From 5edadf5004515a936a5a1749fa1a165a12409b55 Mon Sep 17 00:00:00 2001 From: Polonkai Gergely Date: Tue, 31 Jul 2012 11:54:29 +0200 Subject: [PATCH] Removed vendors from version control Signed-off-by: Gergely Polonkai --- vendor/.gitignore | 2 + vendor/ClassLoader.php | 203 - vendor/autoload.php | 27 - vendor/autoload_classmap.php | 9 - vendor/autoload_namespaces.php | 32 - vendor/composer/ClassLoader.php | 205 - vendor/composer/autoload_classmap.php | 9 - vendor/composer/autoload_namespaces.php | 34 - vendor/composer/installed_dev.json | 3 - vendor/doctrine/common/.travis.yml | 5 - vendor/doctrine/common/LICENSE | 504 -- vendor/doctrine/common/README.md | 12 - vendor/doctrine/common/UPGRADE_TO_2_1 | 39 - vendor/doctrine/common/UPGRADE_TO_2_2 | 61 - vendor/doctrine/common/composer.json | 21 - .../common/doctrine-common-ac6c39b/.gitignore | 4 - .../doctrine-common-ac6c39b/.gitmodules | 3 - .../doctrine-common-ac6c39b/.travis.yml | 5 - .../common/doctrine-common-ac6c39b/LICENSE | 504 -- .../common/doctrine-common-ac6c39b/README.md | 12 - .../doctrine-common-ac6c39b/UPGRADE_TO_2_1 | 39 - .../doctrine-common-ac6c39b/UPGRADE_TO_2_2 | 61 - .../doctrine-common-ac6c39b/build.properties | 6 - .../common/doctrine-common-ac6c39b/build.xml | 59 - .../doctrine-common-ac6c39b/composer.json | 21 - .../Common/Annotations/Annotation.php | 75 - .../Annotations/Annotation/Attribute.php | 47 - .../Annotations/Annotation/Attributes.php | 37 - .../Annotation/IgnoreAnnotation.php | 44 - .../Annotations/Annotation/Required.php | 33 - .../Common/Annotations/Annotation/Target.php | 105 - .../Annotations/AnnotationException.php | 111 - .../Common/Annotations/AnnotationReader.php | 301 - .../Common/Annotations/AnnotationRegistry.php | 129 - .../Common/Annotations/CachedReader.php | 179 - .../Doctrine/Common/Annotations/DocLexer.php | 140 - .../Doctrine/Common/Annotations/DocParser.php | 891 --- .../Common/Annotations/FileCacheReader.php | 209 - .../Common/Annotations/IndexedReader.php | 94 - .../Doctrine/Common/Annotations/PhpParser.php | 203 - .../Doctrine/Common/Annotations/Reader.php | 35 - .../Annotations/SimpleAnnotationReader.php | 152 - .../lib/Doctrine/Common/Cache/ApcCache.php | 97 - .../lib/Doctrine/Common/Cache/ArrayCache.php | 96 - .../lib/Doctrine/Common/Cache/Cache.php | 102 - .../Doctrine/Common/Cache/CacheProvider.php | 188 - .../Doctrine/Common/Cache/MemcacheCache.php | 121 - .../Doctrine/Common/Cache/MemcachedCache.php | 124 - .../Doctrine/Common/Cache/WinCacheCache.php | 92 - .../lib/Doctrine/Common/Cache/XcacheCache.php | 110 - .../Doctrine/Common/Cache/ZendDataCache.php | 84 - .../lib/Doctrine/Common/ClassLoader.php | 262 - .../Common/Collections/ArrayCollection.php | 447 -- .../Common/Collections/Collection.php | 243 - .../lib/Doctrine/Common/CommonException.php | 28 - .../lib/Doctrine/Common/Comparable.php | 47 - .../lib/Doctrine/Common/EventArgs.php | 69 - .../lib/Doctrine/Common/EventManager.php | 136 - .../lib/Doctrine/Common/EventSubscriber.php | 45 - .../lib/Doctrine/Common/Lexer.php | 266 - .../Doctrine/Common/NotifyPropertyChanged.php | 45 - .../Persistence/AbstractManagerRegistry.php | 218 - .../Common/Persistence/ConnectionRegistry.php | 63 - .../Persistence/Event/LifecycleEventArgs.php | 77 - .../Event/LoadClassMetadataEventArgs.php | 76 - .../Persistence/Event/ManagerEventArgs.php | 59 - .../Persistence/Event/OnClearEventArgs.php | 84 - .../Persistence/Event/PreUpdateEventArgs.php | 129 - .../Common/Persistence/ManagerRegistry.php | 112 - .../Mapping/AbstractClassMetadataFactory.php | 359 -- .../Persistence/Mapping/ClassMetadata.php | 165 - .../Mapping/ClassMetadataFactory.php | 74 - .../Mapping/Driver/AnnotationDriver.php | 214 - .../Mapping/Driver/DefaultFileLocator.php | 169 - .../Persistence/Mapping/Driver/FileDriver.php | 178 - .../Mapping/Driver/FileLocator.php | 69 - .../Mapping/Driver/MappingDriver.php | 56 - .../Mapping/Driver/MappingDriverChain.php | 125 - .../Persistence/Mapping/Driver/PHPDriver.php | 70 - .../Mapping/Driver/StaticPHPDriver.php | 131 - .../Mapping/Driver/SymfonyFileLocator.php | 198 - .../Persistence/Mapping/MappingException.php | 57 - .../Persistence/Mapping/ReflectionService.php | 80 - .../Mapping/RuntimeReflectionService.php | 102 - .../Mapping/StaticReflectionService.php | 107 - .../Common/Persistence/ObjectManager.php | 143 - .../Common/Persistence/ObjectManagerAware.php | 49 - .../Common/Persistence/ObjectRepository.php | 78 - .../Common/Persistence/PersistentObject.php | 233 - .../lib/Doctrine/Common/Persistence/Proxy.php | 60 - .../Common/PropertyChangedListener.php | 48 - .../lib/Doctrine/Common/Util/ClassUtils.php | 103 - .../lib/Doctrine/Common/Util/Debug.php | 123 - .../lib/Doctrine/Common/Util/Inflector.php | 72 - .../lib/Doctrine/Common/Version.php | 55 - .../doctrine-common-ac6c39b/phpunit.xml.dist | 31 - .../doctrine-common-ac6c39b/tests/.gitignore | 3 - .../Common/Annotations/AbstractReaderTest.php | 538 -- .../Annotations/AnnotationReaderTest.php | 13 - .../Common/Annotations/CachedReaderTest.php | 56 - .../Tests/Common/Annotations/DocLexerTest.php | 27 - .../Common/Annotations/DocParserTest.php | 1118 ---- .../Annotations/FileCacheReaderTest.php | 40 - .../Annotation/AnnotWithDefaultValue.php | 10 - .../Fixtures/Annotation/Autoload.php | 10 - .../Annotations/Fixtures/Annotation/Route.php | 11 - .../Fixtures/Annotation/Secure.php | 18 - .../Fixtures/Annotation/Template.php | 14 - .../Fixtures/Annotation/Version.php | 11 - .../Fixtures/AnnotationTargetAll.php | 14 - .../Fixtures/AnnotationTargetAnnotation.php | 14 - .../Fixtures/AnnotationTargetClass.php | 15 - .../Fixtures/AnnotationTargetMethod.php | 15 - .../AnnotationTargetPropertyMethod.php | 14 - .../Fixtures/AnnotationWithAttributes.php | 119 - .../AnnotationWithRequiredAttributes.php | 50 - ...ithRequiredAttributesWithoutContructor.php | 24 - .../AnnotationWithTargetSyntaxError.php | 11 - .../Fixtures/AnnotationWithVarType.php | 62 - .../Annotations/Fixtures/ClassDDC1660.php | 30 - ...assWithAnnotationWithTargetSyntaxError.php | 21 - .../ClassWithAnnotationWithVarType.php | 31 - .../ClassWithFullyQualifiedUseStatements.php | 11 - ...lassWithInvalidAnnotationTargetAtClass.php | 17 - ...assWithInvalidAnnotationTargetAtMethod.php | 20 - ...sWithInvalidAnnotationTargetAtProperty.php | 24 - .../ClassWithValidAnnotationTarget.php | 41 - .../Annotations/Fixtures/Controller.php | 300 - ...erentNamespacesPerFileWithClassAsFirst.php | 15 - ...ferentNamespacesPerFileWithClassAsLast.php | 15 - ...EqualNamespacesPerFileWithClassAsFirst.php | 13 - .../EqualNamespacesPerFileWithClassAsLast.php | 12 - ...lobalNamespacesPerFileWithClassAsFirst.php | 12 - ...GlobalNamespacesPerFileWithClassAsLast.php | 12 - .../InvalidAnnotationUsageButIgnoredClass.php | 14 - .../Fixtures/InvalidAnnotationUsageClass.php | 10 - .../Fixtures/MultipleClassesInFile.php | 9 - .../MultipleImportsInUseStatement.php | 10 - .../NamespaceAndClassCommentedOut.php | 20 - .../NamespaceWithClosureDeclaration.php | 15 - .../Fixtures/NamespacedSingleClassLOC1000.php | 1009 ---- .../Annotations/Fixtures/NoAnnotation.php | 5 - .../Fixtures/NonNamespacedClass.php | 10 - .../Fixtures/SingleClassLOC1000.php | 1006 ---- .../Annotations/Fixtures/TestInterface.php | 13 - .../Common/Annotations/PerformanceTest.php | 194 - .../Common/Annotations/PhpParserTest.php | 179 - .../SimpleAnnotationReaderTest.php | 97 - .../Common/Annotations/Ticket/DCOM55Test.php | 65 - .../Annotations/Ticket/DCOM58Entity.php | 8 - .../Common/Annotations/Ticket/DCOM58Test.php | 112 - .../Common/Annotations/TopLevelAnnotation.php | 8 - .../Tests/Common/Cache/ApcCacheTest.php | 20 - .../Tests/Common/Cache/ArrayCacheTest.php | 13 - .../Doctrine/Tests/Common/Cache/CacheTest.php | 87 - .../Tests/Common/Cache/MemcacheCacheTest.php | 38 - .../Tests/Common/Cache/MemcachedCacheTest.php | 40 - .../Tests/Common/Cache/WinCacheCacheTest.php | 20 - .../Tests/Common/Cache/XcacheCacheTest.php | 20 - .../Tests/Common/Cache/ZendDataCacheTest.php | 20 - .../Doctrine/Tests/Common/ClassLoaderTest.php | 45 - .../Common/ClassLoaderTest/ClassA.class.php | 6 - .../Common/ClassLoaderTest/ClassB.class.php | 6 - .../Common/ClassLoaderTest/ClassC.class.php | 6 - .../Tests/Common/ClassLoaderTest/ClassD.php | 5 - .../Common/Collections/CollectionTest.php | 195 - .../Tests/Common/DoctrineExceptionTest.php | 0 .../Tests/Common/EventManagerTest.php | 88 - .../Persistence/Mapping/ChainDriverTest.php | 94 - .../Mapping/ClassMetadataFactoryTest.php | 134 - .../Mapping/DefaultFileLocatorTest.php | 90 - .../Persistence/Mapping/FileDriverTest.php | 142 - .../Persistence/Mapping/PHPDriverTest.php | 18 - .../Mapping/RuntimeReflectionServiceTest.php | 70 - .../Mapping/StaticPHPDriverTest.php | 35 - .../Mapping/StaticReflectionServiceTest.php | 70 - .../Mapping/SymfonyFileLocatorTest.php | 88 - .../Persistence/Mapping/_files/TestEntity.php | 3 - .../Persistence/Mapping/_files/global.yml | 1 - .../Persistence/Mapping/_files/stdClass.yml | 1 - .../Persistence/PersistentObjectTest.php | 247 - .../Tests/Common/Util/ClassUtilsTest.php | 100 - .../Doctrine/Tests/Common/Util/DebugTest.php | 27 - .../tests/Doctrine/Tests/DoctrineTestCase.php | 10 - .../tests/Doctrine/Tests/TestInit.php | 31 - .../tests/NativePhpunitTask.php | 246 - .../tests/README.markdown | 27 - .../Common/Annotations/Annotation.php | 75 - .../Annotations/Annotation/Attribute.php | 47 - .../Annotations/Annotation/Attributes.php | 37 - .../Annotation/IgnoreAnnotation.php | 44 - .../Annotations/Annotation/Required.php | 33 - .../Common/Annotations/Annotation/Target.php | 105 - .../Annotations/AnnotationException.php | 111 - .../Common/Annotations/AnnotationReader.php | 301 - .../Common/Annotations/AnnotationRegistry.php | 129 - .../Common/Annotations/CachedReader.php | 179 - .../Doctrine/Common/Annotations/DocLexer.php | 140 - .../Doctrine/Common/Annotations/DocParser.php | 891 --- .../Common/Annotations/FileCacheReader.php | 209 - .../Common/Annotations/IndexedReader.php | 94 - .../Doctrine/Common/Annotations/PhpParser.php | 203 - .../Doctrine/Common/Annotations/Reader.php | 35 - .../Annotations/SimpleAnnotationReader.php | 152 - .../lib/Doctrine/Common/Cache/ApcCache.php | 97 - .../lib/Doctrine/Common/Cache/ArrayCache.php | 96 - .../lib/Doctrine/Common/Cache/Cache.php | 102 - .../Doctrine/Common/Cache/CacheProvider.php | 188 - .../Doctrine/Common/Cache/MemcacheCache.php | 121 - .../Doctrine/Common/Cache/MemcachedCache.php | 124 - .../Doctrine/Common/Cache/WinCacheCache.php | 92 - .../lib/Doctrine/Common/Cache/XcacheCache.php | 110 - .../Doctrine/Common/Cache/ZendDataCache.php | 84 - .../lib/Doctrine/Common/ClassLoader.php | 262 - .../Common/Collections/ArrayCollection.php | 447 -- .../Common/Collections/Collection.php | 243 - .../lib/Doctrine/Common/CommonException.php | 28 - .../common/lib/Doctrine/Common/Comparable.php | 47 - .../common/lib/Doctrine/Common/EventArgs.php | 69 - .../lib/Doctrine/Common/EventManager.php | 136 - .../lib/Doctrine/Common/EventSubscriber.php | 45 - .../common/lib/Doctrine/Common/Lexer.php | 266 - .../Doctrine/Common/NotifyPropertyChanged.php | 45 - .../Persistence/AbstractManagerRegistry.php | 218 - .../Common/Persistence/ConnectionRegistry.php | 63 - .../Persistence/Event/LifecycleEventArgs.php | 77 - .../Event/LoadClassMetadataEventArgs.php | 76 - .../Persistence/Event/ManagerEventArgs.php | 59 - .../Persistence/Event/OnClearEventArgs.php | 84 - .../Persistence/Event/PreUpdateEventArgs.php | 129 - .../Common/Persistence/ManagerRegistry.php | 112 - .../Mapping/AbstractClassMetadataFactory.php | 359 -- .../Persistence/Mapping/ClassMetadata.php | 165 - .../Mapping/ClassMetadataFactory.php | 74 - .../Mapping/Driver/AnnotationDriver.php | 214 - .../Mapping/Driver/DefaultFileLocator.php | 169 - .../Persistence/Mapping/Driver/FileDriver.php | 178 - .../Mapping/Driver/FileLocator.php | 69 - .../Mapping/Driver/MappingDriver.php | 56 - .../Mapping/Driver/MappingDriverChain.php | 125 - .../Persistence/Mapping/Driver/PHPDriver.php | 70 - .../Mapping/Driver/StaticPHPDriver.php | 131 - .../Mapping/Driver/SymfonyFileLocator.php | 198 - .../Persistence/Mapping/MappingException.php | 57 - .../Persistence/Mapping/ReflectionService.php | 80 - .../Mapping/RuntimeReflectionService.php | 102 - .../Mapping/StaticReflectionService.php | 107 - .../Common/Persistence/ObjectManager.php | 143 - .../Common/Persistence/ObjectManagerAware.php | 49 - .../Common/Persistence/ObjectRepository.php | 78 - .../Common/Persistence/PersistentObject.php | 233 - .../lib/Doctrine/Common/Persistence/Proxy.php | 60 - .../Common/PropertyChangedListener.php | 48 - .../lib/Doctrine/Common/Util/ClassUtils.php | 103 - .../common/lib/Doctrine/Common/Util/Debug.php | 123 - .../lib/Doctrine/Common/Util/Inflector.php | 72 - .../common/lib/Doctrine/Common/Version.php | 55 - vendor/doctrine/common/phpunit.xml.dist | 31 - vendor/doctrine/dbal/.gitignore | 6 - vendor/doctrine/dbal/.gitmodules | 9 - vendor/doctrine/dbal/.travis.yml | 20 - vendor/doctrine/dbal/LICENSE | 504 -- vendor/doctrine/dbal/README.md | 14 - vendor/doctrine/dbal/UPGRADE | 72 - vendor/doctrine/dbal/bin/doctrine-dbal | 4 - vendor/doctrine/dbal/bin/doctrine-dbal.php | 43 - vendor/doctrine/dbal/bin/doctrine.php | 42 - vendor/doctrine/dbal/build.properties | 10 - vendor/doctrine/dbal/build.xml | 91 - vendor/doctrine/dbal/composer.json | 21 - .../Doctrine/DBAL/Cache/ArrayStatement.php | 98 - .../Doctrine/DBAL/Cache/CacheException.php | 37 - .../Doctrine/DBAL/Cache/QueryCacheProfile.php | 131 - .../DBAL/Cache/ResultCacheStatement.php | 255 - .../dbal/lib/Doctrine/DBAL/Configuration.php | 113 - .../dbal/lib/Doctrine/DBAL/Connection.php | 1168 ---- .../lib/Doctrine/DBAL/ConnectionException.php | 54 - .../Connections/MasterSlaveConnection.php | 329 - .../dbal/lib/Doctrine/DBAL/DBALException.php | 88 - .../dbal/lib/Doctrine/DBAL/Driver.php | 72 - .../lib/Doctrine/DBAL/Driver/Connection.php | 42 - .../DBAL/Driver/IBMDB2/DB2Connection.php | 115 - .../Doctrine/DBAL/Driver/IBMDB2/DB2Driver.php | 111 - .../DBAL/Driver/IBMDB2/DB2Exception.php | 27 - .../DBAL/Driver/IBMDB2/DB2Statement.php | 215 - .../Doctrine/DBAL/Driver/Mysqli/Driver.php | 69 - .../DBAL/Driver/Mysqli/MysqliConnection.php | 146 - .../DBAL/Driver/Mysqli/MysqliException.php | 26 - .../DBAL/Driver/Mysqli/MysqliStatement.php | 335 -- .../lib/Doctrine/DBAL/Driver/OCI8/Driver.php | 95 - .../DBAL/Driver/OCI8/OCI8Connection.php | 172 - .../DBAL/Driver/OCI8/OCI8Exception.php | 30 - .../DBAL/Driver/OCI8/OCI8Statement.php | 258 - .../Doctrine/DBAL/Driver/PDOConnection.php | 40 - .../Doctrine/DBAL/Driver/PDOIbm/Driver.php | 126 - .../Doctrine/DBAL/Driver/PDOMySql/Driver.php | 102 - .../Doctrine/DBAL/Driver/PDOOracle/Driver.php | 98 - .../Doctrine/DBAL/Driver/PDOPgSql/Driver.php | 70 - .../Doctrine/DBAL/Driver/PDOSqlite/Driver.php | 116 - .../DBAL/Driver/PDOSqlsrv/Connection.php | 45 - .../Doctrine/DBAL/Driver/PDOSqlsrv/Driver.php | 88 - .../lib/Doctrine/DBAL/Driver/PDOStatement.php | 50 - .../Doctrine/DBAL/Driver/ResultStatement.php | 113 - .../lib/Doctrine/DBAL/Driver/Statement.php | 124 - .../dbal/lib/Doctrine/DBAL/DriverManager.php | 165 - .../DBAL/Event/ConnectionEventArgs.php | 79 - .../DBAL/Event/Listeners/MysqlSessionInit.php | 74 - .../Event/Listeners/OracleSessionInit.php | 79 - .../DBAL/Event/Listeners/SQLSessionInit.php | 63 - .../SchemaAlterTableAddColumnEventArgs.php | 114 - .../SchemaAlterTableChangeColumnEventArgs.php | 114 - .../DBAL/Event/SchemaAlterTableEventArgs.php | 99 - .../SchemaAlterTableRemoveColumnEventArgs.php | 114 - .../SchemaAlterTableRenameColumnEventArgs.php | 129 - .../Event/SchemaColumnDefinitionEventArgs.php | 137 - .../SchemaCreateTableColumnEventArgs.php | 114 - .../DBAL/Event/SchemaCreateTableEventArgs.php | 128 - .../DBAL/Event/SchemaDropTableEventArgs.php | 98 - .../Doctrine/DBAL/Event/SchemaEventArgs.php | 56 - .../Event/SchemaIndexDefinitionEventArgs.php | 122 - .../dbal/lib/Doctrine/DBAL/Events.php | 48 - .../dbal/lib/Doctrine/DBAL/LockMode.php | 42 - .../lib/Doctrine/DBAL/Logging/DebugStack.php | 67 - .../Doctrine/DBAL/Logging/EchoSQLLogger.php | 61 - .../lib/Doctrine/DBAL/Logging/LoggerChain.php | 64 - .../lib/Doctrine/DBAL/Logging/SQLLogger.php | 54 - .../DBAL/Platforms/AbstractPlatform.php | 2645 --------- .../Doctrine/DBAL/Platforms/DB2Platform.php | 587 -- .../DBAL/Platforms/Keywords/DB2Keywords.php | 438 -- .../DBAL/Platforms/Keywords/KeywordList.php | 63 - .../DBAL/Platforms/Keywords/MsSQLKeywords.php | 243 - .../DBAL/Platforms/Keywords/MySQLKeywords.php | 268 - .../Platforms/Keywords/OracleKeywords.php | 156 - .../Platforms/Keywords/PostgreSQLKeywords.php | 131 - .../Keywords/ReservedKeywordsValidator.php | 116 - .../Platforms/Keywords/SQLiteKeywords.php | 164 - .../Doctrine/DBAL/Platforms/MySqlPlatform.php | 768 --- .../DBAL/Platforms/OraclePlatform.php | 840 --- .../DBAL/Platforms/PostgreSqlPlatform.php | 792 --- .../DBAL/Platforms/SQLServer2005Platform.php | 52 - .../DBAL/Platforms/SQLServer2008Platform.php | 90 - .../DBAL/Platforms/SQLServerPlatform.php | 865 --- .../DBAL/Platforms/SqlitePlatform.php | 519 -- .../Doctrine/DBAL/Portability/Connection.php | 113 - .../Doctrine/DBAL/Portability/Statement.php | 191 - .../Query/Expression/CompositeExpression.php | 130 - .../Query/Expression/ExpressionBuilder.php | 264 - .../lib/Doctrine/DBAL/Query/QueryBuilder.php | 1091 ---- .../Doctrine/DBAL/Query/QueryException.php | 40 - .../dbal/lib/Doctrine/DBAL/README.markdown | 0 .../dbal/lib/Doctrine/DBAL/SQLParserUtils.php | 173 - .../Doctrine/DBAL/Schema/AbstractAsset.php | 204 - .../DBAL/Schema/AbstractSchemaManager.php | 890 --- .../dbal/lib/Doctrine/DBAL/Schema/Column.php | 423 -- .../lib/Doctrine/DBAL/Schema/ColumnDiff.php | 58 - .../lib/Doctrine/DBAL/Schema/Comparator.php | 399 -- .../lib/Doctrine/DBAL/Schema/Constraint.php | 38 - .../Doctrine/DBAL/Schema/DB2SchemaManager.php | 214 - .../DBAL/Schema/ForeignKeyConstraint.php | 164 - .../dbal/lib/Doctrine/DBAL/Schema/Index.php | 196 - .../DBAL/Schema/MySqlSchemaManager.php | 211 - .../DBAL/Schema/OracleSchemaManager.php | 286 - .../DBAL/Schema/PostgreSqlSchemaManager.php | 359 -- .../DBAL/Schema/SQLServerSchemaManager.php | 247 - .../dbal/lib/Doctrine/DBAL/Schema/Schema.php | 367 -- .../lib/Doctrine/DBAL/Schema/SchemaConfig.php | 98 - .../lib/Doctrine/DBAL/Schema/SchemaDiff.php | 176 - .../Doctrine/DBAL/Schema/SchemaException.php | 126 - .../lib/Doctrine/DBAL/Schema/Sequence.php | 87 - .../DBAL/Schema/SqliteSchemaManager.php | 190 - .../dbal/lib/Doctrine/DBAL/Schema/Table.php | 645 -- .../lib/Doctrine/DBAL/Schema/TableDiff.php | 136 - .../dbal/lib/Doctrine/DBAL/Schema/View.php | 53 - .../Visitor/CreateSchemaSqlCollector.php | 147 - .../Schema/Visitor/DropSchemaSqlCollector.php | 159 - .../Doctrine/DBAL/Schema/Visitor/Graphviz.php | 151 - .../Schema/Visitor/RemoveNamespacedAssets.php | 113 - .../Doctrine/DBAL/Schema/Visitor/Visitor.php | 75 - .../dbal/lib/Doctrine/DBAL/Statement.php | 247 - .../Tools/Console/Command/ImportCommand.php | 124 - .../Console/Command/ReservedWordsCommand.php | 133 - .../Tools/Console/Command/RunSqlCommand.php | 87 - .../Tools/Console/Helper/ConnectionHelper.php | 74 - .../lib/Doctrine/DBAL/Types/ArrayType.php | 57 - .../lib/Doctrine/DBAL/Types/BigIntType.php | 48 - .../dbal/lib/Doctrine/DBAL/Types/BlobType.php | 67 - .../lib/Doctrine/DBAL/Types/BooleanType.php | 57 - .../DBAL/Types/ConversionException.php | 65 - .../lib/Doctrine/DBAL/Types/DateTimeType.php | 59 - .../Doctrine/DBAL/Types/DateTimeTzType.php | 79 - .../dbal/lib/Doctrine/DBAL/Types/DateType.php | 59 - .../lib/Doctrine/DBAL/Types/DecimalType.php | 45 - .../lib/Doctrine/DBAL/Types/FloatType.php | 54 - .../lib/Doctrine/DBAL/Types/IntegerType.php | 53 - .../lib/Doctrine/DBAL/Types/ObjectType.php | 57 - .../lib/Doctrine/DBAL/Types/SmallIntType.php | 52 - .../lib/Doctrine/DBAL/Types/StringType.php | 50 - .../dbal/lib/Doctrine/DBAL/Types/TextType.php | 56 - .../dbal/lib/Doctrine/DBAL/Types/TimeType.php | 68 - .../dbal/lib/Doctrine/DBAL/Types/Type.php | 274 - .../Doctrine/DBAL/Types/VarDateTimeType.php | 60 - .../dbal/lib/Doctrine/DBAL/Version.php | 55 - vendor/doctrine/dbal/phpunit.xml.dist | 51 - vendor/doctrine/dbal/run-all.sh | 21 - vendor/doctrine/dbal/tests/.gitignore | 3 - .../Doctrine/Tests/DBAL/ConnectionTest.php | 148 - .../DBAL/Driver/OCI8/OCI8StatementTest.php | 82 - .../Doctrine/Tests/DBAL/DriverManagerTest.php | 117 - .../DBAL/Events/MysqlSessionInitTest.php | 33 - .../DBAL/Events/OracleSessionInitTest.php | 33 - .../Tests/DBAL/Events/SQLSessionInitTest.php | 35 - .../Tests/DBAL/Functional/BlobTest.php | 83 - .../Tests/DBAL/Functional/ConnectionTest.php | 219 - .../Tests/DBAL/Functional/DataAccessTest.php | 477 -- .../Tests/DBAL/Functional/LoggingTest.php | 52 - .../Functional/MasterSlaveConnectionTest.php | 82 - .../DBAL/Functional/ModifyLimitQueryTest.php | 114 - .../DBAL/Functional/NamedParametersTest.php | 166 - .../Tests/DBAL/Functional/PortabilityTest.php | 97 - .../Tests/DBAL/Functional/ResultCacheTest.php | 199 - .../Schema/Db2SchemaManagerTest.php | 12 - .../Schema/MySqlSchemaManagerTest.php | 50 - .../Schema/OracleSchemaManagerTest.php | 39 - .../Schema/PostgreSqlSchemaManagerTest.php | 228 - .../Schema/SQLServerSchemaManagerTest.php | 37 - .../SchemaManagerFunctionalTestCase.php | 642 -- .../Schema/SqliteSchemaManagerTest.php | 46 - .../DBAL/Functional/TemporaryTableTest.php | 102 - .../DBAL/Functional/Ticket/DBAL168Test.php | 27 - .../DBAL/Functional/Ticket/DBAL202Test.php | 48 - .../DBAL/Functional/TypeConversionTest.php | 101 - .../Tests/DBAL/Functional/WriteTest.php | 137 - .../Tests/DBAL/Mocks/MockPlatform.php | 49 - .../Platforms/AbstractPlatformTestCase.php | 388 -- .../DBAL/Platforms/MySqlPlatformTest.php | 229 - .../DBAL/Platforms/OraclePlatformTest.php | 227 - .../DBAL/Platforms/PostgreSqlPlatformTest.php | 230 - .../ReservedKeywordsValidatorTest.php | 47 - .../DBAL/Platforms/SQLServerPlatformTest.php | 191 - .../DBAL/Platforms/SqlitePlatformTest.php | 134 - .../Expression/CompositeExpressionTest.php | 82 - .../Expression/ExpressionBuilderTest.php | 201 - .../Tests/DBAL/Query/QueryBuilderTest.php | 572 -- .../Tests/DBAL/SQLParserUtilsTest.php | 214 - .../Doctrine/Tests/DBAL/Schema/ColumnTest.php | 114 - .../Tests/DBAL/Schema/ComparatorTest.php | 787 --- .../Doctrine/Tests/DBAL/Schema/IndexTest.php | 99 - .../DBAL/Schema/MySqlSchemaManagerTest.php | 76 - .../DBAL/Schema/Platforms/MySQLSchemaTest.php | 67 - .../Tests/DBAL/Schema/SchemaDiffTest.php | 109 - .../Doctrine/Tests/DBAL/Schema/SchemaTest.php | 224 - .../Doctrine/Tests/DBAL/Schema/TableTest.php | 500 -- .../Visitor/RemoveNamespacedAssetsTest.php | 77 - .../Schema/Visitor/SchemaSqlCollectorTest.php | 80 - .../Doctrine/Tests/DBAL/Types/ArrayTest.php | 61 - .../Doctrine/Tests/DBAL/Types/BlobTest.php | 26 - .../Doctrine/Tests/DBAL/Types/BooleanTest.php | 36 - .../Doctrine/Tests/DBAL/Types/DateTest.php | 75 - .../Tests/DBAL/Types/DateTimeTest.php | 50 - .../Tests/DBAL/Types/DateTimeTzTest.php | 50 - .../Doctrine/Tests/DBAL/Types/DecimalTest.php | 31 - .../Doctrine/Tests/DBAL/Types/FloatTest.php | 39 - .../Doctrine/Tests/DBAL/Types/IntegerTest.php | 32 - .../Doctrine/Tests/DBAL/Types/ObjectTest.php | 56 - .../Tests/DBAL/Types/SmallIntTest.php | 32 - .../Doctrine/Tests/DBAL/Types/StringTest.php | 49 - .../Doctrine/Tests/DBAL/Types/TimeTest.php | 47 - .../Tests/DBAL/Types/VarDateTimeTest.php | 62 - .../tests/Doctrine/Tests/DBAL/UtilTest.php | 78 - .../Doctrine/Tests/DbalFunctionalTestCase.php | 77 - .../tests/Doctrine/Tests/DbalTestCase.php | 10 - .../tests/Doctrine/Tests/DoctrineTestCase.php | 10 - .../Doctrine/Tests/Mocks/ConnectionMock.php | 92 - .../Tests/Mocks/DatabasePlatformMock.php | 98 - .../Tests/Mocks/DriverConnectionMock.php | 17 - .../tests/Doctrine/Tests/Mocks/DriverMock.php | 72 - .../Tests/Mocks/HydratorMockStatement.php | 101 - .../Tests/Mocks/SchemaManagerMock.php | 13 - .../tests/Doctrine/Tests/Mocks/TaskMock.php | 81 - .../dbal/tests/Doctrine/Tests/TestInit.php | 22 - .../dbal/tests/Doctrine/Tests/TestUtil.php | 131 - vendor/doctrine/dbal/tests/README.markdown | 25 - .../dbal/tests/travis/mysql.travis.xml | 32 - .../dbal/tests/travis/pgsql.travis.xml | 29 - .../dbal/tests/travis/sqlite.travis.xml | 14 - .../Doctrine/Bundle/DoctrineBundle/.gitignore | 4 - .../Bundle/DoctrineBundle/.travis.yml | 10 - .../Command/CreateDatabaseDoctrineCommand.php | 82 - .../Command/DoctrineCommand.php | 66 - .../Command/DropDatabaseDoctrineCommand.php | 94 - .../GenerateEntitiesDoctrineCommand.php | 140 - .../Command/ImportMappingDoctrineCommand.php | 132 - .../ClearMetadataCacheDoctrineCommand.php | 64 - .../Proxy/ClearQueryCacheDoctrineCommand.php | 64 - .../Proxy/ClearResultCacheDoctrineCommand.php | 64 - .../Proxy/ConvertMappingDoctrineCommand.php | 80 - .../Proxy/CreateSchemaDoctrineCommand.php | 69 - .../Command/Proxy/DoctrineCommandHelper.php | 55 - .../Proxy/DropSchemaDoctrineCommand.php | 69 - ...nsureProductionSettingsDoctrineCommand.php | 64 - .../Command/Proxy/InfoDoctrineCommand.php | 63 - .../Command/Proxy/RunDqlDoctrineCommand.php | 69 - .../Command/Proxy/RunSqlDoctrineCommand.php | 59 - .../Proxy/UpdateSchemaDoctrineCommand.php | 73 - .../Command/Proxy/ValidateSchemaCommand.php | 65 - .../DoctrineBundle/ConnectionFactory.php | 88 - .../Controller/ProfilerController.php | 68 - .../DependencyInjection/Configuration.php | 420 -- .../DependencyInjection/DoctrineExtension.php | 460 -- .../Bundle/DoctrineBundle/DoctrineBundle.php | 134 - .../Doctrine/Bundle/DoctrineBundle/LICENSE | 13 - .../DoctrineBundle/ManagerConfigurator.php | 66 - .../Mapping/ClassMetadataCollection.php | 75 - .../Mapping/DisconnectedMetadataFactory.php | 29 - .../Mapping/MetadataFactory.php | 211 - .../Doctrine/Bundle/DoctrineBundle/README.md | 56 - .../Bundle/DoctrineBundle/Registry.php | 164 - .../DoctrineBundle/Resources/config/dbal.xml | 62 - .../DoctrineBundle/Resources/config/orm.xml | 105 - .../Resources/config/schema/doctrine-1.0.xsd | 192 - .../Resources/doc/configuration.rst | 310 - .../Resources/doc/installation.rst | 43 - .../Resources/views/Collector/db.html.twig | 122 - .../views/Collector/explain.html.twig | 20 - .../DoctrineBundle/Tests/BundleTest.php | 47 - .../DoctrineBundle/Tests/ContainerTest.php | 59 - .../AbstractDoctrineExtensionTest.php | 891 --- .../AnnotationsBundle/AnnotationsBundle.php | 21 - .../Bundles/AnnotationsBundle/Entity/Test.php | 19 - .../AnnotationsBundle/AnnotationsBundle.php | 21 - .../Vendor/AnnotationsBundle/Entity/Test.php | 19 - .../Bundles/XmlBundle/Entity/Test.php | 19 - .../Resources/config/doctrine/Test.orm.xml | 0 .../Fixtures/Bundles/XmlBundle/XmlBundle.php | 21 - .../Bundles/YamlBundle/Entity/Test.php | 20 - .../Resources/config/doctrine/Test.orm.yml | 5 - .../Bundles/YamlBundle/YamlBundle.php | 21 - .../Fixtures/config/xml/dbal_logging.xml | 29 - .../config/xml/dbal_schema_filter.xml | 12 - .../xml/dbal_service_multiple_connections.xml | 33 - .../xml/dbal_service_single_connection.xml | 12 - ...service_single_master_slave_connection.xml | 14 - .../Fixtures/config/xml/dbal_types.xml | 15 - .../Fixtures/config/xml/orm_filters.xml | 18 - .../Fixtures/config/xml/orm_functions.xml | 25 - .../config/xml/orm_hydration_mode.xml | 21 - .../Fixtures/config/xml/orm_imports.xml | 16 - .../config/xml/orm_imports_import.xml | 23 - .../xml/orm_multiple_em_bundle_mappings.xml | 27 - .../config/xml/orm_namingstrategy.xml | 23 - .../Fixtures/config/xml/orm_proxy.xml | 12 - .../config/xml/orm_resolve_target_entity.xml | 18 - .../orm_service_multiple_entity_managers.xml | 40 - ...m_service_simple_single_entity_manager.xml | 26 - .../xml/orm_service_single_entity_manager.xml | 39 - .../xml/orm_single_em_bundle_mappings.xml | 23 - .../xml/orm_single_em_dql_functions.xml | 20 - .../Fixtures/config/yml/dbal_logging.yml | 13 - .../config/yml/dbal_schema_filter.yml | 3 - .../yml/dbal_service_multiple_connections.yml | 18 - .../yml/dbal_service_single_connection.yml | 6 - ...service_single_master_slave_connection.yml | 12 - .../Fixtures/config/yml/dbal_types.yml | 7 - .../Fixtures/config/yml/orm_filters.yml | 12 - .../Fixtures/config/yml/orm_functions.yml | 19 - .../config/yml/orm_hydration_mode.yml | 14 - .../Fixtures/config/yml/orm_imports.yml | 6 - .../config/yml/orm_imports_import.yml | 15 - .../yml/orm_multiple_em_bundle_mappings.yml | 23 - .../config/yml/orm_namingstrategy.yml | 18 - .../config/yml/orm_resolve_target_entity.yml | 10 - .../orm_service_multiple_entity_managers.yml | 34 - ...m_service_simple_single_entity_manager.yml | 19 - .../yml/orm_service_single_entity_manager.yml | 27 - .../yml/orm_single_em_bundle_mappings.yml | 18 - .../yml/orm_single_em_dql_functions.yml | 11 - .../TestDatetimeFunction.php | 32 - .../Tests/DependencyInjection/TestFilter.php | 30 - .../TestNumericFunction.php | 32 - .../TestStringFunction.php | 32 - .../Tests/DependencyInjection/TestType.php | 30 - .../DependencyInjection/XMLSchemaTest.php | 71 - .../XmlDoctrineExtensionTest.php | 28 - .../YamlDoctrineExtensionTest.php | 28 - .../Tests/Mapping/MetadataFactoryTest.php | 41 - .../DoctrineBundle/Tests/RegistryTest.php | 149 - .../Bundle/DoctrineBundle/Tests/TestCase.php | 83 - .../Bundle/DoctrineBundle/Tests/bootstrap.php | 8 - .../Bundle/DoctrineBundle/composer.json | 46 - .../Bundle/DoctrineBundle/phpunit.xml.dist | 35 - .../Doctrine/Bundle/MigrationsBundle | 1 - vendor/doctrine/migrations | 1 - vendor/doctrine/orm/.gitignore | 11 - vendor/doctrine/orm/.gitmodules | 15 - vendor/doctrine/orm/.travis.yml | 19 - vendor/doctrine/orm/LICENSE | 504 -- vendor/doctrine/orm/README.markdown | 18 - vendor/doctrine/orm/UPGRADE_TO_2_0 | 240 - vendor/doctrine/orm/UPGRADE_TO_2_1 | 25 - vendor/doctrine/orm/UPGRADE_TO_2_2 | 81 - vendor/doctrine/orm/UPGRADE_TO_ALPHA3 | 35 - vendor/doctrine/orm/UPGRADE_TO_ALPHA4 | 36 - vendor/doctrine/orm/bin/doctrine | 4 - vendor/doctrine/orm/bin/doctrine.bat | 9 - vendor/doctrine/orm/bin/doctrine.php | 50 - vendor/doctrine/orm/build.properties | 11 - vendor/doctrine/orm/build.properties.dev | 16 - vendor/doctrine/orm/build.xml | 114 - vendor/doctrine/orm/composer.json | 23 - vendor/doctrine/orm/doctrine-mapping.xsd | 409 -- .../orm/lib/Doctrine/ORM/AbstractQuery.php | 820 --- .../orm/lib/Doctrine/ORM/Configuration.php | 573 -- .../orm/lib/Doctrine/ORM/EntityManager.php | 834 --- .../Doctrine/ORM/EntityNotFoundException.php | 34 - .../orm/lib/Doctrine/ORM/EntityRepository.php | 272 - .../Doctrine/ORM/Event/LifecycleEventArgs.php | 77 - .../ORM/Event/LoadClassMetadataEventArgs.php | 76 - .../Doctrine/ORM/Event/OnClearEventArgs.php | 84 - .../Doctrine/ORM/Event/OnFlushEventArgs.php | 86 - .../Doctrine/ORM/Event/PostFlushEventArgs.php | 61 - .../Doctrine/ORM/Event/PreFlushEventArgs.php | 53 - .../Doctrine/ORM/Event/PreUpdateEventArgs.php | 131 - .../doctrine/orm/lib/Doctrine/ORM/Events.php | 148 - .../Doctrine/ORM/Id/AbstractIdGenerator.php | 48 - .../lib/Doctrine/ORM/Id/AssignedGenerator.php | 71 - .../lib/Doctrine/ORM/Id/IdentityGenerator.php | 59 - .../lib/Doctrine/ORM/Id/SequenceGenerator.php | 106 - .../lib/Doctrine/ORM/Id/TableGenerator.php | 81 - .../ORM/Internal/CommitOrderCalculator.php | 118 - .../Internal/Hydration/AbstractHydrator.php | 389 -- .../ORM/Internal/Hydration/ArrayHydrator.php | 289 - .../Internal/Hydration/HydrationException.php | 26 - .../ORM/Internal/Hydration/IterableResult.php | 104 - .../ORM/Internal/Hydration/ObjectHydrator.php | 536 -- .../ORM/Internal/Hydration/ScalarHydrator.php | 57 - .../Hydration/SimpleObjectHydrator.php | 183 - .../Hydration/SingleScalarHydrator.php | 56 - .../lib/Doctrine/ORM/Mapping/Annotation.php | 24 - .../Mapping/Builder/AssociationBuilder.php | 167 - .../Mapping/Builder/ClassMetadataBuilder.php | 470 -- .../ORM/Mapping/Builder/FieldBuilder.php | 223 - .../Builder/ManyToManyAssociationBuilder.php | 86 - .../Builder/OneToManyAssociationBuilder.php | 62 - .../ORM/Mapping/ChangeTrackingPolicy.php | 30 - .../Doctrine/ORM/Mapping/ClassMetadata.php | 44 - .../ORM/Mapping/ClassMetadataFactory.php | 593 -- .../ORM/Mapping/ClassMetadataInfo.php | 2340 -------- .../orm/lib/Doctrine/ORM/Mapping/Column.php | 46 - .../ORM/Mapping/DiscriminatorColumn.php | 36 - .../Doctrine/ORM/Mapping/DiscriminatorMap.php | 30 - .../ORM/Mapping/Driver/AbstractFileDriver.php | 213 - .../ORM/Mapping/Driver/AnnotationDriver.php | 599 -- .../ORM/Mapping/Driver/DatabaseDriver.php | 417 -- .../Mapping/Driver/DoctrineAnnotations.php | 54 - .../Doctrine/ORM/Mapping/Driver/Driver.php | 59 - .../ORM/Mapping/Driver/DriverChain.php | 126 - .../Doctrine/ORM/Mapping/Driver/PHPDriver.php | 69 - .../Mapping/Driver/SimplifiedXmlDriver.php | 176 - .../Mapping/Driver/SimplifiedYamlDriver.php | 181 - .../ORM/Mapping/Driver/StaticPHPDriver.php | 138 - .../Doctrine/ORM/Mapping/Driver/XmlDriver.php | 536 -- .../ORM/Mapping/Driver/YamlDriver.php | 512 -- .../ORM/Mapping/ElementCollection.php | 31 - .../orm/lib/Doctrine/ORM/Mapping/Entity.php | 32 - .../Doctrine/ORM/Mapping/GeneratedValue.php | 30 - .../ORM/Mapping/HasLifecycleCallbacks.php | 28 - .../orm/lib/Doctrine/ORM/Mapping/Id.php | 28 - .../orm/lib/Doctrine/ORM/Mapping/Index.php | 32 - .../Doctrine/ORM/Mapping/InheritanceType.php | 30 - .../lib/Doctrine/ORM/Mapping/JoinColumn.php | 42 - .../lib/Doctrine/ORM/Mapping/JoinColumns.php | 30 - .../lib/Doctrine/ORM/Mapping/JoinTable.php | 36 - .../lib/Doctrine/ORM/Mapping/ManyToMany.php | 42 - .../lib/Doctrine/ORM/Mapping/ManyToOne.php | 36 - .../Doctrine/ORM/Mapping/MappedSuperclass.php | 30 - .../Doctrine/ORM/Mapping/MappingException.php | 332 -- .../lib/Doctrine/ORM/Mapping/NamedQueries.php | 30 - .../lib/Doctrine/ORM/Mapping/NamedQuery.php | 32 - .../lib/Doctrine/ORM/Mapping/OneToMany.php | 40 - .../orm/lib/Doctrine/ORM/Mapping/OneToOne.php | 40 - .../orm/lib/Doctrine/ORM/Mapping/OrderBy.php | 30 - .../orm/lib/Doctrine/ORM/Mapping/PostLoad.php | 28 - .../lib/Doctrine/ORM/Mapping/PostPersist.php | 28 - .../lib/Doctrine/ORM/Mapping/PostRemove.php | 28 - .../lib/Doctrine/ORM/Mapping/PostUpdate.php | 28 - .../orm/lib/Doctrine/ORM/Mapping/PreFlush.php | 28 - .../lib/Doctrine/ORM/Mapping/PrePersist.php | 28 - .../lib/Doctrine/ORM/Mapping/PreRemove.php | 28 - .../lib/Doctrine/ORM/Mapping/PreUpdate.php | 28 - .../ORM/Mapping/SequenceGenerator.php | 34 - .../orm/lib/Doctrine/ORM/Mapping/Table.php | 36 - .../Doctrine/ORM/Mapping/UniqueConstraint.php | 32 - .../orm/lib/Doctrine/ORM/Mapping/Version.php | 28 - .../orm/lib/Doctrine/ORM/NativeQuery.php | 76 - .../lib/Doctrine/ORM/NoResultException.php | 34 - .../Doctrine/ORM/NonUniqueResultException.php | 28 - .../orm/lib/Doctrine/ORM/ORMException.php | 152 - .../ORM/ORMInvalidArgumentException.php | 107 - .../Doctrine/ORM/OptimisticLockException.php | 64 - .../lib/Doctrine/ORM/PersistentCollection.php | 792 --- .../AbstractCollectionPersister.php | 207 - .../AbstractEntityInheritancePersister.php | 83 - .../ORM/Persisters/BasicEntityPersister.php | 1617 ----- .../Persisters/ElementCollectionPersister.php | 33 - .../Persisters/JoinedSubclassPersister.php | 487 -- .../ORM/Persisters/ManyToManyPersister.php | 425 -- .../ORM/Persisters/OneToManyPersister.php | 212 - .../ORM/Persisters/SingleTablePersister.php | 146 - .../ORM/Persisters/UnionSubclassPersister.php | 8 - .../Doctrine/ORM/PessimisticLockException.php | 40 - .../orm/lib/Doctrine/ORM/Proxy/Autoloader.php | 78 - .../orm/lib/Doctrine/ORM/Proxy/Proxy.php | 30 - .../lib/Doctrine/ORM/Proxy/ProxyException.php | 51 - .../lib/Doctrine/ORM/Proxy/ProxyFactory.php | 414 -- .../doctrine/orm/lib/Doctrine/ORM/Query.php | 615 -- .../Doctrine/ORM/Query/AST/ASTException.php | 13 - .../ORM/Query/AST/AggregateExpression.php | 52 - .../ORM/Query/AST/ArithmeticExpression.php | 54 - .../ORM/Query/AST/ArithmeticFactor.php | 67 - .../Doctrine/ORM/Query/AST/ArithmeticTerm.php | 48 - .../ORM/Query/AST/BetweenExpression.php | 54 - .../ORM/Query/AST/CoalesceExpression.php | 47 - .../Query/AST/CollectionMemberExpression.php | 52 - .../ORM/Query/AST/ComparisonExpression.php | 57 - .../ORM/Query/AST/ConditionalExpression.php | 48 - .../ORM/Query/AST/ConditionalFactor.php | 49 - .../ORM/Query/AST/ConditionalPrimary.php | 54 - .../ORM/Query/AST/ConditionalTerm.php | 48 - .../Doctrine/ORM/Query/AST/DeleteClause.php | 50 - .../ORM/Query/AST/DeleteStatement.php | 49 - .../EmptyCollectionComparisonExpression.php | 50 - .../ORM/Query/AST/ExistsExpression.php | 50 - .../lib/Doctrine/ORM/Query/AST/FromClause.php | 45 - .../ORM/Query/AST/Functions/AbsFunction.php | 62 - .../Query/AST/Functions/BitAndFunction.php | 63 - .../ORM/Query/AST/Functions/BitOrFunction.php | 63 - .../Query/AST/Functions/ConcatFunction.php | 67 - .../AST/Functions/CurrentDateFunction.php | 54 - .../AST/Functions/CurrentTimeFunction.php | 54 - .../Functions/CurrentTimestampFunction.php | 54 - .../Query/AST/Functions/DateAddFunction.php | 71 - .../Query/AST/Functions/DateDiffFunction.php | 58 - .../Query/AST/Functions/DateSubFunction.php | 58 - .../ORM/Query/AST/Functions/FunctionNode.php | 52 - .../Query/AST/Functions/IdentityFunction.php | 68 - .../Query/AST/Functions/LengthFunction.php | 62 - .../Query/AST/Functions/LocateFunction.php | 81 - .../ORM/Query/AST/Functions/LowerFunction.php | 62 - .../ORM/Query/AST/Functions/ModFunction.php | 68 - .../ORM/Query/AST/Functions/SizeFunction.php | 122 - .../ORM/Query/AST/Functions/SqrtFunction.php | 61 - .../Query/AST/Functions/SubstringFunction.php | 82 - .../ORM/Query/AST/Functions/TrimFunction.php | 100 - .../ORM/Query/AST/Functions/UpperFunction.php | 62 - .../ORM/Query/AST/GeneralCaseExpression.php | 48 - .../Doctrine/ORM/Query/AST/GroupByClause.php | 48 - .../Doctrine/ORM/Query/AST/HavingClause.php | 48 - .../AST/IdentificationVariableDeclaration.php | 52 - .../Doctrine/ORM/Query/AST/InExpression.php | 52 - .../lib/Doctrine/ORM/Query/AST/IndexBy.php | 48 - .../Doctrine/ORM/Query/AST/InputParameter.php | 58 - .../ORM/Query/AST/InstanceOfExpression.php | 50 - .../orm/lib/Doctrine/ORM/Query/AST/Join.php | 58 - .../AST/JoinAssociationPathExpression.php | 50 - .../ORM/Query/AST/JoinVariableDeclaration.php | 50 - .../Doctrine/ORM/Query/AST/LikeExpression.php | 53 - .../lib/Doctrine/ORM/Query/AST/Literal.php | 24 - .../orm/lib/Doctrine/ORM/Query/AST/Node.php | 98 - .../Query/AST/NullComparisonExpression.php | 50 - .../ORM/Query/AST/NullIfExpression.php | 49 - .../Doctrine/ORM/Query/AST/OrderByClause.php | 48 - .../Doctrine/ORM/Query/AST/OrderByItem.php | 59 - .../ORM/Query/AST/PartialObjectExpression.php | 15 - .../Doctrine/ORM/Query/AST/PathExpression.php | 58 - .../ORM/Query/AST/QuantifiedExpression.php | 68 - .../Query/AST/RangeVariableDeclaration.php | 50 - .../Doctrine/ORM/Query/AST/SelectClause.php | 50 - .../ORM/Query/AST/SelectExpression.php | 53 - .../ORM/Query/AST/SelectStatement.php | 53 - .../Query/AST/SimpleArithmeticExpression.php | 48 - .../ORM/Query/AST/SimpleCaseExpression.php | 50 - .../ORM/Query/AST/SimpleSelectClause.php | 50 - .../ORM/Query/AST/SimpleSelectExpression.php | 50 - .../ORM/Query/AST/SimpleWhenClause.php | 48 - .../lib/Doctrine/ORM/Query/AST/Subselect.php | 54 - .../ORM/Query/AST/SubselectFromClause.php | 48 - .../Doctrine/ORM/Query/AST/UpdateClause.php | 52 - .../lib/Doctrine/ORM/Query/AST/UpdateItem.php | 53 - .../ORM/Query/AST/UpdateStatement.php | 49 - .../lib/Doctrine/ORM/Query/AST/WhenClause.php | 48 - .../Doctrine/ORM/Query/AST/WhereClause.php | 48 - .../ORM/Query/Exec/AbstractSqlExecutor.php | 70 - .../Query/Exec/MultiTableDeleteExecutor.php | 124 - .../Query/Exec/MultiTableUpdateExecutor.php | 178 - .../ORM/Query/Exec/SingleSelectExecutor.php | 48 - .../Exec/SingleTableDeleteUpdateExecutor.php | 53 - .../orm/lib/Doctrine/ORM/Query/Expr.php | 595 -- .../orm/lib/Doctrine/ORM/Query/Expr/Andx.php | 44 - .../orm/lib/Doctrine/ORM/Query/Expr/Base.php | 89 - .../Doctrine/ORM/Query/Expr/Comparison.php | 59 - .../lib/Doctrine/ORM/Query/Expr/Composite.php | 68 - .../orm/lib/Doctrine/ORM/Query/Expr/From.php | 88 - .../orm/lib/Doctrine/ORM/Query/Expr/Func.php | 50 - .../lib/Doctrine/ORM/Query/Expr/GroupBy.php | 39 - .../orm/lib/Doctrine/ORM/Query/Expr/Join.php | 67 - .../lib/Doctrine/ORM/Query/Expr/Literal.php | 9 - .../orm/lib/Doctrine/ORM/Query/Expr/Math.php | 66 - .../lib/Doctrine/ORM/Query/Expr/OrderBy.php | 66 - .../orm/lib/Doctrine/ORM/Query/Expr/Orx.php | 44 - .../lib/Doctrine/ORM/Query/Expr/Select.php | 42 - .../Doctrine/ORM/Query/Filter/SQLFilter.php | 122 - .../Doctrine/ORM/Query/FilterCollection.php | 198 - .../orm/lib/Doctrine/ORM/Query/Lexer.php | 208 - .../ORM/Query/ParameterTypeInferer.php | 72 - .../orm/lib/Doctrine/ORM/Query/Parser.php | 3093 ---------- .../lib/Doctrine/ORM/Query/ParserResult.php | 141 - .../orm/lib/Doctrine/ORM/Query/Printer.php | 95 - .../lib/Doctrine/ORM/Query/QueryException.php | 154 - .../Doctrine/ORM/Query/ResultSetMapping.php | 485 -- .../ORM/Query/ResultSetMappingBuilder.php | 109 - .../orm/lib/Doctrine/ORM/Query/SqlWalker.php | 2159 ------- .../orm/lib/Doctrine/ORM/Query/TreeWalker.php | 411 -- .../Doctrine/ORM/Query/TreeWalkerAdapter.php | 445 -- .../Doctrine/ORM/Query/TreeWalkerChain.php | 664 --- .../orm/lib/Doctrine/ORM/QueryBuilder.php | 1115 ---- .../orm/lib/Doctrine/ORM/README.markdown | 0 .../Command/ClearCache/MetadataCommand.php | 104 - .../Command/ClearCache/QueryCommand.php | 104 - .../Command/ClearCache/ResultCommand.php | 104 - .../Command/ConvertDoctrine1SchemaCommand.php | 223 - .../Console/Command/ConvertMappingCommand.php | 186 - .../EnsureProductionSettingsCommand.php | 85 - .../Command/GenerateEntitiesCommand.php | 163 - .../Command/GenerateProxiesCommand.php | 115 - .../Command/GenerateRepositoriesCommand.php | 116 - .../ORM/Tools/Console/Command/InfoCommand.php | 80 - .../Tools/Console/Command/RunDqlCommand.php | 124 - .../Command/SchemaTool/AbstractCommand.php | 64 - .../Command/SchemaTool/CreateCommand.php | 79 - .../Command/SchemaTool/DropCommand.php | 111 - .../Command/SchemaTool/UpdateCommand.php | 135 - .../Console/Command/ValidateSchemaCommand.php | 89 - .../ORM/Tools/Console/ConsoleRunner.php | 70 - .../Console/Helper/EntityManagerHelper.php | 74 - .../ORM/Tools/Console/MetadataFilter.php | 80 - .../ORM/Tools/ConvertDoctrine1Schema.php | 274 - .../ORM/Tools/DebugUnitOfWorkListener.php | 151 - .../DisconnectedClassMetadataFactory.php | 45 - .../Doctrine/ORM/Tools/EntityGenerator.php | 1146 ---- .../ORM/Tools/EntityRepositoryGenerator.php | 83 - .../Tools/Event/GenerateSchemaEventArgs.php | 65 - .../Event/GenerateSchemaTableEventArgs.php | 75 - .../Tools/Export/ClassMetadataExporter.php | 76 - .../Tools/Export/Driver/AbstractExporter.php | 217 - .../Export/Driver/AnnotationExporter.php | 71 - .../ORM/Tools/Export/Driver/PhpExporter.php | 169 - .../ORM/Tools/Export/Driver/XmlExporter.php | 320 - .../ORM/Tools/Export/Driver/YamlExporter.php | 210 - .../ORM/Tools/Export/ExportException.php | 23 - .../ORM/Tools/Pagination/CountWalker.php | 80 - .../Tools/Pagination/LimitSubqueryWalker.php | 115 - .../ORM/Tools/Pagination/Paginator.php | 180 - .../ORM/Tools/Pagination/WhereInWalker.php | 142 - .../ORM/Tools/ResolveTargetEntityListener.php | 94 - .../orm/lib/Doctrine/ORM/Tools/SchemaTool.php | 701 --- .../Doctrine/ORM/Tools/SchemaValidator.php | 267 - .../orm/lib/Doctrine/ORM/Tools/Setup.php | 194 - .../orm/lib/Doctrine/ORM/Tools/ToolEvents.php | 44 - .../lib/Doctrine/ORM/Tools/ToolsException.php | 40 - .../ORM/TransactionRequiredException.php | 40 - .../orm/lib/Doctrine/ORM/UnitOfWork.php | 2954 --------- .../doctrine/orm/lib/Doctrine/ORM/Version.php | 55 - vendor/doctrine/orm/phpunit.xml.dist | 59 - vendor/doctrine/orm/run-all.sh | 21 - vendor/doctrine/orm/tests/.gitignore | 3 - .../Doctrine/Tests/DbalFunctionalTestCase.php | 32 - .../orm/tests/Doctrine/Tests/DbalTestCase.php | 10 - .../DbalTypes/NegativeToPositiveType.php | 34 - .../Tests/DbalTypes/UpperCaseStringType.php | 29 - .../tests/Doctrine/Tests/DoctrineTestCase.php | 10 - .../Tests/Mocks/ClassMetadataMock.php | 14 - .../Doctrine/Tests/Mocks/ConnectionMock.php | 106 - .../Tests/Mocks/DatabasePlatformMock.php | 97 - .../Tests/Mocks/DriverConnectionMock.php | 17 - .../tests/Doctrine/Tests/Mocks/DriverMock.php | 72 - .../Tests/Mocks/EntityManagerMock.php | 106 - .../Tests/Mocks/EntityPersisterMock.php | 100 - .../Tests/Mocks/HydratorMockStatement.php | 111 - .../Tests/Mocks/IdentityIdGeneratorMock.php | 12 - .../Tests/Mocks/MetadataDriverMock.php | 21 - .../Doctrine/Tests/Mocks/MockTreeWalker.php | 17 - .../Tests/Mocks/SchemaManagerMock.php | 13 - .../Doctrine/Tests/Mocks/SequenceMock.php | 52 - .../tests/Doctrine/Tests/Mocks/TaskMock.php | 81 - .../Doctrine/Tests/Mocks/UnitOfWorkMock.php | 58 - .../Doctrine/Tests/Models/CMS/CmsAddress.php | 72 - .../Doctrine/Tests/Models/CMS/CmsArticle.php | 48 - .../Doctrine/Tests/Models/CMS/CmsComment.php | 38 - .../Doctrine/Tests/Models/CMS/CmsEmail.php | 48 - .../Doctrine/Tests/Models/CMS/CmsEmployee.php | 44 - .../Doctrine/Tests/Models/CMS/CmsGroup.php | 49 - .../Tests/Models/CMS/CmsPhonenumber.php | 28 - .../Doctrine/Tests/Models/CMS/CmsUser.php | 139 - .../Tests/Models/Company/CompanyAuction.php | 17 - .../Tests/Models/Company/CompanyCar.php | 33 - .../Tests/Models/Company/CompanyContract.php | 89 - .../Tests/Models/Company/CompanyEmployee.php | 59 - .../Tests/Models/Company/CompanyEvent.php | 36 - .../Models/Company/CompanyFixContract.php | 30 - .../Models/Company/CompanyFlexContract.php | 68 - .../Company/CompanyFlexUltraContract.php | 30 - .../Tests/Models/Company/CompanyManager.php | 42 - .../Models/Company/CompanyOrganization.php | 44 - .../Tests/Models/Company/CompanyPerson.php | 82 - .../Tests/Models/Company/CompanyRaffle.php | 17 - .../Models/CustomType/CustomTypeChild.php | 21 - .../Models/CustomType/CustomTypeParent.php | 68 - .../Models/CustomType/CustomTypeUpperCase.php | 21 - .../Models/DDC117/DDC117ApproveChanges.php | 65 - .../Tests/Models/DDC117/DDC117Article.php | 87 - .../Models/DDC117/DDC117ArticleDetails.php | 39 - .../Tests/Models/DDC117/DDC117Editor.php | 54 - .../Tests/Models/DDC117/DDC117Link.php | 31 - .../Tests/Models/DDC117/DDC117Reference.php | 64 - .../Tests/Models/DDC117/DDC117Translation.php | 65 - .../DDC1476EntityWithDefaultFieldType.php | 76 - .../Models/DDC753/DDC753CustomRepository.php | 36 - .../Models/DDC753/DDC753DefaultRepository.php | 35 - .../DDC753EntityWithCustomRepository.php | 39 - ...DC753EntityWithDefaultCustomRepository.php | 39 - .../DDC753EntityWithInvalidRepository.php | 39 - .../Models/DDC753/DDC753InvalidRepository.php | 28 - .../Models/DDC869/DDC869ChequePayment.php | 40 - .../Models/DDC869/DDC869CreditCardPayment.php | 40 - .../Tests/Models/DDC869/DDC869Payment.php | 57 - .../Models/DDC869/DDC869PaymentRepository.php | 37 - .../DirectoryTree/AbstractContentItem.php | 64 - .../Tests/Models/DirectoryTree/Directory.php | 41 - .../Tests/Models/DirectoryTree/File.php | 46 - .../Tests/Models/ECommerce/ECommerceCart.php | 91 - .../Models/ECommerce/ECommerceCategory.php | 126 - .../Models/ECommerce/ECommerceCustomer.php | 94 - .../Models/ECommerce/ECommerceFeature.php | 59 - .../Models/ECommerce/ECommerceProduct.php | 178 - .../Models/ECommerce/ECommerceShipping.php | 40 - .../Tests/Models/Forum/ForumAdministrator.php | 14 - .../Tests/Models/Forum/ForumAvatar.php | 17 - .../Tests/Models/Forum/ForumBoard.php | 28 - .../Tests/Models/Forum/ForumCategory.php | 32 - .../Tests/Models/Forum/ForumEntry.php | 26 - .../Doctrine/Tests/Models/Forum/ForumUser.php | 41 - .../Tests/Models/Generic/BooleanModel.php | 20 - .../Tests/Models/Generic/DateTimeModel.php | 28 - .../Tests/Models/Generic/DecimalModel.php | 25 - .../Models/Generic/SerializationModel.php | 25 - .../Models/Global/GlobalNamespaceModel.php | 68 - .../Tests/Models/Legacy/LegacyArticle.php | 33 - .../Tests/Models/Legacy/LegacyCar.php | 41 - .../Tests/Models/Legacy/LegacyUser.php | 80 - .../Models/Legacy/LegacyUserReference.php | 65 - .../Tests/Models/Navigation/NavCountry.php | 39 - .../Tests/Models/Navigation/NavPhotos.php | 48 - .../Models/Navigation/NavPointOfInterest.php | 79 - .../Tests/Models/Navigation/NavTour.php | 61 - .../Tests/Models/Navigation/NavUser.php | 28 - .../Tests/Models/Routing/RoutingLeg.php | 37 - .../Tests/Models/Routing/RoutingLocation.php | 25 - .../Tests/Models/Routing/RoutingRoute.php | 39 - .../Models/Routing/RoutingRouteBooking.php | 32 - .../Tests/Models/StockExchange/Bond.php | 48 - .../Tests/Models/StockExchange/Market.php | 56 - .../Tests/Models/StockExchange/Stock.php | 49 - .../Tests/ORM/CommitOrderCalculatorTest.php | 56 - .../Tests/ORM/Criteria/DqlGenerationTest.php | 252 - .../Tests/ORM/Entity/ConstructorTest.php | 28 - .../Doctrine/Tests/ORM/EntityManagerTest.php | 158 - .../AbstractManyToManyAssociationTestCase.php | 42 - .../Functional/AdvancedAssociationTest.php | 598 -- .../ORM/Functional/AdvancedDqlQueryTest.php | 181 - .../ORM/Functional/BasicFunctionalTest.php | 1232 ---- .../Functional/ClassTableInheritanceTest.php | 470 -- .../Functional/ClassTableInheritanceTest2.php | 176 - .../Tests/ORM/Functional/ClearEventTest.php | 40 - .../Functional/CompositePrimaryKeyTest.php | 144 - .../ORM/Functional/CustomTreeWalkersTest.php | 157 - .../ORM/Functional/DatabaseDriverTest.php | 166 - .../ORM/Functional/DefaultValuesTest.php | 150 - .../ORM/Functional/DetachedEntityTest.php | 218 - .../ORM/Functional/EntityRepositoryTest.php | 505 -- .../Functional/ExtraLazyCollectionTest.php | 583 -- .../Tests/ORM/Functional/FlushEventTest.php | 94 - .../ORM/Functional/HydrationCacheTest.php | 86 - .../Tests/ORM/Functional/IdentityMapTest.php | 288 - .../ORM/Functional/IndexByAssociationTest.php | 105 - .../ORM/Functional/LifecycleCallbackTest.php | 311 - .../Functional/Locking/GearmanLockTest.php | 180 - .../Functional/Locking/LockAgentWorker.php | 112 - .../Tests/ORM/Functional/Locking/LockTest.php | 184 - .../ORM/Functional/Locking/OptimisticTest.php | 277 - .../ManyToManyBasicAssociationTest.php | 380 -- ...ManyToManyBidirectionalAssociationTest.php | 202 - .../ORM/Functional/ManyToManyEventTest.php | 76 - ...nyToManySelfReferentialAssociationTest.php | 124 - ...anyToManyUnidirectionalAssociationTest.php | 108 - .../ORM/Functional/MappedSuperclassTest.php | 47 - .../Tests/ORM/Functional/NativeQueryTest.php | 333 -- .../Tests/ORM/Functional/NotifyPolicyTest.php | 173 - .../OneToManyBidirectionalAssociationTest.php | 171 - .../Functional/OneToManyOrphanRemovalTest.php | 75 - ...neToManySelfReferentialAssociationTest.php | 123 - ...OneToManyUnidirectionalAssociationTest.php | 86 - .../OneToOneBidirectionalAssociationTest.php | 151 - .../Functional/OneToOneEagerLoadingTest.php | 307 - .../Functional/OneToOneOrphanRemovalTest.php | 94 - ...OneToOneSelfReferentialAssociationTest.php | 165 - .../OneToOneUnidirectionalAssociationTest.php | 125 - .../ORM/Functional/OrderedCollectionTest.php | 113 - ...edJoinedTableInheritanceCollectionTest.php | 133 - .../Tests/ORM/Functional/PaginationTest.php | 105 - .../Functional/PersistentCollectionTest.php | 98 - .../ORM/Functional/PersistentObjectTest.php | 105 - .../ORM/Functional/PostFlushEventTest.php | 95 - .../PostgreSQLIdentityStrategyTest.php | 53 - .../Tests/ORM/Functional/QueryCacheTest.php | 151 - .../ORM/Functional/QueryDqlFunctionTest.php | 401 -- .../Tests/ORM/Functional/QueryTest.php | 658 -- .../Tests/ORM/Functional/ReadOnlyTest.php | 94 - .../ORM/Functional/ReferenceProxyTest.php | 250 - .../Tests/ORM/Functional/ResultCacheTest.php | 254 - .../Tests/ORM/Functional/SQLFilterTest.php | 1047 ---- .../SchemaTool/CompanySchemaTest.php | 68 - .../ORM/Functional/SchemaTool/DDC214Test.php | 90 - .../SchemaTool/MySqlSchemaToolTest.php | 92 - .../SchemaTool/PostgreSqlSchemaToolTest.php | 108 - .../ORM/Functional/SchemaValidatorTest.php | 50 - .../ORM/Functional/SequenceGeneratorTest.php | 53 - .../Functional/SingleTableInheritanceTest.php | 370 -- .../StandardEntityPersisterTest.php | 110 - .../ORM/Functional/Ticket/DDC1040Test.php | 81 - .../ORM/Functional/Ticket/DDC1041Test.php | 33 - .../ORM/Functional/Ticket/DDC1043Test.php | 36 - .../ORM/Functional/Ticket/DDC1050Test.php | 37 - .../ORM/Functional/Ticket/DDC1080Test.php | 317 - .../ORM/Functional/Ticket/DDC1113Test.php | 99 - .../ORM/Functional/Ticket/DDC1129Test.php | 46 - .../ORM/Functional/Ticket/DDC1151Test.php | 56 - .../ORM/Functional/Ticket/DDC1163Test.php | 215 - .../ORM/Functional/Ticket/DDC117Test.php | 464 -- .../ORM/Functional/Ticket/DDC1181Test.php | 101 - .../ORM/Functional/Ticket/DDC1193Test.php | 93 - .../ORM/Functional/Ticket/DDC1209Test.php | 125 - .../ORM/Functional/Ticket/DDC1225Test.php | 85 - .../ORM/Functional/Ticket/DDC1228Test.php | 136 - .../ORM/Functional/Ticket/DDC1238Test.php | 100 - .../ORM/Functional/Ticket/DDC1250Test.php | 96 - .../ORM/Functional/Ticket/DDC1276Test.php | 50 - .../ORM/Functional/Ticket/DDC1300Test.php | 108 - .../ORM/Functional/Ticket/DDC1301Test.php | 148 - .../ORM/Functional/Ticket/DDC1306Test.php | 54 - .../ORM/Functional/Ticket/DDC1335Test.php | 218 - .../ORM/Functional/Ticket/DDC1360Test.php | 37 - .../ORM/Functional/Ticket/DDC1383Test.php | 99 - .../ORM/Functional/Ticket/DDC1392Test.php | 127 - .../ORM/Functional/Ticket/DDC1400Test.php | 131 - .../ORM/Functional/Ticket/DDC1404Test.php | 129 - .../ORM/Functional/Ticket/DDC1430Test.php | 297 - .../ORM/Functional/Ticket/DDC1436Test.php | 89 - .../ORM/Functional/Ticket/DDC144Test.php | 64 - .../ORM/Functional/Ticket/DDC1452Test.php | 127 - .../ORM/Functional/Ticket/DDC1454Test.php | 69 - .../ORM/Functional/Ticket/DDC1458Test.php | 131 - .../ORM/Functional/Ticket/DDC1461Test.php | 86 - .../ORM/Functional/Ticket/DDC1509Test.php | 146 - .../ORM/Functional/Ticket/DDC1514Test.php | 113 - .../ORM/Functional/Ticket/DDC1515Test.php | 64 - .../ORM/Functional/Ticket/DDC1526Test.php | 67 - .../ORM/Functional/Ticket/DDC1545Test.php | 201 - .../ORM/Functional/Ticket/DDC1548Test.php | 81 - .../ORM/Functional/Ticket/DDC1594Test.php | 45 - .../ORM/Functional/Ticket/DDC1595Test.php | 111 - .../ORM/Functional/Ticket/DDC163Test.php | 65 - .../ORM/Functional/Ticket/DDC1643Test.php | 121 - .../ORM/Functional/Ticket/DDC1654Test.php | 103 - .../ORM/Functional/Ticket/DDC1655Test.php | 144 - .../ORM/Functional/Ticket/DDC168Test.php | 64 - .../ORM/Functional/Ticket/DDC1695Test.php | 158 - .../ORM/Functional/Ticket/DDC1778Test.php | 74 - .../ORM/Functional/Ticket/DDC192Test.php | 65 - .../ORM/Functional/Ticket/DDC199Test.php | 100 - .../ORM/Functional/Ticket/DDC211Test.php | 116 - .../ORM/Functional/Ticket/DDC237Test.php | 112 - .../ORM/Functional/Ticket/DDC258Test.php | 142 - .../ORM/Functional/Ticket/DDC279Test.php | 133 - .../ORM/Functional/Ticket/DDC309Test.php | 73 - .../ORM/Functional/Ticket/DDC331Test.php | 39 - .../ORM/Functional/Ticket/DDC345Test.php | 157 - .../ORM/Functional/Ticket/DDC353Test.php | 150 - .../ORM/Functional/Ticket/DDC371Test.php | 69 - .../ORM/Functional/Ticket/DDC381Test.php | 63 - .../ORM/Functional/Ticket/DDC422Test.php | 75 - .../ORM/Functional/Ticket/DDC425Test.php | 43 - .../ORM/Functional/Ticket/DDC440Test.php | 216 - .../ORM/Functional/Ticket/DDC444Test.php | 77 - .../ORM/Functional/Ticket/DDC448Test.php | 74 - .../ORM/Functional/Ticket/DDC493Test.php | 72 - .../ORM/Functional/Ticket/DDC501Test.php | 124 - .../ORM/Functional/Ticket/DDC512Test.php | 94 - .../ORM/Functional/Ticket/DDC513Test.php | 74 - .../ORM/Functional/Ticket/DDC518Test.php | 36 - .../ORM/Functional/Ticket/DDC522Test.php | 121 - .../ORM/Functional/Ticket/DDC531Test.php | 88 - .../ORM/Functional/Ticket/DDC588Test.php | 48 - .../ORM/Functional/Ticket/DDC599Test.php | 132 - .../ORM/Functional/Ticket/DDC618Test.php | 185 - .../ORM/Functional/Ticket/DDC633Test.php | 102 - .../ORM/Functional/Ticket/DDC656Test.php | 82 - .../ORM/Functional/Ticket/DDC657Test.php | 118 - .../ORM/Functional/Ticket/DDC698Test.php | 107 - .../ORM/Functional/Ticket/DDC719Test.php | 112 - .../ORM/Functional/Ticket/DDC729Test.php | 182 - .../ORM/Functional/Ticket/DDC735Test.php | 122 - .../ORM/Functional/Ticket/DDC736Test.php | 100 - .../ORM/Functional/Ticket/DDC742Test.php | 130 - .../ORM/Functional/Ticket/DDC748Test.php | 64 - .../ORM/Functional/Ticket/DDC758Test.php | 185 - .../ORM/Functional/Ticket/DDC767Test.php | 74 - .../ORM/Functional/Ticket/DDC809Test.php | 109 - .../ORM/Functional/Ticket/DDC812Test.php | 48 - .../ORM/Functional/Ticket/DDC832Test.php | 194 - .../ORM/Functional/Ticket/DDC837Test.php | 198 - .../ORM/Functional/Ticket/DDC849Test.php | 84 - .../ORM/Functional/Ticket/DDC881Test.php | 215 - .../ORM/Functional/Ticket/DDC933Test.php | 39 - .../ORM/Functional/Ticket/DDC949Test.php | 43 - .../ORM/Functional/Ticket/DDC960Test.php | 92 - .../ORM/Functional/Ticket/DDC992Test.php | 147 - .../ORM/Functional/Ticket/Ticket2481Test.php | 44 - .../Tests/ORM/Functional/Ticket/Ticket69.php | 427 -- .../Tests/ORM/Functional/TypeTest.php | 182 - .../Tests/ORM/Functional/TypeValueSqlTest.php | 105 - .../Functional/UnitOfWorkLifecycleTest.php | 71 - .../Tests/ORM/Hydration/ArrayHydratorTest.php | 1147 ---- .../ORM/Hydration/CustomHydratorTest.php | 29 - .../Tests/ORM/Hydration/HydrationTestCase.php | 30 - .../ORM/Hydration/ObjectHydratorTest.php | 1866 ------ .../ORM/Hydration/ResultSetMappingTest.php | 97 - .../ORM/Hydration/ScalarHydratorTest.php | 101 - .../Hydration/SingleScalarHydratorTest.php | 78 - .../Tests/ORM/Id/AssignedGeneratorTest.php | 67 - .../Tests/ORM/Id/SequenceGeneratorTest.php | 40 - .../ORM/Mapping/AbstractMappingDriverTest.php | 685 --- .../ORM/Mapping/AnnotationDriverTest.php | 340 -- .../Mapping/BasicInheritanceMappingTest.php | 319 - .../ORM/Mapping/ClassMetadataBuilderTest.php | 428 -- .../ORM/Mapping/ClassMetadataFactoryTest.php | 181 - .../Mapping/ClassMetadataLoadEventTest.php | 56 - .../Tests/ORM/Mapping/ClassMetadataTest.php | 553 -- .../Tests/ORM/Mapping/DriverChainTest.php | 96 - .../ORM/Mapping/PHPMappingDriverTest.php | 31 - .../Mapping/StaticPHPMappingDriverTest.php | 17 - .../Mapping/Symfony/AbstractDriverTest.php | 113 - .../ORM/Mapping/Symfony/XmlDriverTest.php | 40 - .../ORM/Mapping/Symfony/YamlDriverTest.php | 40 - .../ORM/Mapping/XmlMappingDriverTest.php | 96 - .../ORM/Mapping/YamlMappingDriverTest.php | 57 - ...1476.DDC1476EntityWithDefaultFieldType.php | 12 - ...ests.Models.DDC869.DDC869ChequePayment.php | 5 - ....Models.DDC869.DDC869CreditCardPayment.php | 5 - ...rine.Tests.Models.DDC869.DDC869Payment.php | 17 - ...ctrine.Tests.ORM.Mapping.DDC1170Entity.php | 16 - .../php/Doctrine.Tests.ORM.Mapping.User.php | 119 - .../Tests/ORM/Mapping/xml/CatNoId.dcm.xml | 8 - ...ts.Models.DDC117.DDC117Translation.dcm.xml | 22 - ....DDC1476EntityWithDefaultFieldType.dcm.xml | 15 - ....Models.DDC869.DDC869ChequePayment.dcm.xml | 11 - ...els.DDC869.DDC869CreditCardPayment.dcm.xml | 11 - ....Tests.Models.DDC869.DDC869Payment.dcm.xml | 15 - ....Models.Generic.SerializationModel.dcm.xml | 17 - .../Doctrine.Tests.ORM.Mapping.Animal.dcm.xml | 12 - .../Doctrine.Tests.ORM.Mapping.CTI.dcm.xml | 17 - ...ne.Tests.ORM.Mapping.DDC1170Entity.dcm.xml | 15 - .../Doctrine.Tests.ORM.Mapping.User.dcm.xml | 67 - ....DDC1476EntityWithDefaultFieldType.dcm.yml | 8 - ....Models.DDC869.DDC869ChequePayment.dcm.yml | 5 - ...els.DDC869.DDC869CreditCardPayment.dcm.yml | 5 - ....Tests.Models.DDC869.DDC869Payment.dcm.yml | 12 - ....DirectoryTree.AbstractContentItem.dcm.yml | 14 - ...sts.Models.DirectoryTree.Directory.dcm.yml | 6 - ...ne.Tests.Models.DirectoryTree.File.dcm.yml | 6 - ....Models.Generic.SerializationModel.dcm.yml | 13 - .../Doctrine.Tests.ORM.Mapping.Animal.dcm.yml | 6 - ...ne.Tests.ORM.Mapping.DDC1170Entity.dcm.yml | 10 - .../Doctrine.Tests.ORM.Mapping.User.dcm.yml | 68 - .../Performance/HydrationPerformanceTest.php | 461 -- .../InheritancePersisterPerformanceTest.php | 66 - .../ORM/Performance/InsertPerformanceTest.php | 56 - .../Performance/PersisterPerformanceTest.php | 121 - .../Performance/UnitOfWorkPerformanceTest.php | 51 - .../Tests/ORM/PersistentCollectionTest.php | 37 - .../BasicEntityPersisterTypeValueSqlTest.php | 79 - .../Tests/ORM/Proxy/AutoloaderTest.php | 62 - .../ORM/Proxy/ProxyClassGeneratorTest.php | 204 - .../Proxy/fixtures/NonNamespacedProxies.php | 13 - .../ORM/Query/DeleteSqlGenerationTest.php | 287 - .../Doctrine/Tests/ORM/Query/ExprTest.php | 348 -- .../ORM/Query/LanguageRecognitionTest.php | 601 -- .../Doctrine/Tests/ORM/Query/LexerTest.php | 234 - .../Tests/ORM/Query/ParserResultTest.php | 48 - .../Doctrine/Tests/ORM/Query/QueryTest.php | 128 - .../ORM/Query/SelectSqlGenerationTest.php | 1601 ----- .../ORM/Query/UpdateSqlGenerationTest.php | 205 - .../Doctrine/Tests/ORM/QueryBuilderTest.php | 748 --- .../ConvertDoctrine1SchemaCommandTest.php | 23 - .../ORM/Tools/ConvertDoctrine1SchemaTest.php | 108 - .../Tests/ORM/Tools/EntityGeneratorTest.php | 294 - .../AbstractClassMetadataExporterTest.php | 392 -- .../AnnotationClassMetadataExporterTest.php | 42 - .../Export/ClassMetadataExporterTest.php | 0 .../Export/PhpClassMetadataExporterTest.php | 42 - .../Export/XmlClassMetadataExporterTest.php | 42 - .../Export/YamlClassMetadataExporterTest.php | 46 - .../Doctrine.Tests.ORM.Tools.Export.User.php | 73 - .../Doctrine.Tests.ORM.Tools.Export.User.php | 109 - ...ctrine.Tests.ORM.Tools.Export.User.dcm.xml | 66 - ...ctrine.Tests.ORM.Tools.Export.User.dcm.yml | 63 - .../ORM/Tools/Pagination/CountWalkerTest.php | 78 - .../Pagination/LimitSubqueryWalkerTest.php | 36 - .../Tools/Pagination/PaginationTestCase.php | 142 - .../Tools/Pagination/WhereInWalkerTest.php | 111 - .../Tools/ResolveTargetEntityListenerTest.php | 129 - .../Tests/ORM/Tools/SchemaToolTest.php | 132 - .../Tests/ORM/Tools/SchemaValidatorTest.php | 267 - .../Doctrine/Tests/ORM/Tools/SetupTest.php | 110 - .../ORM/Tools/doctrine1schema/schema.yml | 28 - .../Doctrine/Tests/ORM/UnitOfWorkTest.php | 312 - .../Doctrine/Tests/OrmFunctionalTestCase.php | 416 -- .../Doctrine/Tests/OrmPerformanceTestCase.php | 60 - .../orm/tests/Doctrine/Tests/OrmTestCase.php | 122 - .../orm/tests/Doctrine/Tests/TestInit.php | 43 - .../orm/tests/Doctrine/Tests/TestUtil.php | 119 - .../doctrine/orm/tests/NativePhpunitTask.php | 249 - vendor/doctrine/orm/tests/README.markdown | 25 - .../doctrine/orm/tests/dbproperties.xml.dev | 33 - .../orm/tests/travis/mysql.travis.xml | 32 - .../orm/tests/travis/pgsql.travis.xml | 34 - .../orm/tests/travis/sqlite.travis.xml | 15 - .../orm/tools/sandbox/Entities/Address.php | 45 - .../orm/tools/sandbox/Entities/User.php | 48 - .../doctrine/orm/tools/sandbox/cli-config.php | 36 - vendor/doctrine/orm/tools/sandbox/doctrine | 4 - .../doctrine/orm/tools/sandbox/doctrine.php | 49 - vendor/doctrine/orm/tools/sandbox/index.php | 62 - .../sandbox/xml/Entities.Address.dcm.xml | 15 - .../tools/sandbox/xml/Entities.User.dcm.xml | 17 - .../sandbox/yaml/Entities.Address.dcm.yml | 16 - .../tools/sandbox/yaml/Entities.User.dcm.yml | 18 - .../ckeditor-bundle/Ivory/CKEditorBundle | 1 - .../JMS/AopBundle/Aop/InterceptorLoader.php | 58 - .../JMS/AopBundle/Aop/PointcutContainer.php | 34 - .../JMS/AopBundle/Aop/PointcutInterface.php | 54 - .../JMS/AopBundle/Aop/RegexPointcut.php | 46 - .../Compiler/PointcutMatchingPass.php | 195 - .../DependencyInjection/Configuration.php | 45 - .../DependencyInjection/JMSAopExtension.php | 53 - .../JMS/AopBundle/Exception/Exception.php | 28 - .../AopBundle/Exception/RuntimeException.php | 28 - .../aop-bundle/JMS/AopBundle/JMSAopBundle.php | 34 - vendor/jms/aop-bundle/JMS/AopBundle/README | 8 - .../AopBundle/Resources/config/services.xml | 18 - .../JMS/AopBundle/Resources/doc/index.rst | 252 - .../JMS/AopBundle/Resources/meta/LICENSE | 201 - .../aop-bundle/JMS/AopBundle/composer.json | 21 - .../Aop/InterceptorLoader.php | 58 - .../Aop/PointcutContainer.php | 34 - .../Aop/PointcutInterface.php | 54 - .../Aop/RegexPointcut.php | 46 - .../Compiler/PointcutMatchingPass.php | 195 - .../DependencyInjection/Configuration.php | 45 - .../DependencyInjection/JMSAopExtension.php | 53 - .../Exception/Exception.php | 28 - .../Exception/RuntimeException.php | 28 - .../JMSAopBundle.php | 34 - .../schmittjoh-JMSAopBundle-8ef7db0/README | 8 - .../Resources/config/services.xml | 18 - .../Resources/doc/index.rst | 252 - .../Resources/meta/LICENSE | 201 - .../Tests/Aop/InterceptorLoaderTest.php | 64 - .../Tests/Aop/RegexPointcutTest.php | 47 - .../Compiler/Fixture/LoggingInterceptor.php | 39 - .../Compiler/Fixture/LoggingPointcut.php | 34 - .../Compiler/Fixture/TestService.php | 32 - .../Compiler/PointcutMatchingPassTest.php | 96 - .../composer.json | 21 - .../phpunit.xml.dist | 26 - vendor/jms/cg/LICENSE | 201 - vendor/jms/cg/composer.json | 19 - .../cg/schmittjoh-cg-library-ce8ef43/LICENSE | 201 - .../schmittjoh-cg-library-ce8ef43/README.rst | 9 - .../composer.json | 19 - .../phpunit.xml.dist | 25 - .../src/CG/Core/AbstractClassGenerator.php | 60 - .../src/CG/Core/ClassGeneratorInterface.php | 36 - .../src/CG/Core/ClassUtils.php | 35 - .../src/CG/Core/DefaultGeneratorStrategy.php | 67 - .../src/CG/Core/DefaultNamingStrategy.php | 41 - .../CG/Core/GeneratorStrategyInterface.php | 34 - .../src/CG/Core/NamingStrategyInterface.php | 50 - .../src/CG/Core/ReflectionUtils.php | 57 - .../src/CG/Generator/AbstractPhpMember.php | 95 - .../src/CG/Generator/DefaultNavigator.php | 172 - .../src/CG/Generator/DefaultVisitor.php | 237 - .../CG/Generator/DefaultVisitorInterface.php | 47 - .../src/CG/Generator/GeneratorUtils.php | 38 - .../src/CG/Generator/PhpClass.php | 360 -- .../src/CG/Generator/PhpFunction.php | 146 - .../src/CG/Generator/PhpMethod.php | 158 - .../src/CG/Generator/PhpParameter.php | 126 - .../src/CG/Generator/PhpProperty.php | 84 - .../src/CG/Generator/Writer.php | 103 - .../src/CG/Proxy/Enhancer.php | 158 - .../src/CG/Proxy/GeneratorInterface.php | 38 - .../src/CG/Proxy/InterceptionGenerator.php | 117 - .../CG/Proxy/InterceptorLoaderInterface.php | 38 - .../src/CG/Proxy/LazyInitializerGenerator.php | 153 - .../src/CG/Proxy/LazyInitializerInterface.php | 38 - .../CG/Proxy/MethodInterceptorInterface.php | 42 - .../src/CG/Proxy/MethodInvocation.php | 77 - .../src/CG/Proxy/RegexInterceptionLoader.php | 48 - .../src/CG/Version.php | 8 - .../tests/CG/Tests/Core/ClassUtilsTest.php | 14 - .../Core/DefaultGeneratorStrategyTest.php | 66 - .../CG/Tests/Core/ReflectionUtilsTest.php | 48 - .../Core/generated/GenerationTestClass_A.php | 16 - .../Core/generated/GenerationTestClass_B.php | 16 - .../Tests/Generator/AbstractPhpMemberTest.php | 58 - .../CG/Tests/Generator/DefaultVisitorTest.php | 47 - .../CG/Tests/Generator/Fixture/Entity.php | 35 - .../Fixture/generated/a_b_function.php | 8 - .../tests/CG/Tests/Generator/PhpClassTest.php | 215 - .../CG/Tests/Generator/PhpFunctionTest.php | 75 - .../CG/Tests/Generator/PhpMethodTest.php | 74 - .../CG/Tests/Generator/PhpParameterTest.php | 51 - .../CG/Tests/Generator/PhpPropertyTest.php | 22 - .../tests/CG/Tests/Proxy/EnhancerTest.php | 111 - .../tests/CG/Tests/Proxy/Fixture/Entity.php | 23 - .../Proxy/Fixture/LazyLoadingInterceptor.php | 3 - .../Tests/Proxy/Fixture/MarkerInterface.php | 7 - .../CG/Tests/Proxy/Fixture/SimpleClass.php | 7 - .../Proxy/Fixture/SluggableInterface.php | 8 - .../Tests/Proxy/Fixture/TraceInterceptor.php | 29 - .../Entity__CG__LazyInitializing.php.gen | 37 - .../SimpleClass__CG__Enhanced.php.gen | 11 - .../SimpleClass__CG__Sluggable.php.gen | 14 - .../tests/bootstrap.php | 35 - .../cg/src/CG/Core/AbstractClassGenerator.php | 60 - .../src/CG/Core/ClassGeneratorInterface.php | 36 - vendor/jms/cg/src/CG/Core/ClassUtils.php | 35 - .../src/CG/Core/DefaultGeneratorStrategy.php | 67 - .../cg/src/CG/Core/DefaultNamingStrategy.php | 41 - .../CG/Core/GeneratorStrategyInterface.php | 34 - .../src/CG/Core/NamingStrategyInterface.php | 50 - vendor/jms/cg/src/CG/Core/ReflectionUtils.php | 57 - .../cg/src/CG/Generator/AbstractPhpMember.php | 95 - .../cg/src/CG/Generator/DefaultNavigator.php | 172 - .../cg/src/CG/Generator/DefaultVisitor.php | 237 - .../CG/Generator/DefaultVisitorInterface.php | 47 - .../cg/src/CG/Generator/GeneratorUtils.php | 38 - vendor/jms/cg/src/CG/Generator/PhpClass.php | 360 -- .../jms/cg/src/CG/Generator/PhpFunction.php | 146 - vendor/jms/cg/src/CG/Generator/PhpMethod.php | 158 - .../jms/cg/src/CG/Generator/PhpParameter.php | 126 - .../jms/cg/src/CG/Generator/PhpProperty.php | 84 - vendor/jms/cg/src/CG/Generator/Writer.php | 103 - vendor/jms/cg/src/CG/Proxy/Enhancer.php | 158 - .../cg/src/CG/Proxy/GeneratorInterface.php | 38 - .../cg/src/CG/Proxy/InterceptionGenerator.php | 117 - .../CG/Proxy/InterceptorLoaderInterface.php | 38 - .../src/CG/Proxy/LazyInitializerGenerator.php | 153 - .../src/CG/Proxy/LazyInitializerInterface.php | 38 - .../CG/Proxy/MethodInterceptorInterface.php | 42 - .../jms/cg/src/CG/Proxy/MethodInvocation.php | 77 - .../src/CG/Proxy/RegexInterceptionLoader.php | 48 - vendor/jms/cg/src/CG/Version.php | 8 - .../DiExtraBundle/Annotation/AfterSetup.php | 13 - .../Annotation/DoctrineListener.php | 74 - .../JMS/DiExtraBundle/Annotation/FormType.php | 37 - .../JMS/DiExtraBundle/Annotation/Inject.php | 27 - .../DiExtraBundle/Annotation/InjectParams.php | 57 - .../DiExtraBundle/Annotation/LookupMethod.php | 27 - .../JMS/DiExtraBundle/Annotation/Observe.php | 62 - .../DiExtraBundle/Annotation/Reference.php | 54 - .../JMS/DiExtraBundle/Annotation/Service.php | 87 - .../JMS/DiExtraBundle/Annotation/Tag.php | 60 - .../DiExtraBundle/Annotation/Validator.php | 51 - .../Config/FastDirectoriesResource.php | 78 - .../Config/ServiceFilesResource.php | 52 - .../Compiler/AnnotationConfigurationPass.php | 120 - .../Compiler/IntegrationPass.php | 55 - .../Compiler/ResourceOptimizationPass.php | 81 - .../DependencyInjection/Configuration.php | 69 - .../JMSDiExtraExtension.php | 84 - .../LookupMethodClassInterface.php | 24 - .../EventListener/ControllerListener.php | 58 - .../EventListener/TemplateListener.php | 50 - .../JMS/DiExtraBundle/Exception/Exception.php | 28 - .../Exception/InvalidArgumentException.php | 28 - .../Exception/InvalidTypeException.php | 29 - .../Exception/RuntimeException.php | 28 - .../DiExtraBundle/Finder/PatternFinder.php | 201 - .../Generator/DefinitionInjectorGenerator.php | 192 - .../Generator/LookupMethodClassGenerator.php | 119 - .../DiExtraBundle/Generator/NameGenerator.php | 79 - .../HttpKernel/ControllerResolver.php | 179 - .../JMS/DiExtraBundle/JMSDiExtraBundle.php | 50 - .../DiExtraBundle/Metadata/ClassMetadata.php | 74 - .../Metadata/Driver/AnnotationDriver.php | 220 - .../Metadata/MetadataConverter.php | 85 - .../di-extra-bundle/JMS/DiExtraBundle/README | 8 - .../Resources/config/services.xml | 50 - .../JMS/DiExtraBundle/Resources/doc/index.rst | 290 - .../JMS/DiExtraBundle/Resources/meta/LICENSE | 201 - .../JMS/DiExtraBundle/composer.json | 21 - .../Annotation/AfterSetup.php | 13 - .../Annotation/DoctrineListener.php | 74 - .../Annotation/FormType.php | 37 - .../Annotation/Inject.php | 27 - .../Annotation/InjectParams.php | 57 - .../Annotation/LookupMethod.php | 27 - .../Annotation/Observe.php | 62 - .../Annotation/Reference.php | 54 - .../Annotation/Service.php | 87 - .../Annotation/Tag.php | 60 - .../Annotation/Validator.php | 51 - .../Config/FastDirectoriesResource.php | 78 - .../Config/ServiceFilesResource.php | 52 - .../Compiler/AnnotationConfigurationPass.php | 120 - .../Compiler/IntegrationPass.php | 55 - .../Compiler/ResourceOptimizationPass.php | 81 - .../DependencyInjection/Configuration.php | 69 - .../JMSDiExtraExtension.php | 84 - .../LookupMethodClassInterface.php | 24 - .../EventListener/ControllerListener.php | 58 - .../EventListener/TemplateListener.php | 50 - .../Exception/Exception.php | 28 - .../Exception/InvalidArgumentException.php | 28 - .../Exception/InvalidTypeException.php | 29 - .../Exception/RuntimeException.php | 28 - .../Finder/PatternFinder.php | 201 - .../Generator/DefinitionInjectorGenerator.php | 192 - .../Generator/LookupMethodClassGenerator.php | 119 - .../Generator/NameGenerator.php | 79 - .../HttpKernel/ControllerResolver.php | 179 - .../JMSDiExtraBundle.php | 50 - .../Metadata/ClassMetadata.php | 74 - .../Metadata/Driver/AnnotationDriver.php | 220 - .../Metadata/MetadataConverter.php | 85 - .../README | 8 - .../Resources/config/services.xml | 50 - .../Resources/doc/index.rst | 290 - .../Resources/meta/LICENSE | 201 - .../AnnotationConfigurationPassTest.php | 127 - .../Compiler/Fixtures/a/b/.gitkeep | 0 .../Compiler/Fixtures/c/.gitkeep | 0 .../Compiler/ResourceOptimizationPassTest.php | 50 - .../Finder/AbstractPatternFinderTest.php | 50 - .../Tests/Finder/FindstrPatternFinderTest.php | 38 - .../Tests/Finder/GrepPatternFinderTest.php | 37 - .../Tests/Finder/PhpPatternFinderTest.php | 34 - .../Tests/Fixture/EmptyDirectory/.gitkeep | 0 .../Tests/Fixture/LoginController.php | 73 - .../Fixture/NonEmptyDirectory/DummyFile.php | 3 - .../Fixture/NonEmptyDirectory/Service1.php | 26 - .../NonEmptyDirectory/SubDir1/NonPhpFile.txt | 10 - .../NonEmptyDirectory/SubDir1/Service2.php | 26 - .../NonEmptyDirectory/SubDir2/Service3.php | 26 - .../Tests/Fixture/RequestListener.php | 58 - .../Tests/Fixture/Validator/Validator.php | 45 - .../Tests/Functional/AppKernel.php | 80 - .../Tests/Functional/BaseTestCase.php | 49 - .../Controller/AnotherSecuredController.php | 40 - .../Controller/RegisterController.php | 42 - .../Controller/SecuredController.php | 41 - .../TestBundle/Inheritance/AbstractClass.php | 31 - .../TestBundle/Inheritance/ConcreteClass.php | 38 - .../TestBundle/JMSDiExtraTestBundle.php | 25 - .../Bundle/TestBundle/Mailer/TestMailer.php | 34 - .../Functional/ControllerResolverTest.php | 50 - .../Tests/Functional/Issue11Test.php | 21 - .../Tests/Functional/config/default.yml | 12 - .../Tests/Functional/config/framework.yml | 16 - .../Tests/Functional/config/routing.yml | 3 - .../Tests/Functional/config/security.yml | 13 - .../Tests/Functional/config/twig.yml | 7 - .../Tests/Metadata/ClassMetadataTest.php | 35 - .../Metadata/Driver/AnnotationDriverTest.php | 37 - .../Metadata/Driver/Fixture/LoginType.php | 27 - .../Metadata/Driver/Fixture/SignUpType.php | 19 - .../Tests/PerformanceTest.php | 100 - .../Tests/bootstrap.php | 15 - .../composer.json | 21 - .../phpunit.xml.dist | 26 - vendor/jms/metadata/CHANGELOG.md | 18 - vendor/jms/metadata/LICENSE | 201 - vendor/jms/metadata/composer.json | 19 - .../schmittjoh-metadata-84088bc/CHANGELOG.md | 18 - .../schmittjoh-metadata-84088bc/LICENSE | 201 - .../schmittjoh-metadata-84088bc/README.rst | 37 - .../schmittjoh-metadata-84088bc/composer.json | 19 - .../phpunit.xml.dist | 25 - .../src/Metadata/Cache/CacheInterface.php | 35 - .../src/Metadata/Cache/FileCache.php | 46 - .../src/Metadata/ClassHierarchyMetadata.php | 55 - .../src/Metadata/ClassMetadata.php | 98 - .../Metadata/Driver/AbstractFileDriver.php | 42 - .../src/Metadata/Driver/DriverChain.php | 40 - .../src/Metadata/Driver/DriverInterface.php | 24 - .../src/Metadata/Driver/FileLocator.php | 29 - .../Metadata/Driver/FileLocatorInterface.php | 8 - .../src/Metadata/Driver/LazyLoadingDriver.php | 22 - .../src/Metadata/MergeableClassMetadata.php | 23 - .../src/Metadata/MergeableInterface.php | 8 - .../src/Metadata/MetadataFactory.php | 142 - .../src/Metadata/MetadataFactoryInterface.php | 24 - .../src/Metadata/MethodMetadata.php | 61 - .../src/Metadata/PropertyMetadata.php | 69 - .../src/Metadata/Version.php | 24 - .../Metadata/Tests/Cache/FileCacheTest.php | 23 - .../Metadata/Tests/ClassMetadataTest.php | 39 - .../Metadata/Tests/Driver/DriverChainTest.php | 37 - .../Metadata/Tests/Driver/FileLocatorTest.php | 26 - .../Metadata/Tests/Driver/Fixture/A/A.php | 5 - .../Metadata/Tests/Driver/Fixture/A/A.xml | 0 .../Metadata/Tests/Driver/Fixture/B/B.php | 5 - .../Metadata/Tests/Driver/Fixture/B/B.yml | 0 .../Tests/Driver/Fixture/C/SubDir.C.yml | 0 .../Tests/Driver/Fixture/C/SubDir/C.php | 5 - .../Fixtures/ComplexHierarchy/BaseClass.php | 8 - .../Fixtures/ComplexHierarchy/InterfaceA.php | 7 - .../Fixtures/ComplexHierarchy/InterfaceB.php | 7 - .../Fixtures/ComplexHierarchy/SubClassA.php | 8 - .../Fixtures/ComplexHierarchy/SubClassB.php | 8 - .../Metadata/Tests/Fixtures/TestObject.php | 18 - .../Metadata/Tests/Fixtures/TestParent.php | 7 - .../Tests/MergeableClassMetadataTest.php | 33 - .../Metadata/Tests/MetadataFactoryTest.php | 184 - .../Metadata/Tests/MethodMetadataTest.php | 36 - .../Metadata/Tests/PropertyMetadataTest.php | 36 - .../tests/bootstrap.php | 36 - .../src/Metadata/Cache/CacheInterface.php | 35 - .../metadata/src/Metadata/Cache/FileCache.php | 46 - .../src/Metadata/ClassHierarchyMetadata.php | 55 - .../metadata/src/Metadata/ClassMetadata.php | 98 - .../Metadata/Driver/AbstractFileDriver.php | 42 - .../src/Metadata/Driver/DriverChain.php | 40 - .../src/Metadata/Driver/DriverInterface.php | 24 - .../src/Metadata/Driver/FileLocator.php | 29 - .../Metadata/Driver/FileLocatorInterface.php | 8 - .../src/Metadata/Driver/LazyLoadingDriver.php | 22 - .../src/Metadata/MergeableClassMetadata.php | 23 - .../src/Metadata/MergeableInterface.php | 8 - .../metadata/src/Metadata/MetadataFactory.php | 142 - .../src/Metadata/MetadataFactoryInterface.php | 24 - .../metadata/src/Metadata/MethodMetadata.php | 61 - .../src/Metadata/PropertyMetadata.php | 69 - vendor/jms/metadata/src/Metadata/Version.php | 24 - .../Annotation/PreAuthorize.php | 59 - .../SecurityExtraBundle/Annotation/RunAs.php | 42 - .../SatisfiesParentSecurityPolicy.php | 81 - .../SecurityExtraBundle/Annotation/Secure.php | 45 - .../Annotation/SecureParam.php | 48 - .../Annotation/SecureReturn.php | 45 - .../JMS/SecurityExtraBundle/CHANGELOG-1.1.md | 38 - .../AccessControlConfiguration.php | 90 - .../AddAfterInvocationProvidersPass.php | 52 - .../Compiler/AddExpressionCompilersPass.php | 66 - .../Compiler/CollectSecuredServicesPass.php | 43 - .../Compiler/DisableVotersPass.php | 46 - .../Compiler/IntegrationPass.php | 22 - .../DependencyInjection/Configuration.php | 64 - .../JMSSecurityExtraExtension.php | 100 - .../DependencyInjection/SecurityExtension.php | 130 - .../Exception/Exception.php | 28 - .../Exception/InvalidArgumentException.php | 28 - .../Exception/RuntimeException.php | 28 - .../JMSSecurityExtraBundle.php | 59 - .../Metadata/ClassMetadata.php | 93 - .../Metadata/Driver/AnnotationDriver.php | 107 - .../Metadata/Driver/ConfigDriver.php | 100 - .../Metadata/MethodMetadata.php | 84 - .../JMS/SecurityExtraBundle/README | 8 - .../Resources/config/security_expressions.xml | 84 - .../Resources/config/services.xml | 99 - .../Resources/doc/index.rst | 352 -- .../Resources/meta/LICENSE | 201 - .../HasPermissionFunctionCompiler.php | 63 - .../Acl/Expression/PermissionEvaluator.php | 122 - .../Security/Acl/Voter/AclVoter.php | 136 - .../Provider/RunAsAuthenticationProvider.php | 57 - .../Authentication/Token/RunAsUserToken.php | 85 - .../AclAfterInvocationProvider.php | 111 - .../AfterInvocationManager.php | 77 - .../AfterInvocationManagerInterface.php | 56 - .../AfterInvocationProviderInterface.php | 33 - .../Expression/Ast/AndExpression.php | 31 - .../Expression/Ast/ArrayExpression.php | 29 - .../Expression/Ast/ConstantExpression.php | 29 - .../Expression/Ast/ExpressionInterface.php | 23 - .../Expression/Ast/FunctionExpression.php | 32 - .../Expression/Ast/GetItemExpression.php | 31 - .../Expression/Ast/GetPropertyExpression.php | 31 - .../Expression/Ast/IsEqualExpression.php | 31 - .../Expression/Ast/MethodCallExpression.php | 33 - .../Expression/Ast/NotExpression.php | 29 - .../Expression/Ast/OrExpression.php | 31 - .../Expression/Ast/ParameterExpression.php | 29 - .../Expression/Ast/VariableExpression.php | 31 - .../Compiler/AndExpressionCompiler.php | 32 - .../Compiler/BinaryExprCompiler.php | 51 - .../ContainerAwareVariableCompiler.php | 60 - .../AuthenticationTrustFunctionCompiler.php | 35 - .../Func/FunctionCompilerInterface.php | 29 - .../Func/HasAnyRoleFunctionCompiler.php | 63 - .../Compiler/Func/HasRoleFunctionCompiler.php | 51 - .../Func/IsAnonymousFunctionCompiler.php | 39 - .../Func/IsAuthenticatedFunctionCompiler.php | 41 - .../IsFullyAuthenticatedFunctionCompiler.php | 39 - .../Func/IsRememberMeFunctionCompiler.php | 39 - .../Compiler/IsEqualExpressionCompiler.php | 32 - .../Compiler/NotExpressionCompiler.php | 44 - .../Compiler/OrExpressionCompiler.php | 32 - .../Compiler/ParameterExpressionCompiler.php | 80 - .../Compiler/TypeCompilerInterface.php | 29 - .../Compiler/VariableExpressionCompiler.php | 74 - .../ContainerAwareExpressionHandler.php | 47 - .../Expression/DefaultExpressionHandler.php | 51 - .../Authorization/Expression/Expression.php | 40 - .../Expression/ExpressionCompiler.php | 395 -- .../Expression/ExpressionHandlerInterface.php | 26 - .../Expression/ExpressionLexer.php | 134 - .../Expression/ExpressionParser.php | 290 - .../Expression/ExpressionVoter.php | 114 - .../Expression/LazyLoadingExpressionVoter.php | 39 - .../MethodSecurityInterceptor.php | 150 - .../Interception/SecurityPointcut.php | 92 - .../Security/Authorization/RunAsManager.php | 79 - .../Authorization/RunAsManagerInterface.php | 57 - .../Authorization/Voter/IddqdVoter.php | 61 - .../Twig/SecurityExtension.php | 35 - .../JMS/SecurityExtraBundle/composer.json | 25 - .../Annotation/PreAuthorize.php | 59 - .../Annotation/RunAs.php | 42 - .../SatisfiesParentSecurityPolicy.php | 81 - .../Annotation/Secure.php | 45 - .../Annotation/SecureParam.php | 48 - .../Annotation/SecureReturn.php | 45 - .../CHANGELOG-1.1.md | 38 - .../AccessControlConfiguration.php | 90 - .../AddAfterInvocationProvidersPass.php | 52 - .../Compiler/AddExpressionCompilersPass.php | 66 - .../Compiler/CollectSecuredServicesPass.php | 43 - .../Compiler/DisableVotersPass.php | 46 - .../Compiler/IntegrationPass.php | 22 - .../DependencyInjection/Configuration.php | 64 - .../JMSSecurityExtraExtension.php | 100 - .../DependencyInjection/SecurityExtension.php | 130 - .../Exception/Exception.php | 28 - .../Exception/InvalidArgumentException.php | 28 - .../Exception/RuntimeException.php | 28 - .../JMSSecurityExtraBundle.php | 59 - .../Metadata/ClassMetadata.php | 93 - .../Metadata/Driver/AnnotationDriver.php | 107 - .../Metadata/Driver/ConfigDriver.php | 100 - .../Metadata/MethodMetadata.php | 84 - .../README | 8 - .../Resources/config/security_expressions.xml | 84 - .../Resources/config/services.xml | 99 - .../Resources/doc/index.rst | 352 -- .../Resources/meta/LICENSE | 201 - .../HasPermissionFunctionCompiler.php | 63 - .../Acl/Expression/PermissionEvaluator.php | 122 - .../Security/Acl/Voter/AclVoter.php | 136 - .../Provider/RunAsAuthenticationProvider.php | 57 - .../Authentication/Token/RunAsUserToken.php | 85 - .../AclAfterInvocationProvider.php | 111 - .../AfterInvocationManager.php | 77 - .../AfterInvocationManagerInterface.php | 56 - .../AfterInvocationProviderInterface.php | 33 - .../Expression/Ast/AndExpression.php | 31 - .../Expression/Ast/ArrayExpression.php | 29 - .../Expression/Ast/ConstantExpression.php | 29 - .../Expression/Ast/ExpressionInterface.php | 23 - .../Expression/Ast/FunctionExpression.php | 32 - .../Expression/Ast/GetItemExpression.php | 31 - .../Expression/Ast/GetPropertyExpression.php | 31 - .../Expression/Ast/IsEqualExpression.php | 31 - .../Expression/Ast/MethodCallExpression.php | 33 - .../Expression/Ast/NotExpression.php | 29 - .../Expression/Ast/OrExpression.php | 31 - .../Expression/Ast/ParameterExpression.php | 29 - .../Expression/Ast/VariableExpression.php | 31 - .../Compiler/AndExpressionCompiler.php | 32 - .../Compiler/BinaryExprCompiler.php | 51 - .../ContainerAwareVariableCompiler.php | 60 - .../AuthenticationTrustFunctionCompiler.php | 35 - .../Func/FunctionCompilerInterface.php | 29 - .../Func/HasAnyRoleFunctionCompiler.php | 63 - .../Compiler/Func/HasRoleFunctionCompiler.php | 51 - .../Func/IsAnonymousFunctionCompiler.php | 39 - .../Func/IsAuthenticatedFunctionCompiler.php | 41 - .../IsFullyAuthenticatedFunctionCompiler.php | 39 - .../Func/IsRememberMeFunctionCompiler.php | 39 - .../Compiler/IsEqualExpressionCompiler.php | 32 - .../Compiler/NotExpressionCompiler.php | 44 - .../Compiler/OrExpressionCompiler.php | 32 - .../Compiler/ParameterExpressionCompiler.php | 80 - .../Compiler/TypeCompilerInterface.php | 29 - .../Compiler/VariableExpressionCompiler.php | 74 - .../ContainerAwareExpressionHandler.php | 47 - .../Expression/DefaultExpressionHandler.php | 51 - .../Authorization/Expression/Expression.php | 40 - .../Expression/ExpressionCompiler.php | 395 -- .../Expression/ExpressionHandlerInterface.php | 26 - .../Expression/ExpressionLexer.php | 134 - .../Expression/ExpressionParser.php | 290 - .../Expression/ExpressionVoter.php | 114 - .../Expression/LazyLoadingExpressionVoter.php | 39 - .../MethodSecurityInterceptor.php | 150 - .../Interception/SecurityPointcut.php | 92 - .../Security/Authorization/RunAsManager.php | 79 - .../Authorization/RunAsManagerInterface.php | 57 - .../Authorization/Voter/IddqdVoter.php | 61 - .../AddAfterInvocationProvidersPassTest.php | 91 - .../CollectSecuredServicesPassTest.php | 50 - .../JMSSecurityExtraExtensionTest.php | 91 - ...irectlyOverwrittenInDirectChildService.php | 45 - .../Annotation/NonSecurityAnnotation.php | 24 - .../Tests/Fixtures/ComplexService.php | 54 - .../Tests/Fixtures/CorrectSubService.php | 34 - .../Tests/Fixtures/MainService.php | 42 - .../Tests/Fixtures/SubService.php | 29 - .../Tests/Functional/AppKernel.php | 97 - .../Tests/Functional/BaseTestCase.php | 64 - .../Functional/MethodAccessControlTest.php | 77 - .../Functional/Resources/views/base.html.twig | 13 - .../TestBundle/Controller/CrudController.php | 18 - .../TestBundle/Controller/PostController.php | 84 - .../Functional/TestBundle/Entity/Post.php | 41 - .../TestBundle/Logger/FileLogger.php | 60 - .../Resources/views/is_expr_granted.html.twig | 5 - .../Functional/TestBundle/TestBundle.php | 10 - .../TestBundle/User/UserManager.php | 11 - .../Tests/Functional/TwigIntegrationTest.php | 39 - .../Tests/Functional/VoterDisablingTest.php | 48 - .../Tests/Functional/config/acl_enabled.yml | 9 - .../Functional/config/all_voters_disabled.yml | 6 - .../Tests/Functional/config/default.yml | 5 - .../Tests/Functional/config/doctrine.yml | 13 - .../Tests/Functional/config/framework.yml | 18 - .../config/method_access_control.yml | 12 - .../Tests/Functional/config/routing.yml | 27 - .../Tests/Functional/config/security.yml | 17 - .../config/some_voters_disabled.yml | 10 - .../Tests/Functional/config/twig.yml | 7 - .../Tests/Metadata/ClassMetadataTest.php | 117 - .../Metadata/Driver/AnnotationDriverTest.php | 66 - .../Metadata/Driver/ConfigDriverTest.php | 54 - .../Fixtures/Controller/CrudController.php | 14 - .../Metadata/Driver/Fixtures/services.php | 46 - .../HasPermissionFunctionCompilerTest.php | 40 - .../Expression/PermissionEvaluatorTest.php | 143 - .../Tests/Security/Acl/Voter/AclVoterTest.php | 396 -- .../RunAsAuthenticationProviderTest.php | 86 - .../Token/RunAsUserTokenTest.php | 54 - .../AclAfterInvocationProviderTest.php | 248 - .../AfterInvocationManagerTest.php | 107 - .../Expression/ExpressionCompilerTest.php | 150 - .../Expression/ExpressionLexerTest.php | 27 - .../Expression/ExpressionParserTest.php | 158 - .../Expression/ExpressionVoterTest.php | 113 - .../Expression/Fixture/Issue22/Project.php | 18 - .../Fixture/Issue22/SecuredObject.php | 14 - .../ParameterExpressionCompilerTest.php | 67 - .../MethodSecurityInterceptorTest.php | 314 - .../Interception/SecurityPointcutTest.php | 34 - .../Twig/SecurityExtension.php | 35 - .../composer.json | 25 - .../phpunit.xml.dist | 19 - vendor/kriswallsmith/assetic/.gitignore | 4 - vendor/kriswallsmith/assetic/.travis.yml | 16 - vendor/kriswallsmith/assetic/CHANGELOG-1.0.md | 29 - vendor/kriswallsmith/assetic/CHANGELOG-1.1.md | 9 - vendor/kriswallsmith/assetic/LICENSE | 19 - vendor/kriswallsmith/assetic/README.md | 284 - vendor/kriswallsmith/assetic/composer.json | 37 - vendor/kriswallsmith/assetic/docs/en/build.md | 32 - .../kriswallsmith/assetic/docs/en/concepts.md | 129 - .../kriswallsmith/assetic/docs/en/define.md | 145 - vendor/kriswallsmith/assetic/docs/en/index.md | 7 - .../assetic/docs/en/introduction.md | 21 - vendor/kriswallsmith/assetic/docs/ja/build.md | 30 - .../kriswallsmith/assetic/docs/ja/concepts.md | 121 - .../kriswallsmith/assetic/docs/ja/define.md | 140 - vendor/kriswallsmith/assetic/docs/ja/index.md | 7 - .../assetic/docs/ja/introduction.md | 18 - .../kriswallsmith/assetic/phpunit.travis.xml | 39 - vendor/kriswallsmith/assetic/phpunit.xml.dist | 42 - .../assetic/src/Assetic/Asset/AssetCache.php | 168 - .../src/Assetic/Asset/AssetCollection.php | 217 - .../Asset/AssetCollectionInterface.php | 53 - .../src/Assetic/Asset/AssetInterface.php | 156 - .../src/Assetic/Asset/AssetReference.php | 134 - .../assetic/src/Assetic/Asset/BaseAsset.php | 169 - .../assetic/src/Assetic/Asset/FileAsset.php | 78 - .../assetic/src/Assetic/Asset/GlobAsset.php | 111 - .../assetic/src/Assetic/Asset/HttpAsset.php | 79 - .../AssetCollectionFilterIterator.php | 84 - .../Iterator/AssetCollectionIterator.php | 109 - .../assetic/src/Assetic/Asset/StringAsset.php | 55 - .../assetic/src/Assetic/AssetManager.php | 79 - .../assetic/src/Assetic/AssetWriter.php | 107 - .../assetic/src/Assetic/Cache/ApcCache.php | 66 - .../src/Assetic/Cache/CacheInterface.php | 53 - .../assetic/src/Assetic/Cache/ConfigCache.php | 123 - .../src/Assetic/Cache/ExpiringCache.php | 60 - .../src/Assetic/Cache/FilesystemCache.php | 65 - .../src/Assetic/Exception/Exception.php | 21 - .../src/Assetic/Exception/FilterException.php | 73 - .../Extension/Twig/AsseticExtension.php | 76 - .../Extension/Twig/AsseticFilterFunction.php | 29 - .../Extension/Twig/AsseticFilterInvoker.php | 61 - .../Assetic/Extension/Twig/AsseticNode.php | 166 - .../Extension/Twig/AsseticTokenParser.php | 150 - .../Extension/Twig/TwigFormulaLoader.php | 97 - .../Assetic/Extension/Twig/TwigResource.php | 54 - .../src/Assetic/Factory/AssetFactory.php | 386 -- .../src/Assetic/Factory/LazyAssetManager.php | 204 - .../Factory/Loader/BasePhpFormulaLoader.php | 159 - .../Factory/Loader/CachedFormulaLoader.php | 68 - .../Factory/Loader/FormulaLoaderInterface.php | 34 - .../Loader/FunctionCallsFormulaLoader.php | 53 - .../Resource/CoalescingDirectoryResource.php | 112 - .../Factory/Resource/DirectoryResource.php | 133 - .../Assetic/Factory/Resource/FileResource.php | 47 - .../Resource/IteratorResourceInterface.php | 21 - .../Factory/Resource/ResourceInterface.php | 43 - .../Factory/Worker/EnsureFilterWorker.php | 60 - .../Factory/Worker/WorkerInterface.php | 31 - .../src/Assetic/Filter/BaseCssFilter.php | 71 - .../src/Assetic/Filter/CallablesFilter.php | 45 - .../src/Assetic/Filter/CoffeeScriptFilter.php | 73 - .../src/Assetic/Filter/CompassFilter.php | 358 -- .../src/Assetic/Filter/CssEmbedFilter.php | 139 - .../src/Assetic/Filter/CssImportFilter.php | 107 - .../src/Assetic/Filter/CssMinFilter.php | 74 - .../src/Assetic/Filter/CssRewriteFilter.php | 94 - .../src/Assetic/Filter/FilterCollection.php | 82 - .../src/Assetic/Filter/FilterInterface.php | 36 - .../GoogleClosure/BaseCompilerFilter.php | 84 - .../GoogleClosure/CompilerApiFilter.php | 100 - .../GoogleClosure/CompilerJarFilter.php | 90 - .../assetic/src/Assetic/Filter/GssFilter.php | 142 - .../src/Assetic/Filter/HashableInterface.php | 29 - .../src/Assetic/Filter/JSMinFilter.php | 34 - .../src/Assetic/Filter/JSMinPlusFilter.php | 34 - .../src/Assetic/Filter/JpegoptimFilter.php | 81 - .../src/Assetic/Filter/JpegtranFilter.php | 103 - .../assetic/src/Assetic/Filter/LessFilter.php | 114 - .../src/Assetic/Filter/LessphpFilter.php | 51 - .../src/Assetic/Filter/OptiPngFilter.php | 75 - .../src/Assetic/Filter/PackagerFilter.php | 64 - .../src/Assetic/Filter/PackerFilter.php | 56 - .../src/Assetic/Filter/PngoutFilter.php | 128 - .../src/Assetic/Filter/Sass/SassFilter.php | 176 - .../src/Assetic/Filter/Sass/ScssFilter.php | 28 - .../src/Assetic/Filter/SprocketsFilter.php | 148 - .../src/Assetic/Filter/StylusFilter.php | 117 - .../src/Assetic/Filter/UglifyJsFilter.php | 136 - .../Filter/Yui/BaseCompressorFilter.php | 107 - .../Filter/Yui/CssCompressorFilter.php | 28 - .../Assetic/Filter/Yui/JsCompressorFilter.php | 61 - .../assetic/src/Assetic/FilterManager.php | 64 - .../assetic/src/Assetic/Util/PathUtils.php | 31 - .../src/Assetic/Util/TraversableString.php | 44 - .../src/Assetic/ValueSupplierInterface.php | 29 - .../kriswallsmith/assetic/src/functions.php | 121 - .../Assetic/Test/Asset/AssetCacheTest.php | 175 - .../Test/Asset/AssetCollectionTest.php | 318 - .../Assetic/Test/Asset/AssetReferenceTest.php | 126 - .../Assetic/Test/Asset/FileAssetTest.php | 72 - .../Assetic/Test/Asset/GlobAssetTest.php | 61 - .../Assetic/Test/Asset/HttpAssetTest.php | 58 - .../Assetic/Test/Asset/StringAssetTest.php | 79 - .../tests/Assetic/Test/AssetManagerTest.php | 53 - .../tests/Assetic/Test/AssetWriterTest.php | 206 - .../tests/Assetic/Test/Cache/ApcCacheTest.php | 42 - .../Assetic/Test/Cache/ConfigCacheTest.php | 65 - .../Assetic/Test/Cache/ExpiringCacheTest.php | 111 - .../Test/Cache/FilesystemCacheTest.php | 52 - .../Extension/Twig/AsseticExtensionTest.php | 204 - .../Extension/Twig/TwigFormulaLoaderTest.php | 97 - .../Test/Extension/Twig/TwigResourceTest.php | 48 - .../Twig/templates/absolute_path.twig | 3 - .../Extension/Twig/templates/combine.twig | 3 - .../Test/Extension/Twig/templates/debug.twig | 3 - .../Extension/Twig/templates/filters.twig | 3 - .../Extension/Twig/templates/function.twig | 3 - .../Test/Extension/Twig/templates/glob.twig | 3 - .../Test/Extension/Twig/templates/image.twig | 3 - .../Extension/Twig/templates/mixture.twig | 3 - .../Twig/templates/optional_filter.twig | 3 - .../Twig/templates/output_pattern.twig | 3 - .../Extension/Twig/templates/output_url.twig | 3 - .../Extension/Twig/templates/reference.twig | 3 - .../Extension/Twig/templates/variables.twig | 5 - .../Assetic/Test/Factory/AssetFactoryTest.php | 203 - .../Test/Factory/LazyAssetManagerTest.php | 96 - .../Loader/CachedFormulaLoaderTest.php | 138 - .../Loader/FunctionCallsFormulaLoaderTest.php | 69 - .../Test/Factory/Loader/templates/debug.php | 8 - .../CoalescingDirectoryResourceTest.php | 42 - .../Resource/DirectoryResourceTest.php | 108 - .../Factory/Resource/FileResourceTest.php | 42 - .../Factory/Resource/Fixtures/dir1/file1.txt | 0 .../Factory/Resource/Fixtures/dir1/file2.txt | 0 .../Factory/Resource/Fixtures/dir2/file1.txt | 0 .../Factory/Resource/Fixtures/dir2/file3.txt | 0 .../Factory/Worker/EnsureFilterWorkerTest.php | 47 - .../Test/Filter/BaseImageFilterTest.php | 24 - .../Test/Filter/CallablesFilterTest.php | 39 - .../Test/Filter/CoffeeScriptFilterTest.php | 73 - .../Assetic/Test/Filter/CompassFilterTest.php | 66 - .../Test/Filter/CssEmbedFilterTest.php | 54 - .../Test/Filter/CssImportFilterTest.php | 67 - .../Assetic/Test/Filter/CssMinFilterTest.php | 40 - .../Test/Filter/CssRewriteFilterTest.php | 124 - .../Test/Filter/FilterCollectionTest.php | 59 - .../GoogleClosure/CompilerApiFilterTest.php | 59 - .../GoogleClosure/CompilerJarFilterTest.php | 53 - .../Assetic/Test/Filter/GssFilterTest.php | 45 - .../Assetic/Test/Filter/JSMinFilterTest.php | 39 - .../Test/Filter/JSMinPlusFilterTest.php | 39 - .../Test/Filter/JpegoptimFilterTest.php | 45 - .../Test/Filter/JpegtranFilterTest.php | 45 - .../Assetic/Test/Filter/LessFilterTest.php | 63 - .../Assetic/Test/Filter/LessphpFilterTest.php | 67 - .../Assetic/Test/Filter/OptiPngFilterTest.php | 56 - .../Test/Filter/PackagerFilterTest.php | 69 - .../Assetic/Test/Filter/PackerFilterTest.php | 36 - .../Assetic/Test/Filter/PngoutFilterTest.php | 57 - .../Test/Filter/Sass/SassFilterTest.php | 70 - .../Test/Filter/Sass/ScssFilterTest.php | 44 - .../Test/Filter/SprocketsFilterTest.php | 69 - .../Assetic/Test/Filter/StylusFilterTest.php | 53 - .../Test/Filter/UglifyJsFilterTest.php | 100 - .../Filter/Yui/BaseCompressorFilterTest.php | 31 - .../Filter/Yui/CssCompressorFilterTest.php | 23 - .../Filter/Yui/JsCompressorFilterTest.php | 62 - .../Test/Filter/fixtures/compass/compass.sass | 4 - .../fixtures/compass/partials/_sass.sass | 4 - .../fixtures/compass/partials/_scss.scss | 6 - .../Filter/fixtures/compass/stylesheet.sass | 4 - .../Filter/fixtures/compass/stylesheet.scss | 6 - .../Test/Filter/fixtures/cssembed/test.css | 4 - .../Test/Filter/fixtures/cssimport/import.css | 2 - .../Test/Filter/fixtures/cssimport/main.css | 4 - .../Test/Filter/fixtures/cssimport/more.sass | 1 - .../fixtures/cssimport/more/evenmore/bg.gif | 0 .../cssimport/more/evenmore/deep1.css | 2 - .../cssimport/more/evenmore/deep2.css | 4 - .../fixtures/cssimport/noncssimport.css | 2 - .../Test/Filter/fixtures/cssmin/fonts.css | 3 - .../Test/Filter/fixtures/cssmin/main.css | 5 - .../Assetic/Test/Filter/fixtures/home.gif | Bin 61 -> 0 bytes .../Assetic/Test/Filter/fixtures/home.jpg | Bin 431 -> 0 bytes .../Assetic/Test/Filter/fixtures/home.png | Bin 184 -> 0 bytes .../Assetic/Test/Filter/fixtures/jsmin/js.js | 7 - .../Test/Filter/fixtures/less/_include.less | 1 - .../Test/Filter/fixtures/less/main.less | 3 - .../fixtures/packager/app/application.js | 11 - .../Filter/fixtures/packager/lib/package.yml | 4 - .../Test/Filter/fixtures/packager/lib/util.js | 11 - .../Test/Filter/fixtures/packer/example.js | 7 - .../Test/Filter/fixtures/sass/_include.scss | 1 - .../Test/Filter/fixtures/sass/main.scss | 3 - .../Test/Filter/fixtures/sprockets/include.js | 1 - .../sprockets/lib1/assets/images/image.gif | Bin 49 -> 0 bytes .../Filter/fixtures/sprockets/lib1/header.js | 3 - .../Filter/fixtures/sprockets/lib2/footer.js | 1 - .../Test/Filter/fixtures/sprockets/main.js | 5 - .../Test/Filter/fixtures/uglifyjs/script.js | 18 - .../tests/Assetic/Test/FilterManagerTest.php | 58 - .../tests/Assetic/Test/Fixture/messages.de.js | 1 - .../tests/Assetic/Test/Fixture/messages.en.js | 1 - .../tests/Assetic/Test/Fixture/messages.fr.js | 1 - .../Test/Util/TraversableStringTest.php | 35 - .../kriswallsmith/assetic/tests/bootstrap.php | 46 - vendor/monolog/monolog/.travis.yml | 11 - vendor/monolog/monolog/CHANGELOG.mdown | 38 - vendor/monolog/monolog/LICENSE | 19 - vendor/monolog/monolog/README.mdown | 172 - .../Seldaek-monolog-abc80e0/.gitignore | 4 - .../Seldaek-monolog-abc80e0/.travis.yml | 11 - .../Seldaek-monolog-abc80e0/CHANGELOG.mdown | 38 - .../monolog/Seldaek-monolog-abc80e0/LICENSE | 19 - .../Seldaek-monolog-abc80e0/README.mdown | 172 - .../Seldaek-monolog-abc80e0/composer.json | 27 - .../Seldaek-monolog-abc80e0/doc/extending.md | 76 - .../Seldaek-monolog-abc80e0/doc/sockets.md | 37 - .../Seldaek-monolog-abc80e0/doc/usage.md | 124 - .../Seldaek-monolog-abc80e0/phpunit.xml.dist | 15 - .../Monolog/Formatter/ChromePHPFormatter.php | 77 - .../Monolog/Formatter/FormatterInterface.php | 36 - .../Formatter/GelfMessageFormatter.php | 91 - .../src/Monolog/Formatter/JsonFormatter.php | 40 - .../src/Monolog/Formatter/LineFormatter.php | 92 - .../Monolog/Formatter/NormalizerFormatter.php | 90 - .../Monolog/Formatter/WildfireFormatter.php | 87 - .../src/Monolog/Handler/AbstractHandler.php | 173 - .../Handler/AbstractProcessingHandler.php | 70 - .../src/Monolog/Handler/BufferHandler.php | 67 - .../src/Monolog/Handler/ChromePHPHandler.php | 127 - .../ActivationStrategyInterface.php | 28 - .../ErrorLevelActivationStrategy.php | 32 - .../Monolog/Handler/FingersCrossedHandler.php | 104 - .../src/Monolog/Handler/FirePHPHandler.php | 161 - .../src/Monolog/Handler/GelfHandler.php | 66 - .../src/Monolog/Handler/GroupHandler.php | 74 - .../src/Monolog/Handler/HandlerInterface.php | 77 - .../src/Monolog/Handler/MailHandler.php | 55 - .../src/Monolog/Handler/MongoDBHandler.php | 51 - .../Monolog/Handler/NativeMailerHandler.php | 49 - .../src/Monolog/Handler/NullHandler.php | 45 - .../Monolog/Handler/RotatingFileHandler.php | 109 - .../src/Monolog/Handler/SocketHandler.php | 272 - .../src/Monolog/Handler/StreamHandler.php | 71 - .../Monolog/Handler/SwiftMailerHandler.php | 55 - .../src/Monolog/Handler/SyslogHandler.php | 108 - .../src/Monolog/Handler/TestHandler.php | 120 - .../src/Monolog/Logger.php | 421 -- .../Processor/IntrospectionProcessor.php | 58 - .../Processor/MemoryPeakUsageProcessor.php | 40 - .../src/Monolog/Processor/MemoryProcessor.php | 50 - .../Processor/MemoryUsageProcessor.php | 40 - .../src/Monolog/Processor/WebProcessor.php | 66 - .../Formatter/ChromePHPFormatterTest.php | 158 - .../Formatter/GelfMessageFormatterTest.php | 150 - .../Monolog/Formatter/JsonFormatterTest.php | 41 - .../Monolog/Formatter/LineFormatterTest.php | 134 - .../Formatter/NormalizerFormatterTest.php | 107 - .../Formatter/WildfireFormatterTest.php | 111 - .../Functional/Handler/FirePHPHandlerTest.php | 32 - .../Monolog/Handler/AbstractHandlerTest.php | 104 - .../Handler/AbstractProcessingHandlerTest.php | 80 - .../Monolog/Handler/BufferHandlerTest.php | 84 - .../Monolog/Handler/ChromePHPHandlerTest.php | 98 - .../Handler/FingersCrossedHandlerTest.php | 151 - .../Monolog/Handler/FirePHPHandlerTest.php | 94 - .../tests/Monolog/Handler/Fixtures/.gitkeep | 0 .../tests/Monolog/Handler/GelfHandlerTest.php | 102 - .../Monolog/Handler/GroupHandlerTest.php | 71 - .../tests/Monolog/Handler/MailHandlerTest.php | 75 - .../Monolog/Handler/MongoDBHandlerTest.php | 54 - .../tests/Monolog/Handler/NullHandlerTest.php | 33 - .../Handler/RotatingFileHandlerTest.php | 100 - .../Monolog/Handler/SocketHandlerTest.php | 284 - .../Monolog/Handler/StreamHandlerTest.php | 77 - .../Monolog/Handler/SyslogHandlerTest.php | 41 - .../tests/Monolog/Handler/TestHandlerTest.php | 54 - .../tests/Monolog/LoggerTest.php | 367 -- .../Processor/IntrospectionProcessorTest.php | 64 - .../MemoryPeakUsageProcessorTest.php | 29 - .../Processor/MemoryUsageProcessorTest.php | 29 - .../Monolog/Processor/WebProcessorTest.php | 68 - .../tests/Monolog/TestCase.php | 58 - .../tests/bootstrap.php | 13 - vendor/monolog/monolog/composer.json | 27 - vendor/monolog/monolog/doc/extending.md | 76 - vendor/monolog/monolog/doc/sockets.md | 37 - vendor/monolog/monolog/doc/usage.md | 124 - .../Monolog/Formatter/ChromePHPFormatter.php | 77 - .../Monolog/Formatter/FormatterInterface.php | 36 - .../Formatter/GelfMessageFormatter.php | 91 - .../src/Monolog/Formatter/JsonFormatter.php | 40 - .../src/Monolog/Formatter/LineFormatter.php | 92 - .../Monolog/Formatter/NormalizerFormatter.php | 90 - .../Monolog/Formatter/WildfireFormatter.php | 87 - .../src/Monolog/Handler/AbstractHandler.php | 173 - .../Handler/AbstractProcessingHandler.php | 70 - .../src/Monolog/Handler/BufferHandler.php | 67 - .../src/Monolog/Handler/ChromePHPHandler.php | 127 - .../ActivationStrategyInterface.php | 28 - .../ErrorLevelActivationStrategy.php | 32 - .../Monolog/Handler/FingersCrossedHandler.php | 104 - .../src/Monolog/Handler/FirePHPHandler.php | 161 - .../src/Monolog/Handler/GelfHandler.php | 66 - .../src/Monolog/Handler/GroupHandler.php | 74 - .../src/Monolog/Handler/HandlerInterface.php | 77 - .../src/Monolog/Handler/MailHandler.php | 55 - .../src/Monolog/Handler/MongoDBHandler.php | 51 - .../Monolog/Handler/NativeMailerHandler.php | 49 - .../src/Monolog/Handler/NullHandler.php | 45 - .../Monolog/Handler/RotatingFileHandler.php | 109 - .../src/Monolog/Handler/SocketHandler.php | 272 - .../src/Monolog/Handler/StreamHandler.php | 71 - .../Monolog/Handler/SwiftMailerHandler.php | 55 - .../src/Monolog/Handler/SyslogHandler.php | 108 - .../src/Monolog/Handler/TestHandler.php | 120 - vendor/monolog/monolog/src/Monolog/Logger.php | 421 -- .../Processor/IntrospectionProcessor.php | 58 - .../Processor/MemoryPeakUsageProcessor.php | 40 - .../src/Monolog/Processor/MemoryProcessor.php | 50 - .../Processor/MemoryUsageProcessor.php | 40 - .../src/Monolog/Processor/WebProcessor.php | 66 - .../Composer/ScriptHandler.php | 172 - .../Configurator/Configurator.php | 186 - .../Configurator/Form/DoctrineStepType.php | 47 - .../Configurator/Form/SecretStepType.php | 33 - .../Configurator/Step/DoctrineStep.php | 143 - .../Configurator/Step/SecretStep.php | 87 - .../Configurator/Step/StepInterface.php | 65 - .../Controller/ConfiguratorController.php | 107 - .../SensioDistributionExtension.php | 33 - .../Sensio/Bundle/DistributionBundle/LICENSE | 19 - .../DistributionBundle/Resources/bin/build.sh | 102 - .../Resources/bin/build_bootstrap.php | 26 - .../config/routing/webconfigurator.xml | 18 - .../Resources/config/webconfigurator.xml | 17 - .../public/webconfigurator/css/configure.css | 153 - .../public/webconfigurator/css/install.css | 148 - .../images/background-textfield.gif | Bin 63 -> 0 bytes .../webconfigurator/images/blue-arrow.png | Bin 181 -> 0 bytes .../public/webconfigurator/images/favicon.ico | Bin 1150 -> 0 bytes .../webconfigurator/images/logo-big.gif | Bin 4060 -> 0 bytes .../webconfigurator/images/logo-small.gif | Bin 1698 -> 0 bytes .../webconfigurator/images/notification.gif | Bin 206 -> 0 bytes .../skeleton/app/SymfonyRequirements.php | 603 -- .../Resources/skeleton/app/check.php | 55 - .../Resources/skeleton/web/config.php | 98 - .../Configurator/Step/doctrine.html.twig | 31 - .../views/Configurator/Step/secret.html.twig | 44 - .../views/Configurator/check.html.twig | 43 - .../views/Configurator/final.html.twig | 28 - .../views/Configurator/form.html.twig | 34 - .../views/Configurator/layout.html.twig | 20 - .../views/Configurator/steps.html.twig | 14 - .../SensioDistributionBundle.php | 32 - .../Bundle/DistributionBundle/composer.json | 20 - .../Bundle/FrameworkExtraBundle/.gitignore | 4 - .../Bundle/FrameworkExtraBundle/.travis.yml | 9 - .../FrameworkExtraBundle/CHANGELOG-2.1.md | 6 - .../Configuration/Cache.php | 171 - .../Configuration/ConfigurationAnnotation.php | 22 - .../Configuration/ConfigurationInterface.php | 27 - .../Configuration/Method.php | 69 - .../Configuration/ParamConverter.php | 179 - .../Configuration/Route.php | 33 - .../Configuration/Template.php | 148 - .../Compiler/AddParamConverterPass.php | 46 - .../DependencyInjection/Configuration.php | 57 - .../SensioFrameworkExtraExtension.php | 77 - .../EventListener/CacheListener.php | 65 - .../EventListener/ControllerListener.php | 84 - .../EventListener/ParamConverterListener.php | 87 - .../EventListener/TemplateListener.php | 126 - .../Bundle/FrameworkExtraBundle/LICENSE | 19 - .../Bundle/FrameworkExtraBundle/README.md | 6 - .../ParamConverter/DateTimeParamConverter.php | 59 - .../ParamConverter/DoctrineParamConverter.php | 161 - .../ParamConverterInterface.php | 27 - .../ParamConverter/ParamConverterManager.php | 142 - .../Resources/config/annotations.xml | 17 - .../Resources/config/cache.xml | 12 - .../Resources/config/converters.xml | 31 - .../Resources/config/routing.xml | 31 - .../Resources/config/services.xml | 17 - .../Resources/config/view.xml | 18 - .../Resources/doc/annotations/cache.rst | 60 - .../Resources/doc/annotations/converters.rst | 217 - .../Resources/doc/annotations/routing.rst | 166 - .../Resources/doc/annotations/view.rst | 87 - .../Resources/doc/index.rst | 145 - .../AnnotatedRouteControllerLoader.php | 76 - .../SensioFrameworkExtraBundle.php | 31 - .../Templating/TemplateGuesser.php | 92 - .../ConfigurationAnnotationTest.php | 18 - .../Tests/EventListener/CacheListenerTest.php | 101 - .../EventListener/ControllerListenerTest.php | 104 - .../Fixture/FooControllerCacheAtClass.php | 17 - .../FooControllerCacheAtClassAndMethod.php | 34 - .../Fixture/FooControllerCacheAtMethod.php | 17 - .../ParamConverterListenerTest.php | 34 - .../DateTimeParamConverterTest.php | 69 - .../DoctrineParamConverterTest.php | 170 - .../ParamConverterManagerTest.php | 166 - .../Bundle/FrameworkExtraBundle/UPGRADE.md | 50 - .../Bundle/FrameworkExtraBundle/composer.json | 27 - .../FrameworkExtraBundle/phpunit.xml.dist | 20 - .../Sensio/Bundle/GeneratorBundle/.gitignore | 3 - .../Sensio/Bundle/GeneratorBundle/.travis.yml | 9 - .../Command/GenerateBundleCommand.php | 316 - .../Command/GenerateDoctrineCommand.php | 41 - .../Command/GenerateDoctrineCrudCommand.php | 274 - .../Command/GenerateDoctrineEntityCommand.php | 312 - .../Command/GenerateDoctrineFormCommand.php | 71 - .../Command/Helper/DialogHelper.php | 65 - .../GeneratorBundle/Command/Validators.php | 160 - .../Generator/BundleGenerator.php | 76 - .../Generator/DoctrineCrudGenerator.php | 290 - .../Generator/DoctrineEntityGenerator.php | 119 - .../Generator/DoctrineFormGenerator.php | 109 - .../GeneratorBundle/Generator/Generator.php | 41 - .../Sensio/Bundle/GeneratorBundle/LICENSE | 19 - .../Manipulator/KernelManipulator.php | 105 - .../Manipulator/Manipulator.php | 85 - .../Manipulator/RoutingManipulator.php | 75 - .../Sensio/Bundle/GeneratorBundle/README.md | 10 - .../doc/commands/generate_bundle.rst | 68 - .../doc/commands/generate_doctrine_crud.rst | 65 - .../doc/commands/generate_doctrine_entity.rst | 55 - .../doc/commands/generate_doctrine_form.rst | 23 - .../GeneratorBundle/Resources/doc/index.rst | 42 - .../Resources/skeleton/bundle/Bundle.php | 9 - .../skeleton/bundle/Configuration.php | 29 - .../skeleton/bundle/DefaultController.php | 28 - .../skeleton/bundle/DefaultControllerTest.php | 17 - .../Resources/skeleton/bundle/Extension.php | 37 - .../Resources/skeleton/bundle/index.html.twig | 1 - .../Resources/skeleton/bundle/messages.fr.xlf | 11 - .../Resources/skeleton/bundle/routing.php | 11 - .../Resources/skeleton/bundle/routing.xml | 10 - .../Resources/skeleton/bundle/routing.yml | 3 - .../Resources/skeleton/bundle/services.php | 21 - .../Resources/skeleton/bundle/services.xml | 20 - .../Resources/skeleton/bundle/services.yml | 7 - .../skeleton/crud/actions/create.php | 42 - .../skeleton/crud/actions/delete.php | 38 - .../Resources/skeleton/crud/actions/edit.php | 36 - .../Resources/skeleton/crud/actions/index.php | 25 - .../Resources/skeleton/crud/actions/new.php | 26 - .../Resources/skeleton/crud/actions/show.php | 39 - .../skeleton/crud/actions/update.php | 48 - .../skeleton/crud/config/routing.php | 52 - .../skeleton/crud/config/routing.xml | 44 - .../skeleton/crud/config/routing.yml | 40 - .../Resources/skeleton/crud/controller.php | 49 - .../crud/tests/others/full_scenario.php | 44 - .../crud/tests/others/short_scenario.php | 14 - .../Resources/skeleton/crud/tests/test.php | 18 - .../skeleton/crud/views/edit.html.twig | 11 - .../skeleton/crud/views/index.html.twig | 56 - .../skeleton/crud/views/new.html.twig | 11 - .../crud/views/others/actions.html.twig | 12 - .../views/others/record_actions.html.twig | 22 - .../skeleton/crud/views/show.html.twig | 28 - .../Resources/skeleton/form/FormType.php | 34 - .../GeneratorBundle/SensioGeneratorBundle.php | 23 - .../Command/GenerateBundleCommandTest.php | 101 - .../Tests/Command/GenerateCommandTest.php | 74 - .../GenerateDoctrineCrudCommandTest.php | 141 - .../GenerateDoctrineEntityCommandTest.php | 104 - .../Tests/Generator/BundleGeneratorTest.php | 59 - .../Generator/DoctrineCrudGeneratorTest.php | 206 - .../Generator/DoctrineFormGeneratorTest.php | 40 - .../Tests/Generator/GeneratorTest.php | 32 - .../Bundle/GeneratorBundle/composer.json | 30 - .../Bundle/GeneratorBundle/phpunit.xml.dist | 20 - vendor/swiftmailer/swiftmailer/.gitignore | 6 - vendor/swiftmailer/swiftmailer/CHANGES | 100 - vendor/swiftmailer/swiftmailer/LICENSE | 165 - vendor/swiftmailer/swiftmailer/README | 16 - vendor/swiftmailer/swiftmailer/README.git | 67 - vendor/swiftmailer/swiftmailer/VERSION | 1 - vendor/swiftmailer/swiftmailer/build.xml | 112 - vendor/swiftmailer/swiftmailer/composer.json | 29 - .../swiftmailer/create_pear_package.php | 42 - .../swiftmailer/swiftmailer/doc/headers.rst | 742 --- .../swiftmailer/doc/help-resources.rst | 44 - .../swiftmailer/doc/including-the-files.rst | 56 - vendor/swiftmailer/swiftmailer/doc/index.rst | 16 - .../swiftmailer/doc/installing.rst | 201 - .../swiftmailer/doc/introduction.rst | 135 - .../swiftmailer/swiftmailer/doc/japanese.rst | 22 - .../swiftmailer/swiftmailer/doc/messages.rst | 964 --- .../swiftmailer/swiftmailer/doc/overview.rst | 161 - .../swiftmailer/swiftmailer/doc/plugins.rst | 385 -- .../swiftmailer/swiftmailer/doc/sending.rst | 592 -- .../swiftmailer/doc/uml/Encoders.graffle | Bin 3503 -> 0 bytes .../swiftmailer/doc/uml/Mime.graffle | Bin 5575 -> 0 bytes .../swiftmailer/doc/uml/Transports.graffle | Bin 3061 -> 0 bytes .../swiftmailer/lib/classes/Swift.php | 81 - .../lib/classes/Swift/Attachment.php | 66 - .../AbstractFilterableInputStream.php | 164 - .../Swift/ByteStream/ArrayByteStream.php | 170 - .../Swift/ByteStream/FileByteStream.php | 212 - .../lib/classes/Swift/CharacterReader.php | 59 - .../GenericFixedWidthReader.php | 89 - .../Swift/CharacterReader/UsAsciiReader.php | 75 - .../Swift/CharacterReader/Utf8Reader.php | 171 - .../classes/Swift/CharacterReaderFactory.php | 25 - .../SimpleCharacterReaderFactory.php | 123 - .../lib/classes/Swift/CharacterStream.php | 82 - .../CharacterStream/ArrayCharacterStream.php | 284 - .../CharacterStream/NgCharacterStream.php | 283 - .../lib/classes/Swift/ConfigurableSpool.php | 59 - .../lib/classes/Swift/DependencyContainer.php | 341 -- .../lib/classes/Swift/DependencyException.php | 26 - .../lib/classes/Swift/EmbeddedFile.php | 64 - .../swiftmailer/lib/classes/Swift/Encoder.php | 27 - .../classes/Swift/Encoder/Base64Encoder.php | 56 - .../lib/classes/Swift/Encoder/QpEncoder.php | 275 - .../classes/Swift/Encoder/Rfc2231Encoder.php | 81 - .../lib/classes/Swift/Encoding.php | 66 - .../lib/classes/Swift/Events/CommandEvent.php | 61 - .../classes/Swift/Events/CommandListener.php | 24 - .../lib/classes/Swift/Events/Event.php | 37 - .../classes/Swift/Events/EventDispatcher.php | 72 - .../classes/Swift/Events/EventListener.php | 19 - .../lib/classes/Swift/Events/EventObject.php | 61 - .../classes/Swift/Events/ResponseEvent.php | 62 - .../classes/Swift/Events/ResponseListener.php | 24 - .../lib/classes/Swift/Events/SendEvent.php | 116 - .../lib/classes/Swift/Events/SendListener.php | 30 - .../Swift/Events/SimpleEventDispatcher.php | 156 - .../Swift/Events/TransportChangeEvent.php | 27 - .../Swift/Events/TransportChangeListener.php | 48 - .../Swift/Events/TransportExceptionEvent.php | 44 - .../Events/TransportExceptionListener.php | 24 - .../lib/classes/Swift/FailoverTransport.php | 43 - .../lib/classes/Swift/FileSpool.php | 190 - .../lib/classes/Swift/FileStream.php | 24 - .../lib/classes/Swift/Filterable.php | 30 - .../swiftmailer/lib/classes/Swift/Image.php | 56 - .../lib/classes/Swift/InputByteStream.php | 70 - .../lib/classes/Swift/IoException.php | 26 - .../lib/classes/Swift/KeyCache.php | 92 - .../classes/Swift/KeyCache/ArrayKeyCache.php | 193 - .../classes/Swift/KeyCache/DiskKeyCache.php | 307 - .../classes/Swift/KeyCache/DummyKeyCache.php | 114 - .../Swift/KeyCache/KeyCacheInputStream.php | 48 - .../classes/Swift/KeyCache/NullKeyCache.php | 101 - .../KeyCache/SimpleKeyCacheInputStream.php | 123 - .../classes/Swift/LoadBalancedTransport.php | 43 - .../lib/classes/Swift/MailTransport.php | 43 - .../swiftmailer/lib/classes/Swift/Mailer.php | 111 - .../Swift/Mailer/ArrayRecipientIterator.php | 54 - .../Swift/Mailer/RecipientIterator.php | 32 - .../lib/classes/Swift/MemorySpool.php | 82 - .../swiftmailer/lib/classes/Swift/Message.php | 77 - .../lib/classes/Swift/Mime/Attachment.php | 139 - .../classes/Swift/Mime/CharsetObserver.php | 24 - .../lib/classes/Swift/Mime/ContentEncoder.php | 33 - .../ContentEncoder/Base64ContentEncoder.php | 66 - .../ContentEncoder/NativeQpContentEncoder.php | 58 - .../ContentEncoder/PlainContentEncoder.php | 159 - .../Mime/ContentEncoder/QpContentEncoder.php | 120 - .../lib/classes/Swift/Mime/EmbeddedFile.php | 43 - .../classes/Swift/Mime/EncodingObserver.php | 24 - .../lib/classes/Swift/Mime/Grammar.php | 174 - .../lib/classes/Swift/Mime/Header.php | 83 - .../lib/classes/Swift/Mime/HeaderEncoder.php | 24 - .../HeaderEncoder/Base64HeaderEncoder.php | 55 - .../Mime/HeaderEncoder/QpHeaderEncoder.php | 65 - .../lib/classes/Swift/Mime/HeaderFactory.php | 67 - .../lib/classes/Swift/Mime/HeaderSet.php | 166 - .../Swift/Mime/Headers/AbstractHeader.php | 471 -- .../classes/Swift/Mime/Headers/DateHeader.php | 113 - .../Mime/Headers/IdentificationHeader.php | 160 - .../Swift/Mime/Headers/MailboxHeader.php | 316 - .../Mime/Headers/ParameterizedHeader.php | 248 - .../classes/Swift/Mime/Headers/PathHeader.php | 131 - .../Swift/Mime/Headers/UnstructuredHeader.php | 103 - .../lib/classes/Swift/Mime/Message.php | 226 - .../lib/classes/Swift/Mime/MimeEntity.php | 101 - .../lib/classes/Swift/Mime/MimePart.php | 213 - .../Swift/Mime/ParameterizedHeader.php | 31 - .../Swift/Mime/SimpleHeaderFactory.php | 178 - .../classes/Swift/Mime/SimpleHeaderSet.php | 376 -- .../lib/classes/Swift/Mime/SimpleMessage.php | 611 -- .../classes/Swift/Mime/SimpleMimeEntity.php | 797 --- .../lib/classes/Swift/MimePart.php | 56 - .../lib/classes/Swift/NullTransport.php | 38 - .../lib/classes/Swift/OutputByteStream.php | 39 - .../classes/Swift/Plugins/AntiFloodPlugin.php | 134 - .../Swift/Plugins/BandwidthMonitorPlugin.php | 157 - .../Swift/Plugins/Decorator/Replacements.php | 34 - .../classes/Swift/Plugins/DecoratorPlugin.php | 212 - .../Swift/Plugins/ImpersonatePlugin.php | 71 - .../lib/classes/Swift/Plugins/Logger.php | 35 - .../classes/Swift/Plugins/LoggerPlugin.php | 144 - .../Swift/Plugins/Loggers/ArrayLogger.php | 70 - .../Swift/Plugins/Loggers/EchoLogger.php | 59 - .../classes/Swift/Plugins/MessageLogger.php | 76 - .../Swift/Plugins/Pop/Pop3Connection.php | 34 - .../Swift/Plugins/Pop/Pop3Exception.php | 30 - .../Swift/Plugins/PopBeforeSmtpPlugin.php | 271 - .../Swift/Plugins/RedirectingPlugin.php | 105 - .../lib/classes/Swift/Plugins/Reporter.php | 32 - .../classes/Swift/Plugins/ReporterPlugin.php | 72 - .../Swift/Plugins/Reporters/HitReporter.php | 57 - .../Swift/Plugins/Reporters/HtmlReporter.php | 39 - .../lib/classes/Swift/Plugins/Sleeper.php | 24 - .../classes/Swift/Plugins/ThrottlerPlugin.php | 169 - .../lib/classes/Swift/Plugins/Timer.php | 24 - .../lib/classes/Swift/Preferences.php | 92 - .../Swift/ReplacementFilterFactory.php | 25 - .../classes/Swift/RfcComplianceException.php | 26 - .../lib/classes/Swift/SendmailTransport.php | 43 - .../lib/classes/Swift/SmtpTransport.php | 49 - .../swiftmailer/lib/classes/Swift/Spool.php | 52 - .../lib/classes/Swift/SpoolTransport.php | 44 - .../lib/classes/Swift/StreamFilter.php | 31 - .../ByteArrayReplacementFilter.php | 163 - .../StreamFilters/StringReplacementFilter.php | 61 - .../StringReplacementFilterFactory.php | 44 - .../lib/classes/Swift/SwiftException.php | 26 - .../lib/classes/Swift/Transport.php | 55 - .../Swift/Transport/AbstractSmtpTransport.php | 494 -- .../Esmtp/Auth/CramMd5Authenticator.php | 77 - .../Esmtp/Auth/LoginAuthenticator.php | 49 - .../Esmtp/Auth/PlainAuthenticator.php | 48 - .../Swift/Transport/Esmtp/AuthHandler.php | 250 - .../Swift/Transport/Esmtp/Authenticator.php | 33 - .../classes/Swift/Transport/EsmtpHandler.php | 77 - .../Swift/Transport/EsmtpTransport.php | 370 -- .../Swift/Transport/FailoverTransport.php | 86 - .../lib/classes/Swift/Transport/IoBuffer.php | 59 - .../Swift/Transport/LoadBalancedTransport.php | 170 - .../classes/Swift/Transport/MailInvoker.php | 34 - .../classes/Swift/Transport/MailTransport.php | 227 - .../classes/Swift/Transport/NullTransport.php | 87 - .../Swift/Transport/SendmailTransport.php | 153 - .../Swift/Transport/SimpleMailInvoker.php | 51 - .../lib/classes/Swift/Transport/SmtpAgent.php | 34 - .../Swift/Transport/SpoolTransport.php | 114 - .../classes/Swift/Transport/StreamBuffer.php | 299 - .../lib/classes/Swift/TransportException.php | 27 - .../lib/classes/Swift/Validate.php | 38 - .../lib/dependency_maps/cache_deps.php | 23 - .../lib/dependency_maps/message_deps.php | 9 - .../lib/dependency_maps/mime_deps.php | 110 - .../lib/dependency_maps/transport_deps.php | 68 - .../swiftmailer/lib/mime_types.php | 76 - .../swiftmailer/lib/preferences.php | 21 - .../swiftmailer/lib/swift_init.php | 28 - .../swiftmailer/lib/swift_required.php | 32 - .../swiftmailer/lib/swift_required_pear.php | 32 - vendor/swiftmailer/swiftmailer/notes/APPS | 15 - vendor/swiftmailer/swiftmailer/notes/CHARSETS | 46 - .../swiftmailer/swiftmailer/notes/message.xml | 22 - .../swiftmailer/notes/rfc/rfc0821.txt | 4050 ------------- .../swiftmailer/notes/rfc/rfc0822.txt | 2901 --------- .../swiftmailer/notes/rfc/rfc1341.txt | 5265 ----------------- .../swiftmailer/notes/rfc/rfc1521.txt | 4539 -------------- .../swiftmailer/notes/rfc/rfc1854.txt | 395 -- .../swiftmailer/notes/rfc/rfc2045.txt | 1739 ------ .../swiftmailer/notes/rfc/rfc2046.txt | 2467 -------- .../swiftmailer/notes/rfc/rfc2047.txt | 843 --- .../swiftmailer/notes/rfc/rfc2048.txt | 1180 ---- .../swiftmailer/notes/rfc/rfc2049.txt | 1347 ----- .../swiftmailer/notes/rfc/rfc2183.txt | 675 --- .../swiftmailer/notes/rfc/rfc2222.txt | 899 --- .../swiftmailer/notes/rfc/rfc2231.txt | 563 -- .../swiftmailer/notes/rfc/rfc2234.txt | 787 --- .../swiftmailer/notes/rfc/rfc2487.txt | 451 -- .../swiftmailer/notes/rfc/rfc2554.txt | 619 -- .../swiftmailer/notes/rfc/rfc2821.txt | 4427 -------------- .../swiftmailer/notes/rfc/rfc2822.txt | 2859 --------- .../swiftmailer/notes/rfc/rfc3676.txt | 1123 ---- .../swiftmailer/notes/rfc/rfc4505.txt | 507 -- .../swiftmailer/notes/rfc/rfc4616.txt | 619 -- .../swiftmailer/notes/rfc/rfc4954.txt | 1123 ---- .../swiftmailer/notes/rfc/whats_where.txt | 61 - vendor/swiftmailer/swiftmailer/notes/smtp.txt | 48 - .../swiftmailer/swiftmailer/package.xml.tpl | 73 - .../swiftmailer/test-suite/CHANGES | 7 - .../swiftmailer/test-suite/LICENSE | 165 - .../swiftmailer/swiftmailer/test-suite/README | 159 - .../swiftmailer/test-suite/config.php | 68 - .../swiftmailer/test-suite/index.php | 40 - .../test-suite/lib/Sweety/Reporter.php | 69 - .../lib/Sweety/Reporter/CliReporter.php | 203 - .../Sweety/Reporter/CliTestCaseReporter.php | 160 - .../lib/Sweety/Reporter/HtmlReporter.php | 174 - .../Sweety/Reporter/HtmlTestCaseReporter.php | 174 - .../test-suite/lib/Sweety/Runner.php | 56 - .../lib/Sweety/Runner/AbstractTestRunner.php | 365 -- .../lib/Sweety/Runner/CliRunner.php | 128 - .../lib/Sweety/Runner/HtmlRunner.php | 160 - .../test-suite/lib/Sweety/TestLocator.php | 25 - .../Sweety/TestLocator/PearStyleLocator.php | 71 - .../HELP_MY_TESTS_DONT_WORK_ANYMORE | 383 -- .../test-suite/lib/simpletest/LICENSE | 502 -- .../test-suite/lib/simpletest/README | 108 - .../test-suite/lib/simpletest/TODO.xml | 176 - .../test-suite/lib/simpletest/VERSION | 1 - .../lib/simpletest/authentication.php | 237 - .../test-suite/lib/simpletest/autorun.php | 97 - .../test-suite/lib/simpletest/browser.php | 1094 ---- .../test-suite/lib/simpletest/collector.php | 122 - .../lib/simpletest/compatibility.php | 166 - .../test-suite/lib/simpletest/cookies.php | 380 -- .../lib/simpletest/default_reporter.php | 163 - .../test-suite/lib/simpletest/detached.php | 96 - .../lib/simpletest/docs/en/docs.css | 121 - .../lib/simpletest/docs/fr/docs.css | 84 - .../lib/simpletest/docs/lastcraft/README | 1 - .../lib/simpletest/docs/onpk/README | 1 - .../test-suite/lib/simpletest/docs/pkg/README | 1 - .../lib/simpletest/docs/simpletest.org/README | 1 - .../docs/simpletest.org/favicon.ico | Bin 1150 -> 0 bytes .../images/book-domain-driven-design.jpg | Bin 6599 -> 0 bytes .../book-guide-to-php-design-patterns.jpg | Bin 5657 -> 0 bytes ...nthology-object-oriented-php-solutions.jpg | Bin 43265 -> 0 bytes .../docs/simpletest.org/images/quote.png | Bin 620 -> 0 bytes .../images/simpletest-contribute.png | Bin 4299 -> 0 bytes .../images/simpletest-download.png | Bin 4946 -> 0 bytes .../images/simpletest-external-bottom.png | Bin 533 -> 0 bytes .../images/simpletest-external-middle.png | Bin 217 -> 0 bytes .../images/simpletest-external-top.png | Bin 1085 -> 0 bytes .../images/simpletest-internal-bottom.png | Bin 516 -> 0 bytes .../images/simpletest-internal-middle.png | Bin 237 -> 0 bytes .../images/simpletest-internal-top.png | Bin 1158 -> 0 bytes .../simpletest.org/images/simpletest-logo.png | Bin 6892 -> 0 bytes .../images/simpletest-start-testing.png | Bin 5952 -> 0 bytes .../images/simpletest-support.png | Bin 5525 -> 0 bytes .../simpletest.org/images/test-in-cli.png | Bin 46023 -> 0 bytes .../images/test-with-1-fail.png | Bin 25562 -> 0 bytes .../images/test-with-1-pass.png | Bin 10213 -> 0 bytes .../simpletest/docs/simpletest.org/index.html | 192 - .../simpletest.org/js/jquery-1.2.1.pack.js | 11 - .../js/jquery-speakers_coaches_consultants.js | 30 - .../simpletest.org/js/jquery.heartbeat.js | 9 - .../simpletest.org/js/jquery.sparkline.js | 76 - .../docs/simpletest.org/simpletest.css | 43 - .../docs/simpletest.org/views/heartbeat.php | 174 - .../simpletest.org/views/photos_stream.php | 37 - .../lib/simpletest/docs/source/en/about.xml | 112 - .../en/authentication_documentation.xml | 337 -- .../docs/source/en/books_website.xml | 73 - .../source/en/boundary_classes_tutorial.xml | 405 -- .../docs/source/en/browser_documentation.xml | 281 - .../simpletest/docs/source/en/changelog.xml | 188 - .../docs/source/en/coding_standards.xml | 135 - .../source/en/display_subclass_tutorial.xml | 267 - .../docs/source/en/download_website.xml | 106 - .../source/en/expectation_documentation.xml | 383 -- .../source/en/experimental_dom_tester.xml | 231 - .../docs/source/en/experimental_intro.xml | 54 - .../docs/source/en/experimental_recorder.xml | 170 - .../docs/source/en/extension_eclipse.xml | 279 - .../docs/source/en/first_test_tutorial.xml | 436 -- .../source/en/form_testing_documentation.xml | 304 - .../docs/source/en/gain_control_tutorial.xml | 290 - .../source/en/group_test_documentation.xml | 332 -- .../docs/source/en/group_test_tutorial.xml | 239 - .../simpletest/docs/source/en/heartbeat.xml | 57 - .../lib/simpletest/docs/source/en/ideas.xml | 188 - .../source/en/improving_design_tutorial.xml | 195 - .../lib/simpletest/docs/source/en/index.xml | 220 - .../lib/simpletest/docs/source/en/intro.xml | 54 - .../source/en/mock_objects_documentation.xml | 708 --- .../docs/source/en/mock_objects_tutorial.xml | 359 -- .../simpletest/docs/source/en/overview.xml | 460 -- .../source/en/partial_mocks_documentation.xml | 402 -- .../docs/source/en/photos_stream.xml | 51 - .../docs/source/en/reporter_documentation.xml | 471 -- .../simpletest/docs/source/en/screencasts.xml | 76 - .../simpletest/docs/source/en/simple_test.xml | 524 -- .../source/en/softwares_using_simpletest.xml | 164 - .../en/speakers_coaches_consultancy.xml | 94 - .../docs/source/en/subclass_tutorial.xml | 255 - .../docs/source/en/support_website.xml | 59 - .../source/en/unit_test_documentation.xml | 313 - .../source/en/web_tester_documentation.xml | 379 -- .../docs/source/en/writing_extensions.xml | 128 - .../fr/authentication_documentation.xml | 307 - .../docs/source/fr/books_website.xml | 77 - .../source/fr/boundary_classes_tutorial.xml | 410 -- .../docs/source/fr/browser_documentation.xml | 259 - .../source/fr/display_subclass_tutorial.xml | 282 - .../docs/source/fr/download_website.xml | 110 - .../source/fr/expectation_documentation.xml | 308 - .../docs/source/fr/extension_eclipse.xml | 292 - .../docs/source/fr/first_test_tutorial.xml | 462 -- .../source/fr/form_testing_documentation.xml | 308 - .../docs/source/fr/gain_control_tutorial.xml | 324 - .../source/fr/group_test_documentation.xml | 353 -- .../docs/source/fr/group_test_tutorial.xml | 247 - .../source/fr/improving_design_tutorial.xml | 218 - .../lib/simpletest/docs/source/fr/index.xml | 69 - .../lib/simpletest/docs/source/fr/intro.xml | 39 - .../fr/logiciels_utilisant_simpletest.xml | 121 - .../source/fr/mock_objects_documentation.xml | 729 --- .../docs/source/fr/mock_objects_tutorial.xml | 374 -- .../simpletest/docs/source/fr/overview.xml | 297 - .../source/fr/partial_mocks_documentation.xml | 419 -- .../docs/source/fr/reporter_documentation.xml | 488 -- .../simpletest/docs/source/fr/simple_test.xml | 556 -- .../docs/source/fr/subclass_tutorial.xml | 261 - .../docs/source/fr/support_website.xml | 60 - .../source/fr/unit_test_documentation.xml | 330 -- .../source/fr/web_tester_documentation.xml | 377 -- .../test-suite/lib/simpletest/dumper.php | 359 -- .../test-suite/lib/simpletest/eclipse.php | 307 - .../test-suite/lib/simpletest/encoding.php | 552 -- .../test-suite/lib/simpletest/errors.php | 257 - .../test-suite/lib/simpletest/exceptions.php | 198 - .../test-suite/lib/simpletest/expectation.php | 901 --- .../extensions/colortext_reporter.php | 86 - .../lib/simpletest/extensions/css/webunit.css | 78 - .../lib/simpletest/extensions/dom_tester.php | 117 - .../extensions/dom_tester/css_selector.php | 539 -- .../dom_tester/test/dom_tester_doc_test.php | 24 - .../dom_tester/test/dom_tester_test.php | 223 - .../test/support/child_adjacent.html | 24 - .../dom_tester/test/support/dom_tester.html | 59 - .../lib/simpletest/extensions/img/wait.gif | Bin 1426 -> 0 bytes .../extensions/js/tests/TestOfWebunit.js.html | 34 - .../lib/simpletest/extensions/js/webunit.js | 194 - .../lib/simpletest/extensions/js/x.js | 423 -- .../extensions/junit_xml_reporter.php | 118 - .../simpletest/extensions/pear_test_case.php | 196 - .../lib/simpletest/extensions/recorder.php | 62 - .../extensions/recorder/test/sample.php | 14 - .../extensions/recorder/test/test.php | 28 - .../simpletest/extensions/selenese_tester.php | 393 -- .../lib/simpletest/extensions/selenium.php | 136 - .../extensions/selenium/remote-control.php | 128 - .../selenium/test/remote-control_test.php | 36 - .../lib/simpletest/extensions/testdox.php | 55 - .../simpletest/extensions/testdox/test.php | 107 - .../extensions/treemap_reporter.php | 126 - .../extensions/treemap_reporter/jquery.php | 75 - .../test/treemap_node_test.php | 69 - .../treemap_reporter/treemap_recorder.php | 310 - .../extensions/webunit_reporter.php | 285 - .../test-suite/lib/simpletest/form.php | 355 -- .../test-suite/lib/simpletest/frames.php | 592 -- .../test-suite/lib/simpletest/http.php | 628 -- .../test-suite/lib/simpletest/invoker.php | 139 - .../lib/simpletest/mock_objects.php | 1630 ----- .../test-suite/lib/simpletest/packages/README | 26 - .../lib/simpletest/packages/build_tarball.sh | 132 - .../lib/simpletest/packages/bundled_docs.xslt | 246 - .../lib/simpletest/packages/bundled_map.xml | 14 - .../lib/simpletest/packages/extension.xml | 40 - .../simpletest/packages/generate_package.php | 54 - .../lib/simpletest/packages/lastcraft.xslt | 302 - .../simpletest/packages/make_bundled_docs.sh | 25 - .../packages/make_bundled_docs_with_xalan.sh | 26 - .../packages/make_lastcraft_docs.sh | 2 - .../simpletest/packages/make_phpdoc_docs.sh | 42 - .../lib/simpletest/packages/onpk/map_onpk.xml | 26 - .../lib/simpletest/packages/onpk/onpk.xslt | 227 - .../packages/onpk/transform_all_onpk.php | 32 - .../lib/simpletest/packages/package.xml | 710 --- .../packages/pear_package_create.php | 170 - .../lib/simpletest/packages/phpdoc_docs.xslt | 127 - .../lib/simpletest/packages/simpletest.ini | 92 - .../packages/simpletest.org/index.php | 54 - .../packages/simpletest.org/integration.php | 41 - .../packages/simpletest.org/map.xml | 87 - .../packages/simpletest.org/package.php | 440 -- .../packages/simpletest.org/template.html | 59 - .../test/package/content_without_section.xml | 91 - .../test/package/en/synchronisation.xml | 92 - .../test/package/fr/no-synchronisation.xml | 91 - .../test/package/fr/synchronisation.xml | 93 - .../test/package/here_download.xml | 91 - .../test/package/here_overview.xml | 91 - .../test/package/here_simpletest.xml | 91 - .../test/package/here_start_testing.xml | 91 - .../test/package/here_support.xml | 91 - .../test/package/here_unit-tester.xml | 91 - .../simpletest.org/test/package/map.xml | 20 - .../test/package/one_section_changelogged.xml | 65 - .../test/package/one_section_milestoned.xml | 95 - .../package/one_section_with_autorum_php.xml | 87 - .../package/one_section_with_php_code.xml | 93 - .../simpletest.org/test/package_test.php | 150 - .../lib/simpletest/packages/site_map.xml | 33 - .../packages/transform_all_lastcraft.php | 17 - .../test-suite/lib/simpletest/page.php | 979 --- .../test-suite/lib/simpletest/parser.php | 760 --- .../lib/simpletest/reflection_php4.php | 136 - .../lib/simpletest/reflection_php5.php | 386 -- .../test-suite/lib/simpletest/remote.php | 115 - .../test-suite/lib/simpletest/reporter.php | 446 -- .../test-suite/lib/simpletest/scorer.php | 862 --- .../test-suite/lib/simpletest/selector.php | 141 - .../lib/simpletest/shell_tester.php | 330 -- .../test-suite/lib/simpletest/simpletest.php | 396 -- .../test-suite/lib/simpletest/socket.php | 308 - .../test-suite/lib/simpletest/tag.php | 1418 ----- .../lib/simpletest/test/acceptance_test.php | 1653 ------ .../lib/simpletest/test/adapter_test.php | 50 - .../lib/simpletest/test/all_tests.php | 13 - .../simpletest/test/authentication_test.php | 145 - .../lib/simpletest/test/autorun_test.php | 13 - .../lib/simpletest/test/bad_test_suite.php | 10 - .../lib/simpletest/test/browser_test.php | 774 --- .../lib/simpletest/test/collector_test.php | 50 - .../lib/simpletest/test/command_line_test.php | 40 - .../simpletest/test/compatibility_test.php | 87 - .../lib/simpletest/test/cookies_test.php | 227 - .../lib/simpletest/test/detached_test.php | 15 - .../lib/simpletest/test/dumper_test.php | 88 - .../lib/simpletest/test/eclipse_test.php | 32 - .../lib/simpletest/test/encoding_test.php | 213 - .../lib/simpletest/test/errors_test.php | 229 - .../lib/simpletest/test/exceptions_test.php | 153 - .../lib/simpletest/test/expectation_test.php | 223 - .../lib/simpletest/test/extensions_tests.php | 23 - .../lib/simpletest/test/form_test.php | 324 - .../lib/simpletest/test/frames_test.php | 549 -- .../lib/simpletest/test/http_test.php | 424 -- .../lib/simpletest/test/interfaces_test.php | 137 - .../test/interfaces_test_php5_1.php | 14 - .../lib/simpletest/test/live_test.php | 47 - .../lib/simpletest/test/mock_objects_test.php | 1012 ---- .../lib/simpletest/test/page_test.php | 898 --- .../lib/simpletest/test/parse_error_test.php | 9 - .../lib/simpletest/test/parser_test.php | 551 -- .../simpletest/test/reflection_php4_test.php | 61 - .../simpletest/test/reflection_php5_test.php | 263 - .../lib/simpletest/test/remote_test.php | 19 - .../lib/simpletest/test/shell_test.php | 38 - .../lib/simpletest/test/shell_tester_test.php | 42 - .../lib/simpletest/test/simpletest_test.php | 58 - .../lib/simpletest/test/site/.htaccess | 2 - .../lib/simpletest/test/site/1.html | 6 - .../lib/simpletest/test/site/2.html | 6 - .../lib/simpletest/test/site/3.html | 6 - .../test/site/base_change_redirect.php | 6 - .../test/site/base_tag/base_link.html | 9 - .../simpletest/test/site/base_tag/form.html | 50 - .../test/site/base_tag/frameset.html | 9 - .../site/base_tag/frameset_with_base_tag.html | 12 - .../simpletest/test/site/base_tag/page_1.html | 7 - .../simpletest/test/site/base_tag/page_2.html | 7 - .../test/site/base_tag/relative_link.html | 8 - .../test/site/cookie_based_counter.php | 10 - .../test/site/counting_frameset.html | 10 - .../test/site/double_base_change_redirect.php | 6 - .../lib/simpletest/test/site/file.html | 6 - .../lib/simpletest/test/site/form.html | 47 - .../test/site/form_data_encoded_form.html | 47 - .../site/form_with_array_based_inputs.php | 15 - .../test/site/form_with_false_defaults.html | 40 - .../site/form_with_mixed_post_and_get.html | 15 - .../test/site/form_with_quoted_values.php | 14 - .../test/site/form_with_radio_buttons.html | 10 - .../test/site/form_with_tricky_defaults.html | 35 - .../test/site/form_with_unnamed_submit.html | 12 - .../test/site/form_without_action.php | 11 - .../lib/simpletest/test/site/frame_a.html | 6 - .../lib/simpletest/test/site/frame_b.html | 6 - .../lib/simpletest/test/site/frame_links.html | 7 - .../lib/simpletest/test/site/frameset.html | 10 - .../site/front_controller_style/a_page.php | 37 - .../site/front_controller_style/index.php | 44 - .../front_controller_style/show_request.php | 49 - .../lib/simpletest/test/site/link_confirm.php | 18 - .../simpletest/test/site/local_redirect.php | 6 - .../simpletest/test/site/messy_frameset.html | 16 - .../test/site/multiple_widget_form.html | 59 - .../simpletest/test/site/nested_frameset.html | 10 - .../simpletest/test/site/network_confirm.php | 84 - .../test/site/one_page_frameset.html | 9 - .../lib/simpletest/test/site/page_request.php | 60 - .../test/site/path/base_change_redirect.php | 6 - .../test/site/path/network_confirm.php | 71 - .../test/site/path/show_cookies.php | 18 - .../simpletest/test/site/protected/.htaccess | 5 - .../simpletest/test/site/protected/.htpasswd | 1 - .../lib/simpletest/test/site/protected/1.html | 6 - .../lib/simpletest/test/site/protected/2.html | 6 - .../lib/simpletest/test/site/protected/3.html | 6 - .../simpletest/test/site/protected/htaccess | 4 - .../test/site/protected/local_redirect.php | 6 - .../test/site/protected/network_confirm.php | 71 - .../lib/simpletest/test/site/redirect.php | 6 - .../test/site/savant_style_form.html | 20 - .../lib/simpletest/test/site/search.png | Bin 1259 -> 0 bytes .../lib/simpletest/test/site/self.php | 5 - .../lib/simpletest/test/site/self_form.php | 21 - .../lib/simpletest/test/site/set_cookies.php | 20 - .../lib/simpletest/test/site/slow_page.php | 6 - .../test/site/temp/.stop_cvs_removing_temp | 0 .../lib/simpletest/test/site/timestamp.php | 3 - .../lib/simpletest/test/site/upload_form.html | 11 - .../simpletest/test/site/upload_handler.php | 18 - .../lib/simpletest/test/socket_test.php | 25 - .../test/support/collector/collectable.1 | 0 .../test/support/collector/collectable.2 | 0 .../test/support/empty_test_file.php | 3 - .../lib/simpletest/test/support/latin1_sample | 1 - .../simpletest/test/support/spl_examples.php | 15 - .../support/supplementary_upload_sample.txt | 1 - .../lib/simpletest/test/support/test1.php | 7 - .../simpletest/test/support/upload_sample.txt | 1 - .../lib/simpletest/test/tag_test.php | 554 -- .../lib/simpletest/test/unit_tester_test.php | 61 - .../lib/simpletest/test/unit_tests.php | 46 - .../lib/simpletest/test/url_test.php | 496 -- .../lib/simpletest/test/user_agent_test.php | 348 -- .../lib/simpletest/test/utf8_test.php | 78 - .../simpletest/test/visual/visual_errors.php | 65 - .../lib/simpletest/test/visual_test.php | 495 -- .../lib/simpletest/test/web_tester_test.php | 155 - .../lib/simpletest/test/xml_test.php | 187 - .../test-suite/lib/simpletest/test_case.php | 655 -- .../tutorials/SimpleTest/Expectations.pkg | 319 - .../tutorials/SimpleTest/FormTesting.pkg | 218 - .../tutorials/SimpleTest/GroupTests.pkg | 297 - .../tutorials/SimpleTest/MockObjects.pkg | 663 --- .../tutorials/SimpleTest/PartialMock.pkg | 361 -- .../tutorials/SimpleTest/Reporting.pkg | 450 -- .../tutorials/SimpleTest/ServerStubs.pkg | 323 - .../tutorials/SimpleTest/SimpleTest.pkg | 387 -- .../tutorials/SimpleTest/SimpleTest.pkg.ini | 10 - .../tutorials/SimpleTest/UnitTestCase.pkg | 405 -- .../tutorials/SimpleTest/WebTester.pkg | 610 -- .../test-suite/lib/simpletest/unit_tester.php | 402 -- .../test-suite/lib/simpletest/url.php | 550 -- .../test-suite/lib/simpletest/user_agent.php | 328 - .../test-suite/lib/simpletest/web_tester.php | 1495 ----- .../test-suite/lib/simpletest/xml.php | 647 -- .../test-suite/lib/yaymock/classes/Yay.php | 261 - .../lib/yaymock/classes/Yay/Action.php | 37 - .../classes/Yay/Actions/CallbackAction.php | 66 - .../Yay/Actions/ReturnReferenceAction.php | 64 - .../classes/Yay/Actions/ReturnValueAction.php | 100 - .../classes/Yay/Actions/ThrowAction.php | 66 - .../lib/yaymock/classes/Yay/Description.php | 45 - .../lib/yaymock/classes/Yay/Expectation.php | 88 - .../classes/Yay/ExpectationProvider.php | 33 - .../lib/yaymock/classes/Yay/Expectations.php | 306 - .../Yay/Expectations/AbstractExpectation.php | 345 -- .../Yay/Expectations/AtLeastExpectation.php | 101 - .../Yay/Expectations/AtMostExpectation.php | 117 - .../Yay/Expectations/BetweenExpectation.php | 118 - .../Yay/Expectations/ExactlyExpectation.php | 117 - .../lib/yaymock/classes/Yay/Invocation.php | 49 - .../yaymock/classes/Yay/InvocationHandler.php | 36 - .../yaymock/classes/Yay/InvocationProxy.php | 90 - .../classes/Yay/InvocationRecorder.php | 36 - .../lib/yaymock/classes/Yay/Matcher.php | 48 - .../classes/Yay/Matchers/AnyMatcher.php | 85 - .../classes/Yay/Matchers/BoundsMatcher.php | 94 - .../classes/Yay/Matchers/EqualMatcher.php | 50 - .../classes/Yay/Matchers/IdenticalMatcher.php | 116 - .../classes/Yay/Matchers/OptionalMatcher.php | 103 - .../classes/Yay/Matchers/PatternMatcher.php | 88 - .../classes/Yay/Matchers/ReferenceMatcher.php | 104 - .../lib/yaymock/classes/Yay/MockGenerator.php | 323 - .../lib/yaymock/classes/Yay/MockObject.php | 25 - .../lib/yaymock/classes/Yay/Mockery.php | 183 - .../classes/Yay/NotSatisfiedException.php | 36 - .../yaymock/classes/Yay/SelfDescribing.php | 35 - .../lib/yaymock/classes/Yay/Sequence.php | 43 - .../yaymock/classes/Yay/SimpleDescription.php | 63 - .../yaymock/classes/Yay/SimpleInvocation.php | 163 - .../yaymock/classes/Yay/SimpleSequence.php | 108 - .../lib/yaymock/classes/Yay/SimpleState.php | 49 - .../classes/Yay/SimpleStatePredicate.php | 88 - .../lib/yaymock/classes/Yay/State.php | 34 - .../lib/yaymock/classes/Yay/StateMachine.php | 113 - .../yaymock/classes/Yay/StatePredicate.php | 35 - .../lib/yaymock/classes/Yay/States.php | 62 - .../test-suite/lib/yaymock/mock.tpl.php | 69 - .../lib/yaymock/yay_convenience.php | 176 - .../test-suite/lib/yaymock/yay_mock.php | 29 - .../swiftmailer/test-suite/run.php | 56 - .../swiftmailer/test-suite/sweety.js | 471 -- .../test-suite/templates/sweety/css/main.css | 203 - .../templates/sweety/images/darr.gif | Bin 57 -> 0 bytes .../templates/sweety/images/group.gif | Bin 90 -> 0 bytes .../templates/sweety/images/htmlicon.gif | Bin 1022 -> 0 bytes .../templates/sweety/images/loading.gif | Bin 1732 -> 0 bytes .../templates/sweety/images/network.gif | Bin 2130 -> 0 bytes .../templates/sweety/images/rarr.gif | Bin 59 -> 0 bytes .../templates/sweety/images/runicon.gif | Bin 159 -> 0 bytes .../templates/sweety/images/xmlicon.gif | Bin 128 -> 0 bytes .../templates/sweety/js/sweety-template.js | 1155 ---- .../templates/sweety/suite-ui-noajax.tpl.php | 155 - .../templates/sweety/suite-ui.tpl.php | 132 - .../swiftmailer/test-suite/xpath-legacy.js | 2764 --------- .../_samples/charsets/iso-2022-jp/one.txt | 11 - .../_samples/charsets/iso-8859-1/one.txt | 19 - .../tests/_samples/charsets/utf-8/one.txt | 22 - .../tests/_samples/charsets/utf-8/three.txt | 45 - .../tests/_samples/charsets/utf-8/two.txt | 3 - .../swiftmailer/tests/_samples/files/data.txt | 1 - .../tests/_samples/files/textfile.zip | Bin 202 -> 0 bytes .../tests/acceptance.conf.php.default | 44 - .../Swift/AttachmentAcceptanceTest.php | 13 - .../FileByteStreamAcceptanceTest.php | 171 - ...leCharacterReaderFactoryAcceptanceTest.php | 183 - .../DependencyContainerAcceptanceTest.php | 22 - .../Swift/EmbeddedFileAcceptanceTest.php | 13 - .../Encoder/Base64EncoderAcceptanceTest.php | 49 - .../Swift/Encoder/QpEncoderAcceptanceTest.php | 58 - .../Encoder/Rfc2231EncoderAcceptanceTest.php | 56 - .../Swift/EncodingAcceptanceTest.php | 31 - .../KeyCache/ArrayKeyCacheAcceptanceTest.php | 179 - .../KeyCache/DiskKeyCacheAcceptanceTest.php | 189 - .../Swift/MessageAcceptanceTest.php | 57 - .../Swift/Mime/AttachmentAcceptanceTest.php | 136 - .../Base64ContentEncoderAcceptanceTest.php | 62 - .../NativeQpContentEncoderAcceptanceTest.php | 94 - .../PlainContentEncoderAcceptanceTest.php | 96 - .../QpContentEncoderAcceptanceTest.php | 170 - .../Swift/Mime/EmbeddedFileAcceptanceTest.php | 149 - .../Base64HeaderEncoderAcceptanceTest.php | 37 - .../Swift/Mime/MimePartAcceptanceTest.php | 142 - .../Mime/SimpleMessageAcceptanceTest.php | 1254 ---- .../Swift/MimePartAcceptanceTest.php | 14 - .../AbstractStreamBufferAcceptanceTest.php | 122 - .../BasicSocketAcceptanceTest.php | 31 - .../StreamBuffer/ProcessAcceptanceTest.php | 23 - .../StreamBuffer/SocketTimeoutTest.php | 72 - .../StreamBuffer/SslSocketAcceptanceTest.php | 35 - .../StreamBuffer/TlsSocketAcceptanceTest.php | 35 - .../tests/bug/Swift/Bug111Test.php | 44 - .../tests/bug/Swift/Bug118Test.php | 22 - .../tests/bug/Swift/Bug206Test.php | 40 - .../swiftmailer/tests/bug/Swift/Bug34Test.php | 77 - .../swiftmailer/tests/bug/Swift/Bug35Test.php | 75 - .../swiftmailer/tests/bug/Swift/Bug38Test.php | 196 - .../swiftmailer/tests/bug/Swift/Bug51Test.php | 125 - .../swiftmailer/tests/bug/Swift/Bug71Test.php | 22 - .../swiftmailer/tests/bug/Swift/Bug76Test.php | 86 - .../Tests/IdenticalBinaryExpectation.php | 78 - .../Swift/Tests/SwiftSmokeTestCase.php | 53 - .../helpers/Swift/Tests/SwiftUnitTestCase.php | 97 - .../swiftmailer/tests/smoke.conf.php.default | 63 - .../smoke/Swift/Smoke/AttachmentSmokeTest.php | 30 - .../smoke/Swift/Smoke/BasicSmokeTest.php | 24 - .../Smoke/HtmlWithAttachmentSmokeTest.php | 30 - .../Swift/Smoke/InternationalSmokeTest.php | 37 - .../Swift/ByteStream/ArrayByteStreamTest.php | 204 - .../GenericFixedWidthReaderTest.php | 46 - .../CharacterReader/UsAsciiReaderTest.php | 55 - .../Swift/CharacterReader/Utf8ReaderTest.php | 68 - .../ArrayCharacterStreamTest.php | 374 -- .../unit/Swift/DependencyContainerTest.php | 175 - .../unit/Swift/Encoder/Base64EncoderTest.php | 175 - .../unit/Swift/Encoder/QpEncoderTest.php | 361 -- .../unit/Swift/Encoder/Rfc2231EncoderTest.php | 144 - .../unit/Swift/Events/CommandEventTest.php | 41 - .../unit/Swift/Events/EventObjectTest.php | 37 - .../unit/Swift/Events/ResponseEventTest.php | 44 - .../tests/unit/Swift/Events/SendEventTest.php | 103 - .../Events/SimpleEventDispatcherTest.php | 166 - .../Swift/Events/TransportChangeEventTest.php | 36 - .../Events/TransportExceptionEventTest.php | 49 - .../unit/Swift/KeyCache/ArrayKeyCacheTest.php | 242 - .../SimpleKeyCacheInputStreamTest.php | 77 - .../Mailer/ArrayRecipientIteratorTest.php | 46 - .../tests/unit/Swift/MailerTest.php | 149 - .../Swift/Mime/AbstractMimeEntityTest.php | 1094 ---- .../tests/unit/Swift/Mime/AttachmentTest.php | 297 - .../Base64ContentEncoderTest.php | 293 - .../PlainContentEncoderTest.php | 275 - .../ContentEncoder/QpContentEncoderTest.php | 474 -- .../unit/Swift/Mime/EmbeddedFileTest.php | 63 - .../HeaderEncoder/Base64HeaderEncoderTest.php | 15 - .../HeaderEncoder/QpHeaderEncoderTest.php | 223 - .../Swift/Mime/Headers/DateHeaderTest.php | 76 - .../Mime/Headers/IdentificationHeaderTest.php | 199 - .../Swift/Mime/Headers/MailboxHeaderTest.php | 338 -- .../Mime/Headers/ParameterizedHeaderTest.php | 420 -- .../Swift/Mime/Headers/PathHeaderTest.php | 83 - .../Mime/Headers/UnstructuredHeaderTest.php | 364 -- .../tests/unit/Swift/Mime/MimePartTest.php | 252 - .../Swift/Mime/SimpleHeaderFactoryTest.php | 179 - .../unit/Swift/Mime/SimpleHeaderSetTest.php | 652 -- .../unit/Swift/Mime/SimpleMessageTest.php | 803 --- .../unit/Swift/Mime/SimpleMimeEntityTest.php | 15 - .../Swift/Plugins/AntiFloodPluginTest.php | 98 - .../Plugins/BandwidthMonitorPluginTest.php | 125 - .../Swift/Plugins/DecoratorPluginTest.php | 231 - .../unit/Swift/Plugins/LoggerPluginTest.php | 194 - .../Swift/Plugins/Loggers/ArrayLoggerTest.php | 70 - .../Swift/Plugins/Loggers/EchoLoggerTest.php | 29 - .../Swift/Plugins/PopBeforeSmtpPluginTest.php | 113 - .../Swift/Plugins/RedirectingPluginTest.php | 66 - .../unit/Swift/Plugins/ReporterPluginTest.php | 120 - .../Plugins/Reporters/HitReporterTest.php | 69 - .../Plugins/Reporters/HtmlReporterTest.php | 59 - .../Swift/Plugins/ThrottlerPluginTest.php | 124 - .../ByteArrayReplacementFilterTest.php | 135 - .../StringReplacementFilterFactoryTest.php | 41 - .../StringReplacementFilterTest.php | 59 - .../AbstractSmtpEventSupportTest.php | 378 -- .../unit/Swift/Transport/AbstractSmtpTest.php | 924 --- .../Esmtp/Auth/CramMd5AuthenticatorTest.php | 67 - .../Esmtp/Auth/LoginAuthenticatorTest.php | 60 - .../Esmtp/Auth/PlainAuthenticatorTest.php | 71 - .../Swift/Transport/Esmtp/AuthHandlerTest.php | 156 - .../EsmtpTransport/ExtensionSupportTest.php | 312 - .../Swift/Transport/EsmtpTransportTest.php | 234 - .../Swift/Transport/FailoverTransportTest.php | 334 -- .../Transport/LoadBalancedTransportTest.php | 418 -- .../Swift/Transport/MailTransportTest.php | 315 - .../Swift/Transport/SendmailTransportTest.php | 133 - .../unit/Swift/Transport/StreamBufferTest.php | 50 - .../Symfony/Bundle/AsseticBundle/.gitignore | 1 - .../Bundle/AsseticBundle/AsseticBundle.php | 49 - .../CacheWarmer/AssetManagerCacheWarmer.php | 41 - .../AsseticBundle/Command/DumpCommand.php | 232 - .../AsseticBundle/Config/AsseticResource.php | 75 - .../Controller/AsseticController.php | 121 - .../AsseticBundle/DefaultValueSupplier.php | 35 - .../DependencyInjection/AsseticExtension.php | 144 - .../Compiler/AssetFactoryPass.php | 36 - .../Compiler/AssetManagerPass.php | 62 - .../Compiler/CheckClosureFilterPass.php | 36 - .../Compiler/CheckCssEmbedFilterPass.php | 31 - .../Compiler/CheckYuiFilterPass.php | 36 - .../Compiler/FilterManagerPass.php | 44 - .../Compiler/RouterResourcePass.php | 44 - .../Compiler/SprocketsFilterPass.php | 35 - .../Compiler/TemplateResourcesPass.php | 67 - .../Compiler/TemplatingPass.php | 44 - .../DependencyInjection/Configuration.php | 199 - .../DirectoryResourceDefinition.php | 75 - .../EventListener/RequestListener.php | 31 - .../Exception/InvalidBundleException.php | 26 - .../AsseticBundle/Factory/AssetFactory.php | 97 - .../Loader/AsseticHelperFormulaLoader.php | 87 - .../Factory/Loader/ConfigurationLoader.php | 29 - .../Resource/CoalescingDirectoryResource.php | 30 - .../Resource/ConfigurationResource.php | 44 - .../Factory/Resource/DirectoryResource.php | 51 - .../Resource/DirectoryResourceIterator.php | 45 - .../Factory/Resource/FileResource.php | 88 - .../Factory/Worker/UseControllerWorker.php | 33 - .../Bundle/AsseticBundle/FilterManager.php | 55 - .../Resources/config/assetic.xml | 75 - .../Resources/config/controller.xml | 41 - .../Resources/config/filters/closure.xml | 31 - .../Resources/config/filters/coffee.xml | 22 - .../Resources/config/filters/compass.xml | 37 - .../Resources/config/filters/cssembed.xml | 34 - .../Resources/config/filters/cssimport.xml | 16 - .../Resources/config/filters/cssmin.xml | 20 - .../Resources/config/filters/cssrewrite.xml | 16 - .../Resources/config/filters/gss.xml | 20 - .../Resources/config/filters/jpegoptim.xml | 22 - .../Resources/config/filters/jpegtran.xml | 26 - .../Resources/config/filters/less.xml | 22 - .../Resources/config/filters/lessphp.xml | 18 - .../Resources/config/filters/optipng.xml | 20 - .../Resources/config/filters/packager.xml | 18 - .../Resources/config/filters/pngout.xml | 26 - .../Resources/config/filters/sass.xml | 23 - .../Resources/config/filters/scss.xml | 23 - .../Resources/config/filters/sprockets.xml | 23 - .../Resources/config/filters/stylus.xml | 22 - .../Resources/config/filters/uglifyjs.xml | 32 - .../Resources/config/filters/yui_css.xml | 22 - .../Resources/config/filters/yui_js.xml | 28 - .../Resources/config/schema/assetic-1.0.xsd | 58 - .../Resources/config/templating_php.xml | 39 - .../Resources/config/templating_twig.xml | 35 - .../AsseticBundle/Routing/AsseticLoader.php | 122 - .../Templating/AsseticHelper.php | 157 - .../Templating/DynamicAsseticHelper.php | 44 - .../Templating/StaticAsseticHelper.php | 44 - .../AssetManagerCacheWarmerTest.php | 51 - .../Tests/Command/DumpCommandTest.php | 202 - .../Controller/AsseticControllerTest.php | 167 - .../AsseticExtensionTest.php | 215 - .../Tests/Factory/AssetFactoryTest.php | 97 - .../CoalescingDirectoryResourceTest.php | 63 - .../Factory/Resource/FileResourceTest.php | 31 - .../AsseticBundle/Tests/FilterManagerTest.php | 59 - .../AsseticBundle/Tests/FunctionalTest.php | 75 - .../Resources/Resources/views/base.html.php | 11 - .../Resources/Resources/views/base.html.twig | 11 - .../Resources/Resources/views/layout.html.php | 17 - .../Resources/views/layout.html.twig | 19 - .../Tests/Resources/config/config.yml | 40 - .../Tests/Resources/config/routing.yml | 3 - .../Tests/Resources/web/javascript1.js | 1 - .../Tests/Resources/web/javascript2.js | 1 - .../Tests/Resources/web/stylesheet1.css | 1 - .../Tests/Resources/web/stylesheet2.css | 1 - .../Tests/Templating/AsseticHelperTest.php | 56 - .../Tests/TestBundle/Resources/css/bundle.css | 1 - .../Tests/TestBundle/TestBundle.php | 18 - .../Bundle/AsseticBundle/Tests/TestKernel.php | 38 - .../Bundle/AsseticBundle/Tests/bootstrap.php | 17 - .../AsseticBundle/Twig/AsseticExtension.php | 69 - .../Bundle/AsseticBundle/Twig/AsseticNode.php | 83 - .../AsseticBundle/Twig/AsseticNodeVisitor.php | 120 - .../AsseticBundle/Twig/AsseticTokenParser.php | 66 - .../Symfony/Bundle/AsseticBundle/UPGRADE.md | 10 - .../Bundle/AsseticBundle/composer.json | 33 - .../Bundle/AsseticBundle/phpunit.xml.dist | 35 - .../Symfony/Bundle/MonologBundle/.gitignore | 4 - .../Symfony/Bundle/MonologBundle/.travis.yml | 9 - .../Compiler/AddProcessorsPass.php | 59 - .../Compiler/DebugHandlerPass.php | 49 - .../Compiler/LoggerChannelPass.php | 105 - .../DependencyInjection/Configuration.php | 215 - .../DependencyInjection/MonologExtension.php | 289 - .../Symfony/Bundle/MonologBundle/LICENSE | 19 - .../Bundle/MonologBundle/MonologBundle.php | 35 - .../Resources/config/monolog.xml | 39 - .../Resources/config/schema/monolog-1.0.xsd | 92 - .../Compiler/AddProcessorsPassTest.php | 67 - .../Compiler/LoggerChannelPassTest.php | 130 - .../DependencyInjection/ConfigurationTest.php | 228 - .../Fixtures/xml/handlers_with_channels.xml | 31 - .../Fixtures/xml/multiple_handlers.xml | 14 - .../Fixtures/xml/new_and_priority.xml | 18 - .../Fixtures/xml/new_and_priority_import.xml | 14 - .../Fixtures/xml/new_at_end.xml | 17 - .../Fixtures/xml/new_at_end_import.xml | 14 - .../Fixtures/xml/overwriting.xml | 16 - .../Fixtures/xml/overwriting_import.xml | 14 - .../Fixtures/yml/handlers_with_channels.yml | 30 - .../Fixtures/yml/multiple_handlers.yml | 13 - .../Fixtures/yml/new_and_priority.yml | 22 - .../Fixtures/yml/new_and_priority_import.yml | 13 - .../Fixtures/yml/new_at_end.yml | 15 - .../Fixtures/yml/new_at_end_import.yml | 13 - .../Fixtures/yml/overwriting.yml | 10 - .../Fixtures/yml/overwriting_import.yml | 13 - .../MonologExtensionTest.php | 285 - .../XmlMonologExtensionTest.php | 25 - .../YamlMonologExtensionTest.php | 25 - .../Bundle/MonologBundle/Tests/TestCase.php | 22 - .../Bundle/MonologBundle/composer.json | 38 - .../Bundle/MonologBundle/phpunit.xml.dist | 20 - .../Bundle/SwiftmailerBundle/.gitignore | 3 - .../Command/SendEmailCommand.php | 74 - .../Compiler/RegisterPluginsPass.php | 36 - .../DependencyInjection/Configuration.php | 93 - .../SwiftmailerExtension.php | 155 - .../EventListener/EmailSenderListener.php | 59 - .../Symfony/Bundle/SwiftmailerBundle/LICENSE | 19 - .../config/schema/swiftmailer-1.0.xsd | 65 - .../Resources/config/smtp.xml | 29 - .../Resources/config/spool.xml | 18 - .../Resources/config/spool_file.xml | 16 - .../Resources/config/spool_memory.xml | 20 - .../Resources/config/swiftmailer.xml | 86 - .../views/Collector/swiftmailer.html.twig | 59 - .../SwiftmailerBundle/SwiftmailerBundle.php | 31 - .../SwiftmailerExtensionTest.php | 57 - .../SwiftmailerBundle/Tests/TestCase.php | 22 - .../Bundle/SwiftmailerBundle/composer.json | 38 - .../Bundle/SwiftmailerBundle/phpunit.xml.dist | 20 - vendor/symfony/symfony/.editorconfig | 10 - vendor/symfony/symfony/.gitignore | 5 - vendor/symfony/symfony/.travis.yml | 10 - vendor/symfony/symfony/CHANGELOG-2.0.md | 341 -- vendor/symfony/symfony/CONTRIBUTORS.md | 457 -- vendor/symfony/symfony/LICENSE | 19 - vendor/symfony/symfony/README.md | 57 - vendor/symfony/symfony/UPGRADE-2.1.md | 1409 ----- vendor/symfony/symfony/autoload.php.dist | 17 - vendor/symfony/symfony/composer.json | 76 - vendor/symfony/symfony/phpunit.xml.dist | 45 - .../src/Symfony/Bridge/Doctrine/CHANGELOG.md | 12 - .../Doctrine/CacheWarmer/ProxyCacheWarmer.php | 71 - .../Doctrine/ContainerAwareEventManager.php | 137 - .../DataCollector/DoctrineDataCollector.php | 177 - .../DataFixtures/ContainerAwareLoader.php | 54 - .../AbstractDoctrineExtension.php | 383 -- .../CompilerPass/DoctrineValidationPass.php | 71 - ...gisterEventListenersAndSubscribersPass.php | 138 - .../Security/UserProvider/EntityFactory.php | 62 - .../Form/ChoiceList/EntityChoiceList.php | 394 -- .../Form/ChoiceList/EntityLoaderInterface.php | 39 - .../Form/ChoiceList/ORMQueryBuilderLoader.php | 82 - .../CollectionToArrayTransformer.php | 61 - .../Doctrine/Form/DoctrineOrmExtension.php | 37 - .../Doctrine/Form/DoctrineOrmTypeGuesser.php | 154 - .../MergeDoctrineCollectionListener.php | 47 - .../Doctrine/Form/Type/DoctrineType.php | 156 - .../Bridge/Doctrine/Form/Type/EntityType.php | 40 - .../HttpFoundation/DbalSessionHandler.php | 172 - .../DbalSessionHandlerSchema.php | 48 - .../src/Symfony/Bridge/Doctrine/LICENSE | 19 - .../Bridge/Doctrine/Logger/DbalLogger.php | 73 - .../Bridge/Doctrine/ManagerRegistry.php | 53 - .../src/Symfony/Bridge/Doctrine/README.md | 28 - .../Bridge/Doctrine/RegistryInterface.php | 94 - .../Security/User/EntityUserProvider.php | 110 - .../Tests/ContainerAwareEventManagerTest.php | 66 - .../DoctrineDataCollectorTest.php | 158 - .../DataFixtures/ContainerAwareLoaderTest.php | 40 - ...erEventListenersAndSubscribersPassTest.php | 157 - .../Doctrine/Tests/DoctrineOrmTestCase.php | 59 - .../Tests/Fixtures/AssociationEntity.php | 43 - .../Tests/Fixtures/CompositeIdentEntity.php | 62 - .../Fixtures/CompositeStringIdentEntity.php | 36 - .../Tests/Fixtures/ContainerAwareFixture.php | 31 - .../Tests/Fixtures/ItemGroupEntity.php | 36 - .../Fixtures/NoToStringSingleIdentEntity.php | 32 - .../Tests/Fixtures/SingleIdentEntity.php | 37 - .../Fixtures/SingleStringIdentEntity.php | 32 - .../Form/ChoiceList/EntityChoiceListTest.php | 311 - .../Form/Type/EntityTypePerformanceTest.php | 112 - .../Tests/Form/Type/EntityTypeTest.php | 723 --- .../HttpFoundation/DbalSessionHandlerTest.php | 37 - .../Security/User/EntityUserProviderTest.php | 119 - .../Constraints/UniqueValidatorTest.php | 320 - .../Bridge/Doctrine/Tests/bootstrap.php | 70 - .../Validator/Constraints/UniqueEntity.php | 58 - .../Constraints/UniqueEntityValidator.php | 125 - .../Validator/DoctrineInitializer.php | 38 - .../src/Symfony/Bridge/Doctrine/composer.json | 38 - .../Symfony/Bridge/Doctrine/phpunit.xml.dist | 29 - .../src/Symfony/Bridge/Monolog/CHANGELOG.md | 7 - .../Monolog/Handler/ChromePhpHandler.php | 83 - .../Bridge/Monolog/Handler/DebugHandler.php | 58 - .../Bridge/Monolog/Handler/FirePHPHandler.php | 84 - .../src/Symfony/Bridge/Monolog/LICENSE | 19 - .../src/Symfony/Bridge/Monolog/Logger.php | 58 - .../Bridge/Monolog/Processor/WebProcessor.php | 38 - .../src/Symfony/Bridge/Monolog/README.md | 18 - .../Tests/Processor/WebProcessorTest.php | 77 - .../Bridge/Monolog/Tests/bootstrap.php | 34 - .../src/Symfony/Bridge/Monolog/composer.json | 32 - .../Symfony/Bridge/Monolog/phpunit.xml.dist | 29 - .../src/Symfony/Bridge/Propel1/CHANGELOG.md | 7 - .../DataCollector/PropelDataCollector.php | 145 - .../Security/UserProvider/PropelFactory.php | 58 - .../Form/ChoiceList/ModelChoiceList.php | 354 -- .../CollectionToArrayTransformer.php | 55 - .../Bridge/Propel1/Form/PropelExtension.php | 34 - .../Bridge/Propel1/Form/PropelTypeGuesser.php | 172 - .../Bridge/Propel1/Form/Type/ModelType.php | 70 - .../src/Symfony/Bridge/Propel1/LICENSE | 19 - .../Bridge/Propel1/Logger/PropelLogger.php | 170 - .../src/Symfony/Bridge/Propel1/README.md | 20 - .../Security/User/PropelUserProvider.php | 100 - .../DataCollector/PropelDataCollectorTest.php | 110 - .../Bridge/Propel1/Tests/Fixtures/Column.php | 59 - .../Bridge/Propel1/Tests/Fixtures/Item.php | 108 - .../Propel1/Tests/Fixtures/ItemQuery.php | 64 - .../Propel1/Tests/Fixtures/ReadOnlyItem.php | 25 - .../Tests/Fixtures/ReadOnlyItemQuery.php | 27 - .../Form/ChoiceList/ModelChoiceListTest.php | 161 - .../CollectionToArrayTransformerTest.php | 111 - .../Tests/Form/PropelTypeGuesserTest.php | 119 - .../Bridge/Propel1/Tests/Propel1TestCase.php | 22 - .../Bridge/Propel1/Tests/bootstrap.php | 34 - .../src/Symfony/Bridge/Propel1/composer.json | 34 - .../Symfony/Bridge/Propel1/phpunit.xml.dist | 29 - .../Symfony/Bridge/Swiftmailer/CHANGELOG.md | 7 - .../DataCollector/MessageDataCollector.php | 85 - .../src/Symfony/Bridge/Swiftmailer/LICENSE | 19 - .../Symfony/Bridge/Swiftmailer/composer.json | 34 - .../src/Symfony/Bridge/Twig/.gitignore | 2 - .../src/Symfony/Bridge/Twig/CHANGELOG.md | 12 - .../Bridge/Twig/Extension/FormExtension.php | 134 - .../Twig/Extension/RoutingExtension.php | 62 - .../Twig/Extension/SecurityExtension.php | 63 - .../Twig/Extension/TranslationExtension.php | 114 - .../Bridge/Twig/Extension/YamlExtension.php | 67 - .../Symfony/Bridge/Twig/Form/TwigRenderer.php | 41 - .../Bridge/Twig/Form/TwigRendererEngine.php | 183 - .../Twig/Form/TwigRendererEngineInterface.php | 27 - .../Twig/Form/TwigRendererInterface.php | 27 - .../symfony/src/Symfony/Bridge/Twig/LICENSE | 19 - .../Bridge/Twig/Node/FormThemeNode.php | 40 - .../Twig/Node/SearchAndRenderBlockNode.php | 106 - .../Twig/Node/TransDefaultDomainNode.php | 33 - .../Symfony/Bridge/Twig/Node/TransNode.php | 119 - .../TranslationDefaultDomainNodeVisitor.php | 81 - .../NodeVisitor/TranslationNodeVisitor.php | 98 - .../symfony/src/Symfony/Bridge/Twig/README.md | 15 - .../views/Form/form_div_layout.html.twig | 331 -- .../views/Form/form_table_layout.html.twig | 41 - .../Fixtures/StubFilesystemLoader.php | 30 - .../Extension/Fixtures/StubTranslator.php | 35 - .../Extension/FormExtensionDivLayoutTest.php | 194 - .../FormExtensionTableLayoutTest.php | 116 - .../Extension/TranslationExtensionTest.php | 149 - .../Tests/Extension/child_label.html.twig | 3 - .../Tests/Extension/custom_widgets.html.twig | 16 - .../Tests/Extension/parent_label.html.twig | 3 - .../Twig/Tests/Extension/theme.html.twig | 6 - .../Tests/Extension/theme_extends.html.twig | 8 - .../Twig/Tests/Extension/theme_use.html.twig | 8 - .../Bridge/Twig/Tests/Node/FormThemeTest.php | 85 - .../Node/SearchAndRenderBlockNodeTest.php | 282 - .../Symfony/Bridge/Twig/Tests/TestCase.php | 22 - .../TokenParser/FormThemeTokenParserTest.php | 108 - .../Tests/Translation/TwigExtractorTest.php | 71 - .../Symfony/Bridge/Twig/Tests/bootstrap.php | 14 - .../Twig/TokenParser/FormThemeTokenParser.php | 61 - .../TokenParser/TransChoiceTokenParser.php | 87 - .../TransDefaultDomainTokenParser.php | 48 - .../Twig/TokenParser/TransTokenParser.php | 87 - .../Bridge/Twig/Translation/TwigExtractor.php | 85 - .../src/Symfony/Bridge/Twig/TwigEngine.php | 126 - .../src/Symfony/Bridge/Twig/composer.json | 47 - .../src/Symfony/Bridge/Twig/phpunit.xml.dist | 30 - .../Bundle/FrameworkBundle/CHANGELOG.md | 43 - .../CacheWarmer/RouterCacheWarmer.php | 58 - .../CacheWarmer/TemplateFinder.php | 109 - .../CacheWarmer/TemplateFinderInterface.php | 27 - .../CacheWarmer/TemplatePathsCacheWarmer.php | 64 - .../Symfony/Bundle/FrameworkBundle/Client.php | 125 - .../Command/AssetsInstallCommand.php | 112 - .../Command/CacheClearCommand.php | 177 - .../Command/CacheWarmupCommand.php | 66 - .../Command/ConfigDumpReferenceCommand.php | 266 - .../Command/ContainerAwareCommand.php | 49 - .../Command/ContainerDebugCommand.php | 226 - .../Command/RouterApacheDumperCommand.php | 86 - .../Command/RouterDebugCommand.php | 178 - .../Command/RouterMatchCommand.php | 89 - .../Command/ServerRunCommand.php | 98 - .../Command/TranslationUpdateCommand.php | 134 - .../FrameworkBundle/Console/Application.php | 87 - .../Bundle/FrameworkBundle/Console/Shell.php | 45 - .../FrameworkBundle/Controller/Controller.php | 247 - .../Controller/ControllerNameParser.php | 86 - .../Controller/ControllerResolver.php | 85 - .../Controller/InternalController.php | 46 - .../Controller/RedirectController.php | 101 - .../Controller/TemplateController.php | 35 - .../TraceableControllerResolver.php | 71 - .../DataCollector/RouterDataCollector.php | 37 - .../Compiler/AddCacheClearerPass.php | 41 - .../Compiler/AddCacheWarmerPass.php | 50 - .../Compiler/AddConstraintValidatorsPass.php | 34 - .../Compiler/AddValidatorInitializersPass.php | 33 - .../Compiler/CompilerDebugDumpPass.php | 33 - .../ContainerBuilderDebugDumpPass.php | 34 - .../DependencyInjection/Compiler/FormPass.php | 62 - .../Compiler/ProfilerPass.php | 57 - .../Compiler/RegisterKernelListenersPass.php | 59 - .../Compiler/RoutingResolverPass.php | 37 - .../Compiler/TemplatingPass.php | 39 - .../Compiler/TranslationDumperPass.php | 35 - .../Compiler/TranslationExtractorPass.php | 39 - .../Compiler/TranslatorPass.php | 45 - .../DependencyInjection/Configuration.php | 412 -- .../FrameworkExtension.php | 651 -- .../EventListener/SessionListener.php | 61 - .../EventListener/TestSessionListener.php | 88 - .../FrameworkBundle/FrameworkBundle.php | 72 - .../FrameworkBundle/HttpCache/HttpCache.php | 82 - .../Bundle/FrameworkBundle/HttpKernel.php | 241 - .../Symfony/Bundle/FrameworkBundle/LICENSE | 19 - .../Resources/config/annotations.xml | 30 - .../Resources/config/collectors.xml | 60 - .../Resources/config/debug.xml | 32 - .../FrameworkBundle/Resources/config/esi.xml | 20 - .../FrameworkBundle/Resources/config/form.xml | 153 - .../Resources/config/form_csrf.xml | 24 - .../Resources/config/profiling.xml | 34 - .../Resources/config/router.php | 30 - .../Resources/config/routing.xml | 98 - .../Resources/config/routing/internal.xml | 18 - .../Resources/config/schema/symfony-1.0.xsd | 143 - .../Resources/config/services.xml | 55 - .../Resources/config/session.xml | 49 - .../Resources/config/templating.xml | 64 - .../Resources/config/templating_debug.xml | 17 - .../Resources/config/templating_php.xml | 118 - .../FrameworkBundle/Resources/config/test.xml | 32 - .../Resources/config/translation.xml | 139 - .../Resources/config/validator.xml | 65 - .../FrameworkBundle/Resources/config/web.xml | 43 - .../Resources/public/css/exception.css | 232 - .../Resources/public/css/exception_layout.css | 136 - .../public/images/blue_picto_less.gif | Bin 197 -> 0 bytes .../public/images/blue_picto_more.gif | Bin 213 -> 0 bytes .../Resources/public/images/border_l.png | Bin 249 -> 0 bytes .../Resources/public/images/border_r.png | Bin 253 -> 0 bytes .../Resources/public/images/btn_bg.png | Bin 87 -> 0 bytes .../Resources/public/images/close_quote.gif | Bin 284 -> 0 bytes .../public/images/exception_detected.gif | Bin 3996 -> 0 bytes .../public/images/exception_detected.png | Bin 3637 -> 0 bytes .../public/images/grey_magnifier.png | Bin 393 -> 0 bytes .../Resources/public/images/icon_log.png | Bin 283 -> 0 bytes .../Resources/public/images/input_bg.gif | Bin 63 -> 0 bytes .../Resources/public/images/logo_symfony.gif | Bin 1698 -> 0 bytes .../Resources/public/images/logo_symfony.png | Bin 1459 -> 0 bytes .../Resources/public/images/open_quote.gif | Bin 281 -> 0 bytes .../Resources/views/Form/attributes.html.php | 1 - .../views/Form/checkbox_widget.html.php | 5 - .../views/Form/choice_options.html.php | 1 - .../views/Form/choice_widget.html.php | 5 - .../Form/choice_widget_collapsed.html.php | 13 - .../Form/choice_widget_expanded.html.php | 6 - .../views/Form/choice_widget_options.html.php | 11 - .../views/Form/collection_widget.html.php | 4 - .../views/Form/container_attributes.html.php | 1 - .../Resources/views/Form/date_widget.html.php | 11 - .../views/Form/datetime_widget.html.php | 7 - .../views/Form/email_widget.html.php | 1 - .../views/Form/field_enctype.html.php | 1 - .../views/Form/field_errors.html.php | 1 - .../Resources/views/Form/field_label.html.php | 1 - .../Resources/views/Form/field_rest.html.php | 1 - .../Resources/views/Form/field_row.html.php | 1 - .../Resources/views/Form/field_rows.html.php | 1 - .../views/Form/field_widget.html.php | 1 - .../views/Form/form_enctype.html.php | 1 - .../Resources/views/Form/form_errors.html.php | 21 - .../Resources/views/Form/form_label.html.php | 4 - .../Resources/views/Form/form_rest.html.php | 5 - .../Resources/views/Form/form_row.html.php | 5 - .../Resources/views/Form/form_rows.html.php | 3 - .../Resources/views/Form/form_widget.html.php | 5 - .../views/Form/form_widget_compound.html.php | 11 - .../views/Form/form_widget_simple.html.php | 5 - .../Resources/views/Form/hidden_row.html.php | 1 - .../views/Form/hidden_widget.html.php | 1 - .../views/Form/integer_widget.html.php | 1 - .../views/Form/money_widget.html.php | 1 - .../views/Form/number_widget.html.php | 1 - .../views/Form/password_widget.html.php | 1 - .../views/Form/percent_widget.html.php | 1 - .../views/Form/radio_widget.html.php | 5 - .../views/Form/repeated_row.html.php | 1 - .../views/Form/search_widget.html.php | 1 - .../views/Form/textarea_widget.html.php | 1 - .../Resources/views/Form/time_widget.html.php | 18 - .../Resources/views/Form/url_widget.html.php | 1 - .../views/Form/widget_attributes.html.php | 10 - .../Form/widget_container_attributes.html.php | 2 - .../views/FormTable/form_errors.html.php | 21 - .../views/FormTable/form_row.html.php | 9 - .../FormTable/form_widget_compound.html.php | 7 - .../views/FormTable/hidden_row.html.php | 5 - .../Routing/DelegatingLoader.php | 73 - .../Routing/RedirectableUrlMatcher.php | 42 - .../Bundle/FrameworkBundle/Routing/Router.php | 151 - .../Templating/Asset/PackageFactory.php | 44 - .../Templating/Asset/PathPackage.php | 35 - .../FrameworkBundle/Templating/Debugger.php | 47 - .../Templating/DelegatingEngine.php | 89 - .../Templating/EngineInterface.php | 34 - .../Templating/GlobalVariables.php | 110 - .../Templating/Helper/ActionsHelper.php | 61 - .../Templating/Helper/CodeHelper.php | 222 - .../Templating/Helper/FormHelper.php | 208 - .../Templating/Helper/RequestHelper.php | 68 - .../Templating/Helper/RouterHelper.php | 59 - .../Templating/Helper/SessionHelper.php | 73 - .../Templating/Helper/TranslatorHelper.php | 61 - .../Templating/Loader/FilesystemLoader.php | 74 - .../Templating/Loader/TemplateLocator.php | 84 - .../FrameworkBundle/Templating/PhpEngine.php | 92 - .../Templating/TemplateFilenameParser.php | 40 - .../Templating/TemplateNameParser.php | 83 - .../Templating/TemplateReference.php | 57 - .../FrameworkBundle/Test/WebTestCase.php | 169 - .../Tests/CacheWarmer/TemplateFinderTest.php | 57 - .../Tests/Command/TestCaseMethod.tpl | 47 - .../Controller/ControllerNameParserTest.php | 110 - .../Controller/RedirectControllerTest.php | 122 - .../Compiler/AddCacheWarmerPassTest.php | 92 - .../Compiler/ProfilerPassTest.php | 76 - .../RegisterKernelListenersPassTest.php | 89 - .../Compiler/TranslatorPassTest.php | 48 - .../Resources/config/validation.xml | 0 .../Resources/config/validation.yml | 0 .../Fixtures/TestBundle/TestBundle.php | 17 - .../Fixtures/php/deprecated_merge_full.php | 20 - .../Fixtures/php/deprecated_merge_partial.php | 17 - .../DependencyInjection/Fixtures/php/full.php | 71 - .../Fixtures/php/templating_url_package.php | 14 - .../Fixtures/php/validation_annotations.php | 9 - .../Fixtures/xml/deprecated_merge_full.xml | 12 - .../Fixtures/xml/deprecated_merge_partial.xml | 12 - .../DependencyInjection/Fixtures/xml/full.xml | 40 - .../Fixtures/xml/templating_url_package.xml | 19 - .../Fixtures/xml/validation_annotations.xml | 12 - .../Fixtures/yml/deprecated_merge_full.yml | 16 - .../Fixtures/yml/deprecated_merge_partial.yml | 14 - .../DependencyInjection/Fixtures/yml/full.yml | 54 - .../Fixtures/yml/templating_url_package.yml | 8 - .../Fixtures/yml/validation_annotations.yml | 5 - .../FrameworkExtensionTest.php | 304 - .../PhpFrameworkExtensionTest.php | 25 - .../XmlFrameworkExtensionTest.php | 25 - .../YamlFrameworkExtensionTest.php | 25 - .../EventListener/TestSessionListenerTest.php | 106 - .../Tests/Fixtures/BaseBundle/BaseBundle.php | 18 - .../Resources/views/base.format.engine | 0 .../views/controller/base.format.engine | 0 .../views/this.is.a.template.format.engine | 0 .../Resources/views/resource.format.engine | 0 .../views/this.is.a.template.format.engine | 0 .../Resources/views/translation.html.php | 2 - .../Controller/DefaultController.php | 21 - .../Fabpot/FooBundle/FabpotFooBundle.php | 30 - .../Controller/DefaultController.php | 21 - .../Controller/Sub/DefaultController.php | 21 - .../Controller/Test/DefaultController.php | 21 - .../TestBundle/FooBundle/FooBundle.php | 23 - .../Controller/DefaultController.php | 21 - .../Cms/FooBundle/SensioCmsFooBundle.php | 23 - .../Controller/DefaultController.php | 21 - .../Sensio/FooBundle/SensioFooBundle.php | 23 - .../Controller/SessionController.php | 72 - .../TestBundle/Resources/config/routing.yml | 19 - .../Bundle/TestBundle/TestBundle.php | 18 - .../Tests/Functional/SessionTest.php | 154 - .../Tests/Functional/WebTestCase.php | 67 - .../Tests/Functional/app/AppKernel.php | 113 - .../Tests/Functional/app/Session/bundles.php | 9 - .../Tests/Functional/app/Session/config.yml | 2 - .../Tests/Functional/app/Session/routing.yml | 2 - .../Tests/Functional/app/config/default.yml | 2 - .../Tests/Functional/app/config/framework.yml | 14 - .../FrameworkBundle/Tests/HttpKernelTest.php | 216 - .../Routing/RedirectableUrlMatcherTest.php | 60 - .../Tests/Routing/RouterTest.php | 189 - .../Templating/Helper/CodeHelperTest.php | 69 - .../Fixtures/StubTemplateNameParser.php | 43 - .../Helper/Fixtures/StubTranslator.php | 35 - .../Helper/FormHelperDivLayoutTest.php | 103 - .../Helper/FormHelperTableLayoutTest.php | 92 - .../Templating/Helper/RequestHelperTest.php | 55 - .../Resources/Child/form_label.html.php | 1 - .../Custom/_name_entry_label.html.php | 2 - .../Resources/Custom/_text_id_widget.html.php | 3 - .../Resources/Parent/form_label.html.php | 1 - .../Parent/form_widget_simple.html.php | 2 - .../Templating/Helper/SessionHelperTest.php | 70 - .../Templating/Loader/TemplateLocatorTest.php | 84 - .../Tests/Templating/PhpEngineTest.php | 74 - .../Templating/TemplateFilenameParserTest.php | 56 - .../Templating/TemplateNameParserTest.php | 87 - .../Templating/TemplateReferenceTest.php | 28 - .../Tests/Templating/TemplateTest.php | 48 - .../Bundle/FrameworkBundle/Tests/TestCase.php | 16 - .../Tests/Translation/PhpExtractorTest.php | 35 - .../Tests/Translation/TranslatorTest.php | 189 - .../ConstraintValidatorFactoryTest.php | 65 - .../Translation/PhpExtractor.php | 123 - .../Translation/TranslationLoader.php | 61 - .../Translation/Translator.php | 148 - .../Validator/ConstraintValidatorFactory.php | 74 - .../Bundle/FrameworkBundle/composer.json | 45 - .../Bundle/SecurityBundle/CHANGELOG.md | 77 - .../SecurityBundle/Command/InitAclCommand.php | 74 - .../DataCollector/SecurityDataCollector.php | 109 - .../Compiler/AddSecurityVotersPass.php | 45 - .../DependencyInjection/MainConfiguration.php | 391 -- .../Security/Factory/AbstractFactory.php | 197 - .../Security/Factory/FormLoginFactory.php | 100 - .../Security/Factory/HttpBasicFactory.php | 82 - .../Security/Factory/HttpDigestFactory.php | 85 - .../Security/Factory/RememberMeFactory.php | 143 - .../Factory/SecurityFactoryInterface.php | 31 - .../Security/Factory/X509Factory.php | 67 - .../Security/UserProvider/InMemoryFactory.php | 69 - .../UserProviderFactoryInterface.php | 30 - .../DependencyInjection/SecurityExtension.php | 631 -- .../EventListener/AclSchemaListener.php | 36 - .../EventListener/ResponseListener.php | 34 - .../src/Symfony/Bundle/SecurityBundle/LICENSE | 19 - .../Resources/config/collectors.xml | 17 - .../Resources/config/security.xml | 141 - .../Resources/config/security_acl.xml | 47 - .../Resources/config/security_acl_dbal.xml | 54 - .../Resources/config/security_listeners.xml | 212 - .../Resources/config/security_rememberme.xml | 61 - .../Resources/config/templating_php.xml | 24 - .../Resources/config/templating_twig.xml | 23 - .../views/Collector/security.html.twig | 74 - .../Security/FirewallContext.php | 37 - .../SecurityBundle/Security/FirewallMap.php | 46 - .../Bundle/SecurityBundle/SecurityBundle.php | 45 - .../Templating/Helper/LogoutUrlHelper.php | 121 - .../Templating/Helper/SecurityHelper.php | 59 - .../DependencyInjection/ConfigurationTest.php | 70 - .../Fixtures/php/container1.php | 75 - .../Fixtures/php/custom_acl_provider.php | 9 - .../Fixtures/php/merge.php | 20 - .../Fixtures/php/merge_import.php | 15 - .../Fixtures/xml/container1.xml | 63 - .../Fixtures/xml/custom_acl_provider.xml | 16 - .../Fixtures/xml/merge.xml | 22 - .../Fixtures/xml/merge_import.xml | 17 - .../Fixtures/yml/container1.yml | 57 - .../Fixtures/yml/custom_acl_provider.yml | 6 - .../Fixtures/yml/merge.yml | 14 - .../Fixtures/yml/merge_import.yml | 9 - .../PhpSecurityExtensionTest.php | 25 - .../Security/Factory/AbstractFactoryTest.php | 103 - .../SecurityExtensionTest.php | 183 - .../XmlSecurityExtensionTest.php | 25 - .../YamlSecurityExtensionTest.php | 25 - .../AuthenticationCommencingTest.php | 24 - .../Controller/LoginController.php | 43 - .../CsrfFormLoginBundle.php | 18 - .../Form/UserLoginFormType.php | 98 - .../Resources/config/routing.yml | 30 - .../views/Login/after_login.html.twig | 8 - .../Resources/views/Login/login.html.twig | 12 - .../Controller/LocalizedController.php | 60 - .../Controller/LoginController.php | 51 - .../FormLoginExtension.php | 28 - .../FormLoginBundle/FormLoginBundle.php | 18 - .../Resources/config/localized_routing.yml | 29 - .../Resources/config/routing.yml | 33 - .../Resources/views/Localized/login.html.twig | 21 - .../views/Login/after_login.html.twig | 6 - .../Resources/views/Login/login.html.twig | 21 - .../Security/LocalizedFormFailureHandler.php | 33 - .../Tests/Functional/CsrfFormLoginTest.php | 132 - .../Tests/Functional/FormLoginTest.php | 103 - .../Functional/LocalizedRoutesAsPathTest.php | 97 - .../SecurityRoutingIntegrationTest.php | 84 - .../Tests/Functional/SwitchUserTest.php | 91 - .../Tests/Functional/WebTestCase.php | 67 - .../Tests/Functional/app/AppKernel.php | 113 - .../Functional/app/CsrfFormLogin/bundles.php | 8 - .../Functional/app/CsrfFormLogin/config.yml | 47 - .../app/CsrfFormLogin/routes_as_path.yml | 13 - .../Functional/app/CsrfFormLogin/routing.yml | 2 - .../app/Resources/views/base.html.twig | 13 - .../app/StandardFormLogin/bundles.php | 13 - .../app/StandardFormLogin/config.yml | 32 - .../localized_form_failure_handler.yml | 20 - .../StandardFormLogin/localized_routes.yml | 26 - .../localized_routes_with_forward.yml | 9 - .../app/StandardFormLogin/routes_as_path.yml | 13 - .../app/StandardFormLogin/routing.yml | 5 - .../app/StandardFormLogin/switchuser.yml | 14 - .../Tests/Functional/app/config/default.yml | 3 - .../Tests/Functional/app/config/framework.yml | 15 - .../Tests/Functional/app/config/twig.yml | 7 - .../Twig/Extension/LogoutUrlExtension.php | 75 - .../Bundle/SecurityBundle/composer.json | 31 - .../Symfony/Bundle/TwigBundle/CHANGELOG.md | 11 - .../CacheWarmer/TemplateCacheCacheWarmer.php | 78 - .../Bundle/TwigBundle/Command/LintCommand.php | 139 - .../Controller/ExceptionController.php | 114 - .../TwigBundle/Debug/TimedTwigEngine.php | 58 - .../Compiler/ExceptionListenerPass.php | 36 - .../Compiler/TwigEnvironmentPass.php | 44 - .../DependencyInjection/Configuration.php | 134 - .../DependencyInjection/TwigExtension.php | 125 - .../TwigBundle/Extension/ActionsExtension.php | 67 - .../TwigBundle/Extension/AssetsExtension.php | 79 - .../TwigBundle/Extension/CodeExtension.php | 97 - .../src/Symfony/Bundle/TwigBundle/LICENSE | 19 - .../TwigBundle/Loader/FilesystemLoader.php | 87 - .../Bundle/TwigBundle/Node/RenderNode.php | 44 - .../TwigBundle/Resources/config/debug.xml | 24 - .../Resources/config/schema/twig-1.0.xsd | 44 - .../TwigBundle/Resources/config/twig.xml | 104 - .../Resources/views/Exception/error.atom.twig | 1 - .../Resources/views/Exception/error.css.twig | 4 - .../Resources/views/Exception/error.html.twig | 17 - .../Resources/views/Exception/error.js.twig | 4 - .../Resources/views/Exception/error.json.twig | 1 - .../Resources/views/Exception/error.rdf.twig | 1 - .../Resources/views/Exception/error.txt.twig | 8 - .../Resources/views/Exception/error.xml.twig | 3 - .../views/Exception/exception.atom.twig | 1 - .../views/Exception/exception.css.twig | 3 - .../views/Exception/exception.html.twig | 129 - .../views/Exception/exception.js.twig | 3 - .../views/Exception/exception.json.twig | 1 - .../views/Exception/exception.rdf.twig | 1 - .../views/Exception/exception.txt.twig | 7 - .../views/Exception/exception.xml.twig | 9 - .../views/Exception/exception_full.html.twig | 9 - .../Resources/views/Exception/logs.html.twig | 7 - .../Resources/views/Exception/trace.html.twig | 22 - .../Resources/views/Exception/trace.txt.twig | 8 - .../views/Exception/traces.html.twig | 25 - .../Resources/views/Exception/traces.txt.twig | 6 - .../Resources/views/Exception/traces.xml.twig | 8 - .../Resources/views/layout.html.twig | 42 - .../Controller/ExceptionControllerTest.php | 83 - .../DependencyInjection/Fixtures/php/full.php | 22 - .../DependencyInjection/Fixtures/xml/full.xml | 18 - .../DependencyInjection/Fixtures/yml/full.yml | 16 - .../DependencyInjection/TwigExtensionTest.php | 158 - .../Tests/Loader/FilesystemLoaderTest.php | 74 - .../Bundle/TwigBundle/Tests/TestCase.php | 22 - .../TwigBundle/Tests/TwigEngineTest.php | 94 - .../TokenParser/RenderTokenParser.php | 68 - .../Symfony/Bundle/TwigBundle/TwigBundle.php | 33 - .../Symfony/Bundle/TwigBundle/TwigEngine.php | 117 - .../Symfony/Bundle/TwigBundle/composer.json | 31 - .../Bundle/WebProfilerBundle/CHANGELOG.md | 14 - .../Controller/ExceptionController.php | 45 - .../Controller/ProfilerController.php | 330 -- .../Controller/RouterController.php | 56 - .../DependencyInjection/Configuration.php | 54 - .../WebProfilerExtension.php | 74 - .../EventListener/WebDebugToolbarListener.php | 136 - .../Symfony/Bundle/WebProfilerBundle/LICENSE | 19 - .../Profiler/TemplateManager.php | 123 - .../Resources/ICONS_LICENSE.txt | 5 - .../Resources/config/routing/profiler.xml | 49 - .../Resources/config/routing/wdt.xml | 10 - .../config/schema/webprofiler-1.0.xsd | 23 - .../Resources/config/toolbar.xml | 20 - .../Resources/public/css/profiler.css | 490 -- .../Resources/public/favicon.ico | Bin 1150 -> 0 bytes .../Resources/public/images/close.png | Bin 402 -> 0 bytes .../Resources/public/images/config.png | Bin 379 -> 0 bytes .../Resources/public/images/db.png | Bin 246 -> 0 bytes .../Resources/public/images/events.png | Bin 730 -> 0 bytes .../Resources/public/images/exception.png | Bin 921 -> 0 bytes .../Resources/public/images/import.png | Bin 988 -> 0 bytes .../Resources/public/images/logger.png | Bin 283 -> 0 bytes .../Resources/public/images/mail.png | Bin 568 -> 0 bytes .../Resources/public/images/memory.png | Bin 199 -> 0 bytes .../public/images/profiler/bg_submenu.gif | Bin 176 -> 0 bytes .../public/images/profiler/bg_submenu.png | Bin 114 -> 0 bytes .../public/images/profiler/border_l.png | Bin 249 -> 0 bytes .../public/images/profiler/border_r.png | Bin 253 -> 0 bytes .../public/images/profiler/btn_bg.png | Bin 87 -> 0 bytes .../public/images/profiler/config.png | Bin 379 -> 0 bytes .../Resources/public/images/profiler/db.png | Bin 358 -> 0 bytes .../public/images/profiler/events.png | Bin 1060 -> 0 bytes .../public/images/profiler/exception.png | Bin 1148 -> 0 bytes .../public/images/profiler/grey_magnifier.png | Bin 393 -> 0 bytes .../public/images/profiler/input_bg.gif | Bin 63 -> 0 bytes .../public/images/profiler/logger.png | Bin 453 -> 0 bytes .../images/profiler/logo_symfony_profiler.gif | Bin 2589 -> 0 bytes .../images/profiler/logo_symfony_profiler.png | Bin 2222 -> 0 bytes .../Resources/public/images/profiler/mail.png | Bin 1093 -> 0 bytes .../public/images/profiler/request.png | Bin 1042 -> 0 bytes .../public/images/profiler/routing.png | Bin 696 -> 0 bytes .../public/images/profiler/security.png | Bin 994 -> 0 bytes .../public/images/profiler/spinner.gif | Bin 1505 -> 0 bytes .../Resources/public/images/profiler/time.png | Bin 776 -> 0 bytes .../Resources/public/images/request.png | Bin 757 -> 0 bytes .../Resources/public/images/routing.png | Bin 337 -> 0 bytes .../Resources/public/images/search.png | Bin 785 -> 0 bytes .../Resources/public/images/security.png | Bin 808 -> 0 bytes .../Resources/public/images/spacer.gif | Bin 45 -> 0 bytes .../Resources/public/images/symfony.png | Bin 1332 -> 0 bytes .../Resources/public/images/time.png | Bin 482 -> 0 bytes .../views/Collector/config.html.twig | 165 - .../views/Collector/events.html.twig | 72 - .../views/Collector/exception.html.twig | 30 - .../views/Collector/logger.html.twig | 77 - .../views/Collector/memory.html.twig | 17 - .../views/Collector/request.html.twig | 161 - .../views/Collector/router.html.twig | 15 - .../Resources/views/Collector/time.html.twig | 468 -- .../Resources/views/Profiler/admin.html.twig | 27 - .../views/Profiler/ajax_layout.html.twig | 1 - .../Resources/views/Profiler/bag.html.twig | 16 - .../Resources/views/Profiler/base.html.twig | 16 - .../views/Profiler/base_js.html.twig | 72 - .../Resources/views/Profiler/header.html.twig | 25 - .../Resources/views/Profiler/info.html.twig | 43 - .../Resources/views/Profiler/layout.html.twig | 54 - .../views/Profiler/results.html.twig | 35 - .../Resources/views/Profiler/search.html.twig | 39 - .../Resources/views/Profiler/table.html.twig | 16 - .../views/Profiler/toolbar.html.twig | 26 - .../views/Profiler/toolbar_item.html.twig | 9 - .../views/Profiler/toolbar_js.html.twig | 18 - .../views/Profiler/toolbar_redirect.html.twig | 18 - .../views/Profiler/toolbar_style.html.twig | 275 - .../Resources/views/Router/panel.html.twig | 44 - .../Controller/ExceptionControllerTest.php | 89 - .../DependencyInjection/ConfigurationTest.php | 41 - .../WebProfilerExtensionTest.php | 133 - .../WebDebugToolbarListenerTest.php | 226 - .../Tests/Profiler/TemplateManagerTest.php | 178 - .../WebProfilerBundle/Tests/TestCase.php | 22 - .../WebProfilerBundle/WebProfilerBundle.php | 23 - .../Bundle/WebProfilerBundle/composer.json | 31 - .../Symfony/Component/BrowserKit/.gitignore | 2 - .../Symfony/Component/BrowserKit/CHANGELOG.md | 8 - .../Symfony/Component/BrowserKit/Client.php | 492 -- .../Symfony/Component/BrowserKit/Cookie.php | 315 - .../Component/BrowserKit/CookieJar.php | 215 - .../Symfony/Component/BrowserKit/History.php | 110 - .../src/Symfony/Component/BrowserKit/LICENSE | 19 - .../Symfony/Component/BrowserKit/README.md | 26 - .../Symfony/Component/BrowserKit/Request.php | 138 - .../Symfony/Component/BrowserKit/Response.php | 138 - .../Component/BrowserKit/Tests/ClientTest.php | 419 -- .../BrowserKit/Tests/CookieJarTest.php | 191 - .../Component/BrowserKit/Tests/CookieTest.php | 174 - .../BrowserKit/Tests/HistoryTest.php | 101 - .../BrowserKit/Tests/RequestTest.php | 53 - .../BrowserKit/Tests/ResponseTest.php | 76 - .../Component/BrowserKit/Tests/bootstrap.php | 22 - .../Component/BrowserKit/composer.json | 38 - .../Component/BrowserKit/phpunit.xml.dist | 30 - .../Symfony/Component/ClassLoader/.gitignore | 2 - .../Component/ClassLoader/ApcClassLoader.php | 118 - .../ClassLoader/ApcUniversalClassLoader.php | 98 - .../Component/ClassLoader/CHANGELOG.md | 15 - .../ClassLoader/ClassCollectionLoader.php | 320 - .../Component/ClassLoader/ClassLoader.php | 203 - .../ClassLoader/ClassMapGenerator.php | 133 - .../ClassLoader/DebugClassLoader.php | 91 - .../ClassLoader/DebugUniversalClassLoader.php | 63 - .../src/Symfony/Component/ClassLoader/LICENSE | 19 - .../Component/ClassLoader/MapClassLoader.php | 76 - .../Symfony/Component/ClassLoader/README.md | 72 - .../Tests/ApcUniversalClassLoaderTest.php | 192 - .../Tests/ClassCollectionLoaderTest.php | 176 - .../ClassLoader/Tests/ClassLoaderTest.php | 163 - .../Tests/ClassMapGeneratorTest.php | 102 - .../Tests/Fixtures/Apc/Namespaced/Bar.php | 17 - .../Tests/Fixtures/Apc/Namespaced/Baz.php | 17 - .../Tests/Fixtures/Apc/Namespaced/Foo.php | 17 - .../Tests/Fixtures/Apc/Namespaced/FooBar.php | 17 - .../Tests/Fixtures/Apc/Pearlike/Bar.php | 6 - .../Tests/Fixtures/Apc/Pearlike/Baz.php | 6 - .../Tests/Fixtures/Apc/Pearlike/Foo.php | 6 - .../alpha/Apc/ApcPrefixCollision/A/Bar.php | 6 - .../alpha/Apc/ApcPrefixCollision/A/Foo.php | 6 - .../alpha/Apc/NamespaceCollision/A/Bar.php | 17 - .../alpha/Apc/NamespaceCollision/A/Foo.php | 17 - .../beta/Apc/ApcPrefixCollision/A/B/Bar.php | 6 - .../beta/Apc/ApcPrefixCollision/A/B/Foo.php | 6 - .../beta/Apc/NamespaceCollision/A/B/Bar.php | 17 - .../beta/Apc/NamespaceCollision/A/B/Foo.php | 17 - .../Apc/fallback/Apc/Pearlike/FooBar.php | 6 - .../Apc/fallback/Namespaced/FooBar.php | 17 - .../Tests/Fixtures/ClassesWithParents/A.php | 5 - .../Fixtures/ClassesWithParents/ATrait.php | 7 - .../Tests/Fixtures/ClassesWithParents/B.php | 5 - .../Fixtures/ClassesWithParents/BTrait.php | 8 - .../ClassesWithParents/CInterface.php | 7 - .../Fixtures/ClassesWithParents/CTrait.php | 7 - .../Tests/Fixtures/ClassesWithParents/D.php | 8 - .../Tests/Fixtures/ClassesWithParents/E.php | 8 - .../ClassesWithParents/GInterface.php | 7 - .../Tests/Fixtures/Namespaced/Bar.php | 17 - .../Tests/Fixtures/Namespaced/Baz.php | 17 - .../Tests/Fixtures/Namespaced/Foo.php | 17 - .../Tests/Fixtures/Namespaced2/Bar.php | 8 - .../Tests/Fixtures/Namespaced2/Baz.php | 8 - .../Tests/Fixtures/Namespaced2/Foo.php | 8 - .../Tests/Fixtures/Pearlike/Bar.php | 6 - .../Tests/Fixtures/Pearlike/Baz.php | 6 - .../Tests/Fixtures/Pearlike/Foo.php | 6 - .../Tests/Fixtures/Pearlike2/Bar.php | 6 - .../Tests/Fixtures/Pearlike2/Baz.php | 6 - .../Tests/Fixtures/Pearlike2/Foo.php | 6 - .../alpha/NamespaceCollision/A/Bar.php | 17 - .../alpha/NamespaceCollision/A/Foo.php | 17 - .../alpha/NamespaceCollision/C/Bar.php | 8 - .../alpha/NamespaceCollision/C/Foo.php | 8 - .../Fixtures/alpha/PrefixCollision/A/Bar.php | 6 - .../Fixtures/alpha/PrefixCollision/A/Foo.php | 6 - .../Fixtures/alpha/PrefixCollision/C/Bar.php | 6 - .../Fixtures/alpha/PrefixCollision/C/Foo.php | 6 - .../beta/NamespaceCollision/A/B/Bar.php | 17 - .../beta/NamespaceCollision/A/B/Foo.php | 17 - .../beta/NamespaceCollision/C/B/Bar.php | 8 - .../beta/NamespaceCollision/C/B/Foo.php | 8 - .../Fixtures/beta/PrefixCollision/A/B/Bar.php | 6 - .../Fixtures/beta/PrefixCollision/A/B/Foo.php | 6 - .../Fixtures/beta/PrefixCollision/C/B/Bar.php | 6 - .../Fixtures/beta/PrefixCollision/C/B/Foo.php | 6 - .../Tests/Fixtures/classmap/SomeClass.php | 17 - .../Tests/Fixtures/classmap/SomeInterface.php | 17 - .../Tests/Fixtures/classmap/SomeParent.php | 17 - .../Tests/Fixtures/classmap/multipleNs.php | 14 - .../Tests/Fixtures/classmap/notAClass.php | 3 - .../Tests/Fixtures/classmap/notPhpFile.md | 1 - .../classmap/sameNsMultipleClasses.php | 15 - .../Fixtures/fallback/Namespaced/FooBar.php | 17 - .../Fixtures/fallback/Namespaced2/FooBar.php | 8 - .../Fixtures/fallback/Pearlike/FooBar.php | 6 - .../Fixtures/fallback/Pearlike2/FooBar.php | 6 - .../Tests/Fixtures/includepath/Foo.php | 5 - .../Tests/Fixtures/php5.4/traits.php | 30 - .../Tests/UniversalClassLoaderTest.php | 196 - .../Component/ClassLoader/Tests/bootstrap.php | 22 - .../ClassLoader/UniversalClassLoader.php | 319 - .../ClassLoader/XcacheClassLoader.php | 121 - .../Component/ClassLoader/composer.json | 34 - .../Component/ClassLoader/phpunit.xml.dist | 30 - .../src/Symfony/Component/Config/CHANGELOG.md | 10 - .../Symfony/Component/Config/ConfigCache.php | 117 - .../Component/Config/Definition/ArrayNode.php | 362 -- .../Component/Config/Definition/BaseNode.php | 337 -- .../Config/Definition/BooleanNode.php | 39 - .../Builder/ArrayNodeDefinition.php | 419 -- .../Builder/BooleanNodeDefinition.php | 43 - .../Definition/Builder/EnumNodeDefinition.php | 43 - .../Config/Definition/Builder/ExprBuilder.php | 229 - .../Definition/Builder/MergeBuilder.php | 74 - .../Config/Definition/Builder/NodeBuilder.php | 219 - .../Definition/Builder/NodeDefinition.php | 343 -- .../Builder/NodeParentInterface.php | 21 - .../Builder/NormalizationBuilder.php | 70 - .../Builder/ParentNodeDefinitionInterface.php | 26 - .../Builder/ScalarNodeDefinition.php | 32 - .../Config/Definition/Builder/TreeBuilder.php | 59 - .../Definition/Builder/ValidationBuilder.php | 53 - .../Builder/VariableNodeDefinition.php | 68 - .../Definition/ConfigurationInterface.php | 27 - .../Component/Config/Definition/EnumNode.php | 50 - .../Exception/DuplicateKeyException.php | 22 - .../Config/Definition/Exception/Exception.php | 21 - .../Exception/ForbiddenOverwriteException.php | 22 - .../InvalidConfigurationException.php | 33 - .../Exception/InvalidDefinitionException.php | 21 - .../Exception/InvalidTypeException.php | 21 - .../Exception/UnsetKeyException.php | 22 - .../Config/Definition/NodeInterface.php | 87 - .../Component/Config/Definition/Processor.php | 127 - .../Definition/PrototypeNodeInterface.php | 27 - .../Config/Definition/PrototypedArrayNode.php | 342 -- .../Config/Definition/ScalarNode.php | 47 - .../Config/Definition/VariableNode.php | 114 - ...LoaderImportCircularReferenceException.php | 27 - .../Exception/FileLoaderLoadException.php | 78 - .../Symfony/Component/Config/FileLocator.php | 99 - .../Component/Config/FileLocatorInterface.php | 31 - .../src/Symfony/Component/Config/LICENSE | 19 - .../Config/Loader/DelegatingLoader.php | 62 - .../Component/Config/Loader/FileLoader.php | 93 - .../Component/Config/Loader/Loader.php | 80 - .../Config/Loader/LoaderInterface.php | 53 - .../Config/Loader/LoaderResolver.php | 81 - .../Config/Loader/LoaderResolverInterface.php | 30 - .../src/Symfony/Component/Config/README.md | 14 - .../Config/Resource/DirectoryResource.php | 102 - .../Config/Resource/FileResource.php | 80 - .../Config/Resource/ResourceInterface.php | 43 - .../Config/Tests/Definition/ArrayNodeTest.php | 57 - .../Tests/Definition/BooleanNodeTest.php | 60 - .../Builder/ArrayNodeDefinitionTest.php | 159 - .../Builder/EnumNodeDefinitionTest.php | 37 - .../Definition/Builder/ExprBuilderTest.php | 211 - .../Definition/Builder/NodeBuilderTest.php | 83 - .../Definition/Builder/TreeBuilderTest.php | 127 - .../Config/Tests/Definition/EnumNodeTest.php | 41 - .../Tests/Definition/FinalizationTest.php | 73 - .../Config/Tests/Definition/MergeTest.php | 195 - .../Tests/Definition/NormalizationTest.php | 210 - .../Config/Tests/Definition/ProcessorTest.php | 51 - .../Definition/PrototypedArrayNodeTest.php | 181 - .../Tests/Definition/ScalarNodeTest.php | 60 - .../Config/Tests/FileLocatorTest.php | 107 - .../Config/Tests/Fixtures/Again/foo.xml | 0 .../Fixtures/Builder/BarNodeDefinition.php | 21 - .../Tests/Fixtures/Builder/NodeBuilder.php | 34 - .../Builder/VariableNodeDefinition.php | 18 - .../Component/Config/Tests/Fixtures/foo.xml | 0 .../Tests/Loader/DelegatingLoaderTest.php | 83 - .../Tests/Loader/LoaderResolverTest.php | 56 - .../Config/Tests/Loader/LoaderTest.php | 74 - .../Tests/Resource/DirectoryResourceTest.php | 171 - .../Tests/Resource/FileResourceTest.php | 52 - .../Component/Config/Tests/bootstrap.php | 18 - .../Symfony/Component/Config/composer.json | 30 - .../Symfony/Component/Config/phpunit.xml.dist | 30 - .../Symfony/Component/Console/Application.php | 1080 ---- .../Symfony/Component/Console/CHANGELOG.md | 19 - .../Component/Console/Command/Command.php | 614 -- .../Component/Console/Command/HelpCommand.php | 84 - .../Component/Console/Command/ListCommand.php | 87 - .../Console/Formatter/OutputFormatter.php | 249 - .../Formatter/OutputFormatterInterface.php | 83 - .../Formatter/OutputFormatterStyle.php | 218 - .../OutputFormatterStyleInterface.php | 72 - .../Formatter/OutputFormatterStyleStack.php | 121 - .../Component/Console/Helper/DialogHelper.php | 141 - .../Console/Helper/FormatterHelper.php | 102 - .../Component/Console/Helper/Helper.php | 42 - .../Console/Helper/HelperInterface.php | 49 - .../Component/Console/Helper/HelperSet.php | 104 - .../Component/Console/Input/ArgvInput.php | 313 - .../Component/Console/Input/ArrayInput.php | 190 - .../Symfony/Component/Console/Input/Input.php | 211 - .../Component/Console/Input/InputArgument.php | 132 - .../Console/Input/InputDefinition.php | 531 -- .../Console/Input/InputInterface.php | 152 - .../Component/Console/Input/InputOption.php | 209 - .../Component/Console/Input/StringInput.php | 81 - .../src/Symfony/Component/Console/LICENSE | 19 - .../Console/Output/ConsoleOutput.php | 104 - .../Console/Output/ConsoleOutputInterface.php | 30 - .../Component/Console/Output/NullOutput.php | 34 - .../Component/Console/Output/Output.php | 180 - .../Console/Output/OutputInterface.php | 109 - .../Component/Console/Output/StreamOutput.php | 113 - .../src/Symfony/Component/Console/README.md | 55 - .../src/Symfony/Component/Console/Shell.php | 207 - .../Console/Tester/ApplicationTester.php | 104 - .../Console/Tester/CommandTester.php | 102 - .../Console/Tests/ApplicationTest.php | 470 -- .../Console/Tests/Command/CommandTest.php | 253 - .../Console/Tests/Command/HelpCommandTest.php | 42 - .../Console/Tests/Command/ListCommandTest.php | 38 - .../Console/Tests/Fixtures/Foo1Command.php | 26 - .../Console/Tests/Fixtures/Foo2Command.php | 21 - .../Console/Tests/Fixtures/Foo3Command.php | 25 - .../Console/Tests/Fixtures/FooCommand.php | 33 - .../Console/Tests/Fixtures/TestCommand.php | 28 - .../Tests/Fixtures/application_astext1.txt | 20 - .../Tests/Fixtures/application_astext2.txt | 16 - .../Tests/Fixtures/application_asxml1.txt | 83 - .../Tests/Fixtures/application_asxml2.txt | 15 - .../Tests/Fixtures/application_gethelp.txt | 13 - .../Fixtures/application_renderexception1.txt | 8 - .../Fixtures/application_renderexception2.txt | 11 - .../Fixtures/application_renderexception3.txt | 19 - .../Fixtures/application_renderexception4.txt | 9 - .../Tests/Fixtures/application_run1.txt | 17 - .../Tests/Fixtures/application_run2.txt | 26 - .../Tests/Fixtures/application_run3.txt | 27 - .../Tests/Fixtures/application_run4.txt | 1 - .../Console/Tests/Fixtures/command_astext.txt | 18 - .../Console/Tests/Fixtures/command_asxml.txt | 38 - .../Tests/Fixtures/definition_astext.txt | 11 - .../Tests/Fixtures/definition_asxml.txt | 39 - .../OutputFormatterStyleStackTest.php | 70 - .../Formatter/OutputFormatterStyleTest.php | 77 - .../Tests/Formatter/OutputFormatterTest.php | 206 - .../Console/Tests/Helper/DialogHelperTest.php | 93 - .../Tests/Helper/FormatterHelperTest.php | 84 - .../Console/Tests/Input/ArgvInputTest.php | 217 - .../Console/Tests/Input/ArrayInputTest.php | 90 - .../Console/Tests/Input/InputArgumentTest.php | 104 - .../Tests/Input/InputDefinitionTest.php | 363 -- .../Console/Tests/Input/InputOptionTest.php | 192 - .../Console/Tests/Input/InputTest.php | 117 - .../Console/Tests/Input/StringInputTest.php | 58 - .../Tests/Output/ConsoleOutputTest.php | 24 - .../Console/Tests/Output/NullOutputTest.php | 24 - .../Console/Tests/Output/OutputTest.php | 101 - .../Console/Tests/Output/StreamOutputTest.php | 59 - .../Tests/Tester/ApplicationTesterTest.php | 64 - .../Tests/Tester/CommandTesterTest.php | 62 - .../Component/Console/Tests/bootstrap.php | 18 - .../Symfony/Component/Console/composer.json | 30 - .../Component/Console/phpunit.xml.dist | 30 - .../Component/CssSelector/CHANGELOG.md | 7 - .../Component/CssSelector/CssSelector.php | 322 - .../CssSelector/Exception/ParseException.php | 24 - .../src/Symfony/Component/CssSelector/LICENSE | 19 - .../Component/CssSelector/Node/AttribNode.php | 131 - .../Component/CssSelector/Node/ClassNode.php | 59 - .../CssSelector/Node/CombinedSelectorNode.php | 142 - .../CssSelector/Node/ElementNode.php | 77 - .../CssSelector/Node/FunctionNode.php | 290 - .../Component/CssSelector/Node/HashNode.php | 59 - .../CssSelector/Node/NodeInterface.php | 37 - .../Component/CssSelector/Node/OrNode.php | 58 - .../Component/CssSelector/Node/PseudoNode.php | 228 - .../Symfony/Component/CssSelector/README.md | 23 - .../CssSelector/Tests/CssSelectorTest.php | 71 - .../CssSelector/Tests/Node/AttribNodeTest.php | 43 - .../CssSelector/Tests/Node/ClassNodeTest.php | 27 - .../Tests/Node/CombinedSelectorNodeTest.php | 36 - .../Tests/Node/ElementNodeTest.php | 30 - .../Tests/Node/FunctionNodeTest.php | 96 - .../CssSelector/Tests/Node/HashNodeTest.php | 27 - .../CssSelector/Tests/Node/OrNodeTest.php | 43 - .../CssSelector/Tests/Node/PseudoNodeTest.php | 55 - .../CssSelector/Tests/TokenizerTest.php | 71 - .../CssSelector/Tests/XPathExprTest.php | 35 - .../Component/CssSelector/Tests/bootstrap.php | 18 - .../Symfony/Component/CssSelector/Token.php | 73 - .../Component/CssSelector/TokenStream.php | 105 - .../Component/CssSelector/Tokenizer.php | 201 - .../Component/CssSelector/XPathExpr.php | 254 - .../Component/CssSelector/XPathExprOr.php | 54 - .../Component/CssSelector/composer.json | 30 - .../Component/CssSelector/phpunit.xml.dist | 30 - .../Component/DependencyInjection/.gitignore | 2 - .../Component/DependencyInjection/Alias.php | 71 - .../DependencyInjection/CHANGELOG.md | 15 - .../Compiler/AnalyzeServiceReferencesPass.php | 140 - .../Compiler/CheckCircularReferencesPass.php | 70 - .../Compiler/CheckDefinitionValidityPass.php | 79 - ...xceptionOnInvalidReferenceBehaviorPass.php | 64 - .../Compiler/CheckReferenceValidityPass.php | 167 - .../DependencyInjection/Compiler/Compiler.php | 122 - .../Compiler/CompilerPassInterface.php | 33 - .../Compiler/InlineServiceDefinitionsPass.php | 137 - .../Compiler/LoggingFormatter.php | 45 - .../MergeExtensionConfigurationPass.php | 51 - .../Compiler/PassConfig.php | 259 - .../RemoveAbstractDefinitionsPass.php | 39 - .../Compiler/RemovePrivateAliasesPass.php | 44 - .../Compiler/RemoveUnusedDefinitionsPass.php | 84 - .../Compiler/RepeatablePassInterface.php | 28 - .../Compiler/RepeatedPass.php | 80 - .../ReplaceAliasByActualDefinitionPass.php | 116 - .../ResolveDefinitionTemplatesPass.php | 148 - .../Compiler/ResolveInvalidReferencesPass.php | 103 - .../ResolveParameterPlaceHoldersPass.php | 61 - .../ResolveReferencesToAliasesPass.php | 93 - .../Compiler/ServiceReferenceGraph.php | 117 - .../Compiler/ServiceReferenceGraphEdge.php | 70 - .../Compiler/ServiceReferenceGraphNode.php | 124 - .../DependencyInjection/Container.php | 467 -- .../DependencyInjection/ContainerAware.php | 41 - .../ContainerAwareInterface.php | 31 - .../DependencyInjection/ContainerBuilder.php | 871 --- .../ContainerInterface.php | 154 - .../DependencyInjection/Definition.php | 655 -- .../DefinitionDecorator.php | 205 - .../DependencyInjection/Dumper/Dumper.php | 38 - .../Dumper/DumperInterface.php | 33 - .../Dumper/GraphvizDumper.php | 273 - .../DependencyInjection/Dumper/PhpDumper.php | 1136 ---- .../DependencyInjection/Dumper/XmlDumper.php | 301 - .../DependencyInjection/Dumper/YamlDumper.php | 295 - .../Exception/BadMethodCallException.php | 19 - .../Exception/ExceptionInterface.php | 22 - .../Exception/InactiveScopeException.php | 41 - .../Exception/InvalidArgumentException.php | 21 - .../Exception/LogicException.php | 19 - .../Exception/OutOfBoundsException.php | 19 - .../ParameterCircularReferenceException.php | 34 - .../Exception/ParameterNotFoundException.php | 80 - .../Exception/RuntimeException.php | 21 - .../ScopeCrossingInjectionException.php | 65 - .../ScopeWideningInjectionException.php | 64 - .../ServiceCircularReferenceException.php | 41 - .../Exception/ServiceNotFoundException.php | 47 - .../ConfigurationExtensionInterface.php | 32 - .../Extension/ExtensionInterface.php | 65 - .../IntrospectableContainerInterface.php | 33 - .../Component/DependencyInjection/LICENSE | 19 - .../Loader/ClosureLoader.php | 61 - .../DependencyInjection/Loader/FileLoader.php | 39 - .../Loader/IniFileLoader.php | 62 - .../Loader/PhpFileLoader.php | 57 - .../Loader/XmlFileLoader.php | 499 -- .../Loader/YamlFileLoader.php | 331 -- .../schema/dic/services/services-1.0.xsd | 183 - .../DependencyInjection/Parameter.php | 44 - .../ParameterBag/FrozenParameterBag.php | 72 - .../ParameterBag/ParameterBag.php | 294 - .../ParameterBag/ParameterBagInterface.php | 115 - .../Component/DependencyInjection/README.md | 76 - .../DependencyInjection/Reference.php | 72 - .../Component/DependencyInjection/Scope.php | 50 - .../DependencyInjection/ScopeInterface.php | 32 - .../DependencyInjection/SimpleXMLElement.php | 127 - .../TaggedContainerInterface.php | 33 - .../AnalyzeServiceReferencesPassTest.php | 107 - .../CheckCircularReferencesPassTest.php | 85 - .../CheckDefinitionValidityPassTest.php | 69 - ...tionOnInvalidReferenceBehaviorPassTest.php | 71 - .../CheckReferenceValidityPassTest.php | 98 - .../InlineServiceDefinitionsPassTest.php | 134 - .../Tests/Compiler/IntegrationTest.php | 118 - .../RemoveUnusedDefinitionsPassTest.php | 89 - ...ReplaceAliasByActualDefinitionPassTest.php | 49 - .../ResolveDefinitionTemplatesPassTest.php | 151 - .../ResolveInvalidReferencesPassTest.php | 69 - .../ResolveReferencesToAliasesPassTest.php | 56 - .../Tests/ContainerBuilderTest.php | 553 -- .../Tests/ContainerTest.php | 450 -- .../Tests/CrossCheckTest.php | 97 - .../Tests/DefinitionDecoratorTest.php | 110 - .../Tests/DefinitionTest.php | 292 - .../Tests/Dumper/GraphvizDumperTest.php | 58 - .../Tests/Dumper/PhpDumperTest.php | 130 - .../Tests/Dumper/XmlDumperTest.php | 110 - .../Tests/Dumper/YamlDumperTest.php | 66 - .../Tests/Fixtures/containers/container10.php | 14 - .../Tests/Fixtures/containers/container11.php | 12 - .../Tests/Fixtures/containers/container12.php | 13 - .../Tests/Fixtures/containers/container8.php | 13 - .../Tests/Fixtures/containers/container9.php | 58 - .../Tests/Fixtures/containers/interfaces1.php | 25 - .../Tests/Fixtures/containers/interfaces2.php | 34 - .../Tests/Fixtures/graphviz/services1.dot | 7 - .../Tests/Fixtures/graphviz/services10-1.dot | 10 - .../Tests/Fixtures/graphviz/services10.dot | 10 - .../Tests/Fixtures/graphviz/services9.dot | 25 - .../Fixtures/includes/ProjectExtension.php | 41 - .../includes/ProjectWithXsdExtension.php | 19 - .../ProjectWithXsdExtensionInPhar.phar | Bin 1138 -> 0 bytes .../Tests/Fixtures/includes/classes.php | 42 - .../Tests/Fixtures/includes/createphar.php | 47 - .../Tests/Fixtures/includes/foo.php | 36 - .../Fixtures/includes/schema/project-1.0.xsd | 13 - .../Tests/Fixtures/ini/nonvalid.ini | 2 - .../Tests/Fixtures/ini/parameters.ini | 3 - .../Tests/Fixtures/ini/parameters1.ini | 3 - .../Tests/Fixtures/ini/parameters2.ini | 2 - .../Tests/Fixtures/php/services1-1.php | 28 - .../Tests/Fixtures/php/services1.php | 28 - .../Tests/Fixtures/php/services10.php | 104 - .../Tests/Fixtures/php/services8.php | 52 - .../Tests/Fixtures/php/services9.php | 160 - .../Tests/Fixtures/php/simple.php | 3 - .../Fixtures/xml/extension1/services.xml | 14 - .../Fixtures/xml/extension2/services.xml | 14 - .../Fixtures/xml/extensions/services1.xml | 19 - .../Fixtures/xml/extensions/services2.xml | 19 - .../Fixtures/xml/extensions/services3.xml | 19 - .../Fixtures/xml/extensions/services4.xml | 6 - .../Fixtures/xml/extensions/services5.xml | 11 - .../Fixtures/xml/extensions/services6.xml | 11 - .../Fixtures/xml/extensions/services7.xml | 11 - .../Tests/Fixtures/xml/nonvalid.xml | 3 - .../Tests/Fixtures/xml/services1.xml | 2 - .../Tests/Fixtures/xml/services13.xml | 9 - .../Tests/Fixtures/xml/services2.xml | 31 - .../Tests/Fixtures/xml/services3.xml | 13 - .../Tests/Fixtures/xml/services4.xml | 13 - .../Fixtures/xml/services4_bad_import.xml | 9 - .../Tests/Fixtures/xml/services5.xml | 21 - .../Tests/Fixtures/xml/services6.xml | 50 - .../Tests/Fixtures/xml/services7.xml | 9 - .../Tests/Fixtures/xml/services8.xml | 21 - .../Tests/Fixtures/xml/services9.xml | 56 - .../Tests/Fixtures/yaml/badtag1.yml | 5 - .../Tests/Fixtures/yaml/badtag2.yml | 6 - .../Tests/Fixtures/yaml/badtag3.yml | 6 - .../Tests/Fixtures/yaml/nonvalid1.yml | 2 - .../Tests/Fixtures/yaml/nonvalid2.yml | 1 - .../Tests/Fixtures/yaml/services1.yml | 1 - .../Tests/Fixtures/yaml/services10.yml | 9 - .../Tests/Fixtures/yaml/services11.yml | 1 - .../Tests/Fixtures/yaml/services13.yml | 3 - .../Tests/Fixtures/yaml/services2.yml | 11 - .../Tests/Fixtures/yaml/services3.yml | 5 - .../Tests/Fixtures/yaml/services4.yml | 6 - .../Fixtures/yaml/services4_bad_import.yml | 2 - .../Tests/Fixtures/yaml/services6.yml | 26 - .../Tests/Fixtures/yaml/services7.yml | 2 - .../Tests/Fixtures/yaml/services8.yml | 6 - .../Tests/Fixtures/yaml/services9.yml | 43 - .../Tests/Loader/ClosureLoaderTest.php | 50 - .../Tests/Loader/IniFileLoaderTest.php | 90 - .../Tests/Loader/PhpFileLoaderTest.php | 50 - .../Tests/Loader/XmlFileLoaderTest.php | 331 -- .../Tests/Loader/YamlFileLoaderTest.php | 211 - .../ParameterBag/FrozenParameterBagTest.php | 60 - .../Tests/ParameterBag/ParameterBagTest.php | 244 - .../Tests/ParameterTest.php | 26 - .../Tests/ReferenceTest.php | 32 - .../DependencyInjection/Tests/bootstrap.php | 22 - .../DependencyInjection/Variable.php | 50 - .../DependencyInjection/composer.json | 38 - .../DependencyInjection/phpunit.xml.dist | 30 - .../Symfony/Component/DomCrawler/.gitignore | 2 - .../Symfony/Component/DomCrawler/CHANGELOG.md | 12 - .../Symfony/Component/DomCrawler/Crawler.php | 721 --- .../DomCrawler/Field/ChoiceFormField.php | 307 - .../DomCrawler/Field/FileFormField.php | 96 - .../Component/DomCrawler/Field/FormField.php | 122 - .../DomCrawler/Field/InputFormField.php | 47 - .../DomCrawler/Field/TextareaFormField.php | 39 - .../src/Symfony/Component/DomCrawler/Form.php | 586 -- .../src/Symfony/Component/DomCrawler/LICENSE | 19 - .../src/Symfony/Component/DomCrawler/Link.php | 157 - .../Symfony/Component/DomCrawler/README.md | 35 - .../DomCrawler/Tests/CrawlerTest.php | 595 -- .../Tests/Field/ChoiceFormFieldTest.php | 329 - .../Tests/Field/FileFormFieldTest.php | 87 - .../DomCrawler/Tests/Field/FormFieldTest.php | 38 - .../Tests/Field/FormFieldTestCase.php | 27 - .../Tests/Field/InputFormFieldTest.php | 49 - .../Tests/Field/TextareaFormFieldTest.php | 33 - .../Component/DomCrawler/Tests/FormTest.php | 671 --- .../Component/DomCrawler/Tests/LinkTest.php | 104 - .../Component/DomCrawler/Tests/bootstrap.php | 22 - .../Component/DomCrawler/composer.json | 36 - .../Component/DomCrawler/phpunit.xml.dist | 30 - .../Component/EventDispatcher/.gitignore | 2 - .../Component/EventDispatcher/CHANGELOG.md | 16 - .../ContainerAwareEventDispatcher.php | 200 - .../TraceableEventDispatcherInterface.php | 32 - .../Component/EventDispatcher/Event.php | 121 - .../EventDispatcher/EventDispatcher.php | 185 - .../EventDispatcherInterface.php | 96 - .../EventSubscriberInterface.php | 50 - .../EventDispatcher/GenericEvent.php | 180 - .../ImmutableEventDispatcher.php | 92 - .../Symfony/Component/EventDispatcher/LICENSE | 19 - .../Component/EventDispatcher/README.md | 28 - .../ContainerAwareEventDispatcherTest.php | 257 - .../Tests/EventDispatcherTest.php | 297 - .../EventDispatcher/Tests/EventTest.php | 84 - .../Tests/GenericEventTest.php | 131 - .../Tests/ImmutableEventDispatcherTest.php | 106 - .../EventDispatcher/Tests/bootstrap.php | 22 - .../Component/EventDispatcher/composer.json | 37 - .../EventDispatcher/phpunit.xml.dist | 30 - .../Symfony/Component/Filesystem/CHANGELOG.md | 8 - .../Exception/ExceptionInterface.php | 24 - .../Filesystem/Exception/IOException.php | 24 - .../Component/Filesystem/Filesystem.php | 407 -- .../src/Symfony/Component/Filesystem/LICENSE | 19 - .../Symfony/Component/Filesystem/README.md | 43 - .../Filesystem/Tests/FilesystemTest.php | 880 --- .../Component/Filesystem/Tests/bootstrap.php | 18 - .../Component/Filesystem/composer.json | 30 - .../Component/Filesystem/phpunit.xml.dist | 28 - .../src/Symfony/Component/Finder/CHANGELOG.md | 16 - .../Finder/Comparator/Comparator.php | 94 - .../Finder/Comparator/DateComparator.php | 54 - .../Finder/Comparator/NumberComparator.php | 82 - .../src/Symfony/Component/Finder/Finder.php | 632 -- .../src/Symfony/Component/Finder/Glob.php | 103 - .../Finder/Iterator/CustomFilterIterator.php | 61 - .../Iterator/DateRangeFilterIterator.php | 58 - .../Iterator/DepthRangeFilterIterator.php | 67 - .../ExcludeDirectoryFilterIterator.php | 56 - .../Iterator/FileTypeFilterIterator.php | 55 - .../Iterator/FilecontentFilterIterator.php | 76 - .../Iterator/FilenameFilterIterator.php | 68 - .../Finder/Iterator/FilterIterator.php | 42 - .../Iterator/MultiplePcreFilterIterator.php | 79 - .../Iterator/RecursiveDirectoryIterator.php | 41 - .../Iterator/SizeRangeFilterIterator.php | 57 - .../Finder/Iterator/SortableIterator.php | 80 - .../src/Symfony/Component/Finder/LICENSE | 19 - .../src/Symfony/Component/Finder/README.md | 38 - .../Symfony/Component/Finder/SplFileInfo.php | 71 - .../Tests/Comparator/ComparatorTest.php | 64 - .../Tests/Comparator/DateComparatorTest.php | 64 - .../Tests/Comparator/NumberComparatorTest.php | 109 - .../Component/Finder/Tests/FinderTest.php | 462 -- .../Component/Finder/Tests/Fixtures/dolor.txt | 2 - .../Component/Finder/Tests/Fixtures/ipsum.txt | 2 - .../Component/Finder/Tests/Fixtures/lorem.txt | 2 - .../Component/Finder/Tests/GlobTest.php | 47 - .../Iterator/CustomFilterIteratorTest.php | 46 - .../Iterator/DateRangeFilterIteratorTest.php | 39 - .../Tests/Iterator/DepthRangeIteratorTest.php | 49 - .../ExcludeDirectoryFileIteratorTest.php | 58 - .../Iterator/FileTypeFilterIteratorTest.php | 55 - .../FilecontentFilterIteratorTest.php | 191 - .../Iterator/FilenameFilterIteratorTest.php | 55 - .../Tests/Iterator/FilterIteratorTest.php | 50 - .../Finder/Tests/Iterator/Iterator.php | 56 - .../Tests/Iterator/IteratorTestCase.php | 32 - .../MultiplePcreFilterIteratorTest.php | 67 - .../Tests/Iterator/RealIteratorTestCase.php | 64 - .../Iterator/SizeRangeFilterIteratorTest.php | 60 - .../Tests/Iterator/SortableIteratorTest.php | 48 - .../Component/Finder/Tests/bootstrap.php | 18 - .../Symfony/Component/Finder/composer.json | 30 - .../Symfony/Component/Finder/phpunit.xml.dist | 29 - .../src/Symfony/Component/Form/.gitignore | 2 - .../Component/Form/AbstractExtension.php | 195 - .../Component/Form/AbstractRendererEngine.php | 206 - .../Symfony/Component/Form/AbstractType.php | 123 - .../Component/Form/AbstractTypeExtension.php | 76 - .../src/Symfony/Component/Form/CHANGELOG.md | 179 - .../Component/Form/CallbackTransformer.php | 70 - .../Component/Form/CallbackValidator.php | 40 - .../Component/Form/DataMapperInterface.php | 38 - .../Form/DataTransformerInterface.php | 77 - .../Component/Form/Event/DataEvent.php | 69 - .../Component/Form/Event/FilterDataEvent.php | 22 - .../Form/Exception/AlreadyBoundException.php | 16 - .../Form/Exception/CreationException.php | 21 - .../Form/Exception/ErrorMappingException.php | 16 - .../Form/Exception/FormException.php | 16 - .../InvalidConfigurationException.php | 16 - .../Exception/InvalidPropertyException.php | 16 - .../InvalidPropertyPathException.php | 16 - .../Exception/NotInitializedException.php | 16 - .../Form/Exception/NotValidException.php | 16 - .../PropertyAccessDeniedException.php | 16 - .../Form/Exception/StringCastException.php | 16 - .../TransformationFailedException.php | 21 - .../Exception/TypeDefinitionException.php | 21 - .../Form/Exception/TypeLoaderException.php | 16 - .../Exception/UnexpectedTypeException.php | 20 - .../Extension/Core/ChoiceList/ChoiceList.php | 509 -- .../Core/ChoiceList/ChoiceListInterface.php | 135 - .../Core/ChoiceList/LazyChoiceList.php | 149 - .../Core/ChoiceList/ObjectChoiceList.php | 174 - .../Core/ChoiceList/SimpleChoiceList.php | 164 - .../Form/Extension/Core/CoreExtension.php | 55 - .../Core/DataMapper/PropertyPathMapper.php | 82 - .../ArrayToPartsTransformer.php | 87 - .../BaseDateTimeTransformer.php | 52 - .../BooleanToStringTransformer.php | 85 - .../ChoiceToBooleanArrayTransformer.php | 106 - .../ChoiceToValueTransformer.php | 63 - .../ChoicesToBooleanArrayTransformer.php | 115 - .../ChoicesToValuesTransformer.php | 82 - .../DataTransformer/DataTransformerChain.php | 87 - .../DateTimeToArrayTransformer.php | 182 - .../DateTimeToLocalizedStringTransformer.php | 165 - .../DateTimeToRfc3339Transformer.php | 80 - .../DateTimeToStringTransformer.php | 118 - .../DateTimeToTimestampTransformer.php | 89 - .../IntegerToLocalizedStringTransformer.php | 54 - .../MoneyToLocalizedStringTransformer.php | 90 - .../NumberToLocalizedStringTransformer.php | 142 - .../PercentToLocalizedStringTransformer.php | 147 - .../ValueToDuplicatesTransformer.php | 92 - .../FixCheckboxInputListener.php | 51 - .../EventListener/FixRadioInputListener.php | 51 - .../EventListener/FixUrlProtocolListener.php | 45 - .../EventListener/MergeCollectionListener.php | 126 - .../Core/EventListener/ResizeFormListener.php | 158 - .../Core/EventListener/TrimListener.php | 38 - .../Form/Extension/Core/Type/BirthdayType.php | 44 - .../Form/Extension/Core/Type/CheckboxType.php | 75 - .../Form/Extension/Core/Type/ChoiceType.php | 261 - .../Extension/Core/Type/CollectionType.php | 104 - .../Form/Extension/Core/Type/CountryType.php | 45 - .../Form/Extension/Core/Type/DateTimeType.php | 298 - .../Form/Extension/Core/Type/DateType.php | 314 - .../Form/Extension/Core/Type/EmailType.php | 33 - .../Form/Extension/Core/Type/FieldType.php | 32 - .../Form/Extension/Core/Type/FileType.php | 67 - .../Form/Extension/Core/Type/FormType.php | 243 - .../Form/Extension/Core/Type/HiddenType.php | 48 - .../Form/Extension/Core/Type/IntegerType.php | 76 - .../Form/Extension/Core/Type/LanguageType.php | 45 - .../Form/Extension/Core/Type/LocaleType.php | 45 - .../Form/Extension/Core/Type/MoneyType.php | 117 - .../Form/Extension/Core/Type/NumberType.php | 74 - .../Form/Extension/Core/Type/PasswordType.php | 56 - .../Form/Extension/Core/Type/PercentType.php | 63 - .../Form/Extension/Core/Type/RadioType.php | 33 - .../Form/Extension/Core/Type/RepeatedType.php | 64 - .../Form/Extension/Core/Type/SearchType.php | 33 - .../Form/Extension/Core/Type/TextType.php | 44 - .../Form/Extension/Core/Type/TextareaType.php | 43 - .../Form/Extension/Core/Type/TimeType.php | 223 - .../Form/Extension/Core/Type/TimezoneType.php | 86 - .../Form/Extension/Core/Type/UrlType.php | 54 - .../Form/Extension/Core/View/ChoiceView.php | 71 - .../Form/Extension/Csrf/CsrfExtension.php | 44 - .../CsrfProvider/CsrfProviderInterface.php | 49 - .../Csrf/CsrfProvider/DefaultCsrfProvider.php | 74 - .../Csrf/CsrfProvider/SessionCsrfProvider.php | 57 - .../EventListener/CsrfValidationListener.php | 76 - .../Csrf/Type/FormTypeCsrfExtension.php | 97 - .../DependencyInjectionExtension.php | 100 - .../EventListener/BindRequestListener.php | 85 - .../HttpFoundationExtension.php | 29 - .../Type/FormTypeHttpFoundationExtension.php | 50 - .../Templating/TemplatingRendererEngine.php | 125 - .../Extension/Validator/Constraints/Form.php | 33 - .../Validator/Constraints/FormValidator.php | 179 - .../EventListener/ValidationListener.php | 68 - .../Type/FormTypeValidatorExtension.php | 104 - .../Type/RepeatedTypeValidatorExtension.php | 45 - .../Extension/Validator/Util/ServerParams.php | 68 - .../Validator/ValidatorExtension.php | 45 - .../Validator/ValidatorTypeGuesser.php | 299 - .../Validator/ViolationMapper/MappingRule.php | 106 - .../ViolationMapper/RelativePath.php | 45 - .../ViolationMapper/ViolationMapper.php | 311 - .../ViolationMapperInterface.php | 33 - .../ViolationMapper/ViolationPath.php | 265 - .../ViolationMapper/ViolationPathIterator.php | 30 - .../src/Symfony/Component/Form/Form.php | 1121 ---- .../Symfony/Component/Form/FormBuilder.php | 305 - .../Component/Form/FormBuilderInterface.php | 116 - .../Component/Form/FormConfigBuilder.php | 876 --- .../Form/FormConfigBuilderInterface.php | 250 - .../Component/Form/FormConfigInterface.php | 220 - .../src/Symfony/Component/Form/FormError.php | 97 - .../src/Symfony/Component/Form/FormEvent.php | 21 - .../src/Symfony/Component/Form/FormEvents.php | 50 - .../Component/Form/FormExtensionInterface.php | 63 - .../Symfony/Component/Form/FormFactory.php | 199 - .../Component/Form/FormFactoryInterface.php | 115 - .../Symfony/Component/Form/FormInterface.php | 246 - .../Symfony/Component/Form/FormRegistry.php | 167 - .../Component/Form/FormRegistryInterface.php | 68 - .../Symfony/Component/Form/FormRenderer.php | 286 - .../Form/FormRendererEngineInterface.php | 150 - .../Component/Form/FormRendererInterface.php | 105 - .../Form/FormTypeExtensionInterface.php | 75 - .../Component/Form/FormTypeGuesserChain.php | 114 - .../Form/FormTypeGuesserInterface.php | 76 - .../Component/Form/FormTypeInterface.php | 91 - .../Component/Form/FormValidatorInterface.php | 28 - .../src/Symfony/Component/Form/FormView.php | 362 -- .../Symfony/Component/Form/Guess/Guess.php | 113 - .../Component/Form/Guess/TypeGuess.php | 70 - .../Component/Form/Guess/ValueGuess.php | 50 - .../src/Symfony/Component/Form/LICENSE | 19 - .../src/Symfony/Component/Form/README.md | 29 - .../Component/Form/ResolvedFormType.php | 253 - .../Form/ResolvedFormTypeFactory.php | 26 - .../Form/ResolvedFormTypeFactoryInterface.php | 38 - .../Form/ResolvedFormTypeInterface.php | 107 - .../Form/Resources/config/validation.xml | 13 - .../Resources/translations/validators.ca.xlf | 19 - .../Resources/translations/validators.cs.xlf | 19 - .../Resources/translations/validators.da.xlf | 19 - .../Resources/translations/validators.de.xlf | 19 - .../Resources/translations/validators.en.xlf | 19 - .../Resources/translations/validators.es.xlf | 19 - .../Resources/translations/validators.et.xlf | 19 - .../Resources/translations/validators.eu.xlf | 19 - .../Resources/translations/validators.fa.xlf | 19 - .../Resources/translations/validators.fi.xlf | 19 - .../Resources/translations/validators.fr.xlf | 19 - .../Resources/translations/validators.he.xlf | 19 - .../Resources/translations/validators.hr.xlf | 19 - .../Resources/translations/validators.hu.xlf | 19 - .../Resources/translations/validators.hy.xlf | 19 - .../Resources/translations/validators.id.xlf | 19 - .../Resources/translations/validators.it.xlf | 19 - .../Resources/translations/validators.ja.xlf | 19 - .../Resources/translations/validators.lb.xlf | 19 - .../Resources/translations/validators.lt.xlf | 19 - .../Resources/translations/validators.mn.xlf | 19 - .../Resources/translations/validators.nb.xlf | 19 - .../Resources/translations/validators.nl.xlf | 19 - .../Resources/translations/validators.pl.xlf | 19 - .../Resources/translations/validators.pt.xlf | 19 - .../translations/validators.pt_BR.xlf | 19 - .../Resources/translations/validators.ro.xlf | 19 - .../Resources/translations/validators.ru.xlf | 19 - .../Resources/translations/validators.sk.xlf | 19 - .../Resources/translations/validators.sl.xlf | 19 - .../translations/validators.sr_Cyrl.xlf | 19 - .../translations/validators.sr_Latn.xlf | 19 - .../Resources/translations/validators.sv.xlf | 19 - .../Resources/translations/validators.ua.xlf | 19 - .../translations/validators.zh_CN.xlf | 19 - .../Component/Form/ReversedTransformer.php | 55 - .../Form/Tests/AbstractDivLayoutTest.php | 612 -- .../Form/Tests/AbstractExtensionTest.php | 43 - .../Component/Form/Tests/AbstractFormTest.php | 143 - .../Form/Tests/AbstractLayoutTest.php | 1763 ------ .../Form/Tests/AbstractTableLayoutTest.php | 365 -- .../Tests/CompoundFormPerformanceTest.php | 48 - .../Component/Form/Tests/CompoundFormTest.php | 583 -- .../Core/ChoiceList/ChoiceListTest.php | 187 - .../Core/ChoiceList/LazyChoiceListTest.php | 116 - .../Core/ChoiceList/ObjectChoiceListTest.php | 209 - .../Core/ChoiceList/SimpleChoiceListTest.php | 188 - .../DataMapper/PropertyPathMapperTest.php | 376 -- .../ArrayToPartsTransformerTest.php | 149 - .../BooleanToStringTransformerTest.php | 60 - .../ChoiceToValueTransformerTest.php | 76 - .../ChoicesToValuesTransformerTest.php | 76 - .../DataTransformerChainTest.php | 53 - .../Core/DataTransformer/DateTimeTestCase.php | 20 - .../DateTimeToArrayTransformerTest.php | 512 -- ...teTimeToLocalizedStringTransformerTest.php | 297 - .../DateTimeToRfc3339TransformerTest.php | 122 - .../DateTimeToStringTransformerTest.php | 150 - .../DateTimeToTimestampTransformerTest.php | 104 - ...ntegerToLocalizedStringTransformerTest.php | 111 - .../DataTransformer/LocalizedTestCase.php | 70 - .../MoneyToLocalizedStringTransformerTest.php | 70 - ...NumberToLocalizedStringTransformerTest.php | 175 - ...ercentToLocalizedStringTransformerTest.php | 110 - .../ValueToDuplicatesTransformerTest.php | 120 - .../FixRadioInputListenerTest.php | 73 - .../FixUrlProtocolListenerTest.php | 61 - .../Core/EventListener/Fixtures/randomhash | Bin 35 -> 0 bytes ...MergeCollectionListenerArrayObjectTest.php | 27 - .../MergeCollectionListenerArrayTest.php | 27 - ...ollectionListenerCustomArrayObjectTest.php | 28 - .../MergeCollectionListenerTest.php | 259 - .../EventListener/ResizeFormListenerTest.php | 255 - .../Core/EventListener/TrimListenerTest.php | 49 - .../Extension/Core/Type/CheckboxTypeTest.php | 140 - .../Core/Type/ChoiceTypePerformanceTest.php | 38 - .../Extension/Core/Type/ChoiceTypeTest.php | 748 --- .../Core/Type/CollectionTypeTest.php | 200 - .../Extension/Core/Type/CountryTypeTest.php | 46 - .../Extension/Core/Type/DateTimeTypeTest.php | 389 -- .../Extension/Core/Type/DateTypeTest.php | 743 --- .../Extension/Core/Type/FileTypeTest.php | 54 - .../Extension/Core/Type/FormTypeTest.php | 662 --- .../Extension/Core/Type/IntegerTypeTest.php | 25 - .../Extension/Core/Type/LanguageTypeTest.php | 41 - .../Extension/Core/Type/LocaleTypeTest.php | 30 - .../Extension/Core/Type/LocalizedTestCase.php | 28 - .../Extension/Core/Type/MoneyTypeTest.php | 34 - .../Extension/Core/Type/NumberTypeTest.php | 58 - .../Extension/Core/Type/PasswordTypeTest.php | 42 - .../Extension/Core/Type/RepeatedTypeTest.php | 114 - .../Extension/Core/Type/TimeTypeTest.php | 564 -- .../Extension/Core/Type/TimezoneTypeTest.php | 30 - .../Extension/Core/Type/TypeTestCase.php | 42 - .../Tests/Extension/Core/Type/UrlTypeTest.php | 61 - .../CsrfProvider/DefaultCsrfProviderTest.php | 58 - .../CsrfProvider/SessionCsrfProviderTest.php | 75 - .../Csrf/Type/FormTypeCsrfExtensionTest.php | 258 - .../EventListener/BindRequestListenerTest.php | 285 - .../Constraints/FormValidatorTest.php | 537 -- .../EventListener/ValidationListenerTest.php | 149 - .../Type/FormTypeValidatorExtensionTest.php | 76 - .../Extension/Validator/Type/TypeTestCase.php | 49 - .../ViolationMapper/ViolationMapperTest.php | 1464 ----- .../ViolationMapper/ViolationPathTest.php | 245 - .../Tests/Fixtures/AlternatingRowType.php | 27 - .../Component/Form/Tests/Fixtures/Author.php | 71 - .../Form/Tests/Fixtures/AuthorType.php | 30 - .../Form/Tests/Fixtures/CustomArrayObject.php | 70 - .../Tests/Fixtures/FixedDataTransformer.php | 44 - .../Tests/Fixtures/FixedFilterListener.php | 66 - .../Form/Tests/Fixtures/FooSubType.php | 32 - .../Component/Form/Tests/Fixtures/FooType.php | 32 - .../Tests/Fixtures/FooTypeBarExtension.php | 35 - .../Tests/Fixtures/FooTypeBazExtension.php | 28 - .../Form/Tests/Fixtures/Magician.php | 27 - .../Form/Tests/Fixtures/TestExtension.php | 72 - .../Symfony/Component/Form/Tests/Fixtures/foo | 0 .../Form/Tests/FormBuilderInterface.php | 16 - .../Component/Form/Tests/FormBuilderTest.php | 247 - .../Component/Form/Tests/FormConfigTest.php | 78 - .../Component/Form/Tests/FormFactoryTest.php | 572 -- .../Form/Tests/FormIntegrationTestCase.php | 56 - .../Component/Form/Tests/FormInterface.php | 16 - .../Form/Tests/FormPerformanceTestCase.php | 70 - .../Component/Form/Tests/FormRegistryTest.php | 233 - .../Component/Form/Tests/Guess/GuessTest.php | 36 - .../Form/Tests/ResolvedFormTypeTest.php | 284 - .../Component/Form/Tests/SimpleFormTest.php | 778 --- .../Form/Tests/Util/FormUtilTest.php | 134 - .../Util/PropertyPathArrayObjectTest.php | 20 - .../Form/Tests/Util/PropertyPathArrayTest.php | 20 - .../Tests/Util/PropertyPathBuilderTest.php | 238 - .../Tests/Util/PropertyPathCollectionTest.php | 334 -- .../PropertyPathCustomArrayObjectTest.php | 22 - .../Form/Tests/Util/PropertyPathTest.php | 557 -- .../Component/Form/Tests/bootstrap.php | 22 - .../Symfony/Component/Form/Util/FormUtil.php | 212 - .../Component/Form/Util/PropertyPath.php | 644 -- .../Form/Util/PropertyPathBuilder.php | 280 - .../Form/Util/PropertyPathInterface.php | 92 - .../Form/Util/PropertyPathIterator.php | 55 - .../Util/PropertyPathIteratorInterface.php | 34 - .../Form/Util/VirtualFormAwareIterator.php | 33 - .../src/Symfony/Component/Form/composer.json | 41 - .../Symfony/Component/Form/phpunit.xml.dist | 29 - .../HttpFoundation/ApacheRequest.php | 51 - .../Component/HttpFoundation/CHANGELOG.md | 75 - .../Component/HttpFoundation/Cookie.php | 208 - .../File/Exception/AccessDeniedException.php | 30 - .../File/Exception/FileException.php | 21 - .../File/Exception/FileNotFoundException.php | 30 - .../Exception/UnexpectedTypeException.php | 20 - .../File/Exception/UploadException.php | 21 - .../Component/HttpFoundation/File/File.php | 129 - .../File/MimeType/ExtensionGuesser.php | 102 - .../MimeType/ExtensionGuesserInterface.php | 26 - .../MimeType/FileBinaryMimeTypeGuesser.php | 87 - .../File/MimeType/FileinfoMimeTypeGuesser.php | 57 - .../MimeType/MimeTypeExtensionGuesser.php | 740 --- .../File/MimeType/MimeTypeGuesser.php | 124 - .../MimeType/MimeTypeGuesserInterface.php | 35 - .../HttpFoundation/File/UploadedFile.php | 223 - .../Component/HttpFoundation/FileBag.php | 155 - .../Component/HttpFoundation/HeaderBag.php | 323 - .../Component/HttpFoundation/JsonResponse.php | 109 - .../Symfony/Component/HttpFoundation/LICENSE | 19 - .../Component/HttpFoundation/ParameterBag.php | 303 - .../Component/HttpFoundation/README.md | 46 - .../HttpFoundation/RedirectResponse.php | 102 - .../Component/HttpFoundation/Request.php | 1514 ----- .../HttpFoundation/RequestMatcher.php | 230 - .../RequestMatcherInterface.php | 33 - .../stubs/SessionHandlerInterface.php | 98 - .../Component/HttpFoundation/Response.php | 1148 ---- .../HttpFoundation/ResponseHeaderBag.php | 293 - .../Component/HttpFoundation/ServerBag.php | 82 - .../Session/Attribute/AttributeBag.php | 157 - .../Attribute/AttributeBagInterface.php | 72 - .../Attribute/NamespacedAttributeBag.php | 154 - .../Session/Flash/AutoExpireFlashBag.php | 176 - .../HttpFoundation/Session/Flash/FlashBag.php | 186 - .../Session/Flash/FlashBagInterface.php | 93 - .../HttpFoundation/Session/Session.php | 347 -- .../Session/SessionBagInterface.php | 48 - .../Session/SessionInterface.php | 208 - .../Handler/MemcacheSessionHandler.php | 109 - .../Handler/MemcachedSessionHandler.php | 115 - .../Storage/Handler/MongoDbSessionHandler.php | 145 - .../Handler/NativeFileSessionHandler.php | 58 - .../Storage/Handler/NativeSessionHandler.php | 24 - .../Storage/Handler/NullSessionHandler.php | 72 - .../Storage/Handler/PdoSessionHandler.php | 231 - .../Session/Storage/MetadataBag.php | 160 - .../Storage/MockArraySessionStorage.php | 265 - .../Storage/MockFileSessionStorage.php | 139 - .../Session/Storage/NativeSessionStorage.php | 400 -- .../Session/Storage/Proxy/AbstractProxy.php | 135 - .../Session/Storage/Proxy/NativeProxy.php | 41 - .../Storage/Proxy/SessionHandlerProxy.php | 95 - .../Storage/SessionStorageInterface.php | 143 - .../HttpFoundation/StreamedResponse.php | 129 - .../Tests/ApacheRequestTest.php | 92 - .../HttpFoundation/Tests/CookieTest.php | 127 - .../HttpFoundation/Tests/File/FileTest.php | 134 - .../Tests/File/Fixtures/.unknownextension | 1 - .../Tests/File/Fixtures/directory/.empty | 0 .../HttpFoundation/Tests/File/Fixtures/test | Bin 35 -> 0 bytes .../Tests/File/Fixtures/test.gif | Bin 35 -> 0 bytes .../Tests/File/MimeType/MimeTypeTest.php | 105 - .../Tests/File/UploadedFileTest.php | 219 - .../HttpFoundation/Tests/FileBagTest.php | 148 - .../HttpFoundation/Tests/HeaderBagTest.php | 158 - .../HttpFoundation/Tests/JsonResponseTest.php | 114 - .../HttpFoundation/Tests/ParameterBagTest.php | 232 - .../Tests/RedirectResponseTest.php | 58 - .../Tests/RequestMatcherTest.php | 181 - .../HttpFoundation/Tests/RequestTest.php | 1162 ---- .../Tests/ResponseHeaderBagTest.php | 176 - .../HttpFoundation/Tests/ResponseTest.php | 583 -- .../HttpFoundation/Tests/ServerBagTest.php | 101 - .../Session/Attribute/AttributeBagTest.php | 193 - .../Attribute/NamespacedAttributeBagTest.php | 171 - .../Session/Flash/AutoExpireFlashBagTest.php | 155 - .../Tests/Session/Flash/FlashBagTest.php | 168 - .../Tests/Session/SessionTest.php | 276 - .../Handler/MemcacheSessionHandlerTest.php | 124 - .../Handler/MemcachedSessionHandlerTest.php | 119 - .../Handler/MongoDbSessionHandlerTest.php | 99 - .../Handler/NativeFileSessionHandlerTest.php | 80 - .../Handler/NativeSessionHandlerTest.php | 39 - .../Handler/NullSessionHandlerTest.php | 57 - .../Storage/Handler/PdoSessionHandlerTest.php | 63 - .../Tests/Session/Storage/MetadataBagTest.php | 99 - .../Storage/MockArraySessionStorageTest.php | 98 - .../Storage/MockFileSessionStorageTest.php | 117 - .../Storage/NativeSessionStorageTest.php | 155 - .../Storage/Proxy/AbstractProxyTest.php | 141 - .../Session/Storage/Proxy/NativeProxyTest.php | 35 - .../Storage/Proxy/SessionHandlerProxyTest.php | 122 - .../Tests/StreamedResponseTest.php | 105 - .../HttpFoundation/Tests/bootstrap.php | 22 - .../Component/HttpFoundation/composer.json | 33 - .../Component/HttpFoundation/phpunit.xml.dist | 30 - .../Symfony/Component/HttpKernel/.gitignore | 2 - .../Component/HttpKernel/Bundle/Bundle.php | 194 - .../HttpKernel/Bundle/BundleInterface.php | 102 - .../Symfony/Component/HttpKernel/CHANGELOG.md | 21 - .../CacheClearer/CacheClearerInterface.php | 27 - .../CacheClearer/ChainCacheClearer.php | 55 - .../HttpKernel/CacheWarmer/CacheWarmer.php | 32 - .../CacheWarmer/CacheWarmerAggregate.php | 73 - .../CacheWarmer/CacheWarmerInterface.php | 32 - .../CacheWarmer/WarmableInterface.php | 27 - .../Symfony/Component/HttpKernel/Client.php | 184 - .../HttpKernel/Config/FileLocator.php | 54 - .../Controller/ControllerResolver.php | 160 - .../ControllerResolverInterface.php | 63 - .../DataCollector/ConfigDataCollector.php | 187 - .../DataCollector/DataCollector.php | 34 - .../DataCollector/DataCollectorInterface.php | 45 - .../DataCollector/EventDataCollector.php | 77 - .../DataCollector/ExceptionDataCollector.php | 105 - .../DataCollector/LoggerDataCollector.php | 106 - .../DataCollector/MemoryDataCollector.php | 51 - .../DataCollector/RequestDataCollector.php | 286 - .../DataCollector/RouterDataCollector.php | 101 - .../DataCollector/TimeDataCollector.php | 109 - ...ContainerAwareTraceableEventDispatcher.php | 318 - .../HttpKernel/Debug/ErrorHandler.php | 72 - .../HttpKernel/Debug/ExceptionHandler.php | 263 - .../Component/HttpKernel/Debug/Stopwatch.php | 251 - .../HttpKernel/Debug/StopwatchEvent.php | 182 - .../AddClassesToCachePass.php | 47 - .../ConfigurableExtension.php | 45 - .../DependencyInjection/Extension.php | 125 - .../MergeExtensionConfigurationPass.php | 41 - .../Event/FilterControllerEvent.php | 107 - .../HttpKernel/Event/FilterResponseEvent.php | 67 - .../HttpKernel/Event/GetResponseEvent.php | 72 - .../GetResponseForControllerResultEvent.php | 54 - .../Event/GetResponseForExceptionEvent.php | 72 - .../HttpKernel/Event/KernelEvent.php | 89 - .../HttpKernel/Event/PostResponseEvent.php | 72 - .../HttpKernel/EventListener/EsiListener.php | 60 - .../EventListener/ExceptionListener.php | 107 - .../EventListener/LocaleListener.php | 57 - .../EventListener/ProfilerListener.php | 164 - .../EventListener/ResponseListener.php | 59 - .../EventListener/RouterListener.php | 116 - .../StreamedResponseListener.php | 52 - .../Exception/AccessDeniedHttpException.php | 33 - .../HttpKernel/Exception/FlattenException.php | 231 - .../HttpKernel/Exception/HttpException.php | 41 - .../Exception/HttpExceptionInterface.php | 34 - .../MethodNotAllowedHttpException.php | 35 - .../Exception/NotFoundHttpException.php | 32 - .../Component/HttpKernel/HttpCache/Esi.php | 234 - .../HttpCache/EsiResponseCacheStrategy.php | 74 - .../EsiResponseCacheStrategyInterface.php | 41 - .../HttpKernel/HttpCache/HttpCache.php | 660 --- .../Component/HttpKernel/HttpCache/Store.php | 403 -- .../HttpKernel/HttpCache/StoreInterface.php | 85 - .../Component/HttpKernel/HttpKernel.php | 248 - .../HttpKernel/HttpKernelInterface.php | 47 - .../Symfony/Component/HttpKernel/Kernel.php | 787 --- .../Component/HttpKernel/KernelEvents.php | 105 - .../Component/HttpKernel/KernelInterface.php | 208 - .../src/Symfony/Component/HttpKernel/LICENSE | 19 - .../HttpKernel/Log/DebugLoggerInterface.php | 38 - .../HttpKernel/Log/LoggerInterface.php | 62 - .../Component/HttpKernel/Log/NullLogger.php | 80 - .../Profiler/BaseMemcacheProfilerStorage.php | 298 - .../Profiler/FileProfilerStorage.php | 269 - .../Profiler/MemcacheProfilerStorage.php | 110 - .../Profiler/MemcachedProfilerStorage.php | 105 - .../Profiler/MongoDbProfilerStorage.php | 227 - .../Profiler/MysqlProfilerStorage.php | 69 - .../Profiler/PdoProfilerStorage.php | 254 - .../Component/HttpKernel/Profiler/Profile.php | 219 - .../HttpKernel/Profiler/Profiler.php | 248 - .../Profiler/ProfilerStorageInterface.php | 57 - .../Profiler/RedisProfilerStorage.php | 381 -- .../Profiler/SqliteProfilerStorage.php | 129 - .../Symfony/Component/HttpKernel/README.md | 92 - .../HttpKernel/TerminableInterface.php | 39 - .../HttpKernel/Tests/Bundle/BundleTest.php | 48 - .../CacheClearer/ChainCacheClearerTest.php | 58 - .../CacheWarmer/CacheWarmerAggregateTest.php | 102 - .../Tests/CacheWarmer/CacheWarmerTest.php | 67 - .../Component/HttpKernel/Tests/ClientTest.php | 159 - .../Controller/ControllerResolverTest.php | 176 - .../DataCollector/ConfigDataCollectorTest.php | 87 - .../DataCollector/EventDataCollectorTest.php | 45 - .../ExceptionDataCollectorTest.php | 47 - .../DataCollector/LoggerDataCollectorTest.php | 64 - .../DataCollector/MemoryDataCollectorTest.php | 37 - .../RequestDataCollectorTest.php | 73 - ...ainerAwareTraceableEventDispatcherTest.php | 80 - .../Tests/Debug/ErrorHandlerTest.php | 61 - .../Tests/Debug/ExceptionHandlerTest.php | 69 - .../Tests/Debug/StopwatchEventTest.php | 152 - .../HttpKernel/Tests/Debug/StopwatchTest.php | 120 - .../MergeExtensionConfigurationPassTest.php | 65 - .../Tests/EventListener/EsiListenerTest.php | 73 - .../EventListener/ExceptionListenerTest.php | 139 - .../EventListener/LocaleListenerTest.php | 75 - .../EventListener/ResponseListenerTest.php | 99 - .../EventListener/RouterListenerTest.php | 134 - .../Tests/Exception/FlattenExceptionTest.php | 128 - .../Fixtures/BaseBundle/Resources/foo.txt | 0 .../Fixtures/BaseBundle/Resources/hide.txt | 0 .../Fixtures/Bundle1Bundle/Resources/foo.txt | 0 .../Tests/Fixtures/Bundle1Bundle/bar.txt | 0 .../Tests/Fixtures/Bundle1Bundle/foo.txt | 0 .../Tests/Fixtures/Bundle2Bundle/foo.txt | 0 .../Fixtures/ChildBundle/Resources/foo.txt | 0 .../Fixtures/ChildBundle/Resources/hide.txt | 0 .../ExtensionAbsentBundle.php | 18 - .../ExtensionLoadedExtension.php | 22 - .../ExtensionLoadedBundle.php | 18 - .../Command/FooCommand.php | 23 - .../ExtensionPresentExtension.php | 22 - .../ExtensionPresentBundle.php | 18 - .../Tests/Fixtures/FooBarBundle.php | 19 - .../Tests/Fixtures/KernelForOverrideName.php | 30 - .../Tests/Fixtures/KernelForTest.php | 54 - .../Fixtures/Resources/BaseBundle/hide.txt | 0 .../Fixtures/Resources/Bundle1Bundle/foo.txt | 0 .../Fixtures/Resources/ChildBundle/foo.txt | 0 .../Fixtures/Resources/FooBundle/foo.txt | 0 .../HttpKernel/Tests/Fixtures/TestClient.php | 26 - .../Tests/Fixtures/TestEventDispatcher.php | 28 - .../HttpKernel/Tests/HttpCache/EsiTest.php | 227 - .../Tests/HttpCache/HttpCacheTest.php | 1037 ---- .../Tests/HttpCache/HttpCacheTestCase.php | 179 - .../HttpKernel/Tests/HttpCache/StoreTest.php | 232 - .../Tests/HttpCache/TestHttpKernel.php | 86 - .../HttpCache/TestMultipleHttpKernel.php | 78 - .../HttpKernel/Tests/HttpKernelTest.php | 270 - .../Component/HttpKernel/Tests/KernelTest.php | 792 --- .../Component/HttpKernel/Tests/Logger.php | 88 - .../Profiler/AbstractProfilerStorageTest.php | 232 - .../Profiler/FileProfilerStorageTest.php | 85 - .../Profiler/MemcacheProfilerStorageTest.php | 49 - .../Profiler/MemcachedProfilerStorageTest.php | 49 - .../Tests/Profiler/Mock/MemcacheMock.php | 260 - .../Tests/Profiler/Mock/MemcachedMock.php | 225 - .../Tests/Profiler/Mock/RedisMock.php | 241 - .../Profiler/MongoDbProfilerStorageTest.php | 81 - .../Tests/Profiler/ProfilerTest.php | 56 - .../Profiler/RedisProfilerStorageTest.php | 49 - .../Profiler/SqliteProfilerStorageTest.php | 50 - .../HttpKernel/Tests/TestHttpKernel.php | 41 - .../Component/HttpKernel/Tests/bootstrap.php | 22 - .../Component/HttpKernel/composer.json | 50 - .../Component/HttpKernel/phpunit.xml.dist | 29 - .../src/Symfony/Component/Locale/CHANGELOG.md | 7 - .../MethodArgumentNotImplementedException.php | 32 - ...odArgumentValueNotImplementedException.php | 41 - .../MethodNotImplementedException.php | 28 - .../Exception/NotImplementedException.php | 32 - .../src/Symfony/Component/Locale/LICENSE | 19 - .../src/Symfony/Component/Locale/Locale.php | 258 - .../src/Symfony/Component/Locale/README.md | 22 - .../Locale/Resources/data/UPDATE.txt | 30 - .../Locale/Resources/data/lang/af.res | Bin 2944 -> 0 bytes .../Locale/Resources/data/lang/ak.res | Bin 1688 -> 0 bytes .../Locale/Resources/data/lang/am.res | Bin 3756 -> 0 bytes .../Locale/Resources/data/lang/ar.res | Bin 25924 -> 0 bytes .../Locale/Resources/data/lang/as.res | Bin 1500 -> 0 bytes .../Locale/Resources/data/lang/asa.res | Bin 1600 -> 0 bytes .../Locale/Resources/data/lang/az.res | Bin 24356 -> 0 bytes .../Locale/Resources/data/lang/az_AZ.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/az_Cyrl.res | Bin 432 -> 0 bytes .../Locale/Resources/data/lang/az_Latn.res | Bin 100 -> 0 bytes .../Locale/Resources/data/lang/az_Latn_AZ.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/be.res | Bin 6984 -> 0 bytes .../Locale/Resources/data/lang/bem.res | Bin 1888 -> 0 bytes .../Locale/Resources/data/lang/bez.res | Bin 1576 -> 0 bytes .../Locale/Resources/data/lang/bg.res | Bin 25128 -> 0 bytes .../Locale/Resources/data/lang/bm.res | Bin 1660 -> 0 bytes .../Locale/Resources/data/lang/bn.res | Bin 23632 -> 0 bytes .../Locale/Resources/data/lang/bn_IN.res | Bin 1032 -> 0 bytes .../Locale/Resources/data/lang/bo.res | Bin 400 -> 0 bytes .../Locale/Resources/data/lang/bs.res | Bin 23688 -> 0 bytes .../Locale/Resources/data/lang/ca.res | Bin 25304 -> 0 bytes .../Locale/Resources/data/lang/cgg.res | Bin 1700 -> 0 bytes .../Locale/Resources/data/lang/chr.res | Bin 892 -> 0 bytes .../Locale/Resources/data/lang/cs.res | Bin 11008 -> 0 bytes .../Locale/Resources/data/lang/cy.res | Bin 2928 -> 0 bytes .../Locale/Resources/data/lang/da.res | Bin 24976 -> 0 bytes .../Locale/Resources/data/lang/dav.res | Bin 1580 -> 0 bytes .../Locale/Resources/data/lang/de.res | Bin 28096 -> 0 bytes .../Locale/Resources/data/lang/de_CH.res | Bin 164 -> 0 bytes .../Locale/Resources/data/lang/ebu.res | Bin 1580 -> 0 bytes .../Locale/Resources/data/lang/ee.res | Bin 1696 -> 0 bytes .../Locale/Resources/data/lang/el.res | Bin 27120 -> 0 bytes .../Locale/Resources/data/lang/en.res | Bin 30020 -> 0 bytes .../Locale/Resources/data/lang/en_RH.res | Bin 92 -> 0 bytes .../Locale/Resources/data/lang/en_ZW.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/eo.res | Bin 4292 -> 0 bytes .../Locale/Resources/data/lang/es.res | Bin 24196 -> 0 bytes .../Locale/Resources/data/lang/es_AR.res | Bin 180 -> 0 bytes .../Locale/Resources/data/lang/es_CL.res | Bin 264 -> 0 bytes .../Locale/Resources/data/lang/et.res | Bin 23360 -> 0 bytes .../Locale/Resources/data/lang/eu.res | Bin 6368 -> 0 bytes .../Locale/Resources/data/lang/fa.res | Bin 21604 -> 0 bytes .../Locale/Resources/data/lang/fa_AF.res | Bin 704 -> 0 bytes .../Locale/Resources/data/lang/ff.res | Bin 1584 -> 0 bytes .../Locale/Resources/data/lang/fi.res | Bin 28012 -> 0 bytes .../Locale/Resources/data/lang/fil.res | Bin 3264 -> 0 bytes .../Locale/Resources/data/lang/fil_PH.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/fo.res | Bin 156 -> 0 bytes .../Locale/Resources/data/lang/fr.res | Bin 26084 -> 0 bytes .../Locale/Resources/data/lang/ga.res | Bin 5120 -> 0 bytes .../Locale/Resources/data/lang/gl.res | Bin 7104 -> 0 bytes .../Locale/Resources/data/lang/gsw.res | Bin 28388 -> 0 bytes .../Locale/Resources/data/lang/gu.res | Bin 21712 -> 0 bytes .../Locale/Resources/data/lang/guz.res | Bin 1584 -> 0 bytes .../Locale/Resources/data/lang/gv.res | Bin 148 -> 0 bytes .../Locale/Resources/data/lang/ha.res | Bin 1720 -> 0 bytes .../Locale/Resources/data/lang/ha_GH.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/ha_Latn.res | Bin 100 -> 0 bytes .../Locale/Resources/data/lang/ha_Latn_GH.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/ha_Latn_NE.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/ha_Latn_NG.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/ha_NE.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/ha_NG.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/haw.res | Bin 1484 -> 0 bytes .../Locale/Resources/data/lang/he.res | Bin 11588 -> 0 bytes .../Locale/Resources/data/lang/he_IL.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/hi.res | Bin 23084 -> 0 bytes .../Locale/Resources/data/lang/hr.res | Bin 26960 -> 0 bytes .../Locale/Resources/data/lang/hu.res | Bin 24372 -> 0 bytes .../Locale/Resources/data/lang/hy.res | Bin 152 -> 0 bytes .../Locale/Resources/data/lang/id.res | Bin 8268 -> 0 bytes .../Locale/Resources/data/lang/id_ID.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/ig.res | Bin 1412 -> 0 bytes .../Locale/Resources/data/lang/ii.res | Bin 932 -> 0 bytes .../Locale/Resources/data/lang/in.res | Bin 128 -> 0 bytes .../Locale/Resources/data/lang/in_ID.res | Bin 92 -> 0 bytes .../Locale/Resources/data/lang/is.res | Bin 19368 -> 0 bytes .../Locale/Resources/data/lang/it.res | Bin 23716 -> 0 bytes .../Locale/Resources/data/lang/iw.res | Bin 128 -> 0 bytes .../Locale/Resources/data/lang/iw_IL.res | Bin 92 -> 0 bytes .../Locale/Resources/data/lang/ja.res | Bin 19196 -> 0 bytes .../Locale/Resources/data/lang/ja_JP.res | Bin 80 -> 0 bytes .../Resources/data/lang/ja_JP_TRADITIONAL.res | Bin 120 -> 0 bytes .../Locale/Resources/data/lang/jmc.res | Bin 1684 -> 0 bytes .../Locale/Resources/data/lang/ka.res | Bin 8716 -> 0 bytes .../Locale/Resources/data/lang/kab.res | Bin 1652 -> 0 bytes .../Locale/Resources/data/lang/kam.res | Bin 1580 -> 0 bytes .../Locale/Resources/data/lang/kde.res | Bin 1688 -> 0 bytes .../Locale/Resources/data/lang/kea.res | Bin 1420 -> 0 bytes .../Locale/Resources/data/lang/khq.res | Bin 1992 -> 0 bytes .../Locale/Resources/data/lang/ki.res | Bin 1576 -> 0 bytes .../Locale/Resources/data/lang/kk.res | Bin 148 -> 0 bytes .../Locale/Resources/data/lang/kk_Cyrl.res | Bin 100 -> 0 bytes .../Locale/Resources/data/lang/kk_Cyrl_KZ.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/kk_KZ.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/kl.res | Bin 160 -> 0 bytes .../Locale/Resources/data/lang/kln.res | Bin 2156 -> 0 bytes .../Locale/Resources/data/lang/km.res | Bin 4040 -> 0 bytes .../Locale/Resources/data/lang/kn.res | Bin 22544 -> 0 bytes .../Locale/Resources/data/lang/ko.res | Bin 18288 -> 0 bytes .../Locale/Resources/data/lang/kok.res | Bin 4448 -> 0 bytes .../Locale/Resources/data/lang/kw.res | Bin 156 -> 0 bytes .../Locale/Resources/data/lang/lag.res | Bin 1640 -> 0 bytes .../Locale/Resources/data/lang/lg.res | Bin 1644 -> 0 bytes .../Locale/Resources/data/lang/lt.res | Bin 25800 -> 0 bytes .../Locale/Resources/data/lang/luo.res | Bin 1580 -> 0 bytes .../Locale/Resources/data/lang/luy.res | Bin 1576 -> 0 bytes .../Locale/Resources/data/lang/lv.res | Bin 22628 -> 0 bytes .../Locale/Resources/data/lang/mas.res | Bin 2612 -> 0 bytes .../Locale/Resources/data/lang/mer.res | Bin 1568 -> 0 bytes .../Locale/Resources/data/lang/mfe.res | Bin 1452 -> 0 bytes .../Locale/Resources/data/lang/mg.res | Bin 1504 -> 0 bytes .../Locale/Resources/data/lang/mk.res | Bin 20876 -> 0 bytes .../Locale/Resources/data/lang/ml.res | Bin 25248 -> 0 bytes .../Locale/Resources/data/lang/mo.res | Bin 132 -> 0 bytes .../Locale/Resources/data/lang/mr.res | Bin 21792 -> 0 bytes .../Locale/Resources/data/lang/ms.res | Bin 1692 -> 0 bytes .../Locale/Resources/data/lang/mt.res | Bin 17844 -> 0 bytes .../Locale/Resources/data/lang/my.res | Bin 8636 -> 0 bytes .../Locale/Resources/data/lang/naq.res | Bin 1924 -> 0 bytes .../Locale/Resources/data/lang/nb.res | Bin 25732 -> 0 bytes .../Locale/Resources/data/lang/nb_NO.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/nd.res | Bin 1832 -> 0 bytes .../Locale/Resources/data/lang/ne.res | Bin 6304 -> 0 bytes .../Locale/Resources/data/lang/nl.res | Bin 25808 -> 0 bytes .../Locale/Resources/data/lang/nl_BE.res | Bin 352 -> 0 bytes .../Locale/Resources/data/lang/nn.res | Bin 25972 -> 0 bytes .../Locale/Resources/data/lang/nn_NO.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/no.res | Bin 128 -> 0 bytes .../Locale/Resources/data/lang/no_NO.res | Bin 92 -> 0 bytes .../Locale/Resources/data/lang/no_NO_NY.res | Bin 92 -> 0 bytes .../Locale/Resources/data/lang/nyn.res | Bin 1708 -> 0 bytes .../Locale/Resources/data/lang/om.res | Bin 3892 -> 0 bytes .../Locale/Resources/data/lang/or.res | Bin 22584 -> 0 bytes .../Locale/Resources/data/lang/pa.res | Bin 1164 -> 0 bytes .../Locale/Resources/data/lang/pa_Arab.res | Bin 228 -> 0 bytes .../Locale/Resources/data/lang/pa_Arab_PK.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/pa_Guru.res | Bin 100 -> 0 bytes .../Locale/Resources/data/lang/pa_Guru_IN.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/pa_IN.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/pa_PK.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/pl.res | Bin 26556 -> 0 bytes .../Locale/Resources/data/lang/ps.res | Bin 1048 -> 0 bytes .../Locale/Resources/data/lang/pt.res | Bin 25568 -> 0 bytes .../Locale/Resources/data/lang/pt_PT.res | Bin 4312 -> 0 bytes .../Locale/Resources/data/lang/rm.res | Bin 25684 -> 0 bytes .../Locale/Resources/data/lang/ro.res | Bin 12660 -> 0 bytes .../Locale/Resources/data/lang/ro_MD.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/rof.res | Bin 1592 -> 0 bytes .../Locale/Resources/data/lang/root.res | Bin 344 -> 0 bytes .../Locale/Resources/data/lang/ru.res | Bin 26560 -> 0 bytes .../Locale/Resources/data/lang/ru_UA.res | Bin 256 -> 0 bytes .../Locale/Resources/data/lang/rw.res | Bin 4352 -> 0 bytes .../Locale/Resources/data/lang/rwk.res | Bin 1680 -> 0 bytes .../Locale/Resources/data/lang/saq.res | Bin 1584 -> 0 bytes .../Locale/Resources/data/lang/seh.res | Bin 1420 -> 0 bytes .../Locale/Resources/data/lang/ses.res | Bin 1976 -> 0 bytes .../Locale/Resources/data/lang/sg.res | Bin 1436 -> 0 bytes .../Locale/Resources/data/lang/sh.res | Bin 136 -> 0 bytes .../Locale/Resources/data/lang/sh_BA.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/sh_CS.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/sh_YU.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/shi.res | Bin 1616 -> 0 bytes .../Locale/Resources/data/lang/shi_Latn.res | Bin 100 -> 0 bytes .../Resources/data/lang/shi_Latn_MA.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/shi_MA.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/shi_Tfng.res | Bin 1616 -> 0 bytes .../Locale/Resources/data/lang/si.res | Bin 916 -> 0 bytes .../Locale/Resources/data/lang/sk.res | Bin 12500 -> 0 bytes .../Locale/Resources/data/lang/sl.res | Bin 28996 -> 0 bytes .../Locale/Resources/data/lang/sn.res | Bin 1672 -> 0 bytes .../Locale/Resources/data/lang/so.res | Bin 1704 -> 0 bytes .../Locale/Resources/data/lang/sq.res | Bin 760 -> 0 bytes .../Locale/Resources/data/lang/sr.res | Bin 27032 -> 0 bytes .../Locale/Resources/data/lang/sr_BA.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/sr_CS.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/sr_Cyrl.res | Bin 100 -> 0 bytes .../Locale/Resources/data/lang/sr_Cyrl_BA.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/sr_Cyrl_CS.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/sr_Cyrl_RS.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/sr_Cyrl_YU.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/sr_Latn.res | Bin 27168 -> 0 bytes .../Locale/Resources/data/lang/sr_Latn_BA.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/sr_Latn_CS.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/sr_Latn_ME.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/sr_Latn_RS.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/sr_Latn_YU.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/sr_ME.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/sr_RS.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/sr_YU.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/sv.res | Bin 25900 -> 0 bytes .../Locale/Resources/data/lang/sv_FI.res | Bin 172 -> 0 bytes .../Locale/Resources/data/lang/sw.res | Bin 1584 -> 0 bytes .../Locale/Resources/data/lang/ta.res | Bin 23396 -> 0 bytes .../Locale/Resources/data/lang/te.res | Bin 22504 -> 0 bytes .../Locale/Resources/data/lang/teo.res | Bin 1580 -> 0 bytes .../Locale/Resources/data/lang/th.res | Bin 23176 -> 0 bytes .../Locale/Resources/data/lang/th_TH.res | Bin 80 -> 0 bytes .../Resources/data/lang/th_TH_TRADITIONAL.res | Bin 120 -> 0 bytes .../Locale/Resources/data/lang/ti.res | Bin 2668 -> 0 bytes .../Locale/Resources/data/lang/tl.res | Bin 128 -> 0 bytes .../Locale/Resources/data/lang/tl_PH.res | Bin 136 -> 0 bytes .../Locale/Resources/data/lang/to.res | Bin 11564 -> 0 bytes .../Locale/Resources/data/lang/tr.res | Bin 26180 -> 0 bytes .../Locale/Resources/data/lang/tzm.res | Bin 1672 -> 0 bytes .../Locale/Resources/data/lang/tzm_Latn.res | Bin 100 -> 0 bytes .../Resources/data/lang/tzm_Latn_MA.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/tzm_MA.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/uk.res | Bin 27100 -> 0 bytes .../Locale/Resources/data/lang/ur.res | Bin 2544 -> 0 bytes .../Locale/Resources/data/lang/uz.res | Bin 148 -> 0 bytes .../Locale/Resources/data/lang/uz_AF.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/uz_Arab.res | Bin 196 -> 0 bytes .../Locale/Resources/data/lang/uz_Arab_AF.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/uz_Cyrl.res | Bin 100 -> 0 bytes .../Locale/Resources/data/lang/uz_Cyrl_UZ.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/uz_Latn.res | Bin 588 -> 0 bytes .../Locale/Resources/data/lang/uz_UZ.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/vi.res | Bin 5428 -> 0 bytes .../Locale/Resources/data/lang/vun.res | Bin 1684 -> 0 bytes .../Locale/Resources/data/lang/xog.res | Bin 1696 -> 0 bytes .../Locale/Resources/data/lang/yo.res | Bin 3908 -> 0 bytes .../Locale/Resources/data/lang/zh.res | Bin 17736 -> 0 bytes .../Locale/Resources/data/lang/zh_CN.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/zh_HK.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/zh_Hans.res | Bin 100 -> 0 bytes .../Locale/Resources/data/lang/zh_Hans_CN.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/zh_Hans_SG.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/zh_Hant.res | Bin 17544 -> 0 bytes .../Locale/Resources/data/lang/zh_Hant_HK.res | Bin 556 -> 0 bytes .../Locale/Resources/data/lang/zh_Hant_MO.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/zh_Hant_TW.res | Bin 80 -> 0 bytes .../Locale/Resources/data/lang/zh_MO.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/zh_SG.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/zh_TW.res | Bin 144 -> 0 bytes .../Locale/Resources/data/lang/zu.res | Bin 504 -> 0 bytes .../Locale/Resources/data/locales/af.res | Bin 4764 -> 0 bytes .../Locale/Resources/data/locales/af_NA.res | Bin 204 -> 0 bytes .../Locale/Resources/data/locales/af_ZA.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ak.res | Bin 3888 -> 0 bytes .../Locale/Resources/data/locales/ak_GH.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/am.res | Bin 3488 -> 0 bytes .../Locale/Resources/data/locales/am_ET.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ar.res | Bin 19712 -> 0 bytes .../Locale/Resources/data/locales/ar_AE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ar_BH.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ar_DZ.res | Bin 900 -> 0 bytes .../Locale/Resources/data/locales/ar_EG.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ar_IQ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ar_JO.res | Bin 708 -> 0 bytes .../Locale/Resources/data/locales/ar_KW.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ar_LB.res | Bin 708 -> 0 bytes .../Locale/Resources/data/locales/ar_LY.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ar_MA.res | Bin 972 -> 0 bytes .../Locale/Resources/data/locales/ar_OM.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ar_QA.res | Bin 512 -> 0 bytes .../Locale/Resources/data/locales/ar_SA.res | Bin 512 -> 0 bytes .../Locale/Resources/data/locales/ar_SD.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ar_SY.res | Bin 856 -> 0 bytes .../Locale/Resources/data/locales/ar_TN.res | Bin 1300 -> 0 bytes .../Locale/Resources/data/locales/ar_YE.res | Bin 512 -> 0 bytes .../Locale/Resources/data/locales/as.res | Bin 2524 -> 0 bytes .../Locale/Resources/data/locales/as_IN.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/asa.res | Bin 4108 -> 0 bytes .../Locale/Resources/data/locales/asa_TZ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/az.res | Bin 4272 -> 0 bytes .../Locale/Resources/data/locales/az_AZ.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/az_Cyrl.res | Bin 2104 -> 0 bytes .../Resources/data/locales/az_Cyrl_AZ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/az_Latn.res | Bin 148 -> 0 bytes .../Resources/data/locales/az_Latn_AZ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/be.res | Bin 7584 -> 0 bytes .../Locale/Resources/data/locales/be_BY.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/bem.res | Bin 3580 -> 0 bytes .../Locale/Resources/data/locales/bem_ZM.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/bez.res | Bin 4492 -> 0 bytes .../Locale/Resources/data/locales/bez_TZ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/bg.res | Bin 9140 -> 0 bytes .../Locale/Resources/data/locales/bg_BG.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/bm.res | Bin 4280 -> 0 bytes .../Locale/Resources/data/locales/bm_ML.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/bn.res | Bin 9020 -> 0 bytes .../Locale/Resources/data/locales/bn_BD.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/bn_IN.res | Bin 632 -> 0 bytes .../Locale/Resources/data/locales/bo.res | Bin 3716 -> 0 bytes .../Locale/Resources/data/locales/bo_CN.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/bo_IN.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/bs.res | Bin 4356 -> 0 bytes .../Locale/Resources/data/locales/bs_BA.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ca.res | Bin 9716 -> 0 bytes .../Locale/Resources/data/locales/ca_ES.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/cgg.res | Bin 4212 -> 0 bytes .../Locale/Resources/data/locales/cgg_UG.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/chr.res | Bin 6272 -> 0 bytes .../Locale/Resources/data/locales/chr_US.res | Bin 152 -> 0 bytes .../Locale/Resources/data/locales/cs.res | Bin 5868 -> 0 bytes .../Locale/Resources/data/locales/cs_CZ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/cy.res | Bin 6608 -> 0 bytes .../Locale/Resources/data/locales/cy_GB.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/da.res | Bin 14800 -> 0 bytes .../Locale/Resources/data/locales/da_DK.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/dav.res | Bin 4508 -> 0 bytes .../Locale/Resources/data/locales/dav_KE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/de.res | Bin 16516 -> 0 bytes .../Locale/Resources/data/locales/de_AT.res | Bin 1180 -> 0 bytes .../Locale/Resources/data/locales/de_BE.res | Bin 716 -> 0 bytes .../Locale/Resources/data/locales/de_CH.res | Bin 436 -> 0 bytes .../Locale/Resources/data/locales/de_DE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/de_LI.res | Bin 268 -> 0 bytes .../Locale/Resources/data/locales/de_LU.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ebu.res | Bin 4396 -> 0 bytes .../Locale/Resources/data/locales/ebu_KE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ee.res | Bin 4044 -> 0 bytes .../Locale/Resources/data/locales/ee_GH.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ee_TG.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/el.res | Bin 11204 -> 0 bytes .../Locale/Resources/data/locales/el_CY.res | Bin 200 -> 0 bytes .../Locale/Resources/data/locales/el_GR.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/en.res | Bin 16428 -> 0 bytes .../Locale/Resources/data/locales/en_AS.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/en_AU.res | Bin 2784 -> 0 bytes .../Locale/Resources/data/locales/en_BE.res | Bin 1036 -> 0 bytes .../Locale/Resources/data/locales/en_BW.res | Bin 1000 -> 0 bytes .../Locale/Resources/data/locales/en_BZ.res | Bin 860 -> 0 bytes .../Locale/Resources/data/locales/en_CA.res | Bin 2820 -> 0 bytes .../Locale/Resources/data/locales/en_GB.res | Bin 8352 -> 0 bytes .../Locale/Resources/data/locales/en_GU.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/en_HK.res | Bin 8788 -> 0 bytes .../Locale/Resources/data/locales/en_IE.res | Bin 2812 -> 0 bytes .../Locale/Resources/data/locales/en_IN.res | Bin 956 -> 0 bytes .../Locale/Resources/data/locales/en_JM.res | Bin 200 -> 0 bytes .../Locale/Resources/data/locales/en_MH.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/en_MP.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/en_MT.res | Bin 908 -> 0 bytes .../Locale/Resources/data/locales/en_MU.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/en_NA.res | Bin 200 -> 0 bytes .../Locale/Resources/data/locales/en_NZ.res | Bin 2828 -> 0 bytes .../Locale/Resources/data/locales/en_PH.res | Bin 132 -> 0 bytes .../Locale/Resources/data/locales/en_PK.res | Bin 528 -> 0 bytes .../Locale/Resources/data/locales/en_RH.res | Bin 92 -> 0 bytes .../Locale/Resources/data/locales/en_SG.res | Bin 1560 -> 0 bytes .../Locale/Resources/data/locales/en_TT.res | Bin 200 -> 0 bytes .../Locale/Resources/data/locales/en_UM.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/en_US.res | Bin 152 -> 0 bytes .../Resources/data/locales/en_US_POSIX.res | Bin 408 -> 0 bytes .../Locale/Resources/data/locales/en_VI.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/en_ZA.res | Bin 1224 -> 0 bytes .../Locale/Resources/data/locales/en_ZW.res | Bin 920 -> 0 bytes .../Locale/Resources/data/locales/eo.res | Bin 2080 -> 0 bytes .../Locale/Resources/data/locales/es.res | Bin 16324 -> 0 bytes .../Locale/Resources/data/locales/es_419.res | Bin 200 -> 0 bytes .../Locale/Resources/data/locales/es_AR.res | Bin 952 -> 0 bytes .../Locale/Resources/data/locales/es_BO.res | Bin 232 -> 0 bytes .../Locale/Resources/data/locales/es_CL.res | Bin 992 -> 0 bytes .../Locale/Resources/data/locales/es_CO.res | Bin 708 -> 0 bytes .../Locale/Resources/data/locales/es_CR.res | Bin 264 -> 0 bytes .../Locale/Resources/data/locales/es_DO.res | Bin 140 -> 0 bytes .../Locale/Resources/data/locales/es_EC.res | Bin 776 -> 0 bytes .../Locale/Resources/data/locales/es_ES.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/es_GQ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/es_GT.res | Bin 620 -> 0 bytes .../Locale/Resources/data/locales/es_HN.res | Bin 604 -> 0 bytes .../Locale/Resources/data/locales/es_MX.res | Bin 164 -> 0 bytes .../Locale/Resources/data/locales/es_NI.res | Bin 164 -> 0 bytes .../Locale/Resources/data/locales/es_PA.res | Bin 816 -> 0 bytes .../Locale/Resources/data/locales/es_PE.res | Bin 608 -> 0 bytes .../Locale/Resources/data/locales/es_PR.res | Bin 816 -> 0 bytes .../Locale/Resources/data/locales/es_PY.res | Bin 324 -> 0 bytes .../Locale/Resources/data/locales/es_SV.res | Bin 164 -> 0 bytes .../Locale/Resources/data/locales/es_US.res | Bin 996 -> 0 bytes .../Locale/Resources/data/locales/es_UY.res | Bin 324 -> 0 bytes .../Locale/Resources/data/locales/es_VE.res | Bin 352 -> 0 bytes .../Locale/Resources/data/locales/et.res | Bin 7228 -> 0 bytes .../Locale/Resources/data/locales/et_EE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/eu.res | Bin 4088 -> 0 bytes .../Locale/Resources/data/locales/eu_ES.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fa.res | Bin 11020 -> 0 bytes .../Locale/Resources/data/locales/fa_AF.res | Bin 1636 -> 0 bytes .../Locale/Resources/data/locales/fa_IR.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ff.res | Bin 4256 -> 0 bytes .../Locale/Resources/data/locales/ff_SN.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fi.res | Bin 16744 -> 0 bytes .../Locale/Resources/data/locales/fi_FI.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fil.res | Bin 5588 -> 0 bytes .../Locale/Resources/data/locales/fil_PH.res | Bin 132 -> 0 bytes .../Locale/Resources/data/locales/fo.res | Bin 2448 -> 0 bytes .../Locale/Resources/data/locales/fo_FO.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr.res | Bin 17728 -> 0 bytes .../Locale/Resources/data/locales/fr_BE.res | Bin 612 -> 0 bytes .../Locale/Resources/data/locales/fr_BF.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_BI.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_BJ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_BL.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_CA.res | Bin 2792 -> 0 bytes .../Locale/Resources/data/locales/fr_CD.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_CF.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_CG.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_CH.res | Bin 712 -> 0 bytes .../Locale/Resources/data/locales/fr_CI.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_CM.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_DJ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_FR.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_GA.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_GN.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_GP.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_GQ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_KM.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_LU.res | Bin 176 -> 0 bytes .../Locale/Resources/data/locales/fr_MC.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_MF.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_MG.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_ML.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_MQ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_NE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_RE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_RW.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_SN.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_TD.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/fr_TG.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ga.res | Bin 2496 -> 0 bytes .../Locale/Resources/data/locales/ga_IE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/gl.res | Bin 5492 -> 0 bytes .../Locale/Resources/data/locales/gl_ES.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/gsw.res | Bin 8844 -> 0 bytes .../Locale/Resources/data/locales/gsw_CH.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/gu.res | Bin 4532 -> 0 bytes .../Locale/Resources/data/locales/gu_IN.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/guz.res | Bin 4160 -> 0 bytes .../Locale/Resources/data/locales/guz_KE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/gv.res | Bin 1688 -> 0 bytes .../Locale/Resources/data/locales/gv_GB.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ha.res | Bin 4424 -> 0 bytes .../Locale/Resources/data/locales/ha_GH.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/ha_Latn.res | Bin 148 -> 0 bytes .../Resources/data/locales/ha_Latn_GH.res | Bin 100 -> 0 bytes .../Resources/data/locales/ha_Latn_NE.res | Bin 100 -> 0 bytes .../Resources/data/locales/ha_Latn_NG.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ha_NE.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/ha_NG.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/haw.res | Bin 1976 -> 0 bytes .../Locale/Resources/data/locales/haw_US.res | Bin 152 -> 0 bytes .../Locale/Resources/data/locales/he.res | Bin 15440 -> 0 bytes .../Locale/Resources/data/locales/he_IL.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/hi.res | Bin 17860 -> 0 bytes .../Locale/Resources/data/locales/hi_IN.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/hr.res | Bin 13340 -> 0 bytes .../Locale/Resources/data/locales/hr_HR.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/hu.res | Bin 8940 -> 0 bytes .../Locale/Resources/data/locales/hu_HU.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/hy.res | Bin 2076 -> 0 bytes .../Locale/Resources/data/locales/hy_AM.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/id.res | Bin 6524 -> 0 bytes .../Locale/Resources/data/locales/id_ID.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ig.res | Bin 3784 -> 0 bytes .../Locale/Resources/data/locales/ig_NG.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ii.res | Bin 1804 -> 0 bytes .../Locale/Resources/data/locales/ii_CN.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/in.res | Bin 128 -> 0 bytes .../Locale/Resources/data/locales/in_ID.res | Bin 92 -> 0 bytes .../Locale/Resources/data/locales/is.res | Bin 8028 -> 0 bytes .../Locale/Resources/data/locales/is_IS.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/it.res | Bin 15896 -> 0 bytes .../Locale/Resources/data/locales/it_CH.res | Bin 712 -> 0 bytes .../Locale/Resources/data/locales/it_IT.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/iw.res | Bin 128 -> 0 bytes .../Locale/Resources/data/locales/iw_IL.res | Bin 92 -> 0 bytes .../Locale/Resources/data/locales/ja.res | Bin 22376 -> 0 bytes .../Locale/Resources/data/locales/ja_JP.res | Bin 100 -> 0 bytes .../data/locales/ja_JP_TRADITIONAL.res | Bin 120 -> 0 bytes .../Locale/Resources/data/locales/jmc.res | Bin 3992 -> 0 bytes .../Locale/Resources/data/locales/jmc_TZ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ka.res | Bin 1668 -> 0 bytes .../Locale/Resources/data/locales/ka_GE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/kab.res | Bin 4480 -> 0 bytes .../Locale/Resources/data/locales/kab_DZ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/kam.res | Bin 4308 -> 0 bytes .../Locale/Resources/data/locales/kam_KE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/kde.res | Bin 4516 -> 0 bytes .../Locale/Resources/data/locales/kde_TZ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/kea.res | Bin 4656 -> 0 bytes .../Locale/Resources/data/locales/kea_CV.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/khq.res | Bin 4224 -> 0 bytes .../Locale/Resources/data/locales/khq_ML.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ki.res | Bin 4312 -> 0 bytes .../Locale/Resources/data/locales/ki_KE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/kk.res | Bin 1920 -> 0 bytes .../Locale/Resources/data/locales/kk_Cyrl.res | Bin 148 -> 0 bytes .../Resources/data/locales/kk_Cyrl_KZ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/kk_KZ.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/kl.res | Bin 1580 -> 0 bytes .../Locale/Resources/data/locales/kl_GL.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/kln.res | Bin 4192 -> 0 bytes .../Locale/Resources/data/locales/kln_KE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/km.res | Bin 2376 -> 0 bytes .../Locale/Resources/data/locales/km_KH.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/kn.res | Bin 2920 -> 0 bytes .../Locale/Resources/data/locales/kn_IN.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ko.res | Bin 18568 -> 0 bytes .../Locale/Resources/data/locales/ko_KR.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/kok.res | Bin 1720 -> 0 bytes .../Locale/Resources/data/locales/kok_IN.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/kw.res | Bin 1532 -> 0 bytes .../Locale/Resources/data/locales/kw_GB.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/lag.res | Bin 4172 -> 0 bytes .../Locale/Resources/data/locales/lag_TZ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/lg.res | Bin 4068 -> 0 bytes .../Locale/Resources/data/locales/lg_UG.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/lt.res | Bin 10180 -> 0 bytes .../Locale/Resources/data/locales/lt_LT.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/luo.res | Bin 4300 -> 0 bytes .../Locale/Resources/data/locales/luo_KE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/luy.res | Bin 4160 -> 0 bytes .../Locale/Resources/data/locales/luy_KE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/lv.res | Bin 10496 -> 0 bytes .../Locale/Resources/data/locales/lv_LV.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/mas.res | Bin 4224 -> 0 bytes .../Locale/Resources/data/locales/mas_KE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/mas_TZ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/mer.res | Bin 3964 -> 0 bytes .../Locale/Resources/data/locales/mer_KE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/mfe.res | Bin 3964 -> 0 bytes .../Locale/Resources/data/locales/mfe_MU.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/mg.res | Bin 4172 -> 0 bytes .../Locale/Resources/data/locales/mg_MG.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/mk.res | Bin 7508 -> 0 bytes .../Locale/Resources/data/locales/mk_MK.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ml.res | Bin 9384 -> 0 bytes .../Locale/Resources/data/locales/ml_IN.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/mo.res | Bin 132 -> 0 bytes .../Locale/Resources/data/locales/mr.res | Bin 3964 -> 0 bytes .../Locale/Resources/data/locales/mr_IN.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ms.res | Bin 5348 -> 0 bytes .../Locale/Resources/data/locales/ms_BN.res | Bin 684 -> 0 bytes .../Locale/Resources/data/locales/ms_MY.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/mt.res | Bin 3372 -> 0 bytes .../Locale/Resources/data/locales/mt_MT.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/my.res | Bin 7492 -> 0 bytes .../Locale/Resources/data/locales/my_MM.res | Bin 128 -> 0 bytes .../Locale/Resources/data/locales/naq.res | Bin 4244 -> 0 bytes .../Locale/Resources/data/locales/naq_NA.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/nb.res | Bin 13952 -> 0 bytes .../Locale/Resources/data/locales/nb_NO.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/nd.res | Bin 4024 -> 0 bytes .../Locale/Resources/data/locales/nd_ZW.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ne.res | Bin 2464 -> 0 bytes .../Locale/Resources/data/locales/ne_IN.res | Bin 1864 -> 0 bytes .../Locale/Resources/data/locales/ne_NP.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/nl.res | Bin 15864 -> 0 bytes .../Locale/Resources/data/locales/nl_BE.res | Bin 612 -> 0 bytes .../Locale/Resources/data/locales/nl_NL.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/nn.res | Bin 7236 -> 0 bytes .../Locale/Resources/data/locales/nn_NO.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/no.res | Bin 128 -> 0 bytes .../Locale/Resources/data/locales/no_NO.res | Bin 92 -> 0 bytes .../Resources/data/locales/no_NO_NY.res | Bin 92 -> 0 bytes .../Locale/Resources/data/locales/nyn.res | Bin 4204 -> 0 bytes .../Locale/Resources/data/locales/nyn_UG.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/om.res | Bin 2504 -> 0 bytes .../Locale/Resources/data/locales/om_ET.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/om_KE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/or.res | Bin 2724 -> 0 bytes .../Locale/Resources/data/locales/or_IN.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/pa.res | Bin 3268 -> 0 bytes .../Locale/Resources/data/locales/pa_Arab.res | Bin 2264 -> 0 bytes .../Resources/data/locales/pa_Arab_PK.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/pa_Guru.res | Bin 148 -> 0 bytes .../Resources/data/locales/pa_Guru_IN.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/pa_IN.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/pa_PK.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/pl.res | Bin 15120 -> 0 bytes .../Locale/Resources/data/locales/pl_PL.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ps.res | Bin 2440 -> 0 bytes .../Locale/Resources/data/locales/ps_AF.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/pt.res | Bin 17928 -> 0 bytes .../Locale/Resources/data/locales/pt_BR.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/pt_GW.res | Bin 136 -> 0 bytes .../Locale/Resources/data/locales/pt_MZ.res | Bin 136 -> 0 bytes .../Locale/Resources/data/locales/pt_PT.res | Bin 5400 -> 0 bytes .../Locale/Resources/data/locales/rm.res | Bin 8644 -> 0 bytes .../Locale/Resources/data/locales/rm_CH.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ro.res | Bin 10092 -> 0 bytes .../Locale/Resources/data/locales/ro_MD.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ro_RO.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/rof.res | Bin 4280 -> 0 bytes .../Locale/Resources/data/locales/rof_TZ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/root.res | Bin 43680 -> 0 bytes .../Locale/Resources/data/locales/ru.res | Bin 29220 -> 0 bytes .../Locale/Resources/data/locales/ru_MD.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ru_RU.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ru_UA.res | Bin 528 -> 0 bytes .../Locale/Resources/data/locales/rw.res | Bin 2488 -> 0 bytes .../Locale/Resources/data/locales/rw_RW.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/rwk.res | Bin 3992 -> 0 bytes .../Locale/Resources/data/locales/rwk_TZ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/saq.res | Bin 4328 -> 0 bytes .../Locale/Resources/data/locales/saq_KE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/seh.res | Bin 3960 -> 0 bytes .../Locale/Resources/data/locales/seh_MZ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ses.res | Bin 4232 -> 0 bytes .../Locale/Resources/data/locales/ses_ML.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/sg.res | Bin 4184 -> 0 bytes .../Locale/Resources/data/locales/sg_CF.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/sh.res | Bin 136 -> 0 bytes .../Locale/Resources/data/locales/sh_BA.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/sh_CS.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/sh_YU.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/shi.res | Bin 4072 -> 0 bytes .../Resources/data/locales/shi_Latn.res | Bin 100 -> 0 bytes .../Resources/data/locales/shi_Latn_MA.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/shi_MA.res | Bin 144 -> 0 bytes .../Resources/data/locales/shi_Tfng.res | Bin 4032 -> 0 bytes .../Resources/data/locales/shi_Tfng_MA.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/si.res | Bin 3580 -> 0 bytes .../Locale/Resources/data/locales/si_LK.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/sk.res | Bin 8896 -> 0 bytes .../Locale/Resources/data/locales/sk_SK.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/sl.res | Bin 9360 -> 0 bytes .../Locale/Resources/data/locales/sl_SI.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/sn.res | Bin 3980 -> 0 bytes .../Locale/Resources/data/locales/sn_ZW.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/so.res | Bin 3960 -> 0 bytes .../Locale/Resources/data/locales/so_DJ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/so_ET.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/so_KE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/so_SO.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/sq.res | Bin 4204 -> 0 bytes .../Locale/Resources/data/locales/sq_AL.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/sr.res | Bin 18212 -> 0 bytes .../Locale/Resources/data/locales/sr_BA.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/sr_CS.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/sr_Cyrl.res | Bin 148 -> 0 bytes .../Resources/data/locales/sr_Cyrl_BA.res | Bin 1276 -> 0 bytes .../Resources/data/locales/sr_Cyrl_CS.res | Bin 144 -> 0 bytes .../Resources/data/locales/sr_Cyrl_ME.res | Bin 100 -> 0 bytes .../Resources/data/locales/sr_Cyrl_RS.res | Bin 100 -> 0 bytes .../Resources/data/locales/sr_Cyrl_YU.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/sr_Latn.res | Bin 5972 -> 0 bytes .../Resources/data/locales/sr_Latn_BA.res | Bin 100 -> 0 bytes .../Resources/data/locales/sr_Latn_CS.res | Bin 144 -> 0 bytes .../Resources/data/locales/sr_Latn_ME.res | Bin 628 -> 0 bytes .../Resources/data/locales/sr_Latn_RS.res | Bin 100 -> 0 bytes .../Resources/data/locales/sr_Latn_YU.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/sr_ME.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/sr_RS.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/sr_YU.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/sv.res | Bin 15520 -> 0 bytes .../Locale/Resources/data/locales/sv_FI.res | Bin 284 -> 0 bytes .../Locale/Resources/data/locales/sv_SE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/sw.res | Bin 3884 -> 0 bytes .../Locale/Resources/data/locales/sw_KE.res | Bin 200 -> 0 bytes .../Locale/Resources/data/locales/sw_TZ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ta.res | Bin 3576 -> 0 bytes .../Locale/Resources/data/locales/ta_IN.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ta_LK.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/te.res | Bin 2948 -> 0 bytes .../Locale/Resources/data/locales/te_IN.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/teo.res | Bin 4096 -> 0 bytes .../Locale/Resources/data/locales/teo_KE.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/teo_UG.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/th.res | Bin 26112 -> 0 bytes .../Locale/Resources/data/locales/th_TH.res | Bin 100 -> 0 bytes .../data/locales/th_TH_TRADITIONAL.res | Bin 120 -> 0 bytes .../Locale/Resources/data/locales/ti.res | Bin 2624 -> 0 bytes .../Locale/Resources/data/locales/ti_ER.res | Bin 1348 -> 0 bytes .../Locale/Resources/data/locales/ti_ET.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/tl.res | Bin 128 -> 0 bytes .../Locale/Resources/data/locales/tl_PH.res | Bin 136 -> 0 bytes .../Locale/Resources/data/locales/to.res | Bin 7116 -> 0 bytes .../Locale/Resources/data/locales/to_TO.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/tr.res | Bin 15796 -> 0 bytes .../Locale/Resources/data/locales/tr_TR.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/tzm.res | Bin 4252 -> 0 bytes .../Resources/data/locales/tzm_Latn.res | Bin 148 -> 0 bytes .../Resources/data/locales/tzm_Latn_MA.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/tzm_MA.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/uk.res | Bin 11048 -> 0 bytes .../Locale/Resources/data/locales/uk_UA.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/ur.res | Bin 2552 -> 0 bytes .../Locale/Resources/data/locales/ur_IN.res | Bin 304 -> 0 bytes .../Locale/Resources/data/locales/ur_PK.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/uz.res | Bin 364 -> 0 bytes .../Locale/Resources/data/locales/uz_AF.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/uz_Arab.res | Bin 900 -> 0 bytes .../Resources/data/locales/uz_Arab_AF.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/uz_Cyrl.res | Bin 148 -> 0 bytes .../Resources/data/locales/uz_Cyrl_UZ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/uz_Latn.res | Bin 2336 -> 0 bytes .../Resources/data/locales/uz_Latn_UZ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/uz_UZ.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/vi.res | Bin 12524 -> 0 bytes .../Locale/Resources/data/locales/vi_VN.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/vun.res | Bin 4000 -> 0 bytes .../Locale/Resources/data/locales/vun_TZ.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/xog.res | Bin 4296 -> 0 bytes .../Locale/Resources/data/locales/xog_UG.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/yo.res | Bin 4172 -> 0 bytes .../Locale/Resources/data/locales/yo_NG.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/zh.res | Bin 23112 -> 0 bytes .../Locale/Resources/data/locales/zh_CN.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/zh_HK.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/zh_Hans.res | Bin 148 -> 0 bytes .../Resources/data/locales/zh_Hans_CN.res | Bin 100 -> 0 bytes .../Resources/data/locales/zh_Hans_HK.res | Bin 100 -> 0 bytes .../Resources/data/locales/zh_Hans_MO.res | Bin 100 -> 0 bytes .../Resources/data/locales/zh_Hans_SG.res | Bin 516 -> 0 bytes .../Locale/Resources/data/locales/zh_Hant.res | Bin 23444 -> 0 bytes .../Resources/data/locales/zh_Hant_HK.res | Bin 856 -> 0 bytes .../Resources/data/locales/zh_Hant_MO.res | Bin 512 -> 0 bytes .../Resources/data/locales/zh_Hant_TW.res | Bin 100 -> 0 bytes .../Locale/Resources/data/locales/zh_MO.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/zh_SG.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/zh_TW.res | Bin 144 -> 0 bytes .../Locale/Resources/data/locales/zu.res | Bin 3224 -> 0 bytes .../Locale/Resources/data/locales/zu_ZA.res | Bin 100 -> 0 bytes .../Locale/Resources/data/names/ar.res | Bin 9820 -> 0 bytes .../Locale/Resources/data/names/bg.res | Bin 9476 -> 0 bytes .../Locale/Resources/data/names/bs.res | Bin 9728 -> 0 bytes .../Locale/Resources/data/names/ca.res | Bin 8924 -> 0 bytes .../Locale/Resources/data/names/da.res | Bin 9200 -> 0 bytes .../Locale/Resources/data/names/de.res | Bin 10152 -> 0 bytes .../Locale/Resources/data/names/de_CH.res | Bin 120 -> 0 bytes .../Locale/Resources/data/names/el.res | Bin 9748 -> 0 bytes .../Locale/Resources/data/names/en.res | Bin 9912 -> 0 bytes .../Locale/Resources/data/names/en_RH.res | Bin 9912 -> 0 bytes .../Locale/Resources/data/names/en_ZW.res | Bin 9912 -> 0 bytes .../Locale/Resources/data/names/es.res | Bin 9148 -> 0 bytes .../Locale/Resources/data/names/es_AR.res | Bin 9148 -> 0 bytes .../Locale/Resources/data/names/es_CL.res | Bin 3548 -> 0 bytes .../Locale/Resources/data/names/et.res | Bin 9268 -> 0 bytes .../Locale/Resources/data/names/fa.res | Bin 8816 -> 0 bytes .../Locale/Resources/data/names/fa_AF.res | Bin 1764 -> 0 bytes .../Locale/Resources/data/names/fi.res | Bin 9052 -> 0 bytes .../Locale/Resources/data/names/fr.res | Bin 9136 -> 0 bytes .../Locale/Resources/data/names/gsw.res | Bin 10268 -> 0 bytes .../Locale/Resources/data/names/gu.res | Bin 8932 -> 0 bytes .../Locale/Resources/data/names/he.res | Bin 7996 -> 0 bytes .../Locale/Resources/data/names/he_IL.res | Bin 7996 -> 0 bytes .../Locale/Resources/data/names/hi.res | Bin 8992 -> 0 bytes .../Locale/Resources/data/names/hr.res | Bin 9620 -> 0 bytes .../Locale/Resources/data/names/hu.res | Bin 8720 -> 0 bytes .../Locale/Resources/data/names/it.res | Bin 9408 -> 0 bytes .../Locale/Resources/data/names/iw.res | Bin 7996 -> 0 bytes .../Locale/Resources/data/names/iw_IL.res | Bin 7996 -> 0 bytes .../Locale/Resources/data/names/ja.res | Bin 7404 -> 0 bytes .../Locale/Resources/data/names/ja_JP.res | Bin 7404 -> 0 bytes .../data/names/ja_JP_TRADITIONAL.res | Bin 7404 -> 0 bytes .../Locale/Resources/data/names/ko.res | Bin 6852 -> 0 bytes .../Locale/Resources/data/names/lt.res | Bin 8992 -> 0 bytes .../Locale/Resources/data/names/lv.res | Bin 9108 -> 0 bytes .../Locale/Resources/data/names/mk.res | Bin 9724 -> 0 bytes .../Locale/Resources/data/names/ml.res | Bin 9796 -> 0 bytes .../Locale/Resources/data/names/mo.res | Bin 8276 -> 0 bytes .../Locale/Resources/data/names/mr.res | Bin 8928 -> 0 bytes .../Locale/Resources/data/names/mt.res | Bin 8488 -> 0 bytes .../Locale/Resources/data/names/my.res | Bin 6844 -> 0 bytes .../Locale/Resources/data/names/nb.res | Bin 9228 -> 0 bytes .../Locale/Resources/data/names/nb_NO.res | Bin 9228 -> 0 bytes .../Locale/Resources/data/names/ne.res | Bin 856 -> 0 bytes .../Locale/Resources/data/names/nl.res | Bin 9272 -> 0 bytes .../Locale/Resources/data/names/nl_BE.res | Bin 104 -> 0 bytes .../Locale/Resources/data/names/nn.res | Bin 9216 -> 0 bytes .../Locale/Resources/data/names/nn_NO.res | Bin 9216 -> 0 bytes .../Locale/Resources/data/names/no.res | Bin 9228 -> 0 bytes .../Locale/Resources/data/names/no_NO.res | Bin 9228 -> 0 bytes .../Locale/Resources/data/names/no_NO_NY.res | Bin 9216 -> 0 bytes .../Locale/Resources/data/names/pl.res | Bin 9636 -> 0 bytes .../Locale/Resources/data/names/pt.res | Bin 9104 -> 0 bytes .../Locale/Resources/data/names/pt_PT.res | Bin 688 -> 0 bytes .../Locale/Resources/data/names/rm.res | Bin 9188 -> 0 bytes .../Locale/Resources/data/names/ro.res | Bin 8276 -> 0 bytes .../Locale/Resources/data/names/ro_MD.res | Bin 8276 -> 0 bytes .../Locale/Resources/data/names/ru.res | Bin 10080 -> 0 bytes .../Locale/Resources/data/names/sh.res | Bin 9592 -> 0 bytes .../Locale/Resources/data/names/sh_BA.res | Bin 9592 -> 0 bytes .../Locale/Resources/data/names/sh_CS.res | Bin 9592 -> 0 bytes .../Locale/Resources/data/names/sh_YU.res | Bin 9592 -> 0 bytes .../Locale/Resources/data/names/sl.res | Bin 10560 -> 0 bytes .../Locale/Resources/data/names/sr.res | Bin 9540 -> 0 bytes .../Locale/Resources/data/names/sr_BA.res | Bin 9540 -> 0 bytes .../Locale/Resources/data/names/sr_CS.res | Bin 9540 -> 0 bytes .../Locale/Resources/data/names/sr_Cyrl.res | Bin 9540 -> 0 bytes .../Resources/data/names/sr_Cyrl_BA.res | Bin 9540 -> 0 bytes .../Resources/data/names/sr_Cyrl_CS.res | Bin 9540 -> 0 bytes .../Resources/data/names/sr_Cyrl_RS.res | Bin 9540 -> 0 bytes .../Resources/data/names/sr_Cyrl_YU.res | Bin 9540 -> 0 bytes .../Locale/Resources/data/names/sr_Latn.res | Bin 9592 -> 0 bytes .../Resources/data/names/sr_Latn_BA.res | Bin 9592 -> 0 bytes .../Resources/data/names/sr_Latn_CS.res | Bin 9592 -> 0 bytes .../Resources/data/names/sr_Latn_ME.res | Bin 9592 -> 0 bytes .../Resources/data/names/sr_Latn_RS.res | Bin 9592 -> 0 bytes .../Resources/data/names/sr_Latn_YU.res | Bin 9592 -> 0 bytes .../Locale/Resources/data/names/sr_ME.res | Bin 9592 -> 0 bytes .../Locale/Resources/data/names/sr_RS.res | Bin 9540 -> 0 bytes .../Locale/Resources/data/names/sr_YU.res | Bin 9540 -> 0 bytes .../Locale/Resources/data/names/sv.res | Bin 9476 -> 0 bytes .../Locale/Resources/data/names/sv_FI.res | Bin 4548 -> 0 bytes .../Locale/Resources/data/names/ta.res | Bin 9712 -> 0 bytes .../Locale/Resources/data/names/te.res | Bin 9356 -> 0 bytes .../Locale/Resources/data/names/th.res | Bin 8820 -> 0 bytes .../Locale/Resources/data/names/th_TH.res | Bin 8820 -> 0 bytes .../data/names/th_TH_TRADITIONAL.res | Bin 8820 -> 0 bytes .../Locale/Resources/data/names/tr.res | Bin 9516 -> 0 bytes .../Locale/Resources/data/names/uk.res | Bin 9752 -> 0 bytes .../Locale/Resources/data/names/zh.res | Bin 6592 -> 0 bytes .../Locale/Resources/data/names/zh_CN.res | Bin 6592 -> 0 bytes .../Locale/Resources/data/names/zh_HK.res | Bin 144 -> 0 bytes .../Locale/Resources/data/names/zh_Hans.res | Bin 6592 -> 0 bytes .../Resources/data/names/zh_Hans_CN.res | Bin 6592 -> 0 bytes .../Resources/data/names/zh_Hans_SG.res | Bin 6592 -> 0 bytes .../Locale/Resources/data/names/zh_Hant.res | Bin 6516 -> 0 bytes .../Resources/data/names/zh_Hant_HK.res | Bin 144 -> 0 bytes .../Resources/data/names/zh_Hant_MO.res | Bin 6516 -> 0 bytes .../Resources/data/names/zh_Hant_TW.res | Bin 6516 -> 0 bytes .../Locale/Resources/data/names/zh_MO.res | Bin 6516 -> 0 bytes .../Locale/Resources/data/names/zh_SG.res | Bin 6592 -> 0 bytes .../Locale/Resources/data/names/zh_TW.res | Bin 6516 -> 0 bytes .../Locale/Resources/data/region/af.res | Bin 9136 -> 0 bytes .../Locale/Resources/data/region/ak.res | Bin 7832 -> 0 bytes .../Locale/Resources/data/region/am.res | Bin 6240 -> 0 bytes .../Locale/Resources/data/region/ar.res | Bin 10292 -> 0 bytes .../Locale/Resources/data/region/as.res | Bin 868 -> 0 bytes .../Locale/Resources/data/region/asa.res | Bin 8040 -> 0 bytes .../Locale/Resources/data/region/az.res | Bin 10272 -> 0 bytes .../Locale/Resources/data/region/az_AZ.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/az_Cyrl.res | Bin 468 -> 0 bytes .../Locale/Resources/data/region/az_Latn.res | Bin 100 -> 0 bytes .../Resources/data/region/az_Latn_AZ.res | Bin 80 -> 0 bytes .../Locale/Resources/data/region/be.res | Bin 10476 -> 0 bytes .../Locale/Resources/data/region/bem.res | Bin 152 -> 0 bytes .../Locale/Resources/data/region/bez.res | Bin 8932 -> 0 bytes .../Locale/Resources/data/region/bg.res | Bin 11192 -> 0 bytes .../Locale/Resources/data/region/bm.res | Bin 7832 -> 0 bytes .../Locale/Resources/data/region/bn.res | Bin 11176 -> 0 bytes .../Locale/Resources/data/region/bo.res | Bin 488 -> 0 bytes .../Locale/Resources/data/region/bs.res | Bin 10672 -> 0 bytes .../Locale/Resources/data/region/ca.res | Bin 11048 -> 0 bytes .../Locale/Resources/data/region/cgg.res | Bin 8340 -> 0 bytes .../Locale/Resources/data/region/chr.res | Bin 520 -> 0 bytes .../Locale/Resources/data/region/cs.res | Bin 10616 -> 0 bytes .../Locale/Resources/data/region/cy.res | Bin 164 -> 0 bytes .../Locale/Resources/data/region/da.res | Bin 10684 -> 0 bytes .../Locale/Resources/data/region/dav.res | Bin 7960 -> 0 bytes .../Locale/Resources/data/region/de.res | Bin 11084 -> 0 bytes .../Locale/Resources/data/region/de_CH.res | Bin 632 -> 0 bytes .../Locale/Resources/data/region/ebu.res | Bin 7960 -> 0 bytes .../Locale/Resources/data/region/ee.res | Bin 8912 -> 0 bytes .../Locale/Resources/data/region/el.res | Bin 11104 -> 0 bytes .../Locale/Resources/data/region/en.res | Bin 10912 -> 0 bytes .../Locale/Resources/data/region/en_RH.res | Bin 92 -> 0 bytes .../Locale/Resources/data/region/en_ZW.res | Bin 80 -> 0 bytes .../Locale/Resources/data/region/eo.res | Bin 7840 -> 0 bytes .../Locale/Resources/data/region/es.res | Bin 11184 -> 0 bytes .../Locale/Resources/data/region/es_CL.res | Bin 212 -> 0 bytes .../Locale/Resources/data/region/et.res | Bin 10680 -> 0 bytes .../Locale/Resources/data/region/eu.res | Bin 8772 -> 0 bytes .../Locale/Resources/data/region/fa.res | Bin 10052 -> 0 bytes .../Locale/Resources/data/region/fa_AF.res | Bin 3200 -> 0 bytes .../Locale/Resources/data/region/ff.res | Bin 8060 -> 0 bytes .../Locale/Resources/data/region/fi.res | Bin 10800 -> 0 bytes .../Locale/Resources/data/region/fil.res | Bin 4776 -> 0 bytes .../Locale/Resources/data/region/fil_PH.res | Bin 80 -> 0 bytes .../Locale/Resources/data/region/fo.res | Bin 4424 -> 0 bytes .../Locale/Resources/data/region/fr.res | Bin 11264 -> 0 bytes .../Locale/Resources/data/region/ga.res | Bin 11016 -> 0 bytes .../Locale/Resources/data/region/gl.res | Bin 10468 -> 0 bytes .../Locale/Resources/data/region/gsw.res | Bin 11124 -> 0 bytes .../Locale/Resources/data/region/gu.res | Bin 11008 -> 0 bytes .../Locale/Resources/data/region/guz.res | Bin 7960 -> 0 bytes .../Locale/Resources/data/region/gv.res | Bin 168 -> 0 bytes .../Locale/Resources/data/region/ha.res | Bin 7996 -> 0 bytes .../Locale/Resources/data/region/ha_GH.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/ha_Latn.res | Bin 100 -> 0 bytes .../Resources/data/region/ha_Latn_GH.res | Bin 80 -> 0 bytes .../Resources/data/region/ha_Latn_NE.res | Bin 80 -> 0 bytes .../Resources/data/region/ha_Latn_NG.res | Bin 80 -> 0 bytes .../Locale/Resources/data/region/ha_NE.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/ha_NG.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/haw.res | Bin 792 -> 0 bytes .../Locale/Resources/data/region/he.res | Bin 9656 -> 0 bytes .../Locale/Resources/data/region/he_IL.res | Bin 80 -> 0 bytes .../Locale/Resources/data/region/hi.res | Bin 10524 -> 0 bytes .../Locale/Resources/data/region/hr.res | Bin 10964 -> 0 bytes .../Locale/Resources/data/region/hu.res | Bin 11184 -> 0 bytes .../Locale/Resources/data/region/hy.res | Bin 6540 -> 0 bytes .../Locale/Resources/data/region/id.res | Bin 8832 -> 0 bytes .../Locale/Resources/data/region/id_ID.res | Bin 80 -> 0 bytes .../Locale/Resources/data/region/ig.res | Bin 356 -> 0 bytes .../Locale/Resources/data/region/ii.res | Bin 360 -> 0 bytes .../Locale/Resources/data/region/in.res | Bin 128 -> 0 bytes .../Locale/Resources/data/region/in_ID.res | Bin 92 -> 0 bytes .../Locale/Resources/data/region/is.res | Bin 10112 -> 0 bytes .../Locale/Resources/data/region/it.res | Bin 11096 -> 0 bytes .../Locale/Resources/data/region/iw.res | Bin 128 -> 0 bytes .../Locale/Resources/data/region/iw_IL.res | Bin 92 -> 0 bytes .../Locale/Resources/data/region/ja.res | Bin 8088 -> 0 bytes .../Locale/Resources/data/region/ja_JP.res | Bin 80 -> 0 bytes .../data/region/ja_JP_TRADITIONAL.res | Bin 120 -> 0 bytes .../Locale/Resources/data/region/jmc.res | Bin 7960 -> 0 bytes .../Locale/Resources/data/region/ka.res | Bin 10360 -> 0 bytes .../Locale/Resources/data/region/kab.res | Bin 7816 -> 0 bytes .../Locale/Resources/data/region/kam.res | Bin 7972 -> 0 bytes .../Locale/Resources/data/region/kde.res | Bin 8096 -> 0 bytes .../Locale/Resources/data/region/kea.res | Bin 7760 -> 0 bytes .../Locale/Resources/data/region/khq.res | Bin 7956 -> 0 bytes .../Locale/Resources/data/region/ki.res | Bin 7980 -> 0 bytes .../Locale/Resources/data/region/kk.res | Bin 156 -> 0 bytes .../Locale/Resources/data/region/kk_Cyrl.res | Bin 100 -> 0 bytes .../Resources/data/region/kk_Cyrl_KZ.res | Bin 80 -> 0 bytes .../Locale/Resources/data/region/kk_KZ.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/kl.res | Bin 172 -> 0 bytes .../Locale/Resources/data/region/kln.res | Bin 11140 -> 0 bytes .../Locale/Resources/data/region/km.res | Bin 6220 -> 0 bytes .../Locale/Resources/data/region/kn.res | Bin 11184 -> 0 bytes .../Locale/Resources/data/region/ko.res | Bin 7364 -> 0 bytes .../Locale/Resources/data/region/kok.res | Bin 148 -> 0 bytes .../Locale/Resources/data/region/kw.res | Bin 168 -> 0 bytes .../Locale/Resources/data/region/lag.res | Bin 8484 -> 0 bytes .../Locale/Resources/data/region/lg.res | Bin 8524 -> 0 bytes .../Locale/Resources/data/region/lt.res | Bin 11332 -> 0 bytes .../Locale/Resources/data/region/luo.res | Bin 7920 -> 0 bytes .../Locale/Resources/data/region/luy.res | Bin 7964 -> 0 bytes .../Locale/Resources/data/region/lv.res | Bin 11104 -> 0 bytes .../Locale/Resources/data/region/mas.res | Bin 7960 -> 0 bytes .../Locale/Resources/data/region/mer.res | Bin 8008 -> 0 bytes .../Locale/Resources/data/region/mfe.res | Bin 7608 -> 0 bytes .../Locale/Resources/data/region/mg.res | Bin 7916 -> 0 bytes .../Locale/Resources/data/region/mk.res | Bin 11044 -> 0 bytes .../Locale/Resources/data/region/ml.res | Bin 11736 -> 0 bytes .../Locale/Resources/data/region/mo.res | Bin 132 -> 0 bytes .../Locale/Resources/data/region/mr.res | Bin 10804 -> 0 bytes .../Locale/Resources/data/region/ms.res | Bin 8680 -> 0 bytes .../Locale/Resources/data/region/mt.res | Bin 10352 -> 0 bytes .../Locale/Resources/data/region/my.res | Bin 8260 -> 0 bytes .../Locale/Resources/data/region/naq.res | Bin 8264 -> 0 bytes .../Locale/Resources/data/region/nb.res | Bin 10528 -> 0 bytes .../Locale/Resources/data/region/nb_NO.res | Bin 80 -> 0 bytes .../Locale/Resources/data/region/nd.res | Bin 8156 -> 0 bytes .../Locale/Resources/data/region/ne.res | Bin 10532 -> 0 bytes .../Locale/Resources/data/region/nl.res | Bin 10988 -> 0 bytes .../Locale/Resources/data/region/nl_BE.res | Bin 168 -> 0 bytes .../Locale/Resources/data/region/nn.res | Bin 10580 -> 0 bytes .../Locale/Resources/data/region/nn_NO.res | Bin 80 -> 0 bytes .../Locale/Resources/data/region/no.res | Bin 128 -> 0 bytes .../Locale/Resources/data/region/no_NO.res | Bin 92 -> 0 bytes .../Locale/Resources/data/region/no_NO_NY.res | Bin 92 -> 0 bytes .../Locale/Resources/data/region/nyn.res | Bin 8460 -> 0 bytes .../Locale/Resources/data/region/om.res | Bin 496 -> 0 bytes .../Locale/Resources/data/region/or.res | Bin 10980 -> 0 bytes .../Locale/Resources/data/region/pa.res | Bin 148 -> 0 bytes .../Locale/Resources/data/region/pa_Arab.res | Bin 152 -> 0 bytes .../Resources/data/region/pa_Arab_PK.res | Bin 80 -> 0 bytes .../Locale/Resources/data/region/pa_Guru.res | Bin 100 -> 0 bytes .../Resources/data/region/pa_Guru_IN.res | Bin 80 -> 0 bytes .../Locale/Resources/data/region/pa_IN.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/pa_PK.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/pl.res | Bin 11112 -> 0 bytes .../Locale/Resources/data/region/ps.res | Bin 1896 -> 0 bytes .../Locale/Resources/data/region/pt.res | Bin 11016 -> 0 bytes .../Locale/Resources/data/region/pt_PT.res | Bin 2776 -> 0 bytes .../Locale/Resources/data/region/rm.res | Bin 11048 -> 0 bytes .../Locale/Resources/data/region/ro.res | Bin 11224 -> 0 bytes .../Locale/Resources/data/region/ro_MD.res | Bin 80 -> 0 bytes .../Locale/Resources/data/region/rof.res | Bin 7952 -> 0 bytes .../Locale/Resources/data/region/root.res | Bin 100 -> 0 bytes .../Locale/Resources/data/region/ru.res | Bin 11212 -> 0 bytes .../Locale/Resources/data/region/rw.res | Bin 184 -> 0 bytes .../Locale/Resources/data/region/rwk.res | Bin 7960 -> 0 bytes .../Locale/Resources/data/region/saq.res | Bin 7960 -> 0 bytes .../Locale/Resources/data/region/seh.res | Bin 7852 -> 0 bytes .../Locale/Resources/data/region/ses.res | Bin 7956 -> 0 bytes .../Locale/Resources/data/region/sg.res | Bin 8168 -> 0 bytes .../Locale/Resources/data/region/sh.res | Bin 136 -> 0 bytes .../Locale/Resources/data/region/sh_BA.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/sh_CS.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/sh_YU.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/shi.res | Bin 7792 -> 0 bytes .../Locale/Resources/data/region/shi_Latn.res | Bin 100 -> 0 bytes .../Resources/data/region/shi_Latn_MA.res | Bin 80 -> 0 bytes .../Locale/Resources/data/region/shi_MA.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/shi_Tfng.res | Bin 7792 -> 0 bytes .../Locale/Resources/data/region/si.res | Bin 216 -> 0 bytes .../Locale/Resources/data/region/sk.res | Bin 11004 -> 0 bytes .../Locale/Resources/data/region/sl.res | Bin 11164 -> 0 bytes .../Locale/Resources/data/region/sn.res | Bin 7968 -> 0 bytes .../Locale/Resources/data/region/so.res | Bin 8432 -> 0 bytes .../Locale/Resources/data/region/sq.res | Bin 5484 -> 0 bytes .../Locale/Resources/data/region/sr.res | Bin 10952 -> 0 bytes .../Locale/Resources/data/region/sr_BA.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/sr_CS.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/sr_Cyrl.res | Bin 100 -> 0 bytes .../Resources/data/region/sr_Cyrl_BA.res | Bin 80 -> 0 bytes .../Resources/data/region/sr_Cyrl_CS.res | Bin 144 -> 0 bytes .../Resources/data/region/sr_Cyrl_RS.res | Bin 80 -> 0 bytes .../Resources/data/region/sr_Cyrl_YU.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/sr_Latn.res | Bin 10676 -> 0 bytes .../Resources/data/region/sr_Latn_BA.res | Bin 80 -> 0 bytes .../Resources/data/region/sr_Latn_CS.res | Bin 144 -> 0 bytes .../Resources/data/region/sr_Latn_ME.res | Bin 80 -> 0 bytes .../Resources/data/region/sr_Latn_RS.res | Bin 80 -> 0 bytes .../Resources/data/region/sr_Latn_YU.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/sr_ME.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/sr_RS.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/sr_YU.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/sv.res | Bin 10628 -> 0 bytes .../Locale/Resources/data/region/sv_FI.res | Bin 168 -> 0 bytes .../Locale/Resources/data/region/sw.res | Bin 7960 -> 0 bytes .../Locale/Resources/data/region/ta.res | Bin 11752 -> 0 bytes .../Locale/Resources/data/region/te.res | Bin 11328 -> 0 bytes .../Locale/Resources/data/region/teo.res | Bin 7960 -> 0 bytes .../Locale/Resources/data/region/th.res | Bin 10792 -> 0 bytes .../Locale/Resources/data/region/th_TH.res | Bin 80 -> 0 bytes .../data/region/th_TH_TRADITIONAL.res | Bin 120 -> 0 bytes .../Locale/Resources/data/region/ti.res | Bin 100 -> 0 bytes .../Locale/Resources/data/region/tl.res | Bin 128 -> 0 bytes .../Locale/Resources/data/region/tl_PH.res | Bin 136 -> 0 bytes .../Locale/Resources/data/region/to.res | Bin 11148 -> 0 bytes .../Locale/Resources/data/region/tr.res | Bin 10852 -> 0 bytes .../Locale/Resources/data/region/tzm.res | Bin 7996 -> 0 bytes .../Locale/Resources/data/region/tzm_Latn.res | Bin 100 -> 0 bytes .../Resources/data/region/tzm_Latn_MA.res | Bin 80 -> 0 bytes .../Locale/Resources/data/region/tzm_MA.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/uk.res | Bin 11064 -> 0 bytes .../Locale/Resources/data/region/ur.res | Bin 176 -> 0 bytes .../Locale/Resources/data/region/uz.res | Bin 160 -> 0 bytes .../Locale/Resources/data/region/uz_AF.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/uz_Arab.res | Bin 156 -> 0 bytes .../Resources/data/region/uz_Arab_AF.res | Bin 80 -> 0 bytes .../Locale/Resources/data/region/uz_Cyrl.res | Bin 100 -> 0 bytes .../Resources/data/region/uz_Cyrl_UZ.res | Bin 80 -> 0 bytes .../Locale/Resources/data/region/uz_Latn.res | Bin 548 -> 0 bytes .../Locale/Resources/data/region/uz_UZ.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/vi.res | Bin 10300 -> 0 bytes .../Locale/Resources/data/region/vun.res | Bin 7960 -> 0 bytes .../Locale/Resources/data/region/xog.res | Bin 8472 -> 0 bytes .../Locale/Resources/data/region/yo.res | Bin 12388 -> 0 bytes .../Locale/Resources/data/region/zh.res | Bin 7044 -> 0 bytes .../Locale/Resources/data/region/zh_CN.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/zh_HK.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/zh_Hans.res | Bin 100 -> 0 bytes .../Resources/data/region/zh_Hans_CN.res | Bin 80 -> 0 bytes .../Resources/data/region/zh_Hans_SG.res | Bin 80 -> 0 bytes .../Locale/Resources/data/region/zh_Hant.res | Bin 6736 -> 0 bytes .../Resources/data/region/zh_Hant_HK.res | Bin 80 -> 0 bytes .../Resources/data/region/zh_Hant_MO.res | Bin 80 -> 0 bytes .../Resources/data/region/zh_Hant_TW.res | Bin 80 -> 0 bytes .../Locale/Resources/data/region/zh_MO.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/zh_SG.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/zh_TW.res | Bin 144 -> 0 bytes .../Locale/Resources/data/region/zu.res | Bin 172 -> 0 bytes .../Locale/Resources/data/stub/curr/en.php | 1771 ------ .../Locale/Resources/data/stub/lang/en.php | 556 -- .../Locale/Resources/data/stub/names/en.php | 248 - .../Locale/Resources/data/stub/region/en.php | 268 - .../Locale/Resources/data/update-data.php | 498 -- .../Locale/Resources/stubs/Collator.php | 23 - .../Resources/stubs/IntlDateFormatter.php | 23 - .../Locale/Resources/stubs/Locale.php | 23 - .../Resources/stubs/NumberFormatter.php | 23 - .../Locale/Resources/stubs/functions.php | 63 - .../Stub/DateFormat/AmPmTransformer.php | 46 - .../Stub/DateFormat/DayOfWeekTransformer.php | 59 - .../Stub/DateFormat/DayOfYearTransformer.php | 46 - .../Locale/Stub/DateFormat/DayTransformer.php | 46 - .../Stub/DateFormat/FullTransformer.php | 348 -- .../Stub/DateFormat/Hour1200Transformer.php | 62 - .../Stub/DateFormat/Hour1201Transformer.php | 62 - .../Stub/DateFormat/Hour2400Transformer.php | 61 - .../Stub/DateFormat/Hour2401Transformer.php | 64 - .../Stub/DateFormat/HourTransformer.php | 30 - .../Stub/DateFormat/MinuteTransformer.php | 48 - .../Stub/DateFormat/MonthTransformer.php | 143 - .../Stub/DateFormat/QuarterTransformer.php | 64 - .../Stub/DateFormat/SecondTransformer.php | 48 - .../Stub/DateFormat/TimeZoneTransformer.php | 96 - .../Locale/Stub/DateFormat/Transformer.php | 64 - .../Stub/DateFormat/YearTransformer.php | 50 - .../Component/Locale/Stub/StubCollator.php | 280 - .../Component/Locale/Stub/StubIntl.php | 137 - .../Locale/Stub/StubIntlDateFormatter.php | 526 -- .../Component/Locale/Stub/StubLocale.php | 493 -- .../Locale/Stub/StubNumberFormatter.php | 907 --- .../Component/Locale/Tests/LocaleTest.php | 51 - .../Locale/Tests/Stub/StubCollatorTest.php | 154 - .../Tests/Stub/StubIntlDateFormatterTest.php | 1072 ---- .../Locale/Tests/Stub/StubIntlTest.php | 49 - .../Locale/Tests/Stub/StubLocaleTest.php | 252 - .../Tests/Stub/StubNumberFormatterTest.php | 1195 ---- .../Component/Locale/Tests/TestCase.php | 120 - .../Component/Locale/Tests/bootstrap.php | 26 - .../Symfony/Component/Locale/composer.json | 33 - .../Symfony/Component/Locale/phpunit.xml.dist | 30 - .../Exception/ExceptionInterface.php | 21 - .../Exception/InvalidOptionsException.php | 21 - .../Exception/MissingOptionsException.php | 21 - .../Exception/OptionDefinitionException.php | 21 - .../Symfony/Component/OptionsResolver/LICENSE | 19 - .../Component/OptionsResolver/Options.php | 512 -- .../OptionsResolver/OptionsResolver.php | 342 -- .../OptionsResolverInterface.php | 210 - .../Component/OptionsResolver/README.md | 105 - .../Tests/OptionsResolverTest.php | 636 -- .../OptionsResolver/Tests/OptionsTest.php | 472 -- .../OptionsResolver/Tests/bootstrap.php | 18 - .../Component/OptionsResolver/composer.json | 30 - .../OptionsResolver/phpunit.xml.dist | 29 - .../Symfony/Component/Process/CHANGELOG.md | 11 - .../Process/Exception/ExceptionInterface.php | 21 - .../Exception/ProcessFailedException.php | 45 - .../Process/Exception/RuntimeException.php | 21 - .../Component/Process/ExecutableFinder.php | 89 - .../src/Symfony/Component/Process/LICENSE | 19 - .../Component/Process/PhpExecutableFinder.php | 62 - .../Symfony/Component/Process/PhpProcess.php | 78 - .../src/Symfony/Component/Process/Process.php | 749 --- .../Component/Process/ProcessBuilder.php | 135 - .../src/Symfony/Component/Process/README.md | 45 - .../Process/Tests/PhpExecutableFinderTest.php | 64 - .../Process/Tests/ProcessBuilderTest.php | 108 - .../Tests/ProcessFailedExceptionTest.php | 75 - .../Component/Process/Tests/ProcessTest.php | 202 - .../Process/Tests/ProcessTestHelper.php | 63 - .../Component/Process/Tests/bootstrap.php | 18 - .../Symfony/Component/Process/composer.json | 30 - .../Component/Process/phpunit.xml.dist | 28 - .../src/Symfony/Component/Routing/.gitignore | 2 - .../Component/Routing/Annotation/Route.php | 103 - .../Symfony/Component/Routing/CHANGELOG.md | 26 - .../Component/Routing/CompiledRoute.php | 134 - .../Routing/Exception/ExceptionInterface.php | 23 - .../Exception/InvalidParameterException.php | 23 - .../Exception/MethodNotAllowedException.php | 38 - .../MissingMandatoryParametersException.php | 24 - .../Exception/ResourceNotFoundException.php | 25 - .../Exception/RouteNotFoundException.php | 23 - .../Generator/Dumper/GeneratorDumper.php | 42 - .../Dumper/GeneratorDumperInterface.php | 41 - .../Generator/Dumper/PhpGeneratorDumper.php | 124 - .../Routing/Generator/UrlGenerator.php | 226 - .../Generator/UrlGeneratorInterface.php | 43 - .../src/Symfony/Component/Routing/LICENSE | 19 - .../Routing/Loader/AnnotationClassLoader.php | 204 - .../Loader/AnnotationDirectoryLoader.php | 77 - .../Routing/Loader/AnnotationFileLoader.php | 120 - .../Routing/Loader/ClosureLoader.php | 49 - .../Routing/Loader/PhpFileLoader.php | 59 - .../Routing/Loader/XmlFileLoader.php | 227 - .../Routing/Loader/YamlFileLoader.php | 141 - .../Loader/schema/routing/routing-1.0.xsd | 44 - .../Routing/Matcher/ApacheUrlMatcher.php | 76 - .../Matcher/Dumper/ApacheMatcherDumper.php | 164 - .../Routing/Matcher/Dumper/MatcherDumper.php | 42 - .../Matcher/Dumper/MatcherDumperInterface.php | 37 - .../Matcher/Dumper/PhpMatcherDumper.php | 293 - .../Matcher/RedirectableUrlMatcher.php | 61 - .../RedirectableUrlMatcherInterface.php | 35 - .../Matcher/RequestMatcherInterface.php | 39 - .../Routing/Matcher/TraceableUrlMatcher.php | 121 - .../Component/Routing/Matcher/UrlMatcher.php | 186 - .../Routing/Matcher/UrlMatcherInterface.php | 43 - .../src/Symfony/Component/Routing/README.md | 37 - .../Component/Routing/RequestContext.php | 262 - .../Routing/RequestContextAwareInterface.php | 36 - .../src/Symfony/Component/Routing/Route.php | 391 -- .../Component/Routing/RouteCollection.php | 344 -- .../Component/Routing/RouteCompiler.php | 134 - .../Routing/RouteCompilerInterface.php | 29 - .../src/Symfony/Component/Routing/Router.php | 253 - .../Component/Routing/RouterInterface.php | 32 - .../Routing/Tests/Annotation/RouteTest.php | 45 - .../Routing/Tests/CompiledRouteTest.php | 43 - .../AnnotatedClasses/AbstractClass.php | 16 - .../Fixtures/AnnotatedClasses/FooClass.php | 16 - .../Tests/Fixtures/CustomXmlFileLoader.php | 25 - .../Tests/Fixtures/RedirectableUrlMatcher.php | 30 - .../Routing/Tests/Fixtures/annotated.php | 0 .../Tests/Fixtures/dumper/url_matcher1.apache | 75 - .../Tests/Fixtures/dumper/url_matcher1.php | 239 - .../Tests/Fixtures/dumper/url_matcher2.apache | 7 - .../Tests/Fixtures/dumper/url_matcher2.php | 269 - .../Tests/Fixtures/dumper/url_matcher3.php | 45 - .../Routing/Tests/Fixtures/empty.yml | 0 .../Component/Routing/Tests/Fixtures/foo.xml | 0 .../Component/Routing/Tests/Fixtures/foo1.xml | 0 .../Routing/Tests/Fixtures/incomplete.yml | 2 - .../Routing/Tests/Fixtures/nonvalid.xml | 12 - .../Routing/Tests/Fixtures/nonvalid.yml | 1 - .../Routing/Tests/Fixtures/nonvalidkeys.yml | 3 - .../Routing/Tests/Fixtures/nonvalidnode.xml | 8 - .../Routing/Tests/Fixtures/nonvalidroute.xml | 13 - .../Routing/Tests/Fixtures/validpattern.php | 13 - .../Routing/Tests/Fixtures/validpattern.xml | 12 - .../Routing/Tests/Fixtures/validpattern.yml | 5 - .../Routing/Tests/Fixtures/validresource.xml | 12 - .../Routing/Tests/Fixtures/validresource.yml | 6 - .../Dumper/PhpGeneratorDumperTest.php | 117 - .../Tests/Generator/UrlGeneratorTest.php | 277 - .../Loader/AbstractAnnotationLoaderTest.php | 38 - .../Loader/AnnotationClassLoaderTest.php | 74 - .../Loader/AnnotationDirectoryLoaderTest.php | 50 - .../Tests/Loader/AnnotationFileLoaderTest.php | 50 - .../Tests/Loader/ClosureLoaderTest.php | 61 - .../Tests/Loader/PhpFileLoaderTest.php | 52 - .../Tests/Loader/XmlFileLoaderTest.php | 91 - .../Tests/Loader/YamlFileLoaderTest.php | 115 - .../Tests/Matcher/ApacheUrlMatcherTest.php | 109 - .../Dumper/ApacheMatcherDumperTest.php | 130 - .../Matcher/Dumper/PhpMatcherDumperTest.php | 202 - .../Matcher/RedirectableUrlMatcherTest.php | 58 - .../Tests/Matcher/TraceableUrlMatcherTest.php | 60 - .../Routing/Tests/Matcher/UrlMatcherTest.php | 245 - .../Routing/Tests/RouteCollectionTest.php | 291 - .../Routing/Tests/RouteCompilerTest.php | 136 - .../Component/Routing/Tests/RouteTest.php | 127 - .../Component/Routing/Tests/bootstrap.php | 22 - .../Symfony/Component/Routing/composer.json | 41 - .../Component/Routing/phpunit.xml.dist | 29 - .../src/Symfony/Component/Security/.gitignore | 2 - .../Security/Acl/Dbal/AclProvider.php | 637 -- .../Security/Acl/Dbal/MutableAclProvider.php | 881 --- .../Component/Security/Acl/Dbal/Schema.php | 154 - .../Component/Security/Acl/Domain/Acl.php | 665 --- .../Acl/Domain/AclCollectionCache.php | 64 - .../Security/Acl/Domain/AuditLogger.php | 51 - .../Security/Acl/Domain/DoctrineAclCache.php | 221 - .../Component/Security/Acl/Domain/Entry.php | 208 - .../Security/Acl/Domain/FieldEntry.php | 74 - .../Security/Acl/Domain/ObjectIdentity.php | 110 - .../ObjectIdentityRetrievalStrategy.php | 35 - .../Acl/Domain/PermissionGrantingStrategy.php | 207 - .../Acl/Domain/RoleSecurityIdentity.php | 73 - .../SecurityIdentityRetrievalStrategy.php | 79 - .../Acl/Domain/UserSecurityIdentity.php | 120 - .../Exception/AclAlreadyExistsException.php | 22 - .../Acl/Exception/AclNotFoundException.php | 22 - .../ConcurrentModificationException.php | 22 - .../Security/Acl/Exception/Exception.php | 21 - .../InvalidDomainObjectException.php | 22 - .../Acl/Exception/NoAceFoundException.php | 26 - .../Exception/NotAllAclsFoundException.php | 46 - .../Acl/Exception/SidNotLoadedException.php | 22 - .../Security/Acl/Model/AclCacheInterface.php | 64 - .../Security/Acl/Model/AclInterface.php | 106 - .../Acl/Model/AclProviderInterface.php | 49 - .../Acl/Model/AuditLoggerInterface.php | 29 - .../Acl/Model/AuditableAclInterface.php | 58 - .../Acl/Model/AuditableEntryInterface.php | 34 - .../Acl/Model/DomainObjectInterface.php | 29 - .../Security/Acl/Model/EntryInterface.php | 65 - .../Acl/Model/FieldEntryInterface.php | 27 - .../Acl/Model/MutableAclInterface.php | 159 - .../Acl/Model/MutableAclProviderInterface.php | 50 - .../Acl/Model/ObjectIdentityInterface.php | 49 - ...jectIdentityRetrievalStrategyInterface.php | 28 - .../PermissionGrantingStrategyInterface.php | 44 - .../Acl/Model/SecurityIdentityInterface.php | 30 - ...rityIdentityRetrievalStrategyInterface.php | 34 - .../Acl/Permission/BasicPermissionMap.php | 103 - .../Security/Acl/Permission/MaskBuilder.php | 201 - .../Acl/Permission/PermissionMapInterface.php | 40 - .../Acl/Resources/bin/generateSql.php | 51 - .../Security/Acl/Resources/schema/db2.sql | 43 - .../Security/Acl/Resources/schema/drizzle.sql | 21 - .../Security/Acl/Resources/schema/mssql.sql | 43 - .../Security/Acl/Resources/schema/mysql.sql | 21 - .../Security/Acl/Resources/schema/oracle.sql | 175 - .../Acl/Resources/schema/postgresql.sql | 43 - .../Security/Acl/Resources/schema/sqlite.sql | 31 - .../Component/Security/Acl/Voter/AclVoter.php | 143 - .../Security/Acl/Voter/FieldVote.php | 40 - .../Symfony/Component/Security/CHANGELOG.md | 27 - .../AuthenticationManagerInterface.php | 35 - .../AuthenticationProviderManager.php | 110 - .../AuthenticationTrustResolver.php | 73 - .../AuthenticationTrustResolverInterface.php | 53 - .../AnonymousAuthenticationProvider.php | 60 - .../AuthenticationProviderInterface.php | 35 - .../Provider/DaoAuthenticationProvider.php | 96 - ...PreAuthenticatedAuthenticationProvider.php | 84 - .../RememberMeAuthenticationProvider.php | 55 - .../Provider/UserAuthenticationProvider.php | 128 - .../RememberMe/InMemoryTokenProvider.php | 59 - .../RememberMe/PersistentToken.php | 107 - .../RememberMe/PersistentTokenInterface.php | 51 - .../RememberMe/TokenProviderInterface.php | 54 - .../Authentication/Token/AbstractToken.php | 279 - .../Authentication/Token/AnonymousToken.php | 74 - .../Token/PreAuthenticatedToken.php | 74 - .../Authentication/Token/RememberMeToken.php | 96 - .../Authentication/Token/TokenInterface.php | 127 - .../Token/UsernamePasswordToken.php | 91 - .../Security/Core/AuthenticationEvents.php | 19 - .../Authorization/AccessDecisionManager.php | 208 - .../AccessDecisionManagerInterface.php | 51 - .../Voter/AuthenticatedVoter.php | 94 - .../Voter/RoleHierarchyVoter.php | 41 - .../Core/Authorization/Voter/RoleVoter.php | 79 - .../Authorization/Voter/VoterInterface.php | 58 - .../Core/Encoder/BasePasswordEncoder.php | 91 - .../Security/Core/Encoder/EncoderFactory.php | 68 - .../Core/Encoder/EncoderFactoryInterface.php | 33 - .../Encoder/MessageDigestPasswordEncoder.php | 66 - .../Core/Encoder/PasswordEncoderInterface.php | 41 - .../Core/Encoder/PlaintextPasswordEncoder.php | 54 - .../Core/Event/AuthenticationEvent.php | 35 - .../Core/Event/AuthenticationFailureEvent.php | 37 - .../Core/Exception/AccessDeniedException.php | 25 - .../Exception/AccountExpiredException.php | 21 - .../Core/Exception/AccountStatusException.php | 22 - ...enticationCredentialsNotFoundException.php | 22 - .../Exception/AuthenticationException.php | 61 - .../AuthenticationServiceException.php | 21 - .../Exception/BadCredentialsException.php | 25 - .../Core/Exception/CookieTheftException.php | 22 - .../Exception/CredentialsExpiredException.php | 21 - .../Core/Exception/DisabledException.php | 21 - .../InsufficientAuthenticationException.php | 23 - .../Exception/InvalidCsrfTokenException.php | 21 - .../Core/Exception/LockedException.php | 21 - .../Core/Exception/LogoutException.php | 25 - .../Core/Exception/NonceExpiredException.php | 24 - .../Exception/ProviderNotFoundException.php | 22 - .../Exception/SessionUnavailableException.php | 27 - .../Core/Exception/TokenNotFoundException.php | 20 - .../Exception/UnsupportedUserException.php | 22 - .../Exception/UsernameNotFoundException.php | 21 - .../Component/Security/Core/Role/Role.php | 41 - .../Security/Core/Role/RoleHierarchy.php | 77 - .../Core/Role/RoleHierarchyInterface.php | 32 - .../Security/Core/Role/RoleInterface.php | 35 - .../Security/Core/Role/SwitchUserRole.php | 48 - .../Security/Core/SecurityContext.php | 94 - .../Core/SecurityContextInterface.php | 50 - .../Core/User/AdvancedUserInterface.php | 87 - .../Security/Core/User/ChainUserProvider.php | 88 - .../Security/Core/User/EquatableInterface.php | 37 - .../Core/User/InMemoryUserProvider.php | 97 - .../Component/Security/Core/User/User.php | 116 - .../Security/Core/User/UserChecker.php | 61 - .../Core/User/UserCheckerInterface.php | 36 - .../Security/Core/User/UserInterface.php | 87 - .../Core/User/UserProviderInterface.php | 76 - .../Security/Core/Util/ClassUtils.php | 55 - .../Validator/Constraint/UserPassword.php | 27 - .../Constraint/UserPasswordValidator.php | 46 - .../Component/Security/Http/AccessMap.php | 49 - .../Security/Http/AccessMapInterface.php | 33 - .../AuthenticationFailureHandlerInterface.php | 39 - .../AuthenticationSuccessHandlerInterface.php | 39 - .../DefaultAuthenticationFailureHandler.php | 87 - .../DefaultAuthenticationSuccessHandler.php | 111 - .../AccessDeniedHandlerInterface.php | 34 - .../AuthenticationEntryPointInterface.php | 34 - .../BasicAuthenticationEntryPoint.php | 41 - .../DigestAuthenticationEntryPoint.php | 74 - .../FormAuthenticationEntryPoint.php | 61 - .../RetryAuthenticationEntryPoint.php | 57 - .../Http/Event/InteractiveLoginEvent.php | 55 - .../Security/Http/Event/SwitchUserEvent.php | 39 - .../Component/Security/Http/Firewall.php | 71 - .../AbstractAuthenticationListener.php | 225 - .../AbstractPreAuthenticatedListener.php | 103 - .../Security/Http/Firewall/AccessListener.php | 73 - .../AnonymousAuthenticationListener.php | 55 - .../Firewall/BasicAuthenticationListener.php | 90 - .../Http/Firewall/ChannelListener.php | 71 - .../Http/Firewall/ContextListener.php | 163 - .../Firewall/DigestAuthenticationListener.php | 216 - .../Http/Firewall/ExceptionListener.php | 185 - .../Http/Firewall/ListenerInterface.php | 29 - .../Security/Http/Firewall/LogoutListener.php | 129 - .../Http/Firewall/RememberMeListener.php | 95 - .../Http/Firewall/SwitchUserListener.php | 183 - ...namePasswordFormAuthenticationListener.php | 93 - .../Firewall/X509AuthenticationListener.php | 47 - .../Component/Security/Http/FirewallMap.php | 43 - .../Security/Http/FirewallMapInterface.php | 38 - .../Component/Security/Http/HttpUtils.php | 141 - .../Logout/CookieClearingLogoutHandler.php | 50 - .../Logout/DefaultLogoutSuccessHandler.php | 47 - .../Http/Logout/LogoutHandlerInterface.php | 35 - .../Logout/LogoutSuccessHandlerInterface.php | 37 - .../Http/Logout/SessionLogoutHandler.php | 36 - .../RememberMe/AbstractRememberMeServices.php | 294 - ...PersistentTokenBasedRememberMeServices.php | 151 - .../RememberMeServicesInterface.php | 82 - .../TokenBasedRememberMeServices.php | 152 - .../Security/Http/SecurityEvents.php | 19 - .../Session/SessionAuthenticationStrategy.php | 63 - ...SessionAuthenticationStrategyInterface.php | 37 - .../src/Symfony/Component/Security/LICENSE | 19 - .../src/Symfony/Component/Security/README.md | 26 - .../Acl/Dbal/AclProviderBenchmarkTest.php | 271 - .../Tests/Acl/Dbal/AclProviderTest.php | 267 - .../Tests/Acl/Dbal/MutableAclProviderTest.php | 492 -- .../Security/Tests/Acl/Domain/AclTest.php | 521 -- .../Tests/Acl/Domain/AuditLoggerTest.php | 83 - .../Tests/Acl/Domain/DoctrineAclCacheTest.php | 108 - .../Security/Tests/Acl/Domain/EntryTest.php | 119 - .../Tests/Acl/Domain/FieldEntryTest.php | 74 - .../ObjectIdentityRetrievalStrategyTest.php | 41 - .../Tests/Acl/Domain/ObjectIdentityTest.php | 116 - .../Domain/PermissionGrantingStrategyTest.php | 192 - .../Acl/Domain/RoleSecurityIdentityTest.php | 55 - .../SecurityIdentityRetrievalStrategyTest.php | 196 - .../Acl/Domain/UserSecurityIdentityTest.php | 73 - .../Acl/Permission/BasicPermissionMapTest.php | 23 - .../Tests/Acl/Permission/MaskBuilderTest.php | 103 - .../Security/Tests/Acl/Voter/AclVoterTest.php | 405 -- .../AuthenticationProviderManagerTest.php | 138 - .../AuthenticationTrustResolverTest.php | 72 - .../AnonymousAuthenticationProviderTest.php | 66 - .../DaoAuthenticationProviderTest.php | 300 - ...uthenticatedAuthenticationProviderTest.php | 133 - .../RememberMeAuthenticationProviderTest.php | 111 - .../UserAuthenticationProviderTest.php | 206 - .../RememberMe/InMemoryTokenProviderTest.php | 63 - .../RememberMe/PersistentTokenTest.php | 29 - .../Token/AbstractTokenTest.php | 244 - .../Token/AnonymousTokenTest.php | 45 - .../Token/PreAuthenticatedTokenTest.php | 48 - .../Token/RememerMeTokenTest.php | 83 - .../Token/UsernamePasswordTokenTest.php | 58 - .../AccessDecisionManagerTest.php | 151 - .../Voter/AuthenticatedVoterTest.php | 78 - .../Voter/RoleHierarchyVoterTest.php | 36 - .../Authorization/Voter/RoleVoterTest.php | 62 - .../Core/Encoder/BasePasswordEncoderTest.php | 85 - .../Tests/Core/Encoder/EncoderFactoryTest.php | 94 - .../MessageDigestPasswordEncoderTest.php | 45 - .../Encoder/PlaintextPasswordEncoderTest.php | 39 - .../Tests/Core/Role/RoleHierarchyTest.php | 32 - .../Security/Tests/Core/Role/RoleTest.php | 24 - .../Tests/Core/Role/SwitchUserRoleTest.php | 31 - .../Tests/Core/SecurityContextTest.php | 92 - .../Tests/Core/User/AccountCheckerTest.php | 108 - .../Tests/Core/User/ChainUserProviderTest.php | 185 - .../Tests/Core/User/InMemoryProviderTest.php | 62 - .../Security/Tests/Core/User/UserTest.php | 126 - .../Tests/Core/Util/ClassUtilsTest.php | 41 - .../BasicAuthenticationEntryPointTest.php | 52 - .../DigestAuthenticationEntryPointTest.php | 66 - .../FormAuthenticationEntryPointTest.php | 75 - .../RetryAuthenticationEntryPointTest.php | 71 - .../Http/Firewall/AccessListenerTest.php | 223 - .../AnonymousAuthenticationListenerTest.php | 62 - .../BasicAuthenticationListenerTest.php | 198 - .../Http/Firewall/ChannelListenerTest.php | 196 - .../Http/Firewall/ContextListenerTest.php | 128 - .../Http/Firewall/LogoutListenerTest.php | 258 - .../Http/Firewall/RememberMeListenerTest.php | 199 - .../Security/Tests/Http/FirewallMapTest.php | 128 - .../Security/Tests/Http/FirewallTest.php | 123 - .../Security/Tests/Http/HttpUtilsTest.php | 151 - .../CookieClearingLogoutHandlerTest.php | 56 - .../Http/Logout/SessionLogoutHandlerTest.php | 47 - .../AbstractRememberMeServicesTest.php | 268 - ...istentTokenBasedRememberMeServicesTest.php | 335 -- .../TokenBasedRememberMeServicesTest.php | 280 - .../Component/Security/Tests/bootstrap.php | 22 - .../Symfony/Component/Security/composer.json | 48 - .../Component/Security/phpunit.xml.dist | 29 - .../Symfony/Component/Serializer/CHANGELOG.md | 44 - .../Serializer/Encoder/ChainDecoder.php | 82 - .../Serializer/Encoder/ChainEncoder.php | 105 - .../Serializer/Encoder/DecoderInterface.php | 38 - .../Serializer/Encoder/EncoderInterface.php | 38 - .../Serializer/Encoder/JsonDecode.php | 65 - .../Serializer/Encoder/JsonEncode.php | 63 - .../Serializer/Encoder/JsonEncoder.php | 90 - .../Encoder/NormalizationAwareInterface.php | 24 - .../Encoder/SerializerAwareEncoder.php | 33 - .../Serializer/Encoder/XmlEncoder.php | 383 -- .../Serializer/Exception/Exception.php | 21 - .../Exception/InvalidArgumentException.php | 21 - .../Serializer/Exception/LogicException.php | 21 - .../Serializer/Exception/RuntimeException.php | 21 - .../Exception/UnexpectedValueException.php | 21 - .../Exception/UnsupportedException.php | 21 - .../src/Symfony/Component/Serializer/LICENSE | 19 - .../Normalizer/CustomNormalizer.php | 64 - .../Normalizer/DenormalizableInterface.php | 37 - .../Normalizer/DenormalizerInterface.php | 40 - .../Normalizer/GetSetMethodNormalizer.php | 190 - .../Normalizer/NormalizableInterface.php | 37 - .../Normalizer/NormalizerInterface.php | 38 - .../Normalizer/SerializerAwareNormalizer.php | 36 - .../Symfony/Component/Serializer/README.md | 13 - .../Component/Serializer/Serializer.php | 291 - .../Serializer/SerializerAwareInterface.php | 29 - .../Serializer/SerializerInterface.php | 38 - .../Tests/Encoder/XmlEncoderTest.php | 285 - .../Tests/Fixtures/DenormalizableDummy.php | 25 - .../Serializer/Tests/Fixtures/Dummy.php | 43 - .../Fixtures/NormalizableTraversableDummy.php | 36 - .../Serializer/Tests/Fixtures/ScalarDummy.php | 37 - .../Tests/Fixtures/TraversableDummy.php | 23 - .../Tests/Normalizer/CustomNormalizerTest.php | 58 - .../Normalizer/GetSetMethodNormalizerTest.php | 220 - .../Serializer/Tests/SerializerTest.php | 227 - .../Component/Serializer/Tests/bootstrap.php | 18 - .../Component/Serializer/composer.json | 30 - .../Component/Serializer/phpunit.xml.dist | 29 - .../Component/Templating/Asset/Package.php | 71 - .../Templating/Asset/PackageInterface.php | 36 - .../Templating/Asset/PathPackage.php | 70 - .../Component/Templating/Asset/UrlPackage.php | 77 - .../Symfony/Component/Templating/CHANGELOG.md | 8 - .../Templating/DebuggerInterface.php | 28 - .../Component/Templating/DelegatingEngine.php | 145 - .../Component/Templating/EngineInterface.php | 70 - .../Templating/Helper/AssetsHelper.php | 50 - .../Templating/Helper/CoreAssetsHelper.php | 128 - .../Component/Templating/Helper/Helper.php | 51 - .../Templating/Helper/HelperInterface.php | 49 - .../Templating/Helper/SlotsHelper.php | 147 - .../src/Symfony/Component/Templating/LICENSE | 19 - .../Templating/Loader/CacheLoader.php | 95 - .../Templating/Loader/ChainLoader.php | 83 - .../Templating/Loader/FilesystemLoader.php | 125 - .../Component/Templating/Loader/Loader.php | 34 - .../Templating/Loader/LoaderInterface.php | 47 - .../Component/Templating/PhpEngine.php | 566 -- .../Symfony/Component/Templating/README.md | 16 - .../Templating/Storage/FileStorage.php | 34 - .../Component/Templating/Storage/Storage.php | 55 - .../Templating/Storage/StringStorage.php | 34 - .../Templating/StreamingEngineInterface.php | 32 - .../Templating/TemplateNameParser.php | 51 - .../TemplateNameParserInterface.php | 34 - .../Templating/TemplateReference.php | 120 - .../Templating/TemplateReferenceInterface.php | 80 - .../Fixtures/ProjectTemplateDebugger.php | 40 - .../Tests/Fixtures/SimpleHelper.php | 34 - .../Tests/Fixtures/templates/foo.php | 1 - .../Tests/Helper/AssetsHelperTest.php | 65 - .../Tests/Helper/CoreAssetsHelperTest.php | 54 - .../Templating/Tests/Helper/HelperTest.php | 32 - .../Tests/Helper/SlotsHelperTest.php | 80 - .../Tests/Loader/CacheLoaderTest.php | 82 - .../Tests/Loader/ChainLoaderTest.php | 63 - .../Tests/Loader/FilesystemLoaderTest.php | 85 - .../Templating/Tests/Loader/LoaderTest.php | 43 - .../Templating/Tests/PhpEngineTest.php | 196 - .../Tests/Storage/FileStorageTest.php | 26 - .../Templating/Tests/Storage/StorageTest.php | 30 - .../Tests/Storage/StringStorageTest.php | 26 - .../Tests/TemplateNameParserTest.php | 50 - .../Component/Templating/Tests/bootstrap.php | 18 - .../Component/Templating/composer.json | 30 - .../Component/Templating/phpunit.xml.dist | 29 - .../Symfony/Component/Translation/.gitignore | 2 - .../Component/Translation/CHANGELOG.md | 10 - .../Translation/Dumper/CsvFileDumper.php | 63 - .../Translation/Dumper/DumperInterface.php | 31 - .../Translation/Dumper/FileDumper.php | 62 - .../Translation/Dumper/IcuResFileDumper.php | 135 - .../Translation/Dumper/IniFileDumper.php | 45 - .../Translation/Dumper/MoFileDumper.php | 82 - .../Translation/Dumper/PhpFileDumper.php | 40 - .../Translation/Dumper/PoFileDumper.php | 55 - .../Translation/Dumper/QtFileDumper.php | 50 - .../Translation/Dumper/XliffFileDumper.php | 60 - .../Translation/Dumper/YamlFileDumper.php | 39 - .../Translation/Extractor/ChainExtractor.php | 60 - .../Extractor/ExtractorInterface.php | 38 - .../Translation/IdentityTranslator.php | 74 - .../Component/Translation/Interval.php | 103 - .../src/Symfony/Component/Translation/LICENSE | 19 - .../Translation/Loader/ArrayLoader.php | 70 - .../Translation/Loader/CsvFileLoader.php | 86 - .../Translation/Loader/IcuDatFileLoader.php | 44 - .../Translation/Loader/IcuResFileLoader.php | 74 - .../Translation/Loader/IniFileLoader.php | 39 - .../Translation/Loader/LoaderInterface.php | 37 - .../Translation/Loader/MoFileLoader.php | 174 - .../Translation/Loader/PhpFileLoader.php | 43 - .../Translation/Loader/PoFileLoader.php | 168 - .../Loader/QtTranslationsLoader.php | 85 - .../Translation/Loader/XliffFileLoader.php | 116 - .../Translation/Loader/YamlFileLoader.php | 50 - .../dic/xliff-core/xliff-core-1.2-strict.xsd | 2223 ------- .../Loader/schema/dic/xliff-core/xml.xsd | 309 - .../Translation/MessageCatalogue.php | 234 - .../Translation/MessageCatalogueInterface.php | 172 - .../Component/Translation/MessageSelector.php | 82 - .../Translation/PluralizationRules.php | 217 - .../Symfony/Component/Translation/README.md | 38 - .../Tests/Dumper/CsvFileDumperTest.php | 33 - .../Tests/Dumper/IcuResFileDumperTest.php | 37 - .../Tests/Dumper/IniFileDumperTest.php | 32 - .../Tests/Dumper/MoFileDumperTest.php | 31 - .../Tests/Dumper/PhpFileDumperTest.php | 32 - .../Tests/Dumper/PoFileDumperTest.php | 31 - .../Tests/Dumper/QtFileDumperTest.php | 32 - .../Tests/Dumper/XliffFileDumperTest.php | 32 - .../Tests/Dumper/YamlFileDumperTest.php | 39 - .../Tests/IdentityTranslatorTest.php | 61 - .../Translation/Tests/IntervalTest.php | 48 - .../Tests/Loader/CsvFileLoaderTest.php | 67 - .../Tests/Loader/IcuDatFileLoaderTest.php | 64 - .../Tests/Loader/IcuResFileLoaderTest.php | 51 - .../Tests/Loader/IniFileLoaderTest.php | 57 - .../Tests/Loader/LocalizedTestCase.php | 22 - .../Tests/Loader/MoFileLoaderTest.php | 57 - .../Tests/Loader/PhpFileLoaderTest.php | 46 - .../Tests/Loader/PoFileLoaderTest.php | 69 - .../Tests/Loader/QtTranslationsLoaderTest.php | 36 - .../Tests/Loader/XliffFileLoaderTest.php | 72 - .../Tests/Loader/YamlFileLoaderTest.php | 61 - .../Tests/MessageCatalogueTest.php | 173 - .../Translation/Tests/MessageSelectorTest.php | 72 - .../Tests/PluralizationRulesTest.php | 124 - .../Translation/Tests/TranslatorTest.php | 248 - .../Component/Translation/Tests/bootstrap.php | 22 - .../Tests/fixtures/empty-translation.po | 3 - .../Translation/Tests/fixtures/empty.csv | 0 .../Translation/Tests/fixtures/empty.ini | 0 .../Translation/Tests/fixtures/empty.mo | 0 .../Translation/Tests/fixtures/empty.po | 0 .../Translation/Tests/fixtures/empty.yml | 0 .../Translation/Tests/fixtures/non-valid.xlf | 11 - .../Translation/Tests/fixtures/non-valid.yml | 1 - .../Translation/Tests/fixtures/plurals.mo | Bin 74 -> 0 bytes .../Translation/Tests/fixtures/plurals.po | 5 - .../Tests/fixtures/resourcebundle/dat/en.res | Bin 120 -> 0 bytes .../Tests/fixtures/resourcebundle/dat/en.txt | 3 - .../Tests/fixtures/resourcebundle/dat/fr.res | Bin 124 -> 0 bytes .../Tests/fixtures/resourcebundle/dat/fr.txt | 3 - .../resourcebundle/dat/packagelist.txt | 2 - .../fixtures/resourcebundle/dat/resources.dat | Bin 352 -> 0 bytes .../Tests/fixtures/resourcebundle/res/en.res | Bin 84 -> 0 bytes .../Tests/fixtures/resourcebundle/res/en.txt | 3 - .../Tests/fixtures/resources-clean.xlf | 15 - .../Translation/Tests/fixtures/resources.csv | 4 - .../Translation/Tests/fixtures/resources.ini | 1 - .../Translation/Tests/fixtures/resources.mo | Bin 52 -> 0 bytes .../Translation/Tests/fixtures/resources.php | 5 - .../Translation/Tests/fixtures/resources.po | 2 - .../Translation/Tests/fixtures/resources.ts | 10 - .../Translation/Tests/fixtures/resources.xlf | 18 - .../Translation/Tests/fixtures/resources.yml | 1 - .../Translation/Tests/fixtures/valid.csv | 4 - .../Component/Translation/Translator.php | 212 - .../Translation/TranslatorInterface.php | 69 - .../Translation/Writer/TranslationWriter.php | 71 - .../Component/Translation/composer.json | 38 - .../Component/Translation/phpunit.xml.dist | 29 - .../Symfony/Component/Validator/.gitignore | 2 - .../Symfony/Component/Validator/CHANGELOG.md | 28 - .../Component/Validator/Constraint.php | 220 - .../Validator/ConstraintValidator.php | 111 - .../Validator/ConstraintValidatorFactory.php | 41 - .../ConstraintValidatorFactoryInterface.php | 31 - .../ConstraintValidatorInterface.php | 37 - .../Validator/ConstraintViolation.php | 127 - .../Validator/ConstraintViolationList.php | 196 - .../Component/Validator/Constraints/All.php | 57 - .../Validator/Constraints/AllValidator.php | 48 - .../Component/Validator/Constraints/Blank.php | 24 - .../Validator/Constraints/BlankValidator.php | 33 - .../Validator/Constraints/Callback.php | 48 - .../Constraints/CallbackValidator.php | 61 - .../Validator/Constraints/Choice.php | 41 - .../Validator/Constraints/ChoiceValidator.php | 83 - .../Validator/Constraints/Collection.php | 74 - .../Constraints/Collection/Optional.php | 27 - .../Constraints/Collection/Required.php | 27 - .../Constraints/CollectionValidator.php | 70 - .../Component/Validator/Constraints/Count.php | 45 - .../Validator/Constraints/CountValidator.php | 63 - .../Validator/Constraints/Country.php | 24 - .../Constraints/CountryValidator.php | 46 - .../Component/Validator/Constraints/Date.php | 24 - .../Validator/Constraints/DateTime.php | 24 - .../Constraints/DateTimeValidator.php | 22 - .../Validator/Constraints/DateValidator.php | 46 - .../Component/Validator/Constraints/Email.php | 26 - .../Validator/Constraints/EmailValidator.php | 85 - .../Component/Validator/Constraints/False.php | 24 - .../Validator/Constraints/FalseValidator.php | 35 - .../Component/Validator/Constraints/File.php | 38 - .../Validator/Constraints/FileValidator.php | 158 - .../Validator/Constraints/GroupSequence.php | 34 - .../Constraints/GroupSequenceProvider.php | 22 - .../Component/Validator/Constraints/Image.php | 33 - .../Validator/Constraints/ImageValidator.php | 113 - .../Component/Validator/Constraints/Ip.php | 80 - .../Validator/Constraints/IpValidator.php | 97 - .../Validator/Constraints/Language.php | 24 - .../Constraints/LanguageValidator.php | 46 - .../Validator/Constraints/Length.php | 46 - .../Validator/Constraints/LengthValidator.php | 71 - .../Validator/Constraints/Locale.php | 24 - .../Validator/Constraints/LocaleValidator.php | 46 - .../Component/Validator/Constraints/Max.php | 44 - .../Validator/Constraints/MaxLength.php | 44 - .../Constraints/MaxLengthValidator.php | 57 - .../Validator/Constraints/MaxValidator.php | 51 - .../Component/Validator/Constraints/Min.php | 44 - .../Validator/Constraints/MinLength.php | 44 - .../Constraints/MinLengthValidator.php | 57 - .../Validator/Constraints/MinValidator.php | 56 - .../Validator/Constraints/NotBlank.php | 24 - .../Constraints/NotBlankValidator.php | 33 - .../Validator/Constraints/NotNull.php | 24 - .../Constraints/NotNullValidator.php | 33 - .../Component/Validator/Constraints/Null.php | 24 - .../Validator/Constraints/NullValidator.php | 33 - .../Component/Validator/Constraints/Range.php | 38 - .../Validator/Constraints/RangeValidator.php | 55 - .../Component/Validator/Constraints/Regex.php | 86 - .../Validator/Constraints/RegexValidator.php | 47 - .../Component/Validator/Constraints/Time.php | 24 - .../Validator/Constraints/TimeValidator.php | 46 - .../Component/Validator/Constraints/True.php | 24 - .../Validator/Constraints/TrueValidator.php | 37 - .../Component/Validator/Constraints/Type.php | 41 - .../Validator/Constraints/TypeValidator.php | 51 - .../Component/Validator/Constraints/Url.php | 25 - .../Validator/Constraints/UrlValidator.php | 61 - .../Component/Validator/Constraints/Valid.php | 36 - .../ConstraintDefinitionException.php | 16 - .../Exception/GroupDefinitionException.php | 16 - .../Exception/InvalidOptionsException.php | 29 - .../Validator/Exception/MappingException.php | 16 - .../Exception/MissingOptionsException.php | 29 - .../Exception/UnexpectedTypeException.php | 20 - .../Exception/ValidatorException.php | 16 - .../Component/Validator/ExecutionContext.php | 187 - .../Validator/GlobalExecutionContext.php | 76 - .../Component/Validator/GraphWalker.php | 184 - .../GroupSequenceProviderInterface.php | 26 - .../src/Symfony/Component/Validator/LICENSE | 19 - .../Mapping/BlackholeMetadataFactory.php | 25 - .../Validator/Mapping/Cache/ApcCache.php | 51 - .../Mapping/Cache/CacheInterface.php | 45 - .../Validator/Mapping/ClassMetadata.php | 330 -- .../Mapping/ClassMetadataFactory.php | 79 - .../Mapping/ClassMetadataFactoryInterface.php | 17 - .../Validator/Mapping/ElementMetadata.php | 98 - .../Validator/Mapping/GetterMetadata.php | 55 - .../Mapping/Loader/AbstractLoader.php | 65 - .../Mapping/Loader/AnnotationLoader.php | 81 - .../Validator/Mapping/Loader/FileLoader.php | 40 - .../Validator/Mapping/Loader/FilesLoader.php | 61 - .../Validator/Mapping/Loader/LoaderChain.php | 62 - .../Mapping/Loader/LoaderInterface.php | 26 - .../Mapping/Loader/StaticMethodLoader.php | 51 - .../Mapping/Loader/XmlFileLoader.php | 215 - .../Mapping/Loader/XmlFilesLoader.php | 30 - .../Mapping/Loader/YamlFileLoader.php | 124 - .../Mapping/Loader/YamlFilesLoader.php | 30 - .../constraint-mapping-1.0.xsd | 147 - .../Validator/Mapping/MemberMetadata.php | 202 - .../Validator/Mapping/PropertyMetadata.php | 51 - .../Validator/ObjectInitializerInterface.php | 34 - .../src/Symfony/Component/Validator/README.md | 55 - .../Resources/translations/validators.ca.xlf | 187 - .../Resources/translations/validators.cs.xlf | 219 - .../Resources/translations/validators.da.xlf | 207 - .../Resources/translations/validators.de.xlf | 187 - .../Resources/translations/validators.en.xlf | 219 - .../Resources/translations/validators.es.xlf | 187 - .../Resources/translations/validators.et.xlf | 131 - .../Resources/translations/validators.eu.xlf | 155 - .../Resources/translations/validators.fa.xlf | 155 - .../Resources/translations/validators.fi.xlf | 131 - .../Resources/translations/validators.fr.xlf | 219 - .../Resources/translations/validators.he.xlf | 219 - .../Resources/translations/validators.hr.xlf | 207 - .../Resources/translations/validators.hu.xlf | 207 - .../Resources/translations/validators.hy.xlf | 187 - .../Resources/translations/validators.id.xlf | 187 - .../Resources/translations/validators.it.xlf | 219 - .../Resources/translations/validators.ja.xlf | 151 - .../Resources/translations/validators.lb.xlf | 131 - .../Resources/translations/validators.lt.xlf | 155 - .../Resources/translations/validators.mn.xlf | 151 - .../Resources/translations/validators.nb.xlf | 155 - .../Resources/translations/validators.nl.xlf | 219 - .../Resources/translations/validators.pl.xlf | 219 - .../Resources/translations/validators.pt.xlf | 219 - .../translations/validators.pt_BR.xlf | 219 - .../Resources/translations/validators.ro.xlf | 207 - .../Resources/translations/validators.ru.xlf | 219 - .../Resources/translations/validators.sk.xlf | 207 - .../Resources/translations/validators.sl.xlf | 219 - .../translations/validators.sr_Cyrl.xlf | 219 - .../translations/validators.sr_Latn.xlf | 219 - .../Resources/translations/validators.sv.xlf | 119 - .../Resources/translations/validators.ua.xlf | 151 - .../translations/validators.zh_CN.xlf | 179 - .../Validator/Tests/ConstraintTest.php | 131 - .../Tests/ConstraintValidatorTest.php | 60 - .../Tests/ConstraintViolationListTest.php | 134 - .../Tests/ConstraintViolationTest.php | 35 - .../Validator/Tests/Constraints/AllTest.php | 41 - .../Tests/Constraints/AllValidatorTest.php | 121 - .../Tests/Constraints/BlankValidatorTest.php | 78 - .../Constraints/CallbackValidatorTest.php | 156 - .../Tests/Constraints/ChoiceValidatorTest.php | 296 - .../Tests/Constraints/CollectionTest.php | 73 - .../CollectionValidatorArrayObjectTest.php | 20 - .../CollectionValidatorArrayTest.php | 20 - ...llectionValidatorCustomArrayObjectTest.php | 78 - .../Constraints/CollectionValidatorTest.php | 419 -- .../Constraints/CountValidatorArrayTest.php | 23 - .../CountValidatorCountableTest.php | 38 - .../Tests/Constraints/CountValidatorTest.php | 195 - .../Constraints/CountryValidatorTest.php | 114 - .../Constraints/DateTimeValidatorTest.php | 120 - .../Tests/Constraints/DateValidatorTest.php | 116 - .../Tests/Constraints/EmailValidatorTest.php | 106 - .../Tests/Constraints/FalseValidatorTest.php | 63 - .../Constraints/FileValidatorObjectTest.php | 22 - .../Constraints/FileValidatorPathTest.php | 37 - .../Tests/Constraints/FileValidatorTest.php | 329 - .../Tests/Constraints/Fixtures/test.gif | Bin 801 -> 0 bytes .../Tests/Constraints/ImageValidatorTest.php | 226 - .../Tests/Constraints/IpValidatorTest.php | 478 -- .../Constraints/LanguageValidatorTest.php | 114 - .../Tests/Constraints/LengthValidatorTest.php | 233 - .../Tests/Constraints/LocaleValidatorTest.php | 115 - .../Tests/Constraints/LocalizedTestCase.php | 22 - .../Constraints/MaxLengthValidatorTest.php | 127 - .../Tests/Constraints/MaxValidatorTest.php | 111 - .../Constraints/MinLengthValidatorTest.php | 127 - .../Tests/Constraints/MinValidatorTest.php | 105 - .../Constraints/NotBlankValidatorTest.php | 108 - .../Constraints/NotNullValidatorTest.php | 69 - .../Tests/Constraints/NullValidatorTest.php | 70 - .../Tests/Constraints/RangeValidatorTest.php | 237 - .../Tests/Constraints/RegexValidatorTest.php | 167 - .../Tests/Constraints/TimeValidatorTest.php | 117 - .../Tests/Constraints/TrueValidatorTest.php | 64 - .../Tests/Constraints/TypeValidatorTest.php | 183 - .../Tests/Constraints/UrlValidatorTest.php | 168 - .../Validator/Tests/Constraints/ValidTest.php | 28 - .../Validator/Tests/ExecutionContextTest.php | 250 - .../Tests/Fixtures/ClassConstraint.php | 22 - .../Validator/Tests/Fixtures/ConstraintA.php | 31 - .../Tests/Fixtures/ConstraintAValidator.php | 39 - .../Validator/Tests/Fixtures/ConstraintB.php | 23 - .../Validator/Tests/Fixtures/ConstraintC.php | 30 - .../Validator/Tests/Fixtures/Entity.php | 56 - .../Tests/Fixtures/EntityInterface.php | 16 - .../Validator/Tests/Fixtures/EntityParent.php | 25 - .../Tests/Fixtures/FailingConstraint.php | 24 - .../Fixtures/FailingConstraintValidator.php | 25 - .../Fixtures/FakeClassMetadataFactory.php | 34 - .../Validator/Tests/Fixtures/FilesLoader.php | 39 - .../Fixtures/GroupSequenceProviderEntity.php | 36 - .../Tests/Fixtures/InvalidConstraint.php | 16 - .../Fixtures/InvalidConstraintValidator.php | 14 - .../Tests/Fixtures/PropertyConstraint.php | 22 - .../Validator/Tests/Fixtures/Reference.php | 16 - .../Tests/GlobalExecutionContextTest.php | 63 - .../Validator/Tests/GraphWalkerTest.php | 539 -- .../Tests/Mapping/Cache/ApcCacheTest.php | 78 - .../Mapping/ClassMetadataFactoryTest.php | 119 - .../Tests/Mapping/ClassMetadataTest.php | 225 - .../Tests/Mapping/ElementMetadataTest.php | 73 - .../Tests/Mapping/GetterMetadataTest.php | 38 - .../Mapping/Loader/AnnotationLoaderTest.php | 157 - .../Tests/Mapping/Loader/FilesLoaderTest.php | 48 - .../Tests/Mapping/Loader/LoaderChainTest.php | 84 - .../Mapping/Loader/StaticMethodLoaderTest.php | 80 - .../Mapping/Loader/XmlFileLoaderTest.php | 82 - .../Mapping/Loader/YamlFileLoaderTest.php | 107 - .../Mapping/Loader/constraint-mapping.xml | 87 - .../Mapping/Loader/constraint-mapping.yml | 45 - .../Tests/Mapping/Loader/empty-mapping.yml | 0 .../Tests/Mapping/Loader/nonvalid-mapping.yml | 1 - .../Tests/Mapping/MemberMetadataTest.php | 83 - .../Tests/Mapping/PropertyMetadataTest.php | 35 - .../Validator/Tests/ValidatorContextTest.php | 61 - .../Validator/Tests/ValidatorFactoryTest.php | 178 - .../Validator/Tests/ValidatorTest.php | 223 - .../Component/Validator/Tests/bootstrap.php | 34 - .../Symfony/Component/Validator/Validator.php | 143 - .../Component/Validator/ValidatorContext.php | 85 - .../Validator/ValidatorContextInterface.php | 53 - .../Component/Validator/ValidatorFactory.php | 203 - .../Validator/ValidatorInterface.php | 85 - .../Symfony/Component/Validator/composer.json | 40 - .../Component/Validator/phpunit.xml.dist | 29 - .../src/Symfony/Component/Yaml/CHANGELOG.md | 8 - .../src/Symfony/Component/Yaml/Dumper.php | 54 - .../src/Symfony/Component/Yaml/Escaper.php | 88 - .../Yaml/Exception/DumpException.php | 23 - .../Yaml/Exception/ExceptionInterface.php | 23 - .../Yaml/Exception/ParseException.php | 143 - .../src/Symfony/Component/Yaml/Inline.php | 424 -- .../src/Symfony/Component/Yaml/LICENSE | 19 - .../src/Symfony/Component/Yaml/Parser.php | 620 -- .../src/Symfony/Component/Yaml/README.md | 17 - .../Component/Yaml/Tests/DumperTest.php | 166 - .../Yaml/Tests/Fixtures/YtsAnchorAlias.yml | 31 - .../Yaml/Tests/Fixtures/YtsBasicTests.yml | 178 - .../Yaml/Tests/Fixtures/YtsBlockMapping.yml | 51 - .../Tests/Fixtures/YtsDocumentSeparator.yml | 85 - .../Yaml/Tests/Fixtures/YtsErrorTests.yml | 25 - .../Tests/Fixtures/YtsFlowCollections.yml | 60 - .../Yaml/Tests/Fixtures/YtsFoldedScalars.yml | 176 - .../Tests/Fixtures/YtsNullsAndEmpties.yml | 45 - .../Fixtures/YtsSpecificationExamples.yml | 1695 ------ .../Yaml/Tests/Fixtures/YtsTypeTransfers.yml | 244 - .../Yaml/Tests/Fixtures/embededPhp.yml | 1 - .../Yaml/Tests/Fixtures/escapedCharacters.yml | 139 - .../Component/Yaml/Tests/Fixtures/index.yml | 18 - .../Yaml/Tests/Fixtures/sfComments.yml | 51 - .../Yaml/Tests/Fixtures/sfCompact.yml | 159 - .../Yaml/Tests/Fixtures/sfMergeKey.yml | 27 - .../Yaml/Tests/Fixtures/sfObjects.yml | 11 - .../Yaml/Tests/Fixtures/sfQuotes.yml | 33 - .../Component/Yaml/Tests/Fixtures/sfTests.yml | 135 - .../Tests/Fixtures/unindentedCollections.yml | 62 - .../Component/Yaml/Tests/InlineTest.php | 211 - .../Component/Yaml/Tests/ParserTest.php | 193 - .../Symfony/Component/Yaml/Tests/YamlTest.php | 41 - .../Component/Yaml/Tests/bootstrap.php | 18 - .../src/Symfony/Component/Yaml/Unescaper.php | 145 - .../src/Symfony/Component/Yaml/Yaml.php | 111 - .../src/Symfony/Component/Yaml/composer.json | 30 - .../Symfony/Component/Yaml/phpunit.xml.dist | 29 - vendor/twig/extensions/.gitignore | 2 - vendor/twig/extensions/LICENSE | 19 - vendor/twig/extensions/README | 7 - vendor/twig/extensions/composer.json | 20 - vendor/twig/extensions/doc/debug.rst | 30 - vendor/twig/extensions/doc/i18n.rst | 156 - vendor/twig/extensions/doc/index.rst | 18 - vendor/twig/extensions/doc/text.rst | 8 - .../lib/Twig/Extensions/Autoloader.php | 46 - .../lib/Twig/Extensions/Extension/Debug.php | 34 - .../lib/Twig/Extensions/Extension/I18n.php | 44 - .../lib/Twig/Extensions/Extension/Intl.php | 70 - .../lib/Twig/Extensions/Extension/Text.php | 109 - .../lib/Twig/Extensions/Grammar.php | 30 - .../lib/Twig/Extensions/Grammar/Arguments.php | 22 - .../lib/Twig/Extensions/Grammar/Array.php | 22 - .../lib/Twig/Extensions/Grammar/Body.php | 39 - .../lib/Twig/Extensions/Grammar/Boolean.php | 24 - .../lib/Twig/Extensions/Grammar/Constant.php | 37 - .../Twig/Extensions/Grammar/Expression.php | 22 - .../lib/Twig/Extensions/Grammar/Hash.php | 22 - .../lib/Twig/Extensions/Grammar/Number.php | 24 - .../lib/Twig/Extensions/Grammar/Optional.php | 69 - .../lib/Twig/Extensions/Grammar/Switch.php | 24 - .../lib/Twig/Extensions/Grammar/Tag.php | 56 - .../lib/Twig/Extensions/GrammarInterface.php | 18 - .../lib/Twig/Extensions/Node/Debug.php | 69 - .../lib/Twig/Extensions/Node/Trans.php | 133 - .../lib/Twig/Extensions/SimpleTokenParser.php | 132 - .../lib/Twig/Extensions/TokenParser/Debug.php | 42 - .../lib/Twig/Extensions/TokenParser/Trans.php | 80 - vendor/twig/extensions/phpunit.xml.dist | 30 - .../test/Twig/Tests/Grammar/ArgumentsTest.php | 19 - .../test/Twig/Tests/Grammar/ArrayTest.php | 19 - .../test/Twig/Tests/Grammar/BodyTest.php | 19 - .../test/Twig/Tests/Grammar/BooleanTest.php | 19 - .../test/Twig/Tests/Grammar/ConstantTest.php | 19 - .../Twig/Tests/Grammar/ExpressionTest.php | 19 - .../test/Twig/Tests/Grammar/NumberTest.php | 19 - .../test/Twig/Tests/Grammar/OptionalTest.php | 19 - .../test/Twig/Tests/Grammar/TagTest.php | 23 - .../test/Twig/Tests/Node/DebugTest.php | 67 - .../test/Twig/Tests/Node/TransTest.php | 93 - .../test/Twig/Tests/SimpleTokenParser.php | 48 - .../test/Twig/Tests/SimpleTokenParserTest.php | 112 - .../test/Twig/Tests/grammarTest.php | 63 - vendor/twig/extensions/test/bootstrap.php | 20 - vendor/twig/twig/.travis.yml | 14 - vendor/twig/twig/AUTHORS | 9 - vendor/twig/twig/CHANGELOG | 538 -- vendor/twig/twig/LICENSE | 31 - vendor/twig/twig/README.markdown | 17 - vendor/twig/twig/bin/create_pear_package.php | 42 - vendor/twig/twig/composer.json | 31 - vendor/twig/twig/doc/advanced.rst | 835 --- vendor/twig/twig/doc/api.rst | 510 -- vendor/twig/twig/doc/coding_standards.rst | 101 - vendor/twig/twig/doc/filters/abs.rst | 18 - vendor/twig/twig/doc/filters/capitalize.rst | 11 - .../twig/doc/filters/convert_encoding.rst | 22 - vendor/twig/twig/doc/filters/date.rst | 65 - vendor/twig/twig/doc/filters/date_modify.rst | 18 - vendor/twig/twig/doc/filters/default.rst | 28 - vendor/twig/twig/doc/filters/escape.rst | 60 - vendor/twig/twig/doc/filters/format.rst | 16 - vendor/twig/twig/doc/filters/index.rst | 30 - vendor/twig/twig/doc/filters/join.rst | 18 - vendor/twig/twig/doc/filters/json_encode.rst | 14 - vendor/twig/twig/doc/filters/keys.rst | 11 - vendor/twig/twig/doc/filters/length.rst | 12 - vendor/twig/twig/doc/filters/lower.rst | 10 - vendor/twig/twig/doc/filters/merge.rst | 41 - vendor/twig/twig/doc/filters/nl2br.rst | 22 - .../twig/twig/doc/filters/number_format.rst | 38 - vendor/twig/twig/doc/filters/raw.rst | 12 - vendor/twig/twig/doc/filters/replace.rst | 14 - vendor/twig/twig/doc/filters/reverse.rst | 23 - vendor/twig/twig/doc/filters/slice.rst | 57 - vendor/twig/twig/doc/filters/sort.rst | 17 - vendor/twig/twig/doc/filters/striptags.rst | 15 - vendor/twig/twig/doc/filters/title.rst | 11 - vendor/twig/twig/doc/filters/trim.rst | 24 - vendor/twig/twig/doc/filters/upper.rst | 10 - vendor/twig/twig/doc/filters/url_encode.rst | 14 - vendor/twig/twig/doc/functions/attribute.rst | 18 - vendor/twig/twig/doc/functions/block.rst | 15 - vendor/twig/twig/doc/functions/constant.rst | 9 - vendor/twig/twig/doc/functions/cycle.rst | 20 - vendor/twig/twig/doc/functions/date.rst | 46 - vendor/twig/twig/doc/functions/dump.rst | 64 - vendor/twig/twig/doc/functions/index.rst | 15 - vendor/twig/twig/doc/functions/parent.rst | 20 - vendor/twig/twig/doc/functions/random.rst | 24 - vendor/twig/twig/doc/functions/range.rst | 38 - vendor/twig/twig/doc/index.rst | 17 - vendor/twig/twig/doc/internals.rst | 140 - vendor/twig/twig/doc/intro.rst | 160 - vendor/twig/twig/doc/recipes.rst | 368 -- vendor/twig/twig/doc/tags/autoescape.rst | 71 - vendor/twig/twig/doc/tags/block.rst | 11 - vendor/twig/twig/doc/tags/do.rst | 12 - vendor/twig/twig/doc/tags/embed.rst | 178 - vendor/twig/twig/doc/tags/extends.rst | 187 - vendor/twig/twig/doc/tags/filter.rst | 21 - vendor/twig/twig/doc/tags/flush.rst | 17 - vendor/twig/twig/doc/tags/for.rst | 157 - vendor/twig/twig/doc/tags/from.rst | 8 - vendor/twig/twig/doc/tags/if.rst | 43 - vendor/twig/twig/doc/tags/import.rst | 79 - vendor/twig/twig/doc/tags/include.rst | 86 - vendor/twig/twig/doc/tags/index.rst | 24 - vendor/twig/twig/doc/tags/macro.rst | 91 - vendor/twig/twig/doc/tags/raw.rst | 16 - vendor/twig/twig/doc/tags/sandbox.rst | 30 - vendor/twig/twig/doc/tags/set.rst | 32 - vendor/twig/twig/doc/tags/spaceless.rst | 37 - vendor/twig/twig/doc/tags/use.rst | 123 - vendor/twig/twig/doc/templates.rst | 754 --- vendor/twig/twig/doc/tests/constant.rst | 11 - vendor/twig/twig/doc/tests/defined.rst | 30 - vendor/twig/twig/doc/tests/divisibleby.rst | 10 - vendor/twig/twig/doc/tests/empty.rst | 11 - vendor/twig/twig/doc/tests/even.rst | 10 - vendor/twig/twig/doc/tests/index.rst | 15 - vendor/twig/twig/doc/tests/iterable.rst | 19 - vendor/twig/twig/doc/tests/null.rst | 12 - vendor/twig/twig/doc/tests/odd.rst | 10 - vendor/twig/twig/doc/tests/sameas.rst | 11 - vendor/twig/twig/ext/twig/.gitignore | 30 - vendor/twig/twig/ext/twig/LICENSE | 22 - vendor/twig/twig/ext/twig/config.m4 | 8 - vendor/twig/twig/ext/twig/config.w32 | 8 - vendor/twig/twig/ext/twig/php_twig.h | 31 - vendor/twig/twig/ext/twig/twig.c | 975 --- vendor/twig/twig/lib/Twig/Autoloader.php | 44 - vendor/twig/twig/lib/Twig/Compiler.php | 256 - .../twig/twig/lib/Twig/CompilerInterface.php | 35 - vendor/twig/twig/lib/Twig/Environment.php | 1105 ---- vendor/twig/twig/lib/Twig/Error.php | 197 - vendor/twig/twig/lib/Twig/Error/Loader.php | 20 - vendor/twig/twig/lib/Twig/Error/Runtime.php | 21 - vendor/twig/twig/lib/Twig/Error/Syntax.php | 21 - .../twig/twig/lib/Twig/ExpressionParser.php | 488 -- vendor/twig/twig/lib/Twig/Extension.php | 93 - vendor/twig/twig/lib/Twig/Extension/Core.php | 1183 ---- vendor/twig/twig/lib/Twig/Extension/Debug.php | 70 - .../twig/twig/lib/Twig/Extension/Escaper.php | 108 - .../twig/lib/Twig/Extension/Optimizer.php | 35 - .../twig/twig/lib/Twig/Extension/Sandbox.php | 112 - .../twig/twig/lib/Twig/ExtensionInterface.php | 84 - vendor/twig/twig/lib/Twig/Filter.php | 75 - vendor/twig/twig/lib/Twig/Filter/Function.php | 33 - vendor/twig/twig/lib/Twig/Filter/Method.php | 35 - vendor/twig/twig/lib/Twig/Filter/Node.php | 37 - vendor/twig/twig/lib/Twig/FilterInterface.php | 40 - vendor/twig/twig/lib/Twig/Function.php | 63 - .../twig/twig/lib/Twig/Function/Function.php | 34 - vendor/twig/twig/lib/Twig/Function/Method.php | 36 - vendor/twig/twig/lib/Twig/Function/Node.php | 37 - .../twig/twig/lib/Twig/FunctionInterface.php | 37 - vendor/twig/twig/lib/Twig/Lexer.php | 406 -- vendor/twig/twig/lib/Twig/LexerInterface.php | 29 - vendor/twig/twig/lib/Twig/Loader/Array.php | 102 - vendor/twig/twig/lib/Twig/Loader/Chain.php | 106 - .../twig/twig/lib/Twig/Loader/Filesystem.php | 152 - vendor/twig/twig/lib/Twig/Loader/String.php | 63 - vendor/twig/twig/lib/Twig/LoaderInterface.php | 53 - vendor/twig/twig/lib/Twig/Markup.php | 38 - vendor/twig/twig/lib/Twig/Node.php | 227 - vendor/twig/twig/lib/Twig/Node/AutoEscape.php | 40 - vendor/twig/twig/lib/Twig/Node/Block.php | 45 - .../twig/lib/Twig/Node/BlockReference.php | 38 - vendor/twig/twig/lib/Twig/Node/Body.php | 20 - vendor/twig/twig/lib/Twig/Node/Do.php | 39 - vendor/twig/twig/lib/Twig/Node/Embed.php | 39 - vendor/twig/twig/lib/Twig/Node/Expression.php | 21 - .../twig/lib/Twig/Node/Expression/Array.php | 86 - .../lib/Twig/Node/Expression/AssignName.php | 28 - .../twig/lib/Twig/Node/Expression/Binary.php | 40 - .../lib/Twig/Node/Expression/Binary/Add.php | 18 - .../lib/Twig/Node/Expression/Binary/And.php | 18 - .../Node/Expression/Binary/BitwiseAnd.php | 18 - .../Twig/Node/Expression/Binary/BitwiseOr.php | 18 - .../Node/Expression/Binary/BitwiseXor.php | 18 - .../Twig/Node/Expression/Binary/Concat.php | 18 - .../lib/Twig/Node/Expression/Binary/Div.php | 18 - .../lib/Twig/Node/Expression/Binary/Equal.php | 17 - .../Twig/Node/Expression/Binary/FloorDiv.php | 29 - .../Twig/Node/Expression/Binary/Greater.php | 17 - .../Node/Expression/Binary/GreaterEqual.php | 17 - .../lib/Twig/Node/Expression/Binary/In.php | 33 - .../lib/Twig/Node/Expression/Binary/Less.php | 17 - .../Twig/Node/Expression/Binary/LessEqual.php | 17 - .../lib/Twig/Node/Expression/Binary/Mod.php | 18 - .../lib/Twig/Node/Expression/Binary/Mul.php | 18 - .../Twig/Node/Expression/Binary/NotEqual.php | 17 - .../lib/Twig/Node/Expression/Binary/NotIn.php | 33 - .../lib/Twig/Node/Expression/Binary/Or.php | 18 - .../lib/Twig/Node/Expression/Binary/Power.php | 33 - .../lib/Twig/Node/Expression/Binary/Range.php | 33 - .../lib/Twig/Node/Expression/Binary/Sub.php | 18 - .../Twig/Node/Expression/BlockReference.php | 52 - .../lib/Twig/Node/Expression/Conditional.php | 31 - .../lib/Twig/Node/Expression/Constant.php | 23 - .../Node/Expression/ExtensionReference.php | 34 - .../twig/lib/Twig/Node/Expression/Filter.php | 61 - .../Twig/Node/Expression/Filter/Default.php | 44 - .../lib/Twig/Node/Expression/Function.php | 66 - .../twig/lib/Twig/Node/Expression/GetAttr.php | 53 - .../lib/Twig/Node/Expression/MethodCall.php | 37 - .../twig/lib/Twig/Node/Expression/Name.php | 76 - .../twig/lib/Twig/Node/Expression/Parent.php | 48 - .../lib/Twig/Node/Expression/TempName.php | 26 - .../twig/lib/Twig/Node/Expression/Test.php | 54 - .../Twig/Node/Expression/Test/Constant.php | 36 - .../lib/Twig/Node/Expression/Test/Defined.php | 55 - .../Twig/Node/Expression/Test/Divisibleby.php | 34 - .../lib/Twig/Node/Expression/Test/Even.php | 33 - .../lib/Twig/Node/Expression/Test/Null.php | 32 - .../lib/Twig/Node/Expression/Test/Odd.php | 33 - .../lib/Twig/Node/Expression/Test/Sameas.php | 30 - .../twig/lib/Twig/Node/Expression/Unary.php | 30 - .../lib/Twig/Node/Expression/Unary/Neg.php | 18 - .../lib/Twig/Node/Expression/Unary/Not.php | 18 - .../lib/Twig/Node/Expression/Unary/Pos.php | 18 - vendor/twig/twig/lib/Twig/Node/Flush.php | 37 - vendor/twig/twig/lib/Twig/Node/For.php | 113 - vendor/twig/twig/lib/Twig/Node/ForLoop.php | 56 - vendor/twig/twig/lib/Twig/Node/If.php | 67 - vendor/twig/twig/lib/Twig/Node/Import.php | 51 - vendor/twig/twig/lib/Twig/Node/Include.php | 100 - vendor/twig/twig/lib/Twig/Node/Macro.php | 84 - vendor/twig/twig/lib/Twig/Node/Module.php | 372 -- vendor/twig/twig/lib/Twig/Node/Print.php | 40 - vendor/twig/twig/lib/Twig/Node/Sandbox.php | 48 - .../twig/lib/Twig/Node/SandboxedModule.php | 61 - .../twig/lib/Twig/Node/SandboxedPrint.php | 60 - vendor/twig/twig/lib/Twig/Node/Set.php | 102 - vendor/twig/twig/lib/Twig/Node/SetTemp.php | 35 - vendor/twig/twig/lib/Twig/Node/Spaceless.php | 41 - vendor/twig/twig/lib/Twig/Node/Text.php | 40 - vendor/twig/twig/lib/Twig/NodeInterface.php | 30 - .../twig/lib/Twig/NodeOutputInterface.php | 20 - vendor/twig/twig/lib/Twig/NodeTraverser.php | 89 - .../twig/lib/Twig/NodeVisitor/Escaper.php | 172 - .../twig/lib/Twig/NodeVisitor/Optimizer.php | 247 - .../lib/Twig/NodeVisitor/SafeAnalysis.php | 133 - .../twig/lib/Twig/NodeVisitor/Sandbox.php | 106 - .../twig/lib/Twig/NodeVisitorInterface.php | 48 - vendor/twig/twig/lib/Twig/Parser.php | 381 -- vendor/twig/twig/lib/Twig/ParserInterface.php | 28 - .../twig/lib/Twig/Sandbox/SecurityError.php | 20 - .../twig/lib/Twig/Sandbox/SecurityPolicy.php | 120 - .../Twig/Sandbox/SecurityPolicyInterface.php | 25 - vendor/twig/twig/lib/Twig/Template.php | 443 -- .../twig/twig/lib/Twig/TemplateInterface.php | 47 - vendor/twig/twig/lib/Twig/Test/Function.php | 31 - vendor/twig/twig/lib/Twig/Test/Method.php | 33 - vendor/twig/twig/lib/Twig/Test/Node.php | 35 - vendor/twig/twig/lib/Twig/TestInterface.php | 26 - vendor/twig/twig/lib/Twig/Token.php | 219 - vendor/twig/twig/lib/Twig/TokenParser.php | 34 - .../twig/lib/Twig/TokenParser/AutoEscape.php | 88 - .../twig/twig/lib/Twig/TokenParser/Block.php | 83 - vendor/twig/twig/lib/Twig/TokenParser/Do.php | 42 - .../twig/twig/lib/Twig/TokenParser/Embed.php | 66 - .../twig/lib/Twig/TokenParser/Extends.php | 54 - .../twig/twig/lib/Twig/TokenParser/Filter.php | 61 - .../twig/twig/lib/Twig/TokenParser/Flush.php | 42 - vendor/twig/twig/lib/Twig/TokenParser/For.php | 89 - .../twig/twig/lib/Twig/TokenParser/From.php | 74 - vendor/twig/twig/lib/Twig/TokenParser/If.php | 93 - .../twig/twig/lib/Twig/TokenParser/Import.php | 47 - .../twig/lib/Twig/TokenParser/Include.php | 80 - .../twig/twig/lib/Twig/TokenParser/Macro.php | 69 - .../twig/lib/Twig/TokenParser/Sandbox.php | 55 - vendor/twig/twig/lib/Twig/TokenParser/Set.php | 84 - .../twig/lib/Twig/TokenParser/Spaceless.php | 59 - vendor/twig/twig/lib/Twig/TokenParser/Use.php | 85 - .../twig/twig/lib/Twig/TokenParserBroker.php | 113 - .../lib/Twig/TokenParserBrokerInterface.php | 45 - .../twig/lib/Twig/TokenParserInterface.php | 42 - vendor/twig/twig/lib/Twig/TokenStream.php | 145 - vendor/twig/twig/package.xml.tpl | 64 - vendor/twig/twig/phpunit.xml.dist | 25 - .../twig/test/Twig/Tests/AutoloaderTest.php | 21 - .../twig/test/Twig/Tests/CompilerTest.php | 33 - .../twig/test/Twig/Tests/EnvironmentTest.php | 35 - .../twig/twig/test/Twig/Tests/ErrorTest.php | 136 - .../test/Twig/Tests/ExpressionParserTest.php | 217 - .../test/Twig/Tests/Extension/CoreTest.php | 115 - .../test/Twig/Tests/Extension/SandboxTest.php | 209 - .../twig/test/Twig/Tests/FileCachingTest.php | 70 - .../test/Twig/Tests/Fixtures/errors/base.html | 1 - .../Twig/Tests/Fixtures/errors/index.html | 7 - .../Fixtures/exceptions/unclosed_tag.test | 20 - .../Tests/Fixtures/expressions/array.test | 61 - .../Fixtures/expressions/array_call.test | 14 - .../Tests/Fixtures/expressions/binary.test | 46 - .../Tests/Fixtures/expressions/bitwise.test | 12 - .../Fixtures/expressions/comparison.test | 14 - .../Tests/Fixtures/expressions/dotdot.test | 20 - .../Tests/Fixtures/expressions/grouping.test | 8 - .../Tests/Fixtures/expressions/literals.test | 22 - .../Fixtures/expressions/magic_call.test | 27 - .../Fixtures/expressions/method_call.test | 28 - .../Tests/Fixtures/expressions/postfix.test | 21 - .../Tests/Fixtures/expressions/strings.test | 10 - .../expressions/ternary_operator.test | 18 - .../Tests/Fixtures/expressions/unary.test | 12 - .../expressions/unary_precedence.test | 14 - .../test/Twig/Tests/Fixtures/filters/abs.test | 30 - .../Fixtures/filters/convert_encoding.test | 10 - .../Twig/Tests/Fixtures/filters/date.test | 56 - .../Fixtures/filters/date_default_format.test | 14 - .../filters/date_default_format_interval.test | 16 - .../Tests/Fixtures/filters/date_interval.test | 16 - .../Tests/Fixtures/filters/date_modify.test | 14 - .../Twig/Tests/Fixtures/filters/default.test | 150 - .../Fixtures/filters/dynamic_filter.test | 10 - .../Twig/Tests/Fixtures/filters/escape.test | 8 - .../filters/escape_non_supported_charset.test | 8 - .../Tests/Fixtures/filters/force_escape.test | 18 - .../Twig/Tests/Fixtures/filters/format.test | 8 - .../Twig/Tests/Fixtures/filters/join.test | 12 - .../Tests/Fixtures/filters/json_encode.test | 12 - .../Twig/Tests/Fixtures/filters/length.test | 14 - .../Tests/Fixtures/filters/length_utf8.test | 12 - .../Twig/Tests/Fixtures/filters/merge.test | 16 - .../Twig/Tests/Fixtures/filters/nl2br.test | 14 - .../Tests/Fixtures/filters/number_format.test | 18 - .../filters/number_format_default.test | 21 - .../Twig/Tests/Fixtures/filters/replace.test | 8 - .../Twig/Tests/Fixtures/filters/reverse.test | 12 - .../Twig/Tests/Fixtures/filters/slice.test | 40 - .../Twig/Tests/Fixtures/filters/sort.test | 10 - .../Tests/Fixtures/filters/special_chars.test | 8 - .../Twig/Tests/Fixtures/filters/trim.test | 12 - .../Tests/Fixtures/functions/attribute.test | 12 - .../Twig/Tests/Fixtures/functions/block.test | 12 - .../Tests/Fixtures/functions/constant.test | 12 - .../Twig/Tests/Fixtures/functions/cycle.test | 16 - .../Twig/Tests/Fixtures/functions/date.test | 25 - .../Twig/Tests/Fixtures/functions/dump.test | 14 - .../Tests/Fixtures/functions/dump_array.test | 19 - .../Fixtures/functions/dynamic_function.test | 10 - .../Fixtures/functions/special_chars.test | 8 - .../Twig/Tests/Fixtures/macros/simple.test | 22 - .../Tests/Fixtures/macros/with_filters.test | 14 - .../Fixtures/regression/empty_token.test | 8 - .../regression/simple_xml_element.test | 17 - .../regression/strings_like_numbers.test | 8 - .../Tests/Fixtures/tags/autoescape/basic.test | 26 - .../Fixtures/tags/autoescape/blocks.test | 12 - .../tags/autoescape/double_escaping.test | 10 - .../Fixtures/tags/autoescape/functions.test | 83 - .../Fixtures/tags/autoescape/literal.test | 45 - .../Fixtures/tags/autoescape/nested.test | 26 - .../Fixtures/tags/autoescape/objects.test | 26 - .../Tests/Fixtures/tags/autoescape/raw.test | 10 - .../Fixtures/tags/autoescape/strategy.test | 17 - .../Tests/Fixtures/tags/autoescape/type.test | 69 - .../tags/autoescape/with_filters.test | 131 - .../autoescape/with_filters_arguments.test | 23 - .../autoescape/with_pre_escape_filters.test | 68 - .../with_preserves_safety_filters.test | 50 - .../Twig/Tests/Fixtures/tags/block/basic.test | 11 - .../tags/block/block_unique_name.test | 11 - .../Fixtures/tags/block/special_chars.test | 10 - .../Twig/Tests/Fixtures/tags/embed/basic.test | 35 - .../Tests/Fixtures/tags/embed/multiple.test | 50 - .../Tests/Fixtures/tags/embed/nested.test | 42 - .../Fixtures/tags/embed/with_extends.test | 57 - .../Tests/Fixtures/tags/filter/basic.test | 10 - .../Fixtures/tags/filter/json_encode.test | 8 - .../Tests/Fixtures/tags/filter/multiple.test | 10 - .../Tests/Fixtures/tags/filter/nested.test | 16 - .../Fixtures/tags/filter/with_for_tag.test | 13 - .../Fixtures/tags/filter/with_if_tag.test | 29 - .../Tests/Fixtures/tags/for/condition.test | 14 - .../Twig/Tests/Fixtures/tags/for/context.test | 18 - .../Twig/Tests/Fixtures/tags/for/else.test | 23 - .../Fixtures/tags/for/inner_variables.test | 17 - .../Twig/Tests/Fixtures/tags/for/keys.test | 11 - .../Fixtures/tags/for/keys_and_values.test | 11 - .../Tests/Fixtures/tags/for/loop_context.test | 19 - .../Fixtures/tags/for/loop_context_local.test | 10 - .../Tests/Fixtures/tags/for/nested_else.test | 17 - .../Twig/Tests/Fixtures/tags/for/objects.test | 43 - .../Fixtures/tags/for/objects_countable.test | 47 - .../Tests/Fixtures/tags/for/recursive.test | 18 - .../Twig/Tests/Fixtures/tags/for/values.test | 11 - .../test/Twig/Tests/Fixtures/tags/from.test | 14 - .../Twig/Tests/Fixtures/tags/if/basic.test | 22 - .../Tests/Fixtures/tags/if/expression.test | 22 - .../Tests/Fixtures/tags/include/basic.test | 16 - .../Fixtures/tags/include/expression.test | 16 - .../Fixtures/tags/include/ignore_missing.test | 10 - .../Tests/Fixtures/tags/include/only.test | 16 - .../tags/include/template_instance.test | 10 - .../tags/include/templates_as_array.test | 12 - .../Fixtures/tags/include/with_variables.test | 12 - .../Fixtures/tags/inheritance/basic.test | 14 - .../tags/inheritance/conditional.test | 14 - .../Fixtures/tags/inheritance/dynamic.test | 14 - .../Fixtures/tags/inheritance/empty.test | 10 - .../tags/inheritance/extends_as_array.test | 12 - .../Fixtures/tags/inheritance/multiple.test | 12 - .../tags/inheritance/nested_blocks.test | 22 - .../nested_blocks_parent_only.test | 15 - .../tags/inheritance/nested_inheritance.test | 16 - .../Fixtures/tags/inheritance/parent.test | 12 - .../tags/inheritance/parent_change.test | 16 - .../tags/inheritance/parent_in_a_block.test | 8 - .../tags/inheritance/parent_isolation.test | 20 - .../tags/inheritance/parent_nested.test | 28 - .../inheritance/parent_without_extends.test | 8 - .../parent_without_extends_but_traits.test | 14 - .../tags/inheritance/template_instance.test | 14 - .../Tests/Fixtures/tags/inheritance/use.test | 44 - .../Twig/Tests/Fixtures/tags/macro/basic.test | 15 - .../Fixtures/tags/macro/endmacro_name.test | 14 - .../Tests/Fixtures/tags/macro/external.test | 17 - .../Twig/Tests/Fixtures/tags/macro/from.test | 18 - .../Tests/Fixtures/tags/macro/global.test | 14 - .../Fixtures/tags/macro/self_import.test | 17 - .../Fixtures/tags/macro/special_chars.test | 12 - .../Twig/Tests/Fixtures/tags/raw/basic.test | 10 - .../Fixtures/tags/raw/whitespace_control.test | 56 - .../Fixtures/tags/sandbox/not_valid1.test | 11 - .../Fixtures/tags/sandbox/not_valid2.test | 14 - .../Tests/Fixtures/tags/sandbox/simple.test | 22 - .../Twig/Tests/Fixtures/tags/set/basic.test | 20 - .../Fixtures/tags/set/capture-empty.test | 9 - .../Twig/Tests/Fixtures/tags/set/capture.test | 10 - .../Tests/Fixtures/tags/set/expression.test | 12 - .../Tests/Fixtures/tags/spaceless/simple.test | 12 - .../Tests/Fixtures/tags/special_chars.test | 8 - .../Twig/Tests/Fixtures/tags/trim_block.test | 74 - .../Twig/Tests/Fixtures/tags/use/aliases.test | 12 - .../Twig/Tests/Fixtures/tags/use/basic.test | 12 - .../Twig/Tests/Fixtures/tags/use/deep.test | 22 - .../Tests/Fixtures/tags/use/deep_empty.test | 10 - .../Tests/Fixtures/tags/use/multiple.test | 21 - .../Fixtures/tags/use/multiple_aliases.test | 23 - .../test/Twig/Tests/Fixtures/tests/array.test | 24 - .../Twig/Tests/Fixtures/tests/constant.test | 12 - .../Twig/Tests/Fixtures/tests/defined.test | 108 - .../test/Twig/Tests/Fixtures/tests/empty.test | 45 - .../test/Twig/Tests/Fixtures/tests/even.test | 14 - .../test/Twig/Tests/Fixtures/tests/in.test | 48 - .../Twig/Tests/Fixtures/tests/iterable.test | 19 - .../test/Twig/Tests/Fixtures/tests/odd.test | 10 - .../twig/twig/test/Twig/Tests/LexerTest.php | 249 - .../twig/test/Twig/Tests/Loader/ArrayTest.php | 97 - .../twig/test/Twig/Tests/Loader/ChainTest.php | 63 - .../test/Twig/Tests/Loader/FilesystemTest.php | 52 - .../test/Twig/Tests/Node/AutoEscapeTest.php | 46 - .../Twig/Tests/Node/BlockReferenceTest.php | 41 - .../twig/test/Twig/Tests/Node/BlockTest.php | 52 - .../twig/twig/test/Twig/Tests/Node/DoTest.php | 46 - .../Twig/Tests/Node/Expression/ArrayTest.php | 51 - .../Tests/Node/Expression/AssignNameTest.php | 43 - .../Tests/Node/Expression/Binary/AddTest.php | 49 - .../Tests/Node/Expression/Binary/AndTest.php | 49 - .../Node/Expression/Binary/ConcatTest.php | 49 - .../Tests/Node/Expression/Binary/DivTest.php | 49 - .../Node/Expression/Binary/FloorDivTest.php | 49 - .../Tests/Node/Expression/Binary/ModTest.php | 49 - .../Tests/Node/Expression/Binary/MulTest.php | 49 - .../Tests/Node/Expression/Binary/OrTest.php | 49 - .../Tests/Node/Expression/Binary/SubTest.php | 49 - .../Tests/Node/Expression/ConditionalTest.php | 52 - .../Tests/Node/Expression/ConstantTest.php | 44 - .../Twig/Tests/Node/Expression/FilterTest.php | 85 - .../Tests/Node/Expression/FunctionTest.php | 90 - .../Tests/Node/Expression/GetAttrTest.php | 64 - .../Twig/Tests/Node/Expression/NameTest.php | 51 - .../Twig/Tests/Node/Expression/ParentTest.php | 42 - .../Twig/Tests/Node/Expression/TestTest.php | 67 - .../Tests/Node/Expression/Unary/NegTest.php | 46 - .../Tests/Node/Expression/Unary/NotTest.php | 46 - .../Tests/Node/Expression/Unary/PosTest.php | 46 - .../twig/test/Twig/Tests/Node/ForTest.php | 201 - .../twig/twig/test/Twig/Tests/Node/IfTest.php | 99 - .../twig/test/Twig/Tests/Node/ImportTest.php | 50 - .../twig/test/Twig/Tests/Node/IncludeTest.php | 84 - .../twig/test/Twig/Tests/Node/MacroTest.php | 70 - .../twig/test/Twig/Tests/Node/ModuleTest.php | 196 - .../twig/test/Twig/Tests/Node/PrintTest.php | 43 - .../twig/test/Twig/Tests/Node/SandboxTest.php | 57 - .../Twig/Tests/Node/SandboxedModuleTest.php | 172 - .../Twig/Tests/Node/SandboxedPrintTest.php | 46 - .../twig/test/Twig/Tests/Node/SetTest.php | 73 - .../test/Twig/Tests/Node/SpacelessTest.php | 50 - .../twig/test/Twig/Tests/Node/TestCase.php | 58 - .../twig/test/Twig/Tests/Node/TextTest.php | 42 - .../Twig/Tests/NodeVisitor/OptimizerTest.php | 118 - .../twig/twig/test/Twig/Tests/ParserTest.php | 180 - .../twig/test/Twig/Tests/TemplateTest.php | 377 -- .../twig/test/Twig/Tests/TokenStreamTest.php | 41 - .../twig/test/Twig/Tests/escapingTest.php | 320 - .../twig/test/Twig/Tests/integrationTest.php | 322 - vendor/twig/twig/test/bootstrap.php | 13 - 7334 files changed, 2 insertions(+), 671679 deletions(-) create mode 100644 vendor/.gitignore delete mode 100644 vendor/ClassLoader.php delete mode 100644 vendor/autoload.php delete mode 100644 vendor/autoload_classmap.php delete mode 100644 vendor/autoload_namespaces.php delete mode 100644 vendor/composer/ClassLoader.php delete mode 100644 vendor/composer/autoload_classmap.php delete mode 100644 vendor/composer/autoload_namespaces.php delete mode 100644 vendor/composer/installed_dev.json delete mode 100644 vendor/doctrine/common/.travis.yml delete mode 100644 vendor/doctrine/common/LICENSE delete mode 100644 vendor/doctrine/common/README.md delete mode 100644 vendor/doctrine/common/UPGRADE_TO_2_1 delete mode 100644 vendor/doctrine/common/UPGRADE_TO_2_2 delete mode 100644 vendor/doctrine/common/composer.json delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/.gitignore delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/.gitmodules delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/.travis.yml delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/LICENSE delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/README.md delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/UPGRADE_TO_2_1 delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/UPGRADE_TO_2_2 delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/build.properties delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/build.xml delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/composer.json delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation/Attribute.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation/Attributes.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation/Required.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation/Target.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/AnnotationException.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/AnnotationReader.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/AnnotationRegistry.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/CachedReader.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/DocLexer.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/DocParser.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/FileCacheReader.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/IndexedReader.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/PhpParser.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Reader.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/ApcCache.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/ArrayCache.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/Cache.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/CacheProvider.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/MemcacheCache.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/MemcachedCache.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/WinCacheCache.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/XcacheCache.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/ZendDataCache.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/ClassLoader.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Collections/ArrayCollection.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Collections/Collection.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/CommonException.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Comparable.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/EventArgs.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/EventManager.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/EventSubscriber.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Lexer.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/NotifyPropertyChanged.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/ConnectionRegistry.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/ManagerRegistry.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/MappingException.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/ObjectManager.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/ObjectManagerAware.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/ObjectRepository.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/PersistentObject.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Proxy.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/PropertyChangedListener.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Util/ClassUtils.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Util/Debug.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Util/Inflector.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Version.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/phpunit.xml.dist delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/.gitignore delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/AnnotationReaderTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/CachedReaderTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/DocLexerTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/DocParserTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/FileCacheReaderTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/AnnotWithDefaultValue.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Autoload.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Route.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Secure.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Template.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Version.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetAll.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetAnnotation.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetClass.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetMethod.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetPropertyMethod.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithAttributes.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithRequiredAttributes.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithRequiredAttributesWithoutContructor.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithTargetSyntaxError.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithVarType.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassDDC1660.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithAnnotationWithTargetSyntaxError.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithAnnotationWithVarType.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithFullyQualifiedUseStatements.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithInvalidAnnotationTargetAtClass.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithInvalidAnnotationTargetAtMethod.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithInvalidAnnotationTargetAtProperty.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithValidAnnotationTarget.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Controller.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/DifferentNamespacesPerFileWithClassAsFirst.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/DifferentNamespacesPerFileWithClassAsLast.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/EqualNamespacesPerFileWithClassAsFirst.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/EqualNamespacesPerFileWithClassAsLast.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/GlobalNamespacesPerFileWithClassAsFirst.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/GlobalNamespacesPerFileWithClassAsLast.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/InvalidAnnotationUsageButIgnoredClass.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/InvalidAnnotationUsageClass.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/MultipleClassesInFile.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/MultipleImportsInUseStatement.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespaceAndClassCommentedOut.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespaceWithClosureDeclaration.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespacedSingleClassLOC1000.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/NoAnnotation.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/NonNamespacedClass.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/SingleClassLOC1000.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/TestInterface.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/PerformanceTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/PhpParserTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/SimpleAnnotationReaderTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM55Test.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Entity.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Test.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/TopLevelAnnotation.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/ApcCacheTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/ArrayCacheTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/CacheTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/MemcacheCacheTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/WinCacheCacheTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/XcacheCacheTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/ZendDataCacheTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/ClassLoaderTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassA.class.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassB.class.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassC.class.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassD.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Collections/CollectionTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/DoctrineExceptionTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/EventManagerTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/ChainDriverTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/ClassMetadataFactoryTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/DefaultFileLocatorTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/FileDriverTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/PHPDriverTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/RuntimeReflectionServiceTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticPHPDriverTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticReflectionServiceTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/SymfonyFileLocatorTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/TestEntity.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/global.yml delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/stdClass.yml delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/PersistentObjectTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Util/ClassUtilsTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Util/DebugTest.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/DoctrineTestCase.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/TestInit.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/NativePhpunitTask.php delete mode 100644 vendor/doctrine/common/doctrine-common-ac6c39b/tests/README.markdown delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Attribute.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Attributes.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Required.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Target.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationException.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationReader.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationRegistry.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Annotations/CachedReader.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocLexer.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Annotations/FileCacheReader.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Annotations/IndexedReader.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Annotations/PhpParser.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Annotations/Reader.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Cache/ApcCache.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Cache/ArrayCache.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Cache/Cache.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Cache/CacheProvider.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Cache/MemcacheCache.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Cache/MemcachedCache.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Cache/WinCacheCache.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Cache/XcacheCache.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Cache/ZendDataCache.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Collections/ArrayCollection.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Collections/Collection.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/CommonException.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Comparable.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/EventArgs.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/EventManager.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/EventSubscriber.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Lexer.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/NotifyPropertyChanged.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/ManagerRegistry.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerAware.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Proxy.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/PropertyChangedListener.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Util/Inflector.php delete mode 100644 vendor/doctrine/common/lib/Doctrine/Common/Version.php delete mode 100644 vendor/doctrine/common/phpunit.xml.dist delete mode 100644 vendor/doctrine/dbal/.gitignore delete mode 100644 vendor/doctrine/dbal/.gitmodules delete mode 100644 vendor/doctrine/dbal/.travis.yml delete mode 100644 vendor/doctrine/dbal/LICENSE delete mode 100644 vendor/doctrine/dbal/README.md delete mode 100644 vendor/doctrine/dbal/UPGRADE delete mode 100644 vendor/doctrine/dbal/bin/doctrine-dbal delete mode 100644 vendor/doctrine/dbal/bin/doctrine-dbal.php delete mode 100644 vendor/doctrine/dbal/bin/doctrine.php delete mode 100644 vendor/doctrine/dbal/build.properties delete mode 100644 vendor/doctrine/dbal/build.xml delete mode 100644 vendor/doctrine/dbal/composer.json delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/ArrayStatement.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/CacheException.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/QueryCacheProfile.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Configuration.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/ConnectionException.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Connection.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Driver.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Exception.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/Driver.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliException.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/Driver.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOIbm/Driver.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Driver.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/ResultStatement.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Statement.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/ConnectionEventArgs.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/MysqlSessionInit.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/SQLSessionInit.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableAddColumnEventArgs.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableChangeColumnEventArgs.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableEventArgs.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableRemoveColumnEventArgs.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableRenameColumnEventArgs.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaColumnDefinitionEventArgs.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaCreateTableColumnEventArgs.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaCreateTableEventArgs.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaDropTableEventArgs.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaEventArgs.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaIndexDefinitionEventArgs.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Events.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/LockMode.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/DebugStack.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/EchoSQLLogger.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/LoggerChain.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/SQLLogger.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DB2Platform.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/DB2Keywords.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/KeywordList.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MsSQLKeywords.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MySQLKeywords.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/OracleKeywords.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQLKeywords.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/ReservedKeywordsValidator.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLiteKeywords.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/OraclePlatform.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServer2005Platform.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServer2008Platform.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Portability/Connection.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Portability/Statement.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/Expression/CompositeExpression.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/Expression/ExpressionBuilder.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryException.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/README.markdown delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/SQLParserUtils.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractAsset.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Column.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/ColumnDiff.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Comparator.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Constraint.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Index.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Schema.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaConfig.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaDiff.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaException.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Sequence.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Table.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/TableDiff.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/View.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/DropSchemaSqlCollector.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/Graphviz.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/RemoveNamespacedAssets.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/Visitor.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Helper/ConnectionHelper.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ArrayType.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BigIntType.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BlobType.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BooleanType.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DateTimeType.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DateTimeTzType.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DateType.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DecimalType.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/FloatType.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/IntegerType.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ObjectType.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/SmallIntType.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/StringType.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/TextType.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/TimeType.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/Type.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/VarDateTimeType.php delete mode 100644 vendor/doctrine/dbal/lib/Doctrine/DBAL/Version.php delete mode 100644 vendor/doctrine/dbal/phpunit.xml.dist delete mode 100644 vendor/doctrine/dbal/run-all.sh delete mode 100644 vendor/doctrine/dbal/tests/.gitignore delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/ConnectionTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Driver/OCI8/OCI8StatementTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/DriverManagerTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Events/MysqlSessionInitTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Events/OracleSessionInitTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Events/SQLSessionInitTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/BlobTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/LoggingTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/MasterSlaveConnectionTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/ModifyLimitQueryTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/NamedParametersTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/PortabilityTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/Db2SchemaManagerTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/OracleSchemaManagerTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/SQLServerSchemaManagerTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/SqliteSchemaManagerTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/TemporaryTableTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL168Test.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL202Test.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/TypeConversionTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/WriteTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Mocks/MockPlatform.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/MySqlPlatformTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/PostgreSqlPlatformTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/ReservedKeywordsValidatorTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Query/Expression/CompositeExpressionTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Query/Expression/ExpressionBuilderTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/ColumnTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/IndexTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/MySqlSchemaManagerTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/Platforms/MySQLSchemaTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/SchemaDiffTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/SchemaTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/TableTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/Visitor/RemoveNamespacedAssetsTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/Visitor/SchemaSqlCollectorTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/ArrayTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/BlobTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/BooleanTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DateTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DateTimeTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DateTimeTzTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DecimalTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/FloatTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/IntegerTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/ObjectTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/SmallIntTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/StringTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/TimeTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/VarDateTimeTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/UtilTest.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DbalFunctionalTestCase.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DbalTestCase.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/DoctrineTestCase.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/ConnectionMock.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/DriverMock.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/SchemaManagerMock.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/TaskMock.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/TestInit.php delete mode 100644 vendor/doctrine/dbal/tests/Doctrine/Tests/TestUtil.php delete mode 100644 vendor/doctrine/dbal/tests/README.markdown delete mode 100644 vendor/doctrine/dbal/tests/travis/mysql.travis.xml delete mode 100644 vendor/doctrine/dbal/tests/travis/pgsql.travis.xml delete mode 100644 vendor/doctrine/dbal/tests/travis/sqlite.travis.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/.gitignore delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/.travis.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/CreateDatabaseDoctrineCommand.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/DoctrineCommand.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/DropDatabaseDoctrineCommand.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/ImportMappingDoctrineCommand.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/ClearMetadataCacheDoctrineCommand.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/ClearQueryCacheDoctrineCommand.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/ClearResultCacheDoctrineCommand.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/ConvertMappingDoctrineCommand.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/CreateSchemaDoctrineCommand.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/DoctrineCommandHelper.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/DropSchemaDoctrineCommand.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/EnsureProductionSettingsDoctrineCommand.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/InfoDoctrineCommand.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/RunDqlDoctrineCommand.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/RunSqlDoctrineCommand.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/UpdateSchemaDoctrineCommand.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/ValidateSchemaCommand.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/ConnectionFactory.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Controller/ProfilerController.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DependencyInjection/Configuration.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DoctrineBundle.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/LICENSE delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/ManagerConfigurator.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Mapping/ClassMetadataCollection.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Mapping/DisconnectedMetadataFactory.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Mapping/MetadataFactory.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/README.md delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Registry.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/config/dbal.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/config/orm.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/config/schema/doctrine-1.0.xsd delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/doc/configuration.rst delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/doc/installation.rst delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/views/Collector/db.html.twig delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/views/Collector/explain.html.twig delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/BundleTest.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/ContainerTest.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/AnnotationsBundle.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/Entity/Test.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/AnnotationsBundle.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/Entity/Test.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Entity/Test.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config/doctrine/Test.orm.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/XmlBundle.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/Entity/Test.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/Resources/config/doctrine/Test.orm.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/YamlBundle.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_logging.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_schema_filter.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_service_multiple_connections.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_service_single_connection.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_service_single_master_slave_connection.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_types.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_filters.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_functions.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_hydration_mode.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_imports.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_imports_import.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_multiple_em_bundle_mappings.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_namingstrategy.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_proxy.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_resolve_target_entity.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_service_multiple_entity_managers.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_service_simple_single_entity_manager.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_service_single_entity_manager.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_single_em_bundle_mappings.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_single_em_dql_functions.xml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_logging.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_schema_filter.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_service_multiple_connections.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_service_single_connection.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_service_single_master_slave_connection.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_types.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_filters.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_functions.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_hydration_mode.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_imports.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_imports_import.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_multiple_em_bundle_mappings.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_namingstrategy.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_resolve_target_entity.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_service_multiple_entity_managers.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_service_simple_single_entity_manager.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_service_single_entity_manager.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_single_em_bundle_mappings.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_single_em_dql_functions.yml delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/TestDatetimeFunction.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/TestFilter.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/TestNumericFunction.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/TestStringFunction.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/TestType.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/XMLSchemaTest.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/XmlDoctrineExtensionTest.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/YamlDoctrineExtensionTest.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/Mapping/MetadataFactoryTest.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/RegistryTest.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/TestCase.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/bootstrap.php delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/composer.json delete mode 100644 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/phpunit.xml.dist delete mode 160000 vendor/doctrine/doctrine-migrations-bundle/Doctrine/Bundle/MigrationsBundle delete mode 160000 vendor/doctrine/migrations delete mode 100644 vendor/doctrine/orm/.gitignore delete mode 100644 vendor/doctrine/orm/.gitmodules delete mode 100644 vendor/doctrine/orm/.travis.yml delete mode 100644 vendor/doctrine/orm/LICENSE delete mode 100644 vendor/doctrine/orm/README.markdown delete mode 100644 vendor/doctrine/orm/UPGRADE_TO_2_0 delete mode 100644 vendor/doctrine/orm/UPGRADE_TO_2_1 delete mode 100644 vendor/doctrine/orm/UPGRADE_TO_2_2 delete mode 100644 vendor/doctrine/orm/UPGRADE_TO_ALPHA3 delete mode 100644 vendor/doctrine/orm/UPGRADE_TO_ALPHA4 delete mode 100644 vendor/doctrine/orm/bin/doctrine delete mode 100644 vendor/doctrine/orm/bin/doctrine.bat delete mode 100644 vendor/doctrine/orm/bin/doctrine.php delete mode 100644 vendor/doctrine/orm/build.properties delete mode 100644 vendor/doctrine/orm/build.properties.dev delete mode 100644 vendor/doctrine/orm/build.xml delete mode 100644 vendor/doctrine/orm/composer.json delete mode 100644 vendor/doctrine/orm/doctrine-mapping.xsd delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Configuration.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/EntityNotFoundException.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Event/LifecycleEventArgs.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Event/LoadClassMetadataEventArgs.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Event/OnClearEventArgs.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Event/OnFlushEventArgs.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Event/PostFlushEventArgs.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Event/PreFlushEventArgs.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Event/PreUpdateEventArgs.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Events.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Id/AbstractIdGenerator.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Id/AssignedGenerator.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Id/IdentityGenerator.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Id/SequenceGenerator.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Id/TableGenerator.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/IterableResult.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SingleScalarHydrator.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Annotation.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/FieldBuilder.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/ManyToManyAssociationBuilder.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/OneToManyAssociationBuilder.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ChangeTrackingPolicy.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadata.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Column.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/DiscriminatorColumn.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/DiscriminatorMap.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/AbstractFileDriver.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/Driver.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/PHPDriver.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/SimplifiedXmlDriver.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/SimplifiedYamlDriver.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ElementCollection.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Entity.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/GeneratedValue.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/HasLifecycleCallbacks.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Id.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Index.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/InheritanceType.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/JoinColumn.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/JoinColumns.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/JoinTable.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ManyToMany.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ManyToOne.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappedSuperclass.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/NamedQueries.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/NamedQuery.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OneToMany.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OneToOne.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OrderBy.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostLoad.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostPersist.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostRemove.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostUpdate.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PreFlush.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PrePersist.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PreRemove.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PreUpdate.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/SequenceGenerator.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Table.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/UniqueConstraint.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Version.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/NativeQuery.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/NoResultException.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/NonUniqueResultException.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/OptimisticLockException.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/PersistentCollection.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/AbstractEntityInheritancePersister.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/ElementCollectionPersister.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/OneToManyPersister.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/SingleTablePersister.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/UnionSubclassPersister.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/PessimisticLockException.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/Autoloader.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/Proxy.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyException.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyFactory.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ASTException.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/AggregateExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ArithmeticExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ArithmeticFactor.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ArithmeticTerm.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/BetweenExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/CoalesceExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/CollectionMemberExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ComparisonExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalFactor.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalPrimary.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalTerm.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/DeleteClause.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/DeleteStatement.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/EmptyCollectionComparisonExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ExistsExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/FromClause.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/AbsFunction.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/BitAndFunction.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/BitOrFunction.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/ConcatFunction.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/CurrentDateFunction.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/CurrentTimeFunction.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/CurrentTimestampFunction.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/DateDiffFunction.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/FunctionNode.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/IdentityFunction.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/LengthFunction.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/LocateFunction.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/LowerFunction.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/ModFunction.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/SizeFunction.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/SubstringFunction.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/TrimFunction.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/UpperFunction.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/GeneralCaseExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/GroupByClause.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/HavingClause.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/IdentificationVariableDeclaration.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/InExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/IndexBy.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/InputParameter.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/InstanceOfExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Join.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/JoinAssociationPathExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/JoinVariableDeclaration.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/LikeExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Literal.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Node.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/NullComparisonExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/NullIfExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/OrderByClause.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/OrderByItem.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/PartialObjectExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/PathExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/QuantifiedExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/RangeVariableDeclaration.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SelectClause.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SelectExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SelectStatement.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleArithmeticExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleCaseExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleSelectClause.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleSelectExpression.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleWhenClause.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Subselect.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SubselectFromClause.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/UpdateClause.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/UpdateItem.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/UpdateStatement.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/WhenClause.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/WhereClause.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleTableDeleteUpdateExecutor.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Andx.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Base.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Comparison.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Composite.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/From.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Func.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/GroupBy.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Join.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Literal.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Math.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/OrderBy.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Orx.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Select.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Filter/SQLFilter.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/FilterCollection.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Lexer.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/ParameterTypeInferer.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/ParserResult.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Printer.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/ResultSetMapping.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/SqlWalker.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/TreeWalker.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Query/TreeWalkerChain.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/QueryBuilder.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/README.markdown delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/MetadataCommand.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryCommand.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/ResultCommand.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/InfoCommand.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ValidateSchemaCommand.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/ConsoleRunner.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Helper/EntityManagerHelper.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/DebugUnitOfWorkListener.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/EntityGenerator.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Event/GenerateSchemaEventArgs.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Event/GenerateSchemaTableEventArgs.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/ExportException.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/CountWalker.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/Paginator.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ResolveTargetEntityListener.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaTool.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaValidator.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Setup.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ToolEvents.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ToolsException.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/TransactionRequiredException.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php delete mode 100644 vendor/doctrine/orm/lib/Doctrine/ORM/Version.php delete mode 100644 vendor/doctrine/orm/phpunit.xml.dist delete mode 100755 vendor/doctrine/orm/run-all.sh delete mode 100644 vendor/doctrine/orm/tests/.gitignore delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/DbalFunctionalTestCase.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/DbalTestCase.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/DbalTypes/NegativeToPositiveType.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/DbalTypes/UpperCaseStringType.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/DoctrineTestCase.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/ClassMetadataMock.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/ConnectionMock.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DriverMock.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/EntityManagerMock.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/EntityPersisterMock.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/IdentityIdGeneratorMock.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/MetadataDriverMock.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/MockTreeWalker.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/SchemaManagerMock.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/SequenceMock.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/TaskMock.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/UnitOfWorkMock.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsAddress.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsArticle.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsComment.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsEmail.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsEmployee.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsGroup.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsPhonenumber.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsUser.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyAuction.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyCar.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyContract.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyEmployee.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyEvent.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFixContract.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFlexContract.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFlexUltraContract.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyManager.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyOrganization.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyPerson.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyRaffle.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeChild.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeParent.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeUpperCase.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117ApproveChanges.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Article.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117ArticleDetails.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Editor.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Link.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Reference.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Translation.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC1476/DDC1476EntityWithDefaultFieldType.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753CustomRepository.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753DefaultRepository.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithCustomRepository.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithDefaultCustomRepository.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithInvalidRepository.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753InvalidRepository.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869ChequePayment.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869CreditCardPayment.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869Payment.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869PaymentRepository.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/AbstractContentItem.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/Directory.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/File.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCart.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCategory.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCustomer.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceFeature.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceShipping.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumAdministrator.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumAvatar.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumBoard.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumCategory.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumEntry.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumUser.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/BooleanModel.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/DateTimeModel.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/DecimalModel.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/SerializationModel.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Global/GlobalNamespaceModel.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyArticle.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyCar.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyUser.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyUserReference.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavCountry.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavPhotos.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavPointOfInterest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavTour.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavUser.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingLeg.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingLocation.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingRoute.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingRouteBooking.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/StockExchange/Bond.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/StockExchange/Market.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/Models/StockExchange/Stock.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Criteria/DqlGenerationTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Entity/ConstructorTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/EntityManagerTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/AbstractManyToManyAssociationTestCase.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/AdvancedDqlQueryTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest2.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ClearEventTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/CustomTreeWalkersTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/DetachedEntityTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/FlushEventTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/HydrationCacheTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/IdentityMapTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/IndexByAssociationTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/GearmanLockTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/LockAgentWorker.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/LockTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/OptimisticTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyEventTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyUnidirectionalAssociationTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/MappedSuperclassTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/NativeQueryTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/NotifyPolicyTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManyBidirectionalAssociationTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManyOrphanRemovalTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManySelfReferentialAssociationTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManyUnidirectionalAssociationTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneBidirectionalAssociationTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneEagerLoadingTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneOrphanRemovalTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneSelfReferentialAssociationTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneUnidirectionalAssociationTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OrderedCollectionTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OrderedJoinedTableInheritanceCollectionTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PaginationTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PersistentObjectTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PostFlushEventTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PostgreSQLIdentityStrategyTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/QueryTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ReadOnlyTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ReferenceProxyTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SQLFilterTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/CompanySchemaTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DDC214Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/PostgreSqlSchemaToolTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaValidatorTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SequenceGeneratorTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SingleTableInheritanceTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/StandardEntityPersisterTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1040Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1041Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1043Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1050Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1080Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1113Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1129Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1151Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1163Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC117Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1181Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1193Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1209Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1225Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1228Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1238Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1250Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1276Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1300Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1301Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1306Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1335Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1360Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1383Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1392Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1400Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1404Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1430Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1436Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC144Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1452Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1454Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1458Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1461Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1514Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1515Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1526Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1545Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1548Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1594Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1595Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC163Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1643Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1654Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1655Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC168Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1695Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1778Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC192Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC199Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC211Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC237Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC258Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC279Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC309Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC331Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC353Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC371Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC381Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC422Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC425Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC444Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC448Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC493Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC512Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC513Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC518Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC522Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC531Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC599Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC618Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC633Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC656Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC657Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC698Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC719Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC729Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC735Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC736Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC748Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC758Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC767Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC809Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC812Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC832Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC837Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC849Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC881Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC949Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC960Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC992Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket2481Test.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket69.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/TypeTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/TypeValueSqlTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/UnitOfWorkLifecycleTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ArrayHydratorTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/CustomHydratorTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/HydrationTestCase.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ObjectHydratorTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ResultSetMappingTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ScalarHydratorTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/SingleScalarHydratorTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Id/AssignedGeneratorTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Id/SequenceGeneratorTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataBuilderTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataLoadEventTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/DriverChainTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/StaticPHPMappingDriverTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/Symfony/AbstractDriverTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/Symfony/XmlDriverTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/Symfony/YamlDriverTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869Payment.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC1170Entity.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.User.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/CatNoId.dcm.xml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC117.DDC117Translation.dcm.xml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.xml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.xml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.xml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.xml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.xml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.yml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.yml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.yml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.yml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DirectoryTree.AbstractContentItem.dcm.yml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DirectoryTree.Directory.dcm.yml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DirectoryTree.File.dcm.yml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.yml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.Animal.dcm.yml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.yml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.User.dcm.yml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/HydrationPerformanceTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/InheritancePersisterPerformanceTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/InsertPerformanceTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/PersisterPerformanceTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/UnitOfWorkPerformanceTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/PersistentCollectionTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Proxy/AutoloaderTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Proxy/ProxyClassGeneratorTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Proxy/fixtures/NonNamespacedProxies.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/DeleteSqlGenerationTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/ExprTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/LexerTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/ParserResultTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/QueryTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/UpdateSqlGenerationTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/QueryBuilderTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommandTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/ConvertDoctrine1SchemaTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/AbstractClassMetadataExporterTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/AnnotationClassMetadataExporterTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/ClassMetadataExporterTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/PhpClassMetadataExporterTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/XmlClassMetadataExporterTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/YamlClassMetadataExporterTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/annotation/Doctrine.Tests.ORM.Tools.Export.User.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/php/Doctrine.Tests.ORM.Tools.Export.User.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/xml/Doctrine.Tests.ORM.Tools.Export.User.dcm.xml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/yaml/Doctrine.Tests.ORM.Tools.Export.User.dcm.yml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/CountWalkerTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryWalkerTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginationTestCase.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/WhereInWalkerTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/ResolveTargetEntityListenerTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/SetupTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/doctrine1schema/schema.yml delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/ORM/UnitOfWorkTest.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/OrmFunctionalTestCase.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/OrmPerformanceTestCase.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/OrmTestCase.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/TestInit.php delete mode 100644 vendor/doctrine/orm/tests/Doctrine/Tests/TestUtil.php delete mode 100644 vendor/doctrine/orm/tests/NativePhpunitTask.php delete mode 100644 vendor/doctrine/orm/tests/README.markdown delete mode 100644 vendor/doctrine/orm/tests/dbproperties.xml.dev delete mode 100644 vendor/doctrine/orm/tests/travis/mysql.travis.xml delete mode 100644 vendor/doctrine/orm/tests/travis/pgsql.travis.xml delete mode 100644 vendor/doctrine/orm/tests/travis/sqlite.travis.xml delete mode 100644 vendor/doctrine/orm/tools/sandbox/Entities/Address.php delete mode 100644 vendor/doctrine/orm/tools/sandbox/Entities/User.php delete mode 100644 vendor/doctrine/orm/tools/sandbox/cli-config.php delete mode 100755 vendor/doctrine/orm/tools/sandbox/doctrine delete mode 100644 vendor/doctrine/orm/tools/sandbox/doctrine.php delete mode 100644 vendor/doctrine/orm/tools/sandbox/index.php delete mode 100644 vendor/doctrine/orm/tools/sandbox/xml/Entities.Address.dcm.xml delete mode 100644 vendor/doctrine/orm/tools/sandbox/xml/Entities.User.dcm.xml delete mode 100644 vendor/doctrine/orm/tools/sandbox/yaml/Entities.Address.dcm.yml delete mode 100644 vendor/doctrine/orm/tools/sandbox/yaml/Entities.User.dcm.yml delete mode 160000 vendor/egeloen/ckeditor-bundle/Ivory/CKEditorBundle delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/Aop/InterceptorLoader.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/Aop/PointcutContainer.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/Aop/PointcutInterface.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/Aop/RegexPointcut.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/DependencyInjection/Compiler/PointcutMatchingPass.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/DependencyInjection/Configuration.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/DependencyInjection/JMSAopExtension.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/Exception/Exception.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/Exception/RuntimeException.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/JMSAopBundle.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/README delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/Resources/config/services.xml delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/Resources/doc/index.rst delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/Resources/meta/LICENSE delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/composer.json delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Aop/InterceptorLoader.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Aop/PointcutContainer.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Aop/PointcutInterface.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Aop/RegexPointcut.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/DependencyInjection/Compiler/PointcutMatchingPass.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/DependencyInjection/Configuration.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/DependencyInjection/JMSAopExtension.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Exception/Exception.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Exception/RuntimeException.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/JMSAopBundle.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/README delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Resources/config/services.xml delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Resources/doc/index.rst delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Resources/meta/LICENSE delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/Aop/InterceptorLoaderTest.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/Aop/RegexPointcutTest.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/DependencyInjection/Compiler/Fixture/LoggingInterceptor.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/DependencyInjection/Compiler/Fixture/LoggingPointcut.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/DependencyInjection/Compiler/Fixture/TestService.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/DependencyInjection/Compiler/PointcutMatchingPassTest.php delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/composer.json delete mode 100644 vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/phpunit.xml.dist delete mode 100644 vendor/jms/cg/LICENSE delete mode 100644 vendor/jms/cg/composer.json delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/LICENSE delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/README.rst delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/composer.json delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/phpunit.xml.dist delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/AbstractClassGenerator.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/ClassGeneratorInterface.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/ClassUtils.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/DefaultGeneratorStrategy.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/DefaultNamingStrategy.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/GeneratorStrategyInterface.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/NamingStrategyInterface.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/ReflectionUtils.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/AbstractPhpMember.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/DefaultNavigator.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/DefaultVisitor.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/DefaultVisitorInterface.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/GeneratorUtils.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/PhpClass.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/PhpFunction.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/PhpMethod.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/PhpParameter.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/PhpProperty.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/Writer.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/Enhancer.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/GeneratorInterface.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/InterceptionGenerator.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/InterceptorLoaderInterface.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/LazyInitializerGenerator.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/LazyInitializerInterface.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/MethodInterceptorInterface.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/MethodInvocation.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/RegexInterceptionLoader.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Version.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Core/ClassUtilsTest.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Core/DefaultGeneratorStrategyTest.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Core/ReflectionUtilsTest.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Core/generated/GenerationTestClass_A.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Core/generated/GenerationTestClass_B.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/AbstractPhpMemberTest.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/DefaultVisitorTest.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/Fixture/Entity.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/Fixture/generated/a_b_function.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/PhpClassTest.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/PhpFunctionTest.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/PhpMethodTest.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/PhpParameterTest.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/PhpPropertyTest.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/EnhancerTest.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/Entity.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/LazyLoadingInterceptor.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/MarkerInterface.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/SimpleClass.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/SluggableInterface.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/TraceInterceptor.php delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/generated/Entity__CG__LazyInitializing.php.gen delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/generated/SimpleClass__CG__Enhanced.php.gen delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/generated/SimpleClass__CG__Sluggable.php.gen delete mode 100644 vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/bootstrap.php delete mode 100644 vendor/jms/cg/src/CG/Core/AbstractClassGenerator.php delete mode 100644 vendor/jms/cg/src/CG/Core/ClassGeneratorInterface.php delete mode 100644 vendor/jms/cg/src/CG/Core/ClassUtils.php delete mode 100644 vendor/jms/cg/src/CG/Core/DefaultGeneratorStrategy.php delete mode 100644 vendor/jms/cg/src/CG/Core/DefaultNamingStrategy.php delete mode 100644 vendor/jms/cg/src/CG/Core/GeneratorStrategyInterface.php delete mode 100644 vendor/jms/cg/src/CG/Core/NamingStrategyInterface.php delete mode 100644 vendor/jms/cg/src/CG/Core/ReflectionUtils.php delete mode 100644 vendor/jms/cg/src/CG/Generator/AbstractPhpMember.php delete mode 100644 vendor/jms/cg/src/CG/Generator/DefaultNavigator.php delete mode 100644 vendor/jms/cg/src/CG/Generator/DefaultVisitor.php delete mode 100644 vendor/jms/cg/src/CG/Generator/DefaultVisitorInterface.php delete mode 100644 vendor/jms/cg/src/CG/Generator/GeneratorUtils.php delete mode 100644 vendor/jms/cg/src/CG/Generator/PhpClass.php delete mode 100644 vendor/jms/cg/src/CG/Generator/PhpFunction.php delete mode 100644 vendor/jms/cg/src/CG/Generator/PhpMethod.php delete mode 100644 vendor/jms/cg/src/CG/Generator/PhpParameter.php delete mode 100644 vendor/jms/cg/src/CG/Generator/PhpProperty.php delete mode 100644 vendor/jms/cg/src/CG/Generator/Writer.php delete mode 100644 vendor/jms/cg/src/CG/Proxy/Enhancer.php delete mode 100644 vendor/jms/cg/src/CG/Proxy/GeneratorInterface.php delete mode 100644 vendor/jms/cg/src/CG/Proxy/InterceptionGenerator.php delete mode 100644 vendor/jms/cg/src/CG/Proxy/InterceptorLoaderInterface.php delete mode 100644 vendor/jms/cg/src/CG/Proxy/LazyInitializerGenerator.php delete mode 100644 vendor/jms/cg/src/CG/Proxy/LazyInitializerInterface.php delete mode 100644 vendor/jms/cg/src/CG/Proxy/MethodInterceptorInterface.php delete mode 100644 vendor/jms/cg/src/CG/Proxy/MethodInvocation.php delete mode 100644 vendor/jms/cg/src/CG/Proxy/RegexInterceptionLoader.php delete mode 100644 vendor/jms/cg/src/CG/Version.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/AfterSetup.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/DoctrineListener.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/FormType.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Inject.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/InjectParams.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/LookupMethod.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Observe.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Reference.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Service.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Tag.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Validator.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Config/FastDirectoriesResource.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Config/ServiceFilesResource.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/Compiler/AnnotationConfigurationPass.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/Compiler/IntegrationPass.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/Compiler/ResourceOptimizationPass.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/Configuration.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/JMSDiExtraExtension.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/LookupMethodClassInterface.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/EventListener/ControllerListener.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/EventListener/TemplateListener.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Exception/Exception.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Exception/InvalidArgumentException.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Exception/InvalidTypeException.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Exception/RuntimeException.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Finder/PatternFinder.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Generator/DefinitionInjectorGenerator.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Generator/LookupMethodClassGenerator.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Generator/NameGenerator.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/HttpKernel/ControllerResolver.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/JMSDiExtraBundle.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Metadata/ClassMetadata.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Metadata/Driver/AnnotationDriver.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Metadata/MetadataConverter.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/README delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Resources/config/services.xml delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Resources/doc/index.rst delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Resources/meta/LICENSE delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/composer.json delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/AfterSetup.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/DoctrineListener.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/FormType.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Inject.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/InjectParams.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/LookupMethod.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Observe.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Reference.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Service.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Tag.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Validator.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Config/FastDirectoriesResource.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Config/ServiceFilesResource.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/Compiler/AnnotationConfigurationPass.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/Compiler/IntegrationPass.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/Compiler/ResourceOptimizationPass.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/Configuration.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/JMSDiExtraExtension.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/LookupMethodClassInterface.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/EventListener/ControllerListener.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/EventListener/TemplateListener.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Exception/Exception.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Exception/InvalidArgumentException.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Exception/InvalidTypeException.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Exception/RuntimeException.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Finder/PatternFinder.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Generator/DefinitionInjectorGenerator.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Generator/LookupMethodClassGenerator.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Generator/NameGenerator.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/HttpKernel/ControllerResolver.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/JMSDiExtraBundle.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Metadata/ClassMetadata.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Metadata/Driver/AnnotationDriver.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Metadata/MetadataConverter.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/README delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Resources/config/services.xml delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Resources/doc/index.rst delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Resources/meta/LICENSE delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/DependencyInjection/Compiler/AnnotationConfigurationPassTest.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/DependencyInjection/Compiler/Fixtures/a/b/.gitkeep delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/DependencyInjection/Compiler/Fixtures/c/.gitkeep delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/DependencyInjection/Compiler/ResourceOptimizationPassTest.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Finder/AbstractPatternFinderTest.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Finder/FindstrPatternFinderTest.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Finder/GrepPatternFinderTest.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Finder/PhpPatternFinderTest.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/EmptyDirectory/.gitkeep delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/LoginController.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/NonEmptyDirectory/DummyFile.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/NonEmptyDirectory/Service1.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/NonEmptyDirectory/SubDir1/NonPhpFile.txt delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/NonEmptyDirectory/SubDir1/Service2.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/NonEmptyDirectory/SubDir2/Service3.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/RequestListener.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/Validator/Validator.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/AppKernel.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/BaseTestCase.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Controller/AnotherSecuredController.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Controller/RegisterController.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Controller/SecuredController.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Inheritance/AbstractClass.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Inheritance/ConcreteClass.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/JMSDiExtraTestBundle.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Mailer/TestMailer.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/ControllerResolverTest.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Issue11Test.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/config/default.yml delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/config/framework.yml delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/config/routing.yml delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/config/security.yml delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/config/twig.yml delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Metadata/ClassMetadataTest.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Metadata/Driver/AnnotationDriverTest.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Metadata/Driver/Fixture/LoginType.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Metadata/Driver/Fixture/SignUpType.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/PerformanceTest.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/bootstrap.php delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/composer.json delete mode 100644 vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/phpunit.xml.dist delete mode 100644 vendor/jms/metadata/CHANGELOG.md delete mode 100644 vendor/jms/metadata/LICENSE delete mode 100644 vendor/jms/metadata/composer.json delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/CHANGELOG.md delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/LICENSE delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/README.rst delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/composer.json delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/phpunit.xml.dist delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Cache/CacheInterface.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Cache/FileCache.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/ClassHierarchyMetadata.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/ClassMetadata.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/AbstractFileDriver.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/DriverChain.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/DriverInterface.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/FileLocator.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/FileLocatorInterface.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/LazyLoadingDriver.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/MergeableClassMetadata.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/MergeableInterface.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/MetadataFactory.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/MetadataFactoryInterface.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/MethodMetadata.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/PropertyMetadata.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Version.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Cache/FileCacheTest.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/ClassMetadataTest.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Driver/DriverChainTest.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Driver/FileLocatorTest.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Driver/Fixture/A/A.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Driver/Fixture/A/A.xml delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Driver/Fixture/B/B.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Driver/Fixture/B/B.yml delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Driver/Fixture/C/SubDir.C.yml delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Driver/Fixture/C/SubDir/C.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Fixtures/ComplexHierarchy/BaseClass.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Fixtures/ComplexHierarchy/InterfaceA.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Fixtures/ComplexHierarchy/InterfaceB.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Fixtures/ComplexHierarchy/SubClassA.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Fixtures/ComplexHierarchy/SubClassB.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Fixtures/TestObject.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Fixtures/TestParent.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/MergeableClassMetadataTest.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/MetadataFactoryTest.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/MethodMetadataTest.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/PropertyMetadataTest.php delete mode 100644 vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/bootstrap.php delete mode 100644 vendor/jms/metadata/src/Metadata/Cache/CacheInterface.php delete mode 100644 vendor/jms/metadata/src/Metadata/Cache/FileCache.php delete mode 100644 vendor/jms/metadata/src/Metadata/ClassHierarchyMetadata.php delete mode 100644 vendor/jms/metadata/src/Metadata/ClassMetadata.php delete mode 100644 vendor/jms/metadata/src/Metadata/Driver/AbstractFileDriver.php delete mode 100644 vendor/jms/metadata/src/Metadata/Driver/DriverChain.php delete mode 100644 vendor/jms/metadata/src/Metadata/Driver/DriverInterface.php delete mode 100644 vendor/jms/metadata/src/Metadata/Driver/FileLocator.php delete mode 100644 vendor/jms/metadata/src/Metadata/Driver/FileLocatorInterface.php delete mode 100644 vendor/jms/metadata/src/Metadata/Driver/LazyLoadingDriver.php delete mode 100644 vendor/jms/metadata/src/Metadata/MergeableClassMetadata.php delete mode 100644 vendor/jms/metadata/src/Metadata/MergeableInterface.php delete mode 100644 vendor/jms/metadata/src/Metadata/MetadataFactory.php delete mode 100644 vendor/jms/metadata/src/Metadata/MetadataFactoryInterface.php delete mode 100644 vendor/jms/metadata/src/Metadata/MethodMetadata.php delete mode 100644 vendor/jms/metadata/src/Metadata/PropertyMetadata.php delete mode 100644 vendor/jms/metadata/src/Metadata/Version.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/PreAuthorize.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/RunAs.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/SatisfiesParentSecurityPolicy.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/Secure.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/SecureParam.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/SecureReturn.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/CHANGELOG-1.1.md delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/AccessControlConfiguration.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Compiler/AddAfterInvocationProvidersPass.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Compiler/AddExpressionCompilersPass.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Compiler/CollectSecuredServicesPass.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Compiler/DisableVotersPass.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Compiler/IntegrationPass.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Configuration.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/JMSSecurityExtraExtension.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/SecurityExtension.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Exception/Exception.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Exception/InvalidArgumentException.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Exception/RuntimeException.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/JMSSecurityExtraBundle.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Metadata/ClassMetadata.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Metadata/Driver/AnnotationDriver.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Metadata/Driver/ConfigDriver.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Metadata/MethodMetadata.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/README delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Resources/config/security_expressions.xml delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Resources/config/services.xml delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Resources/doc/index.rst delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Resources/meta/LICENSE delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Acl/Expression/HasPermissionFunctionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Acl/Expression/PermissionEvaluator.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Acl/Voter/AclVoter.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authentication/Provider/RunAsAuthenticationProvider.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authentication/Token/RunAsUserToken.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/AfterInvocation/AclAfterInvocationProvider.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/AfterInvocation/AfterInvocationManager.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/AfterInvocation/AfterInvocationManagerInterface.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/AfterInvocation/AfterInvocationProviderInterface.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/AndExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/ArrayExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/ConstantExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/ExpressionInterface.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/FunctionExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/GetItemExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/GetPropertyExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/IsEqualExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/MethodCallExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/NotExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/OrExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/ParameterExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/VariableExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/AndExpressionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/BinaryExprCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/ContainerAwareVariableCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/AuthenticationTrustFunctionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/FunctionCompilerInterface.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/HasAnyRoleFunctionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/HasRoleFunctionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/IsAnonymousFunctionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/IsAuthenticatedFunctionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/IsFullyAuthenticatedFunctionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/IsRememberMeFunctionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/IsEqualExpressionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/NotExpressionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/OrExpressionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/ParameterExpressionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/TypeCompilerInterface.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/VariableExpressionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ContainerAwareExpressionHandler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/DefaultExpressionHandler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Expression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ExpressionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ExpressionHandlerInterface.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ExpressionLexer.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ExpressionParser.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ExpressionVoter.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/LazyLoadingExpressionVoter.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Interception/MethodSecurityInterceptor.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Interception/SecurityPointcut.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/RunAsManager.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/RunAsManagerInterface.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Voter/IddqdVoter.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Twig/SecurityExtension.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/composer.json delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/PreAuthorize.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/RunAs.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/SatisfiesParentSecurityPolicy.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/Secure.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/SecureParam.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/SecureReturn.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/CHANGELOG-1.1.md delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/AccessControlConfiguration.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Compiler/AddAfterInvocationProvidersPass.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Compiler/AddExpressionCompilersPass.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Compiler/CollectSecuredServicesPass.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Compiler/DisableVotersPass.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Compiler/IntegrationPass.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Configuration.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/JMSSecurityExtraExtension.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/SecurityExtension.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Exception/Exception.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Exception/InvalidArgumentException.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Exception/RuntimeException.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/JMSSecurityExtraBundle.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Metadata/ClassMetadata.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Metadata/Driver/AnnotationDriver.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Metadata/Driver/ConfigDriver.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Metadata/MethodMetadata.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/README delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Resources/config/security_expressions.xml delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Resources/config/services.xml delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Resources/doc/index.rst delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Resources/meta/LICENSE delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Acl/Expression/HasPermissionFunctionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Acl/Expression/PermissionEvaluator.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Acl/Voter/AclVoter.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authentication/Provider/RunAsAuthenticationProvider.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authentication/Token/RunAsUserToken.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/AfterInvocation/AclAfterInvocationProvider.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/AfterInvocation/AfterInvocationManager.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/AfterInvocation/AfterInvocationManagerInterface.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/AfterInvocation/AfterInvocationProviderInterface.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/AndExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/ArrayExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/ConstantExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/ExpressionInterface.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/FunctionExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/GetItemExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/GetPropertyExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/IsEqualExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/MethodCallExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/NotExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/OrExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/ParameterExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/VariableExpression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/AndExpressionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/BinaryExprCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/ContainerAwareVariableCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/AuthenticationTrustFunctionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/FunctionCompilerInterface.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/HasAnyRoleFunctionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/HasRoleFunctionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/IsAnonymousFunctionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/IsAuthenticatedFunctionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/IsFullyAuthenticatedFunctionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/IsRememberMeFunctionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/IsEqualExpressionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/NotExpressionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/OrExpressionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/ParameterExpressionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/TypeCompilerInterface.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/VariableExpressionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ContainerAwareExpressionHandler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/DefaultExpressionHandler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Expression.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ExpressionCompiler.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ExpressionHandlerInterface.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ExpressionLexer.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ExpressionParser.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ExpressionVoter.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/LazyLoadingExpressionVoter.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Interception/MethodSecurityInterceptor.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Interception/SecurityPointcut.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/RunAsManager.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/RunAsManagerInterface.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Voter/IddqdVoter.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/DependencyInjection/Compiler/AddAfterInvocationProvidersPassTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/DependencyInjection/Compiler/CollectSecuredServicesPassTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/DependencyInjection/JMSSecurityExtraExtensionTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/AbstractMethodNotDirectlyOverwrittenInDirectChildService.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/Annotation/NonSecurityAnnotation.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/ComplexService.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/CorrectSubService.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/MainService.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/SubService.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/AppKernel.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/BaseTestCase.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/MethodAccessControlTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/Resources/views/base.html.twig delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/Controller/CrudController.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/Controller/PostController.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/Entity/Post.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/Logger/FileLogger.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/Resources/views/is_expr_granted.html.twig delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/TestBundle.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/User/UserManager.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TwigIntegrationTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/VoterDisablingTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/acl_enabled.yml delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/all_voters_disabled.yml delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/default.yml delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/doctrine.yml delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/framework.yml delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/method_access_control.yml delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/routing.yml delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/security.yml delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/some_voters_disabled.yml delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/twig.yml delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Metadata/ClassMetadataTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Metadata/Driver/AnnotationDriverTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Metadata/Driver/ConfigDriverTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Metadata/Driver/Fixtures/Controller/CrudController.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Metadata/Driver/Fixtures/services.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Acl/Expression/HasPermissionFunctionCompilerTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Acl/Expression/PermissionEvaluatorTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Acl/Voter/AclVoterTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authentication/Provider/RunAsAuthenticationProviderTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authentication/Token/RunAsUserTokenTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/AfterInvocation/AclAfterInvocationProviderTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/AfterInvocation/AfterInvocationManagerTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/ExpressionCompilerTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/ExpressionLexerTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/ExpressionParserTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/ExpressionVoterTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/Fixture/Issue22/Project.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/Fixture/Issue22/SecuredObject.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/ParameterExpressionCompilerTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Interception/MethodSecurityInterceptorTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Interception/SecurityPointcutTest.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Twig/SecurityExtension.php delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/composer.json delete mode 100644 vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/phpunit.xml.dist delete mode 100644 vendor/kriswallsmith/assetic/.gitignore delete mode 100644 vendor/kriswallsmith/assetic/.travis.yml delete mode 100644 vendor/kriswallsmith/assetic/CHANGELOG-1.0.md delete mode 100755 vendor/kriswallsmith/assetic/CHANGELOG-1.1.md delete mode 100644 vendor/kriswallsmith/assetic/LICENSE delete mode 100644 vendor/kriswallsmith/assetic/README.md delete mode 100644 vendor/kriswallsmith/assetic/composer.json delete mode 100644 vendor/kriswallsmith/assetic/docs/en/build.md delete mode 100644 vendor/kriswallsmith/assetic/docs/en/concepts.md delete mode 100644 vendor/kriswallsmith/assetic/docs/en/define.md delete mode 100644 vendor/kriswallsmith/assetic/docs/en/index.md delete mode 100644 vendor/kriswallsmith/assetic/docs/en/introduction.md delete mode 100644 vendor/kriswallsmith/assetic/docs/ja/build.md delete mode 100644 vendor/kriswallsmith/assetic/docs/ja/concepts.md delete mode 100644 vendor/kriswallsmith/assetic/docs/ja/define.md delete mode 100644 vendor/kriswallsmith/assetic/docs/ja/index.md delete mode 100644 vendor/kriswallsmith/assetic/docs/ja/introduction.md delete mode 100644 vendor/kriswallsmith/assetic/phpunit.travis.xml delete mode 100644 vendor/kriswallsmith/assetic/phpunit.xml.dist delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCache.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollection.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollectionInterface.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetInterface.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetReference.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/BaseAsset.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/FileAsset.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/GlobAsset.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/HttpAsset.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionFilterIterator.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionIterator.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Asset/StringAsset.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/AssetManager.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/AssetWriter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Cache/ApcCache.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Cache/CacheInterface.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Cache/ConfigCache.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Cache/ExpiringCache.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Cache/FilesystemCache.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Exception/Exception.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Exception/FilterException.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticExtension.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterFunction.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterInvoker.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticNode.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticTokenParser.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigFormulaLoader.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigResource.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/AssetFactory.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/LazyAssetManager.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/BasePhpFormulaLoader.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/CachedFormulaLoader.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/FormulaLoaderInterface.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/FunctionCallsFormulaLoader.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/CoalescingDirectoryResource.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/DirectoryResource.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/FileResource.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/IteratorResourceInterface.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/ResourceInterface.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/EnsureFilterWorker.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/WorkerInterface.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/BaseCssFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/CallablesFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/CoffeeScriptFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/CompassFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/CssEmbedFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/CssImportFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/CssMinFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/CssRewriteFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterCollection.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterInterface.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/BaseCompilerFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerApiFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerJarFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/GssFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/HashableInterface.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/JSMinFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/JSMinPlusFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegoptimFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegtranFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/LessFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/LessphpFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/OptiPngFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/PackagerFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/PackerFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/PngoutFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/SassFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/ScssFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/SprocketsFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/StylusFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/UglifyJsFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/BaseCompressorFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/CssCompressorFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/JsCompressorFilter.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/FilterManager.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Util/PathUtils.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/Util/TraversableString.php delete mode 100644 vendor/kriswallsmith/assetic/src/Assetic/ValueSupplierInterface.php delete mode 100644 vendor/kriswallsmith/assetic/src/functions.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetCacheTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetCollectionTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetReferenceTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/FileAssetTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/GlobAssetTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/HttpAssetTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/StringAssetTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/AssetManagerTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/AssetWriterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ApcCacheTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ConfigCacheTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ExpiringCacheTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/FilesystemCacheTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/AsseticExtensionTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/TwigFormulaLoaderTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/TwigResourceTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/absolute_path.twig delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/combine.twig delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/debug.twig delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/filters.twig delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/function.twig delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/glob.twig delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/image.twig delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/mixture.twig delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/optional_filter.twig delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/output_pattern.twig delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/output_url.twig delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/reference.twig delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/variables.twig delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/AssetFactoryTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/LazyAssetManagerTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/CachedFormulaLoaderTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/FunctionCallsFormulaLoaderTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/templates/debug.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/CoalescingDirectoryResourceTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/DirectoryResourceTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/FileResourceTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir1/file1.txt delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir1/file2.txt delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir2/file1.txt delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir2/file3.txt delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Worker/EnsureFilterWorkerTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/BaseImageFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CallablesFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CoffeeScriptFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CompassFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssEmbedFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssImportFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssMinFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssRewriteFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/FilterCollectionTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GoogleClosure/CompilerApiFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GoogleClosure/CompilerJarFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GssFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JSMinFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JSMinPlusFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JpegoptimFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JpegtranFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/LessFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/LessphpFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/OptiPngFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PackagerFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PackerFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PngoutFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Sass/SassFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Sass/ScssFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/SprocketsFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/StylusFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/UglifyJsFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/BaseCompressorFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/CssCompressorFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/JsCompressorFilterTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/compass.sass delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/partials/_sass.sass delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/partials/_scss.scss delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/stylesheet.sass delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/stylesheet.scss delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssembed/test.css delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/import.css delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/main.css delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more.sass delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/bg.gif delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/deep1.css delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/deep2.css delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/noncssimport.css delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssmin/fonts.css delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssmin/main.css delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/home.gif delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/home.jpg delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/home.png delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/jsmin/js.js delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/less/_include.less delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/less/main.less delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/packager/app/application.js delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/packager/lib/package.yml delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/packager/lib/util.js delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/packer/example.js delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sass/_include.scss delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sass/main.scss delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/include.js delete mode 100755 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/lib1/assets/images/image.gif delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/lib1/header.js delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/lib2/footer.js delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/main.js delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/uglifyjs/script.js delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/FilterManagerTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Fixture/messages.de.js delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Fixture/messages.en.js delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Fixture/messages.fr.js delete mode 100644 vendor/kriswallsmith/assetic/tests/Assetic/Test/Util/TraversableStringTest.php delete mode 100644 vendor/kriswallsmith/assetic/tests/bootstrap.php delete mode 100644 vendor/monolog/monolog/.travis.yml delete mode 100644 vendor/monolog/monolog/CHANGELOG.mdown delete mode 100644 vendor/monolog/monolog/LICENSE delete mode 100644 vendor/monolog/monolog/README.mdown delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/.gitignore delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/.travis.yml delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/CHANGELOG.mdown delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/LICENSE delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/README.mdown delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/composer.json delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/doc/extending.md delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/doc/sockets.md delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/doc/usage.md delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/phpunit.xml.dist delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/ChromePHPFormatter.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/FormatterInterface.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/GelfMessageFormatter.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/JsonFormatter.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/LineFormatter.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/NormalizerFormatter.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/WildfireFormatter.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/AbstractHandler.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/AbstractProcessingHandler.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/BufferHandler.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/ChromePHPHandler.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/FingersCrossedHandler.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/FirePHPHandler.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/GelfHandler.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/GroupHandler.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/HandlerInterface.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/MailHandler.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/MongoDBHandler.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/NativeMailerHandler.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/NullHandler.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/RotatingFileHandler.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/SocketHandler.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/StreamHandler.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/SwiftMailerHandler.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/SyslogHandler.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/TestHandler.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Logger.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Processor/IntrospectionProcessor.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Processor/MemoryPeakUsageProcessor.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Processor/MemoryProcessor.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Processor/MemoryUsageProcessor.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Processor/WebProcessor.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/ChromePHPFormatterTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/GelfMessageFormatterTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/JsonFormatterTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/LineFormatterTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/NormalizerFormatterTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/WildfireFormatterTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Functional/Handler/FirePHPHandlerTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/AbstractHandlerTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/AbstractProcessingHandlerTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/BufferHandlerTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/ChromePHPHandlerTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/FingersCrossedHandlerTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/FirePHPHandlerTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/Fixtures/.gitkeep delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/GelfHandlerTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/GroupHandlerTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/MailHandlerTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/MongoDBHandlerTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/NullHandlerTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/RotatingFileHandlerTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/SocketHandlerTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/StreamHandlerTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/SyslogHandlerTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/TestHandlerTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/LoggerTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Processor/IntrospectionProcessorTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Processor/MemoryUsageProcessorTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Processor/WebProcessorTest.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/TestCase.php delete mode 100644 vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/bootstrap.php delete mode 100644 vendor/monolog/monolog/composer.json delete mode 100644 vendor/monolog/monolog/doc/extending.md delete mode 100644 vendor/monolog/monolog/doc/sockets.md delete mode 100644 vendor/monolog/monolog/doc/usage.md delete mode 100644 vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Logger.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Composer/ScriptHandler.php delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Configurator.php delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Form/DoctrineStepType.php delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Form/SecretStepType.php delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Step/DoctrineStep.php delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Step/SecretStep.php delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Step/StepInterface.php delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Controller/ConfiguratorController.php delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/DependencyInjection/SensioDistributionExtension.php delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/LICENSE delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build.sh delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/config/routing/webconfigurator.xml delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/config/webconfigurator.xml delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/css/configure.css delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/css/install.css delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/images/background-textfield.gif delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/images/blue-arrow.png delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/images/favicon.ico delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/images/logo-big.gif delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/images/logo-small.gif delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/images/notification.gif delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/app/SymfonyRequirements.php delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/app/check.php delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/web/config.php delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/Step/doctrine.html.twig delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/Step/secret.html.twig delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/check.html.twig delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/final.html.twig delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/form.html.twig delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/layout.html.twig delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/steps.html.twig delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/SensioDistributionBundle.php delete mode 100644 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/composer.json delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/.gitignore delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/.travis.yml delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/CHANGELOG-2.1.md delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Cache.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/ConfigurationAnnotation.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/ConfigurationInterface.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Method.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/ParamConverter.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Route.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Template.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/DependencyInjection/Compiler/AddParamConverterPass.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/DependencyInjection/Configuration.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/DependencyInjection/SensioFrameworkExtraExtension.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/EventListener/CacheListener.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/EventListener/ControllerListener.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/EventListener/ParamConverterListener.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/EventListener/TemplateListener.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/LICENSE delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/README.md delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/DateTimeParamConverter.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/DoctrineParamConverter.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/ParamConverterInterface.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/ParamConverterManager.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/annotations.xml delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/cache.xml delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/converters.xml delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/routing.xml delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/services.xml delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/view.xml delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/cache.rst delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/converters.rst delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/routing.rst delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/view.rst delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/index.rst delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Routing/AnnotatedRouteControllerLoader.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/SensioFrameworkExtraBundle.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Templating/TemplateGuesser.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/Configuration/ConfigurationAnnotationTest.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/EventListener/CacheListenerTest.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/EventListener/ControllerListenerTest.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/EventListener/Fixture/FooControllerCacheAtClass.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/EventListener/Fixture/FooControllerCacheAtClassAndMethod.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/EventListener/Fixture/FooControllerCacheAtMethod.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/EventListener/ParamConverterListenerTest.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/Request/ParamConverter/DateTimeParamConverterTest.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/Request/ParamConverter/DoctrineParamConverterTest.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/Request/ParamConverter/ParamConverterManagerTest.php delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/UPGRADE.md delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/composer.json delete mode 100644 vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/phpunit.xml.dist delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/.gitignore delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/.travis.yml delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateBundleCommand.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineCommand.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineCrudCommand.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineEntityCommand.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineFormCommand.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/Helper/DialogHelper.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/Validators.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Generator/BundleGenerator.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Generator/DoctrineCrudGenerator.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Generator/DoctrineEntityGenerator.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Generator/DoctrineFormGenerator.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Generator/Generator.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/LICENSE delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Manipulator/KernelManipulator.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Manipulator/Manipulator.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Manipulator/RoutingManipulator.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/README.md delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/doc/commands/generate_bundle.rst delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/doc/commands/generate_doctrine_crud.rst delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/doc/commands/generate_doctrine_entity.rst delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/doc/commands/generate_doctrine_form.rst delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/doc/index.rst delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/Bundle.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/Configuration.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/DefaultController.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/DefaultControllerTest.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/Extension.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/index.html.twig delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/messages.fr.xlf delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/routing.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/routing.xml delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/routing.yml delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/services.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/services.xml delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/services.yml delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/create.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/delete.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/edit.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/index.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/new.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/show.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/update.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/config/routing.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/config/routing.xml delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/config/routing.yml delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/controller.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/tests/others/full_scenario.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/tests/others/short_scenario.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/tests/test.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/edit.html.twig delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/index.html.twig delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/new.html.twig delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/others/actions.html.twig delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/others/record_actions.html.twig delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/show.html.twig delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/form/FormType.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/SensioGeneratorBundle.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateBundleCommandTest.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateCommandTest.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateDoctrineCrudCommandTest.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateDoctrineEntityCommandTest.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Generator/BundleGeneratorTest.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Generator/DoctrineCrudGeneratorTest.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Generator/DoctrineFormGeneratorTest.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Generator/GeneratorTest.php delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/composer.json delete mode 100644 vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/phpunit.xml.dist delete mode 100644 vendor/swiftmailer/swiftmailer/.gitignore delete mode 100644 vendor/swiftmailer/swiftmailer/CHANGES delete mode 100644 vendor/swiftmailer/swiftmailer/LICENSE delete mode 100644 vendor/swiftmailer/swiftmailer/README delete mode 100644 vendor/swiftmailer/swiftmailer/README.git delete mode 100644 vendor/swiftmailer/swiftmailer/VERSION delete mode 100644 vendor/swiftmailer/swiftmailer/build.xml delete mode 100644 vendor/swiftmailer/swiftmailer/composer.json delete mode 100644 vendor/swiftmailer/swiftmailer/create_pear_package.php delete mode 100644 vendor/swiftmailer/swiftmailer/doc/headers.rst delete mode 100644 vendor/swiftmailer/swiftmailer/doc/help-resources.rst delete mode 100644 vendor/swiftmailer/swiftmailer/doc/including-the-files.rst delete mode 100644 vendor/swiftmailer/swiftmailer/doc/index.rst delete mode 100644 vendor/swiftmailer/swiftmailer/doc/installing.rst delete mode 100644 vendor/swiftmailer/swiftmailer/doc/introduction.rst delete mode 100644 vendor/swiftmailer/swiftmailer/doc/japanese.rst delete mode 100644 vendor/swiftmailer/swiftmailer/doc/messages.rst delete mode 100644 vendor/swiftmailer/swiftmailer/doc/overview.rst delete mode 100644 vendor/swiftmailer/swiftmailer/doc/plugins.rst delete mode 100644 vendor/swiftmailer/swiftmailer/doc/sending.rst delete mode 100644 vendor/swiftmailer/swiftmailer/doc/uml/Encoders.graffle delete mode 100644 vendor/swiftmailer/swiftmailer/doc/uml/Mime.graffle delete mode 100644 vendor/swiftmailer/swiftmailer/doc/uml/Transports.graffle delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Attachment.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/ArrayByteStream.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/FileByteStream.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/UsAsciiReader.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/Utf8Reader.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReaderFactory.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReaderFactory/SimpleCharacterReaderFactory.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/ArrayCharacterStream.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/NgCharacterStream.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/ConfigurableSpool.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyException.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/EmbeddedFile.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Base64Encoder.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/QpEncoder.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Rfc2231Encoder.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoding.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandEvent.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandListener.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/Event.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/EventDispatcher.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/EventListener.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/EventObject.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseEvent.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseListener.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SendEvent.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SendListener.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SimpleEventDispatcher.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeEvent.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeListener.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportExceptionEvent.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportExceptionListener.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/FailoverTransport.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileSpool.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileStream.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Filterable.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Image.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/InputByteStream.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/IoException.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/ArrayKeyCache.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DummyKeyCache.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/KeyCacheInputStream.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/NullKeyCache.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/SimpleKeyCacheInputStream.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/LoadBalancedTransport.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/MailTransport.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/ArrayRecipientIterator.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/RecipientIterator.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/MemorySpool.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Attachment.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/CharsetObserver.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EmbeddedFile.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EncodingObserver.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Grammar.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Header.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/Base64HeaderEncoder.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderFactory.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderSet.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/AbstractHeader.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/DateHeader.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/UnstructuredHeader.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Message.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/MimeEntity.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/MimePart.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ParameterizedHeader.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderFactory.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/MimePart.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/NullTransport.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/OutputByteStream.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/AntiFloodPlugin.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Decorator/Replacements.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/DecoratorPlugin.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ImpersonatePlugin.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Logger.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/EchoLogger.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/MessageLogger.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Pop/Pop3Connection.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Pop/Pop3Exception.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/PopBeforeSmtpPlugin.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/RedirectingPlugin.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporter.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ReporterPlugin.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HitReporter.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HtmlReporter.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Sleeper.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ThrottlerPlugin.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Timer.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Preferences.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/ReplacementFilterFactory.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/RfcComplianceException.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/SendmailTransport.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Spool.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/SpoolTransport.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilter.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/ByteArrayReplacementFilter.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilter.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilterFactory.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/SwiftException.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Authenticator.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpHandler.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/FailoverTransport.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/IoBuffer.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/LoadBalancedTransport.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/MailInvoker.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/MailTransport.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/NullTransport.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SimpleMailInvoker.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SmtpAgent.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SpoolTransport.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/TransportException.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/classes/Swift/Validate.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/dependency_maps/cache_deps.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/dependency_maps/message_deps.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/dependency_maps/mime_deps.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/dependency_maps/transport_deps.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/mime_types.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/preferences.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/swift_init.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/swift_required.php delete mode 100644 vendor/swiftmailer/swiftmailer/lib/swift_required_pear.php delete mode 100644 vendor/swiftmailer/swiftmailer/notes/APPS delete mode 100644 vendor/swiftmailer/swiftmailer/notes/CHARSETS delete mode 100644 vendor/swiftmailer/swiftmailer/notes/message.xml delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc0821.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc0822.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc1341.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc1521.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc1854.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc2045.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc2046.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc2047.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc2048.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc2049.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc2183.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc2222.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc2231.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc2234.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc2487.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc2554.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc2821.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc2822.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc3676.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc4505.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc4616.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/rfc4954.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/rfc/whats_where.txt delete mode 100644 vendor/swiftmailer/swiftmailer/notes/smtp.txt delete mode 100644 vendor/swiftmailer/swiftmailer/package.xml.tpl delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/CHANGES delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/LICENSE delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/README delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/config.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/index.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Reporter.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Reporter/CliReporter.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Reporter/CliTestCaseReporter.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Reporter/HtmlReporter.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Reporter/HtmlTestCaseReporter.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Runner.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Runner/AbstractTestRunner.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Runner/CliRunner.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Runner/HtmlRunner.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/TestLocator.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/TestLocator/PearStyleLocator.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/HELP_MY_TESTS_DONT_WORK_ANYMORE delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/LICENSE delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/README delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/TODO.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/VERSION delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/authentication.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/autorun.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/browser.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/collector.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/compatibility.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/cookies.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/default_reporter.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/detached.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/en/docs.css delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/fr/docs.css delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/lastcraft/README delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/onpk/README delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/pkg/README delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/README delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/favicon.ico delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/book-domain-driven-design.jpg delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/book-guide-to-php-design-patterns.jpg delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/book-the-php-anthology-object-oriented-php-solutions.jpg delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/quote.png delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/simpletest-contribute.png delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/simpletest-download.png delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/simpletest-external-bottom.png delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/simpletest-external-middle.png delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/simpletest-external-top.png delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/simpletest-internal-bottom.png delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/simpletest-internal-middle.png delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/simpletest-internal-top.png delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/simpletest-logo.png delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/simpletest-start-testing.png delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/simpletest-support.png delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/test-in-cli.png delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/test-with-1-fail.png delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/test-with-1-pass.png delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/index.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/js/jquery-1.2.1.pack.js delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/js/jquery-speakers_coaches_consultants.js delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/js/jquery.heartbeat.js delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/js/jquery.sparkline.js delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/simpletest.css delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/views/heartbeat.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/views/photos_stream.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/about.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/authentication_documentation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/books_website.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/boundary_classes_tutorial.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/browser_documentation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/changelog.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/coding_standards.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/display_subclass_tutorial.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/download_website.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/expectation_documentation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/experimental_dom_tester.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/experimental_intro.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/experimental_recorder.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/extension_eclipse.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/first_test_tutorial.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/form_testing_documentation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/gain_control_tutorial.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/group_test_documentation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/group_test_tutorial.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/heartbeat.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/ideas.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/improving_design_tutorial.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/index.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/intro.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/mock_objects_documentation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/mock_objects_tutorial.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/overview.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/partial_mocks_documentation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/photos_stream.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/reporter_documentation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/screencasts.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/simple_test.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/softwares_using_simpletest.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/speakers_coaches_consultancy.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/subclass_tutorial.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/support_website.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/unit_test_documentation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/web_tester_documentation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/writing_extensions.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/authentication_documentation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/books_website.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/boundary_classes_tutorial.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/browser_documentation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/display_subclass_tutorial.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/download_website.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/expectation_documentation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/extension_eclipse.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/first_test_tutorial.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/form_testing_documentation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/gain_control_tutorial.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/group_test_documentation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/group_test_tutorial.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/improving_design_tutorial.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/index.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/intro.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/logiciels_utilisant_simpletest.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/mock_objects_documentation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/mock_objects_tutorial.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/overview.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/partial_mocks_documentation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/reporter_documentation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/simple_test.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/subclass_tutorial.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/support_website.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/unit_test_documentation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/web_tester_documentation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/dumper.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/eclipse.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/encoding.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/errors.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/exceptions.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/expectation.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/colortext_reporter.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/css/webunit.css delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester/css_selector.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester/test/dom_tester_doc_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester/test/dom_tester_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester/test/support/child_adjacent.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester/test/support/dom_tester.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/img/wait.gif delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/js/tests/TestOfWebunit.js.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/js/webunit.js delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/js/x.js delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/junit_xml_reporter.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/pear_test_case.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/recorder.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/recorder/test/sample.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/recorder/test/test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/selenese_tester.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/selenium.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/selenium/remote-control.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/selenium/test/remote-control_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/testdox.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/testdox/test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/treemap_reporter.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/treemap_reporter/jquery.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/treemap_reporter/test/treemap_node_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/treemap_reporter/treemap_recorder.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/webunit_reporter.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/form.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/frames.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/http.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/invoker.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/mock_objects.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/README delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/build_tarball.sh delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/bundled_docs.xslt delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/bundled_map.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/extension.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/generate_package.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/lastcraft.xslt delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/make_bundled_docs.sh delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/make_bundled_docs_with_xalan.sh delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/make_lastcraft_docs.sh delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/make_phpdoc_docs.sh delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/onpk/map_onpk.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/onpk/onpk.xslt delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/onpk/transform_all_onpk.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/package.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/pear_package_create.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/phpdoc_docs.xslt delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.ini delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/index.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/integration.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/map.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/package.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/template.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/content_without_section.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/en/synchronisation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/fr/no-synchronisation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/fr/synchronisation.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_download.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_overview.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_simpletest.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_start_testing.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_support.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_unit-tester.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/map.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/one_section_changelogged.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/one_section_milestoned.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/one_section_with_autorum_php.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/one_section_with_php_code.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/site_map.xml delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/transform_all_lastcraft.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/page.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/parser.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/reflection_php4.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/reflection_php5.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/remote.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/reporter.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/scorer.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/selector.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/shell_tester.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/simpletest.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/socket.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tag.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/acceptance_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/adapter_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/all_tests.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/authentication_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/autorun_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/bad_test_suite.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/browser_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/collector_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/command_line_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/compatibility_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/cookies_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/detached_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/dumper_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/eclipse_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/encoding_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/errors_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/exceptions_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/expectation_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/extensions_tests.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/form_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/frames_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/http_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/interfaces_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/interfaces_test_php5_1.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/live_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/mock_objects_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/page_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/parse_error_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/parser_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/reflection_php4_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/reflection_php5_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/remote_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/shell_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/shell_tester_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/simpletest_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/.htaccess delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/1.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/2.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/3.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_change_redirect.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/base_link.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/form.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/frameset.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/frameset_with_base_tag.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/page_1.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/page_2.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/relative_link.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/cookie_based_counter.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/counting_frameset.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/double_base_change_redirect.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/file.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_data_encoded_form.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_array_based_inputs.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_false_defaults.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_mixed_post_and_get.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_quoted_values.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_radio_buttons.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_tricky_defaults.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_unnamed_submit.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_without_action.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/frame_a.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/frame_b.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/frame_links.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/frameset.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/front_controller_style/a_page.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/front_controller_style/index.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/front_controller_style/show_request.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/link_confirm.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/local_redirect.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/messy_frameset.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/multiple_widget_form.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/nested_frameset.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/network_confirm.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/one_page_frameset.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/page_request.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/path/base_change_redirect.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/path/network_confirm.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/path/show_cookies.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/.htaccess delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/.htpasswd delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/1.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/2.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/3.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/htaccess delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/local_redirect.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/network_confirm.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/redirect.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/savant_style_form.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/search.png delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/self.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/self_form.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/set_cookies.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/slow_page.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/temp/.stop_cvs_removing_temp delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/timestamp.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/upload_form.html delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/upload_handler.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/socket_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/collector/collectable.1 delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/collector/collectable.2 delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/empty_test_file.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/latin1_sample delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/spl_examples.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/supplementary_upload_sample.txt delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/test1.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/upload_sample.txt delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/tag_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/unit_tester_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/unit_tests.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/url_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/user_agent_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/utf8_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/visual/visual_errors.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/visual_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/web_tester_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/xml_test.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test_case.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/Expectations.pkg delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/FormTesting.pkg delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/GroupTests.pkg delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/MockObjects.pkg delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/PartialMock.pkg delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/Reporting.pkg delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/ServerStubs.pkg delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/SimpleTest.pkg delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/SimpleTest.pkg.ini delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/UnitTestCase.pkg delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/WebTester.pkg delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/unit_tester.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/url.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/user_agent.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/web_tester.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/xml.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Action.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Actions/CallbackAction.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Actions/ReturnReferenceAction.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Actions/ReturnValueAction.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Actions/ThrowAction.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Description.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectation.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/ExpectationProvider.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations/AbstractExpectation.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations/AtLeastExpectation.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations/AtMostExpectation.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations/BetweenExpectation.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations/ExactlyExpectation.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Invocation.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/InvocationHandler.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/InvocationProxy.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/InvocationRecorder.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matcher.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/AnyMatcher.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/BoundsMatcher.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/EqualMatcher.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/IdenticalMatcher.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/OptionalMatcher.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/PatternMatcher.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/ReferenceMatcher.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/MockGenerator.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/MockObject.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Mockery.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/NotSatisfiedException.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SelfDescribing.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Sequence.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SimpleDescription.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SimpleInvocation.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SimpleSequence.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SimpleState.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SimpleStatePredicate.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/State.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/StateMachine.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/StatePredicate.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/States.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/mock.tpl.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/yay_convenience.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/yay_mock.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/run.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/sweety.js delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/css/main.css delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/images/darr.gif delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/images/group.gif delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/images/htmlicon.gif delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/images/loading.gif delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/images/network.gif delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/images/rarr.gif delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/images/runicon.gif delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/images/xmlicon.gif delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/js/sweety-template.js delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/suite-ui-noajax.tpl.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/suite-ui.tpl.php delete mode 100644 vendor/swiftmailer/swiftmailer/test-suite/xpath-legacy.js delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/charsets/iso-2022-jp/one.txt delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/charsets/iso-8859-1/one.txt delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/one.txt delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/three.txt delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/two.txt delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/files/data.txt delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/files/textfile.zip delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance.conf.php.default delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/AttachmentAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/ByteStream/FileByteStreamAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/CharacterReaderFactory/SimpleCharacterReaderFactoryAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/DependencyContainerAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EmbeddedFileAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/Base64EncoderAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/QpEncoderAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/Rfc2231EncoderAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EncodingAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/ArrayKeyCacheAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/DiskKeyCacheAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MessageAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/AttachmentAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/Base64ContentEncoderAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/NativeQpContentEncoderAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/PlainContentEncoderAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/QpContentEncoderAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/EmbeddedFileAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/HeaderEncoder/Base64HeaderEncoderAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/MimePartAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/SimpleMessageAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MimePartAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/AbstractStreamBufferAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/BasicSocketAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SocketTimeoutTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SslSocketAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/TlsSocketAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug111Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug118Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug206Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug34Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug35Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug38Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug51Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug71Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug76Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/helpers/Swift/Tests/IdenticalBinaryExpectation.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/helpers/Swift/Tests/SwiftSmokeTestCase.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/helpers/Swift/Tests/SwiftUnitTestCase.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/smoke.conf.php.default delete mode 100644 vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/AttachmentSmokeTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/BasicSmokeTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/HtmlWithAttachmentSmokeTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/InternationalSmokeTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/ByteStream/ArrayByteStreamTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/GenericFixedWidthReaderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/UsAsciiReaderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/Utf8ReaderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterStream/ArrayCharacterStreamTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/DependencyContainerTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Base64EncoderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/QpEncoderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Rfc2231EncoderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/CommandEventTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/EventObjectTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/ResponseEventTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SendEventTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SimpleEventDispatcherTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportChangeEventTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportExceptionEventTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/ArrayKeyCacheTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/SimpleKeyCacheInputStreamTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mailer/ArrayRecipientIteratorTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/MailerTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AbstractMimeEntityTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AttachmentTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/Base64ContentEncoderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/PlainContentEncoderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/QpContentEncoderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/EmbeddedFileTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/Base64HeaderEncoderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/QpHeaderEncoderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/DateHeaderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/IdentificationHeaderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/MailboxHeaderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/ParameterizedHeaderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/PathHeaderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/UnstructuredHeaderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/MimePartTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderFactoryTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderSetTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMessageTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMimeEntityTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/AntiFloodPluginTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/BandwidthMonitorPluginTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/DecoratorPluginTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/LoggerPluginTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/ArrayLoggerTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/EchoLoggerTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/PopBeforeSmtpPluginTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/RedirectingPluginTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ReporterPluginTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HitReporterTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HtmlReporterTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ThrottlerPluginTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/ByteArrayReplacementFilterTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterFactoryTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpEventSupportTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/CramMd5AuthenticatorTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/LoginAuthenticatorTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/PlainAuthenticatorTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/AuthHandlerTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransport/ExtensionSupportTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransportTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/FailoverTransportTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/LoadBalancedTransportTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/MailTransportTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/SendmailTransportTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/StreamBufferTest.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/.gitignore delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/AsseticBundle.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/CacheWarmer/AssetManagerCacheWarmer.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Command/DumpCommand.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Config/AsseticResource.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Controller/AsseticController.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DefaultValueSupplier.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/AsseticExtension.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/AssetFactoryPass.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/AssetManagerPass.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/CheckClosureFilterPass.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/CheckCssEmbedFilterPass.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/CheckYuiFilterPass.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/FilterManagerPass.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/RouterResourcePass.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/SprocketsFilterPass.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/TemplateResourcesPass.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/TemplatingPass.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Configuration.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/DirectoryResourceDefinition.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/EventListener/RequestListener.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Exception/InvalidBundleException.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/AssetFactory.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Loader/AsseticHelperFormulaLoader.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Loader/ConfigurationLoader.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Resource/CoalescingDirectoryResource.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Resource/ConfigurationResource.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Resource/DirectoryResource.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Resource/DirectoryResourceIterator.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Resource/FileResource.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Worker/UseControllerWorker.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/FilterManager.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/assetic.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/controller.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/closure.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/coffee.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/compass.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/cssembed.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/cssimport.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/cssmin.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/cssrewrite.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/gss.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/jpegoptim.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/jpegtran.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/less.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/lessphp.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/optipng.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/packager.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/pngout.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/sass.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/scss.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/sprockets.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/stylus.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/uglifyjs.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/yui_css.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/yui_js.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/schema/assetic-1.0.xsd delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/templating_php.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/templating_twig.xml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Routing/AsseticLoader.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Templating/AsseticHelper.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Templating/DynamicAsseticHelper.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Templating/StaticAsseticHelper.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/CacheWarmer/AssetManagerCacheWarmerTest.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Command/DumpCommandTest.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Controller/AsseticControllerTest.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/DependencyInjection/AsseticExtensionTest.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Factory/AssetFactoryTest.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Factory/Resource/CoalescingDirectoryResourceTest.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Factory/Resource/FileResourceTest.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/FilterManagerTest.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/FunctionalTest.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/Resources/views/base.html.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/Resources/views/base.html.twig delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/Resources/views/layout.html.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/Resources/views/layout.html.twig delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/config/config.yml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/config/routing.yml delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/web/javascript1.js delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/web/javascript2.js delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/web/stylesheet1.css delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/web/stylesheet2.css delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Templating/AsseticHelperTest.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/TestBundle/Resources/css/bundle.css delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/TestBundle/TestBundle.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/TestKernel.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/bootstrap.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Twig/AsseticExtension.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Twig/AsseticNode.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Twig/AsseticNodeVisitor.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Twig/AsseticTokenParser.php delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/UPGRADE.md delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/composer.json delete mode 100644 vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/phpunit.xml.dist delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/.gitignore delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/.travis.yml delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/Compiler/AddProcessorsPass.php delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/Compiler/DebugHandlerPass.php delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/Compiler/LoggerChannelPass.php delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/Configuration.php delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/MonologExtension.php delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/LICENSE delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/MonologBundle.php delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Resources/config/monolog.xml delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Resources/config/schema/monolog-1.0.xsd delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Compiler/AddProcessorsPassTest.php delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Compiler/LoggerChannelPassTest.php delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/ConfigurationTest.php delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/handlers_with_channels.xml delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/multiple_handlers.xml delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/new_and_priority.xml delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/new_and_priority_import.xml delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/new_at_end.xml delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/new_at_end_import.xml delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/overwriting.xml delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/overwriting_import.xml delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/handlers_with_channels.yml delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/multiple_handlers.yml delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/new_and_priority.yml delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/new_and_priority_import.yml delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/new_at_end.yml delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/new_at_end_import.yml delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/overwriting.yml delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/overwriting_import.yml delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/MonologExtensionTest.php delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/XmlMonologExtensionTest.php delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/YamlMonologExtensionTest.php delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/TestCase.php delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/composer.json delete mode 100644 vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/phpunit.xml.dist delete mode 100644 vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/.gitignore delete mode 100644 vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Command/SendEmailCommand.php delete mode 100644 vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/DependencyInjection/Compiler/RegisterPluginsPass.php delete mode 100644 vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/DependencyInjection/Configuration.php delete mode 100644 vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/DependencyInjection/SwiftmailerExtension.php delete mode 100644 vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/EventListener/EmailSenderListener.php delete mode 100644 vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/LICENSE delete mode 100644 vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/schema/swiftmailer-1.0.xsd delete mode 100644 vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/smtp.xml delete mode 100644 vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/spool.xml delete mode 100644 vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/spool_file.xml delete mode 100644 vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/spool_memory.xml delete mode 100644 vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/swiftmailer.xml delete mode 100644 vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/views/Collector/swiftmailer.html.twig delete mode 100644 vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/SwiftmailerBundle.php delete mode 100644 vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Tests/DependencyInjection/SwiftmailerExtensionTest.php delete mode 100644 vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Tests/TestCase.php delete mode 100644 vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/composer.json delete mode 100644 vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/.editorconfig delete mode 100644 vendor/symfony/symfony/.gitignore delete mode 100644 vendor/symfony/symfony/.travis.yml delete mode 100644 vendor/symfony/symfony/CHANGELOG-2.0.md delete mode 100644 vendor/symfony/symfony/CONTRIBUTORS.md delete mode 100644 vendor/symfony/symfony/LICENSE delete mode 100644 vendor/symfony/symfony/README.md delete mode 100644 vendor/symfony/symfony/UPGRADE-2.1.md delete mode 100644 vendor/symfony/symfony/autoload.php.dist delete mode 100644 vendor/symfony/symfony/composer.json delete mode 100644 vendor/symfony/symfony/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DataFixtures/ContainerAwareLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/Security/UserProvider/EntityFactory.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityLoaderInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandlerSchema.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/ManagerRegistry.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/RegistryInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/DataFixtures/ContainerAwareLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/AssociationEntity.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeIdentEntity.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeStringIdentEntity.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/ContainerAwareFixture.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/ItemGroupEntity.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/NoToStringSingleIdentEntity.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIdentEntity.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleStringIdentEntity.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/EntityChoiceListTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/HttpFoundation/DbalSessionHandlerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntity.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Validator/DoctrineInitializer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Monolog/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Handler/DebugHandler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Monolog/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Logger.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Processor/WebProcessor.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Monolog/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Tests/Processor/WebProcessorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Monolog/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Monolog/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/DataCollector/PropelDataCollector.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/DependencyInjection/Security/UserProvider/PropelFactory.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Form/DataTransformer/CollectionToArrayTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Form/PropelExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Form/PropelTypeGuesser.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Form/Type/ModelType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Logger/PropelLogger.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Security/User/PropelUserProvider.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/DataCollector/PropelDataCollectorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Fixtures/Column.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Fixtures/Item.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Fixtures/ItemQuery.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Fixtures/ReadOnlyItem.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Fixtures/ReadOnlyItemQuery.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/ModelChoiceListTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Form/PropelTypeGuesserTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Propel1TestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Propel1/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Swiftmailer/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Swiftmailer/DataCollector/MessageDataCollector.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Swiftmailer/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Swiftmailer/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/.gitignore delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Extension/FormExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Extension/RoutingExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Extension/SecurityExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Extension/TranslationExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Extension/YamlExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Form/TwigRenderer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Form/TwigRendererEngine.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Form/TwigRendererEngineInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Form/TwigRendererInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Node/FormThemeNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Node/SearchAndRenderBlockNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Node/TransDefaultDomainNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Node/TransNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form/form_table_layout.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/Fixtures/StubFilesystemLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/Fixtures/StubTranslator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/child_label.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/custom_widgets.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/parent_label.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/theme.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/theme_extends.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/theme_use.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/TestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/TokenParser/FormThemeTokenParserTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Translation/TwigExtractorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/TokenParser/FormThemeTokenParser.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/TokenParser/TransChoiceTokenParser.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/TokenParser/TransDefaultDomainTokenParser.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/Translation/TwigExtractor.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Bridge/Twig/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/RouterCacheWarmer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinderInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplatePathsCacheWarmer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Client.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ContainerAwareCommand.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/RouterApacheDumperCommand.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Shell.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerNameParser.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerResolver.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/InternalController.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/RedirectController.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/TraceableControllerResolver.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DataCollector/RouterDataCollector.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddCacheClearerPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddCacheWarmerPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddConstraintValidatorsPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddValidatorInitializersPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CompilerDebugDumpPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ContainerBuilderDebugDumpPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/FormPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ProfilerPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/RegisterKernelListenersPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/RoutingResolverPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TemplatingPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslationDumperPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslationExtractorPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslatorPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/EventListener/SessionListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/EventListener/TestSessionListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/annotations.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/collectors.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/debug.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/esi.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/form.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/form_csrf.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/profiling.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/router.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing/internal.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_debug.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_php.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/test.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/translation.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/web.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/css/exception.css delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/css/exception_layout.css delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/blue_picto_less.gif delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/blue_picto_more.gif delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/border_l.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/border_r.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/btn_bg.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/close_quote.gif delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/exception_detected.gif delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/exception_detected.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/grey_magnifier.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/icon_log.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/input_bg.gif delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/logo_symfony.gif delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/logo_symfony.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/open_quote.gif delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/attributes.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/checkbox_widget.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_options.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_collapsed.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_expanded.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_options.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/collection_widget.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/container_attributes.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/date_widget.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/datetime_widget.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/email_widget.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_enctype.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_errors.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_label.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_rest.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_row.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_rows.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_widget.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_enctype.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_errors.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_label.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_rest.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_row.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_rows.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_widget.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_widget_compound.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_widget_simple.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/hidden_row.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/hidden_widget.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/integer_widget.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/money_widget.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/number_widget.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/password_widget.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/percent_widget.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/radio_widget.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/repeated_row.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/search_widget.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/textarea_widget.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/time_widget.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/url_widget.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_attributes.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_container_attributes.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_errors.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_row.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_widget_compound.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/hidden_row.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Routing/DelegatingLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Routing/RedirectableUrlMatcher.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Asset/PackageFactory.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Asset/PathPackage.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Debugger.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/DelegatingEngine.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/EngineInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RequestHelper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RouterHelper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/SessionHelper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/TranslatorHelper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/FilesystemLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/PhpEngine.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateFilenameParser.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateNameParser.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateReference.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplateFinderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TestCaseMethod.tpl delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerNameParserTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddCacheWarmerPassTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ProfilerPassTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/RegisterKernelListenersPassTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/TranslatorPassTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/TestBundle/Resources/config/validation.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/TestBundle/Resources/config/validation.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/TestBundle/TestBundle.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/deprecated_merge_full.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/deprecated_merge_partial.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_url_package.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_annotations.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/deprecated_merge_full.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/deprecated_merge_partial.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/templating_url_package.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/validation_annotations.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/deprecated_merge_full.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/deprecated_merge_partial.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/templating_url_package.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/validation_annotations.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/PhpFrameworkExtensionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/XmlFrameworkExtensionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/YamlFrameworkExtensionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/EventListener/TestSessionListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/BaseBundle.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/Resources/views/base.format.engine delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/Resources/views/controller/base.format.engine delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/Resources/views/this.is.a.template.format.engine delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/resource.format.engine delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/this.is.a.template.format.engine delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Fabpot/FooBundle/Controller/DefaultController.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Fabpot/FooBundle/FabpotFooBundle.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/Controller/DefaultController.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/Controller/Sub/DefaultController.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/Controller/Test/DefaultController.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/FooBundle.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/Cms/FooBundle/Controller/DefaultController.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/Cms/FooBundle/SensioCmsFooBundle.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/FooBundle/Controller/DefaultController.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/FooBundle/SensioFooBundle.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SessionController.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Resources/config/routing.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/TestBundle.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/bundles.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/config.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/routing.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/config/default.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/config/framework.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/HttpKernelTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RedirectableUrlMatcherTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/CodeHelperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Fixtures/StubTemplateNameParser.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Fixtures/StubTranslator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/RequestHelperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Child/form_label.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_entry_label.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_text_id_widget.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Parent/form_label.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Parent/form_widget_simple.html.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/SessionHelperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Loader/TemplateLocatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/PhpEngineTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateFilenameParserTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateNameParserTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateReferenceTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/TestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/PhpExtractorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Validator/ConstraintValidatorFactoryTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Translation/PhpExtractor.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Validator/ConstraintValidatorFactory.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Command/InitAclCommand.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSecurityVotersPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AbstractFactory.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FormLoginFactory.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpBasicFactory.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpDigestFactory.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SecurityFactoryInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/X509Factory.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/UserProvider/InMemoryFactory.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/UserProvider/UserProviderFactoryInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/EventListener/AclSchemaListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/EventListener/ResponseListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/collectors.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security_acl.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security_acl_dbal.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security_listeners.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security_rememberme.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/templating_php.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/templating_twig.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Security/FirewallMap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/SecurityBundle.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Templating/Helper/LogoutUrlHelper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Templating/Helper/SecurityHelper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/ConfigurationTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/custom_acl_provider.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge_import.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/container1.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/custom_acl_provider.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/merge.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/merge_import.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/container1.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/custom_acl_provider.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/merge.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/merge_import.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/PhpSecurityExtensionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Security/Factory/AbstractFactoryTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/XmlSecurityExtensionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/YamlSecurityExtensionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/AuthenticationCommencingTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Controller/LoginController.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/CsrfFormLoginBundle.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Form/UserLoginFormType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Resources/config/routing.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Resources/views/Login/after_login.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Resources/views/Login/login.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LocalizedController.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LoginController.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/DependencyInjection/FormLoginExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/FormLoginBundle.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Resources/config/localized_routing.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Resources/config/routing.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Resources/views/Localized/login.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Resources/views/Login/after_login.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Resources/views/Login/login.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Security/LocalizedFormFailureHandler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/CsrfFormLoginTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/FormLoginTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SwitchUserTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/WebTestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AppKernel.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/bundles.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/config.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/routes_as_path.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/routing.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Resources/views/base.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/bundles.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/config.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/localized_form_failure_handler.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/localized_routes.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/localized_routes_with_forward.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/routes_as_path.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/routing.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/switchuser.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/config/default.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/config/framework.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/config/twig.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Twig/Extension/LogoutUrlExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheCacheWarmer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Command/LintCommand.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Debug/TimedTwigEngine.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExceptionListenerPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigEnvironmentPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Extension/ActionsExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Extension/AssetsExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Extension/CodeExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Node/RenderNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/config/debug.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/config/schema/twig-1.0.xsd delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.atom.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.css.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.js.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.json.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.rdf.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.txt.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.xml.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.atom.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.css.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.js.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.json.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.rdf.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.txt.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.xml.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception_full.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/logs.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.txt.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.txt.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.xml.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/layout.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/full.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/xml/full.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/yml/full.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/Loader/FilesystemLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/TestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/TwigEngineTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TokenParser/RenderTokenParser.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TwigBundle.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TwigEngine.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Controller/RouterController.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/Configuration.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/ICONS_LICENSE.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/wdt.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/config/schema/webprofiler-1.0.xsd delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/config/toolbar.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/css/profiler.css delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/favicon.ico delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/close.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/config.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/db.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/events.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/exception.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/import.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/logger.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/mail.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/memory.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/bg_submenu.gif delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/bg_submenu.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/border_l.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/border_r.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/btn_bg.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/config.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/db.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/events.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/exception.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/grey_magnifier.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/input_bg.gif delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/logger.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/logo_symfony_profiler.gif delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/logo_symfony_profiler.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/mail.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/request.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/routing.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/security.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/spinner.gif delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/time.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/request.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/routing.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/search.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/security.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/spacer.gif delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/symfony.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/time.png delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/events.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/exception.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/router.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/admin.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/ajax_layout.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/bag.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/header.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/info.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/results.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/search.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/table.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_redirect.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_style.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Router/panel.html.twig delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ExceptionControllerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/ConfigurationTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/WebProfilerExtensionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/Profiler/TemplateManagerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/TestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/WebProfilerBundle.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/BrowserKit/.gitignore delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/BrowserKit/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Client.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Cookie.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/BrowserKit/CookieJar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/BrowserKit/History.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/BrowserKit/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/BrowserKit/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Request.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Response.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/ClientTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/CookieJarTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/CookieTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/HistoryTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/RequestTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/ResponseTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/BrowserKit/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/BrowserKit/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/.gitignore delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ApcClassLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassMapGenerator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/DebugClassLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/MapClassLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/ApcUniversalClassLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/ClassLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Bar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Baz.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/FooBar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Bar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Baz.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/ApcPrefixCollision/A/Bar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/ApcPrefixCollision/A/Foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Bar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Bar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Bar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/fallback/Apc/Pearlike/FooBar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/fallback/Namespaced/FooBar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/A.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/ATrait.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/B.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/BTrait.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/CInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/CTrait.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/D.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/E.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/GInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Bar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Baz.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Bar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Baz.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike/Bar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike/Baz.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike/Foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike2/Bar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike2/Baz.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Pearlike2/Foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/A/Bar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/A/Foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/C/Bar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/C/Foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/A/Bar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/A/Foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/C/Bar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/PrefixCollision/C/Foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/A/B/Bar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/A/B/Foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/C/B/Bar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/C/B/Foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/A/B/Bar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/A/B/Foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/C/B/Bar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/beta/PrefixCollision/C/B/Foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeClass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeParent.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/multipleNs.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/notAClass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/notPhpFile.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/sameNsMultipleClasses.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Namespaced/FooBar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Namespaced2/FooBar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Pearlike/FooBar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Pearlike2/FooBar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/includepath/Foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/php5.4/traits.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/UniversalClassLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/XcacheClassLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/ClassLoader/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/ConfigCache.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/ArrayNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/BaseNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/BooleanNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php delete mode 100755 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/EnumNodeDefinition.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/MergeBuilder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/NodeParentInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/ParentNodeDefinitionInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/ScalarNodeDefinition.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/TreeBuilder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/VariableNodeDefinition.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/ConfigurationInterface.php delete mode 100755 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/EnumNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/DuplicateKeyException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/Exception.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/ForbiddenOverwriteException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/InvalidConfigurationException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/InvalidDefinitionException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/InvalidTypeException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/UnsetKeyException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/NodeInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Processor.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/PrototypeNodeInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/ScalarNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Definition/VariableNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Exception/FileLoaderImportCircularReferenceException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Exception/FileLoaderLoadException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/FileLocator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/FileLocatorInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Loader/DelegatingLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Loader/FileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Loader/Loader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Loader/LoaderInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Loader/LoaderResolver.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Loader/LoaderResolverInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Resource/DirectoryResource.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Resource/FileResource.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Resource/ResourceInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/ArrayNodeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/BooleanNodeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php delete mode 100755 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/EnumNodeDefinitionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/NodeBuilderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php delete mode 100755 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/EnumNodeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/FinalizationTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/MergeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/NormalizationTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/ProcessorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/PrototypedArrayNodeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/ScalarNodeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/FileLocatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Fixtures/Again/foo.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Fixtures/Builder/BarNodeDefinition.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Fixtures/Builder/NodeBuilder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Fixtures/Builder/VariableNodeDefinition.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Fixtures/foo.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Loader/DelegatingLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Loader/LoaderResolverTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Loader/LoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Resource/DirectoryResourceTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Resource/FileResourceTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Config/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Application.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Command/HelpCommand.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Command/ListCommand.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatter.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatterInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Helper/DialogHelper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Helper/FormatterHelper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Helper/Helper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Helper/HelperInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Helper/HelperSet.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Input/ArgvInput.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Input/ArrayInput.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Input/Input.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Input/InputArgument.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Input/InputDefinition.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Input/InputInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Input/InputOption.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Input/StringInput.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Output/ConsoleOutput.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Output/ConsoleOutputInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Output/NullOutput.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Output/Output.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Output/OutputInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Output/StreamOutput.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Shell.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tester/ApplicationTester.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tester/CommandTester.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/ApplicationTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Command/CommandTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Command/HelpCommandTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/Foo1Command.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/Foo2Command.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/Foo3Command.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/FooCommand.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/TestCommand.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_astext1.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_astext2.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_asxml2.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_gethelp.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception1.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception2.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception3.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception4.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_run1.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_run2.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_run3.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_run4.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/command_astext.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/command_asxml.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/definition_astext.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/definition_asxml.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleStackTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Helper/FormatterHelperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/ArgvInputTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/ArrayInputTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/InputArgumentTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/InputOptionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/InputTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/StringInputTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Output/ConsoleOutputTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Output/NullOutputTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Output/OutputTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Output/StreamOutputTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Tester/ApplicationTesterTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Tester/CommandTesterTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Console/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/CssSelector.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Exception/ParseException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/AttribNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/ClassNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/ElementNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/FunctionNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/HashNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/NodeInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/OrNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/PseudoNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/CssSelectorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/AttribNodeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/OrNodeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/TokenizerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/XPathExprTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Token.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/TokenStream.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tokenizer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/XPathExpr.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/XPathExprOr.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/CssSelector/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/.gitignore delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Alias.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CompilerPassInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/LoggingFormatter.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RemoveUnusedDefinitionsPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RepeatablePassInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerAware.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerAwareInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Definition.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/DefinitionDecorator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/Dumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/DumperInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/BadMethodCallException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ExceptionInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/InactiveScopeException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/InvalidArgumentException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/LogicException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/OutOfBoundsException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/RuntimeException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ScopeCrossingInjectionException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ScopeWideningInjectionException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/FileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Parameter.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Reference.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Scope.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ScopeInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/SimpleXMLElement.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/TaggedContainerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckCircularReferencesPassTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckDefinitionValidityPassTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckExceptionOnInvalidReferenceBehaviorPassTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckReferenceValidityPassTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInvalidReferencesPassTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/DefinitionDecoratorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Dumper/GraphvizDumperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Dumper/XmlDumperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container10.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container11.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container12.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container8.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces1.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces2.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services1.dot delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10-1.dot delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10.dot delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services9.dot delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtensionInPhar.phar delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/schema/project-1.0.xsd delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/nonvalid.ini delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters.ini delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters1.ini delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters2.ini delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/simple.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension1/services.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension2/services.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services1.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services2.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services3.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services4.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services5.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services6.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services7.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/nonvalid.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services1.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services13.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services2.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services3.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4_bad_import.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services5.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services7.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services8.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services9.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag1.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag2.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag3.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid1.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid2.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services1.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services10.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services11.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services13.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services2.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services3.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4_bad_import.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services7.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services8.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ParameterTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ReferenceTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Variable.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/.gitignore delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Crawler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Field/FileFormField.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Field/FormField.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Field/InputFormField.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Field/TextareaFormField.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Form.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Link.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Tests/Field/ChoiceFormFieldTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Tests/Field/FileFormFieldTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Tests/Field/FormFieldTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Tests/Field/FormFieldTestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Tests/Field/InputFormFieldTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Tests/Field/TextareaFormFieldTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Tests/FormTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Tests/LinkTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/DomCrawler/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/.gitignore delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcherInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Event.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcherInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventSubscriberInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/GenericEvent.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Tests/EventTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Tests/ImmutableEventDispatcherTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Filesystem/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Filesystem/Exception/ExceptionInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Filesystem/Exception/IOException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Filesystem/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Filesystem/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Filesystem/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Filesystem/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Filesystem/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Comparator/Comparator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Comparator/DateComparator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Comparator/NumberComparator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Finder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Glob.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/CustomFilterIterator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/DateRangeFilterIterator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/DepthRangeFilterIterator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/FileTypeFilterIterator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/FilecontentFilterIterator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/FilenameFilterIterator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/FilterIterator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/MultiplePcreFilterIterator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/SizeRangeFilterIterator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/SortableIterator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/SplFileInfo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Comparator/ComparatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Comparator/DateComparatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Comparator/NumberComparatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/FinderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Fixtures/dolor.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Fixtures/ipsum.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Fixtures/lorem.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/GlobTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/CustomFilterIteratorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/DateRangeFilterIteratorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/DepthRangeIteratorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/ExcludeDirectoryFileIteratorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/FileTypeFilterIteratorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/FilecontentFilterIteratorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/FilenameFilterIteratorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/FilterIteratorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/Iterator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/IteratorTestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/MultiplePcreFilterIteratorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/RealIteratorTestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/SizeRangeFilterIteratorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/SortableIteratorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Finder/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/.gitignore delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/AbstractExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/AbstractRendererEngine.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/AbstractType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/AbstractTypeExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/CallbackTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/CallbackValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/DataMapperInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/DataTransformerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Event/DataEvent.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Event/FilterDataEvent.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Exception/AlreadyBoundException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Exception/CreationException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Exception/ErrorMappingException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Exception/FormException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Exception/InvalidConfigurationException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Exception/InvalidPropertyException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Exception/InvalidPropertyPathException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Exception/NotInitializedException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Exception/NotValidException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Exception/PropertyAccessDeniedException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Exception/StringCastException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Exception/TransformationFailedException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Exception/TypeDefinitionException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Exception/TypeLoaderException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Exception/UnexpectedTypeException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceList.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceListInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/ChoiceList/LazyChoiceList.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/ChoiceList/SimpleChoiceList.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/CoreExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataMapper/PropertyPathMapper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/ArrayToPartsTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/BaseDateTimeTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToBooleanArrayTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToValueTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoicesToBooleanArrayTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoicesToValuesTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/DataTransformerChain.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToRfc3339Transformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToTimestampTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/ValueToDuplicatesTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/EventListener/FixCheckboxInputListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/EventListener/FixRadioInputListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/EventListener/FixUrlProtocolListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/EventListener/MergeCollectionListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/EventListener/TrimListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/BirthdayType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/CollectionType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/CountryType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/DateType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/EmailType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/FieldType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/FileType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/FormType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/HiddenType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/IntegerType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/LanguageType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/LocaleType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/NumberType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/PasswordType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/PercentType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/RadioType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/RepeatedType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/SearchType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/TextType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/TextareaType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/TimezoneType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/UrlType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/View/ChoiceView.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Csrf/CsrfExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfProviderInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/DefaultCsrfProvider.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/SessionCsrfProvider.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/DependencyInjection/DependencyInjectionExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/HttpFoundation/EventListener/BindRequestListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/HttpFoundation/HttpFoundationExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/HttpFoundation/Type/FormTypeHttpFoundationExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Templating/TemplatingRendererEngine.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/Constraints/Form.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/EventListener/ValidationListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/Type/RepeatedTypeValidatorExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/Util/ServerParams.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/ValidatorExtension.php delete mode 100755 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/RelativePath.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapperInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPathIterator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Form.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilderInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormConfigBuilder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormConfigBuilderInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormConfigInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormError.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormEvent.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormEvents.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormExtensionInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormFactory.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormFactoryInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormRegistry.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormRegistryInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormRenderer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormRendererEngineInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormRendererInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormTypeExtensionInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormTypeGuesserChain.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormTypeGuesserInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormTypeInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormValidatorInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/FormView.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Guess/Guess.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Guess/TypeGuess.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Guess/ValueGuess.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormTypeFactory.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormTypeFactoryInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormTypeInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/config/validation.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.ca.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.cs.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.da.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.de.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.en.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.es.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.et.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.eu.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.fa.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.fi.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.fr.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.he.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.hr.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.hu.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.hy.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.id.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.it.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.ja.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.lb.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.lt.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.mn.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.nb.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.nl.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.pl.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.pt.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.pt_BR.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.ro.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.ru.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.sk.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.sl.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.sr_Cyrl.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.sr_Latn.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.sv.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.ua.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.zh_CN.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/ReversedTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/AbstractExtensionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/AbstractFormTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/AbstractTableLayoutTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/CompoundFormPerformanceTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/CompoundFormTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ChoiceListTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/LazyChoiceListTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ObjectChoiceListTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/SimpleChoiceListTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataMapper/PropertyPathMapperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ArrayToPartsTransformerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/BooleanToStringTransformerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ChoiceToValueTransformerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ChoicesToValuesTransformerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DataTransformerChainTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeTestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToArrayTransformerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToRfc3339TransformerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToStringTransformerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToTimestampTransformerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/LocalizedTestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/PercentToLocalizedStringTransformerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ValueToDuplicatesTransformerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixRadioInputListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixUrlProtocolListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/Fixtures/randomhash delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerArrayObjectTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerArrayTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerCustomArrayObjectTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/ResizeFormListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/TrimListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/CheckboxTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypePerformanceTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/CollectionTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/CountryTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/FileTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/IntegerTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/LanguageTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/LocaleTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/LocalizedTestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/MoneyTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/NumberTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/PasswordTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/RepeatedTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimezoneTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/TypeTestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/UrlTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/DefaultCsrfProviderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/SessionCsrfProviderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Csrf/Type/FormTypeCsrfExtensionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/BindRequestListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Validator/EventListener/ValidationListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Validator/Type/FormTypeValidatorExtensionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Validator/Type/TypeTestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationPathTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Fixtures/AlternatingRowType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Fixtures/Author.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Fixtures/AuthorType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Fixtures/CustomArrayObject.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Fixtures/FixedDataTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Fixtures/FixedFilterListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Fixtures/FooSubType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Fixtures/FooType.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Fixtures/FooTypeBarExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Fixtures/FooTypeBazExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Fixtures/Magician.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Fixtures/TestExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Fixtures/foo delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormBuilderInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormBuilderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormConfigTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormFactoryTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormIntegrationTestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormPerformanceTestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormRegistryTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Guess/GuessTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/ResolvedFormTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/SimpleFormTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Util/FormUtilTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Util/PropertyPathArrayObjectTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Util/PropertyPathArrayTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Util/PropertyPathBuilderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Util/PropertyPathCollectionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Util/PropertyPathCustomArrayObjectTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Util/PropertyPathTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Util/FormUtil.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Util/PropertyPath.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Util/PropertyPathBuilder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Util/PropertyPathInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Util/PropertyPathIterator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Util/PropertyPathIteratorInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/Util/VirtualFormAwareIterator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Form/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/ApacheRequest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Cookie.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/Exception/AccessDeniedException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/Exception/FileException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/Exception/FileNotFoundException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/Exception/UnexpectedTypeException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/Exception/UploadException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/File.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesser.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesserInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesserInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/UploadedFile.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/FileBag.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/HeaderBag.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/JsonResponse.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/ParameterBag.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/RedirectResponse.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Request.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/RequestMatcher.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/RequestMatcherInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Resources/stubs/SessionHandlerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Response.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/ServerBag.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Flash/AutoExpireFlashBag.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Session.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/SessionBagInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/SessionInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/StreamedResponse.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/CookieTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/File/FileTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/File/Fixtures/.unknownextension delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/File/Fixtures/directory/.empty delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/File/Fixtures/test delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/File/Fixtures/test.gif delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/File/MimeType/MimeTypeTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/FileBagTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/HeaderBagTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/RequestMatcherTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/ServerBagTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/AttributeBagTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/Session/Flash/AutoExpireFlashBagTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeSessionHandlerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MetadataBagTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockArraySessionStorageTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/NativeProxyTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/StreamedResponseTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/.gitignore delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Bundle/Bundle.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Bundle/BundleInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/CacheClearer/CacheClearerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/CacheClearer/ChainCacheClearer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/CacheWarmer/WarmableInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Client.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Config/FileLocator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DataCollector/MemoryDataCollector.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/ContainerAwareTraceableEventDispatcher.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/ErrorHandler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/Stopwatch.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/StopwatchEvent.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php delete mode 100755 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/Extension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Event/FilterResponseEvent.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Event/GetResponseEvent.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Event/GetResponseForExceptionEvent.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Event/KernelEvent.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Event/PostResponseEvent.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/EsiListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/LocaleListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/ResponseListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Exception/AccessDeniedHttpException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Exception/FlattenException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Exception/HttpException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Exception/HttpExceptionInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Exception/MethodNotAllowedHttpException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Exception/NotFoundHttpException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/Esi.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategy.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategyInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/Store.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/StoreInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernelInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/KernelEvents.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/KernelInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Log/DebugLoggerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Log/LoggerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Log/NullLogger.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Profiler/MysqlProfilerStorage.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Profiler/Profile.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Profiler/Profiler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/TerminableInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/CacheClearer/ChainCacheClearerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/CacheWarmer/CacheWarmerAggregateTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/CacheWarmer/CacheWarmerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/ClientTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/DataCollector/EventDataCollectorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/DataCollector/MemoryDataCollectorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Debug/ContainerAwareTraceableEventDispatcherTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Debug/ErrorHandlerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Debug/ExceptionHandlerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Debug/StopwatchEventTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Debug/StopwatchTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/MergeExtensionConfigurationPassTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/EventListener/EsiListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/EventListener/ResponseListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Exception/FlattenExceptionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/BaseBundle/Resources/foo.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/BaseBundle/Resources/hide.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/Resources/foo.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/bar.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/foo.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle2Bundle/foo.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/ChildBundle/Resources/foo.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/ChildBundle/Resources/hide.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionAbsentBundle/ExtensionAbsentBundle.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionLoadedBundle/DependencyInjection/ExtensionLoadedExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionLoadedBundle/ExtensionLoadedBundle.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/Command/FooCommand.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/DependencyInjection/ExtensionPresentExtension.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/ExtensionPresentBundle.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/FooBarBundle.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForOverrideName.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/BaseBundle/hide.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/Bundle1Bundle/foo.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/ChildBundle/foo.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/FooBundle/foo.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/TestClient.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/TestEventDispatcher.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/HttpCache/TestHttpKernel.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/KernelTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Logger.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Profiler/AbstractProfilerStorageTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Profiler/FileProfilerStorageTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Profiler/MemcacheProfilerStorageTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Profiler/MemcachedProfilerStorageTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcacheMock.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcachedMock.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Profiler/Mock/RedisMock.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Profiler/ProfilerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Profiler/RedisProfilerStorageTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Profiler/SqliteProfilerStorageTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/TestHttpKernel.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/HttpKernel/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Exception/MethodArgumentNotImplementedException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Exception/MethodArgumentValueNotImplementedException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Exception/MethodNotImplementedException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Exception/NotImplementedException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Locale.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/UPDATE.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/af.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ak.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/am.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ar.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/as.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/asa.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/az.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/az_AZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/az_Cyrl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/az_Latn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/az_Latn_AZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/be.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/bem.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/bez.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/bg.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/bm.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/bn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/bn_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/bo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/bs.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ca.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/cgg.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/chr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/cs.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/cy.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/da.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/dav.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/de.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/de_CH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ebu.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ee.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/el.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/en.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/en_RH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/en_ZW.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/eo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/es.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/es_AR.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/es_CL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/et.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/eu.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/fa.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/fa_AF.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ff.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/fi.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/fil.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/fil_PH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/fo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/fr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ga.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/gl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/gsw.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/gu.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/guz.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/gv.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ha.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ha_GH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ha_Latn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ha_Latn_GH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ha_Latn_NE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ha_Latn_NG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ha_NE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ha_NG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/haw.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/he.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/he_IL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/hi.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/hr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/hu.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/hy.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/id.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/id_ID.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ig.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ii.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/in.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/in_ID.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/is.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/it.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/iw.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/iw_IL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ja.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ja_JP.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ja_JP_TRADITIONAL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/jmc.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ka.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/kab.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/kam.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/kde.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/kea.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/khq.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ki.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/kk.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/kk_Cyrl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/kk_Cyrl_KZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/kk_KZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/kl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/kln.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/km.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/kn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ko.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/kok.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/kw.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/lag.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/lg.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/lt.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/luo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/luy.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/lv.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/mas.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/mer.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/mfe.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/mg.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/mk.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ml.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/mo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/mr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ms.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/mt.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/my.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/naq.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/nb.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/nb_NO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/nd.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ne.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/nl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/nl_BE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/nn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/nn_NO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/no.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/no_NO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/no_NO_NY.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/nyn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/om.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/or.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/pa.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/pa_Arab.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/pa_Arab_PK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/pa_Guru.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/pa_Guru_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/pa_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/pa_PK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/pl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ps.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/pt.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/pt_PT.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/rm.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ro.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ro_MD.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/rof.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/root.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ru.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ru_UA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/rw.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/rwk.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/saq.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/seh.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ses.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sg.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sh.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sh_BA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sh_CS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sh_YU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/shi.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/shi_Latn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/shi_Latn_MA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/shi_MA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/shi_Tfng.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/si.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sk.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/so.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sq.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sr_BA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sr_CS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sr_Cyrl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sr_Cyrl_BA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sr_Cyrl_CS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sr_Cyrl_RS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sr_Cyrl_YU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sr_Latn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sr_Latn_BA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sr_Latn_CS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sr_Latn_ME.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sr_Latn_RS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sr_Latn_YU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sr_ME.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sr_RS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sr_YU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sv.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sv_FI.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/sw.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ta.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/te.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/teo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/th.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/th_TH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/th_TH_TRADITIONAL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ti.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/tl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/tl_PH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/to.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/tr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/tzm.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/tzm_Latn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/tzm_Latn_MA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/tzm_MA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/uk.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/ur.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/uz.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/uz_AF.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/uz_Arab.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/uz_Arab_AF.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/uz_Cyrl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/uz_Cyrl_UZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/uz_Latn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/uz_UZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/vi.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/vun.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/xog.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/yo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/zh.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/zh_CN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/zh_HK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/zh_Hans.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/zh_Hans_CN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/zh_Hans_SG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/zh_Hant.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/zh_Hant_HK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/zh_Hant_MO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/zh_Hant_TW.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/zh_MO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/zh_SG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/zh_TW.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/lang/zu.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/af.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/af_NA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/af_ZA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ak.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ak_GH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/am.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/am_ET.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ar.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ar_AE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ar_BH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ar_DZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ar_EG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ar_IQ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ar_JO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ar_KW.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ar_LB.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ar_LY.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ar_MA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ar_OM.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ar_QA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ar_SA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ar_SD.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ar_SY.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ar_TN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ar_YE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/as.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/as_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/asa.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/asa_TZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/az.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/az_AZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/az_Cyrl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/az_Cyrl_AZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/az_Latn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/az_Latn_AZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/be.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/be_BY.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/bem.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/bem_ZM.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/bez.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/bez_TZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/bg.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/bg_BG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/bm.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/bm_ML.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/bn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/bn_BD.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/bn_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/bo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/bo_CN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/bo_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/bs.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/bs_BA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ca.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ca_ES.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/cgg.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/cgg_UG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/chr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/chr_US.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/cs.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/cs_CZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/cy.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/cy_GB.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/da.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/da_DK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/dav.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/dav_KE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/de.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/de_AT.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/de_BE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/de_CH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/de_DE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/de_LI.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/de_LU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ebu.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ebu_KE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ee.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ee_GH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ee_TG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/el.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/el_CY.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/el_GR.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_AS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_AU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_BE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_BW.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_BZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_CA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_GB.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_GU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_HK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_IE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_JM.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_MH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_MP.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_MT.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_MU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_NA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_NZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_PH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_PK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_RH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_SG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_TT.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_UM.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_US.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_US_POSIX.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_VI.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_ZA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/en_ZW.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/eo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_419.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_AR.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_BO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_CL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_CO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_CR.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_DO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_EC.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_ES.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_GQ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_GT.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_HN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_MX.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_NI.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_PA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_PE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_PR.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_PY.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_SV.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_US.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_UY.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/es_VE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/et.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/et_EE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/eu.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/eu_ES.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fa.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fa_AF.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fa_IR.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ff.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ff_SN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fi.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fi_FI.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fil.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fil_PH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fo_FO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_BE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_BF.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_BI.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_BJ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_BL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_CA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_CD.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_CF.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_CG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_CH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_CI.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_CM.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_DJ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_FR.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_GA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_GN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_GP.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_GQ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_KM.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_LU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_MC.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_MF.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_MG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_ML.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_MQ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_NE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_RE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_RW.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_SN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_TD.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/fr_TG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ga.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ga_IE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/gl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/gl_ES.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/gsw.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/gsw_CH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/gu.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/gu_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/guz.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/guz_KE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/gv.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/gv_GB.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ha.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ha_GH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ha_Latn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ha_Latn_GH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ha_Latn_NE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ha_Latn_NG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ha_NE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ha_NG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/haw.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/haw_US.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/he.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/he_IL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/hi.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/hi_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/hr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/hr_HR.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/hu.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/hu_HU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/hy.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/hy_AM.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/id.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/id_ID.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ig.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ig_NG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ii.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ii_CN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/in.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/in_ID.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/is.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/is_IS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/it.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/it_CH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/it_IT.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/iw.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/iw_IL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ja.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ja_JP.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ja_JP_TRADITIONAL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/jmc.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/jmc_TZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ka.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ka_GE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kab.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kab_DZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kam.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kam_KE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kde.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kde_TZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kea.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kea_CV.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/khq.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/khq_ML.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ki.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ki_KE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kk.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kk_Cyrl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kk_Cyrl_KZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kk_KZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kl_GL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kln.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kln_KE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/km.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/km_KH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kn_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ko.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ko_KR.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kok.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kok_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kw.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/kw_GB.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/lag.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/lag_TZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/lg.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/lg_UG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/lt.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/lt_LT.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/luo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/luo_KE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/luy.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/luy_KE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/lv.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/lv_LV.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/mas.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/mas_KE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/mas_TZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/mer.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/mer_KE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/mfe.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/mfe_MU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/mg.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/mg_MG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/mk.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/mk_MK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ml.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ml_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/mo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/mr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/mr_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ms.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ms_BN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ms_MY.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/mt.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/mt_MT.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/my.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/my_MM.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/naq.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/naq_NA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/nb.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/nb_NO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/nd.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/nd_ZW.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ne.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ne_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ne_NP.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/nl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/nl_BE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/nl_NL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/nn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/nn_NO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/no.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/no_NO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/no_NO_NY.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/nyn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/nyn_UG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/om.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/om_ET.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/om_KE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/or.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/or_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/pa.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/pa_Arab.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/pa_Arab_PK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/pa_Guru.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/pa_Guru_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/pa_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/pa_PK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/pl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/pl_PL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ps.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ps_AF.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/pt.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/pt_BR.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/pt_GW.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/pt_MZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/pt_PT.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/rm.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/rm_CH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ro.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ro_MD.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ro_RO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/rof.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/rof_TZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/root.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ru.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ru_MD.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ru_RU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ru_UA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/rw.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/rw_RW.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/rwk.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/rwk_TZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/saq.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/saq_KE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/seh.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/seh_MZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ses.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ses_ML.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sg.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sg_CF.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sh.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sh_BA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sh_CS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sh_YU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/shi.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/shi_Latn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/shi_Latn_MA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/shi_MA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/shi_Tfng.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/shi_Tfng_MA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/si.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/si_LK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sk.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sk_SK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sl_SI.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sn_ZW.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/so.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/so_DJ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/so_ET.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/so_KE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/so_SO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sq.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sq_AL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sr_BA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sr_CS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sr_Cyrl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sr_Cyrl_BA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sr_Cyrl_CS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sr_Cyrl_ME.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sr_Cyrl_RS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sr_Cyrl_YU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sr_Latn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sr_Latn_BA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sr_Latn_CS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sr_Latn_ME.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sr_Latn_RS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sr_Latn_YU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sr_ME.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sr_RS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sr_YU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sv.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sv_FI.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sv_SE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sw.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sw_KE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/sw_TZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ta.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ta_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ta_LK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/te.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/te_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/teo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/teo_KE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/teo_UG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/th.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/th_TH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/th_TH_TRADITIONAL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ti.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ti_ER.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ti_ET.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/tl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/tl_PH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/to.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/to_TO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/tr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/tr_TR.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/tzm.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/tzm_Latn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/tzm_Latn_MA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/tzm_MA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/uk.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/uk_UA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ur.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ur_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/ur_PK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/uz.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/uz_AF.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/uz_Arab.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/uz_Arab_AF.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/uz_Cyrl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/uz_Cyrl_UZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/uz_Latn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/uz_Latn_UZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/uz_UZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/vi.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/vi_VN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/vun.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/vun_TZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/xog.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/xog_UG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/yo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/yo_NG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/zh.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/zh_CN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/zh_HK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/zh_Hans.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/zh_Hans_CN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/zh_Hans_HK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/zh_Hans_MO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/zh_Hans_SG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/zh_Hant.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/zh_Hant_HK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/zh_Hant_MO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/zh_Hant_TW.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/zh_MO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/zh_SG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/zh_TW.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/zu.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/locales/zu_ZA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/ar.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/bg.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/bs.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/ca.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/da.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/de.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/de_CH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/el.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/en.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/en_RH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/en_ZW.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/es.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/es_AR.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/es_CL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/et.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/fa.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/fa_AF.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/fi.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/fr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/gsw.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/gu.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/he.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/he_IL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/hi.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/hr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/hu.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/it.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/iw.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/iw_IL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/ja.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/ja_JP.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/ja_JP_TRADITIONAL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/ko.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/lt.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/lv.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/mk.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/ml.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/mo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/mr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/mt.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/my.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/nb.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/nb_NO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/ne.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/nl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/nl_BE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/nn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/nn_NO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/no.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/no_NO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/no_NO_NY.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/pl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/pt.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/pt_PT.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/rm.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/ro.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/ro_MD.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/ru.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sh.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sh_BA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sh_CS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sh_YU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sr_BA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sr_CS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sr_Cyrl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sr_Cyrl_BA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sr_Cyrl_CS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sr_Cyrl_RS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sr_Cyrl_YU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sr_Latn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sr_Latn_BA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sr_Latn_CS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sr_Latn_ME.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sr_Latn_RS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sr_Latn_YU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sr_ME.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sr_RS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sr_YU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sv.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/sv_FI.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/ta.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/te.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/th.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/th_TH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/th_TH_TRADITIONAL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/tr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/uk.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/zh.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/zh_CN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/zh_HK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/zh_Hans.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/zh_Hans_CN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/zh_Hans_SG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/zh_Hant.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/zh_Hant_HK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/zh_Hant_MO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/zh_Hant_TW.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/zh_MO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/zh_SG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/names/zh_TW.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/af.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ak.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/am.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ar.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/as.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/asa.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/az.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/az_AZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/az_Cyrl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/az_Latn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/az_Latn_AZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/be.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/bem.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/bez.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/bg.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/bm.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/bn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/bo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/bs.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ca.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/cgg.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/chr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/cs.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/cy.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/da.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/dav.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/de.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/de_CH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ebu.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ee.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/el.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/en.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/en_RH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/en_ZW.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/eo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/es.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/es_CL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/et.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/eu.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/fa.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/fa_AF.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ff.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/fi.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/fil.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/fil_PH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/fo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/fr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ga.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/gl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/gsw.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/gu.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/guz.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/gv.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ha.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ha_GH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ha_Latn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ha_Latn_GH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ha_Latn_NE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ha_Latn_NG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ha_NE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ha_NG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/haw.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/he.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/he_IL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/hi.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/hr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/hu.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/hy.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/id.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/id_ID.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ig.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ii.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/in.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/in_ID.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/is.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/it.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/iw.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/iw_IL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ja.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ja_JP.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ja_JP_TRADITIONAL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/jmc.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ka.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/kab.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/kam.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/kde.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/kea.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/khq.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ki.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/kk.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/kk_Cyrl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/kk_Cyrl_KZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/kk_KZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/kl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/kln.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/km.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/kn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ko.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/kok.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/kw.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/lag.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/lg.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/lt.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/luo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/luy.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/lv.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/mas.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/mer.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/mfe.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/mg.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/mk.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ml.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/mo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/mr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ms.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/mt.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/my.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/naq.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/nb.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/nb_NO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/nd.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ne.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/nl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/nl_BE.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/nn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/nn_NO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/no.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/no_NO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/no_NO_NY.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/nyn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/om.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/or.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/pa.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/pa_Arab.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/pa_Arab_PK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/pa_Guru.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/pa_Guru_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/pa_IN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/pa_PK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/pl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ps.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/pt.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/pt_PT.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/rm.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ro.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ro_MD.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/rof.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/root.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ru.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/rw.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/rwk.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/saq.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/seh.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ses.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sg.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sh.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sh_BA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sh_CS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sh_YU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/shi.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/shi_Latn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/shi_Latn_MA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/shi_MA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/shi_Tfng.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/si.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sk.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/so.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sq.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sr_BA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sr_CS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sr_Cyrl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sr_Cyrl_BA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sr_Cyrl_CS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sr_Cyrl_RS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sr_Cyrl_YU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sr_Latn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sr_Latn_BA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sr_Latn_CS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sr_Latn_ME.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sr_Latn_RS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sr_Latn_YU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sr_ME.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sr_RS.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sr_YU.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sv.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sv_FI.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/sw.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ta.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/te.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/teo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/th.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/th_TH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/th_TH_TRADITIONAL.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ti.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/tl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/tl_PH.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/to.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/tr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/tzm.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/tzm_Latn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/tzm_Latn_MA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/tzm_MA.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/uk.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/ur.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/uz.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/uz_AF.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/uz_Arab.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/uz_Arab_AF.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/uz_Cyrl.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/uz_Cyrl_UZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/uz_Latn.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/uz_UZ.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/vi.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/vun.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/xog.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/yo.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/zh.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/zh_CN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/zh_HK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/zh_Hans.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/zh_Hans_CN.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/zh_Hans_SG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/zh_Hant.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/zh_Hant_HK.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/zh_Hant_MO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/zh_Hant_TW.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/zh_MO.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/zh_SG.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/zh_TW.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/region/zu.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/stub/curr/en.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/stub/lang/en.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/stub/names/en.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/stub/region/en.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/update-data.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/Collator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/IntlDateFormatter.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/Locale.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/NumberFormatter.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/DateFormat/AmPmTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/DateFormat/DayOfWeekTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/DateFormat/DayOfYearTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/DateFormat/DayTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/DateFormat/FullTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/DateFormat/Hour1200Transformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/DateFormat/Hour1201Transformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/DateFormat/Hour2400Transformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/DateFormat/Hour2401Transformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/DateFormat/HourTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/DateFormat/MinuteTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/DateFormat/MonthTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/DateFormat/QuarterTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/DateFormat/SecondTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/DateFormat/TimeZoneTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/DateFormat/Transformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/DateFormat/YearTransformer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/StubCollator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/StubIntl.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/StubLocale.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/StubNumberFormatter.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Tests/LocaleTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Tests/Stub/StubCollatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Tests/Stub/StubIntlDateFormatterTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Tests/Stub/StubIntlTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Tests/Stub/StubLocaleTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Tests/Stub/StubNumberFormatterTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Tests/TestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Locale/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/Exception/ExceptionInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/Exception/InvalidOptionsException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/Exception/MissingOptionsException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/Exception/OptionDefinitionException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/Options.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/OptionsResolver.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/OptionsResolverInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/Tests/OptionsTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Process/CHANGELOG.md delete mode 100755 vendor/symfony/symfony/src/Symfony/Component/Process/Exception/ExceptionInterface.php delete mode 100755 vendor/symfony/symfony/src/Symfony/Component/Process/Exception/ProcessFailedException.php delete mode 100755 vendor/symfony/symfony/src/Symfony/Component/Process/Exception/RuntimeException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Process/ExecutableFinder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Process/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Process/PhpExecutableFinder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Process/PhpProcess.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Process/Process.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Process/ProcessBuilder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Process/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Process/Tests/PhpExecutableFinderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Process/Tests/ProcessBuilderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Process/Tests/ProcessFailedExceptionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Process/Tests/ProcessTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Process/Tests/ProcessTestHelper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Process/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Process/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Process/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/.gitignore delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Annotation/Route.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/CompiledRoute.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Exception/ExceptionInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Exception/InvalidParameterException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Exception/MethodNotAllowedException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Exception/MissingMandatoryParametersException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Exception/ResourceNotFoundException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Exception/RouteNotFoundException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Generator/Dumper/GeneratorDumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Generator/Dumper/GeneratorDumperInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Generator/UrlGenerator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Generator/UrlGeneratorInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Loader/AnnotationFileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Loader/ClosureLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Loader/PhpFileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Loader/XmlFileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Loader/YamlFileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Matcher/ApacheUrlMatcher.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Matcher/Dumper/MatcherDumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Matcher/Dumper/MatcherDumperInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Matcher/RedirectableUrlMatcherInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Matcher/RequestMatcherInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Matcher/TraceableUrlMatcher.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Matcher/UrlMatcher.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Matcher/UrlMatcherInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/RequestContext.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/RequestContextAwareInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Route.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/RouteCollection.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/RouteCompiler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/RouteCompilerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/RouterInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Annotation/RouteTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/CompiledRouteTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/AnnotatedClasses/AbstractClass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/AnnotatedClasses/FooClass.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/CustomXmlFileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/RedirectableUrlMatcher.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/annotated.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.apache delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.apache delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/empty.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/foo.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/foo1.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/incomplete.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/nonvalid.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/nonvalid.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/nonvalidkeys.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/nonvalidnode.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/nonvalidroute.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/validpattern.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/validpattern.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/validpattern.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/validresource.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/validresource.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Loader/AbstractAnnotationLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Loader/AnnotationDirectoryLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Loader/AnnotationFileLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Loader/ClosureLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Loader/PhpFileLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Loader/YamlFileLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Matcher/ApacheUrlMatcherTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Matcher/Dumper/ApacheMatcherDumperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Matcher/RedirectableUrlMatcherTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Matcher/TraceableUrlMatcherTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/RouteCollectionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/RouteCompilerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/RouteTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Routing/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/.gitignore delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Dbal/Schema.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Domain/Acl.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Domain/AclCollectionCache.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Domain/AuditLogger.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Domain/DoctrineAclCache.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Domain/Entry.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Domain/FieldEntry.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Domain/ObjectIdentity.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Domain/ObjectIdentityRetrievalStrategy.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Domain/PermissionGrantingStrategy.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Domain/RoleSecurityIdentity.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Domain/SecurityIdentityRetrievalStrategy.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Domain/UserSecurityIdentity.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Exception/AclAlreadyExistsException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Exception/AclNotFoundException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Exception/ConcurrentModificationException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Exception/Exception.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Exception/InvalidDomainObjectException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Exception/NoAceFoundException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Exception/NotAllAclsFoundException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Exception/SidNotLoadedException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Model/AclCacheInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Model/AclInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Model/AclProviderInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Model/AuditLoggerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Model/AuditableAclInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Model/AuditableEntryInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Model/DomainObjectInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Model/EntryInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Model/FieldEntryInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Model/MutableAclInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Model/MutableAclProviderInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Model/ObjectIdentityInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Model/ObjectIdentityRetrievalStrategyInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Model/PermissionGrantingStrategyInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Model/SecurityIdentityInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Model/SecurityIdentityRetrievalStrategyInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Permission/BasicPermissionMap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Permission/MaskBuilder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Permission/PermissionMapInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Resources/bin/generateSql.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Resources/schema/db2.sql delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Resources/schema/drizzle.sql delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Resources/schema/mssql.sql delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Resources/schema/mysql.sql delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Resources/schema/oracle.sql delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Resources/schema/postgresql.sql delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Resources/schema/sqlite.sql delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Voter/AclVoter.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Voter/FieldVote.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/AuthenticationManagerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/AuthenticationProviderManager.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/AuthenticationTrustResolver.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/AuthenticationTrustResolverInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/Provider/AnonymousAuthenticationProvider.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/Provider/AuthenticationProviderInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/Provider/DaoAuthenticationProvider.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/Provider/RememberMeAuthenticationProvider.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/Provider/UserAuthenticationProvider.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/RememberMe/InMemoryTokenProvider.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/RememberMe/PersistentToken.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/RememberMe/PersistentTokenInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/RememberMe/TokenProviderInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/Token/AnonymousToken.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/Token/PreAuthenticatedToken.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/Token/RememberMeToken.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/Token/UsernamePasswordToken.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/AuthenticationEvents.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManagerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authorization/Voter/AuthenticatedVoter.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authorization/Voter/RoleHierarchyVoter.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authorization/Voter/RoleVoter.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authorization/Voter/VoterInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Encoder/BasePasswordEncoder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Encoder/EncoderFactory.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Encoder/EncoderFactoryInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Encoder/MessageDigestPasswordEncoder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Encoder/PasswordEncoderInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Encoder/PlaintextPasswordEncoder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Event/AuthenticationEvent.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Event/AuthenticationFailureEvent.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/AccessDeniedException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/AccountExpiredException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/AccountStatusException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/AuthenticationCredentialsNotFoundException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/AuthenticationException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/AuthenticationServiceException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/BadCredentialsException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/CookieTheftException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/CredentialsExpiredException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/DisabledException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/InsufficientAuthenticationException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/InvalidCsrfTokenException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/LockedException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/LogoutException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/NonceExpiredException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/ProviderNotFoundException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/SessionUnavailableException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/TokenNotFoundException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/UnsupportedUserException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/UsernameNotFoundException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Role/Role.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Role/RoleHierarchy.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Role/RoleHierarchyInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Role/RoleInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Role/SwitchUserRole.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/SecurityContext.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/SecurityContextInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/User/AdvancedUserInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/User/ChainUserProvider.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/User/EquatableInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/User/InMemoryUserProvider.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/User/User.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/User/UserChecker.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/User/UserCheckerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/User/UserInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/User/UserProviderInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Util/ClassUtils.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Validator/Constraint/UserPassword.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Core/Validator/Constraint/UserPasswordValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/AccessMap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/AccessMapInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Authentication/AuthenticationFailureHandlerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Authentication/AuthenticationSuccessHandlerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Authentication/DefaultAuthenticationFailureHandler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Authentication/DefaultAuthenticationSuccessHandler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Authorization/AccessDeniedHandlerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/EntryPoint/AuthenticationEntryPointInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/EntryPoint/BasicAuthenticationEntryPoint.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/EntryPoint/DigestAuthenticationEntryPoint.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/EntryPoint/FormAuthenticationEntryPoint.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/EntryPoint/RetryAuthenticationEntryPoint.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Event/InteractiveLoginEvent.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Event/SwitchUserEvent.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/AbstractAuthenticationListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/AbstractPreAuthenticatedListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/AccessListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/AnonymousAuthenticationListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/BasicAuthenticationListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/ChannelListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/ContextListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/DigestAuthenticationListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/ListenerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/LogoutListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/RememberMeListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/SwitchUserListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/UsernamePasswordFormAuthenticationListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/X509AuthenticationListener.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/FirewallMap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/FirewallMapInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/HttpUtils.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Logout/CookieClearingLogoutHandler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Logout/DefaultLogoutSuccessHandler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Logout/LogoutHandlerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Logout/LogoutSuccessHandlerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Logout/SessionLogoutHandler.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/RememberMe/PersistentTokenBasedRememberMeServices.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/RememberMe/RememberMeServicesInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/RememberMe/TokenBasedRememberMeServices.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/SecurityEvents.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Session/SessionAuthenticationStrategy.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Http/Session/SessionAuthenticationStrategyInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Dbal/AclProviderBenchmarkTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Dbal/AclProviderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Dbal/MutableAclProviderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/AclTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/AuditLoggerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/DoctrineAclCacheTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/EntryTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/FieldEntryTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/ObjectIdentityRetrievalStrategyTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/ObjectIdentityTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/PermissionGrantingStrategyTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/RoleSecurityIdentityTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/SecurityIdentityRetrievalStrategyTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/UserSecurityIdentityTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Permission/BasicPermissionMapTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Permission/MaskBuilderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Voter/AclVoterTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Authentication/AuthenticationProviderManagerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Authentication/AuthenticationTrustResolverTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Authentication/Provider/AnonymousAuthenticationProviderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Authentication/Provider/DaoAuthenticationProviderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Authentication/Provider/PreAuthenticatedAuthenticationProviderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Authentication/Provider/RememberMeAuthenticationProviderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Authentication/Provider/UserAuthenticationProviderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Authentication/RememberMe/InMemoryTokenProviderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Authentication/RememberMe/PersistentTokenTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Authentication/Token/AbstractTokenTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Authentication/Token/AnonymousTokenTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Authentication/Token/PreAuthenticatedTokenTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Authentication/Token/RememerMeTokenTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Authentication/Token/UsernamePasswordTokenTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Authorization/AccessDecisionManagerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Authorization/Voter/AuthenticatedVoterTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Authorization/Voter/RoleHierarchyVoterTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Authorization/Voter/RoleVoterTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Encoder/BasePasswordEncoderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Encoder/EncoderFactoryTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Encoder/MessageDigestPasswordEncoderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Encoder/PlaintextPasswordEncoderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Role/RoleHierarchyTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Role/RoleTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Role/SwitchUserRoleTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/SecurityContextTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/User/AccountCheckerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/User/ChainUserProviderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/User/InMemoryProviderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/User/UserTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Core/Util/ClassUtilsTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Http/EntryPoint/BasicAuthenticationEntryPointTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Http/EntryPoint/DigestAuthenticationEntryPointTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Http/EntryPoint/FormAuthenticationEntryPointTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Http/EntryPoint/RetryAuthenticationEntryPointTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Http/Firewall/AccessListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Http/Firewall/AnonymousAuthenticationListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Http/Firewall/BasicAuthenticationListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Http/Firewall/ChannelListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Http/Firewall/ContextListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Http/Firewall/LogoutListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Http/Firewall/RememberMeListenerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Http/FirewallMapTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Http/FirewallTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Http/HttpUtilsTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Http/Logout/CookieClearingLogoutHandlerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Http/Logout/SessionLogoutHandlerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Http/RememberMe/AbstractRememberMeServicesTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Http/RememberMe/PersistentTokenBasedRememberMeServicesTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Http/RememberMe/TokenBasedRememberMeServicesTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Security/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Encoder/ChainDecoder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Encoder/ChainEncoder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Encoder/DecoderInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Encoder/EncoderInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Encoder/JsonDecode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Encoder/JsonEncode.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Encoder/JsonEncoder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Encoder/NormalizationAwareInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Encoder/SerializerAwareEncoder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Exception/Exception.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Exception/InvalidArgumentException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Exception/LogicException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Exception/RuntimeException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Exception/UnexpectedValueException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Exception/UnsupportedException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Normalizer/CustomNormalizer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Normalizer/NormalizableInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Normalizer/SerializerAwareNormalizer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Serializer.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/SerializerAwareInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/SerializerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Tests/Fixtures/DenormalizableDummy.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Tests/Fixtures/Dummy.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Tests/Fixtures/NormalizableTraversableDummy.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Tests/Fixtures/ScalarDummy.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Tests/Fixtures/TraversableDummy.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Tests/Normalizer/CustomNormalizerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Tests/SerializerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Serializer/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Asset/Package.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Asset/PackageInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Asset/PathPackage.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Asset/UrlPackage.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/DebuggerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/DelegatingEngine.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/EngineInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Helper/AssetsHelper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Helper/CoreAssetsHelper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Helper/Helper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Helper/HelperInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Helper/SlotsHelper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Loader/CacheLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Loader/ChainLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Loader/FilesystemLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Loader/Loader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Loader/LoaderInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/PhpEngine.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Storage/FileStorage.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Storage/Storage.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Storage/StringStorage.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/StreamingEngineInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/TemplateNameParser.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/TemplateNameParserInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/TemplateReference.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/TemplateReferenceInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Tests/Fixtures/ProjectTemplateDebugger.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Tests/Fixtures/SimpleHelper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Tests/Fixtures/templates/foo.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Tests/Helper/AssetsHelperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Tests/Helper/CoreAssetsHelperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Tests/Helper/HelperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Tests/Helper/SlotsHelperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Tests/Loader/CacheLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Tests/Loader/ChainLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Tests/Loader/FilesystemLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Tests/Loader/LoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Tests/PhpEngineTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Tests/Storage/FileStorageTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Tests/Storage/StorageTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Tests/Storage/StringStorageTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Tests/TemplateNameParserTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Templating/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/.gitignore delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Dumper/CsvFileDumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Dumper/DumperInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Dumper/FileDumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Dumper/IcuResFileDumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Dumper/IniFileDumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Dumper/MoFileDumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Dumper/PhpFileDumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Dumper/PoFileDumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Dumper/QtFileDumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Dumper/XliffFileDumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Dumper/YamlFileDumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Extractor/ChainExtractor.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Extractor/ExtractorInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/IdentityTranslator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Interval.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Loader/ArrayLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Loader/CsvFileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Loader/IcuDatFileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Loader/IcuResFileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Loader/IniFileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Loader/LoaderInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Loader/MoFileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Loader/PhpFileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Loader/PoFileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Loader/QtTranslationsLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Loader/XliffFileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Loader/YamlFileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Loader/schema/dic/xliff-core/xliff-core-1.2-strict.xsd delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Loader/schema/dic/xliff-core/xml.xsd delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/MessageCatalogue.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/MessageCatalogueInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/MessageSelector.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/PluralizationRules.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/CsvFileDumperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/IniFileDumperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/MoFileDumperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/PhpFileDumperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/PoFileDumperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/QtFileDumperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/XliffFileDumperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/YamlFileDumperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/IntervalTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Loader/CsvFileLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Loader/IcuDatFileLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Loader/IcuResFileLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Loader/IniFileLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Loader/LocalizedTestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Loader/MoFileLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Loader/PhpFileLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Loader/PoFileLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Loader/QtTranslationsLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Loader/YamlFileLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/MessageCatalogueTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/MessageSelectorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/PluralizationRulesTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/TranslatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/empty-translation.po delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/empty.csv delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/empty.ini delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/empty.mo delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/empty.po delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/empty.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/non-valid.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/non-valid.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/plurals.mo delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/plurals.po delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/en.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/en.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/fr.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/fr.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/packagelist.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/resources.dat delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/resourcebundle/res/en.res delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/resourcebundle/res/en.txt delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/resources-clean.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/resources.csv delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/resources.ini delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/resources.mo delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/resources.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/resources.po delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/resources.ts delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/resources.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/resources.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/fixtures/valid.csv delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Translator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/TranslatorInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/Writer/TranslationWriter.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Translation/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/.gitignore delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraint.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/ConstraintValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/ConstraintValidatorFactory.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/ConstraintValidatorFactoryInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/ConstraintValidatorInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/ConstraintViolation.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/ConstraintViolationList.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/All.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/AllValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Blank.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/BlankValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Callback.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/CallbackValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Choice.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/ChoiceValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Collection.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Collection/Optional.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Collection/Required.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/CollectionValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Count.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/CountValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Country.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/CountryValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Date.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/DateTime.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/DateTimeValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/DateValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Email.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/EmailValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/False.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/FalseValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/File.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/FileValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/GroupSequence.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/GroupSequenceProvider.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Image.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/ImageValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Ip.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/IpValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Language.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/LanguageValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Length.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/LengthValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Locale.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/LocaleValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Max.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/MaxLength.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/MaxLengthValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/MaxValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Min.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/MinLength.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/MinLengthValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/MinValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/NotBlank.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/NotBlankValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/NotNull.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/NotNullValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Null.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/NullValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Range.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/RangeValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Regex.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/RegexValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Time.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/TimeValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/True.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/TrueValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Type.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/TypeValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Url.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/UrlValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Valid.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Exception/ConstraintDefinitionException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Exception/GroupDefinitionException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Exception/InvalidOptionsException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Exception/MappingException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Exception/MissingOptionsException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Exception/UnexpectedTypeException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Exception/ValidatorException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/ExecutionContext.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/GlobalExecutionContext.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/GraphWalker.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/GroupSequenceProviderInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/BlackholeMetadataFactory.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Cache/ApcCache.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Cache/CacheInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/ClassMetadata.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/ClassMetadataFactory.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/ClassMetadataFactoryInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/ElementMetadata.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/GetterMetadata.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/AbstractLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/AnnotationLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/FileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/FilesLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/LoaderChain.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/LoaderInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/StaticMethodLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/XmlFileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/XmlFilesLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/YamlFileLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/YamlFilesLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/MemberMetadata.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/PropertyMetadata.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/ObjectInitializerInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.et.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.fa.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.fi.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.hy.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.id.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.lt.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.mn.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.nb.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.pt_BR.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sk.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sr_Cyrl.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sr_Latn.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.ua.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.zh_CN.xlf delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/ConstraintTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/ConstraintValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/ConstraintViolationListTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/ConstraintViolationTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/AllTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/AllValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/BlankValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/CollectionTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorArrayObjectTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorArrayTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorCustomArrayObjectTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/CountValidatorArrayTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/CountValidatorCountableTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/CountValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/DateTimeValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/DateValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/EmailValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/FalseValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/FileValidatorObjectTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/FileValidatorPathTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/Fixtures/test.gif delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/ImageValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/IpValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/LanguageValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/LengthValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/LocaleValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/LocalizedTestCase.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/MaxLengthValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/MaxValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/MinLengthValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/MinValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/NotBlankValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/NotNullValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/NullValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/RegexValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/TimeValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/TrueValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/TypeValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/ValidTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/ExecutionContextTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Fixtures/ClassConstraint.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Fixtures/ConstraintA.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Fixtures/ConstraintAValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Fixtures/ConstraintB.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Fixtures/ConstraintC.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Fixtures/Entity.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Fixtures/EntityInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Fixtures/EntityParent.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Fixtures/FailingConstraint.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Fixtures/FailingConstraintValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Fixtures/FakeClassMetadataFactory.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Fixtures/FilesLoader.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Fixtures/GroupSequenceProviderEntity.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Fixtures/InvalidConstraint.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Fixtures/InvalidConstraintValidator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Fixtures/PropertyConstraint.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Fixtures/Reference.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/GlobalExecutionContextTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/GraphWalkerTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Mapping/Cache/ApcCacheTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Mapping/ClassMetadataFactoryTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Mapping/ClassMetadataTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Mapping/ElementMetadataTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Mapping/GetterMetadataTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Mapping/Loader/AnnotationLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Mapping/Loader/FilesLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Mapping/Loader/LoaderChainTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Mapping/Loader/StaticMethodLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Mapping/Loader/XmlFileLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Mapping/Loader/YamlFileLoaderTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Mapping/Loader/constraint-mapping.xml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Mapping/Loader/constraint-mapping.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Mapping/Loader/empty-mapping.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Mapping/Loader/nonvalid-mapping.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Mapping/MemberMetadataTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Mapping/PropertyMetadataTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/ValidatorContextTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/ValidatorFactoryTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/ValidatorTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/Validator.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/ValidatorContext.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/ValidatorContextInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/ValidatorFactory.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/ValidatorInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Validator/phpunit.xml.dist delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/CHANGELOG.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Dumper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Escaper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Exception/DumpException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Exception/ExceptionInterface.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Exception/ParseException.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Inline.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/LICENSE delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Parser.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/README.md delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/DumperTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/Fixtures/YtsAnchorAlias.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/Fixtures/YtsBasicTests.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/Fixtures/YtsBlockMapping.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/Fixtures/YtsDocumentSeparator.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/Fixtures/YtsErrorTests.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/Fixtures/YtsFlowCollections.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/Fixtures/YtsFoldedScalars.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/Fixtures/YtsNullsAndEmpties.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/Fixtures/YtsTypeTransfers.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/Fixtures/embededPhp.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/Fixtures/escapedCharacters.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/Fixtures/index.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/Fixtures/sfComments.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/Fixtures/sfCompact.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/Fixtures/sfMergeKey.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/Fixtures/sfObjects.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/Fixtures/sfQuotes.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/Fixtures/sfTests.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/Fixtures/unindentedCollections.yml delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/InlineTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/ParserTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/YamlTest.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Tests/bootstrap.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Unescaper.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/Yaml.php delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/composer.json delete mode 100644 vendor/symfony/symfony/src/Symfony/Component/Yaml/phpunit.xml.dist delete mode 100644 vendor/twig/extensions/.gitignore delete mode 100644 vendor/twig/extensions/LICENSE delete mode 100644 vendor/twig/extensions/README delete mode 100644 vendor/twig/extensions/composer.json delete mode 100644 vendor/twig/extensions/doc/debug.rst delete mode 100644 vendor/twig/extensions/doc/i18n.rst delete mode 100644 vendor/twig/extensions/doc/index.rst delete mode 100644 vendor/twig/extensions/doc/text.rst delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/Autoloader.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/Extension/Debug.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/Extension/I18n.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/Extension/Intl.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/Extension/Text.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/Grammar.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/Grammar/Arguments.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/Grammar/Array.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/Grammar/Body.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/Grammar/Boolean.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/Grammar/Constant.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/Grammar/Expression.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/Grammar/Hash.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/Grammar/Number.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/Grammar/Optional.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/Grammar/Switch.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/Grammar/Tag.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/GrammarInterface.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/Node/Debug.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/Node/Trans.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/SimpleTokenParser.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/TokenParser/Debug.php delete mode 100644 vendor/twig/extensions/lib/Twig/Extensions/TokenParser/Trans.php delete mode 100644 vendor/twig/extensions/phpunit.xml.dist delete mode 100644 vendor/twig/extensions/test/Twig/Tests/Grammar/ArgumentsTest.php delete mode 100644 vendor/twig/extensions/test/Twig/Tests/Grammar/ArrayTest.php delete mode 100644 vendor/twig/extensions/test/Twig/Tests/Grammar/BodyTest.php delete mode 100644 vendor/twig/extensions/test/Twig/Tests/Grammar/BooleanTest.php delete mode 100644 vendor/twig/extensions/test/Twig/Tests/Grammar/ConstantTest.php delete mode 100644 vendor/twig/extensions/test/Twig/Tests/Grammar/ExpressionTest.php delete mode 100644 vendor/twig/extensions/test/Twig/Tests/Grammar/NumberTest.php delete mode 100644 vendor/twig/extensions/test/Twig/Tests/Grammar/OptionalTest.php delete mode 100644 vendor/twig/extensions/test/Twig/Tests/Grammar/TagTest.php delete mode 100644 vendor/twig/extensions/test/Twig/Tests/Node/DebugTest.php delete mode 100644 vendor/twig/extensions/test/Twig/Tests/Node/TransTest.php delete mode 100644 vendor/twig/extensions/test/Twig/Tests/SimpleTokenParser.php delete mode 100644 vendor/twig/extensions/test/Twig/Tests/SimpleTokenParserTest.php delete mode 100644 vendor/twig/extensions/test/Twig/Tests/grammarTest.php delete mode 100644 vendor/twig/extensions/test/bootstrap.php delete mode 100644 vendor/twig/twig/.travis.yml delete mode 100644 vendor/twig/twig/AUTHORS delete mode 100644 vendor/twig/twig/CHANGELOG delete mode 100644 vendor/twig/twig/LICENSE delete mode 100644 vendor/twig/twig/README.markdown delete mode 100644 vendor/twig/twig/bin/create_pear_package.php delete mode 100644 vendor/twig/twig/composer.json delete mode 100644 vendor/twig/twig/doc/advanced.rst delete mode 100644 vendor/twig/twig/doc/api.rst delete mode 100644 vendor/twig/twig/doc/coding_standards.rst delete mode 100644 vendor/twig/twig/doc/filters/abs.rst delete mode 100644 vendor/twig/twig/doc/filters/capitalize.rst delete mode 100644 vendor/twig/twig/doc/filters/convert_encoding.rst delete mode 100644 vendor/twig/twig/doc/filters/date.rst delete mode 100644 vendor/twig/twig/doc/filters/date_modify.rst delete mode 100644 vendor/twig/twig/doc/filters/default.rst delete mode 100644 vendor/twig/twig/doc/filters/escape.rst delete mode 100644 vendor/twig/twig/doc/filters/format.rst delete mode 100644 vendor/twig/twig/doc/filters/index.rst delete mode 100644 vendor/twig/twig/doc/filters/join.rst delete mode 100644 vendor/twig/twig/doc/filters/json_encode.rst delete mode 100644 vendor/twig/twig/doc/filters/keys.rst delete mode 100644 vendor/twig/twig/doc/filters/length.rst delete mode 100644 vendor/twig/twig/doc/filters/lower.rst delete mode 100644 vendor/twig/twig/doc/filters/merge.rst delete mode 100644 vendor/twig/twig/doc/filters/nl2br.rst delete mode 100644 vendor/twig/twig/doc/filters/number_format.rst delete mode 100644 vendor/twig/twig/doc/filters/raw.rst delete mode 100644 vendor/twig/twig/doc/filters/replace.rst delete mode 100644 vendor/twig/twig/doc/filters/reverse.rst delete mode 100644 vendor/twig/twig/doc/filters/slice.rst delete mode 100644 vendor/twig/twig/doc/filters/sort.rst delete mode 100644 vendor/twig/twig/doc/filters/striptags.rst delete mode 100644 vendor/twig/twig/doc/filters/title.rst delete mode 100644 vendor/twig/twig/doc/filters/trim.rst delete mode 100644 vendor/twig/twig/doc/filters/upper.rst delete mode 100644 vendor/twig/twig/doc/filters/url_encode.rst delete mode 100644 vendor/twig/twig/doc/functions/attribute.rst delete mode 100644 vendor/twig/twig/doc/functions/block.rst delete mode 100644 vendor/twig/twig/doc/functions/constant.rst delete mode 100644 vendor/twig/twig/doc/functions/cycle.rst delete mode 100644 vendor/twig/twig/doc/functions/date.rst delete mode 100644 vendor/twig/twig/doc/functions/dump.rst delete mode 100644 vendor/twig/twig/doc/functions/index.rst delete mode 100644 vendor/twig/twig/doc/functions/parent.rst delete mode 100644 vendor/twig/twig/doc/functions/random.rst delete mode 100644 vendor/twig/twig/doc/functions/range.rst delete mode 100644 vendor/twig/twig/doc/index.rst delete mode 100644 vendor/twig/twig/doc/internals.rst delete mode 100644 vendor/twig/twig/doc/intro.rst delete mode 100644 vendor/twig/twig/doc/recipes.rst delete mode 100644 vendor/twig/twig/doc/tags/autoescape.rst delete mode 100644 vendor/twig/twig/doc/tags/block.rst delete mode 100644 vendor/twig/twig/doc/tags/do.rst delete mode 100644 vendor/twig/twig/doc/tags/embed.rst delete mode 100644 vendor/twig/twig/doc/tags/extends.rst delete mode 100644 vendor/twig/twig/doc/tags/filter.rst delete mode 100644 vendor/twig/twig/doc/tags/flush.rst delete mode 100644 vendor/twig/twig/doc/tags/for.rst delete mode 100644 vendor/twig/twig/doc/tags/from.rst delete mode 100644 vendor/twig/twig/doc/tags/if.rst delete mode 100644 vendor/twig/twig/doc/tags/import.rst delete mode 100644 vendor/twig/twig/doc/tags/include.rst delete mode 100644 vendor/twig/twig/doc/tags/index.rst delete mode 100644 vendor/twig/twig/doc/tags/macro.rst delete mode 100644 vendor/twig/twig/doc/tags/raw.rst delete mode 100644 vendor/twig/twig/doc/tags/sandbox.rst delete mode 100644 vendor/twig/twig/doc/tags/set.rst delete mode 100644 vendor/twig/twig/doc/tags/spaceless.rst delete mode 100644 vendor/twig/twig/doc/tags/use.rst delete mode 100644 vendor/twig/twig/doc/templates.rst delete mode 100644 vendor/twig/twig/doc/tests/constant.rst delete mode 100644 vendor/twig/twig/doc/tests/defined.rst delete mode 100644 vendor/twig/twig/doc/tests/divisibleby.rst delete mode 100644 vendor/twig/twig/doc/tests/empty.rst delete mode 100644 vendor/twig/twig/doc/tests/even.rst delete mode 100644 vendor/twig/twig/doc/tests/index.rst delete mode 100644 vendor/twig/twig/doc/tests/iterable.rst delete mode 100644 vendor/twig/twig/doc/tests/null.rst delete mode 100644 vendor/twig/twig/doc/tests/odd.rst delete mode 100644 vendor/twig/twig/doc/tests/sameas.rst delete mode 100644 vendor/twig/twig/ext/twig/.gitignore delete mode 100644 vendor/twig/twig/ext/twig/LICENSE delete mode 100644 vendor/twig/twig/ext/twig/config.m4 delete mode 100644 vendor/twig/twig/ext/twig/config.w32 delete mode 100644 vendor/twig/twig/ext/twig/php_twig.h delete mode 100644 vendor/twig/twig/ext/twig/twig.c delete mode 100644 vendor/twig/twig/lib/Twig/Autoloader.php delete mode 100644 vendor/twig/twig/lib/Twig/Compiler.php delete mode 100644 vendor/twig/twig/lib/Twig/CompilerInterface.php delete mode 100644 vendor/twig/twig/lib/Twig/Environment.php delete mode 100644 vendor/twig/twig/lib/Twig/Error.php delete mode 100644 vendor/twig/twig/lib/Twig/Error/Loader.php delete mode 100644 vendor/twig/twig/lib/Twig/Error/Runtime.php delete mode 100644 vendor/twig/twig/lib/Twig/Error/Syntax.php delete mode 100644 vendor/twig/twig/lib/Twig/ExpressionParser.php delete mode 100644 vendor/twig/twig/lib/Twig/Extension.php delete mode 100644 vendor/twig/twig/lib/Twig/Extension/Core.php delete mode 100644 vendor/twig/twig/lib/Twig/Extension/Debug.php delete mode 100644 vendor/twig/twig/lib/Twig/Extension/Escaper.php delete mode 100644 vendor/twig/twig/lib/Twig/Extension/Optimizer.php delete mode 100644 vendor/twig/twig/lib/Twig/Extension/Sandbox.php delete mode 100644 vendor/twig/twig/lib/Twig/ExtensionInterface.php delete mode 100644 vendor/twig/twig/lib/Twig/Filter.php delete mode 100644 vendor/twig/twig/lib/Twig/Filter/Function.php delete mode 100644 vendor/twig/twig/lib/Twig/Filter/Method.php delete mode 100644 vendor/twig/twig/lib/Twig/Filter/Node.php delete mode 100644 vendor/twig/twig/lib/Twig/FilterInterface.php delete mode 100644 vendor/twig/twig/lib/Twig/Function.php delete mode 100644 vendor/twig/twig/lib/Twig/Function/Function.php delete mode 100644 vendor/twig/twig/lib/Twig/Function/Method.php delete mode 100644 vendor/twig/twig/lib/Twig/Function/Node.php delete mode 100644 vendor/twig/twig/lib/Twig/FunctionInterface.php delete mode 100644 vendor/twig/twig/lib/Twig/Lexer.php delete mode 100644 vendor/twig/twig/lib/Twig/LexerInterface.php delete mode 100644 vendor/twig/twig/lib/Twig/Loader/Array.php delete mode 100644 vendor/twig/twig/lib/Twig/Loader/Chain.php delete mode 100644 vendor/twig/twig/lib/Twig/Loader/Filesystem.php delete mode 100644 vendor/twig/twig/lib/Twig/Loader/String.php delete mode 100644 vendor/twig/twig/lib/Twig/LoaderInterface.php delete mode 100644 vendor/twig/twig/lib/Twig/Markup.php delete mode 100644 vendor/twig/twig/lib/Twig/Node.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/AutoEscape.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Block.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/BlockReference.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Body.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Do.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Embed.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Array.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Constant.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Filter.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Function.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/MethodCall.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Name.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Parent.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/TempName.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Test.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Test/Constant.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Test/Even.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Test/Null.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Unary.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Flush.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/For.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/ForLoop.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/If.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Import.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Include.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Macro.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Module.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Print.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Sandbox.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/SandboxedModule.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Set.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/SetTemp.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Spaceless.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/Text.php delete mode 100644 vendor/twig/twig/lib/Twig/NodeInterface.php delete mode 100644 vendor/twig/twig/lib/Twig/NodeOutputInterface.php delete mode 100644 vendor/twig/twig/lib/Twig/NodeTraverser.php delete mode 100644 vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php delete mode 100644 vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php delete mode 100644 vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php delete mode 100644 vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php delete mode 100644 vendor/twig/twig/lib/Twig/NodeVisitorInterface.php delete mode 100644 vendor/twig/twig/lib/Twig/Parser.php delete mode 100644 vendor/twig/twig/lib/Twig/ParserInterface.php delete mode 100644 vendor/twig/twig/lib/Twig/Sandbox/SecurityError.php delete mode 100644 vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php delete mode 100644 vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php delete mode 100644 vendor/twig/twig/lib/Twig/Template.php delete mode 100644 vendor/twig/twig/lib/Twig/TemplateInterface.php delete mode 100644 vendor/twig/twig/lib/Twig/Test/Function.php delete mode 100644 vendor/twig/twig/lib/Twig/Test/Method.php delete mode 100644 vendor/twig/twig/lib/Twig/Test/Node.php delete mode 100644 vendor/twig/twig/lib/Twig/TestInterface.php delete mode 100644 vendor/twig/twig/lib/Twig/Token.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParser.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParser/Block.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParser/Do.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParser/Embed.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParser/Extends.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParser/Filter.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParser/Flush.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParser/For.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParser/From.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParser/If.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParser/Import.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParser/Include.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParser/Macro.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParser/Sandbox.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParser/Set.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParser/Use.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParserBroker.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParserBrokerInterface.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenParserInterface.php delete mode 100644 vendor/twig/twig/lib/Twig/TokenStream.php delete mode 100644 vendor/twig/twig/package.xml.tpl delete mode 100644 vendor/twig/twig/phpunit.xml.dist delete mode 100644 vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/CompilerTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/ErrorTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/FileCachingTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/errors/base.html delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/errors/index.html delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/unclosed_tag.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array_call.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/binary.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/comparison.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/dotdot.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/grouping.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/literals.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/magic_call.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/method_call.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/postfix.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/strings.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_precedence.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/convert_encoding.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format_interval.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_interval.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_modify.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/dynamic_filter.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/force_escape.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/format.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/join.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/json_encode.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length_utf8.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/nl2br.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format_default.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reverse.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/sort.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/special_chars.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/trim.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/constant.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/cycle.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump_array.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dynamic_function.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/special_chars.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/regression/simple_xml_element.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/regression/strings_like_numbers.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/blocks.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/double_escaping.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/functions.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/literal.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/nested.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/objects.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/raw.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters_arguments.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_pre_escape_filters.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/special_chars.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/multiple.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/nested.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/with_extends.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/json_encode.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/multiple.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/nested.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_for_tag.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_if_tag.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/condition.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/context.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/else.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/inner_variables.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys_and_values.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context_local.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/nested_else.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects_countable.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/recursive.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/values.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/from.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/expression.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/expression.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/only.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/template_instance.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/templates_as_array.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/with_variables.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/dynamic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/empty.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_inheritance.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_change.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_in_a_block.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_isolation.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_nested.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/template_instance.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/use.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/endmacro_name.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/external.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/global.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/self_import.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/special_chars.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/whitespace_control.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/simple.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture-empty.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/expression.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/simple.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/special_chars.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/trim_block.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/aliases.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep_empty.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple_aliases.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/array.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/constant.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/empty.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/even.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/iterable.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/odd.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/LexerTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/DoTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/ForTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/IfTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/SandboxedModuleTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/SandboxedPrintTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/SetTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/TestCase.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/TextTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/ParserTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/TemplateTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/escapingTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/integrationTest.php delete mode 100644 vendor/twig/twig/test/bootstrap.php diff --git a/vendor/.gitignore b/vendor/.gitignore new file mode 100644 index 0000000..4ce1c7b --- /dev/null +++ b/vendor/.gitignore @@ -0,0 +1,2 @@ +* +!.git* diff --git a/vendor/ClassLoader.php b/vendor/ClassLoader.php deleted file mode 100644 index d07cb31..0000000 --- a/vendor/ClassLoader.php +++ /dev/null @@ -1,203 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements an PSR-0 class loader - * - * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md - * - * $loader = new ComposerClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - */ -class ClassLoader -{ - private $prefixes = array(); - private $fallbackDirs = array(); - private $useIncludePath = false; - private $classMap = array(); - - public function getPrefixes() - { - return $this->prefixes; - } - - public function getFallbackDirs() - { - return $this->fallbackDirs; - } - - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of classes - * - * @param string $prefix The classes prefix - * @param array|string $paths The location(s) of the classes - */ - public function add($prefix, $paths) - { - if (!$prefix) { - foreach ((array) $paths as $path) { - $this->fallbackDirs[] = $path; - } - return; - } - if (isset($this->prefixes[$prefix])) { - $this->prefixes[$prefix] = array_merge( - $this->prefixes[$prefix], - (array) $paths - ); - } else { - $this->prefixes[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include for class files. - * - * @param Boolean $useIncludePath - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return Boolean - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Registers this instance as an autoloader. - * - * @param Boolean $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return Boolean|null True, if loaded - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - require $file; - return true; - } - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|null The path, if found - */ - public function findFile($class) - { - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - - if ('\\' == $class[0]) { - $class = substr($class, 1); - } - - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)) . DIRECTORY_SEPARATOR; - $className = substr($class, $pos + 1); - } else { - // PEAR-like class name - $classPath = null; - $className = $class; - } - - $classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; - - foreach ($this->prefixes as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) { - return $dir . DIRECTORY_SEPARATOR . $classPath; - } - } - } - } - - foreach ($this->fallbackDirs as $dir) { - if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) { - return $dir . DIRECTORY_SEPARATOR . $classPath; - } - } - - if ($this->useIncludePath && $file = stream_resolve_include_path($classPath)) { - return $file; - } - } -} diff --git a/vendor/autoload.php b/vendor/autoload.php deleted file mode 100644 index c741020..0000000 --- a/vendor/autoload.php +++ /dev/null @@ -1,27 +0,0 @@ - $path) { - $loader->add($namespace, $path); - } - - $classMap = require $composerDir . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - - $loader->register(); - - require __DIR__ . '/swiftmailer/swiftmailer/lib/swift_required.php'; - - return $loader; -}); diff --git a/vendor/autoload_classmap.php b/vendor/autoload_classmap.php deleted file mode 100644 index b382d27..0000000 --- a/vendor/autoload_classmap.php +++ /dev/null @@ -1,9 +0,0 @@ - $vendorDir . '/twig/extensions/lib/', - 'Twig_' => $vendorDir . '/twig/twig/lib/', - 'Symfony\\Bundle\\SwiftmailerBundle' => $vendorDir . '/symfony/swiftmailer-bundle/', - 'Symfony\\Bundle\\MonologBundle' => $vendorDir . '/symfony/monolog-bundle/', - 'Symfony\\Bundle\\AsseticBundle' => $vendorDir . '/symfony/assetic-bundle/', - 'Symfony\\Bridge\\Swiftmailer' => $vendorDir . '/symfony/swiftmailer-bridge/', - 'Symfony' => $vendorDir . '/symfony/symfony/src/', - 'SessionHandlerInterface' => $vendorDir . '/symfony/symfony/src/Symfony/Component/HttpFoundation/Resources/stubs', - 'Sensio\\Bundle\\GeneratorBundle' => $vendorDir . '/sensio/generator-bundle/', - 'Sensio\\Bundle\\FrameworkExtraBundle' => $vendorDir . '/sensio/framework-extra-bundle/', - 'Sensio\\Bundle\\DistributionBundle' => $vendorDir . '/sensio/distribution-bundle/', - 'Monolog' => $vendorDir . '/monolog/monolog/src/', - 'Metadata\\' => $vendorDir . '/jms/metadata/src/', - 'JMS\\SecurityExtraBundle' => $vendorDir . '/jms/security-extra-bundle/', - 'JMS\\DiExtraBundle' => $vendorDir . '/jms/di-extra-bundle/', - 'JMS\\AopBundle' => $vendorDir . '/jms/aop-bundle/', - 'Doctrine\\ORM' => $vendorDir . '/doctrine/orm/lib/', - 'Doctrine\\DBAL' => $vendorDir . '/doctrine/dbal/lib/', - 'Doctrine\\Common' => $vendorDir . '/doctrine/common/lib/', - 'Doctrine\\Bundle\\DoctrineBundle' => $vendorDir . '/doctrine/doctrine-bundle/', - 'CG\\' => $vendorDir . '/jms/cg/src/', - 'Assetic' => $vendorDir . '/kriswallsmith/assetic/src/', - '' => $baseDir . '/src/', -); diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php deleted file mode 100644 index d1c2cd5..0000000 --- a/vendor/composer/ClassLoader.php +++ /dev/null @@ -1,205 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0 class loader - * - * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - */ -class ClassLoader -{ - private $prefixes = array(); - private $fallbackDirs = array(); - private $useIncludePath = false; - private $classMap = array(); - - public function getPrefixes() - { - return $this->prefixes; - } - - public function getFallbackDirs() - { - return $this->fallbackDirs; - } - - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of classes - * - * @param string $prefix The classes prefix - * @param array|string $paths The location(s) of the classes - */ - public function add($prefix, $paths) - { - if (!$prefix) { - foreach ((array) $paths as $path) { - $this->fallbackDirs[] = $path; - } - - return; - } - if (isset($this->prefixes[$prefix])) { - $this->prefixes[$prefix] = array_merge( - $this->prefixes[$prefix], - (array) $paths - ); - } else { - $this->prefixes[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return bool|null True, if loaded - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - include $file; - - return true; - } - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|null The path, if found - */ - public function findFile($class) - { - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - - if ('\\' == $class[0]) { - $class = substr($class, 1); - } - - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)) . DIRECTORY_SEPARATOR; - $className = substr($class, $pos + 1); - } else { - // PEAR-like class name - $classPath = null; - $className = $class; - } - - $classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; - - foreach ($this->prefixes as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) { - return $dir . DIRECTORY_SEPARATOR . $classPath; - } - } - } - } - - foreach ($this->fallbackDirs as $dir) { - if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) { - return $dir . DIRECTORY_SEPARATOR . $classPath; - } - } - - if ($this->useIncludePath && $file = stream_resolve_include_path($classPath)) { - return $file; - } - } -} diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php deleted file mode 100644 index 4a9177d..0000000 --- a/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,9 +0,0 @@ - $vendorDir . '/twig/extensions/lib/', - 'Twig_' => $vendorDir . '/twig/twig/lib/', - 'Symfony\\Bundle\\SwiftmailerBundle' => $vendorDir . '/symfony/swiftmailer-bundle/', - 'Symfony\\Bundle\\MonologBundle' => $vendorDir . '/symfony/monolog-bundle/', - 'Symfony\\Bundle\\AsseticBundle' => $vendorDir . '/symfony/assetic-bundle/', - 'Symfony' => $vendorDir . '/symfony/symfony/src/', - 'SessionHandlerInterface' => $vendorDir . '/symfony/symfony/src/Symfony/Component/HttpFoundation/Resources/stubs', - 'Sensio\\Bundle\\GeneratorBundle' => $vendorDir . '/sensio/generator-bundle/', - 'Sensio\\Bundle\\FrameworkExtraBundle' => $vendorDir . '/sensio/framework-extra-bundle/', - 'Sensio\\Bundle\\DistributionBundle' => $vendorDir . '/sensio/distribution-bundle/', - 'Monolog' => $vendorDir . '/monolog/monolog/src/', - 'Metadata\\' => $vendorDir . '/jms/metadata/src/', - 'JMS\\SecurityExtraBundle' => $vendorDir . '/jms/security-extra-bundle/', - 'JMS\\DiExtraBundle' => $vendorDir . '/jms/di-extra-bundle/', - 'JMS\\AopBundle' => $vendorDir . '/jms/aop-bundle/', - 'Ivory\\CKEditorBundle' => $vendorDir . '/egeloen/ckeditor-bundle/', - 'Doctrine\\ORM' => $vendorDir . '/doctrine/orm/lib/', - 'Doctrine\\DBAL\\Migrations' => $vendorDir . '/doctrine/migrations/lib', - 'Doctrine\\DBAL' => $vendorDir . '/doctrine/dbal/lib/', - 'Doctrine\\Common' => $vendorDir . '/doctrine/common/lib/', - 'Doctrine\\Bundle\\MigrationsBundle' => $vendorDir . '/doctrine/doctrine-migrations-bundle/', - 'Doctrine\\Bundle\\DoctrineBundle' => $vendorDir . '/doctrine/doctrine-bundle/', - 'CG\\' => $vendorDir . '/jms/cg/src/', - 'Assetic' => $vendorDir . '/kriswallsmith/assetic/src/', - '' => $baseDir . '/src/', -); diff --git a/vendor/composer/installed_dev.json b/vendor/composer/installed_dev.json deleted file mode 100644 index 3be7d3e..0000000 --- a/vendor/composer/installed_dev.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - - ] diff --git a/vendor/doctrine/common/.travis.yml b/vendor/doctrine/common/.travis.yml deleted file mode 100644 index 4464d4f..0000000 --- a/vendor/doctrine/common/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: php - -php: - - 5.3 - - 5.4 diff --git a/vendor/doctrine/common/LICENSE b/vendor/doctrine/common/LICENSE deleted file mode 100644 index 1c03f74..0000000 --- a/vendor/doctrine/common/LICENSE +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/vendor/doctrine/common/README.md b/vendor/doctrine/common/README.md deleted file mode 100644 index c63f762..0000000 --- a/vendor/doctrine/common/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Doctrine Common - -[![Build Status](https://secure.travis-ci.org/doctrine/common.png)](http://travis-ci.org/doctrine/common) - -The Doctrine Common project is a library that provides extensions to core PHP functionality. - -## More resources: - -* [Website](http://www.doctrine-project.org) -* [Documentation](http://www.doctrine-project.org/projects/common/current/docs/en) -* [Issue Tracker](http://www.doctrine-project.org/jira/browse/DCOM) -* [Downloads](http://github.com/doctrine/common/downloads) diff --git a/vendor/doctrine/common/UPGRADE_TO_2_1 b/vendor/doctrine/common/UPGRADE_TO_2_1 deleted file mode 100644 index 891a2e5..0000000 --- a/vendor/doctrine/common/UPGRADE_TO_2_1 +++ /dev/null @@ -1,39 +0,0 @@ -This document details all the possible changes that you should investigate when updating -your project from Doctrine Common 2.0.x to 2.1 - -## AnnotationReader changes - -The annotation reader was heavily refactored between 2.0 and 2.1-RC1. In theory the operation of the new reader should be backwards compatible, but it has to be setup differently to work that way: - - $reader = new \Doctrine\Common\Annotations\AnnotationReader(); - $reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\'); - // new code necessary starting here - $reader->setIgnoreNotImportedAnnotations(true); - $reader->setEnableParsePhpImports(false); - $reader = new \Doctrine\Common\Annotations\CachedReader( - new \Doctrine\Common\Annotations\IndexedReader($reader), new ArrayCache() - ); - -## Annotation Base class or @Annotation - -Beginning after 2.1-RC2 you have to either extend ``Doctrine\Common\Annotations\Annotation`` or add @Annotation to your annotations class-level docblock, otherwise the class will simply be ignored. - -## Removed methods on AnnotationReader - -* AnnotationReader::setAutoloadAnnotations() -* AnnotationReader::getAutoloadAnnotations() -* AnnotationReader::isAutoloadAnnotations() - -## AnnotationRegistry - -Autoloading through the PHP autoloader is removed from the 2.1 AnnotationReader. Instead you have to use the global AnnotationRegistry for loading purposes: - - \Doctrine\Common\Annotations\AnnotationRegistry::registerFile($fileWithAnnotations); - \Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace($namespace, $dirs = null); - \Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespaces($namespaces); - \Doctrine\Common\Annotations\AnnotationRegistry::registerLoader($callable); - -The $callable for registering a loader accepts a class as first and only parameter and must try to silently autoload it. On success true has to be returned. -The registerAutoloadNamespace function registers a PSR-0 compatible silent autoloader for all classes with the given namespace in the given directories. -If null is passed as directory the include path will be used. - diff --git a/vendor/doctrine/common/UPGRADE_TO_2_2 b/vendor/doctrine/common/UPGRADE_TO_2_2 deleted file mode 100644 index 1d93a13..0000000 --- a/vendor/doctrine/common/UPGRADE_TO_2_2 +++ /dev/null @@ -1,61 +0,0 @@ -This document details all the possible changes that you should investigate when -updating your project from Doctrine Common 2.1 to 2.2: - -## Annotation Changes - -- AnnotationReader::setIgnoreNotImportedAnnotations has been removed, you need to - add ignore annotation names which are supposed to be ignored via - AnnotationReader::addGlobalIgnoredName - -- AnnotationReader::setAutoloadAnnotations was deprecated by the AnnotationRegistry - in 2.1 and has been removed in 2.2 - -- AnnotationReader::setEnableParsePhpImports was added to ease transition to the new - annotation mechanism in 2.1 and is removed in 2.2 - -- AnnotationReader::isParsePhpImportsEnabled is removed (see above) - -- AnnotationReader::setDefaultAnnotationNamespace was deprecated in favor of explicit - configuration in 2.1 and will be removed in 2.2 (for isolated projects where you - have full-control over _all_ available annotations, we offer a dedicated reader - class ``SimpleAnnotationReader``) - -- AnnotationReader::setAnnotationCreationFunction was deprecated in 2.1 and will be - removed in 2.2. We only offer two creation mechanisms which cannot be changed - anymore to allow the same reader instance to work with all annotations regardless - of which library they are coming from. - -- AnnotationReader::setAnnotationNamespaceAlias was deprecated in 2.1 and will be - removed in 2.2 (see setDefaultAnnotationNamespace) - -- If you use a class as annotation which has not the @Annotation marker in it's - class block, we will now throw an exception instead of silently ignoring it. You - can however still achieve the previous behavior using the @IgnoreAnnotation, or - AnnotationReader::addGlobalIgnoredName (the exception message will contain detailed - instructions when you run into this problem). - -## Cache Changes - -- Renamed old AbstractCache to CacheProvider - -- Dropped the support to the following functions of all cache providers: - - - CacheProvider::deleteByWildcard - - - CacheProvider::deleteByRegEx - - - CacheProvider::deleteByPrefix - - - CacheProvider::deleteBySuffix - -- CacheProvider::deleteAll will not remove ALL entries, it will only mark them as invalid - -- CacheProvider::flushAll will remove ALL entries, namespaced or not - -- Added support to MemcachedCache - -- Added support to WincacheCache - -## ClassLoader Changes - -- ClassLoader::fileExistsInIncludePath() no longer exists. Use the native stream_resolve_include_path() PHP function \ No newline at end of file diff --git a/vendor/doctrine/common/composer.json b/vendor/doctrine/common/composer.json deleted file mode 100644 index 7780d93..0000000 --- a/vendor/doctrine/common/composer.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "doctrine/common", - "type": "library","version":"2.2.2", - "description": "Common Library for Doctrine projects", - "keywords": ["collections", "spl", "eventmanager", "annotations", "persistence"], - "homepage": "http://www.doctrine-project.org", - "license": "LGPL", - "authors": [ - {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, - {"name": "Roman Borschel", "email": "roman@code-factory.org"}, - {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, - {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}, - {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} - ], - "require": { - "php": ">=5.3.2" - }, - "autoload": { - "psr-0": { "Doctrine\\Common": "lib/" } - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/.gitignore b/vendor/doctrine/common/doctrine-common-ac6c39b/.gitignore deleted file mode 100644 index fb5e79d..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -build/ -logs/ -reports/ -dist/ diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/.gitmodules b/vendor/doctrine/common/doctrine-common-ac6c39b/.gitmodules deleted file mode 100644 index 51f0843..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "lib/vendor/doctrine-build-common"] - path = lib/vendor/doctrine-build-common - url = git://github.com/doctrine/doctrine-build-common.git diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/.travis.yml b/vendor/doctrine/common/doctrine-common-ac6c39b/.travis.yml deleted file mode 100644 index 4464d4f..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: php - -php: - - 5.3 - - 5.4 diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/LICENSE b/vendor/doctrine/common/doctrine-common-ac6c39b/LICENSE deleted file mode 100644 index 1c03f74..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/LICENSE +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/README.md b/vendor/doctrine/common/doctrine-common-ac6c39b/README.md deleted file mode 100644 index c63f762..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Doctrine Common - -[![Build Status](https://secure.travis-ci.org/doctrine/common.png)](http://travis-ci.org/doctrine/common) - -The Doctrine Common project is a library that provides extensions to core PHP functionality. - -## More resources: - -* [Website](http://www.doctrine-project.org) -* [Documentation](http://www.doctrine-project.org/projects/common/current/docs/en) -* [Issue Tracker](http://www.doctrine-project.org/jira/browse/DCOM) -* [Downloads](http://github.com/doctrine/common/downloads) diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/UPGRADE_TO_2_1 b/vendor/doctrine/common/doctrine-common-ac6c39b/UPGRADE_TO_2_1 deleted file mode 100644 index 891a2e5..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/UPGRADE_TO_2_1 +++ /dev/null @@ -1,39 +0,0 @@ -This document details all the possible changes that you should investigate when updating -your project from Doctrine Common 2.0.x to 2.1 - -## AnnotationReader changes - -The annotation reader was heavily refactored between 2.0 and 2.1-RC1. In theory the operation of the new reader should be backwards compatible, but it has to be setup differently to work that way: - - $reader = new \Doctrine\Common\Annotations\AnnotationReader(); - $reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\'); - // new code necessary starting here - $reader->setIgnoreNotImportedAnnotations(true); - $reader->setEnableParsePhpImports(false); - $reader = new \Doctrine\Common\Annotations\CachedReader( - new \Doctrine\Common\Annotations\IndexedReader($reader), new ArrayCache() - ); - -## Annotation Base class or @Annotation - -Beginning after 2.1-RC2 you have to either extend ``Doctrine\Common\Annotations\Annotation`` or add @Annotation to your annotations class-level docblock, otherwise the class will simply be ignored. - -## Removed methods on AnnotationReader - -* AnnotationReader::setAutoloadAnnotations() -* AnnotationReader::getAutoloadAnnotations() -* AnnotationReader::isAutoloadAnnotations() - -## AnnotationRegistry - -Autoloading through the PHP autoloader is removed from the 2.1 AnnotationReader. Instead you have to use the global AnnotationRegistry for loading purposes: - - \Doctrine\Common\Annotations\AnnotationRegistry::registerFile($fileWithAnnotations); - \Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace($namespace, $dirs = null); - \Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespaces($namespaces); - \Doctrine\Common\Annotations\AnnotationRegistry::registerLoader($callable); - -The $callable for registering a loader accepts a class as first and only parameter and must try to silently autoload it. On success true has to be returned. -The registerAutoloadNamespace function registers a PSR-0 compatible silent autoloader for all classes with the given namespace in the given directories. -If null is passed as directory the include path will be used. - diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/UPGRADE_TO_2_2 b/vendor/doctrine/common/doctrine-common-ac6c39b/UPGRADE_TO_2_2 deleted file mode 100644 index 1d93a13..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/UPGRADE_TO_2_2 +++ /dev/null @@ -1,61 +0,0 @@ -This document details all the possible changes that you should investigate when -updating your project from Doctrine Common 2.1 to 2.2: - -## Annotation Changes - -- AnnotationReader::setIgnoreNotImportedAnnotations has been removed, you need to - add ignore annotation names which are supposed to be ignored via - AnnotationReader::addGlobalIgnoredName - -- AnnotationReader::setAutoloadAnnotations was deprecated by the AnnotationRegistry - in 2.1 and has been removed in 2.2 - -- AnnotationReader::setEnableParsePhpImports was added to ease transition to the new - annotation mechanism in 2.1 and is removed in 2.2 - -- AnnotationReader::isParsePhpImportsEnabled is removed (see above) - -- AnnotationReader::setDefaultAnnotationNamespace was deprecated in favor of explicit - configuration in 2.1 and will be removed in 2.2 (for isolated projects where you - have full-control over _all_ available annotations, we offer a dedicated reader - class ``SimpleAnnotationReader``) - -- AnnotationReader::setAnnotationCreationFunction was deprecated in 2.1 and will be - removed in 2.2. We only offer two creation mechanisms which cannot be changed - anymore to allow the same reader instance to work with all annotations regardless - of which library they are coming from. - -- AnnotationReader::setAnnotationNamespaceAlias was deprecated in 2.1 and will be - removed in 2.2 (see setDefaultAnnotationNamespace) - -- If you use a class as annotation which has not the @Annotation marker in it's - class block, we will now throw an exception instead of silently ignoring it. You - can however still achieve the previous behavior using the @IgnoreAnnotation, or - AnnotationReader::addGlobalIgnoredName (the exception message will contain detailed - instructions when you run into this problem). - -## Cache Changes - -- Renamed old AbstractCache to CacheProvider - -- Dropped the support to the following functions of all cache providers: - - - CacheProvider::deleteByWildcard - - - CacheProvider::deleteByRegEx - - - CacheProvider::deleteByPrefix - - - CacheProvider::deleteBySuffix - -- CacheProvider::deleteAll will not remove ALL entries, it will only mark them as invalid - -- CacheProvider::flushAll will remove ALL entries, namespaced or not - -- Added support to MemcachedCache - -- Added support to WincacheCache - -## ClassLoader Changes - -- ClassLoader::fileExistsInIncludePath() no longer exists. Use the native stream_resolve_include_path() PHP function \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/build.properties b/vendor/doctrine/common/doctrine-common-ac6c39b/build.properties deleted file mode 100644 index ff311a4..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -# Project Name -project.name=DoctrineCommon - -# Version class and file -project.version_class = Doctrine\Common\Version -project.version_file = lib/Doctrine/Common/Version.php diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/build.xml b/vendor/doctrine/common/doctrine-common-ac6c39b/build.xml deleted file mode 100644 index 71a9a50..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/build.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DoctrineCommon - Doctrine Common PHP Extensions - pear.doctrine-project.org - The Doctrine Common package contains shared code between the other packages. - - - - - LGPL - - - - - - - - - - - diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/composer.json b/vendor/doctrine/common/doctrine-common-ac6c39b/composer.json deleted file mode 100644 index 7780d93..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/composer.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "doctrine/common", - "type": "library","version":"2.2.2", - "description": "Common Library for Doctrine projects", - "keywords": ["collections", "spl", "eventmanager", "annotations", "persistence"], - "homepage": "http://www.doctrine-project.org", - "license": "LGPL", - "authors": [ - {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, - {"name": "Roman Borschel", "email": "roman@code-factory.org"}, - {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, - {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}, - {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} - ], - "require": { - "php": ">=5.3.2" - }, - "autoload": { - "psr-0": { "Doctrine\\Common": "lib/" } - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation.php deleted file mode 100644 index 6251252..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation.php +++ /dev/null @@ -1,75 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -/** - * Annotations class - * - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class Annotation -{ - /** - * Value property. Common among all derived classes. - * - * @var string - */ - public $value; - - /** - * Constructor - * - * @param array $data Key-value for properties to be defined in this class - */ - public final function __construct(array $data) - { - foreach ($data as $key => $value) { - $this->$key = $value; - } - } - - /** - * Error handler for unknown property accessor in Annotation class. - * - * @param string $name Unknown property name - */ - public function __get($name) - { - throw new \BadMethodCallException( - sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this)) - ); - } - - /** - * Error handler for unknown property mutator in Annotation class. - * - * @param string $name Unkown property name - * @param mixed $value Property value - */ - public function __set($name, $value) - { - throw new \BadMethodCallException( - sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this)) - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation/Attribute.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation/Attribute.php deleted file mode 100644 index 21597b1..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation/Attribute.php +++ /dev/null @@ -1,47 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations\Annotation; - -/** - * Annotation that can be used to signal to the parser - * to check the attribute type during the parsing process. - * - * @author Fabio B. Silva - * - * @Annotation - */ -final class Attribute -{ - /** - * @var string - */ - public $name; - - /** - * @var string - */ - public $type; - - /** - * @var boolean - */ - public $required = false; -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation/Attributes.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation/Attributes.php deleted file mode 100644 index 6e314be..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation/Attributes.php +++ /dev/null @@ -1,37 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations\Annotation; - -/** - * Annotation that can be used to signal to the parser - * to check the types of all declared attributes during the parsing process. - * - * @author Fabio B. Silva - * - * @Annotation - */ -final class Attributes -{ - /** - * @var array - */ - public $value; -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php deleted file mode 100644 index 1b2b20a..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php +++ /dev/null @@ -1,44 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations\Annotation; - -/** - * Annotation that can be used to signal to the parser to ignore specific - * annotations during the parsing process. - * - * @Annotation - * @author Johannes M. Schmitt - */ -final class IgnoreAnnotation -{ - public $names; - - public function __construct(array $values) - { - if (is_string($values['value'])) { - $values['value'] = array($values['value']); - } - if (!is_array($values['value'])) { - throw new \RuntimeException(sprintf('@IgnoreAnnotation expects either a string name, or an array of strings, but got %s.', json_encode($values['value']))); - } - - $this->names = $values['value']; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation/Required.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation/Required.php deleted file mode 100644 index 7b89a02..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation/Required.php +++ /dev/null @@ -1,33 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations\Annotation; - -/** - * Annotation that can be used to signal to the parser - * to check if that attribute is required during the parsing process. - * - * @author Fabio B. Silva - * - * @Annotation - */ -final class Required -{ -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation/Target.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation/Target.php deleted file mode 100644 index c41896a..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Annotation/Target.php +++ /dev/null @@ -1,105 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations\Annotation; - -/** - * Annotation that can be used to signal to the parser - * to check the annotation target during the parsing process. - * - * @author Fabio B. Silva - * - * @Annotation - */ -final class Target -{ - const TARGET_CLASS = 1; - const TARGET_METHOD = 2; - const TARGET_PROPERTY = 4; - const TARGET_ANNOTATION = 8; - const TARGET_ALL = 15; - - /** - * @var array - */ - private static $map = array( - 'ALL' => self::TARGET_ALL, - 'CLASS' => self::TARGET_CLASS, - 'METHOD' => self::TARGET_METHOD, - 'PROPERTY' => self::TARGET_PROPERTY, - 'ANNOTATION' => self::TARGET_ANNOTATION, - ); - - /** - * @var array - */ - public $value; - - /** - * Targets as bitmask. - * - * @var integer - */ - public $targets; - - /** - * Literal target declaration. - * - * @var integer - */ - public $literal; - - /** - * Annotation construct - * - * @param array $values - */ - public function __construct(array $values) - { - if (!isset($values['value'])){ - $values['value'] = null; - } - if (is_string($values['value'])){ - $values['value'] = array($values['value']); - } - if (!is_array($values['value'])){ - throw new \InvalidArgumentException( - sprintf('@Target expects either a string value, or an array of strings, "%s" given.', - is_object($values['value']) ? get_class($values['value']) : gettype($values['value']) - ) - ); - } - - $bitmask = 0; - foreach ($values['value'] as $literal) { - if(!isset(self::$map[$literal])){ - throw new \InvalidArgumentException( - sprintf('Invalid Target "%s". Available targets: [%s]', - $literal, implode(', ', array_keys(self::$map))) - ); - } - $bitmask += self::$map[$literal]; - } - - $this->targets = $bitmask; - $this->value = $values['value']; - $this->literal = implode(', ', $this->value); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/AnnotationException.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/AnnotationException.php deleted file mode 100644 index fdc1913..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/AnnotationException.php +++ /dev/null @@ -1,111 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -/** - * Description of AnnotationException - * - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class AnnotationException extends \Exception -{ - /** - * Creates a new AnnotationException describing a Syntax error. - * - * @param string $message Exception message - * @return AnnotationException - */ - public static function syntaxError($message) - { - return new self('[Syntax Error] ' . $message); - } - - /** - * Creates a new AnnotationException describing a Semantical error. - * - * @param string $message Exception message - * @return AnnotationException - */ - public static function semanticalError($message) - { - return new self('[Semantical Error] ' . $message); - } - - /** - * Creates a new AnnotationException describing an error which occurred during - * the creation of the annotation. - * - * @since 2.2 - * @param string $message - * @return AnnotationException - */ - public static function creationError($message) - { - return new self('[Creation Error] ' . $message); - } - - /** - * Creates a new AnnotationException describing an type error of an attribute. - * - * @since 2.2 - * @param string $attributeName - * @param string $annotationName - * @param string $context - * @param string $expected - * @param mixed $actual - * @return AnnotationException - */ - public static function typeError($attributeName, $annotationName, $context, $expected, $actual) - { - return new self(sprintf( - '[Type Error] Attribute "%s" of @%s declared on %s expects %s, but got %s.', - $attributeName, - $annotationName, - $context, - $expected, - is_object($actual) ? 'an instance of '.get_class($actual) : gettype($actual) - )); - } - - /** - * Creates a new AnnotationException describing an required error of an attribute. - * - * @since 2.2 - * @param string $attributeName - * @param string $annotationName - * @param string $context - * @param string $expected - * @return AnnotationException - */ - public static function requiredError($attributeName, $annotationName, $context, $expected) - { - return new self(sprintf( - '[Type Error] Attribute "%s" of @%s declared on %s expects %s. This value should not be null.', - $attributeName, - $annotationName, - $context, - $expected - )); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/AnnotationReader.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/AnnotationReader.php deleted file mode 100644 index dda8b23..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/AnnotationReader.php +++ /dev/null @@ -1,301 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -use Doctrine\Common\Annotations\Annotation\IgnoreAnnotation; -use Doctrine\Common\Annotations\Annotation\Target; -use Closure; -use ReflectionClass; -use ReflectionMethod; -use ReflectionProperty; - -/** - * A reader for docblock annotations. - * - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Johannes M. Schmitt - */ -final class AnnotationReader implements Reader -{ - /** - * Global map for imports. - * - * @var array - */ - private static $globalImports = array( - 'ignoreannotation' => 'Doctrine\Common\Annotations\Annotation\IgnoreAnnotation', - ); - - /** - * A list with annotations that are not causing exceptions when not resolved to an annotation class. - * - * The names are case sensitive. - * - * @var array - */ - private static $globalIgnoredNames = array( - 'access'=> true, 'author'=> true, 'copyright'=> true, 'deprecated'=> true, - 'example'=> true, 'ignore'=> true, 'internal'=> true, 'link'=> true, 'see'=> true, - 'since'=> true, 'tutorial'=> true, 'version'=> true, 'package'=> true, - 'subpackage'=> true, 'name'=> true, 'global'=> true, 'param'=> true, - 'return'=> true, 'staticvar'=> true, 'category'=> true, 'staticVar'=> true, - 'static'=> true, 'var'=> true, 'throws'=> true, 'inheritdoc'=> true, - 'inheritDoc'=> true, 'license'=> true, 'todo'=> true, 'deprecated'=> true, - 'deprec'=> true, 'author'=> true, 'property' => true, 'method' => true, - 'abstract'=> true, 'exception'=> true, 'magic' => true, 'api' => true, - 'final'=> true, 'filesource'=> true, 'throw' => true, 'uses' => true, - 'usedby'=> true, 'private' => true, 'Annotation' => true, 'override' => true, - 'codeCoverageIgnore' => true, 'codeCoverageIgnoreStart' => true, 'codeCoverageIgnoreEnd' => true, - 'Required' => true, 'Attribute' => true, 'Attributes' => true, - 'Target' => true, 'SuppressWarnings' => true, - ); - - /** - * Add a new annotation to the globally ignored annotation names with regard to exception handling. - * - * @param string $name - */ - static public function addGlobalIgnoredName($name) - { - self::$globalIgnoredNames[$name] = true; - } - - /** - * Annotations Parser - * - * @var Doctrine\Common\Annotations\DocParser - */ - private $parser; - - /** - * Annotations Parser used to collect parsing metadata - * - * @var Doctrine\Common\Annotations\DocParser - */ - private $preParser; - - /** - * PHP Parser used to collect imports. - * - * @var Doctrine\Common\Annotations\PhpParser - */ - private $phpParser; - - /** - * In-memory cache mechanism to store imported annotations per class. - * - * @var array - */ - private $imports = array(); - - /** - * In-memory cache mechanism to store ignored annotations per class. - * - * @var array - */ - private $ignoredAnnotationNames = array(); - - /** - * Constructor. - * - * Initializes a new AnnotationReader. - */ - public function __construct() - { - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/IgnoreAnnotation.php'); - - $this->parser = new DocParser; - - $this->preParser = new DocParser; - $this->preParser->setImports(self::$globalImports); - $this->preParser->setIgnoreNotImportedAnnotations(true); - - $this->phpParser = new PhpParser; - } - - /** - * Gets the annotations applied to a class. - * - * @param ReflectionClass $class The ReflectionClass of the class from which - * the class annotations should be read. - * @return array An array of Annotations. - */ - public function getClassAnnotations(ReflectionClass $class) - { - $this->parser->setTarget(Target::TARGET_CLASS); - $this->parser->setImports($this->getImports($class)); - $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class)); - - return $this->parser->parse($class->getDocComment(), 'class ' . $class->getName()); - } - - /** - * Gets a class annotation. - * - * @param ReflectionClass $class The ReflectionClass of the class from which - * the class annotations should be read. - * @param string $annotationName The name of the annotation. - * @return The Annotation or NULL, if the requested annotation does not exist. - */ - public function getClassAnnotation(ReflectionClass $class, $annotationName) - { - $annotations = $this->getClassAnnotations($class); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * Gets the annotations applied to a property. - * - * @param ReflectionProperty $property The ReflectionProperty of the property - * from which the annotations should be read. - * @return array An array of Annotations. - */ - public function getPropertyAnnotations(ReflectionProperty $property) - { - $class = $property->getDeclaringClass(); - $context = 'property ' . $class->getName() . "::\$" . $property->getName(); - $this->parser->setTarget(Target::TARGET_PROPERTY); - $this->parser->setImports($this->getImports($class)); - $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class)); - - return $this->parser->parse($property->getDocComment(), $context); - } - - /** - * Gets a property annotation. - * - * @param ReflectionProperty $property - * @param string $annotationName The name of the annotation. - * @return The Annotation or NULL, if the requested annotation does not exist. - */ - public function getPropertyAnnotation(ReflectionProperty $property, $annotationName) - { - $annotations = $this->getPropertyAnnotations($property); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * Gets the annotations applied to a method. - * - * @param ReflectionMethod $property The ReflectionMethod of the method from which - * the annotations should be read. - * @return array An array of Annotations. - */ - public function getMethodAnnotations(ReflectionMethod $method) - { - $class = $method->getDeclaringClass(); - $context = 'method ' . $class->getName() . '::' . $method->getName() . '()'; - $this->parser->setTarget(Target::TARGET_METHOD); - $this->parser->setImports($this->getImports($class)); - $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class)); - - return $this->parser->parse($method->getDocComment(), $context); - } - - /** - * Gets a method annotation. - * - * @param ReflectionMethod $method - * @param string $annotationName The name of the annotation. - * @return The Annotation or NULL, if the requested annotation does not exist. - */ - public function getMethodAnnotation(ReflectionMethod $method, $annotationName) - { - $annotations = $this->getMethodAnnotations($method); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * Returns the ignored annotations for the given class. - * - * @param ReflectionClass $class - * @return array - */ - private function getIgnoredAnnotationNames(ReflectionClass $class) - { - if (isset($this->ignoredAnnotationNames[$name = $class->getName()])) { - return $this->ignoredAnnotationNames[$name]; - } - $this->collectParsingMetadata($class); - - return $this->ignoredAnnotationNames[$name]; - } - - private function getImports(ReflectionClass $class) - { - if (isset($this->imports[$name = $class->getName()])) { - return $this->imports[$name]; - } - $this->collectParsingMetadata($class); - - return $this->imports[$name]; - } - - /** - * Collects parsing metadata for a given class - * - * @param ReflectionClass $class - */ - private function collectParsingMetadata(ReflectionClass $class) - { - $ignoredAnnotationNames = self::$globalIgnoredNames; - - $annotations = $this->preParser->parse($class->getDocComment(), 'class '.$class->name); - foreach ($annotations as $annotation) { - if ($annotation instanceof IgnoreAnnotation) { - foreach ($annotation->names AS $annot) { - $ignoredAnnotationNames[$annot] = true; - } - } - } - - $name = $class->getName(); - $this->imports[$name] = array_merge( - self::$globalImports, - $this->phpParser->parseClass($class), - array('__NAMESPACE__' => $class->getNamespaceName()) - ); - $this->ignoredAnnotationNames[$name] = $ignoredAnnotationNames; - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/AnnotationRegistry.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/AnnotationRegistry.php deleted file mode 100644 index 60b00f5..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/AnnotationRegistry.php +++ /dev/null @@ -1,129 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -final class AnnotationRegistry -{ - /** - * A map of namespaces to use for autoloading purposes based on a PSR-0 convention. - * - * Contains the namespace as key and an array of directories as value. If the value is NULL - * the include path is used for checking for the corresponding file. - * - * This autoloading mechanism does not utilize the PHP autoloading but implements autoloading on its own. - * - * @var array - */ - static private $autoloadNamespaces = array(); - - /** - * A map of autoloader callables. - * - * @var array - */ - static private $loaders = array(); - - static public function reset() - { - self::$autoloadNamespaces = array(); - self::$loaders = array(); - } - - static public function registerFile($file) - { - require_once $file; - } - - /** - * Add a namespace with one or many directories to look for files or null for the include path. - * - * Loading of this namespaces will be done with a PSR-0 namespace loading algorithm. - * - * @param string $namespace - * @param string|array|null $dirs - */ - static public function registerAutoloadNamespace($namespace, $dirs = null) - { - self::$autoloadNamespaces[$namespace] = $dirs; - } - - /** - * Register multiple namespaces - * - * Loading of this namespaces will be done with a PSR-0 namespace loading algorithm. - * - * @param array $namespaces - */ - static public function registerAutoloadNamespaces(array $namespaces) - { - self::$autoloadNamespaces = array_merge(self::$autoloadNamespaces, $namespaces); - } - - /** - * Register an autoloading callabale for annotations, much like spl_autoload_register(). - * - * NOTE: These class loaders HAVE to be silent when a class was not found! - * IMPORTANT: Loaders have to return true if they loaded a class that could contain the searched annotation class. - * - * @param callabale $callabale - */ - static public function registerLoader($callabale) - { - if (!is_callable($callabale)) { - throw new \InvalidArgumentException("A callable is expected in AnnotationRegistry::registerLoader()."); - } - self::$loaders[] = $callabale; - } - - /** - * Autoload an annotation class silently. - * - * @param string $class - * @return void - */ - static public function loadAnnotationClass($class) - { - foreach (self::$autoloadNamespaces AS $namespace => $dirs) { - if (strpos($class, $namespace) === 0) { - $file = str_replace("\\", DIRECTORY_SEPARATOR, $class) . ".php"; - if ($dirs === null) { - if ($path = stream_resolve_include_path($file)) { - require $path; - return true; - } - } else { - foreach((array)$dirs AS $dir) { - if (file_exists($dir . DIRECTORY_SEPARATOR . $file)) { - require $dir . DIRECTORY_SEPARATOR . $file; - return true; - } - } - } - } - } - - foreach (self::$loaders AS $loader) { - if (call_user_func($loader, $class) === true) { - return true; - } - } - return false; - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/CachedReader.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/CachedReader.php deleted file mode 100644 index 6ea47c6..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/CachedReader.php +++ /dev/null @@ -1,179 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -use Doctrine\Common\Cache\Cache; - -/** - * A cache aware annotation reader. - * - * @author Johannes M. Schmitt - * @author Benjamin Eberlei - */ -final class CachedReader implements Reader -{ - private static $CACHE_SALT = '@[Annot]'; - - /** - * @var Reader - */ - private $delegate; - - /** - * @var Cache - */ - private $cache; - - /** - * @var boolean - */ - private $debug; - - /** - * @var array - */ - private $loadedAnnotations; - - /** - * @param Reader $reader - * @param Cache $cache - */ - public function __construct(Reader $reader, Cache $cache, $debug = false) - { - $this->delegate = $reader; - $this->cache = $cache; - $this->debug = $debug; - } - - public function getClassAnnotations(\ReflectionClass $class) - { - $cacheKey = $class->getName() . self::$CACHE_SALT; - - if (isset($this->loadedAnnotations[$cacheKey])) { - return $this->loadedAnnotations[$cacheKey]; - } - - // Attempt to grab data from cache - if (($data = $this->cache->fetch($cacheKey)) !== false) { - if (!$this->debug || $this->isCacheFresh($cacheKey, $class)) { - return $data; - } - } - - $annots = $this->delegate->getClassAnnotations($class); - $this->cache->save($cacheKey, $annots); - $this->cache->save('[C]'.$cacheKey, time()); - - return $this->loadedAnnotations[$cacheKey] = $annots; - } - - public function getClassAnnotation(\ReflectionClass $class, $annotationName) - { - foreach ($this->getClassAnnotations($class) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - public function getPropertyAnnotations(\ReflectionProperty $property) - { - $class = $property->getDeclaringClass(); - $cacheKey = $class->getName().'$'.$property->getName().self::$CACHE_SALT; - - if (isset($this->loadedAnnotations[$cacheKey])) { - return $this->loadedAnnotations[$cacheKey]; - } - - // Attempt to grab data from cache - if (($data = $this->cache->fetch($cacheKey)) !== false) { - if (!$this->debug || $this->isCacheFresh($cacheKey, $class)) { - return $data; - } - } - - $annots = $this->delegate->getPropertyAnnotations($property); - $this->cache->save($cacheKey, $annots); - $this->cache->save('[C]'.$cacheKey, time()); - - return $this->loadedAnnotations[$cacheKey] = $annots; - } - - public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName) - { - foreach ($this->getPropertyAnnotations($property) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - public function getMethodAnnotations(\ReflectionMethod $method) - { - $class = $method->getDeclaringClass(); - $cacheKey = $class->getName().'#'.$method->getName().self::$CACHE_SALT; - - if (isset($this->loadedAnnotations[$cacheKey])) { - return $this->loadedAnnotations[$cacheKey]; - } - - // Attempt to grab data from cache - if (($data = $this->cache->fetch($cacheKey)) !== false) { - if (!$this->debug || $this->isCacheFresh($cacheKey, $class)) { - return $data; - } - } - - $annots = $this->delegate->getMethodAnnotations($method); - $this->cache->save($cacheKey, $annots); - $this->cache->save('[C]'.$cacheKey, time()); - - return $this->loadedAnnotations[$cacheKey] = $annots; - } - - public function getMethodAnnotation(\ReflectionMethod $method, $annotationName) - { - foreach ($this->getMethodAnnotations($method) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - public function clearLoadedAnnotations() - { - $this->loadedAnnotations = array(); - } - - private function isCacheFresh($cacheKey, \ReflectionClass $class) - { - if (false === $filename = $class->getFilename()) { - return true; - } - - return $this->cache->fetch('[C]'.$cacheKey) >= filemtime($filename); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/DocLexer.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/DocLexer.php deleted file mode 100644 index c6223e3..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/DocLexer.php +++ /dev/null @@ -1,140 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -use Doctrine\Common\Lexer; - -/** - * Simple lexer for docblock annotations. - * - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Johannes M. Schmitt - */ -final class DocLexer extends Lexer -{ - const T_NONE = 1; - const T_IDENTIFIER = 2; - const T_INTEGER = 3; - const T_STRING = 4; - const T_FLOAT = 5; - - const T_AT = 101; - const T_CLOSE_CURLY_BRACES = 102; - const T_CLOSE_PARENTHESIS = 103; - const T_COMMA = 104; - const T_EQUALS = 105; - const T_FALSE = 106; - const T_NAMESPACE_SEPARATOR = 107; - const T_OPEN_CURLY_BRACES = 108; - const T_OPEN_PARENTHESIS = 109; - const T_TRUE = 110; - const T_NULL = 111; - const T_COLON = 112; - - /** - * @inheritdoc - */ - protected function getCatchablePatterns() - { - return array( - '[a-z_][a-z0-9_:]*', - '(?:[+-]?[0-9]+(?:[\.][0-9]+)*)(?:[eE][+-]?[0-9]+)?', - '"(?:[^"]|"")*"', - ); - } - - /** - * @inheritdoc - */ - protected function getNonCatchablePatterns() - { - return array('\s+', '\*+', '(.)'); - } - - /** - * @inheritdoc - */ - protected function getType(&$value) - { - $type = self::T_NONE; - - // Checking numeric value - if (is_numeric($value)) { - return (strpos($value, '.') !== false || stripos($value, 'e') !== false) - ? self::T_FLOAT : self::T_INTEGER; - } - - if ($value[0] === '"') { - $value = str_replace('""', '"', substr($value, 1, strlen($value) - 2)); - - return self::T_STRING; - } else { - switch (strtolower($value)) { - case '@': - return self::T_AT; - - case ',': - return self::T_COMMA; - - case '(': - return self::T_OPEN_PARENTHESIS; - - case ')': - return self::T_CLOSE_PARENTHESIS; - - case '{': - return self::T_OPEN_CURLY_BRACES; - - case '}': - return self::T_CLOSE_CURLY_BRACES; - - case '=': - return self::T_EQUALS; - - case '\\': - return self::T_NAMESPACE_SEPARATOR; - - case 'true': - return self::T_TRUE; - - case 'false': - return self::T_FALSE; - - case 'null': - return self::T_NULL; - - case ':': - return self::T_COLON; - - default: - if (ctype_alpha($value[0]) || $value[0] === '_') { - return self::T_IDENTIFIER; - } - - break; - } - } - - return $type; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/DocParser.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/DocParser.php deleted file mode 100644 index 9d16b17..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/DocParser.php +++ /dev/null @@ -1,891 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -use Closure; -use ReflectionClass; -use Doctrine\Common\Annotations\Annotation\Target; -use Doctrine\Common\Annotations\Annotation\Attribute; -use Doctrine\Common\Annotations\Annotation\Attributes; - -/** - * A parser for docblock annotations. - * - * It is strongly discouraged to change the default annotation parsing process. - * - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Johannes M. Schmitt - * @author Fabio B. Silva - */ -final class DocParser -{ - /** - * An array of all valid tokens for a class name. - * - * @var array - */ - private static $classIdentifiers = array(DocLexer::T_IDENTIFIER, DocLexer::T_TRUE, DocLexer::T_FALSE, DocLexer::T_NULL); - - /** - * The lexer. - * - * @var Doctrine\Common\Annotations\DocLexer - */ - private $lexer; - - /** - * Current target context - * - * @var string - */ - private $target; - - /** - * Doc Parser used to collect annotation target - * - * @var Doctrine\Common\Annotations\DocParser - */ - private static $metadataParser; - - /** - * Flag to control if the current annotation is nested or not. - * - * @var boolean - */ - private $isNestedAnnotation = false; - - /** - * Hashmap containing all use-statements that are to be used when parsing - * the given doc block. - * - * @var array - */ - private $imports = array(); - - /** - * This hashmap is used internally to cache results of class_exists() - * look-ups. - * - * @var array - */ - private $classExists = array(); - - /** - * Whether annotations that have not been imported should be ignored. - * - * @var boolean - */ - private $ignoreNotImportedAnnotations = false; - - /** - * An array of default namespaces if operating in simple mode. - * - * @var array - */ - private $namespaces = array(); - - /** - * A list with annotations that are not causing exceptions when not resolved to an annotation class. - * - * The names must be the raw names as used in the class, not the fully qualified - * class names. - * - * @var array - */ - private $ignoredAnnotationNames = array(); - - /** - * @var string - */ - private $context = ''; - - /** - * Hash-map for caching annotation metadata - * @var array - */ - private static $annotationMetadata = array( - 'Doctrine\Common\Annotations\Annotation\Target' => array( - 'is_annotation' => true, - 'has_constructor' => true, - 'properties' => array(), - 'targets_literal' => 'ANNOTATION_CLASS', - 'targets' => Target::TARGET_CLASS, - 'default_property' => 'value', - 'attribute_types' => array( - 'value' => array( - 'required' => false, - 'type' =>'array', - 'array_type'=>'string', - 'value' =>'array' - ) - ), - ), - 'Doctrine\Common\Annotations\Annotation\Attribute' => array( - 'is_annotation' => true, - 'has_constructor' => false, - 'targets_literal' => 'ANNOTATION_ANNOTATION', - 'targets' => Target::TARGET_ANNOTATION, - 'default_property' => 'name', - 'properties' => array( - 'name' => 'name', - 'type' => 'type', - 'required' => 'required' - ), - 'attribute_types' => array( - 'value' => array( - 'required' => true, - 'type' =>'string', - 'value' =>'string' - ), - 'type' => array( - 'required' =>true, - 'type' =>'string', - 'value' =>'string' - ), - 'required' => array( - 'required' =>false, - 'type' =>'boolean', - 'value' =>'boolean' - ) - ), - ), - 'Doctrine\Common\Annotations\Annotation\Attributes' => array( - 'is_annotation' => true, - 'has_constructor' => false, - 'targets_literal' => 'ANNOTATION_CLASS', - 'targets' => Target::TARGET_CLASS, - 'default_property' => 'value', - 'properties' => array( - 'value' => 'value' - ), - 'attribute_types' => array( - 'value' => array( - 'type' =>'array', - 'required' =>true, - 'array_type'=>'Doctrine\Common\Annotations\Annotation\Attribute', - 'value' =>'array' - ) - ), - ), - ); - - /** - * Hash-map for handle types declaration - * - * @var array - */ - private static $typeMap = array( - 'float' => 'double', - 'bool' => 'boolean', - // allow uppercase Boolean in honor of George Boole - 'Boolean' => 'boolean', - 'int' => 'integer', - ); - - /** - * Constructs a new DocParser. - */ - public function __construct() - { - $this->lexer = new DocLexer; - } - - /** - * Sets the annotation names that are ignored during the parsing process. - * - * The names are supposed to be the raw names as used in the class, not the - * fully qualified class names. - * - * @param array $names - */ - public function setIgnoredAnnotationNames(array $names) - { - $this->ignoredAnnotationNames = $names; - } - - public function setIgnoreNotImportedAnnotations($bool) - { - $this->ignoreNotImportedAnnotations = (Boolean) $bool; - } - - /** - * Sets the default namespaces. - * @param array $namespaces - */ - public function addNamespace($namespace) - { - if ($this->imports) { - throw new \RuntimeException('You must either use addNamespace(), or setImports(), but not both.'); - } - $this->namespaces[] = $namespace; - } - - public function setImports(array $imports) - { - if ($this->namespaces) { - throw new \RuntimeException('You must either use addNamespace(), or setImports(), but not both.'); - } - $this->imports = $imports; - } - - /** - * Sets current target context as bitmask. - * - * @param integer $target - */ - public function setTarget($target) - { - $this->target = $target; - } - - /** - * Parses the given docblock string for annotations. - * - * @param string $input The docblock string to parse. - * @param string $context The parsing context. - * @return array Array of annotations. If no annotations are found, an empty array is returned. - */ - public function parse($input, $context = '') - { - if (false === $pos = strpos($input, '@')) { - return array(); - } - - // also parse whatever character is before the @ - if ($pos > 0) { - $pos -= 1; - } - - $this->context = $context; - $this->lexer->setInput(trim(substr($input, $pos), '* /')); - $this->lexer->moveNext(); - - return $this->Annotations(); - } - - /** - * Attempts to match the given token with the current lookahead token. - * If they match, updates the lookahead token; otherwise raises a syntax error. - * - * @param int Token type. - * @return bool True if tokens match; false otherwise. - */ - private function match($token) - { - if ( ! $this->lexer->isNextToken($token) ) { - $this->syntaxError($this->lexer->getLiteral($token)); - } - - return $this->lexer->moveNext(); - } - - /** - * Attempts to match the current lookahead token with any of the given tokens. - * - * If any of them matches, this method updates the lookahead token; otherwise - * a syntax error is raised. - * - * @param array $tokens - * @return bool - */ - private function matchAny(array $tokens) - { - if ( ! $this->lexer->isNextTokenAny($tokens)) { - $this->syntaxError(implode(' or ', array_map(array($this->lexer, 'getLiteral'), $tokens))); - } - - return $this->lexer->moveNext(); - } - - /** - * Generates a new syntax error. - * - * @param string $expected Expected string. - * @param array $token Optional token. - * @throws SyntaxException - */ - private function syntaxError($expected, $token = null) - { - if ($token === null) { - $token = $this->lexer->lookahead; - } - - $message = "Expected {$expected}, got "; - - if ($this->lexer->lookahead === null) { - $message .= 'end of string'; - } else { - $message .= "'{$token['value']}' at position {$token['position']}"; - } - - if (strlen($this->context)) { - $message .= ' in ' . $this->context; - } - - $message .= '.'; - - throw AnnotationException::syntaxError($message); - } - - /** - * Attempt to check if a class exists or not. This never goes through the PHP autoloading mechanism - * but uses the {@link AnnotationRegistry} to load classes. - * - * @param string $fqcn - * @return boolean - */ - private function classExists($fqcn) - { - if (isset($this->classExists[$fqcn])) { - return $this->classExists[$fqcn]; - } - - // first check if the class already exists, maybe loaded through another AnnotationReader - if (class_exists($fqcn, false)) { - return $this->classExists[$fqcn] = true; - } - - // final check, does this class exist? - return $this->classExists[$fqcn] = AnnotationRegistry::loadAnnotationClass($fqcn); - } - - /** - * Collects parsing metadata for a given annotation class - * - * @param string $name The annotation name - */ - private function collectAnnotationMetadata($name) - { - if (self::$metadataParser == null){ - self::$metadataParser = new self(); - self::$metadataParser->setTarget(Target::TARGET_CLASS); - self::$metadataParser->setIgnoreNotImportedAnnotations(true); - self::$metadataParser->setImports(array( - 'target' => 'Doctrine\Common\Annotations\Annotation\Target', - 'attribute' => 'Doctrine\Common\Annotations\Annotation\Attribute', - 'attributes' => 'Doctrine\Common\Annotations\Annotation\Attributes' - )); - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Target.php'); - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Attribute.php'); - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Attributes.php'); - } - - $class = new \ReflectionClass($name); - $docComment = $class->getDocComment(); - - // Sets default values for annotation metadata - $metadata = array( - 'default_property' => null, - 'has_constructor' => (null !== $constructor = $class->getConstructor()) && $constructor->getNumberOfParameters() > 0, - 'properties' => array(), - 'property_types' => array(), - 'attribute_types' => array(), - 'targets_literal' => null, - 'targets' => Target::TARGET_ALL, - 'is_annotation' => false !== strpos($docComment, '@Annotation'), - ); - - // verify that the class is really meant to be an annotation - if ($metadata['is_annotation']) { - foreach (self::$metadataParser->parse($docComment, 'class @' . $name) as $annotation) { - if ($annotation instanceof Target) { - $metadata['targets'] = $annotation->targets; - $metadata['targets_literal'] = $annotation->literal; - - } elseif ($annotation instanceof Attributes) { - foreach ($annotation->value as $attrib) { - // handle internal type declaration - $type = isset(self::$typeMap[$attrib->type]) ? self::$typeMap[$attrib->type] : $attrib->type; - - // handle the case if the property type is mixed - if ('mixed' !== $type) { - // Checks if the property has array - if (false !== $pos = strpos($type, '<')) { - $arrayType = substr($type, $pos+1, -1); - $type = 'array'; - - if (isset(self::$typeMap[$arrayType])) { - $arrayType = self::$typeMap[$arrayType]; - } - - $metadata['attribute_types'][$attrib->name]['array_type'] = $arrayType; - } - - $metadata['attribute_types'][$attrib->name]['type'] = $type; - $metadata['attribute_types'][$attrib->name]['value'] = $attrib->type; - $metadata['attribute_types'][$attrib->name]['required'] = $attrib->required; - } - } - } - } - - // if not has a constructor will inject values into public properties - if (false === $metadata['has_constructor']) { - // collect all public properties - foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) { - $metadata['properties'][$property->name] = $property->name; - - // checks if the property has @var annotation - if ((false !== $propertyComment = $property->getDocComment()) - && false !== strpos($propertyComment, '@var') - && preg_match('/@var\s+([^\s]+)/',$propertyComment, $matches)) { - // literal type declaration - $value = $matches[1]; - - // handle internal type declaration - $type = isset(self::$typeMap[$value]) ? self::$typeMap[$value] : $value; - - // handle the case if the property type is mixed - if ('mixed' !== $type) { - // Checks if the property has @var array annotation - if (false !== $pos = strpos($type, '<')) { - $arrayType = substr($type, $pos+1, -1); - $type = 'array'; - - if (isset(self::$typeMap[$arrayType])) { - $arrayType = self::$typeMap[$arrayType]; - } - - $metadata['attribute_types'][$property->name]['array_type'] = $arrayType; - } - - $metadata['attribute_types'][$property->name]['type'] = $type; - $metadata['attribute_types'][$property->name]['value'] = $value; - $metadata['attribute_types'][$property->name]['required'] = false !== strpos($propertyComment, '@Required'); - } - } - } - - // choose the first property as default property - $metadata['default_property'] = reset($metadata['properties']); - } - } - - self::$annotationMetadata[$name] = $metadata; - } - - /** - * Annotations ::= Annotation {[ "*" ]* [Annotation]}* - * - * @return array - */ - private function Annotations() - { - $annotations = array(); - - while (null !== $this->lexer->lookahead) { - if (DocLexer::T_AT !== $this->lexer->lookahead['type']) { - $this->lexer->moveNext(); - continue; - } - - // make sure the @ is preceded by non-catchable pattern - if (null !== $this->lexer->token && $this->lexer->lookahead['position'] === $this->lexer->token['position'] + strlen($this->lexer->token['value'])) { - $this->lexer->moveNext(); - continue; - } - - // make sure the @ is followed by either a namespace separator, or - // an identifier token - if ((null === $peek = $this->lexer->glimpse()) - || (DocLexer::T_NAMESPACE_SEPARATOR !== $peek['type'] && !in_array($peek['type'], self::$classIdentifiers, true)) - || $peek['position'] !== $this->lexer->lookahead['position'] + 1) { - $this->lexer->moveNext(); - continue; - } - - $this->isNestedAnnotation = false; - if (false !== $annot = $this->Annotation()) { - $annotations[] = $annot; - } - } - - return $annotations; - } - - /** - * Annotation ::= "@" AnnotationName ["(" [Values] ")"] - * AnnotationName ::= QualifiedName | SimpleName - * QualifiedName ::= NameSpacePart "\" {NameSpacePart "\"}* SimpleName - * NameSpacePart ::= identifier | null | false | true - * SimpleName ::= identifier | null | false | true - * - * @return mixed False if it is not a valid annotation. - */ - private function Annotation() - { - $this->match(DocLexer::T_AT); - - // check if we have an annotation - if ($this->lexer->isNextTokenAny(self::$classIdentifiers)) { - $this->lexer->moveNext(); - $name = $this->lexer->token['value']; - } else if ($this->lexer->isNextToken(DocLexer::T_NAMESPACE_SEPARATOR)) { - $name = ''; - } else { - $this->syntaxError('namespace separator or identifier'); - } - - while ($this->lexer->lookahead['position'] === $this->lexer->token['position'] + strlen($this->lexer->token['value']) && $this->lexer->isNextToken(DocLexer::T_NAMESPACE_SEPARATOR)) { - $this->match(DocLexer::T_NAMESPACE_SEPARATOR); - $this->matchAny(self::$classIdentifiers); - $name .= '\\'.$this->lexer->token['value']; - } - - // only process names which are not fully qualified, yet - // fully qualified names must start with a \ - $originalName = $name; - if ('\\' !== $name[0]) { - $alias = (false === $pos = strpos($name, '\\'))? $name : substr($name, 0, $pos); - - $found = false; - if ($this->namespaces) { - foreach ($this->namespaces as $namespace) { - if ($this->classExists($namespace.'\\'.$name)) { - $name = $namespace.'\\'.$name; - $found = true; - break; - } - } - } elseif (isset($this->imports[$loweredAlias = strtolower($alias)])) { - if (false !== $pos) { - $name = $this->imports[$loweredAlias].substr($name, $pos); - } else { - $name = $this->imports[$loweredAlias]; - } - $found = true; - } elseif (isset($this->imports['__NAMESPACE__']) && $this->classExists($this->imports['__NAMESPACE__'].'\\'.$name)) { - $name = $this->imports['__NAMESPACE__'].'\\'.$name; - $found = true; - } elseif ($this->classExists($name)) { - $found = true; - } - - if (!$found) { - if ($this->ignoreNotImportedAnnotations || isset($this->ignoredAnnotationNames[$name])) { - return false; - } - - throw AnnotationException::semanticalError(sprintf('The annotation "@%s" in %s was never imported. Did you maybe forget to add a "use" statement for this annotation?', $name, $this->context)); - } - } - - if (!$this->classExists($name)) { - throw AnnotationException::semanticalError(sprintf('The annotation "@%s" in %s does not exist, or could not be auto-loaded.', $name, $this->context)); - } - - // at this point, $name contains the fully qualified class name of the - // annotation, and it is also guaranteed that this class exists, and - // that it is loaded - - - // collects the metadata annotation only if there is not yet - if (!isset(self::$annotationMetadata[$name])) { - $this->collectAnnotationMetadata($name); - } - - // verify that the class is really meant to be an annotation and not just any ordinary class - if (self::$annotationMetadata[$name]['is_annotation'] === false) { - if (isset($this->ignoredAnnotationNames[$originalName])) { - return false; - } - - throw AnnotationException::semanticalError(sprintf('The class "%s" is not annotated with @Annotation. Are you sure this class can be used as annotation? If so, then you need to add @Annotation to the _class_ doc comment of "%s". If it is indeed no annotation, then you need to add @IgnoreAnnotation("%s") to the _class_ doc comment of %s.', $name, $name, $originalName, $this->context)); - } - - //if target is nested annotation - $target = $this->isNestedAnnotation ? Target::TARGET_ANNOTATION : $this->target; - - // Next will be nested - $this->isNestedAnnotation = true; - - //if annotation does not support current target - if (0 === (self::$annotationMetadata[$name]['targets'] & $target) && $target) { - throw AnnotationException::semanticalError( - sprintf('Annotation @%s is not allowed to be declared on %s. You may only use this annotation on these code elements: %s.', - $originalName, $this->context, self::$annotationMetadata[$name]['targets_literal']) - ); - } - - $values = array(); - if ($this->lexer->isNextToken(DocLexer::T_OPEN_PARENTHESIS)) { - $this->match(DocLexer::T_OPEN_PARENTHESIS); - - if ( ! $this->lexer->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) { - $values = $this->Values(); - } - - $this->match(DocLexer::T_CLOSE_PARENTHESIS); - } - - // checks all declared attributes - foreach (self::$annotationMetadata[$name]['attribute_types'] as $property => $type) { - if ($property === self::$annotationMetadata[$name]['default_property'] - && !isset($values[$property]) && isset($values['value'])) { - $property = 'value'; - } - - // handle a not given attribute or null value - if (!isset($values[$property])) { - if ($type['required']) { - throw AnnotationException::requiredError($property, $originalName, $this->context, 'a(n) '.$type['value']); - } - - continue; - } - - if ($type['type'] === 'array') { - // handle the case of a single value - if (!is_array($values[$property])) { - $values[$property] = array($values[$property]); - } - - // checks if the attribute has array type declaration, such as "array" - if (isset($type['array_type'])) { - foreach ($values[$property] as $item) { - if (gettype($item) !== $type['array_type'] && !$item instanceof $type['array_type']) { - throw AnnotationException::typeError($property, $originalName, $this->context, 'either a(n) '.$type['array_type'].', or an array of '.$type['array_type'].'s', $item); - } - } - } - } elseif (gettype($values[$property]) !== $type['type'] && !$values[$property] instanceof $type['type']) { - throw AnnotationException::typeError($property, $originalName, $this->context, 'a(n) '.$type['value'], $values[$property]); - } - } - - // check if the annotation expects values via the constructor, - // or directly injected into public properties - if (self::$annotationMetadata[$name]['has_constructor'] === true) { - return new $name($values); - } - - $instance = new $name(); - foreach ($values as $property => $value) { - if (!isset(self::$annotationMetadata[$name]['properties'][$property])) { - if ('value' !== $property) { - throw AnnotationException::creationError(sprintf('The annotation @%s declared on %s does not have a property named "%s". Available properties: %s', $originalName, $this->context, $property, implode(', ', self::$annotationMetadata[$name]['properties']))); - } - - // handle the case if the property has no annotations - if (!$property = self::$annotationMetadata[$name]['default_property']) { - throw AnnotationException::creationError(sprintf('The annotation @%s declared on %s does not accept any values, but got %s.', $originalName, $this->context, json_encode($values))); - } - } - - $instance->{$property} = $value; - } - - return $instance; - } - - /** - * Values ::= Array | Value {"," Value}* - * - * @return array - */ - private function Values() - { - $values = array(); - - // Handle the case of a single array as value, i.e. @Foo({....}) - if ($this->lexer->isNextToken(DocLexer::T_OPEN_CURLY_BRACES)) { - $values['value'] = $this->Value(); - return $values; - } - - $values[] = $this->Value(); - - while ($this->lexer->isNextToken(DocLexer::T_COMMA)) { - $this->match(DocLexer::T_COMMA); - $token = $this->lexer->lookahead; - $value = $this->Value(); - - if ( ! is_object($value) && ! is_array($value)) { - $this->syntaxError('Value', $token); - } - - $values[] = $value; - } - - foreach ($values as $k => $value) { - if (is_object($value) && $value instanceof \stdClass) { - $values[$value->name] = $value->value; - } else if ( ! isset($values['value'])){ - $values['value'] = $value; - } else { - if ( ! is_array($values['value'])) { - $values['value'] = array($values['value']); - } - - $values['value'][] = $value; - } - - unset($values[$k]); - } - - return $values; - } - - /** - * Value ::= PlainValue | FieldAssignment - * - * @return mixed - */ - private function Value() - { - $peek = $this->lexer->glimpse(); - - if (DocLexer::T_EQUALS === $peek['type']) { - return $this->FieldAssignment(); - } - - return $this->PlainValue(); - } - - /** - * PlainValue ::= integer | string | float | boolean | Array | Annotation - * - * @return mixed - */ - private function PlainValue() - { - if ($this->lexer->isNextToken(DocLexer::T_OPEN_CURLY_BRACES)) { - return $this->Arrayx(); - } - - if ($this->lexer->isNextToken(DocLexer::T_AT)) { - return $this->Annotation(); - } - - switch ($this->lexer->lookahead['type']) { - case DocLexer::T_STRING: - $this->match(DocLexer::T_STRING); - return $this->lexer->token['value']; - - case DocLexer::T_INTEGER: - $this->match(DocLexer::T_INTEGER); - return (int)$this->lexer->token['value']; - - case DocLexer::T_FLOAT: - $this->match(DocLexer::T_FLOAT); - return (float)$this->lexer->token['value']; - - case DocLexer::T_TRUE: - $this->match(DocLexer::T_TRUE); - return true; - - case DocLexer::T_FALSE: - $this->match(DocLexer::T_FALSE); - return false; - - case DocLexer::T_NULL: - $this->match(DocLexer::T_NULL); - return null; - - default: - $this->syntaxError('PlainValue'); - } - } - - /** - * FieldAssignment ::= FieldName "=" PlainValue - * FieldName ::= identifier - * - * @return array - */ - private function FieldAssignment() - { - $this->match(DocLexer::T_IDENTIFIER); - $fieldName = $this->lexer->token['value']; - - $this->match(DocLexer::T_EQUALS); - - $item = new \stdClass(); - $item->name = $fieldName; - $item->value = $this->PlainValue(); - - return $item; - } - - /** - * Array ::= "{" ArrayEntry {"," ArrayEntry}* [","] "}" - * - * @return array - */ - private function Arrayx() - { - $array = $values = array(); - - $this->match(DocLexer::T_OPEN_CURLY_BRACES); - $values[] = $this->ArrayEntry(); - - while ($this->lexer->isNextToken(DocLexer::T_COMMA)) { - $this->match(DocLexer::T_COMMA); - - // optional trailing comma - if ($this->lexer->isNextToken(DocLexer::T_CLOSE_CURLY_BRACES)) { - break; - } - - $values[] = $this->ArrayEntry(); - } - - $this->match(DocLexer::T_CLOSE_CURLY_BRACES); - - foreach ($values as $value) { - list ($key, $val) = $value; - - if ($key !== null) { - $array[$key] = $val; - } else { - $array[] = $val; - } - } - - return $array; - } - - /** - * ArrayEntry ::= Value | KeyValuePair - * KeyValuePair ::= Key ("=" | ":") PlainValue - * Key ::= string | integer - * - * @return array - */ - private function ArrayEntry() - { - $peek = $this->lexer->glimpse(); - - if (DocLexer::T_EQUALS === $peek['type'] - || DocLexer::T_COLON === $peek['type']) { - $this->matchAny(array(DocLexer::T_INTEGER, DocLexer::T_STRING)); - - $key = $this->lexer->token['value']; - $this->matchAny(array(DocLexer::T_EQUALS, DocLexer::T_COLON)); - - return array($key, $this->PlainValue()); - } - - return array(null, $this->Value()); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/FileCacheReader.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/FileCacheReader.php deleted file mode 100644 index 4a42b58..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/FileCacheReader.php +++ /dev/null @@ -1,209 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - - -/** - * File cache reader for annotations. - * - * @author Johannes M. Schmitt - * @author Benjamin Eberlei - */ -class FileCacheReader implements Reader -{ - /** - * @var Reader - */ - private $reader; - private $dir; - private $debug; - private $loadedAnnotations = array(); - - public function __construct(Reader $reader, $cacheDir, $debug = false) - { - $this->reader = $reader; - if (!is_dir($cacheDir) && !@mkdir($cacheDir, 0777, true)) { - throw new \InvalidArgumentException(sprintf('The directory "%s" does not exist and could not be created.', $cacheDir)); - } - if (!is_writable($cacheDir)) { - throw new \InvalidArgumentException(sprintf('The directory "%s" is not writable. Both, the webserver and the console user need access. You can manage access rights for multiple users with "chmod +a". If your system does not support this, check out the acl package.', $cacheDir)); - } - - $this->dir = rtrim($cacheDir, '\\/'); - $this->debug = $debug; - } - - public function getClassAnnotations(\ReflectionClass $class) - { - $key = $class->getName(); - - if (isset($this->loadedAnnotations[$key])) { - return $this->loadedAnnotations[$key]; - } - - $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php'; - if (!file_exists($path)) { - $annot = $this->reader->getClassAnnotations($class); - $this->saveCacheFile($path, $annot); - return $this->loadedAnnotations[$key] = $annot; - } - - if ($this->debug - && (false !== $filename = $class->getFilename()) - && filemtime($path) < filemtime($filename)) { - @unlink($path); - - $annot = $this->reader->getClassAnnotations($class); - $this->saveCacheFile($path, $annot); - return $this->loadedAnnotations[$key] = $annot; - } - - return $this->loadedAnnotations[$key] = include $path; - } - - public function getPropertyAnnotations(\ReflectionProperty $property) - { - $class = $property->getDeclaringClass(); - $key = $class->getName().'$'.$property->getName(); - - if (isset($this->loadedAnnotations[$key])) { - return $this->loadedAnnotations[$key]; - } - - $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php'; - if (!file_exists($path)) { - $annot = $this->reader->getPropertyAnnotations($property); - $this->saveCacheFile($path, $annot); - return $this->loadedAnnotations[$key] = $annot; - } - - if ($this->debug - && (false !== $filename = $class->getFilename()) - && filemtime($path) < filemtime($filename)) { - unlink($path); - - $annot = $this->reader->getPropertyAnnotations($property); - $this->saveCacheFile($path, $annot); - return $this->loadedAnnotations[$key] = $annot; - } - - return $this->loadedAnnotations[$key] = include $path; - } - - public function getMethodAnnotations(\ReflectionMethod $method) - { - $class = $method->getDeclaringClass(); - $key = $class->getName().'#'.$method->getName(); - - if (isset($this->loadedAnnotations[$key])) { - return $this->loadedAnnotations[$key]; - } - - $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php'; - if (!file_exists($path)) { - $annot = $this->reader->getMethodAnnotations($method); - $this->saveCacheFile($path, $annot); - return $this->loadedAnnotations[$key] = $annot; - } - - if ($this->debug - && (false !== $filename = $class->getFilename()) - && filemtime($path) < filemtime($filename)) { - unlink($path); - - $annot = $this->reader->getMethodAnnotations($method); - $this->saveCacheFile($path, $annot); - return $this->loadedAnnotations[$key] = $annot; - } - - return $this->loadedAnnotations[$key] = include $path; - } - - private function saveCacheFile($path, $data) - { - file_put_contents($path, 'getClassAnnotations($class); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * Gets a method annotation. - * - * @param ReflectionMethod $method - * @param string $annotationName The name of the annotation. - * @return The Annotation or NULL, if the requested annotation does not exist. - */ - public function getMethodAnnotation(\ReflectionMethod $method, $annotationName) - { - $annotations = $this->getMethodAnnotations($method); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * Gets a property annotation. - * - * @param ReflectionProperty $property - * @param string $annotationName The name of the annotation. - * @return The Annotation or NULL, if the requested annotation does not exist. - */ - public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName) - { - $annotations = $this->getPropertyAnnotations($property); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - public function clearLoadedAnnotations() - { - $this->loadedAnnotations = array(); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/IndexedReader.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/IndexedReader.php deleted file mode 100644 index 1eea492..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/IndexedReader.php +++ /dev/null @@ -1,94 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -use Doctrine\Common\Annotations\Reader; - -/** - * Allows the reader to be used in-place of Doctrine's reader. - * - * @author Johannes M. Schmitt - */ -class IndexedReader implements Reader -{ - private $delegate; - - public function __construct(Reader $reader) - { - $this->delegate = $reader; - } - - public function getClassAnnotations(\ReflectionClass $class) - { - $annotations = array(); - foreach ($this->delegate->getClassAnnotations($class) as $annot) { - $annotations[get_class($annot)] = $annot; - } - - return $annotations; - } - - public function getClassAnnotation(\ReflectionClass $class, $annotation) - { - return $this->delegate->getClassAnnotation($class, $annotation); - } - - public function getMethodAnnotations(\ReflectionMethod $method) - { - $annotations = array(); - foreach ($this->delegate->getMethodAnnotations($method) as $annot) { - $annotations[get_class($annot)] = $annot; - } - - return $annotations; - } - - public function getMethodAnnotation(\ReflectionMethod $method, $annotation) - { - return $this->delegate->getMethodAnnotation($method, $annotation); - } - - public function getPropertyAnnotations(\ReflectionProperty $property) - { - $annotations = array(); - foreach ($this->delegate->getPropertyAnnotations($property) as $annot) { - $annotations[get_class($annot)] = $annot; - } - - return $annotations; - } - - public function getPropertyAnnotation(\ReflectionProperty $property, $annotation) - { - return $this->delegate->getPropertyAnnotation($property, $annotation); - } - - /** - * Proxy all methods to the delegate. - * - * @param type $method - * @param type $args - * @return type - */ - public function __call($method, $args) - { - return call_user_func_array(array($this->delegate, $method), $args); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/PhpParser.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/PhpParser.php deleted file mode 100644 index a14f8f5..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/PhpParser.php +++ /dev/null @@ -1,203 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -use SplFileObject; - -/** - * Parses a file for namespaces/use/class declarations. - * - * @author Fabien Potencier - * @author Christian Kaps - */ -final class PhpParser -{ - /** - * The token list. - * - * @var array - */ - private $tokens; - - /** - * The number of tokens. - * - * @var int - */ - private $numTokens = 0; - - /** - * The current array pointer. - * - * @var int - */ - private $pointer = 0; - - /** - * Parses a class. - * - * @param \ReflectionClass $class A ReflectionClass object. - * @return array A list with use statements in the form (Alias => FQN). - */ - public function parseClass(\ReflectionClass $class) - { - if (false === $filename = $class->getFilename()) { - return array(); - } - - $content = $this->getFileContent($filename, $class->getStartLine()); - $namespace = str_replace('\\', '\\\\', $class->getNamespaceName()); - $content = preg_replace('/^.*?(\bnamespace\s+' . $namespace . '\s*[;{].*)$/s', '\\1', $content); - $this->tokens = token_get_all('numTokens = count($this->tokens); - $this->pointer = 0; - - $statements = $this->parseUseStatements($class->getNamespaceName()); - - return $statements; - } - - /** - * Get the content of the file right up to the given line number. - * - * @param string $filename The name of the file to load. - * @param int $lineNumber The number of lines to read from file. - * @return string The content of the file. - */ - private function getFileContent($filename, $lineNumber) - { - $content = ''; - $lineCnt = 0; - $file = new SplFileObject($filename); - while(!$file->eof()) { - if ($lineCnt++ == $lineNumber) { - break; - } - - $content .= $file->fgets(); - } - - return $content; - } - - /** - * Gets the next non whitespace and non comment token. - * - * @return array The token if exists, null otherwise. - */ - private function next() - { - for ($i = $this->pointer; $i < $this->numTokens; $i++) { - $this->pointer++; - if ($this->tokens[$i][0] === T_WHITESPACE || - $this->tokens[$i][0] === T_COMMENT || - $this->tokens[$i][0] === T_DOC_COMMENT) { - - continue; - } - - return $this->tokens[$i]; - } - - return null; - } - - /** - * Get all use statements. - * - * @param string $namespaceName The namespace name of the reflected class. - * @return array A list with all found use statements. - */ - private function parseUseStatements($namespaceName) - { - $statements = array(); - while (($token = $this->next())) { - if ($token[0] === T_USE) { - $statements = array_merge($statements, $this->parseUseStatement()); - continue; - } else if ($token[0] !== T_NAMESPACE || $this->parseNamespace() != $namespaceName) { - continue; - } - - // Get fresh array for new namespace. This is to prevent the parser to collect the use statements - // for a previous namespace with the same name. This is the case if a namespace is defined twice - // or if a namespace with the same name is commented out. - $statements = array(); - } - - return $statements; - } - - /** - * Get the namespace name. - * - * @return string The found namespace name. - */ - private function parseNamespace() - { - $namespace = ''; - while (($token = $this->next())){ - if ($token[0] === T_STRING || $token[0] === T_NS_SEPARATOR) { - $namespace .= $token[1]; - } else { - break; - } - } - - return $namespace; - } - - /** - * Parse a single use statement. - * - * @return array A list with all found class names for a use statement. - */ - private function parseUseStatement() - { - $class = ''; - $alias = ''; - $statements = array(); - $explicitAlias = false; - while (($token = $this->next())) { - $isNameToken = $token[0] === T_STRING || $token[0] === T_NS_SEPARATOR; - if (!$explicitAlias && $isNameToken) { - $class .= $token[1]; - $alias = $token[1]; - } else if ($explicitAlias && $isNameToken) { - $alias .= $token[1]; - } else if ($token[0] === T_AS) { - $explicitAlias = true; - $alias = ''; - } else if ($token === ',') { - $statements[strtolower($alias)] = $class; - $class = ''; - $alias = ''; - $explicitAlias = false; - } else if ($token === ';') { - $statements[strtolower($alias)] = $class; - break; - } else { - break; - } - } - - return $statements; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Reader.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Reader.php deleted file mode 100644 index 8e85d39..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/Reader.php +++ /dev/null @@ -1,35 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -/** - * Interface for annotation readers. - * - * @author Johannes M. Schmitt - */ -interface Reader -{ - function getClassAnnotations(\ReflectionClass $class); - function getClassAnnotation(\ReflectionClass $class, $annotationName); - function getMethodAnnotations(\ReflectionMethod $method); - function getMethodAnnotation(\ReflectionMethod $method, $annotationName); - function getPropertyAnnotations(\ReflectionProperty $property); - function getPropertyAnnotation(\ReflectionProperty $property, $annotationName); -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php deleted file mode 100644 index a13c7fa..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php +++ /dev/null @@ -1,152 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -use Doctrine\Common\Annotations\Annotation\Target; - -/** - * Simple Annotation Reader. - * - * This annotation reader is intended to be used in projects where you have - * full-control over all annotations that are available. - * - * @since 2.2 - * @author Johannes M. Schmitt - * @author Fabio B. Silva - */ -class SimpleAnnotationReader implements Reader -{ - /** - * @var DocParser - */ - private $parser; - - /** - * Constructor. - * - * Initializes a new SimpleAnnotationReader. - */ - public function __construct() - { - $this->parser = new DocParser(); - $this->parser->setIgnoreNotImportedAnnotations(true); - } - - /** - * Adds a namespace in which we will look for annotations. - * - * @param string $namespace - */ - public function addNamespace($namespace) - { - $this->parser->addNamespace($namespace); - } - - /** - * Gets the annotations applied to a class. - * - * @param ReflectionClass $class The ReflectionClass of the class from which - * the class annotations should be read. - * @return array An array of Annotations. - */ - public function getClassAnnotations(\ReflectionClass $class) - { - return $this->parser->parse($class->getDocComment(), 'class '.$class->getName()); - } - - /** - * Gets the annotations applied to a method. - * - * @param ReflectionMethod $property The ReflectionMethod of the method from which - * the annotations should be read. - * @return array An array of Annotations. - */ - public function getMethodAnnotations(\ReflectionMethod $method) - { - return $this->parser->parse($method->getDocComment(), 'method '.$method->getDeclaringClass()->name.'::'.$method->getName().'()'); - } - - /** - * Gets the annotations applied to a property. - * - * @param ReflectionProperty $property The ReflectionProperty of the property - * from which the annotations should be read. - * @return array An array of Annotations. - */ - public function getPropertyAnnotations(\ReflectionProperty $property) - { - return $this->parser->parse($property->getDocComment(), 'property '.$property->getDeclaringClass()->name.'::$'.$property->getName()); - } - - /** - * Gets a class annotation. - * - * @param ReflectionClass $class The ReflectionClass of the class from which - * the class annotations should be read. - * @param string $annotationName The name of the annotation. - * @return The Annotation or NULL, if the requested annotation does not exist. - */ - public function getClassAnnotation(\ReflectionClass $class, $annotationName) - { - foreach ($this->getClassAnnotations($class) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - /** - * Gets a method annotation. - * - * @param ReflectionMethod $method - * @param string $annotationName The name of the annotation. - * @return The Annotation or NULL, if the requested annotation does not exist. - */ - public function getMethodAnnotation(\ReflectionMethod $method, $annotationName) - { - foreach ($this->getMethodAnnotations($method) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - /** - * Gets a property annotation. - * - * @param ReflectionProperty $property - * @param string $annotationName The name of the annotation. - * @return The Annotation or NULL, if the requested annotation does not exist. - */ - public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName) - { - foreach ($this->getPropertyAnnotations($property) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/ApcCache.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/ApcCache.php deleted file mode 100644 index a59296f..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/ApcCache.php +++ /dev/null @@ -1,97 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * APC cache provider. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author David Abdemoulaie - */ -class ApcCache extends CacheProvider -{ - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return apc_fetch($id); - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - $found = false; - - apc_fetch($id, $found); - - return $found; - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - return (bool) apc_store($id, $data, (int) $lifeTime); - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return apc_delete($id); - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - return apc_clear_cache() && apc_clear_cache('user'); - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - $info = apc_cache_info(); - $sma = apc_sma_info(); - - return array( - Cache::STATS_HITS => $info['num_hits'], - Cache::STATS_MISSES => $info['num_misses'], - Cache::STATS_UPTIME => $info['start_time'], - Cache::STATS_MEMORY_USAGE => $info['mem_size'], - Cache::STATS_MEMORY_AVAILIABLE => $sma['avail_mem'], - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/ArrayCache.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/ArrayCache.php deleted file mode 100644 index 8a0b982..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/ArrayCache.php +++ /dev/null @@ -1,96 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * Array cache driver. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author David Abdemoulaie - */ -class ArrayCache extends CacheProvider -{ - /** - * @var array $data - */ - private $data = array(); - - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return (isset($this->data[$id])) ? $this->data[$id] : false; - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return isset($this->data[$id]); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - $this->data[$id] = $data; - - return true; - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - unset($this->data[$id]); - - return true; - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - $this->data = array(); - - return true; - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - return null; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/Cache.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/Cache.php deleted file mode 100644 index d303bde..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/Cache.php +++ /dev/null @@ -1,102 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * Interface for cache drivers. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Fabio B. Silva - */ -interface Cache -{ - const STATS_HITS = 'hits'; - const STATS_MISSES = 'misses'; - const STATS_UPTIME = 'uptime'; - const STATS_MEMORY_USAGE = 'memory_usage'; - const STATS_MEMORY_AVAILIABLE = 'memory_available'; - - /** - * Fetches an entry from the cache. - * - * @param string $id cache id The id of the cache entry to fetch. - * @return string The cached data or FALSE, if no cache entry exists for the given id. - */ - function fetch($id); - - /** - * Test if an entry exists in the cache. - * - * @param string $id cache id The cache id of the entry to check for. - * @return boolean TRUE if a cache entry exists for the given cache id, FALSE otherwise. - */ - function contains($id); - - /** - * Puts data into the cache. - * - * @param string $id The cache id. - * @param string $data The cache entry/data. - * @param int $lifeTime The lifetime. If != 0, sets a specific lifetime for this cache entry (0 => infinite lifeTime). - * @return boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise. - */ - function save($id, $data, $lifeTime = 0); - - /** - * Deletes a cache entry. - * - * @param string $id cache id - * @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise. - */ - function delete($id); - - /** - * Retrieves cached information from data store - * - * The server's statistics array has the following values: - * - * - hits - * Number of keys that have been requested and found present. - * - * - misses - * Number of items that have been requested and not found. - * - * - uptime - * Time that the server is running. - * - * - memory_usage - * Memory used by this server to store items. - * - * - memory_available - * Memory allowed to use for storage. - * - * @since 2.2 - * @var array Associative array with server's statistics if available, NULL otherwise. - */ - function getStats(); -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/CacheProvider.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/CacheProvider.php deleted file mode 100644 index fa11fc2..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/CacheProvider.php +++ /dev/null @@ -1,188 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * Base class for cache provider implementations. - * - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Fabio B. Silva - */ -abstract class CacheProvider implements Cache -{ - const DOCTRINE_NAMESPACE_CACHEKEY = 'DoctrineNamespaceCacheKey[%s]'; - - /** - * @var string The namespace to prefix all cache ids with - */ - private $namespace = ''; - - /** - * Set the namespace to prefix all cache ids with. - * - * @param string $namespace - * @return void - */ - public function setNamespace($namespace) - { - $this->namespace = (string) $namespace; - } - - /** - * Retrieve the namespace that prefixes all cache ids. - * - * @return string - */ - public function getNamespace() - { - return $this->namespace; - } - - /** - * {@inheritdoc} - */ - public function fetch($id) - { - return $this->doFetch($this->getNamespacedId($id)); - } - - /** - * {@inheritdoc} - */ - public function contains($id) - { - return $this->doContains($this->getNamespacedId($id)); - } - - /** - * {@inheritdoc} - */ - public function save($id, $data, $lifeTime = 0) - { - return $this->doSave($this->getNamespacedId($id), $data, $lifeTime); - } - - /** - * {@inheritdoc} - */ - public function delete($id) - { - return $this->doDelete($this->getNamespacedId($id)); - } - - /** - * {@inheritdoc} - */ - public function getStats() - { - return $this->doGetStats(); - } - - /** - * Deletes all cache entries. - * - * @return boolean TRUE if the cache entries were successfully flushed, FALSE otherwise. - */ - public function flushAll() - { - return $this->doFlush(); - } - - /** - * Delete all cache entries. - * - * @return boolean TRUE if the cache entries were successfully deleted, FALSE otherwise. - */ - public function deleteAll() - { - $namespaceCacheKey = sprintf(self::DOCTRINE_NAMESPACE_CACHEKEY, $this->namespace); - $namespaceVersion = ($this->doContains($namespaceCacheKey)) ? $this->doFetch($namespaceCacheKey) : 1; - - return $this->doSave($namespaceCacheKey, $namespaceVersion + 1); - } - - /** - * Prefix the passed id with the configured namespace value - * - * @param string $id The id to namespace - * @return string $id The namespaced id - */ - private function getNamespacedId($id) - { - $namespaceCacheKey = sprintf(self::DOCTRINE_NAMESPACE_CACHEKEY, $this->namespace); - $namespaceVersion = ($this->doContains($namespaceCacheKey)) ? $this->doFetch($namespaceCacheKey) : 1; - - return sprintf('%s[%s][%s]', $this->namespace, $id, $namespaceVersion); - } - - /** - * Fetches an entry from the cache. - * - * @param string $id cache id The id of the cache entry to fetch. - * @return string The cached data or FALSE, if no cache entry exists for the given id. - */ - abstract protected function doFetch($id); - - /** - * Test if an entry exists in the cache. - * - * @param string $id cache id The cache id of the entry to check for. - * @return boolean TRUE if a cache entry exists for the given cache id, FALSE otherwise. - */ - abstract protected function doContains($id); - - /** - * Puts data into the cache. - * - * @param string $id The cache id. - * @param string $data The cache entry/data. - * @param int $lifeTime The lifetime. If != false, sets a specific lifetime for this cache entry (null => infinite lifeTime). - * @return boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise. - */ - abstract protected function doSave($id, $data, $lifeTime = false); - - /** - * Deletes a cache entry. - * - * @param string $id cache id - * @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise. - */ - abstract protected function doDelete($id); - - /** - * Deletes all cache entries. - * - * @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise. - */ - abstract protected function doFlush(); - - /** - * Retrieves cached information from data store - * - * @since 2.2 - * @return array An associative array with server's statistics if available, NULL otherwise. - */ - abstract protected function doGetStats(); -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/MemcacheCache.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/MemcacheCache.php deleted file mode 100644 index dd6d1e3..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/MemcacheCache.php +++ /dev/null @@ -1,121 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -use \Memcache; - -/** - * Memcache cache provider. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author David Abdemoulaie - */ -class MemcacheCache extends CacheProvider -{ - /** - * @var Memcache - */ - private $memcache; - - /** - * Sets the memcache instance to use. - * - * @param Memcache $memcache - */ - public function setMemcache(Memcache $memcache) - { - $this->memcache = $memcache; - } - - /** - * Gets the memcache instance used by the cache. - * - * @return Memcache - */ - public function getMemcache() - { - return $this->memcache; - } - - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return $this->memcache->get($id); - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return (bool) $this->memcache->get($id); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - if ($lifeTime > 30 * 24 * 3600) { - $lifeTime = time() + $lifeTime; - } - return $this->memcache->set($id, $data, 0, (int) $lifeTime); - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return $this->memcache->delete($id); - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - return $this->memcache->flush(); - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - $stats = $this->memcache->getStats(); - return array( - Cache::STATS_HITS => $stats['get_hits'], - Cache::STATS_MISSES => $stats['get_misses'], - Cache::STATS_UPTIME => $stats['uptime'], - Cache::STATS_MEMORY_USAGE => $stats['bytes'], - Cache::STATS_MEMORY_AVAILIABLE => $stats['limit_maxbytes'], - ); - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/MemcachedCache.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/MemcachedCache.php deleted file mode 100644 index 4675fae..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/MemcachedCache.php +++ /dev/null @@ -1,124 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -use \Memcached; - -/** - * Memcached cache provider. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author David Abdemoulaie - */ -class MemcachedCache extends CacheProvider -{ - /** - * @var Memcached - */ - private $memcached; - - /** - * Sets the memcache instance to use. - * - * @param Memcached $memcached - */ - public function setMemcached(Memcached $memcached) - { - $this->memcached = $memcached; - } - - /** - * Gets the memcached instance used by the cache. - * - * @return Memcached - */ - public function getMemcached() - { - return $this->memcached; - } - - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return $this->memcached->get($id); - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return (false !== $this->memcached->get($id)); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - if ($lifeTime > 30 * 24 * 3600) { - $lifeTime = time() + $lifeTime; - } - return $this->memcached->set($id, $data, (int) $lifeTime); - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return $this->memcached->delete($id); - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - return $this->memcached->flush(); - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - $stats = $this->memcached->getStats(); - $servers = $this->memcached->getServerList(); - $key = $servers[0]['host'] . ':' . $servers[0]['port']; - $stats = $stats[$key]; - return array( - Cache::STATS_HITS => $stats['get_hits'], - Cache::STATS_MISSES => $stats['get_misses'], - Cache::STATS_UPTIME => $stats['uptime'], - Cache::STATS_MEMORY_USAGE => $stats['bytes'], - Cache::STATS_MEMORY_AVAILIABLE => $stats['limit_maxbytes'], - ); - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/WinCacheCache.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/WinCacheCache.php deleted file mode 100644 index ed8ca74..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/WinCacheCache.php +++ /dev/null @@ -1,92 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * WinCache cache provider. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author David Abdemoulaie - */ -class WincacheCache extends CacheProvider -{ - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return wincache_ucache_get($id); - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return wincache_ucache_exists($id); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - return (bool) wincache_ucache_set($id, $data, (int) $lifeTime); - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return wincache_ucache_delete($id); - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - return wincache_ucache_clear(); - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - $info = wincache_ucache_info(); - $meminfo= wincache_ucache_meminfo(); - return array( - Cache::STATS_HITS => $info['total_hit_count'], - Cache::STATS_MISSES => $info['total_miss_count'], - Cache::STATS_UPTIME => $info['total_cache_uptime'], - Cache::STATS_MEMORY_USAGE => $meminfo['memory_total'], - Cache::STATS_MEMORY_AVAILIABLE => $meminfo['memory_free'], - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/XcacheCache.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/XcacheCache.php deleted file mode 100644 index 6e22d26..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/XcacheCache.php +++ /dev/null @@ -1,110 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * Xcache cache driver. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author David Abdemoulaie - */ -class XcacheCache extends CacheProvider -{ - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return $this->doContains($id) ? unserialize(xcache_get($id)) : false; - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return xcache_isset($id); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - return xcache_set($id, serialize($data), (int) $lifeTime); - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return xcache_unset($id); - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - $this->checkAuthorization(); - - xcache_clear_cache(XC_TYPE_VAR, 0); - - return true; - } - - /** - * Checks that xcache.admin.enable_auth is Off - * - * @throws \BadMethodCallException When xcache.admin.enable_auth is On - * @return void - */ - protected function checkAuthorization() - { - if (ini_get('xcache.admin.enable_auth')) { - throw new \BadMethodCallException('To use all features of \Doctrine\Common\Cache\XcacheCache, you must set "xcache.admin.enable_auth" to "Off" in your php.ini.'); - } - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - $this->checkAuthorization(); - - $info = xcache_info(XC_TYPE_VAR, 0); - return array( - Cache::STATS_HITS => $info['hits'], - Cache::STATS_MISSES => $info['misses'], - Cache::STATS_UPTIME => null, - Cache::STATS_MEMORY_USAGE => $info['size'], - Cache::STATS_MEMORY_AVAILIABLE => $info['avail'], - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/ZendDataCache.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/ZendDataCache.php deleted file mode 100644 index 4e4dabe..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Cache/ZendDataCache.php +++ /dev/null @@ -1,84 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * Zend Data Cache cache driver. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Ralph Schindler - * @author Guilherme Blanco - */ -class ZendDataCache extends CacheProvider -{ - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return zend_shm_cache_fetch($id); - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return (false !== zend_shm_cache_fetch($id)); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - return zend_shm_cache_store($id, $data, $lifeTime); - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return zend_shm_cache_delete($id); - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - $namespace = $this->getNamespace(); - if (empty($namespace)) { - return zend_shm_cache_clear(); - } - return zend_shm_cache_clear($namespace); - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - return null; - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/ClassLoader.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/ClassLoader.php deleted file mode 100644 index 375b0d6..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/ClassLoader.php +++ /dev/null @@ -1,262 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * A ClassLoader is an autoloader for class files that can be - * installed on the SPL autoload stack. It is a class loader that either loads only classes - * of a specific namespace or all namespaces and it is suitable for working together - * with other autoloaders in the SPL autoload stack. - * - * If no include path is configured through the constructor or {@link setIncludePath}, a ClassLoader - * relies on the PHP include_path. - * - * @author Roman Borschel - * @since 2.0 - */ -class ClassLoader -{ - /** - * @var string PHP file extension - */ - protected $fileExtension = '.php'; - - /** - * @var string Current namespace - */ - protected $namespace; - - /** - * @var string Current include path - */ - protected $includePath; - - /** - * @var string PHP namespace separator - */ - protected $namespaceSeparator = '\\'; - - /** - * Creates a new ClassLoader that loads classes of the - * specified namespace from the specified include path. - * - * If no include path is given, the ClassLoader relies on the PHP include_path. - * If neither a namespace nor an include path is given, the ClassLoader will - * be responsible for loading all classes, thereby relying on the PHP include_path. - * - * @param string $ns The namespace of the classes to load. - * @param string $includePath The base include path to use. - */ - public function __construct($ns = null, $includePath = null) - { - $this->namespace = $ns; - $this->includePath = $includePath; - } - - /** - * Sets the namespace separator used by classes in the namespace of this ClassLoader. - * - * @param string $sep The separator to use. - */ - public function setNamespaceSeparator($sep) - { - $this->namespaceSeparator = $sep; - } - - /** - * Gets the namespace separator used by classes in the namespace of this ClassLoader. - * - * @return string - */ - public function getNamespaceSeparator() - { - return $this->namespaceSeparator; - } - - /** - * Sets the base include path for all class files in the namespace of this ClassLoader. - * - * @param string $includePath - */ - public function setIncludePath($includePath) - { - $this->includePath = $includePath; - } - - /** - * Gets the base include path for all class files in the namespace of this ClassLoader. - * - * @return string - */ - public function getIncludePath() - { - return $this->includePath; - } - - /** - * Sets the file extension of class files in the namespace of this ClassLoader. - * - * @param string $fileExtension - */ - public function setFileExtension($fileExtension) - { - $this->fileExtension = $fileExtension; - } - - /** - * Gets the file extension of class files in the namespace of this ClassLoader. - * - * @return string - */ - public function getFileExtension() - { - return $this->fileExtension; - } - - /** - * Registers this ClassLoader on the SPL autoload stack. - */ - public function register() - { - spl_autoload_register(array($this, 'loadClass')); - } - - /** - * Removes this ClassLoader from the SPL autoload stack. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $classname The name of the class to load. - * @return boolean TRUE if the class has been successfully loaded, FALSE otherwise. - */ - public function loadClass($className) - { - if ($this->namespace !== null && strpos($className, $this->namespace.$this->namespaceSeparator) !== 0) { - return false; - } - - require ($this->includePath !== null ? $this->includePath . DIRECTORY_SEPARATOR : '') - . str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $className) - . $this->fileExtension; - - return true; - } - - /** - * Asks this ClassLoader whether it can potentially load the class (file) with - * the given name. - * - * @param string $className The fully-qualified name of the class. - * @return boolean TRUE if this ClassLoader can load the class, FALSE otherwise. - */ - public function canLoadClass($className) - { - if ($this->namespace !== null && strpos($className, $this->namespace.$this->namespaceSeparator) !== 0) { - return false; - } - - $file = str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $className) . $this->fileExtension; - - if ($this->includePath !== null) { - return file_exists($this->includePath . DIRECTORY_SEPARATOR . $file); - } - - return (false !== stream_resolve_include_path($file)); - } - - /** - * Checks whether a class with a given name exists. A class "exists" if it is either - * already defined in the current request or if there is an autoloader on the SPL - * autoload stack that is a) responsible for the class in question and b) is able to - * load a class file in which the class definition resides. - * - * If the class is not already defined, each autoloader in the SPL autoload stack - * is asked whether it is able to tell if the class exists. If the autoloader is - * a ClassLoader, {@link canLoadClass} is used, otherwise the autoload - * function of the autoloader is invoked and expected to return a value that - * evaluates to TRUE if the class (file) exists. As soon as one autoloader reports - * that the class exists, TRUE is returned. - * - * Note that, depending on what kinds of autoloaders are installed on the SPL - * autoload stack, the class (file) might already be loaded as a result of checking - * for its existence. This is not the case with a ClassLoader, who separates - * these responsibilities. - * - * @param string $className The fully-qualified name of the class. - * @return boolean TRUE if the class exists as per the definition given above, FALSE otherwise. - */ - public static function classExists($className) - { - if (class_exists($className, false) || interface_exists($className, false)) { - return true; - } - - foreach (spl_autoload_functions() as $loader) { - if (is_array($loader)) { // array(???, ???) - if (is_object($loader[0])) { - if ($loader[0] instanceof ClassLoader) { // array($obj, 'methodName') - if ($loader[0]->canLoadClass($className)) { - return true; - } - } else if ($loader[0]->{$loader[1]}($className)) { - return true; - } - } else if ($loader[0]::$loader[1]($className)) { // array('ClassName', 'methodName') - return true; - } - } else if ($loader instanceof \Closure) { // function($className) {..} - if ($loader($className)) { - return true; - } - } else if (is_string($loader) && $loader($className)) { // "MyClass::loadClass" - return true; - } - } - - return class_exists($className, false) || interface_exists($className, false); - } - - /** - * Gets the ClassLoader from the SPL autoload stack that is responsible - * for (and is able to load) the class with the given name. - * - * @param string $className The name of the class. - * @return The ClassLoader for the class or NULL if no such ClassLoader exists. - */ - public static function getClassLoader($className) - { - foreach (spl_autoload_functions() as $loader) { - if (is_array($loader) - && $loader[0] instanceof ClassLoader - && $loader[0]->canLoadClass($className) - ) { - return $loader[0]; - } - } - - return null; - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Collections/ArrayCollection.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Collections/ArrayCollection.php deleted file mode 100644 index 2a7d4ea..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Collections/ArrayCollection.php +++ /dev/null @@ -1,447 +0,0 @@ -. - */ - -namespace Doctrine\Common\Collections; - -use Closure, ArrayIterator; - -/** - * An ArrayCollection is a Collection implementation that wraps a regular PHP array. - * - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ArrayCollection implements Collection -{ - /** - * An array containing the entries of this collection. - * - * @var array - */ - private $_elements; - - /** - * Initializes a new ArrayCollection. - * - * @param array $elements - */ - public function __construct(array $elements = array()) - { - $this->_elements = $elements; - } - - /** - * Gets the PHP array representation of this collection. - * - * @return array The PHP array representation of this collection. - */ - public function toArray() - { - return $this->_elements; - } - - /** - * Sets the internal iterator to the first element in the collection and - * returns this element. - * - * @return mixed - */ - public function first() - { - return reset($this->_elements); - } - - /** - * Sets the internal iterator to the last element in the collection and - * returns this element. - * - * @return mixed - */ - public function last() - { - return end($this->_elements); - } - - /** - * Gets the current key/index at the current internal iterator position. - * - * @return mixed - */ - public function key() - { - return key($this->_elements); - } - - /** - * Moves the internal iterator position to the next element. - * - * @return mixed - */ - public function next() - { - return next($this->_elements); - } - - /** - * Gets the element of the collection at the current internal iterator position. - * - * @return mixed - */ - public function current() - { - return current($this->_elements); - } - - /** - * Removes an element with a specific key/index from the collection. - * - * @param mixed $key - * @return mixed The removed element or NULL, if no element exists for the given key. - */ - public function remove($key) - { - if (isset($this->_elements[$key])) { - $removed = $this->_elements[$key]; - unset($this->_elements[$key]); - - return $removed; - } - - return null; - } - - /** - * Removes the specified element from the collection, if it is found. - * - * @param mixed $element The element to remove. - * @return boolean TRUE if this collection contained the specified element, FALSE otherwise. - */ - public function removeElement($element) - { - $key = array_search($element, $this->_elements, true); - - if ($key !== false) { - unset($this->_elements[$key]); - - return true; - } - - return false; - } - - /** - * ArrayAccess implementation of offsetExists() - * - * @see containsKey() - */ - public function offsetExists($offset) - { - return $this->containsKey($offset); - } - - /** - * ArrayAccess implementation of offsetGet() - * - * @see get() - */ - public function offsetGet($offset) - { - return $this->get($offset); - } - - /** - * ArrayAccess implementation of offsetGet() - * - * @see add() - * @see set() - */ - public function offsetSet($offset, $value) - { - if ( ! isset($offset)) { - return $this->add($value); - } - return $this->set($offset, $value); - } - - /** - * ArrayAccess implementation of offsetUnset() - * - * @see remove() - */ - public function offsetUnset($offset) - { - return $this->remove($offset); - } - - /** - * Checks whether the collection contains a specific key/index. - * - * @param mixed $key The key to check for. - * @return boolean TRUE if the given key/index exists, FALSE otherwise. - */ - public function containsKey($key) - { - return isset($this->_elements[$key]); - } - - /** - * Checks whether the given element is contained in the collection. - * Only element values are compared, not keys. The comparison of two elements - * is strict, that means not only the value but also the type must match. - * For objects this means reference equality. - * - * @param mixed $element - * @return boolean TRUE if the given element is contained in the collection, - * FALSE otherwise. - */ - public function contains($element) - { - foreach ($this->_elements as $collectionElement) { - if ($element === $collectionElement) { - return true; - } - } - - return false; - } - - /** - * Tests for the existance of an element that satisfies the given predicate. - * - * @param Closure $p The predicate. - * @return boolean TRUE if the predicate is TRUE for at least one element, FALSE otherwise. - */ - public function exists(Closure $p) - { - foreach ($this->_elements as $key => $element) { - if ($p($key, $element)) { - return true; - } - } - return false; - } - - /** - * Searches for a given element and, if found, returns the corresponding key/index - * of that element. The comparison of two elements is strict, that means not - * only the value but also the type must match. - * For objects this means reference equality. - * - * @param mixed $element The element to search for. - * @return mixed The key/index of the element or FALSE if the element was not found. - */ - public function indexOf($element) - { - return array_search($element, $this->_elements, true); - } - - /** - * Gets the element with the given key/index. - * - * @param mixed $key The key. - * @return mixed The element or NULL, if no element exists for the given key. - */ - public function get($key) - { - if (isset($this->_elements[$key])) { - return $this->_elements[$key]; - } - return null; - } - - /** - * Gets all keys/indexes of the collection elements. - * - * @return array - */ - public function getKeys() - { - return array_keys($this->_elements); - } - - /** - * Gets all elements. - * - * @return array - */ - public function getValues() - { - return array_values($this->_elements); - } - - /** - * Returns the number of elements in the collection. - * - * Implementation of the Countable interface. - * - * @return integer The number of elements in the collection. - */ - public function count() - { - return count($this->_elements); - } - - /** - * Adds/sets an element in the collection at the index / with the specified key. - * - * When the collection is a Map this is like put(key,value)/add(key,value). - * When the collection is a List this is like add(position,value). - * - * @param mixed $key - * @param mixed $value - */ - public function set($key, $value) - { - $this->_elements[$key] = $value; - } - - /** - * Adds an element to the collection. - * - * @param mixed $value - * @return boolean Always TRUE. - */ - public function add($value) - { - $this->_elements[] = $value; - return true; - } - - /** - * Checks whether the collection is empty. - * - * Note: This is preferrable over count() == 0. - * - * @return boolean TRUE if the collection is empty, FALSE otherwise. - */ - public function isEmpty() - { - return ! $this->_elements; - } - - /** - * Gets an iterator for iterating over the elements in the collection. - * - * @return ArrayIterator - */ - public function getIterator() - { - return new ArrayIterator($this->_elements); - } - - /** - * Applies the given function to each element in the collection and returns - * a new collection with the elements returned by the function. - * - * @param Closure $func - * @return Collection - */ - public function map(Closure $func) - { - return new static(array_map($func, $this->_elements)); - } - - /** - * Returns all the elements of this collection that satisfy the predicate p. - * The order of the elements is preserved. - * - * @param Closure $p The predicate used for filtering. - * @return Collection A collection with the results of the filter operation. - */ - public function filter(Closure $p) - { - return new static(array_filter($this->_elements, $p)); - } - - /** - * Applies the given predicate p to all elements of this collection, - * returning true, if the predicate yields true for all elements. - * - * @param Closure $p The predicate. - * @return boolean TRUE, if the predicate yields TRUE for all elements, FALSE otherwise. - */ - public function forAll(Closure $p) - { - foreach ($this->_elements as $key => $element) { - if ( ! $p($key, $element)) { - return false; - } - } - - return true; - } - - /** - * Partitions this collection in two collections according to a predicate. - * Keys are preserved in the resulting collections. - * - * @param Closure $p The predicate on which to partition. - * @return array An array with two elements. The first element contains the collection - * of elements where the predicate returned TRUE, the second element - * contains the collection of elements where the predicate returned FALSE. - */ - public function partition(Closure $p) - { - $coll1 = $coll2 = array(); - foreach ($this->_elements as $key => $element) { - if ($p($key, $element)) { - $coll1[$key] = $element; - } else { - $coll2[$key] = $element; - } - } - return array(new static($coll1), new static($coll2)); - } - - /** - * Returns a string representation of this object. - * - * @return string - */ - public function __toString() - { - return __CLASS__ . '@' . spl_object_hash($this); - } - - /** - * Clears the collection. - */ - public function clear() - { - $this->_elements = array(); - } - - /** - * Extract a slice of $length elements starting at position $offset from the Collection. - * - * If $length is null it returns all elements from $offset to the end of the Collection. - * Keys have to be preserved by this method. Calling this method will only return the - * selected slice and NOT change the elements contained in the collection slice is called on. - * - * @param int $offset - * @param int $length - * @return array - */ - public function slice($offset, $length = null) - { - return array_slice($this->_elements, $offset, $length, true); - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Collections/Collection.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Collections/Collection.php deleted file mode 100644 index 9fca659..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Collections/Collection.php +++ /dev/null @@ -1,243 +0,0 @@ -. - */ - -namespace Doctrine\Common\Collections; - -use Closure, Countable, IteratorAggregate, ArrayAccess; - -/** - * The missing (SPL) Collection/Array/OrderedMap interface. - * - * A Collection resembles the nature of a regular PHP array. That is, - * it is essentially an ordered map that can also be used - * like a list. - * - * A Collection has an internal iterator just like a PHP array. In addition, - * a Collection can be iterated with external iterators, which is preferrable. - * To use an external iterator simply use the foreach language construct to - * iterate over the collection (which calls {@link getIterator()} internally) or - * explicitly retrieve an iterator though {@link getIterator()} which can then be - * used to iterate over the collection. - * You can not rely on the internal iterator of the collection being at a certain - * position unless you explicitly positioned it before. Prefer iteration with - * external iterators. - * - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -interface Collection extends Countable, IteratorAggregate, ArrayAccess -{ - /** - * Adds an element at the end of the collection. - * - * @param mixed $element The element to add. - * @return boolean Always TRUE. - */ - function add($element); - - /** - * Clears the collection, removing all elements. - */ - function clear(); - - /** - * Checks whether an element is contained in the collection. - * This is an O(n) operation, where n is the size of the collection. - * - * @param mixed $element The element to search for. - * @return boolean TRUE if the collection contains the element, FALSE otherwise. - */ - function contains($element); - - /** - * Checks whether the collection is empty (contains no elements). - * - * @return boolean TRUE if the collection is empty, FALSE otherwise. - */ - function isEmpty(); - - /** - * Removes the element at the specified index from the collection. - * - * @param string|integer $key The kex/index of the element to remove. - * @return mixed The removed element or NULL, if the collection did not contain the element. - */ - function remove($key); - - /** - * Removes the specified element from the collection, if it is found. - * - * @param mixed $element The element to remove. - * @return boolean TRUE if this collection contained the specified element, FALSE otherwise. - */ - function removeElement($element); - - /** - * Checks whether the collection contains an element with the specified key/index. - * - * @param string|integer $key The key/index to check for. - * @return boolean TRUE if the collection contains an element with the specified key/index, - * FALSE otherwise. - */ - function containsKey($key); - - /** - * Gets the element at the specified key/index. - * - * @param string|integer $key The key/index of the element to retrieve. - * @return mixed - */ - function get($key); - - /** - * Gets all keys/indices of the collection. - * - * @return array The keys/indices of the collection, in the order of the corresponding - * elements in the collection. - */ - function getKeys(); - - /** - * Gets all values of the collection. - * - * @return array The values of all elements in the collection, in the order they - * appear in the collection. - */ - function getValues(); - - /** - * Sets an element in the collection at the specified key/index. - * - * @param string|integer $key The key/index of the element to set. - * @param mixed $value The element to set. - */ - function set($key, $value); - - /** - * Gets a native PHP array representation of the collection. - * - * @return array - */ - function toArray(); - - /** - * Sets the internal iterator to the first element in the collection and - * returns this element. - * - * @return mixed - */ - function first(); - - /** - * Sets the internal iterator to the last element in the collection and - * returns this element. - * - * @return mixed - */ - function last(); - - /** - * Gets the key/index of the element at the current iterator position. - * - */ - function key(); - - /** - * Gets the element of the collection at the current iterator position. - * - */ - function current(); - - /** - * Moves the internal iterator position to the next element. - * - */ - function next(); - - /** - * Tests for the existence of an element that satisfies the given predicate. - * - * @param Closure $p The predicate. - * @return boolean TRUE if the predicate is TRUE for at least one element, FALSE otherwise. - */ - function exists(Closure $p); - - /** - * Returns all the elements of this collection that satisfy the predicate p. - * The order of the elements is preserved. - * - * @param Closure $p The predicate used for filtering. - * @return Collection A collection with the results of the filter operation. - */ - function filter(Closure $p); - - /** - * Applies the given predicate p to all elements of this collection, - * returning true, if the predicate yields true for all elements. - * - * @param Closure $p The predicate. - * @return boolean TRUE, if the predicate yields TRUE for all elements, FALSE otherwise. - */ - function forAll(Closure $p); - - /** - * Applies the given function to each element in the collection and returns - * a new collection with the elements returned by the function. - * - * @param Closure $func - * @return Collection - */ - function map(Closure $func); - - /** - * Partitions this collection in two collections according to a predicate. - * Keys are preserved in the resulting collections. - * - * @param Closure $p The predicate on which to partition. - * @return array An array with two elements. The first element contains the collection - * of elements where the predicate returned TRUE, the second element - * contains the collection of elements where the predicate returned FALSE. - */ - function partition(Closure $p); - - /** - * Gets the index/key of a given element. The comparison of two elements is strict, - * that means not only the value but also the type must match. - * For objects this means reference equality. - * - * @param mixed $element The element to search for. - * @return mixed The key/index of the element or FALSE if the element was not found. - */ - function indexOf($element); - - /** - * Extract a slice of $length elements starting at position $offset from the Collection. - * - * If $length is null it returns all elements from $offset to the end of the Collection. - * Keys have to be preserved by this method. Calling this method will only return the - * selected slice and NOT change the elements contained in the collection slice is called on. - * - * @param int $offset - * @param int $length - * @return array - */ - function slice($offset, $length = null); -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/CommonException.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/CommonException.php deleted file mode 100644 index 8c5669b..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/CommonException.php +++ /dev/null @@ -1,28 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * Base exception class for package Doctrine\Common - * @author heinrich - * - */ -class CommonException extends \Exception { -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Comparable.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Comparable.php deleted file mode 100644 index bc95d30..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Comparable.php +++ /dev/null @@ -1,47 +0,0 @@ -. - */ - - -namespace Doctrine\Common; - -/** - * Comparable interface that allows to compare two value objects to each other for similarity. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - */ -interface Comparable -{ - /** - * Compare the current object to the passed $other. - * - * Returns 0 if they are semantically equal, 1 if the other object - * is less than the current one, or -1 if its more than the current one. - * - * This method should not check for identity using ===, only for semantical equality for example - * when two different DateTime instances point to the exact same Date + TZ. - * - * @return int - */ - public function compareTo($other); -} - diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/EventArgs.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/EventArgs.php deleted file mode 100644 index 6a3c069..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/EventArgs.php +++ /dev/null @@ -1,69 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * EventArgs is the base class for classes containing event data. - * - * This class contains no event data. It is used by events that do not pass state - * information to an event handler when an event is raised. The single empty EventArgs - * instance can be obtained through {@link getEmptyInstance}. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class EventArgs -{ - /** - * @var EventArgs Single instance of EventArgs - * @static - */ - private static $_emptyEventArgsInstance; - - /** - * Gets the single, empty and immutable EventArgs instance. - * - * This instance will be used when events are dispatched without any parameter, - * like this: EventManager::dispatchEvent('eventname'); - * - * The benefit from this is that only one empty instance is instantiated and shared - * (otherwise there would be instances for every dispatched in the abovementioned form) - * - * @see EventManager::dispatchEvent - * @link http://msdn.microsoft.com/en-us/library/system.eventargs.aspx - * @static - * @return EventArgs - */ - public static function getEmptyInstance() - { - if ( ! self::$_emptyEventArgsInstance) { - self::$_emptyEventArgsInstance = new EventArgs; - } - - return self::$_emptyEventArgsInstance; - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/EventManager.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/EventManager.php deleted file mode 100644 index a1f11ed..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/EventManager.php +++ /dev/null @@ -1,136 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * The EventManager is the central point of Doctrine's event listener system. - * Listeners are registered on the manager and events are dispatched through the - * manager. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class EventManager -{ - /** - * Map of registered listeners. - * => - * - * @var array - */ - private $_listeners = array(); - - /** - * Dispatches an event to all registered listeners. - * - * @param string $eventName The name of the event to dispatch. The name of the event is - * the name of the method that is invoked on listeners. - * @param EventArgs $eventArgs The event arguments to pass to the event handlers/listeners. - * If not supplied, the single empty EventArgs instance is used. - * @return boolean - */ - public function dispatchEvent($eventName, EventArgs $eventArgs = null) - { - if (isset($this->_listeners[$eventName])) { - $eventArgs = $eventArgs === null ? EventArgs::getEmptyInstance() : $eventArgs; - - foreach ($this->_listeners[$eventName] as $listener) { - $listener->$eventName($eventArgs); - } - } - } - - /** - * Gets the listeners of a specific event or all listeners. - * - * @param string $event The name of the event. - * @return array The event listeners for the specified event, or all event listeners. - */ - public function getListeners($event = null) - { - return $event ? $this->_listeners[$event] : $this->_listeners; - } - - /** - * Checks whether an event has any registered listeners. - * - * @param string $event - * @return boolean TRUE if the specified event has any listeners, FALSE otherwise. - */ - public function hasListeners($event) - { - return isset($this->_listeners[$event]) && $this->_listeners[$event]; - } - - /** - * Adds an event listener that listens on the specified events. - * - * @param string|array $events The event(s) to listen on. - * @param object $listener The listener object. - */ - public function addEventListener($events, $listener) - { - // Picks the hash code related to that listener - $hash = spl_object_hash($listener); - - foreach ((array) $events as $event) { - // Overrides listener if a previous one was associated already - // Prevents duplicate listeners on same event (same instance only) - $this->_listeners[$event][$hash] = $listener; - } - } - - /** - * Removes an event listener from the specified events. - * - * @param string|array $events - * @param object $listener - */ - public function removeEventListener($events, $listener) - { - // Picks the hash code related to that listener - $hash = spl_object_hash($listener); - - foreach ((array) $events as $event) { - // Check if actually have this listener associated - if (isset($this->_listeners[$event][$hash])) { - unset($this->_listeners[$event][$hash]); - } - } - } - - /** - * Adds an EventSubscriber. The subscriber is asked for all the events he is - * interested in and added as a listener for these events. - * - * @param Doctrine\Common\EventSubscriber $subscriber The subscriber. - */ - public function addEventSubscriber(EventSubscriber $subscriber) - { - $this->addEventListener($subscriber->getSubscribedEvents(), $subscriber); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/EventSubscriber.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/EventSubscriber.php deleted file mode 100644 index ed3383f..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/EventSubscriber.php +++ /dev/null @@ -1,45 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * An EventSubscriber knows himself what events he is interested in. - * If an EventSubscriber is added to an EventManager, the manager invokes - * {@link getSubscribedEvents} and registers the subscriber as a listener for all - * returned events. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -interface EventSubscriber -{ - /** - * Returns an array of events this subscriber wants to listen to. - * - * @return array - */ - function getSubscribedEvents(); -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Lexer.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Lexer.php deleted file mode 100644 index 8df3b84..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Lexer.php +++ /dev/null @@ -1,266 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * Base class for writing simple lexers, i.e. for creating small DSLs. - * - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @todo Rename: AbstractLexer - */ -abstract class Lexer -{ - /** - * @var array Array of scanned tokens - */ - private $tokens = array(); - - /** - * @var integer Current lexer position in input string - */ - private $position = 0; - - /** - * @var integer Current peek of current lexer position - */ - private $peek = 0; - - /** - * @var array The next token in the input. - */ - public $lookahead; - - /** - * @var array The last matched/seen token. - */ - public $token; - - /** - * Sets the input data to be tokenized. - * - * The Lexer is immediately reset and the new input tokenized. - * Any unprocessed tokens from any previous input are lost. - * - * @param string $input The input to be tokenized. - */ - public function setInput($input) - { - $this->tokens = array(); - $this->reset(); - $this->scan($input); - } - - /** - * Resets the lexer. - */ - public function reset() - { - $this->lookahead = null; - $this->token = null; - $this->peek = 0; - $this->position = 0; - } - - /** - * Resets the peek pointer to 0. - */ - public function resetPeek() - { - $this->peek = 0; - } - - /** - * Resets the lexer position on the input to the given position. - * - * @param integer $position Position to place the lexical scanner - */ - public function resetPosition($position = 0) - { - $this->position = $position; - } - - /** - * Checks whether a given token matches the current lookahead. - * - * @param integer|string $token - * @return boolean - */ - public function isNextToken($token) - { - return null !== $this->lookahead && $this->lookahead['type'] === $token; - } - - /** - * Checks whether any of the given tokens matches the current lookahead - * - * @param array $tokens - * @return boolean - */ - public function isNextTokenAny(array $tokens) - { - return null !== $this->lookahead && in_array($this->lookahead['type'], $tokens, true); - } - - /** - * Moves to the next token in the input string. - * - * A token is an associative array containing three items: - * - 'value' : the string value of the token in the input string - * - 'type' : the type of the token (identifier, numeric, string, input - * parameter, none) - * - 'position' : the position of the token in the input string - * - * @return array|null the next token; null if there is no more tokens left - */ - public function moveNext() - { - $this->peek = 0; - $this->token = $this->lookahead; - $this->lookahead = (isset($this->tokens[$this->position])) - ? $this->tokens[$this->position++] : null; - - return $this->lookahead !== null; - } - - /** - * Tells the lexer to skip input tokens until it sees a token with the given value. - * - * @param $type The token type to skip until. - */ - public function skipUntil($type) - { - while ($this->lookahead !== null && $this->lookahead['type'] !== $type) { - $this->moveNext(); - } - } - - /** - * Checks if given value is identical to the given token - * - * @param mixed $value - * @param integer $token - * @return boolean - */ - public function isA($value, $token) - { - return $this->getType($value) === $token; - } - - /** - * Moves the lookahead token forward. - * - * @return array | null The next token or NULL if there are no more tokens ahead. - */ - public function peek() - { - if (isset($this->tokens[$this->position + $this->peek])) { - return $this->tokens[$this->position + $this->peek++]; - } else { - return null; - } - } - - /** - * Peeks at the next token, returns it and immediately resets the peek. - * - * @return array|null The next token or NULL if there are no more tokens ahead. - */ - public function glimpse() - { - $peek = $this->peek(); - $this->peek = 0; - return $peek; - } - - /** - * Scans the input string for tokens. - * - * @param string $input a query string - */ - protected function scan($input) - { - static $regex; - - if ( ! isset($regex)) { - $regex = '/(' . implode(')|(', $this->getCatchablePatterns()) . ')|' - . implode('|', $this->getNonCatchablePatterns()) . '/i'; - } - - $flags = PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE; - $matches = preg_split($regex, $input, -1, $flags); - - foreach ($matches as $match) { - // Must remain before 'value' assignment since it can change content - $type = $this->getType($match[0]); - - $this->tokens[] = array( - 'value' => $match[0], - 'type' => $type, - 'position' => $match[1], - ); - } - } - - /** - * Gets the literal for a given token. - * - * @param integer $token - * @return string - */ - public function getLiteral($token) - { - $className = get_class($this); - $reflClass = new \ReflectionClass($className); - $constants = $reflClass->getConstants(); - - foreach ($constants as $name => $value) { - if ($value === $token) { - return $className . '::' . $name; - } - } - - return $token; - } - - /** - * Lexical catchable patterns. - * - * @return array - */ - abstract protected function getCatchablePatterns(); - - /** - * Lexical non-catchable patterns. - * - * @return array - */ - abstract protected function getNonCatchablePatterns(); - - /** - * Retrieve token type. Also processes the token value if necessary. - * - * @param string $value - * @return integer - */ - abstract protected function getType(&$value); -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/NotifyPropertyChanged.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/NotifyPropertyChanged.php deleted file mode 100644 index 93e504a..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/NotifyPropertyChanged.php +++ /dev/null @@ -1,45 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * Contract for classes that provide the service of notifying listeners of - * changes to their properties. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -interface NotifyPropertyChanged -{ - /** - * Adds a listener that wants to be notified about property changes. - * - * @param PropertyChangedListener $listener - */ - function addPropertyChangedListener(PropertyChangedListener $listener); -} - diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php deleted file mode 100644 index f045286..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php +++ /dev/null @@ -1,218 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -use Doctrine\Common\Persistence\ManagerRegistry; - -/** - * Abstract implementation of the ManagerRegistry contract. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.2 - * @author Fabien Potencier - * @author Benjamin Eberlei - * @author Lukas Kahwe Smith - */ -abstract class AbstractManagerRegistry implements ManagerRegistry -{ - private $name; - private $connections; - private $managers; - private $defaultConnection; - private $defaultManager; - private $proxyInterfaceName; - - public function __construct($name, array $connections, array $managers, $defaultConnection, $defaultManager, $proxyInterfaceName) - { - $this->name = $name; - $this->connections = $connections; - $this->managers = $managers; - $this->defaultConnection = $defaultConnection; - $this->defaultManager = $defaultManager; - $this->proxyInterfaceName = $proxyInterfaceName; - } - - /** - * Fetches/creates the given services - * - * A service in this context is connection or a manager instance - * - * @param string $name name of the service - * @return object instance of the given service - */ - abstract protected function getService($name); - - /** - * Resets the given services - * - * A service in this context is connection or a manager instance - * - * @param string $name name of the service - * @return void - */ - abstract protected function resetService($name); - - /** - * Get the name of the registry - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * @inheritdoc - */ - public function getConnection($name = null) - { - if (null === $name) { - $name = $this->defaultConnection; - } - - if (!isset($this->connections[$name])) { - throw new \InvalidArgumentException(sprintf('Doctrine %s Connection named "%s" does not exist.', $this->name, $name)); - } - - return $this->getService($this->connections[$name]); - } - - /** - * @inheritdoc - */ - public function getConnectionNames() - { - return $this->connections; - } - - /** - * @inheritdoc - */ - public function getConnections() - { - $connections = array(); - foreach ($this->connections as $name => $id) { - $connections[$name] = $this->getService($id); - } - - return $connections; - } - - /** - * @inheritdoc - */ - public function getDefaultConnectionName() - { - return $this->defaultConnection; - } - - /** - * @inheritdoc - */ - public function getDefaultManagerName() - { - return $this->defaultManager; - } - - /** - * @inheritdoc - */ - public function getManager($name = null) - { - if (null === $name) { - $name = $this->defaultManager; - } - - if (!isset($this->managers[$name])) { - throw new \InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name)); - } - - return $this->getService($this->managers[$name]); - } - - /** - * @inheritdoc - */ - public function getManagerForClass($class) - { - $proxyClass = new \ReflectionClass($class); - if ($proxyClass->implementsInterface($this->proxyInterfaceName)) { - $class = $proxyClass->getParentClass()->getName(); - } - - foreach ($this->managers as $id) { - $manager = $this->getService($id); - - if (!$manager->getMetadataFactory()->isTransient($class)) { - return $manager; - } - } - } - - /** - * @inheritdoc - */ - public function getManagerNames() - { - return $this->managers; - } - - /** - * @inheritdoc - */ - public function getManagers() - { - $dms = array(); - foreach ($this->managers as $name => $id) { - $dms[$name] = $this->getService($id); - } - - return $dms; - } - - /** - * @inheritdoc - */ - public function getRepository($persistentObjectName, $persistentManagerName = null) - { - return $this->getManager($persistentManagerName)->getRepository($persistentObjectName); - } - - /** - * @inheritdoc - */ - public function resetManager($name = null) - { - if (null === $name) { - $name = $this->defaultManager; - } - - if (!isset($this->managers[$name])) { - throw new \InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name)); - } - - // force the creation of a new document manager - // if the current one is closed - $this->resetService($this->managers[$name]); - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/ConnectionRegistry.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/ConnectionRegistry.php deleted file mode 100644 index a47727f..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/ConnectionRegistry.php +++ /dev/null @@ -1,63 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -/** - * Contract covering connection for a Doctrine persistence layer ManagerRegistry class to implement. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.2 - * @author Fabien Potencier - * @author Benjamin Eberlei - * @author Lukas Kahwe Smith - */ -interface ConnectionRegistry -{ - /** - * Gets the default connection name. - * - * @return string The default connection name - */ - function getDefaultConnectionName(); - - /** - * Gets the named connection. - * - * @param string $name The connection name (null for the default one) - * - * @return Connection - */ - function getConnection($name = null); - - /** - * Gets an array of all registered connections - * - * @return array An array of Connection instances - */ - function getConnections(); - - /** - * Gets all connection names. - * - * @return array An array of connection names - */ - function getConnectionNames(); -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php deleted file mode 100644 index 8055b66..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php +++ /dev/null @@ -1,77 +0,0 @@ -. -*/ - -namespace Doctrine\Common\Persistence\Event; - -use Doctrine\Common\EventArgs; -use Doctrine\Common\Persistence\ObjectManager; - -/** - * Lifecycle Events are triggered by the UnitOfWork during lifecycle transitions - * of entities. - * - * @link www.doctrine-project.org - * @since 2.2 - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class LifecycleEventArgs extends EventArgs -{ - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @var object - */ - private $entity; - - /** - * Constructor - * - * @param object $entity - * @param ObjectManager $objectManager - */ - public function __construct($entity, ObjectManager $objectManager) - { - $this->entity = $entity; - $this->objectManager = $objectManager; - } - - /** - * Retireve associated Entity. - * - * @return object - */ - public function getEntity() - { - return $this->entity; - } - - /** - * Retrieve associated ObjectManager. - * - * @return ObjectManager - */ - public function getObjectManager() - { - return $this->objectManager; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php deleted file mode 100644 index 4a18d16..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php +++ /dev/null @@ -1,76 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Event; - -use Doctrine\Common\EventArgs; -use Doctrine\Common\Persistence\ObjectManager; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; - -/** - * Class that holds event arguments for a loadMetadata event. - * - * @author Jonathan H. Wage - * @since 2.2 - */ -class LoadClassMetadataEventArgs extends EventArgs -{ - /** - * @var ClassMetadata - */ - private $classMetadata; - - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * Constructor. - * - * @param ClasseMetadata $classMetadata - * @param ObjectManager $objectManager - */ - public function __construct(ClassMetadata $classMetadata, ObjectManager $objectManager) - { - $this->classMetadata = $classMetadata; - $this->objectManager = $objectManager; - } - - /** - * Retrieve associated ClassMetadata. - * - * @return ClassMetadata - */ - public function getClassMetadata() - { - return $this->classMetadata; - } - - /** - * Retrieve associated ObjectManager. - * - * @return ObjectManager - */ - public function getObjectManager() - { - return $this->objectManager; - } -} - diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php deleted file mode 100644 index 33c4d79..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php +++ /dev/null @@ -1,59 +0,0 @@ -. -*/ - -namespace Doctrine\Common\Persistence\Event; - -use Doctrine\Common\Persistence\ObjectManager; - -/** - * Provides event arguments for the preFlush event. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.2 - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class ManagerEventArgs extends \Doctrine\Common\EventArgs -{ - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * Constructor. - * - * @param ObjectManager $objectManager - */ - public function __construct(ObjectManager $objectManager) - { - $this->objectManager = $objectManager; - } - - /** - * Retrieve associated ObjectManager. - * - * @return ObjectManager - */ - public function getObjectManager() - { - return $this->objectManager; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php deleted file mode 100644 index f67ab50..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php +++ /dev/null @@ -1,84 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Event; - -/** - * Provides event arguments for the onClear event. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.2 - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class OnClearEventArgs extends \Doctrine\Common\EventArgs -{ - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @var string - */ - private $entityClass; - - /** - * Constructor. - * - * @param ObjectManager $objectManager - * @param string $entityClass Optional entity class - */ - public function __construct($objectManager, $entityClass = null) - { - $this->objectManager = $objectManager; - $this->entityClass = $entityClass; - } - - /** - * Retrieve associated ObjectManager. - * - * @return ObjectManager - */ - public function getObjectManager() - { - return $this->objectManager; - } - - /** - * Name of the entity class that is cleared, or empty if all are cleared. - * - * @return string - */ - public function getEntityClass() - { - return $this->entityClass; - } - - /** - * Check if event clears all entities. - * - * @return bool - */ - public function clearsAllEntities() - { - return ($this->entityClass === null); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php deleted file mode 100644 index 191d053..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php +++ /dev/null @@ -1,129 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Event; - -use Doctrine\Common\EventArgs, - Doctrine\Common\Persistence\ObjectManager; - -/** - * Class that holds event arguments for a preUpdate event. - * - * @author Guilherme Blanco - * @author Roman Borschel - * @author Benjamin Eberlei - * @since 2.2 - */ -class PreUpdateEventArgs extends LifecycleEventArgs -{ - /** - * @var array - */ - private $entityChangeSet; - - /** - * Constructor. - * - * @param object $entity - * @param ObjectManager $objectManager - * @param array $changeSet - */ - public function __construct($entity, ObjectManager $objectManager, array &$changeSet) - { - parent::__construct($entity, $objectManager); - - $this->entityChangeSet = &$changeSet; - } - - /** - * Retrieve entity changeset. - * - * @return array - */ - public function getEntityChangeSet() - { - return $this->entityChangeSet; - } - - /** - * Check if field has a changeset. - * - * @return boolean - */ - public function hasChangedField($field) - { - return isset($this->entityChangeSet[$field]); - } - - /** - * Get the old value of the changeset of the changed field. - * - * @param string $field - * @return mixed - */ - public function getOldValue($field) - { - $this->assertValidField($field); - - return $this->entityChangeSet[$field][0]; - } - - /** - * Get the new value of the changeset of the changed field. - * - * @param string $field - * @return mixed - */ - public function getNewValue($field) - { - $this->assertValidField($field); - - return $this->entityChangeSet[$field][1]; - } - - /** - * Set the new value of this field. - * - * @param string $field - * @param mixed $value - */ - public function setNewValue($field, $value) - { - $this->assertValidField($field); - - $this->entityChangeSet[$field][1] = $value; - } - - /** - * Assert the field exists in changeset. - * - * @param string $field - */ - private function assertValidField($field) - { - if ( ! isset($this->entityChangeSet[$field])) { - throw new \InvalidArgumentException(sprintf( - 'Field "%s" is not a valid field of the entity "%s" in PreUpdateEventArgs.', - $field, - get_class($this->getEntity()) - )); - } - } -} - diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/ManagerRegistry.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/ManagerRegistry.php deleted file mode 100644 index 4d92426..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/ManagerRegistry.php +++ /dev/null @@ -1,112 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -/** - * Contract covering object managers for a Doctrine persistence layer ManagerRegistry class to implement. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.2 - * @author Fabien Potencier - * @author Benjamin Eberlei - * @author Lukas Kahwe Smith - */ -interface ManagerRegistry extends ConnectionRegistry -{ - /** - * Gets the default object manager name. - * - * @return string The default object manager name - */ - function getDefaultManagerName(); - - /** - * Gets a named object manager. - * - * @param string $name The object manager name (null for the default one) - * - * @return \Doctrine\Common\Persistence\ObjectManager - */ - function getManager($name = null); - - /** - * Gets an array of all registered object managers - * - * @return array An array of ObjectManager instances - */ - function getManagers(); - - /** - * Resets a named object manager. - * - * This method is useful when an object manager has been closed - * because of a rollbacked transaction AND when you think that - * it makes sense to get a new one to replace the closed one. - * - * Be warned that you will get a brand new object manager as - * the existing one is not useable anymore. This means that any - * other object with a dependency on this object manager will - * hold an obsolete reference. You can inject the registry instead - * to avoid this problem. - * - * @param string $name The object manager name (null for the default one) - * - * @return \Doctrine\Common\Persistence\ObjectManager - */ - function resetManager($name = null); - - /** - * Resolves a registered namespace alias to the full namespace. - * - * This method looks for the alias in all registered object managers. - * - * @param string $alias The alias - * - * @return string The full namespace - */ - function getAliasNamespace($alias); - - /** - * Gets all connection names. - * - * @return array An array of connection names - */ - function getManagerNames(); - - /** - * Gets the ObjectRepository for an persistent object. - * - * @param string $persistentObject The name of the persistent object. - * @param string $persistentManagerName The object manager name (null for the default one) - * - * @return \Doctrine\Common\Persistence\ObjectRepository - */ - function getRepository($persistentObject, $persistentManagerName = null); - - /** - * Gets the object manager associated with a given class. - * - * @param string $class A persistent object class name - * - * @return \Doctrine\Common\Persistence\ObjectManager|null - */ - function getManagerForClass($class); -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php deleted file mode 100644 index a2a6185..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php +++ /dev/null @@ -1,359 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -use Doctrine\Common\Cache\Cache; - -/** - * The ClassMetadataFactory is used to create ClassMetadata objects that contain all the - * metadata mapping informations of a class which describes how a class should be mapped - * to a relational database. - * - * This class was abstracted from the ORM ClassMetadataFactory - * - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -abstract class AbstractClassMetadataFactory implements ClassMetadataFactory -{ - /** - * Salt used by specific Object Manager implementation. - * - * @var string - */ - protected $cacheSalt = "\$CLASSMETADATA"; - - /** - * @var \Doctrine\Common\Cache\Cache - */ - private $cacheDriver; - - /** - * @var array - */ - private $loadedMetadata = array(); - - /** - * @var bool - */ - protected $initialized = false; - - /** - * @var ReflectionService - */ - private $reflectionService; - - /** - * Sets the cache driver used by the factory to cache ClassMetadata instances. - * - * @param Doctrine\Common\Cache\Cache $cacheDriver - */ - public function setCacheDriver(Cache $cacheDriver = null) - { - $this->cacheDriver = $cacheDriver; - } - - /** - * Gets the cache driver used by the factory to cache ClassMetadata instances. - * - * @return Doctrine\Common\Cache\Cache - */ - public function getCacheDriver() - { - return $this->cacheDriver; - } - - /** - * Return an array of all the loaded metadata currently in memory. - * - * @return array - */ - public function getLoadedMetadata() - { - return $this->loadedMetadata; - } - - /** - * Forces the factory to load the metadata of all classes known to the underlying - * mapping driver. - * - * @return array The ClassMetadata instances of all mapped classes. - */ - public function getAllMetadata() - { - if ( ! $this->initialized) { - $this->initialize(); - } - - $driver = $this->getDriver(); - $metadata = array(); - foreach ($driver->getAllClassNames() as $className) { - $metadata[] = $this->getMetadataFor($className); - } - - return $metadata; - } - - /** - * Lazy initialization of this stuff, especially the metadata driver, - * since these are not needed at all when a metadata cache is active. - * - * @return void - */ - abstract protected function initialize(); - - /** - * Get the fully qualified class-name from the namespace alias. - * - * @param string $namespaceAlias - * @param string $simpleClassName - * @return string - */ - abstract protected function getFqcnFromAlias($namespaceAlias, $simpleClassName); - - /** - * Return the mapping driver implementation. - * - * @return MappingDriver - */ - abstract protected function getDriver(); - - /** - * Wakeup reflection after ClassMetadata gets unserialized from cache. - * - * @param ClassMetadata $class - * @param ReflectionService $reflService - * @return void - */ - abstract protected function wakeupReflection(ClassMetadata $class, ReflectionService $reflService); - - /** - * Initialize Reflection after ClassMetadata was constructed. - * - * @param ClassMetadata $class - * @param ReflectionSErvice $reflService - * @return void - */ - abstract protected function initializeReflection(ClassMetadata $class, ReflectionService $reflService); - - /** - * Gets the class metadata descriptor for a class. - * - * @param string $className The name of the class. - * @return Doctrine\Common\Persistence\Mapping\ClassMetadata - */ - public function getMetadataFor($className) - { - if ( ! isset($this->loadedMetadata[$className])) { - $realClassName = $className; - - // Check for namespace alias - if (strpos($className, ':') !== false) { - list($namespaceAlias, $simpleClassName) = explode(':', $className); - $realClassName = $this->getFqcnFromAlias($namespaceAlias, $simpleClassName); - - if (isset($this->loadedMetadata[$realClassName])) { - // We do not have the alias name in the map, include it - $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName]; - - return $this->loadedMetadata[$realClassName]; - } - } - - if ($this->cacheDriver) { - if (($cached = $this->cacheDriver->fetch($realClassName . $this->cacheSalt)) !== false) { - $this->loadedMetadata[$realClassName] = $cached; - $this->wakeupReflection($cached, $this->getReflectionService()); - } else { - foreach ($this->loadMetadata($realClassName) as $loadedClassName) { - $this->cacheDriver->save( - $loadedClassName . $this->cacheSalt, $this->loadedMetadata[$loadedClassName], null - ); - } - } - } else { - $this->loadMetadata($realClassName); - } - - if ($className != $realClassName) { - // We do not have the alias name in the map, include it - $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName]; - } - } - - return $this->loadedMetadata[$className]; - } - - /** - * Checks whether the factory has the metadata for a class loaded already. - * - * @param string $className - * @return boolean TRUE if the metadata of the class in question is already loaded, FALSE otherwise. - */ - public function hasMetadataFor($className) - { - return isset($this->loadedMetadata[$className]); - } - - /** - * Sets the metadata descriptor for a specific class. - * - * NOTE: This is only useful in very special cases, like when generating proxy classes. - * - * @param string $className - * @param ClassMetadata $class - */ - public function setMetadataFor($className, $class) - { - $this->loadedMetadata[$className] = $class; - } - - /** - * Get array of parent classes for the given entity class - * - * @param string $name - * @return array $parentClasses - */ - protected function getParentClasses($name) - { - // Collect parent classes, ignoring transient (not-mapped) classes. - $parentClasses = array(); - foreach (array_reverse($this->getReflectionService()->getParentClasses($name)) as $parentClass) { - if ( ! $this->getDriver()->isTransient($parentClass)) { - $parentClasses[] = $parentClass; - } - } - return $parentClasses; - } - - /** - * Loads the metadata of the class in question and all it's ancestors whose metadata - * is still not loaded. - * - * @param string $name The name of the class for which the metadata should get loaded. - * @param array $tables The metadata collection to which the loaded metadata is added. - */ - protected function loadMetadata($name) - { - if ( ! $this->initialized) { - $this->initialize(); - } - - $loaded = array(); - - $parentClasses = $this->getParentClasses($name); - $parentClasses[] = $name; - - // Move down the hierarchy of parent classes, starting from the topmost class - $parent = null; - $rootEntityFound = false; - $visited = array(); - $reflService = $this->getReflectionService(); - foreach ($parentClasses as $className) { - if (isset($this->loadedMetadata[$className])) { - $parent = $this->loadedMetadata[$className]; - if (isset($parent->isMappedSuperclass) && $parent->isMappedSuperclass === false) { - $rootEntityFound = true; - array_unshift($visited, $className); - } - continue; - } - - $class = $this->newClassMetadataInstance($className); - $this->initializeReflection($class, $reflService); - - $this->doLoadMetadata($class, $parent, $rootEntityFound); - - $this->loadedMetadata[$className] = $class; - - $parent = $class; - - if (isset($parent->isMappedSuperclass) && $class->isMappedSuperclass === false) { - $rootEntityFound = true; - array_unshift($visited, $className); - } - - $this->wakeupReflection($class, $reflService); - - $loaded[] = $className; - } - - return $loaded; - } - - /** - * Actually load the metadata from the underlying metadata - * - * @param ClassMetadata $class - * @param ClassMetadata $parent - * @param bool $rootEntityFound - * @return void - */ - abstract protected function doLoadMetadata($class, $parent, $rootEntityFound); - - /** - * Creates a new ClassMetadata instance for the given class name. - * - * @param string $className - * @return ClassMetadata - */ - abstract protected function newClassMetadataInstance($className); - - /** - * Check if this class is mapped by this Object Manager + ClassMetadata configuration - * - * @param $class - * @return bool - */ - public function isTransient($class) - { - if ( ! $this->initialized) { - $this->initialize(); - } - - return $this->getDriver()->isTransient($class); - } - - /** - * Set reflectionService. - * - * @param ReflectionService $reflectionService - */ - public function setReflectionService(ReflectionService $reflectionService) - { - $this->reflectionService = $reflectionService; - } - - /** - * Get the reflection service associated with this metadata factory. - * - * @return ReflectionService - */ - public function getReflectionService() - { - if ($this->reflectionService === null) { - $this->reflectionService = new RuntimeReflectionService(); - } - return $this->reflectionService; - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php deleted file mode 100644 index 705d59a..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php +++ /dev/null @@ -1,165 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -/** - * Contract for a Doctrine persistence layer ClassMetadata class to implement. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.1 - * @author Benjamin Eberlei - * @author Jonathan Wage - */ -interface ClassMetadata -{ - /** - * Get fully-qualified class name of this persistent class. - * - * @return string - */ - function getName(); - - /** - * Gets the mapped identifier field name. - * - * The returned structure is an array of the identifier field names. - * - * @return array - */ - function getIdentifier(); - - /** - * Gets the ReflectionClass instance for this mapped class. - * - * @return ReflectionClass - */ - function getReflectionClass(); - - /** - * Checks if the given field name is a mapped identifier for this class. - * - * @param string $fieldName - * @return boolean - */ - function isIdentifier($fieldName); - - /** - * Checks if the given field is a mapped property for this class. - * - * @param string $fieldName - * @return boolean - */ - function hasField($fieldName); - - /** - * Checks if the given field is a mapped association for this class. - * - * @param string $fieldName - * @return boolean - */ - function hasAssociation($fieldName); - - /** - * Checks if the given field is a mapped single valued association for this class. - * - * @param string $fieldName - * @return boolean - */ - function isSingleValuedAssociation($fieldName); - - /** - * Checks if the given field is a mapped collection valued association for this class. - * - * @param string $fieldName - * @return boolean - */ - function isCollectionValuedAssociation($fieldName); - - /** - * A numerically indexed list of field names of this persistent class. - * - * This array includes identifier fields if present on this class. - * - * @return array - */ - function getFieldNames(); - - /** - * Returns an array of identifier field names numerically indexed. - * - * @return array - */ - function getIdentifierFieldNames(); - - /** - * A numerically indexed list of association names of this persistent class. - * - * This array includes identifier associations if present on this class. - * - * @return array - */ - function getAssociationNames(); - - /** - * Returns a type name of this field. - * - * This type names can be implementation specific but should at least include the php types: - * integer, string, boolean, float/double, datetime. - * - * @param string $fieldName - * @return string - */ - function getTypeOfField($fieldName); - - /** - * Returns the target class name of the given association. - * - * @param string $assocName - * @return string - */ - function getAssociationTargetClass($assocName); - - /** - * Checks if the association is the inverse side of a bidirectional association - * - * @param string $assocName - * @return boolean - */ - function isAssociationInverseSide($assocName); - - /** - * Returns the target field of the owning side of the association - * - * @param string $assocName - * @return string - */ - function getAssociationMappedByTargetField($assocName); - - /** - * Return the identifier of this object as an array with field name as key. - * - * Has to return an empty array if no identifier isset. - * - * @param object $object - * @return array - */ - function getIdentifierValues($object); -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php deleted file mode 100644 index bf27ba9..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php +++ /dev/null @@ -1,74 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -/** - * Contract for a Doctrine persistence layer ClassMetadata class to implement. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.1 - * @author Benjamin Eberlei - * @author Jonathan Wage - */ -interface ClassMetadataFactory -{ - /** - * Forces the factory to load the metadata of all classes known to the underlying - * mapping driver. - * - * @return array The ClassMetadata instances of all mapped classes. - */ - function getAllMetadata(); - - /** - * Gets the class metadata descriptor for a class. - * - * @param string $className The name of the class. - * @return ClassMetadata - */ - function getMetadataFor($className); - - /** - * Checks whether the factory has the metadata for a class loaded already. - * - * @param string $className - * @return boolean TRUE if the metadata of the class in question is already loaded, FALSE otherwise. - */ - function hasMetadataFor($className); - - /** - * Sets the metadata descriptor for a specific class. - * - * @param string $className - * @param ClassMetadata $class - */ - function setMetadataFor($className, $class); - - /** - * Whether the class with the specified name should have its metadata loaded. - * This is only the case if it is either mapped directly or as a - * MappedSuperclass. - * - * @param string $className - * @return boolean - */ - function isTransient($className); -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php deleted file mode 100644 index f52d37e..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php +++ /dev/null @@ -1,214 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Cache\ArrayCache, - Doctrine\Common\Annotations\AnnotationReader, - Doctrine\Common\Annotations\AnnotationRegistry, - Doctrine\Common\Persistence\Mapping\MappingException; - -/** - * The AnnotationDriver reads the mapping metadata from docblock annotations. - * - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -abstract class AnnotationDriver implements MappingDriver -{ - /** - * The AnnotationReader. - * - * @var AnnotationReader - */ - protected $reader; - - /** - * The paths where to look for mapping files. - * - * @var array - */ - protected $paths = array(); - - /** - * The file extension of mapping documents. - * - * @var string - */ - protected $fileExtension = '.php'; - - /** - * Cache for AnnotationDriver#getAllClassNames() - * - * @var array - */ - protected $classNames; - - /** - * Name of the entity annotations as keys - * - * @var array - */ - protected $entityAnnotationClasses = array(); - - /** - * Initializes a new AnnotationDriver that uses the given AnnotationReader for reading - * docblock annotations. - * - * @param AnnotationReader $reader The AnnotationReader to use, duck-typed. - * @param string|array $paths One or multiple paths where mapping classes can be found. - */ - public function __construct($reader, $paths = null) - { - $this->reader = $reader; - if ($paths) { - $this->addPaths((array) $paths); - } - } - - /** - * Append lookup paths to metadata driver. - * - * @param array $paths - */ - public function addPaths(array $paths) - { - $this->paths = array_unique(array_merge($this->paths, $paths)); - } - - /** - * Retrieve the defined metadata lookup paths. - * - * @return array - */ - public function getPaths() - { - return $this->paths; - } - - /** - * Retrieve the current annotation reader - * - * @return AnnotationReader - */ - public function getReader() - { - return $this->reader; - } - - /** - * Get the file extension used to look for mapping files under - * - * @return void - */ - public function getFileExtension() - { - return $this->fileExtension; - } - - /** - * Set the file extension used to look for mapping files under - * - * @param string $fileExtension The file extension to set - * @return void - */ - public function setFileExtension($fileExtension) - { - $this->fileExtension = $fileExtension; - } - - /** - * Whether the class with the specified name is transient. Only non-transient - * classes, that is entities and mapped superclasses, should have their metadata loaded. - * - * A class is non-transient if it is annotated with an annotation - * from the {@see AnnotationDriver::entityAnnotationClasses}. - * - * @param string $className - * @return boolean - */ - public function isTransient($className) - { - $classAnnotations = $this->reader->getClassAnnotations(new \ReflectionClass($className)); - - foreach ($classAnnotations as $annot) { - if (isset($this->entityAnnotationClasses[get_class($annot)])) { - return false; - } - } - return true; - } - - /** - * {@inheritDoc} - */ - public function getAllClassNames() - { - if ($this->classNames !== null) { - return $this->classNames; - } - - if (!$this->paths) { - throw MappingException::pathRequired(); - } - - $classes = array(); - $includedFiles = array(); - - foreach ($this->paths as $path) { - if ( ! is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); - } - - $iterator = new \RegexIterator( - new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS), - \RecursiveIteratorIterator::LEAVES_ONLY - ), - '/^.+' . str_replace('.', '\.', $this->fileExtension) . '$/i', - \RecursiveRegexIterator::GET_MATCH - ); - - foreach ($iterator as $file) { - $sourceFile = realpath($file[0]); - - require_once $sourceFile; - - $includedFiles[] = $sourceFile; - } - } - - $declared = get_declared_classes(); - - foreach ($declared as $className) { - $rc = new \ReflectionClass($className); - $sourceFile = $rc->getFileName(); - if (in_array($sourceFile, $includedFiles) && ! $this->isTransient($className)) { - $classes[] = $className; - } - } - - $this->classNames = $classes; - - return $classes; - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php deleted file mode 100644 index efaf545..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php +++ /dev/null @@ -1,169 +0,0 @@ -. -*/ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\MappingException; - -/** - * Locate the file that contains the metadata information for a given class name. - * - * This behavior is inpependent of the actual content of the file. It just detects - * the file which is responsible for the given class name. - * - * @author Benjamin Eberlei - * @author Johannes M. Schmitt - */ -class DefaultFileLocator implements FileLocator -{ - /** - * The paths where to look for mapping files. - * - * @var array - */ - protected $paths = array(); - - /** - * The file extension of mapping documents. - * - * @var string - */ - protected $fileExtension; - - /** - * Initializes a new FileDriver that looks in the given path(s) for mapping - * documents and operates in the specified operating mode. - * - * @param string|array $paths One or multiple paths where mapping documents can be found. - */ - public function __construct($paths, $fileExtension = null) - { - $this->addPaths((array) $paths); - $this->fileExtension = $fileExtension; - } - - /** - * Append lookup paths to metadata driver. - * - * @param array $paths - */ - public function addPaths(array $paths) - { - $this->paths = array_unique(array_merge($this->paths, $paths)); - } - - /** - * Retrieve the defined metadata lookup paths. - * - * @return array - */ - public function getPaths() - { - return $this->paths; - } - - /** - * Get the file extension used to look for mapping files under - * - * @return void - */ - public function getFileExtension() - { - return $this->fileExtension; - } - - /** - * Set the file extension used to look for mapping files under - * - * @param string $fileExtension The file extension to set - * @return void - */ - public function setFileExtension($fileExtension) - { - $this->fileExtension = $fileExtension; - } - - /** - * {@inheritDoc} - */ - public function findMappingFile($className) - { - $fileName = str_replace('\\', '.', $className) . $this->fileExtension; - - // Check whether file exists - foreach ($this->paths as $path) { - if (file_exists($path . DIRECTORY_SEPARATOR . $fileName)) { - return $path . DIRECTORY_SEPARATOR . $fileName; - } - } - - throw MappingException::mappingFileNotFound($className, $fileName); - } - - /** - * {@inheritDoc} - */ - public function getAllClassNames($globalBasename) - { - $classes = array(); - - if ($this->paths) { - foreach ($this->paths as $path) { - if ( ! is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); - } - - $iterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - - foreach ($iterator as $file) { - $fileName = $file->getBasename($this->fileExtension); - - if ($fileName == $file->getBasename() || $fileName == $globalBasename) { - continue; - } - - // NOTE: All files found here means classes are not transient! - $classes[] = str_replace('.', '\\', $fileName); - } - } - } - - return $classes; - } - - /** - * {@inheritDoc} - */ - public function fileExists($className) - { - $fileName = str_replace('\\', '.', $className) . $this->fileExtension; - - // Check whether file exists - foreach ((array) $this->paths as $path) { - if (file_exists($path . DIRECTORY_SEPARATOR . $fileName)) { - return true; - } - } - - return false; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php deleted file mode 100644 index 22cf117..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php +++ /dev/null @@ -1,178 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\MappingException; - -/** - * Base driver for file-based metadata drivers. - * - * A file driver operates in a mode where it loads the mapping files of individual - * classes on demand. This requires the user to adhere to the convention of 1 mapping - * file per class and the file names of the mapping files must correspond to the full - * class name, including namespace, with the namespace delimiters '\', replaced by dots '.'. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -abstract class FileDriver implements MappingDriver -{ - /** - * @var FileLocator - */ - protected $locator; - - /** - * @var array - */ - protected $classCache; - - /** - * @var string - */ - protected $globalBasename; - - /** - * Initializes a new FileDriver that looks in the given path(s) for mapping - * documents and operates in the specified operating mode. - * - * @param string|array|FileLocator $paths A FileLocator or one/multiple paths where mapping documents can be found. - * @param string $fileExtension - */ - public function __construct($locator, $fileExtension = null) - { - if ($locator instanceof FileLocator) { - $this->locator = $locator; - } else { - $this->locator = new DefaultFileLocator((array)$locator, $fileExtension); - } - } - - public function setGlobalBasename($file) - { - $this->globalBasename = $file; - } - - public function getGlobalBasename() - { - return $this->globalBasename; - } - - /** - * Get the element of schema meta data for the class from the mapping file. - * This will lazily load the mapping file if it is not loaded yet - * - * @return array $element The element of schema meta data - */ - public function getElement($className) - { - if ($this->classCache === null) { - $this->initialize(); - } - - if (isset($this->classCache[$className])) { - return $this->classCache[$className]; - } - - $result = $this->loadMappingFile($this->locator->findMappingFile($className)); - - return $result[$className]; - } - - /** - * Whether the class with the specified name should have its metadata loaded. - * This is only the case if it is either mapped as an Entity or a - * MappedSuperclass. - * - * @param string $className - * @return boolean - */ - public function isTransient($className) - { - if ($this->classCache === null) { - $this->initialize(); - } - - if (isset($this->classCache[$className])) { - return false; - } - - return !$this->locator->fileExists($className); - } - - /** - * Gets the names of all mapped classes known to this driver. - * - * @return array The names of all mapped classes known to this driver. - */ - public function getAllClassNames() - { - if ($this->classCache === null) { - $this->initialize(); - } - - $classNames = (array)$this->locator->getAllClassNames($this->globalBasename); - if ($this->classCache) { - $classNames = array_merge(array_keys($this->classCache), $classNames); - } - return $classNames; - } - - /** - * Loads a mapping file with the given name and returns a map - * from class/entity names to their corresponding file driver elements. - * - * @param string $file The mapping file to load. - * @return array - */ - abstract protected function loadMappingFile($file); - - /** - * Initialize the class cache from all the global files. - * - * Using this feature adds a substantial performance hit to file drivers as - * more metadata has to be loaded into memory than might actually be - * necessary. This may not be relevant to scenarios where caching of - * metadata is in place, however hits very hard in scenarios where no - * caching is used. - * - * @return void - */ - protected function initialize() - { - $this->classCache = array(); - if (null !== $this->globalBasename) { - foreach ($this->locator->getPaths() as $path) { - $file = $path.'/'.$this->globalBasename.$this->locator->getFileExtension(); - if (is_file($file)) { - $this->classCache = array_merge( - $this->classCache, - $this->loadMappingFile($file) - ); - } - } - } - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php deleted file mode 100644 index a1019d7..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php +++ /dev/null @@ -1,69 +0,0 @@ -. -*/ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -/** - * Locate the file that contains the metadata information for a given class name. - * - * This behavior is inpependent of the actual content of the file. It just detects - * the file which is responsible for the given class name. - * - * @author Benjamin Eberlei - * @author Johannes M. Schmitt - */ -interface FileLocator -{ - /** - * Locate mapping file for the given class name. - * - * @param string $className - * @return string - */ - function findMappingFile($className); - - /** - * Get all class names that are found with this file locator. - * - * @param string $globalBasename Passed to allow excluding the basename - * @return array - */ - function getAllClassNames($globalBasename); - - /** - * Check if a file can be found for this class name. - * - * @return bool - */ - function fileExists($className); - - /** - * Get all the paths that this file locator looks for mapping files. - * - * @return array - */ - function getPaths(); - - /** - * Get the file extension that mapping files are suffixed with. - * - * @return string - */ - function getFileExtension(); -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php deleted file mode 100644 index c050d32..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php +++ /dev/null @@ -1,56 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\ClassMetadata; - -/** - * Contract for metadata drivers. - * - * @since 2.2 - * @author Jonathan H. Wage - */ -interface MappingDriver -{ - /** - * Loads the metadata for the specified class into the provided container. - * - * @param string $className - * @param ClassMetadata $metadata - */ - function loadMetadataForClass($className, ClassMetadata $metadata); - - /** - * Gets the names of all mapped classes known to this driver. - * - * @return array The names of all mapped classes known to this driver. - */ - function getAllClassNames(); - - /** - * Whether the class with the specified name should have its metadata loaded. - * This is only the case if it is either mapped as an Entity or a - * MappedSuperclass. - * - * @param string $className - * @return boolean - */ - function isTransient($className); -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php deleted file mode 100644 index c7c1452..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php +++ /dev/null @@ -1,125 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver, - Doctrine\Common\Persistence\Mapping\ClassMetadata, - Doctrine\Common\Persistence\Mapping\MappingException; - -/** - * The DriverChain allows you to add multiple other mapping drivers for - * certain namespaces - * - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -class MappingDriverChain implements MappingDriver -{ - /** - * @var array - */ - private $drivers = array(); - - /** - * Add a nested driver. - * - * @param Driver $nestedDriver - * @param string $namespace - */ - public function addDriver(MappingDriver $nestedDriver, $namespace) - { - $this->drivers[$namespace] = $nestedDriver; - } - - /** - * Get the array of nested drivers. - * - * @return array $drivers - */ - public function getDrivers() - { - return $this->drivers; - } - - /** - * Loads the metadata for the specified class into the provided container. - * - * @param string $className - * @param ClassMetadataInfo $metadata - */ - public function loadMetadataForClass($className, ClassMetadata $metadata) - { - foreach ($this->drivers as $namespace => $driver) { - if (strpos($className, $namespace) === 0) { - $driver->loadMetadataForClass($className, $metadata); - return; - } - } - - throw MappingException::classNotFoundInNamespaces($className, array_keys($this->drivers)); - } - - /** - * Gets the names of all mapped classes known to this driver. - * - * @return array The names of all mapped classes known to this driver. - */ - public function getAllClassNames() - { - $classNames = array(); - $driverClasses = array(); - foreach ($this->drivers AS $namespace => $driver) { - $oid = spl_object_hash($driver); - if (!isset($driverClasses[$oid])) { - $driverClasses[$oid] = $driver->getAllClassNames(); - } - - foreach ($driverClasses[$oid] AS $className) { - if (strpos($className, $namespace) === 0) { - $classNames[$className] = true; - } - } - } - return array_keys($classNames); - } - - /** - * Whether the class with the specified name should have its metadata loaded. - * - * This is only the case for non-transient classes either mapped as an Entity or MappedSuperclass. - * - * @param string $className - * @return boolean - */ - public function isTransient($className) - { - foreach ($this->drivers AS $namespace => $driver) { - if (strpos($className, $namespace) === 0) { - return $driver->isTransient($className); - } - } - - // class isTransient, i.e. not an entity or mapped superclass - return true; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php deleted file mode 100644 index 7751dae..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php +++ /dev/null @@ -1,70 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\ClassMetadata; - -/** - * The PHPDriver includes php files which just populate ClassMetadataInfo - * instances with plain php code - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -class PHPDriver extends FileDriver -{ - /** - * {@inheritdoc} - */ - protected $metadata; - - /** - * {@inheritDoc} - */ - public function __construct($locator, $fileExtension = null) - { - $fileExtension = ".php"; - parent::__construct($locator, $fileExtension); - } - - /** - * {@inheritdoc} - */ - public function loadMetadataForClass($className, ClassMetadata $metadata) - { - $this->metadata = $metadata; - $this->loadMappingFile($this->locator->findMappingFile($className)); - } - - /** - * {@inheritdoc} - */ - protected function loadMappingFile($file) - { - $metadata = $this->metadata; - include $file; - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php deleted file mode 100644 index 9103ed8..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php +++ /dev/null @@ -1,131 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\ClassMetadata; -use Doctrine\Common\Persistence\Mapping\MappingException; - -/** - * The StaticPHPDriver calls a static loadMetadata() method on your entity - * classes where you can manually populate the ClassMetadata instance. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -class StaticPHPDriver implements MappingDriver -{ - /** - * Paths of entity directories. - * - * @var array - */ - private $paths = array(); - - /** - * Map of all class names. - * - * @var array - */ - private $classNames; - - public function __construct($paths) - { - $this->addPaths((array) $paths); - } - - public function addPaths(array $paths) - { - $this->paths = array_unique(array_merge($this->paths, $paths)); - } - - /** - * {@inheritdoc} - */ - public function loadMetadataForClass($className, ClassMetadata $metadata) - { - $className::loadMetadata($metadata); - } - - /** - * {@inheritDoc} - * @todo Same code exists in AnnotationDriver, should we re-use it somehow or not worry about it? - */ - public function getAllClassNames() - { - if ($this->classNames !== null) { - return $this->classNames; - } - - if (!$this->paths) { - throw MappingException::pathRequired(); - } - - $classes = array(); - $includedFiles = array(); - - foreach ($this->paths as $path) { - if (!is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); - } - - $iterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - - foreach ($iterator as $file) { - if ($file->getBasename('.php') == $file->getBasename()) { - continue; - } - - $sourceFile = realpath($file->getPathName()); - require_once $sourceFile; - $includedFiles[] = $sourceFile; - } - } - - $declared = get_declared_classes(); - - foreach ($declared as $className) { - $rc = new \ReflectionClass($className); - $sourceFile = $rc->getFileName(); - if (in_array($sourceFile, $includedFiles) && !$this->isTransient($className)) { - $classes[] = $className; - } - } - - $this->classNames = $classes; - - return $classes; - } - - /** - * {@inheritdoc} - */ - public function isTransient($className) - { - return ! method_exists($className, 'loadMetadata'); - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php deleted file mode 100644 index d338cf6..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php +++ /dev/null @@ -1,198 +0,0 @@ -. -*/ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\MappingException; - -/** - * The Symfony File Locator makes a simplifying assumptions compared - * to the DefaultFileLocator. By assuming paths only contain entities of a certain - * namespace the mapping files consists of the short classname only. - * - * @author Fabien Potencier - * @author Benjamin Eberlei - * @license MIT - */ -class SymfonyFileLocator implements FileLocator -{ - /** - * The paths where to look for mapping files. - * - * @var array - */ - protected $paths = array(); - - /** - * A map of mapping directory path to namespace prefix used to expand class shortnames. - * - * @var array - */ - protected $prefixes = array(); - - /** - * File extension that is searched for. - * - * @var string - */ - protected $fileExtension; - - public function __construct(array $prefixes, $fileExtension = null) - { - $this->addNamespacePrefixes($prefixes); - $this->fileExtension = $fileExtension; - } - - public function addNamespacePrefixes(array $prefixes) - { - $this->prefixes = array_merge($this->prefixes, $prefixes); - $this->paths = array_merge($this->paths, array_keys($prefixes)); - } - - public function getNamespacePrefixes() - { - return $this->prefixes; - } - - /** - * {@inheritDoc} - */ - public function getPaths() - { - return $this->paths; - } - - /** - * {@inheritDoc} - */ - public function getFileExtension() - { - return $this->fileExtension; - } - - /** - * Set the file extension used to look for mapping files under - * - * @param string $fileExtension The file extension to set - * @return void - */ - public function setFileExtension($fileExtension) - { - $this->fileExtension = $fileExtension; - } - - /** - * {@inheritDoc} - */ - public function fileExists($className) - { - $defaultFileName = str_replace('\\', '.', $className).$this->fileExtension; - foreach ($this->paths as $path) { - if (!isset($this->prefixes[$path])) { - // global namespace class - if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) { - return true; - } - - continue; - } - - $prefix = $this->prefixes[$path]; - - if (0 !== strpos($className, $prefix.'\\')) { - continue; - } - - $filename = $path.'/'.strtr(substr($className, strlen($prefix)+1), '\\', '.').$this->fileExtension; - return is_file($filename); - } - - return false; - } - - /** - * {@inheritDoc} - */ - public function getAllClassNames($globalBasename = null) - { - $classes = array(); - - if ($this->paths) { - foreach ((array) $this->paths as $path) { - if (!is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); - } - - $iterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - - foreach ($iterator as $file) { - $fileName = $file->getBasename($this->fileExtension); - - if ($fileName == $file->getBasename() || $fileName == $globalBasename) { - continue; - } - - // NOTE: All files found here means classes are not transient! - if (isset($this->prefixes[$path])) { - $classes[] = $this->prefixes[$path].'\\'.str_replace('.', '\\', $fileName); - } else { - $classes[] = str_replace('.', '\\', $fileName); - } - } - } - } - - return $classes; - } - - /** - * {@inheritDoc} - */ - public function findMappingFile($className) - { - $defaultFileName = str_replace('\\', '.', $className).$this->fileExtension; - foreach ($this->paths as $path) { - if (!isset($this->prefixes[$path])) { - if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) { - return $path.DIRECTORY_SEPARATOR.$defaultFileName; - } - - continue; - } - - $prefix = $this->prefixes[$path]; - - if (0 !== strpos($className, $prefix.'\\')) { - continue; - } - - $filename = $path.'/'.strtr(substr($className, strlen($prefix)+1), '\\', '.').$this->fileExtension; - if (is_file($filename)) { - return $filename; - } - - throw MappingException::mappingFileNotFound($className, $filename); - } - - throw MappingException::mappingFileNotFound($className, substr($className, strrpos($className, '\\') + 1).$this->fileExtension); - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/MappingException.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/MappingException.php deleted file mode 100644 index 4ecd2ad..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/MappingException.php +++ /dev/null @@ -1,57 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -/** - * A MappingException indicates that something is wrong with the mapping setup. - * - * @since 2.2 - */ -class MappingException extends \Exception -{ - public static function classNotFoundInNamespaces($className, $namespaces) - { - return new self("The class '" . $className . "' was not found in the ". - "chain configured namespaces " . implode(", ", $namespaces)); - } - - public static function pathRequired() - { - return new self("Specifying the paths to your entities is required ". - "in the AnnotationDriver to retrieve all class names."); - } - - public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null) - { - if ( ! empty($path)) { - $path = '[' . $path . ']'; - } - - return new self( - 'File mapping drivers must have a valid directory path, ' . - 'however the given path ' . $path . ' seems to be incorrect!' - ); - } - - public static function mappingFileNotFound($entityName, $fileName) - { - return new self("No mapping file found named '$fileName' for class '$entityName'."); - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php deleted file mode 100644 index 4e0e312..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php +++ /dev/null @@ -1,80 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -/** - * Very simple reflection service abstraction. - * - * This is required inside metadata layers that may require either - * static or runtime reflection. - * - * @author Benjamin Eberlei - */ -interface ReflectionService -{ - /** - * Return an array of the parent classes (not interfaces) for the given class. - * - * @param string $class - * @return array - */ - function getParentClasses($class); - - /** - * Return the shortname of a class. - * - * @param string $class - * @return string - */ - function getClassShortName($class); - - /** - * @param string $class - * @return string - */ - function getClassNamespace($class); - - /** - * Return a reflection class instance or null - * - * @param string $class - * @return ReflectionClass|null - */ - function getClass($class); - - /** - * Return an accessible property (setAccessible(true)) or null. - * - * @param string $class - * @param string $property - * @return ReflectionProperty|null - */ - function getAccessibleProperty($class, $property); - - /** - * Check if the class have a public method with the given name. - * - * @param mixed $class - * @param mixed $method - * @return bool - */ - function hasPublicMethod($class, $method); -} - diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php deleted file mode 100644 index abcff58..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php +++ /dev/null @@ -1,102 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -use ReflectionClass; -use ReflectionProperty; - -/** - * PHP Runtime Reflection Service - * - * @author Benjamin Eberlei - */ -class RuntimeReflectionService implements ReflectionService -{ - /** - * Return an array of the parent classes (not interfaces) for the given class. - * - * @param string $class - * @return array - */ - public function getParentClasses($class) - { - return class_parents($class); - } - - /** - * Return the shortname of a class. - * - * @param string $class - * @return string - */ - public function getClassShortName($class) - { - $r = new ReflectionClass($class); - return $r->getShortName(); - } - - /** - * @param string $class - * @return string - */ - public function getClassNamespace($class) - { - $r = new ReflectionClass($class); - return $r->getNamespaceName(); - } - - /** - * Return a reflection class instance or null - * - * @param string $class - * @return ReflectionClass|null - */ - public function getClass($class) - { - return new ReflectionClass($class); - } - - /** - * Return an accessible property (setAccessible(true)) or null. - * - * @param string $class - * @param string $property - * @return ReflectionProperty|null - */ - public function getAccessibleProperty($class, $property) - { - $property = new ReflectionProperty($class, $property); - $property->setAccessible(true); - return $property; - } - - /** - * Check if the class have a public method with the given name. - * - * @param mixed $class - * @param mixed $method - * @return bool - */ - public function hasPublicMethod($class, $method) - { - return method_exists($class, $method) && is_callable(array($class, $method)); - } -} - diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php deleted file mode 100644 index 2de6e76..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php +++ /dev/null @@ -1,107 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -use ReflectionClass; -use ReflectionProperty; - -/** - * PHP Runtime Reflection Service - * - * @author Benjamin Eberlei - */ -class StaticReflectionService implements ReflectionService -{ - /** - * Return an array of the parent classes (not interfaces) for the given class. - * - * @param string $class - * @return array - */ - public function getParentClasses($class) - { - return array(); - } - - /** - * Return the shortname of a class. - * - * @param string $className - * @return string - */ - public function getClassShortName($className) - { - if (strpos($className, '\\') !== false) { - $className = substr($className, strrpos($className, "\\")+1); - } - return $className; - } - - /** - * Return the namespace of a class. - * - * @param string $className - * @return string - */ - public function getClassNamespace($className) - { - $namespace = ''; - if (strpos($className, '\\') !== false) { - $namespace = strrev(substr( strrev($className), strpos(strrev($className), '\\')+1 )); - } - return $namespace; - } - - /** - * Return a reflection class instance or null - * - * @param string $class - * @return ReflectionClass|null - */ - public function getClass($class) - { - return null; - } - - /** - * Return an accessible property (setAccessible(true)) or null. - * - * @param string $class - * @param string $property - * @return ReflectionProperty|null - */ - public function getAccessibleProperty($class, $property) - { - return null; - } - - /** - * Check if the class have a public method with the given name. - * - * @param mixed $class - * @param mixed $method - * @return bool - */ - public function hasPublicMethod($class, $method) - { - return method_exists($class, $method) && is_callable(array($class, $method)); - } -} - diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/ObjectManager.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/ObjectManager.php deleted file mode 100644 index 6d70fc1..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/ObjectManager.php +++ /dev/null @@ -1,143 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -/** - * Contract for a Doctrine persistence layer ObjectManager class to implement. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.1 - * @author Benjamin Eberlei - * @author Jonathan Wage - */ -interface ObjectManager -{ - /** - * Finds a object by its identifier. - * - * This is just a convenient shortcut for getRepository($className)->find($id). - * - * @param string - * @param mixed - * @return object - */ - function find($className, $id); - - /** - * Tells the ObjectManager to make an instance managed and persistent. - * - * The object will be entered into the database as a result of the flush operation. - * - * NOTE: The persist operation always considers objects that are not yet known to - * this ObjectManager as NEW. Do not pass detached objects to the persist operation. - * - * @param object $object The instance to make managed and persistent. - */ - function persist($object); - - /** - * Removes an object instance. - * - * A removed object will be removed from the database as a result of the flush operation. - * - * @param object $object The object instance to remove. - */ - function remove($object); - - /** - * Merges the state of a detached object into the persistence context - * of this ObjectManager and returns the managed copy of the object. - * The object passed to merge will not become associated/managed with this ObjectManager. - * - * @param object $object - */ - function merge($object); - - /** - * Detaches an object from the ObjectManager, causing a managed object to - * become detached. Unflushed changes made to the object if any - * (including removal of the object), will not be synchronized to the database. - * Objects which previously referenced the detached object will continue to - * reference it. - * - * @param object $object The object to detach. - */ - function detach($object); - - /** - * Refreshes the persistent state of an object from the database, - * overriding any local changes that have not yet been persisted. - * - * @param object $object The object to refresh. - */ - function refresh($object); - - /** - * Flushes all changes to objects that have been queued up to now to the database. - * This effectively synchronizes the in-memory state of managed objects with the - * database. - */ - function flush(); - - /** - * Gets the repository for a class. - * - * @param string $className - * @return \Doctrine\Common\Persistence\ObjectRepository - */ - function getRepository($className); - - /** - * Returns the ClassMetadata descriptor for a class. - * - * The class name must be the fully-qualified class name without a leading backslash - * (as it is returned by get_class($obj)). - * - * @param string $className - * @return \Doctrine\Common\Persistence\Mapping\ClassMetadata - */ - function getClassMetadata($className); - - /** - * Gets the metadata factory used to gather the metadata of classes. - * - * @return Doctrine\Common\Persistence\Mapping\ClassMetadataFactory - */ - function getMetadataFactory(); - - /** - * Helper method to initialize a lazy loading proxy or persistent collection. - * - * This method is a no-op for other objects. - * - * @param object $obj - */ - function initializeObject($obj); - - /** - * Check if the object is part of the current UnitOfWork and therefore - * managed. - * - * @param object $object - * @return bool - */ - function contains($object); -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/ObjectManagerAware.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/ObjectManagerAware.php deleted file mode 100644 index 015dd3d..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/ObjectManagerAware.php +++ /dev/null @@ -1,49 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -use Doctrine\Common\Persistence\Mapping\ClassMetadata; - -/** - * Makes a Persistent Objects aware of its own object-manager. - * - * Using this interface the managing object manager and class metadata instances - * are injected into the persistent object after construction. This allows - * you to implement ActiveRecord functionality on top of the persistance-ignorance - * that Doctrine propagates. - * - * Word of Warning: This is a very powerful hook to change how you can work with your domain models. - * Using this hook will break the Single Responsibility Principle inside your Domain Objects - * and increase the coupling of database and objects. - * - * Every ObjectManager has to implement this functionality itself. - * - * @author Benjamin Eberlei - */ -interface ObjectManagerAware -{ - /** - * Injects responsible ObjectManager and the ClassMetadata into this persistent object. - * - * @param ObjectManager $objectManager - * @param ClassMetadata $classMetadata - */ - public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata); -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/ObjectRepository.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/ObjectRepository.php deleted file mode 100644 index 2263328..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/ObjectRepository.php +++ /dev/null @@ -1,78 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -/** - * Contract for a Doctrine persistence layer ObjectRepository class to implement. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.1 - * @author Benjamin Eberlei - * @author Jonathan Wage - */ -interface ObjectRepository -{ - /** - * Finds an object by its primary key / identifier. - * - * @param $id The identifier. - * @return object The object. - */ - function find($id); - - /** - * Finds all objects in the repository. - * - * @return mixed The objects. - */ - function findAll(); - - /** - * Finds objects by a set of criteria. - * - * Optionally sorting and limiting details can be passed. An implementation may throw - * an UnexpectedValueException if certain values of the sorting or limiting details are - * not supported. - * - * @throws UnexpectedValueException - * @param array $criteria - * @param array|null $orderBy - * @param int|null $limit - * @param int|null $offset - * @return mixed The objects. - */ - function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null); - - /** - * Finds a single object by a set of criteria. - * - * @param array $criteria - * @return object The object. - */ - function findOneBy(array $criteria); - - /** - * Returns the class name of the object managed by the repository - * - * @return string - */ - function getClassName(); -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/PersistentObject.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/PersistentObject.php deleted file mode 100644 index 4274af6..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/PersistentObject.php +++ /dev/null @@ -1,233 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -use Doctrine\Common\Persistence\Mapping\ClassMetadata; -use Doctrine\Common\Collections\ArrayCollection; -use Doctrine\Common\Collections\Collection; - -/** - * PersistentObject base class that implements getter/setter methods for all mapped fields and associations - * by overriding __call. - * - * This class is a forward compatible implementation of the PersistentObject trait. - * - * - * Limitations: - * - * 1. All persistent objects have to be associated with a single ObjectManager, multiple - * ObjectManagers are not supported. You can set the ObjectManager with `PersistentObject#setObjectManager()`. - * 2. Setters and getters only work if a ClassMetadata instance was injected into the PersistentObject. - * This is either done on `postLoad` of an object or by accessing the global object manager. - * 3. There are no hooks for setters/getters. Just implement the method yourself instead of relying on __call(). - * 4. Slower than handcoded implementations: An average of 7 method calls per access to a field and 11 for an association. - * 5. Only the inverse side associations get autoset on the owning side aswell. Setting objects on the owning side - * will not set the inverse side associations. - * - * @example - * - * PersistentObject::setObjectManager($em); - * - * class Foo extends PersistentObject - * { - * private $id; - * } - * - * $foo = new Foo(); - * $foo->getId(); // method exists through __call - * - * @author Benjamin Eberlei - */ -abstract class PersistentObject implements ObjectManagerAware -{ - /** - * @var ObjectManager - */ - private static $objectManager; - - /** - * @var ClassMetadata - */ - private $cm; - - /** - * Set the object manager responsible for all persistent object base classes. - * - * @param ObjectManager $objectManager - */ - static public function setObjectManager(ObjectManager $objectManager = null) - { - self::$objectManager = $objectManager; - } - - /** - * @return ObjectManager - */ - static public function getObjectManager() - { - return self::$objectManager; - } - - /** - * Inject Doctrine Object Manager - * - * @param ObjectManager $objectManager - * @param ClassMetadata $classMetadata - */ - public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata) - { - if ($objectManager !== self::$objectManager) { - throw new \RuntimeException("Trying to use PersistentObject with different ObjectManager instances. " . - "Was PersistentObject::setObjectManager() called?"); - } - - $this->cm = $classMetadata; - } - - /** - * Sets a persistent fields value. - * - * @throws InvalidArgumentException - When the wrong target object type is passed to an association - * @throws BadMethodCallException - When no persistent field exists by that name. - * @param string $field - * @param array $args - * @return void - */ - private function set($field, $args) - { - $this->initializeDoctrine(); - - if ($this->cm->hasField($field) && !$this->cm->isIdentifier($field)) { - $this->$field = $args[0]; - } else if ($this->cm->hasAssociation($field) && $this->cm->isSingleValuedAssociation($field)) { - $targetClass = $this->cm->getAssociationTargetClass($field); - if (!($args[0] instanceof $targetClass) && $args[0] !== null) { - throw new \InvalidArgumentException("Expected persistent object of type '".$targetClass."'"); - } - $this->$field = $args[0]; - $this->completeOwningSide($field, $targetClass, $args[0]); - } else { - throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getName()."'"); - } - } - - /** - * Get persistent field value. - * - * @throws BadMethodCallException - When no persistent field exists by that name. - * @param string $field - * @return mixed - */ - private function get($field) - { - $this->initializeDoctrine(); - - if ( $this->cm->hasField($field) || $this->cm->hasAssociation($field) ) { - return $this->$field; - } else { - throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getName()."'"); - } - } - - /** - * If this is an inverse side association complete the owning side. - * - * @param string $field - * @param ClassMetadata $targetClass - * @param object $targetObject - */ - private function completeOwningSide($field, $targetClass, $targetObject) - { - // add this object on the owning side aswell, for obvious infinite recursion - // reasons this is only done when called on the inverse side. - if ($this->cm->isAssociationInverseSide($field)) { - $mappedByField = $this->cm->getAssociationMappedByTargetField($field); - $targetMetadata = self::$objectManager->getClassMetadata($targetClass); - - $setter = ($targetMetadata->isCollectionValuedAssociation($mappedByField) ? "add" : "set").$mappedByField; - $targetObject->$setter($this); - } - } - - /** - * Add an object to a collection - * - * @param type $field - * @param assoc $args - */ - private function add($field, $args) - { - $this->initializeDoctrine(); - - if ($this->cm->hasAssociation($field) && $this->cm->isCollectionValuedAssociation($field)) { - $targetClass = $this->cm->getAssociationTargetClass($field); - if (!($args[0] instanceof $targetClass)) { - throw new \InvalidArgumentException("Expected persistent object of type '".$targetClass."'"); - } - if (!($this->$field instanceof Collection)) { - $this->$field = new ArrayCollection($this->$field ?: array()); - } - $this->$field->add($args[0]); - $this->completeOwningSide($field, $targetClass, $args[0]); - } else { - throw new \BadMethodCallException("There is no method add".$field."() on ".$this->cm->getName()); - } - } - - /** - * Initialize Doctrine Metadata for this class. - * - * @return void - */ - private function initializeDoctrine() - { - if ($this->cm !== null) { - return; - } - - if (!self::$objectManager) { - throw new \RuntimeException("No runtime object manager set. Call PersistentObject#setObjectManager()."); - } - - $this->cm = self::$objectManager->getClassMetadata(get_class($this)); - } - - /** - * Magic method that implements - * - * @param string $method - * @param array $args - * @return mixed - */ - public function __call($method, $args) - { - $command = substr($method, 0, 3); - $field = lcfirst(substr($method, 3)); - if ($command == "set") { - $this->set($field, $args); - } else if ($command == "get") { - return $this->get($field); - } else if ($command == "add") { - $this->add($field, $args); - } else { - throw new \BadMethodCallException("There is no method ".$method." on ".$this->cm->getName()); - } - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Proxy.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Proxy.php deleted file mode 100644 index 726979f..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Persistence/Proxy.php +++ /dev/null @@ -1,60 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -/** - * Interface for proxy classes. - * - * @author Roman Borschel - * @since 2.2 - */ -interface Proxy -{ - /** - * Marker for Proxy class names. - * - * @var string - */ - const MARKER = '__CG__'; - - /** - * Length of the proxy marker - * - * @var int - */ - const MARKER_LENGTH = 6; - - /** - * Initialize this proxy if its not yet initialized. - * - * Acts as a no-op if already initialized. - * - * @return void - */ - public function __load(); - - /** - * Is this proxy initialized or not. - * - * @return bool - */ - public function __isInitialized(); -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/PropertyChangedListener.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/PropertyChangedListener.php deleted file mode 100644 index 87c5b41..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/PropertyChangedListener.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * Contract for classes that are potential listeners of a NotifyPropertyChanged - * implementor. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -interface PropertyChangedListener -{ - /** - * Notifies the listener of a property change. - * - * @param object $sender The object on which the property changed. - * @param string $propertyName The name of the property that changed. - * @param mixed $oldValue The old value of the property that changed. - * @param mixed $newValue The new value of the property that changed. - */ - function propertyChanged($sender, $propertyName, $oldValue, $newValue); -} - diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Util/ClassUtils.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Util/ClassUtils.php deleted file mode 100644 index c346278..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Util/ClassUtils.php +++ /dev/null @@ -1,103 +0,0 @@ -. - */ - -namespace Doctrine\Common\Util; - -use Doctrine\Common\Persistence\Proxy; - -/** - * Class and reflection related functionality for objects that - * might or not be proxy objects at the moment. - * - * @author Benjamin Eberlei - * @author Johannes Schmitt - */ -class ClassUtils -{ - /** - * Get the real class name of a class name that could be a proxy. - * - * @param string - * @return string - */ - public static function getRealClass($class) - { - if (false === $pos = strrpos($class, '\\'.Proxy::MARKER.'\\')) { - return $class; - } - - return substr($class, $pos + Proxy::MARKER_LENGTH + 2); - } - - /** - * Get the real class name of an object (even if its a proxy) - * - * @param object - * @return string - */ - public static function getClass($object) - { - return self::getRealClass(get_class($object)); - } - - /** - * Get the real parent class name of a class or object - * - * @param string - * @return string - */ - public static function getParentClass($className) - { - return get_parent_class( self::getRealClass( $className ) ); - } - - /** - * Create a new reflection class - * - * @param string - * @return ReflectionClass - */ - public static function newReflectionClass($class) - { - return new \ReflectionClass( self::getRealClass( $class ) ); - } - - /** - * Create a new reflection object - * - * @param object - * @return ReflectionObject - */ - public static function newReflectionObject($object) - { - return self::newReflectionClass( self::getClass( $object ) ); - } - - /** - * Given a class name and a proxy namespace return the proxy name. - * - * @param string $className - * @param string $proxyNamespace - * @return string - */ - public static function generateProxyClassName($className, $proxyNamespace) - { - return rtrim($proxyNamespace, '\\') . '\\'.Proxy::MARKER.'\\' . ltrim($className, '\\'); - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Util/Debug.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Util/Debug.php deleted file mode 100644 index 57ae312..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Util/Debug.php +++ /dev/null @@ -1,123 +0,0 @@ -. - */ - -namespace Doctrine\Common\Util; - -/** - * Static class containing most used debug methods. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Giorgio Sironi - */ -final class Debug -{ - /** - * Private constructor (prevents from instantiation) - * - */ - private function __construct() {} - - /** - * Prints a dump of the public, protected and private properties of $var. - * - * @static - * @link http://xdebug.org/ - * @param mixed $var - * @param integer $maxDepth Maximum nesting level for object properties - * @param boolean $stripTags Flag that indicate if output should strip HTML tags - */ - public static function dump($var, $maxDepth = 2, $stripTags = true) - { - ini_set('html_errors', 'On'); - - if (extension_loaded('xdebug')) { - ini_set('xdebug.var_display_max_depth', $maxDepth); - } - - $var = self::export($var, $maxDepth++); - - ob_start(); - var_dump($var); - $dump = ob_get_contents(); - ob_end_clean(); - - echo ($stripTags ? strip_tags(html_entity_decode($dump)) : $dump); - - ini_set('html_errors', 'Off'); - } - - public static function export($var, $maxDepth) - { - $return = null; - $isObj = is_object($var); - - if ($isObj && in_array('Doctrine\Common\Collections\Collection', class_implements($var))) { - $var = $var->toArray(); - } - - if ($maxDepth) { - if (is_array($var)) { - $return = array(); - - foreach ($var as $k => $v) { - $return[$k] = self::export($v, $maxDepth - 1); - } - } else if ($isObj) { - $return = new \stdclass(); - if ($var instanceof \DateTime) { - $return->__CLASS__ = "DateTime"; - $return->date = $var->format('c'); - $return->timezone = $var->getTimeZone()->getName(); - } else { - $reflClass = ClassUtils::newReflectionObject($var); - $return->__CLASS__ = ClassUtils::getClass($var); - - if ($var instanceof \Doctrine\Common\Persistence\Proxy) { - $return->__IS_PROXY__ = true; - $return->__PROXY_INITIALIZED__ = $var->__isInitialized(); - } - - foreach ($reflClass->getProperties() as $reflProperty) { - $name = $reflProperty->getName(); - - $reflProperty->setAccessible(true); - $return->$name = self::export($reflProperty->getValue($var), $maxDepth - 1); - } - } - } else { - $return = $var; - } - } else { - $return = is_object($var) ? get_class($var) - : (is_array($var) ? 'Array(' . count($var) . ')' : $var); - } - - return $return; - } - - public static function toString($obj) - { - return method_exists('__toString', $obj) ? (string) $obj : get_class($obj) . '@' . spl_object_hash($obj); - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Util/Inflector.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Util/Inflector.php deleted file mode 100644 index ba1eb17..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Util/Inflector.php +++ /dev/null @@ -1,72 +0,0 @@ -. - */ - -namespace Doctrine\Common\Util; - -/** - * Doctrine inflector has static methods for inflecting text - * - * The methods in these classes are from several different sources collected - * across several different php projects and several different authors. The - * original author names and emails are not known - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 1.0 - * @version $Revision: 3189 $ - * @author Konsta Vesterinen - * @author Jonathan H. Wage - */ -class Inflector -{ - /** - * Convert word in to the format for a Doctrine table name. Converts 'ModelName' to 'model_name' - * - * @param string $word Word to tableize - * @return string $word Tableized word - */ - public static function tableize($word) - { - return strtolower(preg_replace('~(?<=\\w)([A-Z])~', '_$1', $word)); - } - - /** - * Convert a word in to the format for a Doctrine class name. Converts 'table_name' to 'TableName' - * - * @param string $word Word to classify - * @return string $word Classified word - */ - public static function classify($word) - { - return str_replace(" ", "", ucwords(strtr($word, "_-", " "))); - } - - /** - * Camelize a word. This uses the classify() method and turns the first character to lowercase - * - * @param string $word - * @return string $word - */ - public static function camelize($word) - { - return lcfirst(self::classify($word)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Version.php b/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Version.php deleted file mode 100644 index b7c9a82..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/lib/Doctrine/Common/Version.php +++ /dev/null @@ -1,55 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * Class to store and retrieve the version of Doctrine - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class Version -{ - /** - * Current Doctrine Version - */ - const VERSION = '2.2.2'; - - /** - * Compares a Doctrine version with the current one. - * - * @param string $version Doctrine version to compare. - * @return int Returns -1 if older, 0 if it is the same, 1 if version - * passed as argument is newer. - */ - public static function compare($version) - { - $currentVersion = str_replace(' ', '', strtolower(self::VERSION)); - $version = str_replace(' ', '', $version); - - return version_compare($version, $currentVersion); - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/phpunit.xml.dist b/vendor/doctrine/common/doctrine-common-ac6c39b/phpunit.xml.dist deleted file mode 100644 index b9d3b34..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/phpunit.xml.dist +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - ./tests/Doctrine/ - - - - - - ./lib/Doctrine/ - - - - - - performance - - - diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/.gitignore b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/.gitignore deleted file mode 100644 index 7210405..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -Doctrine/Tests/Proxies/ -Doctrine/Tests/ORM/Proxy/generated/ -Doctrine/Tests/ORM/Tools/Export/export diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php deleted file mode 100644 index 0a329a3..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php +++ /dev/null @@ -1,538 +0,0 @@ -getReader(); - - $class = new ReflectionClass('Doctrine\Tests\Common\Annotations\DummyClass'); - $this->assertEquals(1, count($reader->getClassAnnotations($class))); - $this->assertInstanceOf($annotName = 'Doctrine\Tests\Common\Annotations\DummyAnnotation', $annot = $reader->getClassAnnotation($class, $annotName)); - $this->assertEquals("hello", $annot->dummyValue); - - $field1Prop = $class->getProperty('field1'); - $propAnnots = $reader->getPropertyAnnotations($field1Prop); - $this->assertEquals(1, count($propAnnots)); - $this->assertInstanceOf($annotName, $annot = $reader->getPropertyAnnotation($field1Prop, $annotName)); - $this->assertEquals("fieldHello", $annot->dummyValue); - - $getField1Method = $class->getMethod('getField1'); - $methodAnnots = $reader->getMethodAnnotations($getField1Method); - $this->assertEquals(1, count($methodAnnots)); - $this->assertInstanceOf($annotName, $annot = $reader->getMethodAnnotation($getField1Method, $annotName)); - $this->assertEquals(array(1, 2, "three"), $annot->value); - - $field2Prop = $class->getProperty('field2'); - $propAnnots = $reader->getPropertyAnnotations($field2Prop); - $this->assertEquals(1, count($propAnnots)); - $this->assertInstanceOf($annotName = 'Doctrine\Tests\Common\Annotations\DummyJoinTable', $joinTableAnnot = $reader->getPropertyAnnotation($field2Prop, $annotName)); - $this->assertEquals(1, count($joinTableAnnot->joinColumns)); - $this->assertEquals(1, count($joinTableAnnot->inverseJoinColumns)); - $this->assertTrue($joinTableAnnot->joinColumns[0] instanceof DummyJoinColumn); - $this->assertTrue($joinTableAnnot->inverseJoinColumns[0] instanceof DummyJoinColumn); - $this->assertEquals('col1', $joinTableAnnot->joinColumns[0]->name); - $this->assertEquals('col2', $joinTableAnnot->joinColumns[0]->referencedColumnName); - $this->assertEquals('col3', $joinTableAnnot->inverseJoinColumns[0]->name); - $this->assertEquals('col4', $joinTableAnnot->inverseJoinColumns[0]->referencedColumnName); - - $dummyAnnot = $reader->getMethodAnnotation($class->getMethod('getField1'), 'Doctrine\Tests\Common\Annotations\DummyAnnotation'); - $this->assertEquals('', $dummyAnnot->dummyValue); - $this->assertEquals(array(1, 2, 'three'), $dummyAnnot->value); - - $dummyAnnot = $reader->getPropertyAnnotation($class->getProperty('field1'), 'Doctrine\Tests\Common\Annotations\DummyAnnotation'); - $this->assertEquals('fieldHello', $dummyAnnot->dummyValue); - - $classAnnot = $reader->getClassAnnotation($class, 'Doctrine\Tests\Common\Annotations\DummyAnnotation'); - $this->assertEquals('hello', $classAnnot->dummyValue); - } - - public function testAnnotationsWithValidTargets() - { - $reader = $this->getReader(); - $class = new ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithValidAnnotationTarget'); - - $this->assertEquals(1,count($reader->getClassAnnotations($class))); - $this->assertEquals(1,count($reader->getPropertyAnnotations($class->getProperty('foo')))); - $this->assertEquals(1,count($reader->getMethodAnnotations($class->getMethod('someFunction')))); - $this->assertEquals(1,count($reader->getPropertyAnnotations($class->getProperty('nested')))); - } - - public function testAnnotationsWithVarType() - { - $reader = $this->getReader(); - $class = new ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAnnotationWithVarType'); - - $this->assertEquals(1,count($fooAnnot = $reader->getPropertyAnnotations($class->getProperty('foo')))); - $this->assertEquals(1,count($barAnnot = $reader->getMethodAnnotations($class->getMethod('bar')))); - - $this->assertInternalType('string', $fooAnnot[0]->string); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', $barAnnot[0]->annotation); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage [Semantical Error] Annotation @AnnotationTargetPropertyMethod is not allowed to be declared on class Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtClass. You may only use this annotation on these code elements: METHOD, PROPERTY - */ - public function testClassWithInvalidAnnotationTargetAtClassDocBlock() - { - $reader = $this->getReader(); - $reader->getClassAnnotations(new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtClass')); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage [Semantical Error] Annotation @AnnotationTargetClass is not allowed to be declared on property Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtProperty::$foo. You may only use this annotation on these code elements: CLASS - */ - public function testClassWithInvalidAnnotationTargetAtPropertyDocBlock() - { - $reader = $this->getReader(); - $reader->getPropertyAnnotations(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtProperty', 'foo')); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage [Semantical Error] Annotation @AnnotationTargetAnnotation is not allowed to be declared on property Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtProperty::$bar. You may only use this annotation on these code elements: ANNOTATION - */ - public function testClassWithInvalidNestedAnnotationTargetAtPropertyDocBlock() - { - $reader = $this->getReader(); - $reader->getPropertyAnnotations(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtProperty', 'bar')); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage [Semantical Error] Annotation @AnnotationTargetClass is not allowed to be declared on method Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtMethod::functionName(). You may only use this annotation on these code elements: CLASS - */ - public function testClassWithInvalidAnnotationTargetAtMethodDocBlock() - { - $reader = $this->getReader(); - $reader->getMethodAnnotations(new \ReflectionMethod('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtMethod', 'functionName')); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage Expected namespace separator or identifier, got ')' at position 24 in class @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithTargetSyntaxError. - */ - public function testClassWithAnnotationWithTargetSyntaxErrorAtClassDocBlock() - { - $reader = $this->getReader(); - $reader->getClassAnnotations(new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAnnotationWithTargetSyntaxError')); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage Expected namespace separator or identifier, got ')' at position 24 in class @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithTargetSyntaxError. - */ - public function testClassWithAnnotationWithTargetSyntaxErrorAtPropertyDocBlock() - { - $reader = $this->getReader(); - $reader->getPropertyAnnotations(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAnnotationWithTargetSyntaxError','foo')); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage Expected namespace separator or identifier, got ')' at position 24 in class @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithTargetSyntaxError. - */ - public function testClassWithAnnotationWithTargetSyntaxErrorAtMethodDocBlock() - { - $reader = $this->getReader(); - $reader->getMethodAnnotations(new \ReflectionMethod('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAnnotationWithTargetSyntaxError','bar')); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage [Type Error] Attribute "string" of @AnnotationWithVarType declared on property Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAnnotationWithVarType::$invalidProperty expects a(n) string, but got integer. - */ - public function testClassWithPropertyInvalidVarTypeError() - { - $reader = $this->getReader(); - $class = new ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAnnotationWithVarType'); - - $reader->getPropertyAnnotations($class->getProperty('invalidProperty')); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage [Type Error] Attribute "annotation" of @AnnotationWithVarType declared on method Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAnnotationWithVarType::invalidMethod() expects a(n) Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll, but got an instance of Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation. - */ - public function testClassWithMethodInvalidVarTypeError() - { - $reader = $this->getReader(); - $class = new ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAnnotationWithVarType'); - - $reader->getMethodAnnotations($class->getMethod('invalidMethod')); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage Expected namespace separator or identifier, got ')' at position 18 in class Doctrine\Tests\Common\Annotations\DummyClassSyntaxError. - */ - public function testClassSyntaxErrorContext() - { - $reader = $this->getReader(); - $reader->getClassAnnotations(new \ReflectionClass('Doctrine\Tests\Common\Annotations\DummyClassSyntaxError')); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage Expected namespace separator or identifier, got ')' at position 18 in method Doctrine\Tests\Common\Annotations\DummyClassMethodSyntaxError::foo(). - */ - public function testMethodSyntaxErrorContext() - { - $reader = $this->getReader(); - $reader->getMethodAnnotations(new \ReflectionMethod('Doctrine\Tests\Common\Annotations\DummyClassMethodSyntaxError', 'foo')); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage Expected namespace separator or identifier, got ')' at position 18 in property Doctrine\Tests\Common\Annotations\DummyClassPropertySyntaxError::$foo. - */ - public function testPropertySyntaxErrorContext() - { - $reader = $this->getReader(); - $reader->getPropertyAnnotations(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\DummyClassPropertySyntaxError', 'foo')); - } - - /** - * @group regression - */ - public function testMultipleAnnotationsOnSameLine() - { - $reader = $this->getReader(); - $annots = $reader->getPropertyAnnotations(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\DummyClass2', 'id')); - $this->assertEquals(3, count($annots)); - } - - public function testNonAnnotationProblem() - { - $reader = $this->getReader(); - - $this->assertNotNull($annot = $reader->getPropertyAnnotation(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\DummyClassNonAnnotationProblem', 'foo'), $name = 'Doctrine\Tests\Common\Annotations\DummyAnnotation')); - $this->assertInstanceOf($name, $annot); - } - - public function testImportWithConcreteAnnotation() - { - $reader = $this->getReader(); - $property = new \ReflectionProperty('Doctrine\Tests\Common\Annotations\TestImportWithConcreteAnnotation', 'field'); - $annotations = $reader->getPropertyAnnotations($property); - $this->assertEquals(1, count($annotations)); - $this->assertNotNull($reader->getPropertyAnnotation($property, 'Doctrine\Tests\Common\Annotations\DummyAnnotation')); - } - - public function testImportWithInheritance() - { - $reader = $this->getReader(); - - $class = new TestParentClass(); - $ref = new \ReflectionClass($class); - - $childAnnotations = $reader->getPropertyAnnotations($ref->getProperty('child')); - $this->assertEquals(1, count($childAnnotations)); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Foo\Name', reset($childAnnotations)); - - $parentAnnotations = $reader->getPropertyAnnotations($ref->getProperty('parent')); - $this->assertEquals(1, count($parentAnnotations)); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Bar\Name', reset($parentAnnotations)); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage The annotation "@NameFoo" in property Doctrine\Tests\Common\Annotations\TestAnnotationNotImportedClass::$field was never imported. - */ - public function testImportDetectsNotImportedAnnotation() - { - $reader = $this->getReader(); - $reader->getPropertyAnnotations(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\TestAnnotationNotImportedClass', 'field')); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage The annotation "@Foo\Bar\Name" in property Doctrine\Tests\Common\Annotations\TestNonExistentAnnotationClass::$field was never imported. - */ - public function testImportDetectsNonExistentAnnotation() - { - $reader = $this->getReader(); - $reader->getPropertyAnnotations(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\TestNonExistentAnnotationClass', 'field')); - } - - public function testTopLevelAnnotation() - { - $reader = $this->getReader(); - $annotations = $reader->getPropertyAnnotations(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\TestTopLevelAnnotationClass', 'field')); - - $this->assertEquals(1, count($annotations)); - $this->assertInstanceOf('\TopLevelAnnotation', reset($annotations)); - } - - public function testIgnoresAnnotationsNotPrefixedWithWhitespace() - { - $reader = $this->getReader(); - - $annotation = $reader->getClassAnnotation(new \ReflectionClass(new TestIgnoresNonAnnotationsClass()), 'Doctrine\Tests\Common\Annotations\Name'); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Name', $annotation); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage The class "Doctrine\Tests\Common\Annotations\Fixtures\NoAnnotation" is not annotated with @Annotation. Are you sure this class can be used as annotation? If so, then you need to add @Annotation to the _class_ doc comment of "Doctrine\Tests\Common\Annotations\Fixtures\NoAnnotation". If it is indeed no annotation, then you need to add @IgnoreAnnotation("NoAnnotation") to the _class_ doc comment of class Doctrine\Tests\Common\Annotations\Fixtures\InvalidAnnotationUsageClass. - */ - public function testErrorWhenInvalidAnnotationIsUsed() - { - $reader = $this->getReader(); - $ref = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\InvalidAnnotationUsageClass'); - $reader->getClassAnnotations($ref); - } - - public function testInvalidAnnotationUsageButIgnoredClass() - { - $reader = $this->getReader(); - $ref = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\InvalidAnnotationUsageButIgnoredClass'); - $annots = $reader->getClassAnnotations($ref); - - $this->assertEquals(2, count($annots)); - } - - /** - * @group DDC-1660 - * @group regression - */ - public function testInvalidAnnotationButIgnored() - { - $reader = $this->getReader(); - $class = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassDDC1660'); - - $this->assertTrue(class_exists('Doctrine\Tests\Common\Annotations\Fixtures\Annotation\Version')); - $this->assertCount(0, $reader->getClassAnnotations($class)); - $this->assertCount(0, $reader->getMethodAnnotations($class->getMethod('bar'))); - $this->assertCount(0, $reader->getPropertyAnnotations($class->getProperty('foo'))); - } - - abstract protected function getReader(); -} - -/** - * @parseAnnotation("var") - * @author Johannes M. Schmitt - * - */ -class TestParseAnnotationClass -{ - /** - * @var - */ - private $field; -} - -/** - * @Name - * @author Johannes M. Schmitt - */ -class TestIgnoresNonAnnotationsClass -{ -} - -class TestTopLevelAnnotationClass -{ - /** - * @\TopLevelAnnotation - */ - private $field; -} - -class TestNonExistentAnnotationClass -{ - /** - * @Foo\Bar\Name - */ - private $field; -} - -class TestAnnotationNotImportedClass -{ - /** - * @NameFoo - */ - private $field; -} - -class TestChildClass -{ - /** - * @\Doctrine\Tests\Common\Annotations\Foo\Name(name = "foo") - */ - protected $child; -} - -class TestParentClass extends TestChildClass -{ - /** - * @\Doctrine\Tests\Common\Annotations\Bar\Name(name = "bar") - */ - private $parent; -} - -class TestImportWithConcreteAnnotation -{ - /** - * @DummyAnnotation(dummyValue = "bar") - */ - private $field; -} - -/** - * A description of this class. - * - * Let's see if the parser recognizes that this @ is not really referring to an - * annotation. Also make sure that @var \ is not concated to "@var\is". - * - * @author robo - * @since 2.0 - * @DummyAnnotation(dummyValue="hello") - */ -class DummyClass { - /** - * A nice property. - * - * @var mixed - * @DummyAnnotation(dummyValue="fieldHello") - */ - private $field1; - - /** - * @DummyJoinTable(name="join_table", - * joinColumns={@DummyJoinColumn(name="col1", referencedColumnName="col2")}, - * inverseJoinColumns={ - * @DummyJoinColumn(name="col3", referencedColumnName="col4") - * }) - */ - private $field2; - - /** - * Gets the value of field1. - * - * @return mixed - * @DummyAnnotation({1,2,"three"}) - */ - public function getField1() { - } -} - -/** - * @ignoreAnnotation("var") - */ -class DummyClass2 { - /** - * @DummyId @DummyColumn(type="integer") @DummyGeneratedValue - * @var integer - */ - private $id; -} - -/** @Annotation */ -class DummyId extends \Doctrine\Common\Annotations\Annotation {} -/** @Annotation */ -class DummyColumn extends \Doctrine\Common\Annotations\Annotation { - public $type; -} -/** @Annotation */ -class DummyGeneratedValue extends \Doctrine\Common\Annotations\Annotation {} -/** @Annotation */ -class DummyAnnotation extends \Doctrine\Common\Annotations\Annotation { - public $dummyValue; -} -/** @Annotation */ -class DummyJoinColumn extends \Doctrine\Common\Annotations\Annotation { - public $name; - public $referencedColumnName; -} -/** @Annotation */ -class DummyJoinTable extends \Doctrine\Common\Annotations\Annotation { - public $name; - public $joinColumns; - public $inverseJoinColumns; -} - -/** - * @DummyAnnotation(@) - */ -class DummyClassSyntaxError -{ - -} - -class DummyClassMethodSyntaxError -{ - /** - * @DummyAnnotation(@) - */ - public function foo() - { - - } -} - -class DummyClassPropertySyntaxError -{ - /** - * @DummyAnnotation(@) - */ - public $foo; -} - -/** - * @ignoreAnnotation({"since", "var"}) - */ -class DummyClassNonAnnotationProblem -{ - /** - * @DummyAnnotation - * - * @var \Test - * @since 0.1 - */ - public $foo; -} - - -/** -* @DummyAnnotation Foo bar -*/ -class DummyClassWithEmail -{ - -} - -namespace Doctrine\Tests\Common\Annotations\Foo; - -/** @Annotation */ -class Name extends \Doctrine\Common\Annotations\Annotation -{ - public $name; -} - -namespace Doctrine\Tests\Common\Annotations\Bar; - -/** @Annotation */ -class Name extends \Doctrine\Common\Annotations\Annotation -{ - public $name; -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/AnnotationReaderTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/AnnotationReaderTest.php deleted file mode 100644 index d2cc667..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/AnnotationReaderTest.php +++ /dev/null @@ -1,13 +0,0 @@ -getMock('Doctrine\Common\Cache\Cache'); - $cache - ->expects($this->at(0)) - ->method('fetch') - ->with($this->equalTo($cacheKey)) - ->will($this->returnValue(array())) - ; - $cache - ->expects($this->at(1)) - ->method('fetch') - ->with($this->equalTo('[C]'.$cacheKey)) - ->will($this->returnValue(time() - 10)) - ; - $cache - ->expects($this->at(2)) - ->method('save') - ->with($this->equalTo($cacheKey)) - ; - $cache - ->expects($this->at(3)) - ->method('save') - ->with($this->equalTo('[C]'.$cacheKey)) - ; - - $reader = new CachedReader(new AnnotationReader(), $cache, true); - $route = new Route(); - $route->pattern = '/someprefix'; - $this->assertEquals(array($route), $reader->getClassAnnotations(new \ReflectionClass($name))); - } - - protected function getReader() - { - $this->cache = new ArrayCache(); - return new CachedReader(new AnnotationReader(), $this->cache); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/DocLexerTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/DocLexerTest.php deleted file mode 100644 index cb080f0..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/DocLexerTest.php +++ /dev/null @@ -1,27 +0,0 @@ -setInput("@Name"); - $this->assertNull($lexer->token); - $this->assertNull($lexer->lookahead); - - $this->assertTrue($lexer->moveNext()); - $this->assertNull($lexer->token); - $this->assertEquals('@', $lexer->lookahead['value']); - - $this->assertTrue($lexer->moveNext()); - $this->assertEquals('@', $lexer->token['value']); - $this->assertEquals('Name', $lexer->lookahead['value']); - - $this->assertFalse($lexer->moveNext()); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/DocParserTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/DocParserTest.php deleted file mode 100644 index 56cae7f..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/DocParserTest.php +++ /dev/null @@ -1,1118 +0,0 @@ -createTestParser(); - - // Nested arrays with nested annotations - $result = $parser->parse('@Name(foo={1,2, {"key"=@Name}})'); - $annot = $result[0]; - - $this->assertTrue($annot instanceof Name); - $this->assertNull($annot->value); - $this->assertEquals(3, count($annot->foo)); - $this->assertEquals(1, $annot->foo[0]); - $this->assertEquals(2, $annot->foo[1]); - $this->assertTrue(is_array($annot->foo[2])); - - $nestedArray = $annot->foo[2]; - $this->assertTrue(isset($nestedArray['key'])); - $this->assertTrue($nestedArray['key'] instanceof Name); - } - - public function testBasicAnnotations() - { - $parser = $this->createTestParser(); - - // Marker annotation - $result = $parser->parse("@Name"); - $annot = $result[0]; - $this->assertTrue($annot instanceof Name); - $this->assertNull($annot->value); - $this->assertNull($annot->foo); - - // Associative arrays - $result = $parser->parse('@Name(foo={"key1" = "value1"})'); - $annot = $result[0]; - $this->assertNull($annot->value); - $this->assertTrue(is_array($annot->foo)); - $this->assertTrue(isset($annot->foo['key1'])); - - // Numerical arrays - $result = $parser->parse('@Name({2="foo", 4="bar"})'); - $annot = $result[0]; - $this->assertTrue(is_array($annot->value)); - $this->assertEquals('foo', $annot->value[2]); - $this->assertEquals('bar', $annot->value[4]); - $this->assertFalse(isset($annot->value[0])); - $this->assertFalse(isset($annot->value[1])); - $this->assertFalse(isset($annot->value[3])); - - // Multiple values - $result = $parser->parse('@Name(@Name, @Name)'); - $annot = $result[0]; - - $this->assertTrue($annot instanceof Name); - $this->assertTrue(is_array($annot->value)); - $this->assertTrue($annot->value[0] instanceof Name); - $this->assertTrue($annot->value[1] instanceof Name); - - // Multiple types as values - $result = $parser->parse('@Name(foo="Bar", @Name, {"key1"="value1", "key2"="value2"})'); - $annot = $result[0]; - - $this->assertTrue($annot instanceof Name); - $this->assertTrue(is_array($annot->value)); - $this->assertTrue($annot->value[0] instanceof Name); - $this->assertTrue(is_array($annot->value[1])); - $this->assertEquals('value1', $annot->value[1]['key1']); - $this->assertEquals('value2', $annot->value[1]['key2']); - - // Complete docblock - $docblock = <<parse($docblock); - $this->assertEquals(1, count($result)); - $annot = $result[0]; - $this->assertTrue($annot instanceof Name); - $this->assertEquals("bar", $annot->foo); - $this->assertNull($annot->value); - } - - public function testNamespacedAnnotations() - { - $parser = new DocParser; - $parser->setIgnoreNotImportedAnnotations(true); - - $docblock = << - * @Doctrine\Tests\Common\Annotations\Name(foo="bar") - * @ignore - */ -DOCBLOCK; - - $result = $parser->parse($docblock); - $this->assertEquals(1, count($result)); - $annot = $result[0]; - $this->assertTrue($annot instanceof Name); - $this->assertEquals("bar", $annot->foo); - } - - /** - * @group debug - */ - public function testTypicalMethodDocBlock() - { - $parser = $this->createTestParser(); - - $docblock = <<parse($docblock); - $this->assertEquals(2, count($result)); - $this->assertTrue(isset($result[0])); - $this->assertTrue(isset($result[1])); - $annot = $result[0]; - $this->assertTrue($annot instanceof Name); - $this->assertEquals("bar", $annot->foo); - $marker = $result[1]; - $this->assertTrue($marker instanceof Marker); - } - - - public function testAnnotationWithoutConstructor() - { - $parser = $this->createTestParser(); - - - $docblock = <<parse($docblock); - $this->assertEquals(count($result), 1); - $annot = $result[0]; - - $this->assertNotNull($annot); - $this->assertTrue($annot instanceof SomeAnnotationClassNameWithoutConstructor); - - $this->assertNull($annot->name); - $this->assertNotNull($annot->data); - $this->assertEquals($annot->data, "Some data"); - - - - -$docblock = <<parse($docblock); - $this->assertEquals(count($result), 1); - $annot = $result[0]; - - $this->assertNotNull($annot); - $this->assertTrue($annot instanceof SomeAnnotationClassNameWithoutConstructor); - - $this->assertEquals($annot->name, "Some Name"); - $this->assertEquals($annot->data, "Some data"); - - - - -$docblock = <<parse($docblock); - $this->assertEquals(count($result), 1); - $annot = $result[0]; - - $this->assertEquals($annot->data, "Some data"); - $this->assertNull($annot->name); - - - $docblock = <<parse($docblock); - $this->assertEquals(count($result), 1); - $annot = $result[0]; - - $this->assertEquals($annot->name, "Some name"); - $this->assertNull($annot->data); - - $docblock = <<parse($docblock); - $this->assertEquals(count($result), 1); - $annot = $result[0]; - - $this->assertEquals($annot->data, "Some data"); - $this->assertNull($annot->name); - - - - $docblock = <<parse($docblock); - $this->assertEquals(count($result), 1); - $annot = $result[0]; - - $this->assertEquals($annot->name, "Some name"); - $this->assertEquals($annot->data, "Some data"); - - - $docblock = <<parse($docblock); - $this->assertEquals(count($result), 1); - $annot = $result[0]; - - $this->assertEquals($annot->name, "Some name"); - $this->assertEquals($annot->data, "Some data"); - - $docblock = <<parse($docblock); - $this->assertEquals(count($result), 1); - $this->assertTrue($result[0] instanceof SomeAnnotationClassNameWithoutConstructorAndProperties); - } - - public function testAnnotationTarget() - { - - $parser = new DocParser; - $parser->setImports(array( - '__NAMESPACE__' => 'Doctrine\Tests\Common\Annotations\Fixtures', - )); - $class = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithValidAnnotationTarget'); - - - $context = 'class ' . $class->getName(); - $docComment = $class->getDocComment(); - - $parser->setTarget(Target::TARGET_CLASS); - $this->assertNotNull($parser->parse($docComment,$context)); - - - $property = $class->getProperty('foo'); - $docComment = $property->getDocComment(); - $context = 'property ' . $class->getName() . "::\$" . $property->getName(); - - $parser->setTarget(Target::TARGET_PROPERTY); - $this->assertNotNull($parser->parse($docComment,$context)); - - - - $method = $class->getMethod('someFunction'); - $docComment = $property->getDocComment(); - $context = 'method ' . $class->getName() . '::' . $method->getName() . '()'; - - $parser->setTarget(Target::TARGET_METHOD); - $this->assertNotNull($parser->parse($docComment,$context)); - - - try { - $class = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtClass'); - $context = 'class ' . $class->getName(); - $docComment = $class->getDocComment(); - - $parser->setTarget(Target::TARGET_CLASS); - $parser->parse($class->getDocComment(),$context); - - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertNotNull($exc->getMessage()); - } - - - try { - - $class = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtMethod'); - $method = $class->getMethod('functionName'); - $docComment = $method->getDocComment(); - $context = 'method ' . $class->getName() . '::' . $method->getName() . '()'; - - $parser->setTarget(Target::TARGET_METHOD); - $parser->parse($docComment,$context); - - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertNotNull($exc->getMessage()); - } - - - try { - $class = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtProperty'); - $property = $class->getProperty('foo'); - $docComment = $property->getDocComment(); - $context = 'property ' . $class->getName() . "::\$" . $property->getName(); - - $parser->setTarget(Target::TARGET_PROPERTY); - $parser->parse($docComment,$context); - - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertNotNull($exc->getMessage()); - } - - } - - public function getAnnotationVarTypeProviderValid() - { - //({attribute name}, {attribute value}) - return array( - // mixed type - array('mixed', '"String Value"'), - array('mixed', 'true'), - array('mixed', 'false'), - array('mixed', '1'), - array('mixed', '1.2'), - array('mixed', '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll'), - - // boolean type - array('boolean', 'true'), - array('boolean', 'false'), - - // alias for internal type boolean - array('bool', 'true'), - array('bool', 'false'), - - // integer type - array('integer', '0'), - array('integer', '1'), - array('integer', '123456789'), - array('integer', '9223372036854775807'), - - // alias for internal type double - array('float', '0.1'), - array('float', '1.2'), - array('float', '123.456'), - - // string type - array('string', '"String Value"'), - array('string', '"true"'), - array('string', '"123"'), - - // array type - array('array', '{@AnnotationExtendsAnnotationTargetAll}'), - array('array', '{@AnnotationExtendsAnnotationTargetAll,@AnnotationExtendsAnnotationTargetAll}'), - - array('arrayOfIntegers', '1'), - array('arrayOfIntegers', '{1}'), - array('arrayOfIntegers', '{1,2,3,4}'), - array('arrayOfAnnotations', '@AnnotationExtendsAnnotationTargetAll'), - array('arrayOfAnnotations', '{@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll}'), - array('arrayOfAnnotations', '{@AnnotationExtendsAnnotationTargetAll, @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll}'), - - // annotation instance - array('annotation', '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll'), - array('annotation', '@AnnotationExtendsAnnotationTargetAll'), - ); - } - - public function getAnnotationVarTypeProviderInvalid() - { - //({attribute name}, {type declared type}, {attribute value} , {given type or class}) - return array( - // boolean type - array('boolean','boolean','1','integer'), - array('boolean','boolean','1.2','double'), - array('boolean','boolean','"str"','string'), - array('boolean','boolean','{1,2,3}','array'), - array('boolean','boolean','@Name', 'an instance of Doctrine\Tests\Common\Annotations\Name'), - - // alias for internal type boolean - array('bool','bool', '1','integer'), - array('bool','bool', '1.2','double'), - array('bool','bool', '"str"','string'), - array('bool','bool', '{"str"}','array'), - - // integer type - array('integer','integer', 'true','boolean'), - array('integer','integer', 'false','boolean'), - array('integer','integer', '1.2','double'), - array('integer','integer', '"str"','string'), - array('integer','integer', '{"str"}','array'), - array('integer','integer', '{1,2,3,4}','array'), - - // alias for internal type double - array('float','float', 'true','boolean'), - array('float','float', 'false','boolean'), - array('float','float', '123','integer'), - array('float','float', '"str"','string'), - array('float','float', '{"str"}','array'), - array('float','float', '{12.34}','array'), - array('float','float', '{1,2,3}','array'), - - // string type - array('string','string', 'true','boolean'), - array('string','string', 'false','boolean'), - array('string','string', '12','integer'), - array('string','string', '1.2','double'), - array('string','string', '{"str"}','array'), - array('string','string', '{1,2,3,4}','array'), - - // annotation instance - array('annotation','Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', 'true','boolean'), - array('annotation','Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', 'false','boolean'), - array('annotation','Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', '12','integer'), - array('annotation','Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', '1.2','double'), - array('annotation','Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', '{"str"}','array'), - array('annotation','Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', '{1,2,3,4}','array'), - array('annotation','Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', '@Name','an instance of Doctrine\Tests\Common\Annotations\Name'), - ); - } - - public function getAnnotationVarTypeArrayProviderInvalid() - { - //({attribute name}, {type declared type}, {attribute value} , {given type or class}) - return array( - array('arrayOfIntegers','integer', 'true','boolean'), - array('arrayOfIntegers','integer', 'false','boolean'), - array('arrayOfIntegers','integer', '{true,true}','boolean'), - array('arrayOfIntegers','integer', '{1,true}','boolean'), - array('arrayOfIntegers','integer', '{1,2,1.2}','double'), - array('arrayOfIntegers','integer', '{1,2,"str"}','string'), - - - array('arrayOfAnnotations','Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', 'true','boolean'), - array('arrayOfAnnotations','Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', 'false','boolean'), - array('arrayOfAnnotations','Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', '{@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll,true}','boolean'), - array('arrayOfAnnotations','Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', '{@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll,true}','boolean'), - array('arrayOfAnnotations','Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', '{@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll,1.2}','double'), - array('arrayOfAnnotations','Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', '{@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll,@AnnotationExtendsAnnotationTargetAll,"str"}','string'), - ); - } - - /** - * @dataProvider getAnnotationVarTypeProviderValid - */ - public function testAnnotationWithVarType($attribute, $value) - { - $parser = $this->createTestParser(); - $context = 'property SomeClassName::$invalidProperty.'; - $docblock = sprintf('@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithVarType(%s = %s)',$attribute, $value); - $parser->setTarget(Target::TARGET_PROPERTY); - - $result = $parser->parse($docblock, $context); - - $this->assertTrue(sizeof($result) === 1); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithVarType', $result[0]); - $this->assertNotNull($result[0]->$attribute); - } - - /** - * @dataProvider getAnnotationVarTypeProviderInvalid - */ - public function testAnnotationWithVarTypeError($attribute,$type,$value,$given) - { - $parser = $this->createTestParser(); - $context = 'property SomeClassName::invalidProperty.'; - $docblock = sprintf('@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithVarType(%s = %s)',$attribute, $value); - $parser->setTarget(Target::TARGET_PROPERTY); - - try { - $parser->parse($docblock, $context); - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertContains("[Type Error] Attribute \"$attribute\" of @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithVarType declared on property SomeClassName::invalidProperty. expects a(n) $type, but got $given.", $exc->getMessage()); - } - } - - - /** - * @dataProvider getAnnotationVarTypeArrayProviderInvalid - */ - public function testAnnotationWithVarTypeArrayError($attribute,$type,$value,$given) - { - $parser = $this->createTestParser(); - $context = 'property SomeClassName::invalidProperty.'; - $docblock = sprintf('@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithVarType(%s = %s)',$attribute, $value); - $parser->setTarget(Target::TARGET_PROPERTY); - - try { - $parser->parse($docblock, $context); - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertContains("[Type Error] Attribute \"$attribute\" of @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithVarType declared on property SomeClassName::invalidProperty. expects either a(n) $type, or an array of {$type}s, but got $given.", $exc->getMessage()); - } - } - - /** - * @dataProvider getAnnotationVarTypeProviderValid - */ - public function testAnnotationWithAttributes($attribute, $value) - { - $parser = $this->createTestParser(); - $context = 'property SomeClassName::$invalidProperty.'; - $docblock = sprintf('@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithAttributes(%s = %s)',$attribute, $value); - $parser->setTarget(Target::TARGET_PROPERTY); - - $result = $parser->parse($docblock, $context); - - $this->assertTrue(sizeof($result) === 1); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithAttributes', $result[0]); - $getter = "get".ucfirst($attribute); - $this->assertNotNull($result[0]->$getter()); - } - - /** - * @dataProvider getAnnotationVarTypeProviderInvalid - */ - public function testAnnotationWithAttributesError($attribute,$type,$value,$given) - { - $parser = $this->createTestParser(); - $context = 'property SomeClassName::invalidProperty.'; - $docblock = sprintf('@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithAttributes(%s = %s)',$attribute, $value); - $parser->setTarget(Target::TARGET_PROPERTY); - - try { - $parser->parse($docblock, $context); - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertContains("[Type Error] Attribute \"$attribute\" of @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithAttributes declared on property SomeClassName::invalidProperty. expects a(n) $type, but got $given.", $exc->getMessage()); - } - } - - - /** - * @dataProvider getAnnotationVarTypeArrayProviderInvalid - */ - public function testAnnotationWithAttributesWithVarTypeArrayError($attribute,$type,$value,$given) - { - $parser = $this->createTestParser(); - $context = 'property SomeClassName::invalidProperty.'; - $docblock = sprintf('@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithAttributes(%s = %s)',$attribute, $value); - $parser->setTarget(Target::TARGET_PROPERTY); - - try { - $parser->parse($docblock, $context); - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertContains("[Type Error] Attribute \"$attribute\" of @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithAttributes declared on property SomeClassName::invalidProperty. expects either a(n) $type, or an array of {$type}s, but got $given.", $exc->getMessage()); - } - } - - public function testAnnotationWithRequiredAttributes() - { - $parser = $this->createTestParser(); - $context = 'property SomeClassName::invalidProperty.'; - $parser->setTarget(Target::TARGET_PROPERTY); - - - $docblock = '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributes("Some Value", annot = @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation)'; - $result = $parser->parse($docblock); - - $this->assertTrue(sizeof($result) === 1); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributes', $result[0]); - $this->assertEquals("Some Value",$result[0]->getValue()); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation', $result[0]->getAnnot()); - - - $docblock = '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributes("Some Value")'; - try { - $result = $parser->parse($docblock,$context); - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertContains('Attribute "annot" of @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributes declared on property SomeClassName::invalidProperty. expects a(n) Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation. This value should not be null.', $exc->getMessage()); - } - - $docblock = '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributes(annot = @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation)'; - try { - $result = $parser->parse($docblock,$context); - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertContains('Attribute "value" of @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributes declared on property SomeClassName::invalidProperty. expects a(n) string. This value should not be null.', $exc->getMessage()); - } - - } - - public function testAnnotationWithRequiredAttributesWithoutContructor() - { - $parser = $this->createTestParser(); - $context = 'property SomeClassName::invalidProperty.'; - $parser->setTarget(Target::TARGET_PROPERTY); - - - $docblock = '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributesWithoutContructor("Some Value", annot = @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation)'; - $result = $parser->parse($docblock); - - $this->assertTrue(sizeof($result) === 1); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributesWithoutContructor', $result[0]); - $this->assertEquals("Some Value", $result[0]->value); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation', $result[0]->annot); - - - $docblock = '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributesWithoutContructor("Some Value")'; - try { - $result = $parser->parse($docblock,$context); - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertContains('Attribute "annot" of @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributesWithoutContructor declared on property SomeClassName::invalidProperty. expects a(n) Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation. This value should not be null.', $exc->getMessage()); - } - - $docblock = '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributesWithoutContructor(annot = @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation)'; - try { - $result = $parser->parse($docblock,$context); - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertContains('Attribute "value" of @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributesWithoutContructor declared on property SomeClassName::invalidProperty. expects a(n) string. This value should not be null.', $exc->getMessage()); - } - - } - - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage The annotation @SomeAnnotationClassNameWithoutConstructorAndProperties declared on does not accept any values, but got {"value":"Foo"}. - */ - public function testWithoutConstructorWhenIsNotDefaultValue() - { - $parser = $this->createTestParser(); - $docblock = <<setTarget(Target::TARGET_CLASS); - $parser->parse($docblock); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage The annotation @SomeAnnotationClassNameWithoutConstructorAndProperties declared on does not accept any values, but got {"value":"Foo"}. - */ - public function testWithoutConstructorWhenHasNoProperties() - { - $parser = $this->createTestParser(); - $docblock = <<setTarget(Target::TARGET_CLASS); - $parser->parse($docblock); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage Expected namespace separator or identifier, got ')' at position 24 in class @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithTargetSyntaxError. - */ - public function testAnnotationTargetSyntaxError() - { - $parser = $this->createTestParser(); - $context = 'class ' . 'SomeClassName'; - $docblock = <<setTarget(Target::TARGET_CLASS); - $parser->parse($docblock,$context); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Invalid Target "Foo". Available targets: [ALL, CLASS, METHOD, PROPERTY, ANNOTATION] - */ - public function testAnnotationWithInvalidTargetDeclarationError() - { - $parser = $this->createTestParser(); - $context = 'class ' . 'SomeClassName'; - $docblock = <<setTarget(Target::TARGET_CLASS); - $parser->parse($docblock,$context); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage @Target expects either a string value, or an array of strings, "NULL" given. - */ - public function testAnnotationWithTargetEmptyError() - { - $parser = $this->createTestParser(); - $context = 'class ' . 'SomeClassName'; - $docblock = <<setTarget(Target::TARGET_CLASS); - $parser->parse($docblock,$context); - } - - /** - * @group DDC-575 - */ - public function testRegressionDDC575() - { - $parser = $this->createTestParser(); - - $docblock = <<parse($docblock); - - $this->assertInstanceOf("Doctrine\Tests\Common\Annotations\Name", $result[0]); - - $docblock = <<parse($docblock); - - $this->assertInstanceOf("Doctrine\Tests\Common\Annotations\Name", $result[0]); - } - - /** - * @group DDC-77 - */ - public function testAnnotationWithoutClassIsIgnoredWithoutWarning() - { - $parser = new DocParser(); - $parser->setIgnoreNotImportedAnnotations(true); - $result = $parser->parse("@param"); - - $this->assertEquals(0, count($result)); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage Expected PlainValue, got ''' at position 10. - */ - public function testAnnotationDontAcceptSingleQuotes() - { - $parser = $this->createTestParser(); - $parser->parse("@Name(foo='bar')"); - } - - /** - * @group DCOM-41 - */ - public function testAnnotationDoesntThrowExceptionWhenAtSignIsNotFollowedByIdentifier() - { - $parser = new DocParser(); - $result = $parser->parse("'@'"); - - $this->assertEquals(0, count($result)); - } - - /** - * @group DCOM-41 - * @expectedException Doctrine\Common\Annotations\AnnotationException - */ - public function testAnnotationThrowsExceptionWhenAtSignIsNotFollowedByIdentifierInNestedAnnotation() - { - $parser = new DocParser(); - $result = $parser->parse("@Doctrine\Tests\Common\Annotations\Name(@')"); - } - - /** - * @group DCOM-56 - */ - public function testAutoloadAnnotation() - { - $this->assertFalse(class_exists('Doctrine\Tests\Common\Annotations\Fixture\Annotation\Autoload', false), 'Pre-condition: Doctrine\Tests\Common\Annotations\Fixture\Annotation\Autoload not allowed to be loaded.'); - - $parser = new DocParser(); - - AnnotationRegistry::registerAutoloadNamespace('Doctrine\Tests\Common\Annotations\Fixtures\Annotation', __DIR__ . '/../../../../'); - - $parser->setImports(array( - 'autoload' => 'Doctrine\Tests\Common\Annotations\Fixtures\Annotation\Autoload', - )); - $annotations = $parser->parse('@Autoload'); - - $this->assertEquals(1, count($annotations)); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\Annotation\Autoload', $annotations[0]); - } - - public function createTestParser() - { - $parser = new DocParser(); - $parser->setIgnoreNotImportedAnnotations(true); - $parser->setImports(array( - 'name' => 'Doctrine\Tests\Common\Annotations\Name', - '__NAMESPACE__' => 'Doctrine\Tests\Common\Annotations', - )); - - return $parser; - } - - /** - * @group DDC-78 - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage Expected PlainValue, got ''' at position 10 in class \Doctrine\Tests\Common\Annotations\Name - */ - public function testSyntaxErrorWithContextDescription() - { - $parser = $this->createTestParser(); - $parser->parse("@Name(foo='bar')", "class \Doctrine\Tests\Common\Annotations\Name"); - } - - /** - * @group DDC-183 - */ - public function testSyntaxErrorWithUnknownCharacters() - { - $docblock = <<setInput(trim($docblock, '/ *')); - //var_dump($lexer); - - try { - $parser = $this->createTestParser(); - $result = $parser->parse($docblock); - } catch (Exception $e) { - $this->fail($e->getMessage()); - } - } - - /** - * @group DCOM-14 - */ - public function testIgnorePHPDocThrowTag() - { - $docblock = <<createTestParser(); - $result = $parser->parse($docblock); - } catch (Exception $e) { - $this->fail($e->getMessage()); - } - } - - /** - * @group DCOM-38 - */ - public function testCastInt() - { - $parser = $this->createTestParser(); - - $result = $parser->parse("@Name(foo=1234)"); - $annot = $result[0]; - $this->assertInternalType('int', $annot->foo); - } - - /** - * @group DCOM-38 - */ - public function testCastNegativeInt() - { - $parser = $this->createTestParser(); - - $result = $parser->parse("@Name(foo=-1234)"); - $annot = $result[0]; - $this->assertInternalType('int', $annot->foo); - } - - /** - * @group DCOM-38 - */ - public function testCastFloat() - { - $parser = $this->createTestParser(); - - $result = $parser->parse("@Name(foo=1234.345)"); - $annot = $result[0]; - $this->assertInternalType('float', $annot->foo); - } - - /** - * @group DCOM-38 - */ - public function testCastNegativeFloat() - { - $parser = $this->createTestParser(); - - $result = $parser->parse("@Name(foo=-1234.345)"); - $annot = $result[0]; - $this->assertInternalType('float', $annot->foo); - - $result = $parser->parse("@Marker(-1234.345)"); - $annot = $result[0]; - $this->assertInternalType('float', $annot->value); - } - - public function testReservedKeywordsInAnnotations() - { - $parser = $this->createTestParser(); - - $result = $parser->parse('@Doctrine\Tests\Common\Annotations\True'); - $this->assertTrue($result[0] instanceof True); - $result = $parser->parse('@Doctrine\Tests\Common\Annotations\False'); - $this->assertTrue($result[0] instanceof False); - $result = $parser->parse('@Doctrine\Tests\Common\Annotations\Null'); - $this->assertTrue($result[0] instanceof Null); - - $result = $parser->parse('@True'); - $this->assertTrue($result[0] instanceof True); - $result = $parser->parse('@False'); - $this->assertTrue($result[0] instanceof False); - $result = $parser->parse('@Null'); - $this->assertTrue($result[0] instanceof Null); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage [Creation Error] The annotation @SomeAnnotationClassNameWithoutConstructor declared on some class does not have a property named "invalidaProperty". Available properties: data, name - */ - public function testSetValuesExeption() - { - $docblock = <<createTestParser()->parse($docblock, 'some class'); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage [Syntax Error] Expected Doctrine\Common\Annotations\DocLexer::T_IDENTIFIER or Doctrine\Common\Annotations\DocLexer::T_TRUE or Doctrine\Common\Annotations\DocLexer::T_FALSE or Doctrine\Common\Annotations\DocLexer::T_NULL, got '3.42' at position 5. - */ - public function testInvalidIdentifierInAnnotation() - { - $parser = $this->createTestParser(); - $parser->parse('@Foo\3.42'); - } - - public function testTrailingCommaIsAllowed() - { - $parser = $this->createTestParser(); - - $annots = $parser->parse('@Name({ - "Foo", - "Bar", - })'); - $this->assertEquals(1, count($annots)); - $this->assertEquals(array('Foo', 'Bar'), $annots[0]->value); - } - - public function testDefaultAnnotationValueIsNotOverwritten() - { - $parser = $this->createTestParser(); - - $annots = $parser->parse('@Doctrine\Tests\Common\Annotations\Fixtures\Annotation\AnnotWithDefaultValue'); - $this->assertEquals(1, count($annots)); - $this->assertEquals('bar', $annots[0]->foo); - } - - public function testArrayWithColon() - { - $parser = $this->createTestParser(); - - $annots = $parser->parse('@Name({"foo": "bar"})'); - $this->assertEquals(1, count($annots)); - $this->assertEquals(array('foo' => 'bar'), $annots[0]->value); - } - - /** - * @expectedException Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage [Syntax Error] Expected PlainValue, got 'foo:' at position 6. - */ - public function testColonNotAllowedOnTopLevel() - { - $parser = $this->createTestParser(); - $parser->parse('@Name(foo: "bar")'); - } -} - -/** @Annotation */ -class SomeAnnotationClassNameWithoutConstructor -{ - public $data; - public $name; -} - -/** @Annotation */ -class SomeAnnotationWithConstructorWithoutParams -{ - function __construct() - { - $this->data = "Some data"; - } - public $data; - public $name; -} - -/** @Annotation */ -class SomeAnnotationClassNameWithoutConstructorAndProperties{} - -/** - * @Annotation - * @Target("Foo") - */ -class AnnotationWithInvalidTargetDeclaration{} - -/** - * @Annotation - * @Target - */ -class AnnotationWithTargetEmpty{} - -/** @Annotation */ -class AnnotationExtendsAnnotationTargetAll extends \Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll -{ -} - -/** @Annotation */ -class Name extends \Doctrine\Common\Annotations\Annotation { - public $foo; -} - -/** @Annotation */ -class Marker { - public $value; -} - -/** @Annotation */ -class True {} - -/** @Annotation */ -class False {} - -/** @Annotation */ -class Null {} - -namespace Doctrine\Tests\Common\Annotations\FooBar; - -/** @Annotation */ -class Name extends \Doctrine\Common\Annotations\Annotation { -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/FileCacheReaderTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/FileCacheReaderTest.php deleted file mode 100644 index c84344d..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/FileCacheReaderTest.php +++ /dev/null @@ -1,40 +0,0 @@ -cacheDir = sys_get_temp_dir() . "/annotations_". uniqid(); - @mkdir($this->cacheDir); - return new FileCacheReader(new AnnotationReader(), $this->cacheDir); - } - - public function tearDown() - { - foreach (glob($this->cacheDir.'/*.php') AS $file) { - unlink($file); - } - rmdir($this->cacheDir); - } - - /** - * @group DCOM-81 - */ - public function testAttemptToCreateAnnotationCacheDir() - { - $this->cacheDir = sys_get_temp_dir() . "/not_existed_dir_". uniqid(); - - $this->assertFalse(is_dir($this->cacheDir)); - - $cache = new FileCacheReader(new AnnotationReader(), $this->cacheDir); - - $this->assertTrue(is_dir($this->cacheDir)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/AnnotWithDefaultValue.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/AnnotWithDefaultValue.php deleted file mode 100644 index 44108e1..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/AnnotWithDefaultValue.php +++ /dev/null @@ -1,10 +0,0 @@ -roles = $values['value']; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Template.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Template.php deleted file mode 100644 index b507e60..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Template.php +++ /dev/null @@ -1,14 +0,0 @@ -name = isset($values['value']) ? $values['value'] : null; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Version.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Version.php deleted file mode 100644 index 09ef031..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Version.php +++ /dev/null @@ -1,11 +0,0 @@ -"), - @Attribute("annotation", type = "Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll"), - @Attribute("arrayOfAnnotations", type = "array"), - }) - */ -final class AnnotationWithAttributes -{ - - public final function __construct(array $data) - { - foreach ($data as $key => $value) { - $this->$key = $value; - } - } - - private $mixed; - private $boolean; - private $bool; - private $float; - private $string; - private $integer; - private $array; - private $annotation; - private $arrayOfIntegers; - private $arrayOfAnnotations; - - /** - * @return mixed - */ - public function getMixed() - { - return $this->mixed; - } - - /** - * @return boolean - */ - public function getBoolean() - { - return $this->boolean; - } - - /** - * @return bool - */ - public function getBool() - { - return $this->bool; - } - - /** - * @return float - */ - public function getFloat() - { - return $this->float; - } - - /** - * @return string - */ - public function getString() - { - return $this->string; - } - - public function getInteger() - { - return $this->integer; - } - - /** - * @return array - */ - public function getArray() - { - return $this->array; - } - - /** - * @return Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll - */ - public function getAnnotation() - { - return $this->annotation; - } - - /** - * @return array - */ - public function getArrayOfIntegers() - { - return $this->arrayOfIntegers; - } - - /** - * @return array - */ - public function getArrayOfAnnotations() - { - return $this->arrayOfAnnotations; - } - -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithRequiredAttributes.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithRequiredAttributes.php deleted file mode 100644 index 6eb1bc5..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithRequiredAttributes.php +++ /dev/null @@ -1,50 +0,0 @@ - $value) { - $this->$key = $value; - } - } - - /** - * @var string - */ - private $value; - - /** - * - * @var Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation - */ - private $annot; - - /** - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * @return Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation - */ - public function getAnnot() - { - return $this->annot; - } - -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithRequiredAttributesWithoutContructor.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithRequiredAttributesWithoutContructor.php deleted file mode 100644 index bf458ee..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithRequiredAttributesWithoutContructor.php +++ /dev/null @@ -1,24 +0,0 @@ - - */ - public $arrayOfIntegers; - - /** - * @var array - */ - public $arrayOfAnnotations; - -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassDDC1660.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassDDC1660.php deleted file mode 100644 index 4e652e1..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassDDC1660.php +++ /dev/null @@ -1,30 +0,0 @@ - - */ -class Controller -{ - /** - * @Route("/", name="_demo") - * @Template() - */ - public function indexAction() - { - return array(); - } - - /** - * @Route("/hello/{name}", name="_demo_hello") - * @Template() - */ - public function helloAction($name) - { - return array('name' => $name); - } - - /** - * @Route("/contact", name="_demo_contact") - * @Template() - */ - public function contactAction() - { - $form = ContactForm::create($this->get('form.context'), 'contact'); - - $form->bind($this->container->get('request'), $form); - if ($form->isValid()) { - $form->send($this->get('mailer')); - - $this->get('session')->setFlash('notice', 'Message sent!'); - - return new RedirectResponse($this->generateUrl('_demo')); - } - - return array('form' => $form); - } - - /** - * Creates the ACL for the passed object identity - * - * @param ObjectIdentityInterface $oid - * @return void - */ - private function createObjectIdentity(ObjectIdentityInterface $oid) - { - $classId = $this->createOrRetrieveClassId($oid->getType()); - - $this->connection->executeQuery($this->getInsertObjectIdentitySql($oid->getIdentifier(), $classId, true)); - } - - /** - * Returns the primary key for the passed class type. - * - * If the type does not yet exist in the database, it will be created. - * - * @param string $classType - * @return integer - */ - private function createOrRetrieveClassId($classType) - { - if (false !== $id = $this->connection->executeQuery($this->getSelectClassIdSql($classType))->fetchColumn()) { - return $id; - } - - $this->connection->executeQuery($this->getInsertClassSql($classType)); - - return $this->connection->executeQuery($this->getSelectClassIdSql($classType))->fetchColumn(); - } - - /** - * Returns the primary key for the passed security identity. - * - * If the security identity does not yet exist in the database, it will be - * created. - * - * @param SecurityIdentityInterface $sid - * @return integer - */ - private function createOrRetrieveSecurityIdentityId(SecurityIdentityInterface $sid) - { - if (false !== $id = $this->connection->executeQuery($this->getSelectSecurityIdentityIdSql($sid))->fetchColumn()) { - return $id; - } - - $this->connection->executeQuery($this->getInsertSecurityIdentitySql($sid)); - - return $this->connection->executeQuery($this->getSelectSecurityIdentityIdSql($sid))->fetchColumn(); - } - - /** - * Deletes all ACEs for the given object identity primary key. - * - * @param integer $oidPK - * @return void - */ - private function deleteAccessControlEntries($oidPK) - { - $this->connection->executeQuery($this->getDeleteAccessControlEntriesSql($oidPK)); - } - - /** - * Deletes the object identity from the database. - * - * @param integer $pk - * @return void - */ - private function deleteObjectIdentity($pk) - { - $this->connection->executeQuery($this->getDeleteObjectIdentitySql($pk)); - } - - /** - * Deletes all entries from the relations table from the database. - * - * @param integer $pk - * @return void - */ - private function deleteObjectIdentityRelations($pk) - { - $this->connection->executeQuery($this->getDeleteObjectIdentityRelationsSql($pk)); - } - - /** - * This regenerates the ancestor table which is used for fast read access. - * - * @param AclInterface $acl - * @return void - */ - private function regenerateAncestorRelations(AclInterface $acl) - { - $pk = $acl->getId(); - $this->connection->executeQuery($this->getDeleteObjectIdentityRelationsSql($pk)); - $this->connection->executeQuery($this->getInsertObjectIdentityRelationSql($pk, $pk)); - - $parentAcl = $acl->getParentAcl(); - while (null !== $parentAcl) { - $this->connection->executeQuery($this->getInsertObjectIdentityRelationSql($pk, $parentAcl->getId())); - - $parentAcl = $parentAcl->getParentAcl(); - } - } - - /** - * This processes changes on an ACE related property (classFieldAces, or objectFieldAces). - * - * @param string $name - * @param array $changes - * @return void - */ - private function updateFieldAceProperty($name, array $changes) - { - $sids = new \SplObjectStorage(); - $classIds = new \SplObjectStorage(); - $currentIds = array(); - foreach ($changes[1] as $field => $new) { - for ($i=0,$c=count($new); $i<$c; $i++) { - $ace = $new[$i]; - - if (null === $ace->getId()) { - if ($sids->contains($ace->getSecurityIdentity())) { - $sid = $sids->offsetGet($ace->getSecurityIdentity()); - } else { - $sid = $this->createOrRetrieveSecurityIdentityId($ace->getSecurityIdentity()); - } - - $oid = $ace->getAcl()->getObjectIdentity(); - if ($classIds->contains($oid)) { - $classId = $classIds->offsetGet($oid); - } else { - $classId = $this->createOrRetrieveClassId($oid->getType()); - } - - $objectIdentityId = $name === 'classFieldAces' ? null : $ace->getAcl()->getId(); - - $this->connection->executeQuery($this->getInsertAccessControlEntrySql($classId, $objectIdentityId, $field, $i, $sid, $ace->getStrategy(), $ace->getMask(), $ace->isGranting(), $ace->isAuditSuccess(), $ace->isAuditFailure())); - $aceId = $this->connection->executeQuery($this->getSelectAccessControlEntryIdSql($classId, $objectIdentityId, $field, $i))->fetchColumn(); - $this->loadedAces[$aceId] = $ace; - - $aceIdProperty = new \ReflectionProperty('Symfony\Component\Security\Acl\Domain\Entry', 'id'); - $aceIdProperty->setAccessible(true); - $aceIdProperty->setValue($ace, intval($aceId)); - } else { - $currentIds[$ace->getId()] = true; - } - } - } - - foreach ($changes[0] as $old) { - for ($i=0,$c=count($old); $i<$c; $i++) { - $ace = $old[$i]; - - if (!isset($currentIds[$ace->getId()])) { - $this->connection->executeQuery($this->getDeleteAccessControlEntrySql($ace->getId())); - unset($this->loadedAces[$ace->getId()]); - } - } - } - } - - /** - * This processes changes on an ACE related property (classAces, or objectAces). - * - * @param string $name - * @param array $changes - * @return void - */ - private function updateAceProperty($name, array $changes) - { - list($old, $new) = $changes; - - $sids = new \SplObjectStorage(); - $classIds = new \SplObjectStorage(); - $currentIds = array(); - for ($i=0,$c=count($new); $i<$c; $i++) { - $ace = $new[$i]; - - if (null === $ace->getId()) { - if ($sids->contains($ace->getSecurityIdentity())) { - $sid = $sids->offsetGet($ace->getSecurityIdentity()); - } else { - $sid = $this->createOrRetrieveSecurityIdentityId($ace->getSecurityIdentity()); - } - - $oid = $ace->getAcl()->getObjectIdentity(); - if ($classIds->contains($oid)) { - $classId = $classIds->offsetGet($oid); - } else { - $classId = $this->createOrRetrieveClassId($oid->getType()); - } - - $objectIdentityId = $name === 'classAces' ? null : $ace->getAcl()->getId(); - - $this->connection->executeQuery($this->getInsertAccessControlEntrySql($classId, $objectIdentityId, null, $i, $sid, $ace->getStrategy(), $ace->getMask(), $ace->isGranting(), $ace->isAuditSuccess(), $ace->isAuditFailure())); - $aceId = $this->connection->executeQuery($this->getSelectAccessControlEntryIdSql($classId, $objectIdentityId, null, $i))->fetchColumn(); - $this->loadedAces[$aceId] = $ace; - - $aceIdProperty = new \ReflectionProperty($ace, 'id'); - $aceIdProperty->setAccessible(true); - $aceIdProperty->setValue($ace, intval($aceId)); - } else { - $currentIds[$ace->getId()] = true; - } - } - - for ($i=0,$c=count($old); $i<$c; $i++) { - $ace = $old[$i]; - - if (!isset($currentIds[$ace->getId()])) { - $this->connection->executeQuery($this->getDeleteAccessControlEntrySql($ace->getId())); - unset($this->loadedAces[$ace->getId()]); - } - } - } - - /** - * Persists the changes which were made to ACEs to the database. - * - * @param \SplObjectStorage $aces - * @return void - */ - private function updateAces(\SplObjectStorage $aces) - { - foreach ($aces as $ace) { - $propertyChanges = $aces->offsetGet($ace); - $sets = array(); - - if (isset($propertyChanges['mask'])) { - $sets[] = sprintf('mask = %d', $propertyChanges['mask'][1]); - } - if (isset($propertyChanges['strategy'])) { - $sets[] = sprintf('granting_strategy = %s', $this->connection->quote($propertyChanges['strategy'])); - } - if (isset($propertyChanges['aceOrder'])) { - $sets[] = sprintf('ace_order = %d', $propertyChanges['aceOrder'][1]); - } - if (isset($propertyChanges['auditSuccess'])) { - $sets[] = sprintf('audit_success = %s', $this->connection->getDatabasePlatform()->convertBooleans($propertyChanges['auditSuccess'][1])); - } - if (isset($propertyChanges['auditFailure'])) { - $sets[] = sprintf('audit_failure = %s', $this->connection->getDatabasePlatform()->convertBooleans($propertyChanges['auditFailure'][1])); - } - - $this->connection->executeQuery($this->getUpdateAccessControlEntrySql($ace->getId(), $sets)); - } - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/DifferentNamespacesPerFileWithClassAsFirst.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/DifferentNamespacesPerFileWithClassAsFirst.php deleted file mode 100644 index bda2cc2..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/DifferentNamespacesPerFileWithClassAsFirst.php +++ /dev/null @@ -1,15 +0,0 @@ -test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test2() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test3() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test4() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test5() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test6() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test7() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test8() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - - } - - public function test9() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test10() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test11() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test12() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test13() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test14() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test15() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test16() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test17() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - - } - - public function test18() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test19() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test20() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test21() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test22() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test23() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test24() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test25() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test26() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test27() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - - } - - public function test28() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test29() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test30() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test31() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test32() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test33() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test34() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test35() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test36() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test37() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - - } - - public function test38() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test39() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/NoAnnotation.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/NoAnnotation.php deleted file mode 100644 index 1dae104..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/NoAnnotation.php +++ /dev/null @@ -1,5 +0,0 @@ -test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test2() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test3() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test4() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test5() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test6() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test7() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test8() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - - } - - public function test9() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test10() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test11() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test12() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test13() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test14() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test15() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test16() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test17() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - - } - - public function test18() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test19() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test20() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test21() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test22() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test23() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test24() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test25() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test26() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test27() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - - } - - public function test28() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test29() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test30() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test31() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test32() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test33() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test34() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test35() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test36() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test37() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - - } - - public function test38() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test39() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/TestInterface.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/TestInterface.php deleted file mode 100644 index 58c5e6a..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Fixtures/TestInterface.php +++ /dev/null @@ -1,13 +0,0 @@ -getMethod(); - - $time = microtime(true); - for ($i=0,$c=500; $i<$c; $i++) { - $reader->getMethodAnnotations($method); - } - $time = microtime(true) - $time; - - $this->printResults('cached reader (in-memory)', $time, $c); - } - - /** - * @group performance - */ - public function testCachedReadPerformanceWithFileCache() - { - $method = $this->getMethod(); - - // prime cache - $reader = new FileCacheReader(new AnnotationReader(), sys_get_temp_dir()); - $reader->getMethodAnnotations($method); - - $time = microtime(true); - for ($i=0,$c=500; $i<$c; $i++) { - $reader = new FileCacheReader(new AnnotationReader(), sys_get_temp_dir()); - $reader->getMethodAnnotations($method); - clearstatcache(); - } - $time = microtime(true) - $time; - - $this->printResults('cached reader (file)', $time, $c); - } - - /** - * @group performance - */ - public function testReadPerformance() - { - $method = $this->getMethod(); - - $time = microtime(true); - for ($i=0,$c=150; $i<$c; $i++) { - $reader = new AnnotationReader(); - $reader->getMethodAnnotations($method); - } - $time = microtime(true) - $time; - - $this->printResults('reader', $time, $c); - } - - /** - * @group performance - */ - public function testDocParsePerformance() - { - $imports = array( - 'ignorephpdoc' => 'Annotations\Annotation\IgnorePhpDoc', - 'ignoreannotation' => 'Annotations\Annotation\IgnoreAnnotation', - 'route' => 'Doctrine\Tests\Common\Annotations\Fixtures\Annotation\Route', - 'template' => 'Doctrine\Tests\Common\Annotations\Fixtures\Annotation\Template', - '__NAMESPACE__' => 'Doctrine\Tests\Common\Annotations\Fixtures', - ); - $ignored = array( - 'access', 'author', 'copyright', 'deprecated', 'example', 'ignore', - 'internal', 'link', 'see', 'since', 'tutorial', 'version', 'package', - 'subpackage', 'name', 'global', 'param', 'return', 'staticvar', - 'static', 'var', 'throws', 'inheritdoc', - ); - - $method = $this->getMethod(); - $methodComment = $method->getDocComment(); - $classComment = $method->getDeclaringClass()->getDocComment(); - - $time = microtime(true); - for ($i=0,$c=200; $i<$c; $i++) { - $parser = new DocParser(); - $parser->setImports($imports); - $parser->setIgnoredAnnotationNames($ignored); - $parser->setIgnoreNotImportedAnnotations(true); - - $parser->parse($methodComment); - $parser->parse($classComment); - } - $time = microtime(true) - $time; - - $this->printResults('doc-parser', $time, $c); - } - - /** - * @group performance - */ - public function testDocLexerPerformance() - { - $method = $this->getMethod(); - $methodComment = $method->getDocComment(); - $classComment = $method->getDeclaringClass()->getDocComment(); - - $time = microtime(true); - for ($i=0,$c=500; $i<$c; $i++) { - $lexer = new DocLexer(); - $lexer->setInput($methodComment); - $lexer->setInput($classComment); - } - $time = microtime(true) - $time; - - $this->printResults('doc-lexer', $time, $c); - } - - /** - * @group performance - */ - public function testPhpParserPerformanceWithShortCut() - { - $class = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\NamespacedSingleClassLOC1000'); - - $time = microtime(true); - for ($i=0,$c=500; $i<$c; $i++) { - $parser = new PhpParser(); - $parser->parseClass($class); - } - $time = microtime(true) - $time; - - $this->printResults('doc-parser-with-short-cut', $time, $c); - } - - /** - * @group performance - */ - public function testPhpParserPerformanceWithoutShortCut() - { - $class = new \ReflectionClass('SingleClassLOC1000'); - - $time = microtime(true); - for ($i=0,$c=500; $i<$c; $i++) { - $parser = new PhpParser(); - $parser->parseClass($class); - } - $time = microtime(true) - $time; - - $this->printResults('doc-parser-without-short-cut', $time, $c); - } - - private function getMethod() - { - return new \ReflectionMethod('Doctrine\Tests\Common\Annotations\Fixtures\Controller', 'helloAction'); - } - - private function printResults($test, $time, $iterations) - { - if (0 == $iterations) { - throw new \InvalidArgumentException('$iterations cannot be zero.'); - } - - $title = $test." results:\n"; - $iterationsText = sprintf("Iterations: %d\n", $iterations); - $totalTime = sprintf("Total Time: %.3f s\n", $time); - $iterationTime = sprintf("Time per iteration: %.3f ms\n", $time/$iterations * 1000); - - $max = max(strlen($title), strlen($iterationTime)) - 1; - - echo "\n".str_repeat('-', $max)."\n"; - echo $title; - echo str_repeat('=', $max)."\n"; - echo $iterationsText; - echo $totalTime; - echo $iterationTime; - echo str_repeat('-', $max)."\n"; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/PhpParserTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/PhpParserTest.php deleted file mode 100644 index 8de4aab..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/PhpParserTest.php +++ /dev/null @@ -1,179 +0,0 @@ -assertEquals(array( - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - ), $parser->parseClass($class)); - } - - public function testParseClassWithMultipleImportsInUseStatement() - { - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\MultipleImportsInUseStatement'); - $parser = new PhpParser(); - - $this->assertEquals(array( - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - ), $parser->parseClass($class)); - } - - public function testParseClassWhenNotUserDefined() - { - $parser = new PhpParser(); - $this->assertEquals(array(), $parser->parseClass(new \ReflectionClass('\stdClass'))); - } - - public function testParseClassWhenClassIsNotNamespaced() - { - $parser = new PhpParser(); - $class = new ReflectionClass('\AnnotationsTestsFixturesNonNamespacedClass'); - - $this->assertEquals(array( - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); - } - - public function testParseClassWhenClassIsInterface() - { - $parser = new PhpParser(); - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\TestInterface'); - - $this->assertEquals(array( - 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - ), $parser->parseClass($class)); - } - - public function testClassWithFullyQualifiedUseStatements() - { - $parser = new PhpParser(); - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\ClassWithFullyQualifiedUseStatements'); - - $this->assertEquals(array( - 'secure' => '\\' . __NAMESPACE__ . '\Fixtures\Annotation\Secure', - 'route' => '\\' . __NAMESPACE__ . '\Fixtures\Annotation\Route', - 'template' => '\\' . __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); - } - - public function testNamespaceAndClassCommentedOut() - { - $parser = new PhpParser(); - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\NamespaceAndClassCommentedOut'); - - $this->assertEquals(array( - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); - } - - public function testEqualNamespacesPerFileWithClassAsFirst() - { - $parser = new PhpParser(); - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\EqualNamespacesPerFileWithClassAsFirst'); - - $this->assertEquals(array( - 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - ), $parser->parseClass($class)); - } - - public function testEqualNamespacesPerFileWithClassAsLast() - { - $parser = new PhpParser(); - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\EqualNamespacesPerFileWithClassAsLast'); - - $this->assertEquals(array( - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); - } - - public function testDifferentNamespacesPerFileWithClassAsFirst() - { - $parser = new PhpParser(); - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\DifferentNamespacesPerFileWithClassAsFirst'); - - $this->assertEquals(array( - 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - ), $parser->parseClass($class)); - } - - public function testDifferentNamespacesPerFileWithClassAsLast() - { - $parser = new PhpParser(); - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\DifferentNamespacesPerFileWithClassAsLast'); - - $this->assertEquals(array( - 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); - } - - public function testGlobalNamespacesPerFileWithClassAsFirst() - { - $parser = new PhpParser(); - $class = new \ReflectionClass('\GlobalNamespacesPerFileWithClassAsFirst'); - - $this->assertEquals(array( - 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - ), $parser->parseClass($class)); - } - - public function testGlobalNamespacesPerFileWithClassAsLast() - { - $parser = new PhpParser(); - $class = new ReflectionClass('\GlobalNamespacesPerFileWithClassAsLast'); - - $this->assertEquals(array( - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); - } - - public function testNamespaceWithClosureDeclaration() - { - $parser = new PhpParser(); - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\NamespaceWithClosureDeclaration'); - - $this->assertEquals(array( - 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); - } - - public function testIfPointerResetsOnMultipleParsingTries() - { - $parser = new PhpParser(); - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\NamespaceWithClosureDeclaration'); - - $this->assertEquals(array( - 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); - - $this->assertEquals(array( - 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/SimpleAnnotationReaderTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/SimpleAnnotationReaderTest.php deleted file mode 100644 index 376539f..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/SimpleAnnotationReaderTest.php +++ /dev/null @@ -1,97 +0,0 @@ -getReader(); - $class = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassDDC1660'); - - $this->assertTrue(class_exists('Doctrine\Tests\Common\Annotations\Fixtures\Annotation\Version')); - $this->assertCount(1, $reader->getClassAnnotations($class)); - $this->assertCount(1, $reader->getMethodAnnotations($class->getMethod('bar'))); - $this->assertCount(1, $reader->getPropertyAnnotations($class->getProperty('foo'))); - } - - protected function getReader() - { - $reader = new SimpleAnnotationReader(); - $reader->addNamespace(__NAMESPACE__); - $reader->addNamespace(__NAMESPACE__ . '\Fixtures'); - $reader->addNamespace(__NAMESPACE__ . '\Fixtures\Annotation'); - - return $reader; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM55Test.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM55Test.php deleted file mode 100644 index a7b9e2f..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM55Test.php +++ /dev/null @@ -1,65 +0,0 @@ -getClassAnnotations($class); - } - - public function testAnnotation() - { - $class = new \ReflectionClass(__NAMESPACE__ . '\\DCOM55Consumer'); - $reader = new \Doctrine\Common\Annotations\AnnotationReader(); - $annots = $reader->getClassAnnotations($class); - - $this->assertEquals(1, count($annots)); - $this->assertInstanceOf(__NAMESPACE__.'\\DCOM55Annotation', $annots[0]); - } - - public function testParseAnnotationDocblocks() - { - $class = new \ReflectionClass(__NAMESPACE__ . '\\DCOM55Annotation'); - $reader = new \Doctrine\Common\Annotations\AnnotationReader(); - $annots = $reader->getClassAnnotations($class); - - $this->assertEquals(0, count($annots)); - } -} - -/** - * @Controller - */ -class Dummy -{ - -} - -/** - * @Annotation - */ -class DCOM55Annotation -{ - -} - -/** - * @DCOM55Annotation - */ -class DCOM55Consumer -{ - -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Entity.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Entity.php deleted file mode 100644 index 708bcc9..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Entity.php +++ /dev/null @@ -1,8 +0,0 @@ -getClassAnnotations(new \ReflectionClass(__NAMESPACE__."\MappedClass")); - - foreach ($result as $annot) { - $classAnnotations[get_class($annot)] = $annot; - } - - $this->assertTrue(!isset($classAnnotations['']), 'Class "xxx" is not a valid entity or mapped super class.'); - } - - public function testIssueGlobalNamespace() - { - $docblock = "@Entity"; - $parser = new \Doctrine\Common\Annotations\DocParser(); - $parser->setImports(array( - "__NAMESPACE__" =>"Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM\Mapping" - )); - - $annots = $parser->parse($docblock); - - $this->assertEquals(1, count($annots)); - $this->assertInstanceOf("Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM\Mapping\Entity", $annots[0]); - } - - public function testIssueNamespaces() - { - $docblock = "@Entity"; - $parser = new \Doctrine\Common\Annotations\DocParser(); - $parser->addNamespace("Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM"); - - $annots = $parser->parse($docblock); - - $this->assertEquals(1, count($annots)); - $this->assertInstanceOf("Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM\Entity", $annots[0]); - } - - public function testIssueMultipleNamespaces() - { - $docblock = "@Entity"; - $parser = new \Doctrine\Common\Annotations\DocParser(); - $parser->addNamespace("Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM\Mapping"); - $parser->addNamespace("Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM"); - - $annots = $parser->parse($docblock); - - $this->assertEquals(1, count($annots)); - $this->assertInstanceOf("Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM\Mapping\Entity", $annots[0]); - } - - public function testIssueWithNamespacesOrImports() - { - $docblock = "@Entity"; - $parser = new \Doctrine\Common\Annotations\DocParser(); - $annots = $parser->parse($docblock); - - $this->assertEquals(1, count($annots)); - $this->assertInstanceOf("Entity", $annots[0]); - $this->assertEquals(1, count($annots)); - } - - - public function testIssueSimpleAnnotationReader() - { - $reader = new \Doctrine\Common\Annotations\SimpleAnnotationReader(); - $reader->addNamespace('Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM\Mapping'); - $annots = $reader->getClassAnnotations(new \ReflectionClass(__NAMESPACE__."\MappedClass")); - - $this->assertEquals(1, count($annots)); - $this->assertInstanceOf("Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM\Mapping\Entity", $annots[0]); - } - -} - -/** - * @Entity - */ -class MappedClass -{ - -} - - -namespace Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM\Mapping; -/** -* @Annotation -*/ -class Entity -{ - -} - -namespace Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM; -/** -* @Annotation -*/ -class Entity -{ - -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/TopLevelAnnotation.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/TopLevelAnnotation.php deleted file mode 100644 index ff3ca37..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Annotations/TopLevelAnnotation.php +++ /dev/null @@ -1,8 +0,0 @@ -markTestSkipped('The ' . __CLASS__ .' requires the use of APC'); - } - } - - protected function _getCacheDriver() - { - return new ApcCache(); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/ArrayCacheTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/ArrayCacheTest.php deleted file mode 100644 index 7192717..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/ArrayCacheTest.php +++ /dev/null @@ -1,13 +0,0 @@ -_getCacheDriver(); - - // Test save - $cache->save('test_key', 'testing this out'); - - // Test contains to test that save() worked - $this->assertTrue($cache->contains('test_key')); - - // Test fetch - $this->assertEquals('testing this out', $cache->fetch('test_key')); - - // Test delete - $cache->save('test_key2', 'test2'); - $cache->delete('test_key2'); - $this->assertFalse($cache->contains('test_key2')); - } - - public function testDeleteAll() - { - $cache = $this->_getCacheDriver(); - $cache->save('test_key1', '1'); - $cache->save('test_key2', '2'); - $cache->deleteAll(); - - $this->assertFalse($cache->contains('test_key1')); - $this->assertFalse($cache->contains('test_key2')); - } - - public function testFlushAll() - { - $cache = $this->_getCacheDriver(); - $cache->save('test_key1', '1'); - $cache->save('test_key2', '2'); - $cache->flushAll(); - - $this->assertFalse($cache->contains('test_key1')); - $this->assertFalse($cache->contains('test_key2')); - } - - public function testNamespace() - { - $cache = $this->_getCacheDriver(); - $cache->setNamespace('test_'); - $cache->save('key1', 'test'); - - $this->assertTrue($cache->contains('key1')); - - $cache->setNamespace('test2_'); - - $this->assertFalse($cache->contains('key1')); - } - - /** - * @group DCOM-43 - */ - public function testGetStats() - { - if ($this instanceof ArrayCacheTest || $this instanceof ZendDataCacheTest ) { - $this->markTestSkipped("Statistics are not available for this driver"); - } - - $cache = $this->_getCacheDriver(); - $stats = $cache->getStats(); - - - $this->assertArrayHasKey(Cache::STATS_HITS, $stats); - $this->assertArrayHasKey(Cache::STATS_MISSES, $stats); - $this->assertArrayHasKey(Cache::STATS_UPTIME, $stats); - $this->assertArrayHasKey(Cache::STATS_MEMORY_USAGE, $stats); - $this->assertArrayHasKey(Cache::STATS_MEMORY_AVAILIABLE, $stats); - } - - /** - * @return \Doctrine\Common\Cache\CacheProvider - */ - abstract protected function _getCacheDriver(); -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/MemcacheCacheTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/MemcacheCacheTest.php deleted file mode 100644 index 362ff69..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/MemcacheCacheTest.php +++ /dev/null @@ -1,38 +0,0 @@ -_memcache = new \Memcache; - $ok = @$this->_memcache->connect('localhost', 11211); - if (!$ok) { - $this->markTestSkipped('The ' . __CLASS__ .' requires the use of memcache'); - } - } else { - $this->markTestSkipped('The ' . __CLASS__ .' requires the use of memcache'); - } - } - - public function testNoExpire() { - $cache = $this->_getCacheDriver(); - $cache->save('noexpire', 'value', 0); - sleep(1); - $this->assertTrue($cache->contains('noexpire'), 'Memcache provider should support no-expire'); - } - - protected function _getCacheDriver() - { - $driver = new MemcacheCache(); - $driver->setMemcache($this->_memcache); - return $driver; - } - -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php deleted file mode 100644 index 947ba75..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php +++ /dev/null @@ -1,40 +0,0 @@ -memcached = new \Memcached(); - $this->memcached->setOption(\Memcached::OPT_COMPRESSION, false); - $this->memcached->addServer('127.0.0.1', 11211); - - $fh = @fsockopen('127.0.0.1', 11211); - if (!$fh) { - $this->markTestSkipped('The ' . __CLASS__ .' requires the use of memcache'); - } - } else { - $this->markTestSkipped('The ' . __CLASS__ .' requires the use of memcache'); - } - } - - public function testNoExpire() { - $cache = $this->_getCacheDriver(); - $cache->save('noexpire', 'value', 0); - sleep(1); - $this->assertTrue($cache->contains('noexpire'), 'Memcache provider should support no-expire'); - } - - protected function _getCacheDriver() - { - $driver = new MemcachedCache(); - $driver->setMemcached($this->memcached); - return $driver; - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/WinCacheCacheTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/WinCacheCacheTest.php deleted file mode 100644 index cb363df..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/WinCacheCacheTest.php +++ /dev/null @@ -1,20 +0,0 @@ -markTestSkipped('The ' . __CLASS__ .' requires the use of Wincache'); - } - } - - protected function _getCacheDriver() - { - return new WincacheCache(); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/XcacheCacheTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/XcacheCacheTest.php deleted file mode 100644 index 6259848..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/XcacheCacheTest.php +++ /dev/null @@ -1,20 +0,0 @@ -markTestSkipped('The ' . __CLASS__ .' requires the use of xcache'); - } - } - - protected function _getCacheDriver() - { - return new XcacheCache(); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/ZendDataCacheTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/ZendDataCacheTest.php deleted file mode 100644 index 27dcf35..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Cache/ZendDataCacheTest.php +++ /dev/null @@ -1,20 +0,0 @@ -markTestSkipped('The ' . __CLASS__ .' requires the use of Zend Data Cache which only works in apache2handler SAPI'); - } - } - - protected function _getCacheDriver() - { - return new ZendDataCache(); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/ClassLoaderTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/ClassLoaderTest.php deleted file mode 100644 index 567cf91..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/ClassLoaderTest.php +++ /dev/null @@ -1,45 +0,0 @@ -setIncludePath(__DIR__); - $classLoader->setFileExtension('.class.php'); - $classLoader->setNamespaceSeparator('_'); - - $this->assertTrue($classLoader->canLoadClass('ClassLoaderTest_ClassA')); - $this->assertTrue($classLoader->canLoadClass('ClassLoaderTest_ClassB')); - $this->assertTrue($classLoader->canLoadClass('ClassLoaderTest_ClassC')); - $this->assertFalse($classLoader->canLoadClass('OtherClass')); - $this->assertEquals($classLoader->loadClass('ClassLoaderTest_ClassA'), true); - $this->assertEquals($classLoader->loadClass('ClassLoaderTest_ClassB'), true); - $this->assertEquals($classLoader->loadClass('ClassLoaderTest_ClassC'), true); - } - - public function testClassExists() - { - $this->assertFalse(ClassLoader::classExists('ClassLoaderTest\ClassD')); - $badLoader = function($className) { - require __DIR__ . '/ClassLoaderTest/ClassD.php'; - return true; - }; - spl_autoload_register($badLoader); - $this->assertTrue(ClassLoader::classExists('ClassLoaderTest\ClassD')); - spl_autoload_unregister($badLoader); - } - - public function testGetClassLoader() - { - $cl = new ClassLoader('ClassLoaderTest', __DIR__); - $cl->register(); - $this->assertTrue(ClassLoader::getClassLoader('ClassLoaderTest\ClassD') instanceof \Doctrine\Common\ClassLoader); - $this->assertNull(ClassLoader::getClassLoader('This\Class\Does\Not\Exist')); - $cl->unregister(); - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassA.class.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassA.class.php deleted file mode 100644 index 8554654..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassA.class.php +++ /dev/null @@ -1,6 +0,0 @@ -_coll = new \Doctrine\Common\Collections\ArrayCollection; - } - - public function testIssetAndUnset() - { - $this->assertFalse(isset($this->_coll[0])); - $this->_coll->add('testing'); - $this->assertTrue(isset($this->_coll[0])); - unset($this->_coll[0]); - $this->assertFalse(isset($this->_coll[0])); - } - - public function testToString() - { - $this->_coll->add('testing'); - $this->assertTrue(is_string((string) $this->_coll)); - } - - public function testRemovingNonExistentEntryReturnsNull() - { - $this->assertEquals(null, $this->_coll->remove('testing_does_not_exist')); - } - - public function testExists() - { - $this->_coll->add("one"); - $this->_coll->add("two"); - $exists = $this->_coll->exists(function($k, $e) { return $e == "one"; }); - $this->assertTrue($exists); - $exists = $this->_coll->exists(function($k, $e) { return $e == "other"; }); - $this->assertFalse($exists); - } - - public function testMap() - { - $this->_coll->add(1); - $this->_coll->add(2); - $res = $this->_coll->map(function($e) { return $e * 2; }); - $this->assertEquals(array(2, 4), $res->toArray()); - } - - public function testFilter() - { - $this->_coll->add(1); - $this->_coll->add("foo"); - $this->_coll->add(3); - $res = $this->_coll->filter(function($e) { return is_numeric($e); }); - $this->assertEquals(array(0 => 1, 2 => 3), $res->toArray()); - } - - public function testFirstAndLast() - { - $this->_coll->add('one'); - $this->_coll->add('two'); - - $this->assertEquals($this->_coll->first(), 'one'); - $this->assertEquals($this->_coll->last(), 'two'); - } - - public function testArrayAccess() - { - $this->_coll[] = 'one'; - $this->_coll[] = 'two'; - - $this->assertEquals($this->_coll[0], 'one'); - $this->assertEquals($this->_coll[1], 'two'); - - unset($this->_coll[0]); - $this->assertEquals($this->_coll->count(), 1); - } - - public function testContainsKey() - { - $this->_coll[5] = 'five'; - $this->assertTrue($this->_coll->containsKey(5)); - } - - public function testContains() - { - $this->_coll[0] = 'test'; - $this->assertTrue($this->_coll->contains('test')); - } - - public function testSearch() - { - $this->_coll[0] = 'test'; - $this->assertEquals(0, $this->_coll->indexOf('test')); - } - - public function testGet() - { - $this->_coll[0] = 'test'; - $this->assertEquals('test', $this->_coll->get(0)); - } - - public function testGetKeys() - { - $this->_coll[] = 'one'; - $this->_coll[] = 'two'; - $this->assertEquals(array(0, 1), $this->_coll->getKeys()); - } - - public function testGetValues() - { - $this->_coll[] = 'one'; - $this->_coll[] = 'two'; - $this->assertEquals(array('one', 'two'), $this->_coll->getValues()); - } - - public function testCount() - { - $this->_coll[] = 'one'; - $this->_coll[] = 'two'; - $this->assertEquals($this->_coll->count(), 2); - $this->assertEquals(count($this->_coll), 2); - } - - public function testForAll() - { - $this->_coll[] = 'one'; - $this->_coll[] = 'two'; - $this->assertEquals($this->_coll->forAll(function($k, $e) { return is_string($e); }), true); - $this->assertEquals($this->_coll->forAll(function($k, $e) { return is_array($e); }), false); - } - - public function testPartition() - { - $this->_coll[] = true; - $this->_coll[] = false; - $partition = $this->_coll->partition(function($k, $e) { return $e == true; }); - $this->assertEquals($partition[0][0], true); - $this->assertEquals($partition[1][0], false); - } - - public function testClear() - { - $this->_coll[] = 'one'; - $this->_coll[] = 'two'; - $this->_coll->clear(); - $this->assertEquals($this->_coll->isEmpty(), true); - } - - public function testRemove() - { - $this->_coll[] = 'one'; - $this->_coll[] = 'two'; - $el = $this->_coll->remove(0); - - $this->assertEquals('one', $el); - $this->assertEquals($this->_coll->contains('one'), false); - $this->assertNull($this->_coll->remove(0)); - } - - public function testRemoveElement() - { - $this->_coll[] = 'one'; - $this->_coll[] = 'two'; - - $this->assertTrue($this->_coll->removeElement('two')); - $this->assertFalse($this->_coll->contains('two')); - $this->assertFalse($this->_coll->removeElement('two')); - } - - public function testSlice() - { - $this->_coll[] = 'one'; - $this->_coll[] = 'two'; - $this->_coll[] = 'three'; - - $slice = $this->_coll->slice(0, 1); - $this->assertInternalType('array', $slice); - $this->assertEquals(array('one'), $slice); - - $slice = $this->_coll->slice(1); - $this->assertEquals(array(1 => 'two', 2 => 'three'), $slice); - - $slice = $this->_coll->slice(1, 1); - $this->assertEquals(array(1 => 'two'), $slice); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/DoctrineExceptionTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/DoctrineExceptionTest.php deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/EventManagerTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/EventManagerTest.php deleted file mode 100644 index 2b11b20..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/EventManagerTest.php +++ /dev/null @@ -1,88 +0,0 @@ -_eventManager = new EventManager; - $this->_preFooInvoked = false; - $this->_postFooInvoked = false; - } - - public function testInitialState() - { - $this->assertEquals(array(), $this->_eventManager->getListeners()); - $this->assertFalse($this->_eventManager->hasListeners(self::preFoo)); - $this->assertFalse($this->_eventManager->hasListeners(self::postFoo)); - } - - public function testAddEventListener() - { - $this->_eventManager->addEventListener(array('preFoo', 'postFoo'), $this); - $this->assertTrue($this->_eventManager->hasListeners(self::preFoo)); - $this->assertTrue($this->_eventManager->hasListeners(self::postFoo)); - $this->assertEquals(1, count($this->_eventManager->getListeners(self::preFoo))); - $this->assertEquals(1, count($this->_eventManager->getListeners(self::postFoo))); - $this->assertEquals(2, count($this->_eventManager->getListeners())); - } - - public function testDispatchEvent() - { - $this->_eventManager->addEventListener(array('preFoo', 'postFoo'), $this); - $this->_eventManager->dispatchEvent(self::preFoo); - $this->assertTrue($this->_preFooInvoked); - $this->assertFalse($this->_postFooInvoked); - } - - public function testRemoveEventListener() - { - $this->_eventManager->addEventListener(array('preBar'), $this); - $this->assertTrue($this->_eventManager->hasListeners(self::preBar)); - $this->_eventManager->removeEventListener(array('preBar'), $this); - $this->assertFalse($this->_eventManager->hasListeners(self::preBar)); - } - - public function testAddEventSubscriber() - { - $eventSubscriber = new TestEventSubscriber(); - $this->_eventManager->addEventSubscriber($eventSubscriber); - $this->assertTrue($this->_eventManager->hasListeners(self::preFoo)); - $this->assertTrue($this->_eventManager->hasListeners(self::postFoo)); - } - - /* Listener methods */ - - public function preFoo(EventArgs $e) - { - $this->_preFooInvoked = true; - } - - public function postFoo(EventArgs $e) - { - $this->_postFooInvoked = true; - } -} - -class TestEventSubscriber implements \Doctrine\Common\EventSubscriber -{ - public function getSubscribedEvents() - { - return array('preFoo', 'postFoo'); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/ChainDriverTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/ChainDriverTest.php deleted file mode 100644 index e1825ae..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/ChainDriverTest.php +++ /dev/null @@ -1,94 +0,0 @@ -getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - - $chain = new MappingDriverChain(); - - $driver1 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $driver1->expects($this->never()) - ->method('loadMetadataForClass'); - $driver1->expectS($this->never()) - ->method('isTransient'); - - $driver2 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $driver2->expects($this->at(0)) - ->method('loadMetadataForClass') - ->with($this->equalTo($className), $this->equalTo($classMetadata)); - $driver2->expects($this->at(1)) - ->method('isTransient') - ->with($this->equalTo($className)) - ->will($this->returnValue( true )); - - $chain->addDriver($driver1, 'Doctrine\Tests\Models\Company'); - $chain->addDriver($driver2, 'Doctrine\Tests\Common\Persistence\Mapping'); - - $chain->loadMetadataForClass($className, $classMetadata); - - $this->assertTrue( $chain->isTransient($className) ); - } - - public function testLoadMetadata_NoDelegatorFound_ThrowsMappingException() - { - $className = 'Doctrine\Tests\Common\Persistence\Mapping\DriverChainEntity'; - $classMetadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - - $chain = new MappingDriverChain(); - - $this->setExpectedException('Doctrine\Common\Persistence\Mapping\MappingException'); - $chain->loadMetadataForClass($className, $classMetadata); - } - - public function testGatherAllClassNames() - { - $className = 'Doctrine\Tests\Common\Persistence\Mapping\DriverChainEntity'; - $classMetadata = $this->getMock('Doctrine\Common\Peristence\ClassMetadata'); - - $chain = new MappingDriverChain(); - - $driver1 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $driver1->expects($this->once()) - ->method('getAllClassNames') - ->will($this->returnValue(array('Doctrine\Tests\Models\Company\Foo'))); - - $driver2 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $driver2->expects($this->once()) - ->method('getAllClassNames') - ->will($this->returnValue(array('Doctrine\Tests\ORM\Mapping\Bar', 'Doctrine\Tests\ORM\Mapping\Baz', 'FooBarBaz'))); - - $chain->addDriver($driver1, 'Doctrine\Tests\Models\Company'); - $chain->addDriver($driver2, 'Doctrine\Tests\ORM\Mapping'); - - $this->assertEquals(array( - 'Doctrine\Tests\Models\Company\Foo', - 'Doctrine\Tests\ORM\Mapping\Bar', - 'Doctrine\Tests\ORM\Mapping\Baz' - ), $chain->getAllClassNames()); - } - - /** - * @group DDC-706 - */ - public function testIsTransient() - { - $driver1 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $chain = new MappingDriverChain(); - $chain->addDriver($driver1, 'Doctrine\Tests\Models\CMS'); - - $this->assertTrue($chain->isTransient('stdClass'), "stdClass isTransient"); - } -} - -class DriverChainEntity -{ - -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/ClassMetadataFactoryTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/ClassMetadataFactoryTest.php deleted file mode 100644 index 9fe3299..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/ClassMetadataFactoryTest.php +++ /dev/null @@ -1,134 +0,0 @@ -getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $this->cmf = new TestClassMetadataFactory($driver, $metadata); - } - - public function testGetCacheDriver() - { - $this->assertNull($this->cmf->getCacheDriver()); - $cache = new ArrayCache(); - $this->cmf->setCacheDriver($cache); - $this->assertSame($cache, $this->cmf->getCacheDriver()); - } - - public function testGetMetadataFor() - { - $metadata = $this->cmf->getMetadataFor('stdClass'); - - $this->assertInstanceOf('Doctrine\Common\Persistence\Mapping\ClassMetadata', $metadata); - $this->assertTrue($this->cmf->hasMetadataFor('stdClass')); - } - - public function testGetParentMetadata() - { - $metadata = $this->cmf->getMetadataFor(__NAMESPACE__ . '\ChildEntity'); - - $this->assertInstanceOf('Doctrine\Common\Persistence\Mapping\ClassMetadata', $metadata); - $this->assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__ . '\ChildEntity')); - $this->assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__ . '\RootEntity')); - } - - public function testGetCachedMetadata() - { - $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $cache = new ArrayCache(); - $cache->save(__NAMESPACE__. '\ChildEntity$CLASSMETADATA', $metadata); - - $this->cmf->setCacheDriver($cache); - - $loadedMetadata = $this->cmf->getMetadataFor(__NAMESPACE__ . '\ChildEntity'); - $this->assertSame($loadedMetadata, $metadata); - } - - public function testCacheGetMetadataFor() - { - $cache = new ArrayCache(); - $this->cmf->setCacheDriver($cache); - - $loadedMetadata = $this->cmf->getMetadataFor(__NAMESPACE__ . '\ChildEntity'); - - $this->assertSame($loadedMetadata, $cache->fetch(__NAMESPACE__. '\ChildEntity$CLASSMETADATA')); - } - - public function testGetAliasedMetadata() - { - $loadedMetadata = $this->cmf->getMetadataFor('prefix:ChildEntity'); - - $this->assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__ . '\ChildEntity')); - $this->assertTrue($this->cmf->hasMetadataFor('prefix:ChildEntity')); - } -} - -class TestClassMetadataFactory extends AbstractClassMetadataFactory -{ - public $driver; - public $metadata; - - public function __construct($driver, $metadata) - { - $this->driver = $driver; - $this->metadata = $metadata; - } - - protected function doLoadMetadata($class, $parent, $rootEntityFound) - { - - } - - protected function getFqcnFromAlias($namespaceAlias, $simpleClassName) - { - return __NAMESPACE__ . '\\' . $simpleClassName; - } - - protected function initialize() - { - - } - - protected function newClassMetadataInstance($className) - { - return $this->metadata; - } - - protected function getDriver() - { - return $this->driver; - } - protected function wakeupReflection(ClassMetadata $class, ReflectionService $reflService) - { - } - - protected function initializeReflection(ClassMetadata $class, ReflectionService $reflService) - { - } -} - -class RootEntity -{ - -} - -class ChildEntity extends RootEntity -{ - -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/DefaultFileLocatorTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/DefaultFileLocatorTest.php deleted file mode 100644 index 3c600c4..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/DefaultFileLocatorTest.php +++ /dev/null @@ -1,90 +0,0 @@ -assertEquals(array($path), $locator->getPaths()); - - $locator = new DefaultFileLocator($path); - $this->assertEquals(array($path), $locator->getPaths()); - } - - public function testGetFileExtension() - { - $locator = new DefaultFileLocator(array(), ".yml"); - $this->assertEquals(".yml", $locator->getFileExtension()); - $locator->setFileExtension(".xml"); - $this->assertEquals(".xml", $locator->getFileExtension()); - } - - public function testUniquePaths() - { - $path = __DIR__ . "/_files"; - - $locator = new DefaultFileLocator(array($path, $path)); - $this->assertEquals(array($path), $locator->getPaths()); - } - - public function testFindMappingFile() - { - $path = __DIR__ . "/_files"; - - $locator = new DefaultFileLocator(array($path), ".yml"); - - $this->assertEquals(__DIR__ . '/_files/stdClass.yml', $locator->findMappingFile('stdClass')); - } - - public function testFindMappingFileNotFound() - { - $path = __DIR__ . "/_files"; - - $locator = new DefaultFileLocator(array($path), ".yml"); - - $this->setExpectedException( - 'Doctrine\Common\Persistence\Mapping\MappingException', - "No mapping file found named 'stdClass2.yml' for class 'stdClass2'" - ); - $locator->findMappingFile('stdClass2'); - } - - public function testGetAllClassNames() - { - $path = __DIR__ . "/_files"; - - $locator = new DefaultFileLocator(array($path), ".yml"); - $classes = $locator->getAllClassNames(null); - sort($classes); - - $this->assertEquals(array('global', 'stdClass'), $classes); - $this->assertEquals(array('stdClass'), $locator->getAllClassNames("global")); - } - - public function testGetAllClassNamesNonMatchingFileExtension() - { - $path = __DIR__ . "/_files"; - - $locator = new DefaultFileLocator(array($path), ".xml"); - $this->assertEquals(array(), $locator->getAllClassNames("global")); - } - - public function testFileExists() - { - $path = __DIR__ . "/_files"; - - $locator = new DefaultFileLocator(array($path), ".yml"); - - $this->assertTrue($locator->fileExists("stdClass")); - $this->assertFalse($locator->fileExists("stdClass2")); - $this->assertTrue($locator->fileExists("global")); - $this->assertFalse($locator->fileExists("global2")); - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/FileDriverTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/FileDriverTest.php deleted file mode 100644 index 020c242..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/FileDriverTest.php +++ /dev/null @@ -1,142 +0,0 @@ -assertNull($driver->getGlobalBasename()); - - $driver->setGlobalBasename("global"); - $this->assertEquals("global", $driver->getGlobalBasename()); - } - - public function testGetElementFromGlobalFile() - { - $driver = new TestFileDriver($this->newLocator()); - $driver->setGlobalBasename("global"); - - $element = $driver->getElement('stdGlobal'); - - $this->assertEquals('stdGlobal', $element); - } - - public function testGetElementFromFile() - { - $locator = $this->newLocator(); - $locator->expects($this->once()) - ->method('findMappingFile') - ->with($this->equalTo('stdClass')) - ->will($this->returnValue(__DIR__ . '/_files/stdClass.yml')); - - $driver = new TestFileDriver($locator); - - $this->assertEquals('stdClass', $driver->getElement('stdClass')); - } - - public function testGetAllClassNamesGlobalBasename() - { - $driver = new TestFileDriver($this->newLocator()); - $driver->setGlobalBasename("global"); - - $classNames = $driver->getAllClassNames(); - - $this->assertEquals(array('stdGlobal', 'stdGlobal2'), $classNames); - } - - public function testGetAllClassNamesFromMappingFile() - { - $locator = $this->newLocator(); - $locator->expects($this->any()) - ->method('getAllClassNames') - ->with($this->equalTo(null)) - ->will($this->returnValue(array('stdClass'))); - $driver = new TestFileDriver($locator); - - $classNames = $driver->getAllClassNames(); - - $this->assertEquals(array('stdClass'), $classNames); - } - - public function testGetAllClassNamesBothSources() - { - $locator = $this->newLocator(); - $locator->expects($this->any()) - ->method('getAllClassNames') - ->with($this->equalTo('global')) - ->will($this->returnValue(array('stdClass'))); - $driver = new TestFileDriver($locator); - $driver->setGlobalBasename("global"); - - $classNames = $driver->getAllClassNames(); - - $this->assertEquals(array('stdGlobal', 'stdGlobal2', 'stdClass'), $classNames); - } - - public function testIsNotTransient() - { - $locator = $this->newLocator(); - $locator->expects($this->once()) - ->method('fileExists') - ->with($this->equalTo('stdClass')) - ->will($this->returnValue( true )); - - $driver = new TestFileDriver($locator); - $driver->setGlobalBasename("global"); - - $this->assertFalse($driver->isTransient('stdClass')); - $this->assertFalse($driver->isTransient('stdGlobal')); - $this->assertFalse($driver->isTransient('stdGlobal2')); - } - - public function testIsTransient() - { - $locator = $this->newLocator(); - $locator->expects($this->once()) - ->method('fileExists') - ->with($this->equalTo('stdClass2')) - ->will($this->returnValue( false )); - - $driver = new TestFileDriver($locator); - - $this->assertTrue($driver->isTransient('stdClass2')); - } - - public function testNonLocatorFallback() - { - $driver = new TestFileDriver(__DIR__ . '/_files', '.yml'); - $this->assertTrue($driver->isTransient('stdClass2')); - $this->assertFalse($driver->isTransient('stdClass')); - } - - private function newLocator() - { - $locator = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\FileLocator'); - $locator->expects($this->any())->method('getFileExtension')->will($this->returnValue('.yml')); - $locator->expects($this->any())->method('getPaths')->will($this->returnValue(array(__DIR__ . "/_files"))); - return $locator; - } -} - -class TestFileDriver extends FileDriver -{ - protected function loadMappingFile($file) - { - if (strpos($file, "global.yml") !== false) { - return array('stdGlobal' => 'stdGlobal', 'stdGlobal2' => 'stdGlobal2'); - } - return array('stdClass' => 'stdClass'); - } - - public function loadMetadataForClass($className, ClassMetadata $metadata) - { - - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/PHPDriverTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/PHPDriverTest.php deleted file mode 100644 index 8fc4d80..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/PHPDriverTest.php +++ /dev/null @@ -1,18 +0,0 @@ -getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $metadata->expects($this->once())->method('getFieldNames'); - - $driver = new PHPDriver(array(__DIR__ . "/_files")); - $driver->loadMetadataForClass('TestEntity', $metadata); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/RuntimeReflectionServiceTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/RuntimeReflectionServiceTest.php deleted file mode 100644 index 5f06cad..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/RuntimeReflectionServiceTest.php +++ /dev/null @@ -1,70 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Persistence\Mapping; - -use Doctrine\Common\Persistence\Mapping\RuntimeReflectionService; - -/** - * @group DCOM-93 - */ -class RuntimeReflectionServiceTest extends \PHPUnit_Framework_TestCase -{ - private $reflectionService; - - public function setUp() - { - $this->reflectionService = new RuntimeReflectionService(); - } - - public function testShortname() - { - $this->assertEquals("RuntimeReflectionServiceTest", $this->reflectionService->getClassShortName(__CLASS__)); - } - - public function testClassNamespaceName() - { - $this->assertEquals("Doctrine\Tests\Common\Persistence\Mapping", $this->reflectionService->getClassNamespace(__CLASS__)); - } - - public function testGetParentClasses() - { - $classes = $this->reflectionService->getParentClasses(__CLASS__); - $this->assertTrue(count($classes) >= 1, "The test class ".__CLASS__." should have at least one parent."); - } - - public function testGetReflectionClass() - { - $class = $this->reflectionService->getClass(__CLASS__); - $this->assertInstanceOf("ReflectionClass", $class); - } - - public function testGetMethods() - { - $this->assertTrue($this->reflectionService->hasPublicMethod(__CLASS__, "testGetMethods")); - $this->assertFalse($this->reflectionService->hasPublicMethod(__CLASS__, "testGetMethods2")); - } - - public function testGetAccessibleProperty() - { - $reflProp = $this->reflectionService->getAccessibleProperty(__CLASS__, "reflectionService"); - $this->assertInstanceOf("ReflectionProperty", $reflProp); - } -} - diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticPHPDriverTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticPHPDriverTest.php deleted file mode 100644 index 9f1c568..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticPHPDriverTest.php +++ /dev/null @@ -1,35 +0,0 @@ -getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $metadata->expects($this->once())->method('getFieldNames'); - - $driver = new StaticPHPDriver(array(__DIR__)); - $driver->loadMetadataForClass(__NAMESPACE__ . '\\TestEntity', $metadata); - } - - public function testGetAllClassNames() - { - $driver = new StaticPHPDriver(array(__DIR__)); - $classNames = $driver->getAllClassNames(); - - $this->assertContains( - 'Doctrine\Tests\Common\Persistence\Mapping\TestEntity', $classNames); - } -} - -class TestEntity -{ - static public function loadMetadata($metadata) - { - $metadata->getFieldNames(); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticReflectionServiceTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticReflectionServiceTest.php deleted file mode 100644 index ffce6d4..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticReflectionServiceTest.php +++ /dev/null @@ -1,70 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Persistence\Mapping; - -use Doctrine\Common\Persistence\Mapping\StaticReflectionService; - -/** - * @group DCOM-93 - */ -class StaticReflectionServiceTest extends \PHPUnit_Framework_TestCase -{ - private $reflectionService; - - public function setUp() - { - $this->reflectionService = new StaticReflectionService(); - } - - public function testShortname() - { - $this->assertEquals("StaticReflectionServiceTest", $this->reflectionService->getClassShortName(__CLASS__)); - } - - public function testClassNamespaceName() - { - $this->assertEquals("Doctrine\Tests\Common\Persistence\Mapping", $this->reflectionService->getClassNamespace(__CLASS__)); - } - - public function testGetParentClasses() - { - $classes = $this->reflectionService->getParentClasses(__CLASS__); - $this->assertTrue(count($classes) == 0, "The test class ".__CLASS__." should have no parents according to static reflection."); - } - - public function testGetReflectionClass() - { - $class = $this->reflectionService->getClass(__CLASS__); - $this->assertNull($class); - } - - public function testGetMethods() - { - $this->assertTrue($this->reflectionService->hasPublicMethod(__CLASS__, "testGetMethods")); - $this->assertFalse($this->reflectionService->hasPublicMethod(__CLASS__, "testGetMethods2")); - } - - public function testGetAccessibleProperty() - { - $reflProp = $this->reflectionService->getAccessibleProperty(__CLASS__, "reflectionService"); - $this->assertNull($reflProp); - } -} - diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/SymfonyFileLocatorTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/SymfonyFileLocatorTest.php deleted file mode 100644 index b51162e..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/SymfonyFileLocatorTest.php +++ /dev/null @@ -1,88 +0,0 @@ - $prefix)); - $this->assertEquals(array($path), $locator->getPaths()); - - $locator = new SymfonyFileLocator(array($path => $prefix)); - $this->assertEquals(array($path), $locator->getPaths()); - } - - public function testGetPrefixes() - { - $path = __DIR__ . "/_files"; - $prefix = "Foo"; - - $locator = new SymfonyFileLocator(array($path => $prefix)); - $this->assertEquals(array($path => $prefix), $locator->getNamespacePrefixes()); - } - - public function testGetFileExtension() - { - $locator = new SymfonyFileLocator(array(), ".yml"); - $this->assertEquals(".yml", $locator->getFileExtension()); - $locator->setFileExtension(".xml"); - $this->assertEquals(".xml", $locator->getFileExtension()); - } - - public function testFileExists() - { - $path = __DIR__ . "/_files"; - $prefix = "Foo"; - - $locator = new SymfonyFileLocator(array($path => $prefix), ".yml"); - - $this->assertTrue($locator->fileExists("Foo\stdClass")); - $this->assertTrue($locator->fileExists("Foo\global")); - $this->assertFalse($locator->fileExists("Foo\stdClass2")); - $this->assertFalse($locator->fileExists("Foo\global2")); - } - - public function testGetAllClassNames() - { - $path = __DIR__ . "/_files"; - $prefix = "Foo"; - - $locator = new SymfonyFileLocator(array($path => $prefix), ".yml"); - $classes = $locator->getAllClassNames(null); - sort($classes); - - $this->assertEquals(array("Foo\\global", "Foo\\stdClass"), $classes); - $this->assertEquals(array("Foo\\stdClass"), $locator->getAllClassNames("global")); - } - - public function testFindMappingFile() - { - $path = __DIR__ . "/_files"; - $prefix = "Foo"; - - $locator = new SymfonyFileLocator(array($path => $prefix), ".yml"); - - $this->assertEquals(__DIR__ . "/_files/stdClass.yml", $locator->findMappingFile("Foo\\stdClass")); - } - - public function testFindMappingFileNotFound() - { - $path = __DIR__ . "/_files"; - $prefix = "Foo"; - - $locator = new SymfonyFileLocator(array($path => $prefix), ".yml"); - - $this->setExpectedException( - "Doctrine\Common\Persistence\Mapping\MappingException", - "No mapping file found named '".__DIR__."/_files/stdClass2.yml' for class 'Foo\stdClass2'." - ); - $locator->findMappingFile("Foo\\stdClass2"); - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/TestEntity.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/TestEntity.php deleted file mode 100644 index d0e9976..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/TestEntity.php +++ /dev/null @@ -1,3 +0,0 @@ -getFieldNames(); \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/global.yml b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/global.yml deleted file mode 100644 index 30d74d2..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/global.yml +++ /dev/null @@ -1 +0,0 @@ -test \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/stdClass.yml b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/stdClass.yml deleted file mode 100644 index 30d74d2..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/stdClass.yml +++ /dev/null @@ -1 +0,0 @@ -test \ No newline at end of file diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/PersistentObjectTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/PersistentObjectTest.php deleted file mode 100644 index a0f77b5..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Persistence/PersistentObjectTest.php +++ /dev/null @@ -1,247 +0,0 @@ -cm = new TestObjectMetadata; - $this->om = $this->getMock('Doctrine\Common\Persistence\ObjectManager'); - $this->om->expects($this->any())->method('getClassMetadata') - ->will($this->returnValue($this->cm)); - $this->object = new TestObject; - PersistentObject::setObjectManager($this->om); - $this->object->injectObjectManager($this->om, $this->cm); - } - - public function testGetObjectManager() - { - $this->assertSame($this->om, PersistentObject::getObjectManager()); - } - - public function testNonMatchingObjectManager() - { - $this->setExpectedException('RuntimeException'); - $om = $this->getMock('Doctrine\Common\Persistence\ObjectManager'); - $this->object->injectObjectManager($om, $this->cm); - } - - public function testGetField() - { - $this->assertEquals('beberlei', $this->object->getName()); - } - - public function testSetField() - { - $this->object->setName("test"); - $this->assertEquals("test", $this->object->getName()); - } - - public function testGetIdentifier() - { - $this->assertEquals(1, $this->object->getId()); - } - - public function testSetIdentifier() - { - $this->setExpectedException('BadMethodCallException'); - $this->object->setId(2); - } - - public function testSetUnknownField() - { - $this->setExpectedException('BadMethodCallException'); - $this->object->setUnknown("test"); - } - - public function testGetUnknownField() - { - $this->setExpectedException('BadMethodCallException'); - $this->object->getUnknown(); - } - - public function testGetToOneAssociation() - { - $this->assertNull($this->object->getParent()); - } - - public function testSetToOneAssociation() - { - $parent = new TestObject(); - $this->object->setParent($parent); - $this->assertSame($parent, $this->object->getParent($parent)); - } - - public function testSetInvalidToOneAssocation() - { - $parent = new \stdClass(); - - $this->setExpectedException('InvalidArgumentException'); - $this->object->setParent($parent); - } - - public function testSetToOneAssociationNull() - { - $parent = new TestObject(); - $this->object->setParent($parent); - $this->object->setParent(null); - $this->assertNull($this->object->getParent()); - } - - public function testAddToManyAssocation() - { - $child = new TestObject(); - $this->object->addChildren($child); - - $this->assertSame($this->object, $child->getParent()); - $this->assertEquals(1, count($this->object->getChildren())); - - $child = new TestObject(); - $this->object->addChildren($child); - - $this->assertEquals(2, count($this->object->getChildren())); - } - - public function testAddInvalidToManyAssocation() - { - $this->setExpectedException('InvalidArgumentException'); - $this->object->addChildren(new \stdClass()); - } - - public function testNoObjectManagerSet() - { - PersistentObject::setObjectManager(null); - $child = new TestObject(); - - $this->setExpectedException('RuntimeException'); - $child->setName("test"); - } - - public function testInvalidMethod() - { - $this->setExpectedException('BadMethodCallException'); - $this->object->asdf(); - } - - public function testAddInvalidCollection() - { - $this->setExpectedException('BadMethodCallException'); - $this->object->addAsdf(new \stdClass()); - } -} - -class TestObject extends PersistentObject -{ - protected $id = 1; - protected $name = 'beberlei'; - protected $parent; - protected $children; -} - -class TestObjectMetadata implements ClassMetadata -{ - - public function getAssociationMappedByTargetField($assocName) - { - $assoc = array('children' => 'parent'); - return $assoc[$assocName]; - } - - public function getAssociationNames() - { - return array('parent', 'children'); - } - - public function getAssociationTargetClass($assocName) - { - return __NAMESPACE__ . '\TestObject'; - } - - public function getFieldNames() - { - return array('id', 'name'); - } - - public function getIdentifier() - { - return array('id'); - } - - public function getName() - { - return __NAMESPACE__ . '\TestObject'; - } - - public function getReflectionClass() - { - return new \ReflectionClass($this->getName()); - } - - public function getTypeOfField($fieldName) - { - $types = array('id' => 'integer', 'name' => 'string'); - return $types[$fieldName]; - } - - public function hasAssociation($fieldName) - { - return in_array($fieldName, array('parent', 'children')); - } - - public function hasField($fieldName) - { - return in_array($fieldName, array('id', 'name')); - } - - public function isAssociationInverseSide($assocName) - { - return ($assocName === 'children'); - } - - public function isCollectionValuedAssociation($fieldName) - { - return ($fieldName === 'children'); - } - - public function isIdentifier($fieldName) - { - return $fieldName === 'id'; - } - - public function isSingleValuedAssociation($fieldName) - { - return $fieldName === 'parent'; - } - - public function getIdentifierValues($entity) - { - - } - - public function getIdentifierFieldNames() - { - - } - - public function initializeReflection(ReflectionService $reflService) - { - - } - - public function wakeupReflection(ReflectionService $reflService) - { - - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Util/ClassUtilsTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Util/ClassUtilsTest.php deleted file mode 100644 index a281450..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Util/ClassUtilsTest.php +++ /dev/null @@ -1,100 +0,0 @@ -assertEquals($expectedClassName, ClassUtils::getRealClass($className)); - } - - /** - * @dataProvider dataGetClass - */ - public function testGetClass( $className, $expectedClassName ) - { - $object = new $className(); - $this->assertEquals($expectedClassName, ClassUtils::getClass($object)); - } - - public function testGetParentClass() - { - $parentClass = ClassUtils::getParentClass( 'MyProject\Proxies\__CG__\OtherProject\Proxies\__CG__\Doctrine\Tests\Common\Util\ChildObject' ); - $this->assertEquals('stdClass', $parentClass); - } - - public function testGenerateProxyClassName() - { - $this->assertEquals( 'Proxies\__CG__\stdClass', ClassUtils::generateProxyClassName( 'stdClass', 'Proxies' ) ); - } - - /** - * @dataProvider dataGetClass - */ - public function testNewReflectionClass( $className, $expectedClassName ) - { - $reflClass = ClassUtils::newReflectionClass( $className ); - $this->assertEquals( $expectedClassName, $reflClass->getName() ); - } - - /** - * @dataProvider dataGetClass - */ - public function testNewReflectionObject( $className, $expectedClassName ) - { - $object = new $className; - $reflClass = ClassUtils::newReflectionObject( $object ); - $this->assertEquals( $expectedClassName, $reflClass->getName() ); - } - } - - class ChildObject extends \stdClass - { - } -} - -namespace MyProject\Proxies\__CG__ -{ - class stdClass extends \stdClass - { - } -} - -namespace MyProject\Proxies\__CG__\Doctrine\Tests\Common\Util -{ - class ChildObject extends \Doctrine\Tests\Common\Util\ChildObject - { - } -} - -namespace MyProject\Proxies\__CG__\OtherProject\Proxies\__CG__ -{ - class stdClass extends \MyProject\Proxies\__CG__\stdClass - { - } -} - -namespace MyProject\Proxies\__CG__\OtherProject\Proxies\__CG__\Doctrine\Tests\Common\Util -{ - class ChildObject extends \MyProject\Proxies\__CG__\Doctrine\Tests\Common\Util\ChildObject - { - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Util/DebugTest.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Util/DebugTest.php deleted file mode 100644 index b4e9eed..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/Common/Util/DebugTest.php +++ /dev/null @@ -1,27 +0,0 @@ -foo = "bar"; - $obj->bar = 1234; - - $var = Debug::export($obj, 2); - $this->assertEquals( "stdClass", $var->__CLASS__ ); - } - - public function testExportDateTime() - { - $obj = new \DateTime( "2010-10-10 10:10:10" ); - - $var = Debug::export( $obj, 2 ); - $this->assertEquals( "DateTime", $var->__CLASS__ ); - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/DoctrineTestCase.php b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/DoctrineTestCase.php deleted file mode 100644 index e8323d2..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/Doctrine/Tests/DoctrineTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ - - */ -class NativePhpunitTask extends Task -{ - private $test; - private $testfile; - private $testdirectory; - private $configuration = null; - private $coverageClover = null; - private $junitlogfile = null; - private $haltonfailure = true; - private $haltonerror = true; - - public function setTestdirectory($directory) { - $this->testdirectory = $directory; - } - - public function setTest($test) { - $this->test = $test; - } - - public function setTestfile($testfile) { - $this->testfile = $testfile; - } - - public function setJunitlogfile($junitlogfile) { - if (strlen($junitlogfile) == 0) { - $junitlogfile = NULL; - } - - $this->junitlogfile = $junitlogfile; - } - - public function setConfiguration($configuration) { - if (strlen($configuration) == 0) { - $configuration = NULL; - } - - $this->configuration = $configuration; - } - - public function setCoverageClover($coverageClover) { - if (strlen($coverageClover) == 0) { - $coverageClover = NULL; - } - - $this->coverageClover = $coverageClover; - } - - public function setHaltonfailure($haltonfailures) { - $this->haltonfailure = $haltonfailures; - } - - public function setHaltonerror($haltonerrors) { - $this->haltonerror = $haltonerrors; - } - - public function init() - { - require_once "PHPUnit/Runner/Version.php"; - $version = PHPUnit_Runner_Version::id(); - - if (version_compare($version, '3.4.0') < 0) { - throw new BuildException("NativePHPUnitTask requires PHPUnit version >= 3.2.0", $this->getLocation()); - } - - require_once 'PHPUnit/Util/Filter.php'; - - // point PHPUnit_MAIN_METHOD define to non-existing method - if (!defined('PHPUnit_MAIN_METHOD')) { - define('PHPUnit_MAIN_METHOD', 'PHPUnitTask::undefined'); - } - } - - public function main() - { - if (!is_dir(realpath($this->testdirectory))) { - throw new BuildException("NativePHPUnitTask requires a Test Directory path given, '".$this->testdirectory."' given."); - } - set_include_path(realpath($this->testdirectory) . PATH_SEPARATOR . get_include_path()); - - $printer = new NativePhpunitPrinter(); - - $arguments = array( - 'configuration' => $this->configuration, - 'coverageClover' => $this->coverageClover, - 'junitLogfile' => $this->junitlogfile, - 'printer' => $printer, - ); - - $runner = new PHPUnit_TextUI_TestRunner(); - $suite = $runner->getTest($this->test, $this->testfile, true); - - try { - $result = $runner->doRun($suite, $arguments); - /* @var $result PHPUnit_Framework_TestResult */ - - if ( ($this->haltonfailure && $result->failureCount() > 0) || ($this->haltonerror && $result->errorCount() > 0) ) { - throw new BuildException("PHPUnit: ".$result->failureCount()." Failures and ".$result->errorCount()." Errors, ". - "last failure message: ".$printer->getMessages()); - } - - $this->log("PHPUnit Success: ".count($result->passed())." tests passed, no ". - "failures (".$result->skippedCount()." skipped, ".$result->notImplementedCount()." not implemented)"); - - // Hudson for example doesn't like the backslash in class names - if (file_exists($this->coverageClover)) { - $this->log("Generated Clover Coverage XML to: ".$this->coverageClover); - $content = file_get_contents($this->coverageClover); - $content = str_replace("\\", ".", $content); - file_put_contents($this->coverageClover, $content); - unset($content); - } - - } catch(\Exception $e) { - throw new BuildException("NativePhpunitTask failed: ".$e->getMessage()); - } - } -} - -class NativePhpunitPrinter extends PHPUnit_Util_Printer implements PHPUnit_Framework_TestListener -{ - private $_messages = array(); - - public function write($buffer) - { - // do nothing - } - - public function getMessages() - { - return $this->_messages; - } - - /** - * An error occurred. - * - * @param PHPUnit_Framework_Test $test - * @param Exception $e - * @param float $time - */ - public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) - { - $this->_messages[] = "Test ERROR: ".$test->getName().": ".$e->getMessage(); - } - - /** - * A failure occurred. - * - * @param PHPUnit_Framework_Test $test - * @param PHPUnit_Framework_AssertionFailedError $e - * @param float $time - */ - public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) - { - $this->_messages[] = "Test FAILED: ".$test->getName().": ".$e->getMessage(); - } - - /** - * Incomplete test. - * - * @param PHPUnit_Framework_Test $test - * @param Exception $e - * @param float $time - */ - public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) - { - - } - - /** - * Skipped test. - * - * @param PHPUnit_Framework_Test $test - * @param Exception $e - * @param float $time - * @since Method available since Release 3.0.0 - */ - public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) - { - - } - - /** - * A test suite started. - * - * @param PHPUnit_Framework_TestSuite $suite - * @since Method available since Release 2.2.0 - */ - public function startTestSuite(PHPUnit_Framework_TestSuite $suite) - { - - } - - /** - * A test suite ended. - * - * @param PHPUnit_Framework_TestSuite $suite - * @since Method available since Release 2.2.0 - */ - public function endTestSuite(PHPUnit_Framework_TestSuite $suite) - { - - } - - /** - * A test started. - * - * @param PHPUnit_Framework_Test $test - */ - public function startTest(PHPUnit_Framework_Test $test) - { - - } - - /** - * A test ended. - * - * @param PHPUnit_Framework_Test $test - * @param float $time - */ - public function endTest(PHPUnit_Framework_Test $test, $time) - { - - } -} diff --git a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/README.markdown b/vendor/doctrine/common/doctrine-common-ac6c39b/tests/README.markdown deleted file mode 100644 index e6f1703..0000000 --- a/vendor/doctrine/common/doctrine-common-ac6c39b/tests/README.markdown +++ /dev/null @@ -1,27 +0,0 @@ -# Running the Doctrine 2 Testsuite - -## Running tests - -Execute PHPUnit in the root folder of your doctrine-common clone. - - phpunit - -## Testing Lock-Support - -The Lock support in Doctrine 2 is tested using Gearman, which allows to run concurrent tasks in parallel. -Install Gearman with PHP as follows: - -1. Go to http://www.gearman.org and download the latest Gearman Server -2. Compile it and then call ldconfig -3. Start it up "gearmand -vvvv" -4. Install pecl/gearman by calling "gearman-beta" - -You can then go into tests/ and start up two workers: - - php Doctrine/Tests/ORM/Functional/Locking/LockAgentWorker.php - -Then run the locking test-suite: - - phpunit --configuration Doctrine/Tests/ORM/Functional/Locking/GearmanLockTest.php - -This can run considerable time, because it is using sleep() to test for the timing ranges of locks. \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation.php deleted file mode 100644 index 6251252..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation.php +++ /dev/null @@ -1,75 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -/** - * Annotations class - * - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class Annotation -{ - /** - * Value property. Common among all derived classes. - * - * @var string - */ - public $value; - - /** - * Constructor - * - * @param array $data Key-value for properties to be defined in this class - */ - public final function __construct(array $data) - { - foreach ($data as $key => $value) { - $this->$key = $value; - } - } - - /** - * Error handler for unknown property accessor in Annotation class. - * - * @param string $name Unknown property name - */ - public function __get($name) - { - throw new \BadMethodCallException( - sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this)) - ); - } - - /** - * Error handler for unknown property mutator in Annotation class. - * - * @param string $name Unkown property name - * @param mixed $value Property value - */ - public function __set($name, $value) - { - throw new \BadMethodCallException( - sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this)) - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Attribute.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Attribute.php deleted file mode 100644 index 21597b1..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Attribute.php +++ /dev/null @@ -1,47 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations\Annotation; - -/** - * Annotation that can be used to signal to the parser - * to check the attribute type during the parsing process. - * - * @author Fabio B. Silva - * - * @Annotation - */ -final class Attribute -{ - /** - * @var string - */ - public $name; - - /** - * @var string - */ - public $type; - - /** - * @var boolean - */ - public $required = false; -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Attributes.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Attributes.php deleted file mode 100644 index 6e314be..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Attributes.php +++ /dev/null @@ -1,37 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations\Annotation; - -/** - * Annotation that can be used to signal to the parser - * to check the types of all declared attributes during the parsing process. - * - * @author Fabio B. Silva - * - * @Annotation - */ -final class Attributes -{ - /** - * @var array - */ - public $value; -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php deleted file mode 100644 index 1b2b20a..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php +++ /dev/null @@ -1,44 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations\Annotation; - -/** - * Annotation that can be used to signal to the parser to ignore specific - * annotations during the parsing process. - * - * @Annotation - * @author Johannes M. Schmitt - */ -final class IgnoreAnnotation -{ - public $names; - - public function __construct(array $values) - { - if (is_string($values['value'])) { - $values['value'] = array($values['value']); - } - if (!is_array($values['value'])) { - throw new \RuntimeException(sprintf('@IgnoreAnnotation expects either a string name, or an array of strings, but got %s.', json_encode($values['value']))); - } - - $this->names = $values['value']; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Required.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Required.php deleted file mode 100644 index 7b89a02..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Required.php +++ /dev/null @@ -1,33 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations\Annotation; - -/** - * Annotation that can be used to signal to the parser - * to check if that attribute is required during the parsing process. - * - * @author Fabio B. Silva - * - * @Annotation - */ -final class Required -{ -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Target.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Target.php deleted file mode 100644 index c41896a..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Target.php +++ /dev/null @@ -1,105 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations\Annotation; - -/** - * Annotation that can be used to signal to the parser - * to check the annotation target during the parsing process. - * - * @author Fabio B. Silva - * - * @Annotation - */ -final class Target -{ - const TARGET_CLASS = 1; - const TARGET_METHOD = 2; - const TARGET_PROPERTY = 4; - const TARGET_ANNOTATION = 8; - const TARGET_ALL = 15; - - /** - * @var array - */ - private static $map = array( - 'ALL' => self::TARGET_ALL, - 'CLASS' => self::TARGET_CLASS, - 'METHOD' => self::TARGET_METHOD, - 'PROPERTY' => self::TARGET_PROPERTY, - 'ANNOTATION' => self::TARGET_ANNOTATION, - ); - - /** - * @var array - */ - public $value; - - /** - * Targets as bitmask. - * - * @var integer - */ - public $targets; - - /** - * Literal target declaration. - * - * @var integer - */ - public $literal; - - /** - * Annotation construct - * - * @param array $values - */ - public function __construct(array $values) - { - if (!isset($values['value'])){ - $values['value'] = null; - } - if (is_string($values['value'])){ - $values['value'] = array($values['value']); - } - if (!is_array($values['value'])){ - throw new \InvalidArgumentException( - sprintf('@Target expects either a string value, or an array of strings, "%s" given.', - is_object($values['value']) ? get_class($values['value']) : gettype($values['value']) - ) - ); - } - - $bitmask = 0; - foreach ($values['value'] as $literal) { - if(!isset(self::$map[$literal])){ - throw new \InvalidArgumentException( - sprintf('Invalid Target "%s". Available targets: [%s]', - $literal, implode(', ', array_keys(self::$map))) - ); - } - $bitmask += self::$map[$literal]; - } - - $this->targets = $bitmask; - $this->value = $values['value']; - $this->literal = implode(', ', $this->value); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationException.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationException.php deleted file mode 100644 index fdc1913..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationException.php +++ /dev/null @@ -1,111 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -/** - * Description of AnnotationException - * - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class AnnotationException extends \Exception -{ - /** - * Creates a new AnnotationException describing a Syntax error. - * - * @param string $message Exception message - * @return AnnotationException - */ - public static function syntaxError($message) - { - return new self('[Syntax Error] ' . $message); - } - - /** - * Creates a new AnnotationException describing a Semantical error. - * - * @param string $message Exception message - * @return AnnotationException - */ - public static function semanticalError($message) - { - return new self('[Semantical Error] ' . $message); - } - - /** - * Creates a new AnnotationException describing an error which occurred during - * the creation of the annotation. - * - * @since 2.2 - * @param string $message - * @return AnnotationException - */ - public static function creationError($message) - { - return new self('[Creation Error] ' . $message); - } - - /** - * Creates a new AnnotationException describing an type error of an attribute. - * - * @since 2.2 - * @param string $attributeName - * @param string $annotationName - * @param string $context - * @param string $expected - * @param mixed $actual - * @return AnnotationException - */ - public static function typeError($attributeName, $annotationName, $context, $expected, $actual) - { - return new self(sprintf( - '[Type Error] Attribute "%s" of @%s declared on %s expects %s, but got %s.', - $attributeName, - $annotationName, - $context, - $expected, - is_object($actual) ? 'an instance of '.get_class($actual) : gettype($actual) - )); - } - - /** - * Creates a new AnnotationException describing an required error of an attribute. - * - * @since 2.2 - * @param string $attributeName - * @param string $annotationName - * @param string $context - * @param string $expected - * @return AnnotationException - */ - public static function requiredError($attributeName, $annotationName, $context, $expected) - { - return new self(sprintf( - '[Type Error] Attribute "%s" of @%s declared on %s expects %s. This value should not be null.', - $attributeName, - $annotationName, - $context, - $expected - )); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationReader.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationReader.php deleted file mode 100644 index dda8b23..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationReader.php +++ /dev/null @@ -1,301 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -use Doctrine\Common\Annotations\Annotation\IgnoreAnnotation; -use Doctrine\Common\Annotations\Annotation\Target; -use Closure; -use ReflectionClass; -use ReflectionMethod; -use ReflectionProperty; - -/** - * A reader for docblock annotations. - * - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Johannes M. Schmitt - */ -final class AnnotationReader implements Reader -{ - /** - * Global map for imports. - * - * @var array - */ - private static $globalImports = array( - 'ignoreannotation' => 'Doctrine\Common\Annotations\Annotation\IgnoreAnnotation', - ); - - /** - * A list with annotations that are not causing exceptions when not resolved to an annotation class. - * - * The names are case sensitive. - * - * @var array - */ - private static $globalIgnoredNames = array( - 'access'=> true, 'author'=> true, 'copyright'=> true, 'deprecated'=> true, - 'example'=> true, 'ignore'=> true, 'internal'=> true, 'link'=> true, 'see'=> true, - 'since'=> true, 'tutorial'=> true, 'version'=> true, 'package'=> true, - 'subpackage'=> true, 'name'=> true, 'global'=> true, 'param'=> true, - 'return'=> true, 'staticvar'=> true, 'category'=> true, 'staticVar'=> true, - 'static'=> true, 'var'=> true, 'throws'=> true, 'inheritdoc'=> true, - 'inheritDoc'=> true, 'license'=> true, 'todo'=> true, 'deprecated'=> true, - 'deprec'=> true, 'author'=> true, 'property' => true, 'method' => true, - 'abstract'=> true, 'exception'=> true, 'magic' => true, 'api' => true, - 'final'=> true, 'filesource'=> true, 'throw' => true, 'uses' => true, - 'usedby'=> true, 'private' => true, 'Annotation' => true, 'override' => true, - 'codeCoverageIgnore' => true, 'codeCoverageIgnoreStart' => true, 'codeCoverageIgnoreEnd' => true, - 'Required' => true, 'Attribute' => true, 'Attributes' => true, - 'Target' => true, 'SuppressWarnings' => true, - ); - - /** - * Add a new annotation to the globally ignored annotation names with regard to exception handling. - * - * @param string $name - */ - static public function addGlobalIgnoredName($name) - { - self::$globalIgnoredNames[$name] = true; - } - - /** - * Annotations Parser - * - * @var Doctrine\Common\Annotations\DocParser - */ - private $parser; - - /** - * Annotations Parser used to collect parsing metadata - * - * @var Doctrine\Common\Annotations\DocParser - */ - private $preParser; - - /** - * PHP Parser used to collect imports. - * - * @var Doctrine\Common\Annotations\PhpParser - */ - private $phpParser; - - /** - * In-memory cache mechanism to store imported annotations per class. - * - * @var array - */ - private $imports = array(); - - /** - * In-memory cache mechanism to store ignored annotations per class. - * - * @var array - */ - private $ignoredAnnotationNames = array(); - - /** - * Constructor. - * - * Initializes a new AnnotationReader. - */ - public function __construct() - { - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/IgnoreAnnotation.php'); - - $this->parser = new DocParser; - - $this->preParser = new DocParser; - $this->preParser->setImports(self::$globalImports); - $this->preParser->setIgnoreNotImportedAnnotations(true); - - $this->phpParser = new PhpParser; - } - - /** - * Gets the annotations applied to a class. - * - * @param ReflectionClass $class The ReflectionClass of the class from which - * the class annotations should be read. - * @return array An array of Annotations. - */ - public function getClassAnnotations(ReflectionClass $class) - { - $this->parser->setTarget(Target::TARGET_CLASS); - $this->parser->setImports($this->getImports($class)); - $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class)); - - return $this->parser->parse($class->getDocComment(), 'class ' . $class->getName()); - } - - /** - * Gets a class annotation. - * - * @param ReflectionClass $class The ReflectionClass of the class from which - * the class annotations should be read. - * @param string $annotationName The name of the annotation. - * @return The Annotation or NULL, if the requested annotation does not exist. - */ - public function getClassAnnotation(ReflectionClass $class, $annotationName) - { - $annotations = $this->getClassAnnotations($class); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * Gets the annotations applied to a property. - * - * @param ReflectionProperty $property The ReflectionProperty of the property - * from which the annotations should be read. - * @return array An array of Annotations. - */ - public function getPropertyAnnotations(ReflectionProperty $property) - { - $class = $property->getDeclaringClass(); - $context = 'property ' . $class->getName() . "::\$" . $property->getName(); - $this->parser->setTarget(Target::TARGET_PROPERTY); - $this->parser->setImports($this->getImports($class)); - $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class)); - - return $this->parser->parse($property->getDocComment(), $context); - } - - /** - * Gets a property annotation. - * - * @param ReflectionProperty $property - * @param string $annotationName The name of the annotation. - * @return The Annotation or NULL, if the requested annotation does not exist. - */ - public function getPropertyAnnotation(ReflectionProperty $property, $annotationName) - { - $annotations = $this->getPropertyAnnotations($property); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * Gets the annotations applied to a method. - * - * @param ReflectionMethod $property The ReflectionMethod of the method from which - * the annotations should be read. - * @return array An array of Annotations. - */ - public function getMethodAnnotations(ReflectionMethod $method) - { - $class = $method->getDeclaringClass(); - $context = 'method ' . $class->getName() . '::' . $method->getName() . '()'; - $this->parser->setTarget(Target::TARGET_METHOD); - $this->parser->setImports($this->getImports($class)); - $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class)); - - return $this->parser->parse($method->getDocComment(), $context); - } - - /** - * Gets a method annotation. - * - * @param ReflectionMethod $method - * @param string $annotationName The name of the annotation. - * @return The Annotation or NULL, if the requested annotation does not exist. - */ - public function getMethodAnnotation(ReflectionMethod $method, $annotationName) - { - $annotations = $this->getMethodAnnotations($method); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * Returns the ignored annotations for the given class. - * - * @param ReflectionClass $class - * @return array - */ - private function getIgnoredAnnotationNames(ReflectionClass $class) - { - if (isset($this->ignoredAnnotationNames[$name = $class->getName()])) { - return $this->ignoredAnnotationNames[$name]; - } - $this->collectParsingMetadata($class); - - return $this->ignoredAnnotationNames[$name]; - } - - private function getImports(ReflectionClass $class) - { - if (isset($this->imports[$name = $class->getName()])) { - return $this->imports[$name]; - } - $this->collectParsingMetadata($class); - - return $this->imports[$name]; - } - - /** - * Collects parsing metadata for a given class - * - * @param ReflectionClass $class - */ - private function collectParsingMetadata(ReflectionClass $class) - { - $ignoredAnnotationNames = self::$globalIgnoredNames; - - $annotations = $this->preParser->parse($class->getDocComment(), 'class '.$class->name); - foreach ($annotations as $annotation) { - if ($annotation instanceof IgnoreAnnotation) { - foreach ($annotation->names AS $annot) { - $ignoredAnnotationNames[$annot] = true; - } - } - } - - $name = $class->getName(); - $this->imports[$name] = array_merge( - self::$globalImports, - $this->phpParser->parseClass($class), - array('__NAMESPACE__' => $class->getNamespaceName()) - ); - $this->ignoredAnnotationNames[$name] = $ignoredAnnotationNames; - } -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationRegistry.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationRegistry.php deleted file mode 100644 index 60b00f5..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationRegistry.php +++ /dev/null @@ -1,129 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -final class AnnotationRegistry -{ - /** - * A map of namespaces to use for autoloading purposes based on a PSR-0 convention. - * - * Contains the namespace as key and an array of directories as value. If the value is NULL - * the include path is used for checking for the corresponding file. - * - * This autoloading mechanism does not utilize the PHP autoloading but implements autoloading on its own. - * - * @var array - */ - static private $autoloadNamespaces = array(); - - /** - * A map of autoloader callables. - * - * @var array - */ - static private $loaders = array(); - - static public function reset() - { - self::$autoloadNamespaces = array(); - self::$loaders = array(); - } - - static public function registerFile($file) - { - require_once $file; - } - - /** - * Add a namespace with one or many directories to look for files or null for the include path. - * - * Loading of this namespaces will be done with a PSR-0 namespace loading algorithm. - * - * @param string $namespace - * @param string|array|null $dirs - */ - static public function registerAutoloadNamespace($namespace, $dirs = null) - { - self::$autoloadNamespaces[$namespace] = $dirs; - } - - /** - * Register multiple namespaces - * - * Loading of this namespaces will be done with a PSR-0 namespace loading algorithm. - * - * @param array $namespaces - */ - static public function registerAutoloadNamespaces(array $namespaces) - { - self::$autoloadNamespaces = array_merge(self::$autoloadNamespaces, $namespaces); - } - - /** - * Register an autoloading callabale for annotations, much like spl_autoload_register(). - * - * NOTE: These class loaders HAVE to be silent when a class was not found! - * IMPORTANT: Loaders have to return true if they loaded a class that could contain the searched annotation class. - * - * @param callabale $callabale - */ - static public function registerLoader($callabale) - { - if (!is_callable($callabale)) { - throw new \InvalidArgumentException("A callable is expected in AnnotationRegistry::registerLoader()."); - } - self::$loaders[] = $callabale; - } - - /** - * Autoload an annotation class silently. - * - * @param string $class - * @return void - */ - static public function loadAnnotationClass($class) - { - foreach (self::$autoloadNamespaces AS $namespace => $dirs) { - if (strpos($class, $namespace) === 0) { - $file = str_replace("\\", DIRECTORY_SEPARATOR, $class) . ".php"; - if ($dirs === null) { - if ($path = stream_resolve_include_path($file)) { - require $path; - return true; - } - } else { - foreach((array)$dirs AS $dir) { - if (file_exists($dir . DIRECTORY_SEPARATOR . $file)) { - require $dir . DIRECTORY_SEPARATOR . $file; - return true; - } - } - } - } - } - - foreach (self::$loaders AS $loader) { - if (call_user_func($loader, $class) === true) { - return true; - } - } - return false; - } -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/CachedReader.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/CachedReader.php deleted file mode 100644 index 6ea47c6..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/CachedReader.php +++ /dev/null @@ -1,179 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -use Doctrine\Common\Cache\Cache; - -/** - * A cache aware annotation reader. - * - * @author Johannes M. Schmitt - * @author Benjamin Eberlei - */ -final class CachedReader implements Reader -{ - private static $CACHE_SALT = '@[Annot]'; - - /** - * @var Reader - */ - private $delegate; - - /** - * @var Cache - */ - private $cache; - - /** - * @var boolean - */ - private $debug; - - /** - * @var array - */ - private $loadedAnnotations; - - /** - * @param Reader $reader - * @param Cache $cache - */ - public function __construct(Reader $reader, Cache $cache, $debug = false) - { - $this->delegate = $reader; - $this->cache = $cache; - $this->debug = $debug; - } - - public function getClassAnnotations(\ReflectionClass $class) - { - $cacheKey = $class->getName() . self::$CACHE_SALT; - - if (isset($this->loadedAnnotations[$cacheKey])) { - return $this->loadedAnnotations[$cacheKey]; - } - - // Attempt to grab data from cache - if (($data = $this->cache->fetch($cacheKey)) !== false) { - if (!$this->debug || $this->isCacheFresh($cacheKey, $class)) { - return $data; - } - } - - $annots = $this->delegate->getClassAnnotations($class); - $this->cache->save($cacheKey, $annots); - $this->cache->save('[C]'.$cacheKey, time()); - - return $this->loadedAnnotations[$cacheKey] = $annots; - } - - public function getClassAnnotation(\ReflectionClass $class, $annotationName) - { - foreach ($this->getClassAnnotations($class) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - public function getPropertyAnnotations(\ReflectionProperty $property) - { - $class = $property->getDeclaringClass(); - $cacheKey = $class->getName().'$'.$property->getName().self::$CACHE_SALT; - - if (isset($this->loadedAnnotations[$cacheKey])) { - return $this->loadedAnnotations[$cacheKey]; - } - - // Attempt to grab data from cache - if (($data = $this->cache->fetch($cacheKey)) !== false) { - if (!$this->debug || $this->isCacheFresh($cacheKey, $class)) { - return $data; - } - } - - $annots = $this->delegate->getPropertyAnnotations($property); - $this->cache->save($cacheKey, $annots); - $this->cache->save('[C]'.$cacheKey, time()); - - return $this->loadedAnnotations[$cacheKey] = $annots; - } - - public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName) - { - foreach ($this->getPropertyAnnotations($property) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - public function getMethodAnnotations(\ReflectionMethod $method) - { - $class = $method->getDeclaringClass(); - $cacheKey = $class->getName().'#'.$method->getName().self::$CACHE_SALT; - - if (isset($this->loadedAnnotations[$cacheKey])) { - return $this->loadedAnnotations[$cacheKey]; - } - - // Attempt to grab data from cache - if (($data = $this->cache->fetch($cacheKey)) !== false) { - if (!$this->debug || $this->isCacheFresh($cacheKey, $class)) { - return $data; - } - } - - $annots = $this->delegate->getMethodAnnotations($method); - $this->cache->save($cacheKey, $annots); - $this->cache->save('[C]'.$cacheKey, time()); - - return $this->loadedAnnotations[$cacheKey] = $annots; - } - - public function getMethodAnnotation(\ReflectionMethod $method, $annotationName) - { - foreach ($this->getMethodAnnotations($method) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - public function clearLoadedAnnotations() - { - $this->loadedAnnotations = array(); - } - - private function isCacheFresh($cacheKey, \ReflectionClass $class) - { - if (false === $filename = $class->getFilename()) { - return true; - } - - return $this->cache->fetch('[C]'.$cacheKey) >= filemtime($filename); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocLexer.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocLexer.php deleted file mode 100644 index c6223e3..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocLexer.php +++ /dev/null @@ -1,140 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -use Doctrine\Common\Lexer; - -/** - * Simple lexer for docblock annotations. - * - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Johannes M. Schmitt - */ -final class DocLexer extends Lexer -{ - const T_NONE = 1; - const T_IDENTIFIER = 2; - const T_INTEGER = 3; - const T_STRING = 4; - const T_FLOAT = 5; - - const T_AT = 101; - const T_CLOSE_CURLY_BRACES = 102; - const T_CLOSE_PARENTHESIS = 103; - const T_COMMA = 104; - const T_EQUALS = 105; - const T_FALSE = 106; - const T_NAMESPACE_SEPARATOR = 107; - const T_OPEN_CURLY_BRACES = 108; - const T_OPEN_PARENTHESIS = 109; - const T_TRUE = 110; - const T_NULL = 111; - const T_COLON = 112; - - /** - * @inheritdoc - */ - protected function getCatchablePatterns() - { - return array( - '[a-z_][a-z0-9_:]*', - '(?:[+-]?[0-9]+(?:[\.][0-9]+)*)(?:[eE][+-]?[0-9]+)?', - '"(?:[^"]|"")*"', - ); - } - - /** - * @inheritdoc - */ - protected function getNonCatchablePatterns() - { - return array('\s+', '\*+', '(.)'); - } - - /** - * @inheritdoc - */ - protected function getType(&$value) - { - $type = self::T_NONE; - - // Checking numeric value - if (is_numeric($value)) { - return (strpos($value, '.') !== false || stripos($value, 'e') !== false) - ? self::T_FLOAT : self::T_INTEGER; - } - - if ($value[0] === '"') { - $value = str_replace('""', '"', substr($value, 1, strlen($value) - 2)); - - return self::T_STRING; - } else { - switch (strtolower($value)) { - case '@': - return self::T_AT; - - case ',': - return self::T_COMMA; - - case '(': - return self::T_OPEN_PARENTHESIS; - - case ')': - return self::T_CLOSE_PARENTHESIS; - - case '{': - return self::T_OPEN_CURLY_BRACES; - - case '}': - return self::T_CLOSE_CURLY_BRACES; - - case '=': - return self::T_EQUALS; - - case '\\': - return self::T_NAMESPACE_SEPARATOR; - - case 'true': - return self::T_TRUE; - - case 'false': - return self::T_FALSE; - - case 'null': - return self::T_NULL; - - case ':': - return self::T_COLON; - - default: - if (ctype_alpha($value[0]) || $value[0] === '_') { - return self::T_IDENTIFIER; - } - - break; - } - } - - return $type; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php deleted file mode 100644 index 9d16b17..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php +++ /dev/null @@ -1,891 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -use Closure; -use ReflectionClass; -use Doctrine\Common\Annotations\Annotation\Target; -use Doctrine\Common\Annotations\Annotation\Attribute; -use Doctrine\Common\Annotations\Annotation\Attributes; - -/** - * A parser for docblock annotations. - * - * It is strongly discouraged to change the default annotation parsing process. - * - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Johannes M. Schmitt - * @author Fabio B. Silva - */ -final class DocParser -{ - /** - * An array of all valid tokens for a class name. - * - * @var array - */ - private static $classIdentifiers = array(DocLexer::T_IDENTIFIER, DocLexer::T_TRUE, DocLexer::T_FALSE, DocLexer::T_NULL); - - /** - * The lexer. - * - * @var Doctrine\Common\Annotations\DocLexer - */ - private $lexer; - - /** - * Current target context - * - * @var string - */ - private $target; - - /** - * Doc Parser used to collect annotation target - * - * @var Doctrine\Common\Annotations\DocParser - */ - private static $metadataParser; - - /** - * Flag to control if the current annotation is nested or not. - * - * @var boolean - */ - private $isNestedAnnotation = false; - - /** - * Hashmap containing all use-statements that are to be used when parsing - * the given doc block. - * - * @var array - */ - private $imports = array(); - - /** - * This hashmap is used internally to cache results of class_exists() - * look-ups. - * - * @var array - */ - private $classExists = array(); - - /** - * Whether annotations that have not been imported should be ignored. - * - * @var boolean - */ - private $ignoreNotImportedAnnotations = false; - - /** - * An array of default namespaces if operating in simple mode. - * - * @var array - */ - private $namespaces = array(); - - /** - * A list with annotations that are not causing exceptions when not resolved to an annotation class. - * - * The names must be the raw names as used in the class, not the fully qualified - * class names. - * - * @var array - */ - private $ignoredAnnotationNames = array(); - - /** - * @var string - */ - private $context = ''; - - /** - * Hash-map for caching annotation metadata - * @var array - */ - private static $annotationMetadata = array( - 'Doctrine\Common\Annotations\Annotation\Target' => array( - 'is_annotation' => true, - 'has_constructor' => true, - 'properties' => array(), - 'targets_literal' => 'ANNOTATION_CLASS', - 'targets' => Target::TARGET_CLASS, - 'default_property' => 'value', - 'attribute_types' => array( - 'value' => array( - 'required' => false, - 'type' =>'array', - 'array_type'=>'string', - 'value' =>'array' - ) - ), - ), - 'Doctrine\Common\Annotations\Annotation\Attribute' => array( - 'is_annotation' => true, - 'has_constructor' => false, - 'targets_literal' => 'ANNOTATION_ANNOTATION', - 'targets' => Target::TARGET_ANNOTATION, - 'default_property' => 'name', - 'properties' => array( - 'name' => 'name', - 'type' => 'type', - 'required' => 'required' - ), - 'attribute_types' => array( - 'value' => array( - 'required' => true, - 'type' =>'string', - 'value' =>'string' - ), - 'type' => array( - 'required' =>true, - 'type' =>'string', - 'value' =>'string' - ), - 'required' => array( - 'required' =>false, - 'type' =>'boolean', - 'value' =>'boolean' - ) - ), - ), - 'Doctrine\Common\Annotations\Annotation\Attributes' => array( - 'is_annotation' => true, - 'has_constructor' => false, - 'targets_literal' => 'ANNOTATION_CLASS', - 'targets' => Target::TARGET_CLASS, - 'default_property' => 'value', - 'properties' => array( - 'value' => 'value' - ), - 'attribute_types' => array( - 'value' => array( - 'type' =>'array', - 'required' =>true, - 'array_type'=>'Doctrine\Common\Annotations\Annotation\Attribute', - 'value' =>'array' - ) - ), - ), - ); - - /** - * Hash-map for handle types declaration - * - * @var array - */ - private static $typeMap = array( - 'float' => 'double', - 'bool' => 'boolean', - // allow uppercase Boolean in honor of George Boole - 'Boolean' => 'boolean', - 'int' => 'integer', - ); - - /** - * Constructs a new DocParser. - */ - public function __construct() - { - $this->lexer = new DocLexer; - } - - /** - * Sets the annotation names that are ignored during the parsing process. - * - * The names are supposed to be the raw names as used in the class, not the - * fully qualified class names. - * - * @param array $names - */ - public function setIgnoredAnnotationNames(array $names) - { - $this->ignoredAnnotationNames = $names; - } - - public function setIgnoreNotImportedAnnotations($bool) - { - $this->ignoreNotImportedAnnotations = (Boolean) $bool; - } - - /** - * Sets the default namespaces. - * @param array $namespaces - */ - public function addNamespace($namespace) - { - if ($this->imports) { - throw new \RuntimeException('You must either use addNamespace(), or setImports(), but not both.'); - } - $this->namespaces[] = $namespace; - } - - public function setImports(array $imports) - { - if ($this->namespaces) { - throw new \RuntimeException('You must either use addNamespace(), or setImports(), but not both.'); - } - $this->imports = $imports; - } - - /** - * Sets current target context as bitmask. - * - * @param integer $target - */ - public function setTarget($target) - { - $this->target = $target; - } - - /** - * Parses the given docblock string for annotations. - * - * @param string $input The docblock string to parse. - * @param string $context The parsing context. - * @return array Array of annotations. If no annotations are found, an empty array is returned. - */ - public function parse($input, $context = '') - { - if (false === $pos = strpos($input, '@')) { - return array(); - } - - // also parse whatever character is before the @ - if ($pos > 0) { - $pos -= 1; - } - - $this->context = $context; - $this->lexer->setInput(trim(substr($input, $pos), '* /')); - $this->lexer->moveNext(); - - return $this->Annotations(); - } - - /** - * Attempts to match the given token with the current lookahead token. - * If they match, updates the lookahead token; otherwise raises a syntax error. - * - * @param int Token type. - * @return bool True if tokens match; false otherwise. - */ - private function match($token) - { - if ( ! $this->lexer->isNextToken($token) ) { - $this->syntaxError($this->lexer->getLiteral($token)); - } - - return $this->lexer->moveNext(); - } - - /** - * Attempts to match the current lookahead token with any of the given tokens. - * - * If any of them matches, this method updates the lookahead token; otherwise - * a syntax error is raised. - * - * @param array $tokens - * @return bool - */ - private function matchAny(array $tokens) - { - if ( ! $this->lexer->isNextTokenAny($tokens)) { - $this->syntaxError(implode(' or ', array_map(array($this->lexer, 'getLiteral'), $tokens))); - } - - return $this->lexer->moveNext(); - } - - /** - * Generates a new syntax error. - * - * @param string $expected Expected string. - * @param array $token Optional token. - * @throws SyntaxException - */ - private function syntaxError($expected, $token = null) - { - if ($token === null) { - $token = $this->lexer->lookahead; - } - - $message = "Expected {$expected}, got "; - - if ($this->lexer->lookahead === null) { - $message .= 'end of string'; - } else { - $message .= "'{$token['value']}' at position {$token['position']}"; - } - - if (strlen($this->context)) { - $message .= ' in ' . $this->context; - } - - $message .= '.'; - - throw AnnotationException::syntaxError($message); - } - - /** - * Attempt to check if a class exists or not. This never goes through the PHP autoloading mechanism - * but uses the {@link AnnotationRegistry} to load classes. - * - * @param string $fqcn - * @return boolean - */ - private function classExists($fqcn) - { - if (isset($this->classExists[$fqcn])) { - return $this->classExists[$fqcn]; - } - - // first check if the class already exists, maybe loaded through another AnnotationReader - if (class_exists($fqcn, false)) { - return $this->classExists[$fqcn] = true; - } - - // final check, does this class exist? - return $this->classExists[$fqcn] = AnnotationRegistry::loadAnnotationClass($fqcn); - } - - /** - * Collects parsing metadata for a given annotation class - * - * @param string $name The annotation name - */ - private function collectAnnotationMetadata($name) - { - if (self::$metadataParser == null){ - self::$metadataParser = new self(); - self::$metadataParser->setTarget(Target::TARGET_CLASS); - self::$metadataParser->setIgnoreNotImportedAnnotations(true); - self::$metadataParser->setImports(array( - 'target' => 'Doctrine\Common\Annotations\Annotation\Target', - 'attribute' => 'Doctrine\Common\Annotations\Annotation\Attribute', - 'attributes' => 'Doctrine\Common\Annotations\Annotation\Attributes' - )); - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Target.php'); - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Attribute.php'); - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Attributes.php'); - } - - $class = new \ReflectionClass($name); - $docComment = $class->getDocComment(); - - // Sets default values for annotation metadata - $metadata = array( - 'default_property' => null, - 'has_constructor' => (null !== $constructor = $class->getConstructor()) && $constructor->getNumberOfParameters() > 0, - 'properties' => array(), - 'property_types' => array(), - 'attribute_types' => array(), - 'targets_literal' => null, - 'targets' => Target::TARGET_ALL, - 'is_annotation' => false !== strpos($docComment, '@Annotation'), - ); - - // verify that the class is really meant to be an annotation - if ($metadata['is_annotation']) { - foreach (self::$metadataParser->parse($docComment, 'class @' . $name) as $annotation) { - if ($annotation instanceof Target) { - $metadata['targets'] = $annotation->targets; - $metadata['targets_literal'] = $annotation->literal; - - } elseif ($annotation instanceof Attributes) { - foreach ($annotation->value as $attrib) { - // handle internal type declaration - $type = isset(self::$typeMap[$attrib->type]) ? self::$typeMap[$attrib->type] : $attrib->type; - - // handle the case if the property type is mixed - if ('mixed' !== $type) { - // Checks if the property has array - if (false !== $pos = strpos($type, '<')) { - $arrayType = substr($type, $pos+1, -1); - $type = 'array'; - - if (isset(self::$typeMap[$arrayType])) { - $arrayType = self::$typeMap[$arrayType]; - } - - $metadata['attribute_types'][$attrib->name]['array_type'] = $arrayType; - } - - $metadata['attribute_types'][$attrib->name]['type'] = $type; - $metadata['attribute_types'][$attrib->name]['value'] = $attrib->type; - $metadata['attribute_types'][$attrib->name]['required'] = $attrib->required; - } - } - } - } - - // if not has a constructor will inject values into public properties - if (false === $metadata['has_constructor']) { - // collect all public properties - foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) { - $metadata['properties'][$property->name] = $property->name; - - // checks if the property has @var annotation - if ((false !== $propertyComment = $property->getDocComment()) - && false !== strpos($propertyComment, '@var') - && preg_match('/@var\s+([^\s]+)/',$propertyComment, $matches)) { - // literal type declaration - $value = $matches[1]; - - // handle internal type declaration - $type = isset(self::$typeMap[$value]) ? self::$typeMap[$value] : $value; - - // handle the case if the property type is mixed - if ('mixed' !== $type) { - // Checks if the property has @var array annotation - if (false !== $pos = strpos($type, '<')) { - $arrayType = substr($type, $pos+1, -1); - $type = 'array'; - - if (isset(self::$typeMap[$arrayType])) { - $arrayType = self::$typeMap[$arrayType]; - } - - $metadata['attribute_types'][$property->name]['array_type'] = $arrayType; - } - - $metadata['attribute_types'][$property->name]['type'] = $type; - $metadata['attribute_types'][$property->name]['value'] = $value; - $metadata['attribute_types'][$property->name]['required'] = false !== strpos($propertyComment, '@Required'); - } - } - } - - // choose the first property as default property - $metadata['default_property'] = reset($metadata['properties']); - } - } - - self::$annotationMetadata[$name] = $metadata; - } - - /** - * Annotations ::= Annotation {[ "*" ]* [Annotation]}* - * - * @return array - */ - private function Annotations() - { - $annotations = array(); - - while (null !== $this->lexer->lookahead) { - if (DocLexer::T_AT !== $this->lexer->lookahead['type']) { - $this->lexer->moveNext(); - continue; - } - - // make sure the @ is preceded by non-catchable pattern - if (null !== $this->lexer->token && $this->lexer->lookahead['position'] === $this->lexer->token['position'] + strlen($this->lexer->token['value'])) { - $this->lexer->moveNext(); - continue; - } - - // make sure the @ is followed by either a namespace separator, or - // an identifier token - if ((null === $peek = $this->lexer->glimpse()) - || (DocLexer::T_NAMESPACE_SEPARATOR !== $peek['type'] && !in_array($peek['type'], self::$classIdentifiers, true)) - || $peek['position'] !== $this->lexer->lookahead['position'] + 1) { - $this->lexer->moveNext(); - continue; - } - - $this->isNestedAnnotation = false; - if (false !== $annot = $this->Annotation()) { - $annotations[] = $annot; - } - } - - return $annotations; - } - - /** - * Annotation ::= "@" AnnotationName ["(" [Values] ")"] - * AnnotationName ::= QualifiedName | SimpleName - * QualifiedName ::= NameSpacePart "\" {NameSpacePart "\"}* SimpleName - * NameSpacePart ::= identifier | null | false | true - * SimpleName ::= identifier | null | false | true - * - * @return mixed False if it is not a valid annotation. - */ - private function Annotation() - { - $this->match(DocLexer::T_AT); - - // check if we have an annotation - if ($this->lexer->isNextTokenAny(self::$classIdentifiers)) { - $this->lexer->moveNext(); - $name = $this->lexer->token['value']; - } else if ($this->lexer->isNextToken(DocLexer::T_NAMESPACE_SEPARATOR)) { - $name = ''; - } else { - $this->syntaxError('namespace separator or identifier'); - } - - while ($this->lexer->lookahead['position'] === $this->lexer->token['position'] + strlen($this->lexer->token['value']) && $this->lexer->isNextToken(DocLexer::T_NAMESPACE_SEPARATOR)) { - $this->match(DocLexer::T_NAMESPACE_SEPARATOR); - $this->matchAny(self::$classIdentifiers); - $name .= '\\'.$this->lexer->token['value']; - } - - // only process names which are not fully qualified, yet - // fully qualified names must start with a \ - $originalName = $name; - if ('\\' !== $name[0]) { - $alias = (false === $pos = strpos($name, '\\'))? $name : substr($name, 0, $pos); - - $found = false; - if ($this->namespaces) { - foreach ($this->namespaces as $namespace) { - if ($this->classExists($namespace.'\\'.$name)) { - $name = $namespace.'\\'.$name; - $found = true; - break; - } - } - } elseif (isset($this->imports[$loweredAlias = strtolower($alias)])) { - if (false !== $pos) { - $name = $this->imports[$loweredAlias].substr($name, $pos); - } else { - $name = $this->imports[$loweredAlias]; - } - $found = true; - } elseif (isset($this->imports['__NAMESPACE__']) && $this->classExists($this->imports['__NAMESPACE__'].'\\'.$name)) { - $name = $this->imports['__NAMESPACE__'].'\\'.$name; - $found = true; - } elseif ($this->classExists($name)) { - $found = true; - } - - if (!$found) { - if ($this->ignoreNotImportedAnnotations || isset($this->ignoredAnnotationNames[$name])) { - return false; - } - - throw AnnotationException::semanticalError(sprintf('The annotation "@%s" in %s was never imported. Did you maybe forget to add a "use" statement for this annotation?', $name, $this->context)); - } - } - - if (!$this->classExists($name)) { - throw AnnotationException::semanticalError(sprintf('The annotation "@%s" in %s does not exist, or could not be auto-loaded.', $name, $this->context)); - } - - // at this point, $name contains the fully qualified class name of the - // annotation, and it is also guaranteed that this class exists, and - // that it is loaded - - - // collects the metadata annotation only if there is not yet - if (!isset(self::$annotationMetadata[$name])) { - $this->collectAnnotationMetadata($name); - } - - // verify that the class is really meant to be an annotation and not just any ordinary class - if (self::$annotationMetadata[$name]['is_annotation'] === false) { - if (isset($this->ignoredAnnotationNames[$originalName])) { - return false; - } - - throw AnnotationException::semanticalError(sprintf('The class "%s" is not annotated with @Annotation. Are you sure this class can be used as annotation? If so, then you need to add @Annotation to the _class_ doc comment of "%s". If it is indeed no annotation, then you need to add @IgnoreAnnotation("%s") to the _class_ doc comment of %s.', $name, $name, $originalName, $this->context)); - } - - //if target is nested annotation - $target = $this->isNestedAnnotation ? Target::TARGET_ANNOTATION : $this->target; - - // Next will be nested - $this->isNestedAnnotation = true; - - //if annotation does not support current target - if (0 === (self::$annotationMetadata[$name]['targets'] & $target) && $target) { - throw AnnotationException::semanticalError( - sprintf('Annotation @%s is not allowed to be declared on %s. You may only use this annotation on these code elements: %s.', - $originalName, $this->context, self::$annotationMetadata[$name]['targets_literal']) - ); - } - - $values = array(); - if ($this->lexer->isNextToken(DocLexer::T_OPEN_PARENTHESIS)) { - $this->match(DocLexer::T_OPEN_PARENTHESIS); - - if ( ! $this->lexer->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) { - $values = $this->Values(); - } - - $this->match(DocLexer::T_CLOSE_PARENTHESIS); - } - - // checks all declared attributes - foreach (self::$annotationMetadata[$name]['attribute_types'] as $property => $type) { - if ($property === self::$annotationMetadata[$name]['default_property'] - && !isset($values[$property]) && isset($values['value'])) { - $property = 'value'; - } - - // handle a not given attribute or null value - if (!isset($values[$property])) { - if ($type['required']) { - throw AnnotationException::requiredError($property, $originalName, $this->context, 'a(n) '.$type['value']); - } - - continue; - } - - if ($type['type'] === 'array') { - // handle the case of a single value - if (!is_array($values[$property])) { - $values[$property] = array($values[$property]); - } - - // checks if the attribute has array type declaration, such as "array" - if (isset($type['array_type'])) { - foreach ($values[$property] as $item) { - if (gettype($item) !== $type['array_type'] && !$item instanceof $type['array_type']) { - throw AnnotationException::typeError($property, $originalName, $this->context, 'either a(n) '.$type['array_type'].', or an array of '.$type['array_type'].'s', $item); - } - } - } - } elseif (gettype($values[$property]) !== $type['type'] && !$values[$property] instanceof $type['type']) { - throw AnnotationException::typeError($property, $originalName, $this->context, 'a(n) '.$type['value'], $values[$property]); - } - } - - // check if the annotation expects values via the constructor, - // or directly injected into public properties - if (self::$annotationMetadata[$name]['has_constructor'] === true) { - return new $name($values); - } - - $instance = new $name(); - foreach ($values as $property => $value) { - if (!isset(self::$annotationMetadata[$name]['properties'][$property])) { - if ('value' !== $property) { - throw AnnotationException::creationError(sprintf('The annotation @%s declared on %s does not have a property named "%s". Available properties: %s', $originalName, $this->context, $property, implode(', ', self::$annotationMetadata[$name]['properties']))); - } - - // handle the case if the property has no annotations - if (!$property = self::$annotationMetadata[$name]['default_property']) { - throw AnnotationException::creationError(sprintf('The annotation @%s declared on %s does not accept any values, but got %s.', $originalName, $this->context, json_encode($values))); - } - } - - $instance->{$property} = $value; - } - - return $instance; - } - - /** - * Values ::= Array | Value {"," Value}* - * - * @return array - */ - private function Values() - { - $values = array(); - - // Handle the case of a single array as value, i.e. @Foo({....}) - if ($this->lexer->isNextToken(DocLexer::T_OPEN_CURLY_BRACES)) { - $values['value'] = $this->Value(); - return $values; - } - - $values[] = $this->Value(); - - while ($this->lexer->isNextToken(DocLexer::T_COMMA)) { - $this->match(DocLexer::T_COMMA); - $token = $this->lexer->lookahead; - $value = $this->Value(); - - if ( ! is_object($value) && ! is_array($value)) { - $this->syntaxError('Value', $token); - } - - $values[] = $value; - } - - foreach ($values as $k => $value) { - if (is_object($value) && $value instanceof \stdClass) { - $values[$value->name] = $value->value; - } else if ( ! isset($values['value'])){ - $values['value'] = $value; - } else { - if ( ! is_array($values['value'])) { - $values['value'] = array($values['value']); - } - - $values['value'][] = $value; - } - - unset($values[$k]); - } - - return $values; - } - - /** - * Value ::= PlainValue | FieldAssignment - * - * @return mixed - */ - private function Value() - { - $peek = $this->lexer->glimpse(); - - if (DocLexer::T_EQUALS === $peek['type']) { - return $this->FieldAssignment(); - } - - return $this->PlainValue(); - } - - /** - * PlainValue ::= integer | string | float | boolean | Array | Annotation - * - * @return mixed - */ - private function PlainValue() - { - if ($this->lexer->isNextToken(DocLexer::T_OPEN_CURLY_BRACES)) { - return $this->Arrayx(); - } - - if ($this->lexer->isNextToken(DocLexer::T_AT)) { - return $this->Annotation(); - } - - switch ($this->lexer->lookahead['type']) { - case DocLexer::T_STRING: - $this->match(DocLexer::T_STRING); - return $this->lexer->token['value']; - - case DocLexer::T_INTEGER: - $this->match(DocLexer::T_INTEGER); - return (int)$this->lexer->token['value']; - - case DocLexer::T_FLOAT: - $this->match(DocLexer::T_FLOAT); - return (float)$this->lexer->token['value']; - - case DocLexer::T_TRUE: - $this->match(DocLexer::T_TRUE); - return true; - - case DocLexer::T_FALSE: - $this->match(DocLexer::T_FALSE); - return false; - - case DocLexer::T_NULL: - $this->match(DocLexer::T_NULL); - return null; - - default: - $this->syntaxError('PlainValue'); - } - } - - /** - * FieldAssignment ::= FieldName "=" PlainValue - * FieldName ::= identifier - * - * @return array - */ - private function FieldAssignment() - { - $this->match(DocLexer::T_IDENTIFIER); - $fieldName = $this->lexer->token['value']; - - $this->match(DocLexer::T_EQUALS); - - $item = new \stdClass(); - $item->name = $fieldName; - $item->value = $this->PlainValue(); - - return $item; - } - - /** - * Array ::= "{" ArrayEntry {"," ArrayEntry}* [","] "}" - * - * @return array - */ - private function Arrayx() - { - $array = $values = array(); - - $this->match(DocLexer::T_OPEN_CURLY_BRACES); - $values[] = $this->ArrayEntry(); - - while ($this->lexer->isNextToken(DocLexer::T_COMMA)) { - $this->match(DocLexer::T_COMMA); - - // optional trailing comma - if ($this->lexer->isNextToken(DocLexer::T_CLOSE_CURLY_BRACES)) { - break; - } - - $values[] = $this->ArrayEntry(); - } - - $this->match(DocLexer::T_CLOSE_CURLY_BRACES); - - foreach ($values as $value) { - list ($key, $val) = $value; - - if ($key !== null) { - $array[$key] = $val; - } else { - $array[] = $val; - } - } - - return $array; - } - - /** - * ArrayEntry ::= Value | KeyValuePair - * KeyValuePair ::= Key ("=" | ":") PlainValue - * Key ::= string | integer - * - * @return array - */ - private function ArrayEntry() - { - $peek = $this->lexer->glimpse(); - - if (DocLexer::T_EQUALS === $peek['type'] - || DocLexer::T_COLON === $peek['type']) { - $this->matchAny(array(DocLexer::T_INTEGER, DocLexer::T_STRING)); - - $key = $this->lexer->token['value']; - $this->matchAny(array(DocLexer::T_EQUALS, DocLexer::T_COLON)); - - return array($key, $this->PlainValue()); - } - - return array(null, $this->Value()); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/FileCacheReader.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/FileCacheReader.php deleted file mode 100644 index 4a42b58..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/FileCacheReader.php +++ /dev/null @@ -1,209 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - - -/** - * File cache reader for annotations. - * - * @author Johannes M. Schmitt - * @author Benjamin Eberlei - */ -class FileCacheReader implements Reader -{ - /** - * @var Reader - */ - private $reader; - private $dir; - private $debug; - private $loadedAnnotations = array(); - - public function __construct(Reader $reader, $cacheDir, $debug = false) - { - $this->reader = $reader; - if (!is_dir($cacheDir) && !@mkdir($cacheDir, 0777, true)) { - throw new \InvalidArgumentException(sprintf('The directory "%s" does not exist and could not be created.', $cacheDir)); - } - if (!is_writable($cacheDir)) { - throw new \InvalidArgumentException(sprintf('The directory "%s" is not writable. Both, the webserver and the console user need access. You can manage access rights for multiple users with "chmod +a". If your system does not support this, check out the acl package.', $cacheDir)); - } - - $this->dir = rtrim($cacheDir, '\\/'); - $this->debug = $debug; - } - - public function getClassAnnotations(\ReflectionClass $class) - { - $key = $class->getName(); - - if (isset($this->loadedAnnotations[$key])) { - return $this->loadedAnnotations[$key]; - } - - $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php'; - if (!file_exists($path)) { - $annot = $this->reader->getClassAnnotations($class); - $this->saveCacheFile($path, $annot); - return $this->loadedAnnotations[$key] = $annot; - } - - if ($this->debug - && (false !== $filename = $class->getFilename()) - && filemtime($path) < filemtime($filename)) { - @unlink($path); - - $annot = $this->reader->getClassAnnotations($class); - $this->saveCacheFile($path, $annot); - return $this->loadedAnnotations[$key] = $annot; - } - - return $this->loadedAnnotations[$key] = include $path; - } - - public function getPropertyAnnotations(\ReflectionProperty $property) - { - $class = $property->getDeclaringClass(); - $key = $class->getName().'$'.$property->getName(); - - if (isset($this->loadedAnnotations[$key])) { - return $this->loadedAnnotations[$key]; - } - - $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php'; - if (!file_exists($path)) { - $annot = $this->reader->getPropertyAnnotations($property); - $this->saveCacheFile($path, $annot); - return $this->loadedAnnotations[$key] = $annot; - } - - if ($this->debug - && (false !== $filename = $class->getFilename()) - && filemtime($path) < filemtime($filename)) { - unlink($path); - - $annot = $this->reader->getPropertyAnnotations($property); - $this->saveCacheFile($path, $annot); - return $this->loadedAnnotations[$key] = $annot; - } - - return $this->loadedAnnotations[$key] = include $path; - } - - public function getMethodAnnotations(\ReflectionMethod $method) - { - $class = $method->getDeclaringClass(); - $key = $class->getName().'#'.$method->getName(); - - if (isset($this->loadedAnnotations[$key])) { - return $this->loadedAnnotations[$key]; - } - - $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php'; - if (!file_exists($path)) { - $annot = $this->reader->getMethodAnnotations($method); - $this->saveCacheFile($path, $annot); - return $this->loadedAnnotations[$key] = $annot; - } - - if ($this->debug - && (false !== $filename = $class->getFilename()) - && filemtime($path) < filemtime($filename)) { - unlink($path); - - $annot = $this->reader->getMethodAnnotations($method); - $this->saveCacheFile($path, $annot); - return $this->loadedAnnotations[$key] = $annot; - } - - return $this->loadedAnnotations[$key] = include $path; - } - - private function saveCacheFile($path, $data) - { - file_put_contents($path, 'getClassAnnotations($class); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * Gets a method annotation. - * - * @param ReflectionMethod $method - * @param string $annotationName The name of the annotation. - * @return The Annotation or NULL, if the requested annotation does not exist. - */ - public function getMethodAnnotation(\ReflectionMethod $method, $annotationName) - { - $annotations = $this->getMethodAnnotations($method); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * Gets a property annotation. - * - * @param ReflectionProperty $property - * @param string $annotationName The name of the annotation. - * @return The Annotation or NULL, if the requested annotation does not exist. - */ - public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName) - { - $annotations = $this->getPropertyAnnotations($property); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - public function clearLoadedAnnotations() - { - $this->loadedAnnotations = array(); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/IndexedReader.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/IndexedReader.php deleted file mode 100644 index 1eea492..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/IndexedReader.php +++ /dev/null @@ -1,94 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -use Doctrine\Common\Annotations\Reader; - -/** - * Allows the reader to be used in-place of Doctrine's reader. - * - * @author Johannes M. Schmitt - */ -class IndexedReader implements Reader -{ - private $delegate; - - public function __construct(Reader $reader) - { - $this->delegate = $reader; - } - - public function getClassAnnotations(\ReflectionClass $class) - { - $annotations = array(); - foreach ($this->delegate->getClassAnnotations($class) as $annot) { - $annotations[get_class($annot)] = $annot; - } - - return $annotations; - } - - public function getClassAnnotation(\ReflectionClass $class, $annotation) - { - return $this->delegate->getClassAnnotation($class, $annotation); - } - - public function getMethodAnnotations(\ReflectionMethod $method) - { - $annotations = array(); - foreach ($this->delegate->getMethodAnnotations($method) as $annot) { - $annotations[get_class($annot)] = $annot; - } - - return $annotations; - } - - public function getMethodAnnotation(\ReflectionMethod $method, $annotation) - { - return $this->delegate->getMethodAnnotation($method, $annotation); - } - - public function getPropertyAnnotations(\ReflectionProperty $property) - { - $annotations = array(); - foreach ($this->delegate->getPropertyAnnotations($property) as $annot) { - $annotations[get_class($annot)] = $annot; - } - - return $annotations; - } - - public function getPropertyAnnotation(\ReflectionProperty $property, $annotation) - { - return $this->delegate->getPropertyAnnotation($property, $annotation); - } - - /** - * Proxy all methods to the delegate. - * - * @param type $method - * @param type $args - * @return type - */ - public function __call($method, $args) - { - return call_user_func_array(array($this->delegate, $method), $args); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/PhpParser.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/PhpParser.php deleted file mode 100644 index a14f8f5..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/PhpParser.php +++ /dev/null @@ -1,203 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -use SplFileObject; - -/** - * Parses a file for namespaces/use/class declarations. - * - * @author Fabien Potencier - * @author Christian Kaps - */ -final class PhpParser -{ - /** - * The token list. - * - * @var array - */ - private $tokens; - - /** - * The number of tokens. - * - * @var int - */ - private $numTokens = 0; - - /** - * The current array pointer. - * - * @var int - */ - private $pointer = 0; - - /** - * Parses a class. - * - * @param \ReflectionClass $class A ReflectionClass object. - * @return array A list with use statements in the form (Alias => FQN). - */ - public function parseClass(\ReflectionClass $class) - { - if (false === $filename = $class->getFilename()) { - return array(); - } - - $content = $this->getFileContent($filename, $class->getStartLine()); - $namespace = str_replace('\\', '\\\\', $class->getNamespaceName()); - $content = preg_replace('/^.*?(\bnamespace\s+' . $namespace . '\s*[;{].*)$/s', '\\1', $content); - $this->tokens = token_get_all('numTokens = count($this->tokens); - $this->pointer = 0; - - $statements = $this->parseUseStatements($class->getNamespaceName()); - - return $statements; - } - - /** - * Get the content of the file right up to the given line number. - * - * @param string $filename The name of the file to load. - * @param int $lineNumber The number of lines to read from file. - * @return string The content of the file. - */ - private function getFileContent($filename, $lineNumber) - { - $content = ''; - $lineCnt = 0; - $file = new SplFileObject($filename); - while(!$file->eof()) { - if ($lineCnt++ == $lineNumber) { - break; - } - - $content .= $file->fgets(); - } - - return $content; - } - - /** - * Gets the next non whitespace and non comment token. - * - * @return array The token if exists, null otherwise. - */ - private function next() - { - for ($i = $this->pointer; $i < $this->numTokens; $i++) { - $this->pointer++; - if ($this->tokens[$i][0] === T_WHITESPACE || - $this->tokens[$i][0] === T_COMMENT || - $this->tokens[$i][0] === T_DOC_COMMENT) { - - continue; - } - - return $this->tokens[$i]; - } - - return null; - } - - /** - * Get all use statements. - * - * @param string $namespaceName The namespace name of the reflected class. - * @return array A list with all found use statements. - */ - private function parseUseStatements($namespaceName) - { - $statements = array(); - while (($token = $this->next())) { - if ($token[0] === T_USE) { - $statements = array_merge($statements, $this->parseUseStatement()); - continue; - } else if ($token[0] !== T_NAMESPACE || $this->parseNamespace() != $namespaceName) { - continue; - } - - // Get fresh array for new namespace. This is to prevent the parser to collect the use statements - // for a previous namespace with the same name. This is the case if a namespace is defined twice - // or if a namespace with the same name is commented out. - $statements = array(); - } - - return $statements; - } - - /** - * Get the namespace name. - * - * @return string The found namespace name. - */ - private function parseNamespace() - { - $namespace = ''; - while (($token = $this->next())){ - if ($token[0] === T_STRING || $token[0] === T_NS_SEPARATOR) { - $namespace .= $token[1]; - } else { - break; - } - } - - return $namespace; - } - - /** - * Parse a single use statement. - * - * @return array A list with all found class names for a use statement. - */ - private function parseUseStatement() - { - $class = ''; - $alias = ''; - $statements = array(); - $explicitAlias = false; - while (($token = $this->next())) { - $isNameToken = $token[0] === T_STRING || $token[0] === T_NS_SEPARATOR; - if (!$explicitAlias && $isNameToken) { - $class .= $token[1]; - $alias = $token[1]; - } else if ($explicitAlias && $isNameToken) { - $alias .= $token[1]; - } else if ($token[0] === T_AS) { - $explicitAlias = true; - $alias = ''; - } else if ($token === ',') { - $statements[strtolower($alias)] = $class; - $class = ''; - $alias = ''; - $explicitAlias = false; - } else if ($token === ';') { - $statements[strtolower($alias)] = $class; - break; - } else { - break; - } - } - - return $statements; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Reader.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Reader.php deleted file mode 100644 index 8e85d39..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Reader.php +++ /dev/null @@ -1,35 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -/** - * Interface for annotation readers. - * - * @author Johannes M. Schmitt - */ -interface Reader -{ - function getClassAnnotations(\ReflectionClass $class); - function getClassAnnotation(\ReflectionClass $class, $annotationName); - function getMethodAnnotations(\ReflectionMethod $method); - function getMethodAnnotation(\ReflectionMethod $method, $annotationName); - function getPropertyAnnotations(\ReflectionProperty $property); - function getPropertyAnnotation(\ReflectionProperty $property, $annotationName); -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php deleted file mode 100644 index a13c7fa..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php +++ /dev/null @@ -1,152 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -use Doctrine\Common\Annotations\Annotation\Target; - -/** - * Simple Annotation Reader. - * - * This annotation reader is intended to be used in projects where you have - * full-control over all annotations that are available. - * - * @since 2.2 - * @author Johannes M. Schmitt - * @author Fabio B. Silva - */ -class SimpleAnnotationReader implements Reader -{ - /** - * @var DocParser - */ - private $parser; - - /** - * Constructor. - * - * Initializes a new SimpleAnnotationReader. - */ - public function __construct() - { - $this->parser = new DocParser(); - $this->parser->setIgnoreNotImportedAnnotations(true); - } - - /** - * Adds a namespace in which we will look for annotations. - * - * @param string $namespace - */ - public function addNamespace($namespace) - { - $this->parser->addNamespace($namespace); - } - - /** - * Gets the annotations applied to a class. - * - * @param ReflectionClass $class The ReflectionClass of the class from which - * the class annotations should be read. - * @return array An array of Annotations. - */ - public function getClassAnnotations(\ReflectionClass $class) - { - return $this->parser->parse($class->getDocComment(), 'class '.$class->getName()); - } - - /** - * Gets the annotations applied to a method. - * - * @param ReflectionMethod $property The ReflectionMethod of the method from which - * the annotations should be read. - * @return array An array of Annotations. - */ - public function getMethodAnnotations(\ReflectionMethod $method) - { - return $this->parser->parse($method->getDocComment(), 'method '.$method->getDeclaringClass()->name.'::'.$method->getName().'()'); - } - - /** - * Gets the annotations applied to a property. - * - * @param ReflectionProperty $property The ReflectionProperty of the property - * from which the annotations should be read. - * @return array An array of Annotations. - */ - public function getPropertyAnnotations(\ReflectionProperty $property) - { - return $this->parser->parse($property->getDocComment(), 'property '.$property->getDeclaringClass()->name.'::$'.$property->getName()); - } - - /** - * Gets a class annotation. - * - * @param ReflectionClass $class The ReflectionClass of the class from which - * the class annotations should be read. - * @param string $annotationName The name of the annotation. - * @return The Annotation or NULL, if the requested annotation does not exist. - */ - public function getClassAnnotation(\ReflectionClass $class, $annotationName) - { - foreach ($this->getClassAnnotations($class) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - /** - * Gets a method annotation. - * - * @param ReflectionMethod $method - * @param string $annotationName The name of the annotation. - * @return The Annotation or NULL, if the requested annotation does not exist. - */ - public function getMethodAnnotation(\ReflectionMethod $method, $annotationName) - { - foreach ($this->getMethodAnnotations($method) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - /** - * Gets a property annotation. - * - * @param ReflectionProperty $property - * @param string $annotationName The name of the annotation. - * @return The Annotation or NULL, if the requested annotation does not exist. - */ - public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName) - { - foreach ($this->getPropertyAnnotations($property) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/ApcCache.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/ApcCache.php deleted file mode 100644 index a59296f..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Cache/ApcCache.php +++ /dev/null @@ -1,97 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * APC cache provider. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author David Abdemoulaie - */ -class ApcCache extends CacheProvider -{ - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return apc_fetch($id); - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - $found = false; - - apc_fetch($id, $found); - - return $found; - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - return (bool) apc_store($id, $data, (int) $lifeTime); - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return apc_delete($id); - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - return apc_clear_cache() && apc_clear_cache('user'); - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - $info = apc_cache_info(); - $sma = apc_sma_info(); - - return array( - Cache::STATS_HITS => $info['num_hits'], - Cache::STATS_MISSES => $info['num_misses'], - Cache::STATS_UPTIME => $info['start_time'], - Cache::STATS_MEMORY_USAGE => $info['mem_size'], - Cache::STATS_MEMORY_AVAILIABLE => $sma['avail_mem'], - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/ArrayCache.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/ArrayCache.php deleted file mode 100644 index 8a0b982..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Cache/ArrayCache.php +++ /dev/null @@ -1,96 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * Array cache driver. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author David Abdemoulaie - */ -class ArrayCache extends CacheProvider -{ - /** - * @var array $data - */ - private $data = array(); - - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return (isset($this->data[$id])) ? $this->data[$id] : false; - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return isset($this->data[$id]); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - $this->data[$id] = $data; - - return true; - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - unset($this->data[$id]); - - return true; - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - $this->data = array(); - - return true; - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - return null; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/Cache.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/Cache.php deleted file mode 100644 index d303bde..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Cache/Cache.php +++ /dev/null @@ -1,102 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * Interface for cache drivers. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Fabio B. Silva - */ -interface Cache -{ - const STATS_HITS = 'hits'; - const STATS_MISSES = 'misses'; - const STATS_UPTIME = 'uptime'; - const STATS_MEMORY_USAGE = 'memory_usage'; - const STATS_MEMORY_AVAILIABLE = 'memory_available'; - - /** - * Fetches an entry from the cache. - * - * @param string $id cache id The id of the cache entry to fetch. - * @return string The cached data or FALSE, if no cache entry exists for the given id. - */ - function fetch($id); - - /** - * Test if an entry exists in the cache. - * - * @param string $id cache id The cache id of the entry to check for. - * @return boolean TRUE if a cache entry exists for the given cache id, FALSE otherwise. - */ - function contains($id); - - /** - * Puts data into the cache. - * - * @param string $id The cache id. - * @param string $data The cache entry/data. - * @param int $lifeTime The lifetime. If != 0, sets a specific lifetime for this cache entry (0 => infinite lifeTime). - * @return boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise. - */ - function save($id, $data, $lifeTime = 0); - - /** - * Deletes a cache entry. - * - * @param string $id cache id - * @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise. - */ - function delete($id); - - /** - * Retrieves cached information from data store - * - * The server's statistics array has the following values: - * - * - hits - * Number of keys that have been requested and found present. - * - * - misses - * Number of items that have been requested and not found. - * - * - uptime - * Time that the server is running. - * - * - memory_usage - * Memory used by this server to store items. - * - * - memory_available - * Memory allowed to use for storage. - * - * @since 2.2 - * @var array Associative array with server's statistics if available, NULL otherwise. - */ - function getStats(); -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/CacheProvider.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/CacheProvider.php deleted file mode 100644 index fa11fc2..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Cache/CacheProvider.php +++ /dev/null @@ -1,188 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * Base class for cache provider implementations. - * - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Fabio B. Silva - */ -abstract class CacheProvider implements Cache -{ - const DOCTRINE_NAMESPACE_CACHEKEY = 'DoctrineNamespaceCacheKey[%s]'; - - /** - * @var string The namespace to prefix all cache ids with - */ - private $namespace = ''; - - /** - * Set the namespace to prefix all cache ids with. - * - * @param string $namespace - * @return void - */ - public function setNamespace($namespace) - { - $this->namespace = (string) $namespace; - } - - /** - * Retrieve the namespace that prefixes all cache ids. - * - * @return string - */ - public function getNamespace() - { - return $this->namespace; - } - - /** - * {@inheritdoc} - */ - public function fetch($id) - { - return $this->doFetch($this->getNamespacedId($id)); - } - - /** - * {@inheritdoc} - */ - public function contains($id) - { - return $this->doContains($this->getNamespacedId($id)); - } - - /** - * {@inheritdoc} - */ - public function save($id, $data, $lifeTime = 0) - { - return $this->doSave($this->getNamespacedId($id), $data, $lifeTime); - } - - /** - * {@inheritdoc} - */ - public function delete($id) - { - return $this->doDelete($this->getNamespacedId($id)); - } - - /** - * {@inheritdoc} - */ - public function getStats() - { - return $this->doGetStats(); - } - - /** - * Deletes all cache entries. - * - * @return boolean TRUE if the cache entries were successfully flushed, FALSE otherwise. - */ - public function flushAll() - { - return $this->doFlush(); - } - - /** - * Delete all cache entries. - * - * @return boolean TRUE if the cache entries were successfully deleted, FALSE otherwise. - */ - public function deleteAll() - { - $namespaceCacheKey = sprintf(self::DOCTRINE_NAMESPACE_CACHEKEY, $this->namespace); - $namespaceVersion = ($this->doContains($namespaceCacheKey)) ? $this->doFetch($namespaceCacheKey) : 1; - - return $this->doSave($namespaceCacheKey, $namespaceVersion + 1); - } - - /** - * Prefix the passed id with the configured namespace value - * - * @param string $id The id to namespace - * @return string $id The namespaced id - */ - private function getNamespacedId($id) - { - $namespaceCacheKey = sprintf(self::DOCTRINE_NAMESPACE_CACHEKEY, $this->namespace); - $namespaceVersion = ($this->doContains($namespaceCacheKey)) ? $this->doFetch($namespaceCacheKey) : 1; - - return sprintf('%s[%s][%s]', $this->namespace, $id, $namespaceVersion); - } - - /** - * Fetches an entry from the cache. - * - * @param string $id cache id The id of the cache entry to fetch. - * @return string The cached data or FALSE, if no cache entry exists for the given id. - */ - abstract protected function doFetch($id); - - /** - * Test if an entry exists in the cache. - * - * @param string $id cache id The cache id of the entry to check for. - * @return boolean TRUE if a cache entry exists for the given cache id, FALSE otherwise. - */ - abstract protected function doContains($id); - - /** - * Puts data into the cache. - * - * @param string $id The cache id. - * @param string $data The cache entry/data. - * @param int $lifeTime The lifetime. If != false, sets a specific lifetime for this cache entry (null => infinite lifeTime). - * @return boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise. - */ - abstract protected function doSave($id, $data, $lifeTime = false); - - /** - * Deletes a cache entry. - * - * @param string $id cache id - * @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise. - */ - abstract protected function doDelete($id); - - /** - * Deletes all cache entries. - * - * @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise. - */ - abstract protected function doFlush(); - - /** - * Retrieves cached information from data store - * - * @since 2.2 - * @return array An associative array with server's statistics if available, NULL otherwise. - */ - abstract protected function doGetStats(); -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/MemcacheCache.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/MemcacheCache.php deleted file mode 100644 index dd6d1e3..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Cache/MemcacheCache.php +++ /dev/null @@ -1,121 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -use \Memcache; - -/** - * Memcache cache provider. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author David Abdemoulaie - */ -class MemcacheCache extends CacheProvider -{ - /** - * @var Memcache - */ - private $memcache; - - /** - * Sets the memcache instance to use. - * - * @param Memcache $memcache - */ - public function setMemcache(Memcache $memcache) - { - $this->memcache = $memcache; - } - - /** - * Gets the memcache instance used by the cache. - * - * @return Memcache - */ - public function getMemcache() - { - return $this->memcache; - } - - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return $this->memcache->get($id); - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return (bool) $this->memcache->get($id); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - if ($lifeTime > 30 * 24 * 3600) { - $lifeTime = time() + $lifeTime; - } - return $this->memcache->set($id, $data, 0, (int) $lifeTime); - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return $this->memcache->delete($id); - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - return $this->memcache->flush(); - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - $stats = $this->memcache->getStats(); - return array( - Cache::STATS_HITS => $stats['get_hits'], - Cache::STATS_MISSES => $stats['get_misses'], - Cache::STATS_UPTIME => $stats['uptime'], - Cache::STATS_MEMORY_USAGE => $stats['bytes'], - Cache::STATS_MEMORY_AVAILIABLE => $stats['limit_maxbytes'], - ); - } -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/MemcachedCache.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/MemcachedCache.php deleted file mode 100644 index 4675fae..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Cache/MemcachedCache.php +++ /dev/null @@ -1,124 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -use \Memcached; - -/** - * Memcached cache provider. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author David Abdemoulaie - */ -class MemcachedCache extends CacheProvider -{ - /** - * @var Memcached - */ - private $memcached; - - /** - * Sets the memcache instance to use. - * - * @param Memcached $memcached - */ - public function setMemcached(Memcached $memcached) - { - $this->memcached = $memcached; - } - - /** - * Gets the memcached instance used by the cache. - * - * @return Memcached - */ - public function getMemcached() - { - return $this->memcached; - } - - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return $this->memcached->get($id); - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return (false !== $this->memcached->get($id)); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - if ($lifeTime > 30 * 24 * 3600) { - $lifeTime = time() + $lifeTime; - } - return $this->memcached->set($id, $data, (int) $lifeTime); - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return $this->memcached->delete($id); - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - return $this->memcached->flush(); - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - $stats = $this->memcached->getStats(); - $servers = $this->memcached->getServerList(); - $key = $servers[0]['host'] . ':' . $servers[0]['port']; - $stats = $stats[$key]; - return array( - Cache::STATS_HITS => $stats['get_hits'], - Cache::STATS_MISSES => $stats['get_misses'], - Cache::STATS_UPTIME => $stats['uptime'], - Cache::STATS_MEMORY_USAGE => $stats['bytes'], - Cache::STATS_MEMORY_AVAILIABLE => $stats['limit_maxbytes'], - ); - } -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/WinCacheCache.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/WinCacheCache.php deleted file mode 100644 index ed8ca74..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Cache/WinCacheCache.php +++ /dev/null @@ -1,92 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * WinCache cache provider. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author David Abdemoulaie - */ -class WincacheCache extends CacheProvider -{ - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return wincache_ucache_get($id); - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return wincache_ucache_exists($id); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - return (bool) wincache_ucache_set($id, $data, (int) $lifeTime); - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return wincache_ucache_delete($id); - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - return wincache_ucache_clear(); - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - $info = wincache_ucache_info(); - $meminfo= wincache_ucache_meminfo(); - return array( - Cache::STATS_HITS => $info['total_hit_count'], - Cache::STATS_MISSES => $info['total_miss_count'], - Cache::STATS_UPTIME => $info['total_cache_uptime'], - Cache::STATS_MEMORY_USAGE => $meminfo['memory_total'], - Cache::STATS_MEMORY_AVAILIABLE => $meminfo['memory_free'], - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/XcacheCache.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/XcacheCache.php deleted file mode 100644 index 6e22d26..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Cache/XcacheCache.php +++ /dev/null @@ -1,110 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * Xcache cache driver. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author David Abdemoulaie - */ -class XcacheCache extends CacheProvider -{ - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return $this->doContains($id) ? unserialize(xcache_get($id)) : false; - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return xcache_isset($id); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - return xcache_set($id, serialize($data), (int) $lifeTime); - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return xcache_unset($id); - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - $this->checkAuthorization(); - - xcache_clear_cache(XC_TYPE_VAR, 0); - - return true; - } - - /** - * Checks that xcache.admin.enable_auth is Off - * - * @throws \BadMethodCallException When xcache.admin.enable_auth is On - * @return void - */ - protected function checkAuthorization() - { - if (ini_get('xcache.admin.enable_auth')) { - throw new \BadMethodCallException('To use all features of \Doctrine\Common\Cache\XcacheCache, you must set "xcache.admin.enable_auth" to "Off" in your php.ini.'); - } - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - $this->checkAuthorization(); - - $info = xcache_info(XC_TYPE_VAR, 0); - return array( - Cache::STATS_HITS => $info['hits'], - Cache::STATS_MISSES => $info['misses'], - Cache::STATS_UPTIME => null, - Cache::STATS_MEMORY_USAGE => $info['size'], - Cache::STATS_MEMORY_AVAILIABLE => $info['avail'], - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/ZendDataCache.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/ZendDataCache.php deleted file mode 100644 index 4e4dabe..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Cache/ZendDataCache.php +++ /dev/null @@ -1,84 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * Zend Data Cache cache driver. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Ralph Schindler - * @author Guilherme Blanco - */ -class ZendDataCache extends CacheProvider -{ - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return zend_shm_cache_fetch($id); - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return (false !== zend_shm_cache_fetch($id)); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - return zend_shm_cache_store($id, $data, $lifeTime); - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return zend_shm_cache_delete($id); - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - $namespace = $this->getNamespace(); - if (empty($namespace)) { - return zend_shm_cache_clear(); - } - return zend_shm_cache_clear($namespace); - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - return null; - } -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php b/vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php deleted file mode 100644 index 375b0d6..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php +++ /dev/null @@ -1,262 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * A ClassLoader is an autoloader for class files that can be - * installed on the SPL autoload stack. It is a class loader that either loads only classes - * of a specific namespace or all namespaces and it is suitable for working together - * with other autoloaders in the SPL autoload stack. - * - * If no include path is configured through the constructor or {@link setIncludePath}, a ClassLoader - * relies on the PHP include_path. - * - * @author Roman Borschel - * @since 2.0 - */ -class ClassLoader -{ - /** - * @var string PHP file extension - */ - protected $fileExtension = '.php'; - - /** - * @var string Current namespace - */ - protected $namespace; - - /** - * @var string Current include path - */ - protected $includePath; - - /** - * @var string PHP namespace separator - */ - protected $namespaceSeparator = '\\'; - - /** - * Creates a new ClassLoader that loads classes of the - * specified namespace from the specified include path. - * - * If no include path is given, the ClassLoader relies on the PHP include_path. - * If neither a namespace nor an include path is given, the ClassLoader will - * be responsible for loading all classes, thereby relying on the PHP include_path. - * - * @param string $ns The namespace of the classes to load. - * @param string $includePath The base include path to use. - */ - public function __construct($ns = null, $includePath = null) - { - $this->namespace = $ns; - $this->includePath = $includePath; - } - - /** - * Sets the namespace separator used by classes in the namespace of this ClassLoader. - * - * @param string $sep The separator to use. - */ - public function setNamespaceSeparator($sep) - { - $this->namespaceSeparator = $sep; - } - - /** - * Gets the namespace separator used by classes in the namespace of this ClassLoader. - * - * @return string - */ - public function getNamespaceSeparator() - { - return $this->namespaceSeparator; - } - - /** - * Sets the base include path for all class files in the namespace of this ClassLoader. - * - * @param string $includePath - */ - public function setIncludePath($includePath) - { - $this->includePath = $includePath; - } - - /** - * Gets the base include path for all class files in the namespace of this ClassLoader. - * - * @return string - */ - public function getIncludePath() - { - return $this->includePath; - } - - /** - * Sets the file extension of class files in the namespace of this ClassLoader. - * - * @param string $fileExtension - */ - public function setFileExtension($fileExtension) - { - $this->fileExtension = $fileExtension; - } - - /** - * Gets the file extension of class files in the namespace of this ClassLoader. - * - * @return string - */ - public function getFileExtension() - { - return $this->fileExtension; - } - - /** - * Registers this ClassLoader on the SPL autoload stack. - */ - public function register() - { - spl_autoload_register(array($this, 'loadClass')); - } - - /** - * Removes this ClassLoader from the SPL autoload stack. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $classname The name of the class to load. - * @return boolean TRUE if the class has been successfully loaded, FALSE otherwise. - */ - public function loadClass($className) - { - if ($this->namespace !== null && strpos($className, $this->namespace.$this->namespaceSeparator) !== 0) { - return false; - } - - require ($this->includePath !== null ? $this->includePath . DIRECTORY_SEPARATOR : '') - . str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $className) - . $this->fileExtension; - - return true; - } - - /** - * Asks this ClassLoader whether it can potentially load the class (file) with - * the given name. - * - * @param string $className The fully-qualified name of the class. - * @return boolean TRUE if this ClassLoader can load the class, FALSE otherwise. - */ - public function canLoadClass($className) - { - if ($this->namespace !== null && strpos($className, $this->namespace.$this->namespaceSeparator) !== 0) { - return false; - } - - $file = str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $className) . $this->fileExtension; - - if ($this->includePath !== null) { - return file_exists($this->includePath . DIRECTORY_SEPARATOR . $file); - } - - return (false !== stream_resolve_include_path($file)); - } - - /** - * Checks whether a class with a given name exists. A class "exists" if it is either - * already defined in the current request or if there is an autoloader on the SPL - * autoload stack that is a) responsible for the class in question and b) is able to - * load a class file in which the class definition resides. - * - * If the class is not already defined, each autoloader in the SPL autoload stack - * is asked whether it is able to tell if the class exists. If the autoloader is - * a ClassLoader, {@link canLoadClass} is used, otherwise the autoload - * function of the autoloader is invoked and expected to return a value that - * evaluates to TRUE if the class (file) exists. As soon as one autoloader reports - * that the class exists, TRUE is returned. - * - * Note that, depending on what kinds of autoloaders are installed on the SPL - * autoload stack, the class (file) might already be loaded as a result of checking - * for its existence. This is not the case with a ClassLoader, who separates - * these responsibilities. - * - * @param string $className The fully-qualified name of the class. - * @return boolean TRUE if the class exists as per the definition given above, FALSE otherwise. - */ - public static function classExists($className) - { - if (class_exists($className, false) || interface_exists($className, false)) { - return true; - } - - foreach (spl_autoload_functions() as $loader) { - if (is_array($loader)) { // array(???, ???) - if (is_object($loader[0])) { - if ($loader[0] instanceof ClassLoader) { // array($obj, 'methodName') - if ($loader[0]->canLoadClass($className)) { - return true; - } - } else if ($loader[0]->{$loader[1]}($className)) { - return true; - } - } else if ($loader[0]::$loader[1]($className)) { // array('ClassName', 'methodName') - return true; - } - } else if ($loader instanceof \Closure) { // function($className) {..} - if ($loader($className)) { - return true; - } - } else if (is_string($loader) && $loader($className)) { // "MyClass::loadClass" - return true; - } - } - - return class_exists($className, false) || interface_exists($className, false); - } - - /** - * Gets the ClassLoader from the SPL autoload stack that is responsible - * for (and is able to load) the class with the given name. - * - * @param string $className The name of the class. - * @return The ClassLoader for the class or NULL if no such ClassLoader exists. - */ - public static function getClassLoader($className) - { - foreach (spl_autoload_functions() as $loader) { - if (is_array($loader) - && $loader[0] instanceof ClassLoader - && $loader[0]->canLoadClass($className) - ) { - return $loader[0]; - } - } - - return null; - } -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Collections/ArrayCollection.php b/vendor/doctrine/common/lib/Doctrine/Common/Collections/ArrayCollection.php deleted file mode 100644 index 2a7d4ea..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Collections/ArrayCollection.php +++ /dev/null @@ -1,447 +0,0 @@ -. - */ - -namespace Doctrine\Common\Collections; - -use Closure, ArrayIterator; - -/** - * An ArrayCollection is a Collection implementation that wraps a regular PHP array. - * - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ArrayCollection implements Collection -{ - /** - * An array containing the entries of this collection. - * - * @var array - */ - private $_elements; - - /** - * Initializes a new ArrayCollection. - * - * @param array $elements - */ - public function __construct(array $elements = array()) - { - $this->_elements = $elements; - } - - /** - * Gets the PHP array representation of this collection. - * - * @return array The PHP array representation of this collection. - */ - public function toArray() - { - return $this->_elements; - } - - /** - * Sets the internal iterator to the first element in the collection and - * returns this element. - * - * @return mixed - */ - public function first() - { - return reset($this->_elements); - } - - /** - * Sets the internal iterator to the last element in the collection and - * returns this element. - * - * @return mixed - */ - public function last() - { - return end($this->_elements); - } - - /** - * Gets the current key/index at the current internal iterator position. - * - * @return mixed - */ - public function key() - { - return key($this->_elements); - } - - /** - * Moves the internal iterator position to the next element. - * - * @return mixed - */ - public function next() - { - return next($this->_elements); - } - - /** - * Gets the element of the collection at the current internal iterator position. - * - * @return mixed - */ - public function current() - { - return current($this->_elements); - } - - /** - * Removes an element with a specific key/index from the collection. - * - * @param mixed $key - * @return mixed The removed element or NULL, if no element exists for the given key. - */ - public function remove($key) - { - if (isset($this->_elements[$key])) { - $removed = $this->_elements[$key]; - unset($this->_elements[$key]); - - return $removed; - } - - return null; - } - - /** - * Removes the specified element from the collection, if it is found. - * - * @param mixed $element The element to remove. - * @return boolean TRUE if this collection contained the specified element, FALSE otherwise. - */ - public function removeElement($element) - { - $key = array_search($element, $this->_elements, true); - - if ($key !== false) { - unset($this->_elements[$key]); - - return true; - } - - return false; - } - - /** - * ArrayAccess implementation of offsetExists() - * - * @see containsKey() - */ - public function offsetExists($offset) - { - return $this->containsKey($offset); - } - - /** - * ArrayAccess implementation of offsetGet() - * - * @see get() - */ - public function offsetGet($offset) - { - return $this->get($offset); - } - - /** - * ArrayAccess implementation of offsetGet() - * - * @see add() - * @see set() - */ - public function offsetSet($offset, $value) - { - if ( ! isset($offset)) { - return $this->add($value); - } - return $this->set($offset, $value); - } - - /** - * ArrayAccess implementation of offsetUnset() - * - * @see remove() - */ - public function offsetUnset($offset) - { - return $this->remove($offset); - } - - /** - * Checks whether the collection contains a specific key/index. - * - * @param mixed $key The key to check for. - * @return boolean TRUE if the given key/index exists, FALSE otherwise. - */ - public function containsKey($key) - { - return isset($this->_elements[$key]); - } - - /** - * Checks whether the given element is contained in the collection. - * Only element values are compared, not keys. The comparison of two elements - * is strict, that means not only the value but also the type must match. - * For objects this means reference equality. - * - * @param mixed $element - * @return boolean TRUE if the given element is contained in the collection, - * FALSE otherwise. - */ - public function contains($element) - { - foreach ($this->_elements as $collectionElement) { - if ($element === $collectionElement) { - return true; - } - } - - return false; - } - - /** - * Tests for the existance of an element that satisfies the given predicate. - * - * @param Closure $p The predicate. - * @return boolean TRUE if the predicate is TRUE for at least one element, FALSE otherwise. - */ - public function exists(Closure $p) - { - foreach ($this->_elements as $key => $element) { - if ($p($key, $element)) { - return true; - } - } - return false; - } - - /** - * Searches for a given element and, if found, returns the corresponding key/index - * of that element. The comparison of two elements is strict, that means not - * only the value but also the type must match. - * For objects this means reference equality. - * - * @param mixed $element The element to search for. - * @return mixed The key/index of the element or FALSE if the element was not found. - */ - public function indexOf($element) - { - return array_search($element, $this->_elements, true); - } - - /** - * Gets the element with the given key/index. - * - * @param mixed $key The key. - * @return mixed The element or NULL, if no element exists for the given key. - */ - public function get($key) - { - if (isset($this->_elements[$key])) { - return $this->_elements[$key]; - } - return null; - } - - /** - * Gets all keys/indexes of the collection elements. - * - * @return array - */ - public function getKeys() - { - return array_keys($this->_elements); - } - - /** - * Gets all elements. - * - * @return array - */ - public function getValues() - { - return array_values($this->_elements); - } - - /** - * Returns the number of elements in the collection. - * - * Implementation of the Countable interface. - * - * @return integer The number of elements in the collection. - */ - public function count() - { - return count($this->_elements); - } - - /** - * Adds/sets an element in the collection at the index / with the specified key. - * - * When the collection is a Map this is like put(key,value)/add(key,value). - * When the collection is a List this is like add(position,value). - * - * @param mixed $key - * @param mixed $value - */ - public function set($key, $value) - { - $this->_elements[$key] = $value; - } - - /** - * Adds an element to the collection. - * - * @param mixed $value - * @return boolean Always TRUE. - */ - public function add($value) - { - $this->_elements[] = $value; - return true; - } - - /** - * Checks whether the collection is empty. - * - * Note: This is preferrable over count() == 0. - * - * @return boolean TRUE if the collection is empty, FALSE otherwise. - */ - public function isEmpty() - { - return ! $this->_elements; - } - - /** - * Gets an iterator for iterating over the elements in the collection. - * - * @return ArrayIterator - */ - public function getIterator() - { - return new ArrayIterator($this->_elements); - } - - /** - * Applies the given function to each element in the collection and returns - * a new collection with the elements returned by the function. - * - * @param Closure $func - * @return Collection - */ - public function map(Closure $func) - { - return new static(array_map($func, $this->_elements)); - } - - /** - * Returns all the elements of this collection that satisfy the predicate p. - * The order of the elements is preserved. - * - * @param Closure $p The predicate used for filtering. - * @return Collection A collection with the results of the filter operation. - */ - public function filter(Closure $p) - { - return new static(array_filter($this->_elements, $p)); - } - - /** - * Applies the given predicate p to all elements of this collection, - * returning true, if the predicate yields true for all elements. - * - * @param Closure $p The predicate. - * @return boolean TRUE, if the predicate yields TRUE for all elements, FALSE otherwise. - */ - public function forAll(Closure $p) - { - foreach ($this->_elements as $key => $element) { - if ( ! $p($key, $element)) { - return false; - } - } - - return true; - } - - /** - * Partitions this collection in two collections according to a predicate. - * Keys are preserved in the resulting collections. - * - * @param Closure $p The predicate on which to partition. - * @return array An array with two elements. The first element contains the collection - * of elements where the predicate returned TRUE, the second element - * contains the collection of elements where the predicate returned FALSE. - */ - public function partition(Closure $p) - { - $coll1 = $coll2 = array(); - foreach ($this->_elements as $key => $element) { - if ($p($key, $element)) { - $coll1[$key] = $element; - } else { - $coll2[$key] = $element; - } - } - return array(new static($coll1), new static($coll2)); - } - - /** - * Returns a string representation of this object. - * - * @return string - */ - public function __toString() - { - return __CLASS__ . '@' . spl_object_hash($this); - } - - /** - * Clears the collection. - */ - public function clear() - { - $this->_elements = array(); - } - - /** - * Extract a slice of $length elements starting at position $offset from the Collection. - * - * If $length is null it returns all elements from $offset to the end of the Collection. - * Keys have to be preserved by this method. Calling this method will only return the - * selected slice and NOT change the elements contained in the collection slice is called on. - * - * @param int $offset - * @param int $length - * @return array - */ - public function slice($offset, $length = null) - { - return array_slice($this->_elements, $offset, $length, true); - } -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Collections/Collection.php b/vendor/doctrine/common/lib/Doctrine/Common/Collections/Collection.php deleted file mode 100644 index 9fca659..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Collections/Collection.php +++ /dev/null @@ -1,243 +0,0 @@ -. - */ - -namespace Doctrine\Common\Collections; - -use Closure, Countable, IteratorAggregate, ArrayAccess; - -/** - * The missing (SPL) Collection/Array/OrderedMap interface. - * - * A Collection resembles the nature of a regular PHP array. That is, - * it is essentially an ordered map that can also be used - * like a list. - * - * A Collection has an internal iterator just like a PHP array. In addition, - * a Collection can be iterated with external iterators, which is preferrable. - * To use an external iterator simply use the foreach language construct to - * iterate over the collection (which calls {@link getIterator()} internally) or - * explicitly retrieve an iterator though {@link getIterator()} which can then be - * used to iterate over the collection. - * You can not rely on the internal iterator of the collection being at a certain - * position unless you explicitly positioned it before. Prefer iteration with - * external iterators. - * - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -interface Collection extends Countable, IteratorAggregate, ArrayAccess -{ - /** - * Adds an element at the end of the collection. - * - * @param mixed $element The element to add. - * @return boolean Always TRUE. - */ - function add($element); - - /** - * Clears the collection, removing all elements. - */ - function clear(); - - /** - * Checks whether an element is contained in the collection. - * This is an O(n) operation, where n is the size of the collection. - * - * @param mixed $element The element to search for. - * @return boolean TRUE if the collection contains the element, FALSE otherwise. - */ - function contains($element); - - /** - * Checks whether the collection is empty (contains no elements). - * - * @return boolean TRUE if the collection is empty, FALSE otherwise. - */ - function isEmpty(); - - /** - * Removes the element at the specified index from the collection. - * - * @param string|integer $key The kex/index of the element to remove. - * @return mixed The removed element or NULL, if the collection did not contain the element. - */ - function remove($key); - - /** - * Removes the specified element from the collection, if it is found. - * - * @param mixed $element The element to remove. - * @return boolean TRUE if this collection contained the specified element, FALSE otherwise. - */ - function removeElement($element); - - /** - * Checks whether the collection contains an element with the specified key/index. - * - * @param string|integer $key The key/index to check for. - * @return boolean TRUE if the collection contains an element with the specified key/index, - * FALSE otherwise. - */ - function containsKey($key); - - /** - * Gets the element at the specified key/index. - * - * @param string|integer $key The key/index of the element to retrieve. - * @return mixed - */ - function get($key); - - /** - * Gets all keys/indices of the collection. - * - * @return array The keys/indices of the collection, in the order of the corresponding - * elements in the collection. - */ - function getKeys(); - - /** - * Gets all values of the collection. - * - * @return array The values of all elements in the collection, in the order they - * appear in the collection. - */ - function getValues(); - - /** - * Sets an element in the collection at the specified key/index. - * - * @param string|integer $key The key/index of the element to set. - * @param mixed $value The element to set. - */ - function set($key, $value); - - /** - * Gets a native PHP array representation of the collection. - * - * @return array - */ - function toArray(); - - /** - * Sets the internal iterator to the first element in the collection and - * returns this element. - * - * @return mixed - */ - function first(); - - /** - * Sets the internal iterator to the last element in the collection and - * returns this element. - * - * @return mixed - */ - function last(); - - /** - * Gets the key/index of the element at the current iterator position. - * - */ - function key(); - - /** - * Gets the element of the collection at the current iterator position. - * - */ - function current(); - - /** - * Moves the internal iterator position to the next element. - * - */ - function next(); - - /** - * Tests for the existence of an element that satisfies the given predicate. - * - * @param Closure $p The predicate. - * @return boolean TRUE if the predicate is TRUE for at least one element, FALSE otherwise. - */ - function exists(Closure $p); - - /** - * Returns all the elements of this collection that satisfy the predicate p. - * The order of the elements is preserved. - * - * @param Closure $p The predicate used for filtering. - * @return Collection A collection with the results of the filter operation. - */ - function filter(Closure $p); - - /** - * Applies the given predicate p to all elements of this collection, - * returning true, if the predicate yields true for all elements. - * - * @param Closure $p The predicate. - * @return boolean TRUE, if the predicate yields TRUE for all elements, FALSE otherwise. - */ - function forAll(Closure $p); - - /** - * Applies the given function to each element in the collection and returns - * a new collection with the elements returned by the function. - * - * @param Closure $func - * @return Collection - */ - function map(Closure $func); - - /** - * Partitions this collection in two collections according to a predicate. - * Keys are preserved in the resulting collections. - * - * @param Closure $p The predicate on which to partition. - * @return array An array with two elements. The first element contains the collection - * of elements where the predicate returned TRUE, the second element - * contains the collection of elements where the predicate returned FALSE. - */ - function partition(Closure $p); - - /** - * Gets the index/key of a given element. The comparison of two elements is strict, - * that means not only the value but also the type must match. - * For objects this means reference equality. - * - * @param mixed $element The element to search for. - * @return mixed The key/index of the element or FALSE if the element was not found. - */ - function indexOf($element); - - /** - * Extract a slice of $length elements starting at position $offset from the Collection. - * - * If $length is null it returns all elements from $offset to the end of the Collection. - * Keys have to be preserved by this method. Calling this method will only return the - * selected slice and NOT change the elements contained in the collection slice is called on. - * - * @param int $offset - * @param int $length - * @return array - */ - function slice($offset, $length = null); -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/CommonException.php b/vendor/doctrine/common/lib/Doctrine/Common/CommonException.php deleted file mode 100644 index 8c5669b..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/CommonException.php +++ /dev/null @@ -1,28 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * Base exception class for package Doctrine\Common - * @author heinrich - * - */ -class CommonException extends \Exception { -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Comparable.php b/vendor/doctrine/common/lib/Doctrine/Common/Comparable.php deleted file mode 100644 index bc95d30..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Comparable.php +++ /dev/null @@ -1,47 +0,0 @@ -. - */ - - -namespace Doctrine\Common; - -/** - * Comparable interface that allows to compare two value objects to each other for similarity. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - */ -interface Comparable -{ - /** - * Compare the current object to the passed $other. - * - * Returns 0 if they are semantically equal, 1 if the other object - * is less than the current one, or -1 if its more than the current one. - * - * This method should not check for identity using ===, only for semantical equality for example - * when two different DateTime instances point to the exact same Date + TZ. - * - * @return int - */ - public function compareTo($other); -} - diff --git a/vendor/doctrine/common/lib/Doctrine/Common/EventArgs.php b/vendor/doctrine/common/lib/Doctrine/Common/EventArgs.php deleted file mode 100644 index 6a3c069..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/EventArgs.php +++ /dev/null @@ -1,69 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * EventArgs is the base class for classes containing event data. - * - * This class contains no event data. It is used by events that do not pass state - * information to an event handler when an event is raised. The single empty EventArgs - * instance can be obtained through {@link getEmptyInstance}. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class EventArgs -{ - /** - * @var EventArgs Single instance of EventArgs - * @static - */ - private static $_emptyEventArgsInstance; - - /** - * Gets the single, empty and immutable EventArgs instance. - * - * This instance will be used when events are dispatched without any parameter, - * like this: EventManager::dispatchEvent('eventname'); - * - * The benefit from this is that only one empty instance is instantiated and shared - * (otherwise there would be instances for every dispatched in the abovementioned form) - * - * @see EventManager::dispatchEvent - * @link http://msdn.microsoft.com/en-us/library/system.eventargs.aspx - * @static - * @return EventArgs - */ - public static function getEmptyInstance() - { - if ( ! self::$_emptyEventArgsInstance) { - self::$_emptyEventArgsInstance = new EventArgs; - } - - return self::$_emptyEventArgsInstance; - } -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php b/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php deleted file mode 100644 index a1f11ed..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php +++ /dev/null @@ -1,136 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * The EventManager is the central point of Doctrine's event listener system. - * Listeners are registered on the manager and events are dispatched through the - * manager. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class EventManager -{ - /** - * Map of registered listeners. - * => - * - * @var array - */ - private $_listeners = array(); - - /** - * Dispatches an event to all registered listeners. - * - * @param string $eventName The name of the event to dispatch. The name of the event is - * the name of the method that is invoked on listeners. - * @param EventArgs $eventArgs The event arguments to pass to the event handlers/listeners. - * If not supplied, the single empty EventArgs instance is used. - * @return boolean - */ - public function dispatchEvent($eventName, EventArgs $eventArgs = null) - { - if (isset($this->_listeners[$eventName])) { - $eventArgs = $eventArgs === null ? EventArgs::getEmptyInstance() : $eventArgs; - - foreach ($this->_listeners[$eventName] as $listener) { - $listener->$eventName($eventArgs); - } - } - } - - /** - * Gets the listeners of a specific event or all listeners. - * - * @param string $event The name of the event. - * @return array The event listeners for the specified event, or all event listeners. - */ - public function getListeners($event = null) - { - return $event ? $this->_listeners[$event] : $this->_listeners; - } - - /** - * Checks whether an event has any registered listeners. - * - * @param string $event - * @return boolean TRUE if the specified event has any listeners, FALSE otherwise. - */ - public function hasListeners($event) - { - return isset($this->_listeners[$event]) && $this->_listeners[$event]; - } - - /** - * Adds an event listener that listens on the specified events. - * - * @param string|array $events The event(s) to listen on. - * @param object $listener The listener object. - */ - public function addEventListener($events, $listener) - { - // Picks the hash code related to that listener - $hash = spl_object_hash($listener); - - foreach ((array) $events as $event) { - // Overrides listener if a previous one was associated already - // Prevents duplicate listeners on same event (same instance only) - $this->_listeners[$event][$hash] = $listener; - } - } - - /** - * Removes an event listener from the specified events. - * - * @param string|array $events - * @param object $listener - */ - public function removeEventListener($events, $listener) - { - // Picks the hash code related to that listener - $hash = spl_object_hash($listener); - - foreach ((array) $events as $event) { - // Check if actually have this listener associated - if (isset($this->_listeners[$event][$hash])) { - unset($this->_listeners[$event][$hash]); - } - } - } - - /** - * Adds an EventSubscriber. The subscriber is asked for all the events he is - * interested in and added as a listener for these events. - * - * @param Doctrine\Common\EventSubscriber $subscriber The subscriber. - */ - public function addEventSubscriber(EventSubscriber $subscriber) - { - $this->addEventListener($subscriber->getSubscribedEvents(), $subscriber); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/EventSubscriber.php b/vendor/doctrine/common/lib/Doctrine/Common/EventSubscriber.php deleted file mode 100644 index ed3383f..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/EventSubscriber.php +++ /dev/null @@ -1,45 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * An EventSubscriber knows himself what events he is interested in. - * If an EventSubscriber is added to an EventManager, the manager invokes - * {@link getSubscribedEvents} and registers the subscriber as a listener for all - * returned events. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -interface EventSubscriber -{ - /** - * Returns an array of events this subscriber wants to listen to. - * - * @return array - */ - function getSubscribedEvents(); -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Lexer.php b/vendor/doctrine/common/lib/Doctrine/Common/Lexer.php deleted file mode 100644 index 8df3b84..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Lexer.php +++ /dev/null @@ -1,266 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * Base class for writing simple lexers, i.e. for creating small DSLs. - * - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @todo Rename: AbstractLexer - */ -abstract class Lexer -{ - /** - * @var array Array of scanned tokens - */ - private $tokens = array(); - - /** - * @var integer Current lexer position in input string - */ - private $position = 0; - - /** - * @var integer Current peek of current lexer position - */ - private $peek = 0; - - /** - * @var array The next token in the input. - */ - public $lookahead; - - /** - * @var array The last matched/seen token. - */ - public $token; - - /** - * Sets the input data to be tokenized. - * - * The Lexer is immediately reset and the new input tokenized. - * Any unprocessed tokens from any previous input are lost. - * - * @param string $input The input to be tokenized. - */ - public function setInput($input) - { - $this->tokens = array(); - $this->reset(); - $this->scan($input); - } - - /** - * Resets the lexer. - */ - public function reset() - { - $this->lookahead = null; - $this->token = null; - $this->peek = 0; - $this->position = 0; - } - - /** - * Resets the peek pointer to 0. - */ - public function resetPeek() - { - $this->peek = 0; - } - - /** - * Resets the lexer position on the input to the given position. - * - * @param integer $position Position to place the lexical scanner - */ - public function resetPosition($position = 0) - { - $this->position = $position; - } - - /** - * Checks whether a given token matches the current lookahead. - * - * @param integer|string $token - * @return boolean - */ - public function isNextToken($token) - { - return null !== $this->lookahead && $this->lookahead['type'] === $token; - } - - /** - * Checks whether any of the given tokens matches the current lookahead - * - * @param array $tokens - * @return boolean - */ - public function isNextTokenAny(array $tokens) - { - return null !== $this->lookahead && in_array($this->lookahead['type'], $tokens, true); - } - - /** - * Moves to the next token in the input string. - * - * A token is an associative array containing three items: - * - 'value' : the string value of the token in the input string - * - 'type' : the type of the token (identifier, numeric, string, input - * parameter, none) - * - 'position' : the position of the token in the input string - * - * @return array|null the next token; null if there is no more tokens left - */ - public function moveNext() - { - $this->peek = 0; - $this->token = $this->lookahead; - $this->lookahead = (isset($this->tokens[$this->position])) - ? $this->tokens[$this->position++] : null; - - return $this->lookahead !== null; - } - - /** - * Tells the lexer to skip input tokens until it sees a token with the given value. - * - * @param $type The token type to skip until. - */ - public function skipUntil($type) - { - while ($this->lookahead !== null && $this->lookahead['type'] !== $type) { - $this->moveNext(); - } - } - - /** - * Checks if given value is identical to the given token - * - * @param mixed $value - * @param integer $token - * @return boolean - */ - public function isA($value, $token) - { - return $this->getType($value) === $token; - } - - /** - * Moves the lookahead token forward. - * - * @return array | null The next token or NULL if there are no more tokens ahead. - */ - public function peek() - { - if (isset($this->tokens[$this->position + $this->peek])) { - return $this->tokens[$this->position + $this->peek++]; - } else { - return null; - } - } - - /** - * Peeks at the next token, returns it and immediately resets the peek. - * - * @return array|null The next token or NULL if there are no more tokens ahead. - */ - public function glimpse() - { - $peek = $this->peek(); - $this->peek = 0; - return $peek; - } - - /** - * Scans the input string for tokens. - * - * @param string $input a query string - */ - protected function scan($input) - { - static $regex; - - if ( ! isset($regex)) { - $regex = '/(' . implode(')|(', $this->getCatchablePatterns()) . ')|' - . implode('|', $this->getNonCatchablePatterns()) . '/i'; - } - - $flags = PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE; - $matches = preg_split($regex, $input, -1, $flags); - - foreach ($matches as $match) { - // Must remain before 'value' assignment since it can change content - $type = $this->getType($match[0]); - - $this->tokens[] = array( - 'value' => $match[0], - 'type' => $type, - 'position' => $match[1], - ); - } - } - - /** - * Gets the literal for a given token. - * - * @param integer $token - * @return string - */ - public function getLiteral($token) - { - $className = get_class($this); - $reflClass = new \ReflectionClass($className); - $constants = $reflClass->getConstants(); - - foreach ($constants as $name => $value) { - if ($value === $token) { - return $className . '::' . $name; - } - } - - return $token; - } - - /** - * Lexical catchable patterns. - * - * @return array - */ - abstract protected function getCatchablePatterns(); - - /** - * Lexical non-catchable patterns. - * - * @return array - */ - abstract protected function getNonCatchablePatterns(); - - /** - * Retrieve token type. Also processes the token value if necessary. - * - * @param string $value - * @return integer - */ - abstract protected function getType(&$value); -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/NotifyPropertyChanged.php b/vendor/doctrine/common/lib/Doctrine/Common/NotifyPropertyChanged.php deleted file mode 100644 index 93e504a..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/NotifyPropertyChanged.php +++ /dev/null @@ -1,45 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * Contract for classes that provide the service of notifying listeners of - * changes to their properties. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -interface NotifyPropertyChanged -{ - /** - * Adds a listener that wants to be notified about property changes. - * - * @param PropertyChangedListener $listener - */ - function addPropertyChangedListener(PropertyChangedListener $listener); -} - diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php deleted file mode 100644 index f045286..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php +++ /dev/null @@ -1,218 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -use Doctrine\Common\Persistence\ManagerRegistry; - -/** - * Abstract implementation of the ManagerRegistry contract. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.2 - * @author Fabien Potencier - * @author Benjamin Eberlei - * @author Lukas Kahwe Smith - */ -abstract class AbstractManagerRegistry implements ManagerRegistry -{ - private $name; - private $connections; - private $managers; - private $defaultConnection; - private $defaultManager; - private $proxyInterfaceName; - - public function __construct($name, array $connections, array $managers, $defaultConnection, $defaultManager, $proxyInterfaceName) - { - $this->name = $name; - $this->connections = $connections; - $this->managers = $managers; - $this->defaultConnection = $defaultConnection; - $this->defaultManager = $defaultManager; - $this->proxyInterfaceName = $proxyInterfaceName; - } - - /** - * Fetches/creates the given services - * - * A service in this context is connection or a manager instance - * - * @param string $name name of the service - * @return object instance of the given service - */ - abstract protected function getService($name); - - /** - * Resets the given services - * - * A service in this context is connection or a manager instance - * - * @param string $name name of the service - * @return void - */ - abstract protected function resetService($name); - - /** - * Get the name of the registry - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * @inheritdoc - */ - public function getConnection($name = null) - { - if (null === $name) { - $name = $this->defaultConnection; - } - - if (!isset($this->connections[$name])) { - throw new \InvalidArgumentException(sprintf('Doctrine %s Connection named "%s" does not exist.', $this->name, $name)); - } - - return $this->getService($this->connections[$name]); - } - - /** - * @inheritdoc - */ - public function getConnectionNames() - { - return $this->connections; - } - - /** - * @inheritdoc - */ - public function getConnections() - { - $connections = array(); - foreach ($this->connections as $name => $id) { - $connections[$name] = $this->getService($id); - } - - return $connections; - } - - /** - * @inheritdoc - */ - public function getDefaultConnectionName() - { - return $this->defaultConnection; - } - - /** - * @inheritdoc - */ - public function getDefaultManagerName() - { - return $this->defaultManager; - } - - /** - * @inheritdoc - */ - public function getManager($name = null) - { - if (null === $name) { - $name = $this->defaultManager; - } - - if (!isset($this->managers[$name])) { - throw new \InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name)); - } - - return $this->getService($this->managers[$name]); - } - - /** - * @inheritdoc - */ - public function getManagerForClass($class) - { - $proxyClass = new \ReflectionClass($class); - if ($proxyClass->implementsInterface($this->proxyInterfaceName)) { - $class = $proxyClass->getParentClass()->getName(); - } - - foreach ($this->managers as $id) { - $manager = $this->getService($id); - - if (!$manager->getMetadataFactory()->isTransient($class)) { - return $manager; - } - } - } - - /** - * @inheritdoc - */ - public function getManagerNames() - { - return $this->managers; - } - - /** - * @inheritdoc - */ - public function getManagers() - { - $dms = array(); - foreach ($this->managers as $name => $id) { - $dms[$name] = $this->getService($id); - } - - return $dms; - } - - /** - * @inheritdoc - */ - public function getRepository($persistentObjectName, $persistentManagerName = null) - { - return $this->getManager($persistentManagerName)->getRepository($persistentObjectName); - } - - /** - * @inheritdoc - */ - public function resetManager($name = null) - { - if (null === $name) { - $name = $this->defaultManager; - } - - if (!isset($this->managers[$name])) { - throw new \InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name)); - } - - // force the creation of a new document manager - // if the current one is closed - $this->resetService($this->managers[$name]); - } -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.php deleted file mode 100644 index a47727f..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.php +++ /dev/null @@ -1,63 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -/** - * Contract covering connection for a Doctrine persistence layer ManagerRegistry class to implement. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.2 - * @author Fabien Potencier - * @author Benjamin Eberlei - * @author Lukas Kahwe Smith - */ -interface ConnectionRegistry -{ - /** - * Gets the default connection name. - * - * @return string The default connection name - */ - function getDefaultConnectionName(); - - /** - * Gets the named connection. - * - * @param string $name The connection name (null for the default one) - * - * @return Connection - */ - function getConnection($name = null); - - /** - * Gets an array of all registered connections - * - * @return array An array of Connection instances - */ - function getConnections(); - - /** - * Gets all connection names. - * - * @return array An array of connection names - */ - function getConnectionNames(); -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php deleted file mode 100644 index 8055b66..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php +++ /dev/null @@ -1,77 +0,0 @@ -. -*/ - -namespace Doctrine\Common\Persistence\Event; - -use Doctrine\Common\EventArgs; -use Doctrine\Common\Persistence\ObjectManager; - -/** - * Lifecycle Events are triggered by the UnitOfWork during lifecycle transitions - * of entities. - * - * @link www.doctrine-project.org - * @since 2.2 - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class LifecycleEventArgs extends EventArgs -{ - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @var object - */ - private $entity; - - /** - * Constructor - * - * @param object $entity - * @param ObjectManager $objectManager - */ - public function __construct($entity, ObjectManager $objectManager) - { - $this->entity = $entity; - $this->objectManager = $objectManager; - } - - /** - * Retireve associated Entity. - * - * @return object - */ - public function getEntity() - { - return $this->entity; - } - - /** - * Retrieve associated ObjectManager. - * - * @return ObjectManager - */ - public function getObjectManager() - { - return $this->objectManager; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php deleted file mode 100644 index 4a18d16..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php +++ /dev/null @@ -1,76 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Event; - -use Doctrine\Common\EventArgs; -use Doctrine\Common\Persistence\ObjectManager; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; - -/** - * Class that holds event arguments for a loadMetadata event. - * - * @author Jonathan H. Wage - * @since 2.2 - */ -class LoadClassMetadataEventArgs extends EventArgs -{ - /** - * @var ClassMetadata - */ - private $classMetadata; - - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * Constructor. - * - * @param ClasseMetadata $classMetadata - * @param ObjectManager $objectManager - */ - public function __construct(ClassMetadata $classMetadata, ObjectManager $objectManager) - { - $this->classMetadata = $classMetadata; - $this->objectManager = $objectManager; - } - - /** - * Retrieve associated ClassMetadata. - * - * @return ClassMetadata - */ - public function getClassMetadata() - { - return $this->classMetadata; - } - - /** - * Retrieve associated ObjectManager. - * - * @return ObjectManager - */ - public function getObjectManager() - { - return $this->objectManager; - } -} - diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php deleted file mode 100644 index 33c4d79..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php +++ /dev/null @@ -1,59 +0,0 @@ -. -*/ - -namespace Doctrine\Common\Persistence\Event; - -use Doctrine\Common\Persistence\ObjectManager; - -/** - * Provides event arguments for the preFlush event. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.2 - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class ManagerEventArgs extends \Doctrine\Common\EventArgs -{ - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * Constructor. - * - * @param ObjectManager $objectManager - */ - public function __construct(ObjectManager $objectManager) - { - $this->objectManager = $objectManager; - } - - /** - * Retrieve associated ObjectManager. - * - * @return ObjectManager - */ - public function getObjectManager() - { - return $this->objectManager; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php deleted file mode 100644 index f67ab50..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php +++ /dev/null @@ -1,84 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Event; - -/** - * Provides event arguments for the onClear event. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.2 - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class OnClearEventArgs extends \Doctrine\Common\EventArgs -{ - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @var string - */ - private $entityClass; - - /** - * Constructor. - * - * @param ObjectManager $objectManager - * @param string $entityClass Optional entity class - */ - public function __construct($objectManager, $entityClass = null) - { - $this->objectManager = $objectManager; - $this->entityClass = $entityClass; - } - - /** - * Retrieve associated ObjectManager. - * - * @return ObjectManager - */ - public function getObjectManager() - { - return $this->objectManager; - } - - /** - * Name of the entity class that is cleared, or empty if all are cleared. - * - * @return string - */ - public function getEntityClass() - { - return $this->entityClass; - } - - /** - * Check if event clears all entities. - * - * @return bool - */ - public function clearsAllEntities() - { - return ($this->entityClass === null); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php deleted file mode 100644 index 191d053..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php +++ /dev/null @@ -1,129 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Event; - -use Doctrine\Common\EventArgs, - Doctrine\Common\Persistence\ObjectManager; - -/** - * Class that holds event arguments for a preUpdate event. - * - * @author Guilherme Blanco - * @author Roman Borschel - * @author Benjamin Eberlei - * @since 2.2 - */ -class PreUpdateEventArgs extends LifecycleEventArgs -{ - /** - * @var array - */ - private $entityChangeSet; - - /** - * Constructor. - * - * @param object $entity - * @param ObjectManager $objectManager - * @param array $changeSet - */ - public function __construct($entity, ObjectManager $objectManager, array &$changeSet) - { - parent::__construct($entity, $objectManager); - - $this->entityChangeSet = &$changeSet; - } - - /** - * Retrieve entity changeset. - * - * @return array - */ - public function getEntityChangeSet() - { - return $this->entityChangeSet; - } - - /** - * Check if field has a changeset. - * - * @return boolean - */ - public function hasChangedField($field) - { - return isset($this->entityChangeSet[$field]); - } - - /** - * Get the old value of the changeset of the changed field. - * - * @param string $field - * @return mixed - */ - public function getOldValue($field) - { - $this->assertValidField($field); - - return $this->entityChangeSet[$field][0]; - } - - /** - * Get the new value of the changeset of the changed field. - * - * @param string $field - * @return mixed - */ - public function getNewValue($field) - { - $this->assertValidField($field); - - return $this->entityChangeSet[$field][1]; - } - - /** - * Set the new value of this field. - * - * @param string $field - * @param mixed $value - */ - public function setNewValue($field, $value) - { - $this->assertValidField($field); - - $this->entityChangeSet[$field][1] = $value; - } - - /** - * Assert the field exists in changeset. - * - * @param string $field - */ - private function assertValidField($field) - { - if ( ! isset($this->entityChangeSet[$field])) { - throw new \InvalidArgumentException(sprintf( - 'Field "%s" is not a valid field of the entity "%s" in PreUpdateEventArgs.', - $field, - get_class($this->getEntity()) - )); - } - } -} - diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ManagerRegistry.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ManagerRegistry.php deleted file mode 100644 index 4d92426..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ManagerRegistry.php +++ /dev/null @@ -1,112 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -/** - * Contract covering object managers for a Doctrine persistence layer ManagerRegistry class to implement. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.2 - * @author Fabien Potencier - * @author Benjamin Eberlei - * @author Lukas Kahwe Smith - */ -interface ManagerRegistry extends ConnectionRegistry -{ - /** - * Gets the default object manager name. - * - * @return string The default object manager name - */ - function getDefaultManagerName(); - - /** - * Gets a named object manager. - * - * @param string $name The object manager name (null for the default one) - * - * @return \Doctrine\Common\Persistence\ObjectManager - */ - function getManager($name = null); - - /** - * Gets an array of all registered object managers - * - * @return array An array of ObjectManager instances - */ - function getManagers(); - - /** - * Resets a named object manager. - * - * This method is useful when an object manager has been closed - * because of a rollbacked transaction AND when you think that - * it makes sense to get a new one to replace the closed one. - * - * Be warned that you will get a brand new object manager as - * the existing one is not useable anymore. This means that any - * other object with a dependency on this object manager will - * hold an obsolete reference. You can inject the registry instead - * to avoid this problem. - * - * @param string $name The object manager name (null for the default one) - * - * @return \Doctrine\Common\Persistence\ObjectManager - */ - function resetManager($name = null); - - /** - * Resolves a registered namespace alias to the full namespace. - * - * This method looks for the alias in all registered object managers. - * - * @param string $alias The alias - * - * @return string The full namespace - */ - function getAliasNamespace($alias); - - /** - * Gets all connection names. - * - * @return array An array of connection names - */ - function getManagerNames(); - - /** - * Gets the ObjectRepository for an persistent object. - * - * @param string $persistentObject The name of the persistent object. - * @param string $persistentManagerName The object manager name (null for the default one) - * - * @return \Doctrine\Common\Persistence\ObjectRepository - */ - function getRepository($persistentObject, $persistentManagerName = null); - - /** - * Gets the object manager associated with a given class. - * - * @param string $class A persistent object class name - * - * @return \Doctrine\Common\Persistence\ObjectManager|null - */ - function getManagerForClass($class); -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php deleted file mode 100644 index a2a6185..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php +++ /dev/null @@ -1,359 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -use Doctrine\Common\Cache\Cache; - -/** - * The ClassMetadataFactory is used to create ClassMetadata objects that contain all the - * metadata mapping informations of a class which describes how a class should be mapped - * to a relational database. - * - * This class was abstracted from the ORM ClassMetadataFactory - * - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -abstract class AbstractClassMetadataFactory implements ClassMetadataFactory -{ - /** - * Salt used by specific Object Manager implementation. - * - * @var string - */ - protected $cacheSalt = "\$CLASSMETADATA"; - - /** - * @var \Doctrine\Common\Cache\Cache - */ - private $cacheDriver; - - /** - * @var array - */ - private $loadedMetadata = array(); - - /** - * @var bool - */ - protected $initialized = false; - - /** - * @var ReflectionService - */ - private $reflectionService; - - /** - * Sets the cache driver used by the factory to cache ClassMetadata instances. - * - * @param Doctrine\Common\Cache\Cache $cacheDriver - */ - public function setCacheDriver(Cache $cacheDriver = null) - { - $this->cacheDriver = $cacheDriver; - } - - /** - * Gets the cache driver used by the factory to cache ClassMetadata instances. - * - * @return Doctrine\Common\Cache\Cache - */ - public function getCacheDriver() - { - return $this->cacheDriver; - } - - /** - * Return an array of all the loaded metadata currently in memory. - * - * @return array - */ - public function getLoadedMetadata() - { - return $this->loadedMetadata; - } - - /** - * Forces the factory to load the metadata of all classes known to the underlying - * mapping driver. - * - * @return array The ClassMetadata instances of all mapped classes. - */ - public function getAllMetadata() - { - if ( ! $this->initialized) { - $this->initialize(); - } - - $driver = $this->getDriver(); - $metadata = array(); - foreach ($driver->getAllClassNames() as $className) { - $metadata[] = $this->getMetadataFor($className); - } - - return $metadata; - } - - /** - * Lazy initialization of this stuff, especially the metadata driver, - * since these are not needed at all when a metadata cache is active. - * - * @return void - */ - abstract protected function initialize(); - - /** - * Get the fully qualified class-name from the namespace alias. - * - * @param string $namespaceAlias - * @param string $simpleClassName - * @return string - */ - abstract protected function getFqcnFromAlias($namespaceAlias, $simpleClassName); - - /** - * Return the mapping driver implementation. - * - * @return MappingDriver - */ - abstract protected function getDriver(); - - /** - * Wakeup reflection after ClassMetadata gets unserialized from cache. - * - * @param ClassMetadata $class - * @param ReflectionService $reflService - * @return void - */ - abstract protected function wakeupReflection(ClassMetadata $class, ReflectionService $reflService); - - /** - * Initialize Reflection after ClassMetadata was constructed. - * - * @param ClassMetadata $class - * @param ReflectionSErvice $reflService - * @return void - */ - abstract protected function initializeReflection(ClassMetadata $class, ReflectionService $reflService); - - /** - * Gets the class metadata descriptor for a class. - * - * @param string $className The name of the class. - * @return Doctrine\Common\Persistence\Mapping\ClassMetadata - */ - public function getMetadataFor($className) - { - if ( ! isset($this->loadedMetadata[$className])) { - $realClassName = $className; - - // Check for namespace alias - if (strpos($className, ':') !== false) { - list($namespaceAlias, $simpleClassName) = explode(':', $className); - $realClassName = $this->getFqcnFromAlias($namespaceAlias, $simpleClassName); - - if (isset($this->loadedMetadata[$realClassName])) { - // We do not have the alias name in the map, include it - $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName]; - - return $this->loadedMetadata[$realClassName]; - } - } - - if ($this->cacheDriver) { - if (($cached = $this->cacheDriver->fetch($realClassName . $this->cacheSalt)) !== false) { - $this->loadedMetadata[$realClassName] = $cached; - $this->wakeupReflection($cached, $this->getReflectionService()); - } else { - foreach ($this->loadMetadata($realClassName) as $loadedClassName) { - $this->cacheDriver->save( - $loadedClassName . $this->cacheSalt, $this->loadedMetadata[$loadedClassName], null - ); - } - } - } else { - $this->loadMetadata($realClassName); - } - - if ($className != $realClassName) { - // We do not have the alias name in the map, include it - $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName]; - } - } - - return $this->loadedMetadata[$className]; - } - - /** - * Checks whether the factory has the metadata for a class loaded already. - * - * @param string $className - * @return boolean TRUE if the metadata of the class in question is already loaded, FALSE otherwise. - */ - public function hasMetadataFor($className) - { - return isset($this->loadedMetadata[$className]); - } - - /** - * Sets the metadata descriptor for a specific class. - * - * NOTE: This is only useful in very special cases, like when generating proxy classes. - * - * @param string $className - * @param ClassMetadata $class - */ - public function setMetadataFor($className, $class) - { - $this->loadedMetadata[$className] = $class; - } - - /** - * Get array of parent classes for the given entity class - * - * @param string $name - * @return array $parentClasses - */ - protected function getParentClasses($name) - { - // Collect parent classes, ignoring transient (not-mapped) classes. - $parentClasses = array(); - foreach (array_reverse($this->getReflectionService()->getParentClasses($name)) as $parentClass) { - if ( ! $this->getDriver()->isTransient($parentClass)) { - $parentClasses[] = $parentClass; - } - } - return $parentClasses; - } - - /** - * Loads the metadata of the class in question and all it's ancestors whose metadata - * is still not loaded. - * - * @param string $name The name of the class for which the metadata should get loaded. - * @param array $tables The metadata collection to which the loaded metadata is added. - */ - protected function loadMetadata($name) - { - if ( ! $this->initialized) { - $this->initialize(); - } - - $loaded = array(); - - $parentClasses = $this->getParentClasses($name); - $parentClasses[] = $name; - - // Move down the hierarchy of parent classes, starting from the topmost class - $parent = null; - $rootEntityFound = false; - $visited = array(); - $reflService = $this->getReflectionService(); - foreach ($parentClasses as $className) { - if (isset($this->loadedMetadata[$className])) { - $parent = $this->loadedMetadata[$className]; - if (isset($parent->isMappedSuperclass) && $parent->isMappedSuperclass === false) { - $rootEntityFound = true; - array_unshift($visited, $className); - } - continue; - } - - $class = $this->newClassMetadataInstance($className); - $this->initializeReflection($class, $reflService); - - $this->doLoadMetadata($class, $parent, $rootEntityFound); - - $this->loadedMetadata[$className] = $class; - - $parent = $class; - - if (isset($parent->isMappedSuperclass) && $class->isMappedSuperclass === false) { - $rootEntityFound = true; - array_unshift($visited, $className); - } - - $this->wakeupReflection($class, $reflService); - - $loaded[] = $className; - } - - return $loaded; - } - - /** - * Actually load the metadata from the underlying metadata - * - * @param ClassMetadata $class - * @param ClassMetadata $parent - * @param bool $rootEntityFound - * @return void - */ - abstract protected function doLoadMetadata($class, $parent, $rootEntityFound); - - /** - * Creates a new ClassMetadata instance for the given class name. - * - * @param string $className - * @return ClassMetadata - */ - abstract protected function newClassMetadataInstance($className); - - /** - * Check if this class is mapped by this Object Manager + ClassMetadata configuration - * - * @param $class - * @return bool - */ - public function isTransient($class) - { - if ( ! $this->initialized) { - $this->initialize(); - } - - return $this->getDriver()->isTransient($class); - } - - /** - * Set reflectionService. - * - * @param ReflectionService $reflectionService - */ - public function setReflectionService(ReflectionService $reflectionService) - { - $this->reflectionService = $reflectionService; - } - - /** - * Get the reflection service associated with this metadata factory. - * - * @return ReflectionService - */ - public function getReflectionService() - { - if ($this->reflectionService === null) { - $this->reflectionService = new RuntimeReflectionService(); - } - return $this->reflectionService; - } -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php deleted file mode 100644 index 705d59a..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php +++ /dev/null @@ -1,165 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -/** - * Contract for a Doctrine persistence layer ClassMetadata class to implement. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.1 - * @author Benjamin Eberlei - * @author Jonathan Wage - */ -interface ClassMetadata -{ - /** - * Get fully-qualified class name of this persistent class. - * - * @return string - */ - function getName(); - - /** - * Gets the mapped identifier field name. - * - * The returned structure is an array of the identifier field names. - * - * @return array - */ - function getIdentifier(); - - /** - * Gets the ReflectionClass instance for this mapped class. - * - * @return ReflectionClass - */ - function getReflectionClass(); - - /** - * Checks if the given field name is a mapped identifier for this class. - * - * @param string $fieldName - * @return boolean - */ - function isIdentifier($fieldName); - - /** - * Checks if the given field is a mapped property for this class. - * - * @param string $fieldName - * @return boolean - */ - function hasField($fieldName); - - /** - * Checks if the given field is a mapped association for this class. - * - * @param string $fieldName - * @return boolean - */ - function hasAssociation($fieldName); - - /** - * Checks if the given field is a mapped single valued association for this class. - * - * @param string $fieldName - * @return boolean - */ - function isSingleValuedAssociation($fieldName); - - /** - * Checks if the given field is a mapped collection valued association for this class. - * - * @param string $fieldName - * @return boolean - */ - function isCollectionValuedAssociation($fieldName); - - /** - * A numerically indexed list of field names of this persistent class. - * - * This array includes identifier fields if present on this class. - * - * @return array - */ - function getFieldNames(); - - /** - * Returns an array of identifier field names numerically indexed. - * - * @return array - */ - function getIdentifierFieldNames(); - - /** - * A numerically indexed list of association names of this persistent class. - * - * This array includes identifier associations if present on this class. - * - * @return array - */ - function getAssociationNames(); - - /** - * Returns a type name of this field. - * - * This type names can be implementation specific but should at least include the php types: - * integer, string, boolean, float/double, datetime. - * - * @param string $fieldName - * @return string - */ - function getTypeOfField($fieldName); - - /** - * Returns the target class name of the given association. - * - * @param string $assocName - * @return string - */ - function getAssociationTargetClass($assocName); - - /** - * Checks if the association is the inverse side of a bidirectional association - * - * @param string $assocName - * @return boolean - */ - function isAssociationInverseSide($assocName); - - /** - * Returns the target field of the owning side of the association - * - * @param string $assocName - * @return string - */ - function getAssociationMappedByTargetField($assocName); - - /** - * Return the identifier of this object as an array with field name as key. - * - * Has to return an empty array if no identifier isset. - * - * @param object $object - * @return array - */ - function getIdentifierValues($object); -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php deleted file mode 100644 index bf27ba9..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php +++ /dev/null @@ -1,74 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -/** - * Contract for a Doctrine persistence layer ClassMetadata class to implement. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.1 - * @author Benjamin Eberlei - * @author Jonathan Wage - */ -interface ClassMetadataFactory -{ - /** - * Forces the factory to load the metadata of all classes known to the underlying - * mapping driver. - * - * @return array The ClassMetadata instances of all mapped classes. - */ - function getAllMetadata(); - - /** - * Gets the class metadata descriptor for a class. - * - * @param string $className The name of the class. - * @return ClassMetadata - */ - function getMetadataFor($className); - - /** - * Checks whether the factory has the metadata for a class loaded already. - * - * @param string $className - * @return boolean TRUE if the metadata of the class in question is already loaded, FALSE otherwise. - */ - function hasMetadataFor($className); - - /** - * Sets the metadata descriptor for a specific class. - * - * @param string $className - * @param ClassMetadata $class - */ - function setMetadataFor($className, $class); - - /** - * Whether the class with the specified name should have its metadata loaded. - * This is only the case if it is either mapped directly or as a - * MappedSuperclass. - * - * @param string $className - * @return boolean - */ - function isTransient($className); -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php deleted file mode 100644 index f52d37e..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php +++ /dev/null @@ -1,214 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Cache\ArrayCache, - Doctrine\Common\Annotations\AnnotationReader, - Doctrine\Common\Annotations\AnnotationRegistry, - Doctrine\Common\Persistence\Mapping\MappingException; - -/** - * The AnnotationDriver reads the mapping metadata from docblock annotations. - * - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -abstract class AnnotationDriver implements MappingDriver -{ - /** - * The AnnotationReader. - * - * @var AnnotationReader - */ - protected $reader; - - /** - * The paths where to look for mapping files. - * - * @var array - */ - protected $paths = array(); - - /** - * The file extension of mapping documents. - * - * @var string - */ - protected $fileExtension = '.php'; - - /** - * Cache for AnnotationDriver#getAllClassNames() - * - * @var array - */ - protected $classNames; - - /** - * Name of the entity annotations as keys - * - * @var array - */ - protected $entityAnnotationClasses = array(); - - /** - * Initializes a new AnnotationDriver that uses the given AnnotationReader for reading - * docblock annotations. - * - * @param AnnotationReader $reader The AnnotationReader to use, duck-typed. - * @param string|array $paths One or multiple paths where mapping classes can be found. - */ - public function __construct($reader, $paths = null) - { - $this->reader = $reader; - if ($paths) { - $this->addPaths((array) $paths); - } - } - - /** - * Append lookup paths to metadata driver. - * - * @param array $paths - */ - public function addPaths(array $paths) - { - $this->paths = array_unique(array_merge($this->paths, $paths)); - } - - /** - * Retrieve the defined metadata lookup paths. - * - * @return array - */ - public function getPaths() - { - return $this->paths; - } - - /** - * Retrieve the current annotation reader - * - * @return AnnotationReader - */ - public function getReader() - { - return $this->reader; - } - - /** - * Get the file extension used to look for mapping files under - * - * @return void - */ - public function getFileExtension() - { - return $this->fileExtension; - } - - /** - * Set the file extension used to look for mapping files under - * - * @param string $fileExtension The file extension to set - * @return void - */ - public function setFileExtension($fileExtension) - { - $this->fileExtension = $fileExtension; - } - - /** - * Whether the class with the specified name is transient. Only non-transient - * classes, that is entities and mapped superclasses, should have their metadata loaded. - * - * A class is non-transient if it is annotated with an annotation - * from the {@see AnnotationDriver::entityAnnotationClasses}. - * - * @param string $className - * @return boolean - */ - public function isTransient($className) - { - $classAnnotations = $this->reader->getClassAnnotations(new \ReflectionClass($className)); - - foreach ($classAnnotations as $annot) { - if (isset($this->entityAnnotationClasses[get_class($annot)])) { - return false; - } - } - return true; - } - - /** - * {@inheritDoc} - */ - public function getAllClassNames() - { - if ($this->classNames !== null) { - return $this->classNames; - } - - if (!$this->paths) { - throw MappingException::pathRequired(); - } - - $classes = array(); - $includedFiles = array(); - - foreach ($this->paths as $path) { - if ( ! is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); - } - - $iterator = new \RegexIterator( - new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS), - \RecursiveIteratorIterator::LEAVES_ONLY - ), - '/^.+' . str_replace('.', '\.', $this->fileExtension) . '$/i', - \RecursiveRegexIterator::GET_MATCH - ); - - foreach ($iterator as $file) { - $sourceFile = realpath($file[0]); - - require_once $sourceFile; - - $includedFiles[] = $sourceFile; - } - } - - $declared = get_declared_classes(); - - foreach ($declared as $className) { - $rc = new \ReflectionClass($className); - $sourceFile = $rc->getFileName(); - if (in_array($sourceFile, $includedFiles) && ! $this->isTransient($className)) { - $classes[] = $className; - } - } - - $this->classNames = $classes; - - return $classes; - } -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php deleted file mode 100644 index efaf545..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php +++ /dev/null @@ -1,169 +0,0 @@ -. -*/ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\MappingException; - -/** - * Locate the file that contains the metadata information for a given class name. - * - * This behavior is inpependent of the actual content of the file. It just detects - * the file which is responsible for the given class name. - * - * @author Benjamin Eberlei - * @author Johannes M. Schmitt - */ -class DefaultFileLocator implements FileLocator -{ - /** - * The paths where to look for mapping files. - * - * @var array - */ - protected $paths = array(); - - /** - * The file extension of mapping documents. - * - * @var string - */ - protected $fileExtension; - - /** - * Initializes a new FileDriver that looks in the given path(s) for mapping - * documents and operates in the specified operating mode. - * - * @param string|array $paths One or multiple paths where mapping documents can be found. - */ - public function __construct($paths, $fileExtension = null) - { - $this->addPaths((array) $paths); - $this->fileExtension = $fileExtension; - } - - /** - * Append lookup paths to metadata driver. - * - * @param array $paths - */ - public function addPaths(array $paths) - { - $this->paths = array_unique(array_merge($this->paths, $paths)); - } - - /** - * Retrieve the defined metadata lookup paths. - * - * @return array - */ - public function getPaths() - { - return $this->paths; - } - - /** - * Get the file extension used to look for mapping files under - * - * @return void - */ - public function getFileExtension() - { - return $this->fileExtension; - } - - /** - * Set the file extension used to look for mapping files under - * - * @param string $fileExtension The file extension to set - * @return void - */ - public function setFileExtension($fileExtension) - { - $this->fileExtension = $fileExtension; - } - - /** - * {@inheritDoc} - */ - public function findMappingFile($className) - { - $fileName = str_replace('\\', '.', $className) . $this->fileExtension; - - // Check whether file exists - foreach ($this->paths as $path) { - if (file_exists($path . DIRECTORY_SEPARATOR . $fileName)) { - return $path . DIRECTORY_SEPARATOR . $fileName; - } - } - - throw MappingException::mappingFileNotFound($className, $fileName); - } - - /** - * {@inheritDoc} - */ - public function getAllClassNames($globalBasename) - { - $classes = array(); - - if ($this->paths) { - foreach ($this->paths as $path) { - if ( ! is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); - } - - $iterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - - foreach ($iterator as $file) { - $fileName = $file->getBasename($this->fileExtension); - - if ($fileName == $file->getBasename() || $fileName == $globalBasename) { - continue; - } - - // NOTE: All files found here means classes are not transient! - $classes[] = str_replace('.', '\\', $fileName); - } - } - } - - return $classes; - } - - /** - * {@inheritDoc} - */ - public function fileExists($className) - { - $fileName = str_replace('\\', '.', $className) . $this->fileExtension; - - // Check whether file exists - foreach ((array) $this->paths as $path) { - if (file_exists($path . DIRECTORY_SEPARATOR . $fileName)) { - return true; - } - } - - return false; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php deleted file mode 100644 index 22cf117..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php +++ /dev/null @@ -1,178 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\MappingException; - -/** - * Base driver for file-based metadata drivers. - * - * A file driver operates in a mode where it loads the mapping files of individual - * classes on demand. This requires the user to adhere to the convention of 1 mapping - * file per class and the file names of the mapping files must correspond to the full - * class name, including namespace, with the namespace delimiters '\', replaced by dots '.'. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -abstract class FileDriver implements MappingDriver -{ - /** - * @var FileLocator - */ - protected $locator; - - /** - * @var array - */ - protected $classCache; - - /** - * @var string - */ - protected $globalBasename; - - /** - * Initializes a new FileDriver that looks in the given path(s) for mapping - * documents and operates in the specified operating mode. - * - * @param string|array|FileLocator $paths A FileLocator or one/multiple paths where mapping documents can be found. - * @param string $fileExtension - */ - public function __construct($locator, $fileExtension = null) - { - if ($locator instanceof FileLocator) { - $this->locator = $locator; - } else { - $this->locator = new DefaultFileLocator((array)$locator, $fileExtension); - } - } - - public function setGlobalBasename($file) - { - $this->globalBasename = $file; - } - - public function getGlobalBasename() - { - return $this->globalBasename; - } - - /** - * Get the element of schema meta data for the class from the mapping file. - * This will lazily load the mapping file if it is not loaded yet - * - * @return array $element The element of schema meta data - */ - public function getElement($className) - { - if ($this->classCache === null) { - $this->initialize(); - } - - if (isset($this->classCache[$className])) { - return $this->classCache[$className]; - } - - $result = $this->loadMappingFile($this->locator->findMappingFile($className)); - - return $result[$className]; - } - - /** - * Whether the class with the specified name should have its metadata loaded. - * This is only the case if it is either mapped as an Entity or a - * MappedSuperclass. - * - * @param string $className - * @return boolean - */ - public function isTransient($className) - { - if ($this->classCache === null) { - $this->initialize(); - } - - if (isset($this->classCache[$className])) { - return false; - } - - return !$this->locator->fileExists($className); - } - - /** - * Gets the names of all mapped classes known to this driver. - * - * @return array The names of all mapped classes known to this driver. - */ - public function getAllClassNames() - { - if ($this->classCache === null) { - $this->initialize(); - } - - $classNames = (array)$this->locator->getAllClassNames($this->globalBasename); - if ($this->classCache) { - $classNames = array_merge(array_keys($this->classCache), $classNames); - } - return $classNames; - } - - /** - * Loads a mapping file with the given name and returns a map - * from class/entity names to their corresponding file driver elements. - * - * @param string $file The mapping file to load. - * @return array - */ - abstract protected function loadMappingFile($file); - - /** - * Initialize the class cache from all the global files. - * - * Using this feature adds a substantial performance hit to file drivers as - * more metadata has to be loaded into memory than might actually be - * necessary. This may not be relevant to scenarios where caching of - * metadata is in place, however hits very hard in scenarios where no - * caching is used. - * - * @return void - */ - protected function initialize() - { - $this->classCache = array(); - if (null !== $this->globalBasename) { - foreach ($this->locator->getPaths() as $path) { - $file = $path.'/'.$this->globalBasename.$this->locator->getFileExtension(); - if (is_file($file)) { - $this->classCache = array_merge( - $this->classCache, - $this->loadMappingFile($file) - ); - } - } - } - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php deleted file mode 100644 index a1019d7..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php +++ /dev/null @@ -1,69 +0,0 @@ -. -*/ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -/** - * Locate the file that contains the metadata information for a given class name. - * - * This behavior is inpependent of the actual content of the file. It just detects - * the file which is responsible for the given class name. - * - * @author Benjamin Eberlei - * @author Johannes M. Schmitt - */ -interface FileLocator -{ - /** - * Locate mapping file for the given class name. - * - * @param string $className - * @return string - */ - function findMappingFile($className); - - /** - * Get all class names that are found with this file locator. - * - * @param string $globalBasename Passed to allow excluding the basename - * @return array - */ - function getAllClassNames($globalBasename); - - /** - * Check if a file can be found for this class name. - * - * @return bool - */ - function fileExists($className); - - /** - * Get all the paths that this file locator looks for mapping files. - * - * @return array - */ - function getPaths(); - - /** - * Get the file extension that mapping files are suffixed with. - * - * @return string - */ - function getFileExtension(); -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php deleted file mode 100644 index c050d32..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php +++ /dev/null @@ -1,56 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\ClassMetadata; - -/** - * Contract for metadata drivers. - * - * @since 2.2 - * @author Jonathan H. Wage - */ -interface MappingDriver -{ - /** - * Loads the metadata for the specified class into the provided container. - * - * @param string $className - * @param ClassMetadata $metadata - */ - function loadMetadataForClass($className, ClassMetadata $metadata); - - /** - * Gets the names of all mapped classes known to this driver. - * - * @return array The names of all mapped classes known to this driver. - */ - function getAllClassNames(); - - /** - * Whether the class with the specified name should have its metadata loaded. - * This is only the case if it is either mapped as an Entity or a - * MappedSuperclass. - * - * @param string $className - * @return boolean - */ - function isTransient($className); -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php deleted file mode 100644 index c7c1452..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php +++ /dev/null @@ -1,125 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver, - Doctrine\Common\Persistence\Mapping\ClassMetadata, - Doctrine\Common\Persistence\Mapping\MappingException; - -/** - * The DriverChain allows you to add multiple other mapping drivers for - * certain namespaces - * - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -class MappingDriverChain implements MappingDriver -{ - /** - * @var array - */ - private $drivers = array(); - - /** - * Add a nested driver. - * - * @param Driver $nestedDriver - * @param string $namespace - */ - public function addDriver(MappingDriver $nestedDriver, $namespace) - { - $this->drivers[$namespace] = $nestedDriver; - } - - /** - * Get the array of nested drivers. - * - * @return array $drivers - */ - public function getDrivers() - { - return $this->drivers; - } - - /** - * Loads the metadata for the specified class into the provided container. - * - * @param string $className - * @param ClassMetadataInfo $metadata - */ - public function loadMetadataForClass($className, ClassMetadata $metadata) - { - foreach ($this->drivers as $namespace => $driver) { - if (strpos($className, $namespace) === 0) { - $driver->loadMetadataForClass($className, $metadata); - return; - } - } - - throw MappingException::classNotFoundInNamespaces($className, array_keys($this->drivers)); - } - - /** - * Gets the names of all mapped classes known to this driver. - * - * @return array The names of all mapped classes known to this driver. - */ - public function getAllClassNames() - { - $classNames = array(); - $driverClasses = array(); - foreach ($this->drivers AS $namespace => $driver) { - $oid = spl_object_hash($driver); - if (!isset($driverClasses[$oid])) { - $driverClasses[$oid] = $driver->getAllClassNames(); - } - - foreach ($driverClasses[$oid] AS $className) { - if (strpos($className, $namespace) === 0) { - $classNames[$className] = true; - } - } - } - return array_keys($classNames); - } - - /** - * Whether the class with the specified name should have its metadata loaded. - * - * This is only the case for non-transient classes either mapped as an Entity or MappedSuperclass. - * - * @param string $className - * @return boolean - */ - public function isTransient($className) - { - foreach ($this->drivers AS $namespace => $driver) { - if (strpos($className, $namespace) === 0) { - return $driver->isTransient($className); - } - } - - // class isTransient, i.e. not an entity or mapped superclass - return true; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php deleted file mode 100644 index 7751dae..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php +++ /dev/null @@ -1,70 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\ClassMetadata; - -/** - * The PHPDriver includes php files which just populate ClassMetadataInfo - * instances with plain php code - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -class PHPDriver extends FileDriver -{ - /** - * {@inheritdoc} - */ - protected $metadata; - - /** - * {@inheritDoc} - */ - public function __construct($locator, $fileExtension = null) - { - $fileExtension = ".php"; - parent::__construct($locator, $fileExtension); - } - - /** - * {@inheritdoc} - */ - public function loadMetadataForClass($className, ClassMetadata $metadata) - { - $this->metadata = $metadata; - $this->loadMappingFile($this->locator->findMappingFile($className)); - } - - /** - * {@inheritdoc} - */ - protected function loadMappingFile($file) - { - $metadata = $this->metadata; - include $file; - } -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php deleted file mode 100644 index 9103ed8..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php +++ /dev/null @@ -1,131 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\ClassMetadata; -use Doctrine\Common\Persistence\Mapping\MappingException; - -/** - * The StaticPHPDriver calls a static loadMetadata() method on your entity - * classes where you can manually populate the ClassMetadata instance. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -class StaticPHPDriver implements MappingDriver -{ - /** - * Paths of entity directories. - * - * @var array - */ - private $paths = array(); - - /** - * Map of all class names. - * - * @var array - */ - private $classNames; - - public function __construct($paths) - { - $this->addPaths((array) $paths); - } - - public function addPaths(array $paths) - { - $this->paths = array_unique(array_merge($this->paths, $paths)); - } - - /** - * {@inheritdoc} - */ - public function loadMetadataForClass($className, ClassMetadata $metadata) - { - $className::loadMetadata($metadata); - } - - /** - * {@inheritDoc} - * @todo Same code exists in AnnotationDriver, should we re-use it somehow or not worry about it? - */ - public function getAllClassNames() - { - if ($this->classNames !== null) { - return $this->classNames; - } - - if (!$this->paths) { - throw MappingException::pathRequired(); - } - - $classes = array(); - $includedFiles = array(); - - foreach ($this->paths as $path) { - if (!is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); - } - - $iterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - - foreach ($iterator as $file) { - if ($file->getBasename('.php') == $file->getBasename()) { - continue; - } - - $sourceFile = realpath($file->getPathName()); - require_once $sourceFile; - $includedFiles[] = $sourceFile; - } - } - - $declared = get_declared_classes(); - - foreach ($declared as $className) { - $rc = new \ReflectionClass($className); - $sourceFile = $rc->getFileName(); - if (in_array($sourceFile, $includedFiles) && !$this->isTransient($className)) { - $classes[] = $className; - } - } - - $this->classNames = $classes; - - return $classes; - } - - /** - * {@inheritdoc} - */ - public function isTransient($className) - { - return ! method_exists($className, 'loadMetadata'); - } -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php deleted file mode 100644 index d338cf6..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php +++ /dev/null @@ -1,198 +0,0 @@ -. -*/ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\MappingException; - -/** - * The Symfony File Locator makes a simplifying assumptions compared - * to the DefaultFileLocator. By assuming paths only contain entities of a certain - * namespace the mapping files consists of the short classname only. - * - * @author Fabien Potencier - * @author Benjamin Eberlei - * @license MIT - */ -class SymfonyFileLocator implements FileLocator -{ - /** - * The paths where to look for mapping files. - * - * @var array - */ - protected $paths = array(); - - /** - * A map of mapping directory path to namespace prefix used to expand class shortnames. - * - * @var array - */ - protected $prefixes = array(); - - /** - * File extension that is searched for. - * - * @var string - */ - protected $fileExtension; - - public function __construct(array $prefixes, $fileExtension = null) - { - $this->addNamespacePrefixes($prefixes); - $this->fileExtension = $fileExtension; - } - - public function addNamespacePrefixes(array $prefixes) - { - $this->prefixes = array_merge($this->prefixes, $prefixes); - $this->paths = array_merge($this->paths, array_keys($prefixes)); - } - - public function getNamespacePrefixes() - { - return $this->prefixes; - } - - /** - * {@inheritDoc} - */ - public function getPaths() - { - return $this->paths; - } - - /** - * {@inheritDoc} - */ - public function getFileExtension() - { - return $this->fileExtension; - } - - /** - * Set the file extension used to look for mapping files under - * - * @param string $fileExtension The file extension to set - * @return void - */ - public function setFileExtension($fileExtension) - { - $this->fileExtension = $fileExtension; - } - - /** - * {@inheritDoc} - */ - public function fileExists($className) - { - $defaultFileName = str_replace('\\', '.', $className).$this->fileExtension; - foreach ($this->paths as $path) { - if (!isset($this->prefixes[$path])) { - // global namespace class - if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) { - return true; - } - - continue; - } - - $prefix = $this->prefixes[$path]; - - if (0 !== strpos($className, $prefix.'\\')) { - continue; - } - - $filename = $path.'/'.strtr(substr($className, strlen($prefix)+1), '\\', '.').$this->fileExtension; - return is_file($filename); - } - - return false; - } - - /** - * {@inheritDoc} - */ - public function getAllClassNames($globalBasename = null) - { - $classes = array(); - - if ($this->paths) { - foreach ((array) $this->paths as $path) { - if (!is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); - } - - $iterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - - foreach ($iterator as $file) { - $fileName = $file->getBasename($this->fileExtension); - - if ($fileName == $file->getBasename() || $fileName == $globalBasename) { - continue; - } - - // NOTE: All files found here means classes are not transient! - if (isset($this->prefixes[$path])) { - $classes[] = $this->prefixes[$path].'\\'.str_replace('.', '\\', $fileName); - } else { - $classes[] = str_replace('.', '\\', $fileName); - } - } - } - } - - return $classes; - } - - /** - * {@inheritDoc} - */ - public function findMappingFile($className) - { - $defaultFileName = str_replace('\\', '.', $className).$this->fileExtension; - foreach ($this->paths as $path) { - if (!isset($this->prefixes[$path])) { - if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) { - return $path.DIRECTORY_SEPARATOR.$defaultFileName; - } - - continue; - } - - $prefix = $this->prefixes[$path]; - - if (0 !== strpos($className, $prefix.'\\')) { - continue; - } - - $filename = $path.'/'.strtr(substr($className, strlen($prefix)+1), '\\', '.').$this->fileExtension; - if (is_file($filename)) { - return $filename; - } - - throw MappingException::mappingFileNotFound($className, $filename); - } - - throw MappingException::mappingFileNotFound($className, substr($className, strrpos($className, '\\') + 1).$this->fileExtension); - } -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php deleted file mode 100644 index 4ecd2ad..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php +++ /dev/null @@ -1,57 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -/** - * A MappingException indicates that something is wrong with the mapping setup. - * - * @since 2.2 - */ -class MappingException extends \Exception -{ - public static function classNotFoundInNamespaces($className, $namespaces) - { - return new self("The class '" . $className . "' was not found in the ". - "chain configured namespaces " . implode(", ", $namespaces)); - } - - public static function pathRequired() - { - return new self("Specifying the paths to your entities is required ". - "in the AnnotationDriver to retrieve all class names."); - } - - public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null) - { - if ( ! empty($path)) { - $path = '[' . $path . ']'; - } - - return new self( - 'File mapping drivers must have a valid directory path, ' . - 'however the given path ' . $path . ' seems to be incorrect!' - ); - } - - public static function mappingFileNotFound($entityName, $fileName) - { - return new self("No mapping file found named '$fileName' for class '$entityName'."); - } -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php deleted file mode 100644 index 4e0e312..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php +++ /dev/null @@ -1,80 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -/** - * Very simple reflection service abstraction. - * - * This is required inside metadata layers that may require either - * static or runtime reflection. - * - * @author Benjamin Eberlei - */ -interface ReflectionService -{ - /** - * Return an array of the parent classes (not interfaces) for the given class. - * - * @param string $class - * @return array - */ - function getParentClasses($class); - - /** - * Return the shortname of a class. - * - * @param string $class - * @return string - */ - function getClassShortName($class); - - /** - * @param string $class - * @return string - */ - function getClassNamespace($class); - - /** - * Return a reflection class instance or null - * - * @param string $class - * @return ReflectionClass|null - */ - function getClass($class); - - /** - * Return an accessible property (setAccessible(true)) or null. - * - * @param string $class - * @param string $property - * @return ReflectionProperty|null - */ - function getAccessibleProperty($class, $property); - - /** - * Check if the class have a public method with the given name. - * - * @param mixed $class - * @param mixed $method - * @return bool - */ - function hasPublicMethod($class, $method); -} - diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php deleted file mode 100644 index abcff58..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php +++ /dev/null @@ -1,102 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -use ReflectionClass; -use ReflectionProperty; - -/** - * PHP Runtime Reflection Service - * - * @author Benjamin Eberlei - */ -class RuntimeReflectionService implements ReflectionService -{ - /** - * Return an array of the parent classes (not interfaces) for the given class. - * - * @param string $class - * @return array - */ - public function getParentClasses($class) - { - return class_parents($class); - } - - /** - * Return the shortname of a class. - * - * @param string $class - * @return string - */ - public function getClassShortName($class) - { - $r = new ReflectionClass($class); - return $r->getShortName(); - } - - /** - * @param string $class - * @return string - */ - public function getClassNamespace($class) - { - $r = new ReflectionClass($class); - return $r->getNamespaceName(); - } - - /** - * Return a reflection class instance or null - * - * @param string $class - * @return ReflectionClass|null - */ - public function getClass($class) - { - return new ReflectionClass($class); - } - - /** - * Return an accessible property (setAccessible(true)) or null. - * - * @param string $class - * @param string $property - * @return ReflectionProperty|null - */ - public function getAccessibleProperty($class, $property) - { - $property = new ReflectionProperty($class, $property); - $property->setAccessible(true); - return $property; - } - - /** - * Check if the class have a public method with the given name. - * - * @param mixed $class - * @param mixed $method - * @return bool - */ - public function hasPublicMethod($class, $method) - { - return method_exists($class, $method) && is_callable(array($class, $method)); - } -} - diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php deleted file mode 100644 index 2de6e76..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php +++ /dev/null @@ -1,107 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -use ReflectionClass; -use ReflectionProperty; - -/** - * PHP Runtime Reflection Service - * - * @author Benjamin Eberlei - */ -class StaticReflectionService implements ReflectionService -{ - /** - * Return an array of the parent classes (not interfaces) for the given class. - * - * @param string $class - * @return array - */ - public function getParentClasses($class) - { - return array(); - } - - /** - * Return the shortname of a class. - * - * @param string $className - * @return string - */ - public function getClassShortName($className) - { - if (strpos($className, '\\') !== false) { - $className = substr($className, strrpos($className, "\\")+1); - } - return $className; - } - - /** - * Return the namespace of a class. - * - * @param string $className - * @return string - */ - public function getClassNamespace($className) - { - $namespace = ''; - if (strpos($className, '\\') !== false) { - $namespace = strrev(substr( strrev($className), strpos(strrev($className), '\\')+1 )); - } - return $namespace; - } - - /** - * Return a reflection class instance or null - * - * @param string $class - * @return ReflectionClass|null - */ - public function getClass($class) - { - return null; - } - - /** - * Return an accessible property (setAccessible(true)) or null. - * - * @param string $class - * @param string $property - * @return ReflectionProperty|null - */ - public function getAccessibleProperty($class, $property) - { - return null; - } - - /** - * Check if the class have a public method with the given name. - * - * @param mixed $class - * @param mixed $method - * @return bool - */ - public function hasPublicMethod($class, $method) - { - return method_exists($class, $method) && is_callable(array($class, $method)); - } -} - diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php deleted file mode 100644 index 6d70fc1..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php +++ /dev/null @@ -1,143 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -/** - * Contract for a Doctrine persistence layer ObjectManager class to implement. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.1 - * @author Benjamin Eberlei - * @author Jonathan Wage - */ -interface ObjectManager -{ - /** - * Finds a object by its identifier. - * - * This is just a convenient shortcut for getRepository($className)->find($id). - * - * @param string - * @param mixed - * @return object - */ - function find($className, $id); - - /** - * Tells the ObjectManager to make an instance managed and persistent. - * - * The object will be entered into the database as a result of the flush operation. - * - * NOTE: The persist operation always considers objects that are not yet known to - * this ObjectManager as NEW. Do not pass detached objects to the persist operation. - * - * @param object $object The instance to make managed and persistent. - */ - function persist($object); - - /** - * Removes an object instance. - * - * A removed object will be removed from the database as a result of the flush operation. - * - * @param object $object The object instance to remove. - */ - function remove($object); - - /** - * Merges the state of a detached object into the persistence context - * of this ObjectManager and returns the managed copy of the object. - * The object passed to merge will not become associated/managed with this ObjectManager. - * - * @param object $object - */ - function merge($object); - - /** - * Detaches an object from the ObjectManager, causing a managed object to - * become detached. Unflushed changes made to the object if any - * (including removal of the object), will not be synchronized to the database. - * Objects which previously referenced the detached object will continue to - * reference it. - * - * @param object $object The object to detach. - */ - function detach($object); - - /** - * Refreshes the persistent state of an object from the database, - * overriding any local changes that have not yet been persisted. - * - * @param object $object The object to refresh. - */ - function refresh($object); - - /** - * Flushes all changes to objects that have been queued up to now to the database. - * This effectively synchronizes the in-memory state of managed objects with the - * database. - */ - function flush(); - - /** - * Gets the repository for a class. - * - * @param string $className - * @return \Doctrine\Common\Persistence\ObjectRepository - */ - function getRepository($className); - - /** - * Returns the ClassMetadata descriptor for a class. - * - * The class name must be the fully-qualified class name without a leading backslash - * (as it is returned by get_class($obj)). - * - * @param string $className - * @return \Doctrine\Common\Persistence\Mapping\ClassMetadata - */ - function getClassMetadata($className); - - /** - * Gets the metadata factory used to gather the metadata of classes. - * - * @return Doctrine\Common\Persistence\Mapping\ClassMetadataFactory - */ - function getMetadataFactory(); - - /** - * Helper method to initialize a lazy loading proxy or persistent collection. - * - * This method is a no-op for other objects. - * - * @param object $obj - */ - function initializeObject($obj); - - /** - * Check if the object is part of the current UnitOfWork and therefore - * managed. - * - * @param object $object - * @return bool - */ - function contains($object); -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerAware.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerAware.php deleted file mode 100644 index 015dd3d..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerAware.php +++ /dev/null @@ -1,49 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -use Doctrine\Common\Persistence\Mapping\ClassMetadata; - -/** - * Makes a Persistent Objects aware of its own object-manager. - * - * Using this interface the managing object manager and class metadata instances - * are injected into the persistent object after construction. This allows - * you to implement ActiveRecord functionality on top of the persistance-ignorance - * that Doctrine propagates. - * - * Word of Warning: This is a very powerful hook to change how you can work with your domain models. - * Using this hook will break the Single Responsibility Principle inside your Domain Objects - * and increase the coupling of database and objects. - * - * Every ObjectManager has to implement this functionality itself. - * - * @author Benjamin Eberlei - */ -interface ObjectManagerAware -{ - /** - * Injects responsible ObjectManager and the ClassMetadata into this persistent object. - * - * @param ObjectManager $objectManager - * @param ClassMetadata $classMetadata - */ - public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata); -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php deleted file mode 100644 index 2263328..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php +++ /dev/null @@ -1,78 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -/** - * Contract for a Doctrine persistence layer ObjectRepository class to implement. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.1 - * @author Benjamin Eberlei - * @author Jonathan Wage - */ -interface ObjectRepository -{ - /** - * Finds an object by its primary key / identifier. - * - * @param $id The identifier. - * @return object The object. - */ - function find($id); - - /** - * Finds all objects in the repository. - * - * @return mixed The objects. - */ - function findAll(); - - /** - * Finds objects by a set of criteria. - * - * Optionally sorting and limiting details can be passed. An implementation may throw - * an UnexpectedValueException if certain values of the sorting or limiting details are - * not supported. - * - * @throws UnexpectedValueException - * @param array $criteria - * @param array|null $orderBy - * @param int|null $limit - * @param int|null $offset - * @return mixed The objects. - */ - function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null); - - /** - * Finds a single object by a set of criteria. - * - * @param array $criteria - * @return object The object. - */ - function findOneBy(array $criteria); - - /** - * Returns the class name of the object managed by the repository - * - * @return string - */ - function getClassName(); -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php deleted file mode 100644 index 4274af6..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php +++ /dev/null @@ -1,233 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -use Doctrine\Common\Persistence\Mapping\ClassMetadata; -use Doctrine\Common\Collections\ArrayCollection; -use Doctrine\Common\Collections\Collection; - -/** - * PersistentObject base class that implements getter/setter methods for all mapped fields and associations - * by overriding __call. - * - * This class is a forward compatible implementation of the PersistentObject trait. - * - * - * Limitations: - * - * 1. All persistent objects have to be associated with a single ObjectManager, multiple - * ObjectManagers are not supported. You can set the ObjectManager with `PersistentObject#setObjectManager()`. - * 2. Setters and getters only work if a ClassMetadata instance was injected into the PersistentObject. - * This is either done on `postLoad` of an object or by accessing the global object manager. - * 3. There are no hooks for setters/getters. Just implement the method yourself instead of relying on __call(). - * 4. Slower than handcoded implementations: An average of 7 method calls per access to a field and 11 for an association. - * 5. Only the inverse side associations get autoset on the owning side aswell. Setting objects on the owning side - * will not set the inverse side associations. - * - * @example - * - * PersistentObject::setObjectManager($em); - * - * class Foo extends PersistentObject - * { - * private $id; - * } - * - * $foo = new Foo(); - * $foo->getId(); // method exists through __call - * - * @author Benjamin Eberlei - */ -abstract class PersistentObject implements ObjectManagerAware -{ - /** - * @var ObjectManager - */ - private static $objectManager; - - /** - * @var ClassMetadata - */ - private $cm; - - /** - * Set the object manager responsible for all persistent object base classes. - * - * @param ObjectManager $objectManager - */ - static public function setObjectManager(ObjectManager $objectManager = null) - { - self::$objectManager = $objectManager; - } - - /** - * @return ObjectManager - */ - static public function getObjectManager() - { - return self::$objectManager; - } - - /** - * Inject Doctrine Object Manager - * - * @param ObjectManager $objectManager - * @param ClassMetadata $classMetadata - */ - public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata) - { - if ($objectManager !== self::$objectManager) { - throw new \RuntimeException("Trying to use PersistentObject with different ObjectManager instances. " . - "Was PersistentObject::setObjectManager() called?"); - } - - $this->cm = $classMetadata; - } - - /** - * Sets a persistent fields value. - * - * @throws InvalidArgumentException - When the wrong target object type is passed to an association - * @throws BadMethodCallException - When no persistent field exists by that name. - * @param string $field - * @param array $args - * @return void - */ - private function set($field, $args) - { - $this->initializeDoctrine(); - - if ($this->cm->hasField($field) && !$this->cm->isIdentifier($field)) { - $this->$field = $args[0]; - } else if ($this->cm->hasAssociation($field) && $this->cm->isSingleValuedAssociation($field)) { - $targetClass = $this->cm->getAssociationTargetClass($field); - if (!($args[0] instanceof $targetClass) && $args[0] !== null) { - throw new \InvalidArgumentException("Expected persistent object of type '".$targetClass."'"); - } - $this->$field = $args[0]; - $this->completeOwningSide($field, $targetClass, $args[0]); - } else { - throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getName()."'"); - } - } - - /** - * Get persistent field value. - * - * @throws BadMethodCallException - When no persistent field exists by that name. - * @param string $field - * @return mixed - */ - private function get($field) - { - $this->initializeDoctrine(); - - if ( $this->cm->hasField($field) || $this->cm->hasAssociation($field) ) { - return $this->$field; - } else { - throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getName()."'"); - } - } - - /** - * If this is an inverse side association complete the owning side. - * - * @param string $field - * @param ClassMetadata $targetClass - * @param object $targetObject - */ - private function completeOwningSide($field, $targetClass, $targetObject) - { - // add this object on the owning side aswell, for obvious infinite recursion - // reasons this is only done when called on the inverse side. - if ($this->cm->isAssociationInverseSide($field)) { - $mappedByField = $this->cm->getAssociationMappedByTargetField($field); - $targetMetadata = self::$objectManager->getClassMetadata($targetClass); - - $setter = ($targetMetadata->isCollectionValuedAssociation($mappedByField) ? "add" : "set").$mappedByField; - $targetObject->$setter($this); - } - } - - /** - * Add an object to a collection - * - * @param type $field - * @param assoc $args - */ - private function add($field, $args) - { - $this->initializeDoctrine(); - - if ($this->cm->hasAssociation($field) && $this->cm->isCollectionValuedAssociation($field)) { - $targetClass = $this->cm->getAssociationTargetClass($field); - if (!($args[0] instanceof $targetClass)) { - throw new \InvalidArgumentException("Expected persistent object of type '".$targetClass."'"); - } - if (!($this->$field instanceof Collection)) { - $this->$field = new ArrayCollection($this->$field ?: array()); - } - $this->$field->add($args[0]); - $this->completeOwningSide($field, $targetClass, $args[0]); - } else { - throw new \BadMethodCallException("There is no method add".$field."() on ".$this->cm->getName()); - } - } - - /** - * Initialize Doctrine Metadata for this class. - * - * @return void - */ - private function initializeDoctrine() - { - if ($this->cm !== null) { - return; - } - - if (!self::$objectManager) { - throw new \RuntimeException("No runtime object manager set. Call PersistentObject#setObjectManager()."); - } - - $this->cm = self::$objectManager->getClassMetadata(get_class($this)); - } - - /** - * Magic method that implements - * - * @param string $method - * @param array $args - * @return mixed - */ - public function __call($method, $args) - { - $command = substr($method, 0, 3); - $field = lcfirst(substr($method, 3)); - if ($command == "set") { - $this->set($field, $args); - } else if ($command == "get") { - return $this->get($field); - } else if ($command == "add") { - $this->add($field, $args); - } else { - throw new \BadMethodCallException("There is no method ".$method." on ".$this->cm->getName()); - } - } -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Proxy.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Proxy.php deleted file mode 100644 index 726979f..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Proxy.php +++ /dev/null @@ -1,60 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -/** - * Interface for proxy classes. - * - * @author Roman Borschel - * @since 2.2 - */ -interface Proxy -{ - /** - * Marker for Proxy class names. - * - * @var string - */ - const MARKER = '__CG__'; - - /** - * Length of the proxy marker - * - * @var int - */ - const MARKER_LENGTH = 6; - - /** - * Initialize this proxy if its not yet initialized. - * - * Acts as a no-op if already initialized. - * - * @return void - */ - public function __load(); - - /** - * Is this proxy initialized or not. - * - * @return bool - */ - public function __isInitialized(); -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/PropertyChangedListener.php b/vendor/doctrine/common/lib/Doctrine/Common/PropertyChangedListener.php deleted file mode 100644 index 87c5b41..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/PropertyChangedListener.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * Contract for classes that are potential listeners of a NotifyPropertyChanged - * implementor. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -interface PropertyChangedListener -{ - /** - * Notifies the listener of a property change. - * - * @param object $sender The object on which the property changed. - * @param string $propertyName The name of the property that changed. - * @param mixed $oldValue The old value of the property that changed. - * @param mixed $newValue The new value of the property that changed. - */ - function propertyChanged($sender, $propertyName, $oldValue, $newValue); -} - diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php b/vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php deleted file mode 100644 index c346278..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php +++ /dev/null @@ -1,103 +0,0 @@ -. - */ - -namespace Doctrine\Common\Util; - -use Doctrine\Common\Persistence\Proxy; - -/** - * Class and reflection related functionality for objects that - * might or not be proxy objects at the moment. - * - * @author Benjamin Eberlei - * @author Johannes Schmitt - */ -class ClassUtils -{ - /** - * Get the real class name of a class name that could be a proxy. - * - * @param string - * @return string - */ - public static function getRealClass($class) - { - if (false === $pos = strrpos($class, '\\'.Proxy::MARKER.'\\')) { - return $class; - } - - return substr($class, $pos + Proxy::MARKER_LENGTH + 2); - } - - /** - * Get the real class name of an object (even if its a proxy) - * - * @param object - * @return string - */ - public static function getClass($object) - { - return self::getRealClass(get_class($object)); - } - - /** - * Get the real parent class name of a class or object - * - * @param string - * @return string - */ - public static function getParentClass($className) - { - return get_parent_class( self::getRealClass( $className ) ); - } - - /** - * Create a new reflection class - * - * @param string - * @return ReflectionClass - */ - public static function newReflectionClass($class) - { - return new \ReflectionClass( self::getRealClass( $class ) ); - } - - /** - * Create a new reflection object - * - * @param object - * @return ReflectionObject - */ - public static function newReflectionObject($object) - { - return self::newReflectionClass( self::getClass( $object ) ); - } - - /** - * Given a class name and a proxy namespace return the proxy name. - * - * @param string $className - * @param string $proxyNamespace - * @return string - */ - public static function generateProxyClassName($className, $proxyNamespace) - { - return rtrim($proxyNamespace, '\\') . '\\'.Proxy::MARKER.'\\' . ltrim($className, '\\'); - } -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php b/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php deleted file mode 100644 index 57ae312..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php +++ /dev/null @@ -1,123 +0,0 @@ -. - */ - -namespace Doctrine\Common\Util; - -/** - * Static class containing most used debug methods. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Giorgio Sironi - */ -final class Debug -{ - /** - * Private constructor (prevents from instantiation) - * - */ - private function __construct() {} - - /** - * Prints a dump of the public, protected and private properties of $var. - * - * @static - * @link http://xdebug.org/ - * @param mixed $var - * @param integer $maxDepth Maximum nesting level for object properties - * @param boolean $stripTags Flag that indicate if output should strip HTML tags - */ - public static function dump($var, $maxDepth = 2, $stripTags = true) - { - ini_set('html_errors', 'On'); - - if (extension_loaded('xdebug')) { - ini_set('xdebug.var_display_max_depth', $maxDepth); - } - - $var = self::export($var, $maxDepth++); - - ob_start(); - var_dump($var); - $dump = ob_get_contents(); - ob_end_clean(); - - echo ($stripTags ? strip_tags(html_entity_decode($dump)) : $dump); - - ini_set('html_errors', 'Off'); - } - - public static function export($var, $maxDepth) - { - $return = null; - $isObj = is_object($var); - - if ($isObj && in_array('Doctrine\Common\Collections\Collection', class_implements($var))) { - $var = $var->toArray(); - } - - if ($maxDepth) { - if (is_array($var)) { - $return = array(); - - foreach ($var as $k => $v) { - $return[$k] = self::export($v, $maxDepth - 1); - } - } else if ($isObj) { - $return = new \stdclass(); - if ($var instanceof \DateTime) { - $return->__CLASS__ = "DateTime"; - $return->date = $var->format('c'); - $return->timezone = $var->getTimeZone()->getName(); - } else { - $reflClass = ClassUtils::newReflectionObject($var); - $return->__CLASS__ = ClassUtils::getClass($var); - - if ($var instanceof \Doctrine\Common\Persistence\Proxy) { - $return->__IS_PROXY__ = true; - $return->__PROXY_INITIALIZED__ = $var->__isInitialized(); - } - - foreach ($reflClass->getProperties() as $reflProperty) { - $name = $reflProperty->getName(); - - $reflProperty->setAccessible(true); - $return->$name = self::export($reflProperty->getValue($var), $maxDepth - 1); - } - } - } else { - $return = $var; - } - } else { - $return = is_object($var) ? get_class($var) - : (is_array($var) ? 'Array(' . count($var) . ')' : $var); - } - - return $return; - } - - public static function toString($obj) - { - return method_exists('__toString', $obj) ? (string) $obj : get_class($obj) . '@' . spl_object_hash($obj); - } -} diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Util/Inflector.php b/vendor/doctrine/common/lib/Doctrine/Common/Util/Inflector.php deleted file mode 100644 index ba1eb17..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Util/Inflector.php +++ /dev/null @@ -1,72 +0,0 @@ -. - */ - -namespace Doctrine\Common\Util; - -/** - * Doctrine inflector has static methods for inflecting text - * - * The methods in these classes are from several different sources collected - * across several different php projects and several different authors. The - * original author names and emails are not known - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 1.0 - * @version $Revision: 3189 $ - * @author Konsta Vesterinen - * @author Jonathan H. Wage - */ -class Inflector -{ - /** - * Convert word in to the format for a Doctrine table name. Converts 'ModelName' to 'model_name' - * - * @param string $word Word to tableize - * @return string $word Tableized word - */ - public static function tableize($word) - { - return strtolower(preg_replace('~(?<=\\w)([A-Z])~', '_$1', $word)); - } - - /** - * Convert a word in to the format for a Doctrine class name. Converts 'table_name' to 'TableName' - * - * @param string $word Word to classify - * @return string $word Classified word - */ - public static function classify($word) - { - return str_replace(" ", "", ucwords(strtr($word, "_-", " "))); - } - - /** - * Camelize a word. This uses the classify() method and turns the first character to lowercase - * - * @param string $word - * @return string $word - */ - public static function camelize($word) - { - return lcfirst(self::classify($word)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Version.php b/vendor/doctrine/common/lib/Doctrine/Common/Version.php deleted file mode 100644 index b7c9a82..0000000 --- a/vendor/doctrine/common/lib/Doctrine/Common/Version.php +++ /dev/null @@ -1,55 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * Class to store and retrieve the version of Doctrine - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class Version -{ - /** - * Current Doctrine Version - */ - const VERSION = '2.2.2'; - - /** - * Compares a Doctrine version with the current one. - * - * @param string $version Doctrine version to compare. - * @return int Returns -1 if older, 0 if it is the same, 1 if version - * passed as argument is newer. - */ - public static function compare($version) - { - $currentVersion = str_replace(' ', '', strtolower(self::VERSION)); - $version = str_replace(' ', '', $version); - - return version_compare($version, $currentVersion); - } -} diff --git a/vendor/doctrine/common/phpunit.xml.dist b/vendor/doctrine/common/phpunit.xml.dist deleted file mode 100644 index b9d3b34..0000000 --- a/vendor/doctrine/common/phpunit.xml.dist +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - ./tests/Doctrine/ - - - - - - ./lib/Doctrine/ - - - - - - performance - - - diff --git a/vendor/doctrine/dbal/.gitignore b/vendor/doctrine/dbal/.gitignore deleted file mode 100644 index a9b57aa..0000000 --- a/vendor/doctrine/dbal/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -build/ -logs/ -reports/ -dist/ -download/ -lib/Doctrine/Common/ diff --git a/vendor/doctrine/dbal/.gitmodules b/vendor/doctrine/dbal/.gitmodules deleted file mode 100644 index 00dc3fa..0000000 --- a/vendor/doctrine/dbal/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -[submodule "lib/vendor/doctrine-common"] - path = lib/vendor/doctrine-common - url = git://github.com/doctrine/common.git -[submodule "lib/vendor/Symfony/Component/Console"] - path = lib/vendor/Symfony/Component/Console - url = git://github.com/symfony/Console.git -[submodule "lib/vendor/doctrine-build-common"] - path = lib/vendor/doctrine-build-common - url = git://github.com/doctrine/doctrine-build-common.git diff --git a/vendor/doctrine/dbal/.travis.yml b/vendor/doctrine/dbal/.travis.yml deleted file mode 100644 index ab6fde0..0000000 --- a/vendor/doctrine/dbal/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: php - -php: - - 5.3 - - 5.4 -env: - - DB=mysql - - DB=pgsql - - DB=sqlite - -before_script: - - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS doctrine_tests;' -U postgres; fi" - - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS doctrine_tests_tmp;' -U postgres; fi" - - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'create database doctrine_tests;' -U postgres; fi" - - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'create database doctrine_tests_tmp;' -U postgres; fi" - - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS doctrine_tests_tmp;create database IF NOT EXISTS doctrine_tests;'; fi" - - git submodule update --init - -script: phpunit --configuration tests/travis/$DB.travis.xml - diff --git a/vendor/doctrine/dbal/LICENSE b/vendor/doctrine/dbal/LICENSE deleted file mode 100644 index 1c03f74..0000000 --- a/vendor/doctrine/dbal/LICENSE +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/vendor/doctrine/dbal/README.md b/vendor/doctrine/dbal/README.md deleted file mode 100644 index 70617c3..0000000 --- a/vendor/doctrine/dbal/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Doctrine DBAL - -Powerful database abstraction layer with many features for database schema introspection, schema management and PDO abstraction. - -* Master: [![Build Status](https://secure.travis-ci.org/doctrine/dbal.png?branch=master)](http://travis-ci.org/doctrine/dbal) -* Master: [![Build Status](https://secure.travis-ci.org/doctrine/dbal.png?branch=2.2)](http://travis-ci.org/doctrine/dbal) -* 2.1.x: [![Build Status](https://secure.travis-ci.org/doctrine/dbal.png?branch=2.1.x)](http://travis-ci.org/doctrine/dbal) - -## More resources: - -* [Website](http://www.doctrine-project.org) -* [Documentation](http://www.doctrine-project.org/projects/dbal/current/docs/en) -* [Issue Tracker](http://www.doctrine-project.org/jira/browse/DBAL) -* [Downloads](http://github.com/doctrine/dbal/downloads) diff --git a/vendor/doctrine/dbal/UPGRADE b/vendor/doctrine/dbal/UPGRADE deleted file mode 100644 index 9466d7a..0000000 --- a/vendor/doctrine/dbal/UPGRADE +++ /dev/null @@ -1,72 +0,0 @@ -# Upgrade to 2.2 - -## Doctrine\DBAL\Connection#insert and Doctrine\DBAL\Connnection#update - -Both methods now accept an optional last parameter $types with binding types of the values passed. -This can potentially break child classes that have overwritten one of these methods. - -## Doctrine\DBAL\Connection#executeQuery - -Doctrine\DBAL\Connection#executeQuery() got a new last parameter "QueryCacheProfile $qcp" - -## Doctrine\DBAL\Driver\Statement split - -The Driver statement was split into a ResultStatement and the normal statement extending from it. -This seperates the configuration and the retrieval API from a statement. - -## MsSql Platform/SchemaManager renamed - -The MsSqlPlatform was renamed to SQLServerPlatform, the MsSqlSchemaManager was renamed -to SQLServerSchemaManager. - -## Cleanup SQLServer Platform version mess - -DBAL 2.1 and before were actually only compatible to SQL Server 2008, not earlier versions. -Still other parts of the platform did use old features instead of newly introduced datatypes -in SQL Server 2005. Starting with DBAL 2.2 you can pick the Doctrine abstraction exactly -matching your SQL Server version. - -The PDO SqlSrv driver now uses the new `SQLServer2008Platform` as default platform. -This platform uses new features of SQL Server as of version 2008. This also includes a switch -in the used fields for "text" and "blob" field types to: - - "text" => "VARCHAR(MAX)" - "blob" => "VARBINARY(MAX)" - -Additionally `SQLServerPlatform` in DBAL 2.1 and before used "DATE", "TIME" and "DATETIME2" for dates. -This types are only available since version 2008 and the introduction of an explicit -SQLServer 2008 platform makes this dependency explicit. - -An `SQLServer2005Platform` was also introduced to differentiate the features between -versions 2003, earlier and 2005. - -With this change the `SQLServerPlatform` now throws an exception for using limit queries -with an offset, since SQLServer 2003 and lower do not support this feature. - -To use the old SQL Server Platform, because you are using SQL Server 2003 and below use -the following configuration code: - - use Doctrine\DBAL\DriverManager; - use Doctrine\DBAL\Platforms\SQLServerPlatform; - use Doctrine\DBAL\Platforms\SQLServer2005Platform; - - // You are using SQL Server 2003 or earlier - $conn = DriverManager::getConnection(array( - 'driver' => 'pdo_sqlsrv', - 'platform' => new SQLServerPlatform() - // .. additional parameters - )); - - // You are using SQL Server 2005 - $conn = DriverManager::getConnection(array( - 'driver' => 'pdo_sqlsrv', - 'platform' => new SQLServer2005Platform() - // .. additional parameters - )); - - // You are using SQL Server 2008 - $conn = DriverManager::getConnection(array( - 'driver' => 'pdo_sqlsrv', - // 2008 is default platform - // .. additional parameters - )); diff --git a/vendor/doctrine/dbal/bin/doctrine-dbal b/vendor/doctrine/dbal/bin/doctrine-dbal deleted file mode 100644 index 7ca0142..0000000 --- a/vendor/doctrine/dbal/bin/doctrine-dbal +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env php -register(); - -$classLoader = new \Doctrine\Common\ClassLoader('Symfony', 'Doctrine'); -$classLoader->register(); - -$configFile = getcwd() . DIRECTORY_SEPARATOR . 'cli-config.php'; - -$helperSet = null; -if (file_exists($configFile)) { - if ( ! is_readable($configFile)) { - trigger_error( - 'Configuration file [' . $configFile . '] does not have read permission.', E_ERROR - ); - } - - require $configFile; - - foreach ($GLOBALS as $helperSetCandidate) { - if ($helperSetCandidate instanceof \Symfony\Component\Console\Helper\HelperSet) { - $helperSet = $helperSetCandidate; - break; - } - } -} - -$helperSet = ($helperSet) ?: new \Symfony\Component\Console\Helper\HelperSet(); - -$cli = new \Symfony\Component\Console\Application('Doctrine Command Line Interface', Doctrine\DBAL\Version::VERSION); -$cli->setCatchExceptions(true); -$cli->setHelperSet($helperSet); -$cli->addCommands(array( - // DBAL Commands - new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(), - new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(), - new \Doctrine\DBAL\Tools\Console\Command\ReservedWordsCommand(), - -)); -$cli->run(); \ No newline at end of file diff --git a/vendor/doctrine/dbal/bin/doctrine.php b/vendor/doctrine/dbal/bin/doctrine.php deleted file mode 100644 index c24d306..0000000 --- a/vendor/doctrine/dbal/bin/doctrine.php +++ /dev/null @@ -1,42 +0,0 @@ -register(); - -$classLoader = new \Doctrine\Common\ClassLoader('Symfony', 'Doctrine'); -$classLoader->register(); - -$configFile = getcwd() . DIRECTORY_SEPARATOR . 'cli-config.php'; - -$helperSet = null; -if (file_exists($configFile)) { - if ( ! is_readable($configFile)) { - trigger_error( - 'Configuration file [' . $configFile . '] does not have read permission.', E_ERROR - ); - } - - require $configFile; - - foreach ($GLOBALS as $helperSetCandidate) { - if ($helperSetCandidate instanceof \Symfony\Component\Console\Helper\HelperSet) { - $helperSet = $helperSetCandidate; - break; - } - } -} - -$helperSet = ($helperSet) ?: new \Symfony\Component\Console\Helper\HelperSet(); - -$cli = new \Symfony\Component\Console\Application('Doctrine Command Line Interface', Doctrine\DBAL\Version::VERSION); -$cli->setCatchExceptions(true); -$cli->setHelperSet($helperSet); -$cli->addCommands(array( - // DBAL Commands - new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(), - new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(), - -)); -$cli->run(); diff --git a/vendor/doctrine/dbal/build.properties b/vendor/doctrine/dbal/build.properties deleted file mode 100644 index 12b5e8f..0000000 --- a/vendor/doctrine/dbal/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -# Project Name -project.name=DoctrineDBAL - -# Dependency minimum versions -dependencies.common=2.0.1 -dependencies.sfconsole=2.0.0 - -# Version class and file -project.version_class = Doctrine\DBAL\Version -project.version_file = lib/Doctrine/DBAL/Version.php diff --git a/vendor/doctrine/dbal/build.xml b/vendor/doctrine/dbal/build.xml deleted file mode 100644 index 0fb05ff..0000000 --- a/vendor/doctrine/dbal/build.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${project.name} - Doctrine Database Abstraction Layer - pear.doctrine-project.org - The Doctrine DBAL package is the database abstraction layer used to power the ORM package. - - - - - LGPL - - - - - - - - - - - script - Doctrine/Common/ - Doctrine/Symfony/ - - - - - - - diff --git a/vendor/doctrine/dbal/composer.json b/vendor/doctrine/dbal/composer.json deleted file mode 100644 index 9fca5d3..0000000 --- a/vendor/doctrine/dbal/composer.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "doctrine/dbal", - "type": "library", - "description": "Database Abstraction Layer", - "keywords": ["dbal", "database", "persistence", "queryobject"], - "homepage": "http://www.doctrine-project.org", - "license": "LGPL", - "authors": [ - {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, - {"name": "Roman Borschel", "email": "roman@code-factory.org"}, - {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, - {"name": "Jonathan Wage", "email": "jonwage@gmail.com"} - ], - "require": { - "php": ">=5.3.2", - "doctrine/common": ">=2.2.0,<=2.2.99" - }, - "autoload": { - "psr-0": { "Doctrine\\DBAL": "lib/" } - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/ArrayStatement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/ArrayStatement.php deleted file mode 100644 index 4818cd2..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/ArrayStatement.php +++ /dev/null @@ -1,98 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Cache; - -use Doctrine\DBAL\Driver\ResultStatement; -use PDO; - -class ArrayStatement implements \IteratorAggregate, ResultStatement -{ - private $data; - private $columnCount = 0; - private $num = 0; - private $defaultFetchStyle = PDO::FETCH_BOTH; - - public function __construct(array $data) - { - $this->data = $data; - if (count($data)) { - $this->columnCount = count($data[0]); - } - } - - public function closeCursor() - { - unset ($this->data); - } - - public function columnCount() - { - return $this->columnCount; - } - - public function setFetchMode($fetchStyle, $arg2 = null, $arg3 = null) - { - if ($arg2 !== null || $arg3 !== null) { - throw new \InvalidArgumentException("Caching layer does not support 2nd/3rd argument to setFetchMode()"); - } - - $this->defaultFetchStyle = $fetchStyle; - } - - public function getIterator() - { - $data = $this->fetchAll($this->defaultFetchStyle); - return new \ArrayIterator($data); - } - - public function fetch($fetchStyle = PDO::FETCH_BOTH) - { - if (isset($this->data[$this->num])) { - $row = $this->data[$this->num++]; - if ($fetchStyle === PDO::FETCH_ASSOC) { - return $row; - } else if ($fetchStyle === PDO::FETCH_NUM) { - return array_values($row); - } else if ($fetchStyle === PDO::FETCH_BOTH) { - return array_merge($row, array_values($row)); - } - } - return false; - } - - public function fetchAll($fetchStyle = PDO::FETCH_BOTH) - { - $rows = array(); - while ($row = $this->fetch($fetchStyle)) { - $rows[] = $row; - } - return $rows; - } - - public function fetchColumn($columnIndex = 0) - { - $row = $this->fetch(PDO::FETCH_NUM); - if (!isset($row[$columnIndex])) { - // TODO: verify this is correct behavior - return false; - } - return $row[$columnIndex]; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/CacheException.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/CacheException.php deleted file mode 100644 index 367ab81..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/CacheException.php +++ /dev/null @@ -1,37 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Cache; - -/** - * @author Benjamin Eberlei - * @since 2.2 - */ -class CacheException extends \Doctrine\DBAL\DBALException -{ - static public function noCacheKey() - { - return new self("No cache key was set."); - } - - static public function noResultDriverConfigured() - { - return new self("Trying to cache a query but no result driver is configured."); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/QueryCacheProfile.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/QueryCacheProfile.php deleted file mode 100644 index 1ffbd97..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/QueryCacheProfile.php +++ /dev/null @@ -1,131 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Cache; - -use Doctrine\Common\Cache\Cache; - -/** - * Query Cache Profile handles the data relevant for query caching. - * - * It is a value object, setter methods return NEW instances. - * - * @author Benjamin Eberlei - */ -class QueryCacheProfile -{ - /** - * @var Cache - */ - private $resultCacheDriver; - /** - * @var int - */ - private $lifetime = 0; - /** - * @var string - */ - private $cacheKey; - - /** - * @param int $lifetime - * @param string $cacheKey - * @param Cache $resultCache - */ - public function __construct($lifetime = 0, $cacheKey = null, Cache $resultCache = null) - { - $this->lifetime = $lifetime; - $this->cacheKey = $cacheKey; - $this->resultCacheDriver = $resultCache; - } - - /** - * @return Cache - */ - public function getResultCacheDriver() - { - return $this->resultCacheDriver; - } - - /** - * @return int - */ - public function getLifetime() - { - return $this->lifetime; - } - - /** - * @return string - */ - public function getCacheKey() - { - if ($this->cacheKey === null) { - throw CacheException::noCacheKey(); - } - return $this->cacheKey; - } - - /** - * Generate the real cache key from query, params and types. - * - * @param string $query - * @param array $params - * @param array $types - * @return array - */ - public function generateCacheKeys($query, $params, $types) - { - $realCacheKey = $query . "-" . serialize($params) . "-" . serialize($types); - // should the key be automatically generated using the inputs or is the cache key set? - if ($this->cacheKey === null) { - $cacheKey = sha1($realCacheKey); - } else { - $cacheKey = $this->cacheKey; - } - return array($cacheKey, $realCacheKey); - } - - /** - * @param Cache $cache - * @return QueryCacheProfile - */ - public function setResultCacheDriver(Cache $cache) - { - return new QueryCacheProfile($this->lifetime, $this->cacheKey, $cache); - } - - /** - * @param string|null $cacheKey - * @return QueryCacheProfile - */ - public function setCacheKey($cacheKey) - { - return new QueryCacheProfile($this->lifetime, $cacheKey, $this->resultCacheDriver); - } - - /** - * @param int $lifetime - * @return QueryCacheProfile - */ - public function setLifetime($lifetime) - { - return new QueryCacheProfile($lifetime, $this->cacheKey, $this->resultCacheDriver); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php deleted file mode 100644 index 6054184..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php +++ /dev/null @@ -1,255 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Cache; - -use Doctrine\DBAL\Driver\Statement; -use Doctrine\DBAL\Driver\ResultStatement; -use Doctrine\DBAL\Connection; -use Doctrine\Common\Cache\Cache; -use PDO; - -/** - * Cache statement for SQL results. - * - * A result is saved in multiple cache keys, there is the originally specified - * cache key which is just pointing to result rows by key. The following things - * have to be ensured: - * - * 1. lifetime of the original key has to be longer than that of all the individual rows keys - * 2. if any one row key is missing the query has to be re-executed. - * - * Also you have to realize that the cache will load the whole result into memory at once to ensure 2. - * This means that the memory usage for cached results might increase by using this feature. - */ -class ResultCacheStatement implements \IteratorAggregate, ResultStatement -{ - /** - * @var \Doctrine\Common\Cache\Cache - */ - private $resultCache; - - /** - * - * @var string - */ - private $cacheKey; - - /** - * @var string - */ - private $realKey; - - /** - * @var int - */ - private $lifetime; - - /** - * @var Doctrine\DBAL\Driver\Statement - */ - private $statement; - - /** - * Did we reach the end of the statement? - * - * @var bool - */ - private $emptied = false; - - /** - * @var array - */ - private $data; - - /** - * @var int - */ - private $defaultFetchStyle = PDO::FETCH_BOTH; - - /** - * @param Statement $stmt - * @param Cache $resultCache - * @param string $cacheKey - * @param string $realKey - * @param int $lifetime - */ - public function __construct(Statement $stmt, Cache $resultCache, $cacheKey, $realKey, $lifetime) - { - $this->statement = $stmt; - $this->resultCache = $resultCache; - $this->cacheKey = $cacheKey; - $this->realKey = $realKey; - $this->lifetime = $lifetime; - } - - /** - * Closes the cursor, enabling the statement to be executed again. - * - * @return boolean Returns TRUE on success or FALSE on failure. - */ - public function closeCursor() - { - $this->statement->closeCursor(); - if ($this->emptied && $this->data !== null) { - $data = $this->resultCache->fetch($this->cacheKey); - if (!$data) { - $data = array(); - } - $data[$this->realKey] = $this->data; - - $this->resultCache->save($this->cacheKey, $data, $this->lifetime); - unset($this->data); - } - } - - /** - * columnCount - * Returns the number of columns in the result set - * - * @return integer Returns the number of columns in the result set represented - * by the PDOStatement object. If there is no result set, - * this method should return 0. - */ - public function columnCount() - { - return $this->statement->columnCount(); - } - - public function setFetchMode($fetchStyle, $arg2 = null, $arg3 = null) - { - $this->defaultFetchStyle = $fetchStyle; - } - - public function getIterator() - { - $data = $this->fetchAll($this->defaultFetchStyle); - return new \ArrayIterator($data); - } - - /** - * fetch - * - * @see Query::HYDRATE_* constants - * @param integer $fetchStyle Controls how the next row will be returned to the caller. - * This value must be one of the Query::HYDRATE_* constants, - * defaulting to Query::HYDRATE_BOTH - * - * @param integer $cursorOrientation For a PDOStatement object representing a scrollable cursor, - * this value determines which row will be returned to the caller. - * This value must be one of the Query::HYDRATE_ORI_* constants, defaulting to - * Query::HYDRATE_ORI_NEXT. To request a scrollable cursor for your - * PDOStatement object, - * you must set the PDO::ATTR_CURSOR attribute to Doctrine::CURSOR_SCROLL when you - * prepare the SQL statement with Doctrine_Adapter_Interface->prepare(). - * - * @param integer $cursorOffset For a PDOStatement object representing a scrollable cursor for which the - * $cursorOrientation parameter is set to Query::HYDRATE_ORI_ABS, this value specifies - * the absolute number of the row in the result set that shall be fetched. - * - * For a PDOStatement object representing a scrollable cursor for - * which the $cursorOrientation parameter is set to Query::HYDRATE_ORI_REL, this value - * specifies the row to fetch relative to the cursor position before - * PDOStatement->fetch() was called. - * - * @return mixed - */ - public function fetch($fetchStyle = PDO::FETCH_BOTH) - { - if ($this->data === null) { - $this->data = array(); - } - - $row = $this->statement->fetch(PDO::FETCH_ASSOC); - if ($row) { - $this->data[] = $row; - - if ($fetchStyle == PDO::FETCH_ASSOC) { - return $row; - } else if ($fetchStyle == PDO::FETCH_NUM) { - return array_values($row); - } else if ($fetchStyle == PDO::FETCH_BOTH) { - return array_merge($row, array_values($row)); - } else { - throw new \InvalidArgumentException("Invalid fetch-style given for caching result."); - } - } - $this->emptied = true; - return false; - } - - /** - * Returns an array containing all of the result set rows - * - * @param integer $fetchStyle Controls how the next row will be returned to the caller. - * This value must be one of the Query::HYDRATE_* constants, - * defaulting to Query::HYDRATE_BOTH - * - * @param integer $columnIndex Returns the indicated 0-indexed column when the value of $fetchStyle is - * Query::HYDRATE_COLUMN. Defaults to 0. - * - * @return array - */ - public function fetchAll($fetchStyle = PDO::FETCH_BOTH) - { - $rows = array(); - while ($row = $this->fetch($fetchStyle)) { - $rows[] = $row; - } - return $rows; - } - - /** - * fetchColumn - * Returns a single column from the next row of a - * result set or FALSE if there are no more rows. - * - * @param integer $columnIndex 0-indexed number of the column you wish to retrieve from the row. If no - * value is supplied, PDOStatement->fetchColumn() - * fetches the first column. - * - * @return string returns a single column in the next row of a result set. - */ - public function fetchColumn($columnIndex = 0) - { - $row = $this->fetch(PDO::FETCH_NUM); - if (!isset($row[$columnIndex])) { - // TODO: verify this is correct behavior - return false; - } - return $row[$columnIndex]; - } - - /** - * rowCount - * rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement - * executed by the corresponding object. - * - * If the last SQL statement executed by the associated Statement object was a SELECT statement, - * some databases may return the number of rows returned by that statement. However, - * this behaviour is not guaranteed for all databases and should not be - * relied on for portable applications. - * - * @return integer Returns the number of rows. - */ - public function rowCount() - { - return $this->statement->rowCount(); - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Configuration.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Configuration.php deleted file mode 100644 index 03327fb..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Configuration.php +++ /dev/null @@ -1,113 +0,0 @@ -. - */ - -namespace Doctrine\DBAL; - -use Doctrine\DBAL\Logging\SQLLogger; -use Doctrine\Common\Cache\Cache; - -/** - * Configuration container for the Doctrine DBAL. - * - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @internal When adding a new configuration option just write a getter/setter - * pair and add the option to the _attributes array with a proper default value. - */ -class Configuration -{ - /** - * The attributes that are contained in the configuration. - * Values are default values. - * - * @var array - */ - protected $_attributes = array(); - - /** - * Sets the SQL logger to use. Defaults to NULL which means SQL logging is disabled. - * - * @param SQLLogger $logger - */ - public function setSQLLogger(SQLLogger $logger = null) - { - $this->_attributes['sqlLogger'] = $logger; - } - - /** - * Gets the SQL logger that is used. - * - * @return SQLLogger - */ - public function getSQLLogger() - { - return isset($this->_attributes['sqlLogger']) ? - $this->_attributes['sqlLogger'] : null; - } - - /** - * Gets the cache driver implementation that is used for query result caching. - * - * @return \Doctrine\Common\Cache\Cache - */ - public function getResultCacheImpl() - { - return isset($this->_attributes['resultCacheImpl']) ? - $this->_attributes['resultCacheImpl'] : null; - } - - /** - * Sets the cache driver implementation that is used for query result caching. - * - * @param \Doctrine\Common\Cache\Cache $cacheImpl - */ - public function setResultCacheImpl(Cache $cacheImpl) - { - $this->_attributes['resultCacheImpl'] = $cacheImpl; - } - - /** - * Filter schema assets expression. - * - * Only include tables/sequences matching the filter expression regexp in - * schema instances generated for the active connection when calling - * {AbstractSchemaManager#createSchema()}. - * - * @param string $filterExpression - */ - public function setFilterSchemaAssetsExpression($filterExpression) - { - $this->_attributes['filterSchemaAssetsExpression'] = $filterExpression; - } - - /** - * Return filter schema assets expression. - * - * @return string|null - */ - public function getFilterSchemaAssetsExpression() - { - if (isset($this->_attributes['filterSchemaAssetsExpression'])) { - return $this->_attributes['filterSchemaAssetsExpression']; - } - return null; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php deleted file mode 100644 index abe9376..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php +++ /dev/null @@ -1,1168 +0,0 @@ -. - */ - -namespace Doctrine\DBAL; - -use PDO, Closure, Exception, - Doctrine\DBAL\Types\Type, - Doctrine\DBAL\Driver\Connection as DriverConnection, - Doctrine\Common\EventManager, - Doctrine\DBAL\DBALException, - Doctrine\DBAL\Cache\ResultCacheStatement, - Doctrine\DBAL\Cache\QueryCacheProfile, - Doctrine\DBAL\Cache\ArrayStatement, - Doctrine\DBAL\Cache\CacheException; - -/** - * A wrapper around a Doctrine\DBAL\Driver\Connection that adds features like - * events, transaction isolation levels, configuration, emulated transaction nesting, - * lazy connecting and more. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Konsta Vesterinen - * @author Lukas Smith (MDB2 library) - * @author Benjamin Eberlei - */ -class Connection implements DriverConnection -{ - /** - * Constant for transaction isolation level READ UNCOMMITTED. - */ - const TRANSACTION_READ_UNCOMMITTED = 1; - - /** - * Constant for transaction isolation level READ COMMITTED. - */ - const TRANSACTION_READ_COMMITTED = 2; - - /** - * Constant for transaction isolation level REPEATABLE READ. - */ - const TRANSACTION_REPEATABLE_READ = 3; - - /** - * Constant for transaction isolation level SERIALIZABLE. - */ - const TRANSACTION_SERIALIZABLE = 4; - - /** - * Represents an array of ints to be expanded by Doctrine SQL parsing. - * - * @var int - */ - const PARAM_INT_ARRAY = 101; - - /** - * Represents an array of strings to be expanded by Doctrine SQL parsing. - * - * @var int - */ - const PARAM_STR_ARRAY = 102; - - /** - * Offset by which PARAM_* constants are detected as arrays of the param type. - * - * @var int - */ - const ARRAY_PARAM_OFFSET = 100; - - /** - * The wrapped driver connection. - * - * @var Doctrine\DBAL\Driver\Connection - */ - protected $_conn; - - /** - * @var Doctrine\DBAL\Configuration - */ - protected $_config; - - /** - * @var Doctrine\Common\EventManager - */ - protected $_eventManager; - - /** - * @var Doctrine\DBAL\Query\ExpressionBuilder - */ - protected $_expr; - - /** - * Whether or not a connection has been established. - * - * @var boolean - */ - private $_isConnected = false; - - /** - * The transaction nesting level. - * - * @var integer - */ - private $_transactionNestingLevel = 0; - - /** - * The currently active transaction isolation level. - * - * @var integer - */ - private $_transactionIsolationLevel; - - /** - * If nested transations should use savepoints - * - * @var integer - */ - private $_nestTransactionsWithSavepoints; - - /** - * The parameters used during creation of the Connection instance. - * - * @var array - */ - private $_params = array(); - - /** - * The DatabasePlatform object that provides information about the - * database platform used by the connection. - * - * @var Doctrine\DBAL\Platforms\AbstractPlatform - */ - protected $_platform; - - /** - * The schema manager. - * - * @var Doctrine\DBAL\Schema\SchemaManager - */ - protected $_schemaManager; - - /** - * The used DBAL driver. - * - * @var Doctrine\DBAL\Driver - */ - protected $_driver; - - /** - * Flag that indicates whether the current transaction is marked for rollback only. - * - * @var boolean - */ - private $_isRollbackOnly = false; - - /** - * Initializes a new instance of the Connection class. - * - * @param array $params The connection parameters. - * @param Driver $driver - * @param Configuration $config - * @param EventManager $eventManager - */ - public function __construct(array $params, Driver $driver, Configuration $config = null, - EventManager $eventManager = null) - { - $this->_driver = $driver; - $this->_params = $params; - - if (isset($params['pdo'])) { - $this->_conn = $params['pdo']; - $this->_isConnected = true; - } - - // Create default config and event manager if none given - if ( ! $config) { - $config = new Configuration(); - } - - if ( ! $eventManager) { - $eventManager = new EventManager(); - } - - $this->_config = $config; - $this->_eventManager = $eventManager; - - $this->_expr = new Query\Expression\ExpressionBuilder($this); - - if ( ! isset($params['platform'])) { - $this->_platform = $driver->getDatabasePlatform(); - } else if ($params['platform'] instanceof Platforms\AbstractPlatform) { - $this->_platform = $params['platform']; - } else { - throw DBALException::invalidPlatformSpecified(); - } - - $this->_platform->setEventManager($eventManager); - - $this->_transactionIsolationLevel = $this->_platform->getDefaultTransactionIsolationLevel(); - } - - /** - * Gets the parameters used during instantiation. - * - * @return array $params - */ - public function getParams() - { - return $this->_params; - } - - /** - * Gets the name of the database this Connection is connected to. - * - * @return string $database - */ - public function getDatabase() - { - return $this->_driver->getDatabase($this); - } - - /** - * Gets the hostname of the currently connected database. - * - * @return string - */ - public function getHost() - { - return isset($this->_params['host']) ? $this->_params['host'] : null; - } - - /** - * Gets the port of the currently connected database. - * - * @return mixed - */ - public function getPort() - { - return isset($this->_params['port']) ? $this->_params['port'] : null; - } - - /** - * Gets the username used by this connection. - * - * @return string - */ - public function getUsername() - { - return isset($this->_params['user']) ? $this->_params['user'] : null; - } - - /** - * Gets the password used by this connection. - * - * @return string - */ - public function getPassword() - { - return isset($this->_params['password']) ? $this->_params['password'] : null; - } - - /** - * Gets the DBAL driver instance. - * - * @return \Doctrine\DBAL\Driver - */ - public function getDriver() - { - return $this->_driver; - } - - /** - * Gets the Configuration used by the Connection. - * - * @return \Doctrine\DBAL\Configuration - */ - public function getConfiguration() - { - return $this->_config; - } - - /** - * Gets the EventManager used by the Connection. - * - * @return \Doctrine\Common\EventManager - */ - public function getEventManager() - { - return $this->_eventManager; - } - - /** - * Gets the DatabasePlatform for the connection. - * - * @return \Doctrine\DBAL\Platforms\AbstractPlatform - */ - public function getDatabasePlatform() - { - return $this->_platform; - } - - /** - * Gets the ExpressionBuilder for the connection. - * - * @return \Doctrine\DBAL\Query\ExpressionBuilder - */ - public function getExpressionBuilder() - { - return $this->_expr; - } - - /** - * Establishes the connection with the database. - * - * @return boolean TRUE if the connection was successfully established, FALSE if - * the connection is already open. - */ - public function connect() - { - if ($this->_isConnected) return false; - - $driverOptions = isset($this->_params['driverOptions']) ? - $this->_params['driverOptions'] : array(); - $user = isset($this->_params['user']) ? $this->_params['user'] : null; - $password = isset($this->_params['password']) ? - $this->_params['password'] : null; - - $this->_conn = $this->_driver->connect($this->_params, $user, $password, $driverOptions); - $this->_isConnected = true; - - if ($this->_eventManager->hasListeners(Events::postConnect)) { - $eventArgs = new Event\ConnectionEventArgs($this); - $this->_eventManager->dispatchEvent(Events::postConnect, $eventArgs); - } - - return true; - } - - /** - * Prepares and executes an SQL query and returns the first row of the result - * as an associative array. - * - * @param string $statement The SQL query. - * @param array $params The query parameters. - * @return array - */ - public function fetchAssoc($statement, array $params = array()) - { - return $this->executeQuery($statement, $params)->fetch(PDO::FETCH_ASSOC); - } - - /** - * Prepares and executes an SQL query and returns the first row of the result - * as a numerically indexed array. - * - * @param string $statement sql query to be executed - * @param array $params prepared statement params - * @return array - */ - public function fetchArray($statement, array $params = array()) - { - return $this->executeQuery($statement, $params)->fetch(PDO::FETCH_NUM); - } - - /** - * Prepares and executes an SQL query and returns the value of a single column - * of the first row of the result. - * - * @param string $statement sql query to be executed - * @param array $params prepared statement params - * @param int $colnum 0-indexed column number to retrieve - * @return mixed - */ - public function fetchColumn($statement, array $params = array(), $colnum = 0) - { - return $this->executeQuery($statement, $params)->fetchColumn($colnum); - } - - /** - * Whether an actual connection to the database is established. - * - * @return boolean - */ - public function isConnected() - { - return $this->_isConnected; - } - - /** - * Checks whether a transaction is currently active. - * - * @return boolean TRUE if a transaction is currently active, FALSE otherwise. - */ - public function isTransactionActive() - { - return $this->_transactionNestingLevel > 0; - } - - /** - * Executes an SQL DELETE statement on a table. - * - * @param string $table The name of the table on which to delete. - * @param array $identifier The deletion criteria. An associateve array containing column-value pairs. - * @return integer The number of affected rows. - */ - public function delete($tableName, array $identifier) - { - $this->connect(); - - $criteria = array(); - - foreach (array_keys($identifier) as $columnName) { - $criteria[] = $columnName . ' = ?'; - } - - $query = 'DELETE FROM ' . $tableName . ' WHERE ' . implode(' AND ', $criteria); - - return $this->executeUpdate($query, array_values($identifier)); - } - - /** - * Closes the connection. - * - * @return void - */ - public function close() - { - unset($this->_conn); - - $this->_isConnected = false; - } - - /** - * Sets the transaction isolation level. - * - * @param integer $level The level to set. - */ - public function setTransactionIsolation($level) - { - $this->_transactionIsolationLevel = $level; - - return $this->executeUpdate($this->_platform->getSetTransactionIsolationSQL($level)); - } - - /** - * Gets the currently active transaction isolation level. - * - * @return integer The current transaction isolation level. - */ - public function getTransactionIsolation() - { - return $this->_transactionIsolationLevel; - } - - /** - * Executes an SQL UPDATE statement on a table. - * - * @param string $table The name of the table to update. - * @param array $identifier The update criteria. An associative array containing column-value pairs. - * @param array $types Types of the merged $data and $identifier arrays in that order. - * @return integer The number of affected rows. - */ - public function update($tableName, array $data, array $identifier, array $types = array()) - { - $this->connect(); - $set = array(); - foreach ($data as $columnName => $value) { - $set[] = $columnName . ' = ?'; - } - - $params = array_merge(array_values($data), array_values($identifier)); - - $sql = 'UPDATE ' . $tableName . ' SET ' . implode(', ', $set) - . ' WHERE ' . implode(' = ? AND ', array_keys($identifier)) - . ' = ?'; - - return $this->executeUpdate($sql, $params, $types); - } - - /** - * Inserts a table row with specified data. - * - * @param string $table The name of the table to insert data into. - * @param array $data An associative array containing column-value pairs. - * @param array $types Types of the inserted data. - * @return integer The number of affected rows. - */ - public function insert($tableName, array $data, array $types = array()) - { - $this->connect(); - - // column names are specified as array keys - $cols = array(); - $placeholders = array(); - - foreach ($data as $columnName => $value) { - $cols[] = $columnName; - $placeholders[] = '?'; - } - - $query = 'INSERT INTO ' . $tableName - . ' (' . implode(', ', $cols) . ')' - . ' VALUES (' . implode(', ', $placeholders) . ')'; - - return $this->executeUpdate($query, array_values($data), $types); - } - - /** - * Sets the given charset on the current connection. - * - * @param string $charset The charset to set. - */ - public function setCharset($charset) - { - $this->executeUpdate($this->_platform->getSetCharsetSQL($charset)); - } - - /** - * Quote a string so it can be safely used as a table or column name, even if - * it is a reserved name. - * - * Delimiting style depends on the underlying database platform that is being used. - * - * NOTE: Just because you CAN use quoted identifiers does not mean - * you SHOULD use them. In general, they end up causing way more - * problems than they solve. - * - * @param string $str The name to be quoted. - * @return string The quoted name. - */ - public function quoteIdentifier($str) - { - return $this->_platform->quoteIdentifier($str); - } - - /** - * Quotes a given input parameter. - * - * @param mixed $input Parameter to be quoted. - * @param string $type Type of the parameter. - * @return string The quoted parameter. - */ - public function quote($input, $type = null) - { - $this->connect(); - - list($value, $bindingType) = $this->getBindingInfo($input, $type); - return $this->_conn->quote($value, $bindingType); - } - - /** - * Prepares and executes an SQL query and returns the result as an associative array. - * - * @param string $sql The SQL query. - * @param array $params The query parameters. - * @return array - */ - public function fetchAll($sql, array $params = array()) - { - return $this->executeQuery($sql, $params)->fetchAll(PDO::FETCH_ASSOC); - } - - /** - * Prepares an SQL statement. - * - * @param string $statement The SQL statement to prepare. - * @return Doctrine\DBAL\Driver\Statement The prepared statement. - */ - public function prepare($statement) - { - $this->connect(); - - return new Statement($statement, $this); - } - - /** - * Executes an, optionally parameterized, SQL query. - * - * If the query is parameterized, a prepared statement is used. - * If an SQLLogger is configured, the execution is logged. - * - * @param string $query The SQL query to execute. - * @param array $params The parameters to bind to the query, if any. - * @param array $types The types the previous parameters are in. - * @param QueryCacheProfile $qcp - * @return Doctrine\DBAL\Driver\Statement The executed statement. - * @internal PERF: Directly prepares a driver statement, not a wrapper. - */ - public function executeQuery($query, array $params = array(), $types = array(), QueryCacheProfile $qcp = null) - { - if ($qcp !== null) { - return $this->executeCacheQuery($query, $params, $types, $qcp); - } - - $this->connect(); - - $hasLogger = $this->_config->getSQLLogger() !== null; - if ($hasLogger) { - $this->_config->getSQLLogger()->startQuery($query, $params, $types); - } - - if ($params) { - list($query, $params, $types) = SQLParserUtils::expandListParameters($query, $params, $types); - - $stmt = $this->_conn->prepare($query); - if ($types) { - $this->_bindTypedValues($stmt, $params, $types); - $stmt->execute(); - } else { - $stmt->execute($params); - } - } else { - $stmt = $this->_conn->query($query); - } - - if ($hasLogger) { - $this->_config->getSQLLogger()->stopQuery(); - } - - return $stmt; - } - - /** - * Execute a caching query and - * - * @param string $query - * @param array $params - * @param array $types - * @param QueryCacheProfile $qcp - * @return \Doctrine\DBAL\Driver\ResultStatement - */ - public function executeCacheQuery($query, $params, $types, QueryCacheProfile $qcp) - { - $resultCache = $qcp->getResultCacheDriver() ?: $this->_config->getResultCacheImpl(); - if (!$resultCache) { - throw CacheException::noResultDriverConfigured(); - } - - list($cacheKey, $realKey) = $qcp->generateCacheKeys($query, $params, $types); - - // fetch the row pointers entry - if ($data = $resultCache->fetch($cacheKey)) { - // is the real key part of this row pointers map or is the cache only pointing to other cache keys? - if (isset($data[$realKey])) { - return new ArrayStatement($data[$realKey]); - } else if (array_key_exists($realKey, $data)) { - return new ArrayStatement(array()); - } - } - return new ResultCacheStatement($this->executeQuery($query, $params, $types), $resultCache, $cacheKey, $realKey, $qcp->getLifetime()); - } - - /** - * Executes an, optionally parameterized, SQL query and returns the result, - * applying a given projection/transformation function on each row of the result. - * - * @param string $query The SQL query to execute. - * @param array $params The parameters, if any. - * @param Closure $mapper The transformation function that is applied on each row. - * The function receives a single paramater, an array, that - * represents a row of the result set. - * @return mixed The projected result of the query. - */ - public function project($query, array $params, Closure $function) - { - $result = array(); - $stmt = $this->executeQuery($query, $params ?: array()); - - while ($row = $stmt->fetch()) { - $result[] = $function($row); - } - - $stmt->closeCursor(); - - return $result; - } - - /** - * Executes an SQL statement, returning a result set as a Statement object. - * - * @param string $statement - * @param integer $fetchType - * @return Doctrine\DBAL\Driver\Statement - */ - public function query() - { - $this->connect(); - - $args = func_get_args(); - - $logger = $this->getConfiguration()->getSQLLogger(); - if ($logger) { - $logger->startQuery($args[0]); - } - - $statement = call_user_func_array(array($this->_conn, 'query'), $args); - - if ($logger) { - $logger->stopQuery(); - } - - return $statement; - } - - /** - * Executes an SQL INSERT/UPDATE/DELETE query with the given parameters - * and returns the number of affected rows. - * - * This method supports PDO binding types as well as DBAL mapping types. - * - * @param string $query The SQL query. - * @param array $params The query parameters. - * @param array $types The parameter types. - * @return integer The number of affected rows. - * @internal PERF: Directly prepares a driver statement, not a wrapper. - */ - public function executeUpdate($query, array $params = array(), array $types = array()) - { - $this->connect(); - - $hasLogger = $this->_config->getSQLLogger() !== null; - if ($hasLogger) { - $this->_config->getSQLLogger()->startQuery($query, $params, $types); - } - - if ($params) { - list($query, $params, $types) = SQLParserUtils::expandListParameters($query, $params, $types); - - $stmt = $this->_conn->prepare($query); - if ($types) { - $this->_bindTypedValues($stmt, $params, $types); - $stmt->execute(); - } else { - $stmt->execute($params); - } - $result = $stmt->rowCount(); - } else { - $result = $this->_conn->exec($query); - } - - if ($hasLogger) { - $this->_config->getSQLLogger()->stopQuery(); - } - - return $result; - } - - /** - * Execute an SQL statement and return the number of affected rows. - * - * @param string $statement - * @return integer The number of affected rows. - */ - public function exec($statement) - { - $this->connect(); - return $this->_conn->exec($statement); - } - - /** - * Returns the current transaction nesting level. - * - * @return integer The nesting level. A value of 0 means there's no active transaction. - */ - public function getTransactionNestingLevel() - { - return $this->_transactionNestingLevel; - } - - /** - * Fetch the SQLSTATE associated with the last database operation. - * - * @return integer The last error code. - */ - public function errorCode() - { - $this->connect(); - return $this->_conn->errorCode(); - } - - /** - * Fetch extended error information associated with the last database operation. - * - * @return array The last error information. - */ - public function errorInfo() - { - $this->connect(); - return $this->_conn->errorInfo(); - } - - /** - * Returns the ID of the last inserted row, or the last value from a sequence object, - * depending on the underlying driver. - * - * Note: This method may not return a meaningful or consistent result across different drivers, - * because the underlying database may not even support the notion of AUTO_INCREMENT/IDENTITY - * columns or sequences. - * - * @param string $seqName Name of the sequence object from which the ID should be returned. - * @return string A string representation of the last inserted ID. - */ - public function lastInsertId($seqName = null) - { - $this->connect(); - return $this->_conn->lastInsertId($seqName); - } - - /** - * Executes a function in a transaction. - * - * The function gets passed this Connection instance as an (optional) parameter. - * - * If an exception occurs during execution of the function or transaction commit, - * the transaction is rolled back and the exception re-thrown. - * - * @param Closure $func The function to execute transactionally. - */ - public function transactional(Closure $func) - { - $this->beginTransaction(); - try { - $func($this); - $this->commit(); - } catch (Exception $e) { - $this->rollback(); - throw $e; - } - } - - /** - * Set if nested transactions should use savepoints - * - * @param boolean - * @return void - */ - public function setNestTransactionsWithSavepoints($nestTransactionsWithSavepoints) - { - if ($this->_transactionNestingLevel > 0) { - throw ConnectionException::mayNotAlterNestedTransactionWithSavepointsInTransaction(); - } - - if (!$this->_platform->supportsSavepoints()) { - throw ConnectionException::savepointsNotSupported(); - } - - $this->_nestTransactionsWithSavepoints = $nestTransactionsWithSavepoints; - } - - /** - * Get if nested transactions should use savepoints - * - * @return boolean - */ - public function getNestTransactionsWithSavepoints() - { - return $this->_nestTransactionsWithSavepoints; - } - - /** - * Returns the savepoint name to use for nested transactions are false if they are not supported - * "savepointFormat" parameter is not set - * - * @return mixed a string with the savepoint name or false - */ - protected function _getNestedTransactionSavePointName() - { - return 'DOCTRINE2_SAVEPOINT_'.$this->_transactionNestingLevel; - } - - /** - * Starts a transaction by suspending auto-commit mode. - * - * @return void - */ - public function beginTransaction() - { - $this->connect(); - - ++$this->_transactionNestingLevel; - - if ($this->_transactionNestingLevel == 1) { - $this->_conn->beginTransaction(); - } else if ($this->_nestTransactionsWithSavepoints) { - $this->createSavepoint($this->_getNestedTransactionSavePointName()); - } - } - - /** - * Commits the current transaction. - * - * @return void - * @throws ConnectionException If the commit failed due to no active transaction or - * because the transaction was marked for rollback only. - */ - public function commit() - { - if ($this->_transactionNestingLevel == 0) { - throw ConnectionException::noActiveTransaction(); - } - if ($this->_isRollbackOnly) { - throw ConnectionException::commitFailedRollbackOnly(); - } - - $this->connect(); - - if ($this->_transactionNestingLevel == 1) { - $this->_conn->commit(); - } else if ($this->_nestTransactionsWithSavepoints) { - $this->releaseSavepoint($this->_getNestedTransactionSavePointName()); - } - - --$this->_transactionNestingLevel; - } - - /** - * Cancel any database changes done during the current transaction. - * - * this method can be listened with onPreTransactionRollback and onTransactionRollback - * eventlistener methods - * - * @throws ConnectionException If the rollback operation failed. - */ - public function rollback() - { - if ($this->_transactionNestingLevel == 0) { - throw ConnectionException::noActiveTransaction(); - } - - $this->connect(); - - if ($this->_transactionNestingLevel == 1) { - $this->_transactionNestingLevel = 0; - $this->_conn->rollback(); - $this->_isRollbackOnly = false; - } else if ($this->_nestTransactionsWithSavepoints) { - $this->rollbackSavepoint($this->_getNestedTransactionSavePointName()); - --$this->_transactionNestingLevel; - } else { - $this->_isRollbackOnly = true; - --$this->_transactionNestingLevel; - } - } - - /** - * createSavepoint - * creates a new savepoint - * - * @param string $savepoint name of a savepoint to set - * @return void - */ - public function createSavepoint($savepoint) - { - if (!$this->_platform->supportsSavepoints()) { - throw ConnectionException::savepointsNotSupported(); - } - - $this->_conn->exec($this->_platform->createSavePoint($savepoint)); - } - - /** - * releaseSavePoint - * releases given savepoint - * - * @param string $savepoint name of a savepoint to release - * @return void - */ - public function releaseSavepoint($savepoint) - { - if (!$this->_platform->supportsSavepoints()) { - throw ConnectionException::savepointsNotSupported(); - } - - if ($this->_platform->supportsReleaseSavepoints()) { - $this->_conn->exec($this->_platform->releaseSavePoint($savepoint)); - } - } - - /** - * rollbackSavePoint - * releases given savepoint - * - * @param string $savepoint name of a savepoint to rollback to - * @return void - */ - public function rollbackSavepoint($savepoint) - { - if (!$this->_platform->supportsSavepoints()) { - throw ConnectionException::savepointsNotSupported(); - } - - $this->_conn->exec($this->_platform->rollbackSavePoint($savepoint)); - } - - /** - * Gets the wrapped driver connection. - * - * @return Doctrine\DBAL\Driver\Connection - */ - public function getWrappedConnection() - { - $this->connect(); - - return $this->_conn; - } - - /** - * Gets the SchemaManager that can be used to inspect or change the - * database schema through the connection. - * - * @return Doctrine\DBAL\Schema\AbstractSchemaManager - */ - public function getSchemaManager() - { - if ( ! $this->_schemaManager) { - $this->_schemaManager = $this->_driver->getSchemaManager($this); - } - - return $this->_schemaManager; - } - - /** - * Marks the current transaction so that the only possible - * outcome for the transaction to be rolled back. - * - * @throws ConnectionException If no transaction is active. - */ - public function setRollbackOnly() - { - if ($this->_transactionNestingLevel == 0) { - throw ConnectionException::noActiveTransaction(); - } - $this->_isRollbackOnly = true; - } - - /** - * Check whether the current transaction is marked for rollback only. - * - * @return boolean - * @throws ConnectionException If no transaction is active. - */ - public function isRollbackOnly() - { - if ($this->_transactionNestingLevel == 0) { - throw ConnectionException::noActiveTransaction(); - } - return $this->_isRollbackOnly; - } - - /** - * Converts a given value to its database representation according to the conversion - * rules of a specific DBAL mapping type. - * - * @param mixed $value The value to convert. - * @param string $type The name of the DBAL mapping type. - * @return mixed The converted value. - */ - public function convertToDatabaseValue($value, $type) - { - return Type::getType($type)->convertToDatabaseValue($value, $this->_platform); - } - - /** - * Converts a given value to its PHP representation according to the conversion - * rules of a specific DBAL mapping type. - * - * @param mixed $value The value to convert. - * @param string $type The name of the DBAL mapping type. - * @return mixed The converted type. - */ - public function convertToPHPValue($value, $type) - { - return Type::getType($type)->convertToPHPValue($value, $this->_platform); - } - - /** - * Binds a set of parameters, some or all of which are typed with a PDO binding type - * or DBAL mapping type, to a given statement. - * - * @param $stmt The statement to bind the values to. - * @param array $params The map/list of named/positional parameters. - * @param array $types The parameter types (PDO binding types or DBAL mapping types). - * @internal Duck-typing used on the $stmt parameter to support driver statements as well as - * raw PDOStatement instances. - */ - private function _bindTypedValues($stmt, array $params, array $types) - { - // Check whether parameters are positional or named. Mixing is not allowed, just like in PDO. - if (is_int(key($params))) { - // Positional parameters - $typeOffset = array_key_exists(0, $types) ? -1 : 0; - $bindIndex = 1; - foreach ($params as $position => $value) { - $typeIndex = $bindIndex + $typeOffset; - if (isset($types[$typeIndex])) { - $type = $types[$typeIndex]; - list($value, $bindingType) = $this->getBindingInfo($value, $type); - $stmt->bindValue($bindIndex, $value, $bindingType); - } else { - $stmt->bindValue($bindIndex, $value); - } - ++$bindIndex; - } - } else { - // Named parameters - foreach ($params as $name => $value) { - if (isset($types[$name])) { - $type = $types[$name]; - list($value, $bindingType) = $this->getBindingInfo($value, $type); - $stmt->bindValue($name, $value, $bindingType); - } else { - $stmt->bindValue($name, $value); - } - } - } - } - - /** - * Gets the binding type of a given type. The given type can be a PDO or DBAL mapping type. - * - * @param mixed $value The value to bind - * @param mixed $type The type to bind (PDO or DBAL) - * @return array [0] => the (escaped) value, [1] => the binding type - */ - private function getBindingInfo($value, $type) - { - if (is_string($type)) { - $type = Type::getType($type); - } - if ($type instanceof Type) { - $value = $type->convertToDatabaseValue($value, $this->_platform); - $bindingType = $type->getBindingType(); - } else { - $bindingType = $type; // PDO::PARAM_* constants - } - return array($value, $bindingType); - } - - /** - * Create a new instance of a SQL query builder. - * - * @return Query\QueryBuilder - */ - public function createQueryBuilder() - { - return new Query\QueryBuilder($this); - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/ConnectionException.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/ConnectionException.php deleted file mode 100644 index 8c8f703..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/ConnectionException.php +++ /dev/null @@ -1,54 +0,0 @@ -. - */ - -namespace Doctrine\DBAL; - -/** - * Doctrine\DBAL\ConnectionException - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 4628 $ - * @author Jonathan H. Wage . - */ - -namespace Doctrine\DBAL\Connections; - - -use Doctrine\DBAL\Connection, - Doctrine\DBAL\Driver, - Doctrine\DBAL\Configuration, - Doctrine\Common\EventManager, - Doctrine\DBAL\Event\ConnectionEventArgs, - Doctrine\DBAL\Events; - -/** - * Master-Slave Connection - * - * Connection can be used with master-slave setups. - * - * Important for the understanding of this connection should be how and when - * it picks the slave or master. - * - * 1. Slave if master was never picked before and ONLY if 'getWrappedConnection' - * or 'executeQuery' is used. - * 2. Master picked when 'exec', 'executeUpdate', 'insert', 'delete', 'update', 'createSavepoint', - * 'releaseSavepoint', 'beginTransaction', 'rollback', 'commit', 'query' or - * 'prepare' is called. - * 3. If master was picked once during the lifetime of the connection it will always get picked afterwards. - * 4. One slave connection is randomly picked ONCE during a request. - * - * ATTENTION: You can write to the slave with this connection if you execute a write query without - * opening up a transaction. For example: - * - * $conn = DriverManager::getConnection(...); - * $conn->executeQuery("DELETE FROM table"); - * - * Be aware that Connection#executeQuery is a method specifically for READ - * operations only. - * - * This connection is limited to slave operations using the - * Connection#executeQuery operation only, because it wouldn't be compatible - * with the ORM or SchemaManager code otherwise. Both use all the other - * operations in a context where writes could happen to a slave, which makes - * this restricted approach necessary. - * - * You can manually connect to the master at any time by calling: - * - * $conn->connect('master'); - * - * Instantiation through the DriverManager looks like: - * - * @example - * - * $conn = DriverManager::getConnection(array( - * 'wrapperClass' => 'Doctrine\DBAL\Connections\MasterSlaveConnection', - * 'driver' => 'pdo_mysql', - * 'master' => array('user' => '', 'password' => '', 'host' => '', 'dbname' => ''), - * 'slaves' => array( - * array('user' => 'slave1', 'password', 'host' => '', 'dbname' => ''), - * array('user' => 'slave2', 'password', 'host' => '', 'dbname' => ''), - * ) - * )); - * - * You can also pass 'driverOptions' and any other documented option to each of this drivers to pass additional information. - * - * @author Lars Strojny - * @author Benjamin Eberlei - */ -class MasterSlaveConnection extends Connection -{ - /** - * Master and slave connection (one of the randomly picked slaves) - * - * @var Doctrine\DBAL\Driver\Connection[] - */ - protected $connections = array('master' => null, 'slave' => null); - - /** - * Create Master Slave Connection - * - * @param array $params - * @param Driver $driver - * @param Configuration $config - * @param EventManager $eventManager - */ - public function __construct(array $params, Driver $driver, Configuration $config = null, EventManager $eventManager = null) - { - if ( !isset($params['slaves']) || !isset($params['master']) ) { - throw new \InvalidArgumentException('master or slaves configuration missing'); - } - if ( count($params['slaves']) == 0 ) { - throw new \InvalidArgumentException('You have to configure at least one slaves.'); - } - - $params['master']['driver'] = $params['driver']; - foreach ($params['slaves'] as $slaveKey => $slave) { - $params['slaves'][$slaveKey]['driver'] = $params['driver']; - } - - parent::__construct($params, $driver, $config, $eventManager); - } - - /** - * Check if the connection is currently towards the master or not. - * - * @return bool - */ - public function isConnectedToMaster() - { - return $this->_conn !== null && $this->_conn === $this->connections['master']; - } - - /** - * {@inheritDoc} - */ - public function connect($connectionName = 'slave') - { - if ( $connectionName !== 'slave' && $connectionName !== 'master' ) { - throw new \InvalidArgumentException("Invalid option to connect(), only master or slave allowed."); - } - - $forceMasterAsSlave = false; - - if ($this->getTransactionNestingLevel() > 0) { - $connectionName = 'master'; - $forceMasterAsSlave = true; - } - - if ($this->connections[$connectionName]) { - if ($forceMasterAsSlave) { - $this->connections['slave'] = $this->_conn = $this->connections['master']; - } else { - $this->_conn = $this->connections[$connectionName]; - } - return false; - } - - if ($connectionName === 'master') { - /** Set slave connection to master to avoid invalid reads */ - if ($this->connections['slave']) { - unset($this->connections['slave']); - } - - $this->connections['master'] = $this->connections['slave'] = $this->_conn = $this->connectTo($connectionName); - } else { - $this->connections['slave'] = $this->_conn = $this->connectTo($connectionName); - } - - if ($this->_eventManager->hasListeners(Events::postConnect)) { - $eventArgs = new ConnectionEventArgs($this); - $this->_eventManager->dispatchEvent(Events::postConnect, $eventArgs); - } - - return true; - } - - /** - * Connect to a specific connection - * - * @param string $connectionName - * @return Driver - */ - protected function connectTo($connectionName) - { - $params = $this->getParams(); - - $driverOptions = isset($params['driverOptions']) ? $params['driverOptions'] : array(); - - $connectionParams = $this->chooseConnectionConfiguration($connectionName, $params); - - $user = isset($connectionParams['user']) ? $connectionParams['user'] : null; - $password = isset($connectionParams['password']) ? $connectionParams['password'] : null; - - return $this->_driver->connect($connectionParams, $user, $password, $driverOptions); - } - - protected function chooseConnectionConfiguration($connectionName, $params) - { - if ($connectionName === 'master') { - return $params['master']; - } - - return $params['slaves'][array_rand($params['slaves'])]; - } - - /** - * {@inheritDoc} - */ - public function executeUpdate($query, array $params = array(), array $types = array()) - { - $this->connect('master'); - return parent::executeUpdate($query, $params, $types); - } - - /** - * {@inheritDoc} - */ - public function beginTransaction() - { - $this->connect('master'); - return parent::beginTransaction(); - } - - /** - * {@inheritDoc} - */ - public function commit() - { - $this->connect('master'); - return parent::commit(); - } - - /** - * {@inheritDoc} - */ - public function rollback() - { - $this->connect('master'); - return parent::rollback(); - } - - /** - * {@inheritDoc} - */ - public function delete($tableName, array $identifier) - { - $this->connect('master'); - return parent::delete($tableName, $identifier); - } - - /** - * {@inheritDoc} - */ - public function update($tableName, array $data, array $identifier, array $types = array()) - { - $this->connect('master'); - return parent::update($tableName, $data, $identifier, $types); - } - - /** - * {@inheritDoc} - */ - public function insert($tableName, array $data, array $types = array()) - { - $this->connect('master'); - return parent::insert($tableName, $data, $types); - } - - /** - * {@inheritDoc} - */ - public function exec($statement) - { - $this->connect('master'); - return parent::exec($statement); - } - - /** - * {@inheritDoc} - */ - public function createSavepoint($savepoint) - { - $this->connect('master'); - - return parent::createSavepoint($savepoint); - } - - /** - * {@inheritDoc} - */ - public function releaseSavepoint($savepoint) - { - $this->connect('master'); - - return parent::releaseSavepoint($savepoint); - } - - /** - * {@inheritDoc} - */ - public function rollbackSavepoint($savepoint) - { - $this->connect('master'); - - return parent::rollbackSavepoint($savepoint); - } - - public function query() - { - $this->connect('master'); - - $args = func_get_args(); - - $logger = $this->getConfiguration()->getSQLLogger(); - if ($logger) { - $logger->startQuery($args[0]); - } - - $statement = call_user_func_array(array($this->_conn, 'query'), $args); - - if ($logger) { - $logger->stopQuery(); - } - - return $statement; - } - - public function prepare($statement) - { - $this->connect('master'); - - return parent::prepare($statement); - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php deleted file mode 100644 index 9222e7e..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php +++ /dev/null @@ -1,88 +0,0 @@ -. - */ - -namespace Doctrine\DBAL; - -/** - * Driver interface. - * Interface that all DBAL drivers must implement. - * - * @since 2.0 - */ -interface Driver -{ - /** - * Attempts to create a connection with the database. - * - * @param array $params All connection parameters passed by the user. - * @param string $username The username to use when connecting. - * @param string $password The password to use when connecting. - * @param array $driverOptions The driver options to use when connecting. - * @return Doctrine\DBAL\Driver\Connection The database connection. - */ - public function connect(array $params, $username = null, $password = null, array $driverOptions = array()); - - /** - * Gets the DatabasePlatform instance that provides all the metadata about - * the platform this driver connects to. - * - * @return Doctrine\DBAL\Platforms\AbstractPlatform The database platform. - */ - public function getDatabasePlatform(); - - /** - * Gets the SchemaManager that can be used to inspect and change the underlying - * database schema of the platform this driver connects to. - * - * @param Doctrine\DBAL\Connection $conn - * @return Doctrine\DBAL\SchemaManager - */ - public function getSchemaManager(Connection $conn); - - /** - * Gets the name of the driver. - * - * @return string The name of the driver. - */ - public function getName(); - - /** - * Get the name of the database connected to for this driver. - * - * @param Doctrine\DBAL\Connection $conn - * @return string $database - */ - public function getDatabase(Connection $conn); -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Connection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Connection.php deleted file mode 100644 index c3f0d56..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Connection.php +++ /dev/null @@ -1,42 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Driver; - -/** - * Connection interface. - * Driver connections must implement this interface. - * - * This resembles (a subset of) the PDO interface. - * - * @since 2.0 - */ -interface Connection -{ - function prepare($prepareString); - function query(); - function quote($input, $type=\PDO::PARAM_STR); - function exec($statement); - function lastInsertId($name = null); - function beginTransaction(); - function commit(); - function rollBack(); - function errorCode(); - function errorInfo(); -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php deleted file mode 100644 index c9d2fef..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php +++ /dev/null @@ -1,115 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Driver\IBMDB2; - -class DB2Connection implements \Doctrine\DBAL\Driver\Connection -{ - private $_conn = null; - - public function __construct(array $params, $username, $password, $driverOptions = array()) - { - $isPersistant = (isset($params['persistent']) && $params['persistent'] == true); - - if ($isPersistant) { - $this->_conn = db2_pconnect($params['dbname'], $username, $password, $driverOptions); - } else { - $this->_conn = db2_connect($params['dbname'], $username, $password, $driverOptions); - } - if (!$this->_conn) { - throw new DB2Exception(db2_conn_errormsg()); - } - } - - public function prepare($sql) - { - $stmt = @db2_prepare($this->_conn, $sql); - if (!$stmt) { - throw new DB2Exception(db2_stmt_errormsg()); - } - return new DB2Statement($stmt); - } - - public function query() - { - $args = func_get_args(); - $sql = $args[0]; - $stmt = $this->prepare($sql); - $stmt->execute(); - return $stmt; - } - - public function quote($input, $type=\PDO::PARAM_STR) - { - $input = db2_escape_string($input); - if ($type == \PDO::PARAM_INT ) { - return $input; - } else { - return "'".$input."'"; - } - } - - public function exec($statement) - { - $stmt = $this->prepare($statement); - $stmt->execute(); - return $stmt->rowCount(); - } - - public function lastInsertId($name = null) - { - return db2_last_insert_id($this->_conn); - } - - public function beginTransaction() - { - db2_autocommit($this->_conn, DB2_AUTOCOMMIT_OFF); - } - - public function commit() - { - if (!db2_commit($this->_conn)) { - throw new DB2Exception(db2_conn_errormsg($this->_conn)); - } - db2_autocommit($this->_conn, DB2_AUTOCOMMIT_ON); - } - - public function rollBack() - { - if (!db2_rollback($this->_conn)) { - throw new DB2Exception(db2_conn_errormsg($this->_conn)); - } - db2_autocommit($this->_conn, DB2_AUTOCOMMIT_ON); - } - - public function errorCode() - { - return db2_conn_error($this->_conn); - } - - public function errorInfo() - { - return array( - 0 => db2_conn_errormsg($this->_conn), - 1 => $this->errorCode(), - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Driver.php deleted file mode 100644 index d574b68..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Driver.php +++ /dev/null @@ -1,111 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Driver\IBMDB2; - -use Doctrine\DBAL\Driver, - Doctrine\DBAL\Connection; - -/** - * IBM DB2 Driver - * - * @since 2.0 - * @author Benjamin Eberlei - */ -class DB2Driver implements Driver -{ - /** - * Attempts to create a connection with the database. - * - * @param array $params All connection parameters passed by the user. - * @param string $username The username to use when connecting. - * @param string $password The password to use when connecting. - * @param array $driverOptions The driver options to use when connecting. - * @return Doctrine\DBAL\Driver\Connection The database connection. - */ - public function connect(array $params, $username = null, $password = null, array $driverOptions = array()) - { - if ( ! isset($params['protocol'])) { - $params['protocol'] = 'TCPIP'; - } - - if ($params['host'] !== 'localhost' && $params['host'] != '127.0.0.1') { - // if the host isn't localhost, use extended connection params - $params['dbname'] = 'DRIVER={IBM DB2 ODBC DRIVER}' . - ';DATABASE=' . $params['dbname'] . - ';HOSTNAME=' . $params['host'] . - ';PROTOCOL=' . $params['protocol'] . - ';UID=' . $username . - ';PWD=' . $password .';'; - if (isset($params['port'])) { - $params['dbname'] .= 'PORT=' . $params['port']; - } - - $username = null; - $password = null; - } - - return new DB2Connection($params, $username, $password, $driverOptions); - } - - /** - * Gets the DatabasePlatform instance that provides all the metadata about - * the platform this driver connects to. - * - * @return Doctrine\DBAL\Platforms\AbstractPlatform The database platform. - */ - public function getDatabasePlatform() - { - return new \Doctrine\DBAL\Platforms\DB2Platform; - } - - /** - * Gets the SchemaManager that can be used to inspect and change the underlying - * database schema of the platform this driver connects to. - * - * @param Doctrine\DBAL\Connection $conn - * @return Doctrine\DBAL\SchemaManager - */ - public function getSchemaManager(Connection $conn) - { - return new \Doctrine\DBAL\Schema\DB2SchemaManager($conn); - } - - /** - * Gets the name of the driver. - * - * @return string The name of the driver. - */ - public function getName() - { - return 'ibm_db2'; - } - - /** - * Get the name of the database connected to for this driver. - * - * @param Doctrine\DBAL\Connection $conn - * @return string $database - */ - public function getDatabase(\Doctrine\DBAL\Connection $conn) - { - $params = $conn->getParams(); - return $params['dbname']; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Exception.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Exception.php deleted file mode 100644 index 7a6cc41..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Exception.php +++ /dev/null @@ -1,27 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Driver\IBMDB2; - -class DB2Exception extends \Exception -{ - -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php deleted file mode 100644 index 27da2ee..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php +++ /dev/null @@ -1,215 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Driver\IBMDB2; - -use \Doctrine\DBAL\Driver\Statement; - -class DB2Statement implements \IteratorAggregate, Statement -{ - private $_stmt = null; - - private $_bindParam = array(); - - private $_defaultFetchStyle = \PDO::FETCH_BOTH; - - /** - * DB2_BINARY, DB2_CHAR, DB2_DOUBLE, or DB2_LONG - * @var array - */ - static private $_typeMap = array( - \PDO::PARAM_INT => DB2_LONG, - \PDO::PARAM_STR => DB2_CHAR, - ); - - public function __construct($stmt) - { - $this->_stmt = $stmt; - } - - /** - * {@inheritdoc} - */ - public function bindValue($param, $value, $type = null) - { - return $this->bindParam($param, $value, $type); - } - - /** - * {@inheritdoc} - */ - public function bindParam($column, &$variable, $type = null) - { - $this->_bindParam[$column] =& $variable; - - if ($type && isset(self::$_typeMap[$type])) { - $type = self::$_typeMap[$type]; - } else { - $type = DB2_CHAR; - } - - if (!db2_bind_param($this->_stmt, $column, "variable", DB2_PARAM_IN, $type)) { - throw new DB2Exception(db2_stmt_errormsg()); - } - return true; - } - - /** - * {@inheritdoc} - */ - public function closeCursor() - { - if (!$this->_stmt) { - return false; - } - - $this->_bindParam = array(); - db2_free_result($this->_stmt); - $ret = db2_free_stmt($this->_stmt); - $this->_stmt = false; - return $ret; - } - - /** - * {@inheritdoc} - */ - public function columnCount() - { - if (!$this->_stmt) { - return false; - } - return db2_num_fields($this->_stmt); - } - - /** - * {@inheritdoc} - */ - public function errorCode() - { - return db2_stmt_error(); - } - - /** - * {@inheritdoc} - */ - public function errorInfo() - { - return array( - 0 => db2_stmt_errormsg(), - 1 => db2_stmt_error(), - ); - } - - /** - * {@inheritdoc} - */ - public function execute($params = null) - { - if (!$this->_stmt) { - return false; - } - - /*$retval = true; - if ($params !== null) { - $retval = @db2_execute($this->_stmt, $params); - } else { - $retval = @db2_execute($this->_stmt); - }*/ - if ($params === null) { - ksort($this->_bindParam); - $params = array_values($this->_bindParam); - } - $retval = @db2_execute($this->_stmt, $params); - - if ($retval === false) { - throw new DB2Exception(db2_stmt_errormsg()); - } - return $retval; - } - - /** - * {@inheritdoc} - */ - public function setFetchMode($fetchStyle = \PDO::FETCH_BOTH, $arg2 = null, $arg3 = null) - { - $this->_defaultFetchStyle = $fetchStyle; - } - - /** - * {@inheritdoc} - */ - public function getIterator() - { - $data = $this->fetchAll($this->_defaultFetchStyle); - return new \ArrayIterator($data); - } - - /** - * {@inheritdoc} - */ - public function fetch($fetchStyle = null) - { - $fetchStyle = $fetchStyle ?: $this->_defaultFetchStyle; - switch ($fetchStyle) { - case \PDO::FETCH_BOTH: - return db2_fetch_both($this->_stmt); - case \PDO::FETCH_ASSOC: - return db2_fetch_assoc($this->_stmt); - case \PDO::FETCH_NUM: - return db2_fetch_array($this->_stmt); - default: - throw new DB2Exception("Given Fetch-Style " . $fetchStyle . " is not supported."); - } - } - - /** - * {@inheritdoc} - */ - public function fetchAll($fetchStyle = null) - { - $fetchStyle = $fetchStyle ?: $this->_defaultFetchStyle; - $rows = array(); - while ($row = $this->fetch($fetchStyle)) { - $rows[] = $row; - } - return $rows; - } - - /** - * {@inheritdoc} - */ - public function fetchColumn($columnIndex = 0) - { - $row = $this->fetch(\PDO::FETCH_NUM); - if ($row && isset($row[$columnIndex])) { - return $row[$columnIndex]; - } - return false; - } - - /** - * {@inheritdoc} - */ - public function rowCount() - { - return (@db2_num_rows($this->_stmt))?:0; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/Driver.php deleted file mode 100644 index b77de67..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/Driver.php +++ /dev/null @@ -1,69 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Driver\Mysqli; - -use Doctrine\DBAL\Driver as DriverInterface; - -/** - * @author Kim Hemsø Rasmussen - */ -class Driver implements DriverInterface -{ - /** - * {@inheritdoc} - */ - public function connect(array $params, $username = null, $password = null, array $driverOptions = array()) - { - return new MysqliConnection($params, $username, $password, $driverOptions); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'mysqli'; - } - - /** - * {@inheritdoc} - */ - public function getSchemaManager(\Doctrine\DBAL\Connection $conn) - { - return new \Doctrine\DBAL\Schema\MySqlSchemaManager($conn); - } - - /** - * {@inheritdoc} - */ - public function getDatabasePlatform() - { - return new \Doctrine\DBAL\Platforms\MySqlPlatform(); - } - - /** - * {@inheritdoc} - */ - public function getDatabase(\Doctrine\DBAL\Connection $conn) - { - $params = $conn->getParams(); - return $params['dbname']; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php deleted file mode 100644 index b69535b..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php +++ /dev/null @@ -1,146 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Driver\Mysqli; - -use Doctrine\DBAL\Driver\Connection as Connection; - -/** - * @author Kim Hemsø Rasmussen - */ -class MysqliConnection implements Connection -{ - /** - * @var \mysqli - */ - private $_conn; - - public function __construct(array $params, $username, $password, array $driverOptions = array()) - { - $port = isset($params['port']) ? $params['port'] : ini_get('mysqli.default_port'); - $socket = isset($params['unix_socket']) ? $params['unix_socket'] : ini_get('mysqli.default_socket'); - - $this->_conn = mysqli_init(); - if (!$this->_conn->real_connect($params['host'], $username, $password, $params['dbname'], $port, $socket)) { - throw new MysqliException($this->_conn->connect_error, $this->_conn->connect_errno); - } - - if (isset($params['charset'])) { - $this->_conn->set_charset($params['charset']); - } - } - - /** - * Retrieve mysqli native resource handle. - * - * Could be used if part of your application is not using DBAL - * - * @return mysqli - */ - public function getWrappedResourceHandle() - { - return $this->_conn; - } - - /** - * {@inheritdoc} - */ - public function prepare($prepareString) - { - return new MysqliStatement($this->_conn, $prepareString); - } - - /** - * {@inheritdoc} - */ - public function query() - { - $args = func_get_args(); - $sql = $args[0]; - $stmt = $this->prepare($sql); - $stmt->execute(); - return $stmt; - } - - /** - * {@inheritdoc} - */ - public function quote($input, $type=\PDO::PARAM_STR) - { - return "'". $this->_conn->escape_string($input) ."'"; - } - - /** - * {@inheritdoc} - */ - public function exec($statement) - { - $this->_conn->query($statement); - return $this->_conn->affected_rows; - } - - /** - * {@inheritdoc} - */ - public function lastInsertId($name = null) - { - return $this->_conn->insert_id; - } - - /** - * {@inheritdoc} - */ - public function beginTransaction() - { - $this->_conn->query('START TRANSACTION'); - return true; - } - - /** - * {@inheritdoc} - */ - public function commit() - { - return $this->_conn->commit(); - } - - /** - * {@inheritdoc}non-PHPdoc) - */ - public function rollBack() - { - return $this->_conn->rollback(); - } - - /** - * {@inheritdoc} - */ - public function errorCode() - { - return $this->_conn->errno; - } - - /** - * {@inheritdoc} - */ - public function errorInfo() - { - return $this->_conn->error; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliException.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliException.php deleted file mode 100644 index e59a803..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliException.php +++ /dev/null @@ -1,26 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Driver\Mysqli; - -/** - * @author Kim Hemsø Rasmussen - */ -class MysqliException extends \Exception -{} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php deleted file mode 100644 index d7f9703..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php +++ /dev/null @@ -1,335 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Driver\Mysqli; - -use Doctrine\DBAL\Driver\Statement; -use PDO; - -/** - * @author Kim Hemsø Rasmussen - */ -class MysqliStatement implements \IteratorAggregate, Statement -{ - protected static $_paramTypeMap = array( - PDO::PARAM_STR => 's', - PDO::PARAM_BOOL => 'i', - PDO::PARAM_NULL => 's', - PDO::PARAM_INT => 'i', - PDO::PARAM_LOB => 's' // TODO Support LOB bigger then max package size. - ); - - protected $_conn; - protected $_stmt; - - /** - * @var null|false|array - */ - protected $_columnNames; - - /** - * @var null|array - */ - protected $_rowBindedValues; - - /** - * @var array - */ - protected $_bindedValues; - - /** - * Contains ref values for bindValue() - * - * @var array - */ - protected $_values = array(); - - protected $_defaultFetchStyle = PDO::FETCH_BOTH; - - public function __construct(\mysqli $conn, $prepareString) - { - $this->_conn = $conn; - $this->_stmt = $conn->prepare($prepareString); - if (false === $this->_stmt) { - throw new MysqliException($this->_conn->error, $this->_conn->errno); - } - - $paramCount = $this->_stmt->param_count; - if (0 < $paramCount) { - // Index 0 is types - // Need to init the string else php think we are trying to access it as a array. - $bindedValues = array(0 => str_repeat('s', $paramCount)); - $null = null; - for ($i = 1; $i < $paramCount; $i++) { - $bindedValues[] =& $null; - } - $this->_bindedValues = $bindedValues; - } - } - - /** - * {@inheritdoc} - */ - public function bindParam($column, &$variable, $type = null) - { - if (null === $type) { - $type = 's'; - } else { - if (isset(self::$_paramTypeMap[$type])) { - $type = self::$_paramTypeMap[$type]; - } else { - throw new MysqliException("Unkown type: '{$type}'"); - } - } - - $this->_bindedValues[$column] =& $variable; - $this->_bindedValues[0][$column - 1] = 's'; - return true; - } - - /** - * {@inheritdoc} - */ - public function bindValue($param, $value, $type = null) - { - if (null === $type) { - $type = 's'; - } else { - if (isset(self::$_paramTypeMap[$type])) { - $type = self::$_paramTypeMap[$type]; - } else { - throw new MysqliException("Unknown type: '{$type}'"); - } - } - - $this->_values[$param] = $value; - $this->_bindedValues[$param] =& $this->_values[$param]; - $this->_bindedValues[0][$param - 1] = 's'; - return true; - } - - /** - * {@inheritdoc} - */ - public function execute($params = null) - { - if (null !== $this->_bindedValues) { - if (null !== $params) { - if (!$this->_bindValues($params)) { - throw new MysqliException($this->_stmt->error, $this->_stmt->errno); - } - } else { - if (!call_user_func_array(array($this->_stmt, 'bind_param'), $this->_bindedValues)) { - throw new MysqliException($this->_stmt->error, $this->_stmt->errno); - } - } - } - - if (!$this->_stmt->execute()) { - throw new MysqliException($this->_stmt->error, $this->_stmt->errno); - } - - if (null === $this->_columnNames) { - $meta = $this->_stmt->result_metadata(); - if (false !== $meta) { - $columnNames = array(); - foreach ($meta->fetch_fields() as $col) { - $columnNames[] = $col->name; - } - $meta->free(); - - $this->_columnNames = $columnNames; - $this->_rowBindedValues = array_fill(0, count($columnNames), NULL); - - $refs = array(); - foreach ($this->_rowBindedValues as $key => &$value) { - $refs[$key] =& $value; - } - - if (!call_user_func_array(array($this->_stmt, 'bind_result'), $refs)) { - throw new MysqliException($this->_stmt->error, $this->_stmt->errno); - } - } else { - $this->_columnNames = false; - } - } - - // We have a result. - if (false !== $this->_columnNames) { - $this->_stmt->store_result(); - } - return true; - } - - /** - * Bind a array of values to bound parameters - * - * @param array $values - * @return boolean - */ - private function _bindValues($values) - { - $params = array(); - $types = str_repeat('s', count($values)); - $params[0] = $types; - - foreach ($values as &$v) { - $params[] =& $v; - } - return call_user_func_array(array($this->_stmt, 'bind_param'), $params); - } - - /** - * @return null|false|array - */ - private function _fetch() - { - $ret = $this->_stmt->fetch(); - - if (true === $ret) { - $values = array(); - foreach ($this->_rowBindedValues as $v) { - // Mysqli converts them to a scalar type it can fit in. - $values[] = null === $v ? null : (string)$v; - } - return $values; - } - return $ret; - } - - /** - * {@inheritdoc} - */ - public function fetch($fetchStyle = null) - { - $values = $this->_fetch(); - if (null === $values) { - return null; - } - - if (false === $values) { - throw new MysqliException($this->_stmt->error, $this->_stmt->errno); - } - - $fetchStyle = $fetchStyle ?: $this->_defaultFetchStyle; - - switch ($fetchStyle) { - case PDO::FETCH_NUM: - return $values; - - case PDO::FETCH_ASSOC: - return array_combine($this->_columnNames, $values); - - case PDO::FETCH_BOTH: - $ret = array_combine($this->_columnNames, $values); - $ret += $values; - return $ret; - - default: - throw new MysqliException("Unknown fetch type '{$fetchStyle}'"); - } - } - - /** - * {@inheritdoc} - */ - public function fetchAll($fetchStyle = null) - { - $fetchStyle = $fetchStyle ?: $this->_defaultFetchStyle; - - $a = array(); - while (($row = $this->fetch($fetchStyle)) !== null) { - $a[] = $row; - } - return $a; - } - - /** - * {@inheritdoc} - */ - public function fetchColumn($columnIndex = 0) - { - $row = $this->fetch(PDO::FETCH_NUM); - if (null === $row) { - return false; - } - return $row[$columnIndex]; - } - - /** - * {@inheritdoc} - */ - public function errorCode() - { - return $this->_stmt->errno; - } - - /** - * {@inheritdoc} - */ - public function errorInfo() - { - return $this->_stmt->error; - } - - /** - * {@inheritdoc} - */ - public function closeCursor() - { - $this->_stmt->free_result(); - return true; - } - - /** - * {@inheritdoc} - */ - public function rowCount() - { - if (false === $this->_columnNames) { - return $this->_stmt->affected_rows; - } - return $this->_stmt->num_rows; - } - - /** - * {@inheritdoc} - */ - public function columnCount() - { - return $this->_stmt->field_count; - } - - /** - * {@inheritdoc} - */ - public function setFetchMode($fetchMode = PDO::FETCH_BOTH, $arg2 = null, $arg3 = null) - { - $this->_defaultFetchStyle = $fetchMode; - } - - /** - * {@inheritdoc} - */ - public function getIterator() - { - $data = $this->fetchAll($this->_defaultFetchStyle); - return new \ArrayIterator($data); - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/Driver.php deleted file mode 100644 index 650ad9b..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/Driver.php +++ /dev/null @@ -1,95 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Driver\OCI8; - -use Doctrine\DBAL\Platforms; - -/** - * A Doctrine DBAL driver for the Oracle OCI8 PHP extensions. - * - * @author Roman Borschel - * @since 2.0 - */ -class Driver implements \Doctrine\DBAL\Driver -{ - public function connect(array $params, $username = null, $password = null, array $driverOptions = array()) - { - return new OCI8Connection( - $username, - $password, - $this->_constructDsn($params), - isset($params['charset']) ? $params['charset'] : null, - isset($params['sessionMode']) ? $params['sessionMode'] : OCI_DEFAULT - ); - } - - /** - * Constructs the Oracle DSN. - * - * @return string The DSN. - */ - protected function _constructDsn(array $params) - { - $dsn = ''; - if (isset($params['host']) && $params['host'] != '') { - $dsn .= '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)' . - '(HOST=' . $params['host'] . ')'; - - if (isset($params['port'])) { - $dsn .= '(PORT=' . $params['port'] . ')'; - } else { - $dsn .= '(PORT=1521)'; - } - - if (isset($params['service']) && $params['service'] == true) { - $dsn .= '))(CONNECT_DATA=(SERVICE_NAME=' . $params['dbname'] . ')))'; - } else { - $dsn .= '))(CONNECT_DATA=(SID=' . $params['dbname'] . ')))'; - } - } else { - $dsn .= $params['dbname']; - } - - return $dsn; - } - - public function getDatabasePlatform() - { - return new \Doctrine\DBAL\Platforms\OraclePlatform(); - } - - public function getSchemaManager(\Doctrine\DBAL\Connection $conn) - { - return new \Doctrine\DBAL\Schema\OracleSchemaManager($conn); - } - - public function getName() - { - return 'oci8'; - } - - public function getDatabase(\Doctrine\DBAL\Connection $conn) - { - $params = $conn->getParams(); - return $params['user']; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php deleted file mode 100644 index f00ffaf..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php +++ /dev/null @@ -1,172 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Driver\OCI8; - -/** - * OCI8 implementation of the Connection interface. - * - * @since 2.0 - */ -class OCI8Connection implements \Doctrine\DBAL\Driver\Connection -{ - protected $_dbh; - - protected $_executeMode = OCI_COMMIT_ON_SUCCESS; - - /** - * Create a Connection to an Oracle Database using oci8 extension. - * - * @param string $username - * @param string $password - * @param string $db - */ - public function __construct($username, $password, $db, $charset = null, $sessionMode = OCI_DEFAULT) - { - if (!defined('OCI_NO_AUTO_COMMIT')) { - define('OCI_NO_AUTO_COMMIT', 0); - } - - $this->_dbh = @oci_connect($username, $password, $db, $charset, $sessionMode); - if (!$this->_dbh) { - throw OCI8Exception::fromErrorInfo(oci_error()); - } - } - - /** - * Create a non-executed prepared statement. - * - * @param string $prepareString - * @return OCI8Statement - */ - public function prepare($prepareString) - { - return new OCI8Statement($this->_dbh, $prepareString, $this); - } - - /** - * @param string $sql - * @return OCI8Statement - */ - public function query() - { - $args = func_get_args(); - $sql = $args[0]; - //$fetchMode = $args[1]; - $stmt = $this->prepare($sql); - $stmt->execute(); - return $stmt; - } - - /** - * Quote input value. - * - * @param mixed $input - * @param int $type PDO::PARAM* - * @return mixed - */ - public function quote($value, $type=\PDO::PARAM_STR) - { - if (is_int($value) || is_float($value)) { - return $value; - } - $value = str_replace("'", "''", $value); - return "'" . addcslashes($value, "\000\n\r\\\032") . "'"; - } - - /** - * - * @param string $statement - * @return int - */ - public function exec($statement) - { - $stmt = $this->prepare($statement); - $stmt->execute(); - return $stmt->rowCount(); - } - - public function lastInsertId($name = null) - { - //TODO: throw exception or support sequences? - } - - /** - * Return the current execution mode. - */ - public function getExecuteMode() - { - return $this->_executeMode; - } - - /** - * Start a transactiom - * - * Oracle has to explicitly set the autocommit mode off. That means - * after connection, a commit or rollback there is always automatically - * opened a new transaction. - * - * @return bool - */ - public function beginTransaction() - { - $this->_executeMode = OCI_NO_AUTO_COMMIT; - return true; - } - - /** - * @throws OCI8Exception - * @return bool - */ - public function commit() - { - if (!oci_commit($this->_dbh)) { - throw OCI8Exception::fromErrorInfo($this->errorInfo()); - } - $this->_executeMode = OCI_COMMIT_ON_SUCCESS; - return true; - } - - /** - * @throws OCI8Exception - * @return bool - */ - public function rollBack() - { - if (!oci_rollback($this->_dbh)) { - throw OCI8Exception::fromErrorInfo($this->errorInfo()); - } - $this->_executeMode = OCI_COMMIT_ON_SUCCESS; - return true; - } - - public function errorCode() - { - $error = oci_error($this->_dbh); - if ($error !== false) { - $error = $error['code']; - } - return $error; - } - - public function errorInfo() - { - return oci_error($this->_dbh); - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php deleted file mode 100644 index 66fe615..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php +++ /dev/null @@ -1,30 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Driver\OCI8; - -class OCI8Exception extends \Exception -{ - static public function fromErrorInfo($error) - { - return new self($error['message'], $error['code']); - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php deleted file mode 100644 index 677b684..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php +++ /dev/null @@ -1,258 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Driver\OCI8; - -use PDO; -use IteratorAggregate; -use Doctrine\DBAL\Driver\Statement; - -/** - * The OCI8 implementation of the Statement interface. - * - * @since 2.0 - * @author Roman Borschel - */ -class OCI8Statement implements \IteratorAggregate, Statement -{ - /** Statement handle. */ - protected $_dbh; - protected $_sth; - protected $_conn; - protected static $_PARAM = ':param'; - protected static $fetchStyleMap = array( - PDO::FETCH_BOTH => OCI_BOTH, - PDO::FETCH_ASSOC => OCI_ASSOC, - PDO::FETCH_NUM => OCI_NUM, - PDO::PARAM_LOB => OCI_B_BLOB, - ); - protected $_defaultFetchStyle = PDO::FETCH_BOTH; - protected $_paramMap = array(); - - /** - * Creates a new OCI8Statement that uses the given connection handle and SQL statement. - * - * @param resource $dbh The connection handle. - * @param string $statement The SQL statement. - */ - public function __construct($dbh, $statement, OCI8Connection $conn) - { - list($statement, $paramMap) = self::convertPositionalToNamedPlaceholders($statement); - $this->_sth = oci_parse($dbh, $statement); - $this->_dbh = $dbh; - $this->_paramMap = $paramMap; - $this->_conn = $conn; - } - - /** - * Convert positional (?) into named placeholders (:param) - * - * Oracle does not support positional parameters, hence this method converts all - * positional parameters into artificially named parameters. Note that this conversion - * is not perfect. All question marks (?) in the original statement are treated as - * placeholders and converted to a named parameter. - * - * The algorithm uses a state machine with two possible states: InLiteral and NotInLiteral. - * Question marks inside literal strings are therefore handled correctly by this method. - * This comes at a cost, the whole sql statement has to be looped over. - * - * @todo extract into utility class in Doctrine\DBAL\Util namespace - * @todo review and test for lost spaces. we experienced missing spaces with oci8 in some sql statements. - * @param string $statement The SQL statement to convert. - * @return string - */ - static public function convertPositionalToNamedPlaceholders($statement) - { - $count = 1; - $inLiteral = false; // a valid query never starts with quotes - $stmtLen = strlen($statement); - $paramMap = array(); - for ($i = 0; $i < $stmtLen; $i++) { - if ($statement[$i] == '?' && !$inLiteral) { - // real positional parameter detected - $paramMap[$count] = ":param$count"; - $len = strlen($paramMap[$count]); - $statement = substr_replace($statement, ":param$count", $i, 1); - $i += $len-1; // jump ahead - $stmtLen = strlen($statement); // adjust statement length - ++$count; - } else if ($statement[$i] == "'" || $statement[$i] == '"') { - $inLiteral = ! $inLiteral; // switch state! - } - } - - return array($statement, $paramMap); - } - - /** - * {@inheritdoc} - */ - public function bindValue($param, $value, $type = null) - { - return $this->bindParam($param, $value, $type); - } - - /** - * {@inheritdoc} - */ - public function bindParam($column, &$variable, $type = null) - { - $column = isset($this->_paramMap[$column]) ? $this->_paramMap[$column] : $column; - - if ($type == \PDO::PARAM_LOB) { - $lob = oci_new_descriptor($this->_dbh, OCI_D_LOB); - $lob->writeTemporary($variable, OCI_TEMP_BLOB); - - return oci_bind_by_name($this->_sth, $column, $lob, -1, OCI_B_BLOB); - } else { - return oci_bind_by_name($this->_sth, $column, $variable); - } - } - - /** - * Closes the cursor, enabling the statement to be executed again. - * - * @return boolean Returns TRUE on success or FALSE on failure. - */ - public function closeCursor() - { - return oci_free_statement($this->_sth); - } - - /** - * {@inheritdoc} - */ - public function columnCount() - { - return oci_num_fields($this->_sth); - } - - /** - * {@inheritdoc} - */ - public function errorCode() - { - $error = oci_error($this->_sth); - if ($error !== false) { - $error = $error['code']; - } - return $error; - } - - /** - * {@inheritdoc} - */ - public function errorInfo() - { - return oci_error($this->_sth); - } - - /** - * {@inheritdoc} - */ - public function execute($params = null) - { - if ($params) { - $hasZeroIndex = array_key_exists(0, $params); - foreach ($params as $key => $val) { - if ($hasZeroIndex && is_numeric($key)) { - $this->bindValue($key + 1, $val); - } else { - $this->bindValue($key, $val); - } - } - } - - $ret = @oci_execute($this->_sth, $this->_conn->getExecuteMode()); - if ( ! $ret) { - throw OCI8Exception::fromErrorInfo($this->errorInfo()); - } - return $ret; - } - - /** - * {@inheritdoc} - */ - public function setFetchMode($fetchStyle = PDO::FETCH_BOTH, $arg2 = null, $arg3 = null) - { - $this->_defaultFetchStyle = $fetchStyle; - } - - /** - * {@inheritdoc} - */ - public function getIterator() - { - $data = $this->fetchAll($this->_defaultFetchStyle); - return new \ArrayIterator($data); - } - - /** - * {@inheritdoc} - */ - public function fetch($fetchStyle = null) - { - $fetchStyle = $fetchStyle ?: $this->_defaultFetchStyle; - if ( ! isset(self::$fetchStyleMap[$fetchStyle])) { - throw new \InvalidArgumentException("Invalid fetch style: " . $fetchStyle); - } - - return oci_fetch_array($this->_sth, self::$fetchStyleMap[$fetchStyle] | OCI_RETURN_NULLS | OCI_RETURN_LOBS); - } - - /** - * {@inheritdoc} - */ - public function fetchAll($fetchStyle = null) - { - $fetchStyle = $fetchStyle ?: $this->_defaultFetchStyle; - if ( ! isset(self::$fetchStyleMap[$fetchStyle])) { - throw new \InvalidArgumentException("Invalid fetch style: " . $fetchStyle); - } - - $result = array(); - if (self::$fetchStyleMap[$fetchStyle] === OCI_BOTH) { - while ($row = $this->fetch($fetchStyle)) { - $result[] = $row; - } - } else { - oci_fetch_all($this->_sth, $result, 0, -1, - self::$fetchStyleMap[$fetchStyle] | OCI_RETURN_NULLS | OCI_FETCHSTATEMENT_BY_ROW | OCI_RETURN_LOBS); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function fetchColumn($columnIndex = 0) - { - $row = oci_fetch_array($this->_sth, OCI_NUM | OCI_RETURN_NULLS | OCI_RETURN_LOBS); - return isset($row[$columnIndex]) ? $row[$columnIndex] : false; - } - - /** - * {@inheritdoc} - */ - public function rowCount() - { - return oci_num_rows($this->_sth); - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php deleted file mode 100644 index f006807..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php +++ /dev/null @@ -1,40 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Driver; - -use \PDO; - -/** - * PDO implementation of the Connection interface. - * Used by all PDO-based drivers. - * - * @since 2.0 - */ -class PDOConnection extends PDO implements Connection -{ - public function __construct($dsn, $user = null, $password = null, array $options = null) - { - parent::__construct($dsn, $user, $password, $options); - $this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('Doctrine\DBAL\Driver\PDOStatement', array())); - $this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOIbm/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOIbm/Driver.php deleted file mode 100644 index 844f2ab..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOIbm/Driver.php +++ /dev/null @@ -1,126 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Driver\PDOIbm; - -use Doctrine\DBAL\Connection; - -/** - * Driver for the PDO IBM extension - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 1.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class Driver implements \Doctrine\DBAL\Driver -{ - /** - * Attempts to establish a connection with the underlying driver. - * - * @param array $params - * @param string $username - * @param string $password - * @param array $driverOptions - * @return Doctrine\DBAL\Driver\Connection - */ - public function connect(array $params, $username = null, $password = null, array $driverOptions = array()) - { - $conn = new \Doctrine\DBAL\Driver\PDOConnection( - $this->_constructPdoDsn($params), - $username, - $password, - $driverOptions - ); - return $conn; - } - - /** - * Constructs the MySql PDO DSN. - * - * @return string The DSN. - */ - private function _constructPdoDsn(array $params) - { - $dsn = 'ibm:'; - if (isset($params['host'])) { - $dsn .= 'HOSTNAME=' . $params['host'] . ';'; - } - if (isset($params['port'])) { - $dsn .= 'PORT=' . $params['port'] . ';'; - } - $dsn .= 'PROTOCOL=TCPIP;'; - if (isset($params['dbname'])) { - $dsn .= 'DATABASE=' . $params['dbname'] . ';'; - } - - return $dsn; - } - - /** - * Gets the DatabasePlatform instance that provides all the metadata about - * the platform this driver connects to. - * - * @return Doctrine\DBAL\Platforms\AbstractPlatform The database platform. - */ - public function getDatabasePlatform() - { - return new \Doctrine\DBAL\Platforms\DB2Platform; - } - - /** - * Gets the SchemaManager that can be used to inspect and change the underlying - * database schema of the platform this driver connects to. - * - * @param Doctrine\DBAL\Connection $conn - * @return Doctrine\DBAL\SchemaManager - */ - public function getSchemaManager(Connection $conn) - { - return new \Doctrine\DBAL\Schema\DB2SchemaManager($conn); - } - - /** - * Gets the name of the driver. - * - * @return string The name of the driver. - */ - public function getName() - { - return 'pdo_ibm'; - } - - /** - * Get the name of the database connected to for this driver. - * - * @param Doctrine\DBAL\Connection $conn - * @return string $database - */ - public function getDatabase(\Doctrine\DBAL\Connection $conn) - { - $params = $conn->getParams(); - return $params['dbname']; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php deleted file mode 100644 index cb2df85..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php +++ /dev/null @@ -1,102 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Driver\PDOMySql; - -use Doctrine\DBAL\Connection; - -/** - * PDO MySql driver. - * - * @since 2.0 - */ -class Driver implements \Doctrine\DBAL\Driver -{ - /** - * Attempts to establish a connection with the underlying driver. - * - * @param array $params - * @param string $username - * @param string $password - * @param array $driverOptions - * @return Doctrine\DBAL\Driver\Connection - */ - public function connect(array $params, $username = null, $password = null, array $driverOptions = array()) - { - $conn = new \Doctrine\DBAL\Driver\PDOConnection( - $this->_constructPdoDsn($params), - $username, - $password, - $driverOptions - ); - return $conn; - } - - /** - * Constructs the MySql PDO DSN. - * - * @return string The DSN. - */ - private function _constructPdoDsn(array $params) - { - $dsn = 'mysql:'; - if (isset($params['host']) && $params['host'] != '') { - $dsn .= 'host=' . $params['host'] . ';'; - } - if (isset($params['port'])) { - $dsn .= 'port=' . $params['port'] . ';'; - } - if (isset($params['dbname'])) { - $dsn .= 'dbname=' . $params['dbname'] . ';'; - } - if (isset($params['unix_socket'])) { - $dsn .= 'unix_socket=' . $params['unix_socket'] . ';'; - } - if (isset($params['charset'])) { - $dsn .= 'charset=' . $params['charset'] . ';'; - } - - return $dsn; - } - - public function getDatabasePlatform() - { - return new \Doctrine\DBAL\Platforms\MySqlPlatform(); - } - - public function getSchemaManager(\Doctrine\DBAL\Connection $conn) - { - return new \Doctrine\DBAL\Schema\MySqlSchemaManager($conn); - } - - public function getName() - { - return 'pdo_mysql'; - } - - public function getDatabase(\Doctrine\DBAL\Connection $conn) - { - $params = $conn->getParams(); - - if (isset($params['dbname'])) { - return $params['dbname']; - } - return $conn->query('SELECT DATABASE()')->fetchColumn(); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php deleted file mode 100644 index 1f007c1..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php +++ /dev/null @@ -1,98 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Driver\PDOOracle; - -use Doctrine\DBAL\Platforms; - -/** - * PDO Oracle driver - * - * WARNING: This driver gives us segfauls in our testsuites on CLOB and other - * stuff. PDO Oracle is not maintained by Oracle or anyone in the PHP community, - * which leads us to the recommendation to use the "oci8" driver to connect - * to Oracle instead. - */ -class Driver implements \Doctrine\DBAL\Driver -{ - public function connect(array $params, $username = null, $password = null, array $driverOptions = array()) - { - return new \Doctrine\DBAL\Driver\PDOConnection( - $this->_constructPdoDsn($params), - $username, - $password, - $driverOptions - ); - } - - /** - * Constructs the Oracle PDO DSN. - * - * @return string The DSN. - */ - private function _constructPdoDsn(array $params) - { - $dsn = 'oci:'; - if (isset($params['host'])) { - $dsn .= 'dbname=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)' . - '(HOST=' . $params['host'] . ')'; - - if (isset($params['port'])) { - $dsn .= '(PORT=' . $params['port'] . ')'; - } else { - $dsn .= '(PORT=1521)'; - } - - if (isset($params['service']) && $params['service'] == true) { - $dsn .= '))(CONNECT_DATA=(SERVICE_NAME=' . $params['dbname'] . ')))'; - } else { - $dsn .= '))(CONNECT_DATA=(SID=' . $params['dbname'] . ')))'; - } - } else { - $dsn .= 'dbname=' . $params['dbname']; - } - - if (isset($params['charset'])) { - $dsn .= ';charset=' . $params['charset']; - } - - return $dsn; - } - - public function getDatabasePlatform() - { - return new \Doctrine\DBAL\Platforms\OraclePlatform(); - } - - public function getSchemaManager(\Doctrine\DBAL\Connection $conn) - { - return new \Doctrine\DBAL\Schema\OracleSchemaManager($conn); - } - - public function getName() - { - return 'pdo_oracle'; - } - - public function getDatabase(\Doctrine\DBAL\Connection $conn) - { - $params = $conn->getParams(); - return $params['user']; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php deleted file mode 100644 index 247eb8f..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php +++ /dev/null @@ -1,70 +0,0 @@ -_constructPdoDsn($params), - $username, - $password, - $driverOptions - ); - } - - /** - * Constructs the Postgres PDO DSN. - * - * @return string The DSN. - */ - private function _constructPdoDsn(array $params) - { - $dsn = 'pgsql:'; - if (isset($params['host']) && $params['host'] != '') { - $dsn .= 'host=' . $params['host'] . ' '; - } - if (isset($params['port']) && $params['port'] != '') { - $dsn .= 'port=' . $params['port'] . ' '; - } - if (isset($params['dbname'])) { - $dsn .= 'dbname=' . $params['dbname'] . ' '; - } - - return $dsn; - } - - public function getDatabasePlatform() - { - return new \Doctrine\DBAL\Platforms\PostgreSqlPlatform(); - } - - public function getSchemaManager(\Doctrine\DBAL\Connection $conn) - { - return new \Doctrine\DBAL\Schema\PostgreSqlSchemaManager($conn); - } - - public function getName() - { - return 'pdo_pgsql'; - } - - public function getDatabase(\Doctrine\DBAL\Connection $conn) - { - $params = $conn->getParams(); - return $params['dbname']; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php deleted file mode 100644 index e13526a..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php +++ /dev/null @@ -1,116 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Driver\PDOSqlite; - -/** - * The PDO Sqlite driver. - * - * @since 2.0 - */ -class Driver implements \Doctrine\DBAL\Driver -{ - /** - * @var array - */ - protected $_userDefinedFunctions = array( - 'sqrt' => array('callback' => array('Doctrine\DBAL\Platforms\SqlitePlatform', 'udfSqrt'), 'numArgs' => 1), - 'mod' => array('callback' => array('Doctrine\DBAL\Platforms\SqlitePlatform', 'udfMod'), 'numArgs' => 2), - 'locate' => array('callback' => array('Doctrine\DBAL\Platforms\SqlitePlatform', 'udfLocate'), 'numArgs' => -1), - ); - - /** - * Tries to establish a database connection to SQLite. - * - * @param array $params - * @param string $username - * @param string $password - * @param array $driverOptions - * @return Connection - */ - public function connect(array $params, $username = null, $password = null, array $driverOptions = array()) - { - if (isset($driverOptions['userDefinedFunctions'])) { - $this->_userDefinedFunctions = array_merge( - $this->_userDefinedFunctions, $driverOptions['userDefinedFunctions']); - unset($driverOptions['userDefinedFunctions']); - } - - $pdo = new \Doctrine\DBAL\Driver\PDOConnection( - $this->_constructPdoDsn($params), - $username, - $password, - $driverOptions - ); - - foreach ($this->_userDefinedFunctions AS $fn => $data) { - $pdo->sqliteCreateFunction($fn, $data['callback'], $data['numArgs']); - } - - return $pdo; - } - - /** - * Constructs the Sqlite PDO DSN. - * - * @return string The DSN. - * @override - */ - protected function _constructPdoDsn(array $params) - { - $dsn = 'sqlite:'; - if (isset($params['path'])) { - $dsn .= $params['path']; - } else if (isset($params['memory'])) { - $dsn .= ':memory:'; - } - - return $dsn; - } - - /** - * Gets the database platform that is relevant for this driver. - */ - public function getDatabasePlatform() - { - return new \Doctrine\DBAL\Platforms\SqlitePlatform(); - } - - /** - * Gets the schema manager that is relevant for this driver. - * - * @param Doctrine\DBAL\Connection $conn - * @return Doctrine\DBAL\Schema\SqliteSchemaManager - */ - public function getSchemaManager(\Doctrine\DBAL\Connection $conn) - { - return new \Doctrine\DBAL\Schema\SqliteSchemaManager($conn); - } - - public function getName() - { - return 'pdo_sqlite'; - } - - public function getDatabase(\Doctrine\DBAL\Connection $conn) - { - $params = $conn->getParams(); - return isset($params['path']) ? $params['path'] : null; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php deleted file mode 100644 index ba8aaf0..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php +++ /dev/null @@ -1,45 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Driver\PDOSqlsrv; - -/** - * Sqlsrv Connection implementation. - * - * @since 2.0 - */ -class Connection extends \Doctrine\DBAL\Driver\PDOConnection implements \Doctrine\DBAL\Driver\Connection -{ - /** - * @override - */ - public function quote($value, $type=\PDO::PARAM_STR) - { - $val = parent::quote($value, $type); - - // Fix for a driver version terminating all values with null byte - if (strpos($val, "\0") !== false) { - $val = substr($val, 0, -1); - } - - return $val; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Driver.php deleted file mode 100644 index d3c6bf1..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Driver.php +++ /dev/null @@ -1,88 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Driver\PDOSqlsrv; - -/** - * The PDO-based Sqlsrv driver. - * - * @since 2.0 - */ -class Driver implements \Doctrine\DBAL\Driver -{ - public function connect(array $params, $username = null, $password = null, array $driverOptions = array()) - { - return new Connection( - $this->_constructPdoDsn($params), - $username, - $password, - $driverOptions - ); - } - - /** - * Constructs the Sqlsrv PDO DSN. - * - * @return string The DSN. - */ - private function _constructPdoDsn(array $params) - { - $dsn = 'sqlsrv:server='; - - if (isset($params['host'])) { - $dsn .= $params['host']; - } - - if (isset($params['port']) && !empty($params['port'])) { - $dsn .= ',' . $params['port']; - } - - if (isset($params['dbname'])) {; - $dsn .= ';Database=' . $params['dbname']; - } - - if (isset($params['MultipleActiveResultSets'])) { - $dsn .= '; MultipleActiveResultSets=' . ($params['MultipleActiveResultSets'] ? 'true' : 'false'); - } - - return $dsn; - } - - - public function getDatabasePlatform() - { - return new \Doctrine\DBAL\Platforms\SQLServer2008Platform(); - } - - public function getSchemaManager(\Doctrine\DBAL\Connection $conn) - { - return new \Doctrine\DBAL\Schema\SQLServerSchemaManager($conn); - } - - public function getName() - { - return 'pdo_sqlsrv'; - } - - public function getDatabase(\Doctrine\DBAL\Connection $conn) - { - $params = $conn->getParams(); - return $params['dbname']; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php deleted file mode 100644 index 6456af7..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php +++ /dev/null @@ -1,50 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Driver; - -/** - * The PDO implementation of the Statement interface. - * Used by all PDO-based drivers. - * - * @since 2.0 - */ -class PDOStatement extends \PDOStatement implements Statement -{ - private function __construct() {} - - public function setFetchMode($fetchStyle, $arg2 = null, $arg3 = null) - { - // This thin wrapper is necessary to shield against the weird signature - // of PDOStatement::setFetchMode(): even if the second and third - // parameters are optional, PHP will not let us remove it from this - // declaration. - if ($arg2 === null && $arg3 === null) { - return parent::setFetchMode($fetchStyle); - } - - if ($arg3 === null) { - return parent::setFetchMode($fetchStyle, $arg2); - } - - return parent::setFetchMode($fetchStyle, $arg2, $arg3); - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/ResultStatement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/ResultStatement.php deleted file mode 100644 index ef5eb02..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/ResultStatement.php +++ /dev/null @@ -1,113 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Driver; - -use PDO; - -/** - * Interface for the reading part of a prepare statement only. - * - * @author Benjamin Eberlei - */ -interface ResultStatement extends \Traversable -{ - /** - * Closes the cursor, enabling the statement to be executed again. - * - * @return boolean Returns TRUE on success or FALSE on failure. - */ - function closeCursor(); - - - /** - * columnCount - * Returns the number of columns in the result set - * - * @return integer Returns the number of columns in the result set represented - * by the PDOStatement object. If there is no result set, - * this method should return 0. - */ - function columnCount(); - - /** - * setFetchMode - * Set the fetch mode to use while iterating this statement. - * - * @param integer $fetchStyle - */ - function setFetchMode($fetchStyle, $arg2 = null, $arg3 = null); - - /** - * fetch - * - * @see Query::HYDRATE_* constants - * @param integer $fetchStyle Controls how the next row will be returned to the caller. - * This value must be one of the Query::HYDRATE_* constants, - * defaulting to Query::HYDRATE_BOTH - * - * @param integer $cursorOrientation For a PDOStatement object representing a scrollable cursor, - * this value determines which row will be returned to the caller. - * This value must be one of the Query::HYDRATE_ORI_* constants, defaulting to - * Query::HYDRATE_ORI_NEXT. To request a scrollable cursor for your - * PDOStatement object, - * you must set the PDO::ATTR_CURSOR attribute to Doctrine::CURSOR_SCROLL when you - * prepare the SQL statement with Doctrine_Adapter_Interface->prepare(). - * - * @param integer $cursorOffset For a PDOStatement object representing a scrollable cursor for which the - * $cursorOrientation parameter is set to Query::HYDRATE_ORI_ABS, this value specifies - * the absolute number of the row in the result set that shall be fetched. - * - * For a PDOStatement object representing a scrollable cursor for - * which the $cursorOrientation parameter is set to Query::HYDRATE_ORI_REL, this value - * specifies the row to fetch relative to the cursor position before - * PDOStatement->fetch() was called. - * - * @return mixed - */ - function fetch($fetchStyle = PDO::FETCH_BOTH); - - /** - * Returns an array containing all of the result set rows - * - * @param integer $fetchStyle Controls how the next row will be returned to the caller. - * This value must be one of the Query::HYDRATE_* constants, - * defaulting to Query::HYDRATE_BOTH - * - * @param integer $columnIndex Returns the indicated 0-indexed column when the value of $fetchStyle is - * Query::HYDRATE_COLUMN. Defaults to 0. - * - * @return array - */ - function fetchAll($fetchStyle = PDO::FETCH_BOTH); - - /** - * fetchColumn - * Returns a single column from the next row of a - * result set or FALSE if there are no more rows. - * - * @param integer $columnIndex 0-indexed number of the column you wish to retrieve from the row. If no - * value is supplied, PDOStatement->fetchColumn() - * fetches the first column. - * - * @return string returns a single column in the next row of a result set. - */ - function fetchColumn($columnIndex = 0); -} - diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Statement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Statement.php deleted file mode 100644 index d417833..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Statement.php +++ /dev/null @@ -1,124 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Driver; - -use \PDO; - -/** - * Statement interface. - * Drivers must implement this interface. - * - * This resembles (a subset of) the PDOStatement interface. - * - * @author Konsta Vesterinen - * @author Roman Borschel - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - */ -interface Statement extends ResultStatement -{ - /** - * Binds a value to a corresponding named or positional - * placeholder in the SQL statement that was used to prepare the statement. - * - * @param mixed $param Parameter identifier. For a prepared statement using named placeholders, - * this will be a parameter name of the form :name. For a prepared statement - * using question mark placeholders, this will be the 1-indexed position of the parameter - * - * @param mixed $value The value to bind to the parameter. - * @param integer $type Explicit data type for the parameter using the PDO::PARAM_* constants. - * - * @return boolean Returns TRUE on success or FALSE on failure. - */ - function bindValue($param, $value, $type = null); - - /** - * Binds a PHP variable to a corresponding named or question mark placeholder in the - * SQL statement that was use to prepare the statement. Unlike PDOStatement->bindValue(), - * the variable is bound as a reference and will only be evaluated at the time - * that PDOStatement->execute() is called. - * - * Most parameters are input parameters, that is, parameters that are - * used in a read-only fashion to build up the query. Some drivers support the invocation - * of stored procedures that return data as output parameters, and some also as input/output - * parameters that both send in data and are updated to receive it. - * - * @param mixed $param Parameter identifier. For a prepared statement using named placeholders, - * this will be a parameter name of the form :name. For a prepared statement - * using question mark placeholders, this will be the 1-indexed position of the parameter - * - * @param mixed $variable Name of the PHP variable to bind to the SQL statement parameter. - * - * @param integer $type Explicit data type for the parameter using the PDO::PARAM_* constants. To return - * an INOUT parameter from a stored procedure, use the bitwise OR operator to set the - * PDO::PARAM_INPUT_OUTPUT bits for the data_type parameter. - * @return boolean Returns TRUE on success or FALSE on failure. - */ - function bindParam($column, &$variable, $type = null); - - /** - * errorCode - * Fetch the SQLSTATE associated with the last operation on the statement handle - * - * @see Doctrine_Adapter_Interface::errorCode() - * @return string error code string - */ - function errorCode(); - - /** - * errorInfo - * Fetch extended error information associated with the last operation on the statement handle - * - * @see Doctrine_Adapter_Interface::errorInfo() - * @return array error info array - */ - function errorInfo(); - - /** - * Executes a prepared statement - * - * If the prepared statement included parameter markers, you must either: - * call PDOStatement->bindParam() to bind PHP variables to the parameter markers: - * bound variables pass their value as input and receive the output value, - * if any, of their associated parameter markers or pass an array of input-only - * parameter values - * - * - * @param array $params An array of values with as many elements as there are - * bound parameters in the SQL statement being executed. - * @return boolean Returns TRUE on success or FALSE on failure. - */ - function execute($params = null); - - /** - * rowCount - * rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement - * executed by the corresponding object. - * - * If the last SQL statement executed by the associated Statement object was a SELECT statement, - * some databases may return the number of rows returned by that statement. However, - * this behaviour is not guaranteed for all databases and should not be - * relied on for portable applications. - * - * @return integer Returns the number of rows. - */ - function rowCount(); -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php deleted file mode 100644 index b670ee5..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php +++ /dev/null @@ -1,165 +0,0 @@ -. - */ - -namespace Doctrine\DBAL; - -use Doctrine\Common\EventManager; - -/** - * Factory for creating Doctrine\DBAL\Connection instances. - * - * @author Roman Borschel - * @since 2.0 - */ -final class DriverManager -{ - /** - * List of supported drivers and their mappings to the driver classes. - * - * @var array - * @todo REMOVE. Users should directly supply class names instead. - */ - private static $_driverMap = array( - 'pdo_mysql' => 'Doctrine\DBAL\Driver\PDOMySql\Driver', - 'pdo_sqlite' => 'Doctrine\DBAL\Driver\PDOSqlite\Driver', - 'pdo_pgsql' => 'Doctrine\DBAL\Driver\PDOPgSql\Driver', - 'pdo_oci' => 'Doctrine\DBAL\Driver\PDOOracle\Driver', - 'oci8' => 'Doctrine\DBAL\Driver\OCI8\Driver', - 'ibm_db2' => 'Doctrine\DBAL\Driver\IBMDB2\DB2Driver', - 'pdo_ibm' => 'Doctrine\DBAL\Driver\PDOIbm\Driver', - 'pdo_sqlsrv' => 'Doctrine\DBAL\Driver\PDOSqlsrv\Driver', - 'mysqli' => 'Doctrine\DBAL\Driver\Mysqli\Driver', - ); - - /** Private constructor. This class cannot be instantiated. */ - private function __construct() { } - - /** - * Creates a connection object based on the specified parameters. - * This method returns a Doctrine\DBAL\Connection which wraps the underlying - * driver connection. - * - * $params must contain at least one of the following. - * - * Either 'driver' with one of the following values: - * pdo_mysql - * pdo_sqlite - * pdo_pgsql - * pdo_oracle - * pdo_sqlsrv - * - * OR 'driverClass' that contains the full class name (with namespace) of the - * driver class to instantiate. - * - * Other (optional) parameters: - * - * user (string): - * The username to use when connecting. - * - * password (string): - * The password to use when connecting. - * - * driverOptions (array): - * Any additional driver-specific options for the driver. These are just passed - * through to the driver. - * - * pdo: - * You can pass an existing PDO instance through this parameter. The PDO - * instance will be wrapped in a Doctrine\DBAL\Connection. - * - * wrapperClass: - * You may specify a custom wrapper class through the 'wrapperClass' - * parameter but this class MUST inherit from Doctrine\DBAL\Connection. - * - * driverClass: - * The driver class to use. - * - * @param array $params The parameters. - * @param Doctrine\DBAL\Configuration The configuration to use. - * @param Doctrine\Common\EventManager The event manager to use. - * @return Doctrine\DBAL\Connection - */ - public static function getConnection( - array $params, - Configuration $config = null, - EventManager $eventManager = null) - { - // create default config and event manager, if not set - if ( ! $config) { - $config = new Configuration(); - } - if ( ! $eventManager) { - $eventManager = new EventManager(); - } - - // check for existing pdo object - if (isset($params['pdo']) && ! $params['pdo'] instanceof \PDO) { - throw DBALException::invalidPdoInstance(); - } else if (isset($params['pdo'])) { - $params['pdo']->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); - $params['driver'] = 'pdo_' . $params['pdo']->getAttribute(\PDO::ATTR_DRIVER_NAME); - } else { - self::_checkParams($params); - } - if (isset($params['driverClass'])) { - $className = $params['driverClass']; - } else { - $className = self::$_driverMap[$params['driver']]; - } - - $driver = new $className(); - - $wrapperClass = 'Doctrine\DBAL\Connection'; - if (isset($params['wrapperClass'])) { - if (is_subclass_of($params['wrapperClass'], $wrapperClass)) { - $wrapperClass = $params['wrapperClass']; - } else { - throw DBALException::invalidWrapperClass($params['wrapperClass']); - } - } - - return new $wrapperClass($params, $driver, $config, $eventManager); - } - - /** - * Checks the list of parameters. - * - * @param array $params - */ - private static function _checkParams(array $params) - { - // check existance of mandatory parameters - - // driver - if ( ! isset($params['driver']) && ! isset($params['driverClass'])) { - throw DBALException::driverRequired(); - } - - // check validity of parameters - - // driver - if ( isset($params['driver']) && ! isset(self::$_driverMap[$params['driver']])) { - throw DBALException::unknownDriver($params['driver'], array_keys(self::$_driverMap)); - } - - if (isset($params['driverClass']) && ! in_array('Doctrine\DBAL\Driver', class_implements($params['driverClass'], true))) { - throw DBALException::invalidDriverClass($params['driverClass']); - } - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/ConnectionEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/ConnectionEventArgs.php deleted file mode 100644 index ce80ecd..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/ConnectionEventArgs.php +++ /dev/null @@ -1,79 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Event; - -use Doctrine\Common\EventArgs, - Doctrine\DBAL\Connection; - -/** - * Event Arguments used when a Driver connection is established inside Doctrine\DBAL\Connection. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 1.0 - * @version $Revision$ - * @author Benjamin Eberlei - */ -class ConnectionEventArgs extends EventArgs -{ - /** - * @var Connection - */ - private $_connection = null; - - public function __construct(Connection $connection) - { - $this->_connection = $connection; - } - - /** - * @return Doctrine\DBAL\Connection - */ - public function getConnection() - { - return $this->_connection; - } - - /** - * @return Doctrine\DBAL\Driver - */ - public function getDriver() - { - return $this->_connection->getDriver(); - } - - /** - * @return Doctrine\DBAL\Platforms\AbstractPlatform - */ - public function getDatabasePlatform() - { - return $this->_connection->getDatabasePlatform(); - } - - /** - * @return Doctrine\DBAL\Schema\AbstractSchemaManager - */ - public function getSchemaManager() - { - return $this->_connection->getSchemaManager(); - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/MysqlSessionInit.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/MysqlSessionInit.php deleted file mode 100644 index a9718d5..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/MysqlSessionInit.php +++ /dev/null @@ -1,74 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Event\Listeners; - -use Doctrine\DBAL\Event\ConnectionEventArgs; -use Doctrine\DBAL\Events; -use Doctrine\Common\EventSubscriber; - -/** - * MySQL Session Init Event Subscriber which allows to set the Client Encoding of the Connection - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 1.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @deprecated Use "charset" option to PDO MySQL Connection instead. - */ -class MysqlSessionInit implements EventSubscriber -{ - /** - * @var string - */ - private $_charset; - - /** - * @var string - */ - private $_collation; - - /** - * Configure Charset and Collation options of MySQL Client for each Connection - * - * @param string $charset - * @param string $collation - */ - public function __construct($charset = 'utf8', $collation = false) - { - $this->_charset = $charset; - $this->_collation = $collation; - } - - /** - * @param ConnectionEventArgs $args - * @return void - */ - public function postConnect(ConnectionEventArgs $args) - { - $collation = ($this->_collation) ? " COLLATE ".$this->_collation : ""; - $args->getConnection()->executeUpdate("SET NAMES ".$this->_charset . $collation); - } - - public function getSubscribedEvents() - { - return array(Events::postConnect); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php deleted file mode 100644 index 7f5caa3..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php +++ /dev/null @@ -1,79 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Event\Listeners; - -use Doctrine\DBAL\Event\ConnectionEventArgs; -use Doctrine\DBAL\Events; -use Doctrine\Common\EventSubscriber; - -/** - * Should be used when Oracle Server default enviroment does not match the Doctrine requirements. - * - * The following enviroment variables are required for the Doctrine default date format: - * - * NLS_TIME_FORMAT="HH24:MI:SS" - * NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS" - * NLS_TIMESTAMP_FORMAT="YYYY-MM-DD HH24:MI:SS" - * NLS_TIMESTAMP_TZ_FORMAT="YYYY-MM-DD HH24:MI:SS TZH:TZM" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.0 - * @author Benjamin Eberlei - */ -class OracleSessionInit implements EventSubscriber -{ - protected $_defaultSessionVars = array( - 'NLS_TIME_FORMAT' => "HH24:MI:SS", - 'NLS_DATE_FORMAT' => "YYYY-MM-DD HH24:MI:SS", - 'NLS_TIMESTAMP_FORMAT' => "YYYY-MM-DD HH24:MI:SS", - 'NLS_TIMESTAMP_TZ_FORMAT' => "YYYY-MM-DD HH24:MI:SS TZH:TZM", - ); - - /** - * @param array $oracleSessionVars - */ - public function __construct(array $oracleSessionVars = array()) - { - $this->_defaultSessionVars = array_merge($this->_defaultSessionVars, $oracleSessionVars); - } - - /** - * @param ConnectionEventArgs $args - * @return void - */ - public function postConnect(ConnectionEventArgs $args) - { - if (count($this->_defaultSessionVars)) { - array_change_key_case($this->_defaultSessionVars, \CASE_UPPER); - $vars = array(); - foreach ($this->_defaultSessionVars AS $option => $value) { - $vars[] = $option." = '".$value."'"; - } - $sql = "ALTER SESSION SET ".implode(" ", $vars); - $args->getConnection()->executeUpdate($sql); - } - } - - public function getSubscribedEvents() - { - return array(Events::postConnect); - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/SQLSessionInit.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/SQLSessionInit.php deleted file mode 100644 index 670a61e..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/SQLSessionInit.php +++ /dev/null @@ -1,63 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Event\Listeners; - -use Doctrine\DBAL\Event\ConnectionEventArgs; -use Doctrine\DBAL\Events; -use Doctrine\Common\EventSubscriber; - -/** - * Session init listener for executing a single SQL statement right after a connection is opened. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.2 - * @author Benjamin Eberlei - */ -class SQLSessionInit implements EventSubscriber -{ - /** - * @var string - */ - protected $sql; - - /** - * @param string $sql - */ - public function __construct($sql) - { - $this->sql = $sql; - } - - /** - * @param ConnectionEventArgs $args - * @return void - */ - public function postConnect(ConnectionEventArgs $args) - { - $conn = $args->getConnection(); - $conn->exec($this->sql); - } - - public function getSubscribedEvents() - { - return array(Events::postConnect); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableAddColumnEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableAddColumnEventArgs.php deleted file mode 100644 index 453f942..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableAddColumnEventArgs.php +++ /dev/null @@ -1,114 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Event; - -use Doctrine\DBAL\Platforms\AbstractPlatform, - Doctrine\DBAL\Schema\Column, - Doctrine\DBAL\Schema\TableDiff; - -/** - * Event Arguments used when SQL queries for adding table columns are generated inside Doctrine\DBAL\Platform\*Platform. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.2 - * @author Jan Sorgalla - */ -class SchemaAlterTableAddColumnEventArgs extends SchemaEventArgs -{ - /** - * @var \Doctrine\DBAL\Schema\Column - */ - private $_column = null; - - /** - * @var \Doctrine\DBAL\Schema\TableDiff - */ - private $_tableDiff = null; - - /** - * @var \Doctrine\DBAL\Platforms\AbstractPlatform - */ - private $_platform = null; - - /** - * @var array - */ - private $_sql = array(); - - /** - * @param \Doctrine\DBAL\Schema\Column $column - * @param \Doctrine\DBAL\Schema\TableDiff $tableDiff - * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform - */ - public function __construct(Column $column, TableDiff $tableDiff, AbstractPlatform $platform) - { - $this->_column = $column; - $this->_tableDiff = $tableDiff; - $this->_platform = $platform; - } - - /** - * @return \Doctrine\DBAL\Schema\Column - */ - public function getColumn() - { - return $this->_column; - } - - /** - * @return \Doctrine\DBAL\Schema\TableDiff - */ - public function getTableDiff() - { - return $this->_tableDiff; - } - - /** - * @return \Doctrine\DBAL\Platforms\AbstractPlatform - */ - public function getPlatform() - { - return $this->_platform; - } - - /** - * @param string|array $sql - * @return \Doctrine\DBAL\Event\SchemaAlterTableAddColumnEventArgs - */ - public function addSql($sql) - { - if (is_array($sql)) { - $this->_sql = array_merge($this->_sql, $sql); - } else { - $this->_sql[] = $sql; - } - - return $this; - } - - /** - * @return array - */ - public function getSql() - { - return $this->_sql; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableChangeColumnEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableChangeColumnEventArgs.php deleted file mode 100644 index 180fbee..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableChangeColumnEventArgs.php +++ /dev/null @@ -1,114 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Event; - -use Doctrine\DBAL\Platforms\AbstractPlatform, - Doctrine\DBAL\Schema\ColumnDiff, - Doctrine\DBAL\Schema\TableDiff; - -/** - * Event Arguments used when SQL queries for changing table columns are generated inside Doctrine\DBAL\Platform\*Platform. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.2 - * @author Jan Sorgalla - */ -class SchemaAlterTableChangeColumnEventArgs extends SchemaEventArgs -{ - /** - * @var \Doctrine\DBAL\Schema\ColumnDiff - */ - private $_columnDiff = null; - - /** - * @var \Doctrine\DBAL\Schema\TableDiff - */ - private $_tableDiff = null; - - /** - * @var \Doctrine\DBAL\Platforms\AbstractPlatform - */ - private $_platform = null; - - /** - * @var array - */ - private $_sql = array(); - - /** - * @param \Doctrine\DBAL\Schema\ColumnDiff $columnDiff - * @param \Doctrine\DBAL\Schema\TableDiff $tableDiff - * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform - */ - public function __construct(ColumnDiff $columnDiff, TableDiff $tableDiff, AbstractPlatform $platform) - { - $this->_columnDiff = $columnDiff; - $this->_tableDiff = $tableDiff; - $this->_platform = $platform; - } - - /** - * @return \Doctrine\DBAL\Schema\ColumnDiff - */ - public function getColumnDiff() - { - return $this->_columnDiff; - } - - /** - * @return \Doctrine\DBAL\Schema\TableDiff - */ - public function getTableDiff() - { - return $this->_tableDiff; - } - - /** - * @return \Doctrine\DBAL\Platforms\AbstractPlatform - */ - public function getPlatform() - { - return $this->_platform; - } - - /** - * @param string|array $sql - * @return \Doctrine\DBAL\Event\SchemaAlterTableChangeColumnEventArgs - */ - public function addSql($sql) - { - if (is_array($sql)) { - $this->_sql = array_merge($this->_sql, $sql); - } else { - $this->_sql[] = $sql; - } - - return $this; - } - - /** - * @return array - */ - public function getSql() - { - return $this->_sql; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableEventArgs.php deleted file mode 100644 index 0f9a0a5..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableEventArgs.php +++ /dev/null @@ -1,99 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Event; - -use Doctrine\DBAL\Platforms\AbstractPlatform, - Doctrine\DBAL\Schema\Column, - Doctrine\DBAL\Schema\TableDiff; - -/** - * Event Arguments used when SQL queries for creating tables are generated inside Doctrine\DBAL\Platform\*Platform. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.2 - * @author Jan Sorgalla - */ -class SchemaAlterTableEventArgs extends SchemaEventArgs -{ - /** - * @var \Doctrine\DBAL\Schema\TableDiff - */ - private $_tableDiff = null; - - /** - * @var \Doctrine\DBAL\Platforms\AbstractPlatform - */ - private $_platform = null; - - /** - * @var array - */ - private $_sql = array(); - - /** - * @param \Doctrine\DBAL\Schema\TableDiff $tableDiff - * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform - */ - public function __construct(TableDiff $tableDiff, AbstractPlatform $platform) - { - $this->_tableDiff = $tableDiff; - $this->_platform = $platform; - } - - /** - * @return \Doctrine\DBAL\Schema\TableDiff - */ - public function getTableDiff() - { - return $this->_tableDiff; - } - - /** - * @return \Doctrine\DBAL\Platforms\AbstractPlatform - */ - public function getPlatform() - { - return $this->_platform; - } - - /** - * @param string|array $sql - * @return \Doctrine\DBAL\Event\SchemaAlterTableEventArgs - */ - public function addSql($sql) - { - if (is_array($sql)) { - $this->_sql = array_merge($this->_sql, $sql); - } else { - $this->_sql[] = $sql; - } - - return $this; - } - - /** - * @return array - */ - public function getSql() - { - return $this->_sql; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableRemoveColumnEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableRemoveColumnEventArgs.php deleted file mode 100644 index b64bbc1..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableRemoveColumnEventArgs.php +++ /dev/null @@ -1,114 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Event; - -use Doctrine\DBAL\Platforms\AbstractPlatform, - Doctrine\DBAL\Schema\Column, - Doctrine\DBAL\Schema\TableDiff; - -/** - * Event Arguments used when SQL queries for removing table columns are generated inside Doctrine\DBAL\Platform\*Platform. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.2 - * @author Jan Sorgalla - */ -class SchemaAlterTableRemoveColumnEventArgs extends SchemaEventArgs -{ - /** - * @var \Doctrine\DBAL\Schema\Column - */ - private $_column = null; - - /** - * @var \Doctrine\DBAL\Schema\TableDiff - */ - private $_tableDiff = null; - - /** - * @var \Doctrine\DBAL\Platforms\AbstractPlatform - */ - private $_platform = null; - - /** - * @var array - */ - private $_sql = array(); - - /** - * @param \Doctrine\DBAL\Schema\Column $column - * @param \Doctrine\DBAL\Schema\TableDiff $tableDiff - * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform - */ - public function __construct(Column $column, TableDiff $tableDiff, AbstractPlatform $platform) - { - $this->_column = $column; - $this->_tableDiff = $tableDiff; - $this->_platform = $platform; - } - - /** - * @return \Doctrine\DBAL\Schema\Column - */ - public function getColumn() - { - return $this->_column; - } - - /** - * @return \Doctrine\DBAL\Schema\TableDiff - */ - public function getTableDiff() - { - return $this->_tableDiff; - } - - /** - * @return \Doctrine\DBAL\Platforms\AbstractPlatform - */ - public function getPlatform() - { - return $this->_platform; - } - - /** - * @param string|array $sql - * @return \Doctrine\DBAL\Event\SchemaAlterTableRemoveColumnEventArgs - */ - public function addSql($sql) - { - if (is_array($sql)) { - $this->_sql = array_merge($this->_sql, $sql); - } else { - $this->_sql[] = $sql; - } - - return $this; - } - - /** - * @return array - */ - public function getSql() - { - return $this->_sql; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableRenameColumnEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableRenameColumnEventArgs.php deleted file mode 100644 index 4b9a88b..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableRenameColumnEventArgs.php +++ /dev/null @@ -1,129 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Event; - -use Doctrine\DBAL\Platforms\AbstractPlatform, - Doctrine\DBAL\Schema\Column, - Doctrine\DBAL\Schema\TableDiff; - -/** - * Event Arguments used when SQL queries for renaming table columns are generated inside Doctrine\DBAL\Platform\*Platform. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.2 - * @author Jan Sorgalla - */ -class SchemaAlterTableRenameColumnEventArgs extends SchemaEventArgs -{ - /** - * @var string - */ - private $_oldColumnName = null; - - /** - * @var \Doctrine\DBAL\Schema\Column - */ - private $_column = null; - - /** - * @var \Doctrine\DBAL\Schema\TableDiff - */ - private $_tableDiff = null; - - /** - * @var \Doctrine\DBAL\Platforms\AbstractPlatform - */ - private $_platform = null; - - /** - * @var array - */ - private $_sql = array(); - - /** - * @param string $oldColumnName - * @param \Doctrine\DBAL\Schema\Column $column - * @param \Doctrine\DBAL\Schema\TableDiff $tableDiff - * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform - */ - public function __construct($oldColumnName, Column $column, TableDiff $tableDiff, AbstractPlatform $platform) - { - $this->_oldColumnName = $oldColumnName; - $this->_column = $column; - $this->_tableDiff = $tableDiff; - $this->_platform = $platform; - } - - /** - * @return string - */ - public function getOldColumnName() - { - return $this->_oldColumnName; - } - - /** - * @return \Doctrine\DBAL\Schema\Column - */ - public function getColumn() - { - return $this->_column; - } - - /** - * @return \Doctrine\DBAL\Schema\TableDiff - */ - public function getTableDiff() - { - return $this->_tableDiff; - } - - /** - * @return \Doctrine\DBAL\Platforms\AbstractPlatform - */ - public function getPlatform() - { - return $this->_platform; - } - - /** - * @param string|array $sql - * @return \Doctrine\DBAL\Event\SchemaAlterTableRenameColumnEventArgs - */ - public function addSql($sql) - { - if (is_array($sql)) { - $this->_sql = array_merge($this->_sql, $sql); - } else { - $this->_sql[] = $sql; - } - - return $this; - } - - /** - * @return array - */ - public function getSql() - { - return $this->_sql; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaColumnDefinitionEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaColumnDefinitionEventArgs.php deleted file mode 100644 index 4cde46c..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaColumnDefinitionEventArgs.php +++ /dev/null @@ -1,137 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Event; - -use Doctrine\DBAL\Connection, - Doctrine\DBAL\Schema\Column; - -/** - * Event Arguments used when the portable column definition is generated inside Doctrine\DBAL\Schema\AbstractSchemaManager. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.2 - * @author Jan Sorgalla - */ -class SchemaColumnDefinitionEventArgs extends SchemaEventArgs -{ - /** - * @var \Doctrine\DBAL\Schema\Column - */ - private $_column = null; - - /** - * Raw column data as fetched from the database - * - * @var array - */ - private $_tableColumn = null; - - /** - * @var string - */ - private $_table = null; - - /** - * @var string - */ - private $_database = null; - - /** - * @var \Doctrine\DBAL\Connection - */ - private $_connection = null; - - /** - * @param array $tableColumn - * @param string $table - * @param string $database - * @param \Doctrine\DBAL\Connection $conn - */ - public function __construct(array $tableColumn, $table, $database, Connection $connection) - { - $this->_tableColumn = $tableColumn; - $this->_table = $table; - $this->_database = $database; - $this->_connection = $connection; - } - - /** - * Allows to clear the column which means the column will be excluded from - * tables column list. - * - * @param null|\Doctrine\DBAL\Schema\Column $column - * @return SchemaColumnDefinitionEventArgs - */ - public function setColumn(Column $column = null) - { - $this->_column = $column; - - return $this; - } - - /** - * @return \Doctrine\DBAL\Schema\Column - */ - public function getColumn() - { - return $this->_column; - } - - /** - * @return array - */ - public function getTableColumn() - { - return $this->_tableColumn; - } - - /** - * @return string - */ - public function getTable() - { - return $this->_table; - } - - /** - * @return string - */ - public function getDatabase() - { - return $this->_database; - } - - /** - * @return \Doctrine\DBAL\Connection - */ - public function getConnection() - { - return $this->_connection; - } - - /** - * @return \Doctrine\DBAL\Platforms\AbstractPlatform - */ - public function getDatabasePlatform() - { - return $this->_connection->getDatabasePlatform(); - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaCreateTableColumnEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaCreateTableColumnEventArgs.php deleted file mode 100644 index 5e9a440..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaCreateTableColumnEventArgs.php +++ /dev/null @@ -1,114 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Event; - -use Doctrine\DBAL\Platforms\AbstractPlatform, - Doctrine\DBAL\Schema\Column, - Doctrine\DBAL\Schema\Table; - -/** - * Event Arguments used when SQL queries for creating table columns are generated inside Doctrine\DBAL\Platform\AbstractPlatform. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.2 - * @author Jan Sorgalla - */ -class SchemaCreateTableColumnEventArgs extends SchemaEventArgs -{ - /** - * @var \Doctrine\DBAL\Schema\Column - */ - private $_column = null; - - /** - * @var \Doctrine\DBAL\Schema\Table - */ - private $_table = null; - - /** - * @var \Doctrine\DBAL\Platforms\AbstractPlatform - */ - private $_platform = null; - - /** - * @var array - */ - private $_sql = array(); - - /** - * @param \Doctrine\DBAL\Schema\Column $column - * @param \Doctrine\DBAL\Schema\Table $table - * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform - */ - public function __construct(Column $column, Table $table, AbstractPlatform $platform) - { - $this->_column = $column; - $this->_table = $table; - $this->_platform = $platform; - } - - /** - * @return \Doctrine\DBAL\Schema\Column - */ - public function getColumn() - { - return $this->_column; - } - - /** - * @return \Doctrine\DBAL\Schema\Table - */ - public function getTable() - { - return $this->_table; - } - - /** - * @return \Doctrine\DBAL\Platforms\AbstractPlatform - */ - public function getPlatform() - { - return $this->_platform; - } - - /** - * @param string|array $sql - * @return \Doctrine\DBAL\Event\SchemaCreateTableColumnEventArgs - */ - public function addSql($sql) - { - if (is_array($sql)) { - $this->_sql = array_merge($this->_sql, $sql); - } else { - $this->_sql[] = $sql; - } - - return $this; - } - - /** - * @return array - */ - public function getSql() - { - return $this->_sql; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaCreateTableEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaCreateTableEventArgs.php deleted file mode 100644 index 138981c..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaCreateTableEventArgs.php +++ /dev/null @@ -1,128 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Event; - -use Doctrine\DBAL\Platforms\AbstractPlatform, - Doctrine\DBAL\Schema\Table; - -/** - * Event Arguments used when SQL queries for creating tables are generated inside Doctrine\DBAL\Platform\AbstractPlatform. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.2 - * @author Jan Sorgalla - */ -class SchemaCreateTableEventArgs extends SchemaEventArgs -{ - /** - * @var \Doctrine\DBAL\Schema\Table - */ - private $_table = null; - - /** - * @var array - */ - private $_columns = null; - - /** - * @var array - */ - private $_options = null; - - /** - * @var \Doctrine\DBAL\Platforms\AbstractPlatform - */ - private $_platform = null; - - /** - * @var array - */ - private $_sql = array(); - - /** - * @param \Doctrine\DBAL\Schema\Table $table - * @param array $columns - * @param array $options - * @param Doctrine\DBAL\Platforms\AbstractPlatform $platform - */ - public function __construct(Table $table, array $columns, array $options, AbstractPlatform $platform) - { - $this->_table = $table; - $this->_columns = $columns; - $this->_options = $options; - $this->_platform = $platform; - } - - /** - * @return \Doctrine\DBAL\Schema\Table - */ - public function getTable() - { - return $this->_table; - } - - /** - * @return array - */ - public function getColumns() - { - return $this->_columns; - } - - /** - * @return array - */ - public function getOptions() - { - return $this->_options; - } - - /** - * @return \Doctrine\DBAL\Platforms\AbstractPlatform - */ - public function getPlatform() - { - return $this->_platform; - } - - /** - * @param string|array $sql - * @return \Doctrine\DBAL\Event\SchemaCreateTableEventArgs - */ - public function addSql($sql) - { - if (is_array($sql)) { - $this->_sql = array_merge($this->_sql, $sql); - } else { - $this->_sql[] = $sql; - } - - return $this; - } - - /** - * @return array - */ - public function getSql() - { - return $this->_sql; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaDropTableEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaDropTableEventArgs.php deleted file mode 100644 index ebd2163..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaDropTableEventArgs.php +++ /dev/null @@ -1,98 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Event; - -use Doctrine\DBAL\Platforms\AbstractPlatform, - Doctrine\DBAL\Schema\Table; - -/** - * Event Arguments used when the SQL query for dropping tables are generated inside Doctrine\DBAL\Platform\AbstractPlatform. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.2 - * @author Jan Sorgalla - */ -class SchemaDropTableEventArgs extends SchemaEventArgs -{ - /** - * @var string|\Doctrine\DBAL\Schema\Table - */ - private $_table = null; - - /** - * @var \Doctrine\DBAL\Platforms\AbstractPlatform - */ - private $_platform = null; - - /** - * @var string - */ - private $_sql = null; - - /** - * @param string|\Doctrine\DBAL\Schema\Table $table - * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform - */ - public function __construct($table, AbstractPlatform $platform) - { - if (!$table instanceof Table && !is_string($table)) { - throw new \InvalidArgumentException('SchemaCreateTableEventArgs expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'); - } - - $this->_table = $table; - $this->_platform = $platform; - } - - /** - * @return string|\Doctrine\DBAL\Schema\Table - */ - public function getTable() - { - return $this->_table; - } - - /** - * @return \Doctrine\DBAL\Platforms\AbstractPlatform - */ - public function getPlatform() - { - return $this->_platform; - } - - /** - * @param string $sql - * @return \Doctrine\DBAL\Event\SchemaDropTableEventArgs - */ - public function setSql($sql) - { - $this->_sql = $sql; - - return $this; - } - - /** - * @return string - */ - public function getSql() - { - return $this->_sql; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaEventArgs.php deleted file mode 100644 index 8181225..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaEventArgs.php +++ /dev/null @@ -1,56 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Event; - -use Doctrine\Common\EventArgs; - -/** - * Base class for schema related events. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.2 - * @author Jan Sorgalla - */ -class SchemaEventArgs extends EventArgs -{ - /** - * @var boolean - */ - private $_preventDefault = false; - - /** - * @return \Doctrine\DBAL\Event\SchemaEventArgs - */ - public function preventDefault() - { - $this->_preventDefault = true; - - return $this; - } - - /** - * @return boolean - */ - public function isDefaultPrevented() - { - return $this->_preventDefault; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaIndexDefinitionEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaIndexDefinitionEventArgs.php deleted file mode 100644 index 9eb95af..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaIndexDefinitionEventArgs.php +++ /dev/null @@ -1,122 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Event; - -use Doctrine\DBAL\Connection, - Doctrine\DBAL\Schema\Index; - -/** - * Event Arguments used when the portable index definition is generated inside Doctrine\DBAL\Schema\AbstractSchemaManager. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.2 - * @author Jan Sorgalla - */ -class SchemaIndexDefinitionEventArgs extends SchemaEventArgs -{ - /** - * @var \Doctrine\DBAL\Schema\Index - */ - private $_index = null; - - /** - * Raw index data as fetched from the database - * - * @var array - */ - private $_tableIndex = null; - - /** - * @var string - */ - private $_table = null; - - /** - * @var \Doctrine\DBAL\Connection - */ - private $_connection = null; - - /** - * @param array $tableIndex - * @param string $table - * @param \Doctrine\DBAL\Connection $conn - */ - public function __construct(array $tableIndex, $table, Connection $connection) - { - $this->_tableIndex = $tableIndex; - $this->_table = $table; - $this->_connection = $connection; - } - - /** - * Allows to clear the index which means the index will be excluded from - * tables index list. - * - * @param null|\Doctrine\DBAL\Schema\Index $index - * @return SchemaIndexDefinitionEventArgs - */ - public function setIndex(Index $index = null) - { - $this->_index = $index; - - return $this; - } - - /** - * @return \Doctrine\DBAL\Schema\Index - */ - public function getIndex() - { - return $this->_index; - } - - /** - * @return array - */ - public function getTableIndex() - { - return $this->_tableIndex; - } - - /** - * @return string - */ - public function getTable() - { - return $this->_table; - } - - /** - * @return \Doctrine\DBAL\Connection - */ - public function getConnection() - { - return $this->_connection; - } - - /** - * @return \Doctrine\DBAL\Platforms\AbstractPlatform - */ - public function getDatabasePlatform() - { - return $this->_connection->getDatabasePlatform(); - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Events.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Events.php deleted file mode 100644 index 25e31f0..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Events.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\DBAL; - -/** - * Container for all DBAL events. - * - * This class cannot be instantiated. - * - * @author Roman Borschel - * @since 2.0 - */ -final class Events -{ - private function __construct() {} - - const postConnect = 'postConnect'; - - const onSchemaCreateTable = 'onSchemaCreateTable'; - const onSchemaCreateTableColumn = 'onSchemaCreateTableColumn'; - const onSchemaDropTable = 'onSchemaDropTable'; - const onSchemaAlterTable = 'onSchemaAlterTable'; - const onSchemaAlterTableAddColumn = 'onSchemaAlterTableAddColumn'; - const onSchemaAlterTableRemoveColumn = 'onSchemaAlterTableRemoveColumn'; - const onSchemaAlterTableChangeColumn = 'onSchemaAlterTableChangeColumn'; - const onSchemaAlterTableRenameColumn = 'onSchemaAlterTableRenameColumn'; - const onSchemaColumnDefinition = 'onSchemaColumnDefinition'; - const onSchemaIndexDefinition = 'onSchemaIndexDefinition'; -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/LockMode.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/LockMode.php deleted file mode 100644 index dff96de..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/LockMode.php +++ /dev/null @@ -1,42 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL; - -/** - * Contains all DBAL LockModes - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 1.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Roman Borschel - */ -class LockMode -{ - const NONE = 0; - const OPTIMISTIC = 1; - const PESSIMISTIC_READ = 2; - const PESSIMISTIC_WRITE = 4; - - final private function __construct() { } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/DebugStack.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/DebugStack.php deleted file mode 100644 index 7dca159..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/DebugStack.php +++ /dev/null @@ -1,67 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Logging; - -/** - * Includes executed SQLs in a Debug Stack - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class DebugStack implements SQLLogger -{ - /** @var array $queries Executed SQL queries. */ - public $queries = array(); - - /** @var boolean $enabled If Debug Stack is enabled (log queries) or not. */ - public $enabled = true; - - public $start = null; - - public $currentQuery = 0; - - /** - * {@inheritdoc} - */ - public function startQuery($sql, array $params = null, array $types = null) - { - if ($this->enabled) { - $this->start = microtime(true); - $this->queries[++$this->currentQuery] = array('sql' => $sql, 'params' => $params, 'types' => $types, 'executionMS' => 0); - } - } - - /** - * {@inheritdoc} - */ - public function stopQuery() - { - $this->queries[$this->currentQuery]['executionMS'] = microtime(true) - $this->start; - } -} - diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/EchoSQLLogger.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/EchoSQLLogger.php deleted file mode 100644 index 2c3caf2..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/EchoSQLLogger.php +++ /dev/null @@ -1,61 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Logging; - -/** - * A SQL logger that logs to the standard output using echo/var_dump. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class EchoSQLLogger implements SQLLogger -{ - /** - * {@inheritdoc} - */ - public function startQuery($sql, array $params = null, array $types = null) - { - echo $sql . PHP_EOL; - - if ($params) { - var_dump($params); - } - - if ($types) { - var_dump($types); - } - } - - /** - * {@inheritdoc} - */ - public function stopQuery() - { - - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/LoggerChain.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/LoggerChain.php deleted file mode 100644 index 0711c9b..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/LoggerChain.php +++ /dev/null @@ -1,64 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Logging; - -/** - * Chains multiple SQLLogger - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.2 - * @author Christophe Coevoet - */ -class LoggerChain implements SQLLogger -{ - private $loggers = array(); - - /** - * Adds a logger in the chain - * - * @param SQLLogger $logger - */ - public function addLogger(SQLLogger $logger) - { - $this->loggers[] = $logger; - } - - /** - * {@inheritdoc} - */ - public function startQuery($sql, array $params = null, array $types = null) - { - foreach ($this->loggers as $logger) { - $logger->startQuery($sql, $params, $types); - } - } - - /** - * {@inheritdoc} - */ - public function stopQuery() - { - foreach ($this->loggers as $logger) { - $logger->stopQuery(); - } - } -} - diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/SQLLogger.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/SQLLogger.php deleted file mode 100644 index 6fccb6a..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/SQLLogger.php +++ /dev/null @@ -1,54 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Logging; - -/** - * Interface for SQL loggers. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -interface SQLLogger -{ - /** - * Logs a SQL statement somewhere. - * - * @param string $sql The SQL to be executed. - * @param array $params The SQL parameters. - * @param array $types The SQL parameter types. - * @return void - */ - public function startQuery($sql, array $params = null, array $types = null); - - /** - * Mark the last started query as stopped. This can be used for timing of queries. - * - * @return void - */ - public function stopQuery(); -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php deleted file mode 100644 index 7f5024d..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php +++ /dev/null @@ -1,2645 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Platforms; - -use Doctrine\DBAL\DBALException, - Doctrine\DBAL\Connection, - Doctrine\DBAL\Types, - Doctrine\DBAL\Schema\Table, - Doctrine\DBAL\Schema\Index, - Doctrine\DBAL\Schema\ForeignKeyConstraint, - Doctrine\DBAL\Schema\TableDiff, - Doctrine\DBAL\Schema\Column, - Doctrine\DBAL\Schema\ColumnDiff, - Doctrine\DBAL\Types\Type, - Doctrine\DBAL\Events, - Doctrine\Common\EventManager, - Doctrine\DBAL\Event\SchemaCreateTableEventArgs, - Doctrine\DBAL\Event\SchemaCreateTableColumnEventArgs, - Doctrine\DBAL\Event\SchemaDropTableEventArgs, - Doctrine\DBAL\Event\SchemaAlterTableEventArgs, - Doctrine\DBAL\Event\SchemaAlterTableAddColumnEventArgs, - Doctrine\DBAL\Event\SchemaAlterTableRemoveColumnEventArgs, - Doctrine\DBAL\Event\SchemaAlterTableChangeColumnEventArgs, - Doctrine\DBAL\Event\SchemaAlterTableRenameColumnEventArgs; - -/** - * Base class for all DatabasePlatforms. The DatabasePlatforms are the central - * point of abstraction of platform-specific behaviors, features and SQL dialects. - * They are a passive source of information. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Lukas Smith (PEAR MDB2 library) - * @author Benjamin Eberlei - * @todo Remove any unnecessary methods. - */ -abstract class AbstractPlatform -{ - /** - * @var int - */ - const CREATE_INDEXES = 1; - - /** - * @var int - */ - const CREATE_FOREIGNKEYS = 2; - - /** - * @var int - */ - const TRIM_UNSPECIFIED = 0; - - /** - * @var int - */ - const TRIM_LEADING = 1; - - /** - * @var int - */ - const TRIM_TRAILING = 2; - - /** - * @var int - */ - const TRIM_BOTH = 3; - - /** - * @var array - */ - protected $doctrineTypeMapping = null; - - /** - * Contains a list of all columns that should generate parseable column comments for type-detection - * in reverse engineering scenarios. - * - * @var array - */ - protected $doctrineTypeComments = null; - - /** - * @var Doctrine\Common\EventManager - */ - protected $_eventManager; - - /** - * Constructor. - */ - public function __construct() {} - - /** - * Sets the EventManager used by the Platform. - * - * @param \Doctrine\Common\EventManager - */ - public function setEventManager(EventManager $eventManager) - { - $this->_eventManager = $eventManager; - } - - /** - * Gets the EventManager used by the Platform. - * - * @return \Doctrine\Common\EventManager - */ - public function getEventManager() - { - return $this->_eventManager; - } - - /** - * Gets the SQL snippet that declares a boolean column. - * - * @param array $columnDef - * @return string - */ - abstract public function getBooleanTypeDeclarationSQL(array $columnDef); - - /** - * Gets the SQL snippet that declares a 4 byte integer column. - * - * @param array $columnDef - * @return string - */ - abstract public function getIntegerTypeDeclarationSQL(array $columnDef); - - /** - * Gets the SQL snippet that declares an 8 byte integer column. - * - * @param array $columnDef - * @return string - */ - abstract public function getBigIntTypeDeclarationSQL(array $columnDef); - - /** - * Gets the SQL snippet that declares a 2 byte integer column. - * - * @param array $columnDef - * @return string - */ - abstract public function getSmallIntTypeDeclarationSQL(array $columnDef); - - /** - * Gets the SQL snippet that declares common properties of an integer column. - * - * @param array $columnDef - * @return string - */ - abstract protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef); - - /** - * Lazy load Doctrine Type Mappings - * - * @return void - */ - abstract protected function initializeDoctrineTypeMappings(); - - /** - * Gets the SQL snippet used to declare a VARCHAR column type. - * - * @param array $field - */ - public function getVarcharTypeDeclarationSQL(array $field) - { - if ( !isset($field['length'])) { - $field['length'] = $this->getVarcharDefaultLength(); - } - - $fixed = (isset($field['fixed'])) ? $field['fixed'] : false; - - if ($field['length'] > $this->getVarcharMaxLength()) { - return $this->getClobTypeDeclarationSQL($field); - } else { - return $this->getVarcharTypeDeclarationSQLSnippet($field['length'], $fixed); - } - } - - protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) - { - throw DBALException::notSupported('VARCHARs not supported by Platform.'); - } - - /** - * Gets the SQL snippet used to declare a CLOB column type. - * - * @param array $field - */ - abstract public function getClobTypeDeclarationSQL(array $field); - - /** - * Gets the SQL Snippet used to declare a BLOB column type. - */ - abstract public function getBlobTypeDeclarationSQL(array $field); - - /** - * Gets the name of the platform. - * - * @return string - */ - abstract public function getName(); - - /** - * Register a doctrine type to be used in conjunction with a column type of this platform. - * - * @param string $dbType - * @param string $doctrineType - */ - public function registerDoctrineTypeMapping($dbType, $doctrineType) - { - if ($this->doctrineTypeMapping === null) { - $this->initializeDoctrineTypeMappings(); - } - - if (!Types\Type::hasType($doctrineType)) { - throw DBALException::typeNotFound($doctrineType); - } - - $dbType = strtolower($dbType); - $this->doctrineTypeMapping[$dbType] = $doctrineType; - } - - /** - * Get the Doctrine type that is mapped for the given database column type. - * - * @param string $dbType - * @return string - */ - public function getDoctrineTypeMapping($dbType) - { - if ($this->doctrineTypeMapping === null) { - $this->initializeDoctrineTypeMappings(); - } - - $dbType = strtolower($dbType); - if (isset($this->doctrineTypeMapping[$dbType])) { - return $this->doctrineTypeMapping[$dbType]; - } else { - throw new \Doctrine\DBAL\DBALException("Unknown database type ".$dbType." requested, " . get_class($this) . " may not support it."); - } - } - - /** - * Check if a database type is currently supported by this platform. - * - * @param string $dbType - * @return bool - */ - public function hasDoctrineTypeMappingFor($dbType) - { - if ($this->doctrineTypeMapping === null) { - $this->initializeDoctrineTypeMappings(); - } - - $dbType = strtolower($dbType); - return isset($this->doctrineTypeMapping[$dbType]); - } - - /** - * Initialize the Doctrine Type comments instance variable for in_array() checks. - * - * @return void - */ - protected function initializeCommentedDoctrineTypes() - { - $this->doctrineTypeComments = array(Type::TARRAY, Type::OBJECT); - } - - /** - * Is it necessary for the platform to add a parsable type comment to allow reverse engineering the given type? - * - * @param Type $doctrineType - * @return bool - */ - public function isCommentedDoctrineType(Type $doctrineType) - { - if ($this->doctrineTypeComments === null) { - $this->initializeCommentedDoctrineTypes(); - } - - return in_array($doctrineType->getName(), $this->doctrineTypeComments); - } - - /** - * Mark this type as to be commented in ALTER TABLE and CREATE TABLE statements. - * - * @param Type $doctrineType - * @return void - */ - public function markDoctrineTypeCommented(Type $doctrineType) - { - if ($this->doctrineTypeComments === null) { - $this->initializeCommentedDoctrineTypes(); - } - $this->doctrineTypeComments[] = $doctrineType->getName(); - } - - /** - * Get the comment to append to a column comment that helps parsing this type in reverse engineering. - * - * @param Type $doctrineType - * @return string - */ - public function getDoctrineTypeComment(Type $doctrineType) - { - return '(DC2Type:' . $doctrineType->getName() . ')'; - } - - /** - * Return the comment of a passed column modified by potential doctrine type comment hints. - * - * @param Column $column - * @return string - */ - protected function getColumnComment(Column $column) - { - $comment = $column->getComment(); - if ($this->isCommentedDoctrineType($column->getType())) { - $comment .= $this->getDoctrineTypeComment($column->getType()); - } - return $comment; - } - - /** - * Gets the character used for identifier quoting. - * - * @return string - */ - public function getIdentifierQuoteCharacter() - { - return '"'; - } - - /** - * Gets the string portion that starts an SQL comment. - * - * @return string - */ - public function getSqlCommentStartString() - { - return "--"; - } - - /** - * Gets the string portion that ends an SQL comment. - * - * @return string - */ - public function getSqlCommentEndString() - { - return "\n"; - } - - /** - * Gets the maximum length of a varchar field. - * - * @return integer - */ - public function getVarcharMaxLength() - { - return 4000; - } - - /** - * Gets the default length of a varchar field. - * - * @return integer - */ - public function getVarcharDefaultLength() - { - return 255; - } - - /** - * Gets all SQL wildcard characters of the platform. - * - * @return array - */ - public function getWildcards() - { - return array('%', '_'); - } - - /** - * Returns the regular expression operator. - * - * @return string - */ - public function getRegexpExpression() - { - throw DBALException::notSupported(__METHOD__); - } - - /** - * Returns global unique identifier - * - * @return string to get global unique identifier - */ - public function getGuidExpression() - { - throw DBALException::notSupported(__METHOD__); - } - - /** - * Returns the average value of a column - * - * @param string $column the column to use - * @return string generated sql including an AVG aggregate function - */ - public function getAvgExpression($column) - { - return 'AVG(' . $column . ')'; - } - - /** - * Returns the number of rows (without a NULL value) of a column - * - * If a '*' is used instead of a column the number of selected rows - * is returned. - * - * @param string|integer $column the column to use - * @return string generated sql including a COUNT aggregate function - */ - public function getCountExpression($column) - { - return 'COUNT(' . $column . ')'; - } - - /** - * Returns the highest value of a column - * - * @param string $column the column to use - * @return string generated sql including a MAX aggregate function - */ - public function getMaxExpression($column) - { - return 'MAX(' . $column . ')'; - } - - /** - * Returns the lowest value of a column - * - * @param string $column the column to use - * @return string - */ - public function getMinExpression($column) - { - return 'MIN(' . $column . ')'; - } - - /** - * Returns the total sum of a column - * - * @param string $column the column to use - * @return string - */ - public function getSumExpression($column) - { - return 'SUM(' . $column . ')'; - } - - // scalar functions - - /** - * Returns the md5 sum of a field. - * - * Note: Not SQL92, but common functionality - * - * @return string - */ - public function getMd5Expression($column) - { - return 'MD5(' . $column . ')'; - } - - /** - * Returns the length of a text field. - * - * @param string $expression1 - * @param string $expression2 - * @return string - */ - public function getLengthExpression($column) - { - return 'LENGTH(' . $column . ')'; - } - - /** - * Rounds a numeric field to the number of decimals specified. - * - * @param string $expression1 - * @param string $expression2 - * @return string - */ - public function getRoundExpression($column, $decimals = 0) - { - return 'ROUND(' . $column . ', ' . $decimals . ')'; - } - - /** - * Returns the remainder of the division operation - * $expression1 / $expression2. - * - * @param string $expression1 - * @param string $expression2 - * @return string - */ - public function getModExpression($expression1, $expression2) - { - return 'MOD(' . $expression1 . ', ' . $expression2 . ')'; - } - - /** - * Trim a string, leading/trailing/both and with a given char which defaults to space. - * - * @param string $str - * @param int $pos - * @param string $char has to be quoted already - * @return string - */ - public function getTrimExpression($str, $pos = self::TRIM_UNSPECIFIED, $char = false) - { - $posStr = ''; - $trimChar = ($char != false) ? $char . ' FROM ' : ''; - - if ($pos == self::TRIM_LEADING) { - $posStr = 'LEADING '.$trimChar; - } else if($pos == self::TRIM_TRAILING) { - $posStr = 'TRAILING '.$trimChar; - } else if($pos == self::TRIM_BOTH) { - $posStr = 'BOTH '.$trimChar; - } - - return 'TRIM(' . $posStr . $str . ')'; - } - - /** - * rtrim - * returns the string $str with proceeding space characters removed - * - * @param string $str literal string or column name - * @return string - */ - public function getRtrimExpression($str) - { - return 'RTRIM(' . $str . ')'; - } - - /** - * ltrim - * returns the string $str with leading space characters removed - * - * @param string $str literal string or column name - * @return string - */ - public function getLtrimExpression($str) - { - return 'LTRIM(' . $str . ')'; - } - - /** - * upper - * Returns the string $str with all characters changed to - * uppercase according to the current character set mapping. - * - * @param string $str literal string or column name - * @return string - */ - public function getUpperExpression($str) - { - return 'UPPER(' . $str . ')'; - } - - /** - * lower - * Returns the string $str with all characters changed to - * lowercase according to the current character set mapping. - * - * @param string $str literal string or column name - * @return string - */ - public function getLowerExpression($str) - { - return 'LOWER(' . $str . ')'; - } - - /** - * returns the position of the first occurrence of substring $substr in string $str - * - * @param string $substr literal string to find - * @param string $str literal string - * @param int $pos position to start at, beginning of string by default - * @return integer - */ - public function getLocateExpression($str, $substr, $startPos = false) - { - throw DBALException::notSupported(__METHOD__); - } - - /** - * Returns the current system date. - * - * @return string - */ - public function getNowExpression() - { - return 'NOW()'; - } - - /** - * return string to call a function to get a substring inside an SQL statement - * - * Note: Not SQL92, but common functionality. - * - * SQLite only supports the 2 parameter variant of this function - * - * @param string $value an sql string literal or column name/alias - * @param integer $from where to start the substring portion - * @param integer $len the substring portion length - * @return string - */ - public function getSubstringExpression($value, $from, $len = null) - { - if ($len === null) - return 'SUBSTRING(' . $value . ' FROM ' . $from . ')'; - else { - return 'SUBSTRING(' . $value . ' FROM ' . $from . ' FOR ' . $len . ')'; - } - } - - /** - * Returns a series of strings concatinated - * - * concat() accepts an arbitrary number of parameters. Each parameter - * must contain an expression - * - * @param string $arg1, $arg2 ... $argN strings that will be concatinated. - * @return string - */ - public function getConcatExpression() - { - return join(' || ' , func_get_args()); - } - - /** - * Returns the SQL for a logical not. - * - * Example: - * - * $q = new Doctrine_Query(); - * $e = $q->expr; - * $q->select('*')->from('table') - * ->where($e->eq('id', $e->not('null')); - * - * - * @return string a logical expression - */ - public function getNotExpression($expression) - { - return 'NOT(' . $expression . ')'; - } - - /** - * Returns the SQL to check if a value is one in a set of - * given values. - * - * in() accepts an arbitrary number of parameters. The first parameter - * must always specify the value that should be matched against. Successive - * must contain a logical expression or an array with logical expressions. - * These expressions will be matched against the first parameter. - * - * @param string $column the value that should be matched against - * @param string|array(string) values that will be matched against $column - * @return string logical expression - */ - public function getInExpression($column, $values) - { - if ( ! is_array($values)) { - $values = array($values); - } - $values = $this->getIdentifiers($values); - - if (count($values) == 0) { - throw \InvalidArgumentException('Values must not be empty.'); - } - return $column . ' IN (' . implode(', ', $values) . ')'; - } - - /** - * Returns SQL that checks if a expression is null. - * - * @param string $expression the expression that should be compared to null - * @return string logical expression - */ - public function getIsNullExpression($expression) - { - return $expression . ' IS NULL'; - } - - /** - * Returns SQL that checks if a expression is not null. - * - * @param string $expression the expression that should be compared to null - * @return string logical expression - */ - public function getIsNotNullExpression($expression) - { - return $expression . ' IS NOT NULL'; - } - - /** - * Returns SQL that checks if an expression evaluates to a value between - * two values. - * - * The parameter $expression is checked if it is between $value1 and $value2. - * - * Note: There is a slight difference in the way BETWEEN works on some databases. - * http://www.w3schools.com/sql/sql_between.asp. If you want complete database - * independence you should avoid using between(). - * - * @param string $expression the value to compare to - * @param string $value1 the lower value to compare with - * @param string $value2 the higher value to compare with - * @return string logical expression - */ - public function getBetweenExpression($expression, $value1, $value2) - { - return $expression . ' BETWEEN ' .$value1 . ' AND ' . $value2; - } - - public function getAcosExpression($value) - { - return 'ACOS(' . $value . ')'; - } - - public function getSinExpression($value) - { - return 'SIN(' . $value . ')'; - } - - public function getPiExpression() - { - return 'PI()'; - } - - public function getCosExpression($value) - { - return 'COS(' . $value . ')'; - } - - /** - * Calculate the difference in days between the two passed dates. - * - * Computes diff = date1 - date2 - * - * @param string $date1 - * @param string $date2 - * @return string - */ - public function getDateDiffExpression($date1, $date2) - { - throw DBALException::notSupported(__METHOD__); - } - - /** - * Add the number of given days to a date. - * - * @param string $date - * @param int $days - * @return string - */ - public function getDateAddDaysExpression($date, $days) - { - throw DBALException::notSupported(__METHOD__); - } - - /** - * Substract the number of given days to a date. - * - * @param string $date - * @param int $days - * @return string - */ - public function getDateSubDaysExpression($date, $days) - { - throw DBALException::notSupported(__METHOD__); - } - - /** - * Add the number of given months to a date. - * - * @param string $date - * @param int $months - * @return string - */ - public function getDateAddMonthExpression($date, $months) - { - throw DBALException::notSupported(__METHOD__); - } - - /** - * Substract the number of given months to a date. - * - * @param string $date - * @param int $months - * @return string - */ - public function getDateSubMonthExpression($date, $months) - { - throw DBALException::notSupported(__METHOD__); - } - - /** - * Gets SQL bit AND comparison expression - * - * @param string $value1 - * @param string $value2 - * @return string - */ - public function getBitAndComparisonExpression($value1, $value2) - { - return '(' . $value1 . ' & ' . $value2 . ')'; - } - - /** - * Gets SQL bit OR comparison expression - * - * @param string $value1 - * @param string $value2 - * @return string - */ - public function getBitOrComparisonExpression($value1, $value2) - { - return '(' . $value1 . ' | ' . $value2 . ')'; - } - - public function getForUpdateSQL() - { - return 'FOR UPDATE'; - } - - /** - * Honors that some SQL vendors such as MsSql use table hints for locking instead of the ANSI SQL FOR UPDATE specification. - * - * @param string $fromClause - * @param int $lockMode - * @return string - */ - public function appendLockHint($fromClause, $lockMode) - { - return $fromClause; - } - - /** - * Get the sql snippet to append to any SELECT statement which locks rows in shared read lock. - * - * This defaults to the ASNI SQL "FOR UPDATE", which is an exclusive lock (Write). Some database - * vendors allow to lighten this constraint up to be a real read lock. - * - * @return string - */ - public function getReadLockSQL() - { - return $this->getForUpdateSQL(); - } - - /** - * Get the SQL snippet to append to any SELECT statement which obtains an exclusive lock on the rows. - * - * The semantics of this lock mode should equal the SELECT .. FOR UPDATE of the ASNI SQL standard. - * - * @return string - */ - public function getWriteLockSQL() - { - return $this->getForUpdateSQL(); - } - - public function getDropDatabaseSQL($database) - { - return 'DROP DATABASE ' . $database; - } - - /** - * Drop a Table - * - * @throws \InvalidArgumentException - * @param Table|string $table - * @return string - */ - public function getDropTableSQL($table) - { - $tableArg = $table; - - if ($table instanceof \Doctrine\DBAL\Schema\Table) { - $table = $table->getQuotedName($this); - } else if(!is_string($table)) { - throw new \InvalidArgumentException('getDropTableSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'); - } - - if (null !== $this->_eventManager && $this->_eventManager->hasListeners(Events::onSchemaDropTable)) { - $eventArgs = new SchemaDropTableEventArgs($tableArg, $this); - $this->_eventManager->dispatchEvent(Events::onSchemaDropTable, $eventArgs); - - if ($eventArgs->isDefaultPrevented()) { - return $eventArgs->getSql(); - } - } - - return 'DROP TABLE ' . $table; - } - - /** - * Get SQL to safely drop a temporary table WITHOUT implicitly committing an open transaction. - * - * @param Table|string $table - * @return string - */ - public function getDropTemporaryTableSQL($table) - { - return $this->getDropTableSQL($table); - } - - /** - * Drop index from a table - * - * @param Index|string $name - * @param string|Table $table - * @return string - */ - public function getDropIndexSQL($index, $table=null) - { - if($index instanceof \Doctrine\DBAL\Schema\Index) { - $index = $index->getQuotedName($this); - } else if(!is_string($index)) { - throw new \InvalidArgumentException('AbstractPlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.'); - } - - return 'DROP INDEX ' . $index; - } - - /** - * Get drop constraint sql - * - * @param \Doctrine\DBAL\Schema\Constraint $constraint - * @param string|Table $table - * @return string - */ - public function getDropConstraintSQL($constraint, $table) - { - if ($constraint instanceof \Doctrine\DBAL\Schema\Constraint) { - $constraint = $constraint->getQuotedName($this); - } - - if ($table instanceof \Doctrine\DBAL\Schema\Table) { - $table = $table->getQuotedName($this); - } - - return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $constraint; - } - - /** - * @param ForeignKeyConstraint|string $foreignKey - * @param Table|string $table - * @return string - */ - public function getDropForeignKeySQL($foreignKey, $table) - { - if ($foreignKey instanceof \Doctrine\DBAL\Schema\ForeignKeyConstraint) { - $foreignKey = $foreignKey->getQuotedName($this); - } - - if ($table instanceof \Doctrine\DBAL\Schema\Table) { - $table = $table->getQuotedName($this); - } - - return 'ALTER TABLE ' . $table . ' DROP FOREIGN KEY ' . $foreignKey; - } - - /** - * Gets the SQL statement(s) to create a table with the specified name, columns and constraints - * on this platform. - * - * @param string $table The name of the table. - * @param int $createFlags - * @return array The sequence of SQL statements. - */ - public function getCreateTableSQL(Table $table, $createFlags=self::CREATE_INDEXES) - { - if ( ! is_int($createFlags)) { - throw new \InvalidArgumentException("Second argument of AbstractPlatform::getCreateTableSQL() has to be integer."); - } - - if (count($table->getColumns()) == 0) { - throw DBALException::noColumnsSpecifiedForTable($table->getName()); - } - - $tableName = $table->getQuotedName($this); - $options = $table->getOptions(); - $options['uniqueConstraints'] = array(); - $options['indexes'] = array(); - $options['primary'] = array(); - - if (($createFlags&self::CREATE_INDEXES) > 0) { - foreach ($table->getIndexes() AS $index) { - /* @var $index Index */ - if ($index->isPrimary()) { - $options['primary'] = $index->getColumns(); - } else { - $options['indexes'][$index->getName()] = $index; - } - } - } - - $columnSql = array(); - $columns = array(); - foreach ($table->getColumns() AS $column) { - /* @var \Doctrine\DBAL\Schema\Column $column */ - - if (null !== $this->_eventManager && $this->_eventManager->hasListeners(Events::onSchemaCreateTableColumn)) { - $eventArgs = new SchemaCreateTableColumnEventArgs($column, $table, $this); - $this->_eventManager->dispatchEvent(Events::onSchemaCreateTableColumn, $eventArgs); - - $columnSql = array_merge($columnSql, $eventArgs->getSql()); - - if ($eventArgs->isDefaultPrevented()) { - continue; - } - } - - $columnData = array(); - $columnData['name'] = $column->getQuotedName($this); - $columnData['type'] = $column->getType(); - $columnData['length'] = $column->getLength(); - $columnData['notnull'] = $column->getNotNull(); - $columnData['fixed'] = $column->getFixed(); - $columnData['unique'] = false; // TODO: what do we do about this? - $columnData['version'] = ($column->hasPlatformOption("version"))?$column->getPlatformOption('version'):false; - if(strtolower($columnData['type']) == "string" && $columnData['length'] === null) { - $columnData['length'] = 255; - } - $columnData['unsigned'] = $column->getUnsigned(); - $columnData['precision'] = $column->getPrecision(); - $columnData['scale'] = $column->getScale(); - $columnData['default'] = $column->getDefault(); - $columnData['columnDefinition'] = $column->getColumnDefinition(); - $columnData['autoincrement'] = $column->getAutoincrement(); - $columnData['comment'] = $this->getColumnComment($column); - - if(in_array($column->getName(), $options['primary'])) { - $columnData['primary'] = true; - } - - $columns[$columnData['name']] = $columnData; - } - - if (($createFlags&self::CREATE_FOREIGNKEYS) > 0) { - $options['foreignKeys'] = array(); - foreach ($table->getForeignKeys() AS $fkConstraint) { - $options['foreignKeys'][] = $fkConstraint; - } - } - - if (null !== $this->_eventManager && $this->_eventManager->hasListeners(Events::onSchemaCreateTable)) { - $eventArgs = new SchemaCreateTableEventArgs($table, $columns, $options, $this); - $this->_eventManager->dispatchEvent(Events::onSchemaCreateTable, $eventArgs); - - if ($eventArgs->isDefaultPrevented()) { - return array_merge($eventArgs->getSql(), $columnSql); - } - } - - $sql = $this->_getCreateTableSQL($tableName, $columns, $options); - if ($this->supportsCommentOnStatement()) { - foreach ($table->getColumns() AS $column) { - if ($this->getColumnComment($column)) { - $sql[] = $this->getCommentOnColumnSQL($tableName, $column->getName(), $this->getColumnComment($column)); - } - } - } - - return array_merge($sql, $columnSql); - } - - public function getCommentOnColumnSQL($tableName, $columnName, $comment) - { - return "COMMENT ON COLUMN " . $tableName . "." . $columnName . " IS '" . $comment . "'"; - } - - /** - * @param string $tableName - * @param array $columns - * @param array $options - * @return array - */ - protected function _getCreateTableSQL($tableName, array $columns, array $options = array()) - { - $columnListSql = $this->getColumnDeclarationListSQL($columns); - - if (isset($options['uniqueConstraints']) && ! empty($options['uniqueConstraints'])) { - foreach ($options['uniqueConstraints'] as $name => $definition) { - $columnListSql .= ', ' . $this->getUniqueConstraintDeclarationSQL($name, $definition); - } - } - - if (isset($options['primary']) && ! empty($options['primary'])) { - $columnListSql .= ', PRIMARY KEY(' . implode(', ', array_unique(array_values($options['primary']))) . ')'; - } - - if (isset($options['indexes']) && ! empty($options['indexes'])) { - foreach($options['indexes'] as $index => $definition) { - $columnListSql .= ', ' . $this->getIndexDeclarationSQL($index, $definition); - } - } - - $query = 'CREATE TABLE ' . $tableName . ' (' . $columnListSql; - - $check = $this->getCheckDeclarationSQL($columns); - if ( ! empty($check)) { - $query .= ', ' . $check; - } - $query .= ')'; - - $sql[] = $query; - - if (isset($options['foreignKeys'])) { - foreach ((array) $options['foreignKeys'] AS $definition) { - $sql[] = $this->getCreateForeignKeySQL($definition, $tableName); - } - } - - return $sql; - } - - public function getCreateTemporaryTableSnippetSQL() - { - return "CREATE TEMPORARY TABLE"; - } - - /** - * Gets the SQL to create a sequence on this platform. - * - * @param \Doctrine\DBAL\Schema\Sequence $sequence - * @throws DBALException - */ - public function getCreateSequenceSQL(\Doctrine\DBAL\Schema\Sequence $sequence) - { - throw DBALException::notSupported(__METHOD__); - } - - /** - * Gets the SQL statement to change a sequence on this platform. - * - * @param \Doctrine\DBAL\Schema\Sequence $sequence - * @return string - */ - public function getAlterSequenceSQL(\Doctrine\DBAL\Schema\Sequence $sequence) - { - throw DBALException::notSupported(__METHOD__); - } - - /** - * Gets the SQL to create a constraint on a table on this platform. - * - * @param Constraint $constraint - * @param string|Table $table - * @return string - */ - public function getCreateConstraintSQL(\Doctrine\DBAL\Schema\Constraint $constraint, $table) - { - if ($table instanceof \Doctrine\DBAL\Schema\Table) { - $table = $table->getQuotedName($this); - } - - $query = 'ALTER TABLE ' . $table . ' ADD CONSTRAINT ' . $constraint->getQuotedName($this); - - $columns = array(); - foreach ($constraint->getColumns() as $column) { - $columns[] = $column; - } - $columnList = '('. implode(', ', $columns) . ')'; - - $referencesClause = ''; - if ($constraint instanceof \Doctrine\DBAL\Schema\Index) { - if($constraint->isPrimary()) { - $query .= ' PRIMARY KEY'; - } elseif ($constraint->isUnique()) { - $query .= ' UNIQUE'; - } else { - throw new \InvalidArgumentException( - 'Can only create primary or unique constraints, no common indexes with getCreateConstraintSQL().' - ); - } - } else if ($constraint instanceof \Doctrine\DBAL\Schema\ForeignKeyConstraint) { - $query .= ' FOREIGN KEY'; - - $foreignColumns = array(); - foreach ($constraint->getForeignColumns() AS $column) { - $foreignColumns[] = $column; - } - - $referencesClause = ' REFERENCES '.$constraint->getForeignTableName(). ' ('.implode(', ', $foreignColumns).')'; - } - $query .= ' '.$columnList.$referencesClause; - - return $query; - } - - /** - * Gets the SQL to create an index on a table on this platform. - * - * @param Index $index - * @param string|Table $table name of the table on which the index is to be created - * @return string - */ - public function getCreateIndexSQL(Index $index, $table) - { - if ($table instanceof Table) { - $table = $table->getQuotedName($this); - } - $name = $index->getQuotedName($this); - $columns = $index->getColumns(); - - if (count($columns) == 0) { - throw new \InvalidArgumentException("Incomplete definition. 'columns' required."); - } - - if ($index->isPrimary()) { - return $this->getCreatePrimaryKeySQL($index, $table); - } else { - $type = ''; - if ($index->isUnique()) { - $type = 'UNIQUE '; - } - - $query = 'CREATE ' . $type . 'INDEX ' . $name . ' ON ' . $table; - $query .= ' (' . $this->getIndexFieldDeclarationListSQL($columns) . ')'; - } - - return $query; - } - - /** - * Get SQL to create an unnamed primary key constraint. - * - * @param Index $index - * @param string|Table $table - * @return string - */ - public function getCreatePrimaryKeySQL(Index $index, $table) - { - return 'ALTER TABLE ' . $table . ' ADD PRIMARY KEY (' . $this->getIndexFieldDeclarationListSQL($index->getColumns()) . ')'; - } - - /** - * Quotes a string so that it can be safely used as a table or column name, - * even if it is a reserved word of the platform. This also detects identifier - * chains seperated by dot and quotes them independently. - * - * NOTE: Just because you CAN use quoted identifiers doesn't mean - * you SHOULD use them. In general, they end up causing way more - * problems than they solve. - * - * @param string $str identifier name to be quoted - * @return string quoted identifier string - */ - public function quoteIdentifier($str) - { - if (strpos($str, ".") !== false) { - $parts = array_map(array($this, "quoteIdentifier"), explode(".", $str)); - return implode(".", $parts); - } - - return $this->quoteSingleIdentifier($str); - } - - /** - * Quote a single identifier (no dot chain seperation) - * - * @param string $str - * @return string - */ - public function quoteSingleIdentifier($str) - { - $c = $this->getIdentifierQuoteCharacter(); - - return $c . str_replace($c, $c.$c, $str) . $c; - } - - /** - * Create a new foreign key - * - * @param ForeignKeyConstraint $foreignKey ForeignKey instance - * @param string|Table $table name of the table on which the foreign key is to be created - * @return string - */ - public function getCreateForeignKeySQL(ForeignKeyConstraint $foreignKey, $table) - { - if ($table instanceof \Doctrine\DBAL\Schema\Table) { - $table = $table->getQuotedName($this); - } - - $query = 'ALTER TABLE ' . $table . ' ADD ' . $this->getForeignKeyDeclarationSQL($foreignKey); - - return $query; - } - - /** - * Gets the sql statements for altering an existing table. - * - * The method returns an array of sql statements, since some platforms need several statements. - * - * @param TableDiff $diff - * @return array - */ - public function getAlterTableSQL(TableDiff $diff) - { - throw DBALException::notSupported(__METHOD__); - } - - /** - * @param Column $column - * @param TableDiff $diff - * @param array $columnSql - */ - protected function onSchemaAlterTableAddColumn(Column $column, TableDiff $diff, &$columnSql) - { - if (null === $this->_eventManager) { - return false; - } - - if (!$this->_eventManager->hasListeners(Events::onSchemaAlterTableAddColumn)) { - return false; - } - - $eventArgs = new SchemaAlterTableAddColumnEventArgs($column, $diff, $this); - $this->_eventManager->dispatchEvent(Events::onSchemaAlterTableAddColumn, $eventArgs); - - $columnSql = array_merge($columnSql, $eventArgs->getSql()); - - return $eventArgs->isDefaultPrevented(); - } - - /** - * @param Column $column - * @param TableDiff $diff - * @param array $columnSql - */ - protected function onSchemaAlterTableRemoveColumn(Column $column, TableDiff $diff, &$columnSql) - { - if (null === $this->_eventManager) { - return false; - } - - if (!$this->_eventManager->hasListeners(Events::onSchemaAlterTableRemoveColumn)) { - return false; - } - - $eventArgs = new SchemaAlterTableRemoveColumnEventArgs($column, $diff, $this); - $this->_eventManager->dispatchEvent(Events::onSchemaAlterTableRemoveColumn, $eventArgs); - - $columnSql = array_merge($columnSql, $eventArgs->getSql()); - - return $eventArgs->isDefaultPrevented(); - } - - /** - * @param ColumnDiff $columnDiff - * @param TableDiff $diff - * @param array $columnSql - */ - protected function onSchemaAlterTableChangeColumn(ColumnDiff $columnDiff, TableDiff $diff, &$columnSql) - { - if (null === $this->_eventManager) { - return false; - } - - if (!$this->_eventManager->hasListeners(Events::onSchemaAlterTableChangeColumn)) { - return false; - } - - $eventArgs = new SchemaAlterTableChangeColumnEventArgs($columnDiff, $diff, $this); - $this->_eventManager->dispatchEvent(Events::onSchemaAlterTableChangeColumn, $eventArgs); - - $columnSql = array_merge($columnSql, $eventArgs->getSql()); - - return $eventArgs->isDefaultPrevented(); - } - - /** - * @param string $oldColumnName - * @param Column $column - * @param TableDiff $diff - * @param array $columnSql - */ - protected function onSchemaAlterTableRenameColumn($oldColumnName, Column $column, TableDiff $diff, &$columnSql) - { - if (null === $this->_eventManager) { - return false; - } - - if (!$this->_eventManager->hasListeners(Events::onSchemaAlterTableRenameColumn)) { - return false; - } - - $eventArgs = new SchemaAlterTableRenameColumnEventArgs($oldColumnName, $column, $diff, $this); - $this->_eventManager->dispatchEvent(Events::onSchemaAlterTableRenameColumn, $eventArgs); - - $columnSql = array_merge($columnSql, $eventArgs->getSql()); - - return $eventArgs->isDefaultPrevented(); - } - /** - * @param TableDiff $diff - * @param array $columnSql - */ - protected function onSchemaAlterTable(TableDiff $diff, &$sql) - { - if (null === $this->_eventManager) { - return false; - } - - if (!$this->_eventManager->hasListeners(Events::onSchemaAlterTable)) { - return false; - } - - $eventArgs = new SchemaAlterTableEventArgs($diff, $this); - $this->_eventManager->dispatchEvent(Events::onSchemaAlterTable, $eventArgs); - - $sql = array_merge($sql, $eventArgs->getSql()); - - return $eventArgs->isDefaultPrevented(); - } - - protected function getPreAlterTableIndexForeignKeySQL(TableDiff $diff) - { - $tableName = $diff->name; - - $sql = array(); - if ($this->supportsForeignKeyConstraints()) { - foreach ($diff->removedForeignKeys AS $foreignKey) { - $sql[] = $this->getDropForeignKeySQL($foreignKey, $tableName); - } - foreach ($diff->changedForeignKeys AS $foreignKey) { - $sql[] = $this->getDropForeignKeySQL($foreignKey, $tableName); - } - } - - foreach ($diff->removedIndexes AS $index) { - $sql[] = $this->getDropIndexSQL($index, $tableName); - } - foreach ($diff->changedIndexes AS $index) { - $sql[] = $this->getDropIndexSQL($index, $tableName); - } - - return $sql; - } - - protected function getPostAlterTableIndexForeignKeySQL(TableDiff $diff) - { - if ($diff->newName !== false) { - $tableName = $diff->newName; - } else { - $tableName = $diff->name; - } - - $sql = array(); - if ($this->supportsForeignKeyConstraints()) { - foreach ($diff->addedForeignKeys AS $foreignKey) { - $sql[] = $this->getCreateForeignKeySQL($foreignKey, $tableName); - } - foreach ($diff->changedForeignKeys AS $foreignKey) { - $sql[] = $this->getCreateForeignKeySQL($foreignKey, $tableName); - } - } - - foreach ($diff->addedIndexes AS $index) { - $sql[] = $this->getCreateIndexSQL($index, $tableName); - } - foreach ($diff->changedIndexes AS $index) { - $sql[] = $this->getCreateIndexSQL($index, $tableName); - } - - return $sql; - } - - /** - * Common code for alter table statement generation that updates the changed Index and Foreign Key definitions. - * - * @param TableDiff $diff - * @return array - */ - protected function _getAlterTableIndexForeignKeySQL(TableDiff $diff) - { - return array_merge($this->getPreAlterTableIndexForeignKeySQL($diff), $this->getPostAlterTableIndexForeignKeySQL($diff)); - } - - /** - * Get declaration of a number of fields in bulk - * - * @param array $fields a multidimensional associative array. - * The first dimension determines the field name, while the second - * dimension is keyed with the name of the properties - * of the field being declared as array indexes. Currently, the types - * of supported field properties are as follows: - * - * length - * Integer value that determines the maximum length of the text - * field. If this argument is missing the field should be - * declared to have the longest length allowed by the DBMS. - * - * default - * Text value to be used as default for this field. - * - * notnull - * Boolean flag that indicates whether this field is constrained - * to not be set to null. - * charset - * Text value with the default CHARACTER SET for this field. - * collation - * Text value with the default COLLATION for this field. - * unique - * unique constraint - * - * @return string - */ - public function getColumnDeclarationListSQL(array $fields) - { - $queryFields = array(); - foreach ($fields as $fieldName => $field) { - $query = $this->getColumnDeclarationSQL($fieldName, $field); - $queryFields[] = $query; - } - return implode(', ', $queryFields); - } - - /** - * Obtain DBMS specific SQL code portion needed to declare a generic type - * field to be used in statements like CREATE TABLE. - * - * @param string $name name the field to be declared. - * @param array $field associative array with the name of the properties - * of the field being declared as array indexes. Currently, the types - * of supported field properties are as follows: - * - * length - * Integer value that determines the maximum length of the text - * field. If this argument is missing the field should be - * declared to have the longest length allowed by the DBMS. - * - * default - * Text value to be used as default for this field. - * - * notnull - * Boolean flag that indicates whether this field is constrained - * to not be set to null. - * charset - * Text value with the default CHARACTER SET for this field. - * collation - * Text value with the default COLLATION for this field. - * unique - * unique constraint - * check - * column check constraint - * columnDefinition - * a string that defines the complete column - * - * @return string DBMS specific SQL code portion that should be used to declare the column. - */ - public function getColumnDeclarationSQL($name, array $field) - { - if (isset($field['columnDefinition'])) { - $columnDef = $this->getCustomTypeDeclarationSQL($field); - } else { - $default = $this->getDefaultValueDeclarationSQL($field); - - $charset = (isset($field['charset']) && $field['charset']) ? - ' ' . $this->getColumnCharsetDeclarationSQL($field['charset']) : ''; - - $collation = (isset($field['collation']) && $field['collation']) ? - ' ' . $this->getColumnCollationDeclarationSQL($field['collation']) : ''; - - $notnull = (isset($field['notnull']) && $field['notnull']) ? ' NOT NULL' : ''; - - $unique = (isset($field['unique']) && $field['unique']) ? - ' ' . $this->getUniqueFieldDeclarationSQL() : ''; - - $check = (isset($field['check']) && $field['check']) ? - ' ' . $field['check'] : ''; - - $typeDecl = $field['type']->getSqlDeclaration($field, $this); - $columnDef = $typeDecl . $charset . $default . $notnull . $unique . $check . $collation; - } - - if ($this->supportsInlineColumnComments() && isset($field['comment']) && $field['comment']) { - $columnDef .= " COMMENT '" . $field['comment'] . "'"; - } - - return $name . ' ' . $columnDef; - } - - /** - * Gets the SQL snippet that declares a floating point column of arbitrary precision. - * - * @param array $columnDef - * @return string - */ - public function getDecimalTypeDeclarationSQL(array $columnDef) - { - $columnDef['precision'] = ( ! isset($columnDef['precision']) || empty($columnDef['precision'])) - ? 10 : $columnDef['precision']; - $columnDef['scale'] = ( ! isset($columnDef['scale']) || empty($columnDef['scale'])) - ? 0 : $columnDef['scale']; - - return 'NUMERIC(' . $columnDef['precision'] . ', ' . $columnDef['scale'] . ')'; - } - - /** - * Obtain DBMS specific SQL code portion needed to set a default value - * declaration to be used in statements like CREATE TABLE. - * - * @param array $field field definition array - * @return string DBMS specific SQL code portion needed to set a default value - */ - public function getDefaultValueDeclarationSQL($field) - { - $default = empty($field['notnull']) ? ' DEFAULT NULL' : ''; - - if (isset($field['default'])) { - $default = " DEFAULT '".$field['default']."'"; - if (isset($field['type'])) { - if (in_array((string)$field['type'], array("Integer", "BigInteger", "SmallInteger"))) { - $default = " DEFAULT ".$field['default']; - } else if ((string)$field['type'] == 'DateTime' && $field['default'] == $this->getCurrentTimestampSQL()) { - $default = " DEFAULT ".$this->getCurrentTimestampSQL(); - - } else if ((string) $field['type'] == 'Boolean') { - $default = " DEFAULT '" . $this->convertBooleans($field['default']) . "'"; - } - } - } - return $default; - } - - /** - * Obtain DBMS specific SQL code portion needed to set a CHECK constraint - * declaration to be used in statements like CREATE TABLE. - * - * @param array $definition check definition - * @return string DBMS specific SQL code portion needed to set a CHECK constraint - */ - public function getCheckDeclarationSQL(array $definition) - { - $constraints = array(); - foreach ($definition as $field => $def) { - if (is_string($def)) { - $constraints[] = 'CHECK (' . $def . ')'; - } else { - if (isset($def['min'])) { - $constraints[] = 'CHECK (' . $field . ' >= ' . $def['min'] . ')'; - } - - if (isset($def['max'])) { - $constraints[] = 'CHECK (' . $field . ' <= ' . $def['max'] . ')'; - } - } - } - - return implode(', ', $constraints); - } - - /** - * Obtain DBMS specific SQL code portion needed to set a unique - * constraint declaration to be used in statements like CREATE TABLE. - * - * @param string $name name of the unique constraint - * @param Index $index index definition - * @return string DBMS specific SQL code portion needed - * to set a constraint - */ - public function getUniqueConstraintDeclarationSQL($name, Index $index) - { - if (count($index->getColumns()) == 0) { - throw \InvalidArgumentException("Incomplete definition. 'columns' required."); - } - - return 'CONSTRAINT ' . $name . ' UNIQUE (' - . $this->getIndexFieldDeclarationListSQL($index->getColumns()) - . ')'; - } - - /** - * Obtain DBMS specific SQL code portion needed to set an index - * declaration to be used in statements like CREATE TABLE. - * - * @param string $name name of the index - * @param Index $index index definition - * @return string DBMS specific SQL code portion needed to set an index - */ - public function getIndexDeclarationSQL($name, Index $index) - { - $type = ''; - - if($index->isUnique()) { - $type = 'UNIQUE '; - } - - if (count($index->getColumns()) == 0) { - throw \InvalidArgumentException("Incomplete definition. 'columns' required."); - } - - return $type . 'INDEX ' . $name . ' (' - . $this->getIndexFieldDeclarationListSQL($index->getColumns()) - . ')'; - } - - /** - * getCustomTypeDeclarationSql - * Obtail SQL code portion needed to create a custom column, - * e.g. when a field has the "columnDefinition" keyword. - * Only "AUTOINCREMENT" and "PRIMARY KEY" are added if appropriate. - * - * @return string - */ - public function getCustomTypeDeclarationSQL(array $columnDef) - { - return $columnDef['columnDefinition']; - } - - /** - * getIndexFieldDeclarationList - * Obtain DBMS specific SQL code portion needed to set an index - * declaration to be used in statements like CREATE TABLE. - * - * @return string - */ - public function getIndexFieldDeclarationListSQL(array $fields) - { - $ret = array(); - foreach ($fields as $field => $definition) { - if (is_array($definition)) { - $ret[] = $field; - } else { - $ret[] = $definition; - } - } - return implode(', ', $ret); - } - - /** - * A method to return the required SQL string that fits between CREATE ... TABLE - * to create the table as a temporary table. - * - * Should be overridden in driver classes to return the correct string for the - * specific database type. - * - * The default is to return the string "TEMPORARY" - this will result in a - * SQL error for any database that does not support temporary tables, or that - * requires a different SQL command from "CREATE TEMPORARY TABLE". - * - * @return string The string required to be placed between "CREATE" and "TABLE" - * to generate a temporary table, if possible. - */ - public function getTemporaryTableSQL() - { - return 'TEMPORARY'; - } - - /** - * Some vendors require temporary table names to be qualified specially. - * - * @param string $tableName - * @return string - */ - public function getTemporaryTableName($tableName) - { - return $tableName; - } - - /** - * Get sql query to show a list of database. - * - * @return string - */ - public function getShowDatabasesSQL() - { - throw DBALException::notSupported(__METHOD__); - } - - /** - * Obtain DBMS specific SQL code portion needed to set the FOREIGN KEY constraint - * of a field declaration to be used in statements like CREATE TABLE. - * - * @param array $definition an associative array with the following structure: - * name optional constraint name - * - * local the local field(s) - * - * foreign the foreign reference field(s) - * - * foreignTable the name of the foreign table - * - * onDelete referential delete action - * - * onUpdate referential update action - * - * deferred deferred constraint checking - * - * The onDelete and onUpdate keys accept the following values: - * - * CASCADE: Delete or update the row from the parent table and automatically delete or - * update the matching rows in the child table. Both ON DELETE CASCADE and ON UPDATE CASCADE are supported. - * Between two tables, you should not define several ON UPDATE CASCADE clauses that act on the same column - * in the parent table or in the child table. - * - * SET NULL: Delete or update the row from the parent table and set the foreign key column or columns in the - * child table to NULL. This is valid only if the foreign key columns do not have the NOT NULL qualifier - * specified. Both ON DELETE SET NULL and ON UPDATE SET NULL clauses are supported. - * - * NO ACTION: In standard SQL, NO ACTION means no action in the sense that an attempt to delete or update a primary - * key value is not allowed to proceed if there is a related foreign key value in the referenced table. - * - * RESTRICT: Rejects the delete or update operation for the parent table. NO ACTION and RESTRICT are the same as - * omitting the ON DELETE or ON UPDATE clause. - * - * SET DEFAULT - * - * @return string DBMS specific SQL code portion needed to set the FOREIGN KEY constraint - * of a field declaration. - */ - public function getForeignKeyDeclarationSQL(ForeignKeyConstraint $foreignKey) - { - $sql = $this->getForeignKeyBaseDeclarationSQL($foreignKey); - $sql .= $this->getAdvancedForeignKeyOptionsSQL($foreignKey); - - return $sql; - } - - /** - * Return the FOREIGN KEY query section dealing with non-standard options - * as MATCH, INITIALLY DEFERRED, ON UPDATE, ... - * - * @param ForeignKeyConstraint $foreignKey foreign key definition - * @return string - */ - public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey) - { - $query = ''; - if ($this->supportsForeignKeyOnUpdate() && $foreignKey->hasOption('onUpdate')) { - $query .= ' ON UPDATE ' . $this->getForeignKeyReferentialActionSQL($foreignKey->getOption('onUpdate')); - } - if ($foreignKey->hasOption('onDelete')) { - $query .= ' ON DELETE ' . $this->getForeignKeyReferentialActionSQL($foreignKey->getOption('onDelete')); - } - return $query; - } - - /** - * returns given referential action in uppercase if valid, otherwise throws - * an exception - * - * @throws Doctrine_Exception_Exception if unknown referential action given - * @param string $action foreign key referential action - * @param string foreign key referential action in uppercase - */ - public function getForeignKeyReferentialActionSQL($action) - { - $upper = strtoupper($action); - switch ($upper) { - case 'CASCADE': - case 'SET NULL': - case 'NO ACTION': - case 'RESTRICT': - case 'SET DEFAULT': - return $upper; - break; - default: - throw new \InvalidArgumentException('Invalid foreign key action: ' . $upper); - } - } - - /** - * Obtain DBMS specific SQL code portion needed to set the FOREIGN KEY constraint - * of a field declaration to be used in statements like CREATE TABLE. - * - * @param ForeignKeyConstraint $foreignKey - * @return string - */ - public function getForeignKeyBaseDeclarationSQL(ForeignKeyConstraint $foreignKey) - { - $sql = ''; - if (strlen($foreignKey->getName())) { - $sql .= 'CONSTRAINT ' . $foreignKey->getQuotedName($this) . ' '; - } - $sql .= 'FOREIGN KEY ('; - - if (count($foreignKey->getLocalColumns()) == 0) { - throw new \InvalidArgumentException("Incomplete definition. 'local' required."); - } - if (count($foreignKey->getForeignColumns()) == 0) { - throw new \InvalidArgumentException("Incomplete definition. 'foreign' required."); - } - if (strlen($foreignKey->getForeignTableName()) == 0) { - throw new \InvalidArgumentException("Incomplete definition. 'foreignTable' required."); - } - - $sql .= implode(', ', $foreignKey->getLocalColumns()) - . ') REFERENCES ' - . $foreignKey->getForeignTableName() . ' (' - . implode(', ', $foreignKey->getForeignColumns()) . ')'; - - return $sql; - } - - /** - * Obtain DBMS specific SQL code portion needed to set the UNIQUE constraint - * of a field declaration to be used in statements like CREATE TABLE. - * - * @return string DBMS specific SQL code portion needed to set the UNIQUE constraint - * of a field declaration. - */ - public function getUniqueFieldDeclarationSQL() - { - return 'UNIQUE'; - } - - /** - * Obtain DBMS specific SQL code portion needed to set the CHARACTER SET - * of a field declaration to be used in statements like CREATE TABLE. - * - * @param string $charset name of the charset - * @return string DBMS specific SQL code portion needed to set the CHARACTER SET - * of a field declaration. - */ - public function getColumnCharsetDeclarationSQL($charset) - { - return ''; - } - - /** - * Obtain DBMS specific SQL code portion needed to set the COLLATION - * of a field declaration to be used in statements like CREATE TABLE. - * - * @param string $collation name of the collation - * @return string DBMS specific SQL code portion needed to set the COLLATION - * of a field declaration. - */ - public function getColumnCollationDeclarationSQL($collation) - { - return ''; - } - - /** - * Whether the platform prefers sequences for ID generation. - * Subclasses should override this method to return TRUE if they prefer sequences. - * - * @return boolean - */ - public function prefersSequences() - { - return false; - } - - /** - * Whether the platform prefers identity columns (eg. autoincrement) for ID generation. - * Subclasses should override this method to return TRUE if they prefer identity columns. - * - * @return boolean - */ - public function prefersIdentityColumns() - { - return false; - } - - /** - * Some platforms need the boolean values to be converted. - * - * The default conversion in this implementation converts to integers (false => 0, true => 1). - * - * @param mixed $item - */ - public function convertBooleans($item) - { - if (is_array($item)) { - foreach ($item as $k => $value) { - if (is_bool($value)) { - $item[$k] = (int) $value; - } - } - } else if (is_bool($item)) { - $item = (int) $item; - } - return $item; - } - - /** - * Gets the SQL statement specific for the platform to set the charset. - * - * This function is MySQL specific and required by - * {@see \Doctrine\DBAL\Connection::setCharset($charset)} - * - * @param string $charset - * @return string - */ - public function getSetCharsetSQL($charset) - { - return "SET NAMES '".$charset."'"; - } - - /** - * Gets the SQL specific for the platform to get the current date. - * - * @return string - */ - public function getCurrentDateSQL() - { - return 'CURRENT_DATE'; - } - - /** - * Gets the SQL specific for the platform to get the current time. - * - * @return string - */ - public function getCurrentTimeSQL() - { - return 'CURRENT_TIME'; - } - - /** - * Gets the SQL specific for the platform to get the current timestamp - * - * @return string - */ - public function getCurrentTimestampSQL() - { - return 'CURRENT_TIMESTAMP'; - } - - /** - * Get sql for transaction isolation level Connection constant - * - * @param integer $level - */ - protected function _getTransactionIsolationLevelSQL($level) - { - switch ($level) { - case Connection::TRANSACTION_READ_UNCOMMITTED: - return 'READ UNCOMMITTED'; - case Connection::TRANSACTION_READ_COMMITTED: - return 'READ COMMITTED'; - case Connection::TRANSACTION_REPEATABLE_READ: - return 'REPEATABLE READ'; - case Connection::TRANSACTION_SERIALIZABLE: - return 'SERIALIZABLE'; - default: - throw new \InvalidArgumentException('Invalid isolation level:' . $level); - } - } - - public function getListDatabasesSQL() - { - throw DBALException::notSupported(__METHOD__); - } - - public function getListSequencesSQL($database) - { - throw DBALException::notSupported(__METHOD__); - } - - public function getListTableConstraintsSQL($table) - { - throw DBALException::notSupported(__METHOD__); - } - - public function getListTableColumnsSQL($table, $database = null) - { - throw DBALException::notSupported(__METHOD__); - } - - public function getListTablesSQL() - { - throw DBALException::notSupported(__METHOD__); - } - - public function getListUsersSQL() - { - throw DBALException::notSupported(__METHOD__); - } - - /** - * Get the SQL to list all views of a database or user. - * - * @param string $database - * @return string - */ - public function getListViewsSQL($database) - { - throw DBALException::notSupported(__METHOD__); - } - - /** - * Get the list of indexes for the current database. - * - * The current database parameter is optional but will always be passed - * when using the SchemaManager API and is the database the given table is in. - * - * Attention: Some platforms only support currentDatabase when they - * are connected with that database. Cross-database information schema - * requests may be impossible. - * - * @param string $table - * @param string $currentDatabase - */ - public function getListTableIndexesSQL($table, $currentDatabase = null) - { - throw DBALException::notSupported(__METHOD__); - } - - public function getListTableForeignKeysSQL($table) - { - throw DBALException::notSupported(__METHOD__); - } - - public function getCreateViewSQL($name, $sql) - { - throw DBALException::notSupported(__METHOD__); - } - - public function getDropViewSQL($name) - { - throw DBALException::notSupported(__METHOD__); - } - - public function getDropSequenceSQL($sequence) - { - throw DBALException::notSupported(__METHOD__); - } - - public function getSequenceNextValSQL($sequenceName) - { - throw DBALException::notSupported(__METHOD__); - } - - public function getCreateDatabaseSQL($database) - { - throw DBALException::notSupported(__METHOD__); - } - - /** - * Get sql to set the transaction isolation level - * - * @param integer $level - */ - public function getSetTransactionIsolationSQL($level) - { - throw DBALException::notSupported(__METHOD__); - } - - /** - * Obtain DBMS specific SQL to be used to create datetime fields in - * statements like CREATE TABLE - * - * @param array $fieldDeclaration - * @return string - */ - public function getDateTimeTypeDeclarationSQL(array $fieldDeclaration) - { - throw DBALException::notSupported(__METHOD__); - } - - /** - * Obtain DBMS specific SQL to be used to create datetime with timezone offset fields. - * - * @param array $fieldDeclaration - */ - public function getDateTimeTzTypeDeclarationSQL(array $fieldDeclaration) - { - return $this->getDateTimeTypeDeclarationSQL($fieldDeclaration); - } - - - /** - * Obtain DBMS specific SQL to be used to create date fields in statements - * like CREATE TABLE. - * - * @param array $fieldDeclaration - * @return string - */ - public function getDateTypeDeclarationSQL(array $fieldDeclaration) - { - throw DBALException::notSupported(__METHOD__); - } - - /** - * Obtain DBMS specific SQL to be used to create time fields in statements - * like CREATE TABLE. - * - * @param array $fieldDeclaration - * @return string - */ - public function getTimeTypeDeclarationSQL(array $fieldDeclaration) - { - throw DBALException::notSupported(__METHOD__); - } - - public function getFloatDeclarationSQL(array $fieldDeclaration) - { - return 'DOUBLE PRECISION'; - } - - /** - * Gets the default transaction isolation level of the platform. - * - * @return integer The default isolation level. - * @see Doctrine\DBAL\Connection\TRANSACTION_* constants. - */ - public function getDefaultTransactionIsolationLevel() - { - return Connection::TRANSACTION_READ_COMMITTED; - } - - /* supports*() methods */ - - /** - * Whether the platform supports sequences. - * - * @return boolean - */ - public function supportsSequences() - { - return false; - } - - /** - * Whether the platform supports identity columns. - * Identity columns are columns that recieve an auto-generated value from the - * database on insert of a row. - * - * @return boolean - */ - public function supportsIdentityColumns() - { - return false; - } - - /** - * Whether the platform supports indexes. - * - * @return boolean - */ - public function supportsIndexes() - { - return true; - } - - public function supportsAlterTable() - { - return true; - } - - /** - * Whether the platform supports transactions. - * - * @return boolean - */ - public function supportsTransactions() - { - return true; - } - - /** - * Whether the platform supports savepoints. - * - * @return boolean - */ - public function supportsSavepoints() - { - return true; - } - - /** - * Whether the platform supports releasing savepoints. - * - * @return boolean - */ - public function supportsReleaseSavepoints() - { - return $this->supportsSavepoints(); - } - - /** - * Whether the platform supports primary key constraints. - * - * @return boolean - */ - public function supportsPrimaryConstraints() - { - return true; - } - - /** - * Does the platform supports foreign key constraints? - * - * @return boolean - */ - public function supportsForeignKeyConstraints() - { - return true; - } - - /** - * Does this platform supports onUpdate in foreign key constraints? - * - * @return bool - */ - public function supportsForeignKeyOnUpdate() - { - return ($this->supportsForeignKeyConstraints() && true); - } - - /** - * Whether the platform supports database schemas. - * - * @return boolean - */ - public function supportsSchemas() - { - return false; - } - - /** - * Can this platform emulate schemas? - * - * Platforms that either support or emulate schemas don't automatically - * filter a schema for the namespaced elements in {@link - * AbstractManager#createSchema}. - * - * @return bool - */ - public function canEmulateSchemas() - { - return false; - } - - /** - * Some databases don't allow to create and drop databases at all or only with certain tools. - * - * @return bool - */ - public function supportsCreateDropDatabase() - { - return true; - } - - /** - * Whether the platform supports getting the affected rows of a recent - * update/delete type query. - * - * @return boolean - */ - public function supportsGettingAffectedRows() - { - return true; - } - - /** - * Does this plaform support to add inline column comments as postfix. - * - * @return bool - */ - public function supportsInlineColumnComments() - { - return false; - } - - /** - * Does this platform support the propriortary synatx "COMMENT ON asset" - * - * @return bool - */ - public function supportsCommentOnStatement() - { - return false; - } - - public function getIdentityColumnNullInsertSQL() - { - return ""; - } - - /** - * Gets the format string, as accepted by the date() function, that describes - * the format of a stored datetime value of this platform. - * - * @return string The format string. - */ - public function getDateTimeFormatString() - { - return 'Y-m-d H:i:s'; - } - - /** - * Gets the format string, as accepted by the date() function, that describes - * the format of a stored datetime with timezone value of this platform. - * - * @return string The format string. - */ - public function getDateTimeTzFormatString() - { - return 'Y-m-d H:i:s'; - } - - /** - * Gets the format string, as accepted by the date() function, that describes - * the format of a stored date value of this platform. - * - * @return string The format string. - */ - public function getDateFormatString() - { - return 'Y-m-d'; - } - - /** - * Gets the format string, as accepted by the date() function, that describes - * the format of a stored time value of this platform. - * - * @return string The format string. - */ - public function getTimeFormatString() - { - return 'H:i:s'; - } - - /** - * Modify limit query - * - * @param string $query - * @param int $limit - * @param int $offset - * @return string - */ - final public function modifyLimitQuery($query, $limit, $offset = null) - { - if ( $limit !== null) { - $limit = (int)$limit; - } - - if ( $offset !== null) { - $offset = (int)$offset; - - if ($offset < 0) { - throw new DBALException("LIMIT argument offset=$offset is not valid"); - } - if ( $offset > 0 && ! $this->supportsLimitOffset()) { - throw new DBALException(sprintf("Platform %s does not support offset values in limit queries.", $this->getName())); - } - } - - return $this->doModifyLimitQuery($query, $limit, $offset); - } - - /** - * @param string $query - * @param int $limit - * @param int $offset - * @return string - */ - protected function doModifyLimitQuery($query, $limit, $offset) - { - if ( $limit !== null) { - $query .= ' LIMIT ' . $limit; - } - - if ( $offset !== null) { - $query .= ' OFFSET ' . $offset; - } - - return $query; - } - - /** - * Does the database platform support offsets in modify limit clauses? - * - * @return bool - */ - public function supportsLimitOffset() - { - return true; - } - - /** - * Gets the character casing of a column in an SQL result set of this platform. - * - * @param string $column The column name for which to get the correct character casing. - * @return string The column name in the character casing used in SQL result sets. - */ - public function getSQLResultCasing($column) - { - return $column; - } - - /** - * Makes any fixes to a name of a schema element (table, sequence, ...) that are required - * by restrictions of the platform, like a maximum length. - * - * @param string $schemaName - * @return string - */ - public function fixSchemaElementName($schemaElementName) - { - return $schemaElementName; - } - - /** - * Maximum length of any given databse identifier, like tables or column names. - * - * @return int - */ - public function getMaxIdentifierLength() - { - return 63; - } - - /** - * Get the insert sql for an empty insert statement - * - * @param string $tableName - * @param string $identifierColumnName - * @return string $sql - */ - public function getEmptyIdentityInsertSQL($tableName, $identifierColumnName) - { - return 'INSERT INTO ' . $tableName . ' (' . $identifierColumnName . ') VALUES (null)'; - } - - /** - * Generate a Truncate Table SQL statement for a given table. - * - * Cascade is not supported on many platforms but would optionally cascade the truncate by - * following the foreign keys. - * - * @param string $tableName - * @param bool $cascade - * @return string - */ - public function getTruncateTableSQL($tableName, $cascade = false) - { - return 'TRUNCATE '.$tableName; - } - - /** - * This is for test reasons, many vendors have special requirements for dummy statements. - * - * @return string - */ - public function getDummySelectSQL() - { - return 'SELECT 1'; - } - - /** - * Generate SQL to create a new savepoint - * - * @param string $savepoint - * @return string - */ - public function createSavePoint($savepoint) - { - return 'SAVEPOINT ' . $savepoint; - } - - /** - * Generate SQL to release a savepoint - * - * @param string $savepoint - * @return string - */ - public function releaseSavePoint($savepoint) - { - return 'RELEASE SAVEPOINT ' . $savepoint; - } - - /** - * Generate SQL to rollback a savepoint - * - * @param string $savepoint - * @return string - */ - public function rollbackSavePoint($savepoint) - { - return 'ROLLBACK TO SAVEPOINT ' . $savepoint; - } - - /** - * Return the keyword list instance of this platform. - * - * Throws exception if no keyword list is specified. - * - * @throws DBALException - * @return KeywordList - */ - final public function getReservedKeywordsList() - { - $class = $this->getReservedKeywordsClass(); - $keywords = new $class; - if (!$keywords instanceof \Doctrine\DBAL\Platforms\Keywords\KeywordList) { - throw DBALException::notSupported(__METHOD__); - } - return $keywords; - } - - /** - * The class name of the reserved keywords list. - * - * @return string - */ - protected function getReservedKeywordsClass() - { - throw DBALException::notSupported(__METHOD__); - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DB2Platform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DB2Platform.php deleted file mode 100644 index 198be83..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DB2Platform.php +++ /dev/null @@ -1,587 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Platforms; - -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Schema\Index; -use Doctrine\DBAL\Schema\TableDiff; - -class DB2Platform extends AbstractPlatform -{ - /** - * Gets the SQL Snippet used to declare a BLOB column type. - */ - public function getBlobTypeDeclarationSQL(array $field) - { - throw DBALException::notSupported(__METHOD__); - } - - public function initializeDoctrineTypeMappings() - { - $this->doctrineTypeMapping = array( - 'smallint' => 'smallint', - 'bigint' => 'bigint', - 'integer' => 'integer', - 'time' => 'time', - 'date' => 'date', - 'varchar' => 'string', - 'character' => 'string', - 'clob' => 'text', - 'decimal' => 'decimal', - 'double' => 'float', - 'real' => 'float', - 'timestamp' => 'datetime', - ); - } - - /** - * Gets the SQL snippet used to declare a VARCHAR column type. - * - * @param array $field - */ - protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) - { - return $fixed ? ($length ? 'CHAR(' . $length . ')' : 'CHAR(255)') - : ($length ? 'VARCHAR(' . $length . ')' : 'VARCHAR(255)'); - } - - /** - * Gets the SQL snippet used to declare a CLOB column type. - * - * @param array $field - */ - public function getClobTypeDeclarationSQL(array $field) - { - // todo clob(n) with $field['length']; - return 'CLOB(1M)'; - } - - /** - * Gets the name of the platform. - * - * @return string - */ - public function getName() - { - return 'db2'; - } - - - /** - * Gets the SQL snippet that declares a boolean column. - * - * @param array $columnDef - * @return string - */ - public function getBooleanTypeDeclarationSQL(array $columnDef) - { - return 'SMALLINT'; - } - - /** - * Gets the SQL snippet that declares a 4 byte integer column. - * - * @param array $columnDef - * @return string - */ - public function getIntegerTypeDeclarationSQL(array $columnDef) - { - return 'INTEGER' . $this->_getCommonIntegerTypeDeclarationSQL($columnDef); - } - - /** - * Gets the SQL snippet that declares an 8 byte integer column. - * - * @param array $columnDef - * @return string - */ - public function getBigIntTypeDeclarationSQL(array $columnDef) - { - return 'BIGINT' . $this->_getCommonIntegerTypeDeclarationSQL($columnDef); - } - - /** - * Gets the SQL snippet that declares a 2 byte integer column. - * - * @param array $columnDef - * @return string - */ - public function getSmallIntTypeDeclarationSQL(array $columnDef) - { - return 'SMALLINT' . $this->_getCommonIntegerTypeDeclarationSQL($columnDef); - } - - /** - * Gets the SQL snippet that declares common properties of an integer column. - * - * @param array $columnDef - * @return string - */ - protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef) - { - $autoinc = ''; - if ( ! empty($columnDef['autoincrement'])) { - $autoinc = ' GENERATED BY DEFAULT AS IDENTITY'; - } - return $autoinc; - } - - /** - * Obtain DBMS specific SQL to be used to create datetime fields in - * statements like CREATE TABLE - * - * @param array $fieldDeclaration - * @return string - */ - public function getDateTimeTypeDeclarationSQL(array $fieldDeclaration) - { - if (isset($fieldDeclaration['version']) && $fieldDeclaration['version'] == true) { - return "TIMESTAMP(0) WITH DEFAULT"; - } - - return 'TIMESTAMP(0)'; - } - - /** - * Obtain DBMS specific SQL to be used to create date fields in statements - * like CREATE TABLE. - * - * @param array $fieldDeclaration - * @return string - */ - public function getDateTypeDeclarationSQL(array $fieldDeclaration) - { - return 'DATE'; - } - - /** - * Obtain DBMS specific SQL to be used to create time fields in statements - * like CREATE TABLE. - * - * @param array $fieldDeclaration - * @return string - */ - public function getTimeTypeDeclarationSQL(array $fieldDeclaration) - { - return 'TIME'; - } - - public function getListDatabasesSQL() - { - throw DBALException::notSupported(__METHOD__); - } - - public function getListSequencesSQL($database) - { - throw DBALException::notSupported(__METHOD__); - } - - public function getListTableConstraintsSQL($table) - { - throw DBALException::notSupported(__METHOD__); - } - - /** - * This code fragment is originally from the Zend_Db_Adapter_Db2 class. - * - * @license New BSD License - * @param string $table - * @return string - */ - public function getListTableColumnsSQL($table, $database = null) - { - return "SELECT DISTINCT c.tabschema, c.tabname, c.colname, c.colno, - c.typename, c.default, c.nulls, c.length, c.scale, - c.identity, tc.type AS tabconsttype, k.colseq - FROM syscat.columns c - LEFT JOIN (syscat.keycoluse k JOIN syscat.tabconst tc - ON (k.tabschema = tc.tabschema - AND k.tabname = tc.tabname - AND tc.type = 'P')) - ON (c.tabschema = k.tabschema - AND c.tabname = k.tabname - AND c.colname = k.colname) - WHERE UPPER(c.tabname) = UPPER('" . $table . "') ORDER BY c.colno"; - } - - public function getListTablesSQL() - { - return "SELECT NAME FROM SYSIBM.SYSTABLES WHERE TYPE = 'T'"; - } - - public function getListUsersSQL() - { - throw DBALException::notSupported(__METHOD__); - } - - /** - * Get the SQL to list all views of a database or user. - * - * @param string $database - * @return string - */ - public function getListViewsSQL($database) - { - return "SELECT NAME, TEXT FROM SYSIBM.SYSVIEWS"; - } - - public function getListTableIndexesSQL($table, $currentDatabase = null) - { - return "SELECT NAME, COLNAMES, UNIQUERULE FROM SYSIBM.SYSINDEXES WHERE TBNAME = UPPER('" . $table . "')"; - } - - public function getListTableForeignKeysSQL($table) - { - return "SELECT TBNAME, RELNAME, REFTBNAME, DELETERULE, UPDATERULE, FKCOLNAMES, PKCOLNAMES ". - "FROM SYSIBM.SYSRELS WHERE TBNAME = UPPER('".$table."')"; - } - - public function getCreateViewSQL($name, $sql) - { - return "CREATE VIEW ".$name." AS ".$sql; - } - - public function getDropViewSQL($name) - { - return "DROP VIEW ".$name; - } - - public function getDropSequenceSQL($sequence) - { - throw DBALException::notSupported(__METHOD__); - } - - public function getSequenceNextValSQL($sequenceName) - { - throw DBALException::notSupported(__METHOD__); - } - - public function getCreateDatabaseSQL($database) - { - return "CREATE DATABASE ".$database; - } - - public function getDropDatabaseSQL($database) - { - return "DROP DATABASE ".$database.";"; - } - - public function supportsCreateDropDatabase() - { - return false; - } - - /** - * Whether the platform supports releasing savepoints. - * - * @return boolean - */ - public function supportsReleaseSavepoints() - { - return false; - } - - /** - * Gets the SQL specific for the platform to get the current date. - * - * @return string - */ - public function getCurrentDateSQL() - { - return 'VALUES CURRENT DATE'; - } - - /** - * Gets the SQL specific for the platform to get the current time. - * - * @return string - */ - public function getCurrentTimeSQL() - { - return 'VALUES CURRENT TIME'; - } - - /** - * Gets the SQL specific for the platform to get the current timestamp - * - * @return string - */ - - public function getCurrentTimestampSQL() - { - return "VALUES CURRENT TIMESTAMP"; - } - - /** - * Obtain DBMS specific SQL code portion needed to set an index - * declaration to be used in statements like CREATE TABLE. - * - * @param string $name name of the index - * @param Index $index index definition - * @return string DBMS specific SQL code portion needed to set an index - */ - public function getIndexDeclarationSQL($name, Index $index) - { - return $this->getUniqueConstraintDeclarationSQL($name, $index); - } - - /** - * @param string $tableName - * @param array $columns - * @param array $options - * @return array - */ - protected function _getCreateTableSQL($tableName, array $columns, array $options = array()) - { - $indexes = array(); - if (isset($options['indexes'])) { - $indexes = $options['indexes']; - } - $options['indexes'] = array(); - - $sqls = parent::_getCreateTableSQL($tableName, $columns, $options); - - foreach ($indexes as $index => $definition) { - $sqls[] = $this->getCreateIndexSQL($definition, $tableName); - } - return $sqls; - } - - /** - * Gets the SQL to alter an existing table. - * - * @param TableDiff $diff - * @return array - */ - public function getAlterTableSQL(TableDiff $diff) - { - $sql = array(); - $columnSql = array(); - - $queryParts = array(); - foreach ($diff->addedColumns AS $fieldName => $column) { - if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { - continue; - } - - $queryParts[] = 'ADD COLUMN ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); - } - - foreach ($diff->removedColumns AS $column) { - if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) { - continue; - } - - $queryParts[] = 'DROP COLUMN ' . $column->getQuotedName($this); - } - - foreach ($diff->changedColumns AS $columnDiff) { - if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { - continue; - } - - /* @var $columnDiff Doctrine\DBAL\Schema\ColumnDiff */ - $column = $columnDiff->column; - $queryParts[] = 'ALTER ' . ($columnDiff->oldColumnName) . ' ' - . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); - } - - foreach ($diff->renamedColumns AS $oldColumnName => $column) { - if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) { - continue; - } - - $queryParts[] = 'RENAME ' . $oldColumnName . ' TO ' . $column->getQuotedName($this); - } - - $tableSql = array(); - - if (!$this->onSchemaAlterTable($diff, $tableSql)) { - if (count($queryParts) > 0) { - $sql[] = 'ALTER TABLE ' . $diff->name . ' ' . implode(" ", $queryParts); - } - - $sql = array_merge($sql, $this->_getAlterTableIndexForeignKeySQL($diff)); - - if ($diff->newName !== false) { - $sql[] = 'RENAME TABLE TO ' . $diff->newName; - } - } - - return array_merge($sql, $tableSql, $columnSql); - } - - public function getDefaultValueDeclarationSQL($field) - { - if (isset($field['notnull']) && $field['notnull'] && !isset($field['default'])) { - if (in_array((string)$field['type'], array("Integer", "BigInteger", "SmallInteger"))) { - $field['default'] = 0; - } else if((string)$field['type'] == "DateTime") { - $field['default'] = "00-00-00 00:00:00"; - } else if ((string)$field['type'] == "Date") { - $field['default'] = "00-00-00"; - } else if((string)$field['type'] == "Time") { - $field['default'] = "00:00:00"; - } else { - $field['default'] = ''; - } - } - - unset($field['default']); // @todo this needs fixing - if (isset($field['version']) && $field['version']) { - if ((string)$field['type'] != "DateTime") { - $field['default'] = "1"; - } - } - - return parent::getDefaultValueDeclarationSQL($field); - } - - /** - * Get the insert sql for an empty insert statement - * - * @param string $tableName - * @param string $identifierColumnName - * @return string $sql - */ - public function getEmptyIdentityInsertSQL($tableName, $identifierColumnName) - { - return 'INSERT INTO ' . $tableName . ' (' . $identifierColumnName . ') VALUES (DEFAULT)'; - } - - public function getCreateTemporaryTableSnippetSQL() - { - return "DECLARE GLOBAL TEMPORARY TABLE"; - } - - /** - * DB2 automatically moves temporary tables into the SESSION. schema. - * - * @param string $tableName - * @return string - */ - public function getTemporaryTableName($tableName) - { - return "SESSION." . $tableName; - } - - protected function doModifyLimitQuery($query, $limit, $offset = null) - { - if ($limit === null && $offset === null) { - return $query; - } - - $limit = (int)$limit; - $offset = (int)(($offset)?:0); - - // Todo OVER() needs ORDER BY data! - $sql = 'SELECT db22.* FROM (SELECT ROW_NUMBER() OVER() AS DC_ROWNUM, db21.* '. - 'FROM (' . $query . ') db21) db22 WHERE db22.DC_ROWNUM BETWEEN ' . ($offset+1) .' AND ' . ($offset+$limit); - return $sql; - } - - /** - * returns the position of the first occurrence of substring $substr in string $str - * - * @param string $substr literal string to find - * @param string $str literal string - * @param int $pos position to start at, beginning of string by default - * @return integer - */ - public function getLocateExpression($str, $substr, $startPos = false) - { - if ($startPos == false) { - return 'LOCATE(' . $substr . ', ' . $str . ')'; - } else { - return 'LOCATE(' . $substr . ', ' . $str . ', '.$startPos.')'; - } - } - - /** - * return string to call a function to get a substring inside an SQL statement - * - * Note: Not SQL92, but common functionality. - * - * SQLite only supports the 2 parameter variant of this function - * - * @param string $value an sql string literal or column name/alias - * @param integer $from where to start the substring portion - * @param integer $len the substring portion length - * @return string - */ - public function getSubstringExpression($value, $from, $len = null) - { - if ($len === null) - return 'SUBSTR(' . $value . ', ' . $from . ')'; - else { - return 'SUBSTR(' . $value . ', ' . $from . ', ' . $len . ')'; - } - } - - public function supportsIdentityColumns() - { - return true; - } - - public function prefersIdentityColumns() - { - return true; - } - - /** - * Gets the character casing of a column in an SQL result set of this platform. - * - * DB2 returns all column names in SQL result sets in uppercase. - * - * @param string $column The column name for which to get the correct character casing. - * @return string The column name in the character casing used in SQL result sets. - */ - public function getSQLResultCasing($column) - { - return strtoupper($column); - } - - public function getForUpdateSQL() - { - return ' WITH RR USE AND KEEP UPDATE LOCKS'; - } - - public function getDummySelectSQL() - { - return 'SELECT 1 FROM sysibm.sysdummy1'; - } - - /** - * DB2 supports savepoints, but they work semantically different than on other vendor platforms. - * - * TODO: We have to investigate how to get DB2 up and running with savepoints. - * - * @return bool - */ - public function supportsSavepoints() - { - return false; - } - - protected function getReservedKeywordsClass() - { - return 'Doctrine\DBAL\Platforms\Keywords\DB2Keywords'; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/DB2Keywords.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/DB2Keywords.php deleted file mode 100644 index 4b77cac..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/DB2Keywords.php +++ /dev/null @@ -1,438 +0,0 @@ -. - */ - - -namespace Doctrine\DBAL\Platforms\Keywords; - -/** - * DB2 Keywords - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.0 - * @author Benjamin Eberlei - */ -class DB2Keywords extends KeywordList -{ - public function getName() - { - return 'DB2'; - } - - protected function getKeywords() - { - return array( - 'ACTIVATE', - 'ADD', - 'AFTER', - 'ALIAS', - 'ALL', - 'ALLOCATE', - 'DOCUMENT', - 'DOUBLE', - 'DROP', - 'DSSIZE', - 'DYNAMIC', - 'EACH', - 'LOCK', - 'LOCKMAX', - 'LOCKSIZE', - 'LONG', - 'LOOP', - 'MAINTAINED', - 'ROUND_CEILING', - 'ROUND_DOWN', - 'ROUND_FLOOR', - 'ROUND_HALF_DOWN', - 'ROUND_HALF_EVEN', - 'ROUND_HALF_UP', - 'ALLOW', - 'ALTER', - 'AND', - 'ANY', - 'AS', - 'ASENSITIVE', - 'ASSOCIATE', - 'ASUTIME', - 'AT', - 'ATTRIBUTES', - 'AUDIT', - 'AUTHORIZATION', - 'AUX', - 'AUXILIARY', - 'BEFORE', - 'BEGIN', - 'BETWEEN', - 'BINARY', - 'BUFFERPOOL', - 'BY', - 'CACHE', - 'CALL', - 'CALLED', - 'CAPTURE', - 'CARDINALITY', - 'CASCADED', - 'CASE', - 'CAST', - 'CCSID', - 'CHAR', - 'CHARACTER', - 'CHECK', - 'CLONE', - 'CLOSE', - 'CLUSTER', - 'COLLECTION', - 'COLLID', - 'COLUMN', - 'COMMENT', - 'COMMIT', - 'CONCAT', - 'CONDITION', - 'CONNECT', - 'CONNECTION', - 'CONSTRAINT', - 'CONTAINS', - 'CONTINUE', - 'COUNT', - 'COUNT_BIG', - 'CREATE', - 'CROSS', - 'CURRENT', - 'CURRENT_DATE', - 'CURRENT_LC_CTYPE', - 'CURRENT_PATH', - 'CURRENT_SCHEMA', - 'CURRENT_SERVER', - 'CURRENT_TIME', - 'CURRENT_TIMESTAMP', - 'CURRENT_TIMEZONE', - 'CURRENT_USER', - 'CURSOR', - 'CYCLE', - 'DATA', - 'DATABASE', - 'DATAPARTITIONNAME', - 'DATAPARTITIONNUM', - 'EDITPROC', - 'ELSE', - 'ELSEIF', - 'ENABLE', - 'ENCODING', - 'ENCRYPTION', - 'END', - 'END-EXEC', - 'ENDING', - 'ERASE', - 'ESCAPE', - 'EVERY', - 'EXCEPT', - 'EXCEPTION', - 'EXCLUDING', - 'EXCLUSIVE', - 'EXECUTE', - 'EXISTS', - 'EXIT', - 'EXPLAIN', - 'EXTERNAL', - 'EXTRACT', - 'FENCED', - 'FETCH', - 'FIELDPROC', - 'FILE', - 'FINAL', - 'FOR', - 'FOREIGN', - 'FREE', - 'FROM', - 'FULL', - 'FUNCTION', - 'GENERAL', - 'GENERATED', - 'GET', - 'GLOBAL', - 'GO', - 'GOTO', - 'GRANT', - 'GRAPHIC', - 'GROUP', - 'HANDLER', - 'HASH', - 'HASHED_VALUE', - 'HAVING', - 'HINT', - 'HOLD', - 'HOUR', - 'HOURS', - 'IDENTITY', - 'IF', - 'IMMEDIATE', - 'IN', - 'INCLUDING', - 'INCLUSIVE', - 'INCREMENT', - 'INDEX', - 'INDICATOR', - 'INF', - 'INFINITY', - 'INHERIT', - 'INNER', - 'INOUT', - 'INSENSITIVE', - 'INSERT', - 'INTEGRITY', - 'MATERIALIZED', - 'MAXVALUE', - 'MICROSECOND', - 'MICROSECONDS', - 'MINUTE', - 'MINUTES', - 'MINVALUE', - 'MODE', - 'MODIFIES', - 'MONTH', - 'MONTHS', - 'NAN', - 'NEW', - 'NEW_TABLE', - 'NEXTVAL', - 'NO', - 'NOCACHE', - 'NOCYCLE', - 'NODENAME', - 'NODENUMBER', - 'NOMAXVALUE', - 'NOMINVALUE', - 'NONE', - 'NOORDER', - 'NORMALIZED', - 'NOT', - 'NULL', - 'NULLS', - 'NUMPARTS', - 'OBID', - 'OF', - 'OLD', - 'OLD_TABLE', - 'ON', - 'OPEN', - 'OPTIMIZATION', - 'OPTIMIZE', - 'OPTION', - 'OR', - 'ORDER', - 'OUT', - 'OUTER', - 'OVER', - 'OVERRIDING', - 'PACKAGE', - 'PADDED', - 'PAGESIZE', - 'PARAMETER', - 'PART', - 'PARTITION', - 'PARTITIONED', - 'PARTITIONING', - 'PARTITIONS', - 'PASSWORD', - 'PATH', - 'PIECESIZE', - 'PLAN', - 'POSITION', - 'PRECISION', - 'PREPARE', - 'PREVVAL', - 'PRIMARY', - 'PRIQTY', - 'PRIVILEGES', - 'PROCEDURE', - 'PROGRAM', - 'PSID', - 'ROUND_UP', - 'ROUTINE', - 'ROW', - 'ROW_NUMBER', - 'ROWNUMBER', - 'ROWS', - 'ROWSET', - 'RRN', - 'RUN', - 'SAVEPOINT', - 'SCHEMA', - 'SCRATCHPAD', - 'SCROLL', - 'SEARCH', - 'SECOND', - 'SECONDS', - 'SECQTY', - 'SECURITY', - 'SELECT', - 'SENSITIVE', - 'SEQUENCE', - 'SESSION', - 'SESSION_USER', - 'SET', - 'SIGNAL', - 'SIMPLE', - 'SNAN', - 'SOME', - 'SOURCE', - 'SPECIFIC', - 'SQL', - 'SQLID', - 'STACKED', - 'STANDARD', - 'START', - 'STARTING', - 'STATEMENT', - 'STATIC', - 'STATMENT', - 'STAY', - 'STOGROUP', - 'STORES', - 'STYLE', - 'SUBSTRING', - 'SUMMARY', - 'SYNONYM', - 'SYSFUN', - 'SYSIBM', - 'SYSPROC', - 'SYSTEM', - 'SYSTEM_USER', - 'TABLE', - 'TABLESPACE', - 'THEN', - 'TIME', - 'TIMESTAMP', - 'TO', - 'TRANSACTION', - 'TRIGGER', - 'TRIM', - 'TRUNCATE', - 'TYPE', - 'UNDO', - 'UNION', - 'UNIQUE', - 'UNTIL', - 'UPDATE', - 'DATE', - 'DAY', - 'DAYS', - 'DB2GENERAL', - 'DB2GENRL', - 'DB2SQL', - 'DBINFO', - 'DBPARTITIONNAME', - 'DBPARTITIONNUM', - 'DEALLOCATE', - 'DECLARE', - 'DEFAULT', - 'DEFAULTS', - 'DEFINITION', - 'DELETE', - 'DENSE_RANK', - 'DENSERANK', - 'DESCRIBE', - 'DESCRIPTOR', - 'DETERMINISTIC', - 'DIAGNOSTICS', - 'DISABLE', - 'DISALLOW', - 'DISCONNECT', - 'DISTINCT', - 'DO', - 'INTERSECT', - 'PUBLIC', - 'USAGE', - 'INTO', - 'QUERY', - 'USER', - 'IS', - 'QUERYNO', - 'USING', - 'ISOBID', - 'RANGE', - 'VALIDPROC', - 'ISOLATION', - 'RANK', - 'VALUE', - 'ITERATE', - 'READ', - 'VALUES', - 'JAR', - 'READS', - 'VARIABLE', - 'JAVA', - 'RECOVERY', - 'VARIANT', - 'JOIN', - 'REFERENCES', - 'VCAT', - 'KEEP', - 'REFERENCING', - 'VERSION', - 'KEY', - 'REFRESH', - 'VIEW', - 'LABEL', - 'RELEASE', - 'VOLATILE', - 'LANGUAGE', - 'RENAME', - 'VOLUMES', - 'LATERAL', - 'REPEAT', - 'WHEN', - 'LC_CTYPE', - 'RESET', - 'WHENEVER', - 'LEAVE', - 'RESIGNAL', - 'WHERE', - 'LEFT', - 'RESTART', - 'WHILE', - 'LIKE', - 'RESTRICT', - 'WITH', - 'LINKTYPE', - 'RESULT', - 'WITHOUT', - 'LOCAL', - 'RESULT_SET_LOCATOR WLM', - 'LOCALDATE', - 'RETURN', - 'WRITE', - 'LOCALE', - 'RETURNS', - 'XMLELEMENT', - 'LOCALTIME', - 'REVOKE', - 'XMLEXISTS', - 'LOCALTIMESTAMP RIGHT', - 'XMLNAMESPACES', - 'LOCATOR', - 'ROLE', - 'YEAR', - 'LOCATORS', - 'ROLLBACK', - 'YEARS', - ); - } -} - diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/KeywordList.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/KeywordList.php deleted file mode 100644 index dccd717..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/KeywordList.php +++ /dev/null @@ -1,63 +0,0 @@ -. - */ - - -namespace Doctrine\DBAL\Platforms\Keywords; - -/** - * Abstract interface for a SQL reserved keyword dictionary. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.0 - * @author Benjamin Eberlei - */ -abstract class KeywordList -{ - private $keywords = null; - - /** - * Check if the given word is a keyword of this dialect/vendor platform. - * - * @param string $word - * @return bool - */ - public function isKeyword($word) - { - if ($this->keywords === null) { - $this->initializeKeywords(); - } - - return isset($this->keywords[strtoupper($word)]); - } - - protected function initializeKeywords() - { - $this->keywords = array_flip(array_map('strtoupper', $this->getKeywords())); - } - - abstract protected function getKeywords(); - - /** - * Name of this keyword list. - * - * @return string - */ - abstract public function getName(); -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MsSQLKeywords.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MsSQLKeywords.php deleted file mode 100644 index f59ae81..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MsSQLKeywords.php +++ /dev/null @@ -1,243 +0,0 @@ -. - */ - - -namespace Doctrine\DBAL\Platforms\Keywords; - -/** - * MsSQL Keywordlist - * - * @license BSD http://www.opensource.org/licenses/bsd-license.php - * @link www.doctrine-project.com - * @since 2.0 - * @author Benjamin Eberlei - * @author David Coallier - */ -class MsSQLKeywords extends KeywordList -{ - public function getName() - { - return 'MsSQL'; - } - - protected function getKeywords() - { - return array( - 'ADD', - 'CURRENT_TIMESTAMP', - 'GROUP', - 'OPENQUERY', - 'SERIALIZABLE', - 'ALL', - 'CURRENT_USER', - 'HAVING', - 'OPENROWSET', - 'SESSION_USER', - 'ALTER', - 'CURSOR', - 'HOLDLOCK', - 'OPTION', - 'SET', - 'AND', - 'DATABASE', - 'IDENTITY', - 'OR', - 'SETUSER', - 'ANY', - 'DBCC', - 'IDENTITYCOL', - 'ORDER', - 'SHUTDOWN', - 'AS', - 'DEALLOCATE', - 'IDENTITY_INSERT', - 'OUTER', - 'SOME', - 'ASC', - 'DECLARE', - 'IF', - 'OVER', - 'STATISTICS', - 'AUTHORIZATION', - 'DEFAULT', - 'IN', - 'PERCENT', - 'SUM', - 'AVG', - 'DELETE', - 'INDEX', - 'PERM', - 'SYSTEM_USER', - 'BACKUP', - 'DENY', - 'INNER', - 'PERMANENT', - 'TABLE', - 'BEGIN', - 'DESC', - 'INSERT', - 'PIPE', - 'TAPE', - 'BETWEEN', - 'DISK', - 'INTERSECT', - 'PLAN', - 'TEMP', - 'BREAK', - 'DISTINCT', - 'INTO', - 'PRECISION', - 'TEMPORARY', - 'BROWSE', - 'DISTRIBUTED', - 'IS', - 'PREPARE', - 'TEXTSIZE', - 'BULK', - 'DOUBLE', - 'ISOLATION', - 'PRIMARY', - 'THEN', - 'BY', - 'DROP', - 'JOIN', - 'PRINT', - 'TO', - 'CASCADE', - 'DUMMY', - 'KEY', - 'PRIVILEGES', - 'TOP', - 'CASE', - 'DUMP', - 'KILL', - 'PROC', - 'TRAN', - 'CHECK', - 'ELSE', - 'LEFT', - 'PROCEDURE', - 'TRANSACTION', - 'CHECKPOINT', - 'END', - 'LEVEL', - 'PROCESSEXIT', - 'TRIGGER', - 'CLOSE', - 'ERRLVL', - 'LIKE', - 'PUBLIC', - 'TRUNCATE', - 'CLUSTERED', - 'ERROREXIT', - 'LINENO', - 'RAISERROR', - 'TSEQUAL', - 'COALESCE', - 'ESCAPE', - 'LOAD', - 'READ', - 'UNCOMMITTED', - 'COLUMN', - 'EXCEPT', - 'MAX', - 'READTEXT', - 'UNION', - 'COMMIT', - 'EXEC', - 'MIN', - 'RECONFIGURE', - 'UNIQUE', - 'COMMITTED', - 'EXECUTE', - 'MIRROREXIT', - 'REFERENCES', - 'UPDATE', - 'COMPUTE', - 'EXISTS', - 'NATIONAL', - 'REPEATABLE', - 'UPDATETEXT', - 'CONFIRM', - 'EXIT', - 'NOCHECK', - 'REPLICATION', - 'USE', - 'CONSTRAINT', - 'FETCH', - 'NONCLUSTERED', - 'RESTORE', - 'USER', - 'CONTAINS', - 'FILE', - 'NOT', - 'RESTRICT', - 'VALUES', - 'CONTAINSTABLE', - 'FILLFACTOR', - 'NULL', - 'RETURN', - 'VARYING', - 'CONTINUE', - 'FLOPPY', - 'NULLIF', - 'REVOKE', - 'VIEW', - 'CONTROLROW', - 'FOR', - 'OF', - 'RIGHT', - 'WAITFOR', - 'CONVERT', - 'FOREIGN', - 'OFF', - 'ROLLBACK', - 'WHEN', - 'COUNT', - 'FREETEXT', - 'OFFSETS', - 'ROWCOUNT', - 'WHERE', - 'CREATE', - 'FREETEXTTABLE', - 'ON', - 'ROWGUIDCOL', - 'WHILE', - 'CROSS', - 'FROM', - 'ONCE', - 'RULE', - 'WITH', - 'CURRENT', - 'FULL', - 'ONLY', - 'SAVE', - 'WORK', - 'CURRENT_DATE', - 'GOTO', - 'OPEN', - 'SCHEMA', - 'WRITETEXT', - 'CURRENT_TIME', - 'GRANT', - 'OPENDATASOURCE', - 'SELECT', - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MySQLKeywords.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MySQLKeywords.php deleted file mode 100644 index 1d58749..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MySQLKeywords.php +++ /dev/null @@ -1,268 +0,0 @@ -. - */ - - -namespace Doctrine\DBAL\Platforms\Keywords; - -/** - * MySQL Keywordlist - * - * @license BSD http://www.opensource.org/licenses/bsd-license.php - * @link www.doctrine-project.com - * @since 2.0 - * @author Benjamin Eberlei - * @author David Coallier - */ -class MySQLKeywords extends KeywordList -{ - public function getName() - { - return 'MySQL'; - } - - protected function getKeywords() - { - return array( - 'ADD', - 'ALL', - 'ALTER', - 'ANALYZE', - 'AND', - 'AS', - 'ASC', - 'ASENSITIVE', - 'BEFORE', - 'BETWEEN', - 'BIGINT', - 'BINARY', - 'BLOB', - 'BOTH', - 'BY', - 'CALL', - 'CASCADE', - 'CASE', - 'CHANGE', - 'CHAR', - 'CHARACTER', - 'CHECK', - 'COLLATE', - 'COLUMN', - 'CONDITION', - 'CONNECTION', - 'CONSTRAINT', - 'CONTINUE', - 'CONVERT', - 'CREATE', - 'CROSS', - 'CURRENT_DATE', - 'CURRENT_TIME', - 'CURRENT_TIMESTAMP', - 'CURRENT_USER', - 'CURSOR', - 'DATABASE', - 'DATABASES', - 'DAY_HOUR', - 'DAY_MICROSECOND', - 'DAY_MINUTE', - 'DAY_SECOND', - 'DEC', - 'DECIMAL', - 'DECLARE', - 'DEFAULT', - 'DELAYED', - 'DELETE', - 'DESC', - 'DESCRIBE', - 'DETERMINISTIC', - 'DISTINCT', - 'DISTINCTROW', - 'DIV', - 'DOUBLE', - 'DROP', - 'DUAL', - 'EACH', - 'ELSE', - 'ELSEIF', - 'ENCLOSED', - 'ESCAPED', - 'EXISTS', - 'EXIT', - 'EXPLAIN', - 'FALSE', - 'FETCH', - 'FLOAT', - 'FLOAT4', - 'FLOAT8', - 'FOR', - 'FORCE', - 'FOREIGN', - 'FROM', - 'FULLTEXT', - 'GOTO', - 'GRANT', - 'GROUP', - 'HAVING', - 'HIGH_PRIORITY', - 'HOUR_MICROSECOND', - 'HOUR_MINUTE', - 'HOUR_SECOND', - 'IF', - 'IGNORE', - 'IN', - 'INDEX', - 'INFILE', - 'INNER', - 'INOUT', - 'INSENSITIVE', - 'INSERT', - 'INT', - 'INT1', - 'INT2', - 'INT3', - 'INT4', - 'INT8', - 'INTEGER', - 'INTERVAL', - 'INTO', - 'IS', - 'ITERATE', - 'JOIN', - 'KEY', - 'KEYS', - 'KILL', - 'LABEL', - 'LEADING', - 'LEAVE', - 'LEFT', - 'LIKE', - 'LIMIT', - 'LINES', - 'LOAD', - 'LOCALTIME', - 'LOCALTIMESTAMP', - 'LOCK', - 'LONG', - 'LONGBLOB', - 'LONGTEXT', - 'LOOP', - 'LOW_PRIORITY', - 'MATCH', - 'MEDIUMBLOB', - 'MEDIUMINT', - 'MEDIUMTEXT', - 'MIDDLEINT', - 'MINUTE_MICROSECOND', - 'MINUTE_SECOND', - 'MOD', - 'MODIFIES', - 'NATURAL', - 'NOT', - 'NO_WRITE_TO_BINLOG', - 'NULL', - 'NUMERIC', - 'ON', - 'OPTIMIZE', - 'OPTION', - 'OPTIONALLY', - 'OR', - 'ORDER', - 'OUT', - 'OUTER', - 'OUTFILE', - 'PRECISION', - 'PRIMARY', - 'PROCEDURE', - 'PURGE', - 'RAID0', - 'READ', - 'READS', - 'REAL', - 'REFERENCES', - 'REGEXP', - 'RELEASE', - 'RENAME', - 'REPEAT', - 'REPLACE', - 'REQUIRE', - 'RESTRICT', - 'RETURN', - 'REVOKE', - 'RIGHT', - 'RLIKE', - 'SCHEMA', - 'SCHEMAS', - 'SECOND_MICROSECOND', - 'SELECT', - 'SENSITIVE', - 'SEPARATOR', - 'SET', - 'SHOW', - 'SMALLINT', - 'SONAME', - 'SPATIAL', - 'SPECIFIC', - 'SQL', - 'SQLEXCEPTION', - 'SQLSTATE', - 'SQLWARNING', - 'SQL_BIG_RESULT', - 'SQL_CALC_FOUND_ROWS', - 'SQL_SMALL_RESULT', - 'SSL', - 'STARTING', - 'STRAIGHT_JOIN', - 'TABLE', - 'TERMINATED', - 'THEN', - 'TINYBLOB', - 'TINYINT', - 'TINYTEXT', - 'TO', - 'TRAILING', - 'TRIGGER', - 'TRUE', - 'UNDO', - 'UNION', - 'UNIQUE', - 'UNLOCK', - 'UNSIGNED', - 'UPDATE', - 'USAGE', - 'USE', - 'USING', - 'UTC_DATE', - 'UTC_TIME', - 'UTC_TIMESTAMP', - 'VALUES', - 'VARBINARY', - 'VARCHAR', - 'VARCHARACTER', - 'VARYING', - 'WHEN', - 'WHERE', - 'WHILE', - 'WITH', - 'WRITE', - 'X509', - 'XOR', - 'YEAR_MONTH', - 'ZEROFILL', - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/OracleKeywords.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/OracleKeywords.php deleted file mode 100644 index a5840a0..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/OracleKeywords.php +++ /dev/null @@ -1,156 +0,0 @@ -. - */ - - -namespace Doctrine\DBAL\Platforms\Keywords; - -/** - * Oracle Keywordlist - * - * @license BSD http://www.opensource.org/licenses/bsd-license.php - * @link www.doctrine-project.com - * @since 2.0 - * @author Benjamin Eberlei - * @author David Coallier - */ -class OracleKeywords extends KeywordList -{ - public function getName() - { - return 'Oracle'; - } - - protected function getKeywords() - { - return array( - 'ACCESS', - 'ELSE', - 'MODIFY', - 'START', - 'ADD', - 'EXCLUSIVE', - 'NOAUDIT', - 'SELECT', - 'ALL', - 'EXISTS', - 'NOCOMPRESS', - 'SESSION', - 'ALTER', - 'FILE', - 'NOT', - 'SET', - 'AND', - 'FLOAT', - 'NOTFOUND ', - 'SHARE', - 'ANY', - 'FOR', - 'NOWAIT', - 'SIZE', - 'ARRAYLEN', - 'FROM', - 'NULL', - 'SMALLINT', - 'AS', - 'GRANT', - 'NUMBER', - 'SQLBUF', - 'ASC', - 'GROUP', - 'OF', - 'SUCCESSFUL', - 'AUDIT', - 'HAVING', - 'OFFLINE ', - 'SYNONYM', - 'BETWEEN', - 'IDENTIFIED', - 'ON', - 'SYSDATE', - 'BY', - 'IMMEDIATE', - 'ONLINE', - 'TABLE', - 'CHAR', - 'IN', - 'OPTION', - 'THEN', - 'CHECK', - 'INCREMENT', - 'OR', - 'TO', - 'CLUSTER', - 'INDEX', - 'ORDER', - 'TRIGGER', - 'COLUMN', - 'INITIAL', - 'PCTFREE', - 'UID', - 'COMMENT', - 'INSERT', - 'PRIOR', - 'UNION', - 'COMPRESS', - 'INTEGER', - 'PRIVILEGES', - 'UNIQUE', - 'CONNECT', - 'INTERSECT', - 'PUBLIC', - 'UPDATE', - 'CREATE', - 'INTO', - 'RAW', - 'USER', - 'CURRENT', - 'IS', - 'RENAME', - 'VALIDATE', - 'DATE', - 'LEVEL', - 'RESOURCE', - 'VALUES', - 'DECIMAL', - 'LIKE', - 'REVOKE', - 'VARCHAR', - 'DEFAULT', - 'LOCK', - 'ROW', - 'VARCHAR2', - 'DELETE', - 'LONG', - 'ROWID', - 'VIEW', - 'DESC', - 'MAXEXTENTS', - 'ROWLABEL', - 'WHENEVER', - 'DISTINCT', - 'MINUS', - 'ROWNUM', - 'WHERE', - 'DROP', - 'MODE', - 'ROWS', - 'WITH', - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQLKeywords.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQLKeywords.php deleted file mode 100644 index e5acea0..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQLKeywords.php +++ /dev/null @@ -1,131 +0,0 @@ -. - */ - - -namespace Doctrine\DBAL\Platforms\Keywords; - -/** - * PostgreSQL Keywordlist - * - * @license BSD http://www.opensource.org/licenses/bsd-license.php - * @link www.doctrine-project.com - * @since 2.0 - * @author Benjamin Eberlei - * @author Marcelo Santos Araujo - */ -class PostgreSQLKeywords extends KeywordList -{ - public function getName() - { - return 'PostgreSQL'; - } - - protected function getKeywords() - { - return array( - 'ALL', - 'ANALYSE', - 'ANALYZE', - 'AND', - 'ANY', - 'AS', - 'ASC', - 'AUTHORIZATION', - 'BETWEEN', - 'BINARY', - 'BOTH', - 'CASE', - 'CAST', - 'CHECK', - 'COLLATE', - 'COLUMN', - 'CONSTRAINT', - 'CREATE', - 'CURRENT_DATE', - 'CURRENT_TIME', - 'CURRENT_TIMESTAMP', - 'CURRENT_USER', - 'DEFAULT', - 'DEFERRABLE', - 'DESC', - 'DISTINCT', - 'DO', - 'ELSE', - 'END', - 'EXCEPT', - 'FALSE', - 'FOR', - 'FOREIGN', - 'FREEZE', - 'FROM', - 'FULL', - 'GRANT', - 'GROUP', - 'HAVING', - 'ILIKE', - 'IN', - 'INITIALLY', - 'INNER', - 'INTERSECT', - 'INTO', - 'IS', - 'ISNULL', - 'JOIN', - 'LEADING', - 'LEFT', - 'LIKE', - 'LIMIT', - 'LOCALTIME', - 'LOCALTIMESTAMP', - 'NATURAL', - 'NEW', - 'NOT', - 'NOTNULL', - 'NULL', - 'OFF', - 'OFFSET', - 'OLD', - 'ON', - 'ONLY', - 'OR', - 'ORDER', - 'OUTER', - 'OVERLAPS', - 'PLACING', - 'PRIMARY', - 'REFERENCES', - 'SELECT', - 'SESSION_USER', - 'SIMILAR', - 'SOME', - 'TABLE', - 'THEN', - 'TO', - 'TRAILING', - 'TRUE', - 'UNION', - 'UNIQUE', - 'USER', - 'USING', - 'VERBOSE', - 'WHEN', - 'WHERE' - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/ReservedKeywordsValidator.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/ReservedKeywordsValidator.php deleted file mode 100644 index 5c99ba3..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/ReservedKeywordsValidator.php +++ /dev/null @@ -1,116 +0,0 @@ -. - */ - - -namespace Doctrine\DBAL\Platforms\Keywords; - -use Doctrine\DBAL\Schema\Visitor\Visitor; -use Doctrine\DBAL\Schema\Table; -use Doctrine\DBAL\Schema\Column; -use Doctrine\DBAL\Schema\ForeignKeyConstraint; -use Doctrine\DBAL\Schema\Schema; -use Doctrine\DBAL\Schema\Sequence; -use Doctrine\DBAL\Schema\Index; - -class ReservedKeywordsValidator implements Visitor -{ - /** - * @var KeywordList[] - */ - private $keywordLists = array(); - - /** - * @var array - */ - private $violations = array(); - - public function __construct(array $keywordLists) - { - $this->keywordLists = $keywordLists; - } - - public function getViolations() - { - return $this->violations; - } - - /** - * @param string $word - * @return array - */ - private function isReservedWord($word) - { - if ($word[0] == "`") { - $word = str_replace('`', '', $word); - } - - $keywordLists = array(); - foreach ($this->keywordLists AS $keywordList) { - if ($keywordList->isKeyword($word)) { - $keywordLists[] = $keywordList->getName(); - } - } - return $keywordLists; - } - - private function addViolation($asset, $violatedPlatforms) - { - if (!$violatedPlatforms) { - return; - } - - $this->violations[] = $asset . ' keyword violations: ' . implode(', ', $violatedPlatforms); - } - - public function acceptColumn(Table $table, Column $column) - { - $this->addViolation( - 'Table ' . $table->getName() . ' column ' . $column->getName(), - $this->isReservedWord($column->getName()) - ); - } - - public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) - { - - } - - public function acceptIndex(Table $table, Index $index) - { - - } - - public function acceptSchema(Schema $schema) - { - - } - - public function acceptSequence(Sequence $sequence) - { - - } - - public function acceptTable(Table $table) - { - $this->addViolation( - 'Table ' . $table->getName(), - $this->isReservedWord($table->getName()) - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLiteKeywords.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLiteKeywords.php deleted file mode 100644 index 4d12aff..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLiteKeywords.php +++ /dev/null @@ -1,164 +0,0 @@ -. - */ - - -namespace Doctrine\DBAL\Platforms\Keywords; - -/** - * SQLite Keywords - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.0 - * @author Benjamin Eberlei - */ -class SQLiteKeywords extends KeywordList -{ - public function getName() - { - return 'SQLite'; - } - - protected function getKeywords() - { - return array( - 'ABORT', - 'ACTION', - 'ADD', - 'AFTER', - 'ALL', - 'ALTER', - 'ANALYZE', - 'AND', - 'AS', - 'ASC', - 'ATTACH', - 'AUTOINCREMENT', - 'BEFORE', - 'BEGIN', - 'BETWEEN', - 'BY', - 'CASCADE', - 'CASE', - 'CAST', - 'CHECK', - 'COLLATE', - 'COLUMN', - 'COMMIT', - 'CONFLICT', - 'CONSTRAINT', - 'CREATE', - 'CROSS', - 'CURRENT_DATE', - 'CURRENT_TIME', - 'CURRENT_TIMESTAMP', - 'DATABASE', - 'DEFAULT', - 'DEFERRABLE', - 'DEFERRED', - 'DELETE', - 'DESC', - 'DETACH', - 'DISTINCT', - 'DROP', - 'EACH', - 'ELSE', - 'END', - 'ESCAPE', - 'EXCEPT', - 'EXCLUSIVE', - 'EXISTS', - 'EXPLAIN', - 'FAIL', - 'FOR', - 'FOREIGN', - 'FROM', - 'FULL', - 'GLOB', - 'GROUP', - 'HAVING', - 'IF', - 'IGNORE', - 'IMMEDIATE', - 'IN', - 'INDEX', - 'INDEXED', - 'INITIALLY', - 'INNER', - 'INSERT', - 'INSTEAD', - 'INTERSECT', - 'INTO', - 'IS', - 'ISNULL', - 'JOIN', - 'KEY', - 'LEFT', - 'LIKE', - 'LIMIT', - 'MATCH', - 'NATURAL', - 'NO', - 'NOT', - 'NOTNULL', - 'NULL', - 'OF', - 'OFFSET', - 'ON', - 'OR', - 'ORDER', - 'OUTER', - 'PLAN', - 'PRAGMA', - 'PRIMARY', - 'QUERY', - 'RAISE', - 'REFERENCES', - 'REGEXP', - 'REINDEX', - 'RELEASE', - 'RENAME', - 'REPLACE', - 'RESTRICT', - 'RIGHT', - 'ROLLBACK', - 'ROW', - 'SAVEPOINT', - 'SELECT', - 'SET', - 'TABLE', - 'TEMP', - 'TEMPORARY', - 'THEN', - 'TO', - 'TRANSACTION', - 'TRIGGER', - 'UNION', - 'UNIQUE', - 'UPDATE', - 'USING', - 'VACUUM', - 'VALUES', - 'VIEW', - 'VIRTUAL', - 'WHEN', - 'WHERE' - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php deleted file mode 100644 index 8520e45..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php +++ /dev/null @@ -1,768 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Platforms; - -use Doctrine\DBAL\DBALException, - Doctrine\DBAL\Schema\TableDiff, - Doctrine\DBAL\Schema\Index, - Doctrine\DBAL\Schema\Table; - -/** - * The MySqlPlatform provides the behavior, features and SQL dialect of the - * MySQL database platform. This platform represents a MySQL 5.0 or greater platform that - * uses the InnoDB storage engine. - * - * @since 2.0 - * @author Roman Borschel - * @author Benjamin Eberlei - * @todo Rename: MySQLPlatform - */ -class MySqlPlatform extends AbstractPlatform -{ - /** - * Gets the character used for identifier quoting. - * - * @return string - * @override - */ - public function getIdentifierQuoteCharacter() - { - return '`'; - } - - /** - * Returns the regular expression operator. - * - * @return string - * @override - */ - public function getRegexpExpression() - { - return 'RLIKE'; - } - - /** - * Returns global unique identifier - * - * @return string to get global unique identifier - * @override - */ - public function getGuidExpression() - { - return 'UUID()'; - } - - /** - * returns the position of the first occurrence of substring $substr in string $str - * - * @param string $substr literal string to find - * @param string $str literal string - * @param int $pos position to start at, beginning of string by default - * @return integer - */ - public function getLocateExpression($str, $substr, $startPos = false) - { - if ($startPos == false) { - return 'LOCATE(' . $substr . ', ' . $str . ')'; - } else { - return 'LOCATE(' . $substr . ', ' . $str . ', '.$startPos.')'; - } - } - - /** - * Returns a series of strings concatinated - * - * concat() accepts an arbitrary number of parameters. Each parameter - * must contain an expression or an array with expressions. - * - * @param string|array(string) strings that will be concatinated. - * @override - */ - public function getConcatExpression() - { - $args = func_get_args(); - return 'CONCAT(' . join(', ', (array) $args) . ')'; - } - - public function getDateDiffExpression($date1, $date2) - { - return 'DATEDIFF(' . $date1 . ', ' . $date2 . ')'; - } - - public function getDateAddDaysExpression($date, $days) - { - return 'DATE_ADD(' . $date . ', INTERVAL ' . $days . ' DAY)'; - } - - public function getDateSubDaysExpression($date, $days) - { - return 'DATE_SUB(' . $date . ', INTERVAL ' . $days . ' DAY)'; - } - - public function getDateAddMonthExpression($date, $months) - { - return 'DATE_ADD(' . $date . ', INTERVAL ' . $months . ' MONTH)'; - } - - public function getDateSubMonthExpression($date, $months) - { - return 'DATE_SUB(' . $date . ', INTERVAL ' . $months . ' MONTH)'; - } - - public function getListDatabasesSQL() - { - return 'SHOW DATABASES'; - } - - public function getListTableConstraintsSQL($table) - { - return 'SHOW INDEX FROM ' . $table; - } - - /** - * Two approaches to listing the table indexes. The information_schema is - * prefered, because it doesn't cause problems with SQL keywords such as "order" or "table". - * - * @param string $table - * @param string $currentDatabase - * @return string - */ - public function getListTableIndexesSQL($table, $currentDatabase = null) - { - if ($currentDatabase) { - return "SELECT TABLE_NAME AS `Table`, NON_UNIQUE AS Non_Unique, INDEX_NAME AS Key_name, ". - "SEQ_IN_INDEX AS Seq_in_index, COLUMN_NAME AS Column_Name, COLLATION AS Collation, ". - "CARDINALITY AS Cardinality, SUB_PART AS Sub_Part, PACKED AS Packed, " . - "NULLABLE AS `Null`, INDEX_TYPE AS Index_Type, COMMENT AS Comment " . - "FROM information_schema.STATISTICS WHERE TABLE_NAME = '" . $table . "' AND TABLE_SCHEMA = '" . $currentDatabase . "'"; - } else { - return 'SHOW INDEX FROM ' . $table; - } - } - - public function getListViewsSQL($database) - { - return "SELECT * FROM information_schema.VIEWS WHERE TABLE_SCHEMA = '".$database."'"; - } - - public function getListTableForeignKeysSQL($table, $database = null) - { - $sql = "SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, ". - "k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ ". - "FROM information_schema.key_column_usage k /*!50116 ". - "INNER JOIN information_schema.referential_constraints c ON ". - " c.constraint_name = k.constraint_name AND ". - " c.table_name = '$table' */ WHERE k.table_name = '$table'"; - - if ($database) { - $sql .= " AND k.table_schema = '$database' /*!50116 AND c.constraint_schema = '$database' */"; - } - - $sql .= " AND k.`REFERENCED_COLUMN_NAME` is not NULL"; - - return $sql; - } - - public function getCreateViewSQL($name, $sql) - { - return 'CREATE VIEW ' . $name . ' AS ' . $sql; - } - - public function getDropViewSQL($name) - { - return 'DROP VIEW '. $name; - } - - /** - * Gets the SQL snippet used to declare a VARCHAR column on the MySql platform. - * - * @params array $field - */ - protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) - { - return $fixed ? ($length ? 'CHAR(' . $length . ')' : 'CHAR(255)') - : ($length ? 'VARCHAR(' . $length . ')' : 'VARCHAR(255)'); - } - - /** @override */ - public function getClobTypeDeclarationSQL(array $field) - { - if ( ! empty($field['length']) && is_numeric($field['length'])) { - $length = $field['length']; - if ($length <= 255) { - return 'TINYTEXT'; - } else if ($length <= 65532) { - return 'TEXT'; - } else if ($length <= 16777215) { - return 'MEDIUMTEXT'; - } - } - return 'LONGTEXT'; - } - - /** - * @override - */ - public function getDateTimeTypeDeclarationSQL(array $fieldDeclaration) - { - if (isset($fieldDeclaration['version']) && $fieldDeclaration['version'] == true) { - return 'TIMESTAMP'; - } else { - return 'DATETIME'; - } - } - - /** - * @override - */ - public function getDateTypeDeclarationSQL(array $fieldDeclaration) - { - return 'DATE'; - } - - /** - * @override - */ - public function getTimeTypeDeclarationSQL(array $fieldDeclaration) - { - return 'TIME'; - } - - /** - * @override - */ - public function getBooleanTypeDeclarationSQL(array $field) - { - return 'TINYINT(1)'; - } - - /** - * Obtain DBMS specific SQL code portion needed to set the COLLATION - * of a field declaration to be used in statements like CREATE TABLE. - * - * @param string $collation name of the collation - * @return string DBMS specific SQL code portion needed to set the COLLATION - * of a field declaration. - */ - public function getCollationFieldDeclaration($collation) - { - return 'COLLATE ' . $collation; - } - - /** - * Whether the platform prefers identity columns for ID generation. - * MySql prefers "autoincrement" identity columns since sequences can only - * be emulated with a table. - * - * @return boolean - * @override - */ - public function prefersIdentityColumns() - { - return true; - } - - /** - * Whether the platform supports identity columns. - * MySql supports this through AUTO_INCREMENT columns. - * - * @return boolean - * @override - */ - public function supportsIdentityColumns() - { - return true; - } - - public function supportsInlineColumnComments() - { - return true; - } - - public function getShowDatabasesSQL() - { - return 'SHOW DATABASES'; - } - - public function getListTablesSQL() - { - return "SHOW FULL TABLES WHERE Table_type = 'BASE TABLE'"; - } - - public function getListTableColumnsSQL($table, $database = null) - { - if ($database) { - return "SELECT COLUMN_NAME AS Field, COLUMN_TYPE AS Type, IS_NULLABLE AS `Null`, ". - "COLUMN_KEY AS `Key`, COLUMN_DEFAULT AS `Default`, EXTRA AS Extra, COLUMN_COMMENT AS Comment, " . - "CHARACTER_SET_NAME AS CharacterSet, COLLATION_NAME AS CollactionName ". - "FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" . $database . "' AND TABLE_NAME = '" . $table . "'"; - } else { - return 'DESCRIBE ' . $table; - } - } - - /** - * create a new database - * - * @param string $name name of the database that should be created - * @return string - * @override - */ - public function getCreateDatabaseSQL($name) - { - return 'CREATE DATABASE ' . $name; - } - - /** - * drop an existing database - * - * @param string $name name of the database that should be dropped - * @return string - * @override - */ - public function getDropDatabaseSQL($name) - { - return 'DROP DATABASE ' . $name; - } - - /** - * create a new table - * - * @param string $tableName Name of the database that should be created - * @param array $columns Associative array that contains the definition of each field of the new table - * The indexes of the array entries are the names of the fields of the table an - * the array entry values are associative arrays like those that are meant to be - * passed with the field definitions to get[Type]Declaration() functions. - * array( - * 'id' => array( - * 'type' => 'integer', - * 'unsigned' => 1 - * 'notnull' => 1 - * 'default' => 0 - * ), - * 'name' => array( - * 'type' => 'text', - * 'length' => 12 - * ), - * 'password' => array( - * 'type' => 'text', - * 'length' => 12 - * ) - * ); - * @param array $options An associative array of table options: - * array( - * 'comment' => 'Foo', - * 'charset' => 'utf8', - * 'collate' => 'utf8_unicode_ci', - * 'engine' => 'innodb', - * 'foreignKeys' => array( - * new ForeignKeyConstraint(), - * new ForeignKeyConstraint(), - * new ForeignKeyConstraint(), - * // etc - * ) - * ); - * - * @return void - * @override - */ - protected function _getCreateTableSQL($tableName, array $columns, array $options = array()) - { - $queryFields = $this->getColumnDeclarationListSQL($columns); - - if (isset($options['uniqueConstraints']) && ! empty($options['uniqueConstraints'])) { - foreach ($options['uniqueConstraints'] as $index => $definition) { - $queryFields .= ', ' . $this->getUniqueConstraintDeclarationSQL($index, $definition); - } - } - - // add all indexes - if (isset($options['indexes']) && ! empty($options['indexes'])) { - foreach($options['indexes'] as $index => $definition) { - $queryFields .= ', ' . $this->getIndexDeclarationSQL($index, $definition); - } - } - - // attach all primary keys - if (isset($options['primary']) && ! empty($options['primary'])) { - $keyColumns = array_unique(array_values($options['primary'])); - $queryFields .= ', PRIMARY KEY(' . implode(', ', $keyColumns) . ')'; - } - - $query = 'CREATE '; - if (!empty($options['temporary'])) { - $query .= 'TEMPORARY '; - } - $query.= 'TABLE ' . $tableName . ' (' . $queryFields . ')'; - - $optionStrings = array(); - - if (isset($options['comment'])) { - $optionStrings['comment'] = 'COMMENT = ' . $options['comment']; - } - if (isset($options['charset'])) { - $optionStrings['charset'] = 'DEFAULT CHARACTER SET ' . $options['charset']; - if (isset($options['collate'])) { - $optionStrings['charset'] .= ' COLLATE ' . $options['collate']; - } - } - - // get the type of the table - if (isset($options['engine'])) { - $optionStrings[] = 'ENGINE = ' . $options['engine']; - } else { - // default to innodb - $optionStrings[] = 'ENGINE = InnoDB'; - } - - if ( ! empty($optionStrings)) { - $query.= ' '.implode(' ', $optionStrings); - } - $sql[] = $query; - - if (isset($options['foreignKeys'])) { - foreach ((array) $options['foreignKeys'] as $definition) { - $sql[] = $this->getCreateForeignKeySQL($definition, $tableName); - } - } - - return $sql; - } - - /** - * Gets the SQL to alter an existing table. - * - * @param TableDiff $diff - * @return array - */ - public function getAlterTableSQL(TableDiff $diff) - { - $columnSql = array(); - $queryParts = array(); - if ($diff->newName !== false) { - $queryParts[] = 'RENAME TO ' . $diff->newName; - } - - foreach ($diff->addedColumns AS $fieldName => $column) { - if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { - continue; - } - - $columnArray = $column->toArray(); - $columnArray['comment'] = $this->getColumnComment($column); - $queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); - } - - foreach ($diff->removedColumns AS $column) { - if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) { - continue; - } - - $queryParts[] = 'DROP ' . $column->getQuotedName($this); - } - - foreach ($diff->changedColumns AS $columnDiff) { - if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { - continue; - } - - /* @var $columnDiff Doctrine\DBAL\Schema\ColumnDiff */ - $column = $columnDiff->column; - $columnArray = $column->toArray(); - $columnArray['comment'] = $this->getColumnComment($column); - $queryParts[] = 'CHANGE ' . ($columnDiff->oldColumnName) . ' ' - . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); - } - - foreach ($diff->renamedColumns AS $oldColumnName => $column) { - if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) { - continue; - } - - $columnArray = $column->toArray(); - $columnArray['comment'] = $this->getColumnComment($column); - $queryParts[] = 'CHANGE ' . $oldColumnName . ' ' - . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); - } - - $sql = array(); - $tableSql = array(); - - if (!$this->onSchemaAlterTable($diff, $tableSql)) { - if (count($queryParts) > 0) { - $sql[] = 'ALTER TABLE ' . $diff->name . ' ' . implode(", ", $queryParts); - } - $sql = array_merge( - $this->getPreAlterTableIndexForeignKeySQL($diff), - $sql, - $this->getPostAlterTableIndexForeignKeySQL($diff) - ); - } - - return array_merge($sql, $tableSql, $columnSql); - } - - /** - * Fix for DROP/CREATE index after foreign key change from OneToOne to ManyToOne - * - * @param TableDiff $diff - * @return array - */ - protected function getPreAlterTableIndexForeignKeySQL(TableDiff $diff) - { - $sql = array(); - $table = $diff->name; - - foreach ($diff->removedIndexes AS $remKey => $remIndex) { - - foreach ($diff->addedIndexes as $addKey => $addIndex) { - if ($remIndex->getColumns() == $addIndex->getColumns()) { - - $columns = $addIndex->getColumns(); - $type = ''; - if ($addIndex->isUnique()) { - $type = 'UNIQUE '; - } - - $query = 'ALTER TABLE ' . $table . ' DROP INDEX ' . $remIndex->getName() . ', '; - $query .= 'ADD ' . $type . 'INDEX ' . $addIndex->getName(); - $query .= ' (' . $this->getIndexFieldDeclarationListSQL($columns) . ')'; - - $sql[] = $query; - - unset($diff->removedIndexes[$remKey]); - unset($diff->addedIndexes[$addKey]); - - break; - } - } - } - - $sql = array_merge($sql, parent::getPreAlterTableIndexForeignKeySQL($diff)); - - return $sql; - } - - /** - * Obtain DBMS specific SQL code portion needed to declare an integer type - * field to be used in statements like CREATE TABLE. - * - * @param string $name name the field to be declared. - * @param string $field associative array with the name of the properties - * of the field being declared as array indexes. - * Currently, the types of supported field - * properties are as follows: - * - * unsigned - * Boolean flag that indicates whether the field - * should be declared as unsigned integer if - * possible. - * - * default - * Integer value to be used as default for this - * field. - * - * notnull - * Boolean flag that indicates whether this field is - * constrained to not be set to null. - * @return string DBMS specific SQL code portion that should be used to - * declare the specified field. - * @override - */ - public function getIntegerTypeDeclarationSQL(array $field) - { - return 'INT' . $this->_getCommonIntegerTypeDeclarationSQL($field); - } - - /** @override */ - public function getBigIntTypeDeclarationSQL(array $field) - { - return 'BIGINT' . $this->_getCommonIntegerTypeDeclarationSQL($field); - } - - /** @override */ - public function getSmallIntTypeDeclarationSQL(array $field) - { - return 'SMALLINT' . $this->_getCommonIntegerTypeDeclarationSQL($field); - } - - /** @override */ - protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef) - { - $autoinc = ''; - if ( ! empty($columnDef['autoincrement'])) { - $autoinc = ' AUTO_INCREMENT'; - } - $unsigned = (isset($columnDef['unsigned']) && $columnDef['unsigned']) ? ' UNSIGNED' : ''; - - return $unsigned . $autoinc; - } - - /** - * Return the FOREIGN KEY query section dealing with non-standard options - * as MATCH, INITIALLY DEFERRED, ON UPDATE, ... - * - * @param ForeignKeyConstraint $foreignKey - * @return string - * @override - */ - public function getAdvancedForeignKeyOptionsSQL(\Doctrine\DBAL\Schema\ForeignKeyConstraint $foreignKey) - { - $query = ''; - if ($foreignKey->hasOption('match')) { - $query .= ' MATCH ' . $foreignKey->getOption('match'); - } - $query .= parent::getAdvancedForeignKeyOptionsSQL($foreignKey); - return $query; - } - - /** - * Gets the SQL to drop an index of a table. - * - * @param Index $index name of the index to be dropped - * @param string|Table $table name of table that should be used in method - * @override - */ - public function getDropIndexSQL($index, $table=null) - { - if($index instanceof Index) { - $indexName = $index->getQuotedName($this); - } else if(is_string($index)) { - $indexName = $index; - } else { - throw new \InvalidArgumentException('MysqlPlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.'); - } - - if($table instanceof Table) { - $table = $table->getQuotedName($this); - } else if(!is_string($table)) { - throw new \InvalidArgumentException('MysqlPlatform::getDropIndexSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'); - } - - if ($index instanceof Index && $index->isPrimary()) { - // mysql primary keys are always named "PRIMARY", - // so we cannot use them in statements because of them being keyword. - return $this->getDropPrimaryKeySQL($table); - } - - return 'DROP INDEX ' . $indexName . ' ON ' . $table; - } - - /** - * @param Index $index - * @param Table $table - */ - protected function getDropPrimaryKeySQL($table) - { - return 'ALTER TABLE ' . $table . ' DROP PRIMARY KEY'; - } - - public function getSetTransactionIsolationSQL($level) - { - return 'SET SESSION TRANSACTION ISOLATION LEVEL ' . $this->_getTransactionIsolationLevelSQL($level); - } - - /** - * Get the platform name for this instance. - * - * @return string - */ - public function getName() - { - return 'mysql'; - } - - public function getReadLockSQL() - { - return 'LOCK IN SHARE MODE'; - } - - protected function initializeDoctrineTypeMappings() - { - $this->doctrineTypeMapping = array( - 'tinyint' => 'boolean', - 'smallint' => 'smallint', - 'mediumint' => 'integer', - 'int' => 'integer', - 'integer' => 'integer', - 'bigint' => 'bigint', - 'tinytext' => 'text', - 'mediumtext' => 'text', - 'longtext' => 'text', - 'text' => 'text', - 'varchar' => 'string', - 'string' => 'string', - 'char' => 'string', - 'date' => 'date', - 'datetime' => 'datetime', - 'timestamp' => 'datetime', - 'time' => 'time', - 'float' => 'float', - 'double' => 'float', - 'real' => 'float', - 'decimal' => 'decimal', - 'numeric' => 'decimal', - 'year' => 'date', - 'longblob' => 'blob', - 'blob' => 'blob', - 'mediumblob' => 'blob', - 'tinyblob' => 'blob', - ); - } - - public function getVarcharMaxLength() - { - return 65535; - } - - protected function getReservedKeywordsClass() - { - return 'Doctrine\DBAL\Platforms\Keywords\MySQLKeywords'; - } - - /** - * Get SQL to safely drop a temporary table WITHOUT implicitly committing an open transaction. - * - * MySQL commits a transaction implicitly when DROP TABLE is executed, however not - * if DROP TEMPORARY TABLE is executed. - * - * @throws \InvalidArgumentException - * @param $table - * @return string - */ - public function getDropTemporaryTableSQL($table) - { - if ($table instanceof \Doctrine\DBAL\Schema\Table) { - $table = $table->getQuotedName($this); - } else if(!is_string($table)) { - throw new \InvalidArgumentException('getDropTableSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'); - } - - return 'DROP TEMPORARY TABLE ' . $table; - } - - /** - * Gets the SQL Snippet used to declare a BLOB column type. - */ - public function getBlobTypeDeclarationSQL(array $field) - { - return 'LONGBLOB'; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/OraclePlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/OraclePlatform.php deleted file mode 100644 index 215ea1c..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/OraclePlatform.php +++ /dev/null @@ -1,840 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Platforms; - -use Doctrine\DBAL\Schema\TableDiff; - -/** - * OraclePlatform. - * - * @since 2.0 - * @author Roman Borschel - * @author Lukas Smith (PEAR MDB2 library) - * @author Benjamin Eberlei - */ -class OraclePlatform extends AbstractPlatform -{ - /** - * return string to call a function to get a substring inside an SQL statement - * - * Note: Not SQL92, but common functionality. - * - * @param string $value an sql string literal or column name/alias - * @param integer $position where to start the substring portion - * @param integer $length the substring portion length - * @return string SQL substring function with given parameters - * @override - */ - public function getSubstringExpression($value, $position, $length = null) - { - if ($length !== null) { - return "SUBSTR($value, $position, $length)"; - } - - return "SUBSTR($value, $position)"; - } - - /** - * Return string to call a variable with the current timestamp inside an SQL statement - * There are three special variables for current date and time: - * - CURRENT_TIMESTAMP (date and time, TIMESTAMP type) - * - CURRENT_DATE (date, DATE type) - * - CURRENT_TIME (time, TIME type) - * - * @return string to call a variable with the current timestamp - * @override - */ - public function getNowExpression($type = 'timestamp') - { - switch ($type) { - case 'date': - case 'time': - case 'timestamp': - default: - return 'TO_CHAR(CURRENT_TIMESTAMP, \'YYYY-MM-DD HH24:MI:SS\')'; - } - } - - /** - * returns the position of the first occurrence of substring $substr in string $str - * - * @param string $substr literal string to find - * @param string $str literal string - * @param int $pos position to start at, beginning of string by default - * @return integer - */ - public function getLocateExpression($str, $substr, $startPos = false) - { - if ($startPos == false) { - return 'INSTR('.$str.', '.$substr.')'; - } else { - return 'INSTR('.$str.', '.$substr.', '.$startPos.')'; - } - } - - /** - * Returns global unique identifier - * - * @return string to get global unique identifier - * @override - */ - public function getGuidExpression() - { - return 'SYS_GUID()'; - } - - /** - * Get the number of days difference between two dates. - * - * Note: Since Oracle timestamp differences are calculated down to the microsecond we have to truncate - * them to the difference in days. This is obviously a restriction of the original functionality, but we - * need to make this a portable function. - * - * @param type $date1 - * @param type $date2 - * @return type - */ - public function getDateDiffExpression($date1, $date2) - { - return "TRUNC(TO_NUMBER(SUBSTR((" . $date1 . "-" . $date2 . "), 1, INSTR(" . $date1 . "-" . $date2 .", ' '))))"; - } - - /** - * {@inheritdoc} - */ - public function getDateAddDaysExpression($date, $days) - { - return '(' . $date . '+' . $days . ')'; - } - - /** - * {@inheritdoc} - */ - public function getDateSubDaysExpression($date, $days) - { - return '(' . $date . '-' . $days . ')'; - } - - /** - * {@inheritdoc} - */ - public function getDateAddMonthExpression($date, $months) - { - return "ADD_MONTHS(" . $date . ", " . $months . ")"; - } - - /** - * {@inheritdoc} - */ - public function getDateSubMonthExpression($date, $months) - { - return "ADD_MONTHS(" . $date . ", -" . $months . ")"; - } - - /** - * {@inheritdoc} - */ - public function getBitAndComparisonExpression($value1, $value2) - { - return 'BITAND('.$value1 . ', ' . $value2 . ')'; - } - - /** - * {@inheritdoc} - */ - public function getBitOrComparisonExpression($value1, $value2) - { - return '(' . $value1 . '-' . - $this->getBitAndComparisonExpression($value1, $value2) - . '+' . $value2 . ')'; - } - - /** - * Gets the SQL used to create a sequence that starts with a given value - * and increments by the given allocation size. - * - * Need to specifiy minvalue, since start with is hidden in the system and MINVALUE <= START WITH. - * Therefore we can use MINVALUE to be able to get a hint what START WITH was for later introspection - * in {@see listSequences()} - * - * @param \Doctrine\DBAL\Schema\Sequence $sequence - * @return string - */ - public function getCreateSequenceSQL(\Doctrine\DBAL\Schema\Sequence $sequence) - { - return 'CREATE SEQUENCE ' . $sequence->getQuotedName($this) . - ' START WITH ' . $sequence->getInitialValue() . - ' MINVALUE ' . $sequence->getInitialValue() . - ' INCREMENT BY ' . $sequence->getAllocationSize(); - } - - public function getAlterSequenceSQL(\Doctrine\DBAL\Schema\Sequence $sequence) - { - return 'ALTER SEQUENCE ' . $sequence->getQuotedName($this) . - ' INCREMENT BY ' . $sequence->getAllocationSize(); - } - - /** - * {@inheritdoc} - * - * @param string $sequenceName - * @override - */ - public function getSequenceNextValSQL($sequenceName) - { - return 'SELECT ' . $sequenceName . '.nextval FROM DUAL'; - } - - /** - * {@inheritdoc} - * - * @param integer $level - * @override - */ - public function getSetTransactionIsolationSQL($level) - { - return 'SET TRANSACTION ISOLATION LEVEL ' . $this->_getTransactionIsolationLevelSQL($level); - } - - protected function _getTransactionIsolationLevelSQL($level) - { - switch ($level) { - case \Doctrine\DBAL\Connection::TRANSACTION_READ_UNCOMMITTED: - return 'READ UNCOMMITTED'; - case \Doctrine\DBAL\Connection::TRANSACTION_READ_COMMITTED: - return 'READ COMMITTED'; - case \Doctrine\DBAL\Connection::TRANSACTION_REPEATABLE_READ: - case \Doctrine\DBAL\Connection::TRANSACTION_SERIALIZABLE: - return 'SERIALIZABLE'; - default: - return parent::_getTransactionIsolationLevelSQL($level); - } - } - - /** - * @override - */ - public function getBooleanTypeDeclarationSQL(array $field) - { - return 'NUMBER(1)'; - } - - /** - * @override - */ - public function getIntegerTypeDeclarationSQL(array $field) - { - return 'NUMBER(10)'; - } - - /** - * @override - */ - public function getBigIntTypeDeclarationSQL(array $field) - { - return 'NUMBER(20)'; - } - - /** - * @override - */ - public function getSmallIntTypeDeclarationSQL(array $field) - { - return 'NUMBER(5)'; - } - - /** - * @override - */ - public function getDateTimeTypeDeclarationSQL(array $fieldDeclaration) - { - return 'TIMESTAMP(0)'; - } - - /** - * @override - */ - public function getDateTimeTzTypeDeclarationSQL(array $fieldDeclaration) - { - return 'TIMESTAMP(0) WITH TIME ZONE'; - } - - /** - * @override - */ - public function getDateTypeDeclarationSQL(array $fieldDeclaration) - { - return 'DATE'; - } - - /** - * @override - */ - public function getTimeTypeDeclarationSQL(array $fieldDeclaration) - { - return 'DATE'; - } - - /** - * @override - */ - protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef) - { - return ''; - } - - /** - * Gets the SQL snippet used to declare a VARCHAR column on the Oracle platform. - * - * @params array $field - * @override - */ - protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) - { - return $fixed ? ($length ? 'CHAR(' . $length . ')' : 'CHAR(2000)') - : ($length ? 'VARCHAR2(' . $length . ')' : 'VARCHAR2(4000)'); - } - - /** @override */ - public function getClobTypeDeclarationSQL(array $field) - { - return 'CLOB'; - } - - public function getListDatabasesSQL() - { - return 'SELECT username FROM all_users'; - } - - public function getListSequencesSQL($database) - { - return "SELECT sequence_name, min_value, increment_by FROM sys.all_sequences ". - "WHERE SEQUENCE_OWNER = '".strtoupper($database)."'"; - } - - /** - * - * @param string $table - * @param array $columns - * @param array $options - * @return array - */ - protected function _getCreateTableSQL($table, array $columns, array $options = array()) - { - $indexes = isset($options['indexes']) ? $options['indexes'] : array(); - $options['indexes'] = array(); - $sql = parent::_getCreateTableSQL($table, $columns, $options); - - foreach ($columns as $name => $column) { - if (isset($column['sequence'])) { - $sql[] = $this->getCreateSequenceSQL($column['sequence'], 1); - } - - if (isset($column['autoincrement']) && $column['autoincrement'] || - (isset($column['autoinc']) && $column['autoinc'])) { - $sql = array_merge($sql, $this->getCreateAutoincrementSql($name, $table)); - } - } - - if (isset($indexes) && ! empty($indexes)) { - foreach ($indexes as $indexName => $index) { - $sql[] = $this->getCreateIndexSQL($index, $table); - } - } - - return $sql; - } - - /** - * @license New BSD License - * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaOracleReader.html - * @param string $table - * @return string - */ - public function getListTableIndexesSQL($table, $currentDatabase = null) - { - $table = strtoupper($table); - - return "SELECT uind.index_name AS name, " . - " uind.index_type AS type, " . - " decode( uind.uniqueness, 'NONUNIQUE', 0, 'UNIQUE', 1 ) AS is_unique, " . - " uind_col.column_name AS column_name, " . - " uind_col.column_position AS column_pos, " . - " (SELECT ucon.constraint_type FROM user_constraints ucon WHERE ucon.constraint_name = uind.index_name) AS is_primary ". - "FROM user_indexes uind, user_ind_columns uind_col " . - "WHERE uind.index_name = uind_col.index_name AND uind_col.table_name = '$table' ORDER BY uind_col.column_position ASC"; - } - - public function getListTablesSQL() - { - return 'SELECT * FROM sys.user_tables'; - } - - public function getListViewsSQL($database) - { - return 'SELECT view_name, text FROM sys.user_views'; - } - - public function getCreateViewSQL($name, $sql) - { - return 'CREATE VIEW ' . $name . ' AS ' . $sql; - } - - public function getDropViewSQL($name) - { - return 'DROP VIEW '. $name; - } - - public function getCreateAutoincrementSql($name, $table, $start = 1) - { - $table = strtoupper($table); - $sql = array(); - - $indexName = $table . '_AI_PK'; - $definition = array( - 'primary' => true, - 'columns' => array($name => true), - ); - - $idx = new \Doctrine\DBAL\Schema\Index($indexName, array($name), true, true); - - $sql[] = 'DECLARE - constraints_Count NUMBER; -BEGIN - SELECT COUNT(CONSTRAINT_NAME) INTO constraints_Count FROM USER_CONSTRAINTS WHERE TABLE_NAME = \''.$table.'\' AND CONSTRAINT_TYPE = \'P\'; - IF constraints_Count = 0 OR constraints_Count = \'\' THEN - EXECUTE IMMEDIATE \''.$this->getCreateConstraintSQL($idx, $table).'\'; - END IF; -END;'; - - $sequenceName = $table . '_SEQ'; - $sequence = new \Doctrine\DBAL\Schema\Sequence($sequenceName, $start); - $sql[] = $this->getCreateSequenceSQL($sequence); - - $triggerName = $table . '_AI_PK'; - $sql[] = 'CREATE TRIGGER ' . $triggerName . ' - BEFORE INSERT - ON ' . $table . ' - FOR EACH ROW -DECLARE - last_Sequence NUMBER; - last_InsertID NUMBER; -BEGIN - SELECT ' . $sequenceName . '.NEXTVAL INTO :NEW.' . $name . ' FROM DUAL; - IF (:NEW.' . $name . ' IS NULL OR :NEW.'.$name.' = 0) THEN - SELECT ' . $sequenceName . '.NEXTVAL INTO :NEW.' . $name . ' FROM DUAL; - ELSE - SELECT NVL(Last_Number, 0) INTO last_Sequence - FROM User_Sequences - WHERE Sequence_Name = \'' . $sequenceName . '\'; - SELECT :NEW.' . $name . ' INTO last_InsertID FROM DUAL; - WHILE (last_InsertID > last_Sequence) LOOP - SELECT ' . $sequenceName . '.NEXTVAL INTO last_Sequence FROM DUAL; - END LOOP; - END IF; -END;'; - return $sql; - } - - public function getDropAutoincrementSql($table) - { - $table = strtoupper($table); - $trigger = $table . '_AI_PK'; - - if ($trigger) { - $sql[] = 'DROP TRIGGER ' . $trigger; - $sql[] = $this->getDropSequenceSQL($table.'_SEQ'); - - $indexName = $table . '_AI_PK'; - $sql[] = $this->getDropConstraintSQL($indexName, $table); - } - - return $sql; - } - - public function getListTableForeignKeysSQL($table) - { - $table = strtoupper($table); - - return "SELECT alc.constraint_name, - alc.DELETE_RULE, - alc.search_condition, - cols.column_name \"local_column\", - cols.position, - r_alc.table_name \"references_table\", - r_cols.column_name \"foreign_column\" - FROM user_cons_columns cols -LEFT JOIN user_constraints alc - ON alc.constraint_name = cols.constraint_name -LEFT JOIN user_constraints r_alc - ON alc.r_constraint_name = r_alc.constraint_name -LEFT JOIN user_cons_columns r_cols - ON r_alc.constraint_name = r_cols.constraint_name - AND cols.position = r_cols.position - WHERE alc.constraint_name = cols.constraint_name - AND alc.constraint_type = 'R' - AND alc.table_name = '".$table."'"; - } - - public function getListTableConstraintsSQL($table) - { - $table = strtoupper($table); - return 'SELECT * FROM user_constraints WHERE table_name = \'' . $table . '\''; - } - - public function getListTableColumnsSQL($table, $database = null) - { - $table = strtoupper($table); - - $tabColumnsTableName = "user_tab_columns"; - $ownerCondition = ''; - if(null !== $database){ - $database = strtoupper($database); - $tabColumnsTableName = "all_tab_columns"; - $ownerCondition = "AND c.owner = '".$database."'"; - } - - return "SELECT c.*, d.comments FROM $tabColumnsTableName c ". - "INNER JOIN user_col_comments d ON d.TABLE_NAME = c.TABLE_NAME AND d.COLUMN_NAME = c.COLUMN_NAME ". - "WHERE c.table_name = '" . $table . "' ".$ownerCondition." ORDER BY c.column_name"; - } - - /** - * - * @param \Doctrine\DBAL\Schema\Sequence $sequence - * @return string - */ - public function getDropSequenceSQL($sequence) - { - if ($sequence instanceof \Doctrine\DBAL\Schema\Sequence) { - $sequence = $sequence->getQuotedName($this); - } - - return 'DROP SEQUENCE ' . $sequence; - } - - /** - * @param ForeignKeyConstraint|string $foreignKey - * @param Table|string $table - * @return string - */ - public function getDropForeignKeySQL($foreignKey, $table) - { - if ($foreignKey instanceof \Doctrine\DBAL\Schema\ForeignKeyConstraint) { - $foreignKey = $foreignKey->getQuotedName($this); - } - - if ($table instanceof \Doctrine\DBAL\Schema\Table) { - $table = $table->getQuotedName($this); - } - - return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $foreignKey; - } - - public function getDropDatabaseSQL($database) - { - return 'DROP USER ' . $database . ' CASCADE'; - } - - /** - * Gets the sql statements for altering an existing table. - * - * The method returns an array of sql statements, since some platforms need several statements. - * - * @param string $diff->name name of the table that is intended to be changed. - * @param array $changes associative array that contains the details of each type * - * @param boolean $check indicates whether the function should just check if the DBMS driver - * can perform the requested table alterations if the value is true or - * actually perform them otherwise. - * @return array - */ - public function getAlterTableSQL(TableDiff $diff) - { - $sql = array(); - $commentsSQL = array(); - $columnSql = array(); - - $fields = array(); - foreach ($diff->addedColumns AS $column) { - if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { - continue; - } - - $fields[] = $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); - if ($comment = $this->getColumnComment($column)) { - $commentsSQL[] = $this->getCommentOnColumnSQL($diff->name, $column->getName(), $comment); - } - } - if (count($fields)) { - $sql[] = 'ALTER TABLE ' . $diff->name . ' ADD (' . implode(', ', $fields) . ')'; - } - - $fields = array(); - foreach ($diff->changedColumns AS $columnDiff) { - if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { - continue; - } - - $column = $columnDiff->column; - $fields[] = $column->getQuotedName($this). ' ' . $this->getColumnDeclarationSQL('', $column->toArray()); - if ($columnDiff->hasChanged('comment') && $comment = $this->getColumnComment($column)) { - $commentsSQL[] = $this->getCommentOnColumnSQL($diff->name, $column->getName(), $comment); - } - } - if (count($fields)) { - $sql[] = 'ALTER TABLE ' . $diff->name . ' MODIFY (' . implode(', ', $fields) . ')'; - } - - foreach ($diff->renamedColumns AS $oldColumnName => $column) { - if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) { - continue; - } - - $sql[] = 'ALTER TABLE ' . $diff->name . ' RENAME COLUMN ' . $oldColumnName .' TO ' . $column->getQuotedName($this); - } - - $fields = array(); - foreach ($diff->removedColumns AS $column) { - if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) { - continue; - } - - $fields[] = $column->getQuotedName($this); - } - if (count($fields)) { - $sql[] = 'ALTER TABLE ' . $diff->name . ' DROP (' . implode(', ', $fields).')'; - } - - $tableSql = array(); - - if (!$this->onSchemaAlterTable($diff, $tableSql)) { - if ($diff->newName !== false) { - $sql[] = 'ALTER TABLE ' . $diff->name . ' RENAME TO ' . $diff->newName; - } - - $sql = array_merge($sql, $this->_getAlterTableIndexForeignKeySQL($diff), $commentsSQL); - } - - return array_merge($sql, $tableSql, $columnSql); - } - - /** - * Whether the platform prefers sequences for ID generation. - * - * @return boolean - */ - public function prefersSequences() - { - return true; - } - - public function supportsCommentOnStatement() - { - return true; - } - - /** - * Get the platform name for this instance - * - * @return string - */ - public function getName() - { - return 'oracle'; - } - - /** - * Adds an driver-specific LIMIT clause to the query - * - * @param string $query query to modify - * @param integer $limit limit the number of rows - * @param integer $offset start reading from given offset - * @return string the modified query - */ - protected function doModifyLimitQuery($query, $limit, $offset = null) - { - $limit = (int) $limit; - $offset = (int) $offset; - if (preg_match('/^\s*SELECT/i', $query)) { - if (!preg_match('/\sFROM\s/i', $query)) { - $query .= " FROM dual"; - } - if ($limit > 0) { - $max = $offset + $limit; - $column = '*'; - if ($offset > 0) { - $min = $offset + 1; - $query = 'SELECT * FROM (SELECT a.' . $column . ', rownum AS doctrine_rownum FROM (' . - $query . - ') a WHERE rownum <= ' . $max . ') WHERE doctrine_rownum >= ' . $min; - } else { - $query = 'SELECT a.' . $column . ' FROM (' . $query . ') a WHERE ROWNUM <= ' . $max; - } - } - } - return $query; - } - - /** - * Gets the character casing of a column in an SQL result set of this platform. - * - * Oracle returns all column names in SQL result sets in uppercase. - * - * @param string $column The column name for which to get the correct character casing. - * @return string The column name in the character casing used in SQL result sets. - */ - public function getSQLResultCasing($column) - { - return strtoupper($column); - } - - public function getCreateTemporaryTableSnippetSQL() - { - return "CREATE GLOBAL TEMPORARY TABLE"; - } - - public function getDateTimeTzFormatString() - { - return 'Y-m-d H:i:sP'; - } - - public function getDateFormatString() - { - return 'Y-m-d 00:00:00'; - } - - public function getTimeFormatString() - { - return '1900-01-01 H:i:s'; - } - - public function fixSchemaElementName($schemaElementName) - { - if (strlen($schemaElementName) > 30) { - // Trim it - return substr($schemaElementName, 0, 30); - } - return $schemaElementName; - } - - /** - * Maximum length of any given databse identifier, like tables or column names. - * - * @return int - */ - public function getMaxIdentifierLength() - { - return 30; - } - - /** - * Whether the platform supports sequences. - * - * @return boolean - */ - public function supportsSequences() - { - return true; - } - - public function supportsForeignKeyOnUpdate() - { - return false; - } - - /** - * Whether the platform supports releasing savepoints. - * - * @return boolean - */ - public function supportsReleaseSavepoints() - { - return false; - } - - /** - * @inheritdoc - */ - public function getTruncateTableSQL($tableName, $cascade = false) - { - return 'TRUNCATE TABLE '.$tableName; - } - - /** - * This is for test reasons, many vendors have special requirements for dummy statements. - * - * @return string - */ - public function getDummySelectSQL() - { - return 'SELECT 1 FROM DUAL'; - } - - protected function initializeDoctrineTypeMappings() - { - $this->doctrineTypeMapping = array( - 'integer' => 'integer', - 'number' => 'integer', - 'pls_integer' => 'boolean', - 'binary_integer' => 'boolean', - 'varchar' => 'string', - 'varchar2' => 'string', - 'nvarchar2' => 'string', - 'char' => 'string', - 'nchar' => 'string', - 'date' => 'datetime', - 'timestamp' => 'datetime', - 'timestamptz' => 'datetimetz', - 'float' => 'float', - 'long' => 'string', - 'clob' => 'text', - 'nclob' => 'text', - 'raw' => 'text', - 'long raw' => 'text', - 'rowid' => 'string', - 'urowid' => 'string', - 'blob' => 'blob', - ); - } - - /** - * Generate SQL to release a savepoint - * - * @param string $savepoint - * @return string - */ - public function releaseSavePoint($savepoint) - { - return ''; - } - - protected function getReservedKeywordsClass() - { - return 'Doctrine\DBAL\Platforms\Keywords\OracleKeywords'; - } - - /** - * Gets the SQL Snippet used to declare a BLOB column type. - */ - public function getBlobTypeDeclarationSQL(array $field) - { - return 'BLOB'; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php deleted file mode 100644 index d398651..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php +++ /dev/null @@ -1,792 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Platforms; - -use Doctrine\DBAL\Schema\TableDiff, - Doctrine\DBAL\Schema\Table; - -/** - * PostgreSqlPlatform. - * - * @since 2.0 - * @author Roman Borschel - * @author Lukas Smith (PEAR MDB2 library) - * @author Benjamin Eberlei - * @todo Rename: PostgreSQLPlatform - */ -class PostgreSqlPlatform extends AbstractPlatform -{ - /** - * Returns part of a string. - * - * Note: Not SQL92, but common functionality. - * - * @param string $value the target $value the string or the string column. - * @param int $from extract from this characeter. - * @param int $len extract this amount of characters. - * @return string sql that extracts part of a string. - * @override - */ - public function getSubstringExpression($value, $from, $len = null) - { - if ($len === null) { - return 'SUBSTR(' . $value . ', ' . $from . ')'; - } else { - return 'SUBSTR(' . $value . ', ' . $from . ', ' . $len . ')'; - } - } - - /** - * Returns the SQL string to return the current system date and time. - * - * @return string - */ - public function getNowExpression() - { - return 'LOCALTIMESTAMP(0)'; - } - - /** - * regexp - * - * @return string the regular expression operator - * @override - */ - public function getRegexpExpression() - { - return 'SIMILAR TO'; - } - - /** - * returns the position of the first occurrence of substring $substr in string $str - * - * @param string $substr literal string to find - * @param string $str literal string - * @param int $pos position to start at, beginning of string by default - * @return integer - */ - public function getLocateExpression($str, $substr, $startPos = false) - { - if ($startPos !== false) { - $str = $this->getSubstringExpression($str, $startPos); - return 'CASE WHEN (POSITION('.$substr.' IN '.$str.') = 0) THEN 0 ELSE (POSITION('.$substr.' IN '.$str.') + '.($startPos-1).') END'; - } else { - return 'POSITION('.$substr.' IN '.$str.')'; - } - } - - public function getDateDiffExpression($date1, $date2) - { - return '(DATE(' . $date1 . ')-DATE(' . $date2 . '))'; - } - - public function getDateAddDaysExpression($date, $days) - { - return "(" . $date ." + (" . $days . " || ' day')::interval)"; - } - - public function getDateSubDaysExpression($date, $days) - { - return "(" . $date ." - (" . $days . " || ' day')::interval)"; - } - - public function getDateAddMonthExpression($date, $months) - { - return "(" . $date ." + (" . $months . " || ' month')::interval)"; - } - - public function getDateSubMonthExpression($date, $months) - { - return "(" . $date ." - (" . $months . " || ' month')::interval)"; - } - - /** - * parses a literal boolean value and returns - * proper sql equivalent - * - * @param string $value boolean value to be parsed - * @return string parsed boolean value - */ - /*public function parseBoolean($value) - { - return $value; - }*/ - - /** - * Whether the platform supports sequences. - * Postgres has native support for sequences. - * - * @return boolean - */ - public function supportsSequences() - { - return true; - } - - /** - * Whether the platform supports database schemas. - * - * @return boolean - */ - public function supportsSchemas() - { - return true; - } - - /** - * Whether the platform supports identity columns. - * Postgres supports these through the SERIAL keyword. - * - * @return boolean - */ - public function supportsIdentityColumns() - { - return true; - } - - public function supportsCommentOnStatement() - { - return true; - } - - /** - * Whether the platform prefers sequences for ID generation. - * - * @return boolean - */ - public function prefersSequences() - { - return true; - } - - public function getListDatabasesSQL() - { - return 'SELECT datname FROM pg_database'; - } - - public function getListSequencesSQL($database) - { - return "SELECT - c.relname, n.nspname AS schemaname - FROM - pg_class c, pg_namespace n - WHERE relkind = 'S' AND n.oid = c.relnamespace AND - (n.nspname NOT LIKE 'pg_%' AND n.nspname != 'information_schema')"; - } - - public function getListTablesSQL() - { - return "SELECT tablename AS table_name, schemaname AS schema_name - FROM pg_tables WHERE schemaname NOT LIKE 'pg_%' AND schemaname != 'information_schema' AND tablename != 'geometry_columns' AND tablename != 'spatial_ref_sys'"; - } - - public function getListViewsSQL($database) - { - return 'SELECT viewname, definition FROM pg_views'; - } - - public function getListTableForeignKeysSQL($table, $database = null) - { - return "SELECT r.conname, pg_catalog.pg_get_constraintdef(r.oid, true) as condef - FROM pg_catalog.pg_constraint r - WHERE r.conrelid = - ( - SELECT c.oid - FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n - WHERE " .$this->getTableWhereClause($table) ." AND n.oid = c.relnamespace - ) - AND r.contype = 'f'"; - } - - public function getCreateViewSQL($name, $sql) - { - return 'CREATE VIEW ' . $name . ' AS ' . $sql; - } - - public function getDropViewSQL($name) - { - return 'DROP VIEW '. $name; - } - - public function getListTableConstraintsSQL($table) - { - return "SELECT - relname - FROM - pg_class - WHERE oid IN ( - SELECT indexrelid - FROM pg_index, pg_class - WHERE pg_class.relname = '$table' - AND pg_class.oid = pg_index.indrelid - AND (indisunique = 't' OR indisprimary = 't') - )"; - } - - /** - * @license New BSD License - * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html - * @param string $table - * @return string - */ - public function getListTableIndexesSQL($table, $currentDatabase = null) - { - return "SELECT relname, pg_index.indisunique, pg_index.indisprimary, - pg_index.indkey, pg_index.indrelid - FROM pg_class, pg_index - WHERE oid IN ( - SELECT indexrelid - FROM pg_index si, pg_class sc, pg_namespace sn - WHERE " . $this->getTableWhereClause($table, 'sc', 'sn')." AND sc.oid=si.indrelid AND sc.relnamespace = sn.oid - ) AND pg_index.indexrelid = oid"; - } - - /** - * @param string $table - * @param string $classAlias - * @param string $namespaceAlias - * @return string - */ - private function getTableWhereClause($table, $classAlias = 'c', $namespaceAlias = 'n') - { - $whereClause = $namespaceAlias.".nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast') AND "; - if (strpos($table, ".") !== false) { - list($schema, $table) = explode(".", $table); - $schema = "'" . $schema . "'"; - } else { - $schema = "ANY(string_to_array((select setting from pg_catalog.pg_settings where name = 'search_path'),','))"; - } - $whereClause .= "$classAlias.relname = '" . $table . "' AND $namespaceAlias.nspname = $schema"; - - return $whereClause; - } - - public function getListTableColumnsSQL($table, $database = null) - { - return "SELECT - a.attnum, - a.attname AS field, - t.typname AS type, - format_type(a.atttypid, a.atttypmod) AS complete_type, - (SELECT t1.typname FROM pg_catalog.pg_type t1 WHERE t1.oid = t.typbasetype) AS domain_type, - (SELECT format_type(t2.typbasetype, t2.typtypmod) FROM pg_catalog.pg_type t2 - WHERE t2.typtype = 'd' AND t2.typname = format_type(a.atttypid, a.atttypmod)) AS domain_complete_type, - a.attnotnull AS isnotnull, - (SELECT 't' - FROM pg_index - WHERE c.oid = pg_index.indrelid - AND pg_index.indkey[0] = a.attnum - AND pg_index.indisprimary = 't' - ) AS pri, - (SELECT pg_attrdef.adsrc - FROM pg_attrdef - WHERE c.oid = pg_attrdef.adrelid - AND pg_attrdef.adnum=a.attnum - ) AS default, - (SELECT pg_description.description - FROM pg_description WHERE pg_description.objoid = c.oid AND a.attnum = pg_description.objsubid - ) AS comment - FROM pg_attribute a, pg_class c, pg_type t, pg_namespace n - WHERE ".$this->getTableWhereClause($table, 'c', 'n') ." - AND a.attnum > 0 - AND a.attrelid = c.oid - AND a.atttypid = t.oid - AND n.oid = c.relnamespace - ORDER BY a.attnum"; - } - - /** - * create a new database - * - * @param string $name name of the database that should be created - * @throws PDOException - * @return void - * @override - */ - public function getCreateDatabaseSQL($name) - { - return 'CREATE DATABASE ' . $name; - } - - /** - * drop an existing database - * - * @param string $name name of the database that should be dropped - * @throws PDOException - * @access public - */ - public function getDropDatabaseSQL($name) - { - return 'DROP DATABASE ' . $name; - } - - /** - * Return the FOREIGN KEY query section dealing with non-standard options - * as MATCH, INITIALLY DEFERRED, ON UPDATE, ... - * - * @param \Doctrine\DBAL\Schema\ForeignKeyConstraint $foreignKey foreign key definition - * @return string - * @override - */ - public function getAdvancedForeignKeyOptionsSQL(\Doctrine\DBAL\Schema\ForeignKeyConstraint $foreignKey) - { - $query = ''; - if ($foreignKey->hasOption('match')) { - $query .= ' MATCH ' . $foreignKey->getOption('match'); - } - $query .= parent::getAdvancedForeignKeyOptionsSQL($foreignKey); - if ($foreignKey->hasOption('deferrable') && $foreignKey->getOption('deferrable') !== false) { - $query .= ' DEFERRABLE'; - } else { - $query .= ' NOT DEFERRABLE'; - } - if ($foreignKey->hasOption('feferred') && $foreignKey->getOption('feferred') !== false) { - $query .= ' INITIALLY DEFERRED'; - } else { - $query .= ' INITIALLY IMMEDIATE'; - } - return $query; - } - - /** - * generates the sql for altering an existing table on postgresql - * - * @param string $name name of the table that is intended to be changed. - * @param array $changes associative array that contains the details of each type * - * @param boolean $check indicates whether the function should just check if the DBMS driver - * can perform the requested table alterations if the value is true or - * actually perform them otherwise. - * @see Doctrine_Export::alterTable() - * @return array - * @override - */ - public function getAlterTableSQL(TableDiff $diff) - { - $sql = array(); - $commentsSQL = array(); - $columnSql = array(); - - foreach ($diff->addedColumns as $column) { - if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { - continue; - } - - $query = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); - $sql[] = 'ALTER TABLE ' . $diff->name . ' ' . $query; - if ($comment = $this->getColumnComment($column)) { - $commentsSQL[] = $this->getCommentOnColumnSQL($diff->name, $column->getName(), $comment); - } - } - - foreach ($diff->removedColumns as $column) { - if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) { - continue; - } - - $query = 'DROP ' . $column->getQuotedName($this); - $sql[] = 'ALTER TABLE ' . $diff->name . ' ' . $query; - } - - foreach ($diff->changedColumns AS $columnDiff) { - if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { - continue; - } - - $oldColumnName = $columnDiff->oldColumnName; - $column = $columnDiff->column; - - if ($columnDiff->hasChanged('type')) { - $type = $column->getType(); - - // here was a server version check before, but DBAL API does not support this anymore. - $query = 'ALTER ' . $oldColumnName . ' TYPE ' . $type->getSqlDeclaration($column->toArray(), $this); - $sql[] = 'ALTER TABLE ' . $diff->name . ' ' . $query; - } - if ($columnDiff->hasChanged('default')) { - $query = 'ALTER ' . $oldColumnName . ' SET ' . $this->getDefaultValueDeclarationSQL($column->toArray()); - $sql[] = 'ALTER TABLE ' . $diff->name . ' ' . $query; - } - if ($columnDiff->hasChanged('notnull')) { - $query = 'ALTER ' . $oldColumnName . ' ' . ($column->getNotNull() ? 'SET' : 'DROP') . ' NOT NULL'; - $sql[] = 'ALTER TABLE ' . $diff->name . ' ' . $query; - } - if ($columnDiff->hasChanged('autoincrement')) { - if ($column->getAutoincrement()) { - // add autoincrement - $seqName = $diff->name . '_' . $oldColumnName . '_seq'; - - $sql[] = "CREATE SEQUENCE " . $seqName; - $sql[] = "SELECT setval('" . $seqName . "', (SELECT MAX(" . $oldColumnName . ") FROM " . $diff->name . "))"; - $query = "ALTER " . $oldColumnName . " SET DEFAULT nextval('" . $seqName . "')"; - $sql[] = "ALTER TABLE " . $diff->name . " " . $query; - } else { - // Drop autoincrement, but do NOT drop the sequence. It might be re-used by other tables or have - $query = "ALTER " . $oldColumnName . " " . "DROP DEFAULT"; - $sql[] = "ALTER TABLE " . $diff->name . " " . $query; - } - } - if ($columnDiff->hasChanged('comment') && $comment = $this->getColumnComment($column)) { - $commentsSQL[] = $this->getCommentOnColumnSQL($diff->name, $column->getName(), $comment); - } - } - - foreach ($diff->renamedColumns as $oldColumnName => $column) { - if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) { - continue; - } - - $sql[] = 'ALTER TABLE ' . $diff->name . ' RENAME COLUMN ' . $oldColumnName . ' TO ' . $column->getQuotedName($this); - } - - $tableSql = array(); - - if (!$this->onSchemaAlterTable($diff, $tableSql)) { - if ($diff->newName !== false) { - $sql[] = 'ALTER TABLE ' . $diff->name . ' RENAME TO ' . $diff->newName; - } - - $sql = array_merge($sql, $this->_getAlterTableIndexForeignKeySQL($diff), $commentsSQL); - } - - return array_merge($sql, $tableSql, $columnSql); - } - - /** - * Gets the SQL to create a sequence on this platform. - * - * @param \Doctrine\DBAL\Schema\Sequence $sequence - * @return string - */ - public function getCreateSequenceSQL(\Doctrine\DBAL\Schema\Sequence $sequence) - { - return 'CREATE SEQUENCE ' . $sequence->getQuotedName($this) . - ' INCREMENT BY ' . $sequence->getAllocationSize() . - ' MINVALUE ' . $sequence->getInitialValue() . - ' START ' . $sequence->getInitialValue(); - } - - public function getAlterSequenceSQL(\Doctrine\DBAL\Schema\Sequence $sequence) - { - return 'ALTER SEQUENCE ' . $sequence->getQuotedName($this) . - ' INCREMENT BY ' . $sequence->getAllocationSize(); - } - - /** - * Drop existing sequence - * @param \Doctrine\DBAL\Schema\Sequence $sequence - * @return string - */ - public function getDropSequenceSQL($sequence) - { - if ($sequence instanceof \Doctrine\DBAL\Schema\Sequence) { - $sequence = $sequence->getQuotedName($this); - } - return 'DROP SEQUENCE ' . $sequence; - } - - /** - * @param ForeignKeyConstraint|string $foreignKey - * @param Table|string $table - * @return string - */ - public function getDropForeignKeySQL($foreignKey, $table) - { - return $this->getDropConstraintSQL($foreignKey, $table); - } - - /** - * Gets the SQL used to create a table. - * - * @param unknown_type $tableName - * @param array $columns - * @param array $options - * @return unknown - */ - protected function _getCreateTableSQL($tableName, array $columns, array $options = array()) - { - $queryFields = $this->getColumnDeclarationListSQL($columns); - - if (isset($options['primary']) && ! empty($options['primary'])) { - $keyColumns = array_unique(array_values($options['primary'])); - $queryFields .= ', PRIMARY KEY(' . implode(', ', $keyColumns) . ')'; - } - - $query = 'CREATE TABLE ' . $tableName . ' (' . $queryFields . ')'; - - $sql[] = $query; - - if (isset($options['indexes']) && ! empty($options['indexes'])) { - foreach ($options['indexes'] AS $index) { - $sql[] = $this->getCreateIndexSQL($index, $tableName); - } - } - - if (isset($options['foreignKeys'])) { - foreach ((array) $options['foreignKeys'] as $definition) { - $sql[] = $this->getCreateForeignKeySQL($definition, $tableName); - } - } - - return $sql; - } - - /** - * Postgres wants boolean values converted to the strings 'true'/'false'. - * - * @param array $item - * @override - */ - public function convertBooleans($item) - { - if (is_array($item)) { - foreach ($item as $key => $value) { - if (is_bool($value) || is_numeric($item)) { - $item[$key] = ($value) ? 'true' : 'false'; - } - } - } else { - if (is_bool($item) || is_numeric($item)) { - $item = ($item) ? 'true' : 'false'; - } - } - return $item; - } - - public function getSequenceNextValSQL($sequenceName) - { - return "SELECT NEXTVAL('" . $sequenceName . "')"; - } - - public function getSetTransactionIsolationSQL($level) - { - return 'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL ' - . $this->_getTransactionIsolationLevelSQL($level); - } - - /** - * @override - */ - public function getBooleanTypeDeclarationSQL(array $field) - { - return 'BOOLEAN'; - } - - /** - * @override - */ - public function getIntegerTypeDeclarationSQL(array $field) - { - if ( ! empty($field['autoincrement'])) { - return 'SERIAL'; - } - - return 'INT'; - } - - /** - * @override - */ - public function getBigIntTypeDeclarationSQL(array $field) - { - if ( ! empty($field['autoincrement'])) { - return 'BIGSERIAL'; - } - return 'BIGINT'; - } - - /** - * @override - */ - public function getSmallIntTypeDeclarationSQL(array $field) - { - return 'SMALLINT'; - } - - /** - * @override - */ - public function getDateTimeTypeDeclarationSQL(array $fieldDeclaration) - { - return 'TIMESTAMP(0) WITHOUT TIME ZONE'; - } - - /** - * @override - */ - public function getDateTimeTzTypeDeclarationSQL(array $fieldDeclaration) - { - return 'TIMESTAMP(0) WITH TIME ZONE'; - } - - /** - * @override - */ - public function getDateTypeDeclarationSQL(array $fieldDeclaration) - { - return 'DATE'; - } - - /** - * @override - */ - public function getTimeTypeDeclarationSQL(array $fieldDeclaration) - { - return 'TIME(0) WITHOUT TIME ZONE'; - } - - /** - * @override - */ - protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef) - { - return ''; - } - - /** - * Gets the SQL snippet used to declare a VARCHAR column on the MySql platform. - * - * @params array $field - * @override - */ - protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) - { - return $fixed ? ($length ? 'CHAR(' . $length . ')' : 'CHAR(255)') - : ($length ? 'VARCHAR(' . $length . ')' : 'VARCHAR(255)'); - } - - /** @override */ - public function getClobTypeDeclarationSQL(array $field) - { - return 'TEXT'; - } - - /** - * Get the platform name for this instance - * - * @return string - */ - public function getName() - { - return 'postgresql'; - } - - /** - * Gets the character casing of a column in an SQL result set. - * - * PostgreSQL returns all column names in SQL result sets in lowercase. - * - * @param string $column The column name for which to get the correct character casing. - * @return string The column name in the character casing used in SQL result sets. - */ - public function getSQLResultCasing($column) - { - return strtolower($column); - } - - public function getDateTimeTzFormatString() - { - return 'Y-m-d H:i:sO'; - } - - /** - * Get the insert sql for an empty insert statement - * - * @param string $tableName - * @param string $identifierColumnName - * @return string $sql - */ - public function getEmptyIdentityInsertSQL($quotedTableName, $quotedIdentifierColumnName) - { - return 'INSERT INTO ' . $quotedTableName . ' (' . $quotedIdentifierColumnName . ') VALUES (DEFAULT)'; - } - - /** - * @inheritdoc - */ - public function getTruncateTableSQL($tableName, $cascade = false) - { - return 'TRUNCATE '.$tableName.' '.(($cascade)?'CASCADE':''); - } - - public function getReadLockSQL() - { - return 'FOR SHARE'; - } - - protected function initializeDoctrineTypeMappings() - { - $this->doctrineTypeMapping = array( - 'smallint' => 'smallint', - 'int2' => 'smallint', - 'serial' => 'integer', - 'serial4' => 'integer', - 'int' => 'integer', - 'int4' => 'integer', - 'integer' => 'integer', - 'bigserial' => 'bigint', - 'serial8' => 'bigint', - 'bigint' => 'bigint', - 'int8' => 'bigint', - 'bool' => 'boolean', - 'boolean' => 'boolean', - 'text' => 'text', - 'varchar' => 'string', - 'interval' => 'string', - '_varchar' => 'string', - 'char' => 'string', - 'bpchar' => 'string', - 'date' => 'date', - 'datetime' => 'datetime', - 'timestamp' => 'datetime', - 'timestamptz' => 'datetimetz', - 'time' => 'time', - 'timetz' => 'time', - 'float' => 'float', - 'float4' => 'float', - 'float8' => 'float', - 'double' => 'float', - 'double precision' => 'float', - 'real' => 'float', - 'decimal' => 'decimal', - 'money' => 'decimal', - 'numeric' => 'decimal', - 'year' => 'date', - 'bytea' => 'blob', - ); - } - - public function getVarcharMaxLength() - { - return 65535; - } - - protected function getReservedKeywordsClass() - { - return 'Doctrine\DBAL\Platforms\Keywords\PostgreSQLKeywords'; - } - - /** - * Gets the SQL Snippet used to declare a BLOB column type. - */ - public function getBlobTypeDeclarationSQL(array $field) - { - return 'BYTEA'; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServer2005Platform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServer2005Platform.php deleted file mode 100644 index 2bbcee2..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServer2005Platform.php +++ /dev/null @@ -1,52 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Platforms; - -/** - * Platform to ensure compatibility of Doctrine with SQLServer2005 version and - * higher. - * - * Differences to SQL Server 2008 are: - * - * - DATETIME2 datatype does not exist, only DATETIME which has a precision of - * 3. This is not supported by PHP DateTime, so we are emulating it by - * setting .000 manually. - * - Starting with SQLServer2005 VARCHAR(MAX), VARBINARY(MAX) and - * NVARCHAR(max) replace the old TEXT, NTEXT and IMAGE types. See - * {@link http://www.sql-server-helper.com/faq/sql-server-2005-varchar-max-p01.aspx} - * for more information. - */ -class SQLServer2005Platform extends SQLServerPlatform -{ - /** - * @override - */ - public function supportsLimitOffset() - { - return true; - } - - /** @override */ - public function getClobTypeDeclarationSQL(array $field) - { - return 'VARCHAR(MAX)'; - } -} - diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServer2008Platform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServer2008Platform.php deleted file mode 100644 index 2938d4a..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServer2008Platform.php +++ /dev/null @@ -1,90 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Platforms; - -/** - * Platform to ensure compatibility of Doctrine with SQLServer2008 version. - * - * Differences to SQL Server 2005 and before are that a new DATETIME2 type was - * introduced that has a higher precision. - */ -class SQLServer2008Platform extends SQLServer2005Platform -{ - /** - * @override - */ - public function getDateTimeTypeDeclarationSQL(array $fieldDeclaration) - { - // 3 - microseconds precision length - // http://msdn.microsoft.com/en-us/library/ms187819.aspx - return 'DATETIME2(6)'; - } - - /** - * @override - */ - public function getDateTypeDeclarationSQL(array $fieldDeclaration) - { - return 'DATE'; - } - - /** - * @override - */ - public function getTimeTypeDeclarationSQL(array $fieldDeclaration) - { - return 'TIME(0)'; - } - - /** - * @override - */ - public function getDateTimeFormatString() - { - return 'Y-m-d H:i:s.u'; - } - - /** - * @override - */ - public function getDateFormatString() - { - return 'Y-m-d'; - } - - /** - * @override - */ - public function getTimeFormatString() - { - return 'H:i:s'; - } - - /** - * Adding Datetime2 Type - */ - protected function initializeDoctrineTypeMappings() - { - parent::initializeDoctrineTypeMappings(); - $this->doctrineTypeMapping['datetime2'] = 'datetime'; - $this->doctrineTypeMapping['date'] = 'date'; - $this->doctrineTypeMapping['time'] = 'time'; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php deleted file mode 100644 index a108fd6..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php +++ /dev/null @@ -1,865 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Platforms; - -use Doctrine\DBAL\Schema\TableDiff; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Schema\Index, - Doctrine\DBAL\Schema\Table; - -/** - * The SQLServerPlatform provides the behavior, features and SQL dialect of the - * Microsoft SQL Server database platform. - * - * @since 2.0 - * @author Roman Borschel - * @author Jonathan H. Wage - * @author Benjamin Eberlei - */ -class SQLServerPlatform extends AbstractPlatform -{ - /** - * {@inheritDoc} - */ - public function getDateDiffExpression($date1, $date2) - { - return 'DATEDIFF(day, ' . $date2 . ',' . $date1 . ')'; - } - - public function getDateAddDaysExpression($date, $days) - { - return 'DATEADD(day, ' . $days . ', ' . $date . ')'; - } - - public function getDateSubDaysExpression($date, $days) - { - return 'DATEADD(day, -1 * ' . $days . ', ' . $date . ')'; - } - - public function getDateAddMonthExpression($date, $months) - { - return 'DATEADD(month, ' . $months . ', ' . $date . ')'; - } - - public function getDateSubMonthExpression($date, $months) - { - return 'DATEADD(month, -1 * ' . $months . ', ' . $date . ')'; - } - - /** - * Whether the platform prefers identity columns for ID generation. - * MsSql prefers "autoincrement" identity columns since sequences can only - * be emulated with a table. - * - * @return boolean - * @override - */ - public function prefersIdentityColumns() - { - return true; - } - - /** - * Whether the platform supports identity columns. - * MsSql supports this through AUTO_INCREMENT columns. - * - * @return boolean - * @override - */ - public function supportsIdentityColumns() - { - return true; - } - - /** - * Whether the platform supports releasing savepoints. - * - * @return boolean - */ - public function supportsReleaseSavepoints() - { - return false; - } - - /** - * create a new database - * - * @param string $name name of the database that should be created - * @return string - * @override - */ - public function getCreateDatabaseSQL($name) - { - return 'CREATE DATABASE ' . $name; - } - - /** - * drop an existing database - * - * @param string $name name of the database that should be dropped - * @return string - * @override - */ - public function getDropDatabaseSQL($name) - { - return 'DROP DATABASE ' . $name; - } - - /** - * @override - */ - public function supportsCreateDropDatabase() - { - return false; - } - - /** - * @override - */ - public function getDropForeignKeySQL($foreignKey, $table) - { - if ($foreignKey instanceof \Doctrine\DBAL\Schema\ForeignKeyConstraint) { - $foreignKey = $foreignKey->getQuotedName($this); - } - - if ($table instanceof \Doctrine\DBAL\Schema\Table) { - $table = $table->getQuotedName($this); - } - - return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $foreignKey; - } - - /** - * @override - */ - public function getDropIndexSQL($index, $table=null) - { - if ($index instanceof \Doctrine\DBAL\Schema\Index) { - $index_ = $index; - $index = $index->getQuotedName($this); - } else if (!is_string($index)) { - throw new \InvalidArgumentException('AbstractPlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.'); - } - - if (!isset($table)) { - return 'DROP INDEX ' . $index; - } else { - if ($table instanceof \Doctrine\DBAL\Schema\Table) { - $table = $table->getQuotedName($this); - } - - return "IF EXISTS (SELECT * FROM sysobjects WHERE name = '$index') - ALTER TABLE " . $table . " DROP CONSTRAINT " . $index . " - ELSE - DROP INDEX " . $index . " ON " . $table; - } - } - - /** - * @override - */ - protected function _getCreateTableSQL($tableName, array $columns, array $options = array()) - { - // @todo does other code breaks because of this? - // foce primary keys to be not null - foreach ($columns as &$column) { - if (isset($column['primary']) && $column['primary']) { - $column['notnull'] = true; - } - } - - $columnListSql = $this->getColumnDeclarationListSQL($columns); - - if (isset($options['uniqueConstraints']) && !empty($options['uniqueConstraints'])) { - foreach ($options['uniqueConstraints'] as $name => $definition) { - $columnListSql .= ', ' . $this->getUniqueConstraintDeclarationSQL($name, $definition); - } - } - - if (isset($options['primary']) && !empty($options['primary'])) { - $columnListSql .= ', PRIMARY KEY(' . implode(', ', array_unique(array_values($options['primary']))) . ')'; - } - - $query = 'CREATE TABLE ' . $tableName . ' (' . $columnListSql; - - $check = $this->getCheckDeclarationSQL($columns); - if (!empty($check)) { - $query .= ', ' . $check; - } - $query .= ')'; - - $sql[] = $query; - - if (isset($options['indexes']) && !empty($options['indexes'])) { - foreach ($options['indexes'] AS $index) { - $sql[] = $this->getCreateIndexSQL($index, $tableName); - } - } - - if (isset($options['foreignKeys'])) { - foreach ((array) $options['foreignKeys'] AS $definition) { - $sql[] = $this->getCreateForeignKeySQL($definition, $tableName); - } - } - - return $sql; - } - - /** - * @override - */ - public function getUniqueConstraintDeclarationSQL($name, Index $index) - { - $constraint = parent::getUniqueConstraintDeclarationSQL($name, $index); - - $constraint = $this->_appendUniqueConstraintDefinition($constraint, $index); - - return $constraint; - } - - /** - * @override - */ - public function getCreateIndexSQL(Index $index, $table) - { - $constraint = parent::getCreateIndexSQL($index, $table); - - if ($index->isUnique()) { - $constraint = $this->_appendUniqueConstraintDefinition($constraint, $index); - } - - return $constraint; - } - - /** - * Extend unique key constraint with required filters - * - * @param string $sql - * @param Index $index - * @return string - */ - private function _appendUniqueConstraintDefinition($sql, Index $index) - { - $fields = array(); - foreach ($index->getColumns() as $field => $definition) { - if (!is_array($definition)) { - $field = $definition; - } - - $fields[] = $field . ' IS NOT NULL'; - } - - return $sql . ' WHERE ' . implode(' AND ', $fields); - } - - /** - * @override - */ - public function getAlterTableSQL(TableDiff $diff) - { - $queryParts = array(); - $sql = array(); - $columnSql = array(); - - if ($diff->newName !== false) { - $queryParts[] = "sp_RENAME '" . $diff->name . "', '" . $diff->newName . "'"; - } - - foreach ($diff->addedColumns AS $fieldName => $column) { - if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { - continue; - } - - $queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); - } - - foreach ($diff->removedColumns AS $column) { - if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) { - continue; - } - - $queryParts[] = 'DROP COLUMN ' . $column->getQuotedName($this); - } - - foreach ($diff->changedColumns AS $columnDiff) { - if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { - continue; - } - - /* @var $columnDiff Doctrine\DBAL\Schema\ColumnDiff */ - $column = $columnDiff->column; - $queryParts[] = 'ALTER COLUMN ' . - $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); - } - - foreach ($diff->renamedColumns AS $oldColumnName => $column) { - if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) { - continue; - } - - $sql[] = "sp_RENAME '". $diff->name. ".". $oldColumnName . "' , '".$column->getQuotedName($this)."', 'COLUMN'"; - $queryParts[] = 'ALTER COLUMN ' . - $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); - } - - $tableSql = array(); - - if ($this->onSchemaAlterTable($diff, $tableSql)) { - return array_merge($tableSql, $columnSql); - } - - foreach ($queryParts as $query) { - $sql[] = 'ALTER TABLE ' . $diff->name . ' ' . $query; - } - - $sql = array_merge($sql, $this->_getAlterTableIndexForeignKeySQL($diff)); - - return array_merge($sql, $tableSql, $columnSql); - } - - /** - * @override - */ - public function getEmptyIdentityInsertSQL($quotedTableName, $quotedIdentifierColumnName) - { - return 'INSERT INTO ' . $quotedTableName . ' DEFAULT VALUES'; - } - - /** - * @override - */ - public function getShowDatabasesSQL() - { - return 'SHOW DATABASES'; - } - - /** - * @override - */ - public function getListTablesSQL() - { - // "sysdiagrams" table must be ignored as it's internal SQL Server table for Database Diagrams - return "SELECT name FROM sysobjects WHERE type = 'U' AND name != 'sysdiagrams' ORDER BY name"; - } - - /** - * @override - */ - public function getListTableColumnsSQL($table, $database = null) - { - return "exec sp_columns @table_name = '" . $table . "'"; - } - - /** - * @override - */ - public function getListTableForeignKeysSQL($table, $database = null) - { - return "SELECT f.name AS ForeignKey, - SCHEMA_NAME (f.SCHEMA_ID) AS SchemaName, - OBJECT_NAME (f.parent_object_id) AS TableName, - COL_NAME (fc.parent_object_id,fc.parent_column_id) AS ColumnName, - SCHEMA_NAME (o.SCHEMA_ID) ReferenceSchemaName, - OBJECT_NAME (f.referenced_object_id) AS ReferenceTableName, - COL_NAME(fc.referenced_object_id,fc.referenced_column_id) AS ReferenceColumnName, - f.delete_referential_action_desc, - f.update_referential_action_desc - FROM sys.foreign_keys AS f - INNER JOIN sys.foreign_key_columns AS fc - INNER JOIN sys.objects AS o ON o.OBJECT_ID = fc.referenced_object_id - ON f.OBJECT_ID = fc.constraint_object_id - WHERE OBJECT_NAME (f.parent_object_id) = '" . $table . "'"; - } - - /** - * @override - */ - public function getListTableIndexesSQL($table, $currentDatabase = null) - { - return "exec sp_helpindex '" . $table . "'"; - } - - /** - * @override - */ - public function getCreateViewSQL($name, $sql) - { - return 'CREATE VIEW ' . $name . ' AS ' . $sql; - } - - /** - * @override - */ - public function getListViewsSQL($database) - { - return "SELECT name FROM sysobjects WHERE type = 'V' ORDER BY name"; - } - - /** - * @override - */ - public function getDropViewSQL($name) - { - return 'DROP VIEW ' . $name; - } - - /** - * Returns the regular expression operator. - * - * @return string - * @override - */ - public function getRegexpExpression() - { - return 'RLIKE'; - } - - /** - * Returns global unique identifier - * - * @return string to get global unique identifier - * @override - */ - public function getGuidExpression() - { - return 'UUID()'; - } - - /** - * @override - */ - public function getLocateExpression($str, $substr, $startPos = false) - { - if ($startPos == false) { - return 'CHARINDEX(' . $substr . ', ' . $str . ')'; - } else { - return 'CHARINDEX(' . $substr . ', ' . $str . ', ' . $startPos . ')'; - } - } - - /** - * @override - */ - public function getModExpression($expression1, $expression2) - { - return $expression1 . ' % ' . $expression2; - } - - /** - * @override - */ - public function getTrimExpression($str, $pos = self::TRIM_UNSPECIFIED, $char = false) - { - $trimFn = ''; - - if (!$char) { - if ($pos == self::TRIM_LEADING) { - $trimFn = 'LTRIM'; - } else if ($pos == self::TRIM_TRAILING) { - $trimFn = 'RTRIM'; - } else { - return 'LTRIM(RTRIM(' . $str . '))'; - } - - return $trimFn . '(' . $str . ')'; - } else { - /** Original query used to get those expressions - declare @c varchar(100) = 'xxxBarxxx', @trim_char char(1) = 'x'; - declare @pat varchar(10) = '%[^' + @trim_char + ']%'; - select @c as string - , @trim_char as trim_char - , stuff(@c, 1, patindex(@pat, @c) - 1, null) as trim_leading - , reverse(stuff(reverse(@c), 1, patindex(@pat, reverse(@c)) - 1, null)) as trim_trailing - , reverse(stuff(reverse(stuff(@c, 1, patindex(@pat, @c) - 1, null)), 1, patindex(@pat, reverse(stuff(@c, 1, patindex(@pat, @c) - 1, null))) - 1, null)) as trim_both; - */ - $pattern = "'%[^' + $char + ']%'"; - - if ($pos == self::TRIM_LEADING) { - return 'stuff(' . $str . ', 1, patindex(' . $pattern . ', ' . $str . ') - 1, null)'; - } else if ($pos == self::TRIM_TRAILING) { - return 'reverse(stuff(reverse(' . $str . '), 1, patindex(' . $pattern . ', reverse(' . $str . ')) - 1, null))'; - } else { - return 'reverse(stuff(reverse(stuff(' . $str . ', 1, patindex(' . $pattern . ', ' . $str . ') - 1, null)), 1, patindex(' . $pattern . ', reverse(stuff(' . $str . ', 1, patindex(' . $pattern . ', ' . $str . ') - 1, null))) - 1, null))'; - } - } - } - - /** - * @override - */ - public function getConcatExpression() - { - $args = func_get_args(); - return '(' . implode(' + ', $args) . ')'; - } - - public function getListDatabasesSQL() - { - return 'SELECT * FROM SYS.DATABASES'; - } - - /** - * @override - */ - public function getSubstringExpression($value, $from, $len = null) - { - if (!is_null($len)) { - return 'SUBSTRING(' . $value . ', ' . $from . ', ' . $len . ')'; - } - return 'SUBSTRING(' . $value . ', ' . $from . ', LEN(' . $value . ') - ' . $from . ' + 1)'; - } - - /** - * @override - */ - public function getLengthExpression($column) - { - return 'LEN(' . $column . ')'; - } - - /** - * @override - */ - public function getSetTransactionIsolationSQL($level) - { - return 'SET TRANSACTION ISOLATION LEVEL ' . $this->_getTransactionIsolationLevelSQL($level); - } - - /** - * @override - */ - public function getIntegerTypeDeclarationSQL(array $field) - { - return 'INT' . $this->_getCommonIntegerTypeDeclarationSQL($field); - } - - /** - * @override - */ - public function getBigIntTypeDeclarationSQL(array $field) - { - return 'BIGINT' . $this->_getCommonIntegerTypeDeclarationSQL($field); - } - - /** - * @override - */ - public function getSmallIntTypeDeclarationSQL(array $field) - { - return 'SMALLINT' . $this->_getCommonIntegerTypeDeclarationSQL($field); - } - - /** @override */ - protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) - { - return $fixed ? ($length ? 'NCHAR(' . $length . ')' : 'CHAR(255)') : ($length ? 'NVARCHAR(' . $length . ')' : 'NVARCHAR(255)'); - } - - /** @override */ - public function getClobTypeDeclarationSQL(array $field) - { - return 'TEXT'; - } - - /** - * @override - */ - protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef) - { - $autoinc = ''; - if (!empty($columnDef['autoincrement'])) { - $autoinc = ' IDENTITY'; - } - $unsigned = (isset($columnDef['unsigned']) && $columnDef['unsigned']) ? ' UNSIGNED' : ''; - - return $unsigned . $autoinc; - } - - /** - * @override - */ - public function getDateTimeTypeDeclarationSQL(array $fieldDeclaration) - { - return 'DATETIME'; - } - - /** - * @override - */ - public function getDateTypeDeclarationSQL(array $fieldDeclaration) - { - return 'DATETIME'; - } - - /** - * @override - */ - public function getTimeTypeDeclarationSQL(array $fieldDeclaration) - { - return 'DATETIME'; - } - - /** - * @override - */ - public function getBooleanTypeDeclarationSQL(array $field) - { - return 'BIT'; - } - - /** - * Adds an adapter-specific LIMIT clause to the SELECT statement. - * - * @param string $query - * @param integer $limit - * @param integer $offset - * @link http://lists.bestpractical.com/pipermail/rt-devel/2005-June/007339.html - * @return string - */ - protected function doModifyLimitQuery($query, $limit, $offset = null) - { - if ($limit > 0) { - if ($offset == 0) { - $query = preg_replace('/^(SELECT\s(DISTINCT\s)?)/i', '\1TOP ' . $limit . ' ', $query); - } else { - $orderby = stristr($query, 'ORDER BY'); - - if (!$orderby) { - $over = 'ORDER BY (SELECT 0)'; - } else { - $over = preg_replace('/\"[^,]*\".\"([^,]*)\"/i', '"inner_tbl"."$1"', $orderby); - } - - // Remove ORDER BY clause from $query - $query = preg_replace('/\s+ORDER BY(.*)/', '', $query); - $query = preg_replace('/^SELECT\s/', '', $query); - - $start = $offset + 1; - $end = $offset + $limit; - - $query = "SELECT * FROM (SELECT ROW_NUMBER() OVER ($over) AS \"doctrine_rownum\", $query) AS doctrine_tbl WHERE \"doctrine_rownum\" BETWEEN $start AND $end"; - } - } - - return $query; - } - - /** - * @override - */ - public function supportsLimitOffset() - { - return false; - } - - /** - * @override - */ - public function convertBooleans($item) - { - if (is_array($item)) { - foreach ($item as $key => $value) { - if (is_bool($value) || is_numeric($item)) { - $item[$key] = ($value) ? 1 : 0; - } - } - } else { - if (is_bool($item) || is_numeric($item)) { - $item = ($item) ? 1 : 0; - } - } - return $item; - } - - /** - * @override - */ - public function getCreateTemporaryTableSnippetSQL() - { - return "CREATE TABLE"; - } - - /** - * @override - */ - public function getTemporaryTableName($tableName) - { - return '#' . $tableName; - } - - /** - * @override - */ - public function getDateTimeFormatString() - { - return 'Y-m-d H:i:s.000'; - } - - /** - * @override - */ - public function getDateFormatString() - { - return 'Y-m-d H:i:s.000'; - } - - /** - * @override - */ - public function getTimeFormatString() - { - return 'Y-m-d H:i:s.000'; - } - - /** - * @override - */ - public function getDateTimeTzFormatString() - { - return $this->getDateTimeFormatString(); - } - - /** - * Get the platform name for this instance - * - * @return string - */ - public function getName() - { - return 'mssql'; - } - - /** - * @override - */ - protected function initializeDoctrineTypeMappings() - { - $this->doctrineTypeMapping = array( - 'bigint' => 'bigint', - 'numeric' => 'decimal', - 'bit' => 'boolean', - 'smallint' => 'smallint', - 'decimal' => 'decimal', - 'smallmoney' => 'integer', - 'int' => 'integer', - 'tinyint' => 'smallint', - 'money' => 'integer', - 'float' => 'float', - 'real' => 'float', - 'double' => 'float', - 'double precision' => 'float', - 'datetimeoffset' => 'datetimetz', - 'smalldatetime' => 'datetime', - 'datetime' => 'datetime', - 'char' => 'string', - 'varchar' => 'string', - 'text' => 'text', - 'nchar' => 'string', - 'nvarchar' => 'string', - 'ntext' => 'text', - 'binary' => 'text', - 'varbinary' => 'blob', - 'image' => 'text', - ); - } - - /** - * Generate SQL to create a new savepoint - * - * @param string $savepoint - * @return string - */ - public function createSavePoint($savepoint) - { - return 'SAVE TRANSACTION ' . $savepoint; - } - - /** - * Generate SQL to release a savepoint - * - * @param string $savepoint - * @return string - */ - public function releaseSavePoint($savepoint) - { - return ''; - } - - /** - * Generate SQL to rollback a savepoint - * - * @param string $savepoint - * @return string - */ - public function rollbackSavePoint($savepoint) - { - return 'ROLLBACK TRANSACTION ' . $savepoint; - } - - /** - * @override - */ - public function appendLockHint($fromClause, $lockMode) - { - // @todo coorect - if ($lockMode == \Doctrine\DBAL\LockMode::PESSIMISTIC_READ) { - return $fromClause . ' WITH (tablockx)'; - } else if ($lockMode == \Doctrine\DBAL\LockMode::PESSIMISTIC_WRITE) { - return $fromClause . ' WITH (tablockx)'; - } else { - return $fromClause; - } - } - - /** - * @override - */ - public function getForUpdateSQL() - { - return ' '; - } - - protected function getReservedKeywordsClass() - { - return 'Doctrine\DBAL\Platforms\Keywords\MsSQLKeywords'; - } - - /** - * {@inheritDoc} - */ - public function quoteSingleIdentifier($str) - { - return "[" . str_replace("]", "][", $str) . "]"; - } - - public function getTruncateTableSQL($tableName, $cascade = false) - { - return 'TRUNCATE TABLE '.$tableName; - } - - /** - * Gets the SQL Snippet used to declare a BLOB column type. - */ - public function getBlobTypeDeclarationSQL(array $field) - { - return 'VARBINARY(MAX)'; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php deleted file mode 100644 index 9cfa726..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php +++ /dev/null @@ -1,519 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Platforms; - -use Doctrine\DBAL\DBALException; - -/** - * The SqlitePlatform class describes the specifics and dialects of the SQLite - * database platform. - * - * @since 2.0 - * @author Roman Borschel - * @author Benjamin Eberlei - * @todo Rename: SQLitePlatform - */ -class SqlitePlatform extends AbstractPlatform -{ - /** - * returns the regular expression operator - * - * @return string - * @override - */ - public function getRegexpExpression() - { - return 'RLIKE'; - } - - /** - * Return string to call a variable with the current timestamp inside an SQL statement - * There are three special variables for current date and time. - * - * @return string sqlite function as string - * @override - */ - public function getNowExpression($type = 'timestamp') - { - switch ($type) { - case 'time': - return 'time(\'now\')'; - case 'date': - return 'date(\'now\')'; - case 'timestamp': - default: - return 'datetime(\'now\')'; - } - } - - /** - * Trim a string, leading/trailing/both and with a given char which defaults to space. - * - * @param string $str - * @param int $pos - * @param string $char - * @return string - */ - public function getTrimExpression($str, $pos = self::TRIM_UNSPECIFIED, $char = false) - { - $trimFn = ''; - $trimChar = ($char != false) ? (', ' . $char) : ''; - - if ($pos == self::TRIM_LEADING) { - $trimFn = 'LTRIM'; - } else if($pos == self::TRIM_TRAILING) { - $trimFn = 'RTRIM'; - } else { - $trimFn = 'TRIM'; - } - - return $trimFn . '(' . $str . $trimChar . ')'; - } - - /** - * return string to call a function to get a substring inside an SQL statement - * - * Note: Not SQL92, but common functionality. - * - * SQLite only supports the 2 parameter variant of this function - * - * @param string $value an sql string literal or column name/alias - * @param integer $position where to start the substring portion - * @param integer $length the substring portion length - * @return string SQL substring function with given parameters - * @override - */ - public function getSubstringExpression($value, $position, $length = null) - { - if ($length !== null) { - return 'SUBSTR(' . $value . ', ' . $position . ', ' . $length . ')'; - } - return 'SUBSTR(' . $value . ', ' . $position . ', LENGTH(' . $value . '))'; - } - - /** - * returns the position of the first occurrence of substring $substr in string $str - * - * @param string $substr literal string to find - * @param string $str literal string - * @param int $pos position to start at, beginning of string by default - * @return integer - */ - public function getLocateExpression($str, $substr, $startPos = false) - { - if ($startPos == false) { - return 'LOCATE('.$str.', '.$substr.')'; - } else { - return 'LOCATE('.$str.', '.$substr.', '.$startPos.')'; - } - } - - public function getDateDiffExpression($date1, $date2) - { - return 'ROUND(JULIANDAY('.$date1 . ')-JULIANDAY('.$date2.'))'; - } - - public function getDateAddDaysExpression($date, $days) - { - return "DATE(" . $date . ",'+". $days . " day')"; - } - - public function getDateSubDaysExpression($date, $days) - { - return "DATE(" . $date . ",'-". $days . " day')"; - } - - public function getDateAddMonthExpression($date, $months) - { - return "DATE(" . $date . ",'+". $months . " month')"; - } - - public function getDateSubMonthExpression($date, $months) - { - return "DATE(" . $date . ",'-". $months . " month')"; - } - - protected function _getTransactionIsolationLevelSQL($level) - { - switch ($level) { - case \Doctrine\DBAL\Connection::TRANSACTION_READ_UNCOMMITTED: - return 0; - case \Doctrine\DBAL\Connection::TRANSACTION_READ_COMMITTED: - case \Doctrine\DBAL\Connection::TRANSACTION_REPEATABLE_READ: - case \Doctrine\DBAL\Connection::TRANSACTION_SERIALIZABLE: - return 1; - default: - return parent::_getTransactionIsolationLevelSQL($level); - } - } - - public function getSetTransactionIsolationSQL($level) - { - return 'PRAGMA read_uncommitted = ' . $this->_getTransactionIsolationLevelSQL($level); - } - - /** - * @override - */ - public function prefersIdentityColumns() - { - return true; - } - - /** - * @override - */ - public function getBooleanTypeDeclarationSQL(array $field) - { - return 'BOOLEAN'; - } - - /** - * @override - */ - public function getIntegerTypeDeclarationSQL(array $field) - { - return $this->_getCommonIntegerTypeDeclarationSQL($field); - } - - /** - * @override - */ - public function getBigIntTypeDeclarationSQL(array $field) - { - return $this->_getCommonIntegerTypeDeclarationSQL($field); - } - - /** - * @override - */ - public function getTinyIntTypeDeclarationSql(array $field) - { - return $this->_getCommonIntegerTypeDeclarationSQL($field); - } - - /** - * @override - */ - public function getSmallIntTypeDeclarationSQL(array $field) - { - return $this->_getCommonIntegerTypeDeclarationSQL($field); - } - - /** - * @override - */ - public function getMediumIntTypeDeclarationSql(array $field) - { - return $this->_getCommonIntegerTypeDeclarationSQL($field); - } - - /** - * @override - */ - public function getDateTimeTypeDeclarationSQL(array $fieldDeclaration) - { - return 'DATETIME'; - } - - /** - * @override - */ - public function getDateTypeDeclarationSQL(array $fieldDeclaration) - { - return 'DATE'; - } - - /** - * @override - */ - public function getTimeTypeDeclarationSQL(array $fieldDeclaration) - { - return 'TIME'; - } - - /** - * @override - */ - protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef) - { - return 'INTEGER'; - } - - /** - * create a new table - * - * @param string $name Name of the database that should be created - * @param array $fields Associative array that contains the definition of each field of the new table - * The indexes of the array entries are the names of the fields of the table an - * the array entry values are associative arrays like those that are meant to be - * passed with the field definitions to get[Type]Declaration() functions. - * array( - * 'id' => array( - * 'type' => 'integer', - * 'unsigned' => 1 - * 'notnull' => 1 - * 'default' => 0 - * ), - * 'name' => array( - * 'type' => 'text', - * 'length' => 12 - * ), - * 'password' => array( - * 'type' => 'text', - * 'length' => 12 - * ) - * ); - * @param array $options An associative array of table options: - * - * @return void - * @override - */ - protected function _getCreateTableSQL($name, array $columns, array $options = array()) - { - $name = str_replace(".", "__", $name); - $queryFields = $this->getColumnDeclarationListSQL($columns); - - if (isset($options['primary']) && ! empty($options['primary'])) { - $keyColumns = array_unique(array_values($options['primary'])); - $keyColumns = array_map(array($this, 'quoteIdentifier'), $keyColumns); - $queryFields.= ', PRIMARY KEY('.implode(', ', $keyColumns).')'; - } - - $query[] = 'CREATE TABLE ' . $name . ' (' . $queryFields . ')'; - - if (isset($options['indexes']) && ! empty($options['indexes'])) { - foreach ($options['indexes'] as $index => $indexDef) { - $query[] = $this->getCreateIndexSQL($indexDef, $name); - } - } - if (isset($options['unique']) && ! empty($options['unique'])) { - foreach ($options['unique'] as $index => $indexDef) { - $query[] = $this->getCreateIndexSQL($indexDef, $name); - } - } - return $query; - } - - /** - * {@inheritdoc} - */ - protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) - { - return $fixed ? ($length ? 'CHAR(' . $length . ')' : 'CHAR(255)') - : ($length ? 'VARCHAR(' . $length . ')' : 'TEXT'); - } - - public function getClobTypeDeclarationSQL(array $field) - { - return 'CLOB'; - } - - public function getListTableConstraintsSQL($table) - { - $table = str_replace(".", "__", $table); - return "SELECT sql FROM sqlite_master WHERE type='index' AND tbl_name = '$table' AND sql NOT NULL ORDER BY name"; - } - - public function getListTableColumnsSQL($table, $currentDatabase = null) - { - $table = str_replace(".", "__", $table); - return "PRAGMA table_info($table)"; - } - - public function getListTableIndexesSQL($table, $currentDatabase = null) - { - $table = str_replace(".", "__", $table); - return "PRAGMA index_list($table)"; - } - - public function getListTablesSQL() - { - return "SELECT name FROM sqlite_master WHERE type = 'table' AND name != 'sqlite_sequence' AND name != 'geometry_columns' AND name != 'spatial_ref_sys' " - . "UNION ALL SELECT name FROM sqlite_temp_master " - . "WHERE type = 'table' ORDER BY name"; - } - - public function getListViewsSQL($database) - { - return "SELECT name, sql FROM sqlite_master WHERE type='view' AND sql NOT NULL"; - } - - public function getCreateViewSQL($name, $sql) - { - return 'CREATE VIEW ' . $name . ' AS ' . $sql; - } - - public function getDropViewSQL($name) - { - return 'DROP VIEW '. $name; - } - - /** - * SQLite does support foreign key constraints, but only in CREATE TABLE statements... - * This really limits their usefulness and requires SQLite specific handling, so - * we simply say that SQLite does NOT support foreign keys for now... - * - * @return boolean FALSE - * @override - */ - public function supportsForeignKeyConstraints() - { - return false; - } - - public function supportsAlterTable() - { - return false; - } - - public function supportsIdentityColumns() - { - return true; - } - - /** - * Get the platform name for this instance - * - * @return string - */ - public function getName() - { - return 'sqlite'; - } - - /** - * @inheritdoc - */ - public function getTruncateTableSQL($tableName, $cascade = false) - { - $tableName = str_replace(".", "__", $tableName); - return 'DELETE FROM '.$tableName; - } - - /** - * User-defined function for Sqlite that is used with PDO::sqliteCreateFunction() - * - * @param int|float $value - * @return float - */ - static public function udfSqrt($value) - { - return sqrt($value); - } - - /** - * User-defined function for Sqlite that implements MOD(a, b) - */ - static public function udfMod($a, $b) - { - return ($a % $b); - } - - /** - * @param string $str - * @param string $substr - * @param int $offset - */ - static public function udfLocate($str, $substr, $offset = 0) - { - $pos = strpos($str, $substr, $offset); - if ($pos !== false) { - return $pos+1; - } - return 0; - } - - public function getForUpdateSql() - { - return ''; - } - - protected function initializeDoctrineTypeMappings() - { - $this->doctrineTypeMapping = array( - 'boolean' => 'boolean', - 'tinyint' => 'boolean', - 'smallint' => 'smallint', - 'mediumint' => 'integer', - 'int' => 'integer', - 'integer' => 'integer', - 'serial' => 'integer', - 'bigint' => 'bigint', - 'bigserial' => 'bigint', - 'clob' => 'text', - 'tinytext' => 'text', - 'mediumtext' => 'text', - 'longtext' => 'text', - 'text' => 'text', - 'varchar' => 'string', - 'longvarchar' => 'string', - 'varchar2' => 'string', - 'nvarchar' => 'string', - 'image' => 'string', - 'ntext' => 'string', - 'char' => 'string', - 'date' => 'date', - 'datetime' => 'datetime', - 'timestamp' => 'datetime', - 'time' => 'time', - 'float' => 'float', - 'double' => 'float', - 'double precision' => 'float', - 'real' => 'float', - 'decimal' => 'decimal', - 'numeric' => 'decimal', - 'blob' => 'blob', - ); - } - - protected function getReservedKeywordsClass() - { - return 'Doctrine\DBAL\Platforms\Keywords\SQLiteKeywords'; - } - - /** - * Gets the SQL Snippet used to declare a BLOB column type. - */ - public function getBlobTypeDeclarationSQL(array $field) - { - return 'BLOB'; - } - - public function getTemporaryTableName($tableName) - { - $tableName = str_replace(".", "__", $tableName); - return $tableName; - } - - /** - * Sqlite Platform emulates schema by underscoring each dot and generating tables - * into the default database. - * - * This hack is implemented to be able to use SQLite as testdriver when - * using schema supporting databases. - * - * @return bool - */ - public function canEmulateSchemas() - { - return true; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Portability/Connection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Portability/Connection.php deleted file mode 100644 index 93ee9fc..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Portability/Connection.php +++ /dev/null @@ -1,113 +0,0 @@ -. - */ - - -namespace Doctrine\DBAL\Portability; - -use Doctrine\Common\EventManager; -use Doctrine\DBAL\Configuration; -use Doctrine\DBAL\Driver; -use Doctrine\DBAL\Cache\QueryCacheProfile; - -class Connection extends \Doctrine\DBAL\Connection -{ - const PORTABILITY_ALL = 255; - const PORTABILITY_NONE = 0; - const PORTABILITY_RTRIM = 1; - const PORTABILITY_EMPTY_TO_NULL = 4; - const PORTABILITY_FIX_CASE = 8; - - const PORTABILITY_ORACLE = 9; - const PORTABILITY_POSTGRESQL = 13; - const PORTABILITY_SQLITE = 13; - const PORTABILITY_OTHERVENDORS = 12; - - /** - * @var int - */ - private $portability = self::PORTABILITY_NONE; - - /** - * @var int - */ - private $case; - - public function connect() - { - $ret = parent::connect(); - if ($ret) { - $params = $this->getParams(); - if (isset($params['portability'])) { - if ($this->_platform->getName() === "oracle") { - $params['portability'] = $params['portability'] & self::PORTABILITY_ORACLE; - } else if ($this->_platform->getName() === "postgresql") { - $params['portability'] = $params['portability'] & self::PORTABILITY_POSTGRESQL; - } else if ($this->_platform->getName() === "sqlite") { - $params['portability'] = $params['portability'] & self::PORTABILITY_SQLITE; - } else { - $params['portability'] = $params['portability'] & self::PORTABILITY_OTHERVENDORS; - } - $this->portability = $params['portability']; - } - if (isset($params['fetch_case']) && $this->portability & self::PORTABILITY_FIX_CASE) { - if ($this->_conn instanceof \Doctrine\DBAL\Driver\PDOConnection) { - // make use of c-level support for case handling - $this->_conn->setAttribute(\PDO::ATTR_CASE, $params['fetch_case']); - } else { - $this->case = ($params['fetch_case'] == \PDO::CASE_LOWER) ? CASE_LOWER : CASE_UPPER; - } - } - } - return $ret; - } - - public function getPortability() - { - return $this->portability; - } - - public function getFetchCase() - { - return $this->case; - } - - public function executeQuery($query, array $params = array(), $types = array(), QueryCacheProfile $qcp = null) - { - return new Statement(parent::executeQuery($query, $params, $types, $qcp), $this); - } - - /** - * Prepares an SQL statement. - * - * @param string $statement The SQL statement to prepare. - * @return Doctrine\DBAL\Driver\Statement The prepared statement. - */ - public function prepare($statement) - { - return new Statement(parent::prepare($statement), $this); - } - - public function query() - { - $this->connect(); - - $stmt = call_user_func_array(array($this->_conn, 'query'), func_get_args()); - return new Statement($stmt, $this); - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Portability/Statement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Portability/Statement.php deleted file mode 100644 index 70622f6..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Portability/Statement.php +++ /dev/null @@ -1,191 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Portability; - -use PDO; - -/** - * Portability Wrapper for a Statement - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.0 - * @author Benjamin Eberlei - */ -class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement -{ - - /** - * @var int - */ - private $portability; - - /** - * @var Doctrine\DBAL\Driver\Statement - */ - private $stmt; - - /** - * @var int - */ - private $case; - - /** - * @var int - */ - private $defaultFetchStyle = PDO::FETCH_BOTH; - - /** - * Wraps Statement and applies portability measures - * - * @param Doctrine\DBAL\Driver\Statement $stmt - * @param Doctrine\DBAL\Connection $conn - */ - public function __construct($stmt, Connection $conn) - { - $this->stmt = $stmt; - $this->portability = $conn->getPortability(); - $this->case = $conn->getFetchCase(); - } - - public function bindParam($column, &$variable, $type = null) - { - return $this->stmt->bindParam($column, $variable, $type); - } - - public function bindValue($param, $value, $type = null) - { - return $this->stmt->bindValue($param, $value, $type); - } - - public function closeCursor() - { - return $this->stmt->closeCursor(); - } - - public function columnCount() - { - return $this->stmt->columnCount(); - } - - public function errorCode() - { - return $this->stmt->errorCode(); - } - - public function errorInfo() - { - return $this->stmt->errorInfo(); - } - - public function execute($params = null) - { - return $this->stmt->execute($params); - } - - public function setFetchMode($fetchStyle, $arg1 = null, $arg2 = null) - { - $this->defaultFetchStyle = $fetchStyle; - $this->stmt->setFetchMode($fetchStyle, $arg1, $arg2); - } - - public function getIterator() - { - $data = $this->fetchAll($this->defaultFetchStyle); - return new \ArrayIterator($data); - } - - public function fetch($fetchStyle = PDO::FETCH_BOTH) - { - $row = $this->stmt->fetch($fetchStyle); - - $row = $this->fixRow($row, - $this->portability & (Connection::PORTABILITY_EMPTY_TO_NULL|Connection::PORTABILITY_RTRIM), - !is_null($this->case) && ($fetchStyle == PDO::FETCH_ASSOC || $fetchStyle == PDO::FETCH_BOTH) && ($this->portability & Connection::PORTABILITY_FIX_CASE) - ); - - return $row; - } - - public function fetchAll($fetchStyle = PDO::FETCH_BOTH, $columnIndex = 0) - { - if ($columnIndex != 0) { - $rows = $this->stmt->fetchAll($fetchStyle, $columnIndex); - } else { - $rows = $this->stmt->fetchAll($fetchStyle); - } - - $iterateRow = $this->portability & (Connection::PORTABILITY_EMPTY_TO_NULL|Connection::PORTABILITY_RTRIM); - $fixCase = !is_null($this->case) && ($fetchStyle == PDO::FETCH_ASSOC || $fetchStyle == PDO::FETCH_BOTH) && ($this->portability & Connection::PORTABILITY_FIX_CASE); - if (!$iterateRow && !$fixCase) { - return $rows; - } - - foreach ($rows AS $num => $row) { - $rows[$num] = $this->fixRow($row, $iterateRow, $fixCase); - } - - return $rows; - } - - protected function fixRow($row, $iterateRow, $fixCase) - { - if (!$row) { - return $row; - } - - if ($fixCase) { - $row = array_change_key_case($row, $this->case); - } - - if ($iterateRow) { - foreach ($row AS $k => $v) { - if (($this->portability & Connection::PORTABILITY_EMPTY_TO_NULL) && $v === '') { - $row[$k] = null; - } else if (($this->portability & Connection::PORTABILITY_RTRIM) && is_string($v)) { - $row[$k] = rtrim($v); - } - } - } - return $row; - } - - public function fetchColumn($columnIndex = 0) - { - $value = $this->stmt->fetchColumn($columnIndex); - - if ($this->portability & (Connection::PORTABILITY_EMPTY_TO_NULL|Connection::PORTABILITY_RTRIM)) { - if (($this->portability & Connection::PORTABILITY_EMPTY_TO_NULL) && $value === '') { - $value = null; - } else if (($this->portability & Connection::PORTABILITY_RTRIM) && is_string($value)) { - $value = rtrim($value); - } - } - - return $value; - } - - public function rowCount() - { - return $this->stmt->rowCount(); - } - -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/Expression/CompositeExpression.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/Expression/CompositeExpression.php deleted file mode 100644 index 5da1889..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/Expression/CompositeExpression.php +++ /dev/null @@ -1,130 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Query\Expression; - -/** - * Composite expression is responsible to build a group of similar expression. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.1 - * @author Guilherme Blanco - * @author Benjamin Eberlei - */ -class CompositeExpression implements \Countable -{ - /** - * Constant that represents an AND composite expression - */ - const TYPE_AND = 'AND'; - - /** - * Constant that represents an OR composite expression - */ - const TYPE_OR = 'OR'; - - /** - * @var string Holds the instance type of composite expression - */ - private $type; - - /** - * @var array Each expression part of the composite expression - */ - private $parts = array(); - - /** - * Constructor. - * - * @param string $type Instance type of composite expression - * @param array $parts Composition of expressions to be joined on composite expression - */ - public function __construct($type, array $parts = array()) - { - $this->type = $type; - - $this->addMultiple($parts); - } - - /** - * Adds multiple parts to composite expression. - * - * @param array $args - * - * @return CompositeExpression - */ - public function addMultiple(array $parts = array()) - { - foreach ((array) $parts as $part) { - $this->add($part); - } - - return $this; - } - - /** - * Adds an expression to composite expression. - * - * @param mixed $part - * @return CompositeExpression - */ - public function add($part) - { - if ( ! empty($part) || ($part instanceof self && $part->count() > 0)) { - $this->parts[] = $part; - } - - return $this; - } - - /** - * Retrieves the amount of expressions on composite expression. - * - * @return integer - */ - public function count() - { - return count($this->parts); - } - - /** - * Retrieve the string representation of this composite expression. - * - * @return string - */ - public function __toString() - { - if (count($this->parts) === 1) { - return (string) $this->parts[0]; - } - - return '(' . implode(') ' . $this->type . ' (', $this->parts) . ')'; - } - - /** - * Return type of this composite expression (AND/OR) - * - * @return string - */ - public function getType() - { - return $this->type; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/Expression/ExpressionBuilder.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/Expression/ExpressionBuilder.php deleted file mode 100644 index 35f0762..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/Expression/ExpressionBuilder.php +++ /dev/null @@ -1,264 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Query\Expression; - -use Doctrine\DBAL\Connection; - -/** - * ExpressionBuilder class is responsible to dynamically create SQL query parts. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.1 - * @author Guilherme Blanco - * @author Benjamin Eberlei - */ -class ExpressionBuilder -{ - const EQ = '='; - const NEQ = '<>'; - const LT = '<'; - const LTE = '<='; - const GT = '>'; - const GTE = '>='; - - /** - * @var Doctrine\DBAL\Connection DBAL Connection - */ - private $connection = null; - - /** - * Initializes a new ExpressionBuilder. - * - * @param Doctrine\DBAL\Connection $connection DBAL Connection - */ - public function __construct(Connection $connection) - { - $this->connection = $connection; - } - - /** - * Creates a conjunction of the given boolean expressions. - * - * Example: - * - * [php] - * // (u.type = ?) AND (u.role = ?) - * $expr->andX('u.type = ?', 'u.role = ?')); - * - * @param mixed $x Optional clause. Defaults = null, but requires - * at least one defined when converting to string. - * @return CompositeExpression - */ - public function andX($x = null) - { - return new CompositeExpression(CompositeExpression::TYPE_AND, func_get_args()); - } - - /** - * Creates a disjunction of the given boolean expressions. - * - * Example: - * - * [php] - * // (u.type = ?) OR (u.role = ?) - * $qb->where($qb->expr()->orX('u.type = ?', 'u.role = ?')); - * - * @param mixed $x Optional clause. Defaults = null, but requires - * at least one defined when converting to string. - * @return CompositeExpression - */ - public function orX($x = null) - { - return new CompositeExpression(CompositeExpression::TYPE_OR, func_get_args()); - } - - /** - * Creates a comparison expression. - * - * @param mixed $x Left expression - * @param string $operator One of the ExpressionBuikder::* constants. - * @param mixed $y Right expression - * @return string - */ - public function comparison($x, $operator, $y) - { - return $x . ' ' . $operator . ' ' . $y; - } - - /** - * Creates an equality comparison expression with the given arguments. - * - * First argument is considered the left expression and the second is the right expression. - * When converted to string, it will generated a = . Example: - * - * [php] - * // u.id = ? - * $expr->eq('u.id', '?'); - * - * @param mixed $x Left expression - * @param mixed $y Right expression - * @return string - */ - public function eq($x, $y) - { - return $this->comparison($x, self::EQ, $y); - } - - /** - * Creates a non equality comparison expression with the given arguments. - * First argument is considered the left expression and the second is the right expression. - * When converted to string, it will generated a <> . Example: - * - * [php] - * // u.id <> 1 - * $q->where($q->expr()->neq('u.id', '1')); - * - * @param mixed $x Left expression - * @param mixed $y Right expression - * @return string - */ - public function neq($x, $y) - { - return $this->comparison($x, self::NEQ, $y); - } - - /** - * Creates a lower-than comparison expression with the given arguments. - * First argument is considered the left expression and the second is the right expression. - * When converted to string, it will generated a < . Example: - * - * [php] - * // u.id < ? - * $q->where($q->expr()->lt('u.id', '?')); - * - * @param mixed $x Left expression - * @param mixed $y Right expression - * @return string - */ - public function lt($x, $y) - { - return $this->comparison($x, self::LT, $y); - } - - /** - * Creates a lower-than-equal comparison expression with the given arguments. - * First argument is considered the left expression and the second is the right expression. - * When converted to string, it will generated a <= . Example: - * - * [php] - * // u.id <= ? - * $q->where($q->expr()->lte('u.id', '?')); - * - * @param mixed $x Left expression - * @param mixed $y Right expression - * @return string - */ - public function lte($x, $y) - { - return $this->comparison($x, self::LTE, $y); - } - - /** - * Creates a greater-than comparison expression with the given arguments. - * First argument is considered the left expression and the second is the right expression. - * When converted to string, it will generated a > . Example: - * - * [php] - * // u.id > ? - * $q->where($q->expr()->gt('u.id', '?')); - * - * @param mixed $x Left expression - * @param mixed $y Right expression - * @return string - */ - public function gt($x, $y) - { - return $this->comparison($x, self::GT, $y); - } - - /** - * Creates a greater-than-equal comparison expression with the given arguments. - * First argument is considered the left expression and the second is the right expression. - * When converted to string, it will generated a >= . Example: - * - * [php] - * // u.id >= ? - * $q->where($q->expr()->gte('u.id', '?')); - * - * @param mixed $x Left expression - * @param mixed $y Right expression - * @return string - */ - public function gte($x, $y) - { - return $this->comparison($x, self::GTE, $y); - } - - /** - * Creates an IS NULL expression with the given arguments. - * - * @param string $x Field in string format to be restricted by IS NULL - * - * @return string - */ - public function isNull($x) - { - return $x . ' IS NULL'; - } - - /** - * Creates an IS NOT NULL expression with the given arguments. - * - * @param string $x Field in string format to be restricted by IS NOT NULL - * - * @return string - */ - public function isNotNull($x) - { - return $x . ' IS NOT NULL'; - } - - /** - * Creates a LIKE() comparison expression with the given arguments. - * - * @param string $x Field in string format to be inspected by LIKE() comparison. - * @param mixed $y Argument to be used in LIKE() comparison. - * - * @return string - */ - public function like($x, $y) - { - return $this->comparison($x, 'LIKE', $y); - } - - /** - * Quotes a given input parameter. - * - * @param mixed $input Parameter to be quoted. - * @param string $type Type of the parameter. - * - * @return string - */ - public function literal($input, $type = null) - { - return $this->connection->quote($input, $type); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php deleted file mode 100644 index 4fb3a06..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php +++ /dev/null @@ -1,1091 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Query; - -use Doctrine\DBAL\Query\Expression\CompositeExpression, - Doctrine\DBAL\Connection; - -/** - * QueryBuilder class is responsible to dynamically create SQL queries. - * - * Important: Verify that every feature you use will work with your database vendor. - * SQL Query Builder does not attempt to validate the generated SQL at all. - * - * The query builder does no validation whatsoever if certain features even work with the - * underlying database vendor. Limit queries and joins are NOT applied to UPDATE and DELETE statements - * even if some vendors such as MySQL support it. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.1 - * @author Guilherme Blanco - * @author Benjamin Eberlei - */ -class QueryBuilder -{ - /* The query types. */ - const SELECT = 0; - const DELETE = 1; - const UPDATE = 2; - - /** The builder states. */ - const STATE_DIRTY = 0; - const STATE_CLEAN = 1; - - /** - * @var Doctrine\DBAL\Connection DBAL Connection - */ - private $connection = null; - - /** - * @var array The array of SQL parts collected. - */ - private $sqlParts = array( - 'select' => array(), - 'from' => array(), - 'join' => array(), - 'set' => array(), - 'where' => null, - 'groupBy' => array(), - 'having' => null, - 'orderBy' => array() - ); - - /** - * @var string The complete SQL string for this query. - */ - private $sql; - - /** - * @var array The query parameters. - */ - private $params = array(); - - /** - * @var array The parameter type map of this query. - */ - private $paramTypes = array(); - - /** - * @var integer The type of query this is. Can be select, update or delete. - */ - private $type = self::SELECT; - - /** - * @var integer The state of the query object. Can be dirty or clean. - */ - private $state = self::STATE_CLEAN; - - /** - * @var integer The index of the first result to retrieve. - */ - private $firstResult = null; - - /** - * @var integer The maximum number of results to retrieve. - */ - private $maxResults = null; - - /** - * The counter of bound parameters used with {@see bindValue) - * - * @var int - */ - private $boundCounter = 0; - - /** - * Initializes a new QueryBuilder. - * - * @param Doctrine\DBAL\Connection $connection DBAL Connection - */ - public function __construct(Connection $connection) - { - $this->connection = $connection; - } - - /** - * Gets an ExpressionBuilder used for object-oriented construction of query expressions. - * This producer method is intended for convenient inline usage. Example: - * - * - * $qb = $conn->createQueryBuilder() - * ->select('u') - * ->from('users', 'u') - * ->where($qb->expr()->eq('u.id', 1)); - * - * - * For more complex expression construction, consider storing the expression - * builder object in a local variable. - * - * @return Doctrine\DBAL\Query\ExpressionBuilder - */ - public function expr() - { - return $this->connection->getExpressionBuilder(); - } - - /** - * Get the type of the currently built query. - * - * @return integer - */ - public function getType() - { - return $this->type; - } - - /** - * Get the associated DBAL Connection for this query builder. - * - * @return Doctrine\DBAL\Connection - */ - public function getConnection() - { - return $this->connection; - } - - /** - * Get the state of this query builder instance. - * - * @return integer Either QueryBuilder::STATE_DIRTY or QueryBuilder::STATE_CLEAN. - */ - public function getState() - { - return $this->state; - } - - /** - * Execute this query using the bound parameters and their types. - * - * Uses {@see Connection::executeQuery} for select statements and {@see Connection::executeUpdate} - * for insert, update and delete statements. - * - * @return mixed - */ - public function execute() - { - if ($this->type == self::SELECT) { - return $this->connection->executeQuery($this->getSQL(), $this->params, $this->paramTypes); - } else { - return $this->connection->executeUpdate($this->getSQL(), $this->params, $this->paramTypes); - } - } - - /** - * Get the complete SQL string formed by the current specifications of this QueryBuilder. - * - * - * $qb = $em->createQueryBuilder() - * ->select('u') - * ->from('User', 'u') - * echo $qb->getSQL(); // SELECT u FROM User u - * - * - * @return string The sql query string. - */ - public function getSQL() - { - if ($this->sql !== null && $this->state === self::STATE_CLEAN) { - return $this->sql; - } - - $sql = ''; - - switch ($this->type) { - case self::DELETE: - $sql = $this->getSQLForDelete(); - break; - - case self::UPDATE: - $sql = $this->getSQLForUpdate(); - break; - - case self::SELECT: - default: - $sql = $this->getSQLForSelect(); - break; - } - - $this->state = self::STATE_CLEAN; - $this->sql = $sql; - - return $sql; - } - - /** - * Sets a query parameter for the query being constructed. - * - * - * $qb = $conn->createQueryBuilder() - * ->select('u') - * ->from('users', 'u') - * ->where('u.id = :user_id') - * ->setParameter(':user_id', 1); - * - * - * @param string|integer $key The parameter position or name. - * @param mixed $value The parameter value. - * @param string|null $type PDO::PARAM_* - * @return QueryBuilder This QueryBuilder instance. - */ - public function setParameter($key, $value, $type = null) - { - if ($type !== null) { - $this->paramTypes[$key] = $type; - } - - $this->params[$key] = $value; - - return $this; - } - - /** - * Sets a collection of query parameters for the query being constructed. - * - * - * $qb = $conn->createQueryBuilder() - * ->select('u') - * ->from('users', 'u') - * ->where('u.id = :user_id1 OR u.id = :user_id2') - * ->setParameters(array( - * ':user_id1' => 1, - * ':user_id2' => 2 - * )); - * - * - * @param array $params The query parameters to set. - * @return QueryBuilder This QueryBuilder instance. - */ - public function setParameters(array $params, array $types = array()) - { - $this->paramTypes = $types; - $this->params = $params; - - return $this; - } - - /** - * Gets all defined query parameters for the query being constructed. - * - * @return array The currently defined query parameters. - */ - public function getParameters() - { - return $this->params; - } - - /** - * Gets a (previously set) query parameter of the query being constructed. - * - * @param mixed $key The key (index or name) of the bound parameter. - * @return mixed The value of the bound parameter. - */ - public function getParameter($key) - { - return isset($this->params[$key]) ? $this->params[$key] : null; - } - - /** - * Sets the position of the first result to retrieve (the "offset"). - * - * @param integer $firstResult The first result to return. - * @return Doctrine\DBAL\Query\QueryBuilder This QueryBuilder instance. - */ - public function setFirstResult($firstResult) - { - $this->state = self::STATE_DIRTY; - $this->firstResult = $firstResult; - return $this; - } - - /** - * Gets the position of the first result the query object was set to retrieve (the "offset"). - * Returns NULL if {@link setFirstResult} was not applied to this QueryBuilder. - * - * @return integer The position of the first result. - */ - public function getFirstResult() - { - return $this->firstResult; - } - - /** - * Sets the maximum number of results to retrieve (the "limit"). - * - * @param integer $maxResults The maximum number of results to retrieve. - * @return Doctrine\DBAL\Query\QueryBuilder This QueryBuilder instance. - */ - public function setMaxResults($maxResults) - { - $this->state = self::STATE_DIRTY; - $this->maxResults = $maxResults; - return $this; - } - - /** - * Gets the maximum number of results the query object was set to retrieve (the "limit"). - * Returns NULL if {@link setMaxResults} was not applied to this query builder. - * - * @return integer Maximum number of results. - */ - public function getMaxResults() - { - return $this->maxResults; - } - - /** - * Either appends to or replaces a single, generic query part. - * - * The available parts are: 'select', 'from', 'set', 'where', - * 'groupBy', 'having' and 'orderBy'. - * - * @param string $sqlPartName - * @param string $sqlPart - * @param string $append - * @return Doctrine\DBAL\Query\QueryBuilder This QueryBuilder instance. - */ - public function add($sqlPartName, $sqlPart, $append = false) - { - $isArray = is_array($sqlPart); - $isMultiple = is_array($this->sqlParts[$sqlPartName]); - - if ($isMultiple && !$isArray) { - $sqlPart = array($sqlPart); - } - - $this->state = self::STATE_DIRTY; - - if ($append) { - if ($sqlPartName == "orderBy" || $sqlPartName == "groupBy" || $sqlPartName == "select" || $sqlPartName == "set") { - foreach ($sqlPart AS $part) { - $this->sqlParts[$sqlPartName][] = $part; - } - } else if ($isArray && is_array($sqlPart[key($sqlPart)])) { - $key = key($sqlPart); - $this->sqlParts[$sqlPartName][$key][] = $sqlPart[$key]; - } else if ($isMultiple) { - $this->sqlParts[$sqlPartName][] = $sqlPart; - } else { - $this->sqlParts[$sqlPartName] = $sqlPart; - } - - return $this; - } - - $this->sqlParts[$sqlPartName] = $sqlPart; - - return $this; - } - - /** - * Specifies an item that is to be returned in the query result. - * Replaces any previously specified selections, if any. - * - * - * $qb = $conn->createQueryBuilder() - * ->select('u.id', 'p.id') - * ->from('users', 'u') - * ->leftJoin('u', 'phonenumbers', 'p', 'u.id = p.user_id'); - * - * - * @param mixed $select The selection expressions. - * @return QueryBuilder This QueryBuilder instance. - */ - public function select($select = null) - { - $this->type = self::SELECT; - - if (empty($select)) { - return $this; - } - - $selects = is_array($select) ? $select : func_get_args(); - - return $this->add('select', $selects, false); - } - - /** - * Adds an item that is to be returned in the query result. - * - * - * $qb = $conn->createQueryBuilder() - * ->select('u.id') - * ->addSelect('p.id') - * ->from('users', 'u') - * ->leftJoin('u', 'phonenumbers', 'u.id = p.user_id'); - * - * - * @param mixed $select The selection expression. - * @return QueryBuilder This QueryBuilder instance. - */ - public function addSelect($select = null) - { - $this->type = self::SELECT; - - if (empty($select)) { - return $this; - } - - $selects = is_array($select) ? $select : func_get_args(); - - return $this->add('select', $selects, true); - } - - /** - * Turns the query being built into a bulk delete query that ranges over - * a certain table. - * - * - * $qb = $conn->createQueryBuilder() - * ->delete('users', 'u') - * ->where('u.id = :user_id'); - * ->setParameter(':user_id', 1); - * - * - * @param string $delete The table whose rows are subject to the deletion. - * @param string $alias The table alias used in the constructed query. - * @return QueryBuilder This QueryBuilder instance. - */ - public function delete($delete = null, $alias = null) - { - $this->type = self::DELETE; - - if ( ! $delete) { - return $this; - } - - return $this->add('from', array( - 'table' => $delete, - 'alias' => $alias - )); - } - - /** - * Turns the query being built into a bulk update query that ranges over - * a certain table - * - * - * $qb = $conn->createQueryBuilder() - * ->update('users', 'u') - * ->set('u.password', md5('password')) - * ->where('u.id = ?'); - * - * - * @param string $update The table whose rows are subject to the update. - * @param string $alias The table alias used in the constructed query. - * @return QueryBuilder This QueryBuilder instance. - */ - public function update($update = null, $alias = null) - { - $this->type = self::UPDATE; - - if ( ! $update) { - return $this; - } - - return $this->add('from', array( - 'table' => $update, - 'alias' => $alias - )); - } - - /** - * Create and add a query root corresponding to the table identified by the - * given alias, forming a cartesian product with any existing query roots. - * - * - * $qb = $conn->createQueryBuilder() - * ->select('u.id') - * ->from('users', 'u') - * - * - * @param string $from The table - * @param string $alias The alias of the table - * @return QueryBuilder This QueryBuilder instance. - */ - public function from($from, $alias) - { - return $this->add('from', array( - 'table' => $from, - 'alias' => $alias - ), true); - } - - /** - * Creates and adds a join to the query. - * - * - * $qb = $conn->createQueryBuilder() - * ->select('u.name') - * ->from('users', 'u') - * ->join('u', 'phonenumbers', 'p', 'p.is_primary = 1'); - * - * - * @param string $fromAlias The alias that points to a from clause - * @param string $join The table name to join - * @param string $alias The alias of the join table - * @param string $condition The condition for the join - * @return QueryBuilder This QueryBuilder instance. - */ - public function join($fromAlias, $join, $alias, $condition = null) - { - return $this->innerJoin($fromAlias, $join, $alias, $condition); - } - - /** - * Creates and adds a join to the query. - * - * - * $qb = $conn->createQueryBuilder() - * ->select('u.name') - * ->from('users', 'u') - * ->innerJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1'); - * - * - * @param string $fromAlias The alias that points to a from clause - * @param string $join The table name to join - * @param string $alias The alias of the join table - * @param string $condition The condition for the join - * @return QueryBuilder This QueryBuilder instance. - */ - public function innerJoin($fromAlias, $join, $alias, $condition = null) - { - return $this->add('join', array( - $fromAlias => array( - 'joinType' => 'inner', - 'joinTable' => $join, - 'joinAlias' => $alias, - 'joinCondition' => $condition - ) - ), true); - } - - /** - * Creates and adds a left join to the query. - * - * - * $qb = $conn->createQueryBuilder() - * ->select('u.name') - * ->from('users', 'u') - * ->leftJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1'); - * - * - * @param string $fromAlias The alias that points to a from clause - * @param string $join The table name to join - * @param string $alias The alias of the join table - * @param string $condition The condition for the join - * @return QueryBuilder This QueryBuilder instance. - */ - public function leftJoin($fromAlias, $join, $alias, $condition = null) - { - return $this->add('join', array( - $fromAlias => array( - 'joinType' => 'left', - 'joinTable' => $join, - 'joinAlias' => $alias, - 'joinCondition' => $condition - ) - ), true); - } - - /** - * Creates and adds a right join to the query. - * - * - * $qb = $conn->createQueryBuilder() - * ->select('u.name') - * ->from('users', 'u') - * ->rightJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1'); - * - * - * @param string $fromAlias The alias that points to a from clause - * @param string $join The table name to join - * @param string $alias The alias of the join table - * @param string $condition The condition for the join - * @return QueryBuilder This QueryBuilder instance. - */ - public function rightJoin($fromAlias, $join, $alias, $condition = null) - { - return $this->add('join', array( - $fromAlias => array( - 'joinType' => 'right', - 'joinTable' => $join, - 'joinAlias' => $alias, - 'joinCondition' => $condition - ) - ), true); - } - - /** - * Sets a new value for a column in a bulk update query. - * - * - * $qb = $conn->createQueryBuilder() - * ->update('users', 'u') - * ->set('u.password', md5('password')) - * ->where('u.id = ?'); - * - * - * @param string $key The column to set. - * @param string $value The value, expression, placeholder, etc. - * @return QueryBuilder This QueryBuilder instance. - */ - public function set($key, $value) - { - return $this->add('set', $key .' = ' . $value, true); - } - - /** - * Specifies one or more restrictions to the query result. - * Replaces any previously specified restrictions, if any. - * - * - * $qb = $conn->createQueryBuilder() - * ->select('u.name') - * ->from('users', 'u') - * ->where('u.id = ?'); - * - * // You can optionally programatically build and/or expressions - * $qb = $conn->createQueryBuilder(); - * - * $or = $qb->expr()->orx(); - * $or->add($qb->expr()->eq('u.id', 1)); - * $or->add($qb->expr()->eq('u.id', 2)); - * - * $qb->update('users', 'u') - * ->set('u.password', md5('password')) - * ->where($or); - * - * - * @param mixed $predicates The restriction predicates. - * @return QueryBuilder This QueryBuilder instance. - */ - public function where($predicates) - { - if ( ! (func_num_args() == 1 && $predicates instanceof CompositeExpression) ) { - $predicates = new CompositeExpression(CompositeExpression::TYPE_AND, func_get_args()); - } - - return $this->add('where', $predicates); - } - - /** - * Adds one or more restrictions to the query results, forming a logical - * conjunction with any previously specified restrictions. - * - * - * $qb = $conn->createQueryBuilder() - * ->select('u') - * ->from('users', 'u') - * ->where('u.username LIKE ?') - * ->andWhere('u.is_active = 1'); - * - * - * @param mixed $where The query restrictions. - * @return QueryBuilder This QueryBuilder instance. - * @see where() - */ - public function andWhere($where) - { - $where = $this->getQueryPart('where'); - $args = func_get_args(); - - if ($where instanceof CompositeExpression && $where->getType() === CompositeExpression::TYPE_AND) { - $where->addMultiple($args); - } else { - array_unshift($args, $where); - $where = new CompositeExpression(CompositeExpression::TYPE_AND, $args); - } - - return $this->add('where', $where, true); - } - - /** - * Adds one or more restrictions to the query results, forming a logical - * disjunction with any previously specified restrictions. - * - * - * $qb = $em->createQueryBuilder() - * ->select('u.name') - * ->from('users', 'u') - * ->where('u.id = 1') - * ->orWhere('u.id = 2'); - * - * - * @param mixed $where The WHERE statement - * @return QueryBuilder $qb - * @see where() - */ - public function orWhere($where) - { - $where = $this->getQueryPart('where'); - $args = func_get_args(); - - if ($where instanceof CompositeExpression && $where->getType() === CompositeExpression::TYPE_OR) { - $where->addMultiple($args); - } else { - array_unshift($args, $where); - $where = new CompositeExpression(CompositeExpression::TYPE_OR, $args); - } - - return $this->add('where', $where, true); - } - - /** - * Specifies a grouping over the results of the query. - * Replaces any previously specified groupings, if any. - * - * - * $qb = $conn->createQueryBuilder() - * ->select('u.name') - * ->from('users', 'u') - * ->groupBy('u.id'); - * - * - * @param mixed $groupBy The grouping expression. - * @return QueryBuilder This QueryBuilder instance. - */ - public function groupBy($groupBy) - { - if (empty($groupBy)) { - return $this; - } - - $groupBy = is_array($groupBy) ? $groupBy : func_get_args(); - - return $this->add('groupBy', $groupBy, false); - } - - - /** - * Adds a grouping expression to the query. - * - * - * $qb = $conn->createQueryBuilder() - * ->select('u.name') - * ->from('users', 'u') - * ->groupBy('u.lastLogin'); - * ->addGroupBy('u.createdAt') - * - * - * @param mixed $groupBy The grouping expression. - * @return QueryBuilder This QueryBuilder instance. - */ - public function addGroupBy($groupBy) - { - if (empty($groupBy)) { - return $this; - } - - $groupBy = is_array($groupBy) ? $groupBy : func_get_args(); - - return $this->add('groupBy', $groupBy, true); - } - - /** - * Specifies a restriction over the groups of the query. - * Replaces any previous having restrictions, if any. - * - * @param mixed $having The restriction over the groups. - * @return QueryBuilder This QueryBuilder instance. - */ - public function having($having) - { - if ( ! (func_num_args() == 1 && $having instanceof CompositeExpression)) { - $having = new CompositeExpression(CompositeExpression::TYPE_AND, func_get_args()); - } - - return $this->add('having', $having); - } - - /** - * Adds a restriction over the groups of the query, forming a logical - * conjunction with any existing having restrictions. - * - * @param mixed $having The restriction to append. - * @return QueryBuilder This QueryBuilder instance. - */ - public function andHaving($having) - { - $having = $this->getQueryPart('having'); - $args = func_get_args(); - - if ($having instanceof CompositeExpression && $having->getType() === CompositeExpression::TYPE_AND) { - $having->addMultiple($args); - } else { - array_unshift($args, $having); - $having = new CompositeExpression(CompositeExpression::TYPE_AND, $args); - } - - return $this->add('having', $having); - } - - /** - * Adds a restriction over the groups of the query, forming a logical - * disjunction with any existing having restrictions. - * - * @param mixed $having The restriction to add. - * @return QueryBuilder This QueryBuilder instance. - */ - public function orHaving($having) - { - $having = $this->getQueryPart('having'); - $args = func_get_args(); - - if ($having instanceof CompositeExpression && $having->getType() === CompositeExpression::TYPE_OR) { - $having->addMultiple($args); - } else { - array_unshift($args, $having); - $having = new CompositeExpression(CompositeExpression::TYPE_OR, $args); - } - - return $this->add('having', $having); - } - - /** - * Specifies an ordering for the query results. - * Replaces any previously specified orderings, if any. - * - * @param string $sort The ordering expression. - * @param string $order The ordering direction. - * @return QueryBuilder This QueryBuilder instance. - */ - public function orderBy($sort, $order = null) - { - return $this->add('orderBy', $sort . ' ' . (! $order ? 'ASC' : $order), false); - } - - /** - * Adds an ordering to the query results. - * - * @param string $sort The ordering expression. - * @param string $order The ordering direction. - * @return QueryBuilder This QueryBuilder instance. - */ - public function addOrderBy($sort, $order = null) - { - return $this->add('orderBy', $sort . ' ' . (! $order ? 'ASC' : $order), true); - } - - /** - * Get a query part by its name. - * - * @param string $queryPartName - * @return mixed $queryPart - */ - public function getQueryPart($queryPartName) - { - return $this->sqlParts[$queryPartName]; - } - - /** - * Get all query parts. - * - * @return array $sqlParts - */ - public function getQueryParts() - { - return $this->sqlParts; - } - - /** - * Reset SQL parts - * - * @param array $queryPartNames - * @return QueryBuilder - */ - public function resetQueryParts($queryPartNames = null) - { - if (is_null($queryPartNames)) { - $queryPartNames = array_keys($this->sqlParts); - } - - foreach ($queryPartNames as $queryPartName) { - $this->resetQueryPart($queryPartName); - } - - return $this; - } - - /** - * Reset single SQL part - * - * @param string $queryPartName - * @return QueryBuilder - */ - public function resetQueryPart($queryPartName) - { - $this->sqlParts[$queryPartName] = is_array($this->sqlParts[$queryPartName]) - ? array() : null; - - $this->state = self::STATE_DIRTY; - - return $this; - } - - /** - * Converts this instance into a SELECT string in SQL. - * - * @return string - */ - private function getSQLForSelect() - { - $query = 'SELECT ' . implode(', ', $this->sqlParts['select']) . ' FROM '; - - $fromClauses = array(); - - // Loop through all FROM clauses - foreach ($this->sqlParts['from'] as $from) { - $fromClause = $from['table'] . ' ' . $from['alias']; - - if (isset($this->sqlParts['join'][$from['alias']])) { - foreach ($this->sqlParts['join'][$from['alias']] as $join) { - $fromClause .= ' ' . strtoupper($join['joinType']) - . ' JOIN ' . $join['joinTable'] . ' ' . $join['joinAlias'] - . ' ON ' . ((string) $join['joinCondition']); - } - } - - $fromClauses[$from['alias']] = $fromClause; - } - - // loop through all JOIN clasues for validation purpose - foreach ($this->sqlParts['join'] as $fromAlias => $joins) { - if ( ! isset($fromClauses[$fromAlias]) ) { - throw QueryException::unknownFromAlias($fromAlias, array_keys($fromClauses)); - } - } - - $query .= implode(', ', $fromClauses) - . ($this->sqlParts['where'] !== null ? ' WHERE ' . ((string) $this->sqlParts['where']) : '') - . ($this->sqlParts['groupBy'] ? ' GROUP BY ' . implode(', ', $this->sqlParts['groupBy']) : '') - . ($this->sqlParts['having'] !== null ? ' HAVING ' . ((string) $this->sqlParts['having']) : '') - . ($this->sqlParts['orderBy'] ? ' ORDER BY ' . implode(', ', $this->sqlParts['orderBy']) : ''); - - return ($this->maxResults === null && $this->firstResult == null) - ? $query - : $this->connection->getDatabasePlatform()->modifyLimitQuery($query, $this->maxResults, $this->firstResult); - } - - /** - * Converts this instance into an UPDATE string in SQL. - * - * @return string - */ - private function getSQLForUpdate() - { - $table = $this->sqlParts['from']['table'] . ($this->sqlParts['from']['alias'] ? ' ' . $this->sqlParts['from']['alias'] : ''); - $query = 'UPDATE ' . $table - . ' SET ' . implode(", ", $this->sqlParts['set']) - . ($this->sqlParts['where'] !== null ? ' WHERE ' . ((string) $this->sqlParts['where']) : ''); - - return $query; - } - - /** - * Converts this instance into a DELETE string in SQL. - * - * @return string - */ - private function getSQLForDelete() - { - $table = $this->sqlParts['from']['table'] . ($this->sqlParts['from']['alias'] ? ' ' . $this->sqlParts['from']['alias'] : ''); - $query = 'DELETE FROM ' . $table . ($this->sqlParts['where'] !== null ? ' WHERE ' . ((string) $this->sqlParts['where']) : ''); - - return $query; - } - - /** - * Gets a string representation of this QueryBuilder which corresponds to - * the final SQL query being constructed. - * - * @return string The string representation of this QueryBuilder. - */ - public function __toString() - { - return $this->getSQL(); - } - - /** - * Create a new named parameter and bind the value $value to it. - * - * This method provides a shortcut for PDOStatement::bindValue - * when using prepared statements. - * - * The parameter $value specifies the value that you want to bind. If - * $placeholder is not provided bindValue() will automatically create a - * placeholder for you. An automatic placeholder will be of the name - * ':dcValue1', ':dcValue2' etc. - * - * For more information see {@link http://php.net/pdostatement-bindparam} - * - * Example: - * - * $value = 2; - * $q->eq( 'id', $q->bindValue( $value ) ); - * $stmt = $q->executeQuery(); // executed with 'id = 2' - * - * - * @license New BSD License - * @link http://www.zetacomponents.org - * @param mixed $value - * @param mixed $type - * @param string $placeHolder the name to bind with. The string must start with a colon ':'. - * @return string the placeholder name used. - */ - public function createNamedParameter( $value, $type = \PDO::PARAM_STR, $placeHolder = null ) - { - if ( $placeHolder === null ) { - $this->boundCounter++; - $placeHolder = ":dcValue" . $this->boundCounter; - } - $this->setParameter(substr($placeHolder, 1), $value, $type); - - return $placeHolder; - } - - /** - * Create a new positional parameter and bind the given value to it. - * - * Attention: If you are using positional parameters with the query builder you have - * to be very careful to bind all parameters in the order they appear in the SQL - * statement , otherwise they get bound in the wrong order which can lead to serious - * bugs in your code. - * - * Example: - * - * $qb = $conn->createQueryBuilder(); - * $qb->select('u.*') - * ->from('users', 'u') - * ->where('u.username = ' . $qb->createPositionalParameter('Foo', PDO::PARAM_STR)) - * ->orWhere('u.username = ' . $qb->createPositionalParameter('Bar', PDO::PARAM_STR)) - * - * - * @param mixed $value - * @param mixed $type - * @return string - */ - public function createPositionalParameter($value, $type = \PDO::PARAM_STR) - { - $this->boundCounter++; - $this->setParameter($this->boundCounter, $value, $type); - return "?"; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryException.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryException.php deleted file mode 100644 index fe2cc2f..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryException.php +++ /dev/null @@ -1,40 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Query; - -use Doctrine\DBAL\DBALException; - -/** - * Driver interface. - * Interface that all DBAL drivers must implement. - * - * @since 2.1.4 - */ -class QueryException extends DBALException -{ - static public function unknownFromAlias($alias, $registeredAliases) - { - return new self("The given alias '" . $alias . "' is not part of " . - "any FROM clause table. The currently registered FROM-clause " . - "aliases are: " . implode(", ", $registeredAliases) . ". Join clauses " . - "are bound to from clauses to provide support for mixing of multiple " . - "from and join clauses."); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/README.markdown b/vendor/doctrine/dbal/lib/Doctrine/DBAL/README.markdown deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/SQLParserUtils.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/SQLParserUtils.php deleted file mode 100644 index fa14a73..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/SQLParserUtils.php +++ /dev/null @@ -1,173 +0,0 @@ -. - */ - - -namespace Doctrine\DBAL; - -use Doctrine\DBAL\Connection; - -/** - * Utility class that parses sql statements with regard to types and parameters. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.0 - * @author Benjamin Eberlei - */ -class SQLParserUtils -{ - /** - * Get an array of the placeholders in an sql statements as keys and their positions in the query string. - * - * Returns an integer => integer pair (indexed from zero) for a positional statement - * and a string => int[] pair for a named statement. - * - * @param string $statement - * @param bool $isPositional - * @return array - */ - static public function getPlaceholderPositions($statement, $isPositional = true) - { - $match = ($isPositional) ? '?' : ':'; - if (strpos($statement, $match) === false) { - return array(); - } - - $count = 0; - $inLiteral = false; // a valid query never starts with quotes - $stmtLen = strlen($statement); - $paramMap = array(); - for ($i = 0; $i < $stmtLen; $i++) { - if ($statement[$i] == $match && !$inLiteral) { - // real positional parameter detected - if ($isPositional) { - $paramMap[$count] = $i; - } else { - $name = ""; - // TODO: Something faster/better to match this than regex? - for ($j = $i + 1; ($j < $stmtLen && preg_match('(([a-zA-Z0-9_]{1}))', $statement[$j])); $j++) { - $name .= $statement[$j]; - } - $paramMap[$i] = $name; // named parameters can be duplicated! - $i = $j; - } - ++$count; - } else if ($statement[$i] == "'" || $statement[$i] == '"') { - $inLiteral = ! $inLiteral; // switch state! - } - } - - return $paramMap; - } - - /** - * For a positional query this method can rewrite the sql statement with regard to array parameters. - * - * @param string $query - * @param array $params - * @param array $types - */ - static public function expandListParameters($query, $params, $types) - { - $isPositional = is_int(key($params)); - $arrayPositions = array(); - $bindIndex = -1; - foreach ($types AS $name => $type) { - ++$bindIndex; - if ($type === Connection::PARAM_INT_ARRAY || $type === Connection::PARAM_STR_ARRAY) { - if ($isPositional) { - $name = $bindIndex; - } - - $arrayPositions[$name] = false; - } - } - - if ((!$arrayPositions && $isPositional) || (count($params) != count($types))) { - return array($query, $params, $types); - } - - $paramPos = self::getPlaceholderPositions($query, $isPositional); - if ($isPositional) { - $paramOffset = 0; - $queryOffset = 0; - foreach ($paramPos AS $needle => $needlePos) { - if (!isset($arrayPositions[$needle])) { - continue; - } - - $needle += $paramOffset; - $needlePos += $queryOffset; - $len = count($params[$needle]); - - $params = array_merge( - array_slice($params, 0, $needle), - $params[$needle], - array_slice($params, $needle + 1) - ); - - $types = array_merge( - array_slice($types, 0, $needle), - array_fill(0, $len, $types[$needle] - Connection::ARRAY_PARAM_OFFSET), // array needles are at PDO::PARAM_* + 100 - array_slice($types, $needle + 1) - ); - - $expandStr = implode(", ", array_fill(0, $len, "?")); - $query = substr($query, 0, $needlePos) . $expandStr . substr($query, $needlePos + 1); - - $paramOffset += ($len - 1); // Grows larger by number of parameters minus the replaced needle. - $queryOffset += (strlen($expandStr) - 1); - } - - } else { - $queryOffset= 0; - $typesOrd = array(); - $paramsOrd = array(); - foreach ($paramPos as $pos => $paramName) { - $paramLen = strlen($paramName) + 1; - $value = $params[$paramName]; - - if (!isset($arrayPositions[$paramName])) { - $pos += $queryOffset; - $queryOffset -= ($paramLen - 1); - $paramsOrd[] = $value; - $typesOrd[] = $types[$paramName]; - $query = substr($query, 0, $pos) . '?' . substr($query, ($pos + $paramLen)); - } else { - $len = count($value); - $expandStr = implode(", ", array_fill(0, $len, "?")); - - foreach ($value as $val) { - $paramsOrd[] = $val; - $typesOrd[] = $types[$paramName] - Connection::ARRAY_PARAM_OFFSET; - } - - $pos += $queryOffset; - $queryOffset += (strlen($expandStr) - $paramLen); - $query = substr($query, 0, $pos) . $expandStr . substr($query, ($pos + $paramLen)); - } - } - - $types = $typesOrd; - $params = $paramsOrd; - } - - return array($query, $params, $types); - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractAsset.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractAsset.php deleted file mode 100644 index a14218a..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractAsset.php +++ /dev/null @@ -1,204 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -/** - * The abstract asset allows to reset the name of all assets without publishing this to the public userland. - * - * This encapsulation hack is necessary to keep a consistent state of the database schema. Say we have a list of tables - * array($tableName => Table($tableName)); if you want to rename the table, you have to make sure - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - */ -abstract class AbstractAsset -{ - /** - * @var string - */ - protected $_name; - - /** - * Namespace of the asset. If none isset the default namespace is assumed. - * - * @var string - */ - protected $_namespace; - - /** - * @var bool - */ - protected $_quoted = false; - - /** - * Set name of this asset - * - * @param string $name - */ - protected function _setName($name) - { - if ($this->isQuoted($name)) { - $this->_quoted = true; - $name = $this->trimQuotes($name); - } - if (strpos($name, ".") !== false) { - $parts = explode(".", $name); - $this->_namespace = $parts[0]; - $name = $parts[1]; - } - $this->_name = $name; - } - - /** - * Is this asset in the default namespace? - * - * @param string $defaultNamespaceName - * @return bool - */ - public function isInDefaultNamespace($defaultNamespaceName) - { - return $this->_namespace == $defaultNamespaceName || $this->_namespace === null; - } - - /** - * Get namespace name of this asset. - * - * If NULL is returned this means the default namespace is used. - * - * @return string - */ - public function getNamespaceName() - { - return $this->_namespace; - } - - /** - * The shortest name is stripped of the default namespace. All other - * namespaced elements are returned as full-qualified names. - * - * @param string - * @return string - */ - public function getShortestName($defaultNamespaceName) - { - $shortestName = $this->getName(); - if ($this->_namespace == $defaultNamespaceName) { - $shortestName = $this->_name; - } - return strtolower($shortestName); - } - - /** - * The normalized name is full-qualified and lowerspaced. Lowerspacing is - * actually wrong, but we have to do it to keep our sanity. If you are - * using database objects that only differentiate in the casing (FOO vs - * Foo) then you will NOT be able to use Doctrine Schema abstraction. - * - * Every non-namespaced element is prefixed with the default namespace - * name which is passed as argument to this method. - * - * @return string - */ - public function getFullQualifiedName($defaultNamespaceName) - { - $name = $this->getName(); - if (!$this->_namespace) { - $name = $defaultNamespaceName . "." . $name; - } - return strtolower($name); - } - - /** - * Check if this identifier is quoted. - * - * @param string $identifier - * @return bool - */ - protected function isQuoted($identifier) - { - return (isset($identifier[0]) && ($identifier[0] == '`' || $identifier[0] == '"')); - } - - /** - * Trim quotes from the identifier. - * - * @param string $identifier - * @return string - */ - protected function trimQuotes($identifier) - { - return str_replace(array('`', '"'), '', $identifier); - } - - /** - * Return name of this schema asset. - * - * @return string - */ - public function getName() - { - if ($this->_namespace) { - return $this->_namespace . "." . $this->_name; - } - return $this->_name; - } - - /** - * Get the quoted representation of this asset but only if it was defined with one. Otherwise - * return the plain unquoted value as inserted. - * - * @param AbstractPlatform $platform - * @return string - */ - public function getQuotedName(AbstractPlatform $platform) - { - $keywords = $platform->getReservedKeywordsList(); - $parts = explode(".", $this->getName()); - foreach ($parts AS $k => $v) { - $parts[$k] = ($this->_quoted || $keywords->isKeyword($v)) ? $platform->quoteIdentifier($v) : $v; - } - - return implode(".", $parts); - } - - /** - * Generate an identifier from a list of column names obeying a certain string length. - * - * This is especially important for Oracle, since it does not allow identifiers larger than 30 chars, - * however building idents automatically for foreign keys, composite keys or such can easily create - * very long names. - * - * @param array $columnNames - * @param string $prefix - * @param int $maxSize - * @return string - */ - protected function _generateIdentifierName($columnNames, $prefix='', $maxSize=30) - { - $hash = implode("", array_map(function($column) { - return dechex(crc32($column)); - }, $columnNames)); - return substr(strtoupper($prefix . "_" . $hash), 0, $maxSize); - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php deleted file mode 100644 index 57fd67a..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php +++ /dev/null @@ -1,890 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema; - -use Doctrine\DBAL\Events; -use Doctrine\DBAL\Event\SchemaColumnDefinitionEventArgs; -use Doctrine\DBAL\Event\SchemaIndexDefinitionEventArgs; -use Doctrine\DBAL\Types; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Platforms\AbstractPlatform; - -/** - * Base class for schema managers. Schema managers are used to inspect and/or - * modify the database schema/structure. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @author Konsta Vesterinen - * @author Lukas Smith (PEAR MDB2 library) - * @author Roman Borschel - * @author Jonathan H. Wage - * @author Benjamin Eberlei - * @since 2.0 - */ -abstract class AbstractSchemaManager -{ - /** - * Holds instance of the Doctrine connection for this schema manager - * - * @var \Doctrine\DBAL\Connection - */ - protected $_conn; - - /** - * Holds instance of the database platform used for this schema manager - * - * @var \Doctrine\DBAL\Platforms\AbstractPlatform - */ - protected $_platform; - - /** - * Constructor. Accepts the Connection instance to manage the schema for - * - * @param \Doctrine\DBAL\Connection $conn - */ - public function __construct(\Doctrine\DBAL\Connection $conn) - { - $this->_conn = $conn; - $this->_platform = $this->_conn->getDatabasePlatform(); - } - - /** - * Return associated platform. - * - * @return \Doctrine\DBAL\Platform\AbstractPlatform - */ - public function getDatabasePlatform() - { - return $this->_platform; - } - - /** - * Try any method on the schema manager. Normally a method throws an - * exception when your DBMS doesn't support it or if an error occurs. - * This method allows you to try and method on your SchemaManager - * instance and will return false if it does not work or is not supported. - * - * - * $result = $sm->tryMethod('dropView', 'view_name'); - * - * - * @return mixed - */ - public function tryMethod() - { - $args = func_get_args(); - $method = $args[0]; - unset($args[0]); - $args = array_values($args); - - try { - return call_user_func_array(array($this, $method), $args); - } catch (\Exception $e) { - return false; - } - } - - /** - * List the available databases for this connection - * - * @return array $databases - */ - public function listDatabases() - { - $sql = $this->_platform->getListDatabasesSQL(); - - $databases = $this->_conn->fetchAll($sql); - - return $this->_getPortableDatabasesList($databases); - } - - /** - * List the available sequences for this connection - * - * @return Sequence[] - */ - public function listSequences($database = null) - { - if (is_null($database)) { - $database = $this->_conn->getDatabase(); - } - $sql = $this->_platform->getListSequencesSQL($database); - - $sequences = $this->_conn->fetchAll($sql); - - return $this->filterAssetNames($this->_getPortableSequencesList($sequences)); - } - - /** - * List the columns for a given table. - * - * In contrast to other libraries and to the old version of Doctrine, - * this column definition does try to contain the 'primary' field for - * the reason that it is not portable accross different RDBMS. Use - * {@see listTableIndexes($tableName)} to retrieve the primary key - * of a table. We're a RDBMS specifies more details these are held - * in the platformDetails array. - * - * @param string $table The name of the table. - * @param string $database - * @return Column[] - */ - public function listTableColumns($table, $database = null) - { - if (!$database) { - $database = $this->_conn->getDatabase(); - } - - $sql = $this->_platform->getListTableColumnsSQL($table, $database); - - $tableColumns = $this->_conn->fetchAll($sql); - - return $this->_getPortableTableColumnList($table, $database, $tableColumns); - } - - /** - * List the indexes for a given table returning an array of Index instances. - * - * Keys of the portable indexes list are all lower-cased. - * - * @param string $table The name of the table - * @return Index[] $tableIndexes - */ - public function listTableIndexes($table) - { - $sql = $this->_platform->getListTableIndexesSQL($table, $this->_conn->getDatabase()); - - $tableIndexes = $this->_conn->fetchAll($sql); - - return $this->_getPortableTableIndexesList($tableIndexes, $table); - } - - /** - * Return true if all the given tables exist. - * - * @param array $tableNames - * @return bool - */ - public function tablesExist($tableNames) - { - $tableNames = array_map('strtolower', (array)$tableNames); - return count($tableNames) == count(\array_intersect($tableNames, array_map('strtolower', $this->listTableNames()))); - } - - /** - * Return a list of all tables in the current database - * - * @return array - */ - public function listTableNames() - { - $sql = $this->_platform->getListTablesSQL(); - - $tables = $this->_conn->fetchAll($sql); - $tableNames = $this->_getPortableTablesList($tables); - return $this->filterAssetNames($tableNames); - } - - /** - * Filter asset names if they are configured to return only a subset of all - * the found elements. - * - * @param array $assetNames - * @return array - */ - protected function filterAssetNames($assetNames) - { - $filterExpr = $this->getFilterSchemaAssetsExpression(); - if (!$filterExpr) { - return $assetNames; - } - return array_values ( - array_filter($assetNames, function ($assetName) use ($filterExpr) { - $assetName = ($assetName instanceof AbstractAsset) ? $assetName->getName() : $assetName; - return preg_match('(' . $filterExpr . ')', $assetName); - }) - ); - } - - protected function getFilterSchemaAssetsExpression() - { - return $this->_conn->getConfiguration()->getFilterSchemaAssetsExpression(); - } - - /** - * List the tables for this connection - * - * @return Table[] - */ - public function listTables() - { - $tableNames = $this->listTableNames(); - - $tables = array(); - foreach ($tableNames AS $tableName) { - $tables[] = $this->listTableDetails($tableName); - } - - return $tables; - } - - /** - * @param string $tableName - * @return Table - */ - public function listTableDetails($tableName) - { - $columns = $this->listTableColumns($tableName); - $foreignKeys = array(); - if ($this->_platform->supportsForeignKeyConstraints()) { - $foreignKeys = $this->listTableForeignKeys($tableName); - } - $indexes = $this->listTableIndexes($tableName); - - return new Table($tableName, $columns, $indexes, $foreignKeys, false, array()); - } - - /** - * List the views this connection has - * - * @return View[] - */ - public function listViews() - { - $database = $this->_conn->getDatabase(); - $sql = $this->_platform->getListViewsSQL($database); - $views = $this->_conn->fetchAll($sql); - - return $this->_getPortableViewsList($views); - } - - /** - * List the foreign keys for the given table - * - * @param string $table The name of the table - * @return ForeignKeyConstraint[] - */ - public function listTableForeignKeys($table, $database = null) - { - if (is_null($database)) { - $database = $this->_conn->getDatabase(); - } - $sql = $this->_platform->getListTableForeignKeysSQL($table, $database); - $tableForeignKeys = $this->_conn->fetchAll($sql); - - return $this->_getPortableTableForeignKeysList($tableForeignKeys); - } - - /* drop*() Methods */ - - /** - * Drops a database. - * - * NOTE: You can not drop the database this SchemaManager is currently connected to. - * - * @param string $database The name of the database to drop - */ - public function dropDatabase($database) - { - $this->_execSql($this->_platform->getDropDatabaseSQL($database)); - } - - /** - * Drop the given table - * - * @param string $table The name of the table to drop - */ - public function dropTable($table) - { - $this->_execSql($this->_platform->getDropTableSQL($table)); - } - - /** - * Drop the index from the given table - * - * @param Index|string $index The name of the index - * @param string|Table $table The name of the table - */ - public function dropIndex($index, $table) - { - if($index instanceof Index) { - $index = $index->getQuotedName($this->_platform); - } - - $this->_execSql($this->_platform->getDropIndexSQL($index, $table)); - } - - /** - * Drop the constraint from the given table - * - * @param Constraint $constraint - * @param string $table The name of the table - */ - public function dropConstraint(Constraint $constraint, $table) - { - $this->_execSql($this->_platform->getDropConstraintSQL($constraint, $table)); - } - - /** - * Drops a foreign key from a table. - * - * @param ForeignKeyConstraint|string $table The name of the table with the foreign key. - * @param Table|string $name The name of the foreign key. - * @return boolean $result - */ - public function dropForeignKey($foreignKey, $table) - { - $this->_execSql($this->_platform->getDropForeignKeySQL($foreignKey, $table)); - } - - /** - * Drops a sequence with a given name. - * - * @param string $name The name of the sequence to drop. - */ - public function dropSequence($name) - { - $this->_execSql($this->_platform->getDropSequenceSQL($name)); - } - - /** - * Drop a view - * - * @param string $name The name of the view - * @return boolean $result - */ - public function dropView($name) - { - $this->_execSql($this->_platform->getDropViewSQL($name)); - } - - /* create*() Methods */ - - /** - * Creates a new database. - * - * @param string $database The name of the database to create. - */ - public function createDatabase($database) - { - $this->_execSql($this->_platform->getCreateDatabaseSQL($database)); - } - - /** - * Create a new table. - * - * @param Table $table - * @param int $createFlags - */ - public function createTable(Table $table) - { - $createFlags = AbstractPlatform::CREATE_INDEXES|AbstractPlatform::CREATE_FOREIGNKEYS; - $this->_execSql($this->_platform->getCreateTableSQL($table, $createFlags)); - } - - /** - * Create a new sequence - * - * @param Sequence $sequence - * @throws Doctrine\DBAL\ConnectionException if something fails at database level - */ - public function createSequence($sequence) - { - $this->_execSql($this->_platform->getCreateSequenceSQL($sequence)); - } - - /** - * Create a constraint on a table - * - * @param Constraint $constraint - * @param string|Table $table - */ - public function createConstraint(Constraint $constraint, $table) - { - $this->_execSql($this->_platform->getCreateConstraintSQL($constraint, $table)); - } - - /** - * Create a new index on a table - * - * @param Index $index - * @param string $table name of the table on which the index is to be created - */ - public function createIndex(Index $index, $table) - { - $this->_execSql($this->_platform->getCreateIndexSQL($index, $table)); - } - - /** - * Create a new foreign key - * - * @param ForeignKeyConstraint $foreignKey ForeignKey instance - * @param string|Table $table name of the table on which the foreign key is to be created - */ - public function createForeignKey(ForeignKeyConstraint $foreignKey, $table) - { - $this->_execSql($this->_platform->getCreateForeignKeySQL($foreignKey, $table)); - } - - /** - * Create a new view - * - * @param View $view - */ - public function createView(View $view) - { - $this->_execSql($this->_platform->getCreateViewSQL($view->getQuotedName($this->_platform), $view->getSql())); - } - - /* dropAndCreate*() Methods */ - - /** - * Drop and create a constraint - * - * @param Constraint $constraint - * @param string $table - * @see dropConstraint() - * @see createConstraint() - */ - public function dropAndCreateConstraint(Constraint $constraint, $table) - { - $this->tryMethod('dropConstraint', $constraint, $table); - $this->createConstraint($constraint, $table); - } - - /** - * Drop and create a new index on a table - * - * @param string|Table $table name of the table on which the index is to be created - * @param Index $index - */ - public function dropAndCreateIndex(Index $index, $table) - { - $this->tryMethod('dropIndex', $index->getQuotedName($this->_platform), $table); - $this->createIndex($index, $table); - } - - /** - * Drop and create a new foreign key - * - * @param ForeignKeyConstraint $foreignKey associative array that defines properties of the foreign key to be created. - * @param string|Table $table name of the table on which the foreign key is to be created - */ - public function dropAndCreateForeignKey(ForeignKeyConstraint $foreignKey, $table) - { - $this->tryMethod('dropForeignKey', $foreignKey, $table); - $this->createForeignKey($foreignKey, $table); - } - - /** - * Drop and create a new sequence - * - * @param Sequence $sequence - * @throws Doctrine\DBAL\ConnectionException if something fails at database level - */ - public function dropAndCreateSequence(Sequence $sequence) - { - $this->tryMethod('dropSequence', $sequence->getQuotedName($this->_platform)); - $this->createSequence($sequence); - } - - /** - * Drop and create a new table. - * - * @param Table $table - */ - public function dropAndCreateTable(Table $table) - { - $this->tryMethod('dropTable', $table->getQuotedName($this->_platform)); - $this->createTable($table); - } - - /** - * Drop and creates a new database. - * - * @param string $database The name of the database to create. - */ - public function dropAndCreateDatabase($database) - { - $this->tryMethod('dropDatabase', $database); - $this->createDatabase($database); - } - - /** - * Drop and create a new view - * - * @param View $view - */ - public function dropAndCreateView(View $view) - { - $this->tryMethod('dropView', $view->getQuotedName($this->_platform)); - $this->createView($view); - } - - /* alterTable() Methods */ - - /** - * Alter an existing tables schema - * - * @param TableDiff $tableDiff - */ - public function alterTable(TableDiff $tableDiff) - { - $queries = $this->_platform->getAlterTableSQL($tableDiff); - if (is_array($queries) && count($queries)) { - foreach ($queries AS $ddlQuery) { - $this->_execSql($ddlQuery); - } - } - } - - /** - * Rename a given table to another name - * - * @param string $name The current name of the table - * @param string $newName The new name of the table - */ - public function renameTable($name, $newName) - { - $tableDiff = new TableDiff($name); - $tableDiff->newName = $newName; - $this->alterTable($tableDiff); - } - - /** - * Methods for filtering return values of list*() methods to convert - * the native DBMS data definition to a portable Doctrine definition - */ - - protected function _getPortableDatabasesList($databases) - { - $list = array(); - foreach ($databases as $key => $value) { - if ($value = $this->_getPortableDatabaseDefinition($value)) { - $list[] = $value; - } - } - return $list; - } - - protected function _getPortableDatabaseDefinition($database) - { - return $database; - } - - protected function _getPortableFunctionsList($functions) - { - $list = array(); - foreach ($functions as $key => $value) { - if ($value = $this->_getPortableFunctionDefinition($value)) { - $list[] = $value; - } - } - return $list; - } - - protected function _getPortableFunctionDefinition($function) - { - return $function; - } - - protected function _getPortableTriggersList($triggers) - { - $list = array(); - foreach ($triggers as $key => $value) { - if ($value = $this->_getPortableTriggerDefinition($value)) { - $list[] = $value; - } - } - return $list; - } - - protected function _getPortableTriggerDefinition($trigger) - { - return $trigger; - } - - protected function _getPortableSequencesList($sequences) - { - $list = array(); - foreach ($sequences as $key => $value) { - if ($value = $this->_getPortableSequenceDefinition($value)) { - $list[] = $value; - } - } - return $list; - } - - /** - * @param array $sequence - * @return Sequence - */ - protected function _getPortableSequenceDefinition($sequence) - { - throw DBALException::notSupported('Sequences'); - } - - /** - * Independent of the database the keys of the column list result are lowercased. - * - * The name of the created column instance however is kept in its case. - * - * @param string $table The name of the table. - * @param string $database - * @param array $tableColumns - * @return array - */ - protected function _getPortableTableColumnList($table, $database, $tableColumns) - { - $eventManager = $this->_platform->getEventManager(); - - $list = array(); - foreach ($tableColumns as $key => $tableColumn) { - $column = null; - $defaultPrevented = false; - - if (null !== $eventManager && $eventManager->hasListeners(Events::onSchemaColumnDefinition)) { - $eventArgs = new SchemaColumnDefinitionEventArgs($tableColumn, $table, $database, $this->_conn); - $eventManager->dispatchEvent(Events::onSchemaColumnDefinition, $eventArgs); - - $defaultPrevented = $eventArgs->isDefaultPrevented(); - $column = $eventArgs->getColumn(); - } - - if (!$defaultPrevented) { - $column = $this->_getPortableTableColumnDefinition($tableColumn); - } - - if ($column) { - $name = strtolower($column->getQuotedName($this->_platform)); - $list[$name] = $column; - } - } - return $list; - } - - /** - * Get Table Column Definition - * - * @param array $tableColumn - * @return Column - */ - abstract protected function _getPortableTableColumnDefinition($tableColumn); - - /** - * Aggregate and group the index results according to the required data result. - * - * @param array $tableIndexRows - * @param string $tableName - * @return array - */ - protected function _getPortableTableIndexesList($tableIndexRows, $tableName=null) - { - $result = array(); - foreach($tableIndexRows AS $tableIndex) { - $indexName = $keyName = $tableIndex['key_name']; - if($tableIndex['primary']) { - $keyName = 'primary'; - } - $keyName = strtolower($keyName); - - if(!isset($result[$keyName])) { - $result[$keyName] = array( - 'name' => $indexName, - 'columns' => array($tableIndex['column_name']), - 'unique' => $tableIndex['non_unique'] ? false : true, - 'primary' => $tableIndex['primary'], - ); - } else { - $result[$keyName]['columns'][] = $tableIndex['column_name']; - } - } - - $eventManager = $this->_platform->getEventManager(); - - $indexes = array(); - foreach($result AS $indexKey => $data) { - $index = null; - $defaultPrevented = false; - - if (null !== $eventManager && $eventManager->hasListeners(Events::onSchemaIndexDefinition)) { - $eventArgs = new SchemaIndexDefinitionEventArgs($data, $tableName, $this->_conn); - $eventManager->dispatchEvent(Events::onSchemaIndexDefinition, $eventArgs); - - $defaultPrevented = $eventArgs->isDefaultPrevented(); - $index = $eventArgs->getIndex(); - } - - if (!$defaultPrevented) { - $index = new Index($data['name'], $data['columns'], $data['unique'], $data['primary']); - } - - if ($index) { - $indexes[$indexKey] = $index; - } - } - - return $indexes; - } - - protected function _getPortableTablesList($tables) - { - $list = array(); - foreach ($tables as $key => $value) { - if ($value = $this->_getPortableTableDefinition($value)) { - $list[] = $value; - } - } - return $list; - } - - protected function _getPortableTableDefinition($table) - { - return $table; - } - - protected function _getPortableUsersList($users) - { - $list = array(); - foreach ($users as $key => $value) { - if ($value = $this->_getPortableUserDefinition($value)) { - $list[] = $value; - } - } - return $list; - } - - protected function _getPortableUserDefinition($user) - { - return $user; - } - - protected function _getPortableViewsList($views) - { - $list = array(); - foreach ($views as $key => $value) { - if ($view = $this->_getPortableViewDefinition($value)) { - $viewName = strtolower($view->getQuotedName($this->_platform)); - $list[$viewName] = $view; - } - } - return $list; - } - - protected function _getPortableViewDefinition($view) - { - return false; - } - - protected function _getPortableTableForeignKeysList($tableForeignKeys) - { - $list = array(); - foreach ($tableForeignKeys as $key => $value) { - if ($value = $this->_getPortableTableForeignKeyDefinition($value)) { - $list[] = $value; - } - } - return $list; - } - - protected function _getPortableTableForeignKeyDefinition($tableForeignKey) - { - return $tableForeignKey; - } - - protected function _execSql($sql) - { - foreach ((array) $sql as $query) { - $this->_conn->executeUpdate($query); - } - } - - /** - * Create a schema instance for the current database. - * - * @return Schema - */ - public function createSchema() - { - $sequences = array(); - if($this->_platform->supportsSequences()) { - $sequences = $this->listSequences(); - } - $tables = $this->listTables(); - - return new Schema($tables, $sequences, $this->createSchemaConfig()); - } - - /** - * Create the configuration for this schema. - * - * @return SchemaConfig - */ - public function createSchemaConfig() - { - $schemaConfig = new SchemaConfig(); - $schemaConfig->setMaxIdentifierLength($this->_platform->getMaxIdentifierLength()); - - $searchPaths = $this->getSchemaSearchPaths(); - if (isset($searchPaths[0])) { - $schemaConfig->setName($searchPaths[0]); - } - - return $schemaConfig; - } - - /** - * The search path for namespaces in the currently connected database. - * - * The first entry is usually the default namespace in the Schema. All - * further namespaces contain tables/sequences which can also be addressed - * with a short, not full-qualified name. - * - * For databases that don't support subschema/namespaces this method - * returns the name of the currently connected database. - * - * @return array - */ - public function getSchemaSearchPaths() - { - return array($this->_conn->getDatabase()); - } - - /** - * Given a table comment this method tries to extract a typehint for Doctrine Type, or returns - * the type given as default. - * - * @param string $comment - * @param string $currentType - * @return string - */ - public function extractDoctrineTypeFromComment($comment, $currentType) - { - if (preg_match("(\(DC2Type:([a-zA-Z0-9]+)\))", $comment, $match)) { - $currentType = $match[1]; - } - return $currentType; - } - - public function removeDoctrineTypeFromComment($comment, $type) - { - return str_replace('(DC2Type:'.$type.')', '', $comment); - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Column.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Column.php deleted file mode 100644 index cb28bc8..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Column.php +++ /dev/null @@ -1,423 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema; - -use \Doctrine\DBAL\Types\Type; -use Doctrine\DBAL\Schema\Visitor\Visitor; - -/** - * Object representation of a database column - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - */ -class Column extends AbstractAsset -{ - /** - * @var \Doctrine\DBAL\Types\Type - */ - protected $_type; - - /** - * @var int - */ - protected $_length = null; - - /** - * @var int - */ - protected $_precision = 10; - - /** - * @var int - */ - protected $_scale = 0; - - /** - * @var bool - */ - protected $_unsigned = false; - - /** - * @var bool - */ - protected $_fixed = false; - - /** - * @var bool - */ - protected $_notnull = true; - - /** - * @var string - */ - protected $_default = null; - - /** - * @var bool - */ - protected $_autoincrement = false; - - /** - * @var array - */ - protected $_platformOptions = array(); - - /** - * @var string - */ - protected $_columnDefinition = null; - - /** - * @var string - */ - protected $_comment = null; - - /** - * @var array - */ - protected $_customSchemaOptions = array(); - - /** - * Create a new Column - * - * @param string $columnName - * @param Doctrine\DBAL\Types\Type $type - * @param int $length - * @param bool $notNull - * @param mixed $default - * @param bool $unsigned - * @param bool $fixed - * @param int $precision - * @param int $scale - * @param array $platformOptions - */ - public function __construct($columnName, Type $type, array $options=array()) - { - $this->_setName($columnName); - $this->setType($type); - $this->setOptions($options); - } - - /** - * @param array $options - * @return Column - */ - public function setOptions(array $options) - { - foreach ($options AS $name => $value) { - $method = "set".$name; - if (method_exists($this, $method)) { - $this->$method($value); - } - } - return $this; - } - - /** - * @param Type $type - * @return Column - */ - public function setType(Type $type) - { - $this->_type = $type; - return $this; - } - - /** - * @param int $length - * @return Column - */ - public function setLength($length) - { - if($length !== null) { - $this->_length = (int)$length; - } else { - $this->_length = null; - } - return $this; - } - - /** - * @param int $precision - * @return Column - */ - public function setPrecision($precision) - { - if (!is_numeric($precision)) { - $precision = 10; // defaults to 10 when no valid precision is given. - } - - $this->_precision = (int)$precision; - return $this; - } - - /** - * @param int $scale - * @return Column - */ - public function setScale($scale) - { - if (!is_numeric($scale)) { - $scale = 0; - } - - $this->_scale = (int)$scale; - return $this; - } - - /** - * - * @param bool $unsigned - * @return Column - */ - public function setUnsigned($unsigned) - { - $this->_unsigned = (bool)$unsigned; - return $this; - } - - /** - * - * @param bool $fixed - * @return Column - */ - public function setFixed($fixed) - { - $this->_fixed = (bool)$fixed; - return $this; - } - - /** - * @param bool $notnull - * @return Column - */ - public function setNotnull($notnull) - { - $this->_notnull = (bool)$notnull; - return $this; - } - - /** - * - * @param mixed $default - * @return Column - */ - public function setDefault($default) - { - $this->_default = $default; - return $this; - } - - /** - * - * @param array $platformOptions - * @return Column - */ - public function setPlatformOptions(array $platformOptions) - { - $this->_platformOptions = $platformOptions; - return $this; - } - - /** - * - * @param string $name - * @param mixed $value - * @return Column - */ - public function setPlatformOption($name, $value) - { - $this->_platformOptions[$name] = $value; - return $this; - } - - /** - * - * @param string - * @return Column - */ - public function setColumnDefinition($value) - { - $this->_columnDefinition = $value; - return $this; - } - - public function getType() - { - return $this->_type; - } - - public function getLength() - { - return $this->_length; - } - - public function getPrecision() - { - return $this->_precision; - } - - public function getScale() - { - return $this->_scale; - } - - public function getUnsigned() - { - return $this->_unsigned; - } - - public function getFixed() - { - return $this->_fixed; - } - - public function getNotnull() - { - return $this->_notnull; - } - - public function getDefault() - { - return $this->_default; - } - - public function getPlatformOptions() - { - return $this->_platformOptions; - } - - public function hasPlatformOption($name) - { - return isset($this->_platformOptions[$name]); - } - - public function getPlatformOption($name) - { - return $this->_platformOptions[$name]; - } - - public function getColumnDefinition() - { - return $this->_columnDefinition; - } - - public function getAutoincrement() - { - return $this->_autoincrement; - } - - public function setAutoincrement($flag) - { - $this->_autoincrement = $flag; - return $this; - } - - public function setComment($comment) - { - $this->_comment = $comment; - return $this; - } - - public function getComment() - { - return $this->_comment; - } - - /** - * @param string $name - * @param mixed $value - * @return Column - */ - public function setCustomSchemaOption($name, $value) - { - $this->_customSchemaOptions[$name] = $value; - return $this; - } - - /** - * @param string $name - * @return boolean - */ - public function hasCustomSchemaOption($name) - { - return isset($this->_customSchemaOptions[$name]); - } - - /** - * @param string $name - * @return mixed - */ - public function getCustomSchemaOption($name) - { - return $this->_customSchemaOptions[$name]; - } - - /** - * @param array $customSchemaOptions - * @return Column - */ - public function setCustomSchemaOptions(array $customSchemaOptions) - { - $this->_customSchemaOptions = $customSchemaOptions; - return $this; - } - - /** - * @return array - */ - public function getCustomSchemaOptions() - { - return $this->_customSchemaOptions; - } - - /** - * @param Visitor $visitor - */ - public function visit(\Doctrine\DBAL\Schema\Visitor $visitor) - { - $visitor->accept($this); - } - - /** - * @return array - */ - public function toArray() - { - return array_merge(array( - 'name' => $this->_name, - 'type' => $this->_type, - 'default' => $this->_default, - 'notnull' => $this->_notnull, - 'length' => $this->_length, - 'precision' => $this->_precision, - 'scale' => $this->_scale, - 'fixed' => $this->_fixed, - 'unsigned' => $this->_unsigned, - 'autoincrement' => $this->_autoincrement, - 'columnDefinition' => $this->_columnDefinition, - 'comment' => $this->_comment, - ), $this->_platformOptions, $this->_customSchemaOptions); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/ColumnDiff.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/ColumnDiff.php deleted file mode 100644 index 4cf8969..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/ColumnDiff.php +++ /dev/null @@ -1,58 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema; - -/** - * Represent the change of a column - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - */ -class ColumnDiff -{ - public $oldColumnName; - - /** - * @var Column - */ - public $column; - - /** - * @var array - */ - public $changedProperties = array(); - - public function __construct($oldColumnName, Column $column, array $changedProperties = array()) - { - $this->oldColumnName = $oldColumnName; - $this->column = $column; - $this->changedProperties = $changedProperties; - } - - public function hasChanged($propertyName) - { - return in_array($propertyName, $this->changedProperties); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Comparator.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Comparator.php deleted file mode 100644 index 52b8ad8..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Comparator.php +++ /dev/null @@ -1,399 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema; - -/** - * Compare to Schemas and return an instance of SchemaDiff - * - * @copyright Copyright (C) 2005-2009 eZ Systems AS. All rights reserved. - * @license http://ez.no/licenses/new_bsd New BSD License - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - */ -class Comparator -{ - /** - * @param Schema $fromSchema - * @param Schema $toSchema - * @return SchemaDiff - */ - static public function compareSchemas( Schema $fromSchema, Schema $toSchema ) - { - $c = new self(); - return $c->compare($fromSchema, $toSchema); - } - - /** - * Returns a SchemaDiff object containing the differences between the schemas $fromSchema and $toSchema. - * - * The returned diferences are returned in such a way that they contain the - * operations to change the schema stored in $fromSchema to the schema that is - * stored in $toSchema. - * - * @param Schema $fromSchema - * @param Schema $toSchema - * - * @return SchemaDiff - */ - public function compare(Schema $fromSchema, Schema $toSchema) - { - $diff = new SchemaDiff(); - - $foreignKeysToTable = array(); - - foreach ( $toSchema->getTables() AS $table ) { - $tableName = $table->getShortestName($toSchema->getName()); - if ( ! $fromSchema->hasTable($tableName)) { - $diff->newTables[$tableName] = $toSchema->getTable($tableName); - } else { - $tableDifferences = $this->diffTable($fromSchema->getTable($tableName), $toSchema->getTable($tableName)); - if ($tableDifferences !== false) { - $diff->changedTables[$tableName] = $tableDifferences; - } - } - } - - /* Check if there are tables removed */ - foreach ($fromSchema->getTables() AS $table) { - $tableName = $table->getShortestName($fromSchema->getName()); - - $table = $fromSchema->getTable($tableName); - if ( ! $toSchema->hasTable($tableName) ) { - $diff->removedTables[$tableName] = $table; - } - - // also remember all foreign keys that point to a specific table - foreach ($table->getForeignKeys() AS $foreignKey) { - $foreignTable = strtolower($foreignKey->getForeignTableName()); - if (!isset($foreignKeysToTable[$foreignTable])) { - $foreignKeysToTable[$foreignTable] = array(); - } - $foreignKeysToTable[$foreignTable][] = $foreignKey; - } - } - - foreach ($diff->removedTables AS $tableName => $table) { - if (isset($foreignKeysToTable[$tableName])) { - $diff->orphanedForeignKeys = array_merge($diff->orphanedForeignKeys, $foreignKeysToTable[$tableName]); - } - } - - foreach ($toSchema->getSequences() AS $sequence) { - $sequenceName = $sequence->getShortestName($toSchema->getName()); - if (!$fromSchema->hasSequence($sequenceName)) { - $diff->newSequences[] = $sequence; - } else { - if ($this->diffSequence($sequence, $fromSchema->getSequence($sequenceName))) { - $diff->changedSequences[] = $toSchema->getSequence($sequenceName); - } - } - } - - foreach ($fromSchema->getSequences() AS $sequence) { - $sequenceName = $sequence->getShortestName($fromSchema->getName()); - if (!$toSchema->hasSequence($sequenceName)) { - $diff->removedSequences[] = $sequence; - } - } - - return $diff; - } - - /** - * - * @param Sequence $sequence1 - * @param Sequence $sequence2 - */ - public function diffSequence(Sequence $sequence1, Sequence $sequence2) - { - if($sequence1->getAllocationSize() != $sequence2->getAllocationSize()) { - return true; - } - - if($sequence1->getInitialValue() != $sequence2->getInitialValue()) { - return true; - } - - return false; - } - - /** - * Returns the difference between the tables $table1 and $table2. - * - * If there are no differences this method returns the boolean false. - * - * @param Table $table1 - * @param Table $table2 - * - * @return bool|TableDiff - */ - public function diffTable(Table $table1, Table $table2) - { - $changes = 0; - $tableDifferences = new TableDiff($table1->getName()); - - $table1Columns = $table1->getColumns(); - $table2Columns = $table2->getColumns(); - - /* See if all the fields in table 1 exist in table 2 */ - foreach ( $table2Columns as $columnName => $column ) { - if ( !$table1->hasColumn($columnName) ) { - $tableDifferences->addedColumns[$columnName] = $column; - $changes++; - } - } - /* See if there are any removed fields in table 2 */ - foreach ( $table1Columns as $columnName => $column ) { - if ( !$table2->hasColumn($columnName) ) { - $tableDifferences->removedColumns[$columnName] = $column; - $changes++; - } - } - - foreach ( $table1Columns as $columnName => $column ) { - if ( $table2->hasColumn($columnName) ) { - $changedProperties = $this->diffColumn( $column, $table2->getColumn($columnName) ); - if (count($changedProperties) ) { - $columnDiff = new ColumnDiff($column->getName(), $table2->getColumn($columnName), $changedProperties); - $tableDifferences->changedColumns[$column->getName()] = $columnDiff; - $changes++; - } - } - } - - $this->detectColumnRenamings($tableDifferences); - - $table1Indexes = $table1->getIndexes(); - $table2Indexes = $table2->getIndexes(); - - foreach ($table2Indexes AS $index2Name => $index2Definition) { - foreach ($table1Indexes AS $index1Name => $index1Definition) { - if ($this->diffIndex($index1Definition, $index2Definition) === false) { - unset($table1Indexes[$index1Name]); - unset($table2Indexes[$index2Name]); - } else { - if ($index1Name == $index2Name) { - $tableDifferences->changedIndexes[$index2Name] = $table2Indexes[$index2Name]; - unset($table1Indexes[$index1Name]); - unset($table2Indexes[$index2Name]); - $changes++; - } - } - } - } - - foreach ($table1Indexes AS $index1Name => $index1Definition) { - $tableDifferences->removedIndexes[$index1Name] = $index1Definition; - $changes++; - } - - foreach ($table2Indexes AS $index2Name => $index2Definition) { - $tableDifferences->addedIndexes[$index2Name] = $index2Definition; - $changes++; - } - - $fromFkeys = $table1->getForeignKeys(); - $toFkeys = $table2->getForeignKeys(); - - foreach ($fromFkeys AS $key1 => $constraint1) { - foreach ($toFkeys AS $key2 => $constraint2) { - if($this->diffForeignKey($constraint1, $constraint2) === false) { - unset($fromFkeys[$key1]); - unset($toFkeys[$key2]); - } else { - if (strtolower($constraint1->getName()) == strtolower($constraint2->getName())) { - $tableDifferences->changedForeignKeys[] = $constraint2; - $changes++; - unset($fromFkeys[$key1]); - unset($toFkeys[$key2]); - } - } - } - } - - foreach ($fromFkeys AS $key1 => $constraint1) { - $tableDifferences->removedForeignKeys[] = $constraint1; - $changes++; - } - - foreach ($toFkeys AS $key2 => $constraint2) { - $tableDifferences->addedForeignKeys[] = $constraint2; - $changes++; - } - - return $changes ? $tableDifferences : false; - } - - /** - * Try to find columns that only changed their name, rename operations maybe cheaper than add/drop - * however ambiguouties between different possibilites should not lead to renaming at all. - * - * @param TableDiff $tableDifferences - */ - private function detectColumnRenamings(TableDiff $tableDifferences) - { - $renameCandidates = array(); - foreach ($tableDifferences->addedColumns AS $addedColumnName => $addedColumn) { - foreach ($tableDifferences->removedColumns AS $removedColumnName => $removedColumn) { - if (count($this->diffColumn($addedColumn, $removedColumn)) == 0) { - $renameCandidates[$addedColumn->getName()][] = array($removedColumn, $addedColumn, $addedColumnName); - } - } - } - - foreach ($renameCandidates AS $candidate => $candidateColumns) { - if (count($candidateColumns) == 1) { - list($removedColumn, $addedColumn) = $candidateColumns[0]; - $removedColumnName = strtolower($removedColumn->getName()); - $addedColumnName = strtolower($addedColumn->getName()); - - $tableDifferences->renamedColumns[$removedColumnName] = $addedColumn; - unset($tableDifferences->addedColumns[$addedColumnName]); - unset($tableDifferences->removedColumns[$removedColumnName]); - } - } - } - - /** - * @param ForeignKeyConstraint $key1 - * @param ForeignKeyConstraint $key2 - * @return bool - */ - public function diffForeignKey(ForeignKeyConstraint $key1, ForeignKeyConstraint $key2) - { - if (array_map('strtolower', $key1->getLocalColumns()) != array_map('strtolower', $key2->getLocalColumns())) { - return true; - } - - if (array_map('strtolower', $key1->getForeignColumns()) != array_map('strtolower', $key2->getForeignColumns())) { - return true; - } - - if ($key1->onUpdate() != $key2->onUpdate()) { - return true; - } - - if ($key1->onDelete() != $key2->onDelete()) { - return true; - } - - return false; - } - - /** - * Returns the difference between the fields $field1 and $field2. - * - * If there are differences this method returns $field2, otherwise the - * boolean false. - * - * @param Column $column1 - * @param Column $column2 - * - * @return array - */ - public function diffColumn(Column $column1, Column $column2) - { - $changedProperties = array(); - if ( $column1->getType() != $column2->getType() ) { - $changedProperties[] = 'type'; - } - - if ($column1->getNotnull() != $column2->getNotnull()) { - $changedProperties[] = 'notnull'; - } - - if ($column1->getDefault() != $column2->getDefault()) { - $changedProperties[] = 'default'; - } - - if ($column1->getUnsigned() != $column2->getUnsigned()) { - $changedProperties[] = 'unsigned'; - } - - if ($column1->getType() instanceof \Doctrine\DBAL\Types\StringType) { - // check if value of length is set at all, default value assumed otherwise. - $length1 = $column1->getLength() ?: 255; - $length2 = $column2->getLength() ?: 255; - if ($length1 != $length2) { - $changedProperties[] = 'length'; - } - - if ($column1->getFixed() != $column2->getFixed()) { - $changedProperties[] = 'fixed'; - } - } - - if ($column1->getType() instanceof \Doctrine\DBAL\Types\DecimalType) { - if (($column1->getPrecision()?:10) != ($column2->getPrecision()?:10)) { - $changedProperties[] = 'precision'; - } - if ($column1->getScale() != $column2->getScale()) { - $changedProperties[] = 'scale'; - } - } - - if ($column1->getAutoincrement() != $column2->getAutoincrement()) { - $changedProperties[] = 'autoincrement'; - } - - // only allow to delete comment if its set to '' not to null. - if ($column1->getComment() !== null && $column1->getComment() != $column2->getComment()) { - $changedProperties[] = 'comment'; - } - - $options1 = $column1->getCustomSchemaOptions(); - $options2 = $column2->getCustomSchemaOptions(); - - $commonKeys = array_keys(array_intersect_key($options1, $options2)); - - foreach ($commonKeys as $key) { - if ($options1[$key] !== $options2[$key]) { - $changedProperties[] = $key; - } - } - - $diffKeys = array_keys(array_diff_key($options1, $options2) + array_diff_key($options2, $options1)); - - $changedProperties = array_merge($changedProperties, $diffKeys); - - return $changedProperties; - } - - /** - * Finds the difference between the indexes $index1 and $index2. - * - * Compares $index1 with $index2 and returns $index2 if there are any - * differences or false in case there are no differences. - * - * @param Index $index1 - * @param Index $index2 - * @return bool - */ - public function diffIndex(Index $index1, Index $index2) - { - if ($index1->isFullfilledBy($index2) && $index2->isFullfilledBy($index1)) { - return false; - } - return true; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Constraint.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Constraint.php deleted file mode 100644 index 9e760ff..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Constraint.php +++ /dev/null @@ -1,38 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema; - -/** - * Marker interface for contraints - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - */ -interface Constraint -{ - public function getName(); - - public function getColumns(); -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php deleted file mode 100644 index 4e41eff..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php +++ /dev/null @@ -1,214 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Schema; - -use Doctrine\DBAL\Event\SchemaIndexDefinitionEventArgs; - -/** - * IBM Db2 Schema Manager - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 1.0 - * @version $Revision$ - * @author Benjamin Eberlei - */ -class DB2SchemaManager extends AbstractSchemaManager -{ - /** - * Return a list of all tables in the current database - * - * Apparently creator is the schema not the user who created it: - * {@link http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db29.doc.sqlref/db2z_sysibmsystablestable.htm} - * - * @return array - */ - public function listTableNames() - { - $sql = $this->_platform->getListTablesSQL(); - $sql .= " AND CREATOR = UPPER('".$this->_conn->getUsername()."')"; - - $tables = $this->_conn->fetchAll($sql); - - return $this->_getPortableTablesList($tables); - } - - - /** - * Get Table Column Definition - * - * @param array $tableColumn - * @return Column - */ - protected function _getPortableTableColumnDefinition($tableColumn) - { - $tableColumn = array_change_key_case($tableColumn, \CASE_LOWER); - - $length = null; - $fixed = null; - $unsigned = false; - $scale = false; - $precision = false; - - $type = $this->_platform->getDoctrineTypeMapping($tableColumn['typename']); - - switch (strtolower($tableColumn['typename'])) { - case 'varchar': - $length = $tableColumn['length']; - $fixed = false; - break; - case 'character': - $length = $tableColumn['length']; - $fixed = true; - break; - case 'clob': - $length = $tableColumn['length']; - break; - case 'decimal': - case 'double': - case 'real': - $scale = $tableColumn['scale']; - $precision = $tableColumn['length']; - break; - } - - $options = array( - 'length' => $length, - 'unsigned' => (bool)$unsigned, - 'fixed' => (bool)$fixed, - 'default' => ($tableColumn['default'] == "NULL") ? null : $tableColumn['default'], - 'notnull' => (bool) ($tableColumn['nulls'] == 'N'), - 'scale' => null, - 'precision' => null, - 'platformOptions' => array(), - ); - - if ($scale !== null && $precision !== null) { - $options['scale'] = $scale; - $options['precision'] = $precision; - } - - return new Column($tableColumn['colname'], \Doctrine\DBAL\Types\Type::getType($type), $options); - } - - protected function _getPortableTablesList($tables) - { - $tableNames = array(); - foreach ($tables AS $tableRow) { - $tableRow = array_change_key_case($tableRow, \CASE_LOWER); - $tableNames[] = $tableRow['name']; - } - return $tableNames; - } - - protected function _getPortableTableIndexesList($tableIndexes, $tableName=null) - { - $eventManager = $this->_platform->getEventManager(); - - $tableIndexRows = array(); - $indexes = array(); - foreach($tableIndexes AS $indexKey => $data) { - $data = array_change_key_case($data, \CASE_LOWER); - $unique = ($data['uniquerule'] == "D") ? false : true; - $primary = ($data['uniquerule'] == "P"); - - $indexName = strtolower($data['name']); - if ($primary) { - $keyName = 'primary'; - } else { - $keyName = $indexName; - } - - $data = array( - 'name' => $indexName, - 'columns' => explode("+", ltrim($data['colnames'], '+')), - 'unique' => $unique, - 'primary' => $primary - ); - - $index = null; - $defaultPrevented = false; - - if (null !== $eventManager && $eventManager->hasListeners(Events::onSchemaIndexDefinition)) { - $eventArgs = new SchemaIndexDefinitionEventArgs($data, $tableName, $this->_conn); - $eventManager->dispatchEvent(Events::onSchemaIndexDefinition, $eventArgs); - - $defaultPrevented = $eventArgs->isDefaultPrevented(); - $index = $eventArgs->getIndex(); - } - - if (!$defaultPrevented) { - $index = new Index($data['name'], $data['columns'], $data['unique'], $data['primary']); - } - - if ($index) { - $indexes[$indexKey] = $index; - } - } - - return $indexes; - } - - protected function _getPortableTableForeignKeyDefinition($tableForeignKey) - { - $tableForeignKey = array_change_key_case($tableForeignKey, CASE_LOWER); - - $tableForeignKey['deleterule'] = $this->_getPortableForeignKeyRuleDef($tableForeignKey['deleterule']); - $tableForeignKey['updaterule'] = $this->_getPortableForeignKeyRuleDef($tableForeignKey['updaterule']); - - return new ForeignKeyConstraint( - array_map('trim', (array)$tableForeignKey['fkcolnames']), - $tableForeignKey['reftbname'], - array_map('trim', (array)$tableForeignKey['pkcolnames']), - $tableForeignKey['relname'], - array( - 'onUpdate' => $tableForeignKey['updaterule'], - 'onDelete' => $tableForeignKey['deleterule'], - ) - ); - } - - protected function _getPortableForeignKeyRuleDef($def) - { - if ($def == "C") { - return "CASCADE"; - } else if ($def == "N") { - return "SET NULL"; - } - return null; - } - - protected function _getPortableViewDefinition($view) - { - $view = array_change_key_case($view, \CASE_LOWER); - // sadly this still segfaults on PDO_IBM, see http://pecl.php.net/bugs/bug.php?id=17199 - //$view['text'] = (is_resource($view['text']) ? stream_get_contents($view['text']) : $view['text']); - if (!is_resource($view['text'])) { - $pos = strpos($view['text'], ' AS '); - $sql = substr($view['text'], $pos+4); - } else { - $sql = ''; - } - - return new View($view['name'], $sql); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php deleted file mode 100644 index 398c727..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php +++ /dev/null @@ -1,164 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema; - -use Doctrine\DBAL\Schema\Visitor\Visitor; - -class ForeignKeyConstraint extends AbstractAsset implements Constraint -{ - /** - * @var Table - */ - protected $_localTable; - - /** - * @var array - */ - protected $_localColumnNames; - - /** - * @var string - */ - protected $_foreignTableName; - - /** - * @var array - */ - protected $_foreignColumnNames; - - /** - * @var string - */ - protected $_cascade = ''; - - /** - * @var array - */ - protected $_options; - - /** - * - * @param array $localColumnNames - * @param string $foreignTableName - * @param array $foreignColumnNames - * @param string $cascade - * @param string|null $name - */ - public function __construct(array $localColumnNames, $foreignTableName, array $foreignColumnNames, $name=null, array $options=array()) - { - $this->_setName($name); - $this->_localColumnNames = $localColumnNames; - $this->_foreignTableName = $foreignTableName; - $this->_foreignColumnNames = $foreignColumnNames; - $this->_options = $options; - } - - /** - * @return string - */ - public function getLocalTableName() - { - return $this->_localTable->getName(); - } - - /** - * @param Table $table - */ - public function setLocalTable(Table $table) - { - $this->_localTable = $table; - } - - /** - * @return array - */ - public function getLocalColumns() - { - return $this->_localColumnNames; - } - - public function getColumns() - { - return $this->_localColumnNames; - } - - /** - * @return string - */ - public function getForeignTableName() - { - return $this->_foreignTableName; - } - - /** - * @return array - */ - public function getForeignColumns() - { - return $this->_foreignColumnNames; - } - - public function hasOption($name) - { - return isset($this->_options[$name]); - } - - public function getOption($name) - { - return $this->_options[$name]; - } - - /** - * Foreign Key onUpdate status - * - * @return string|null - */ - public function onUpdate() - { - return $this->_onEvent('onUpdate'); - } - - /** - * Foreign Key onDelete status - * - * @return string|null - */ - public function onDelete() - { - return $this->_onEvent('onDelete'); - } - - /** - * @param string $event - * @return string|null - */ - private function _onEvent($event) - { - if (isset($this->_options[$event])) { - $onEvent = strtoupper($this->_options[$event]); - if (!in_array($onEvent, array('NO ACTION', 'RESTRICT'))) { - return $onEvent; - } - } - return false; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Index.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Index.php deleted file mode 100644 index 5d77e3a..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Index.php +++ /dev/null @@ -1,196 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema; - -use Doctrine\DBAL\Schema\Visitor\Visitor; - -class Index extends AbstractAsset implements Constraint -{ - /** - * @var array - */ - protected $_columns; - - /** - * @var bool - */ - protected $_isUnique = false; - - /** - * @var bool - */ - protected $_isPrimary = false; - - /** - * @param string $indexName - * @param array $column - * @param bool $isUnique - * @param bool $isPrimary - */ - public function __construct($indexName, array $columns, $isUnique=false, $isPrimary=false) - { - $isUnique = ($isPrimary)?true:$isUnique; - - $this->_setName($indexName); - $this->_isUnique = $isUnique; - $this->_isPrimary = $isPrimary; - - foreach($columns AS $column) { - $this->_addColumn($column); - } - } - - /** - * @param string $column - */ - protected function _addColumn($column) - { - if(is_string($column)) { - $this->_columns[] = $column; - } else { - throw new \InvalidArgumentException("Expecting a string as Index Column"); - } - } - - /** - * @return array - */ - public function getColumns() - { - return $this->_columns; - } - - /** - * @return array - */ - public function getUnquotedColumns() - { - return array_map(array($this, 'trimQuotes'), $this->getColumns()); - } - - /** - * Is the index neither unique nor primary key? - * - * @return bool - */ - public function isSimpleIndex() - { - return !$this->_isPrimary && !$this->_isUnique; - } - - /** - * @return bool - */ - public function isUnique() - { - return $this->_isUnique; - } - - /** - * @return bool - */ - public function isPrimary() - { - return $this->_isPrimary; - } - - /** - * @param string $columnName - * @param int $pos - * @return bool - */ - public function hasColumnAtPosition($columnName, $pos = 0) - { - $columnName = $this->trimQuotes(strtolower($columnName)); - $indexColumns = array_map('strtolower', $this->getUnquotedColumns()); - return array_search($columnName, $indexColumns) === $pos; - } - - /** - * Check if this index exactly spans the given column names in the correct order. - * - * @param array $columnNames - * @return boolean - */ - public function spansColumns(array $columnNames) - { - $sameColumns = true; - for ($i = 0; $i < count($this->_columns); $i++) { - if (!isset($columnNames[$i]) || $this->trimQuotes(strtolower($this->_columns[$i])) != $this->trimQuotes(strtolower($columnNames[$i]))) { - $sameColumns = false; - } - } - return $sameColumns; - } - - /** - * Check if the other index already fullfills all the indexing and constraint needs of the current one. - * - * @param Index $other - * @return bool - */ - public function isFullfilledBy(Index $other) - { - // allow the other index to be equally large only. It being larger is an option - // but it creates a problem with scenarios of the kind PRIMARY KEY(foo,bar) UNIQUE(foo) - if (count($other->getColumns()) != count($this->getColumns())) { - return false; - } - - // Check if columns are the same, and even in the same order - $sameColumns = $this->spansColumns($other->getColumns()); - - if ($sameColumns) { - if (!$this->isUnique() && !$this->isPrimary()) { - // this is a special case: If the current key is neither primary or unique, any uniqe or - // primary key will always have the same effect for the index and there cannot be any constraint - // overlaps. This means a primary or unique index can always fullfill the requirements of just an - // index that has no constraints. - return true; - } else if ($other->isPrimary() != $this->isPrimary()) { - return false; - } else if ($other->isUnique() != $this->isUnique()) { - return false; - } - return true; - } - return false; - } - - /** - * Detect if the other index is a non-unique, non primary index that can be overwritten by this one. - * - * @param Index $other - * @return bool - */ - public function overrules(Index $other) - { - if ($other->isPrimary()) { - return false; - } else if ($this->isSimpleIndex() && $other->isUnique()) { - return false; - } - - if ($this->spansColumns($other->getColumns()) && ($this->isPrimary() || $this->isUnique())) { - return true; - } - return false; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php deleted file mode 100644 index 5796f94..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php +++ /dev/null @@ -1,211 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema; - -/** - * Schema manager for the MySql RDBMS. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @author Konsta Vesterinen - * @author Lukas Smith (PEAR MDB2 library) - * @author Roman Borschel - * @author Benjamin Eberlei - * @version $Revision$ - * @since 2.0 - */ -class MySqlSchemaManager extends AbstractSchemaManager -{ - protected function _getPortableViewDefinition($view) - { - return new View($view['TABLE_NAME'], $view['VIEW_DEFINITION']); - } - - protected function _getPortableTableDefinition($table) - { - return array_shift($table); - } - - protected function _getPortableUserDefinition($user) - { - return array( - 'user' => $user['User'], - 'password' => $user['Password'], - ); - } - - protected function _getPortableTableIndexesList($tableIndexes, $tableName=null) - { - foreach($tableIndexes AS $k => $v) { - $v = array_change_key_case($v, CASE_LOWER); - if($v['key_name'] == 'PRIMARY') { - $v['primary'] = true; - } else { - $v['primary'] = false; - } - $tableIndexes[$k] = $v; - } - - return parent::_getPortableTableIndexesList($tableIndexes, $tableName); - } - - protected function _getPortableSequenceDefinition($sequence) - { - return end($sequence); - } - - protected function _getPortableDatabaseDefinition($database) - { - return $database['Database']; - } - - /** - * Gets a portable column definition. - * - * The database type is mapped to a corresponding Doctrine mapping type. - * - * @param $tableColumn - * @return array - */ - protected function _getPortableTableColumnDefinition($tableColumn) - { - $tableColumn = array_change_key_case($tableColumn, CASE_LOWER); - - $dbType = strtolower($tableColumn['type']); - $dbType = strtok($dbType, '(), '); - if (isset($tableColumn['length'])) { - $length = $tableColumn['length']; - $decimal = ''; - } else { - $length = strtok('(), '); - $decimal = strtok('(), ') ? strtok('(), '):null; - } - $type = array(); - $unsigned = $fixed = null; - - if ( ! isset($tableColumn['name'])) { - $tableColumn['name'] = ''; - } - - $scale = null; - $precision = null; - - $type = $this->_platform->getDoctrineTypeMapping($dbType); - $type = $this->extractDoctrineTypeFromComment($tableColumn['comment'], $type); - $tableColumn['comment'] = $this->removeDoctrineTypeFromComment($tableColumn['comment'], $type); - - switch ($dbType) { - case 'char': - $fixed = true; - break; - case 'float': - case 'double': - case 'real': - case 'numeric': - case 'decimal': - if(preg_match('([A-Za-z]+\(([0-9]+)\,([0-9]+)\))', $tableColumn['type'], $match)) { - $precision = $match[1]; - $scale = $match[2]; - $length = null; - } - break; - case 'tinyint': - case 'smallint': - case 'mediumint': - case 'int': - case 'integer': - case 'bigint': - case 'tinyblob': - case 'mediumblob': - case 'longblob': - case 'blob': - case 'year': - $length = null; - break; - } - - $length = ((int) $length == 0) ? null : (int) $length; - $def = array( - 'type' => $type, - 'length' => $length, - 'unsigned' => (bool) $unsigned, - 'fixed' => (bool) $fixed - ); - - $options = array( - 'length' => $length, - 'unsigned' => (bool)$unsigned, - 'fixed' => (bool)$fixed, - 'default' => isset($tableColumn['default']) ? $tableColumn['default'] : null, - 'notnull' => (bool) ($tableColumn['null'] != 'YES'), - 'scale' => null, - 'precision' => null, - 'autoincrement' => (bool) (strpos($tableColumn['extra'], 'auto_increment') !== false), - 'comment' => (isset($tableColumn['comment'])) ? $tableColumn['comment'] : null - ); - - if ($scale !== null && $precision !== null) { - $options['scale'] = $scale; - $options['precision'] = $precision; - } - - return new Column($tableColumn['field'], \Doctrine\DBAL\Types\Type::getType($type), $options); - } - - protected function _getPortableTableForeignKeysList($tableForeignKeys) - { - $list = array(); - foreach ($tableForeignKeys as $key => $value) { - $value = array_change_key_case($value, CASE_LOWER); - if (!isset($list[$value['constraint_name']])) { - if (!isset($value['delete_rule']) || $value['delete_rule'] == "RESTRICT") { - $value['delete_rule'] = null; - } - if (!isset($value['update_rule']) || $value['update_rule'] == "RESTRICT") { - $value['update_rule'] = null; - } - - $list[$value['constraint_name']] = array( - 'name' => $value['constraint_name'], - 'local' => array(), - 'foreign' => array(), - 'foreignTable' => $value['referenced_table_name'], - 'onDelete' => $value['delete_rule'], - 'onUpdate' => $value['update_rule'], - ); - } - $list[$value['constraint_name']]['local'][] = $value['column_name']; - $list[$value['constraint_name']]['foreign'][] = $value['referenced_column_name']; - } - - $result = array(); - foreach($list AS $constraint) { - $result[] = new ForeignKeyConstraint( - array_values($constraint['local']), $constraint['foreignTable'], - array_values($constraint['foreign']), $constraint['name'], - array( - 'onDelete' => $constraint['onDelete'], - 'onUpdate' => $constraint['onUpdate'], - ) - ); - } - - return $result; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php deleted file mode 100644 index 3bbefb6..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php +++ /dev/null @@ -1,286 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema; - -/** - * Oracle Schema Manager - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @author Konsta Vesterinen - * @author Lukas Smith (PEAR MDB2 library) - * @author Benjamin Eberlei - * @version $Revision$ - * @since 2.0 - */ -class OracleSchemaManager extends AbstractSchemaManager -{ - protected function _getPortableViewDefinition($view) - { - $view = \array_change_key_case($view, CASE_LOWER); - - return new View($view['view_name'], $view['text']); - } - - protected function _getPortableUserDefinition($user) - { - $user = \array_change_key_case($user, CASE_LOWER); - - return array( - 'user' => $user['username'], - ); - } - - protected function _getPortableTableDefinition($table) - { - $table = \array_change_key_case($table, CASE_LOWER); - - return $table['table_name']; - } - - /** - * @license New BSD License - * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html - * @param array $tableIndexes - * @param string $tableName - * @return array - */ - protected function _getPortableTableIndexesList($tableIndexes, $tableName=null) - { - $indexBuffer = array(); - foreach ( $tableIndexes as $tableIndex ) { - $tableIndex = \array_change_key_case($tableIndex, CASE_LOWER); - - $keyName = strtolower($tableIndex['name']); - - if ( strtolower($tableIndex['is_primary']) == "p" ) { - $keyName = 'primary'; - $buffer['primary'] = true; - $buffer['non_unique'] = false; - } else { - $buffer['primary'] = false; - $buffer['non_unique'] = ( $tableIndex['is_unique'] == 0 ) ? true : false; - } - $buffer['key_name'] = $keyName; - $buffer['column_name'] = $tableIndex['column_name']; - $indexBuffer[] = $buffer; - } - return parent::_getPortableTableIndexesList($indexBuffer, $tableName); - } - - protected function _getPortableTableColumnDefinition($tableColumn) - { - $tableColumn = \array_change_key_case($tableColumn, CASE_LOWER); - - $dbType = strtolower($tableColumn['data_type']); - if(strpos($dbType, "timestamp(") === 0) { - if (strpos($dbType, "WITH TIME ZONE")) { - $dbType = "timestamptz"; - } else { - $dbType = "timestamp"; - } - } - - $type = array(); - $length = $unsigned = $fixed = null; - if ( ! empty($tableColumn['data_length'])) { - $length = $tableColumn['data_length']; - } - - if ( ! isset($tableColumn['column_name'])) { - $tableColumn['column_name'] = ''; - } - - if (stripos($tableColumn['data_default'], 'NULL') !== null) { - $tableColumn['data_default'] = null; - } - - $precision = null; - $scale = null; - - $type = $this->_platform->getDoctrineTypeMapping($dbType); - $type = $this->extractDoctrineTypeFromComment($tableColumn['comments'], $type); - $tableColumn['comments'] = $this->removeDoctrineTypeFromComment($tableColumn['comments'], $type); - - switch ($dbType) { - case 'number': - if ($tableColumn['data_precision'] == 20 && $tableColumn['data_scale'] == 0) { - $precision = 20; - $scale = 0; - $type = 'bigint'; - } elseif ($tableColumn['data_precision'] == 5 && $tableColumn['data_scale'] == 0) { - $type = 'smallint'; - $precision = 5; - $scale = 0; - } elseif ($tableColumn['data_precision'] == 1 && $tableColumn['data_scale'] == 0) { - $precision = 1; - $scale = 0; - $type = 'boolean'; - } elseif ($tableColumn['data_scale'] > 0) { - $precision = $tableColumn['data_precision']; - $scale = $tableColumn['data_scale']; - $type = 'decimal'; - } - $length = null; - break; - case 'pls_integer': - case 'binary_integer': - $length = null; - break; - case 'varchar': - case 'varchar2': - case 'nvarchar2': - $length = $tableColumn['char_length']; - $fixed = false; - break; - case 'char': - case 'nchar': - $length = $tableColumn['char_length']; - $fixed = true; - break; - case 'date': - case 'timestamp': - $length = null; - break; - case 'float': - $precision = $tableColumn['data_precision']; - $scale = $tableColumn['data_scale']; - $length = null; - break; - case 'clob': - case 'nclob': - $length = null; - break; - case 'blob': - case 'raw': - case 'long raw': - case 'bfile': - $length = null; - break; - case 'rowid': - case 'urowid': - default: - $length = null; - } - - $options = array( - 'notnull' => (bool) ($tableColumn['nullable'] === 'N'), - 'fixed' => (bool) $fixed, - 'unsigned' => (bool) $unsigned, - 'default' => $tableColumn['data_default'], - 'length' => $length, - 'precision' => $precision, - 'scale' => $scale, - 'comment' => (isset($tableColumn['comments'])) ? $tableColumn['comments'] : null, - 'platformDetails' => array(), - ); - - return new Column($tableColumn['column_name'], \Doctrine\DBAL\Types\Type::getType($type), $options); - } - - protected function _getPortableTableForeignKeysList($tableForeignKeys) - { - $list = array(); - foreach ($tableForeignKeys as $key => $value) { - $value = \array_change_key_case($value, CASE_LOWER); - if (!isset($list[$value['constraint_name']])) { - if ($value['delete_rule'] == "NO ACTION") { - $value['delete_rule'] = null; - } - - $list[$value['constraint_name']] = array( - 'name' => $value['constraint_name'], - 'local' => array(), - 'foreign' => array(), - 'foreignTable' => $value['references_table'], - 'onDelete' => $value['delete_rule'], - ); - } - $list[$value['constraint_name']]['local'][$value['position']] = $value['local_column']; - $list[$value['constraint_name']]['foreign'][$value['position']] = $value['foreign_column']; - } - - $result = array(); - foreach($list AS $constraint) { - $result[] = new ForeignKeyConstraint( - array_values($constraint['local']), $constraint['foreignTable'], - array_values($constraint['foreign']), $constraint['name'], - array('onDelete' => $constraint['onDelete']) - ); - } - - return $result; - } - - protected function _getPortableSequenceDefinition($sequence) - { - $sequence = \array_change_key_case($sequence, CASE_LOWER); - return new Sequence($sequence['sequence_name'], $sequence['increment_by'], $sequence['min_value']); - } - - protected function _getPortableFunctionDefinition($function) - { - $function = \array_change_key_case($function, CASE_LOWER); - return $function['name']; - } - - protected function _getPortableDatabaseDefinition($database) - { - $database = \array_change_key_case($database, CASE_LOWER); - return $database['username']; - } - - public function createDatabase($database = null) - { - if (is_null($database)) { - $database = $this->_conn->getDatabase(); - } - - $params = $this->_conn->getParams(); - $username = $database; - $password = $params['password']; - - $query = 'CREATE USER ' . $username . ' IDENTIFIED BY ' . $password; - $result = $this->_conn->executeUpdate($query); - - $query = 'GRANT CREATE SESSION, CREATE TABLE, UNLIMITED TABLESPACE, CREATE SEQUENCE, CREATE TRIGGER TO ' . $username; - $result = $this->_conn->executeUpdate($query); - - return true; - } - - public function dropAutoincrement($table) - { - $sql = $this->_platform->getDropAutoincrementSql($table); - foreach ($sql as $query) { - $this->_conn->executeUpdate($query); - } - - return true; - } - - public function dropTable($name) - { - $this->dropAutoincrement($name); - - return parent::dropTable($name); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php deleted file mode 100644 index 87b5301..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php +++ /dev/null @@ -1,359 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema; - -/** - * PostgreSQL Schema Manager - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @author Konsta Vesterinen - * @author Lukas Smith (PEAR MDB2 library) - * @author Benjamin Eberlei - * @since 2.0 - */ -class PostgreSqlSchemaManager extends AbstractSchemaManager -{ - /** - * @var array - */ - private $existingSchemaPaths; - - /** - * Get all the existing schema names. - * - * @return array - */ - public function getSchemaNames() - { - $rows = $this->_conn->fetchAll("SELECT nspname as schema_name FROM pg_namespace WHERE nspname !~ '^pg_.*' and nspname != 'information_schema'"); - return array_map(function($v) { return $v['schema_name']; }, $rows); - } - - /** - * Return an array of schema search paths - * - * This is a PostgreSQL only function. - * - * @return array - */ - public function getSchemaSearchPaths() - { - $params = $this->_conn->getParams(); - $schema = explode(",", $this->_conn->fetchColumn('SHOW search_path')); - if (isset($params['user'])) { - $schema = str_replace('"$user"', $params['user'], $schema); - } - return $schema; - } - - /** - * Get names of all existing schemas in the current users search path. - * - * This is a PostgreSQL only function. - * - * @return array - */ - public function getExistingSchemaSearchPaths() - { - if ($this->existingSchemaPaths === null) { - $this->determineExistingSchemaSearchPaths(); - } - return $this->existingSchemaPaths; - } - - /** - * Use this to set or reset the order of the existing schemas in the current search path of the user - * - * This is a PostgreSQL only function. - * - * @return type - */ - public function determineExistingSchemaSearchPaths() - { - $names = $this->getSchemaNames(); - $paths = $this->getSchemaSearchPaths(); - - $this->existingSchemaPaths = array_filter($paths, function ($v) use ($names) { - return in_array($v, $names); - }); - } - - protected function _getPortableTableForeignKeyDefinition($tableForeignKey) - { - $onUpdate = null; - $onDelete = null; - - if (preg_match('(ON UPDATE ([a-zA-Z0-9]+( (NULL|ACTION|DEFAULT))?))', $tableForeignKey['condef'], $match)) { - $onUpdate = $match[1]; - } - if (preg_match('(ON DELETE ([a-zA-Z0-9]+( (NULL|ACTION|DEFAULT))?))', $tableForeignKey['condef'], $match)) { - $onDelete = $match[1]; - } - - if (preg_match('/FOREIGN KEY \((.+)\) REFERENCES (.+)\((.+)\)/', $tableForeignKey['condef'], $values)) { - // PostgreSQL returns identifiers that are keywords with quotes, we need them later, don't get - // the idea to trim them here. - $localColumns = array_map('trim', explode(",", $values[1])); - $foreignColumns = array_map('trim', explode(",", $values[3])); - $foreignTable = $values[2]; - } - - return new ForeignKeyConstraint( - $localColumns, $foreignTable, $foreignColumns, $tableForeignKey['conname'], - array('onUpdate' => $onUpdate, 'onDelete' => $onDelete) - ); - } - - public function dropDatabase($database) - { - $params = $this->_conn->getParams(); - $params["dbname"] = "postgres"; - $tmpPlatform = $this->_platform; - $tmpConn = $this->_conn; - - $this->_conn = \Doctrine\DBAL\DriverManager::getConnection($params); - $this->_platform = $this->_conn->getDatabasePlatform(); - - parent::dropDatabase($database); - - $this->_platform = $tmpPlatform; - $this->_conn = $tmpConn; - } - - public function createDatabase($database) - { - $params = $this->_conn->getParams(); - $params["dbname"] = "postgres"; - $tmpPlatform = $this->_platform; - $tmpConn = $this->_conn; - - $this->_conn = \Doctrine\DBAL\DriverManager::getConnection($params); - $this->_platform = $this->_conn->getDatabasePlatform(); - - parent::createDatabase($database); - - $this->_platform = $tmpPlatform; - $this->_conn = $tmpConn; - } - - protected function _getPortableTriggerDefinition($trigger) - { - return $trigger['trigger_name']; - } - - protected function _getPortableViewDefinition($view) - { - return new View($view['viewname'], $view['definition']); - } - - protected function _getPortableUserDefinition($user) - { - return array( - 'user' => $user['usename'], - 'password' => $user['passwd'] - ); - } - - protected function _getPortableTableDefinition($table) - { - $schemas = $this->getExistingSchemaSearchPaths(); - $firstSchema = array_shift($schemas); - - if ($table['schema_name'] == $firstSchema) { - return $table['table_name']; - } else { - return $table['schema_name'] . "." . $table['table_name']; - } - } - - /** - * @license New BSD License - * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html - * @param array $tableIndexes - * @param string $tableName - * @return array - */ - protected function _getPortableTableIndexesList($tableIndexes, $tableName=null) - { - $buffer = array(); - foreach ($tableIndexes AS $row) { - $colNumbers = explode(' ', $row['indkey']); - $colNumbersSql = 'IN (' . join(' ,', $colNumbers) . ' )'; - $columnNameSql = "SELECT attnum, attname FROM pg_attribute - WHERE attrelid={$row['indrelid']} AND attnum $colNumbersSql ORDER BY attnum ASC;"; - - $stmt = $this->_conn->executeQuery($columnNameSql); - $indexColumns = $stmt->fetchAll(); - - // required for getting the order of the columns right. - foreach ($colNumbers AS $colNum) { - foreach ($indexColumns as $colRow) { - if ($colNum == $colRow['attnum']) { - $buffer[] = array( - 'key_name' => $row['relname'], - 'column_name' => trim($colRow['attname']), - 'non_unique' => !$row['indisunique'], - 'primary' => $row['indisprimary'] - ); - } - } - } - } - return parent::_getPortableTableIndexesList($buffer, $tableName); - } - - protected function _getPortableDatabaseDefinition($database) - { - return $database['datname']; - } - - protected function _getPortableSequenceDefinition($sequence) - { - if ($sequence['schemaname'] != 'public') { - $sequenceName = $sequence['schemaname'] . "." . $sequence['relname']; - } else { - $sequenceName = $sequence['relname']; - } - - $data = $this->_conn->fetchAll('SELECT min_value, increment_by FROM ' . $sequenceName); - return new Sequence($sequenceName, $data[0]['increment_by'], $data[0]['min_value']); - } - - protected function _getPortableTableColumnDefinition($tableColumn) - { - $tableColumn = array_change_key_case($tableColumn, CASE_LOWER); - - if (strtolower($tableColumn['type']) === 'varchar') { - // get length from varchar definition - $length = preg_replace('~.*\(([0-9]*)\).*~', '$1', $tableColumn['complete_type']); - $tableColumn['length'] = $length; - } - - $matches = array(); - - $autoincrement = false; - if (preg_match("/^nextval\('(.*)'(::.*)?\)$/", $tableColumn['default'], $matches)) { - $tableColumn['sequence'] = $matches[1]; - $tableColumn['default'] = null; - $autoincrement = true; - } - - if (stripos($tableColumn['default'], 'NULL') === 0) { - $tableColumn['default'] = null; - } - - $length = (isset($tableColumn['length'])) ? $tableColumn['length'] : null; - if ($length == '-1' && isset($tableColumn['atttypmod'])) { - $length = $tableColumn['atttypmod'] - 4; - } - if ((int) $length <= 0) { - $length = null; - } - $fixed = null; - - if (!isset($tableColumn['name'])) { - $tableColumn['name'] = ''; - } - - $precision = null; - $scale = null; - - $dbType = strtolower($tableColumn['type']); - if (strlen($tableColumn['domain_type']) && !$this->_platform->hasDoctrineTypeMappingFor($tableColumn['type'])) { - $dbType = strtolower($tableColumn['domain_type']); - $tableColumn['complete_type'] = $tableColumn['domain_complete_type']; - } - - $type = $this->_platform->getDoctrineTypeMapping($dbType); - $type = $this->extractDoctrineTypeFromComment($tableColumn['comment'], $type); - $tableColumn['comment'] = $this->removeDoctrineTypeFromComment($tableColumn['comment'], $type); - - switch ($dbType) { - case 'smallint': - case 'int2': - $length = null; - break; - case 'int': - case 'int4': - case 'integer': - $length = null; - break; - case 'bigint': - case 'int8': - $length = null; - break; - case 'bool': - case 'boolean': - $length = null; - break; - case 'text': - $fixed = false; - break; - case 'varchar': - case 'interval': - case '_varchar': - $fixed = false; - break; - case 'char': - case 'bpchar': - $fixed = true; - break; - case 'float': - case 'float4': - case 'float8': - case 'double': - case 'double precision': - case 'real': - case 'decimal': - case 'money': - case 'numeric': - if (preg_match('([A-Za-z]+\(([0-9]+)\,([0-9]+)\))', $tableColumn['complete_type'], $match)) { - $precision = $match[1]; - $scale = $match[2]; - $length = null; - } - break; - case 'year': - $length = null; - break; - } - - if ($tableColumn['default'] && preg_match("('([^']+)'::)", $tableColumn['default'], $match)) { - $tableColumn['default'] = $match[1]; - } - - $options = array( - 'length' => $length, - 'notnull' => (bool) $tableColumn['isnotnull'], - 'default' => $tableColumn['default'], - 'primary' => (bool) ($tableColumn['pri'] == 't'), - 'precision' => $precision, - 'scale' => $scale, - 'fixed' => $fixed, - 'unsigned' => false, - 'autoincrement' => $autoincrement, - 'comment' => $tableColumn['comment'], - ); - - return new Column($tableColumn['field'], \Doctrine\DBAL\Types\Type::getType($type), $options); - } - -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php deleted file mode 100644 index 0a2de79..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php +++ /dev/null @@ -1,247 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema; - -use Doctrine\DBAL\Event\SchemaIndexDefinitionEventArgs; -use Doctrine\DBAL\Events; - -/** - * SQL Server Schema Manager - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @author Konsta Vesterinen - * @author Lukas Smith (PEAR MDB2 library) - * @author Juozas Kaziukenas - * @since 2.0 - */ -class SQLServerSchemaManager extends AbstractSchemaManager -{ - /** - * @override - */ - protected function _getPortableTableColumnDefinition($tableColumn) - { - $dbType = strtolower($tableColumn['TYPE_NAME']); - - $autoincrement = false; - if (stripos($dbType, 'identity')) { - $dbType = trim(str_ireplace('identity', '', $dbType)); - $autoincrement = true; - } - - $type = array(); - $unsigned = $fixed = null; - - if (!isset($tableColumn['name'])) { - $tableColumn['name'] = ''; - } - - $default = $tableColumn['COLUMN_DEF']; - - while ($default != ($default2 = preg_replace("/^\((.*)\)$/", '$1', $default))) { - $default = trim($default2, "'"); - } - - $length = (int) $tableColumn['LENGTH']; - - $type = $this->_platform->getDoctrineTypeMapping($dbType); - switch ($type) { - case 'char': - if ($tableColumn['LENGTH'] == '1') { - $type = 'boolean'; - if (preg_match('/^(is|has)/', $tableColumn['name'])) { - $type = array_reverse($type); - } - } - $fixed = true; - break; - case 'text': - $fixed = false; - break; - } - switch ($dbType) { - case 'nchar': - case 'nvarchar': - case 'ntext': - // Unicode data requires 2 bytes per character - $length = $length / 2; - break; - } - - $options = array( - 'length' => ($length == 0 || !in_array($type, array('text', 'string'))) ? null : $length, - 'unsigned' => (bool) $unsigned, - 'fixed' => (bool) $fixed, - 'default' => $default !== 'NULL' ? $default : null, - 'notnull' => (bool) ($tableColumn['IS_NULLABLE'] != 'YES'), - 'scale' => $tableColumn['SCALE'], - 'precision' => $tableColumn['PRECISION'], - 'autoincrement' => $autoincrement, - ); - - return new Column($tableColumn['COLUMN_NAME'], \Doctrine\DBAL\Types\Type::getType($type), $options); - } - - /** - * @override - */ - protected function _getPortableTableIndexesList($tableIndexRows, $tableName=null) - { - $result = array(); - foreach ($tableIndexRows AS $tableIndex) { - $indexName = $keyName = $tableIndex['index_name']; - if (strpos($tableIndex['index_description'], 'primary key') !== false) { - $keyName = 'primary'; - } - $keyName = strtolower($keyName); - - $result[$keyName] = array( - 'name' => $indexName, - 'columns' => explode(', ', $tableIndex['index_keys']), - 'unique' => strpos($tableIndex['index_description'], 'unique') !== false, - 'primary' => strpos($tableIndex['index_description'], 'primary key') !== false, - ); - } - - $eventManager = $this->_platform->getEventManager(); - - $indexes = array(); - foreach ($result AS $indexKey => $data) { - $index = null; - $defaultPrevented = false; - - if (null !== $eventManager && $eventManager->hasListeners(Events::onSchemaIndexDefinition)) { - $eventArgs = new SchemaIndexDefinitionEventArgs($data, $tableName, $this->_conn); - $eventManager->dispatchEvent(Events::onSchemaIndexDefinition, $eventArgs); - - $defaultPrevented = $eventArgs->isDefaultPrevented(); - $index = $eventArgs->getIndex(); - } - - if (!$defaultPrevented) { - $index = new Index($data['name'], $data['columns'], $data['unique'], $data['primary']); - } - - if ($index) { - $indexes[$indexKey] = $index; - } - } - - return $indexes; - } - - /** - * @override - */ - public function _getPortableTableForeignKeyDefinition($tableForeignKey) - { - return new ForeignKeyConstraint( - (array) $tableForeignKey['ColumnName'], - $tableForeignKey['ReferenceTableName'], - (array) $tableForeignKey['ReferenceColumnName'], - $tableForeignKey['ForeignKey'], - array( - 'onUpdate' => str_replace('_', ' ', $tableForeignKey['update_referential_action_desc']), - 'onDelete' => str_replace('_', ' ', $tableForeignKey['delete_referential_action_desc']), - ) - ); - } - - /** - * @override - */ - protected function _getPortableTableDefinition($table) - { - return $table['name']; - } - - /** - * @override - */ - protected function _getPortableDatabaseDefinition($database) - { - return $database['name']; - } - - /** - * @override - */ - protected function _getPortableViewDefinition($view) - { - // @todo - return new View($view['name'], null); - } - - /** - * List the indexes for a given table returning an array of Index instances. - * - * Keys of the portable indexes list are all lower-cased. - * - * @param string $table The name of the table - * @return Index[] $tableIndexes - */ - public function listTableIndexes($table) - { - $sql = $this->_platform->getListTableIndexesSQL($table, $this->_conn->getDatabase()); - - try { - $tableIndexes = $this->_conn->fetchAll($sql); - } catch(\PDOException $e) { - if ($e->getCode() == "IMSSP") { - return array(); - } else { - throw $e; - } - } - - return $this->_getPortableTableIndexesList($tableIndexes, $table); - } - - /** - * @override - */ - public function alterTable(TableDiff $tableDiff) - { - if(count($tableDiff->removedColumns) > 0) { - foreach($tableDiff->removedColumns as $col){ - $columnConstraintSql = $this->getColumnConstraintSQL($tableDiff->name, $col->getName()); - foreach ($this->_conn->fetchAll($columnConstraintSql) as $constraint) { - $this->_conn->exec("ALTER TABLE $tableDiff->name DROP CONSTRAINT " . $constraint['Name']); - } - } - } - - return parent::alterTable($tableDiff); - } - - /** - * This function retrieves the constraints for a given column. - */ - private function getColumnConstraintSQL($table, $column) - { - return "SELECT SysObjects.[Name] - FROM SysObjects INNER JOIN (SELECT [Name],[ID] FROM SysObjects WHERE XType = 'U') AS Tab - ON Tab.[ID] = Sysobjects.[Parent_Obj] - INNER JOIN sys.default_constraints DefCons ON DefCons.[object_id] = Sysobjects.[ID] - INNER JOIN SysColumns Col ON Col.[ColID] = DefCons.[parent_column_id] AND Col.[ID] = Tab.[ID] - WHERE Col.[Name] = " . $this->_conn->quote($column) ." AND Tab.[Name] = " . $this->_conn->quote($table) . " - ORDER BY Col.[Name]"; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Schema.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Schema.php deleted file mode 100644 index 2c1b642..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Schema.php +++ /dev/null @@ -1,367 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema; - -use Doctrine\DBAL\Schema\Visitor\CreateSchemaSqlCollector; -use Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector; -use Doctrine\DBAL\Schema\Visitor\Visitor; - -/** - * Object representation of a database schema - * - * Different vendors have very inconsistent naming with regard to the concept - * of a "schema". Doctrine understands a schema as the entity that conceptually - * wraps a set of database objects such as tables, sequences, indexes and - * foreign keys that belong to each other into a namespace. A Doctrine Schema - * has nothing to do with the "SCHEMA" defined as in PostgreSQL, it is more - * related to the concept of "DATABASE" that exists in MySQL and PostgreSQL. - * - * Every asset in the doctrine schema has a name. A name consists of either a - * namespace.local name pair or just a local unqualified name. - * - * The abstraction layer that covers a PostgreSQL schema is the namespace of an - * database object (asset). A schema can have a name, which will be used as - * default namespace for the unqualified database objects that are created in - * the schema. - * - * In the case of MySQL where cross-database queries are allowed this leads to - * databases being "misinterpreted" as namespaces. This is intentional, however - * the CREATE/DROP SQL visitors will just filter this queries and do not - * execute them. Only the queries for the currently connected database are - * executed. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - */ -class Schema extends AbstractAsset -{ - /** - * @var array - */ - protected $_tables = array(); - - /** - * @var array - */ - protected $_sequences = array(); - - /** - * @var SchemaConfig - */ - protected $_schemaConfig = false; - - /** - * @param array $tables - * @param array $sequences - * @param array $views - * @param array $triggers - * @param SchemaConfig $schemaConfig - */ - public function __construct(array $tables=array(), array $sequences=array(), SchemaConfig $schemaConfig=null) - { - if ($schemaConfig == null) { - $schemaConfig = new SchemaConfig(); - } - $this->_schemaConfig = $schemaConfig; - $this->_setName($schemaConfig->getName() ?: 'public'); - - foreach ($tables AS $table) { - $this->_addTable($table); - } - foreach ($sequences AS $sequence) { - $this->_addSequence($sequence); - } - } - - /** - * @return bool - */ - public function hasExplicitForeignKeyIndexes() - { - return $this->_schemaConfig->hasExplicitForeignKeyIndexes(); - } - - /** - * @param Table $table - */ - protected function _addTable(Table $table) - { - $tableName = $table->getFullQualifiedName($this->getName()); - if(isset($this->_tables[$tableName])) { - throw SchemaException::tableAlreadyExists($tableName); - } - - $this->_tables[$tableName] = $table; - $table->setSchemaConfig($this->_schemaConfig); - } - - /** - * @param Sequence $sequence - */ - protected function _addSequence(Sequence $sequence) - { - $seqName = $sequence->getFullQualifiedName($this->getName()); - if (isset($this->_sequences[$seqName])) { - throw SchemaException::sequenceAlreadyExists($seqName); - } - $this->_sequences[$seqName] = $sequence; - } - - /** - * Get all tables of this schema. - * - * @return array - */ - public function getTables() - { - return $this->_tables; - } - - /** - * @param string $tableName - * @return Table - */ - public function getTable($tableName) - { - $tableName = $this->getFullQualifiedAssetName($tableName); - if (!isset($this->_tables[$tableName])) { - throw SchemaException::tableDoesNotExist($tableName); - } - - return $this->_tables[$tableName]; - } - - /** - * @return string - */ - private function getFullQualifiedAssetName($name) - { - if ($this->isQuoted($name)) { - $name = $this->trimQuotes($name); - } - if (strpos($name, ".") === false) { - $name = $this->getName() . "." . $name; - } - return strtolower($name); - } - - /** - * Does this schema have a table with the given name? - * - * @param string $tableName - * @return Schema - */ - public function hasTable($tableName) - { - $tableName = $this->getFullQualifiedAssetName($tableName); - return isset($this->_tables[$tableName]); - } - - /** - * Get all table names, prefixed with a schema name, even the default one - * if present. - * - * @return array - */ - public function getTableNames() - { - return array_keys($this->_tables); - } - - public function hasSequence($sequenceName) - { - $sequenceName = $this->getFullQualifiedAssetName($sequenceName); - return isset($this->_sequences[$sequenceName]); - } - - /** - * @throws SchemaException - * @param string $sequenceName - * @return Doctrine\DBAL\Schema\Sequence - */ - public function getSequence($sequenceName) - { - $sequenceName = $this->getFullQualifiedAssetName($sequenceName); - if(!$this->hasSequence($sequenceName)) { - throw SchemaException::sequenceDoesNotExist($sequenceName); - } - return $this->_sequences[$sequenceName]; - } - - /** - * @return Doctrine\DBAL\Schema\Sequence[] - */ - public function getSequences() - { - return $this->_sequences; - } - - /** - * Create a new table - * - * @param string $tableName - * @return Table - */ - public function createTable($tableName) - { - $table = new Table($tableName); - $this->_addTable($table); - return $table; - } - - /** - * Rename a table - * - * @param string $oldTableName - * @param string $newTableName - * @return Schema - */ - public function renameTable($oldTableName, $newTableName) - { - $table = $this->getTable($oldTableName); - $table->_setName($newTableName); - - $this->dropTable($oldTableName); - $this->_addTable($table); - return $this; - } - - /** - * Drop a table from the schema. - * - * @param string $tableName - * @return Schema - */ - public function dropTable($tableName) - { - $tableName = $this->getFullQualifiedAssetName($tableName); - $table = $this->getTable($tableName); - unset($this->_tables[$tableName]); - return $this; - } - - /** - * Create a new sequence - * - * @param string $sequenceName - * @param int $allocationSize - * @param int $initialValue - * @return Sequence - */ - public function createSequence($sequenceName, $allocationSize=1, $initialValue=1) - { - $seq = new Sequence($sequenceName, $allocationSize, $initialValue); - $this->_addSequence($seq); - return $seq; - } - - /** - * @param string $sequenceName - * @return Schema - */ - public function dropSequence($sequenceName) - { - $sequenceName = $this->getFullQualifiedAssetName($sequenceName); - unset($this->_sequences[$sequenceName]); - return $this; - } - - /** - * Return an array of necessary sql queries to create the schema on the given platform. - * - * @param AbstractPlatform $platform - * @return array - */ - public function toSql(\Doctrine\DBAL\Platforms\AbstractPlatform $platform) - { - $sqlCollector = new CreateSchemaSqlCollector($platform); - $this->visit($sqlCollector); - - return $sqlCollector->getQueries(); - } - - /** - * Return an array of necessary sql queries to drop the schema on the given platform. - * - * @param AbstractPlatform $platform - * @return array - */ - public function toDropSql(\Doctrine\DBAL\Platforms\AbstractPlatform $platform) - { - $dropSqlCollector = new DropSchemaSqlCollector($platform); - $this->visit($dropSqlCollector); - - return $dropSqlCollector->getQueries(); - } - - /** - * @param Schema $toSchema - * @param AbstractPlatform $platform - */ - public function getMigrateToSql(Schema $toSchema, \Doctrine\DBAL\Platforms\AbstractPlatform $platform) - { - $comparator = new Comparator(); - $schemaDiff = $comparator->compare($this, $toSchema); - return $schemaDiff->toSql($platform); - } - - /** - * @param Schema $fromSchema - * @param AbstractPlatform $platform - */ - public function getMigrateFromSql(Schema $fromSchema, \Doctrine\DBAL\Platforms\AbstractPlatform $platform) - { - $comparator = new Comparator(); - $schemaDiff = $comparator->compare($fromSchema, $this); - return $schemaDiff->toSql($platform); - } - - /** - * @param Visitor $visitor - */ - public function visit(Visitor $visitor) - { - $visitor->acceptSchema($this); - - foreach ($this->_tables AS $table) { - $table->visit($visitor); - } - foreach ($this->_sequences AS $sequence) { - $sequence->visit($visitor); - } - } - - /** - * Cloning a Schema triggers a deep clone of all related assets. - * - * @return void - */ - public function __clone() - { - foreach ($this->_tables AS $k => $table) { - $this->_tables[$k] = clone $table; - } - foreach ($this->_sequences AS $k => $sequence) { - $this->_sequences[$k] = clone $sequence; - } - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaConfig.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaConfig.php deleted file mode 100644 index d4961f4..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaConfig.php +++ /dev/null @@ -1,98 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema; - -/** - * Configuration for a Schema - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - */ -class SchemaConfig -{ - /** - * @var bool - */ - protected $_hasExplicitForeignKeyIndexes = false; - - /** - * @var int - */ - protected $_maxIdentifierLength = 63; - - /** - * @var string - */ - protected $_name; - - /** - * @return bool - */ - public function hasExplicitForeignKeyIndexes() - { - return $this->_hasExplicitForeignKeyIndexes; - } - - /** - * @param bool $flag - */ - public function setExplicitForeignKeyIndexes($flag) - { - $this->_hasExplicitForeignKeyIndexes = (bool)$flag; - } - - /** - * @param int $length - */ - public function setMaxIdentifierLength($length) - { - $this->_maxIdentifierLength = (int)$length; - } - - /** - * @return int - */ - public function getMaxIdentifierLength() - { - return $this->_maxIdentifierLength; - } - - /** - * Get default namespace of schema objects. - * - * @return string - */ - public function getName() - { - return $this->_name; - } - - /** - * set default namespace name of schema objects. - * - * @param _name the value to set. - */ - public function setName($name) - { - $this->_name = $name; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaDiff.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaDiff.php deleted file mode 100644 index 64033c1..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaDiff.php +++ /dev/null @@ -1,176 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema; - -use \Doctrine\DBAL\Platforms\AbstractPlatform; - -/** - * Schema Diff - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @copyright Copyright (C) 2005-2009 eZ Systems AS. All rights reserved. - * @license http://ez.no/licenses/new_bsd New BSD License - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - */ -class SchemaDiff -{ - /** - * All added tables - * - * @var array(string=>ezcDbSchemaTable) - */ - public $newTables = array(); - - /** - * All changed tables - * - * @var array(string=>ezcDbSchemaTableDiff) - */ - public $changedTables = array(); - - /** - * All removed tables - * - * @var array(string=>Table) - */ - public $removedTables = array(); - - /** - * @var array - */ - public $newSequences = array(); - - /** - * @var array - */ - public $changedSequences = array(); - - /** - * @var array - */ - public $removedSequences = array(); - - /** - * @var array - */ - public $orphanedForeignKeys = array(); - - /** - * Constructs an SchemaDiff object. - * - * @param array(string=>Table) $newTables - * @param array(string=>TableDiff) $changedTables - * @param array(string=>bool) $removedTables - */ - public function __construct($newTables = array(), $changedTables = array(), $removedTables = array()) - { - $this->newTables = $newTables; - $this->changedTables = $changedTables; - $this->removedTables = $removedTables; - } - - /** - * The to save sql mode ensures that the following things don't happen: - * - * 1. Tables are deleted - * 2. Sequences are deleted - * 3. Foreign Keys which reference tables that would otherwise be deleted. - * - * This way it is ensured that assets are deleted which might not be relevant to the metadata schema at all. - * - * @param AbstractPlatform $platform - * @return array - */ - public function toSaveSql(AbstractPlatform $platform) - { - return $this->_toSql($platform, true); - } - - /** - * @param AbstractPlatform $platform - * @return array - */ - public function toSql(AbstractPlatform $platform) - { - return $this->_toSql($platform, false); - } - - /** - * @param AbstractPlatform $platform - * @param bool $saveMode - * @return array - */ - protected function _toSql(AbstractPlatform $platform, $saveMode = false) - { - $sql = array(); - - if ($platform->supportsForeignKeyConstraints() && $saveMode == false) { - foreach ($this->orphanedForeignKeys AS $orphanedForeignKey) { - $sql[] = $platform->getDropForeignKeySQL($orphanedForeignKey, $orphanedForeignKey->getLocalTableName()); - } - } - - if ($platform->supportsSequences() == true) { - foreach ($this->changedSequences AS $sequence) { - $sql[] = $platform->getAlterSequenceSQL($sequence); - } - - if ($saveMode === false) { - foreach ($this->removedSequences AS $sequence) { - $sql[] = $platform->getDropSequenceSQL($sequence); - } - } - - foreach ($this->newSequences AS $sequence) { - $sql[] = $platform->getCreateSequenceSQL($sequence); - } - } - - $foreignKeySql = array(); - foreach ($this->newTables AS $table) { - $sql = array_merge( - $sql, - $platform->getCreateTableSQL($table, AbstractPlatform::CREATE_INDEXES) - ); - - if ($platform->supportsForeignKeyConstraints()) { - foreach ($table->getForeignKeys() AS $foreignKey) { - $foreignKeySql[] = $platform->getCreateForeignKeySQL($foreignKey, $table); - } - } - } - $sql = array_merge($sql, $foreignKeySql); - - if ($saveMode === false) { - foreach ($this->removedTables AS $table) { - $sql[] = $platform->getDropTableSQL($table); - } - } - - foreach ($this->changedTables AS $tableDiff) { - $sql = array_merge($sql, $platform->getAlterTableSQL($tableDiff)); - } - - return $sql; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaException.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaException.php deleted file mode 100644 index a8cb93d..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaException.php +++ /dev/null @@ -1,126 +0,0 @@ -getName()." requires a named foreign key, ". - "but the given foreign key from (".implode(", ", $foreignKey->getColumns()).") onto foreign table ". - "'".$foreignKey->getForeignTableName()."' (".implode(", ", $foreignKey->getForeignColumns()).") is currently ". - "unnamed." - ); - } - - static public function alterTableChangeNotSupported($changeName) { - return new self ("Alter table change not supported, given '$changeName'"); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Sequence.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Sequence.php deleted file mode 100644 index 6344cc7..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Sequence.php +++ /dev/null @@ -1,87 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema; - -use Doctrine\DBAL\Schema\Visitor\Visitor; - -/** - * Sequence Structure - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - */ -class Sequence extends AbstractAsset -{ - /** - * @var int - */ - protected $_allocationSize = 1; - - /** - * @var int - */ - protected $_initialValue = 1; - - /** - * - * @param string $name - * @param int $allocationSize - * @param int $initialValue - */ - public function __construct($name, $allocationSize=1, $initialValue=1) - { - $this->_setName($name); - $this->_allocationSize = (is_numeric($allocationSize))?$allocationSize:1; - $this->_initialValue = (is_numeric($initialValue))?$initialValue:1; - } - - public function getAllocationSize() - { - return $this->_allocationSize; - } - - public function getInitialValue() - { - return $this->_initialValue; - } - - public function setAllocationSize($allocationSize) - { - $this->_allocationSize = (is_numeric($allocationSize))?$allocationSize:1; - } - - public function setInitialValue($initialValue) - { - $this->_initialValue = (is_numeric($initialValue))?$initialValue:1; - } - - /** - * @param Visitor $visitor - */ - public function visit(Visitor $visitor) - { - $visitor->acceptSequence($this); - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php deleted file mode 100644 index 9e91299..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php +++ /dev/null @@ -1,190 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema; - -/** - * SqliteSchemaManager - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @author Konsta Vesterinen - * @author Lukas Smith (PEAR MDB2 library) - * @author Jonathan H. Wage - * @version $Revision$ - * @since 2.0 - */ -class SqliteSchemaManager extends AbstractSchemaManager -{ - /** - * {@inheritdoc} - * - * @override - */ - public function dropDatabase($database) - { - if (file_exists($database)) { - unlink($database); - } - } - - /** - * {@inheritdoc} - * - * @override - */ - public function createDatabase($database) - { - $params = $this->_conn->getParams(); - $driver = $params['driver']; - $options = array( - 'driver' => $driver, - 'path' => $database - ); - $conn = \Doctrine\DBAL\DriverManager::getConnection($options); - $conn->connect(); - $conn->close(); - } - - protected function _getPortableTableDefinition($table) - { - return $table['name']; - } - - /** - * @license New BSD License - * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html - * @param array $tableIndexes - * @param string $tableName - * @return array - */ - protected function _getPortableTableIndexesList($tableIndexes, $tableName=null) - { - $indexBuffer = array(); - - // fetch primary - $stmt = $this->_conn->executeQuery( "PRAGMA TABLE_INFO ('$tableName')" ); - $indexArray = $stmt->fetchAll(\PDO::FETCH_ASSOC); - foreach($indexArray AS $indexColumnRow) { - if($indexColumnRow['pk'] == "1") { - $indexBuffer[] = array( - 'key_name' => 'primary', - 'primary' => true, - 'non_unique' => false, - 'column_name' => $indexColumnRow['name'] - ); - } - } - - // fetch regular indexes - foreach($tableIndexes AS $tableIndex) { - // Ignore indexes with reserved names, e.g. autoindexes - if (strpos($tableIndex['name'], 'sqlite_') !== 0) { - $keyName = $tableIndex['name']; - $idx = array(); - $idx['key_name'] = $keyName; - $idx['primary'] = false; - $idx['non_unique'] = $tableIndex['unique']?false:true; - - $stmt = $this->_conn->executeQuery( "PRAGMA INDEX_INFO ( '{$keyName}' )" ); - $indexArray = $stmt->fetchAll(\PDO::FETCH_ASSOC); - - foreach ( $indexArray as $indexColumnRow ) { - $idx['column_name'] = $indexColumnRow['name']; - $indexBuffer[] = $idx; - } - } - } - - return parent::_getPortableTableIndexesList($indexBuffer, $tableName); - } - - protected function _getPortableTableIndexDefinition($tableIndex) - { - return array( - 'name' => $tableIndex['name'], - 'unique' => (bool) $tableIndex['unique'] - ); - } - - protected function _getPortableTableColumnDefinition($tableColumn) - { - $e = explode('(', $tableColumn['type']); - $tableColumn['type'] = $e[0]; - if (isset($e[1])) { - $length = trim($e[1], ')'); - $tableColumn['length'] = $length; - } - - $dbType = strtolower($tableColumn['type']); - $length = isset($tableColumn['length']) ? $tableColumn['length'] : null; - $unsigned = (boolean) isset($tableColumn['unsigned']) ? $tableColumn['unsigned'] : false; - $fixed = false; - $type = $this->_platform->getDoctrineTypeMapping($dbType); - $default = $tableColumn['dflt_value']; - if ($default == 'NULL') { - $default = null; - } - if ($default !== null) { - // SQLite returns strings wrapped in single quotes, so we need to strip them - $default = preg_replace("/^'(.*)'$/", '\1', $default); - } - $notnull = (bool) $tableColumn['notnull']; - - if ( ! isset($tableColumn['name'])) { - $tableColumn['name'] = ''; - } - - $precision = null; - $scale = null; - - switch ($dbType) { - case 'char': - $fixed = true; - break; - case 'float': - case 'double': - case 'real': - case 'decimal': - case 'numeric': - if (isset($tableColumn['length'])) { - list($precision, $scale) = array_map('trim', explode(', ', $tableColumn['length'])); - } - $length = null; - break; - } - - $options = array( - 'length' => $length, - 'unsigned' => (bool) $unsigned, - 'fixed' => $fixed, - 'notnull' => $notnull, - 'default' => $default, - 'precision' => $precision, - 'scale' => $scale, - 'autoincrement' => false, - ); - - return new Column($tableColumn['name'], \Doctrine\DBAL\Types\Type::getType($type), $options); - } - - protected function _getPortableViewDefinition($view) - { - return new View($view['name'], $view['sql']); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Table.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Table.php deleted file mode 100644 index b7e3d04..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Table.php +++ /dev/null @@ -1,645 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema; - -use Doctrine\DBAL\Types\Type; -use Doctrine\DBAL\Schema\Visitor\Visitor; -use Doctrine\DBAL\DBALException; - -/** - * Object Representation of a table - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - */ -class Table extends AbstractAsset -{ - /** - * @var string - */ - protected $_name = null; - - /** - * @var array - */ - protected $_columns = array(); - - /** - * @var array - */ - protected $_indexes = array(); - - /** - * @var string - */ - protected $_primaryKeyName = false; - - /** - * @var array - */ - protected $_fkConstraints = array(); - - /** - * @var array - */ - protected $_options = array(); - - /** - * @var SchemaConfig - */ - protected $_schemaConfig = null; - - /** - * - * @param string $tableName - * @param array $columns - * @param array $indexes - * @param array $fkConstraints - * @param int $idGeneratorType - * @param array $options - */ - public function __construct($tableName, array $columns=array(), array $indexes=array(), array $fkConstraints=array(), $idGeneratorType = 0, array $options=array()) - { - if (strlen($tableName) == 0) { - throw DBALException::invalidTableName($tableName); - } - - $this->_setName($tableName); - $this->_idGeneratorType = $idGeneratorType; - - foreach ($columns AS $column) { - $this->_addColumn($column); - } - - foreach ($indexes AS $idx) { - $this->_addIndex($idx); - } - - foreach ($fkConstraints AS $constraint) { - $this->_addForeignKeyConstraint($constraint); - } - - $this->_options = $options; - } - - /** - * @param SchemaConfig $schemaConfig - */ - public function setSchemaConfig(SchemaConfig $schemaConfig) - { - $this->_schemaConfig = $schemaConfig; - } - - /** - * @return int - */ - protected function _getMaxIdentifierLength() - { - if ($this->_schemaConfig instanceof SchemaConfig) { - return $this->_schemaConfig->getMaxIdentifierLength(); - } else { - return 63; - } - } - - /** - * Set Primary Key - * - * @param array $columns - * @param string $indexName - * @return Table - */ - public function setPrimaryKey(array $columns, $indexName = false) - { - $primaryKey = $this->_createIndex($columns, $indexName ?: "primary", true, true); - - foreach ($columns AS $columnName) { - $column = $this->getColumn($columnName); - $column->setNotnull(true); - } - - return $primaryKey; - } - - /** - * @param array $columnNames - * @param string $indexName - * @return Table - */ - public function addIndex(array $columnNames, $indexName = null) - { - if($indexName == null) { - $indexName = $this->_generateIdentifierName( - array_merge(array($this->getName()), $columnNames), "idx", $this->_getMaxIdentifierLength() - ); - } - - return $this->_createIndex($columnNames, $indexName, false, false); - } - - /** - * - * @param array $columnNames - * @param string $indexName - * @return Table - */ - public function addUniqueIndex(array $columnNames, $indexName = null) - { - if ($indexName === null) { - $indexName = $this->_generateIdentifierName( - array_merge(array($this->getName()), $columnNames), "uniq", $this->_getMaxIdentifierLength() - ); - } - - return $this->_createIndex($columnNames, $indexName, true, false); - } - - /** - * Check if an index begins in the order of the given columns. - * - * @param array $columnsNames - * @return bool - */ - public function columnsAreIndexed(array $columnsNames) - { - foreach ($this->getIndexes() AS $index) { - /* @var $index Index */ - if ($index->spansColumns($columnsNames)) { - return true; - } - } - return false; - } - - /** - * - * @param array $columnNames - * @param string $indexName - * @param bool $isUnique - * @param bool $isPrimary - * @return Table - */ - private function _createIndex(array $columnNames, $indexName, $isUnique, $isPrimary) - { - if (preg_match('(([^a-zA-Z0-9_]+))', $indexName)) { - throw SchemaException::indexNameInvalid($indexName); - } - - foreach ($columnNames AS $columnName => $indexColOptions) { - if (is_numeric($columnName) && is_string($indexColOptions)) { - $columnName = $indexColOptions; - } - - if ( ! $this->hasColumn($columnName)) { - throw SchemaException::columnDoesNotExist($columnName, $this->_name); - } - } - $this->_addIndex(new Index($indexName, $columnNames, $isUnique, $isPrimary)); - return $this; - } - - /** - * @param string $columnName - * @param string $columnType - * @param array $options - * @return Column - */ - public function addColumn($columnName, $typeName, array $options=array()) - { - $column = new Column($columnName, Type::getType($typeName), $options); - - $this->_addColumn($column); - return $column; - } - - /** - * Rename Column - * - * @param string $oldColumnName - * @param string $newColumnName - * @return Table - */ - public function renameColumn($oldColumnName, $newColumnName) - { - $column = $this->getColumn($oldColumnName); - $this->dropColumn($oldColumnName); - - $column->_setName($newColumnName); - return $this; - } - - /** - * Change Column Details - * - * @param string $columnName - * @param array $options - * @return Table - */ - public function changeColumn($columnName, array $options) - { - $column = $this->getColumn($columnName); - $column->setOptions($options); - return $this; - } - - /** - * Drop Column from Table - * - * @param string $columnName - * @return Table - */ - public function dropColumn($columnName) - { - $columnName = strtolower($columnName); - $column = $this->getColumn($columnName); - unset($this->_columns[$columnName]); - return $this; - } - - - /** - * Add a foreign key constraint - * - * Name is inferred from the local columns - * - * @param Table $foreignTable - * @param array $localColumns - * @param array $foreignColumns - * @param array $options - * @param string $constraintName - * @return Table - */ - public function addForeignKeyConstraint($foreignTable, array $localColumnNames, array $foreignColumnNames, array $options=array(), $constraintName = null) - { - $constraintName = $constraintName ?: $this->_generateIdentifierName(array_merge((array)$this->getName(), $localColumnNames), "fk", $this->_getMaxIdentifierLength()); - return $this->addNamedForeignKeyConstraint($constraintName, $foreignTable, $localColumnNames, $foreignColumnNames, $options); - } - - /** - * Add a foreign key constraint - * - * Name is to be generated by the database itsself. - * - * @deprecated Use {@link addForeignKeyConstraint} - * @param Table $foreignTable - * @param array $localColumns - * @param array $foreignColumns - * @param array $options - * @return Table - */ - public function addUnnamedForeignKeyConstraint($foreignTable, array $localColumnNames, array $foreignColumnNames, array $options=array()) - { - return $this->addForeignKeyConstraint($foreignTable, $localColumnNames, $foreignColumnNames, $options); - } - - /** - * Add a foreign key constraint with a given name - * - * @deprecated Use {@link addForeignKeyConstraint} - * @param string $name - * @param Table $foreignTable - * @param array $localColumns - * @param array $foreignColumns - * @param array $options - * @return Table - */ - public function addNamedForeignKeyConstraint($name, $foreignTable, array $localColumnNames, array $foreignColumnNames, array $options=array()) - { - if ($foreignTable instanceof Table) { - $foreignTableName = $foreignTable->getName(); - - foreach ($foreignColumnNames AS $columnName) { - if ( ! $foreignTable->hasColumn($columnName)) { - throw SchemaException::columnDoesNotExist($columnName, $foreignTable->getName()); - } - } - } else { - $foreignTableName = $foreignTable; - } - - foreach ($localColumnNames AS $columnName) { - if ( ! $this->hasColumn($columnName)) { - throw SchemaException::columnDoesNotExist($columnName, $this->_name); - } - } - - $constraint = new ForeignKeyConstraint( - $localColumnNames, $foreignTableName, $foreignColumnNames, $name, $options - ); - $this->_addForeignKeyConstraint($constraint); - - return $this; - } - - /** - * @param string $name - * @param string $value - * @return Table - */ - public function addOption($name, $value) - { - $this->_options[$name] = $value; - return $this; - } - - /** - * @param Column $column - */ - protected function _addColumn(Column $column) - { - $columnName = $column->getName(); - $columnName = strtolower($columnName); - - if (isset($this->_columns[$columnName])) { - throw SchemaException::columnAlreadyExists($this->getName(), $columnName); - } - - $this->_columns[$columnName] = $column; - } - - /** - * Add index to table - * - * @param Index $indexCandidate - * @return Table - */ - protected function _addIndex(Index $indexCandidate) - { - // check for duplicates - foreach ($this->_indexes AS $existingIndex) { - if ($indexCandidate->isFullfilledBy($existingIndex)) { - return $this; - } - } - - $indexName = $indexCandidate->getName(); - $indexName = strtolower($indexName); - - if (isset($this->_indexes[$indexName]) || ($this->_primaryKeyName != false && $indexCandidate->isPrimary())) { - throw SchemaException::indexAlreadyExists($indexName, $this->_name); - } - - // remove overruled indexes - foreach ($this->_indexes AS $idxKey => $existingIndex) { - if ($indexCandidate->overrules($existingIndex)) { - unset($this->_indexes[$idxKey]); - } - } - - if ($indexCandidate->isPrimary()) { - $this->_primaryKeyName = $indexName; - } - - $this->_indexes[$indexName] = $indexCandidate; - return $this; - } - - /** - * @param ForeignKeyConstraint $constraint - */ - protected function _addForeignKeyConstraint(ForeignKeyConstraint $constraint) - { - $constraint->setLocalTable($this); - - if(strlen($constraint->getName())) { - $name = $constraint->getName(); - } else { - $name = $this->_generateIdentifierName( - array_merge((array)$this->getName(), $constraint->getLocalColumns()), "fk", $this->_getMaxIdentifierLength() - ); - } - $name = strtolower($name); - - $this->_fkConstraints[$name] = $constraint; - // add an explicit index on the foreign key columns. If there is already an index that fullfils this requirements drop the request. - // In the case of __construct calling this method during hydration from schema-details all the explicitly added indexes - // lead to duplicates. This creates compuation overhead in this case, however no duplicate indexes are ever added (based on columns). - $this->addIndex($constraint->getColumns()); - } - - /** - * Does Table have a foreign key constraint with the given name? - * * - * @param string $constraintName - * @return bool - */ - public function hasForeignKey($constraintName) - { - $constraintName = strtolower($constraintName); - return isset($this->_fkConstraints[$constraintName]); - } - - /** - * @param string $constraintName - * @return ForeignKeyConstraint - */ - public function getForeignKey($constraintName) - { - $constraintName = strtolower($constraintName); - if(!$this->hasForeignKey($constraintName)) { - throw SchemaException::foreignKeyDoesNotExist($constraintName, $this->_name); - } - - return $this->_fkConstraints[$constraintName]; - } - - public function removeForeignKey($constraintName) - { - $constraintName = strtolower($constraintName); - if(!$this->hasForeignKey($constraintName)) { - throw SchemaException::foreignKeyDoesNotExist($constraintName, $this->_name); - } - - unset($this->_fkConstraints[$constraintName]); - } - - /** - * @return Column[] - */ - public function getColumns() - { - $columns = $this->_columns; - - $pkCols = array(); - $fkCols = array(); - - if ($this->hasPrimaryKey()) { - $pkCols = $this->getPrimaryKey()->getColumns(); - } - foreach ($this->getForeignKeys() AS $fk) { - /* @var $fk ForeignKeyConstraint */ - $fkCols = array_merge($fkCols, $fk->getColumns()); - } - $colNames = array_unique(array_merge($pkCols, $fkCols, array_keys($columns))); - - uksort($columns, function($a, $b) use($colNames) { - return (array_search($a, $colNames) >= array_search($b, $colNames)); - }); - return $columns; - } - - - /** - * Does this table have a column with the given name? - * - * @param string $columnName - * @return bool - */ - public function hasColumn($columnName) - { - $columnName = $this->trimQuotes(strtolower($columnName)); - return isset($this->_columns[$columnName]); - } - - /** - * Get a column instance - * - * @param string $columnName - * @return Column - */ - public function getColumn($columnName) - { - $columnName = strtolower($this->trimQuotes($columnName)); - if (!$this->hasColumn($columnName)) { - throw SchemaException::columnDoesNotExist($columnName, $this->_name); - } - - return $this->_columns[$columnName]; - } - - /** - * @return Index|null - */ - public function getPrimaryKey() - { - if (!$this->hasPrimaryKey()) { - return null; - } - return $this->getIndex($this->_primaryKeyName); - } - - /** - * Check if this table has a primary key. - * - * @return bool - */ - public function hasPrimaryKey() - { - return ($this->_primaryKeyName && $this->hasIndex($this->_primaryKeyName)); - } - - /** - * @param string $indexName - * @return bool - */ - public function hasIndex($indexName) - { - $indexName = strtolower($indexName); - return (isset($this->_indexes[$indexName])); - } - - /** - * @param string $indexName - * @return Index - */ - public function getIndex($indexName) - { - $indexName = strtolower($indexName); - if (!$this->hasIndex($indexName)) { - throw SchemaException::indexDoesNotExist($indexName, $this->_name); - } - return $this->_indexes[$indexName]; - } - - /** - * @return array - */ - public function getIndexes() - { - return $this->_indexes; - } - - /** - * Get Constraints - * - * @return array - */ - public function getForeignKeys() - { - return $this->_fkConstraints; - } - - public function hasOption($name) - { - return isset($this->_options[$name]); - } - - public function getOption($name) - { - return $this->_options[$name]; - } - - public function getOptions() - { - return $this->_options; - } - - /** - * @param Visitor $visitor - */ - public function visit(Visitor $visitor) - { - $visitor->acceptTable($this); - - foreach ($this->getColumns() AS $column) { - $visitor->acceptColumn($this, $column); - } - - foreach ($this->getIndexes() AS $index) { - $visitor->acceptIndex($this, $index); - } - - foreach ($this->getForeignKeys() AS $constraint) { - $visitor->acceptForeignKey($this, $constraint); - } - } - - /** - * Clone of a Table triggers a deep clone of all affected assets - */ - public function __clone() - { - foreach ($this->_columns AS $k => $column) { - $this->_columns[$k] = clone $column; - } - foreach ($this->_indexes AS $k => $index) { - $this->_indexes[$k] = clone $index; - } - foreach ($this->_fkConstraints AS $k => $fk) { - $this->_fkConstraints[$k] = clone $fk; - $this->_fkConstraints[$k]->setLocalTable($this); - } - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/TableDiff.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/TableDiff.php deleted file mode 100644 index 5f99ce2..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/TableDiff.php +++ /dev/null @@ -1,136 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema; - -/** - * Table Diff - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @copyright Copyright (C) 2005-2009 eZ Systems AS. All rights reserved. - * @license http://ez.no/licenses/new_bsd New BSD License - * @since 2.0 - * @author Benjamin Eberlei - */ -class TableDiff -{ - /** - * @var string - */ - public $name = null; - - /** - * @var string - */ - public $newName = false; - - /** - * All added fields - * - * @var array(string=>Column) - */ - public $addedColumns; - - /** - * All changed fields - * - * @var array(string=>Column) - */ - public $changedColumns = array(); - - /** - * All removed fields - * - * @var array(string=>Column) - */ - public $removedColumns = array(); - - /** - * Columns that are only renamed from key to column instance name. - * - * @var array(string=>Column) - */ - public $renamedColumns = array(); - - /** - * All added indexes - * - * @var array(string=>Index) - */ - public $addedIndexes = array(); - - /** - * All changed indexes - * - * @var array(string=>Index) - */ - public $changedIndexes = array(); - - /** - * All removed indexes - * - * @var array(string=>bool) - */ - public $removedIndexes = array(); - - /** - * All added foreign key definitions - * - * @var array - */ - public $addedForeignKeys = array(); - - /** - * All changed foreign keys - * - * @var array - */ - public $changedForeignKeys = array(); - - /** - * All removed foreign keys - * - * @var array - */ - public $removedForeignKeys = array(); - - /** - * Constructs an TableDiff object. - * - * @param array(string=>Column) $addedColumns - * @param array(string=>Column) $changedColumns - * @param array(string=>bool) $removedColumns - * @param array(string=>Index) $addedIndexes - * @param array(string=>Index) $changedIndexes - * @param array(string=>bool) $removedIndexes - */ - public function __construct($tableName, $addedColumns = array(), - $changedColumns = array(), $removedColumns = array(), $addedIndexes = array(), - $changedIndexes = array(), $removedIndexes = array()) - { - $this->name = $tableName; - $this->addedColumns = $addedColumns; - $this->changedColumns = $changedColumns; - $this->removedColumns = $removedColumns; - $this->addedIndexes = $addedIndexes; - $this->changedIndexes = $changedIndexes; - $this->removedIndexes = $removedIndexes; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/View.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/View.php deleted file mode 100644 index 4a8329d..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/View.php +++ /dev/null @@ -1,53 +0,0 @@ -. -*/ - -namespace Doctrine\DBAL\Schema; - -/** - * Representation of a Database View - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 1.0 - * @version $Revision$ - * @author Benjamin Eberlei - */ -class View extends AbstractAsset -{ - /** - * @var string - */ - private $_sql; - - public function __construct($name, $sql) - { - $this->_setName($name); - $this->_sql = $sql; - } - - /** - * @return string - */ - public function getSql() - { - return $this->_sql; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php deleted file mode 100644 index d0a5ac4..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php +++ /dev/null @@ -1,147 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema\Visitor; - -use Doctrine\DBAL\Platforms\AbstractPlatform, - Doctrine\DBAL\Schema\Table, - Doctrine\DBAL\Schema\Schema, - Doctrine\DBAL\Schema\Column, - Doctrine\DBAL\Schema\ForeignKeyConstraint, - Doctrine\DBAL\Schema\Constraint, - Doctrine\DBAL\Schema\Sequence, - Doctrine\DBAL\Schema\Index; - -class CreateSchemaSqlCollector implements Visitor -{ - /** - * @var array - */ - private $_createTableQueries = array(); - - /** - * @var array - */ - private $_createSequenceQueries = array(); - - /** - * @var array - */ - private $_createFkConstraintQueries = array(); - - /** - * - * @var \Doctrine\DBAL\Platforms\AbstractPlatform - */ - private $_platform = null; - - /** - * @param AbstractPlatform $platform - */ - public function __construct(AbstractPlatform $platform) - { - $this->_platform = $platform; - } - - /** - * @param Schema $schema - */ - public function acceptSchema(Schema $schema) - { - - } - - /** - * Generate DDL Statements to create the accepted table with all its dependencies. - * - * @param Table $table - */ - public function acceptTable(Table $table) - { - $this->_createTableQueries = array_merge($this->_createTableQueries, - $this->_platform->getCreateTableSQL($table) - ); - } - - public function acceptColumn(Table $table, Column $column) - { - - } - - /** - * @param Table $localTable - * @param ForeignKeyConstraint $fkConstraint - */ - public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) - { - // Append the foreign key constraints SQL - if ($this->_platform->supportsForeignKeyConstraints()) { - $this->_createFkConstraintQueries = array_merge($this->_createFkConstraintQueries, - (array) $this->_platform->getCreateForeignKeySQL( - $fkConstraint, $localTable - ) - ); - } - } - - /** - * @param Table $table - * @param Index $index - */ - public function acceptIndex(Table $table, Index $index) - { - - } - - /** - * @param Sequence $sequence - */ - public function acceptSequence(Sequence $sequence) - { - $this->_createSequenceQueries = array_merge( - $this->_createSequenceQueries, (array)$this->_platform->getCreateSequenceSQL($sequence) - ); - } - - /** - * @return array - */ - public function resetQueries() - { - $this->_createTableQueries = array(); - $this->_createSequenceQueries = array(); - $this->_createFkConstraintQueries = array(); - } - - /** - * Get all queries collected so far. - * - * @return array - */ - public function getQueries() - { - return array_merge( - $this->_createTableQueries, - $this->_createSequenceQueries, - $this->_createFkConstraintQueries - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/DropSchemaSqlCollector.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/DropSchemaSqlCollector.php deleted file mode 100644 index f59a7ea..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/DropSchemaSqlCollector.php +++ /dev/null @@ -1,159 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema\Visitor; - -use Doctrine\DBAL\Platforms\AbstractPlatform, - Doctrine\DBAL\Schema\Table, - Doctrine\DBAL\Schema\Schema, - Doctrine\DBAL\Schema\Column, - Doctrine\DBAL\Schema\ForeignKeyConstraint, - Doctrine\DBAL\Schema\Constraint, - Doctrine\DBAL\Schema\Sequence, - Doctrine\DBAL\Schema\Index; - -/** - * Gather SQL statements that allow to completly drop the current schema. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - */ -class DropSchemaSqlCollector implements Visitor -{ - /** - * @var \SplObjectStorage - */ - private $constraints; - - /** - * @var \SplObjectStorage - */ - private $sequences; - - /** - * @var \SplObjectStorage - */ - private $tables; - - /** - * - * @var \Doctrine\DBAL\Platforms\AbstractPlatform - */ - private $platform; - - /** - * @param AbstractPlatform $platform - */ - public function __construct(AbstractPlatform $platform) - { - $this->platform = $platform; - $this->clearQueries(); - } - - /** - * @param Schema $schema - */ - public function acceptSchema(Schema $schema) - { - - } - - /** - * @param Table $table - */ - public function acceptTable(Table $table) - { - $this->tables->attach($table); - } - - /** - * @param Column $column - */ - public function acceptColumn(Table $table, Column $column) - { - - } - - /** - * @param Table $localTable - * @param ForeignKeyConstraint $fkConstraint - */ - public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) - { - if (strlen($fkConstraint->getName()) == 0) { - throw SchemaException::namedForeignKeyRequired($localTable, $fkConstraint); - } - - $this->constraints->attach($fkConstraint); - $this->constraints[$fkConstraint] = $localTable; - } - - /** - * @param Table $table - * @param Index $index - */ - public function acceptIndex(Table $table, Index $index) - { - - } - - /** - * @param Sequence $sequence - */ - public function acceptSequence(Sequence $sequence) - { - $this->sequences->attach($sequence); - } - - /** - * @return void - */ - public function clearQueries() - { - $this->constraints = new \SplObjectStorage(); - $this->sequences = new \SplObjectStorage(); - $this->tables = new \SplObjectStorage(); - } - - /** - * @return array - */ - public function getQueries() - { - $sql = array(); - foreach ($this->constraints AS $fkConstraint) { - $localTable = $this->constraints[$fkConstraint]; - $sql[] = $this->platform->getDropForeignKeySQL($fkConstraint, $localTable); - } - - foreach ($this->sequences AS $sequence) { - $sql[] = $this->platform->getDropSequenceSQL($sequence); - } - - foreach ($this->tables AS $table) { - $sql[] = $this->platform->getDropTableSQL($table); - } - - return $sql; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/Graphviz.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/Graphviz.php deleted file mode 100644 index 762f551..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/Graphviz.php +++ /dev/null @@ -1,151 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema\Visitor; - -use Doctrine\DBAL\Platforms\AbstractPlatform, - Doctrine\DBAL\Schema\Table, - Doctrine\DBAL\Schema\Schema, - Doctrine\DBAL\Schema\Column, - Doctrine\DBAL\Schema\ForeignKeyConstraint, - Doctrine\DBAL\Schema\Constraint, - Doctrine\DBAL\Schema\Sequence, - Doctrine\DBAL\Schema\Index; - -class Graphviz implements \Doctrine\DBAL\Schema\Visitor\Visitor -{ - private $output = ''; - - public function acceptColumn(Table $table, Column $column) - { - - } - - public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) - { - $this->output .= $this->createNodeRelation( - $fkConstraint->getLocalTableName() . ":col" . current($fkConstraint->getLocalColumns()).":se", - $fkConstraint->getForeignTableName() . ":col" . current($fkConstraint->getForeignColumns()).":se", - array( - 'dir' => 'back', - 'arrowtail' => 'dot', - 'arrowhead' => 'normal', - ) - ); - } - - public function acceptIndex(Table $table, Index $index) - { - - } - - public function acceptSchema(Schema $schema) - { - $this->output = 'digraph "' . sha1( mt_rand() ) . '" {' . "\n"; - $this->output .= 'splines = true;' . "\n"; - $this->output .= 'overlap = false;' . "\n"; - $this->output .= 'outputorder=edgesfirst;'."\n"; - $this->output .= 'mindist = 0.6;' . "\n"; - $this->output .= 'sep = .2;' . "\n"; - } - - public function acceptSequence(Sequence $sequence) - { - - } - - public function acceptTable(Table $table) - { - $this->output .= $this->createNode( - $table->getName(), - array( - 'label' => $this->createTableLabel( $table ), - 'shape' => 'plaintext', - ) - ); - } - - private function createTableLabel( Table $table ) - { - // Start the table - $label = '<'; - - // The title - $label .= ''; - - // The attributes block - foreach( $table->getColumns() as $column ) { - $columnLabel = $column->getName(); - - $label .= ''; - $label .= ''; - $label .= ''; - } - - // End the table - $label .= '
' . $table->getName() . '
'; - $label .= '' . $columnLabel . ''; - $label .= '' . strtolower($column->getType()) . ''; - if ($table->hasPrimaryKey() && in_array($column->getName(), $table->getPrimaryKey()->getColumns())) { - $label .= "\xe2\x9c\xb7"; - } - $label .= '
>'; - - return $label; - } - - private function createNode( $name, $options ) - { - $node = $name . " ["; - foreach( $options as $key => $value ) - { - $node .= $key . '=' . $value . ' '; - } - $node .= "]\n"; - return $node; - } - - private function createNodeRelation( $node1, $node2, $options ) - { - $relation = $node1 . ' -> ' . $node2 . ' ['; - foreach( $options as $key => $value ) - { - $relation .= $key . '=' . $value . ' '; - } - $relation .= "]\n"; - return $relation; - } - - /** - * Write dot language output to a file. This should usually be a *.dot file. - * - * You have to convert the output into a viewable format. For example use "neato" on linux systems - * and execute: - * - * neato -Tpng -o er.png er.dot - * - * @param string $filename - * @return void - */ - public function write($filename) - { - file_put_contents($filename, $this->output . "}"); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/RemoveNamespacedAssets.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/RemoveNamespacedAssets.php deleted file mode 100644 index f5db5af..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/RemoveNamespacedAssets.php +++ /dev/null @@ -1,113 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema\Visitor; - -use Doctrine\DBAL\Platforms\AbstractPlatform, - Doctrine\DBAL\Schema\Table, - Doctrine\DBAL\Schema\Schema, - Doctrine\DBAL\Schema\Column, - Doctrine\DBAL\Schema\ForeignKeyConstraint, - Doctrine\DBAL\Schema\Constraint, - Doctrine\DBAL\Schema\Sequence, - Doctrine\DBAL\Schema\Index; - -/** - * Remove assets from a schema that are not in the default namespace. - * - * Some databases such as MySQL support cross databases joins, but don't - * allow to call DDLs to a database from another connected database. - * Before a schema is serialized into SQL this visitor can cleanup schemas with - * non default namespaces. - * - * This visitor filters all these non-default namespaced tables and sequences - * and removes them from the SChema instance. - * - * @author Benjamin Eberlei - * @since 2.2 - */ -class RemoveNamespacedAssets implements Visitor -{ - /** - * @var Schema - */ - private $schema; - - /** - * @param Schema $schema - */ - public function acceptSchema(Schema $schema) - { - $this->schema = $schema; - } - - /** - * @param Table $table - */ - public function acceptTable(Table $table) - { - if ( ! $table->isInDefaultNamespace($this->schema->getName()) ) { - $this->schema->dropTable($table->getName()); - } - } - /** - * @param Sequence $sequence - */ - public function acceptSequence(Sequence $sequence) - { - if ( ! $sequence->isInDefaultNamespace($this->schema->getName()) ) { - $this->schema->dropSequence($sequence->getName()); - } - } - - /** - * @param Column $column - */ - public function acceptColumn(Table $table, Column $column) - { - } - - /** - * @param Table $localTable - * @param ForeignKeyConstraint $fkConstraint - */ - public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) - { - // The table may already be deleted in a previous - // RemoveNamespacedAssets#acceptTable call. Removing Foreign keys that - // point to nowhere. - if ( ! $this->schema->hasTable($fkConstraint->getForeignTableName())) { - $localTable->removeForeignKey($fkConstraint->getName()); - return; - } - - $foreignTable = $this->schema->getTable($fkConstraint->getForeignTableName()); - if ( ! $foreignTable->isInDefaultNamespace($this->schema->getName()) ) { - $localTable->removeForeignKey($fkConstraint->getName()); - } - } - - /** - * @param Table $table - * @param Index $index - */ - public function acceptIndex(Table $table, Index $index) - { - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/Visitor.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/Visitor.php deleted file mode 100644 index 2dad80d..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/Visitor.php +++ /dev/null @@ -1,75 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Schema\Visitor; - -use Doctrine\DBAL\Platforms\AbstractPlatform, - Doctrine\DBAL\Schema\Table, - Doctrine\DBAL\Schema\Schema, - Doctrine\DBAL\Schema\Column, - Doctrine\DBAL\Schema\ForeignKeyConstraint, - Doctrine\DBAL\Schema\Constraint, - Doctrine\DBAL\Schema\Sequence, - Doctrine\DBAL\Schema\Index; - -/** - * Schema Visitor used for Validation or Generation purposes. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - */ -interface Visitor -{ - /** - * @param Schema $schema - */ - public function acceptSchema(Schema $schema); - - /** - * @param Table $table - */ - public function acceptTable(Table $table); - - /** - * @param Column $column - */ - public function acceptColumn(Table $table, Column $column); - - /** - * @param Table $localTable - * @param ForeignKeyConstraint $fkConstraint - */ - public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint); - - /** - * @param Table $table - * @param Index $index - */ - public function acceptIndex(Table $table, Index $index); - - /** - * @param Sequence $sequence - */ - public function acceptSequence(Sequence $sequence); -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php deleted file mode 100644 index cf625ad..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php +++ /dev/null @@ -1,247 +0,0 @@ -. - */ - -namespace Doctrine\DBAL; - -use PDO, - Doctrine\DBAL\Types\Type, - Doctrine\DBAL\Driver\Statement as DriverStatement; - -/** - * A thin wrapper around a Doctrine\DBAL\Driver\Statement that adds support - * for logging, DBAL mapping types, etc. - * - * @author Roman Borschel - * @since 2.0 - */ -class Statement implements \IteratorAggregate, DriverStatement -{ - /** - * @var string The SQL statement. - */ - protected $sql; - /** - * @var array The bound parameters. - */ - protected $params = array(); - /** - * @var Doctrine\DBAL\Driver\Statement The underlying driver statement. - */ - protected $stmt; - /** - * @var Doctrine\DBAL\Platforms\AbstractPlatform The underlying database platform. - */ - protected $platform; - /** - * @var Doctrine\DBAL\Connection The connection this statement is bound to and executed on. - */ - protected $conn; - - /** - * Creates a new Statement for the given SQL and Connection. - * - * @param string $sql The SQL of the statement. - * @param Doctrine\DBAL\Connection The connection on which the statement should be executed. - */ - public function __construct($sql, Connection $conn) - { - $this->sql = $sql; - $this->stmt = $conn->getWrappedConnection()->prepare($sql); - $this->conn = $conn; - $this->platform = $conn->getDatabasePlatform(); - } - - /** - * Binds a parameter value to the statement. - * - * The value can optionally be bound with a PDO binding type or a DBAL mapping type. - * If bound with a DBAL mapping type, the binding type is derived from the mapping - * type and the value undergoes the conversion routines of the mapping type before - * being bound. - * - * @param $name The name or position of the parameter. - * @param $value The value of the parameter. - * @param mixed $type Either a PDO binding type or a DBAL mapping type name or instance. - * @return boolean TRUE on success, FALSE on failure. - */ - public function bindValue($name, $value, $type = null) - { - $this->params[$name] = $value; - if ($type !== null) { - if (is_string($type)) { - $type = Type::getType($type); - } - if ($type instanceof Type) { - $value = $type->convertToDatabaseValue($value, $this->platform); - $bindingType = $type->getBindingType(); - } else { - $bindingType = $type; // PDO::PARAM_* constants - } - return $this->stmt->bindValue($name, $value, $bindingType); - } else { - return $this->stmt->bindValue($name, $value); - } - } - - /** - * Binds a parameter to a value by reference. - * - * Binding a parameter by reference does not support DBAL mapping types. - * - * @param string $name The name or position of the parameter. - * @param mixed $value The reference to the variable to bind - * @param integer $type The PDO binding type. - * @return boolean TRUE on success, FALSE on failure. - */ - public function bindParam($name, &$var, $type = PDO::PARAM_STR) - { - return $this->stmt->bindParam($name, $var, $type); - } - - /** - * Executes the statement with the currently bound parameters. - * - * @return boolean TRUE on success, FALSE on failure. - */ - public function execute($params = null) - { - $hasLogger = $this->conn->getConfiguration()->getSQLLogger(); - if ($hasLogger) { - $this->conn->getConfiguration()->getSQLLogger()->startQuery($this->sql, $this->params); - } - - $stmt = $this->stmt->execute($params); - - if ($hasLogger) { - $this->conn->getConfiguration()->getSQLLogger()->stopQuery(); - } - $this->params = array(); - return $stmt; - } - - /** - * Closes the cursor, freeing the database resources used by this statement. - * - * @return boolean TRUE on success, FALSE on failure. - */ - public function closeCursor() - { - return $this->stmt->closeCursor(); - } - - /** - * Returns the number of columns in the result set. - * - * @return integer - */ - public function columnCount() - { - return $this->stmt->columnCount(); - } - - /** - * Fetches the SQLSTATE associated with the last operation on the statement. - * - * @return string - */ - public function errorCode() - { - return $this->stmt->errorCode(); - } - - /** - * Fetches extended error information associated with the last operation on the statement. - * - * @return array - */ - public function errorInfo() - { - return $this->stmt->errorInfo(); - } - - public function setFetchMode($fetchStyle, $arg2 = null, $arg3 = null) - { - return $this->stmt->setFetchMode($fetchStyle, $arg2, $arg3); - } - - public function getIterator() - { - return $this->stmt; - } - - /** - * Fetches the next row from a result set. - * - * @param integer $fetchStyle - * @return mixed The return value of this function on success depends on the fetch type. - * In all cases, FALSE is returned on failure. - */ - public function fetch($fetchStyle = PDO::FETCH_BOTH) - { - return $this->stmt->fetch($fetchStyle); - } - - /** - * Returns an array containing all of the result set rows. - * - * @param integer $fetchStyle - * @param mixed $fetchArgument - * @return array An array containing all of the remaining rows in the result set. - */ - public function fetchAll($fetchStyle = PDO::FETCH_BOTH, $fetchArgument = 0) - { - if ($fetchArgument !== 0) { - return $this->stmt->fetchAll($fetchStyle, $fetchArgument); - } - return $this->stmt->fetchAll($fetchStyle); - } - - /** - * Returns a single column from the next row of a result set. - * - * @param integer $columnIndex - * @return mixed A single column from the next row of a result set or FALSE if there are no more rows. - */ - public function fetchColumn($columnIndex = 0) - { - return $this->stmt->fetchColumn($columnIndex); - } - - /** - * Returns the number of rows affected by the last execution of this statement. - * - * @return integer The number of affected rows. - */ - public function rowCount() - { - return $this->stmt->rowCount(); - } - - /** - * Gets the wrapped driver statement. - * - * @return Doctrine\DBAL\Driver\Statement - */ - public function getWrappedStatement() - { - return $this->stmt; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php deleted file mode 100644 index 96eaa11..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php +++ /dev/null @@ -1,124 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Tools\Console\Command; - -use Symfony\Component\Console\Input\InputArgument, - Symfony\Component\Console; - -/** - * Task for executing arbitrary SQL that can come from a file or directly from - * the command line. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ImportCommand extends Console\Command\Command -{ - /** - * @see Console\Command\Command - */ - protected function configure() - { - $this - ->setName('dbal:import') - ->setDescription('Import SQL file(s) directly to Database.') - ->setDefinition(array( - new InputArgument( - 'file', InputArgument::REQUIRED | InputArgument::IS_ARRAY, 'File path(s) of SQL to be executed.' - ) - )) - ->setHelp(<<getHelper('db')->getConnection(); - - if (($fileNames = $input->getArgument('file')) !== null) { - foreach ((array) $fileNames as $fileName) { - $fileName = realpath($fileName); - - if ( ! file_exists($fileName)) { - throw new \InvalidArgumentException( - sprintf("SQL file '%s' does not exist.", $fileName) - ); - } else if ( ! is_readable($fileName)) { - throw new \InvalidArgumentException( - sprintf("SQL file '%s' does not have read permissions.", $fileName) - ); - } - - $output->write(sprintf("Processing file '%s'... ", $fileName)); - $sql = file_get_contents($fileName); - - if ($conn instanceof \Doctrine\DBAL\Driver\PDOConnection) { - // PDO Drivers - try { - $lines = 0; - - $stmt = $conn->prepare($sql); - $stmt->execute(); - - do { - // Required due to "MySQL has gone away!" issue - $stmt->fetch(); - $stmt->closeCursor(); - - $lines++; - } while ($stmt->nextRowset()); - - $output->write(sprintf('%d statements executed!', $lines) . PHP_EOL); - } catch (\PDOException $e) { - $output->write('error!' . PHP_EOL); - - throw new \RuntimeException($e->getMessage(), $e->getCode(), $e); - } - } else { - // Non-PDO Drivers (ie. OCI8 driver) - $stmt = $conn->prepare($sql); - $rs = $stmt->execute(); - - if ($rs) { - $output->writeln('OK!' . PHP_EOL); - } else { - $error = $stmt->errorInfo(); - - $output->write('error!' . PHP_EOL); - - throw new \RuntimeException($error[2], $error[0]); - } - - $stmt->closeCursor(); - } - } - } - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php deleted file mode 100644 index 9bf0a27..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php +++ /dev/null @@ -1,133 +0,0 @@ -. - */ - - -namespace Doctrine\DBAL\Tools\Console\Command; - -use Symfony\Component\Console\Input\InputArgument, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console\Command\Command, - Symfony\Component\Console\Input\InputInterface, - Symfony\Component\Console\Output\OutputInterface; -use Doctrine\DBAL\Platforms\Keywords\ReservedKeywordsValidator; - -class ReservedWordsCommand extends Command -{ - private $keywordListClasses = array( - 'mysql' => 'Doctrine\DBAL\Platforms\Keywords\MySQLKeywords', - 'mssql' => 'Doctrine\DBAL\Platforms\Keywords\MsSQLKeywords', - 'sqlite' => 'Doctrine\DBAL\Platforms\Keywords\SQLiteKeywords', - 'pgsql' => 'Doctrine\DBAL\Platforms\Keywords\PostgreSQLKeywords', - 'oracle' => 'Doctrine\DBAL\Platforms\Keywords\OracleKeywords', - 'db2' => 'Doctrine\DBAL\Platforms\Keywords\DB2Keywords', - ); - - /** - * If you want to add or replace a keywords list use this command - * - * @param string $name - * @param string $class - */ - public function setKeywordListClass($name, $class) - { - $this->keywordListClasses[$name] = $class; - } - - /** - * @see Console\Command\Command - */ - protected function configure() - { - $this - ->setName('dbal:reserved-words') - ->setDescription('Checks if the current database contains identifiers that are reserved.') - ->setDefinition(array( - new InputOption( - 'list', 'l', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Keyword-List name.' - ) - )) - ->setHelp(<<doctrine dbal:reserved-words - -If you want to check against specific dialects you can -pass them to the command: - - doctrine dbal:reserved-words mysql pgsql - -The following keyword lists are currently shipped with Doctrine: - - * mysql - * pgsql - * sqlite - * oracle - * mssql - * db2 (Not checked by default) -EOT - ); - } - - /** - * @see Console\Command\Command - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - /* @var $conn Doctrine\DBAL\Connection */ - $conn = $this->getHelper('db')->getConnection(); - - $keywordLists = (array)$input->getOption('list'); - if (!$keywordLists) { - $keywordLists = array('mysql', 'pgsql', 'sqlite', 'oracle', 'mssql'); - } - - $keywords = array(); - foreach ($keywordLists AS $keywordList) { - if (!isset($this->keywordListClasses[$keywordList])) { - throw new \InvalidArgumentException( - "There exists no keyword list with name '" . $keywordList . "'. ". - "Known lists: " . implode(", ", array_keys($this->keywordListClasses)) - ); - } - $class = $this->keywordListClasses[$keywordList]; - $keywords[] = new $class; - } - - $output->write('Checking keyword violations for ' . implode(", ", $keywordLists) . "...", true); - - /* @var $schema \Doctrine\DBAL\Schema\Schema */ - $schema = $conn->getSchemaManager()->createSchema(); - $visitor = new ReservedKeywordsValidator($keywords); - $schema->visit($visitor); - - $violations = $visitor->getViolations(); - if (count($violations) == 0) { - $output->write("No reserved keywords violations have been found!", true); - } else { - $output->write('There are ' . count($violations) . ' reserved keyword violations in your database schema:', true); - foreach ($violations AS $violation) { - $output->write(' - ' . $violation, true); - } - } - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php deleted file mode 100644 index 856c1a2..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php +++ /dev/null @@ -1,87 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Tools\Console\Command; - -use Symfony\Component\Console\Input\InputArgument, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console; - -/** - * Task for executing arbitrary SQL that can come from a file or directly from - * the command line. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class RunSqlCommand extends Console\Command\Command -{ - /** - * @see Console\Command\Command - */ - protected function configure() - { - $this - ->setName('dbal:run-sql') - ->setDescription('Executes arbitrary SQL directly from the command line.') - ->setDefinition(array( - new InputArgument('sql', InputArgument::REQUIRED, 'The SQL statement to execute.'), - new InputOption('depth', null, InputOption::VALUE_REQUIRED, 'Dumping depth of result set.', 7) - )) - ->setHelp(<<getHelper('db')->getConnection(); - - if (($sql = $input->getArgument('sql')) === null) { - throw new \RuntimeException("Argument 'SQL' is required in order to execute this command correctly."); - } - - $depth = $input->getOption('depth'); - - if ( ! is_numeric($depth)) { - throw new \LogicException("Option 'depth' must contains an integer value"); - } - - if (preg_match('/^select/i', $sql)) { - $resultSet = $conn->fetchAll($sql); - } else { - $resultSet = $conn->executeUpdate($sql); - } - - ob_start(); - \Doctrine\Common\Util\Debug::dump($resultSet, (int) $depth); - $message = ob_get_clean(); - - $output->write($message); - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Helper/ConnectionHelper.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Helper/ConnectionHelper.php deleted file mode 100644 index 4437d46..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Helper/ConnectionHelper.php +++ /dev/null @@ -1,74 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Tools\Console\Helper; - -use Symfony\Component\Console\Helper\Helper, - Doctrine\DBAL\Connection; - -/** - * Doctrine CLI Connection Helper. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ConnectionHelper extends Helper -{ - /** - * Doctrine Database Connection - * @var Connection - */ - protected $_connection; - - /** - * Constructor - * - * @param Connection $connection Doctrine Database Connection - */ - public function __construct(Connection $connection) - { - $this->_connection = $connection; - } - - /** - * Retrieves Doctrine Database Connection - * - * @return Connection - */ - public function getConnection() - { - return $this->_connection; - } - - /** - * @see Helper - */ - public function getName() - { - return 'connection'; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ArrayType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ArrayType.php deleted file mode 100644 index 237070e..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ArrayType.php +++ /dev/null @@ -1,57 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Types; - -/** - * Type that maps a PHP array to a clob SQL type. - * - * @since 2.0 - */ -class ArrayType extends Type -{ - public function getSQLDeclaration(array $fieldDeclaration, \Doctrine\DBAL\Platforms\AbstractPlatform $platform) - { - return $platform->getClobTypeDeclarationSQL($fieldDeclaration); - } - - public function convertToDatabaseValue($value, \Doctrine\DBAL\Platforms\AbstractPlatform $platform) - { - return serialize($value); - } - - public function convertToPHPValue($value, \Doctrine\DBAL\Platforms\AbstractPlatform $platform) - { - if ($value === null) { - return null; - } - - $value = (is_resource($value)) ? stream_get_contents($value) : $value; - $val = unserialize($value); - if ($val === false && $value != 'b:0;') { - throw ConversionException::conversionFailed($value, $this->getName()); - } - return $val; - } - - public function getName() - { - return Type::TARRAY; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BigIntType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BigIntType.php deleted file mode 100644 index 6c3f4b0..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BigIntType.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Types; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -/** - * Type that maps a database BIGINT to a PHP string. - * - * @author robo - * @since 2.0 - */ -class BigIntType extends Type -{ - public function getName() - { - return Type::BIGINT; - } - - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getBigIntTypeDeclarationSQL($fieldDeclaration); - } - - public function getBindingType() - { - return \PDO::PARAM_STR; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BlobType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BlobType.php deleted file mode 100644 index 5be8c30..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BlobType.php +++ /dev/null @@ -1,67 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Types; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -/** - * Type that maps an SQL BLOB to a PHP resource stream - * - * @since 2.2 - */ -class BlobType extends Type -{ - /** @override */ - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getBlobTypeDeclarationSQL($fieldDeclaration); - } - - /** - * Converts a value from its database representation to its PHP representation - * of this type. - * - * @param mixed $value The value to convert. - * @param AbstractPlatform $platform The currently used database platform. - * @return mixed The PHP representation of the value. - */ - public function convertToPHPValue($value, AbstractPlatform $platform) - { - if (null === $value) { - return null; - } - if (is_string($value)) { - $value = fopen('data://text/plain;base64,' . base64_encode($value), 'r'); - } else if ( ! is_resource($value)) { - throw ConversionException::conversionFailed($value, self::BLOB); - } - return $value; - } - - public function getName() - { - return Type::BLOB; - } - - public function getBindingType() - { - return \PDO::PARAM_LOB; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BooleanType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BooleanType.php deleted file mode 100644 index e3cb9a1..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BooleanType.php +++ /dev/null @@ -1,57 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Types; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -/** - * Type that maps an SQL boolean to a PHP boolean. - * - * @since 2.0 - */ -class BooleanType extends Type -{ - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getBooleanTypeDeclarationSQL($fieldDeclaration); - } - - public function convertToDatabaseValue($value, AbstractPlatform $platform) - { - return $platform->convertBooleans($value); - } - - public function convertToPHPValue($value, AbstractPlatform $platform) - { - return (null === $value) ? null : (bool) $value; - } - - public function getName() - { - return Type::BOOLEAN; - } - - public function getBindingType() - { - return \PDO::PARAM_BOOL; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php deleted file mode 100644 index ef3270f..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php +++ /dev/null @@ -1,65 +0,0 @@ -. - */ - - -/** - * Conversion Exception is thrown when the database to PHP conversion fails - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -namespace Doctrine\DBAL\Types; - -class ConversionException extends \Doctrine\DBAL\DBALException -{ - /** - * Thrown when a Database to Doctrine Type Conversion fails. - * - * @param string $value - * @param string $toType - * @return ConversionException - */ - static public function conversionFailed($value, $toType) - { - $value = (strlen($value) > 32) ? substr($value, 0, 20) . "..." : $value; - return new self('Could not convert database value "' . $value . '" to Doctrine Type ' . $toType); - } - - /** - * Thrown when a Database to Doctrine Type Conversion fails and we can make a statement - * about the expected format. - * - * @param string $value - * @param string $toType - * @return ConversionException - */ - static public function conversionFailedFormat($value, $toType, $expectedFormat) - { - $value = (strlen($value) > 32) ? substr($value, 0, 20) . "..." : $value; - return new self( - 'Could not convert database value "' . $value . '" to Doctrine Type ' . - $toType . '. Expected format: ' . $expectedFormat - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DateTimeType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DateTimeType.php deleted file mode 100644 index d073173..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DateTimeType.php +++ /dev/null @@ -1,59 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Types; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -/** - * Type that maps an SQL DATETIME/TIMESTAMP to a PHP DateTime object. - * - * @since 2.0 - */ -class DateTimeType extends Type -{ - public function getName() - { - return Type::DATETIME; - } - - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getDateTimeTypeDeclarationSQL($fieldDeclaration); - } - - public function convertToDatabaseValue($value, AbstractPlatform $platform) - { - return ($value !== null) - ? $value->format($platform->getDateTimeFormatString()) : null; - } - - public function convertToPHPValue($value, AbstractPlatform $platform) - { - if ($value === null) { - return null; - } - - $val = \DateTime::createFromFormat($platform->getDateTimeFormatString(), $value); - if (!$val) { - throw ConversionException::conversionFailedFormat($value, $this->getName(), $platform->getDateTimeFormatString()); - } - return $val; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DateTimeTzType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DateTimeTzType.php deleted file mode 100644 index 4dc6058..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DateTimeTzType.php +++ /dev/null @@ -1,79 +0,0 @@ -. - */ - - -namespace Doctrine\DBAL\Types; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -/** - * DateTime type saving additional timezone information. - * - * Caution: Databases are not necessarily experts at storing timezone related - * data of dates. First, of all the supported vendors only PostgreSQL and Oracle - * support storing Timezone data. But those two don't save the actual timezone - * attached to a DateTime instance (for example "Europe/Berlin" or "America/Montreal") - * but the current offset of them related to UTC. That means depending on daylight saving times - * or not you may get different offsets. - * - * This datatype makes only sense to use, if your application works with an offset, not - * with an actual timezone that uses transitions. Otherwise your DateTime instance - * attached with a timezone such as Europe/Berlin gets saved into the database with - * the offset and re-created from persistence with only the offset, not the original timezone - * attached. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 1.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class DateTimeTzType extends Type -{ - public function getName() - { - return Type::DATETIMETZ; - } - - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getDateTimeTzTypeDeclarationSQL($fieldDeclaration); - } - - public function convertToDatabaseValue($value, AbstractPlatform $platform) - { - return ($value !== null) - ? $value->format($platform->getDateTimeTzFormatString()) : null; - } - - public function convertToPHPValue($value, AbstractPlatform $platform) - { - if ($value === null) { - return null; - } - - $val = \DateTime::createFromFormat($platform->getDateTimeTzFormatString(), $value); - if (!$val) { - throw ConversionException::conversionFailedFormat($value, $this->getName(), $platform->getDateTimeTzFormatString()); - } - return $val; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DateType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DateType.php deleted file mode 100644 index 42c4803..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DateType.php +++ /dev/null @@ -1,59 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Types; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -/** - * Type that maps an SQL DATE to a PHP Date object. - * - * @since 2.0 - */ -class DateType extends Type -{ - public function getName() - { - return Type::DATE; - } - - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getDateTypeDeclarationSQL($fieldDeclaration); - } - - public function convertToDatabaseValue($value, AbstractPlatform $platform) - { - return ($value !== null) - ? $value->format($platform->getDateFormatString()) : null; - } - - public function convertToPHPValue($value, AbstractPlatform $platform) - { - if ($value === null) { - return null; - } - - $val = \DateTime::createFromFormat('!'.$platform->getDateFormatString(), $value); - if (!$val) { - throw ConversionException::conversionFailedFormat($value, $this->getName(), $platform->getDateFormatString()); - } - return $val; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DecimalType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DecimalType.php deleted file mode 100644 index 1308c96..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DecimalType.php +++ /dev/null @@ -1,45 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Types; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -/** - * Type that maps an SQL DECIMAL to a PHP double. - * - * @since 2.0 - */ -class DecimalType extends Type -{ - public function getName() - { - return Type::DECIMAL; - } - - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getDecimalTypeDeclarationSQL($fieldDeclaration); - } - - public function convertToPHPValue($value, AbstractPlatform $platform) - { - return (null === $value) ? null : $value; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/FloatType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/FloatType.php deleted file mode 100644 index c8f7914..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/FloatType.php +++ /dev/null @@ -1,54 +0,0 @@ -. - */ - - -namespace Doctrine\DBAL\Types; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -class FloatType extends Type -{ - public function getName() - { - return Type::FLOAT; - } - - /** - * @param array $fieldDeclaration - * @param AbstractPlatform $platform - * @return string - */ - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getFloatDeclarationSQL($fieldDeclaration); - } - - /** - * Converts a value from its database representation to its PHP representation - * of this type. - * - * @param mixed $value The value to convert. - * @param AbstractPlatform $platform The currently used database platform. - * @return mixed The PHP representation of the value. - */ - public function convertToPHPValue($value, AbstractPlatform $platform) - { - return (null === $value) ? null : (double) $value; - } -} diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/IntegerType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/IntegerType.php deleted file mode 100644 index dd13f0a..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/IntegerType.php +++ /dev/null @@ -1,53 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Types; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -/** - * Type that maps an SQL INT to a PHP integer. - * - * @author Roman Borschel - * @since 2.0 - */ -class IntegerType extends Type -{ - public function getName() - { - return Type::INTEGER; - } - - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getIntegerTypeDeclarationSQL($fieldDeclaration); - } - - public function convertToPHPValue($value, AbstractPlatform $platform) - { - return (null === $value) ? null : (int) $value; - } - - public function getBindingType() - { - return \PDO::PARAM_INT; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ObjectType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ObjectType.php deleted file mode 100644 index 977c3b3..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ObjectType.php +++ /dev/null @@ -1,57 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Types; - -/** - * Type that maps a PHP object to a clob SQL type. - * - * @since 2.0 - */ -class ObjectType extends Type -{ - public function getSQLDeclaration(array $fieldDeclaration, \Doctrine\DBAL\Platforms\AbstractPlatform $platform) - { - return $platform->getClobTypeDeclarationSQL($fieldDeclaration); - } - - public function convertToDatabaseValue($value, \Doctrine\DBAL\Platforms\AbstractPlatform $platform) - { - return serialize($value); - } - - public function convertToPHPValue($value, \Doctrine\DBAL\Platforms\AbstractPlatform $platform) - { - if ($value === null) { - return null; - } - - $value = (is_resource($value)) ? stream_get_contents($value) : $value; - $val = unserialize($value); - if ($val === false && $value !== 'b:0;') { - throw ConversionException::conversionFailed($value, $this->getName()); - } - return $val; - } - - public function getName() - { - return Type::OBJECT; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/SmallIntType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/SmallIntType.php deleted file mode 100644 index 5e1df69..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/SmallIntType.php +++ /dev/null @@ -1,52 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Types; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -/** - * Type that maps a database SMALLINT to a PHP integer. - * - * @author robo - */ -class SmallIntType extends Type -{ - public function getName() - { - return Type::SMALLINT; - } - - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getSmallIntTypeDeclarationSQL($fieldDeclaration); - } - - public function convertToPHPValue($value, AbstractPlatform $platform) - { - return (null === $value) ? null : (int) $value; - } - - public function getBindingType() - { - return \PDO::PARAM_INT; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/StringType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/StringType.php deleted file mode 100644 index a813eaa..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/StringType.php +++ /dev/null @@ -1,50 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Types; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -/** - * Type that maps an SQL VARCHAR to a PHP string. - * - * @since 2.0 - */ -class StringType extends Type -{ - /** @override */ - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration); - } - - /** @override */ - public function getDefaultLength(AbstractPlatform $platform) - { - return $platform->getVarcharDefaultLength(); - } - - /** @override */ - public function getName() - { - return Type::STRING; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/TextType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/TextType.php deleted file mode 100644 index 50b4f83..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/TextType.php +++ /dev/null @@ -1,56 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Types; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -/** - * Type that maps an SQL CLOB to a PHP string. - * - * @since 2.0 - */ -class TextType extends Type -{ - /** @override */ - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getClobTypeDeclarationSQL($fieldDeclaration); - } - - /** - * Converts a value from its database representation to its PHP representation - * of this type. - * - * @param mixed $value The value to convert. - * @param AbstractPlatform $platform The currently used database platform. - * @return mixed The PHP representation of the value. - */ - public function convertToPHPValue($value, AbstractPlatform $platform) - { - return (is_resource($value)) ? stream_get_contents($value) : $value; - } - - public function getName() - { - return Type::TEXT; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/TimeType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/TimeType.php deleted file mode 100644 index d4c49c4..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/TimeType.php +++ /dev/null @@ -1,68 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Types; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -/** - * Type that maps an SQL TIME to a PHP DateTime object. - * - * @since 2.0 - */ -class TimeType extends Type -{ - public function getName() - { - return Type::TIME; - } - - /** - * {@inheritdoc} - */ - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getTimeTypeDeclarationSQL($fieldDeclaration); - } - - /** - * {@inheritdoc} - */ - public function convertToDatabaseValue($value, AbstractPlatform $platform) - { - return ($value !== null) - ? $value->format($platform->getTimeFormatString()) : null; - } - - /** - * {@inheritdoc} - */ - public function convertToPHPValue($value, AbstractPlatform $platform) - { - if ($value === null) { - return null; - } - - $val = \DateTime::createFromFormat($platform->getTimeFormatString(), $value); - if (!$val) { - throw ConversionException::conversionFailedFormat($value, $this->getName(), $platform->getTimeFormatString()); - } - return $val; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/Type.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/Type.php deleted file mode 100644 index 320dfa9..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/Type.php +++ /dev/null @@ -1,274 +0,0 @@ -. - */ - -namespace Doctrine\DBAL\Types; - -use Doctrine\DBAL\Platforms\AbstractPlatform, - Doctrine\DBAL\DBALException; - -/** - * The base class for so-called Doctrine mapping types. - * - * A Type object is obtained by calling the static {@link getType()} method. - * - * @author Roman Borschel - * @author Benjamin Eberlei - * @since 2.0 - */ -abstract class Type -{ - const TARRAY = 'array'; - const BIGINT = 'bigint'; - const BOOLEAN = 'boolean'; - const DATETIME = 'datetime'; - const DATETIMETZ = 'datetimetz'; - const DATE = 'date'; - const TIME = 'time'; - const DECIMAL = 'decimal'; - const INTEGER = 'integer'; - const OBJECT = 'object'; - const SMALLINT = 'smallint'; - const STRING = 'string'; - const TEXT = 'text'; - const BLOB = 'blob'; - const FLOAT = 'float'; - - /** Map of already instantiated type objects. One instance per type (flyweight). */ - private static $_typeObjects = array(); - - /** The map of supported doctrine mapping types. */ - private static $_typesMap = array( - self::TARRAY => 'Doctrine\DBAL\Types\ArrayType', - self::OBJECT => 'Doctrine\DBAL\Types\ObjectType', - self::BOOLEAN => 'Doctrine\DBAL\Types\BooleanType', - self::INTEGER => 'Doctrine\DBAL\Types\IntegerType', - self::SMALLINT => 'Doctrine\DBAL\Types\SmallIntType', - self::BIGINT => 'Doctrine\DBAL\Types\BigIntType', - self::STRING => 'Doctrine\DBAL\Types\StringType', - self::TEXT => 'Doctrine\DBAL\Types\TextType', - self::DATETIME => 'Doctrine\DBAL\Types\DateTimeType', - self::DATETIMETZ => 'Doctrine\DBAL\Types\DateTimeTzType', - self::DATE => 'Doctrine\DBAL\Types\DateType', - self::TIME => 'Doctrine\DBAL\Types\TimeType', - self::DECIMAL => 'Doctrine\DBAL\Types\DecimalType', - self::FLOAT => 'Doctrine\DBAL\Types\FloatType', - self::BLOB => 'Doctrine\DBAL\Types\BlobType', - ); - - /* Prevent instantiation and force use of the factory method. */ - final private function __construct() {} - - /** - * Converts a value from its PHP representation to its database representation - * of this type. - * - * @param mixed $value The value to convert. - * @param AbstractPlatform $platform The currently used database platform. - * @return mixed The database representation of the value. - */ - public function convertToDatabaseValue($value, AbstractPlatform $platform) - { - return $value; - } - - /** - * Converts a value from its database representation to its PHP representation - * of this type. - * - * @param mixed $value The value to convert. - * @param AbstractPlatform $platform The currently used database platform. - * @return mixed The PHP representation of the value. - */ - public function convertToPHPValue($value, AbstractPlatform $platform) - { - return $value; - } - - /** - * Gets the default length of this type. - * - * @todo Needed? - */ - public function getDefaultLength(AbstractPlatform $platform) - { - return null; - } - - /** - * Gets the SQL declaration snippet for a field of this type. - * - * @param array $fieldDeclaration The field declaration. - * @param AbstractPlatform $platform The currently used database platform. - */ - abstract public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform); - - /** - * Gets the name of this type. - * - * @return string - * @todo Needed? - */ - abstract public function getName(); - - /** - * Factory method to create type instances. - * Type instances are implemented as flyweights. - * - * @static - * @throws DBALException - * @param string $name The name of the type (as returned by getName()). - * @return Doctrine\DBAL\Types\Type - */ - public static function getType($name) - { - if ( ! isset(self::$_typeObjects[$name])) { - if ( ! isset(self::$_typesMap[$name])) { - throw DBALException::unknownColumnType($name); - } - self::$_typeObjects[$name] = new self::$_typesMap[$name](); - } - - return self::$_typeObjects[$name]; - } - - /** - * Adds a custom type to the type map. - * - * @static - * @param string $name Name of the type. This should correspond to what getName() returns. - * @param string $className The class name of the custom type. - * @throws DBALException - */ - public static function addType($name, $className) - { - if (isset(self::$_typesMap[$name])) { - throw DBALException::typeExists($name); - } - - self::$_typesMap[$name] = $className; - } - - /** - * Checks if exists support for a type. - * - * @static - * @param string $name Name of the type - * @return boolean TRUE if type is supported; FALSE otherwise - */ - public static function hasType($name) - { - return isset(self::$_typesMap[$name]); - } - - /** - * Overrides an already defined type to use a different implementation. - * - * @static - * @param string $name - * @param string $className - * @throws DBALException - */ - public static function overrideType($name, $className) - { - if ( ! isset(self::$_typesMap[$name])) { - throw DBALException::typeNotFound($name); - } - - if (isset(self::$_typeObjects[$name])) { - unset(self::$_typeObjects[$name]); - } - - self::$_typesMap[$name] = $className; - } - - /** - * Gets the (preferred) binding type for values of this type that - * can be used when binding parameters to prepared statements. - * - * This method should return one of the PDO::PARAM_* constants, that is, one of: - * - * PDO::PARAM_BOOL - * PDO::PARAM_NULL - * PDO::PARAM_INT - * PDO::PARAM_STR - * PDO::PARAM_LOB - * - * @return integer - */ - public function getBindingType() - { - return \PDO::PARAM_STR; - } - - /** - * Get the types array map which holds all registered types and the corresponding - * type class - * - * @return array $typesMap - */ - public static function getTypesMap() - { - return self::$_typesMap; - } - - public function __toString() - { - $e = explode('\\', get_class($this)); - return str_replace('Type', '', end($e)); - } - - /** - * Does working with this column require SQL conversion functions? - * - * This is a metadata function that is required for example in the ORM. - * Usage of {@link convertToDatabaseValueSQL} and - * {@link convertToPHPValueSQL} works for any type and mostly - * does nothing. This method can additionally be used for optimization purposes. - * - * @return bool - */ - public function canRequireSQLConversion() - { - return false; - } - - /** - * Modifies the SQL expression (identifier, parameter) to convert to a database value. - * - * @param string $sqlExpr - * @param AbstractPlatform $platform - * @return string - */ - public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform) - { - return $sqlExpr; - } - - /** - * Modifies the SQL expression (identifier, parameter) to convert to a PHP value. - * - * @param string $sqlExpr - * @param AbstractPlatform $platform - * @return string - */ - public function convertToPHPValueSQL($sqlExpr, $platform) - { - return $sqlExpr; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/VarDateTimeType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/VarDateTimeType.php deleted file mode 100644 index 03ea048..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/VarDateTimeType.php +++ /dev/null @@ -1,60 +0,0 @@ -. - */ - - -namespace Doctrine\DBAL\Types; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -/** - * Variable DateTime Type using date_create() instead of DateTime::createFromFormat() - * - * This type has performance implications as it runs twice as long as the regular - * {@see DateTimeType}, however in certain PostgreSQL configurations with - * TIMESTAMP(n) columns where n > 0 it is necessary to use this type. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class VarDateTimeType extends DateTimeType -{ - /** - * @throws ConversionException - * @param string $value - * @param AbstractPlatform $platform - * @return DateTime - */ - public function convertToPHPValue($value, AbstractPlatform $platform) - { - if ($value === null) { - return null; - } - - $val = date_create($value); - if (!$val) { - throw ConversionException::conversionFailed($value, $this->getName()); - } - return $val; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Version.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Version.php deleted file mode 100644 index 883b217..0000000 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Version.php +++ /dev/null @@ -1,55 +0,0 @@ -. - */ - -namespace Doctrine\DBAL; - -/** - * Class to store and retrieve the version of Doctrine - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class Version -{ - /** - * Current Doctrine Version - */ - const VERSION = '2.2.3-DEV'; - - /** - * Compares a Doctrine version with the current one. - * - * @param string $version Doctrine version to compare. - * @return int Returns -1 if older, 0 if it is the same, 1 if version - * passed as argument is newer. - */ - public static function compare($version) - { - $currentVersion = str_replace(' ', '', strtolower(self::VERSION)); - $version = str_replace(' ', '', $version); - - return version_compare($version, $currentVersion); - } -} diff --git a/vendor/doctrine/dbal/phpunit.xml.dist b/vendor/doctrine/dbal/phpunit.xml.dist deleted file mode 100644 index fe1d515..0000000 --- a/vendor/doctrine/dbal/phpunit.xml.dist +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - ./tests/Doctrine/Tests/DBAL - - - \ No newline at end of file diff --git a/vendor/doctrine/dbal/run-all.sh b/vendor/doctrine/dbal/run-all.sh deleted file mode 100644 index 80712ee..0000000 --- a/vendor/doctrine/dbal/run-all.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# This script is a small convenience wrapper for running the doctrine testsuite against a large bunch of databases. -# Just create the phpunit.xmls as described in the array below and configure the specific files section -# to connect to that database. Just omit a file if you dont have that database and the tests will be skipped. - -configs[1]="mysql.phpunit.xml" -configs[2]='postgres.phpunit.xml' -configs[3]='sqlite.phpunit.xml' -configs[4]='oracle.phpunit.xml' -configs[5]='db2.phpunit.xml' -configs[6]='pdo-ibm.phpunit.xml' -configs[7]='sqlsrv.phpunit.xml' - -for i in "${configs[@]}"; do - if [ -f "$i" ]; - then - echo "RUNNING TESTS WITH CONFIG $i" - phpunit -c "$i" "$@" - fi; -done diff --git a/vendor/doctrine/dbal/tests/.gitignore b/vendor/doctrine/dbal/tests/.gitignore deleted file mode 100644 index 7210405..0000000 --- a/vendor/doctrine/dbal/tests/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -Doctrine/Tests/Proxies/ -Doctrine/Tests/ORM/Proxy/generated/ -Doctrine/Tests/ORM/Tools/Export/export diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/ConnectionTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/ConnectionTest.php deleted file mode 100644 index bcd6834..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/ConnectionTest.php +++ /dev/null @@ -1,148 +0,0 @@ - 'pdo_mysql', - 'host' => 'localhost', - 'user' => 'root', - 'password' => 'password', - 'port' => '1234' - ); - $this->_conn = \Doctrine\DBAL\DriverManager::getConnection($params); - } - - public function testIsConnected() - { - $this->assertFalse($this->_conn->isConnected()); - } - - public function testNoTransactionActiveByDefault() - { - $this->assertFalse($this->_conn->isTransactionActive()); - } - - public function testCommitWithNoActiveTransaction_ThrowsException() - { - $this->setExpectedException('Doctrine\DBAL\ConnectionException'); - $this->_conn->commit(); - } - - public function testRollbackWithNoActiveTransaction_ThrowsException() - { - $this->setExpectedException('Doctrine\DBAL\ConnectionException'); - $this->_conn->rollback(); - } - - public function testSetRollbackOnlyNoActiveTransaction_ThrowsException() - { - $this->setExpectedException('Doctrine\DBAL\ConnectionException'); - $this->_conn->setRollbackOnly(); - } - - public function testIsRollbackOnlyNoActiveTransaction_ThrowsException() - { - $this->setExpectedException('Doctrine\DBAL\ConnectionException'); - $this->_conn->isRollbackOnly(); - } - - public function testGetConfiguration() - { - $config = $this->_conn->getConfiguration(); - - $this->assertInstanceOf('Doctrine\DBAL\Configuration', $config); - } - - public function testGetHost() - { - $this->assertEquals('localhost', $this->_conn->getHost()); - } - - public function testGetPort() - { - $this->assertEquals('1234', $this->_conn->getPort()); - } - - public function testGetUsername() - { - $this->assertEquals('root', $this->_conn->getUsername()); - } - - public function testGetPassword() - { - $this->assertEquals('password', $this->_conn->getPassword()); - } - - public function testGetDriver() - { - $this->assertInstanceOf('Doctrine\DBAL\Driver\PDOMySql\Driver', $this->_conn->getDriver()); - } - - public function testGetEventManager() - { - $this->assertInstanceOf('Doctrine\Common\EventManager', $this->_conn->getEventManager()); - } - - public function testConnectDispatchEvent() - { - $listenerMock = $this->getMock('ConnectDispatchEventListener', array('postConnect')); - $listenerMock->expects($this->once())->method('postConnect'); - - $eventManager = new EventManager(); - $eventManager->addEventListener(array(Events::postConnect), $listenerMock); - - $driverMock = $this->getMock('Doctrine\DBAL\Driver'); - $driverMock->expects(($this->at(0))) - ->method('connect'); - $platform = new Mocks\MockPlatform(); - - $conn = new Connection(array('platform' => $platform), $driverMock, new Configuration(), $eventManager); - $conn->connect(); - } - - public function testEventManagerPassedToPlatform() - { - $this->assertInstanceOf('Doctrine\Common\EventManager', $this->_conn->getDatabasePlatform()->getEventManager()); - $this->assertSame($this->_conn->getEventManager(), $this->_conn->getDatabasePlatform()->getEventManager()); - } - - /** - * Pretty dumb test, however we want to check that the EchoSQLLogger correctly implements the interface. - * - * @group DBAL-11 - */ - public function testEchoSQLLogger() - { - $logger = new \Doctrine\DBAL\Logging\EchoSQLLogger(); - $this->_conn->getConfiguration()->setSQLLogger($logger); - $this->assertSame($logger, $this->_conn->getConfiguration()->getSQLLogger()); - } - - /** - * Pretty dumb test, however we want to check that the DebugStack correctly implements the interface. - * - * @group DBAL-11 - */ - public function testDebugSQLStack() - { - $logger = new \Doctrine\DBAL\Logging\DebugStack(); - $this->_conn->getConfiguration()->setSQLLogger($logger); - $this->assertSame($logger, $this->_conn->getConfiguration()->getSQLLogger()); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Driver/OCI8/OCI8StatementTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Driver/OCI8/OCI8StatementTest.php deleted file mode 100644 index a3dfe2a..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Driver/OCI8/OCI8StatementTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestSkipped('oci8 is not installed.'); - } - - parent::setUp(); - } - - /** - * This scenario shows that when the first parameter is not null - * it properly sets $hasZeroIndex to 1 and calls bindValue starting at 1. - * - * This also verifies that the statement will check with the connection to - * see what the current execution mode is. - * - * The expected exception is due to oci_execute failing due to no valid connection. - * - * @dataProvider executeDataProvider - * @expectedException \Doctrine\DBAL\Driver\OCI8\OCI8Exception - */ - public function testExecute(array $params) - { - $statement = $this->getMock('\Doctrine\DBAL\Driver\OCI8\OCI8Statement', - array('bindValue', 'errorInfo'), - array(), '', false); - - $statement->expects($this->at(0)) - ->method('bindValue') - ->with( - $this->equalTo(1), - $this->equalTo($params[0]) - ); - $statement->expects($this->at(1)) - ->method('bindValue') - ->with( - $this->equalTo(2), - $this->equalTo($params[1]) - ); - $statement->expects($this->at(2)) - ->method('bindValue') - ->with( - $this->equalTo(3), - $this->equalTo($params[2]) - ); - - // can't pass to constructor since we don't have a real database handle, - // but execute must check the connection for the executeMode - $conn = $this->getMock('\Doctrine\DBAL\Driver\OCI8\OCI8Connection', array('getExecuteMode'), array(), '', false); - $conn->expects($this->once()) - ->method('getExecuteMode'); - - $reflProperty = new \ReflectionProperty($statement, '_conn'); - $reflProperty->setAccessible(true); - $reflProperty->setValue($statement, $conn); - - $statement->execute($params); - } - - public static function executeDataProvider() - { - return array( - // $hasZeroIndex = isset($params[0]); == true - array( - array(0 => 'test', 1 => null, 2 => 'value') - ), - // $hasZeroIndex = isset($params[0]); == false - array( - array(0 => null, 1 => 'test', 2 => 'value') - ) - ); - } - -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/DriverManagerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/DriverManagerTest.php deleted file mode 100644 index 055b2ae..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/DriverManagerTest.php +++ /dev/null @@ -1,117 +0,0 @@ - 'test' - ); - $test = \Doctrine\DBAL\DriverManager::getConnection($options); - } - - public function testValidPdoInstance() - { - $options = array( - 'pdo' => new \PDO('sqlite::memory:') - ); - $conn = \Doctrine\DBAL\DriverManager::getConnection($options); - $this->assertEquals('sqlite', $conn->getDatabasePlatform()->getName()); - } - - /** - * @group DBAL-32 - */ - public function testPdoInstanceSetErrorMode() - { - $pdo = new \PDO('sqlite::memory:'); - $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_SILENT); - $options = array( - 'pdo' => $pdo - ); - - $conn = \Doctrine\DBAL\DriverManager::getConnection($options); - $this->assertEquals(\PDO::ERRMODE_EXCEPTION, $pdo->getAttribute(\PDO::ATTR_ERRMODE)); - } - - /** - * @expectedException \Doctrine\DBAL\DBALException - */ - public function testCheckParams() - { - $conn = \Doctrine\DBAL\DriverManager::getConnection(array()); - } - - /** - * @expectedException \Doctrine\DBAL\DBALException - */ - public function testInvalidDriver() - { - $conn = \Doctrine\DBAL\DriverManager::getConnection(array('driver' => 'invalid_driver')); - } - - public function testCustomPlatform() - { - $mockPlatform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform(); - $options = array( - 'pdo' => new \PDO('sqlite::memory:'), - 'platform' => $mockPlatform - ); - - $conn = \Doctrine\DBAL\DriverManager::getConnection($options); - $this->assertSame($mockPlatform, $conn->getDatabasePlatform()); - } - - public function testCustomWrapper() - { - $wrapperClass = 'Doctrine\Tests\Mocks\ConnectionMock'; - - $options = array( - 'pdo' => new \PDO('sqlite::memory:'), - 'wrapperClass' => $wrapperClass, - ); - - $conn = \Doctrine\DBAL\DriverManager::getConnection($options); - $this->assertInstanceOf($wrapperClass, $conn); - } - - public function testInvalidWrapperClass() - { - $this->setExpectedException('\Doctrine\DBAL\DBALException'); - - $options = array( - 'pdo' => new \PDO('sqlite::memory:'), - 'wrapperClass' => 'stdClass', - ); - - $conn = \Doctrine\DBAL\DriverManager::getConnection($options); - } - - public function testInvalidDriverClass() - { - $this->setExpectedException('\Doctrine\DBAL\DBALException'); - - $options = array( - 'driverClass' => 'stdClass' - ); - - $conn = \Doctrine\DBAL\DriverManager::getConnection($options); - } - - public function testValidDriverClass() - { - $options = array( - 'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver', - ); - - $conn = \Doctrine\DBAL\DriverManager::getConnection($options); - $this->assertInstanceOf('Doctrine\DBAL\Driver\PDOMySql\Driver', $conn->getDriver()); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Events/MysqlSessionInitTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Events/MysqlSessionInitTest.php deleted file mode 100644 index 1ef47dd..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Events/MysqlSessionInitTest.php +++ /dev/null @@ -1,33 +0,0 @@ -getMock('Doctrine\DBAL\Connection', array(), array(), '', false); - $connectionMock->expects($this->once()) - ->method('executeUpdate') - ->with($this->equalTo("SET NAMES foo COLLATE bar")); - - $eventArgs = new ConnectionEventArgs($connectionMock); - - - $listener = new MysqlSessionInit('foo', 'bar'); - $listener->postConnect($eventArgs); - } - - public function testGetSubscribedEvents() - { - $listener = new MysqlSessionInit(); - $this->assertEquals(array(Events::postConnect), $listener->getSubscribedEvents()); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Events/OracleSessionInitTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Events/OracleSessionInitTest.php deleted file mode 100644 index 847ed6b..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Events/OracleSessionInitTest.php +++ /dev/null @@ -1,33 +0,0 @@ -getMock('Doctrine\DBAL\Connection', array(), array(), '', false); - $connectionMock->expects($this->once()) - ->method('executeUpdate') - ->with($this->isType('string')); - - $eventArgs = new ConnectionEventArgs($connectionMock); - - - $listener = new OracleSessionInit(); - $listener->postConnect($eventArgs); - } - - public function testGetSubscribedEvents() - { - $listener = new OracleSessionInit(); - $this->assertEquals(array(Events::postConnect), $listener->getSubscribedEvents()); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Events/SQLSessionInitTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Events/SQLSessionInitTest.php deleted file mode 100644 index ed2dd43..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Events/SQLSessionInitTest.php +++ /dev/null @@ -1,35 +0,0 @@ -getMock('Doctrine\DBAL\Connection', array(), array(), '', false); - $connectionMock->expects($this->once()) - ->method('exec') - ->with($this->equalTo("SET SEARCH_PATH TO foo, public, TIMEZONE TO 'Europe/Berlin'")); - - $eventArgs = new ConnectionEventArgs($connectionMock); - - $listener = new SQLSessionInit("SET SEARCH_PATH TO foo, public, TIMEZONE TO 'Europe/Berlin'"); - $listener->postConnect($eventArgs); - } - - public function testGetSubscribedEvents() - { - $listener = new SQLSessionInit("SET SEARCH_PATH TO foo, public, TIMEZONE TO 'Europe/Berlin'"); - $this->assertEquals(array(Events::postConnect), $listener->getSubscribedEvents()); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/BlobTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/BlobTest.php deleted file mode 100644 index 7c56542..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/BlobTest.php +++ /dev/null @@ -1,83 +0,0 @@ -addColumn('id', 'integer'); - $table->addColumn('clobfield', 'text'); - $table->addColumn('blobfield', 'blob'); - $table->setPrimaryKey(array('id')); - - $sm = $this->_conn->getSchemaManager(); - $sm->createTable($table); - } catch(\Exception $e) { - - } - $this->_conn->exec($this->_conn->getDatabasePlatform()->getTruncateTableSQL('blob_table')); - } - - public function testInsert() - { - $ret = $this->_conn->insert('blob_table', - array('id' => 1, 'clobfield' => 'test', 'blobfield' => 'test'), - array(\PDO::PARAM_INT, \PDO::PARAM_STR, \PDO::PARAM_LOB) - ); - $this->assertEquals(1, $ret); - } - - public function testSelect() - { - $ret = $this->_conn->insert('blob_table', - array('id' => 1, 'clobfield' => 'test', 'blobfield' => 'test'), - array(\PDO::PARAM_INT, \PDO::PARAM_STR, \PDO::PARAM_LOB) - ); - - $this->assertBlobContains('test'); - } - - public function testUpdate() - { - $ret = $this->_conn->insert('blob_table', - array('id' => 1, 'clobfield' => 'test', 'blobfield' => 'test'), - array(\PDO::PARAM_INT, \PDO::PARAM_STR, \PDO::PARAM_LOB) - ); - - $this->_conn->update('blob_table', - array('blobfield' => 'test2'), - array('id' => 1), - array(\PDO::PARAM_LOB, \PDO::PARAM_INT) - ); - - $this->assertBlobContains('test2'); - } - - private function assertBlobContains($text) - { - $rows = $this->_conn->fetchAll('SELECT * FROM blob_table'); - - $this->assertEquals(1, count($rows)); - $row = array_change_key_case($rows[0], CASE_LOWER); - - $blobValue = Type::getType('blob')->convertToPHPValue($row['blobfield'], $this->_conn->getDatabasePlatform()); - - $this->assertInternalType('resource', $blobValue); - $this->assertEquals($text, stream_get_contents($blobValue)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php deleted file mode 100644 index 31da42f..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php +++ /dev/null @@ -1,219 +0,0 @@ -resetSharedConn(); - parent::setUp(); - } - - public function tearDown() - { - parent::tearDown(); - $this->resetSharedConn(); - } - - public function testGetWrappedConnection() - { - $this->assertInstanceOf('Doctrine\DBAL\Driver\Connection', $this->_conn->getWrappedConnection()); - } - - public function testCommitWithRollbackOnlyThrowsException() - { - $this->_conn->beginTransaction(); - $this->_conn->setRollbackOnly(); - $this->setExpectedException('Doctrine\DBAL\ConnectionException'); - $this->_conn->commit(); - } - - public function testTransactionNestingBehavior() - { - try { - $this->_conn->beginTransaction(); - $this->assertEquals(1, $this->_conn->getTransactionNestingLevel()); - - try { - $this->_conn->beginTransaction(); - $this->assertEquals(2, $this->_conn->getTransactionNestingLevel()); - throw new \Exception; - $this->_conn->commit(); // never reached - } catch (\Exception $e) { - $this->_conn->rollback(); - $this->assertEquals(1, $this->_conn->getTransactionNestingLevel()); - //no rethrow - } - $this->assertTrue($this->_conn->isRollbackOnly()); - - $this->_conn->commit(); // should throw exception - $this->fail('Transaction commit after failed nested transaction should fail.'); - } catch (ConnectionException $e) { - $this->assertEquals(1, $this->_conn->getTransactionNestingLevel()); - $this->_conn->rollback(); - $this->assertEquals(0, $this->_conn->getTransactionNestingLevel()); - } - } - - public function testTransactionNestingBehaviorWithSavepoints() - { - if (!$this->_conn->getDatabasePlatform()->supportsSavepoints()) { - $this->markTestSkipped('This test requires the platform to support savepoints.'); - } - - $this->_conn->setNestTransactionsWithSavepoints(true); - try { - $this->_conn->beginTransaction(); - $this->assertEquals(1, $this->_conn->getTransactionNestingLevel()); - - try { - $this->_conn->beginTransaction(); - $this->assertEquals(2, $this->_conn->getTransactionNestingLevel()); - $this->_conn->beginTransaction(); - $this->assertEquals(3, $this->_conn->getTransactionNestingLevel()); - $this->_conn->commit(); - $this->assertEquals(2, $this->_conn->getTransactionNestingLevel()); - throw new \Exception; - $this->_conn->commit(); // never reached - } catch (\Exception $e) { - $this->_conn->rollback(); - $this->assertEquals(1, $this->_conn->getTransactionNestingLevel()); - //no rethrow - } - $this->assertFalse($this->_conn->isRollbackOnly()); - try { - $this->_conn->setNestTransactionsWithSavepoints(false); - $this->fail('Should not be able to disable savepoints in usage for nested transactions inside an open transaction.'); - } catch (ConnectionException $e) { - $this->assertTrue($this->_conn->getNestTransactionsWithSavepoints()); - } - $this->_conn->commit(); // should not throw exception - } catch (ConnectionException $e) { - $this->fail('Transaction commit after failed nested transaction should not fail when using savepoints.'); - $this->_conn->rollback(); - } - } - - public function testTransactionNestingBehaviorCantBeChangedInActiveTransaction() - { - if (!$this->_conn->getDatabasePlatform()->supportsSavepoints()) { - $this->markTestSkipped('This test requires the platform to support savepoints.'); - } - - $this->_conn->beginTransaction(); - try { - $this->_conn->setNestTransactionsWithSavepoints(true); - $this->fail('An exception should have been thrown by chaning the nesting transaction behavior within an transaction.'); - } catch(ConnectionException $e) { - $this->_conn->rollBack(); - } - } - - public function testSetNestedTransactionsThroughSavepointsNotSupportedThrowsException() - { - if ($this->_conn->getDatabasePlatform()->supportsSavepoints()) { - $this->markTestSkipped('This test requires the platform not to support savepoints.'); - } - - $this->setExpectedException('Doctrine\DBAL\ConnectionException', "Savepoints are not supported by this driver."); - - $this->_conn->setNestTransactionsWithSavepoints(true); - } - - public function testCreateSavepointsNotSupportedThrowsException() - { - if ($this->_conn->getDatabasePlatform()->supportsSavepoints()) { - $this->markTestSkipped('This test requires the platform not to support savepoints.'); - } - - $this->setExpectedException('Doctrine\DBAL\ConnectionException', "Savepoints are not supported by this driver."); - - $this->_conn->createSavepoint('foo'); - } - - public function testReleaseSavepointsNotSupportedThrowsException() - { - if ($this->_conn->getDatabasePlatform()->supportsSavepoints()) { - $this->markTestSkipped('This test requires the platform not to support savepoints.'); - } - - $this->setExpectedException('Doctrine\DBAL\ConnectionException', "Savepoints are not supported by this driver."); - - $this->_conn->releaseSavepoint('foo'); - } - - public function testRollbackSavepointsNotSupportedThrowsException() - { - if ($this->_conn->getDatabasePlatform()->supportsSavepoints()) { - $this->markTestSkipped('This test requires the platform not to support savepoints.'); - } - - $this->setExpectedException('Doctrine\DBAL\ConnectionException', "Savepoints are not supported by this driver."); - - $this->_conn->rollbackSavepoint('foo'); - } - - public function testTransactionBehaviorWithRollback() - { - try { - $this->_conn->beginTransaction(); - $this->assertEquals(1, $this->_conn->getTransactionNestingLevel()); - - throw new \Exception; - - $this->_conn->commit(); // never reached - } catch (\Exception $e) { - $this->assertEquals(1, $this->_conn->getTransactionNestingLevel()); - $this->_conn->rollback(); - $this->assertEquals(0, $this->_conn->getTransactionNestingLevel()); - } - } - - public function testTransactionBehaviour() - { - try { - $this->_conn->beginTransaction(); - $this->assertEquals(1, $this->_conn->getTransactionNestingLevel()); - $this->_conn->commit(); - } catch (\Exception $e) { - $this->_conn->rollback(); - $this->assertEquals(0, $this->_conn->getTransactionNestingLevel()); - } - - $this->assertEquals(0, $this->_conn->getTransactionNestingLevel()); - } - - public function testTransactionalWithException() - { - try { - $this->_conn->transactional(function($conn) { - $conn->executeQuery($conn->getDatabasePlatform()->getDummySelectSQL()); - throw new \RuntimeException("Ooops!"); - }); - } catch (\RuntimeException $expected) { - $this->assertEquals(0, $this->_conn->getTransactionNestingLevel()); - } - } - - public function testTransactional() - { - $this->_conn->transactional(function($conn) { - /* @var $conn Connection */ - $conn->executeQuery($conn->getDatabasePlatform()->getDummySelectSQL()); - }); - } - - /** - * Tests that the quote function accepts DBAL and PDO types. - */ - public function testQuote() - { - $this->assertEquals($this->_conn->quote("foo", Type::STRING), $this->_conn->quote("foo", \PDO::PARAM_STR)); - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php deleted file mode 100644 index 86a7ee4..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php +++ /dev/null @@ -1,477 +0,0 @@ -addColumn('test_int', 'integer'); - $table->addColumn('test_string', 'string'); - $table->addColumn('test_datetime', 'datetime', array('notnull' => false)); - $table->setPrimaryKey(array('test_int')); - - $sm = $this->_conn->getSchemaManager(); - $sm->createTable($table); - - $this->_conn->insert('fetch_table', array('test_int' => 1, 'test_string' => 'foo', 'test_datetime' => '2010-01-01 10:10:10')); - self::$generated = true; - } - } - - public function testPrepareWithBindValue() - { - $sql = "SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?"; - $stmt = $this->_conn->prepare($sql); - $this->assertInstanceOf('Doctrine\DBAL\Statement', $stmt); - - $stmt->bindValue(1, 1); - $stmt->bindValue(2, 'foo'); - $stmt->execute(); - - $row = $stmt->fetch(\PDO::FETCH_ASSOC); - $row = array_change_key_case($row, \CASE_LOWER); - $this->assertEquals(array('test_int' => 1, 'test_string' => 'foo'), $row); - } - - public function testPrepareWithBindParam() - { - $paramInt = 1; - $paramStr = 'foo'; - - $sql = "SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?"; - $stmt = $this->_conn->prepare($sql); - $this->assertInstanceOf('Doctrine\DBAL\Statement', $stmt); - - $stmt->bindParam(1, $paramInt); - $stmt->bindParam(2, $paramStr); - $stmt->execute(); - - $row = $stmt->fetch(\PDO::FETCH_ASSOC); - $row = array_change_key_case($row, \CASE_LOWER); - $this->assertEquals(array('test_int' => 1, 'test_string' => 'foo'), $row); - } - - public function testPrepareWithFetchAll() - { - $paramInt = 1; - $paramStr = 'foo'; - - $sql = "SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?"; - $stmt = $this->_conn->prepare($sql); - $this->assertInstanceOf('Doctrine\DBAL\Statement', $stmt); - - $stmt->bindParam(1, $paramInt); - $stmt->bindParam(2, $paramStr); - $stmt->execute(); - - $rows = $stmt->fetchAll(\PDO::FETCH_ASSOC); - $rows[0] = array_change_key_case($rows[0], \CASE_LOWER); - $this->assertEquals(array('test_int' => 1, 'test_string' => 'foo'), $rows[0]); - } - - /** - * @group DBAL-228 - */ - public function testPrepareWithFetchAllBoth() - { - $paramInt = 1; - $paramStr = 'foo'; - - $sql = "SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?"; - $stmt = $this->_conn->prepare($sql); - $this->assertInstanceOf('Doctrine\DBAL\Statement', $stmt); - - $stmt->bindParam(1, $paramInt); - $stmt->bindParam(2, $paramStr); - $stmt->execute(); - - $rows = $stmt->fetchAll(\PDO::FETCH_BOTH); - $rows[0] = array_change_key_case($rows[0], \CASE_LOWER); - $this->assertEquals(array('test_int' => 1, 'test_string' => 'foo', 0 => 1, 1 => 'foo'), $rows[0]); - } - - public function testPrepareWithFetchColumn() - { - $paramInt = 1; - $paramStr = 'foo'; - - $sql = "SELECT test_int FROM fetch_table WHERE test_int = ? AND test_string = ?"; - $stmt = $this->_conn->prepare($sql); - $this->assertInstanceOf('Doctrine\DBAL\Statement', $stmt); - - $stmt->bindParam(1, $paramInt); - $stmt->bindParam(2, $paramStr); - $stmt->execute(); - - $column = $stmt->fetchColumn(); - $this->assertEquals(1, $column); - } - - public function testPrepareWithIterator() - { - $paramInt = 1; - $paramStr = 'foo'; - - $sql = "SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?"; - $stmt = $this->_conn->prepare($sql); - $this->assertInstanceOf('Doctrine\DBAL\Statement', $stmt); - - $stmt->bindParam(1, $paramInt); - $stmt->bindParam(2, $paramStr); - $stmt->execute(); - - $rows = array(); - $stmt->setFetchMode(\PDO::FETCH_ASSOC); - foreach ($stmt as $row) { - $rows[] = array_change_key_case($row, \CASE_LOWER); - } - - $this->assertEquals(array('test_int' => 1, 'test_string' => 'foo'), $rows[0]); - } - - public function testPrepareWithQuoted() - { - $table = 'fetch_table'; - $paramInt = 1; - $paramStr = 'foo'; - - $sql = "SELECT test_int, test_string FROM " . $this->_conn->quoteIdentifier($table) . " ". - "WHERE test_int = " . $this->_conn->quote($paramInt) . " AND test_string = " . $this->_conn->quote($paramStr); - $stmt = $this->_conn->prepare($sql); - $this->assertInstanceOf('Doctrine\DBAL\Statement', $stmt); - } - - public function testPrepareWithExecuteParams() - { - $paramInt = 1; - $paramStr = 'foo'; - - $sql = "SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?"; - $stmt = $this->_conn->prepare($sql); - $this->assertInstanceOf('Doctrine\DBAL\Statement', $stmt); - $stmt->execute(array($paramInt, $paramStr)); - - $row = $stmt->fetch(\PDO::FETCH_ASSOC); - $this->assertTrue($row !== false); - $row = array_change_key_case($row, \CASE_LOWER); - $this->assertEquals(array('test_int' => 1, 'test_string' => 'foo'), $row); - } - - public function testFetchAll() - { - $sql = "SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?"; - $data = $this->_conn->fetchAll($sql, array(1, 'foo')); - - $this->assertEquals(1, count($data)); - - $row = $data[0]; - $this->assertEquals(2, count($row)); - - $row = array_change_key_case($row, \CASE_LOWER); - $this->assertEquals(1, $row['test_int']); - $this->assertEquals('foo', $row['test_string']); - } - - public function testFetchBoth() - { - $sql = "SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?"; - $row = $this->_conn->executeQuery($sql, array(1, 'foo'))->fetch(); - - $this->assertTrue($row !== false); - - $row = array_change_key_case($row, \CASE_LOWER); - - $this->assertEquals(1, $row['test_int']); - $this->assertEquals('foo', $row['test_string']); - $this->assertEquals(1, $row[0]); - $this->assertEquals('foo', $row[1]); - } - - public function testFetchRow() - { - $sql = "SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?"; - $row = $this->_conn->fetchAssoc($sql, array(1, 'foo')); - - $this->assertTrue($row !== false); - - $row = array_change_key_case($row, \CASE_LOWER); - - $this->assertEquals(1, $row['test_int']); - $this->assertEquals('foo', $row['test_string']); - } - - public function testFetchArray() - { - $sql = "SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?"; - $row = $this->_conn->fetchArray($sql, array(1, 'foo')); - - $this->assertEquals(1, $row[0]); - $this->assertEquals('foo', $row[1]); - } - - public function testFetchColumn() - { - $sql = "SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?"; - $testInt = $this->_conn->fetchColumn($sql, array(1, 'foo'), 0); - - $this->assertEquals(1, $testInt); - - $sql = "SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?"; - $testString = $this->_conn->fetchColumn($sql, array(1, 'foo'), 1); - - $this->assertEquals('foo', $testString); - } - - /** - * @group DDC-697 - */ - public function testExecuteQueryBindDateTimeType() - { - $sql = 'SELECT count(*) AS c FROM fetch_table WHERE test_datetime = ?'; - $stmt = $this->_conn->executeQuery($sql, - array(1 => new \DateTime('2010-01-01 10:10:10')), - array(1 => Type::DATETIME) - ); - - $this->assertEquals(1, $stmt->fetchColumn()); - } - - /** - * @group DDC-697 - */ - public function testExecuteUpdateBindDateTimeType() - { - $datetime = new \DateTime('2010-02-02 20:20:20'); - - $sql = 'INSERT INTO fetch_table (test_int, test_string, test_datetime) VALUES (?, ?, ?)'; - $affectedRows = $this->_conn->executeUpdate($sql, - array(1 => 50, 2 => 'foo', 3 => $datetime), - array(1 => PDO::PARAM_INT, 2 => PDO::PARAM_STR, 3 => Type::DATETIME) - ); - - $this->assertEquals(1, $affectedRows); - $this->assertEquals(1, $this->_conn->executeQuery( - 'SELECT count(*) AS c FROM fetch_table WHERE test_datetime = ?', - array(1 => $datetime), - array(1 => Type::DATETIME) - )->fetchColumn()); - } - - /** - * @group DDC-697 - */ - public function testPrepareQueryBindValueDateTimeType() - { - $sql = 'SELECT count(*) AS c FROM fetch_table WHERE test_datetime = ?'; - $stmt = $this->_conn->prepare($sql); - $stmt->bindValue(1, new \DateTime('2010-01-01 10:10:10'), Type::DATETIME); - $stmt->execute(); - - $this->assertEquals(1, $stmt->fetchColumn()); - } - - /** - * @group DBAL-78 - */ - public function testNativeArrayListSupport() - { - for ($i = 100; $i < 110; $i++) { - $this->_conn->insert('fetch_table', array('test_int' => $i, 'test_string' => 'foo' . $i, 'test_datetime' => '2010-01-01 10:10:10')); - } - - $stmt = $this->_conn->executeQuery('SELECT test_int FROM fetch_table WHERE test_int IN (?)', - array(array(100, 101, 102, 103, 104)), array(Connection::PARAM_INT_ARRAY)); - - $data = $stmt->fetchAll(PDO::FETCH_NUM); - $this->assertEquals(5, count($data)); - $this->assertEquals(array(array(100), array(101), array(102), array(103), array(104)), $data); - - $stmt = $this->_conn->executeQuery('SELECT test_int FROM fetch_table WHERE test_string IN (?)', - array(array('foo100', 'foo101', 'foo102', 'foo103', 'foo104')), array(Connection::PARAM_STR_ARRAY)); - - $data = $stmt->fetchAll(PDO::FETCH_NUM); - $this->assertEquals(5, count($data)); - $this->assertEquals(array(array(100), array(101), array(102), array(103), array(104)), $data); - } - - /** - * @group DDC-1014 - */ - public function testDateArithmetics() - { - $p = $this->_conn->getDatabasePlatform(); - $sql = 'SELECT '; - $sql .= $p->getDateDiffExpression('test_datetime', $p->getCurrentTimestampSQL()) .' AS diff, '; - $sql .= $p->getDateAddDaysExpression('test_datetime', 10) .' AS add_days, '; - $sql .= $p->getDateSubDaysExpression('test_datetime', 10) .' AS sub_days, '; - $sql .= $p->getDateAddMonthExpression('test_datetime', 2) .' AS add_month, '; - $sql .= $p->getDateSubMonthExpression('test_datetime', 2) .' AS sub_month '; - $sql .= 'FROM fetch_table'; - - $row = $this->_conn->fetchAssoc($sql); - $row = array_change_key_case($row, CASE_LOWER); - - $diff = floor( (strtotime('2010-01-01')-time()) / 3600 / 24); - $this->assertEquals($diff, (int)$row['diff'], "Date difference should be approx. ".$diff." days.", 1); - $this->assertEquals('2010-01-11', date('Y-m-d', strtotime($row['add_days'])), "Adding date should end up on 2010-01-11"); - $this->assertEquals('2009-12-22', date('Y-m-d', strtotime($row['sub_days'])), "Subtracting date should end up on 2009-12-22"); - $this->assertEquals('2010-03-01', date('Y-m-d', strtotime($row['add_month'])), "Adding month should end up on 2010-03-01"); - $this->assertEquals('2009-11-01', date('Y-m-d', strtotime($row['sub_month'])), "Adding month should end up on 2009-11-01"); - } - - public function testQuoteSQLInjection() - { - $sql = "SELECT * FROM fetch_table WHERE test_string = " . $this->_conn->quote("bar' OR '1'='1"); - $rows = $this->_conn->fetchAll($sql); - - $this->assertEquals(0, count($rows), "no result should be returned, otherwise SQL injection is possible"); - } - - /** - * @group DDC-1213 - */ - public function testBitComparisonExpressionSupport() - { - $this->_conn->executeQuery('DELETE FROM fetch_table')->execute(); - $platform = $this->_conn->getDatabasePlatform(); - $bitmap = array(); - - for ($i = 2; $i < 9; $i = $i + 2) { - $bitmap[$i] = array( - 'bit_or' => ($i | 2), - 'bit_and' => ($i & 2) - ); - $this->_conn->insert('fetch_table', array( - 'test_int' => $i, - 'test_string' => json_encode($bitmap[$i]), - 'test_datetime' => '2010-01-01 10:10:10' - )); - } - - $sql[] = 'SELECT '; - $sql[] = 'test_int, '; - $sql[] = 'test_string, '; - $sql[] = $platform->getBitOrComparisonExpression('test_int', 2) . ' AS bit_or, '; - $sql[] = $platform->getBitAndComparisonExpression('test_int', 2) . ' AS bit_and '; - $sql[] = 'FROM fetch_table'; - - $stmt = $this->_conn->executeQuery(implode(PHP_EOL, $sql)); - $data = $stmt->fetchAll(PDO::FETCH_ASSOC); - - - $this->assertEquals(4, count($data)); - $this->assertEquals(count($bitmap), count($data)); - foreach ($data as $row) { - $row = array_change_key_case($row, CASE_LOWER); - - $this->assertArrayHasKey('test_int', $row); - - $id = $row['test_int']; - - $this->assertArrayHasKey($id, $bitmap); - $this->assertArrayHasKey($id, $bitmap); - - $this->assertArrayHasKey('bit_or', $row); - $this->assertArrayHasKey('bit_and', $row); - - $this->assertEquals($row['bit_or'], $bitmap[$id]['bit_or']); - $this->assertEquals($row['bit_and'], $bitmap[$id]['bit_and']); - } - } - - public function testSetDefaultFetchMode() - { - $stmt = $this->_conn->query("SELECT * FROM fetch_table"); - $stmt->setFetchMode(\PDO::FETCH_NUM); - - $row = array_keys($stmt->fetch()); - $this->assertEquals(0, count( array_filter($row, function($v) { return ! is_numeric($v); })), "should be no non-numerical elements in the result."); - } - - /** - * @group DBAL-196 - */ - public function testFetchAllSupportFetchClass() - { - $this->skipOci8AndMysqli(); - - $this->_conn->executeQuery('DELETE FROM fetch_table')->execute(); - $this->_conn->insert('fetch_table', array( - 'test_int' => 1, - 'test_string' => 'foo', - 'test_datetime' => '2010-01-01 10:10:10' - )); - - $sql = "SELECT test_int, test_string, test_datetime FROM fetch_table"; - $stmt = $this->_conn->prepare($sql); - $stmt->execute(); - - $results = $stmt->fetchAll( - \PDO::FETCH_CLASS, - __NAMESPACE__.'\\MyFetchClass' - ); - - $this->assertEquals(1, count($results)); - $this->assertInstanceOf(__NAMESPACE__.'\\MyFetchClass', $results[0]); - - $this->assertEquals(1, $results[0]->test_int); - $this->assertEquals('foo', $results[0]->test_string); - $this->assertStringStartsWith('2010-01-01 10:10:10', $results[0]->test_datetime); - } - - /** - * @group DBAL-241 - */ - public function testFetchAllStyleColumn() - { - $sql = "DELETE FROM fetch_table"; - $this->_conn->executeUpdate($sql); - - $this->_conn->insert('fetch_table', array('test_int' => 1, 'test_string' => 'foo')); - $this->_conn->insert('fetch_table', array('test_int' => 10, 'test_string' => 'foo')); - - $sql = "SELECT test_int FROM fetch_table"; - $rows = $this->_conn->query($sql)->fetchAll(\PDO::FETCH_COLUMN); - - $this->assertEquals(array(1, 10), $rows); - } - - /** - * @group DBAL-257 - */ - public function testEmptyFetchColumnReturnsFalse() - { - $this->_conn->executeQuery('DELETE FROM fetch_table')->execute(); - $this->assertFalse($this->_conn->fetchColumn('SELECT test_int FROM fetch_table')); - $this->assertFalse($this->_conn->query('SELECT test_int FROM fetch_table')->fetchColumn()); - } - - private function skipOci8AndMysqli() - { - if (isset($GLOBALS['db_type']) && $GLOBALS['db_type'] == "oci8") { - $this->markTestSkipped("Not supported by OCI8"); - } - if ('mysqli' == $this->_conn->getDriver()->getName()) { - $this->markTestSkipped('Mysqli driver dont support this feature.'); - } - } -} - -class MyFetchClass -{ - public $test_int, $test_string, $test_datetime; -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/LoggingTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/LoggingTest.php deleted file mode 100644 index 7c96813..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/LoggingTest.php +++ /dev/null @@ -1,52 +0,0 @@ -_conn->getDatabasePlatform()->getDummySelectSQL(); - - $logMock = $this->getMock('Doctrine\DBAL\Logging\SQLLogger'); - $logMock->expects($this->at(0)) - ->method('startQuery') - ->with($this->equalTo($sql), $this->equalTo(array()), $this->equalTo(array())); - $logMock->expects($this->at(1)) - ->method('stopQuery'); - $this->_conn->getConfiguration()->setSQLLogger($logMock); - $this->_conn->executeQuery($sql, array()); - } - - public function testLogExecuteUpdate() - { - $this->markTestSkipped('Test breaks MySQL but works on all other platforms (Unbuffered Queries stuff).'); - - $sql = $this->_conn->getDatabasePlatform()->getDummySelectSQL(); - - $logMock = $this->getMock('Doctrine\DBAL\Logging\SQLLogger'); - $logMock->expects($this->at(0)) - ->method('startQuery') - ->with($this->equalTo($sql), $this->equalTo(array()), $this->equalTo(array())); - $logMock->expects($this->at(1)) - ->method('stopQuery'); - $this->_conn->getConfiguration()->setSQLLogger($logMock); - $this->_conn->executeUpdate($sql, array()); - } - - public function testLogPrepareExecute() - { - $sql = $this->_conn->getDatabasePlatform()->getDummySelectSQL(); - - $logMock = $this->getMock('Doctrine\DBAL\Logging\SQLLogger'); - $logMock->expects($this->once()) - ->method('startQuery') - ->with($this->equalTo($sql), $this->equalTo(array())); - $logMock->expects($this->at(1)) - ->method('stopQuery'); - $this->_conn->getConfiguration()->setSQLLogger($logMock); - - $stmt = $this->_conn->prepare($sql); - $stmt->execute(); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/MasterSlaveConnectionTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/MasterSlaveConnectionTest.php deleted file mode 100644 index 6959d30..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/MasterSlaveConnectionTest.php +++ /dev/null @@ -1,82 +0,0 @@ -_conn->getDatabasePlatform()->getName() == "sqlite") { - $this->markTestSkipped('Test does not work on sqlite.'); - } - - try { - /* @var $sm \Doctrine\DBAL\Schema\AbstractSchemaManager */ - $table = new \Doctrine\DBAL\Schema\Table("master_slave_table"); - $table->addColumn('test_int', 'integer'); - $table->setPrimaryKey(array('test_int')); - - $sm = $this->_conn->getSchemaManager(); - $sm->createTable($table); - - $this->_conn->insert('master_slave_table', array('test_int' => 1)); - } catch(\Exception $e) { - } - } - - public function createMasterSlaveConnection() - { - $params = $this->_conn->getParams(); - $params['master'] = $params; - $params['slaves'] = array($params, $params); - $params['wrapperClass'] = 'Doctrine\DBAL\Connections\MasterSlaveConnection'; - - return DriverManager::getConnection($params); - } - - public function testMasterOnConnect() - { - $conn = $this->createMasterSlaveConnection(); - - $this->assertFalse($conn->isConnectedToMaster()); - $conn->connect('slave'); - $this->assertFalse($conn->isConnectedToMaster()); - $conn->connect('master'); - $this->assertTrue($conn->isConnectedToMaster()); - } - - public function testNoMasterOnExecuteQuery() - { - $conn = $this->createMasterSlaveConnection(); - - $sql = "SELECT count(*) as num FROM master_slave_table"; - $data = $conn->fetchAll($sql); - $data[0] = array_change_key_case($data[0], CASE_LOWER); - - $this->assertEquals(1, $data[0]['num']); - $this->assertFalse($conn->isConnectedToMaster()); - } - - public function testMasterOnWriteOperation() - { - $conn = $this->createMasterSlaveConnection(); - $conn->insert('master_slave_table', array('test_int' => 30)); - - $this->assertTrue($conn->isConnectedToMaster()); - - $sql = "SELECT count(*) as num FROM master_slave_table"; - $data = $conn->fetchAll($sql); - $data[0] = array_change_key_case($data[0], CASE_LOWER); - - $this->assertEquals(2, $data[0]['num']); - $this->assertTrue($conn->isConnectedToMaster()); - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/ModifyLimitQueryTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/ModifyLimitQueryTest.php deleted file mode 100644 index 69ba6ac..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/ModifyLimitQueryTest.php +++ /dev/null @@ -1,114 +0,0 @@ -addColumn('test_int', 'integer'); - $table->setPrimaryKey(array('test_int')); - - $table2 = new \Doctrine\DBAL\Schema\Table("modify_limit_table2"); - $table2->addColumn('id', 'integer', array('autoincrement' => true)); - $table2->addColumn('test_int', 'integer'); - $table2->setPrimaryKey(array('id')); - - $sm = $this->_conn->getSchemaManager(); - $sm->createTable($table); - $sm->createTable($table2); - self::$tableCreated = true; - } - $this->_conn->exec($this->_conn->getDatabasePlatform()->getTruncateTableSQL('modify_limit_table')); - $this->_conn->exec($this->_conn->getDatabasePlatform()->getTruncateTableSQL('modify_limit_table2')); - } - - public function testModifyLimitQuerySimpleQuery() - { - $this->_conn->insert('modify_limit_table', array('test_int' => 1)); - $this->_conn->insert('modify_limit_table', array('test_int' => 2)); - $this->_conn->insert('modify_limit_table', array('test_int' => 3)); - $this->_conn->insert('modify_limit_table', array('test_int' => 4)); - - $sql = "SELECT * FROM modify_limit_table"; - - $this->assertLimitResult(array(1, 2, 3, 4), $sql, 10, 0); - $this->assertLimitResult(array(1, 2), $sql, 2, 0); - $this->assertLimitResult(array(3, 4), $sql, 2, 2); - } - - public function testModifyLimitQueryJoinQuery() - { - $this->_conn->insert('modify_limit_table', array('test_int' => 1)); - $this->_conn->insert('modify_limit_table', array('test_int' => 2)); - - $this->_conn->insert('modify_limit_table2', array('test_int' => 1)); - $this->_conn->insert('modify_limit_table2', array('test_int' => 1)); - $this->_conn->insert('modify_limit_table2', array('test_int' => 1)); - $this->_conn->insert('modify_limit_table2', array('test_int' => 2)); - $this->_conn->insert('modify_limit_table2', array('test_int' => 2)); - - $sql = "SELECT modify_limit_table.test_int FROM modify_limit_table INNER JOIN modify_limit_table2 ON modify_limit_table.test_int = modify_limit_table2.test_int"; - - $this->assertLimitResult(array(1, 1, 1, 2, 2), $sql, 10, 0); - $this->assertLimitResult(array(1, 1, 1), $sql, 3, 0); - $this->assertLimitResult(array(2, 2), $sql, 2, 3); - } - - public function testModifyLimitQueryOrderBy() - { - $this->_conn->insert('modify_limit_table', array('test_int' => 1)); - $this->_conn->insert('modify_limit_table', array('test_int' => 2)); - $this->_conn->insert('modify_limit_table', array('test_int' => 3)); - $this->_conn->insert('modify_limit_table', array('test_int' => 4)); - - $sql = "SELECT * FROM modify_limit_table ORDER BY test_int DESC"; - - $this->assertLimitResult(array(4, 3, 2, 1), $sql, 10, 0); - $this->assertLimitResult(array(4, 3), $sql, 2, 0); - $this->assertLimitResult(array(2, 1), $sql, 2, 2); - } - - public function testModifyLimitQueryGroupBy() - { - $this->_conn->insert('modify_limit_table', array('test_int' => 1)); - $this->_conn->insert('modify_limit_table', array('test_int' => 2)); - - $this->_conn->insert('modify_limit_table2', array('test_int' => 1)); - $this->_conn->insert('modify_limit_table2', array('test_int' => 1)); - $this->_conn->insert('modify_limit_table2', array('test_int' => 1)); - $this->_conn->insert('modify_limit_table2', array('test_int' => 2)); - $this->_conn->insert('modify_limit_table2', array('test_int' => 2)); - - $sql = "SELECT modify_limit_table.test_int FROM modify_limit_table " . - "INNER JOIN modify_limit_table2 ON modify_limit_table.test_int = modify_limit_table2.test_int ". - "GROUP BY modify_limit_table.test_int"; - $this->assertLimitResult(array(1, 2), $sql, 10, 0); - $this->assertLimitResult(array(1), $sql, 1, 0); - $this->assertLimitResult(array(2), $sql, 1, 1); - } - - public function assertLimitResult($expectedResults, $sql, $limit, $offset) - { - $p = $this->_conn->getDatabasePlatform(); - $data = array(); - foreach ($this->_conn->fetchAll($p->modifyLimitQuery($sql, $limit, $offset)) AS $row) { - $row = array_change_key_case($row, CASE_LOWER); - $data[] = $row['test_int']; - } - $this->assertEquals($expectedResults, $data); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/NamedParametersTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/NamedParametersTest.php deleted file mode 100644 index 6f9e513..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/NamedParametersTest.php +++ /dev/null @@ -1,166 +0,0 @@ -1,'bar'=> array(1, 2, 3)), - array('foo'=>PDO::PARAM_INT,'bar'=> Connection::PARAM_INT_ARRAY,), - array( - array('id'=>1,'foo'=>1,'bar'=>1), - array('id'=>2,'foo'=>1,'bar'=>2), - array('id'=>3,'foo'=>1,'bar'=>3), - ) - ), - - array( - 'SELECT * FROM ddc1372_foobar f WHERE f.foo = :foo AND f.bar IN (:bar)', - array('foo'=>1,'bar'=> array(1, 2, 3)), - array('bar'=> Connection::PARAM_INT_ARRAY,'foo'=>PDO::PARAM_INT), - array( - array('id'=>1,'foo'=>1,'bar'=>1), - array('id'=>2,'foo'=>1,'bar'=>2), - array('id'=>3,'foo'=>1,'bar'=>3), - ) - ), - - array( - 'SELECT * FROM ddc1372_foobar f WHERE f.bar IN (:bar) AND f.foo = :foo', - array('foo'=>1,'bar'=> array(1, 2, 3)), - array('bar'=> Connection::PARAM_INT_ARRAY,'foo'=>PDO::PARAM_INT), - array( - array('id'=>1,'foo'=>1,'bar'=>1), - array('id'=>2,'foo'=>1,'bar'=>2), - array('id'=>3,'foo'=>1,'bar'=>3), - ) - ), - - array( - 'SELECT * FROM ddc1372_foobar f WHERE f.bar IN (:bar) AND f.foo = :foo', - array('foo'=>1,'bar'=> array('1', '2', '3')), - array('bar'=> Connection::PARAM_STR_ARRAY,'foo'=>PDO::PARAM_INT), - array( - array('id'=>1,'foo'=>1,'bar'=>1), - array('id'=>2,'foo'=>1,'bar'=>2), - array('id'=>3,'foo'=>1,'bar'=>3), - ) - ), - - array( - 'SELECT * FROM ddc1372_foobar f WHERE f.bar IN (:bar) AND f.foo IN (:foo)', - array('foo'=>array('1'),'bar'=> array(1, 2, 3,4)), - array('bar'=> Connection::PARAM_STR_ARRAY,'foo'=>Connection::PARAM_INT_ARRAY), - array( - array('id'=>1,'foo'=>1,'bar'=>1), - array('id'=>2,'foo'=>1,'bar'=>2), - array('id'=>3,'foo'=>1,'bar'=>3), - array('id'=>4,'foo'=>1,'bar'=>4), - ) - ), - - array( - 'SELECT * FROM ddc1372_foobar f WHERE f.bar IN (:bar) AND f.foo IN (:foo)', - array('foo'=>1,'bar'=> 2), - array('bar'=>PDO::PARAM_INT,'foo'=>PDO::PARAM_INT), - array( - array('id'=>2,'foo'=>1,'bar'=>2), - ) - ), - - array( - 'SELECT * FROM ddc1372_foobar f WHERE f.bar = :arg AND f.foo <> :arg', - array('arg'=>'1'), - array('arg'=>PDO::PARAM_STR), - array( - array('id'=>5,'foo'=>2,'bar'=>1), - ) - ), - - array( - 'SELECT * FROM ddc1372_foobar f WHERE f.bar NOT IN (:arg) AND f.foo IN (:arg)', - array('arg'=>array(1, 2)), - array('arg'=>Connection::PARAM_INT_ARRAY), - array( - array('id'=>3,'foo'=>1,'bar'=>3), - array('id'=>4,'foo'=>1,'bar'=>4), - ) - ), - - ); - } - - public function setUp() - { - parent::setUp(); - - if (!$this->_conn->getSchemaManager()->tablesExist("ddc1372_foobar")) { - try { - $table = new \Doctrine\DBAL\Schema\Table("ddc1372_foobar"); - $table->addColumn('id', 'integer'); - $table->addColumn('foo','string'); - $table->addColumn('bar','string'); - $table->setPrimaryKey(array('id')); - - - $sm = $this->_conn->getSchemaManager(); - $sm->createTable($table); - - $this->_conn->insert('ddc1372_foobar', array( - 'id' => 1, 'foo' => 1, 'bar' => 1 - )); - $this->_conn->insert('ddc1372_foobar', array( - 'id' => 2, 'foo' => 1, 'bar' => 2 - )); - $this->_conn->insert('ddc1372_foobar', array( - 'id' => 3, 'foo' => 1, 'bar' => 3 - )); - $this->_conn->insert('ddc1372_foobar', array( - 'id' => 4, 'foo' => 1, 'bar' => 4 - )); - $this->_conn->insert('ddc1372_foobar', array( - 'id' => 5, 'foo' => 2, 'bar' => 1 - )); - $this->_conn->insert('ddc1372_foobar', array( - 'id' => 6, 'foo' => 2, 'bar' => 2 - )); - } catch(\Exception $e) { - $this->fail($e->getMessage()); - } - } - } - - /** - * @dataProvider ticketProvider - * @param string $query - * @param array $params - * @param array $types - * @param array $expected - */ - public function testTicket($query,$params,$types,$expected) - { - $stmt = $this->_conn->executeQuery($query, $params, $types); - $result = $stmt->fetchAll(\PDO::FETCH_ASSOC); - - foreach ($result as $k => $v) { - $result[$k] = array_change_key_case($v, CASE_LOWER); - } - - $this->assertEquals($result, $expected); - } - -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/PortabilityTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/PortabilityTest.php deleted file mode 100644 index acf995b..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/PortabilityTest.php +++ /dev/null @@ -1,97 +0,0 @@ -portableConnection) { - $this->portableConnection->close(); - } - } - - private function getPortableConnection($portabilityMode = \Doctrine\DBAL\Portability\Connection::PORTABILITY_ALL, $case = \PDO::CASE_LOWER) - { - if (!$this->portableConnection) { - $params = $this->_conn->getParams(); - $params['wrapperClass'] = 'Doctrine\DBAL\Portability\Connection'; - $params['portability'] = $portabilityMode; - $params['fetch_case'] = $case; - $this->portableConnection = DriverManager::getConnection($params, $this->_conn->getConfiguration(), $this->_conn->getEventManager()); - - try { - /* @var $sm \Doctrine\DBAL\Schema\AbstractSchemaManager */ - $table = new \Doctrine\DBAL\Schema\Table("portability_table"); - $table->addColumn('Test_Int', 'integer'); - $table->addColumn('Test_String', 'string', array('fixed' => true, 'length' => 32)); - $table->addColumn('Test_Null', 'string', array('notnull' => false)); - $table->setPrimaryKey(array('Test_Int')); - - $sm = $this->portableConnection->getSchemaManager(); - $sm->createTable($table); - - $this->portableConnection->insert('portability_table', array('Test_Int' => 1, 'Test_String' => 'foo', 'Test_Null' => '')); - $this->portableConnection->insert('portability_table', array('Test_Int' => 2, 'Test_String' => 'foo ', 'Test_Null' => null)); - } catch(\Exception $e) { - - } - } - - return $this->portableConnection; - } - - public function testFullFetchMode() - { - $rows = $this->getPortableConnection()->fetchAll('SELECT * FROM portability_table'); - $this->assertFetchResultRows($rows); - - $stmt = $this->getPortableConnection()->query('SELECT * FROM portability_table'); - $stmt->setFetchMode(\PDO::FETCH_ASSOC); - foreach ($stmt as $row) { - $this->assertFetchResultRow($row); - } - - $stmt = $this->getPortableConnection()->query('SELECT * FROM portability_table'); - while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { - $this->assertFetchResultRow($row); - } - - $stmt = $this->getPortableConnection()->prepare('SELECT * FROM portability_table'); - $stmt->execute(); - - while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { - $this->assertFetchResultRow($row); - } - } - - public function assertFetchResultRows($rows) - { - $this->assertEquals(2, count($rows)); - foreach ($rows AS $row) { - $this->assertFetchResultRow($row); - } - } - - public function assertFetchResultRow($row) - { - $this->assertTrue(in_array($row['test_int'], array(1, 2)), "Primary key test_int should either be 1 or 2."); - $this->assertArrayHasKey('test_string', $row, "Case should be lowered."); - $this->assertEquals(3, strlen($row['test_string']), "test_string should be rtrimed to length of three for CHAR(32) column."); - $this->assertNull($row['test_null']); - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php deleted file mode 100644 index 5e678a7..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php +++ /dev/null @@ -1,199 +0,0 @@ - 100, 'test_string' => 'foo'), array('test_int' => 200, 'test_string' => 'bar'), array('test_int' => 300, 'test_string' => 'baz')); - private $sqlLogger; - - public function setUp() - { - parent::setUp(); - - try { - /* @var $sm \Doctrine\DBAL\Schema\AbstractSchemaManager */ - $table = new \Doctrine\DBAL\Schema\Table("caching"); - $table->addColumn('test_int', 'integer'); - $table->addColumn('test_string', 'string', array('notnull' => false)); - $table->setPrimaryKey(array('test_int')); - - $sm = $this->_conn->getSchemaManager(); - $sm->createTable($table); - } catch(\Exception $e) { - - } - $this->_conn->executeUpdate('DELETE FROM caching'); - foreach ($this->expectedResult AS $row) { - $this->_conn->insert('caching', $row); - } - - $config = $this->_conn->getConfiguration(); - $config->setSQLLogger($this->sqlLogger = new \Doctrine\DBAL\Logging\DebugStack); - - $cache = new \Doctrine\Common\Cache\ArrayCache; - $config->setResultCacheImpl($cache); - } - - public function testCacheFetchAssoc() - { - $this->assertCacheNonCacheSelectSameFetchModeAreEqual($this->expectedResult, \PDO::FETCH_ASSOC); - } - - public function testFetchNum() - { - $expectedResult = array(); - foreach ($this->expectedResult AS $v) { - $expectedResult[] = array_values($v); - } - $this->assertCacheNonCacheSelectSameFetchModeAreEqual($expectedResult, \PDO::FETCH_NUM); - } - - public function testFetchBoth() - { - $expectedResult = array(); - foreach ($this->expectedResult AS $v) { - $expectedResult[] = array_merge($v, array_values($v)); - } - $this->assertCacheNonCacheSelectSameFetchModeAreEqual($expectedResult, \PDO::FETCH_BOTH); - } - - public function testMixingFetch() - { - $numExpectedResult = array(); - foreach ($this->expectedResult AS $v) { - $numExpectedResult[] = array_values($v); - } - $stmt = $this->_conn->executeQuery("SELECT * FROM caching ORDER BY test_int ASC", array(), array(), new QueryCacheProfile(10, "testcachekey")); - - $data = $this->hydrateStmt($stmt, \PDO::FETCH_ASSOC); - - $this->assertEquals($this->expectedResult, $data); - - $stmt = $this->_conn->executeQuery("SELECT * FROM caching ORDER BY test_int ASC", array(), array(), new QueryCacheProfile(10, "testcachekey")); - - $data = $this->hydrateStmt($stmt, \PDO::FETCH_NUM); - - $this->assertEquals($numExpectedResult, $data); - } - - public function testIteratorFetch() - { - $this->assertStandardAndIteratorFetchAreEqual(\PDO::FETCH_BOTH); - $this->assertStandardAndIteratorFetchAreEqual(\PDO::FETCH_ASSOC); - $this->assertStandardAndIteratorFetchAreEqual(\PDO::FETCH_NUM); - } - - public function assertStandardAndIteratorFetchAreEqual($fetchStyle) - { - $stmt = $this->_conn->executeQuery("SELECT * FROM caching ORDER BY test_int ASC", array(), array(), new QueryCacheProfile(10, "testcachekey")); - $data = $this->hydrateStmt($stmt, $fetchStyle); - - $stmt = $this->_conn->executeQuery("SELECT * FROM caching ORDER BY test_int ASC", array(), array(), new QueryCacheProfile(10, "testcachekey")); - $data_iterator = $this->hydrateStmtIterator($stmt, $fetchStyle); - - $this->assertEquals($data, $data_iterator); - } - - public function testDontCloseNoCache() - { - $stmt = $this->_conn->executeQuery("SELECT * FROM caching ORDER BY test_int ASC", array(), array(), new QueryCacheProfile(10, "testcachekey")); - - $data = array(); - while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { - $data[] = $row; - } - - $stmt = $this->_conn->executeQuery("SELECT * FROM caching ORDER BY test_int ASC", array(), array(), new QueryCacheProfile(10, "testcachekey")); - - $data = array(); - while ($row = $stmt->fetch(\PDO::FETCH_NUM)) { - $data[] = $row; - } - - $this->assertEquals(2, count($this->sqlLogger->queries)); - } - - public function testDontFinishNoCache() - { - $stmt = $this->_conn->executeQuery("SELECT * FROM caching ORDER BY test_int ASC", array(), array(), new QueryCacheProfile(10, "testcachekey")); - - $row = $stmt->fetch(\PDO::FETCH_ASSOC); - $stmt->closeCursor(); - - $stmt = $this->_conn->executeQuery("SELECT * FROM caching ORDER BY test_int ASC", array(), array(), new QueryCacheProfile(10, "testcachekey")); - - $data = $this->hydrateStmt($stmt, \PDO::FETCH_NUM); - - $this->assertEquals(2, count($this->sqlLogger->queries)); - } - - public function assertCacheNonCacheSelectSameFetchModeAreEqual($expectedResult, $fetchStyle) - { - $stmt = $this->_conn->executeQuery("SELECT * FROM caching ORDER BY test_int ASC", array(), array(), new QueryCacheProfile(10, "testcachekey")); - - $this->assertEquals(2, $stmt->columnCount()); - $data = $this->hydrateStmt($stmt, $fetchStyle); - $this->assertEquals($expectedResult, $data); - - $stmt = $this->_conn->executeQuery("SELECT * FROM caching ORDER BY test_int ASC", array(), array(), new QueryCacheProfile(10, "testcachekey")); - - $this->assertEquals(2, $stmt->columnCount()); - $data = $this->hydrateStmt($stmt, $fetchStyle); - $this->assertEquals($expectedResult, $data); - $this->assertEquals(1, count($this->sqlLogger->queries), "just one dbal hit"); - } - - public function testEmptyResultCache() - { - $stmt = $this->_conn->executeQuery("SELECT * FROM caching WHERE test_int > 500", array(), array(), new QueryCacheProfile(10, "emptycachekey")); - $data = $this->hydrateStmt($stmt); - - $stmt = $this->_conn->executeQuery("SELECT * FROM caching WHERE test_int > 500", array(), array(), new QueryCacheProfile(10, "emptycachekey")); - $data = $this->hydrateStmt($stmt); - - $this->assertEquals(1, count($this->sqlLogger->queries), "just one dbal hit"); - } - - public function testChangeCacheImpl() - { - $stmt = $this->_conn->executeQuery("SELECT * FROM caching WHERE test_int > 500", array(), array(), new QueryCacheProfile(10, "emptycachekey")); - $data = $this->hydrateStmt($stmt); - - $secondCache = new \Doctrine\Common\Cache\ArrayCache; - $stmt = $this->_conn->executeQuery("SELECT * FROM caching WHERE test_int > 500", array(), array(), new QueryCacheProfile(10, "emptycachekey", $secondCache)); - $data = $this->hydrateStmt($stmt); - - $this->assertEquals(2, count($this->sqlLogger->queries), "two hits"); - $this->assertEquals(1, count($secondCache->fetch("emptycachekey"))); - } - - private function hydrateStmt($stmt, $fetchStyle = \PDO::FETCH_ASSOC) - { - $data = array(); - while ($row = $stmt->fetch($fetchStyle)) { - $data[] = array_change_key_case($row, CASE_LOWER); - } - $stmt->closeCursor(); - return $data; - } - - private function hydrateStmtIterator($stmt, $fetchStyle = \PDO::FETCH_ASSOC) - { - $data = array(); - $stmt->setFetchMode($fetchStyle); - foreach ($stmt as $row) { - $data[] = array_change_key_case($row, CASE_LOWER); - } - $stmt->closeCursor(); - return $data; - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/Db2SchemaManagerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/Db2SchemaManagerTest.php deleted file mode 100644 index a567900..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/Db2SchemaManagerTest.php +++ /dev/null @@ -1,12 +0,0 @@ -addColumn('foo_id', 'integer'); - $tableOld->addColumn('bar_id', 'integer'); - $tableNew = clone $tableOld; - - $this->_sm->createTable($tableOld); - $tableFetched = $this->_sm->listTableDetails("switch_primary_key_columns"); - $tableNew = clone $tableFetched; - $tableNew->setPrimaryKey(array('bar_id', 'foo_id')); - - $comparator = new \Doctrine\DBAL\Schema\Comparator; - $this->_sm->alterTable($comparator->diffTable($tableFetched, $tableNew)); - } - - public function testDiffTableBug() - { - $schema = new Schema(); - $table = $schema->createTable('diffbug_routing_translations'); - $table->addColumn('id', 'integer'); - $table->addColumn('route', 'string'); - $table->addColumn('locale', 'string'); - $table->addColumn('attribute', 'string'); - $table->addColumn('localized_value', 'string'); - $table->addColumn('original_value', 'string'); - $table->setPrimaryKey(array('id')); - $table->addUniqueIndex(array('route', 'locale', 'attribute')); - $table->addIndex(array('localized_value')); // this is much more selective than the unique index - - $this->_sm->createTable($table); - $tableFetched = $this->_sm->listTableDetails("diffbug_routing_translations"); - - $comparator = new \Doctrine\DBAL\Schema\Comparator; - $diff = $comparator->diffTable($tableFetched, $table); - - $this->assertFalse($diff, "no changes expected."); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/OracleSchemaManagerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/OracleSchemaManagerTest.php deleted file mode 100644 index 231b542..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/OracleSchemaManagerTest.php +++ /dev/null @@ -1,39 +0,0 @@ -markTestSkipped('Foo'); - } - - $username = $GLOBALS['db_username']; - - $query = "GRANT ALL PRIVILEGES TO ".$username; - - $conn = \Doctrine\Tests\TestUtil::getTempConnection(); - $conn->executeUpdate($query); - } - - public function testRenameTable() - { - $this->_sm->tryMethod('DropTable', 'list_tables_test'); - $this->_sm->tryMethod('DropTable', 'list_tables_test_new_name'); - - $this->createTestTable('list_tables_test'); - $this->_sm->renameTable('list_tables_test', 'list_tables_test_new_name'); - - $tables = $this->_sm->listTables(); - - $this->assertHasTable($tables, 'list_tables_test_new_name'); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php deleted file mode 100644 index 61d799f..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php +++ /dev/null @@ -1,228 +0,0 @@ -_conn) { - return; - } - - $this->_conn->getConfiguration()->setFilterSchemaAssetsExpression(null); - } - - /** - * @group DBAL-177 - */ - public function testGetSearchPath() - { - $params = $this->_conn->getParams(); - - $paths = $this->_sm->getSchemaSearchPaths(); - $this->assertEquals(array($params['user'], 'public'), $paths); - } - - /** - * @group DBAL-244 - */ - public function testGetSchemaNames() - { - $names = $this->_sm->getSchemaNames(); - - $this->assertInternalType('array', $names); - $this->assertTrue(count($names) > 0); - $this->assertTrue(in_array('public', $names), "The public schema should be found."); - } - - /** - * @group DBAL-21 - */ - public function testSupportDomainTypeFallback() - { - $createDomainTypeSQL = "CREATE DOMAIN MyMoney AS DECIMAL(18,2)"; - $this->_conn->exec($createDomainTypeSQL); - - $createTableSQL = "CREATE TABLE domain_type_test (id INT PRIMARY KEY, value MyMoney)"; - $this->_conn->exec($createTableSQL); - - $table = $this->_conn->getSchemaManager()->listTableDetails('domain_type_test'); - $this->assertInstanceOf('Doctrine\DBAL\Types\DecimalType', $table->getColumn('value')->getType()); - - Type::addType('MyMoney', 'Doctrine\Tests\DBAL\Functional\Schema\MoneyType'); - $this->_conn->getDatabasePlatform()->registerDoctrineTypeMapping('MyMoney', 'MyMoney'); - - $table = $this->_conn->getSchemaManager()->listTableDetails('domain_type_test'); - $this->assertInstanceOf('Doctrine\Tests\DBAL\Functional\Schema\MoneyType', $table->getColumn('value')->getType()); - } - - /** - * @group DBAL-37 - */ - public function testDetectsAutoIncrement() - { - $autoincTable = new \Doctrine\DBAL\Schema\Table('autoinc_table'); - $column = $autoincTable->addColumn('id', 'integer'); - $column->setAutoincrement(true); - $this->_sm->createTable($autoincTable); - $autoincTable = $this->_sm->listTableDetails('autoinc_table'); - - $this->assertTrue($autoincTable->getColumn('id')->getAutoincrement()); - } - - /** - * @group DBAL-37 - */ - public function testAlterTableAutoIncrementAdd() - { - $tableFrom = new \Doctrine\DBAL\Schema\Table('autoinc_table_add'); - $column = $tableFrom->addColumn('id', 'integer'); - $this->_sm->createTable($tableFrom); - $tableFrom = $this->_sm->listTableDetails('autoinc_table_add'); - $this->assertFalse($tableFrom->getColumn('id')->getAutoincrement()); - - $tableTo = new \Doctrine\DBAL\Schema\Table('autoinc_table_add'); - $column = $tableTo->addColumn('id', 'integer'); - $column->setAutoincrement(true); - - $c = new \Doctrine\DBAL\Schema\Comparator(); - $diff = $c->diffTable($tableFrom, $tableTo); - $sql = $this->_conn->getDatabasePlatform()->getAlterTableSQL($diff); - $this->assertEquals(array( - "CREATE SEQUENCE autoinc_table_add_id_seq", - "SELECT setval('autoinc_table_add_id_seq', (SELECT MAX(id) FROM autoinc_table_add))", - "ALTER TABLE autoinc_table_add ALTER id SET DEFAULT nextval('autoinc_table_add_id_seq')", - ), $sql); - - $this->_sm->alterTable($diff); - $tableFinal = $this->_sm->listTableDetails('autoinc_table_add'); - $this->assertTrue($tableFinal->getColumn('id')->getAutoincrement()); - } - - /** - * @group DBAL-37 - */ - public function testAlterTableAutoIncrementDrop() - { - $tableFrom = new \Doctrine\DBAL\Schema\Table('autoinc_table_drop'); - $column = $tableFrom->addColumn('id', 'integer'); - $column->setAutoincrement(true); - $this->_sm->createTable($tableFrom); - $tableFrom = $this->_sm->listTableDetails('autoinc_table_drop'); - $this->assertTrue($tableFrom->getColumn('id')->getAutoincrement()); - - $tableTo = new \Doctrine\DBAL\Schema\Table('autoinc_table_drop'); - $column = $tableTo->addColumn('id', 'integer'); - - $c = new \Doctrine\DBAL\Schema\Comparator(); - $diff = $c->diffTable($tableFrom, $tableTo); - $this->assertInstanceOf('Doctrine\DBAL\Schema\TableDiff', $diff, "There should be a difference and not false being returned from the table comparison"); - $this->assertEquals(array("ALTER TABLE autoinc_table_drop ALTER id DROP DEFAULT"), $this->_conn->getDatabasePlatform()->getAlterTableSQL($diff)); - - $this->_sm->alterTable($diff); - $tableFinal = $this->_sm->listTableDetails('autoinc_table_drop'); - $this->assertFalse($tableFinal->getColumn('id')->getAutoincrement()); - } - - /** - * @group DBAL-75 - */ - public function testTableWithSchema() - { - $this->_conn->exec('CREATE SCHEMA nested'); - - $nestedRelatedTable = new \Doctrine\DBAL\Schema\Table('nested.schemarelated'); - $column = $nestedRelatedTable->addColumn('id', 'integer'); - $column->setAutoincrement(true); - $nestedRelatedTable->setPrimaryKey(array('id')); - - $nestedSchemaTable = new \Doctrine\DBAL\Schema\Table('nested.schematable'); - $column = $nestedSchemaTable->addColumn('id', 'integer'); - $column->setAutoincrement(true); - $nestedSchemaTable->setPrimaryKey(array('id')); - $nestedSchemaTable->addUnnamedForeignKeyConstraint($nestedRelatedTable, array('id'), array('id')); - - $this->_sm->createTable($nestedRelatedTable); - $this->_sm->createTable($nestedSchemaTable); - - $tables = $this->_sm->listTableNames(); - $this->assertContains('nested.schematable', $tables, "The table should be detected with its non-public schema."); - - $nestedSchemaTable = $this->_sm->listTableDetails('nested.schematable'); - $this->assertTrue($nestedSchemaTable->hasColumn('id')); - $this->assertEquals(array('id'), $nestedSchemaTable->getPrimaryKey()->getColumns()); - - $relatedFks = $nestedSchemaTable->getForeignKeys(); - $this->assertEquals(1, count($relatedFks)); - $relatedFk = array_pop($relatedFks); - $this->assertEquals("nested.schemarelated", $relatedFk->getForeignTableName()); - } - - /** - * @group DBAL-91 - * @group DBAL-88 - */ - public function testReturnQuotedAssets() - { - $sql = 'create table dbal91_something ( id integer CONSTRAINT id_something PRIMARY KEY NOT NULL ,"table" integer );'; - $this->_conn->exec($sql); - - $sql = 'ALTER TABLE dbal91_something ADD CONSTRAINT something_input FOREIGN KEY( "table" ) REFERENCES dbal91_something ON UPDATE CASCADE;'; - $this->_conn->exec($sql); - - $table = $this->_sm->listTableDetails('dbal91_something'); - - $this->assertEquals( - array( - "CREATE TABLE dbal91_something (id INT NOT NULL, \"table\" INT DEFAULT NULL, PRIMARY KEY(id))", - "CREATE INDEX IDX_A9401304ECA7352B ON dbal91_something (\"table\")", - ), - $this->_conn->getDatabasePlatform()->getCreateTableSQL($table) - ); - } - - /** - * @group DBAL-204 - */ - public function testFilterSchemaExpression() - { - $testTable = new \Doctrine\DBAL\Schema\Table('dbal204_test_prefix'); - $column = $testTable->addColumn('id', 'integer'); - $this->_sm->createTable($testTable); - $testTable = new \Doctrine\DBAL\Schema\Table('dbal204_without_prefix'); - $column = $testTable->addColumn('id', 'integer'); - $this->_sm->createTable($testTable); - - $this->_conn->getConfiguration()->setFilterSchemaAssetsExpression('^dbal204_'); - $names = $this->_sm->listTableNames(); - $this->assertEquals(2, count($names)); - - $this->_conn->getConfiguration()->setFilterSchemaAssetsExpression('^dbal204_test'); - $names = $this->_sm->listTableNames(); - $this->assertEquals(1, count($names)); - } -} - -class MoneyType extends Type -{ - - public function getName() - { - return "MyMoney"; - } - - public function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return 'MyMoney'; - } - -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/SQLServerSchemaManagerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/SQLServerSchemaManagerTest.php deleted file mode 100644 index b6372b4..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/SQLServerSchemaManagerTest.php +++ /dev/null @@ -1,37 +0,0 @@ -addColumn('id', 'integer'); - $table->addColumn('todrop', 'decimal', array('default' => 10.2)); - - $this->_sm->createTable($table); - - $diff = new TableDiff('sqlsrv_drop_column', array(), array(), array( - new Column('todrop', Type::getType('decimal')) - )); - $this->_sm->alterTable($diff); - - $columns = $this->_sm->listTableColumns('sqlsrv_drop_column'); - $this->assertEquals(1, count($columns)); - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php deleted file mode 100644 index ac9fa8e..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php +++ /dev/null @@ -1,642 +0,0 @@ -getPlatformName(); - - if ($this->_conn->getDatabasePlatform()->getName() !== $dbms) { - $this->markTestSkipped(get_class($this) . ' requires the use of ' . $dbms); - } - - $this->_sm = $this->_conn->getSchemaManager(); - } - - /** - * @group DBAL-195 - */ - public function testDropAndCreateSequence() - { - if(!$this->_conn->getDatabasePlatform()->supportsSequences()) { - $this->markTestSkipped($this->_conn->getDriver()->getName().' does not support sequences.'); - } - - $sequence = new \Doctrine\DBAL\Schema\Sequence('dropcreate_sequences_test_seq', 20, 10); - $this->_sm->dropAndCreateSequence($sequence); - } - - public function testListSequences() - { - if(!$this->_conn->getDatabasePlatform()->supportsSequences()) { - $this->markTestSkipped($this->_conn->getDriver()->getName().' does not support sequences.'); - } - - $sequence = new \Doctrine\DBAL\Schema\Sequence('list_sequences_test_seq', 20, 10); - $this->_sm->createSequence($sequence); - - $sequences = $this->_sm->listSequences(); - - $this->assertInternalType('array', $sequences, 'listSequences() should return an array.'); - - $foundSequence = null; - foreach($sequences AS $sequence) { - $this->assertInstanceOf('Doctrine\DBAL\Schema\Sequence', $sequence, 'Array elements of listSequences() should be Sequence instances.'); - if(strtolower($sequence->getName()) == 'list_sequences_test_seq') { - $foundSequence = $sequence; - } - } - - $this->assertNotNull($foundSequence, "Sequence with name 'list_sequences_test_seq' was not found."); - $this->assertEquals(20, $foundSequence->getAllocationSize(), "Allocation Size is expected to be 20."); - $this->assertEquals(10, $foundSequence->getInitialValue(), "Initial Value is expected to be 10."); - } - - public function testListDatabases() - { - if (!$this->_sm->getDatabasePlatform()->supportsCreateDropDatabase()) { - $this->markTestSkipped('Cannot drop Database client side with this Driver.'); - } - - $this->_sm->dropAndCreateDatabase('test_create_database'); - $databases = $this->_sm->listDatabases(); - - $databases = \array_map('strtolower', $databases); - - $this->assertEquals(true, \in_array('test_create_database', $databases)); - } - - public function testListTables() - { - $this->createTestTable('list_tables_test'); - $tables = $this->_sm->listTables(); - - $this->assertInternalType('array', $tables); - $this->assertTrue(count($tables) > 0, "List Tables has to find at least one table named 'list_tables_test'."); - - $foundTable = false; - foreach ($tables AS $table) { - $this->assertInstanceOf('Doctrine\DBAL\Schema\Table', $table); - if (strtolower($table->getName()) == 'list_tables_test') { - $foundTable = true; - - $this->assertTrue($table->hasColumn('id')); - $this->assertTrue($table->hasColumn('test')); - $this->assertTrue($table->hasColumn('foreign_key_test')); - } - } - - $this->assertTrue( $foundTable , "The 'list_tables_test' table has to be found."); - } - - public function createListTableColumns() - { - $table = new \Doctrine\DBAL\Schema\Table('list_table_columns'); - $table->addColumn('id', 'integer', array('notnull' => true)); - $table->addColumn('test', 'string', array('length' => 255, 'notnull' => false, 'default' => 'expected default')); - $table->addColumn('foo', 'text', array('notnull' => true)); - $table->addColumn('bar', 'decimal', array('precision' => 10, 'scale' => 4, 'notnull' => false)); - $table->addColumn('baz1', 'datetime'); - $table->addColumn('baz2', 'time'); - $table->addColumn('baz3', 'date'); - - return $table; - } - - public function testListTableColumns() - { - $table = $this->createListTableColumns(); - - $this->_sm->dropAndCreateTable($table); - - $columns = $this->_sm->listTableColumns('list_table_columns'); - - $this->assertArrayHasKey('id', $columns); - $this->assertEquals('id', strtolower($columns['id']->getname())); - $this->assertInstanceOf('Doctrine\DBAL\Types\IntegerType', $columns['id']->gettype()); - $this->assertEquals(false, $columns['id']->getunsigned()); - $this->assertEquals(true, $columns['id']->getnotnull()); - $this->assertEquals(null, $columns['id']->getdefault()); - $this->assertInternalType('array', $columns['id']->getPlatformOptions()); - - $this->assertArrayHasKey('test', $columns); - $this->assertEquals('test', strtolower($columns['test']->getname())); - $this->assertInstanceOf('Doctrine\DBAL\Types\StringType', $columns['test']->gettype()); - $this->assertEquals(255, $columns['test']->getlength()); - $this->assertEquals(false, $columns['test']->getfixed()); - $this->assertEquals(false, $columns['test']->getnotnull()); - $this->assertEquals('expected default', $columns['test']->getdefault()); - $this->assertInternalType('array', $columns['test']->getPlatformOptions()); - - $this->assertEquals('foo', strtolower($columns['foo']->getname())); - $this->assertInstanceOf('Doctrine\DBAL\Types\TextType', $columns['foo']->gettype()); - $this->assertEquals(false, $columns['foo']->getunsigned()); - $this->assertEquals(false, $columns['foo']->getfixed()); - $this->assertEquals(true, $columns['foo']->getnotnull()); - $this->assertEquals(null, $columns['foo']->getdefault()); - $this->assertInternalType('array', $columns['foo']->getPlatformOptions()); - - $this->assertEquals('bar', strtolower($columns['bar']->getname())); - $this->assertInstanceOf('Doctrine\DBAL\Types\DecimalType', $columns['bar']->gettype()); - $this->assertEquals(null, $columns['bar']->getlength()); - $this->assertEquals(10, $columns['bar']->getprecision()); - $this->assertEquals(4, $columns['bar']->getscale()); - $this->assertEquals(false, $columns['bar']->getunsigned()); - $this->assertEquals(false, $columns['bar']->getfixed()); - $this->assertEquals(false, $columns['bar']->getnotnull()); - $this->assertEquals(null, $columns['bar']->getdefault()); - $this->assertInternalType('array', $columns['bar']->getPlatformOptions()); - - $this->assertEquals('baz1', strtolower($columns['baz1']->getname())); - $this->assertInstanceOf('Doctrine\DBAL\Types\DateTimeType', $columns['baz1']->gettype()); - $this->assertEquals(true, $columns['baz1']->getnotnull()); - $this->assertEquals(null, $columns['baz1']->getdefault()); - $this->assertInternalType('array', $columns['baz1']->getPlatformOptions()); - - $this->assertEquals('baz2', strtolower($columns['baz2']->getname())); - $this->assertContains($columns['baz2']->gettype()->getName(), array('time', 'date', 'datetime')); - $this->assertEquals(true, $columns['baz2']->getnotnull()); - $this->assertEquals(null, $columns['baz2']->getdefault()); - $this->assertInternalType('array', $columns['baz2']->getPlatformOptions()); - - $this->assertEquals('baz3', strtolower($columns['baz3']->getname())); - $this->assertContains($columns['baz2']->gettype()->getName(), array('time', 'date', 'datetime')); - $this->assertEquals(true, $columns['baz3']->getnotnull()); - $this->assertEquals(null, $columns['baz3']->getdefault()); - $this->assertInternalType('array', $columns['baz3']->getPlatformOptions()); - } - - public function testListTableColumnsDispatchEvent() - { - $table = $this->createListTableColumns(); - - $this->_sm->dropAndCreateTable($table); - - $listenerMock = $this->getMock('ListTableColumnsDispatchEventListener', array('onSchemaColumnDefinition')); - $listenerMock - ->expects($this->exactly(7)) - ->method('onSchemaColumnDefinition'); - - $oldEventManager = $this->_sm->getDatabasePlatform()->getEventManager(); - - $eventManager = new EventManager(); - $eventManager->addEventListener(array(Events::onSchemaColumnDefinition), $listenerMock); - - $this->_sm->getDatabasePlatform()->setEventManager($eventManager); - - $this->_sm->listTableColumns('list_table_columns'); - - $this->_sm->getDatabasePlatform()->setEventManager($oldEventManager); - } - - public function testListTableIndexesDispatchEvent() - { - $table = $this->getTestTable('list_table_indexes_test'); - $table->addUniqueIndex(array('test'), 'test_index_name'); - $table->addIndex(array('id', 'test'), 'test_composite_idx'); - - $this->_sm->dropAndCreateTable($table); - - $listenerMock = $this->getMock('ListTableIndexesDispatchEventListener', array('onSchemaIndexDefinition')); - $listenerMock - ->expects($this->exactly(3)) - ->method('onSchemaIndexDefinition'); - - $oldEventManager = $this->_sm->getDatabasePlatform()->getEventManager(); - - $eventManager = new EventManager(); - $eventManager->addEventListener(array(Events::onSchemaIndexDefinition), $listenerMock); - - $this->_sm->getDatabasePlatform()->setEventManager($eventManager); - - $this->_sm->listTableIndexes('list_table_indexes_test'); - - $this->_sm->getDatabasePlatform()->setEventManager($oldEventManager); - } - - public function testDiffListTableColumns() - { - if ($this->_sm->getDatabasePlatform()->getName() == 'oracle') { - $this->markTestSkipped('Does not work with Oracle, since it cannot detect DateTime, Date and Time differenecs (at the moment).'); - } - - $offlineTable = $this->createListTableColumns(); - $onlineTable = $this->_sm->listTableDetails('list_table_columns'); - - $comparator = new \Doctrine\DBAL\Schema\Comparator(); - $diff = $comparator->diffTable($offlineTable, $onlineTable); - - $this->assertFalse($diff, "No differences should be detected with the offline vs online schema."); - } - - public function testListTableIndexes() - { - $table = $this->getTestCompositeTable('list_table_indexes_test'); - $table->addUniqueIndex(array('test'), 'test_index_name'); - $table->addIndex(array('id', 'test'), 'test_composite_idx'); - - $this->_sm->dropAndCreateTable($table); - - $tableIndexes = $this->_sm->listTableIndexes('list_table_indexes_test'); - - $this->assertEquals(3, count($tableIndexes)); - - $this->assertArrayHasKey('primary', $tableIndexes, 'listTableIndexes() has to return a "primary" array key.'); - $this->assertEquals(array('id', 'other_id'), array_map('strtolower', $tableIndexes['primary']->getColumns())); - $this->assertTrue($tableIndexes['primary']->isUnique()); - $this->assertTrue($tableIndexes['primary']->isPrimary()); - - $this->assertEquals('test_index_name', $tableIndexes['test_index_name']->getName()); - $this->assertEquals(array('test'), array_map('strtolower', $tableIndexes['test_index_name']->getColumns())); - $this->assertTrue($tableIndexes['test_index_name']->isUnique()); - $this->assertFalse($tableIndexes['test_index_name']->isPrimary()); - - $this->assertEquals('test_composite_idx', $tableIndexes['test_composite_idx']->getName()); - $this->assertEquals(array('id', 'test'), array_map('strtolower', $tableIndexes['test_composite_idx']->getColumns())); - $this->assertFalse($tableIndexes['test_composite_idx']->isUnique()); - $this->assertFalse($tableIndexes['test_composite_idx']->isPrimary()); - } - - public function testDropAndCreateIndex() - { - $table = $this->getTestTable('test_create_index'); - $table->addUniqueIndex(array('test'), 'test'); - $this->_sm->dropAndCreateTable($table); - - $this->_sm->dropAndCreateIndex($table->getIndex('test'), $table); - $tableIndexes = $this->_sm->listTableIndexes('test_create_index'); - $this->assertInternalType('array', $tableIndexes); - - $this->assertEquals('test', strtolower($tableIndexes['test']->getName())); - $this->assertEquals(array('test'), array_map('strtolower', $tableIndexes['test']->getColumns())); - $this->assertTrue($tableIndexes['test']->isUnique()); - $this->assertFalse($tableIndexes['test']->isPrimary()); - } - - public function testCreateTableWithForeignKeys() - { - if(!$this->_sm->getDatabasePlatform()->supportsForeignKeyConstraints()) { - $this->markTestSkipped('Platform does not support foreign keys.'); - } - - $tableB = $this->getTestTable('test_foreign'); - - $this->_sm->dropAndCreateTable($tableB); - - $tableA = $this->getTestTable('test_create_fk'); - $tableA->addForeignKeyConstraint('test_foreign', array('foreign_key_test'), array('id')); - - $this->_sm->dropAndCreateTable($tableA); - - $fkTable = $this->_sm->listTableDetails('test_create_fk'); - $fkConstraints = $fkTable->getForeignKeys(); - $this->assertEquals(1, count($fkConstraints), "Table 'test_create_fk1' has to have one foreign key."); - - $fkConstraint = current($fkConstraints); - $this->assertInstanceOf('\Doctrine\DBAL\Schema\ForeignKeyConstraint', $fkConstraint); - $this->assertEquals('test_foreign', strtolower($fkConstraint->getForeignTableName())); - $this->assertEquals(array('foreign_key_test'), array_map('strtolower', $fkConstraint->getColumns())); - $this->assertEquals(array('id'), array_map('strtolower', $fkConstraint->getForeignColumns())); - - $this->assertTrue($fkTable->columnsAreIndexed($fkConstraint->getColumns()), "The columns of a foreign key constraint should always be indexed."); - } - - public function testListForeignKeys() - { - if(!$this->_conn->getDatabasePlatform()->supportsForeignKeyConstraints()) { - $this->markTestSkipped('Does not support foreign key constraints.'); - } - - $this->createTestTable('test_create_fk1'); - $this->createTestTable('test_create_fk2'); - - $foreignKey = new \Doctrine\DBAL\Schema\ForeignKeyConstraint( - array('foreign_key_test'), 'test_create_fk2', array('id'), 'foreign_key_test_fk', array('onDelete' => 'CASCADE') - ); - - $this->_sm->createForeignKey($foreignKey, 'test_create_fk1'); - - $fkeys = $this->_sm->listTableForeignKeys('test_create_fk1'); - - $this->assertEquals(1, count($fkeys), "Table 'test_create_fk1' has to have one foreign key."); - - $this->assertInstanceOf('Doctrine\DBAL\Schema\ForeignKeyConstraint', $fkeys[0]); - $this->assertEquals(array('foreign_key_test'), array_map('strtolower', $fkeys[0]->getLocalColumns())); - $this->assertEquals(array('id'), array_map('strtolower', $fkeys[0]->getForeignColumns())); - $this->assertEquals('test_create_fk2', strtolower($fkeys[0]->getForeignTableName())); - - if($fkeys[0]->hasOption('onDelete')) { - $this->assertEquals('CASCADE', $fkeys[0]->getOption('onDelete')); - } - } - - protected function getCreateExampleViewSql() - { - $this->markTestSkipped('No Create Example View SQL was defined for this SchemaManager'); - } - - public function testCreateSchema() - { - $this->createTestTable('test_table'); - - $schema = $this->_sm->createSchema(); - $this->assertTrue($schema->hasTable('test_table')); - } - - public function testAlterTableScenario() - { - if(!$this->_sm->getDatabasePlatform()->supportsAlterTable()) { - $this->markTestSkipped('Alter Table is not supported by this platform.'); - } - - $this->createTestTable('alter_table'); - $this->createTestTable('alter_table_foreign'); - - $table = $this->_sm->listTableDetails('alter_table'); - $this->assertTrue($table->hasColumn('id')); - $this->assertTrue($table->hasColumn('test')); - $this->assertTrue($table->hasColumn('foreign_key_test')); - $this->assertEquals(0, count($table->getForeignKeys())); - $this->assertEquals(1, count($table->getIndexes())); - - $tableDiff = new \Doctrine\DBAL\Schema\TableDiff("alter_table"); - $tableDiff->addedColumns['foo'] = new \Doctrine\DBAL\Schema\Column('foo', Type::getType('integer')); - $tableDiff->removedColumns['test'] = $table->getColumn('test'); - - $this->_sm->alterTable($tableDiff); - - $table = $this->_sm->listTableDetails('alter_table'); - $this->assertFalse($table->hasColumn('test')); - $this->assertTrue($table->hasColumn('foo')); - - $tableDiff = new \Doctrine\DBAL\Schema\TableDiff("alter_table"); - $tableDiff->addedIndexes[] = new \Doctrine\DBAL\Schema\Index('foo_idx', array('foo')); - - $this->_sm->alterTable($tableDiff); - - $table = $this->_sm->listTableDetails('alter_table'); - $this->assertEquals(2, count($table->getIndexes())); - $this->assertTrue($table->hasIndex('foo_idx')); - $this->assertEquals(array('foo'), array_map('strtolower', $table->getIndex('foo_idx')->getColumns())); - $this->assertFalse($table->getIndex('foo_idx')->isPrimary()); - $this->assertFalse($table->getIndex('foo_idx')->isUnique()); - - $tableDiff = new \Doctrine\DBAL\Schema\TableDiff("alter_table"); - $tableDiff->changedIndexes[] = new \Doctrine\DBAL\Schema\Index('foo_idx', array('foo', 'foreign_key_test')); - - $this->_sm->alterTable($tableDiff); - - $table = $this->_sm->listTableDetails('alter_table'); - $this->assertEquals(2, count($table->getIndexes())); - $this->assertTrue($table->hasIndex('foo_idx')); - $this->assertEquals(array('foo', 'foreign_key_test'), array_map('strtolower', $table->getIndex('foo_idx')->getColumns())); - - $tableDiff = new \Doctrine\DBAL\Schema\TableDiff("alter_table"); - $tableDiff->removedIndexes[] = new \Doctrine\DBAL\Schema\Index('foo_idx', array('foo', 'foreign_key_test')); - $fk = new \Doctrine\DBAL\Schema\ForeignKeyConstraint(array('foreign_key_test'), 'alter_table_foreign', array('id')); - $tableDiff->addedForeignKeys[] = $fk; - - $this->_sm->alterTable($tableDiff); - $table = $this->_sm->listTableDetails('alter_table'); - - // dont check for index size here, some platforms automatically add indexes for foreign keys. - $this->assertFalse($table->hasIndex('foo_idx')); - - $this->assertEquals(1, count($table->getForeignKeys())); - $fks = $table->getForeignKeys(); - $foreignKey = current($fks); - $this->assertEquals('alter_table_foreign', strtolower($foreignKey->getForeignTableName())); - $this->assertEquals(array('foreign_key_test'), array_map('strtolower', $foreignKey->getColumns())); - $this->assertEquals(array('id'), array_map('strtolower', $foreignKey->getForeignColumns())); - } - - public function testCreateAndListViews() - { - $this->createTestTable('view_test_table'); - - $name = "doctrine_test_view"; - $sql = "SELECT * FROM view_test_table"; - - $view = new \Doctrine\DBAL\Schema\View($name, $sql); - - $this->_sm->dropAndCreateView($view); - - $views = $this->_sm->listViews(); - } - - public function testAutoincrementDetection() - { - if (!$this->_sm->getDatabasePlatform()->supportsIdentityColumns()) { - $this->markTestSkipped('This test is only supported on platforms that have autoincrement'); - } - - $table = new \Doctrine\DBAL\Schema\Table('test_autoincrement'); - $table->setSchemaConfig($this->_sm->createSchemaConfig()); - $table->addColumn('id', 'integer', array('autoincrement' => true)); - $table->setPrimaryKey(array('id')); - - $this->_sm->createTable($table); - - $inferredTable = $this->_sm->listTableDetails('test_autoincrement'); - $this->assertTrue($inferredTable->hasColumn('id')); - $this->assertTrue($inferredTable->getColumn('id')->getAutoincrement()); - } - - /** - * @group DDC-887 - */ - public function testUpdateSchemaWithForeignKeyRenaming() - { - if (!$this->_sm->getDatabasePlatform()->supportsForeignKeyConstraints()) { - $this->markTestSkipped('This test is only supported on platforms that have foreign keys.'); - } - - $table = new \Doctrine\DBAL\Schema\Table('test_fk_base'); - $table->addColumn('id', 'integer'); - $table->setPrimaryKey(array('id')); - - $tableFK = new \Doctrine\DBAL\Schema\Table('test_fk_rename'); - $tableFK->setSchemaConfig($this->_sm->createSchemaConfig()); - $tableFK->addColumn('id', 'integer'); - $tableFK->addColumn('fk_id', 'integer'); - $tableFK->setPrimaryKey(array('id')); - $tableFK->addIndex(array('fk_id'), 'fk_idx'); - $tableFK->addForeignKeyConstraint('test_fk_base', array('fk_id'), array('id')); - - $this->_sm->createTable($table); - $this->_sm->createTable($tableFK); - - $tableFKNew = new \Doctrine\DBAL\Schema\Table('test_fk_rename'); - $tableFKNew->setSchemaConfig($this->_sm->createSchemaConfig()); - $tableFKNew->addColumn('id', 'integer'); - $tableFKNew->addColumn('rename_fk_id', 'integer'); - $tableFKNew->setPrimaryKey(array('id')); - $tableFKNew->addIndex(array('rename_fk_id'), 'fk_idx'); - $tableFKNew->addForeignKeyConstraint('test_fk_base', array('rename_fk_id'), array('id')); - - $c = new \Doctrine\DBAL\Schema\Comparator(); - $tableDiff = $c->diffTable($tableFK, $tableFKNew); - - $this->_sm->alterTable($tableDiff); - } - - /** - * @group DBAL-42 - */ - public function testGetColumnComment() - { - if (!$this->_conn->getDatabasePlatform()->supportsInlineColumnComments() && !$this->_conn->getDatabasePlatform()->supportsCommentOnStatement()) { - $this->markTestSkipped('Database does not support column comments.'); - } - - $table = new \Doctrine\DBAL\Schema\Table('column_comment_test'); - $table->addColumn('id', 'integer', array('comment' => 'This is a comment')); - $table->setPrimaryKey(array('id')); - - $this->_sm->createTable($table); - - $columns = $this->_sm->listTableColumns("column_comment_test"); - $this->assertEquals(1, count($columns)); - $this->assertEquals('This is a comment', $columns['id']->getComment()); - } - - /** - * @group DBAL-42 - */ - public function testAutomaticallyAppendCommentOnMarkedColumns() - { - if (!$this->_conn->getDatabasePlatform()->supportsInlineColumnComments() && !$this->_conn->getDatabasePlatform()->supportsCommentOnStatement()) { - $this->markTestSkipped('Database does not support column comments.'); - } - - $table = new \Doctrine\DBAL\Schema\Table('column_comment_test2'); - $table->addColumn('id', 'integer', array('comment' => 'This is a comment')); - $table->addColumn('obj', 'object', array('comment' => 'This is a comment')); - $table->addColumn('arr', 'array', array('comment' => 'This is a comment')); - $table->setPrimaryKey(array('id')); - - $this->_sm->createTable($table); - - $columns = $this->_sm->listTableColumns("column_comment_test2"); - $this->assertEquals(3, count($columns)); - $this->assertEquals('This is a comment', $columns['id']->getComment()); - $this->assertEquals('This is a comment', $columns['obj']->getComment(), "The Doctrine2 Typehint should be stripped from comment."); - $this->assertInstanceOf('Doctrine\DBAL\Types\ObjectType', $columns['obj']->getType(), "The Doctrine2 should be detected from comment hint."); - $this->assertEquals('This is a comment', $columns['arr']->getComment(), "The Doctrine2 Typehint should be stripped from comment."); - $this->assertInstanceOf('Doctrine\DBAL\Types\ArrayType', $columns['arr']->getType(), "The Doctrine2 should be detected from comment hint."); - } - - /** - * @group DBAL-197 - */ - public function testListTableWithBlob() - { - $table = new \Doctrine\DBAL\Schema\Table('test_blob_table'); - $table->addColumn('id', 'integer', array('comment' => 'This is a comment')); - $table->addColumn('binarydata', 'blob', array()); - $table->setPrimaryKey(array('id')); - - $this->_sm->createTable($table); - $blobTable = $this->_sm->listTableDetails('test_blob_table'); - } - - /** - * @param string $name - * @param array $data - */ - protected function createTestTable($name = 'test_table', $data = array()) - { - $options = array(); - if (isset($data['options'])) { - $options = $data['options']; - } - - $table = $this->getTestTable($name, $options); - - $this->_sm->dropAndCreateTable($table); - } - - protected function getTestTable($name, $options=array()) - { - $table = new \Doctrine\DBAL\Schema\Table($name, array(), array(), array(), false, $options); - $table->setSchemaConfig($this->_sm->createSchemaConfig()); - $table->addColumn('id', 'integer', array('notnull' => true)); - $table->setPrimaryKey(array('id')); - $table->addColumn('test', 'string', array('length' => 255)); - $table->addColumn('foreign_key_test', 'integer'); - return $table; - } - - protected function getTestCompositeTable($name) - { - $table = new \Doctrine\DBAL\Schema\Table($name, array(), array(), array(), false, array()); - $table->setSchemaConfig($this->_sm->createSchemaConfig()); - $table->addColumn('id', 'integer', array('notnull' => true)); - $table->addColumn('other_id', 'integer', array('notnull' => true)); - $table->setPrimaryKey(array('id', 'other_id')); - $table->addColumn('test', 'string', array('length' => 255)); - return $table; - } - - protected function assertHasTable($tables, $tableName) - { - $foundTable = false; - foreach ($tables AS $table) { - $this->assertInstanceOf('Doctrine\DBAL\Schema\Table', $table, 'No Table instance was found in tables array.'); - if (strtolower($table->getName()) == 'list_tables_test_new_name') { - $foundTable = true; - } - } - $this->assertTrue($foundTable, "Could not find new table"); - } - - public function testListForeignKeysComposite() - { - if(!$this->_conn->getDatabasePlatform()->supportsForeignKeyConstraints()) { - $this->markTestSkipped('Does not support foreign key constraints.'); - } - - $this->_sm->createTable($this->getTestTable('test_create_fk3')); - $this->_sm->createTable($this->getTestCompositeTable('test_create_fk4')); - - $foreignKey = new \Doctrine\DBAL\Schema\ForeignKeyConstraint( - array('id', 'foreign_key_test'), 'test_create_fk4', array('id', 'other_id'), 'foreign_key_test_fk' - ); - - $this->_sm->createForeignKey($foreignKey, 'test_create_fk3'); - - $fkeys = $this->_sm->listTableForeignKeys('test_create_fk3'); - - $this->assertEquals(1, count($fkeys), "Table 'test_create_fk3' has to have one foreign key."); - - $this->assertInstanceOf('Doctrine\DBAL\Schema\ForeignKeyConstraint', $fkeys[0]); - $this->assertEquals(array('id', 'foreign_key_test'), array_map('strtolower', $fkeys[0]->getLocalColumns())); - $this->assertEquals(array('id', 'other_id'), array_map('strtolower', $fkeys[0]->getForeignColumns())); - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/SqliteSchemaManagerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/SqliteSchemaManagerTest.php deleted file mode 100644 index 2dccb51..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/SqliteSchemaManagerTest.php +++ /dev/null @@ -1,46 +0,0 @@ -_sm->listDatabases(); - } - - public function testCreateAndDropDatabase() - { - $path = dirname(__FILE__).'/test_create_and_drop_sqlite_database.sqlite'; - - $this->_sm->createDatabase($path); - $this->assertEquals(true, file_exists($path)); - $this->_sm->dropDatabase($path); - $this->assertEquals(false, file_exists($path)); - } - - /** - * @expectedException \Doctrine\DBAL\DBALException - */ - public function testRenameTable() - { - $this->_sm->renameTable('oldname', 'newname'); - } - - public function testAutoincrementDetection() - { - $this->markTestSkipped( - 'There is currently no reliable way to determine whether an SQLite column is marked as ' - . 'auto-increment. So, while it does support a single identity column, we cannot with ' - . 'certainty determine which it is.'); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/TemporaryTableTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/TemporaryTableTest.php deleted file mode 100644 index 9fa92c7..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/TemporaryTableTest.php +++ /dev/null @@ -1,102 +0,0 @@ -_conn->exec($this->_conn->getDatabasePlatform()->getDropTableSQL("nontemporary")); - } catch(\Exception $e) { - - } - } - - public function tearDown() - { - if ($this->_conn) { - try { - $tempTable = $this->_conn->getDatabasePlatform()->getTemporaryTableName("temporary"); - $this->_conn->exec($this->_conn->getDatabasePlatform()->getDropTemporaryTableSQL($tempTable)); - } catch(\Exception $e) { } - } - } - - /** - * @group DDC-1337 - * @return void - */ - public function testDropTemporaryTableNotAutoCommitTransaction() - { - $platform = $this->_conn->getDatabasePlatform(); - $columnDefinitions = array("id" => array("type" => Type::getType("integer"), "notnull" => true)); - $tempTable = $platform->getTemporaryTableName("temporary"); - - $createTempTableSQL = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; - $this->_conn->executeUpdate($createTempTableSQL); - - $table = new Table("nontemporary"); - $table->addColumn("id", "integer"); - $table->setPrimaryKey(array('id')); - - foreach ($platform->getCreateTableSQL($table) AS $sql) { - $this->_conn->executeQuery($sql); - } - - $this->_conn->beginTransaction(); - $this->_conn->insert("nontemporary", array("id" => 1)); - $this->_conn->exec($platform->getDropTemporaryTableSQL($tempTable)); - $this->_conn->insert("nontemporary", array("id" => 2)); - - $this->_conn->rollback(); - - $rows = $this->_conn->fetchAll('SELECT * FROM nontemporary'); - $this->assertEquals(array(), $rows, "In an event of an error this result has one row, because of an implicit commit."); - } - - /** - * @group DDC-1337 - * @return void - */ - public function testCreateTemporaryTableNotAutoCommitTransaction() - { - $platform = $this->_conn->getDatabasePlatform(); - $columnDefinitions = array("id" => array("type" => Type::getType("integer"), "notnull" => true)); - $tempTable = $platform->getTemporaryTableName("temporary"); - - $createTempTableSQL = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; - - $table = new Table("nontemporary"); - $table->addColumn("id", "integer"); - $table->setPrimaryKey(array('id')); - - foreach ($platform->getCreateTableSQL($table) AS $sql) { - $this->_conn->executeQuery($sql); - } - - $this->_conn->beginTransaction(); - $this->_conn->insert("nontemporary", array("id" => 1)); - - $this->_conn->exec($createTempTableSQL); - $this->_conn->insert("nontemporary", array("id" => 2)); - - $this->_conn->rollback(); - - try { - $this->_conn->exec($platform->getDropTemporaryTableSQL($tempTable)); - } catch(\Exception $e) { - - } - - $rows = $this->_conn->fetchAll('SELECT * FROM nontemporary'); - $this->assertEquals(array(), $rows, "In an event of an error this result has one row, because of an implicit commit."); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL168Test.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL168Test.php deleted file mode 100644 index 1393404..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL168Test.php +++ /dev/null @@ -1,27 +0,0 @@ -_conn->getDatabasePlatform()->getName() != "postgresql") { - $this->markTestSkipped('PostgreSQL only test'); - } - - $table = new \Doctrine\DBAL\Schema\Table("domains"); - $table->addColumn('id', 'integer'); - $table->addColumn('parent_id', 'integer'); - $table->setPrimaryKey(array('id')); - $table->addForeignKeyConstraint('domains', array('parent_id'), array('id')); - - $this->_conn->getSchemaManager()->createTable($table); - $table = $this->_conn->getSchemaManager()->listTableDetails('domains'); - - $this->assertEquals('domains', $table->getName()); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL202Test.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL202Test.php deleted file mode 100644 index 4448ed7..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL202Test.php +++ /dev/null @@ -1,48 +0,0 @@ -_conn->getDatabasePlatform()->getName() != 'oracle') { - $this->markTestSkipped('OCI8 only test'); - } - - if ($this->_conn->getSchemaManager()->tablesExist('DBAL202')) { - $this->_conn->executeQuery('DELETE FROM DBAL202'); - } else { - $table = new \Doctrine\DBAL\Schema\Table('DBAL202'); - $table->addColumn('id', 'integer'); - $table->setPrimaryKey(array('id')); - - $this->_conn->getSchemaManager()->createTable($table); - } - } - - public function testStatementRollback() - { - $stmt = $this->_conn->prepare('INSERT INTO DBAL202 VALUES (8)'); - $this->_conn->beginTransaction(); - $stmt->execute(); - $this->_conn->rollback(); - - $this->assertEquals(0, $this->_conn->query('SELECT COUNT(1) FROM DBAL202')->fetchColumn()); - } - - public function testStatementCommit() - { - $stmt = $this->_conn->prepare('INSERT INTO DBAL202 VALUES (8)'); - $this->_conn->beginTransaction(); - $stmt->execute(); - $this->_conn->commit(); - - $this->assertEquals(1, $this->_conn->query('SELECT COUNT(1) FROM DBAL202')->fetchColumn()); - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/TypeConversionTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/TypeConversionTest.php deleted file mode 100644 index 67e6dda..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/TypeConversionTest.php +++ /dev/null @@ -1,101 +0,0 @@ -_conn->getSchemaManager(); - - $table = new \Doctrine\DBAL\Schema\Table("type_conversion"); - $table->addColumn('id', 'integer', array('notnull' => false)); - $table->addColumn('test_string', 'string', array('notnull' => false)); - $table->addColumn('test_boolean', 'boolean', array('notnull' => false)); - $table->addColumn('test_bigint', 'bigint', array('notnull' => false)); - $table->addColumn('test_smallint', 'bigint', array('notnull' => false)); - $table->addColumn('test_datetime', 'datetime', array('notnull' => false)); - $table->addColumn('test_datetimetz', 'datetimetz', array('notnull' => false)); - $table->addColumn('test_date', 'date', array('notnull' => false)); - $table->addColumn('test_time', 'time', array('notnull' => false)); - $table->addColumn('test_text', 'text', array('notnull' => false)); - $table->addColumn('test_array', 'array', array('notnull' => false)); - $table->addColumn('test_object', 'object', array('notnull' => false)); - $table->addColumn('test_float', 'float', array('notnull' => false)); - $table->addColumn('test_decimal', 'decimal', array('notnull' => false, 'scale' => 2, 'precision' => 10)); - $table->setPrimaryKey(array('id')); - - try { - foreach ($this->_conn->getDatabasePlatform()->getCreateTableSQL($table) AS $sql) { - $this->_conn->executeQuery($sql); - } - } catch(\Exception $e) { - - } - } - - static public function dataIdempotentDataConversion() - { - $obj = new \stdClass(); - $obj->foo = "bar"; - $obj->bar = "baz"; - - return array( - array('string', 'ABCDEFGaaaBBB', 'string'), - array('boolean', true, 'bool'), - array('boolean', false, 'bool'), - array('bigint', 12345678, 'string'), - array('smallint', 123, 'int'), - array('datetime', new \DateTime('2010-04-05 10:10:10'), 'DateTime'), - array('datetimetz', new \DateTime('2010-04-05 10:10:10'), 'DateTime'), - array('date', new \DateTime('2010-04-05'), 'DateTime'), - array('time', new \DateTime('10:10:10'), 'DateTime'), - array('text', str_repeat('foo ', 1000), 'string'), - array('array', array('foo' => 'bar'), 'array'), - array('object', $obj, 'object'), - array('float', 1.5, 'float'), - array('decimal', 1.55, 'string'), - ); - } - - /** - * @dataProvider dataIdempotentDataConversion - * @param string $type - * @param mixed $originalValue - * @param string $expectedPhpType - */ - public function testIdempotentDataConversion($type, $originalValue, $expectedPhpType) - { - $columnName = "test_" . $type; - $typeInstance = Type::getType($type); - $insertionValue = $typeInstance->convertToDatabaseValue($originalValue, $this->_conn->getDatabasePlatform()); - - $this->_conn->insert('type_conversion', array('id' => ++self::$typeCounter, $columnName => $insertionValue)); - - $sql = "SELECT " . $columnName . " FROM type_conversion WHERE id = " . self::$typeCounter; - $actualDbValue = $typeInstance->convertToPHPValue($this->_conn->fetchColumn($sql), $this->_conn->getDatabasePlatform()); - - if ($originalValue instanceof \DateTime) { - $this->assertInstanceOf($expectedPhpType, $actualDbValue, "The expected type from the conversion to and back from the database should be " . $expectedPhpType); - } else { - $this->assertInternalType($expectedPhpType, $actualDbValue, "The expected type from the conversion to and back from the database should be " . $expectedPhpType); - } - - if ($type !== "datetimetz") { - $this->assertEquals($originalValue, $actualDbValue, "Conversion between values should produce the same out as in value, but doesnt!"); - - if ($originalValue instanceof \DateTime) { - $this->assertEquals($originalValue->getTimezone()->getName(), $actualDbValue->getTimezone()->getName(), "Timezones should be the same."); - } - } - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/WriteTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/WriteTest.php deleted file mode 100644 index 3bdbab0..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/WriteTest.php +++ /dev/null @@ -1,137 +0,0 @@ -addColumn('test_int', 'integer'); - $table->addColumn('test_string', 'string', array('notnull' => false)); - $table->setPrimaryKey(array('test_int')); - - foreach ($this->_conn->getDatabasePlatform()->getCreateTableSQL($table) AS $sql) { - $this->_conn->executeQuery($sql); - } - } catch(\Exception $e) { - - } - $this->_conn->executeUpdate('DELETE FROM write_table'); - } - - /** - * @group DBAL-80 - */ - public function testExecuteUpdateFirstTypeIsNull() - { - $sql = "INSERT INTO write_table (test_string, test_int) VALUES (?, ?)"; - $this->_conn->executeUpdate($sql, array("text", 1111), array(null, PDO::PARAM_INT)); - - $sql = "SELECT * FROM write_table WHERE test_string = ? AND test_int = ?"; - $this->assertTrue((bool)$this->_conn->fetchColumn($sql, array("text", 1111))); - } - - public function testExecuteUpdate() - { - $sql = "INSERT INTO write_table (test_int) VALUES ( " . $this->_conn->quote(1) . ")"; - $affected = $this->_conn->executeUpdate($sql); - - $this->assertEquals(1, $affected, "executeUpdate() should return the number of affected rows!"); - } - - public function testExecuteUpdateWithTypes() - { - $sql = "INSERT INTO write_table (test_int, test_string) VALUES (?, ?)"; - $affected = $this->_conn->executeUpdate($sql, array(1, 'foo'), array(\PDO::PARAM_INT, \PDO::PARAM_STR)); - - $this->assertEquals(1, $affected, "executeUpdate() should return the number of affected rows!"); - } - - public function testPrepareRowCountReturnsAffectedRows() - { - $sql = "INSERT INTO write_table (test_int, test_string) VALUES (?, ?)"; - $stmt = $this->_conn->prepare($sql); - - $stmt->bindValue(1, 1); - $stmt->bindValue(2, "foo"); - $stmt->execute(); - - $this->assertEquals(1, $stmt->rowCount()); - } - - public function testPrepareWithPdoTypes() - { - $sql = "INSERT INTO write_table (test_int, test_string) VALUES (?, ?)"; - $stmt = $this->_conn->prepare($sql); - - $stmt->bindValue(1, 1, \PDO::PARAM_INT); - $stmt->bindValue(2, "foo", \PDO::PARAM_STR); - $stmt->execute(); - - $this->assertEquals(1, $stmt->rowCount()); - } - - public function testPrepareWithDbalTypes() - { - $sql = "INSERT INTO write_table (test_int, test_string) VALUES (?, ?)"; - $stmt = $this->_conn->prepare($sql); - - $stmt->bindValue(1, 1, Type::getType('integer')); - $stmt->bindValue(2, "foo", Type::getType('string')); - $stmt->execute(); - - $this->assertEquals(1, $stmt->rowCount()); - } - - public function testPrepareWithDbalTypeNames() - { - $sql = "INSERT INTO write_table (test_int, test_string) VALUES (?, ?)"; - $stmt = $this->_conn->prepare($sql); - - $stmt->bindValue(1, 1, 'integer'); - $stmt->bindValue(2, "foo", 'string'); - $stmt->execute(); - - $this->assertEquals(1, $stmt->rowCount()); - } - - public function insertRows() - { - $this->assertEquals(1, $this->_conn->insert('write_table', array('test_int' => 1, 'test_string' => 'foo'))); - $this->assertEquals(1, $this->_conn->insert('write_table', array('test_int' => 2, 'test_string' => 'bar'))); - } - - public function testInsert() - { - $this->insertRows(); - } - - public function testDelete() - { - $this->insertRows(); - - $this->assertEquals(1, $this->_conn->delete('write_table', array('test_int' => 2))); - $this->assertEquals(1, count($this->_conn->fetchAll('SELECT * FROM write_table'))); - - $this->assertEquals(1, $this->_conn->delete('write_table', array('test_int' => 1))); - $this->assertEquals(0, count($this->_conn->fetchAll('SELECT * FROM write_table'))); - } - - public function testUpdate() - { - $this->insertRows(); - - $this->assertEquals(1, $this->_conn->update('write_table', array('test_string' => 'bar'), array('test_string' => 'foo'))); - $this->assertEquals(2, $this->_conn->update('write_table', array('test_string' => 'baz'), array('test_string' => 'bar'))); - $this->assertEquals(0, $this->_conn->update('write_table', array('test_string' => 'baz'), array('test_string' => 'bar'))); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Mocks/MockPlatform.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Mocks/MockPlatform.php deleted file mode 100644 index 576430c..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Mocks/MockPlatform.php +++ /dev/null @@ -1,49 +0,0 @@ -_platform = $this->createPlatform(); - } - - /** - * @group DDC-1360 - */ - public function testQuoteIdentifier() - { - if ($this->_platform->getName() == "mssql") { - $this->markTestSkipped('Not working this way on mssql.'); - } - - $c = $this->_platform->getIdentifierQuoteCharacter(); - $this->assertEquals($c."test".$c, $this->_platform->quoteIdentifier("test")); - $this->assertEquals($c."test".$c.".".$c."test".$c, $this->_platform->quoteIdentifier("test.test")); - $this->assertEquals(str_repeat($c, 4), $this->_platform->quoteIdentifier($c)); - } - - /** - * @group DDC-1360 - */ - public function testQuoteSingleIdentifier() - { - if ($this->_platform->getName() == "mssql") { - $this->markTestSkipped('Not working this way on mssql.'); - } - - $c = $this->_platform->getIdentifierQuoteCharacter(); - $this->assertEquals($c."test".$c, $this->_platform->quoteSingleIdentifier("test")); - $this->assertEquals($c."test.test".$c, $this->_platform->quoteSingleIdentifier("test.test")); - $this->assertEquals(str_repeat($c, 4), $this->_platform->quoteSingleIdentifier($c)); - } - - public function testGetInvalidtForeignKeyReferentialActionSQL() - { - $this->setExpectedException('InvalidArgumentException'); - $this->_platform->getForeignKeyReferentialActionSQL('unknown'); - } - - public function testGetUnknownDoctrineMappingType() - { - $this->setExpectedException('Doctrine\DBAL\DBALException'); - $this->_platform->getDoctrineTypeMapping('foobar'); - } - - public function testRegisterDoctrineMappingType() - { - $this->_platform->registerDoctrineTypeMapping('foo', 'integer'); - $this->assertEquals('integer', $this->_platform->getDoctrineTypeMapping('foo')); - } - - public function testRegisterUnknownDoctrineMappingType() - { - $this->setExpectedException('Doctrine\DBAL\DBALException'); - $this->_platform->registerDoctrineTypeMapping('foo', 'bar'); - } - - public function testCreateWithNoColumns() - { - $table = new \Doctrine\DBAL\Schema\Table('test'); - - $this->setExpectedException('Doctrine\DBAL\DBALException'); - $sql = $this->_platform->getCreateTableSQL($table); - } - - public function testGeneratesTableCreationSql() - { - $table = new \Doctrine\DBAL\Schema\Table('test'); - $table->addColumn('id', 'integer', array('notnull' => true, 'autoincrement' => true)); - $table->addColumn('test', 'string', array('notnull' => false, 'length' => 255)); - $table->setPrimaryKey(array('id')); - - $sql = $this->_platform->getCreateTableSQL($table); - $this->assertEquals($this->getGenerateTableSql(), $sql[0]); - } - - abstract public function getGenerateTableSql(); - - public function testGenerateTableWithMultiColumnUniqueIndex() - { - $table = new \Doctrine\DBAL\Schema\Table('test'); - $table->addColumn('foo', 'string', array('notnull' => false, 'length' => 255)); - $table->addColumn('bar', 'string', array('notnull' => false, 'length' => 255)); - $table->addUniqueIndex(array("foo", "bar")); - - $sql = $this->_platform->getCreateTableSQL($table); - $this->assertEquals($this->getGenerateTableWithMultiColumnUniqueIndexSql(), $sql); - } - - abstract public function getGenerateTableWithMultiColumnUniqueIndexSql(); - - public function testGeneratesIndexCreationSql() - { - $indexDef = new \Doctrine\DBAL\Schema\Index('my_idx', array('user_name', 'last_login')); - - $this->assertEquals( - $this->getGenerateIndexSql(), - $this->_platform->getCreateIndexSQL($indexDef, 'mytable') - ); - } - - abstract public function getGenerateIndexSql(); - - public function testGeneratesUniqueIndexCreationSql() - { - $indexDef = new \Doctrine\DBAL\Schema\Index('index_name', array('test', 'test2'), true); - - $sql = $this->_platform->getCreateIndexSQL($indexDef, 'test'); - $this->assertEquals($this->getGenerateUniqueIndexSql(), $sql); - } - - abstract public function getGenerateUniqueIndexSql(); - - public function testGeneratesForeignKeyCreationSql() - { - $fk = new \Doctrine\DBAL\Schema\ForeignKeyConstraint(array('fk_name_id'), 'other_table', array('id'), ''); - - $sql = $this->_platform->getCreateForeignKeySQL($fk, 'test'); - $this->assertEquals($sql, $this->getGenerateForeignKeySql()); - } - - abstract public function getGenerateForeignKeySql(); - - public function testGeneratesConstraintCreationSql() - { - $idx = new \Doctrine\DBAL\Schema\Index('constraint_name', array('test'), true, false); - $sql = $this->_platform->getCreateConstraintSQL($idx, 'test'); - $this->assertEquals($this->getGenerateConstraintUniqueIndexSql(), $sql); - - $pk = new \Doctrine\DBAL\Schema\Index('constraint_name', array('test'), true, true); - $sql = $this->_platform->getCreateConstraintSQL($pk, 'test'); - $this->assertEquals($this->getGenerateConstraintPrimaryIndexSql(), $sql); - - $fk = new \Doctrine\DBAL\Schema\ForeignKeyConstraint(array('fk_name'), 'foreign', array('id'), 'constraint_fk'); - $sql = $this->_platform->getCreateConstraintSQL($fk, 'test'); - $this->assertEquals($this->getGenerateConstraintForeignKeySql(), $sql); - } - - protected function getBitAndComparisonExpressionSql($value1, $value2) - { - return '(' . $value1 . ' & ' . $value2 . ')'; - } - - /** - * @group DDC-1213 - */ - public function testGeneratesBitAndComparisonExpressionSql() - { - $sql = $this->_platform->getBitAndComparisonExpression(2, 4); - $this->assertEquals($this->getBitAndComparisonExpressionSql(2, 4), $sql); - } - - protected function getBitOrComparisonExpressionSql($value1, $value2) - { - return '(' . $value1 . ' | ' . $value2 . ')'; - } - - /** - * @group DDC-1213 - */ - public function testGeneratesBitOrComparisonExpressionSql() - { - $sql = $this->_platform->getBitOrComparisonExpression(2, 4); - $this->assertEquals($this->getBitOrComparisonExpressionSql(2, 4), $sql); - } - - public function getGenerateConstraintUniqueIndexSql() - { - return 'ALTER TABLE test ADD CONSTRAINT constraint_name UNIQUE (test)'; - } - - public function getGenerateConstraintPrimaryIndexSql() - { - return 'ALTER TABLE test ADD CONSTRAINT constraint_name PRIMARY KEY (test)'; - } - - public function getGenerateConstraintForeignKeySql() - { - return 'ALTER TABLE test ADD CONSTRAINT constraint_fk FOREIGN KEY (fk_name) REFERENCES foreign (id)'; - } - - abstract public function getGenerateAlterTableSql(); - - public function testGeneratesTableAlterationSql() - { - $expectedSql = $this->getGenerateAlterTableSql(); - - $tableDiff = new \Doctrine\DBAL\Schema\TableDiff('mytable'); - $tableDiff->newName = 'userlist'; - $tableDiff->addedColumns['quota'] = new \Doctrine\DBAL\Schema\Column('quota', \Doctrine\DBAL\Types\Type::getType('integer'), array('notnull' => false)); - $tableDiff->removedColumns['foo'] = new \Doctrine\DBAL\Schema\Column('foo', \Doctrine\DBAL\Types\Type::getType('integer')); - $tableDiff->changedColumns['bar'] = new \Doctrine\DBAL\Schema\ColumnDiff( - 'bar', new \Doctrine\DBAL\Schema\Column( - 'baz', \Doctrine\DBAL\Types\Type::getType('string'), array('default' => 'def') - ), - array('type', 'notnull', 'default') - ); - $tableDiff->changedColumns['bloo'] = new \Doctrine\DBAL\Schema\ColumnDiff( - 'bloo', new \Doctrine\DBAL\Schema\Column( - 'bloo', \Doctrine\DBAL\Types\Type::getType('boolean'), array('default' => false) - ), - array('type', 'notnull', 'default') - ); - - $sql = $this->_platform->getAlterTableSQL($tableDiff); - - $this->assertEquals($expectedSql, $sql); - } - - public function testGetCustomColumnDeclarationSql() - { - $field = array('columnDefinition' => 'MEDIUMINT(6) UNSIGNED'); - $this->assertEquals('foo MEDIUMINT(6) UNSIGNED', $this->_platform->getColumnDeclarationSQL('foo', $field)); - } - - public function testGetCreateTableSqlDispatchEvent() - { - $listenerMock = $this->getMock('GetCreateTableSqlDispatchEvenListener', array('onSchemaCreateTable', 'onSchemaCreateTableColumn')); - $listenerMock - ->expects($this->once()) - ->method('onSchemaCreateTable'); - $listenerMock - ->expects($this->exactly(2)) - ->method('onSchemaCreateTableColumn'); - - $eventManager = new EventManager(); - $eventManager->addEventListener(array(Events::onSchemaCreateTable, Events::onSchemaCreateTableColumn), $listenerMock); - - $this->_platform->setEventManager($eventManager); - - $table = new \Doctrine\DBAL\Schema\Table('test'); - $table->addColumn('foo', 'string', array('notnull' => false, 'length' => 255)); - $table->addColumn('bar', 'string', array('notnull' => false, 'length' => 255)); - - $this->_platform->getCreateTableSQL($table); - } - - public function testGetDropTableSqlDispatchEvent() - { - $listenerMock = $this->getMock('GetDropTableSqlDispatchEventListener', array('onSchemaDropTable')); - $listenerMock - ->expects($this->once()) - ->method('onSchemaDropTable'); - - $eventManager = new EventManager(); - $eventManager->addEventListener(array(Events::onSchemaDropTable), $listenerMock); - - $this->_platform->setEventManager($eventManager); - - $this->_platform->getDropTableSQL('TABLE'); - } - - public function testGetAlterTableSqlDispatchEvent() - { - $events = array( - 'onSchemaAlterTable', - 'onSchemaAlterTableAddColumn', - 'onSchemaAlterTableRemoveColumn', - 'onSchemaAlterTableChangeColumn', - 'onSchemaAlterTableRenameColumn' - ); - - $listenerMock = $this->getMock('GetAlterTableSqlDispatchEvenListener', $events); - $listenerMock - ->expects($this->once()) - ->method('onSchemaAlterTable'); - $listenerMock - ->expects($this->once()) - ->method('onSchemaAlterTableAddColumn'); - $listenerMock - ->expects($this->once()) - ->method('onSchemaAlterTableRemoveColumn'); - $listenerMock - ->expects($this->once()) - ->method('onSchemaAlterTableChangeColumn'); - $listenerMock - ->expects($this->once()) - ->method('onSchemaAlterTableRenameColumn'); - - $eventManager = new EventManager(); - $events = array( - Events::onSchemaAlterTable, - Events::onSchemaAlterTableAddColumn, - Events::onSchemaAlterTableRemoveColumn, - Events::onSchemaAlterTableChangeColumn, - Events::onSchemaAlterTableRenameColumn - ); - $eventManager->addEventListener($events, $listenerMock); - - $this->_platform->setEventManager($eventManager); - - $tableDiff = new \Doctrine\DBAL\Schema\TableDiff('mytable'); - $tableDiff->addedColumns['added'] = new \Doctrine\DBAL\Schema\Column('added', \Doctrine\DBAL\Types\Type::getType('integer'), array()); - $tableDiff->removedColumns['removed'] = new \Doctrine\DBAL\Schema\Column('removed', \Doctrine\DBAL\Types\Type::getType('integer'), array()); - $tableDiff->changedColumns['changed'] = new \Doctrine\DBAL\Schema\ColumnDiff( - 'changed', new \Doctrine\DBAL\Schema\Column( - 'changed2', \Doctrine\DBAL\Types\Type::getType('string'), array() - ), - array() - ); - $tableDiff->renamedColumns['renamed'] = new \Doctrine\DBAL\Schema\Column('renamed2', \Doctrine\DBAL\Types\Type::getType('integer'), array()); - - $this->_platform->getAlterTableSQL($tableDiff); - } - - /** - * @group DBAL-42 - */ - public function testCreateTableColumnComments() - { - $table = new \Doctrine\DBAL\Schema\Table('test'); - $table->addColumn('id', 'integer', array('comment' => 'This is a comment')); - $table->setPrimaryKey(array('id')); - - $this->assertEquals($this->getCreateTableColumnCommentsSQL(), $this->_platform->getCreateTableSQL($table)); - } - - /** - * @group DBAL-42 - */ - public function testAlterTableColumnComments() - { - $tableDiff = new \Doctrine\DBAL\Schema\TableDiff('mytable'); - $tableDiff->addedColumns['quota'] = new \Doctrine\DBAL\Schema\Column('quota', \Doctrine\DBAL\Types\Type::getType('integer'), array('comment' => 'A comment')); - $tableDiff->changedColumns['bar'] = new \Doctrine\DBAL\Schema\ColumnDiff( - 'bar', new \Doctrine\DBAL\Schema\Column( - 'baz', \Doctrine\DBAL\Types\Type::getType('string'), array('comment' => 'B comment') - ), - array('comment') - ); - - $this->assertEquals($this->getAlterTableColumnCommentsSQL(), $this->_platform->getAlterTableSQL($tableDiff)); - } - - public function testCreateTableColumnTypeComments() - { - $table = new \Doctrine\DBAL\Schema\Table('test'); - $table->addColumn('id', 'integer'); - $table->addColumn('data', 'array'); - $table->setPrimaryKey(array('id')); - - $this->assertEquals($this->getCreateTableColumnTypeCommentsSQL(), $this->_platform->getCreateTableSQL($table)); - } - - public function getCreateTableColumnCommentsSQL() - { - $this->markTestSkipped('Platform does not support Column comments.'); - } - - public function getAlterTableColumnCommentsSQL() - { - $this->markTestSkipped('Platform does not support Column comments.'); - } - - public function getCreateTableColumnTypeCommentsSQL() - { - $this->markTestSkipped('Platform does not support Column comments.'); - } - - /** - * @group DBAL-45 - */ - public function testKeywordList() - { - $keywordList = $this->_platform->getReservedKeywordsList(); - $this->assertInstanceOf('Doctrine\DBAL\Platforms\Keywords\KeywordList', $keywordList); - - $this->assertTrue($keywordList->isKeyword('table')); - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/MySqlPlatformTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/MySqlPlatformTest.php deleted file mode 100644 index 1deb460..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/MySqlPlatformTest.php +++ /dev/null @@ -1,229 +0,0 @@ -addColumn("Bar", "integer"); - - $sql = $this->_platform->getCreateTableSQL($table); - $this->assertEquals('CREATE TABLE Foo (Bar INT NOT NULL) ENGINE = InnoDB', array_shift($sql)); - } - - public function getGenerateTableSql() - { - return 'CREATE TABLE test (id INT AUTO_INCREMENT NOT NULL, test VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) ENGINE = InnoDB'; - } - - public function getGenerateTableWithMultiColumnUniqueIndexSql() - { - return array( - 'CREATE TABLE test (foo VARCHAR(255) DEFAULT NULL, bar VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_D87F7E0C8C73652176FF8CAA (foo, bar)) ENGINE = InnoDB' - ); - } - - public function getGenerateAlterTableSql() - { - return array( - "ALTER TABLE mytable RENAME TO userlist, ADD quota INT DEFAULT NULL, DROP foo, CHANGE bar baz VARCHAR(255) DEFAULT 'def' NOT NULL, CHANGE bloo bloo TINYINT(1) DEFAULT '0' NOT NULL" - ); - } - - public function testGeneratesSqlSnippets() - { - $this->assertEquals('RLIKE', $this->_platform->getRegexpExpression(), 'Regular expression operator is not correct'); - $this->assertEquals('`', $this->_platform->getIdentifierQuoteCharacter(), 'Quote character is not correct'); - $this->assertEquals('CONCAT(column1, column2, column3)', $this->_platform->getConcatExpression('column1', 'column2', 'column3'), 'Concatenation function is not correct'); - } - - public function testGeneratesTransactionsCommands() - { - $this->assertEquals( - 'SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED', - $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_READ_UNCOMMITTED), - '' - ); - $this->assertEquals( - 'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED', - $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_READ_COMMITTED) - ); - $this->assertEquals( - 'SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ', - $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_REPEATABLE_READ) - ); - $this->assertEquals( - 'SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE', - $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_SERIALIZABLE) - ); - } - - - public function testGeneratesDDLSnippets() - { - $this->assertEquals('SHOW DATABASES', $this->_platform->getShowDatabasesSQL()); - $this->assertEquals('CREATE DATABASE foobar', $this->_platform->getCreateDatabaseSQL('foobar')); - $this->assertEquals('DROP DATABASE foobar', $this->_platform->getDropDatabaseSQL('foobar')); - $this->assertEquals('DROP TABLE foobar', $this->_platform->getDropTableSQL('foobar')); - } - - public function testGeneratesTypeDeclarationForIntegers() - { - $this->assertEquals( - 'INT', - $this->_platform->getIntegerTypeDeclarationSQL(array()) - ); - $this->assertEquals( - 'INT AUTO_INCREMENT', - $this->_platform->getIntegerTypeDeclarationSQL(array('autoincrement' => true) - )); - $this->assertEquals( - 'INT AUTO_INCREMENT', - $this->_platform->getIntegerTypeDeclarationSQL( - array('autoincrement' => true, 'primary' => true) - )); - } - - public function testGeneratesTypeDeclarationForStrings() - { - $this->assertEquals( - 'CHAR(10)', - $this->_platform->getVarcharTypeDeclarationSQL( - array('length' => 10, 'fixed' => true) - )); - $this->assertEquals( - 'VARCHAR(50)', - $this->_platform->getVarcharTypeDeclarationSQL(array('length' => 50)), - 'Variable string declaration is not correct' - ); - $this->assertEquals( - 'VARCHAR(255)', - $this->_platform->getVarcharTypeDeclarationSQL(array()), - 'Long string declaration is not correct' - ); - } - - public function testPrefersIdentityColumns() - { - $this->assertTrue($this->_platform->prefersIdentityColumns()); - } - - public function testSupportsIdentityColumns() - { - $this->assertTrue($this->_platform->supportsIdentityColumns()); - } - - public function testDoesSupportSavePoints() - { - $this->assertTrue($this->_platform->supportsSavepoints()); - } - - public function getGenerateIndexSql() - { - return 'CREATE INDEX my_idx ON mytable (user_name, last_login)'; - } - - public function getGenerateUniqueIndexSql() - { - return 'CREATE UNIQUE INDEX index_name ON test (test, test2)'; - } - - public function getGenerateForeignKeySql() - { - return 'ALTER TABLE test ADD FOREIGN KEY (fk_name_id) REFERENCES other_table (id)'; - } - - /** - * @group DBAL-126 - */ - public function testUniquePrimaryKey() - { - $keyTable = new Table("foo"); - $keyTable->addColumn("bar", "integer"); - $keyTable->addColumn("baz", "string"); - $keyTable->setPrimaryKey(array("bar")); - $keyTable->addUniqueIndex(array("baz")); - - $oldTable = new Table("foo"); - $oldTable->addColumn("bar", "integer"); - $oldTable->addColumn("baz", "string"); - - $c = new \Doctrine\DBAL\Schema\Comparator; - $diff = $c->diffTable($oldTable, $keyTable); - - $sql = $this->_platform->getAlterTableSQL($diff); - - $this->assertEquals(array( - "ALTER TABLE foo ADD PRIMARY KEY (bar)", - "CREATE UNIQUE INDEX UNIQ_8C73652178240498 ON foo (baz)", - ), $sql); - } - - public function testModifyLimitQuery() - { - $sql = $this->_platform->modifyLimitQuery('SELECT * FROM user', 10, 0); - $this->assertEquals('SELECT * FROM user LIMIT 10 OFFSET 0', $sql); - } - - public function testModifyLimitQueryWithEmptyOffset() - { - $sql = $this->_platform->modifyLimitQuery('SELECT * FROM user', 10); - $this->assertEquals('SELECT * FROM user LIMIT 10', $sql); - } - - /** - * @group DDC-118 - */ - public function testGetDateTimeTypeDeclarationSql() - { - $this->assertEquals("DATETIME", $this->_platform->getDateTimeTypeDeclarationSQL(array('version' => false))); - $this->assertEquals("TIMESTAMP", $this->_platform->getDateTimeTypeDeclarationSQL(array('version' => true))); - $this->assertEquals("DATETIME", $this->_platform->getDateTimeTypeDeclarationSQL(array())); - } - - public function getCreateTableColumnCommentsSQL() - { - return array("CREATE TABLE test (id INT NOT NULL COMMENT 'This is a comment', PRIMARY KEY(id)) ENGINE = InnoDB"); - } - - public function getAlterTableColumnCommentsSQL() - { - return array("ALTER TABLE mytable ADD quota INT NOT NULL COMMENT 'A comment', CHANGE bar baz VARCHAR(255) NOT NULL COMMENT 'B comment'"); - } - - public function getCreateTableColumnTypeCommentsSQL() - { - return array("CREATE TABLE test (id INT NOT NULL, data LONGTEXT NOT NULL COMMENT '(DC2Type:array)', PRIMARY KEY(id)) ENGINE = InnoDB"); - } - - /** - * @group DBAL-237 - */ - public function testChangeIndexWithForeignKeys() - { - $index = new Index("idx", array("col"), false); - $unique = new Index("uniq", array("col"), true); - - $diff = new TableDiff("test", array(), array(), array(), array($unique), array(), array($index)); - $sql = $this->_platform->getAlterTableSQL($diff); - $this->assertEquals(array("ALTER TABLE test DROP INDEX idx, ADD UNIQUE INDEX uniq (col)"), $sql); - - $diff = new TableDiff("test", array(), array(), array(), array($index), array(), array($unique)); - $sql = $this->_platform->getAlterTableSQL($diff); - $this->assertEquals(array("ALTER TABLE test DROP INDEX uniq, ADD INDEX idx (col)"), $sql); - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php deleted file mode 100644 index d79423e..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php +++ /dev/null @@ -1,227 +0,0 @@ -assertEquals('RLIKE', $this->_platform->getRegexpExpression(), 'Regular expression operator is not correct'); - } - - public function testGeneratesSqlSnippets() - { - $this->assertEquals('"', $this->_platform->getIdentifierQuoteCharacter(), 'Identifier quote character is not correct'); - $this->assertEquals('column1 || column2 || column3', $this->_platform->getConcatExpression('column1', 'column2', 'column3'), 'Concatenation expression is not correct'); - } - - public function testGeneratesTransactionsCommands() - { - $this->assertEquals( - 'SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED', - $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_READ_UNCOMMITTED) - ); - $this->assertEquals( - 'SET TRANSACTION ISOLATION LEVEL READ COMMITTED', - $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_READ_COMMITTED) - ); - $this->assertEquals( - 'SET TRANSACTION ISOLATION LEVEL SERIALIZABLE', - $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_REPEATABLE_READ) - ); - $this->assertEquals( - 'SET TRANSACTION ISOLATION LEVEL SERIALIZABLE', - $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_SERIALIZABLE) - ); - } - - /** - * @expectedException Doctrine\DBAL\DBALException - */ - public function testShowDatabasesThrowsException() - { - $this->assertEquals('SHOW DATABASES', $this->_platform->getShowDatabasesSQL()); - } - - /** - * @expectedException Doctrine\DBAL\DBALException - */ - public function testCreateDatabaseThrowsException() - { - $this->assertEquals('CREATE DATABASE foobar', $this->_platform->getCreateDatabaseSQL('foobar')); - } - - public function testDropDatabaseThrowsException() - { - $this->assertEquals('DROP USER foobar CASCADE', $this->_platform->getDropDatabaseSQL('foobar')); - } - - public function testDropTable() - { - $this->assertEquals('DROP TABLE foobar', $this->_platform->getDropTableSQL('foobar')); - } - - public function testGeneratesTypeDeclarationForIntegers() - { - $this->assertEquals( - 'NUMBER(10)', - $this->_platform->getIntegerTypeDeclarationSQL(array()) - ); - $this->assertEquals( - 'NUMBER(10)', - $this->_platform->getIntegerTypeDeclarationSQL(array('autoincrement' => true) - )); - $this->assertEquals( - 'NUMBER(10)', - $this->_platform->getIntegerTypeDeclarationSQL( - array('autoincrement' => true, 'primary' => true) - )); - } - - public function testGeneratesTypeDeclarationsForStrings() - { - $this->assertEquals( - 'CHAR(10)', - $this->_platform->getVarcharTypeDeclarationSQL( - array('length' => 10, 'fixed' => true) - )); - $this->assertEquals( - 'VARCHAR2(50)', - $this->_platform->getVarcharTypeDeclarationSQL(array('length' => 50)), - 'Variable string declaration is not correct' - ); - $this->assertEquals( - 'VARCHAR2(255)', - $this->_platform->getVarcharTypeDeclarationSQL(array()), - 'Long string declaration is not correct' - ); - } - - public function testPrefersIdentityColumns() - { - $this->assertFalse($this->_platform->prefersIdentityColumns()); - } - - public function testSupportsIdentityColumns() - { - $this->assertFalse($this->_platform->supportsIdentityColumns()); - } - - public function testSupportsSavePoints() - { - $this->assertTrue($this->_platform->supportsSavepoints()); - } - - public function getGenerateIndexSql() - { - return 'CREATE INDEX my_idx ON mytable (user_name, last_login)'; - } - - public function getGenerateUniqueIndexSql() - { - return 'CREATE UNIQUE INDEX index_name ON test (test, test2)'; - } - - public function getGenerateForeignKeySql() - { - return 'ALTER TABLE test ADD FOREIGN KEY (fk_name_id) REFERENCES other_table (id)'; - } - - public function testModifyLimitQuery() - { - $sql = $this->_platform->modifyLimitQuery('SELECT * FROM user', 10, 0); - $this->assertEquals('SELECT a.* FROM (SELECT * FROM user) a WHERE ROWNUM <= 10', $sql); - } - - public function testModifyLimitQueryWithEmptyOffset() - { - $sql = $this->_platform->modifyLimitQuery('SELECT * FROM user', 10); - $this->assertEquals('SELECT a.* FROM (SELECT * FROM user) a WHERE ROWNUM <= 10', $sql); - } - - public function testModifyLimitQueryWithAscOrderBy() - { - $sql = $this->_platform->modifyLimitQuery('SELECT * FROM user ORDER BY username ASC', 10); - $this->assertEquals('SELECT a.* FROM (SELECT * FROM user ORDER BY username ASC) a WHERE ROWNUM <= 10', $sql); - } - - public function testModifyLimitQueryWithDescOrderBy() - { - $sql = $this->_platform->modifyLimitQuery('SELECT * FROM user ORDER BY username DESC', 10); - $this->assertEquals('SELECT a.* FROM (SELECT * FROM user ORDER BY username DESC) a WHERE ROWNUM <= 10', $sql); - } - - public function getCreateTableColumnCommentsSQL() - { - return array( - "CREATE TABLE test (id NUMBER(10) NOT NULL, PRIMARY KEY(id))", - "COMMENT ON COLUMN test.id IS 'This is a comment'", - ); - } - - public function getCreateTableColumnTypeCommentsSQL() - { - return array( - "CREATE TABLE test (id NUMBER(10) NOT NULL, data CLOB NOT NULL, PRIMARY KEY(id))", - "COMMENT ON COLUMN test.data IS '(DC2Type:array)'" - ); - } - - public function getAlterTableColumnCommentsSQL() - { - return array( - "ALTER TABLE mytable ADD (quota NUMBER(10) NOT NULL)", - "ALTER TABLE mytable MODIFY (baz VARCHAR2(255) NOT NULL)", - "COMMENT ON COLUMN mytable.quota IS 'A comment'", - "COMMENT ON COLUMN mytable.baz IS 'B comment'", - ); - } - - public function getBitAndComparisonExpressionSql($value1, $value2) - { - return 'BITAND('.$value1 . ', ' . $value2 . ')'; - } - - public function getBitOrComparisonExpressionSql($value1, $value2) - { - return '(' . $value1 . '-' . - $this->getBitAndComparisonExpressionSql($value1, $value2) - . '+' . $value2 . ')'; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/PostgreSqlPlatformTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/PostgreSqlPlatformTest.php deleted file mode 100644 index de75d02..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/PostgreSqlPlatformTest.php +++ /dev/null @@ -1,230 +0,0 @@ - 'CASCADE') - ); - $this->assertEquals( - "CONSTRAINT my_fk FOREIGN KEY (foreign_id) REFERENCES my_table (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE", - $this->_platform->getForeignKeyDeclarationSQL($foreignKey) - ); - } - - public function testGeneratesSqlSnippets() - { - $this->assertEquals('SIMILAR TO', $this->_platform->getRegexpExpression(), 'Regular expression operator is not correct'); - $this->assertEquals('"', $this->_platform->getIdentifierQuoteCharacter(), 'Identifier quote character is not correct'); - $this->assertEquals('column1 || column2 || column3', $this->_platform->getConcatExpression('column1', 'column2', 'column3'), 'Concatenation expression is not correct'); - $this->assertEquals('SUBSTR(column, 5)', $this->_platform->getSubstringExpression('column', 5), 'Substring expression without length is not correct'); - $this->assertEquals('SUBSTR(column, 0, 5)', $this->_platform->getSubstringExpression('column', 0, 5), 'Substring expression with length is not correct'); - } - - public function testGeneratesTransactionCommands() - { - $this->assertEquals( - 'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL READ UNCOMMITTED', - $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_READ_UNCOMMITTED) - ); - $this->assertEquals( - 'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL READ COMMITTED', - $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_READ_COMMITTED) - ); - $this->assertEquals( - 'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL REPEATABLE READ', - $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_REPEATABLE_READ) - ); - $this->assertEquals( - 'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE', - $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_SERIALIZABLE) - ); - } - - public function testGeneratesDDLSnippets() - { - $this->assertEquals('CREATE DATABASE foobar', $this->_platform->getCreateDatabaseSQL('foobar')); - $this->assertEquals('DROP DATABASE foobar', $this->_platform->getDropDatabaseSQL('foobar')); - $this->assertEquals('DROP TABLE foobar', $this->_platform->getDropTableSQL('foobar')); - } - - public function testGenerateTableWithAutoincrement() - { - $table = new \Doctrine\DBAL\Schema\Table('autoinc_table'); - $column = $table->addColumn('id', 'integer'); - $column->setAutoincrement(true); - - $this->assertEquals(array('CREATE TABLE autoinc_table (id SERIAL NOT NULL)'), $this->_platform->getCreateTableSQL($table)); - } - - public function testGeneratesTypeDeclarationForIntegers() - { - $this->assertEquals( - 'INT', - $this->_platform->getIntegerTypeDeclarationSQL(array()) - ); - $this->assertEquals( - 'SERIAL', - $this->_platform->getIntegerTypeDeclarationSQL(array('autoincrement' => true) - )); - $this->assertEquals( - 'SERIAL', - $this->_platform->getIntegerTypeDeclarationSQL( - array('autoincrement' => true, 'primary' => true) - )); - } - - public function testGeneratesTypeDeclarationForStrings() - { - $this->assertEquals( - 'CHAR(10)', - $this->_platform->getVarcharTypeDeclarationSQL( - array('length' => 10, 'fixed' => true)) - ); - $this->assertEquals( - 'VARCHAR(50)', - $this->_platform->getVarcharTypeDeclarationSQL(array('length' => 50)), - 'Variable string declaration is not correct' - ); - $this->assertEquals( - 'VARCHAR(255)', - $this->_platform->getVarcharTypeDeclarationSQL(array()), - 'Long string declaration is not correct' - ); - } - - public function getGenerateUniqueIndexSql() - { - return 'CREATE UNIQUE INDEX index_name ON test (test, test2)'; - } - - public function testGeneratesSequenceSqlCommands() - { - $sequence = new \Doctrine\DBAL\Schema\Sequence('myseq', 20, 1); - $this->assertEquals( - 'CREATE SEQUENCE myseq INCREMENT BY 20 MINVALUE 1 START 1', - $this->_platform->getCreateSequenceSQL($sequence) - ); - $this->assertEquals( - 'DROP SEQUENCE myseq', - $this->_platform->getDropSequenceSQL('myseq') - ); - $this->assertEquals( - "SELECT NEXTVAL('myseq')", - $this->_platform->getSequenceNextValSQL('myseq') - ); - } - - public function testDoesNotPreferIdentityColumns() - { - $this->assertFalse($this->_platform->prefersIdentityColumns()); - } - - public function testPrefersSequences() - { - $this->assertTrue($this->_platform->prefersSequences()); - } - - public function testSupportsIdentityColumns() - { - $this->assertTrue($this->_platform->supportsIdentityColumns()); - } - - public function testSupportsSavePoints() - { - $this->assertTrue($this->_platform->supportsSavepoints()); - } - - public function testSupportsSequences() - { - $this->assertTrue($this->_platform->supportsSequences()); - } - - public function testModifyLimitQuery() - { - $sql = $this->_platform->modifyLimitQuery('SELECT * FROM user', 10, 0); - $this->assertEquals('SELECT * FROM user LIMIT 10 OFFSET 0', $sql); - } - - public function testModifyLimitQueryWithEmptyOffset() - { - $sql = $this->_platform->modifyLimitQuery('SELECT * FROM user', 10); - $this->assertEquals('SELECT * FROM user LIMIT 10', $sql); - } - - public function getCreateTableColumnCommentsSQL() - { - return array( - "CREATE TABLE test (id INT NOT NULL, PRIMARY KEY(id))", - "COMMENT ON COLUMN test.id IS 'This is a comment'", - ); - } - - public function getAlterTableColumnCommentsSQL() - { - return array( - "ALTER TABLE mytable ADD quota INT NOT NULL", - "COMMENT ON COLUMN mytable.quota IS 'A comment'", - "COMMENT ON COLUMN mytable.baz IS 'B comment'", - ); - } - - public function getCreateTableColumnTypeCommentsSQL() - { - return array( - "CREATE TABLE test (id INT NOT NULL, data TEXT NOT NULL, PRIMARY KEY(id))", - "COMMENT ON COLUMN test.data IS '(DC2Type:array)'" - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/ReservedKeywordsValidatorTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/ReservedKeywordsValidatorTest.php deleted file mode 100644 index 388115f..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/ReservedKeywordsValidatorTest.php +++ /dev/null @@ -1,47 +0,0 @@ -validator = new ReservedKeywordsValidator(array( - new \Doctrine\DBAL\Platforms\Keywords\MySQLKeywords() - )); - } - - public function testReservedTableName() - { - $table = new Table("TABLE"); - $this->validator->acceptTable($table); - - $this->assertEquals( - array('Table TABLE keyword violations: MySQL'), - $this->validator->getViolations() - ); - } - - public function testReservedColumnName() - { - $table = new Table("TABLE"); - $column = $table->addColumn('table', 'string'); - - $this->validator->acceptColumn($table, $column); - - $this->assertEquals( - array('Table TABLE column table keyword violations: MySQL'), - $this->validator->getViolations() - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php deleted file mode 100644 index 887dbef..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php +++ /dev/null @@ -1,191 +0,0 @@ -assertEquals('RLIKE', $this->_platform->getRegexpExpression(), 'Regular expression operator is not correct'); - $this->assertEquals('"', $this->_platform->getIdentifierQuoteCharacter(), 'Identifier quote character is not correct'); - $this->assertEquals('(column1 + column2 + column3)', $this->_platform->getConcatExpression('column1', 'column2', 'column3'), 'Concatenation expression is not correct'); - } - - public function testGeneratesTransactionsCommands() - { - $this->assertEquals( - 'SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED', - $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_READ_UNCOMMITTED) - ); - $this->assertEquals( - 'SET TRANSACTION ISOLATION LEVEL READ COMMITTED', - $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_READ_COMMITTED) - ); - $this->assertEquals( - 'SET TRANSACTION ISOLATION LEVEL REPEATABLE READ', - $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_REPEATABLE_READ) - ); - $this->assertEquals( - 'SET TRANSACTION ISOLATION LEVEL SERIALIZABLE', - $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_SERIALIZABLE) - ); - } - - public function testGeneratesDDLSnippets() - { - $dropDatabaseExpectation = 'DROP DATABASE foobar'; - - $this->assertEquals('SHOW DATABASES', $this->_platform->getShowDatabasesSQL()); - $this->assertEquals('CREATE DATABASE foobar', $this->_platform->getCreateDatabaseSQL('foobar')); - $this->assertEquals($dropDatabaseExpectation, $this->_platform->getDropDatabaseSQL('foobar')); - $this->assertEquals('DROP TABLE foobar', $this->_platform->getDropTableSQL('foobar')); - } - - public function testGeneratesTypeDeclarationForIntegers() - { - $this->assertEquals( - 'INT', - $this->_platform->getIntegerTypeDeclarationSQL(array()) - ); - $this->assertEquals( - 'INT IDENTITY', - $this->_platform->getIntegerTypeDeclarationSQL(array('autoincrement' => true) - )); - $this->assertEquals( - 'INT IDENTITY', - $this->_platform->getIntegerTypeDeclarationSQL( - array('autoincrement' => true, 'primary' => true) - )); - } - - public function testGeneratesTypeDeclarationsForStrings() - { - $this->assertEquals( - 'NCHAR(10)', - $this->_platform->getVarcharTypeDeclarationSQL( - array('length' => 10, 'fixed' => true) - )); - $this->assertEquals( - 'NVARCHAR(50)', - $this->_platform->getVarcharTypeDeclarationSQL(array('length' => 50)), - 'Variable string declaration is not correct' - ); - $this->assertEquals( - 'NVARCHAR(255)', - $this->_platform->getVarcharTypeDeclarationSQL(array()), - 'Long string declaration is not correct' - ); - } - - public function testPrefersIdentityColumns() - { - $this->assertTrue($this->_platform->prefersIdentityColumns()); - } - - public function testSupportsIdentityColumns() - { - $this->assertTrue($this->_platform->supportsIdentityColumns()); - } - - public function testDoesNotSupportSavePoints() - { - $this->assertTrue($this->_platform->supportsSavepoints()); - } - - public function getGenerateIndexSql() - { - return 'CREATE INDEX my_idx ON mytable (user_name, last_login)'; - } - - public function getGenerateUniqueIndexSql() - { - return 'CREATE UNIQUE INDEX index_name ON test (test, test2) WHERE test IS NOT NULL AND test2 IS NOT NULL'; - } - - public function getGenerateForeignKeySql() - { - return 'ALTER TABLE test ADD FOREIGN KEY (fk_name_id) REFERENCES other_table (id)'; - } - - public function testModifyLimitQuery() - { - $sql = $this->_platform->modifyLimitQuery('SELECT * FROM user', 10, 0); - $this->assertEquals('SELECT TOP 10 * FROM user', $sql); - } - - public function testModifyLimitQueryWithEmptyOffset() - { - $sql = $this->_platform->modifyLimitQuery('SELECT * FROM user', 10); - $this->assertEquals('SELECT TOP 10 * FROM user', $sql); - } - - public function testModifyLimitQueryWithOffset() - { - $sql = $this->_platform->modifyLimitQuery('SELECT * FROM user ORDER BY username DESC', 10, 5); - $this->assertEquals('SELECT * FROM (SELECT ROW_NUMBER() OVER (ORDER BY username DESC) AS "doctrine_rownum", * FROM user) AS doctrine_tbl WHERE "doctrine_rownum" BETWEEN 6 AND 15', $sql); - } - - public function testModifyLimitQueryWithAscOrderBy() - { - $sql = $this->_platform->modifyLimitQuery('SELECT * FROM user ORDER BY username ASC', 10); - $this->assertEquals('SELECT TOP 10 * FROM user ORDER BY username ASC', $sql); - } - - public function testModifyLimitQueryWithDescOrderBy() - { - $sql = $this->_platform->modifyLimitQuery('SELECT * FROM user ORDER BY username DESC', 10); - $this->assertEquals('SELECT TOP 10 * FROM user ORDER BY username DESC', $sql); - } - - /** - * @group DDC-1360 - */ - public function testQuoteIdentifier() - { - $this->assertEquals('[fo][o]', $this->_platform->quoteIdentifier('fo]o')); - $this->assertEquals('[test]', $this->_platform->quoteIdentifier('test')); - $this->assertEquals('[test].[test]', $this->_platform->quoteIdentifier('test.test')); - } - - /** - * @group DDC-1360 - */ - public function testQuoteSingleIdentifier() - { - $this->assertEquals('[fo][o]', $this->_platform->quoteSingleIdentifier('fo]o')); - $this->assertEquals('[test]', $this->_platform->quoteSingleIdentifier('test')); - $this->assertEquals('[test.test]', $this->_platform->quoteSingleIdentifier('test.test')); - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php deleted file mode 100644 index 0e50891..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php +++ /dev/null @@ -1,134 +0,0 @@ -assertEquals('RLIKE', $this->_platform->getRegexpExpression(), 'Regular expression operator is not correct'); - $this->assertEquals('SUBSTR(column, 5, LENGTH(column))', $this->_platform->getSubstringExpression('column', 5), 'Substring expression without length is not correct'); - $this->assertEquals('SUBSTR(column, 0, 5)', $this->_platform->getSubstringExpression('column', 0, 5), 'Substring expression with length is not correct'); - } - - public function testGeneratesTransactionCommands() - { - $this->assertEquals( - 'PRAGMA read_uncommitted = 0', - $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_READ_UNCOMMITTED) - ); - $this->assertEquals( - 'PRAGMA read_uncommitted = 1', - $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_READ_COMMITTED) - ); - $this->assertEquals( - 'PRAGMA read_uncommitted = 1', - $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_REPEATABLE_READ) - ); - $this->assertEquals( - 'PRAGMA read_uncommitted = 1', - $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_SERIALIZABLE) - ); - } - - public function testPrefersIdentityColumns() - { - $this->assertTrue($this->_platform->prefersIdentityColumns()); - } - - public function testGeneratesTypeDeclarationForIntegers() - { - $this->assertEquals( - 'INTEGER', - $this->_platform->getIntegerTypeDeclarationSQL(array()) - ); - $this->assertEquals( - 'INTEGER', - $this->_platform->getIntegerTypeDeclarationSQL(array('autoincrement' => true)) - ); - $this->assertEquals( - 'INTEGER', - $this->_platform->getIntegerTypeDeclarationSQL( - array('autoincrement' => true, 'primary' => true)) - ); - } - - public function testGeneratesTypeDeclarationForStrings() - { - $this->assertEquals( - 'CHAR(10)', - $this->_platform->getVarcharTypeDeclarationSQL( - array('length' => 10, 'fixed' => true)) - ); - $this->assertEquals( - 'VARCHAR(50)', - $this->_platform->getVarcharTypeDeclarationSQL(array('length' => 50)), - 'Variable string declaration is not correct' - ); - $this->assertEquals( - 'VARCHAR(255)', - $this->_platform->getVarcharTypeDeclarationSQL(array()), - 'Long string declaration is not correct' - ); - } - - public function getGenerateIndexSql() - { - return 'CREATE INDEX my_idx ON mytable (user_name, last_login)'; - } - - public function getGenerateUniqueIndexSql() - { - return 'CREATE UNIQUE INDEX index_name ON test (test, test2)'; - } - - public function getGenerateForeignKeySql() - { - $this->markTestSkipped('SQLite does not support ForeignKeys.'); - } - - public function testModifyLimitQuery() - { - $sql = $this->_platform->modifyLimitQuery('SELECT * FROM user', 10, 0); - $this->assertEquals('SELECT * FROM user LIMIT 10 OFFSET 0', $sql); - } - - public function testModifyLimitQueryWithEmptyOffset() - { - $sql = $this->_platform->modifyLimitQuery('SELECT * FROM user', 10); - $this->assertEquals('SELECT * FROM user LIMIT 10', $sql); - } - - public function getGenerateAlterTableSql() - { - $this->markTestSkipped('SQlite does not support ALTER Table.'); - } - - public function testGetAlterTableSqlDispatchEvent() - { - $this->markTestSkipped('SQlite does not support ALTER Table.'); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Query/Expression/CompositeExpressionTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Query/Expression/CompositeExpressionTest.php deleted file mode 100644 index 9939659..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Query/Expression/CompositeExpressionTest.php +++ /dev/null @@ -1,82 +0,0 @@ -assertEquals(1, count($expr)); - - $expr->add('u.group_id = 2'); - - $this->assertEquals(2, count($expr)); - } - - /** - * @dataProvider provideDataForConvertToString - */ - public function testCompositeUsageAndGeneration($type, $parts, $expects) - { - $expr = new CompositeExpression($type, $parts); - - $this->assertEquals($expects, (string) $expr); - } - - public function provideDataForConvertToString() - { - return array( - array( - CompositeExpression::TYPE_AND, - array('u.user = 1'), - 'u.user = 1' - ), - array( - CompositeExpression::TYPE_AND, - array('u.user = 1', 'u.group_id = 1'), - '(u.user = 1) AND (u.group_id = 1)' - ), - array( - CompositeExpression::TYPE_OR, - array('u.user = 1'), - 'u.user = 1' - ), - array( - CompositeExpression::TYPE_OR, - array('u.group_id = 1', 'u.group_id = 2'), - '(u.group_id = 1) OR (u.group_id = 2)' - ), - array( - CompositeExpression::TYPE_AND, - array( - 'u.user = 1', - new CompositeExpression( - CompositeExpression::TYPE_OR, - array('u.group_id = 1', 'u.group_id = 2') - ) - ), - '(u.user = 1) AND ((u.group_id = 1) OR (u.group_id = 2))' - ), - array( - CompositeExpression::TYPE_OR, - array( - 'u.group_id = 1', - new CompositeExpression( - CompositeExpression::TYPE_AND, - array('u.user = 1', 'u.group_id = 2') - ) - ), - '(u.group_id = 1) OR ((u.user = 1) AND (u.group_id = 2))' - ), - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Query/Expression/ExpressionBuilderTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Query/Expression/ExpressionBuilderTest.php deleted file mode 100644 index 1893e97..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Query/Expression/ExpressionBuilderTest.php +++ /dev/null @@ -1,201 +0,0 @@ -getMock('Doctrine\DBAL\Connection', array(), array(), '', false); - - $this->expr = new ExpressionBuilder($conn); - - $conn->expects($this->any()) - ->method('getExpressionBuilder') - ->will($this->returnValue($this->expr)); - } - - /** - * @dataProvider provideDataForAndX - */ - public function testAndX($parts, $expected) - { - $composite = $this->expr->andX(); - - foreach ($parts as $part) { - $composite->add($part); - } - - $this->assertEquals($expected, (string) $composite); - } - - public function provideDataForAndX() - { - return array( - array( - array('u.user = 1'), - 'u.user = 1' - ), - array( - array('u.user = 1', 'u.group_id = 1'), - '(u.user = 1) AND (u.group_id = 1)' - ), - array( - array('u.user = 1'), - 'u.user = 1' - ), - array( - array('u.group_id = 1', 'u.group_id = 2'), - '(u.group_id = 1) AND (u.group_id = 2)' - ), - array( - array( - 'u.user = 1', - new CompositeExpression( - CompositeExpression::TYPE_OR, - array('u.group_id = 1', 'u.group_id = 2') - ) - ), - '(u.user = 1) AND ((u.group_id = 1) OR (u.group_id = 2))' - ), - array( - array( - 'u.group_id = 1', - new CompositeExpression( - CompositeExpression::TYPE_AND, - array('u.user = 1', 'u.group_id = 2') - ) - ), - '(u.group_id = 1) AND ((u.user = 1) AND (u.group_id = 2))' - ), - ); - } - - /** - * @dataProvider provideDataForOrX - */ - public function testOrX($parts, $expected) - { - $composite = $this->expr->orX(); - - foreach ($parts as $part) { - $composite->add($part); - } - - $this->assertEquals($expected, (string) $composite); - } - - public function provideDataForOrX() - { - return array( - array( - array('u.user = 1'), - 'u.user = 1' - ), - array( - array('u.user = 1', 'u.group_id = 1'), - '(u.user = 1) OR (u.group_id = 1)' - ), - array( - array('u.user = 1'), - 'u.user = 1' - ), - array( - array('u.group_id = 1', 'u.group_id = 2'), - '(u.group_id = 1) OR (u.group_id = 2)' - ), - array( - array( - 'u.user = 1', - new CompositeExpression( - CompositeExpression::TYPE_OR, - array('u.group_id = 1', 'u.group_id = 2') - ) - ), - '(u.user = 1) OR ((u.group_id = 1) OR (u.group_id = 2))' - ), - array( - array( - 'u.group_id = 1', - new CompositeExpression( - CompositeExpression::TYPE_AND, - array('u.user = 1', 'u.group_id = 2') - ) - ), - '(u.group_id = 1) OR ((u.user = 1) AND (u.group_id = 2))' - ), - ); - } - - /** - * @dataProvider provideDataForComparison - */ - public function testComparison($leftExpr, $operator, $rightExpr, $expected) - { - $part = $this->expr->comparison($leftExpr, $operator, $rightExpr); - - $this->assertEquals($expected, (string) $part); - } - - public function provideDataForComparison() - { - return array( - array('u.user_id', ExpressionBuilder::EQ, '1', 'u.user_id = 1'), - array('u.user_id', ExpressionBuilder::NEQ, '1', 'u.user_id <> 1'), - array('u.salary', ExpressionBuilder::LT, '10000', 'u.salary < 10000'), - array('u.salary', ExpressionBuilder::LTE, '10000', 'u.salary <= 10000'), - array('u.salary', ExpressionBuilder::GT, '10000', 'u.salary > 10000'), - array('u.salary', ExpressionBuilder::GTE, '10000', 'u.salary >= 10000'), - ); - } - - public function testEq() - { - $this->assertEquals('u.user_id = 1', $this->expr->eq('u.user_id', '1')); - } - - public function testNeq() - { - $this->assertEquals('u.user_id <> 1', $this->expr->neq('u.user_id', '1')); - } - - public function testLt() - { - $this->assertEquals('u.salary < 10000', $this->expr->lt('u.salary', '10000')); - } - - public function testLte() - { - $this->assertEquals('u.salary <= 10000', $this->expr->lte('u.salary', '10000')); - } - - public function testGt() - { - $this->assertEquals('u.salary > 10000', $this->expr->gt('u.salary', '10000')); - } - - public function testGte() - { - $this->assertEquals('u.salary >= 10000', $this->expr->gte('u.salary', '10000')); - } - - public function testIsNull() - { - $this->assertEquals('u.deleted IS NULL', $this->expr->isNull('u.deleted')); - } - - public function testIsNotNull() - { - $this->assertEquals('u.updated IS NOT NULL', $this->expr->isNotNull('u.updated')); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php deleted file mode 100644 index 98f1616..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php +++ /dev/null @@ -1,572 +0,0 @@ -conn = $this->getMock('Doctrine\DBAL\Connection', array(), array(), '', false); - - $expressionBuilder = new ExpressionBuilder($this->conn); - - $this->conn->expects($this->any()) - ->method('getExpressionBuilder') - ->will($this->returnValue($expressionBuilder)); - } - - public function testSimpleSelect() - { - $qb = new QueryBuilder($this->conn); - - $qb->select('u.id') - ->from('users', 'u'); - - $this->assertEquals('SELECT u.id FROM users u', (string) $qb); - } - - public function testSelectWithSimpleWhere() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.id') - ->from('users', 'u') - ->where($expr->andX($expr->eq('u.nickname', '?'))); - - $this->assertEquals("SELECT u.id FROM users u WHERE u.nickname = ?", (string) $qb); - } - - public function testSelectWithLeftJoin() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->from('users', 'u') - ->leftJoin('u', 'phones', 'p', $expr->eq('p.user_id', 'u.id')); - - $this->assertEquals('SELECT u.*, p.* FROM users u LEFT JOIN phones p ON p.user_id = u.id', (string) $qb); - } - - public function testSelectWithJoin() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->from('users', 'u') - ->Join('u', 'phones', 'p', $expr->eq('p.user_id', 'u.id')); - - $this->assertEquals('SELECT u.*, p.* FROM users u INNER JOIN phones p ON p.user_id = u.id', (string) $qb); - } - - public function testSelectWithInnerJoin() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->from('users', 'u') - ->innerJoin('u', 'phones', 'p', $expr->eq('p.user_id', 'u.id')); - - $this->assertEquals('SELECT u.*, p.* FROM users u INNER JOIN phones p ON p.user_id = u.id', (string) $qb); - } - - public function testSelectWithRightJoin() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->from('users', 'u') - ->rightJoin('u', 'phones', 'p', $expr->eq('p.user_id', 'u.id')); - - $this->assertEquals('SELECT u.*, p.* FROM users u RIGHT JOIN phones p ON p.user_id = u.id', (string) $qb); - } - - public function testSelectWithAndWhereConditions() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->from('users', 'u') - ->where('u.username = ?') - ->andWhere('u.name = ?'); - - $this->assertEquals('SELECT u.*, p.* FROM users u WHERE (u.username = ?) AND (u.name = ?)', (string) $qb); - } - - public function testSelectWithOrWhereConditions() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->from('users', 'u') - ->where('u.username = ?') - ->orWhere('u.name = ?'); - - $this->assertEquals('SELECT u.*, p.* FROM users u WHERE (u.username = ?) OR (u.name = ?)', (string) $qb); - } - - public function testSelectWithOrOrWhereConditions() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->from('users', 'u') - ->orWhere('u.username = ?') - ->orWhere('u.name = ?'); - - $this->assertEquals('SELECT u.*, p.* FROM users u WHERE (u.username = ?) OR (u.name = ?)', (string) $qb); - } - - public function testSelectWithAndOrWhereConditions() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->from('users', 'u') - ->where('u.username = ?') - ->andWhere('u.username = ?') - ->orWhere('u.name = ?') - ->andWhere('u.name = ?'); - - $this->assertEquals('SELECT u.*, p.* FROM users u WHERE (((u.username = ?) AND (u.username = ?)) OR (u.name = ?)) AND (u.name = ?)', (string) $qb); - } - - public function testSelectGroupBy() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->from('users', 'u') - ->groupBy('u.id'); - - $this->assertEquals('SELECT u.*, p.* FROM users u GROUP BY u.id', (string) $qb); - } - - public function testSelectEmptyGroupBy() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->groupBy(array()) - ->from('users', 'u'); - - $this->assertEquals('SELECT u.*, p.* FROM users u', (string) $qb); - } - - public function testSelectEmptyAddGroupBy() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->addGroupBy(array()) - ->from('users', 'u'); - - $this->assertEquals('SELECT u.*, p.* FROM users u', (string) $qb); - } - - public function testSelectAddGroupBy() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->from('users', 'u') - ->groupBy('u.id') - ->addGroupBy('u.foo'); - - $this->assertEquals('SELECT u.*, p.* FROM users u GROUP BY u.id, u.foo', (string) $qb); - } - - public function testSelectAddGroupBys() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->from('users', 'u') - ->groupBy('u.id') - ->addGroupBy('u.foo', 'u.bar'); - - $this->assertEquals('SELECT u.*, p.* FROM users u GROUP BY u.id, u.foo, u.bar', (string) $qb); - } - - public function testSelectHaving() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->from('users', 'u') - ->groupBy('u.id') - ->having('u.name = ?'); - - $this->assertEquals('SELECT u.*, p.* FROM users u GROUP BY u.id HAVING u.name = ?', (string) $qb); - } - - public function testSelectAndHaving() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->from('users', 'u') - ->groupBy('u.id') - ->andHaving('u.name = ?'); - - $this->assertEquals('SELECT u.*, p.* FROM users u GROUP BY u.id HAVING u.name = ?', (string) $qb); - } - - public function testSelectHavingAndHaving() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->from('users', 'u') - ->groupBy('u.id') - ->having('u.name = ?') - ->andHaving('u.username = ?'); - - $this->assertEquals('SELECT u.*, p.* FROM users u GROUP BY u.id HAVING (u.name = ?) AND (u.username = ?)', (string) $qb); - } - - public function testSelectHavingOrHaving() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->from('users', 'u') - ->groupBy('u.id') - ->having('u.name = ?') - ->orHaving('u.username = ?'); - - $this->assertEquals('SELECT u.*, p.* FROM users u GROUP BY u.id HAVING (u.name = ?) OR (u.username = ?)', (string) $qb); - } - - public function testSelectOrHavingOrHaving() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->from('users', 'u') - ->groupBy('u.id') - ->orHaving('u.name = ?') - ->orHaving('u.username = ?'); - - $this->assertEquals('SELECT u.*, p.* FROM users u GROUP BY u.id HAVING (u.name = ?) OR (u.username = ?)', (string) $qb); - } - - public function testSelectHavingAndOrHaving() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->from('users', 'u') - ->groupBy('u.id') - ->having('u.name = ?') - ->orHaving('u.username = ?') - ->andHaving('u.username = ?'); - - $this->assertEquals('SELECT u.*, p.* FROM users u GROUP BY u.id HAVING ((u.name = ?) OR (u.username = ?)) AND (u.username = ?)', (string) $qb); - } - - public function testSelectOrderBy() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->from('users', 'u') - ->orderBy('u.name'); - - $this->assertEquals('SELECT u.*, p.* FROM users u ORDER BY u.name ASC', (string) $qb); - } - - public function testSelectAddOrderBy() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->from('users', 'u') - ->orderBy('u.name') - ->addOrderBy('u.username', 'DESC'); - - $this->assertEquals('SELECT u.*, p.* FROM users u ORDER BY u.name ASC, u.username DESC', (string) $qb); - } - - public function testSelectAddAddOrderBy() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*', 'p.*') - ->from('users', 'u') - ->addOrderBy('u.name') - ->addOrderBy('u.username', 'DESC'); - - $this->assertEquals('SELECT u.*, p.* FROM users u ORDER BY u.name ASC, u.username DESC', (string) $qb); - } - - public function testEmptySelect() - { - $qb = new QueryBuilder($this->conn); - $qb2 = $qb->select(); - - $this->assertSame($qb, $qb2); - $this->assertEquals(QueryBuilder::SELECT, $qb->getType()); - } - - public function testSelectAddSelect() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*') - ->addSelect('p.*') - ->from('users', 'u'); - - $this->assertEquals('SELECT u.*, p.* FROM users u', (string) $qb); - } - - public function testEmptyAddSelect() - { - $qb = new QueryBuilder($this->conn); - $qb2 = $qb->addSelect(); - - $this->assertSame($qb, $qb2); - $this->assertEquals(QueryBuilder::SELECT, $qb->getType()); - } - - public function testSelectMultipleFrom() - { - $qb = new QueryBuilder($this->conn); - $expr = $qb->expr(); - - $qb->select('u.*') - ->addSelect('p.*') - ->from('users', 'u') - ->from('phonenumbers', 'p'); - - $this->assertEquals('SELECT u.*, p.* FROM users u, phonenumbers p', (string) $qb); - } - - public function testUpdate() - { - $qb = new QueryBuilder($this->conn); - $qb->update('users', 'u') - ->set('u.foo', '?') - ->set('u.bar', '?'); - - $this->assertEquals(QueryBuilder::UPDATE, $qb->getType()); - $this->assertEquals('UPDATE users u SET u.foo = ?, u.bar = ?', (string) $qb); - } - - public function testUpdateWithoutAlias() - { - $qb = new QueryBuilder($this->conn); - $qb->update('users') - ->set('foo', '?') - ->set('bar', '?'); - - $this->assertEquals('UPDATE users SET foo = ?, bar = ?', (string) $qb); - } - - public function testUpdateWhere() - { - $qb = new QueryBuilder($this->conn); - $qb->update('users', 'u') - ->set('u.foo', '?') - ->where('u.foo = ?'); - - $this->assertEquals('UPDATE users u SET u.foo = ? WHERE u.foo = ?', (string) $qb); - } - - public function testEmptyUpdate() - { - $qb = new QueryBuilder($this->conn); - $qb2 = $qb->update(); - - $this->assertEquals(QueryBuilder::UPDATE, $qb->getType()); - $this->assertSame($qb2, $qb); - } - - public function testDelete() - { - $qb = new QueryBuilder($this->conn); - $qb->delete('users', 'u'); - - $this->assertEquals(QueryBuilder::DELETE, $qb->getType()); - $this->assertEquals('DELETE FROM users u', (string) $qb); - } - - public function testDeleteWithoutAlias() - { - $qb = new QueryBuilder($this->conn); - $qb->delete('users'); - - $this->assertEquals(QueryBuilder::DELETE, $qb->getType()); - $this->assertEquals('DELETE FROM users', (string) $qb); - } - - public function testDeleteWhere() - { - $qb = new QueryBuilder($this->conn); - $qb->delete('users', 'u') - ->where('u.foo = ?'); - - $this->assertEquals('DELETE FROM users u WHERE u.foo = ?', (string) $qb); - } - - public function testEmptyDelete() - { - $qb = new QueryBuilder($this->conn); - $qb2 = $qb->delete(); - - $this->assertEquals(QueryBuilder::DELETE, $qb->getType()); - $this->assertSame($qb2, $qb); - } - - public function testGetConnection() - { - $qb = new QueryBuilder($this->conn); - $this->assertSame($this->conn, $qb->getConnection()); - } - - public function testGetState() - { - $qb = new QueryBuilder($this->conn); - - $this->assertEquals(QueryBuilder::STATE_CLEAN, $qb->getState()); - - $qb->select('u.*')->from('users', 'u'); - - $this->assertEquals(QueryBuilder::STATE_DIRTY, $qb->getState()); - - $sql1 = $qb->getSQL(); - - $this->assertEquals(QueryBuilder::STATE_CLEAN, $qb->getState()); - $this->assertEquals($sql1, $qb->getSQL()); - } - - public function testSetMaxResults() - { - $qb = new QueryBuilder($this->conn); - $qb->setMaxResults(10); - - $this->assertEquals(QueryBuilder::STATE_DIRTY, $qb->getState()); - $this->assertEQuals(10, $qb->getMaxResults()); - } - - public function testSetFirstResult() - { - $qb = new QueryBuilder($this->conn); - $qb->setFirstResult(10); - - $this->assertEquals(QueryBuilder::STATE_DIRTY, $qb->getState()); - $this->assertEQuals(10, $qb->getFirstResult()); - } - - public function testResetQueryPart() - { - $qb = new QueryBuilder($this->conn); - - $qb->select('u.*')->from('users', 'u')->where('u.name = ?'); - - $this->assertEquals('SELECT u.* FROM users u WHERE u.name = ?', (string)$qb); - $qb->resetQueryPart('where'); - $this->assertEquals('SELECT u.* FROM users u', (string)$qb); - } - - public function testResetQueryParts() - { - $qb = new QueryBuilder($this->conn); - - $qb->select('u.*')->from('users', 'u')->where('u.name = ?')->orderBy('u.name'); - - $this->assertEquals('SELECT u.* FROM users u WHERE u.name = ? ORDER BY u.name ASC', (string)$qb); - $qb->resetQueryParts(array('where', 'orderBy')); - $this->assertEquals('SELECT u.* FROM users u', (string)$qb); - } - - public function testCreateNamedParameter() - { - $qb = new QueryBuilder($this->conn); - - $qb->select('u.*')->from('users', 'u')->where( - $qb->expr()->eq('u.name', $qb->createNamedParameter(10, \PDO::PARAM_INT)) - ); - - $this->assertEquals('SELECT u.* FROM users u WHERE u.name = :dcValue1', (string)$qb); - $this->assertEquals(10, $qb->getParameter('dcValue1')); - } - - public function testCreateNamedParameterCustomPlaceholder() - { - $qb = new QueryBuilder($this->conn); - - $qb->select('u.*')->from('users', 'u')->where( - $qb->expr()->eq('u.name', $qb->createNamedParameter(10, \PDO::PARAM_INT, ':test')) - ); - - $this->assertEquals('SELECT u.* FROM users u WHERE u.name = :test', (string)$qb); - $this->assertEquals(10, $qb->getParameter('test')); - } - - public function testCreatePositionalParameter() - { - $qb = new QueryBuilder($this->conn); - - $qb->select('u.*')->from('users', 'u')->where( - $qb->expr()->eq('u.name', $qb->createPositionalParameter(10, \PDO::PARAM_INT)) - ); - - $this->assertEquals('SELECT u.* FROM users u WHERE u.name = ?', (string)$qb); - $this->assertEquals(10, $qb->getParameter(1)); - } - - /** - * @group DBAL-172 - */ - public function testReferenceJoinFromJoin() - { - $qb = new QueryBuilder($this->conn); - - $qb->select("l.id", "mdsh.xcode", "mdso.xcode") - ->from("location_tree", "l") - ->join("l", "location_tree_pos", "p", "l.id = p.tree_id") - ->rightJoin("l", "hotel", "h", "h.location_id = l.id") - ->leftJoin("l", "offer_location", "ol", "l.id=ol.location_id") - ->leftJoin("ol", "mds_offer", "mdso", "ol.offer_id = mdso.offer_id") - ->leftJoin("h", "mds_hotel", "mdsh", "h.id = mdsh.hotel_id") - ->where("p.parent_id IN (:ids)") - ->andWhere("(mdso.xcode IS NOT NULL OR mdsh.xcode IS NOT NULL)"); - - $this->setExpectedException('Doctrine\DBAL\Query\QueryException', "The given alias 'ol' is not part of any FROM clause table. The currently registered FROM-clause aliases are: l"); - $this->assertEquals('', $qb->getSQL()); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php deleted file mode 100644 index 6467d8b..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php +++ /dev/null @@ -1,214 +0,0 @@ - 'foo', 17 => 'bar')), - array('SELECT * FROM Foo WHERE bar IN (:name1, :name2)', false, array(32 => 'name1', 40 => 'name2')), - array('SELECT ":foo" FROM Foo WHERE bar IN (:name1, :name2)', false, array(37 => 'name1', 45 => 'name2')), - array("SELECT ':foo' FROM Foo WHERE bar IN (:name1, :name2)", false, array(37 => 'name1', 45 => 'name2')), - array('SELECT :foo_id', false, array(7 => 'foo_id')), // Ticket DBAL-231 - ); - } - - /** - * @dataProvider dataGetPlaceholderPositions - * @param type $query - * @param type $isPositional - * @param type $expectedParamPos - */ - public function testGetPlaceholderPositions($query, $isPositional, $expectedParamPos) - { - $actualParamPos = SQLParserUtils::getPlaceholderPositions($query, $isPositional); - $this->assertEquals($expectedParamPos, $actualParamPos); - } - - static public function dataExpandListParameters() - { - return array( - // Positional: Very simple with one needle - array( - "SELECT * FROM Foo WHERE foo IN (?)", - array(array(1, 2, 3)), - array(Connection::PARAM_INT_ARRAY), - 'SELECT * FROM Foo WHERE foo IN (?, ?, ?)', - array(1, 2, 3), - array(\PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_INT) - ), - // Positional: One non-list before d one after list-needle - array( - "SELECT * FROM Foo WHERE foo = ? AND bar IN (?)", - array("string", array(1, 2, 3)), - array(\PDO::PARAM_STR, Connection::PARAM_INT_ARRAY), - 'SELECT * FROM Foo WHERE foo = ? AND bar IN (?, ?, ?)', - array("string", 1, 2, 3), - array(\PDO::PARAM_STR, \PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_INT) - ), - // Positional: One non-list after list-needle - array( - "SELECT * FROM Foo WHERE bar IN (?) AND baz = ?", - array(array(1, 2, 3), "foo"), - array(Connection::PARAM_INT_ARRAY, \PDO::PARAM_STR), - 'SELECT * FROM Foo WHERE bar IN (?, ?, ?) AND baz = ?', - array(1, 2, 3, "foo"), - array(\PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_STR) - ), - // Positional: One non-list before and one after list-needle - array( - "SELECT * FROM Foo WHERE foo = ? AND bar IN (?) AND baz = ?", - array(1, array(1, 2, 3), 4), - array(\PDO::PARAM_INT, Connection::PARAM_INT_ARRAY, \PDO::PARAM_INT), - 'SELECT * FROM Foo WHERE foo = ? AND bar IN (?, ?, ?) AND baz = ?', - array(1, 1, 2, 3, 4), - array(\PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_INT) - ), - // Positional: Two lists - array( - "SELECT * FROM Foo WHERE foo IN (?, ?)", - array(array(1, 2, 3), array(4, 5)), - array(Connection::PARAM_INT_ARRAY, Connection::PARAM_INT_ARRAY), - 'SELECT * FROM Foo WHERE foo IN (?, ?, ?, ?, ?)', - array(1, 2, 3, 4, 5), - array(\PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_INT) - ), - // Named parameters : Very simple with param int - array( - "SELECT * FROM Foo WHERE foo = :foo", - array('foo'=>1), - array('foo'=>\PDO::PARAM_INT), - 'SELECT * FROM Foo WHERE foo = ?', - array(1), - array(\PDO::PARAM_INT) - ), - - // Named parameters : Very simple with param int and string - array( - "SELECT * FROM Foo WHERE foo = :foo AND bar = :bar", - array('bar'=>'Some String','foo'=>1), - array('foo'=>\PDO::PARAM_INT,'bar'=>\PDO::PARAM_STR), - 'SELECT * FROM Foo WHERE foo = ? AND bar = ?', - array(1,'Some String'), - array(\PDO::PARAM_INT, \PDO::PARAM_STR) - ), - - // Named parameters : Very simple with one needle - array( - "SELECT * FROM Foo WHERE foo IN (:foo)", - array('foo'=>array(1, 2, 3)), - array('foo'=>Connection::PARAM_INT_ARRAY), - 'SELECT * FROM Foo WHERE foo IN (?, ?, ?)', - array(1, 2, 3), - array(\PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_INT) - ), - // Named parameters: One non-list before d one after list-needle - array( - "SELECT * FROM Foo WHERE foo = :foo AND bar IN (:bar)", - array('foo'=>"string", 'bar'=>array(1, 2, 3)), - array('foo'=>\PDO::PARAM_STR, 'bar'=>Connection::PARAM_INT_ARRAY), - 'SELECT * FROM Foo WHERE foo = ? AND bar IN (?, ?, ?)', - array("string", 1, 2, 3), - array(\PDO::PARAM_STR, \PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_INT) - ), - // Named parameters: One non-list after list-needle - array( - "SELECT * FROM Foo WHERE bar IN (:bar) AND baz = :baz", - array('bar'=>array(1, 2, 3), 'baz'=>"foo"), - array('bar'=>Connection::PARAM_INT_ARRAY, 'baz'=>\PDO::PARAM_STR), - 'SELECT * FROM Foo WHERE bar IN (?, ?, ?) AND baz = ?', - array(1, 2, 3, "foo"), - array(\PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_STR) - ), - // Named parameters: One non-list before and one after list-needle - array( - "SELECT * FROM Foo WHERE foo = :foo AND bar IN (:bar) AND baz = :baz", - array('bar'=>array(1, 2, 3),'foo'=>1, 'baz'=>4), - array('bar'=>Connection::PARAM_INT_ARRAY, 'foo'=>\PDO::PARAM_INT, 'baz'=>\PDO::PARAM_INT), - 'SELECT * FROM Foo WHERE foo = ? AND bar IN (?, ?, ?) AND baz = ?', - array(1, 1, 2, 3, 4), - array(\PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_INT) - ), - // Named parameters: Two lists - array( - "SELECT * FROM Foo WHERE foo IN (:a, :b)", - array('b'=>array(4, 5),'a'=>array(1, 2, 3)), - array('a'=>Connection::PARAM_INT_ARRAY, 'b'=>Connection::PARAM_INT_ARRAY), - 'SELECT * FROM Foo WHERE foo IN (?, ?, ?, ?, ?)', - array(1, 2, 3, 4, 5), - array(\PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_INT) - ), - // Named parameters : With the same name arg type string - array( - "SELECT * FROM Foo WHERE foo <> :arg AND bar = :arg", - array('arg'=>"Some String"), - array('arg'=>\PDO::PARAM_STR), - 'SELECT * FROM Foo WHERE foo <> ? AND bar = ?', - array("Some String","Some String"), - array(\PDO::PARAM_STR,\PDO::PARAM_STR,) - ), - // Named parameters : With the same name arg - array( - "SELECT * FROM Foo WHERE foo IN (:arg) AND NOT bar IN (:arg)", - array('arg'=>array(1, 2, 3)), - array('arg'=>Connection::PARAM_INT_ARRAY), - 'SELECT * FROM Foo WHERE foo IN (?, ?, ?) AND NOT bar IN (?, ?, ?)', - array(1, 2, 3, 1, 2, 3), - array(\PDO::PARAM_INT,\PDO::PARAM_INT, \PDO::PARAM_INT,\PDO::PARAM_INT,\PDO::PARAM_INT, \PDO::PARAM_INT) - ), - - // Named parameters : Same name, other name in between DBAL-299 - array( - "SELECT * FROM Foo WHERE (:foo = 2) AND (:bar = 3) AND (:foo = 2)", - array('foo'=>2,'bar'=>3), - array('foo'=>\PDO::PARAM_INT,'bar'=>\PDO::PARAM_INT), - 'SELECT * FROM Foo WHERE (? = 2) AND (? = 3) AND (? = 2)', - array(2, 3, 2), - array(\PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_INT) - ), - ); - } - - /** - * @dataProvider dataExpandListParameters - * @param type $q - * @param type $p - * @param type $t - * @param type $expectedQuery - * @param type $expectedParams - * @param type $expectedTypes - */ - public function testExpandListParameters($q, $p, $t, $expectedQuery, $expectedParams, $expectedTypes) - { - list($query, $params, $types) = SQLParserUtils::expandListParameters($q, $p, $t); - - $this->assertEquals($expectedQuery, $query, "Query was not rewritten correctly."); - $this->assertEquals($expectedParams, $params, "Params dont match"); - $this->assertEquals($expectedTypes, $types, "Types dont match"); - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/ColumnTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/ColumnTest.php deleted file mode 100644 index 2051061..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/ColumnTest.php +++ /dev/null @@ -1,114 +0,0 @@ -createColumn(); - - $this->assertEquals("foo", $column->getName()); - $this->assertSame(Type::getType('string'), $column->getType()); - - $this->assertEquals(200, $column->getLength()); - $this->assertEquals(5, $column->getPrecision()); - $this->assertEquals(2, $column->getScale()); - $this->assertTrue($column->getUnsigned()); - $this->assertFalse($column->getNotNull()); - $this->assertTrue($column->getFixed()); - $this->assertEquals("baz", $column->getDefault()); - - $this->assertEquals(array('foo' => 'bar'), $column->getPlatformOptions()); - $this->assertTrue($column->hasPlatformOption('foo')); - $this->assertEquals('bar', $column->getPlatformOption('foo')); - $this->assertFalse($column->hasPlatformOption('bar')); - - $this->assertEquals(array('bar' => 'baz'), $column->getCustomSchemaOptions()); - $this->assertTrue($column->hasCustomSchemaOption('bar')); - $this->assertEquals('baz', $column->getCustomSchemaOption('bar')); - $this->assertFalse($column->hasCustomSchemaOption('foo')); - } - - public function testToArray() - { - $expected = array( - 'name' => 'foo', - 'type' => Type::getType('string'), - 'default' => 'baz', - 'notnull' => false, - 'length' => 200, - 'precision' => 5, - 'scale' => 2, - 'fixed' => true, - 'unsigned' => true, - 'autoincrement' => false, - 'columnDefinition' => null, - 'comment' => null, - 'foo' => 'bar', - 'bar' => 'baz' - ); - - $this->assertEquals($expected, $this->createColumn()->toArray()); - } - - /** - * @return Column - */ - public function createColumn() - { - $options = array( - 'length' => 200, - 'precision' => 5, - 'scale' => 2, - 'unsigned' => true, - 'notnull' => false, - 'fixed' => true, - 'default' => 'baz', - 'platformOptions' => array('foo' => 'bar'), - 'customSchemaOptions' => array('bar' => 'baz'), - ); - - $string = Type::getType('string'); - return new Column("foo", $string, $options); - } - - /** - * @group DBAL-64 - */ - public function testQuotedColumnName() - { - $string = Type::getType('string'); - $column = new Column("`bar`", $string, array()); - - $mysqlPlatform = new \Doctrine\DBAL\Platforms\MySqlPlatform(); - $sqlitePlatform = new \Doctrine\DBAL\Platforms\SqlitePlatform(); - - $this->assertEquals('bar', $column->getName()); - $this->assertEquals('`bar`', $column->getQuotedName($mysqlPlatform)); - $this->assertEquals('"bar"', $column->getQuotedName($sqlitePlatform)); - } - - /** - * @group DBAL-42 - */ - public function testColumnComment() - { - $column = new Column("bar", Type::getType('string')); - $this->assertNull($column->getComment()); - - $column->setComment("foo"); - $this->assertEquals("foo", $column->getComment()); - - $columnArray = $column->toArray(); - $this->assertArrayHasKey('comment', $columnArray); - $this->assertEquals('foo', $columnArray['comment']); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php deleted file mode 100644 index bb48c5b..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php +++ /dev/null @@ -1,787 +0,0 @@ -. - */ - -namespace Doctrine\Tests\DBAL\Schema; - -require_once __DIR__ . '/../../TestInit.php'; - -use Doctrine\DBAL\Schema\Schema, - Doctrine\DBAL\Schema\SchemaConfig, - Doctrine\DBAL\Schema\Table, - Doctrine\DBAL\Schema\Column, - Doctrine\DBAL\Schema\Index, - Doctrine\DBAL\Schema\Sequence, - Doctrine\DBAL\Schema\SchemaDiff, - Doctrine\DBAL\Schema\TableDiff, - Doctrine\DBAL\Schema\Comparator, - Doctrine\DBAL\Types\Type, - Doctrine\DBAL\Schema\ForeignKeyConstraint; - -/** - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @copyright Copyright (C) 2005-2009 eZ Systems AS. All rights reserved. - * @license http://ez.no/licenses/new_bsd New BSD License - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - */ -class ComparatorTest extends \PHPUnit_Framework_TestCase -{ - public function testCompareSame1() - { - $schema1 = new Schema( array( - 'bugdb' => new Table('bugdb', - array ( - 'integerfield1' => new Column('integerfield1', Type::getType('integer' ) ), - ) - ), - ) ); - $schema2 = new Schema( array( - 'bugdb' => new Table('bugdb', - array ( - 'integerfield1' => new Column('integerfield1', Type::getType('integer') ), - ) - ), - ) ); - - $this->assertEquals(new SchemaDiff(), Comparator::compareSchemas( $schema1, $schema2 ) ); - } - - public function testCompareSame2() - { - $schema1 = new Schema( array( - 'bugdb' => new Table('bugdb', - array ( - 'integerfield1' => new Column('integerfield1', Type::getType('integer')), - 'integerfield2' => new Column('integerfield2', Type::getType('integer')), - ) - ), - ) ); - $schema2 = new Schema( array( - 'bugdb' => new Table('bugdb', - array ( - 'integerfield2' => new Column('integerfield2', Type::getType('integer')), - 'integerfield1' => new Column('integerfield1', Type::getType('integer')), - ) - ), - ) ); - $this->assertEquals(new SchemaDiff(), Comparator::compareSchemas( $schema1, $schema2 ) ); - } - - public function testCompareMissingTable() - { - $schemaConfig = new \Doctrine\DBAL\Schema\SchemaConfig; - $table = new Table('bugdb', array ('integerfield1' => new Column('integerfield1', Type::getType('integer')))); - $table->setSchemaConfig($schemaConfig); - - $schema1 = new Schema( array($table), array(), $schemaConfig ); - $schema2 = new Schema( array(), array(), $schemaConfig ); - - $expected = new SchemaDiff( array(), array(), array('bugdb' => $table) ); - - $this->assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ) ); - } - - public function testCompareNewTable() - { - $schemaConfig = new \Doctrine\DBAL\Schema\SchemaConfig; - $table = new Table('bugdb', array ('integerfield1' => new Column('integerfield1', Type::getType('integer')))); - $table->setSchemaConfig($schemaConfig); - - $schema1 = new Schema( array(), array(), $schemaConfig ); - $schema2 = new Schema( array($table), array(), $schemaConfig ); - - $expected = new SchemaDiff( array('bugdb' => $table), array(), array() ); - $this->assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ) ); - } - - public function testCompareOnlyAutoincrementChanged() - { - $column1 = new Column('foo', Type::getType('integer'), array('autoincrement' => true)); - $column2 = new Column('foo', Type::getType('integer'), array('autoincrement' => false)); - - $comparator = new Comparator(); - $changedProperties = $comparator->diffColumn($column1, $column2); - - $this->assertEquals(array('autoincrement'), $changedProperties); - } - - public function testCompareMissingField() - { - $missingColumn = new Column('integerfield1', Type::getType('integer')); - $schema1 = new Schema( array( - 'bugdb' => new Table('bugdb', - array ( - 'integerfield1' => $missingColumn, - 'integerfield2' => new Column('integerfield2', Type::getType('integer')), - ) - ), - ) ); - $schema2 = new Schema( array( - 'bugdb' => new Table('bugdb', - array ( - 'integerfield2' => new Column('integerfield2', Type::getType('integer')), - ) - ), - ) ); - - $expected = new SchemaDiff ( array(), - array ( - 'bugdb' => new TableDiff( 'bugdb', array(), array(), - array ( - 'integerfield1' => $missingColumn, - ) - ) - ) - ); - $this->assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ) ); - } - - public function testCompareNewField() - { - $schema1 = new Schema( array( - 'bugdb' => new Table('bugdb', - array ( - 'integerfield1' => new Column('integerfield1', Type::getType('integer')), - ) - ), - ) ); - $schema2 = new Schema( array( - 'bugdb' => new Table('bugdb', - array ( - 'integerfield1' => new Column('integerfield1', Type::getType('integer')), - 'integerfield2' => new Column('integerfield2', Type::getType('integer')), - ) - ), - ) ); - - $expected = new SchemaDiff ( array(), - array ( - 'bugdb' => new TableDiff ('bugdb', - array ( - 'integerfield2' => new Column('integerfield2', Type::getType('integer')), - ) - ), - ) - ); - $this->assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ) ); - } - - public function testCompareChangedColumns_ChangeType() - { - $column1 = new Column('charfield1', Type::getType('string')); - $column2 = new Column('charfield1', Type::getType('integer')); - - $c = new Comparator(); - $this->assertEquals(array('type'), $c->diffColumn($column1, $column2)); - $this->assertEquals(array(), $c->diffColumn($column1, $column1)); - } - - public function testCompareChangedColumns_ChangeCustomSchemaOption() - { - $column1 = new Column('charfield1', Type::getType('string')); - $column2 = new Column('charfield1', Type::getType('string')); - - $column1->setCustomSchemaOption('foo', 'bar'); - $column2->setCustomSchemaOption('foo', 'bar'); - - $column1->setCustomSchemaOption('foo1', 'bar1'); - $column2->setCustomSchemaOption('foo2', 'bar2'); - - $c = new Comparator(); - $this->assertEquals(array('foo1', 'foo2'), $c->diffColumn($column1, $column2)); - $this->assertEquals(array(), $c->diffColumn($column1, $column1)); - } - - public function testCompareRemovedIndex() - { - $schema1 = new Schema( array( - 'bugdb' => new Table('bugdb', - array ( - 'integerfield1' => new Column('integerfield1', Type::getType('integer')), - 'integerfield2' => new Column('integerfield2', Type::getType('integer')), - ), - array ( - 'primary' => new Index('primary', - array( - 'integerfield1' - ), - true - ) - ) - ), - ) ); - $schema2 = new Schema( array( - 'bugdb' => new Table('bugdb', - array ( - 'integerfield1' => new Column('integerfield1', Type::getType('integer')), - 'integerfield2' => new Column('integerfield2', Type::getType('integer')), - ) - ), - ) ); - - $expected = new SchemaDiff ( array(), - array ( - 'bugdb' => new TableDiff( 'bugdb', array(), array(), array(), array(), array(), - array ( - 'primary' => new Index('primary', - array( - 'integerfield1' - ), - true - ) - ) - ), - ) - ); - $this->assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ) ); - } - - public function testCompareNewIndex() - { - $schema1 = new Schema( array( - 'bugdb' => new Table('bugdb', - array ( - 'integerfield1' => new Column('integerfield1', Type::getType('integer')), - 'integerfield2' => new Column('integerfield2', Type::getType('integer')), - ) - ), - ) ); - $schema2 = new Schema( array( - 'bugdb' => new Table('bugdb', - array ( - 'integerfield1' => new Column('integerfield1', Type::getType('integer')), - 'integerfield2' => new Column('integerfield2', Type::getType('integer')), - ), - array ( - 'primary' => new Index('primary', - array( - 'integerfield1' - ), - true - ) - ) - ), - ) ); - - $expected = new SchemaDiff ( array(), - array ( - 'bugdb' => new TableDiff( 'bugdb', array(), array(), array(), - array ( - 'primary' => new Index('primary', - array( - 'integerfield1' - ), - true - ) - ) - ), - ) - ); - $this->assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ) ); - } - - public function testCompareChangedIndex() - { - $schema1 = new Schema( array( - 'bugdb' => new Table('bugdb', - array ( - 'integerfield1' => new Column('integerfield1', Type::getType('integer')), - 'integerfield2' => new Column('integerfield2', Type::getType('integer')), - ), - array ( - 'primary' => new Index('primary', - array( - 'integerfield1' - ), - true - ) - ) - ), - ) ); - $schema2 = new Schema( array( - 'bugdb' => new Table('bugdb', - array ( - 'integerfield1' => new Column('integerfield1', Type::getType('integer')), - 'integerfield2' => new Column('integerfield2', Type::getType('integer')), - ), - array ( - 'primary' => new Index('primary', - array('integerfield1', 'integerfield2'), - true - ) - ) - ), - ) ); - - $expected = new SchemaDiff ( array(), - array ( - 'bugdb' => new TableDiff( 'bugdb', array(), array(), array(), array(), - array ( - 'primary' => new Index('primary', - array( - 'integerfield1', - 'integerfield2' - ), - true - ) - ) - ), - ) - ); - $actual = Comparator::compareSchemas( $schema1, $schema2 ); - $this->assertEquals($expected, $actual); - } - - public function testCompareChangedIndexFieldPositions() - { - $schema1 = new Schema( array( - 'bugdb' => new Table('bugdb', - array ( - 'integerfield1' => new Column('integerfield1', Type::getType('integer')), - 'integerfield2' => new Column('integerfield2', Type::getType('integer')), - ), - array ( - 'primary' => new Index('primary', array('integerfield1', 'integerfield2'), true) - ) - ), - ) ); - $schema2 = new Schema( array( - 'bugdb' => new Table('bugdb', - array ( - 'integerfield1' => new Column('integerfield1', Type::getType('integer')), - 'integerfield2' => new Column('integerfield2', Type::getType('integer')), - ), - array ( - 'primary' => new Index('primary', array('integerfield2', 'integerfield1'), true) - ) - ), - ) ); - - $expected = new SchemaDiff ( array(), - array ( - 'bugdb' => new TableDiff('bugdb', array(), array(), array(), array(), - array ( - 'primary' => new Index('primary', array('integerfield2', 'integerfield1'), true) - ) - ), - ) - ); - $actual = Comparator::compareSchemas( $schema1, $schema2 ); - $this->assertEquals($expected, $actual); - } - - public function testCompareSequences() - { - $seq1 = new Sequence('foo', 1, 1); - $seq2 = new Sequence('foo', 1, 2); - $seq3 = new Sequence('foo', 2, 1); - - $c = new Comparator(); - - $this->assertTrue($c->diffSequence($seq1, $seq2)); - $this->assertTrue($c->diffSequence($seq1, $seq3)); - } - - public function testRemovedSequence() - { - $schema1 = new Schema(); - $seq = $schema1->createSequence('foo'); - - $schema2 = new Schema(); - - $c = new Comparator(); - $diffSchema = $c->compare($schema1, $schema2); - - $this->assertEquals(1, count($diffSchema->removedSequences)); - $this->assertSame($seq, $diffSchema->removedSequences[0]); - } - - public function testAddedSequence() - { - $schema1 = new Schema(); - - $schema2 = new Schema(); - $seq = $schema2->createSequence('foo'); - - $c = new Comparator(); - $diffSchema = $c->compare($schema1, $schema2); - - $this->assertEquals(1, count($diffSchema->newSequences)); - $this->assertSame($seq, $diffSchema->newSequences[0]); - } - - public function testTableAddForeignKey() - { - $tableForeign = new Table("bar"); - $tableForeign->addColumn('id', 'integer'); - - $table1 = new Table("foo"); - $table1->addColumn('fk', 'integer'); - - $table2 = new Table("foo"); - $table2->addColumn('fk', 'integer'); - $table2->addForeignKeyConstraint($tableForeign, array('fk'), array('id')); - - $c = new Comparator(); - $tableDiff = $c->diffTable($table1, $table2); - - $this->assertInstanceOf('Doctrine\DBAL\Schema\TableDiff', $tableDiff); - $this->assertEquals(1, count($tableDiff->addedForeignKeys)); - } - - public function testTableRemoveForeignKey() - { - $tableForeign = new Table("bar"); - $tableForeign->addColumn('id', 'integer'); - - $table1 = new Table("foo"); - $table1->addColumn('fk', 'integer'); - - $table2 = new Table("foo"); - $table2->addColumn('fk', 'integer'); - $table2->addForeignKeyConstraint($tableForeign, array('fk'), array('id')); - - $c = new Comparator(); - $tableDiff = $c->diffTable($table2, $table1); - - $this->assertInstanceOf('Doctrine\DBAL\Schema\TableDiff', $tableDiff); - $this->assertEquals(1, count($tableDiff->removedForeignKeys)); - } - - public function testTableUpdateForeignKey() - { - $tableForeign = new Table("bar"); - $tableForeign->addColumn('id', 'integer'); - - $table1 = new Table("foo"); - $table1->addColumn('fk', 'integer'); - $table1->addForeignKeyConstraint($tableForeign, array('fk'), array('id')); - - $table2 = new Table("foo"); - $table2->addColumn('fk', 'integer'); - $table2->addForeignKeyConstraint($tableForeign, array('fk'), array('id'), array('onUpdate' => 'CASCADE')); - - $c = new Comparator(); - $tableDiff = $c->diffTable($table1, $table2); - - $this->assertInstanceOf('Doctrine\DBAL\Schema\TableDiff', $tableDiff); - $this->assertEquals(1, count($tableDiff->changedForeignKeys)); - } - - public function testTablesCaseInsensitive() - { - $schemaA = new Schema(); - $schemaA->createTable('foo'); - $schemaA->createTable('bAr'); - $schemaA->createTable('BAZ'); - $schemaA->createTable('new'); - - $schemaB = new Schema(); - $schemaB->createTable('FOO'); - $schemaB->createTable('bar'); - $schemaB->createTable('Baz'); - $schemaB->createTable('old'); - - $c = new Comparator(); - $diff = $c->compare($schemaA, $schemaB); - - $this->assertSchemaTableChangeCount($diff, 1, 0, 1); - } - - public function testSequencesCaseInsenstive() - { - $schemaA = new Schema(); - $schemaA->createSequence('foo'); - $schemaA->createSequence('BAR'); - $schemaA->createSequence('Baz'); - $schemaA->createSequence('new'); - - $schemaB = new Schema(); - $schemaB->createSequence('FOO'); - $schemaB->createSequence('Bar'); - $schemaB->createSequence('baz'); - $schemaB->createSequence('old'); - - $c = new Comparator(); - $diff = $c->compare($schemaA, $schemaB); - - $this->assertSchemaSequenceChangeCount($diff, 1, 0, 1); - } - - public function testCompareColumnCompareCaseInsensitive() - { - $tableA = new Table("foo"); - $tableA->addColumn('id', 'integer'); - - $tableB = new Table("foo"); - $tableB->addColumn('ID', 'integer'); - - $c = new Comparator(); - $tableDiff = $c->diffTable($tableA, $tableB); - - $this->assertFalse($tableDiff); - } - - public function testCompareIndexBasedOnPropertiesNotName() - { - $tableA = new Table("foo"); - $tableA->addColumn('id', 'integer'); - $tableA->addIndex(array("id"), "foo_bar_idx"); - - $tableB = new Table("foo"); - $tableB->addColumn('ID', 'integer'); - $tableB->addIndex(array("id"), "bar_foo_idx"); - - $c = new Comparator(); - $tableDiff = $c->diffTable($tableA, $tableB); - - $this->assertFalse($tableDiff); - } - - public function testCompareForeignKeyBasedOnPropertiesNotName() - { - $tableA = new Table("foo"); - $tableA->addColumn('id', 'integer'); - $tableA->addNamedForeignKeyConstraint('foo_constraint', 'bar', array('id'), array('id')); - - $tableB = new Table("foo"); - $tableB->addColumn('ID', 'integer'); - $tableB->addNamedForeignKeyConstraint('bar_constraint', 'bar', array('id'), array('id')); - - $c = new Comparator(); - $tableDiff = $c->diffTable($tableA, $tableB); - - $this->assertFalse($tableDiff); - } - - public function testCompareForeignKey_RestrictNoAction_AreTheSame() - { - $fk1 = new ForeignKeyConstraint(array("foo"), "bar", array("baz"), "fk1", array('onDelete' => 'NO ACTION')); - $fk2 = new ForeignKeyConstraint(array("foo"), "bar", array("baz"), "fk1", array('onDelete' => 'RESTRICT')); - - $c = new Comparator(); - $this->assertFalse($c->diffForeignKey($fk1, $fk2)); - } - - public function testDetectRenameColumn() - { - $tableA = new Table("foo"); - $tableA->addColumn('foo', 'integer'); - - $tableB = new Table("foo"); - $tableB->addColumn('bar', 'integer'); - - $c = new Comparator(); - $tableDiff = $c->diffTable($tableA, $tableB); - - $this->assertEquals(0, count($tableDiff->addedColumns)); - $this->assertEquals(0, count($tableDiff->removedColumns)); - $this->assertArrayHasKey('foo', $tableDiff->renamedColumns); - $this->assertEquals('bar', $tableDiff->renamedColumns['foo']->getName()); - } - - /** - * You can easily have ambiguouties in the column renaming. If these - * are detected no renaming should take place, instead adding and dropping - * should be used exclusively. - * - * @group DBAL-24 - */ - public function testDetectRenameColumnAmbiguous() - { - $tableA = new Table("foo"); - $tableA->addColumn('foo', 'integer'); - $tableA->addColumn('bar', 'integer'); - - $tableB = new Table("foo"); - $tableB->addColumn('baz', 'integer'); - - $c = new Comparator(); - $tableDiff = $c->diffTable($tableA, $tableB); - - $this->assertEquals(1, count($tableDiff->addedColumns), "'baz' should be added, not created through renaming!"); - $this->assertArrayHasKey('baz', $tableDiff->addedColumns, "'baz' should be added, not created through renaming!"); - $this->assertEquals(2, count($tableDiff->removedColumns), "'foo' and 'bar' should both be dropped, an ambigouty exists which one could be renamed to 'baz'."); - $this->assertArrayHasKey('foo', $tableDiff->removedColumns, "'foo' should be removed."); - $this->assertArrayHasKey('bar', $tableDiff->removedColumns, "'bar' should be removed."); - $this->assertEquals(0, count($tableDiff->renamedColumns), "no renamings should take place."); - } - - public function testDetectChangeIdentifierType() - { - $this->markTestSkipped('DBAL-2 was reopened, this test cannot work anymore.'); - - $tableA = new Table("foo"); - $tableA->addColumn('id', 'integer', array('autoincrement' => false)); - - $tableB = new Table("foo"); - $tableB->addColumn('id', 'integer', array('autoincrement' => true)); - - $c = new Comparator(); - $tableDiff = $c->diffTable($tableA, $tableB); - - $this->assertInstanceOf('Doctrine\DBAL\Schema\TableDiff', $tableDiff); - $this->assertArrayHasKey('id', $tableDiff->changedColumns); - } - - - /** - * @group DBAL-105 - */ - public function testDiff() - { - $table = new \Doctrine\DBAL\Schema\Table('twitter_users'); - $table->addColumn('id', 'integer', array('autoincrement' => true)); - $table->addColumn('twitterId', 'integer', array('nullable' => false)); - $table->addColumn('displayName', 'string', array('nullable' => false)); - $table->setPrimaryKey(array('id')); - - $newtable = new \Doctrine\DBAL\Schema\Table('twitter_users'); - $newtable->addColumn('id', 'integer', array('autoincrement' => true)); - $newtable->addColumn('twitter_id', 'integer', array('nullable' => false)); - $newtable->addColumn('display_name', 'string', array('nullable' => false)); - $newtable->addColumn('logged_in_at', 'datetime', array('nullable' => true)); - $newtable->setPrimaryKey(array('id')); - - $c = new Comparator(); - $tableDiff = $c->diffTable($table, $newtable); - - $this->assertInstanceOf('Doctrine\DBAL\Schema\TableDiff', $tableDiff); - $this->assertEquals(array('twitterid', 'displayname'), array_keys($tableDiff->renamedColumns)); - $this->assertEquals(array('logged_in_at'), array_keys($tableDiff->addedColumns)); - $this->assertEquals(0, count($tableDiff->removedColumns)); - } - - - /** - * @group DBAL-112 - */ - public function testChangedSequence() - { - $schema = new Schema(); - $sequence = $schema->createSequence('baz'); - - $schemaNew = clone $schema; - /* @var $schemaNew Schema */ - $schemaNew->getSequence('baz')->setAllocationSize(20); - - $c = new \Doctrine\DBAL\Schema\Comparator; - $diff = $c->compare($schema, $schemaNew); - - $this->assertSame($diff->changedSequences[0] , $schemaNew->getSequence('baz')); - } - - /** - * @group DBAL-106 - */ - public function testDiffDecimalWithNullPrecision() - { - $column = new Column('foo', Type::getType('decimal')); - $column->setPrecision(null); - - $column2 = new Column('foo', Type::getType('decimal')); - - $c = new Comparator(); - $this->assertEquals(array(), $c->diffColumn($column, $column2)); - } - - /** - * @group DBAL-204 - */ - public function testFqnSchemaComparision() - { - $config = new SchemaConfig(); - $config->setName("foo"); - - $oldSchema = new Schema(array(), array(), $config); - $oldSchema->createTable('bar'); - - $newSchema= new Schema(array(), array(), $config); - $newSchema->createTable('foo.bar'); - - $c = new Comparator(); - $this->assertEquals(new SchemaDiff(), $c->compare($oldSchema, $newSchema)); - } - - /** - * @group DBAL-204 - */ - public function testFqnSchemaComparisionDifferentSchemaNameButSameTableNoDiff() - { - $config = new SchemaConfig(); - $config->setName("foo"); - - $oldSchema = new Schema(array(), array(), $config); - $oldSchema->createTable('foo.bar'); - - $newSchema = new Schema(); - $newSchema->createTable('bar'); - - $c = new Comparator(); - $diff = $c->compare($oldSchema, $newSchema); - $this->assertEquals(new SchemaDiff(), $c->compare($oldSchema, $newSchema)); - } - - /** - * @group DBAL-204 - */ - public function testFqnSchemaComparisionNoSchemaSame() - { - $config = new SchemaConfig(); - $config->setName("foo"); - $oldSchema = new Schema(array(), array(), $config); - $oldSchema->createTable('bar'); - - $newSchema = new Schema(); - $newSchema->createTable('bar'); - - $c = new Comparator(); - $diff = $c->compare($oldSchema, $newSchema); - - $this->assertEquals(new SchemaDiff(), $c->compare($oldSchema, $newSchema)); - } - - /** - * @param SchemaDiff $diff - * @param int $newTableCount - * @param int $changeTableCount - * @param int $removeTableCount - */ - public function assertSchemaTableChangeCount($diff, $newTableCount=0, $changeTableCount=0, $removeTableCount=0) - { - $this->assertEquals($newTableCount, count($diff->newTables)); - $this->assertEquals($changeTableCount, count($diff->changedTables)); - $this->assertEquals($removeTableCount, count($diff->removedTables)); - } - - /** - * @param SchemaDiff $diff - * @param int $newSequenceCount - * @param int $changeSequenceCount - * @param int $changeSequenceCount - */ - public function assertSchemaSequenceChangeCount($diff, $newSequenceCount=0, $changeSequenceCount=0, $removeSequenceCount=0) - { - $this->assertEquals($newSequenceCount, count($diff->newSequences), "Expected number of new sequences is wrong."); - $this->assertEquals($changeSequenceCount, count($diff->changedSequences), "Expected number of changed sequences is wrong."); - $this->assertEquals($removeSequenceCount, count($diff->removedSequences), "Expected number of removed sequences is wrong."); - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/IndexTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/IndexTest.php deleted file mode 100644 index 6d5f5b8..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/IndexTest.php +++ /dev/null @@ -1,99 +0,0 @@ -createIndex(); - $this->assertEquals("foo", $idx->getName()); - $columns = $idx->getColumns(); - $this->assertEquals(2, count($columns)); - $this->assertEquals(array("bar", "baz"), $columns); - $this->assertFalse($idx->isUnique()); - $this->assertFalse($idx->isPrimary()); - } - - public function testCreatePrimary() - { - $idx = $this->createIndex(false, true); - $this->assertTrue($idx->isUnique()); - $this->assertTrue($idx->isPrimary()); - } - - public function testCreateUnique() - { - $idx = $this->createIndex(true, false); - $this->assertTrue($idx->isUnique()); - $this->assertFalse($idx->isPrimary()); - } - - /** - * @group DBAL-50 - */ - public function testFullfilledByUnique() - { - $idx1 = $this->createIndex(true, false); - $idx2 = $this->createIndex(true, false); - $idx3 = $this->createIndex(); - - $this->assertTrue($idx1->isFullfilledBy($idx2)); - $this->assertFalse($idx1->isFullfilledBy($idx3)); - } - - /** - * @group DBAL-50 - */ - public function testFullfilledByPrimary() - { - $idx1 = $this->createIndex(true, true); - $idx2 = $this->createIndex(true, true); - $idx3 = $this->createIndex(true, false); - - $this->assertTrue($idx1->isFullfilledBy($idx2)); - $this->assertFalse($idx1->isFullfilledBy($idx3)); - } - - /** - * @group DBAL-50 - */ - public function testFullfilledByIndex() - { - $idx1 = $this->createIndex(); - $idx2 = $this->createIndex(); - $pri = $this->createIndex(true, true); - $uniq = $this->createIndex(true); - - $this->assertTrue($idx1->isFullfilledBy($idx2)); - $this->assertTrue($idx1->isFullfilledBy($pri)); - $this->assertTrue($idx1->isFullfilledBy($uniq)); - } - - /** - * @group DBAL-285 - */ - public function testIndexQuotes() - { - $index = new Index("foo", array("`bar`", "`baz`")); - - $this->assertTrue($index->spansColumns(array("bar", "baz"))); - $this->assertTrue($index->hasColumnAtPosition("bar", 0)); - $this->assertTrue($index->hasColumnAtPosition("baz", 1)); - - $this->assertFalse($index->hasColumnAtPosition("bar", 1)); - $this->assertFalse($index->hasColumnAtPosition("baz", 0)); - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/MySqlSchemaManagerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/MySqlSchemaManagerTest.php deleted file mode 100644 index e5033d6..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/MySqlSchemaManagerTest.php +++ /dev/null @@ -1,76 +0,0 @@ -getMock('Doctrine\DBAL\Driver'); - $platform = $this->getMock('Doctrine\DBAL\Platforms\MySqlPlatform'); - $this->conn = $this->getMock( - 'Doctrine\DBAL\Connection', - array('fetchAll'), - array(array('platform' => $platform), $driverMock, new Configuration(), $eventManager) - ); - $this->manager = new MySqlSchemaManager($this->conn); - } - - public function testCompositeForeignKeys() - { - $this->conn->expects($this->once())->method('fetchAll')->will($this->returnValue($this->getFKDefinition())); - $fkeys = $this->manager->listTableForeignKeys('dummy'); - $this->assertEquals(1, count($fkeys), "Table has to have one foreign key."); - - $this->assertInstanceOf('Doctrine\DBAL\Schema\ForeignKeyConstraint', $fkeys[0]); - $this->assertEquals(array('column_1', 'column_2', 'column_3'), array_map('strtolower', $fkeys[0]->getLocalColumns())); - $this->assertEquals(array('column_1', 'column_2', 'column_3'), array_map('strtolower', $fkeys[0]->getForeignColumns())); - } - - public function getFKDefinition() - { - return array( - array( - "CONSTRAINT_NAME" => "FK_C1B1712387FE737264DE5A5511B8B3E", - "COLUMN_NAME" => "column_1", - "REFERENCED_TABLE_NAME" => "dummy", - "REFERENCED_COLUMN_NAME" => "column_1", - "update_rule" => "RESTRICT", - "delete_rule" => "RESTRICT", - ), - array( - "CONSTRAINT_NAME" => "FK_C1B1712387FE737264DE5A5511B8B3E", - "COLUMN_NAME" => "column_2", - "REFERENCED_TABLE_NAME" => "dummy", - "REFERENCED_COLUMN_NAME" => "column_2", - "update_rule" => "RESTRICT", - "delete_rule" => "RESTRICT", - ), - array( - "CONSTRAINT_NAME" => "FK_C1B1712387FE737264DE5A5511B8B3E", - "COLUMN_NAME" => "column_3", - "REFERENCED_TABLE_NAME" => "dummy", - "REFERENCED_COLUMN_NAME" => "column_3", - "update_rule" => "RESTRICT", - "delete_rule" => "RESTRICT", - ) - ); - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/Platforms/MySQLSchemaTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/Platforms/MySQLSchemaTest.php deleted file mode 100644 index 36f362e..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/Platforms/MySQLSchemaTest.php +++ /dev/null @@ -1,67 +0,0 @@ -comparator = new \Doctrine\DBAL\Schema\Comparator; - $this->platform = new \Doctrine\DBAL\Platforms\MySqlPlatform; - } - - public function testSwitchPrimaryKeyOrder() - { - $tableOld = new Table("test"); - $tableOld->addColumn('foo_id', 'integer'); - $tableOld->addColumn('bar_id', 'integer'); - $tableNew = clone $tableOld; - - $tableOld->setPrimaryKey(array('foo_id', 'bar_id')); - $tableNew->setPrimaryKey(array('bar_id', 'foo_id')); - - $diff = $this->comparator->diffTable($tableOld, $tableNew); - $sql = $this->platform->getAlterTableSQL($diff); - - $this->assertEquals( - array( - 'ALTER TABLE test DROP PRIMARY KEY', - 'ALTER TABLE test ADD PRIMARY KEY (bar_id, foo_id)' - ), $sql - ); - } - - /** - * @group DBAL-132 - */ - public function testGenerateForeignKeySQL() - { - $tableOld = new Table("test"); - $tableOld->addColumn('foo_id', 'integer'); - $tableOld->addUnnamedForeignKeyConstraint('test_foreign', array('foo_id'), array('foo_id')); - - $sqls = array(); - foreach ($tableOld->getForeignKeys() AS $fk) { - $sqls[] = $this->platform->getCreateForeignKeySQL($fk, $tableOld); - } - - $this->assertEquals(array("ALTER TABLE test ADD CONSTRAINT FK_D87F7E0C8E48560F FOREIGN KEY (foo_id) REFERENCES test_foreign (foo_id)"), $sqls); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/SchemaDiffTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/SchemaDiffTest.php deleted file mode 100644 index 16bf92a..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/SchemaDiffTest.php +++ /dev/null @@ -1,109 +0,0 @@ -createSchemaDiff(); - $platform = $this->createPlatform(true); - - $sql = $diff->toSql($platform); - - $expected = array('drop_orphan_fk', 'alter_seq', 'drop_seq', 'create_seq', 'create_table', 'create_foreign_key', 'drop_table', 'alter_table'); - - $this->assertEquals($expected, $sql); - } - - public function testSchemaDiffToSaveSql() - { - $diff = $this->createSchemaDiff(); - $platform = $this->createPlatform(false); - - $sql = $diff->toSaveSql($platform); - - $expected = array('alter_seq', 'create_seq', 'create_table', 'create_foreign_key', 'alter_table'); - - $this->assertEquals($expected, $sql); - } - - public function createPlatform($unsafe = false) - { - $platform = $this->getMock('Doctrine\Tests\DBAL\Mocks\MockPlatform'); - if ($unsafe) { - $platform->expects($this->exactly(1)) - ->method('getDropSequenceSql') - ->with($this->isInstanceOf('Doctrine\DBAL\Schema\Sequence')) - ->will($this->returnValue('drop_seq')); - } - $platform->expects($this->exactly(1)) - ->method('getAlterSequenceSql') - ->with($this->isInstanceOf('Doctrine\DBAL\Schema\Sequence')) - ->will($this->returnValue('alter_seq')); - $platform->expects($this->exactly(1)) - ->method('getCreateSequenceSql') - ->with($this->isInstanceOf('Doctrine\DBAL\Schema\Sequence')) - ->will($this->returnValue('create_seq')); - if ($unsafe) { - $platform->expects($this->exactly(1)) - ->method('getDropTableSql') - ->with($this->isInstanceof('Doctrine\DBAL\Schema\Table')) - ->will($this->returnValue('drop_table')); - } - $platform->expects($this->exactly(1)) - ->method('getCreateTableSql') - ->with($this->isInstanceof('Doctrine\DBAL\Schema\Table')) - ->will($this->returnValue(array('create_table'))); - $platform->expects($this->exactly(1)) - ->method('getCreateForeignKeySQL') - ->with($this->isInstanceOf('Doctrine\DBAL\Schema\ForeignKeyConstraint')) - ->will($this->returnValue('create_foreign_key')); - $platform->expects($this->exactly(1)) - ->method('getAlterTableSql') - ->with($this->isInstanceOf('Doctrine\DBAL\Schema\TableDiff')) - ->will($this->returnValue(array('alter_table'))); - if ($unsafe) { - $platform->expects($this->exactly(1)) - ->method('getDropForeignKeySql') - ->with($this->isInstanceof('Doctrine\DBAL\Schema\ForeignKeyConstraint'), $this->equalTo('local_table')) - ->will($this->returnValue('drop_orphan_fk')); - } - $platform->expects($this->exactly(1)) - ->method('supportsSequences') - ->will($this->returnValue(true)); - $platform->expects($this->exactly(2)) - ->method('supportsForeignKeyConstraints') - ->will($this->returnValue(true)); - return $platform; - } - - public function createSchemaDiff() - { - $diff = new SchemaDiff(); - $diff->changedSequences['foo_seq'] = new Sequence('foo_seq'); - $diff->newSequences['bar_seq'] = new Sequence('bar_seq'); - $diff->removedSequences['baz_seq'] = new Sequence('baz_seq'); - $diff->newTables['foo_table'] = new Table('foo_table'); - $diff->removedTables['bar_table'] = new Table('bar_table'); - $diff->changedTables['baz_table'] = new TableDiff('baz_table'); - $diff->newTables['foo_table']->addColumn('foreign_id', 'integer'); - $diff->newTables['foo_table']->addForeignKeyConstraint('foreign_table', array('foreign_id'), array('id')); - $fk = new \Doctrine\DBAL\Schema\ForeignKeyConstraint(array('id'), 'foreign_table', array('id')); - $fk->setLocalTable(new Table('local_table')); - $diff->orphanedForeignKeys[] = $fk; - return $diff; - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/SchemaTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/SchemaTest.php deleted file mode 100644 index 096ede7..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/SchemaTest.php +++ /dev/null @@ -1,224 +0,0 @@ -assertTrue($schema->hasTable($tableName)); - - $tables = $schema->getTables(); - $this->assertTrue( isset($tables[$tableName]) ); - $this->assertSame($table, $tables[$tableName]); - $this->assertSame($table, $schema->getTable($tableName)); - $this->assertTrue($schema->hasTable($tableName)); - } - - public function testTableMatchingCaseInsenstive() - { - $table = new Table("Foo"); - - $schema = new Schema(array($table)); - $this->assertTrue($schema->hasTable("foo")); - $this->assertTrue($schema->hasTable("FOO")); - - $this->assertSame($table, $schema->getTable('FOO')); - $this->assertSame($table, $schema->getTable('foo')); - $this->assertSame($table, $schema->getTable('Foo')); - } - - public function testGetUnknownTableThrowsException() - { - $this->setExpectedException("Doctrine\DBAL\Schema\SchemaException"); - - $schema = new Schema(); - $schema->getTable("unknown"); - } - - public function testCreateTableTwiceThrowsException() - { - $this->setExpectedException("Doctrine\DBAL\Schema\SchemaException"); - - $tableName = "foo"; - $table = new Table($tableName); - $tables = array($table, $table); - - $schema = new Schema($tables); - } - - public function testRenameTable() - { - $tableName = "foo"; - $table = new Table($tableName); - $schema = new Schema(array($table)); - - $this->assertTrue($schema->hasTable("foo")); - $schema->renameTable("foo", "bar"); - $this->assertFalse($schema->hasTable("foo")); - $this->assertTrue($schema->hasTable("bar")); - $this->assertSame($table, $schema->getTable("bar")); - } - - public function testDropTable() - { - $tableName = "foo"; - $table = new Table($tableName); - $schema = new Schema(array($table)); - - $this->assertTrue($schema->hasTable("foo")); - - $schema->dropTable("foo"); - - $this->assertFalse($schema->hasTable("foo")); - } - - public function testCreateTable() - { - $schema = new Schema(); - - $this->assertFalse($schema->hasTable("foo")); - - $table = $schema->createTable("foo"); - - $this->assertInstanceOf('Doctrine\DBAL\Schema\Table', $table); - $this->assertEquals("foo", $table->getName()); - $this->assertTrue($schema->hasTable("foo")); - } - - public function testAddSequences() - { - $sequence = new Sequence("a_seq", 1, 1); - - $schema = new Schema(array(), array($sequence)); - - $this->assertTrue($schema->hasSequence("a_seq")); - $this->assertInstanceOf('Doctrine\DBAL\Schema\Sequence', $schema->getSequence("a_seq")); - - $sequences = $schema->getSequences(); - $this->assertArrayHasKey('public.a_seq', $sequences); - } - - public function testSequenceAccessCaseInsensitive() - { - $sequence = new Sequence("a_Seq"); - - $schema = new Schema(array(), array($sequence)); - $this->assertTrue($schema->hasSequence('a_seq')); - $this->assertTrue($schema->hasSequence('a_Seq')); - $this->assertTrue($schema->hasSequence('A_SEQ')); - - $this->assertEquals($sequence, $schema->getSequence('a_seq')); - $this->assertEquals($sequence, $schema->getSequence('a_Seq')); - $this->assertEquals($sequence, $schema->getSequence('A_SEQ')); - } - - public function testGetUnknownSequenceThrowsException() - { - $this->setExpectedException("Doctrine\DBAL\Schema\SchemaException"); - - $schema = new Schema(); - $schema->getSequence("unknown"); - } - - public function testCreateSequence() - { - $schema = new Schema(); - $sequence = $schema->createSequence('a_seq', 10, 20); - - $this->assertEquals('a_seq', $sequence->getName()); - $this->assertEquals(10, $sequence->getAllocationSize()); - $this->assertEquals(20, $sequence->getInitialValue()); - - $this->assertTrue($schema->hasSequence("a_seq")); - $this->assertInstanceOf('Doctrine\DBAL\Schema\Sequence', $schema->getSequence("a_seq")); - - $sequences = $schema->getSequences(); - $this->assertArrayHasKey('public.a_seq', $sequences); - } - - public function testDropSequence() - { - $sequence = new Sequence("a_seq", 1, 1); - - $schema = new Schema(array(), array($sequence)); - - $schema->dropSequence("a_seq"); - $this->assertFalse($schema->hasSequence("a_seq")); - } - - public function testAddSequenceTwiceThrowsException() - { - $this->setExpectedException("Doctrine\DBAL\Schema\SchemaException"); - - $sequence = new Sequence("a_seq", 1, 1); - - $schema = new Schema(array(), array($sequence, $sequence)); - } - - public function testConfigMaxIdentifierLength() - { - $schemaConfig = new \Doctrine\DBAL\Schema\SchemaConfig(); - $schemaConfig->setMaxIdentifierLength(5); - - $schema = new Schema(array(), array(), $schemaConfig); - $table = $schema->createTable("smalltable"); - $table->addColumn('long_id', 'integer'); - $table->addIndex(array('long_id')); - - $index = current($table->getIndexes()); - $this->assertEquals(5, strlen($index->getName())); - } - - public function testDeepClone() - { - $schema = new Schema(); - $sequence = $schema->createSequence('baz'); - - $tableA = $schema->createTable('foo'); - $tableA->addColumn('id', 'integer'); - - $tableB = $schema->createTable('bar'); - $tableB->addColumn('id', 'integer'); - $tableB->addColumn('foo_id', 'integer'); - $tableB->addForeignKeyConstraint($tableA, array('foo_id'), array('id')); - - $schemaNew = clone $schema; - - $this->assertNotSame($sequence, $schemaNew->getSequence('baz')); - - $this->assertNotSame($tableA, $schemaNew->getTable('foo')); - $this->assertNotSame($tableA->getColumn('id'), $schemaNew->getTable('foo')->getColumn('id')); - - $this->assertNotSame($tableB, $schemaNew->getTable('bar')); - $this->assertNotSame($tableB->getColumn('id'), $schemaNew->getTable('bar')->getColumn('id')); - - $fk = $schemaNew->getTable('bar')->getForeignKeys(); - $fk = current($fk); - $this->assertSame($schemaNew->getTable('bar'), $this->readAttribute($fk, '_localTable')); - } - - /** - * @group DBAL-219 - */ - public function testHasTableForQuotedAsset() - { - $schema = new Schema(); - - $tableA = $schema->createTable('foo'); - $tableA->addColumn('id', 'integer'); - - $this->assertTrue($schema->hasTable('`foo`')); - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/TableTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/TableTest.php deleted file mode 100644 index 778ad56..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/TableTest.php +++ /dev/null @@ -1,500 +0,0 @@ -setExpectedException('Doctrine\DBAL\DBALException'); - $table = new \Doctrine\DBAL\Schema\Table(''); - } - - public function testGetName() - { - $table = new Table("foo", array(), array(), array()); - $this->assertEquals("foo", $table->getName()); - } - - public function testColumns() - { - $type = Type::getType('integer'); - $columns = array(); - $columns[] = new Column("foo", $type); - $columns[] = new Column("bar", $type); - $table = new Table("foo", $columns, array(), array()); - - $this->assertTrue($table->hasColumn("foo")); - $this->assertTrue($table->hasColumn("bar")); - $this->assertFalse($table->hasColumn("baz")); - - $this->assertInstanceOf('Doctrine\DBAL\Schema\Column', $table->getColumn("foo")); - $this->assertInstanceOf('Doctrine\DBAL\Schema\Column', $table->getColumn("bar")); - - $this->assertEquals(2, count($table->getColumns())); - } - - public function testColumnsCaseInsensitive() - { - $table = new Table("foo"); - $column = $table->addColumn('Foo', 'integer'); - - $this->assertTrue($table->hasColumn('Foo')); - $this->assertTrue($table->hasColumn('foo')); - $this->assertTrue($table->hasColumn('FOO')); - - $this->assertSame($column, $table->getColumn('Foo')); - $this->assertSame($column, $table->getColumn('foo')); - $this->assertSame($column, $table->getColumn('FOO')); - } - - public function testCreateColumn() - { - $type = Type::getType('integer'); - - $table = new Table("foo"); - - $this->assertFalse($table->hasColumn("bar")); - $table->addColumn("bar", 'integer'); - $this->assertTrue($table->hasColumn("bar")); - $this->assertSame($type, $table->getColumn("bar")->getType()); - } - - public function testDropColumn() - { - $type = Type::getType('integer'); - $columns = array(); - $columns[] = new Column("foo", $type); - $columns[] = new Column("bar", $type); - $table = new Table("foo", $columns, array(), array()); - - $this->assertTrue($table->hasColumn("foo")); - $this->assertTrue($table->hasColumn("bar")); - - $table->dropColumn("foo")->dropColumn("bar"); - - $this->assertFalse($table->hasColumn("foo")); - $this->assertFalse($table->hasColumn("bar")); - } - - public function testGetUnknownColumnThrowsException() - { - $this->setExpectedException("Doctrine\DBAL\Schema\SchemaException"); - - $table = new Table("foo", array(), array(), array()); - $table->getColumn('unknown'); - } - - public function testAddColumnTwiceThrowsException() - { - $this->setExpectedException("Doctrine\DBAL\Schema\SchemaException"); - - $type = \Doctrine\DBAL\Types\Type::getType('integer'); - $columns = array(); - $columns[] = new Column("foo", $type); - $columns[] = new Column("foo", $type); - $table = new Table("foo", $columns, array(), array()); - } - - public function testCreateIndex() - { - $type = \Doctrine\DBAL\Types\Type::getType('integer'); - $columns = array(new Column("foo", $type), new Column("bar", $type), new Column("baz", $type)); - $table = new Table("foo", $columns); - - $table->addIndex(array("foo", "bar"), "foo_foo_bar_idx"); - $table->addUniqueIndex(array("bar", "baz"), "foo_bar_baz_uniq"); - - $this->assertTrue($table->hasIndex("foo_foo_bar_idx")); - $this->assertTrue($table->hasIndex("foo_bar_baz_uniq")); - } - - public function testIndexCaseInsensitive() - { - $type = \Doctrine\DBAL\Types\Type::getType('integer'); - $columns = array( - new Column("foo", $type), - new Column("bar", $type), - new Column("baz", $type) - ); - $table = new Table("foo", $columns); - - $table->addIndex(array("foo", "bar", "baz"), "Foo_Idx"); - - $this->assertTrue($table->hasIndex('foo_idx')); - $this->assertTrue($table->hasIndex('Foo_Idx')); - $this->assertTrue($table->hasIndex('FOO_IDX')); - } - - public function testAddIndexes() - { - $type = \Doctrine\DBAL\Types\Type::getType('integer'); - $columns = array( - new Column("foo", $type), - new Column("bar", $type), - ); - $indexes = array( - new Index("the_primary", array("foo"), true, true), - new Index("bar_idx", array("bar"), false, false), - ); - $table = new Table("foo", $columns, $indexes, array()); - - $this->assertTrue($table->hasIndex("the_primary")); - $this->assertTrue($table->hasIndex("bar_idx")); - $this->assertFalse($table->hasIndex("some_idx")); - - $this->assertInstanceOf('Doctrine\DBAL\Schema\Index', $table->getPrimaryKey()); - $this->assertInstanceOf('Doctrine\DBAL\Schema\Index', $table->getIndex('the_primary')); - $this->assertInstanceOf('Doctrine\DBAL\Schema\Index', $table->getIndex('bar_idx')); - } - - public function testGetUnknownIndexThrowsException() - { - $this->setExpectedException("Doctrine\DBAL\Schema\SchemaException"); - - $table = new Table("foo", array(), array(), array()); - $table->getIndex("unknownIndex"); - } - - public function testAddTwoPrimaryThrowsException() - { - $this->setExpectedException("Doctrine\DBAL\Schema\SchemaException"); - - $type = \Doctrine\DBAL\Types\Type::getType('integer'); - $columns = array(new Column("foo", $type), new Column("bar", $type)); - $indexes = array( - new Index("the_primary", array("foo"), true, true), - new Index("other_primary", array("bar"), true, true), - ); - $table = new Table("foo", $columns, $indexes, array()); - } - - public function testAddTwoIndexesWithSameNameThrowsException() - { - $this->setExpectedException("Doctrine\DBAL\Schema\SchemaException"); - - $type = \Doctrine\DBAL\Types\Type::getType('integer'); - $columns = array(new Column("foo", $type), new Column("bar", $type)); - $indexes = array( - new Index("an_idx", array("foo"), false, false), - new Index("an_idx", array("bar"), false, false), - ); - $table = new Table("foo", $columns, $indexes, array()); - } - - public function testConstraints() - { - $constraint = new ForeignKeyConstraint(array(), "foo", array()); - - $tableA = new Table("foo", array(), array(), array($constraint)); - $constraints = $tableA->getForeignKeys(); - - $this->assertEquals(1, count($constraints)); - $this->assertSame($constraint, array_shift($constraints)); - } - - public function testOptions() - { - $table = new Table("foo", array(), array(), array(), false, array("foo" => "bar")); - - $this->assertTrue($table->hasOption("foo")); - $this->assertEquals("bar", $table->getOption("foo")); - } - - public function testBuilderSetPrimaryKey() - { - $table = new Table("foo"); - - $table->addColumn("bar", 'integer'); - $table->setPrimaryKey(array("bar")); - - $this->assertTrue($table->hasIndex("primary")); - $this->assertInstanceOf('Doctrine\DBAL\Schema\Index', $table->getPrimaryKey()); - $this->assertTrue($table->getIndex("primary")->isUnique()); - $this->assertTrue($table->getIndex("primary")->isPrimary()); - } - - public function testBuilderAddUniqueIndex() - { - $table = new Table("foo"); - - $table->addColumn("bar", 'integer'); - $table->addUniqueIndex(array("bar"), "my_idx"); - - $this->assertTrue($table->hasIndex("my_idx")); - $this->assertTrue($table->getIndex("my_idx")->isUnique()); - $this->assertFalse($table->getIndex("my_idx")->isPrimary()); - } - - public function testBuilderAddIndex() - { - $table = new Table("foo"); - - $table->addColumn("bar", 'integer'); - $table->addIndex(array("bar"), "my_idx"); - - $this->assertTrue($table->hasIndex("my_idx")); - $this->assertFalse($table->getIndex("my_idx")->isUnique()); - $this->assertFalse($table->getIndex("my_idx")->isPrimary()); - } - - public function testBuilderAddIndexWithInvalidNameThrowsException() - { - $this->setExpectedException("Doctrine\DBAL\Schema\SchemaException"); - - $table = new Table("foo"); - $table->addColumn("bar",'integer'); - $table->addIndex(array("bar"), "invalid name %&/"); - } - - public function testBuilderAddIndexWithUnknownColumnThrowsException() - { - $this->setExpectedException("Doctrine\DBAL\Schema\SchemaException"); - - $table = new Table("foo"); - $table->addIndex(array("bar"), "invalidName"); - } - - public function testBuilderOptions() - { - $table = new Table("foo"); - $table->addOption("foo", "bar"); - $this->assertTrue($table->hasOption("foo")); - $this->assertEquals("bar", $table->getOption("foo")); - } - - public function testAddForeignKeyConstraint_UnknownLocalColumn_ThrowsException() - { - $this->setExpectedException("Doctrine\DBAL\Schema\SchemaException"); - - $table = new Table("foo"); - $table->addColumn("id", 'integer'); - - $foreignTable = new Table("bar"); - $foreignTable->addColumn("id", 'integer'); - - $table->addForeignKeyConstraint($foreignTable, array("foo"), array("id")); - } - - public function testAddForeignKeyConstraint_UnknownForeignColumn_ThrowsException() - { - $this->setExpectedException("Doctrine\DBAL\Schema\SchemaException"); - - $table = new Table("foo"); - $table->addColumn("id", 'integer'); - - $foreignTable = new Table("bar"); - $foreignTable->addColumn("id", 'integer'); - - $table->addForeignKeyConstraint($foreignTable, array("id"), array("foo")); - } - - public function testAddForeignKeyConstraint() - { - $table = new Table("foo"); - $table->addColumn("id", 'integer'); - - $foreignTable = new Table("bar"); - $foreignTable->addColumn("id", 'integer'); - - $table->addForeignKeyConstraint($foreignTable, array("id"), array("id"), array("foo" => "bar")); - - $constraints = $table->getForeignKeys(); - $this->assertEquals(1, count($constraints)); - $constraint = current($constraints); - - $this->assertInstanceOf('Doctrine\DBAL\Schema\ForeignKeyConstraint', $constraint); - - $this->assertTrue($constraint->hasOption("foo")); - $this->assertEquals("bar", $constraint->getOption("foo")); - } - - public function testAddIndexWithCaseSensitiveColumnProblem() - { - $table = new Table("foo"); - $table->addColumn("id", 'integer'); - - $table->addIndex(array("ID"), "my_idx"); - - $this->assertTrue($table->hasIndex('my_idx')); - $this->assertEquals(array("ID"), $table->getIndex("my_idx")->getColumns()); - $this->assertTrue($table->getIndex('my_idx')->spansColumns(array('id'))); - } - - public function testAddPrimaryKey_ColumnsAreExplicitlySetToNotNull() - { - $table = new Table("foo"); - $column = $table->addColumn("id", 'integer', array('notnull' => false)); - - $this->assertFalse($column->getNotnull()); - - $table->setPrimaryKey(array('id')); - - $this->assertTrue($column->getNotnull()); - } - - /** - * @group DDC-133 - */ - public function testAllowImplicitSchemaTableInAutogeneratedIndexNames() - { - $table = new Table("foo.bar"); - $table->addColumn('baz', 'integer', array()); - $table->addIndex(array('baz')); - - $this->assertEquals(1, count($table->getIndexes())); - } - - /** - * @group DBAL-50 - */ - public function testAddIndexTwice_IgnoreSecond() - { - $table = new Table("foo.bar"); - $table->addColumn('baz', 'integer', array()); - $table->addIndex(array('baz')); - $table->addIndex(array('baz')); - - $this->assertEquals(1, count($table->getIndexes())); - } - - /** - * @group DBAL-50 - */ - public function testAddForeignKeyIndexImplicitly() - { - $table = new Table("foo"); - $table->addColumn("id", 'integer'); - - $foreignTable = new Table("bar"); - $foreignTable->addColumn("id", 'integer'); - - $table->addForeignKeyConstraint($foreignTable, array("id"), array("id"), array("foo" => "bar")); - - $indexes = $table->getIndexes(); - $this->assertEquals(1, count($indexes)); - $index = current($indexes); - - $this->assertTrue($table->hasIndex($index->getName())); - $this->assertEquals(array('id'), $index->getColumns()); - } - - /** - * @group DBAL-50 - */ - public function testOverruleIndex() - { - $table = new Table("bar"); - $table->addColumn('baz', 'integer', array()); - $table->addIndex(array('baz')); - - $indexes = $table->getIndexes(); - $this->assertEquals(1, count($indexes)); - $index = current($indexes); - - $table->addUniqueIndex(array('baz')); - $this->assertEquals(1, count($table->getIndexes())); - $this->assertFalse($table->hasIndex($index->getName())); - } - - public function testPrimaryKeyOverrulesUniqueIndex() - { - $table = new Table("bar"); - $table->addColumn('baz', 'integer', array()); - $table->addUniqueIndex(array('baz')); - - $table->setPrimaryKey(array('baz')); - - $indexes = $table->getIndexes(); - $this->assertEquals(1, count($indexes), "Table should only contain the primary key table index, not the unique one anymore, because it was overruled."); - - $index = current($indexes); - $this->assertTrue($index->isPrimary()); - } - - /** - * @group DBAL-64 - */ - public function testQuotedTableName() - { - $table = new Table("`bar`"); - - $mysqlPlatform = new \Doctrine\DBAL\Platforms\MySqlPlatform(); - $sqlitePlatform = new \Doctrine\DBAL\Platforms\SqlitePlatform(); - - $this->assertEquals('bar', $table->getName()); - $this->assertEquals('`bar`', $table->getQuotedName($mysqlPlatform)); - $this->assertEquals('"bar"', $table->getQuotedName($sqlitePlatform)); - } - - /** - * @group DBAL-79 - */ - public function testTableHasPrimaryKey() - { - $table = new Table("test"); - - $this->assertFalse($table->hasPrimaryKey()); - - $table->addColumn("foo", "integer"); - $table->setPrimaryKey(array("foo")); - - $this->assertTrue($table->hasPrimaryKey()); - } - - /** - * @group DBAL-91 - */ - public function testAddIndexWithQuotedColumns() - { - $table = new Table("test"); - $table->addColumn('"foo"', 'integer'); - $table->addColumn('bar', 'integer'); - $table->addIndex(array('"foo"', '"bar"')); - } - - /** - * @group DBAL-91 - */ - public function testAddForeignKeyWithQuotedColumnsAndTable() - { - $table = new Table("test"); - $table->addColumn('"foo"', 'integer'); - $table->addColumn('bar', 'integer'); - $table->addForeignKeyConstraint('"boing"', array('"foo"', '"bar"'), array("id")); - } - - /** - * @group DBAL-177 - */ - public function testQuoteSchemaPrefixed() - { - $table = new Table("`test`.`test`"); - $this->assertEquals("test.test", $table->getName()); - $this->assertEquals("`test`.`test`", $table->getQuotedName(new \Doctrine\DBAL\Platforms\MySqlPlatform)); - } - - /** - * @group DBAL-204 - */ - public function testFullQualifiedTableName() - { - $table = new Table("`test`.`test`"); - $this->assertEquals('test.test', $table->getFullQualifiedName("test")); - $this->assertEquals('test.test', $table->getFullQualifiedName("other")); - - $table = new Table("test"); - $this->assertEquals('test.test', $table->getFullQualifiedName("test")); - $this->assertEquals('other.test', $table->getFullQualifiedName("other")); - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/Visitor/RemoveNamespacedAssetsTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/Visitor/RemoveNamespacedAssetsTest.php deleted file mode 100644 index e5b660f..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/Visitor/RemoveNamespacedAssetsTest.php +++ /dev/null @@ -1,77 +0,0 @@ -setName("test"); - $schema = new Schema(array(), array(), $config); - - $schema->createTable("test.test"); - $schema->createTable("foo.bar"); - $schema->createTable("baz"); - - $schema->visit(new RemoveNamespacedAssets()); - - $tables = $schema->getTables(); - $this->assertEquals(array("test.test", "test.baz"), array_keys($tables), "Only 2 tables should be present, both in 'test' namespace."); - } - - /** - * @group DBAL-204 - */ - public function testCleanupForeignKeys() - { - $config = new SchemaConfig; - $config->setName("test"); - $schema = new Schema(array(), array(), $config); - - $fooTable = $schema->createTable("foo.bar"); - $fooTable->addColumn('id', 'integer'); - - $testTable = $schema->createTable("test.test"); - $testTable->addColumn('id', 'integer'); - - $testTable->addForeignKeyConstraint("foo.bar", array("id"), array("id")); - - $schema->visit(new RemoveNamespacedAssets()); - - $sql = $schema->toSql(new MySqlPlatform()); - $this->assertEquals(1, count($sql), "Just one CREATE TABLE statement, no foreign key and table to foo.bar"); - } - - /** - * @group DBAL-204 - */ - public function testCleanupForeignKeysDifferentOrder() - { - $config = new SchemaConfig; - $config->setName("test"); - $schema = new Schema(array(), array(), $config); - - $testTable = $schema->createTable("test.test"); - $testTable->addColumn('id', 'integer'); - - $fooTable = $schema->createTable("foo.bar"); - $fooTable->addColumn('id', 'integer'); - - $testTable->addForeignKeyConstraint("foo.bar", array("id"), array("id")); - - $schema->visit(new RemoveNamespacedAssets()); - - $sql = $schema->toSql(new MySqlPlatform()); - $this->assertEquals(1, count($sql), "Just one CREATE TABLE statement, no foreign key and table to foo.bar"); - } -} - diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/Visitor/SchemaSqlCollectorTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/Visitor/SchemaSqlCollectorTest.php deleted file mode 100644 index 8dfd2b2..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/Visitor/SchemaSqlCollectorTest.php +++ /dev/null @@ -1,80 +0,0 @@ -getMock( - 'Doctrine\DBAL\Platforms\MySqlPlatform', - array('getCreateTableSql', 'getCreateSequenceSql', 'getCreateForeignKeySql') - ); - $platformMock->expects($this->exactly(2)) - ->method('getCreateTableSql') - ->will($this->returnValue(array("foo"))); - $platformMock->expects($this->exactly(1)) - ->method('getCreateSequenceSql') - ->will($this->returnValue(array("bar"))); - $platformMock->expects($this->exactly(1)) - ->method('getCreateForeignKeySql') - ->will($this->returnValue(array("baz"))); - - $schema = $this->createFixtureSchema(); - - $sql = $schema->toSql($platformMock); - - $this->assertEquals(array("foo", "foo", "bar", "baz"), $sql); - } - - public function testDropSchema() - { - $platformMock = $this->getMock( - 'Doctrine\DBAL\Platforms\MySqlPlatform', - array('getDropTableSql', 'getDropSequenceSql', 'getDropForeignKeySql') - ); - $platformMock->expects($this->exactly(2)) - ->method('getDropTableSql') - ->will($this->returnValue("tbl")); - $platformMock->expects($this->exactly(1)) - ->method('getDropSequenceSql') - ->will($this->returnValue("seq")); - $platformMock->expects($this->exactly(1)) - ->method('getDropForeignKeySql') - ->will($this->returnValue("fk")); - - $schema = $this->createFixtureSchema(); - - $sql = $schema->toDropSql($platformMock); - - $this->assertEquals(array("fk", "seq", "tbl", "tbl"), $sql); - } - - /** - * @return Schema - */ - public function createFixtureSchema() - { - $schema = new Schema(); - $tableA = $schema->createTable("foo"); - $tableA->addColumn("id", 'integer'); - $tableA->addColumn("bar", 'string', array('length' => 255)); - $tableA->setPrimaryKey(array("id")); - - $schema->createSequence("foo_seq"); - - $tableB = $schema->createTable("bar"); - $tableB->addColumn("id", 'integer'); - $tableB->setPrimaryKey(array("id")); - - $tableA->addForeignKeyConstraint($tableB, array("bar"), array("id")); - - return $schema; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/ArrayTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/ArrayTest.php deleted file mode 100644 index ac4244d..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/ArrayTest.php +++ /dev/null @@ -1,61 +0,0 @@ -_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform(); - $this->_type = Type::getType('array'); - } - - public function tearDown() - { - error_reporting(-1); // reactive all error levels - } - - - public function testArrayConvertsToDatabaseValue() - { - $this->assertTrue( - is_string($this->_type->convertToDatabaseValue(array(), $this->_platform)) - ); - } - - public function testArrayConvertsToPHPValue() - { - $this->assertTrue( - is_array($this->_type->convertToPHPValue(serialize(array()), $this->_platform)) - ); - } - - public function testConversionFailure() - { - error_reporting( (E_ALL | E_STRICT) - \E_NOTICE ); - $this->setExpectedException('Doctrine\DBAL\Types\ConversionException'); - $this->_type->convertToPHPValue('abcdefg', $this->_platform); - } - - public function testNullConversion() - { - $this->assertNull($this->_type->convertToPHPValue(null, $this->_platform)); - } - - /** - * @group DBAL-73 - */ - public function testFalseConversion() - { - $this->assertFalse($this->_type->convertToPHPValue(serialize(false), $this->_platform)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/BlobTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/BlobTest.php deleted file mode 100644 index 756487d..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/BlobTest.php +++ /dev/null @@ -1,26 +0,0 @@ -_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform(); - $this->_type = Type::getType('blob'); - } - - public function testBlobNullConvertsToPHPValue() - { - $this->assertNull($this->_type->convertToPHPValue(null, $this->_platform)); - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/BooleanTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/BooleanTest.php deleted file mode 100644 index 753cfb4..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/BooleanTest.php +++ /dev/null @@ -1,36 +0,0 @@ -_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform(); - $this->_type = Type::getType('boolean'); - } - - public function testBooleanConvertsToDatabaseValue() - { - $this->assertInternalType('integer', $this->_type->convertToDatabaseValue(1, $this->_platform)); - } - - public function testBooleanConvertsToPHPValue() - { - $this->assertInternalType('bool', $this->_type->convertToPHPValue(0, $this->_platform)); - } - - public function testBooleanNullConvertsToPHPValue() - { - $this->assertNull($this->_type->convertToPHPValue(null, $this->_platform)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DateTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DateTest.php deleted file mode 100644 index 8d97640..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DateTest.php +++ /dev/null @@ -1,75 +0,0 @@ -_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform(); - $this->_type = Type::getType('date'); - $this->_tz = date_default_timezone_get(); - } - - public function tearDown() - { - date_default_timezone_set($this->_tz); - } - - public function testDateConvertsToDatabaseValue() - { - $this->assertTrue( - is_string($this->_type->convertToDatabaseValue(new \DateTime(), $this->_platform)) - ); - } - - public function testDateConvertsToPHPValue() - { - // Birthday of jwage and also birthday of Doctrine. Send him a present ;) - $this->assertTrue( - $this->_type->convertToPHPValue('1985-09-01', $this->_platform) - instanceof \DateTime - ); - } - - public function testDateResetsNonDatePartsToZeroUnixTimeValues() - { - $date = $this->_type->convertToPHPValue('1985-09-01', $this->_platform); - - $this->assertEquals('00:00:00', $date->format('H:i:s')); - } - - public function testDateRests_SummerTimeAffection() - { - date_default_timezone_set('Europe/Berlin'); - - $date = $this->_type->convertToPHPValue('2009-08-01', $this->_platform); - $this->assertEquals('00:00:00', $date->format('H:i:s')); - $this->assertEquals('2009-08-01', $date->format('Y-m-d')); - - $date = $this->_type->convertToPHPValue('2009-11-01', $this->_platform); - $this->assertEquals('00:00:00', $date->format('H:i:s')); - $this->assertEquals('2009-11-01', $date->format('Y-m-d')); - } - - public function testInvalidDateFormatConversion() - { - $this->setExpectedException('Doctrine\DBAL\Types\ConversionException'); - $this->_type->convertToPHPValue('abcdefg', $this->_platform); - } - - public function testNullConversion() - { - $this->assertNull($this->_type->convertToPHPValue(null, $this->_platform)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DateTimeTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DateTimeTest.php deleted file mode 100644 index f9674e7..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DateTimeTest.php +++ /dev/null @@ -1,50 +0,0 @@ -_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform(); - $this->_type = Type::getType('datetime'); - } - - public function testDateTimeConvertsToDatabaseValue() - { - $date = new \DateTime('1985-09-01 10:10:10'); - - $expected = $date->format($this->_platform->getDateTimeTzFormatString()); - $actual = $this->_type->convertToDatabaseValue($date, $this->_platform); - - $this->assertEquals($expected, $actual); - } - - public function testDateTimeConvertsToPHPValue() - { - // Birthday of jwage and also birthday of Doctrine. Send him a present ;) - $date = $this->_type->convertToPHPValue('1985-09-01 00:00:00', $this->_platform); - $this->assertInstanceOf('DateTime', $date); - $this->assertEquals('1985-09-01 00:00:00', $date->format('Y-m-d H:i:s')); - } - - public function testInvalidDateTimeFormatConversion() - { - $this->setExpectedException('Doctrine\DBAL\Types\ConversionException'); - $this->_type->convertToPHPValue('abcdefg', $this->_platform); - } - - public function testNullConversion() - { - $this->assertNull($this->_type->convertToPHPValue(null, $this->_platform)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DateTimeTzTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DateTimeTzTest.php deleted file mode 100644 index 3e2ae17..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DateTimeTzTest.php +++ /dev/null @@ -1,50 +0,0 @@ -_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform(); - $this->_type = Type::getType('datetimetz'); - } - - public function testDateTimeConvertsToDatabaseValue() - { - $date = new \DateTime('1985-09-01 10:10:10'); - - $expected = $date->format($this->_platform->getDateTimeTzFormatString()); - $actual = $this->_type->convertToDatabaseValue($date, $this->_platform); - - $this->assertEquals($expected, $actual); - } - - public function testDateTimeConvertsToPHPValue() - { - // Birthday of jwage and also birthday of Doctrine. Send him a present ;) - $date = $this->_type->convertToPHPValue('1985-09-01 00:00:00', $this->_platform); - $this->assertInstanceOf('DateTime', $date); - $this->assertEquals('1985-09-01 00:00:00', $date->format('Y-m-d H:i:s')); - } - - public function testInvalidDateFormatConversion() - { - $this->setExpectedException('Doctrine\DBAL\Types\ConversionException'); - $this->_type->convertToPHPValue('abcdefg', $this->_platform); - } - - public function testNullConversion() - { - $this->assertNull($this->_type->convertToPHPValue(null, $this->_platform)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DecimalTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DecimalTest.php deleted file mode 100644 index 983029c..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DecimalTest.php +++ /dev/null @@ -1,31 +0,0 @@ -_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform(); - $this->_type = Type::getType('decimal'); - } - - public function testDecimalConvertsToPHPValue() - { - $this->assertInternalType('string', $this->_type->convertToPHPValue('5.5', $this->_platform)); - } - - public function testDecimalNullConvertsToPHPValue() - { - $this->assertNull($this->_type->convertToPHPValue(null, $this->_platform)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/FloatTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/FloatTest.php deleted file mode 100644 index 38d9237..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/FloatTest.php +++ /dev/null @@ -1,39 +0,0 @@ -_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform(); - $this->_type = Type::getType('float'); - } - - public function testFloatConvertsToPHPValue() - { - $this->assertInternalType('float', $this->_type->convertToPHPValue('5.5', $this->_platform)); - } - - public function testFloatNullConvertsToPHPValue() - { - $this->assertNull($this->_type->convertToPHPValue(null, $this->_platform)); - } - - public function testFloatConvertToDatabaseValue() - { - $this->assertInternalType('float', $this->_type->convertToDatabaseValue(5.5, $this->_platform)); - } - - public function testFloatNullConvertToDatabaseValue() - { - $this->assertNull($this->_type->convertToDatabaseValue(null, $this->_platform)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/IntegerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/IntegerTest.php deleted file mode 100644 index adcde53..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/IntegerTest.php +++ /dev/null @@ -1,32 +0,0 @@ -_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform(); - $this->_type = Type::getType('integer'); - } - - public function testIntegerConvertsToPHPValue() - { - $this->assertInternalType('integer', $this->_type->convertToPHPValue('1', $this->_platform)); - $this->assertInternalType('integer', $this->_type->convertToPHPValue('0', $this->_platform)); - } - - public function testIntegerNullConvertsToPHPValue() - { - $this->assertNull($this->_type->convertToPHPValue(null, $this->_platform)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/ObjectTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/ObjectTest.php deleted file mode 100644 index d25c49a..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/ObjectTest.php +++ /dev/null @@ -1,56 +0,0 @@ -_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform(); - $this->_type = Type::getType('object'); - } - - public function tearDown() - { - error_reporting(-1); // reactive all error levels - } - - public function testObjectConvertsToDatabaseValue() - { - $this->assertInternalType('string', $this->_type->convertToDatabaseValue(new \stdClass(), $this->_platform)); - } - - public function testObjectConvertsToPHPValue() - { - $this->assertInternalType('object', $this->_type->convertToPHPValue(serialize(new \stdClass), $this->_platform)); - } - - public function testConversionFailure() - { - error_reporting( (E_ALL | E_STRICT) - \E_NOTICE ); - $this->setExpectedException('Doctrine\DBAL\Types\ConversionException'); - $this->_type->convertToPHPValue('abcdefg', $this->_platform); - } - - public function testNullConversion() - { - $this->assertNull($this->_type->convertToPHPValue(null, $this->_platform)); - } - - /** - * @group DBAL-73 - */ - public function testFalseConversion() - { - $this->assertFalse($this->_type->convertToPHPValue(serialize(false), $this->_platform)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/SmallIntTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/SmallIntTest.php deleted file mode 100644 index 399095c..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/SmallIntTest.php +++ /dev/null @@ -1,32 +0,0 @@ -_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform(); - $this->_type = Type::getType('smallint'); - } - - public function testSmallIntConvertsToPHPValue() - { - $this->assertInternalType('integer', $this->_type->convertToPHPValue('1', $this->_platform)); - $this->assertInternalType('integer', $this->_type->convertToPHPValue('0', $this->_platform)); - } - - public function testSmallIntNullConvertsToPHPValue() - { - $this->assertNull($this->_type->convertToPHPValue(null, $this->_platform)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/StringTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/StringTest.php deleted file mode 100644 index 52d2955..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/StringTest.php +++ /dev/null @@ -1,49 +0,0 @@ -_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform(); - $this->_type = Type::getType('string'); - } - - public function testReturnsSqlDeclarationFromPlatformVarchar() - { - $this->assertEquals("DUMMYVARCHAR()", $this->_type->getSqlDeclaration(array(), $this->_platform)); - } - - public function testReturnsDefaultLengthFromPlatformVarchar() - { - $this->assertEquals(255, $this->_type->getDefaultLength($this->_platform)); - } - - public function testConvertToPHPValue() - { - $this->assertInternalType("string", $this->_type->convertToPHPValue("foo", $this->_platform)); - $this->assertInternalType("string", $this->_type->convertToPHPValue("", $this->_platform)); - } - - public function testNullConversion() - { - $this->assertNull($this->_type->convertToPHPValue(null, $this->_platform)); - } - - public function testSQLConversion() - { - $this->assertFalse($this->_type->canRequireSQLConversion(), "String type can never require SQL conversion to work."); - $this->assertEquals('t.foo', $this->_type->convertToDatabaseValueSQL('t.foo', $this->_platform)); - $this->assertEquals('t.foo', $this->_type->convertToPHPValueSQL('t.foo', $this->_platform)); - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/TimeTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/TimeTest.php deleted file mode 100644 index 32374ad..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/TimeTest.php +++ /dev/null @@ -1,47 +0,0 @@ -_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform(); - $this->_type = Type::getType('time'); - } - - public function testTimeConvertsToDatabaseValue() - { - $this->assertTrue( - is_string($this->_type->convertToDatabaseValue(new \DateTime(), $this->_platform)) - ); - } - - public function testTimeConvertsToPHPValue() - { - $this->assertTrue( - $this->_type->convertToPHPValue('5:30:55', $this->_platform) - instanceof \DateTime - ); - } - - public function testInvalidTimeFormatConversion() - { - $this->setExpectedException('Doctrine\DBAL\Types\ConversionException'); - $this->_type->convertToPHPValue('abcdefg', $this->_platform); - } - - public function testNullConversion() - { - $this->assertNull($this->_type->convertToPHPValue(null, $this->_platform)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/VarDateTimeTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/VarDateTimeTest.php deleted file mode 100644 index 8934bca..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/VarDateTimeTest.php +++ /dev/null @@ -1,62 +0,0 @@ -_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform(); - if (!Type::hasType('vardatetime')) { - Type::addType('vardatetime', 'Doctrine\DBAL\Types\VarDateTimeType'); - } - $this->_type = Type::getType('vardatetime'); - } - - public function testDateTimeConvertsToDatabaseValue() - { - $date = new \DateTime('1985-09-01 10:10:10'); - - $expected = $date->format($this->_platform->getDateTimeTzFormatString()); - $actual = $this->_type->convertToDatabaseValue($date, $this->_platform); - - $this->assertEquals($expected, $actual); - } - - public function testDateTimeConvertsToPHPValue() - { - // Birthday of jwage and also birthday of Doctrine. Send him a present ;) - $date = $this->_type->convertToPHPValue('1985-09-01 00:00:00', $this->_platform); - $this->assertInstanceOf('DateTime', $date); - $this->assertEquals('1985-09-01 00:00:00', $date->format('Y-m-d H:i:s')); - $this->assertEquals('000000', $date->format('u')); - } - - public function testInvalidDateTimeFormatConversion() - { - $this->setExpectedException('Doctrine\DBAL\Types\ConversionException'); - $this->_type->convertToPHPValue('abcdefg', $this->_platform); - } - - public function testConversionWithMicroseconds() - { - $date = $this->_type->convertToPHPValue('1985-09-01 00:00:00.123456', $this->_platform); - $this->assertInstanceOf('DateTime', $date); - $this->assertEquals('1985-09-01 00:00:00', $date->format('Y-m-d H:i:s')); - $this->assertEquals('123456', $date->format('u')); - } - - public function testNullConversion() - { - $this->assertNull($this->_type->convertToPHPValue(null, $this->_platform)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/UtilTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/UtilTest.php deleted file mode 100644 index b793e35..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/UtilTest.php +++ /dev/null @@ -1,78 +0,0 @@ - ':param1') - ), - array( - 'SELECT name FROM users WHERE id = ? AND status = ?', - 'SELECT name FROM users WHERE id = :param1 AND status = :param2', - array(1 => ':param1', 2 => ':param2'), - ), - array( - "UPDATE users SET name = '???', status = ?", - "UPDATE users SET name = '???', status = :param1", - array(1 => ':param1'), - ), - array( - "UPDATE users SET status = ?, name = '???'", - "UPDATE users SET status = :param1, name = '???'", - array(1 => ':param1'), - ), - array( - "UPDATE users SET foo = ?, name = '???', status = ?", - "UPDATE users SET foo = :param1, name = '???', status = :param2", - array(1 => ':param1', 2 => ':param2'), - ), - array( - 'UPDATE users SET name = "???", status = ?', - 'UPDATE users SET name = "???", status = :param1', - array(1 => ':param1'), - ), - array( - 'UPDATE users SET status = ?, name = "???"', - 'UPDATE users SET status = :param1, name = "???"', - array(1 => ':param1'), - ), - array( - 'UPDATE users SET foo = ?, name = "???", status = ?', - 'UPDATE users SET foo = :param1, name = "???", status = :param2', - array(1 => ':param1', 2 => ':param2'), - ), - array( - 'SELECT * FROM users WHERE id = ? AND name = "" AND status = ?', - 'SELECT * FROM users WHERE id = :param1 AND name = "" AND status = :param2', - array(1 => ':param1', 2 => ':param2'), - ), - array( - "SELECT * FROM users WHERE id = ? AND name = '' AND status = ?", - "SELECT * FROM users WHERE id = :param1 AND name = '' AND status = :param2", - array(1 => ':param1', 2 => ':param2'), - ) - ); - } - - /** - * @dataProvider dataConvertPositionalToNamedParameters - * @param string $inputSQL - * @param string $expectedOutputSQL - * @param array $expectedOutputParamsMap - */ - public function testConvertPositionalToNamedParameters($inputSQL, $expectedOutputSQL, $expectedOutputParamsMap) - { - list($statement, $params) = \Doctrine\DBAL\Driver\OCI8\OCI8Statement::convertPositionalToNamedPlaceholders($inputSQL); - - $this->assertEquals($expectedOutputSQL, $statement); - $this->assertEquals($expectedOutputParamsMap, $params); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DbalFunctionalTestCase.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DbalFunctionalTestCase.php deleted file mode 100644 index 27dd149..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DbalFunctionalTestCase.php +++ /dev/null @@ -1,77 +0,0 @@ -close(); - self::$_sharedConn = null; - } - } - - protected function setUp() - { - if ( ! isset(self::$_sharedConn)) { - self::$_sharedConn = TestUtil::getConnection(); - } - $this->_conn = self::$_sharedConn; - - $this->_sqlLoggerStack = new \Doctrine\DBAL\Logging\DebugStack(); - $this->_conn->getConfiguration()->setSQLLogger($this->_sqlLoggerStack); - } - - protected function onNotSuccessfulTest(\Exception $e) - { - if ($e instanceof \PHPUnit_Framework_AssertionFailedError) { - throw $e; - } - - if(isset($this->_sqlLoggerStack->queries) && count($this->_sqlLoggerStack->queries)) { - $queries = ""; - $i = count($this->_sqlLoggerStack->queries); - foreach (array_reverse($this->_sqlLoggerStack->queries) AS $query) { - $params = array_map(function($p) { if (is_object($p)) return get_class($p); else return "'".$p."'"; }, $query['params'] ?: array()); - $queries .= ($i+1).". SQL: '".$query['sql']."' Params: ".implode(", ", $params).PHP_EOL; - $i--; - } - - $trace = $e->getTrace(); - $traceMsg = ""; - foreach($trace AS $part) { - if(isset($part['file'])) { - if(strpos($part['file'], "PHPUnit/") !== false) { - // Beginning with PHPUnit files we don't print the trace anymore. - break; - } - - $traceMsg .= $part['file'].":".$part['line'].PHP_EOL; - } - } - - $message = "[".get_class($e)."] ".$e->getMessage().PHP_EOL.PHP_EOL."With queries:".PHP_EOL.$queries.PHP_EOL."Trace:".PHP_EOL.$traceMsg; - - throw new \Exception($message, (int)$e->getCode(), $e); - } - throw $e; - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DbalTestCase.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DbalTestCase.php deleted file mode 100644 index 2478e7b..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/DbalTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ -_platformMock = new DatabasePlatformMock(); - - parent::__construct($params, $driver, $config, $eventManager); - - // Override possible assignment of platform to database platform mock - $this->_platform = $this->_platformMock; - } - - /** - * @override - */ - public function getDatabasePlatform() - { - return $this->_platformMock; - } - - /** - * @override - */ - public function insert($tableName, array $data, array $types = array()) - { - $this->_inserts[$tableName][] = $data; - } - - /** - * @override - */ - public function lastInsertId($seqName = null) - { - return $this->_lastInsertId; - } - - /** - * @override - */ - public function fetchColumn($statement, array $params = array(), $colnum = 0) - { - return $this->_fetchOneResult; - } - - /** - * @override - */ - public function quote($input, $type = null) - { - if (is_string($input)) { - return "'" . $input . "'"; - } - return $input; - } - - /* Mock API */ - - public function setFetchOneResult($fetchOneResult) - { - $this->_fetchOneResult = $fetchOneResult; - } - - public function setDatabasePlatform($platform) - { - $this->_platformMock = $platform; - } - - public function setLastInsertId($id) - { - $this->_lastInsertId = $id; - } - - public function getInserts() - { - return $this->_inserts; - } - - public function reset() - { - $this->_inserts = array(); - $this->_lastInsertId = 0; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php deleted file mode 100644 index 0153f9b..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php +++ /dev/null @@ -1,98 +0,0 @@ -_prefersIdentityColumns; - } - - /** - * @override - */ - public function prefersSequences() - { - return $this->_prefersSequences; - } - - /** @override */ - public function getSequenceNextValSQL($sequenceName) - { - return $this->_sequenceNextValSql; - } - - /** @override */ - public function getBooleanTypeDeclarationSQL(array $field) {} - - /** @override */ - public function getIntegerTypeDeclarationSQL(array $field) {} - - /** @override */ - public function getBigIntTypeDeclarationSQL(array $field) {} - - /** @override */ - public function getSmallIntTypeDeclarationSQL(array $field) {} - - /** @override */ - protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef) {} - - /** @override */ - public function getVarcharTypeDeclarationSQL(array $field) {} - - /** @override */ - public function getClobTypeDeclarationSQL(array $field) {} - - /* MOCK API */ - - public function setPrefersIdentityColumns($bool) - { - $this->_prefersIdentityColumns = $bool; - } - - public function setPrefersSequences($bool) - { - $this->_prefersSequences = $bool; - } - - public function setSequenceNextValSql($sql) - { - $this->_sequenceNextValSql = $sql; - } - - public function getName() - { - return 'mock'; - } - protected function initializeDoctrineTypeMappings() { - } - protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) - { - - } - /** - * Gets the SQL Snippet used to declare a BLOB column type. - */ - public function getBlobTypeDeclarationSQL(array $field) - { - throw DBALException::notSupported(__METHOD__); - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php deleted file mode 100644 index 03d44ca..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php +++ /dev/null @@ -1,17 +0,0 @@ -_platformMock) { - $this->_platformMock = new DatabasePlatformMock; - } - return $this->_platformMock; - } - - /** - * @override - */ - public function getSchemaManager(\Doctrine\DBAL\Connection $conn) - { - if($this->_schemaManagerMock == null) { - return new SchemaManagerMock($conn); - } else { - return $this->_schemaManagerMock; - } - } - - /* MOCK API */ - - public function setDatabasePlatform(\Doctrine\DBAL\Platforms\AbstractPlatform $platform) - { - $this->_platformMock = $platform; - } - - public function setSchemaManager(\Doctrine\DBAL\Schema\AbstractSchemaManager $sm) - { - $this->_schemaManagerMock = $sm; - } - - public function getName() - { - return 'mock'; - } - - public function getDatabase(\Doctrine\DBAL\Connection $conn) - { - return; - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php deleted file mode 100644 index a5bd1c6..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php +++ /dev/null @@ -1,101 +0,0 @@ - - */ -class HydratorMockStatement implements \Doctrine\DBAL\Driver\Statement -{ - private $_resultSet; - - /** - * Creates a new mock statement that will serve the provided fake result set to clients. - * - * @param array $resultSet The faked SQL result set. - */ - public function __construct(array $resultSet) - { - $this->_resultSet = $resultSet; - } - - /** - * Fetches all rows from the result set. - * - * @return array - */ - public function fetchAll($fetchStyle = null, $columnIndex = null, array $ctorArgs = null) - { - return $this->_resultSet; - } - - public function fetchColumn($columnNumber = 0) - { - $row = current($this->_resultSet); - if ( ! is_array($row)) return false; - $val = array_shift($row); - return $val !== null ? $val : false; - } - - /** - * Fetches the next row in the result set. - * - */ - public function fetch($fetchStyle = null) - { - $current = current($this->_resultSet); - next($this->_resultSet); - return $current; - } - - /** - * Closes the cursor, enabling the statement to be executed again. - * - * @return boolean - */ - public function closeCursor() - { - return true; - } - - public function setResultSet(array $resultSet) - { - reset($resultSet); - $this->_resultSet = $resultSet; - } - - public function bindColumn($column, &$param, $type = null) - { - } - - public function bindValue($param, $value, $type = null) - { - } - - public function bindParam($column, &$variable, $type = null, $length = null, $driverOptions = array()) - { - } - - public function columnCount() - { - } - - public function errorCode() - { - } - - public function errorInfo() - { - } - - public function execute($params = array()) - { - } - - public function rowCount() - { - } -} \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/SchemaManagerMock.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/SchemaManagerMock.php deleted file mode 100644 index d4c3c28..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/SchemaManagerMock.php +++ /dev/null @@ -1,13 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Mocks; - -use Doctrine\Common\Cli\AbstractNamespace; - -/** - * TaskMock used for testing the CLI interface. - * @author Nils Adermann - */ -class TaskMock extends \Doctrine\Common\Cli\Tasks\AbstractTask -{ - /** - * Since instances of this class can be created elsewhere all instances - * register themselves in this array for later inspection. - * - * @var array(TaskMock) - */ - static public $instances = array(); - - private $runCounter = 0; - - /** - * Constructor of Task Mock Object. - * Makes sure the object can be inspected later. - * - * @param AbstractNamespace CLI Namespace, passed to parent constructor - */ - function __construct(AbstractNamespace $namespace) - { - self::$instances[] = $this; - - parent::__construct($namespace); - } - - /** - * Returns the number of times run() was called on this object. - * - * @return int - */ - public function getRunCounter() - { - return $this->runCounter; - } - - /* Mock API */ - - /** - * Method invoked by CLI to run task. - */ - public function run() - { - $this->runCounter++; - } - - /** - * Method supposed to generate the CLI Task Documentation - */ - public function buildDocumentation() - { - } -} diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/TestInit.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/TestInit.php deleted file mode 100644 index 6580343..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/TestInit.php +++ /dev/null @@ -1,22 +0,0 @@ -register(); - -$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', __DIR__ . '/../../../lib'); -$classLoader->register(); - -$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Tests', __DIR__ . '/../../'); -$classLoader->register(); - -$classLoader = new \Doctrine\Common\ClassLoader('Symfony', __DIR__ . "/../../../lib/vendor"); -$classLoader->register(); - diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/TestUtil.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/TestUtil.php deleted file mode 100644 index 17d7cc0..0000000 --- a/vendor/doctrine/dbal/tests/Doctrine/Tests/TestUtil.php +++ /dev/null @@ -1,131 +0,0 @@ -real database connection using the following parameters - * of the $GLOBALS array: - * - * 'db_type' : The name of the Doctrine DBAL database driver to use. - * 'db_username' : The username to use for connecting. - * 'db_password' : The password to use for connecting. - * 'db_host' : The hostname of the database to connect to. - * 'db_name' : The name of the database to connect to. - * 'db_port' : The port of the database to connect to. - * - * Usually these variables of the $GLOBALS array are filled by PHPUnit based - * on an XML configuration file. If no such parameters exist, an SQLite - * in-memory database is used. - * - * IMPORTANT: - * 1) Each invocation of this method returns a NEW database connection. - * 2) The database is dropped and recreated to ensure it's clean. - * - * @return Doctrine\DBAL\Connection The database connection instance. - */ - public static function getConnection() - { - if (isset($GLOBALS['db_type'], $GLOBALS['db_username'], $GLOBALS['db_password'], - $GLOBALS['db_host'], $GLOBALS['db_name'], $GLOBALS['db_port']) && - isset($GLOBALS['tmpdb_type'], $GLOBALS['tmpdb_username'], $GLOBALS['tmpdb_password'], - $GLOBALS['tmpdb_host'], $GLOBALS['tmpdb_name'], $GLOBALS['tmpdb_port'])) { - $realDbParams = array( - 'driver' => $GLOBALS['db_type'], - 'user' => $GLOBALS['db_username'], - 'password' => $GLOBALS['db_password'], - 'host' => $GLOBALS['db_host'], - 'dbname' => $GLOBALS['db_name'], - 'port' => $GLOBALS['db_port'] - ); - $tmpDbParams = array( - 'driver' => $GLOBALS['tmpdb_type'], - 'user' => $GLOBALS['tmpdb_username'], - 'password' => $GLOBALS['tmpdb_password'], - 'host' => $GLOBALS['tmpdb_host'], - 'dbname' => $GLOBALS['tmpdb_name'], - 'port' => $GLOBALS['tmpdb_port'] - ); - - if (isset($GLOBALS['db_unix_socket'])) { - $realDbParams['unix_socket'] = $GLOBALS['db_unix_socket']; - } - - if (isset($GLOBALS['tmpdb_unix_socket'])) { - $tmpDbParams['unix_socket'] = $GLOBALS['tmpdb_unix_socket']; - } - - $realConn = \Doctrine\DBAL\DriverManager::getConnection($realDbParams); - - $platform = $realConn->getDatabasePlatform(); - - if ($platform->supportsCreateDropDatabase()) { - $dbname = $realConn->getDatabase(); - // Connect to tmpdb in order to drop and create the real test db. - $tmpConn = \Doctrine\DBAL\DriverManager::getConnection($tmpDbParams); - $realConn->close(); - - $tmpConn->getSchemaManager()->dropDatabase($dbname); - $tmpConn->getSchemaManager()->createDatabase($dbname); - - $tmpConn->close(); - } else { - $sm = $realConn->getSchemaManager(); - - /* @var $schema Schema */ - $schema = $sm->createSchema(); - $stmts = $schema->toDropSql($realConn->getDatabasePlatform()); - - foreach ($stmts AS $stmt) { - $realConn->exec($stmt); - } - } - - $conn = \Doctrine\DBAL\DriverManager::getConnection($realDbParams, null, null); - } else { - $params = array( - 'driver' => 'pdo_sqlite', - 'memory' => true - ); - if (isset($GLOBALS['db_path'])) { - $params['path'] = $GLOBALS['db_path']; - unlink($GLOBALS['db_path']); - } - $conn = \Doctrine\DBAL\DriverManager::getConnection($params); - } - - if (isset($GLOBALS['db_event_subscribers'])) { - $evm = $conn->getEventManager(); - foreach (explode(",", $GLOBALS['db_event_subscribers']) AS $subscriberClass) { - $subscriberInstance = new $subscriberClass(); - $evm->addEventSubscriber($subscriberInstance); - } - } - - return $conn; - } - - /** - * @return \Doctrine\DBAL\Connection - */ - public static function getTempConnection() - { - $tmpDbParams = array( - 'driver' => $GLOBALS['tmpdb_type'], - 'user' => $GLOBALS['tmpdb_username'], - 'password' => $GLOBALS['tmpdb_password'], - 'host' => $GLOBALS['tmpdb_host'], - 'dbname' => $GLOBALS['tmpdb_name'], - 'port' => $GLOBALS['tmpdb_port'] - ); - - // Connect to tmpdb in order to drop and create the real test db. - return \Doctrine\DBAL\DriverManager::getConnection($tmpDbParams); - } -} diff --git a/vendor/doctrine/dbal/tests/README.markdown b/vendor/doctrine/dbal/tests/README.markdown deleted file mode 100644 index c1027ac..0000000 --- a/vendor/doctrine/dbal/tests/README.markdown +++ /dev/null @@ -1,25 +0,0 @@ -# Running the Doctrine 2 Testsuite - -## Setting up a PHPUnit Configuration XML - -.. - -## Testing Lock-Support - -The Lock support in Doctrine 2 is tested using Gearman, which allows to run concurrent tasks in parallel. -Install Gearman with PHP as follows: - -1. Go to http://www.gearman.org and download the latest Gearman Server -2. Compile it and then call ldconfig -3. Start it up "gearmand -vvvv" -4. Install pecl/gearman by calling "gearman-beta" - -You can then go into tests/ and start up two workers: - - php Doctrine/Tests/ORM/Functional/Locking/LockAgentWorker.php - -Then run the locking test-suite: - - phpunit --configuration Doctrine/Tests/ORM/Functional/Locking/GearmanLockTest.php - -This can run considerable time, because it is using sleep() to test for the timing ranges of locks. \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/travis/mysql.travis.xml b/vendor/doctrine/dbal/tests/travis/mysql.travis.xml deleted file mode 100644 index c80f4d2..0000000 --- a/vendor/doctrine/dbal/tests/travis/mysql.travis.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - ./../Doctrine/Tests/DBAL - - - - - performance - locking_functional - - - - - diff --git a/vendor/doctrine/dbal/tests/travis/pgsql.travis.xml b/vendor/doctrine/dbal/tests/travis/pgsql.travis.xml deleted file mode 100644 index e3bd7ea..0000000 --- a/vendor/doctrine/dbal/tests/travis/pgsql.travis.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - ./../Doctrine/Tests/DBAL - - - - - performance - locking_functional - - - \ No newline at end of file diff --git a/vendor/doctrine/dbal/tests/travis/sqlite.travis.xml b/vendor/doctrine/dbal/tests/travis/sqlite.travis.xml deleted file mode 100644 index 944f137..0000000 --- a/vendor/doctrine/dbal/tests/travis/sqlite.travis.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - ./../Doctrine/Tests/DBAL - - - - - performance - locking_functional - - - \ No newline at end of file diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/.gitignore b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/.gitignore deleted file mode 100644 index 1d034f4..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -vendor -composer.phar -composer.lock -phpunit.xml diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/.travis.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/.travis.yml deleted file mode 100644 index 47ab323..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: php - -php: - - 5.3 - - 5.4 - -before_script: - - wget http://getcomposer.org/composer.phar - - php composer.phar install --dev - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/CreateDatabaseDoctrineCommand.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/CreateDatabaseDoctrineCommand.php deleted file mode 100644 index a497daa..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/CreateDatabaseDoctrineCommand.php +++ /dev/null @@ -1,82 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Command; - -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Doctrine\DBAL\DriverManager; - -/** - * Database tool allows you to easily drop and create your configured databases. - * - * @author Fabien Potencier - * @author Jonathan H. Wage - */ -class CreateDatabaseDoctrineCommand extends DoctrineCommand -{ - /** - * {@inheritDoc} - */ - protected function configure() - { - $this - ->setName('doctrine:database:create') - ->setDescription('Creates the configured databases') - ->addOption('connection', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command') - ->setHelp(<<doctrine:database:create command creates the default -connections database: - -php app/console doctrine:database:create - -You can also optionally specify the name of a connection to create the -database for: - -php app/console doctrine:database:create --connection=default -EOT - ); - } - - /** - * {@inheritDoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $connection = $this->getDoctrineConnection($input->getOption('connection')); - - $params = $connection->getParams(); - $name = isset($params['path']) ? $params['path'] : $params['dbname']; - - unset($params['dbname']); - - $tmpConnection = DriverManager::getConnection($params); - - // Only quote if we don't have a path - if (!isset($params['path'])) { - $name = $tmpConnection->getDatabasePlatform()->quoteSingleIdentifier($name); - } - - try { - $tmpConnection->getSchemaManager()->createDatabase($name); - $output->writeln(sprintf('Created database for connection named %s', $name)); - } catch (\Exception $e) { - $output->writeln(sprintf('Could not create database for connection named %s', $name)); - $output->writeln(sprintf('%s', $e->getMessage())); - } - - $tmpConnection->close(); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/DoctrineCommand.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/DoctrineCommand.php deleted file mode 100644 index 208cfaf..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/DoctrineCommand.php +++ /dev/null @@ -1,66 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Command; - -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; -use Doctrine\ORM\Tools\EntityGenerator; - -/** - * Base class for Doctrine console commands to extend from. - * - * @author Fabien Potencier - */ -abstract class DoctrineCommand extends ContainerAwareCommand -{ - /** - * get a doctrine entity generator - * - * @return EntityGenerator - */ - protected function getEntityGenerator() - { - $entityGenerator = new EntityGenerator(); - $entityGenerator->setGenerateAnnotations(false); - $entityGenerator->setGenerateStubMethods(true); - $entityGenerator->setRegenerateEntityIfExists(false); - $entityGenerator->setUpdateEntityIfExists(true); - $entityGenerator->setNumSpaces(4); - $entityGenerator->setAnnotationPrefix('ORM\\'); - - return $entityGenerator; - } - - /** - * Get a doctrine entity manager by symfony name. - * - * @param string $name - * @return \Doctrine\ORM\EntityManager - */ - protected function getEntityManager($name) - { - return $this->getContainer()->get('doctrine')->getManager($name); - } - - /** - * Get a doctrine dbal connection by symfony name. - * - * @param string $name - * @return \Doctrine\DBAL\Connection - */ - protected function getDoctrineConnection($name) - { - return $this->getContainer()->get('doctrine')->getConnection($name); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/DropDatabaseDoctrineCommand.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/DropDatabaseDoctrineCommand.php deleted file mode 100644 index aeaa03d..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/DropDatabaseDoctrineCommand.php +++ /dev/null @@ -1,94 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Command; - -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Database tool allows you to easily drop and create your configured databases. - * - * @author Fabien Potencier - * @author Jonathan H. Wage - */ -class DropDatabaseDoctrineCommand extends DoctrineCommand -{ - /** - * {@inheritDoc} - */ - protected function configure() - { - $this - ->setName('doctrine:database:drop') - ->setDescription('Drops the configured databases') - ->addOption('connection', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command') - ->addOption('force', null, InputOption::VALUE_NONE, 'Set this parameter to execute this action') - ->setHelp(<<doctrine:database:drop command drops the default connections -database: - -php app/console doctrine:database:drop - -The --force parameter has to be used to actually drop the database. - -You can also optionally specify the name of a connection to drop the database -for: - -php app/console doctrine:database:drop --connection=default - -Be careful: All data in a given database will be lost when executing -this command. -EOT - ); - } - - /** - * {@inheritDoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $connection = $this->getDoctrineConnection($input->getOption('connection')); - - $params = $connection->getParams(); - - $name = isset($params['path']) ? $params['path'] : (isset($params['dbname']) ? $params['dbname'] : false); - - if (!$name) { - throw new \InvalidArgumentException("Connection does not contain a 'path' or 'dbname' parameter and cannot be dropped."); - } - - if ($input->getOption('force')) { - // Only quote if we don't have a path - if (!isset($params['path'])) { - $name = $connection->getDatabasePlatform()->quoteSingleIdentifier($name); - } - - try { - $connection->getSchemaManager()->dropDatabase($name); - $output->writeln(sprintf('Dropped database for connection named %s', $name)); - } catch (\Exception $e) { - $output->writeln(sprintf('Could not drop database for connection named %s', $name)); - $output->writeln(sprintf('%s', $e->getMessage())); - } - } else { - $output->writeln('ATTENTION: This operation should not be executed in a production environment.'); - $output->writeln(''); - $output->writeln(sprintf('Would drop the database named %s.', $name)); - $output->writeln('Please run the operation with --force to execute'); - $output->writeln('All data will be lost!'); - } - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php deleted file mode 100644 index 911f262..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php +++ /dev/null @@ -1,140 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Command; - -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Doctrine\ORM\Tools\EntityRepositoryGenerator; -use Doctrine\Bundle\DoctrineBundle\Mapping\DisconnectedMetadataFactory; - -/** - * Generate entity classes from mapping information - * - * @author Fabien Potencier - * @author Jonathan H. Wage - */ -class GenerateEntitiesDoctrineCommand extends DoctrineCommand -{ - /** - * {@inheritDoc} - */ - protected function configure() - { - $this - ->setName('doctrine:generate:entities') - ->setAliases(array('generate:doctrine:entities')) - ->setDescription('Generates entity classes and method stubs from your mapping information') - ->addArgument('name', InputArgument::REQUIRED, 'A bundle name, a namespace, or a class name') - ->addOption('path', null, InputOption::VALUE_REQUIRED, 'The path where to generate entities when it cannot be guessed') - ->addOption('no-backup', null, InputOption::VALUE_NONE, 'Do not backup existing entities files.') - ->setHelp(<<doctrine:generate:entities command generates entity classes -and method stubs from your mapping information: - -You have to limit generation of entities: - -* To a bundle: - - php app/console doctrine:generate:entities MyCustomBundle - -* To a single entity: - - php app/console doctrine:generate:entities MyCustomBundle:User - php app/console doctrine:generate:entities MyCustomBundle/Entity/User - -* To a namespace - - php app/console doctrine:generate:entities MyCustomBundle/Entity - -If the entities are not stored in a bundle, and if the classes do not exist, -the command has no way to guess where they should be generated. In this case, -you must provide the --path option: - - php app/console doctrine:generate:entities Blog/Entity --path=src/ - -By default, the unmodified version of each entity is backed up and saved -(e.g. Product.php~). To prevent this task from creating the backup file, -pass the --no-backup option: - - php app/console doctrine:generate:entities Blog/Entity --no-backup - -Important: Even if you specified Inheritance options in your -XML or YAML Mapping files the generator cannot generate the base and -child classes for you correctly, because it doesn't know which -class is supposed to extend which. You have to adjust the entity -code manually for inheritance to work! - -EOT - ); - } - - /** - * {@inheritDoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $manager = new DisconnectedMetadataFactory($this->getContainer()->get('doctrine')); - - try { - $bundle = $this->getApplication()->getKernel()->getBundle($input->getArgument('name')); - - $output->writeln(sprintf('Generating entities for bundle "%s"', $bundle->getName())); - $metadata = $manager->getBundleMetadata($bundle); - } catch (\InvalidArgumentException $e) { - $name = strtr($input->getArgument('name'), '/', '\\'); - - if (false !== $pos = strpos($name, ':')) { - $name = $this->getContainer()->get('doctrine')->getEntityNamespace(substr($name, 0, $pos)).'\\'.substr($name, $pos + 1); - } - - if (class_exists($name)) { - $output->writeln(sprintf('Generating entity "%s"', $name)); - $metadata = $manager->getClassMetadata($name, $input->getOption('path')); - } else { - $output->writeln(sprintf('Generating entities for namespace "%s"', $name)); - $metadata = $manager->getNamespaceMetadata($name, $input->getOption('path')); - } - } - - $generator = $this->getEntityGenerator(); - - $backupExisting = !$input->getOption('no-backup'); - $generator->setBackupExisting($backupExisting); - - $repoGenerator = new EntityRepositoryGenerator(); - foreach ($metadata->getMetadata() as $m) { - if ($backupExisting) { - $basename = substr($m->name, strrpos($m->name, '\\') + 1); - $output->writeln(sprintf(' > backing up %s.php to %s.php~', $basename, $basename)); - } - // Getting the metadata for the entity class once more to get the correct path if the namespace has multiple occurrences - try { - $entityMetadata = $manager->getClassMetadata($m->getName(), $input->getOption('path')); - } catch (\RuntimeException $e) { - // fall back to the bundle metadata when no entity class could be found - $entityMetadata = $metadata; - } - - $output->writeln(sprintf(' > generating %s', $m->name)); - $generator->generate(array($m), $entityMetadata->getPath()); - - if ($m->customRepositoryClassName && false !== strpos($m->customRepositoryClassName, $metadata->getNamespace())) { - $repoGenerator->writeEntityRepositoryClass($m->customRepositoryClassName, $metadata->getPath()); - } - } - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/ImportMappingDoctrineCommand.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/ImportMappingDoctrineCommand.php deleted file mode 100644 index b54203e..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/ImportMappingDoctrineCommand.php +++ /dev/null @@ -1,132 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Command; - -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Doctrine\ORM\Mapping\Driver\DatabaseDriver; -use Doctrine\ORM\Tools\DisconnectedClassMetadataFactory; -use Doctrine\ORM\Tools\Export\ClassMetadataExporter; -use Doctrine\ORM\Tools\Console\MetadataFilter; - -/** - * Import Doctrine ORM metadata mapping information from an existing database. - * - * @author Fabien Potencier - * @author Jonathan H. Wage - */ -class ImportMappingDoctrineCommand extends DoctrineCommand -{ - /** - * {@inheritDoc} - */ - protected function configure() - { - $this - ->setName('doctrine:mapping:import') - ->addArgument('bundle', InputArgument::REQUIRED, 'The bundle to import the mapping information to') - ->addArgument('mapping-type', InputArgument::OPTIONAL, 'The mapping type to export the imported mapping information to') - ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command') - ->addOption('filter', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'A string pattern used to match entities that should be mapped.') - ->addOption('force', null, InputOption::VALUE_NONE, 'Force to overwrite existing mapping files.') - ->setDescription('Imports mapping information from an existing database') - ->setHelp(<<doctrine:mapping:import command imports mapping information -from an existing database: - -php app/console doctrine:mapping:import "MyCustomBundle" xml - -You can also optionally specify which entity manager to import from with the ---em option: - -php app/console doctrine:mapping:import "MyCustomBundle" xml --em=default - -If you don't want to map every entity that can be found in the database, use the ---filter option. It will try to match the targeted mapped entity with the -provided pattern string. - -php app/console doctrine:mapping:import "MyCustomBundle" xml --filter=MyMatchedEntity - -Use the --force option, if you want to override existing mapping files: - -php app/console doctrine:mapping:import "MyCustomBundle" xml --force -EOT - ); - } - - /** - * {@inheritDoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $bundle = $this->getApplication()->getKernel()->getBundle($input->getArgument('bundle')); - - $destPath = $bundle->getPath(); - $type = $input->getArgument('mapping-type') ? $input->getArgument('mapping-type') : 'xml'; - if ('annotation' === $type) { - $destPath .= '/Entity'; - } else { - $destPath .= '/Resources/config/doctrine'; - } - if ('yaml' === $type) { - $type = 'yml'; - } - - $cme = new ClassMetadataExporter(); - $exporter = $cme->getExporter($type); - $exporter->setOverwriteExistingFiles($input->getOption('force')); - - if ('annotation' === $type) { - $entityGenerator = $this->getEntityGenerator(); - $exporter->setEntityGenerator($entityGenerator); - } - - $em = $this->getEntityManager($input->getOption('em')); - - $databaseDriver = new DatabaseDriver($em->getConnection()->getSchemaManager()); - $em->getConfiguration()->setMetadataDriverImpl($databaseDriver); - - $emName = $input->getOption('em'); - $emName = $emName ? $emName : 'default'; - - $cmf = new DisconnectedClassMetadataFactory(); - $cmf->setEntityManager($em); - $metadata = $cmf->getAllMetadata(); - $metadata = MetadataFilter::filter($metadata, $input->getOption('filter')); - if ($metadata) { - $output->writeln(sprintf('Importing mapping information from "%s" entity manager', $emName)); - foreach ($metadata as $class) { - $className = $class->name; - $class->name = $bundle->getNamespace().'\\Entity\\'.$className; - if ('annotation' === $type) { - $path = $destPath.'/'.$className.'.php'; - } else { - $path = $destPath.'/'.$className.'.orm.'.$type; - } - $output->writeln(sprintf(' > writing %s', $path)); - $code = $exporter->exportClassMetadata($class); - if (!is_dir($dir = dirname($path))) { - mkdir($dir, 0777, true); - } - file_put_contents($path, $code); - } - } else { - $output->writeln('Database does not have any mapping information.', 'ERROR'); - $output->writeln('', 'ERROR'); - } - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/ClearMetadataCacheDoctrineCommand.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/ClearMetadataCacheDoctrineCommand.php deleted file mode 100644 index c780266..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/ClearMetadataCacheDoctrineCommand.php +++ /dev/null @@ -1,64 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy; - -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand; - -/** - * Command to clear the metadata cache of the various cache drivers. - * - * @author Fabien Potencier - * @author Jonathan H. Wage - */ -class ClearMetadataCacheDoctrineCommand extends MetadataCommand -{ - /** - * {@inheritDoc} - */ - protected function configure() - { - parent::configure(); - - $this - ->setName('doctrine:cache:clear-metadata') - ->setDescription('Clears all metadata cache for a entity manager') - ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command') - ->setHelp(<<doctrine:cache:clear-metadata command clears all metadata -cache for the default entity manager: - -php app/console doctrine:cache:clear-metadata - -You can also optionally specify the --em option to specify -which entity manager to clear the cache for: - -php app/console doctrine:cache:clear-metadata --em=default -EOT - ); - } - - /** - * {@inheritDoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em')); - - return parent::execute($input, $output); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/ClearQueryCacheDoctrineCommand.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/ClearQueryCacheDoctrineCommand.php deleted file mode 100644 index 0843ad8..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/ClearQueryCacheDoctrineCommand.php +++ /dev/null @@ -1,64 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy; - -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand; - -/** - * Command to clear the query cache of the various cache drivers. - * - * @author Fabien Potencier - * @author Jonathan H. Wage - */ -class ClearQueryCacheDoctrineCommand extends QueryCommand -{ - /** - * {@inheritDoc} - */ - protected function configure() - { - parent::configure(); - - $this - ->setName('doctrine:cache:clear-query') - ->setDescription('Clears all query cache for a entity manager') - ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command') - ->setHelp(<<doctrine:cache:clear-query command clears all query cache for -the default entity manager: - -php app/console doctrine:cache:clear-query - -You can also optionally specify the --em option to specify -which entity manager to clear the cache for: - -php app/console doctrine:cache:clear-query --em=default -EOT - ); - } - - /** - * {@inheritDoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em')); - - return parent::execute($input, $output); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/ClearResultCacheDoctrineCommand.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/ClearResultCacheDoctrineCommand.php deleted file mode 100644 index 695108e..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/ClearResultCacheDoctrineCommand.php +++ /dev/null @@ -1,64 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy; - -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand; - -/** - * Command to clear the result cache of the various cache drivers. - * - * @author Fabien Potencier - * @author Jonathan H. Wage - */ -class ClearResultCacheDoctrineCommand extends ResultCommand -{ - /** - * {@inheritDoc} - */ - protected function configure() - { - parent::configure(); - - $this - ->setName('doctrine:cache:clear-result') - ->setDescription('Clears result cache for a entity manager') - ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command') - ->setHelp(<<doctrine:cache:clear-result command clears all result cache -for the default entity manager: - -php app/console doctrine:cache:clear-result - -You can also optionally specify the --em option to specify -which entity manager to clear the cache for: - -php app/console doctrine:cache:clear-result --em=default -EOT - ); - } - - /** - * {@inheritDoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em')); - - return parent::execute($input, $output); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/ConvertMappingDoctrineCommand.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/ConvertMappingDoctrineCommand.php deleted file mode 100644 index e92c853..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/ConvertMappingDoctrineCommand.php +++ /dev/null @@ -1,80 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy; - -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; -use Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand; -use Doctrine\ORM\Tools\Export\Driver\XmlExporter; -use Doctrine\ORM\Tools\Export\Driver\YamlExporter; - -/** - * Convert Doctrine ORM metadata mapping information between the various supported - * formats. - * - * @author Fabien Potencier - * @author Jonathan H. Wage - */ -class ConvertMappingDoctrineCommand extends ConvertMappingCommand -{ - /** - * {@inheritDoc} - */ - protected function configure() - { - parent::configure(); - $this - ->setName('doctrine:mapping:convert') - ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command') - ->setHelp(<<doctrine:mapping:convert command converts mapping information -between supported formats: - -php app/console doctrine:mapping:convert xml /path/to/output -EOT - ); - } - - /** - * {@inheritDoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em')); - - return parent::execute($input, $output); - } - - /** - * @param string $toType - * @param string $destPath - * - * @return \Doctrine\ORM\Tools\Export\Driver\AbstractExporter - */ - protected function getExporter($toType, $destPath) - { - /** @var $exporter \Doctrine\ORM\Tools\Export\Driver\AbstractExporter */ - $exporter = parent::getExporter($toType, $destPath); - if ($exporter instanceof XmlExporter) { - $exporter->setExtension('.orm.xml'); - } elseif ($exporter instanceof YamlExporter) { - $exporter->setExtension('.orm.yml'); - } - - return $exporter; - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/CreateSchemaDoctrineCommand.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/CreateSchemaDoctrineCommand.php deleted file mode 100644 index 6bc704b..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/CreateSchemaDoctrineCommand.php +++ /dev/null @@ -1,69 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy; - -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; -use Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand; - -/** - * Command to execute the SQL needed to generate the database schema for - * a given entity manager. - * - * @author Fabien Potencier - * @author Jonathan H. Wage - */ -class CreateSchemaDoctrineCommand extends CreateCommand -{ - /** - * {@inheritDoc} - */ - protected function configure() - { - parent::configure(); - - $this - ->setName('doctrine:schema:create') - ->setDescription('Executes (or dumps) the SQL needed to generate the database schema') - ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command') - ->setHelp(<<doctrine:schema:create command executes the SQL needed to -generate the database schema for the default entity manager: - -php app/console doctrine:schema:create - -You can also generate the database schema for a specific entity manager: - -php app/console doctrine:schema:create --em=default - -Finally, instead of executing the SQL, you can output the SQL: - -php app/console doctrine:schema:create --dump-sql -EOT - ); - } - - /** - * {@inheritDoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em')); - - parent::execute($input, $output); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/DoctrineCommandHelper.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/DoctrineCommandHelper.php deleted file mode 100644 index 11b7589..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/DoctrineCommandHelper.php +++ /dev/null @@ -1,55 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy; - -use Symfony\Bundle\FrameworkBundle\Console\Application; -use Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper; -use Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper; - -/** - * Provides some helper and convenience methods to configure doctrine commands in the context of bundles - * and multiple connections/entity managers. - * - * @author Fabien Potencier - */ -abstract class DoctrineCommandHelper -{ - /** - * Convenience method to push the helper sets of a given entity manager into the application. - * - * @param Application $application - * @param string $emName - */ - static public function setApplicationEntityManager(Application $application, $emName) - { - /** @var $em \Doctrine\ORM\EntityManager */ - $em = $application->getKernel()->getContainer()->get('doctrine')->getManager($emName); - $helperSet = $application->getHelperSet(); - $helperSet->set(new ConnectionHelper($em->getConnection()), 'db'); - $helperSet->set(new EntityManagerHelper($em), 'em'); - } - - /** - * Convenience method to push the helper sets of a given connection into the application. - * - * @param Application $application - * @param string $connName - */ - static public function setApplicationConnection(Application $application, $connName) - { - $connection = $application->getKernel()->getContainer()->get('doctrine')->getConnection($connName); - $helperSet = $application->getHelperSet(); - $helperSet->set(new ConnectionHelper($connection), 'db'); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/DropSchemaDoctrineCommand.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/DropSchemaDoctrineCommand.php deleted file mode 100644 index 4391f6d..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/DropSchemaDoctrineCommand.php +++ /dev/null @@ -1,69 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy; - -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; -use Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand; - -/** - * Command to drop the database schema for a set of classes based on their mappings. - * - * @author Fabien Potencier - * @author Jonathan H. Wage - */ -class DropSchemaDoctrineCommand extends DropCommand -{ - /** - * {@inheritDoc} - */ - protected function configure() - { - parent::configure(); - - $this - ->setName('doctrine:schema:drop') - ->setDescription('Executes (or dumps) the SQL needed to drop the current database schema') - ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command') - ->setHelp(<<doctrine:schema:drop command generates the SQL needed to -drop the database schema of the default entity manager: - -php app/console doctrine:schema:drop --dump-sql - -Alternatively, you can execute the generated queries: - -php app/console doctrine:schema:drop --force - -You can also optionally specify the name of a entity manager to drop the -schema for: - -php app/console doctrine:schema:drop --em=default -EOT - ); - } - - /** - * {@inheritDoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em')); - - parent::execute($input, $output); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/EnsureProductionSettingsDoctrineCommand.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/EnsureProductionSettingsDoctrineCommand.php deleted file mode 100644 index 8012a9e..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/EnsureProductionSettingsDoctrineCommand.php +++ /dev/null @@ -1,64 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy; - -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; -use Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand; - -/** - * Ensure the Doctrine ORM is configured properly for a production environment. - * - * @author Fabien Potencier - * @author Jonathan H. Wage - */ -class EnsureProductionSettingsDoctrineCommand extends EnsureProductionSettingsCommand -{ - /** - * {@inheritDoc} - */ - protected function configure() - { - parent::configure(); - - $this - ->setName('doctrine:ensure-production-settings') - ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command') - ->setHelp(<<doctrine:ensure-production-settings command ensures that -Doctrine is properly configured for a production environment.: - -php app/console doctrine:ensure-production-settings - -You can also optionally specify the --em option to specify -which entity manager to use: - -php app/console doctrine:ensure-production-settings --em=default -EOT - ); - } - - /** - * {@inheritDoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em')); - - parent::execute($input, $output); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/InfoDoctrineCommand.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/InfoDoctrineCommand.php deleted file mode 100644 index 1fffd35..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/InfoDoctrineCommand.php +++ /dev/null @@ -1,63 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy; - -use Doctrine\ORM\Mapping\MappingException; -use Doctrine\ORM\Tools\Console\Command\InfoCommand; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Show information about mapped entities - * - * @author Benjamin Eberlei - */ -class InfoDoctrineCommand extends InfoCommand -{ - /** - * {@inheritDoc} - */ - protected function configure() - { - $this - ->setName('doctrine:mapping:info') - ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command') - ->setDescription('Shows basic information about all mapped entities') - ->setHelp(<<doctrine:mapping:info shows basic information about which -entities exist and possibly if their mapping information contains errors or -not. - -php app/console doctrine:mapping:info - -If you are using multiple entity managers you can pick your choice with the ---em option: - -php app/console doctrine:mapping:info --em=default -EOT - ); - } - - /** - * {@inheritDoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em')); - - parent::execute($input, $output); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/RunDqlDoctrineCommand.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/RunDqlDoctrineCommand.php deleted file mode 100644 index 440ca00..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/RunDqlDoctrineCommand.php +++ /dev/null @@ -1,69 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy; - -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; -use Doctrine\ORM\Tools\Console\Command\RunDqlCommand; - -/** - * Execute a Doctrine DQL query and output the results. - * - * @author Fabien Potencier - * @author Jonathan H. Wage - */ -class RunDqlDoctrineCommand extends RunDqlCommand -{ - /** - * {@inheritDoc} - */ - protected function configure() - { - parent::configure(); - - $this - ->setName('doctrine:query:dql') - ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command') - ->setHelp(<<doctrine:query:dql command executes the given DQL query and -outputs the results: - -php app/console doctrine:query:dql "SELECT u FROM UserBundle:User u" - -You can also optional specify some additional options like what type of -hydration to use when executing the query: - -php app/console doctrine:query:dql "SELECT u FROM UserBundle:User u" --hydrate=array - -Additionally you can specify the first result and maximum amount of results to -show: - -php app/console doctrine:query:dql "SELECT u FROM UserBundle:User u" --first-result=0 --max-result=30 -EOT - ); - } - - /** - * {@inheritDoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em')); - - return parent::execute($input, $output); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/RunSqlDoctrineCommand.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/RunSqlDoctrineCommand.php deleted file mode 100644 index f10ae4d..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/RunSqlDoctrineCommand.php +++ /dev/null @@ -1,59 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy; - -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; -use Doctrine\DBAL\Tools\Console\Command\RunSqlCommand; - -/** - * Execute a SQL query and output the results. - * - * @author Fabien Potencier - * @author Jonathan H. Wage - */ -class RunSqlDoctrineCommand extends RunSqlCommand -{ - /** - * {@inheritDoc} - */ - protected function configure() - { - parent::configure(); - - $this - ->setName('doctrine:query:sql') - ->addOption('connection', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command') - ->setHelp(<<doctrine:query:sql command executes the given DQL query and -outputs the results: - -php app/console doctrine:query:sql "SELECT * from user" -EOT - ); - } - - /** - * {@inheritDoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - DoctrineCommandHelper::setApplicationConnection($this->getApplication(), $input->getOption('connection')); - - return parent::execute($input, $output); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/UpdateSchemaDoctrineCommand.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/UpdateSchemaDoctrineCommand.php deleted file mode 100644 index 6dc1b82..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/UpdateSchemaDoctrineCommand.php +++ /dev/null @@ -1,73 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy; - -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; -use Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand; - -/** - * Command to generate the SQL needed to update the database schema to match - * the current mapping information. - * - * @author Fabien Potencier - * @author Jonathan H. Wage - */ -class UpdateSchemaDoctrineCommand extends UpdateCommand -{ - /** - * {@inheritDoc} - */ - protected function configure() - { - parent::configure(); - - $this - ->setName('doctrine:schema:update') - ->setDescription('Executes (or dumps) the SQL needed to update the database schema to match the current mapping metadata') - ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command') - ->setHelp(<<doctrine:schema:update command generates the SQL needed to -synchronize the database schema with the current mapping metadata of the -default entity manager. - -For example, if you add metadata for a new column to an entity, this command -would generate and output the SQL needed to add the new column to the database: - -php app/console doctrine:schema:update --dump-sql - -Alternatively, you can execute the generated queries: - -php app/console doctrine:schema:update --force - -You can also update the database schema for a specific entity manager: - -php app/console doctrine:schema:update --em=default -EOT - ); - } - - /** - * {@inheritDoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em')); - - parent::execute($input, $output); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/ValidateSchemaCommand.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/ValidateSchemaCommand.php deleted file mode 100644 index 0f51b46..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/ValidateSchemaCommand.php +++ /dev/null @@ -1,65 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy; - -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand as DoctrineValidateSchemaCommand; - -/** - * Command to run Doctrine ValidateSchema() on the current mappings. - * - * @author Fabien Potencier - * @author Jonathan H. Wage - * @author Neil Katin - */ -class ValidateSchemaCommand extends DoctrineValidateSchemaCommand -{ - /** - * {@inheritDoc} - */ - protected function configure() - { - parent::configure(); - - $this - ->setName('doctrine:schema:validate') - ->setDescription('Validates the doctrine mapping files') - ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command') - ->setHelp(<<doctrine:schema:validate checks the current mappings -for valid forward and reverse mappings. - -php app/console doctrine:schema:validate - -You can also optionally specify the --em option to specify -which entity manager use for the validation. - -php app/console doctrine:schema:validate --em=default -EOT - ); - } - - /** - * {@inheritDoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em')); - - return parent::execute($input, $output); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/ConnectionFactory.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/ConnectionFactory.php deleted file mode 100644 index e8fa495..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/ConnectionFactory.php +++ /dev/null @@ -1,88 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle; - -use Doctrine\Common\EventManager; -use Doctrine\DBAL\Configuration; -use Doctrine\DBAL\DriverManager; -use Doctrine\DBAL\Types\Type; - -/** - * Connection - */ -class ConnectionFactory -{ - private $typesConfig = array(); - private $commentedTypes = array(); - private $initialized = false; - - /** - * Construct. - * - * @param array $typesConfig - */ - public function __construct(array $typesConfig) - { - $this->typesConfig = $typesConfig; - } - - /** - * Create a connection by name. - * - * @param array $params - * @param Configuration $config - * @param EventManager $eventManager - * - * @return \Doctrine\DBAL\Connection - */ - public function createConnection(array $params, Configuration $config = null, EventManager $eventManager = null, array $mappingTypes = array()) - { - if (!$this->initialized) { - $this->initializeTypes(); - $this->initialized = true; - } - - $connection = DriverManager::getConnection($params, $config, $eventManager); - - if (!empty($mappingTypes)) { - $platform = $connection->getDatabasePlatform(); - foreach ($mappingTypes as $dbType => $doctrineType) { - $platform->registerDoctrineTypeMapping($dbType, $doctrineType); - } - foreach ($this->commentedTypes as $type) { - $platform->markDoctrineTypeCommented(Type::getType($type)); - } - } - - return $connection; - } - - /** - * initialize the types - */ - private function initializeTypes() - { - foreach ($this->typesConfig as $type => $typeConfig) { - if (Type::hasType($type)) { - Type::overrideType($type, $typeConfig['class']); - } else { - Type::addType($type, $typeConfig['class']); - } - if ($typeConfig['commented']) { - $this->commentedTypes[] = $type; - } - } - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Controller/ProfilerController.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Controller/ProfilerController.php deleted file mode 100644 index 3c34b21..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Controller/ProfilerController.php +++ /dev/null @@ -1,68 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Controller; - -use Symfony\Component\DependencyInjection\ContainerAware; -use Symfony\Component\HttpFoundation\Response; - -/** - * ProfilerController. - * - * @author Christophe Coevoet - */ -class ProfilerController extends ContainerAware -{ - /** - * Renders the profiler panel for the given token. - * - * @param string $token The profiler token - * @param string $connectionName - * @param integer $query - * - * @return Response A Response instance - */ - public function explainAction($token, $connectionName, $query) - { - /** @var $profiler \Symfony\Component\HttpKernel\Profiler\Profiler */ - $profiler = $this->container->get('profiler'); - $profiler->disable(); - - $profile = $profiler->loadProfile($token); - $queries = $profile->getCollector('db')->getQueries(); - - if (!isset($queries[$connectionName][$query])) { - return new Response('This query does not exist.'); - } - - $query = $queries[$connectionName][$query]; - if (!$query['explainable']) { - return new Response('This query cannot be explained.'); - } - - /** @var $connection \Doctrine\DBAL\Connection */ - $connection = $this->container->get('doctrine')->getConnection($connectionName); - try { - $results = $connection->executeQuery('EXPLAIN '.$query['sql'], $query['params'], $query['types']) - ->fetchAll(\PDO::FETCH_ASSOC); - } catch (\Exception $e) { - return new Response('This query cannot be explained.'); - } - - return $this->container->get('templating')->renderResponse('DoctrineBundle:Collector:explain.html.twig', array( - 'data' => $results, - 'query' => $query, - )); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DependencyInjection/Configuration.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DependencyInjection/Configuration.php deleted file mode 100644 index 56d260d..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DependencyInjection/Configuration.php +++ /dev/null @@ -1,420 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\DependencyInjection; - -use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; -use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\Config\Definition\ConfigurationInterface; - -/** - * This class contains the configuration information for the bundle - * - * This information is solely responsible for how the different configuration - * sections are normalized, and merged. - * - * @author Christophe Coevoet - */ -class Configuration implements ConfigurationInterface -{ - private $debug; - - /** - * Constructor - * - * @param Boolean $debug Whether to use the debug mode - */ - public function __construct($debug) - { - $this->debug = (Boolean) $debug; - } - - /** - * {@inheritDoc} - */ - public function getConfigTreeBuilder() - { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('doctrine'); - - $this->addDbalSection($rootNode); - $this->addOrmSection($rootNode); - - return $treeBuilder; - } - - /** - * Add DBAL section to configuration tree - * - * @param ArrayNodeDefinition $node - */ - private function addDbalSection(ArrayNodeDefinition $node) - { - $node - ->children() - ->arrayNode('dbal') - ->beforeNormalization() - ->ifTrue(function ($v) { return is_array($v) && !array_key_exists('connections', $v) && !array_key_exists('connection', $v); }) - ->then(function ($v) { - // Key that should not be rewritten to the connection config - $excludedKeys = array('default_connection' => true, 'types' => true, 'type' => true); - $connection = array(); - foreach ($v as $key => $value) { - if (isset($excludedKeys[$key])) { - continue; - } - $connection[$key] = $v[$key]; - unset($v[$key]); - } - $v['default_connection'] = isset($v['default_connection']) ? (string) $v['default_connection'] : 'default'; - $v['connections'] = array($v['default_connection'] => $connection); - - return $v; - }) - ->end() - ->children() - ->scalarNode('default_connection')->end() - ->end() - ->fixXmlConfig('type') - ->children() - ->arrayNode('types') - ->useAttributeAsKey('name') - ->prototype('array') - ->beforeNormalization() - ->ifString() - ->then(function($v) { return array('class' => $v); }) - ->end() - ->children() - ->scalarNode('class')->isRequired()->end() - ->booleanNode('commented')->defaultTrue()->end() - ->end() - ->end() - ->end() - ->end() - ->fixXmlConfig('connection') - ->append($this->getDbalConnectionsNode()) - ->end() - ; - } - - /** - * Return the dbal connections node - * - * @return ArrayNodeDefinition - */ - private function getDbalConnectionsNode() - { - $treeBuilder = new TreeBuilder(); - $node = $treeBuilder->root('connections'); - - /** @var $connectionNode ArrayNodeDefinition */ - $connectionNode = $node - ->requiresAtLeastOneElement() - ->useAttributeAsKey('name') - ->prototype('array') - ; - - $this->configureDbalDriverNode($connectionNode); - - $connectionNode - ->fixXmlConfig('option') - ->fixXmlConfig('mapping_type') - ->fixXmlConfig('slave') - ->children() - ->scalarNode('driver')->defaultValue('pdo_mysql')->end() - ->scalarNode('platform_service')->end() - ->scalarNode('schema_filter')->end() - ->booleanNode('logging')->defaultValue($this->debug)->end() - ->booleanNode('profiling')->defaultValue($this->debug)->end() - ->scalarNode('driver_class')->end() - ->scalarNode('wrapper_class')->end() - ->arrayNode('options') - ->useAttributeAsKey('key') - ->prototype('scalar')->end() - ->end() - ->arrayNode('mapping_types') - ->useAttributeAsKey('name') - ->prototype('scalar')->end() - ->end() - ->end() - ; - - $slaveNode = $connectionNode - ->children() - ->arrayNode('slaves') - ->useAttributeAsKey('name') - ->prototype('array') - ; - $this->configureDbalDriverNode($slaveNode); - - return $node; - } - - /** - * Adds config keys related to params processed by the DBAL drivers - * - * These keys are available for slave configurations too. - * - * @param ArrayNodeDefinition $node - */ - private function configureDbalDriverNode(ArrayNodeDefinition $node) - { - $node - ->children() - ->scalarNode('dbname')->end() - ->scalarNode('host')->defaultValue('localhost')->end() - ->scalarNode('port')->defaultNull()->end() - ->scalarNode('user')->defaultValue('root')->end() - ->scalarNode('password')->defaultNull()->end() - ->scalarNode('charset')->end() - ->scalarNode('path')->end() - ->booleanNode('memory')->end() - ->scalarNode('unix_socket')->info('The unix socket to use for MySQL')->end() - ->booleanNode('persistent')->info('True to use as persistent connection for the ibm_db2 driver')->end() - ->scalarNode('protocol')->info('The protocol to use for the ibm_db2 driver (default to TCPIP if ommited)')->end() - ->booleanNode('service')->info('True to use dbname as service name instead of SID for Oracle')->end() - ->scalarNode('sessionMode') - ->info('The session mode to use for the oci8 driver') - ->end() - ->booleanNode('pooled')->info('True to use a pooled server with the oci8 driver')->end() - ->booleanNode('MultipleActiveResultSets')->info('Configuring MultipleActiveResultSets for the pdo_sqlsrv driver')->end() - ->end() - ->beforeNormalization() - ->ifTrue(function($v) {return !isset($v['sessionMode']) && isset($v['session_mode']);}) - ->then(function($v) { - $v['sessionMode'] = $v['session_mode']; - unset($v['session_mode']); - - return $v; - }) - ->end() - ->beforeNormalization() - ->ifTrue(function($v) {return !isset($v['MultipleActiveResultSets']) && isset($v['multiple_active_result_sets']);}) - ->then(function($v) { - $v['MultipleActiveResultSets'] = $v['multiple_active_result_sets']; - unset($v['multiple_active_result_sets']); - - return $v; - }) - ->end() - ; - } - - /** - * Add the ORM section to configuration tree - * - * @param ArrayNodeDefinition $node - */ - private function addOrmSection(ArrayNodeDefinition $node) - { - $node - ->children() - ->arrayNode('orm') - ->beforeNormalization() - ->ifTrue(function ($v) { return null === $v || (is_array($v) && !array_key_exists('entity_managers', $v) && !array_key_exists('entity_manager', $v)); }) - ->then(function ($v) { - $v = (array) $v; - // Key that should not be rewritten to the connection config - $excludedKeys = array( - 'default_entity_manager' => true, 'auto_generate_proxy_classes' => true, - 'proxy_dir' => true, 'proxy_namespace' => true, 'resolve_target_entities' => true, - 'resolve_target_entity' => true, - ); - $entityManager = array(); - foreach ($v as $key => $value) { - if (isset($excludedKeys[$key])) { - continue; - } - $entityManager[$key] = $v[$key]; - unset($v[$key]); - } - $v['default_entity_manager'] = isset($v['default_entity_manager']) ? (string) $v['default_entity_manager'] : 'default'; - $v['entity_managers'] = array($v['default_entity_manager'] => $entityManager); - - return $v; - }) - ->end() - ->children() - ->scalarNode('default_entity_manager')->end() - ->booleanNode('auto_generate_proxy_classes')->defaultFalse()->end() - ->scalarNode('proxy_dir')->defaultValue('%kernel.cache_dir%/doctrine/orm/Proxies')->end() - ->scalarNode('proxy_namespace')->defaultValue('Proxies')->end() - ->end() - ->fixXmlConfig('entity_manager') - ->append($this->getOrmEntityManagersNode()) - ->fixXmlConfig('resolve_target_entity', 'resolve_target_entities') - ->append($this->getOrmTargetEntityResolverNode()) - ->end() - ->end() - ; - } - - /** - * Return ORM target entity resolver node - * - * @return \Symfony\Component\Config\Definition\Builder\NodeDefinition - */ - private function getOrmTargetEntityResolverNode() - { - $treeBuilder = new TreeBuilder(); - $node = $treeBuilder->root('resolve_target_entities'); - - $node - ->useAttributeAsKey('interface') - ->prototype('scalar') - ->cannotBeEmpty() - ->end() - ; - - return $node; - } - - /** - * Return ORM entity manager node - * - * @return ArrayNodeDefinition - */ - private function getOrmEntityManagersNode() - { - $treeBuilder = new TreeBuilder(); - $node = $treeBuilder->root('entity_managers'); - - $node - ->requiresAtLeastOneElement() - ->useAttributeAsKey('name') - ->prototype('array') - ->addDefaultsIfNotSet() - ->append($this->getOrmCacheDriverNode('query_cache_driver')) - ->append($this->getOrmCacheDriverNode('metadata_cache_driver')) - ->append($this->getOrmCacheDriverNode('result_cache_driver')) - ->children() - ->scalarNode('connection')->end() - ->scalarNode('class_metadata_factory_name')->defaultValue('Doctrine\ORM\Mapping\ClassMetadataFactory')->end() - ->scalarNode('default_repository_class')->defaultValue('Doctrine\ORM\EntityRepository')->end() - ->scalarNode('auto_mapping')->defaultFalse()->end() - ->scalarNode('naming_strategy')->defaultValue('doctrine.orm.naming_strategy.default')->end() - ->end() - ->fixXmlConfig('hydrator') - ->children() - ->arrayNode('hydrators') - ->useAttributeAsKey('name') - ->prototype('scalar')->end() - ->end() - ->end() - ->fixXmlConfig('mapping') - ->children() - ->arrayNode('mappings') - ->useAttributeAsKey('name') - ->prototype('array') - ->beforeNormalization() - ->ifString() - ->then(function($v) { return array('type' => $v); }) - ->end() - ->treatNullLike(array()) - ->treatFalseLike(array('mapping' => false)) - ->performNoDeepMerging() - ->children() - ->scalarNode('mapping')->defaultValue(true)->end() - ->scalarNode('type')->end() - ->scalarNode('dir')->end() - ->scalarNode('alias')->end() - ->scalarNode('prefix')->end() - ->booleanNode('is_bundle')->end() - ->end() - ->end() - ->end() - ->arrayNode('dql') - ->fixXmlConfig('string_function') - ->fixXmlConfig('numeric_function') - ->fixXmlConfig('datetime_function') - ->children() - ->arrayNode('string_functions') - ->useAttributeAsKey('name') - ->prototype('scalar')->end() - ->end() - ->arrayNode('numeric_functions') - ->useAttributeAsKey('name') - ->prototype('scalar')->end() - ->end() - ->arrayNode('datetime_functions') - ->useAttributeAsKey('name') - ->prototype('scalar')->end() - ->end() - ->end() - ->end() - ->end() - ->fixXmlConfig('filter') - ->children() - ->arrayNode('filters') - ->info('Register SQL Filters in the entity manager') - ->useAttributeAsKey('name') - ->prototype('array') - ->beforeNormalization() - ->ifString() - ->then(function($v) { return array('class' => $v); }) - ->end() - ->beforeNormalization() - // The content of the XML node is returned as the "value" key so we need to rename it - ->ifTrue(function($v) {return is_array($v) && isset($v['value']); }) - ->then(function($v) { - $v['class'] = $v['value']; - unset($v['value']); - - return $v; - }) - ->end() - ->children() - ->scalarNode('class')->isRequired()->end() - ->booleanNode('enabled')->defaultFalse()->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ; - - return $node; - } - - /** - * Return a ORM cache driver node for an given entity manager - * - * @param string $name - * - * @return ArrayNodeDefinition - */ - private function getOrmCacheDriverNode($name) - { - $treeBuilder = new TreeBuilder(); - $node = $treeBuilder->root($name); - - $node - ->addDefaultsIfNotSet() - ->beforeNormalization() - ->ifString() - ->then(function($v) { return array('type' => $v); }) - ->end() - ->children() - ->scalarNode('type')->defaultValue('array')->end() - ->scalarNode('host')->end() - ->scalarNode('port')->end() - ->scalarNode('instance_class')->end() - ->scalarNode('class')->end() - ->scalarNode('id')->end() - ->end() - ; - - return $node; - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php deleted file mode 100644 index 308829b..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php +++ /dev/null @@ -1,460 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\DependencyInjection; - -use Symfony\Component\DependencyInjection\Alias; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Bridge\Doctrine\DependencyInjection\AbstractDoctrineExtension; -use Symfony\Component\Config\FileLocator; - -/** - * DoctrineExtension is an extension for the Doctrine DBAL and ORM library. - * - * @author Jonathan H. Wage - * @author Fabien Potencier - * @author Benjamin Eberlei - */ -class DoctrineExtension extends AbstractDoctrineExtension -{ - /** - * {@inheritDoc} - */ - public function load(array $configs, ContainerBuilder $container) - { - $configuration = $this->getConfiguration($configs, $container); - $config = $this->processConfiguration($configuration, $configs); - - if (!empty($config['dbal'])) { - $this->dbalLoad($config['dbal'], $container); - } - - if (!empty($config['orm'])) { - $this->ormLoad($config['orm'], $container); - } - } - - /** - * Loads the DBAL configuration. - * - * Usage example: - * - * - * - * @param array $config An array of configuration settings - * @param ContainerBuilder $container A ContainerBuilder instance - */ - protected function dbalLoad(array $config, ContainerBuilder $container) - { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('dbal.xml'); - - if (empty($config['default_connection'])) { - $keys = array_keys($config['connections']); - $config['default_connection'] = reset($keys); - } - $this->defaultConnection = $config['default_connection']; - - $container->setAlias('database_connection', sprintf('doctrine.dbal.%s_connection', $this->defaultConnection)); - $container->setAlias('doctrine.dbal.event_manager', new Alias(sprintf('doctrine.dbal.%s_connection.event_manager', $this->defaultConnection), false)); - - $container->setParameter('doctrine.dbal.connection_factory.types', $config['types']); - - $connections = array(); - foreach (array_keys($config['connections']) as $name) { - $connections[$name] = sprintf('doctrine.dbal.%s_connection', $name); - } - $container->setParameter('doctrine.connections', $connections); - $container->setParameter('doctrine.default_connection', $this->defaultConnection); - - foreach ($config['connections'] as $name => $connection) { - $this->loadDbalConnection($name, $connection, $container); - } - } - - /** - * Loads a configured DBAL connection. - * - * @param string $name The name of the connection - * @param array $connection A dbal connection configuration. - * @param ContainerBuilder $container A ContainerBuilder instance - */ - protected function loadDbalConnection($name, array $connection, ContainerBuilder $container) - { - // configuration - $configuration = $container->setDefinition(sprintf('doctrine.dbal.%s_connection.configuration', $name), new DefinitionDecorator('doctrine.dbal.connection.configuration')); - $logger = null; - if ($connection['logging']) { - $logger = new Reference('doctrine.dbal.logger'); - } - unset ($connection['logging']); - if ($connection['profiling']) { - $profilingLoggerId = 'doctrine.dbal.logger.profiling.'.$name; - $container->setDefinition($profilingLoggerId, new DefinitionDecorator('doctrine.dbal.logger.profiling')); - $logger = new Reference($profilingLoggerId); - $container->getDefinition('data_collector.doctrine')->addMethodCall('addLogger', array($name, $logger)); - - if (null !== $logger) { - $chainLogger = new DefinitionDecorator('doctrine.dbal.logger.chain'); - $chainLogger->addMethodCall('addLogger', array($logger)); - - $loggerId = 'doctrine.dbal.logger.chain.'.$name; - $container->setDefinition($loggerId, $chainLogger); - $logger = new Reference($loggerId); - } - } - unset($connection['profiling']); - - if (isset($connection['schema_filter']) && $connection['schema_filter']) { - $configuration->addMethodCall('setFilterSchemaAssetsExpression', array($connection['schema_filter'])); - } - - unset($connection['schema_filter']); - - if ($logger) { - $configuration->addMethodCall('setSQLLogger', array($logger)); - } - - // event manager - $def = $container->setDefinition(sprintf('doctrine.dbal.%s_connection.event_manager', $name), new DefinitionDecorator('doctrine.dbal.connection.event_manager')); - - // connection - if (isset($connection['charset'])) { - if ((isset($connection['driver']) && stripos($connection['driver'], 'mysql') !== false) || - (isset($connection['driver_class']) && stripos($connection['driver_class'], 'mysql') !== false)) { - $mysqlSessionInit = new Definition('%doctrine.dbal.events.mysql_session_init.class%'); - $mysqlSessionInit->setArguments(array($connection['charset'])); - $mysqlSessionInit->setPublic(false); - $mysqlSessionInit->addTag('doctrine.event_subscriber', array('connection' => $name)); - - $container->setDefinition( - sprintf('doctrine.dbal.%s_connection.events.mysqlsessioninit', $name), - $mysqlSessionInit - ); - unset($connection['charset']); - } - } - - $options = $this->getConnectionOptions($connection); - - $container - ->setDefinition(sprintf('doctrine.dbal.%s_connection', $name), new DefinitionDecorator('doctrine.dbal.connection')) - ->setArguments(array( - $options, - new Reference(sprintf('doctrine.dbal.%s_connection.configuration', $name)), - new Reference(sprintf('doctrine.dbal.%s_connection.event_manager', $name)), - $connection['mapping_types'], - )) - ; - } - - protected function getConnectionOptions($connection) - { - $options = $connection; - - if (isset($options['platform_service'])) { - $options['platform'] = new Reference($options['platform_service']); - unset($options['platform_service']); - } - unset($options['mapping_types']); - - foreach (array( - 'options' => 'driverOptions', - 'driver_class' => 'driverClass', - 'wrapper_class' => 'wrapperClass', - ) as $old => $new) { - if (isset($options[$old])) { - $options[$new] = $options[$old]; - unset($options[$old]); - } - } - - if (!empty($options['slaves'])) { - $nonRewrittenKeys = array( - 'driver' => true, 'driverOptions' => true, 'driverClass' => true, 'wrapperClass' => true, - 'platform' => true, 'slaves' => true, 'master' => true, - // included by safety but should have been unset already - 'logging' => true, 'profiling' => true, 'mapping_types' => true, 'platform_service' => true, - ); - foreach ($options as $key => $value) { - if (isset($nonRewrittenKeys[$key])) { - continue; - } - $options['master'][$key] = $value; - unset($options[$key]); - } - if (empty($options['wrapperClass'])) { - // Change the wrapper class only if the user does not already forced using a custom one. - $options['wrapperClass'] = 'Doctrine\\DBAL\\Connections\\MasterSlaveConnection'; - } - } else { - unset($options['slaves']); - } - - return $options; - } - - /** - * Loads the Doctrine ORM configuration. - * - * Usage example: - * - * - * - * @param array $config An array of configuration settings - * @param ContainerBuilder $container A ContainerBuilder instance - */ - protected function ormLoad(array $config, ContainerBuilder $container) - { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('orm.xml'); - - $this->entityManagers = array(); - foreach (array_keys($config['entity_managers']) as $name) { - $this->entityManagers[$name] = sprintf('doctrine.orm.%s_entity_manager', $name); - } - $container->setParameter('doctrine.entity_managers', $this->entityManagers); - - if (empty($config['default_entity_manager'])) { - $tmp = array_keys($this->entityManagers); - $config['default_entity_manager'] = reset($tmp); - } - $container->setParameter('doctrine.default_entity_manager', $config['default_entity_manager']); - - $options = array('auto_generate_proxy_classes', 'proxy_dir', 'proxy_namespace'); - foreach ($options as $key) { - $container->setParameter('doctrine.orm.'.$key, $config[$key]); - } - - $container->setAlias('doctrine.orm.entity_manager', sprintf('doctrine.orm.%s_entity_manager', $config['default_entity_manager'])); - - foreach ($config['entity_managers'] as $name => $entityManager) { - $entityManager['name'] = $name; - $this->loadOrmEntityManager($entityManager, $container); - } - - if ($config['resolve_target_entities']) { - $def = $container->findDefinition('doctrine.orm.listeners.resolve_target_entity'); - foreach ($config['resolve_target_entities'] as $name => $implementation) { - $def->addMethodCall('addResolveTargetEntity', array( - $name, $implementation, array() - )); - } - - $def->addTag('doctrine.event_listener', array('event' => 'loadClassMetadata')); - } - } - - /** - * Loads a configured ORM entity manager. - * - * @param array $entityManager A configured ORM entity manager. - * @param ContainerBuilder $container A ContainerBuilder instance - */ - protected function loadOrmEntityManager(array $entityManager, ContainerBuilder $container) - { - if ($entityManager['auto_mapping'] && count($this->entityManagers) > 1) { - throw new \LogicException('You cannot enable "auto_mapping" when several entity managers are defined.'); - } - - $ormConfigDef = $container->setDefinition(sprintf('doctrine.orm.%s_configuration', $entityManager['name']), new DefinitionDecorator('doctrine.orm.configuration')); - - $this->loadOrmEntityManagerMappingInformation($entityManager, $ormConfigDef, $container); - $this->loadOrmCacheDrivers($entityManager, $container); - - $methods = array( - 'setMetadataCacheImpl' => new Reference(sprintf('doctrine.orm.%s_metadata_cache', $entityManager['name'])), - 'setQueryCacheImpl' => new Reference(sprintf('doctrine.orm.%s_query_cache', $entityManager['name'])), - 'setResultCacheImpl' => new Reference(sprintf('doctrine.orm.%s_result_cache', $entityManager['name'])), - 'setMetadataDriverImpl' => new Reference('doctrine.orm.'.$entityManager['name'].'_metadata_driver'), - 'setProxyDir' => '%doctrine.orm.proxy_dir%', - 'setProxyNamespace' => '%doctrine.orm.proxy_namespace%', - 'setAutoGenerateProxyClasses' => '%doctrine.orm.auto_generate_proxy_classes%', - 'setClassMetadataFactoryName' => $entityManager['class_metadata_factory_name'], - 'setDefaultRepositoryClassName' => $entityManager['default_repository_class'], - ); - // check for version to keep BC - if (version_compare(\Doctrine\ORM\Version::VERSION, "2.3.0-DEV") >= 0) { - $methods = array_merge($methods, array( - 'setNamingStrategy' => new Reference($entityManager['naming_strategy']), - )); - } - foreach ($methods as $method => $arg) { - $ormConfigDef->addMethodCall($method, array($arg)); - } - - foreach ($entityManager['hydrators'] as $name => $class) { - $ormConfigDef->addMethodCall('addCustomHydrationMode', array($name, $class)); - } - - if (!empty($entityManager['dql'])) { - foreach ($entityManager['dql']['string_functions'] as $name => $function) { - $ormConfigDef->addMethodCall('addCustomStringFunction', array($name, $function)); - } - foreach ($entityManager['dql']['numeric_functions'] as $name => $function) { - $ormConfigDef->addMethodCall('addCustomNumericFunction', array($name, $function)); - } - foreach ($entityManager['dql']['datetime_functions'] as $name => $function) { - $ormConfigDef->addMethodCall('addCustomDatetimeFunction', array($name, $function)); - } - } - - $enabledFilters = array(); - foreach ($entityManager['filters'] as $name => $filter) { - $ormConfigDef->addMethodCall('addFilter', array($name, $filter['class'])); - if ($filter['enabled']) { - $enabledFilters[] = $name; - } - } - - $managerConfiguratorName = sprintf('doctrine.orm.%s_manager_configurator', $entityManager['name']); - $managerConfiguratorDef = $container - ->setDefinition($managerConfiguratorName, new DefinitionDecorator('doctrine.orm.manager_configurator.abstract')) - ->replaceArgument(0, $enabledFilters) - ; - - if (!isset($entityManager['connection'])) { - $entityManager['connection'] = $this->defaultConnection; - } - - $container - ->setDefinition(sprintf('doctrine.orm.%s_entity_manager', $entityManager['name']), new DefinitionDecorator('doctrine.orm.entity_manager.abstract')) - ->setArguments(array( - new Reference(sprintf('doctrine.dbal.%s_connection', $entityManager['connection'])), - new Reference(sprintf('doctrine.orm.%s_configuration', $entityManager['name'])) - )) - ->setConfigurator(array(new Reference($managerConfiguratorName), 'configure')) - ; - - $container->setAlias( - sprintf('doctrine.orm.%s_entity_manager.event_manager', $entityManager['name']), - new Alias(sprintf('doctrine.dbal.%s_connection.event_manager', $entityManager['connection']), false) - ); - } - - /** - * Loads an ORM entity managers bundle mapping information. - * - * There are two distinct configuration possibilities for mapping information: - * - * 1. Specify a bundle and optionally details where the entity and mapping information reside. - * 2. Specify an arbitrary mapping location. - * - * @example - * - * doctrine.orm: - * mappings: - * MyBundle1: ~ - * MyBundle2: yml - * MyBundle3: { type: annotation, dir: Entities/ } - * MyBundle4: { type: xml, dir: Resources/config/doctrine/mapping } - * MyBundle5: - * type: yml - * dir: [bundle-mappings1/, bundle-mappings2/] - * alias: BundleAlias - * arbitrary_key: - * type: xml - * dir: %kernel.dir%/../src/vendor/DoctrineExtensions/lib/DoctrineExtensions/Entities - * prefix: DoctrineExtensions\Entities\ - * alias: DExt - * - * In the case of bundles everything is really optional (which leads to autodetection for this bundle) but - * in the mappings key everything except alias is a required argument. - * - * @param array $entityManager A configured ORM entity manager - * @param Definition $ormConfigDef A Definition instance - * @param ContainerBuilder $container A ContainerBuilder instance - */ - protected function loadOrmEntityManagerMappingInformation(array $entityManager, Definition $ormConfigDef, ContainerBuilder $container) - { - // reset state of drivers and alias map. They are only used by this methods and children. - $this->drivers = array(); - $this->aliasMap = array(); - - $this->loadMappingInformation($entityManager, $container); - $this->registerMappingDrivers($entityManager, $container); - - $ormConfigDef->addMethodCall('setEntityNamespaces', array($this->aliasMap)); - } - - /** - * {@inheritDoc} - */ - protected function getObjectManagerElementName($name) - { - return 'doctrine.orm.'.$name; - } - - protected function getMappingObjectDefaultName() - { - return 'Entity'; - } - - /** - * {@inheritDoc} - */ - protected function getMappingResourceConfigDirectory() - { - return 'Resources/config/doctrine'; - } - - /** - * {@inheritDoc} - */ - protected function getMappingResourceExtension() - { - return 'orm'; - } - - /** - * Loads a configured entity managers cache drivers. - * - * @param array $entityManager A configured ORM entity manager. - * @param ContainerBuilder $container A ContainerBuilder instance - */ - protected function loadOrmCacheDrivers(array $entityManager, ContainerBuilder $container) - { - $this->loadObjectManagerCacheDriver($entityManager, $container, 'metadata_cache'); - $this->loadObjectManagerCacheDriver($entityManager, $container, 'result_cache'); - $this->loadObjectManagerCacheDriver($entityManager, $container, 'query_cache'); - } - - /** - * {@inheritDoc} - */ - public function getXsdValidationBasePath() - { - return __DIR__.'/../Resources/config/schema'; - } - - /** - * {@inheritDoc} - */ - public function getNamespace() - { - return 'http://symfony.com/schema/dic/doctrine'; - } - - /** - * {@inheritDoc} - */ - public function getConfiguration(array $config, ContainerBuilder $container) - { - return new Configuration($container->getParameter('kernel.debug')); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DoctrineBundle.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DoctrineBundle.php deleted file mode 100644 index 46cde03..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DoctrineBundle.php +++ /dev/null @@ -1,134 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle; - -use Doctrine\Common\Util\ClassUtils; -use Doctrine\Bundle\DoctrineBundle\Command\CreateDatabaseDoctrineCommand; -use Doctrine\Bundle\DoctrineBundle\Command\DropDatabaseDoctrineCommand; -use Doctrine\Bundle\DoctrineBundle\Command\Proxy\RunSqlDoctrineCommand; -use Symfony\Component\Console\Application; -use Symfony\Component\DependencyInjection\Compiler\PassConfig; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\HttpKernel\Bundle\Bundle; -use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\DoctrineValidationPass; -use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterEventListenersAndSubscribersPass; -use Symfony\Bridge\Doctrine\DependencyInjection\Security\UserProvider\EntityFactory; - -/** - * Bundle. - * - * @author Fabien Potencier - * @author Jonathan H. Wage - */ -class DoctrineBundle extends Bundle -{ - private $autoloader; - - /** - * {@inheritDoc} - */ - public function build(ContainerBuilder $container) - { - parent::build($container); - - $container->addCompilerPass(new RegisterEventListenersAndSubscribersPass('doctrine.connections', 'doctrine.dbal.%s_connection.event_manager', 'doctrine'), PassConfig::TYPE_BEFORE_OPTIMIZATION); - - if ($container->hasExtension('security')) { - $container->getExtension('security')->addUserProviderFactory(new EntityFactory('entity', 'doctrine.orm.security.user.provider')); - } - $container->addCompilerPass(new DoctrineValidationPass('orm')); - } - - /** - * {@inheritDoc} - */ - public function boot() - { - // Register an autoloader for proxies to avoid issues when unserializing them - // when the ORM is used. - if ($this->container->hasParameter('doctrine.orm.proxy_namespace')) { - $namespace = $this->container->getParameter('doctrine.orm.proxy_namespace'); - $dir = $this->container->getParameter('doctrine.orm.proxy_dir'); - // See https://github.com/symfony/symfony/pull/3419 for usage of - // references - $container =& $this->container; - - $this->autoloader = function($class) use ($namespace, $dir, &$container) { - if (0 === strpos($class, $namespace)) { - $fileName = str_replace('\\', '', substr($class, strlen($namespace) +1)); - $file = $dir.DIRECTORY_SEPARATOR.$fileName.'.php'; - - if (!is_file($file) && $container->getParameter('kernel.debug')) { - $originalClassName = ClassUtils::getRealClass($class); - /** @var $registry Registry */ - $registry = $container->get('doctrine'); - - // Tries to auto-generate the proxy file - /** @var $em \Doctrine\ORM\EntityManager */ - foreach ($registry->getManagers() as $em) { - - if ($em->getConfiguration()->getAutoGenerateProxyClasses()) { - $classes = $em->getMetadataFactory()->getAllMetadata(); - - foreach ($classes as $classMetadata) { - if ($classMetadata->name == $originalClassName) { - $em->getProxyFactory()->generateProxyClasses(array($classMetadata)); - } - } - } - } - - clearstatcache($file); - } - - if (file_exists($file)) { - require $file; - } - } - }; - spl_autoload_register($this->autoloader); - } - } - - /** - * {@inheritDoc} - */ - public function shutdown() - { - if (null !== $this->autoloader) { - spl_autoload_unregister($this->autoloader); - $this->autoloader = null; - } - } - - /** - * {@inheritDoc} - */ - public function registerCommands(Application $application) - { - // Use the default logic when the ORM is available. - // This avoids listing all ORM commands by hand. - if (class_exists('Doctrine\\ORM\\Version')) { - parent::registerCommands($application); - - return; - } - - // Register only the DBAL commands if the ORM is not available. - $application->add(new CreateDatabaseDoctrineCommand()); - $application->add(new DropDatabaseDoctrineCommand()); - $application->add(new RunSqlDoctrineCommand()); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/LICENSE b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/LICENSE deleted file mode 100644 index 655a5ce..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2011 Fabien Potencier, Doctrine Project - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, -and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/ManagerConfigurator.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/ManagerConfigurator.php deleted file mode 100644 index fd9078d..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/ManagerConfigurator.php +++ /dev/null @@ -1,66 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle; - -use Doctrine\ORM\EntityManager; - -/** - * Configurator for an EntityManager - * - * @author Christophe Coevoet - */ -class ManagerConfigurator -{ - private $enabledFilters = array(); - - /** - * Construct. - * - * @param array $enabledFilters - */ - public function __construct(array $enabledFilters) - { - $this->enabledFilters = $enabledFilters; - } - - /** - * Create a connection by name. - * - * @param EntityManager $entityManager - */ - public function configure(EntityManager $entityManager) - { - $this->enableFilters($entityManager); - } - - /** - * Enable filters for an given entity manager - * - * @param EntityManager $entityManager - * - * @return null - */ - private function enableFilters(EntityManager $entityManager) - { - if (empty($this->enabledFilters)) { - return; - } - - $filterCollection = $entityManager->getFilters(); - foreach ($this->enabledFilters as $filter) { - $filterCollection->enable($filter); - } - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Mapping/ClassMetadataCollection.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Mapping/ClassMetadataCollection.php deleted file mode 100644 index 1f5d6c5..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Mapping/ClassMetadataCollection.php +++ /dev/null @@ -1,75 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Mapping; - -/** - * @author Fabien Potencier - */ -class ClassMetadataCollection -{ - private $path; - private $namespace; - private $metadata; - - /** - * Constructor - * - * @param array $metadata - */ - public function __construct(array $metadata) - { - $this->metadata = $metadata; - } - - /** - * @return array - */ - public function getMetadata() - { - return $this->metadata; - } - - /** - * @param string $path - */ - public function setPath($path) - { - $this->path = $path; - } - - /** - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * @param string $namespace - */ - public function setNamespace($namespace) - { - $this->namespace = $namespace; - } - - /** - * @return string - */ - public function getNamespace() - { - return $this->namespace; - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Mapping/DisconnectedMetadataFactory.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Mapping/DisconnectedMetadataFactory.php deleted file mode 100644 index 274ae94..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Mapping/DisconnectedMetadataFactory.php +++ /dev/null @@ -1,29 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Mapping; - -/** - * @author Fabien Potencier - */ -class DisconnectedMetadataFactory extends MetadataFactory -{ - /** - * @return string - */ - protected function getClassMetadataFactoryClass() - { - return 'Doctrine\\ORM\\Tools\\DisconnectedClassMetadataFactory'; - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Mapping/MetadataFactory.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Mapping/MetadataFactory.php deleted file mode 100644 index 3e9105a..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Mapping/MetadataFactory.php +++ /dev/null @@ -1,211 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Mapping; - -use Doctrine\Common\Persistence\ManagerRegistry; -use Symfony\Component\HttpKernel\Bundle\BundleInterface; -use Doctrine\ORM\Mapping\MappingException; - -/** - * This class provides methods to access Doctrine entity class metadata for a - * given bundle, namespace or entity class. - * - * @author Fabien Potencier - */ -class MetadataFactory -{ - private $registry; - - /** - * Constructor. - * - * @param ManagerRegistry $registry A ManagerRegistry instance - */ - public function __construct(ManagerRegistry $registry) - { - $this->registry = $registry; - } - - /** - * Gets the metadata of all classes of a bundle. - * - * @param BundleInterface $bundle A BundleInterface instance - * - * @return ClassMetadataCollection A ClassMetadataCollection instance - * @throws \RuntimeException When bundle does not contain mapped entities - */ - public function getBundleMetadata(BundleInterface $bundle) - { - $namespace = $bundle->getNamespace(); - $metadata = $this->getMetadataForNamespace($namespace); - if (!$metadata->getMetadata()) { - throw new \RuntimeException(sprintf('Bundle "%s" does not contain any mapped entities.', $bundle->getName())); - } - - $path = $this->getBasePathForClass($bundle->getName(), $bundle->getNamespace(), $bundle->getPath()); - - $metadata->setPath($path); - $metadata->setNamespace($bundle->getNamespace()); - - return $metadata; - } - - /** - * Gets the metadata of a class. - * - * @param string $class A class name - * @param string $path The path where the class is stored (if known) - * - * @return ClassMetadataCollection A ClassMetadataCollection instance - * @throws MappingException When class is not valid entity or mapped superclass - */ - public function getClassMetadata($class, $path = null) - { - $metadata = $this->getMetadataForClass($class); - if (!$metadata->getMetadata()) { - throw MappingException::classIsNotAValidEntityOrMappedSuperClass($class); - } - - $this->findNamespaceAndPathForMetadata($metadata); - - return $metadata; - } - - /** - * Gets the metadata of all classes of a namespace. - * - * @param string $namespace A namespace name - * @param string $path The path where the class is stored (if known) - * - * @return ClassMetadataCollection A ClassMetadataCollection instance - * @throws \RuntimeException When namespace not contain mapped entities - */ - public function getNamespaceMetadata($namespace, $path = null) - { - $metadata = $this->getMetadataForNamespace($namespace); - if (!$metadata->getMetadata()) { - throw new \RuntimeException(sprintf('Namespace "%s" does not contain any mapped entities.', $namespace)); - } - - $this->findNamespaceAndPathForMetadata($metadata, $path); - - return $metadata; - } - - /** - * Find and configure path and namespace for the metadata collection. - * - * @param ClassMetadataCollection $metadata - * @param string|null $path - * - * @throws \RuntimeException When unable to determine the path - */ - public function findNamespaceAndPathForMetadata(ClassMetadataCollection $metadata, $path = null) - { - $all = $metadata->getMetadata(); - if (class_exists($all[0]->name)) { - $r = new \ReflectionClass($all[0]->name); - $path = $this->getBasePathForClass($r->getName(), $r->getNamespaceName(), dirname($r->getFilename())); - } elseif (!$path) { - throw new \RuntimeException(sprintf('Unable to determine where to save the "%s" class (use the --path option).', $all[0]->name)); - } - - $metadata->setPath($path); - $metadata->setNamespace(isset($r) ? $r->getNamespaceName() : $all[0]->name); - } - - /** - * Get a base path for a class - * - * @param string $name class name - * @param string $namespace class namespace - * @param string $path class path - * - * @return string - * @throws \RuntimeException When base path not found - */ - private function getBasePathForClass($name, $namespace, $path) - { - $namespace = str_replace('\\', '/', $namespace); - $search = str_replace('\\', '/', $path); - $destination = str_replace('/' . $namespace, '', $search, $c); - - if ($c != 1) { - throw new \RuntimeException(sprintf('Can\'t find base path for "%s" (path: "%s", destination: "%s").', $name, $path, $destination)); - } - - return $destination; - } - - /** - * @param string $namespace - * - * @return ClassMetadataCollection - */ - private function getMetadataForNamespace($namespace) - { - $metadata = array(); - foreach ($this->getAllMetadata() as $m) { - if (strpos($m->name, $namespace) === 0) { - $metadata[] = $m; - } - } - - return new ClassMetadataCollection($metadata); - } - - /** - * @param string $entity - * - * @return ClassMetadataCollection - */ - private function getMetadataForClass($entity) - { - foreach ($this->getAllMetadata() as $metadata) { - if ($metadata->name === $entity) { - return new ClassMetadataCollection(array($metadata)); - } - } - - return new ClassMetadataCollection(array()); - } - - /** - * @return array - */ - private function getAllMetadata() - { - $metadata = array(); - foreach ($this->registry->getManagers() as $em) { - $class = $this->getClassMetadataFactoryClass(); - /** @var $cmf \Doctrine\ORM\Mapping\ClassMetadataFactory */ - $cmf = new $class(); - $cmf->setEntityManager($em); - foreach ($cmf->getAllMetadata() as $m) { - $metadata[] = $m; - } - } - - return $metadata; - } - - /** - * @return string - */ - protected function getClassMetadataFactoryClass() - { - return 'Doctrine\\ORM\\Mapping\\ClassMetadataFactory'; - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/README.md b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/README.md deleted file mode 100644 index 31391c5..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# Doctrine Bundle - -Doctrine DBAL & ORM Bundle for the Symfony Framework. - -Because Symfony 2 does not want to force or suggest a specific persistence solutions on the users -this bundle was removed from the core of the Symfony 2 framework. Doctrine2 will still be a major player -in the Symfony world and the bundle is maintained by developers in the Doctrine and Symfony communities. - - IMPORTANT: This bundle is developed for Symfony 2.1 and up. For Symfony 2.0 applications the DoctrineBundle - is still shipped with the core Symfony repository. - -Build Status: [![Build Status](https://secure.travis-ci.org/doctrine/DoctrineBundle.png?branch=master)](http://travis-ci.org/doctrine/DoctrineBundle) - -## What is Doctrine? - -The Doctrine Project is the home of a selected set of PHP libraries primarily focused on providing persistence -services and related functionality. Its prize projects are a Object Relational Mapper and the Database Abstraction -Layer it is built on top of. You can read more about the projects below or view a list of all projects. - -Object relational mapper (ORM) for PHP that sits on top of a powerful database abstraction layer (DBAL). -One of its key features is the option to write database queries in a proprietary object oriented SQL dialect -called Doctrine Query Language (DQL), inspired by Hibernates HQL. This provides developers with a powerful -alternative to SQL that maintains flexibility without requiring unnecessary code duplication. - -DBAL is a powerful database abstraction layer with many features for database schema introspection, -schema management and PDO abstraction. - -## Installation - -### 1. Old deps and bin/vendors way - -Add the following snippets to "deps" files: - - [doctrine-dbal] - git=http://github.com/doctrine/dbal.git - - [doctrine-orm] - git=http://github.com/doctrine/doctrine2.git - - [DoctrineBundle] - git=http://github.com/doctrine/DoctrineBundle.git - target=/bundles/Doctrine/Bundle/DoctrineBundle - -### 2. Composer - -Add the following dependencies to your projects composer.json file: - - "require": { - # .. - "doctrine/doctrine-bundle": ">=2.1" - # .. - } - -## Documentation - -See the Resources/docs folder more a full documentation. diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Registry.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Registry.php deleted file mode 100644 index 9779d30..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Registry.php +++ /dev/null @@ -1,164 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle; - -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Bridge\Doctrine\RegistryInterface; -use Symfony\Bridge\Doctrine\ManagerRegistry; -use Doctrine\ORM\ORMException; -use Doctrine\ORM\EntityManager; - -/** - * References all Doctrine connections and entity managers in a given Container. - * - * @author Fabien Potencier - */ -class Registry extends ManagerRegistry implements RegistryInterface -{ - /** - * Construct. - * - * @param ContainerInterface $container - * @param array $connections - * @param array $entityManagers - * @param string $defaultConnection - * @param string $defaultEntityManager - */ - public function __construct(ContainerInterface $container, array $connections, array $entityManagers, $defaultConnection, $defaultEntityManager) - { - $this->setContainer($container); - - parent::__construct('ORM', $connections, $entityManagers, $defaultConnection, $defaultEntityManager, 'Doctrine\ORM\Proxy\Proxy'); - } - - /** - * Gets the default entity manager name. - * - * @return string The default entity manager name - * - * @deprecated - */ - public function getDefaultEntityManagerName() - { - return $this->getDefaultManagerName(); - } - - /** - * Gets a named entity manager. - * - * @param string $name The entity manager name (null for the default one) - * - * @return EntityManager - * - * @deprecated - */ - public function getEntityManager($name = null) - { - return $this->getManager($name); - } - - /** - * Gets an array of all registered entity managers - * - * @return EntityManager[] an array of all EntityManager instances - * - * @deprecated - */ - public function getEntityManagers() - { - return $this->getManagers(); - } - - /** - * Resets a named entity manager. - * - * This method is useful when an entity manager has been closed - * because of a rollbacked transaction AND when you think that - * it makes sense to get a new one to replace the closed one. - * - * Be warned that you will get a brand new entity manager as - * the existing one is not useable anymore. This means that any - * other object with a dependency on this entity manager will - * hold an obsolete reference. You can inject the registry instead - * to avoid this problem. - * - * @param string $name The entity manager name (null for the default one) - * - * @return EntityManager - */ - public function resetEntityManager($name = null) - { - $this->resetManager($name); - } - - /** - * Resolves a registered namespace alias to the full namespace. - * - * This method looks for the alias in all registered entity managers. - * - * @param string $alias The alias - * - * @return string The full namespace - */ - public function getEntityNamespace($alias) - { - return $this->getAliasNamespace($alias); - } - - /** - * Resolves a registered namespace alias to the full namespace. - * - * This method looks for the alias in all registered entity managers. - * - * @param string $alias The alias - * - * @return string The full namespace - * - * @see Configuration::getEntityNamespace - */ - public function getAliasNamespace($alias) - { - foreach (array_keys($this->getManagers()) as $name) { - try { - return $this->getManager($name)->getConfiguration()->getEntityNamespace($alias); - } catch (ORMException $e) { - } - } - - throw ORMException::unknownEntityNamespace($alias); - } - - /** - * Gets all connection names. - * - * @return array An array of connection names - */ - public function getEntityManagerNames() - { - return $this->getManagerNames(); - } - - /** - * Gets the entity manager associated with a given class. - * - * @param string $class A Doctrine Entity class name - * - * @return EntityManager|null - */ - public function getEntityManagerForClass($class) - { - return $this->getManagerForClass($class); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/config/dbal.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/config/dbal.xml deleted file mode 100644 index ff85087..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/config/dbal.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - Doctrine\DBAL\Logging\LoggerChain - Doctrine\DBAL\Logging\DebugStack - Symfony\Bridge\Doctrine\Logger\DbalLogger - Doctrine\DBAL\Configuration - Symfony\Bridge\Doctrine\DataCollector\DoctrineDataCollector - Symfony\Bridge\Doctrine\ContainerAwareEventManager - Doctrine\Bundle\DoctrineBundle\ConnectionFactory - Doctrine\DBAL\Event\Listeners\MysqlSessionInit - Doctrine\DBAL\Event\Listeners\OracleSessionInit - Doctrine\Bundle\DoctrineBundle\Registry - - - - - - - - - - - - - - - - - - - - - - - - - - %doctrine.dbal.connection_factory.types% - - - - - - - - - - - - - %doctrine.connections% - %doctrine.entity_managers% - %doctrine.default_connection% - %doctrine.default_entity_manager% - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/config/orm.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/config/orm.xml deleted file mode 100644 index 5448cdb..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/config/orm.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - Doctrine\ORM\Configuration - Doctrine\ORM\EntityManager - Doctrine\Bundle\DoctrineBundle\ManagerConfigurator - - - Doctrine\Common\Cache\ArrayCache - Doctrine\Common\Cache\ApcCache - Doctrine\Common\Cache\MemcacheCache - localhost - 11211 - Memcache - Doctrine\Common\Cache\MemcachedCache - localhost - 11211 - Memcached - Doctrine\Common\Cache\XcacheCache - - - Doctrine\ORM\Mapping\Driver\DriverChain - Doctrine\ORM\Mapping\Driver\AnnotationDriver - Doctrine\ORM\Mapping\Driver\SimplifiedXmlDriver - Doctrine\ORM\Mapping\Driver\SimplifiedYamlDriver - Doctrine\ORM\Mapping\Driver\PHPDriver - Doctrine\ORM\Mapping\Driver\StaticPHPDriver - - - Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer - - - Symfony\Bridge\Doctrine\Form\DoctrineOrmTypeGuesser - - - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator - Symfony\Bridge\Doctrine\Validator\DoctrineInitializer - - - Symfony\Bridge\Doctrine\Security\User\EntityUserProvider - - - Doctrine\ORM\Tools\ResolveTargetEntityListener - - - Doctrine\ORM\Mapping\DefaultNamingStrategy - Doctrine\ORM\Mapping\UnderscoreNamingStrategy - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/config/schema/doctrine-1.0.xsd b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/config/schema/doctrine-1.0.xsd deleted file mode 100644 index 747bcc8..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/config/schema/doctrine-1.0.xsd +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/doc/configuration.rst b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/doc/configuration.rst deleted file mode 100644 index f921637..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/doc/configuration.rst +++ /dev/null @@ -1,310 +0,0 @@ -.. index:: - single: Doctrine; ORM Configuration Reference - single: Configuration Reference; Doctrine ORM - -Configuration Reference -======================= - -.. configuration-block:: - - .. code-block:: yaml - - doctrine: - dbal: - default_connection: default - connections: - default: - dbname: database - host: localhost - port: 1234 - user: user - password: secret - driver: pdo_mysql - driver_class: MyNamespace\MyDriverImpl - options: - foo: bar - path: %kernel.data_dir%/data.sqlite - memory: true - unix_socket: /tmp/mysql.sock - wrapper_class: MyDoctrineDbalConnectionWrapper - charset: UTF8 - logging: %kernel.debug% - platform_service: MyOwnDatabasePlatformService - schema_filter: ^sf2_ - mapping_types: - enum: string - conn1: - # ... - types: - custom: Acme\HelloBundle\MyCustomType - orm: - auto_generate_proxy_classes: false - proxy_namespace: Proxies - proxy_dir: %kernel.cache_dir%/doctrine/orm/Proxies - default_entity_manager: default # The first defined is used if not set - entity_managers: - default: - # The name of a DBAL connection (the one marked as default is used if not set) - connection: conn1 - mappings: # Required - AcmeHelloBundle: ~ - class_metadata_factory_name: Doctrine\ORM\Mapping\ClassMetadataFactory - # All cache drivers have to be array, apc, xcache or memcache - metadata_cache_driver: array - query_cache_driver: array - result_cache_driver: - type: memcache - host: localhost - port: 11211 - instance_class: Memcache - class: Doctrine\Common\Cache\MemcacheCache - dql: - string_functions: - test_string: Acme\HelloBundle\DQL\StringFunction - numeric_functions: - test_numeric: Acme\HelloBundle\DQL\NumericFunction - datetime_functions: - test_datetime: Acme\HelloBundle\DQL\DatetimeFunction - naming_strategy: doctrine.orm.naming_strategy.default # Service Reference - em2: - # ... - - .. code-block:: xml - - - - - - - bar - string - - - Acme\HelloBundle\MyCustomType - - - - - - - - Acme\HelloBundle\DQL\NumericFunction - - - - - - - -Configuration Overview ----------------------- - -This following configuration example shows all the configuration defaults that -the ORM resolves to: - -.. code-block:: yaml - - doctrine: - orm: - auto_mapping: true - # the standard distribution overrides this to be true in debug, false otherwise - auto_generate_proxy_classes: false - proxy_namespace: Proxies - proxy_dir: %kernel.cache_dir%/doctrine/orm/Proxies - default_entity_manager: default - metadata_cache_driver: array - query_cache_driver: array - result_cache_driver: array - -There are lots of other configuration options that you can use to overwrite -certain classes, but those are for very advanced use-cases only. - -Caching Drivers -~~~~~~~~~~~~~~~ - -For the caching drivers you can specify the values "array", "apc", "memcache", "memcached" -or "xcache". - -The following example shows an overview of the caching configurations: - -.. code-block:: yaml - - doctrine: - orm: - auto_mapping: true - metadata_cache_driver: apc - query_cache_driver: xcache - result_cache_driver: - type: memcache - host: localhost - port: 11211 - instance_class: Memcache - -Mapping Configuration -~~~~~~~~~~~~~~~~~~~~~ - -Explicit definition of all the mapped entities is the only necessary -configuration for the ORM and there are several configuration options that you -can control. The following configuration options exist for a mapping: - -* ``type`` One of ``annotation``, ``xml``, ``yml``, ``php`` or ``staticphp``. - This specifies which type of metadata type your mapping uses. - -* ``dir`` Path to the mapping or entity files (depending on the driver). If - this path is relative it is assumed to be relative to the bundle root. This - only works if the name of your mapping is a bundle name. If you want to use - this option to specify absolute paths you should prefix the path with the - kernel parameters that exist in the DIC (for example %kernel.root_dir%). - -* ``prefix`` A common namespace prefix that all entities of this mapping - share. This prefix should never conflict with prefixes of other defined - mappings otherwise some of your entities cannot be found by Doctrine. This - option defaults to the bundle namespace + ``Entity``, for example for an - application bundle called ``AcmeHelloBundle`` prefix would be - ``Acme\HelloBundle\Entity``. - -* ``alias`` Doctrine offers a way to alias entity namespaces to simpler, - shorter names to be used in DQL queries or for Repository access. When using - a bundle the alias defaults to the bundle name. - -* ``is_bundle`` This option is a derived value from ``dir`` and by default is - set to true if dir is relative proved by a ``file_exists()`` check that - returns false. It is false if the existence check returns true. In this case - an absolute path was specified and the metadata files are most likely in a - directory outside of a bundle. - -.. index:: - single: Configuration; Doctrine DBAL - single: Doctrine; DBAL configuration - -.. _`reference-dbal-configuration`: - -Doctrine DBAL Configuration ---------------------------- - -.. note:: - - DoctrineBundle supports all parameters that default Doctrine drivers - accept, converted to the XML or YAML naming standards that Symfony - enforces. See the Doctrine `DBAL documentation`_ for more information. - -Besides default Doctrine options, there are some Symfony-related ones that you -can configure. The following block shows all possible configuration keys: - -.. configuration-block:: - - .. code-block:: yaml - - doctrine: - dbal: - dbname: database - host: localhost - port: 1234 - user: user - password: secret - driver: pdo_mysql - driver_class: MyNamespace\MyDriverImpl - options: - foo: bar - path: %kernel.data_dir%/data.sqlite - memory: true - unix_socket: /tmp/mysql.sock - wrapper_class: MyDoctrineDbalConnectionWrapper - charset: UTF8 - logging: %kernel.debug% - platform_service: MyOwnDatabasePlatformService - schema_filter: ^sf2_ - mapping_types: - enum: string - types: - custom: Acme\HelloBundle\MyCustomType - - .. code-block:: xml - - - - - - - bar - string - Acme\HelloBundle\MyCustomType - - - -If you want to configure multiple connections in YAML, put them under the -``connections`` key and give them a unique name: - -.. code-block:: yaml - - doctrine: - dbal: - default_connection: default - connections: - default: - dbname: Symfony2 - user: root - password: null - host: localhost - customer: - dbname: customer - user: root - password: null - host: localhost - -The ``database_connection`` service always refers to the *default* connection, -which is the first one defined or the one configured via the -``default_connection`` parameter. - -Each connection is also accessible via the ``doctrine.dbal.[name]_connection`` -service where ``[name]`` if the name of the connection. - -.. _DBAL documentation: http://www.doctrine-project.org/docs/dbal/2.0/en diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/doc/installation.rst b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/doc/installation.rst deleted file mode 100644 index 1ee5a31..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/doc/installation.rst +++ /dev/null @@ -1,43 +0,0 @@ -Doctrine Bundle -=============== - -Doctrine DBAL & ORM Bundle for the Symfony Framework. - -Because Symfony 2 does not want to force or suggest a specific persistence solutions on the users -this bundle was removed from the core of the Symfony 2 framework. Doctrine2 will still be a major player -in the Symfony world and the bundle is maintained by developers in the Doctrine and Symfony communities. - -IMPORTANT: This bundle is developed for Symfony 2.1 and up. For Symfony 2.0 applications the DoctrineBundle -is still shipped with the core Symfony repository. - -Installation ------------- - -1. Old deps and bin/vendors way - -Add the following snippets to "deps" files: - -.. code-block:: - - [doctrine-mongodb] - git=http://github.com/doctrine/dbal.git - - [doctrine-mongodb-odm] - git=http://github.com/doctrine/doctrine2.git - - [DoctrineBundle] - git=http://github.com/doctrine/DoctrineBundle.git - target=/bundles/Doctrine/Bundle/DoctrineBundle - -2. Composer - -Add the following dependencies to your projects composer.json file: - -.. code-block:: - - "require": { - # .. - "doctrine/doctrine-bundle": ">=2.1" - # .. - } - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/views/Collector/db.html.twig b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/views/Collector/db.html.twig deleted file mode 100644 index 8dbbf32..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/views/Collector/db.html.twig +++ /dev/null @@ -1,122 +0,0 @@ -{% extends app.request.isXmlHttpRequest ? 'WebProfilerBundle:Profiler:ajax_layout.html.twig' : 'WebProfilerBundle:Profiler:layout.html.twig' %} - -{% block toolbar %} - {% set icon %} - Database - {{ collector.querycount }} - in {{ '%0.2f'|format(collector.time * 1000) }} ms - {% endset %} - {% set text %} -
- DB Queries - {{ collector.querycount }} -
-
- Query time - {{ '%0.2f'|format(collector.time * 1000) }} ms -
- {% endset %} - {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %} -{% endblock %} - -{% block menu %} - - - Doctrine - - {{ collector.querycount }} - {{ '%0.0f'|format(collector.time * 1000) }} ms - - -{% endblock %} - -{% block panel %} - {% if 'explain' == page %} - {% render 'DoctrineBundle:Profiler:explain' with { - 'token': token, - 'panel': 'db', - 'connectionName': app.request.query.get('connection'), - 'query': app.request.query.get('query') - } %} - {% else %} - {{ block('queries') }} - {% endif %} -{% endblock %} - -{% block queries %} -

Queries

- - {% for connection, queries in collector.queries %} -

Connection {{ connection }}

- {% if queries is empty %} -

- No queries. -

- {% else %} -
    - {% for i, query in queries %} -
  • -
    - {% if query.explainable %} - - + - - - - {% endif %} - {{ query.sql }} -
    - - Parameters: {{ query.params|yaml_encode }}
    - Time: {{ '%0.2f'|format(query.executionMS * 1000) }} ms -
    - {% if query.explainable %} -
    - {% endif %} -
  • - {% endfor %} -
- {% endif %} - {% endfor %} - -

Database Connections

- - {% if collector.connections %} - {% include 'WebProfilerBundle:Profiler:table.html.twig' with {data: collector.connections} only %} - {% else %} -

- No connections. -

- {% endif %} - -

Entity Managers

- - {% if collector.managers %} - {% include 'WebProfilerBundle:Profiler:table.html.twig' with {data: collector.managers} only %} - {% else %} -

- No entity managers. -

- {% endif %} - - -{% endblock %} \ No newline at end of file diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/views/Collector/explain.html.twig b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/views/Collector/explain.html.twig deleted file mode 100644 index 22af37f..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Resources/views/Collector/explain.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -Explanation: - - - - - {% for label in data[0]|keys %} - - {% endfor %} - - - - {% for row in data %} - - {% for item in row %} - - {% endfor %} - - {% endfor %} - -
{{ label }}
{{ item }}
\ No newline at end of file diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/BundleTest.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/BundleTest.php deleted file mode 100644 index 94eaccd..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/BundleTest.php +++ /dev/null @@ -1,47 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Tests; - -use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\DoctrineValidationPass; -use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterEventListenersAndSubscribersPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Doctrine\Bundle\DoctrineBundle\DoctrineBundle; - -class BundleTest extends \PHPUnit_Framework_TestCase -{ - public function testBuildCompilerPasses() - { - $container = new ContainerBuilder(); - $bundle = new DoctrineBundle(); - $bundle->build($container); - - $config = $container->getCompilerPassConfig(); - $passes = $config->getBeforeOptimizationPasses(); - - $foundEventListener = false; - $foundValidation = false; - - foreach ($passes as $pass) { - if ($pass instanceof RegisterEventListenersAndSubscribersPass) { - $foundEventListener = true; - } elseif ($pass instanceof DoctrineValidationPass) { - $foundValidation = true; - } - } - - $this->assertTrue($foundEventListener, 'RegisterEventListenersAndSubcribersPass was not found'); - $this->assertTrue($foundValidation, 'DoctrineValidationPass was not found'); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/ContainerTest.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/ContainerTest.php deleted file mode 100644 index 83de54c..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/ContainerTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Tests; - -use Doctrine\DBAL\Types\Type; - -class ContainerTest extends TestCase -{ - protected function setUp() - { - parent::setUp(); - - if (!class_exists('Doctrine\\ORM\\Version')) { - $this->markTestSkipped('Doctrine ORM is not available.'); - } - } - - public function testContainer() - { - $container = $this->createYamlBundleTestContainer(); - - $this->assertInstanceOf('Symfony\Bridge\Doctrine\Logger\DbalLogger', $container->get('doctrine.dbal.logger')); - $this->assertInstanceOf('Symfony\Bridge\Doctrine\DataCollector\DoctrineDataCollector', $container->get('data_collector.doctrine')); - $this->assertInstanceOf('Doctrine\DBAL\Configuration', $container->get('doctrine.dbal.default_connection.configuration')); - $this->assertInstanceOf('Doctrine\Common\EventManager', $container->get('doctrine.dbal.default_connection.event_manager')); - $this->assertInstanceOf('Doctrine\DBAL\Connection', $container->get('doctrine.dbal.default_connection')); - $this->assertInstanceOf('Doctrine\Common\Annotations\Reader', $container->get('doctrine.orm.metadata.annotation_reader')); - $this->assertInstanceOf('Doctrine\ORM\Configuration', $container->get('doctrine.orm.default_configuration')); - $this->assertInstanceOf('Doctrine\ORM\Mapping\Driver\DriverChain', $container->get('doctrine.orm.default_metadata_driver')); - $this->assertInstanceOf('Doctrine\Common\Cache\ArrayCache', $container->get('doctrine.orm.default_metadata_cache')); - $this->assertInstanceOf('Doctrine\Common\Cache\ArrayCache', $container->get('doctrine.orm.default_query_cache')); - $this->assertInstanceOf('Doctrine\Common\Cache\ArrayCache', $container->get('doctrine.orm.default_result_cache')); - $this->assertInstanceOf('Doctrine\ORM\EntityManager', $container->get('doctrine.orm.default_entity_manager')); - $this->assertInstanceOf('Doctrine\DBAL\Connection', $container->get('database_connection')); - $this->assertInstanceOf('Doctrine\ORM\EntityManager', $container->get('doctrine.orm.entity_manager')); - $this->assertInstanceOf('Doctrine\Common\EventManager', $container->get('doctrine.orm.default_entity_manager.event_manager')); - $this->assertInstanceOf('Doctrine\Common\EventManager', $container->get('doctrine.dbal.event_manager')); - $this->assertInstanceOf('Doctrine\DBAL\Event\Listeners\MysqlSessionInit', $container->get('doctrine.dbal.default_connection.events.mysqlsessioninit')); - $this->assertInstanceOf('Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer', $container->get('doctrine.orm.proxy_cache_warmer')); - $this->assertInstanceOf('Doctrine\Common\Persistence\ManagerRegistry', $container->get('doctrine')); - $this->assertInstanceOf('Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator', $container->get('doctrine.orm.validator.unique')); - - $this->assertSame($container->get('my.platform'), $container->get('doctrine.dbal.default_connection')->getDatabasePlatform()); - - $this->assertTrue(Type::hasType('test')); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php deleted file mode 100644 index 06884dd..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php +++ /dev/null @@ -1,891 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection; - -use Doctrine\Bundle\DoctrineBundle\Tests\TestCase; -use Doctrine\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass; -use Symfony\Component\Config\FileLocator; - -abstract class AbstractDoctrineExtensionTest extends \PHPUnit_Framework_TestCase -{ - abstract protected function loadFromFile(ContainerBuilder $container, $file); - - public function testDbalOverrideDefaultConnection() - { - $container = $this->getContainer(); - $loader = new DoctrineExtension(); - - $loader->load(array(array(), array('dbal' => array('default_connection' => 'foo')), array()), $container); - - // doctrine.dbal.default_connection - $this->assertEquals('%doctrine.default_connection%', $container->getDefinition('doctrine')->getArgument(3), '->load() overrides existing configuration options'); - $this->assertEquals('foo', $container->getParameter('doctrine.default_connection'), '->load() overrides existing configuration options'); - - } - - public function testDbalLoad() - { - $container = $this->getContainer(); - $loader = new DoctrineExtension(); - - $loader->load(array(array('dbal' => array('connections' => array('default' => array('password' => 'foo')))), array(), array('dbal' => array('default_connection' => 'foo')), array()), $container); - - $config = $container->getDefinition('doctrine.dbal.default_connection')->getArgument(0); - - $this->assertEquals('foo', $config['password']); - $this->assertEquals('root', $config['user']); - } - - public function testDbalLoadFromXmlMultipleConnections() - { - $container = $this->getContainer(); - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - - $this->loadFromFile($container, 'dbal_service_multiple_connections'); - - $this->compileContainer($container); - - // doctrine.dbal.mysql_connection - $config = $container->getDefinition('doctrine.dbal.mysql_connection')->getArgument(0); - - $this->assertEquals('mysql_s3cr3t', $config['password']); - $this->assertEquals('mysql_user', $config['user']); - $this->assertEquals('mysql_db', $config['dbname']); - $this->assertEquals('/path/to/mysqld.sock', $config['unix_socket']); - - // doctrine.dbal.sqlite_connection - $config = $container->getDefinition('doctrine.dbal.sqlite_connection')->getArgument(0); - $this->assertArrayHasKey('memory', $config); - - // doctrine.dbal.oci8_connection - $config = $container->getDefinition('doctrine.dbal.oci_connection')->getArgument(0); - $this->assertArrayHasKey('charset', $config); - } - - public function testDbalLoadFromXmlSingleConnections() - { - $container = $this->getContainer(); - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - - $this->loadFromFile($container, 'dbal_service_single_connection'); - - $this->compileContainer($container); - - // doctrine.dbal.mysql_connection - $config = $container->getDefinition('doctrine.dbal.default_connection')->getArgument(0); - - $this->assertEquals('mysql_s3cr3t', $config['password']); - $this->assertEquals('mysql_user', $config['user']); - $this->assertEquals('mysql_db', $config['dbname']); - $this->assertEquals('/path/to/mysqld.sock', $config['unix_socket']); - } - - public function testDbalLoadSingleMasterSlaveConnection() - { - $container = $this->getContainer(); - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - - $this->loadFromFile($container, 'dbal_service_single_master_slave_connection'); - - $this->compileContainer($container); - - // doctrine.dbal.mysql_connection - $param = $container->getDefinition('doctrine.dbal.default_connection')->getArgument(0); - - $this->assertEquals('Doctrine\\DBAL\\Connections\\MasterSlaveConnection', $param['wrapperClass']); - $this->assertEquals( - array('user' => 'mysql_user', 'password' => 'mysql_s3cr3t', 'port' => null, 'dbname' => 'mysql_db', 'host' => 'localhost', 'unix_socket' => '/path/to/mysqld.sock'), - $param['master'] - ); - $this->assertEquals( - array( - 'user' => 'slave_user', 'password' => 'slave_s3cr3t', 'port' => null, 'dbname' => 'slave_db', - 'host' => 'localhost', 'unix_socket' => '/path/to/mysqld_slave.sock' - ), - $param['slaves']['slave1'] - ); - } - - public function testDependencyInjectionConfigurationDefaults() - { - $container = $this->getContainer(); - $loader = new DoctrineExtension(); - - $loader->load(array(array('dbal' => array('connections' => array('default' => array('password' => 'foo'))), 'orm' => array('default_entity_manager' => 'default', 'entity_managers' => array('default' => array('mappings' => array('YamlBundle' => array())))))), $container); - - $this->assertFalse($container->getParameter('doctrine.orm.auto_generate_proxy_classes')); - $this->assertEquals('Doctrine\ORM\Configuration', $container->getParameter('doctrine.orm.configuration.class')); - $this->assertEquals('Doctrine\ORM\EntityManager', $container->getParameter('doctrine.orm.entity_manager.class')); - $this->assertEquals('Proxies', $container->getParameter('doctrine.orm.proxy_namespace')); - $this->assertEquals('Doctrine\Common\Cache\ArrayCache', $container->getParameter('doctrine.orm.cache.array.class')); - $this->assertEquals('Doctrine\Common\Cache\ApcCache', $container->getParameter('doctrine.orm.cache.apc.class')); - $this->assertEquals('Doctrine\Common\Cache\MemcacheCache', $container->getParameter('doctrine.orm.cache.memcache.class')); - $this->assertEquals('localhost', $container->getParameter('doctrine.orm.cache.memcache_host')); - $this->assertEquals('11211', $container->getParameter('doctrine.orm.cache.memcache_port')); - $this->assertEquals('Memcache', $container->getParameter('doctrine.orm.cache.memcache_instance.class')); - $this->assertEquals('Doctrine\Common\Cache\XcacheCache', $container->getParameter('doctrine.orm.cache.xcache.class')); - $this->assertEquals('Doctrine\ORM\Mapping\Driver\DriverChain', $container->getParameter('doctrine.orm.metadata.driver_chain.class')); - $this->assertEquals('Doctrine\ORM\Mapping\Driver\AnnotationDriver', $container->getParameter('doctrine.orm.metadata.annotation.class')); - $this->assertEquals('Doctrine\ORM\Mapping\Driver\SimplifiedXmlDriver', $container->getParameter('doctrine.orm.metadata.xml.class')); - $this->assertEquals('Doctrine\ORM\Mapping\Driver\SimplifiedYamlDriver', $container->getParameter('doctrine.orm.metadata.yml.class')); - - $config = array( - 'proxy_namespace' => 'MyProxies', - 'auto_generate_proxy_classes' => true, - 'default_entity_manager' => 'default', - 'entity_managers' => array( - 'default' => array( - 'mappings' => array('YamlBundle' => array()), - ) - ) - ); - - $container = $this->getContainer(); - $loader->load(array(array('dbal' => array('connections' => array('default' => array('password' => 'foo'))), 'orm' => $config)), $container); - $this->compileContainer($container); - - $definition = $container->getDefinition('doctrine.dbal.default_connection'); - - $args = $definition->getArguments(); - $this->assertEquals('pdo_mysql', $args[0]['driver']); - $this->assertEquals('localhost', $args[0]['host']); - $this->assertEquals('root', $args[0]['user']); - $this->assertEquals('doctrine.dbal.default_connection.configuration', (string) $args[1]); - $this->assertEquals('doctrine.dbal.default_connection.event_manager', (string) $args[2]); - - $definition = $container->getDefinition('doctrine.orm.default_entity_manager'); - $this->assertEquals('%doctrine.orm.entity_manager.class%', $definition->getClass()); - $this->assertEquals('%doctrine.orm.entity_manager.class%', $definition->getFactoryClass()); - $this->assertEquals('create', $definition->getFactoryMethod()); - - $this->assertEquals(array('default' => 'doctrine.orm.default_entity_manager'), $container->getParameter('doctrine.entity_managers'), "Set of the existing EntityManagers names is incorrect."); - $this->assertEquals('%doctrine.entity_managers%', $container->getDefinition('doctrine')->getArgument(2), "Set of the existing EntityManagers names is incorrect."); - - $arguments = $definition->getArguments(); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]); - $this->assertEquals('doctrine.dbal.default_connection', (string) $arguments[0]); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[1]); - $this->assertEquals('doctrine.orm.default_configuration', (string) $arguments[1]); - - $definition = $container->getDefinition('doctrine.orm.default_configuration'); - $calls = array_values($definition->getMethodCalls()); - $this->assertEquals(array('YamlBundle' => 'Fixtures\Bundles\YamlBundle\Entity'), $calls[0][1][0]); - $this->assertEquals('doctrine.orm.default_metadata_cache', (string) $calls[1][1][0]); - $this->assertEquals('doctrine.orm.default_query_cache', (string) $calls[2][1][0]); - $this->assertEquals('doctrine.orm.default_result_cache', (string) $calls[3][1][0]); - - if (version_compare(\Doctrine\ORM\Version::VERSION, "2.3.0-DEV") >= 0) { - $this->assertEquals('doctrine.orm.naming_strategy.default', (string) $calls[10][1][0]); - } - - $definition = $container->getDefinition('doctrine.orm.default_metadata_cache'); - $this->assertEquals('%doctrine.orm.cache.array.class%', $definition->getClass()); - - $definition = $container->getDefinition('doctrine.orm.default_query_cache'); - $this->assertEquals('%doctrine.orm.cache.array.class%', $definition->getClass()); - - $definition = $container->getDefinition('doctrine.orm.default_result_cache'); - $this->assertEquals('%doctrine.orm.cache.array.class%', $definition->getClass()); - } - - public function testSingleEntityManagerConfiguration() - { - $container = $this->getContainer(); - $loader = new DoctrineExtension(); - - $loader->load(array(array('dbal' => array('connections' => array('default' => array('password' => 'foo'))), 'orm' => array('default_entity_manager' => 'default', 'entity_managers' => array('default' => array('mappings' => array('YamlBundle' => array())))))), $container); - $this->compileContainer($container); - - $definition = $container->getDefinition('doctrine.dbal.default_connection'); - - $definition = $container->getDefinition('doctrine.orm.default_entity_manager'); - $this->assertEquals('%doctrine.orm.entity_manager.class%', $definition->getClass()); - $this->assertEquals('%doctrine.orm.entity_manager.class%', $definition->getFactoryClass()); - $this->assertEquals('create', $definition->getFactoryMethod()); - - $this->assertDICConstructorArguments($definition, array( - new Reference('doctrine.dbal.default_connection'), new Reference('doctrine.orm.default_configuration') - )); - } - - public function testLoadSimpleSingleConnection() - { - $container = $this->getContainer(); - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - - $this->loadFromFile($container, 'orm_service_simple_single_entity_manager'); - - $this->compileContainer($container); - - $definition = $container->getDefinition('doctrine.dbal.default_connection'); - - $this->assertDICConstructorArguments($definition, array( - array( - 'dbname' => 'db', - 'host' => 'localhost', - 'port' => null, - 'user' => 'root', - 'password' => null, - 'driver' => 'pdo_mysql', - 'driverOptions' => array(), - ), - new Reference('doctrine.dbal.default_connection.configuration'), - new Reference('doctrine.dbal.default_connection.event_manager'), - array(), - )); - - $definition = $container->getDefinition('doctrine.orm.default_entity_manager'); - $this->assertEquals('%doctrine.orm.entity_manager.class%', $definition->getClass()); - $this->assertEquals('%doctrine.orm.entity_manager.class%', $definition->getFactoryClass()); - $this->assertEquals('create', $definition->getFactoryMethod()); - - $this->assertDICConstructorArguments($definition, array( - new Reference('doctrine.dbal.default_connection'), new Reference('doctrine.orm.default_configuration') - )); - } - - public function testLoadSingleConnection() - { - $container = $this->getContainer(); - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - - $this->loadFromFile($container, 'orm_service_single_entity_manager'); - - $this->compileContainer($container); - - $definition = $container->getDefinition('doctrine.dbal.default_connection'); - - $this->assertDICConstructorArguments($definition, array( - array( - 'host' => 'localhost', - 'driver' => 'pdo_sqlite', - 'driverOptions' => array(), - 'user' => 'sqlite_user', - 'port' => null, - 'password' => 'sqlite_s3cr3t', - 'dbname' => 'sqlite_db', - 'memory' => true, - ), - new Reference('doctrine.dbal.default_connection.configuration'), - new Reference('doctrine.dbal.default_connection.event_manager'), - array(), - )); - - $definition = $container->getDefinition('doctrine.orm.default_entity_manager'); - $this->assertEquals('%doctrine.orm.entity_manager.class%', $definition->getClass()); - $this->assertEquals('%doctrine.orm.entity_manager.class%', $definition->getFactoryClass()); - $this->assertEquals('create', $definition->getFactoryMethod()); - - $this->assertDICConstructorArguments($definition, array( - new Reference('doctrine.dbal.default_connection'), new Reference('doctrine.orm.default_configuration') - )); - - $configDef = $container->getDefinition('doctrine.orm.default_configuration'); - $this->assertDICDefinitionMethodCallOnce($configDef, 'setDefaultRepositoryClassName', array('Acme\Doctrine\Repository')); - } - - public function testLoadMultipleConnections() - { - $container = $this->getContainer(); - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - - $this->loadFromFile($container, 'orm_service_multiple_entity_managers'); - - $this->compileContainer($container); - - $definition = $container->getDefinition('doctrine.dbal.conn1_connection'); - - $args = $definition->getArguments(); - $this->assertEquals('pdo_sqlite', $args[0]['driver']); - $this->assertEquals('localhost', $args[0]['host']); - $this->assertEquals('sqlite_user', $args[0]['user']); - $this->assertEquals('doctrine.dbal.conn1_connection.configuration', (string) $args[1]); - $this->assertEquals('doctrine.dbal.conn1_connection.event_manager', (string) $args[2]); - - $this->assertEquals('doctrine.orm.em2_entity_manager', (string) $container->getAlias('doctrine.orm.entity_manager')); - - $definition = $container->getDefinition('doctrine.orm.em1_entity_manager'); - $this->assertEquals('%doctrine.orm.entity_manager.class%', $definition->getClass()); - $this->assertEquals('%doctrine.orm.entity_manager.class%', $definition->getFactoryClass()); - $this->assertEquals('create', $definition->getFactoryMethod()); - - $arguments = $definition->getArguments(); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]); - $this->assertEquals('doctrine.dbal.conn1_connection', (string) $arguments[0]); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[1]); - $this->assertEquals('doctrine.orm.em1_configuration', (string) $arguments[1]); - - $definition = $container->getDefinition('doctrine.dbal.conn2_connection'); - - $args = $definition->getArguments(); - $this->assertEquals('pdo_sqlite', $args[0]['driver']); - $this->assertEquals('localhost', $args[0]['host']); - $this->assertEquals('sqlite_user', $args[0]['user']); - $this->assertEquals('doctrine.dbal.conn2_connection.configuration', (string) $args[1]); - $this->assertEquals('doctrine.dbal.conn2_connection.event_manager', (string) $args[2]); - - $definition = $container->getDefinition('doctrine.orm.em2_entity_manager'); - $this->assertEquals('%doctrine.orm.entity_manager.class%', $definition->getClass()); - $this->assertEquals('%doctrine.orm.entity_manager.class%', $definition->getFactoryClass()); - $this->assertEquals('create', $definition->getFactoryMethod()); - - $arguments = $definition->getArguments(); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]); - $this->assertEquals('doctrine.dbal.conn2_connection', (string) $arguments[0]); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[1]); - $this->assertEquals('doctrine.orm.em2_configuration', (string) $arguments[1]); - - $definition = $container->getDefinition('doctrine.orm.em1_metadata_cache'); - $this->assertEquals('%doctrine.orm.cache.xcache.class%', $definition->getClass()); - - $definition = $container->getDefinition('doctrine.orm.em1_query_cache'); - $this->assertEquals('%doctrine.orm.cache.array.class%', $definition->getClass()); - - $definition = $container->getDefinition('doctrine.orm.em1_result_cache'); - $this->assertEquals('%doctrine.orm.cache.array.class%', $definition->getClass()); - } - - public function testLoadLogging() - { - $container = $this->getContainer(); - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - - $this->loadFromFile($container, 'dbal_logging'); - - $this->compileContainer($container); - - $definition = $container->getDefinition('doctrine.dbal.log_connection.configuration'); - $this->assertDICDefinitionMethodCallOnce($definition, 'setSQLLogger', array(new Reference('doctrine.dbal.logger'))); - - $definition = $container->getDefinition('doctrine.dbal.profile_connection.configuration'); - $this->assertDICDefinitionMethodCallOnce($definition, 'setSQLLogger', array(new Reference('doctrine.dbal.logger.chain.profile'))); - - $definition = $container->getDefinition('doctrine.dbal.both_connection.configuration'); - $this->assertDICDefinitionMethodCallOnce($definition, 'setSQLLogger', array(new Reference('doctrine.dbal.logger.chain.both'))); - } - - public function testBundleEntityAliases() - { - $container = $this->getContainer(); - $loader = new DoctrineExtension(); - - $config = $this->getConnectionConfig(); - $config['orm'] = array('default_entity_manager' => 'default', 'entity_managers' => array('default' => array('mappings' => array('YamlBundle' => array())))); - $loader->load(array($config), $container); - - $definition = $container->getDefinition('doctrine.orm.default_configuration'); - $this->assertDICDefinitionMethodCallOnce($definition, 'setEntityNamespaces', - array(array('YamlBundle' => 'Fixtures\Bundles\YamlBundle\Entity')) - ); - } - - public function testOverwriteEntityAliases() - { - $container = $this->getContainer(); - $loader = new DoctrineExtension(); - - $config = $this->getConnectionConfig(); - $config['orm'] = array('default_entity_manager' => 'default', 'entity_managers' => array('default' => array('mappings' => array('YamlBundle' => array('alias' => 'yml'))))); - $loader->load(array($config), $container); - - $definition = $container->getDefinition('doctrine.orm.default_configuration'); - $this->assertDICDefinitionMethodCallOnce($definition, 'setEntityNamespaces', - array(array('yml' => 'Fixtures\Bundles\YamlBundle\Entity')) - ); - } - - public function testYamlBundleMappingDetection() - { - $container = $this->getContainer('YamlBundle'); - $loader = new DoctrineExtension(); - - $config = $this->getConnectionConfig(); - $config['orm'] = array('default_entity_manager' => 'default', 'entity_managers' => array('default' => array('mappings' => array('YamlBundle' => array())))); - $loader->load(array($config), $container); - - $definition = $container->getDefinition('doctrine.orm.default_metadata_driver'); - $this->assertDICDefinitionMethodCallOnce($definition, 'addDriver', array( - new Reference('doctrine.orm.default_yml_metadata_driver'), - 'Fixtures\Bundles\YamlBundle\Entity' - )); - } - - public function testXmlBundleMappingDetection() - { - $container = $this->getContainer('XmlBundle'); - $loader = new DoctrineExtension(); - - $config = $this->getConnectionConfig(); - $config['orm'] = array('default_entity_manager' => 'default', 'entity_managers' => array('default' => array('mappings' => array('XmlBundle' => array())))); - $loader->load(array($config), $container); - - $definition = $container->getDefinition('doctrine.orm.default_metadata_driver'); - $this->assertDICDefinitionMethodCallOnce($definition, 'addDriver', array( - new Reference('doctrine.orm.default_xml_metadata_driver'), - 'Fixtures\Bundles\XmlBundle\Entity' - )); - } - - public function testAnnotationsBundleMappingDetection() - { - $container = $this->getContainer('AnnotationsBundle'); - $loader = new DoctrineExtension(); - - $config = $this->getConnectionConfig(); - $config['orm'] = array('default_entity_manager' => 'default', 'entity_managers' => array('default' => array('mappings' => array('AnnotationsBundle' => array())))); - $loader->load(array($config), $container); - - $definition = $container->getDefinition('doctrine.orm.default_metadata_driver'); - $this->assertDICDefinitionMethodCallOnce($definition, 'addDriver', array( - new Reference('doctrine.orm.default_annotation_metadata_driver'), - 'Fixtures\Bundles\AnnotationsBundle\Entity' - )); - } - - public function testOrmMergeConfigs() - { - $container = $this->getContainer(array('XmlBundle', 'AnnotationsBundle')); - $loader = new DoctrineExtension(); - - $config1 = $this->getConnectionConfig(); - $config1['orm'] = array( - 'auto_generate_proxy_classes' => true, - 'default_entity_manager' => 'default', - 'entity_managers' => array( - 'default' => array('mappings' => array('AnnotationsBundle' => array())) - )); - $config2 = $this->getConnectionConfig(); - $config2['orm'] = array( - 'auto_generate_proxy_classes' => false, - 'default_entity_manager' => 'default', - 'entity_managers' => array( - 'default' => array('mappings' => array('XmlBundle' => array())) - )); - $loader->load(array($config1, $config2), $container); - - $definition = $container->getDefinition('doctrine.orm.default_metadata_driver'); - $this->assertDICDefinitionMethodCallAt(0, $definition, 'addDriver', array( - new Reference('doctrine.orm.default_annotation_metadata_driver'), - 'Fixtures\Bundles\AnnotationsBundle\Entity' - )); - $this->assertDICDefinitionMethodCallAt(1, $definition, 'addDriver', array( - new Reference('doctrine.orm.default_xml_metadata_driver'), - 'Fixtures\Bundles\XmlBundle\Entity' - )); - - $configDef = $container->getDefinition('doctrine.orm.default_configuration'); - $this->assertDICDefinitionMethodCallOnce($configDef, 'setAutoGenerateProxyClasses'); - - $calls = $configDef->getMethodCalls(); - foreach ($calls as $call) { - if ($call[0] == 'setAutoGenerateProxyClasses') { - $this->assertFalse($container->getParameterBag()->resolveValue($call[1][0])); - break; - } - } - } - - public function testEntityManagerMetadataCacheDriverConfiguration() - { - $container = $this->getContainer(); - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - - $this->loadFromFile($container, 'orm_service_multiple_entity_managers'); - - $this->compileContainer($container); - - $definition = $container->getDefinition('doctrine.orm.em1_metadata_cache'); - $this->assertDICDefinitionClass($definition, '%doctrine.orm.cache.xcache.class%'); - - $definition = $container->getDefinition('doctrine.orm.em2_metadata_cache'); - $this->assertDICDefinitionClass($definition, '%doctrine.orm.cache.apc.class%'); - } - - public function testEntityManagerMemcacheMetadataCacheDriverConfiguration() - { - $container = $this->getContainer(); - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - - $this->loadFromFile($container, 'orm_service_simple_single_entity_manager'); - - $this->compileContainer($container); - - $definition = $container->getDefinition('doctrine.orm.default_metadata_cache'); - $this->assertDICDefinitionClass($definition, 'Doctrine\Common\Cache\MemcacheCache'); - $this->assertDICDefinitionMethodCallOnce($definition, 'setMemcache', - array(new Reference('doctrine.orm.default_memcache_instance')) - ); - - $definition = $container->getDefinition('doctrine.orm.default_memcache_instance'); - $this->assertDICDefinitionClass($definition, 'Memcache'); - $this->assertDICDefinitionMethodCallOnce($definition, 'connect', array( - 'localhost', '11211' - )); - } - - public function testDependencyInjectionImportsOverrideDefaults() - { - $container = $this->getContainer(); - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - - $this->loadFromFile($container, 'orm_imports'); - - $this->compileContainer($container); - - $cacheDefinition = $container->getDefinition('doctrine.orm.default_metadata_cache'); - $this->assertEquals('%doctrine.orm.cache.apc.class%', $cacheDefinition->getClass()); - - $configDefinition = $container->getDefinition('doctrine.orm.default_configuration'); - $this->assertDICDefinitionMethodCallOnce($configDefinition, 'setAutoGenerateProxyClasses', array('%doctrine.orm.auto_generate_proxy_classes%')); - } - - public function testSingleEntityManagerMultipleMappingBundleDefinitions() - { - $container = $this->getContainer(array('YamlBundle', 'AnnotationsBundle', 'XmlBundle')); - - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - - $this->loadFromFile($container, 'orm_single_em_bundle_mappings'); - - $this->compileContainer($container); - - $definition = $container->getDefinition('doctrine.orm.default_metadata_driver'); - - $this->assertDICDefinitionMethodCallAt(0, $definition, 'addDriver', array( - new Reference('doctrine.orm.default_annotation_metadata_driver'), - 'Fixtures\Bundles\AnnotationsBundle\Entity' - )); - - $this->assertDICDefinitionMethodCallAt(1, $definition, 'addDriver', array( - new Reference('doctrine.orm.default_yml_metadata_driver'), - 'Fixtures\Bundles\YamlBundle\Entity' - )); - - $this->assertDICDefinitionMethodCallAt(2, $definition, 'addDriver', array( - new Reference('doctrine.orm.default_xml_metadata_driver'), - 'Fixtures\Bundles\XmlBundle' - )); - - $annDef = $container->getDefinition('doctrine.orm.default_annotation_metadata_driver'); - $this->assertDICConstructorArguments($annDef, array( - new Reference('doctrine.orm.metadata.annotation_reader'), - array(__DIR__ .DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'Bundles'.DIRECTORY_SEPARATOR.'AnnotationsBundle'.DIRECTORY_SEPARATOR.'Entity') - )); - - $ymlDef = $container->getDefinition('doctrine.orm.default_yml_metadata_driver'); - $this->assertDICConstructorArguments($ymlDef, array( - array(__DIR__ .DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'Bundles'.DIRECTORY_SEPARATOR.'YamlBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'doctrine' => 'Fixtures\Bundles\YamlBundle\Entity') - )); - - $xmlDef = $container->getDefinition('doctrine.orm.default_xml_metadata_driver'); - $this->assertDICConstructorArguments($xmlDef, array( - array(__DIR__ .DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'Bundles'.DIRECTORY_SEPARATOR.'XmlBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'doctrine' => 'Fixtures\Bundles\XmlBundle') - )); - } - - public function testMultipleEntityManagersMappingBundleDefinitions() - { - $container = $this->getContainer(array('YamlBundle', 'AnnotationsBundle', 'XmlBundle')); - - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - - $this->loadFromFile($container, 'orm_multiple_em_bundle_mappings'); - - $this->compileContainer($container); - - $this->assertEquals(array('em1' => 'doctrine.orm.em1_entity_manager', 'em2' => 'doctrine.orm.em2_entity_manager'), $container->getParameter('doctrine.entity_managers'), "Set of the existing EntityManagers names is incorrect."); - $this->assertEquals('%doctrine.entity_managers%', $container->getDefinition('doctrine')->getArgument(2), "Set of the existing EntityManagers names is incorrect."); - - $def1 = $container->getDefinition('doctrine.orm.em1_metadata_driver'); - $def2 = $container->getDefinition('doctrine.orm.em2_metadata_driver'); - - $this->assertDICDefinitionMethodCallAt(0, $def1, 'addDriver', array( - new Reference('doctrine.orm.em1_annotation_metadata_driver'), - 'Fixtures\Bundles\AnnotationsBundle\Entity' - )); - - $this->assertDICDefinitionMethodCallAt(0, $def2, 'addDriver', array( - new Reference('doctrine.orm.em2_yml_metadata_driver'), - 'Fixtures\Bundles\YamlBundle\Entity' - )); - - $this->assertDICDefinitionMethodCallAt(1, $def2, 'addDriver', array( - new Reference('doctrine.orm.em2_xml_metadata_driver'), - 'Fixtures\Bundles\XmlBundle' - )); - - $annDef = $container->getDefinition('doctrine.orm.em1_annotation_metadata_driver'); - $this->assertDICConstructorArguments($annDef, array( - new Reference('doctrine.orm.metadata.annotation_reader'), - array(__DIR__ .DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'Bundles'.DIRECTORY_SEPARATOR.'AnnotationsBundle'.DIRECTORY_SEPARATOR.'Entity') - )); - - $ymlDef = $container->getDefinition('doctrine.orm.em2_yml_metadata_driver'); - $this->assertDICConstructorArguments($ymlDef, array( - array(__DIR__ .DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'Bundles'.DIRECTORY_SEPARATOR.'YamlBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'doctrine' => 'Fixtures\Bundles\YamlBundle\Entity') - )); - - $xmlDef = $container->getDefinition('doctrine.orm.em2_xml_metadata_driver'); - $this->assertDICConstructorArguments($xmlDef, array( - array(__DIR__ .DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'Bundles'.DIRECTORY_SEPARATOR.'XmlBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'doctrine' => 'Fixtures\Bundles\XmlBundle') - )); - } - - public function testAnnotationsBundleMappingDetectionWithVendorNamespace() - { - $container = $this->getContainer('AnnotationsBundle', 'Vendor'); - $loader = new DoctrineExtension(); - - $config = $this->getConnectionConfig(); - $config['orm'] = array('default_entity_manager' => 'default', 'entity_managers' => array('default' => array('mappings' => array('AnnotationsBundle' => array())))); - $loader->load(array($config), $container); - - $calls = $container->getDefinition('doctrine.orm.default_metadata_driver')->getMethodCalls(); - $this->assertEquals('doctrine.orm.default_annotation_metadata_driver', (string) $calls[0][1][0]); - $this->assertEquals('Fixtures\Bundles\Vendor\AnnotationsBundle\Entity', $calls[0][1][1]); - } - - public function testSetTypes() - { - $container = $this->getContainer(array('YamlBundle')); - - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - $this->loadFromFile($container, 'dbal_types'); - $this->compileContainer($container); - - $this->assertEquals( - array('test' => array('class' => 'Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestType', 'commented' => true)), - $container->getParameter('doctrine.dbal.connection_factory.types') - ); - $this->assertEquals('%doctrine.dbal.connection_factory.types%', $container->getDefinition('doctrine.dbal.connection_factory')->getArgument(0)); - } - - public function testSetCustomFunctions() - { - $container = $this->getContainer(array('YamlBundle')); - - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - $this->loadFromFile($container, 'orm_functions'); - $this->compileContainer($container); - - $definition = $container->getDefinition('doctrine.orm.default_configuration'); - $this->assertDICDefinitionMethodCallOnce($definition, 'addCustomStringFunction', array('test_string', 'Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestStringFunction')); - $this->assertDICDefinitionMethodCallOnce($definition, 'addCustomNumericFunction', array('test_numeric', 'Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestNumericFunction')); - $this->assertDICDefinitionMethodCallOnce($definition, 'addCustomDatetimeFunction', array('test_datetime', 'Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestDatetimeFunction')); - } - - public function testSetNamingStrategy() - { - if (version_compare(\Doctrine\ORM\Version::VERSION, "2.3.0-DEV") < 0) { - $this->markTestSkipped('Naming Strategies are not available'); - } - $container = $this->getContainer(array('YamlBundle')); - - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - $this->loadFromFile($container, 'orm_namingstrategy'); - $this->compileContainer($container); - - $def1 = $container->getDefinition('doctrine.orm.em1_configuration'); - $def2 = $container->getDefinition('doctrine.orm.em2_configuration'); - - $this->assertDICDefinitionMethodCallOnce($def1, 'setNamingStrategy', array(0 => new Reference('doctrine.orm.naming_strategy.default'))); - $this->assertDICDefinitionMethodCallOnce($def2, 'setNamingStrategy', array(0 => new Reference('doctrine.orm.naming_strategy.underscore'))); - } - - public function testSingleEMSetCustomFunctions() - { - $container = $this->getContainer(array('YamlBundle')); - - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - $this->loadFromFile($container, 'orm_single_em_dql_functions'); - $this->compileContainer($container); - - $definition = $container->getDefinition('doctrine.orm.default_configuration'); - $this->assertDICDefinitionMethodCallOnce($definition, 'addCustomStringFunction', array('test_string', 'Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestStringFunction')); - } - - public function testAddCustomHydrationMode() - { - $container = $this->getContainer(array('YamlBundle')); - - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - $this->loadFromFile($container, 'orm_hydration_mode'); - $this->compileContainer($container); - - $definition = $container->getDefinition('doctrine.orm.default_configuration'); - $this->assertDICDefinitionMethodCallOnce($definition, 'addCustomHydrationMode', array('test_hydrator', 'Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestHydrator')); - } - - public function testAddFilter() - { - $container = $this->getContainer(array('YamlBundle')); - - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - - $this->loadFromFile($container, 'orm_filters'); - $this->compileContainer($container); - - $definition = $container->getDefinition('doctrine.orm.default_configuration'); - $this->assertDICDefinitionMethodCallOnce($definition, 'addFilter', array('soft_delete', 'Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection\TestFilter')); - - $definition = $container->getDefinition('doctrine.orm.default_manager_configurator'); - $this->assertDICConstructorArguments($definition, array(array('soft_delete'))); - - // Let's create the instance to check the configurator work. - /** @var $entityManager \Doctrine\ORM\EntityManager */ - $entityManager = $container->get('doctrine.orm.entity_manager'); - $this->assertCount(1, $entityManager->getFilters()->getEnabledFilters()); - } - - public function testResolveTargetEntity() - { - $container = $this->getContainer(array('YamlBundle')); - - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - - $this->loadFromFile($container, 'orm_resolve_target_entity'); - $this->compileContainer($container); - - $definition = $container->getDefinition('doctrine.orm.listeners.resolve_target_entity'); - $this->assertDICDefinitionMethodCallOnce($definition, 'addResolveTargetEntity', array('Symfony\Component\Security\Core\User\UserInterface', 'MyUserClass', array())); - $this->assertEquals(array('doctrine.event_listener' => array( array('event' => 'loadClassMetadata') ) ), $definition->getTags()); - } - - public function testDbalSchemaFilter() - { - $container = $this->getContainer(); - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - - $this->loadFromFile($container, 'dbal_schema_filter'); - - $this->compileContainer($container); - - $definition = $container->getDefinition('doctrine.dbal.default_connection.configuration'); - $this->assertDICDefinitionMethodCallOnce($definition, 'setFilterSchemaAssetsExpression', array('^sf2_')); - } - - protected function getContainer($bundles = 'YamlBundle', $vendor = null) - { - $bundles = (array) $bundles; - - $map = array(); - foreach ($bundles as $bundle) { - require_once __DIR__.'/Fixtures/Bundles/'.($vendor ? $vendor.'/' : '').$bundle.'/'.$bundle.'.php'; - - $map[$bundle] = 'Fixtures\\Bundles\\'.($vendor ? $vendor.'\\' : '').$bundle.'\\'.$bundle; - } - - return new ContainerBuilder(new ParameterBag(array( - 'kernel.debug' => false, - 'kernel.bundles' => $map, - 'kernel.cache_dir' => sys_get_temp_dir(), - 'kernel.environment' => 'test', - 'kernel.root_dir' => __DIR__.'/../../' // src dir - ))); - } - - /** - * Assertion on the Class of a DIC Service Definition. - * - * @param \Symfony\Component\DependencyInjection\Definition $definition - * @param string $expectedClass - */ - protected function assertDICDefinitionClass($definition, $expectedClass) - { - $this->assertEquals($expectedClass, $definition->getClass(), 'Expected Class of the DIC Container Service Definition is wrong.'); - } - - protected function assertDICConstructorArguments($definition, $args) - { - $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '".$definition->getClass()."' don't match."); - } - - protected function assertDICDefinitionMethodCallAt($pos, $definition, $methodName, array $params = null) - { - $calls = $definition->getMethodCalls(); - if (isset($calls[$pos][0])) { - $this->assertEquals($methodName, $calls[$pos][0], "Method '".$methodName."' is expected to be called at position $pos."); - - if ($params !== null) { - $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '".$methodName."' do not match the actual parameters."); - } - } - } - - /** - * Assertion for the DI Container, check if the given definition contains a method call with the given parameters. - * - * @param \Symfony\Component\DependencyInjection\Definition $definition - * @param string $methodName - * @param array $params - */ - protected function assertDICDefinitionMethodCallOnce($definition, $methodName, array $params = null) - { - $calls = $definition->getMethodCalls(); - $called = false; - foreach ($calls as $call) { - if ($call[0] == $methodName) { - if ($called) { - $this->fail("Method '".$methodName."' is expected to be called only once, a second call was registered though."); - } else { - $called = true; - if ($params !== null) { - $this->assertEquals($params, $call[1], "Expected parameters to methods '".$methodName."' do not match the actual parameters."); - } - } - } - } - if (!$called) { - $this->fail("Method '".$methodName."' is expected to be called once, definition does not contain a call though."); - } - } - - protected function compileContainer(ContainerBuilder $container) - { - $container->getCompilerPassConfig()->setOptimizationPasses(array(new ResolveDefinitionTemplatesPass())); - $container->getCompilerPassConfig()->setRemovingPasses(array()); - $container->compile(); - } - - protected function getConnectionConfig() - { - return array('dbal' => array('connections' => array('default' => array('password' => 'foo')))); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/AnnotationsBundle.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/AnnotationsBundle.php deleted file mode 100644 index c99a0bb..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/AnnotationsBundle.php +++ /dev/null @@ -1,21 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Fixtures\Bundles\AnnotationsBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; - -class AnnotationsBundle extends Bundle -{ -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/Entity/Test.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/Entity/Test.php deleted file mode 100644 index 9c2932c..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/Entity/Test.php +++ /dev/null @@ -1,19 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Fixtures\Bundles\AnnotationsBundle\Entity; - -class Test -{ -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/AnnotationsBundle.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/AnnotationsBundle.php deleted file mode 100644 index fe940e3..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/AnnotationsBundle.php +++ /dev/null @@ -1,21 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Fixtures\Bundles\Vendor\AnnotationsBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; - -class AnnotationsBundle extends Bundle -{ -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/Entity/Test.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/Entity/Test.php deleted file mode 100644 index 0dfe0f6..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/Entity/Test.php +++ /dev/null @@ -1,19 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Fixtures\Bundles\Vendor\AnnotationsBundle\Entity; - -class Test -{ -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Entity/Test.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Entity/Test.php deleted file mode 100644 index 770ab31..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Entity/Test.php +++ /dev/null @@ -1,19 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Fixtures\Bundles\XmlBundle\Entity; - -class Test -{ -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config/doctrine/Test.orm.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config/doctrine/Test.orm.xml deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/XmlBundle.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/XmlBundle.php deleted file mode 100644 index f14e909..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/XmlBundle.php +++ /dev/null @@ -1,21 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Fixtures\Bundles\XmlBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; - -class XmlBundle extends Bundle -{ -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/Entity/Test.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/Entity/Test.php deleted file mode 100644 index 9eb004c..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/Entity/Test.php +++ /dev/null @@ -1,20 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Fixtures\Bundles\YamlBundle\Entity; - -class Test -{ - private $id; -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/Resources/config/doctrine/Test.orm.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/Resources/config/doctrine/Test.orm.yml deleted file mode 100644 index 6ac8c14..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/Resources/config/doctrine/Test.orm.yml +++ /dev/null @@ -1,5 +0,0 @@ -Fixtures\Bundles\YamlBundle\Entity\Test: - type: entity - id: - id: - type: integer diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/YamlBundle.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/YamlBundle.php deleted file mode 100644 index 8b9fea0..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/YamlBundle.php +++ /dev/null @@ -1,21 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Fixtures\Bundles\YamlBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; - -class YamlBundle extends Bundle -{ -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_logging.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_logging.xml deleted file mode 100644 index b7b17b4..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_logging.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_schema_filter.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_schema_filter.xml deleted file mode 100644 index 2a897bb..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_schema_filter.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_service_multiple_connections.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_service_multiple_connections.xml deleted file mode 100644 index acfa896..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_service_multiple_connections.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_service_single_connection.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_service_single_connection.xml deleted file mode 100644 index fada4ad..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_service_single_connection.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_service_single_master_slave_connection.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_service_single_master_slave_connection.xml deleted file mode 100644 index 1b31a4c..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_service_single_master_slave_connection.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_types.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_types.xml deleted file mode 100644 index 368cc89..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_types.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestType - - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_filters.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_filters.xml deleted file mode 100644 index 913a10e..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_filters.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection\TestFilter - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_functions.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_functions.xml deleted file mode 100644 index 7bbdf7a..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_functions.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestStringFunction - Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestNumericFunction - Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestDatetimeFunction - - - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_hydration_mode.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_hydration_mode.xml deleted file mode 100644 index b6ceb83..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_hydration_mode.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestHydrator - - - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_imports.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_imports.xml deleted file mode 100644 index 20e9b25..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_imports.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_imports_import.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_imports_import.xml deleted file mode 100644 index de649bf..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_imports_import.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_multiple_em_bundle_mappings.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_multiple_em_bundle_mappings.xml deleted file mode 100644 index 65312da..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_multiple_em_bundle_mappings.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_namingstrategy.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_namingstrategy.xml deleted file mode 100644 index 43a49ee..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_namingstrategy.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_proxy.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_proxy.xml deleted file mode 100644 index 96208dd..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_proxy.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_resolve_target_entity.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_resolve_target_entity.xml deleted file mode 100644 index 6890cd0..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_resolve_target_entity.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - MyUserClass - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_service_multiple_entity_managers.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_service_multiple_entity_managers.xml deleted file mode 100644 index 9c3b840..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_service_multiple_entity_managers.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Proxies - - - - - - - - - - - - - - - - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_service_simple_single_entity_manager.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_service_simple_single_entity_manager.xml deleted file mode 100644 index 0870542..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_service_simple_single_entity_manager.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - Doctrine\Common\Cache\MemcacheCache - localhost - 11211 - Memcache - - - - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_service_single_entity_manager.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_service_single_entity_manager.xml deleted file mode 100644 index bd64743..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_service_single_entity_manager.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - Proxies - - - - - - - - - - - Doctrine\Common\Cache\MemcacheCache - localhost - 11211 - Memcache - - - - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_single_em_bundle_mappings.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_single_em_bundle_mappings.xml deleted file mode 100644 index 5ea5b2f..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_single_em_bundle_mappings.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_single_em_dql_functions.xml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_single_em_dql_functions.xml deleted file mode 100644 index 0ed15d1..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_single_em_dql_functions.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestStringFunction - - - - diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_logging.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_logging.yml deleted file mode 100644 index ee8ef26..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_logging.yml +++ /dev/null @@ -1,13 +0,0 @@ -doctrine: - dbal: - default_connection: mysql - connections: - log: - logging: true - profiling: false - profile: - logging: false - profiling: true - both: - logging: true - profiling: true diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_schema_filter.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_schema_filter.yml deleted file mode 100644 index aa8f008..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_schema_filter.yml +++ /dev/null @@ -1,3 +0,0 @@ -doctrine: - dbal: - schema_filter: ^sf2_ \ No newline at end of file diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_service_multiple_connections.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_service_multiple_connections.yml deleted file mode 100644 index a01101d..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_service_multiple_connections.yml +++ /dev/null @@ -1,18 +0,0 @@ -doctrine: - dbal: - default_connection: mysql - connections: - mysql: - dbname: mysql_db - user: mysql_user - password: mysql_s3cr3t - unix_socket: /path/to/mysqld.sock - sqlite: - driver: pdo_sqlite - memory: true - oci: - driver: oci8 - dbname: oracle_db - user: oracle_user - password: oracle_s3cr3t - charset: utf8 diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_service_single_connection.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_service_single_connection.yml deleted file mode 100644 index 9db7c37..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_service_single_connection.yml +++ /dev/null @@ -1,6 +0,0 @@ -doctrine: - dbal: - dbname: mysql_db - user: mysql_user - password: mysql_s3cr3t - unix_socket: /path/to/mysqld.sock diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_service_single_master_slave_connection.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_service_single_master_slave_connection.yml deleted file mode 100644 index c7f05f6..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_service_single_master_slave_connection.yml +++ /dev/null @@ -1,12 +0,0 @@ -doctrine: - dbal: - dbname: mysql_db - user: mysql_user - password: mysql_s3cr3t - unix_socket: /path/to/mysqld.sock - slaves: - slave1: - user: slave_user - dbname: slave_db - password: slave_s3cr3t - unix_socket: /path/to/mysqld_slave.sock diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_types.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_types.yml deleted file mode 100644 index 1e86dc4..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_types.yml +++ /dev/null @@ -1,7 +0,0 @@ -doctrine: - dbal: - default_connection: default - types: - test: Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestType - connections: - default: ~ diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_filters.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_filters.yml deleted file mode 100644 index aa85341..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_filters.yml +++ /dev/null @@ -1,12 +0,0 @@ -doctrine: - dbal: - default_connection: default - connections: - default: - dbname: db - - orm: - filters: - soft_delete: - class: Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection\TestFilter - enabled: true diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_functions.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_functions.yml deleted file mode 100644 index 2185305..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_functions.yml +++ /dev/null @@ -1,19 +0,0 @@ -doctrine: - dbal: - default_connection: default - connections: - default: - dbname: db - - orm: - entity_managers: - default: - mappings: - YamlBundle: ~ - dql: - string_functions: - test_string: Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestStringFunction - numeric_functions: - test_numeric: Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestNumericFunction - datetime_functions: - test_datetime: Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestDatetimeFunction diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_hydration_mode.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_hydration_mode.yml deleted file mode 100644 index 6d81a5b..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_hydration_mode.yml +++ /dev/null @@ -1,14 +0,0 @@ -doctrine: - dbal: - default_connection: default - connections: - default: - dbname: db - - orm: - entity_managers: - default: - hydrators: - test_hydrator: Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestHydrator - mappings: - YamlBundle: ~ diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_imports.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_imports.yml deleted file mode 100644 index df87945..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_imports.yml +++ /dev/null @@ -1,6 +0,0 @@ -imports: - - { resource: orm_imports_import.yml } - -doctrine: - orm: - auto_generate_proxy_classes: true diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_imports_import.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_imports_import.yml deleted file mode 100644 index c533c1e..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_imports_import.yml +++ /dev/null @@ -1,15 +0,0 @@ -doctrine: - dbal: - default_connection: default - connections: - default: - dbname: db - - orm: - auto_generate_proxy_classes: false - default_entity_manager: default - entity_managers: - default: - metadata_cache_driver: apc - mappings: - YamlBundle: ~ diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_multiple_em_bundle_mappings.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_multiple_em_bundle_mappings.yml deleted file mode 100644 index 320df94..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_multiple_em_bundle_mappings.yml +++ /dev/null @@ -1,23 +0,0 @@ -doctrine: - dbal: - default_connection: default - connections: - default: - dbname: db - - orm: - default_entity_manager: em2 - entity_managers: - em1: - mappings: - AnnotationsBundle: ~ - em2: - mappings: - YamlBundle: - dir: Resources/config/doctrine - alias: yml - manual: - type: xml - prefix: Fixtures\Bundles\XmlBundle - dir: %kernel.root_dir%/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config/doctrine - alias: TestAlias diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_namingstrategy.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_namingstrategy.yml deleted file mode 100644 index 95345bb..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_namingstrategy.yml +++ /dev/null @@ -1,18 +0,0 @@ -doctrine: - dbal: - default_connection: default - connections: - default: - dbname: db - - orm: - default_entity_manager: em1 - entity_managers: - em1: - mappings: - YamlBundle: ~ - naming_strategy: doctrine.orm.naming_strategy.default - em2: - mappings: - YamlBundle: ~ - naming_strategy: doctrine.orm.naming_strategy.underscore diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_resolve_target_entity.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_resolve_target_entity.yml deleted file mode 100644 index 4bdbedd..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_resolve_target_entity.yml +++ /dev/null @@ -1,10 +0,0 @@ -doctrine: - dbal: - default_connection: default - connections: - default: - dbname: db - - orm: - resolve_target_entities: - Symfony\Component\Security\Core\User\UserInterface: MyUserClass diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_service_multiple_entity_managers.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_service_multiple_entity_managers.yml deleted file mode 100644 index 31b9cc1..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_service_multiple_entity_managers.yml +++ /dev/null @@ -1,34 +0,0 @@ -parameters: - doctrine.orm.proxy_namespace: Proxies - -doctrine: - dbal: - default_connection: conn1 - connections: - conn1: - driver: pdo_sqlite - dbname: sqlite_db - user: sqlite_user - password: sqlite_s3cr3t - memory: true - conn2: - driver: pdo_sqlite - dbname: sqlite_db - user: sqlite_user - password: sqlite_s3cr3t - memory: true - - orm: - default_entity_manager: em2 - auto_generate_proxy_classes: true - entity_managers: - em1: - metadata_cache_driver: xcache - connection: conn1 - mappings: - YamlBundle: ~ - em2: - metadata_cache_driver: apc - connection: conn2 - mappings: - YamlBundle: ~ diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_service_simple_single_entity_manager.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_service_simple_single_entity_manager.yml deleted file mode 100644 index b2082a5..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_service_simple_single_entity_manager.yml +++ /dev/null @@ -1,19 +0,0 @@ -doctrine: - dbal: - default_connection: default - connections: - default: - dbname: db - - orm: - default_entity_manager: default - entity_managers: - default: - mappings: - YamlBundle: ~ - metadata_cache_driver: - type: memcache - class: Doctrine\Common\Cache\MemcacheCache - host: localhost - port: 11211 - instance_class: Memcache diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_service_single_entity_manager.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_service_single_entity_manager.yml deleted file mode 100644 index 9f81981..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_service_single_entity_manager.yml +++ /dev/null @@ -1,27 +0,0 @@ -doctrine: - dbal: - default_connection: default - connections: - default: - driver: pdo_sqlite - dbname: sqlite_db - user: sqlite_user - password: sqlite_s3cr3t - memory: true - - orm: - default_entity_manager: dm2 - proxy_namespace: Proxies - auto_generate_proxy_classes: true - entity_managers: - default: - connection: default - default_repository_class: Acme\Doctrine\Repository - mappings: - YamlBundle: ~ - metadata_cache_driver: - type: memcache - class: Doctrine\Common\Cache\MemcacheCache - host: localhost - port: 11211 - instance_class: Memcache diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_single_em_bundle_mappings.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_single_em_bundle_mappings.yml deleted file mode 100644 index bf4a199..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_single_em_bundle_mappings.yml +++ /dev/null @@ -1,18 +0,0 @@ -doctrine: - dbal: - default_connection: default - connections: - default: - dbname: db - - orm: - mappings: - AnnotationsBundle: ~ - YamlBundle: - dir: Resources/config/doctrine - alias: yml - manual: - type: xml - prefix: Fixtures\Bundles\XmlBundle - dir: %kernel.root_dir%/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config/doctrine - alias: TestAlias diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_single_em_dql_functions.yml b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_single_em_dql_functions.yml deleted file mode 100644 index 9bcec3c..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_single_em_dql_functions.yml +++ /dev/null @@ -1,11 +0,0 @@ -doctrine: - dbal: - default_connection: default - connections: - default: - dbname: db - - orm: - dql: - string_functions: - test_string: Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestStringFunction diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/TestDatetimeFunction.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/TestDatetimeFunction.php deleted file mode 100644 index 02ed7e0..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/TestDatetimeFunction.php +++ /dev/null @@ -1,32 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection; - -use Doctrine\ORM\Query\AST\Functions\FunctionNode; -use Doctrine\ORM\Query\SqlWalker; -use Doctrine\ORM\Query\Parser; - -class TestDatetimeFunction extends FunctionNode -{ - public function getSql(SqlWalker $sqlWalker) - { - return ''; - } - - public function parse(Parser $parser) - { - return ''; - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/TestFilter.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/TestFilter.php deleted file mode 100644 index 63b5bee..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/TestFilter.php +++ /dev/null @@ -1,30 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection; - -use Doctrine\ORM\Query\Filter\SQLFilter; -use Doctrine\ORM\Mapping\ClassMetadata; - -class TestFilter extends SQLFilter -{ - /** - * Gets the SQL query part to add to a query. - * - * @return string The constraint SQL if there is available, empty string otherwise - */ - public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias) - { - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/TestNumericFunction.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/TestNumericFunction.php deleted file mode 100644 index dd5d865..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/TestNumericFunction.php +++ /dev/null @@ -1,32 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection; - -use Doctrine\ORM\Query\AST\Functions\FunctionNode; -use Doctrine\ORM\Query\SqlWalker; -use Doctrine\ORM\Query\Parser; - -class TestNumericFunction extends FunctionNode -{ - public function getSql(SqlWalker $sqlWalker) - { - return ''; - } - - public function parse(Parser $parser) - { - return ''; - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/TestStringFunction.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/TestStringFunction.php deleted file mode 100644 index 8831482..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/TestStringFunction.php +++ /dev/null @@ -1,32 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection; - -use Doctrine\ORM\Query\AST\Functions\FunctionNode; -use Doctrine\ORM\Query\SqlWalker; -use Doctrine\ORM\Query\Parser; - -class TestStringFunction extends FunctionNode -{ - public function getSql(SqlWalker $sqlWalker) - { - return ''; - } - - public function parse(Parser $parser) - { - return ''; - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/TestType.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/TestType.php deleted file mode 100644 index 18f6b0f..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/TestType.php +++ /dev/null @@ -1,30 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -class TestType extends \Doctrine\DBAL\Types\Type -{ - public function getName() - { - return 'test'; - } - - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return ''; - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/XMLSchemaTest.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/XMLSchemaTest.php deleted file mode 100644 index 9bb17af..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/XMLSchemaTest.php +++ /dev/null @@ -1,71 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection; - -class XMLSchemaTest extends \PHPUnit_Framework_TestCase -{ - static public function dataValidateSchemaFiles() - { - $schemaFiles = array(); - $di = new \DirectoryIterator(__DIR__."/Fixtures/config/xml"); - foreach ($di as $element) { - if ($element->isFile() && substr($element->getFilename(), -4) === ".xml") { - $schemaFiles[] = array($element->getPathname()); - } - } - - return $schemaFiles; - } - - /** - * @dataProvider dataValidateSchemaFiles - */ - public function testValidateSchema($file) - { - $found = false; - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->load($file); - - $xmlns = "http://symfony.com/schema/dic/doctrine"; - - $dbalElements = $dom->getElementsByTagNameNS($xmlns, 'dbal'); - if ($dbalElements->length) { - $dbalDom = new \DOMDocument('1.0', 'UTF-8'); - $dbalNode = $dbalDom->importNode($dbalElements->item(0)); - $configNode = $dbalDom->createElementNS($xmlns, 'config'); - $configNode->appendChild($dbalNode); - $dbalDom->appendChild($configNode); - - $ret = $dbalDom->schemaValidate(__DIR__."/../../Resources/config/schema/doctrine-1.0.xsd"); - $this->assertTrue($ret, "DoctrineBundle Dependency Injection XMLSchema did not validate this XML instance."); - $found = true; - } - - $ormElements = $dom->getElementsByTagNameNS($xmlns, 'orm'); - if ($ormElements->length) { - $ormDom = new \DOMDocument('1.0', 'UTF-8'); - $ormNode = $ormDom->importNode($ormElements->item(0)); - $configNode = $ormDom->createElementNS($xmlns, 'config'); - $configNode->appendChild($ormNode); - $ormDom->appendChild($configNode); - - $ret = $ormDom->schemaValidate(__DIR__."/../../Resources/config/schema/doctrine-1.0.xsd"); - $this->assertTrue($ret, "DoctrineBundle Dependency Injection XMLSchema did not validate this XML instance."); - $found = true; - } - - $this->assertTrue($found, "Neither nor elements found in given XML. Are namespaces configured correctly?"); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/XmlDoctrineExtensionTest.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/XmlDoctrineExtensionTest.php deleted file mode 100644 index 4b787fb..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/XmlDoctrineExtensionTest.php +++ /dev/null @@ -1,28 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\Config\FileLocator; - -class XmlDoctrineExtensionTest extends AbstractDoctrineExtensionTest -{ - protected function loadFromFile(ContainerBuilder $container, $file) - { - $loadXml = new XmlFileLoader($container, new FileLocator(__DIR__.'/Fixtures/config/xml')); - $loadXml->load($file.'.xml'); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/YamlDoctrineExtensionTest.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/YamlDoctrineExtensionTest.php deleted file mode 100644 index 2a96bd5..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/DependencyInjection/YamlDoctrineExtensionTest.php +++ /dev/null @@ -1,28 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; -use Symfony\Component\Config\FileLocator; - -class YamlDoctrineExtensionTest extends AbstractDoctrineExtensionTest -{ - protected function loadFromFile(ContainerBuilder $container, $file) - { - $loadYaml = new YamlFileLoader($container, new FileLocator(__DIR__.'/Fixtures/config/yml')); - $loadYaml->load($file.'.yml'); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/Mapping/MetadataFactoryTest.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/Mapping/MetadataFactoryTest.php deleted file mode 100644 index b226336..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/Mapping/MetadataFactoryTest.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Tests; - -use Doctrine\Bundle\DoctrineBundle\Tests\TestCase; -use Doctrine\Bundle\DoctrineBundle\Mapping\MetadataFactory; -use Doctrine\Bundle\DoctrineBundle\Mapping\ClassMetadataCollection; -use Doctrine\ORM\Mapping\ClassMetadataInfo; - -class MetadataFactoryTest extends TestCase -{ - protected function setUp() - { - parent::setUp(); - - if (!class_exists('Doctrine\\ORM\\Version')) { - $this->markTestSkipped('Doctrine ORM is not available.'); - } - } - - public function testFindNamespaceAndPathForMetadata() - { - $class = new ClassMetadataInfo(__CLASS__); - $collection = new ClassMetadataCollection(array($class)); - - $registry = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry'); - $factory = new MetadataFactory($registry); - - $this->setExpectedException("RuntimeException", "Can't find base path for \"Doctrine\Bundle\DoctrineBundle\Tests\MetadataFactoryTest"); - $factory->findNamespaceAndPathForMetadata($collection); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/RegistryTest.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/RegistryTest.php deleted file mode 100644 index 9d1003d..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/RegistryTest.php +++ /dev/null @@ -1,149 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Tests; - -use Doctrine\Bundle\DoctrineBundle\Registry; - -class RegistryTest extends TestCase -{ - public function testGetDefaultConnectionName() - { - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - $registry = new Registry($container, array(), array(), 'default', 'default'); - - $this->assertEquals('default', $registry->getDefaultConnectionName()); - } - - public function testGetDefaultEntityManagerName() - { - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - $registry = new Registry($container, array(), array(), 'default', 'default'); - - $this->assertEquals('default', $registry->getDefaultEntityManagerName()); - } - - public function testGetDefaultConnection() - { - $conn = $this->getMock('Doctrine\DBAL\Connection', array(), array(), '', false); - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - $container->expects($this->once()) - ->method('get') - ->with($this->equalTo('doctrine.dbal.default_connection')) - ->will($this->returnValue($conn)); - - $registry = new Registry($container, array('default' => 'doctrine.dbal.default_connection'), array(), 'default', 'default'); - - $this->assertSame($conn, $registry->getConnection()); - } - - public function testGetConnection() - { - $conn = $this->getMock('Doctrine\DBAL\Connection', array(), array(), '', false); - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - $container->expects($this->once()) - ->method('get') - ->with($this->equalTo('doctrine.dbal.default_connection')) - ->will($this->returnValue($conn)); - - $registry = new Registry($container, array('default' => 'doctrine.dbal.default_connection'), array(), 'default', 'default'); - - $this->assertSame($conn, $registry->getConnection('default')); - } - - public function testGetUnknownConnection() - { - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - $registry = new Registry($container, array(), array(), 'default', 'default'); - - $this->setExpectedException('InvalidArgumentException', 'Doctrine ORM Connection named "default" does not exist.'); - $registry->getConnection('default'); - } - - public function testGetConnectionNames() - { - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - $registry = new Registry($container, array('default' => 'doctrine.dbal.default_connection'), array(), 'default', 'default'); - - $this->assertEquals(array('default' => 'doctrine.dbal.default_connection'), $registry->getConnectionNames()); - } - - public function testGetDefaultEntityManager() - { - $em = new \stdClass(); - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - $container->expects($this->once()) - ->method('get') - ->with($this->equalTo('doctrine.orm.default_entity_manager')) - ->will($this->returnValue($em)); - - $registry = new Registry($container, array(), array('default' => 'doctrine.orm.default_entity_manager'), 'default', 'default'); - - $this->assertSame($em, $registry->getEntityManager()); - } - - public function testGetEntityManager() - { - $em = new \stdClass(); - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - $container->expects($this->once()) - ->method('get') - ->with($this->equalTo('doctrine.orm.default_entity_manager')) - ->will($this->returnValue($em)); - - $registry = new Registry($container, array(), array('default' => 'doctrine.orm.default_entity_manager'), 'default', 'default'); - - $this->assertSame($em, $registry->getEntityManager('default')); - } - - public function testGetUnknownEntityManager() - { - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - $registry = new Registry($container, array(), array(), 'default', 'default'); - - $this->setExpectedException('InvalidArgumentException', 'Doctrine ORM Manager named "default" does not exist.'); - $registry->getEntityManager('default'); - } - - public function testResetDefaultEntityManager() - { - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - $container->expects($this->once()) - ->method('set') - ->with($this->equalTo('doctrine.orm.default_entity_manager'), $this->equalTo(null)); - - $registry = new Registry($container, array(), array('default' => 'doctrine.orm.default_entity_manager'), 'default', 'default'); - $registry->resetEntityManager(); - } - - public function testResetEntityManager() - { - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - $container->expects($this->once()) - ->method('set') - ->with($this->equalTo('doctrine.orm.default_entity_manager'), $this->equalTo(null)); - - $registry = new Registry($container, array(), array('default' => 'doctrine.orm.default_entity_manager'), 'default', 'default'); - $registry->resetEntityManager('default'); - } - - public function testResetUnknownEntityManager() - { - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - $registry = new Registry($container, array(), array(), 'default', 'default'); - - $this->setExpectedException('InvalidArgumentException', 'Doctrine ORM Manager named "default" does not exist.'); - $registry->resetEntityManager('default'); - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/TestCase.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/TestCase.php deleted file mode 100644 index b8857d8..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/TestCase.php +++ /dev/null @@ -1,83 +0,0 @@ - - * (c) Doctrine Project, Benjamin Eberlei - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Doctrine\Bundle\DoctrineBundle\Tests; - -use Doctrine\Common\Annotations\AnnotationReader; -use Doctrine\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; -use Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass; -use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterEventListenersAndSubscribersPass; - -class TestCase extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!class_exists('Doctrine\\Common\\Version')) { - $this->markTestSkipped('Doctrine is not available.'); - } - } - - public function createYamlBundleTestContainer() - { - $container = new ContainerBuilder(new ParameterBag(array( - 'kernel.debug' => false, - 'kernel.bundles' => array('YamlBundle' => 'Fixtures\Bundles\YamlBundle\YamlBundle'), - 'kernel.cache_dir' => sys_get_temp_dir(), - 'kernel.environment' => 'test', - 'kernel.root_dir' => __DIR__.'/../../../../' // src dir - ))); - $container->set('annotation_reader', new AnnotationReader()); - $loader = new DoctrineExtension(); - $container->registerExtension($loader); - $loader->load(array(array( - 'dbal' => array( - 'connections' => array( - 'default' => array( - 'driver' => 'pdo_mysql', - 'charset' => 'UTF8', - 'platform-service' => 'my.platform', - ) - ), - 'default_connection' => 'default', - 'types' => array( - 'test' => 'Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestType', - ), - ), 'orm' => array( - 'default_entity_manager' => 'default', - 'entity_managers' => array ( - 'default' => array( - 'mappings' => array('YamlBundle' => array( - 'type' => 'yml', - 'dir' => __DIR__.'/DependencyInjection/Fixtures/Bundles/YamlBundle/Resources/config/doctrine', - 'prefix' => 'Fixtures\Bundles\YamlBundle\Entity', - ) - ))), - 'resolve_target_entities' => array( - 'Symfony\Component\Security\Core\User\UserInterface' => 'stdClass', - ), - ) - )), $container); - - $container->setDefinition('my.platform', new \Symfony\Component\DependencyInjection\Definition('Doctrine\DBAL\Platforms\MySqlPlatform')); - - $container->getCompilerPassConfig()->setOptimizationPasses(array(new ResolveDefinitionTemplatesPass())); - $container->getCompilerPassConfig()->setRemovingPasses(array()); - $container->compile(); - - return $container; - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/bootstrap.php b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/bootstrap.php deleted file mode 100644 index 2598748..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/bootstrap.php +++ /dev/null @@ -1,8 +0,0 @@ -=5.3.2", - "symfony/framework-bundle": "2.1.*", - "symfony/doctrine-bridge": "2.1.*", - "doctrine/dbal": ">=2.2,<2.4-dev" - }, - "require-dev": { - "doctrine/orm": ">=2.2,<2.4-dev", - "symfony/yaml": "2.1.*", - "symfony/validator": "2.1.*" - }, - "suggest": { - "doctrine/orm": "The Doctrine ORM integration is optional in the bundle." - }, - "autoload": { - "psr-0": { "Doctrine\\Bundle\\DoctrineBundle": "" } - }, - "target-dir": "Doctrine/Bundle/DoctrineBundle", - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/phpunit.xml.dist b/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/phpunit.xml.dist deleted file mode 100644 index d401031..0000000 --- a/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/phpunit.xml.dist +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - ./Tests - - - - - - benchmark - - - - - - . - - ./Resources - ./Tests - - - - diff --git a/vendor/doctrine/doctrine-migrations-bundle/Doctrine/Bundle/MigrationsBundle b/vendor/doctrine/doctrine-migrations-bundle/Doctrine/Bundle/MigrationsBundle deleted file mode 160000 index 3792aa7..0000000 --- a/vendor/doctrine/doctrine-migrations-bundle/Doctrine/Bundle/MigrationsBundle +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3792aa78445773387754c6853bbd7f4dcb31f486 diff --git a/vendor/doctrine/migrations b/vendor/doctrine/migrations deleted file mode 160000 index b86b4cc..0000000 --- a/vendor/doctrine/migrations +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b86b4cc0a39714f0aa53b908d495beacfa0e4011 diff --git a/vendor/doctrine/orm/.gitignore b/vendor/doctrine/orm/.gitignore deleted file mode 100644 index a918417..0000000 --- a/vendor/doctrine/orm/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -build/ -logs/ -reports/ -dist/ -download/ -lib/api/ -lib/Doctrine/Common -lib/Doctrine/DBAL -/.settings/ -.buildpath -.project diff --git a/vendor/doctrine/orm/.gitmodules b/vendor/doctrine/orm/.gitmodules deleted file mode 100644 index 21a1fb2..0000000 --- a/vendor/doctrine/orm/.gitmodules +++ /dev/null @@ -1,15 +0,0 @@ -[submodule "lib/vendor/doctrine-common"] - path = lib/vendor/doctrine-common - url = git://github.com/doctrine/common.git -[submodule "lib/vendor/doctrine-dbal"] - path = lib/vendor/doctrine-dbal - url = git://github.com/doctrine/dbal.git -[submodule "lib/vendor/Symfony/Component/Console"] - path = lib/vendor/Symfony/Component/Console - url = git://github.com/symfony/Console.git -[submodule "lib/vendor/Symfony/Component/Yaml"] - path = lib/vendor/Symfony/Component/Yaml - url = git://github.com/symfony/Yaml.git -[submodule "lib/vendor/doctrine-build-common"] - path = lib/vendor/doctrine-build-common - url = https://github.com/doctrine/doctrine-build-common.git diff --git a/vendor/doctrine/orm/.travis.yml b/vendor/doctrine/orm/.travis.yml deleted file mode 100644 index 716b9b6..0000000 --- a/vendor/doctrine/orm/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: php - -php: - - 5.3 - - 5.4 -env: - - DB=mysql - - DB=pgsql - - DB=sqlite - -before_script: - - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS doctrine_tests;' -U postgres; fi" - - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS doctrine_tests_tmp;' -U postgres; fi" - - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'create database doctrine_tests;' -U postgres; fi" - - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'create database doctrine_tests_tmp;' -U postgres; fi" - - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS doctrine_tests_tmp;create database IF NOT EXISTS doctrine_tests;'; fi" - - git submodule update --init - -script: phpunit --configuration tests/travis/$DB.travis.xml \ No newline at end of file diff --git a/vendor/doctrine/orm/LICENSE b/vendor/doctrine/orm/LICENSE deleted file mode 100644 index 1c03f74..0000000 --- a/vendor/doctrine/orm/LICENSE +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/vendor/doctrine/orm/README.markdown b/vendor/doctrine/orm/README.markdown deleted file mode 100644 index 00458ca..0000000 --- a/vendor/doctrine/orm/README.markdown +++ /dev/null @@ -1,18 +0,0 @@ -# Doctrine 2 ORM - -Master: [![Build Status](https://secure.travis-ci.org/doctrine/doctrine2.png?branch=master)](http://travis-ci.org/doctrine/doctrine2) -2.1.x: [![Build Status](https://secure.travis-ci.org/doctrine/doctrine2.png?branch=2.1.x)](http://travis-ci.org/doctrine/doctrine2) - -Doctrine 2 is an object-relational mapper (ORM) for PHP 5.3.2+ that provides transparent persistence -for PHP objects. It sits on top of a powerful database abstraction layer (DBAL). One of its key features -is the option to write database queries in a proprietary object oriented SQL dialect called Doctrine Query Language (DQL), -inspired by Hibernates HQL. This provides developers with a powerful alternative to SQL that maintains flexibility -without requiring unnecessary code duplication. - -## More resources: - -* [Website](http://www.doctrine-project.org) -* [Documentation](http://www.doctrine-project.org/projects/orm/2.0/docs/reference/introduction/en) -* [Issue Tracker](http://www.doctrine-project.org/jira/browse/DDC) -* [Downloads](http://github.com/doctrine/doctrine2/downloads) - diff --git a/vendor/doctrine/orm/UPGRADE_TO_2_0 b/vendor/doctrine/orm/UPGRADE_TO_2_0 deleted file mode 100644 index 1dcc807..0000000 --- a/vendor/doctrine/orm/UPGRADE_TO_2_0 +++ /dev/null @@ -1,240 +0,0 @@ -# Update from 2.0-BETA3 to 2.0-BETA4 - -## XML Driver element demoted to attribute - -We changed how the XML Driver allows to define the change-tracking-policy. The working case is now: - - - -# Update from 2.0-BETA2 to 2.0-BETA3 - -## Serialization of Uninitialized Proxies - -As of Beta3 you can now serialize uninitialized proxies, an exception will only be thrown when -trying to access methods on the unserialized proxy as long as it has not been re-attached to the -EntityManager using `EntityManager#merge()`. See this example: - - $proxy = $em->getReference('User', 1); - - $serializedProxy = serialize($proxy); - $detachedProxy = unserialized($serializedProxy); - - echo $em->contains($detachedProxy); // FALSE - - try { - $detachedProxy->getId(); // uninitialized detached proxy - } catch(Exception $e) { - - } - $attachedProxy = $em->merge($detachedProxy); - echo $attackedProxy->getId(); // works! - -## Changed SQL implementation of Postgres and Oracle DateTime types - -The DBAL Type "datetime" included the Timezone Offset in both Postgres and Oracle. As of this version they are now -generated without Timezone (TIMESTAMP WITHOUT TIME ZONE instead of TIMESTAMP WITH TIME ZONE). -See [this comment to Ticket DBAL-22](http://www.doctrine-project.org/jira/browse/DBAL-22?focusedCommentId=13396&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_13396) -for more details as well as migration issues for PostgreSQL and Oracle. - -Both Postgres and Oracle will throw Exceptions during hydration of Objects with "DateTime" fields unless migration steps are taken! - -## Removed multi-dot/deep-path expressions in DQL - -The support for implicit joins in DQL through the multi-dot/Deep Path Expressions -was dropped. For example: - - SELECT u FROM User u WHERE u.group.name = ?1 - -See the "u.group.id" here is using multi dots (deep expression) to walk -through the graph of objects and properties. Internally the DQL parser -would rewrite these queries to: - - SELECT u FROM User u JOIN u.group g WHERE g.name = ?1 - -This explicit notation will be the only supported notation as of now. The internal -handling of multi-dots in the DQL Parser was very complex, error prone in edge cases -and required special treatment for several features we added. Additionally -it had edge cases that could not be solved without making the DQL Parser -even much more complex. For this reason we will drop the support for the -deep path expressions to increase maintainability and overall performance -of the DQL parsing process. This will benefit any DQL query being parsed, -even those not using deep path expressions. - -Note that the generated SQL of both notations is exactly the same! You -don't loose anything through this. - -## Default Allocation Size for Sequences - -The default allocation size for sequences has been changed from 10 to 1. This step was made -to not cause confusion with users and also because it is partly some kind of premature optimization. - -# Update from 2.0-BETA1 to 2.0-BETA2 - -There are no backwards incompatible changes in this release. - -# Upgrade from 2.0-ALPHA4 to 2.0-BETA1 - -## EntityRepository deprecates access to protected variables - -Instead of accessing protected variables for the EntityManager in -a custom EntityRepository it is now required to use the getter methods -for all the three instance variables: - -* `$this->_em` now accessible through `$this->getEntityManager()` -* `$this->_class` now accessible through `$this->getClassMetadata()` -* `$this->_entityName` now accessible through `$this->getEntityName()` - -Important: For Beta 2 the protected visibility of these three properties will be -changed to private! - -## Console migrated to Symfony Console - -The Doctrine CLI has been replaced by Symfony Console Configuration - -Instead of having to specify: - - [php] - $cliConfig = new CliConfiguration(); - $cliConfig->setAttribute('em', $entityManager); - -You now have to configure the script like: - - [php] - $helperSet = new \Symfony\Components\Console\Helper\HelperSet(array( - 'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()), - 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em) - )); - -## Console: No need for Mapping Paths anymore - -In previous versions you had to specify the --from and --from-path options -to show where your mapping paths are from the console. However this information -is already known from the Mapping Driver configuration, so the requirement -for this options were dropped. - -Instead for each console command all the entities are loaded and to -restrict the operation to one or more sub-groups you can use the --filter flag. - -## AnnotationDriver is not a default mapping driver anymore - -In conjunction with the recent changes to Console we realized that the -annotations driver being a default metadata driver lead to lots of glue -code in the console components to detect where entities lie and how to load -them for batch updates like SchemaTool and other commands. However the -annotations driver being a default driver does not really help that much -anyways. - -Therefore we decided to break backwards compability in this issue and drop -the support for Annotations as Default Driver and require our users to -specify the driver explicitly (which allows us to ask for the path to all -entities). - -If you are using the annotations metadata driver as default driver, you -have to add the following lines to your bootstrap code: - - $driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__."/Entities")); - $config->setMetadataDriverImpl($driverImpl); - -You have to specify the path to your entities as either string of a single -path or array of multiple paths -to your entities. This information will be used by all console commands to -access all entities. - -Xml and Yaml Drivers work as before! - - -## New inversedBy attribute - -It is now *mandatory* that the owning side of a bidirectional association specifies the -'inversedBy' attribute that points to the name of the field on the inverse side that completes -the association. Example: - - [php] - // BEFORE (ALPHA4 AND EARLIER) - class User - { - //... - /** @OneToOne(targetEntity="Address", mappedBy="user") */ - private $address; - //... - } - class Address - { - //... - /** @OneToOne(targetEntity="User") */ - private $user; - //... - } - - // SINCE BETA1 - // User class DOES NOT CHANGE - class Address - { - //... - /** @OneToOne(targetEntity="User", inversedBy="address") */ - private $user; - //... - } - -Thus, the inversedBy attribute is the counterpart to the mappedBy attribute. This change -was necessary to enable some simplifications and further performance improvements. We -apologize for the inconvenience. - -## Default Property for Field Mappings - -The "default" option for database column defaults has been removed. If desired, database column defaults can -be implemented by using the columnDefinition attribute of the @Column annotation (or the approriate XML and YAML equivalents). -Prefer PHP default values, if possible. - -## Selecting Partial Objects - -Querying for partial objects now has a new syntax. The old syntax to query for partial objects -now has a different meaning. This is best illustrated by an example. If you previously -had a DQL query like this: - - [sql] - SELECT u.id, u.name FROM User u - -Since BETA1, simple state field path expressions in the select clause are used to select -object fields as plain scalar values (something that was not possible before). -To achieve the same result as previously (that is, a partial object with only id and name populated) -you need to use the following, explicit syntax: - - [sql] - SELECT PARTIAL u.{id,name} FROM User u - -## XML Mapping Driver - -The 'inheritance-type' attribute changed to take last bit of ClassMetadata constant names, i.e. -NONE, SINGLE_TABLE, INHERITANCE_TYPE_JOINED - -## YAML Mapping Driver - -The way to specify lifecycle callbacks in YAML Mapping driver was changed to allow for multiple callbacks -per event. The Old syntax ways: - - [yaml] - lifecycleCallbacks: - doStuffOnPrePersist: prePersist - doStuffOnPostPersist: postPersist - -The new syntax is: - - [yaml] - lifecycleCallbacks: - prePersist: [ doStuffOnPrePersist, doOtherStuffOnPrePersistToo ] - postPersist: [ doStuffOnPostPersist ] - -## PreUpdate Event Listeners - -Event Listeners listening to the 'preUpdate' event can only affect the primitive values of entity changesets -by using the API on the `PreUpdateEventArgs` instance passed to the preUpdate listener method. Any changes -to the state of the entitys properties won't affect the database UPDATE statement anymore. This gives drastic -performance benefits for the preUpdate event. - -## Collection API - -The Collection interface in the Common package has been updated with some missing methods -that were present only on the default implementation, ArrayCollection. Custom collection -implementations need to be updated to adhere to the updated interface. - diff --git a/vendor/doctrine/orm/UPGRADE_TO_2_1 b/vendor/doctrine/orm/UPGRADE_TO_2_1 deleted file mode 100644 index f422444..0000000 --- a/vendor/doctrine/orm/UPGRADE_TO_2_1 +++ /dev/null @@ -1,25 +0,0 @@ -This document details all the possible changes that you should investigate when updating -your project from Doctrine 2.0.x to 2.1 - -## Interface for EntityRepository - -The EntityRepository now has an interface Doctrine\Common\Persistence\ObjectRepository. This means that your classes that override EntityRepository and extend find(), findOneBy() or findBy() must be adjusted to follow this interface. - -## AnnotationReader changes - -The annotation reader was heavily refactored between 2.0 and 2.1-RC1. In theory the operation of the new reader should be backwards compatible, but it has to be setup differently to work that way: - - // new call to the AnnotationRegistry - \Doctrine\Common\Annotations\AnnotationRegistry::registerFile('/doctrine-src/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'); - - $reader = new \Doctrine\Common\Annotations\AnnotationReader(); - $reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\'); - // new code necessary starting here - $reader->setIgnoreNotImportedAnnotations(true); - $reader->setEnableParsePhpImports(false); - $reader = new \Doctrine\Common\Annotations\CachedReader( - new \Doctrine\Common\Annotations\IndexedReader($reader), new ArrayCache() - ); - -This is already done inside the ``$config->newDefaultAnnotationDriver``, so everything should automatically work if you are using this method. You can verify if everything still works by executing a console command such as schema-validate that loads all metadata into memory. - diff --git a/vendor/doctrine/orm/UPGRADE_TO_2_2 b/vendor/doctrine/orm/UPGRADE_TO_2_2 deleted file mode 100644 index 78e77d3..0000000 --- a/vendor/doctrine/orm/UPGRADE_TO_2_2 +++ /dev/null @@ -1,81 +0,0 @@ -# ResultCache implementation rewritten - -The result cache is completely rewritten and now works on the database result level, not inside the ORM AbstractQuery -anymore. This means that for result cached queries the hydration will now always be performed again, regardless of -the hydration mode. Affected areas are: - -1. Fixes the problem that entities coming from the result cache were not registered in the UnitOfWork - leading to problems during EntityManager#flush. Calls to EntityManager#merge are not necessary anymore. -2. Affects the array hydrator which now includes the overhead of hydration compared to caching the final result. - -The API is backwards compatible however most of the getter methods on the `AbstractQuery` object are now -deprecated in favor of calling AbstractQuery#getQueryCacheProfile(). This method returns a `Doctrine\DBAL\Cache\QueryCacheProfile` -instance with access to result cache driver, lifetime and cache key. - - -# EntityManager#getPartialReference() creates read-only entity - -Entities returned from EntityManager#getPartialReference() are now marked as read-only if they -haven't been in the identity map before. This means objects of this kind never lead to changes -in the UnitOfWork. - - -# Fields omitted in a partial DQL query or a native query are never updated - -Fields of an entity that are not returned from a partial DQL Query or native SQL query -will never be updated through an UPDATE statement. - - -# Removed support for onUpdate in @JoinColumn - -The onUpdate foreign key handling makes absolutely no sense in an ORM. Additionally Oracle doesn't even support it. Support for it is removed. - - -# Changes in Annotation Handling - -There have been some changes to the annotation handling in Common 2.2 again, that affect how people with old configurations -from 2.0 have to configure the annotation driver if they don't use `Configuration::newDefaultAnnotationDriver()`: - - // Register the ORM Annotations in the AnnotationRegistry - AnnotationRegistry::registerFile('path/to/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'); - - $reader = new \Doctrine\Common\Annotations\SimpleAnnotationReader(); - $reader->addNamespace('Doctrine\ORM\Mapping'); - $reader = new \Doctrine\Common\Annotations\CachedReader($reader, new ArrayCache()); - - $driver = new AnnotationDriver($reader, (array)$paths); - - $config->setMetadataDriverImpl($driver); - - -# Scalar mappings can now be ommitted from DQL result - -You are now allowed to mark scalar SELECT expressions as HIDDEN an they are not hydrated anymore. -Example: - -SELECT u, SUM(a.id) AS HIDDEN numArticles FROM User u LEFT JOIN u.Articles a ORDER BY numArticles DESC HAVING numArticles > 10 - -Your result will be a collection of Users, and not an array with key 0 as User object instance and "numArticles" as the number of articles per user - - -# Map entities as scalars in DQL result - -When hydrating to array or even a mixed result in object hydrator, previously you had the 0 index holding you entity instance. -You are now allowed to alias this, providing more flexibility for you code. -Example: - -SELECT u AS user FROM User u - -Will now return a collection of arrays with index "user" pointing to the User object instance. - - -# Performance optimizations - -Thousands of lines were completely reviewed and optimized for best performance. -Removed redundancy and improved code readability made now internal Doctrine code easier to understand. -Also, Doctrine 2.2 now is around 10-15% faster than 2.1. - -# EntityManager#find(null) - -Previously EntityManager#find(null) returned null. It now throws an exception. - diff --git a/vendor/doctrine/orm/UPGRADE_TO_ALPHA3 b/vendor/doctrine/orm/UPGRADE_TO_ALPHA3 deleted file mode 100644 index 3db76af..0000000 --- a/vendor/doctrine/orm/UPGRADE_TO_ALPHA3 +++ /dev/null @@ -1,35 +0,0 @@ -# Upgrade from 2.0-ALPHA2 to 2.0-ALPHA3 - -This section details the changes made to Doctrine 2.0-ALPHA3 to make it easier for you -to upgrade your projects to use this version. - -## CLI Changes - -The $args variable used in the cli-config.php for configuring the Doctrine CLI has been renamed to $globalArguments. - -## Proxy class changes - -You are now required to make supply some minimalist configuration with regards to proxy objects. That involves 2 new configuration options. First, the directory where generated proxy classes should be placed needs to be specified. Secondly, you need to configure the namespace used for proxy classes. The following snippet shows an example: - - [php] - // step 1: configure directory for proxy classes - // $config instanceof Doctrine\ORM\Configuration - $config->setProxyDir('/path/to/myproject/lib/MyProject/Generated/Proxies'); - $config->setProxyNamespace('MyProject\Generated\Proxies'); - -Note that proxy classes behave exactly like any other classes when it comes to class loading. Therefore you need to make sure the proxy classes can be loaded by some class loader. If you place the generated proxy classes in a namespace and directory under your projects class files, like in the example above, it would be sufficient to register the MyProject namespace on a class loader. Since the proxy classes are contained in that namespace and adhere to the standards for class loading, no additional work is required. -Generating the proxy classes into a namespace within your class library is the recommended setup. - -Entities with initialized proxy objects can now be serialized and unserialized properly from within the same application. - -For more details refer to the Configuration section of the manual. - -## Removed allowPartialObjects configuration option - -The allowPartialObjects configuration option together with the `Configuration#getAllowPartialObjects` and `Configuration#setAllowPartialObjects` methods have been removed. -The new behavior is as if the option were set to FALSE all the time, basically disallowing partial objects globally. However, you can still use the `Query::HINT_FORCE_PARTIAL_LOAD` query hint to force a query to return partial objects for optimization purposes. - -## Renamed Methods - -* Doctrine\ORM\Configuration#getCacheDir() to getProxyDir() -* Doctrine\ORM\Configuration#setCacheDir($dir) to setProxyDir($dir) \ No newline at end of file diff --git a/vendor/doctrine/orm/UPGRADE_TO_ALPHA4 b/vendor/doctrine/orm/UPGRADE_TO_ALPHA4 deleted file mode 100644 index 81a2ef6..0000000 --- a/vendor/doctrine/orm/UPGRADE_TO_ALPHA4 +++ /dev/null @@ -1,36 +0,0 @@ -# Upgrade from 2.0-ALPHA3 to 2.0-ALPHA4 - -## CLI Controller changes - -CLI main object changed its name and namespace. Renamed from Doctrine\ORM\Tools\Cli to Doctrine\Common\Cli\CliController. -Doctrine\Common\Cli\CliController now only deals with namespaces. Ready to go, Core, Dbal and Orm are available and you can subscribe new tasks by retrieving the namespace and including new task. Example: - - [php] - $cli->getNamespace('Core')->addTask('my-example', '\MyProject\Tools\Cli\Tasks\MyExampleTask'); - - -## CLI Tasks documentation - -Tasks have implemented a new way to build documentation. Although it is still possible to define the help manually by extending the basicHelp and extendedHelp, they are now optional. -With new required method AbstractTask::buildDocumentation, its implementation defines the TaskDocumentation instance (accessible through AbstractTask::getDocumentation()), basicHelp and extendedHelp are now not necessary to be implemented. - -## Changes in Method Signatures - - * A bunch of Methods on both Doctrine\DBAL\Platforms\AbstractPlatform and Doctrine\DBAL\Schema\AbstractSchemaManager - have changed quite significantly by adopting the new Schema instance objects. - -## Renamed Methods - - * Doctrine\ORM\AbstractQuery::setExpireResultCache() -> expireResultCache() - * Doctrine\ORM\Query::setExpireQueryCache() -> expireQueryCache() - -## SchemaTool Changes - - * "doctrine schema-tool --drop" now always drops the complete database instead of - only those tables defined by the current database model. The previous method had - problems when foreign keys of orphaned tables pointed to tables that were schedulded - for deletion. - * Use "doctrine schema-tool --update" to get a save incremental update for your - database schema without deleting any unused tables, sequences or foreign keys. - * Use "doctrine schema-tool --complete-update" to do a full incremental update of - your schema. diff --git a/vendor/doctrine/orm/bin/doctrine b/vendor/doctrine/orm/bin/doctrine deleted file mode 100644 index 92f323f..0000000 --- a/vendor/doctrine/orm/bin/doctrine +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env php -. - */ - -require_once 'Doctrine/Common/ClassLoader.php'; - -$classLoader = new \Doctrine\Common\ClassLoader('Doctrine'); -$classLoader->register(); - -$classLoader = new \Doctrine\Common\ClassLoader('Symfony', 'Doctrine'); -$classLoader->register(); - -$configFile = getcwd() . DIRECTORY_SEPARATOR . 'cli-config.php'; - -$helperSet = null; -if (file_exists($configFile)) { - if ( ! is_readable($configFile)) { - trigger_error( - 'Configuration file [' . $configFile . '] does not have read permission.', E_ERROR - ); - } - - require $configFile; - - foreach ($GLOBALS as $helperSetCandidate) { - if ($helperSetCandidate instanceof \Symfony\Component\Console\Helper\HelperSet) { - $helperSet = $helperSetCandidate; - break; - } - } -} - -$helperSet = ($helperSet) ?: new \Symfony\Component\Console\Helper\HelperSet(); - -\Doctrine\ORM\Tools\Console\ConsoleRunner::run($helperSet); diff --git a/vendor/doctrine/orm/build.properties b/vendor/doctrine/orm/build.properties deleted file mode 100644 index 37c834c..0000000 --- a/vendor/doctrine/orm/build.properties +++ /dev/null @@ -1,11 +0,0 @@ -# Project Name -project.name=DoctrineORM - -# Dependency minimum versions -dependencies.common=2.2.0beta1 -dependencies.dbal=2.2.0beta1 -dependencies.sfconsole=2.0.0 - -# Version class and file -project.version_class = Doctrine\ORM\Version -project.version_file = lib/Doctrine/ORM/Version.php diff --git a/vendor/doctrine/orm/build.properties.dev b/vendor/doctrine/orm/build.properties.dev deleted file mode 100644 index 20e91dc..0000000 --- a/vendor/doctrine/orm/build.properties.dev +++ /dev/null @@ -1,16 +0,0 @@ -version=2.0.0BETA2 -dependencies.common=2.0.0BETA4 -dependencies.dbal=2.0.0BETA4 -stability=beta -build.dir=build -dist.dir=dist -report.dir=reports -log.archive.dir=logs -project.pirum_dir= -project.download_dir= -project.xsd_dir= -test.phpunit_configuration_file= -test.phpunit_generate_coverage=0 -test.pmd_reports=0 -test.pdepend_exec= -test.phpmd_exec= \ No newline at end of file diff --git a/vendor/doctrine/orm/build.xml b/vendor/doctrine/orm/build.xml deleted file mode 100644 index 8b22f07..0000000 --- a/vendor/doctrine/orm/build.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DoctrineORM - Doctrine Object Relational Mapper - pear.doctrine-project.org - The Doctrine ORM package is the primary package containing the object relational mapper. - - - - - LGPL - - - - - - - - - - - - - script - Doctrine/Common/ - Doctrine/DBAL/ - Symfony/Component/Yaml/ - Symfony/Component/Console/ - - - - - - - - - - diff --git a/vendor/doctrine/orm/composer.json b/vendor/doctrine/orm/composer.json deleted file mode 100644 index 4f3f7b3..0000000 --- a/vendor/doctrine/orm/composer.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "doctrine/orm", - "type": "library", - "description": "Object-Relational-Mapper for PHP", - "keywords": ["orm", "database"], - "homepage": "http://www.doctrine-project.org", - "license": "LGPL", - "authors": [ - {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, - {"name": "Roman Borschel", "email": "roman@code-factory.org"}, - {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, - {"name": "Jonathan Wage", "email": "jonwage@gmail.com"} - ], - "require": { - "php": ">=5.3.2", - "ext-pdo": "*", - "doctrine/common": "2.2.*", - "doctrine/dbal": "2.2.*" - }, - "autoload": { - "psr-0": { "Doctrine\\ORM": "lib/" } - } -} diff --git a/vendor/doctrine/orm/doctrine-mapping.xsd b/vendor/doctrine/orm/doctrine-mapping.xsd deleted file mode 100644 index 8db612e..0000000 --- a/vendor/doctrine/orm/doctrine-mapping.xsd +++ /dev/null @@ -1,409 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php b/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php deleted file mode 100644 index 0dba9dc..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php +++ /dev/null @@ -1,820 +0,0 @@ -. - */ - -namespace Doctrine\ORM; - -use Doctrine\DBAL\Types\Type, - Doctrine\DBAL\Cache\QueryCacheProfile, - Doctrine\ORM\Query\QueryException, - Doctrine\ORM\Internal\Hydration\CacheHydrator; - -/** - * Base contract for ORM queries. Base class for Query and NativeQuery. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Konsta Vesterinen - */ -abstract class AbstractQuery -{ - /* Hydration mode constants */ - /** - * Hydrates an object graph. This is the default behavior. - */ - const HYDRATE_OBJECT = 1; - /** - * Hydrates an array graph. - */ - const HYDRATE_ARRAY = 2; - /** - * Hydrates a flat, rectangular result set with scalar values. - */ - const HYDRATE_SCALAR = 3; - /** - * Hydrates a single scalar value. - */ - const HYDRATE_SINGLE_SCALAR = 4; - - /** - * Very simple object hydrator (optimized for performance). - */ - const HYDRATE_SIMPLEOBJECT = 5; - - /** - * @var array The parameter map of this query. - */ - protected $_params = array(); - - /** - * @var array The parameter type map of this query. - */ - protected $_paramTypes = array(); - - /** - * @var ResultSetMapping The user-specified ResultSetMapping to use. - */ - protected $_resultSetMapping; - - /** - * @var \Doctrine\ORM\EntityManager The entity manager used by this query object. - */ - protected $_em; - - /** - * @var array The map of query hints. - */ - protected $_hints = array(); - - /** - * @var integer The hydration mode. - */ - protected $_hydrationMode = self::HYDRATE_OBJECT; - - /** - * @param \Doctrine\DBAL\Cache\QueryCacheProfile - */ - protected $_queryCacheProfile; - - /** - * @var boolean Boolean value that indicates whether or not expire the result cache. - */ - protected $_expireResultCache = false; - - /** - * @param \Doctrine\DBAL\Cache\QueryCacheProfile - */ - protected $_hydrationCacheProfile; - - /** - * Initializes a new instance of a class derived from AbstractQuery. - * - * @param \Doctrine\ORM\EntityManager $entityManager - */ - public function __construct(EntityManager $em) - { - $this->_em = $em; - } - - /** - * Retrieves the associated EntityManager of this Query instance. - * - * @return \Doctrine\ORM\EntityManager - */ - public function getEntityManager() - { - return $this->_em; - } - - /** - * Frees the resources used by the query object. - * - * Resets Parameters, Parameter Types and Query Hints. - * - * @return void - */ - public function free() - { - $this->_params = array(); - $this->_paramTypes = array(); - $this->_hints = array(); - } - - /** - * Get all defined parameters. - * - * @return array The defined query parameters. - */ - public function getParameters() - { - return $this->_params; - } - - /** - * Get all defined parameter types. - * - * @return array The defined query parameter types. - */ - public function getParameterTypes() - { - return $this->_paramTypes; - } - - /** - * Gets a query parameter. - * - * @param mixed $key The key (index or name) of the bound parameter. - * @return mixed The value of the bound parameter. - */ - public function getParameter($key) - { - if (isset($this->_params[$key])) { - return $this->_params[$key]; - } - - return null; - } - - /** - * Gets a query parameter type. - * - * @param mixed $key The key (index or name) of the bound parameter. - * @return mixed The parameter type of the bound parameter. - */ - public function getParameterType($key) - { - if (isset($this->_paramTypes[$key])) { - return $this->_paramTypes[$key]; - } - - return null; - } - - /** - * Gets the SQL query that corresponds to this query object. - * The returned SQL syntax depends on the connection driver that is used - * by this query object at the time of this method call. - * - * @return string SQL query - */ - abstract public function getSQL(); - - /** - * Sets a query parameter. - * - * @param string|integer $key The parameter position or name. - * @param mixed $value The parameter value. - * @param string $type The parameter type. If specified, the given value will be run through - * the type conversion of this type. This is usually not needed for - * strings and numeric types. - * @return \Doctrine\ORM\AbstractQuery This query instance. - */ - public function setParameter($key, $value, $type = null) - { - $key = trim($key, ':'); - - $value = $this->processParameterValue($value); - if ($type === null) { - $type = Query\ParameterTypeInferer::inferType($value); - } - - $this->_paramTypes[$key] = $type; - $this->_params[$key] = $value; - - return $this; - } - - /** - * Process an individual parameter value - * - * @param mixed $value - * @return array - */ - private function processParameterValue($value) - { - switch (true) { - case is_array($value): - for ($i = 0, $l = count($value); $i < $l; $i++) { - $paramValue = $this->processParameterValue($value[$i]); - $value[$i] = is_array($paramValue) ? $paramValue[key($paramValue)] : $paramValue; - } - - return $value; - - case is_object($value) && $this->_em->getMetadataFactory()->hasMetadataFor(get_class($value)): - return $this->convertObjectParameterToScalarValue($value); - - default: - return $value; - } - } - - protected function convertObjectParameterToScalarValue($value) - { - $class = $this->_em->getClassMetadata(get_class($value)); - - if ($class->isIdentifierComposite) { - throw new \InvalidArgumentException("Binding an entity with a composite primary key to a query is not supported. You should split the parameter into the explicit fields and bind them seperately."); - } - - if ($this->_em->getUnitOfWork()->getEntityState($value) === UnitOfWork::STATE_MANAGED) { - $values = $this->_em->getUnitOfWork()->getEntityIdentifier($value); - } else { - $values = $class->getIdentifierValues($value); - } - - $value = $values[$class->getSingleIdentifierFieldName()]; - if (!$value) { - throw new \InvalidArgumentException("Binding entities to query parameters only allowed for entities that have an identifier."); - } - - return $value; - } - - /** - * Sets a collection of query parameters. - * - * @param array $params - * @param array $types - * @return \Doctrine\ORM\AbstractQuery This query instance. - */ - public function setParameters(array $params, array $types = array()) - { - foreach ($params as $key => $value) { - $this->setParameter($key, $value, isset($types[$key]) ? $types[$key] : null); - } - - return $this; - } - - /** - * Sets the ResultSetMapping that should be used for hydration. - * - * @param ResultSetMapping $rsm - * @return \Doctrine\ORM\AbstractQuery - */ - public function setResultSetMapping(Query\ResultSetMapping $rsm) - { - $this->_resultSetMapping = $rsm; - - return $this; - } - - /** - * Set a cache profile for hydration caching. - * - * If no result cache driver is set in the QueryCacheProfile, the default - * result cache driver is used from the configuration. - * - * Important: Hydration caching does NOT register entities in the - * UnitOfWork when retrieved from the cache. Never use result cached - * entities for requests that also flush the EntityManager. If you want - * some form of caching with UnitOfWork registration you should use - * {@see AbstractQuery::setResultCacheProfile()}. - * - * @example - * $lifetime = 100; - * $resultKey = "abc"; - * $query->setHydrationCacheProfile(new QueryCacheProfile()); - * $query->setHydrationCacheProfile(new QueryCacheProfile($lifetime, $resultKey)); - * - * @param \Doctrine\DBAL\Cache\QueryCacheProfile $profile - * @return \Doctrine\ORM\AbstractQuery - */ - public function setHydrationCacheProfile(QueryCacheProfile $profile = null) - { - if ( ! $profile->getResultCacheDriver()) { - $resultCacheDriver = $this->_em->getConfiguration()->getHydrationCacheImpl(); - $profile = $profile->setResultCacheDriver($resultCacheDriver); - } - - $this->_hydrationCacheProfile = $profile; - - return $this; - } - - /** - * @return \Doctrine\DBAL\Cache\QueryCacheProfile - */ - public function getHydrationCacheProfile() - { - return $this->_hydrationCacheProfile; - } - - /** - * Set a cache profile for the result cache. - * - * If no result cache driver is set in the QueryCacheProfile, the default - * result cache driver is used from the configuration. - * - * @param \Doctrine\DBAL\Cache\QueryCacheProfile $profile - * @return \Doctrine\ORM\AbstractQuery - */ - public function setResultCacheProfile(QueryCacheProfile $profile = null) - { - if ( ! $profile->getResultCacheDriver()) { - $resultCacheDriver = $this->_em->getConfiguration()->getResultCacheImpl(); - $profile = $profile->setResultCacheDriver($resultCacheDriver); - } - - $this->_queryCacheProfile = $profile; - - return $this; - } - - /** - * Defines a cache driver to be used for caching result sets and implictly enables caching. - * - * @param \Doctrine\Common\Cache\Cache $driver Cache driver - * @return \Doctrine\ORM\AbstractQuery - */ - public function setResultCacheDriver($resultCacheDriver = null) - { - if ($resultCacheDriver !== null && ! ($resultCacheDriver instanceof \Doctrine\Common\Cache\Cache)) { - throw ORMException::invalidResultCacheDriver(); - } - - $this->_queryCacheProfile = $this->_queryCacheProfile - ? $this->_queryCacheProfile->setResultCacheDriver($resultCacheDriver) - : new QueryCacheProfile(0, null, $resultCacheDriver); - - return $this; - } - - /** - * Returns the cache driver used for caching result sets. - * - * @deprecated - * @return \Doctrine\Common\Cache\Cache Cache driver - */ - public function getResultCacheDriver() - { - if ($this->_queryCacheProfile && $this->_queryCacheProfile->getResultCacheDriver()) { - return $this->_queryCacheProfile->getResultCacheDriver(); - } - - return $this->_em->getConfiguration()->getResultCacheImpl(); - } - - /** - * Set whether or not to cache the results of this query and if so, for - * how long and which ID to use for the cache entry. - * - * @param boolean $bool - * @param integer $lifetime - * @param string $resultCacheId - * @return \Doctrine\ORM\AbstractQuery This query instance. - */ - public function useResultCache($bool, $lifetime = null, $resultCacheId = null) - { - if ($bool) { - $this->setResultCacheLifetime($lifetime); - $this->setResultCacheId($resultCacheId); - - return $this; - } - - $this->_queryCacheProfile = null; - - return $this; - } - - /** - * Defines how long the result cache will be active before expire. - * - * @param integer $lifetime How long the cache entry is valid. - * @return \Doctrine\ORM\AbstractQuery This query instance. - */ - public function setResultCacheLifetime($lifetime) - { - $lifetime = ($lifetime !== null) ? (int) $lifetime : 0; - - $this->_queryCacheProfile = $this->_queryCacheProfile - ? $this->_queryCacheProfile->setLifetime($lifetime) - : new QueryCacheProfile($lifetime, null, $this->_em->getConfiguration()->getResultCacheImpl()); - - return $this; - } - - /** - * Retrieves the lifetime of resultset cache. - * - * @deprecated - * @return integer - */ - public function getResultCacheLifetime() - { - return $this->_queryCacheProfile ? $this->_queryCacheProfile->getLifetime() : 0; - } - - /** - * Defines if the result cache is active or not. - * - * @param boolean $expire Whether or not to force resultset cache expiration. - * @return \Doctrine\ORM\AbstractQuery This query instance. - */ - public function expireResultCache($expire = true) - { - $this->_expireResultCache = $expire; - - return $this; - } - - /** - * Retrieves if the resultset cache is active or not. - * - * @return boolean - */ - public function getExpireResultCache() - { - return $this->_expireResultCache; - } - - /** - * @return QueryCacheProfile - */ - public function getQueryCacheProfile() - { - return $this->_queryCacheProfile; - } - - /** - * Change the default fetch mode of an association for this query. - * - * $fetchMode can be one of ClassMetadata::FETCH_EAGER or ClassMetadata::FETCH_LAZY - * - * @param string $class - * @param string $assocName - * @param int $fetchMode - * @return AbstractQuery - */ - public function setFetchMode($class, $assocName, $fetchMode) - { - if ($fetchMode !== Mapping\ClassMetadata::FETCH_EAGER) { - $fetchMode = Mapping\ClassMetadata::FETCH_LAZY; - } - - $this->_hints['fetchMode'][$class][$assocName] = $fetchMode; - - return $this; - } - - /** - * Defines the processing mode to be used during hydration / result set transformation. - * - * @param integer $hydrationMode Doctrine processing mode to be used during hydration process. - * One of the Query::HYDRATE_* constants. - * @return \Doctrine\ORM\AbstractQuery This query instance. - */ - public function setHydrationMode($hydrationMode) - { - $this->_hydrationMode = $hydrationMode; - - return $this; - } - - /** - * Gets the hydration mode currently used by the query. - * - * @return integer - */ - public function getHydrationMode() - { - return $this->_hydrationMode; - } - - /** - * Gets the list of results for the query. - * - * Alias for execute(array(), $hydrationMode = HYDRATE_OBJECT). - * - * @return array - */ - public function getResult($hydrationMode = self::HYDRATE_OBJECT) - { - return $this->execute(array(), $hydrationMode); - } - - /** - * Gets the array of results for the query. - * - * Alias for execute(array(), HYDRATE_ARRAY). - * - * @return array - */ - public function getArrayResult() - { - return $this->execute(array(), self::HYDRATE_ARRAY); - } - - /** - * Gets the scalar results for the query. - * - * Alias for execute(array(), HYDRATE_SCALAR). - * - * @return array - */ - public function getScalarResult() - { - return $this->execute(array(), self::HYDRATE_SCALAR); - } - - /** - * Get exactly one result or null. - * - * @throws NonUniqueResultException - * @param int $hydrationMode - * @return mixed - */ - public function getOneOrNullResult($hydrationMode = null) - { - $result = $this->execute(array(), $hydrationMode); - - if ($this->_hydrationMode !== self::HYDRATE_SINGLE_SCALAR && ! $result) { - return null; - } - - if ( ! is_array($result)) { - return $result; - } - - if (count($result) > 1) { - throw new NonUniqueResultException; - } - - return array_shift($result); - } - - /** - * Gets the single result of the query. - * - * Enforces the presence as well as the uniqueness of the result. - * - * If the result is not unique, a NonUniqueResultException is thrown. - * If there is no result, a NoResultException is thrown. - * - * @param integer $hydrationMode - * @return mixed - * @throws NonUniqueResultException If the query result is not unique. - * @throws NoResultException If the query returned no result. - */ - public function getSingleResult($hydrationMode = null) - { - $result = $this->execute(array(), $hydrationMode); - - if ($this->_hydrationMode !== self::HYDRATE_SINGLE_SCALAR && ! $result) { - throw new NoResultException; - } - - if ( ! is_array($result)) { - return $result; - } - - if (count($result) > 1) { - throw new NonUniqueResultException; - } - - return array_shift($result); - } - - /** - * Gets the single scalar result of the query. - * - * Alias for getSingleResult(HYDRATE_SINGLE_SCALAR). - * - * @return mixed - * @throws QueryException If the query result is not unique. - */ - public function getSingleScalarResult() - { - return $this->getSingleResult(self::HYDRATE_SINGLE_SCALAR); - } - - /** - * Sets a query hint. If the hint name is not recognized, it is silently ignored. - * - * @param string $name The name of the hint. - * @param mixed $value The value of the hint. - * @return \Doctrine\ORM\AbstractQuery - */ - public function setHint($name, $value) - { - $this->_hints[$name] = $value; - - return $this; - } - - /** - * Gets the value of a query hint. If the hint name is not recognized, FALSE is returned. - * - * @param string $name The name of the hint. - * @return mixed The value of the hint or FALSE, if the hint name is not recognized. - */ - public function getHint($name) - { - return isset($this->_hints[$name]) ? $this->_hints[$name] : false; - } - - /** - * Return the key value map of query hints that are currently set. - * - * @return array - */ - public function getHints() - { - return $this->_hints; - } - - /** - * Executes the query and returns an IterableResult that can be used to incrementally - * iterate over the result. - * - * @param array $params The query parameters. - * @param integer $hydrationMode The hydration mode to use. - * @return \Doctrine\ORM\Internal\Hydration\IterableResult - */ - public function iterate(array $params = array(), $hydrationMode = null) - { - if ($hydrationMode !== null) { - $this->setHydrationMode($hydrationMode); - } - - if ($params) { - $this->setParameters($params); - } - - $stmt = $this->_doExecute(); - - return $this->_em->newHydrator($this->_hydrationMode)->iterate( - $stmt, $this->_resultSetMapping, $this->_hints - ); - } - - /** - * Executes the query. - * - * @param array $params Any additional query parameters. - * @param integer $hydrationMode Processing mode to be used during the hydration process. - * @return mixed - */ - public function execute($params = array(), $hydrationMode = null) - { - if ($hydrationMode !== null) { - $this->setHydrationMode($hydrationMode); - } - - if ($params) { - $this->setParameters($params); - } - - $setCacheEntry = function() {}; - - if ($this->_hydrationCacheProfile !== null) { - list($cacheKey, $realCacheKey) = $this->getHydrationCacheId(); - - $queryCacheProfile = $this->getHydrationCacheProfile(); - $cache = $queryCacheProfile->getResultCacheDriver(); - $result = $cache->fetch($cacheKey); - - if (isset($result[$realCacheKey])) { - return $result[$realCacheKey]; - } - - if ( ! $result) { - $result = array(); - } - - $setCacheEntry = function($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) { - $result[$realCacheKey] = $data; - $cache->save($cacheKey, $result, $queryCacheProfile->getLifetime()); - }; - } - - $stmt = $this->_doExecute(); - - if (is_numeric($stmt)) { - $setCacheEntry($stmt); - - return $stmt; - } - - $data = $this->_em->getHydrator($this->_hydrationMode)->hydrateAll( - $stmt, $this->_resultSetMapping, $this->_hints - ); - - $setCacheEntry($data); - - return $data; - } - - /** - * Get the result cache id to use to store the result set cache entry. - * Will return the configured id if it exists otherwise a hash will be - * automatically generated for you. - * - * @return array ($key, $hash) - */ - protected function getHydrationCacheId() - { - $params = $this->getParameters(); - - foreach ($params AS $key => $value) { - $params[$key] = $this->processParameterValue($value); - } - - $sql = $this->getSQL(); - $queryCacheProfile = $this->getHydrationCacheProfile(); - $hints = $this->getHints(); - $hints['hydrationMode'] = $this->getHydrationMode(); - ksort($hints); - - return $queryCacheProfile->generateCacheKeys($sql, $params, $hints); - } - - /** - * Set the result cache id to use to store the result set cache entry. - * If this is not explicitely set by the developer then a hash is automatically - * generated for you. - * - * @param string $id - * @return \Doctrine\ORM\AbstractQuery This query instance. - */ - public function setResultCacheId($id) - { - $this->_queryCacheProfile = $this->_queryCacheProfile - ? $this->_queryCacheProfile->setCacheKey($id) - : new QueryCacheProfile(0, $id, $this->_em->getConfiguration()->getResultCacheImpl()); - - return $this; - } - - /** - * Get the result cache id to use to store the result set cache entry if set. - * - * @deprecated - * @return string - */ - public function getResultCacheId() - { - return $this->_queryCacheProfile ? $this->_queryCacheProfile->getCacheKey() : null; - } - - /** - * Executes the query and returns a the resulting Statement object. - * - * @return \Doctrine\DBAL\Driver\Statement The executed database statement that holds the results. - */ - abstract protected function _doExecute(); - - /** - * Cleanup Query resource when clone is called. - * - * @return void - */ - public function __clone() - { - $this->_params = array(); - $this->_paramTypes = array(); - $this->_hints = array(); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Configuration.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Configuration.php deleted file mode 100644 index 4189f91..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Configuration.php +++ /dev/null @@ -1,573 +0,0 @@ -. - */ - -namespace Doctrine\ORM; - -use Doctrine\Common\Cache\Cache, - Doctrine\Common\Cache\ArrayCache, - Doctrine\Common\Annotations\AnnotationRegistry, - Doctrine\Common\Annotations\AnnotationReader, - Doctrine\ORM\Mapping\Driver\Driver, - Doctrine\ORM\Mapping\Driver\AnnotationDriver; - -/** - * Configuration container for all configuration options of Doctrine. - * It combines all configuration options from DBAL & ORM. - * - * @since 2.0 - * @internal When adding a new configuration option just write a getter/setter pair. - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class Configuration extends \Doctrine\DBAL\Configuration -{ - /** - * Sets the directory where Doctrine generates any necessary proxy class files. - * - * @param string $dir - */ - public function setProxyDir($dir) - { - $this->_attributes['proxyDir'] = $dir; - } - - /** - * Gets the directory where Doctrine generates any necessary proxy class files. - * - * @return string - */ - public function getProxyDir() - { - return isset($this->_attributes['proxyDir']) ? - $this->_attributes['proxyDir'] : null; - } - - /** - * Gets a boolean flag that indicates whether proxy classes should always be regenerated - * during each script execution. - * - * @return boolean - */ - public function getAutoGenerateProxyClasses() - { - return isset($this->_attributes['autoGenerateProxyClasses']) ? - $this->_attributes['autoGenerateProxyClasses'] : true; - } - - /** - * Sets a boolean flag that indicates whether proxy classes should always be regenerated - * during each script execution. - * - * @param boolean $bool - */ - public function setAutoGenerateProxyClasses($bool) - { - $this->_attributes['autoGenerateProxyClasses'] = $bool; - } - - /** - * Gets the namespace where proxy classes reside. - * - * @return string - */ - public function getProxyNamespace() - { - return isset($this->_attributes['proxyNamespace']) ? - $this->_attributes['proxyNamespace'] : null; - } - - /** - * Sets the namespace where proxy classes reside. - * - * @param string $ns - */ - public function setProxyNamespace($ns) - { - $this->_attributes['proxyNamespace'] = $ns; - } - - /** - * Sets the cache driver implementation that is used for metadata caching. - * - * @param Driver $driverImpl - * @todo Force parameter to be a Closure to ensure lazy evaluation - * (as soon as a metadata cache is in effect, the driver never needs to initialize). - */ - public function setMetadataDriverImpl(Driver $driverImpl) - { - $this->_attributes['metadataDriverImpl'] = $driverImpl; - } - - /** - * Add a new default annotation driver with a correctly configured annotation reader. - * - * @param array $paths - * @return Mapping\Driver\AnnotationDriver - */ - public function newDefaultAnnotationDriver($paths = array()) - { - if (version_compare(\Doctrine\Common\Version::VERSION, '2.2.0-DEV', '>=')) { - // Register the ORM Annotations in the AnnotationRegistry - AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php'); - - $reader = new \Doctrine\Common\Annotations\SimpleAnnotationReader(); - $reader->addNamespace('Doctrine\ORM\Mapping'); - $reader = new \Doctrine\Common\Annotations\CachedReader($reader, new ArrayCache()); - } else if (version_compare(\Doctrine\Common\Version::VERSION, '2.1.0-DEV', '>=')) { - // Register the ORM Annotations in the AnnotationRegistry - AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php'); - - $reader = new AnnotationReader(); - $reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\'); - $reader->setIgnoreNotImportedAnnotations(true); - $reader->setEnableParsePhpImports(false); - $reader = new \Doctrine\Common\Annotations\CachedReader( - new \Doctrine\Common\Annotations\IndexedReader($reader), new ArrayCache() - ); - } else { - $reader = new AnnotationReader(); - $reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\'); - } - return new AnnotationDriver($reader, (array)$paths); - } - - /** - * Adds a namespace under a certain alias. - * - * @param string $alias - * @param string $namespace - */ - public function addEntityNamespace($alias, $namespace) - { - $this->_attributes['entityNamespaces'][$alias] = $namespace; - } - - /** - * Resolves a registered namespace alias to the full namespace. - * - * @param string $entityNamespaceAlias - * @return string - * @throws MappingException - */ - public function getEntityNamespace($entityNamespaceAlias) - { - if ( ! isset($this->_attributes['entityNamespaces'][$entityNamespaceAlias])) { - throw ORMException::unknownEntityNamespace($entityNamespaceAlias); - } - - return trim($this->_attributes['entityNamespaces'][$entityNamespaceAlias], '\\'); - } - - /** - * Set the entity alias map - * - * @param array $entityAliasMap - * @return void - */ - public function setEntityNamespaces(array $entityNamespaces) - { - $this->_attributes['entityNamespaces'] = $entityNamespaces; - } - - /** - * Retrieves the list of registered entity namespace aliases. - * - * @return array - */ - public function getEntityNamespaces() - { - return $this->_attributes['entityNamespaces']; - } - - /** - * Gets the cache driver implementation that is used for the mapping metadata. - * - * @throws ORMException - * @return Mapping\Driver\Driver - */ - public function getMetadataDriverImpl() - { - return isset($this->_attributes['metadataDriverImpl']) ? - $this->_attributes['metadataDriverImpl'] : null; - } - - /** - * Gets the cache driver implementation that is used for the query cache (SQL cache). - * - * @return \Doctrine\Common\Cache\Cache - */ - public function getQueryCacheImpl() - { - return isset($this->_attributes['queryCacheImpl']) ? - $this->_attributes['queryCacheImpl'] : null; - } - - /** - * Sets the cache driver implementation that is used for the query cache (SQL cache). - * - * @param \Doctrine\Common\Cache\Cache $cacheImpl - */ - public function setQueryCacheImpl(Cache $cacheImpl) - { - $this->_attributes['queryCacheImpl'] = $cacheImpl; - } - - /** - * Gets the cache driver implementation that is used for the hydration cache (SQL cache). - * - * @return \Doctrine\Common\Cache\Cache - */ - public function getHydrationCacheImpl() - { - return isset($this->_attributes['hydrationCacheImpl']) - ? $this->_attributes['hydrationCacheImpl'] - : null; - } - - /** - * Sets the cache driver implementation that is used for the hydration cache (SQL cache). - * - * @param \Doctrine\Common\Cache\Cache $cacheImpl - */ - public function setHydrationCacheImpl(Cache $cacheImpl) - { - $this->_attributes['hydrationCacheImpl'] = $cacheImpl; - } - - /** - * Gets the cache driver implementation that is used for metadata caching. - * - * @return \Doctrine\Common\Cache\Cache - */ - public function getMetadataCacheImpl() - { - return isset($this->_attributes['metadataCacheImpl']) ? - $this->_attributes['metadataCacheImpl'] : null; - } - - /** - * Sets the cache driver implementation that is used for metadata caching. - * - * @param \Doctrine\Common\Cache\Cache $cacheImpl - */ - public function setMetadataCacheImpl(Cache $cacheImpl) - { - $this->_attributes['metadataCacheImpl'] = $cacheImpl; - } - - /** - * Adds a named DQL query to the configuration. - * - * @param string $name The name of the query. - * @param string $dql The DQL query string. - */ - public function addNamedQuery($name, $dql) - { - $this->_attributes['namedQueries'][$name] = $dql; - } - - /** - * Gets a previously registered named DQL query. - * - * @param string $name The name of the query. - * @return string The DQL query. - */ - public function getNamedQuery($name) - { - if ( ! isset($this->_attributes['namedQueries'][$name])) { - throw ORMException::namedQueryNotFound($name); - } - return $this->_attributes['namedQueries'][$name]; - } - - /** - * Adds a named native query to the configuration. - * - * @param string $name The name of the query. - * @param string $sql The native SQL query string. - * @param ResultSetMapping $rsm The ResultSetMapping used for the results of the SQL query. - */ - public function addNamedNativeQuery($name, $sql, Query\ResultSetMapping $rsm) - { - $this->_attributes['namedNativeQueries'][$name] = array($sql, $rsm); - } - - /** - * Gets the components of a previously registered named native query. - * - * @param string $name The name of the query. - * @return array A tuple with the first element being the SQL string and the second - * element being the ResultSetMapping. - */ - public function getNamedNativeQuery($name) - { - if ( ! isset($this->_attributes['namedNativeQueries'][$name])) { - throw ORMException::namedNativeQueryNotFound($name); - } - return $this->_attributes['namedNativeQueries'][$name]; - } - - /** - * Ensures that this Configuration instance contains settings that are - * suitable for a production environment. - * - * @throws ORMException If a configuration setting has a value that is not - * suitable for a production environment. - */ - public function ensureProductionSettings() - { - if ( !$this->getQueryCacheImpl()) { - throw ORMException::queryCacheNotConfigured(); - } - if ( !$this->getMetadataCacheImpl()) { - throw ORMException::metadataCacheNotConfigured(); - } - if ($this->getAutoGenerateProxyClasses()) { - throw ORMException::proxyClassesAlwaysRegenerating(); - } - } - - /** - * Registers a custom DQL function that produces a string value. - * Such a function can then be used in any DQL statement in any place where string - * functions are allowed. - * - * DQL function names are case-insensitive. - * - * @param string $name - * @param string $className - */ - public function addCustomStringFunction($name, $className) - { - $this->_attributes['customStringFunctions'][strtolower($name)] = $className; - } - - /** - * Gets the implementation class name of a registered custom string DQL function. - * - * @param string $name - * @return string - */ - public function getCustomStringFunction($name) - { - $name = strtolower($name); - return isset($this->_attributes['customStringFunctions'][$name]) ? - $this->_attributes['customStringFunctions'][$name] : null; - } - - /** - * Sets a map of custom DQL string functions. - * - * Keys must be function names and values the FQCN of the implementing class. - * The function names will be case-insensitive in DQL. - * - * Any previously added string functions are discarded. - * - * @param array $functions The map of custom DQL string functions. - */ - public function setCustomStringFunctions(array $functions) - { - $this->_attributes['customStringFunctions'] = array_change_key_case($functions); - } - - /** - * Registers a custom DQL function that produces a numeric value. - * Such a function can then be used in any DQL statement in any place where numeric - * functions are allowed. - * - * DQL function names are case-insensitive. - * - * @param string $name - * @param string $className - */ - public function addCustomNumericFunction($name, $className) - { - $this->_attributes['customNumericFunctions'][strtolower($name)] = $className; - } - - /** - * Gets the implementation class name of a registered custom numeric DQL function. - * - * @param string $name - * @return string - */ - public function getCustomNumericFunction($name) - { - $name = strtolower($name); - return isset($this->_attributes['customNumericFunctions'][$name]) ? - $this->_attributes['customNumericFunctions'][$name] : null; - } - - /** - * Sets a map of custom DQL numeric functions. - * - * Keys must be function names and values the FQCN of the implementing class. - * The function names will be case-insensitive in DQL. - * - * Any previously added numeric functions are discarded. - * - * @param array $functions The map of custom DQL numeric functions. - */ - public function setCustomNumericFunctions(array $functions) - { - $this->_attributes['customNumericFunctions'] = array_change_key_case($functions); - } - - /** - * Registers a custom DQL function that produces a date/time value. - * Such a function can then be used in any DQL statement in any place where date/time - * functions are allowed. - * - * DQL function names are case-insensitive. - * - * @param string $name - * @param string $className - */ - public function addCustomDatetimeFunction($name, $className) - { - $this->_attributes['customDatetimeFunctions'][strtolower($name)] = $className; - } - - /** - * Gets the implementation class name of a registered custom date/time DQL function. - * - * @param string $name - * @return string - */ - public function getCustomDatetimeFunction($name) - { - $name = strtolower($name); - return isset($this->_attributes['customDatetimeFunctions'][$name]) ? - $this->_attributes['customDatetimeFunctions'][$name] : null; - } - - /** - * Sets a map of custom DQL date/time functions. - * - * Keys must be function names and values the FQCN of the implementing class. - * The function names will be case-insensitive in DQL. - * - * Any previously added date/time functions are discarded. - * - * @param array $functions The map of custom DQL date/time functions. - */ - public function setCustomDatetimeFunctions(array $functions) - { - $this->_attributes['customDatetimeFunctions'] = array_change_key_case($functions); - } - - /** - * Get the hydrator class for the given hydration mode name. - * - * @param string $modeName The hydration mode name. - * @return string $hydrator The hydrator class name. - */ - public function getCustomHydrationMode($modeName) - { - return isset($this->_attributes['customHydrationModes'][$modeName]) ? - $this->_attributes['customHydrationModes'][$modeName] : null; - } - - /** - * Add a custom hydration mode. - * - * @param string $modeName The hydration mode name. - * @param string $hydrator The hydrator class name. - */ - public function addCustomHydrationMode($modeName, $hydrator) - { - $this->_attributes['customHydrationModes'][$modeName] = $hydrator; - } - - /** - * Set a class metadata factory. - * - * @param string $cmf - */ - public function setClassMetadataFactoryName($cmfName) - { - $this->_attributes['classMetadataFactoryName'] = $cmfName; - } - - /** - * @return string - */ - public function getClassMetadataFactoryName() - { - if (!isset($this->_attributes['classMetadataFactoryName'])) { - $this->_attributes['classMetadataFactoryName'] = 'Doctrine\ORM\Mapping\ClassMetadataFactory'; - } - return $this->_attributes['classMetadataFactoryName']; - } - - /** - * Add a filter to the list of possible filters. - * - * @param string $name The name of the filter. - * @param string $className The class name of the filter. - */ - public function addFilter($name, $className) - { - $this->_attributes['filters'][$name] = $className; - } - - /** - * Gets the class name for a given filter name. - * - * @param string $name The name of the filter. - * - * @return string The class name of the filter, or null of it is not - * defined. - */ - public function getFilterClassName($name) - { - return isset($this->_attributes['filters'][$name]) ? - $this->_attributes['filters'][$name] : null; - } - - /** - * Set default repository class. - * - * @since 2.2 - * @param string $className - * @throws ORMException If not is a \Doctrine\ORM\EntityRepository - */ - public function setDefaultRepositoryClassName($className) - { - if ($className != "Doctrine\ORM\EntityRepository" && - !is_subclass_of($className, 'Doctrine\ORM\EntityRepository')){ - throw ORMException::invalidEntityRepository($className); - } - $this->_attributes['defaultRepositoryClassName'] = $className; - } - - /** - * Get default repository class. - * - * @since 2.2 - * @return string - */ - public function getDefaultRepositoryClassName() - { - return isset($this->_attributes['defaultRepositoryClassName']) ? - $this->_attributes['defaultRepositoryClassName'] : 'Doctrine\ORM\EntityRepository'; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php b/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php deleted file mode 100644 index ab3e4c7..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php +++ /dev/null @@ -1,834 +0,0 @@ -. - */ - -namespace Doctrine\ORM; - -use Closure, Exception, - Doctrine\Common\EventManager, - Doctrine\Common\Persistence\ObjectManager, - Doctrine\DBAL\Connection, - Doctrine\DBAL\LockMode, - Doctrine\ORM\Mapping\ClassMetadata, - Doctrine\ORM\Mapping\ClassMetadataFactory, - Doctrine\ORM\Query\ResultSetMapping, - Doctrine\ORM\Proxy\ProxyFactory, - Doctrine\ORM\Query\FilterCollection; - -/** - * The EntityManager is the central access point to ORM functionality. - * - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class EntityManager implements ObjectManager -{ - /** - * The used Configuration. - * - * @var \Doctrine\ORM\Configuration - */ - private $config; - - /** - * The database connection used by the EntityManager. - * - * @var \Doctrine\DBAL\Connection - */ - private $conn; - - /** - * The metadata factory, used to retrieve the ORM metadata of entity classes. - * - * @var \Doctrine\ORM\Mapping\ClassMetadataFactory - */ - private $metadataFactory; - - /** - * The EntityRepository instances. - * - * @var array - */ - private $repositories = array(); - - /** - * The UnitOfWork used to coordinate object-level transactions. - * - * @var \Doctrine\ORM\UnitOfWork - */ - private $unitOfWork; - - /** - * The event manager that is the central point of the event system. - * - * @var \Doctrine\Common\EventManager - */ - private $eventManager; - - /** - * The maintained (cached) hydrators. One instance per type. - * - * @var array - */ - private $hydrators = array(); - - /** - * The proxy factory used to create dynamic proxies. - * - * @var \Doctrine\ORM\Proxy\ProxyFactory - */ - private $proxyFactory; - - /** - * The expression builder instance used to generate query expressions. - * - * @var \Doctrine\ORM\Query\Expr - */ - private $expressionBuilder; - - /** - * Whether the EntityManager is closed or not. - * - * @var bool - */ - private $closed = false; - - /** - * Collection of query filters. - * - * @var Doctrine\ORM\Query\FilterCollection - */ - private $filterCollection; - - /** - * Creates a new EntityManager that operates on the given database connection - * and uses the given Configuration and EventManager implementations. - * - * @param \Doctrine\DBAL\Connection $conn - * @param \Doctrine\ORM\Configuration $config - * @param \Doctrine\Common\EventManager $eventManager - */ - protected function __construct(Connection $conn, Configuration $config, EventManager $eventManager) - { - $this->conn = $conn; - $this->config = $config; - $this->eventManager = $eventManager; - - $metadataFactoryClassName = $config->getClassMetadataFactoryName(); - $this->metadataFactory = new $metadataFactoryClassName; - $this->metadataFactory->setEntityManager($this); - $this->metadataFactory->setCacheDriver($this->config->getMetadataCacheImpl()); - - $this->unitOfWork = new UnitOfWork($this); - $this->proxyFactory = new ProxyFactory( - $this, - $config->getProxyDir(), - $config->getProxyNamespace(), - $config->getAutoGenerateProxyClasses() - ); - } - - /** - * Gets the database connection object used by the EntityManager. - * - * @return \Doctrine\DBAL\Connection - */ - public function getConnection() - { - return $this->conn; - } - - /** - * Gets the metadata factory used to gather the metadata of classes. - * - * @return \Doctrine\ORM\Mapping\ClassMetadataFactory - */ - public function getMetadataFactory() - { - return $this->metadataFactory; - } - - /** - * Gets an ExpressionBuilder used for object-oriented construction of query expressions. - * - * Example: - * - * - * $qb = $em->createQueryBuilder(); - * $expr = $em->getExpressionBuilder(); - * $qb->select('u')->from('User', 'u') - * ->where($expr->orX($expr->eq('u.id', 1), $expr->eq('u.id', 2))); - * - * - * @return \Doctrine\ORM\Query\Expr - */ - public function getExpressionBuilder() - { - if ($this->expressionBuilder === null) { - $this->expressionBuilder = new Query\Expr; - } - - return $this->expressionBuilder; - } - - /** - * Starts a transaction on the underlying database connection. - * - * @deprecated Use {@link getConnection}.beginTransaction(). - */ - public function beginTransaction() - { - $this->conn->beginTransaction(); - } - - /** - * Executes a function in a transaction. - * - * The function gets passed this EntityManager instance as an (optional) parameter. - * - * {@link flush} is invoked prior to transaction commit. - * - * If an exception occurs during execution of the function or flushing or transaction commit, - * the transaction is rolled back, the EntityManager closed and the exception re-thrown. - * - * @param Closure $func The function to execute transactionally. - * @return mixed Returns the non-empty value returned from the closure or true instead - */ - public function transactional(Closure $func) - { - $this->conn->beginTransaction(); - - try { - $return = $func($this); - - $this->flush(); - $this->conn->commit(); - - return $return ?: true; - } catch (Exception $e) { - $this->close(); - $this->conn->rollback(); - - throw $e; - } - } - - /** - * Commits a transaction on the underlying database connection. - * - * @deprecated Use {@link getConnection}.commit(). - */ - public function commit() - { - $this->conn->commit(); - } - - /** - * Performs a rollback on the underlying database connection. - * - * @deprecated Use {@link getConnection}.rollback(). - */ - public function rollback() - { - $this->conn->rollback(); - } - - /** - * Returns the ORM metadata descriptor for a class. - * - * The class name must be the fully-qualified class name without a leading backslash - * (as it is returned by get_class($obj)) or an aliased class name. - * - * Examples: - * MyProject\Domain\User - * sales:PriceRequest - * - * @return \Doctrine\ORM\Mapping\ClassMetadata - * @internal Performance-sensitive method. - */ - public function getClassMetadata($className) - { - return $this->metadataFactory->getMetadataFor($className); - } - - /** - * Creates a new Query object. - * - * @param string The DQL string. - * @return \Doctrine\ORM\Query - */ - public function createQuery($dql = "") - { - $query = new Query($this); - - if ( ! empty($dql)) { - $query->setDql($dql); - } - - return $query; - } - - /** - * Creates a Query from a named query. - * - * @param string $name - * @return \Doctrine\ORM\Query - */ - public function createNamedQuery($name) - { - return $this->createQuery($this->config->getNamedQuery($name)); - } - - /** - * Creates a native SQL query. - * - * @param string $sql - * @param ResultSetMapping $rsm The ResultSetMapping to use. - * @return NativeQuery - */ - public function createNativeQuery($sql, ResultSetMapping $rsm) - { - $query = new NativeQuery($this); - $query->setSql($sql); - $query->setResultSetMapping($rsm); - - return $query; - } - - /** - * Creates a NativeQuery from a named native query. - * - * @param string $name - * @return \Doctrine\ORM\NativeQuery - */ - public function createNamedNativeQuery($name) - { - list($sql, $rsm) = $this->config->getNamedNativeQuery($name); - - return $this->createNativeQuery($sql, $rsm); - } - - /** - * Create a QueryBuilder instance - * - * @return QueryBuilder $qb - */ - public function createQueryBuilder() - { - return new QueryBuilder($this); - } - - /** - * Flushes all changes to objects that have been queued up to now to the database. - * This effectively synchronizes the in-memory state of managed objects with the - * database. - * - * If an entity is explicitly passed to this method only this entity and - * the cascade-persist semantics + scheduled inserts/removals are synchronized. - * - * @param object $entity - * @throws \Doctrine\ORM\OptimisticLockException If a version check on an entity that - * makes use of optimistic locking fails. - */ - public function flush($entity = null) - { - $this->errorIfClosed(); - - $this->unitOfWork->commit($entity); - } - - /** - * Finds an Entity by its identifier. - * - * This is just a convenient shortcut for getRepository($entityName)->find($id). - * - * @param string $entityName - * @param mixed $identifier - * @param int $lockMode - * @param int $lockVersion - * @return object - */ - public function find($entityName, $identifier, $lockMode = LockMode::NONE, $lockVersion = null) - { - return $this->getRepository($entityName)->find($identifier, $lockMode, $lockVersion); - } - - /** - * Gets a reference to the entity identified by the given type and identifier - * without actually loading it, if the entity is not yet loaded. - * - * @param string $entityName The name of the entity type. - * @param mixed $id The entity identifier. - * @return object The entity reference. - */ - public function getReference($entityName, $id) - { - $class = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\')); - if ( ! is_array($id)) { - $id = array($class->identifier[0] => $id); - } - $sortedId = array(); - foreach ($class->identifier as $identifier) { - if (!isset($id[$identifier])) { - throw ORMException::missingIdentifierField($class->name, $identifier); - } - $sortedId[$identifier] = $id[$identifier]; - } - - // Check identity map first, if its already in there just return it. - if ($entity = $this->unitOfWork->tryGetById($sortedId, $class->rootEntityName)) { - return ($entity instanceof $class->name) ? $entity : null; - } - - if ($class->subClasses) { - return $this->find($entityName, $sortedId); - } - - if ( ! is_array($sortedId)) { - $sortedId = array($class->identifier[0] => $sortedId); - } - - $entity = $this->proxyFactory->getProxy($class->name, $sortedId); - $this->unitOfWork->registerManaged($entity, $sortedId, array()); - - return $entity; - } - - /** - * Gets a partial reference to the entity identified by the given type and identifier - * without actually loading it, if the entity is not yet loaded. - * - * The returned reference may be a partial object if the entity is not yet loaded/managed. - * If it is a partial object it will not initialize the rest of the entity state on access. - * Thus you can only ever safely access the identifier of an entity obtained through - * this method. - * - * The use-cases for partial references involve maintaining bidirectional associations - * without loading one side of the association or to update an entity without loading it. - * Note, however, that in the latter case the original (persistent) entity data will - * never be visible to the application (especially not event listeners) as it will - * never be loaded in the first place. - * - * @param string $entityName The name of the entity type. - * @param mixed $identifier The entity identifier. - * @return object The (partial) entity reference. - */ - public function getPartialReference($entityName, $identifier) - { - $class = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\')); - - // Check identity map first, if its already in there just return it. - if ($entity = $this->unitOfWork->tryGetById($identifier, $class->rootEntityName)) { - return ($entity instanceof $class->name) ? $entity : null; - } - - if ( ! is_array($identifier)) { - $identifier = array($class->identifier[0] => $identifier); - } - - $entity = $class->newInstance(); - $class->setIdentifierValues($entity, $identifier); - $this->unitOfWork->registerManaged($entity, $identifier, array()); - $this->unitOfWork->markReadOnly($entity); - - return $entity; - } - - /** - * Clears the EntityManager. All entities that are currently managed - * by this EntityManager become detached. - * - * @param string $entityName if given, only entities of this type will get detached - */ - public function clear($entityName = null) - { - $this->unitOfWork->clear($entityName); - } - - /** - * Closes the EntityManager. All entities that are currently managed - * by this EntityManager become detached. The EntityManager may no longer - * be used after it is closed. - */ - public function close() - { - $this->clear(); - $this->closed = true; - } - - /** - * Tells the EntityManager to make an instance managed and persistent. - * - * The entity will be entered into the database at or before transaction - * commit or as a result of the flush operation. - * - * NOTE: The persist operation always considers entities that are not yet known to - * this EntityManager as NEW. Do not pass detached entities to the persist operation. - * - * @param object $object The instance to make managed and persistent. - */ - public function persist($entity) - { - if ( ! is_object($entity)) { - throw new \InvalidArgumentException(gettype($entity)); - } - - $this->errorIfClosed(); - - $this->unitOfWork->persist($entity); - } - - /** - * Removes an entity instance. - * - * A removed entity will be removed from the database at or before transaction commit - * or as a result of the flush operation. - * - * @param object $entity The entity instance to remove. - */ - public function remove($entity) - { - if ( ! is_object($entity)) { - throw new \InvalidArgumentException(gettype($entity)); - } - - $this->errorIfClosed(); - - $this->unitOfWork->remove($entity); - } - - /** - * Refreshes the persistent state of an entity from the database, - * overriding any local changes that have not yet been persisted. - * - * @param object $entity The entity to refresh. - */ - public function refresh($entity) - { - if ( ! is_object($entity)) { - throw new \InvalidArgumentException(gettype($entity)); - } - - $this->errorIfClosed(); - - $this->unitOfWork->refresh($entity); - } - - /** - * Detaches an entity from the EntityManager, causing a managed entity to - * become detached. Unflushed changes made to the entity if any - * (including removal of the entity), will not be synchronized to the database. - * Entities which previously referenced the detached entity will continue to - * reference it. - * - * @param object $entity The entity to detach. - */ - public function detach($entity) - { - if ( ! is_object($entity)) { - throw new \InvalidArgumentException(gettype($entity)); - } - - $this->unitOfWork->detach($entity); - } - - /** - * Merges the state of a detached entity into the persistence context - * of this EntityManager and returns the managed copy of the entity. - * The entity passed to merge will not become associated/managed with this EntityManager. - * - * @param object $entity The detached entity to merge into the persistence context. - * @return object The managed copy of the entity. - */ - public function merge($entity) - { - if ( ! is_object($entity)) { - throw new \InvalidArgumentException(gettype($entity)); - } - - $this->errorIfClosed(); - - return $this->unitOfWork->merge($entity); - } - - /** - * Creates a copy of the given entity. Can create a shallow or a deep copy. - * - * @param object $entity The entity to copy. - * @return object The new entity. - * @todo Implementation need. This is necessary since $e2 = clone $e1; throws an E_FATAL when access anything on $e: - * Fatal error: Maximum function nesting level of '100' reached, aborting! - */ - public function copy($entity, $deep = false) - { - throw new \BadMethodCallException("Not implemented."); - } - - /** - * Acquire a lock on the given entity. - * - * @param object $entity - * @param int $lockMode - * @param int $lockVersion - * @throws OptimisticLockException - * @throws PessimisticLockException - */ - public function lock($entity, $lockMode, $lockVersion = null) - { - $this->unitOfWork->lock($entity, $lockMode, $lockVersion); - } - - /** - * Gets the repository for an entity class. - * - * @param string $entityName The name of the entity. - * @return EntityRepository The repository class. - */ - public function getRepository($entityName) - { - $entityName = ltrim($entityName, '\\'); - - if (isset($this->repositories[$entityName])) { - return $this->repositories[$entityName]; - } - - $metadata = $this->getClassMetadata($entityName); - $repositoryClassName = $metadata->customRepositoryClassName; - - if ($repositoryClassName === null) { - $repositoryClassName = $this->config->getDefaultRepositoryClassName(); - } - - $repository = new $repositoryClassName($this, $metadata); - - $this->repositories[$entityName] = $repository; - - return $repository; - } - - /** - * Determines whether an entity instance is managed in this EntityManager. - * - * @param object $entity - * @return boolean TRUE if this EntityManager currently manages the given entity, FALSE otherwise. - */ - public function contains($entity) - { - return $this->unitOfWork->isScheduledForInsert($entity) - || $this->unitOfWork->isInIdentityMap($entity) - && ! $this->unitOfWork->isScheduledForDelete($entity); - } - - /** - * Gets the EventManager used by the EntityManager. - * - * @return \Doctrine\Common\EventManager - */ - public function getEventManager() - { - return $this->eventManager; - } - - /** - * Gets the Configuration used by the EntityManager. - * - * @return \Doctrine\ORM\Configuration - */ - public function getConfiguration() - { - return $this->config; - } - - /** - * Throws an exception if the EntityManager is closed or currently not active. - * - * @throws ORMException If the EntityManager is closed. - */ - private function errorIfClosed() - { - if ($this->closed) { - throw ORMException::entityManagerClosed(); - } - } - - /** - * Check if the Entity manager is open or closed. - * - * @return bool - */ - public function isOpen() - { - return (!$this->closed); - } - - /** - * Gets the UnitOfWork used by the EntityManager to coordinate operations. - * - * @return \Doctrine\ORM\UnitOfWork - */ - public function getUnitOfWork() - { - return $this->unitOfWork; - } - - /** - * Gets a hydrator for the given hydration mode. - * - * This method caches the hydrator instances which is used for all queries that don't - * selectively iterate over the result. - * - * @param int $hydrationMode - * @return \Doctrine\ORM\Internal\Hydration\AbstractHydrator - */ - public function getHydrator($hydrationMode) - { - if ( ! isset($this->hydrators[$hydrationMode])) { - $this->hydrators[$hydrationMode] = $this->newHydrator($hydrationMode); - } - - return $this->hydrators[$hydrationMode]; - } - - /** - * Create a new instance for the given hydration mode. - * - * @param int $hydrationMode - * @return \Doctrine\ORM\Internal\Hydration\AbstractHydrator - */ - public function newHydrator($hydrationMode) - { - switch ($hydrationMode) { - case Query::HYDRATE_OBJECT: - return new Internal\Hydration\ObjectHydrator($this); - - case Query::HYDRATE_ARRAY: - return new Internal\Hydration\ArrayHydrator($this); - - case Query::HYDRATE_SCALAR: - return new Internal\Hydration\ScalarHydrator($this); - - case Query::HYDRATE_SINGLE_SCALAR: - return new Internal\Hydration\SingleScalarHydrator($this); - - case Query::HYDRATE_SIMPLEOBJECT: - return new Internal\Hydration\SimpleObjectHydrator($this); - - default: - if ($class = $this->config->getCustomHydrationMode($hydrationMode)) { - return new $class($this); - } - } - - throw ORMException::invalidHydrationMode($hydrationMode); - } - - /** - * Gets the proxy factory used by the EntityManager to create entity proxies. - * - * @return ProxyFactory - */ - public function getProxyFactory() - { - return $this->proxyFactory; - } - - /** - * Helper method to initialize a lazy loading proxy or persistent collection. - * - * This method is a no-op for other objects - * - * @param object $obj - */ - public function initializeObject($obj) - { - $this->unitOfWork->initializeObject($obj); - } - - /** - * Factory method to create EntityManager instances. - * - * @param mixed $conn An array with the connection parameters or an existing - * Connection instance. - * @param Configuration $config The Configuration instance to use. - * @param EventManager $eventManager The EventManager instance to use. - * @return EntityManager The created EntityManager. - */ - public static function create($conn, Configuration $config, EventManager $eventManager = null) - { - if ( ! $config->getMetadataDriverImpl()) { - throw ORMException::missingMappingDriverImpl(); - } - - switch (true) { - case (is_array($conn)): - $conn = \Doctrine\DBAL\DriverManager::getConnection( - $conn, $config, ($eventManager ?: new EventManager()) - ); - break; - - case ($conn instanceof Connection): - if ($eventManager !== null && $conn->getEventManager() !== $eventManager) { - throw ORMException::mismatchedEventManager(); - } - break; - - default: - throw new \InvalidArgumentException("Invalid argument: " . $conn); - } - - return new EntityManager($conn, $config, $conn->getEventManager()); - } - - /** - * Gets the enabled filters. - * - * @return FilterCollection The active filter collection. - */ - public function getFilters() - { - if (null === $this->filterCollection) { - $this->filterCollection = new FilterCollection($this); - } - - return $this->filterCollection; - } - - /** - * Checks whether the state of the filter collection is clean. - * - * @return boolean True, if the filter collection is clean. - */ - public function isFiltersStateClean() - { - return null === $this->filterCollection - || $this->filterCollection->isClean(); - } - - /** - * Checks whether the Entity Manager has filters. - * - * @return True, if the EM has a filter collection. - */ - public function hasFilters() - { - return null !== $this->filterCollection; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/EntityNotFoundException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/EntityNotFoundException.php deleted file mode 100644 index 2e58132..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/EntityNotFoundException.php +++ /dev/null @@ -1,34 +0,0 @@ -. - */ - -namespace Doctrine\ORM; - -/** - * Exception thrown when a Proxy fails to retrieve an Entity result. - * - * @author robo - * @since 2.0 - */ -class EntityNotFoundException extends ORMException -{ - public function __construct() - { - parent::__construct('Entity was not found.'); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php b/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php deleted file mode 100644 index 84d8636..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php +++ /dev/null @@ -1,272 +0,0 @@ -. - */ - -namespace Doctrine\ORM; - -use Doctrine\DBAL\LockMode; -use Doctrine\Common\Persistence\ObjectRepository; - -/** - * An EntityRepository serves as a repository for entities with generic as well as - * business specific methods for retrieving entities. - * - * This class is designed for inheritance and users can subclass this class to - * write their own repositories with business-specific methods to locate entities. - * - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class EntityRepository implements ObjectRepository -{ - /** - * @var string - */ - protected $_entityName; - - /** - * @var EntityManager - */ - protected $_em; - - /** - * @var \Doctrine\ORM\Mapping\ClassMetadata - */ - protected $_class; - - /** - * Initializes a new EntityRepository. - * - * @param EntityManager $em The EntityManager to use. - * @param ClassMetadata $classMetadata The class descriptor. - */ - public function __construct($em, Mapping\ClassMetadata $class) - { - $this->_entityName = $class->name; - $this->_em = $em; - $this->_class = $class; - } - - /** - * Create a new QueryBuilder instance that is prepopulated for this entity name - * - * @param string $alias - * @return QueryBuilder $qb - */ - public function createQueryBuilder($alias) - { - return $this->_em->createQueryBuilder() - ->select($alias) - ->from($this->_entityName, $alias); - } - - /** - * Create a new Query instance based on a predefined metadata named query. - * - * @param string $queryName - * @return Query - */ - public function createNamedQuery($queryName) - { - return $this->_em->createQuery($this->_class->getNamedQuery($queryName)); - } - - /** - * Clears the repository, causing all managed entities to become detached. - */ - public function clear() - { - $this->_em->clear($this->_class->rootEntityName); - } - - /** - * Finds an entity by its primary key / identifier. - * - * @param $id The identifier. - * @param int $lockMode - * @param int $lockVersion - * @return object The entity. - */ - public function find($id, $lockMode = LockMode::NONE, $lockVersion = null) - { - if ( ! is_array($id)) { - $id = array($this->_class->identifier[0] => $id); - } - $sortedId = array(); - foreach ($this->_class->identifier as $identifier) { - if (!isset($id[$identifier])) { - throw ORMException::missingIdentifierField($this->_class->name, $identifier); - } - $sortedId[$identifier] = $id[$identifier]; - } - - // Check identity map first - if ($entity = $this->_em->getUnitOfWork()->tryGetById($sortedId, $this->_class->rootEntityName)) { - if ( ! ($entity instanceof $this->_class->name)) { - return null; - } - - switch ($lockMode) { - case LockMode::OPTIMISTIC: - $this->_em->lock($entity, $lockMode, $lockVersion); - break; - case LockMode::PESSIMISTIC_READ: - case LockMode::PESSIMISTIC_WRITE: - $persister = $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName); - $persister->refresh($sortedId, $entity, $lockMode); - break; - } - - return $entity; // Hit! - } - - switch ($lockMode) { - case LockMode::NONE: - return $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName)->load($sortedId); - - case LockMode::OPTIMISTIC: - if ( ! $this->_class->isVersioned) { - throw OptimisticLockException::notVersioned($this->_entityName); - } - - $entity = $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName)->load($sortedId); - - $this->_em->getUnitOfWork()->lock($entity, $lockMode, $lockVersion); - - return $entity; - - default: - if ( ! $this->_em->getConnection()->isTransactionActive()) { - throw TransactionRequiredException::transactionRequired(); - } - - return $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName)->load($sortedId, null, null, array(), $lockMode); - } - } - - /** - * Finds all entities in the repository. - * - * @return array The entities. - */ - public function findAll() - { - return $this->findBy(array()); - } - - /** - * Finds entities by a set of criteria. - * - * @param array $criteria - * @param array|null $orderBy - * @param int|null $limit - * @param int|null $offset - * @return array The objects. - */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) - { - return $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName)->loadAll($criteria, $orderBy, $limit, $offset); - } - - /** - * Finds a single entity by a set of criteria. - * - * @param array $criteria - * @return object - */ - public function findOneBy(array $criteria) - { - return $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName)->load($criteria, null, null, array(), 0, 1); - } - - /** - * Adds support for magic finders. - * - * @return array|object The found entity/entities. - * @throws BadMethodCallException If the method called is an invalid find* method - * or no find* method at all and therefore an invalid - * method call. - */ - public function __call($method, $arguments) - { - switch (true) { - case (substr($method, 0, 6) == 'findBy'): - $by = substr($method, 6, strlen($method)); - $method = 'findBy'; - break; - - case (substr($method, 0, 9) == 'findOneBy'): - $by = substr($method, 9, strlen($method)); - $method = 'findOneBy'; - break; - - default: - throw new \BadMethodCallException( - "Undefined method '$method'. The method name must start with ". - "either findBy or findOneBy!" - ); - } - - if (empty($arguments)) { - throw ORMException::findByRequiresParameter($method . $by); - } - - $fieldName = lcfirst(\Doctrine\Common\Util\Inflector::classify($by)); - - if ($this->_class->hasField($fieldName) || $this->_class->hasAssociation($fieldName)) { - return $this->$method(array($fieldName => $arguments[0])); - } - - throw ORMException::invalidFindByCall($this->_entityName, $fieldName, $method.$by); - } - - /** - * @return string - */ - protected function getEntityName() - { - return $this->_entityName; - } - - /** - * @return string - */ - public function getClassName() - { - return $this->getEntityName(); - } - - /** - * @return EntityManager - */ - protected function getEntityManager() - { - return $this->_em; - } - - /** - * @return Mapping\ClassMetadata - */ - protected function getClassMetadata() - { - return $this->_class; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/LifecycleEventArgs.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Event/LifecycleEventArgs.php deleted file mode 100644 index 6740a3e..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/LifecycleEventArgs.php +++ /dev/null @@ -1,77 +0,0 @@ -. -*/ - -namespace Doctrine\ORM\Event; - -use Doctrine\Common\EventArgs; -use Doctrine\ORM\EntityManager; - -/** - * Lifecycle Events are triggered by the UnitOfWork during lifecycle transitions - * of entities. - * - * @link www.doctrine-project.org - * @since 2.0 - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class LifecycleEventArgs extends EventArgs -{ - /** - * @var \Doctrine\ORM\EntityManager - */ - private $em; - - /** - * @var object - */ - private $entity; - - /** - * Constructor - * - * @param object $entity - * @param \Doctrine\ORM\EntityManager $em - */ - public function __construct($entity, EntityManager $em) - { - $this->entity = $entity; - $this->em = $em; - } - - /** - * Retireve associated Entity. - * - * @return object - */ - public function getEntity() - { - return $this->entity; - } - - /** - * Retrieve associated EntityManager. - * - * @return \Doctrine\ORM\EntityManager - */ - public function getEntityManager() - { - return $this->em; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/LoadClassMetadataEventArgs.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Event/LoadClassMetadataEventArgs.php deleted file mode 100644 index 901bf3a..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/LoadClassMetadataEventArgs.php +++ /dev/null @@ -1,76 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Event; - -use Doctrine\Common\EventArgs; -use Doctrine\ORM\Mapping\ClassMetadataInfo; -use Doctrine\ORM\EntityManager; - -/** - * Class that holds event arguments for a loadMetadata event. - * - * @author Jonathan H. Wage - * @since 2.0 - */ -class LoadClassMetadataEventArgs extends EventArgs -{ - /** - * @var \Doctrine\ORM\Mapping\ClassMetadata - */ - private $classMetadata; - - /** - * @var \Doctrine\ORM\EntityManager - */ - private $em; - - /** - * Constructor. - * - * @param \Doctrine\ORM\Mapping\ClassMetadataInfo $classMetadata - * @param \Doctrine\ORM\EntityManager $em - */ - public function __construct(ClassMetadataInfo $classMetadata, EntityManager $em) - { - $this->classMetadata = $classMetadata; - $this->em = $em; - } - - /** - * Retrieve associated ClassMetadata. - * - * @return \Doctrine\ORM\Mapping\ClassMetadataInfo - */ - public function getClassMetadata() - { - return $this->classMetadata; - } - - /** - * Retrieve associated EntityManager. - * - * @return \Doctrine\ORM\EntityManager - */ - public function getEntityManager() - { - return $this->em; - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/OnClearEventArgs.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Event/OnClearEventArgs.php deleted file mode 100644 index 542ac45..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/OnClearEventArgs.php +++ /dev/null @@ -1,84 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Event; - -/** - * Provides event arguments for the onClear event. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class OnClearEventArgs extends \Doctrine\Common\EventArgs -{ - /** - * @var \Doctrine\ORM\EntityManager - */ - private $em; - - /** - * @var string - */ - private $entityClass; - - /** - * Constructor. - * - * @param \Doctrine\ORM\EntityManager $em - * @param string $entityClass Optional entity class - */ - public function __construct($em, $entityClass = null) - { - $this->em = $em; - $this->entityClass = $entityClass; - } - - /** - * Retrieve associated EntityManager. - * - * @return \Doctrine\ORM\EntityManager - */ - public function getEntityManager() - { - return $this->em; - } - - /** - * Name of the entity class that is cleared, or empty if all are cleared. - * - * @return string - */ - public function getEntityClass() - { - return $this->entityClass; - } - - /** - * Check if event clears all entities. - * - * @return bool - */ - public function clearsAllEntities() - { - return ($this->entityClass === null); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/OnFlushEventArgs.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Event/OnFlushEventArgs.php deleted file mode 100644 index c4aeb2a..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/OnFlushEventArgs.php +++ /dev/null @@ -1,86 +0,0 @@ -. -*/ - -namespace Doctrine\ORM\Event; - -use Doctrine\ORM\EntityManager; - -/** - * Provides event arguments for the preFlush event. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class OnFlushEventArgs extends \Doctrine\Common\EventArgs -{ - /** - * @var Doctirne\ORM\EntityManager - */ - private $em; - - //private $entitiesToPersist = array(); - //private $entitiesToRemove = array(); - - /** - * Constructor. - * - * @param \Doctrine\ORM\EntityManager $em - */ - public function __construct(EntityManager $em) - { - $this->em = $em; - } - - /** - * Retrieve associated EntityManager. - * - * @return \Doctrine\ORM\EntityManager - */ - public function getEntityManager() - { - return $this->em; - } - - /* - public function addEntityToPersist($entity) - { - - } - - public function addEntityToRemove($entity) - { - - } - - public function addEntityToUpdate($entity) - { - - } - - public function getEntitiesToPersist() - { - return $this->_entitiesToPersist; - } - */ -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/PostFlushEventArgs.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Event/PostFlushEventArgs.php deleted file mode 100644 index f45030d..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/PostFlushEventArgs.php +++ /dev/null @@ -1,61 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Event; - -use Doctrine\ORM\EntityManager; -use Doctrine\Common\EventArgs; - -/** - * Provides event arguments for the postFlush event. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Daniel Freudenberger - */ -class PostFlushEventArgs extends EventArgs -{ - /** - * @var \Doctrine\ORM\EntityManager - */ - private $em; - - /** - * Constructor. - * - * @param \Doctrine\ORM\EntityManager $em - */ - public function __construct(EntityManager $em) - { - $this->em = $em; - } - - /** - * Retrieve associated EntityManager. - * - * @return \Doctrine\ORM\EntityManager - */ - public function getEntityManager() - { - return $this->em; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/PreFlushEventArgs.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Event/PreFlushEventArgs.php deleted file mode 100644 index b86967a..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/PreFlushEventArgs.php +++ /dev/null @@ -1,53 +0,0 @@ -. -*/ - -namespace Doctrine\ORM\Event; - -/** - * Provides event arguments for the preFlush event. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.0 - * @version $Revision$ - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class PreFlushEventArgs extends \Doctrine\Common\EventArgs -{ - /** - * @var EntityManager - */ - private $_em; - - public function __construct($em) - { - $this->_em = $em; - } - - /** - * @return EntityManager - */ - public function getEntityManager() - { - return $this->_em; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/PreUpdateEventArgs.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Event/PreUpdateEventArgs.php deleted file mode 100644 index 0bebba1..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/PreUpdateEventArgs.php +++ /dev/null @@ -1,131 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Event; - -use Doctrine\Common\EventArgs, - Doctrine\ORM\EntityManager; - -/** - * Class that holds event arguments for a preInsert/preUpdate event. - * - * @author Guilherme Blanco - * @author Roman Borschel - * @author Benjamin Eberlei - * @since 2.0 - */ -class PreUpdateEventArgs extends LifecycleEventArgs -{ - /** - * @var array - */ - private $entityChangeSet; - - /** - * Constructor. - * - * @param object $entity - * @param \Doctrine\ORM\EntityManager $em - * @param array $changeSet - */ - public function __construct($entity, EntityManager $em, array &$changeSet) - { - parent::__construct($entity, $em); - - $this->entityChangeSet = &$changeSet; - } - - /** - * Retrieve entity changeset. - * - * @return array - */ - public function getEntityChangeSet() - { - return $this->entityChangeSet; - } - - /** - * Check if field has a changeset. - * - * @return boolean - */ - public function hasChangedField($field) - { - return isset($this->entityChangeSet[$field]); - } - - /** - * Get the old value of the changeset of the changed field. - * - * @param string $field - * @return mixed - */ - public function getOldValue($field) - { - $this->assertValidField($field); - - return $this->entityChangeSet[$field][0]; - } - - /** - * Get the new value of the changeset of the changed field. - * - * @param string $field - * @return mixed - */ - public function getNewValue($field) - { - $this->assertValidField($field); - - return $this->entityChangeSet[$field][1]; - } - - /** - * Set the new value of this field. - * - * @param string $field - * @param mixed $value - */ - public function setNewValue($field, $value) - { - $this->assertValidField($field); - - $this->entityChangeSet[$field][1] = $value; - } - - /** - * Assert the field exists in changeset. - * - * @param string $field - */ - private function assertValidField($field) - { - if ( ! isset($this->entityChangeSet[$field])) { - throw new \InvalidArgumentException(sprintf( - 'Field "%s" is not a valid field of the entity "%s" in PreUpdateEventArgs.', - $field, - get_class($this->getEntity()) - )); - } - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Events.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Events.php deleted file mode 100644 index 45424e7..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Events.php +++ /dev/null @@ -1,148 +0,0 @@ -. - */ - -namespace Doctrine\ORM; - -/** - * Container for all ORM events. - * - * This class cannot be instantiated. - * - * @author Roman Borschel - * @since 2.0 - */ -final class Events -{ - private function __construct() {} - /** - * The preRemove event occurs for a given entity before the respective - * EntityManager remove operation for that entity is executed. - * - * This is an entity lifecycle event. - * - * @var string - */ - const preRemove = 'preRemove'; - /** - * The postRemove event occurs for an entity after the entity has - * been deleted. It will be invoked after the database delete operations. - * - * This is an entity lifecycle event. - * - * @var string - */ - const postRemove = 'postRemove'; - /** - * The prePersist event occurs for a given entity before the respective - * EntityManager persist operation for that entity is executed. - * - * This is an entity lifecycle event. - * - * @var string - */ - const prePersist = 'prePersist'; - /** - * The postPersist event occurs for an entity after the entity has - * been made persistent. It will be invoked after the database insert operations. - * Generated primary key values are available in the postPersist event. - * - * This is an entity lifecycle event. - * - * @var string - */ - const postPersist = 'postPersist'; - /** - * The preUpdate event occurs before the database update operations to - * entity data. - * - * This is an entity lifecycle event. - * - * @var string - */ - const preUpdate = 'preUpdate'; - /** - * The postUpdate event occurs after the database update operations to - * entity data. - * - * This is an entity lifecycle event. - * - * @var string - */ - const postUpdate = 'postUpdate'; - /** - * The postLoad event occurs for an entity after the entity has been loaded - * into the current EntityManager from the database or after the refresh operation - * has been applied to it. - * - * Note that the postLoad event occurs for an entity before any associations have been - * initialized. Therefore it is not safe to access associations in a postLoad callback - * or event handler. - * - * This is an entity lifecycle event. - * - * @var string - */ - const postLoad = 'postLoad'; - /** - * The loadClassMetadata event occurs after the mapping metadata for a class - * has been loaded from a mapping source (annotations/xml/yaml). - * - * @var string - */ - const loadClassMetadata = 'loadClassMetadata'; - - /** - * The preFlush event occurs when the EntityManager#flush() operation is invoked, - * but before any changes to managed entites have been calculated. This event is - * always raised right after EntityManager#flush() call. - */ - const preFlush = 'preFlush'; - - /** - * The onFlush event occurs when the EntityManager#flush() operation is invoked, - * after any changes to managed entities have been determined but before any - * actual database operations are executed. The event is only raised if there is - * actually something to do for the underlying UnitOfWork. If nothing needs to be done, - * the onFlush event is not raised. - * - * @var string - */ - const onFlush = 'onFlush'; - - /** - * The postFlush event occurs when the EntityManager#flush() operation is invoked and - * after all actual database operations are executed successfully. The event is only raised if there is - * actually something to do for the underlying UnitOfWork. If nothing needs to be done, - * the postFlush event is not raised. The event won't be raised if an error occurs during the - * flush operation. - * - * @var string - */ - const postFlush = 'postFlush'; - - /** - * The onClear event occurs when the EntityManager#clear() operation is invoked, - * after all references to entities have been removed from the unit of work. - * - * @var string - */ - const onClear = 'onClear'; -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Id/AbstractIdGenerator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Id/AbstractIdGenerator.php deleted file mode 100644 index d27c00b..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Id/AbstractIdGenerator.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Id; - -use Doctrine\ORM\EntityManager; - -abstract class AbstractIdGenerator -{ - /** - * Generates an identifier for an entity. - * - * @param \Doctrine\ORM\Entity $entity - * @return mixed - */ - abstract public function generate(EntityManager $em, $entity); - - /** - * Gets whether this generator is a post-insert generator which means that - * {@link generate()} must be called after the entity has been inserted - * into the database. - * - * By default, this method returns FALSE. Generators that have this requirement - * must override this method and return TRUE. - * - * @return boolean - */ - public function isPostInsertGenerator() - { - return false; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Id/AssignedGenerator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Id/AssignedGenerator.php deleted file mode 100644 index c9f9ada..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Id/AssignedGenerator.php +++ /dev/null @@ -1,71 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Id; - -use Doctrine\ORM\EntityManager; -use Doctrine\ORM\Mapping\ClassMetadata; -use Doctrine\ORM\ORMException; - -/** - * Special generator for application-assigned identifiers (doesnt really generate anything). - * - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class AssignedGenerator extends AbstractIdGenerator -{ - /** - * Returns the identifier assigned to the given entity. - * - * @param object $entity - * @return mixed - * @override - */ - public function generate(EntityManager $em, $entity) - { - $class = $em->getClassMetadata(get_class($entity)); - $idFields = $class->getIdentifierFieldNames(); - $identifier = array(); - - foreach ($idFields as $idField) { - $value = $class->reflFields[$idField]->getValue($entity); - - if ( ! isset($value)) { - throw ORMException::entityMissingAssignedIdForField($entity, $idField); - } - - if (isset($class->associationMappings[$idField])) { - if ( ! $em->getUnitOfWork()->isInIdentityMap($value)) { - throw ORMException::entityMissingForeignAssignedId($entity, $value); - } - - // NOTE: Single Columns as associated identifiers only allowed - this constraint it is enforced. - $value = current($em->getUnitOfWork()->getEntityIdentifier($value)); - } - - $identifier[$idField] = $value; - } - - return $identifier; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Id/IdentityGenerator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Id/IdentityGenerator.php deleted file mode 100644 index d244871..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Id/IdentityGenerator.php +++ /dev/null @@ -1,59 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Id; - -use Doctrine\ORM\EntityManager; - -/** - * Id generator that obtains IDs from special "identity" columns. These are columns - * that automatically get a database-generated, auto-incremented identifier on INSERT. - * This generator obtains the last insert id after such an insert. - */ -class IdentityGenerator extends AbstractIdGenerator -{ - /** @var string The name of the sequence to pass to lastInsertId(), if any. */ - private $_seqName; - - /** - * @param string $seqName The name of the sequence to pass to lastInsertId() - * to obtain the last generated identifier within the current - * database session/connection, if any. - */ - public function __construct($seqName = null) - { - $this->_seqName = $seqName; - } - - /** - * {@inheritdoc} - */ - public function generate(EntityManager $em, $entity) - { - return (int)$em->getConnection()->lastInsertId($this->_seqName); - } - - /** - * {@inheritdoc} - */ - public function isPostInsertGenerator() - { - return true; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Id/SequenceGenerator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Id/SequenceGenerator.php deleted file mode 100644 index 7924061..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Id/SequenceGenerator.php +++ /dev/null @@ -1,106 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Id; - -use Serializable, Doctrine\ORM\EntityManager; - -/** - * Represents an ID generator that uses a database sequence. - * - * @since 2.0 - * @author Roman Borschel - */ -class SequenceGenerator extends AbstractIdGenerator implements Serializable -{ - private $_allocationSize; - private $_sequenceName; - private $_nextValue = 0; - private $_maxValue = null; - - /** - * Initializes a new sequence generator. - * - * @param \Doctrine\ORM\EntityManager $em The EntityManager to use. - * @param string $sequenceName The name of the sequence. - * @param integer $allocationSize The allocation size of the sequence. - */ - public function __construct($sequenceName, $allocationSize) - { - $this->_sequenceName = $sequenceName; - $this->_allocationSize = $allocationSize; - } - - /** - * Generates an ID for the given entity. - * - * @param object $entity - * @return integer|float The generated value. - * @override - */ - public function generate(EntityManager $em, $entity) - { - if ($this->_maxValue === null || $this->_nextValue == $this->_maxValue) { - // Allocate new values - $conn = $em->getConnection(); - $sql = $conn->getDatabasePlatform()->getSequenceNextValSQL($this->_sequenceName); - - $this->_nextValue = (int)$conn->fetchColumn($sql); - $this->_maxValue = $this->_nextValue + $this->_allocationSize; - } - - return $this->_nextValue++; - } - - /** - * Gets the maximum value of the currently allocated bag of values. - * - * @return integer|float - */ - public function getCurrentMaxValue() - { - return $this->_maxValue; - } - - /** - * Gets the next value that will be returned by generate(). - * - * @return integer|float - */ - public function getNextValue() - { - return $this->_nextValue; - } - - public function serialize() - { - return serialize(array( - 'allocationSize' => $this->_allocationSize, - 'sequenceName' => $this->_sequenceName - )); - } - - public function unserialize($serialized) - { - $array = unserialize($serialized); - - $this->_sequenceName = $array['sequenceName']; - $this->_allocationSize = $array['allocationSize']; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Id/TableGenerator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Id/TableGenerator.php deleted file mode 100644 index 24b1d90..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Id/TableGenerator.php +++ /dev/null @@ -1,81 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Id; - -use Doctrine\ORM\EntityManager; - -/** - * Id generator that uses a single-row database table and a hi/lo algorithm. - * - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class TableGenerator extends AbstractIdGenerator -{ - private $_tableName; - private $_sequenceName; - private $_allocationSize; - private $_nextValue; - private $_maxValue; - - public function __construct($tableName, $sequenceName = 'default', $allocationSize = 10) - { - $this->_tableName = $tableName; - $this->_sequenceName = $sequenceName; - $this->_allocationSize = $allocationSize; - } - - public function generate(EntityManager $em, $entity) - { - if ($this->_maxValue === null || $this->_nextValue == $this->_maxValue) { - // Allocate new values - $conn = $em->getConnection(); - - if ($conn->getTransactionNestingLevel() === 0) { - // use select for update - $sql = $conn->getDatabasePlatform()->getTableHiLoCurrentValSql($this->_tableName, $this->_sequenceName); - $currentLevel = $conn->fetchColumn($sql); - - if ($currentLevel != null) { - $this->_nextValue = $currentLevel; - $this->_maxValue = $this->_nextValue + $this->_allocationSize; - - $updateSql = $conn->getDatabasePlatform()->getTableHiLoUpdateNextValSql( - $this->_tableName, $this->_sequenceName, $this->_allocationSize - ); - - if ($conn->executeUpdate($updateSql, array(1 => $currentLevel, 2 => $currentLevel+1)) !== 1) { - // no affected rows, concurrency issue, throw exception - } - } else { - // no current level returned, TableGenerator seems to be broken, throw exception - } - } else { - // only table locks help here, implement this or throw exception? - // or do we want to work with table locks exclusively? - } - } - - return $this->_nextValue++; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php deleted file mode 100644 index 049cab0..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php +++ /dev/null @@ -1,118 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Internal; - -/** - * The CommitOrderCalculator is used by the UnitOfWork to sort out the - * correct order in which changes to entities need to be persisted. - * - * @since 2.0 - * @author Roman Borschel - * @author Guilherme Blanco - */ -class CommitOrderCalculator -{ - const NOT_VISITED = 1; - const IN_PROGRESS = 2; - const VISITED = 3; - - private $_nodeStates = array(); - private $_classes = array(); // The nodes to sort - private $_relatedClasses = array(); - private $_sorted = array(); - - /** - * Clears the current graph. - * - * @return void - */ - public function clear() - { - $this->_classes = - $this->_relatedClasses = array(); - } - - /** - * Gets a valid commit order for all current nodes. - * - * Uses a depth-first search (DFS) to traverse the graph. - * The desired topological sorting is the reverse postorder of these searches. - * - * @return array The list of ordered classes. - */ - public function getCommitOrder() - { - // Check whether we need to do anything. 0 or 1 node is easy. - $nodeCount = count($this->_classes); - - if ($nodeCount <= 1) { - return ($nodeCount == 1) ? array_values($this->_classes) : array(); - } - - // Init - foreach ($this->_classes as $node) { - $this->_nodeStates[$node->name] = self::NOT_VISITED; - } - - // Go - foreach ($this->_classes as $node) { - if ($this->_nodeStates[$node->name] == self::NOT_VISITED) { - $this->_visitNode($node); - } - } - - $sorted = array_reverse($this->_sorted); - - $this->_sorted = $this->_nodeStates = array(); - - return $sorted; - } - - private function _visitNode($node) - { - $this->_nodeStates[$node->name] = self::IN_PROGRESS; - - if (isset($this->_relatedClasses[$node->name])) { - foreach ($this->_relatedClasses[$node->name] as $relatedNode) { - if ($this->_nodeStates[$relatedNode->name] == self::NOT_VISITED) { - $this->_visitNode($relatedNode); - } - } - } - - $this->_nodeStates[$node->name] = self::VISITED; - $this->_sorted[] = $node; - } - - public function addDependency($fromClass, $toClass) - { - $this->_relatedClasses[$fromClass->name][] = $toClass; - } - - public function hasClass($className) - { - return isset($this->_classes[$className]); - } - - public function addClass($class) - { - $this->_classes[$class->name] = $class; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php deleted file mode 100644 index 83609d5..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php +++ /dev/null @@ -1,389 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Internal\Hydration; - -use PDO, - Doctrine\DBAL\Connection, - Doctrine\DBAL\Types\Type, - Doctrine\ORM\EntityManager, - Doctrine\ORM\Events, - Doctrine\ORM\Mapping\ClassMetadata; - -/** - * Base class for all hydrators. A hydrator is a class that provides some form - * of transformation of an SQL result set into another structure. - * - * @since 2.0 - * @author Konsta Vesterinen - * @author Roman Borschel - * @author Guilherme Blanco - */ -abstract class AbstractHydrator -{ - /** @var ResultSetMapping The ResultSetMapping. */ - protected $_rsm; - - /** @var EntityManager The EntityManager instance. */ - protected $_em; - - /** @var AbstractPlatform The dbms Platform instance */ - protected $_platform; - - /** @var UnitOfWork The UnitOfWork of the associated EntityManager. */ - protected $_uow; - - /** @var array The cache used during row-by-row hydration. */ - protected $_cache = array(); - - /** @var Statement The statement that provides the data to hydrate. */ - protected $_stmt; - - /** @var array The query hints. */ - protected $_hints; - - /** - * Initializes a new instance of a class derived from AbstractHydrator. - * - * @param \Doctrine\ORM\EntityManager $em The EntityManager to use. - */ - public function __construct(EntityManager $em) - { - $this->_em = $em; - $this->_platform = $em->getConnection()->getDatabasePlatform(); - $this->_uow = $em->getUnitOfWork(); - } - - /** - * Initiates a row-by-row hydration. - * - * @param object $stmt - * @param object $resultSetMapping - * - * @return IterableResult - */ - public function iterate($stmt, $resultSetMapping, array $hints = array()) - { - $this->_stmt = $stmt; - $this->_rsm = $resultSetMapping; - $this->_hints = $hints; - - $evm = $this->_em->getEventManager(); - $evm->addEventListener(array(Events::onClear), $this); - - $this->prepare(); - - return new IterableResult($this); - } - - /** - * Hydrates all rows returned by the passed statement instance at once. - * - * @param object $stmt - * @param object $resultSetMapping - * @return mixed - */ - public function hydrateAll($stmt, $resultSetMapping, array $hints = array()) - { - $this->_stmt = $stmt; - $this->_rsm = $resultSetMapping; - $this->_hints = $hints; - - $this->prepare(); - - $result = $this->hydrateAllData(); - - $this->cleanup(); - - return $result; - } - - /** - * Hydrates a single row returned by the current statement instance during - * row-by-row hydration with {@link iterate()}. - * - * @return mixed - */ - public function hydrateRow() - { - $row = $this->_stmt->fetch(PDO::FETCH_ASSOC); - - if ( ! $row) { - $this->cleanup(); - - return false; - } - - $result = array(); - - $this->hydrateRowData($row, $this->_cache, $result); - - return $result; - } - - /** - * Excutes one-time preparation tasks, once each time hydration is started - * through {@link hydrateAll} or {@link iterate()}. - */ - protected function prepare() - {} - - /** - * Excutes one-time cleanup tasks at the end of a hydration that was initiated - * through {@link hydrateAll} or {@link iterate()}. - */ - protected function cleanup() - { - $this->_rsm = null; - - $this->_stmt->closeCursor(); - $this->_stmt = null; - } - - /** - * Hydrates a single row from the current statement instance. - * - * Template method. - * - * @param array $data The row data. - * @param array $cache The cache to use. - * @param mixed $result The result to fill. - */ - protected function hydrateRowData(array $data, array &$cache, array &$result) - { - throw new HydrationException("hydrateRowData() not implemented by this hydrator."); - } - - /** - * Hydrates all rows from the current statement instance at once. - */ - abstract protected function hydrateAllData(); - - /** - * Processes a row of the result set. - * - * Used for identity-based hydration (HYDRATE_OBJECT and HYDRATE_ARRAY). - * Puts the elements of a result row into a new array, grouped by the dql alias - * they belong to. The column names in the result set are mapped to their - * field names during this procedure as well as any necessary conversions on - * the values applied. Scalar values are kept in a specfic key 'scalars'. - * - * @param array $data SQL Result Row - * @param array &$cache Cache for column to field result information - * @param array &$id Dql-Alias => ID-Hash - * @param array &$nonemptyComponents Does this DQL-Alias has at least one non NULL value? - * - * @return array An array with all the fields (name => value) of the data row, - * grouped by their component alias. - */ - protected function gatherRowData(array $data, array &$cache, array &$id, array &$nonemptyComponents) - { - $rowData = array(); - - foreach ($data as $key => $value) { - // Parse each column name only once. Cache the results. - if ( ! isset($cache[$key])) { - switch (true) { - // NOTE: Most of the times it's a field mapping, so keep it first!!! - case (isset($this->_rsm->fieldMappings[$key])): - $fieldName = $this->_rsm->fieldMappings[$key]; - $classMetadata = $this->_em->getClassMetadata($this->_rsm->declaringClasses[$key]); - - $cache[$key]['fieldName'] = $fieldName; - $cache[$key]['type'] = Type::getType($classMetadata->fieldMappings[$fieldName]['type']); - $cache[$key]['isIdentifier'] = $classMetadata->isIdentifier($fieldName); - $cache[$key]['dqlAlias'] = $this->_rsm->columnOwnerMap[$key]; - break; - - case (isset($this->_rsm->scalarMappings[$key])): - $cache[$key]['fieldName'] = $this->_rsm->scalarMappings[$key]; - $cache[$key]['type'] = Type::getType($this->_rsm->typeMappings[$key]); - $cache[$key]['isScalar'] = true; - break; - - case (isset($this->_rsm->metaMappings[$key])): - // Meta column (has meaning in relational schema only, i.e. foreign keys or discriminator columns). - $fieldName = $this->_rsm->metaMappings[$key]; - $classMetadata = $this->_em->getClassMetadata($this->_rsm->aliasMap[$this->_rsm->columnOwnerMap[$key]]); - - $cache[$key]['isMetaColumn'] = true; - $cache[$key]['fieldName'] = $fieldName; - $cache[$key]['dqlAlias'] = $this->_rsm->columnOwnerMap[$key]; - $cache[$key]['isIdentifier'] = isset($this->_rsm->isIdentifierColumn[$cache[$key]['dqlAlias']][$key]); - break; - - default: - // this column is a left over, maybe from a LIMIT query hack for example in Oracle or DB2 - // maybe from an additional column that has not been defined in a NativeQuery ResultSetMapping. - continue 2; - } - } - - if (isset($cache[$key]['isScalar'])) { - $value = $cache[$key]['type']->convertToPHPValue($value, $this->_platform); - - $rowData['scalars'][$cache[$key]['fieldName']] = $value; - - continue; - } - - $dqlAlias = $cache[$key]['dqlAlias']; - - if ($cache[$key]['isIdentifier']) { - $id[$dqlAlias] .= '|' . $value; - } - - if (isset($cache[$key]['isMetaColumn'])) { - if ( ! isset($rowData[$dqlAlias][$cache[$key]['fieldName']]) && $value !== null) { - $rowData[$dqlAlias][$cache[$key]['fieldName']] = $value; - if ($cache[$key]['isIdentifier']) { - $nonemptyComponents[$dqlAlias] = true; - } - } - - continue; - } - - // in an inheritance hierarchy the same field could be defined several times. - // We overwrite this value so long we dont have a non-null value, that value we keep. - // Per definition it cannot be that a field is defined several times and has several values. - if (isset($rowData[$dqlAlias][$cache[$key]['fieldName']]) && $value === null) { - continue; - } - - $rowData[$dqlAlias][$cache[$key]['fieldName']] = $cache[$key]['type']->convertToPHPValue($value, $this->_platform); - - if ( ! isset($nonemptyComponents[$dqlAlias]) && $value !== null) { - $nonemptyComponents[$dqlAlias] = true; - } - } - - return $rowData; - } - - /** - * Processes a row of the result set. - * - * Used for HYDRATE_SCALAR. This is a variant of _gatherRowData() that - * simply converts column names to field names and properly converts the - * values according to their types. The resulting row has the same number - * of elements as before. - * - * @param array $data - * @param array $cache - * - * @return array The processed row. - */ - protected function gatherScalarRowData(&$data, &$cache) - { - $rowData = array(); - - foreach ($data as $key => $value) { - // Parse each column name only once. Cache the results. - if ( ! isset($cache[$key])) { - switch (true) { - // NOTE: During scalar hydration, most of the times it's a scalar mapping, keep it first!!! - case (isset($this->_rsm->scalarMappings[$key])): - $cache[$key]['fieldName'] = $this->_rsm->scalarMappings[$key]; - $cache[$key]['isScalar'] = true; - break; - - case (isset($this->_rsm->fieldMappings[$key])): - $fieldName = $this->_rsm->fieldMappings[$key]; - $classMetadata = $this->_em->getClassMetadata($this->_rsm->declaringClasses[$key]); - - $cache[$key]['fieldName'] = $fieldName; - $cache[$key]['type'] = Type::getType($classMetadata->fieldMappings[$fieldName]['type']); - $cache[$key]['dqlAlias'] = $this->_rsm->columnOwnerMap[$key]; - break; - - case (isset($this->_rsm->metaMappings[$key])): - // Meta column (has meaning in relational schema only, i.e. foreign keys or discriminator columns). - $cache[$key]['isMetaColumn'] = true; - $cache[$key]['fieldName'] = $this->_rsm->metaMappings[$key]; - $cache[$key]['dqlAlias'] = $this->_rsm->columnOwnerMap[$key]; - break; - - default: - // this column is a left over, maybe from a LIMIT query hack for example in Oracle or DB2 - // maybe from an additional column that has not been defined in a NativeQuery ResultSetMapping. - continue 2; - } - } - - $fieldName = $cache[$key]['fieldName']; - - switch (true) { - case (isset($cache[$key]['isScalar'])): - $rowData[$fieldName] = $value; - break; - - case (isset($cache[$key]['isMetaColumn'])): - $rowData[$cache[$key]['dqlAlias'] . '_' . $fieldName] = $value; - break; - - default: - $value = $cache[$key]['type']->convertToPHPValue($value, $this->_platform); - - $rowData[$cache[$key]['dqlAlias'] . '_' . $fieldName] = $value; - } - } - - return $rowData; - } - - /** - * Register entity as managed in UnitOfWork. - * - * @param \Doctrine\ORM\Mapping\ClassMetadata $class - * @param object $entity - * @param array $data - * - * @todo The "$id" generation is the same of UnitOfWork#createEntity. Remove this duplication somehow - */ - protected function registerManaged(ClassMetadata $class, $entity, array $data) - { - if ($class->isIdentifierComposite) { - $id = array(); - foreach ($class->identifier as $fieldName) { - if (isset($class->associationMappings[$fieldName])) { - $id[$fieldName] = $data[$class->associationMappings[$fieldName]['joinColumns'][0]['name']]; - } else { - $id[$fieldName] = $data[$fieldName]; - } - } - } else { - if (isset($class->associationMappings[$class->identifier[0]])) { - $id = array($class->identifier[0] => $data[$class->associationMappings[$class->identifier[0]]['joinColumns'][0]['name']]); - } else { - $id = array($class->identifier[0] => $data[$class->identifier[0]]); - } - } - - $this->_em->getUnitOfWork()->registerManaged($entity, $id, $data); - } - - /** - * When executed in a hydrate() loop we have to clear internal state to - * decrease memory consumption. - */ - public function onClear($eventArgs) - { - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php deleted file mode 100644 index 9a8fcee..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php +++ /dev/null @@ -1,289 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Internal\Hydration; - -use PDO, Doctrine\DBAL\Connection, Doctrine\ORM\Mapping\ClassMetadata; - -/** - * The ArrayHydrator produces a nested array "graph" that is often (not always) - * interchangeable with the corresponding object graph for read-only access. - * - * @since 2.0 - * @author Roman Borschel - * @author Guilherme Blanco - */ -class ArrayHydrator extends AbstractHydrator -{ - private $_ce = array(); - private $_rootAliases = array(); - private $_isSimpleQuery = false; - private $_identifierMap = array(); - private $_resultPointers = array(); - private $_idTemplate = array(); - private $_resultCounter = 0; - - /** - * {@inheritdoc} - */ - protected function prepare() - { - $this->_isSimpleQuery = count($this->_rsm->aliasMap) <= 1; - $this->_identifierMap = array(); - $this->_resultPointers = array(); - $this->_idTemplate = array(); - $this->_resultCounter = 0; - - foreach ($this->_rsm->aliasMap as $dqlAlias => $className) { - $this->_identifierMap[$dqlAlias] = array(); - $this->_resultPointers[$dqlAlias] = array(); - $this->_idTemplate[$dqlAlias] = ''; - } - } - - /** - * {@inheritdoc} - */ - protected function hydrateAllData() - { - $result = array(); - $cache = array(); - - while ($data = $this->_stmt->fetch(PDO::FETCH_ASSOC)) { - $this->hydrateRowData($data, $cache, $result); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - protected function hydrateRowData(array $row, array &$cache, array &$result) - { - // 1) Initialize - $id = $this->_idTemplate; // initialize the id-memory - $nonemptyComponents = array(); - $rowData = $this->gatherRowData($row, $cache, $id, $nonemptyComponents); - - // Extract scalar values. They're appended at the end. - if (isset($rowData['scalars'])) { - $scalars = $rowData['scalars']; - - unset($rowData['scalars']); - - if (empty($rowData)) { - ++$this->_resultCounter; - } - } - - // 2) Now hydrate the data found in the current row. - foreach ($rowData as $dqlAlias => $data) { - $index = false; - - if (isset($this->_rsm->parentAliasMap[$dqlAlias])) { - // It's a joined result - - $parent = $this->_rsm->parentAliasMap[$dqlAlias]; - $path = $parent . '.' . $dqlAlias; - - // missing parent data, skipping as RIGHT JOIN hydration is not supported. - if ( ! isset($nonemptyComponents[$parent]) ) { - continue; - } - - // Get a reference to the right element in the result tree. - // This element will get the associated element attached. - if ($this->_rsm->isMixed && isset($this->_rootAliases[$parent])) { - $first = reset($this->_resultPointers); - // TODO: Exception if $key === null ? - $baseElement =& $this->_resultPointers[$parent][key($first)]; - } else if (isset($this->_resultPointers[$parent])) { - $baseElement =& $this->_resultPointers[$parent]; - } else { - unset($this->_resultPointers[$dqlAlias]); // Ticket #1228 - continue; - } - - $relationAlias = $this->_rsm->relationMap[$dqlAlias]; - $relation = $this->getClassMetadata($this->_rsm->aliasMap[$parent])->associationMappings[$relationAlias]; - - // Check the type of the relation (many or single-valued) - if ( ! ($relation['type'] & ClassMetadata::TO_ONE)) { - $oneToOne = false; - - if (isset($nonemptyComponents[$dqlAlias])) { - if ( ! isset($baseElement[$relationAlias])) { - $baseElement[$relationAlias] = array(); - } - - $indexExists = isset($this->_identifierMap[$path][$id[$parent]][$id[$dqlAlias]]); - $index = $indexExists ? $this->_identifierMap[$path][$id[$parent]][$id[$dqlAlias]] : false; - $indexIsValid = $index !== false ? isset($baseElement[$relationAlias][$index]) : false; - - if ( ! $indexExists || ! $indexIsValid) { - $element = $data; - if (isset($this->_rsm->indexByMap[$dqlAlias])) { - $baseElement[$relationAlias][$row[$this->_rsm->indexByMap[$dqlAlias]]] = $element; - } else { - $baseElement[$relationAlias][] = $element; - } - - end($baseElement[$relationAlias]); - - $this->_identifierMap[$path][$id[$parent]][$id[$dqlAlias]] = key($baseElement[$relationAlias]); - } - } else if ( ! isset($baseElement[$relationAlias])) { - $baseElement[$relationAlias] = array(); - } - } else { - $oneToOne = true; - - if ( ! isset($nonemptyComponents[$dqlAlias]) && ! isset($baseElement[$relationAlias])) { - $baseElement[$relationAlias] = null; - } else if ( ! isset($baseElement[$relationAlias])) { - $baseElement[$relationAlias] = $data; - } - } - - $coll =& $baseElement[$relationAlias]; - - if ($coll !== null) { - $this->updateResultPointer($coll, $index, $dqlAlias, $oneToOne); - } - - } else { - // It's a root result element - - $this->_rootAliases[$dqlAlias] = true; // Mark as root - $entityKey = $this->_rsm->entityMappings[$dqlAlias] ?: 0; - - // if this row has a NULL value for the root result id then make it a null result. - if ( ! isset($nonemptyComponents[$dqlAlias]) ) { - if ($this->_rsm->isMixed) { - $result[] = array($entityKey => null); - } else { - $result[] = null; - } - $resultKey = $this->_resultCounter; - ++$this->_resultCounter; - continue; - } - - // Check for an existing element - if ($this->_isSimpleQuery || ! isset($this->_identifierMap[$dqlAlias][$id[$dqlAlias]])) { - $element = $rowData[$dqlAlias]; - if ($this->_rsm->isMixed) { - $element = array($entityKey => $element); - } - - if (isset($this->_rsm->indexByMap[$dqlAlias])) { - $resultKey = $row[$this->_rsm->indexByMap[$dqlAlias]]; - $result[$resultKey] = $element; - } else { - $resultKey = $this->_resultCounter; - $result[] = $element; - ++$this->_resultCounter; - } - - $this->_identifierMap[$dqlAlias][$id[$dqlAlias]] = $resultKey; - } else { - $index = $this->_identifierMap[$dqlAlias][$id[$dqlAlias]]; - $resultKey = $index; - /*if ($this->_rsm->isMixed) { - $result[] =& $result[$index]; - ++$this->_resultCounter; - }*/ - } - $this->updateResultPointer($result, $index, $dqlAlias, false); - } - } - - // Append scalar values to mixed result sets - if (isset($scalars)) { - if ( ! isset($resultKey) ) { - // this only ever happens when no object is fetched (scalar result only) - if (isset($this->_rsm->indexByMap['scalars'])) { - $resultKey = $row[$this->_rsm->indexByMap['scalars']]; - } else { - $resultKey = $this->_resultCounter - 1; - } - } - - foreach ($scalars as $name => $value) { - $result[$resultKey][$name] = $value; - } - } - } - - /** - * Updates the result pointer for an Entity. The result pointers point to the - * last seen instance of each Entity type. This is used for graph construction. - * - * @param array $coll The element. - * @param boolean|integer $index Index of the element in the collection. - * @param string $dqlAlias - * @param boolean $oneToOne Whether it is a single-valued association or not. - */ - private function updateResultPointer(array &$coll, $index, $dqlAlias, $oneToOne) - { - if ($coll === null) { - unset($this->_resultPointers[$dqlAlias]); // Ticket #1228 - - return; - } - - if ($index !== false) { - $this->_resultPointers[$dqlAlias] =& $coll[$index]; - - return; - } - - if ( ! $coll) { - return; - } - - if ($oneToOne) { - $this->_resultPointers[$dqlAlias] =& $coll; - - return; - } - - end($coll); - $this->_resultPointers[$dqlAlias] =& $coll[key($coll)]; - - return; - } - - /** - * Retrieve ClassMetadata associated to entity class name. - * - * @param string $className - * - * @return \Doctrine\ORM\Mapping\ClassMetadata - */ - private function getClassMetadata($className) - { - if ( ! isset($this->_ce[$className])) { - $this->_ce[$className] = $this->_em->getClassMetadata($className); - } - - return $this->_ce[$className]; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php deleted file mode 100644 index 147f6ac..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php +++ /dev/null @@ -1,26 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Internal\Hydration; - -/** - * Represents a result structure that can be iterated over, hydrating row-by-row - * during the iteration. An IterableResult is obtained by AbstractHydrator#iterate(). - * - * @author robo - * @since 2.0 - */ -class IterableResult implements \Iterator -{ - /** - * @var \Doctrine\ORM\Internal\Hydration\AbstractHydrator - */ - private $_hydrator; - - /** - * @var boolean - */ - private $_rewinded = false; - - /** - * @var integer - */ - private $_key = -1; - - /** - * @var object - */ - private $_current = null; - - /** - * @param \Doctrine\ORM\Internal\Hydration\AbstractHydrator $hydrator - */ - public function __construct($hydrator) - { - $this->_hydrator = $hydrator; - } - - public function rewind() - { - if ($this->_rewinded == true) { - throw new HydrationException("Can only iterate a Result once."); - } else { - $this->_current = $this->next(); - $this->_rewinded = true; - } - } - - /** - * Gets the next set of results. - * - * @return array - */ - public function next() - { - $this->_current = $this->_hydrator->hydrateRow(); - $this->_key++; - return $this->_current; - } - - /** - * @return mixed - */ - public function current() - { - return $this->_current; - } - - /** - * @return int - */ - public function key() - { - return $this->_key; - } - - /** - * @return bool - */ - public function valid() - { - return ($this->_current!=false); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php deleted file mode 100644 index 2f960da..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php +++ /dev/null @@ -1,536 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Internal\Hydration; - -use PDO, - Doctrine\ORM\Mapping\ClassMetadata, - Doctrine\ORM\PersistentCollection, - Doctrine\ORM\Query, - Doctrine\ORM\Event\LifecycleEventArgs, - Doctrine\ORM\Events, - Doctrine\Common\Collections\ArrayCollection, - Doctrine\Common\Collections\Collection, - Doctrine\ORM\Proxy\Proxy; - -/** - * The ObjectHydrator constructs an object graph out of an SQL result set. - * - * @since 2.0 - * @author Roman Borschel - * @author Guilherme Blanco - * - * @internal Highly performance-sensitive code. - */ -class ObjectHydrator extends AbstractHydrator -{ - /* Local ClassMetadata cache to avoid going to the EntityManager all the time. - * This local cache is maintained between hydration runs and not cleared. - */ - private $_ce = array(); - - /* The following parts are reinitialized on every hydration run. */ - - private $_identifierMap; - private $_resultPointers; - private $_idTemplate; - private $_resultCounter; - private $_rootAliases = array(); - private $_initializedCollections = array(); - private $_existingCollections = array(); - - - /** @override */ - protected function prepare() - { - $this->_identifierMap = - $this->_resultPointers = - $this->_idTemplate = array(); - - $this->_resultCounter = 0; - - if ( ! isset($this->_hints['deferEagerLoad'])) { - $this->_hints['deferEagerLoad'] = true; - } - - foreach ($this->_rsm->aliasMap as $dqlAlias => $className) { - $this->_identifierMap[$dqlAlias] = array(); - $this->_idTemplate[$dqlAlias] = ''; - - if ( ! isset($this->_ce[$className])) { - $this->_ce[$className] = $this->_em->getClassMetadata($className); - } - - // Remember which associations are "fetch joined", so that we know where to inject - // collection stubs or proxies and where not. - if ( ! isset($this->_rsm->relationMap[$dqlAlias])) { - continue; - } - - if ( ! isset($this->_rsm->aliasMap[$this->_rsm->parentAliasMap[$dqlAlias]])) { - throw HydrationException::parentObjectOfRelationNotFound($dqlAlias, $this->_rsm->parentAliasMap[$dqlAlias]); - } - - $sourceClassName = $this->_rsm->aliasMap[$this->_rsm->parentAliasMap[$dqlAlias]]; - $sourceClass = $this->_getClassMetadata($sourceClassName); - $assoc = $sourceClass->associationMappings[$this->_rsm->relationMap[$dqlAlias]]; - - $this->_hints['fetched'][$this->_rsm->parentAliasMap[$dqlAlias]][$assoc['fieldName']] = true; - - if ($assoc['type'] === ClassMetadata::MANY_TO_MANY) { - continue; - } - - // Mark any non-collection opposite sides as fetched, too. - if ($assoc['mappedBy']) { - $this->_hints['fetched'][$dqlAlias][$assoc['mappedBy']] = true; - - continue; - } - - // handle fetch-joined owning side bi-directional one-to-one associations - if ($assoc['inversedBy']) { - $class = $this->_ce[$className]; - $inverseAssoc = $class->associationMappings[$assoc['inversedBy']]; - - if ( ! ($inverseAssoc['type'] & ClassMetadata::TO_ONE)) { - continue; - } - - $this->_hints['fetched'][$dqlAlias][$inverseAssoc['fieldName']] = true; - } - } - } - - /** - * {@inheritdoc} - */ - protected function cleanup() - { - $eagerLoad = (isset($this->_hints['deferEagerLoad'])) && $this->_hints['deferEagerLoad'] == true; - - parent::cleanup(); - - $this->_identifierMap = - $this->_initializedCollections = - $this->_existingCollections = - $this->_resultPointers = array(); - - if ($eagerLoad) { - $this->_em->getUnitOfWork()->triggerEagerLoads(); - } - } - - /** - * {@inheritdoc} - */ - protected function hydrateAllData() - { - $result = array(); - $cache = array(); - - while ($row = $this->_stmt->fetch(PDO::FETCH_ASSOC)) { - $this->hydrateRowData($row, $cache, $result); - } - - // Take snapshots from all newly initialized collections - foreach ($this->_initializedCollections as $coll) { - $coll->takeSnapshot(); - } - - return $result; - } - - /** - * Initializes a related collection. - * - * @param object $entity The entity to which the collection belongs. - * @param ClassMetadata $class - * @param string $name The name of the field on the entity that holds the collection. - * @param string $parentDqlAlias Alias of the parent fetch joining this collection. - */ - private function _initRelatedCollection($entity, $class, $fieldName, $parentDqlAlias) - { - $oid = spl_object_hash($entity); - $relation = $class->associationMappings[$fieldName]; - $value = $class->reflFields[$fieldName]->getValue($entity); - - if ($value === null) { - $value = new ArrayCollection; - } - - if ( ! $value instanceof PersistentCollection) { - $value = new PersistentCollection( - $this->_em, $this->_ce[$relation['targetEntity']], $value - ); - $value->setOwner($entity, $relation); - - $class->reflFields[$fieldName]->setValue($entity, $value); - $this->_uow->setOriginalEntityProperty($oid, $fieldName, $value); - - $this->_initializedCollections[$oid . $fieldName] = $value; - } else if ( - isset($this->_hints[Query::HINT_REFRESH]) || - isset($this->_hints['fetched'][$parentDqlAlias][$fieldName]) && - ! $value->isInitialized() - ) { - // Is already PersistentCollection, but either REFRESH or FETCH-JOIN and UNINITIALIZED! - $value->setDirty(false); - $value->setInitialized(true); - $value->unwrap()->clear(); - - $this->_initializedCollections[$oid . $fieldName] = $value; - } else { - // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN! - $this->_existingCollections[$oid . $fieldName] = $value; - } - - return $value; - } - - /** - * Gets an entity instance. - * - * @param $data The instance data. - * @param $dqlAlias The DQL alias of the entity's class. - * @return object The entity. - */ - private function _getEntity(array $data, $dqlAlias) - { - $className = $this->_rsm->aliasMap[$dqlAlias]; - - if (isset($this->_rsm->discriminatorColumns[$dqlAlias])) { - $discrColumn = $this->_rsm->metaMappings[$this->_rsm->discriminatorColumns[$dqlAlias]]; - - if ($data[$discrColumn] === "") { - throw HydrationException::emptyDiscriminatorValue($dqlAlias); - } - - $className = $this->_ce[$className]->discriminatorMap[$data[$discrColumn]]; - - unset($data[$discrColumn]); - } - - if (isset($this->_hints[Query::HINT_REFRESH_ENTITY]) && isset($this->_rootAliases[$dqlAlias])) { - $this->registerManaged($this->_ce[$className], $this->_hints[Query::HINT_REFRESH_ENTITY], $data); - } - - $this->_hints['fetchAlias'] = $dqlAlias; - - return $this->_uow->createEntity($className, $data, $this->_hints); - } - - private function _getEntityFromIdentityMap($className, array $data) - { - // TODO: Abstract this code and UnitOfWork::createEntity() equivalent? - $class = $this->_ce[$className]; - - /* @var $class ClassMetadata */ - if ($class->isIdentifierComposite) { - $idHash = ''; - foreach ($class->identifier as $fieldName) { - if (isset($class->associationMappings[$fieldName])) { - $idHash .= $data[$class->associationMappings[$fieldName]['joinColumns'][0]['name']] . ' '; - } else { - $idHash .= $data[$fieldName] . ' '; - } - } - return $this->_uow->tryGetByIdHash(rtrim($idHash), $class->rootEntityName); - } else if (isset($class->associationMappings[$class->identifier[0]])) { - return $this->_uow->tryGetByIdHash($data[$class->associationMappings[$class->identifier[0]]['joinColumns'][0]['name']], $class->rootEntityName); - } else { - return $this->_uow->tryGetByIdHash($data[$class->identifier[0]], $class->rootEntityName); - } - } - - /** - * Gets a ClassMetadata instance from the local cache. - * If the instance is not yet in the local cache, it is loaded into the - * local cache. - * - * @param string $className The name of the class. - * @return ClassMetadata - */ - private function _getClassMetadata($className) - { - if ( ! isset($this->_ce[$className])) { - $this->_ce[$className] = $this->_em->getClassMetadata($className); - } - - return $this->_ce[$className]; - } - - /** - * Hydrates a single row in an SQL result set. - * - * @internal - * First, the data of the row is split into chunks where each chunk contains data - * that belongs to a particular component/class. Afterwards, all these chunks - * are processed, one after the other. For each chunk of class data only one of the - * following code paths is executed: - * - * Path A: The data chunk belongs to a joined/associated object and the association - * is collection-valued. - * Path B: The data chunk belongs to a joined/associated object and the association - * is single-valued. - * Path C: The data chunk belongs to a root result element/object that appears in the topmost - * level of the hydrated result. A typical example are the objects of the type - * specified by the FROM clause in a DQL query. - * - * @param array $data The data of the row to process. - * @param array $cache The cache to use. - * @param array $result The result array to fill. - */ - protected function hydrateRowData(array $row, array &$cache, array &$result) - { - // Initialize - $id = $this->_idTemplate; // initialize the id-memory - $nonemptyComponents = array(); - // Split the row data into chunks of class data. - $rowData = $this->gatherRowData($row, $cache, $id, $nonemptyComponents); - - // Extract scalar values. They're appended at the end. - if (isset($rowData['scalars'])) { - $scalars = $rowData['scalars']; - - unset($rowData['scalars']); - - if (empty($rowData)) { - ++$this->_resultCounter; - } - } - - // Hydrate the data chunks - foreach ($rowData as $dqlAlias => $data) { - $entityName = $this->_rsm->aliasMap[$dqlAlias]; - - if (isset($this->_rsm->parentAliasMap[$dqlAlias])) { - // It's a joined result - - $parentAlias = $this->_rsm->parentAliasMap[$dqlAlias]; - // we need the $path to save into the identifier map which entities were already - // seen for this parent-child relationship - $path = $parentAlias . '.' . $dqlAlias; - - // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs - if (!isset($nonemptyComponents[$parentAlias])) { - // TODO: Add special case code where we hydrate the right join objects into identity map at least - continue; - } - - // Get a reference to the parent object to which the joined element belongs. - if ($this->_rsm->isMixed && isset($this->_rootAliases[$parentAlias])) { - $first = reset($this->_resultPointers); - $parentObject = $first[key($first)]; - } else if (isset($this->_resultPointers[$parentAlias])) { - $parentObject = $this->_resultPointers[$parentAlias]; - } else { - // Parent object of relation not found, so skip it. - continue; - } - - $parentClass = $this->_ce[$this->_rsm->aliasMap[$parentAlias]]; - $oid = spl_object_hash($parentObject); - $relationField = $this->_rsm->relationMap[$dqlAlias]; - $relation = $parentClass->associationMappings[$relationField]; - $reflField = $parentClass->reflFields[$relationField]; - - // Check the type of the relation (many or single-valued) - if ( ! ($relation['type'] & ClassMetadata::TO_ONE)) { - $reflFieldValue = $reflField->getValue($parentObject); - // PATH A: Collection-valued association - if (isset($nonemptyComponents[$dqlAlias])) { - $collKey = $oid . $relationField; - if (isset($this->_initializedCollections[$collKey])) { - $reflFieldValue = $this->_initializedCollections[$collKey]; - } else if ( ! isset($this->_existingCollections[$collKey])) { - $reflFieldValue = $this->_initRelatedCollection($parentObject, $parentClass, $relationField, $parentAlias); - } - - $indexExists = isset($this->_identifierMap[$path][$id[$parentAlias]][$id[$dqlAlias]]); - $index = $indexExists ? $this->_identifierMap[$path][$id[$parentAlias]][$id[$dqlAlias]] : false; - $indexIsValid = $index !== false ? isset($reflFieldValue[$index]) : false; - - if ( ! $indexExists || ! $indexIsValid) { - if (isset($this->_existingCollections[$collKey])) { - // Collection exists, only look for the element in the identity map. - if ($element = $this->_getEntityFromIdentityMap($entityName, $data)) { - $this->_resultPointers[$dqlAlias] = $element; - } else { - unset($this->_resultPointers[$dqlAlias]); - } - } else { - $element = $this->_getEntity($data, $dqlAlias); - - if (isset($this->_rsm->indexByMap[$dqlAlias])) { - $indexValue = $row[$this->_rsm->indexByMap[$dqlAlias]]; - $reflFieldValue->hydrateSet($indexValue, $element); - $this->_identifierMap[$path][$id[$parentAlias]][$id[$dqlAlias]] = $indexValue; - } else { - $reflFieldValue->hydrateAdd($element); - $reflFieldValue->last(); - $this->_identifierMap[$path][$id[$parentAlias]][$id[$dqlAlias]] = $reflFieldValue->key(); - } - // Update result pointer - $this->_resultPointers[$dqlAlias] = $element; - } - } else { - // Update result pointer - $this->_resultPointers[$dqlAlias] = $reflFieldValue[$index]; - } - } else if ( ! $reflFieldValue) { - $reflFieldValue = $this->_initRelatedCollection($parentObject, $parentClass, $relationField, $parentAlias); - } else if ($reflFieldValue instanceof PersistentCollection && $reflFieldValue->isInitialized() === false) { - $reflFieldValue->setInitialized(true); - } - - } else { - // PATH B: Single-valued association - $reflFieldValue = $reflField->getValue($parentObject); - if ( ! $reflFieldValue || isset($this->_hints[Query::HINT_REFRESH]) || ($reflFieldValue instanceof Proxy && !$reflFieldValue->__isInitialized__)) { - // we only need to take action if this value is null, - // we refresh the entity or its an unitialized proxy. - if (isset($nonemptyComponents[$dqlAlias])) { - $element = $this->_getEntity($data, $dqlAlias); - $reflField->setValue($parentObject, $element); - $this->_uow->setOriginalEntityProperty($oid, $relationField, $element); - $targetClass = $this->_ce[$relation['targetEntity']]; - - if ($relation['isOwningSide']) { - //TODO: Just check hints['fetched'] here? - // If there is an inverse mapping on the target class its bidirectional - if ($relation['inversedBy']) { - $inverseAssoc = $targetClass->associationMappings[$relation['inversedBy']]; - if ($inverseAssoc['type'] & ClassMetadata::TO_ONE) { - $targetClass->reflFields[$inverseAssoc['fieldName']]->setValue($element, $parentObject); - $this->_uow->setOriginalEntityProperty(spl_object_hash($element), $inverseAssoc['fieldName'], $parentObject); - } - } else if ($parentClass === $targetClass && $relation['mappedBy']) { - // Special case: bi-directional self-referencing one-one on the same class - $targetClass->reflFields[$relationField]->setValue($element, $parentObject); - } - } else { - // For sure bidirectional, as there is no inverse side in unidirectional mappings - $targetClass->reflFields[$relation['mappedBy']]->setValue($element, $parentObject); - $this->_uow->setOriginalEntityProperty(spl_object_hash($element), $relation['mappedBy'], $parentObject); - } - // Update result pointer - $this->_resultPointers[$dqlAlias] = $element; - } else { - $this->_uow->setOriginalEntityProperty($oid, $relationField, null); - } - // else leave $reflFieldValue null for single-valued associations - } else { - // Update result pointer - $this->_resultPointers[$dqlAlias] = $reflFieldValue; - } - } - } else { - // PATH C: Its a root result element - $this->_rootAliases[$dqlAlias] = true; // Mark as root alias - $entityKey = $this->_rsm->entityMappings[$dqlAlias] ?: 0; - - // if this row has a NULL value for the root result id then make it a null result. - if ( ! isset($nonemptyComponents[$dqlAlias]) ) { - if ($this->_rsm->isMixed) { - $result[] = array($entityKey => null); - } else { - $result[] = null; - } - $resultKey = $this->_resultCounter; - ++$this->_resultCounter; - continue; - } - - // check for existing result from the iterations before - if ( ! isset($this->_identifierMap[$dqlAlias][$id[$dqlAlias]])) { - $element = $this->_getEntity($rowData[$dqlAlias], $dqlAlias); - if ($this->_rsm->isMixed) { - $element = array($entityKey => $element); - } - - if (isset($this->_rsm->indexByMap[$dqlAlias])) { - $resultKey = $row[$this->_rsm->indexByMap[$dqlAlias]]; - - if (isset($this->_hints['collection'])) { - $this->_hints['collection']->hydrateSet($resultKey, $element); - } - - $result[$resultKey] = $element; - } else { - $resultKey = $this->_resultCounter; - ++$this->_resultCounter; - - if (isset($this->_hints['collection'])) { - $this->_hints['collection']->hydrateAdd($element); - } - - $result[] = $element; - } - - $this->_identifierMap[$dqlAlias][$id[$dqlAlias]] = $resultKey; - - // Update result pointer - $this->_resultPointers[$dqlAlias] = $element; - - } else { - // Update result pointer - $index = $this->_identifierMap[$dqlAlias][$id[$dqlAlias]]; - $this->_resultPointers[$dqlAlias] = $result[$index]; - $resultKey = $index; - /*if ($this->_rsm->isMixed) { - $result[] = $result[$index]; - ++$this->_resultCounter; - }*/ - } - } - } - - // Append scalar values to mixed result sets - if (isset($scalars)) { - if ( ! isset($resultKey) ) { - if (isset($this->_rsm->indexByMap['scalars'])) { - $resultKey = $row[$this->_rsm->indexByMap['scalars']]; - } else { - $resultKey = $this->_resultCounter - 1; - } - } - - foreach ($scalars as $name => $value) { - $result[$resultKey][$name] = $value; - } - } - } - - /** - * When executed in a hydrate() loop we may have to clear internal state to - * decrease memory consumption. - */ - public function onClear($eventArgs) - { - parent::onClear($eventArgs); - - $aliases = array_keys($this->_identifierMap); - $this->_identifierMap = array(); - - foreach ($aliases as $alias) { - $this->_identifierMap[$alias] = array(); - } - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php deleted file mode 100644 index d02651b..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php +++ /dev/null @@ -1,57 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Internal\Hydration; - -use Doctrine\DBAL\Connection; - -/** - * Hydrator that produces flat, rectangular results of scalar data. - * The created result is almost the same as a regular SQL result set, except - * that column names are mapped to field names and data type conversions take place. - * - * @since 2.0 - * @author Roman Borschel - * @author Guilherme Blanco - */ -class ScalarHydrator extends AbstractHydrator -{ - /** - * {@inheritdoc} - */ - protected function hydrateAllData() - { - $result = array(); - $cache = array(); - - while ($data = $this->_stmt->fetch(\PDO::FETCH_ASSOC)) { - $this->hydrateRowData($data, $cache, $result); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - protected function hydrateRowData(array $data, array &$cache, array &$result) - { - $result[] = $this->gatherScalarRowData($data, $cache); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php deleted file mode 100644 index 09c2c7f..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php +++ /dev/null @@ -1,183 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Internal\Hydration; - -use \PDO, - Doctrine\DBAL\Types\Type, - Doctrine\ORM\Mapping\ClassMetadata, - Doctrine\ORM\Event\LifecycleEventArgs, - Doctrine\ORM\Events, - Doctrine\ORM\Query; - -class SimpleObjectHydrator extends AbstractHydrator -{ - /** - * @var ClassMetadata - */ - private $class; - - /** - * @var array - */ - private $declaringClasses = array(); - - /** - * {@inheritdoc} - */ - protected function hydrateAllData() - { - $result = array(); - $cache = array(); - - while ($row = $this->_stmt->fetch(PDO::FETCH_ASSOC)) { - $this->hydrateRowData($row, $cache, $result); - } - - $this->_em->getUnitOfWork()->triggerEagerLoads(); - - return $result; - } - - /** - * {@inheritdoc} - */ - protected function prepare() - { - if (count($this->_rsm->aliasMap) !== 1) { - throw new \RuntimeException("Cannot use SimpleObjectHydrator with a ResultSetMapping that contains more than one object result."); - } - - if ($this->_rsm->scalarMappings) { - throw new \RuntimeException("Cannot use SimpleObjectHydrator with a ResultSetMapping that contains scalar mappings."); - } - - $this->class = $this->_em->getClassMetadata(reset($this->_rsm->aliasMap)); - - // We only need to add declaring classes if we have inheritance. - if ($this->class->inheritanceType === ClassMetadata::INHERITANCE_TYPE_NONE) { - return; - } - - foreach ($this->_rsm->declaringClasses AS $column => $class) { - $this->declaringClasses[$column] = $this->_em->getClassMetadata($class); - } - } - - /** - * {@inheritdoc} - */ - protected function hydrateRowData(array $sqlResult, array &$cache, array &$result) - { - $entityName = $this->class->name; - $data = array(); - - // We need to find the correct entity class name if we have inheritance in resultset - if ($this->class->inheritanceType !== ClassMetadata::INHERITANCE_TYPE_NONE) { - $discrColumnName = $this->_platform->getSQLResultCasing($this->class->discriminatorColumn['name']); - - if ($sqlResult[$discrColumnName] === '') { - throw HydrationException::emptyDiscriminatorValue(key($this->_rsm->aliasMap)); - } - - $entityName = $this->class->discriminatorMap[$sqlResult[$discrColumnName]]; - - unset($sqlResult[$discrColumnName]); - } - - foreach ($sqlResult as $column => $value) { - // Hydrate column information if not yet present - if ( ! isset($cache[$column])) { - if (($info = $this->hydrateColumnInfo($entityName, $column)) === null) { - continue; - } - - $cache[$column] = $info; - } - - // Convert field to a valid PHP value - if (isset($cache[$column]['field'])) { - $type = Type::getType($cache[$column]['class']->fieldMappings[$cache[$column]['name']]['type']); - $value = $type->convertToPHPValue($value, $this->_platform); - } - - // Prevent overwrite in case of inherit classes using same property name (See AbstractHydrator) - if (isset($cache[$column]) && ( ! isset($data[$cache[$column]['name']]) || $value !== null)) { - $data[$cache[$column]['name']] = $value; - } - } - - if (isset($this->_hints[Query::HINT_REFRESH_ENTITY])) { - $this->registerManaged($this->class, $this->_hints[Query::HINT_REFRESH_ENTITY], $data); - } - - $uow = $this->_em->getUnitOfWork(); - $entity = $uow->createEntity($entityName, $data, $this->_hints); - - $result[] = $entity; - } - - /** - * Retrieve column information form ResultSetMapping. - * - * @param string $entityName - * @param string $column - * - * @return array - */ - protected function hydrateColumnInfo($entityName, $column) - { - switch (true) { - case (isset($this->_rsm->fieldMappings[$column])): - $class = isset($this->declaringClasses[$column]) - ? $this->declaringClasses[$column] - : $this->class; - - // If class is not part of the inheritance, ignore - if ( ! ($class->name === $entityName || is_subclass_of($entityName, $class->name))) { - return null; - } - - return array( - 'class' => $class, - 'name' => $this->_rsm->fieldMappings[$column], - 'field' => true, - ); - - case (isset($this->_rsm->relationMap[$column])): - $class = isset($this->_rsm->relationMap[$column]) - ? $this->_rsm->relationMap[$column] - : $this->class; - - // If class is not self referencing, ignore - if ( ! ($class === $entityName || is_subclass_of($entityName, $class))) { - return null; - } - - // TODO: Decide what to do with associations. It seems original code is incomplete. - // One solution is to load the association, but it might require extra efforts. - return array('name' => $column); - - default: - return array( - 'name' => $this->_rsm->metaMappings[$column] - ); - } - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SingleScalarHydrator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SingleScalarHydrator.php deleted file mode 100644 index a5dabc6..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SingleScalarHydrator.php +++ /dev/null @@ -1,56 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Internal\Hydration; - -use Doctrine\DBAL\Connection, - Doctrine\ORM\NoResultException, - Doctrine\ORM\NonUniqueResultException; - -/** - * Hydrator that hydrates a single scalar value from the result set. - * - * @since 2.0 - * @author Roman Borschel - * @author Guilherme Blanco - */ -class SingleScalarHydrator extends AbstractHydrator -{ - /** - * {@inheritdoc} - */ - protected function hydrateAllData() - { - $data = $this->_stmt->fetchAll(\PDO::FETCH_ASSOC); - $numRows = count($data); - - if ($numRows === 0) { - throw new NoResultException(); - } - - if ($numRows > 1 || count($data[key($data)]) > 1) { - throw new NonUniqueResultException(); - } - - $cache = array(); - $result = $this->gatherScalarRowData($data[key($data)], $cache); - - return array_shift($result); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Annotation.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Annotation.php deleted file mode 100644 index dd8f4ef..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Annotation.php +++ /dev/null @@ -1,24 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -interface Annotation -{ -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php deleted file mode 100644 index 843e2ce..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php +++ /dev/null @@ -1,167 +0,0 @@ -. - */ - - -namespace Doctrine\ORM\Mapping\Builder; - -use Doctrine\ORM\Mapping\ClassMetadata; - -class AssociationBuilder -{ - /** - * @var ClassMetadataBuilder - */ - protected $builder; - - /** - * @var array - */ - protected $mapping; - - /** - * @var array - */ - protected $joinColumns; - - /** - * - * @var int - */ - protected $type; - - /** - * @param ClassMetadataBuilder $builder - * @param array $mapping - */ - public function __construct(ClassMetadataBuilder $builder, array $mapping, $type) - { - $this->builder = $builder; - $this->mapping = $mapping; - $this->type = $type; - } - - public function mappedBy($fieldName) - { - $this->mapping['mappedBy'] = $fieldName; - return $this; - } - - public function inversedBy($fieldName) - { - $this->mapping['inversedBy'] = $fieldName; - return $this; - } - - public function cascadeAll() - { - $this->mapping['cascade'] = array("ALL"); - return $this; - } - - public function cascadePersist() - { - $this->mapping['cascade'][] = "persist"; - return $this; - } - - public function cascadeRemove() - { - $this->mapping['cascade'][] = "remove"; - return $this; - } - - public function cascadeMerge() - { - $this->mapping['cascade'][] = "merge"; - return $this; - } - - public function cascadeDetach() - { - $this->mapping['cascade'][] = "detach"; - return $this; - } - - public function cascadeRefresh() - { - $this->mapping['cascade'][] = "refresh"; - return $this; - } - - public function fetchExtraLazy() - { - $this->mapping['fetch'] = ClassMetadata::FETCH_EXTRA_LAZY; - return $this; - } - - public function fetchEager() - { - $this->mapping['fetch'] = ClassMetadata::FETCH_EAGER; - return $this; - } - - public function fetchLazy() - { - $this->mapping['fetch'] = ClassMetadata::FETCH_LAZY; - return $this; - } - - /** - * Add Join Columns - * - * @param string $columnName - * @param string $referencedColumnName - * @param bool $nullable - * @param bool $unique - * @param string $onDelete - * @param string $columnDef - */ - public function addJoinColumn($columnName, $referencedColumnName, $nullable = true, $unique = false, $onDelete = null, $columnDef = null) - { - $this->joinColumns[] = array( - 'name' => $columnName, - 'referencedColumnName' => $referencedColumnName, - 'nullable' => $nullable, - 'unique' => $unique, - 'onDelete' => $onDelete, - 'columnDefinition' => $columnDef, - ); - return $this; - } - - /** - * @return ClassMetadataBuilder - */ - public function build() - { - $mapping = $this->mapping; - if ($this->joinColumns) { - $mapping['joinColumns'] = $this->joinColumns; - } - $cm = $this->builder->getClassMetadata(); - if ($this->type == ClassMetadata::MANY_TO_ONE) { - $cm->mapManyToOne($mapping); - } else if ($this->type == ClassMetadata::ONE_TO_ONE) { - $cm->mapOneToOne($mapping); - } else { - throw new \InvalidArgumentException("Type should be a ToOne Assocation here"); - } - return $this->builder; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php deleted file mode 100644 index fb1f1d5..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php +++ /dev/null @@ -1,470 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping\Builder; - -use Doctrine\ORM\Mapping\ClassMetadata, - Doctrine\ORM\Mapping\ClassMetadataInfo; - -/** - * Builder Object for ClassMetadata - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - */ -class ClassMetadataBuilder -{ - /** - * @var \Doctrine\ORM\Mapping\ClassMetadataInfo - */ - private $cm; - - /** - * @param \Doctrine\ORM\Mapping\ClassMetadataInfo $cm - */ - public function __construct(ClassMetadataInfo $cm) - { - $this->cm = $cm; - } - - /** - * @return ClassMetadata - */ - public function getClassMetadata() - { - return $this->cm; - } - - /** - * Mark the class as mapped superclass. - * - * @return ClassMetadataBuilder - */ - public function setMappedSuperClass() - { - $this->cm->isMappedSuperclass = true; - - return $this; - } - - /** - * Set custom Repository class name - * - * @param string $repositoryClassName - * @return ClassMetadataBuilder - */ - public function setCustomRepositoryClass($repositoryClassName) - { - $this->cm->setCustomRepositoryClass($repositoryClassName); - - return $this; - } - - /** - * Mark class read only - * - * @return ClassMetadataBuilder - */ - public function setReadOnly() - { - $this->cm->markReadOnly(); - - return $this; - } - - /** - * Set the table name - * - * @param string $name - * @return ClassMetadataBuilder - */ - public function setTable($name) - { - $this->cm->setPrimaryTable(array('name' => $name)); - - return $this; - } - - /** - * Add Index - * - * @param array $columns - * @param string $name - * @return ClassMetadataBuilder - */ - public function addIndex(array $columns, $name) - { - if (!isset($this->cm->table['indexes'])) { - $this->cm->table['indexes'] = array(); - } - - $this->cm->table['indexes'][$name] = array('columns' => $columns); - - return $this; - } - - /** - * Add Unique Constraint - * - * @param array $columns - * @param string $name - * @return ClassMetadataBuilder - */ - public function addUniqueConstraint(array $columns, $name) - { - if ( ! isset($this->cm->table['uniqueConstraints'])) { - $this->cm->table['uniqueConstraints'] = array(); - } - - $this->cm->table['uniqueConstraints'][$name] = array('columns' => $columns); - - return $this; - } - - /** - * Add named query - * - * @param string $name - * @param string $dqlQuery - * @return ClassMetadataBuilder - */ - public function addNamedQuery($name, $dqlQuery) - { - $this->cm->addNamedQuery(array( - 'name' => $name, - 'query' => $dqlQuery, - )); - - return $this; - } - - /** - * Set class as root of a joined table inheritance hierachy. - * - * @return ClassMetadataBuilder - */ - public function setJoinedTableInheritance() - { - $this->cm->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_JOINED); - - return $this; - } - - /** - * Set class as root of a single table inheritance hierachy. - * - * @return ClassMetadataBuilder - */ - public function setSingleTableInheritance() - { - $this->cm->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_SINGLE_TABLE); - - return $this; - } - - /** - * Set the discriminator column details. - * - * @param string $name - * @param string $type - */ - public function setDiscriminatorColumn($name, $type = 'string', $length = 255) - { - $this->cm->setDiscriminatorColumn(array( - 'name' => $name, - 'type' => $type, - 'length' => $length, - )); - - return $this; - } - - /** - * Add a subclass to this inheritance hierachy. - * - * @param string $name - * @param string $class - * @return ClassMetadataBuilder - */ - public function addDiscriminatorMapClass($name, $class) - { - $this->cm->addDiscriminatorMapClass($name, $class); - - return $this; - } - - /** - * Set deferred explicit change tracking policy. - * - * @return ClassMetadataBuilder - */ - public function setChangeTrackingPolicyDeferredExplicit() - { - $this->cm->setChangeTrackingPolicy(ClassMetadata::CHANGETRACKING_DEFERRED_EXPLICIT); - - return $this; - } - - /** - * Set notify change tracking policy. - * - * @return ClassMetadataBuilder - */ - public function setChangeTrackingPolicyNotify() - { - $this->cm->setChangeTrackingPolicy(ClassMetadata::CHANGETRACKING_NOTIFY); - - return $this; - } - - /** - * Add lifecycle event - * - * @param string $methodName - * @param string $event - * @return ClassMetadataBuilder - */ - public function addLifecycleEvent($methodName, $event) - { - $this->cm->addLifecycleCallback($methodName, $event); - - return $this; - } - - /** - * Add Field - * - * @param string $name - * @param string $type - * @param array $mapping - */ - public function addField($name, $type, array $mapping = array()) - { - $mapping['fieldName'] = $name; - $mapping['type'] = $type; - - $this->cm->mapField($mapping); - - return $this; - } - - /** - * Create a field builder. - * - * @param string $name - * @param string $type - * @return FieldBuilder - */ - public function createField($name, $type) - { - return new FieldBuilder( - $this, - array( - 'fieldName' => $name, - 'type' => $type - ) - ); - } - - /** - * Add a simple many to one association, optionally with the inversed by field. - * - * @param string $name - * @param string $targetEntity - * @param string|null $inversedBy - * @return ClassMetadataBuilder - */ - public function addManyToOne($name, $targetEntity, $inversedBy = null) - { - $builder = $this->createManyToOne($name, $targetEntity); - - if ($inversedBy) { - $builder->inversedBy($inversedBy); - } - - return $builder->build(); - } - - /** - * Create a ManyToOne Assocation Builder. - * - * Note: This method does not add the association, you have to call build() on the AssociationBuilder. - * - * @param string $name - * @param string $targetEntity - * @return AssociationBuilder - */ - public function createManyToOne($name, $targetEntity) - { - return new AssociationBuilder( - $this, - array( - 'fieldName' => $name, - 'targetEntity' => $targetEntity - ), - ClassMetadata::MANY_TO_ONE - ); - } - - /** - * Create OneToOne Assocation Builder - * - * @param string $name - * @param string $targetEntity - * @return AssociationBuilder - */ - public function createOneToOne($name, $targetEntity) - { - return new AssociationBuilder( - $this, - array( - 'fieldName' => $name, - 'targetEntity' => $targetEntity - ), - ClassMetadata::ONE_TO_ONE - ); - } - - /** - * Add simple inverse one-to-one assocation. - * - * @param string $name - * @param string $targetEntity - * @param string $mappedBy - * @return ClassMetadataBuilder - */ - public function addInverseOneToOne($name, $targetEntity, $mappedBy) - { - $builder = $this->createOneToOne($name, $targetEntity); - $builder->mappedBy($mappedBy); - - return $builder->build(); - } - - /** - * Add simple owning one-to-one assocation. - * - * @param string $name - * @param string $targetEntity - * @param string $inversedBy - * @return ClassMetadataBuilder - */ - public function addOwningOneToOne($name, $targetEntity, $inversedBy = null) - { - $builder = $this->createOneToOne($name, $targetEntity); - - if ($inversedBy) { - $builder->inversedBy($inversedBy); - } - - return $builder->build(); - } - - /** - * Create ManyToMany Assocation Builder - * - * @param string $name - * @param string $targetEntity - * @return ManyToManyAssociationBuilder - */ - public function createManyToMany($name, $targetEntity) - { - return new ManyToManyAssociationBuilder( - $this, - array( - 'fieldName' => $name, - 'targetEntity' => $targetEntity - ), - ClassMetadata::MANY_TO_MANY - ); - } - - /** - * Add a simple owning many to many assocation. - * - * @param string $name - * @param string $targetEntity - * @param string|null $inversedBy - * @return ClassMetadataBuilder - */ - public function addOwningManyToMany($name, $targetEntity, $inversedBy = null) - { - $builder = $this->createManyToMany($name, $targetEntity); - - if ($inversedBy) { - $builder->inversedBy($inversedBy); - } - - return $builder->build(); - } - - /** - * Add a simple inverse many to many assocation. - * - * @param string $name - * @param string $targetEntity - * @param string $mappedBy - * @return ClassMetadataBuilder - */ - public function addInverseManyToMany($name, $targetEntity, $mappedBy) - { - $builder = $this->createManyToMany($name, $targetEntity); - $builder->mappedBy($mappedBy); - - return $builder->build(); - } - - /** - * Create a one to many assocation builder - * - * @param string $name - * @param string $targetEntity - * @return OneToManyAssociationBuilder - */ - public function createOneToMany($name, $targetEntity) - { - return new OneToManyAssociationBuilder( - $this, - array( - 'fieldName' => $name, - 'targetEntity' => $targetEntity - ), - ClassMetadata::ONE_TO_MANY - ); - } - - /** - * Add simple OneToMany assocation. - * - * @param string $name - * @param string $targetEntity - * @param string $mappedBy - * @return ClassMetadataBuilder - */ - public function addOneToMany($name, $targetEntity, $mappedBy) - { - $builder = $this->createOneToMany($name, $targetEntity); - $builder->mappedBy($mappedBy); - - return $builder->build(); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/FieldBuilder.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/FieldBuilder.php deleted file mode 100644 index 3f4a5bb..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/FieldBuilder.php +++ /dev/null @@ -1,223 +0,0 @@ -. - */ - - -namespace Doctrine\ORM\Mapping\Builder; - -/** - * Field Builder - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.2 - * @author Benjamin Eberlei - */ -class FieldBuilder -{ - /** - * @var ClassMetadataBuilder - */ - private $builder; - /** - * @var array - */ - private $mapping; - /** - * @var bool - */ - private $version; - - /** - * @var string - */ - private $generatedValue; - - /** - * @var array - */ - private $sequenceDef; - - /** - * - * @param ClassMetadataBuilder $builder - * @param array $mapping - */ - public function __construct(ClassMetadataBuilder $builder, array $mapping) - { - $this->builder = $builder; - $this->mapping = $mapping; - } - - /** - * Set length. - * - * @param int $length - * @return FieldBuilder - */ - public function length($length) - { - $this->mapping['length'] = $length; - return $this; - } - - /** - * Set nullable - * - * @param bool - * @return FieldBuilder - */ - public function nullable($flag = true) - { - $this->mapping['nullable'] = (bool)$flag; - return $this; - } - - /** - * Set Unique - * - * @param bool - * @return FieldBuilder - */ - public function unique($flag = true) - { - $this->mapping['unique'] = (bool)$flag; - return $this; - } - - /** - * Set column name - * - * @param string $name - * @return FieldBuilder - */ - public function columnName($name) - { - $this->mapping['columnName'] = $name; - return $this; - } - - /** - * Set Precision - * - * @param int $p - * @return FieldBuilder - */ - public function precision($p) - { - $this->mapping['precision'] = $p; - return $this; - } - - /** - * Set scale. - * - * @param int $s - * @return FieldBuilder - */ - public function scale($s) - { - $this->mapping['scale'] = $s; - return $this; - } - - /** - * Set field as primary key. - * - * @return FieldBuilder - */ - public function isPrimaryKey() - { - $this->mapping['id'] = true; - return $this; - } - - /** - * @param int $strategy - * @return FieldBuilder - */ - public function generatedValue($strategy = 'AUTO') - { - $this->generatedValue = $strategy; - return $this; - } - - /** - * Set field versioned - * - * @return FieldBuilder - */ - public function isVersionField() - { - $this->version = true; - return $this; - } - - /** - * Set Sequence Generator - * - * @param string $sequenceName - * @param int $allocationSize - * @param int $initialValue - * @return FieldBuilder - */ - public function setSequenceGenerator($sequenceName, $allocationSize = 1, $initialValue = 1) - { - $this->sequenceDef = array( - 'sequenceName' => $sequenceName, - 'allocationSize' => $allocationSize, - 'initialValue' => $initialValue, - ); - return $this; - } - - /** - * Set column definition. - * - * @param string $def - * @return FieldBuilder - */ - public function columnDefinition($def) - { - $this->mapping['columnDefinition'] = $def; - return $this; - } - - /** - * Finalize this field and attach it to the ClassMetadata. - * - * Without this call a FieldBuilder has no effect on the ClassMetadata. - * - * @return ClassMetadataBuilder - */ - public function build() - { - $cm = $this->builder->getClassMetadata(); - if ($this->generatedValue) { - $cm->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_' . $this->generatedValue)); - } - if ($this->version) { - $cm->setVersionMapping($this->mapping); - } - $cm->mapField($this->mapping); - if ($this->sequenceDef) { - $cm->setSequenceGeneratorDefinition($this->sequenceDef); - } - return $this->builder; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/ManyToManyAssociationBuilder.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/ManyToManyAssociationBuilder.php deleted file mode 100644 index c1dd1e5..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/ManyToManyAssociationBuilder.php +++ /dev/null @@ -1,86 +0,0 @@ -. - */ - - -namespace Doctrine\ORM\Mapping\Builder; - -/** - * ManyToMany Association Builder - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.0 - * @author Benjamin Eberlei - */ -class ManyToManyAssociationBuilder extends OneToManyAssociationBuilder -{ - private $joinTableName; - - private $inverseJoinColumns = array(); - - public function setJoinTable($name) - { - $this->joinTableName = $name; - return $this; - } - - /** - * Add Inverse Join Columns - * - * @param string $columnName - * @param string $referencedColumnName - * @param bool $nullable - * @param bool $unique - * @param string $onDelete - * @param string $columnDef - */ - public function addInverseJoinColumn($columnName, $referencedColumnName, $nullable = true, $unique = false, $onDelete = null, $columnDef = null) - { - $this->inverseJoinColumns[] = array( - 'name' => $columnName, - 'referencedColumnName' => $referencedColumnName, - 'nullable' => $nullable, - 'unique' => $unique, - 'onDelete' => $onDelete, - 'columnDefinition' => $columnDef, - ); - return $this; - } - - /** - * @return ClassMetadataBuilder - */ - public function build() - { - $mapping = $this->mapping; - $mapping['joinTable'] = array(); - if ($this->joinColumns) { - $mapping['joinTable']['joinColumns'] = $this->joinColumns; - } - if ($this->inverseJoinColumns) { - $mapping['joinTable']['inverseJoinColumns'] = $this->inverseJoinColumns; - } - if ($this->joinTableName) { - $mapping['joinTable']['name'] = $this->joinTableName; - } - $cm = $this->builder->getClassMetadata(); - $cm->mapManyToMany($mapping); - return $this->builder; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/OneToManyAssociationBuilder.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/OneToManyAssociationBuilder.php deleted file mode 100644 index be55c2d..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/OneToManyAssociationBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -. - */ - - -namespace Doctrine\ORM\Mapping\Builder; - -/** - * OneToMany Association Builder - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.0 - * @author Benjamin Eberlei - */ -class OneToManyAssociationBuilder extends AssociationBuilder -{ - /** - * @param array $fieldNames - * @return OneToManyAssociationBuilder - */ - public function setOrderBy(array $fieldNames) - { - $this->mapping['orderBy'] = $fieldNames; - return $this; - } - - public function setIndexBy($fieldName) - { - $this->mapping['indexBy'] = $fieldName; - return $this; - } - - /** - * @return ClassMetadataBuilder - */ - public function build() - { - $mapping = $this->mapping; - if ($this->joinColumns) { - $mapping['joinColumns'] = $this->joinColumns; - } - $cm = $this->builder->getClassMetadata(); - $cm->mapOneToMany($mapping); - return $this->builder; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ChangeTrackingPolicy.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ChangeTrackingPolicy.php deleted file mode 100644 index a9cc372..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ChangeTrackingPolicy.php +++ /dev/null @@ -1,30 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("CLASS") - */ -final class ChangeTrackingPolicy implements Annotation -{ - /** @var string */ - public $value; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadata.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadata.php deleted file mode 100644 index 70b8f9e..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadata.php +++ /dev/null @@ -1,44 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -use ReflectionClass, ReflectionProperty; - -/** - * A ClassMetadata instance holds all the object-relational mapping metadata - * of an entity and it's associations. - * - * Once populated, ClassMetadata instances are usually cached in a serialized form. - * - * IMPORTANT NOTE: - * - * The fields of this class are only public for 2 reasons: - * 1) To allow fast READ access. - * 2) To drastically reduce the size of a serialized instance (private/protected members - * get the whole class name, namespace inclusive, prepended to every property in - * the serialized representation). - * - * @author Roman Borschel - * @author Jonathan H. Wage - * @since 2.0 - */ -class ClassMetadata extends ClassMetadataInfo -{ -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php deleted file mode 100644 index e2a5621..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php +++ /dev/null @@ -1,593 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -use ReflectionException, - Doctrine\ORM\ORMException, - Doctrine\ORM\EntityManager, - Doctrine\DBAL\Platforms, - Doctrine\ORM\Events, - Doctrine\Common\Persistence\Mapping\RuntimeReflectionService, - Doctrine\Common\Persistence\Mapping\ReflectionService, - Doctrine\Common\Persistence\Mapping\ClassMetadataFactory as ClassMetadataFactoryInterface; - -/** - * The ClassMetadataFactory is used to create ClassMetadata objects that contain all the - * metadata mapping informations of a class which describes how a class should be mapped - * to a relational database. - * - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ClassMetadataFactory implements ClassMetadataFactoryInterface -{ - /** - * @var EntityManager - */ - private $em; - - /** - * @var AbstractPlatform - */ - private $targetPlatform; - - /** - * @var \Doctrine\ORM\Mapping\Driver\Driver - */ - private $driver; - - /** - * @var \Doctrine\Common\EventManager - */ - private $evm; - - /** - * @var \Doctrine\Common\Cache\Cache - */ - private $cacheDriver; - - /** - * @var array - */ - private $loadedMetadata = array(); - - /** - * @var bool - */ - private $initialized = false; - - /** - * @var ReflectionService - */ - private $reflectionService; - - /** - * @param EntityManager $$em - */ - public function setEntityManager(EntityManager $em) - { - $this->em = $em; - } - - /** - * Sets the cache driver used by the factory to cache ClassMetadata instances. - * - * @param \Doctrine\Common\Cache\Cache $cacheDriver - */ - public function setCacheDriver($cacheDriver) - { - $this->cacheDriver = $cacheDriver; - } - - /** - * Gets the cache driver used by the factory to cache ClassMetadata instances. - * - * @return \Doctrine\Common\Cache\Cache - */ - public function getCacheDriver() - { - return $this->cacheDriver; - } - - public function getLoadedMetadata() - { - return $this->loadedMetadata; - } - - /** - * Forces the factory to load the metadata of all classes known to the underlying - * mapping driver. - * - * @return array The ClassMetadata instances of all mapped classes. - */ - public function getAllMetadata() - { - if ( ! $this->initialized) { - $this->initialize(); - } - - $metadata = array(); - foreach ($this->driver->getAllClassNames() as $className) { - $metadata[] = $this->getMetadataFor($className); - } - - return $metadata; - } - - /** - * Lazy initialization of this stuff, especially the metadata driver, - * since these are not needed at all when a metadata cache is active. - */ - private function initialize() - { - $this->driver = $this->em->getConfiguration()->getMetadataDriverImpl(); - $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform(); - $this->evm = $this->em->getEventManager(); - $this->initialized = true; - } - - /** - * Gets the class metadata descriptor for a class. - * - * @param string $className The name of the class. - * @return \Doctrine\ORM\Mapping\ClassMetadata - */ - public function getMetadataFor($className) - { - if ( ! isset($this->loadedMetadata[$className])) { - $realClassName = $className; - - // Check for namespace alias - if (strpos($className, ':') !== false) { - list($namespaceAlias, $simpleClassName) = explode(':', $className); - $realClassName = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; - - if (isset($this->loadedMetadata[$realClassName])) { - // We do not have the alias name in the map, include it - $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName]; - - return $this->loadedMetadata[$realClassName]; - } - } - - if ($this->cacheDriver) { - if (($cached = $this->cacheDriver->fetch("$realClassName\$CLASSMETADATA")) !== false) { - $this->wakeupReflection($cached, $this->getReflectionService()); - $this->loadedMetadata[$realClassName] = $cached; - } else { - foreach ($this->loadMetadata($realClassName) as $loadedClassName) { - $this->cacheDriver->save( - "$loadedClassName\$CLASSMETADATA", $this->loadedMetadata[$loadedClassName], null - ); - } - } - } else { - $this->loadMetadata($realClassName); - } - - if ($className != $realClassName) { - // We do not have the alias name in the map, include it - $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName]; - } - } - - return $this->loadedMetadata[$className]; - } - - /** - * Checks whether the factory has the metadata for a class loaded already. - * - * @param string $className - * @return boolean TRUE if the metadata of the class in question is already loaded, FALSE otherwise. - */ - public function hasMetadataFor($className) - { - return isset($this->loadedMetadata[$className]); - } - - /** - * Sets the metadata descriptor for a specific class. - * - * NOTE: This is only useful in very special cases, like when generating proxy classes. - * - * @param string $className - * @param ClassMetadata $class - */ - public function setMetadataFor($className, $class) - { - $this->loadedMetadata[$className] = $class; - } - - /** - * Get array of parent classes for the given entity class - * - * @param string $name - * @return array $parentClasses - */ - protected function getParentClasses($name) - { - // Collect parent classes, ignoring transient (not-mapped) classes. - $parentClasses = array(); - foreach (array_reverse($this->getReflectionService()->getParentClasses($name)) as $parentClass) { - if ( ! $this->driver->isTransient($parentClass)) { - $parentClasses[] = $parentClass; - } - } - return $parentClasses; - } - - /** - * Loads the metadata of the class in question and all it's ancestors whose metadata - * is still not loaded. - * - * @param string $name The name of the class for which the metadata should get loaded. - * @param array $tables The metadata collection to which the loaded metadata is added. - */ - protected function loadMetadata($name) - { - if ( ! $this->initialized) { - $this->initialize(); - } - - $loaded = array(); - - $parentClasses = $this->getParentClasses($name); - $parentClasses[] = $name; - - // Move down the hierarchy of parent classes, starting from the topmost class - $parent = null; - $rootEntityFound = false; - $visited = array(); - foreach ($parentClasses as $className) { - if (isset($this->loadedMetadata[$className])) { - $parent = $this->loadedMetadata[$className]; - if ( ! $parent->isMappedSuperclass) { - $rootEntityFound = true; - array_unshift($visited, $className); - } - continue; - } - - $class = $this->newClassMetadataInstance($className); - $this->initializeReflection($class, $this->getReflectionService()); - - if ($parent) { - $class->setInheritanceType($parent->inheritanceType); - $class->setDiscriminatorColumn($parent->discriminatorColumn); - $class->setIdGeneratorType($parent->generatorType); - $this->addInheritedFields($class, $parent); - $this->addInheritedRelations($class, $parent); - $class->setIdentifier($parent->identifier); - $class->setVersioned($parent->isVersioned); - $class->setVersionField($parent->versionField); - $class->setDiscriminatorMap($parent->discriminatorMap); - $class->setLifecycleCallbacks($parent->lifecycleCallbacks); - $class->setChangeTrackingPolicy($parent->changeTrackingPolicy); - if ($parent->isMappedSuperclass) { - $class->setCustomRepositoryClass($parent->customRepositoryClassName); - } - } - - // Invoke driver - try { - $this->driver->loadMetadataForClass($className, $class); - } catch (ReflectionException $e) { - throw MappingException::reflectionFailure($className, $e); - } - - // If this class has a parent the id generator strategy is inherited. - // However this is only true if the hierachy of parents contains the root entity, - // if it consinsts of mapped superclasses these don't necessarily include the id field. - if ($parent && $rootEntityFound) { - if ($parent->isIdGeneratorSequence()) { - $class->setSequenceGeneratorDefinition($parent->sequenceGeneratorDefinition); - } else if ($parent->isIdGeneratorTable()) { - $class->getTableGeneratorDefinition($parent->tableGeneratorDefinition); - } - if ($parent->generatorType) { - $class->setIdGeneratorType($parent->generatorType); - } - if ($parent->idGenerator) { - $class->setIdGenerator($parent->idGenerator); - } - } else { - $this->completeIdGeneratorMapping($class); - } - - if ($parent && $parent->isInheritanceTypeSingleTable()) { - $class->setPrimaryTable($parent->table); - } - - if ($parent && $parent->containsForeignIdentifier) { - $class->containsForeignIdentifier = true; - } - - if ($parent && !empty ($parent->namedQueries)) { - $this->addInheritedNamedQueries($class, $parent); - } - - $class->setParentClasses($visited); - - if ($this->evm->hasListeners(Events::loadClassMetadata)) { - $eventArgs = new \Doctrine\ORM\Event\LoadClassMetadataEventArgs($class, $this->em); - $this->evm->dispatchEvent(Events::loadClassMetadata, $eventArgs); - } - $this->wakeupReflection($class, $this->getReflectionService()); - - $this->validateRuntimeMetadata($class, $parent); - - $this->loadedMetadata[$className] = $class; - - $parent = $class; - - if ( ! $class->isMappedSuperclass) { - $rootEntityFound = true; - array_unshift($visited, $className); - } - - $loaded[] = $className; - } - - return $loaded; - } - - /** - * Validate runtime metadata is correctly defined. - * - * @param ClassMetadata $class - * @param ClassMetadata $parent - */ - protected function validateRuntimeMetadata($class, $parent) - { - if ( ! $class->reflClass ) { - // only validate if there is a reflection class instance - return; - } - - $class->validateIdentifier(); - $class->validateAssocations(); - $class->validateLifecycleCallbacks($this->getReflectionService()); - - // verify inheritance - if (!$class->isMappedSuperclass && !$class->isInheritanceTypeNone()) { - if (!$parent) { - if (count($class->discriminatorMap) == 0) { - throw MappingException::missingDiscriminatorMap($class->name); - } - if (!$class->discriminatorColumn) { - throw MappingException::missingDiscriminatorColumn($class->name); - } - } else if ($parent && !$class->reflClass->isAbstract() && !in_array($class->name, array_values($class->discriminatorMap))) { - // enforce discriminator map for all entities of an inheritance hierachy, otherwise problems will occur. - throw MappingException::mappedClassNotPartOfDiscriminatorMap($class->name, $class->rootEntityName); - } - } else if ($class->isMappedSuperclass && $class->name == $class->rootEntityName && (count($class->discriminatorMap) || $class->discriminatorColumn)) { - // second condition is necessary for mapped superclasses in the middle of an inheritance hierachy - throw MappingException::noInheritanceOnMappedSuperClass($class->name); - } - } - - /** - * Creates a new ClassMetadata instance for the given class name. - * - * @param string $className - * @return \Doctrine\ORM\Mapping\ClassMetadata - */ - protected function newClassMetadataInstance($className) - { - return new ClassMetadata($className); - } - - /** - * Adds inherited fields to the subclass mapping. - * - * @param \Doctrine\ORM\Mapping\ClassMetadata $subClass - * @param \Doctrine\ORM\Mapping\ClassMetadata $parentClass - */ - private function addInheritedFields(ClassMetadata $subClass, ClassMetadata $parentClass) - { - foreach ($parentClass->fieldMappings as $fieldName => $mapping) { - if ( ! isset($mapping['inherited']) && ! $parentClass->isMappedSuperclass) { - $mapping['inherited'] = $parentClass->name; - } - if ( ! isset($mapping['declared'])) { - $mapping['declared'] = $parentClass->name; - } - $subClass->addInheritedFieldMapping($mapping); - } - foreach ($parentClass->reflFields as $name => $field) { - $subClass->reflFields[$name] = $field; - } - } - - /** - * Adds inherited association mappings to the subclass mapping. - * - * @param \Doctrine\ORM\Mapping\ClassMetadata $subClass - * @param \Doctrine\ORM\Mapping\ClassMetadata $parentClass - */ - private function addInheritedRelations(ClassMetadata $subClass, ClassMetadata $parentClass) - { - foreach ($parentClass->associationMappings as $field => $mapping) { - if ($parentClass->isMappedSuperclass) { - if ($mapping['type'] & ClassMetadata::TO_MANY && !$mapping['isOwningSide']) { - throw MappingException::illegalToManyAssocationOnMappedSuperclass($parentClass->name, $field); - } - $mapping['sourceEntity'] = $subClass->name; - } - - //$subclassMapping = $mapping; - if ( ! isset($mapping['inherited']) && ! $parentClass->isMappedSuperclass) { - $mapping['inherited'] = $parentClass->name; - } - if ( ! isset($mapping['declared'])) { - $mapping['declared'] = $parentClass->name; - } - $subClass->addInheritedAssociationMapping($mapping); - } - } - - /** - * Adds inherited named queries to the subclass mapping. - * - * @since 2.2 - * @param \Doctrine\ORM\Mapping\ClassMetadata $subClass - * @param \Doctrine\ORM\Mapping\ClassMetadata $parentClass - */ - private function addInheritedNamedQueries(ClassMetadata $subClass, ClassMetadata $parentClass) - { - foreach ($parentClass->namedQueries as $name => $query) { - if (!isset ($subClass->namedQueries[$name])) { - $subClass->addNamedQuery(array( - 'name' => $query['name'], - 'query' => $query['query'] - )); - } - } - } - - /** - * Completes the ID generator mapping. If "auto" is specified we choose the generator - * most appropriate for the targeted database platform. - * - * @param \Doctrine\ORM\Mapping\ClassMetadata $class - */ - private function completeIdGeneratorMapping(ClassMetadataInfo $class) - { - $idGenType = $class->generatorType; - if ($idGenType == ClassMetadata::GENERATOR_TYPE_AUTO) { - if ($this->targetPlatform->prefersSequences()) { - $class->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_SEQUENCE); - } else if ($this->targetPlatform->prefersIdentityColumns()) { - $class->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_IDENTITY); - } else { - $class->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_TABLE); - } - } - - // Create & assign an appropriate ID generator instance - switch ($class->generatorType) { - case ClassMetadata::GENERATOR_TYPE_IDENTITY: - // For PostgreSQL IDENTITY (SERIAL) we need a sequence name. It defaults to - // __seq in PostgreSQL for SERIAL columns. - // Not pretty but necessary and the simplest solution that currently works. - $seqName = $this->targetPlatform instanceof Platforms\PostgreSQLPlatform ? - $class->getTableName() . '_' . $class->columnNames[$class->identifier[0]] . '_seq' : - null; - $class->setIdGenerator(new \Doctrine\ORM\Id\IdentityGenerator($seqName)); - break; - case ClassMetadata::GENERATOR_TYPE_SEQUENCE: - // If there is no sequence definition yet, create a default definition - $definition = $class->sequenceGeneratorDefinition; - if ( ! $definition) { - $sequenceName = $class->getTableName() . '_' . $class->getSingleIdentifierColumnName() . '_seq'; - $definition['sequenceName'] = $this->targetPlatform->fixSchemaElementName($sequenceName); - $definition['allocationSize'] = 1; - $definition['initialValue'] = 1; - $class->setSequenceGeneratorDefinition($definition); - } - $sequenceGenerator = new \Doctrine\ORM\Id\SequenceGenerator( - $definition['sequenceName'], - $definition['allocationSize'] - ); - $class->setIdGenerator($sequenceGenerator); - break; - case ClassMetadata::GENERATOR_TYPE_NONE: - $class->setIdGenerator(new \Doctrine\ORM\Id\AssignedGenerator()); - break; - case ClassMetadata::GENERATOR_TYPE_TABLE: - throw new ORMException("TableGenerator not yet implemented."); - break; - default: - throw new ORMException("Unknown generator type: " . $class->generatorType); - } - } - - /** - * Check if this class is mapped by this EntityManager + ClassMetadata configuration - * - * @param $class - * @return bool - */ - public function isTransient($class) - { - if ( ! $this->initialized) { - $this->initialize(); - } - - // Check for namespace alias - if (strpos($class, ':') !== false) { - list($namespaceAlias, $simpleClassName) = explode(':', $class); - $class = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; - } - - return $this->driver->isTransient($class); - } - - /** - * Get reflectionService. - * - * @return \Doctrine\Common\Persistence\Mapping\ReflectionService - */ - public function getReflectionService() - { - if ($this->reflectionService === null) { - $this->reflectionService = new RuntimeReflectionService(); - } - return $this->reflectionService; - } - - /** - * Set reflectionService. - * - * @param reflectionService the value to set. - */ - public function setReflectionService(ReflectionService $reflectionService) - { - $this->reflectionService = $reflectionService; - } - - /** - * Wakeup reflection after ClassMetadata gets unserialized from cache. - * - * @param ClassMetadataInfo $class - * @param ReflectionService $reflService - * @return void - */ - protected function wakeupReflection(ClassMetadataInfo $class, ReflectionService $reflService) - { - $class->wakeupReflection($reflService); - } - - /** - * Initialize Reflection after ClassMetadata was constructed. - * - * @param ClassMetadataInfo $class - * @param ReflectionService $reflService - * @return void - */ - protected function initializeReflection(ClassMetadataInfo $class, ReflectionService $reflService) - { - $class->initializeReflection($reflService); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php deleted file mode 100644 index 31e2b75..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ /dev/null @@ -1,2340 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -use Doctrine\DBAL\Types\Type; -use ReflectionClass; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; - -/** - * A ClassMetadata instance holds all the object-relational mapping metadata - * of an entity and it's associations. - * - * Once populated, ClassMetadata instances are usually cached in a serialized form. - * - * IMPORTANT NOTE: - * - * The fields of this class are only public for 2 reasons: - * 1) To allow fast READ access. - * 2) To drastically reduce the size of a serialized instance (private/protected members - * get the whole class name, namespace inclusive, prepended to every property in - * the serialized representation). - * - * @author Roman Borschel - * @author Jonathan H. Wage - * @since 2.0 - */ -class ClassMetadataInfo implements ClassMetadata -{ - /* The inheritance mapping types */ - /** - * NONE means the class does not participate in an inheritance hierarchy - * and therefore does not need an inheritance mapping type. - */ - const INHERITANCE_TYPE_NONE = 1; - /** - * JOINED means the class will be persisted according to the rules of - * Class Table Inheritance. - */ - const INHERITANCE_TYPE_JOINED = 2; - /** - * SINGLE_TABLE means the class will be persisted according to the rules of - * Single Table Inheritance. - */ - const INHERITANCE_TYPE_SINGLE_TABLE = 3; - /** - * TABLE_PER_CLASS means the class will be persisted according to the rules - * of Concrete Table Inheritance. - */ - const INHERITANCE_TYPE_TABLE_PER_CLASS = 4; - - /* The Id generator types. */ - /** - * AUTO means the generator type will depend on what the used platform prefers. - * Offers full portability. - */ - const GENERATOR_TYPE_AUTO = 1; - /** - * SEQUENCE means a separate sequence object will be used. Platforms that do - * not have native sequence support may emulate it. Full portability is currently - * not guaranteed. - */ - const GENERATOR_TYPE_SEQUENCE = 2; - /** - * TABLE means a separate table is used for id generation. - * Offers full portability. - */ - const GENERATOR_TYPE_TABLE = 3; - /** - * IDENTITY means an identity column is used for id generation. The database - * will fill in the id column on insertion. Platforms that do not support - * native identity columns may emulate them. Full portability is currently - * not guaranteed. - */ - const GENERATOR_TYPE_IDENTITY = 4; - /** - * NONE means the class does not have a generated id. That means the class - * must have a natural, manually assigned id. - */ - const GENERATOR_TYPE_NONE = 5; - /** - * DEFERRED_IMPLICIT means that changes of entities are calculated at commit-time - * by doing a property-by-property comparison with the original data. This will - * be done for all entities that are in MANAGED state at commit-time. - * - * This is the default change tracking policy. - */ - const CHANGETRACKING_DEFERRED_IMPLICIT = 1; - /** - * DEFERRED_EXPLICIT means that changes of entities are calculated at commit-time - * by doing a property-by-property comparison with the original data. This will - * be done only for entities that were explicitly saved (through persist() or a cascade). - */ - const CHANGETRACKING_DEFERRED_EXPLICIT = 2; - /** - * NOTIFY means that Doctrine relies on the entities sending out notifications - * when their properties change. Such entity classes must implement - * the NotifyPropertyChanged interface. - */ - const CHANGETRACKING_NOTIFY = 3; - /** - * Specifies that an association is to be fetched when it is first accessed. - */ - const FETCH_LAZY = 2; - /** - * Specifies that an association is to be fetched when the owner of the - * association is fetched. - */ - const FETCH_EAGER = 3; - /** - * Specifies that an association is to be fetched lazy (on first access) and that - * commands such as Collection#count, Collection#slice are issued directly against - * the database if the collection is not yet initialized. - */ - const FETCH_EXTRA_LAZY = 4; - /** - * Identifies a one-to-one association. - */ - const ONE_TO_ONE = 1; - /** - * Identifies a many-to-one association. - */ - const MANY_TO_ONE = 2; - /** - * Identifies a one-to-many association. - */ - const ONE_TO_MANY = 4; - /** - * Identifies a many-to-many association. - */ - const MANY_TO_MANY = 8; - /** - * Combined bitmask for to-one (single-valued) associations. - */ - const TO_ONE = 3; - /** - * Combined bitmask for to-many (collection-valued) associations. - */ - const TO_MANY = 12; - - /** - * READ-ONLY: The name of the entity class. - */ - public $name; - - /** - * READ-ONLY: The namespace the entity class is contained in. - * - * @var string - * @todo Not really needed. Usage could be localized. - */ - public $namespace; - - /** - * READ-ONLY: The name of the entity class that is at the root of the mapped entity inheritance - * hierarchy. If the entity is not part of a mapped inheritance hierarchy this is the same - * as {@link $entityName}. - * - * @var string - */ - public $rootEntityName; - - /** - * The name of the custom repository class used for the entity class. - * (Optional). - * - * @var string - */ - public $customRepositoryClassName; - - /** - * READ-ONLY: Whether this class describes the mapping of a mapped superclass. - * - * @var boolean - */ - public $isMappedSuperclass = false; - - /** - * READ-ONLY: The names of the parent classes (ancestors). - * - * @var array - */ - public $parentClasses = array(); - - /** - * READ-ONLY: The names of all subclasses (descendants). - * - * @var array - */ - public $subClasses = array(); - - /** - * READ-ONLY: The named queries allowed to be called directly from Repository. - * - * @var array - */ - public $namedQueries = array(); - - /** - * READ-ONLY: The field names of all fields that are part of the identifier/primary key - * of the mapped entity class. - * - * @var array - */ - public $identifier = array(); - - /** - * READ-ONLY: The inheritance mapping type used by the class. - * - * @var integer - */ - public $inheritanceType = self::INHERITANCE_TYPE_NONE; - - /** - * READ-ONLY: The Id generator type used by the class. - * - * @var string - */ - public $generatorType = self::GENERATOR_TYPE_NONE; - - /** - * READ-ONLY: The field mappings of the class. - * Keys are field names and values are mapping definitions. - * - * The mapping definition array has the following values: - * - * - fieldName (string) - * The name of the field in the Entity. - * - * - type (string) - * The type name of the mapped field. Can be one of Doctrine's mapping types - * or a custom mapping type. - * - * - columnName (string, optional) - * The column name. Optional. Defaults to the field name. - * - * - length (integer, optional) - * The database length of the column. Optional. Default value taken from - * the type. - * - * - id (boolean, optional) - * Marks the field as the primary key of the entity. Multiple fields of an - * entity can have the id attribute, forming a composite key. - * - * - nullable (boolean, optional) - * Whether the column is nullable. Defaults to FALSE. - * - * - columnDefinition (string, optional, schema-only) - * The SQL fragment that is used when generating the DDL for the column. - * - * - precision (integer, optional, schema-only) - * The precision of a decimal column. Only valid if the column type is decimal. - * - * - scale (integer, optional, schema-only) - * The scale of a decimal column. Only valid if the column type is decimal. - * - [* - 'unique'] (string, optional, schema-only) - * Whether a unique constraint should be generated for the column. - * - * @var array - */ - public $fieldMappings = array(); - - /** - * READ-ONLY: An array of field names. Used to look up field names from column names. - * Keys are column names and values are field names. - * This is the reverse lookup map of $_columnNames. - * - * @var array - */ - public $fieldNames = array(); - - /** - * READ-ONLY: A map of field names to column names. Keys are field names and values column names. - * Used to look up column names from field names. - * This is the reverse lookup map of $_fieldNames. - * - * @var array - * @todo We could get rid of this array by just using $fieldMappings[$fieldName]['columnName']. - */ - public $columnNames = array(); - - /** - * READ-ONLY: The discriminator value of this class. - * - * This does only apply to the JOINED and SINGLE_TABLE inheritance mapping strategies - * where a discriminator column is used. - * - * @var mixed - * @see discriminatorColumn - */ - public $discriminatorValue; - - /** - * READ-ONLY: The discriminator map of all mapped classes in the hierarchy. - * - * This does only apply to the JOINED and SINGLE_TABLE inheritance mapping strategies - * where a discriminator column is used. - * - * @var mixed - * @see discriminatorColumn - */ - public $discriminatorMap = array(); - - /** - * READ-ONLY: The definition of the discriminator column used in JOINED and SINGLE_TABLE - * inheritance mappings. - * - * @var array - */ - public $discriminatorColumn; - - /** - * READ-ONLY: The primary table definition. The definition is an array with the - * following entries: - * - * name => - * schema => - * indexes => array - * uniqueConstraints => array - * - * @var array - */ - public $table; - - /** - * READ-ONLY: The registered lifecycle callbacks for entities of this class. - * - * @var array - */ - public $lifecycleCallbacks = array(); - - /** - * READ-ONLY: The association mappings of this class. - * - * The mapping definition array supports the following keys: - * - * - fieldName (string) - * The name of the field in the entity the association is mapped to. - * - * - targetEntity (string) - * The class name of the target entity. If it is fully-qualified it is used as is. - * If it is a simple, unqualified class name the namespace is assumed to be the same - * as the namespace of the source entity. - * - * - mappedBy (string, required for bidirectional associations) - * The name of the field that completes the bidirectional association on the owning side. - * This key must be specified on the inverse side of a bidirectional association. - * - * - inversedBy (string, required for bidirectional associations) - * The name of the field that completes the bidirectional association on the inverse side. - * This key must be specified on the owning side of a bidirectional association. - * - * - cascade (array, optional) - * The names of persistence operations to cascade on the association. The set of possible - * values are: "persist", "remove", "detach", "merge", "refresh", "all" (implies all others). - * - * - orderBy (array, one-to-many/many-to-many only) - * A map of field names (of the target entity) to sorting directions (ASC/DESC). - * Example: array('priority' => 'desc') - * - * - fetch (integer, optional) - * The fetching strategy to use for the association, usually defaults to FETCH_LAZY. - * Possible values are: ClassMetadata::FETCH_EAGER, ClassMetadata::FETCH_LAZY. - * - * - joinTable (array, optional, many-to-many only) - * Specification of the join table and its join columns (foreign keys). - * Only valid for many-to-many mappings. Note that one-to-many associations can be mapped - * through a join table by simply mapping the association as many-to-many with a unique - * constraint on the join table. - * - * - indexBy (string, optional, to-many only) - * Specification of a field on target-entity that is used to index the collection by. - * This field HAS to be either the primary key or a unique column. Otherwise the collection - * does not contain all the entities that are actually related. - * - * A join table definition has the following structure: - *
-     * array(
-     *     'name' => ,
-     *      'joinColumns' => array(),
-     *      'inverseJoinColumns' => array()
-     * )
-     * 
- * - * - * @var array - */ - public $associationMappings = array(); - - /** - * READ-ONLY: Flag indicating whether the identifier/primary key of the class is composite. - * - * @var boolean - */ - public $isIdentifierComposite = false; - - /** - * READ-ONLY: Flag indicating wheather the identifier/primary key contains at least one foreign key association. - * - * This flag is necessary because some code blocks require special treatment of this cases. - * - * @var boolean - */ - public $containsForeignIdentifier = false; - - /** - * READ-ONLY: The ID generator used for generating IDs for this class. - * - * @var AbstractIdGenerator - * @todo Remove! - */ - public $idGenerator; - - /** - * READ-ONLY: The definition of the sequence generator of this class. Only used for the - * SEQUENCE generation strategy. - * - * The definition has the following structure: - * - * array( - * 'sequenceName' => 'name', - * 'allocationSize' => 20, - * 'initialValue' => 1 - * ) - * - * - * @var array - * @todo Merge with tableGeneratorDefinition into generic generatorDefinition - */ - public $sequenceGeneratorDefinition; - - /** - * READ-ONLY: The definition of the table generator of this class. Only used for the - * TABLE generation strategy. - * - * @var array - * @todo Merge with tableGeneratorDefinition into generic generatorDefinition - */ - public $tableGeneratorDefinition; - - /** - * READ-ONLY: The policy used for change-tracking on entities of this class. - * - * @var integer - */ - public $changeTrackingPolicy = self::CHANGETRACKING_DEFERRED_IMPLICIT; - - /** - * READ-ONLY: A flag for whether or not instances of this class are to be versioned - * with optimistic locking. - * - * @var boolean $isVersioned - */ - public $isVersioned; - - /** - * READ-ONLY: The name of the field which is used for versioning in optimistic locking (if any). - * - * @var mixed $versionField - */ - public $versionField; - - /** - * The ReflectionClass instance of the mapped class. - * - * @var ReflectionClass - */ - public $reflClass; - - /** - * Is this entity marked as "read-only"? - * - * That means it is never considered for change-tracking in the UnitOfWork. It is a very helpful performance - * optimization for entities that are immutable, either in your domain or through the relation database - * (coming from a view, or a history table for example). - * - * @var bool - */ - public $isReadOnly = false; - - /** - * The ReflectionProperty instances of the mapped class. - * - * @var array - */ - public $reflFields = array(); - - /** - * The prototype from which new instances of the mapped class are created. - * - * @var object - */ - private $_prototype; - - /** - * Initializes a new ClassMetadata instance that will hold the object-relational mapping - * metadata of the class with the given name. - * - * @param string $entityName The name of the entity class the new instance is used for. - */ - public function __construct($entityName) - { - $this->name = $entityName; - $this->rootEntityName = $entityName; - } - - /** - * Gets the ReflectionPropertys of the mapped class. - * - * @return array An array of ReflectionProperty instances. - */ - public function getReflectionProperties() - { - return $this->reflFields; - } - - /** - * Gets a ReflectionProperty for a specific field of the mapped class. - * - * @param string $name - * @return ReflectionProperty - */ - public function getReflectionProperty($name) - { - return $this->reflFields[$name]; - } - - /** - * Gets the ReflectionProperty for the single identifier field. - * - * @return ReflectionProperty - * @throws BadMethodCallException If the class has a composite identifier. - */ - public function getSingleIdReflectionProperty() - { - if ($this->isIdentifierComposite) { - throw new \BadMethodCallException("Class " . $this->name . " has a composite identifier."); - } - return $this->reflFields[$this->identifier[0]]; - } - - /** - * Extracts the identifier values of an entity of this class. - * - * For composite identifiers, the identifier values are returned as an array - * with the same order as the field order in {@link identifier}. - * - * @param object $entity - * @return array - */ - public function getIdentifierValues($entity) - { - if ($this->isIdentifierComposite) { - $id = array(); - - foreach ($this->identifier as $idField) { - $value = $this->reflFields[$idField]->getValue($entity); - - if ($value !== null) { - $id[$idField] = $value; - } - } - - return $id; - } - - $value = $this->reflFields[$this->identifier[0]]->getValue($entity); - - if ($value !== null) { - return array($this->identifier[0] => $value); - } - - return array(); - } - - /** - * Populates the entity identifier of an entity. - * - * @param object $entity - * @param mixed $id - * @todo Rename to assignIdentifier() - */ - public function setIdentifierValues($entity, array $id) - { - foreach ($id as $idField => $idValue) { - $this->reflFields[$idField]->setValue($entity, $idValue); - } - } - - /** - * Sets the specified field to the specified value on the given entity. - * - * @param object $entity - * @param string $field - * @param mixed $value - */ - public function setFieldValue($entity, $field, $value) - { - $this->reflFields[$field]->setValue($entity, $value); - } - - /** - * Gets the specified field's value off the given entity. - * - * @param object $entity - * @param string $field - */ - public function getFieldValue($entity, $field) - { - return $this->reflFields[$field]->getValue($entity); - } - - /** - * Creates a string representation of this instance. - * - * @return string The string representation of this instance. - * @todo Construct meaningful string representation. - */ - public function __toString() - { - return __CLASS__ . '@' . spl_object_hash($this); - } - - /** - * Determines which fields get serialized. - * - * It is only serialized what is necessary for best unserialization performance. - * That means any metadata properties that are not set or empty or simply have - * their default value are NOT serialized. - * - * Parts that are also NOT serialized because they can not be properly unserialized: - * - reflClass (ReflectionClass) - * - reflFields (ReflectionProperty array) - * - * @return array The names of all the fields that should be serialized. - */ - public function __sleep() - { - // This metadata is always serialized/cached. - $serialized = array( - 'associationMappings', - 'columnNames', //TODO: Not really needed. Can use fieldMappings[$fieldName]['columnName'] - 'fieldMappings', - 'fieldNames', - 'identifier', - 'isIdentifierComposite', // TODO: REMOVE - 'name', - 'namespace', // TODO: REMOVE - 'table', - 'rootEntityName', - 'idGenerator', //TODO: Does not really need to be serialized. Could be moved to runtime. - ); - - // The rest of the metadata is only serialized if necessary. - if ($this->changeTrackingPolicy != self::CHANGETRACKING_DEFERRED_IMPLICIT) { - $serialized[] = 'changeTrackingPolicy'; - } - - if ($this->customRepositoryClassName) { - $serialized[] = 'customRepositoryClassName'; - } - - if ($this->inheritanceType != self::INHERITANCE_TYPE_NONE) { - $serialized[] = 'inheritanceType'; - $serialized[] = 'discriminatorColumn'; - $serialized[] = 'discriminatorValue'; - $serialized[] = 'discriminatorMap'; - $serialized[] = 'parentClasses'; - $serialized[] = 'subClasses'; - } - - if ($this->generatorType != self::GENERATOR_TYPE_NONE) { - $serialized[] = 'generatorType'; - if ($this->generatorType == self::GENERATOR_TYPE_SEQUENCE) { - $serialized[] = 'sequenceGeneratorDefinition'; - } - } - - if ($this->isMappedSuperclass) { - $serialized[] = 'isMappedSuperclass'; - } - - if ($this->containsForeignIdentifier) { - $serialized[] = 'containsForeignIdentifier'; - } - - if ($this->isVersioned) { - $serialized[] = 'isVersioned'; - $serialized[] = 'versionField'; - } - - if ($this->lifecycleCallbacks) { - $serialized[] = 'lifecycleCallbacks'; - } - - if ($this->namedQueries) { - $serialized[] = 'namedQueries'; - } - - if ($this->isReadOnly) { - $serialized[] = 'isReadOnly'; - } - - return $serialized; - } - - /** - * Creates a new instance of the mapped class, without invoking the constructor. - * - * @return object - */ - public function newInstance() - { - if ($this->_prototype === null) { - $this->_prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name)); - } - - return clone $this->_prototype; - } - /** - * Restores some state that can not be serialized/unserialized. - * - * @param ReflectionService $reflService - * @return void - */ - public function wakeupReflection($reflService) - { - // Restore ReflectionClass and properties - $this->reflClass = $reflService->getClass($this->name); - - foreach ($this->fieldMappings as $field => $mapping) { - $this->reflFields[$field] = isset($mapping['declared']) - ? $reflService->getAccessibleProperty($mapping['declared'], $field) - : $reflService->getAccessibleProperty($this->name, $field); - } - - foreach ($this->associationMappings as $field => $mapping) { - $this->reflFields[$field] = isset($mapping['declared']) - ? $reflService->getAccessibleProperty($mapping['declared'], $field) - : $reflService->getAccessibleProperty($this->name, $field); - } - } - - /** - * Initializes a new ClassMetadata instance that will hold the object-relational mapping - * metadata of the class with the given name. - * - * @param string $entityName The name of the entity class the new instance is used for. - */ - public function initializeReflection($reflService) - { - $this->reflClass = $reflService->getClass($this->name); - $this->namespace = $reflService->getClassNamespace($this->name); - $this->table['name'] = $reflService->getClassShortName($this->name); - - if ($this->reflClass) { - $this->name = $this->rootEntityName = $this->reflClass->getName(); - } - } - - /** - * Validate Identifier - * - * @return void - */ - public function validateIdentifier() - { - // Verify & complete identifier mapping - if ( ! $this->identifier && ! $this->isMappedSuperclass) { - throw MappingException::identifierRequired($this->name); - } - - if ($this->usesIdGenerator() && $this->isIdentifierComposite) { - throw MappingException::compositeKeyAssignedIdGeneratorRequired($this->name); - } - } - - /** - * Validate association targets actually exist. - * - * @return void - */ - public function validateAssocations() - { - foreach ($this->associationMappings as $field => $mapping) { - if ( ! \Doctrine\Common\ClassLoader::classExists($mapping['targetEntity']) ) { - throw MappingException::invalidTargetEntityClass($mapping['targetEntity'], $this->name, $mapping['fieldName']); - } - } - } - - /** - * Validate lifecycle callbacks - * - * @param ReflectionService $reflService - * @return void - */ - public function validateLifecycleCallbacks($reflService) - { - foreach ($this->lifecycleCallbacks as $event => $callbacks) { - foreach ($callbacks as $callbackFuncName) { - if ( ! $reflService->hasPublicMethod($this->name, $callbackFuncName)) { - throw MappingException::lifecycleCallbackMethodNotFound($this->name, $callbackFuncName); - } - } - } - } - - /** - * Gets the ReflectionClass instance of the mapped class. - * - * @return ReflectionClass - */ - public function getReflectionClass() - { - return $this->reflClass; - } - - /** - * Sets the change tracking policy used by this class. - * - * @param integer $policy - */ - public function setChangeTrackingPolicy($policy) - { - $this->changeTrackingPolicy = $policy; - } - - /** - * Whether the change tracking policy of this class is "deferred explicit". - * - * @return boolean - */ - public function isChangeTrackingDeferredExplicit() - { - return $this->changeTrackingPolicy == self::CHANGETRACKING_DEFERRED_EXPLICIT; - } - - /** - * Whether the change tracking policy of this class is "deferred implicit". - * - * @return boolean - */ - public function isChangeTrackingDeferredImplicit() - { - return $this->changeTrackingPolicy == self::CHANGETRACKING_DEFERRED_IMPLICIT; - } - - /** - * Whether the change tracking policy of this class is "notify". - * - * @return boolean - */ - public function isChangeTrackingNotify() - { - return $this->changeTrackingPolicy == self::CHANGETRACKING_NOTIFY; - } - - /** - * Checks whether a field is part of the identifier/primary key field(s). - * - * @param string $fieldName The field name - * @return boolean TRUE if the field is part of the table identifier/primary key field(s), - * FALSE otherwise. - */ - public function isIdentifier($fieldName) - { - if ( ! $this->isIdentifierComposite) { - return $fieldName === $this->identifier[0]; - } - return in_array($fieldName, $this->identifier); - } - - /** - * Check if the field is unique. - * - * @param string $fieldName The field name - * @return boolean TRUE if the field is unique, FALSE otherwise. - */ - public function isUniqueField($fieldName) - { - $mapping = $this->getFieldMapping($fieldName); - if ($mapping !== false) { - return isset($mapping['unique']) && $mapping['unique'] == true; - } - return false; - } - - /** - * Check if the field is not null. - * - * @param string $fieldName The field name - * @return boolean TRUE if the field is not null, FALSE otherwise. - */ - public function isNullable($fieldName) - { - $mapping = $this->getFieldMapping($fieldName); - if ($mapping !== false) { - return isset($mapping['nullable']) && $mapping['nullable'] == true; - } - return false; - } - - /** - * Gets a column name for a field name. - * If the column name for the field cannot be found, the given field name - * is returned. - * - * @param string $fieldName The field name. - * @return string The column name. - */ - public function getColumnName($fieldName) - { - return isset($this->columnNames[$fieldName]) ? - $this->columnNames[$fieldName] : $fieldName; - } - - /** - * Gets the mapping of a (regular) field that holds some data but not a - * reference to another object. - * - * @param string $fieldName The field name. - * @return array The field mapping. - */ - public function getFieldMapping($fieldName) - { - if ( ! isset($this->fieldMappings[$fieldName])) { - throw MappingException::mappingNotFound($this->name, $fieldName); - } - return $this->fieldMappings[$fieldName]; - } - - /** - * Gets the mapping of an association. - * - * @see ClassMetadataInfo::$associationMappings - * @param string $fieldName The field name that represents the association in - * the object model. - * @return array The mapping. - */ - public function getAssociationMapping($fieldName) - { - if ( ! isset($this->associationMappings[$fieldName])) { - throw MappingException::mappingNotFound($this->name, $fieldName); - } - return $this->associationMappings[$fieldName]; - } - - /** - * Gets all association mappings of the class. - * - * @return array - */ - public function getAssociationMappings() - { - return $this->associationMappings; - } - - /** - * Gets the field name for a column name. - * If no field name can be found the column name is returned. - * - * @param string $columnName column name - * @return string column alias - */ - public function getFieldName($columnName) - { - return isset($this->fieldNames[$columnName]) ? - $this->fieldNames[$columnName] : $columnName; - } - - /** - * Gets the named query. - * - * @see ClassMetadataInfo::$namedQueries - * @throws MappingException - * @param string $queryName The query name - * @return string - */ - public function getNamedQuery($queryName) - { - if ( ! isset($this->namedQueries[$queryName])) { - throw MappingException::queryNotFound($this->name, $queryName); - } - return $this->namedQueries[$queryName]['dql']; - } - - /** - * Gets all named queries of the class. - * - * @return array - */ - public function getNamedQueries() - { - return $this->namedQueries; - } - - /** - * Validates & completes the given field mapping. - * - * @param array $mapping The field mapping to validated & complete. - * @return array The validated and completed field mapping. - */ - protected function _validateAndCompleteFieldMapping(array &$mapping) - { - // Check mandatory fields - if ( ! isset($mapping['fieldName']) || strlen($mapping['fieldName']) == 0) { - throw MappingException::missingFieldName($this->name); - } - if ( ! isset($mapping['type'])) { - // Default to string - $mapping['type'] = 'string'; - } - - // Complete fieldName and columnName mapping - if ( ! isset($mapping['columnName'])) { - $mapping['columnName'] = $mapping['fieldName']; - } else { - if ($mapping['columnName'][0] == '`') { - $mapping['columnName'] = trim($mapping['columnName'], '`'); - $mapping['quoted'] = true; - } - } - - $this->columnNames[$mapping['fieldName']] = $mapping['columnName']; - if (isset($this->fieldNames[$mapping['columnName']]) || ($this->discriminatorColumn != null && $this->discriminatorColumn['name'] == $mapping['columnName'])) { - throw MappingException::duplicateColumnName($this->name, $mapping['columnName']); - } - - $this->fieldNames[$mapping['columnName']] = $mapping['fieldName']; - - // Complete id mapping - if (isset($mapping['id']) && $mapping['id'] === true) { - if ($this->versionField == $mapping['fieldName']) { - throw MappingException::cannotVersionIdField($this->name, $mapping['fieldName']); - } - - if ( ! in_array($mapping['fieldName'], $this->identifier)) { - $this->identifier[] = $mapping['fieldName']; - } - // Check for composite key - if ( ! $this->isIdentifierComposite && count($this->identifier) > 1) { - $this->isIdentifierComposite = true; - } - } - - if (Type::hasType($mapping['type']) && Type::getType($mapping['type'])->canRequireSQLConversion()) { - if (isset($mapping['id']) && $mapping['id'] === true) { - throw MappingException::sqlConversionNotAllowedForIdentifiers($this->name, $mapping['fieldName'], $mapping['type']); - } - - $mapping['requireSQLConversion'] = true; - } - } - - /** - * Validates & completes the basic mapping information that is common to all - * association mappings (one-to-one, many-ot-one, one-to-many, many-to-many). - * - * @param array $mapping The mapping. - * @return array The updated mapping. - * @throws MappingException If something is wrong with the mapping. - */ - protected function _validateAndCompleteAssociationMapping(array $mapping) - { - if ( ! isset($mapping['mappedBy'])) { - $mapping['mappedBy'] = null; - } - if ( ! isset($mapping['inversedBy'])) { - $mapping['inversedBy'] = null; - } - $mapping['isOwningSide'] = true; // assume owning side until we hit mappedBy - - // unset optional indexBy attribute if its empty - if (!isset($mapping['indexBy']) || !$mapping['indexBy']) { - unset($mapping['indexBy']); - } - - // If targetEntity is unqualified, assume it is in the same namespace as - // the sourceEntity. - $mapping['sourceEntity'] = $this->name; - - if (isset($mapping['targetEntity'])) { - if (strlen($this->namespace) > 0 && strpos($mapping['targetEntity'], '\\') === false) { - $mapping['targetEntity'] = $this->namespace . '\\' . $mapping['targetEntity']; - } - - $mapping['targetEntity'] = ltrim($mapping['targetEntity'], '\\'); - } - - if ( ($mapping['type'] & self::MANY_TO_ONE) > 0 && - isset($mapping['orphanRemoval']) && - $mapping['orphanRemoval'] == true) { - - throw MappingException::illegalOrphanRemoval($this->name, $mapping['fieldName']); - } - - // Complete id mapping - if (isset($mapping['id']) && $mapping['id'] === true) { - if (isset($mapping['orphanRemoval']) && $mapping['orphanRemoval'] == true) { - throw MappingException::illegalOrphanRemovalOnIdentifierAssociation($this->name, $mapping['fieldName']); - } - - if ( ! in_array($mapping['fieldName'], $this->identifier)) { - if (count($mapping['joinColumns']) >= 2) { - throw MappingException::cannotMapCompositePrimaryKeyEntitiesAsForeignId( - $mapping['targetEntity'], $this->name, $mapping['fieldName'] - ); - } - - $this->identifier[] = $mapping['fieldName']; - $this->containsForeignIdentifier = true; - } - // Check for composite key - if ( ! $this->isIdentifierComposite && count($this->identifier) > 1) { - $this->isIdentifierComposite = true; - } - } - - // Mandatory attributes for both sides - // Mandatory: fieldName, targetEntity - if ( ! isset($mapping['fieldName']) || strlen($mapping['fieldName']) == 0) { - throw MappingException::missingFieldName($this->name); - } - if ( ! isset($mapping['targetEntity'])) { - throw MappingException::missingTargetEntity($mapping['fieldName']); - } - - // Mandatory and optional attributes for either side - if ( ! $mapping['mappedBy']) { - if (isset($mapping['joinTable']) && $mapping['joinTable']) { - if (isset($mapping['joinTable']['name']) && $mapping['joinTable']['name'][0] == '`') { - $mapping['joinTable']['name'] = trim($mapping['joinTable']['name'], '`'); - $mapping['joinTable']['quoted'] = true; - } - } - } else { - $mapping['isOwningSide'] = false; - } - - if (isset($mapping['id']) && $mapping['id'] === true && $mapping['type'] & self::TO_MANY) { - throw MappingException::illegalToManyIdentifierAssoaction($this->name, $mapping['fieldName']); - } - - // Fetch mode. Default fetch mode to LAZY, if not set. - if ( ! isset($mapping['fetch'])) { - $mapping['fetch'] = self::FETCH_LAZY; - } - - // Cascades - $cascades = isset($mapping['cascade']) ? array_map('strtolower', $mapping['cascade']) : array(); - - if (in_array('all', $cascades)) { - $cascades = array('remove', 'persist', 'refresh', 'merge', 'detach'); - } - - $mapping['cascade'] = $cascades; - $mapping['isCascadeRemove'] = in_array('remove', $cascades); - $mapping['isCascadePersist'] = in_array('persist', $cascades); - $mapping['isCascadeRefresh'] = in_array('refresh', $cascades); - $mapping['isCascadeMerge'] = in_array('merge', $cascades); - $mapping['isCascadeDetach'] = in_array('detach', $cascades); - - return $mapping; - } - - /** - * Validates & completes a one-to-one association mapping. - * - * @param array $mapping The mapping to validate & complete. - * @return array The validated & completed mapping. - * @override - */ - protected function _validateAndCompleteOneToOneMapping(array $mapping) - { - $mapping = $this->_validateAndCompleteAssociationMapping($mapping); - - if (isset($mapping['joinColumns']) && $mapping['joinColumns']) { - $mapping['isOwningSide'] = true; - } - - if ($mapping['isOwningSide']) { - if ( ! isset($mapping['joinColumns']) || ! $mapping['joinColumns']) { - // Apply default join column - $mapping['joinColumns'] = array(array( - 'name' => $mapping['fieldName'] . '_id', - 'referencedColumnName' => 'id' - )); - } - - $uniqueContraintColumns = array(); - foreach ($mapping['joinColumns'] as $key => &$joinColumn) { - if ($mapping['type'] === self::ONE_TO_ONE && ! $this->isInheritanceTypeSingleTable()) { - if (count($mapping['joinColumns']) == 1) { - if (! isset($mapping['id']) || ! $mapping['id']) { - $joinColumn['unique'] = true; - } - } else { - $uniqueContraintColumns[] = $joinColumn['name']; - } - } - if (empty($joinColumn['name'])) { - $joinColumn['name'] = $mapping['fieldName'] . '_id'; - } - if (empty($joinColumn['referencedColumnName'])) { - $joinColumn['referencedColumnName'] = 'id'; - } - $mapping['sourceToTargetKeyColumns'][$joinColumn['name']] = $joinColumn['referencedColumnName']; - $mapping['joinColumnFieldNames'][$joinColumn['name']] = isset($joinColumn['fieldName']) - ? $joinColumn['fieldName'] : $joinColumn['name']; - } - - if ($uniqueContraintColumns) { - if (!$this->table) { - throw new \RuntimeException("ClassMetadataInfo::setTable() has to be called before defining a one to one relationship."); - } - $this->table['uniqueConstraints'][$mapping['fieldName']."_uniq"] = array( - 'columns' => $uniqueContraintColumns - ); - } - - $mapping['targetToSourceKeyColumns'] = array_flip($mapping['sourceToTargetKeyColumns']); - } - - $mapping['orphanRemoval'] = isset($mapping['orphanRemoval']) ? (bool) $mapping['orphanRemoval'] : false; - $mapping['isCascadeRemove'] = $mapping['orphanRemoval'] ? true : $mapping['isCascadeRemove']; - - if (isset($mapping['id']) && $mapping['id'] === true && !$mapping['isOwningSide']) { - throw MappingException::illegalInverseIdentifierAssocation($this->name, $mapping['fieldName']); - } - - return $mapping; - } - - /** - * Validates and completes the mapping. - * - * @param array $mapping The mapping to validate and complete. - * @return array The validated and completed mapping. - * @override - */ - protected function _validateAndCompleteOneToManyMapping(array $mapping) - { - $mapping = $this->_validateAndCompleteAssociationMapping($mapping); - - // OneToMany-side MUST be inverse (must have mappedBy) - if ( ! isset($mapping['mappedBy'])) { - throw MappingException::oneToManyRequiresMappedBy($mapping['fieldName']); - } - - $mapping['orphanRemoval'] = isset($mapping['orphanRemoval']) ? (bool) $mapping['orphanRemoval'] : false; - $mapping['isCascadeRemove'] = $mapping['orphanRemoval'] ? true : $mapping['isCascadeRemove']; - - if (isset($mapping['orderBy'])) { - if ( ! is_array($mapping['orderBy'])) { - throw new \InvalidArgumentException("'orderBy' is expected to be an array, not ".gettype($mapping['orderBy'])); - } - } - - return $mapping; - } - - protected function _validateAndCompleteManyToManyMapping(array $mapping) - { - $mapping = $this->_validateAndCompleteAssociationMapping($mapping); - if ($mapping['isOwningSide']) { - if (strpos($mapping['sourceEntity'], '\\') !== false) { - $sourceShortName = strtolower(substr($mapping['sourceEntity'], strrpos($mapping['sourceEntity'], '\\') + 1)); - } else { - $sourceShortName = strtolower($mapping['sourceEntity']); - } - if (strpos($mapping['targetEntity'], '\\') !== false) { - $targetShortName = strtolower(substr($mapping['targetEntity'], strrpos($mapping['targetEntity'], '\\') + 1)); - } else { - $targetShortName = strtolower($mapping['targetEntity']); - } - - // owning side MUST have a join table - if ( ! isset($mapping['joinTable']['name'])) { - $mapping['joinTable']['name'] = $sourceShortName .'_' . $targetShortName; - } - if ( ! isset($mapping['joinTable']['joinColumns'])) { - $mapping['joinTable']['joinColumns'] = array(array( - 'name' => $sourceShortName . '_id', - 'referencedColumnName' => 'id', - 'onDelete' => 'CASCADE')); - } - if ( ! isset($mapping['joinTable']['inverseJoinColumns'])) { - $mapping['joinTable']['inverseJoinColumns'] = array(array( - 'name' => $targetShortName . '_id', - 'referencedColumnName' => 'id', - 'onDelete' => 'CASCADE')); - } - - foreach ($mapping['joinTable']['joinColumns'] as &$joinColumn) { - if (empty($joinColumn['name'])) { - $joinColumn['name'] = $sourceShortName . '_id'; - } - if (empty($joinColumn['referencedColumnName'])) { - $joinColumn['referencedColumnName'] = 'id'; - } - if (isset($joinColumn['onDelete']) && strtolower($joinColumn['onDelete']) == 'cascade') { - $mapping['isOnDeleteCascade'] = true; - } - $mapping['relationToSourceKeyColumns'][$joinColumn['name']] = $joinColumn['referencedColumnName']; - $mapping['joinTableColumns'][] = $joinColumn['name']; - } - - foreach ($mapping['joinTable']['inverseJoinColumns'] as &$inverseJoinColumn) { - if (empty($inverseJoinColumn['name'])) { - $inverseJoinColumn['name'] = $targetShortName . '_id'; - } - if (empty($inverseJoinColumn['referencedColumnName'])) { - $inverseJoinColumn['referencedColumnName'] = 'id'; - } - if (isset($inverseJoinColumn['onDelete']) && strtolower($inverseJoinColumn['onDelete']) == 'cascade') { - $mapping['isOnDeleteCascade'] = true; - } - $mapping['relationToTargetKeyColumns'][$inverseJoinColumn['name']] = $inverseJoinColumn['referencedColumnName']; - $mapping['joinTableColumns'][] = $inverseJoinColumn['name']; - } - } - - $mapping['orphanRemoval'] = isset($mapping['orphanRemoval']) ? (bool) $mapping['orphanRemoval'] : false; - - if (isset($mapping['orderBy'])) { - if ( ! is_array($mapping['orderBy'])) { - throw new \InvalidArgumentException("'orderBy' is expected to be an array, not ".gettype($mapping['orderBy'])); - } - } - - return $mapping; - } - - /** - * Gets the identifier (primary key) field names of the class. - * - * @return mixed - */ - public function getIdentifierFieldNames() - { - return $this->identifier; - } - - /** - * Gets the name of the single id field. Note that this only works on - * entity classes that have a single-field pk. - * - * @return string - * @throws MappingException If the class has a composite primary key. - */ - public function getSingleIdentifierFieldName() - { - if ($this->isIdentifierComposite) { - throw MappingException::singleIdNotAllowedOnCompositePrimaryKey($this->name); - } - return $this->identifier[0]; - } - - /** - * Gets the column name of the single id column. Note that this only works on - * entity classes that have a single-field pk. - * - * @return string - * @throws MappingException If the class has a composite primary key. - */ - public function getSingleIdentifierColumnName() - { - return $this->getColumnName($this->getSingleIdentifierFieldName()); - } - - /** - * INTERNAL: - * Sets the mapped identifier/primary key fields of this class. - * Mainly used by the ClassMetadataFactory to assign inherited identifiers. - * - * @param array $identifier - */ - public function setIdentifier(array $identifier) - { - $this->identifier = $identifier; - $this->isIdentifierComposite = (count($this->identifier) > 1); - } - - /** - * Gets the mapped identifier field of this class. - * - * @return string $identifier - */ - public function getIdentifier() - { - return $this->identifier; - } - - /** - * Checks whether the class has a (mapped) field with a certain name. - * - * @return boolean - */ - public function hasField($fieldName) - { - return isset($this->fieldMappings[$fieldName]); - } - - /** - * Gets an array containing all the column names. - * - * @return array - */ - public function getColumnNames(array $fieldNames = null) - { - if ($fieldNames === null) { - return array_keys($this->fieldNames); - } else { - $columnNames = array(); - foreach ($fieldNames as $fieldName) { - $columnNames[] = $this->getColumnName($fieldName); - } - return $columnNames; - } - } - - /** - * Returns an array with all the identifier column names. - * - * @return array - */ - public function getIdentifierColumnNames() - { - $columnNames = array(); - - foreach ($this->identifier as $idProperty) { - if (isset($this->fieldMappings[$idProperty])) { - $columnNames[] = $this->fieldMappings[$idProperty]['columnName']; - - continue; - } - - // Association defined as Id field - $joinColumns = $this->associationMappings[$idProperty]['joinColumns']; - $assocColumnNames = array_map(function ($joinColumn) { return $joinColumn['name']; }, $joinColumns); - - $columnNames = array_merge($columnNames, $assocColumnNames); - } - - return $columnNames; - } - - /** - * Sets the type of Id generator to use for the mapped class. - */ - public function setIdGeneratorType($generatorType) - { - $this->generatorType = $generatorType; - } - - /** - * Checks whether the mapped class uses an Id generator. - * - * @return boolean TRUE if the mapped class uses an Id generator, FALSE otherwise. - */ - public function usesIdGenerator() - { - return $this->generatorType != self::GENERATOR_TYPE_NONE; - } - - /** - * @return boolean - */ - public function isInheritanceTypeNone() - { - return $this->inheritanceType == self::INHERITANCE_TYPE_NONE; - } - - /** - * Checks whether the mapped class uses the JOINED inheritance mapping strategy. - * - * @return boolean TRUE if the class participates in a JOINED inheritance mapping, - * FALSE otherwise. - */ - public function isInheritanceTypeJoined() - { - return $this->inheritanceType == self::INHERITANCE_TYPE_JOINED; - } - - /** - * Checks whether the mapped class uses the SINGLE_TABLE inheritance mapping strategy. - * - * @return boolean TRUE if the class participates in a SINGLE_TABLE inheritance mapping, - * FALSE otherwise. - */ - public function isInheritanceTypeSingleTable() - { - return $this->inheritanceType == self::INHERITANCE_TYPE_SINGLE_TABLE; - } - - /** - * Checks whether the mapped class uses the TABLE_PER_CLASS inheritance mapping strategy. - * - * @return boolean TRUE if the class participates in a TABLE_PER_CLASS inheritance mapping, - * FALSE otherwise. - */ - public function isInheritanceTypeTablePerClass() - { - return $this->inheritanceType == self::INHERITANCE_TYPE_TABLE_PER_CLASS; - } - - /** - * Checks whether the class uses an identity column for the Id generation. - * - * @return boolean TRUE if the class uses the IDENTITY generator, FALSE otherwise. - */ - public function isIdGeneratorIdentity() - { - return $this->generatorType == self::GENERATOR_TYPE_IDENTITY; - } - - /** - * Checks whether the class uses a sequence for id generation. - * - * @return boolean TRUE if the class uses the SEQUENCE generator, FALSE otherwise. - */ - public function isIdGeneratorSequence() - { - return $this->generatorType == self::GENERATOR_TYPE_SEQUENCE; - } - - /** - * Checks whether the class uses a table for id generation. - * - * @return boolean TRUE if the class uses the TABLE generator, FALSE otherwise. - */ - public function isIdGeneratorTable() - { - $this->generatorType == self::GENERATOR_TYPE_TABLE; - } - - /** - * Checks whether the class has a natural identifier/pk (which means it does - * not use any Id generator. - * - * @return boolean - */ - public function isIdentifierNatural() - { - return $this->generatorType == self::GENERATOR_TYPE_NONE; - } - - /** - * Gets the type of a field. - * - * @param string $fieldName - * @return \Doctrine\DBAL\Types\Type - */ - public function getTypeOfField($fieldName) - { - return isset($this->fieldMappings[$fieldName]) ? - $this->fieldMappings[$fieldName]['type'] : null; - } - - /** - * Gets the type of a column. - * - * @return \Doctrine\DBAL\Types\Type - */ - public function getTypeOfColumn($columnName) - { - return $this->getTypeOfField($this->getFieldName($columnName)); - } - - /** - * Gets the name of the primary table. - * - * @return string - */ - public function getTableName() - { - return $this->table['name']; - } - - /** - * Gets the table name to use for temporary identifier tables of this class. - * - * @return string - */ - public function getTemporaryIdTableName() - { - // replace dots with underscores because PostgreSQL creates temporary tables in a special schema - return str_replace('.', '_', $this->getTableName() . '_id_tmp'); - } - - /** - * Sets the mapped subclasses of this class. - * - * @param array $subclasses The names of all mapped subclasses. - */ - public function setSubclasses(array $subclasses) - { - foreach ($subclasses as $subclass) { - if (strpos($subclass, '\\') === false && strlen($this->namespace)) { - $this->subClasses[] = $this->namespace . '\\' . $subclass; - } else { - $this->subClasses[] = $subclass; - } - } - } - - /** - * Sets the parent class names. - * Assumes that the class names in the passed array are in the order: - * directParent -> directParentParent -> directParentParentParent ... -> root. - */ - public function setParentClasses(array $classNames) - { - $this->parentClasses = $classNames; - if (count($classNames) > 0) { - $this->rootEntityName = array_pop($classNames); - } - } - - /** - * Sets the inheritance type used by the class and it's subclasses. - * - * @param integer $type - */ - public function setInheritanceType($type) - { - if ( ! $this->_isInheritanceType($type)) { - throw MappingException::invalidInheritanceType($this->name, $type); - } - $this->inheritanceType = $type; - } - - /** - * Checks whether a mapped field is inherited from an entity superclass. - * - * @return boolean TRUE if the field is inherited, FALSE otherwise. - */ - public function isInheritedField($fieldName) - { - return isset($this->fieldMappings[$fieldName]['inherited']); - } - - /** - * Checks whether a mapped association field is inherited from a superclass. - * - * @param string $fieldName - * @return boolean TRUE if the field is inherited, FALSE otherwise. - */ - public function isInheritedAssociation($fieldName) - { - return isset($this->associationMappings[$fieldName]['inherited']); - } - - /** - * Sets the name of the primary table the class is mapped to. - * - * @param string $tableName The table name. - * @deprecated Use {@link setPrimaryTable}. - */ - public function setTableName($tableName) - { - $this->table['name'] = $tableName; - } - - /** - * Sets the primary table definition. The provided array supports the - * following structure: - * - * name => (optional, defaults to class name) - * indexes => array of indexes (optional) - * uniqueConstraints => array of constraints (optional) - * - * If a key is omitted, the current value is kept. - * - * @param array $table The table description. - */ - public function setPrimaryTable(array $table) - { - if (isset($table['name'])) { - if ($table['name'][0] == '`') { - $this->table['name'] = str_replace("`", "", $table['name']); - $this->table['quoted'] = true; - } else { - $this->table['name'] = $table['name']; - } - } - - if (isset($table['indexes'])) { - $this->table['indexes'] = $table['indexes']; - } - - if (isset($table['uniqueConstraints'])) { - $this->table['uniqueConstraints'] = $table['uniqueConstraints']; - } - } - - /** - * Checks whether the given type identifies an inheritance type. - * - * @param integer $type - * @return boolean TRUE if the given type identifies an inheritance type, FALSe otherwise. - */ - private function _isInheritanceType($type) - { - return $type == self::INHERITANCE_TYPE_NONE || - $type == self::INHERITANCE_TYPE_SINGLE_TABLE || - $type == self::INHERITANCE_TYPE_JOINED || - $type == self::INHERITANCE_TYPE_TABLE_PER_CLASS; - } - - /** - * Adds a mapped field to the class. - * - * @param array $mapping The field mapping. - */ - public function mapField(array $mapping) - { - $this->_validateAndCompleteFieldMapping($mapping); - if (isset($this->fieldMappings[$mapping['fieldName']]) || isset($this->associationMappings[$mapping['fieldName']])) { - throw MappingException::duplicateFieldMapping($this->name, $mapping['fieldName']); - } - $this->fieldMappings[$mapping['fieldName']] = $mapping; - } - - /** - * INTERNAL: - * Adds an association mapping without completing/validating it. - * This is mainly used to add inherited association mappings to derived classes. - * - * @param array $mapping - */ - public function addInheritedAssociationMapping(array $mapping/*, $owningClassName = null*/) - { - if (isset($this->associationMappings[$mapping['fieldName']])) { - throw MappingException::duplicateAssociationMapping($this->name, $mapping['fieldName']); - } - $this->associationMappings[$mapping['fieldName']] = $mapping; - } - - /** - * INTERNAL: - * Adds a field mapping without completing/validating it. - * This is mainly used to add inherited field mappings to derived classes. - * - * @param array $mapping - */ - public function addInheritedFieldMapping(array $fieldMapping) - { - $this->fieldMappings[$fieldMapping['fieldName']] = $fieldMapping; - $this->columnNames[$fieldMapping['fieldName']] = $fieldMapping['columnName']; - $this->fieldNames[$fieldMapping['columnName']] = $fieldMapping['fieldName']; - } - - /** - * INTERNAL: - * Adds a named query to this class. - * - * @throws MappingException - * @param array $queryMapping - */ - public function addNamedQuery(array $queryMapping) - { - if (isset($this->namedQueries[$queryMapping['name']])) { - throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']); - } - - $name = $queryMapping['name']; - $query = $queryMapping['query']; - $dql = str_replace('__CLASS__', $this->name, $query); - $this->namedQueries[$name] = array( - 'name' => $name, - 'query' => $query, - 'dql' => $dql - ); - } - - /** - * Adds a one-to-one mapping. - * - * @param array $mapping The mapping. - */ - public function mapOneToOne(array $mapping) - { - $mapping['type'] = self::ONE_TO_ONE; - $mapping = $this->_validateAndCompleteOneToOneMapping($mapping); - $this->_storeAssociationMapping($mapping); - } - - /** - * Adds a one-to-many mapping. - * - * @param array $mapping The mapping. - */ - public function mapOneToMany(array $mapping) - { - $mapping['type'] = self::ONE_TO_MANY; - $mapping = $this->_validateAndCompleteOneToManyMapping($mapping); - $this->_storeAssociationMapping($mapping); - } - - /** - * Adds a many-to-one mapping. - * - * @param array $mapping The mapping. - */ - public function mapManyToOne(array $mapping) - { - $mapping['type'] = self::MANY_TO_ONE; - // A many-to-one mapping is essentially a one-one backreference - $mapping = $this->_validateAndCompleteOneToOneMapping($mapping); - $this->_storeAssociationMapping($mapping); - } - - /** - * Adds a many-to-many mapping. - * - * @param array $mapping The mapping. - */ - public function mapManyToMany(array $mapping) - { - $mapping['type'] = self::MANY_TO_MANY; - $mapping = $this->_validateAndCompleteManyToManyMapping($mapping); - $this->_storeAssociationMapping($mapping); - } - - /** - * Stores the association mapping. - * - * @param array $assocMapping - */ - protected function _storeAssociationMapping(array $assocMapping) - { - $sourceFieldName = $assocMapping['fieldName']; - - if (isset($this->fieldMappings[$sourceFieldName]) || isset($this->associationMappings[$sourceFieldName])) { - throw MappingException::duplicateFieldMapping($this->name, $sourceFieldName); - } - - $this->associationMappings[$sourceFieldName] = $assocMapping; - } - - /** - * Registers a custom repository class for the entity class. - * - * @param string $mapperClassName The class name of the custom mapper. - */ - public function setCustomRepositoryClass($repositoryClassName) - { - if ($repositoryClassName !== null && strpos($repositoryClassName, '\\') === false - && strlen($this->namespace) > 0) { - $repositoryClassName = $this->namespace . '\\' . $repositoryClassName; - } - $this->customRepositoryClassName = $repositoryClassName; - } - - /** - * Dispatches the lifecycle event of the given entity to the registered - * lifecycle callbacks and lifecycle listeners. - * - * @param string $event The lifecycle event. - * @param Entity $entity The Entity on which the event occured. - */ - public function invokeLifecycleCallbacks($lifecycleEvent, $entity) - { - foreach ($this->lifecycleCallbacks[$lifecycleEvent] as $callback) { - $entity->$callback(); - } - } - - /** - * Whether the class has any attached lifecycle listeners or callbacks for a lifecycle event. - * - * @param string $lifecycleEvent - * @return boolean - */ - public function hasLifecycleCallbacks($lifecycleEvent) - { - return isset($this->lifecycleCallbacks[$lifecycleEvent]); - } - - /** - * Gets the registered lifecycle callbacks for an event. - * - * @param string $event - * @return array - */ - public function getLifecycleCallbacks($event) - { - return isset($this->lifecycleCallbacks[$event]) ? $this->lifecycleCallbacks[$event] : array(); - } - - /** - * Adds a lifecycle callback for entities of this class. - * - * @param string $callback - * @param string $event - */ - public function addLifecycleCallback($callback, $event) - { - $this->lifecycleCallbacks[$event][] = $callback; - } - - /** - * Sets the lifecycle callbacks for entities of this class. - * Any previously registered callbacks are overwritten. - * - * @param array $callbacks - */ - public function setLifecycleCallbacks(array $callbacks) - { - $this->lifecycleCallbacks = $callbacks; - } - - /** - * Sets the discriminator column definition. - * - * @param array $columnDef - * @see getDiscriminatorColumn() - */ - public function setDiscriminatorColumn($columnDef) - { - if ($columnDef !== null) { - if (isset($this->fieldNames[$columnDef['name']])) { - throw MappingException::duplicateColumnName($this->name, $columnDef['name']); - } - - if ( ! isset($columnDef['name'])) { - throw MappingException::nameIsMandatoryForDiscriminatorColumns($this->name, $columnDef); - } - if ( ! isset($columnDef['fieldName'])) { - $columnDef['fieldName'] = $columnDef['name']; - } - if ( ! isset($columnDef['type'])) { - $columnDef['type'] = "string"; - } - if (in_array($columnDef['type'], array("boolean", "array", "object", "datetime", "time", "date"))) { - throw MappingException::invalidDiscriminatorColumnType($this->name, $columnDef['type']); - } - - $this->discriminatorColumn = $columnDef; - } - } - - /** - * Sets the discriminator values used by this class. - * Used for JOINED and SINGLE_TABLE inheritance mapping strategies. - * - * @param array $map - */ - public function setDiscriminatorMap(array $map) - { - foreach ($map as $value => $className) { - $this->addDiscriminatorMapClass($value, $className); - } - } - - /** - * Add one entry of the discriminator map with a new class and corresponding name. - * - * @param string $name - * @param string $className - */ - public function addDiscriminatorMapClass($name, $className) - { - if (strlen($this->namespace) > 0 && strpos($className, '\\') === false) { - $className = $this->namespace . '\\' . $className; - } - - $className = ltrim($className, '\\'); - $this->discriminatorMap[$name] = $className; - - if ($this->name == $className) { - $this->discriminatorValue = $name; - } else { - if ( ! class_exists($className)) { - throw MappingException::invalidClassInDiscriminatorMap($className, $this->name); - } - if (is_subclass_of($className, $this->name) && ! in_array($className, $this->subClasses)) { - $this->subClasses[] = $className; - } - } - } - - /** - * Checks whether the class has a named query with the given query name. - * - * @param string $fieldName - * @return boolean - */ - public function hasNamedQuery($queryName) - { - return isset($this->namedQueries[$queryName]); - } - - /** - * Checks whether the class has a mapped association with the given field name. - * - * @param string $fieldName - * @return boolean - */ - public function hasAssociation($fieldName) - { - return isset($this->associationMappings[$fieldName]); - } - - /** - * Checks whether the class has a mapped association for the specified field - * and if yes, checks whether it is a single-valued association (to-one). - * - * @param string $fieldName - * @return boolean TRUE if the association exists and is single-valued, FALSE otherwise. - */ - public function isSingleValuedAssociation($fieldName) - { - return isset($this->associationMappings[$fieldName]) && - ($this->associationMappings[$fieldName]['type'] & self::TO_ONE); - } - - /** - * Checks whether the class has a mapped association for the specified field - * and if yes, checks whether it is a collection-valued association (to-many). - * - * @param string $fieldName - * @return boolean TRUE if the association exists and is collection-valued, FALSE otherwise. - */ - public function isCollectionValuedAssociation($fieldName) - { - return isset($this->associationMappings[$fieldName]) && - ! ($this->associationMappings[$fieldName]['type'] & self::TO_ONE); - } - - /** - * Is this an association that only has a single join column? - * - * @param string $fieldName - * @return bool - */ - public function isAssociationWithSingleJoinColumn($fieldName) - { - return ( - isset($this->associationMappings[$fieldName]) && - isset($this->associationMappings[$fieldName]['joinColumns'][0]) && - !isset($this->associationMappings[$fieldName]['joinColumns'][1]) - ); - } - - /** - * Return the single association join column (if any). - * - * @param string $fieldName - * @return string - */ - public function getSingleAssociationJoinColumnName($fieldName) - { - if (!$this->isAssociationWithSingleJoinColumn($fieldName)) { - throw MappingException::noSingleAssociationJoinColumnFound($this->name, $fieldName); - } - return $this->associationMappings[$fieldName]['joinColumns'][0]['name']; - } - - /** - * Return the single association referenced join column name (if any). - * - * @param string $fieldName - * @return string - */ - public function getSingleAssociationReferencedJoinColumnName($fieldName) - { - if (!$this->isAssociationWithSingleJoinColumn($fieldName)) { - throw MappingException::noSingleAssociationJoinColumnFound($this->name, $fieldName); - } - return $this->associationMappings[$fieldName]['joinColumns'][0]['referencedColumnName']; - } - - /** - * Used to retrieve a fieldname for either field or association from a given column, - * - * This method is used in foreign-key as primary-key contexts. - * - * @param string $columnName - * @return string - */ - public function getFieldForColumn($columnName) - { - if (isset($this->fieldNames[$columnName])) { - return $this->fieldNames[$columnName]; - } else { - foreach ($this->associationMappings AS $assocName => $mapping) { - if ($this->isAssociationWithSingleJoinColumn($assocName) && - $this->associationMappings[$assocName]['joinColumns'][0]['name'] == $columnName) { - - return $assocName; - } - } - - throw MappingException::noFieldNameFoundForColumn($this->name, $columnName); - } - } - - /** - * Sets the ID generator used to generate IDs for instances of this class. - * - * @param AbstractIdGenerator $generator - */ - public function setIdGenerator($generator) - { - $this->idGenerator = $generator; - } - - /** - * Sets the definition of the sequence ID generator for this class. - * - * The definition must have the following structure: - * - * array( - * 'sequenceName' => 'name', - * 'allocationSize' => 20, - * 'initialValue' => 1 - * ) - * - * - * @param array $definition - */ - public function setSequenceGeneratorDefinition(array $definition) - { - $this->sequenceGeneratorDefinition = $definition; - } - - /** - * Sets the version field mapping used for versioning. Sets the default - * value to use depending on the column type. - * - * @param array $mapping The version field mapping array - */ - public function setVersionMapping(array &$mapping) - { - $this->isVersioned = true; - $this->versionField = $mapping['fieldName']; - - if ( ! isset($mapping['default'])) { - if (in_array($mapping['type'], array('integer', 'bigint', 'smallint'))) { - $mapping['default'] = 1; - } else if ($mapping['type'] == 'datetime') { - $mapping['default'] = 'CURRENT_TIMESTAMP'; - } else { - throw MappingException::unsupportedOptimisticLockingType($this->name, $mapping['fieldName'], $mapping['type']); - } - } - } - - /** - * Sets whether this class is to be versioned for optimistic locking. - * - * @param boolean $bool - */ - public function setVersioned($bool) - { - $this->isVersioned = $bool; - } - - /** - * Sets the name of the field that is to be used for versioning if this class is - * versioned for optimistic locking. - * - * @param string $versionField - */ - public function setVersionField($versionField) - { - $this->versionField = $versionField; - } - - /** - * Mark this class as read only, no change tracking is applied to it. - * - * @return void - */ - public function markReadOnly() - { - $this->isReadOnly = true; - } - - /** - * A numerically indexed list of field names of this persistent class. - * - * This array includes identifier fields if present on this class. - * - * @return array - */ - public function getFieldNames() - { - return array_keys($this->fieldMappings); - } - - /** - * A numerically indexed list of association names of this persistent class. - * - * This array includes identifier associations if present on this class. - * - * @return array - */ - public function getAssociationNames() - { - return array_keys($this->associationMappings); - } - - /** - * Returns the target class name of the given association. - * - * @param string $assocName - * @return string - */ - public function getAssociationTargetClass($assocName) - { - if ( ! isset($this->associationMappings[$assocName])) { - throw new \InvalidArgumentException("Association name expected, '" . $assocName ."' is not an association."); - } - - return $this->associationMappings[$assocName]['targetEntity']; - } - - /** - * Get fully-qualified class name of this persistent class. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Gets the (possibly quoted) identifier column names for safe use in an SQL statement. - * - * @param AbstractPlatform $platform - * @return array - */ - public function getQuotedIdentifierColumnNames($platform) - { - $quotedColumnNames = array(); - - foreach ($this->identifier as $idProperty) { - if (isset($this->fieldMappings[$idProperty])) { - $quotedColumnNames[] = isset($this->fieldMappings[$idProperty]['quoted']) - ? $platform->quoteIdentifier($this->fieldMappings[$idProperty]['columnName']) - : $this->fieldMappings[$idProperty]['columnName']; - - continue; - } - - // Association defined as Id field - $joinColumns = $this->associationMappings[$idProperty]['joinColumns']; - $assocQuotedColumnNames = array_map( - function ($joinColumn) { - return isset($joinColumn['quoted']) - ? $platform->quoteIdentifier($joinColumn['name']) - : $joinColumn['name']; - }, - $joinColumns - ); - - $quotedColumnNames = array_merge($quotedColumnNames, $assocQuotedColumnNames); - } - - return $quotedColumnNames; - } - - /** - * Gets the (possibly quoted) column name of a mapped field for safe use - * in an SQL statement. - * - * @param string $field - * @param AbstractPlatform $platform - * @return string - */ - public function getQuotedColumnName($field, $platform) - { - return isset($this->fieldMappings[$field]['quoted']) - ? $platform->quoteIdentifier($this->fieldMappings[$field]['columnName']) - : $this->fieldMappings[$field]['columnName']; - } - - /** - * Gets the (possibly quoted) primary table name of this class for safe use - * in an SQL statement. - * - * @param AbstractPlatform $platform - * @return string - */ - public function getQuotedTableName($platform) - { - return isset($this->table['quoted']) ? $platform->quoteIdentifier($this->table['name']) : $this->table['name']; - } - - /** - * Gets the (possibly quoted) name of the join table. - * - * @param AbstractPlatform $platform - * @return string - */ - public function getQuotedJoinTableName(array $assoc, $platform) - { - return isset($assoc['joinTable']['quoted']) ? $platform->quoteIdentifier($assoc['joinTable']['name']) : $assoc['joinTable']['name']; - } - - /** - * @param string $fieldName - * @return bool - */ - public function isAssociationInverseSide($fieldName) - { - return isset($this->associationMappings[$fieldName]) && ! $this->associationMappings[$fieldName]['isOwningSide']; - } - - /** - * @param string $fieldName - * @return string - */ - public function getAssociationMappedByTargetField($fieldName) - { - return $this->associationMappings[$fieldName]['mappedBy']; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Column.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Column.php deleted file mode 100644 index 5f7dd7f..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Column.php +++ /dev/null @@ -1,46 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("PROPERTY") - */ -final class Column implements Annotation -{ - /** @var string */ - public $name; - /** @var mixed */ - public $type = 'string'; - /** @var integer */ - public $length; - /** @var integer */ - public $precision = 0; // The precision for a decimal (exact numeric) column (Applies only for decimal column) - /** @var integer */ - public $scale = 0; // The scale for a decimal (exact numeric) column (Applies only for decimal column) - /** @var boolean */ - public $unique = false; - /** @var boolean */ - public $nullable = false; - /** @var array */ - public $options = array(); - /** @var string */ - public $columnDefinition; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/DiscriminatorColumn.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/DiscriminatorColumn.php deleted file mode 100644 index aec0115..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/DiscriminatorColumn.php +++ /dev/null @@ -1,36 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("CLASS") - */ -final class DiscriminatorColumn implements Annotation -{ - /** @var string */ - public $name; - /** @var string */ - public $type; - /** @var integer */ - public $length; - /** @var mixed */ - public $fieldName; // field name used in non-object hydration (array/scalar) -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/DiscriminatorMap.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/DiscriminatorMap.php deleted file mode 100644 index 8505cf9..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/DiscriminatorMap.php +++ /dev/null @@ -1,30 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("CLASS") - */ -final class DiscriminatorMap implements Annotation -{ - /** @var array */ - public $value; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/AbstractFileDriver.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/AbstractFileDriver.php deleted file mode 100644 index 6953bf2..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/AbstractFileDriver.php +++ /dev/null @@ -1,213 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping\Driver; - -use Doctrine\ORM\Mapping\MappingException; - -/** - * Base driver for file-based metadata drivers. - * - * A file driver operates in a mode where it loads the mapping files of individual - * classes on demand. This requires the user to adhere to the convention of 1 mapping - * file per class and the file names of the mapping files must correspond to the full - * class name, including namespace, with the namespace delimiters '\', replaced by dots '.'. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -abstract class AbstractFileDriver implements Driver -{ - /** - * The paths where to look for mapping files. - * - * @var array - */ - protected $_paths = array(); - - /** - * The file extension of mapping documents. - * - * @var string - */ - protected $_fileExtension; - - /** - * Initializes a new FileDriver that looks in the given path(s) for mapping - * documents and operates in the specified operating mode. - * - * @param string|array $paths One or multiple paths where mapping documents can be found. - */ - public function __construct($paths) - { - $this->addPaths((array) $paths); - } - - /** - * Append lookup paths to metadata driver. - * - * @param array $paths - */ - public function addPaths(array $paths) - { - $this->_paths = array_unique(array_merge($this->_paths, $paths)); - } - - /** - * Retrieve the defined metadata lookup paths. - * - * @return array - */ - public function getPaths() - { - return $this->_paths; - } - - /** - * Get the file extension used to look for mapping files under - * - * @return void - */ - public function getFileExtension() - { - return $this->_fileExtension; - } - - /** - * Set the file extension used to look for mapping files under - * - * @param string $fileExtension The file extension to set - * @return void - */ - public function setFileExtension($fileExtension) - { - $this->_fileExtension = $fileExtension; - } - - /** - * Get the element of schema meta data for the class from the mapping file. - * This will lazily load the mapping file if it is not loaded yet - * - * @return array $element The element of schema meta data - */ - public function getElement($className) - { - $result = $this->_loadMappingFile($this->_findMappingFile($className)); - - if(!isset($result[$className])){ - throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className) . $this->_fileExtension); - } - return $result[$className]; - } - - /** - * Whether the class with the specified name should have its metadata loaded. - * This is only the case if it is either mapped as an Entity or a - * MappedSuperclass. - * - * @param string $className - * @return boolean - */ - public function isTransient($className) - { - $fileName = str_replace('\\', '.', $className) . $this->_fileExtension; - - // Check whether file exists - foreach ((array) $this->_paths as $path) { - if (file_exists($path . DIRECTORY_SEPARATOR . $fileName)) { - return false; - } - } - - return true; - } - - /** - * Gets the names of all mapped classes known to this driver. - * - * @return array The names of all mapped classes known to this driver. - */ - public function getAllClassNames() - { - $classes = array(); - - if ($this->_paths) { - foreach ((array) $this->_paths as $path) { - if ( ! is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); - } - - $iterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - - foreach ($iterator as $file) { - if (($fileName = $file->getBasename($this->_fileExtension)) == $file->getBasename()) { - continue; - } - - // NOTE: All files found here means classes are not transient! - $classes[] = str_replace('.', '\\', $fileName); - } - } - } - - return $classes; - } - - /** - * Finds the mapping file for the class with the given name by searching - * through the configured paths. - * - * @param $className - * @return string The (absolute) file name. - * @throws MappingException - */ - protected function _findMappingFile($className) - { - $fileName = str_replace('\\', '.', $className) . $this->_fileExtension; - - // Check whether file exists - foreach ((array) $this->_paths as $path) { - if (file_exists($path . DIRECTORY_SEPARATOR . $fileName)) { - return $path . DIRECTORY_SEPARATOR . $fileName; - } - } - - throw MappingException::mappingFileNotFound($className, $fileName); - } - - /** - * Loads a mapping file with the given name and returns a map - * from class/entity names to their corresponding elements. - * - * @param string $file The mapping file to load. - * @return array - */ - abstract protected function _loadMappingFile($file); -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php deleted file mode 100644 index b71146c..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php +++ /dev/null @@ -1,599 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping\Driver; - -use Doctrine\Common\Cache\ArrayCache, - Doctrine\Common\Annotations\AnnotationReader, - Doctrine\Common\Annotations\AnnotationRegistry, - Doctrine\ORM\Mapping\ClassMetadataInfo, - Doctrine\ORM\Mapping\MappingException; - -/** - * The AnnotationDriver reads the mapping metadata from docblock annotations. - * - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -class AnnotationDriver implements Driver -{ - /** - * The AnnotationReader. - * - * @var AnnotationReader - */ - protected $_reader; - - /** - * The paths where to look for mapping files. - * - * @var array - */ - protected $_paths = array(); - - /** - * The file extension of mapping documents. - * - * @var string - */ - protected $_fileExtension = '.php'; - - /** - * @param array - */ - protected $_classNames; - - /** - * Initializes a new AnnotationDriver that uses the given AnnotationReader for reading - * docblock annotations. - * - * @param AnnotationReader $reader The AnnotationReader to use, duck-typed. - * @param string|array $paths One or multiple paths where mapping classes can be found. - */ - public function __construct($reader, $paths = null) - { - $this->_reader = $reader; - if ($paths) { - $this->addPaths((array) $paths); - } - } - - /** - * Append lookup paths to metadata driver. - * - * @param array $paths - */ - public function addPaths(array $paths) - { - $this->_paths = array_unique(array_merge($this->_paths, $paths)); - } - - /** - * Retrieve the defined metadata lookup paths. - * - * @return array - */ - public function getPaths() - { - return $this->_paths; - } - - /** - * Retrieve the current annotation reader - * - * @return AnnotationReader - */ - public function getReader() - { - return $this->_reader; - } - - /** - * Get the file extension used to look for mapping files under - * - * @return void - */ - public function getFileExtension() - { - return $this->_fileExtension; - } - - /** - * Set the file extension used to look for mapping files under - * - * @param string $fileExtension The file extension to set - * @return void - */ - public function setFileExtension($fileExtension) - { - $this->_fileExtension = $fileExtension; - } - - /** - * {@inheritdoc} - */ - public function loadMetadataForClass($className, ClassMetadataInfo $metadata) - { - $class = $metadata->getReflectionClass(); - if (!$class) { - // this happens when running annotation driver in combination with - // static reflection services. This is not the nicest fix - $class = new \ReflectionClass($metadata->name); - } - - $classAnnotations = $this->_reader->getClassAnnotations($class); - - if ($classAnnotations) { - foreach ($classAnnotations as $key => $annot) { - if ( ! is_numeric($key)) { - continue; - } - - $classAnnotations[get_class($annot)] = $annot; - } - } - - // Evaluate Entity annotation - if (isset($classAnnotations['Doctrine\ORM\Mapping\Entity'])) { - $entityAnnot = $classAnnotations['Doctrine\ORM\Mapping\Entity']; - if ($entityAnnot->repositoryClass !== null) { - $metadata->setCustomRepositoryClass($entityAnnot->repositoryClass); - } - if ($entityAnnot->readOnly) { - $metadata->markReadOnly(); - } - } else if (isset($classAnnotations['Doctrine\ORM\Mapping\MappedSuperclass'])) { - $mappedSuperclassAnnot = $classAnnotations['Doctrine\ORM\Mapping\MappedSuperclass']; - $metadata->setCustomRepositoryClass($mappedSuperclassAnnot->repositoryClass); - $metadata->isMappedSuperclass = true; - } else { - throw MappingException::classIsNotAValidEntityOrMappedSuperClass($className); - } - - // Evaluate Table annotation - if (isset($classAnnotations['Doctrine\ORM\Mapping\Table'])) { - $tableAnnot = $classAnnotations['Doctrine\ORM\Mapping\Table']; - $primaryTable = array( - 'name' => $tableAnnot->name, - 'schema' => $tableAnnot->schema - ); - - if ($tableAnnot->indexes !== null) { - foreach ($tableAnnot->indexes as $indexAnnot) { - $index = array('columns' => $indexAnnot->columns); - - if ( ! empty($indexAnnot->name)) { - $primaryTable['indexes'][$indexAnnot->name] = $index; - } else { - $primaryTable['indexes'][] = $index; - } - } - } - - if ($tableAnnot->uniqueConstraints !== null) { - foreach ($tableAnnot->uniqueConstraints as $uniqueConstraintAnnot) { - $uniqueConstraint = array('columns' => $uniqueConstraintAnnot->columns); - - if ( ! empty($uniqueConstraintAnnot->name)) { - $primaryTable['uniqueConstraints'][$uniqueConstraintAnnot->name] = $uniqueConstraint; - } else { - $primaryTable['uniqueConstraints'][] = $uniqueConstraint; - } - } - } - - $metadata->setPrimaryTable($primaryTable); - } - - // Evaluate NamedQueries annotation - if (isset($classAnnotations['Doctrine\ORM\Mapping\NamedQueries'])) { - $namedQueriesAnnot = $classAnnotations['Doctrine\ORM\Mapping\NamedQueries']; - - if (!is_array($namedQueriesAnnot->value)) { - throw new \UnexpectedValueException("@NamedQueries should contain an array of @NamedQuery annotations."); - } - - foreach ($namedQueriesAnnot->value as $namedQuery) { - if (!($namedQuery instanceof \Doctrine\ORM\Mapping\NamedQuery)) { - throw new \UnexpectedValueException("@NamedQueries should contain an array of @NamedQuery annotations."); - } - $metadata->addNamedQuery(array( - 'name' => $namedQuery->name, - 'query' => $namedQuery->query - )); - } - } - - // Evaluate InheritanceType annotation - if (isset($classAnnotations['Doctrine\ORM\Mapping\InheritanceType'])) { - $inheritanceTypeAnnot = $classAnnotations['Doctrine\ORM\Mapping\InheritanceType']; - $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . $inheritanceTypeAnnot->value)); - - if ($metadata->inheritanceType != \Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_NONE) { - // Evaluate DiscriminatorColumn annotation - if (isset($classAnnotations['Doctrine\ORM\Mapping\DiscriminatorColumn'])) { - $discrColumnAnnot = $classAnnotations['Doctrine\ORM\Mapping\DiscriminatorColumn']; - $metadata->setDiscriminatorColumn(array( - 'name' => $discrColumnAnnot->name, - 'type' => $discrColumnAnnot->type, - 'length' => $discrColumnAnnot->length - )); - } else { - $metadata->setDiscriminatorColumn(array('name' => 'dtype', 'type' => 'string', 'length' => 255)); - } - - // Evaluate DiscriminatorMap annotation - if (isset($classAnnotations['Doctrine\ORM\Mapping\DiscriminatorMap'])) { - $discrMapAnnot = $classAnnotations['Doctrine\ORM\Mapping\DiscriminatorMap']; - $metadata->setDiscriminatorMap($discrMapAnnot->value); - } - } - } - - - // Evaluate DoctrineChangeTrackingPolicy annotation - if (isset($classAnnotations['Doctrine\ORM\Mapping\ChangeTrackingPolicy'])) { - $changeTrackingAnnot = $classAnnotations['Doctrine\ORM\Mapping\ChangeTrackingPolicy']; - $metadata->setChangeTrackingPolicy(constant('Doctrine\ORM\Mapping\ClassMetadata::CHANGETRACKING_' . $changeTrackingAnnot->value)); - } - - // Evaluate annotations on properties/fields - foreach ($class->getProperties() as $property) { - if ($metadata->isMappedSuperclass && ! $property->isPrivate() - || - $metadata->isInheritedField($property->name) - || - $metadata->isInheritedAssociation($property->name)) { - continue; - } - - $mapping = array(); - $mapping['fieldName'] = $property->getName(); - - // Check for JoinColummn/JoinColumns annotations - $joinColumns = array(); - - if ($joinColumnAnnot = $this->_reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\JoinColumn')) { - $joinColumns[] = array( - 'name' => $joinColumnAnnot->name, - 'referencedColumnName' => $joinColumnAnnot->referencedColumnName, - 'unique' => $joinColumnAnnot->unique, - 'nullable' => $joinColumnAnnot->nullable, - 'onDelete' => $joinColumnAnnot->onDelete, - 'columnDefinition' => $joinColumnAnnot->columnDefinition, - ); - } else if ($joinColumnsAnnot = $this->_reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\JoinColumns')) { - foreach ($joinColumnsAnnot->value as $joinColumn) { - $joinColumns[] = array( - 'name' => $joinColumn->name, - 'referencedColumnName' => $joinColumn->referencedColumnName, - 'unique' => $joinColumn->unique, - 'nullable' => $joinColumn->nullable, - 'onDelete' => $joinColumn->onDelete, - 'columnDefinition' => $joinColumn->columnDefinition, - ); - } - } - - // Field can only be annotated with one of: - // @Column, @OneToOne, @OneToMany, @ManyToOne, @ManyToMany - if ($columnAnnot = $this->_reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\Column')) { - if ($columnAnnot->type == null) { - throw MappingException::propertyTypeIsRequired($className, $property->getName()); - } - - $mapping['type'] = $columnAnnot->type; - $mapping['length'] = $columnAnnot->length; - $mapping['precision'] = $columnAnnot->precision; - $mapping['scale'] = $columnAnnot->scale; - $mapping['nullable'] = $columnAnnot->nullable; - $mapping['unique'] = $columnAnnot->unique; - if ($columnAnnot->options) { - $mapping['options'] = $columnAnnot->options; - } - - if (isset($columnAnnot->name)) { - $mapping['columnName'] = $columnAnnot->name; - } - - if (isset($columnAnnot->columnDefinition)) { - $mapping['columnDefinition'] = $columnAnnot->columnDefinition; - } - - if ($idAnnot = $this->_reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\Id')) { - $mapping['id'] = true; - } - - if ($generatedValueAnnot = $this->_reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\GeneratedValue')) { - $metadata->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_' . $generatedValueAnnot->strategy)); - } - - if ($versionAnnot = $this->_reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\Version')) { - $metadata->setVersionMapping($mapping); - } - - $metadata->mapField($mapping); - - // Check for SequenceGenerator/TableGenerator definition - if ($seqGeneratorAnnot = $this->_reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\SequenceGenerator')) { - $metadata->setSequenceGeneratorDefinition(array( - 'sequenceName' => $seqGeneratorAnnot->sequenceName, - 'allocationSize' => $seqGeneratorAnnot->allocationSize, - 'initialValue' => $seqGeneratorAnnot->initialValue - )); - } else if ($tblGeneratorAnnot = $this->_reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\TableGenerator')) { - throw MappingException::tableIdGeneratorNotImplemented($className); - } - } else if ($oneToOneAnnot = $this->_reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\OneToOne')) { - if ($idAnnot = $this->_reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\Id')) { - $mapping['id'] = true; - } - - $mapping['targetEntity'] = $oneToOneAnnot->targetEntity; - $mapping['joinColumns'] = $joinColumns; - $mapping['mappedBy'] = $oneToOneAnnot->mappedBy; - $mapping['inversedBy'] = $oneToOneAnnot->inversedBy; - $mapping['cascade'] = $oneToOneAnnot->cascade; - $mapping['orphanRemoval'] = $oneToOneAnnot->orphanRemoval; - $mapping['fetch'] = $this->getFetchMode($className, $oneToOneAnnot->fetch); - $metadata->mapOneToOne($mapping); - } else if ($oneToManyAnnot = $this->_reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\OneToMany')) { - $mapping['mappedBy'] = $oneToManyAnnot->mappedBy; - $mapping['targetEntity'] = $oneToManyAnnot->targetEntity; - $mapping['cascade'] = $oneToManyAnnot->cascade; - $mapping['indexBy'] = $oneToManyAnnot->indexBy; - $mapping['orphanRemoval'] = $oneToManyAnnot->orphanRemoval; - $mapping['fetch'] = $this->getFetchMode($className, $oneToManyAnnot->fetch); - - if ($orderByAnnot = $this->_reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\OrderBy')) { - $mapping['orderBy'] = $orderByAnnot->value; - } - - $metadata->mapOneToMany($mapping); - } else if ($manyToOneAnnot = $this->_reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\ManyToOne')) { - if ($idAnnot = $this->_reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\Id')) { - $mapping['id'] = true; - } - - $mapping['joinColumns'] = $joinColumns; - $mapping['cascade'] = $manyToOneAnnot->cascade; - $mapping['inversedBy'] = $manyToOneAnnot->inversedBy; - $mapping['targetEntity'] = $manyToOneAnnot->targetEntity; - $mapping['fetch'] = $this->getFetchMode($className, $manyToOneAnnot->fetch); - $metadata->mapManyToOne($mapping); - } else if ($manyToManyAnnot = $this->_reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\ManyToMany')) { - $joinTable = array(); - - if ($joinTableAnnot = $this->_reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\JoinTable')) { - $joinTable = array( - 'name' => $joinTableAnnot->name, - 'schema' => $joinTableAnnot->schema - ); - - foreach ($joinTableAnnot->joinColumns as $joinColumn) { - $joinTable['joinColumns'][] = array( - 'name' => $joinColumn->name, - 'referencedColumnName' => $joinColumn->referencedColumnName, - 'unique' => $joinColumn->unique, - 'nullable' => $joinColumn->nullable, - 'onDelete' => $joinColumn->onDelete, - 'columnDefinition' => $joinColumn->columnDefinition, - ); - } - - foreach ($joinTableAnnot->inverseJoinColumns as $joinColumn) { - $joinTable['inverseJoinColumns'][] = array( - 'name' => $joinColumn->name, - 'referencedColumnName' => $joinColumn->referencedColumnName, - 'unique' => $joinColumn->unique, - 'nullable' => $joinColumn->nullable, - 'onDelete' => $joinColumn->onDelete, - 'columnDefinition' => $joinColumn->columnDefinition, - ); - } - } - - $mapping['joinTable'] = $joinTable; - $mapping['targetEntity'] = $manyToManyAnnot->targetEntity; - $mapping['mappedBy'] = $manyToManyAnnot->mappedBy; - $mapping['inversedBy'] = $manyToManyAnnot->inversedBy; - $mapping['cascade'] = $manyToManyAnnot->cascade; - $mapping['indexBy'] = $manyToManyAnnot->indexBy; - $mapping['orphanRemoval'] = $manyToManyAnnot->orphanRemoval; - $mapping['fetch'] = $this->getFetchMode($className, $manyToManyAnnot->fetch); - - if ($orderByAnnot = $this->_reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\OrderBy')) { - $mapping['orderBy'] = $orderByAnnot->value; - } - - $metadata->mapManyToMany($mapping); - } - } - - // Evaluate @HasLifecycleCallbacks annotation - if (isset($classAnnotations['Doctrine\ORM\Mapping\HasLifecycleCallbacks'])) { - foreach ($class->getMethods() as $method) { - // filter for the declaring class only, callbacks from parents will already be registered. - if ($method->isPublic() && $method->getDeclaringClass()->getName() == $class->name) { - $annotations = $this->_reader->getMethodAnnotations($method); - - if ($annotations) { - foreach ($annotations as $key => $annot) { - if ( ! is_numeric($key)) { - continue; - } - $annotations[get_class($annot)] = $annot; - } - } - - if (isset($annotations['Doctrine\ORM\Mapping\PrePersist'])) { - $metadata->addLifecycleCallback($method->getName(), \Doctrine\ORM\Events::prePersist); - } - - if (isset($annotations['Doctrine\ORM\Mapping\PostPersist'])) { - $metadata->addLifecycleCallback($method->getName(), \Doctrine\ORM\Events::postPersist); - } - - if (isset($annotations['Doctrine\ORM\Mapping\PreUpdate'])) { - $metadata->addLifecycleCallback($method->getName(), \Doctrine\ORM\Events::preUpdate); - } - - if (isset($annotations['Doctrine\ORM\Mapping\PostUpdate'])) { - $metadata->addLifecycleCallback($method->getName(), \Doctrine\ORM\Events::postUpdate); - } - - if (isset($annotations['Doctrine\ORM\Mapping\PreRemove'])) { - $metadata->addLifecycleCallback($method->getName(), \Doctrine\ORM\Events::preRemove); - } - - if (isset($annotations['Doctrine\ORM\Mapping\PostRemove'])) { - $metadata->addLifecycleCallback($method->getName(), \Doctrine\ORM\Events::postRemove); - } - - if (isset($annotations['Doctrine\ORM\Mapping\PostLoad'])) { - $metadata->addLifecycleCallback($method->getName(), \Doctrine\ORM\Events::postLoad); - } - - if (isset($annotations['Doctrine\ORM\Mapping\PreFlush'])) { - $metadata->addLifecycleCallback($method->getName(), \Doctrine\ORM\Events::preFlush); - } - } - } - } - } - - /** - * Whether the class with the specified name is transient. Only non-transient - * classes, that is entities and mapped superclasses, should have their metadata loaded. - * A class is non-transient if it is annotated with either @Entity or - * @MappedSuperclass in the class doc block. - * - * @param string $className - * @return boolean - */ - public function isTransient($className) - { - $classAnnotations = $this->_reader->getClassAnnotations(new \ReflectionClass($className)); - - if ($classAnnotations && is_numeric(key($classAnnotations))) { - foreach ($classAnnotations as $annot) { - if ($annot instanceof \Doctrine\ORM\Mapping\Entity) { - return false; - } - if ($annot instanceof \Doctrine\ORM\Mapping\MappedSuperclass) { - return false; - } - } - - return true; - } - - return ! isset($classAnnotations['Doctrine\ORM\Mapping\Entity']) && - ! isset($classAnnotations['Doctrine\ORM\Mapping\MappedSuperclass']); - } - - /** - * {@inheritDoc} - */ - public function getAllClassNames() - { - if ($this->_classNames !== null) { - return $this->_classNames; - } - - if (!$this->_paths) { - throw MappingException::pathRequired(); - } - - $classes = array(); - $includedFiles = array(); - - foreach ($this->_paths as $path) { - if ( ! is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); - } - - $iterator = new \RegexIterator( - new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS), - \RecursiveIteratorIterator::LEAVES_ONLY - ), - '/^.+' . str_replace('.', '\.', $this->_fileExtension) . '$/i', - \RecursiveRegexIterator::GET_MATCH - ); - - foreach ($iterator as $file) { - $sourceFile = realpath($file[0]); - - require_once $sourceFile; - - $includedFiles[] = $sourceFile; - } - } - - $declared = get_declared_classes(); - - foreach ($declared as $className) { - $rc = new \ReflectionClass($className); - $sourceFile = $rc->getFileName(); - if (in_array($sourceFile, $includedFiles) && ! $this->isTransient($className)) { - $classes[] = $className; - } - } - - $this->_classNames = $classes; - - return $classes; - } - - /** - * Attempts to resolve the fetch mode. - * - * @param string $className The class name - * @param string $fetchMode The fetch mode - * @return integer The fetch mode as defined in ClassMetadata - * @throws MappingException If the fetch mode is not valid - */ - private function getFetchMode($className, $fetchMode) - { - if(!defined('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $fetchMode)) { - throw MappingException::invalidFetchMode($className, $fetchMode); - } - - return constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $fetchMode); - } - /** - * Factory method for the Annotation Driver - * - * @param array|string $paths - * @param AnnotationReader $reader - * @return AnnotationDriver - */ - static public function create($paths = array(), AnnotationReader $reader = null) - { - if ($reader == null) { - $reader = new AnnotationReader(); - $reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\'); - } - return new self($reader, $paths); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php deleted file mode 100644 index bcbdbd5..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php +++ /dev/null @@ -1,417 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping\Driver; - -use Doctrine\Common\Cache\ArrayCache, - Doctrine\Common\Annotations\AnnotationReader, - Doctrine\DBAL\Schema\AbstractSchemaManager, - Doctrine\DBAL\Schema\SchemaException, - Doctrine\ORM\Mapping\ClassMetadataInfo, - Doctrine\ORM\Mapping\MappingException, - Doctrine\Common\Util\Inflector; - -/** - * The DatabaseDriver reverse engineers the mapping metadata from a database. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Benjamin Eberlei - */ -class DatabaseDriver implements Driver -{ - /** - * @var AbstractSchemaManager - */ - private $_sm; - - /** - * @var array - */ - private $tables = null; - - private $classToTableNames = array(); - - /** - * @var array - */ - private $manyToManyTables = array(); - - /** - * @var array - */ - private $classNamesForTables = array(); - - /** - * @var array - */ - private $fieldNamesForColumns = array(); - - /** - * The namespace for the generated entities. - * - * @var string - */ - private $namespace; - - /** - * Initializes a new AnnotationDriver that uses the given AnnotationReader for reading - * docblock annotations. - * - * @param AnnotationReader $reader The AnnotationReader to use. - */ - public function __construct(AbstractSchemaManager $schemaManager) - { - $this->_sm = $schemaManager; - } - - /** - * Set tables manually instead of relying on the reverse engeneering capabilities of SchemaManager. - * - * @param array $entityTables - * @param array $manyToManyTables - * @return void - */ - public function setTables($entityTables, $manyToManyTables) - { - $this->tables = $this->manyToManyTables = $this->classToTableNames = array(); - foreach ($entityTables AS $table) { - $className = $this->getClassNameForTable($table->getName()); - $this->classToTableNames[$className] = $table->getName(); - $this->tables[$table->getName()] = $table; - } - foreach ($manyToManyTables AS $table) { - $this->manyToManyTables[$table->getName()] = $table; - } - } - - private function reverseEngineerMappingFromDatabase() - { - if ($this->tables !== null) { - return; - } - - $tables = array(); - - foreach ($this->_sm->listTableNames() as $tableName) { - $tables[$tableName] = $this->_sm->listTableDetails($tableName); - } - - $this->tables = $this->manyToManyTables = $this->classToTableNames = array(); - foreach ($tables AS $tableName => $table) { - /* @var $table Table */ - if ($this->_sm->getDatabasePlatform()->supportsForeignKeyConstraints()) { - $foreignKeys = $table->getForeignKeys(); - } else { - $foreignKeys = array(); - } - - $allForeignKeyColumns = array(); - foreach ($foreignKeys AS $foreignKey) { - $allForeignKeyColumns = array_merge($allForeignKeyColumns, $foreignKey->getLocalColumns()); - } - - if ( ! $table->hasPrimaryKey()) { - throw new MappingException( - "Table " . $table->getName() . " has no primary key. Doctrine does not ". - "support reverse engineering from tables that don't have a primary key." - ); - } - - $pkColumns = $table->getPrimaryKey()->getColumns(); - sort($pkColumns); - sort($allForeignKeyColumns); - - if ($pkColumns == $allForeignKeyColumns && count($foreignKeys) == 2) { - $this->manyToManyTables[$tableName] = $table; - } else { - // lower-casing is necessary because of Oracle Uppercase Tablenames, - // assumption is lower-case + underscore separated. - $className = $this->getClassNameForTable($tableName); - $this->tables[$tableName] = $table; - $this->classToTableNames[$className] = $tableName; - } - } - } - - /** - * {@inheritdoc} - */ - public function loadMetadataForClass($className, ClassMetadataInfo $metadata) - { - $this->reverseEngineerMappingFromDatabase(); - - if (!isset($this->classToTableNames[$className])) { - throw new \InvalidArgumentException("Unknown class " . $className); - } - - $tableName = $this->classToTableNames[$className]; - - $metadata->name = $className; - $metadata->table['name'] = $tableName; - - $columns = $this->tables[$tableName]->getColumns(); - $indexes = $this->tables[$tableName]->getIndexes(); - try { - $primaryKeyColumns = $this->tables[$tableName]->getPrimaryKey()->getColumns(); - } catch(SchemaException $e) { - $primaryKeyColumns = array(); - } - - if ($this->_sm->getDatabasePlatform()->supportsForeignKeyConstraints()) { - $foreignKeys = $this->tables[$tableName]->getForeignKeys(); - } else { - $foreignKeys = array(); - } - - $allForeignKeyColumns = array(); - foreach ($foreignKeys AS $foreignKey) { - $allForeignKeyColumns = array_merge($allForeignKeyColumns, $foreignKey->getLocalColumns()); - } - - $ids = array(); - $fieldMappings = array(); - foreach ($columns as $column) { - $fieldMapping = array(); - - if (in_array($column->getName(), $allForeignKeyColumns)) { - continue; - } else if ($primaryKeyColumns && in_array($column->getName(), $primaryKeyColumns)) { - $fieldMapping['id'] = true; - } - - $fieldMapping['fieldName'] = $this->getFieldNameForColumn($tableName, $column->getName(), false); - $fieldMapping['columnName'] = $column->getName(); - $fieldMapping['type'] = strtolower((string) $column->getType()); - - if ($column->getType() instanceof \Doctrine\DBAL\Types\StringType) { - $fieldMapping['length'] = $column->getLength(); - $fieldMapping['fixed'] = $column->getFixed(); - } else if ($column->getType() instanceof \Doctrine\DBAL\Types\IntegerType) { - $fieldMapping['unsigned'] = $column->getUnsigned(); - } - $fieldMapping['nullable'] = $column->getNotNull() ? false : true; - - if (isset($fieldMapping['id'])) { - $ids[] = $fieldMapping; - } else { - $fieldMappings[] = $fieldMapping; - } - } - - if ($ids) { - if (count($ids) == 1) { - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); - } - - foreach ($ids as $id) { - $metadata->mapField($id); - } - } - - foreach ($fieldMappings as $fieldMapping) { - $metadata->mapField($fieldMapping); - } - - foreach ($this->manyToManyTables AS $manyTable) { - foreach ($manyTable->getForeignKeys() AS $foreignKey) { - // foreign key maps to the table of the current entity, many to many association probably exists - if (strtolower($tableName) == strtolower($foreignKey->getForeignTableName())) { - $myFk = $foreignKey; - $otherFk = null; - foreach ($manyTable->getForeignKeys() AS $foreignKey) { - if ($foreignKey != $myFk) { - $otherFk = $foreignKey; - break; - } - } - - if (!$otherFk) { - // the definition of this many to many table does not contain - // enough foreign key information to continue reverse engeneering. - continue; - } - - $localColumn = current($myFk->getColumns()); - $associationMapping = array(); - $associationMapping['fieldName'] = $this->getFieldNameForColumn($manyTable->getName(), current($otherFk->getColumns()), true); - $associationMapping['targetEntity'] = $this->getClassNameForTable($otherFk->getForeignTableName()); - if (current($manyTable->getColumns())->getName() == $localColumn) { - $associationMapping['inversedBy'] = $this->getFieldNameForColumn($manyTable->getName(), current($myFk->getColumns()), true); - $associationMapping['joinTable'] = array( - 'name' => strtolower($manyTable->getName()), - 'joinColumns' => array(), - 'inverseJoinColumns' => array(), - ); - - $fkCols = $myFk->getForeignColumns(); - $cols = $myFk->getColumns(); - for ($i = 0; $i < count($cols); $i++) { - $associationMapping['joinTable']['joinColumns'][] = array( - 'name' => $cols[$i], - 'referencedColumnName' => $fkCols[$i], - ); - } - - $fkCols = $otherFk->getForeignColumns(); - $cols = $otherFk->getColumns(); - for ($i = 0; $i < count($cols); $i++) { - $associationMapping['joinTable']['inverseJoinColumns'][] = array( - 'name' => $cols[$i], - 'referencedColumnName' => $fkCols[$i], - ); - } - } else { - $associationMapping['mappedBy'] = $this->getFieldNameForColumn($manyTable->getName(), current($myFk->getColumns()), true); - } - $metadata->mapManyToMany($associationMapping); - break; - } - } - } - - foreach ($foreignKeys as $foreignKey) { - $foreignTable = $foreignKey->getForeignTableName(); - $cols = $foreignKey->getColumns(); - $fkCols = $foreignKey->getForeignColumns(); - - $localColumn = current($cols); - $associationMapping = array(); - $associationMapping['fieldName'] = $this->getFieldNameForColumn($tableName, $localColumn, true); - $associationMapping['targetEntity'] = $this->getClassNameForTable($foreignTable); - - if ($primaryKeyColumns && in_array($localColumn, $primaryKeyColumns)) { - $associationMapping['id'] = true; - } - - for ($i = 0; $i < count($cols); $i++) { - $associationMapping['joinColumns'][] = array( - 'name' => $cols[$i], - 'referencedColumnName' => $fkCols[$i], - ); - } - - //Here we need to check if $cols are the same as $primaryKeyColums - if (!array_diff($cols,$primaryKeyColumns)) { - $metadata->mapOneToOne($associationMapping); - } else { - $metadata->mapManyToOne($associationMapping); - } - } - } - - /** - * {@inheritdoc} - */ - public function isTransient($className) - { - return true; - } - - /** - * Return all the class names supported by this driver. - * - * IMPORTANT: This method must return an array of class not tables names. - * - * @return array - */ - public function getAllClassNames() - { - $this->reverseEngineerMappingFromDatabase(); - - return array_keys($this->classToTableNames); - } - - /** - * Set class name for a table. - * - * @param string $tableName - * @param string $className - * @return void - */ - public function setClassNameForTable($tableName, $className) - { - $this->classNamesForTables[$tableName] = $className; - } - - /** - * Set field name for a column on a specific table. - * - * @param string $tableName - * @param string $columnName - * @param string $fieldName - * @return void - */ - public function setFieldNameForColumn($tableName, $columnName, $fieldName) - { - $this->fieldNamesForColumns[$tableName][$columnName] = $fieldName; - } - - /** - * Return the mapped class name for a table if it exists. Otherwise return "classified" version. - * - * @param string $tableName - * @return string - */ - private function getClassNameForTable($tableName) - { - if (isset($this->classNamesForTables[$tableName])) { - return $this->namespace . $this->classNamesForTables[$tableName]; - } - - return $this->namespace . Inflector::classify(strtolower($tableName)); - } - - /** - * Return the mapped field name for a column, if it exists. Otherwise return camelized version. - * - * @param string $tableName - * @param string $columnName - * @param boolean $fk Whether the column is a foreignkey or not. - * @return string - */ - private function getFieldNameForColumn($tableName, $columnName, $fk = false) - { - if (isset($this->fieldNamesForColumns[$tableName]) && isset($this->fieldNamesForColumns[$tableName][$columnName])) { - return $this->fieldNamesForColumns[$tableName][$columnName]; - } - - $columnName = strtolower($columnName); - - // Replace _id if it is a foreignkey column - if ($fk) { - $columnName = str_replace('_id', '', $columnName); - } - return Inflector::camelize($columnName); - } - - /** - * Set the namespace for the generated entities. - * - * @param string $namespace - * @return void - */ - public function setNamespace($namespace) - { - $this->namespace = $namespace; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php deleted file mode 100644 index 290fc65..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php +++ /dev/null @@ -1,54 +0,0 @@ -. - */ - -require_once __DIR__.'/../Annotation.php'; -require_once __DIR__.'/../Entity.php'; -require_once __DIR__.'/../MappedSuperclass.php'; -require_once __DIR__.'/../InheritanceType.php'; -require_once __DIR__.'/../DiscriminatorColumn.php'; -require_once __DIR__.'/../DiscriminatorMap.php'; -require_once __DIR__.'/../Id.php'; -require_once __DIR__.'/../GeneratedValue.php'; -require_once __DIR__.'/../Version.php'; -require_once __DIR__.'/../JoinColumn.php'; -require_once __DIR__.'/../JoinColumns.php'; -require_once __DIR__.'/../Column.php'; -require_once __DIR__.'/../OneToOne.php'; -require_once __DIR__.'/../OneToMany.php'; -require_once __DIR__.'/../ManyToOne.php'; -require_once __DIR__.'/../ManyToMany.php'; -require_once __DIR__.'/../ElementCollection.php'; -require_once __DIR__.'/../Table.php'; -require_once __DIR__.'/../UniqueConstraint.php'; -require_once __DIR__.'/../Index.php'; -require_once __DIR__.'/../JoinTable.php'; -require_once __DIR__.'/../SequenceGenerator.php'; -require_once __DIR__.'/../ChangeTrackingPolicy.php'; -require_once __DIR__.'/../OrderBy.php'; -require_once __DIR__.'/../NamedQueries.php'; -require_once __DIR__.'/../NamedQuery.php'; -require_once __DIR__.'/../HasLifecycleCallbacks.php'; -require_once __DIR__.'/../PrePersist.php'; -require_once __DIR__.'/../PostPersist.php'; -require_once __DIR__.'/../PreUpdate.php'; -require_once __DIR__.'/../PostUpdate.php'; -require_once __DIR__.'/../PreRemove.php'; -require_once __DIR__.'/../PostRemove.php'; -require_once __DIR__.'/../PostLoad.php'; -require_once __DIR__.'/../PreFlush.php'; diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/Driver.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/Driver.php deleted file mode 100644 index 28654a8..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/Driver.php +++ /dev/null @@ -1,59 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping\Driver; - -use Doctrine\ORM\Mapping\ClassMetadataInfo; - -/** - * Contract for metadata drivers. - * - * @since 2.0 - * @author Jonathan H. Wage - * @todo Rename: MetadataDriver or MappingDriver - */ -interface Driver -{ - /** - * Loads the metadata for the specified class into the provided container. - * - * @param string $className - * @param ClassMetadataInfo $metadata - */ - function loadMetadataForClass($className, ClassMetadataInfo $metadata); - - /** - * Gets the names of all mapped classes known to this driver. - * - * @return array The names of all mapped classes known to this driver. - */ - function getAllClassNames(); - - /** - * Whether the class with the specified name should have its metadata loaded. - * This is only the case if it is either mapped as an Entity or a - * MappedSuperclass. - * - * @param string $className - * @return boolean - */ - function isTransient($className); -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php deleted file mode 100644 index 321962d..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php +++ /dev/null @@ -1,126 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping\Driver; - -use Doctrine\ORM\Mapping\Driver\Driver, - Doctrine\ORM\Mapping\ClassMetadataInfo, - Doctrine\ORM\Mapping\MappingException; - -/** - * The DriverChain allows you to add multiple other mapping drivers for - * certain namespaces - * - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - * @todo Rename: MappingDriverChain or MetadataDriverChain - */ -class DriverChain implements Driver -{ - /** - * @var array - */ - private $_drivers = array(); - - /** - * Add a nested driver. - * - * @param Driver $nestedDriver - * @param string $namespace - */ - public function addDriver(Driver $nestedDriver, $namespace) - { - $this->_drivers[$namespace] = $nestedDriver; - } - - /** - * Get the array of nested drivers. - * - * @return array $drivers - */ - public function getDrivers() - { - return $this->_drivers; - } - - /** - * Loads the metadata for the specified class into the provided container. - * - * @param string $className - * @param ClassMetadataInfo $metadata - */ - public function loadMetadataForClass($className, ClassMetadataInfo $metadata) - { - foreach ($this->_drivers as $namespace => $driver) { - if (strpos($className, $namespace) === 0) { - $driver->loadMetadataForClass($className, $metadata); - return; - } - } - - throw MappingException::classIsNotAValidEntityOrMappedSuperClass($className); - } - - /** - * Gets the names of all mapped classes known to this driver. - * - * @return array The names of all mapped classes known to this driver. - */ - public function getAllClassNames() - { - $classNames = array(); - $driverClasses = array(); - foreach ($this->_drivers AS $namespace => $driver) { - $oid = spl_object_hash($driver); - if (!isset($driverClasses[$oid])) { - $driverClasses[$oid] = $driver->getAllClassNames(); - } - - foreach ($driverClasses[$oid] AS $className) { - if (strpos($className, $namespace) === 0) { - $classNames[$className] = true; - } - } - } - return array_keys($classNames); - } - - /** - * Whether the class with the specified name should have its metadata loaded. - * - * This is only the case for non-transient classes either mapped as an Entity or MappedSuperclass. - * - * @param string $className - * @return boolean - */ - public function isTransient($className) - { - foreach ($this->_drivers AS $namespace => $driver) { - if (strpos($className, $namespace) === 0) { - return $driver->isTransient($className); - } - } - - // class isTransient, i.e. not an entity or mapped superclass - return true; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/PHPDriver.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/PHPDriver.php deleted file mode 100644 index ff86597..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/PHPDriver.php +++ /dev/null @@ -1,69 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping\Driver; - -use Doctrine\Common\Cache\ArrayCache, - Doctrine\Common\Annotations\AnnotationReader, - Doctrine\DBAL\Schema\AbstractSchemaManager, - Doctrine\ORM\Mapping\ClassMetadataInfo, - Doctrine\ORM\Mapping\MappingException, - Doctrine\Common\Util\Inflector, - Doctrine\ORM\Mapping\Driver\AbstractFileDriver; - -/** - * The PHPDriver includes php files which just populate ClassMetadataInfo - * instances with plain php code - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - * @todo Rename: PHPDriver - */ -class PHPDriver extends AbstractFileDriver -{ - /** - * {@inheritdoc} - */ - protected $_fileExtension = '.php'; - protected $_metadata; - - /** - * {@inheritdoc} - */ - public function loadMetadataForClass($className, ClassMetadataInfo $metadata) - { - $this->_metadata = $metadata; - $this->_loadMappingFile($this->_findMappingFile($className)); - } - - /** - * {@inheritdoc} - */ - protected function _loadMappingFile($file) - { - $metadata = $this->_metadata; - include $file; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/SimplifiedXmlDriver.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/SimplifiedXmlDriver.php deleted file mode 100644 index e60eab7..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/SimplifiedXmlDriver.php +++ /dev/null @@ -1,176 +0,0 @@ -. -*/ - -namespace Doctrine\ORM\Mapping\Driver; - -use Doctrine\ORM\Mapping\MappingException; - -/** - * XmlDriver that additionally looks for mapping information in a global file. - * - * @author Fabien Potencier - * @author Benjamin Eberlei - * @license MIT - */ -class SimplifiedXmlDriver extends XmlDriver -{ - protected $_prefixes = array(); - protected $_globalBasename; - protected $_classCache; - protected $_fileExtension = '.orm.xml'; - - public function __construct($prefixes) - { - $this->addNamespacePrefixes($prefixes); - } - - public function setGlobalBasename($file) - { - $this->_globalBasename = $file; - } - - public function getGlobalBasename() - { - return $this->_globalBasename; - } - - public function addNamespacePrefixes($prefixes) - { - $this->_prefixes = array_merge($this->_prefixes, $prefixes); - $this->addPaths(array_flip($prefixes)); - } - - public function getNamespacePrefixes() - { - return $this->_prefixes; - } - - public function isTransient($className) - { - if (null === $this->_classCache) { - $this->initialize(); - } - - // The mapping is defined in the global mapping file - if (isset($this->_classCache[$className])) { - return false; - } - - try { - $this->_findMappingFile($className); - - return false; - } catch (MappingException $e) { - return true; - } - } - - public function getAllClassNames() - { - if (null === $this->_classCache) { - $this->initialize(); - } - - $classes = array(); - - if ($this->_paths) { - foreach ((array) $this->_paths as $path) { - if (!is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); - } - - $iterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - - foreach ($iterator as $file) { - $fileName = $file->getBasename($this->_fileExtension); - - if ($fileName == $file->getBasename() || $fileName == $this->_globalBasename) { - continue; - } - - // NOTE: All files found here means classes are not transient! - if (isset($this->_prefixes[$path])) { - $classes[] = $this->_prefixes[$path].'\\'.str_replace('.', '\\', $fileName); - } else { - $classes[] = str_replace('.', '\\', $fileName); - } - } - } - } - - return array_merge($classes, array_keys($this->_classCache)); - } - - public function getElement($className) - { - if (null === $this->_classCache) { - $this->initialize(); - } - - if (!isset($this->_classCache[$className])) { - $this->_classCache[$className] = parent::getElement($className); - } - - return $this->_classCache[$className]; - } - - protected function initialize() - { - $this->_classCache = array(); - if (null !== $this->_globalBasename) { - foreach ($this->_paths as $path) { - if (is_file($file = $path.'/'.$this->_globalBasename.$this->_fileExtension)) { - $this->_classCache = array_merge($this->_classCache, $this->_loadMappingFile($file)); - } - } - } - } - - protected function _findMappingFile($className) - { - $defaultFileName = str_replace('\\', '.', $className).$this->_fileExtension; - foreach ($this->_paths as $path) { - if (!isset($this->_prefixes[$path])) { - if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) { - return $path.DIRECTORY_SEPARATOR.$defaultFileName; - } - - continue; - } - - $prefix = $this->_prefixes[$path]; - - if (0 !== strpos($className, $prefix.'\\')) { - continue; - } - - $filename = $path.'/'.strtr(substr($className, strlen($prefix)+1), '\\', '.').$this->_fileExtension; - if (is_file($filename)) { - return $filename; - } - - throw MappingException::mappingFileNotFound($className, $filename); - } - - throw MappingException::mappingFileNotFound($className, substr($className, strrpos($className, '\\') + 1).$this->_fileExtension); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/SimplifiedYamlDriver.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/SimplifiedYamlDriver.php deleted file mode 100644 index b88a769..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/SimplifiedYamlDriver.php +++ /dev/null @@ -1,181 +0,0 @@ -. -*/ - -namespace Doctrine\ORM\Mapping\Driver; - -use Doctrine\ORM\Mapping\MappingException; - -/** - * YamlDriver that additionally looks for mapping information in a global file. - * - * @author Fabien Potencier - * @author Benjamin Eberlei - * @license MIT - */ -class SimplifiedYamlDriver extends YamlDriver -{ - protected $_prefixes = array(); - protected $_globalBasename; - protected $_classCache; - protected $_fileExtension = '.orm.yml'; - - public function __construct($prefixes) - { - $this->addNamespacePrefixes($prefixes); - } - - public function setGlobalBasename($file) - { - $this->_globalBasename = $file; - } - - public function getGlobalBasename() - { - return $this->_globalBasename; - } - - public function addNamespacePrefixes($prefixes) - { - $this->_prefixes = array_merge($this->_prefixes, $prefixes); - $this->addPaths(array_flip($prefixes)); - } - - public function addNamespacePrefix($prefix, $path) - { - $this->_prefixes[$path] = $prefix; - } - - public function getNamespacePrefixes() - { - return $this->_prefixes; - } - - public function isTransient($className) - { - if (null === $this->_classCache) { - $this->initialize(); - } - - // The mapping is defined in the global mapping file - if (isset($this->_classCache[$className])) { - return false; - } - - try { - $this->_findMappingFile($className); - - return false; - } catch (MappingException $e) { - return true; - } - } - - public function getAllClassNames() - { - if (null === $this->_classCache) { - $this->initialize(); - } - - $classes = array(); - - if ($this->_paths) { - foreach ((array) $this->_paths as $path) { - if (!is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); - } - - $iterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - - foreach ($iterator as $file) { - $fileName = $file->getBasename($this->_fileExtension); - - if ($fileName == $file->getBasename() || $fileName == $this->_globalBasename) { - continue; - } - - // NOTE: All files found here means classes are not transient! - if (isset($this->_prefixes[$path])) { - $classes[] = $this->_prefixes[$path].'\\'.str_replace('.', '\\', $fileName); - } else { - $classes[] = str_replace('.', '\\', $fileName); - } - } - } - } - - return array_merge($classes, array_keys($this->_classCache)); - } - - public function getElement($className) - { - if (null === $this->_classCache) { - $this->initialize(); - } - - if (!isset($this->_classCache[$className])) { - $this->_classCache[$className] = parent::getElement($className); - } - - return $this->_classCache[$className]; - } - - protected function initialize() - { - $this->_classCache = array(); - if (null !== $this->_globalBasename) { - foreach ($this->_paths as $path) { - if (is_file($file = $path.'/'.$this->_globalBasename.$this->_fileExtension)) { - $this->_classCache = array_merge($this->_classCache, $this->_loadMappingFile($file)); - } - } - } - } - - protected function _findMappingFile($className) - { - $defaultFileName = str_replace('\\', '.', $className).$this->_fileExtension; - foreach ($this->_paths as $path) { - if (!isset($this->_prefixes[$path])) { - if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) { - return $path.DIRECTORY_SEPARATOR.$defaultFileName; - } - - continue; - } - - $prefix = $this->_prefixes[$path]; - - if (0 !== strpos($className, $prefix.'\\')) { - continue; - } - - $filename = $path.'/'.strtr(substr($className, strlen($prefix)+1), '\\', '.').$this->_fileExtension; - if (is_file($filename)) { - return $filename; - } - - throw MappingException::mappingFileNotFound($className, $filename); - } - - throw MappingException::mappingFileNotFound($className, substr($className, strrpos($className, '\\') + 1).$this->_fileExtension); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php deleted file mode 100644 index 4e593ea..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php +++ /dev/null @@ -1,138 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping\Driver; - -use Doctrine\ORM\Mapping\ClassMetadataInfo, - Doctrine\ORM\Mapping\MappingException; - -/** - * The StaticPHPDriver calls a static loadMetadata() method on your entity - * classes where you can manually populate the ClassMetadata instance. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -class StaticPHPDriver implements Driver -{ - /** - * Paths of entity directories. - * - * @var array - */ - private $_paths = array(); - - /** - * Map of all class names. - * - * @var array - */ - private $_classNames; - - /** - * The file extension of mapping documents. - * - * @var string - */ - private $_fileExtension = '.php'; - - public function __construct($paths) - { - $this->addPaths((array) $paths); - } - - public function addPaths(array $paths) - { - $this->_paths = array_unique(array_merge($this->_paths, $paths)); - } - - /** - * {@inheritdoc} - */ - public function loadMetadataForClass($className, ClassMetadataInfo $metadata) - { - call_user_func_array(array($className, 'loadMetadata'), array($metadata)); - } - - /** - * {@inheritDoc} - * @todo Same code exists in AnnotationDriver, should we re-use it somehow or not worry about it? - */ - public function getAllClassNames() - { - if ($this->_classNames !== null) { - return $this->_classNames; - } - - if (!$this->_paths) { - throw MappingException::pathRequired(); - } - - $classes = array(); - $includedFiles = array(); - - foreach ($this->_paths as $path) { - if (!is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); - } - - $iterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - - foreach ($iterator as $file) { - if (($fileName = $file->getBasename($this->_fileExtension)) == $file->getBasename()) { - continue; - } - - $sourceFile = realpath($file->getPathName()); - require_once $sourceFile; - $includedFiles[] = $sourceFile; - } - } - - $declared = get_declared_classes(); - - foreach ($declared as $className) { - $rc = new \ReflectionClass($className); - $sourceFile = $rc->getFileName(); - if (in_array($sourceFile, $includedFiles) && !$this->isTransient($className)) { - $classes[] = $className; - } - } - - $this->_classNames = $classes; - - return $classes; - } - - /** - * {@inheritdoc} - */ - public function isTransient($className) - { - return method_exists($className, 'loadMetadata') ? false : true; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php deleted file mode 100644 index 31f3191..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php +++ /dev/null @@ -1,536 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping\Driver; - -use SimpleXMLElement, - Doctrine\ORM\Mapping\ClassMetadataInfo, - Doctrine\ORM\Mapping\MappingException; - -/** - * XmlDriver is a metadata driver that enables mapping through XML files. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -class XmlDriver extends AbstractFileDriver -{ - /** - * {@inheritdoc} - */ - protected $_fileExtension = '.dcm.xml'; - - /** - * {@inheritdoc} - */ - public function loadMetadataForClass($className, ClassMetadataInfo $metadata) - { - $xmlRoot = $this->getElement($className); - - if ($xmlRoot->getName() == 'entity') { - if (isset($xmlRoot['repository-class'])) { - $metadata->setCustomRepositoryClass((string)$xmlRoot['repository-class']); - } - if (isset($xmlRoot['read-only']) && $xmlRoot['read-only'] == "true") { - $metadata->markReadOnly(); - } - } else if ($xmlRoot->getName() == 'mapped-superclass') { - $metadata->setCustomRepositoryClass( - isset($xmlRoot['repository-class']) ? (string)$xmlRoot['repository-class'] : null - ); - $metadata->isMappedSuperclass = true; - } else { - throw MappingException::classIsNotAValidEntityOrMappedSuperClass($className); - } - - // Evaluate attributes - $table = array(); - if (isset($xmlRoot['table'])) { - $table['name'] = (string)$xmlRoot['table']; - } - - $metadata->setPrimaryTable($table); - - // Evaluate named queries - if (isset($xmlRoot['named-queries'])) { - foreach ($xmlRoot->{'named-queries'}->{'named-query'} as $namedQueryElement) { - $metadata->addNamedQuery(array( - 'name' => (string)$namedQueryElement['name'], - 'query' => (string)$namedQueryElement['query'] - )); - } - } - - /* not implemented specially anyway. use table = schema.table - if (isset($xmlRoot['schema'])) { - $metadata->table['schema'] = (string)$xmlRoot['schema']; - }*/ - - if (isset($xmlRoot['inheritance-type'])) { - $inheritanceType = (string)$xmlRoot['inheritance-type']; - $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . $inheritanceType)); - - if ($metadata->inheritanceType != \Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_NONE) { - // Evaluate - if (isset($xmlRoot->{'discriminator-column'})) { - $discrColumn = $xmlRoot->{'discriminator-column'}; - $metadata->setDiscriminatorColumn(array( - 'name' => (string)$discrColumn['name'], - 'type' => (string)$discrColumn['type'], - 'length' => (string)$discrColumn['length'] - )); - } else { - $metadata->setDiscriminatorColumn(array('name' => 'dtype', 'type' => 'string', 'length' => 255)); - } - - // Evaluate - if (isset($xmlRoot->{'discriminator-map'})) { - $map = array(); - foreach ($xmlRoot->{'discriminator-map'}->{'discriminator-mapping'} AS $discrMapElement) { - $map[(string)$discrMapElement['value']] = (string)$discrMapElement['class']; - } - $metadata->setDiscriminatorMap($map); - } - } - } - - - // Evaluate - if (isset($xmlRoot['change-tracking-policy'])) { - $metadata->setChangeTrackingPolicy(constant('Doctrine\ORM\Mapping\ClassMetadata::CHANGETRACKING_' - . strtoupper((string)$xmlRoot['change-tracking-policy']))); - } - - // Evaluate - if (isset($xmlRoot->indexes)) { - $metadata->table['indexes'] = array(); - foreach ($xmlRoot->indexes->index as $index) { - $columns = explode(',', (string)$index['columns']); - - if (isset($index['name'])) { - $metadata->table['indexes'][(string)$index['name']] = array( - 'columns' => $columns - ); - } else { - $metadata->table['indexes'][] = array( - 'columns' => $columns - ); - } - } - } - - // Evaluate - if (isset($xmlRoot->{'unique-constraints'})) { - $metadata->table['uniqueConstraints'] = array(); - foreach ($xmlRoot->{'unique-constraints'}->{'unique-constraint'} as $unique) { - $columns = explode(',', (string)$unique['columns']); - - if (isset($unique['name'])) { - $metadata->table['uniqueConstraints'][(string)$unique['name']] = array( - 'columns' => $columns - ); - } else { - $metadata->table['uniqueConstraints'][] = array( - 'columns' => $columns - ); - } - } - } - - // Evaluate mappings - if (isset($xmlRoot->field)) { - foreach ($xmlRoot->field as $fieldMapping) { - $mapping = array( - 'fieldName' => (string)$fieldMapping['name'], - ); - - if (isset($fieldMapping['type'])) { - $mapping['type'] = (string)$fieldMapping['type']; - } - - if (isset($fieldMapping['column'])) { - $mapping['columnName'] = (string)$fieldMapping['column']; - } - - if (isset($fieldMapping['length'])) { - $mapping['length'] = (int)$fieldMapping['length']; - } - - if (isset($fieldMapping['precision'])) { - $mapping['precision'] = (int)$fieldMapping['precision']; - } - - if (isset($fieldMapping['scale'])) { - $mapping['scale'] = (int)$fieldMapping['scale']; - } - - if (isset($fieldMapping['unique'])) { - $mapping['unique'] = ((string)$fieldMapping['unique'] == "false") ? false : true; - } - - if (isset($fieldMapping['options'])) { - $mapping['options'] = (array)$fieldMapping['options']; - } - - if (isset($fieldMapping['nullable'])) { - $mapping['nullable'] = ((string)$fieldMapping['nullable'] == "false") ? false : true; - } - - if (isset($fieldMapping['version']) && $fieldMapping['version']) { - $metadata->setVersionMapping($mapping); - } - - if (isset($fieldMapping['column-definition'])) { - $mapping['columnDefinition'] = (string)$fieldMapping['column-definition']; - } - - $metadata->mapField($mapping); - } - } - - // Evaluate mappings - $associationIds = array(); - foreach ($xmlRoot->id as $idElement) { - if ((bool)$idElement['association-key'] == true) { - $associationIds[(string)$idElement['name']] = true; - continue; - } - - $mapping = array( - 'id' => true, - 'fieldName' => (string)$idElement['name'] - ); - - if (isset($idElement['type'])) { - $mapping['type'] = (string)$idElement['type']; - } - - if (isset($idElement['column'])) { - $mapping['columnName'] = (string)$idElement['column']; - } - - if (isset($idElement['column-definition'])) { - $mapping['columnDefinition'] = (string)$idElement['column-definition']; - } - - $metadata->mapField($mapping); - - if (isset($idElement->generator)) { - $strategy = isset($idElement->generator['strategy']) ? - (string)$idElement->generator['strategy'] : 'AUTO'; - $metadata->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_' - . $strategy)); - } - - // Check for SequenceGenerator/TableGenerator definition - if (isset($idElement->{'sequence-generator'})) { - $seqGenerator = $idElement->{'sequence-generator'}; - $metadata->setSequenceGeneratorDefinition(array( - 'sequenceName' => (string)$seqGenerator['sequence-name'], - 'allocationSize' => (string)$seqGenerator['allocation-size'], - 'initialValue' => (string)$seqGenerator['initial-value'] - )); - } else if (isset($idElement->{'table-generator'})) { - throw MappingException::tableIdGeneratorNotImplemented($className); - } - } - - // Evaluate mappings - if (isset($xmlRoot->{'one-to-one'})) { - foreach ($xmlRoot->{'one-to-one'} as $oneToOneElement) { - $mapping = array( - 'fieldName' => (string)$oneToOneElement['field'], - 'targetEntity' => (string)$oneToOneElement['target-entity'] - ); - - if (isset($associationIds[$mapping['fieldName']])) { - $mapping['id'] = true; - } - - if (isset($oneToOneElement['fetch'])) { - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string)$oneToOneElement['fetch']); - } - - if (isset($oneToOneElement['mapped-by'])) { - $mapping['mappedBy'] = (string)$oneToOneElement['mapped-by']; - } else { - if (isset($oneToOneElement['inversed-by'])) { - $mapping['inversedBy'] = (string)$oneToOneElement['inversed-by']; - } - $joinColumns = array(); - - if (isset($oneToOneElement->{'join-column'})) { - $joinColumns[] = $this->_getJoinColumnMapping($oneToOneElement->{'join-column'}); - } else if (isset($oneToOneElement->{'join-columns'})) { - foreach ($oneToOneElement->{'join-columns'}->{'join-column'} as $joinColumnElement) { - $joinColumns[] = $this->_getJoinColumnMapping($joinColumnElement); - } - } - - $mapping['joinColumns'] = $joinColumns; - } - - if (isset($oneToOneElement->cascade)) { - $mapping['cascade'] = $this->_getCascadeMappings($oneToOneElement->cascade); - } - - if (isset($oneToOneElement['orphan-removal'])) { - $mapping['orphanRemoval'] = (bool)$oneToOneElement['orphan-removal']; - } - - $metadata->mapOneToOne($mapping); - } - } - - // Evaluate mappings - if (isset($xmlRoot->{'one-to-many'})) { - foreach ($xmlRoot->{'one-to-many'} as $oneToManyElement) { - $mapping = array( - 'fieldName' => (string)$oneToManyElement['field'], - 'targetEntity' => (string)$oneToManyElement['target-entity'], - 'mappedBy' => (string)$oneToManyElement['mapped-by'] - ); - - if (isset($oneToManyElement['fetch'])) { - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string)$oneToManyElement['fetch']); - } - - if (isset($oneToManyElement->cascade)) { - $mapping['cascade'] = $this->_getCascadeMappings($oneToManyElement->cascade); - } - - if (isset($oneToManyElement['orphan-removal'])) { - $mapping['orphanRemoval'] = (bool)$oneToManyElement['orphan-removal']; - } - - if (isset($oneToManyElement->{'order-by'})) { - $orderBy = array(); - foreach ($oneToManyElement->{'order-by'}->{'order-by-field'} AS $orderByField) { - $orderBy[(string)$orderByField['name']] = (string)$orderByField['direction']; - } - $mapping['orderBy'] = $orderBy; - } - - if (isset($oneToManyElement['index-by'])) { - $mapping['indexBy'] = (string)$oneToManyElement['index-by']; - } else if (isset($oneToManyElement->{'index-by'})) { - throw new \InvalidArgumentException(" is not a valid tag"); - } - - $metadata->mapOneToMany($mapping); - } - } - - // Evaluate mappings - if (isset($xmlRoot->{'many-to-one'})) { - foreach ($xmlRoot->{'many-to-one'} as $manyToOneElement) { - $mapping = array( - 'fieldName' => (string)$manyToOneElement['field'], - 'targetEntity' => (string)$manyToOneElement['target-entity'] - ); - - if (isset($associationIds[$mapping['fieldName']])) { - $mapping['id'] = true; - } - - if (isset($manyToOneElement['fetch'])) { - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string)$manyToOneElement['fetch']); - } - - if (isset($manyToOneElement['inversed-by'])) { - $mapping['inversedBy'] = (string)$manyToOneElement['inversed-by']; - } - - $joinColumns = array(); - - if (isset($manyToOneElement->{'join-column'})) { - $joinColumns[] = $this->_getJoinColumnMapping($manyToOneElement->{'join-column'}); - } else if (isset($manyToOneElement->{'join-columns'})) { - foreach ($manyToOneElement->{'join-columns'}->{'join-column'} as $joinColumnElement) { - $joinColumns[] = $this->_getJoinColumnMapping($joinColumnElement); - } - } - - $mapping['joinColumns'] = $joinColumns; - - if (isset($manyToOneElement->cascade)) { - $mapping['cascade'] = $this->_getCascadeMappings($manyToOneElement->cascade); - } - - $metadata->mapManyToOne($mapping); - } - } - - // Evaluate mappings - if (isset($xmlRoot->{'many-to-many'})) { - foreach ($xmlRoot->{'many-to-many'} as $manyToManyElement) { - $mapping = array( - 'fieldName' => (string)$manyToManyElement['field'], - 'targetEntity' => (string)$manyToManyElement['target-entity'] - ); - - if (isset($manyToManyElement['fetch'])) { - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string)$manyToManyElement['fetch']); - } - - if (isset($manyToManyElement['orphan-removal'])) { - $mapping['orphanRemoval'] = (bool)$manyToManyElement['orphan-removal']; - } - - if (isset($manyToManyElement['mapped-by'])) { - $mapping['mappedBy'] = (string)$manyToManyElement['mapped-by']; - } else if (isset($manyToManyElement->{'join-table'})) { - if (isset($manyToManyElement['inversed-by'])) { - $mapping['inversedBy'] = (string)$manyToManyElement['inversed-by']; - } - - $joinTableElement = $manyToManyElement->{'join-table'}; - $joinTable = array( - 'name' => (string)$joinTableElement['name'] - ); - - if (isset($joinTableElement['schema'])) { - $joinTable['schema'] = (string)$joinTableElement['schema']; - } - - foreach ($joinTableElement->{'join-columns'}->{'join-column'} as $joinColumnElement) { - $joinTable['joinColumns'][] = $this->_getJoinColumnMapping($joinColumnElement); - } - - foreach ($joinTableElement->{'inverse-join-columns'}->{'join-column'} as $joinColumnElement) { - $joinTable['inverseJoinColumns'][] = $this->_getJoinColumnMapping($joinColumnElement); - } - - $mapping['joinTable'] = $joinTable; - } - - if (isset($manyToManyElement->cascade)) { - $mapping['cascade'] = $this->_getCascadeMappings($manyToManyElement->cascade); - } - - if (isset($manyToManyElement->{'order-by'})) { - $orderBy = array(); - foreach ($manyToManyElement->{'order-by'}->{'order-by-field'} AS $orderByField) { - $orderBy[(string)$orderByField['name']] = (string)$orderByField['direction']; - } - $mapping['orderBy'] = $orderBy; - } - - if (isset($manyToManyElement['index-by'])) { - $mapping['indexBy'] = (string)$manyToManyElement['index-by']; - } else if (isset($manyToManyElement->{'index-by'})) { - throw new \InvalidArgumentException(" is not a valid tag"); - } - - $metadata->mapManyToMany($mapping); - } - } - - // Evaluate - if (isset($xmlRoot->{'lifecycle-callbacks'})) { - foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) { - $metadata->addLifecycleCallback((string)$lifecycleCallback['method'], constant('Doctrine\ORM\Events::' . (string)$lifecycleCallback['type'])); - } - } - } - - /** - * Constructs a joinColumn mapping array based on the information - * found in the given SimpleXMLElement. - * - * @param $joinColumnElement The XML element. - * @return array The mapping array. - */ - private function _getJoinColumnMapping(SimpleXMLElement $joinColumnElement) - { - $joinColumn = array( - 'name' => (string)$joinColumnElement['name'], - 'referencedColumnName' => (string)$joinColumnElement['referenced-column-name'] - ); - - if (isset($joinColumnElement['unique'])) { - $joinColumn['unique'] = ((string)$joinColumnElement['unique'] == "false") ? false : true; - } - - if (isset($joinColumnElement['nullable'])) { - $joinColumn['nullable'] = ((string)$joinColumnElement['nullable'] == "false") ? false : true; - } - - if (isset($joinColumnElement['on-delete'])) { - $joinColumn['onDelete'] = (string)$joinColumnElement['on-delete']; - } - - if (isset($joinColumnElement['column-definition'])) { - $joinColumn['columnDefinition'] = (string)$joinColumnElement['column-definition']; - } - - return $joinColumn; - } - - /** - * Gathers a list of cascade options found in the given cascade element. - * - * @param $cascadeElement The cascade element. - * @return array The list of cascade options. - */ - private function _getCascadeMappings($cascadeElement) - { - $cascades = array(); - foreach ($cascadeElement->children() as $action) { - // According to the JPA specifications, XML uses "cascade-persist" - // instead of "persist". Here, both variations - // are supported because both YAML and Annotation use "persist" - // and we want to make sure that this driver doesn't need to know - // anything about the supported cascading actions - $cascades[] = str_replace('cascade-', '', $action->getName()); - } - return $cascades; - } - - /** - * {@inheritdoc} - */ - protected function _loadMappingFile($file) - { - $result = array(); - $xmlElement = simplexml_load_file($file); - - if (isset($xmlElement->entity)) { - foreach ($xmlElement->entity as $entityElement) { - $entityName = (string)$entityElement['name']; - $result[$entityName] = $entityElement; - } - } else if (isset($xmlElement->{'mapped-superclass'})) { - foreach ($xmlElement->{'mapped-superclass'} as $mappedSuperClass) { - $className = (string)$mappedSuperClass['name']; - $result[$className] = $mappedSuperClass; - } - } - - return $result; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php deleted file mode 100644 index c8baa2f..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php +++ /dev/null @@ -1,512 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping\Driver; - -use Doctrine\ORM\Mapping\ClassMetadataInfo, - Doctrine\ORM\Mapping\MappingException; - -/** - * The YamlDriver reads the mapping metadata from yaml schema files. - * - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -class YamlDriver extends AbstractFileDriver -{ - /** - * {@inheritdoc} - */ - protected $_fileExtension = '.dcm.yml'; - - /** - * {@inheritdoc} - */ - public function loadMetadataForClass($className, ClassMetadataInfo $metadata) - { - $element = $this->getElement($className); - - if ($element['type'] == 'entity') { - if (isset($element['repositoryClass'])) { - $metadata->setCustomRepositoryClass($element['repositoryClass']); - } - if (isset($element['readOnly']) && $element['readOnly'] == true) { - $metadata->markReadOnly(); - } - } else if ($element['type'] == 'mappedSuperclass') { - $metadata->setCustomRepositoryClass( - isset($element['repositoryClass']) ? $element['repositoryClass'] : null - ); - $metadata->isMappedSuperclass = true; - } else { - throw MappingException::classIsNotAValidEntityOrMappedSuperClass($className); - } - - // Evaluate root level properties - $table = array(); - if (isset($element['table'])) { - $table['name'] = $element['table']; - } - $metadata->setPrimaryTable($table); - - // Evaluate named queries - if (isset($element['namedQueries'])) { - foreach ($element['namedQueries'] as $name => $queryMapping) { - if (is_string($queryMapping)) { - $queryMapping = array('query' => $queryMapping); - } - - if ( ! isset($queryMapping['name'])) { - $queryMapping['name'] = $name; - } - - $metadata->addNamedQuery($queryMapping); - } - } - - /* not implemented specially anyway. use table = schema.table - if (isset($element['schema'])) { - $metadata->table['schema'] = $element['schema']; - }*/ - - if (isset($element['inheritanceType'])) { - $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . strtoupper($element['inheritanceType']))); - - if ($metadata->inheritanceType != \Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_NONE) { - // Evaluate discriminatorColumn - if (isset($element['discriminatorColumn'])) { - $discrColumn = $element['discriminatorColumn']; - $metadata->setDiscriminatorColumn(array( - 'name' => $discrColumn['name'], - 'type' => $discrColumn['type'], - 'length' => $discrColumn['length'] - )); - } else { - $metadata->setDiscriminatorColumn(array('name' => 'dtype', 'type' => 'string', 'length' => 255)); - } - - // Evaluate discriminatorMap - if (isset($element['discriminatorMap'])) { - $metadata->setDiscriminatorMap($element['discriminatorMap']); - } - } - } - - - // Evaluate changeTrackingPolicy - if (isset($element['changeTrackingPolicy'])) { - $metadata->setChangeTrackingPolicy(constant('Doctrine\ORM\Mapping\ClassMetadata::CHANGETRACKING_' - . strtoupper($element['changeTrackingPolicy']))); - } - - // Evaluate indexes - if (isset($element['indexes'])) { - foreach ($element['indexes'] as $name => $index) { - if ( ! isset($index['name'])) { - $index['name'] = $name; - } - - if (is_string($index['columns'])) { - $columns = explode(',', $index['columns']); - } else { - $columns = $index['columns']; - } - - $metadata->table['indexes'][$index['name']] = array( - 'columns' => $columns - ); - } - } - - // Evaluate uniqueConstraints - if (isset($element['uniqueConstraints'])) { - foreach ($element['uniqueConstraints'] as $name => $unique) { - if ( ! isset($unique['name'])) { - $unique['name'] = $name; - } - - if (is_string($unique['columns'])) { - $columns = explode(',', $unique['columns']); - } else { - $columns = $unique['columns']; - } - - $metadata->table['uniqueConstraints'][$unique['name']] = array( - 'columns' => $columns - ); - } - } - - $associationIds = array(); - if (isset($element['id'])) { - // Evaluate identifier settings - foreach ($element['id'] as $name => $idElement) { - if (isset($idElement['associationKey']) && $idElement['associationKey'] == true) { - $associationIds[$name] = true; - continue; - } - - $mapping = array( - 'id' => true, - 'fieldName' => $name - ); - - if (isset($idElement['type'])) { - $mapping['type'] = $idElement['type']; - } - - if (isset($idElement['column'])) { - $mapping['columnName'] = $idElement['column']; - } - - if (isset($idElement['length'])) { - $mapping['length'] = $idElement['length']; - } - - if (isset($idElement['columnDefinition'])) { - $mapping['columnDefinition'] = $idElement['columnDefinition']; - } - - $metadata->mapField($mapping); - - if (isset($idElement['generator'])) { - $metadata->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_' - . strtoupper($idElement['generator']['strategy']))); - } - // Check for SequenceGenerator/TableGenerator definition - if (isset($idElement['sequenceGenerator'])) { - $metadata->setSequenceGeneratorDefinition($idElement['sequenceGenerator']); - } else if (isset($idElement['tableGenerator'])) { - throw MappingException::tableIdGeneratorNotImplemented($className); - } - } - } - - // Evaluate fields - if (isset($element['fields'])) { - foreach ($element['fields'] as $name => $fieldMapping) { - - $mapping = array( - 'fieldName' => $name - ); - - if (isset($fieldMapping['type'])) { - $e = explode('(', $fieldMapping['type']); - $fieldMapping['type'] = $e[0]; - $mapping['type'] = $fieldMapping['type']; - - if (isset($e[1])) { - $fieldMapping['length'] = substr($e[1], 0, strlen($e[1]) - 1); - } - } - - if (isset($fieldMapping['id'])) { - $mapping['id'] = true; - if (isset($fieldMapping['generator']['strategy'])) { - $metadata->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_' - . strtoupper($fieldMapping['generator']['strategy']))); - } - } - if (isset($fieldMapping['column'])) { - $mapping['columnName'] = $fieldMapping['column']; - } - if (isset($fieldMapping['length'])) { - $mapping['length'] = $fieldMapping['length']; - } - if (isset($fieldMapping['precision'])) { - $mapping['precision'] = $fieldMapping['precision']; - } - if (isset($fieldMapping['scale'])) { - $mapping['scale'] = $fieldMapping['scale']; - } - if (isset($fieldMapping['unique'])) { - $mapping['unique'] = (bool)$fieldMapping['unique']; - } - if (isset($fieldMapping['options'])) { - $mapping['options'] = $fieldMapping['options']; - } - if (isset($fieldMapping['nullable'])) { - $mapping['nullable'] = $fieldMapping['nullable']; - } - if (isset($fieldMapping['version']) && $fieldMapping['version']) { - $metadata->setVersionMapping($mapping); - } - if (isset($fieldMapping['columnDefinition'])) { - $mapping['columnDefinition'] = $fieldMapping['columnDefinition']; - } - - $metadata->mapField($mapping); - } - } - - // Evaluate oneToOne relationships - if (isset($element['oneToOne'])) { - foreach ($element['oneToOne'] as $name => $oneToOneElement) { - $mapping = array( - 'fieldName' => $name, - 'targetEntity' => $oneToOneElement['targetEntity'] - ); - - if (isset($associationIds[$mapping['fieldName']])) { - $mapping['id'] = true; - } - - if (isset($oneToOneElement['fetch'])) { - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $oneToOneElement['fetch']); - } - - if (isset($oneToOneElement['mappedBy'])) { - $mapping['mappedBy'] = $oneToOneElement['mappedBy']; - } else { - if (isset($oneToOneElement['inversedBy'])) { - $mapping['inversedBy'] = $oneToOneElement['inversedBy']; - } - - $joinColumns = array(); - - if (isset($oneToOneElement['joinColumn'])) { - $joinColumns[] = $this->_getJoinColumnMapping($oneToOneElement['joinColumn']); - } else if (isset($oneToOneElement['joinColumns'])) { - foreach ($oneToOneElement['joinColumns'] as $name => $joinColumnElement) { - if (!isset($joinColumnElement['name'])) { - $joinColumnElement['name'] = $name; - } - - $joinColumns[] = $this->_getJoinColumnMapping($joinColumnElement); - } - } - - $mapping['joinColumns'] = $joinColumns; - } - - if (isset($oneToOneElement['cascade'])) { - $mapping['cascade'] = $oneToOneElement['cascade']; - } - - if (isset($oneToOneElement['orphanRemoval'])) { - $mapping['orphanRemoval'] = (bool)$oneToOneElement['orphanRemoval']; - } - - $metadata->mapOneToOne($mapping); - } - } - - // Evaluate oneToMany relationships - if (isset($element['oneToMany'])) { - foreach ($element['oneToMany'] as $name => $oneToManyElement) { - $mapping = array( - 'fieldName' => $name, - 'targetEntity' => $oneToManyElement['targetEntity'], - 'mappedBy' => $oneToManyElement['mappedBy'] - ); - - if (isset($oneToManyElement['fetch'])) { - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $oneToManyElement['fetch']); - } - - if (isset($oneToManyElement['cascade'])) { - $mapping['cascade'] = $oneToManyElement['cascade']; - } - - if (isset($oneToManyElement['orphanRemoval'])) { - $mapping['orphanRemoval'] = (bool)$oneToManyElement['orphanRemoval']; - } - - if (isset($oneToManyElement['orderBy'])) { - $mapping['orderBy'] = $oneToManyElement['orderBy']; - } - - if (isset($oneToManyElement['indexBy'])) { - $mapping['indexBy'] = $oneToManyElement['indexBy']; - } - - $metadata->mapOneToMany($mapping); - } - } - - // Evaluate manyToOne relationships - if (isset($element['manyToOne'])) { - foreach ($element['manyToOne'] as $name => $manyToOneElement) { - $mapping = array( - 'fieldName' => $name, - 'targetEntity' => $manyToOneElement['targetEntity'] - ); - - if (isset($associationIds[$mapping['fieldName']])) { - $mapping['id'] = true; - } - - if (isset($manyToOneElement['fetch'])) { - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $manyToOneElement['fetch']); - } - - if (isset($manyToOneElement['inversedBy'])) { - $mapping['inversedBy'] = $manyToOneElement['inversedBy']; - } - - $joinColumns = array(); - - if (isset($manyToOneElement['joinColumn'])) { - $joinColumns[] = $this->_getJoinColumnMapping($manyToOneElement['joinColumn']); - } else if (isset($manyToOneElement['joinColumns'])) { - foreach ($manyToOneElement['joinColumns'] as $name => $joinColumnElement) { - if (!isset($joinColumnElement['name'])) { - $joinColumnElement['name'] = $name; - } - - $joinColumns[] = $this->_getJoinColumnMapping($joinColumnElement); - } - } - - $mapping['joinColumns'] = $joinColumns; - - if (isset($manyToOneElement['cascade'])) { - $mapping['cascade'] = $manyToOneElement['cascade']; - } - - $metadata->mapManyToOne($mapping); - } - } - - // Evaluate manyToMany relationships - if (isset($element['manyToMany'])) { - foreach ($element['manyToMany'] as $name => $manyToManyElement) { - $mapping = array( - 'fieldName' => $name, - 'targetEntity' => $manyToManyElement['targetEntity'] - ); - - if (isset($manyToManyElement['fetch'])) { - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $manyToManyElement['fetch']); - } - - if (isset($manyToManyElement['mappedBy'])) { - $mapping['mappedBy'] = $manyToManyElement['mappedBy']; - } else if (isset($manyToManyElement['joinTable'])) { - - $joinTableElement = $manyToManyElement['joinTable']; - $joinTable = array( - 'name' => $joinTableElement['name'] - ); - - if (isset($joinTableElement['schema'])) { - $joinTable['schema'] = $joinTableElement['schema']; - } - - foreach ($joinTableElement['joinColumns'] as $name => $joinColumnElement) { - if (!isset($joinColumnElement['name'])) { - $joinColumnElement['name'] = $name; - } - - $joinTable['joinColumns'][] = $this->_getJoinColumnMapping($joinColumnElement); - } - - foreach ($joinTableElement['inverseJoinColumns'] as $name => $joinColumnElement) { - if (!isset($joinColumnElement['name'])) { - $joinColumnElement['name'] = $name; - } - - $joinTable['inverseJoinColumns'][] = $this->_getJoinColumnMapping($joinColumnElement); - } - - $mapping['joinTable'] = $joinTable; - } - - if (isset($manyToManyElement['inversedBy'])) { - $mapping['inversedBy'] = $manyToManyElement['inversedBy']; - } - - if (isset($manyToManyElement['cascade'])) { - $mapping['cascade'] = $manyToManyElement['cascade']; - } - - if (isset($manyToManyElement['orderBy'])) { - $mapping['orderBy'] = $manyToManyElement['orderBy']; - } - - if (isset($manyToManyElement['indexBy'])) { - $mapping['indexBy'] = $manyToManyElement['indexBy']; - } - - if (isset($manyToManyElement['orphanRemoval'])) { - $mapping['orphanRemoval'] = (bool)$manyToManyElement['orphanRemoval']; - } - - $metadata->mapManyToMany($mapping); - } - } - - // Evaluate lifeCycleCallbacks - if (isset($element['lifecycleCallbacks'])) { - foreach ($element['lifecycleCallbacks'] as $type => $methods) { - foreach ($methods as $method) { - $metadata->addLifecycleCallback($method, constant('Doctrine\ORM\Events::' . $type)); - } - } - } - } - - /** - * Constructs a joinColumn mapping array based on the information - * found in the given join column element. - * - * @param $joinColumnElement The array join column element - * @return array The mapping array. - */ - private function _getJoinColumnMapping($joinColumnElement) - { - $joinColumn = array( - 'name' => $joinColumnElement['name'], - 'referencedColumnName' => $joinColumnElement['referencedColumnName'] - ); - - if (isset($joinColumnElement['fieldName'])) { - $joinColumn['fieldName'] = (string) $joinColumnElement['fieldName']; - } - - if (isset($joinColumnElement['unique'])) { - $joinColumn['unique'] = (bool) $joinColumnElement['unique']; - } - - if (isset($joinColumnElement['nullable'])) { - $joinColumn['nullable'] = (bool) $joinColumnElement['nullable']; - } - - if (isset($joinColumnElement['onDelete'])) { - $joinColumn['onDelete'] = $joinColumnElement['onDelete']; - } - - if (isset($joinColumnElement['columnDefinition'])) { - $joinColumn['columnDefinition'] = $joinColumnElement['columnDefinition']; - } - - return $joinColumn; - } - - /** - * {@inheritdoc} - */ - protected function _loadMappingFile($file) - { - return \Symfony\Component\Yaml\Yaml::parse($file); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ElementCollection.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ElementCollection.php deleted file mode 100644 index f127174..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ElementCollection.php +++ /dev/null @@ -1,31 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("ALL") - * @todo check available targets - */ -final class ElementCollection implements Annotation -{ - /** @var string */ - public $tableName; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Entity.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Entity.php deleted file mode 100644 index 075a5ec..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Entity.php +++ /dev/null @@ -1,32 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("CLASS") - */ -final class Entity implements Annotation -{ - /** @var string */ - public $repositoryClass; - /** @var boolean */ - public $readOnly = false; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/GeneratedValue.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/GeneratedValue.php deleted file mode 100644 index 8558d21..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/GeneratedValue.php +++ /dev/null @@ -1,30 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("PROPERTY") - */ -final class GeneratedValue implements Annotation -{ - /** @var string */ - public $strategy = 'AUTO'; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/HasLifecycleCallbacks.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/HasLifecycleCallbacks.php deleted file mode 100644 index a65fbb5..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/HasLifecycleCallbacks.php +++ /dev/null @@ -1,28 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("CLASS") - */ -final class HasLifecycleCallbacks implements Annotation -{ -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Id.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Id.php deleted file mode 100644 index a670e3d..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Id.php +++ /dev/null @@ -1,28 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("PROPERTY") - */ -final class Id implements Annotation -{ -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Index.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Index.php deleted file mode 100644 index e0a2db3..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Index.php +++ /dev/null @@ -1,32 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("ANNOTATION") - */ -final class Index implements Annotation -{ - /** @var string */ - public $name; - /** @var array */ - public $columns; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/InheritanceType.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/InheritanceType.php deleted file mode 100644 index 009f3ab..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/InheritanceType.php +++ /dev/null @@ -1,30 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("CLASS") - */ -final class InheritanceType implements Annotation -{ - /** @var string */ - public $value; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/JoinColumn.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/JoinColumn.php deleted file mode 100644 index bf5c51d..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/JoinColumn.php +++ /dev/null @@ -1,42 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target({"PROPERTY","ANNOTATION"}) - */ -final class JoinColumn implements Annotation -{ - /** @var string */ - public $name; - /** @var string */ - public $referencedColumnName = 'id'; - /** @var boolean */ - public $unique = false; - /** @var boolean */ - public $nullable = true; - /** @var mixed */ - public $onDelete; - /** @var string */ - public $columnDefinition; - /** @var string */ - public $fieldName; // field name used in non-object hydration (array/scalar) -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/JoinColumns.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/JoinColumns.php deleted file mode 100644 index 525105f..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/JoinColumns.php +++ /dev/null @@ -1,30 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("PROPERTY") - */ -final class JoinColumns implements Annotation -{ - /** @var array<\Doctrine\ORM\Mapping\JoinColumn> */ - public $value; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/JoinTable.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/JoinTable.php deleted file mode 100644 index 9ff9d45..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/JoinTable.php +++ /dev/null @@ -1,36 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("PROPERTY") - */ -final class JoinTable implements Annotation -{ - /** @var string */ - public $name; - /** @var string */ - public $schema; - /** @var array<\Doctrine\ORM\Mapping\JoinColumn> */ - public $joinColumns = array(); - /** @var array<\Doctrine\ORM\Mapping\JoinColumn> */ - public $inverseJoinColumns = array(); -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ManyToMany.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ManyToMany.php deleted file mode 100644 index 28f41aa..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ManyToMany.php +++ /dev/null @@ -1,42 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("PROPERTY") - */ -final class ManyToMany implements Annotation -{ - /** @var string */ - public $targetEntity; - /** @var string */ - public $mappedBy; - /** @var string */ - public $inversedBy; - /** @var array */ - public $cascade; - /** @var string */ - public $fetch = 'LAZY'; - /** @var boolean */ - public $orphanRemoval = false; - /** @var string */ - public $indexBy; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ManyToOne.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ManyToOne.php deleted file mode 100644 index 1bc8376..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ManyToOne.php +++ /dev/null @@ -1,36 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("PROPERTY") - */ -final class ManyToOne implements Annotation -{ - /** @var string */ - public $targetEntity; - /** @var array */ - public $cascade; - /** @var string */ - public $fetch = 'LAZY'; - /** @var string */ - public $inversedBy; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappedSuperclass.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappedSuperclass.php deleted file mode 100644 index 639d216..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappedSuperclass.php +++ /dev/null @@ -1,30 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("CLASS") - */ -final class MappedSuperclass implements Annotation -{ - /** @var string */ - public $repositoryClass; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php deleted file mode 100644 index c71c2e9..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php +++ /dev/null @@ -1,332 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * A MappingException indicates that something is wrong with the mapping setup. - * - * @since 2.0 - */ -class MappingException extends \Doctrine\ORM\ORMException -{ - public static function pathRequired() - { - return new self("Specifying the paths to your entities is required ". - "in the AnnotationDriver to retrieve all class names."); - } - - public static function identifierRequired($entityName) - { - return new self("No identifier/primary key specified for Entity '$entityName'." - . " Every Entity must have an identifier/primary key."); - } - - public static function invalidInheritanceType($entityName, $type) - { - return new self("The inheritance type '$type' specified for '$entityName' does not exist."); - } - - public static function generatorNotAllowedWithCompositeId() - { - return new self("Id generators can't be used with a composite id."); - } - - public static function missingFieldName($entity) - { - return new self("The field or association mapping misses the 'fieldName' attribute in entity '$entity'."); - } - - public static function missingTargetEntity($fieldName) - { - return new self("The association mapping '$fieldName' misses the 'targetEntity' attribute."); - } - - public static function missingSourceEntity($fieldName) - { - return new self("The association mapping '$fieldName' misses the 'sourceEntity' attribute."); - } - - public static function mappingFileNotFound($entityName, $fileName) - { - return new self("No mapping file found named '$fileName' for class '$entityName'."); - } - - public static function invalidMappingFile($entityName, $fileName) - { - return new self("Invalid mapping file '$fileName' for class '$entityName'."); - } - - public static function mappingNotFound($className, $fieldName) - { - return new self("No mapping found for field '$fieldName' on class '$className'."); - } - - public static function queryNotFound($className, $queryName) - { - return new self("No query found named '$queryName' on class '$className'."); - } - - public static function oneToManyRequiresMappedBy($fieldName) - { - return new self("OneToMany mapping on field '$fieldName' requires the 'mappedBy' attribute."); - } - - public static function joinTableRequired($fieldName) - { - return new self("The mapping of field '$fieldName' requires an the 'joinTable' attribute."); - } - - /** - * Called if a required option was not found but is required - * - * @param string $field which field cannot be processed? - * @param string $expectedOption which option is required - * @param string $hint Can optionally be used to supply a tip for common mistakes, - * e.g. "Did you think of the plural s?" - * @return MappingException - */ - static function missingRequiredOption($field, $expectedOption, $hint = '') - { - $message = "The mapping of field '{$field}' is invalid: The option '{$expectedOption}' is required."; - - if ( ! empty($hint)) { - $message .= ' (Hint: ' . $hint . ')'; - } - - return new self($message); - } - - /** - * Generic exception for invalid mappings. - * - * @param string $fieldName - */ - public static function invalidMapping($fieldName) - { - return new self("The mapping of field '$fieldName' is invalid."); - } - - /** - * Exception for reflection exceptions - adds the entity name, - * because there might be long classnames that will be shortened - * within the stacktrace - * - * @param string $entity The entity's name - * @param \ReflectionException $previousException - */ - public static function reflectionFailure($entity, \ReflectionException $previousException) - { - return new self('An error occurred in ' . $entity, 0, $previousException); - } - - public static function joinColumnMustPointToMappedField($className, $joinColumn) - { - return new self('The column ' . $joinColumn . ' must be mapped to a field in class ' - . $className . ' since it is referenced by a join column of another class.'); - } - - public static function classIsNotAValidEntityOrMappedSuperClass($className) - { - return new self('Class '.$className.' is not a valid entity or mapped super class.'); - } - - public static function propertyTypeIsRequired($className, $propertyName) - { - return new self("The attribute 'type' is required for the column description of property ".$className."::\$".$propertyName."."); - } - - public static function tableIdGeneratorNotImplemented($className) - { - return new self("TableIdGenerator is not yet implemented for use with class ".$className); - } - - /** - * - * @param string $entity The entity's name - * @param string $fieldName The name of the field that was already declared - */ - public static function duplicateFieldMapping($entity, $fieldName) { - return new self('Property "'.$fieldName.'" in "'.$entity.'" was already declared, but it must be declared only once'); - } - - public static function duplicateAssociationMapping($entity, $fieldName) { - return new self('Property "'.$fieldName.'" in "'.$entity.'" was already declared, but it must be declared only once'); - } - - public static function duplicateQueryMapping($entity, $queryName) { - return new self('Query named "'.$queryName.'" in "'.$entity.'" was already declared, but it must be declared only once'); - } - - public static function singleIdNotAllowedOnCompositePrimaryKey($entity) { - return new self('Single id is not allowed on composite primary key in entity '.$entity); - } - - public static function unsupportedOptimisticLockingType($entity, $fieldName, $unsupportedType) { - return new self('Locking type "'.$unsupportedType.'" (specified in "'.$entity.'", field "'.$fieldName.'") ' - .'is not supported by Doctrine.' - ); - } - - public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null) - { - if ( ! empty($path)) { - $path = '[' . $path . ']'; - } - - return new self( - 'File mapping drivers must have a valid directory path, ' . - 'however the given path ' . $path . ' seems to be incorrect!' - ); - } - - /** - * Throws an exception that indicates that a class used in a discriminator map does not exist. - * An example would be an outdated (maybe renamed) classname. - * - * @param string $className The class that could not be found - * @param string $owningClass The class that declares the discriminator map. - * @return self - */ - public static function invalidClassInDiscriminatorMap($className, $owningClass) { - return new self( - "Entity class '$className' used in the discriminator map of class '$owningClass' ". - "does not exist." - ); - } - - public static function missingDiscriminatorMap($className) - { - return new self("Entity class '$className' is using inheritance but no discriminator map was defined."); - } - - public static function missingDiscriminatorColumn($className) - { - return new self("Entity class '$className' is using inheritance but no discriminator column was defined."); - } - - public static function invalidDiscriminatorColumnType($className, $type) - { - return new self("Discriminator column type on entity class '$className' is not allowed to be '$type'. 'string' or 'integer' type variables are suggested!"); - } - - public static function cannotVersionIdField($className, $fieldName) - { - return new self("Setting Id field '$fieldName' as versionale in entity class '$className' is not supported."); - } - - public static function sqlConversionNotAllowedForIdentifiers($className, $fieldName, $type) - { - return new self("It is not possible to set id field '$fieldName' to type '$type' in entity class '$className'. The type '$type' requires conversion SQL which is not allowed for identifiers."); - } - - /** - * @param string $className - * @param string $columnName - * @return self - */ - public static function duplicateColumnName($className, $columnName) - { - return new self("Duplicate definition of column '".$columnName."' on entity '".$className."' in a field or discriminator column mapping."); - } - - public static function illegalToManyAssocationOnMappedSuperclass($className, $field) - { - return new self("It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass '".$className."#".$field."'."); - } - - /** - * @param string $className - * @param string $targetEntity - * @param string $targetField - * @return self - */ - public static function cannotMapCompositePrimaryKeyEntitiesAsForeignId($className, $targetEntity, $targetField) - { - return new self("It is not possible to map entity '".$className."' with a composite primary key ". - "as part of the primary key of another entity '".$targetEntity."#".$targetField."'."); - } - - public static function noSingleAssociationJoinColumnFound($className, $field) - { - return new self("'$className#$field' is not an association with a single join column."); - } - - public static function noFieldNameFoundForColumn($className, $column) - { - return new self("Cannot find a field on '$className' that is mapped to column '$column'. Either the ". - "field does not exist or an association exists but it has multiple join columns."); - } - - public static function illegalOrphanRemovalOnIdentifierAssociation($className, $field) - { - return new self("The orphan removal option is not allowed on an association that is ". - "part of the identifier in '$className#$field'."); - } - - public static function illegalOrphanRemoval($className, $field) - { - return new self("Orphan removal is only allowed on one-to-one and one-to-many ". - "associations, but " . $className."#" .$field . " is not."); - } - - public static function illegalInverseIdentifierAssocation($className, $field) - { - return new self("An inverse association is not allowed to be identifier in '$className#$field'."); - } - - public static function illegalToManyIdentifierAssoaction($className, $field) - { - return new self("Many-to-many or one-to-many associations are not allowed to be identifier in '$className#$field'."); - } - - public static function noInheritanceOnMappedSuperClass($className) - { - return new self("Its not supported to define inheritance information on a mapped superclass '" . $className . "'."); - } - - public static function mappedClassNotPartOfDiscriminatorMap($className, $rootClassName) - { - return new self( - "Entity '" . $className . "' has to be part of the discriminator map of '" . $rootClassName . "' " . - "to be properly mapped in the inheritance hierachy. Alternatively you can make '".$className."' an abstract class " . - "to avoid this exception from occuring." - ); - } - - public static function lifecycleCallbackMethodNotFound($className, $methodName) - { - return new self("Entity '" . $className . "' has no method '" . $methodName . "' to be registered as lifecycle callback."); - } - - public static function invalidFetchMode($className, $annotation) - { - return new self("Entity '" . $className . "' has a mapping with invalid fetch mode '" . $annotation . "'"); - } - - public static function compositeKeyAssignedIdGeneratorRequired($className) - { - return new self("Entity '". $className . "' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported."); - } - - public static function invalidTargetEntityClass($targetEntity, $sourceEntity, $associationName) - { - return new self("The target-entity " . $targetEntity . " cannot be found in '" . $sourceEntity."#".$associationName."'."); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/NamedQueries.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/NamedQueries.php deleted file mode 100644 index 1ab2bf2..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/NamedQueries.php +++ /dev/null @@ -1,30 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("CLASS") - */ -final class NamedQueries implements Annotation -{ - /** @var array<\Doctrine\ORM\Mapping\NamedQuery> */ - public $value; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/NamedQuery.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/NamedQuery.php deleted file mode 100644 index 656a4ea..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/NamedQuery.php +++ /dev/null @@ -1,32 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("ANNOTATION") - */ -final class NamedQuery implements Annotation -{ - /** @var string */ - public $name; - /** @var string */ - public $query; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OneToMany.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OneToMany.php deleted file mode 100644 index b4d8ad3..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OneToMany.php +++ /dev/null @@ -1,40 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("PROPERTY") - */ -final class OneToMany implements Annotation -{ - /** @var string */ - public $mappedBy; - /** @var string */ - public $targetEntity; - /** @var array */ - public $cascade; - /** @var string */ - public $fetch = 'LAZY'; - /** @var boolean */ - public $orphanRemoval = false; - /** @var string */ - public $indexBy; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OneToOne.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OneToOne.php deleted file mode 100644 index 4baa121..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OneToOne.php +++ /dev/null @@ -1,40 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("PROPERTY") - */ -final class OneToOne implements Annotation -{ - /** @var string */ - public $targetEntity; - /** @var string */ - public $mappedBy; - /** @var string */ - public $inversedBy; - /** @var array */ - public $cascade; - /** @var string */ - public $fetch = 'LAZY'; - /** @var boolean */ - public $orphanRemoval = false; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OrderBy.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OrderBy.php deleted file mode 100644 index c28f110..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OrderBy.php +++ /dev/null @@ -1,30 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("PROPERTY") - */ -final class OrderBy implements Annotation -{ - /** @var array */ - public $value; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostLoad.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostLoad.php deleted file mode 100644 index 169bb49..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostLoad.php +++ /dev/null @@ -1,28 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("METHOD") - */ -final class PostLoad implements Annotation -{ -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostPersist.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostPersist.php deleted file mode 100644 index 5b5baed..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostPersist.php +++ /dev/null @@ -1,28 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("METHOD") - */ -final class PostPersist implements Annotation -{ -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostRemove.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostRemove.php deleted file mode 100644 index 4798e26..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostRemove.php +++ /dev/null @@ -1,28 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("METHOD") - */ -final class PostRemove implements Annotation -{ -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostUpdate.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostUpdate.php deleted file mode 100644 index f7e7539..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostUpdate.php +++ /dev/null @@ -1,28 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("METHOD") - */ -final class PostUpdate implements Annotation -{ -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PreFlush.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PreFlush.php deleted file mode 100644 index f5eb086..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PreFlush.php +++ /dev/null @@ -1,28 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("METHOD") - */ -final class PreFlush implements Annotation -{ -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PrePersist.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PrePersist.php deleted file mode 100644 index c382700..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PrePersist.php +++ /dev/null @@ -1,28 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("METHOD") - */ -final class PrePersist implements Annotation -{ -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PreRemove.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PreRemove.php deleted file mode 100644 index adcb837..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PreRemove.php +++ /dev/null @@ -1,28 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("METHOD") - */ -final class PreRemove implements Annotation -{ -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PreUpdate.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PreUpdate.php deleted file mode 100644 index 2afd381..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PreUpdate.php +++ /dev/null @@ -1,28 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("METHOD") - */ -final class PreUpdate implements Annotation -{ -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/SequenceGenerator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/SequenceGenerator.php deleted file mode 100644 index be3d700..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/SequenceGenerator.php +++ /dev/null @@ -1,34 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("PROPERTY") - */ -final class SequenceGenerator implements Annotation -{ - /** @var string */ - public $sequenceName; - /** @var integer */ - public $allocationSize = 1; - /** @var integer */ - public $initialValue = 1; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Table.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Table.php deleted file mode 100644 index 41db294..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Table.php +++ /dev/null @@ -1,36 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("CLASS") - */ -final class Table implements Annotation -{ - /** @var string */ - public $name; - /** @var string */ - public $schema; - /** @var array<\Doctrine\ORM\Mapping\Index> */ - public $indexes; - /** @var array<\Doctrine\ORM\Mapping\UniqueConstraint> */ - public $uniqueConstraints; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/UniqueConstraint.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/UniqueConstraint.php deleted file mode 100644 index db9f8fd..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/UniqueConstraint.php +++ /dev/null @@ -1,32 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("ANNOTATION") - */ -final class UniqueConstraint implements Annotation -{ - /** @var string */ - public $name; - /** @var array */ - public $columns; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Version.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Version.php deleted file mode 100644 index 313e751..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Version.php +++ /dev/null @@ -1,28 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Mapping; - -/** - * @Annotation - * @Target("PROPERTY") - */ -final class Version implements Annotation -{ -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/NativeQuery.php b/vendor/doctrine/orm/lib/Doctrine/ORM/NativeQuery.php deleted file mode 100644 index 2ab8744..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/NativeQuery.php +++ /dev/null @@ -1,76 +0,0 @@ -. - */ - -namespace Doctrine\ORM; - -/** - * Represents a native SQL query. - * - * @author Roman Borschel - * @since 2.0 - */ -final class NativeQuery extends AbstractQuery -{ - private $_sql; - - /** - * Sets the SQL of the query. - * - * @param string $sql - * @return NativeQuery This query instance. - */ - public function setSQL($sql) - { - $this->_sql = $sql; - - return $this; - } - - /** - * Gets the SQL query. - * - * @return mixed The built SQL query or an array of all SQL queries. - * @override - */ - public function getSQL() - { - return $this->_sql; - } - - /** - * {@inheritdoc} - */ - protected function _doExecute() - { - $params = $this->_params; - $types = $this->_paramTypes; - - if ($params && is_int(key($params))) { - ksort($params); - ksort($types); - - $params = array_values($params); - $types = array_values($types); - } - - return $this->_em->getConnection()->executeQuery( - $this->_sql, $params, $types, $this->_queryCacheProfile - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/NoResultException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/NoResultException.php deleted file mode 100644 index eb31f7c..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/NoResultException.php +++ /dev/null @@ -1,34 +0,0 @@ -. - */ - -namespace Doctrine\ORM; - -/** - * Exception thrown when an ORM query unexpectedly does not return any results. - * - * @author robo - * @since 2.0 - */ -class NoResultException extends ORMException -{ - public function __construct() - { - parent::__construct('No result was found for query although at least one row was expected.'); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/NonUniqueResultException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/NonUniqueResultException.php deleted file mode 100644 index 1a3a8b7..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/NonUniqueResultException.php +++ /dev/null @@ -1,28 +0,0 @@ -. - */ - -namespace Doctrine\ORM; - -/** - * Exception thrown when an ORM query unexpectedly returns more than one result. - * - * @author robo - * @since 2.0 - */ -class NonUniqueResultException extends ORMException {} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php deleted file mode 100644 index bd16839..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php +++ /dev/null @@ -1,152 +0,0 @@ -. - */ - -namespace Doctrine\ORM; - -use Exception; - -/** - * Base exception class for all ORM exceptions. - * - * @author Roman Borschel - * @since 2.0 - */ -class ORMException extends Exception -{ - public static function missingMappingDriverImpl() - { - return new self("It's a requirement to specify a Metadata Driver and pass it ". - "to Doctrine\ORM\Configuration::setMetadataDriverImpl()."); - } - - public static function entityMissingForeignAssignedId($entity, $relatedEntity) - { - return new self( - "Entity of type " . get_class($entity) . " has identity through a foreign entity " . get_class($relatedEntity) . ", " . - "however this entity has no identity itself. You have to call EntityManager#persist() on the related entity " . - "and make sure that an identifier was generated before trying to persist '" . get_class($entity) . "'. In case " . - "of Post Insert ID Generation (such as MySQL Auto-Increment or PostgreSQL SERIAL) this means you have to call " . - "EntityManager#flush() between both persist operations." - ); - } - - public static function entityMissingAssignedIdForField($entity, $field) - { - return new self("Entity of type " . get_class($entity) . " is missing an assigned ID for field '" . $field . "'. " . - "The identifier generation strategy for this entity requires the ID field to be populated before ". - "EntityManager#persist() is called. If you want automatically generated identifiers instead " . - "you need to adjust the metadata mapping accordingly." - ); - } - public static function unrecognizedField($field) - { - return new self("Unrecognized field: $field"); - } - - /** - * @param string $className - * @param string $field - */ - public static function invalidOrientation($className, $field) - { - return new self("Invalid order by orientation specified for " . $className . "#" . $field); - } - - public static function invalidFlushMode($mode) - { - return new self("'$mode' is an invalid flush mode."); - } - - public static function entityManagerClosed() - { - return new self("The EntityManager is closed."); - } - - public static function invalidHydrationMode($mode) - { - return new self("'$mode' is an invalid hydration mode."); - } - - public static function mismatchedEventManager() - { - return new self("Cannot use different EventManager instances for EntityManager and Connection."); - } - - public static function findByRequiresParameter($methodName) - { - return new self("You need to pass a parameter to '".$methodName."'"); - } - - public static function invalidFindByCall($entityName, $fieldName, $method) - { - return new self( - "Entity '".$entityName."' has no field '".$fieldName."'. ". - "You can therefore not call '".$method."' on the entities' repository" - ); - } - - public static function invalidFindByInverseAssociation($entityName, $associationFieldName) - { - return new self( - "You cannot search for the association field '".$entityName."#".$associationFieldName."', ". - "because it is the inverse side of an association. Find methods only work on owning side associations." - ); - } - - public static function invalidResultCacheDriver() { - return new self("Invalid result cache driver; it must implement \Doctrine\Common\Cache\Cache."); - } - - public static function notSupported() { - return new self("This behaviour is (currently) not supported by Doctrine 2"); - } - - public static function queryCacheNotConfigured() - { - return new self('Query Cache is not configured.'); - } - - public static function metadataCacheNotConfigured() - { - return new self('Class Metadata Cache is not configured.'); - } - - public static function proxyClassesAlwaysRegenerating() - { - return new self('Proxy Classes are always regenerating.'); - } - - public static function unknownEntityNamespace($entityNamespaceAlias) - { - return new self( - "Unknown Entity namespace alias '$entityNamespaceAlias'." - ); - } - - public static function invalidEntityRepository($className) - { - return new self("Invalid repository class '".$className."'. ". - "it must be a Doctrine\ORM\EntityRepository."); - } - - public static function missingIdentifierField($className, $fieldName) - { - return new self("The identifier $fieldName is missing for a query of " . $className); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php deleted file mode 100644 index 878ee4b..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php +++ /dev/null @@ -1,107 +0,0 @@ -. - */ - -namespace Doctrine\ORM; - -/** - * Contains exception messages for all invalid lifecycle state exceptions inside UnitOfWork - * - * @author Benjamin Eberlei - */ -class ORMInvalidArgumentException extends \InvalidArgumentException -{ - static public function scheduleInsertForManagedEntity($entity) - { - return new self("A managed+dirty entity " . self::objToStr($entity) . " can not be scheduled for insertion."); - } - - static public function scheduleInsertForRemovedEntity($entity) - { - return new self("Removed entity " . self::objToStr($entity) . " can not be scheduled for insertion."); - } - - static public function scheduleInsertTwice($entity) - { - return new self("Entity " . self::objToStr($entity) . " can not be scheduled for insertion twice."); - } - - static public function entityWithoutIdentity($className, $entity) - { - throw new self( - "The given entity of type '" . $className . "' (".self::objToStr($entity).") has no identity/no " . - "id values set. It cannot be added to the identity map." - ); - } - - static public function readOnlyRequiresManagedEntity($entity) - { - return new self("Only managed entities can be marked or checked as read only. But " . self::objToStr($entity) . " is not"); - } - - static public function newEntityFoundThroughRelationship(array $assoc, $entry) - { - return new self("A new entity was found through the relationship '" - . $assoc['sourceEntity'] . "#" . $assoc['fieldName'] . "' that was not" - . " configured to cascade persist operations for entity: " . self::objToStr($entry) . "." - . " To solve this issue: Either explicitly call EntityManager#persist()" - . " on this unknown entity or configure cascade persist " - . " this association in the mapping for example @ManyToOne(..,cascade={\"persist\"}). " - . " If you cannot find out which entity causes the problem" - . " implement '" . $assoc['targetEntity'] . "#__toString()' to get a clue."); - } - - static public function detachedEntityFoundThroughRelationship(array $assoc, $entry) - { - throw new self("A detached entity of type " . $assoc['targetEntity'] . " (" . self::objToStr($entry) . ") " - . " was found through the relationship '" . $assoc['sourceEntity'] . "#" . $assoc['fieldName'] . "' " - . "during cascading a persist operation."); - } - - static public function entityNotManaged($entity) - { - throw new self("Entity " . self::objToStr($entity) . " is not managed. An entity is managed if its fetched " . - "from the database or registered as new through EntityManager#persist"); - } - - static public function entityHasNoIdentity($entity, $operation) - { - throw new self("Entity has no identity, therefore " . $operation ." cannot be performed. " . self::objToStr($entity)); - } - - static public function entityIsRemoved($entity, $operation) - { - throw new self("Entity is removed, therefore " . $operation ." cannot be performed. " . self::objToStr($entity)); - } - - static public function detachedEntityCannot($entity, $operation) - { - throw new self("A detached entity was found during " . $operation . " " . self::objToStr($entity)); - } - - /** - * Helper method to show an object as string. - * - * @param object $obj - * @return string - */ - private static function objToStr($obj) - { - return method_exists($obj, '__toString') ? (string)$obj : get_class($obj).'@'.spl_object_hash($obj); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/OptimisticLockException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/OptimisticLockException.php deleted file mode 100644 index 9b5147a..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/OptimisticLockException.php +++ /dev/null @@ -1,64 +0,0 @@ -. - */ - -namespace Doctrine\ORM; - -/** - * An OptimisticLockException is thrown when a version check on an object - * that uses optimistic locking through a version field fails. - * - * @author Roman Borschel - * @author Benjamin Eberlei - * @since 2.0 - */ -class OptimisticLockException extends ORMException -{ - private $entity; - - public function __construct($msg, $entity) - { - parent::__construct($msg); - $this->entity = $entity; - } - - /** - * Gets the entity that caused the exception. - * - * @return object - */ - public function getEntity() - { - return $this->entity; - } - - public static function lockFailed($entity) - { - return new self("The optimistic lock on an entity failed.", $entity); - } - - public static function lockFailedVersionMissmatch($entity, $expectedLockVersion, $actualLockVersion) - { - return new self("The optimistic lock failed, version " . $expectedLockVersion . " was expected, but is actually ".$actualLockVersion, $entity); - } - - public static function notVersioned($entityName) - { - return new self("Cannot obtain optimistic lock on unversioned entity " . $entityName, null); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/PersistentCollection.php b/vendor/doctrine/orm/lib/Doctrine/ORM/PersistentCollection.php deleted file mode 100644 index 00bd702..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/PersistentCollection.php +++ /dev/null @@ -1,792 +0,0 @@ -. - */ - -namespace Doctrine\ORM; - -use Doctrine\ORM\Mapping\ClassMetadata, - Doctrine\Common\Collections\Collection, - Doctrine\Common\Collections\ArrayCollection, - Closure; - -/** - * A PersistentCollection represents a collection of elements that have persistent state. - * - * Collections of entities represent only the associations (links) to those entities. - * That means, if the collection is part of a many-many mapping and you remove - * entities from the collection, only the links in the relation table are removed (on flush). - * Similarly, if you remove entities from a collection that is part of a one-many - * mapping this will only result in the nulling out of the foreign keys on flush. - * - * @since 2.0 - * @author Konsta Vesterinen - * @author Roman Borschel - * @author Giorgio Sironi - * @todo Design for inheritance to allow custom implementations? - */ -final class PersistentCollection implements Collection -{ - /** - * A snapshot of the collection at the moment it was fetched from the database. - * This is used to create a diff of the collection at commit time. - * - * @var array - */ - private $snapshot = array(); - - /** - * The entity that owns this collection. - * - * @var object - */ - private $owner; - - /** - * The association mapping the collection belongs to. - * This is currently either a OneToManyMapping or a ManyToManyMapping. - * - * @var array - */ - private $association; - - /** - * The EntityManager that manages the persistence of the collection. - * - * @var \Doctrine\ORM\EntityManager - */ - private $em; - - /** - * The name of the field on the target entities that points to the owner - * of the collection. This is only set if the association is bi-directional. - * - * @var string - */ - private $backRefFieldName; - - /** - * The class descriptor of the collection's entity type. - */ - private $typeClass; - - /** - * Whether the collection is dirty and needs to be synchronized with the database - * when the UnitOfWork that manages its persistent state commits. - * - * @var boolean - */ - private $isDirty = false; - - /** - * Whether the collection has already been initialized. - * - * @var boolean - */ - private $initialized = true; - - /** - * The wrapped Collection instance. - * - * @var Collection - */ - private $coll; - - /** - * Creates a new persistent collection. - * - * @param EntityManager $em The EntityManager the collection will be associated with. - * @param ClassMetadata $class The class descriptor of the entity type of this collection. - * @param array The collection elements. - */ - public function __construct(EntityManager $em, $class, $coll) - { - $this->coll = $coll; - $this->em = $em; - $this->typeClass = $class; - } - - /** - * INTERNAL: - * Sets the collection's owning entity together with the AssociationMapping that - * describes the association between the owner and the elements of the collection. - * - * @param object $entity - * @param AssociationMapping $assoc - */ - public function setOwner($entity, array $assoc) - { - $this->owner = $entity; - $this->association = $assoc; - $this->backRefFieldName = $assoc['inversedBy'] ?: $assoc['mappedBy']; - } - - /** - * INTERNAL: - * Gets the collection owner. - * - * @return object - */ - public function getOwner() - { - return $this->owner; - } - - public function getTypeClass() - { - return $this->typeClass; - } - - /** - * INTERNAL: - * Adds an element to a collection during hydration. This will automatically - * complete bidirectional associations in the case of a one-to-many association. - * - * @param mixed $element The element to add. - */ - public function hydrateAdd($element) - { - $this->coll->add($element); - - // If _backRefFieldName is set and its a one-to-many association, - // we need to set the back reference. - if ($this->backRefFieldName && $this->association['type'] === ClassMetadata::ONE_TO_MANY) { - // Set back reference to owner - $this->typeClass->reflFields[$this->backRefFieldName]->setValue( - $element, $this->owner - ); - - $this->em->getUnitOfWork()->setOriginalEntityProperty( - spl_object_hash($element), $this->backRefFieldName, $this->owner - ); - } - } - - /** - * INTERNAL: - * Sets a keyed element in the collection during hydration. - * - * @param mixed $key The key to set. - * $param mixed $value The element to set. - */ - public function hydrateSet($key, $element) - { - $this->coll->set($key, $element); - - // If _backRefFieldName is set, then the association is bidirectional - // and we need to set the back reference. - if ($this->backRefFieldName && $this->association['type'] === ClassMetadata::ONE_TO_MANY) { - // Set back reference to owner - $this->typeClass->reflFields[$this->backRefFieldName]->setValue( - $element, $this->owner - ); - } - } - - /** - * Initializes the collection by loading its contents from the database - * if the collection is not yet initialized. - */ - public function initialize() - { - if ($this->initialized || ! $this->association) { - return; - } - - // Has NEW objects added through add(). Remember them. - $newObjects = array(); - - if ($this->isDirty) { - $newObjects = $this->coll->toArray(); - } - - $this->coll->clear(); - $this->em->getUnitOfWork()->loadCollection($this); - $this->takeSnapshot(); - - // Reattach NEW objects added through add(), if any. - if ($newObjects) { - foreach ($newObjects as $obj) { - $this->coll->add($obj); - } - - $this->isDirty = true; - } - - $this->initialized = true; - } - - /** - * INTERNAL: - * Tells this collection to take a snapshot of its current state. - */ - public function takeSnapshot() - { - $this->snapshot = $this->coll->toArray(); - $this->isDirty = false; - } - - /** - * INTERNAL: - * Returns the last snapshot of the elements in the collection. - * - * @return array The last snapshot of the elements. - */ - public function getSnapshot() - { - return $this->snapshot; - } - - /** - * INTERNAL: - * getDeleteDiff - * - * @return array - */ - public function getDeleteDiff() - { - return array_udiff_assoc( - $this->snapshot, - $this->coll->toArray(), - function($a, $b) { return $a === $b ? 0 : 1; } - ); - } - - /** - * INTERNAL: - * getInsertDiff - * - * @return array - */ - public function getInsertDiff() - { - return array_udiff_assoc( - $this->coll->toArray(), - $this->snapshot, - function($a, $b) { return $a === $b ? 0 : 1; } - ); - } - - /** - * INTERNAL: Gets the association mapping of the collection. - * - * @return array - */ - public function getMapping() - { - return $this->association; - } - - /** - * Marks this collection as changed/dirty. - */ - private function changed() - { - if ($this->isDirty) { - return; - } - - $this->isDirty = true; - - if ($this->association !== null && - $this->association['isOwningSide'] && - $this->association['type'] === ClassMetadata::MANY_TO_MANY && - $this->owner && - $this->em->getClassMetadata(get_class($this->owner))->isChangeTrackingNotify()) { - $this->em->getUnitOfWork()->scheduleForDirtyCheck($this->owner); - } - } - - /** - * Gets a boolean flag indicating whether this collection is dirty which means - * its state needs to be synchronized with the database. - * - * @return boolean TRUE if the collection is dirty, FALSE otherwise. - */ - public function isDirty() - { - return $this->isDirty; - } - - /** - * Sets a boolean flag, indicating whether this collection is dirty. - * - * @param boolean $dirty Whether the collection should be marked dirty or not. - */ - public function setDirty($dirty) - { - $this->isDirty = $dirty; - } - - /** - * Sets the initialized flag of the collection, forcing it into that state. - * - * @param boolean $bool - */ - public function setInitialized($bool) - { - $this->initialized = $bool; - } - - /** - * Checks whether this collection has been initialized. - * - * @return boolean - */ - public function isInitialized() - { - return $this->initialized; - } - - /** {@inheritdoc} */ - public function first() - { - $this->initialize(); - - return $this->coll->first(); - } - - /** {@inheritdoc} */ - public function last() - { - $this->initialize(); - - return $this->coll->last(); - } - - /** - * {@inheritdoc} - */ - public function remove($key) - { - // TODO: If the keys are persistent as well (not yet implemented) - // and the collection is not initialized and orphanRemoval is - // not used we can issue a straight SQL delete/update on the - // association (table). Without initializing the collection. - $this->initialize(); - - $removed = $this->coll->remove($key); - - if ( ! $removed) { - return $removed; - } - - $this->changed(); - - if ($this->association !== null && - $this->association['type'] & ClassMetadata::TO_MANY && - $this->owner && - $this->association['orphanRemoval']) { - $this->em->getUnitOfWork()->scheduleOrphanRemoval($removed); - } - - return $removed; - } - - /** - * {@inheritdoc} - */ - public function removeElement($element) - { - if ( ! $this->initialized && $this->association['fetch'] === Mapping\ClassMetadataInfo::FETCH_EXTRA_LAZY) { - if ($this->coll->contains($element)) { - return $this->coll->removeElement($element); - } - - $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); - - if ($persister->removeElement($this, $element)) { - return $element; - } - - return null; - } - - $this->initialize(); - - $removed = $this->coll->removeElement($element); - - if ( ! $removed) { - return $removed; - } - - $this->changed(); - - if ($this->association !== null && - $this->association['type'] & ClassMetadata::TO_MANY && - $this->owner && - $this->association['orphanRemoval']) { - $this->em->getUnitOfWork()->scheduleOrphanRemoval($element); - } - - return $removed; - } - - /** - * {@inheritdoc} - */ - public function containsKey($key) - { - $this->initialize(); - - return $this->coll->containsKey($key); - } - - /** - * {@inheritdoc} - */ - public function contains($element) - { - if ( ! $this->initialized && $this->association['fetch'] === Mapping\ClassMetadataInfo::FETCH_EXTRA_LAZY) { - $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); - - return $this->coll->contains($element) || $persister->contains($this, $element); - } - - $this->initialize(); - - return $this->coll->contains($element); - } - - /** - * {@inheritdoc} - */ - public function exists(Closure $p) - { - $this->initialize(); - - return $this->coll->exists($p); - } - - /** - * {@inheritdoc} - */ - public function indexOf($element) - { - $this->initialize(); - - return $this->coll->indexOf($element); - } - - /** - * {@inheritdoc} - */ - public function get($key) - { - $this->initialize(); - - return $this->coll->get($key); - } - - /** - * {@inheritdoc} - */ - public function getKeys() - { - $this->initialize(); - - return $this->coll->getKeys(); - } - - /** - * {@inheritdoc} - */ - public function getValues() - { - $this->initialize(); - - return $this->coll->getValues(); - } - - /** - * {@inheritdoc} - */ - public function count() - { - if ( ! $this->initialized && $this->association['fetch'] === Mapping\ClassMetadataInfo::FETCH_EXTRA_LAZY) { - $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); - - return $persister->count($this) + ($this->isDirty ? $this->coll->count() : 0); - } - - $this->initialize(); - - return $this->coll->count(); - } - - /** - * {@inheritdoc} - */ - public function set($key, $value) - { - $this->initialize(); - - $this->coll->set($key, $value); - - $this->changed(); - } - - /** - * {@inheritdoc} - */ - public function add($value) - { - $this->coll->add($value); - - $this->changed(); - - return true; - } - - /** - * {@inheritdoc} - */ - public function isEmpty() - { - $this->initialize(); - - return $this->coll->isEmpty(); - } - - /** - * {@inheritdoc} - */ - public function getIterator() - { - $this->initialize(); - - return $this->coll->getIterator(); - } - - /** - * {@inheritdoc} - */ - public function map(Closure $func) - { - $this->initialize(); - - return $this->coll->map($func); - } - - /** - * {@inheritdoc} - */ - public function filter(Closure $p) - { - $this->initialize(); - - return $this->coll->filter($p); - } - - /** - * {@inheritdoc} - */ - public function forAll(Closure $p) - { - $this->initialize(); - - return $this->coll->forAll($p); - } - - /** - * {@inheritdoc} - */ - public function partition(Closure $p) - { - $this->initialize(); - - return $this->coll->partition($p); - } - - /** - * {@inheritdoc} - */ - public function toArray() - { - $this->initialize(); - - return $this->coll->toArray(); - } - - /** - * {@inheritdoc} - */ - public function clear() - { - if ($this->initialized && $this->isEmpty()) { - return; - } - - $uow = $this->em->getUnitOfWork(); - - if ($this->association['type'] & ClassMetadata::TO_MANY && - $this->association['orphanRemoval'] && - $this->owner) { - // we need to initialize here, as orphan removal acts like implicit cascadeRemove, - // hence for event listeners we need the objects in memory. - $this->initialize(); - - foreach ($this->coll as $element) { - $uow->scheduleOrphanRemoval($element); - } - } - - $this->coll->clear(); - - $this->initialized = true; // direct call, {@link initialize()} is too expensive - - if ($this->association['isOwningSide']) { - $this->changed(); - - $uow->scheduleCollectionDeletion($this); - - $this->takeSnapshot(); - } - } - - /** - * Called by PHP when this collection is serialized. Ensures that only the - * elements are properly serialized. - * - * @internal Tried to implement Serializable first but that did not work well - * with circular references. This solution seems simpler and works well. - */ - public function __sleep() - { - return array('coll', 'initialized'); - } - - /* ArrayAccess implementation */ - - /** - * @see containsKey() - */ - public function offsetExists($offset) - { - return $this->containsKey($offset); - } - - /** - * @see get() - */ - public function offsetGet($offset) - { - return $this->get($offset); - } - - /** - * @see add() - * @see set() - */ - public function offsetSet($offset, $value) - { - if ( ! isset($offset)) { - return $this->add($value); - } - - return $this->set($offset, $value); - } - - /** - * @see remove() - */ - public function offsetUnset($offset) - { - return $this->remove($offset); - } - - public function key() - { - return $this->coll->key(); - } - - /** - * Gets the element of the collection at the current iterator position. - */ - public function current() - { - return $this->coll->current(); - } - - /** - * Moves the internal iterator position to the next element. - */ - public function next() - { - return $this->coll->next(); - } - - /** - * Retrieves the wrapped Collection instance. - * - * @return \Doctrine\Common\Collections\Collection - */ - public function unwrap() - { - return $this->coll; - } - - /** - * Extract a slice of $length elements starting at position $offset from the Collection. - * - * If $length is null it returns all elements from $offset to the end of the Collection. - * Keys have to be preserved by this method. Calling this method will only return the - * selected slice and NOT change the elements contained in the collection slice is called on. - * - * @param int $offset - * @param int $length - * - * @return array - */ - public function slice($offset, $length = null) - { - if ( ! $this->initialized && ! $this->isDirty && $this->association['fetch'] === Mapping\ClassMetadataInfo::FETCH_EXTRA_LAZY) { - $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); - - return $persister->slice($this, $offset, $length); - } - - $this->initialize(); - - return $this->coll->slice($offset, $length); - } - - /** - * Cleanup internal state of cloned persistent collection. - * - * The following problems have to be prevented: - * 1. Added entities are added to old PC - * 2. New collection is not dirty, if reused on other entity nothing - * changes. - * 3. Snapshot leads to invalid diffs being generated. - * 4. Lazy loading grabs entities from old owner object. - * 5. New collection is connected to old owner and leads to duplicate keys. - */ - public function __clone() - { - if (is_object($this->coll)) { - $this->coll = clone $this->coll; - } - - $this->initialize(); - $this->owner = null; - - $this->snapshot = array(); - - $this->changed(); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php deleted file mode 100644 index 8c12948..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php +++ /dev/null @@ -1,207 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Persisters; - -use Doctrine\ORM\EntityManager, - Doctrine\ORM\PersistentCollection; - -/** - * Base class for all collection persisters. - * - * @since 2.0 - * @author Roman Borschel - */ -abstract class AbstractCollectionPersister -{ - /** - * @var EntityManager - */ - protected $_em; - - /** - * @var \Doctrine\DBAL\Connection - */ - protected $_conn; - - /** - * @var \Doctrine\ORM\UnitOfWork - */ - protected $_uow; - - /** - * Initializes a new instance of a class derived from AbstractCollectionPersister. - * - * @param \Doctrine\ORM\EntityManager $em - */ - public function __construct(EntityManager $em) - { - $this->_em = $em; - $this->_uow = $em->getUnitOfWork(); - $this->_conn = $em->getConnection(); - } - - /** - * Deletes the persistent state represented by the given collection. - * - * @param PersistentCollection $coll - */ - public function delete(PersistentCollection $coll) - { - $mapping = $coll->getMapping(); - - if ( ! $mapping['isOwningSide']) { - return; // ignore inverse side - } - - $sql = $this->_getDeleteSQL($coll); - $this->_conn->executeUpdate($sql, $this->_getDeleteSQLParameters($coll)); - } - - /** - * Gets the SQL statement for deleting the given collection. - * - * @param PersistentCollection $coll - */ - abstract protected function _getDeleteSQL(PersistentCollection $coll); - - /** - * Gets the SQL parameters for the corresponding SQL statement to delete - * the given collection. - * - * @param PersistentCollection $coll - */ - abstract protected function _getDeleteSQLParameters(PersistentCollection $coll); - - /** - * Updates the given collection, synchronizing it's state with the database - * by inserting, updating and deleting individual elements. - * - * @param PersistentCollection $coll - */ - public function update(PersistentCollection $coll) - { - $mapping = $coll->getMapping(); - - if ( ! $mapping['isOwningSide']) { - return; // ignore inverse side - } - - $this->deleteRows($coll); - //$this->updateRows($coll); - $this->insertRows($coll); - } - - public function deleteRows(PersistentCollection $coll) - { - $deleteDiff = $coll->getDeleteDiff(); - $sql = $this->_getDeleteRowSQL($coll); - - foreach ($deleteDiff as $element) { - $this->_conn->executeUpdate($sql, $this->_getDeleteRowSQLParameters($coll, $element)); - } - } - - //public function updateRows(PersistentCollection $coll) - //{} - - public function insertRows(PersistentCollection $coll) - { - $insertDiff = $coll->getInsertDiff(); - $sql = $this->_getInsertRowSQL($coll); - - foreach ($insertDiff as $element) { - $this->_conn->executeUpdate($sql, $this->_getInsertRowSQLParameters($coll, $element)); - } - } - - public function count(PersistentCollection $coll) - { - throw new \BadMethodCallException("Counting the size of this persistent collection is not supported by this CollectionPersister."); - } - - public function slice(PersistentCollection $coll, $offset, $length = null) - { - throw new \BadMethodCallException("Slicing elements is not supported by this CollectionPersister."); - } - - public function contains(PersistentCollection $coll, $element) - { - throw new \BadMethodCallException("Checking for existance of an element is not supported by this CollectionPersister."); - } - - public function containsKey(PersistentCollection $coll, $key) - { - throw new \BadMethodCallException("Checking for existance of a key is not supported by this CollectionPersister."); - } - - public function removeElement(PersistentCollection $coll, $element) - { - throw new \BadMethodCallException("Removing an element is not supported by this CollectionPersister."); - } - - public function removeKey(PersistentCollection $coll, $key) - { - throw new \BadMethodCallException("Removing a key is not supported by this CollectionPersister."); - } - - public function get(PersistentCollection $coll, $index) - { - throw new \BadMethodCallException("Selecting a collection by index is not supported by this CollectionPersister."); - } - - /** - * Gets the SQL statement used for deleting a row from the collection. - * - * @param PersistentCollection $coll - */ - abstract protected function _getDeleteRowSQL(PersistentCollection $coll); - - /** - * Gets the SQL parameters for the corresponding SQL statement to delete the given - * element from the given collection. - * - * @param PersistentCollection $coll - * @param mixed $element - */ - abstract protected function _getDeleteRowSQLParameters(PersistentCollection $coll, $element); - - /** - * Gets the SQL statement used for updating a row in the collection. - * - * @param PersistentCollection $coll - */ - abstract protected function _getUpdateRowSQL(PersistentCollection $coll); - - /** - * Gets the SQL statement used for inserting a row in the collection. - * - * @param PersistentCollection $coll - */ - abstract protected function _getInsertRowSQL(PersistentCollection $coll); - - /** - * Gets the SQL parameters for the corresponding SQL statement to insert the given - * element of the given collection into the database. - * - * @param PersistentCollection $coll - * @param mixed $element - */ - abstract protected function _getInsertRowSQLParameters(PersistentCollection $coll, $element); -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/AbstractEntityInheritancePersister.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/AbstractEntityInheritancePersister.php deleted file mode 100644 index 191c077..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/AbstractEntityInheritancePersister.php +++ /dev/null @@ -1,83 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Persisters; - -use Doctrine\ORM\Mapping\ClassMetadata, - Doctrine\DBAL\Types\Type; - -/** - * Base class for entity persisters that implement a certain inheritance mapping strategy. - * All these persisters are assumed to use a discriminator column to discriminate entity - * types in the hierarchy. - * - * @author Roman Borschel - * @author Benjamin Eberlei - * @since 2.0 - */ -abstract class AbstractEntityInheritancePersister extends BasicEntityPersister -{ - /** - * {@inheritdoc} - */ - protected function _prepareInsertData($entity) - { - $data = parent::_prepareInsertData($entity); - - // Populate the discriminator column - $discColumn = $this->_class->discriminatorColumn; - $this->_columnTypes[$discColumn['name']] = $discColumn['type']; - $data[$this->_getDiscriminatorColumnTableName()][$discColumn['name']] = $this->_class->discriminatorValue; - - return $data; - } - - /** - * Gets the name of the table that contains the discriminator column. - * - * @return string The table name. - */ - abstract protected function _getDiscriminatorColumnTableName(); - - /** - * {@inheritdoc} - */ - protected function _getSelectColumnSQL($field, ClassMetadata $class, $alias = 'r') - { - $columnName = $class->columnNames[$field]; - $sql = $this->_getSQLTableAlias($class->name, $alias == 'r' ? '' : $alias) . '.' . $class->getQuotedColumnName($field, $this->_platform); - $columnAlias = $this->getSQLColumnAlias($columnName); - $this->_rsm->addFieldResult($alias, $columnAlias, $field, $class->name); - - if (isset($class->fieldMappings[$field]['requireSQLConversion'])) { - $type = Type::getType($class->getTypeOfField($field)); - $sql = $type->convertToPHPValueSQL($sql, $this->_platform); - } - - return $sql . ' AS ' . $columnAlias; - } - - protected function getSelectJoinColumnSQL($tableAlias, $joinColumnName, $className) - { - $columnAlias = $this->getSQLColumnAlias($joinColumnName); - $this->_rsm->addMetaResult('r', $columnAlias, $joinColumnName); - - return $tableAlias . '.' . $joinColumnName . ' AS ' . $columnAlias; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php deleted file mode 100644 index 4837aac..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php +++ /dev/null @@ -1,1617 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Persisters; - -use PDO, - Doctrine\DBAL\LockMode, - Doctrine\DBAL\Types\Type, - Doctrine\DBAL\Connection, - Doctrine\ORM\ORMException, - Doctrine\ORM\OptimisticLockException, - Doctrine\ORM\EntityManager, - Doctrine\ORM\UnitOfWork, - Doctrine\ORM\Query, - Doctrine\ORM\PersistentCollection, - Doctrine\ORM\Mapping\MappingException, - Doctrine\ORM\Mapping\ClassMetadata, - Doctrine\ORM\Events, - Doctrine\ORM\Event\LifecycleEventArgs; - -/** - * A BasicEntityPersiter maps an entity to a single table in a relational database. - * - * A persister is always responsible for a single entity type. - * - * EntityPersisters are used during a UnitOfWork to apply any changes to the persistent - * state of entities onto a relational database when the UnitOfWork is committed, - * as well as for basic querying of entities and their associations (not DQL). - * - * The persisting operations that are invoked during a commit of a UnitOfWork to - * persist the persistent entity state are: - * - * - {@link addInsert} : To schedule an entity for insertion. - * - {@link executeInserts} : To execute all scheduled insertions. - * - {@link update} : To update the persistent state of an entity. - * - {@link delete} : To delete the persistent state of an entity. - * - * As can be seen from the above list, insertions are batched and executed all at once - * for increased efficiency. - * - * The querying operations invoked during a UnitOfWork, either through direct find - * requests or lazy-loading, are the following: - * - * - {@link load} : Loads (the state of) a single, managed entity. - * - {@link loadAll} : Loads multiple, managed entities. - * - {@link loadOneToOneEntity} : Loads a one/many-to-one entity association (lazy-loading). - * - {@link loadOneToManyCollection} : Loads a one-to-many entity association (lazy-loading). - * - {@link loadManyToManyCollection} : Loads a many-to-many entity association (lazy-loading). - * - * The BasicEntityPersister implementation provides the default behavior for - * persisting and querying entities that are mapped to a single database table. - * - * Subclasses can be created to provide custom persisting and querying strategies, - * i.e. spanning multiple tables. - * - * @author Roman Borschel - * @author Giorgio Sironi - * @author Benjamin Eberlei - * @author Alexander - * @since 2.0 - */ -class BasicEntityPersister -{ - /** - * Metadata object that describes the mapping of the mapped entity class. - * - * @var \Doctrine\ORM\Mapping\ClassMetadata - */ - protected $_class; - - /** - * The underlying DBAL Connection of the used EntityManager. - * - * @var \Doctrine\DBAL\Connection $conn - */ - protected $_conn; - - /** - * The database platform. - * - * @var \Doctrine\DBAL\Platforms\AbstractPlatform - */ - protected $_platform; - - /** - * The EntityManager instance. - * - * @var \Doctrine\ORM\EntityManager - */ - protected $_em; - - /** - * Queued inserts. - * - * @var array - */ - protected $_queuedInserts = array(); - - /** - * ResultSetMapping that is used for all queries. Is generated lazily once per request. - * - * TODO: Evaluate Caching in combination with the other cached SQL snippets. - * - * @var Query\ResultSetMapping - */ - protected $_rsm; - - /** - * The map of column names to DBAL mapping types of all prepared columns used - * when INSERTing or UPDATEing an entity. - * - * @var array - * @see _prepareInsertData($entity) - * @see _prepareUpdateData($entity) - */ - protected $_columnTypes = array(); - - /** - * The INSERT SQL statement used for entities handled by this persister. - * This SQL is only generated once per request, if at all. - * - * @var string - */ - private $_insertSql; - - /** - * The SELECT column list SQL fragment used for querying entities by this persister. - * This SQL fragment is only generated once per request, if at all. - * - * @var string - */ - protected $_selectColumnListSql; - - /** - * The JOIN SQL fragement used to eagerly load all many-to-one and one-to-one - * associations configured as FETCH_EAGER, aswell as all inverse one-to-one associations. - * - * @var string - */ - protected $_selectJoinSql; - - /** - * Counter for creating unique SQL table and column aliases. - * - * @var integer - */ - protected $_sqlAliasCounter = 0; - - /** - * Map from class names (FQCN) to the corresponding generated SQL table aliases. - * - * @var array - */ - protected $_sqlTableAliases = array(); - - /** - * Initializes a new BasicEntityPersister that uses the given EntityManager - * and persists instances of the class described by the given ClassMetadata descriptor. - * - * @param \Doctrine\ORM\EntityManager $em - * @param \Doctrine\ORM\Mapping\ClassMetadata $class - */ - public function __construct(EntityManager $em, ClassMetadata $class) - { - $this->_em = $em; - $this->_class = $class; - $this->_conn = $em->getConnection(); - $this->_platform = $this->_conn->getDatabasePlatform(); - } - - /** - * @return \Doctrine\ORM\Mapping\ClassMetadata - */ - public function getClassMetadata() - { - return $this->_class; - } - - /** - * Adds an entity to the queued insertions. - * The entity remains queued until {@link executeInserts} is invoked. - * - * @param object $entity The entity to queue for insertion. - */ - public function addInsert($entity) - { - $this->_queuedInserts[spl_object_hash($entity)] = $entity; - } - - /** - * Executes all queued entity insertions and returns any generated post-insert - * identifiers that were created as a result of the insertions. - * - * If no inserts are queued, invoking this method is a NOOP. - * - * @return array An array of any generated post-insert IDs. This will be an empty array - * if the entity class does not use the IDENTITY generation strategy. - */ - public function executeInserts() - { - if ( ! $this->_queuedInserts) { - return; - } - - $postInsertIds = array(); - $idGen = $this->_class->idGenerator; - $isPostInsertId = $idGen->isPostInsertGenerator(); - - $stmt = $this->_conn->prepare($this->_getInsertSQL()); - $tableName = $this->_class->getTableName(); - - foreach ($this->_queuedInserts as $entity) { - $insertData = $this->_prepareInsertData($entity); - - if (isset($insertData[$tableName])) { - $paramIndex = 1; - - foreach ($insertData[$tableName] as $column => $value) { - $stmt->bindValue($paramIndex++, $value, $this->_columnTypes[$column]); - } - } - - $stmt->execute(); - - if ($isPostInsertId) { - $id = $idGen->generate($this->_em, $entity); - $postInsertIds[$id] = $entity; - } else { - $id = $this->_class->getIdentifierValues($entity); - } - - if ($this->_class->isVersioned) { - $this->assignDefaultVersionValue($entity, $id); - } - } - - $stmt->closeCursor(); - $this->_queuedInserts = array(); - - return $postInsertIds; - } - - /** - * Retrieves the default version value which was created - * by the preceding INSERT statement and assigns it back in to the - * entities version field. - * - * @param object $entity - * @param mixed $id - */ - protected function assignDefaultVersionValue($entity, $id) - { - $value = $this->fetchVersionValue($this->_class, $id); - $this->_class->setFieldValue($entity, $this->_class->versionField, $value); - } - - /** - * Fetch the current version value of a versioned entity. - * - * @param \Doctrine\ORM\Mapping\ClassMetadata $versionedClass - * @param mixed $id - * @return mixed - */ - protected function fetchVersionValue($versionedClass, $id) - { - $versionField = $versionedClass->versionField; - $identifier = $versionedClass->getIdentifierColumnNames(); - - $versionFieldColumnName = $versionedClass->getQuotedColumnName($versionField, $this->_platform); - - //FIXME: Order with composite keys might not be correct - $sql = 'SELECT ' . $versionFieldColumnName - . ' FROM ' . $versionedClass->getQuotedTableName($this->_platform) - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; - $value = $this->_conn->fetchColumn($sql, array_values((array)$id)); - - return Type::getType($versionedClass->fieldMappings[$versionField]['type'])->convertToPHPValue($value, $this->_platform); - } - - /** - * Updates a managed entity. The entity is updated according to its current changeset - * in the running UnitOfWork. If there is no changeset, nothing is updated. - * - * The data to update is retrieved through {@link _prepareUpdateData}. - * Subclasses that override this method are supposed to obtain the update data - * in the same way, through {@link _prepareUpdateData}. - * - * Subclasses are also supposed to take care of versioning when overriding this method, - * if necessary. The {@link _updateTable} method can be used to apply the data retrieved - * from {@_prepareUpdateData} on the target tables, thereby optionally applying versioning. - * - * @param object $entity The entity to update. - */ - public function update($entity) - { - $updateData = $this->_prepareUpdateData($entity); - $tableName = $this->_class->getTableName(); - - if (isset($updateData[$tableName]) && $updateData[$tableName]) { - $this->_updateTable( - $entity, $this->_class->getQuotedTableName($this->_platform), - $updateData[$tableName], $this->_class->isVersioned - ); - - if ($this->_class->isVersioned) { - $id = $this->_em->getUnitOfWork()->getEntityIdentifier($entity); - $this->assignDefaultVersionValue($entity, $id); - } - } - } - - /** - * Performs an UPDATE statement for an entity on a specific table. - * The UPDATE can optionally be versioned, which requires the entity to have a version field. - * - * @param object $entity The entity object being updated. - * @param string $quotedTableName The quoted name of the table to apply the UPDATE on. - * @param array $updateData The map of columns to update (column => value). - * @param boolean $versioned Whether the UPDATE should be versioned. - */ - protected final function _updateTable($entity, $quotedTableName, array $updateData, $versioned = false) - { - $set = $params = $types = array(); - - foreach ($updateData as $columnName => $value) { - $column = $columnName; - $placeholder = '?'; - - if (isset($this->_class->fieldNames[$columnName])) { - $column = $this->_class->getQuotedColumnName($this->_class->fieldNames[$columnName], $this->_platform); - - if (isset($this->_class->fieldMappings[$this->_class->fieldNames[$columnName]]['requireSQLConversion'])) { - $type = Type::getType($this->_columnTypes[$columnName]); - $placeholder = $type->convertToDatabaseValueSQL('?', $this->_platform); - } - } - - $set[] = $column . ' = ' . $placeholder; - $params[] = $value; - $types[] = $this->_columnTypes[$columnName]; - } - - $where = array(); - $id = $this->_em->getUnitOfWork()->getEntityIdentifier($entity); - - foreach ($this->_class->identifier as $idField) { - if (isset($this->_class->associationMappings[$idField])) { - $targetMapping = $this->_em->getClassMetadata($this->_class->associationMappings[$idField]['targetEntity']); - $where[] = $this->_class->associationMappings[$idField]['joinColumns'][0]['name']; - $params[] = $id[$idField]; - - switch (true) { - case (isset($targetMapping->fieldMappings[$targetMapping->identifier[0]])): - $types[] = $targetMapping->fieldMappings[$targetMapping->identifier[0]]['type']; - break; - - case (isset($targetMapping->associationMappings[$targetMapping->identifier[0]])): - $types[] = $targetMapping->associationMappings[$targetMapping->identifier[0]]['type']; - break; - - default: - throw ORMException::unrecognizedField($targetMapping->identifier[0]); - } - } else { - $where[] = $this->_class->getQuotedColumnName($idField, $this->_platform); - $params[] = $id[$idField]; - $types[] = $this->_class->fieldMappings[$idField]['type']; - } - } - - if ($versioned) { - $versionField = $this->_class->versionField; - $versionFieldType = $this->_class->fieldMappings[$versionField]['type']; - $versionColumn = $this->_class->getQuotedColumnName($versionField, $this->_platform); - - if ($versionFieldType == Type::INTEGER) { - $set[] = $versionColumn . ' = ' . $versionColumn . ' + 1'; - } else if ($versionFieldType == Type::DATETIME) { - $set[] = $versionColumn . ' = CURRENT_TIMESTAMP'; - } - - $where[] = $versionColumn; - $params[] = $this->_class->reflFields[$versionField]->getValue($entity); - $types[] = $this->_class->fieldMappings[$versionField]['type']; - } - - $sql = 'UPDATE ' . $quotedTableName - . ' SET ' . implode(', ', $set) - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; - - $result = $this->_conn->executeUpdate($sql, $params, $types); - - if ($versioned && ! $result) { - throw OptimisticLockException::lockFailed($entity); - } - } - - /** - * @todo Add check for platform if it supports foreign keys/cascading. - * @param array $identifier - * @return void - */ - protected function deleteJoinTableRecords($identifier) - { - foreach ($this->_class->associationMappings as $mapping) { - if ($mapping['type'] == ClassMetadata::MANY_TO_MANY) { - // @Todo this only covers scenarios with no inheritance or of the same level. Is there something - // like self-referential relationship between different levels of an inheritance hierachy? I hope not! - $selfReferential = ($mapping['targetEntity'] == $mapping['sourceEntity']); - - if ( ! $mapping['isOwningSide']) { - $relatedClass = $this->_em->getClassMetadata($mapping['targetEntity']); - $mapping = $relatedClass->associationMappings[$mapping['mappedBy']]; - $keys = array_keys($mapping['relationToTargetKeyColumns']); - - if ($selfReferential) { - $otherKeys = array_keys($mapping['relationToSourceKeyColumns']); - } - } else { - $keys = array_keys($mapping['relationToSourceKeyColumns']); - - if ($selfReferential) { - $otherKeys = array_keys($mapping['relationToTargetKeyColumns']); - } - } - - if ( ! isset($mapping['isOnDeleteCascade'])) { - $this->_conn->delete( - $this->_class->getQuotedJoinTableName($mapping, $this->_platform), - array_combine($keys, $identifier) - ); - - if ($selfReferential) { - $this->_conn->delete( - $this->_class->getQuotedJoinTableName($mapping, $this->_platform), - array_combine($otherKeys, $identifier) - ); - } - } - } - } - } - - /** - * Deletes a managed entity. - * - * The entity to delete must be managed and have a persistent identifier. - * The deletion happens instantaneously. - * - * Subclasses may override this method to customize the semantics of entity deletion. - * - * @param object $entity The entity to delete. - */ - public function delete($entity) - { - $identifier = $this->_em->getUnitOfWork()->getEntityIdentifier($entity); - $this->deleteJoinTableRecords($identifier); - - $id = array_combine($this->_class->getIdentifierColumnNames(), $identifier); - $this->_conn->delete($this->_class->getQuotedTableName($this->_platform), $id); - } - - /** - * Prepares the changeset of an entity for database insertion (UPDATE). - * - * The changeset is obtained from the currently running UnitOfWork. - * - * During this preparation the array that is passed as the second parameter is filled with - * => pairs, grouped by table name. - * - * Example: - * - * array( - * 'foo_table' => array('column1' => 'value1', 'column2' => 'value2', ...), - * 'bar_table' => array('columnX' => 'valueX', 'columnY' => 'valueY', ...), - * ... - * ) - * - * - * @param object $entity The entity for which to prepare the data. - * @return array The prepared data. - */ - protected function _prepareUpdateData($entity) - { - $result = array(); - $uow = $this->_em->getUnitOfWork(); - - if (($versioned = $this->_class->isVersioned) != false) { - $versionField = $this->_class->versionField; - } - - foreach ($uow->getEntityChangeSet($entity) as $field => $change) { - if ($versioned && $versionField == $field) { - continue; - } - - $oldVal = $change[0]; - $newVal = $change[1]; - - if (isset($this->_class->associationMappings[$field])) { - $assoc = $this->_class->associationMappings[$field]; - - // Only owning side of x-1 associations can have a FK column. - if ( ! $assoc['isOwningSide'] || ! ($assoc['type'] & ClassMetadata::TO_ONE)) { - continue; - } - - if ($newVal !== null) { - $oid = spl_object_hash($newVal); - - if (isset($this->_queuedInserts[$oid]) || $uow->isScheduledForInsert($newVal)) { - // The associated entity $newVal is not yet persisted, so we must - // set $newVal = null, in order to insert a null value and schedule an - // extra update on the UnitOfWork. - $uow->scheduleExtraUpdate($entity, array( - $field => array(null, $newVal) - )); - $newVal = null; - } - } - - if ($newVal !== null) { - $newValId = $uow->getEntityIdentifier($newVal); - } - - $targetClass = $this->_em->getClassMetadata($assoc['targetEntity']); - $owningTable = $this->getOwningTable($field); - - foreach ($assoc['sourceToTargetKeyColumns'] as $sourceColumn => $targetColumn) { - if ($newVal === null) { - $result[$owningTable][$sourceColumn] = null; - } else if ($targetClass->containsForeignIdentifier) { - $result[$owningTable][$sourceColumn] = $newValId[$targetClass->getFieldForColumn($targetColumn)]; - } else { - $result[$owningTable][$sourceColumn] = $newValId[$targetClass->fieldNames[$targetColumn]]; - } - - $this->_columnTypes[$sourceColumn] = $targetClass->getTypeOfColumn($targetColumn); - } - } else { - $columnName = $this->_class->columnNames[$field]; - $this->_columnTypes[$columnName] = $this->_class->fieldMappings[$field]['type']; - $result[$this->getOwningTable($field)][$columnName] = $newVal; - } - } - - return $result; - } - - /** - * Prepares the data changeset of a managed entity for database insertion (initial INSERT). - * The changeset of the entity is obtained from the currently running UnitOfWork. - * - * The default insert data preparation is the same as for updates. - * - * @param object $entity The entity for which to prepare the data. - * @return array The prepared data for the tables to update. - * @see _prepareUpdateData - */ - protected function _prepareInsertData($entity) - { - return $this->_prepareUpdateData($entity); - } - - /** - * Gets the name of the table that owns the column the given field is mapped to. - * - * The default implementation in BasicEntityPersister always returns the name - * of the table the entity type of this persister is mapped to, since an entity - * is always persisted to a single table with a BasicEntityPersister. - * - * @param string $fieldName The field name. - * @return string The table name. - */ - public function getOwningTable($fieldName) - { - return $this->_class->getTableName(); - } - - /** - * Loads an entity by a list of field criteria. - * - * @param array $criteria The criteria by which to load the entity. - * @param object $entity The entity to load the data into. If not specified, - * a new entity is created. - * @param $assoc The association that connects the entity to load to another entity, if any. - * @param array $hints Hints for entity creation. - * @param int $lockMode - * @param int $limit Limit number of results - * @return object The loaded and managed entity instance or NULL if the entity can not be found. - * @todo Check identity map? loadById method? Try to guess whether $criteria is the id? - */ - public function load(array $criteria, $entity = null, $assoc = null, array $hints = array(), $lockMode = 0, $limit = null) - { - $sql = $this->_getSelectEntitiesSQL($criteria, $assoc, $lockMode, $limit); - list($params, $types) = $this->expandParameters($criteria); - $stmt = $this->_conn->executeQuery($sql, $params, $types); - - if ($entity !== null) { - $hints[Query::HINT_REFRESH] = true; - $hints[Query::HINT_REFRESH_ENTITY] = $entity; - } - - $hydrator = $this->_em->newHydrator($this->_selectJoinSql ? Query::HYDRATE_OBJECT : Query::HYDRATE_SIMPLEOBJECT); - $entities = $hydrator->hydrateAll($stmt, $this->_rsm, $hints); - - return $entities ? $entities[0] : null; - } - - /** - * Loads an entity of this persister's mapped class as part of a single-valued - * association from another entity. - * - * @param array $assoc The association to load. - * @param object $sourceEntity The entity that owns the association (not necessarily the "owning side"). - * @param array $identifier The identifier of the entity to load. Must be provided if - * the association to load represents the owning side, otherwise - * the identifier is derived from the $sourceEntity. - * @return object The loaded and managed entity instance or NULL if the entity can not be found. - */ - public function loadOneToOneEntity(array $assoc, $sourceEntity, array $identifier = array()) - { - if (($foundEntity = $this->_em->getUnitOfWork()->tryGetById($identifier, $assoc['targetEntity'])) != false) { - return $foundEntity; - } - - $targetClass = $this->_em->getClassMetadata($assoc['targetEntity']); - - if ($assoc['isOwningSide']) { - $isInverseSingleValued = $assoc['inversedBy'] && ! $targetClass->isCollectionValuedAssociation($assoc['inversedBy']); - - // Mark inverse side as fetched in the hints, otherwise the UoW would - // try to load it in a separate query (remember: to-one inverse sides can not be lazy). - $hints = array(); - - if ($isInverseSingleValued) { - $hints['fetched']["r"][$assoc['inversedBy']] = true; - } - - /* cascade read-only status - if ($this->_em->getUnitOfWork()->isReadOnly($sourceEntity)) { - $hints[Query::HINT_READ_ONLY] = true; - } - */ - - $targetEntity = $this->load($identifier, null, $assoc, $hints); - - // Complete bidirectional association, if necessary - if ($targetEntity !== null && $isInverseSingleValued) { - $targetClass->reflFields[$assoc['inversedBy']]->setValue($targetEntity, $sourceEntity); - } - } else { - $sourceClass = $this->_em->getClassMetadata($assoc['sourceEntity']); - $owningAssoc = $targetClass->getAssociationMapping($assoc['mappedBy']); - - // TRICKY: since the association is specular source and target are flipped - foreach ($owningAssoc['targetToSourceKeyColumns'] as $sourceKeyColumn => $targetKeyColumn) { - if ( ! isset($sourceClass->fieldNames[$sourceKeyColumn])) { - throw MappingException::joinColumnMustPointToMappedField( - $sourceClass->name, $sourceKeyColumn - ); - } - - // unset the old value and set the new sql aliased value here. By definition - // unset($identifier[$targetKeyColumn] works here with how UnitOfWork::createEntity() calls this method. - $identifier[$this->_getSQLTableAlias($targetClass->name) . "." . $targetKeyColumn] = - $sourceClass->reflFields[$sourceClass->fieldNames[$sourceKeyColumn]]->getValue($sourceEntity); - - unset($identifier[$targetKeyColumn]); - } - - $targetEntity = $this->load($identifier, null, $assoc); - - if ($targetEntity !== null) { - $targetClass->setFieldValue($targetEntity, $assoc['mappedBy'], $sourceEntity); - } - } - - return $targetEntity; - } - - /** - * Refreshes a managed entity. - * - * @param array $id The identifier of the entity as an associative array from - * column or field names to values. - * @param object $entity The entity to refresh. - */ - public function refresh(array $id, $entity, $lockMode = 0) - { - $sql = $this->_getSelectEntitiesSQL($id, null, $lockMode); - list($params, $types) = $this->expandParameters($id); - $stmt = $this->_conn->executeQuery($sql, $params, $types); - - $hydrator = $this->_em->newHydrator(Query::HYDRATE_OBJECT); - $hydrator->hydrateAll($stmt, $this->_rsm, array(Query::HINT_REFRESH => true)); - } - - /** - * Loads a list of entities by a list of field criteria. - * - * @param array $criteria - * @param array $orderBy - * @param int $limit - * @param int $offset - * @return array - */ - public function loadAll(array $criteria = array(), array $orderBy = null, $limit = null, $offset = null) - { - $entities = array(); - $sql = $this->_getSelectEntitiesSQL($criteria, null, 0, $limit, $offset, $orderBy); - list($params, $types) = $this->expandParameters($criteria); - $stmt = $this->_conn->executeQuery($sql, $params, $types); - - $hydrator = $this->_em->newHydrator(($this->_selectJoinSql) ? Query::HYDRATE_OBJECT : Query::HYDRATE_SIMPLEOBJECT); - - return $hydrator->hydrateAll($stmt, $this->_rsm, array('deferEagerLoads' => true)); - } - - /** - * Get (sliced or full) elements of the given collection. - * - * @param array $assoc - * @param object $sourceEntity - * @param int|null $offset - * @param int|null $limit - * @return array - */ - public function getManyToManyCollection(array $assoc, $sourceEntity, $offset = null, $limit = null) - { - $stmt = $this->getManyToManyStatement($assoc, $sourceEntity, $offset, $limit); - - return $this->loadArrayFromStatement($assoc, $stmt); - } - - /** - * Load an array of entities from a given dbal statement. - * - * @param array $assoc - * @param \Doctrine\DBAL\Statement $stmt - * - * @return array - */ - private function loadArrayFromStatement($assoc, $stmt) - { - $hints = array('deferEagerLoads' => true); - - if (isset($assoc['indexBy'])) { - $rsm = clone ($this->_rsm); // this is necessary because the "default rsm" should be changed. - $rsm->addIndexBy('r', $assoc['indexBy']); - } else { - $rsm = $this->_rsm; - } - - $hydrator = $this->_em->newHydrator(Query::HYDRATE_OBJECT); - - return $hydrator->hydrateAll($stmt, $rsm, $hints); - } - - /** - * Hydrate a collection from a given dbal statement. - * - * @param array $assoc - * @param \Doctrine\DBAL\Statement $stmt - * @param PersistentCollection $coll - * - * @return array - */ - private function loadCollectionFromStatement($assoc, $stmt, $coll) - { - $hints = array('deferEagerLoads' => true, 'collection' => $coll); - - if (isset($assoc['indexBy'])) { - $rsm = clone ($this->_rsm); // this is necessary because the "default rsm" should be changed. - $rsm->addIndexBy('r', $assoc['indexBy']); - } else { - $rsm = $this->_rsm; - } - - $hydrator = $this->_em->newHydrator(Query::HYDRATE_OBJECT); - - return $hydrator->hydrateAll($stmt, $rsm, $hints); - } - - /** - * Loads a collection of entities of a many-to-many association. - * - * @param ManyToManyMapping $assoc The association mapping of the association being loaded. - * @param object $sourceEntity The entity that owns the collection. - * @param PersistentCollection $coll The collection to fill. - * @param int|null $offset - * @param int|null $limit - * @return array - */ - public function loadManyToManyCollection(array $assoc, $sourceEntity, PersistentCollection $coll) - { - $stmt = $this->getManyToManyStatement($assoc, $sourceEntity); - - return $this->loadCollectionFromStatement($assoc, $stmt, $coll); - } - - private function getManyToManyStatement(array $assoc, $sourceEntity, $offset = null, $limit = null) - { - $criteria = array(); - $sourceClass = $this->_em->getClassMetadata($assoc['sourceEntity']); - - if ($assoc['isOwningSide']) { - $quotedJoinTable = $sourceClass->getQuotedJoinTableName($assoc, $this->_platform); - - foreach ($assoc['relationToSourceKeyColumns'] as $relationKeyColumn => $sourceKeyColumn) { - if ($sourceClass->containsForeignIdentifier) { - $field = $sourceClass->getFieldForColumn($sourceKeyColumn); - $value = $sourceClass->reflFields[$field]->getValue($sourceEntity); - - if (isset($sourceClass->associationMappings[$field])) { - $value = $this->_em->getUnitOfWork()->getEntityIdentifier($value); - $value = $value[$this->_em->getClassMetadata($sourceClass->associationMappings[$field]['targetEntity'])->identifier[0]]; - } - - $criteria[$quotedJoinTable . "." . $relationKeyColumn] = $value; - } else if (isset($sourceClass->fieldNames[$sourceKeyColumn])) { - $criteria[$quotedJoinTable . "." . $relationKeyColumn] = $sourceClass->reflFields[$sourceClass->fieldNames[$sourceKeyColumn]]->getValue($sourceEntity); - } else { - throw MappingException::joinColumnMustPointToMappedField( - $sourceClass->name, $sourceKeyColumn - ); - } - } - } else { - $owningAssoc = $this->_em->getClassMetadata($assoc['targetEntity'])->associationMappings[$assoc['mappedBy']]; - $quotedJoinTable = $sourceClass->getQuotedJoinTableName($owningAssoc, $this->_platform); - - // TRICKY: since the association is inverted source and target are flipped - foreach ($owningAssoc['relationToTargetKeyColumns'] as $relationKeyColumn => $sourceKeyColumn) { - if ($sourceClass->containsForeignIdentifier) { - $field = $sourceClass->getFieldForColumn($sourceKeyColumn); - $value = $sourceClass->reflFields[$field]->getValue($sourceEntity); - - if (isset($sourceClass->associationMappings[$field])) { - $value = $this->_em->getUnitOfWork()->getEntityIdentifier($value); - $value = $value[$this->_em->getClassMetadata($sourceClass->associationMappings[$field]['targetEntity'])->identifier[0]]; - } - - $criteria[$quotedJoinTable . "." . $relationKeyColumn] = $value; - } else if (isset($sourceClass->fieldNames[$sourceKeyColumn])) { - $criteria[$quotedJoinTable . "." . $relationKeyColumn] = $sourceClass->reflFields[$sourceClass->fieldNames[$sourceKeyColumn]]->getValue($sourceEntity); - } else { - throw MappingException::joinColumnMustPointToMappedField( - $sourceClass->name, $sourceKeyColumn - ); - } - } - } - - $sql = $this->_getSelectEntitiesSQL($criteria, $assoc, 0, $limit, $offset); - list($params, $types) = $this->expandParameters($criteria); - - return $this->_conn->executeQuery($sql, $params, $types); - } - - /** - * Gets the SELECT SQL to select one or more entities by a set of field criteria. - * - * @param array $criteria - * @param AssociationMapping $assoc - * @param string $orderBy - * @param int $lockMode - * @param int $limit - * @param int $offset - * @param array $orderBy - * @return string - * @todo Refactor: _getSelectSQL(...) - */ - protected function _getSelectEntitiesSQL(array $criteria, $assoc = null, $lockMode = 0, $limit = null, $offset = null, array $orderBy = null) - { - $joinSql = ($assoc != null && $assoc['type'] == ClassMetadata::MANY_TO_MANY) ? $this->_getSelectManyToManyJoinSQL($assoc) : ''; - $conditionSql = $this->_getSelectConditionSQL($criteria, $assoc); - - $orderBy = ($assoc !== null && isset($assoc['orderBy'])) ? $assoc['orderBy'] : $orderBy; - $orderBySql = $orderBy ? $this->_getOrderBySQL($orderBy, $this->_getSQLTableAlias($this->_class->name)) : ''; - - $lockSql = ''; - - if ($lockMode == LockMode::PESSIMISTIC_READ) { - $lockSql = ' ' . $this->_platform->getReadLockSql(); - } else if ($lockMode == LockMode::PESSIMISTIC_WRITE) { - $lockSql = ' ' . $this->_platform->getWriteLockSql(); - } - - $alias = $this->_getSQLTableAlias($this->_class->name); - - if ($filterSql = $this->generateFilterConditionSQL($this->_class, $alias)) { - if ($conditionSql) { - $conditionSql .= ' AND '; - } - - $conditionSql .= $filterSql; - } - - return $this->_platform->modifyLimitQuery('SELECT ' . $this->_getSelectColumnListSQL() - . $this->_platform->appendLockHint(' FROM ' . $this->_class->getQuotedTableName($this->_platform) . ' ' - . $alias, $lockMode) - . $this->_selectJoinSql . $joinSql - . ($conditionSql ? ' WHERE ' . $conditionSql : '') - . $orderBySql, $limit, $offset) - . $lockSql; - } - - /** - * Gets the ORDER BY SQL snippet for ordered collections. - * - * @param array $orderBy - * @param string $baseTableAlias - * @return string - */ - protected final function _getOrderBySQL(array $orderBy, $baseTableAlias) - { - $orderBySql = ''; - - foreach ($orderBy as $fieldName => $orientation) { - if ( ! isset($this->_class->fieldMappings[$fieldName])) { - throw ORMException::unrecognizedField($fieldName); - } - - $orientation = strtoupper(trim($orientation)); - if ($orientation != 'ASC' && $orientation != 'DESC') { - throw ORMException::invalidOrientation($this->_class->name, $fieldName); - } - - $tableAlias = isset($this->_class->fieldMappings[$fieldName]['inherited']) ? - $this->_getSQLTableAlias($this->_class->fieldMappings[$fieldName]['inherited']) - : $baseTableAlias; - - $columnName = $this->_class->getQuotedColumnName($fieldName, $this->_platform); - - $orderBySql .= $orderBySql ? ', ' : ' ORDER BY '; - $orderBySql .= $tableAlias . '.' . $columnName . ' ' . $orientation; - } - - return $orderBySql; - } - - /** - * Gets the SQL fragment with the list of columns to select when querying for - * an entity in this persister. - * - * Subclasses should override this method to alter or change the select column - * list SQL fragment. Note that in the implementation of BasicEntityPersister - * the resulting SQL fragment is generated only once and cached in {@link _selectColumnListSql}. - * Subclasses may or may not do the same. - * - * @return string The SQL fragment. - * @todo Rename: _getSelectColumnsSQL() - */ - protected function _getSelectColumnListSQL() - { - if ($this->_selectColumnListSql !== null) { - return $this->_selectColumnListSql; - } - - $columnList = ''; - $this->_rsm = new Query\ResultSetMapping(); - $this->_rsm->addEntityResult($this->_class->name, 'r'); // r for root - - // Add regular columns to select list - foreach ($this->_class->fieldNames as $field) { - if ($columnList) $columnList .= ', '; - - $columnList .= $this->_getSelectColumnSQL($field, $this->_class); - } - - $this->_selectJoinSql = ''; - $eagerAliasCounter = 0; - - foreach ($this->_class->associationMappings as $assocField => $assoc) { - $assocColumnSQL = $this->_getSelectColumnAssociationSQL($assocField, $assoc, $this->_class); - - if ($assocColumnSQL) { - if ($columnList) $columnList .= ', '; - - $columnList .= $assocColumnSQL; - } - - if ($assoc['type'] & ClassMetadata::TO_ONE && ($assoc['fetch'] == ClassMetadata::FETCH_EAGER || !$assoc['isOwningSide'])) { - $eagerEntity = $this->_em->getClassMetadata($assoc['targetEntity']); - - if ($eagerEntity->inheritanceType != ClassMetadata::INHERITANCE_TYPE_NONE) { - continue; // now this is why you shouldn't use inheritance - } - - $assocAlias = 'e' . ($eagerAliasCounter++); - $this->_rsm->addJoinedEntityResult($assoc['targetEntity'], $assocAlias, 'r', $assocField); - - foreach ($eagerEntity->fieldNames AS $field) { - if ($columnList) $columnList .= ', '; - - $columnList .= $this->_getSelectColumnSQL($field, $eagerEntity, $assocAlias); - } - - foreach ($eagerEntity->associationMappings as $assoc2Field => $assoc2) { - $assoc2ColumnSQL = $this->_getSelectColumnAssociationSQL($assoc2Field, $assoc2, $eagerEntity, $assocAlias); - - if ($assoc2ColumnSQL) { - if ($columnList) $columnList .= ', '; - $columnList .= $assoc2ColumnSQL; - } - } - $first = true; - - if ($assoc['isOwningSide']) { - $this->_selectJoinSql .= ' ' . $this->getJoinSQLForJoinColumns($assoc['joinColumns']); - $this->_selectJoinSql .= ' ' . $eagerEntity->getQuotedTableName($this->_platform) . ' ' . $this->_getSQLTableAlias($eagerEntity->name, $assocAlias) .' ON '; - - $tableAlias = $this->_getSQLTableAlias($assoc['targetEntity'], $assocAlias); - foreach ($assoc['sourceToTargetKeyColumns'] AS $sourceCol => $targetCol) { - if ( ! $first) { - $this->_selectJoinSql .= ' AND '; - } - $this->_selectJoinSql .= $this->_getSQLTableAlias($assoc['sourceEntity']) . '.' . $sourceCol . ' = ' - . $tableAlias . '.' . $targetCol; - $first = false; - } - - // Add filter SQL - if ($filterSql = $this->generateFilterConditionSQL($eagerEntity, $tableAlias)) { - $this->_selectJoinSql .= ' AND ' . $filterSql; - } - } else { - $eagerEntity = $this->_em->getClassMetadata($assoc['targetEntity']); - $owningAssoc = $eagerEntity->getAssociationMapping($assoc['mappedBy']); - - $this->_selectJoinSql .= ' LEFT JOIN'; - $this->_selectJoinSql .= ' ' . $eagerEntity->getQuotedTableName($this->_platform) . ' ' - . $this->_getSQLTableAlias($eagerEntity->name, $assocAlias) . ' ON '; - - foreach ($owningAssoc['sourceToTargetKeyColumns'] AS $sourceCol => $targetCol) { - if ( ! $first) { - $this->_selectJoinSql .= ' AND '; - } - - $this->_selectJoinSql .= $this->_getSQLTableAlias($owningAssoc['sourceEntity'], $assocAlias) . '.' . $sourceCol . ' = ' - . $this->_getSQLTableAlias($owningAssoc['targetEntity']) . '.' . $targetCol; - $first = false; - } - } - } - } - - $this->_selectColumnListSql = $columnList; - - return $this->_selectColumnListSql; - } - - /** - * Gets the SQL join fragment used when selecting entities from an association. - * - * @param string $field - * @param array $assoc - * @param ClassMetadata $class - * @param string $alias - * - * @return string - */ - protected function _getSelectColumnAssociationSQL($field, $assoc, ClassMetadata $class, $alias = 'r') - { - $columnList = ''; - - if ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) { - foreach ($assoc['targetToSourceKeyColumns'] as $srcColumn) { - if ($columnList) $columnList .= ', '; - - $resultColumnName = $this->getSQLColumnAlias($srcColumn); - $columnList .= $this->_getSQLTableAlias($class->name, ($alias == 'r' ? '' : $alias) ) - . '.' . $srcColumn . ' AS ' . $resultColumnName; - $this->_rsm->addMetaResult($alias, $resultColumnName, $srcColumn, isset($assoc['id']) && $assoc['id'] === true); - } - } - - return $columnList; - } - - /** - * Gets the SQL join fragment used when selecting entities from a - * many-to-many association. - * - * @param ManyToManyMapping $manyToMany - * @return string - */ - protected function _getSelectManyToManyJoinSQL(array $manyToMany) - { - if ($manyToMany['isOwningSide']) { - $owningAssoc = $manyToMany; - $joinClauses = $manyToMany['relationToTargetKeyColumns']; - } else { - $owningAssoc = $this->_em->getClassMetadata($manyToMany['targetEntity'])->associationMappings[$manyToMany['mappedBy']]; - $joinClauses = $owningAssoc['relationToSourceKeyColumns']; - } - - $joinTableName = $this->_class->getQuotedJoinTableName($owningAssoc, $this->_platform); - $joinSql = ''; - - foreach ($joinClauses as $joinTableColumn => $sourceColumn) { - if ($joinSql != '') $joinSql .= ' AND '; - - if ($this->_class->containsForeignIdentifier && ! isset($this->_class->fieldNames[$sourceColumn])) { - $quotedColumn = $sourceColumn; // join columns cannot be quoted - } else { - $quotedColumn = $this->_class->getQuotedColumnName($this->_class->fieldNames[$sourceColumn], $this->_platform); - } - - $joinSql .= $this->_getSQLTableAlias($this->_class->name) . '.' . $quotedColumn . ' = ' - . $joinTableName . '.' . $joinTableColumn; - } - - return ' INNER JOIN ' . $joinTableName . ' ON ' . $joinSql; - } - - /** - * Gets the INSERT SQL used by the persister to persist a new entity. - * - * @return string - */ - protected function _getInsertSQL() - { - if ($this->_insertSql === null) { - $insertSql = ''; - $columns = $this->_getInsertColumnList(); - - if (empty($columns)) { - $insertSql = $this->_platform->getEmptyIdentityInsertSQL( - $this->_class->getQuotedTableName($this->_platform), - $this->_class->getQuotedColumnName($this->_class->identifier[0], $this->_platform) - ); - } else { - $columns = array_unique($columns); - - $values = array(); - foreach ($columns AS $column) { - $placeholder = '?'; - - if (isset($this->_columnTypes[$column]) && - isset($this->_class->fieldNames[$column]) && - isset($this->_class->fieldMappings[$this->_class->fieldNames[$column]]['requireSQLConversion'])) { - $type = Type::getType($this->_columnTypes[$column]); - $placeholder = $type->convertToDatabaseValueSQL('?', $this->_platform); - } - - $values[] = $placeholder; - } - - $insertSql = 'INSERT INTO ' . $this->_class->getQuotedTableName($this->_platform) - . ' (' . implode(', ', $columns) . ') VALUES (' . implode(', ', $values) . ')'; - } - - $this->_insertSql = $insertSql; - } - - return $this->_insertSql; - } - - /** - * Gets the list of columns to put in the INSERT SQL statement. - * - * Subclasses should override this method to alter or change the list of - * columns placed in the INSERT statements used by the persister. - * - * @return array The list of columns. - */ - protected function _getInsertColumnList() - { - $columns = array(); - - foreach ($this->_class->reflFields as $name => $field) { - if ($this->_class->isVersioned && $this->_class->versionField == $name) { - continue; - } - - if (isset($this->_class->associationMappings[$name])) { - $assoc = $this->_class->associationMappings[$name]; - - if ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) { - foreach ($assoc['targetToSourceKeyColumns'] as $sourceCol) { - $columns[] = $sourceCol; - } - } - } else if ($this->_class->generatorType != ClassMetadata::GENERATOR_TYPE_IDENTITY || $this->_class->identifier[0] != $name) { - $columns[] = $this->_class->getQuotedColumnName($name, $this->_platform); - $this->_columnTypes[$name] = $this->_class->fieldMappings[$name]['type']; - } - } - - return $columns; - } - - /** - * Gets the SQL snippet of a qualified column name for the given field name. - * - * @param string $field The field name. - * @param ClassMetadata $class The class that declares this field. The table this class is - * mapped to must own the column for the given field. - * @param string $alias - */ - protected function _getSelectColumnSQL($field, ClassMetadata $class, $alias = 'r') - { - $sql = $this->_getSQLTableAlias($class->name, $alias == 'r' ? '' : $alias) - . '.' . $class->getQuotedColumnName($field, $this->_platform); - $columnAlias = $this->getSQLColumnAlias($class->columnNames[$field]); - - $this->_rsm->addFieldResult($alias, $columnAlias, $field); - - if (isset($class->fieldMappings[$field]['requireSQLConversion'])) { - $type = Type::getType($class->getTypeOfField($field)); - $sql = $type->convertToPHPValueSQL($sql, $this->_platform); - } - - return $sql . ' AS ' . $columnAlias; - } - - /** - * Gets the SQL table alias for the given class name. - * - * @param string $className - * @return string The SQL table alias. - * @todo Reconsider. Binding table aliases to class names is not such a good idea. - */ - protected function _getSQLTableAlias($className, $assocName = '') - { - if ($assocName) { - $className .= '#' . $assocName; - } - - if (isset($this->_sqlTableAliases[$className])) { - return $this->_sqlTableAliases[$className]; - } - - $tableAlias = 't' . $this->_sqlAliasCounter++; - - $this->_sqlTableAliases[$className] = $tableAlias; - - return $tableAlias; - } - - /** - * Lock all rows of this entity matching the given criteria with the specified pessimistic lock mode - * - * @param array $criteria - * @param int $lockMode - * @return void - */ - public function lock(array $criteria, $lockMode) - { - $conditionSql = $this->_getSelectConditionSQL($criteria); - - if ($lockMode == LockMode::PESSIMISTIC_READ) { - $lockSql = $this->_platform->getReadLockSql(); - } else if ($lockMode == LockMode::PESSIMISTIC_WRITE) { - $lockSql = $this->_platform->getWriteLockSql(); - } - - $sql = 'SELECT 1 ' - . $this->_platform->appendLockHint($this->getLockTablesSql(), $lockMode) - . ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' ' . $lockSql; - - list($params, $types) = $this->expandParameters($criteria); - - $stmt = $this->_conn->executeQuery($sql, $params, $types); - } - - /** - * Get the FROM and optionally JOIN conditions to lock the entity managed by this persister. - * - * @return string - */ - protected function getLockTablesSql() - { - return 'FROM ' . $this->_class->getQuotedTableName($this->_platform) . ' ' - . $this->_getSQLTableAlias($this->_class->name); - } - - /** - * Gets the conditional SQL fragment used in the WHERE clause when selecting - * entities in this persister. - * - * Subclasses are supposed to override this method if they intend to change - * or alter the criteria by which entities are selected. - * - * @param array $criteria - * @param AssociationMapping $assoc - * @return string - */ - protected function _getSelectConditionSQL(array $criteria, $assoc = null) - { - $conditionSql = ''; - - foreach ($criteria as $field => $value) { - $conditionSql .= $conditionSql ? ' AND ' : ''; - - $placeholder = '?'; - - if (isset($this->_class->columnNames[$field])) { - $className = (isset($this->_class->fieldMappings[$field]['inherited'])) - ? $this->_class->fieldMappings[$field]['inherited'] - : $this->_class->name; - - $conditionSql .= $this->_getSQLTableAlias($className) . '.' . $this->_class->getQuotedColumnName($field, $this->_platform); - - if (isset($this->_class->fieldMappings[$field]['requireSQLConversion'])) { - $type = Type::getType($this->_class->getTypeOfField($field)); - $placeholder = $type->convertToDatabaseValueSQL($placeholder, $this->_platform); - } - } else if (isset($this->_class->associationMappings[$field])) { - if ( ! $this->_class->associationMappings[$field]['isOwningSide']) { - throw ORMException::invalidFindByInverseAssociation($this->_class->name, $field); - } - - $className = (isset($this->_class->associationMappings[$field]['inherited'])) - ? $this->_class->associationMappings[$field]['inherited'] - : $this->_class->name; - - $conditionSql .= $this->_getSQLTableAlias($className) . '.' . $this->_class->associationMappings[$field]['joinColumns'][0]['name']; - } else if ($assoc !== null && strpos($field, " ") === false && strpos($field, "(") === false) { - // very careless developers could potentially open up this normally hidden api for userland attacks, - // therefore checking for spaces and function calls which are not allowed. - - // found a join column condition, not really a "field" - $conditionSql .= $field; - } else { - throw ORMException::unrecognizedField($field); - } - - $conditionSql .= (is_array($value)) ? ' IN (?)' : (($value === null) ? ' IS NULL' : ' = ' . $placeholder); - } - return $conditionSql; - } - - /** - * Return an array with (sliced or full list) of elements in the specified collection. - * - * @param array $assoc - * @param object $sourceEntity - * @param int $offset - * @param int $limit - * @return array - */ - public function getOneToManyCollection(array $assoc, $sourceEntity, $offset = null, $limit = null) - { - $stmt = $this->getOneToManyStatement($assoc, $sourceEntity, $offset, $limit); - - return $this->loadArrayFromStatement($assoc, $stmt); - } - - /** - * Loads a collection of entities in a one-to-many association. - * - * @param array $assoc - * @param object $sourceEntity - * @param PersistentCollection $coll The collection to load/fill. - * @param int|null $offset - * @param int|null $limit - */ - public function loadOneToManyCollection(array $assoc, $sourceEntity, PersistentCollection $coll) - { - $stmt = $this->getOneToManyStatement($assoc, $sourceEntity); - - return $this->loadCollectionFromStatement($assoc, $stmt, $coll); - } - - /** - * Build criteria and execute SQL statement to fetch the one to many entities from. - * - * @param array $assoc - * @param object $sourceEntity - * @param int|null $offset - * @param int|null $limit - * @return \Doctrine\DBAL\Statement - */ - private function getOneToManyStatement(array $assoc, $sourceEntity, $offset = null, $limit = null) - { - $criteria = array(); - $owningAssoc = $this->_class->associationMappings[$assoc['mappedBy']]; - $sourceClass = $this->_em->getClassMetadata($assoc['sourceEntity']); - - $tableAlias = $this->_getSQLTableAlias(isset($owningAssoc['inherited']) ? $owningAssoc['inherited'] : $this->_class->name); - - foreach ($owningAssoc['targetToSourceKeyColumns'] as $sourceKeyColumn => $targetKeyColumn) { - if ($sourceClass->containsForeignIdentifier) { - $field = $sourceClass->getFieldForColumn($sourceKeyColumn); - $value = $sourceClass->reflFields[$field]->getValue($sourceEntity); - - if (isset($sourceClass->associationMappings[$field])) { - $value = $this->_em->getUnitOfWork()->getEntityIdentifier($value); - $value = $value[$this->_em->getClassMetadata($sourceClass->associationMappings[$field]['targetEntity'])->identifier[0]]; - } - - $criteria[$tableAlias . "." . $targetKeyColumn] = $value; - } else { - $criteria[$tableAlias . "." . $targetKeyColumn] = $sourceClass->reflFields[$sourceClass->fieldNames[$sourceKeyColumn]]->getValue($sourceEntity); - } - } - - $sql = $this->_getSelectEntitiesSQL($criteria, $assoc, 0, $limit, $offset); - list($params, $types) = $this->expandParameters($criteria); - - return $this->_conn->executeQuery($sql, $params, $types); - } - - /** - * Expand the parameters from the given criteria and use the correct binding types if found. - * - * @param array $criteria - * @return array - */ - private function expandParameters($criteria) - { - $params = $types = array(); - - foreach ($criteria AS $field => $value) { - if ($value === null) { - continue; // skip null values. - } - - $types[] = $this->getType($field, $value); - $params[] = $this->getValue($value); - } - - return array($params, $types); - } - - /** - * Infer field type to be used by parameter type casting. - * - * @param string $field - * @param mixed $value - * @return integer - */ - private function getType($field, $value) - { - switch (true) { - case (isset($this->_class->fieldMappings[$field])): - $type = $this->_class->fieldMappings[$field]['type']; - break; - - case (isset($this->_class->associationMappings[$field])): - $assoc = $this->_class->associationMappings[$field]; - - if (count($assoc['sourceToTargetKeyColumns']) > 1) { - throw Query\QueryException::associationPathCompositeKeyNotSupported(); - } - - $targetClass = $this->_em->getClassMetadata($assoc['targetEntity']); - $targetColumn = $assoc['joinColumns'][0]['referencedColumnName']; - $type = null; - - if (isset($targetClass->fieldNames[$targetColumn])) { - $type = $targetClass->fieldMappings[$targetClass->fieldNames[$targetColumn]]['type']; - } - - break; - - default: - $type = null; - } - if (is_array($value)) { - $type = Type::getType( $type )->getBindingType(); - $type += Connection::ARRAY_PARAM_OFFSET; - } - - return $type; - } - - /** - * Retrieve parameter value - * - * @param mixed $value - * @return mixed - */ - private function getValue($value) - { - if (is_array($value)) { - $newValue = array(); - - foreach ($value as $itemValue) { - $newValue[] = $this->getIndividualValue($itemValue); - } - - return $newValue; - } - - return $this->getIndividualValue($value); - } - - /** - * Retrieve an invidiual parameter value - * - * @param mixed $value - * @return mixed - */ - private function getIndividualValue($value) - { - if (is_object($value) && $this->_em->getMetadataFactory()->hasMetadataFor(get_class($value))) { - if ($this->_em->getUnitOfWork()->getEntityState($value) === UnitOfWork::STATE_MANAGED) { - $idValues = $this->_em->getUnitOfWork()->getEntityIdentifier($value); - } else { - $class = $this->_em->getClassMetadata(get_class($value)); - $idValues = $class->getIdentifierValues($value); - } - - $value = $idValues[key($idValues)]; - } - - return $value; - } - - /** - * Checks whether the given managed entity exists in the database. - * - * @param object $entity - * @return boolean TRUE if the entity exists in the database, FALSE otherwise. - */ - public function exists($entity, array $extraConditions = array()) - { - $criteria = $this->_class->getIdentifierValues($entity); - - if ( ! $criteria) { - return false; - } - - if ($extraConditions) { - $criteria = array_merge($criteria, $extraConditions); - } - - $alias = $this->_getSQLTableAlias($this->_class->name); - - $sql = 'SELECT 1 ' - . $this->getLockTablesSql() - . ' WHERE ' . $this->_getSelectConditionSQL($criteria); - - if ($filterSql = $this->generateFilterConditionSQL($this->_class, $alias)) { - $sql .= ' AND ' . $filterSql; - } - - list($params, $types) = $this->expandParameters($criteria); - - return (bool) $this->_conn->fetchColumn($sql, $params); - } - - /** - * Generates the appropriate join SQL for the given join column. - * - * @param array $joinColumns The join columns definition of an association. - * @return string LEFT JOIN if one of the columns is nullable, INNER JOIN otherwise. - */ - protected function getJoinSQLForJoinColumns($joinColumns) - { - // if one of the join columns is nullable, return left join - foreach ($joinColumns as $joinColumn) { - if (!isset($joinColumn['nullable']) || $joinColumn['nullable']) { - return 'LEFT JOIN'; - } - } - - return 'INNER JOIN'; - } - - /** - * Gets an SQL column alias for a column name. - * - * @param string $columnName - * @return string - */ - public function getSQLColumnAlias($columnName) - { - // Trim the column alias to the maximum identifier length of the platform. - // If the alias is to long, characters are cut off from the beginning. - return $this->_platform->getSQLResultCasing( - substr($columnName . $this->_sqlAliasCounter++, -$this->_platform->getMaxIdentifierLength()) - ); - } - - /** - * Generates the filter SQL for a given entity and table alias. - * - * @param ClassMetadata $targetEntity Metadata of the target entity. - * @param string $targetTableAlias The table alias of the joined/selected table. - * - * @return string The SQL query part to add to a query. - */ - protected function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias) - { - $filterClauses = array(); - - foreach ($this->_em->getFilters()->getEnabledFilters() as $filter) { - if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { - $filterClauses[] = '(' . $filterExpr . ')'; - } - } - - $sql = implode(' AND ', $filterClauses); - return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/ElementCollectionPersister.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/ElementCollectionPersister.php deleted file mode 100644 index 688edeb..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/ElementCollectionPersister.php +++ /dev/null @@ -1,33 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Persisters; - -/** - * Persister for collections of basic elements / value types. - * - * @author robo - * @todo Implementation once support for collections of basic elements (i.e. strings) is added. - */ -abstract class ElementCollectionPersister extends AbstractCollectionPersister -{ - //put your code here -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php deleted file mode 100644 index 350ced9..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php +++ /dev/null @@ -1,487 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Persisters; - -use Doctrine\ORM\ORMException, - Doctrine\ORM\Mapping\ClassMetadata, - Doctrine\DBAL\LockMode, - Doctrine\DBAL\Types\Type, - Doctrine\ORM\Query\ResultSetMapping; - -/** - * The joined subclass persister maps a single entity instance to several tables in the - * database as it is defined by the Class Table Inheritance strategy. - * - * @author Roman Borschel - * @author Benjamin Eberlei - * @author Alexander - * @since 2.0 - * @see http://martinfowler.com/eaaCatalog/classTableInheritance.html - */ -class JoinedSubclassPersister extends AbstractEntityInheritancePersister -{ - /** - * Map that maps column names to the table names that own them. - * This is mainly a temporary cache, used during a single request. - * - * @var array - */ - private $_owningTableMap = array(); - - /** - * Map of table to quoted table names. - * - * @var array - */ - private $_quotedTableMap = array(); - - /** - * {@inheritdoc} - */ - protected function _getDiscriminatorColumnTableName() - { - $class = ($this->_class->name !== $this->_class->rootEntityName) - ? $this->_em->getClassMetadata($this->_class->rootEntityName) - : $this->_class; - - return $class->getTableName(); - } - - /** - * This function finds the ClassMetadata instance in an inheritance hierarchy - * that is responsible for enabling versioning. - * - * @return \Doctrine\ORM\Mapping\ClassMetadata - */ - private function _getVersionedClassMetadata() - { - if (isset($this->_class->fieldMappings[$this->_class->versionField]['inherited'])) { - $definingClassName = $this->_class->fieldMappings[$this->_class->versionField]['inherited']; - - return $this->_em->getClassMetadata($definingClassName); - } - - return $this->_class; - } - - /** - * Gets the name of the table that owns the column the given field is mapped to. - * - * @param string $fieldName - * @return string - * @override - */ - public function getOwningTable($fieldName) - { - if (isset($this->_owningTableMap[$fieldName])) { - return $this->_owningTableMap[$fieldName]; - } - - if (isset($this->_class->associationMappings[$fieldName]['inherited'])) { - $cm = $this->_em->getClassMetadata($this->_class->associationMappings[$fieldName]['inherited']); - } else if (isset($this->_class->fieldMappings[$fieldName]['inherited'])) { - $cm = $this->_em->getClassMetadata($this->_class->fieldMappings[$fieldName]['inherited']); - } else { - $cm = $this->_class; - } - - $tableName = $cm->getTableName(); - - $this->_owningTableMap[$fieldName] = $tableName; - $this->_quotedTableMap[$tableName] = $cm->getQuotedTableName($this->_platform); - - return $tableName; - } - - /** - * {@inheritdoc} - */ - public function executeInserts() - { - if ( ! $this->_queuedInserts) { - return; - } - - $postInsertIds = array(); - $idGen = $this->_class->idGenerator; - $isPostInsertId = $idGen->isPostInsertGenerator(); - - // Prepare statement for the root table - $rootClass = ($this->_class->name !== $this->_class->rootEntityName) ? $this->_em->getClassMetadata($this->_class->rootEntityName) : $this->_class; - $rootPersister = $this->_em->getUnitOfWork()->getEntityPersister($rootClass->name); - $rootTableName = $rootClass->getTableName(); - $rootTableStmt = $this->_conn->prepare($rootPersister->_getInsertSQL()); - - // Prepare statements for sub tables. - $subTableStmts = array(); - - if ($rootClass !== $this->_class) { - $subTableStmts[$this->_class->getTableName()] = $this->_conn->prepare($this->_getInsertSQL()); - } - - foreach ($this->_class->parentClasses as $parentClassName) { - $parentClass = $this->_em->getClassMetadata($parentClassName); - $parentTableName = $parentClass->getTableName(); - - if ($parentClass !== $rootClass) { - $parentPersister = $this->_em->getUnitOfWork()->getEntityPersister($parentClassName); - $subTableStmts[$parentTableName] = $this->_conn->prepare($parentPersister->_getInsertSQL()); - } - } - - // Execute all inserts. For each entity: - // 1) Insert on root table - // 2) Insert on sub tables - foreach ($this->_queuedInserts as $entity) { - $insertData = $this->_prepareInsertData($entity); - - // Execute insert on root table - $paramIndex = 1; - - foreach ($insertData[$rootTableName] as $columnName => $value) { - $rootTableStmt->bindValue($paramIndex++, $value, $this->_columnTypes[$columnName]); - } - - $rootTableStmt->execute(); - - if ($isPostInsertId) { - $id = $idGen->generate($this->_em, $entity); - $postInsertIds[$id] = $entity; - } else { - $id = $this->_em->getUnitOfWork()->getEntityIdentifier($entity); - } - - // Execute inserts on subtables. - // The order doesn't matter because all child tables link to the root table via FK. - foreach ($subTableStmts as $tableName => $stmt) { - $data = isset($insertData[$tableName]) ? $insertData[$tableName] : array(); - $paramIndex = 1; - - foreach ((array) $id as $idName => $idVal) { - $type = isset($this->_columnTypes[$idName]) ? $this->_columnTypes[$idName] : Type::STRING; - - $stmt->bindValue($paramIndex++, $idVal, $type); - } - - foreach ($data as $columnName => $value) { - $stmt->bindValue($paramIndex++, $value, $this->_columnTypes[$columnName]); - } - - $stmt->execute(); - } - } - - $rootTableStmt->closeCursor(); - - foreach ($subTableStmts as $stmt) { - $stmt->closeCursor(); - } - - if ($this->_class->isVersioned) { - $this->assignDefaultVersionValue($entity, $id); - } - - $this->_queuedInserts = array(); - - return $postInsertIds; - } - - /** - * {@inheritdoc} - */ - public function update($entity) - { - $updateData = $this->_prepareUpdateData($entity); - - if (($isVersioned = $this->_class->isVersioned) != false) { - $versionedClass = $this->_getVersionedClassMetadata(); - $versionedTable = $versionedClass->getTableName(); - } - - if ($updateData) { - foreach ($updateData as $tableName => $data) { - $this->_updateTable( - $entity, $this->_quotedTableMap[$tableName], $data, $isVersioned && $versionedTable == $tableName - ); - } - - // Make sure the table with the version column is updated even if no columns on that - // table were affected. - if ($isVersioned && ! isset($updateData[$versionedTable])) { - $this->_updateTable($entity, $versionedClass->getQuotedTableName($this->_platform), array(), true); - - $id = $this->_em->getUnitOfWork()->getEntityIdentifier($entity); - $this->assignDefaultVersionValue($entity, $id); - } - } - } - - /** - * {@inheritdoc} - */ - public function delete($entity) - { - $identifier = $this->_em->getUnitOfWork()->getEntityIdentifier($entity); - $this->deleteJoinTableRecords($identifier); - - $id = array_combine($this->_class->getIdentifierColumnNames(), $identifier); - - // If the database platform supports FKs, just - // delete the row from the root table. Cascades do the rest. - if ($this->_platform->supportsForeignKeyConstraints()) { - $this->_conn->delete( - $this->_em->getClassMetadata($this->_class->rootEntityName)->getQuotedTableName($this->_platform), $id - ); - } else { - // Delete from all tables individually, starting from this class' table up to the root table. - $this->_conn->delete($this->_class->getQuotedTableName($this->_platform), $id); - - foreach ($this->_class->parentClasses as $parentClass) { - $this->_conn->delete( - $this->_em->getClassMetadata($parentClass)->getQuotedTableName($this->_platform), $id - ); - } - } - } - - /** - * {@inheritdoc} - */ - protected function _getSelectEntitiesSQL(array $criteria, $assoc = null, $lockMode = 0, $limit = null, $offset = null, array $orderBy = null) - { - $idColumns = $this->_class->getIdentifierColumnNames(); - $baseTableAlias = $this->_getSQLTableAlias($this->_class->name); - - // Create the column list fragment only once - if ($this->_selectColumnListSql === null) { - - $this->_rsm = new ResultSetMapping(); - $this->_rsm->addEntityResult($this->_class->name, 'r'); - - // Add regular columns - $columnList = ''; - - foreach ($this->_class->fieldMappings as $fieldName => $mapping) { - if ($columnList != '') $columnList .= ', '; - - $columnList .= $this->_getSelectColumnSQL( - $fieldName, - isset($mapping['inherited']) ? $this->_em->getClassMetadata($mapping['inherited']) : $this->_class - ); - } - - // Add foreign key columns - foreach ($this->_class->associationMappings as $assoc2) { - if ($assoc2['isOwningSide'] && $assoc2['type'] & ClassMetadata::TO_ONE) { - $tableAlias = isset($assoc2['inherited']) ? $this->_getSQLTableAlias($assoc2['inherited']) : $baseTableAlias; - - foreach ($assoc2['targetToSourceKeyColumns'] as $srcColumn) { - if ($columnList != '') $columnList .= ', '; - - $columnList .= $this->getSelectJoinColumnSQL( - $tableAlias, - $srcColumn, - isset($assoc2['inherited']) ? $assoc2['inherited'] : $this->_class->name - ); - } - } - } - - // Add discriminator column (DO NOT ALIAS, see AbstractEntityInheritancePersister#_processSQLResult). - $discrColumn = $this->_class->discriminatorColumn['name']; - $tableAlias = ($this->_class->rootEntityName == $this->_class->name) ? $baseTableAlias : $this->_getSQLTableAlias($this->_class->rootEntityName); - $columnList .= ', ' . $tableAlias . '.' . $discrColumn; - - $resultColumnName = $this->_platform->getSQLResultCasing($discrColumn); - - $this->_rsm->setDiscriminatorColumn('r', $resultColumnName); - $this->_rsm->addMetaResult('r', $resultColumnName, $discrColumn); - } - - // INNER JOIN parent tables - $joinSql = ''; - - foreach ($this->_class->parentClasses as $parentClassName) { - $parentClass = $this->_em->getClassMetadata($parentClassName); - $tableAlias = $this->_getSQLTableAlias($parentClassName); - $joinSql .= ' INNER JOIN ' . $parentClass->getQuotedTableName($this->_platform) . ' ' . $tableAlias . ' ON '; - $first = true; - - foreach ($idColumns as $idColumn) { - if ($first) $first = false; else $joinSql .= ' AND '; - - $joinSql .= $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; - } - } - - // OUTER JOIN sub tables - foreach ($this->_class->subClasses as $subClassName) { - $subClass = $this->_em->getClassMetadata($subClassName); - $tableAlias = $this->_getSQLTableAlias($subClassName); - - if ($this->_selectColumnListSql === null) { - // Add subclass columns - foreach ($subClass->fieldMappings as $fieldName => $mapping) { - if (isset($mapping['inherited'])) continue; - - $columnList .= ', ' . $this->_getSelectColumnSQL($fieldName, $subClass); - } - - // Add join columns (foreign keys) - foreach ($subClass->associationMappings as $assoc2) { - if ($assoc2['isOwningSide'] && $assoc2['type'] & ClassMetadata::TO_ONE && ! isset($assoc2['inherited'])) { - foreach ($assoc2['targetToSourceKeyColumns'] as $srcColumn) { - if ($columnList != '') $columnList .= ', '; - - $columnList .= $this->getSelectJoinColumnSQL( - $tableAlias, - $srcColumn, - isset($assoc2['inherited']) ? $assoc2['inherited'] : $subClass->name - ); - } - } - } - } - - // Add LEFT JOIN - $joinSql .= ' LEFT JOIN ' . $subClass->getQuotedTableName($this->_platform) . ' ' . $tableAlias . ' ON '; - $first = true; - - foreach ($idColumns as $idColumn) { - if ($first) $first = false; else $joinSql .= ' AND '; - - $joinSql .= $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; - } - } - - $joinSql .= ($assoc != null && $assoc['type'] == ClassMetadata::MANY_TO_MANY) ? $this->_getSelectManyToManyJoinSQL($assoc) : ''; - - $conditionSql = $this->_getSelectConditionSQL($criteria, $assoc); - - // If the current class in the root entity, add the filters - if ($filterSql = $this->generateFilterConditionSQL($this->_em->getClassMetadata($this->_class->rootEntityName), $this->_getSQLTableAlias($this->_class->rootEntityName))) { - if ($conditionSql) { - $conditionSql .= ' AND '; - } - - $conditionSql .= $filterSql; - } - - $orderBy = ($assoc !== null && isset($assoc['orderBy'])) ? $assoc['orderBy'] : $orderBy; - $orderBySql = $orderBy ? $this->_getOrderBySQL($orderBy, $baseTableAlias) : ''; - - if ($this->_selectColumnListSql === null) { - $this->_selectColumnListSql = $columnList; - } - - $lockSql = ''; - - if ($lockMode == LockMode::PESSIMISTIC_READ) { - $lockSql = ' ' . $this->_platform->getReadLockSql(); - } else if ($lockMode == LockMode::PESSIMISTIC_WRITE) { - $lockSql = ' ' . $this->_platform->getWriteLockSql(); - } - - return $this->_platform->modifyLimitQuery('SELECT ' . $this->_selectColumnListSql - . ' FROM ' . $this->_class->getQuotedTableName($this->_platform) . ' ' . $baseTableAlias - . $joinSql - . ($conditionSql != '' ? ' WHERE ' . $conditionSql : '') . $orderBySql, $limit, $offset) - . $lockSql; - } - - /** - * Get the FROM and optionally JOIN conditions to lock the entity managed by this persister. - * - * @return string - */ - public function getLockTablesSql() - { - $idColumns = $this->_class->getIdentifierColumnNames(); - $baseTableAlias = $this->_getSQLTableAlias($this->_class->name); - - // INNER JOIN parent tables - $joinSql = ''; - - foreach ($this->_class->parentClasses as $parentClassName) { - $parentClass = $this->_em->getClassMetadata($parentClassName); - $tableAlias = $this->_getSQLTableAlias($parentClassName); - $joinSql .= ' INNER JOIN ' . $parentClass->getQuotedTableName($this->_platform) . ' ' . $tableAlias . ' ON '; - $first = true; - - foreach ($idColumns as $idColumn) { - if ($first) $first = false; else $joinSql .= ' AND '; - - $joinSql .= $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; - } - } - - return 'FROM ' . $this->_class->getQuotedTableName($this->_platform) . ' ' . $baseTableAlias . $joinSql; - } - - /* Ensure this method is never called. This persister overrides _getSelectEntitiesSQL directly. */ - protected function _getSelectColumnListSQL() - { - throw new \BadMethodCallException("Illegal invocation of ".__METHOD__."."); - } - - /** {@inheritdoc} */ - protected function _getInsertColumnList() - { - // Identifier columns must always come first in the column list of subclasses. - $columns = $this->_class->parentClasses ? $this->_class->getIdentifierColumnNames() : array(); - - foreach ($this->_class->reflFields as $name => $field) { - if (isset($this->_class->fieldMappings[$name]['inherited']) && ! isset($this->_class->fieldMappings[$name]['id']) - || isset($this->_class->associationMappings[$name]['inherited']) - || ($this->_class->isVersioned && $this->_class->versionField == $name)) { - continue; - } - - if (isset($this->_class->associationMappings[$name])) { - $assoc = $this->_class->associationMappings[$name]; - if ($assoc['type'] & ClassMetadata::TO_ONE && $assoc['isOwningSide']) { - foreach ($assoc['targetToSourceKeyColumns'] as $sourceCol) { - $columns[] = $sourceCol; - } - } - } else if ($this->_class->name != $this->_class->rootEntityName || - ! $this->_class->isIdGeneratorIdentity() || $this->_class->identifier[0] != $name) { - $columns[] = $this->_class->getQuotedColumnName($name, $this->_platform); - } - } - - // Add discriminator column if it is the topmost class. - if ($this->_class->name == $this->_class->rootEntityName) { - $columns[] = $this->_class->discriminatorColumn['name']; - } - - return $columns; - } - - /** - * {@inheritdoc} - */ - protected function assignDefaultVersionValue($entity, $id) - { - $value = $this->fetchVersionValue($this->_getVersionedClassMetadata(), $id); - $this->_class->setFieldValue($entity, $this->_class->versionField, $value); - } - -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php deleted file mode 100644 index 4e3e92b..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php +++ /dev/null @@ -1,425 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Persisters; - -use Doctrine\ORM\Mapping\ClassMetadata, - Doctrine\ORM\PersistentCollection, - Doctrine\ORM\UnitOfWork; - -/** - * Persister for many-to-many collections. - * - * @author Roman Borschel - * @author Guilherme Blanco - * @author Alexander - * @since 2.0 - */ -class ManyToManyPersister extends AbstractCollectionPersister -{ - /** - * {@inheritdoc} - * - * @override - */ - protected function _getDeleteRowSQL(PersistentCollection $coll) - { - $mapping = $coll->getMapping(); - $class = $this->_em->getClassMetadata(get_class($coll->getOwner())); - - return 'DELETE FROM ' . $class->getQuotedJoinTableName($mapping, $this->_conn->getDatabasePlatform()) - . ' WHERE ' . implode(' = ? AND ', $mapping['joinTableColumns']) . ' = ?'; - } - - /** - * {@inheritdoc} - * - * @override - * @internal Order of the parameters must be the same as the order of the columns in - * _getDeleteRowSql. - */ - protected function _getDeleteRowSQLParameters(PersistentCollection $coll, $element) - { - return $this->_collectJoinTableColumnParameters($coll, $element); - } - - /** - * {@inheritdoc} - * - * @override - */ - protected function _getUpdateRowSQL(PersistentCollection $coll) - {} - - /** - * {@inheritdoc} - * - * @override - * @internal Order of the parameters must be the same as the order of the columns in - * _getInsertRowSql. - */ - protected function _getInsertRowSQL(PersistentCollection $coll) - { - $mapping = $coll->getMapping(); - $columns = $mapping['joinTableColumns']; - $class = $this->_em->getClassMetadata(get_class($coll->getOwner())); - - $joinTable = $class->getQuotedJoinTableName($mapping, $this->_conn->getDatabasePlatform()); - - return 'INSERT INTO ' . $joinTable . ' (' . implode(', ', $columns) . ')' - . ' VALUES (' . implode(', ', array_fill(0, count($columns), '?')) . ')'; - } - - /** - * {@inheritdoc} - * - * @override - * @internal Order of the parameters must be the same as the order of the columns in - * _getInsertRowSql. - */ - protected function _getInsertRowSQLParameters(PersistentCollection $coll, $element) - { - return $this->_collectJoinTableColumnParameters($coll, $element); - } - - /** - * Collects the parameters for inserting/deleting on the join table in the order - * of the join table columns as specified in ManyToManyMapping#joinTableColumns. - * - * @param $coll - * @param $element - * @return array - */ - private function _collectJoinTableColumnParameters(PersistentCollection $coll, $element) - { - $params = array(); - $mapping = $coll->getMapping(); - $isComposite = count($mapping['joinTableColumns']) > 2; - - $identifier1 = $this->_uow->getEntityIdentifier($coll->getOwner()); - $identifier2 = $this->_uow->getEntityIdentifier($element); - - if ($isComposite) { - $class1 = $this->_em->getClassMetadata(get_class($coll->getOwner())); - $class2 = $coll->getTypeClass(); - } - - foreach ($mapping['joinTableColumns'] as $joinTableColumn) { - $isRelationToSource = isset($mapping['relationToSourceKeyColumns'][$joinTableColumn]); - - if ( ! $isComposite) { - $params[] = $isRelationToSource ? array_pop($identifier1) : array_pop($identifier2); - - continue; - } - - if ($isRelationToSource) { - $params[] = $identifier1[$class1->getFieldForColumn($mapping['relationToSourceKeyColumns'][$joinTableColumn])]; - - continue; - } - - $params[] = $identifier2[$class2->getFieldForColumn($mapping['relationToTargetKeyColumns'][$joinTableColumn])]; - } - - return $params; - } - - /** - * {@inheritdoc} - * - * @override - */ - protected function _getDeleteSQL(PersistentCollection $coll) - { - $class = $this->_em->getClassMetadata(get_class($coll->getOwner())); - $mapping = $coll->getMapping(); - - return 'DELETE FROM ' . $class->getQuotedJoinTableName($mapping, $this->_conn->getDatabasePlatform()) - . ' WHERE ' . implode(' = ? AND ', array_keys($mapping['relationToSourceKeyColumns'])) . ' = ?'; - } - - /** - * {@inheritdoc} - * - * @override - * @internal Order of the parameters must be the same as the order of the columns in - * _getDeleteSql. - */ - protected function _getDeleteSQLParameters(PersistentCollection $coll) - { - $identifier = $this->_uow->getEntityIdentifier($coll->getOwner()); - $mapping = $coll->getMapping(); - $params = array(); - - // Optimization for single column identifier - if (count($mapping['relationToSourceKeyColumns']) === 1) { - $params[] = array_pop($identifier); - - return $params; - } - - // Composite identifier - $sourceClass = $this->_em->getClassMetadata(get_class($coll->getOwner())); - - foreach ($mapping['relationToSourceKeyColumns'] as $relColumn => $srcColumn) { - $params[] = $identifier[$sourceClass->fieldNames[$srcColumn]]; - } - - return $params; - } - - /** - * {@inheritdoc} - */ - public function count(PersistentCollection $coll) - { - $mapping = $filterMapping = $coll->getMapping(); - $class = $this->_em->getClassMetadata($mapping['sourceEntity']); - $id = $this->_em->getUnitOfWork()->getEntityIdentifier($coll->getOwner()); - - if ($mapping['isOwningSide']) { - $joinColumns = $mapping['relationToSourceKeyColumns']; - } else { - $mapping = $this->_em->getClassMetadata($mapping['targetEntity'])->associationMappings[$mapping['mappedBy']]; - $joinColumns = $mapping['relationToTargetKeyColumns']; - } - - $whereClauses = array(); - $params = array(); - - foreach ($mapping['joinTableColumns'] as $joinTableColumn) { - if ( ! isset($joinColumns[$joinTableColumn])) { - continue; - } - - $whereClauses[] = $joinTableColumn . ' = ?'; - - $params[] = ($class->containsForeignIdentifier) - ? $id[$class->getFieldForColumn($joinColumns[$joinTableColumn])] - : $id[$class->fieldNames[$joinColumns[$joinTableColumn]]]; - } - - list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($filterMapping); - if ($filterSql) { - $whereClauses[] = $filterSql; - } - - $sql = 'SELECT COUNT(*)' - . ' FROM ' . $class->getQuotedJoinTableName($mapping, $this->_conn->getDatabasePlatform()) . ' t' - . $joinTargetEntitySQL - . ' WHERE ' . implode(' AND ', $whereClauses); - - return $this->_conn->fetchColumn($sql, $params); - } - - /** - * @param PersistentCollection $coll - * @param int $offset - * @param int $length - * @return array - */ - public function slice(PersistentCollection $coll, $offset, $length = null) - { - $mapping = $coll->getMapping(); - - return $this->_em->getUnitOfWork()->getEntityPersister($mapping['targetEntity'])->getManyToManyCollection($mapping, $coll->getOwner(), $offset, $length); - } - - /** - * @param PersistentCollection $coll - * @param object $element - * @return boolean - */ - public function contains(PersistentCollection $coll, $element) - { - $uow = $this->_em->getUnitOfWork(); - - // Shortcut for new entities - $entityState = $uow->getEntityState($element, UnitOfWork::STATE_NEW); - - if ($entityState === UnitOfWork::STATE_NEW) { - return false; - } - - // Entity is scheduled for inclusion - if ($entityState === UnitOfWork::STATE_MANAGED && $uow->isScheduledForInsert($element)) { - return false; - } - - list($quotedJoinTable, $whereClauses, $params) = $this->getJoinTableRestrictions($coll, $element, true); - - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); - - return (bool) $this->_conn->fetchColumn($sql, $params); - } - - /** - * @param PersistentCollection $coll - * @param object $element - * @return boolean - */ - public function removeElement(PersistentCollection $coll, $element) - { - $uow = $this->_em->getUnitOfWork(); - - // shortcut for new entities - $entityState = $uow->getEntityState($element, UnitOfWork::STATE_NEW); - - if ($entityState === UnitOfWork::STATE_NEW) { - return false; - } - - // If Entity is scheduled for inclusion, it is not in this collection. - // We can assure that because it would have return true before on array check - if ($entityState === UnitOfWork::STATE_MANAGED && $uow->isScheduledForInsert($element)) { - return false; - } - - list($quotedJoinTable, $whereClauses, $params) = $this->getJoinTableRestrictions($coll, $element, false); - - $sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); - - return (bool) $this->_conn->executeUpdate($sql, $params); - } - - /** - * @param \Doctrine\ORM\PersistentCollection $coll - * @param object $element - * @param boolean $addFilters Whether the filter SQL should be included or not. - * @return array - */ - private function getJoinTableRestrictions(PersistentCollection $coll, $element, $addFilters) - { - $uow = $this->_em->getUnitOfWork(); - $mapping = $filterMapping = $coll->getMapping(); - - if ( ! $mapping['isOwningSide']) { - $sourceClass = $this->_em->getClassMetadata($mapping['targetEntity']); - $targetClass = $this->_em->getClassMetadata($mapping['sourceEntity']); - $sourceId = $uow->getEntityIdentifier($element); - $targetId = $uow->getEntityIdentifier($coll->getOwner()); - - $mapping = $sourceClass->associationMappings[$mapping['mappedBy']]; - } else { - $sourceClass = $this->_em->getClassMetadata($mapping['sourceEntity']); - $targetClass = $this->_em->getClassMetadata($mapping['targetEntity']); - $sourceId = $uow->getEntityIdentifier($coll->getOwner()); - $targetId = $uow->getEntityIdentifier($element); - } - - $quotedJoinTable = $sourceClass->getQuotedJoinTableName($mapping, $this->_conn->getDatabasePlatform()); - $whereClauses = array(); - $params = array(); - - foreach ($mapping['joinTableColumns'] as $joinTableColumn) { - $whereClauses[] = $joinTableColumn . ' = ?'; - - if (isset($mapping['relationToTargetKeyColumns'][$joinTableColumn])) { - $params[] = ($targetClass->containsForeignIdentifier) - ? $targetId[$targetClass->getFieldForColumn($mapping['relationToTargetKeyColumns'][$joinTableColumn])] - : $targetId[$targetClass->fieldNames[$mapping['relationToTargetKeyColumns'][$joinTableColumn]]]; - continue; - } - - // relationToSourceKeyColumns - $params[] = ($sourceClass->containsForeignIdentifier) - ? $sourceId[$sourceClass->getFieldForColumn($mapping['relationToSourceKeyColumns'][$joinTableColumn])] - : $sourceId[$sourceClass->fieldNames[$mapping['relationToSourceKeyColumns'][$joinTableColumn]]]; - } - - if ($addFilters) { - list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($filterMapping); - if ($filterSql) { - $quotedJoinTable .= ' t ' . $joinTargetEntitySQL; - $whereClauses[] = $filterSql; - } - } - - return array($quotedJoinTable, $whereClauses, $params); - } - - /** - * Generates the filter SQL for a given mapping. - * - * This method is not used for actually grabbing the related entities - * but when the extra-lazy collection methods are called on a filtered - * association. This is why besides the many to many table we also - * have to join in the actual entities table leading to additional - * JOIN. - * - * @param array $mapping Array containing mapping information. - * - * @return string The SQL query part to add to a query. - */ - public function getFilterSql($mapping) - { - $targetClass = $this->_em->getClassMetadata($mapping['targetEntity']); - - if ($mapping['isOwningSide']) { - $joinColumns = $mapping['relationToTargetKeyColumns']; - } else { - $mapping = $targetClass->associationMappings[$mapping['mappedBy']]; - $joinColumns = $mapping['relationToSourceKeyColumns']; - } - - $targetClass = $this->_em->getClassMetadata($targetClass->rootEntityName); - - // A join is needed if there is filtering on the target entity - $joinTargetEntitySQL = ''; - if ($filterSql = $this->generateFilterConditionSQL($targetClass, 'te')) { - $joinTargetEntitySQL = ' JOIN ' - . $targetClass->getQuotedTableName($this->_conn->getDatabasePlatform()) . ' te' - . ' ON'; - - $joinTargetEntitySQLClauses = array(); - foreach ($joinColumns as $joinTableColumn => $targetTableColumn) { - $joinTargetEntitySQLClauses[] = ' t.' . $joinTableColumn . ' = ' . 'te.' . $targetTableColumn; - } - - $joinTargetEntitySQL .= implode(' AND ', $joinTargetEntitySQLClauses); - } - - return array($joinTargetEntitySQL, $filterSql); - } - - /** - * Generates the filter SQL for a given entity and table alias. - * - * @param ClassMetadata $targetEntity Metadata of the target entity. - * @param string $targetTableAlias The table alias of the joined/selected table. - * - * @return string The SQL query part to add to a query. - */ - protected function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias) - { - $filterClauses = array(); - - foreach ($this->_em->getFilters()->getEnabledFilters() as $filter) { - if ($filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { - $filterClauses[] = '(' . $filterExpr . ')'; - } - } - - $sql = implode(' AND ', $filterClauses); - return $sql ? "(" . $sql . ")" : ""; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/OneToManyPersister.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/OneToManyPersister.php deleted file mode 100644 index 6f477f0..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/OneToManyPersister.php +++ /dev/null @@ -1,212 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Persisters; - -use Doctrine\ORM\PersistentCollection, - Doctrine\ORM\UnitOfWork; - -/** - * Persister for one-to-many collections. - * - * @author Roman Borschel - * @author Guilherme Blanco - * @author Alexander - * @since 2.0 - */ -class OneToManyPersister extends AbstractCollectionPersister -{ - /** - * Generates the SQL UPDATE that updates a particular row's foreign - * key to null. - * - * @param PersistentCollection $coll - * @return string - * @override - */ - protected function _getDeleteRowSQL(PersistentCollection $coll) - { - $mapping = $coll->getMapping(); - $class = $this->_em->getClassMetadata($mapping['targetEntity']); - - return 'DELETE FROM ' . $class->getQuotedTableName($this->_conn->getDatabasePlatform()) - . ' WHERE ' . implode('= ? AND ', $class->getIdentifierColumnNames()) . ' = ?'; - } - - /** - * {@inheritdoc} - * - */ - protected function _getDeleteRowSQLParameters(PersistentCollection $coll, $element) - { - return array_values($this->_uow->getEntityIdentifier($element)); - } - - protected function _getInsertRowSQL(PersistentCollection $coll) - { - return "UPDATE xxx SET foreign_key = yyy WHERE foreign_key = zzz"; - } - - /** - * Gets the SQL parameters for the corresponding SQL statement to insert the given - * element of the given collection into the database. - * - * @param PersistentCollection $coll - * @param mixed $element - */ - protected function _getInsertRowSQLParameters(PersistentCollection $coll, $element) - {} - - /* Not used for OneToManyPersister */ - protected function _getUpdateRowSQL(PersistentCollection $coll) - { - return; - } - - /** - * Generates the SQL UPDATE that updates all the foreign keys to null. - * - * @param PersistentCollection $coll - */ - protected function _getDeleteSQL(PersistentCollection $coll) - { - - } - - /** - * Gets the SQL parameters for the corresponding SQL statement to delete - * the given collection. - * - * @param PersistentCollection $coll - */ - protected function _getDeleteSQLParameters(PersistentCollection $coll) - {} - - /** - * {@inheritdoc} - */ - public function count(PersistentCollection $coll) - { - $mapping = $coll->getMapping(); - $targetClass = $this->_em->getClassMetadata($mapping['targetEntity']); - $sourceClass = $this->_em->getClassMetadata($mapping['sourceEntity']); - $id = $this->_em->getUnitOfWork()->getEntityIdentifier($coll->getOwner()); - - $whereClauses = array(); - $params = array(); - - foreach ($targetClass->associationMappings[$mapping['mappedBy']]['joinColumns'] AS $joinColumn) { - $whereClauses[] = $joinColumn['name'] . ' = ?'; - - $params[] = ($targetClass->containsForeignIdentifier) - ? $id[$sourceClass->getFieldForColumn($joinColumn['referencedColumnName'])] - : $id[$sourceClass->fieldNames[$joinColumn['referencedColumnName']]]; - } - - $filterTargetClass = $this->_em->getClassMetadata($targetClass->rootEntityName); - foreach ($this->_em->getFilters()->getEnabledFilters() as $filter) { - if ($filterExpr = $filter->addFilterConstraint($filterTargetClass, 't')) { - $whereClauses[] = '(' . $filterExpr . ')'; - } - } - - $sql = 'SELECT count(*)' - . ' FROM ' . $targetClass->getQuotedTableName($this->_conn->getDatabasePlatform()) . ' t' - . ' WHERE ' . implode(' AND ', $whereClauses); - - return $this->_conn->fetchColumn($sql, $params); - } - - /** - * @param PersistentCollection $coll - * @param int $offset - * @param int $length - * @return \Doctrine\Common\Collections\ArrayCollection - */ - public function slice(PersistentCollection $coll, $offset, $length = null) - { - $mapping = $coll->getMapping(); - $uow = $this->_em->getUnitOfWork(); - $persister = $uow->getEntityPersister($mapping['targetEntity']); - - return $persister->getOneToManyCollection($mapping, $coll->getOwner(), $offset, $length); - } - - /** - * @param PersistentCollection $coll - * @param object $element - * @return boolean - */ - public function contains(PersistentCollection $coll, $element) - { - $mapping = $coll->getMapping(); - $uow = $this->_em->getUnitOfWork(); - - // shortcut for new entities - $entityState = $uow->getEntityState($element, UnitOfWork::STATE_NEW); - - if ($entityState === UnitOfWork::STATE_NEW) { - return false; - } - - // Entity is scheduled for inclusion - if ($entityState === UnitOfWork::STATE_MANAGED && $uow->isScheduledForInsert($element)) { - return false; - } - - $persister = $uow->getEntityPersister($mapping['targetEntity']); - - // only works with single id identifier entities. Will throw an - // exception in Entity Persisters if that is not the case for the - // 'mappedBy' field. - $id = current( $uow->getEntityIdentifier($coll->getOwner())); - - return $persister->exists($element, array($mapping['mappedBy'] => $id)); - } - - /** - * @param PersistentCollection $coll - * @param object $element - * @return boolean - */ - public function removeElement(PersistentCollection $coll, $element) - { - $uow = $this->_em->getUnitOfWork(); - - // shortcut for new entities - $entityState = $uow->getEntityState($element, UnitOfWork::STATE_NEW); - - if ($entityState === UnitOfWork::STATE_NEW) { - return false; - } - - // If Entity is scheduled for inclusion, it is not in this collection. - // We can assure that because it would have return true before on array check - if ($entityState === UnitOfWork::STATE_MANAGED && $uow->isScheduledForInsert($element)) { - return false; - } - - $mapping = $coll->getMapping(); - $class = $this->_em->getClassMetadata($mapping['targetEntity']); - $sql = 'DELETE FROM ' . $class->getQuotedTableName($this->_conn->getDatabasePlatform()) - . ' WHERE ' . implode('= ? AND ', $class->getIdentifierColumnNames()) . ' = ?'; - - return (bool) $this->_conn->executeUpdate($sql, $this->_getDeleteRowSQLParameters($coll, $element)); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/SingleTablePersister.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/SingleTablePersister.php deleted file mode 100644 index 8644e1d..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/SingleTablePersister.php +++ /dev/null @@ -1,146 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Persisters; - -use Doctrine\ORM\Mapping\ClassMetadata; - -/** - * Persister for entities that participate in a hierarchy mapped with the - * SINGLE_TABLE strategy. - * - * @author Roman Borschel - * @author Benjamin Eberlei - * @author Alexander - * @since 2.0 - * @link http://martinfowler.com/eaaCatalog/singleTableInheritance.html - */ -class SingleTablePersister extends AbstractEntityInheritancePersister -{ - /** {@inheritdoc} */ - protected function _getDiscriminatorColumnTableName() - { - return $this->_class->getTableName(); - } - - /** {@inheritdoc} */ - protected function _getSelectColumnListSQL() - { - if ($this->_selectColumnListSql !== null) { - return $this->_selectColumnListSql; - } - - $columnList = parent::_getSelectColumnListSQL(); - - $rootClass = $this->_em->getClassMetadata($this->_class->rootEntityName); - $tableAlias = $this->_getSQLTableAlias($rootClass->name); - - // Append discriminator column - $discrColumn = $this->_class->discriminatorColumn['name']; - $columnList .= ', ' . $tableAlias . '.' . $discrColumn; - - $resultColumnName = $this->_platform->getSQLResultCasing($discrColumn); - - $this->_rsm->setDiscriminatorColumn('r', $resultColumnName); - $this->_rsm->addMetaResult('r', $resultColumnName, $discrColumn); - - // Append subclass columns - foreach ($this->_class->subClasses as $subClassName) { - $subClass = $this->_em->getClassMetadata($subClassName); - - // Regular columns - foreach ($subClass->fieldMappings as $fieldName => $mapping) { - if ( ! isset($mapping['inherited'])) { - $columnList .= ', ' . $this->_getSelectColumnSQL($fieldName, $subClass); - } - } - - // Foreign key columns - foreach ($subClass->associationMappings as $assoc) { - if ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE && ! isset($assoc['inherited'])) { - foreach ($assoc['targetToSourceKeyColumns'] as $srcColumn) { - if ($columnList != '') $columnList .= ', '; - - $columnList .= $this->getSelectJoinColumnSQL( - $tableAlias, - $srcColumn, - isset($assoc['inherited']) ? $assoc['inherited'] : $this->_class->name - ); - } - } - } - } - - $this->_selectColumnListSql = $columnList; - return $this->_selectColumnListSql; - } - - /** {@inheritdoc} */ - protected function _getInsertColumnList() - { - $columns = parent::_getInsertColumnList(); - - // Add discriminator column to the INSERT SQL - $columns[] = $this->_class->discriminatorColumn['name']; - - return $columns; - } - - /** {@inheritdoc} */ - protected function _getSQLTableAlias($className, $assocName = '') - { - return parent::_getSQLTableAlias($this->_class->rootEntityName, $assocName); - } - - /** {@inheritdoc} */ - protected function _getSelectConditionSQL(array $criteria, $assoc = null) - { - $conditionSql = parent::_getSelectConditionSQL($criteria, $assoc); - - // Append discriminator condition - if ($conditionSql) $conditionSql .= ' AND '; - - $values = array(); - - if ($this->_class->discriminatorValue !== null) { // discriminators can be 0 - $values[] = $this->_conn->quote($this->_class->discriminatorValue); - } - - $discrValues = array_flip($this->_class->discriminatorMap); - - foreach ($this->_class->subClasses as $subclassName) { - $values[] = $this->_conn->quote($discrValues[$subclassName]); - } - - $conditionSql .= $this->_getSQLTableAlias($this->_class->name) . '.' . $this->_class->discriminatorColumn['name'] - . ' IN (' . implode(', ', $values) . ')'; - - return $conditionSql; - } - - /** {@inheritdoc} */ - protected function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias) - { - // Ensure that the filters are applied to the root entity of the inheritance tree - $targetEntity = $this->_em->getClassMetadata($targetEntity->rootEntityName); - // we dont care about the $targetTableAlias, in a STI there is only one table. - - return parent::generateFilterConditionSQL($targetEntity, $targetTableAlias); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/UnionSubclassPersister.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/UnionSubclassPersister.php deleted file mode 100644 index ef844a7..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/UnionSubclassPersister.php +++ /dev/null @@ -1,8 +0,0 @@ -. -*/ - -namespace Doctrine\ORM; - -/** - * Pessimistic Lock Exception - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 1.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Roman Borschel - */ -class PessimisticLockException extends ORMException -{ - public static function lockFailed() - { - return new self("The pessimistic lock failed."); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/Autoloader.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/Autoloader.php deleted file mode 100644 index 876b3f2..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/Autoloader.php +++ /dev/null @@ -1,78 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Proxy; - -/** - * Special Autoloader for Proxy classes because them not being PSR-0 compatible. - * - * @author Benjamin Eberlei - */ -class Autoloader -{ - /** - * Resolve proxy class name to a filename based on the following pattern. - * - * 1. Remove Proxy namespace from class name - * 2. Remove namespace seperators from remaining class name. - * 3. Return PHP filename from proxy-dir with the result from 2. - * - * @param string $proxyDir - * @param string $proxyNamespace - * @param string $className - * @return string - */ - static public function resolveFile($proxyDir, $proxyNamespace, $className) - { - if (0 !== strpos($className, $proxyNamespace)) { - throw ProxyException::notProxyClass($className, $proxyNamespace); - } - - $className = str_replace('\\', '', substr($className, strlen($proxyNamespace) +1)); - return $proxyDir . DIRECTORY_SEPARATOR . $className.'.php'; - } - - /** - * Register and return autoloader callback for the given proxy dir and - * namespace. - * - * @param string $proxyDir - * @param string $proxyNamespace - * @param Closure $notFoundCallback Invoked when the proxy file is not found. - * @return Closure - */ - static public function register($proxyDir, $proxyNamespace, \Closure $notFoundCallback = null) - { - $proxyNamespace = ltrim($proxyNamespace, "\\"); - $autoloader = function($className) use ($proxyDir, $proxyNamespace, $notFoundCallback) { - if (0 === strpos($className, $proxyNamespace)) { - $file = Autoloader::resolveFile($proxyDir, $proxyNamespace, $className); - - if ($notFoundCallback && ! file_exists($file)) { - $notFoundCallback($proxyDir, $proxyNamespace, $className); - } - - require $file; - } - }; - spl_autoload_register($autoloader); - return $autoloader; - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/Proxy.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/Proxy.php deleted file mode 100644 index 09e2b33..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/Proxy.php +++ /dev/null @@ -1,30 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Proxy; - -use Doctrine\Common\Persistence\Proxy as BaseProxy; - -/** - * Interface for proxy classes. - * - * @author Roman Borschel - * @since 2.0 - */ -interface Proxy extends BaseProxy {} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyException.php deleted file mode 100644 index 2196412..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyException.php +++ /dev/null @@ -1,51 +0,0 @@ -. -*/ - -namespace Doctrine\ORM\Proxy; - -/** - * ORM Proxy Exception - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 1.0 - * @version $Revision$ - * @author Benjamin Eberlei - */ -class ProxyException extends \Doctrine\ORM\ORMException { - - public static function proxyDirectoryRequired() { - return new self("You must configure a proxy directory. See docs for details"); - } - - public static function proxyNamespaceRequired() { - return new self("You must configure a proxy namespace. See docs for details"); - } - - public static function notProxyClass($className, $proxyNamespace) - { - return new self(sprintf( - "The class %s is not part of the proxy namespace %s", - $className, $proxyNamespace - )); - } - -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyFactory.php deleted file mode 100644 index c8ddb9c..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyFactory.php +++ /dev/null @@ -1,414 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Proxy; - -use Doctrine\ORM\EntityManager, - Doctrine\ORM\Mapping\ClassMetadata, - Doctrine\Common\Util\ClassUtils; - -/** - * This factory is used to create proxy objects for entities at runtime. - * - * @author Roman Borschel - * @author Giorgio Sironi - * @since 2.0 - */ -class ProxyFactory -{ - /** The EntityManager this factory is bound to. */ - private $_em; - /** Whether to automatically (re)generate proxy classes. */ - private $_autoGenerate; - /** The namespace that contains all proxy classes. */ - private $_proxyNamespace; - /** The directory that contains all proxy classes. */ - private $_proxyDir; - - /** - * Used to match very simple id methods that don't need - * to be proxied since the identifier is known. - * - * @var string - */ - const PATTERN_MATCH_ID_METHOD = '((public\s)?(function\s{1,}%s\s?\(\)\s{1,})\s{0,}{\s{0,}return\s{0,}\$this->%s;\s{0,}})i'; - - /** - * Initializes a new instance of the ProxyFactory class that is - * connected to the given EntityManager. - * - * @param EntityManager $em The EntityManager the new factory works for. - * @param string $proxyDir The directory to use for the proxy classes. It must exist. - * @param string $proxyNs The namespace to use for the proxy classes. - * @param boolean $autoGenerate Whether to automatically generate proxy classes. - */ - public function __construct(EntityManager $em, $proxyDir, $proxyNs, $autoGenerate = false) - { - if ( ! $proxyDir) { - throw ProxyException::proxyDirectoryRequired(); - } - if ( ! $proxyNs) { - throw ProxyException::proxyNamespaceRequired(); - } - $this->_em = $em; - $this->_proxyDir = $proxyDir; - $this->_autoGenerate = $autoGenerate; - $this->_proxyNamespace = $proxyNs; - } - - /** - * Gets a reference proxy instance for the entity of the given type and identified by - * the given identifier. - * - * @param string $className - * @param mixed $identifier - * @return object - */ - public function getProxy($className, $identifier) - { - $fqn = ClassUtils::generateProxyClassName($className, $this->_proxyNamespace); - - if (! class_exists($fqn, false)) { - $fileName = $this->getProxyFileName($className); - if ($this->_autoGenerate) { - $this->_generateProxyClass($this->_em->getClassMetadata($className), $fileName, self::$_proxyClassTemplate); - } - require $fileName; - } - - if ( ! $this->_em->getMetadataFactory()->hasMetadataFor($fqn)) { - $this->_em->getMetadataFactory()->setMetadataFor($fqn, $this->_em->getClassMetadata($className)); - } - - $entityPersister = $this->_em->getUnitOfWork()->getEntityPersister($className); - - return new $fqn($entityPersister, $identifier); - } - - /** - * Generate the Proxy file name - * - * @param string $className - * @param string $baseDir Optional base directory for proxy file name generation. - * If not specified, the directory configured on the Configuration of the - * EntityManager will be used by this factory. - * @return string - */ - private function getProxyFileName($className, $baseDir = null) - { - $proxyDir = $baseDir ?: $this->_proxyDir; - - return $proxyDir . DIRECTORY_SEPARATOR . '__CG__' . str_replace('\\', '', $className) . '.php'; - } - - /** - * Generates proxy classes for all given classes. - * - * @param array $classes The classes (ClassMetadata instances) for which to generate proxies. - * @param string $toDir The target directory of the proxy classes. If not specified, the - * directory configured on the Configuration of the EntityManager used - * by this factory is used. - * @return int Number of generated proxies. - */ - public function generateProxyClasses(array $classes, $toDir = null) - { - $proxyDir = $toDir ?: $this->_proxyDir; - $proxyDir = rtrim($proxyDir, DIRECTORY_SEPARATOR); - $num = 0; - - foreach ($classes as $class) { - /* @var $class ClassMetadata */ - if ($class->isMappedSuperclass || $class->reflClass->isAbstract()) { - continue; - } - - $proxyFileName = $this->getProxyFileName($class->name, $proxyDir); - - $this->_generateProxyClass($class, $proxyFileName, self::$_proxyClassTemplate); - $num++; - } - - return $num; - } - - /** - * Generates a proxy class file. - * - * @param $class - * @param $proxyClassName - * @param $file The path of the file to write to. - */ - private function _generateProxyClass($class, $fileName, $file) - { - $methods = $this->_generateMethods($class); - $sleepImpl = $this->_generateSleep($class); - $cloneImpl = $class->reflClass->hasMethod('__clone') ? 'parent::__clone();' : ''; // hasMethod() checks case-insensitive - - $placeholders = array( - '', - '', '', - '', '', '' - ); - - $className = ltrim($class->name, '\\'); - $proxyClassName = ClassUtils::generateProxyClassName($class->name, $this->_proxyNamespace); - $parts = explode('\\', strrev($proxyClassName), 2); - $proxyClassNamespace = strrev($parts[1]); - $proxyClassName = strrev($parts[0]); - - $replacements = array( - $proxyClassNamespace, - $proxyClassName, - $className, - $methods, - $sleepImpl, - $cloneImpl - ); - - $file = str_replace($placeholders, $replacements, $file); - - $parentDirectory = dirname($fileName); - - if ( ! is_dir($parentDirectory)) { - if (false === @mkdir($parentDirectory, 0775, true)) { - throw ProxyException::proxyDirectoryNotWritable(); - } - } else if ( ! is_writable($parentDirectory)) { - throw ProxyException::proxyDirectoryNotWritable(); - } - - $tmpFileName = $fileName . '.' . uniqid("", true); - file_put_contents($tmpFileName, $file); - rename($tmpFileName, $fileName); - } - - /** - * Generates the methods of a proxy class. - * - * @param ClassMetadata $class - * @return string The code of the generated methods. - */ - private function _generateMethods(ClassMetadata $class) - { - $methods = ''; - - $methodNames = array(); - foreach ($class->reflClass->getMethods() as $method) { - /* @var $method ReflectionMethod */ - if ($method->isConstructor() || in_array(strtolower($method->getName()), array("__sleep", "__clone")) || isset($methodNames[$method->getName()])) { - continue; - } - $methodNames[$method->getName()] = true; - - if ($method->isPublic() && ! $method->isFinal() && ! $method->isStatic()) { - $methods .= "\n" . ' public function '; - if ($method->returnsReference()) { - $methods .= '&'; - } - $methods .= $method->getName() . '('; - $firstParam = true; - $parameterString = $argumentString = ''; - - foreach ($method->getParameters() as $param) { - if ($firstParam) { - $firstParam = false; - } else { - $parameterString .= ', '; - $argumentString .= ', '; - } - - // We need to pick the type hint class too - if (($paramClass = $param->getClass()) !== null) { - $parameterString .= '\\' . $paramClass->getName() . ' '; - } else if ($param->isArray()) { - $parameterString .= 'array '; - } - - if ($param->isPassedByReference()) { - $parameterString .= '&'; - } - - $parameterString .= '$' . $param->getName(); - $argumentString .= '$' . $param->getName(); - - if ($param->isDefaultValueAvailable()) { - $parameterString .= ' = ' . var_export($param->getDefaultValue(), true); - } - } - - $methods .= $parameterString . ')'; - $methods .= "\n" . ' {' . "\n"; - if ($this->isShortIdentifierGetter($method, $class)) { - $identifier = lcfirst(substr($method->getName(), 3)); - - $cast = in_array($class->fieldMappings[$identifier]['type'], array('integer', 'smallint')) ? '(int) ' : ''; - - $methods .= ' if ($this->__isInitialized__ === false) {' . "\n"; - $methods .= ' return ' . $cast . '$this->_identifier["' . $identifier . '"];' . "\n"; - $methods .= ' }' . "\n"; - } - $methods .= ' $this->__load();' . "\n"; - $methods .= ' return parent::' . $method->getName() . '(' . $argumentString . ');'; - $methods .= "\n" . ' }' . "\n"; - } - } - - return $methods; - } - - /** - * Check if the method is a short identifier getter. - * - * What does this mean? For proxy objects the identifier is already known, - * however accessing the getter for this identifier usually triggers the - * lazy loading, leading to a query that may not be necessary if only the - * ID is interesting for the userland code (for example in views that - * generate links to the entity, but do not display anything else). - * - * @param ReflectionMethod $method - * @param ClassMetadata $class - * @return bool - */ - private function isShortIdentifierGetter($method, $class) - { - $identifier = lcfirst(substr($method->getName(), 3)); - $cheapCheck = ( - $method->getNumberOfParameters() == 0 && - substr($method->getName(), 0, 3) == "get" && - in_array($identifier, $class->identifier, true) && - $class->hasField($identifier) && - (($method->getEndLine() - $method->getStartLine()) <= 4) - && in_array($class->fieldMappings[$identifier]['type'], array('integer', 'bigint', 'smallint', 'string')) - ); - - if ($cheapCheck) { - $code = file($method->getDeclaringClass()->getFileName()); - $code = trim(implode(" ", array_slice($code, $method->getStartLine() - 1, $method->getEndLine() - $method->getStartLine() + 1))); - - $pattern = sprintf(self::PATTERN_MATCH_ID_METHOD, $method->getName(), $identifier); - - if (preg_match($pattern, $code)) { - return true; - } - } - return false; - } - - /** - * Generates the code for the __sleep method for a proxy class. - * - * @param $class - * @return string - */ - private function _generateSleep(ClassMetadata $class) - { - $sleepImpl = ''; - - if ($class->reflClass->hasMethod('__sleep')) { - $sleepImpl .= "return array_merge(array('__isInitialized__'), parent::__sleep());"; - } else { - $sleepImpl .= "return array('__isInitialized__', "; - $first = true; - - foreach ($class->getReflectionProperties() as $name => $prop) { - if ($first) { - $first = false; - } else { - $sleepImpl .= ', '; - } - - $sleepImpl .= "'" . $name . "'"; - } - - $sleepImpl .= ');'; - } - - return $sleepImpl; - } - - /** Proxy class code template */ - private static $_proxyClassTemplate = -'; - -/** - * THIS CLASS WAS GENERATED BY THE DOCTRINE ORM. DO NOT EDIT THIS FILE. - */ -class extends \ implements \Doctrine\ORM\Proxy\Proxy -{ - private $_entityPersister; - private $_identifier; - public $__isInitialized__ = false; - public function __construct($entityPersister, $identifier) - { - $this->_entityPersister = $entityPersister; - $this->_identifier = $identifier; - } - /** @private */ - public function __load() - { - if (!$this->__isInitialized__ && $this->_entityPersister) { - $this->__isInitialized__ = true; - - if (method_exists($this, "__wakeup")) { - // call this after __isInitialized__to avoid infinite recursion - // but before loading to emulate what ClassMetadata::newInstance() - // provides. - $this->__wakeup(); - } - - if ($this->_entityPersister->load($this->_identifier, $this) === null) { - throw new \Doctrine\ORM\EntityNotFoundException(); - } - unset($this->_entityPersister, $this->_identifier); - } - } - - /** @private */ - public function __isInitialized() - { - return $this->__isInitialized__; - } - - - - public function __sleep() - { - - } - - public function __clone() - { - if (!$this->__isInitialized__ && $this->_entityPersister) { - $this->__isInitialized__ = true; - $class = $this->_entityPersister->getClassMetadata(); - $original = $this->_entityPersister->load($this->_identifier); - if ($original === null) { - throw new \Doctrine\ORM\EntityNotFoundException(); - } - foreach ($class->reflFields AS $field => $reflProperty) { - $reflProperty->setValue($this, $reflProperty->getValue($original)); - } - unset($this->_entityPersister, $this->_identifier); - } - - } -}'; -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php deleted file mode 100644 index 71a41e5..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php +++ /dev/null @@ -1,615 +0,0 @@ -. - */ - -namespace Doctrine\ORM; - -use Doctrine\DBAL\LockMode, - Doctrine\ORM\Query\Parser, - Doctrine\ORM\Query\ParserResult, - Doctrine\ORM\Query\QueryException; - -/** - * A Query object represents a DQL query. - * - * @since 1.0 - * @author Guilherme Blanco - * @author Konsta Vesterinen - * @author Roman Borschel - */ -final class Query extends AbstractQuery -{ - /* Query STATES */ - /** - * A query object is in CLEAN state when it has NO unparsed/unprocessed DQL parts. - */ - const STATE_CLEAN = 1; - /** - * A query object is in state DIRTY when it has DQL parts that have not yet been - * parsed/processed. This is automatically defined as DIRTY when addDqlQueryPart - * is called. - */ - const STATE_DIRTY = 2; - - /* Query HINTS */ - /** - * The refresh hint turns any query into a refresh query with the result that - * any local changes in entities are overridden with the fetched values. - * - * @var string - */ - const HINT_REFRESH = 'doctrine.refresh'; - - - /** - * Internal hint: is set to the proxy entity that is currently triggered for loading - * - * @var string - */ - const HINT_REFRESH_ENTITY = 'doctrine.refresh.entity'; - - /** - * The forcePartialLoad query hint forces a particular query to return - * partial objects. - * - * @var string - * @todo Rename: HINT_OPTIMIZE - */ - const HINT_FORCE_PARTIAL_LOAD = 'doctrine.forcePartialLoad'; - /** - * The includeMetaColumns query hint causes meta columns like foreign keys and - * discriminator columns to be selected and returned as part of the query result. - * - * This hint does only apply to non-object queries. - * - * @var string - */ - const HINT_INCLUDE_META_COLUMNS = 'doctrine.includeMetaColumns'; - - /** - * An array of class names that implement \Doctrine\ORM\Query\TreeWalker and - * are iterated and executed after the DQL has been parsed into an AST. - * - * @var string - */ - const HINT_CUSTOM_TREE_WALKERS = 'doctrine.customTreeWalkers'; - - /** - * A string with a class name that implements \Doctrine\ORM\Query\TreeWalker - * and is used for generating the target SQL from any DQL AST tree. - * - * @var string - */ - const HINT_CUSTOM_OUTPUT_WALKER = 'doctrine.customOutputWalker'; - - //const HINT_READ_ONLY = 'doctrine.readOnly'; - - /** - * @var string - */ - const HINT_INTERNAL_ITERATION = 'doctrine.internal.iteration'; - - /** - * @var string - */ - const HINT_LOCK_MODE = 'doctrine.lockMode'; - - /** - * @var integer $_state The current state of this query. - */ - private $_state = self::STATE_CLEAN; - - /** - * @var string $_dql Cached DQL query. - */ - private $_dql = null; - - /** - * @var \Doctrine\ORM\Query\ParserResult The parser result that holds DQL => SQL information. - */ - private $_parserResult; - - /** - * @var integer The first result to return (the "offset"). - */ - private $_firstResult = null; - - /** - * @var integer The maximum number of results to return (the "limit"). - */ - private $_maxResults = null; - - /** - * @var CacheDriver The cache driver used for caching queries. - */ - private $_queryCache; - - /** - * @var boolean Boolean value that indicates whether or not expire the query cache. - */ - private $_expireQueryCache = false; - - /** - * @var int Query Cache lifetime. - */ - private $_queryCacheTTL; - - /** - * @var boolean Whether to use a query cache, if available. Defaults to TRUE. - */ - private $_useQueryCache = true; - - // End of Caching Stuff - - /** - * Initializes a new Query instance. - * - * @param \Doctrine\ORM\EntityManager $entityManager - */ - /*public function __construct(EntityManager $entityManager) - { - parent::__construct($entityManager); - }*/ - - /** - * Gets the SQL query/queries that correspond to this DQL query. - * - * @return mixed The built sql query or an array of all sql queries. - * @override - */ - public function getSQL() - { - return $this->_parse()->getSQLExecutor()->getSQLStatements(); - } - - /** - * Returns the corresponding AST for this DQL query. - * - * @return \Doctrine\ORM\Query\AST\SelectStatement | - * \Doctrine\ORM\Query\AST\UpdateStatement | - * \Doctrine\ORM\Query\AST\DeleteStatement - */ - public function getAST() - { - $parser = new Parser($this); - return $parser->getAST(); - } - - /** - * Parses the DQL query, if necessary, and stores the parser result. - * - * Note: Populates $this->_parserResult as a side-effect. - * - * @return \Doctrine\ORM\Query\ParserResult - */ - private function _parse() - { - // Return previous parser result if the query and the filter collection are both clean - if ($this->_state === self::STATE_CLEAN - && $this->_em->isFiltersStateClean() - ) { - return $this->_parserResult; - } - - $this->_state = self::STATE_CLEAN; - - // Check query cache. - if ( ! ($this->_useQueryCache && ($queryCache = $this->getQueryCacheDriver()))) { - $parser = new Parser($this); - $this->_parserResult = $parser->parse(); - - return $this->_parserResult; - } - - $hash = $this->_getQueryCacheId(); - $cached = $this->_expireQueryCache ? false : $queryCache->fetch($hash); - - if ($cached instanceof ParserResult) { - // Cache hit. - $this->_parserResult = $cached; - - return $this->_parserResult; - } - - // Cache miss. - $parser = new Parser($this); - $this->_parserResult = $parser->parse(); - $queryCache->save($hash, $this->_parserResult, $this->_queryCacheTTL); - - return $this->_parserResult; - } - - /** - * {@inheritdoc} - */ - protected function _doExecute() - { - $executor = $this->_parse()->getSqlExecutor(); - - if ($this->_queryCacheProfile) { - $executor->setQueryCacheProfile($this->_queryCacheProfile); - } - - // Prepare parameters - $paramMappings = $this->_parserResult->getParameterMappings(); - - if (count($paramMappings) != count($this->_params)) { - throw QueryException::invalidParameterNumber(); - } - - list($sqlParams, $types) = $this->processParameterMappings($paramMappings); - - if ($this->_resultSetMapping === null) { - $this->_resultSetMapping = $this->_parserResult->getResultSetMapping(); - } - - return $executor->execute($this->_em->getConnection(), $sqlParams, $types); - } - - /** - * Processes query parameter mappings - * - * @param array $paramMappings - * @return array - */ - private function processParameterMappings($paramMappings) - { - $sqlParams = $types = array(); - - foreach ($this->_params as $key => $value) { - if ( ! isset($paramMappings[$key])) { - throw QueryException::unknownParameter($key); - } - - if (isset($this->_paramTypes[$key])) { - foreach ($paramMappings[$key] as $position) { - $types[$position] = $this->_paramTypes[$key]; - } - } - - $sqlPositions = $paramMappings[$key]; - // optimized multi value sql positions away for now, they are not allowed in DQL anyways. - $value = array($value); - $countValue = count($value); - - for ($i = 0, $l = count($sqlPositions); $i < $l; $i++) { - $sqlParams[$sqlPositions[$i]] = $value[($i % $countValue)]; - } - } - - if (count($sqlParams) != count($types)) { - throw QueryException::parameterTypeMissmatch(); - } - - if ($sqlParams) { - ksort($sqlParams); - $sqlParams = array_values($sqlParams); - - ksort($types); - $types = array_values($types); - } - - return array($sqlParams, $types); - } - - /** - * Defines a cache driver to be used for caching queries. - * - * @param Doctrine_Cache_Interface|null $driver Cache driver - * @return Query This query instance. - */ - public function setQueryCacheDriver($queryCache) - { - $this->_queryCache = $queryCache; - - return $this; - } - - /** - * Defines whether the query should make use of a query cache, if available. - * - * @param boolean $bool - * @return @return Query This query instance. - */ - public function useQueryCache($bool) - { - $this->_useQueryCache = $bool; - - return $this; - } - - /** - * Returns the cache driver used for query caching. - * - * @return CacheDriver The cache driver used for query caching or NULL, if this - * Query does not use query caching. - */ - public function getQueryCacheDriver() - { - if ($this->_queryCache) { - return $this->_queryCache; - } - - return $this->_em->getConfiguration()->getQueryCacheImpl(); - } - - /** - * Defines how long the query cache will be active before expire. - * - * @param integer $timeToLive How long the cache entry is valid - * @return Query This query instance. - */ - public function setQueryCacheLifetime($timeToLive) - { - if ($timeToLive !== null) { - $timeToLive = (int) $timeToLive; - } - - $this->_queryCacheTTL = $timeToLive; - - return $this; - } - - /** - * Retrieves the lifetime of resultset cache. - * - * @return int - */ - public function getQueryCacheLifetime() - { - return $this->_queryCacheTTL; - } - - /** - * Defines if the query cache is active or not. - * - * @param boolean $expire Whether or not to force query cache expiration. - * @return Query This query instance. - */ - public function expireQueryCache($expire = true) - { - $this->_expireQueryCache = $expire; - - return $this; - } - - /** - * Retrieves if the query cache is active or not. - * - * @return bool - */ - public function getExpireQueryCache() - { - return $this->_expireQueryCache; - } - - /** - * @override - */ - public function free() - { - parent::free(); - - $this->_dql = null; - $this->_state = self::STATE_CLEAN; - } - - /** - * Sets a DQL query string. - * - * @param string $dqlQuery DQL Query - * @return \Doctrine\ORM\AbstractQuery - */ - public function setDQL($dqlQuery) - { - if ($dqlQuery !== null) { - $this->_dql = $dqlQuery; - $this->_state = self::STATE_DIRTY; - } - - return $this; - } - - /** - * Returns the DQL query that is represented by this query object. - * - * @return string DQL query - */ - public function getDQL() - { - return $this->_dql; - } - - /** - * Returns the state of this query object - * By default the type is Doctrine_ORM_Query_Abstract::STATE_CLEAN but if it appears any unprocessed DQL - * part, it is switched to Doctrine_ORM_Query_Abstract::STATE_DIRTY. - * - * @see AbstractQuery::STATE_CLEAN - * @see AbstractQuery::STATE_DIRTY - * - * @return integer Return the query state - */ - public function getState() - { - return $this->_state; - } - - /** - * Method to check if an arbitrary piece of DQL exists - * - * @param string $dql Arbitrary piece of DQL to check for - * @return boolean - */ - public function contains($dql) - { - return stripos($this->getDQL(), $dql) === false ? false : true; - } - - /** - * Sets the position of the first result to retrieve (the "offset"). - * - * @param integer $firstResult The first result to return. - * @return Query This query object. - */ - public function setFirstResult($firstResult) - { - $this->_firstResult = $firstResult; - $this->_state = self::STATE_DIRTY; - - return $this; - } - - /** - * Gets the position of the first result the query object was set to retrieve (the "offset"). - * Returns NULL if {@link setFirstResult} was not applied to this query. - * - * @return integer The position of the first result. - */ - public function getFirstResult() - { - return $this->_firstResult; - } - - /** - * Sets the maximum number of results to retrieve (the "limit"). - * - * @param integer $maxResults - * @return Query This query object. - */ - public function setMaxResults($maxResults) - { - $this->_maxResults = $maxResults; - $this->_state = self::STATE_DIRTY; - - return $this; - } - - /** - * Gets the maximum number of results the query object was set to retrieve (the "limit"). - * Returns NULL if {@link setMaxResults} was not applied to this query. - * - * @return integer Maximum number of results. - */ - public function getMaxResults() - { - return $this->_maxResults; - } - - /** - * Executes the query and returns an IterableResult that can be used to incrementally - * iterated over the result. - * - * @param array $params The query parameters. - * @param integer $hydrationMode The hydration mode to use. - * @return \Doctrine\ORM\Internal\Hydration\IterableResult - */ - public function iterate(array $params = array(), $hydrationMode = self::HYDRATE_OBJECT) - { - $this->setHint(self::HINT_INTERNAL_ITERATION, true); - - return parent::iterate($params, $hydrationMode); - } - - /** - * {@inheritdoc} - */ - public function setHint($name, $value) - { - $this->_state = self::STATE_DIRTY; - - return parent::setHint($name, $value); - } - - /** - * {@inheritdoc} - */ - public function setHydrationMode($hydrationMode) - { - $this->_state = self::STATE_DIRTY; - - return parent::setHydrationMode($hydrationMode); - } - - /** - * Set the lock mode for this Query. - * - * @see \Doctrine\DBAL\LockMode - * @param int $lockMode - * @return Query - */ - public function setLockMode($lockMode) - { - if ($lockMode === LockMode::PESSIMISTIC_READ || $lockMode === LockMode::PESSIMISTIC_WRITE) { - if ( ! $this->_em->getConnection()->isTransactionActive()) { - throw TransactionRequiredException::transactionRequired(); - } - } - - $this->setHint(self::HINT_LOCK_MODE, $lockMode); - - return $this; - } - - /** - * Get the current lock mode for this query. - * - * @return int - */ - public function getLockMode() - { - $lockMode = $this->getHint(self::HINT_LOCK_MODE); - - if ( ! $lockMode) { - return LockMode::NONE; - } - - return $lockMode; - } - - /** - * Generate a cache id for the query cache - reusing the Result-Cache-Id generator. - * - * The query cache - * - * @return string - */ - protected function _getQueryCacheId() - { - ksort($this->_hints); - - return md5( - $this->getDql() . var_export($this->_hints, true) . - ($this->_em->hasFilters() ? $this->_em->getFilters()->getHash() : '') . - '&firstResult=' . $this->_firstResult . '&maxResult=' . $this->_maxResults . - '&hydrationMode='.$this->_hydrationMode.'DOCTRINE_QUERY_CACHE_SALT' - ); - } - - /** - * Cleanup Query resource when clone is called. - * - * @return void - */ - public function __clone() - { - parent::__clone(); - - $this->_state = self::STATE_DIRTY; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ASTException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ASTException.php deleted file mode 100644 index 7472572..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ASTException.php +++ /dev/null @@ -1,13 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * Description of AggregateExpression - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class AggregateExpression extends Node -{ - public $functionName; - public $pathExpression; - public $isDistinct = false; // Some aggregate expressions support distinct, eg COUNT - - public function __construct($functionName, $pathExpression, $isDistinct) - { - $this->functionName = $functionName; - $this->pathExpression = $pathExpression; - $this->isDistinct = $isDistinct; - } - - public function dispatch($walker) - { - return $walker->walkAggregateExpression($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ArithmeticExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ArithmeticExpression.php deleted file mode 100644 index 679cbcc..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ArithmeticExpression.php +++ /dev/null @@ -1,54 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * ArithmeticExpression ::= SimpleArithmeticExpression | "(" Subselect ")" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ArithmeticExpression extends Node -{ - public $simpleArithmeticExpression; - public $subselect; - - public function isSimpleArithmeticExpression() - { - return (bool) $this->simpleArithmeticExpression; - } - - public function isSubselect() - { - return (bool) $this->subselect; - } - - public function dispatch($walker) - { - return $walker->walkArithmeticExpression($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ArithmeticFactor.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ArithmeticFactor.php deleted file mode 100644 index 3ad6abf..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ArithmeticFactor.php +++ /dev/null @@ -1,67 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * ArithmeticFactor ::= [("+" | "-")] ArithmeticPrimary - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ArithmeticFactor extends Node -{ - /** - * @var ArithmeticPrimary - */ - public $arithmeticPrimary; - - /** - * @var null|boolean NULL represents no sign, TRUE means positive and FALSE means negative sign - */ - public $sign; - - public function __construct($arithmeticPrimary, $sign = null) - { - $this->arithmeticPrimary = $arithmeticPrimary; - $this->sign = $sign; - } - - public function isPositiveSigned() - { - return $this->sign === true; - } - - public function isNegativeSigned() - { - return $this->sign === false; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkArithmeticFactor($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ArithmeticTerm.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ArithmeticTerm.php deleted file mode 100644 index a233e05..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ArithmeticTerm.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * ArithmeticTerm ::= ArithmeticFactor {("*" | "/") ArithmeticFactor}* - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ArithmeticTerm extends Node -{ - public $arithmeticFactors; - - public function __construct(array $arithmeticFactors) - { - $this->arithmeticFactors = $arithmeticFactors; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkArithmeticTerm($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/BetweenExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/BetweenExpression.php deleted file mode 100644 index c00bca4..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/BetweenExpression.php +++ /dev/null @@ -1,54 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * Description of BetweenExpression - * - @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class BetweenExpression extends Node -{ - public $expression; - public $leftBetweenExpression; - public $rightBetweenExpression; - public $not; - - public function __construct($expr, $leftExpr, $rightExpr) - { - $this->expression = $expr; - $this->leftBetweenExpression = $leftExpr; - $this->rightBetweenExpression = $rightExpr; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkBetweenExpression($this); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/CoalesceExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/CoalesceExpression.php deleted file mode 100644 index dae0742..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/CoalesceExpression.php +++ /dev/null @@ -1,47 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * CoalesceExpression ::= "COALESCE" "(" ScalarExpression {"," ScalarExpression}* ")" - * - * @since 2.1 - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class CoalesceExpression extends Node -{ - public $scalarExpressions = array(); - - - public function __construct(array $scalarExpressions) - { - $this->scalarExpressions = $scalarExpressions; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkCoalesceExpression($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/CollectionMemberExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/CollectionMemberExpression.php deleted file mode 100644 index 62d756b..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/CollectionMemberExpression.php +++ /dev/null @@ -1,52 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * CollectionMemberExpression ::= EntityExpression ["NOT"] "MEMBER" ["OF"] CollectionValuedPathExpression - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class CollectionMemberExpression extends Node -{ - public $entityExpression; - public $collectionValuedPathExpression; - public $not; - - public function __construct($entityExpr, $collValuedPathExpr) - { - $this->entityExpression = $entityExpr; - $this->collectionValuedPathExpression = $collValuedPathExpr; - } - - public function dispatch($walker) - { - return $walker->walkCollectionMemberExpression($this); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ComparisonExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ComparisonExpression.php deleted file mode 100644 index a13ae26..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ComparisonExpression.php +++ /dev/null @@ -1,57 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * ComparisonExpression ::= ArithmeticExpression ComparisonOperator ( QuantifiedExpression | ArithmeticExpression ) | - * StringExpression ComparisonOperator (StringExpression | QuantifiedExpression) | - * BooleanExpression ("=" | "<>" | "!=") (BooleanExpression | QuantifiedExpression) | - * EnumExpression ("=" | "<>" | "!=") (EnumExpression | QuantifiedExpression) | - * DatetimeExpression ComparisonOperator (DatetimeExpression | QuantifiedExpression) | - * EntityExpression ("=" | "<>") (EntityExpression | QuantifiedExpression) - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ComparisonExpression extends Node -{ - public $leftExpression; - public $rightExpression; - public $operator; - - public function __construct($leftExpr, $operator, $rightExpr) - { - $this->leftExpression = $leftExpr; - $this->rightExpression = $rightExpr; - $this->operator = $operator; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkComparisonExpression($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalExpression.php deleted file mode 100644 index d2e7762..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalExpression.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * ConditionalExpression ::= ConditionalTerm {"OR" ConditionalTerm}* - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ConditionalExpression extends Node -{ - public $conditionalTerms = array(); - - public function __construct(array $conditionalTerms) - { - $this->conditionalTerms = $conditionalTerms; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkConditionalExpression($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalFactor.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalFactor.php deleted file mode 100644 index f0b165b..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalFactor.php +++ /dev/null @@ -1,49 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * ConditionalFactor ::= ["NOT"] ConditionalPrimary - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ConditionalFactor extends Node -{ - public $not = false; - public $conditionalPrimary; - - public function __construct($conditionalPrimary) - { - $this->conditionalPrimary = $conditionalPrimary; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkConditionalFactor($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalPrimary.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalPrimary.php deleted file mode 100644 index 0e3f127..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalPrimary.php +++ /dev/null @@ -1,54 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * ConditionalPrimary ::= SimpleConditionalExpression | "(" ConditionalExpression ")" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ConditionalPrimary extends Node -{ - public $simpleConditionalExpression; - public $conditionalExpression; - - public function isSimpleConditionalExpression() - { - return (bool) $this->simpleConditionalExpression; - } - - public function isConditionalExpression() - { - return (bool) $this->conditionalExpression; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkConditionalPrimary($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalTerm.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalTerm.php deleted file mode 100644 index 78ba6a2..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalTerm.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * ConditionalTerm ::= ConditionalFactor {"AND" ConditionalFactor}* - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ConditionalTerm extends Node -{ - public $conditionalFactors = array(); - - public function __construct(array $conditionalFactors) - { - $this->conditionalFactors = $conditionalFactors; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkConditionalTerm($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/DeleteClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/DeleteClause.php deleted file mode 100644 index 4acf49c..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/DeleteClause.php +++ /dev/null @@ -1,50 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * DeleteClause ::= "DELETE" ["FROM"] AbstractSchemaName [["AS"] AliasIdentificationVariable] - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class DeleteClause extends Node -{ - public $abstractSchemaName; - public $aliasIdentificationVariable; - - public function __construct($abstractSchemaName) - { - $this->abstractSchemaName = $abstractSchemaName; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkDeleteClause($this); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/DeleteStatement.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/DeleteStatement.php deleted file mode 100644 index 01c6acb..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/DeleteStatement.php +++ /dev/null @@ -1,49 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * DeleteStatement = DeleteClause [WhereClause] - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class DeleteStatement extends Node -{ - public $deleteClause; - public $whereClause; - - public function __construct($deleteClause) - { - $this->deleteClause = $deleteClause; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkDeleteStatement($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/EmptyCollectionComparisonExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/EmptyCollectionComparisonExpression.php deleted file mode 100644 index 6bb50e8..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/EmptyCollectionComparisonExpression.php +++ /dev/null @@ -1,50 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * EmptyCollectionComparisonExpression ::= CollectionValuedPathExpression "IS" ["NOT"] "EMPTY" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class EmptyCollectionComparisonExpression extends Node -{ - public $expression; - public $not; - - public function __construct($expression) - { - $this->expression = $expression; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkEmptyCollectionComparisonExpression($this); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ExistsExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ExistsExpression.php deleted file mode 100644 index 3d9ad20..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ExistsExpression.php +++ /dev/null @@ -1,50 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * ExistsExpression ::= ["NOT"] "EXISTS" "(" Subselect ")" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ExistsExpression extends Node -{ - public $not; - public $subselect; - - public function __construct($subselect) - { - $this->subselect = $subselect; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkExistsExpression($this); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/FromClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/FromClause.php deleted file mode 100644 index a4dc628..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/FromClause.php +++ /dev/null @@ -1,45 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * FromClause ::= "FROM" IdentificationVariableDeclaration {"," IdentificationVariableDeclaration} - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class FromClause extends Node -{ - public $identificationVariableDeclarations = array(); - - public function __construct(array $identificationVariableDeclarations) - { - $this->identificationVariableDeclarations = $identificationVariableDeclarations; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkFromClause($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/AbsFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/AbsFunction.php deleted file mode 100644 index 3ee4360..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/AbsFunction.php +++ /dev/null @@ -1,62 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\Lexer; - -/** - * "ABS" "(" SimpleArithmeticExpression ")" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class AbsFunction extends FunctionNode -{ - public $simpleArithmeticExpression; - - /** - * @override - */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) - { - return 'ABS(' . $sqlWalker->walkSimpleArithmeticExpression( - $this->simpleArithmeticExpression - ) . ')'; - } - - /** - * @override - */ - public function parse(\Doctrine\ORM\Query\Parser $parser) - { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); - - $this->simpleArithmeticExpression = $parser->SimpleArithmeticExpression(); - - $parser->match(Lexer::T_CLOSE_PARENTHESIS); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/BitAndFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/BitAndFunction.php deleted file mode 100644 index 1ee8233..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/BitAndFunction.php +++ /dev/null @@ -1,63 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\Lexer; - -/** - * "BIT_AND" "(" ArithmeticPrimary "," ArithmeticPrimary ")" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.2 - * @author Fabio B. Silva - */ -class BitAndFunction extends FunctionNode -{ - public $firstArithmetic; - public $secondArithmetic; - - /** - * @override - */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) - { - $platform = $sqlWalker->getConnection()->getDatabasePlatform(); - return $platform->getBitAndComparisonExpression( - $this->firstArithmetic->dispatch($sqlWalker), - $this->secondArithmetic->dispatch($sqlWalker) - ); - } - - /** - * @override - */ - public function parse(\Doctrine\ORM\Query\Parser $parser) - { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); - - $this->firstArithmetic = $parser->ArithmeticPrimary(); - $parser->match(Lexer::T_COMMA); - $this->secondArithmetic = $parser->ArithmeticPrimary(); - - $parser->match(Lexer::T_CLOSE_PARENTHESIS); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/BitOrFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/BitOrFunction.php deleted file mode 100644 index ba36e97..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/BitOrFunction.php +++ /dev/null @@ -1,63 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\Lexer; - -/** - * "BIT_OR" "(" ArithmeticPrimary "," ArithmeticPrimary ")" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.2 - * @author Fabio B. Silva - */ -class BitOrFunction extends FunctionNode -{ - public $firstArithmetic; - public $secondArithmetic; - - /** - * @override - */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) - { - $platform = $sqlWalker->getConnection()->getDatabasePlatform(); - return $platform->getBitOrComparisonExpression( - $this->firstArithmetic->dispatch($sqlWalker), - $this->secondArithmetic->dispatch($sqlWalker) - ); - } - - /** - * @override - */ - public function parse(\Doctrine\ORM\Query\Parser $parser) - { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); - - $this->firstArithmetic = $parser->ArithmeticPrimary(); - $parser->match(Lexer::T_COMMA); - $this->secondArithmetic = $parser->ArithmeticPrimary(); - - $parser->match(Lexer::T_CLOSE_PARENTHESIS); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/ConcatFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/ConcatFunction.php deleted file mode 100644 index bb2333a..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/ConcatFunction.php +++ /dev/null @@ -1,67 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\Lexer; - -/** - * "CONCAT" "(" StringPrimary "," StringPrimary ")" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class ConcatFunction extends FunctionNode -{ - public $firstStringPrimary; - public $secondStringPriamry; - - /** - * @override - */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) - { - $platform = $sqlWalker->getConnection()->getDatabasePlatform(); - return $platform->getConcatExpression( - $sqlWalker->walkStringPrimary($this->firstStringPrimary), - $sqlWalker->walkStringPrimary($this->secondStringPrimary) - ); - } - - /** - * @override - */ - public function parse(\Doctrine\ORM\Query\Parser $parser) - { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); - - $this->firstStringPrimary = $parser->StringPrimary(); - $parser->match(Lexer::T_COMMA); - $this->secondStringPrimary = $parser->StringPrimary(); - - $parser->match(Lexer::T_CLOSE_PARENTHESIS); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/CurrentDateFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/CurrentDateFunction.php deleted file mode 100644 index 66107cc..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/CurrentDateFunction.php +++ /dev/null @@ -1,54 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\Lexer; - -/** - * "CURRENT_DATE" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class CurrentDateFunction extends FunctionNode -{ - /** - * @override - */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) - { - return $sqlWalker->getConnection()->getDatabasePlatform()->getCurrentDateSQL(); - } - - /** - * @override - */ - public function parse(\Doctrine\ORM\Query\Parser $parser) - { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/CurrentTimeFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/CurrentTimeFunction.php deleted file mode 100644 index 1335755..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/CurrentTimeFunction.php +++ /dev/null @@ -1,54 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\Lexer; - -/** - * "CURRENT_TIME" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class CurrentTimeFunction extends FunctionNode -{ - /** - * @override - */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) - { - return $sqlWalker->getConnection()->getDatabasePlatform()->getCurrentTimeSQL(); - } - - /** - * @override - */ - public function parse(\Doctrine\ORM\Query\Parser $parser) - { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/CurrentTimestampFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/CurrentTimestampFunction.php deleted file mode 100644 index 7b1a25d..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/CurrentTimestampFunction.php +++ /dev/null @@ -1,54 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\Lexer; - -/** - * "CURRENT_TIMESTAMP" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class CurrentTimestampFunction extends FunctionNode -{ - /** - * @override - */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) - { - return $sqlWalker->getConnection()->getDatabasePlatform()->getCurrentTimestampSQL(); - } - - /** - * @override - */ - public function parse(\Doctrine\ORM\Query\Parser $parser) - { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php deleted file mode 100644 index 1d840cc..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php +++ /dev/null @@ -1,71 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\Lexer; -use Doctrine\ORM\Query\SqlWalker; -use Doctrine\ORM\Query\Parser; -use Doctrine\ORM\Query\QueryException; - -/** - * "DATE_ADD(date1, interval, unit)" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - */ -class DateAddFunction extends FunctionNode -{ - public $firstDateExpression = null; - public $intervalExpression = null; - public $unit = null; - - public function getSql(SqlWalker $sqlWalker) - { - $unit = strtolower($this->unit); - if ($unit == "day") { - return $sqlWalker->getConnection()->getDatabasePlatform()->getDateAddDaysExpression( - $this->firstDateExpression->dispatch($sqlWalker), - $this->intervalExpression->dispatch($sqlWalker) - ); - } else if ($unit == "month") { - return $sqlWalker->getConnection()->getDatabasePlatform()->getDateAddMonthExpression( - $this->firstDateExpression->dispatch($sqlWalker), - $this->intervalExpression->dispatch($sqlWalker) - ); - } else { - throw QueryException::semanticalError('DATE_ADD() only supports units of type day and month.'); - } - } - - public function parse(Parser $parser) - { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); - - $this->firstDateExpression = $parser->ArithmeticPrimary(); - $parser->match(Lexer::T_COMMA); - $this->intervalExpression = $parser->ArithmeticPrimary(); - $parser->match(Lexer::T_COMMA); - $this->unit = $parser->StringPrimary(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/DateDiffFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/DateDiffFunction.php deleted file mode 100644 index 4de5411..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/DateDiffFunction.php +++ /dev/null @@ -1,58 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\Lexer; -use Doctrine\ORM\Query\SqlWalker; -use Doctrine\ORM\Query\Parser; - -/** - * "DATE_DIFF(date1, date2)" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - */ -class DateDiffFunction extends FunctionNode -{ - public $date1; - public $date2; - - public function getSql(SqlWalker $sqlWalker) - { - return $sqlWalker->getConnection()->getDatabasePlatform()->getDateDiffExpression( - $this->date1->dispatch($sqlWalker), - $this->date2->dispatch($sqlWalker) - ); - } - - public function parse(Parser $parser) - { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); - - $this->date1 = $parser->ArithmeticPrimary(); - $parser->match(Lexer::T_COMMA); - $this->date2 = $parser->ArithmeticPrimary(); - - $parser->match(Lexer::T_CLOSE_PARENTHESIS); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php deleted file mode 100644 index a608d49..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php +++ /dev/null @@ -1,58 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\Lexer; -use Doctrine\ORM\Query\SqlWalker; -use Doctrine\ORM\Query\Parser; -use Doctrine\ORM\Query\QueryException; - -/** - * "DATE_ADD(date1, interval, unit)" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - */ -class DateSubFunction extends DateAddFunction -{ - public $firstDateExpression = null; - public $intervalExpression = null; - public $unit = null; - - public function getSql(SqlWalker $sqlWalker) - { - $unit = strtolower($this->unit); - if ($unit == "day") { - return $sqlWalker->getConnection()->getDatabasePlatform()->getDateSubDaysExpression( - $this->firstDateExpression->dispatch($sqlWalker), - $this->intervalExpression->dispatch($sqlWalker) - ); - } else if ($unit == "month") { - return $sqlWalker->getConnection()->getDatabasePlatform()->getDateSubMonthExpression( - $this->firstDateExpression->dispatch($sqlWalker), - $this->intervalExpression->dispatch($sqlWalker) - ); - } else { - throw QueryException::semanticalError('DATE_SUB() only supports units of type day and month.'); - } - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/FunctionNode.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/FunctionNode.php deleted file mode 100644 index b9d36d1..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/FunctionNode.php +++ /dev/null @@ -1,52 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\AST\Node; - -/** - * Abtract Function Node. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Benjamin Eberlei - */ -abstract class FunctionNode extends Node -{ - public $name; - - public function __construct($name) - { - $this->name = $name; - } - - abstract public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker); - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkFunction($this); - } - - abstract public function parse(\Doctrine\ORM\Query\Parser $parser); -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/IdentityFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/IdentityFunction.php deleted file mode 100644 index 1b75929..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/IdentityFunction.php +++ /dev/null @@ -1,68 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\Lexer; - -/** - * "IDENTITY" "(" SingleValuedAssociationPathExpression ")" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.2 - * @author Guilherme Blanco - * @author Benjamin Eberlei - */ -class IdentityFunction extends FunctionNode -{ - public $pathExpression; - - /** - * @override - */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) - { - $platform = $sqlWalker->getConnection()->getDatabasePlatform(); - $dqlAlias = $this->pathExpression->identificationVariable; - $assocField = $this->pathExpression->field; - - $qComp = $sqlWalker->getQueryComponent($dqlAlias); - $class = $qComp['metadata']; - $assoc = $class->associationMappings[$assocField]; - - $tableAlias = $sqlWalker->getSQLTableAlias($class->getTableName(), $dqlAlias); - - return $tableAlias . '.' . reset($assoc['targetToSourceKeyColumns']);; - } - - /** - * @override - */ - public function parse(\Doctrine\ORM\Query\Parser $parser) - { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); - - $this->pathExpression = $parser->SingleValuedAssociationPathExpression(); - - $parser->match(Lexer::T_CLOSE_PARENTHESIS); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/LengthFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/LengthFunction.php deleted file mode 100644 index 82dd4b4..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/LengthFunction.php +++ /dev/null @@ -1,62 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\Lexer; - -/** - * "LENGTH" "(" StringPrimary ")" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class LengthFunction extends FunctionNode -{ - public $stringPrimary; - - /** - * @override - */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) - { - return $sqlWalker->getConnection()->getDatabasePlatform()->getLengthExpression( - $sqlWalker->walkSimpleArithmeticExpression($this->stringPrimary) - ); - } - - /** - * @override - */ - public function parse(\Doctrine\ORM\Query\Parser $parser) - { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); - - $this->stringPrimary = $parser->StringPrimary(); - - $parser->match(Lexer::T_CLOSE_PARENTHESIS); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/LocateFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/LocateFunction.php deleted file mode 100644 index e630b2e..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/LocateFunction.php +++ /dev/null @@ -1,81 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\Lexer; - -/** - * "LOCATE" "(" StringPrimary "," StringPrimary ["," SimpleArithmeticExpression]")" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class LocateFunction extends FunctionNode -{ - public $firstStringPrimary; - public $secondStringPrimary; - public $simpleArithmeticExpression = false; - - /** - * @override - */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) - { - - return $sqlWalker->getConnection()->getDatabasePlatform()->getLocateExpression( - $sqlWalker->walkStringPrimary($this->secondStringPrimary), // its the other way around in platform - $sqlWalker->walkStringPrimary($this->firstStringPrimary), - (($this->simpleArithmeticExpression) - ? $sqlWalker->walkSimpleArithmeticExpression($this->simpleArithmeticExpression) - : false - ) - ); - } - - /** - * @override - */ - public function parse(\Doctrine\ORM\Query\Parser $parser) - { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); - - $this->firstStringPrimary = $parser->StringPrimary(); - - $parser->match(Lexer::T_COMMA); - - $this->secondStringPrimary = $parser->StringPrimary(); - - $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); - - $this->simpleArithmeticExpression = $parser->SimpleArithmeticExpression(); - } - - $parser->match(Lexer::T_CLOSE_PARENTHESIS); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/LowerFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/LowerFunction.php deleted file mode 100644 index 7bc092d..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/LowerFunction.php +++ /dev/null @@ -1,62 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\Lexer; - -/** - * "LOWER" "(" StringPrimary ")" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class LowerFunction extends FunctionNode -{ - public $stringPrimary; - - /** - * @override - */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) - { - return $sqlWalker->getConnection()->getDatabasePlatform()->getLowerExpression( - $sqlWalker->walkSimpleArithmeticExpression($this->stringPrimary) - ); - } - - /** - * @override - */ - public function parse(\Doctrine\ORM\Query\Parser $parser) - { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); - - $this->stringPrimary = $parser->StringPrimary(); - - $parser->match(Lexer::T_CLOSE_PARENTHESIS); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/ModFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/ModFunction.php deleted file mode 100644 index 53f064a..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/ModFunction.php +++ /dev/null @@ -1,68 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\Lexer; - -/** - * "MOD" "(" SimpleArithmeticExpression "," SimpleArithmeticExpression ")" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class ModFunction extends FunctionNode -{ - public $firstSimpleArithmeticExpression; - public $secondSimpleArithmeticExpression; - - /** - * @override - */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) - { - return $sqlWalker->getConnection()->getDatabasePlatform()->getModExpression( - $sqlWalker->walkSimpleArithmeticExpression($this->firstSimpleArithmeticExpression), - $sqlWalker->walkSimpleArithmeticExpression($this->secondSimpleArithmeticExpression) - ); - } - - /** - * @override - */ - public function parse(\Doctrine\ORM\Query\Parser $parser) - { - $parser->match(Lexer::T_MOD); - $parser->match(Lexer::T_OPEN_PARENTHESIS); - - $this->firstSimpleArithmeticExpression = $parser->SimpleArithmeticExpression(); - - $parser->match(Lexer::T_COMMA); - - $this->secondSimpleArithmeticExpression = $parser->SimpleArithmeticExpression(); - - $parser->match(Lexer::T_CLOSE_PARENTHESIS); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/SizeFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/SizeFunction.php deleted file mode 100644 index 3decb91..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/SizeFunction.php +++ /dev/null @@ -1,122 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\Lexer; - -/** - * "SIZE" "(" CollectionValuedPathExpression ")" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class SizeFunction extends FunctionNode -{ - public $collectionPathExpression; - - /** - * @override - * @todo If the collection being counted is already joined, the SQL can be simpler (more efficient). - */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) - { - $platform = $sqlWalker->getConnection()->getDatabasePlatform(); - $dqlAlias = $this->collectionPathExpression->identificationVariable; - $assocField = $this->collectionPathExpression->field; - - $qComp = $sqlWalker->getQueryComponent($dqlAlias); - $class = $qComp['metadata']; - $assoc = $class->associationMappings[$assocField]; - $sql = 'SELECT COUNT(*) FROM '; - - if ($assoc['type'] == \Doctrine\ORM\Mapping\ClassMetadata::ONE_TO_MANY) { - $targetClass = $sqlWalker->getEntityManager()->getClassMetadata($assoc['targetEntity']); - $targetTableAlias = $sqlWalker->getSQLTableAlias($targetClass->getTableName()); - $sourceTableAlias = $sqlWalker->getSQLTableAlias($class->getTableName(), $dqlAlias); - - $sql .= $targetClass->getQuotedTableName($platform) . ' ' . $targetTableAlias . ' WHERE '; - - $owningAssoc = $targetClass->associationMappings[$assoc['mappedBy']]; - - $first = true; - - foreach ($owningAssoc['targetToSourceKeyColumns'] as $targetColumn => $sourceColumn) { - if ($first) $first = false; else $sql .= ' AND '; - - $sql .= $targetTableAlias . '.' . $sourceColumn - . ' = ' - . $sourceTableAlias . '.' . $class->getQuotedColumnName($class->fieldNames[$targetColumn], $platform); - } - } else { // many-to-many - $targetClass = $sqlWalker->getEntityManager()->getClassMetadata($assoc['targetEntity']); - - $owningAssoc = $assoc['isOwningSide'] ? $assoc : $targetClass->associationMappings[$assoc['mappedBy']]; - $joinTable = $owningAssoc['joinTable']; - - // SQL table aliases - $joinTableAlias = $sqlWalker->getSQLTableAlias($joinTable['name']); - $sourceTableAlias = $sqlWalker->getSQLTableAlias($class->getTableName(), $dqlAlias); - - // join to target table - $sql .= $targetClass->getQuotedJoinTableName($owningAssoc, $platform) . ' ' . $joinTableAlias . ' WHERE '; - - $joinColumns = $assoc['isOwningSide'] - ? $joinTable['joinColumns'] - : $joinTable['inverseJoinColumns']; - - $first = true; - - foreach ($joinColumns as $joinColumn) { - if ($first) $first = false; else $sql .= ' AND '; - - $sourceColumnName = $class->getQuotedColumnName( - $class->fieldNames[$joinColumn['referencedColumnName']], $platform - ); - - $sql .= $joinTableAlias . '.' . $joinColumn['name'] - . ' = ' - . $sourceTableAlias . '.' . $sourceColumnName; - } - } - - return '(' . $sql . ')'; - } - - /** - * @override - */ - public function parse(\Doctrine\ORM\Query\Parser $parser) - { - $lexer = $parser->getLexer(); - - $parser->match(Lexer::T_SIZE); - $parser->match(Lexer::T_OPEN_PARENTHESIS); - - $this->collectionPathExpression = $parser->CollectionValuedPathExpression(); - - $parser->match(Lexer::T_CLOSE_PARENTHESIS); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php deleted file mode 100644 index 087b93b..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php +++ /dev/null @@ -1,61 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\Lexer; - -/** - * "SQRT" "(" SimpleArithmeticExpression ")" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class SqrtFunction extends FunctionNode -{ - public $simpleArithmeticExpression; - - /** - * @override - */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) - { - //TODO: Use platform to get SQL - return 'SQRT(' . $sqlWalker->walkSimpleArithmeticExpression($this->simpleArithmeticExpression) . ')'; - } - - /** - * @override - */ - public function parse(\Doctrine\ORM\Query\Parser $parser) - { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); - - $this->simpleArithmeticExpression = $parser->SimpleArithmeticExpression(); - - $parser->match(Lexer::T_CLOSE_PARENTHESIS); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/SubstringFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/SubstringFunction.php deleted file mode 100644 index c0e6223..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/SubstringFunction.php +++ /dev/null @@ -1,82 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\Lexer; - -/** - * "SUBSTRING" "(" StringPrimary "," SimpleArithmeticExpression "," SimpleArithmeticExpression ")" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class SubstringFunction extends FunctionNode -{ - public $stringPrimary; - public $firstSimpleArithmeticExpression; - public $secondSimpleArithmeticExpression = null; - - /** - * @override - */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) - { - $optionalSecondSimpleArithmeticExpression = null; - if ($this->secondSimpleArithmeticExpression !== null) { - $optionalSecondSimpleArithmeticExpression = $sqlWalker->walkSimpleArithmeticExpression($this->secondSimpleArithmeticExpression); - } - - return $sqlWalker->getConnection()->getDatabasePlatform()->getSubstringExpression( - $sqlWalker->walkStringPrimary($this->stringPrimary), - $sqlWalker->walkSimpleArithmeticExpression($this->firstSimpleArithmeticExpression), - $optionalSecondSimpleArithmeticExpression - ); - } - - /** - * @override - */ - public function parse(\Doctrine\ORM\Query\Parser $parser) - { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); - - $this->stringPrimary = $parser->StringPrimary(); - - $parser->match(Lexer::T_COMMA); - - $this->firstSimpleArithmeticExpression = $parser->SimpleArithmeticExpression(); - - $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); - - $this->secondSimpleArithmeticExpression = $parser->SimpleArithmeticExpression(); - } - - $parser->match(Lexer::T_CLOSE_PARENTHESIS); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/TrimFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/TrimFunction.php deleted file mode 100644 index 47b3cec..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/TrimFunction.php +++ /dev/null @@ -1,100 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\Lexer; -use Doctrine\DBAL\Platforms\AbstractPlatform; - -/** - * "TRIM" "(" [["LEADING" | "TRAILING" | "BOTH"] [char] "FROM"] StringPrimary ")" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class TrimFunction extends FunctionNode -{ - public $leading; - public $trailing; - public $both; - public $trimChar = false; - public $stringPrimary; - - /** - * @override - */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) - { - $pos = AbstractPlatform::TRIM_UNSPECIFIED; - if ($this->leading) { - $pos = AbstractPlatform::TRIM_LEADING; - } else if ($this->trailing) { - $pos = AbstractPlatform::TRIM_TRAILING; - } else if ($this->both) { - $pos = AbstractPlatform::TRIM_BOTH; - } - - return $sqlWalker->getConnection()->getDatabasePlatform()->getTrimExpression( - $sqlWalker->walkStringPrimary($this->stringPrimary), - $pos, - ($this->trimChar != false) ? $sqlWalker->getConnection()->quote($this->trimChar) : false - ); - } - - /** - * @override - */ - public function parse(\Doctrine\ORM\Query\Parser $parser) - { - $lexer = $parser->getLexer(); - - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); - - if (strcasecmp('leading', $lexer->lookahead['value']) === 0) { - $parser->match(Lexer::T_LEADING); - $this->leading = true; - } else if (strcasecmp('trailing', $lexer->lookahead['value']) === 0) { - $parser->match(Lexer::T_TRAILING); - $this->trailing = true; - } else if (strcasecmp('both', $lexer->lookahead['value']) === 0) { - $parser->match(Lexer::T_BOTH); - $this->both = true; - } - - if ($lexer->isNextToken(Lexer::T_STRING)) { - $parser->match(Lexer::T_STRING); - $this->trimChar = $lexer->token['value']; - } - - if ($this->leading || $this->trailing || $this->both || $this->trimChar) { - $parser->match(Lexer::T_FROM); - } - - $this->stringPrimary = $parser->StringPrimary(); - - $parser->match(Lexer::T_CLOSE_PARENTHESIS); - } - -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/UpperFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/UpperFunction.php deleted file mode 100644 index 16a0ed8..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/UpperFunction.php +++ /dev/null @@ -1,62 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST\Functions; - -use Doctrine\ORM\Query\Lexer; - -/** - * "UPPER" "(" StringPrimary ")" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class UpperFunction extends FunctionNode -{ - public $stringPrimary; - - /** - * @override - */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) - { - return $sqlWalker->getConnection()->getDatabasePlatform()->getUpperExpression( - $sqlWalker->walkSimpleArithmeticExpression($this->stringPrimary) - ); - } - - /** - * @override - */ - public function parse(\Doctrine\ORM\Query\Parser $parser) - { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); - - $this->stringPrimary = $parser->StringPrimary(); - - $parser->match(Lexer::T_CLOSE_PARENTHESIS); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/GeneralCaseExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/GeneralCaseExpression.php deleted file mode 100644 index facacd5..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/GeneralCaseExpression.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * GeneralCaseExpression ::= "CASE" WhenClause {WhenClause}* "ELSE" ScalarExpression "END" - * - * @since 2.2 - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class GeneralCaseExpression extends Node -{ - public $whenClauses = array(); - public $elseScalarExpression = null; - - public function __construct(array $whenClauses, $elseScalarExpression) - { - $this->whenClauses = $whenClauses; - $this->elseScalarExpression = $elseScalarExpression; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkGeneralCaseExpression($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/GroupByClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/GroupByClause.php deleted file mode 100644 index d5ae72f..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/GroupByClause.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * Description of GroupByClause - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class GroupByClause extends Node -{ - public $groupByItems = array(); - - public function __construct(array $groupByItems) - { - $this->groupByItems = $groupByItems; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkGroupByClause($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/HavingClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/HavingClause.php deleted file mode 100644 index 08912b0..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/HavingClause.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * Description of HavingClause - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class HavingClause extends Node -{ - public $conditionalExpression; - - public function __construct($conditionalExpression) - { - $this->conditionalExpression = $conditionalExpression; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkHavingClause($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/IdentificationVariableDeclaration.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/IdentificationVariableDeclaration.php deleted file mode 100644 index 2f590cc..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/IdentificationVariableDeclaration.php +++ /dev/null @@ -1,52 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * IdentificationVariableDeclaration ::= RangeVariableDeclaration [IndexBy] {JoinVariableDeclaration}* - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class IdentificationVariableDeclaration extends Node -{ - public $rangeVariableDeclaration = null; - public $indexBy = null; - public $joinVariableDeclarations = array(); - - public function __construct($rangeVariableDecl, $indexBy, array $joinVariableDecls) - { - $this->rangeVariableDeclaration = $rangeVariableDecl; - $this->indexBy = $indexBy; - $this->joinVariableDeclarations = $joinVariableDecls; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkIdentificationVariableDeclaration($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/InExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/InExpression.php deleted file mode 100644 index 15c517d..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/InExpression.php +++ /dev/null @@ -1,52 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * InExpression ::= StateFieldPathExpression ["NOT"] "IN" "(" (Literal {"," Literal}* | Subselect) ")" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class InExpression extends Node -{ - public $not; - public $expression; - public $literals = array(); - public $subselect; - - public function __construct($expression) - { - $this->expression = $expression; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkInExpression($this); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/IndexBy.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/IndexBy.php deleted file mode 100644 index 16f2206..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/IndexBy.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * IndexBy ::= "INDEX" "BY" SimpleStateFieldPathExpression - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class IndexBy extends Node -{ - public $simpleStateFieldPathExpression = null; - - public function __construct($simpleStateFieldPathExpression) - { - $this->simpleStateFieldPathExpression = $simpleStateFieldPathExpression; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkIndexBy($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/InputParameter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/InputParameter.php deleted file mode 100644 index cf04d70..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/InputParameter.php +++ /dev/null @@ -1,58 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * Description of InputParameter - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class InputParameter extends Node -{ - public $isNamed; - public $name; - - /** - * @param string $value - */ - public function __construct($value) - { - if (strlen($value) == 1) { - throw \Doctrine\ORM\Query\QueryException::invalidParameterFormat($value); - } - - $param = substr($value, 1); - $this->isNamed = ! is_numeric($param); - $this->name = $param; - } - - public function dispatch($walker) - { - return $walker->walkInputParameter($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/InstanceOfExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/InstanceOfExpression.php deleted file mode 100644 index 4f254b5..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/InstanceOfExpression.php +++ /dev/null @@ -1,50 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * InstanceOfExpression ::= IdentificationVariable ["NOT"] "INSTANCE" ["OF"] (InstanceOfParameter | "(" InstanceOfParameter {"," InstanceOfParameter}* ")") - * InstanceOfParameter ::= AbstractSchemaName | InputParameter - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class InstanceOfExpression extends Node -{ - public $not; - public $identificationVariable; - public $value; - - public function __construct($identVariable) - { - $this->identificationVariable = $identVariable; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkInstanceOfExpression($this); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Join.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Join.php deleted file mode 100644 index 084f7d7..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Join.php +++ /dev/null @@ -1,58 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * Join ::= ["LEFT" ["OUTER"] | "INNER"] "JOIN" JoinAssociationPathExpression - * ["AS"] AliasIdentificationVariable [("ON" | "WITH") ConditionalExpression] - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class Join extends Node -{ - const JOIN_TYPE_LEFT = 1; - const JOIN_TYPE_LEFTOUTER = 2; - const JOIN_TYPE_INNER = 3; - - public $joinType = self::JOIN_TYPE_INNER; - public $joinAssociationPathExpression = null; - public $aliasIdentificationVariable = null; - public $conditionalExpression = null; - - public function __construct($joinType, $joinAssocPathExpr, $aliasIdentVar) - { - $this->joinType = $joinType; - $this->joinAssociationPathExpression = $joinAssocPathExpr; - $this->aliasIdentificationVariable = $aliasIdentVar; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkJoin($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/JoinAssociationPathExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/JoinAssociationPathExpression.php deleted file mode 100644 index f9300b2..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/JoinAssociationPathExpression.php +++ /dev/null @@ -1,50 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * JoinAssociationPathExpression ::= IdentificationVariable "." (SingleValuedAssociationField | CollectionValuedAssociationField) - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class JoinAssociationPathExpression extends Node -{ - public $identificationVariable; - public $associationField; - - public function __construct($identificationVariable, $associationField) - { - $this->identificationVariable = $identificationVariable; - $this->associationField = $associationField; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkJoinPathExpression($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/JoinVariableDeclaration.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/JoinVariableDeclaration.php deleted file mode 100644 index 7fa9562..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/JoinVariableDeclaration.php +++ /dev/null @@ -1,50 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * JoinVariableDeclaration ::= Join [IndexBy] - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class JoinVariableDeclaration extends Node -{ - public $join = null; - public $indexBy = null; - - public function __construct($join, $indexBy) - { - $this->join = $join; - $this->indexBy = $indexBy; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkJoinVariableDeclaration($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/LikeExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/LikeExpression.php deleted file mode 100644 index 7985be4..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/LikeExpression.php +++ /dev/null @@ -1,53 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * LikeExpression ::= StringExpression ["NOT"] "LIKE" string ["ESCAPE" char] - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class LikeExpression extends Node -{ - public $not; - public $stringExpression; - public $stringPattern; - public $escapeChar; - - public function __construct($stringExpression, $stringPattern, $escapeChar = null) - { - $this->stringExpression = $stringExpression; - $this->stringPattern = $stringPattern; - $this->escapeChar = $escapeChar; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkLikeExpression($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Literal.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Literal.php deleted file mode 100644 index 426907f..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Literal.php +++ /dev/null @@ -1,24 +0,0 @@ -type = $type; - $this->value = $value; - } - - public function dispatch($walker) - { - return $walker->walkLiteral($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Node.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Node.php deleted file mode 100644 index 8ef13c0..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Node.php +++ /dev/null @@ -1,98 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * Abstract class of an AST node - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -abstract class Node -{ - /** - * Double-dispatch method, supposed to dispatch back to the walker. - * - * Implementation is not mandatory for all nodes. - * - * @param $walker - */ - public function dispatch($walker) - { - throw ASTException::noDispatchForNode($this); - } - - /** - * Dumps the AST Node into a string representation for information purpose only - * - * @return string - */ - public function __toString() - { - return $this->dump($this); - } - - public function dump($obj) - { - static $ident = 0; - - $str = ''; - - if ($obj instanceof Node) { - $str .= get_class($obj) . '(' . PHP_EOL; - $props = get_object_vars($obj); - - foreach ($props as $name => $prop) { - $ident += 4; - $str .= str_repeat(' ', $ident) . '"' . $name . '": ' - . $this->dump($prop) . ',' . PHP_EOL; - $ident -= 4; - } - - $str .= str_repeat(' ', $ident) . ')'; - } else if (is_array($obj)) { - $ident += 4; - $str .= 'array('; - $some = false; - - foreach ($obj as $k => $v) { - $str .= PHP_EOL . str_repeat(' ', $ident) . '"' - . $k . '" => ' . $this->dump($v) . ','; - $some = true; - } - - $ident -= 4; - $str .= ($some ? PHP_EOL . str_repeat(' ', $ident) : '') . ')'; - } else if (is_object($obj)) { - $str .= 'instanceof(' . get_class($obj) . ')'; - } else { - $str .= var_export($obj, true); - } - - return $str; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/NullComparisonExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/NullComparisonExpression.php deleted file mode 100644 index 0e64bd2..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/NullComparisonExpression.php +++ /dev/null @@ -1,50 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * NullComparisonExpression ::= (SingleValuedPathExpression | InputParameter) "IS" ["NOT"] "NULL" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class NullComparisonExpression extends Node -{ - public $not; - public $expression; - - public function __construct($expression) - { - $this->expression = $expression; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkNullComparisonExpression($this); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/NullIfExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/NullIfExpression.php deleted file mode 100644 index 12c8c14..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/NullIfExpression.php +++ /dev/null @@ -1,49 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * NullIfExpression ::= "NULLIF" "(" ScalarExpression "," ScalarExpression ")" - * - * @since 2.1 - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class NullIfExpression extends Node -{ - public $firstExpression; - - public $secondExpression; - - public function __construct($firstExpression, $secondExpression) - { - $this->firstExpression = $firstExpression; - $this->secondExpression = $secondExpression; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkNullIfExpression($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/OrderByClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/OrderByClause.php deleted file mode 100644 index 7e23059..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/OrderByClause.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * OrderByClause ::= "ORDER" "BY" OrderByItem {"," OrderByItem}* - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class OrderByClause extends Node -{ - public $orderByItems = array(); - - public function __construct(array $orderByItems) - { - $this->orderByItems = $orderByItems; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkOrderByClause($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/OrderByItem.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/OrderByItem.php deleted file mode 100644 index 207cbd3..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/OrderByItem.php +++ /dev/null @@ -1,59 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * OrderByItem ::= (ResultVariable | StateFieldPathExpression) ["ASC" | "DESC"] - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class OrderByItem extends Node -{ - public $expression; - public $type; - - public function __construct($expression) - { - $this->expression = $expression; - } - - public function isAsc() - { - return strtoupper($this->type) == 'ASC'; - } - - public function isDesc() - { - return strtoupper($this->type) == 'DESC'; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkOrderByItem($this); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/PartialObjectExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/PartialObjectExpression.php deleted file mode 100644 index d1757d7..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/PartialObjectExpression.php +++ /dev/null @@ -1,15 +0,0 @@ -identificationVariable = $identificationVariable; - $this->partialFieldSet = $partialFieldSet; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/PathExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/PathExpression.php deleted file mode 100644 index 2f78b9c..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/PathExpression.php +++ /dev/null @@ -1,58 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * AssociationPathExpression ::= CollectionValuedPathExpression | SingleValuedAssociationPathExpression - * SingleValuedPathExpression ::= StateFieldPathExpression | SingleValuedAssociationPathExpression - * StateFieldPathExpression ::= SimpleStateFieldPathExpression | SimpleStateFieldAssociationPathExpression - * SingleValuedAssociationPathExpression ::= IdentificationVariable "." SingleValuedAssociationField - * CollectionValuedPathExpression ::= IdentificationVariable "." CollectionValuedAssociationField - * StateField ::= {EmbeddedClassStateField "."}* SimpleStateField - * SimpleStateFieldPathExpression ::= IdentificationVariable "." StateField - * - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class PathExpression extends Node -{ - const TYPE_COLLECTION_VALUED_ASSOCIATION = 2; - const TYPE_SINGLE_VALUED_ASSOCIATION = 4; - const TYPE_STATE_FIELD = 8; - - public $type; - public $expectedType; - public $identificationVariable; - public $field; - - public function __construct($expectedType, $identificationVariable, $field = null) - { - $this->expectedType = $expectedType; - $this->identificationVariable = $identificationVariable; - $this->field = $field; - } - - public function dispatch($walker) - { - return $walker->walkPathExpression($this); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/QuantifiedExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/QuantifiedExpression.php deleted file mode 100644 index 11b60ed..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/QuantifiedExpression.php +++ /dev/null @@ -1,68 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * QuantifiedExpression ::= ("ALL" | "ANY" | "SOME") "(" Subselect ")" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class QuantifiedExpression extends Node -{ - public $type; - public $subselect; - - public function __construct($subselect) - { - $this->subselect = $subselect; - } - - public function isAll() - { - return strtoupper($this->type) == 'ALL'; - } - - public function isAny() - { - return strtoupper($this->type) == 'ANY'; - } - - public function isSome() - { - return strtoupper($this->type) == 'SOME'; - } - - /** - * @override - */ - public function dispatch($sqlWalker) - { - return $sqlWalker->walkQuantifiedExpression($this); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/RangeVariableDeclaration.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/RangeVariableDeclaration.php deleted file mode 100644 index cf8b180..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/RangeVariableDeclaration.php +++ /dev/null @@ -1,50 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * RangeVariableDeclaration ::= AbstractSchemaName ["AS"] AliasIdentificationVariable - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class RangeVariableDeclaration extends Node -{ - public $abstractSchemaName; - public $aliasIdentificationVariable; - - public function __construct($abstractSchemaName, $aliasIdentificationVar) - { - $this->abstractSchemaName = $abstractSchemaName; - $this->aliasIdentificationVariable = $aliasIdentificationVar; - } - - public function dispatch($walker) - { - return $walker->walkRangeVariableDeclaration($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SelectClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SelectClause.php deleted file mode 100644 index cf8e9df..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SelectClause.php +++ /dev/null @@ -1,50 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * SelectClause = "SELECT" ["DISTINCT"] SelectExpression {"," SelectExpression} - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class SelectClause extends Node -{ - public $isDistinct; - public $selectExpressions = array(); - - public function __construct(array $selectExpressions, $isDistinct) - { - $this->isDistinct = $isDistinct; - $this->selectExpressions = $selectExpressions; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkSelectClause($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SelectExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SelectExpression.php deleted file mode 100644 index fd0d49b..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SelectExpression.php +++ /dev/null @@ -1,53 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * SelectExpression ::= IdentificationVariable ["." "*"] | StateFieldPathExpression | - * (AggregateExpression | "(" Subselect ")") [["AS"] ["HIDDEN"] FieldAliasIdentificationVariable] - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class SelectExpression extends Node -{ - public $expression; - public $fieldIdentificationVariable; - public $hiddenAliasResultVariable; - - public function __construct($expression, $fieldIdentificationVariable, $hiddenAliasResultVariable = false) - { - $this->expression = $expression; - $this->fieldIdentificationVariable = $fieldIdentificationVariable; - $this->hiddenAliasResultVariable = $hiddenAliasResultVariable; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkSelectExpression($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SelectStatement.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SelectStatement.php deleted file mode 100644 index d65a97b..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SelectStatement.php +++ /dev/null @@ -1,53 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * SelectStatement = SelectClause FromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause] - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class SelectStatement extends Node -{ - public $selectClause; - public $fromClause; - public $whereClause; - public $groupByClause; - public $havingClause; - public $orderByClause; - - public function __construct($selectClause, $fromClause) { - $this->selectClause = $selectClause; - $this->fromClause = $fromClause; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkSelectStatement($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleArithmeticExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleArithmeticExpression.php deleted file mode 100644 index 3fb6f05..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleArithmeticExpression.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * SimpleArithmeticExpression ::= ArithmeticTerm {("+" | "-") ArithmeticTerm}* - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class SimpleArithmeticExpression extends Node -{ - public $arithmeticTerms = array(); - - public function __construct(array $arithmeticTerms) - { - $this->arithmeticTerms = $arithmeticTerms; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkSimpleArithmeticExpression($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleCaseExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleCaseExpression.php deleted file mode 100644 index 586928d..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleCaseExpression.php +++ /dev/null @@ -1,50 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * SimpleCaseExpression ::= "CASE" CaseOperand SimpleWhenClause {SimpleWhenClause}* "ELSE" ScalarExpression "END" - * - * @since 2.2 - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class SimpleCaseExpression extends Node -{ - public $caseOperand = null; - public $simpleWhenClauses = array(); - public $elseScalarExpression = null; - - public function __construct($caseOperand, array $simpleWhenClauses, $elseScalarExpression) - { - $this->caseOperand = $caseOperand; - $this->simpleWhenClauses = $simpleWhenClauses; - $this->elseScalarExpression = $elseScalarExpression; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkSimpleCaseExpression($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleSelectClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleSelectClause.php deleted file mode 100644 index 8a40280..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleSelectClause.php +++ /dev/null @@ -1,50 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * SimpleSelectClause ::= "SELECT" ["DISTINCT"] SimpleSelectExpression - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class SimpleSelectClause extends Node -{ - public $isDistinct = false; - public $simpleSelectExpression; - - public function __construct($simpleSelectExpression, $isDistinct) - { - $this->simpleSelectExpression = $simpleSelectExpression; - $this->isDistinct = $isDistinct; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkSimpleSelectClause($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleSelectExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleSelectExpression.php deleted file mode 100644 index 1648c4d..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleSelectExpression.php +++ /dev/null @@ -1,50 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * SimpleSelectExpression ::= StateFieldPathExpression | IdentificationVariable - * | (AggregateExpression [["AS"] FieldAliasIdentificationVariable]) - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class SimpleSelectExpression extends Node -{ - public $expression; - public $fieldIdentificationVariable; - - public function __construct($expression) - { - $this->expression = $expression; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkSimpleSelectExpression($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleWhenClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleWhenClause.php deleted file mode 100644 index 0345328..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleWhenClause.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * SimpleWhenClause ::= "WHEN" ScalarExpression "THEN" ScalarExpression - * - * @since 2.2 - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class SimpleWhenClause extends Node -{ - public $caseScalarExpression = null; - public $thenScalarExpression = null; - - public function __construct($caseScalarExpression, $thenScalarExpression) - { - $this->caseScalarExpression = $caseScalarExpression; - $this->thenScalarExpression = $thenScalarExpression; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkWhenClauseExpression($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Subselect.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Subselect.php deleted file mode 100644 index 548e42b..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Subselect.php +++ /dev/null @@ -1,54 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * Subselect ::= SimpleSelectClause SubselectFromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause] - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class Subselect extends Node -{ - public $simpleSelectClause; - public $subselectFromClause; - public $whereClause; - public $groupByClause; - public $havingClause; - public $orderByClause; - - public function __construct($simpleSelectClause, $subselectFromClause) - { - $this->simpleSelectClause = $simpleSelectClause; - $this->subselectFromClause = $subselectFromClause; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkSubselect($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SubselectFromClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SubselectFromClause.php deleted file mode 100644 index c7c2f35..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SubselectFromClause.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * SubselectFromClause ::= "FROM" SubselectIdentificationVariableDeclaration {"," SubselectIdentificationVariableDeclaration}* - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class SubselectFromClause extends Node -{ - public $identificationVariableDeclarations = array(); - - public function __construct(array $identificationVariableDeclarations) - { - $this->identificationVariableDeclarations = $identificationVariableDeclarations; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkSubselectFromClause($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/UpdateClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/UpdateClause.php deleted file mode 100644 index 158cf24..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/UpdateClause.php +++ /dev/null @@ -1,52 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * UpdateClause ::= "UPDATE" AbstractSchemaName [["AS"] AliasIdentificationVariable] "SET" UpdateItem {"," UpdateItem}* - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class UpdateClause extends Node -{ - public $abstractSchemaName; - public $aliasIdentificationVariable; - public $updateItems = array(); - - public function __construct($abstractSchemaName, array $updateItems) - { - $this->abstractSchemaName = $abstractSchemaName; - $this->updateItems = $updateItems; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkUpdateClause($this); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/UpdateItem.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/UpdateItem.php deleted file mode 100644 index 5f8b678..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/UpdateItem.php +++ /dev/null @@ -1,53 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * UpdateItem ::= [IdentificationVariable "."] {StateField | SingleValuedAssociationField} "=" NewValue - * NewValue ::= SimpleArithmeticExpression | StringPrimary | DatetimePrimary | BooleanPrimary | - * EnumPrimary | SimpleEntityExpression | "NULL" - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class UpdateItem extends Node -{ - public $pathExpression; - public $newValue; - - public function __construct($pathExpression, $newValue) - { - $this->pathExpression = $pathExpression; - $this->newValue = $newValue; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkUpdateItem($this); - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/UpdateStatement.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/UpdateStatement.php deleted file mode 100644 index d1e152e..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/UpdateStatement.php +++ /dev/null @@ -1,49 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * UpdateStatement = UpdateClause [WhereClause] - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class UpdateStatement extends Node -{ - public $updateClause; - public $whereClause; - - public function __construct($updateClause) - { - $this->updateClause = $updateClause; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkUpdateStatement($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/WhenClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/WhenClause.php deleted file mode 100644 index 69556e5..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/WhenClause.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * WhenClause ::= "WHEN" ConditionalExpression "THEN" ScalarExpression - * - * @since 2.2 - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class WhenClause extends Node -{ - public $caseConditionExpression = null; - public $thenScalarExpression = null; - - public function __construct($caseConditionExpression, $thenScalarExpression) - { - $this->caseConditionExpression = $caseConditionExpression; - $this->thenScalarExpression = $thenScalarExpression; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkWhenClauseExpression($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/WhereClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/WhereClause.php deleted file mode 100644 index 5d3f9c9..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/WhereClause.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\AST; - -/** - * WhereClause ::= "WHERE" ConditionalExpression - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class WhereClause extends Node -{ - public $conditionalExpression; - - public function __construct($conditionalExpression) - { - $this->conditionalExpression = $conditionalExpression; - } - - public function dispatch($sqlWalker) - { - return $sqlWalker->walkWhereClause($this); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php deleted file mode 100644 index d639223..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php +++ /dev/null @@ -1,70 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\Exec; - -use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Cache\QueryCacheProfile; - -/** - * Base class for SQL statement executors. - * - * @author Roman Borschel - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link http://www.doctrine-project.org - * @since 2.0 - * @todo Rename: AbstractSQLExecutor - */ -abstract class AbstractSqlExecutor -{ - /** - * @var array - */ - protected $_sqlStatements; - - /** - * @var QueryCacheProfile - */ - protected $queryCacheProfile; - - /** - * Gets the SQL statements that are executed by the executor. - * - * @return array All the SQL update statements. - */ - public function getSqlStatements() - { - return $this->_sqlStatements; - } - - public function setQueryCacheProfile(QueryCacheProfile $qcp) - { - $this->queryCacheProfile = $qcp; - } - - /** - * Executes all sql statements. - * - * @param \Doctrine\DBAL\Connection $conn The database connection that is used to execute the queries. - * @param array $params The parameters. - * @param array $types The parameter types. - * @return \Doctrine\DBAL\Driver\Statement - */ - abstract public function execute(Connection $conn, array $params, array $types); -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php deleted file mode 100644 index 51f4b8c..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php +++ /dev/null @@ -1,124 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\Exec; - -use Doctrine\DBAL\Connection, - Doctrine\ORM\Query\AST; - -/** - * Executes the SQL statements for bulk DQL DELETE statements on classes in - * Class Table Inheritance (JOINED). - * - * @author Roman Borschel - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link http://www.doctrine-project.org - * @since 2.0 - */ -class MultiTableDeleteExecutor extends AbstractSqlExecutor -{ - private $_createTempTableSql; - private $_dropTempTableSql; - private $_insertSql; - - /** - * Initializes a new MultiTableDeleteExecutor. - * - * @param Node $AST The root AST node of the DQL query. - * @param SqlWalker $sqlWalker The walker used for SQL generation from the AST. - * @internal Any SQL construction and preparation takes place in the constructor for - * best performance. With a query cache the executor will be cached. - */ - public function __construct(AST\Node $AST, $sqlWalker) - { - $em = $sqlWalker->getEntityManager(); - $conn = $em->getConnection(); - $platform = $conn->getDatabasePlatform(); - - $primaryClass = $em->getClassMetadata($AST->deleteClause->abstractSchemaName); - $primaryDqlAlias = $AST->deleteClause->aliasIdentificationVariable; - $rootClass = $em->getClassMetadata($primaryClass->rootEntityName); - - $tempTable = $platform->getTemporaryTableName($rootClass->getTemporaryIdTableName()); - $idColumnNames = $rootClass->getIdentifierColumnNames(); - $idColumnList = implode(', ', $idColumnNames); - - // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() - $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 't0', $primaryDqlAlias); - - $this->_insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnList . ')' - . ' SELECT t0.' . implode(', t0.', $idColumnNames); - - $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->name, $primaryDqlAlias); - $fromClause = new AST\FromClause(array(new AST\IdentificationVariableDeclaration($rangeDecl, null, array()))); - $this->_insertSql .= $sqlWalker->walkFromClause($fromClause); - - // Append WHERE clause, if there is one. - if ($AST->whereClause) { - $this->_insertSql .= $sqlWalker->walkWhereClause($AST->whereClause); - } - - // 2. Create ID subselect statement used in DELETE ... WHERE ... IN (subselect) - $idSubselect = 'SELECT ' . $idColumnList . ' FROM ' . $tempTable; - - // 3. Create and store DELETE statements - $classNames = array_merge($primaryClass->parentClasses, array($primaryClass->name), $primaryClass->subClasses); - foreach (array_reverse($classNames) as $className) { - $tableName = $em->getClassMetadata($className)->getQuotedTableName($platform); - $this->_sqlStatements[] = 'DELETE FROM ' . $tableName - . ' WHERE (' . $idColumnList . ') IN (' . $idSubselect . ')'; - } - - // 4. Store DDL for temporary identifier table. - $columnDefinitions = array(); - foreach ($idColumnNames as $idColumnName) { - $columnDefinitions[$idColumnName] = array( - 'notnull' => true, - 'type' => \Doctrine\DBAL\Types\Type::getType($rootClass->getTypeOfColumn($idColumnName)) - ); - } - $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; - $this->_dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); - } - - /** - * {@inheritDoc} - */ - public function execute(Connection $conn, array $params, array $types) - { - $numDeleted = 0; - - // Create temporary id table - $conn->executeUpdate($this->_createTempTableSql); - - // Insert identifiers - $numDeleted = $conn->executeUpdate($this->_insertSql, $params, $types); - - // Execute DELETE statements - foreach ($this->_sqlStatements as $sql) { - $conn->executeUpdate($sql); - } - - // Drop temporary table - $conn->executeUpdate($this->_dropTempTableSql); - - return $numDeleted; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php deleted file mode 100644 index 8be24e5..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php +++ /dev/null @@ -1,178 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\Exec; - -use Doctrine\DBAL\Connection, - Doctrine\DBAL\Types\Type, - Doctrine\ORM\Query\AST; - -/** - * Executes the SQL statements for bulk DQL UPDATE statements on classes in - * Class Table Inheritance (JOINED). - * - * @author Roman Borschel - * @since 2.0 - */ -class MultiTableUpdateExecutor extends AbstractSqlExecutor -{ - private $_createTempTableSql; - private $_dropTempTableSql; - private $_insertSql; - private $_sqlParameters = array(); - private $_numParametersInUpdateClause = 0; - - /** - * Initializes a new MultiTableUpdateExecutor. - * - * @param Node $AST The root AST node of the DQL query. - * @param SqlWalker $sqlWalker The walker used for SQL generation from the AST. - * @internal Any SQL construction and preparation takes place in the constructor for - * best performance. With a query cache the executor will be cached. - */ - public function __construct(AST\Node $AST, $sqlWalker) - { - $em = $sqlWalker->getEntityManager(); - $conn = $em->getConnection(); - $platform = $conn->getDatabasePlatform(); - - $updateClause = $AST->updateClause; - - $primaryClass = $sqlWalker->getEntityManager()->getClassMetadata($updateClause->abstractSchemaName); - $rootClass = $em->getClassMetadata($primaryClass->rootEntityName); - - $updateItems = $updateClause->updateItems; - - $tempTable = $platform->getTemporaryTableName($rootClass->getTemporaryIdTableName()); - $idColumnNames = $rootClass->getIdentifierColumnNames(); - $idColumnList = implode(', ', $idColumnNames); - - // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() - $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 't0', $updateClause->aliasIdentificationVariable); - - $this->_insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnList . ')' - . ' SELECT t0.' . implode(', t0.', $idColumnNames); - - $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->name, $updateClause->aliasIdentificationVariable); - $fromClause = new AST\FromClause(array(new AST\IdentificationVariableDeclaration($rangeDecl, null, array()))); - - $this->_insertSql .= $sqlWalker->walkFromClause($fromClause); - - // 2. Create ID subselect statement used in UPDATE ... WHERE ... IN (subselect) - $idSubselect = 'SELECT ' . $idColumnList . ' FROM ' . $tempTable; - - // 3. Create and store UPDATE statements - $classNames = array_merge($primaryClass->parentClasses, array($primaryClass->name), $primaryClass->subClasses); - $i = -1; - - foreach (array_reverse($classNames) as $className) { - $affected = false; - $class = $em->getClassMetadata($className); - $updateSql = 'UPDATE ' . $class->getQuotedTableName($platform) . ' SET '; - - foreach ($updateItems as $updateItem) { - $field = $updateItem->pathExpression->field; - - if (isset($class->fieldMappings[$field]) && ! isset($class->fieldMappings[$field]['inherited']) || - isset($class->associationMappings[$field]) && ! isset($class->associationMappings[$field]['inherited'])) { - $newValue = $updateItem->newValue; - - if ( ! $affected) { - $affected = true; - ++$i; - } else { - $updateSql .= ', '; - } - - $updateSql .= $sqlWalker->walkUpdateItem($updateItem); - - //FIXME: parameters can be more deeply nested. traverse the tree. - //FIXME (URGENT): With query cache the parameter is out of date. Move to execute() stage. - if ($newValue instanceof AST\InputParameter) { - $paramKey = $newValue->name; - $this->_sqlParameters[$i]['parameters'][] = $sqlWalker->getQuery()->getParameter($paramKey); - $this->_sqlParameters[$i]['types'][] = $sqlWalker->getQuery()->getParameterType($paramKey); - - ++$this->_numParametersInUpdateClause; - } - } - } - - if ($affected) { - $this->_sqlStatements[$i] = $updateSql . ' WHERE (' . $idColumnList . ') IN (' . $idSubselect . ')'; - } - } - - // Append WHERE clause to insertSql, if there is one. - if ($AST->whereClause) { - $this->_insertSql .= $sqlWalker->walkWhereClause($AST->whereClause); - } - - // 4. Store DDL for temporary identifier table. - $columnDefinitions = array(); - - foreach ($idColumnNames as $idColumnName) { - $columnDefinitions[$idColumnName] = array( - 'notnull' => true, - 'type' => Type::getType($rootClass->getTypeOfColumn($idColumnName)) - ); - } - - $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; - - $this->_dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); - } - - /** - * {@inheritDoc} - */ - public function execute(Connection $conn, array $params, array $types) - { - $numUpdated = 0; - - // Create temporary id table - $conn->executeUpdate($this->_createTempTableSql); - - // Insert identifiers. Parameters from the update clause are cut off. - $numUpdated = $conn->executeUpdate( - $this->_insertSql, - array_slice($params, $this->_numParametersInUpdateClause), - array_slice($types, $this->_numParametersInUpdateClause) - ); - - // Execute UPDATE statements - for ($i=0, $count=count($this->_sqlStatements); $i<$count; ++$i) { - $parameters = array(); - $types = array(); - - if (isset($this->_sqlParameters[$i])) { - $parameters = isset($this->_sqlParameters[$i]['parameters']) ? $this->_sqlParameters[$i]['parameters'] : array(); - $types = isset($this->_sqlParameters[$i]['types']) ? $this->_sqlParameters[$i]['types'] : array(); - } - - $conn->executeUpdate($this->_sqlStatements[$i], $parameters, $types); - } - - // Drop temporary table - $conn->executeUpdate($this->_dropTempTableSql); - - return $numUpdated; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php deleted file mode 100644 index 61c42d8..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\Exec; - -use Doctrine\DBAL\Connection, - Doctrine\ORM\Query\AST\SelectStatement, - Doctrine\ORM\Query\SqlWalker; - -/** - * Executor that executes the SQL statement for simple DQL SELECT statements. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @author Roman Borschel - * @link www.doctrine-project.org - * @since 2.0 - */ -class SingleSelectExecutor extends AbstractSqlExecutor -{ - public function __construct(SelectStatement $AST, SqlWalker $sqlWalker) - { - $this->_sqlStatements = $sqlWalker->walkSelectStatement($AST); - } - - /** - * {@inheritDoc} - */ - public function execute(Connection $conn, array $params, array $types) - { - return $conn->executeQuery($this->_sqlStatements, $params, $types, $this->queryCacheProfile); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleTableDeleteUpdateExecutor.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleTableDeleteUpdateExecutor.php deleted file mode 100644 index 467ce54..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleTableDeleteUpdateExecutor.php +++ /dev/null @@ -1,53 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\Exec; - -use Doctrine\DBAL\Connection, - Doctrine\ORM\Query\AST; - -/** - * Executor that executes the SQL statements for DQL DELETE/UPDATE statements on classes - * that are mapped to a single table. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @author Roman Borschel - * @link www.doctrine-project.org - * @since 2.0 - * @todo This is exactly the same as SingleSelectExecutor. Unify in SingleStatementExecutor. - */ -class SingleTableDeleteUpdateExecutor extends AbstractSqlExecutor -{ - public function __construct(AST\Node $AST, $sqlWalker) - { - if ($AST instanceof AST\UpdateStatement) { - $this->_sqlStatements = $sqlWalker->walkUpdateStatement($AST); - } else if ($AST instanceof AST\DeleteStatement) { - $this->_sqlStatements = $sqlWalker->walkDeleteStatement($AST); - } - } - - /** - * {@inheritDoc} - */ - public function execute(Connection $conn, array $params, array $types) - { - return $conn->executeUpdate($this->_sqlStatements, $params, $types); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr.php deleted file mode 100644 index adcd25c..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr.php +++ /dev/null @@ -1,595 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query; - -/** - * This class is used to generate DQL expressions via a set of PHP static functions - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Benjamin Eberlei - * @todo Rename: ExpressionBuilder - */ -class Expr -{ - /** - * Creates a conjunction of the given boolean expressions. - * - * Example: - * - * [php] - * // (u.type = ?1) AND (u.role = ?2) - * $expr->andX($expr->eq('u.type', ':1'), $expr->eq('u.role', ':2')); - * - * @param \Doctrine\ORM\Query\Expr\Comparison | - * \Doctrine\ORM\Query\Expr\Func | - * \Doctrine\ORM\Query\Expr\Orx - * $x Optional clause. Defaults = null, but requires at least one defined when converting to string. - * @return Expr\Andx - */ - public function andX($x = null) - { - return new Expr\Andx(func_get_args()); - } - - /** - * Creates a disjunction of the given boolean expressions. - * - * Example: - * - * [php] - * // (u.type = ?1) OR (u.role = ?2) - * $q->where($q->expr()->orX('u.type = ?1', 'u.role = ?2')); - * - * @param mixed $x Optional clause. Defaults = null, but requires - * at least one defined when converting to string. - * @return Expr\Orx - */ - public function orX($x = null) - { - return new Expr\Orx(func_get_args()); - } - - /** - * Creates an ASCending order expression. - * - * @param $sort - * @return Expr\OrderBy - */ - public function asc($expr) - { - return new Expr\OrderBy($expr, 'ASC'); - } - - /** - * Creates a DESCending order expression. - * - * @param $sort - * @return Expr\OrderBy - */ - public function desc($expr) - { - return new Expr\OrderBy($expr, 'DESC'); - } - - /** - * Creates an equality comparison expression with the given arguments. - * - * First argument is considered the left expression and the second is the right expression. - * When converted to string, it will generated a = . Example: - * - * [php] - * // u.id = ?1 - * $expr->eq('u.id', '?1'); - * - * @param mixed $x Left expression - * @param mixed $y Right expression - * @return Expr\Comparison - */ - public function eq($x, $y) - { - return new Expr\Comparison($x, Expr\Comparison::EQ, $y); - } - - /** - * Creates an instance of Expr\Comparison, with the given arguments. - * First argument is considered the left expression and the second is the right expression. - * When converted to string, it will generated a <> . Example: - * - * [php] - * // u.id <> ?1 - * $q->where($q->expr()->neq('u.id', '?1')); - * - * @param mixed $x Left expression - * @param mixed $y Right expression - * @return Expr\Comparison - */ - public function neq($x, $y) - { - return new Expr\Comparison($x, Expr\Comparison::NEQ, $y); - } - - /** - * Creates an instance of Expr\Comparison, with the given arguments. - * First argument is considered the left expression and the second is the right expression. - * When converted to string, it will generated a < . Example: - * - * [php] - * // u.id < ?1 - * $q->where($q->expr()->lt('u.id', '?1')); - * - * @param mixed $x Left expression - * @param mixed $y Right expression - * @return Expr\Comparison - */ - public function lt($x, $y) - { - return new Expr\Comparison($x, Expr\Comparison::LT, $y); - } - - /** - * Creates an instance of Expr\Comparison, with the given arguments. - * First argument is considered the left expression and the second is the right expression. - * When converted to string, it will generated a <= . Example: - * - * [php] - * // u.id <= ?1 - * $q->where($q->expr()->lte('u.id', '?1')); - * - * @param mixed $x Left expression - * @param mixed $y Right expression - * @return Expr\Comparison - */ - public function lte($x, $y) - { - return new Expr\Comparison($x, Expr\Comparison::LTE, $y); - } - - /** - * Creates an instance of Expr\Comparison, with the given arguments. - * First argument is considered the left expression and the second is the right expression. - * When converted to string, it will generated a > . Example: - * - * [php] - * // u.id > ?1 - * $q->where($q->expr()->gt('u.id', '?1')); - * - * @param mixed $x Left expression - * @param mixed $y Right expression - * @return Expr\Comparison - */ - public function gt($x, $y) - { - return new Expr\Comparison($x, Expr\Comparison::GT, $y); - } - - /** - * Creates an instance of Expr\Comparison, with the given arguments. - * First argument is considered the left expression and the second is the right expression. - * When converted to string, it will generated a >= . Example: - * - * [php] - * // u.id >= ?1 - * $q->where($q->expr()->gte('u.id', '?1')); - * - * @param mixed $x Left expression - * @param mixed $y Right expression - * @return Expr\Comparison - */ - public function gte($x, $y) - { - return new Expr\Comparison($x, Expr\Comparison::GTE, $y); - } - - /** - * Creates an instance of AVG() function, with the given argument. - * - * @param mixed $x Argument to be used in AVG() function. - * @return Expr\Func - */ - public function avg($x) - { - return new Expr\Func('AVG', array($x)); - } - - /** - * Creates an instance of MAX() function, with the given argument. - * - * @param mixed $x Argument to be used in MAX() function. - * @return Expr\Func - */ - public function max($x) - { - return new Expr\Func('MAX', array($x)); - } - - /** - * Creates an instance of MIN() function, with the given argument. - * - * @param mixed $x Argument to be used in MIN() function. - * @return Expr\Func - */ - public function min($x) - { - return new Expr\Func('MIN', array($x)); - } - - /** - * Creates an instance of COUNT() function, with the given argument. - * - * @param mixed $x Argument to be used in COUNT() function. - * @return Expr\Func - */ - public function count($x) - { - return new Expr\Func('COUNT', array($x)); - } - - /** - * Creates an instance of COUNT(DISTINCT) function, with the given argument. - * - * @param mixed $x Argument to be used in COUNT(DISTINCT) function. - * @return string - */ - public function countDistinct($x) - { - return 'COUNT(DISTINCT ' . implode(', ', func_get_args()) . ')'; - } - - /** - * Creates an instance of EXISTS() function, with the given DQL Subquery. - * - * @param mixed $subquery DQL Subquery to be used in EXISTS() function. - * @return Expr\Func - */ - public function exists($subquery) - { - return new Expr\Func('EXISTS', array($subquery)); - } - - /** - * Creates an instance of ALL() function, with the given DQL Subquery. - * - * @param mixed $subquery DQL Subquery to be used in ALL() function. - * @return Expr\Func - */ - public function all($subquery) - { - return new Expr\Func('ALL', array($subquery)); - } - - /** - * Creates a SOME() function expression with the given DQL subquery. - * - * @param mixed $subquery DQL Subquery to be used in SOME() function. - * @return Expr\Func - */ - public function some($subquery) - { - return new Expr\Func('SOME', array($subquery)); - } - - /** - * Creates an ANY() function expression with the given DQL subquery. - * - * @param mixed $subquery DQL Subquery to be used in ANY() function. - * @return Expr\Func - */ - public function any($subquery) - { - return new Expr\Func('ANY', array($subquery)); - } - - /** - * Creates a negation expression of the given restriction. - * - * @param mixed $restriction Restriction to be used in NOT() function. - * @return Expr\Func - */ - public function not($restriction) - { - return new Expr\Func('NOT', array($restriction)); - } - - /** - * Creates an ABS() function expression with the given argument. - * - * @param mixed $x Argument to be used in ABS() function. - * @return Expr\Func - */ - public function abs($x) - { - return new Expr\Func('ABS', array($x)); - } - - /** - * Creates a product mathematical expression with the given arguments. - * - * First argument is considered the left expression and the second is the right expression. - * When converted to string, it will generated a * . Example: - * - * [php] - * // u.salary * u.percentAnualSalaryIncrease - * $q->expr()->prod('u.salary', 'u.percentAnualSalaryIncrease') - * - * @param mixed $x Left expression - * @param mixed $y Right expression - * @return Expr\Math - */ - public function prod($x, $y) - { - return new Expr\Math($x, '*', $y); - } - - /** - * Creates a difference mathematical expression with the given arguments. - * First argument is considered the left expression and the second is the right expression. - * When converted to string, it will generated a - . Example: - * - * [php] - * // u.monthlySubscriptionCount - 1 - * $q->expr()->diff('u.monthlySubscriptionCount', '1') - * - * @param mixed $x Left expression - * @param mixed $y Right expression - * @return Expr\Math - */ - public function diff($x, $y) - { - return new Expr\Math($x, '-', $y); - } - - /** - * Creates a sum mathematical expression with the given arguments. - * First argument is considered the left expression and the second is the right expression. - * When converted to string, it will generated a + . Example: - * - * [php] - * // u.numChildren + 1 - * $q->expr()->diff('u.numChildren', '1') - * - * @param mixed $x Left expression - * @param mixed $y Right expression - * @return Expr\Math - */ - public function sum($x, $y) - { - return new Expr\Math($x, '+', $y); - } - - /** - * Creates a quotient mathematical expression with the given arguments. - * First argument is considered the left expression and the second is the right expression. - * When converted to string, it will generated a / . Example: - * - * [php] - * // u.total / u.period - * $expr->quot('u.total', 'u.period') - * - * @param mixed $x Left expression - * @param mixed $y Right expression - * @return Expr\Math - */ - public function quot($x, $y) - { - return new Expr\Math($x, '/', $y); - } - - /** - * Creates a SQRT() function expression with the given argument. - * - * @param mixed $x Argument to be used in SQRT() function. - * @return Expr\Func - */ - public function sqrt($x) - { - return new Expr\Func('SQRT', array($x)); - } - - /** - * Creates an IN() expression with the given arguments. - * - * @param string $x Field in string format to be restricted by IN() function - * @param mixed $y Argument to be used in IN() function. - * @return Expr\Func - */ - public function in($x, $y) - { - if (is_array($y)) { - foreach ($y as &$literal) { - if ( ! ($literal instanceof Expr\Literal)) { - $literal = $this->_quoteLiteral($literal); - } - } - } - return new Expr\Func($x . ' IN', (array) $y); - } - - /** - * Creates a NOT IN() expression with the given arguments. - * - * @param string $x Field in string format to be restricted by NOT IN() function - * @param mixed $y Argument to be used in NOT IN() function. - * @return Expr\Func - */ - public function notIn($x, $y) - { - if (is_array($y)) { - foreach ($y as &$literal) { - if ( ! ($literal instanceof Expr\Literal)) { - $literal = $this->_quoteLiteral($literal); - } - } - } - return new Expr\Func($x . ' NOT IN', (array) $y); - } - - /** - * Creates an IS NULL expression with the given arguments. - * - * @param string $x Field in string format to be restricted by IS NULL - * @return string - */ - public function isNull($x) - { - return $x . ' IS NULL'; - } - - /** - * Creates an IS NOT NULL expression with the given arguments. - * - * @param string $x Field in string format to be restricted by IS NOT NULL - * @return string - */ - public function isNotNull($x) - { - return $x . ' IS NOT NULL'; - } - - /** - * Creates a LIKE() comparison expression with the given arguments. - * - * @param string $x Field in string format to be inspected by LIKE() comparison. - * @param mixed $y Argument to be used in LIKE() comparison. - * @return Expr\Comparison - */ - public function like($x, $y) - { - return new Expr\Comparison($x, 'LIKE', $y); - } - - /** - * Creates a CONCAT() function expression with the given arguments. - * - * @param mixed $x First argument to be used in CONCAT() function. - * @param mixed $x Second argument to be used in CONCAT() function. - * @return Expr\Func - */ - public function concat($x, $y) - { - return new Expr\Func('CONCAT', array($x, $y)); - } - - /** - * Creates a SUBSTRING() function expression with the given arguments. - * - * @param mixed $x Argument to be used as string to be cropped by SUBSTRING() function. - * @param integer $from Initial offset to start cropping string. May accept negative values. - * @param integer $len Length of crop. May accept negative values. - * @return Expr\Func - */ - public function substring($x, $from, $len = null) - { - $args = array($x, $from); - if (null !== $len) { - $args[] = $len; - } - return new Expr\Func('SUBSTRING', $args); - } - - /** - * Creates a LOWER() function expression with the given argument. - * - * @param mixed $x Argument to be used in LOWER() function. - * @return Expr\Func A LOWER function expression. - */ - public function lower($x) - { - return new Expr\Func('LOWER', array($x)); - } - - /** - * Creates an UPPER() function expression with the given argument. - * - * @param mixed $x Argument to be used in UPPER() function. - * @return Expr\Func An UPPER function expression. - */ - public function upper($x) - { - return new Expr\Func('UPPER', array($x)); - } - - /** - * Creates a LENGTH() function expression with the given argument. - * - * @param mixed $x Argument to be used as argument of LENGTH() function. - * @return Expr\Func A LENGTH function expression. - */ - public function length($x) - { - return new Expr\Func('LENGTH', array($x)); - } - - /** - * Creates a literal expression of the given argument. - * - * @param mixed $literal Argument to be converted to literal. - * @return Expr\Literal - */ - public function literal($literal) - { - return new Expr\Literal($this->_quoteLiteral($literal)); - } - - /** - * Quotes a literal value, if necessary, according to the DQL syntax. - * - * @param mixed $literal The literal value. - * @return string - */ - private function _quoteLiteral($literal) - { - if (is_numeric($literal) && !is_string($literal)) { - return (string) $literal; - } else if (is_bool($literal)) { - return $literal ? "true" : "false"; - } else { - return "'" . str_replace("'", "''", $literal) . "'"; - } - } - - /** - * Creates an instance of BETWEEN() function, with the given argument. - * - * @param mixed $val Valued to be inspected by range values. - * @param integer $x Starting range value to be used in BETWEEN() function. - * @param integer $y End point value to be used in BETWEEN() function. - * @return Expr\Func A BETWEEN expression. - */ - public function between($val, $x, $y) - { - return $val . ' BETWEEN ' . $x . ' AND ' . $y; - } - - /** - * Creates an instance of TRIM() function, with the given argument. - * - * @param mixed $x Argument to be used as argument of TRIM() function. - * @return Expr\Func a TRIM expression. - */ - public function trim($x) - { - return new Expr\Func('TRIM', $x); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Andx.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Andx.php deleted file mode 100644 index c5cf1f3..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Andx.php +++ /dev/null @@ -1,44 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\Expr; - -/** - * Expression class for building DQL and parts - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class Andx extends Composite -{ - protected $_separator = ' AND '; - protected $_allowedClasses = array( - 'Doctrine\ORM\Query\Expr\Comparison', - 'Doctrine\ORM\Query\Expr\Func', - 'Doctrine\ORM\Query\Expr\Orx', - 'Doctrine\ORM\Query\Expr\Andx', - ); -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Base.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Base.php deleted file mode 100644 index 975d450..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Base.php +++ /dev/null @@ -1,89 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\Expr; - -/** - * Abstract base Expr class for building DQL parts - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -abstract class Base -{ - protected $_preSeparator = '('; - protected $_separator = ', '; - protected $_postSeparator = ')'; - protected $_allowedClasses = array(); - - protected $_parts = array(); - - public function __construct($args = array()) - { - $this->addMultiple($args); - } - - public function addMultiple($args = array()) - { - foreach ((array) $args as $arg) { - $this->add($arg); - } - - return $this; - } - - public function add($arg) - { - if ( $arg !== null || ($arg instanceof self && $arg->count() > 0) ) { - // If we decide to keep Expr\Base instances, we can use this check - if ( ! is_string($arg)) { - $class = get_class($arg); - - if ( ! in_array($class, $this->_allowedClasses)) { - throw new \InvalidArgumentException("Expression of type '$class' not allowed in this context."); - } - } - - $this->_parts[] = $arg; - } - - return $this; - } - - public function count() - { - return count($this->_parts); - } - - public function __toString() - { - if ($this->count() == 1) { - return (string) $this->_parts[0]; - } - - return $this->_preSeparator . implode($this->_separator, $this->_parts) . $this->_postSeparator; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Comparison.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Comparison.php deleted file mode 100644 index d42560e..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Comparison.php +++ /dev/null @@ -1,59 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\Expr; - -/** - * Expression class for DQL comparison expressions - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class Comparison -{ - const EQ = '='; - const NEQ = '<>'; - const LT = '<'; - const LTE = '<='; - const GT = '>'; - const GTE = '>='; - - private $_leftExpr; - private $_operator; - private $_rightExpr; - - public function __construct($leftExpr, $operator, $rightExpr) - { - $this->_leftExpr = $leftExpr; - $this->_operator = $operator; - $this->_rightExpr = $rightExpr; - } - - public function __toString() - { - return $this->_leftExpr . ' ' . $this->_operator . ' ' . $this->_rightExpr; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Composite.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Composite.php deleted file mode 100644 index 036b241..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Composite.php +++ /dev/null @@ -1,68 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\Expr; - -/** - * Expression class for building DQL and parts - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class Composite extends Base -{ - public function __toString() - { - if ($this->count() === 1) { - return (string) $this->_parts[0]; - } - - $components = array(); - - foreach ($this->_parts as $part) { - $components[] = $this->processQueryPart($part); - } - - return implode($this->_separator, $components); - } - - - private function processQueryPart($part) - { - $queryPart = (string) $part; - - if (is_object($part) && $part instanceof self && $part->count() > 1) { - return $this->_preSeparator . $queryPart . $this->_postSeparator; - } - - // Fixes DDC-1237: User may have added a where item containing nested expression (with "OR" or "AND") - if (stripos($queryPart, ' OR ') !== false || stripos($queryPart, ' AND ') !== false) { - return $this->_preSeparator . $queryPart . $this->_postSeparator; - } - - return $queryPart; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/From.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/From.php deleted file mode 100644 index e5707cc..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/From.php +++ /dev/null @@ -1,88 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\Expr; - -/** - * Expression class for DQL from - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class From -{ - /** - * @var string - */ - private $_from; - - /** - * @var string - */ - private $_alias; - - /** - * @var string - */ - private $_indexBy; - - /** - * @param string $from The class name. - * @param string $alias The alias of the class. - * @param string $indexBy The index for the from. - */ - public function __construct($from, $alias, $indexBy = null) - { - $this->_from = $from; - $this->_alias = $alias; - $this->_indexBy = $indexBy; - } - - /** - * @return string - */ - public function getFrom() - { - return $this->_from; - } - - /** - * @return string - */ - public function getAlias() - { - return $this->_alias; - } - - /** - * @return string - */ - public function __toString() - { - return $this->_from . ' ' . $this->_alias . - ($this->_indexBy ? ' INDEX BY ' . $this->_indexBy : ''); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Func.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Func.php deleted file mode 100644 index 48b1a5b..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Func.php +++ /dev/null @@ -1,50 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\Expr; - -/** - * Expression class for generating DQL functions - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class Func -{ - private $_name; - private $_arguments; - - public function __construct($name, $arguments) - { - $this->_name = $name; - $this->_arguments = (array) $arguments; - } - - public function __toString() - { - return $this->_name . '(' . implode(', ', $this->_arguments) . ')'; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/GroupBy.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/GroupBy.php deleted file mode 100644 index dc36ba3..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/GroupBy.php +++ /dev/null @@ -1,39 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\Expr; - -/** - * Expression class for building DQL Group By parts - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class GroupBy extends Base -{ - protected $_preSeparator = ''; - protected $_postSeparator = ''; -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Join.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Join.php deleted file mode 100644 index 14f5b43..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Join.php +++ /dev/null @@ -1,67 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\Expr; - -/** - * Expression class for DQL from - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class Join -{ - const INNER_JOIN = 'INNER'; - const LEFT_JOIN = 'LEFT'; - - const ON = 'ON'; - const WITH = 'WITH'; - - private $_joinType; - private $_join; - private $_alias; - private $_conditionType; - private $_condition; - private $_indexBy; - - public function __construct($joinType, $join, $alias = null, $conditionType = null, $condition = null, $indexBy = null) - { - $this->_joinType = $joinType; - $this->_join = $join; - $this->_alias = $alias; - $this->_conditionType = $conditionType; - $this->_condition = $condition; - $this->_indexBy = $indexBy; - } - - public function __toString() - { - return strtoupper($this->_joinType) . ' JOIN ' . $this->_join - . ($this->_alias ? ' ' . $this->_alias : '') - . ($this->_condition ? ' ' . strtoupper($this->_conditionType) . ' ' . $this->_condition : '') - . ($this->_indexBy ? ' INDEX BY ' . $this->_indexBy : ''); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Literal.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Literal.php deleted file mode 100644 index c1dd5f7..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Literal.php +++ /dev/null @@ -1,9 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\Expr; - -/** - * Expression class for DQL math statements - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class Math -{ - private $_leftExpr; - private $_operator; - private $_rightExpr; - - public function __construct($leftExpr, $operator, $rightExpr) - { - $this->_leftExpr = $leftExpr; - $this->_operator = $operator; - $this->_rightExpr = $rightExpr; - } - - public function __toString() - { - // Adjusting Left Expression - $leftExpr = (string) $this->_leftExpr; - - if ($this->_leftExpr instanceof Math) { - $leftExpr = '(' . $leftExpr . ')'; - } - - // Adjusting Right Expression - $rightExpr = (string) $this->_rightExpr; - - if ($this->_rightExpr instanceof Math) { - $rightExpr = '(' . $rightExpr . ')'; - } - - return $leftExpr . ' ' . $this->_operator . ' ' . $rightExpr; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/OrderBy.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/OrderBy.php deleted file mode 100644 index a24e286..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/OrderBy.php +++ /dev/null @@ -1,66 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\Expr; - -/** - * Expression class for building DQL Order By parts - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class OrderBy -{ - protected $_preSeparator = ''; - protected $_separator = ', '; - protected $_postSeparator = ''; - protected $_allowedClasses = array(); - - private $_parts = array(); - - public function __construct($sort = null, $order = null) - { - if ($sort) { - $this->add($sort, $order); - } - } - - public function add($sort, $order = null) - { - $order = ! $order ? 'ASC' : $order; - $this->_parts[] = $sort . ' '. $order; - } - - public function count() - { - return count($this->_parts); - } - - public function __tostring() - { - return $this->_preSeparator . implode($this->_separator, $this->_parts) . $this->_postSeparator; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Orx.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Orx.php deleted file mode 100644 index 742e499..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Orx.php +++ /dev/null @@ -1,44 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\Expr; - -/** - * Expression class for building DQL OR clauses - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class Orx extends Composite -{ - protected $_separator = ' OR '; - protected $_allowedClasses = array( - 'Doctrine\ORM\Query\Expr\Comparison', - 'Doctrine\ORM\Query\Expr\Func', - 'Doctrine\ORM\Query\Expr\Andx', - 'Doctrine\ORM\Query\Expr\Orx', - ); -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Select.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Select.php deleted file mode 100644 index a310a0c..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Select.php +++ /dev/null @@ -1,42 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\Expr; - -/** - * Expression class for building DQL select statements - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class Select extends Base -{ - protected $_preSeparator = ''; - protected $_postSeparator = ''; - protected $_allowedClasses = array( - 'Doctrine\ORM\Query\Expr\Func' - ); -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Filter/SQLFilter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Filter/SQLFilter.php deleted file mode 100644 index a87dd84..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Filter/SQLFilter.php +++ /dev/null @@ -1,122 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query\Filter; - -use Doctrine\ORM\EntityManager, - Doctrine\ORM\Mapping\ClassMetaData, - Doctrine\ORM\Query\ParameterTypeInferer; - -/** - * The base class that user defined filters should extend. - * - * Handles the setting and escaping of parameters. - * - * @author Alexander - * @author Benjamin Eberlei - * @abstract - */ -abstract class SQLFilter -{ - /** - * The entity manager. - * @var EntityManager - */ - private $em; - - /** - * Parameters for the filter. - * @var array - */ - private $parameters; - - /** - * Constructs the SQLFilter object. - * - * @param EntityManager $em The EM - */ - final public function __construct(EntityManager $em) - { - $this->em = $em; - } - - /** - * Sets a parameter that can be used by the filter. - * - * @param string $name Name of the parameter. - * @param string $value Value of the parameter. - * @param string $type The parameter type. If specified, the given value will be run through - * the type conversion of this type. This is usually not needed for - * strings and numeric types. - * - * @return SQLFilter The current SQL filter. - */ - final public function setParameter($name, $value, $type = null) - { - if (null === $type) { - $type = ParameterTypeInferer::inferType($value); - } - - $this->parameters[$name] = array('value' => $value, 'type' => $type); - - // Keep the parameters sorted for the hash - ksort($this->parameters); - - // The filter collection of the EM is now dirty - $this->em->getFilters()->setFiltersStateDirty(); - - return $this; - } - - /** - * Gets a parameter to use in a query. - * - * The function is responsible for the right output escaping to use the - * value in a query. - * - * @param string $name Name of the parameter. - * - * @return string The SQL escaped parameter to use in a query. - */ - final public function getParameter($name) - { - if (!isset($this->parameters[$name])) { - throw new \InvalidArgumentException("Parameter '" . $name . "' does not exist."); - } - - return $this->em->getConnection()->quote($this->parameters[$name]['value'], $this->parameters[$name]['type']); - } - - /** - * Returns as string representation of the SQLFilter parameters (the state). - * - * @return string String representation of the SQLFilter. - */ - final public function __toString() - { - return serialize($this->parameters); - } - - /** - * Gets the SQL query part to add to a query. - * - * @return string The constraint SQL if there is available, empty string otherwise - */ - abstract public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias); -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/FilterCollection.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/FilterCollection.php deleted file mode 100644 index 35c8d04..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/FilterCollection.php +++ /dev/null @@ -1,198 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query; - -use Doctrine\ORM\Configuration, - Doctrine\ORM\EntityManager; - -/** - * Collection class for all the query filters. - * - * @author Alexander - */ -class FilterCollection -{ - /* Filter STATES */ - /** - * A filter object is in CLEAN state when it has no changed parameters. - */ - const FILTERS_STATE_CLEAN = 1; - - /** - * A filter object is in DIRTY state when it has changed parameters. - */ - const FILTERS_STATE_DIRTY = 2; - - /** - * The used Configuration. - * - * @var Doctrine\ORM\Configuration - */ - private $config; - - /** - * The EntityManager that "owns" this FilterCollection instance. - * - * @var Doctrine\ORM\EntityManager - */ - private $em; - - /** - * Instances of enabled filters. - * - * @var array - */ - private $enabledFilters = array(); - - /** - * @var string The filter hash from the last time the query was parsed. - */ - private $filterHash; - - /** - * @var integer $state The current state of this filter - */ - private $filtersState = self::FILTERS_STATE_CLEAN; - - /** - * Constructor. - * - * @param EntityManager $em - */ - public function __construct(EntityManager $em) - { - $this->em = $em; - $this->config = $em->getConfiguration(); - } - - /** - * Get all the enabled filters. - * - * @return array The enabled filters. - */ - public function getEnabledFilters() - { - return $this->enabledFilters; - } - - /** - * Enables a filter from the collection. - * - * @param string $name Name of the filter. - * - * @throws \InvalidArgumentException If the filter does not exist. - * - * @return SQLFilter The enabled filter. - */ - public function enable($name) - { - if (null === $filterClass = $this->config->getFilterClassName($name)) { - throw new \InvalidArgumentException("Filter '" . $name . "' does not exist."); - } - - if (!isset($this->enabledFilters[$name])) { - $this->enabledFilters[$name] = new $filterClass($this->em); - - // Keep the enabled filters sorted for the hash - ksort($this->enabledFilters); - - // Now the filter collection is dirty - $this->filtersState = self::FILTERS_STATE_DIRTY; - } - - return $this->enabledFilters[$name]; - } - - /** - * Disables a filter. - * - * @param string $name Name of the filter. - * - * @return SQLFilter The disabled filter. - * - * @throws \InvalidArgumentException If the filter does not exist. - */ - public function disable($name) - { - // Get the filter to return it - $filter = $this->getFilter($name); - - unset($this->enabledFilters[$name]); - - // Now the filter collection is dirty - $this->filtersState = self::FILTERS_STATE_DIRTY; - - return $filter; - } - - /** - * Get an enabled filter from the collection. - * - * @param string $name Name of the filter. - * - * @return SQLFilter The filter. - * - * @throws \InvalidArgumentException If the filter is not enabled. - */ - public function getFilter($name) - { - if (!isset($this->enabledFilters[$name])) { - throw new \InvalidArgumentException("Filter '" . $name . "' is not enabled."); - } - - return $this->enabledFilters[$name]; - } - - /** - * @return boolean True, if the filter collection is clean. - */ - public function isClean() - { - return self::FILTERS_STATE_CLEAN === $this->filtersState; - } - - /** - * Generates a string of currently enabled filters to use for the cache id. - * - * @return string - */ - public function getHash() - { - // If there are only clean filters, the previous hash can be returned - if (self::FILTERS_STATE_CLEAN === $this->filtersState) { - return $this->filterHash; - } - - $filterHash = ''; - foreach ($this->enabledFilters as $name => $filter) { - $filterHash .= $name . $filter; - } - - return $filterHash; - } - - /** - * Set the filter state to dirty. - */ - public function setFiltersStateDirty() - { - $this->filtersState = self::FILTERS_STATE_DIRTY; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Lexer.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Lexer.php deleted file mode 100644 index 1eef6af..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Lexer.php +++ /dev/null @@ -1,208 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query; - -/** - * Scans a DQL query for tokens. - * - * @author Guilherme Blanco - * @author Janne Vanhala - * @author Roman Borschel - * @since 2.0 - */ -class Lexer extends \Doctrine\Common\Lexer -{ - // All tokens that are not valid identifiers must be < 100 - const T_NONE = 1; - const T_INTEGER = 2; - const T_STRING = 3; - const T_INPUT_PARAMETER = 4; - const T_FLOAT = 5; - const T_CLOSE_PARENTHESIS = 6; - const T_OPEN_PARENTHESIS = 7; - const T_COMMA = 8; - const T_DIVIDE = 9; - const T_DOT = 10; - const T_EQUALS = 11; - const T_GREATER_THAN = 12; - const T_LOWER_THAN = 13; - const T_MINUS = 14; - const T_MULTIPLY = 15; - const T_NEGATE = 16; - const T_PLUS = 17; - const T_OPEN_CURLY_BRACE = 18; - const T_CLOSE_CURLY_BRACE = 19; - - // All tokens that are also identifiers should be >= 100 - const T_IDENTIFIER = 100; - const T_ALL = 101; - const T_AND = 102; - const T_ANY = 103; - const T_AS = 104; - const T_ASC = 105; - const T_AVG = 106; - const T_BETWEEN = 107; - const T_BOTH = 108; - const T_BY = 109; - const T_CASE = 110; - const T_COALESCE = 111; - const T_COUNT = 112; - const T_DELETE = 113; - const T_DESC = 114; - const T_DISTINCT = 115; - const T_ELSE = 116; - const T_EMPTY = 117; - const T_END = 118; - const T_ESCAPE = 119; - const T_EXISTS = 120; - const T_FALSE = 121; - const T_FROM = 122; - const T_GROUP = 123; - const T_HAVING = 124; - const T_HIDDEN = 125; - const T_IN = 126; - const T_INDEX = 127; - const T_INNER = 128; - const T_INSTANCE = 129; - const T_IS = 130; - const T_JOIN = 131; - const T_LEADING = 132; - const T_LEFT = 133; - const T_LIKE = 134; - const T_MAX = 135; - const T_MEMBER = 136; - const T_MIN = 137; - const T_NOT = 138; - const T_NULL = 139; - const T_NULLIF = 140; - const T_OF = 141; - const T_OR = 142; - const T_ORDER = 143; - const T_OUTER = 144; - const T_SELECT = 145; - const T_SET = 146; - const T_SIZE = 147; - const T_SOME = 148; - const T_SUM = 149; - const T_THEN = 150; - const T_TRAILING = 151; - const T_TRUE = 152; - const T_UPDATE = 153; - const T_WHEN = 154; - const T_WHERE = 155; - const T_WITH = 156; - const T_PARTIAL = 157; - const T_MOD = 158; - - /** - * Creates a new query scanner object. - * - * @param string $input a query string - */ - public function __construct($input) - { - $this->setInput($input); - } - - /** - * @inheritdoc - */ - protected function getCatchablePatterns() - { - return array( - '[a-z_\\\][a-z0-9_\:\\\]*[a-z0-9_]{1}', - '(?:[0-9]+(?:[\.][0-9]+)*)(?:e[+-]?[0-9]+)?', - "'(?:[^']|'')*'", - '\?[0-9]*|:[a-z]{1}[a-z0-9_]{0,}' - ); - } - - /** - * @inheritdoc - */ - protected function getNonCatchablePatterns() - { - return array('\s+', '(.)'); - } - - /** - * @inheritdoc - */ - protected function getType(&$value) - { - $type = self::T_NONE; - - switch (true) { - // Recognize numeric values - case (is_numeric($value)): - if (strpos($value, '.') !== false || stripos($value, 'e') !== false) { - return self::T_FLOAT; - } - - return self::T_INTEGER; - - // Recognize quoted strings - case ($value[0] === "'"): - $value = str_replace("''", "'", substr($value, 1, strlen($value) - 2)); - - return self::T_STRING; - - // Recognize identifiers - case (ctype_alpha($value[0]) || $value[0] === '_'): - $name = 'Doctrine\ORM\Query\Lexer::T_' . strtoupper($value); - - if (defined($name)) { - $type = constant($name); - - if ($type > 100) { - return $type; - } - } - - return self::T_IDENTIFIER; - - // Recognize input parameters - case ($value[0] === '?' || $value[0] === ':'): - return self::T_INPUT_PARAMETER; - - // Recognize symbols - case ($value === '.'): return self::T_DOT; - case ($value === ','): return self::T_COMMA; - case ($value === '('): return self::T_OPEN_PARENTHESIS; - case ($value === ')'): return self::T_CLOSE_PARENTHESIS; - case ($value === '='): return self::T_EQUALS; - case ($value === '>'): return self::T_GREATER_THAN; - case ($value === '<'): return self::T_LOWER_THAN; - case ($value === '+'): return self::T_PLUS; - case ($value === '-'): return self::T_MINUS; - case ($value === '*'): return self::T_MULTIPLY; - case ($value === '/'): return self::T_DIVIDE; - case ($value === '!'): return self::T_NEGATE; - case ($value === '{'): return self::T_OPEN_CURLY_BRACE; - case ($value === '}'): return self::T_CLOSE_CURLY_BRACE; - - // Default - default: - // Do nothing - } - - return $type; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/ParameterTypeInferer.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/ParameterTypeInferer.php deleted file mode 100644 index 39aef29..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/ParameterTypeInferer.php +++ /dev/null @@ -1,72 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query; - -use Doctrine\DBAL\Connection, - Doctrine\DBAL\Types\Type; - -/** - * Provides an enclosed support for parameter infering. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ParameterTypeInferer -{ - /** - * Infer type of a given value, returning a compatible constant: - * - Type (\Doctrine\DBAL\Types\Type::*) - * - Connection (\Doctrine\DBAL\Connection::PARAM_*) - * - * @param mixed $value Parameter value - * - * @return mixed Parameter type constant - */ - public static function inferType($value) - { - switch (true) { - case is_integer($value): - return Type::INTEGER; - - case ($value instanceof \DateTime): - return Type::DATETIME; - - case is_array($value): - $key = key($value); - - if (is_integer($value[$key])) { - return Connection::PARAM_INT_ARRAY; - } - - return Connection::PARAM_STR_ARRAY; - - default: - // Do nothing - break; - } - - return \PDO::PARAM_STR; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php deleted file mode 100644 index 4200836..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php +++ /dev/null @@ -1,3093 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query; - -use Doctrine\ORM\Query; -use Doctrine\ORM\Mapping\ClassMetadata; - -/** - * An LL(*) recursive-descent parser for the context-free grammar of the Doctrine Query Language. - * Parses a DQL query, reports any errors in it, and generates an AST. - * - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Janne Vanhala - */ -class Parser -{ - /** READ-ONLY: Maps BUILT-IN string function names to AST class names. */ - private static $_STRING_FUNCTIONS = array( - 'concat' => 'Doctrine\ORM\Query\AST\Functions\ConcatFunction', - 'substring' => 'Doctrine\ORM\Query\AST\Functions\SubstringFunction', - 'trim' => 'Doctrine\ORM\Query\AST\Functions\TrimFunction', - 'lower' => 'Doctrine\ORM\Query\AST\Functions\LowerFunction', - 'upper' => 'Doctrine\ORM\Query\AST\Functions\UpperFunction', - 'identity' => 'Doctrine\ORM\Query\AST\Functions\IdentityFunction', - ); - - /** READ-ONLY: Maps BUILT-IN numeric function names to AST class names. */ - private static $_NUMERIC_FUNCTIONS = array( - 'length' => 'Doctrine\ORM\Query\AST\Functions\LengthFunction', - 'locate' => 'Doctrine\ORM\Query\AST\Functions\LocateFunction', - 'abs' => 'Doctrine\ORM\Query\AST\Functions\AbsFunction', - 'sqrt' => 'Doctrine\ORM\Query\AST\Functions\SqrtFunction', - 'mod' => 'Doctrine\ORM\Query\AST\Functions\ModFunction', - 'size' => 'Doctrine\ORM\Query\AST\Functions\SizeFunction', - 'date_diff' => 'Doctrine\ORM\Query\AST\Functions\DateDiffFunction', - 'bit_and' => 'Doctrine\ORM\Query\AST\Functions\BitAndFunction', - 'bit_or' => 'Doctrine\ORM\Query\AST\Functions\BitOrFunction', - ); - - /** READ-ONLY: Maps BUILT-IN datetime function names to AST class names. */ - private static $_DATETIME_FUNCTIONS = array( - 'current_date' => 'Doctrine\ORM\Query\AST\Functions\CurrentDateFunction', - 'current_time' => 'Doctrine\ORM\Query\AST\Functions\CurrentTimeFunction', - 'current_timestamp' => 'Doctrine\ORM\Query\AST\Functions\CurrentTimestampFunction', - 'date_add' => 'Doctrine\ORM\Query\AST\Functions\DateAddFunction', - 'date_sub' => 'Doctrine\ORM\Query\AST\Functions\DateSubFunction', - ); - - /** - * Expressions that were encountered during parsing of identifiers and expressions - * and still need to be validated. - */ - private $_deferredIdentificationVariables = array(); - private $_deferredPartialObjectExpressions = array(); - private $_deferredPathExpressions = array(); - private $_deferredResultVariables = array(); - - /** - * The lexer. - * - * @var \Doctrine\ORM\Query\Lexer - */ - private $_lexer; - - /** - * The parser result. - * - * @var \Doctrine\ORM\Query\ParserResult - */ - private $_parserResult; - - /** - * The EntityManager. - * - * @var EnityManager - */ - private $_em; - - /** - * The Query to parse. - * - * @var Query - */ - private $_query; - - /** - * Map of declared query components in the parsed query. - * - * @var array - */ - private $_queryComponents = array(); - - /** - * Keeps the nesting level of defined ResultVariables - * - * @var integer - */ - private $_nestingLevel = 0; - - /** - * Any additional custom tree walkers that modify the AST. - * - * @var array - */ - private $_customTreeWalkers = array(); - - /** - * The custom last tree walker, if any, that is responsible for producing the output. - * - * @var TreeWalker - */ - private $_customOutputWalker; - - /** - * @var array - */ - private $_identVariableExpressions = array(); - - /** - * Creates a new query parser object. - * - * @param Query $query The Query to parse. - */ - public function __construct(Query $query) - { - $this->_query = $query; - $this->_em = $query->getEntityManager(); - $this->_lexer = new Lexer($query->getDql()); - $this->_parserResult = new ParserResult(); - } - - /** - * Sets a custom tree walker that produces output. - * This tree walker will be run last over the AST, after any other walkers. - * - * @param string $className - */ - public function setCustomOutputTreeWalker($className) - { - $this->_customOutputWalker = $className; - } - - /** - * Adds a custom tree walker for modifying the AST. - * - * @param string $className - */ - public function addCustomTreeWalker($className) - { - $this->_customTreeWalkers[] = $className; - } - - /** - * Gets the lexer used by the parser. - * - * @return \Doctrine\ORM\Query\Lexer - */ - public function getLexer() - { - return $this->_lexer; - } - - /** - * Gets the ParserResult that is being filled with information during parsing. - * - * @return \Doctrine\ORM\Query\ParserResult - */ - public function getParserResult() - { - return $this->_parserResult; - } - - /** - * Gets the EntityManager used by the parser. - * - * @return EntityManager - */ - public function getEntityManager() - { - return $this->_em; - } - - /** - * Parse and build AST for the given Query. - * - * @return \Doctrine\ORM\Query\AST\SelectStatement | - * \Doctrine\ORM\Query\AST\UpdateStatement | - * \Doctrine\ORM\Query\AST\DeleteStatement - */ - public function getAST() - { - // Parse & build AST - $AST = $this->QueryLanguage(); - - // Process any deferred validations of some nodes in the AST. - // This also allows post-processing of the AST for modification purposes. - $this->_processDeferredIdentificationVariables(); - - if ($this->_deferredPartialObjectExpressions) { - $this->_processDeferredPartialObjectExpressions(); - } - - if ($this->_deferredPathExpressions) { - $this->_processDeferredPathExpressions($AST); - } - - if ($this->_deferredResultVariables) { - $this->_processDeferredResultVariables(); - } - - $this->_processRootEntityAliasSelected(); - - // TODO: Is there a way to remove this? It may impact the mixed hydration resultset a lot! - $this->fixIdentificationVariableOrder($AST); - - return $AST; - } - - /** - * Attempts to match the given token with the current lookahead token. - * - * If they match, updates the lookahead token; otherwise raises a syntax - * error. - * - * @param int token type - * @return void - * @throws QueryException If the tokens dont match. - */ - public function match($token) - { - $lookaheadType = $this->_lexer->lookahead['type']; - - // short-circuit on first condition, usually types match - if ($lookaheadType !== $token && $token !== Lexer::T_IDENTIFIER && $lookaheadType <= Lexer::T_IDENTIFIER) { - $this->syntaxError($this->_lexer->getLiteral($token)); - } - - $this->_lexer->moveNext(); - } - - /** - * Free this parser enabling it to be reused - * - * @param boolean $deep Whether to clean peek and reset errors - * @param integer $position Position to reset - */ - public function free($deep = false, $position = 0) - { - // WARNING! Use this method with care. It resets the scanner! - $this->_lexer->resetPosition($position); - - // Deep = true cleans peek and also any previously defined errors - if ($deep) { - $this->_lexer->resetPeek(); - } - - $this->_lexer->token = null; - $this->_lexer->lookahead = null; - } - - /** - * Parses a query string. - * - * @return ParserResult - */ - public function parse() - { - $AST = $this->getAST(); - - if (($customWalkers = $this->_query->getHint(Query::HINT_CUSTOM_TREE_WALKERS)) !== false) { - $this->_customTreeWalkers = $customWalkers; - } - - if (($customOutputWalker = $this->_query->getHint(Query::HINT_CUSTOM_OUTPUT_WALKER)) !== false) { - $this->_customOutputWalker = $customOutputWalker; - } - - // Run any custom tree walkers over the AST - if ($this->_customTreeWalkers) { - $treeWalkerChain = new TreeWalkerChain($this->_query, $this->_parserResult, $this->_queryComponents); - - foreach ($this->_customTreeWalkers as $walker) { - $treeWalkerChain->addTreeWalker($walker); - } - - switch (true) { - case ($AST instanceof AST\UpdateStatement): - $treeWalkerChain->walkUpdateStatement($AST); - break; - - case ($AST instanceof AST\DeleteStatement): - $treeWalkerChain->walkDeleteStatement($AST); - break; - - case ($AST instanceof AST\SelectStatement): - default: - $treeWalkerChain->walkSelectStatement($AST); - } - } - - $outputWalkerClass = $this->_customOutputWalker ?: __NAMESPACE__ . '\SqlWalker'; - $outputWalker = new $outputWalkerClass($this->_query, $this->_parserResult, $this->_queryComponents); - - // Assign an SQL executor to the parser result - $this->_parserResult->setSqlExecutor($outputWalker->getExecutor($AST)); - - return $this->_parserResult; - } - - /** - * Fix order of identification variables. - * - * They have to appear in the select clause in the same order as the - * declarations (from ... x join ... y join ... z ...) appear in the query - * as the hydration process relies on that order for proper operation. - * - * @param AST\SelectStatement|AST\DeleteStatement|AST\UpdateStatement $AST - * @return void - */ - private function fixIdentificationVariableOrder($AST) - { - if (count($this->_identVariableExpressions) <= 1) { - return; - } - - foreach ($this->_queryComponents as $dqlAlias => $qComp) { - if ( ! isset($this->_identVariableExpressions[$dqlAlias])) { - continue; - } - - $expr = $this->_identVariableExpressions[$dqlAlias]; - $key = array_search($expr, $AST->selectClause->selectExpressions); - - unset($AST->selectClause->selectExpressions[$key]); - - $AST->selectClause->selectExpressions[] = $expr; - } - } - - /** - * Generates a new syntax error. - * - * @param string $expected Expected string. - * @param array $token Got token. - * - * @throws \Doctrine\ORM\Query\QueryException - */ - public function syntaxError($expected = '', $token = null) - { - if ($token === null) { - $token = $this->_lexer->lookahead; - } - - $tokenPos = (isset($token['position'])) ? $token['position'] : '-1'; - - $message = "line 0, col {$tokenPos}: Error: "; - $message .= ($expected !== '') ? "Expected {$expected}, got " : 'Unexpected '; - $message .= ($this->_lexer->lookahead === null) ? 'end of string.' : "'{$token['value']}'"; - - throw QueryException::syntaxError($message); - } - - /** - * Generates a new semantical error. - * - * @param string $message Optional message. - * @param array $token Optional token. - * - * @throws \Doctrine\ORM\Query\QueryException - */ - public function semanticalError($message = '', $token = null) - { - if ($token === null) { - $token = $this->_lexer->lookahead; - } - - // Minimum exposed chars ahead of token - $distance = 12; - - // Find a position of a final word to display in error string - $dql = $this->_query->getDql(); - $length = strlen($dql); - $pos = $token['position'] + $distance; - $pos = strpos($dql, ' ', ($length > $pos) ? $pos : $length); - $length = ($pos !== false) ? $pos - $token['position'] : $distance; - - $tokenPos = (isset($token['position']) && $token['position'] > 0) ? $token['position'] : '-1'; - $tokenStr = substr($dql, $token['position'], $length); - - // Building informative message - $message = 'line 0, col ' . $tokenPos . " near '" . $tokenStr . "': Error: " . $message; - - throw QueryException::semanticalError($message); - } - - /** - * Peeks beyond the specified token and returns the first token after that one. - * - * @param array $token - * @return array - */ - private function _peekBeyond($token) - { - $peek = $this->_lexer->peek(); - - while ($peek['value'] != $token) { - $peek = $this->_lexer->peek(); - } - - $peek = $this->_lexer->peek(); - $this->_lexer->resetPeek(); - - return $peek; - } - - /** - * Peek beyond the matched closing parenthesis and return the first token after that one. - * - * @return array - */ - private function _peekBeyondClosingParenthesis() - { - $token = $this->_lexer->peek(); - $numUnmatched = 1; - - while ($numUnmatched > 0 && $token !== null) { - switch ($token['type']) { - case Lexer::T_OPEN_PARENTHESIS: - ++$numUnmatched; - break; - - case Lexer::T_CLOSE_PARENTHESIS: - --$numUnmatched; - break; - - default: - // Do nothing - } - - $token = $this->_lexer->peek(); - } - - $this->_lexer->resetPeek(); - - return $token; - } - - /** - * Checks if the given token indicates a mathematical operator. - * - * @return boolean TRUE if the token is a mathematical operator, FALSE otherwise. - */ - private function _isMathOperator($token) - { - return in_array($token['type'], array(Lexer::T_PLUS, Lexer::T_MINUS, Lexer::T_DIVIDE, Lexer::T_MULTIPLY)); - } - - /** - * Checks if the next-next (after lookahead) token starts a function. - * - * @return boolean TRUE if the next-next tokens start a function, FALSE otherwise. - */ - private function _isFunction() - { - $peek = $this->_lexer->peek(); - $nextpeek = $this->_lexer->peek(); - - $this->_lexer->resetPeek(); - - // We deny the COUNT(SELECT * FROM User u) here. COUNT won't be considered a function - return ($peek['type'] === Lexer::T_OPEN_PARENTHESIS && $nextpeek['type'] !== Lexer::T_SELECT); - } - - /** - * Checks whether the given token type indicates an aggregate function. - * - * @return boolean TRUE if the token type is an aggregate function, FALSE otherwise. - */ - private function _isAggregateFunction($tokenType) - { - return in_array($tokenType, array(Lexer::T_AVG, Lexer::T_MIN, Lexer::T_MAX, Lexer::T_SUM, Lexer::T_COUNT)); - } - - /** - * Checks whether the current lookahead token of the lexer has the type T_ALL, T_ANY or T_SOME. - * - * @return boolean - */ - private function _isNextAllAnySome() - { - return in_array($this->_lexer->lookahead['type'], array(Lexer::T_ALL, Lexer::T_ANY, Lexer::T_SOME)); - } - - /** - * Validates that the given IdentificationVariable is semantically correct. - * It must exist in query components list. - * - * @return void - */ - private function _processDeferredIdentificationVariables() - { - foreach ($this->_deferredIdentificationVariables as $deferredItem) { - $identVariable = $deferredItem['expression']; - - // Check if IdentificationVariable exists in queryComponents - if ( ! isset($this->_queryComponents[$identVariable])) { - $this->semanticalError( - "'$identVariable' is not defined.", $deferredItem['token'] - ); - } - - $qComp = $this->_queryComponents[$identVariable]; - - // Check if queryComponent points to an AbstractSchemaName or a ResultVariable - if ( ! isset($qComp['metadata'])) { - $this->semanticalError( - "'$identVariable' does not point to a Class.", $deferredItem['token'] - ); - } - - // Validate if identification variable nesting level is lower or equal than the current one - if ($qComp['nestingLevel'] > $deferredItem['nestingLevel']) { - $this->semanticalError( - "'$identVariable' is used outside the scope of its declaration.", $deferredItem['token'] - ); - } - } - } - - /** - * Validates that the given PartialObjectExpression is semantically correct. - * It must exist in query components list. - * - * @return void - */ - private function _processDeferredPartialObjectExpressions() - { - foreach ($this->_deferredPartialObjectExpressions as $deferredItem) { - $expr = $deferredItem['expression']; - $class = $this->_queryComponents[$expr->identificationVariable]['metadata']; - - foreach ($expr->partialFieldSet as $field) { - if (isset($class->fieldMappings[$field])) { - continue; - } - - $this->semanticalError( - "There is no mapped field named '$field' on class " . $class->name . ".", $deferredItem['token'] - ); - } - - if (array_intersect($class->identifier, $expr->partialFieldSet) != $class->identifier) { - $this->semanticalError( - "The partial field selection of class " . $class->name . " must contain the identifier.", - $deferredItem['token'] - ); - } - } - } - - /** - * Validates that the given ResultVariable is semantically correct. - * It must exist in query components list. - * - * @return void - */ - private function _processDeferredResultVariables() - { - foreach ($this->_deferredResultVariables as $deferredItem) { - $resultVariable = $deferredItem['expression']; - - // Check if ResultVariable exists in queryComponents - if ( ! isset($this->_queryComponents[$resultVariable])) { - $this->semanticalError( - "'$resultVariable' is not defined.", $deferredItem['token'] - ); - } - - $qComp = $this->_queryComponents[$resultVariable]; - - // Check if queryComponent points to an AbstractSchemaName or a ResultVariable - if ( ! isset($qComp['resultVariable'])) { - $this->semanticalError( - "'$identVariable' does not point to a ResultVariable.", $deferredItem['token'] - ); - } - - // Validate if identification variable nesting level is lower or equal than the current one - if ($qComp['nestingLevel'] > $deferredItem['nestingLevel']) { - $this->semanticalError( - "'$resultVariable' is used outside the scope of its declaration.", $deferredItem['token'] - ); - } - } - } - - /** - * Validates that the given PathExpression is semantically correct for grammar rules: - * - * AssociationPathExpression ::= CollectionValuedPathExpression | SingleValuedAssociationPathExpression - * SingleValuedPathExpression ::= StateFieldPathExpression | SingleValuedAssociationPathExpression - * StateFieldPathExpression ::= IdentificationVariable "." StateField - * SingleValuedAssociationPathExpression ::= IdentificationVariable "." SingleValuedAssociationField - * CollectionValuedPathExpression ::= IdentificationVariable "." CollectionValuedAssociationField - * - * @param array $deferredItem - * @param mixed $AST - */ - private function _processDeferredPathExpressions($AST) - { - foreach ($this->_deferredPathExpressions as $deferredItem) { - $pathExpression = $deferredItem['expression']; - - $qComp = $this->_queryComponents[$pathExpression->identificationVariable]; - $class = $qComp['metadata']; - - if (($field = $pathExpression->field) === null) { - $field = $pathExpression->field = $class->identifier[0]; - } - - // Check if field or association exists - if ( ! isset($class->associationMappings[$field]) && ! isset($class->fieldMappings[$field])) { - $this->semanticalError( - 'Class ' . $class->name . ' has no field or association named ' . $field, - $deferredItem['token'] - ); - } - - $fieldType = AST\PathExpression::TYPE_STATE_FIELD; - - if (isset($class->associationMappings[$field])) { - $assoc = $class->associationMappings[$field]; - - $fieldType = ($assoc['type'] & ClassMetadata::TO_ONE) - ? AST\PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION - : AST\PathExpression::TYPE_COLLECTION_VALUED_ASSOCIATION; - } - - // Validate if PathExpression is one of the expected types - $expectedType = $pathExpression->expectedType; - - if ( ! ($expectedType & $fieldType)) { - // We need to recognize which was expected type(s) - $expectedStringTypes = array(); - - // Validate state field type - if ($expectedType & AST\PathExpression::TYPE_STATE_FIELD) { - $expectedStringTypes[] = 'StateFieldPathExpression'; - } - - // Validate single valued association (*-to-one) - if ($expectedType & AST\PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION) { - $expectedStringTypes[] = 'SingleValuedAssociationField'; - } - - // Validate single valued association (*-to-many) - if ($expectedType & AST\PathExpression::TYPE_COLLECTION_VALUED_ASSOCIATION) { - $expectedStringTypes[] = 'CollectionValuedAssociationField'; - } - - // Build the error message - $semanticalError = 'Invalid PathExpression. '; - $semanticalError .= (count($expectedStringTypes) == 1) - ? 'Must be a ' . $expectedStringTypes[0] . '.' - : implode(' or ', $expectedStringTypes) . ' expected.'; - - $this->semanticalError($semanticalError, $deferredItem['token']); - } - - // We need to force the type in PathExpression - $pathExpression->type = $fieldType; - } - } - - private function _processRootEntityAliasSelected() - { - if ( ! count($this->_identVariableExpressions)) { - return; - } - - $foundRootEntity = false; - - foreach ($this->_identVariableExpressions AS $dqlAlias => $expr) { - if (isset($this->_queryComponents[$dqlAlias]) && $this->_queryComponents[$dqlAlias]['parent'] === null) { - $foundRootEntity = true; - } - } - - if ( ! $foundRootEntity) { - $this->semanticalError('Cannot select entity through identification variables without choosing at least one root entity alias.'); - } - } - - /** - * QueryLanguage ::= SelectStatement | UpdateStatement | DeleteStatement - * - * @return \Doctrine\ORM\Query\AST\SelectStatement | - * \Doctrine\ORM\Query\AST\UpdateStatement | - * \Doctrine\ORM\Query\AST\DeleteStatement - */ - public function QueryLanguage() - { - $this->_lexer->moveNext(); - - switch ($this->_lexer->lookahead['type']) { - case Lexer::T_SELECT: - $statement = $this->SelectStatement(); - break; - - case Lexer::T_UPDATE: - $statement = $this->UpdateStatement(); - break; - - case Lexer::T_DELETE: - $statement = $this->DeleteStatement(); - break; - - default: - $this->syntaxError('SELECT, UPDATE or DELETE'); - break; - } - - // Check for end of string - if ($this->_lexer->lookahead !== null) { - $this->syntaxError('end of string'); - } - - return $statement; - } - - /** - * SelectStatement ::= SelectClause FromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause] - * - * @return \Doctrine\ORM\Query\AST\SelectStatement - */ - public function SelectStatement() - { - $selectStatement = new AST\SelectStatement($this->SelectClause(), $this->FromClause()); - - $selectStatement->whereClause = $this->_lexer->isNextToken(Lexer::T_WHERE) ? $this->WhereClause() : null; - $selectStatement->groupByClause = $this->_lexer->isNextToken(Lexer::T_GROUP) ? $this->GroupByClause() : null; - $selectStatement->havingClause = $this->_lexer->isNextToken(Lexer::T_HAVING) ? $this->HavingClause() : null; - $selectStatement->orderByClause = $this->_lexer->isNextToken(Lexer::T_ORDER) ? $this->OrderByClause() : null; - - return $selectStatement; - } - - /** - * UpdateStatement ::= UpdateClause [WhereClause] - * - * @return \Doctrine\ORM\Query\AST\UpdateStatement - */ - public function UpdateStatement() - { - $updateStatement = new AST\UpdateStatement($this->UpdateClause()); - - $updateStatement->whereClause = $this->_lexer->isNextToken(Lexer::T_WHERE) ? $this->WhereClause() : null; - - return $updateStatement; - } - - /** - * DeleteStatement ::= DeleteClause [WhereClause] - * - * @return \Doctrine\ORM\Query\AST\DeleteStatement - */ - public function DeleteStatement() - { - $deleteStatement = new AST\DeleteStatement($this->DeleteClause()); - - $deleteStatement->whereClause = $this->_lexer->isNextToken(Lexer::T_WHERE) ? $this->WhereClause() : null; - - return $deleteStatement; - } - - /** - * IdentificationVariable ::= identifier - * - * @return string - */ - public function IdentificationVariable() - { - $this->match(Lexer::T_IDENTIFIER); - - $identVariable = $this->_lexer->token['value']; - - $this->_deferredIdentificationVariables[] = array( - 'expression' => $identVariable, - 'nestingLevel' => $this->_nestingLevel, - 'token' => $this->_lexer->token, - ); - - return $identVariable; - } - - /** - * AliasIdentificationVariable = identifier - * - * @return string - */ - public function AliasIdentificationVariable() - { - $this->match(Lexer::T_IDENTIFIER); - - $aliasIdentVariable = $this->_lexer->token['value']; - $exists = isset($this->_queryComponents[$aliasIdentVariable]); - - if ($exists) { - $this->semanticalError("'$aliasIdentVariable' is already defined.", $this->_lexer->token); - } - - return $aliasIdentVariable; - } - - /** - * AbstractSchemaName ::= identifier - * - * @return string - */ - public function AbstractSchemaName() - { - $this->match(Lexer::T_IDENTIFIER); - - $schemaName = ltrim($this->_lexer->token['value'], '\\'); - - if (strrpos($schemaName, ':') !== false) { - list($namespaceAlias, $simpleClassName) = explode(':', $schemaName); - - $schemaName = $this->_em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; - } - - $exists = class_exists($schemaName, true); - - if ( ! $exists) { - $this->semanticalError("Class '$schemaName' is not defined.", $this->_lexer->token); - } - - return $schemaName; - } - - /** - * AliasResultVariable ::= identifier - * - * @return string - */ - public function AliasResultVariable() - { - $this->match(Lexer::T_IDENTIFIER); - - $resultVariable = $this->_lexer->token['value']; - $exists = isset($this->_queryComponents[$resultVariable]); - - if ($exists) { - $this->semanticalError("'$resultVariable' is already defined.", $this->_lexer->token); - } - - return $resultVariable; - } - - /** - * ResultVariable ::= identifier - * - * @return string - */ - public function ResultVariable() - { - $this->match(Lexer::T_IDENTIFIER); - - $resultVariable = $this->_lexer->token['value']; - - // Defer ResultVariable validation - $this->_deferredResultVariables[] = array( - 'expression' => $resultVariable, - 'nestingLevel' => $this->_nestingLevel, - 'token' => $this->_lexer->token, - ); - - return $resultVariable; - } - - /** - * JoinAssociationPathExpression ::= IdentificationVariable "." (CollectionValuedAssociationField | SingleValuedAssociationField) - * - * @return \Doctrine\ORM\Query\AST\JoinAssociationPathExpression - */ - public function JoinAssociationPathExpression() - { - $token = $this->_lexer->lookahead; - $identVariable = $this->IdentificationVariable(); - - if ( ! isset($this->_queryComponents[$identVariable])) { - $this->semanticalError( - 'Identification Variable ' . $identVariable .' used in join path expression but was not defined before.' - ); - } - - $this->match(Lexer::T_DOT); - $this->match(Lexer::T_IDENTIFIER); - - $field = $this->_lexer->token['value']; - - // Validate association field - $qComp = $this->_queryComponents[$identVariable]; - $class = $qComp['metadata']; - - if ( ! isset($class->associationMappings[$field])) { - $this->semanticalError('Class ' . $class->name . ' has no association named ' . $field); - } - - return new AST\JoinAssociationPathExpression($identVariable, $field); - } - - /** - * Parses an arbitrary path expression and defers semantical validation - * based on expected types. - * - * PathExpression ::= IdentificationVariable "." identifier - * - * @param integer $expectedTypes - * @return \Doctrine\ORM\Query\AST\PathExpression - */ - public function PathExpression($expectedTypes) - { - $token = $this->_lexer->lookahead; - $identVariable = $this->IdentificationVariable(); - $field = null; - - if ($this->_lexer->isNextToken(Lexer::T_DOT)) { - $this->match(Lexer::T_DOT); - $this->match(Lexer::T_IDENTIFIER); - - $field = $this->_lexer->token['value']; - } - - // Creating AST node - $pathExpr = new AST\PathExpression($expectedTypes, $identVariable, $field); - - // Defer PathExpression validation if requested to be defered - $this->_deferredPathExpressions[] = array( - 'expression' => $pathExpr, - 'nestingLevel' => $this->_nestingLevel, - 'token' => $this->_lexer->token, - ); - - return $pathExpr; - } - - /** - * AssociationPathExpression ::= CollectionValuedPathExpression | SingleValuedAssociationPathExpression - * - * @return \Doctrine\ORM\Query\AST\PathExpression - */ - public function AssociationPathExpression() - { - return $this->PathExpression( - AST\PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION | - AST\PathExpression::TYPE_COLLECTION_VALUED_ASSOCIATION - ); - } - - /** - * SingleValuedPathExpression ::= StateFieldPathExpression | SingleValuedAssociationPathExpression - * - * @return \Doctrine\ORM\Query\AST\PathExpression - */ - public function SingleValuedPathExpression() - { - return $this->PathExpression( - AST\PathExpression::TYPE_STATE_FIELD | - AST\PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION - ); - } - - /** - * StateFieldPathExpression ::= IdentificationVariable "." StateField - * - * @return \Doctrine\ORM\Query\AST\PathExpression - */ - public function StateFieldPathExpression() - { - return $this->PathExpression(AST\PathExpression::TYPE_STATE_FIELD); - } - - /** - * SingleValuedAssociationPathExpression ::= IdentificationVariable "." SingleValuedAssociationField - * - * @return \Doctrine\ORM\Query\AST\PathExpression - */ - public function SingleValuedAssociationPathExpression() - { - return $this->PathExpression(AST\PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION); - } - - /** - * CollectionValuedPathExpression ::= IdentificationVariable "." CollectionValuedAssociationField - * - * @return \Doctrine\ORM\Query\AST\PathExpression - */ - public function CollectionValuedPathExpression() - { - return $this->PathExpression(AST\PathExpression::TYPE_COLLECTION_VALUED_ASSOCIATION); - } - - /** - * SelectClause ::= "SELECT" ["DISTINCT"] SelectExpression {"," SelectExpression} - * - * @return \Doctrine\ORM\Query\AST\SelectClause - */ - public function SelectClause() - { - $isDistinct = false; - $this->match(Lexer::T_SELECT); - - // Check for DISTINCT - if ($this->_lexer->isNextToken(Lexer::T_DISTINCT)) { - $this->match(Lexer::T_DISTINCT); - - $isDistinct = true; - } - - // Process SelectExpressions (1..N) - $selectExpressions = array(); - $selectExpressions[] = $this->SelectExpression(); - - while ($this->_lexer->isNextToken(Lexer::T_COMMA)) { - $this->match(Lexer::T_COMMA); - - $selectExpressions[] = $this->SelectExpression(); - } - - return new AST\SelectClause($selectExpressions, $isDistinct); - } - - /** - * SimpleSelectClause ::= "SELECT" ["DISTINCT"] SimpleSelectExpression - * - * @return \Doctrine\ORM\Query\AST\SimpleSelectClause - */ - public function SimpleSelectClause() - { - $isDistinct = false; - $this->match(Lexer::T_SELECT); - - if ($this->_lexer->isNextToken(Lexer::T_DISTINCT)) { - $this->match(Lexer::T_DISTINCT); - - $isDistinct = true; - } - - return new AST\SimpleSelectClause($this->SimpleSelectExpression(), $isDistinct); - } - - /** - * UpdateClause ::= "UPDATE" AbstractSchemaName ["AS"] AliasIdentificationVariable "SET" UpdateItem {"," UpdateItem}* - * - * @return \Doctrine\ORM\Query\AST\UpdateClause - */ - public function UpdateClause() - { - $this->match(Lexer::T_UPDATE); - $token = $this->_lexer->lookahead; - $abstractSchemaName = $this->AbstractSchemaName(); - - if ($this->_lexer->isNextToken(Lexer::T_AS)) { - $this->match(Lexer::T_AS); - } - - $aliasIdentificationVariable = $this->AliasIdentificationVariable(); - - $class = $this->_em->getClassMetadata($abstractSchemaName); - - // Building queryComponent - $queryComponent = array( - 'metadata' => $class, - 'parent' => null, - 'relation' => null, - 'map' => null, - 'nestingLevel' => $this->_nestingLevel, - 'token' => $token, - ); - - $this->_queryComponents[$aliasIdentificationVariable] = $queryComponent; - - $this->match(Lexer::T_SET); - - $updateItems = array(); - $updateItems[] = $this->UpdateItem(); - - while ($this->_lexer->isNextToken(Lexer::T_COMMA)) { - $this->match(Lexer::T_COMMA); - - $updateItems[] = $this->UpdateItem(); - } - - $updateClause = new AST\UpdateClause($abstractSchemaName, $updateItems); - $updateClause->aliasIdentificationVariable = $aliasIdentificationVariable; - - return $updateClause; - } - - /** - * DeleteClause ::= "DELETE" ["FROM"] AbstractSchemaName ["AS"] AliasIdentificationVariable - * - * @return \Doctrine\ORM\Query\AST\DeleteClause - */ - public function DeleteClause() - { - $this->match(Lexer::T_DELETE); - - if ($this->_lexer->isNextToken(Lexer::T_FROM)) { - $this->match(Lexer::T_FROM); - } - - $token = $this->_lexer->lookahead; - $deleteClause = new AST\DeleteClause($this->AbstractSchemaName()); - - if ($this->_lexer->isNextToken(Lexer::T_AS)) { - $this->match(Lexer::T_AS); - } - - $aliasIdentificationVariable = $this->AliasIdentificationVariable(); - - $deleteClause->aliasIdentificationVariable = $aliasIdentificationVariable; - $class = $this->_em->getClassMetadata($deleteClause->abstractSchemaName); - - // Building queryComponent - $queryComponent = array( - 'metadata' => $class, - 'parent' => null, - 'relation' => null, - 'map' => null, - 'nestingLevel' => $this->_nestingLevel, - 'token' => $token, - ); - - $this->_queryComponents[$aliasIdentificationVariable] = $queryComponent; - - return $deleteClause; - } - - /** - * FromClause ::= "FROM" IdentificationVariableDeclaration {"," IdentificationVariableDeclaration}* - * - * @return \Doctrine\ORM\Query\AST\FromClause - */ - public function FromClause() - { - $this->match(Lexer::T_FROM); - - $identificationVariableDeclarations = array(); - $identificationVariableDeclarations[] = $this->IdentificationVariableDeclaration(); - - while ($this->_lexer->isNextToken(Lexer::T_COMMA)) { - $this->match(Lexer::T_COMMA); - - $identificationVariableDeclarations[] = $this->IdentificationVariableDeclaration(); - } - - return new AST\FromClause($identificationVariableDeclarations); - } - - /** - * SubselectFromClause ::= "FROM" SubselectIdentificationVariableDeclaration {"," SubselectIdentificationVariableDeclaration}* - * - * @return \Doctrine\ORM\Query\AST\SubselectFromClause - */ - public function SubselectFromClause() - { - $this->match(Lexer::T_FROM); - - $identificationVariables = array(); - $identificationVariables[] = $this->SubselectIdentificationVariableDeclaration(); - - while ($this->_lexer->isNextToken(Lexer::T_COMMA)) { - $this->match(Lexer::T_COMMA); - - $identificationVariables[] = $this->SubselectIdentificationVariableDeclaration(); - } - - return new AST\SubselectFromClause($identificationVariables); - } - - /** - * WhereClause ::= "WHERE" ConditionalExpression - * - * @return \Doctrine\ORM\Query\AST\WhereClause - */ - public function WhereClause() - { - $this->match(Lexer::T_WHERE); - - return new AST\WhereClause($this->ConditionalExpression()); - } - - /** - * HavingClause ::= "HAVING" ConditionalExpression - * - * @return \Doctrine\ORM\Query\AST\HavingClause - */ - public function HavingClause() - { - $this->match(Lexer::T_HAVING); - - return new AST\HavingClause($this->ConditionalExpression()); - } - - /** - * GroupByClause ::= "GROUP" "BY" GroupByItem {"," GroupByItem}* - * - * @return \Doctrine\ORM\Query\AST\GroupByClause - */ - public function GroupByClause() - { - $this->match(Lexer::T_GROUP); - $this->match(Lexer::T_BY); - - $groupByItems = array($this->GroupByItem()); - - while ($this->_lexer->isNextToken(Lexer::T_COMMA)) { - $this->match(Lexer::T_COMMA); - - $groupByItems[] = $this->GroupByItem(); - } - - return new AST\GroupByClause($groupByItems); - } - - /** - * OrderByClause ::= "ORDER" "BY" OrderByItem {"," OrderByItem}* - * - * @return \Doctrine\ORM\Query\AST\OrderByClause - */ - public function OrderByClause() - { - $this->match(Lexer::T_ORDER); - $this->match(Lexer::T_BY); - - $orderByItems = array(); - $orderByItems[] = $this->OrderByItem(); - - while ($this->_lexer->isNextToken(Lexer::T_COMMA)) { - $this->match(Lexer::T_COMMA); - - $orderByItems[] = $this->OrderByItem(); - } - - return new AST\OrderByClause($orderByItems); - } - - /** - * Subselect ::= SimpleSelectClause SubselectFromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause] - * - * @return \Doctrine\ORM\Query\AST\Subselect - */ - public function Subselect() - { - // Increase query nesting level - $this->_nestingLevel++; - - $subselect = new AST\Subselect($this->SimpleSelectClause(), $this->SubselectFromClause()); - - $subselect->whereClause = $this->_lexer->isNextToken(Lexer::T_WHERE) ? $this->WhereClause() : null; - $subselect->groupByClause = $this->_lexer->isNextToken(Lexer::T_GROUP) ? $this->GroupByClause() : null; - $subselect->havingClause = $this->_lexer->isNextToken(Lexer::T_HAVING) ? $this->HavingClause() : null; - $subselect->orderByClause = $this->_lexer->isNextToken(Lexer::T_ORDER) ? $this->OrderByClause() : null; - - // Decrease query nesting level - $this->_nestingLevel--; - - return $subselect; - } - - /** - * UpdateItem ::= SingleValuedPathExpression "=" NewValue - * - * @return \Doctrine\ORM\Query\AST\UpdateItem - */ - public function UpdateItem() - { - $pathExpr = $this->SingleValuedPathExpression(); - - $this->match(Lexer::T_EQUALS); - - $updateItem = new AST\UpdateItem($pathExpr, $this->NewValue()); - - return $updateItem; - } - - /** - * GroupByItem ::= IdentificationVariable | ResultVariable | SingleValuedPathExpression - * - * @return string | \Doctrine\ORM\Query\AST\PathExpression - */ - public function GroupByItem() - { - // We need to check if we are in a IdentificationVariable or SingleValuedPathExpression - $glimpse = $this->_lexer->glimpse(); - - if ($glimpse['type'] === Lexer::T_DOT) { - return $this->SingleValuedPathExpression(); - } - - // Still need to decide between IdentificationVariable or ResultVariable - $lookaheadValue = $this->_lexer->lookahead['value']; - - if ( ! isset($this->_queryComponents[$lookaheadValue])) { - $this->semanticalError('Cannot group by undefined identification or result variable.'); - } - - return (isset($this->_queryComponents[$lookaheadValue]['metadata'])) - ? $this->IdentificationVariable() - : $this->ResultVariable(); - } - - /** - * OrderByItem ::= (ResultVariable | SingleValuedPathExpression) ["ASC" | "DESC"] - * - * @return \Doctrine\ORM\Query\AST\OrderByItem - */ - public function OrderByItem() - { - $type = 'ASC'; - - // We need to check if we are in a ResultVariable or StateFieldPathExpression - $glimpse = $this->_lexer->glimpse(); - $expr = ($glimpse['type'] != Lexer::T_DOT) ? $this->ResultVariable() : $this->SingleValuedPathExpression(); - - $item = new AST\OrderByItem($expr); - - switch (true) { - case ($this->_lexer->isNextToken(Lexer::T_DESC)): - $this->match(Lexer::T_DESC); - $type = 'DESC'; - break; - - case ($this->_lexer->isNextToken(Lexer::T_ASC)): - $this->match(Lexer::T_ASC); - break; - - default: - // Do nothing - } - - $item->type = $type; - - return $item; - } - - /** - * NewValue ::= SimpleArithmeticExpression | StringPrimary | DatetimePrimary | BooleanPrimary | - * EnumPrimary | SimpleEntityExpression | "NULL" - * - * NOTE: Since it is not possible to correctly recognize individual types, here is the full - * grammar that needs to be supported: - * - * NewValue ::= SimpleArithmeticExpression | "NULL" - * - * SimpleArithmeticExpression covers all *Primary grammar rules and also SimplEntityExpression - */ - public function NewValue() - { - if ($this->_lexer->isNextToken(Lexer::T_NULL)) { - $this->match(Lexer::T_NULL); - - return null; - } - - if ($this->_lexer->isNextToken(Lexer::T_INPUT_PARAMETER)) { - $this->match(Lexer::T_INPUT_PARAMETER); - - return new AST\InputParameter($this->_lexer->token['value']); - } - - return $this->SimpleArithmeticExpression(); - } - - /** - * IdentificationVariableDeclaration ::= RangeVariableDeclaration [IndexBy] {JoinVariableDeclaration}* - * - * @return \Doctrine\ORM\Query\AST\IdentificationVariableDeclaration - */ - public function IdentificationVariableDeclaration() - { - $rangeVariableDeclaration = $this->RangeVariableDeclaration(); - $indexBy = $this->_lexer->isNextToken(Lexer::T_INDEX) ? $this->IndexBy() : null; - $joinVariableDeclarations = array(); - - while ( - $this->_lexer->isNextToken(Lexer::T_LEFT) || - $this->_lexer->isNextToken(Lexer::T_INNER) || - $this->_lexer->isNextToken(Lexer::T_JOIN) - ) { - $joinVariableDeclarations[] = $this->JoinVariableDeclaration(); - } - - return new AST\IdentificationVariableDeclaration( - $rangeVariableDeclaration, $indexBy, $joinVariableDeclarations - ); - } - - /** - * SubselectIdentificationVariableDeclaration ::= IdentificationVariableDeclaration | (AssociationPathExpression ["AS"] AliasIdentificationVariable) - * - * @return \Doctrine\ORM\Query\AST\SubselectIdentificationVariableDeclaration | - * \Doctrine\ORM\Query\AST\IdentificationVariableDeclaration - */ - public function SubselectIdentificationVariableDeclaration() - { - $glimpse = $this->_lexer->glimpse(); - - /* NOT YET IMPLEMENTED! - - if ($glimpse['type'] == Lexer::T_DOT) { - $subselectIdVarDecl = new AST\SubselectIdentificationVariableDeclaration(); - $subselectIdVarDecl->associationPathExpression = $this->AssociationPathExpression(); - $this->match(Lexer::T_AS); - $subselectIdVarDecl->aliasIdentificationVariable = $this->AliasIdentificationVariable(); - - return $subselectIdVarDecl; - } - */ - - return $this->IdentificationVariableDeclaration(); - } - - /** - * JoinVariableDeclaration ::= Join [IndexBy] - * - * @return \Doctrine\ORM\Query\AST\JoinVariableDeclaration - */ - public function JoinVariableDeclaration() - { - $join = $this->Join(); - $indexBy = $this->_lexer->isNextToken(Lexer::T_INDEX) ? $this->IndexBy() : null; - - return new AST\JoinVariableDeclaration($join, $indexBy); - } - - /** - * RangeVariableDeclaration ::= AbstractSchemaName ["AS"] AliasIdentificationVariable - * - * @return \Doctrine\ORM\Query\AST\RangeVariableDeclaration - */ - public function RangeVariableDeclaration() - { - $abstractSchemaName = $this->AbstractSchemaName(); - - if ($this->_lexer->isNextToken(Lexer::T_AS)) { - $this->match(Lexer::T_AS); - } - - $token = $this->_lexer->lookahead; - $aliasIdentificationVariable = $this->AliasIdentificationVariable(); - $classMetadata = $this->_em->getClassMetadata($abstractSchemaName); - - // Building queryComponent - $queryComponent = array( - 'metadata' => $classMetadata, - 'parent' => null, - 'relation' => null, - 'map' => null, - 'nestingLevel' => $this->_nestingLevel, - 'token' => $token - ); - - $this->_queryComponents[$aliasIdentificationVariable] = $queryComponent; - - return new AST\RangeVariableDeclaration($abstractSchemaName, $aliasIdentificationVariable); - } - - /** - * PartialObjectExpression ::= "PARTIAL" IdentificationVariable "." PartialFieldSet - * PartialFieldSet ::= "{" SimpleStateField {"," SimpleStateField}* "}" - * - * @return array - */ - public function PartialObjectExpression() - { - $this->match(Lexer::T_PARTIAL); - - $partialFieldSet = array(); - - $identificationVariable = $this->IdentificationVariable(); - - $this->match(Lexer::T_DOT); - $this->match(Lexer::T_OPEN_CURLY_BRACE); - $this->match(Lexer::T_IDENTIFIER); - - $partialFieldSet[] = $this->_lexer->token['value']; - - while ($this->_lexer->isNextToken(Lexer::T_COMMA)) { - $this->match(Lexer::T_COMMA); - $this->match(Lexer::T_IDENTIFIER); - - $partialFieldSet[] = $this->_lexer->token['value']; - } - - $this->match(Lexer::T_CLOSE_CURLY_BRACE); - - $partialObjectExpression = new AST\PartialObjectExpression($identificationVariable, $partialFieldSet); - - // Defer PartialObjectExpression validation - $this->_deferredPartialObjectExpressions[] = array( - 'expression' => $partialObjectExpression, - 'nestingLevel' => $this->_nestingLevel, - 'token' => $this->_lexer->token, - ); - - return $partialObjectExpression; - } - - /** - * Join ::= ["LEFT" ["OUTER"] | "INNER"] "JOIN" JoinAssociationPathExpression - * ["AS"] AliasIdentificationVariable ["WITH" ConditionalExpression] - * - * @return \Doctrine\ORM\Query\AST\Join - */ - public function Join() - { - // Check Join type - $joinType = AST\Join::JOIN_TYPE_INNER; - - switch (true) { - case ($this->_lexer->isNextToken(Lexer::T_LEFT)): - $this->match(Lexer::T_LEFT); - - $joinType = AST\Join::JOIN_TYPE_LEFT; - - // Possible LEFT OUTER join - if ($this->_lexer->isNextToken(Lexer::T_OUTER)) { - $this->match(Lexer::T_OUTER); - - $joinType = AST\Join::JOIN_TYPE_LEFTOUTER; - } - break; - - case ($this->_lexer->isNextToken(Lexer::T_INNER)): - $this->match(Lexer::T_INNER); - break; - - default: - // Do nothing - } - - $this->match(Lexer::T_JOIN); - - $joinPathExpression = $this->JoinAssociationPathExpression(); - - if ($this->_lexer->isNextToken(Lexer::T_AS)) { - $this->match(Lexer::T_AS); - } - - $token = $this->_lexer->lookahead; - $aliasIdentificationVariable = $this->AliasIdentificationVariable(); - - // Verify that the association exists. - $parentClass = $this->_queryComponents[$joinPathExpression->identificationVariable]['metadata']; - $assocField = $joinPathExpression->associationField; - - if ( ! $parentClass->hasAssociation($assocField)) { - $this->semanticalError( - "Class " . $parentClass->name . " has no association named '$assocField'." - ); - } - - $targetClassName = $parentClass->associationMappings[$assocField]['targetEntity']; - - // Building queryComponent - $joinQueryComponent = array( - 'metadata' => $this->_em->getClassMetadata($targetClassName), - 'parent' => $joinPathExpression->identificationVariable, - 'relation' => $parentClass->getAssociationMapping($assocField), - 'map' => null, - 'nestingLevel' => $this->_nestingLevel, - 'token' => $token - ); - - $this->_queryComponents[$aliasIdentificationVariable] = $joinQueryComponent; - - // Create AST node - $join = new AST\Join($joinType, $joinPathExpression, $aliasIdentificationVariable); - - // Check for ad-hoc Join conditions - if ($this->_lexer->isNextToken(Lexer::T_WITH)) { - $this->match(Lexer::T_WITH); - - $join->conditionalExpression = $this->ConditionalExpression(); - } - - return $join; - } - - /** - * IndexBy ::= "INDEX" "BY" StateFieldPathExpression - * - * @return \Doctrine\ORM\Query\AST\IndexBy - */ - public function IndexBy() - { - $this->match(Lexer::T_INDEX); - $this->match(Lexer::T_BY); - $pathExpr = $this->StateFieldPathExpression(); - - // Add the INDEX BY info to the query component - $this->_queryComponents[$pathExpr->identificationVariable]['map'] = $pathExpr->field; - - return new AST\IndexBy($pathExpr); - } - - /** - * ScalarExpression ::= SimpleArithmeticExpression | StringPrimary | DateTimePrimary | - * StateFieldPathExpression | BooleanPrimary | CaseExpression | - * InstanceOfExpression - * - * @return mixed One of the possible expressions or subexpressions. - */ - public function ScalarExpression() - { - $lookahead = $this->_lexer->lookahead['type']; - - switch ($lookahead) { - case Lexer::T_IDENTIFIER: - $this->_lexer->peek(); // lookahead => '.' - $this->_lexer->peek(); // lookahead => token after '.' - $peek = $this->_lexer->peek(); // lookahead => token after the token after the '.' - $this->_lexer->resetPeek(); - - if ($this->_isMathOperator($peek)) { - return $this->SimpleArithmeticExpression(); - } - - return $this->StateFieldPathExpression(); - - case Lexer::T_INTEGER: - case Lexer::T_FLOAT: - return $this->SimpleArithmeticExpression(); - - case Lexer::T_STRING: - return $this->StringPrimary(); - - case Lexer::T_TRUE: - case Lexer::T_FALSE: - $this->match($lookahead); - - return new AST\Literal(AST\Literal::BOOLEAN, $this->_lexer->token['value']); - - case Lexer::T_INPUT_PARAMETER: - return $this->InputParameter(); - - case Lexer::T_CASE: - case Lexer::T_COALESCE: - case Lexer::T_NULLIF: - // Since NULLIF and COALESCE can be identified as a function, - // we need to check if before check for FunctionDeclaration - return $this->CaseExpression(); - - default: - if ( ! ($this->_isFunction() || $this->_isAggregateFunction($lookahead))) { - $this->syntaxError(); - } - - // We may be in an ArithmeticExpression (find the matching ")" and inspect for Math operator) - $this->_lexer->peek(); // "(" - $peek = $this->_peekBeyondClosingParenthesis(); - - if ($this->_isMathOperator($peek)) { - return $this->SimpleArithmeticExpression(); - } - - if ($this->_isAggregateFunction($this->_lexer->lookahead['type'])) { - return $this->AggregateExpression(); - } - - return $this->FunctionDeclaration(); - } - } - - /** - * CaseExpression ::= GeneralCaseExpression | SimpleCaseExpression | CoalesceExpression | NullifExpression - * GeneralCaseExpression ::= "CASE" WhenClause {WhenClause}* "ELSE" ScalarExpression "END" - * WhenClause ::= "WHEN" ConditionalExpression "THEN" ScalarExpression - * SimpleCaseExpression ::= "CASE" CaseOperand SimpleWhenClause {SimpleWhenClause}* "ELSE" ScalarExpression "END" - * CaseOperand ::= StateFieldPathExpression | TypeDiscriminator - * SimpleWhenClause ::= "WHEN" ScalarExpression "THEN" ScalarExpression - * CoalesceExpression ::= "COALESCE" "(" ScalarExpression {"," ScalarExpression}* ")" - * NullifExpression ::= "NULLIF" "(" ScalarExpression "," ScalarExpression ")" - * - * @return mixed One of the possible expressions or subexpressions. - */ - public function CaseExpression() - { - $lookahead = $this->_lexer->lookahead['type']; - - switch ($lookahead) { - case Lexer::T_NULLIF: - return $this->NullIfExpression(); - - case Lexer::T_COALESCE: - return $this->CoalesceExpression(); - - case Lexer::T_CASE: - $this->_lexer->resetPeek(); - $peek = $this->_lexer->peek(); - - if ($peek['type'] === Lexer::T_WHEN) { - return $this->GeneralCaseExpression(); - } - - return $this->SimpleCaseExpression(); - - default: - // Do nothing - break; - } - - $this->syntaxError(); - } - - /** - * CoalesceExpression ::= "COALESCE" "(" ScalarExpression {"," ScalarExpression}* ")" - * - * @return \Doctrine\ORM\Query\AST\CoalesceExpression - */ - public function CoalesceExpression() - { - $this->match(Lexer::T_COALESCE); - $this->match(Lexer::T_OPEN_PARENTHESIS); - - // Process ScalarExpressions (1..N) - $scalarExpressions = array(); - $scalarExpressions[] = $this->ScalarExpression(); - - while ($this->_lexer->isNextToken(Lexer::T_COMMA)) { - $this->match(Lexer::T_COMMA); - - $scalarExpressions[] = $this->ScalarExpression(); - } - - $this->match(Lexer::T_CLOSE_PARENTHESIS); - - return new AST\CoalesceExpression($scalarExpressions); - } - - /** - * NullIfExpression ::= "NULLIF" "(" ScalarExpression "," ScalarExpression ")" - * - * @return \Doctrine\ORM\Query\AST\NullIfExpression - */ - public function NullIfExpression() - { - $this->match(Lexer::T_NULLIF); - $this->match(Lexer::T_OPEN_PARENTHESIS); - - $firstExpression = $this->ScalarExpression(); - $this->match(Lexer::T_COMMA); - $secondExpression = $this->ScalarExpression(); - - $this->match(Lexer::T_CLOSE_PARENTHESIS); - - return new AST\NullIfExpression($firstExpression, $secondExpression); - } - - /** - * GeneralCaseExpression ::= "CASE" WhenClause {WhenClause}* "ELSE" ScalarExpression "END" - * - * @return \Doctrine\ORM\Query\AST\GeneralExpression - */ - public function GeneralCaseExpression() - { - $this->match(Lexer::T_CASE); - - // Process WhenClause (1..N) - $whenClauses = array(); - - do { - $whenClauses[] = $this->WhenClause(); - } while ($this->_lexer->isNextToken(Lexer::T_WHEN)); - - $this->match(Lexer::T_ELSE); - $scalarExpression = $this->ScalarExpression(); - $this->match(Lexer::T_END); - - return new AST\GeneralCaseExpression($whenClauses, $scalarExpression); - } - - /** - * SimpleCaseExpression ::= "CASE" CaseOperand SimpleWhenClause {SimpleWhenClause}* "ELSE" ScalarExpression "END" - * CaseOperand ::= StateFieldPathExpression | TypeDiscriminator - */ - public function SimpleCaseExpression() - { - $this->match(Lexer::T_CASE); - $caseOperand = $this->StateFieldPathExpression(); - - // Process SimpleWhenClause (1..N) - $simpleWhenClauses = array(); - - do { - $simpleWhenClauses[] = $this->SimpleWhenClause(); - } while ($this->_lexer->isNextToken(Lexer::T_WHEN)); - - $this->match(Lexer::T_ELSE); - $scalarExpression = $this->ScalarExpression(); - $this->match(Lexer::T_END); - - return new AST\SimpleCaseExpression($caseOperand, $simpleWhenClauses, $scalarExpression); - } - - /** - * WhenClause ::= "WHEN" ConditionalExpression "THEN" ScalarExpression - * - * @return \Doctrine\ORM\Query\AST\WhenExpression - */ - public function WhenClause() - { - $this->match(Lexer::T_WHEN); - $conditionalExpression = $this->ConditionalExpression(); - $this->match(Lexer::T_THEN); - - return new AST\WhenClause($conditionalExpression, $this->ScalarExpression()); - } - - /** - * SimpleWhenClause ::= "WHEN" ScalarExpression "THEN" ScalarExpression - * - * @return \Doctrine\ORM\Query\AST\SimpleWhenExpression - */ - public function SimpleWhenClause() - { - $this->match(Lexer::T_WHEN); - $conditionalExpression = $this->ScalarExpression(); - $this->match(Lexer::T_THEN); - - return new AST\SimpleWhenClause($conditionalExpression, $this->ScalarExpression()); - } - - /** - * SelectExpression ::= ( - * IdentificationVariable | ScalarExpression | AggregateExpression | FunctionDeclaration | - * PartialObjectExpression | "(" Subselect ")" | CaseExpression - * ) [["AS"] ["HIDDEN"] AliasResultVariable] - * - * @return \Doctrine\ORM\Query\AST\SelectExpression - */ - public function SelectExpression() - { - $expression = null; - $identVariable = null; - $peek = $this->_lexer->glimpse(); - $lookaheadType = $this->_lexer->lookahead['type']; - - switch (true) { - // ScalarExpression (u.name) - case ($lookaheadType === Lexer::T_IDENTIFIER && $peek['type'] === Lexer::T_DOT): - $expression = $this->ScalarExpression(); - break; - - // IdentificationVariable (u) - case ($lookaheadType === Lexer::T_IDENTIFIER && $peek['type'] !== Lexer::T_OPEN_PARENTHESIS): - $expression = $identVariable = $this->IdentificationVariable(); - break; - - // CaseExpression (CASE ... or NULLIF(...) or COALESCE(...)) - case ($lookaheadType === Lexer::T_CASE): - case ($lookaheadType === Lexer::T_COALESCE): - case ($lookaheadType === Lexer::T_NULLIF): - $expression = $this->CaseExpression(); - break; - - // DQL Function (SUM(u.value) or SUM(u.value) + 1) - case ($this->_isFunction()): - $this->_lexer->peek(); // "(" - - switch (true) { - case ($this->_isMathOperator($this->_peekBeyondClosingParenthesis())): - // SUM(u.id) + COUNT(u.id) - $expression = $this->ScalarExpression(); - break; - - case ($this->_isAggregateFunction($lookaheadType)): - // COUNT(u.id) - $expression = $this->AggregateExpression(); - break; - - default: - // IDENTITY(u) - $expression = $this->FunctionDeclaration(); - break; - } - - break; - - // PartialObjectExpression (PARTIAL u.{id, name}) - case ($lookaheadType === Lexer::T_PARTIAL): - $expression = $this->PartialObjectExpression(); - $identVariable = $expression->identificationVariable; - break; - - // Subselect - case ($lookaheadType === Lexer::T_OPEN_PARENTHESIS && $peek['type'] === Lexer::T_SELECT): - $this->match(Lexer::T_OPEN_PARENTHESIS); - $expression = $this->Subselect(); - $this->match(Lexer::T_CLOSE_PARENTHESIS); - break; - - // Shortcut: ScalarExpression => SimpleArithmeticExpression - case ($lookaheadType === Lexer::T_OPEN_PARENTHESIS): - case ($lookaheadType === Lexer::T_INTEGER): - case ($lookaheadType === Lexer::T_STRING): - case ($lookaheadType === Lexer::T_FLOAT): - // SimpleArithmeticExpression : (- u.value ) or ( + u.value ) - case ($lookaheadType === Lexer::T_MINUS): - case ($lookaheadType === Lexer::T_PLUS): - $expression = $this->SimpleArithmeticExpression(); - break; - - default: - $this->syntaxError( - 'IdentificationVariable | ScalarExpression | AggregateExpression | FunctionDeclaration | PartialObjectExpression | "(" Subselect ")" | CaseExpression', - $this->_lexer->lookahead - ); - } - - // [["AS"] ["HIDDEN"] AliasResultVariable] - - if ($this->_lexer->isNextToken(Lexer::T_AS)) { - $this->match(Lexer::T_AS); - } - - $hiddenAliasResultVariable = false; - - if ($this->_lexer->isNextToken(Lexer::T_HIDDEN)) { - $this->match(Lexer::T_HIDDEN); - - $hiddenAliasResultVariable = true; - } - - $aliasResultVariable = null; - - if ($this->_lexer->isNextToken(Lexer::T_IDENTIFIER)) { - $token = $this->_lexer->lookahead; - $aliasResultVariable = $this->AliasResultVariable(); - - // Include AliasResultVariable in query components. - $this->_queryComponents[$aliasResultVariable] = array( - 'resultVariable' => $expression, - 'nestingLevel' => $this->_nestingLevel, - 'token' => $token, - ); - } - - // AST - - $expr = new AST\SelectExpression($expression, $aliasResultVariable, $hiddenAliasResultVariable); - - if ($identVariable) { - $this->_identVariableExpressions[$identVariable] = $expr; - } - - return $expr; - } - - /** - * SimpleSelectExpression ::= - * StateFieldPathExpression | IdentificationVariable | - * ((AggregateExpression | "(" Subselect ")" | ScalarExpression) [["AS"] AliasResultVariable]) - * - * @return \Doctrine\ORM\Query\AST\SimpleSelectExpression - */ - public function SimpleSelectExpression() - { - $peek = $this->_lexer->glimpse(); - - switch ($this->_lexer->lookahead['type']) { - case Lexer::T_IDENTIFIER: - switch (true) { - case ($peek['type'] === Lexer::T_DOT): - $expression = $this->StateFieldPathExpression(); - - return new AST\SimpleSelectExpression($expression); - - case ($peek['type'] !== Lexer::T_OPEN_PARENTHESIS): - $expression = $this->IdentificationVariable(); - - return new AST\SimpleSelectExpression($expression); - - default: - // Do nothing - } - break; - - case Lexer::T_OPEN_PARENTHESIS: - if ($peek['type'] !== Lexer::T_SELECT) { - // Shortcut: ScalarExpression => SimpleArithmeticExpression - $expression = $this->SimpleArithmeticExpression(); - - return new AST\SimpleSelectExpression($expression); - } - - // Subselect - $this->match(Lexer::T_OPEN_PARENTHESIS); - $expression = $this->Subselect(); - $this->match(Lexer::T_CLOSE_PARENTHESIS); - - return new AST\SimpleSelectExpression($expression); - - default: - // Do nothing - } - - $this->_lexer->peek(); - - $expression = $this->ScalarExpression(); - $expr = new AST\SimpleSelectExpression($expression); - - if ($this->_lexer->isNextToken(Lexer::T_AS)) { - $this->match(Lexer::T_AS); - } - - if ($this->_lexer->isNextToken(Lexer::T_IDENTIFIER)) { - $token = $this->_lexer->lookahead; - $resultVariable = $this->AliasResultVariable(); - $expr->fieldIdentificationVariable = $resultVariable; - - // Include AliasResultVariable in query components. - $this->_queryComponents[$resultVariable] = array( - 'resultvariable' => $expr, - 'nestingLevel' => $this->_nestingLevel, - 'token' => $token, - ); - } - - return $expr; - } - - /** - * ConditionalExpression ::= ConditionalTerm {"OR" ConditionalTerm}* - * - * @return \Doctrine\ORM\Query\AST\ConditionalExpression - */ - public function ConditionalExpression() - { - $conditionalTerms = array(); - $conditionalTerms[] = $this->ConditionalTerm(); - - while ($this->_lexer->isNextToken(Lexer::T_OR)) { - $this->match(Lexer::T_OR); - - $conditionalTerms[] = $this->ConditionalTerm(); - } - - // Phase 1 AST optimization: Prevent AST\ConditionalExpression - // if only one AST\ConditionalTerm is defined - if (count($conditionalTerms) == 1) { - return $conditionalTerms[0]; - } - - return new AST\ConditionalExpression($conditionalTerms); - } - - /** - * ConditionalTerm ::= ConditionalFactor {"AND" ConditionalFactor}* - * - * @return \Doctrine\ORM\Query\AST\ConditionalTerm - */ - public function ConditionalTerm() - { - $conditionalFactors = array(); - $conditionalFactors[] = $this->ConditionalFactor(); - - while ($this->_lexer->isNextToken(Lexer::T_AND)) { - $this->match(Lexer::T_AND); - - $conditionalFactors[] = $this->ConditionalFactor(); - } - - // Phase 1 AST optimization: Prevent AST\ConditionalTerm - // if only one AST\ConditionalFactor is defined - if (count($conditionalFactors) == 1) { - return $conditionalFactors[0]; - } - - return new AST\ConditionalTerm($conditionalFactors); - } - - /** - * ConditionalFactor ::= ["NOT"] ConditionalPrimary - * - * @return \Doctrine\ORM\Query\AST\ConditionalFactor - */ - public function ConditionalFactor() - { - $not = false; - - if ($this->_lexer->isNextToken(Lexer::T_NOT)) { - $this->match(Lexer::T_NOT); - - $not = true; - } - - $conditionalPrimary = $this->ConditionalPrimary(); - - // Phase 1 AST optimization: Prevent AST\ConditionalFactor - // if only one AST\ConditionalPrimary is defined - if ( ! $not) { - return $conditionalPrimary; - } - - $conditionalFactor = new AST\ConditionalFactor($conditionalPrimary); - $conditionalFactor->not = $not; - - return $conditionalFactor; - } - - /** - * ConditionalPrimary ::= SimpleConditionalExpression | "(" ConditionalExpression ")" - * - * @return \Doctrine\ORM\Query\AST\ConditionalPrimary - */ - public function ConditionalPrimary() - { - $condPrimary = new AST\ConditionalPrimary; - - if ( ! $this->_lexer->isNextToken(Lexer::T_OPEN_PARENTHESIS)) { - $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression(); - - return $condPrimary; - } - - // Peek beyond the matching closing paranthesis ')' - $peek = $this->_peekBeyondClosingParenthesis(); - - if (in_array($peek['value'], array("=", "<", "<=", "<>", ">", ">=", "!=")) || - in_array($peek['type'], array(Lexer::T_NOT, Lexer::T_BETWEEN, Lexer::T_LIKE, Lexer::T_IN, Lexer::T_IS, Lexer::T_EXISTS)) || - $this->_isMathOperator($peek)) { - $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression(); - - return $condPrimary; - } - - $this->match(Lexer::T_OPEN_PARENTHESIS); - $condPrimary->conditionalExpression = $this->ConditionalExpression(); - $this->match(Lexer::T_CLOSE_PARENTHESIS); - - return $condPrimary; - } - - /** - * SimpleConditionalExpression ::= - * ComparisonExpression | BetweenExpression | LikeExpression | - * InExpression | NullComparisonExpression | ExistsExpression | - * EmptyCollectionComparisonExpression | CollectionMemberExpression | - * InstanceOfExpression - */ - public function SimpleConditionalExpression() - { - $token = $this->_lexer->lookahead; - - if ($this->_lexer->isNextToken(Lexer::T_NOT)) { - $token = $this->_lexer->glimpse(); - } - - if ($token['type'] === Lexer::T_EXISTS) { - return $this->ExistsExpression(); - } - - $peek = $this->_lexer->glimpse(); - - if ($token['type'] === Lexer::T_IDENTIFIER || $token['type'] === Lexer::T_INPUT_PARAMETER) { - if ($peek['value'] == '(') { - // Peek beyond the matching closing paranthesis ')' - $this->_lexer->peek(); - $token = $this->_peekBeyondClosingParenthesis(); - } else { - // Peek beyond the PathExpression (or InputParameter) - $peek = $this->_lexer->peek(); - - while ($peek['value'] === '.') { - $this->_lexer->peek(); - $peek = $this->_lexer->peek(); - } - - // Also peek beyond a NOT if there is one - if ($peek['type'] === Lexer::T_NOT) { - $peek = $this->_lexer->peek(); - } - - $token = $peek; - - // We need to go even further in case of IS (differenciate between NULL and EMPTY) - $lookahead = $this->_lexer->peek(); - - // Also peek beyond a NOT if there is one - if ($lookahead['type'] === Lexer::T_NOT) { - $lookahead = $this->_lexer->peek(); - } - - $this->_lexer->resetPeek(); - } - } - - switch ($token['type']) { - case Lexer::T_BETWEEN: - return $this->BetweenExpression(); - case Lexer::T_LIKE: - return $this->LikeExpression(); - case Lexer::T_IN: - return $this->InExpression(); - case Lexer::T_INSTANCE: - return $this->InstanceOfExpression(); - case Lexer::T_IS: - if ($lookahead['type'] == Lexer::T_NULL) { - return $this->NullComparisonExpression(); - } - return $this->EmptyCollectionComparisonExpression(); - case Lexer::T_MEMBER: - return $this->CollectionMemberExpression(); - default: - return $this->ComparisonExpression(); - } - } - - /** - * EmptyCollectionComparisonExpression ::= CollectionValuedPathExpression "IS" ["NOT"] "EMPTY" - * - * @return \Doctrine\ORM\Query\AST\EmptyCollectionComparisonExpression - */ - public function EmptyCollectionComparisonExpression() - { - $emptyColletionCompExpr = new AST\EmptyCollectionComparisonExpression( - $this->CollectionValuedPathExpression() - ); - $this->match(Lexer::T_IS); - - if ($this->_lexer->isNextToken(Lexer::T_NOT)) { - $this->match(Lexer::T_NOT); - $emptyColletionCompExpr->not = true; - } - - $this->match(Lexer::T_EMPTY); - - return $emptyColletionCompExpr; - } - - /** - * CollectionMemberExpression ::= EntityExpression ["NOT"] "MEMBER" ["OF"] CollectionValuedPathExpression - * - * EntityExpression ::= SingleValuedAssociationPathExpression | SimpleEntityExpression - * SimpleEntityExpression ::= IdentificationVariable | InputParameter - * - * @return \Doctrine\ORM\Query\AST\CollectionMemberExpression - */ - public function CollectionMemberExpression() - { - $not = false; - $entityExpr = $this->EntityExpression(); - - if ($this->_lexer->isNextToken(Lexer::T_NOT)) { - $this->match(Lexer::T_NOT); - - $not = true; - } - - $this->match(Lexer::T_MEMBER); - - if ($this->_lexer->isNextToken(Lexer::T_OF)) { - $this->match(Lexer::T_OF); - } - - $collMemberExpr = new AST\CollectionMemberExpression( - $entityExpr, $this->CollectionValuedPathExpression() - ); - $collMemberExpr->not = $not; - - return $collMemberExpr; - } - - /** - * Literal ::= string | char | integer | float | boolean - * - * @return string - */ - public function Literal() - { - switch ($this->_lexer->lookahead['type']) { - case Lexer::T_STRING: - $this->match(Lexer::T_STRING); - return new AST\Literal(AST\Literal::STRING, $this->_lexer->token['value']); - - case Lexer::T_INTEGER: - case Lexer::T_FLOAT: - $this->match( - $this->_lexer->isNextToken(Lexer::T_INTEGER) ? Lexer::T_INTEGER : Lexer::T_FLOAT - ); - return new AST\Literal(AST\Literal::NUMERIC, $this->_lexer->token['value']); - - case Lexer::T_TRUE: - case Lexer::T_FALSE: - $this->match( - $this->_lexer->isNextToken(Lexer::T_TRUE) ? Lexer::T_TRUE : Lexer::T_FALSE - ); - return new AST\Literal(AST\Literal::BOOLEAN, $this->_lexer->token['value']); - - default: - $this->syntaxError('Literal'); - } - } - - /** - * InParameter ::= Literal | InputParameter - * - * @return string | \Doctrine\ORM\Query\AST\InputParameter - */ - public function InParameter() - { - if ($this->_lexer->lookahead['type'] == Lexer::T_INPUT_PARAMETER) { - return $this->InputParameter(); - } - - return $this->Literal(); - } - - /** - * InputParameter ::= PositionalParameter | NamedParameter - * - * @return \Doctrine\ORM\Query\AST\InputParameter - */ - public function InputParameter() - { - $this->match(Lexer::T_INPUT_PARAMETER); - - return new AST\InputParameter($this->_lexer->token['value']); - } - - /** - * ArithmeticExpression ::= SimpleArithmeticExpression | "(" Subselect ")" - * - * @return \Doctrine\ORM\Query\AST\ArithmeticExpression - */ - public function ArithmeticExpression() - { - $expr = new AST\ArithmeticExpression; - - if ($this->_lexer->isNextToken(Lexer::T_OPEN_PARENTHESIS)) { - $peek = $this->_lexer->glimpse(); - - if ($peek['type'] === Lexer::T_SELECT) { - $this->match(Lexer::T_OPEN_PARENTHESIS); - $expr->subselect = $this->Subselect(); - $this->match(Lexer::T_CLOSE_PARENTHESIS); - - return $expr; - } - } - - $expr->simpleArithmeticExpression = $this->SimpleArithmeticExpression(); - - return $expr; - } - - /** - * SimpleArithmeticExpression ::= ArithmeticTerm {("+" | "-") ArithmeticTerm}* - * - * @return \Doctrine\ORM\Query\AST\SimpleArithmeticExpression - */ - public function SimpleArithmeticExpression() - { - $terms = array(); - $terms[] = $this->ArithmeticTerm(); - - while (($isPlus = $this->_lexer->isNextToken(Lexer::T_PLUS)) || $this->_lexer->isNextToken(Lexer::T_MINUS)) { - $this->match(($isPlus) ? Lexer::T_PLUS : Lexer::T_MINUS); - - $terms[] = $this->_lexer->token['value']; - $terms[] = $this->ArithmeticTerm(); - } - - // Phase 1 AST optimization: Prevent AST\SimpleArithmeticExpression - // if only one AST\ArithmeticTerm is defined - if (count($terms) == 1) { - return $terms[0]; - } - - return new AST\SimpleArithmeticExpression($terms); - } - - /** - * ArithmeticTerm ::= ArithmeticFactor {("*" | "/") ArithmeticFactor}* - * - * @return \Doctrine\ORM\Query\AST\ArithmeticTerm - */ - public function ArithmeticTerm() - { - $factors = array(); - $factors[] = $this->ArithmeticFactor(); - - while (($isMult = $this->_lexer->isNextToken(Lexer::T_MULTIPLY)) || $this->_lexer->isNextToken(Lexer::T_DIVIDE)) { - $this->match(($isMult) ? Lexer::T_MULTIPLY : Lexer::T_DIVIDE); - - $factors[] = $this->_lexer->token['value']; - $factors[] = $this->ArithmeticFactor(); - } - - // Phase 1 AST optimization: Prevent AST\ArithmeticTerm - // if only one AST\ArithmeticFactor is defined - if (count($factors) == 1) { - return $factors[0]; - } - - return new AST\ArithmeticTerm($factors); - } - - /** - * ArithmeticFactor ::= [("+" | "-")] ArithmeticPrimary - * - * @return \Doctrine\ORM\Query\AST\ArithmeticFactor - */ - public function ArithmeticFactor() - { - $sign = null; - - if (($isPlus = $this->_lexer->isNextToken(Lexer::T_PLUS)) || $this->_lexer->isNextToken(Lexer::T_MINUS)) { - $this->match(($isPlus) ? Lexer::T_PLUS : Lexer::T_MINUS); - $sign = $isPlus; - } - - $primary = $this->ArithmeticPrimary(); - - // Phase 1 AST optimization: Prevent AST\ArithmeticFactor - // if only one AST\ArithmeticPrimary is defined - if ($sign === null) { - return $primary; - } - - return new AST\ArithmeticFactor($primary, $sign); - } - - /** - * ArithmeticPrimary ::= SingleValuedPathExpression | Literal | "(" SimpleArithmeticExpression ")" - * | FunctionsReturningNumerics | AggregateExpression | FunctionsReturningStrings - * | FunctionsReturningDatetime | IdentificationVariable | ResultVariable | CaseExpression - */ - public function ArithmeticPrimary() - { - if ($this->_lexer->isNextToken(Lexer::T_OPEN_PARENTHESIS)) { - $this->match(Lexer::T_OPEN_PARENTHESIS); - $expr = $this->SimpleArithmeticExpression(); - - $this->match(Lexer::T_CLOSE_PARENTHESIS); - - return $expr; - } - - switch ($this->_lexer->lookahead['type']) { - case Lexer::T_COALESCE: - case Lexer::T_NULLIF: - case Lexer::T_CASE: - return $this->CaseExpression(); - - case Lexer::T_IDENTIFIER: - $peek = $this->_lexer->glimpse(); - - if ($peek['value'] == '(') { - return $this->FunctionDeclaration(); - } - - if ($peek['value'] == '.') { - return $this->SingleValuedPathExpression(); - } - - if (isset($this->_queryComponents[$this->_lexer->lookahead['value']]['resultVariable'])) { - return $this->ResultVariable(); - } - - return $this->StateFieldPathExpression(); - - case Lexer::T_INPUT_PARAMETER: - return $this->InputParameter(); - - default: - $peek = $this->_lexer->glimpse(); - - if ($peek['value'] == '(') { - if ($this->_isAggregateFunction($this->_lexer->lookahead['type'])) { - return $this->AggregateExpression(); - } - - return $this->FunctionDeclaration(); - } - - return $this->Literal(); - } - } - - /** - * StringExpression ::= StringPrimary | "(" Subselect ")" - * - * @return \Doctrine\ORM\Query\AST\StringPrimary | - * \Doctrine]ORM\Query\AST\Subselect - */ - public function StringExpression() - { - if ($this->_lexer->isNextToken(Lexer::T_OPEN_PARENTHESIS)) { - $peek = $this->_lexer->glimpse(); - - if ($peek['type'] === Lexer::T_SELECT) { - $this->match(Lexer::T_OPEN_PARENTHESIS); - $expr = $this->Subselect(); - $this->match(Lexer::T_CLOSE_PARENTHESIS); - - return $expr; - } - } - - return $this->StringPrimary(); - } - - /** - * StringPrimary ::= StateFieldPathExpression | string | InputParameter | FunctionsReturningStrings | AggregateExpression | CaseExpression - */ - public function StringPrimary() - { - $lookaheadType = $this->_lexer->lookahead['type']; - - switch ($lookaheadType) { - case Lexer::T_IDENTIFIER: - $peek = $this->_lexer->glimpse(); - - if ($peek['value'] == '.') { - return $this->StateFieldPathExpression(); - } - - if ($peek['value'] == '(') { - // do NOT directly go to FunctionsReturningString() because it doesnt check for custom functions. - return $this->FunctionDeclaration(); - } - - $this->syntaxError("'.' or '('"); - break; - - case Lexer::T_STRING: - $this->match(Lexer::T_STRING); - - return $this->_lexer->token['value']; - - case Lexer::T_INPUT_PARAMETER: - return $this->InputParameter(); - - case Lexer::T_CASE: - case Lexer::T_COALESCE: - case Lexer::T_NULLIF: - return $this->CaseExpression(); - - default: - if ($this->_isAggregateFunction($lookaheadType)) { - return $this->AggregateExpression(); - } - } - - $this->syntaxError( - 'StateFieldPathExpression | string | InputParameter | FunctionsReturningStrings | AggregateExpression' - ); - } - - /** - * EntityExpression ::= SingleValuedAssociationPathExpression | SimpleEntityExpression - * - * @return \Doctrine\ORM\Query\AST\SingleValuedAssociationPathExpression | - * \Doctrine\ORM\Query\AST\SimpleEntityExpression - */ - public function EntityExpression() - { - $glimpse = $this->_lexer->glimpse(); - - if ($this->_lexer->isNextToken(Lexer::T_IDENTIFIER) && $glimpse['value'] === '.') { - return $this->SingleValuedAssociationPathExpression(); - } - - return $this->SimpleEntityExpression(); - } - - /** - * SimpleEntityExpression ::= IdentificationVariable | InputParameter - * - * @return string | \Doctrine\ORM\Query\AST\InputParameter - */ - public function SimpleEntityExpression() - { - if ($this->_lexer->isNextToken(Lexer::T_INPUT_PARAMETER)) { - return $this->InputParameter(); - } - - return $this->StateFieldPathExpression(); - } - - /** - * AggregateExpression ::= - * ("AVG" | "MAX" | "MIN" | "SUM") "(" ["DISTINCT"] StateFieldPathExpression ")" | - * "COUNT" "(" ["DISTINCT"] (IdentificationVariable | SingleValuedPathExpression) ")" - * - * @return \Doctrine\ORM\Query\AST\AggregateExpression - */ - public function AggregateExpression() - { - $lookaheadType = $this->_lexer->lookahead['type']; - $isDistinct = false; - - if ( ! in_array($lookaheadType, array(Lexer::T_COUNT, Lexer::T_AVG, Lexer::T_MAX, Lexer::T_MIN, Lexer::T_SUM))) { - $this->syntaxError('One of: MAX, MIN, AVG, SUM, COUNT'); - } - - $this->match($lookaheadType); - $functionName = $this->_lexer->token['value']; - $this->match(Lexer::T_OPEN_PARENTHESIS); - - if ($this->_lexer->isNextToken(Lexer::T_DISTINCT)) { - $this->match(Lexer::T_DISTINCT); - $isDistinct = true; - } - - $pathExp = ($lookaheadType === Lexer::T_COUNT) - ? $this->SingleValuedPathExpression() - : $this->SimpleArithmeticExpression(); - - $this->match(Lexer::T_CLOSE_PARENTHESIS); - - return new AST\AggregateExpression($functionName, $pathExp, $isDistinct); - } - - /** - * QuantifiedExpression ::= ("ALL" | "ANY" | "SOME") "(" Subselect ")" - * - * @return \Doctrine\ORM\Query\AST\QuantifiedExpression - */ - public function QuantifiedExpression() - { - $lookaheadType = $this->_lexer->lookahead['type']; - $value = $this->_lexer->lookahead['value']; - - if ( ! in_array($lookaheadType, array(Lexer::T_ALL, Lexer::T_ANY, Lexer::T_SOME))) { - $this->syntaxError('ALL, ANY or SOME'); - } - - $this->match($lookaheadType); - $this->match(Lexer::T_OPEN_PARENTHESIS); - - $qExpr = new AST\QuantifiedExpression($this->Subselect()); - $qExpr->type = $value; - - $this->match(Lexer::T_CLOSE_PARENTHESIS); - - return $qExpr; - } - - /** - * BetweenExpression ::= ArithmeticExpression ["NOT"] "BETWEEN" ArithmeticExpression "AND" ArithmeticExpression - * - * @return \Doctrine\ORM\Query\AST\BetweenExpression - */ - public function BetweenExpression() - { - $not = false; - $arithExpr1 = $this->ArithmeticExpression(); - - if ($this->_lexer->isNextToken(Lexer::T_NOT)) { - $this->match(Lexer::T_NOT); - $not = true; - } - - $this->match(Lexer::T_BETWEEN); - $arithExpr2 = $this->ArithmeticExpression(); - $this->match(Lexer::T_AND); - $arithExpr3 = $this->ArithmeticExpression(); - - $betweenExpr = new AST\BetweenExpression($arithExpr1, $arithExpr2, $arithExpr3); - $betweenExpr->not = $not; - - return $betweenExpr; - } - - /** - * ComparisonExpression ::= ArithmeticExpression ComparisonOperator ( QuantifiedExpression | ArithmeticExpression ) - * - * @return \Doctrine\ORM\Query\AST\ComparisonExpression - */ - public function ComparisonExpression() - { - $peek = $this->_lexer->glimpse(); - - $leftExpr = $this->ArithmeticExpression(); - $operator = $this->ComparisonOperator(); - $rightExpr = ($this->_isNextAllAnySome()) - ? $this->QuantifiedExpression() - : $this->ArithmeticExpression(); - - return new AST\ComparisonExpression($leftExpr, $operator, $rightExpr); - } - - /** - * InExpression ::= SingleValuedPathExpression ["NOT"] "IN" "(" (InParameter {"," InParameter}* | Subselect) ")" - * - * @return \Doctrine\ORM\Query\AST\InExpression - */ - public function InExpression() - { - $inExpression = new AST\InExpression($this->ArithmeticExpression()); - - if ($this->_lexer->isNextToken(Lexer::T_NOT)) { - $this->match(Lexer::T_NOT); - $inExpression->not = true; - } - - $this->match(Lexer::T_IN); - $this->match(Lexer::T_OPEN_PARENTHESIS); - - if ($this->_lexer->isNextToken(Lexer::T_SELECT)) { - $inExpression->subselect = $this->Subselect(); - } else { - $literals = array(); - $literals[] = $this->InParameter(); - - while ($this->_lexer->isNextToken(Lexer::T_COMMA)) { - $this->match(Lexer::T_COMMA); - $literals[] = $this->InParameter(); - } - - $inExpression->literals = $literals; - } - - $this->match(Lexer::T_CLOSE_PARENTHESIS); - - return $inExpression; - } - - /** - * InstanceOfExpression ::= IdentificationVariable ["NOT"] "INSTANCE" ["OF"] (InstanceOfParameter | "(" InstanceOfParameter {"," InstanceOfParameter}* ")") - * - * @return \Doctrine\ORM\Query\AST\InstanceOfExpression - */ - public function InstanceOfExpression() - { - $instanceOfExpression = new AST\InstanceOfExpression($this->IdentificationVariable()); - - if ($this->_lexer->isNextToken(Lexer::T_NOT)) { - $this->match(Lexer::T_NOT); - $instanceOfExpression->not = true; - } - - $this->match(Lexer::T_INSTANCE); - $this->match(Lexer::T_OF); - - $exprValues = array(); - - if ($this->_lexer->isNextToken(Lexer::T_OPEN_PARENTHESIS)) { - $this->match(Lexer::T_OPEN_PARENTHESIS); - - $exprValues[] = $this->InstanceOfParameter(); - - while ($this->_lexer->isNextToken(Lexer::T_COMMA)) { - $this->match(Lexer::T_COMMA); - - $exprValues[] = $this->InstanceOfParameter(); - } - - $this->match(Lexer::T_CLOSE_PARENTHESIS); - - $instanceOfExpression->value = $exprValues; - - return $instanceOfExpression; - } - - $exprValues[] = $this->InstanceOfParameter(); - - $instanceOfExpression->value = $exprValues; - - return $instanceOfExpression; - } - - /** - * InstanceOfParameter ::= AbstractSchemaName | InputParameter - * - * @return mixed - */ - public function InstanceOfParameter() - { - if ($this->_lexer->isNextToken(Lexer::T_INPUT_PARAMETER)) { - $this->match(Lexer::T_INPUT_PARAMETER); - - return new AST\InputParameter($this->_lexer->token['value']); - } - - return $this->AliasIdentificationVariable(); - } - - /** - * LikeExpression ::= StringExpression ["NOT"] "LIKE" (string | input_parameter) ["ESCAPE" char] - * - * @return \Doctrine\ORM\Query\AST\LikeExpression - */ - public function LikeExpression() - { - $stringExpr = $this->StringExpression(); - $not = false; - - if ($this->_lexer->isNextToken(Lexer::T_NOT)) { - $this->match(Lexer::T_NOT); - $not = true; - } - - $this->match(Lexer::T_LIKE); - - if ($this->_lexer->isNextToken(Lexer::T_INPUT_PARAMETER)) { - $this->match(Lexer::T_INPUT_PARAMETER); - $stringPattern = new AST\InputParameter($this->_lexer->token['value']); - } else { - $this->match(Lexer::T_STRING); - $stringPattern = $this->_lexer->token['value']; - } - - $escapeChar = null; - - if ($this->_lexer->lookahead['type'] === Lexer::T_ESCAPE) { - $this->match(Lexer::T_ESCAPE); - $this->match(Lexer::T_STRING); - $escapeChar = $this->_lexer->token['value']; - } - - $likeExpr = new AST\LikeExpression($stringExpr, $stringPattern, $escapeChar); - $likeExpr->not = $not; - - return $likeExpr; - } - - /** - * NullComparisonExpression ::= (SingleValuedPathExpression | InputParameter) "IS" ["NOT"] "NULL" - * - * @return \Doctrine\ORM\Query\AST\NullComparisonExpression - */ - public function NullComparisonExpression() - { - if ($this->_lexer->isNextToken(Lexer::T_INPUT_PARAMETER)) { - $this->match(Lexer::T_INPUT_PARAMETER); - $expr = new AST\InputParameter($this->_lexer->token['value']); - } else { - $expr = $this->SingleValuedPathExpression(); - } - - $nullCompExpr = new AST\NullComparisonExpression($expr); - $this->match(Lexer::T_IS); - - if ($this->_lexer->isNextToken(Lexer::T_NOT)) { - $this->match(Lexer::T_NOT); - $nullCompExpr->not = true; - } - - $this->match(Lexer::T_NULL); - - return $nullCompExpr; - } - - /** - * ExistsExpression ::= ["NOT"] "EXISTS" "(" Subselect ")" - * - * @return \Doctrine\ORM\Query\AST\ExistsExpression - */ - public function ExistsExpression() - { - $not = false; - - if ($this->_lexer->isNextToken(Lexer::T_NOT)) { - $this->match(Lexer::T_NOT); - $not = true; - } - - $this->match(Lexer::T_EXISTS); - $this->match(Lexer::T_OPEN_PARENTHESIS); - - $existsExpression = new AST\ExistsExpression($this->Subselect()); - $existsExpression->not = $not; - - $this->match(Lexer::T_CLOSE_PARENTHESIS); - - return $existsExpression; - } - - /** - * ComparisonOperator ::= "=" | "<" | "<=" | "<>" | ">" | ">=" | "!=" - * - * @return string - */ - public function ComparisonOperator() - { - switch ($this->_lexer->lookahead['value']) { - case '=': - $this->match(Lexer::T_EQUALS); - - return '='; - - case '<': - $this->match(Lexer::T_LOWER_THAN); - $operator = '<'; - - if ($this->_lexer->isNextToken(Lexer::T_EQUALS)) { - $this->match(Lexer::T_EQUALS); - $operator .= '='; - } else if ($this->_lexer->isNextToken(Lexer::T_GREATER_THAN)) { - $this->match(Lexer::T_GREATER_THAN); - $operator .= '>'; - } - - return $operator; - - case '>': - $this->match(Lexer::T_GREATER_THAN); - $operator = '>'; - - if ($this->_lexer->isNextToken(Lexer::T_EQUALS)) { - $this->match(Lexer::T_EQUALS); - $operator .= '='; - } - - return $operator; - - case '!': - $this->match(Lexer::T_NEGATE); - $this->match(Lexer::T_EQUALS); - - return '<>'; - - default: - $this->syntaxError('=, <, <=, <>, >, >=, !='); - } - } - - /** - * FunctionDeclaration ::= FunctionsReturningStrings | FunctionsReturningNumerics | FunctionsReturningDatetime - */ - public function FunctionDeclaration() - { - $token = $this->_lexer->lookahead; - $funcName = strtolower($token['value']); - - // Check for built-in functions first! - switch (true) { - case (isset(self::$_STRING_FUNCTIONS[$funcName])): - return $this->FunctionsReturningStrings(); - - case (isset(self::$_NUMERIC_FUNCTIONS[$funcName])): - return $this->FunctionsReturningNumerics(); - - case (isset(self::$_DATETIME_FUNCTIONS[$funcName])): - return $this->FunctionsReturningDatetime(); - - default: - return $this->CustomFunctionDeclaration(); - } - } - - /** - * Helper function for FunctionDeclaration grammar rule - */ - private function CustomFunctionDeclaration() - { - $token = $this->_lexer->lookahead; - $funcName = strtolower($token['value']); - - // Check for custom functions afterwards - $config = $this->_em->getConfiguration(); - - switch (true) { - case ($config->getCustomStringFunction($funcName) !== null): - return $this->CustomFunctionsReturningStrings(); - - case ($config->getCustomNumericFunction($funcName) !== null): - return $this->CustomFunctionsReturningNumerics(); - - case ($config->getCustomDatetimeFunction($funcName) !== null): - return $this->CustomFunctionsReturningDatetime(); - - default: - $this->syntaxError('known function', $token); - } - } - - /** - * FunctionsReturningNumerics ::= - * "LENGTH" "(" StringPrimary ")" | - * "LOCATE" "(" StringPrimary "," StringPrimary ["," SimpleArithmeticExpression]")" | - * "ABS" "(" SimpleArithmeticExpression ")" | - * "SQRT" "(" SimpleArithmeticExpression ")" | - * "MOD" "(" SimpleArithmeticExpression "," SimpleArithmeticExpression ")" | - * "SIZE" "(" CollectionValuedPathExpression ")" - */ - public function FunctionsReturningNumerics() - { - $funcNameLower = strtolower($this->_lexer->lookahead['value']); - $funcClass = self::$_NUMERIC_FUNCTIONS[$funcNameLower]; - - $function = new $funcClass($funcNameLower); - $function->parse($this); - - return $function; - } - - public function CustomFunctionsReturningNumerics() - { - // getCustomNumericFunction is case-insensitive - $funcName = strtolower($this->_lexer->lookahead['value']); - $funcClass = $this->_em->getConfiguration()->getCustomNumericFunction($funcName); - - $function = new $funcClass($funcName); - $function->parse($this); - - return $function; - } - - /** - * FunctionsReturningDateTime ::= "CURRENT_DATE" | "CURRENT_TIME" | "CURRENT_TIMESTAMP" - */ - public function FunctionsReturningDatetime() - { - $funcNameLower = strtolower($this->_lexer->lookahead['value']); - $funcClass = self::$_DATETIME_FUNCTIONS[$funcNameLower]; - - $function = new $funcClass($funcNameLower); - $function->parse($this); - - return $function; - } - - public function CustomFunctionsReturningDatetime() - { - // getCustomDatetimeFunction is case-insensitive - $funcName = $this->_lexer->lookahead['value']; - $funcClass = $this->_em->getConfiguration()->getCustomDatetimeFunction($funcName); - - $function = new $funcClass($funcName); - $function->parse($this); - - return $function; - } - - /** - * FunctionsReturningStrings ::= - * "CONCAT" "(" StringPrimary "," StringPrimary ")" | - * "SUBSTRING" "(" StringPrimary "," SimpleArithmeticExpression "," SimpleArithmeticExpression ")" | - * "TRIM" "(" [["LEADING" | "TRAILING" | "BOTH"] [char] "FROM"] StringPrimary ")" | - * "LOWER" "(" StringPrimary ")" | - * "UPPER" "(" StringPrimary ")" - */ - public function FunctionsReturningStrings() - { - $funcNameLower = strtolower($this->_lexer->lookahead['value']); - $funcClass = self::$_STRING_FUNCTIONS[$funcNameLower]; - - $function = new $funcClass($funcNameLower); - $function->parse($this); - - return $function; - } - - public function CustomFunctionsReturningStrings() - { - // getCustomStringFunction is case-insensitive - $funcName = $this->_lexer->lookahead['value']; - $funcClass = $this->_em->getConfiguration()->getCustomStringFunction($funcName); - - $function = new $funcClass($funcName); - $function->parse($this); - - return $function; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/ParserResult.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/ParserResult.php deleted file mode 100644 index 3e938a9..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/ParserResult.php +++ /dev/null @@ -1,141 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query; - -/** - * Encapsulates the resulting components from a DQL query parsing process that - * can be serialized. - * - * @author Guilherme Blanco - * @author Janne Vanhala - * @author Roman Borschel - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link http://www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - */ -class ParserResult -{ - /** - * The SQL executor used for executing the SQL. - * - * @var \Doctrine\ORM\Query\Exec\AbstractSqlExecutor - */ - private $_sqlExecutor; - - /** - * The ResultSetMapping that describes how to map the SQL result set. - * - * @var \Doctrine\ORM\Query\ResultSetMapping - */ - private $_resultSetMapping; - - /** - * The mappings of DQL parameter names/positions to SQL parameter positions. - * - * @var array - */ - private $_parameterMappings = array(); - - /** - * Initializes a new instance of the ParserResult class. - * The new instance is initialized with an empty ResultSetMapping. - */ - public function __construct() - { - $this->_resultSetMapping = new ResultSetMapping; - } - - /** - * Gets the ResultSetMapping for the parsed query. - * - * @return ResultSetMapping The result set mapping of the parsed query or NULL - * if the query is not a SELECT query. - */ - public function getResultSetMapping() - { - return $this->_resultSetMapping; - } - - /** - * Sets the ResultSetMapping of the parsed query. - * - * @param ResultSetMapping $rsm - */ - public function setResultSetMapping(ResultSetMapping $rsm) - { - $this->_resultSetMapping = $rsm; - } - - /** - * Sets the SQL executor that should be used for this ParserResult. - * - * @param \Doctrine\ORM\Query\Exec\AbstractSqlExecutor $executor - */ - public function setSqlExecutor($executor) - { - $this->_sqlExecutor = $executor; - } - - /** - * Gets the SQL executor used by this ParserResult. - * - * @return \Doctrine\ORM\Query\Exec\AbstractSqlExecutor - */ - public function getSqlExecutor() - { - return $this->_sqlExecutor; - } - - /** - * Adds a DQL to SQL parameter mapping. One DQL parameter name/position can map to - * several SQL parameter positions. - * - * @param string|integer $dqlPosition - * @param integer $sqlPosition - */ - public function addParameterMapping($dqlPosition, $sqlPosition) - { - $this->_parameterMappings[$dqlPosition][] = $sqlPosition; - } - - /** - * Gets all DQL to SQL parameter mappings. - * - * @return array The parameter mappings. - */ - public function getParameterMappings() - { - return $this->_parameterMappings; - } - - /** - * Gets the SQL parameter positions for a DQL parameter name/position. - * - * @param string|integer $dqlPosition The name or position of the DQL parameter. - * @return array The positions of the corresponding SQL parameters. - */ - public function getSqlParameterPositions($dqlPosition) - { - return $this->_parameterMappings[$dqlPosition]; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Printer.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Printer.php deleted file mode 100644 index 972ad51..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Printer.php +++ /dev/null @@ -1,95 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query; - -/** - * A parse tree printer for Doctrine Query Language parser. - * - * @author Janne Vanhala - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link http://www.phpdoctrine.org - * @since 2.0 - * @version $Revision$ - */ -class Printer -{ - /** - * Current indentation level - * - * @var int - */ - protected $_indent = 0; - - /** - * Defines whether parse tree is printed (default, false) or not (true). - * - * @var bool - */ - protected $_silent; - - /** - * Constructs a new parse tree printer. - * - * @param bool $silent Parse tree will not be printed if true. - */ - public function __construct($silent = false) - { - $this->_silent = $silent; - } - - /** - * Prints an opening parenthesis followed by production name and increases - * indentation level by one. - * - * This method is called before executing a production. - * - * @param string $name production name - */ - public function startProduction($name) - { - $this->println('(' . $name); - $this->_indent++; - } - - /** - * Decreases indentation level by one and prints a closing parenthesis. - * - * This method is called after executing a production. - */ - public function endProduction() - { - $this->_indent--; - $this->println(')'); - } - - /** - * Prints text indented with spaces depending on current indentation level. - * - * @param string $str text - */ - public function println($str) - { - if ( ! $this->_silent) { - echo str_repeat(' ', $this->_indent), $str, "\n"; - } - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php deleted file mode 100644 index 41bfd34..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php +++ /dev/null @@ -1,154 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query; - -use Doctrine\ORM\Query\AST\PathExpression; - -/** - * Description of QueryException - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision: 3938 $ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class QueryException extends \Doctrine\ORM\ORMException -{ - public static function syntaxError($message) - { - return new self('[Syntax Error] ' . $message); - } - - public static function semanticalError($message) - { - return new self('[Semantical Error] ' . $message); - } - - public static function invalidLockMode() - { - return new self('Invalid lock mode hint provided.'); - } - - public static function invalidParameterType($expected, $received) - { - return new self('Invalid parameter type, ' . $received . ' given, but ' . $expected . ' expected.'); - } - - public static function invalidParameterPosition($pos) - { - return new self('Invalid parameter position: ' . $pos); - } - - public static function invalidParameterNumber() - { - return new self("Invalid parameter number: number of bound variables does not match number of tokens"); - } - - public static function invalidParameterFormat($value) - { - return new self('Invalid parameter format, '.$value.' given, but : or ? expected.'); - } - - public static function unknownParameter($key) - { - return new self("Invalid parameter: token ".$key." is not defined in the query."); - } - - public static function parameterTypeMissmatch() - { - return new self("DQL Query parameter and type numbers missmatch, but have to be exactly equal."); - } - - public static function invalidPathExpression($pathExpr) - { - return new self( - "Invalid PathExpression '" . $pathExpr->identificationVariable . "." . $pathExpr->field . "'." - ); - } - - public static function invalidLiteral($literal) { - return new self("Invalid literal '$literal'"); - } - - /** - * @param array $assoc - */ - public static function iterateWithFetchJoinCollectionNotAllowed($assoc) - { - return new self( - "Invalid query operation: Not allowed to iterate over fetch join collections ". - "in class ".$assoc['sourceEntity']." assocation ".$assoc['fieldName'] - ); - } - - public static function partialObjectsAreDangerous() - { - return new self( - "Loading partial objects is dangerous. Fetch full objects or consider " . - "using a different fetch mode. If you really want partial objects, " . - "set the doctrine.forcePartialLoad query hint to TRUE." - ); - } - - public static function overwritingJoinConditionsNotYetSupported($assoc) - { - return new self( - "Unsupported query operation: It is not yet possible to overwrite the join ". - "conditions in class ".$assoc['sourceEntityName']." assocation ".$assoc['fieldName'].". ". - "Use WITH to append additional join conditions to the association." - ); - } - - public static function associationPathInverseSideNotSupported() - { - return new self( - "A single-valued association path expression to an inverse side is not supported". - " in DQL queries. Use an explicit join instead." - ); - } - - public static function iterateWithFetchJoinNotAllowed($assoc) { - return new self( - "Iterate with fetch join in class " . $assoc['sourceEntity'] . - " using association " . $assoc['fieldName'] . " not allowed." - ); - } - - public static function associationPathCompositeKeyNotSupported() - { - return new self( - "A single-valued association path expression to an entity with a composite primary ". - "key is not supported. Explicitly name the components of the composite primary key ". - "in the query." - ); - } - - public static function instanceOfUnrelatedClass($className, $rootClass) - { - return new self("Cannot check if a child of '" . $rootClass . "' is instanceof '" . $className . "', " . - "inheritance hierachy exists between these two classes."); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/ResultSetMapping.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/ResultSetMapping.php deleted file mode 100644 index 32aa298..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/ResultSetMapping.php +++ /dev/null @@ -1,485 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query; - -/** - * A ResultSetMapping describes how a result set of an SQL query maps to a Doctrine result. - * - * IMPORTANT NOTE: - * The properties of this class are only public for fast internal READ access and to (drastically) - * reduce the size of serialized instances for more effective caching due to better (un-)serialization - * performance. - * - * Users should use the public methods. - * - * @author Roman Borschel - * @since 2.0 - * @todo Think about whether the number of lookup maps can be reduced. - */ -class ResultSetMapping -{ - /** - * @ignore - * @var boolean Whether the result is mixed (contains scalar values together with field values). - */ - public $isMixed = false; - - /** - * @ignore - * @var array Maps alias names to class names. - */ - public $aliasMap = array(); - - /** - * @ignore - * @var array Maps alias names to related association field names. - */ - public $relationMap = array(); - - /** - * @ignore - * @var array Maps alias names to parent alias names. - */ - public $parentAliasMap = array(); - - /** - * @ignore - * @var array Maps column names in the result set to field names for each class. - */ - public $fieldMappings = array(); - - /** - * @ignore - * @var array Maps column names in the result set to the alias/field name to use in the mapped result. - */ - public $scalarMappings = array(); - - /** - * @ignore - * @var array Maps column names in the result set to the alias/field type to use in the mapped result. - */ - public $typeMappings = array(); - - /** - * @ignore - * @var array Maps entities in the result set to the alias name to use in the mapped result. - */ - public $entityMappings = array(); - - /** - * @ignore - * @var array Maps column names of meta columns (foreign keys, discriminator columns, ...) to field names. - */ - public $metaMappings = array(); - - /** - * @ignore - * @var array Maps column names in the result set to the alias they belong to. - */ - public $columnOwnerMap = array(); - - /** - * @ignore - * @var array List of columns in the result set that are used as discriminator columns. - */ - public $discriminatorColumns = array(); - - /** - * @ignore - * @var array Maps alias names to field names that should be used for indexing. - */ - public $indexByMap = array(); - - /** - * @ignore - * @var array Map from column names to class names that declare the field the column is mapped to. - */ - public $declaringClasses = array(); - - /** - * @var array This is necessary to hydrate derivate foreign keys correctly. - */ - public $isIdentifierColumn = array(); - - /** - * Adds an entity result to this ResultSetMapping. - * - * @param string $class The class name of the entity. - * @param string $alias The alias for the class. The alias must be unique among all entity - * results or joined entity results within this ResultSetMapping. - * @param string $resultAlias The result alias with which the entity result should be - * placed in the result structure. - * @return ResultSetMapping This ResultSetMapping instance. - * @todo Rename: addRootEntity - */ - public function addEntityResult($class, $alias, $resultAlias = null) - { - $this->aliasMap[$alias] = $class; - $this->entityMappings[$alias] = $resultAlias; - - if ($resultAlias !== null) { - $this->isMixed = true; - } - - return $this; - } - - /** - * Sets a discriminator column for an entity result or joined entity result. - * The discriminator column will be used to determine the concrete class name to - * instantiate. - * - * @param string $alias The alias of the entity result or joined entity result the discriminator - * column should be used for. - * @param string $discrColumn The name of the discriminator column in the SQL result set. - * @return ResultSetMapping This ResultSetMapping instance. - * @todo Rename: addDiscriminatorColumn - */ - public function setDiscriminatorColumn($alias, $discrColumn) - { - $this->discriminatorColumns[$alias] = $discrColumn; - $this->columnOwnerMap[$discrColumn] = $alias; - - return $this; - } - - /** - * Sets a field to use for indexing an entity result or joined entity result. - * - * @param string $alias The alias of an entity result or joined entity result. - * @param string $fieldName The name of the field to use for indexing. - * @return ResultSetMapping This ResultSetMapping instance. - */ - public function addIndexBy($alias, $fieldName) - { - $found = false; - - foreach ($this->fieldMappings AS $columnName => $columnFieldName) { - if ( ! ($columnFieldName === $fieldName && $this->columnOwnerMap[$columnName] === $alias)) continue; - - $this->addIndexByColumn($alias, $columnName); - $found = true; - - break; - } - - /* TODO: check if this exception can be put back, for now it's gone because of assumptions made by some ORM internals - if ( ! $found) { - $message = sprintf( - 'Cannot add index by for DQL alias %s and field %s without calling addFieldResult() for them before.', - $alias, - $fieldName - ); - - throw new \LogicException($message); - } - */ - - return $this; - } - - /** - * Set to index by a scalar result column name - * - * @param $resultColumnName - * @return ResultSetMapping This ResultSetMapping instance. - */ - public function addIndexByScalar($resultColumnName) - { - $this->indexByMap['scalars'] = $resultColumnName; - - return $this; - } - - /** - * Sets a column to use for indexing an entity or joined entity result by the given alias name. - * - * @param $alias - * @param $resultColumnName - * @return ResultSetMapping This ResultSetMapping instance. - */ - public function addIndexByColumn($alias, $resultColumnName) - { - $this->indexByMap[$alias] = $resultColumnName; - - return $this; - } - - /** - * Checks whether an entity result or joined entity result with a given alias has - * a field set for indexing. - * - * @param string $alias - * @return boolean - * @todo Rename: isIndexed($alias) - */ - public function hasIndexBy($alias) - { - return isset($this->indexByMap[$alias]); - } - - /** - * Checks whether the column with the given name is mapped as a field result - * as part of an entity result or joined entity result. - * - * @param string $columnName The name of the column in the SQL result set. - * @return boolean - * @todo Rename: isField - */ - public function isFieldResult($columnName) - { - return isset($this->fieldMappings[$columnName]); - } - - /** - * Adds a field to the result that belongs to an entity or joined entity. - * - * @param string $alias The alias of the root entity or joined entity to which the field belongs. - * @param string $columnName The name of the column in the SQL result set. - * @param string $fieldName The name of the field on the declaring class. - * @param string $declaringClass The name of the class that declares/owns the specified field. - * When $alias refers to a superclass in a mapped hierarchy but - * the field $fieldName is defined on a subclass, specify that here. - * If not specified, the field is assumed to belong to the class - * designated by $alias. - * @return ResultSetMapping This ResultSetMapping instance. - * @todo Rename: addField - */ - public function addFieldResult($alias, $columnName, $fieldName, $declaringClass = null) - { - // column name (in result set) => field name - $this->fieldMappings[$columnName] = $fieldName; - // column name => alias of owner - $this->columnOwnerMap[$columnName] = $alias; - // field name => class name of declaring class - $this->declaringClasses[$columnName] = $declaringClass ?: $this->aliasMap[$alias]; - - if ( ! $this->isMixed && $this->scalarMappings) { - $this->isMixed = true; - } - - return $this; - } - - /** - * Adds a joined entity result. - * - * @param string $class The class name of the joined entity. - * @param string $alias The unique alias to use for the joined entity. - * @param string $parentAlias The alias of the entity result that is the parent of this joined result. - * @param object $relation The association field that connects the parent entity result with the joined entity result. - * @return ResultSetMapping This ResultSetMapping instance. - * @todo Rename: addJoinedEntity - */ - public function addJoinedEntityResult($class, $alias, $parentAlias, $relation) - { - $this->aliasMap[$alias] = $class; - $this->parentAliasMap[$alias] = $parentAlias; - $this->relationMap[$alias] = $relation; - - return $this; - } - - /** - * Adds a scalar result mapping. - * - * @param string $columnName The name of the column in the SQL result set. - * @param string $alias The result alias with which the scalar result should be placed in the result structure. - * @param string $type The column type - * - * @return ResultSetMapping This ResultSetMapping instance. - * - * @todo Rename: addScalar - */ - public function addScalarResult($columnName, $alias, $type = null) - { - $this->scalarMappings[$columnName] = $alias; - $this->typeMappings[$columnName] = $type ?: 'string'; - - if ( ! $this->isMixed && $this->fieldMappings) { - $this->isMixed = true; - } - - return $this; - } - - /** - * Checks whether a column with a given name is mapped as a scalar result. - * - * @param string $columName The name of the column in the SQL result set. - * @return boolean - * @todo Rename: isScalar - */ - public function isScalarResult($columnName) - { - return isset($this->scalarMappings[$columnName]); - } - - /** - * Gets the name of the class of an entity result or joined entity result, - * identified by the given unique alias. - * - * @param string $alias - * @return string - */ - public function getClassName($alias) - { - return $this->aliasMap[$alias]; - } - - /** - * Gets the field alias for a column that is mapped as a scalar value. - * - * @param string $columnName The name of the column in the SQL result set. - * @return string - */ - public function getScalarAlias($columnName) - { - return $this->scalarMappings[$columnName]; - } - - /** - * Gets the name of the class that owns a field mapping for the specified column. - * - * @param string $columnName - * @return string - */ - public function getDeclaringClass($columnName) - { - return $this->declaringClasses[$columnName]; - } - - /** - * - * @param string $alias - * @return AssociationMapping - */ - public function getRelation($alias) - { - return $this->relationMap[$alias]; - } - - /** - * - * @param string $alias - * @return boolean - */ - public function isRelation($alias) - { - return isset($this->relationMap[$alias]); - } - - /** - * Gets the alias of the class that owns a field mapping for the specified column. - * - * @param string $columnName - * @return string - */ - public function getEntityAlias($columnName) - { - return $this->columnOwnerMap[$columnName]; - } - - /** - * Gets the parent alias of the given alias. - * - * @param string $alias - * @return string - */ - public function getParentAlias($alias) - { - return $this->parentAliasMap[$alias]; - } - - /** - * Checks whether the given alias has a parent alias. - * - * @param string $alias - * @return boolean - */ - public function hasParentAlias($alias) - { - return isset($this->parentAliasMap[$alias]); - } - - /** - * Gets the field name for a column name. - * - * @param string $columnName - * @return string - */ - public function getFieldName($columnName) - { - return $this->fieldMappings[$columnName]; - } - - /** - * - * @return array - */ - public function getAliasMap() - { - return $this->aliasMap; - } - - /** - * Gets the number of different entities that appear in the mapped result. - * - * @return integer - */ - public function getEntityResultCount() - { - return count($this->aliasMap); - } - - /** - * Checks whether this ResultSetMapping defines a mixed result. - * Mixed results can only occur in object and array (graph) hydration. In such a - * case a mixed result means that scalar values are mixed with objects/array in - * the result. - * - * @return boolean - */ - public function isMixedResult() - { - return $this->isMixed; - } - - /** - * Adds a meta column (foreign key or discriminator column) to the result set. - * - * @param string $alias - * @param string $columnName - * @param string $fieldName - * @param bool - * @return ResultSetMapping This ResultSetMapping instance. - */ - public function addMetaResult($alias, $columnName, $fieldName, $isIdentifierColumn = false) - { - $this->metaMappings[$columnName] = $fieldName; - $this->columnOwnerMap[$columnName] = $alias; - - if ($isIdentifierColumn) { - $this->isIdentifierColumn[$alias][$columnName] = true; - } - - return $this; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php deleted file mode 100644 index f84686a..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php +++ /dev/null @@ -1,109 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query; - -use Doctrine\ORM\EntityManager; -use Doctrine\ORM\Mapping\ClassMetadataInfo; - -/** - * A ResultSetMappingBuilder uses the EntityManager to automatically populate entity fields - * - * @author Michael Ridgway - * @since 2.1 - */ -class ResultSetMappingBuilder extends ResultSetMapping -{ - /** - * @var EntityManager - */ - private $em; - - /** - * @param EntityManager - */ - public function __construct(EntityManager $em) - { - $this->em = $em; - } - - /** - * Adds a root entity and all of its fields to the result set. - * - * @param string $class The class name of the root entity. - * @param string $alias The unique alias to use for the root entity. - * @param array $renamedColumns Columns that have been renamed (tableColumnName => queryColumnName) - */ - public function addRootEntityFromClassMetadata($class, $alias, $renamedColumns = array()) - { - $this->addEntityResult($class, $alias); - $this->addAllClassFields($class, $alias, $renamedColumns); - } - - /** - * Adds a joined entity and all of its fields to the result set. - * - * @param string $class The class name of the joined entity. - * @param string $alias The unique alias to use for the joined entity. - * @param string $parentAlias The alias of the entity result that is the parent of this joined result. - * @param object $relation The association field that connects the parent entity result with the joined entity result. - * @param array $renamedColumns Columns that have been renamed (tableColumnName => queryColumnName) - */ - public function addJoinedEntityFromClassMetadata($class, $alias, $parentAlias, $relation, $renamedColumns = array()) - { - $this->addJoinedEntityResult($class, $alias, $parentAlias, $relation); - $this->addAllClassFields($class, $alias, $renamedColumns); - } - - /** - * Adds all fields of the given class to the result set mapping (columns and meta fields) - */ - protected function addAllClassFields($class, $alias, $renamedColumns = array()) - { - $classMetadata = $this->em->getClassMetadata($class); - if ($classMetadata->isInheritanceTypeSingleTable() || $classMetadata->isInheritanceTypeJoined()) { - throw new \InvalidArgumentException('ResultSetMapping builder does not currently support inheritance.'); - } - $platform = $this->em->getConnection()->getDatabasePlatform(); - foreach ($classMetadata->getColumnNames() AS $columnName) { - $propertyName = $classMetadata->getFieldName($columnName); - if (isset($renamedColumns[$columnName])) { - $columnName = $renamedColumns[$columnName]; - } - $columnName = $platform->getSQLResultCasing($columnName); - if (isset($this->fieldMappings[$columnName])) { - throw new \InvalidArgumentException("The column '$columnName' conflicts with another column in the mapper."); - } - $this->addFieldResult($alias, $columnName, $propertyName); - } - foreach ($classMetadata->associationMappings AS $associationMapping) { - if ($associationMapping['isOwningSide'] && $associationMapping['type'] & ClassMetadataInfo::TO_ONE) { - foreach ($associationMapping['joinColumns'] AS $joinColumn) { - $columnName = $joinColumn['name']; - $renamedColumnName = isset($renamedColumns[$columnName]) ? $renamedColumns[$columnName] : $columnName; - $renamedColumnName = $platform->getSQLResultCasing($renamedColumnName); - if (isset($this->metaMappings[$renamedColumnName])) { - throw new \InvalidArgumentException("The column '$renamedColumnName' conflicts with another column in the mapper."); - } - $this->addMetaResult($alias, $renamedColumnName, $columnName); - } - } - } - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/SqlWalker.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/SqlWalker.php deleted file mode 100644 index d883aea..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/SqlWalker.php +++ /dev/null @@ -1,2159 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query; - -use Doctrine\DBAL\LockMode, - Doctrine\DBAL\Types\Type, - Doctrine\ORM\Mapping\ClassMetadata, - Doctrine\ORM\Query, - Doctrine\ORM\Query\QueryException, - Doctrine\ORM\Mapping\ClassMetadataInfo; - -/** - * The SqlWalker is a TreeWalker that walks over a DQL AST and constructs - * the corresponding SQL. - * - * @author Guilherme Blanco - * @author Roman Borschel - * @author Benjamin Eberlei - * @author Alexander - * @since 2.0 - * @todo Rename: SQLWalker - */ -class SqlWalker implements TreeWalker -{ - /** - * @var string - */ - const HINT_DISTINCT = 'doctrine.distinct'; - - /** - * @var ResultSetMapping - */ - private $_rsm; - - /** Counters for generating unique column aliases, table aliases and parameter indexes. */ - private $_aliasCounter = 0; - private $_tableAliasCounter = 0; - private $_scalarResultCounter = 1; - private $_sqlParamIndex = 0; - - /** - * @var ParserResult - */ - private $_parserResult; - - /** - * @var EntityManager - */ - private $_em; - - /** - * @var \Doctrine\DBAL\Connection - */ - private $_conn; - - /** - * @var AbstractQuery - */ - private $_query; - - private $_tableAliasMap = array(); - - /** Map from result variable names to their SQL column alias names. */ - private $_scalarResultAliasMap = array(); - - /** - * Map from DQL-Alias + Field-Name to SQL Column Alias - * - * @var array - */ - private $_scalarFields = array(); - - /** Map of all components/classes that appear in the DQL query. */ - private $_queryComponents; - - /** A list of classes that appear in non-scalar SelectExpressions. */ - private $_selectedClasses = array(); - - /** - * The DQL alias of the root class of the currently traversed query. - */ - private $_rootAliases = array(); - - /** - * Flag that indicates whether to generate SQL table aliases in the SQL. - * These should only be generated for SELECT queries, not for UPDATE/DELETE. - */ - private $_useSqlTableAliases = true; - - /** - * The database platform abstraction. - * - * @var AbstractPlatform - */ - private $_platform; - - /** - * {@inheritDoc} - */ - public function __construct($query, $parserResult, array $queryComponents) - { - $this->_query = $query; - $this->_parserResult = $parserResult; - $this->_queryComponents = $queryComponents; - $this->_rsm = $parserResult->getResultSetMapping(); - $this->_em = $query->getEntityManager(); - $this->_conn = $this->_em->getConnection(); - $this->_platform = $this->_conn->getDatabasePlatform(); - } - - /** - * Gets the Query instance used by the walker. - * - * @return Query. - */ - public function getQuery() - { - return $this->_query; - } - - /** - * Gets the Connection used by the walker. - * - * @return Connection - */ - public function getConnection() - { - return $this->_conn; - } - - /** - * Gets the EntityManager used by the walker. - * - * @return EntityManager - */ - public function getEntityManager() - { - return $this->_em; - } - - /** - * Gets the information about a single query component. - * - * @param string $dqlAlias The DQL alias. - * @return array - */ - public function getQueryComponent($dqlAlias) - { - return $this->_queryComponents[$dqlAlias]; - } - - /** - * Gets an executor that can be used to execute the result of this walker. - * - * @return AbstractExecutor - */ - public function getExecutor($AST) - { - switch (true) { - case ($AST instanceof AST\DeleteStatement): - $primaryClass = $this->_em->getClassMetadata($AST->deleteClause->abstractSchemaName); - - return ($primaryClass->isInheritanceTypeJoined()) - ? new Exec\MultiTableDeleteExecutor($AST, $this) - : new Exec\SingleTableDeleteUpdateExecutor($AST, $this); - - case ($AST instanceof AST\UpdateStatement): - $primaryClass = $this->_em->getClassMetadata($AST->updateClause->abstractSchemaName); - - return ($primaryClass->isInheritanceTypeJoined()) - ? new Exec\MultiTableUpdateExecutor($AST, $this) - : new Exec\SingleTableDeleteUpdateExecutor($AST, $this); - - default: - return new Exec\SingleSelectExecutor($AST, $this); - } - } - - /** - * Generates a unique, short SQL table alias. - * - * @param string $tableName Table name - * @param string $dqlAlias The DQL alias. - * @return string Generated table alias. - */ - public function getSQLTableAlias($tableName, $dqlAlias = '') - { - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; - - if ( ! isset($this->_tableAliasMap[$tableName])) { - $this->_tableAliasMap[$tableName] = strtolower(substr($tableName, 0, 1)) . $this->_tableAliasCounter++ . '_'; - } - - return $this->_tableAliasMap[$tableName]; - } - - /** - * Forces the SqlWalker to use a specific alias for a table name, rather than - * generating an alias on its own. - * - * @param string $tableName - * @param string $alias - * @param string $dqlAlias - * @return string - */ - public function setSQLTableAlias($tableName, $alias, $dqlAlias = '') - { - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; - - $this->_tableAliasMap[$tableName] = $alias; - - return $alias; - } - - /** - * Gets an SQL column alias for a column name. - * - * @param string $columnName - * @return string - */ - public function getSQLColumnAlias($columnName) - { - // Trim the column alias to the maximum identifier length of the platform. - // If the alias is to long, characters are cut off from the beginning. - return $this->_platform->getSQLResultCasing( - substr($columnName . $this->_aliasCounter++, -$this->_platform->getMaxIdentifierLength()) - ); - } - - /** - * Generates the SQL JOINs that are necessary for Class Table Inheritance - * for the given class. - * - * @param ClassMetadata $class The class for which to generate the joins. - * @param string $dqlAlias The DQL alias of the class. - * @return string The SQL. - */ - private function _generateClassTableInheritanceJoins($class, $dqlAlias) - { - $sql = ''; - - $baseTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); - - // INNER JOIN parent class tables - foreach ($class->parentClasses as $parentClassName) { - $parentClass = $this->_em->getClassMetadata($parentClassName); - $tableAlias = $this->getSQLTableAlias($parentClass->getTableName(), $dqlAlias); - - // If this is a joined association we must use left joins to preserve the correct result. - $sql .= isset($this->_queryComponents[$dqlAlias]['relation']) ? ' LEFT ' : ' INNER '; - $sql .= 'JOIN ' . $parentClass->getQuotedTableName($this->_platform) . ' ' . $tableAlias . ' ON '; - - $sqlParts = array(); - - foreach ($class->getQuotedIdentifierColumnNames($this->_platform) as $columnName) { - $sqlParts[] = $baseTableAlias . '.' . $columnName . ' = ' . $tableAlias . '.' . $columnName; - } - - // Add filters on the root class - if ($filterSql = $this->generateFilterConditionSQL($parentClass, $tableAlias)) { - $sqlParts[] = $filterSql; - } - - $sql .= implode(' AND ', $sqlParts); - } - - // Ignore subclassing inclusion if partial objects is disallowed - if ($this->_query->getHint(Query::HINT_FORCE_PARTIAL_LOAD)) { - return $sql; - } - - // LEFT JOIN child class tables - foreach ($class->subClasses as $subClassName) { - $subClass = $this->_em->getClassMetadata($subClassName); - $tableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); - - $sql .= ' LEFT JOIN ' . $subClass->getQuotedTableName($this->_platform) . ' ' . $tableAlias . ' ON '; - - $sqlParts = array(); - - foreach ($subClass->getQuotedIdentifierColumnNames($this->_platform) as $columnName) { - $sqlParts[] = $baseTableAlias . '.' . $columnName . ' = ' . $tableAlias . '.' . $columnName; - } - - $sql .= implode(' AND ', $sqlParts); - } - - return $sql; - } - - private function _generateOrderedCollectionOrderByItems() - { - $sqlParts = array(); - - foreach ($this->_selectedClasses AS $selectedClass) { - $dqlAlias = $selectedClass['dqlAlias']; - $qComp = $this->_queryComponents[$dqlAlias]; - - if ( ! isset($qComp['relation']['orderBy'])) continue; - - foreach ($qComp['relation']['orderBy'] AS $fieldName => $orientation) { - $columnName = $qComp['metadata']->getQuotedColumnName($fieldName, $this->_platform); - $tableName = ($qComp['metadata']->isInheritanceTypeJoined()) - ? $this->_em->getUnitOfWork()->getEntityPersister($qComp['metadata']->name)->getOwningTable($fieldName) - : $qComp['metadata']->getTableName(); - - $sqlParts[] = $this->getSQLTableAlias($tableName, $dqlAlias) . '.' . $columnName . ' ' . $orientation; - } - } - - return implode(', ', $sqlParts); - } - - /** - * Generates a discriminator column SQL condition for the class with the given DQL alias. - * - * @param array $dqlAliases List of root DQL aliases to inspect for discriminator restrictions. - * @return string - */ - private function _generateDiscriminatorColumnConditionSQL(array $dqlAliases) - { - $sqlParts = array(); - - foreach ($dqlAliases as $dqlAlias) { - $class = $this->_queryComponents[$dqlAlias]['metadata']; - - if ( ! $class->isInheritanceTypeSingleTable()) continue; - - $conn = $this->_em->getConnection(); - $values = array(); - - if ($class->discriminatorValue !== null) { // discrimnators can be 0 - $values[] = $conn->quote($class->discriminatorValue); - } - - foreach ($class->subClasses as $subclassName) { - $values[] = $conn->quote($this->_em->getClassMetadata($subclassName)->discriminatorValue); - } - - $sqlParts[] = (($this->_useSqlTableAliases) ? $this->getSQLTableAlias($class->getTableName(), $dqlAlias) . '.' : '') - . $class->discriminatorColumn['name'] . ' IN (' . implode(', ', $values) . ')'; - } - - $sql = implode(' AND ', $sqlParts); - - return (count($sqlParts) > 1) ? '(' . $sql . ')' : $sql; - } - - /** - * Generates the filter SQL for a given entity and table alias. - * - * @param ClassMetadata $targetEntity Metadata of the target entity. - * @param string $targetTableAlias The table alias of the joined/selected table. - * - * @return string The SQL query part to add to a query. - */ - private function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias) - { - if (!$this->_em->hasFilters()) { - return ''; - } - - switch($targetEntity->inheritanceType) { - case ClassMetadata::INHERITANCE_TYPE_NONE: - break; - case ClassMetadata::INHERITANCE_TYPE_JOINED: - // The classes in the inheritance will be added to the query one by one, - // but only the root node is getting filtered - if ($targetEntity->name !== $targetEntity->rootEntityName) { - return ''; - } - break; - case ClassMetadata::INHERITANCE_TYPE_SINGLE_TABLE: - // With STI the table will only be queried once, make sure that the filters - // are added to the root entity - $targetEntity = $this->_em->getClassMetadata($targetEntity->rootEntityName); - break; - default: - //@todo: throw exception? - return ''; - break; - } - - $filterClauses = array(); - foreach ($this->_em->getFilters()->getEnabledFilters() as $filter) { - if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { - $filterClauses[] = '(' . $filterExpr . ')'; - } - } - - return implode(' AND ', $filterClauses); - } - /** - * Walks down a SelectStatement AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. - */ - public function walkSelectStatement(AST\SelectStatement $AST) - { - $sql = $this->walkSelectClause($AST->selectClause); - $sql .= $this->walkFromClause($AST->fromClause); - $sql .= $this->walkWhereClause($AST->whereClause); - $sql .= $AST->groupByClause ? $this->walkGroupByClause($AST->groupByClause) : ''; - $sql .= $AST->havingClause ? $this->walkHavingClause($AST->havingClause) : ''; - - if (($orderByClause = $AST->orderByClause) !== null) { - $sql .= $AST->orderByClause ? $this->walkOrderByClause($AST->orderByClause) : ''; - } else if (($orderBySql = $this->_generateOrderedCollectionOrderByItems()) !== '') { - $sql .= ' ORDER BY ' . $orderBySql; - } - - $sql = $this->_platform->modifyLimitQuery( - $sql, $this->_query->getMaxResults(), $this->_query->getFirstResult() - ); - - if (($lockMode = $this->_query->getHint(Query::HINT_LOCK_MODE)) !== false) { - switch ($lockMode) { - case LockMode::PESSIMISTIC_READ: - $sql .= ' ' . $this->_platform->getReadLockSQL(); - break; - - case LockMode::PESSIMISTIC_WRITE: - $sql .= ' ' . $this->_platform->getWriteLockSQL(); - break; - - case LockMode::OPTIMISTIC: - foreach ($this->_selectedClasses AS $selectedClass) { - if ( ! $selectedClass['class']->isVersioned) { - throw \Doctrine\ORM\OptimisticLockException::lockFailed($selectedClass['class']->name); - } - } - break; - case LockMode::NONE: - break; - - default: - throw \Doctrine\ORM\Query\QueryException::invalidLockMode(); - } - } - - return $sql; - } - - /** - * Walks down an UpdateStatement AST node, thereby generating the appropriate SQL. - * - * @param UpdateStatement - * @return string The SQL. - */ - public function walkUpdateStatement(AST\UpdateStatement $AST) - { - $this->_useSqlTableAliases = false; - - return $this->walkUpdateClause($AST->updateClause) - . $this->walkWhereClause($AST->whereClause); - } - - /** - * Walks down a DeleteStatement AST node, thereby generating the appropriate SQL. - * - * @param DeleteStatement - * @return string The SQL. - */ - public function walkDeleteStatement(AST\DeleteStatement $AST) - { - $this->_useSqlTableAliases = false; - - return $this->walkDeleteClause($AST->deleteClause) - . $this->walkWhereClause($AST->whereClause); - } - - /** - * Walks down an IdentificationVariable AST node, thereby generating the appropriate SQL. - * This one differs of ->walkIdentificationVariable() because it generates the entity identifiers. - * - * @param string $identVariable - * @return string - */ - public function walkEntityIdentificationVariable($identVariable) - { - $class = $this->_queryComponents[$identVariable]['metadata']; - $tableAlias = $this->getSQLTableAlias($class->getTableName(), $identVariable); - $sqlParts = array(); - - foreach ($class->getQuotedIdentifierColumnNames($this->_platform) as $columnName) { - $sqlParts[] = $tableAlias . '.' . $columnName; - } - - return implode(', ', $sqlParts); - } - - /** - * Walks down an IdentificationVariable (no AST node associated), thereby generating the SQL. - * - * @param string $identificationVariable - * @param string $fieldName - * @return string The SQL. - */ - public function walkIdentificationVariable($identificationVariable, $fieldName = null) - { - $class = $this->_queryComponents[$identificationVariable]['metadata']; - - if ( - $fieldName !== null && $class->isInheritanceTypeJoined() && - isset($class->fieldMappings[$fieldName]['inherited']) - ) { - $class = $this->_em->getClassMetadata($class->fieldMappings[$fieldName]['inherited']); - } - - return $this->getSQLTableAlias($class->getTableName(), $identificationVariable); - } - - /** - * Walks down a PathExpression AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - public function walkPathExpression($pathExpr) - { - $sql = ''; - - switch ($pathExpr->type) { - case AST\PathExpression::TYPE_STATE_FIELD: - $fieldName = $pathExpr->field; - $dqlAlias = $pathExpr->identificationVariable; - $class = $this->_queryComponents[$dqlAlias]['metadata']; - - if ($this->_useSqlTableAliases) { - $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; - } - - $sql .= $class->getQuotedColumnName($fieldName, $this->_platform); - break; - - case AST\PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION: - // 1- the owning side: - // Just use the foreign key, i.e. u.group_id - $fieldName = $pathExpr->field; - $dqlAlias = $pathExpr->identificationVariable; - $class = $this->_queryComponents[$dqlAlias]['metadata']; - - if (isset($class->associationMappings[$fieldName]['inherited'])) { - $class = $this->_em->getClassMetadata($class->associationMappings[$fieldName]['inherited']); - } - - $assoc = $class->associationMappings[$fieldName]; - - if ( ! $assoc['isOwningSide']) { - throw QueryException::associationPathInverseSideNotSupported(); - } - - // COMPOSITE KEYS NOT (YET?) SUPPORTED - if (count($assoc['sourceToTargetKeyColumns']) > 1) { - throw QueryException::associationPathCompositeKeyNotSupported(); - } - - if ($this->_useSqlTableAliases) { - $sql .= $this->getSQLTableAlias($class->getTableName(), $dqlAlias) . '.'; - } - - $sql .= reset($assoc['targetToSourceKeyColumns']); - break; - - default: - throw QueryException::invalidPathExpression($pathExpr); - } - - return $sql; - } - - /** - * Walks down a SelectClause AST node, thereby generating the appropriate SQL. - * - * @param $selectClause - * @return string The SQL. - */ - public function walkSelectClause($selectClause) - { - $sql = 'SELECT ' . (($selectClause->isDistinct) ? 'DISTINCT ' : ''); - $sqlSelectExpressions = array_filter(array_map(array($this, 'walkSelectExpression'), $selectClause->selectExpressions)); - - if ($this->_query->getHint(Query::HINT_INTERNAL_ITERATION) == true && $selectClause->isDistinct) { - $this->_query->setHint(self::HINT_DISTINCT, true); - } - - $addMetaColumns = ! $this->_query->getHint(Query::HINT_FORCE_PARTIAL_LOAD) && - $this->_query->getHydrationMode() == Query::HYDRATE_OBJECT - || - $this->_query->getHydrationMode() != Query::HYDRATE_OBJECT && - $this->_query->getHint(Query::HINT_INCLUDE_META_COLUMNS); - - foreach ($this->_selectedClasses as $selectedClass) { - $class = $selectedClass['class']; - $dqlAlias = $selectedClass['dqlAlias']; - $resultAlias = $selectedClass['resultAlias']; - - // Register as entity or joined entity result - if ($this->_queryComponents[$dqlAlias]['relation'] === null) { - $this->_rsm->addEntityResult($class->name, $dqlAlias, $resultAlias); - } else { - $this->_rsm->addJoinedEntityResult( - $class->name, - $dqlAlias, - $this->_queryComponents[$dqlAlias]['parent'], - $this->_queryComponents[$dqlAlias]['relation']['fieldName'] - ); - } - - if ($class->isInheritanceTypeSingleTable() || $class->isInheritanceTypeJoined()) { - // Add discriminator columns to SQL - $rootClass = $this->_em->getClassMetadata($class->rootEntityName); - $tblAlias = $this->getSQLTableAlias($rootClass->getTableName(), $dqlAlias); - $discrColumn = $rootClass->discriminatorColumn; - $columnAlias = $this->getSQLColumnAlias($discrColumn['name']); - - $sqlSelectExpressions[] = $tblAlias . '.' . $discrColumn['name'] . ' AS ' . $columnAlias; - - $this->_rsm->setDiscriminatorColumn($dqlAlias, $columnAlias); - $this->_rsm->addMetaResult($dqlAlias, $columnAlias, $discrColumn['fieldName']); - } - - // Add foreign key columns to SQL, if necessary - if ( ! $addMetaColumns && ! $class->containsForeignIdentifier) { - continue; - } - - // Add foreign key columns of class and also parent classes - foreach ($class->associationMappings as $assoc) { - if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) { - continue; - } else if ( !$addMetaColumns && !isset($assoc['id'])) { - continue; - } - - $owningClass = (isset($assoc['inherited'])) ? $this->_em->getClassMetadata($assoc['inherited']) : $class; - $sqlTableAlias = $this->getSQLTableAlias($owningClass->getTableName(), $dqlAlias); - - foreach ($assoc['targetToSourceKeyColumns'] as $srcColumn) { - $columnAlias = $this->getSQLColumnAlias($srcColumn); - - $sqlSelectExpressions[] = $sqlTableAlias . '.' . $srcColumn . ' AS ' . $columnAlias; - - $this->_rsm->addMetaResult($dqlAlias, $columnAlias, $srcColumn, (isset($assoc['id']) && $assoc['id'] === true)); - } - } - - // Add foreign key columns to SQL, if necessary - if ( ! $addMetaColumns) { - continue; - } - - // Add foreign key columns of subclasses - foreach ($class->subClasses as $subClassName) { - $subClass = $this->_em->getClassMetadata($subClassName); - $sqlTableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); - - foreach ($subClass->associationMappings as $assoc) { - // Skip if association is inherited - if (isset($assoc['inherited'])) continue; - - if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) continue; - - foreach ($assoc['targetToSourceKeyColumns'] as $srcColumn) { - $columnAlias = $this->getSQLColumnAlias($srcColumn); - - $sqlSelectExpressions[] = $sqlTableAlias . '.' . $srcColumn . ' AS ' . $columnAlias; - - $this->_rsm->addMetaResult($dqlAlias, $columnAlias, $srcColumn); - } - } - } - } - - $sql .= implode(', ', $sqlSelectExpressions); - - return $sql; - } - - /** - * Walks down a FromClause AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. - */ - public function walkFromClause($fromClause) - { - $identificationVarDecls = $fromClause->identificationVariableDeclarations; - $sqlParts = array(); - - foreach ($identificationVarDecls as $identificationVariableDecl) { - $sql = ''; - - $rangeDecl = $identificationVariableDecl->rangeVariableDeclaration; - $dqlAlias = $rangeDecl->aliasIdentificationVariable; - - $this->_rootAliases[] = $dqlAlias; - - $class = $this->_em->getClassMetadata($rangeDecl->abstractSchemaName); - $sql .= $class->getQuotedTableName($this->_platform) . ' ' - . $this->getSQLTableAlias($class->getTableName(), $dqlAlias); - - if ($class->isInheritanceTypeJoined()) { - $sql .= $this->_generateClassTableInheritanceJoins($class, $dqlAlias); - } - - foreach ($identificationVariableDecl->joinVariableDeclarations as $joinVarDecl) { - $sql .= $this->walkJoinVariableDeclaration($joinVarDecl); - } - - if ($identificationVariableDecl->indexBy) { - $alias = $identificationVariableDecl->indexBy->simpleStateFieldPathExpression->identificationVariable; - $field = $identificationVariableDecl->indexBy->simpleStateFieldPathExpression->field; - - if (isset($this->_scalarFields[$alias][$field])) { - $this->_rsm->addIndexByScalar($this->_scalarFields[$alias][$field]); - } else { - $this->_rsm->addIndexBy( - $identificationVariableDecl->indexBy->simpleStateFieldPathExpression->identificationVariable, - $identificationVariableDecl->indexBy->simpleStateFieldPathExpression->field - ); - } - } - - $sqlParts[] = $this->_platform->appendLockHint($sql, $this->_query->getHint(Query::HINT_LOCK_MODE)); - } - - return ' FROM ' . implode(', ', $sqlParts); - } - - /** - * Walks down a FunctionNode AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. - */ - public function walkFunction($function) - { - return $function->getSql($this); - } - - /** - * Walks down an OrderByClause AST node, thereby generating the appropriate SQL. - * - * @param OrderByClause - * @return string The SQL. - */ - public function walkOrderByClause($orderByClause) - { - $orderByItems = array_map(array($this, 'walkOrderByItem'), $orderByClause->orderByItems); - - if (($collectionOrderByItems = $this->_generateOrderedCollectionOrderByItems()) !== '') { - $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); - } - - return ' ORDER BY ' . implode(', ', $orderByItems); - } - - /** - * Walks down an OrderByItem AST node, thereby generating the appropriate SQL. - * - * @param OrderByItem - * @return string The SQL. - */ - public function walkOrderByItem($orderByItem) - { - $expr = $orderByItem->expression; - $sql = ($expr instanceof AST\PathExpression) - ? $this->walkPathExpression($expr) - : $this->walkResultVariable($this->_queryComponents[$expr]['token']['value']); - - return $sql . ' ' . strtoupper($orderByItem->type); - } - - /** - * Walks down a HavingClause AST node, thereby generating the appropriate SQL. - * - * @param HavingClause - * @return string The SQL. - */ - public function walkHavingClause($havingClause) - { - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); - } - - /** - * Walks down a JoinVariableDeclaration AST node and creates the corresponding SQL. - * - * @param JoinVariableDeclaration $joinVarDecl - * @return string The SQL. - */ - public function walkJoinVariableDeclaration($joinVarDecl) - { - $join = $joinVarDecl->join; - $joinType = $join->joinType; - $sql = ($joinType == AST\Join::JOIN_TYPE_LEFT || $joinType == AST\Join::JOIN_TYPE_LEFTOUTER) - ? ' LEFT JOIN ' - : ' INNER JOIN '; - - if ($joinVarDecl->indexBy) { - // For Many-To-One or One-To-One associations this obviously makes no sense, but is ignored silently. - $this->_rsm->addIndexBy( - $joinVarDecl->indexBy->simpleStateFieldPathExpression->identificationVariable, - $joinVarDecl->indexBy->simpleStateFieldPathExpression->field - ); - } - - $joinAssocPathExpr = $join->joinAssociationPathExpression; - $joinedDqlAlias = $join->aliasIdentificationVariable; - - $relation = $this->_queryComponents[$joinedDqlAlias]['relation']; - $targetClass = $this->_em->getClassMetadata($relation['targetEntity']); - $sourceClass = $this->_em->getClassMetadata($relation['sourceEntity']); - $targetTableName = $targetClass->getQuotedTableName($this->_platform); - - $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName(), $joinedDqlAlias); - $sourceTableAlias = $this->getSQLTableAlias($sourceClass->getTableName(), $joinAssocPathExpr->identificationVariable); - - // Ensure we got the owning side, since it has all mapping info - $assoc = ( ! $relation['isOwningSide']) ? $targetClass->associationMappings[$relation['mappedBy']] : $relation; - if ($this->_query->getHint(Query::HINT_INTERNAL_ITERATION) == true && (!$this->_query->getHint(self::HINT_DISTINCT) || isset($this->_selectedClasses[$joinedDqlAlias]))) { - if ($relation['type'] == ClassMetadata::ONE_TO_MANY || $relation['type'] == ClassMetadata::MANY_TO_MANY) { - throw QueryException::iterateWithFetchJoinNotAllowed($assoc); - } - } - - if ($joinVarDecl->indexBy) { - // For Many-To-One or One-To-One associations this obviously makes no sense, but is ignored silently. - $this->_rsm->addIndexBy( - $joinVarDecl->indexBy->simpleStateFieldPathExpression->identificationVariable, - $joinVarDecl->indexBy->simpleStateFieldPathExpression->field - ); - } else if (isset($relation['indexBy'])) { - $this->_rsm->addIndexBy($joinedDqlAlias, $relation['indexBy']); - } - - // This condition is not checking ClassMetadata::MANY_TO_ONE, because by definition it cannot - // be the owning side and previously we ensured that $assoc is always the owning side of the associations. - // The owning side is necessary at this point because only it contains the JoinColumn information. - if ($assoc['type'] & ClassMetadata::TO_ONE) { - $sql .= $targetTableName . ' ' . $targetTableAlias . ' ON '; - $first = true; - - foreach ($assoc['sourceToTargetKeyColumns'] as $sourceColumn => $targetColumn) { - if ( ! $first) $sql .= ' AND '; else $first = false; - - if ($relation['isOwningSide']) { - if ($targetClass->containsForeignIdentifier && !isset($targetClass->fieldNames[$targetColumn])) { - $quotedTargetColumn = $targetColumn; // Join columns cannot be quoted. - } else { - $quotedTargetColumn = $targetClass->getQuotedColumnName($targetClass->fieldNames[$targetColumn], $this->_platform); - } - $sql .= $sourceTableAlias . '.' . $sourceColumn . ' = ' . $targetTableAlias . '.' . $quotedTargetColumn; - } else { - if ($sourceClass->containsForeignIdentifier && !isset($sourceClass->fieldNames[$targetColumn])) { - $quotedTargetColumn = $targetColumn; // Join columns cannot be quoted. - } else { - $quotedTargetColumn = $sourceClass->getQuotedColumnName($sourceClass->fieldNames[$targetColumn], $this->_platform); - } - $sql .= $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $targetTableAlias . '.' . $sourceColumn; - } - } - - } else if ($assoc['type'] == ClassMetadata::MANY_TO_MANY) { - // Join relation table - $joinTable = $assoc['joinTable']; - $joinTableAlias = $this->getSQLTableAlias($joinTable['name'], $joinedDqlAlias); - $sql .= $sourceClass->getQuotedJoinTableName($assoc, $this->_platform) . ' ' . $joinTableAlias . ' ON '; - - $first = true; - if ($relation['isOwningSide']) { - foreach ($assoc['relationToSourceKeyColumns'] as $relationColumn => $sourceColumn) { - if ( ! $first) $sql .= ' AND '; else $first = false; - - if ($sourceClass->containsForeignIdentifier && !isset($sourceClass->fieldNames[$sourceColumn])) { - $quotedTargetColumn = $sourceColumn; // Join columns cannot be quoted. - } else { - $quotedTargetColumn = $sourceClass->getQuotedColumnName($sourceClass->fieldNames[$sourceColumn], $this->_platform); - } - - $sql .= $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $relationColumn; - } - } else { - foreach ($assoc['relationToTargetKeyColumns'] as $relationColumn => $targetColumn) { - if ( ! $first) $sql .= ' AND '; else $first = false; - - if ($sourceClass->containsForeignIdentifier && !isset($sourceClass->fieldNames[$targetColumn])) { - $quotedTargetColumn = $targetColumn; // Join columns cannot be quoted. - } else { - $quotedTargetColumn = $sourceClass->getQuotedColumnName($sourceClass->fieldNames[$targetColumn], $this->_platform); - } - - $sql .= $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $relationColumn; - } - } - - // Join target table - $sql .= ($joinType == AST\Join::JOIN_TYPE_LEFT || $joinType == AST\Join::JOIN_TYPE_LEFTOUTER) ? ' LEFT JOIN ' : ' INNER JOIN '; - $sql .= $targetTableName . ' ' . $targetTableAlias . ' ON '; - - $first = true; - if ($relation['isOwningSide']) { - foreach ($assoc['relationToTargetKeyColumns'] as $relationColumn => $targetColumn) { - if ( ! $first) $sql .= ' AND '; else $first = false; - - if ($targetClass->containsForeignIdentifier && !isset($targetClass->fieldNames[$targetColumn])) { - $quotedTargetColumn = $targetColumn; // Join columns cannot be quoted. - } else { - $quotedTargetColumn = $targetClass->getQuotedColumnName($targetClass->fieldNames[$targetColumn], $this->_platform); - } - - $sql .= $targetTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $relationColumn; - } - } else { - foreach ($assoc['relationToSourceKeyColumns'] as $relationColumn => $sourceColumn) { - if ( ! $first) $sql .= ' AND '; else $first = false; - - if ($targetClass->containsForeignIdentifier && !isset($targetClass->fieldNames[$sourceColumn])) { - $quotedTargetColumn = $sourceColumn; // Join columns cannot be quoted. - } else { - $quotedTargetColumn = $targetClass->getQuotedColumnName($targetClass->fieldNames[$sourceColumn], $this->_platform); - } - - $sql .= $targetTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $relationColumn; - } - } - } - - // Apply the filters - if ($filterExpr = $this->generateFilterConditionSQL($targetClass, $targetTableAlias)) { - $sql .= ' AND ' . $filterExpr; - } - - // Handle WITH clause - if (($condExpr = $join->conditionalExpression) !== null) { - // Phase 2 AST optimization: Skip processment of ConditionalExpression - // if only one ConditionalTerm is defined - $sql .= ' AND (' . $this->walkConditionalExpression($condExpr) . ')'; - } - - $discrSql = $this->_generateDiscriminatorColumnConditionSQL(array($joinedDqlAlias)); - - if ($discrSql) { - $sql .= ' AND ' . $discrSql; - } - - // FIXME: these should either be nested or all forced to be left joins (DDC-XXX) - if ($targetClass->isInheritanceTypeJoined()) { - $sql .= $this->_generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); - } - - return $sql; - } - - /** - * Walks down a CaseExpression AST node and generates the corresponding SQL. - * - * @param CoalesceExpression|NullIfExpression|GeneralCaseExpression|SimpleCaseExpression $expression - * @return string The SQL. - */ - public function walkCaseExpression($expression) - { - switch (true) { - case ($expression instanceof AST\CoalesceExpression): - return $this->walkCoalesceExpression($expression); - - case ($expression instanceof AST\NullIfExpression): - return $this->walkNullIfExpression($expression); - - case ($expression instanceof AST\GeneralCaseExpression): - return $this->walkGeneralCaseExpression($expression); - - case ($expression instanceof AST\SimpleCaseExpression): - return $this->walkSimpleCaseExpression($expression); - - default: - return ''; - } - } - - /** - * Walks down a CoalesceExpression AST node and generates the corresponding SQL. - * - * @param CoalesceExpression $coalesceExpression - * @return string The SQL. - */ - public function walkCoalesceExpression($coalesceExpression) - { - $sql = 'COALESCE('; - - $scalarExpressions = array(); - - foreach ($coalesceExpression->scalarExpressions as $scalarExpression) { - $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); - } - - $sql .= implode(', ', $scalarExpressions) . ')'; - - return $sql; - } - - /** - * Walks down a NullIfExpression AST node and generates the corresponding SQL. - * - * @param NullIfExpression $nullIfExpression - * @return string The SQL. - */ - public function walkNullIfExpression($nullIfExpression) - { - $firstExpression = is_string($nullIfExpression->firstExpression) - ? $this->_conn->quote($nullIfExpression->firstExpression) - : $this->walkSimpleArithmeticExpression($nullIfExpression->firstExpression); - - $secondExpression = is_string($nullIfExpression->secondExpression) - ? $this->_conn->quote($nullIfExpression->secondExpression) - : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); - - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; - } - - /** - * Walks down a GeneralCaseExpression AST node and generates the corresponding SQL. - * - * @param GeneralCaseExpression $generalCaseExpression - * @return string The SQL. - */ - public function walkGeneralCaseExpression(AST\GeneralCaseExpression $generalCaseExpression) - { - $sql = 'CASE'; - - foreach ($generalCaseExpression->whenClauses as $whenClause) { - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); - } - - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; - - return $sql; - } - - /** - * Walks down a SimpleCaseExpression AST node and generates the corresponding SQL. - * - * @param SimpleCaseExpression $simpleCaseExpression - * @return string The SQL. - */ - public function walkSimpleCaseExpression($simpleCaseExpression) - { - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); - - foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); - } - - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; - - return $sql; - } - - /** - * Walks down a SelectExpression AST node and generates the corresponding SQL. - * - * @param SelectExpression $selectExpression - * @return string The SQL. - */ - public function walkSelectExpression($selectExpression) - { - $sql = ''; - $expr = $selectExpression->expression; - $hidden = $selectExpression->hiddenAliasResultVariable; - - switch (true) { - case ($expr instanceof AST\PathExpression): - if ($expr->type !== AST\PathExpression::TYPE_STATE_FIELD) { - throw QueryException::invalidPathExpression($expr->type); - } - - $fieldName = $expr->field; - $dqlAlias = $expr->identificationVariable; - $qComp = $this->_queryComponents[$dqlAlias]; - $class = $qComp['metadata']; - - $resultAlias = $selectExpression->fieldIdentificationVariable ?: $fieldName; - $tableName = ($class->isInheritanceTypeJoined()) - ? $this->_em->getUnitOfWork()->getEntityPersister($class->name)->getOwningTable($fieldName) - : $class->getTableName(); - - $sqlTableAlias = $this->getSQLTableAlias($tableName, $dqlAlias); - $columnName = $class->getQuotedColumnName($fieldName, $this->_platform); - $columnAlias = $this->getSQLColumnAlias($class->fieldMappings[$fieldName]['columnName']); - - $col = $sqlTableAlias . '.' . $columnName; - - $fieldType = $class->getTypeOfField($fieldName); - - if (isset($class->fieldMappings[$fieldName]['requireSQLConversion'])) { - $type = Type::getType($fieldType); - $col = $type->convertToPHPValueSQL($col, $this->_conn->getDatabasePlatform()); - } - - $sql .= $col . ' AS ' . $columnAlias; - - $this->_scalarResultAliasMap[$resultAlias] = $columnAlias; - - if ( ! $hidden) { - $this->_rsm->addScalarResult($columnAlias, $resultAlias, $fieldType); - $this->_scalarFields[$dqlAlias][$fieldName] = $columnAlias; - } - break; - - case ($expr instanceof AST\AggregateExpression): - case ($expr instanceof AST\Functions\FunctionNode): - case ($expr instanceof AST\SimpleArithmeticExpression): - case ($expr instanceof AST\ArithmeticTerm): - case ($expr instanceof AST\ArithmeticFactor): - case ($expr instanceof AST\ArithmeticPrimary): - case ($expr instanceof AST\Literal): - case ($expr instanceof AST\NullIfExpression): - case ($expr instanceof AST\CoalesceExpression): - case ($expr instanceof AST\GeneralCaseExpression): - case ($expr instanceof AST\SimpleCaseExpression): - $columnAlias = $this->getSQLColumnAlias('sclr'); - $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->_scalarResultCounter++; - - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; - - $this->_scalarResultAliasMap[$resultAlias] = $columnAlias; - - if ( ! $hidden) { - // We cannot resolve field type here; assume 'string'. - $this->_rsm->addScalarResult($columnAlias, $resultAlias, 'string'); - } - break; - - case ($expr instanceof AST\Subselect): - $columnAlias = $this->getSQLColumnAlias('sclr'); - $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->_scalarResultCounter++; - - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; - - $this->_scalarResultAliasMap[$resultAlias] = $columnAlias; - - if ( ! $hidden) { - // We cannot resolve field type here; assume 'string'. - $this->_rsm->addScalarResult($columnAlias, $resultAlias, 'string'); - } - break; - - default: - // IdentificationVariable or PartialObjectExpression - if ($expr instanceof AST\PartialObjectExpression) { - $dqlAlias = $expr->identificationVariable; - $partialFieldSet = $expr->partialFieldSet; - } else { - $dqlAlias = $expr; - $partialFieldSet = array(); - } - - $queryComp = $this->_queryComponents[$dqlAlias]; - $class = $queryComp['metadata']; - $resultAlias = $selectExpression->fieldIdentificationVariable ?: null; - - if ( ! isset($this->_selectedClasses[$dqlAlias])) { - $this->_selectedClasses[$dqlAlias] = array( - 'class' => $class, - 'dqlAlias' => $dqlAlias, - 'resultAlias' => $resultAlias - ); - } - - $sqlParts = array(); - - // Select all fields from the queried class - foreach ($class->fieldMappings as $fieldName => $mapping) { - if ($partialFieldSet && ! in_array($fieldName, $partialFieldSet)) { - continue; - } - - $tableName = (isset($mapping['inherited'])) - ? $this->_em->getClassMetadata($mapping['inherited'])->getTableName() - : $class->getTableName(); - - $sqlTableAlias = $this->getSQLTableAlias($tableName, $dqlAlias); - $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); - $quotedColumnName = $class->getQuotedColumnName($fieldName, $this->_platform); - - $col = $sqlTableAlias . '.' . $quotedColumnName; - - if (isset($class->fieldMappings[$fieldName]['requireSQLConversion'])) { - $type = Type::getType($class->getTypeOfField($fieldName)); - $col = $type->convertToPHPValueSQL($col, $this->_platform); - } - - $sqlParts[] = $col . ' AS '. $columnAlias; - - $this->_scalarResultAliasMap[$resultAlias][] = $columnAlias; - - $this->_rsm->addFieldResult($dqlAlias, $columnAlias, $fieldName, $class->name); - } - - // Add any additional fields of subclasses (excluding inherited fields) - // 1) on Single Table Inheritance: always, since its marginal overhead - // 2) on Class Table Inheritance only if partial objects are disallowed, - // since it requires outer joining subtables. - if ($class->isInheritanceTypeSingleTable() || ! $this->_query->getHint(Query::HINT_FORCE_PARTIAL_LOAD)) { - foreach ($class->subClasses as $subClassName) { - $subClass = $this->_em->getClassMetadata($subClassName); - $sqlTableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); - - foreach ($subClass->fieldMappings as $fieldName => $mapping) { - if (isset($mapping['inherited']) || $partialFieldSet && !in_array($fieldName, $partialFieldSet)) { - continue; - } - - $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); - $quotedColumnName = $subClass->getQuotedColumnName($fieldName, $this->_platform); - - $col = $sqlTableAlias . '.' . $quotedColumnName; - - if (isset($subClass->fieldMappings[$fieldName]['requireSQLConversion'])) { - $type = Type::getType($subClass->getTypeOfField($fieldName)); - $col = $type->convertToPHPValueSQL($col, $this->_platform); - } - - $sqlParts[] = $col . ' AS ' . $columnAlias; - - $this->_scalarResultAliasMap[$resultAlias][] = $columnAlias; - - $this->_rsm->addFieldResult($dqlAlias, $columnAlias, $fieldName, $subClassName); - } - } - } - - $sql .= implode(', ', $sqlParts); - } - - return $sql; - } - - /** - * Walks down a QuantifiedExpression AST node, thereby generating the appropriate SQL. - * - * @param QuantifiedExpression - * @return string The SQL. - */ - public function walkQuantifiedExpression($qExpr) - { - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; - } - - /** - * Walks down a Subselect AST node, thereby generating the appropriate SQL. - * - * @param Subselect - * @return string The SQL. - */ - public function walkSubselect($subselect) - { - $useAliasesBefore = $this->_useSqlTableAliases; - $rootAliasesBefore = $this->_rootAliases; - - $this->_rootAliases = array(); // reset the rootAliases for the subselect - $this->_useSqlTableAliases = true; - - $sql = $this->walkSimpleSelectClause($subselect->simpleSelectClause); - $sql .= $this->walkSubselectFromClause($subselect->subselectFromClause); - $sql .= $this->walkWhereClause($subselect->whereClause); - - $sql .= $subselect->groupByClause ? $this->walkGroupByClause($subselect->groupByClause) : ''; - $sql .= $subselect->havingClause ? $this->walkHavingClause($subselect->havingClause) : ''; - $sql .= $subselect->orderByClause ? $this->walkOrderByClause($subselect->orderByClause) : ''; - - $this->_rootAliases = $rootAliasesBefore; // put the main aliases back - $this->_useSqlTableAliases = $useAliasesBefore; - - return $sql; - } - - /** - * Walks down a SubselectFromClause AST node, thereby generating the appropriate SQL. - * - * @param SubselectFromClause - * @return string The SQL. - */ - public function walkSubselectFromClause($subselectFromClause) - { - $identificationVarDecls = $subselectFromClause->identificationVariableDeclarations; - $sqlParts = array (); - - foreach ($identificationVarDecls as $subselectIdVarDecl) { - $sql = ''; - - $rangeDecl = $subselectIdVarDecl->rangeVariableDeclaration; - $dqlAlias = $rangeDecl->aliasIdentificationVariable; - - $class = $this->_em->getClassMetadata($rangeDecl->abstractSchemaName); - $sql .= $class->getQuotedTableName($this->_platform) . ' ' - . $this->getSQLTableAlias($class->getTableName(), $dqlAlias); - - $this->_rootAliases[] = $dqlAlias; - - if ($class->isInheritanceTypeJoined()) { - $sql .= $this->_generateClassTableInheritanceJoins($class, $dqlAlias); - } - - foreach ($subselectIdVarDecl->joinVariableDeclarations as $joinVarDecl) { - $sql .= $this->walkJoinVariableDeclaration($joinVarDecl); - } - - $sqlParts[] = $this->_platform->appendLockHint($sql, $this->_query->getHint(Query::HINT_LOCK_MODE)); - } - - return ' FROM ' . implode(', ', $sqlParts); - } - - /** - * Walks down a SimpleSelectClause AST node, thereby generating the appropriate SQL. - * - * @param SimpleSelectClause - * @return string The SQL. - */ - public function walkSimpleSelectClause($simpleSelectClause) - { - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') - . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); - } - - /** - * Walks down a SimpleSelectExpression AST node, thereby generating the appropriate SQL. - * - * @param SimpleSelectExpression - * @return string The SQL. - */ - public function walkSimpleSelectExpression($simpleSelectExpression) - { - $expr = $simpleSelectExpression->expression; - $sql = ' '; - - switch (true) { - case ($expr instanceof AST\PathExpression): - $sql .= $this->walkPathExpression($expr); - break; - - case ($expr instanceof AST\AggregateExpression): - $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->_scalarResultCounter++; - - $sql .= $this->walkAggregateExpression($expr) . ' AS dctrn__' . $alias; - break; - - case ($expr instanceof AST\Subselect): - $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->_scalarResultCounter++; - - $columnAlias = 'sclr' . $this->_aliasCounter++; - $this->_scalarResultAliasMap[$alias] = $columnAlias; - - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; - break; - - case ($expr instanceof AST\Functions\FunctionNode): - case ($expr instanceof AST\SimpleArithmeticExpression): - case ($expr instanceof AST\ArithmeticTerm): - case ($expr instanceof AST\ArithmeticFactor): - case ($expr instanceof AST\ArithmeticPrimary): - case ($expr instanceof AST\Literal): - case ($expr instanceof AST\NullIfExpression): - case ($expr instanceof AST\CoalesceExpression): - case ($expr instanceof AST\GeneralCaseExpression): - case ($expr instanceof AST\SimpleCaseExpression): - $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->_scalarResultCounter++; - - $columnAlias = $this->getSQLColumnAlias('sclr'); - $this->_scalarResultAliasMap[$alias] = $columnAlias; - - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; - break; - - default: // IdentificationVariable - $sql .= $this->walkEntityIdentificationVariable($expr); - break; - } - - return $sql; - } - - /** - * Walks down an AggregateExpression AST node, thereby generating the appropriate SQL. - * - * @param AggregateExpression - * @return string The SQL. - */ - public function walkAggregateExpression($aggExpression) - { - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; - } - - /** - * Walks down a GroupByClause AST node, thereby generating the appropriate SQL. - * - * @param GroupByClause - * @return string The SQL. - */ - public function walkGroupByClause($groupByClause) - { - $sqlParts = array(); - - foreach ($groupByClause->groupByItems AS $groupByItem) { - $sqlParts[] = $this->walkGroupByItem($groupByItem); - } - - return ' GROUP BY ' . implode(', ', $sqlParts); - } - - /** - * Walks down a GroupByItem AST node, thereby generating the appropriate SQL. - * - * @param GroupByItem - * @return string The SQL. - */ - public function walkGroupByItem($groupByItem) - { - // StateFieldPathExpression - if ( ! is_string($groupByItem)) { - return $this->walkPathExpression($groupByItem); - } - - // ResultVariable - if (isset($this->_queryComponents[$groupByItem]['resultVariable'])) { - return $this->walkResultVariable($groupByItem); - } - - // IdentificationVariable - $sqlParts = array(); - - foreach ($this->_queryComponents[$groupByItem]['metadata']->fieldNames AS $field) { - $item = new AST\PathExpression(AST\PathExpression::TYPE_STATE_FIELD, $groupByItem, $field); - $item->type = AST\PathExpression::TYPE_STATE_FIELD; - - $sqlParts[] = $this->walkPathExpression($item); - } - - foreach ($this->_queryComponents[$groupByItem]['metadata']->associationMappings AS $mapping) { - if ($mapping['isOwningSide'] && $mapping['type'] & ClassMetadataInfo::TO_ONE) { - $item = new AST\PathExpression(AST\PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION, $groupByItem, $mapping['fieldName']); - $item->type = AST\PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION; - - $sqlParts[] = $this->walkPathExpression($item); - } - } - - return implode(', ', $sqlParts); - } - - /** - * Walks down a DeleteClause AST node, thereby generating the appropriate SQL. - * - * @param DeleteClause - * @return string The SQL. - */ - public function walkDeleteClause(AST\DeleteClause $deleteClause) - { - $class = $this->_em->getClassMetadata($deleteClause->abstractSchemaName); - $tableName = $class->getTableName(); - $sql = 'DELETE FROM ' . $class->getQuotedTableName($this->_platform); - - $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); - $this->_rootAliases[] = $deleteClause->aliasIdentificationVariable; - - return $sql; - } - - /** - * Walks down an UpdateClause AST node, thereby generating the appropriate SQL. - * - * @param UpdateClause - * @return string The SQL. - */ - public function walkUpdateClause($updateClause) - { - $class = $this->_em->getClassMetadata($updateClause->abstractSchemaName); - $tableName = $class->getTableName(); - $sql = 'UPDATE ' . $class->getQuotedTableName($this->_platform); - - $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); - $this->_rootAliases[] = $updateClause->aliasIdentificationVariable; - - $sql .= ' SET ' . implode(', ', array_map(array($this, 'walkUpdateItem'), $updateClause->updateItems)); - - return $sql; - } - - /** - * Walks down an UpdateItem AST node, thereby generating the appropriate SQL. - * - * @param UpdateItem - * @return string The SQL. - */ - public function walkUpdateItem($updateItem) - { - $useTableAliasesBefore = $this->_useSqlTableAliases; - $this->_useSqlTableAliases = false; - - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; - $newValue = $updateItem->newValue; - - switch (true) { - case ($newValue instanceof AST\Node): - $sql .= $newValue->dispatch($this); - break; - - case ($newValue === null): - $sql .= 'NULL'; - break; - - default: - $sql .= $this->_conn->quote($newValue); - break; - } - - $this->_useSqlTableAliases = $useTableAliasesBefore; - - return $sql; - } - - /** - * Walks down a WhereClause AST node, thereby generating the appropriate SQL. - * WhereClause or not, the appropriate discriminator sql is added. - * - * @param WhereClause - * @return string The SQL. - */ - public function walkWhereClause($whereClause) - { - $condSql = null !== $whereClause ? $this->walkConditionalExpression($whereClause->conditionalExpression) : ''; - $discrSql = $this->_generateDiscriminatorColumnConditionSql($this->_rootAliases); - - if ($this->_em->hasFilters()) { - $filterClauses = array(); - foreach ($this->_rootAliases as $dqlAlias) { - $class = $this->_queryComponents[$dqlAlias]['metadata']; - $tableAlias = $this->getSQLTableAlias($class->table['name'], $dqlAlias); - - if ($filterExpr = $this->generateFilterConditionSQL($class, $tableAlias)) { - $filterClauses[] = $filterExpr; - } - } - - if (count($filterClauses)) { - if ($condSql) { - $condSql .= ' AND '; - } - - $condSql .= implode(' AND ', $filterClauses); - } - } - - if ($condSql) { - return ' WHERE ' . (( ! $discrSql) ? $condSql : '(' . $condSql . ') AND ' . $discrSql); - } - - if ($discrSql) { - return ' WHERE ' . $discrSql; - } - - return ''; - } - - /** - * Walk down a ConditionalExpression AST node, thereby generating the appropriate SQL. - * - * @param ConditionalExpression - * @return string The SQL. - */ - public function walkConditionalExpression($condExpr) - { - // Phase 2 AST optimization: Skip processment of ConditionalExpression - // if only one ConditionalTerm is defined - if ( ! ($condExpr instanceof AST\ConditionalExpression)) { - return $this->walkConditionalTerm($condExpr); - } - - return implode(' OR ', array_map(array($this, 'walkConditionalTerm'), $condExpr->conditionalTerms)); - } - - /** - * Walks down a ConditionalTerm AST node, thereby generating the appropriate SQL. - * - * @param ConditionalTerm - * @return string The SQL. - */ - public function walkConditionalTerm($condTerm) - { - // Phase 2 AST optimization: Skip processment of ConditionalTerm - // if only one ConditionalFactor is defined - if ( ! ($condTerm instanceof AST\ConditionalTerm)) { - return $this->walkConditionalFactor($condTerm); - } - - return implode(' AND ', array_map(array($this, 'walkConditionalFactor'), $condTerm->conditionalFactors)); - } - - /** - * Walks down a ConditionalFactor AST node, thereby generating the appropriate SQL. - * - * @param ConditionalFactor - * @return string The SQL. - */ - public function walkConditionalFactor($factor) - { - // Phase 2 AST optimization: Skip processment of ConditionalFactor - // if only one ConditionalPrimary is defined - return ( ! ($factor instanceof AST\ConditionalFactor)) - ? $this->walkConditionalPrimary($factor) - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); - } - - /** - * Walks down a ConditionalPrimary AST node, thereby generating the appropriate SQL. - * - * @param ConditionalPrimary - * @return string The SQL. - */ - public function walkConditionalPrimary($primary) - { - if ($primary->isSimpleConditionalExpression()) { - return $primary->simpleConditionalExpression->dispatch($this); - } - - if ($primary->isConditionalExpression()) { - $condExpr = $primary->conditionalExpression; - - return '(' . $this->walkConditionalExpression($condExpr) . ')'; - } - } - - /** - * Walks down an ExistsExpression AST node, thereby generating the appropriate SQL. - * - * @param ExistsExpression - * @return string The SQL. - */ - public function walkExistsExpression($existsExpr) - { - $sql = ($existsExpr->not) ? 'NOT ' : ''; - - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; - - return $sql; - } - - /** - * Walks down a CollectionMemberExpression AST node, thereby generating the appropriate SQL. - * - * @param CollectionMemberExpression - * @return string The SQL. - */ - public function walkCollectionMemberExpression($collMemberExpr) - { - $sql = $collMemberExpr->not ? 'NOT ' : ''; - $sql .= 'EXISTS (SELECT 1 FROM '; - - $entityExpr = $collMemberExpr->entityExpression; - $collPathExpr = $collMemberExpr->collectionValuedPathExpression; - - $fieldName = $collPathExpr->field; - $dqlAlias = $collPathExpr->identificationVariable; - - $class = $this->_queryComponents[$dqlAlias]['metadata']; - - switch (true) { - // InputParameter - case ($entityExpr instanceof AST\InputParameter): - $dqlParamKey = $entityExpr->name; - $entity = $this->_query->getParameter($dqlParamKey); - $entitySql = '?'; - break; - - // SingleValuedAssociationPathExpression | IdentificationVariable - case ($entityExpr instanceof AST\PathExpression): - $entitySql = $this->walkPathExpression($entityExpr); - break; - - default: - throw new \BadMethodCallException("Not implemented"); - } - - $assoc = $class->associationMappings[$fieldName]; - - if ($assoc['type'] == ClassMetadata::ONE_TO_MANY) { - $targetClass = $this->_em->getClassMetadata($assoc['targetEntity']); - $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); - $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); - - $sql .= $targetClass->getQuotedTableName($this->_platform) . ' ' . $targetTableAlias . ' WHERE '; - - $owningAssoc = $targetClass->associationMappings[$assoc['mappedBy']]; - $sqlParts = array(); - - foreach ($owningAssoc['targetToSourceKeyColumns'] as $targetColumn => $sourceColumn) { - $targetColumn = $class->getQuotedColumnName($class->fieldNames[$targetColumn], $this->_platform); - - $sqlParts[] = $sourceTableAlias . '.' . $targetColumn . ' = ' . $targetTableAlias . '.' . $sourceColumn; - } - - foreach ($targetClass->getQuotedIdentifierColumnNames($this->_platform) as $targetColumnName) { - if (isset($dqlParamKey)) { - $this->_parserResult->addParameterMapping($dqlParamKey, $this->_sqlParamIndex++); - } - - $sqlParts[] = $targetTableAlias . '.' . $targetColumnName . ' = ' . $entitySql; - } - - $sql .= implode(' AND ', $sqlParts); - } else { // many-to-many - $targetClass = $this->_em->getClassMetadata($assoc['targetEntity']); - - $owningAssoc = $assoc['isOwningSide'] ? $assoc : $targetClass->associationMappings[$assoc['mappedBy']]; - $joinTable = $owningAssoc['joinTable']; - - // SQL table aliases - $joinTableAlias = $this->getSQLTableAlias($joinTable['name']); - $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); - $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); - - // join to target table - $sql .= $targetClass->getQuotedJoinTableName($owningAssoc, $this->_platform) . ' ' . $joinTableAlias - . ' INNER JOIN ' . $targetClass->getQuotedTableName($this->_platform) . ' ' . $targetTableAlias . ' ON '; - - // join conditions - $joinColumns = $assoc['isOwningSide'] ? $joinTable['inverseJoinColumns'] : $joinTable['joinColumns']; - $joinSqlParts = array(); - - foreach ($joinColumns as $joinColumn) { - $targetColumn = $targetClass->getQuotedColumnName( - $targetClass->fieldNames[$joinColumn['referencedColumnName']], - $this->_platform - ); - - $joinSqlParts[] = $joinTableAlias . '.' . $joinColumn['name'] . ' = ' . $targetTableAlias . '.' . $targetColumn; - } - - $sql .= implode(' AND ', $joinSqlParts); - $sql .= ' WHERE '; - - $joinColumns = $assoc['isOwningSide'] ? $joinTable['joinColumns'] : $joinTable['inverseJoinColumns']; - $sqlParts = array(); - - foreach ($joinColumns as $joinColumn) { - $targetColumn = $class->getQuotedColumnName( - $class->fieldNames[$joinColumn['referencedColumnName']], - $this->_platform - ); - - $sqlParts[] = $joinTableAlias . '.' . $joinColumn['name'] . ' = ' . $sourceTableAlias . '.' . $targetColumn; - } - - foreach ($targetClass->getQuotedIdentifierColumnNames($this->_platform) as $targetColumnName) { - if (isset($dqlParamKey)) { - $this->_parserResult->addParameterMapping($dqlParamKey, $this->_sqlParamIndex++); - } - - $sqlParts[] = $targetTableAlias . '.' . $targetColumnName . ' = ' . $entitySql; - } - - $sql .= implode(' AND ', $sqlParts); - } - - return $sql . ')'; - } - - /** - * Walks down an EmptyCollectionComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param EmptyCollectionComparisonExpression - * @return string The SQL. - */ - public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr) - { - $sizeFunc = new AST\Functions\SizeFunction('size'); - $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; - - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); - } - - /** - * Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param NullComparisonExpression - * @return string The SQL. - */ - public function walkNullComparisonExpression($nullCompExpr) - { - $sql = ''; - $innerExpr = $nullCompExpr->expression; - - if ($innerExpr instanceof AST\InputParameter) { - $dqlParamKey = $innerExpr->name; - $this->_parserResult->addParameterMapping($dqlParamKey, $this->_sqlParamIndex++); - $sql .= ' ?'; - } else { - $sql .= $this->walkPathExpression($innerExpr); - } - - $sql .= ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; - - return $sql; - } - - /** - * Walks down an InExpression AST node, thereby generating the appropriate SQL. - * - * @param InExpression - * @return string The SQL. - */ - public function walkInExpression($inExpr) - { - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; - - $sql .= ($inExpr->subselect) - ? $this->walkSubselect($inExpr->subselect) - : implode(', ', array_map(array($this, 'walkInParameter'), $inExpr->literals)); - - $sql .= ')'; - - return $sql; - } - - /** - * Walks down an InstanceOfExpression AST node, thereby generating the appropriate SQL. - * - * @param InstanceOfExpression - * @return string The SQL. - */ - public function walkInstanceOfExpression($instanceOfExpr) - { - $sql = ''; - - $dqlAlias = $instanceOfExpr->identificationVariable; - $discrClass = $class = $this->_queryComponents[$dqlAlias]['metadata']; - $fieldName = null; - - if ($class->discriminatorColumn) { - $discrClass = $this->_em->getClassMetadata($class->rootEntityName); - } - - if ($this->_useSqlTableAliases) { - $sql .= $this->getSQLTableAlias($discrClass->getTableName(), $dqlAlias) . '.'; - } - - $sql .= $class->discriminatorColumn['name'] . ($instanceOfExpr->not ? ' NOT IN ' : ' IN '); - - $sqlParameterList = array(); - - foreach ($instanceOfExpr->value as $parameter) { - if ($parameter instanceof AST\InputParameter) { - // We need to modify the parameter value to be its correspondent mapped value - $dqlParamKey = $parameter->name; - $paramValue = $this->_query->getParameter($dqlParamKey); - - if ( ! ($paramValue instanceof \Doctrine\ORM\Mapping\ClassMetadata)) { - throw QueryException::invalidParameterType('ClassMetadata', get_class($paramValue)); - } - - $entityClassName = $paramValue->name; - } else { - // Get name from ClassMetadata to resolve aliases. - $entityClassName = $this->_em->getClassMetadata($parameter)->name; - } - - if ($entityClassName == $class->name) { - $sqlParameterList[] = $this->_conn->quote($class->discriminatorValue); - } else { - $discrMap = array_flip($class->discriminatorMap); - - if (!isset($discrMap[$entityClassName])) { - throw QueryException::instanceOfUnrelatedClass($entityClassName, $class->rootEntityName); - } - - $sqlParameterList[] = $this->_conn->quote($discrMap[$entityClassName]); - } - } - - $sql .= '(' . implode(', ', $sqlParameterList) . ')'; - - return $sql; - } - - /** - * Walks down an InParameter AST node, thereby generating the appropriate SQL. - * - * @param InParameter - * @return string The SQL. - */ - public function walkInParameter($inParam) - { - return $inParam instanceof AST\InputParameter - ? $this->walkInputParameter($inParam) - : $this->walkLiteral($inParam); - } - - /** - * Walks down a literal that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - public function walkLiteral($literal) - { - switch ($literal->type) { - case AST\Literal::STRING: - return $this->_conn->quote($literal->value); - - case AST\Literal::BOOLEAN: - $bool = strtolower($literal->value) == 'true' ? true : false; - $boolVal = $this->_conn->getDatabasePlatform()->convertBooleans($bool); - - return $boolVal; - - case AST\Literal::NUMERIC: - return $literal->value; - - default: - throw QueryException::invalidLiteral($literal); - } - } - - /** - * Walks down a BetweenExpression AST node, thereby generating the appropriate SQL. - * - * @param BetweenExpression - * @return string The SQL. - */ - public function walkBetweenExpression($betweenExpr) - { - $sql = $this->walkArithmeticExpression($betweenExpr->expression); - - if ($betweenExpr->not) $sql .= ' NOT'; - - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); - - return $sql; - } - - /** - * Walks down a LikeExpression AST node, thereby generating the appropriate SQL. - * - * @param LikeExpression - * @return string The SQL. - */ - public function walkLikeExpression($likeExpr) - { - $stringExpr = $likeExpr->stringExpression; - $sql = $stringExpr->dispatch($this) . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; - - if ($likeExpr->stringPattern instanceof AST\InputParameter) { - $inputParam = $likeExpr->stringPattern; - $dqlParamKey = $inputParam->name; - $this->_parserResult->addParameterMapping($dqlParamKey, $this->_sqlParamIndex++); - $sql .= '?'; - } else { - $sql .= $this->_conn->quote($likeExpr->stringPattern); - } - - if ($likeExpr->escapeChar) { - $sql .= ' ESCAPE ' . $this->_conn->quote($likeExpr->escapeChar); - } - - return $sql; - } - - /** - * Walks down a StateFieldPathExpression AST node, thereby generating the appropriate SQL. - * - * @param StateFieldPathExpression - * @return string The SQL. - */ - public function walkStateFieldPathExpression($stateFieldPathExpression) - { - return $this->walkPathExpression($stateFieldPathExpression); - } - - /** - * Walks down a ComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param ComparisonExpression - * @return string The SQL. - */ - public function walkComparisonExpression($compExpr) - { - $leftExpr = $compExpr->leftExpression; - $rightExpr = $compExpr->rightExpression; - $sql = ''; - - $sql .= ($leftExpr instanceof AST\Node) - ? $leftExpr->dispatch($this) - : (is_numeric($leftExpr) ? $leftExpr : $this->_conn->quote($leftExpr)); - - $sql .= ' ' . $compExpr->operator . ' '; - - $sql .= ($rightExpr instanceof AST\Node) - ? $rightExpr->dispatch($this) - : (is_numeric($rightExpr) ? $rightExpr : $this->_conn->quote($rightExpr)); - - return $sql; - } - - /** - * Walks down an InputParameter AST node, thereby generating the appropriate SQL. - * - * @param InputParameter - * @return string The SQL. - */ - public function walkInputParameter($inputParam) - { - $this->_parserResult->addParameterMapping($inputParam->name, $this->_sqlParamIndex++); - - return '?'; - } - - /** - * Walks down an ArithmeticExpression AST node, thereby generating the appropriate SQL. - * - * @param ArithmeticExpression - * @return string The SQL. - */ - public function walkArithmeticExpression($arithmeticExpr) - { - return ($arithmeticExpr->isSimpleArithmeticExpression()) - ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; - } - - /** - * Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL. - * - * @param SimpleArithmeticExpression - * @return string The SQL. - */ - public function walkSimpleArithmeticExpression($simpleArithmeticExpr) - { - if ( ! ($simpleArithmeticExpr instanceof AST\SimpleArithmeticExpression)) { - return $this->walkArithmeticTerm($simpleArithmeticExpr); - } - - return implode(' ', array_map(array($this, 'walkArithmeticTerm'), $simpleArithmeticExpr->arithmeticTerms)); - } - - /** - * Walks down an ArithmeticTerm AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - public function walkArithmeticTerm($term) - { - if (is_string($term)) { - return (isset($this->_queryComponents[$term])) - ? $this->walkResultVariable($this->_queryComponents[$term]['token']['value']) - : $term; - } - - // Phase 2 AST optimization: Skip processment of ArithmeticTerm - // if only one ArithmeticFactor is defined - if ( ! ($term instanceof AST\ArithmeticTerm)) { - return $this->walkArithmeticFactor($term); - } - - return implode(' ', array_map(array($this, 'walkArithmeticFactor'), $term->arithmeticFactors)); - } - - /** - * Walks down an ArithmeticFactor that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - public function walkArithmeticFactor($factor) - { - if (is_string($factor)) { - return $factor; - } - - // Phase 2 AST optimization: Skip processment of ArithmeticFactor - // if only one ArithmeticPrimary is defined - if ( ! ($factor instanceof AST\ArithmeticFactor)) { - return $this->walkArithmeticPrimary($factor); - } - - $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); - - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); - } - - /** - * Walks down an ArithmeticPrimary that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - public function walkArithmeticPrimary($primary) - { - if ($primary instanceof AST\SimpleArithmeticExpression) { - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; - } - - if ($primary instanceof AST\Node) { - return $primary->dispatch($this); - } - - return $this->walkEntityIdentificationVariable($primary); - } - - /** - * Walks down a StringPrimary that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - public function walkStringPrimary($stringPrimary) - { - return (is_string($stringPrimary)) - ? $this->_conn->quote($stringPrimary) - : $stringPrimary->dispatch($this); - } - - /** - * Walks down a ResultVriable that represents an AST node, thereby generating the appropriate SQL. - * - * @param string $resultVariable - * @return string The SQL. - */ - public function walkResultVariable($resultVariable) - { - $resultAlias = $this->_scalarResultAliasMap[$resultVariable]; - - if (is_array($resultAlias)) { - return implode(', ', $resultAlias); - } - - return $resultAlias; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/TreeWalker.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/TreeWalker.php deleted file mode 100644 index 8462898..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/TreeWalker.php +++ /dev/null @@ -1,411 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query; - -/** - * Interface for walkers of DQL ASTs (abstract syntax trees). - * - * @author Roman Borschel - * @since 2.0 - */ -interface TreeWalker -{ - /** - * Initializes TreeWalker with important information about the ASTs to be walked - * - * @param Query $query The parsed Query. - * @param ParserResult $parserResult The result of the parsing process. - * @param array $queryComponents Query components (symbol table) - */ - public function __construct($query, $parserResult, array $queryComponents); - - /** - * Walks down a SelectStatement AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. - */ - function walkSelectStatement(AST\SelectStatement $AST); - - /** - * Walks down a SelectClause AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. - */ - function walkSelectClause($selectClause); - - /** - * Walks down a FromClause AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. - */ - function walkFromClause($fromClause); - - /** - * Walks down a FunctionNode AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. - */ - function walkFunction($function); - - /** - * Walks down an OrderByClause AST node, thereby generating the appropriate SQL. - * - * @param OrderByClause - * @return string The SQL. - */ - function walkOrderByClause($orderByClause); - - /** - * Walks down an OrderByItem AST node, thereby generating the appropriate SQL. - * - * @param OrderByItem - * @return string The SQL. - */ - function walkOrderByItem($orderByItem); - - /** - * Walks down a HavingClause AST node, thereby generating the appropriate SQL. - * - * @param HavingClause - * @return string The SQL. - */ - function walkHavingClause($havingClause); - - /** - * Walks down a JoinVariableDeclaration AST node and creates the corresponding SQL. - * - * @param JoinVariableDeclaration $joinVarDecl - * @return string The SQL. - */ - function walkJoinVariableDeclaration($joinVarDecl); - - /** - * Walks down a SelectExpression AST node and generates the corresponding SQL. - * - * @param SelectExpression $selectExpression - * @return string The SQL. - */ - function walkSelectExpression($selectExpression); - - /** - * Walks down a QuantifiedExpression AST node, thereby generating the appropriate SQL. - * - * @param QuantifiedExpression - * @return string The SQL. - */ - function walkQuantifiedExpression($qExpr); - - /** - * Walks down a Subselect AST node, thereby generating the appropriate SQL. - * - * @param Subselect - * @return string The SQL. - */ - function walkSubselect($subselect); - - /** - * Walks down a SubselectFromClause AST node, thereby generating the appropriate SQL. - * - * @param SubselectFromClause - * @return string The SQL. - */ - function walkSubselectFromClause($subselectFromClause); - - /** - * Walks down a SimpleSelectClause AST node, thereby generating the appropriate SQL. - * - * @param SimpleSelectClause - * @return string The SQL. - */ - function walkSimpleSelectClause($simpleSelectClause); - - /** - * Walks down a SimpleSelectExpression AST node, thereby generating the appropriate SQL. - * - * @param SimpleSelectExpression - * @return string The SQL. - */ - function walkSimpleSelectExpression($simpleSelectExpression); - - /** - * Walks down an AggregateExpression AST node, thereby generating the appropriate SQL. - * - * @param AggregateExpression - * @return string The SQL. - */ - function walkAggregateExpression($aggExpression); - - /** - * Walks down a GroupByClause AST node, thereby generating the appropriate SQL. - * - * @param GroupByClause - * @return string The SQL. - */ - function walkGroupByClause($groupByClause); - - /** - * Walks down a GroupByItem AST node, thereby generating the appropriate SQL. - * - * @param GroupByItem - * @return string The SQL. - */ - function walkGroupByItem($groupByItem); - - /** - * Walks down an UpdateStatement AST node, thereby generating the appropriate SQL. - * - * @param UpdateStatement - * @return string The SQL. - */ - function walkUpdateStatement(AST\UpdateStatement $AST); - - /** - * Walks down a DeleteStatement AST node, thereby generating the appropriate SQL. - * - * @param DeleteStatement - * @return string The SQL. - */ - function walkDeleteStatement(AST\DeleteStatement $AST); - - /** - * Walks down a DeleteClause AST node, thereby generating the appropriate SQL. - * - * @param DeleteClause - * @return string The SQL. - */ - function walkDeleteClause(AST\DeleteClause $deleteClause); - - /** - * Walks down an UpdateClause AST node, thereby generating the appropriate SQL. - * - * @param UpdateClause - * @return string The SQL. - */ - function walkUpdateClause($updateClause); - - /** - * Walks down an UpdateItem AST node, thereby generating the appropriate SQL. - * - * @param UpdateItem - * @return string The SQL. - */ - function walkUpdateItem($updateItem); - - /** - * Walks down a WhereClause AST node, thereby generating the appropriate SQL. - * - * @param WhereClause - * @return string The SQL. - */ - function walkWhereClause($whereClause); - - /** - * Walks down a ConditionalExpression AST node, thereby generating the appropriate SQL. - * - * @param ConditionalExpression - * @return string The SQL. - */ - function walkConditionalExpression($condExpr); - - /** - * Walks down a ConditionalTerm AST node, thereby generating the appropriate SQL. - * - * @param ConditionalTerm - * @return string The SQL. - */ - function walkConditionalTerm($condTerm); - - /** - * Walks down a ConditionalFactor AST node, thereby generating the appropriate SQL. - * - * @param ConditionalFactor - * @return string The SQL. - */ - function walkConditionalFactor($factor); - - /** - * Walks down a ConditionalPrimary AST node, thereby generating the appropriate SQL. - * - * @param ConditionalPrimary - * @return string The SQL. - */ - function walkConditionalPrimary($primary); - - /** - * Walks down an ExistsExpression AST node, thereby generating the appropriate SQL. - * - * @param ExistsExpression - * @return string The SQL. - */ - function walkExistsExpression($existsExpr); - - /** - * Walks down a CollectionMemberExpression AST node, thereby generating the appropriate SQL. - * - * @param CollectionMemberExpression - * @return string The SQL. - */ - function walkCollectionMemberExpression($collMemberExpr); - - /** - * Walks down an EmptyCollectionComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param EmptyCollectionComparisonExpression - * @return string The SQL. - */ - function walkEmptyCollectionComparisonExpression($emptyCollCompExpr); - - /** - * Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param NullComparisonExpression - * @return string The SQL. - */ - function walkNullComparisonExpression($nullCompExpr); - - /** - * Walks down an InExpression AST node, thereby generating the appropriate SQL. - * - * @param InExpression - * @return string The SQL. - */ - function walkInExpression($inExpr); - - /** - * Walks down an InstanceOfExpression AST node, thereby generating the appropriate SQL. - * - * @param InstanceOfExpression - * @return string The SQL. - */ - function walkInstanceOfExpression($instanceOfExpr); - - /** - * Walks down a literal that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - function walkLiteral($literal); - - /** - * Walks down a BetweenExpression AST node, thereby generating the appropriate SQL. - * - * @param BetweenExpression - * @return string The SQL. - */ - function walkBetweenExpression($betweenExpr); - - /** - * Walks down a LikeExpression AST node, thereby generating the appropriate SQL. - * - * @param LikeExpression - * @return string The SQL. - */ - function walkLikeExpression($likeExpr); - - /** - * Walks down a StateFieldPathExpression AST node, thereby generating the appropriate SQL. - * - * @param StateFieldPathExpression - * @return string The SQL. - */ - function walkStateFieldPathExpression($stateFieldPathExpression); - - /** - * Walks down a ComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param ComparisonExpression - * @return string The SQL. - */ - function walkComparisonExpression($compExpr); - - /** - * Walks down an InputParameter AST node, thereby generating the appropriate SQL. - * - * @param InputParameter - * @return string The SQL. - */ - function walkInputParameter($inputParam); - - /** - * Walks down an ArithmeticExpression AST node, thereby generating the appropriate SQL. - * - * @param ArithmeticExpression - * @return string The SQL. - */ - function walkArithmeticExpression($arithmeticExpr); - - /** - * Walks down an ArithmeticTerm AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - function walkArithmeticTerm($term); - - /** - * Walks down a StringPrimary that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - function walkStringPrimary($stringPrimary); - - /** - * Walks down an ArithmeticFactor that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - function walkArithmeticFactor($factor); - - /** - * Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL. - * - * @param SimpleArithmeticExpression - * @return string The SQL. - */ - function walkSimpleArithmeticExpression($simpleArithmeticExpr); - - /** - * Walks down an PathExpression AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - function walkPathExpression($pathExpr); - - /** - * Walks down an ResultVariable AST node, thereby generating the appropriate SQL. - * - * @param string $resultVariable - * @return string The SQL. - */ - function walkResultVariable($resultVariable); - - /** - * Gets an executor that can be used to execute the result of this walker. - * - * @return AbstractExecutor - */ - function getExecutor($AST); -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php deleted file mode 100644 index 5907aa9..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php +++ /dev/null @@ -1,445 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query; - -/** - * An adapter implementation of the TreeWalker interface. The methods in this class - * are empty. This class exists as convenience for creating tree walkers. - * - * @author Roman Borschel - * @since 2.0 - */ -abstract class TreeWalkerAdapter implements TreeWalker -{ - private $_query; - private $_parserResult; - private $_queryComponents; - - /** - * {@inheritdoc} - */ - public function __construct($query, $parserResult, array $queryComponents) - { - $this->_query = $query; - $this->_parserResult = $parserResult; - $this->_queryComponents = $queryComponents; - } - - /** - * @return array - */ - protected function _getQueryComponents() - { - return $this->_queryComponents; - } - - /** - * Retrieve Query Instance reponsible for the current walkers execution. - * - * @return \Doctrine\ORM\Query - */ - protected function _getQuery() - { - return $this->_query; - } - - /** - * Retrieve ParserResult - * - * @return \Doctrine\ORM\Query\ParserResult - */ - protected function _getParserResult() - { - return $this->_parserResult; - } - - /** - * Walks down a SelectStatement AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. - */ - public function walkSelectStatement(AST\SelectStatement $AST) {} - - /** - * Walks down a SelectClause AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. - */ - public function walkSelectClause($selectClause) {} - - /** - * Walks down a FromClause AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. - */ - public function walkFromClause($fromClause) {} - - /** - * Walks down a FunctionNode AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. - */ - public function walkFunction($function) {} - - /** - * Walks down an OrderByClause AST node, thereby generating the appropriate SQL. - * - * @param OrderByClause - * @return string The SQL. - */ - public function walkOrderByClause($orderByClause) {} - - /** - * Walks down an OrderByItem AST node, thereby generating the appropriate SQL. - * - * @param OrderByItem - * @return string The SQL. - */ - public function walkOrderByItem($orderByItem) {} - - /** - * Walks down a HavingClause AST node, thereby generating the appropriate SQL. - * - * @param HavingClause - * @return string The SQL. - */ - public function walkHavingClause($havingClause) {} - - /** - * Walks down a JoinVariableDeclaration AST node and creates the corresponding SQL. - * - * @param JoinVariableDeclaration $joinVarDecl - * @return string The SQL. - */ - public function walkJoinVariableDeclaration($joinVarDecl) {} - - /** - * Walks down a SelectExpression AST node and generates the corresponding SQL. - * - * @param SelectExpression $selectExpression - * @return string The SQL. - */ - public function walkSelectExpression($selectExpression) {} - - /** - * Walks down a QuantifiedExpression AST node, thereby generating the appropriate SQL. - * - * @param QuantifiedExpression - * @return string The SQL. - */ - public function walkQuantifiedExpression($qExpr) {} - - /** - * Walks down a Subselect AST node, thereby generating the appropriate SQL. - * - * @param Subselect - * @return string The SQL. - */ - public function walkSubselect($subselect) {} - - /** - * Walks down a SubselectFromClause AST node, thereby generating the appropriate SQL. - * - * @param SubselectFromClause - * @return string The SQL. - */ - public function walkSubselectFromClause($subselectFromClause) {} - - /** - * Walks down a SimpleSelectClause AST node, thereby generating the appropriate SQL. - * - * @param SimpleSelectClause - * @return string The SQL. - */ - public function walkSimpleSelectClause($simpleSelectClause) {} - - /** - * Walks down a SimpleSelectExpression AST node, thereby generating the appropriate SQL. - * - * @param SimpleSelectExpression - * @return string The SQL. - */ - public function walkSimpleSelectExpression($simpleSelectExpression) {} - - /** - * Walks down an AggregateExpression AST node, thereby generating the appropriate SQL. - * - * @param AggregateExpression - * @return string The SQL. - */ - public function walkAggregateExpression($aggExpression) {} - - /** - * Walks down a GroupByClause AST node, thereby generating the appropriate SQL. - * - * @param GroupByClause - * @return string The SQL. - */ - public function walkGroupByClause($groupByClause) {} - - /** - * Walks down a GroupByItem AST node, thereby generating the appropriate SQL. - * - * @param GroupByItem - * @return string The SQL. - */ - public function walkGroupByItem($groupByItem) {} - - /** - * Walks down an UpdateStatement AST node, thereby generating the appropriate SQL. - * - * @param UpdateStatement - * @return string The SQL. - */ - public function walkUpdateStatement(AST\UpdateStatement $AST) {} - - /** - * Walks down a DeleteStatement AST node, thereby generating the appropriate SQL. - * - * @param DeleteStatement - * @return string The SQL. - */ - public function walkDeleteStatement(AST\DeleteStatement $AST) {} - - /** - * Walks down a DeleteClause AST node, thereby generating the appropriate SQL. - * - * @param DeleteClause - * @return string The SQL. - */ - public function walkDeleteClause(AST\DeleteClause $deleteClause) {} - - /** - * Walks down an UpdateClause AST node, thereby generating the appropriate SQL. - * - * @param UpdateClause - * @return string The SQL. - */ - public function walkUpdateClause($updateClause) {} - - /** - * Walks down an UpdateItem AST node, thereby generating the appropriate SQL. - * - * @param UpdateItem - * @return string The SQL. - */ - public function walkUpdateItem($updateItem) {} - - /** - * Walks down a WhereClause AST node, thereby generating the appropriate SQL. - * - * @param WhereClause - * @return string The SQL. - */ - public function walkWhereClause($whereClause) {} - - /** - * Walks down a ConditionalExpression AST node, thereby generating the appropriate SQL. - * - * @param ConditionalExpression - * @return string The SQL. - */ - public function walkConditionalExpression($condExpr) {} - - /** - * Walks down a ConditionalTerm AST node, thereby generating the appropriate SQL. - * - * @param ConditionalTerm - * @return string The SQL. - */ - public function walkConditionalTerm($condTerm) {} - - /** - * Walks down a ConditionalFactor AST node, thereby generating the appropriate SQL. - * - * @param ConditionalFactor - * @return string The SQL. - */ - public function walkConditionalFactor($factor) {} - - /** - * Walks down a ConditionalPrimary AST node, thereby generating the appropriate SQL. - * - * @param ConditionalPrimary - * @return string The SQL. - */ - public function walkConditionalPrimary($primary) {} - - /** - * Walks down an ExistsExpression AST node, thereby generating the appropriate SQL. - * - * @param ExistsExpression - * @return string The SQL. - */ - public function walkExistsExpression($existsExpr) {} - - /** - * Walks down a CollectionMemberExpression AST node, thereby generating the appropriate SQL. - * - * @param CollectionMemberExpression - * @return string The SQL. - */ - public function walkCollectionMemberExpression($collMemberExpr) {} - - /** - * Walks down an EmptyCollectionComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param EmptyCollectionComparisonExpression - * @return string The SQL. - */ - public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr) {} - - /** - * Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param NullComparisonExpression - * @return string The SQL. - */ - public function walkNullComparisonExpression($nullCompExpr) {} - - /** - * Walks down an InExpression AST node, thereby generating the appropriate SQL. - * - * @param InExpression - * @return string The SQL. - */ - public function walkInExpression($inExpr) {} - - /** - * Walks down an InstanceOfExpression AST node, thereby generating the appropriate SQL. - * - * @param InstanceOfExpression - * @return string The SQL. - */ - function walkInstanceOfExpression($instanceOfExpr) {} - - /** - * Walks down a literal that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - public function walkLiteral($literal) {} - - /** - * Walks down a BetweenExpression AST node, thereby generating the appropriate SQL. - * - * @param BetweenExpression - * @return string The SQL. - */ - public function walkBetweenExpression($betweenExpr) {} - - /** - * Walks down a LikeExpression AST node, thereby generating the appropriate SQL. - * - * @param LikeExpression - * @return string The SQL. - */ - public function walkLikeExpression($likeExpr) {} - - /** - * Walks down a StateFieldPathExpression AST node, thereby generating the appropriate SQL. - * - * @param StateFieldPathExpression - * @return string The SQL. - */ - public function walkStateFieldPathExpression($stateFieldPathExpression) {} - - /** - * Walks down a ComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param ComparisonExpression - * @return string The SQL. - */ - public function walkComparisonExpression($compExpr) {} - - /** - * Walks down an InputParameter AST node, thereby generating the appropriate SQL. - * - * @param InputParameter - * @return string The SQL. - */ - public function walkInputParameter($inputParam) {} - - /** - * Walks down an ArithmeticExpression AST node, thereby generating the appropriate SQL. - * - * @param ArithmeticExpression - * @return string The SQL. - */ - public function walkArithmeticExpression($arithmeticExpr) {} - - /** - * Walks down an ArithmeticTerm AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - public function walkArithmeticTerm($term) {} - - /** - * Walks down a StringPrimary that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - public function walkStringPrimary($stringPrimary) {} - - /** - * Walks down an ArithmeticFactor that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - public function walkArithmeticFactor($factor) {} - - /** - * Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL. - * - * @param SimpleArithmeticExpression - * @return string The SQL. - */ - public function walkSimpleArithmeticExpression($simpleArithmeticExpr) {} - - /** - * Walks down an PathExpression AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - public function walkPathExpression($pathExpr) {} - - /** - * Walks down an ResultVariable AST node, thereby generating the appropriate SQL. - * - * @param string $resultVariable - * @return string The SQL. - */ - public function walkResultVariable($resultVariable) {} - - /** - * Gets an executor that can be used to execute the result of this walker. - * - * @return AbstractExecutor - */ - public function getExecutor($AST) {} -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/TreeWalkerChain.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/TreeWalkerChain.php deleted file mode 100644 index d3891a1..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/TreeWalkerChain.php +++ /dev/null @@ -1,664 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Query; - -/** - * Represents a chain of tree walkers that modify an AST and finally emit output. - * Only the last walker in the chain can emit output. Any previous walkers can modify - * the AST to influence the final output produced by the last walker. - * - * @author Roman Borschel - * @since 2.0 - */ -class TreeWalkerChain implements TreeWalker -{ - /** The tree walkers. */ - private $_walkers = array(); - /** The original Query. */ - private $_query; - /** The ParserResult of the original query that was produced by the Parser. */ - private $_parserResult; - /** The query components of the original query (the "symbol table") that was produced by the Parser. */ - private $_queryComponents; - - /** - * @inheritdoc - */ - public function __construct($query, $parserResult, array $queryComponents) - { - $this->_query = $query; - $this->_parserResult = $parserResult; - $this->_queryComponents = $queryComponents; - } - - /** - * Adds a tree walker to the chain. - * - * @param string $walkerClass The class of the walker to instantiate. - */ - public function addTreeWalker($walkerClass) - { - $this->_walkers[] = new $walkerClass($this->_query, $this->_parserResult, $this->_queryComponents); - } - - /** - * Walks down a SelectStatement AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. - */ - public function walkSelectStatement(AST\SelectStatement $AST) - { - foreach ($this->_walkers as $walker) { - $walker->walkSelectStatement($AST); - } - } - - /** - * Walks down a SelectClause AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. - */ - public function walkSelectClause($selectClause) - { - foreach ($this->_walkers as $walker) { - $walker->walkSelectClause($selectClause); - } - } - - /** - * Walks down a FromClause AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. - */ - public function walkFromClause($fromClause) - { - foreach ($this->_walkers as $walker) { - $walker->walkFromClause($fromClause); - } - } - - /** - * Walks down a FunctionNode AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. - */ - public function walkFunction($function) - { - foreach ($this->_walkers as $walker) { - $walker->walkFunction($function); - } - } - - /** - * Walks down an OrderByClause AST node, thereby generating the appropriate SQL. - * - * @param OrderByClause - * @return string The SQL. - */ - public function walkOrderByClause($orderByClause) - { - foreach ($this->_walkers as $walker) { - $walker->walkOrderByClause($orderByClause); - } - } - - /** - * Walks down an OrderByItem AST node, thereby generating the appropriate SQL. - * - * @param OrderByItem - * @return string The SQL. - */ - public function walkOrderByItem($orderByItem) - { - foreach ($this->_walkers as $walker) { - $walker->walkOrderByItem($orderByItem); - } - } - - /** - * Walks down a HavingClause AST node, thereby generating the appropriate SQL. - * - * @param HavingClause - * @return string The SQL. - */ - public function walkHavingClause($havingClause) - { - foreach ($this->_walkers as $walker) { - $walker->walkHavingClause($havingClause); - } - } - - /** - * Walks down a JoinVariableDeclaration AST node and creates the corresponding SQL. - * - * @param JoinVariableDeclaration $joinVarDecl - * @return string The SQL. - */ - public function walkJoinVariableDeclaration($joinVarDecl) - { - foreach ($this->_walkers as $walker) { - $walker->walkJoinVariableDeclaration($joinVarDecl); - } - } - - /** - * Walks down a SelectExpression AST node and generates the corresponding SQL. - * - * @param SelectExpression $selectExpression - * @return string The SQL. - */ - public function walkSelectExpression($selectExpression) - { - foreach ($this->_walkers as $walker) { - $walker->walkSelectExpression($selectExpression); - } - } - - /** - * Walks down a QuantifiedExpression AST node, thereby generating the appropriate SQL. - * - * @param QuantifiedExpression - * @return string The SQL. - */ - public function walkQuantifiedExpression($qExpr) - { - foreach ($this->_walkers as $walker) { - $walker->walkQuantifiedExpression($qExpr); - } - } - - /** - * Walks down a Subselect AST node, thereby generating the appropriate SQL. - * - * @param Subselect - * @return string The SQL. - */ - public function walkSubselect($subselect) - { - foreach ($this->_walkers as $walker) { - $walker->walkSubselect($subselect); - } - } - - /** - * Walks down a SubselectFromClause AST node, thereby generating the appropriate SQL. - * - * @param SubselectFromClause - * @return string The SQL. - */ - public function walkSubselectFromClause($subselectFromClause) - { - foreach ($this->_walkers as $walker) { - $walker->walkSubselectFromClause($subselectFromClause); - } - } - - /** - * Walks down a SimpleSelectClause AST node, thereby generating the appropriate SQL. - * - * @param SimpleSelectClause - * @return string The SQL. - */ - public function walkSimpleSelectClause($simpleSelectClause) - { - foreach ($this->_walkers as $walker) { - $walker->walkSimpleSelectClause($simpleSelectClause); - } - } - - /** - * Walks down a SimpleSelectExpression AST node, thereby generating the appropriate SQL. - * - * @param SimpleSelectExpression - * @return string The SQL. - */ - public function walkSimpleSelectExpression($simpleSelectExpression) - { - foreach ($this->_walkers as $walker) { - $walker->walkSimpleSelectExpression($simpleSelectExpression); - } - } - - /** - * Walks down an AggregateExpression AST node, thereby generating the appropriate SQL. - * - * @param AggregateExpression - * @return string The SQL. - */ - public function walkAggregateExpression($aggExpression) - { - foreach ($this->_walkers as $walker) { - $walker->walkAggregateExpression($aggExpression); - } - } - - /** - * Walks down a GroupByClause AST node, thereby generating the appropriate SQL. - * - * @param GroupByClause - * @return string The SQL. - */ - public function walkGroupByClause($groupByClause) - { - foreach ($this->_walkers as $walker) { - $walker->walkGroupByClause($groupByClause); - } - } - - /** - * Walks down a GroupByItem AST node, thereby generating the appropriate SQL. - * - * @param GroupByItem - * @return string The SQL. - */ - public function walkGroupByItem($groupByItem) - { - foreach ($this->_walkers as $walker) { - $walker->walkGroupByItem($groupByItem); - } - } - - /** - * Walks down an UpdateStatement AST node, thereby generating the appropriate SQL. - * - * @param UpdateStatement - * @return string The SQL. - */ - public function walkUpdateStatement(AST\UpdateStatement $AST) - { - foreach ($this->_walkers as $walker) { - $walker->walkUpdateStatement($AST); - } - } - - /** - * Walks down a DeleteStatement AST node, thereby generating the appropriate SQL. - * - * @param DeleteStatement - * @return string The SQL. - */ - public function walkDeleteStatement(AST\DeleteStatement $AST) - { - foreach ($this->_walkers as $walker) { - $walker->walkDeleteStatement($AST); - } - } - - /** - * Walks down a DeleteClause AST node, thereby generating the appropriate SQL. - * - * @param DeleteClause - * @return string The SQL. - */ - public function walkDeleteClause(AST\DeleteClause $deleteClause) - { - foreach ($this->_walkers as $walker) { - $walker->walkDeleteClause($deleteClause); - } - } - - /** - * Walks down an UpdateClause AST node, thereby generating the appropriate SQL. - * - * @param UpdateClause - * @return string The SQL. - */ - public function walkUpdateClause($updateClause) - { - foreach ($this->_walkers as $walker) { - $walker->walkUpdateClause($updateClause); - } - } - - /** - * Walks down an UpdateItem AST node, thereby generating the appropriate SQL. - * - * @param UpdateItem - * @return string The SQL. - */ - public function walkUpdateItem($updateItem) - { - foreach ($this->_walkers as $walker) { - $walker->walkUpdateItem($updateItem); - } - } - - /** - * Walks down a WhereClause AST node, thereby generating the appropriate SQL. - * - * @param WhereClause - * @return string The SQL. - */ - public function walkWhereClause($whereClause) - { - foreach ($this->_walkers as $walker) { - $walker->walkWhereClause($whereClause); - } - } - - /** - * Walks down a ConditionalExpression AST node, thereby generating the appropriate SQL. - * - * @param ConditionalExpression - * @return string The SQL. - */ - public function walkConditionalExpression($condExpr) - { - foreach ($this->_walkers as $walker) { - $walker->walkConditionalExpression($condExpr); - } - } - - /** - * Walks down a ConditionalTerm AST node, thereby generating the appropriate SQL. - * - * @param ConditionalTerm - * @return string The SQL. - */ - public function walkConditionalTerm($condTerm) - { - foreach ($this->_walkers as $walker) { - $walker->walkConditionalTerm($condTerm); - } - } - - /** - * Walks down a ConditionalFactor AST node, thereby generating the appropriate SQL. - * - * @param ConditionalFactor - * @return string The SQL. - */ - public function walkConditionalFactor($factor) - { - foreach ($this->_walkers as $walker) { - $walker->walkConditionalFactor($factor); - } - } - - /** - * Walks down a ConditionalPrimary AST node, thereby generating the appropriate SQL. - * - * @param ConditionalPrimary - * @return string The SQL. - */ - public function walkConditionalPrimary($condPrimary) - { - foreach ($this->_walkers as $walker) { - $walker->walkConditionalPrimary($condPrimary); - } - } - - /** - * Walks down an ExistsExpression AST node, thereby generating the appropriate SQL. - * - * @param ExistsExpression - * @return string The SQL. - */ - public function walkExistsExpression($existsExpr) - { - foreach ($this->_walkers as $walker) { - $walker->walkExistsExpression($existsExpr); - } - } - - /** - * Walks down a CollectionMemberExpression AST node, thereby generating the appropriate SQL. - * - * @param CollectionMemberExpression - * @return string The SQL. - */ - public function walkCollectionMemberExpression($collMemberExpr) - { - foreach ($this->_walkers as $walker) { - $walker->walkCollectionMemberExpression($collMemberExpr); - } - } - - /** - * Walks down an EmptyCollectionComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param EmptyCollectionComparisonExpression - * @return string The SQL. - */ - public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr) - { - foreach ($this->_walkers as $walker) { - $walker->walkEmptyCollectionComparisonExpression($emptyCollCompExpr); - } - } - - /** - * Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param NullComparisonExpression - * @return string The SQL. - */ - public function walkNullComparisonExpression($nullCompExpr) - { - foreach ($this->_walkers as $walker) { - $walker->walkNullComparisonExpression($nullCompExpr); - } - } - - /** - * Walks down an InExpression AST node, thereby generating the appropriate SQL. - * - * @param InExpression - * @return string The SQL. - */ - public function walkInExpression($inExpr) - { - foreach ($this->_walkers as $walker) { - $walker->walkInExpression($inExpr); - } - } - - /** - * Walks down an InstanceOfExpression AST node, thereby generating the appropriate SQL. - * - * @param InstanceOfExpression - * @return string The SQL. - */ - function walkInstanceOfExpression($instanceOfExpr) - { - foreach ($this->_walkers as $walker) { - $walker->walkInstanceOfExpression($instanceOfExpr); - } - } - - /** - * Walks down a literal that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - public function walkLiteral($literal) - { - foreach ($this->_walkers as $walker) { - $walker->walkLiteral($literal); - } - } - - /** - * Walks down a BetweenExpression AST node, thereby generating the appropriate SQL. - * - * @param BetweenExpression - * @return string The SQL. - */ - public function walkBetweenExpression($betweenExpr) - { - foreach ($this->_walkers as $walker) { - $walker->walkBetweenExpression($betweenExpr); - } - } - - /** - * Walks down a LikeExpression AST node, thereby generating the appropriate SQL. - * - * @param LikeExpression - * @return string The SQL. - */ - public function walkLikeExpression($likeExpr) - { - foreach ($this->_walkers as $walker) { - $walker->walkLikeExpression($likeExpr); - } - } - - /** - * Walks down a StateFieldPathExpression AST node, thereby generating the appropriate SQL. - * - * @param StateFieldPathExpression - * @return string The SQL. - */ - public function walkStateFieldPathExpression($stateFieldPathExpression) - { - foreach ($this->_walkers as $walker) { - $walker->walkStateFieldPathExpression($stateFieldPathExpression); - } - } - - /** - * Walks down a ComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param ComparisonExpression - * @return string The SQL. - */ - public function walkComparisonExpression($compExpr) - { - foreach ($this->_walkers as $walker) { - $walker->walkComparisonExpression($compExpr); - } - } - - /** - * Walks down an InputParameter AST node, thereby generating the appropriate SQL. - * - * @param InputParameter - * @return string The SQL. - */ - public function walkInputParameter($inputParam) - { - foreach ($this->_walkers as $walker) { - $walker->walkInputParameter($inputParam); - } - } - - /** - * Walks down an ArithmeticExpression AST node, thereby generating the appropriate SQL. - * - * @param ArithmeticExpression - * @return string The SQL. - */ - public function walkArithmeticExpression($arithmeticExpr) - { - foreach ($this->_walkers as $walker) { - $walker->walkArithmeticExpression($arithmeticExpr); - } - } - - /** - * Walks down an ArithmeticTerm AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - public function walkArithmeticTerm($term) - { - foreach ($this->_walkers as $walker) { - $walker->walkArithmeticTerm($term); - } - } - - /** - * Walks down a StringPrimary that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - public function walkStringPrimary($stringPrimary) - { - foreach ($this->_walkers as $walker) { - $walker->walkStringPrimary($stringPrimary); - } - } - - /** - * Walks down an ArithmeticFactor that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - public function walkArithmeticFactor($factor) - { - foreach ($this->_walkers as $walker) { - $walker->walkArithmeticFactor($factor); - } - } - - /** - * Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL. - * - * @param SimpleArithmeticExpression - * @return string The SQL. - */ - public function walkSimpleArithmeticExpression($simpleArithmeticExpr) - { - foreach ($this->_walkers as $walker) { - $walker->walkSimpleArithmeticExpression($simpleArithmeticExpr); - } - } - - /** - * Walks down an PathExpression AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. - */ - public function walkPathExpression($pathExpr) - { - foreach ($this->_walkers as $walker) { - $walker->walkPathExpression($pathExpr); - } - } - - /** - * Walks down an ResultVariable AST node, thereby generating the appropriate SQL. - * - * @param string $resultVariable - * @return string The SQL. - */ - public function walkResultVariable($resultVariable) - { - foreach ($this->_walkers as $walker) { - $walker->walkResultVariable($resultVariable); - } - } - - /** - * Gets an executor that can be used to execute the result of this walker. - * - * @return AbstractExecutor - */ - public function getExecutor($AST) - {} -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/QueryBuilder.php b/vendor/doctrine/orm/lib/Doctrine/ORM/QueryBuilder.php deleted file mode 100644 index 5212634..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/QueryBuilder.php +++ /dev/null @@ -1,1115 +0,0 @@ -. - */ - -namespace Doctrine\ORM; - -use Doctrine\ORM\Query\Expr; - -/** - * This class is responsible for building DQL query strings via an object oriented - * PHP interface. - * - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class QueryBuilder -{ - /* The query types. */ - const SELECT = 0; - const DELETE = 1; - const UPDATE = 2; - - /** The builder states. */ - const STATE_DIRTY = 0; - const STATE_CLEAN = 1; - - /** - * @var EntityManager The EntityManager used by this QueryBuilder. - */ - private $_em; - - /** - * @var array The array of DQL parts collected. - */ - private $_dqlParts = array( - 'distinct' => false, - 'select' => array(), - 'from' => array(), - 'join' => array(), - 'set' => array(), - 'where' => null, - 'groupBy' => array(), - 'having' => null, - 'orderBy' => array() - ); - - /** - * @var integer The type of query this is. Can be select, update or delete. - */ - private $_type = self::SELECT; - - /** - * @var integer The state of the query object. Can be dirty or clean. - */ - private $_state = self::STATE_CLEAN; - - /** - * @var string The complete DQL string for this query. - */ - private $_dql; - - /** - * @var array The query parameters. - */ - private $_params = array(); - - /** - * @var array The parameter type map of this query. - */ - private $_paramTypes = array(); - - /** - * @var integer The index of the first result to retrieve. - */ - private $_firstResult = null; - - /** - * @var integer The maximum number of results to retrieve. - */ - private $_maxResults = null; - - /** - * Initializes a new QueryBuilder that uses the given EntityManager. - * - * @param EntityManager $em The EntityManager to use. - */ - public function __construct(EntityManager $em) - { - $this->_em = $em; - } - - /** - * Gets an ExpressionBuilder used for object-oriented construction of query expressions. - * This producer method is intended for convenient inline usage. Example: - * - * - * $qb = $em->createQueryBuilder() - * ->select('u') - * ->from('User', 'u') - * ->where($qb->expr()->eq('u.id', 1)); - * - * - * For more complex expression construction, consider storing the expression - * builder object in a local variable. - * - * @return Query\Expr - */ - public function expr() - { - return $this->_em->getExpressionBuilder(); - } - - /** - * Get the type of the currently built query. - * - * @return integer - */ - public function getType() - { - return $this->_type; - } - - /** - * Get the associated EntityManager for this query builder. - * - * @return EntityManager - */ - public function getEntityManager() - { - return $this->_em; - } - - /** - * Get the state of this query builder instance. - * - * @return integer Either QueryBuilder::STATE_DIRTY or QueryBuilder::STATE_CLEAN. - */ - public function getState() - { - return $this->_state; - } - - /** - * Get the complete DQL string formed by the current specifications of this QueryBuilder. - * - * - * $qb = $em->createQueryBuilder() - * ->select('u') - * ->from('User', 'u') - * echo $qb->getDql(); // SELECT u FROM User u - * - * - * @return string The DQL query string. - */ - public function getDQL() - { - if ($this->_dql !== null && $this->_state === self::STATE_CLEAN) { - return $this->_dql; - } - - $dql = ''; - - switch ($this->_type) { - case self::DELETE: - $dql = $this->_getDQLForDelete(); - break; - - case self::UPDATE: - $dql = $this->_getDQLForUpdate(); - break; - - case self::SELECT: - default: - $dql = $this->_getDQLForSelect(); - break; - } - - $this->_state = self::STATE_CLEAN; - $this->_dql = $dql; - - return $dql; - } - - /** - * Constructs a Query instance from the current specifications of the builder. - * - * - * $qb = $em->createQueryBuilder() - * ->select('u') - * ->from('User', 'u'); - * $q = $qb->getQuery(); - * $results = $q->execute(); - * - * - * @return Query - */ - public function getQuery() - { - return $this->_em->createQuery($this->getDQL()) - ->setParameters($this->_params, $this->_paramTypes) - ->setFirstResult($this->_firstResult) - ->setMaxResults($this->_maxResults); - } - - /** - * Gets the FIRST root alias of the query. This is the first entity alias involved - * in the construction of the query. - * - * - * $qb = $em->createQueryBuilder() - * ->select('u') - * ->from('User', 'u'); - * - * echo $qb->getRootAlias(); // u - * - * - * @deprecated Please use $qb->getRootAliases() instead. - * @return string $rootAlias - */ - public function getRootAlias() - { - $aliases = $this->getRootAliases(); - return $aliases[0]; - } - - /** - * Gets the root aliases of the query. This is the entity aliases involved - * in the construction of the query. - * - * - * $qb = $em->createQueryBuilder() - * ->select('u') - * ->from('User', 'u'); - * - * $qb->getRootAliases(); // array('u') - * - * - * @return array $rootAliases - */ - public function getRootAliases() - { - $aliases = array(); - - foreach ($this->_dqlParts['from'] as &$fromClause) { - if (is_string($fromClause)) { - $spacePos = strrpos($fromClause, ' '); - $from = substr($fromClause, 0, $spacePos); - $alias = substr($fromClause, $spacePos + 1); - - $fromClause = new Query\Expr\From($from, $alias); - } - - $aliases[] = $fromClause->getAlias(); - } - - return $aliases; - } - - /** - * Gets the root entities of the query. This is the entity aliases involved - * in the construction of the query. - * - * - * $qb = $em->createQueryBuilder() - * ->select('u') - * ->from('User', 'u'); - * - * $qb->getRootEntities(); // array('User') - * - * - * @return array $rootEntities - */ - public function getRootEntities() - { - $entities = array(); - - foreach ($this->_dqlParts['from'] as &$fromClause) { - if (is_string($fromClause)) { - $spacePos = strrpos($fromClause, ' '); - $from = substr($fromClause, 0, $spacePos); - $alias = substr($fromClause, $spacePos + 1); - - $fromClause = new Query\Expr\From($from, $alias); - } - - $entities[] = $fromClause->getFrom(); - } - - return $entities; - } - - /** - * Sets a query parameter for the query being constructed. - * - * - * $qb = $em->createQueryBuilder() - * ->select('u') - * ->from('User', 'u') - * ->where('u.id = :user_id') - * ->setParameter('user_id', 1); - * - * - * @param string|integer $key The parameter position or name. - * @param mixed $value The parameter value. - * @param string|null $type PDO::PARAM_* or \Doctrine\DBAL\Types\Type::* constant - * @return QueryBuilder This QueryBuilder instance. - */ - public function setParameter($key, $value, $type = null) - { - $key = trim($key, ':'); - - if ($type === null) { - $type = Query\ParameterTypeInferer::inferType($value); - } - - $this->_paramTypes[$key] = $type; - $this->_params[$key] = $value; - - return $this; - } - - /** - * Sets a collection of query parameters for the query being constructed. - * - * - * $qb = $em->createQueryBuilder() - * ->select('u') - * ->from('User', 'u') - * ->where('u.id = :user_id1 OR u.id = :user_id2') - * ->setParameters(array( - * 'user_id1' => 1, - * 'user_id2' => 2 - )); - * - * - * @param array $params The query parameters to set. - * @return QueryBuilder This QueryBuilder instance. - */ - public function setParameters(array $params, array $types = array()) - { - foreach ($params as $key => $value) { - $this->setParameter($key, $value, isset($types[$key]) ? $types[$key] : null); - } - - return $this; - } - - /** - * Gets all defined query parameters for the query being constructed. - * - * @return array The currently defined query parameters. - */ - public function getParameters() - { - return $this->_params; - } - - /** - * Gets a (previously set) query parameter of the query being constructed. - * - * @param mixed $key The key (index or name) of the bound parameter. - * @return mixed The value of the bound parameter. - */ - public function getParameter($key) - { - return isset($this->_params[$key]) ? $this->_params[$key] : null; - } - - /** - * Sets the position of the first result to retrieve (the "offset"). - * - * @param integer $firstResult The first result to return. - * @return QueryBuilder This QueryBuilder instance. - */ - public function setFirstResult($firstResult) - { - $this->_firstResult = $firstResult; - - return $this; - } - - /** - * Gets the position of the first result the query object was set to retrieve (the "offset"). - * Returns NULL if {@link setFirstResult} was not applied to this QueryBuilder. - * - * @return integer The position of the first result. - */ - public function getFirstResult() - { - return $this->_firstResult; - } - - /** - * Sets the maximum number of results to retrieve (the "limit"). - * - * @param integer $maxResults The maximum number of results to retrieve. - * @return QueryBuilder This QueryBuilder instance. - */ - public function setMaxResults($maxResults) - { - $this->_maxResults = $maxResults; - - return $this; - } - - /** - * Gets the maximum number of results the query object was set to retrieve (the "limit"). - * Returns NULL if {@link setMaxResults} was not applied to this query builder. - * - * @return integer Maximum number of results. - */ - public function getMaxResults() - { - return $this->_maxResults; - } - - /** - * Either appends to or replaces a single, generic query part. - * - * The available parts are: 'select', 'from', 'join', 'set', 'where', - * 'groupBy', 'having' and 'orderBy'. - * - * @param string $dqlPartName - * @param string $dqlPart - * @param string $append - * @return QueryBuilder This QueryBuilder instance. - */ - public function add($dqlPartName, $dqlPart, $append = false) - { - $isMultiple = is_array($this->_dqlParts[$dqlPartName]); - - // This is introduced for backwards compatibility reasons. - // TODO: Remove for 3.0 - if ($dqlPartName == 'join') { - $newDqlPart = array(); - foreach ($dqlPart AS $k => $v) { - if (is_numeric($k)) { - $newDqlPart[$this->getRootAlias()] = $v; - } else { - $newDqlPart[$k] = $v; - } - } - $dqlPart = $newDqlPart; - } - - if ($append && $isMultiple) { - if (is_array($dqlPart)) { - $key = key($dqlPart); - - $this->_dqlParts[$dqlPartName][$key][] = $dqlPart[$key]; - } else { - $this->_dqlParts[$dqlPartName][] = $dqlPart; - } - } else { - $this->_dqlParts[$dqlPartName] = ($isMultiple) ? array($dqlPart) : $dqlPart; - } - - $this->_state = self::STATE_DIRTY; - - return $this; - } - - /** - * Specifies an item that is to be returned in the query result. - * Replaces any previously specified selections, if any. - * - * - * $qb = $em->createQueryBuilder() - * ->select('u', 'p') - * ->from('User', 'u') - * ->leftJoin('u.Phonenumbers', 'p'); - * - * - * @param mixed $select The selection expressions. - * @return QueryBuilder This QueryBuilder instance. - */ - public function select($select = null) - { - $this->_type = self::SELECT; - - if (empty($select)) { - return $this; - } - - $selects = is_array($select) ? $select : func_get_args(); - - return $this->add('select', new Expr\Select($selects), false); - } - - /** - * Add a DISTINCT flag to this query. - * - * - * $qb = $em->createQueryBuilder() - * ->select('u') - * ->distinct() - * ->from('User', 'u'); - * - * - * @param bool - * @return QueryBuilder - */ - public function distinct($flag = true) - { - $this->_dqlParts['distinct'] = (bool) $flag; - return $this; - } - - /** - * Adds an item that is to be returned in the query result. - * - * - * $qb = $em->createQueryBuilder() - * ->select('u') - * ->addSelect('p') - * ->from('User', 'u') - * ->leftJoin('u.Phonenumbers', 'p'); - * - * - * @param mixed $select The selection expression. - * @return QueryBuilder This QueryBuilder instance. - */ - public function addSelect($select = null) - { - $this->_type = self::SELECT; - - if (empty($select)) { - return $this; - } - - $selects = is_array($select) ? $select : func_get_args(); - - return $this->add('select', new Expr\Select($selects), true); - } - - /** - * Turns the query being built into a bulk delete query that ranges over - * a certain entity type. - * - * - * $qb = $em->createQueryBuilder() - * ->delete('User', 'u') - * ->where('u.id = :user_id'); - * ->setParameter('user_id', 1); - * - * - * @param string $delete The class/type whose instances are subject to the deletion. - * @param string $alias The class/type alias used in the constructed query. - * @return QueryBuilder This QueryBuilder instance. - */ - public function delete($delete = null, $alias = null) - { - $this->_type = self::DELETE; - - if ( ! $delete) { - return $this; - } - - return $this->add('from', new Expr\From($delete, $alias)); - } - - /** - * Turns the query being built into a bulk update query that ranges over - * a certain entity type. - * - * - * $qb = $em->createQueryBuilder() - * ->update('User', 'u') - * ->set('u.password', md5('password')) - * ->where('u.id = ?'); - * - * - * @param string $update The class/type whose instances are subject to the update. - * @param string $alias The class/type alias used in the constructed query. - * @return QueryBuilder This QueryBuilder instance. - */ - public function update($update = null, $alias = null) - { - $this->_type = self::UPDATE; - - if ( ! $update) { - return $this; - } - - return $this->add('from', new Expr\From($update, $alias)); - } - - /** - * Create and add a query root corresponding to the entity identified by the given alias, - * forming a cartesian product with any existing query roots. - * - * - * $qb = $em->createQueryBuilder() - * ->select('u') - * ->from('User', 'u') - * - * - * @param string $from The class name. - * @param string $alias The alias of the class. - * @param string $indexBy The index for the from. - * @return QueryBuilder This QueryBuilder instance. - */ - public function from($from, $alias, $indexBy = null) - { - return $this->add('from', new Expr\From($from, $alias, $indexBy), true); - } - - /** - * Creates and adds a join over an entity association to the query. - * - * The entities in the joined association will be fetched as part of the query - * result if the alias used for the joined association is placed in the select - * expressions. - * - * - * $qb = $em->createQueryBuilder() - * ->select('u') - * ->from('User', 'u') - * ->join('u.Phonenumbers', 'p', Expr\Join::WITH, 'p.is_primary = 1'); - * - * - * @param string $join The relationship to join - * @param string $alias The alias of the join - * @param string $conditionType The condition type constant. Either ON or WITH. - * @param string $condition The condition for the join - * @param string $indexBy The index for the join - * @return QueryBuilder This QueryBuilder instance. - */ - public function join($join, $alias, $conditionType = null, $condition = null, $indexBy = null) - { - return $this->innerJoin($join, $alias, $conditionType, $condition, $indexBy); - } - - /** - * Creates and adds a join over an entity association to the query. - * - * The entities in the joined association will be fetched as part of the query - * result if the alias used for the joined association is placed in the select - * expressions. - * - * [php] - * $qb = $em->createQueryBuilder() - * ->select('u') - * ->from('User', 'u') - * ->innerJoin('u.Phonenumbers', 'p', Expr\Join::WITH, 'p.is_primary = 1'); - * - * @param string $join The relationship to join - * @param string $alias The alias of the join - * @param string $conditionType The condition type constant. Either ON or WITH. - * @param string $condition The condition for the join - * @param string $indexBy The index for the join - * @return QueryBuilder This QueryBuilder instance. - */ - public function innerJoin($join, $alias, $conditionType = null, $condition = null, $indexBy = null) - { - $rootAlias = substr($join, 0, strpos($join, '.')); - - if ( ! in_array($rootAlias, $this->getRootAliases())) { - $rootAlias = $this->getRootAlias(); - } - - $join = new Expr\Join( - Expr\Join::INNER_JOIN, $join, $alias, $conditionType, $condition, $indexBy - ); - - return $this->add('join', array($rootAlias => $join), true); - } - - /** - * Creates and adds a left join over an entity association to the query. - * - * The entities in the joined association will be fetched as part of the query - * result if the alias used for the joined association is placed in the select - * expressions. - * - * - * $qb = $em->createQueryBuilder() - * ->select('u') - * ->from('User', 'u') - * ->leftJoin('u.Phonenumbers', 'p', Expr\Join::WITH, 'p.is_primary = 1'); - * - * - * @param string $join The relationship to join - * @param string $alias The alias of the join - * @param string $conditionType The condition type constant. Either ON or WITH. - * @param string $condition The condition for the join - * @param string $indexBy The index for the join - * @return QueryBuilder This QueryBuilder instance. - */ - public function leftJoin($join, $alias, $conditionType = null, $condition = null, $indexBy = null) - { - $rootAlias = substr($join, 0, strpos($join, '.')); - - if ( ! in_array($rootAlias, $this->getRootAliases())) { - $rootAlias = $this->getRootAlias(); - } - - $join = new Expr\Join( - Expr\Join::LEFT_JOIN, $join, $alias, $conditionType, $condition, $indexBy - ); - - return $this->add('join', array($rootAlias => $join), true); - } - - /** - * Sets a new value for a field in a bulk update query. - * - * - * $qb = $em->createQueryBuilder() - * ->update('User', 'u') - * ->set('u.password', md5('password')) - * ->where('u.id = ?'); - * - * - * @param string $key The key/field to set. - * @param string $value The value, expression, placeholder, etc. - * @return QueryBuilder This QueryBuilder instance. - */ - public function set($key, $value) - { - return $this->add('set', new Expr\Comparison($key, Expr\Comparison::EQ, $value), true); - } - - /** - * Specifies one or more restrictions to the query result. - * Replaces any previously specified restrictions, if any. - * - * - * $qb = $em->createQueryBuilder() - * ->select('u') - * ->from('User', 'u') - * ->where('u.id = ?'); - * - * // You can optionally programatically build and/or expressions - * $qb = $em->createQueryBuilder(); - * - * $or = $qb->expr()->orx(); - * $or->add($qb->expr()->eq('u.id', 1)); - * $or->add($qb->expr()->eq('u.id', 2)); - * - * $qb->update('User', 'u') - * ->set('u.password', md5('password')) - * ->where($or); - * - * - * @param mixed $predicates The restriction predicates. - * @return QueryBuilder This QueryBuilder instance. - */ - public function where($predicates) - { - if ( ! (func_num_args() == 1 && $predicates instanceof Expr\Composite)) { - $predicates = new Expr\Andx(func_get_args()); - } - - return $this->add('where', $predicates); - } - - /** - * Adds one or more restrictions to the query results, forming a logical - * conjunction with any previously specified restrictions. - * - * - * $qb = $em->createQueryBuilder() - * ->select('u') - * ->from('User', 'u') - * ->where('u.username LIKE ?') - * ->andWhere('u.is_active = 1'); - * - * - * @param mixed $where The query restrictions. - * @return QueryBuilder This QueryBuilder instance. - * @see where() - */ - public function andWhere($where) - { - $where = $this->getDQLPart('where'); - $args = func_get_args(); - - if ($where instanceof Expr\Andx) { - $where->addMultiple($args); - } else { - array_unshift($args, $where); - $where = new Expr\Andx($args); - } - - return $this->add('where', $where, true); - } - - /** - * Adds one or more restrictions to the query results, forming a logical - * disjunction with any previously specified restrictions. - * - * - * $qb = $em->createQueryBuilder() - * ->select('u') - * ->from('User', 'u') - * ->where('u.id = 1') - * ->orWhere('u.id = 2'); - * - * - * @param mixed $where The WHERE statement - * @return QueryBuilder $qb - * @see where() - */ - public function orWhere($where) - { - $where = $this->getDqlPart('where'); - $args = func_get_args(); - - if ($where instanceof Expr\Orx) { - $where->addMultiple($args); - } else { - array_unshift($args, $where); - $where = new Expr\Orx($args); - } - - return $this->add('where', $where, true); - } - - /** - * Specifies a grouping over the results of the query. - * Replaces any previously specified groupings, if any. - * - * - * $qb = $em->createQueryBuilder() - * ->select('u') - * ->from('User', 'u') - * ->groupBy('u.id'); - * - * - * @param string $groupBy The grouping expression. - * @return QueryBuilder This QueryBuilder instance. - */ - public function groupBy($groupBy) - { - return $this->add('groupBy', new Expr\GroupBy(func_get_args())); - } - - - /** - * Adds a grouping expression to the query. - * - * - * $qb = $em->createQueryBuilder() - * ->select('u') - * ->from('User', 'u') - * ->groupBy('u.lastLogin'); - * ->addGroupBy('u.createdAt') - * - * - * @param string $groupBy The grouping expression. - * @return QueryBuilder This QueryBuilder instance. - */ - public function addGroupBy($groupBy) - { - return $this->add('groupBy', new Expr\GroupBy(func_get_args()), true); - } - - /** - * Specifies a restriction over the groups of the query. - * Replaces any previous having restrictions, if any. - * - * @param mixed $having The restriction over the groups. - * @return QueryBuilder This QueryBuilder instance. - */ - public function having($having) - { - if ( ! (func_num_args() == 1 && ($having instanceof Expr\Andx || $having instanceof Expr\Orx))) { - $having = new Expr\Andx(func_get_args()); - } - - return $this->add('having', $having); - } - - /** - * Adds a restriction over the groups of the query, forming a logical - * conjunction with any existing having restrictions. - * - * @param mixed $having The restriction to append. - * @return QueryBuilder This QueryBuilder instance. - */ - public function andHaving($having) - { - $having = $this->getDqlPart('having'); - $args = func_get_args(); - - if ($having instanceof Expr\Andx) { - $having->addMultiple($args); - } else { - array_unshift($args, $having); - $having = new Expr\Andx($args); - } - - return $this->add('having', $having); - } - - /** - * Adds a restriction over the groups of the query, forming a logical - * disjunction with any existing having restrictions. - * - * @param mixed $having The restriction to add. - * @return QueryBuilder This QueryBuilder instance. - */ - public function orHaving($having) - { - $having = $this->getDqlPart('having'); - $args = func_get_args(); - - if ($having instanceof Expr\Orx) { - $having->addMultiple($args); - } else { - array_unshift($args, $having); - $having = new Expr\Orx($args); - } - - return $this->add('having', $having); - } - - /** - * Specifies an ordering for the query results. - * Replaces any previously specified orderings, if any. - * - * @param string $sort The ordering expression. - * @param string $order The ordering direction. - * @return QueryBuilder This QueryBuilder instance. - */ - public function orderBy($sort, $order = null) - { - return $this->add('orderBy', $sort instanceof Expr\OrderBy ? $sort - : new Expr\OrderBy($sort, $order)); - } - - /** - * Adds an ordering to the query results. - * - * @param string $sort The ordering expression. - * @param string $order The ordering direction. - * @return QueryBuilder This QueryBuilder instance. - */ - public function addOrderBy($sort, $order = null) - { - return $this->add('orderBy', new Expr\OrderBy($sort, $order), true); - } - - /** - * Get a query part by its name. - * - * @param string $queryPartName - * @return mixed $queryPart - * @todo Rename: getQueryPart (or remove?) - */ - public function getDQLPart($queryPartName) - { - return $this->_dqlParts[$queryPartName]; - } - - /** - * Get all query parts. - * - * @return array $dqlParts - * @todo Rename: getQueryParts (or remove?) - */ - public function getDQLParts() - { - return $this->_dqlParts; - } - - private function _getDQLForDelete() - { - return 'DELETE' - . $this->_getReducedDQLQueryPart('from', array('pre' => ' ', 'separator' => ', ')) - . $this->_getReducedDQLQueryPart('where', array('pre' => ' WHERE ')) - . $this->_getReducedDQLQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', ')); - } - - private function _getDQLForUpdate() - { - return 'UPDATE' - . $this->_getReducedDQLQueryPart('from', array('pre' => ' ', 'separator' => ', ')) - . $this->_getReducedDQLQueryPart('set', array('pre' => ' SET ', 'separator' => ', ')) - . $this->_getReducedDQLQueryPart('where', array('pre' => ' WHERE ')) - . $this->_getReducedDQLQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', ')); - } - - private function _getDQLForSelect() - { - $dql = 'SELECT' - . ($this->_dqlParts['distinct']===true ? ' DISTINCT' : '') - . $this->_getReducedDQLQueryPart('select', array('pre' => ' ', 'separator' => ', ')); - - $fromParts = $this->getDQLPart('from'); - $joinParts = $this->getDQLPart('join'); - $fromClauses = array(); - - // Loop through all FROM clauses - if ( ! empty($fromParts)) { - $dql .= ' FROM '; - - foreach ($fromParts as $from) { - $fromClause = (string) $from; - - if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) { - foreach ($joinParts[$from->getAlias()] as $join) { - $fromClause .= ' ' . ((string) $join); - } - } - - $fromClauses[] = $fromClause; - } - } - - $dql .= implode(', ', $fromClauses) - . $this->_getReducedDQLQueryPart('where', array('pre' => ' WHERE ')) - . $this->_getReducedDQLQueryPart('groupBy', array('pre' => ' GROUP BY ', 'separator' => ', ')) - . $this->_getReducedDQLQueryPart('having', array('pre' => ' HAVING ')) - . $this->_getReducedDQLQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', ')); - - return $dql; - } - - private function _getReducedDQLQueryPart($queryPartName, $options = array()) - { - $queryPart = $this->getDQLPart($queryPartName); - - if (empty($queryPart)) { - return (isset($options['empty']) ? $options['empty'] : ''); - } - - return (isset($options['pre']) ? $options['pre'] : '') - . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart) - . (isset($options['post']) ? $options['post'] : ''); - } - - /** - * Reset DQL parts - * - * @param array $parts - * @return QueryBuilder - */ - public function resetDQLParts($parts = null) - { - if (is_null($parts)) { - $parts = array_keys($this->_dqlParts); - } - foreach ($parts as $part) { - $this->resetDQLPart($part); - } - return $this; - } - - /** - * Reset single DQL part - * - * @param string $part - * @return QueryBuilder; - */ - public function resetDQLPart($part) - { - if (is_array($this->_dqlParts[$part])) { - $this->_dqlParts[$part] = array(); - } else { - $this->_dqlParts[$part] = null; - } - $this->_state = self::STATE_DIRTY; - return $this; - } - - /** - * Gets a string representation of this QueryBuilder which corresponds to - * the final DQL query being constructed. - * - * @return string The string representation of this QueryBuilder. - */ - public function __toString() - { - return $this->getDQL(); - } - - /** - * Deep clone of all expression objects in the DQL parts. - * - * @return void - */ - public function __clone() - { - foreach ($this->_dqlParts AS $part => $elements) { - if (is_array($this->_dqlParts[$part])) { - foreach ($this->_dqlParts[$part] AS $idx => $element) { - if (is_object($element)) { - $this->_dqlParts[$part][$idx] = clone $element; - } - } - } else if (\is_object($elements)) { - $this->_dqlParts[$part] = clone $elements; - } - } - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/README.markdown b/vendor/doctrine/orm/lib/Doctrine/ORM/README.markdown deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/MetadataCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/MetadataCommand.php deleted file mode 100644 index afff8db..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/MetadataCommand.php +++ /dev/null @@ -1,104 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Console\Command\ClearCache; - -use Symfony\Component\Console\Input\InputArgument, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console, - Doctrine\Common\Cache; - -/** - * Command to clear the metadata cache of the various cache drivers. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class MetadataCommand extends Console\Command\Command -{ - /** - * @see Console\Command\Command - */ - protected function configure() - { - $this - ->setName('orm:clear-cache:metadata') - ->setDescription('Clear all metadata cache of the various cache drivers.') - ->setDefinition(array( - new InputOption( - 'flush', null, InputOption::VALUE_NONE, - 'If defined, cache entries will be flushed instead of deleted/invalidated.' - ) - )); - - $fullName = $this->getName(); - $this->setHelp(<<$fullName command is meant to clear the metadata cache of associated Entity Manager. -It is possible to invalidate all cache entries at once - called delete -, or flushes the cache provider -instance completely. - -The execution type differ on how you execute the command. -If you want to invalidate the entries (and not delete from cache instance), this command would do the work: - -$fullName - -Alternatively, if you want to flush the cache provider using this command: - -$fullName --flush - -Finally, be aware that if --flush option is passed, not all cache providers are able to flush entries, -because of a limitation of its execution nature. -EOT - ); - } - - /** - * @see Console\Command\Command - */ - protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output) - { - $em = $this->getHelper('em')->getEntityManager(); - $cacheDriver = $em->getConfiguration()->getMetadataCacheImpl(); - - if ( ! $cacheDriver) { - throw new \InvalidArgumentException('No Metadata cache driver is configured on given EntityManager.'); - } - - if ($cacheDriver instanceof Cache\ApcCache) { - throw new \LogicException("Cannot clear APC Cache from Console, its shared in the Webserver memory and not accessible from the CLI."); - } - - $output->write('Clearing ALL Metadata cache entries' . PHP_EOL); - - $result = $cacheDriver->deleteAll(); - $message = ($result) ? 'Successfully deleted cache entries.' : 'No cache entries were deleted.'; - - if (true === $input->getOption('flush')) { - $result = $cacheDriver->flushAll(); - $message = ($result) ? 'Successfully flushed cache entries.' : $message; - } - - $output->write($message . PHP_EOL); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryCommand.php deleted file mode 100644 index 6ad75cd..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryCommand.php +++ /dev/null @@ -1,104 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Console\Command\ClearCache; - -use Symfony\Component\Console\Input\InputArgument, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console, - Doctrine\Common\Cache; - -/** - * Command to clear the query cache of the various cache drivers. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class QueryCommand extends Console\Command\Command -{ - /** - * @see Console\Command\Command - */ - protected function configure() - { - $this - ->setName('orm:clear-cache:query') - ->setDescription('Clear all query cache of the various cache drivers.') - ->setDefinition(array( - new InputOption( - 'flush', null, InputOption::VALUE_NONE, - 'If defined, cache entries will be flushed instead of deleted/invalidated.' - ) - )); - - $fullName = $this->getName(); - $this->setHelp(<<$fullName command is meant to clear the query cache of associated Entity Manager. -It is possible to invalidate all cache entries at once - called delete -, or flushes the cache provider -instance completely. - -The execution type differ on how you execute the command. -If you want to invalidate the entries (and not delete from cache instance), this command would do the work: - -$fullName - -Alternatively, if you want to flush the cache provider using this command: - -$fullName --flush - -Finally, be aware that if --flush option is passed, not all cache providers are able to flush entries, -because of a limitation of its execution nature. -EOT - ); - } - - /** - * @see Console\Command\Command - */ - protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output) - { - $em = $this->getHelper('em')->getEntityManager(); - $cacheDriver = $em->getConfiguration()->getQueryCacheImpl(); - - if ( ! $cacheDriver) { - throw new \InvalidArgumentException('No Query cache driver is configured on given EntityManager.'); - } - - if ($cacheDriver instanceof Cache\ApcCache) { - throw new \LogicException("Cannot clear APC Cache from Console, its shared in the Webserver memory and not accessible from the CLI."); - } - - $output->write('Clearing ALL Query cache entries' . PHP_EOL); - - $result = $cacheDriver->deleteAll(); - $message = ($result) ? 'Successfully deleted cache entries.' : 'No cache entries were deleted.'; - - if (true === $input->getOption('flush')) { - $result = $cacheDriver->flushAll(); - $message = ($result) ? 'Successfully flushed cache entries.' : $message; - } - - $output->write($message . PHP_EOL); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/ResultCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/ResultCommand.php deleted file mode 100644 index 5bb000c..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/ResultCommand.php +++ /dev/null @@ -1,104 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Console\Command\ClearCache; - -use Symfony\Component\Console\Input\InputArgument, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console, - Doctrine\Common\Cache; - -/** - * Command to clear the result cache of the various cache drivers. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ResultCommand extends Console\Command\Command -{ - /** - * @see Console\Command\Command - */ - protected function configure() - { - $this - ->setName('orm:clear-cache:result') - ->setDescription('Clear all result cache of the various cache drivers.') - ->setDefinition(array( - new InputOption( - 'flush', null, InputOption::VALUE_NONE, - 'If defined, cache entries will be flushed instead of deleted/invalidated.' - ) - )); - - $fullName = $this->getName(); - $this->setHelp(<<$fullName command is meant to clear the result cache of associated Entity Manager. -It is possible to invalidate all cache entries at once - called delete -, or flushes the cache provider -instance completely. - -The execution type differ on how you execute the command. -If you want to invalidate the entries (and not delete from cache instance), this command would do the work: - -$fullName - -Alternatively, if you want to flush the cache provider using this command: - -$fullName --flush - -Finally, be aware that if --flush option is passed, not all cache providers are able to flush entries, -because of a limitation of its execution nature. -EOT - ); - } - - /** - * @see Console\Command\Command - */ - protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output) - { - $em = $this->getHelper('em')->getEntityManager(); - $cacheDriver = $em->getConfiguration()->getResultCacheImpl(); - - if ( ! $cacheDriver) { - throw new \InvalidArgumentException('No Result cache driver is configured on given EntityManager.'); - } - - if ($cacheDriver instanceof Cache\ApcCache) { - throw new \LogicException("Cannot clear APC Cache from Console, its shared in the Webserver memory and not accessible from the CLI."); - } - - $output->write('Clearing ALL Result cache entries' . PHP_EOL); - - $result = $cacheDriver->deleteAll(); - $message = ($result) ? 'Successfully deleted cache entries.' : 'No cache entries were deleted.'; - - if (true === $input->getOption('flush')) { - $result = $cacheDriver->flushAll(); - $message = ($result) ? 'Successfully flushed cache entries.' : $message; - } - - $output->write($message . PHP_EOL); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php deleted file mode 100644 index c78920b..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php +++ /dev/null @@ -1,223 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Console\Command; - -use Symfony\Component\Console\Input\InputArgument, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console, - Doctrine\ORM\Tools\Export\ClassMetadataExporter, - Doctrine\ORM\Tools\ConvertDoctrine1Schema, - Doctrine\ORM\Tools\EntityGenerator; - -/** - * Command to convert a Doctrine 1 schema to a Doctrine 2 mapping file. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ConvertDoctrine1SchemaCommand extends Console\Command\Command -{ - /** - * @var EntityGenerator - */ - private $entityGenerator = null; - - /** - * @var ClassMetadataExporter - */ - private $metadataExporter = null; - - /** - * @return EntityGenerator - */ - public function getEntityGenerator() - { - if ($this->entityGenerator == null) { - $this->entityGenerator = new EntityGenerator(); - } - - return $this->entityGenerator; - } - - /** - * @param EntityGenerator $entityGenerator - */ - public function setEntityGenerator(EntityGenerator $entityGenerator) - { - $this->entityGenerator = $entityGenerator; - } - - /** - * @return ClassMetadataExporter - */ - public function getMetadataExporter() - { - if ($this->metadataExporter == null) { - $this->metadataExporter = new ClassMetadataExporter(); - } - - return $this->metadataExporter; - } - - /** - * @param ClassMetadataExporter $metadataExporter - */ - public function setMetadataExporter(ClassMetadataExporter $metadataExporter) - { - $this->metadataExporter = $metadataExporter; - } - - /** - * @see Console\Command\Command - */ - protected function configure() - { - $this - ->setName('orm:convert-d1-schema') - ->setDescription('Converts Doctrine 1.X schema into a Doctrine 2.X schema.') - ->setDefinition(array( - new InputArgument( - 'from-path', InputArgument::REQUIRED, 'The path of Doctrine 1.X schema information.' - ), - new InputArgument( - 'to-type', InputArgument::REQUIRED, 'The destination Doctrine 2.X mapping type.' - ), - new InputArgument( - 'dest-path', InputArgument::REQUIRED, - 'The path to generate your Doctrine 2.X mapping information.' - ), - new InputOption( - 'from', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, - 'Optional paths of Doctrine 1.X schema information.', - array() - ), - new InputOption( - 'extend', null, InputOption::VALUE_OPTIONAL, - 'Defines a base class to be extended by generated entity classes.' - ), - new InputOption( - 'num-spaces', null, InputOption::VALUE_OPTIONAL, - 'Defines the number of indentation spaces', 4 - ) - )) - ->setHelp(<<getHelper('em')->getEntityManager(); - - // Process source directories - $fromPaths = array_merge(array($input->getArgument('from-path')), $input->getOption('from')); - - // Process destination directory - $destPath = realpath($input->getArgument('dest-path')); - - $toType = $input->getArgument('to-type'); - $extend = $input->getOption('extend'); - $numSpaces = $input->getOption('num-spaces'); - - $this->convertDoctrine1Schema($em, $fromPaths, $destPath, $toType, $numSpaces, $extend, $output); - } - - /** - * @param \Doctrine\ORM\EntityManager $em - * @param array $fromPaths - * @param string $destPath - * @param string $toType - * @param int $numSpaces - * @param string|null $extend - * @param Console\Output\OutputInterface $output - */ - public function convertDoctrine1Schema($em, $fromPaths, $destPath, $toType, $numSpaces, $extend, $output) - { - foreach ($fromPaths as &$dirName) { - $dirName = realpath($dirName); - - if ( ! file_exists($dirName)) { - throw new \InvalidArgumentException( - sprintf("Doctrine 1.X schema directory '%s' does not exist.", $dirName) - ); - } else if ( ! is_readable($dirName)) { - throw new \InvalidArgumentException( - sprintf("Doctrine 1.X schema directory '%s' does not have read permissions.", $dirName) - ); - } - } - - if ( ! file_exists($destPath)) { - throw new \InvalidArgumentException( - sprintf("Doctrine 2.X mapping destination directory '%s' does not exist.", $destPath) - ); - } else if ( ! is_writable($destPath)) { - throw new \InvalidArgumentException( - sprintf("Doctrine 2.X mapping destination directory '%s' does not have write permissions.", $destPath) - ); - } - - $cme = $this->getMetadataExporter(); - $exporter = $cme->getExporter($toType, $destPath); - - if (strtolower($toType) === 'annotation') { - $entityGenerator = $this->getEntityGenerator(); - $exporter->setEntityGenerator($entityGenerator); - - $entityGenerator->setNumSpaces($numSpaces); - - if ($extend !== null) { - $entityGenerator->setClassToExtend($extend); - } - } - - $converter = new ConvertDoctrine1Schema($fromPaths); - $metadata = $converter->getMetadata(); - - if ($metadata) { - $output->write(PHP_EOL); - - foreach ($metadata as $class) { - $output->write(sprintf('Processing entity "%s"', $class->name) . PHP_EOL); - } - - $exporter->setMetadata($metadata); - $exporter->export(); - - $output->write(PHP_EOL . sprintf( - 'Converting Doctrine 1.X schema to "%s" mapping type in "%s"', $toType, $destPath - )); - } else { - $output->write('No Metadata Classes to process.' . PHP_EOL); - } - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php deleted file mode 100644 index 03af43a..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php +++ /dev/null @@ -1,186 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Console\Command; - -use Symfony\Component\Console\Input\InputArgument, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console, - Doctrine\ORM\Tools\Console\MetadataFilter, - Doctrine\ORM\Tools\Export\ClassMetadataExporter, - Doctrine\ORM\Tools\EntityGenerator, - Doctrine\ORM\Tools\DisconnectedClassMetadataFactory; - -/** - * Command to convert your mapping information between the various formats. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ConvertMappingCommand extends Console\Command\Command -{ - /** - * @see Console\Command\Command - */ - protected function configure() - { - $this - ->setName('orm:convert-mapping') - ->setDescription('Convert mapping information between supported formats.') - ->setDefinition(array( - new InputOption( - 'filter', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, - 'A string pattern used to match entities that should be processed.' - ), - new InputArgument( - 'to-type', InputArgument::REQUIRED, 'The mapping type to be converted.' - ), - new InputArgument( - 'dest-path', InputArgument::REQUIRED, - 'The path to generate your entities classes.' - ), - new InputOption( - 'force', null, InputOption::VALUE_NONE, - 'Force to overwrite existing mapping files.' - ), - new InputOption( - 'from-database', null, null, 'Whether or not to convert mapping information from existing database.' - ), - new InputOption( - 'extend', null, InputOption::VALUE_OPTIONAL, - 'Defines a base class to be extended by generated entity classes.' - ), - new InputOption( - 'num-spaces', null, InputOption::VALUE_OPTIONAL, - 'Defines the number of indentation spaces', 4 - ), - new InputOption( - 'namespace', null, InputOption::VALUE_OPTIONAL, - 'Defines a namespace for the generated entity classes, if converted from database.' - ), - )) - ->setHelp(<<one-time command. It should not be necessary for -you to call this method multiple times, escpecially when using the --from-database -flag. - -Converting an existing databsae schema into mapping files only solves about 70-80% -of the necessary mapping information. Additionally the detection from an existing -database cannot detect inverse associations, inheritance types, -entities with foreign keys as primary keys and many of the -semantical operations on associations such as cascade. - -Hint: There is no need to convert YAML or XML mapping files to annotations -every time you make changes. All mapping drivers are first class citizens -in Doctrine 2 and can be used as runtime mapping for the ORM. -EOT - ); - } - - /** - * @see Console\Command\Command - */ - protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output) - { - $em = $this->getHelper('em')->getEntityManager(); - - if ($input->getOption('from-database') === true) { - $databaseDriver = new \Doctrine\ORM\Mapping\Driver\DatabaseDriver( - $em->getConnection()->getSchemaManager() - ); - - $em->getConfiguration()->setMetadataDriverImpl( - $databaseDriver - ); - - if (($namespace = $input->getOption('namespace')) !== null) { - $databaseDriver->setNamespace($namespace); - } - } - - $cmf = new DisconnectedClassMetadataFactory(); - $cmf->setEntityManager($em); - $metadata = $cmf->getAllMetadata(); - $metadata = MetadataFilter::filter($metadata, $input->getOption('filter')); - - // Process destination directory - if ( ! is_dir($destPath = $input->getArgument('dest-path'))) { - mkdir($destPath, 0777, true); - } - $destPath = realpath($destPath); - - if ( ! file_exists($destPath)) { - throw new \InvalidArgumentException( - sprintf("Mapping destination directory '%s' does not exist.", $input->getArgument('dest-path')) - ); - } else if ( ! is_writable($destPath)) { - throw new \InvalidArgumentException( - sprintf("Mapping destination directory '%s' does not have write permissions.", $destPath) - ); - } - - $toType = strtolower($input->getArgument('to-type')); - - $exporter = $this->getExporter($toType, $destPath); - $exporter->setOverwriteExistingFiles( ($input->getOption('force') !== false) ); - - if ($toType == 'annotation') { - $entityGenerator = new EntityGenerator(); - $exporter->setEntityGenerator($entityGenerator); - - $entityGenerator->setNumSpaces($input->getOption('num-spaces')); - - if (($extend = $input->getOption('extend')) !== null) { - $entityGenerator->setClassToExtend($extend); - } - } - - if (count($metadata)) { - foreach ($metadata as $class) { - $output->write(sprintf('Processing entity "%s"', $class->name) . PHP_EOL); - } - - $exporter->setMetadata($metadata); - $exporter->export(); - - $output->write(PHP_EOL . sprintf( - 'Exporting "%s" mapping information to "%s"' . PHP_EOL, $toType, $destPath - )); - } else { - $output->write('No Metadata Classes to process.' . PHP_EOL); - } - } - - protected function getExporter($toType, $destPath) - { - $cme = new ClassMetadataExporter(); - - return $cme->getExporter($toType, $destPath); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php deleted file mode 100644 index d29bfce..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php +++ /dev/null @@ -1,85 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Console\Command; - -use Symfony\Component\Console\Input\InputArgument, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console; - -/** - * Command to ensure that Doctrine is properly configured for a production environment. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class EnsureProductionSettingsCommand extends Console\Command\Command -{ - /** - * @see Console\Command\Command - */ - protected function configure() - { - $this - ->setName('orm:ensure-production-settings') - ->setDescription('Verify that Doctrine is properly configured for a production environment.') - ->setDefinition(array( - new InputOption( - 'complete', null, InputOption::VALUE_NONE, - 'Flag to also inspect database connection existance.' - ) - )) - ->setHelp(<<getHelper('em')->getEntityManager(); - - $error = false; - try { - $em->getConfiguration()->ensureProductionSettings(); - - if ($input->getOption('complete') !== null) { - $em->getConnection()->connect(); - } - } catch (\Exception $e) { - $error = true; - $output->writeln('' . $e->getMessage() . ''); - } - - if ($error === false) { - $output->write('Environment is correctly configured for production.' . PHP_EOL); - } - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php deleted file mode 100644 index f00e6d2..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php +++ /dev/null @@ -1,163 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Console\Command; - -use Symfony\Component\Console\Input\InputArgument, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console, - Doctrine\ORM\Tools\Console\MetadataFilter, - Doctrine\ORM\Tools\EntityGenerator, - Doctrine\ORM\Tools\DisconnectedClassMetadataFactory; - -/** - * Command to generate entity classes and method stubs from your mapping information. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class GenerateEntitiesCommand extends Console\Command\Command -{ - /** - * @see Console\Command\Command - */ - protected function configure() - { - $this - ->setName('orm:generate-entities') - ->setDescription('Generate entity classes and method stubs from your mapping information.') - ->setDefinition(array( - new InputOption( - 'filter', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, - 'A string pattern used to match entities that should be processed.' - ), - new InputArgument( - 'dest-path', InputArgument::REQUIRED, 'The path to generate your entity classes.' - ), - new InputOption( - 'generate-annotations', null, InputOption::VALUE_OPTIONAL, - 'Flag to define if generator should generate annotation metadata on entities.', false - ), - new InputOption( - 'generate-methods', null, InputOption::VALUE_OPTIONAL, - 'Flag to define if generator should generate stub methods on entities.', true - ), - new InputOption( - 'regenerate-entities', null, InputOption::VALUE_OPTIONAL, - 'Flag to define if generator should regenerate entity if it exists.', false - ), - new InputOption( - 'update-entities', null, InputOption::VALUE_OPTIONAL, - 'Flag to define if generator should only update entity if it exists.', true - ), - new InputOption( - 'extend', null, InputOption::VALUE_OPTIONAL, - 'Defines a base class to be extended by generated entity classes.' - ), - new InputOption( - 'num-spaces', null, InputOption::VALUE_OPTIONAL, - 'Defines the number of indentation spaces', 4 - ) - )) - ->setHelp(<<--update-entities or --regenerate-entities flags your exisiting -code gets overwritten. The EntityGenerator will only append new code to your -file and will not delete the old code. However this approach may still be prone -to error and we suggest you use code repositories such as GIT or SVN to make -backups of your code. - -It makes sense to generate the entity code if you are using entities as Data -Access Objects only and dont put much additional logic on them. If you are -however putting much more logic on the entities you should refrain from using -the entity-generator and code your entities manually. - -Important: Even if you specified Inheritance options in your -XML or YAML Mapping files the generator cannot generate the base and -child classes for you correctly, because it doesn't know which -class is supposed to extend which. You have to adjust the entity -code manually for inheritance to work! -EOT - ); - } - - /** - * @see Console\Command\Command - */ - protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output) - { - $em = $this->getHelper('em')->getEntityManager(); - - $cmf = new DisconnectedClassMetadataFactory(); - $cmf->setEntityManager($em); - $metadatas = $cmf->getAllMetadata(); - $metadatas = MetadataFilter::filter($metadatas, $input->getOption('filter')); - - // Process destination directory - $destPath = realpath($input->getArgument('dest-path')); - - if ( ! file_exists($destPath)) { - throw new \InvalidArgumentException( - sprintf("Entities destination directory '%s' does not exist.", $input->getArgument('dest-path')) - ); - } else if ( ! is_writable($destPath)) { - throw new \InvalidArgumentException( - sprintf("Entities destination directory '%s' does not have write permissions.", $destPath) - ); - } - - if (count($metadatas)) { - // Create EntityGenerator - $entityGenerator = new EntityGenerator(); - - $entityGenerator->setGenerateAnnotations($input->getOption('generate-annotations')); - $entityGenerator->setGenerateStubMethods($input->getOption('generate-methods')); - $entityGenerator->setRegenerateEntityIfExists($input->getOption('regenerate-entities')); - $entityGenerator->setUpdateEntityIfExists($input->getOption('update-entities')); - $entityGenerator->setNumSpaces($input->getOption('num-spaces')); - - if (($extend = $input->getOption('extend')) !== null) { - $entityGenerator->setClassToExtend($extend); - } - - foreach ($metadatas as $metadata) { - $output->write( - sprintf('Processing entity "%s"', $metadata->name) . PHP_EOL - ); - } - - // Generating Entities - $entityGenerator->generate($metadatas, $destPath); - - // Outputting information message - $output->write(PHP_EOL . sprintf('Entity classes generated to "%s"', $destPath) . PHP_EOL); - } else { - $output->write('No Metadata Classes to process.' . PHP_EOL); - } - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php deleted file mode 100644 index 7028d99..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php +++ /dev/null @@ -1,115 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Console\Command; - -use Symfony\Component\Console\Input\InputArgument, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console, - Doctrine\ORM\Tools\Console\MetadataFilter; - -/** - * Command to (re)generate the proxy classes used by doctrine. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class GenerateProxiesCommand extends Console\Command\Command -{ - /** - * @see Console\Command\Command - */ - protected function configure() - { - $this - ->setName('orm:generate-proxies') - ->setDescription('Generates proxy classes for entity classes.') - ->setDefinition(array( - new InputOption( - 'filter', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, - 'A string pattern used to match entities that should be processed.' - ), - new InputArgument( - 'dest-path', InputArgument::OPTIONAL, - 'The path to generate your proxy classes. If none is provided, it will attempt to grab from configuration.' - ), - )) - ->setHelp(<<getHelper('em')->getEntityManager(); - - $metadatas = $em->getMetadataFactory()->getAllMetadata(); - $metadatas = MetadataFilter::filter($metadatas, $input->getOption('filter')); - - // Process destination directory - if (($destPath = $input->getArgument('dest-path')) === null) { - $destPath = $em->getConfiguration()->getProxyDir(); - } - - if ( ! is_dir($destPath)) { - mkdir($destPath, 0777, true); - } - - $destPath = realpath($destPath); - - if ( ! file_exists($destPath)) { - throw new \InvalidArgumentException( - sprintf("Proxies destination directory '%s' does not exist.", $em->getConfiguration()->getProxyDir()) - ); - } else if ( ! is_writable($destPath)) { - throw new \InvalidArgumentException( - sprintf("Proxies destination directory '%s' does not have write permissions.", $destPath) - ); - } - - if ( count($metadatas)) { - foreach ($metadatas as $metadata) { - $output->write( - sprintf('Processing entity "%s"', $metadata->name) . PHP_EOL - ); - } - - // Generating Proxies - $em->getProxyFactory()->generateProxyClasses($metadatas, $destPath); - - // Outputting information message - $output->write(PHP_EOL . sprintf('Proxy classes generated to "%s"', $destPath) . PHP_EOL); - } else { - $output->write('No Metadata Classes to process.' . PHP_EOL); - } - - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php deleted file mode 100644 index bb6fc9d..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php +++ /dev/null @@ -1,116 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Console\Command; - -use Symfony\Component\Console\Input\InputArgument, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console, - Doctrine\ORM\Tools\Console\MetadataFilter, - Doctrine\ORM\Tools\EntityRepositoryGenerator; - -/** - * Command to generate repository classes for mapping information. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class GenerateRepositoriesCommand extends Console\Command\Command -{ - /** - * @see Console\Command\Command - */ - protected function configure() - { - $this - ->setName('orm:generate-repositories') - ->setDescription('Generate repository classes from your mapping information.') - ->setDefinition(array( - new InputOption( - 'filter', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, - 'A string pattern used to match entities that should be processed.' - ), - new InputArgument( - 'dest-path', InputArgument::REQUIRED, 'The path to generate your repository classes.' - ) - )) - ->setHelp(<<getHelper('em')->getEntityManager(); - - $metadatas = $em->getMetadataFactory()->getAllMetadata(); - $metadatas = MetadataFilter::filter($metadatas, $input->getOption('filter')); - - // Process destination directory - $destPath = realpath($input->getArgument('dest-path')); - - if ( ! file_exists($destPath)) { - throw new \InvalidArgumentException( - sprintf("Entities destination directory '%s' does not exist.", $input->getArgument('dest-path')) - ); - } else if ( ! is_writable($destPath)) { - throw new \InvalidArgumentException( - sprintf("Entities destination directory '%s' does not have write permissions.", $destPath) - ); - } - - if (count($metadatas)) { - $numRepositories = 0; - $generator = new EntityRepositoryGenerator(); - - foreach ($metadatas as $metadata) { - if ($metadata->customRepositoryClassName) { - $output->write( - sprintf('Processing repository "%s"', $metadata->customRepositoryClassName) . PHP_EOL - ); - - $generator->writeEntityRepositoryClass($metadata->customRepositoryClassName, $destPath); - - $numRepositories++; - } - } - - if ($numRepositories) { - // Outputting information message - $output->write(PHP_EOL . sprintf('Repository classes generated to "%s"', $destPath) . PHP_EOL); - } else { - $output->write('No Repository classes were found to be processed.' . PHP_EOL); - } - } else { - $output->write('No Metadata Classes to process.' . PHP_EOL); - } - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/InfoCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/InfoCommand.php deleted file mode 100644 index 77458cf..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/InfoCommand.php +++ /dev/null @@ -1,80 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Console\Command; - -use Doctrine\ORM\Mapping\MappingException; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Command\Command; - -/** - * Show information about mapped entities - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.1 - * @author Benjamin Eberlei - */ -class InfoCommand extends Command -{ - protected function configure() - { - $this - ->setName('orm:info') - ->setDescription('Show basic information about all mapped entities') - ->setHelp(<<doctrine:mapping:info shows basic information about which -entities exist and possibly if their mapping information contains errors or -not. -EOT - ); - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - /* @var $entityManager \Doctrine\ORM\EntityManager */ - $entityManager = $this->getHelper('em')->getEntityManager(); - - $entityClassNames = $entityManager->getConfiguration() - ->getMetadataDriverImpl() - ->getAllClassNames(); - - if (!$entityClassNames) { - throw new \Exception( - 'You do not have any mapped Doctrine ORM entities according to the current configuration. '. - 'If you have entities or mapping files you should check your mapping configuration for errors.' - ); - } - - $output->writeln(sprintf("Found %d mapped entities:", count($entityClassNames))); - - foreach ($entityClassNames as $entityClassName) { - try { - $cm = $entityManager->getClassMetadata($entityClassName); - $output->writeln(sprintf("[OK] %s", $entityClassName)); - } catch (MappingException $e) { - $output->writeln("[FAIL] ".$entityClassName); - $output->writeln(sprintf("%s", $e->getMessage())); - $output->writeln(''); - } - } - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php deleted file mode 100644 index c794cb9..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php +++ /dev/null @@ -1,124 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Console\Command; - -use Symfony\Component\Console\Input\InputArgument, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console; - -/** - * Command to execute DQL queries in a given EntityManager. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class RunDqlCommand extends Console\Command\Command -{ - /** - * @see Console\Command\Command - */ - protected function configure() - { - $this - ->setName('orm:run-dql') - ->setDescription('Executes arbitrary DQL directly from the command line.') - ->setDefinition(array( - new InputArgument('dql', InputArgument::REQUIRED, 'The DQL to execute.'), - new InputOption( - 'hydrate', null, InputOption::VALUE_REQUIRED, - 'Hydration mode of result set. Should be either: object, array, scalar or single-scalar.', - 'object' - ), - new InputOption( - 'first-result', null, InputOption::VALUE_REQUIRED, - 'The first result in the result set.' - ), - new InputOption( - 'max-result', null, InputOption::VALUE_REQUIRED, - 'The maximum number of results in the result set.' - ), - new InputOption( - 'depth', null, InputOption::VALUE_REQUIRED, - 'Dumping depth of Entity graph.', 7 - ) - )) - ->setHelp(<<getHelper('em')->getEntityManager(); - - if (($dql = $input->getArgument('dql')) === null) { - throw new \RuntimeException("Argument 'DQL' is required in order to execute this command correctly."); - } - - $depth = $input->getOption('depth'); - - if ( ! is_numeric($depth)) { - throw new \LogicException("Option 'depth' must contains an integer value"); - } - - $hydrationModeName = $input->getOption('hydrate'); - $hydrationMode = 'Doctrine\ORM\Query::HYDRATE_' . strtoupper(str_replace('-', '_', $hydrationModeName)); - - if ( ! defined($hydrationMode)) { - throw new \RuntimeException( - "Hydration mode '$hydrationModeName' does not exist. It should be either: object. array, scalar or single-scalar." - ); - } - - $query = $em->createQuery($dql); - - if (($firstResult = $input->getOption('first-result')) !== null) { - if ( ! is_numeric($firstResult)) { - throw new \LogicException("Option 'first-result' must contains an integer value"); - } - - $query->setFirstResult((int) $firstResult); - } - - if (($maxResult = $input->getOption('max-result')) !== null) { - if ( ! is_numeric($maxResult)) { - throw new \LogicException("Option 'max-result' must contains an integer value"); - } - - $query->setMaxResults((int) $maxResult); - } - - $resultSet = $query->execute(array(), constant($hydrationMode)); - - \Doctrine\Common\Util\Debug::dump($resultSet, $input->getOption('depth')); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php deleted file mode 100644 index cd53948..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php +++ /dev/null @@ -1,64 +0,0 @@ -. -*/ - -namespace Doctrine\ORM\Tools\Console\Command\SchemaTool; - -use Symfony\Component\Console\Input\InputArgument, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console\Input\InputInterface, - Symfony\Component\Console\Output\OutputInterface, - Symfony\Component\Console\Command\Command, - Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper, - Doctrine\ORM\Tools\SchemaTool, - Doctrine\ORM\Mapping\Driver\AbstractFileDriver; - -abstract class AbstractCommand extends Command -{ - /** - * @param InputInterface $input - * @param OutputInterface $output - * @param SchemaTool $schemaTool - * @param array $metadatas - */ - abstract protected function executeSchemaCommand(InputInterface $input, OutputInterface $output, SchemaTool $schemaTool, array $metadatas); - - /** - * @see Console\Command\Command - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $emHelper = $this->getHelper('em'); - - /* @var $em \Doctrine\ORM\EntityManager */ - $em = $emHelper->getEntityManager(); - - $metadatas = $em->getMetadataFactory()->getAllMetadata(); - - if ( ! empty($metadatas)) { - // Create SchemaTool - $tool = new \Doctrine\ORM\Tools\SchemaTool($em); - - $this->executeSchemaCommand($input, $output, $tool, $metadatas); - } else { - $output->write('No Metadata Classes to process.' . PHP_EOL); - } - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php deleted file mode 100644 index d0b8818..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php +++ /dev/null @@ -1,79 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Console\Command\SchemaTool; - -use Symfony\Component\Console\Input\InputArgument, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console\Input\InputInterface, - Symfony\Component\Console\Output\OutputInterface, - Doctrine\ORM\Tools\SchemaTool; - -/** - * Command to create the database schema for a set of classes based on their mappings. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class CreateCommand extends AbstractCommand -{ - /** - * @see Console\Command\Command - */ - protected function configure() - { - $this - ->setName('orm:schema-tool:create') - ->setDescription( - 'Processes the schema and either create it directly on EntityManager Storage Connection or generate the SQL output.' - ) - ->setDefinition(array( - new InputOption( - 'dump-sql', null, InputOption::VALUE_NONE, - 'Instead of try to apply generated SQLs into EntityManager Storage Connection, output them.' - ) - )) - ->setHelp(<<write('ATTENTION: This operation should not be executed in a production environment.' . PHP_EOL . PHP_EOL); - - if ($input->getOption('dump-sql') === true) { - $sqls = $schemaTool->getCreateSchemaSql($metadatas); - $output->write(implode(';' . PHP_EOL, $sqls) . PHP_EOL); - } else { - $output->write('Creating database schema...' . PHP_EOL); - $schemaTool->createSchema($metadatas); - $output->write('Database schema created successfully!' . PHP_EOL); - } - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php deleted file mode 100644 index 57243f2..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php +++ /dev/null @@ -1,111 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Console\Command\SchemaTool; - -use Symfony\Component\Console\Input\InputArgument, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console\Input\InputInterface, - Symfony\Component\Console\Output\OutputInterface, - Doctrine\ORM\Tools\SchemaTool; - -/** - * Command to drop the database schema for a set of classes based on their mappings. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class DropCommand extends AbstractCommand -{ - /** - * @see Console\Command\Command - */ - protected function configure() - { - $this - ->setName('orm:schema-tool:drop') - ->setDescription( - 'Drop the complete database schema of EntityManager Storage Connection or generate the corresponding SQL output.' - ) - ->setDefinition(array( - new InputOption( - 'dump-sql', null, InputOption::VALUE_NONE, - 'Instead of try to apply generated SQLs into EntityManager Storage Connection, output them.' - ), - new InputOption( - 'force', null, InputOption::VALUE_NONE, - "Don't ask for the deletion of the database, but force the operation to run." - ), - new InputOption( - 'full-database', null, InputOption::VALUE_NONE, - 'Instead of using the Class Metadata to detect the database table schema, drop ALL assets that the database contains.' - ), - )) - ->setHelp(<<getOption('full-database')); - - if ($input->getOption('dump-sql') === true) { - if ($isFullDatabaseDrop) { - $sqls = $schemaTool->getDropDatabaseSQL(); - } else { - $sqls = $schemaTool->getDropSchemaSQL($metadatas); - } - $output->write(implode(';' . PHP_EOL, $sqls) . PHP_EOL); - } else if ($input->getOption('force') === true) { - $output->write('Dropping database schema...' . PHP_EOL); - if ($isFullDatabaseDrop) { - $schemaTool->dropDatabase(); - } else { - $schemaTool->dropSchema($metadatas); - } - $output->write('Database schema dropped successfully!' . PHP_EOL); - } else { - $output->write('ATTENTION: This operation should not be executed in a production environment.' . PHP_EOL . PHP_EOL); - - if ($isFullDatabaseDrop) { - $sqls = $schemaTool->getDropDatabaseSQL(); - } else { - $sqls = $schemaTool->getDropSchemaSQL($metadatas); - } - - if (count($sqls)) { - $output->write('Schema-Tool would execute ' . count($sqls) . ' queries to drop the database.' . PHP_EOL); - $output->write('Please run the operation with --force to execute these queries or use --dump-sql to see them.' . PHP_EOL); - } else { - $output->write('Nothing to drop. The database is empty!' . PHP_EOL); - } - } - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php deleted file mode 100644 index 2b0fc0d..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php +++ /dev/null @@ -1,135 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Console\Command\SchemaTool; - -use Symfony\Component\Console\Input\InputArgument, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console\Input\InputInterface, - Symfony\Component\Console\Output\OutputInterface, - Doctrine\ORM\Tools\SchemaTool; - -/** - * Command to generate the SQL needed to update the database schema to match - * the current mapping information. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Ryan Weaver - */ -class UpdateCommand extends AbstractCommand -{ - protected $name = 'orm:schema-tool:update'; - - /** - * @see Console\Command\Command - */ - protected function configure() - { - $this - ->setName($this->name) - ->setDescription( - 'Executes (or dumps) the SQL needed to update the database schema to match the current mapping metadata.' - ) - ->setDefinition(array( - new InputOption( - 'complete', null, InputOption::VALUE_NONE, - 'If defined, all assets of the database which are not relevant to the current metadata will be dropped.' - ), - - new InputOption( - 'dump-sql', null, InputOption::VALUE_NONE, - 'Dumps the generated SQL statements to the screen (does not execute them).' - ), - new InputOption( - 'force', null, InputOption::VALUE_NONE, - 'Causes the generated SQL statements to be physically executed against your database.' - ), - )); - - $fullName = $this->getName(); - $this->setHelp(<<$fullName command generates the SQL needed to -synchronize the database schema with the current mapping metadata of the -default entity manager. - -For example, if you add metadata for a new column to an entity, this command -would generate and output the SQL needed to add the new column to the database: - -$fullName --dump-sql - -Alternatively, you can execute the generated queries: - -$fullName --force - -Finally, be aware that if the --complete option is passed, this -task will drop all database assets (e.g. tables, etc) that are *not* described -by the current metadata. In other words, without this option, this task leaves -untouched any "extra" tables that exist in the database, but which aren't -described by any metadata. -EOT - ); - } - - protected function executeSchemaCommand(InputInterface $input, OutputInterface $output, SchemaTool $schemaTool, array $metadatas) - { - // Defining if update is complete or not (--complete not defined means $saveMode = true) - $saveMode = ($input->getOption('complete') !== true); - - $sqls = $schemaTool->getUpdateSchemaSql($metadatas, $saveMode); - if (0 == count($sqls)) { - $output->writeln('Nothing to update - your database is already in sync with the current entity metadata.'); - - return; - } - - $dumpSql = (true === $input->getOption('dump-sql')); - $force = (true === $input->getOption('force')); - if ($dumpSql && $force) { - throw new \InvalidArgumentException('You can pass either the --dump-sql or the --force option (but not both simultaneously).'); - } - - if ($dumpSql) { - $output->writeln(implode(';' . PHP_EOL, $sqls)); - } else if ($force) { - $output->writeln('Updating database schema...'); - $schemaTool->updateSchema($metadatas, $saveMode); - $output->writeln(sprintf('Database schema updated successfully! "%s" queries were executed', count($sqls))); - } else { - $output->writeln('ATTENTION: This operation should not be executed in a production environment.'); - $output->writeln(' Use the incremental update to detect changes during development and use'); - $output->writeln(' the SQL DDL provided to manually update your database in production.'); - $output->writeln(''); - - $output->writeln(sprintf('The Schema-Tool would execute "%s" queries to update the database.', count($sqls))); - $output->writeln('Please run the operation by passing one of the following options:'); - - $output->writeln(sprintf(' %s --force to execute the command', $this->getName())); - $output->writeln(sprintf(' %s --dump-sql to dump the SQL statements to the screen', $this->getName())); - } - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ValidateSchemaCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ValidateSchemaCommand.php deleted file mode 100644 index 9381485..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ValidateSchemaCommand.php +++ /dev/null @@ -1,89 +0,0 @@ -. -*/ - -namespace Doctrine\ORM\Tools\Console\Command; - -use Symfony\Component\Console\Input\InputArgument, - Symfony\Component\Console\Input\InputOption, - Symfony\Component\Console; - -/** - * Validate that the current mapping is valid - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 1.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ValidateSchemaCommand extends Console\Command\Command -{ - /** - * @see Console\Command\Command - */ - protected function configure() - { - $this - ->setName('orm:validate-schema') - ->setDescription('Validate the mapping files.') - ->setHelp(<<getHelper('em')->getEntityManager(); - - $validator = new \Doctrine\ORM\Tools\SchemaValidator($em); - $errors = $validator->validateMapping(); - - $exit = 0; - if ($errors) { - foreach ($errors AS $className => $errorMessages) { - $output->write("[Mapping] FAIL - The entity-class '" . $className . "' mapping is invalid:\n"); - foreach ($errorMessages AS $errorMessage) { - $output->write('* ' . $errorMessage . "\n"); - } - $output->write("\n"); - } - $exit += 1; - } else { - $output->write('[Mapping] OK - The mapping files are correct.' . "\n"); - } - - if (!$validator->schemaInSyncWithMetadata()) { - $output->write('[Database] FAIL - The database schema is not in sync with the current mapping file.' . "\n"); - $exit += 2; - } else { - $output->write('[Database] OK - The database schema is in sync with the mapping files.' . "\n"); - } - - return $exit; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/ConsoleRunner.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/ConsoleRunner.php deleted file mode 100644 index 6907dde..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/ConsoleRunner.php +++ /dev/null @@ -1,70 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Console; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Helper\HelperSet; - -class ConsoleRunner -{ - /** - * Run console with the given helperset. - * - * @param \Symfony\Component\Console\Helper\HelperSet $helperSet - * @return void - */ - static public function run(HelperSet $helperSet) - { - $cli = new Application('Doctrine Command Line Interface', \Doctrine\ORM\Version::VERSION); - $cli->setCatchExceptions(true); - $cli->setHelperSet($helperSet); - self::addCommands($cli); - $cli->run(); - } - - /** - * @param Application $cli - */ - static public function addCommands(Application $cli) - { - $cli->addCommands(array( - // DBAL Commands - new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(), - new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(), - - // ORM Commands - new \Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand(), - new \Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand(), - new \Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand(), - new \Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand(), - new \Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand(), - new \Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand(), - new \Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand(), - new \Doctrine\ORM\Tools\Console\Command\ConvertDoctrine1SchemaCommand(), - new \Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand(), - new \Doctrine\ORM\Tools\Console\Command\GenerateEntitiesCommand(), - new \Doctrine\ORM\Tools\Console\Command\GenerateProxiesCommand(), - new \Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand(), - new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(), - new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand(), - new \Doctrine\ORM\Tools\Console\Command\InfoCommand() - )); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Helper/EntityManagerHelper.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Helper/EntityManagerHelper.php deleted file mode 100644 index c28622e..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Helper/EntityManagerHelper.php +++ /dev/null @@ -1,74 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Console\Helper; - -use Symfony\Component\Console\Helper\Helper, - Doctrine\ORM\EntityManager; - -/** - * Doctrine CLI Connection Helper. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class EntityManagerHelper extends Helper -{ - /** - * Doctrine ORM EntityManager - * @var EntityManager - */ - protected $_em; - - /** - * Constructor - * - * @param Connection $connection Doctrine Database Connection - */ - public function __construct(EntityManager $em) - { - $this->_em = $em; - } - - /** - * Retrieves Doctrine ORM EntityManager - * - * @return EntityManager - */ - public function getEntityManager() - { - return $this->_em; - } - - /** - * @see Helper - */ - public function getName() - { - return 'entityManager'; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php deleted file mode 100644 index 2f69d89..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php +++ /dev/null @@ -1,80 +0,0 @@ -. -*/ - -namespace Doctrine\ORM\Tools\Console; - -/** - * Used by CLI Tools to restrict entity-based commands to given patterns. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 1.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class MetadataFilter extends \FilterIterator implements \Countable -{ - /** - * Filter Metadatas by one or more filter options. - * - * @param array $metadatas - * @param array|string $filter - * @return array - */ - static public function filter(array $metadatas, $filter) - { - $metadatas = new MetadataFilter(new \ArrayIterator($metadatas), $filter); - return iterator_to_array($metadatas); - } - - private $_filter = array(); - - public function __construct(\ArrayIterator $metadata, $filter) - { - $this->_filter = (array)$filter; - parent::__construct($metadata); - } - - public function accept() - { - if (count($this->_filter) == 0) { - return true; - } - - $it = $this->getInnerIterator(); - $metadata = $it->current(); - - foreach ($this->_filter AS $filter) { - if (strpos($metadata->name, $filter) !== false) { - return true; - } - } - return false; - } - - public function count() - { - return count($this->getInnerIterator()); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php deleted file mode 100644 index 93edebb..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php +++ /dev/null @@ -1,274 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools; - -use Doctrine\ORM\Mapping\ClassMetadataInfo, - Doctrine\ORM\Tools\Export\Driver\AbstractExporter, - Doctrine\Common\Util\Inflector; - -/** - * Class to help with converting Doctrine 1 schema files to Doctrine 2 mapping files - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ConvertDoctrine1Schema -{ - private $_legacyTypeMap = array( - // TODO: This list may need to be updated - 'clob' => 'text', - 'timestamp' => 'datetime', - 'enum' => 'string' - ); - - /** - * Constructor passes the directory or array of directories - * to convert the Doctrine 1 schema files from - * - * @param array $from - * @author Jonathan Wage - */ - public function __construct($from) - { - $this->_from = (array) $from; - } - - /** - * Get an array of ClassMetadataInfo instances from the passed - * Doctrine 1 schema - * - * @return array $metadatas An array of ClassMetadataInfo instances - */ - public function getMetadata() - { - $schema = array(); - foreach ($this->_from as $path) { - if (is_dir($path)) { - $files = glob($path . '/*.yml'); - foreach ($files as $file) { - $schema = array_merge($schema, (array) \Symfony\Component\Yaml\Yaml::parse($file)); - } - } else { - $schema = array_merge($schema, (array) \Symfony\Component\Yaml\Yaml::parse($path)); - } - } - - $metadatas = array(); - foreach ($schema as $className => $mappingInformation) { - $metadatas[] = $this->_convertToClassMetadataInfo($className, $mappingInformation); - } - - return $metadatas; - } - - private function _convertToClassMetadataInfo($className, $mappingInformation) - { - $metadata = new ClassMetadataInfo($className); - - $this->_convertTableName($className, $mappingInformation, $metadata); - $this->_convertColumns($className, $mappingInformation, $metadata); - $this->_convertIndexes($className, $mappingInformation, $metadata); - $this->_convertRelations($className, $mappingInformation, $metadata); - - return $metadata; - } - - private function _convertTableName($className, array $model, ClassMetadataInfo $metadata) - { - if (isset($model['tableName']) && $model['tableName']) { - $e = explode('.', $model['tableName']); - - if (count($e) > 1) { - $metadata->table['schema'] = $e[0]; - $metadata->table['name'] = $e[1]; - } else { - $metadata->table['name'] = $e[0]; - } - } - } - - private function _convertColumns($className, array $model, ClassMetadataInfo $metadata) - { - $id = false; - - if (isset($model['columns']) && $model['columns']) { - foreach ($model['columns'] as $name => $column) { - $fieldMapping = $this->_convertColumn($className, $name, $column, $metadata); - - if (isset($fieldMapping['id']) && $fieldMapping['id']) { - $id = true; - } - } - } - - if ( ! $id) { - $fieldMapping = array( - 'fieldName' => 'id', - 'columnName' => 'id', - 'type' => 'integer', - 'id' => true - ); - $metadata->mapField($fieldMapping); - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); - } - } - - private function _convertColumn($className, $name, $column, ClassMetadataInfo $metadata) - { - if (is_string($column)) { - $string = $column; - $column = array(); - $column['type'] = $string; - } - if ( ! isset($column['name'])) { - $column['name'] = $name; - } - // check if a column alias was used (column_name as field_name) - if (preg_match("/(\w+)\sas\s(\w+)/i", $column['name'], $matches)) { - $name = $matches[1]; - $column['name'] = $name; - $column['alias'] = $matches[2]; - } - if (preg_match("/([a-zA-Z]+)\(([0-9]+)\)/", $column['type'], $matches)) { - $column['type'] = $matches[1]; - $column['length'] = $matches[2]; - } - $column['type'] = strtolower($column['type']); - // check if legacy column type (1.x) needs to be mapped to a 2.0 one - if (isset($this->_legacyTypeMap[$column['type']])) { - $column['type'] = $this->_legacyTypeMap[$column['type']]; - } - if ( ! \Doctrine\DBAL\Types\Type::hasType($column['type'])) { - throw ToolsException::couldNotMapDoctrine1Type($column['type']); - } - - $fieldMapping = array(); - if (isset($column['primary'])) { - $fieldMapping['id'] = true; - } - $fieldMapping['fieldName'] = isset($column['alias']) ? $column['alias'] : $name; - $fieldMapping['columnName'] = $column['name']; - $fieldMapping['type'] = $column['type']; - if (isset($column['length'])) { - $fieldMapping['length'] = $column['length']; - } - $allowed = array('precision', 'scale', 'unique', 'options', 'notnull', 'version'); - foreach ($column as $key => $value) { - if (in_array($key, $allowed)) { - $fieldMapping[$key] = $value; - } - } - - $metadata->mapField($fieldMapping); - - if (isset($column['autoincrement'])) { - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); - } else if (isset($column['sequence'])) { - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE); - $definition = array( - 'sequenceName' => is_array($column['sequence']) ? $column['sequence']['name']:$column['sequence'] - ); - if (isset($column['sequence']['size'])) { - $definition['allocationSize'] = $column['sequence']['size']; - } - if (isset($column['sequence']['value'])) { - $definition['initialValue'] = $column['sequence']['value']; - } - $metadata->setSequenceGeneratorDefinition($definition); - } - return $fieldMapping; - } - - private function _convertIndexes($className, array $model, ClassMetadataInfo $metadata) - { - if (isset($model['indexes']) && $model['indexes']) { - foreach ($model['indexes'] as $name => $index) { - $type = (isset($index['type']) && $index['type'] == 'unique') - ? 'uniqueConstraints' : 'indexes'; - - $metadata->table[$type][$name] = array( - 'columns' => $index['fields'] - ); - } - } - } - - private function _convertRelations($className, array $model, ClassMetadataInfo $metadata) - { - if (isset($model['relations']) && $model['relations']) { - foreach ($model['relations'] as $name => $relation) { - if ( ! isset($relation['alias'])) { - $relation['alias'] = $name; - } - if ( ! isset($relation['class'])) { - $relation['class'] = $name; - } - if ( ! isset($relation['local'])) { - $relation['local'] = Inflector::tableize($relation['class']); - } - if ( ! isset($relation['foreign'])) { - $relation['foreign'] = 'id'; - } - if ( ! isset($relation['foreignAlias'])) { - $relation['foreignAlias'] = $className; - } - - if (isset($relation['refClass'])) { - $type = 'many'; - $foreignType = 'many'; - $joinColumns = array(); - } else { - $type = isset($relation['type']) ? $relation['type'] : 'one'; - $foreignType = isset($relation['foreignType']) ? $relation['foreignType'] : 'many'; - $joinColumns = array( - array( - 'name' => $relation['local'], - 'referencedColumnName' => $relation['foreign'], - 'onDelete' => isset($relation['onDelete']) ? $relation['onDelete'] : null, - ) - ); - } - - if ($type == 'one' && $foreignType == 'one') { - $method = 'mapOneToOne'; - } else if ($type == 'many' && $foreignType == 'many') { - $method = 'mapManyToMany'; - } else { - $method = 'mapOneToMany'; - } - - $associationMapping = array(); - $associationMapping['fieldName'] = $relation['alias']; - $associationMapping['targetEntity'] = $relation['class']; - $associationMapping['mappedBy'] = $relation['foreignAlias']; - $associationMapping['joinColumns'] = $joinColumns; - - $metadata->$method($associationMapping); - } - } - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/DebugUnitOfWorkListener.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/DebugUnitOfWorkListener.php deleted file mode 100644 index 0548b96..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/DebugUnitOfWorkListener.php +++ /dev/null @@ -1,151 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools; - -use Doctrine\ORM\Event\OnFlushEventArgs; -use Doctrine\ORM\Mapping\ClassMetadata; -use Doctrine\ORM\PersistentCollection; -use Doctrine\ORM\UnitOfWork; - -/** - * Use this logger to dump the identity map during the onFlush event. This is useful for debugging - * weird UnitOfWork behavior with complex operations. - */ -class DebugUnitOfWorkListener -{ - private $file; - private $context; - - /** - * Pass a stream and contet information for the debugging session. - * - * The stream can be php://output to print to the screen. - * - * @param string $file - * @param string $context - */ - public function __construct($file = 'php://output', $context = '') - { - $this->file = $file; - $this->context = $context; - } - - public function onFlush(OnFlushEventArgs $args) - { - $this->dumpIdentityMap($args->getEntityManager()); - } - - /** - * Dump the contents of the identity map into a stream. - * - * @param EntityManager $em - * @return void - */ - public function dumpIdentityMap(EntityManager $em) - { - $uow = $em->getUnitOfWork(); - $identityMap = $uow->getIdentityMap(); - - $fh = fopen($this->file, "x+"); - if (count($identityMap) == 0) { - fwrite($fh, "Flush Operation [".$this->context."] - Empty identity map.\n"); - return; - } - - fwrite($fh, "Flush Operation [".$this->context."] - Dumping identity map:\n"); - foreach ($identityMap AS $className => $map) { - fwrite($fh, "Class: ". $className . "\n"); - foreach ($map AS $idHash => $entity) { - fwrite($fh, " Entity: " . $this->getIdString($entity, $uow) . " " . spl_object_hash($entity)."\n"); - fwrite($fh, " Associations:\n"); - - $cm = $em->getClassMetadata($className); - foreach ($cm->associationMappings AS $field => $assoc) { - fwrite($fh, " " . $field . " "); - $value = $cm->reflFields[$field]->getValue($entity); - - if ($assoc['type'] & ClassMetadata::TO_ONE) { - if ($value === null) { - fwrite($fh, " NULL\n"); - } else { - if ($value instanceof Proxy && !$value->__isInitialized__) { - fwrite($fh, "[PROXY] "); - } - - fwrite($fh, $this->getIdString($value, $uow) . " " . spl_object_hash($value) . "\n"); - } - } else { - $initialized = !($value instanceof PersistentCollection) || $value->isInitialized(); - if ($value === null) { - fwrite($fh, " NULL\n"); - } else if ($initialized) { - fwrite($fh, "[INITIALIZED] " . $this->getType($value). " " . count($value) . " elements\n"); - foreach ($value AS $obj) { - fwrite($fh, " " . $this->getIdString($obj, $uow) . " " . spl_object_hash($obj)."\n"); - } - } else { - fwrite($fh, "[PROXY] " . $this->getType($value) . " unknown element size\n"); - foreach ($value->unwrap() AS $obj) { - fwrite($fh, " " . $this->getIdString($obj, $uow) . " " . spl_object_hash($obj)."\n"); - } - } - } - } - } - } - fclose($fh); - } - - private function getType($var) - { - if (is_object($var)) { - $refl = new \ReflectionObject($var); - return $refl->getShortname(); - } else { - return gettype($var); - } - } - - private function getIdString($entity, $uow) - { - if ($uow->isInIdentityMap($entity)) { - $ids = $uow->getEntityIdentifier($entity); - $idstring = ""; - foreach ($ids AS $k => $v) { - $idstring .= $k."=".$v; - } - } else { - $idstring = "NEWOBJECT "; - } - - $state = $uow->getEntityState($entity); - if ($state == UnitOfWork::STATE_NEW) { - $idstring .= " [NEW]"; - } else if ($state == UnitOfWork::STATE_REMOVED) { - $idstring .= " [REMOVED]"; - } else if ($state == UnitOfWork::STATE_MANAGED) { - $idstring .= " [MANAGED]"; - } else if ($state == UnitOfwork::STATE_DETACHED) { - $idstring .= " [DETACHED]"; - } - - return $idstring; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php deleted file mode 100644 index 2603c22..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php +++ /dev/null @@ -1,45 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools; - -use Doctrine\ORM\Mapping\ClassMetadataFactory; -use Doctrine\ORM\Mapping\ClassMetadataInfo; - -/** - * The DisconnectedClassMetadataFactory is used to create ClassMetadataInfo objects - * that do not require the entity class actually exist. This allows us to - * load some mapping information and use it to do things like generate code - * from the mapping information. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class DisconnectedClassMetadataFactory extends ClassMetadataFactory -{ - public function getReflectionService() - { - return new \Doctrine\Common\Persistence\Mapping\StaticReflectionService; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/EntityGenerator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/EntityGenerator.php deleted file mode 100644 index b4564e0..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ /dev/null @@ -1,1146 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools; - -use Doctrine\ORM\Mapping\ClassMetadataInfo, - Doctrine\Common\Util\Inflector, - Doctrine\DBAL\Types\Type; - -/** - * Generic class used to generate PHP5 entity classes from ClassMetadataInfo instances - * - * [php] - * $classes = $em->getClassMetadataFactory()->getAllMetadata(); - * - * $generator = new \Doctrine\ORM\Tools\EntityGenerator(); - * $generator->setGenerateAnnotations(true); - * $generator->setGenerateStubMethods(true); - * $generator->setRegenerateEntityIfExists(false); - * $generator->setUpdateEntityIfExists(true); - * $generator->generate($classes, '/path/to/generate/entities'); - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class EntityGenerator -{ - /** - * @var bool - */ - private $_backupExisting = true; - - /** The extension to use for written php files */ - private $_extension = '.php'; - - /** Whether or not the current ClassMetadataInfo instance is new or old */ - private $_isNew = true; - - private $_staticReflection = array(); - - /** Number of spaces to use for indention in generated code */ - private $_numSpaces = 4; - - /** The actual spaces to use for indention */ - private $_spaces = ' '; - - /** The class all generated entities should extend */ - private $_classToExtend; - - /** Whether or not to generation annotations */ - private $_generateAnnotations = false; - - /** - * @var string - */ - private $_annotationsPrefix = ''; - - /** Whether or not to generated sub methods */ - private $_generateEntityStubMethods = false; - - /** Whether or not to update the entity class if it exists already */ - private $_updateEntityIfExists = false; - - /** Whether or not to re-generate entity class if it exists already */ - private $_regenerateEntityIfExists = false; - - private static $_classTemplate = -' - -use Doctrine\ORM\Mapping as ORM; - - - -{ - -}'; - - private static $_getMethodTemplate = -'/** - * - * - * @return - */ -public function () -{ -return $this->; -}'; - - private static $_setMethodTemplate = -'/** - * - * - * @param $ - * @return - */ -public function ($) -{ -$this-> = $; -return $this; -}'; - - private static $_addMethodTemplate = -'/** - * - * - * @param $ - * @return - */ -public function ($) -{ -$this->[] = $; -return $this; -}'; - - /** - * @var string - */ - private static $_removeMethodTemplate = -'/** - * - * - * @param $ - */ -public function ($) -{ -$this->->removeElement($); -}'; - - /** - * @var string - */ - private static $_lifecycleCallbackMethodTemplate = -'/** - * @ - */ -public function () -{ -// Add your code here -}'; - - private static $_constructorMethodTemplate = -'public function __construct() -{ - -} -'; - - public function __construct() - { - if (version_compare(\Doctrine\Common\Version::VERSION, '2.2.0-DEV', '>=')) { - $this->_annotationsPrefix = 'ORM\\'; - } - } - - /** - * Generate and write entity classes for the given array of ClassMetadataInfo instances - * - * @param array $metadatas - * @param string $outputDirectory - * @return void - */ - public function generate(array $metadatas, $outputDirectory) - { - foreach ($metadatas as $metadata) { - $this->writeEntityClass($metadata, $outputDirectory); - } - } - - /** - * Generated and write entity class to disk for the given ClassMetadataInfo instance - * - * @param ClassMetadataInfo $metadata - * @param string $outputDirectory - * @return void - */ - public function writeEntityClass(ClassMetadataInfo $metadata, $outputDirectory) - { - $path = $outputDirectory . '/' . str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name) . $this->_extension; - $dir = dirname($path); - - if ( ! is_dir($dir)) { - mkdir($dir, 0777, true); - } - - $this->_isNew = !file_exists($path) || (file_exists($path) && $this->_regenerateEntityIfExists); - - if ( ! $this->_isNew) { - $this->_parseTokensInEntityFile(file_get_contents($path)); - } else { - $this->_staticReflection[$metadata->name] = array('properties' => array(), 'methods' => array()); - } - - if ($this->_backupExisting && file_exists($path)) { - $backupPath = dirname($path) . DIRECTORY_SEPARATOR . basename($path) . "~"; - if (!copy($path, $backupPath)) { - throw new \RuntimeException("Attempt to backup overwritten entity file but copy operation failed."); - } - } - - // If entity doesn't exist or we're re-generating the entities entirely - if ($this->_isNew) { - file_put_contents($path, $this->generateEntityClass($metadata)); - // If entity exists and we're allowed to update the entity class - } else if ( ! $this->_isNew && $this->_updateEntityIfExists) { - file_put_contents($path, $this->generateUpdatedEntityClass($metadata, $path)); - } - } - - /** - * Generate a PHP5 Doctrine 2 entity class from the given ClassMetadataInfo instance - * - * @param ClassMetadataInfo $metadata - * @return string $code - */ - public function generateEntityClass(ClassMetadataInfo $metadata) - { - $placeHolders = array( - '', - '', - '', - '' - ); - - $replacements = array( - $this->_generateEntityNamespace($metadata), - $this->_generateEntityDocBlock($metadata), - $this->_generateEntityClassName($metadata), - $this->_generateEntityBody($metadata) - ); - - $code = str_replace($placeHolders, $replacements, self::$_classTemplate); - return str_replace('', $this->_spaces, $code); - } - - /** - * Generate the updated code for the given ClassMetadataInfo and entity at path - * - * @param ClassMetadataInfo $metadata - * @param string $path - * @return string $code; - */ - public function generateUpdatedEntityClass(ClassMetadataInfo $metadata, $path) - { - $currentCode = file_get_contents($path); - - $body = $this->_generateEntityBody($metadata); - $body = str_replace('', $this->_spaces, $body); - $last = strrpos($currentCode, '}'); - - return substr($currentCode, 0, $last) . $body . (strlen($body) > 0 ? "\n" : ''). "}"; - } - - /** - * Set the number of spaces the exported class should have - * - * @param integer $numSpaces - * @return void - */ - public function setNumSpaces($numSpaces) - { - $this->_spaces = str_repeat(' ', $numSpaces); - $this->_numSpaces = $numSpaces; - } - - /** - * Set the extension to use when writing php files to disk - * - * @param string $extension - * @return void - */ - public function setExtension($extension) - { - $this->_extension = $extension; - } - - /** - * Set the name of the class the generated classes should extend from - * - * @return void - */ - public function setClassToExtend($classToExtend) - { - $this->_classToExtend = $classToExtend; - } - - /** - * Set whether or not to generate annotations for the entity - * - * @param bool $bool - * @return void - */ - public function setGenerateAnnotations($bool) - { - $this->_generateAnnotations = $bool; - } - - /** - * Set an annotation prefix. - * - * @param string $prefix - */ - public function setAnnotationPrefix($prefix) - { - $this->_annotationsPrefix = $prefix; - } - - /** - * Set whether or not to try and update the entity if it already exists - * - * @param bool $bool - * @return void - */ - public function setUpdateEntityIfExists($bool) - { - $this->_updateEntityIfExists = $bool; - } - - /** - * Set whether or not to regenerate the entity if it exists - * - * @param bool $bool - * @return void - */ - public function setRegenerateEntityIfExists($bool) - { - $this->_regenerateEntityIfExists = $bool; - } - - /** - * Set whether or not to generate stub methods for the entity - * - * @param bool $bool - * @return void - */ - public function setGenerateStubMethods($bool) - { - $this->_generateEntityStubMethods = $bool; - } - - /** - * Should an existing entity be backed up if it already exists? - */ - public function setBackupExisting($bool) - { - $this->_backupExisting = $bool; - } - - private function _generateEntityNamespace(ClassMetadataInfo $metadata) - { - if ($this->_hasNamespace($metadata)) { - return 'namespace ' . $this->_getNamespace($metadata) .';'; - } - } - - private function _generateEntityClassName(ClassMetadataInfo $metadata) - { - return 'class ' . $this->_getClassName($metadata) . - ($this->_extendsClass() ? ' extends ' . $this->_getClassToExtendName() : null); - } - - private function _generateEntityBody(ClassMetadataInfo $metadata) - { - $fieldMappingProperties = $this->_generateEntityFieldMappingProperties($metadata); - $associationMappingProperties = $this->_generateEntityAssociationMappingProperties($metadata); - $stubMethods = $this->_generateEntityStubMethods ? $this->_generateEntityStubMethods($metadata) : null; - $lifecycleCallbackMethods = $this->_generateEntityLifecycleCallbackMethods($metadata); - - $code = array(); - - if ($fieldMappingProperties) { - $code[] = $fieldMappingProperties; - } - - if ($associationMappingProperties) { - $code[] = $associationMappingProperties; - } - - $code[] = $this->_generateEntityConstructor($metadata); - - if ($stubMethods) { - $code[] = $stubMethods; - } - - if ($lifecycleCallbackMethods) { - $code[] = $lifecycleCallbackMethods; - } - - return implode("\n", $code); - } - - private function _generateEntityConstructor(ClassMetadataInfo $metadata) - { - if ($this->_hasMethod('__construct', $metadata)) { - return ''; - } - - $collections = array(); - - foreach ($metadata->associationMappings AS $mapping) { - if ($mapping['type'] & ClassMetadataInfo::TO_MANY) { - $collections[] = '$this->'.$mapping['fieldName'].' = new \Doctrine\Common\Collections\ArrayCollection();'; - } - } - - if ($collections) { - return $this->_prefixCodeWithSpaces(str_replace("", implode("\n".$this->_spaces, $collections), self::$_constructorMethodTemplate)); - } - - return ''; - } - - /** - * @todo this won't work if there is a namespace in brackets and a class outside of it. - * @param string $src - */ - private function _parseTokensInEntityFile($src) - { - $tokens = token_get_all($src); - $lastSeenNamespace = ""; - $lastSeenClass = false; - - $inNamespace = false; - $inClass = false; - for ($i = 0; $i < count($tokens); $i++) { - $token = $tokens[$i]; - if (in_array($token[0], array(T_WHITESPACE, T_COMMENT, T_DOC_COMMENT))) { - continue; - } - - if ($inNamespace) { - if ($token[0] == T_NS_SEPARATOR || $token[0] == T_STRING) { - $lastSeenNamespace .= $token[1]; - } else if (is_string($token) && in_array($token, array(';', '{'))) { - $inNamespace = false; - } - } - - if ($inClass) { - $inClass = false; - $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1]; - $this->_staticReflection[$lastSeenClass]['properties'] = array(); - $this->_staticReflection[$lastSeenClass]['methods'] = array(); - } - - if ($token[0] == T_NAMESPACE) { - $lastSeenNamespace = ""; - $inNamespace = true; - } else if ($token[0] == T_CLASS) { - $inClass = true; - } else if ($token[0] == T_FUNCTION) { - if ($tokens[$i+2][0] == T_STRING) { - $this->_staticReflection[$lastSeenClass]['methods'][] = $tokens[$i+2][1]; - } else if ($tokens[$i+2] == "&" && $tokens[$i+3][0] == T_STRING) { - $this->_staticReflection[$lastSeenClass]['methods'][] = $tokens[$i+3][1]; - } - } else if (in_array($token[0], array(T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED)) && $tokens[$i+2][0] != T_FUNCTION) { - $this->_staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1); - } - } - } - - private function _hasProperty($property, ClassMetadataInfo $metadata) - { - if ($this->_extendsClass()) { - // don't generate property if its already on the base class. - $reflClass = new \ReflectionClass($this->_getClassToExtend()); - if ($reflClass->hasProperty($property)) { - return true; - } - } - - return ( - isset($this->_staticReflection[$metadata->name]) && - in_array($property, $this->_staticReflection[$metadata->name]['properties']) - ); - } - - private function _hasMethod($method, ClassMetadataInfo $metadata) - { - if ($this->_extendsClass()) { - // don't generate method if its already on the base class. - $reflClass = new \ReflectionClass($this->_getClassToExtend()); - if ($reflClass->hasMethod($method)) { - return true; - } - } - - return ( - isset($this->_staticReflection[$metadata->name]) && - in_array($method, $this->_staticReflection[$metadata->name]['methods']) - ); - } - - private function _hasNamespace(ClassMetadataInfo $metadata) - { - return strpos($metadata->name, '\\') ? true : false; - } - - private function _extendsClass() - { - return $this->_classToExtend ? true : false; - } - - private function _getClassToExtend() - { - return $this->_classToExtend; - } - - private function _getClassToExtendName() - { - $refl = new \ReflectionClass($this->_getClassToExtend()); - - return '\\' . $refl->getName(); - } - - private function _getClassName(ClassMetadataInfo $metadata) - { - return ($pos = strrpos($metadata->name, '\\')) - ? substr($metadata->name, $pos + 1, strlen($metadata->name)) : $metadata->name; - } - - private function _getNamespace(ClassMetadataInfo $metadata) - { - return substr($metadata->name, 0, strrpos($metadata->name, '\\')); - } - - private function _generateEntityDocBlock(ClassMetadataInfo $metadata) - { - $lines = array(); - $lines[] = '/**'; - $lines[] = ' * '.$metadata->name; - - if ($this->_generateAnnotations) { - $lines[] = ' *'; - - $methods = array( - '_generateTableAnnotation', - '_generateInheritanceAnnotation', - '_generateDiscriminatorColumnAnnotation', - '_generateDiscriminatorMapAnnotation' - ); - - foreach ($methods as $method) { - if ($code = $this->$method($metadata)) { - $lines[] = ' * ' . $code; - } - } - - if ($metadata->isMappedSuperclass) { - $lines[] = ' * @' . $this->_annotationsPrefix . 'MappedSuperClass'; - } else { - $lines[] = ' * @' . $this->_annotationsPrefix . 'Entity'; - } - - if ($metadata->customRepositoryClassName) { - $lines[count($lines) - 1] .= '(repositoryClass="' . $metadata->customRepositoryClassName . '")'; - } - - if (isset($metadata->lifecycleCallbacks) && $metadata->lifecycleCallbacks) { - $lines[] = ' * @' . $this->_annotationsPrefix . 'HasLifecycleCallbacks'; - } - } - - $lines[] = ' */'; - - return implode("\n", $lines); - } - - private function _generateTableAnnotation($metadata) - { - $table = array(); - - if (isset($metadata->table['schema'])) { - $table[] = 'schema="' . $metadata->table['schema'] . '"'; - } - - if (isset($metadata->table['name'])) { - $table[] = 'name="' . $metadata->table['name'] . '"'; - } - - if (isset($metadata->table['uniqueConstraints']) && $metadata->table['uniqueConstraints']) { - $constraints = $this->_generateTableConstraints('UniqueConstraint', $metadata->table['uniqueConstraints']); - $table[] = 'uniqueConstraints={' . $constraints . '}'; - } - - if (isset($metadata->table['indexes']) && $metadata->table['indexes']) { - $constraints = $this->_generateTableConstraints('Index', $metadata->table['indexes']); - $table[] = 'indexes={' . $constraints . '}'; - } - - return '@' . $this->_annotationsPrefix . 'Table(' . implode(', ', $table) . ')'; - } - - private function _generateTableConstraints($constraintName, $constraints) - { - $annotations = array(); - foreach ($constraints as $name => $constraint) { - $columns = array(); - foreach ($constraint['columns'] as $column) { - $columns[] = '"' . $column . '"'; - } - $annotations[] = '@' . $this->_annotationsPrefix . $constraintName . '(name="' . $name . '", columns={' . implode(', ', $columns) . '})'; - } - return implode(', ', $annotations); - } - - private function _generateInheritanceAnnotation($metadata) - { - if ($metadata->inheritanceType != ClassMetadataInfo::INHERITANCE_TYPE_NONE) { - return '@' . $this->_annotationsPrefix . 'InheritanceType("'.$this->_getInheritanceTypeString($metadata->inheritanceType).'")'; - } - } - - private function _generateDiscriminatorColumnAnnotation($metadata) - { - if ($metadata->inheritanceType != ClassMetadataInfo::INHERITANCE_TYPE_NONE) { - $discrColumn = $metadata->discriminatorValue; - $columnDefinition = 'name="' . $discrColumn['name'] - . '", type="' . $discrColumn['type'] - . '", length=' . $discrColumn['length']; - - return '@' . $this->_annotationsPrefix . 'DiscriminatorColumn(' . $columnDefinition . ')'; - } - } - - private function _generateDiscriminatorMapAnnotation($metadata) - { - if ($metadata->inheritanceType != ClassMetadataInfo::INHERITANCE_TYPE_NONE) { - $inheritanceClassMap = array(); - - foreach ($metadata->discriminatorMap as $type => $class) { - $inheritanceClassMap[] .= '"' . $type . '" = "' . $class . '"'; - } - - return '@' . $this->_annotationsPrefix . 'DiscriminatorMap({' . implode(', ', $inheritanceClassMap) . '})'; - } - } - - private function _generateEntityStubMethods(ClassMetadataInfo $metadata) - { - $methods = array(); - - foreach ($metadata->fieldMappings as $fieldMapping) { - if ( ! isset($fieldMapping['id']) || ! $fieldMapping['id'] || $metadata->generatorType == ClassMetadataInfo::GENERATOR_TYPE_NONE) { - if ($code = $this->_generateEntityStubMethod($metadata, 'set', $fieldMapping['fieldName'], $fieldMapping['type'])) { - $methods[] = $code; - } - } - - if ($code = $this->_generateEntityStubMethod($metadata, 'get', $fieldMapping['fieldName'], $fieldMapping['type'])) { - $methods[] = $code; - } - } - - foreach ($metadata->associationMappings as $associationMapping) { - if ($associationMapping['type'] & ClassMetadataInfo::TO_ONE) { - $nullable = $this->_isAssociationIsNullable($associationMapping) ? 'null' : null; - if ($code = $this->_generateEntityStubMethod($metadata, 'set', $associationMapping['fieldName'], $associationMapping['targetEntity'], $nullable)) { - $methods[] = $code; - } - if ($code = $this->_generateEntityStubMethod($metadata, 'get', $associationMapping['fieldName'], $associationMapping['targetEntity'])) { - $methods[] = $code; - } - } else if ($associationMapping['type'] & ClassMetadataInfo::TO_MANY) { - if ($code = $this->_generateEntityStubMethod($metadata, 'add', $associationMapping['fieldName'], $associationMapping['targetEntity'])) { - $methods[] = $code; - } - if ($code = $this->_generateEntityStubMethod($metadata, 'remove', $associationMapping['fieldName'], $associationMapping['targetEntity'])) { - $methods[] = $code; - } - if ($code = $this->_generateEntityStubMethod($metadata, 'get', $associationMapping['fieldName'], 'Doctrine\Common\Collections\Collection')) { - $methods[] = $code; - } - } - } - - return implode("\n\n", $methods); - } - - private function _isAssociationIsNullable($associationMapping) - { - if (isset($associationMapping['id']) && $associationMapping['id']) { - return false; - } - if (isset($associationMapping['joinColumns'])) { - $joinColumns = $associationMapping['joinColumns']; - } else { - //@todo thereis no way to retreive targetEntity metadata - $joinColumns = array(); - } - foreach ($joinColumns as $joinColumn) { - if(isset($joinColumn['nullable']) && !$joinColumn['nullable']) { - return false; - } - } - return true; - } - - private function _generateEntityLifecycleCallbackMethods(ClassMetadataInfo $metadata) - { - if (isset($metadata->lifecycleCallbacks) && $metadata->lifecycleCallbacks) { - $methods = array(); - - foreach ($metadata->lifecycleCallbacks as $name => $callbacks) { - foreach ($callbacks as $callback) { - if ($code = $this->_generateLifecycleCallbackMethod($name, $callback, $metadata)) { - $methods[] = $code; - } - } - } - - return implode("\n\n", $methods); - } - - return ""; - } - - private function _generateEntityAssociationMappingProperties(ClassMetadataInfo $metadata) - { - $lines = array(); - - foreach ($metadata->associationMappings as $associationMapping) { - if ($this->_hasProperty($associationMapping['fieldName'], $metadata)) { - continue; - } - - $lines[] = $this->_generateAssociationMappingPropertyDocBlock($associationMapping, $metadata); - $lines[] = $this->_spaces . 'private $' . $associationMapping['fieldName'] - . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n"; - } - - return implode("\n", $lines); - } - - private function _generateEntityFieldMappingProperties(ClassMetadataInfo $metadata) - { - $lines = array(); - - foreach ($metadata->fieldMappings as $fieldMapping) { - if ($this->_hasProperty($fieldMapping['fieldName'], $metadata) || - $metadata->isInheritedField($fieldMapping['fieldName'])) { - continue; - } - - $lines[] = $this->_generateFieldMappingPropertyDocBlock($fieldMapping, $metadata); - $lines[] = $this->_spaces . 'private $' . $fieldMapping['fieldName'] - . (isset($fieldMapping['default']) ? ' = ' . var_export($fieldMapping['default'], true) : null) . ";\n"; - } - - return implode("\n", $lines); - } - - private function _generateEntityStubMethod(ClassMetadataInfo $metadata, $type, $fieldName, $typeHint = null, $defaultValue = null) - { - $methodName = $type . Inflector::classify($fieldName); - if (in_array($type, array("add", "remove")) && substr($methodName, -1) == "s") { - $methodName = substr($methodName, 0, -1); - } - - if ($this->_hasMethod($methodName, $metadata)) { - return; - } - $this->_staticReflection[$metadata->name]['methods'][] = $methodName; - - $var = sprintf('_%sMethodTemplate', $type); - $template = self::$$var; - - $variableType = $typeHint ? $typeHint . ' ' : null; - - $types = \Doctrine\DBAL\Types\Type::getTypesMap(); - $methodTypeHint = $typeHint && ! isset($types[$typeHint]) ? '\\' . $typeHint . ' ' : null; - - $replacements = array( - '' => ucfirst($type) . ' ' . $fieldName, - '' => $methodTypeHint, - '' => $variableType, - '' => Inflector::camelize($fieldName), - '' => $methodName, - '' => $fieldName, - '' => ($defaultValue !== null ) ? (' = '.$defaultValue) : '', - '' => $this->_getClassName($metadata) - ); - - $method = str_replace( - array_keys($replacements), - array_values($replacements), - $template - ); - - return $this->_prefixCodeWithSpaces($method); - } - - private function _generateLifecycleCallbackMethod($name, $methodName, $metadata) - { - if ($this->_hasMethod($methodName, $metadata)) { - return; - } - $this->_staticReflection[$metadata->name]['methods'][] = $methodName; - - $replacements = array( - '' => $this->_annotationsPrefix . ucfirst($name), - '' => $methodName, - ); - - $method = str_replace( - array_keys($replacements), - array_values($replacements), - self::$_lifecycleCallbackMethodTemplate - ); - - return $this->_prefixCodeWithSpaces($method); - } - - private function _generateJoinColumnAnnotation(array $joinColumn) - { - $joinColumnAnnot = array(); - - if (isset($joinColumn['name'])) { - $joinColumnAnnot[] = 'name="' . $joinColumn['name'] . '"'; - } - - if (isset($joinColumn['referencedColumnName'])) { - $joinColumnAnnot[] = 'referencedColumnName="' . $joinColumn['referencedColumnName'] . '"'; - } - - if (isset($joinColumn['unique']) && $joinColumn['unique']) { - $joinColumnAnnot[] = 'unique=' . ($joinColumn['unique'] ? 'true' : 'false'); - } - - if (isset($joinColumn['nullable'])) { - $joinColumnAnnot[] = 'nullable=' . ($joinColumn['nullable'] ? 'true' : 'false'); - } - - if (isset($joinColumn['onDelete'])) { - $joinColumnAnnot[] = 'onDelete="' . ($joinColumn['onDelete'] . '"'); - } - - if (isset($joinColumn['columnDefinition'])) { - $joinColumnAnnot[] = 'columnDefinition="' . $joinColumn['columnDefinition'] . '"'; - } - - return '@' . $this->_annotationsPrefix . 'JoinColumn(' . implode(', ', $joinColumnAnnot) . ')'; - } - - private function _generateAssociationMappingPropertyDocBlock(array $associationMapping, ClassMetadataInfo $metadata) - { - $lines = array(); - $lines[] = $this->_spaces . '/**'; - - if ($associationMapping['type'] & ClassMetadataInfo::TO_MANY) { - $lines[] = $this->_spaces . ' * @var \Doctrine\Common\Collections\ArrayCollection'; - } else { - $lines[] = $this->_spaces . ' * @var ' . $associationMapping['targetEntity']; - } - - if ($this->_generateAnnotations) { - $lines[] = $this->_spaces . ' *'; - - if (isset($associationMapping['id']) && $associationMapping['id']) { - $lines[] = $this->_spaces . ' * @' . $this->_annotationsPrefix . 'Id'; - - if ($generatorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) { - $lines[] = $this->_spaces . ' * @' . $this->_annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")'; - } - } - - $type = null; - switch ($associationMapping['type']) { - case ClassMetadataInfo::ONE_TO_ONE: - $type = 'OneToOne'; - break; - case ClassMetadataInfo::MANY_TO_ONE: - $type = 'ManyToOne'; - break; - case ClassMetadataInfo::ONE_TO_MANY: - $type = 'OneToMany'; - break; - case ClassMetadataInfo::MANY_TO_MANY: - $type = 'ManyToMany'; - break; - } - $typeOptions = array(); - - if (isset($associationMapping['targetEntity'])) { - $typeOptions[] = 'targetEntity="' . $associationMapping['targetEntity'] . '"'; - } - - if (isset($associationMapping['inversedBy'])) { - $typeOptions[] = 'inversedBy="' . $associationMapping['inversedBy'] . '"'; - } - - if (isset($associationMapping['mappedBy'])) { - $typeOptions[] = 'mappedBy="' . $associationMapping['mappedBy'] . '"'; - } - - if ($associationMapping['cascade']) { - $cascades = array(); - - if ($associationMapping['isCascadePersist']) $cascades[] = '"persist"'; - if ($associationMapping['isCascadeRemove']) $cascades[] = '"remove"'; - if ($associationMapping['isCascadeDetach']) $cascades[] = '"detach"'; - if ($associationMapping['isCascadeMerge']) $cascades[] = '"merge"'; - if ($associationMapping['isCascadeRefresh']) $cascades[] = '"refresh"'; - - $typeOptions[] = 'cascade={' . implode(',', $cascades) . '}'; - } - - if (isset($associationMapping['orphanRemoval']) && $associationMapping['orphanRemoval']) { - $typeOptions[] = 'orphanRemoval=' . ($associationMapping['orphanRemoval'] ? 'true' : 'false'); - } - - $lines[] = $this->_spaces . ' * @' . $this->_annotationsPrefix . '' . $type . '(' . implode(', ', $typeOptions) . ')'; - - if (isset($associationMapping['joinColumns']) && $associationMapping['joinColumns']) { - $lines[] = $this->_spaces . ' * @' . $this->_annotationsPrefix . 'JoinColumns({'; - - $joinColumnsLines = array(); - - foreach ($associationMapping['joinColumns'] as $joinColumn) { - if ($joinColumnAnnot = $this->_generateJoinColumnAnnotation($joinColumn)) { - $joinColumnsLines[] = $this->_spaces . ' * ' . $joinColumnAnnot; - } - } - - $lines[] = implode(",\n", $joinColumnsLines); - $lines[] = $this->_spaces . ' * })'; - } - - if (isset($associationMapping['joinTable']) && $associationMapping['joinTable']) { - $joinTable = array(); - $joinTable[] = 'name="' . $associationMapping['joinTable']['name'] . '"'; - - if (isset($associationMapping['joinTable']['schema'])) { - $joinTable[] = 'schema="' . $associationMapping['joinTable']['schema'] . '"'; - } - - $lines[] = $this->_spaces . ' * @' . $this->_annotationsPrefix . 'JoinTable(' . implode(', ', $joinTable) . ','; - $lines[] = $this->_spaces . ' * joinColumns={'; - - foreach ($associationMapping['joinTable']['joinColumns'] as $joinColumn) { - $lines[] = $this->_spaces . ' * ' . $this->_generateJoinColumnAnnotation($joinColumn); - } - - $lines[] = $this->_spaces . ' * },'; - $lines[] = $this->_spaces . ' * inverseJoinColumns={'; - - foreach ($associationMapping['joinTable']['inverseJoinColumns'] as $joinColumn) { - $lines[] = $this->_spaces . ' * ' . $this->_generateJoinColumnAnnotation($joinColumn); - } - - $lines[] = $this->_spaces . ' * }'; - $lines[] = $this->_spaces . ' * )'; - } - - if (isset($associationMapping['orderBy'])) { - $lines[] = $this->_spaces . ' * @' . $this->_annotationsPrefix . 'OrderBy({'; - - foreach ($associationMapping['orderBy'] as $name => $direction) { - $lines[] = $this->_spaces . ' * "' . $name . '"="' . $direction . '",'; - } - - $lines[count($lines) - 1] = substr($lines[count($lines) - 1], 0, strlen($lines[count($lines) - 1]) - 1); - $lines[] = $this->_spaces . ' * })'; - } - } - - $lines[] = $this->_spaces . ' */'; - - return implode("\n", $lines); - } - - private function _generateFieldMappingPropertyDocBlock(array $fieldMapping, ClassMetadataInfo $metadata) - { - $lines = array(); - $lines[] = $this->_spaces . '/**'; - $lines[] = $this->_spaces . ' * @var ' . $fieldMapping['type'] . ' $' . $fieldMapping['fieldName']; - - if ($this->_generateAnnotations) { - $lines[] = $this->_spaces . ' *'; - - $column = array(); - if (isset($fieldMapping['columnName'])) { - $column[] = 'name="' . $fieldMapping['columnName'] . '"'; - } - - if (isset($fieldMapping['type'])) { - $column[] = 'type="' . $fieldMapping['type'] . '"'; - } - - if (isset($fieldMapping['length'])) { - $column[] = 'length=' . $fieldMapping['length']; - } - - if (isset($fieldMapping['precision'])) { - $column[] = 'precision=' . $fieldMapping['precision']; - } - - if (isset($fieldMapping['scale'])) { - $column[] = 'scale=' . $fieldMapping['scale']; - } - - if (isset($fieldMapping['nullable'])) { - $column[] = 'nullable=' . var_export($fieldMapping['nullable'], true); - } - - if (isset($fieldMapping['columnDefinition'])) { - $column[] = 'columnDefinition="' . $fieldMapping['columnDefinition'] . '"'; - } - - if (isset($fieldMapping['unique'])) { - $column[] = 'unique=' . var_export($fieldMapping['unique'], true); - } - - $lines[] = $this->_spaces . ' * @' . $this->_annotationsPrefix . 'Column(' . implode(', ', $column) . ')'; - - if (isset($fieldMapping['id']) && $fieldMapping['id']) { - $lines[] = $this->_spaces . ' * @' . $this->_annotationsPrefix . 'Id'; - - if ($generatorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) { - $lines[] = $this->_spaces.' * @' . $this->_annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")'; - } - - if ($metadata->sequenceGeneratorDefinition) { - $sequenceGenerator = array(); - - if (isset($metadata->sequenceGeneratorDefinition['sequenceName'])) { - $sequenceGenerator[] = 'sequenceName="' . $metadata->sequenceGeneratorDefinition['sequenceName'] . '"'; - } - - if (isset($metadata->sequenceGeneratorDefinition['allocationSize'])) { - $sequenceGenerator[] = 'allocationSize=' . $metadata->sequenceGeneratorDefinition['allocationSize']; - } - - if (isset($metadata->sequenceGeneratorDefinition['initialValue'])) { - $sequenceGenerator[] = 'initialValue=' . $metadata->sequenceGeneratorDefinition['initialValue']; - } - - $lines[] = $this->_spaces . ' * @' . $this->_annotationsPrefix . 'SequenceGenerator(' . implode(', ', $sequenceGenerator) . ')'; - } - } - - if (isset($fieldMapping['version']) && $fieldMapping['version']) { - $lines[] = $this->_spaces . ' * @' . $this->_annotationsPrefix . 'Version'; - } - } - - $lines[] = $this->_spaces . ' */'; - - return implode("\n", $lines); - } - - private function _prefixCodeWithSpaces($code, $num = 1) - { - $lines = explode("\n", $code); - - foreach ($lines as $key => $value) { - $lines[$key] = str_repeat($this->_spaces, $num) . $lines[$key]; - } - - return implode("\n", $lines); - } - - private function _getInheritanceTypeString($type) - { - switch ($type) { - case ClassMetadataInfo::INHERITANCE_TYPE_NONE: - return 'NONE'; - - case ClassMetadataInfo::INHERITANCE_TYPE_JOINED: - return 'JOINED'; - - case ClassMetadataInfo::INHERITANCE_TYPE_SINGLE_TABLE: - return 'SINGLE_TABLE'; - - case ClassMetadataInfo::INHERITANCE_TYPE_TABLE_PER_CLASS: - return 'PER_CLASS'; - - default: - throw new \InvalidArgumentException('Invalid provided InheritanceType: ' . $type); - } - } - - private function _getChangeTrackingPolicyString($policy) - { - switch ($policy) { - case ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT: - return 'DEFERRED_IMPLICIT'; - - case ClassMetadataInfo::CHANGETRACKING_DEFERRED_EXPLICIT: - return 'DEFERRED_EXPLICIT'; - - case ClassMetadataInfo::CHANGETRACKING_NOTIFY: - return 'NOTIFY'; - - default: - throw new \InvalidArgumentException('Invalid provided ChangeTrackingPolicy: ' . $policy); - } - } - - private function _getIdGeneratorTypeString($type) - { - switch ($type) { - case ClassMetadataInfo::GENERATOR_TYPE_AUTO: - return 'AUTO'; - - case ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE: - return 'SEQUENCE'; - - case ClassMetadataInfo::GENERATOR_TYPE_TABLE: - return 'TABLE'; - - case ClassMetadataInfo::GENERATOR_TYPE_IDENTITY: - return 'IDENTITY'; - - case ClassMetadataInfo::GENERATOR_TYPE_NONE: - return 'NONE'; - - default: - throw new \InvalidArgumentException('Invalid provided IdGeneratorType: ' . $type); - } - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php deleted file mode 100644 index 74740db..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php +++ /dev/null @@ -1,83 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools; - -/** - * Class to generate entity repository classes - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class EntityRepositoryGenerator -{ - protected static $_template = -'; - -use Doctrine\ORM\EntityRepository; - -/** - * - * - * This class was generated by the Doctrine ORM. Add your own custom - * repository methods below. - */ -class extends EntityRepository -{ -}'; - - public function generateEntityRepositoryClass($fullClassName) - { - $namespace = substr($fullClassName, 0, strrpos($fullClassName, '\\')); - $className = substr($fullClassName, strrpos($fullClassName, '\\') + 1, strlen($fullClassName)); - - $variables = array( - '' => $namespace, - '' => $className - ); - return str_replace(array_keys($variables), array_values($variables), self::$_template); - } - - public function writeEntityRepositoryClass($fullClassName, $outputDirectory) - { - $code = $this->generateEntityRepositoryClass($fullClassName); - - $path = $outputDirectory . DIRECTORY_SEPARATOR - . str_replace('\\', \DIRECTORY_SEPARATOR, $fullClassName) . '.php'; - $dir = dirname($path); - - if ( ! is_dir($dir)) { - mkdir($dir, 0777, true); - } - - if ( ! file_exists($path)) { - file_put_contents($path, $code); - } - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Event/GenerateSchemaEventArgs.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Event/GenerateSchemaEventArgs.php deleted file mode 100644 index 02d04a2..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Event/GenerateSchemaEventArgs.php +++ /dev/null @@ -1,65 +0,0 @@ -. -*/ - -namespace Doctrine\ORM\Tools\Event; - -use Doctrine\DBAL\Schema\Schema; -use Doctrine\ORM\EntityManager; - -/** - * Event Args used for the Events::postGenerateSchema event. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 1.0 - * @version $Revision$ - * @author Benjamin Eberlei - */ -class GenerateSchemaEventArgs extends \Doctrine\Common\EventArgs -{ - private $_em = null; - private $_schema = null; - - /** - * @param ClassMetadata $classMetadata - * @param Schema $schema - * @param Table $classTable - */ - public function __construct(EntityManager $em, Schema $schema) - { - $this->_em = $em; - $this->_schema = $schema; - } - - /** - * @return EntityManager - */ - public function getEntityManager() { - return $this->_em; - } - - /** - * @return Schema - */ - public function getSchema() { - return $this->_schema; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Event/GenerateSchemaTableEventArgs.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Event/GenerateSchemaTableEventArgs.php deleted file mode 100644 index 54aa6e7..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Event/GenerateSchemaTableEventArgs.php +++ /dev/null @@ -1,75 +0,0 @@ -. -*/ - -namespace Doctrine\ORM\Tools\Event; - -use Doctrine\ORM\Mapping\ClassMetadata; -use Doctrine\DBAL\Schema\Schema; -use Doctrine\DBAL\Schema\Table; - -/** - * Event Args used for the Events::postGenerateSchemaTable event. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 1.0 - * @version $Revision$ - * @author Benjamin Eberlei - */ -class GenerateSchemaTableEventArgs extends \Doctrine\Common\EventArgs -{ - private $_classMetadata = null; - private $_schema = null; - private $_classTable = null; - - /** - * @param ClassMetadata $classMetadata - * @param Schema $schema - * @param Table $classTable - */ - public function __construct(ClassMetadata $classMetadata, Schema $schema, Table $classTable) - { - $this->_classMetadata = $classMetadata; - $this->_schema = $schema; - $this->_classTable = $classTable; - } - - /** - * @return ClassMetadata - */ - public function getClassMetadata() { - return $this->_classMetadata; - } - - /** - * @return Schema - */ - public function getSchema() { - return $this->_schema; - } - - /** - * @return Table - */ - public function getClassTable() { - return $this->_classTable; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php deleted file mode 100644 index 2b528a2..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php +++ /dev/null @@ -1,76 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Export; - -use Doctrine\ORM\Tools\Export\ExportException, - Doctrine\ORM\EntityManager; - -/** - * Class used for converting your mapping information between the - * supported formats: yaml, xml, and php/annotation. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Jonathan Wage - */ -class ClassMetadataExporter -{ - private static $_exporterDrivers = array( - 'xml' => 'Doctrine\ORM\Tools\Export\Driver\XmlExporter', - 'yaml' => 'Doctrine\ORM\Tools\Export\Driver\YamlExporter', - 'yml' => 'Doctrine\ORM\Tools\Export\Driver\YamlExporter', - 'php' => 'Doctrine\ORM\Tools\Export\Driver\PhpExporter', - 'annotation' => 'Doctrine\ORM\Tools\Export\Driver\AnnotationExporter' - ); - - /** - * Register a new exporter driver class under a specified name - * - * @param string $name - * @param string $class - */ - public static function registerExportDriver($name, $class) - { - self::$_exporterDrivers[$name] = $class; - } - - /** - * Get a exporter driver instance - * - * @param string $type The type to get (yml, xml, etc.) - * @param string $source The directory where the exporter will export to - * @return AbstractExporter $exporter - */ - public function getExporter($type, $dest = null) - { - if ( ! isset(self::$_exporterDrivers[$type])) { - throw ExportException::invalidExporterDriverType($type); - } - - $class = self::$_exporterDrivers[$type]; - - return new $class($dest); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php deleted file mode 100644 index 41ec6fd..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php +++ /dev/null @@ -1,217 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Export\Driver; - -use Doctrine\ORM\Mapping\ClassMetadataInfo; -use Doctrine\ORM\Tools\Export\ExportException; - -/** - * Abstract base class which is to be used for the Exporter drivers - * which can be found in \Doctrine\ORM\Tools\Export\Driver - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Jonathan Wage - */ -abstract class AbstractExporter -{ - protected $_metadata = array(); - protected $_outputDir; - protected $_extension; - protected $_overwriteExistingFiles = false; - - public function __construct($dir = null) - { - $this->_outputDir = $dir; - } - - public function setOverwriteExistingFiles($overwrite) - { - $this->_overwriteExistingFiles = $overwrite; - } - - /** - * Converts a single ClassMetadata instance to the exported format - * and returns it - * - * @param ClassMetadataInfo $metadata - * @return mixed $exported - */ - abstract public function exportClassMetadata(ClassMetadataInfo $metadata); - - /** - * Set the array of ClassMetadataInfo instances to export - * - * @param array $metadata - * @return void - */ - public function setMetadata(array $metadata) - { - $this->_metadata = $metadata; - } - - /** - * Get the extension used to generated the path to a class - * - * @return string $extension - */ - public function getExtension() - { - return $this->_extension; - } - - /** - * Set the directory to output the mapping files to - * - * [php] - * $exporter = new YamlExporter($metadata); - * $exporter->setOutputDir(__DIR__ . '/yaml'); - * $exporter->export(); - * - * @param string $dir - * @return void - */ - public function setOutputDir($dir) - { - $this->_outputDir = $dir; - } - - /** - * Export each ClassMetadata instance to a single Doctrine Mapping file - * named after the entity - * - * @return void - */ - public function export() - { - if ( ! is_dir($this->_outputDir)) { - mkdir($this->_outputDir, 0777, true); - } - - foreach ($this->_metadata as $metadata) { - //In case output is returned, write it to a file, skip otherwise - if($output = $this->exportClassMetadata($metadata)){ - $path = $this->_generateOutputPath($metadata); - $dir = dirname($path); - if ( ! is_dir($dir)) { - mkdir($dir, 0777, true); - } - if (file_exists($path) && !$this->_overwriteExistingFiles) { - throw ExportException::attemptOverwriteExistingFile($path); - } - file_put_contents($path, $output); - } - } - } - - /** - * Generate the path to write the class for the given ClassMetadataInfo instance - * - * @param ClassMetadataInfo $metadata - * @return string $path - */ - protected function _generateOutputPath(ClassMetadataInfo $metadata) - { - return $this->_outputDir . '/' . str_replace('\\', '.', $metadata->name) . $this->_extension; - } - - /** - * Set the directory to output the mapping files to - * - * [php] - * $exporter = new YamlExporter($metadata, __DIR__ . '/yaml'); - * $exporter->setExtension('.yml'); - * $exporter->export(); - * - * @param string $extension - * @return void - */ - public function setExtension($extension) - { - $this->_extension = $extension; - } - - protected function _getInheritanceTypeString($type) - { - switch ($type) - { - case ClassMetadataInfo::INHERITANCE_TYPE_NONE: - return 'NONE'; - break; - - case ClassMetadataInfo::INHERITANCE_TYPE_JOINED: - return 'JOINED'; - break; - - case ClassMetadataInfo::INHERITANCE_TYPE_SINGLE_TABLE: - return 'SINGLE_TABLE'; - break; - - case ClassMetadataInfo::INHERITANCE_TYPE_TABLE_PER_CLASS: - return 'PER_CLASS'; - break; - } - } - - protected function _getChangeTrackingPolicyString($policy) - { - switch ($policy) - { - case ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT: - return 'DEFERRED_IMPLICIT'; - break; - - case ClassMetadataInfo::CHANGETRACKING_DEFERRED_EXPLICIT: - return 'DEFERRED_EXPLICIT'; - break; - - case ClassMetadataInfo::CHANGETRACKING_NOTIFY: - return 'NOTIFY'; - break; - } - } - - protected function _getIdGeneratorTypeString($type) - { - switch ($type) - { - case ClassMetadataInfo::GENERATOR_TYPE_AUTO: - return 'AUTO'; - break; - - case ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE: - return 'SEQUENCE'; - break; - - case ClassMetadataInfo::GENERATOR_TYPE_TABLE: - return 'TABLE'; - break; - - case ClassMetadataInfo::GENERATOR_TYPE_IDENTITY: - return 'IDENTITY'; - break; - } - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php deleted file mode 100644 index d12c109..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php +++ /dev/null @@ -1,71 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Export\Driver; - -use Doctrine\ORM\Mapping\ClassMetadataInfo, - Doctrine\ORM\Tools\EntityGenerator; - -/** - * ClassMetadata exporter for PHP classes with annotations - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Jonathan Wage - */ -class AnnotationExporter extends AbstractExporter -{ - protected $_extension = '.php'; - private $_entityGenerator; - - /** - * Converts a single ClassMetadata instance to the exported format - * and returns it - * - * @param ClassMetadataInfo $metadata - * @return string $exported - */ - public function exportClassMetadata(ClassMetadataInfo $metadata) - { - if ( ! $this->_entityGenerator) { - throw new \RuntimeException('For the AnnotationExporter you must set an EntityGenerator instance with the setEntityGenerator() method.'); - } - $this->_entityGenerator->setGenerateAnnotations(true); - $this->_entityGenerator->setGenerateStubMethods(false); - $this->_entityGenerator->setRegenerateEntityIfExists(false); - $this->_entityGenerator->setUpdateEntityIfExists(false); - - return $this->_entityGenerator->generateEntityClass($metadata); - } - - protected function _generateOutputPath(ClassMetadataInfo $metadata) - { - return $this->_outputDir . '/' . str_replace('\\', '/', $metadata->name) . $this->_extension; - } - - public function setEntityGenerator(EntityGenerator $entityGenerator) - { - $this->_entityGenerator = $entityGenerator; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php deleted file mode 100644 index 5332edb..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php +++ /dev/null @@ -1,169 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Export\Driver; - -use Doctrine\ORM\Mapping\ClassMetadataInfo; - -/** - * ClassMetadata exporter for PHP code - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Jonathan Wage - */ -class PhpExporter extends AbstractExporter -{ - protected $_extension = '.php'; - - /** - * Converts a single ClassMetadata instance to the exported format - * and returns it - * - * @param ClassMetadataInfo $metadata - * @return mixed $exported - */ - public function exportClassMetadata(ClassMetadataInfo $metadata) - { - $lines = array(); - $lines[] = 'isMappedSuperclass) { - $lines[] = '$metadata->isMappedSuperclass = true;'; - } - - if ($metadata->inheritanceType) { - $lines[] = '$metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_' . $this->_getInheritanceTypeString($metadata->inheritanceType) . ');'; - } - - if ($metadata->customRepositoryClassName) { - $lines[] = "\$metadata->customRepositoryClassName = '" . $metadata->customRepositoryClassName . "';"; - } - - if ($metadata->table) { - $lines[] = '$metadata->setPrimaryTable(' . $this->_varExport($metadata->table) . ');'; - } - - if ($metadata->discriminatorColumn) { - $lines[] = '$metadata->setDiscriminatorColumn(' . $this->_varExport($metadata->discriminatorColumn) . ');'; - } - - if ($metadata->discriminatorMap) { - $lines[] = '$metadata->setDiscriminatorMap(' . $this->_varExport($metadata->discriminatorMap) . ');'; - } - - if ($metadata->changeTrackingPolicy) { - $lines[] = '$metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_' . $this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy) . ');'; - } - - if ($metadata->lifecycleCallbacks) { - foreach ($metadata->lifecycleCallbacks as $event => $callbacks) { - foreach ($callbacks as $callback) { - $lines[] = "\$metadata->addLifecycleCallback('$callback', '$event');"; - } - } - } - - foreach ($metadata->fieldMappings as $fieldMapping) { - $lines[] = '$metadata->mapField(' . $this->_varExport($fieldMapping) . ');'; - } - - if ( ! $metadata->isIdentifierComposite && $generatorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) { - $lines[] = '$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_' . $generatorType . ');'; - } - - foreach ($metadata->associationMappings as $associationMapping) { - $cascade = array('remove', 'persist', 'refresh', 'merge', 'detach'); - foreach ($cascade as $key => $value) { - if ( ! $associationMapping['isCascade'.ucfirst($value)]) { - unset($cascade[$key]); - } - } - $associationMappingArray = array( - 'fieldName' => $associationMapping['fieldName'], - 'targetEntity' => $associationMapping['targetEntity'], - 'cascade' => $cascade, - ); - - if ($associationMapping['type'] & ClassMetadataInfo::TO_ONE) { - $method = 'mapOneToOne'; - $oneToOneMappingArray = array( - 'mappedBy' => $associationMapping['mappedBy'], - 'inversedBy' => $associationMapping['inversedBy'], - 'joinColumns' => $associationMapping['joinColumns'], - 'orphanRemoval' => $associationMapping['orphanRemoval'], - ); - - $associationMappingArray = array_merge($associationMappingArray, $oneToOneMappingArray); - } else if ($associationMapping['type'] == ClassMetadataInfo::ONE_TO_MANY) { - $method = 'mapOneToMany'; - $potentialAssociationMappingIndexes = array( - 'mappedBy', - 'orphanRemoval', - 'orderBy', - ); - foreach ($potentialAssociationMappingIndexes as $index) { - if (isset($associationMapping[$index])) { - $oneToManyMappingArray[$index] = $associationMapping[$index]; - } - } - $associationMappingArray = array_merge($associationMappingArray, $oneToManyMappingArray); - } else if ($associationMapping['type'] == ClassMetadataInfo::MANY_TO_MANY) { - $method = 'mapManyToMany'; - $potentialAssociationMappingIndexes = array( - 'mappedBy', - 'joinTable', - 'orderBy', - ); - foreach ($potentialAssociationMappingIndexes as $index) { - if (isset($associationMapping[$index])) { - $manyToManyMappingArray[$index] = $associationMapping[$index]; - } - } - $associationMappingArray = array_merge($associationMappingArray, $manyToManyMappingArray); - } - - $lines[] = '$metadata->' . $method . '(' . $this->_varExport($associationMappingArray) . ');'; - } - - return implode("\n", $lines); - } - - protected function _varExport($var) - { - $export = var_export($var, true); - $export = str_replace("\n", PHP_EOL . str_repeat(' ', 8), $export); - $export = str_replace(' ', ' ', $export); - $export = str_replace('array (', 'array(', $export); - $export = str_replace('array( ', 'array(', $export); - $export = str_replace(',)', ')', $export); - $export = str_replace(', )', ')', $export); - $export = str_replace(' ', ' ', $export); - - return $export; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php deleted file mode 100644 index 2cad8a4..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php +++ /dev/null @@ -1,320 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Export\Driver; - -use Doctrine\ORM\Mapping\ClassMetadataInfo; - -/** - * ClassMetadata exporter for Doctrine XML mapping files - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Jonathan Wage - */ -class XmlExporter extends AbstractExporter -{ - protected $_extension = '.dcm.xml'; - - /** - * Converts a single ClassMetadata instance to the exported format - * and returns it - * - * @param ClassMetadataInfo $metadata - * @return mixed $exported - */ - public function exportClassMetadata(ClassMetadataInfo $metadata) - { - $xml = new \SimpleXmlElement(""); - - /*$xml->addAttribute('xmlns', 'http://doctrine-project.org/schemas/orm/doctrine-mapping'); - $xml->addAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); - $xml->addAttribute('xsi:schemaLocation', 'http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd');*/ - - if ($metadata->isMappedSuperclass) { - $root = $xml->addChild('mapped-superclass'); - } else { - $root = $xml->addChild('entity'); - } - - if ($metadata->customRepositoryClassName) { - $root->addAttribute('repository-class', $metadata->customRepositoryClassName); - } - - $root->addAttribute('name', $metadata->name); - - if (isset($metadata->table['name'])) { - $root->addAttribute('table', $metadata->table['name']); - } - - if (isset($metadata->table['schema'])) { - $root->addAttribute('schema', $metadata->table['schema']); - } - - if (isset($metadata->table['inheritance-type'])) { - $root->addAttribute('inheritance-type', $metadata->table['inheritance-type']); - } - - if ($metadata->discriminatorColumn) { - $discriminatorColumnXml = $root->addChild('discriminiator-column'); - $discriminatorColumnXml->addAttribute('name', $metadata->discriminatorColumn['name']); - $discriminatorColumnXml->addAttribute('type', $metadata->discriminatorColumn['type']); - $discriminatorColumnXml->addAttribute('length', $metadata->discriminatorColumn['length']); - } - - if ($metadata->discriminatorMap) { - $discriminatorMapXml = $root->addChild('discriminator-map'); - foreach ($metadata->discriminatorMap as $value => $className) { - $discriminatorMappingXml = $discriminatorMapXml->addChild('discriminator-mapping'); - $discriminatorMappingXml->addAttribute('value', $value); - $discriminatorMappingXml->addAttribute('class', $className); - } - } - - $root->addChild('change-tracking-policy', $this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy)); - - if (isset($metadata->table['indexes'])) { - $indexesXml = $root->addChild('indexes'); - - foreach ($metadata->table['indexes'] as $name => $index) { - $indexXml = $indexesXml->addChild('index'); - $indexXml->addAttribute('name', $name); - $indexXml->addAttribute('columns', implode(',', $index['columns'])); - } - } - - if (isset($metadata->table['uniqueConstraints'])) { - $uniqueConstraintsXml = $root->addChild('unique-constraints'); - - foreach ($metadata->table['uniqueConstraints'] as $unique) { - $uniqueConstraintXml = $uniqueConstraintsXml->addChild('unique-constraint'); - $uniqueConstraintXml->addAttribute('name', $unique['name']); - $uniqueConstraintXml->addAttribute('columns', implode(',', $unique['columns'])); - } - } - - $fields = $metadata->fieldMappings; - - $id = array(); - foreach ($fields as $name => $field) { - if (isset($field['id']) && $field['id']) { - $id[$name] = $field; - unset($fields[$name]); - } - } - - if ( ! $metadata->isIdentifierComposite && $idGeneratorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) { - $id[$metadata->getSingleIdentifierFieldName()]['generator']['strategy'] = $idGeneratorType; - } - - if ($id) { - foreach ($id as $field) { - $idXml = $root->addChild('id'); - $idXml->addAttribute('name', $field['fieldName']); - $idXml->addAttribute('type', $field['type']); - if (isset($field['columnName'])) { - $idXml->addAttribute('column', $field['columnName']); - } - if (isset($field['associationKey']) && $field['associationKey']) { - $idXml->addAttribute('association-key', 'true'); - } - if ($idGeneratorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) { - $generatorXml = $idXml->addChild('generator'); - $generatorXml->addAttribute('strategy', $idGeneratorType); - } - } - } - - if ($fields) { - foreach ($fields as $field) { - $fieldXml = $root->addChild('field'); - $fieldXml->addAttribute('name', $field['fieldName']); - $fieldXml->addAttribute('type', $field['type']); - if (isset($field['columnName'])) { - $fieldXml->addAttribute('column', $field['columnName']); - } - if (isset($field['length'])) { - $fieldXml->addAttribute('length', $field['length']); - } - if (isset($field['precision'])) { - $fieldXml->addAttribute('precision', $field['precision']); - } - if (isset($field['scale'])) { - $fieldXml->addAttribute('scale', $field['scale']); - } - if (isset($field['unique']) && $field['unique']) { - $fieldXml->addAttribute('unique', $field['unique']); - } - if (isset($field['options'])) { - $optionsXml = $fieldXml->addChild('options'); - foreach ($field['options'] as $key => $value) { - $optionsXml->addAttribute($key, $value); - } - } - if (isset($field['version'])) { - $fieldXml->addAttribute('version', $field['version']); - } - if (isset($field['columnDefinition'])) { - $fieldXml->addAttribute('column-definition', $field['columnDefinition']); - } - } - } - - foreach ($metadata->associationMappings as $name => $associationMapping) { - if ($associationMapping['type'] == ClassMetadataInfo::ONE_TO_ONE) { - $associationMappingXml = $root->addChild('one-to-one'); - } else if ($associationMapping['type'] == ClassMetadataInfo::MANY_TO_ONE) { - $associationMappingXml = $root->addChild('many-to-one'); - } else if ($associationMapping['type'] == ClassMetadataInfo::ONE_TO_MANY) { - $associationMappingXml = $root->addChild('one-to-many'); - } else if ($associationMapping['type'] == ClassMetadataInfo::MANY_TO_MANY) { - $associationMappingXml = $root->addChild('many-to-many'); - } - - $associationMappingXml->addAttribute('field', $associationMapping['fieldName']); - $associationMappingXml->addAttribute('target-entity', $associationMapping['targetEntity']); - - if (isset($associationMapping['mappedBy'])) { - $associationMappingXml->addAttribute('mapped-by', $associationMapping['mappedBy']); - } - if (isset($associationMapping['inversedBy'])) { - $associationMappingXml->addAttribute('inversed-by', $associationMapping['inversedBy']); - } - if (isset($associationMapping['orphanRemoval'])) { - $associationMappingXml->addAttribute('orphan-removal', $associationMapping['orphanRemoval']); - } - if (isset($associationMapping['joinTable']) && $associationMapping['joinTable']) { - $joinTableXml = $associationMappingXml->addChild('join-table'); - $joinTableXml->addAttribute('name', $associationMapping['joinTable']['name']); - $joinColumnsXml = $joinTableXml->addChild('join-columns'); - foreach ($associationMapping['joinTable']['joinColumns'] as $joinColumn) { - $joinColumnXml = $joinColumnsXml->addChild('join-column'); - $joinColumnXml->addAttribute('name', $joinColumn['name']); - $joinColumnXml->addAttribute('referenced-column-name', $joinColumn['referencedColumnName']); - if (isset($joinColumn['onDelete'])) { - $joinColumnXml->addAttribute('on-delete', $joinColumn['onDelete']); - } - } - $inverseJoinColumnsXml = $joinTableXml->addChild('inverse-join-columns'); - foreach ($associationMapping['joinTable']['inverseJoinColumns'] as $inverseJoinColumn) { - $inverseJoinColumnXml = $inverseJoinColumnsXml->addChild('join-column'); - $inverseJoinColumnXml->addAttribute('name', $inverseJoinColumn['name']); - $inverseJoinColumnXml->addAttribute('referenced-column-name', $inverseJoinColumn['referencedColumnName']); - if (isset($inverseJoinColumn['onDelete'])) { - $inverseJoinColumnXml->addAttribute('on-delete', $inverseJoinColumn['onDelete']); - } - if (isset($inverseJoinColumn['columnDefinition'])) { - $inverseJoinColumnXml->addAttribute('column-definition', $inverseJoinColumn['columnDefinition']); - } - if (isset($inverseJoinColumn['nullable'])) { - $inverseJoinColumnXml->addAttribute('nullable', $inverseJoinColumn['nullable']); - } - if (isset($inverseJoinColumn['orderBy'])) { - $inverseJoinColumnXml->addAttribute('order-by', $inverseJoinColumn['orderBy']); - } - } - } - if (isset($associationMapping['joinColumns'])) { - $joinColumnsXml = $associationMappingXml->addChild('join-columns'); - foreach ($associationMapping['joinColumns'] as $joinColumn) { - $joinColumnXml = $joinColumnsXml->addChild('join-column'); - $joinColumnXml->addAttribute('name', $joinColumn['name']); - $joinColumnXml->addAttribute('referenced-column-name', $joinColumn['referencedColumnName']); - if (isset($joinColumn['onDelete'])) { - $joinColumnXml->addAttribute('on-delete', $joinColumn['onDelete']); - } - if (isset($joinColumn['columnDefinition'])) { - $joinColumnXml->addAttribute('column-definition', $joinColumn['columnDefinition']); - } - if (isset($joinColumn['nullable'])) { - $joinColumnXml->addAttribute('nullable', $joinColumn['nullable']); - } - } - } - if (isset($associationMapping['orderBy'])) { - $orderByXml = $associationMappingXml->addChild('order-by'); - foreach ($associationMapping['orderBy'] as $name => $direction) { - $orderByFieldXml = $orderByXml->addChild('order-by-field'); - $orderByFieldXml->addAttribute('name', $name); - $orderByFieldXml->addAttribute('direction', $direction); - } - } - $cascade = array(); - if ($associationMapping['isCascadeRemove']) { - $cascade[] = 'cascade-remove'; - } - if ($associationMapping['isCascadePersist']) { - $cascade[] = 'cascade-persist'; - } - if ($associationMapping['isCascadeRefresh']) { - $cascade[] = 'cascade-refresh'; - } - if ($associationMapping['isCascadeMerge']) { - $cascade[] = 'cascade-merge'; - } - if ($associationMapping['isCascadeDetach']) { - $cascade[] = 'cascade-detach'; - } - if (count($cascade) === 5) { - $cascade = array('cascade-all'); - } - if ($cascade) { - $cascadeXml = $associationMappingXml->addChild('cascade'); - foreach ($cascade as $type) { - $cascadeXml->addChild($type); - } - } - } - - if (isset($metadata->lifecycleCallbacks)) { - $lifecycleCallbacksXml = $root->addChild('lifecycle-callbacks'); - foreach ($metadata->lifecycleCallbacks as $name => $methods) { - foreach ($methods as $method) { - $lifecycleCallbackXml = $lifecycleCallbacksXml->addChild('lifecycle-callback'); - $lifecycleCallbackXml->addAttribute('type', $name); - $lifecycleCallbackXml->addAttribute('method', $method); - } - } - } - - return $this->_asXml($xml); - } - - /** - * @param \SimpleXMLElement $simpleXml - * @return string $xml - */ - private function _asXml($simpleXml) - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->loadXML($simpleXml->asXML()); - $dom->formatOutput = true; - - $result = $dom->saveXML(); - return $result; - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php deleted file mode 100644 index 525f5f4..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php +++ /dev/null @@ -1,210 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Export\Driver; - -use Doctrine\ORM\Mapping\ClassMetadataInfo; - -/** - * ClassMetadata exporter for Doctrine YAML mapping files - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Jonathan Wage - */ -class YamlExporter extends AbstractExporter -{ - protected $_extension = '.dcm.yml'; - - /** - * Converts a single ClassMetadata instance to the exported format - * and returns it - * - * TODO: Should this code be pulled out in to a toArray() method in ClassMetadata - * - * @param ClassMetadataInfo $metadata - * @return mixed $exported - */ - public function exportClassMetadata(ClassMetadataInfo $metadata) - { - $array = array(); - - if ($metadata->isMappedSuperclass) { - $array['type'] = 'mappedSuperclass'; - } else { - $array['type'] = 'entity'; - } - - $array['table'] = $metadata->table['name']; - - if (isset($metadata->table['schema'])) { - $array['schema'] = $metadata->table['schema']; - } - - $inheritanceType = $metadata->inheritanceType; - if ($inheritanceType !== ClassMetadataInfo::INHERITANCE_TYPE_NONE) { - $array['inheritanceType'] = $this->_getInheritanceTypeString($inheritanceType); - } - - if ($column = $metadata->discriminatorColumn) { - $array['discriminatorColumn'] = $column; - } - - if ($map = $metadata->discriminatorMap) { - $array['discriminatorMap'] = $map; - } - - if ($metadata->changeTrackingPolicy !== ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT) { - $array['changeTrackingPolicy'] = $this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy); - } - - if (isset($metadata->table['indexes'])) { - $array['indexes'] = $metadata->table['indexes']; - } - - if ($metadata->customRepositoryClassName) { - $array['repositoryClass'] = $metadata->customRepositoryClassName; - } - - if (isset($metadata->table['uniqueConstraints'])) { - $array['uniqueConstraints'] = $metadata->table['uniqueConstraints']; - } - - $fieldMappings = $metadata->fieldMappings; - - $ids = array(); - foreach ($fieldMappings as $name => $fieldMapping) { - $fieldMapping['column'] = $fieldMapping['columnName']; - unset( - $fieldMapping['columnName'], - $fieldMapping['fieldName'] - ); - - if ($fieldMapping['column'] == $name) { - unset($fieldMapping['column']); - } - - if (isset($fieldMapping['id']) && $fieldMapping['id']) { - $ids[$name] = $fieldMapping; - unset($fieldMappings[$name]); - continue; - } - - $fieldMappings[$name] = $fieldMapping; - } - - if ( ! $metadata->isIdentifierComposite && $idGeneratorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) { - $ids[$metadata->getSingleIdentifierFieldName()]['generator']['strategy'] = $idGeneratorType; - } - - if ($ids) { - $array['fields'] = $ids; - } - - if ($fieldMappings) { - if ( ! isset($array['fields'])) { - $array['fields'] = array(); - } - $array['fields'] = array_merge($array['fields'], $fieldMappings); - } - - $associations = array(); - foreach ($metadata->associationMappings as $name => $associationMapping) { - $cascade = array(); - if ($associationMapping['isCascadeRemove']) { - $cascade[] = 'remove'; - } - if ($associationMapping['isCascadePersist']) { - $cascade[] = 'persist'; - } - if ($associationMapping['isCascadeRefresh']) { - $cascade[] = 'refresh'; - } - if ($associationMapping['isCascadeMerge']) { - $cascade[] = 'merge'; - } - if ($associationMapping['isCascadeDetach']) { - $cascade[] = 'detach'; - } - if (count($cascade) === 5) { - $cascade = array('all'); - } - $associationMappingArray = array( - 'targetEntity' => $associationMapping['targetEntity'], - 'cascade' => $cascade, - ); - - if ($associationMapping['type'] & ClassMetadataInfo::TO_ONE) { - $joinColumns = $associationMapping['joinColumns']; - $newJoinColumns = array(); - foreach ($joinColumns as $joinColumn) { - $newJoinColumns[$joinColumn['name']]['referencedColumnName'] = $joinColumn['referencedColumnName']; - if (isset($joinColumn['onDelete'])) { - $newJoinColumns[$joinColumn['name']]['onDelete'] = $joinColumn['onDelete']; - } - } - $oneToOneMappingArray = array( - 'mappedBy' => $associationMapping['mappedBy'], - 'inversedBy' => $associationMapping['inversedBy'], - 'joinColumns' => $newJoinColumns, - 'orphanRemoval' => $associationMapping['orphanRemoval'], - ); - - $associationMappingArray = array_merge($associationMappingArray, $oneToOneMappingArray); - - if ($associationMapping['type'] & ClassMetadataInfo::ONE_TO_ONE) { - $array['oneToOne'][$name] = $associationMappingArray; - } else { - $array['manyToOne'][$name] = $associationMappingArray; - } - - } else if ($associationMapping['type'] == ClassMetadataInfo::ONE_TO_MANY) { - $oneToManyMappingArray = array( - 'mappedBy' => $associationMapping['mappedBy'], - 'inversedBy' => $associationMapping['inversedBy'], - 'orphanRemoval' => $associationMapping['orphanRemoval'], - 'orderBy' => isset($associationMapping['orderBy']) ? $associationMapping['orderBy'] : null - ); - - $associationMappingArray = array_merge($associationMappingArray, $oneToManyMappingArray); - $array['oneToMany'][$name] = $associationMappingArray; - } else if ($associationMapping['type'] == ClassMetadataInfo::MANY_TO_MANY) { - $manyToManyMappingArray = array( - 'mappedBy' => $associationMapping['mappedBy'], - 'inversedBy' => $associationMapping['inversedBy'], - 'joinTable' => isset($associationMapping['joinTable']) ? $associationMapping['joinTable'] : null, - 'orderBy' => isset($associationMapping['orderBy']) ? $associationMapping['orderBy'] : null - ); - - $associationMappingArray = array_merge($associationMappingArray, $manyToManyMappingArray); - $array['manyToMany'][$name] = $associationMappingArray; - } - } - if (isset($metadata->lifecycleCallbacks)) { - $array['lifecycleCallbacks'] = $metadata->lifecycleCallbacks; - } - - return \Symfony\Component\Yaml\Yaml::dump(array($metadata->name => $array), 10); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/ExportException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/ExportException.php deleted file mode 100644 index 5ba8bd2..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/ExportException.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010 David Abdemoulaie (http://hobodave.com/) - * @license http://hobodave.com/license.txt New BSD License - */ -class CountWalker extends TreeWalkerAdapter -{ - /** - * Distinct mode hint name - */ - const HINT_DISTINCT = 'doctrine_paginator.distinct'; - - /** - * Walks down a SelectStatement AST node, modifying it to retrieve a COUNT - * - * @param SelectStatement $AST - * @return void - */ - public function walkSelectStatement(SelectStatement $AST) - { - $rootComponents = array(); - foreach ($this->_getQueryComponents() AS $dqlAlias => $qComp) { - $isParent = array_key_exists('parent', $qComp) - && $qComp['parent'] === null - && $qComp['nestingLevel'] == 0 - ; - if ($isParent) { - $rootComponents[] = array($dqlAlias => $qComp); - } - } - if (count($rootComponents) > 1) { - throw new \RuntimeException("Cannot count query which selects two FROM components, cannot make distinction"); - } - $root = reset($rootComponents); - $parentName = key($root); - $parent = current($root); - - $pathExpression = new PathExpression( - PathExpression::TYPE_STATE_FIELD | PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION, $parentName, - $parent['metadata']->getSingleIdentifierFieldName() - ); - $pathExpression->type = PathExpression::TYPE_STATE_FIELD; - - $distinct = $this->_getQuery()->getHint(self::HINT_DISTINCT); - $AST->selectClause->selectExpressions = array( - new SelectExpression( - new AggregateExpression('count', $pathExpression, $distinct), null - ) - ); - - // ORDER BY is not needed, only increases query execution through unnecessary sorting. - $AST->orderByClause = null; - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php deleted file mode 100644 index 97ed5ba..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php +++ /dev/null @@ -1,115 +0,0 @@ - - * @copyright Copyright (c) 2010 David Abdemoulaie (http://hobodave.com/) - * @license http://hobodave.com/license.txt New BSD License - */ - -namespace Doctrine\ORM\Tools\Pagination; - -use Doctrine\DBAL\Types\Type, - Doctrine\ORM\Query\TreeWalkerAdapter, - Doctrine\ORM\Query\AST\SelectStatement, - Doctrine\ORM\Query\AST\SelectExpression, - Doctrine\ORM\Query\AST\PathExpression, - Doctrine\ORM\Query\AST\AggregateExpression; - -/** - * Replaces the selectClause of the AST with a SELECT DISTINCT root.id equivalent - * - * @category DoctrineExtensions - * @package DoctrineExtensions\Paginate - * @author David Abdemoulaie - * @copyright Copyright (c) 2010 David Abdemoulaie (http://hobodave.com/) - * @license http://hobodave.com/license.txt New BSD License - */ -class LimitSubqueryWalker extends TreeWalkerAdapter -{ - /** - * ID type hint - */ - const IDENTIFIER_TYPE = 'doctrine_paginator.id.type'; - - /** - * @var int Counter for generating unique order column aliases - */ - private $_aliasCounter = 0; - - /** - * Walks down a SelectStatement AST node, modifying it to retrieve DISTINCT ids - * of the root Entity - * - * @param SelectStatement $AST - * @return void - */ - public function walkSelectStatement(SelectStatement $AST) - { - $parent = null; - $parentName = null; - $selectExpressions = array(); - - foreach ($this->_getQueryComponents() AS $dqlAlias => $qComp) { - // preserve mixed data in query for ordering - if (isset($qComp['resultVariable'])) { - $selectExpressions[] = new SelectExpression($qComp['resultVariable'], $dqlAlias); - continue; - } - - if ($qComp['parent'] === null && $qComp['nestingLevel'] == 0) { - $parent = $qComp; - $parentName = $dqlAlias; - continue; - } - } - - $identifier = $parent['metadata']->getSingleIdentifierFieldName(); - $this->_getQuery()->setHint( - self::IDENTIFIER_TYPE, - Type::getType($parent['metadata']->getTypeOfField($identifier)) - ); - - $pathExpression = new PathExpression( - PathExpression::TYPE_STATE_FIELD | PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION, - $parentName, - $identifier - ); - $pathExpression->type = PathExpression::TYPE_STATE_FIELD; - - array_unshift($selectExpressions, new SelectExpression($pathExpression, '_dctrn_id')); - $AST->selectClause->selectExpressions = $selectExpressions; - - if (isset($AST->orderByClause)) { - foreach ($AST->orderByClause->orderByItems as $item) { - if ($item->expression instanceof PathExpression) { - $pathExpression = new PathExpression( - PathExpression::TYPE_STATE_FIELD | PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION, - $item->expression->identificationVariable, - $item->expression->field - ); - $pathExpression->type = PathExpression::TYPE_STATE_FIELD; - $AST->selectClause->selectExpressions[] = new SelectExpression( - $pathExpression, - '_dctrn_ord' . $this->_aliasCounter++ - ); - } - } - } - - $AST->selectClause->isDistinct = true; - } - -} - - - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/Paginator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/Paginator.php deleted file mode 100644 index 760d7de..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/Paginator.php +++ /dev/null @@ -1,180 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools\Pagination; - -use Doctrine\ORM\QueryBuilder; -use Doctrine\ORM\Query; -use Doctrine\ORM\NoResultException; -use Doctrine\ORM\Tools\Pagination\WhereInWalker; -use Doctrine\ORM\Tools\Pagination\CountWalker; -use Countable; -use IteratorAggregate; -use ArrayIterator; - -/** - * Paginator - * - * The paginator can handle various complex scenarios with DQL. - * - * @author Pablo Díez - * @author Benjamin Eberlei - * @license New BSD - */ -class Paginator implements \Countable, \IteratorAggregate -{ - /** - * @var Query - */ - private $query; - - /** - * @var bool - */ - private $fetchJoinCollection; - - /** - * @var int - */ - private $count; - - /** - * Constructor. - * - * @param Query|QueryBuilder $query A Doctrine ORM query or query builder. - * @param Boolean $fetchJoinCollection Whether the query joins a collection (true by default). - */ - public function __construct($query, $fetchJoinCollection = true) - { - if ($query instanceof QueryBuilder) { - $query = $query->getQuery(); - } - - $this->query = $query; - $this->fetchJoinCollection = (Boolean) $fetchJoinCollection; - } - - /** - * Returns the query - * - * @return Query - */ - public function getQuery() - { - return $this->query; - } - - /** - * Returns whether the query joins a collection. - * - * @return Boolean Whether the query joins a collection. - */ - public function getFetchJoinCollection() - { - return $this->fetchJoinCollection; - } - - /** - * {@inheritdoc} - */ - public function count() - { - if ($this->count === null) { - /* @var $countQuery Query */ - $countQuery = $this->cloneQuery($this->query); - - if ( ! $countQuery->getHint(CountWalker::HINT_DISTINCT)) { - $countQuery->setHint(CountWalker::HINT_DISTINCT, true); - } - - $countQuery->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\ORM\Tools\Pagination\CountWalker')); - $countQuery->setFirstResult(null)->setMaxResults(null); - - try { - $data = $countQuery->getScalarResult(); - $data = array_map('current', $data); - $this->count = array_sum($data); - } catch(NoResultException $e) { - $this->count = 0; - } - } - return $this->count; - } - - /** - * {@inheritdoc} - */ - public function getIterator() - { - $offset = $this->query->getFirstResult(); - $length = $this->query->getMaxResults(); - - if ($this->fetchJoinCollection) { - $subQuery = $this->cloneQuery($this->query); - $subQuery->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\ORM\Tools\Pagination\LimitSubqueryWalker')) - ->setFirstResult($offset) - ->setMaxResults($length); - - $ids = array_map('current', $subQuery->getScalarResult()); - - $whereInQuery = $this->cloneQuery($this->query); - // don't do this for an empty id array - if (count($ids) > 0) { - $namespace = WhereInWalker::PAGINATOR_ID_ALIAS; - - $whereInQuery->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\ORM\Tools\Pagination\WhereInWalker')); - $whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, count($ids)); - $whereInQuery->setFirstResult(null)->setMaxResults(null); - foreach ($ids as $i => $id) { - $i++; - $whereInQuery->setParameter("{$namespace}_{$i}", $id); - } - } - - $result = $whereInQuery->getResult($this->query->getHydrationMode()); - } else { - $result = $this->cloneQuery($this->query) - ->setMaxResults($length) - ->setFirstResult($offset) - ->getResult($this->query->getHydrationMode()) - ; - } - return new \ArrayIterator($result); - } - - /** - * Clones a query. - * - * @param Query $query The query. - * - * @return Query The cloned query. - */ - private function cloneQuery(Query $query) - { - /* @var $cloneQuery Query */ - $cloneQuery = clone $query; - $cloneQuery->setParameters($query->getParameters()); - foreach ($query->getHints() as $name => $value) { - $cloneQuery->setHint($name, $value); - } - - return $cloneQuery; - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php deleted file mode 100644 index 5400ef2..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php +++ /dev/null @@ -1,142 +0,0 @@ - - * @copyright Copyright (c) 2010 David Abdemoulaie (http://hobodave.com/) - * @license http://hobodave.com/license.txt New BSD License - */ - -namespace Doctrine\ORM\Tools\Pagination; - -use Doctrine\ORM\Query\AST\ArithmeticExpression, - Doctrine\ORM\Query\AST\SimpleArithmeticExpression, - Doctrine\ORM\Query\TreeWalkerAdapter, - Doctrine\ORM\Query\AST\SelectStatement, - Doctrine\ORM\Query\AST\PathExpression, - Doctrine\ORM\Query\AST\InExpression, - Doctrine\ORM\Query\AST\NullComparisonExpression, - Doctrine\ORM\Query\AST\InputParameter, - Doctrine\ORM\Query\AST\ConditionalPrimary, - Doctrine\ORM\Query\AST\ConditionalTerm, - Doctrine\ORM\Query\AST\ConditionalExpression, - Doctrine\ORM\Query\AST\ConditionalFactor, - Doctrine\ORM\Query\AST\WhereClause; - -/** - * Replaces the whereClause of the AST with a WHERE id IN (:foo_1, :foo_2) equivalent - * - * @category DoctrineExtensions - * @package DoctrineExtensions\Paginate - * @author David Abdemoulaie - * @copyright Copyright (c) 2010 David Abdemoulaie (http://hobodave.com/) - * @license http://hobodave.com/license.txt New BSD License - */ -class WhereInWalker extends TreeWalkerAdapter -{ - /** - * ID Count hint name - */ - const HINT_PAGINATOR_ID_COUNT = 'doctrine.id.count'; - - /** - * Primary key alias for query - */ - const PAGINATOR_ID_ALIAS = 'dpid'; - - /** - * Replaces the whereClause in the AST - * - * Generates a clause equivalent to WHERE IN (:dpid_1, :dpid_2, ...) - * - * The parameter namespace (dpid) is defined by - * the PAGINATOR_ID_ALIAS - * - * The total number of parameters is retrieved from - * the HINT_PAGINATOR_ID_COUNT query hint - * - * @param SelectStatement $AST - * @return void - */ - public function walkSelectStatement(SelectStatement $AST) - { - $rootComponents = array(); - foreach ($this->_getQueryComponents() AS $dqlAlias => $qComp) { - $isParent = array_key_exists('parent', $qComp) - && $qComp['parent'] === null - && $qComp['nestingLevel'] == 0 - ; - if ($isParent) { - $rootComponents[] = array($dqlAlias => $qComp); - } - } - if (count($rootComponents) > 1) { - throw new \RuntimeException("Cannot count query which selects two FROM components, cannot make distinction"); - } - $root = reset($rootComponents); - $parentName = key($root); - $parent = current($root); - - $pathExpression = new PathExpression( - PathExpression::TYPE_STATE_FIELD, $parentName, $parent['metadata']->getSingleIdentifierFieldName() - ); - $pathExpression->type = PathExpression::TYPE_STATE_FIELD; - - $count = $this->_getQuery()->getHint(self::HINT_PAGINATOR_ID_COUNT); - - if ($count > 0) { - $arithmeticExpression = new ArithmeticExpression(); - $arithmeticExpression->simpleArithmeticExpression = new SimpleArithmeticExpression( - array($pathExpression) - ); - $expression = new InExpression($arithmeticExpression); - $ns = self::PAGINATOR_ID_ALIAS; - - for ($i = 1; $i <= $count; $i++) { - $expression->literals[] = new InputParameter(":{$ns}_$i"); - } - } else { - $expression = new NullComparisonExpression($pathExpression); - $expression->not = false; - } - - $conditionalPrimary = new ConditionalPrimary; - $conditionalPrimary->simpleConditionalExpression = $expression; - if ($AST->whereClause) { - if ($AST->whereClause->conditionalExpression instanceof ConditionalTerm) { - $AST->whereClause->conditionalExpression->conditionalFactors[] = $conditionalPrimary; - } elseif ($AST->whereClause->conditionalExpression instanceof ConditionalPrimary) { - $AST->whereClause->conditionalExpression = new ConditionalExpression(array( - new ConditionalTerm(array( - $AST->whereClause->conditionalExpression, - $conditionalPrimary - )) - )); - } elseif ($AST->whereClause->conditionalExpression instanceof ConditionalExpression) { - $tmpPrimary = new ConditionalPrimary; - $tmpPrimary->conditionalExpression = $AST->whereClause->conditionalExpression; - $AST->whereClause->conditionalExpression = new ConditionalTerm(array( - $tmpPrimary, - $conditionalPrimary - )); - } - } else { - $AST->whereClause = new WhereClause( - new ConditionalExpression(array( - new ConditionalTerm(array( - $conditionalPrimary - )) - )) - ); - } - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ResolveTargetEntityListener.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ResolveTargetEntityListener.php deleted file mode 100644 index 621214f..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ResolveTargetEntityListener.php +++ /dev/null @@ -1,94 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools; - -use Doctrine\ORM\Event\LoadClassMetadataEventArgs; -use Doctrine\ORM\Mapping\ClassMetadata; - -/** - * ResolveTargetEntityListener - * - * Mechanism to overwrite interfaces or classes specified as association - * targets. - * - * @author Benjamin Eberlei - * @since 2.2 - */ -class ResolveTargetEntityListener -{ - /** - * @var array - */ - private $resolveTargetEntities = array(); - - /** - * Add a target-entity class name to resolve to a new class name. - * - * @param string $originalEntity - * @param string $newEntity - * @param array $mapping - * @return void - */ - public function addResolveTargetEntity($originalEntity, $newEntity, array $mapping) - { - $mapping['targetEntity'] = ltrim($newEntity, "\\"); - $this->resolveTargetEntities[ltrim($originalEntity, "\\")] = $mapping; - } - - /** - * Process event and resolve new target entity names. - * - * @param LoadClassMetadataEventArgs $args - * @return void - */ - public function loadClassMetadata(LoadClassMetadataEventArgs $args) - { - $cm = $args->getClassMetadata(); - foreach ($cm->associationMappings as $assocName => $mapping) { - if (isset($this->resolveTargetEntities[$mapping['targetEntity']])) { - $this->remapAssociation($cm, $mapping); - } - } - } - - private function remapAssociation($classMetadata, $mapping) - { - $newMapping = $this->resolveTargetEntities[$mapping['targetEntity']]; - $newMapping = array_replace_recursive($mapping, $newMapping); - $newMapping['fieldName'] = $mapping['fieldName']; - unset($classMetadata->associationMappings[$mapping['fieldName']]); - - switch ($mapping['type']) { - case ClassMetadata::MANY_TO_MANY: - $classMetadata->mapManyToMany($newMapping); - break; - case ClassMetadata::MANY_TO_ONE: - $classMetadata->mapManyToOne($newMapping); - break; - case ClassMetadata::ONE_TO_MANY: - $classMetadata->mapOneToMany($newMapping); - break; - case ClassMetadata::ONE_TO_ONE: - $classMetadata->mapOneToOne($newMapping); - break; - } - } -} - diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaTool.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaTool.php deleted file mode 100644 index efe7f7b..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaTool.php +++ /dev/null @@ -1,701 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools; - -use Doctrine\ORM\ORMException, - Doctrine\DBAL\Types\Type, - Doctrine\DBAL\Schema\Schema, - Doctrine\DBAL\Schema\Visitor\RemoveNamespacedAssets, - Doctrine\ORM\EntityManager, - Doctrine\ORM\Mapping\ClassMetadata, - Doctrine\ORM\Internal\CommitOrderCalculator, - Doctrine\ORM\Tools\Event\GenerateSchemaTableEventArgs, - Doctrine\ORM\Tools\Event\GenerateSchemaEventArgs; - -/** - * The SchemaTool is a tool to create/drop/update database schemas based on - * ClassMetadata class descriptors. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class SchemaTool -{ - /** - * @var \Doctrine\ORM\EntityManager - */ - private $_em; - - /** - * @var \Doctrine\DBAL\Platforms\AbstractPlatform - */ - private $_platform; - - /** - * Initializes a new SchemaTool instance that uses the connection of the - * provided EntityManager. - * - * @param \Doctrine\ORM\EntityManager $em - */ - public function __construct(EntityManager $em) - { - $this->_em = $em; - $this->_platform = $em->getConnection()->getDatabasePlatform(); - } - - /** - * Creates the database schema for the given array of ClassMetadata instances. - * - * @throws ToolsException - * @param array $classes - * @return void - */ - public function createSchema(array $classes) - { - $createSchemaSql = $this->getCreateSchemaSql($classes); - $conn = $this->_em->getConnection(); - - foreach ($createSchemaSql as $sql) { - try { - $conn->executeQuery($sql); - } catch(\Exception $e) { - throw ToolsException::schemaToolFailure($sql, $e); - } - } - } - - /** - * Gets the list of DDL statements that are required to create the database schema for - * the given list of ClassMetadata instances. - * - * @param array $classes - * @return array $sql The SQL statements needed to create the schema for the classes. - */ - public function getCreateSchemaSql(array $classes) - { - $schema = $this->getSchemaFromMetadata($classes); - return $schema->toSql($this->_platform); - } - - /** - * Some instances of ClassMetadata don't need to be processed in the SchemaTool context. This method detects them. - * - * @param ClassMetadata $class - * @param array $processedClasses - * @return bool - */ - private function processingNotRequired($class, array $processedClasses) - { - return ( - isset($processedClasses[$class->name]) || - $class->isMappedSuperclass || - ($class->isInheritanceTypeSingleTable() && $class->name != $class->rootEntityName) - ); - } - - /** - * From a given set of metadata classes this method creates a Schema instance. - * - * @param array $classes - * @return Schema - */ - public function getSchemaFromMetadata(array $classes) - { - $processedClasses = array(); // Reminder for processed classes, used for hierarchies - - $sm = $this->_em->getConnection()->getSchemaManager(); - $metadataSchemaConfig = $sm->createSchemaConfig(); - $metadataSchemaConfig->setExplicitForeignKeyIndexes(false); - $schema = new Schema(array(), array(), $metadataSchemaConfig); - - $evm = $this->_em->getEventManager(); - - foreach ($classes as $class) { - if ($this->processingNotRequired($class, $processedClasses)) { - continue; - } - - $table = $schema->createTable($class->getQuotedTableName($this->_platform)); - - $columns = array(); // table columns - - if ($class->isInheritanceTypeSingleTable()) { - $columns = $this->_gatherColumns($class, $table); - $this->_gatherRelationsSql($class, $table, $schema); - - // Add the discriminator column - $this->addDiscriminatorColumnDefinition($class, $table); - - // Aggregate all the information from all classes in the hierarchy - foreach ($class->parentClasses as $parentClassName) { - // Parent class information is already contained in this class - $processedClasses[$parentClassName] = true; - } - - foreach ($class->subClasses as $subClassName) { - $subClass = $this->_em->getClassMetadata($subClassName); - $this->_gatherColumns($subClass, $table); - $this->_gatherRelationsSql($subClass, $table, $schema); - $processedClasses[$subClassName] = true; - } - } else if ($class->isInheritanceTypeJoined()) { - // Add all non-inherited fields as columns - $pkColumns = array(); - foreach ($class->fieldMappings as $fieldName => $mapping) { - if ( ! isset($mapping['inherited'])) { - $columnName = $class->getQuotedColumnName($mapping['fieldName'], $this->_platform); - $this->_gatherColumn($class, $mapping, $table); - - if ($class->isIdentifier($fieldName)) { - $pkColumns[] = $columnName; - } - } - } - - $this->_gatherRelationsSql($class, $table, $schema); - - // Add the discriminator column only to the root table - if ($class->name == $class->rootEntityName) { - $this->addDiscriminatorColumnDefinition($class, $table); - } else { - // Add an ID FK column to child tables - /* @var \Doctrine\ORM\Mapping\ClassMetadata $class */ - $idMapping = $class->fieldMappings[$class->identifier[0]]; - $this->_gatherColumn($class, $idMapping, $table); - $columnName = $class->getQuotedColumnName($class->identifier[0], $this->_platform); - // TODO: This seems rather hackish, can we optimize it? - $table->getColumn($columnName)->setAutoincrement(false); - - $pkColumns[] = $columnName; - - // Add a FK constraint on the ID column - $table->addUnnamedForeignKeyConstraint( - $this->_em->getClassMetadata($class->rootEntityName)->getQuotedTableName($this->_platform), - array($columnName), array($columnName), array('onDelete' => 'CASCADE') - ); - } - - $table->setPrimaryKey($pkColumns); - - } else if ($class->isInheritanceTypeTablePerClass()) { - throw ORMException::notSupported(); - } else { - $this->_gatherColumns($class, $table); - $this->_gatherRelationsSql($class, $table, $schema); - } - - $pkColumns = array(); - foreach ($class->identifier AS $identifierField) { - if (isset($class->fieldMappings[$identifierField])) { - $pkColumns[] = $class->getQuotedColumnName($identifierField, $this->_platform); - } else if (isset($class->associationMappings[$identifierField])) { - /* @var $assoc \Doctrine\ORM\Mapping\OneToOne */ - $assoc = $class->associationMappings[$identifierField]; - foreach ($assoc['joinColumns'] AS $joinColumn) { - $pkColumns[] = $joinColumn['name']; - } - } - } - if (!$table->hasIndex('primary')) { - $table->setPrimaryKey($pkColumns); - } - - if (isset($class->table['indexes'])) { - foreach ($class->table['indexes'] AS $indexName => $indexData) { - $table->addIndex($indexData['columns'], is_numeric($indexName) ? null : $indexName); - } - } - - if (isset($class->table['uniqueConstraints'])) { - foreach ($class->table['uniqueConstraints'] AS $indexName => $indexData) { - $table->addUniqueIndex($indexData['columns'], is_numeric($indexName) ? null : $indexName); - } - } - - $processedClasses[$class->name] = true; - - if ($class->isIdGeneratorSequence() && $class->name == $class->rootEntityName) { - $seqDef = $class->sequenceGeneratorDefinition; - - if (!$schema->hasSequence($seqDef['sequenceName'])) { - $schema->createSequence( - $seqDef['sequenceName'], - $seqDef['allocationSize'], - $seqDef['initialValue'] - ); - } - } - - if ($evm->hasListeners(ToolEvents::postGenerateSchemaTable)) { - $evm->dispatchEvent(ToolEvents::postGenerateSchemaTable, new GenerateSchemaTableEventArgs($class, $schema, $table)); - } - } - - if ( ! $this->_platform->supportsSchemas() && ! $this->_platform->canEmulateSchemas() ) { - $schema->visit(new RemoveNamespacedAssets()); - } - - if ($evm->hasListeners(ToolEvents::postGenerateSchema)) { - $evm->dispatchEvent(ToolEvents::postGenerateSchema, new GenerateSchemaEventArgs($this->_em, $schema)); - } - - return $schema; - } - - /** - * Gets a portable column definition as required by the DBAL for the discriminator - * column of a class. - * - * @param ClassMetadata $class - * @return array The portable column definition of the discriminator column as required by - * the DBAL. - */ - private function addDiscriminatorColumnDefinition($class, $table) - { - $discrColumn = $class->discriminatorColumn; - - if (!isset($discrColumn['type']) || (strtolower($discrColumn['type']) == 'string' && $discrColumn['length'] === null)) { - $discrColumn['type'] = 'string'; - $discrColumn['length'] = 255; - } - - $table->addColumn( - $discrColumn['name'], - $discrColumn['type'], - array('length' => $discrColumn['length'], 'notnull' => true) - ); - } - - /** - * Gathers the column definitions as required by the DBAL of all field mappings - * found in the given class. - * - * @param ClassMetadata $class - * @param Table $table - * @return array The list of portable column definitions as required by the DBAL. - */ - private function _gatherColumns($class, $table) - { - $columns = array(); - $pkColumns = array(); - - foreach ($class->fieldMappings as $fieldName => $mapping) { - if ($class->isInheritanceTypeSingleTable() && isset($mapping['inherited'])) { - continue; - } - - $column = $this->_gatherColumn($class, $mapping, $table); - - if ($class->isIdentifier($mapping['fieldName'])) { - $pkColumns[] = $class->getQuotedColumnName($mapping['fieldName'], $this->_platform); - } - } - - // For now, this is a hack required for single table inheritence, since this method is called - // twice by single table inheritence relations - if(!$table->hasIndex('primary')) { - //$table->setPrimaryKey($pkColumns); - } - - return $columns; - } - - /** - * Creates a column definition as required by the DBAL from an ORM field mapping definition. - * - * @param ClassMetadata $class The class that owns the field mapping. - * @param array $mapping The field mapping. - * @param Table $table - * @return array The portable column definition as required by the DBAL. - */ - private function _gatherColumn($class, array $mapping, $table) - { - $columnName = $class->getQuotedColumnName($mapping['fieldName'], $this->_platform); - $columnType = $mapping['type']; - - $options = array(); - $options['length'] = isset($mapping['length']) ? $mapping['length'] : null; - $options['notnull'] = isset($mapping['nullable']) ? ! $mapping['nullable'] : true; - if ($class->isInheritanceTypeSingleTable() && count($class->parentClasses) > 0) { - $options['notnull'] = false; - } - - $options['platformOptions'] = array(); - $options['platformOptions']['version'] = $class->isVersioned && $class->versionField == $mapping['fieldName'] ? true : false; - - if(strtolower($columnType) == 'string' && $options['length'] === null) { - $options['length'] = 255; - } - - if (isset($mapping['precision'])) { - $options['precision'] = $mapping['precision']; - } - - if (isset($mapping['scale'])) { - $options['scale'] = $mapping['scale']; - } - - if (isset($mapping['default'])) { - $options['default'] = $mapping['default']; - } - - if (isset($mapping['columnDefinition'])) { - $options['columnDefinition'] = $mapping['columnDefinition']; - } - - if (isset($mapping['options'])) { - $options['customSchemaOptions'] = $mapping['options']; - } - - if ($class->isIdGeneratorIdentity() && $class->getIdentifierFieldNames() == array($mapping['fieldName'])) { - $options['autoincrement'] = true; - } - if ($class->isInheritanceTypeJoined() && $class->name != $class->rootEntityName) { - $options['autoincrement'] = false; - } - - if ($table->hasColumn($columnName)) { - // required in some inheritance scenarios - $table->changeColumn($columnName, $options); - } else { - $table->addColumn($columnName, $columnType, $options); - } - - $isUnique = isset($mapping['unique']) ? $mapping['unique'] : false; - if ($isUnique) { - $table->addUniqueIndex(array($columnName)); - } - } - - /** - * Gathers the SQL for properly setting up the relations of the given class. - * This includes the SQL for foreign key constraints and join tables. - * - * @param ClassMetadata $class - * @param \Doctrine\DBAL\Schema\Table $table - * @param \Doctrine\DBAL\Schema\Schema $schema - * @return void - */ - private function _gatherRelationsSql($class, $table, $schema) - { - foreach ($class->associationMappings as $fieldName => $mapping) { - if (isset($mapping['inherited'])) { - continue; - } - - $foreignClass = $this->_em->getClassMetadata($mapping['targetEntity']); - - if ($mapping['type'] & ClassMetadata::TO_ONE && $mapping['isOwningSide']) { - $primaryKeyColumns = $uniqueConstraints = array(); // PK is unnecessary for this relation-type - - $this->_gatherRelationJoinColumns($mapping['joinColumns'], $table, $foreignClass, $mapping, $primaryKeyColumns, $uniqueConstraints); - - foreach($uniqueConstraints AS $indexName => $unique) { - $table->addUniqueIndex($unique['columns'], is_numeric($indexName) ? null : $indexName); - } - } else if ($mapping['type'] == ClassMetadata::ONE_TO_MANY && $mapping['isOwningSide']) { - //... create join table, one-many through join table supported later - throw ORMException::notSupported(); - } else if ($mapping['type'] == ClassMetadata::MANY_TO_MANY && $mapping['isOwningSide']) { - // create join table - $joinTable = $mapping['joinTable']; - - $theJoinTable = $schema->createTable($foreignClass->getQuotedJoinTableName($mapping, $this->_platform)); - - $primaryKeyColumns = $uniqueConstraints = array(); - - // Build first FK constraint (relation table => source table) - $this->_gatherRelationJoinColumns($joinTable['joinColumns'], $theJoinTable, $class, $mapping, $primaryKeyColumns, $uniqueConstraints); - - // Build second FK constraint (relation table => target table) - $this->_gatherRelationJoinColumns($joinTable['inverseJoinColumns'], $theJoinTable, $foreignClass, $mapping, $primaryKeyColumns, $uniqueConstraints); - - $theJoinTable->setPrimaryKey($primaryKeyColumns); - - foreach($uniqueConstraints AS $indexName => $unique) { - $theJoinTable->addUniqueIndex($unique['columns'], is_numeric($indexName) ? null : $indexName); - } - } - } - } - - /** - * Get the class metadata that is responsible for the definition of the referenced column name. - * - * Previously this was a simple task, but with DDC-117 this problem is actually recursive. If its - * not a simple field, go through all identifier field names that are associations recursivly and - * find that referenced column name. - * - * TODO: Is there any way to make this code more pleasing? - * - * @param ClassMetadata $class - * @param string $referencedColumnName - * @return array(ClassMetadata, referencedFieldName) - */ - private function getDefiningClass($class, $referencedColumnName) - { - $referencedFieldName = $class->getFieldName($referencedColumnName); - - if ($class->hasField($referencedFieldName)) { - return array($class, $referencedFieldName); - } else if (in_array($referencedColumnName, $class->getIdentifierColumnNames())) { - // it seems to be an entity as foreign key - foreach ($class->getIdentifierFieldNames() AS $fieldName) { - if ($class->hasAssociation($fieldName) && $class->getSingleAssociationJoinColumnName($fieldName) == $referencedColumnName) { - return $this->getDefiningClass( - $this->_em->getClassMetadata($class->associationMappings[$fieldName]['targetEntity']), - $class->getSingleAssociationReferencedJoinColumnName($fieldName) - ); - } - } - } - - return null; - } - - /** - * Gather columns and fk constraints that are required for one part of relationship. - * - * @param array $joinColumns - * @param \Doctrine\DBAL\Schema\Table $theJoinTable - * @param ClassMetadata $class - * @param array $mapping - * @param array $primaryKeyColumns - * @param array $uniqueConstraints - */ - private function _gatherRelationJoinColumns($joinColumns, $theJoinTable, $class, $mapping, &$primaryKeyColumns, &$uniqueConstraints) - { - $localColumns = array(); - $foreignColumns = array(); - $fkOptions = array(); - $foreignTableName = $class->getQuotedTableName($this->_platform); - - foreach ($joinColumns as $joinColumn) { - $columnName = $joinColumn['name']; - list($definingClass, $referencedFieldName) = $this->getDefiningClass($class, $joinColumn['referencedColumnName']); - - if (!$definingClass) { - throw new \Doctrine\ORM\ORMException( - "Column name `".$joinColumn['referencedColumnName']."` referenced for relation from ". - $mapping['sourceEntity'] . " towards ". $mapping['targetEntity'] . " does not exist." - ); - } - - $primaryKeyColumns[] = $columnName; - $localColumns[] = $columnName; - $foreignColumns[] = $joinColumn['referencedColumnName']; - - if ( ! $theJoinTable->hasColumn($joinColumn['name'])) { - // Only add the column to the table if it does not exist already. - // It might exist already if the foreign key is mapped into a regular - // property as well. - - $fieldMapping = $definingClass->getFieldMapping($referencedFieldName); - - $columnDef = null; - if (isset($joinColumn['columnDefinition'])) { - $columnDef = $joinColumn['columnDefinition']; - } else if (isset($fieldMapping['columnDefinition'])) { - $columnDef = $fieldMapping['columnDefinition']; - } - $columnOptions = array('notnull' => false, 'columnDefinition' => $columnDef); - if (isset($joinColumn['nullable'])) { - $columnOptions['notnull'] = !$joinColumn['nullable']; - } - if ($fieldMapping['type'] == "string" && isset($fieldMapping['length'])) { - $columnOptions['length'] = $fieldMapping['length']; - } else if ($fieldMapping['type'] == "decimal") { - $columnOptions['scale'] = $fieldMapping['scale']; - $columnOptions['precision'] = $fieldMapping['precision']; - } - - $theJoinTable->addColumn($columnName, $fieldMapping['type'], $columnOptions); - } - - if (isset($joinColumn['unique']) && $joinColumn['unique'] == true) { - $uniqueConstraints[] = array('columns' => array($columnName)); - } - - if (isset($joinColumn['onDelete'])) { - $fkOptions['onDelete'] = $joinColumn['onDelete']; - } - } - - $theJoinTable->addUnnamedForeignKeyConstraint( - $foreignTableName, $localColumns, $foreignColumns, $fkOptions - ); - } - - /** - * Drops the database schema for the given classes. - * - * In any way when an exception is thrown it is supressed since drop was - * issued for all classes of the schema and some probably just don't exist. - * - * @param array $classes - * @return void - */ - public function dropSchema(array $classes) - { - $dropSchemaSql = $this->getDropSchemaSQL($classes); - $conn = $this->_em->getConnection(); - - foreach ($dropSchemaSql as $sql) { - try { - $conn->executeQuery($sql); - } catch(\Exception $e) { - - } - } - } - - /** - * Drops all elements in the database of the current connection. - * - * @return void - */ - public function dropDatabase() - { - $dropSchemaSql = $this->getDropDatabaseSQL(); - $conn = $this->_em->getConnection(); - - foreach ($dropSchemaSql as $sql) { - $conn->executeQuery($sql); - } - } - - /** - * Gets the SQL needed to drop the database schema for the connections database. - * - * @return array - */ - public function getDropDatabaseSQL() - { - $sm = $this->_em->getConnection()->getSchemaManager(); - $schema = $sm->createSchema(); - - $visitor = new \Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector($this->_platform); - /* @var $schema \Doctrine\DBAL\Schema\Schema */ - $schema->visit($visitor); - return $visitor->getQueries(); - } - - /** - * Get SQL to drop the tables defined by the passed classes. - * - * @param array $classes - * @return array - */ - public function getDropSchemaSQL(array $classes) - { - $visitor = new \Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector($this->_platform); - $schema = $this->getSchemaFromMetadata($classes); - - $sm = $this->_em->getConnection()->getSchemaManager(); - $fullSchema = $sm->createSchema(); - foreach ($fullSchema->getTables() AS $table) { - if (!$schema->hasTable($table->getName())) { - foreach ($table->getForeignKeys() AS $foreignKey) { - /* @var $foreignKey \Doctrine\DBAL\Schema\ForeignKeyConstraint */ - if ($schema->hasTable($foreignKey->getForeignTableName())) { - $visitor->acceptForeignKey($table, $foreignKey); - } - } - } else { - $visitor->acceptTable($table); - foreach ($table->getForeignKeys() AS $foreignKey) { - $visitor->acceptForeignKey($table, $foreignKey); - } - } - } - - if ($this->_platform->supportsSequences()) { - foreach ($schema->getSequences() AS $sequence) { - $visitor->acceptSequence($sequence); - } - foreach ($schema->getTables() AS $table) { - /* @var $sequence Table */ - if ($table->hasPrimaryKey()) { - $columns = $table->getPrimaryKey()->getColumns(); - if (count($columns) == 1) { - $checkSequence = $table->getName() . "_" . $columns[0] . "_seq"; - if ($fullSchema->hasSequence($checkSequence)) { - $visitor->acceptSequence($fullSchema->getSequence($checkSequence)); - } - } - } - } - } - - return $visitor->getQueries(); - } - - /** - * Updates the database schema of the given classes by comparing the ClassMetadata - * instances to the current database schema that is inspected. If $saveMode is set - * to true the command is executed in the Database, else SQL is returned. - * - * @param array $classes - * @param boolean $saveMode - * @return void - */ - public function updateSchema(array $classes, $saveMode=false) - { - $updateSchemaSql = $this->getUpdateSchemaSql($classes, $saveMode); - $conn = $this->_em->getConnection(); - - foreach ($updateSchemaSql as $sql) { - $conn->executeQuery($sql); - } - } - - /** - * Gets the sequence of SQL statements that need to be performed in order - * to bring the given class mappings in-synch with the relational schema. - * If $saveMode is set to true the command is executed in the Database, - * else SQL is returned. - * - * @param array $classes The classes to consider. - * @param boolean $saveMode True for writing to DB, false for SQL string - * @return array The sequence of SQL statements. - */ - public function getUpdateSchemaSql(array $classes, $saveMode=false) - { - $sm = $this->_em->getConnection()->getSchemaManager(); - - $fromSchema = $sm->createSchema(); - $toSchema = $this->getSchemaFromMetadata($classes); - - $comparator = new \Doctrine\DBAL\Schema\Comparator(); - $schemaDiff = $comparator->compare($fromSchema, $toSchema); - - if ($saveMode) { - return $schemaDiff->toSaveSql($this->_platform); - } else { - return $schemaDiff->toSql($this->_platform); - } - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaValidator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaValidator.php deleted file mode 100644 index 0932f09..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaValidator.php +++ /dev/null @@ -1,267 +0,0 @@ -. -*/ - -namespace Doctrine\ORM\Tools; - -use Doctrine\ORM\EntityManager; -use Doctrine\ORM\Mapping\ClassMetadataInfo; -use Doctrine\DBAL\Types\Type; - -/** - * Performs strict validation of the mapping schema - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 1.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class SchemaValidator -{ - /** - * @var EntityManager - */ - private $em; - - /** - * @param EntityManager $em - */ - public function __construct(EntityManager $em) - { - $this->em = $em; - } - - /** - * Checks the internal consistency of all mapping files. - * - * There are several checks that can't be done at runtime or are too expensive, which can be verified - * with this command. For example: - * - * 1. Check if a relation with "mappedBy" is actually connected to that specified field. - * 2. Check if "mappedBy" and "inversedBy" are consistent to each other. - * 3. Check if "referencedColumnName" attributes are really pointing to primary key columns. - * 4. Check if there are public properties that might cause problems with lazy loading. - * - * @return array - */ - public function validateMapping() - { - $errors = array(); - $cmf = $this->em->getMetadataFactory(); - $classes = $cmf->getAllMetadata(); - - foreach ($classes AS $class) { - if ($ce = $this->validateClass($class)) { - $errors[$class->name] = $ce; - } - } - - return $errors; - } - - /** - * Validate a single class of the current - * - * @param ClassMetadataInfo $class - * @return array - */ - public function validateClass(ClassMetadataInfo $class) - { - $ce = array(); - $cmf = $this->em->getMetadataFactory(); - - foreach ($class->fieldMappings as $fieldName => $mapping) { - if (!Type::hasType($mapping['type'])) { - $ce[] = "The field '" . $class->name . "#" . $fieldName."' uses a non-existant type '" . $mapping['type'] . "'."; - } - } - - foreach ($class->associationMappings AS $fieldName => $assoc) { - if (!class_exists($assoc['targetEntity']) || $cmf->isTransient($assoc['targetEntity'])) { - $ce[] = "The target entity '" . $assoc['targetEntity'] . "' specified on " . $class->name . '#' . $fieldName . ' is unknown or not an entity.'; - return $ce; - } - - if ($assoc['mappedBy'] && $assoc['inversedBy']) { - $ce[] = "The association " . $class . "#" . $fieldName . " cannot be defined as both inverse and owning."; - } - - $targetMetadata = $cmf->getMetadataFor($assoc['targetEntity']); - - if (isset($assoc['id']) && $targetMetadata->containsForeignIdentifier) { - $ce[] = "Cannot map association '" . $class->name. "#". $fieldName ." as identifier, because " . - "the target entity '". $targetMetadata->name . "' also maps an association as identifier."; - } - - /* @var $assoc AssociationMapping */ - if ($assoc['mappedBy']) { - if ($targetMetadata->hasField($assoc['mappedBy'])) { - $ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the owning side ". - "field " . $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " which is not defined as association."; - } - if (!$targetMetadata->hasAssociation($assoc['mappedBy'])) { - $ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the owning side ". - "field " . $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " which does not exist."; - } else if ($targetMetadata->associationMappings[$assoc['mappedBy']]['inversedBy'] == null) { - $ce[] = "The field " . $class->name . "#" . $fieldName . " is on the inverse side of a ". - "bi-directional relationship, but the specified mappedBy association on the target-entity ". - $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " does not contain the required ". - "'inversedBy=".$fieldName."' attribute."; - } else if ($targetMetadata->associationMappings[$assoc['mappedBy']]['inversedBy'] != $fieldName) { - $ce[] = "The mappings " . $class->name . "#" . $fieldName . " and " . - $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " are ". - "incosistent with each other."; - } - } - - if ($assoc['inversedBy']) { - if ($targetMetadata->hasField($assoc['inversedBy'])) { - $ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the inverse side ". - "field " . $assoc['targetEntity'] . "#" . $assoc['inversedBy'] . " which is not defined as association."; - } - if (!$targetMetadata->hasAssociation($assoc['inversedBy'])) { - $ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the inverse side ". - "field " . $assoc['targetEntity'] . "#" . $assoc['inversedBy'] . " which does not exist."; - } else if ($targetMetadata->associationMappings[$assoc['inversedBy']]['mappedBy'] == null) { - $ce[] = "The field " . $class->name . "#" . $fieldName . " is on the owning side of a ". - "bi-directional relationship, but the specified mappedBy association on the target-entity ". - $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " does not contain the required ". - "'inversedBy' attribute."; - } else if ($targetMetadata->associationMappings[$assoc['inversedBy']]['mappedBy'] != $fieldName) { - $ce[] = "The mappings " . $class->name . "#" . $fieldName . " and " . - $assoc['targetEntity'] . "#" . $assoc['inversedBy'] . " are ". - "incosistent with each other."; - } - - // Verify inverse side/owning side match each other - if (array_key_exists($assoc['inversedBy'], $targetMetadata->associationMappings)) { - $targetAssoc = $targetMetadata->associationMappings[$assoc['inversedBy']]; - if ($assoc['type'] == ClassMetadataInfo::ONE_TO_ONE && $targetAssoc['type'] !== ClassMetadataInfo::ONE_TO_ONE){ - $ce[] = "If association " . $class->name . "#" . $fieldName . " is one-to-one, then the inversed " . - "side " . $targetMetadata->name . "#" . $assoc['inversedBy'] . " has to be one-to-one as well."; - } else if ($assoc['type'] == ClassMetadataInfo::MANY_TO_ONE && $targetAssoc['type'] !== ClassMetadataInfo::ONE_TO_MANY){ - $ce[] = "If association " . $class->name . "#" . $fieldName . " is many-to-one, then the inversed " . - "side " . $targetMetadata->name . "#" . $assoc['inversedBy'] . " has to be one-to-many."; - } else if ($assoc['type'] == ClassMetadataInfo::MANY_TO_MANY && $targetAssoc['type'] !== ClassMetadataInfo::MANY_TO_MANY){ - $ce[] = "If association " . $class->name . "#" . $fieldName . " is many-to-many, then the inversed " . - "side " . $targetMetadata->name . "#" . $assoc['inversedBy'] . " has to be many-to-many as well."; - } - } - } - - if ($assoc['isOwningSide']) { - if ($assoc['type'] == ClassMetadataInfo::MANY_TO_MANY) { - $identifierColumns = $class->getIdentifierColumnNames(); - foreach ($assoc['joinTable']['joinColumns'] AS $joinColumn) { - if (!in_array($joinColumn['referencedColumnName'], $identifierColumns)) { - $ce[] = "The referenced column name '" . $joinColumn['referencedColumnName'] . "' " . - "has to be a primary key column on the target entity class '".$class->name."'."; - break; - } - } - - $identifierColumns = $targetMetadata->getIdentifierColumnNames(); - foreach ($assoc['joinTable']['inverseJoinColumns'] AS $inverseJoinColumn) { - if (!in_array($inverseJoinColumn['referencedColumnName'], $identifierColumns)) { - $ce[] = "The referenced column name '" . $joinColumn['referencedColumnName'] . "' " . - "has to be a primary key column on the target entity class '".$targetMetadata->name."'."; - break; - } - } - - if (count($targetMetadata->getIdentifierColumnNames()) != count($assoc['joinTable']['inverseJoinColumns'])) { - $ce[] = "The inverse join columns of the many-to-many table '" . $assoc['joinTable']['name'] . "' " . - "have to contain to ALL identifier columns of the target entity '". $targetMetadata->name . "', " . - "however '" . implode(", ", array_diff($targetMetadata->getIdentifierColumnNames(), array_values($assoc['relationToTargetKeyColumns']))) . - "' are missing."; - } - - if (count($class->getIdentifierColumnNames()) != count($assoc['joinTable']['joinColumns'])) { - $ce[] = "The join columns of the many-to-many table '" . $assoc['joinTable']['name'] . "' " . - "have to contain to ALL identifier columns of the source entity '". $class->name . "', " . - "however '" . implode(", ", array_diff($class->getIdentifierColumnNames(), array_values($assoc['relationToSourceKeyColumns']))) . - "' are missing."; - } - - } else if ($assoc['type'] & ClassMetadataInfo::TO_ONE) { - $identifierColumns = $targetMetadata->getIdentifierColumnNames(); - foreach ($assoc['joinColumns'] AS $joinColumn) { - if (!in_array($joinColumn['referencedColumnName'], $identifierColumns)) { - $ce[] = "The referenced column name '" . $joinColumn['referencedColumnName'] . "' " . - "has to be a primary key column on the target entity class '".$targetMetadata->name."'."; - } - } - - if (count($identifierColumns) != count($assoc['joinColumns'])) { - $ids = array(); - foreach ($assoc['joinColumns'] AS $joinColumn) { - $ids[] = $joinColumn['name']; - } - - $ce[] = "The join columns of the association '" . $assoc['fieldName'] . "' " . - "have to match to ALL identifier columns of the target entity '". $class->name . "', " . - "however '" . implode(", ", array_diff($targetMetadata->getIdentifierColumnNames(), $ids)) . - "' are missing."; - } - } - } - - if (isset($assoc['orderBy']) && $assoc['orderBy'] !== null) { - foreach ($assoc['orderBy'] AS $orderField => $orientation) { - if (!$targetMetadata->hasField($orderField)) { - $ce[] = "The association " . $class->name."#".$fieldName." is ordered by a foreign field " . - $orderField . " that is not a field on the target entity " . $targetMetadata->name; - } - } - } - } - - foreach ($class->reflClass->getProperties(\ReflectionProperty::IS_PUBLIC) as $publicAttr) { - if ($publicAttr->isStatic()) { - continue; - } - $ce[] = "Field '".$publicAttr->getName()."' in class '".$class->name."' must be private ". - "or protected. Public fields may break lazy-loading."; - } - - foreach ($class->subClasses AS $subClass) { - if (!in_array($class->name, class_parents($subClass))) { - $ce[] = "According to the discriminator map class '" . $subClass . "' has to be a child ". - "of '" . $class->name . "' but these entities are not related through inheritance."; - } - } - - return $ce; - } - - /** - * Check if the Database Schema is in sync with the current metadata state. - * - * @return bool - */ - public function schemaInSyncWithMetadata() - { - $schemaTool = new SchemaTool($this->em); - - $allMetadata = $this->em->getMetadataFactory()->getAllMetadata(); - return (count($schemaTool->getUpdateSchemaSql($allMetadata, true)) == 0); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Setup.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Setup.php deleted file mode 100644 index c2550e2..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Setup.php +++ /dev/null @@ -1,194 +0,0 @@ -. -*/ - -namespace Doctrine\ORM\Tools; - -use Doctrine\Common\ClassLoader; -use Doctrine\Common\Cache\Cache; -use Doctrine\Common\Cache\ArrayCache; -use Doctrine\ORM\Configuration; -use Doctrine\ORM\Mapping\Driver\XmlDriver; -use Doctrine\ORM\Mapping\Driver\YamlDriver; - -/** - * Convenience class for setting up Doctrine from different installations and configurations. - * - * @author Benjamin Eberlei - */ -class Setup -{ - /** - * Use this method to register all autoloaders for a setup where Doctrine is checked out from - * its github repository at {@link http://github.com/doctrine/doctrine2} - * - * @param string $gitCheckoutRootPath - * @return void - */ - static public function registerAutoloadGit($gitCheckoutRootPath) - { - if (!class_exists('Doctrine\Common\ClassLoader', false)) { - require_once $gitCheckoutRootPath . "/lib/vendor/doctrine-common/lib/Doctrine/Common/ClassLoader.php"; - } - - $loader = new ClassLoader("Doctrine\Common", $gitCheckoutRootPath . "/lib/vendor/doctrine-common/lib"); - $loader->register(); - - $loader = new ClassLoader("Doctrine\DBAL", $gitCheckoutRootPath . "/lib/vendor/doctrine-dbal/lib"); - $loader->register(); - - $loader = new ClassLoader("Doctrine\ORM", $gitCheckoutRootPath . "/lib"); - $loader->register(); - - $loader = new ClassLoader("Symfony\Component", $gitCheckoutRootPath . "/lib/vendor"); - $loader->register(); - } - - /** - * Use this method to register all autoloaders for a setup where Doctrine is installed - * though {@link http://pear.doctrine-project.org}. - * - * @return void - */ - static public function registerAutoloadPEAR() - { - if (!class_exists('Doctrine\Common\ClassLoader', false)) { - require_once "Doctrine/Common/ClassLoader.php"; - } - - $loader = new ClassLoader("Doctrine"); - $loader->register(); - - $parts = explode(PATH_SEPARATOR, get_include_path()); - - foreach ($parts AS $includePath) { - if ($includePath != "." && file_exists($includePath . "/Doctrine")) { - $loader = new ClassLoader("Symfony\Component", $includePath . "/Doctrine"); - $loader->register(); - return; - } - } - } - - /** - * Use this method to register all autoloads for a downloaded Doctrine library. - * Pick the directory the library was uncompressed into. - * - * @param string $directory - */ - static public function registerAutoloadDirectory($directory) - { - if (!class_exists('Doctrine\Common\ClassLoader', false)) { - require_once $directory . "/Doctrine/Common/ClassLoader.php"; - } - - $loader = new ClassLoader("Doctrine", $directory); - $loader->register(); - - $loader = new ClassLoader("Symfony\Component", $directory . "/Doctrine"); - $loader->register(); - } - - /** - * Create a configuration with an annotation metadata driver. - * - * @param array $paths - * @param boolean $isDevMode - * @param string $proxyDir - * @param Cache $cache - * @return Configuration - */ - static public function createAnnotationMetadataConfiguration(array $paths, $isDevMode = false, $proxyDir = null, Cache $cache = null) - { - $config = self::createConfiguration($isDevMode, $proxyDir, $cache); - $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver($paths)); - return $config; - } - - /** - * Create a configuration with a xml metadata driver. - * - * @param array $paths - * @param boolean $isDevMode - * @param string $proxyDir - * @param Cache $cache - * @return Configuration - */ - static public function createXMLMetadataConfiguration(array $paths, $isDevMode = false, $proxyDir = null, Cache $cache = null) - { - $config = self::createConfiguration($isDevMode, $proxyDir, $cache); - $config->setMetadataDriverImpl(new XmlDriver($paths)); - return $config; - } - - /** - * Create a configuration with a yaml metadata driver. - * - * @param array $paths - * @param boolean $isDevMode - * @param string $proxyDir - * @param Cache $cache - * @return Configuration - */ - static public function createYAMLMetadataConfiguration(array $paths, $isDevMode = false, $proxyDir = null, Cache $cache = null) - { - $config = self::createConfiguration($isDevMode, $proxyDir, $cache); - $config->setMetadataDriverImpl(new YamlDriver($paths)); - return $config; - } - - /** - * Create a configuration without a metadata driver. - * - * @param bool $isDevMode - * @param string $proxyDir - * @param Cache $cache - * @return Configuration - */ - static public function createConfiguration($isDevMode = false, $proxyDir = null, Cache $cache = null) - { - $proxyDir = $proxyDir ?: sys_get_temp_dir(); - if ($isDevMode === false && $cache === null) { - if (extension_loaded('apc')) { - $cache = new \Doctrine\Common\Cache\ApcCache; - } else if (extension_loaded('xcache')) { - $cache = new \Doctrine\Common\Cache\XcacheCache; - } else if (extension_loaded('memcache')) { - $memcache = new \Memcache(); - $memcache->connect('127.0.0.1'); - $cache = new \Doctrine\Common\Cache\MemcacheCache(); - $cache->setMemcache($memcache); - } else { - $cache = new ArrayCache; - } - } else if ($cache === null) { - $cache = new ArrayCache; - } - $cache->setNamespace("dc2_" . md5($proxyDir) . "_"); // to avoid collisions - - $config = new Configuration(); - $config->setMetadataCacheImpl($cache); - $config->setQueryCacheImpl($cache); - $config->setResultCacheImpl($cache); - $config->setProxyDir( $proxyDir ); - $config->setProxyNamespace('DoctrineProxies'); - $config->setAutoGenerateProxyClasses($isDevMode); - - return $config; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ToolEvents.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ToolEvents.php deleted file mode 100644 index 7ea1f57..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ToolEvents.php +++ /dev/null @@ -1,44 +0,0 @@ -. -*/ - -namespace Doctrine\ORM\Tools; - -class ToolEvents -{ - /** - * The postGenerateSchemaTable event occurs in SchemaTool#getSchemaFromMetadata() - * whenever an entity class is transformed into its table representation. It recieves - * the current non-complete Schema instance, the Entity Metadata Class instance and - * the Schema Table instance of this entity. - * - * @var string - */ - const postGenerateSchemaTable = 'postGenerateSchemaTable'; - - /** - * The postGenerateSchema event is triggered in SchemaTool#getSchemaFromMetadata() - * after all entity classes have been transformed into the related Schema structure. - * The EventArgs contain the EntityManager and the created Schema instance. - * - * @var string - */ - const postGenerateSchema = 'postGenerateSchema'; -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ToolsException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ToolsException.php deleted file mode 100644 index 4551d87..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ToolsException.php +++ /dev/null @@ -1,40 +0,0 @@ -. - */ - -namespace Doctrine\ORM\Tools; - -use Doctrine\ORM\ORMException; - -/** - * Tools related Exceptions - * - * @author Benjamin Eberlei - */ -class ToolsException extends ORMException -{ - public static function schemaToolFailure($sql, \Exception $e) - { - return new self("Schema-Tool failed with Error '" . $e->getMessage() . "' while executing DDL: " . $sql, "0", $e); - } - - public static function couldNotMapDoctrine1Type($type) - { - return new self("Could not map doctrine 1 type '$type'!"); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/TransactionRequiredException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/TransactionRequiredException.php deleted file mode 100644 index 170f63e..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/TransactionRequiredException.php +++ /dev/null @@ -1,40 +0,0 @@ -. -*/ - -namespace Doctrine\ORM; - -/** - * Is thrown when a transaction is required for the current operation, but there is none open. - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.com - * @since 1.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Roman Borschel - */ -class TransactionRequiredException extends ORMException -{ - static public function transactionRequired() - { - return new self('An open transaction is required for this operation.'); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php b/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php deleted file mode 100644 index 85cf99b..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php +++ /dev/null @@ -1,2954 +0,0 @@ -. - */ - -namespace Doctrine\ORM; - -use Exception, InvalidArgumentException, UnexpectedValueException, - Doctrine\Common\Collections\ArrayCollection, - Doctrine\Common\Collections\Collection, - Doctrine\Common\NotifyPropertyChanged, - Doctrine\Common\PropertyChangedListener, - Doctrine\Common\Persistence\ObjectManagerAware, - Doctrine\ORM\Event\LifecycleEventArgs, - Doctrine\ORM\Mapping\ClassMetadata, - Doctrine\ORM\Proxy\Proxy; - -/** - * The UnitOfWork is responsible for tracking changes to objects during an - * "object-level" transaction and for writing out changes to the database - * in the correct order. - * - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @internal This class contains highly performance-sensitive code. - */ -class UnitOfWork implements PropertyChangedListener -{ - /** - * An entity is in MANAGED state when its persistence is managed by an EntityManager. - */ - const STATE_MANAGED = 1; - - /** - * An entity is new if it has just been instantiated (i.e. using the "new" operator) - * and is not (yet) managed by an EntityManager. - */ - const STATE_NEW = 2; - - /** - * A detached entity is an instance with persistent state and identity that is not - * (or no longer) associated with an EntityManager (and a UnitOfWork). - */ - const STATE_DETACHED = 3; - - /** - * A removed entity instance is an instance with a persistent identity, - * associated with an EntityManager, whose persistent state will be deleted - * on commit. - */ - const STATE_REMOVED = 4; - - /** - * The identity map that holds references to all managed entities that have - * an identity. The entities are grouped by their class name. - * Since all classes in a hierarchy must share the same identifier set, - * we always take the root class name of the hierarchy. - * - * @var array - */ - private $identityMap = array(); - - /** - * Map of all identifiers of managed entities. - * Keys are object ids (spl_object_hash). - * - * @var array - */ - private $entityIdentifiers = array(); - - /** - * Map of the original entity data of managed entities. - * Keys are object ids (spl_object_hash). This is used for calculating changesets - * at commit time. - * - * @var array - * @internal Note that PHPs "copy-on-write" behavior helps a lot with memory usage. - * A value will only really be copied if the value in the entity is modified - * by the user. - */ - private $originalEntityData = array(); - - /** - * Map of entity changes. Keys are object ids (spl_object_hash). - * Filled at the beginning of a commit of the UnitOfWork and cleaned at the end. - * - * @var array - */ - private $entityChangeSets = array(); - - /** - * The (cached) states of any known entities. - * Keys are object ids (spl_object_hash). - * - * @var array - */ - private $entityStates = array(); - - /** - * Map of entities that are scheduled for dirty checking at commit time. - * This is only used for entities with a change tracking policy of DEFERRED_EXPLICIT. - * Keys are object ids (spl_object_hash). - * - * @var array - * @todo rename: scheduledForSynchronization - */ - private $scheduledForDirtyCheck = array(); - - /** - * A list of all pending entity insertions. - * - * @var array - */ - private $entityInsertions = array(); - - /** - * A list of all pending entity updates. - * - * @var array - */ - private $entityUpdates = array(); - - /** - * Any pending extra updates that have been scheduled by persisters. - * - * @var array - */ - private $extraUpdates = array(); - - /** - * A list of all pending entity deletions. - * - * @var array - */ - private $entityDeletions = array(); - - /** - * All pending collection deletions. - * - * @var array - */ - private $collectionDeletions = array(); - - /** - * All pending collection updates. - * - * @var array - */ - private $collectionUpdates = array(); - - /** - * List of collections visited during changeset calculation on a commit-phase of a UnitOfWork. - * At the end of the UnitOfWork all these collections will make new snapshots - * of their data. - * - * @var array - */ - private $visitedCollections = array(); - - /** - * The EntityManager that "owns" this UnitOfWork instance. - * - * @var \Doctrine\ORM\EntityManager - */ - private $em; - - /** - * The calculator used to calculate the order in which changes to - * entities need to be written to the database. - * - * @var \Doctrine\ORM\Internal\CommitOrderCalculator - */ - private $commitOrderCalculator; - - /** - * The entity persister instances used to persist entity instances. - * - * @var array - */ - private $persisters = array(); - - /** - * The collection persister instances used to persist collections. - * - * @var array - */ - private $collectionPersisters = array(); - - /** - * The EventManager used for dispatching events. - * - * @var EventManager - */ - private $evm; - - /** - * Orphaned entities that are scheduled for removal. - * - * @var array - */ - private $orphanRemovals = array(); - - /** - * Read-Only objects are never evaluated - * - * @var array - */ - private $readOnlyObjects = array(); - - /** - * Map of Entity Class-Names and corresponding IDs that should eager loaded when requested. - * - * @var array - */ - private $eagerLoadingEntities = array(); - - /** - * Initializes a new UnitOfWork instance, bound to the given EntityManager. - * - * @param \Doctrine\ORM\EntityManager $em - */ - public function __construct(EntityManager $em) - { - $this->em = $em; - $this->evm = $em->getEventManager(); - } - - /** - * Commits the UnitOfWork, executing all operations that have been postponed - * up to this point. The state of all managed entities will be synchronized with - * the database. - * - * The operations are executed in the following order: - * - * 1) All entity insertions - * 2) All entity updates - * 3) All collection deletions - * 4) All collection updates - * 5) All entity deletions - * - * @param object $entity - * @return void - */ - public function commit($entity = null) - { - // Raise preFlush - if ($this->evm->hasListeners(Events::preFlush)) { - $this->evm->dispatchEvent(Events::preFlush, new Event\PreFlushEventArgs($this->em)); - } - - // Compute changes done since last commit. - if ($entity === null) { - $this->computeChangeSets(); - } else { - $this->computeSingleEntityChangeSet($entity); - } - - if ( ! ($this->entityInsertions || - $this->entityDeletions || - $this->entityUpdates || - $this->collectionUpdates || - $this->collectionDeletions || - $this->orphanRemovals)) { - return; // Nothing to do. - } - - if ($this->orphanRemovals) { - foreach ($this->orphanRemovals as $orphan) { - $this->remove($orphan); - } - } - - // Raise onFlush - if ($this->evm->hasListeners(Events::onFlush)) { - $this->evm->dispatchEvent(Events::onFlush, new Event\OnFlushEventArgs($this->em)); - } - - // Now we need a commit order to maintain referential integrity - $commitOrder = $this->getCommitOrder(); - - $conn = $this->em->getConnection(); - $conn->beginTransaction(); - - try { - if ($this->entityInsertions) { - foreach ($commitOrder as $class) { - $this->executeInserts($class); - } - } - - if ($this->entityUpdates) { - foreach ($commitOrder as $class) { - $this->executeUpdates($class); - } - } - - // Extra updates that were requested by persisters. - if ($this->extraUpdates) { - $this->executeExtraUpdates(); - } - - // Collection deletions (deletions of complete collections) - foreach ($this->collectionDeletions as $collectionToDelete) { - $this->getCollectionPersister($collectionToDelete->getMapping())->delete($collectionToDelete); - } - // Collection updates (deleteRows, updateRows, insertRows) - foreach ($this->collectionUpdates as $collectionToUpdate) { - $this->getCollectionPersister($collectionToUpdate->getMapping())->update($collectionToUpdate); - } - - // Entity deletions come last and need to be in reverse commit order - if ($this->entityDeletions) { - for ($count = count($commitOrder), $i = $count - 1; $i >= 0; --$i) { - $this->executeDeletions($commitOrder[$i]); - } - } - - $conn->commit(); - } catch (Exception $e) { - $this->em->close(); - $conn->rollback(); - - throw $e; - } - - // Take new snapshots from visited collections - foreach ($this->visitedCollections as $coll) { - $coll->takeSnapshot(); - } - - // Raise postFlush - if ($this->evm->hasListeners(Events::postFlush)) { - $this->evm->dispatchEvent(Events::postFlush, new Event\PostFlushEventArgs($this->em)); - } - - // Clear up - $this->entityInsertions = - $this->entityUpdates = - $this->entityDeletions = - $this->extraUpdates = - $this->entityChangeSets = - $this->collectionUpdates = - $this->collectionDeletions = - $this->visitedCollections = - $this->scheduledForDirtyCheck = - $this->orphanRemovals = array(); - } - - /** - * Compute the changesets of all entities scheduled for insertion - * - * @return void - */ - private function computeScheduleInsertsChangeSets() - { - foreach ($this->entityInsertions as $entity) { - $class = $this->em->getClassMetadata(get_class($entity)); - - $this->computeChangeSet($class, $entity); - } - } - - /** - * Only flush the given entity according to a ruleset that keeps the UoW consistent. - * - * 1. All entities scheduled for insertion, (orphan) removals and changes in collections are processed as well! - * 2. Read Only entities are skipped. - * 3. Proxies are skipped. - * 4. Only if entity is properly managed. - * - * @param object $entity - * @return void - */ - private function computeSingleEntityChangeSet($entity) - { - if ( $this->getEntityState($entity) !== self::STATE_MANAGED) { - throw new \InvalidArgumentException("Entity has to be managed for single computation " . self::objToStr($entity)); - } - - $class = $this->em->getClassMetadata(get_class($entity)); - - if ($class->isChangeTrackingDeferredImplicit()) { - $this->persist($entity); - } - - // Compute changes for INSERTed entities first. This must always happen even in this case. - $this->computeScheduleInsertsChangeSets(); - - if ($class->isReadOnly) { - return; - } - - // Ignore uninitialized proxy objects - if ($entity instanceof Proxy && ! $entity->__isInitialized__) { - return; - } - - // Only MANAGED entities that are NOT SCHEDULED FOR INSERTION are processed here. - $oid = spl_object_hash($entity); - - if ( ! isset($this->entityInsertions[$oid]) && isset($this->entityStates[$oid])) { - $this->computeChangeSet($class, $entity); - } - } - - /** - * Executes any extra updates that have been scheduled. - */ - private function executeExtraUpdates() - { - foreach ($this->extraUpdates as $oid => $update) { - list ($entity, $changeset) = $update; - - $this->entityChangeSets[$oid] = $changeset; - $this->getEntityPersister(get_class($entity))->update($entity); - } - } - - /** - * Gets the changeset for an entity. - * - * @return array - */ - public function getEntityChangeSet($entity) - { - $oid = spl_object_hash($entity); - - if (isset($this->entityChangeSets[$oid])) { - return $this->entityChangeSets[$oid]; - } - - return array(); - } - - /** - * Computes the changes that happened to a single entity. - * - * Modifies/populates the following properties: - * - * {@link _originalEntityData} - * If the entity is NEW or MANAGED but not yet fully persisted (only has an id) - * then it was not fetched from the database and therefore we have no original - * entity data yet. All of the current entity data is stored as the original entity data. - * - * {@link _entityChangeSets} - * The changes detected on all properties of the entity are stored there. - * A change is a tuple array where the first entry is the old value and the second - * entry is the new value of the property. Changesets are used by persisters - * to INSERT/UPDATE the persistent entity state. - * - * {@link _entityUpdates} - * If the entity is already fully MANAGED (has been fetched from the database before) - * and any changes to its properties are detected, then a reference to the entity is stored - * there to mark it for an update. - * - * {@link _collectionDeletions} - * If a PersistentCollection has been de-referenced in a fully MANAGED entity, - * then this collection is marked for deletion. - * - * @ignore - * @internal Don't call from the outside. - * @param ClassMetadata $class The class descriptor of the entity. - * @param object $entity The entity for which to compute the changes. - */ - public function computeChangeSet(ClassMetadata $class, $entity) - { - $oid = spl_object_hash($entity); - - if (isset($this->readOnlyObjects[$oid])) { - return; - } - - if ( ! $class->isInheritanceTypeNone()) { - $class = $this->em->getClassMetadata(get_class($entity)); - } - - // Fire PreFlush lifecycle callbacks - if (isset($class->lifecycleCallbacks[Events::preFlush])) { - $class->invokeLifecycleCallbacks(Events::preFlush, $entity); - } - - $actualData = array(); - - foreach ($class->reflFields as $name => $refProp) { - $value = $refProp->getValue($entity); - - if ($class->isCollectionValuedAssociation($name) && $value !== null && ! ($value instanceof PersistentCollection)) { - // If $value is not a Collection then use an ArrayCollection. - if ( ! $value instanceof Collection) { - $value = new ArrayCollection($value); - } - - $assoc = $class->associationMappings[$name]; - - // Inject PersistentCollection - $value = new PersistentCollection( - $this->em, $this->em->getClassMetadata($assoc['targetEntity']), $value - ); - $value->setOwner($entity, $assoc); - $value->setDirty( ! $value->isEmpty()); - - $class->reflFields[$name]->setValue($entity, $value); - - $actualData[$name] = $value; - - continue; - } - - if (( ! $class->isIdentifier($name) || ! $class->isIdGeneratorIdentity()) && ($name !== $class->versionField)) { - $actualData[$name] = $value; - } - } - - if ( ! isset($this->originalEntityData[$oid])) { - // Entity is either NEW or MANAGED but not yet fully persisted (only has an id). - // These result in an INSERT. - $this->originalEntityData[$oid] = $actualData; - $changeSet = array(); - - foreach ($actualData as $propName => $actualValue) { - if ( ! isset($class->associationMappings[$propName])) { - $changeSet[$propName] = array(null, $actualValue); - - continue; - } - - $assoc = $class->associationMappings[$propName]; - - if ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) { - $changeSet[$propName] = array(null, $actualValue); - } - } - - $this->entityChangeSets[$oid] = $changeSet; - } else { - // Entity is "fully" MANAGED: it was already fully persisted before - // and we have a copy of the original data - $originalData = $this->originalEntityData[$oid]; - $isChangeTrackingNotify = $class->isChangeTrackingNotify(); - $changeSet = ($isChangeTrackingNotify && isset($this->entityChangeSets[$oid])) - ? $this->entityChangeSets[$oid] - : array(); - - foreach ($actualData as $propName => $actualValue) { - // skip field, its a partially omitted one! - if ( ! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) { - continue; - } - - $orgValue = $originalData[$propName]; - - // skip if value havent changed - if ($orgValue === $actualValue) { - continue; - } - - // if regular field - if ( ! isset($class->associationMappings[$propName])) { - if ($isChangeTrackingNotify) { - continue; - } - - $changeSet[$propName] = array($orgValue, $actualValue); - - continue; - } - - $assoc = $class->associationMappings[$propName]; - - // Persistent collection was exchanged with the "originally" - // created one. This can only mean it was cloned and replaced - // on another entity. - if ($actualValue instanceof PersistentCollection) { - $owner = $actualValue->getOwner(); - if ($owner === null) { // cloned - $actualValue->setOwner($entity, $assoc); - } else if ($owner !== $entity) { // no clone, we have to fix - if (!$actualValue->isInitialized()) { - $actualValue->initialize(); // we have to do this otherwise the cols share state - } - $newValue = clone $actualValue; - $newValue->setOwner($entity, $assoc); - $class->reflFields[$propName]->setValue($entity, $newValue); - } - } - - if ($orgValue instanceof PersistentCollection) { - // A PersistentCollection was de-referenced, so delete it. - $coid = spl_object_hash($orgValue); - - if (isset($this->collectionDeletions[$coid])) { - continue; - } - - $this->collectionDeletions[$coid] = $orgValue; - $changeSet[$propName] = $orgValue; // Signal changeset, to-many assocs will be ignored. - - continue; - } - - if ($assoc['type'] & ClassMetadata::TO_ONE) { - if ($assoc['isOwningSide']) { - $changeSet[$propName] = array($orgValue, $actualValue); - } - - if ($orgValue !== null && $assoc['orphanRemoval']) { - $this->scheduleOrphanRemoval($orgValue); - } - } - } - - if ($changeSet) { - $this->entityChangeSets[$oid] = $changeSet; - $this->originalEntityData[$oid] = $actualData; - $this->entityUpdates[$oid] = $entity; - } - } - - // Look for changes in associations of the entity - foreach ($class->associationMappings as $field => $assoc) { - if (($val = $class->reflFields[$field]->getValue($entity)) !== null) { - $this->computeAssociationChanges($assoc, $val); - if (!isset($this->entityChangeSets[$oid]) && - $assoc['isOwningSide'] && - $assoc['type'] == ClassMetadata::MANY_TO_MANY && - $val instanceof PersistentCollection && - $val->isDirty()) { - $this->entityChangeSets[$oid] = array(); - $this->originalEntityData[$oid] = $actualData; - $this->entityUpdates[$oid] = $entity; - } - } - } - } - - /** - * Computes all the changes that have been done to entities and collections - * since the last commit and stores these changes in the _entityChangeSet map - * temporarily for access by the persisters, until the UoW commit is finished. - */ - public function computeChangeSets() - { - // Compute changes for INSERTed entities first. This must always happen. - $this->computeScheduleInsertsChangeSets(); - - // Compute changes for other MANAGED entities. Change tracking policies take effect here. - foreach ($this->identityMap as $className => $entities) { - $class = $this->em->getClassMetadata($className); - - // Skip class if instances are read-only - if ($class->isReadOnly) { - continue; - } - - // If change tracking is explicit or happens through notification, then only compute - // changes on entities of that type that are explicitly marked for synchronization. - switch (true) { - case ($class->isChangeTrackingDeferredImplicit()): - $entitiesToProcess = $entities; - break; - - case (isset($this->scheduledForDirtyCheck[$className])): - $entitiesToProcess = $this->scheduledForDirtyCheck[$className]; - break; - - default: - $entitiesToProcess = array(); - - } - - foreach ($entitiesToProcess as $entity) { - // Ignore uninitialized proxy objects - if ($entity instanceof Proxy && ! $entity->__isInitialized__) { - continue; - } - - // Only MANAGED entities that are NOT SCHEDULED FOR INSERTION are processed here. - $oid = spl_object_hash($entity); - - if ( ! isset($this->entityInsertions[$oid]) && isset($this->entityStates[$oid])) { - $this->computeChangeSet($class, $entity); - } - } - } - } - - /** - * Computes the changes of an association. - * - * @param AssociationMapping $assoc - * @param mixed $value The value of the association. - */ - private function computeAssociationChanges($assoc, $value) - { - if ($value instanceof Proxy && ! $value->__isInitialized__) { - return; - } - - if ($value instanceof PersistentCollection && $value->isDirty()) { - $coid = spl_object_hash($value); - - if ($assoc['isOwningSide']) { - $this->collectionUpdates[$coid] = $value; - } - - $this->visitedCollections[$coid] = $value; - } - - // Look through the entities, and in any of their associations, - // for transient (new) entities, recursively. ("Persistence by reachability") - // Unwrap. Uninitialized collections will simply be empty. - $unwrappedValue = ($assoc['type'] & ClassMetadata::TO_ONE) ? array($value) : $value->unwrap(); - $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); - - foreach ($unwrappedValue as $key => $entry) { - $state = $this->getEntityState($entry, self::STATE_NEW); - $oid = spl_object_hash($entry); - - if (!($entry instanceof $assoc['targetEntity'])) { - throw new ORMException(sprintf("Found entity of type %s on association %s#%s, but expecting %s", - get_class($entry), - $assoc['sourceEntity'], - $assoc['fieldName'], - $targetClass->name - )); - } - - switch ($state) { - case self::STATE_NEW: - if ( ! $assoc['isCascadePersist']) { - throw ORMInvalidArgumentException::newEntityFoundThroughRelationship($assoc, $entry); - } - - $this->persistNew($targetClass, $entry); - $this->computeChangeSet($targetClass, $entry); - break; - - case self::STATE_REMOVED: - // Consume the $value as array (it's either an array or an ArrayAccess) - // and remove the element from Collection. - if ($assoc['type'] & ClassMetadata::TO_MANY) { - unset($value[$key]); - } - break; - - case self::STATE_DETACHED: - // Can actually not happen right now as we assume STATE_NEW, - // so the exception will be raised from the DBAL layer (constraint violation). - throw ORMInvalidArgumentException::detachedEntityFoundThroughRelationship($assoc, $entry); - break; - - default: - // MANAGED associated entities are already taken into account - // during changeset calculation anyway, since they are in the identity map. - } - } - } - - private function persistNew($class, $entity) - { - $oid = spl_object_hash($entity); - - if (isset($class->lifecycleCallbacks[Events::prePersist])) { - $class->invokeLifecycleCallbacks(Events::prePersist, $entity); - } - - if ($this->evm->hasListeners(Events::prePersist)) { - $this->evm->dispatchEvent(Events::prePersist, new LifecycleEventArgs($entity, $this->em)); - } - - $idGen = $class->idGenerator; - - if ( ! $idGen->isPostInsertGenerator()) { - $idValue = $idGen->generate($this->em, $entity); - - if ( ! $idGen instanceof \Doctrine\ORM\Id\AssignedGenerator) { - $idValue = array($class->identifier[0] => $idValue); - - $class->setIdentifierValues($entity, $idValue); - } - - $this->entityIdentifiers[$oid] = $idValue; - } - - $this->entityStates[$oid] = self::STATE_MANAGED; - - $this->scheduleForInsert($entity); - } - - /** - * INTERNAL: - * Computes the changeset of an individual entity, independently of the - * computeChangeSets() routine that is used at the beginning of a UnitOfWork#commit(). - * - * The passed entity must be a managed entity. If the entity already has a change set - * because this method is invoked during a commit cycle then the change sets are added. - * whereby changes detected in this method prevail. - * - * @ignore - * @param ClassMetadata $class The class descriptor of the entity. - * @param object $entity The entity for which to (re)calculate the change set. - * @throws InvalidArgumentException If the passed entity is not MANAGED. - */ - public function recomputeSingleEntityChangeSet(ClassMetadata $class, $entity) - { - $oid = spl_object_hash($entity); - - if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] != self::STATE_MANAGED) { - throw ORMInvalidArgumentException::entityNotManaged($entity); - } - - // skip if change tracking is "NOTIFY" - if ($class->isChangeTrackingNotify()) { - return; - } - - if ( ! $class->isInheritanceTypeNone()) { - $class = $this->em->getClassMetadata(get_class($entity)); - } - - $actualData = array(); - - foreach ($class->reflFields as $name => $refProp) { - if ( ! $class->isIdentifier($name) || ! $class->isIdGeneratorIdentity()) { - $actualData[$name] = $refProp->getValue($entity); - } - } - - $originalData = $this->originalEntityData[$oid]; - $changeSet = array(); - - foreach ($actualData as $propName => $actualValue) { - $orgValue = isset($originalData[$propName]) ? $originalData[$propName] : null; - - if (is_object($orgValue) && $orgValue !== $actualValue) { - $changeSet[$propName] = array($orgValue, $actualValue); - } else if ($orgValue != $actualValue || ($orgValue === null ^ $actualValue === null)) { - $changeSet[$propName] = array($orgValue, $actualValue); - } - } - - if ($changeSet) { - if (isset($this->entityChangeSets[$oid])) { - $this->entityChangeSets[$oid] = array_merge($this->entityChangeSets[$oid], $changeSet); - } - - $this->originalEntityData[$oid] = $actualData; - } - } - - /** - * Executes all entity insertions for entities of the specified type. - * - * @param \Doctrine\ORM\Mapping\ClassMetadata $class - */ - private function executeInserts($class) - { - $className = $class->name; - $persister = $this->getEntityPersister($className); - $entities = array(); - - $hasLifecycleCallbacks = isset($class->lifecycleCallbacks[Events::postPersist]); - $hasListeners = $this->evm->hasListeners(Events::postPersist); - - foreach ($this->entityInsertions as $oid => $entity) { - if (get_class($entity) !== $className) { - continue; - } - - $persister->addInsert($entity); - - unset($this->entityInsertions[$oid]); - - if ($hasLifecycleCallbacks || $hasListeners) { - $entities[] = $entity; - } - } - - $postInsertIds = $persister->executeInserts(); - - if ($postInsertIds) { - // Persister returned post-insert IDs - foreach ($postInsertIds as $id => $entity) { - $oid = spl_object_hash($entity); - $idField = $class->identifier[0]; - - $class->reflFields[$idField]->setValue($entity, $id); - - $this->entityIdentifiers[$oid] = array($idField => $id); - $this->entityStates[$oid] = self::STATE_MANAGED; - $this->originalEntityData[$oid][$idField] = $id; - - $this->addToIdentityMap($entity); - } - } - - foreach ($entities as $entity) { - if ($hasLifecycleCallbacks) { - $class->invokeLifecycleCallbacks(Events::postPersist, $entity); - } - - if ($hasListeners) { - $this->evm->dispatchEvent(Events::postPersist, new LifecycleEventArgs($entity, $this->em)); - } - } - } - - /** - * Executes all entity updates for entities of the specified type. - * - * @param \Doctrine\ORM\Mapping\ClassMetadata $class - */ - private function executeUpdates($class) - { - $className = $class->name; - $persister = $this->getEntityPersister($className); - - $hasPreUpdateLifecycleCallbacks = isset($class->lifecycleCallbacks[Events::preUpdate]); - $hasPreUpdateListeners = $this->evm->hasListeners(Events::preUpdate); - - $hasPostUpdateLifecycleCallbacks = isset($class->lifecycleCallbacks[Events::postUpdate]); - $hasPostUpdateListeners = $this->evm->hasListeners(Events::postUpdate); - - foreach ($this->entityUpdates as $oid => $entity) { - if ( ! (get_class($entity) === $className || $entity instanceof Proxy && get_parent_class($entity) === $className)) { - continue; - } - - if ($hasPreUpdateLifecycleCallbacks) { - $class->invokeLifecycleCallbacks(Events::preUpdate, $entity); - - $this->recomputeSingleEntityChangeSet($class, $entity); - } - - if ($hasPreUpdateListeners) { - $this->evm->dispatchEvent( - Events::preUpdate, - new Event\PreUpdateEventArgs($entity, $this->em, $this->entityChangeSets[$oid]) - ); - } - - if ($this->entityChangeSets[$oid]) { - $persister->update($entity); - } - - unset($this->entityUpdates[$oid]); - - if ($hasPostUpdateLifecycleCallbacks) { - $class->invokeLifecycleCallbacks(Events::postUpdate, $entity); - } - - if ($hasPostUpdateListeners) { - $this->evm->dispatchEvent(Events::postUpdate, new LifecycleEventArgs($entity, $this->em)); - } - } - } - - /** - * Executes all entity deletions for entities of the specified type. - * - * @param \Doctrine\ORM\Mapping\ClassMetadata $class - */ - private function executeDeletions($class) - { - $className = $class->name; - $persister = $this->getEntityPersister($className); - - $hasLifecycleCallbacks = isset($class->lifecycleCallbacks[Events::postRemove]); - $hasListeners = $this->evm->hasListeners(Events::postRemove); - - foreach ($this->entityDeletions as $oid => $entity) { - if ( ! (get_class($entity) == $className || $entity instanceof Proxy && get_parent_class($entity) == $className)) { - continue; - } - - $persister->delete($entity); - - unset( - $this->entityDeletions[$oid], - $this->entityIdentifiers[$oid], - $this->originalEntityData[$oid], - $this->entityStates[$oid] - ); - - // Entity with this $oid after deletion treated as NEW, even if the $oid - // is obtained by a new entity because the old one went out of scope. - //$this->entityStates[$oid] = self::STATE_NEW; - if ( ! $class->isIdentifierNatural()) { - $class->reflFields[$class->identifier[0]]->setValue($entity, null); - } - - if ($hasLifecycleCallbacks) { - $class->invokeLifecycleCallbacks(Events::postRemove, $entity); - } - - if ($hasListeners) { - $this->evm->dispatchEvent(Events::postRemove, new LifecycleEventArgs($entity, $this->em)); - } - } - } - - /** - * Gets the commit order. - * - * @return array - */ - private function getCommitOrder(array $entityChangeSet = null) - { - if ($entityChangeSet === null) { - $entityChangeSet = array_merge($this->entityInsertions, $this->entityUpdates, $this->entityDeletions); - } - - $calc = $this->getCommitOrderCalculator(); - - // See if there are any new classes in the changeset, that are not in the - // commit order graph yet (dont have a node). - // We have to inspect changeSet to be able to correctly build dependencies. - // It is not possible to use IdentityMap here because post inserted ids - // are not yet available. - $newNodes = array(); - - foreach ($entityChangeSet as $oid => $entity) { - $className = get_class($entity); - - if ($calc->hasClass($className)) { - continue; - } - - $class = $this->em->getClassMetadata($className); - $calc->addClass($class); - - $newNodes[] = $class; - } - - // Calculate dependencies for new nodes - while ($class = array_pop($newNodes)) { - foreach ($class->associationMappings as $assoc) { - if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) { - continue; - } - - $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); - - if ( ! $calc->hasClass($targetClass->name)) { - $calc->addClass($targetClass); - - $newNodes[] = $targetClass; - } - - $calc->addDependency($targetClass, $class); - - // If the target class has mapped subclasses, these share the same dependency. - if ( ! $targetClass->subClasses) { - continue; - } - - foreach ($targetClass->subClasses as $subClassName) { - $targetSubClass = $this->em->getClassMetadata($subClassName); - - if ( ! $calc->hasClass($subClassName)) { - $calc->addClass($targetSubClass); - - $newNodes[] = $targetSubClass; - } - - $calc->addDependency($targetSubClass, $class); - } - } - } - - return $calc->getCommitOrder(); - } - - /** - * Schedules an entity for insertion into the database. - * If the entity already has an identifier, it will be added to the identity map. - * - * @param object $entity The entity to schedule for insertion. - */ - public function scheduleForInsert($entity) - { - $oid = spl_object_hash($entity); - - if (isset($this->entityUpdates[$oid])) { - throw new InvalidArgumentException("Dirty entity can not be scheduled for insertion."); - } - - if (isset($this->entityDeletions[$oid])) { - throw ORMInvalidArgumentException::scheduleInsertForRemovedEntity($entity); - } - if (isset($this->originalEntityData[$oid]) && ! isset($this->entityInsertions[$oid])) { - throw ORMInvalidArgumentException::scheduleInsertForManagedEntity($entity); - } - - if (isset($this->entityInsertions[$oid])) { - throw ORMInvalidArgumentException::scheduleInsertTwice($entity); - } - - $this->entityInsertions[$oid] = $entity; - - if (isset($this->entityIdentifiers[$oid])) { - $this->addToIdentityMap($entity); - } - - if ($entity instanceof NotifyPropertyChanged) { - $entity->addPropertyChangedListener($this); - } - } - - /** - * Checks whether an entity is scheduled for insertion. - * - * @param object $entity - * @return boolean - */ - public function isScheduledForInsert($entity) - { - return isset($this->entityInsertions[spl_object_hash($entity)]); - } - - /** - * Schedules an entity for being updated. - * - * @param object $entity The entity to schedule for being updated. - */ - public function scheduleForUpdate($entity) - { - $oid = spl_object_hash($entity); - - if ( ! isset($this->entityIdentifiers[$oid])) { - throw ORMInvalidArgumentException::entityHasNoIdentity($entity, "scheduling for update"); - } - - if (isset($this->entityDeletions[$oid])) { - throw ORMInvalidArgumentException::entityIsRemoved($entity, "schedule for update"); - } - - if ( ! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) { - $this->entityUpdates[$oid] = $entity; - } - } - - /** - * INTERNAL: - * Schedules an extra update that will be executed immediately after the - * regular entity updates within the currently running commit cycle. - * - * Extra updates for entities are stored as (entity, changeset) tuples. - * - * @ignore - * @param object $entity The entity for which to schedule an extra update. - * @param array $changeset The changeset of the entity (what to update). - */ - public function scheduleExtraUpdate($entity, array $changeset) - { - $oid = spl_object_hash($entity); - $extraUpdate = array($entity, $changeset); - - if (isset($this->extraUpdates[$oid])) { - list($ignored, $changeset2) = $this->extraUpdates[$oid]; - - $extraUpdate = array($entity, $changeset + $changeset2); - } - - $this->extraUpdates[$oid] = $extraUpdate; - } - - /** - * Checks whether an entity is registered as dirty in the unit of work. - * Note: Is not very useful currently as dirty entities are only registered - * at commit time. - * - * @param object $entity - * @return boolean - */ - public function isScheduledForUpdate($entity) - { - return isset($this->entityUpdates[spl_object_hash($entity)]); - } - - - /** - * Checks whether an entity is registered to be checked in the unit of work. - * - * @param object $entity - * @return boolean - */ - public function isScheduledForDirtyCheck($entity) - { - $rootEntityName = $this->em->getClassMetadata(get_class($entity))->rootEntityName; - - return isset($this->scheduledForDirtyCheck[$rootEntityName][spl_object_hash($entity)]); - } - - /** - * INTERNAL: - * Schedules an entity for deletion. - * - * @param object $entity - */ - public function scheduleForDelete($entity) - { - $oid = spl_object_hash($entity); - - if (isset($this->entityInsertions[$oid])) { - if ($this->isInIdentityMap($entity)) { - $this->removeFromIdentityMap($entity); - } - - unset($this->entityInsertions[$oid], $this->entityStates[$oid]); - - return; // entity has not been persisted yet, so nothing more to do. - } - - if ( ! $this->isInIdentityMap($entity)) { - return; - } - - $this->removeFromIdentityMap($entity); - - if (isset($this->entityUpdates[$oid])) { - unset($this->entityUpdates[$oid]); - } - - if ( ! isset($this->entityDeletions[$oid])) { - $this->entityDeletions[$oid] = $entity; - $this->entityStates[$oid] = self::STATE_REMOVED; - } - } - - /** - * Checks whether an entity is registered as removed/deleted with the unit - * of work. - * - * @param object $entity - * @return boolean - */ - public function isScheduledForDelete($entity) - { - return isset($this->entityDeletions[spl_object_hash($entity)]); - } - - /** - * Checks whether an entity is scheduled for insertion, update or deletion. - * - * @param $entity - * @return boolean - */ - public function isEntityScheduled($entity) - { - $oid = spl_object_hash($entity); - - return isset($this->entityInsertions[$oid]) - || isset($this->entityUpdates[$oid]) - || isset($this->entityDeletions[$oid]); - } - - /** - * INTERNAL: - * Registers an entity in the identity map. - * Note that entities in a hierarchy are registered with the class name of - * the root entity. - * - * @ignore - * @param object $entity The entity to register. - * @return boolean TRUE if the registration was successful, FALSE if the identity of - * the entity in question is already managed. - */ - public function addToIdentityMap($entity) - { - $classMetadata = $this->em->getClassMetadata(get_class($entity)); - $idHash = implode(' ', $this->entityIdentifiers[spl_object_hash($entity)]); - - if ($idHash === '') { - throw ORMInvalidArgumentException::entityWithoutIdentity($classMetadata->name, $entity); - } - - $className = $classMetadata->rootEntityName; - - if (isset($this->identityMap[$className][$idHash])) { - return false; - } - - $this->identityMap[$className][$idHash] = $entity; - - return true; - } - - /** - * Gets the state of an entity with regard to the current unit of work. - * - * @param object $entity - * @param integer $assume The state to assume if the state is not yet known (not MANAGED or REMOVED). - * This parameter can be set to improve performance of entity state detection - * by potentially avoiding a database lookup if the distinction between NEW and DETACHED - * is either known or does not matter for the caller of the method. - * @return int The entity state. - */ - public function getEntityState($entity, $assume = null) - { - $oid = spl_object_hash($entity); - - if (isset($this->entityStates[$oid])) { - return $this->entityStates[$oid]; - } - - if ($assume !== null) { - return $assume; - } - - // State can only be NEW or DETACHED, because MANAGED/REMOVED states are known. - // Note that you can not remember the NEW or DETACHED state in _entityStates since - // the UoW does not hold references to such objects and the object hash can be reused. - // More generally because the state may "change" between NEW/DETACHED without the UoW being aware of it. - $class = $this->em->getClassMetadata(get_class($entity)); - $id = $class->getIdentifierValues($entity); - - if ( ! $id) { - return self::STATE_NEW; - } - - switch (true) { - case ($class->isIdentifierNatural()); - // Check for a version field, if available, to avoid a db lookup. - if ($class->isVersioned) { - return ($class->getFieldValue($entity, $class->versionField)) - ? self::STATE_DETACHED - : self::STATE_NEW; - } - - // Last try before db lookup: check the identity map. - if ($this->tryGetById($id, $class->rootEntityName)) { - return self::STATE_DETACHED; - } - - // db lookup - if ($this->getEntityPersister(get_class($entity))->exists($entity)) { - return self::STATE_DETACHED; - } - - return self::STATE_NEW; - - case ( ! $class->idGenerator->isPostInsertGenerator()): - // if we have a pre insert generator we can't be sure that having an id - // really means that the entity exists. We have to verify this through - // the last resort: a db lookup - - // Last try before db lookup: check the identity map. - if ($this->tryGetById($id, $class->rootEntityName)) { - return self::STATE_DETACHED; - } - - // db lookup - if ($this->getEntityPersister(get_class($entity))->exists($entity)) { - return self::STATE_DETACHED; - } - - return self::STATE_NEW; - - default: - return self::STATE_DETACHED; - } - } - - /** - * INTERNAL: - * Removes an entity from the identity map. This effectively detaches the - * entity from the persistence management of Doctrine. - * - * @ignore - * @param object $entity - * @return boolean - */ - public function removeFromIdentityMap($entity) - { - $oid = spl_object_hash($entity); - $classMetadata = $this->em->getClassMetadata(get_class($entity)); - $idHash = implode(' ', $this->entityIdentifiers[$oid]); - - if ($idHash === '') { - throw ORMInvalidArgumentException::entityHasNoIdentity($entity, "remove from identity map"); - } - - $className = $classMetadata->rootEntityName; - - if (isset($this->identityMap[$className][$idHash])) { - unset($this->identityMap[$className][$idHash]); - unset($this->readOnlyObjects[$oid]); - - //$this->entityStates[$oid] = self::STATE_DETACHED; - - return true; - } - - return false; - } - - /** - * INTERNAL: - * Gets an entity in the identity map by its identifier hash. - * - * @ignore - * @param string $idHash - * @param string $rootClassName - * @return object - */ - public function getByIdHash($idHash, $rootClassName) - { - return $this->identityMap[$rootClassName][$idHash]; - } - - /** - * INTERNAL: - * Tries to get an entity by its identifier hash. If no entity is found for - * the given hash, FALSE is returned. - * - * @ignore - * @param string $idHash - * @param string $rootClassName - * @return mixed The found entity or FALSE. - */ - public function tryGetByIdHash($idHash, $rootClassName) - { - if (isset($this->identityMap[$rootClassName][$idHash])) { - return $this->identityMap[$rootClassName][$idHash]; - } - - return false; - } - - /** - * Checks whether an entity is registered in the identity map of this UnitOfWork. - * - * @param object $entity - * @return boolean - */ - public function isInIdentityMap($entity) - { - $oid = spl_object_hash($entity); - - if ( ! isset($this->entityIdentifiers[$oid])) { - return false; - } - - $classMetadata = $this->em->getClassMetadata(get_class($entity)); - $idHash = implode(' ', $this->entityIdentifiers[$oid]); - - if ($idHash === '') { - return false; - } - - return isset($this->identityMap[$classMetadata->rootEntityName][$idHash]); - } - - /** - * INTERNAL: - * Checks whether an identifier hash exists in the identity map. - * - * @ignore - * @param string $idHash - * @param string $rootClassName - * @return boolean - */ - public function containsIdHash($idHash, $rootClassName) - { - return isset($this->identityMap[$rootClassName][$idHash]); - } - - /** - * Persists an entity as part of the current unit of work. - * - * @param object $entity The entity to persist. - */ - public function persist($entity) - { - $visited = array(); - - $this->doPersist($entity, $visited); - } - - /** - * Persists an entity as part of the current unit of work. - * - * This method is internally called during persist() cascades as it tracks - * the already visited entities to prevent infinite recursions. - * - * @param object $entity The entity to persist. - * @param array $visited The already visited entities. - */ - private function doPersist($entity, array &$visited) - { - $oid = spl_object_hash($entity); - - if (isset($visited[$oid])) { - return; // Prevent infinite recursion - } - - $visited[$oid] = $entity; // Mark visited - - $class = $this->em->getClassMetadata(get_class($entity)); - - // We assume NEW, so DETACHED entities result in an exception on flush (constraint violation). - // If we would detect DETACHED here we would throw an exception anyway with the same - // consequences (not recoverable/programming error), so just assuming NEW here - // lets us avoid some database lookups for entities with natural identifiers. - $entityState = $this->getEntityState($entity, self::STATE_NEW); - - switch ($entityState) { - case self::STATE_MANAGED: - // Nothing to do, except if policy is "deferred explicit" - if ($class->isChangeTrackingDeferredExplicit()) { - $this->scheduleForDirtyCheck($entity); - } - break; - - case self::STATE_NEW: - $this->persistNew($class, $entity); - break; - - case self::STATE_REMOVED: - // Entity becomes managed again - unset($this->entityDeletions[$oid]); - - $this->entityStates[$oid] = self::STATE_MANAGED; - break; - - case self::STATE_DETACHED: - // Can actually not happen right now since we assume STATE_NEW. - throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted"); - - default: - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); - } - - $this->cascadePersist($entity, $visited); - } - - /** - * Deletes an entity as part of the current unit of work. - * - * @param object $entity The entity to remove. - */ - public function remove($entity) - { - $visited = array(); - - $this->doRemove($entity, $visited); - } - - /** - * Deletes an entity as part of the current unit of work. - * - * This method is internally called during delete() cascades as it tracks - * the already visited entities to prevent infinite recursions. - * - * @param object $entity The entity to delete. - * @param array $visited The map of the already visited entities. - * @throws InvalidArgumentException If the instance is a detached entity. - */ - private function doRemove($entity, array &$visited) - { - $oid = spl_object_hash($entity); - - if (isset($visited[$oid])) { - return; // Prevent infinite recursion - } - - $visited[$oid] = $entity; // mark visited - - // Cascade first, because scheduleForDelete() removes the entity from the identity map, which - // can cause problems when a lazy proxy has to be initialized for the cascade operation. - $this->cascadeRemove($entity, $visited); - - $class = $this->em->getClassMetadata(get_class($entity)); - $entityState = $this->getEntityState($entity); - - switch ($entityState) { - case self::STATE_NEW: - case self::STATE_REMOVED: - // nothing to do - break; - - case self::STATE_MANAGED: - if (isset($class->lifecycleCallbacks[Events::preRemove])) { - $class->invokeLifecycleCallbacks(Events::preRemove, $entity); - } - - if ($this->evm->hasListeners(Events::preRemove)) { - $this->evm->dispatchEvent(Events::preRemove, new LifecycleEventArgs($entity, $this->em)); - } - - $this->scheduleForDelete($entity); - break; - - case self::STATE_DETACHED: - throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed"); - default: - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); - } - - } - - /** - * Merges the state of the given detached entity into this UnitOfWork. - * - * @param object $entity - * @return object The managed copy of the entity. - * @throws OptimisticLockException If the entity uses optimistic locking through a version - * attribute and the version check against the managed copy fails. - * - * @todo Require active transaction!? OptimisticLockException may result in undefined state!? - */ - public function merge($entity) - { - $visited = array(); - - return $this->doMerge($entity, $visited); - } - - /** - * Executes a merge operation on an entity. - * - * @param object $entity - * @param array $visited - * @return object The managed copy of the entity. - * @throws OptimisticLockException If the entity uses optimistic locking through a version - * attribute and the version check against the managed copy fails. - * @throws InvalidArgumentException If the entity instance is NEW. - */ - private function doMerge($entity, array &$visited, $prevManagedCopy = null, $assoc = null) - { - $oid = spl_object_hash($entity); - - if (isset($visited[$oid])) { - return $visited[$oid]; // Prevent infinite recursion - } - - $visited[$oid] = $entity; // mark visited - - $class = $this->em->getClassMetadata(get_class($entity)); - - // First we assume DETACHED, although it can still be NEW but we can avoid - // an extra db-roundtrip this way. If it is not MANAGED but has an identity, - // we need to fetch it from the db anyway in order to merge. - // MANAGED entities are ignored by the merge operation. - $managedCopy = $entity; - - if ($this->getEntityState($entity, self::STATE_DETACHED) !== self::STATE_MANAGED) { - if ($entity instanceof Proxy && ! $entity->__isInitialized__) { - $entity->__load(); - } - - // Try to look the entity up in the identity map. - $id = $class->getIdentifierValues($entity); - - // If there is no ID, it is actually NEW. - if ( ! $id) { - $managedCopy = $this->newInstance($class); - - $this->persistNew($class, $managedCopy); - } else { - $flatId = $id; - if ($class->containsForeignIdentifier) { - // convert foreign identifiers into scalar foreign key - // values to avoid object to string conversion failures. - foreach ($id as $idField => $idValue) { - if (isset($class->associationMappings[$idField])) { - $targetClassMetadata = $this->em->getClassMetadata($class->associationMappings[$idField]['targetEntity']); - $associatedId = $this->getEntityIdentifier($idValue); - $flatId[$idField] = $associatedId[$targetClassMetadata->identifier[0]]; - } - } - } - - $managedCopy = $this->tryGetById($flatId, $class->rootEntityName); - - if ($managedCopy) { - // We have the entity in-memory already, just make sure its not removed. - if ($this->getEntityState($managedCopy) == self::STATE_REMOVED) { - throw ORMInvalidArgumentException::entityIsRemoved($managedCopy, "merge"); - } - } else { - // We need to fetch the managed copy in order to merge. - $managedCopy = $this->em->find($class->name, $flatId); - } - - if ($managedCopy === null) { - // If the identifier is ASSIGNED, it is NEW, otherwise an error - // since the managed entity was not found. - if ( ! $class->isIdentifierNatural()) { - throw new EntityNotFoundException; - } - - $managedCopy = $this->newInstance($class); - $class->setIdentifierValues($managedCopy, $id); - - $this->persistNew($class, $managedCopy); - } else { - if ($managedCopy instanceof Proxy && ! $managedCopy->__isInitialized__) { - $managedCopy->__load(); - } - } - } - - if ($class->isVersioned) { - $managedCopyVersion = $class->reflFields[$class->versionField]->getValue($managedCopy); - $entityVersion = $class->reflFields[$class->versionField]->getValue($entity); - - // Throw exception if versions dont match. - if ($managedCopyVersion != $entityVersion) { - throw OptimisticLockException::lockFailedVersionMissmatch($entity, $entityVersion, $managedCopyVersion); - } - } - - // Merge state of $entity into existing (managed) entity - foreach ($class->reflFields as $name => $prop) { - if ( ! isset($class->associationMappings[$name])) { - if ( ! $class->isIdentifier($name)) { - $prop->setValue($managedCopy, $prop->getValue($entity)); - } - } else { - $assoc2 = $class->associationMappings[$name]; - if ($assoc2['type'] & ClassMetadata::TO_ONE) { - $other = $prop->getValue($entity); - if ($other === null) { - $prop->setValue($managedCopy, null); - } else if ($other instanceof Proxy && !$other->__isInitialized__) { - // do not merge fields marked lazy that have not been fetched. - continue; - } else if ( ! $assoc2['isCascadeMerge']) { - if ($this->getEntityState($other, self::STATE_DETACHED) !== self::STATE_MANAGED) { - $targetClass = $this->em->getClassMetadata($assoc2['targetEntity']); - $relatedId = $targetClass->getIdentifierValues($other); - - if ($targetClass->subClasses) { - $other = $this->em->find($targetClass->name, $relatedId); - } else { - $other = $this->em->getProxyFactory()->getProxy($assoc2['targetEntity'], $relatedId); - $this->registerManaged($other, $relatedId, array()); - } - } - $prop->setValue($managedCopy, $other); - } - } else { - $mergeCol = $prop->getValue($entity); - if ($mergeCol instanceof PersistentCollection && !$mergeCol->isInitialized()) { - // do not merge fields marked lazy that have not been fetched. - // keep the lazy persistent collection of the managed copy. - continue; - } - - $managedCol = $prop->getValue($managedCopy); - if (!$managedCol) { - $managedCol = new PersistentCollection($this->em, - $this->em->getClassMetadata($assoc2['targetEntity']), - new ArrayCollection - ); - $managedCol->setOwner($managedCopy, $assoc2); - $prop->setValue($managedCopy, $managedCol); - $this->originalEntityData[$oid][$name] = $managedCol; - } - if ($assoc2['isCascadeMerge']) { - $managedCol->initialize(); - - // clear and set dirty a managed collection if its not also the same collection to merge from. - if (!$managedCol->isEmpty() && $managedCol !== $mergeCol) { - $managedCol->unwrap()->clear(); - $managedCol->setDirty(true); - - if ($assoc2['isOwningSide'] && $assoc2['type'] == ClassMetadata::MANY_TO_MANY && $class->isChangeTrackingNotify()) { - $this->scheduleForDirtyCheck($managedCopy); - } - } - } - } - } - - if ($class->isChangeTrackingNotify()) { - // Just treat all properties as changed, there is no other choice. - $this->propertyChanged($managedCopy, $name, null, $prop->getValue($managedCopy)); - } - } - - if ($class->isChangeTrackingDeferredExplicit()) { - $this->scheduleForDirtyCheck($entity); - } - } - - if ($prevManagedCopy !== null) { - $assocField = $assoc['fieldName']; - $prevClass = $this->em->getClassMetadata(get_class($prevManagedCopy)); - - if ($assoc['type'] & ClassMetadata::TO_ONE) { - $prevClass->reflFields[$assocField]->setValue($prevManagedCopy, $managedCopy); - } else { - $prevClass->reflFields[$assocField]->getValue($prevManagedCopy)->add($managedCopy); - - if ($assoc['type'] == ClassMetadata::ONE_TO_MANY) { - $class->reflFields[$assoc['mappedBy']]->setValue($managedCopy, $prevManagedCopy); - } - } - } - - // Mark the managed copy visited as well - $visited[spl_object_hash($managedCopy)] = true; - - $this->cascadeMerge($entity, $managedCopy, $visited); - - return $managedCopy; - } - - /** - * Detaches an entity from the persistence management. It's persistence will - * no longer be managed by Doctrine. - * - * @param object $entity The entity to detach. - */ - public function detach($entity) - { - $visited = array(); - - $this->doDetach($entity, $visited); - } - - /** - * Executes a detach operation on the given entity. - * - * @param object $entity - * @param array $visited - * @param boolean $noCascade if true, don't cascade detach operation - */ - private function doDetach($entity, array &$visited, $noCascade = false) - { - $oid = spl_object_hash($entity); - - if (isset($visited[$oid])) { - return; // Prevent infinite recursion - } - - $visited[$oid] = $entity; // mark visited - - switch ($this->getEntityState($entity, self::STATE_DETACHED)) { - case self::STATE_MANAGED: - if ($this->isInIdentityMap($entity)) { - $this->removeFromIdentityMap($entity); - } - - unset( - $this->entityInsertions[$oid], - $this->entityUpdates[$oid], - $this->entityDeletions[$oid], - $this->entityIdentifiers[$oid], - $this->entityStates[$oid], - $this->originalEntityData[$oid] - ); - break; - case self::STATE_NEW: - case self::STATE_DETACHED: - return; - } - - if ( ! $noCascade) { - $this->cascadeDetach($entity, $visited); - } - } - - /** - * Refreshes the state of the given entity from the database, overwriting - * any local, unpersisted changes. - * - * @param object $entity The entity to refresh. - * @throws InvalidArgumentException If the entity is not MANAGED. - */ - public function refresh($entity) - { - $visited = array(); - - $this->doRefresh($entity, $visited); - } - - /** - * Executes a refresh operation on an entity. - * - * @param object $entity The entity to refresh. - * @param array $visited The already visited entities during cascades. - * @throws InvalidArgumentException If the entity is not MANAGED. - */ - private function doRefresh($entity, array &$visited) - { - $oid = spl_object_hash($entity); - - if (isset($visited[$oid])) { - return; // Prevent infinite recursion - } - - $visited[$oid] = $entity; // mark visited - - $class = $this->em->getClassMetadata(get_class($entity)); - - if ($this->getEntityState($entity) !== self::STATE_MANAGED) { - throw ORMInvalidArgumentException::entityNotManaged($entity); - } - - $this->getEntityPersister($class->name)->refresh( - array_combine($class->getIdentifierFieldNames(), $this->entityIdentifiers[$oid]), - $entity - ); - - $this->cascadeRefresh($entity, $visited); - } - - /** - * Cascades a refresh operation to associated entities. - * - * @param object $entity - * @param array $visited - */ - private function cascadeRefresh($entity, array &$visited) - { - $class = $this->em->getClassMetadata(get_class($entity)); - - $associationMappings = array_filter( - $class->associationMappings, - function ($assoc) { return $assoc['isCascadeRefresh']; } - ); - - foreach ($associationMappings as $assoc) { - $relatedEntities = $class->reflFields[$assoc['fieldName']]->getValue($entity); - - switch (true) { - case ($relatedEntities instanceof PersistentCollection): - // Unwrap so that foreach() does not initialize - $relatedEntities = $relatedEntities->unwrap(); - // break; is commented intentionally! - - case ($relatedEntities instanceof Collection): - case (is_array($relatedEntities)): - foreach ($relatedEntities as $relatedEntity) { - $this->doRefresh($relatedEntity, $visited); - } - break; - - case ($relatedEntities !== null): - $this->doRefresh($relatedEntities, $visited); - break; - - default: - // Do nothing - } - } - } - - /** - * Cascades a detach operation to associated entities. - * - * @param object $entity - * @param array $visited - */ - private function cascadeDetach($entity, array &$visited) - { - $class = $this->em->getClassMetadata(get_class($entity)); - - $associationMappings = array_filter( - $class->associationMappings, - function ($assoc) { return $assoc['isCascadeDetach']; } - ); - - foreach ($associationMappings as $assoc) { - $relatedEntities = $class->reflFields[$assoc['fieldName']]->getValue($entity); - - switch (true) { - case ($relatedEntities instanceof PersistentCollection): - // Unwrap so that foreach() does not initialize - $relatedEntities = $relatedEntities->unwrap(); - // break; is commented intentionally! - - case ($relatedEntities instanceof Collection): - case (is_array($relatedEntities)): - foreach ($relatedEntities as $relatedEntity) { - $this->doDetach($relatedEntity, $visited); - } - break; - - case ($relatedEntities !== null): - $this->doDetach($relatedEntities, $visited); - break; - - default: - // Do nothing - } - } - } - - /** - * Cascades a merge operation to associated entities. - * - * @param object $entity - * @param object $managedCopy - * @param array $visited - */ - private function cascadeMerge($entity, $managedCopy, array &$visited) - { - $class = $this->em->getClassMetadata(get_class($entity)); - - $associationMappings = array_filter( - $class->associationMappings, - function ($assoc) { return $assoc['isCascadeMerge']; } - ); - - foreach ($associationMappings as $assoc) { - $relatedEntities = $class->reflFields[$assoc['fieldName']]->getValue($entity); - - if ($relatedEntities instanceof Collection) { - if ($relatedEntities === $class->reflFields[$assoc['fieldName']]->getValue($managedCopy)) { - continue; - } - - if ($relatedEntities instanceof PersistentCollection) { - // Unwrap so that foreach() does not initialize - $relatedEntities = $relatedEntities->unwrap(); - } - - foreach ($relatedEntities as $relatedEntity) { - $this->doMerge($relatedEntity, $visited, $managedCopy, $assoc); - } - } else if ($relatedEntities !== null) { - $this->doMerge($relatedEntities, $visited, $managedCopy, $assoc); - } - } - } - - /** - * Cascades the save operation to associated entities. - * - * @param object $entity - * @param array $visited - * @param array $insertNow - */ - private function cascadePersist($entity, array &$visited) - { - $class = $this->em->getClassMetadata(get_class($entity)); - - $associationMappings = array_filter( - $class->associationMappings, - function ($assoc) { return $assoc['isCascadePersist']; } - ); - - foreach ($associationMappings as $assoc) { - $relatedEntities = $class->reflFields[$assoc['fieldName']]->getValue($entity); - - switch (true) { - case ($relatedEntities instanceof PersistentCollection): - // Unwrap so that foreach() does not initialize - $relatedEntities = $relatedEntities->unwrap(); - // break; is commented intentionally! - - case ($relatedEntities instanceof Collection): - case (is_array($relatedEntities)): - foreach ($relatedEntities as $relatedEntity) { - $this->doPersist($relatedEntity, $visited); - } - break; - - case ($relatedEntities !== null): - $this->doPersist($relatedEntities, $visited); - break; - - default: - // Do nothing - } - } - } - - /** - * Cascades the delete operation to associated entities. - * - * @param object $entity - * @param array $visited - */ - private function cascadeRemove($entity, array &$visited) - { - $class = $this->em->getClassMetadata(get_class($entity)); - - $associationMappings = array_filter( - $class->associationMappings, - function ($assoc) { return $assoc['isCascadeRemove']; } - ); - - foreach ($associationMappings as $assoc) { - if ($entity instanceof Proxy && !$entity->__isInitialized__) { - $entity->__load(); - } - - $relatedEntities = $class->reflFields[$assoc['fieldName']]->getValue($entity); - - switch (true) { - case ($relatedEntities instanceof Collection): - case (is_array($relatedEntities)): - // If its a PersistentCollection initialization is intended! No unwrap! - foreach ($relatedEntities as $relatedEntity) { - $this->doRemove($relatedEntity, $visited); - } - break; - - case ($relatedEntities !== null): - $this->doRemove($relatedEntities, $visited); - break; - - default: - // Do nothing - } - } - } - - /** - * Acquire a lock on the given entity. - * - * @param object $entity - * @param int $lockMode - * @param int $lockVersion - */ - public function lock($entity, $lockMode, $lockVersion = null) - { - if ($this->getEntityState($entity, self::STATE_DETACHED) != self::STATE_MANAGED) { - throw ORMInvalidArgumentException::entityNotManaged($entity); - } - - $entityName = get_class($entity); - $class = $this->em->getClassMetadata($entityName); - - switch ($lockMode) { - case \Doctrine\DBAL\LockMode::OPTIMISTIC; - if ( ! $class->isVersioned) { - throw OptimisticLockException::notVersioned($entityName); - } - - if ($lockVersion === null) { - return; - } - - $entityVersion = $class->reflFields[$class->versionField]->getValue($entity); - - if ($entityVersion != $lockVersion) { - throw OptimisticLockException::lockFailedVersionMissmatch($entity, $lockVersion, $entityVersion); - } - - break; - - case \Doctrine\DBAL\LockMode::PESSIMISTIC_READ: - case \Doctrine\DBAL\LockMode::PESSIMISTIC_WRITE: - if (!$this->em->getConnection()->isTransactionActive()) { - throw TransactionRequiredException::transactionRequired(); - } - - $oid = spl_object_hash($entity); - - $this->getEntityPersister($class->name)->lock( - array_combine($class->getIdentifierFieldNames(), $this->entityIdentifiers[$oid]), - $lockMode - ); - break; - - default: - // Do nothing - } - } - - /** - * Gets the CommitOrderCalculator used by the UnitOfWork to order commits. - * - * @return \Doctrine\ORM\Internal\CommitOrderCalculator - */ - public function getCommitOrderCalculator() - { - if ($this->commitOrderCalculator === null) { - $this->commitOrderCalculator = new Internal\CommitOrderCalculator; - } - - return $this->commitOrderCalculator; - } - - /** - * Clears the UnitOfWork. - * - * @param string $entityName if given, only entities of this type will get detached - */ - public function clear($entityName = null) - { - if ($entityName === null) { - $this->identityMap = - $this->entityIdentifiers = - $this->originalEntityData = - $this->entityChangeSets = - $this->entityStates = - $this->scheduledForDirtyCheck = - $this->entityInsertions = - $this->entityUpdates = - $this->entityDeletions = - $this->collectionDeletions = - $this->collectionUpdates = - $this->extraUpdates = - $this->readOnlyObjects = - $this->orphanRemovals = array(); - - if ($this->commitOrderCalculator !== null) { - $this->commitOrderCalculator->clear(); - } - } else { - $visited = array(); - foreach ($this->identityMap as $className => $entities) { - if ($className === $entityName) { - foreach ($entities as $entity) { - $this->doDetach($entity, $visited, true); - } - } - } - } - - if ($this->evm->hasListeners(Events::onClear)) { - $this->evm->dispatchEvent(Events::onClear, new Event\OnClearEventArgs($this->em, $entityName)); - } - } - - /** - * INTERNAL: - * Schedules an orphaned entity for removal. The remove() operation will be - * invoked on that entity at the beginning of the next commit of this - * UnitOfWork. - * - * @ignore - * @param object $entity - */ - public function scheduleOrphanRemoval($entity) - { - $this->orphanRemovals[spl_object_hash($entity)] = $entity; - } - - /** - * INTERNAL: - * Schedules a complete collection for removal when this UnitOfWork commits. - * - * @param PersistentCollection $coll - */ - public function scheduleCollectionDeletion(PersistentCollection $coll) - { - $coid = spl_object_hash($coll); - - //TODO: if $coll is already scheduled for recreation ... what to do? - // Just remove $coll from the scheduled recreations? - if (isset($this->collectionUpdates[$coid])) { - unset($this->collectionUpdates[$coid]); - } - - $this->collectionDeletions[$coid] = $coll; - } - - public function isCollectionScheduledForDeletion(PersistentCollection $coll) - { - return isset($this->collectionsDeletions[spl_object_hash($coll)]); - } - - /** - * @param ClassMetadata $class - */ - private function newInstance($class) - { - $entity = $class->newInstance(); - - if ($entity instanceof \Doctrine\Common\Persistence\ObjectManagerAware) { - $entity->injectObjectManager($this->em, $class); - } - - return $entity; - } - - /** - * INTERNAL: - * Creates an entity. Used for reconstitution of persistent entities. - * - * @ignore - * @param string $className The name of the entity class. - * @param array $data The data for the entity. - * @param array $hints Any hints to account for during reconstitution/lookup of the entity. - * @return object The managed entity instance. - * @internal Highly performance-sensitive method. - * - * @todo Rename: getOrCreateEntity - */ - public function createEntity($className, array $data, &$hints = array()) - { - $class = $this->em->getClassMetadata($className); - //$isReadOnly = isset($hints[Query::HINT_READ_ONLY]); - - if ($class->isIdentifierComposite) { - $id = array(); - - foreach ($class->identifier as $fieldName) { - $id[$fieldName] = isset($class->associationMappings[$fieldName]) - ? $data[$class->associationMappings[$fieldName]['joinColumns'][0]['name']] - : $data[$fieldName]; - } - - $idHash = implode(' ', $id); - } else { - $idHash = isset($class->associationMappings[$class->identifier[0]]) - ? $data[$class->associationMappings[$class->identifier[0]]['joinColumns'][0]['name']] - : $data[$class->identifier[0]]; - - $id = array($class->identifier[0] => $idHash); - } - - if (isset($this->identityMap[$class->rootEntityName][$idHash])) { - $entity = $this->identityMap[$class->rootEntityName][$idHash]; - $oid = spl_object_hash($entity); - - if ($entity instanceof Proxy && ! $entity->__isInitialized__) { - $entity->__isInitialized__ = true; - $overrideLocalValues = true; - - if ($entity instanceof NotifyPropertyChanged) { - $entity->addPropertyChangedListener($this); - } - } else { - $overrideLocalValues = isset($hints[Query::HINT_REFRESH]); - - // If only a specific entity is set to refresh, check that it's the one - if(isset($hints[Query::HINT_REFRESH_ENTITY])) { - $overrideLocalValues = $hints[Query::HINT_REFRESH_ENTITY] === $entity; - - // inject ObjectManager into just loaded proxies. - if ($overrideLocalValues && $entity instanceof ObjectManagerAware) { - $entity->injectObjectManager($this->em, $class); - } - } - } - - if ($overrideLocalValues) { - $this->originalEntityData[$oid] = $data; - } - } else { - $entity = $this->newInstance($class); - $oid = spl_object_hash($entity); - - $this->entityIdentifiers[$oid] = $id; - $this->entityStates[$oid] = self::STATE_MANAGED; - $this->originalEntityData[$oid] = $data; - - $this->identityMap[$class->rootEntityName][$idHash] = $entity; - - if ($entity instanceof NotifyPropertyChanged) { - $entity->addPropertyChangedListener($this); - } - - $overrideLocalValues = true; - } - - if ( ! $overrideLocalValues) { - return $entity; - } - - foreach ($data as $field => $value) { - if (isset($class->fieldMappings[$field])) { - $class->reflFields[$field]->setValue($entity, $value); - } - } - - // Loading the entity right here, if its in the eager loading map get rid of it there. - unset($this->eagerLoadingEntities[$class->rootEntityName][$idHash]); - - if (isset($this->eagerLoadingEntities[$class->rootEntityName]) && ! $this->eagerLoadingEntities[$class->rootEntityName]) { - unset($this->eagerLoadingEntities[$class->rootEntityName]); - } - - // Properly initialize any unfetched associations, if partial objects are not allowed. - if (isset($hints[Query::HINT_FORCE_PARTIAL_LOAD])) { - return $entity; - } - - foreach ($class->associationMappings as $field => $assoc) { - // Check if the association is not among the fetch-joined associations already. - if (isset($hints['fetchAlias']) && isset($hints['fetched'][$hints['fetchAlias']][$field])) { - continue; - } - - $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); - - switch (true) { - case ($assoc['type'] & ClassMetadata::TO_ONE): - if ( ! $assoc['isOwningSide']) { - // Inverse side of x-to-one can never be lazy - $class->reflFields[$field]->setValue($entity, $this->getEntityPersister($assoc['targetEntity'])->loadOneToOneEntity($assoc, $entity)); - - continue 2; - } - - $associatedId = array(); - - // TODO: Is this even computed right in all cases of composite keys? - foreach ($assoc['targetToSourceKeyColumns'] as $targetColumn => $srcColumn) { - $joinColumnValue = isset($data[$srcColumn]) ? $data[$srcColumn] : null; - - if ($joinColumnValue !== null) { - if ($targetClass->containsForeignIdentifier) { - $associatedId[$targetClass->getFieldForColumn($targetColumn)] = $joinColumnValue; - } else { - $associatedId[$targetClass->fieldNames[$targetColumn]] = $joinColumnValue; - } - } - } - - if ( ! $associatedId) { - // Foreign key is NULL - $class->reflFields[$field]->setValue($entity, null); - $this->originalEntityData[$oid][$field] = null; - - continue; - } - - if ( ! isset($hints['fetchMode'][$class->name][$field])) { - $hints['fetchMode'][$class->name][$field] = $assoc['fetch']; - } - - // Foreign key is set - // Check identity map first - // FIXME: Can break easily with composite keys if join column values are in - // wrong order. The correct order is the one in ClassMetadata#identifier. - $relatedIdHash = implode(' ', $associatedId); - - switch (true) { - case (isset($this->identityMap[$targetClass->rootEntityName][$relatedIdHash])): - $newValue = $this->identityMap[$targetClass->rootEntityName][$relatedIdHash]; - - // if this is an uninitialized proxy, we are deferring eager loads, - // this association is marked as eager fetch, and its an uninitialized proxy (wtf!) - // then we cann append this entity for eager loading! - if ($hints['fetchMode'][$class->name][$field] == ClassMetadata::FETCH_EAGER && - isset($hints['deferEagerLoad']) && - !$targetClass->isIdentifierComposite && - $newValue instanceof Proxy && - $newValue->__isInitialized__ === false) { - - $this->eagerLoadingEntities[$targetClass->rootEntityName][$relatedIdHash] = current($associatedId); - } - - break; - - case ($targetClass->subClasses): - // If it might be a subtype, it can not be lazy. There isn't even - // a way to solve this with deferred eager loading, which means putting - // an entity with subclasses at a *-to-one location is really bad! (performance-wise) - $newValue = $this->getEntityPersister($assoc['targetEntity'])->loadOneToOneEntity($assoc, $entity, $associatedId); - break; - - default: - switch (true) { - // We are negating the condition here. Other cases will assume it is valid! - case ($hints['fetchMode'][$class->name][$field] !== ClassMetadata::FETCH_EAGER): - $newValue = $this->em->getProxyFactory()->getProxy($assoc['targetEntity'], $associatedId); - break; - - // Deferred eager load only works for single identifier classes - case (isset($hints['deferEagerLoad']) && ! $targetClass->isIdentifierComposite): - // TODO: Is there a faster approach? - $this->eagerLoadingEntities[$targetClass->rootEntityName][$relatedIdHash] = current($associatedId); - - $newValue = $this->em->getProxyFactory()->getProxy($assoc['targetEntity'], $associatedId); - break; - - default: - // TODO: This is very imperformant, ignore it? - $newValue = $this->em->find($assoc['targetEntity'], $associatedId); - break; - } - - // PERF: Inlined & optimized code from UnitOfWork#registerManaged() - $newValueOid = spl_object_hash($newValue); - $this->entityIdentifiers[$newValueOid] = $associatedId; - $this->identityMap[$targetClass->rootEntityName][$relatedIdHash] = $newValue; - $this->entityStates[$newValueOid] = self::STATE_MANAGED; - // make sure that when an proxy is then finally loaded, $this->originalEntityData is set also! - break; - } - - $this->originalEntityData[$oid][$field] = $newValue; - $class->reflFields[$field]->setValue($entity, $newValue); - - if ($assoc['inversedBy'] && $assoc['type'] & ClassMetadata::ONE_TO_ONE) { - $inverseAssoc = $targetClass->associationMappings[$assoc['inversedBy']]; - $targetClass->reflFields[$inverseAssoc['fieldName']]->setValue($newValue, $entity); - } - - break; - - default: - // Inject collection - $pColl = new PersistentCollection($this->em, $targetClass, new ArrayCollection); - $pColl->setOwner($entity, $assoc); - $pColl->setInitialized(false); - - $reflField = $class->reflFields[$field]; - $reflField->setValue($entity, $pColl); - - if ($assoc['fetch'] == ClassMetadata::FETCH_EAGER) { - $this->loadCollection($pColl); - $pColl->takeSnapshot(); - } - - $this->originalEntityData[$oid][$field] = $pColl; - break; - } - } - - if ($overrideLocalValues) { - if (isset($class->lifecycleCallbacks[Events::postLoad])) { - $class->invokeLifecycleCallbacks(Events::postLoad, $entity); - } - - - if ($this->evm->hasListeners(Events::postLoad)) { - $this->evm->dispatchEvent(Events::postLoad, new LifecycleEventArgs($entity, $this->em)); - } - } - - return $entity; - } - - /** - * @return void - */ - public function triggerEagerLoads() - { - if ( ! $this->eagerLoadingEntities) { - return; - } - - // avoid infinite recursion - $eagerLoadingEntities = $this->eagerLoadingEntities; - $this->eagerLoadingEntities = array(); - - foreach ($eagerLoadingEntities as $entityName => $ids) { - $class = $this->em->getClassMetadata($entityName); - - if ($ids) { - $this->getEntityPersister($entityName)->loadAll( - array_combine($class->identifier, array(array_values($ids))) - ); - } - } - } - - /** - * Initializes (loads) an uninitialized persistent collection of an entity. - * - * @param PeristentCollection $collection The collection to initialize. - * @todo Maybe later move to EntityManager#initialize($proxyOrCollection). See DDC-733. - */ - public function loadCollection(PersistentCollection $collection) - { - $assoc = $collection->getMapping(); - $persister = $this->getEntityPersister($assoc['targetEntity']); - - switch ($assoc['type']) { - case ClassMetadata::ONE_TO_MANY: - $persister->loadOneToManyCollection($assoc, $collection->getOwner(), $collection); - break; - - case ClassMetadata::MANY_TO_MANY: - $persister->loadManyToManyCollection($assoc, $collection->getOwner(), $collection); - break; - } - } - - /** - * Gets the identity map of the UnitOfWork. - * - * @return array - */ - public function getIdentityMap() - { - return $this->identityMap; - } - - /** - * Gets the original data of an entity. The original data is the data that was - * present at the time the entity was reconstituted from the database. - * - * @param object $entity - * @return array - */ - public function getOriginalEntityData($entity) - { - $oid = spl_object_hash($entity); - - if (isset($this->originalEntityData[$oid])) { - return $this->originalEntityData[$oid]; - } - - return array(); - } - - /** - * @ignore - */ - public function setOriginalEntityData($entity, array $data) - { - $this->originalEntityData[spl_object_hash($entity)] = $data; - } - - /** - * INTERNAL: - * Sets a property value of the original data array of an entity. - * - * @ignore - * @param string $oid - * @param string $property - * @param mixed $value - */ - public function setOriginalEntityProperty($oid, $property, $value) - { - $this->originalEntityData[$oid][$property] = $value; - } - - /** - * Gets the identifier of an entity. - * The returned value is always an array of identifier values. If the entity - * has a composite identifier then the identifier values are in the same - * order as the identifier field names as returned by ClassMetadata#getIdentifierFieldNames(). - * - * @param object $entity - * @return array The identifier values. - */ - public function getEntityIdentifier($entity) - { - return $this->entityIdentifiers[spl_object_hash($entity)]; - } - - /** - * Tries to find an entity with the given identifier in the identity map of - * this UnitOfWork. - * - * @param mixed $id The entity identifier to look for. - * @param string $rootClassName The name of the root class of the mapped entity hierarchy. - * @return mixed Returns the entity with the specified identifier if it exists in - * this UnitOfWork, FALSE otherwise. - */ - public function tryGetById($id, $rootClassName) - { - $idHash = implode(' ', (array) $id); - - if (isset($this->identityMap[$rootClassName][$idHash])) { - return $this->identityMap[$rootClassName][$idHash]; - } - - return false; - } - - /** - * Schedules an entity for dirty-checking at commit-time. - * - * @param object $entity The entity to schedule for dirty-checking. - * @todo Rename: scheduleForSynchronization - */ - public function scheduleForDirtyCheck($entity) - { - $rootClassName = $this->em->getClassMetadata(get_class($entity))->rootEntityName; - - $this->scheduledForDirtyCheck[$rootClassName][spl_object_hash($entity)] = $entity; - } - - /** - * Checks whether the UnitOfWork has any pending insertions. - * - * @return boolean TRUE if this UnitOfWork has pending insertions, FALSE otherwise. - */ - public function hasPendingInsertions() - { - return ! empty($this->entityInsertions); - } - - /** - * Calculates the size of the UnitOfWork. The size of the UnitOfWork is the - * number of entities in the identity map. - * - * @return integer - */ - public function size() - { - $countArray = array_map(function ($item) { return count($item); }, $this->identityMap); - - return array_sum($countArray); - } - - /** - * Gets the EntityPersister for an Entity. - * - * @param string $entityName The name of the Entity. - * - * @return \Doctrine\ORM\Persisters\BasicEntityPersister - */ - public function getEntityPersister($entityName) - { - if (isset($this->persisters[$entityName])) { - return $this->persisters[$entityName]; - } - - $class = $this->em->getClassMetadata($entityName); - - switch (true) { - case ($class->isInheritanceTypeNone()): - $persister = new Persisters\BasicEntityPersister($this->em, $class); - break; - - case ($class->isInheritanceTypeSingleTable()): - $persister = new Persisters\SingleTablePersister($this->em, $class); - break; - - case ($class->isInheritanceTypeJoined()): - $persister = new Persisters\JoinedSubclassPersister($this->em, $class); - break; - - default: - $persister = new Persisters\UnionSubclassPersister($this->em, $class); - } - - $this->persisters[$entityName] = $persister; - - return $this->persisters[$entityName]; - } - - /** - * Gets a collection persister for a collection-valued association. - * - * @param AssociationMapping $association - * - * @return AbstractCollectionPersister - */ - public function getCollectionPersister(array $association) - { - $type = $association['type']; - - if (isset($this->collectionPersisters[$type])) { - return $this->collectionPersisters[$type]; - } - - switch ($type) { - case ClassMetadata::ONE_TO_MANY: - $persister = new Persisters\OneToManyPersister($this->em); - break; - - case ClassMetadata::MANY_TO_MANY: - $persister = new Persisters\ManyToManyPersister($this->em); - break; - } - - $this->collectionPersisters[$type] = $persister; - - return $this->collectionPersisters[$type]; - } - - /** - * INTERNAL: - * Registers an entity as managed. - * - * @param object $entity The entity. - * @param array $id The identifier values. - * @param array $data The original entity data. - */ - public function registerManaged($entity, array $id, array $data) - { - $oid = spl_object_hash($entity); - - $this->entityIdentifiers[$oid] = $id; - $this->entityStates[$oid] = self::STATE_MANAGED; - $this->originalEntityData[$oid] = $data; - - $this->addToIdentityMap($entity); - - if ($entity instanceof NotifyPropertyChanged) { - $entity->addPropertyChangedListener($this); - } - } - - /** - * INTERNAL: - * Clears the property changeset of the entity with the given OID. - * - * @param string $oid The entity's OID. - */ - public function clearEntityChangeSet($oid) - { - $this->entityChangeSets[$oid] = array(); - } - - /* PropertyChangedListener implementation */ - - /** - * Notifies this UnitOfWork of a property change in an entity. - * - * @param object $entity The entity that owns the property. - * @param string $propertyName The name of the property that changed. - * @param mixed $oldValue The old value of the property. - * @param mixed $newValue The new value of the property. - */ - public function propertyChanged($entity, $propertyName, $oldValue, $newValue) - { - $oid = spl_object_hash($entity); - $class = $this->em->getClassMetadata(get_class($entity)); - - $isAssocField = isset($class->associationMappings[$propertyName]); - - if ( ! $isAssocField && ! isset($class->fieldMappings[$propertyName])) { - return; // ignore non-persistent fields - } - - // Update changeset and mark entity for synchronization - $this->entityChangeSets[$oid][$propertyName] = array($oldValue, $newValue); - - if ( ! isset($this->scheduledForDirtyCheck[$class->rootEntityName][$oid])) { - $this->scheduleForDirtyCheck($entity); - } - } - - /** - * Gets the currently scheduled entity insertions in this UnitOfWork. - * - * @return array - */ - public function getScheduledEntityInsertions() - { - return $this->entityInsertions; - } - - /** - * Gets the currently scheduled entity updates in this UnitOfWork. - * - * @return array - */ - public function getScheduledEntityUpdates() - { - return $this->entityUpdates; - } - - /** - * Gets the currently scheduled entity deletions in this UnitOfWork. - * - * @return array - */ - public function getScheduledEntityDeletions() - { - return $this->entityDeletions; - } - - /** - * Get the currently scheduled complete collection deletions - * - * @return array - */ - public function getScheduledCollectionDeletions() - { - return $this->collectionDeletions; - } - - /** - * Gets the currently scheduled collection inserts, updates and deletes. - * - * @return array - */ - public function getScheduledCollectionUpdates() - { - return $this->collectionUpdates; - } - - /** - * Helper method to initialize a lazy loading proxy or persistent collection. - * - * @param object - * @return void - */ - public function initializeObject($obj) - { - if ($obj instanceof Proxy) { - $obj->__load(); - - return; - } - - if ($obj instanceof PersistentCollection) { - $obj->initialize(); - } - } - - /** - * Helper method to show an object as string. - * - * @param object $obj - * @return string - */ - private static function objToStr($obj) - { - return method_exists($obj, '__toString') ? (string)$obj : get_class($obj).'@'.spl_object_hash($obj); - } - - /** - * Marks an entity as read-only so that it will not be considered for updates during UnitOfWork#commit(). - * - * This operation cannot be undone as some parts of the UnitOfWork now keep gathering information - * on this object that might be necessary to perform a correct udpate. - * - * @throws \InvalidArgumentException - * @param $object - * @return void - */ - public function markReadOnly($object) - { - if ( ! is_object($object) || ! $this->isInIdentityMap($object)) { - throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object); - } - - $this->readOnlyObjects[spl_object_hash($object)] = true; - } - - /** - * Is this entity read only? - * - * @throws \InvalidArgumentException - * @param $object - * @return void - */ - public function isReadOnly($object) - { - if ( ! is_object($object) ) { - throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object); - } - - return isset($this->readOnlyObjects[spl_object_hash($object)]); - } -} diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Version.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Version.php deleted file mode 100644 index 8d1cf28..0000000 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Version.php +++ /dev/null @@ -1,55 +0,0 @@ -. - */ - -namespace Doctrine\ORM; - -/** - * Class to store and retrieve the version of Doctrine - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class Version -{ - /** - * Current Doctrine Version - */ - const VERSION = '2.2.4-DEV'; - - /** - * Compares a Doctrine version with the current one. - * - * @param string $version Doctrine version to compare. - * @return int Returns -1 if older, 0 if it is the same, 1 if version - * passed as argument is newer. - */ - public static function compare($version) - { - $currentVersion = str_replace(' ', '', strtolower(self::VERSION)); - $version = str_replace(' ', '', $version); - - return version_compare($version, $currentVersion); - } -} diff --git a/vendor/doctrine/orm/phpunit.xml.dist b/vendor/doctrine/orm/phpunit.xml.dist deleted file mode 100644 index 3ab5edb..0000000 --- a/vendor/doctrine/orm/phpunit.xml.dist +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - ./tests/Doctrine/Tests/ORM - - - - - - performance - locking_functional - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/doctrine/orm/run-all.sh b/vendor/doctrine/orm/run-all.sh deleted file mode 100755 index 80712ee..0000000 --- a/vendor/doctrine/orm/run-all.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# This script is a small convenience wrapper for running the doctrine testsuite against a large bunch of databases. -# Just create the phpunit.xmls as described in the array below and configure the specific files section -# to connect to that database. Just omit a file if you dont have that database and the tests will be skipped. - -configs[1]="mysql.phpunit.xml" -configs[2]='postgres.phpunit.xml' -configs[3]='sqlite.phpunit.xml' -configs[4]='oracle.phpunit.xml' -configs[5]='db2.phpunit.xml' -configs[6]='pdo-ibm.phpunit.xml' -configs[7]='sqlsrv.phpunit.xml' - -for i in "${configs[@]}"; do - if [ -f "$i" ]; - then - echo "RUNNING TESTS WITH CONFIG $i" - phpunit -c "$i" "$@" - fi; -done diff --git a/vendor/doctrine/orm/tests/.gitignore b/vendor/doctrine/orm/tests/.gitignore deleted file mode 100644 index 7210405..0000000 --- a/vendor/doctrine/orm/tests/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -Doctrine/Tests/Proxies/ -Doctrine/Tests/ORM/Proxy/generated/ -Doctrine/Tests/ORM/Tools/Export/export diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/DbalFunctionalTestCase.php b/vendor/doctrine/orm/tests/Doctrine/Tests/DbalFunctionalTestCase.php deleted file mode 100644 index c4705a2..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/DbalFunctionalTestCase.php +++ /dev/null @@ -1,32 +0,0 @@ -sharedFixture['conn'] = null; - self::$_sharedConn = null; - } - - protected function setUp() - { - if (isset($this->sharedFixture['conn'])) { - $this->_conn = $this->sharedFixture['conn']; - } else { - if ( ! isset(self::$_sharedConn)) { - self::$_sharedConn = TestUtil::getConnection(); - } - $this->_conn = self::$_sharedConn; - } - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/DbalTestCase.php b/vendor/doctrine/orm/tests/Doctrine/Tests/DbalTestCase.php deleted file mode 100644 index 2478e7b..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/DbalTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ -getIntegerTypeDeclarationSQL($fieldDeclaration); - } - - public function canRequireSQLConversion() - { - return true; - } - - public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform) - { - return 'ABS(' . $sqlExpr . ')'; - } - - public function convertToPHPValueSQL($sqlExpr, $platform) - { - return '-(' . $sqlExpr . ')'; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/DbalTypes/UpperCaseStringType.php b/vendor/doctrine/orm/tests/Doctrine/Tests/DbalTypes/UpperCaseStringType.php deleted file mode 100644 index 47e8c79..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/DbalTypes/UpperCaseStringType.php +++ /dev/null @@ -1,29 +0,0 @@ -_generatorType = $type; - } - -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/ConnectionMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/ConnectionMock.php deleted file mode 100644 index 90ebfec..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/ConnectionMock.php +++ /dev/null @@ -1,106 +0,0 @@ -_platformMock = new DatabasePlatformMock(); - - parent::__construct($params, $driver, $config, $eventManager); - - // Override possible assignment of platform to database platform mock - $this->_platform = $this->_platformMock; - } - - /** - * @override - */ - public function getDatabasePlatform() - { - return $this->_platformMock; - } - - /** - * @override - */ - public function insert($tableName, array $data, array $types = array()) - { - $this->_inserts[$tableName][] = $data; - } - - /** - * @override - */ - public function executeUpdate($query, array $params = array(), array $types = array()) - { - $this->_executeUpdates[] = array('query' => $query, 'params' => $params, 'types' => $types); - } - - /** - * @override - */ - public function lastInsertId($seqName = null) - { - return $this->_lastInsertId; - } - - /** - * @override - */ - public function fetchColumn($statement, array $params = array(), $colnum = 0) - { - return $this->_fetchOneResult; - } - - /** - * @override - */ - public function quote($input, $type = null) - { - if (is_string($input)) { - return "'" . $input . "'"; - } - return $input; - } - - /* Mock API */ - - public function setFetchOneResult($fetchOneResult) - { - $this->_fetchOneResult = $fetchOneResult; - } - - public function setDatabasePlatform($platform) - { - $this->_platformMock = $platform; - } - - public function setLastInsertId($id) - { - $this->_lastInsertId = $id; - } - - public function getInserts() - { - return $this->_inserts; - } - - public function getExecuteUpdates() - { - return $this->_executeUpdates; - } - - public function reset() - { - $this->_inserts = array(); - $this->_lastInsertId = 0; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php deleted file mode 100644 index b634408..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php +++ /dev/null @@ -1,97 +0,0 @@ -_prefersIdentityColumns; - } - - /** - * @override - */ - public function prefersSequences() - { - return $this->_prefersSequences; - } - - /** @override */ - public function getSequenceNextValSQL($sequenceName) - { - return $this->_sequenceNextValSql; - } - - /** @override */ - public function getBooleanTypeDeclarationSQL(array $field) {} - - /** @override */ - public function getIntegerTypeDeclarationSQL(array $field) {} - - /** @override */ - public function getBigIntTypeDeclarationSQL(array $field) {} - - /** @override */ - public function getSmallIntTypeDeclarationSQL(array $field) {} - - /** @override */ - protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef) {} - - /** @override */ - public function getVarcharTypeDeclarationSQL(array $field) {} - - /** @override */ - public function getClobTypeDeclarationSQL(array $field) {} - - /* MOCK API */ - - public function setPrefersIdentityColumns($bool) - { - $this->_prefersIdentityColumns = $bool; - } - - public function setPrefersSequences($bool) - { - $this->_prefersSequences = $bool; - } - - public function setSequenceNextValSql($sql) - { - $this->_sequenceNextValSql = $sql; - } - - public function getName() - { - return 'mock'; - } - - protected function initializeDoctrineTypeMappings() - { - - } - /** - * Gets the SQL Snippet used to declare a BLOB column type. - */ - public function getBlobTypeDeclarationSQL(array $field) - { - throw DBALException::notSupported(__METHOD__); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php deleted file mode 100644 index 03d44ca..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php +++ /dev/null @@ -1,17 +0,0 @@ -_platformMock) { - $this->_platformMock = new DatabasePlatformMock; - } - return $this->_platformMock; - } - - /** - * @override - */ - public function getSchemaManager(\Doctrine\DBAL\Connection $conn) - { - if($this->_schemaManagerMock == null) { - return new SchemaManagerMock($conn); - } else { - return $this->_schemaManagerMock; - } - } - - /* MOCK API */ - - public function setDatabasePlatform(\Doctrine\DBAL\Platforms\AbstractPlatform $platform) - { - $this->_platformMock = $platform; - } - - public function setSchemaManager(\Doctrine\DBAL\Schema\AbstractSchemaManager $sm) - { - $this->_schemaManagerMock = $sm; - } - - public function getName() - { - return 'mock'; - } - - public function getDatabase(\Doctrine\DBAL\Connection $conn) - { - return; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/EntityManagerMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/EntityManagerMock.php deleted file mode 100644 index 04b038d..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/EntityManagerMock.php +++ /dev/null @@ -1,106 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Mocks; - -use Doctrine\ORM\Proxy\ProxyFactory; - -/** - * Special EntityManager mock used for testing purposes. - */ -class EntityManagerMock extends \Doctrine\ORM\EntityManager -{ - private $_uowMock; - private $_proxyFactoryMock; - private $_idGenerators = array(); - - /** - * @override - */ - public function getUnitOfWork() - { - return isset($this->_uowMock) ? $this->_uowMock : parent::getUnitOfWork(); - } - - /* Mock API */ - - /** - * Sets a (mock) UnitOfWork that will be returned when getUnitOfWork() is called. - * - * @param $uow - */ - public function setUnitOfWork($uow) - { - $this->_uowMock = $uow; - } - - public function setProxyFactory($proxyFactory) - { - $this->_proxyFactoryMock = $proxyFactory; - } - - public function getProxyFactory() - { - return isset($this->_proxyFactoryMock) ? $this->_proxyFactoryMock : parent::getProxyFactory(); - } - - /** - * Mock factory method to create an EntityManager. - * - * @param unknown_type $conn - * @param unknown_type $name - * @param Doctrine_Configuration $config - * @param Doctrine_EventManager $eventManager - * @return Doctrine\ORM\EntityManager - */ - public static function create($conn, \Doctrine\ORM\Configuration $config = null, - \Doctrine\Common\EventManager $eventManager = null) - { - if (is_null($config)) { - $config = new \Doctrine\ORM\Configuration(); - $config->setProxyDir(__DIR__ . '/../Proxies'); - $config->setProxyNamespace('Doctrine\Tests\Proxies'); - $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver()); - } - if (is_null($eventManager)) { - $eventManager = new \Doctrine\Common\EventManager(); - } - - return new EntityManagerMock($conn, $config, $eventManager); - } -/* - public function setIdGenerator($className, $generator) - { - $this->_idGenerators[$className] = $generator; - } -*/ - /** @override */ -/* public function getIdGenerator($className) - { - - if (isset($this->_idGenerators[$className])) { - return $this->_idGenerators[$className]; - } - - return parent::getIdGenerator($className); - } - */ -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/EntityPersisterMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/EntityPersisterMock.php deleted file mode 100644 index 768e357..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/EntityPersisterMock.php +++ /dev/null @@ -1,100 +0,0 @@ - $entity - * @return - * @override - */ - public function insert($entity) - { - $this->_inserts[] = $entity; - if ( ! is_null($this->_mockIdGeneratorType) && $this->_mockIdGeneratorType == \Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_IDENTITY - || $this->_class->isIdGeneratorIdentity()) { - $id = $this->_identityColumnValueCounter++; - $this->_postInsertIds[$id] = $entity; - return $id; - } - return null; - } - - public function addInsert($entity) - { - $this->_inserts[] = $entity; - if ( ! is_null($this->_mockIdGeneratorType) && $this->_mockIdGeneratorType == \Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_IDENTITY - || $this->_class->isIdGeneratorIdentity()) { - $id = $this->_identityColumnValueCounter++; - $this->_postInsertIds[$id] = $entity; - return $id; - } - return null; - } - - public function executeInserts() - { - return $this->_postInsertIds; - } - - public function setMockIdGeneratorType($genType) - { - $this->_mockIdGeneratorType = $genType; - } - - public function update($entity) - { - $this->_updates[] = $entity; - } - - public function exists($entity, array $extraConditions = array()) - { - $this->existsCalled = true; - } - - public function delete($entity) - { - $this->_deletes[] = $entity; - } - - public function getInserts() - { - return $this->_inserts; - } - - public function getUpdates() - { - return $this->_updates; - } - - public function getDeletes() - { - return $this->_deletes; - } - - public function reset() - { - $this->existsCalled = false; - $this->_identityColumnValueCounter = 0; - $this->_inserts = array(); - $this->_updates = array(); - $this->_deletes = array(); - } - - public function isExistsCalled() - { - return $this->existsCalled; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php deleted file mode 100644 index 83e978f..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php +++ /dev/null @@ -1,111 +0,0 @@ - - */ -class HydratorMockStatement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement -{ - private $_resultSet; - - /** - * Creates a new mock statement that will serve the provided fake result set to clients. - * - * @param array $resultSet The faked SQL result set. - */ - public function __construct(array $resultSet) - { - $this->_resultSet = $resultSet; - } - - /** - * Fetches all rows from the result set. - * - * @return array - */ - public function fetchAll($fetchStyle = null, $columnIndex = null, array $ctorArgs = null) - { - return $this->_resultSet; - } - - public function fetchColumn($columnNumber = 0) - { - $row = current($this->_resultSet); - if ( ! is_array($row)) return false; - $val = array_shift($row); - return $val !== null ? $val : false; - } - - /** - * Fetches the next row in the result set. - * - */ - public function fetch($fetchStyle = null) - { - $current = current($this->_resultSet); - next($this->_resultSet); - return $current; - } - - /** - * Closes the cursor, enabling the statement to be executed again. - * - * @return boolean - */ - public function closeCursor() - { - return true; - } - - public function setResultSet(array $resultSet) - { - reset($resultSet); - $this->_resultSet = $resultSet; - } - - public function bindColumn($column, &$param, $type = null) - { - } - - public function bindValue($param, $value, $type = null) - { - } - - public function bindParam($column, &$variable, $type = null, $length = null, $driverOptions = array()) - { - } - - public function columnCount() - { - } - - public function errorCode() - { - } - - public function errorInfo() - { - } - - public function execute($params = array()) - { - } - - public function rowCount() - { - } - - public function getIterator() - { - return $this->_resultSet; - } - - public function setFetchMode($fetchMode) - { - - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/IdentityIdGeneratorMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/IdentityIdGeneratorMock.php deleted file mode 100644 index 0c5696b..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/IdentityIdGeneratorMock.php +++ /dev/null @@ -1,12 +0,0 @@ -_mockPostInsertId = $id; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/MetadataDriverMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/MetadataDriverMock.php deleted file mode 100644 index fb533f4..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/MetadataDriverMock.php +++ /dev/null @@ -1,21 +0,0 @@ -_sequenceNumber++; - } - - /** - * @override - */ - public function nextId($seqName, $ondemand = true) - { - return $this->_sequenceNumber++; - } - - /** - * @override - */ - public function lastInsertId($table = null, $field = null) - { - return $this->_sequenceNumber - 1; - } - - /** - * @override - */ - public function currId($seqName) - { - return $this->_sequenceNumber; - } - - /* Mock API */ - - public function reset() - { - $this->_sequenceNumber = 0; - } - - public function autoinc() - { - $this->_sequenceNumber++; - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/TaskMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/TaskMock.php deleted file mode 100644 index d4d5068..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/TaskMock.php +++ /dev/null @@ -1,81 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Mocks; - -use Doctrine\Common\Cli\AbstractNamespace; - -/** - * TaskMock used for testing the CLI interface. - * @author Nils Adermann - */ -class TaskMock extends \Doctrine\Common\Cli\Tasks\AbstractTask -{ - /** - * Since instances of this class can be created elsewhere all instances - * register themselves in this array for later inspection. - * - * @var array(TaskMock) - */ - static public $instances = array(); - - private $runCounter = 0; - - /** - * Constructor of Task Mock Object. - * Makes sure the object can be inspected later. - * - * @param AbstractNamespace CLI Namespace, passed to parent constructor - */ - function __construct(AbstractNamespace $namespace) - { - self::$instances[] = $this; - - parent::__construct($namespace); - } - - /** - * Returns the number of times run() was called on this object. - * - * @return int - */ - public function getRunCounter() - { - return $this->runCounter; - } - - /* Mock API */ - - /** - * Method invoked by CLI to run task. - */ - public function run() - { - $this->runCounter++; - } - - /** - * Method supposed to generate the CLI Task Documentation - */ - public function buildDocumentation() - { - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/UnitOfWorkMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/UnitOfWorkMock.php deleted file mode 100644 index 9535cdd..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/UnitOfWorkMock.php +++ /dev/null @@ -1,58 +0,0 @@ -_persisterMock[$entityName]) ? - $this->_persisterMock[$entityName] : parent::getEntityPersister($entityName); - } - - /** - * @param $entity - * @override - */ - public function getEntityChangeSet($entity) - { - $oid = spl_object_hash($entity); - return isset($this->_mockDataChangeSets[$oid]) ? - $this->_mockDataChangeSets[$oid] : parent::getEntityChangeSet($entity); - } - - /* MOCK API */ - - /** - * Sets a (mock) persister for an entity class that will be returned when - * getEntityPersister() is invoked for that class. - * - * @param $entityName - * @param $persister - */ - public function setEntityPersister($entityName, $persister) - { - $this->_persisterMock[$entityName] = $persister; - } - - public function setDataChangeSet($entity, array $mockChangeSet) - { - $this->_mockDataChangeSets[spl_object_hash($entity)] = $mockChangeSet; - } - - public function setEntityState($entity, $state) - { - $this->_entityStates[spl_object_hash($entity)] = $state; - } - - public function setOriginalEntityData($entity, array $originalData) - { - $this->_originalEntityData[spl_object_hash($entity)] = $originalData; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsAddress.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsAddress.php deleted file mode 100644 index d32416a..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsAddress.php +++ /dev/null @@ -1,72 +0,0 @@ -id; - } - - public function getUser() { - return $this->user; - } - - public function getCountry() { - return $this->country; - } - - public function getZipCode() { - return $this->zip; - } - - public function getCity() { - return $this->city; - } - - public function setUser(CmsUser $user) { - if ($this->user !== $user) { - $this->user = $user; - $user->setAddress($this); - } - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsArticle.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsArticle.php deleted file mode 100644 index 266cbc6..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsArticle.php +++ /dev/null @@ -1,48 +0,0 @@ -user = $author; - } - - public function addComment(CmsComment $comment) { - $this->comments[] = $comment; - $comment->setArticle($this); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsComment.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsComment.php deleted file mode 100644 index 3e23821..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsComment.php +++ /dev/null @@ -1,38 +0,0 @@ -article = $article; - } - - public function __toString() { - return __CLASS__."[id=".$this->id."]"; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsEmail.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsEmail.php deleted file mode 100644 index c79c300..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsEmail.php +++ /dev/null @@ -1,48 +0,0 @@ -id; - } - - public function getEmail() { - return $this->email; - } - - public function setEmail($email) { - $this->email = $email; - } - - public function getUser() { - return $this->user; - } - - public function setUser(CmsUser $user) { - $this->user = $user; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsEmployee.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsEmployee.php deleted file mode 100644 index c169715..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsEmployee.php +++ /dev/null @@ -1,44 +0,0 @@ -id; - } - - public function getName() { - return $this->name; - } - - public function getSpouse() { - return $this->spouse; - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsGroup.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsGroup.php deleted file mode 100644 index b65ae85..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsGroup.php +++ /dev/null @@ -1,49 +0,0 @@ -name = $name; - } - - public function getName() { - return $this->name; - } - - public function addUser(CmsUser $user) { - $this->users[] = $user; - } - - public function getUsers() { - return $this->users; - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsPhonenumber.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsPhonenumber.php deleted file mode 100644 index ff28dfd..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsPhonenumber.php +++ /dev/null @@ -1,28 +0,0 @@ -user = $user; - } - - public function getUser() { - return $this->user; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsUser.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsUser.php deleted file mode 100644 index 05fefb5..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsUser.php +++ /dev/null @@ -1,139 +0,0 @@ -phonenumbers = new ArrayCollection; - $this->articles = new ArrayCollection; - $this->groups = new ArrayCollection; - } - - public function getId() { - return $this->id; - } - - public function getStatus() { - return $this->status; - } - - public function getUsername() { - return $this->username; - } - - public function getName() { - return $this->name; - } - - /** - * Adds a phonenumber to the user. - * - * @param CmsPhonenumber $phone - */ - public function addPhonenumber(CmsPhonenumber $phone) { - $this->phonenumbers[] = $phone; - $phone->setUser($this); - } - - public function getPhonenumbers() { - return $this->phonenumbers; - } - - public function addArticle(CmsArticle $article) { - $this->articles[] = $article; - $article->setAuthor($this); - } - - public function addGroup(CmsGroup $group) { - $this->groups[] = $group; - $group->addUser($this); - } - - public function getGroups() { - return $this->groups; - } - - public function removePhonenumber($index) { - if (isset($this->phonenumbers[$index])) { - $ph = $this->phonenumbers[$index]; - unset($this->phonenumbers[$index]); - $ph->user = null; - return true; - } - return false; - } - - public function getAddress() { return $this->address; } - - public function setAddress(CmsAddress $address) { - if ($this->address !== $address) { - $this->address = $address; - $address->setUser($this); - } - } - - public function getEmail() { return $this->email; } - - public function setEmail(CmsEmail $email = null) { - if ($this->email !== $email) { - $this->email = $email; - - if ($email) { - $email->setUser($this); - } - } - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyAuction.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyAuction.php deleted file mode 100644 index 5743122..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyAuction.php +++ /dev/null @@ -1,17 +0,0 @@ -data = $data; - } - - public function getData() { - return $this->data; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyCar.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyCar.php deleted file mode 100644 index 5af89b2..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyCar.php +++ /dev/null @@ -1,33 +0,0 @@ -brand = $brand; - } - - public function getId() { - return $this->id; - } - - public function getBrand() { - return $this->title; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyContract.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyContract.php deleted file mode 100644 index 7787e96..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyContract.php +++ /dev/null @@ -1,89 +0,0 @@ -engineers = new \Doctrine\Common\Collections\ArrayCollection; - } - - public function getId() - { - return $this->id; - } - - public function markCompleted() - { - $this->completed = true; - } - - public function isCompleted() - { - return $this->completed; - } - - public function getSalesPerson() - { - return $this->salesPerson; - } - - public function setSalesPerson(CompanyEmployee $salesPerson) - { - $this->salesPerson = $salesPerson; - } - - public function getEngineers() - { - return $this->engineers; - } - - public function addEngineer(CompanyEmployee $engineer) - { - $this->engineers[] = $engineer; - } - - public function removeEngineer(CompanyEmployee $engineer) - { - $this->engineers->removeElement($engineer); - } - - abstract public function calculatePrice(); -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyEmployee.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyEmployee.php deleted file mode 100644 index 9d15377..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyEmployee.php +++ /dev/null @@ -1,59 +0,0 @@ -salary; - } - - public function setSalary($salary) { - $this->salary = $salary; - } - - public function getDepartment() { - return $this->department; - } - - public function setDepartment($dep) { - $this->department = $dep; - } - - public function getStartDate() { - return $this->startDate; - } - - public function setStartDate($date) { - $this->startDate = $date; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyEvent.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyEvent.php deleted file mode 100644 index bb320aa..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyEvent.php +++ /dev/null @@ -1,36 +0,0 @@ -id; - } - - public function getOrganization() { - return $this->organization; - } - - public function setOrganization(CompanyOrganization $org) { - $this->organization = $org; - } - -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFixContract.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFixContract.php deleted file mode 100644 index 9186fc3..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFixContract.php +++ /dev/null @@ -1,30 +0,0 @@ -fixPrice; - } - - public function getFixPrice() - { - return $this->fixPrice; - } - - public function setFixPrice($fixPrice) - { - $this->fixPrice = $fixPrice; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFlexContract.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFlexContract.php deleted file mode 100644 index e322888..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFlexContract.php +++ /dev/null @@ -1,68 +0,0 @@ -hoursWorked * $this->pricePerHour; - } - - public function getHoursWorked() - { - return $this->hoursWorked; - } - - public function setHoursWorked($hoursWorked) - { - $this->hoursWorked = $hoursWorked; - } - - public function getPricePerHour() - { - return $this->pricePerHour; - } - - public function setPricePerHour($pricePerHour) - { - $this->pricePerHour = $pricePerHour; - } - public function getManagers() - { - return $this->managers; - } - - public function addManager(CompanyManager $manager) - { - $this->managers[] = $manager; - } - - public function removeManager(CompanyManager $manager) - { - $this->managers->removeElement($manager); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFlexUltraContract.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFlexUltraContract.php deleted file mode 100644 index b9ad3d4..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFlexUltraContract.php +++ /dev/null @@ -1,30 +0,0 @@ -maxPrice, parent::calculatePrice()); - } - - public function getMaxPrice() - { - return $this->maxPrice; - } - - public function setMaxPrice($maxPrice) - { - $this->maxPrice = $maxPrice; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyManager.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyManager.php deleted file mode 100644 index aec9a77..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyManager.php +++ /dev/null @@ -1,42 +0,0 @@ -title; - } - - public function setTitle($title) { - $this->title = $title; - } - - public function getCar() { - return $this->car; - } - - public function setCar(CompanyCar $car) { - $this->car = $car; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyOrganization.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyOrganization.php deleted file mode 100644 index ca99410..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyOrganization.php +++ /dev/null @@ -1,44 +0,0 @@ -id; - } - - public function getEvents() { - return $this->events; - } - - public function addEvent(CompanyEvent $event) { - $this->events[] = $event; - $event->setOrganization($this); - } - - /** - * @OneToOne(targetEntity="CompanyEvent", cascade={"persist"}) - * @JoinColumn(name="main_event_id", referencedColumnName="id", nullable=true) - */ - private $mainevent; - - public function getMainEvent() { - return $this->mainevent; - } - - public function setMainEvent($event) { - $this->mainevent = $event; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyPerson.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyPerson.php deleted file mode 100644 index 0dfe919..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyPerson.php +++ /dev/null @@ -1,82 +0,0 @@ -friends = new \Doctrine\Common\Collections\ArrayCollection; - } - - public function getId() { - return $this->id; - } - - public function getName() { - return $this->name; - } - - public function setName($name) { - $this->name = $name; - } - - public function getSpouse() { - return $this->spouse; - } - - public function getFriends() { - return $this->friends; - } - - public function addFriend(CompanyPerson $friend) { - if ( ! $this->friends->contains($friend)) { - $this->friends->add($friend); - $friend->addFriend($this); - } - } - - public function setSpouse(CompanyPerson $spouse) { - if ($spouse !== $this->spouse) { - $this->spouse = $spouse; - $this->spouse->setSpouse($this); - } - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyRaffle.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyRaffle.php deleted file mode 100644 index 733190d..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyRaffle.php +++ /dev/null @@ -1,17 +0,0 @@ -data = $data; - } - - public function getData() { - return $this->data; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeChild.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeChild.php deleted file mode 100644 index e178ab5..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeChild.php +++ /dev/null @@ -1,21 +0,0 @@ -friendsWithMe = new \Doctrine\Common\Collections\ArrayCollection(); - $this->myFriends = new \Doctrine\Common\Collections\ArrayCollection(); - } - - public function addMyFriend(CustomTypeParent $friend) - { - $this->getMyFriends()->add($friend); - $friend->addFriendWithMe($this); - } - - public function getMyFriends() - { - return $this->myFriends; - } - - public function addFriendWithMe(CustomTypeParent $friend) - { - $this->getFriendsWithMe()->add($friend); - } - - public function getFriendsWithMe() - { - return $this->friendsWithMe; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeUpperCase.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeUpperCase.php deleted file mode 100644 index 26e0ec1..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeUpperCase.php +++ /dev/null @@ -1,21 +0,0 @@ -articleDetails = $details; - $this->reference = $reference; - $this->translation = $translation; - } - - public function getId() - { - return $this->id; - } - - public function getArticleDetails() - { - return $this->articleDetails; - } - - public function getReference() - { - return $this->reference; - } - - public function getTranslation() - { - return $this->translation; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Article.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Article.php deleted file mode 100644 index d77bb94..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Article.php +++ /dev/null @@ -1,87 +0,0 @@ -title = $title; - $this->references = new \Doctrine\Common\Collections\ArrayCollection(); - $this->translations = new \Doctrine\Common\Collections\ArrayCollection(); - } - - public function setDetails($details) - { - $this->details = $details; - } - - public function id() - { - return $this->id; - } - - public function addReference($reference) - { - $this->references[] = $reference; - } - - public function references() - { - return $this->references; - } - - public function addTranslation($language, $title) - { - $this->translations[] = new DDC117Translation($this, $language, $title); - } - - public function getText() - { - return $this->details->getText(); - } - - public function getDetails() - { - return $this->details; - } - - public function resetText() - { - $this->details = null; - } - - public function getTranslations() - { - return $this->translations; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117ArticleDetails.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117ArticleDetails.php deleted file mode 100644 index ae13df0..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117ArticleDetails.php +++ /dev/null @@ -1,39 +0,0 @@ -article = $article; - $article->setDetails($this); - - $this->update($text); - } - - public function update($text) - { - $this->text = $text; - } - - public function getText() - { - return $this->text; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Editor.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Editor.php deleted file mode 100644 index a323bb3..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Editor.php +++ /dev/null @@ -1,54 +0,0 @@ -name = $name; - $this->reviewingTranslations = new \Doctrine\Common\Collections\ArrayCollection(); - } - - public function addLastTranslation(DDC117Translation $t) - { - $this->lastTranslation = $t; - $t->lastTranslatedBy[] = $this; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Link.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Link.php deleted file mode 100644 index 7e0084a..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Link.php +++ /dev/null @@ -1,31 +0,0 @@ -source = $source; - $this->target = $target; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Reference.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Reference.php deleted file mode 100644 index 3c9017d..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Reference.php +++ /dev/null @@ -1,64 +0,0 @@ -addReference($this); - $target->addReference($this); - - $this->source = $source; - $this->target = $target; - $this->description = $description; - $this->created = new \DateTime("now"); - } - - public function source() - { - return $this->source; - } - - public function target() - { - return $this->target; - } - - public function setDescription($desc) - { - $this->description = $desc; - } - - public function getDescription() - { - return $this->description; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Translation.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Translation.php deleted file mode 100644 index b0fb437..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Translation.php +++ /dev/null @@ -1,65 +0,0 @@ -article = $article; - $this->language = $language; - $this->title = $title; - $this->reviewedByEditors = new \Doctrine\Common\Collections\ArrayCollection(); - $this->lastTranslatedBy = new \Doctrine\Common\Collections\ArrayCollection(); - } - - public function getArticleId() - { - return $this->article->id(); - } - - public function getLanguage() - { - return $this->language; - } - - public function getLastTranslatedBy() - { - return $this->lastTranslatedBy; - } - - public function getReviewedByEditors() - { - return $this->reviewedByEditors; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC1476/DDC1476EntityWithDefaultFieldType.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC1476/DDC1476EntityWithDefaultFieldType.php deleted file mode 100644 index cc09c13..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC1476/DDC1476EntityWithDefaultFieldType.php +++ /dev/null @@ -1,76 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Models\DDC1476; - -/** - * @Entity() - */ -class DDC1476EntityWithDefaultFieldType -{ - - /** - * @Id - * @Column() - * @GeneratedValue("NONE") - */ - protected $id; - - /** @column() */ - protected $name; - - /** - * @return integer - */ - public function getId() - { - return $this->id; - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * @param string $name - */ - public function setName($name) - { - $this->name = $name; - } - - public static function loadMetadata(\Doctrine\ORM\Mapping\ClassMetadataInfo $metadata) - { - $metadata->mapField(array( - 'id' => true, - 'fieldName' => 'id', - )); - $metadata->mapField(array( - 'fieldName' => 'name', - )); - - $metadata->setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadataInfo::GENERATOR_TYPE_NONE); - } - -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753CustomRepository.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753CustomRepository.php deleted file mode 100644 index eaf9006..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753CustomRepository.php +++ /dev/null @@ -1,36 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Models\DDC753; - -use Doctrine\ORM\EntityRepository; - -class DDC753CustomRepository extends EntityRepository -{ - - /** - * @return bool - */ - public function isCustomRepository() - { - return true; - } - -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753DefaultRepository.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753DefaultRepository.php deleted file mode 100644 index 5be9aa5..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753DefaultRepository.php +++ /dev/null @@ -1,35 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Models\DDC753; - -use Doctrine\ORM\EntityRepository; - -class DDC753DefaultRepository extends EntityRepository -{ - /** - * @return bool - */ - public function isDefaultRepository() - { - return true; - } - -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithCustomRepository.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithCustomRepository.php deleted file mode 100644 index 7b92e66..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithCustomRepository.php +++ /dev/null @@ -1,39 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Models\DDC753; - -/** - * @Entity(repositoryClass = "Doctrine\Tests\Models\DDC753\DDC753CustomRepository") - */ -class DDC753EntityWithCustomRepository -{ - - /** - * @Id - * @Column(type="integer") - * @GeneratedValue - */ - protected $id; - - /** @column(type="string") */ - protected $name; - -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithDefaultCustomRepository.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithDefaultCustomRepository.php deleted file mode 100644 index 8ca2a2c..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithDefaultCustomRepository.php +++ /dev/null @@ -1,39 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Models\DDC753; - -/** - * @Entity() - */ -class DDC753EntityWithDefaultCustomRepository -{ - - /** - * @Id - * @Column(type="integer") - * @GeneratedValue - */ - protected $id; - - /** @column(type="string") */ - protected $name; - -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithInvalidRepository.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithInvalidRepository.php deleted file mode 100644 index d12660c..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithInvalidRepository.php +++ /dev/null @@ -1,39 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Models\DDC753; - -/** - * @Entity(repositoryClass = "\stdClass") - */ -class DDC753EntityWithInvalidRepository -{ - - /** - * @Id - * @Column(type="integer") - * @GeneratedValue - */ - protected $id; - - /** @column(type="string") */ - protected $name; - -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753InvalidRepository.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753InvalidRepository.php deleted file mode 100644 index 9f0937a..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753InvalidRepository.php +++ /dev/null @@ -1,28 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Models\DDC753; - -use Doctrine\ORM\EntityRepository; - -class DDC753InvalidRepository -{ - -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869ChequePayment.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869ChequePayment.php deleted file mode 100644 index 594f79f..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869ChequePayment.php +++ /dev/null @@ -1,40 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Models\DDC869; - -/** - * @Entity - */ -class DDC869ChequePayment extends DDC869Payment -{ - - /** @column(type="string") */ - protected $serialNumber; - - public static function loadMetadata(\Doctrine\ORM\Mapping\ClassMetadataInfo $metadata) - { - $metadata->mapField(array( - 'fieldName' => 'serialNumber', - 'type' => 'string', - )); - } - -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869CreditCardPayment.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869CreditCardPayment.php deleted file mode 100644 index 9e978d4..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869CreditCardPayment.php +++ /dev/null @@ -1,40 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Models\DDC869; - -/** - * @Entity - */ -class DDC869CreditCardPayment extends DDC869Payment -{ - - /** @column(type="string") */ - protected $creditCardNumber; - - public static function loadMetadata(\Doctrine\ORM\Mapping\ClassMetadataInfo $metadata) - { - $metadata->mapField(array( - 'fieldName' => 'creditCardNumber', - 'type' => 'string', - )); - } - -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869Payment.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869Payment.php deleted file mode 100644 index b9b8feb..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869Payment.php +++ /dev/null @@ -1,57 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Models\DDC869; - -/** - * @MappedSuperclass(repositoryClass = "Doctrine\Tests\Models\DDC869\DDC869PaymentRepository") - */ -class DDC869Payment -{ - - /** - * @Id - * @Column(type="integer") - * @GeneratedValue - */ - protected $id; - - /** @column(type="float") */ - protected $value; - - - public static function loadMetadata(\Doctrine\ORM\Mapping\ClassMetadataInfo $metadata) - { - $metadata->mapField(array( - 'id' => true, - 'fieldName' => 'id', - 'type' => 'integer', - 'columnName' => 'id', - )); - $metadata->mapField(array( - 'fieldName' => 'value', - 'type' => 'float', - )); - $metadata->isMappedSuperclass = true; - $metadata->setCustomRepositoryClass("Doctrine\Tests\Models\DDC869\DDC869PaymentRepository"); - $metadata->setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadataInfo::GENERATOR_TYPE_AUTO); - } - -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869PaymentRepository.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869PaymentRepository.php deleted file mode 100644 index f950df0..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869PaymentRepository.php +++ /dev/null @@ -1,37 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Models\DDC869; - -use Doctrine\ORM\EntityRepository; - -class DDC869PaymentRepository extends EntityRepository -{ - - /** - * Very complex method - * - * @return bool - */ - public function isTrue() - { - return true; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/AbstractContentItem.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/AbstractContentItem.php deleted file mode 100644 index 12b27ee..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/AbstractContentItem.php +++ /dev/null @@ -1,64 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Models\DirectoryTree; - -/** - * @MappedSuperclass - */ -abstract class AbstractContentItem -{ - /** - * @Id @Column(type="integer") @GeneratedValue - */ - private $id; - - /** - * @ManyToOne(targetEntity="Directory") - */ - protected $parentDirectory; - - /** @column(type="string") */ - protected $name; - - public function __construct(Directory $parentDir = null) - { - $this->parentDirectory = $parentDir; - } - - public function getId() - { - return $this->id; - } - - public function setName($name) - { - $this->name = $name; - } - - public function getName() - { - return $this->name; - } - - public function getParent() - { - return $this->parentDirectory; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/Directory.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/Directory.php deleted file mode 100644 index f0db778..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/Directory.php +++ /dev/null @@ -1,41 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Models\DirectoryTree; - -/** - * @Entity - */ -class Directory extends AbstractContentItem -{ - /** - * @Column(type="string") - */ - protected $path; - - public function setPath($path) - { - $this->path = $path; - } - - public function getPath() - { - return $this->path; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/File.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/File.php deleted file mode 100644 index 3513268..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/File.php +++ /dev/null @@ -1,46 +0,0 @@ -. - */ - - -namespace Doctrine\Tests\Models\DirectoryTree; - -/** - * @Entity - * @Table(name="`file`") - */ -class File extends AbstractContentItem -{ - /** @Column(type="string") */ - protected $extension = "html"; - - public function __construct(Directory $parent = null) - { - parent::__construct($parent); - } - - public function getExtension() - { - return $this->extension; - } - - public function setExtension($ext) - { - $this->extension = $ext; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCart.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCart.php deleted file mode 100644 index 3d9f679..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCart.php +++ /dev/null @@ -1,91 +0,0 @@ -products = new ArrayCollection; - } - - public function getId() { - return $this->id; - } - - public function getPayment() { - return $this->payment; - } - - public function setPayment($payment) { - $this->payment = $payment; - } - - public function setCustomer(ECommerceCustomer $customer) { - if ($this->customer !== $customer) { - $this->customer = $customer; - $customer->setCart($this); - } - } - - public function removeCustomer() { - if ($this->customer !== null) { - $customer = $this->customer; - $this->customer = null; - $customer->removeCart(); - } - } - - public function getCustomer() { - return $this->customer; - } - - public function getProducts() - { - return $this->products; - } - - public function addProduct(ECommerceProduct $product) { - $this->products[] = $product; - } - - public function removeProduct(ECommerceProduct $product) { - return $this->products->removeElement($product); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCategory.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCategory.php deleted file mode 100644 index a8d8dc6..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCategory.php +++ /dev/null @@ -1,126 +0,0 @@ -products = new ArrayCollection(); - $this->children = new ArrayCollection(); - } - - public function getId() - { - return $this->id; - } - - public function getName() - { - return $this->name; - } - - public function setName($name) - { - $this->name = $name; - } - - public function addProduct(ECommerceProduct $product) - { - if (!$this->products->contains($product)) { - $this->products[] = $product; - $product->addCategory($this); - } - } - - public function removeProduct(ECommerceProduct $product) - { - $removed = $this->products->removeElement($product); - if ($removed) { - $product->removeCategory($this); - } - } - - public function getProducts() - { - return $this->products; - } - - private function setParent(ECommerceCategory $parent) - { - $this->parent = $parent; - } - - public function getChildren() - { - return $this->children; - } - - public function getParent() - { - return $this->parent; - } - - public function addChild(ECommerceCategory $child) - { - $this->children[] = $child; - $child->setParent($this); - } - - /** does not set the owning side. */ - public function brokenAddChild(ECommerceCategory $child) - { - $this->children[] = $child; - } - - - public function removeChild(ECommerceCategory $child) - { - $removed = $this->children->removeElement($child); - if ($removed) { - $child->removeParent(); - } - } - - private function removeParent() - { - $this->parent = null; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCustomer.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCustomer.php deleted file mode 100644 index a5de9e1..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCustomer.php +++ /dev/null @@ -1,94 +0,0 @@ -id; - } - - public function getName() { - return $this->name; - } - - public function setName($name) { - $this->name = $name; - } - - public function setCart(ECommerceCart $cart) - { - if ($this->cart !== $cart) { - $this->cart = $cart; - $cart->setCustomer($this); - } - } - - /* Does not properly maintain the bidirectional association! */ - public function brokenSetCart(ECommerceCart $cart) { - $this->cart = $cart; - } - - public function getCart() { - return $this->cart; - } - - public function removeCart() - { - if ($this->cart !== null) { - $cart = $this->cart; - $this->cart = null; - $cart->removeCustomer(); - } - } - - public function setMentor(ECommerceCustomer $mentor) - { - $this->mentor = $mentor; - } - - public function removeMentor() - { - $this->mentor = null; - } - - public function getMentor() - { - return $this->mentor; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceFeature.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceFeature.php deleted file mode 100644 index 04fc2be..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceFeature.php +++ /dev/null @@ -1,59 +0,0 @@ -id; - } - - public function getDescription() { - return $this->description; - } - - public function setDescription($description) { - $this->description = $description; - } - - public function setProduct(ECommerceProduct $product) { - $this->product = $product; - } - - public function removeProduct() { - if ($this->product !== null) { - $product = $this->product; - $this->product = null; - $product->removeFeature($this); - } - } - - public function getProduct() { - return $this->product; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php deleted file mode 100644 index f053fd2..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php +++ /dev/null @@ -1,178 +0,0 @@ -features = new ArrayCollection; - $this->categories = new ArrayCollection; - $this->related = new ArrayCollection; - } - - public function getId() - { - return $this->id; - } - - public function getName() - { - return $this->name; - } - - public function setName($name) - { - $this->name = $name; - } - - public function getShipping() - { - return $this->shipping; - } - - public function setShipping(ECommerceShipping $shipping) - { - $this->shipping = $shipping; - } - - public function removeShipping() - { - $this->shipping = null; - } - - public function getFeatures() - { - return $this->features; - } - - public function addFeature(ECommerceFeature $feature) - { - $this->features[] = $feature; - $feature->setProduct($this); - } - - /** does not set the owning side */ - public function brokenAddFeature(ECommerceFeature $feature) - { - $this->features[] = $feature; - } - - public function removeFeature(ECommerceFeature $feature) - { - $removed = $this->features->removeElement($feature); - if ($removed) { - $feature->removeProduct(); - } - return $removed; - } - - public function addCategory(ECommerceCategory $category) - { - if (!$this->categories->contains($category)) { - $this->categories[] = $category; - $category->addProduct($this); - } - } - - public function removeCategory(ECommerceCategory $category) - { - $removed = $this->categories->removeElement($category); - if ($removed) { - $category->removeProduct($this); - } - } - - public function getCategories() - { - return $this->categories; - } - - public function getRelated() - { - return $this->related; - } - - public function addRelated(ECommerceProduct $related) - { - if (!$this->related->contains($related)) { - $this->related[] = $related; - $related->addRelated($this); - } - } - - public function removeRelated(ECommerceProduct $related) - { - $removed = $this->related->removeElement($related); - if ($removed) { - $related->removeRelated($this); - } - } - - public function __clone() - { - $this->isCloned = true; - } - - /** - * Testing docblock contents here - */ - public function __wakeup() - { - $this->wakeUp = true; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceShipping.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceShipping.php deleted file mode 100644 index a0f302c..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceShipping.php +++ /dev/null @@ -1,40 +0,0 @@ -id; - } - - public function getDays() - { - return $this->days; - } - - public function setDays($days) - { - $this->days = $days; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumAdministrator.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumAdministrator.php deleted file mode 100644 index 13d78ab..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumAdministrator.php +++ /dev/null @@ -1,14 +0,0 @@ -id; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumEntry.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumEntry.php deleted file mode 100644 index efa359b..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumEntry.php +++ /dev/null @@ -1,26 +0,0 @@ -topic; - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumUser.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumUser.php deleted file mode 100644 index 3f3b5d9..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumUser.php +++ /dev/null @@ -1,41 +0,0 @@ -id; - } - - public function getUsername() { - return $this->username; - } - - public function getAvatar() { - return $this->avatar; - } - - public function setAvatar(ForumAvatar $avatar) { - $this->avatar = $avatar; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/BooleanModel.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/BooleanModel.php deleted file mode 100644 index 2c93156..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/BooleanModel.php +++ /dev/null @@ -1,20 +0,0 @@ -_user = $author; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyCar.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyCar.php deleted file mode 100644 index ac38341..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyCar.php +++ /dev/null @@ -1,41 +0,0 @@ -_description; - } - - public function addUser(LegacyUser $user) { - $this->_users[] = $user; - } - - public function getUsers() { - return $this->_users; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyUser.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyUser.php deleted file mode 100644 index 3e3deed..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyUser.php +++ /dev/null @@ -1,80 +0,0 @@ -_articles = new ArrayCollection; - $this->_references = new ArrayCollection; - $this->_cars = new ArrayCollection; - } - - public function getId() { - return $this->_id; - } - - public function getUsername() { - return $this->_username; - } - - public function addArticle(LegacyArticle $article) { - $this->_articles[] = $article; - $article->setAuthor($this); - } - - public function addReference($reference) - { - $this->_references[] = $reference; - } - - public function references() - { - return $this->_references; - } - - public function addCar(LegacyCar $car) { - $this->_cars[] = $car; - $car->addUser($this); - } - - public function getCars() { - return $this->_cars; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyUserReference.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyUserReference.php deleted file mode 100644 index 8dc20db..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyUserReference.php +++ /dev/null @@ -1,65 +0,0 @@ -addReference($this); - $target->addReference($this); - - $this->_source = $source; - $this->_target = $target; - $this->_description = $description; - $this->_created = new \DateTime("now"); - } - - public function source() - { - return $this->_source; - } - - public function target() - { - return $this->_target; - } - - public function setDescription($desc) - { - $this->_description = $desc; - } - - public function getDescription() - { - return $this->_description; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavCountry.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavCountry.php deleted file mode 100644 index fd37552..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavCountry.php +++ /dev/null @@ -1,39 +0,0 @@ -name = $name; - } - - public function getId() { - return $this->id; - } - - public function getName() { - return $this->name; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavPhotos.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavPhotos.php deleted file mode 100644 index 25858d0..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavPhotos.php +++ /dev/null @@ -1,48 +0,0 @@ -poi = $poi; - $this->file = $file; - } - - public function getId() { - return $this->id; - } - - public function getPointOfInterest() { - return $this->poi; - } - - public function getFile() { - return $this->file; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavPointOfInterest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavPointOfInterest.php deleted file mode 100644 index 33d0f70..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavPointOfInterest.php +++ /dev/null @@ -1,79 +0,0 @@ -lat = $lat; - $this->long = $long; - $this->name = $name; - $this->country = $country; - $this->visitors = new \Doctrine\Common\Collections\ArrayCollection; - } - - public function getLong() { - return $this->long; - } - - public function getLat() { - return $this->lat; - } - - public function getName() { - return $this->name; - } - - public function getCountry() { - return $this->country; - } - - public function addVisitor(NavUser $user) - { - $this->visitors[] = $user; - } - - public function getVisitors() - { - return $this->visitors; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavTour.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavTour.php deleted file mode 100644 index 5a58017..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavTour.php +++ /dev/null @@ -1,61 +0,0 @@ -name = $name; - $this->pois = new \Doctrine\Common\Collections\ArrayCollection; - } - - public function addPointOfInterest(NavPointOfInterest $poi) - { - $this->pois[] = $poi; - } - - public function getPointOfInterests() - { - return $this->pois; - } - - public function getName() - { - return $this->name; - } - - public function getId() - { - return $this->id; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavUser.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavUser.php deleted file mode 100644 index 42117e4..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavUser.php +++ /dev/null @@ -1,28 +0,0 @@ -name = $name; - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingLeg.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingLeg.php deleted file mode 100644 index a130e7b..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingLeg.php +++ /dev/null @@ -1,37 +0,0 @@ -name; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingRoute.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingRoute.php deleted file mode 100644 index 9e5d5d0..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingRoute.php +++ /dev/null @@ -1,39 +0,0 @@ -legs = new ArrayCollection(); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingRouteBooking.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingRouteBooking.php deleted file mode 100644 index 9b862fc..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingRouteBooking.php +++ /dev/null @@ -1,32 +0,0 @@ -passengerName; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/StockExchange/Bond.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/StockExchange/Bond.php deleted file mode 100644 index c8d6617..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/StockExchange/Bond.php +++ /dev/null @@ -1,48 +0,0 @@ -name = $name; - } - - public function getId() - { - return $this->id; - } - - public function addStock(Stock $stock) - { - $this->stocks[$stock->getSymbol()] = $stock; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/StockExchange/Market.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/StockExchange/Market.php deleted file mode 100644 index 87e12ca..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/StockExchange/Market.php +++ /dev/null @@ -1,56 +0,0 @@ -name = $name; - $this->stocks = new ArrayCollection(); - } - - public function getId() - { - return $this->id; - } - - public function getName() - { - return $this->name; - } - - public function addStock(Stock $stock) - { - $this->stocks[$stock->getSymbol()] = $stock; - } - - public function getStock($symbol) - { - return $this->stocks[$symbol]; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/StockExchange/Stock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/StockExchange/Stock.php deleted file mode 100644 index d65675b..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/StockExchange/Stock.php +++ /dev/null @@ -1,49 +0,0 @@ -symbol = $symbol; - $this->price = $initialOfferingPrice; - $this->market = $market; - $market->addStock($this); - } - - public function getSymbol() - { - return $this->symbol; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php deleted file mode 100644 index ff82059..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php +++ /dev/null @@ -1,56 +0,0 @@ -_calc = new \Doctrine\ORM\Internal\CommitOrderCalculator(); - } - - public function testCommitOrdering1() - { - $class1 = new ClassMetadata(__NAMESPACE__ . '\NodeClass1'); - $class2 = new ClassMetadata(__NAMESPACE__ . '\NodeClass2'); - $class3 = new ClassMetadata(__NAMESPACE__ . '\NodeClass3'); - $class4 = new ClassMetadata(__NAMESPACE__ . '\NodeClass4'); - $class5 = new ClassMetadata(__NAMESPACE__ . '\NodeClass5'); - - $this->_calc->addClass($class1); - $this->_calc->addClass($class2); - $this->_calc->addClass($class3); - $this->_calc->addClass($class4); - $this->_calc->addClass($class5); - - $this->_calc->addDependency($class1, $class2); - $this->_calc->addDependency($class2, $class3); - $this->_calc->addDependency($class3, $class4); - $this->_calc->addDependency($class5, $class1); - - $sorted = $this->_calc->getCommitOrder(); - - // There is only 1 valid ordering for this constellation - $correctOrder = array($class5, $class1, $class2, $class3, $class4); - $this->assertSame($correctOrder, $sorted); - } -} - -class NodeClass1 {} -class NodeClass2 {} -class NodeClass3 {} -class NodeClass4 {} -class NodeClass5 {} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Criteria/DqlGenerationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Criteria/DqlGenerationTest.php deleted file mode 100644 index b3aa607..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Criteria/DqlGenerationTest.php +++ /dev/null @@ -1,252 +0,0 @@ -. - */ - -namespace Doctrine\Tests\ORM\Query; - -require_once __DIR__ . '/../../TestInit.php'; - -/** - * Test case for testing the saving and referencing of query identifiers. - * - * @author Guilherme Blanco - * @author Janne Vanhala - * @author Konsta Vesterinen - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link http://www.doctrine-project.org - * @since 2.0 - * @version $Revision$ - */ -class DqlGenerationTest extends \Doctrine\Tests\OrmTestCase -{ - protected function setUp() { - $this->markTestSkipped('Not yet implemented.'); - } - - protected function createQuery() - { - return $this->_em->createQuery(); - } - - public function testSelect() - { - $query = $this->createQuery(); - - // select and from - $query->setDql('FROM User u'); - $this->assertEquals('FROM User u', $query->getDql()); // Internally we use SELECT * FROM User u to process the DQL - $query->free(); - - $query->select()->from('User u'); - $this->assertEquals('SELECT * FROM User u', $query->getDql()); - $query->free(); - - $query->select('u.*')->from('User u'); - $this->assertEquals('SELECT u.* FROM User u', $query->getDql()); - $query->free(); - - $query->select('u.id')->from('User u'); - $this->assertEquals('SELECT u.id FROM User u', $query->getDql()); - $query->free(); - - $query->select('u.id, u.name')->from('User u'); - $this->assertEquals('SELECT u.id, u.name FROM User u', $query->getDql()); - $query->free(); - - $query->select('u.name AS myCustomName')->from('User u'); - $this->assertEquals('SELECT u.name AS myCustomName FROM User u', $query->getDql()); - $query->free(); - - $query->select('u.id')->select('u.name')->from('User u'); - $this->assertEquals('SELECT u.id, u.name FROM User u', $query->getDql()); - $query->free(); - } - - - public function testSelectDistinct() - { - $query = $this->createQuery(); - - $query->select()->distinct()->from('User u'); - $this->assertEquals('SELECT DISTINCT * FROM User u', $query->getDql()); - $query->free(); - - $query->select('u.name')->distinct(false)->from('User u'); - $this->assertEquals('SELECT u.name FROM User u', $query->getDql()); - $query->free(); - - $query->select()->distinct(false)->from('User u'); - $this->assertEquals('SELECT * FROM User u', $query->getDql()); - $query->free(); - - $query->select('u.name')->distinct()->from('User u'); - $this->assertEquals('SELECT DISTINCT u.name FROM User u', $query->getDql()); - $query->free(); - - $query->select('u.name, u.email')->distinct()->from('User u'); - $this->assertEquals('SELECT DISTINCT u.name, u.email FROM User u', $query->getDql()); - $query->free(); - - $query->select('u.name')->select('u.email')->distinct()->from('User u'); - $this->assertEquals('SELECT DISTINCT u.name, u.email FROM User u', $query->getDql()); - $query->free(); - - $query->select('DISTINCT u.name')->from('User u'); - $this->assertEquals('SELECT DISTINCT u.name FROM User u', $query->getDql()); - $query->free(); - - $query->select('DISTINCT u.name, u.email')->from('User u'); - $this->assertEquals('SELECT DISTINCT u.name, u.email FROM User u', $query->getDql()); - $query->free(); - - $query->select('DISTINCT u.name')->select('u.email')->from('User u'); - $this->assertEquals('SELECT DISTINCT u.name, u.email FROM User u', $query->getDql()); - $query->free(); - } - - - public function testSelectJoin() - { - $query = $this->createQuery(); - - $query->select('u.*')->from('User u')->join('u.Group g')->where('g.id = ?', 1); - $this->assertEquals('SELECT u.* FROM User u INNER JOIN u.Group g WHERE g.id = ?', $query->getDql()); - $this->assertEquals(array(1), $query->getParams()); - $query->free(); - - $query->select('u.*')->from('User u')->innerJoin('u.Group g')->where('g.id = ?', 1); - $this->assertEquals('SELECT u.* FROM User u INNER JOIN u.Group g WHERE g.id = ?', $query->getDql()); - $this->assertEquals(array(1), $query->getParams()); - $query->free(); - - $query->select('u.*')->from('User u')->leftJoin('u.Group g')->where('g.id IS NULL'); - $this->assertEquals('SELECT u.* FROM User u LEFT JOIN u.Group g WHERE g.id IS NULL', $query->getDql()); - $query->free(); - - $query->select('u.*')->from('User u')->leftJoin('u.UserGroup ug')->leftJoin('ug.Group g')->where('g.name = ?', 'admin'); - $this->assertEquals('SELECT u.* FROM User u LEFT JOIN u.UserGroup ug LEFT JOIN ug.Group g WHERE g.name = ?', $query->getDql()); - $query->free(); - } - - - public function testSelectWhere() - { - $query = $this->createQuery(); - - $query->select('u.name')->from('User u')->where('u.id = ?', 1); - $this->assertEquals('SELECT u.name FROM User u WHERE u.id = ?', $query->getDql()); - $this->assertEquals(array(1), $query->getParams()); - $query->free(); - - $query->select('u.name')->from('User u')->where('u.id = ? AND u.type != ?', array(1, 'admin')); - $this->assertEquals('SELECT u.name FROM User u WHERE u.id = ? AND u.type != ?', $query->getDql()); - $this->assertEquals(array(1, 'admin'), $query->getParams()); - $query->free(); - - $query->select('u.name')->from('User u')->where('u.id = ?', 1)->andWhere('u.type != ?', 'admin'); - $this->assertEquals('SELECT u.name FROM User u WHERE u.id = ? AND u.type != ?', $query->getDql()); - $this->assertEquals(array(1, 'admin'), $query->getParams()); - $query->free(); - - $query->select('u.name')->from('User u')->where('( u.id = ?', 1)->andWhere('u.type != ? )', 'admin'); - $this->assertEquals('SELECT u.name FROM User u WHERE ( u.id = ? AND u.type != ? )', $query->getDql()); - $this->assertEquals(array(1, 'admin'), $query->getParams()); - $query->free(); - - $query->select('u.name')->from('User u')->where('u.id = ? OR u.type != ?', array(1, 'admin')); - $this->assertEquals('SELECT u.name FROM User u WHERE u.id = ? OR u.type != ?', $query->getDql()); - $this->assertEquals(array(1, 'admin'), $query->getParams()); - $query->free(); - - $query->select('u.name')->from('User u')->where('u.id = ?', 1)->orWhere('u.type != ?', 'admin'); - $this->assertEquals('SELECT u.name FROM User u WHERE u.id = ? OR u.type != ?', $query->getDql()); - $this->assertEquals(array(1, 'admin'), $query->getParams()); - $query->free(); - - $query->select('u.name')->from('User u')->andwhere('u.id = ?', 1)->andWhere('u.type != ?', 'admin')->orWhere('u.email = ?', 'admin@localhost'); - $this->assertEquals('SELECT u.name FROM User u WHERE u.id = ? AND u.type != ? OR u.email = ?', $query->getDql()); - $this->assertEquals(array(1, 'admin', 'admin@localhost'), $query->getParams()); - $query->free(); - } - - - public function testSelectWhereIn() - { - $query = $this->createQuery(); - - $query->select('u.name')->from('User u')->whereIn('u.id', array(1, 2, 3, 4, 5)); - $this->assertEquals('SELECT u.name FROM User u WHERE u.id IN (?, ?, ?, ?, ?)', $query->getDql()); - $this->assertEquals(array(1, 2, 3, 4, 5), $query->getParams()); - $query->free(); - - $query->select('u.name')->from('User u')->whereNotIn('u.id', array(1, 2, 3)); - $this->assertEquals('SELECT u.name FROM User u WHERE u.id NOT IN (?, ?, ?)', $query->getDql()); - $this->assertEquals(array(1, 2, 3), $query->getParams()); - $query->free(); - - $query->select('u.name')->from('User u')->where('u.type = ?', 'admin')->andWhereIn('u.id', array(1, 2)); - $this->assertEquals('SELECT u.name FROM User u WHERE u.type = ? AND u.id IN (?, ?)', $query->getDql()); - $this->assertEquals(array('admin', 1, 2), $query->getParams()); - $query->free(); - - $query->select('u.name')->from('User u')->where('u.type = ?', 'admin')->andWhereNotIn('u.id', array(1, 2)); - $this->assertEquals('SELECT u.name FROM User u WHERE u.type = ? AND u.id NOT IN (?, ?)', $query->getDql()); - $this->assertEquals(array('admin', 1, 2), $query->getParams()); - $query->free(); - - $query->select('u.name')->from('User u')->whereIn('u.type', array('admin', 'moderator'))->andWhereNotIn('u.id', array(1, 2, 3, 4)); - $this->assertEquals('SELECT u.name FROM User u WHERE u.type IN (?, ?) AND u.id NOT IN (?, ?, ?, ?)', $query->getDql()); - $this->assertEquals(array('admin', 'moderator', 1, 2, 3, 4), $query->getParams()); - $query->free(); - - $query->select('u.name')->from('User u')->whereIn('u.type', array('admin', 'moderator'))->orWhereIn('u.id', array(1, 2, 3, 4)); - $this->assertEquals('SELECT u.name FROM User u WHERE u.type IN (?, ?) OR u.id IN (?, ?, ?, ?)', $query->getDql()); - $this->assertEquals(array('admin', 'moderator', 1, 2, 3, 4), $query->getParams()); - $query->free(); - - $query->select('u.name')->from('User u')->whereIn('u.type', array('admin', 'moderator'))->andWhereNotIn('u.id', array(1, 2))->orWhereNotIn('u.type', array('admin', 'moderator'))->andWhereNotIn('u.email', array('user@localhost', 'guest@localhost')); - $this->assertEquals('SELECT u.name FROM User u WHERE u.type IN (?, ?) AND u.id NOT IN (?, ?) OR u.type NOT IN (?, ?) AND u.email NOT IN (?, ?)', $query->getDql()); - $this->assertEquals(array('admin', 'moderator', 1, 2, 'admin', 'moderator', 'user@localhost', 'guest@localhost'), $query->getParams()); - $query->free(); - } - - - public function testDelete() - { - $query = $this->createQuery(); - - $query->setDql('DELETE CmsUser u'); - $this->assertEquals('DELETE CmsUser u', $query->getDql()); - $query->free(); - - $query->delete()->from('CmsUser u'); - $this->assertEquals('DELETE FROM CmsUser u', $query->getDql()); - $query->free(); - - $query->delete()->from('CmsUser u')->where('u.id = ?', 1); - $this->assertEquals('DELETE FROM CmsUser u WHERE u.id = ?', $query->getDql()); - $query->free(); - - $query->delete()->from('CmsUser u')->where('u.username = ?', 'gblanco')->orWhere('u.name = ?', 'Guilherme'); - $this->assertEquals('DELETE FROM CmsUser u WHERE u.username = ? OR u.name = ?', $query->getDql()); - $query->free(); - } - -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Entity/ConstructorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Entity/ConstructorTest.php deleted file mode 100644 index 014a7b4..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Entity/ConstructorTest.php +++ /dev/null @@ -1,28 +0,0 @@ -assertEquals("romanb", $entity->username); - } -} - -class ConstructorTestEntity1 -{ - private $id; - public $username; - - public function __construct($username = null) - { - if ($username !== null) { - $this->username = $username; - } - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/EntityManagerTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/EntityManagerTest.php deleted file mode 100644 index 5f15781..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/EntityManagerTest.php +++ /dev/null @@ -1,158 +0,0 @@ -_em = $this->_getTestEntityManager(); - } - - /** - * @group DDC-899 - */ - public function testIsOpen() - { - $this->assertTrue($this->_em->isOpen()); - $this->_em->close(); - $this->assertFalse($this->_em->isOpen()); - } - - public function testGetConnection() - { - $this->assertInstanceOf('Doctrine\DBAL\Connection', $this->_em->getConnection()); - } - - public function testGetMetadataFactory() - { - $this->assertInstanceOf('Doctrine\ORM\Mapping\ClassMetadataFactory', $this->_em->getMetadataFactory()); - } - - public function testGetConfiguration() - { - $this->assertInstanceOf('Doctrine\ORM\Configuration', $this->_em->getConfiguration()); - } - - public function testGetUnitOfWork() - { - $this->assertInstanceOf('Doctrine\ORM\UnitOfWork', $this->_em->getUnitOfWork()); - } - - public function testGetProxyFactory() - { - $this->assertInstanceOf('Doctrine\ORM\Proxy\ProxyFactory', $this->_em->getProxyFactory()); - } - - public function testGetEventManager() - { - $this->assertInstanceOf('Doctrine\Common\EventManager', $this->_em->getEventManager()); - } - - public function testCreateNativeQuery() - { - $rsm = new \Doctrine\ORM\Query\ResultSetMapping(); - $query = $this->_em->createNativeQuery('SELECT foo', $rsm); - - $this->assertSame('SELECT foo', $query->getSql()); - } - - public function testCreateQueryBuilder() - { - $this->assertInstanceOf('Doctrine\ORM\QueryBuilder', $this->_em->createQueryBuilder()); - } - - public function testCreateQueryBuilderAliasValid() - { - $q = $this->_em->createQueryBuilder() - ->select('u')->from('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $q2 = clone $q; - - $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u', $q->getQuery()->getDql()); - $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u', $q2->getQuery()->getDql()); - - $q3 = clone $q; - - $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u', $q3->getQuery()->getDql()); - } - - public function testCreateQuery_DqlIsOptional() - { - $this->assertInstanceOf('Doctrine\ORM\Query', $this->_em->createQuery()); - } - - public function testGetPartialReference() - { - $user = $this->_em->getPartialReference('Doctrine\Tests\Models\CMS\CmsUser', 42); - $this->assertTrue($this->_em->contains($user)); - $this->assertEquals(42, $user->id); - $this->assertNull($user->getName()); - } - - public function testCreateQuery() - { - $q = $this->_em->createQuery('SELECT 1'); - $this->assertInstanceOf('Doctrine\ORM\Query', $q); - $this->assertEquals('SELECT 1', $q->getDql()); - } - - static public function dataMethodsAffectedByNoObjectArguments() - { - return array( - array('persist'), - array('remove'), - array('merge'), - array('refresh'), - array('detach') - ); - } - - /** - * @dataProvider dataMethodsAffectedByNoObjectArguments - * @expectedException \InvalidArgumentException - * @param string $methodName - */ - public function testThrowsExceptionOnNonObjectValues($methodName) { - $this->_em->$methodName(null); - } - - static public function dataAffectedByErrorIfClosedException() - { - return array( - array('flush'), - array('persist'), - array('remove'), - array('merge'), - array('refresh'), - ); - } - - /** - * @dataProvider dataAffectedByErrorIfClosedException - * @param string $methodName - */ - public function testAffectedByErrorIfClosedException($methodName) - { - $this->setExpectedException('Doctrine\ORM\ORMException', 'closed'); - - $this->_em->close(); - $this->_em->$methodName(new \stdClass()); - } - - /** - * @group DDC-1125 - */ - public function testTransactionalAcceptsReturn() - { - $return = $this->_em->transactional(function ($em) { - return 'foo'; - }); - - $this->assertEquals('foo', $return); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/AbstractManyToManyAssociationTestCase.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/AbstractManyToManyAssociationTestCase.php deleted file mode 100644 index f11ad26..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/AbstractManyToManyAssociationTestCase.php +++ /dev/null @@ -1,42 +0,0 @@ -assertEquals(1, $this->_countForeignKeys($firstId, $secondId)); - } - - public function assertForeignKeysNotContain($firstId, $secondId) - { - $this->assertEquals(0, $this->_countForeignKeys($firstId, $secondId)); - } - - protected function _countForeignKeys($firstId, $secondId) - { - return count($this->_em->getConnection()->executeQuery(" - SELECT {$this->_firstField} - FROM {$this->_table} - WHERE {$this->_firstField} = ? - AND {$this->_secondField} = ? - ", array($firstId, $secondId))->fetchAll()); - } - - public function assertCollectionEquals(Collection $first, Collection $second) - { - return $first->forAll(function($k, $e) use($second) { return $second->contains($e); }); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php deleted file mode 100644 index f152796..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php +++ /dev/null @@ -1,598 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\Phrase'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\PhraseType'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\Definition'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\Lemma'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\Type') - )); - } catch (\Exception $e) { - // Swallow all exceptions. We do not test the schema tool here. - } - } - - public function testIssue() - { - //setup - $phrase = new Phrase; - $phrase->setPhrase('lalala'); - - $type = new PhraseType; - $type->setType('nonsense'); - $type->setAbbreviation('non'); - - $def1 = new Definition; - $def1->setDefinition('def1'); - $def2 = new Definition; - $def2->setDefinition('def2'); - - $phrase->setType($type); - $phrase->addDefinition($def1); - $phrase->addDefinition($def2); - - $this->_em->persist($phrase); - $this->_em->persist($type); - - $this->_em->flush(); - $this->_em->clear(); - //end setup - - // test1 - lazy-loading many-to-one after find() - $phrase2 = $this->_em->find('Doctrine\Tests\ORM\Functional\Phrase', $phrase->getId()); - $this->assertTrue(is_numeric($phrase2->getType()->getId())); - - $this->_em->clear(); - - // test2 - eager load in DQL query - $query = $this->_em->createQuery("SELECT p,t FROM Doctrine\Tests\ORM\Functional\Phrase p JOIN p.type t"); - $res = $query->getResult(); - $this->assertEquals(1, count($res)); - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\PhraseType', $res[0]->getType()); - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $res[0]->getType()->getPhrases()); - $this->assertFalse($res[0]->getType()->getPhrases()->isInitialized()); - - $this->_em->clear(); - - // test2 - eager load in DQL query with double-join back and forth - $query = $this->_em->createQuery("SELECT p,t,pp FROM Doctrine\Tests\ORM\Functional\Phrase p JOIN p.type t JOIN t.phrases pp"); - $res = $query->getResult(); - $this->assertEquals(1, count($res)); - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\PhraseType', $res[0]->getType()); - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $res[0]->getType()->getPhrases()); - $this->assertTrue($res[0]->getType()->getPhrases()->isInitialized()); - - $this->_em->clear(); - - // test3 - lazy-loading one-to-many after find() - $phrase3 = $this->_em->find('Doctrine\Tests\ORM\Functional\Phrase', $phrase->getId()); - $definitions = $phrase3->getDefinitions(); - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $definitions); - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Definition', $definitions[0]); - - $this->_em->clear(); - - // test4 - lazy-loading after DQL query - $query = $this->_em->createQuery("SELECT p FROM Doctrine\Tests\ORM\Functional\Phrase p"); - $res = $query->getResult(); - $definitions = $res[0]->getDefinitions(); - - $this->assertEquals(1, count($res)); - - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Definition', $definitions[0]); - $this->assertEquals(2, $definitions->count()); - } - - public function testManyToMany() - { - $lemma = new Lemma; - $lemma->setLemma('abu'); - - $type = new Type(); - $type->setType('nonsense'); - $type->setAbbreviation('non'); - - $lemma->addType($type); - - $this->_em->persist($lemma); - $this->_em->persist($type); - $this->_em->flush(); - - // test5 ManyToMany - $query = $this->_em->createQuery("SELECT l FROM Doctrine\Tests\ORM\Functional\Lemma l"); - $res = $query->getResult(); - $types = $res[0]->getTypes(); - - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Type', $types[0]); - } -} - -/** - * @Entity - * @Table(name="lemma") - */ -class Lemma { - - const CLASS_NAME = __CLASS__; - - /** - * @var int - * @Id - * @Column(type="integer", name="lemma_id") - * @GeneratedValue(strategy="AUTO") - */ - private $id; - - /** - * - * @var string - * @Column(type="string", name="lemma_name", unique=true, length=255) - */ - private $lemma; - - /** - * @var kateglo\application\utilities\collections\ArrayCollection - * @ManyToMany(targetEntity="Type", mappedBy="lemmas", cascade={"persist"}) - */ - private $types; - - public function __construct() { - $this->types = new \Doctrine\Common\Collections\ArrayCollection(); - } - - - /** - * - * @return int - */ - public function getId(){ - return $this->id; - } - - /** - * - * @param string $lemma - * @return void - */ - public function setLemma($lemma){ - $this->lemma = $lemma; - } - - /** - * - * @return string - */ - public function getLemma(){ - return $this->lemma; - } - - /** - * - * @param kateglo\application\models\Type $type - * @return void - */ - public function addType(Type $type){ - if (!$this->types->contains($type)) { - $this->types[] = $type; - $type->addLemma($this); - } - } - - /** - * - * @param kateglo\application\models\Type $type - * @return void - */ - public function removeType(Type $type) - { - $removed = $this->sources->removeElement($type); - if ($removed !== null) { - $removed->removeLemma($this); - } - } - - /** - * - * @return kateglo\application\helpers\collections\ArrayCollection - */ - public function getTypes() - { - return $this->types; - } -} - -/** - * @Entity - * @Table(name="type") - */ -class Type { - - const CLASS_NAME = __CLASS__; - - /** - * - * @var int - * @Id - * @Column(type="integer", name="type_id") - * @GeneratedValue(strategy="AUTO") - */ - private $id; - - /** - * - * @var string - * @Column(type="string", name="type_name", unique=true) - */ - private $type; - - /** - * - * @var string - * @Column(type="string", name="type_abbreviation", unique=true) - */ - private $abbreviation; - - /** - * @var kateglo\application\helpers\collections\ArrayCollection - * @ManyToMany(targetEntity="Lemma") - * @JoinTable(name="lemma_type", - * joinColumns={@JoinColumn(name="type_id", referencedColumnName="type_id")}, - * inverseJoinColumns={@JoinColumn(name="lemma_id", referencedColumnName="lemma_id")} - * ) - */ - private $lemmas; - - public function __construct(){ - $this->lemmas = new \Doctrine\Common\Collections\ArrayCollection(); - } - - /** - * - * @return int - */ - public function getId(){ - return $this->id; - } - - /** - * - * @param string $type - * @return void - */ - public function setType($type){ - $this->type = $type; - } - - /** - * - * @return string - */ - public function getType(){ - return $this->type; - } - - /** - * - * @param string $abbreviation - * @return void - */ - public function setAbbreviation($abbreviation){ - $this->abbreviation = $abbreviation; - } - - /** - * - * @return string - */ - public function getAbbreviation(){ - return $this->abbreviation; - } - - /** - * - * @param kateglo\application\models\Lemma $lemma - * @return void - */ - public function addLemma(Lemma $lemma) - { - if (!$this->lemmas->contains($lemma)) { - $this->lemmas[] = $lemma; - $lemma->addType($this); - } - } - - /** - * - * @param kateglo\application\models\Lemma $lemma - * @return void - */ - public function removeLEmma(Lemma $lemma) - { - $removed = $this->lemmas->removeElement($lemma); - if ($removed !== null) { - $removed->removeType($this); - } - } - - /** - * - * @return kateglo\application\helpers\collections\ArrayCollection - */ - public function getCategories() - { - return $this->categories; - } - -} - - -/** - * @Entity - * @Table(name="phrase") - */ -class Phrase { - - const CLASS_NAME = __CLASS__; - - /** - * @Id - * @Column(type="integer", name="phrase_id") - * @GeneratedValue(strategy="AUTO") - */ - private $id; - - /** - * @Column(type="string", name="phrase_name", unique=true, length=255) - */ - private $phrase; - - /** - * @ManyToOne(targetEntity="PhraseType") - * @JoinColumn(name="phrase_type_id", referencedColumnName="phrase_type_id") - */ - private $type; - - /** - * @OneToMany(targetEntity="Definition", mappedBy="phrase", cascade={"persist"}) - */ - private $definitions; - - public function __construct() { - $this->definitions = new \Doctrine\Common\Collections\ArrayCollection; - } - - /** - * - * @param Definition $definition - * @return void - */ - public function addDefinition(Definition $definition){ - $this->definitions[] = $definition; - $definition->setPhrase($this); - } - - /** - * @return int - */ - public function getId(){ - return $this->id; - } - - /** - * @param string $phrase - * @return void - */ - public function setPhrase($phrase){ - $this->phrase = $phrase; - } - - /** - * @return string - */ - public function getPhrase(){ - return $this->phrase; - } - - /** - * - * @param PhraseType $type - * @return void - */ - public function setType(PhraseType $type){ - $this->type = $type; - } - - /** - * - * @return PhraseType - */ - public function getType(){ - return $this->type; - } - - /** - * - * @return ArrayCollection - */ - public function getDefinitions(){ - return $this->definitions; - } -} - -/** - * @Entity - * @Table(name="phrase_type") - */ -class PhraseType { - - const CLASS_NAME = __CLASS__; - - /** - * @Id - * @Column(type="integer", name="phrase_type_id") - * @GeneratedValue(strategy="AUTO") - */ - private $id; - - /** - * @Column(type="string", name="phrase_type_name", unique=true) - */ - private $type; - - /** - * @Column(type="string", name="phrase_type_abbreviation", unique=true) - */ - private $abbreviation; - - /** - * @OneToMany(targetEntity="Phrase", mappedBy="type") - */ - private $phrases; - - public function __construct() { - $this->phrases = new \Doctrine\Common\Collections\ArrayCollection; - } - - /** - * @return int - */ - public function getId(){ - return $this->id; - } - - /** - * @param string $type - * @return void - */ - public function setType($type){ - $this->type = $type; - } - - /** - * @return string - */ - public function getType(){ - return $this->type; - } - - /** - * @param string $abbreviation - * @return void - */ - public function setAbbreviation($abbreviation){ - $this->abbreviation = $abbreviation; - } - - /** - * @return string - */ - public function getAbbreviation(){ - return $this->abbreviation; - } - - /** - * @param ArrayCollection $phrases - * @return void - */ - public function setPhrases($phrases){ - $this->phrases = $phrases; - } - - /** - * - * @return ArrayCollection - */ - public function getPhrases(){ - return $this->phrases; - } - -} - -/** - * @Entity - * @Table(name="definition") - */ -class Definition { - - const CLASS_NAME = __CLASS__; - - /** - * @Id - * @Column(type="integer", name="definition_id") - * @GeneratedValue(strategy="AUTO") - */ - private $id; - - /** - * @ManyToOne(targetEntity="Phrase") - * @JoinColumn(name="definition_phrase_id", referencedColumnName="phrase_id") - */ - private $phrase; - - /** - * @Column(type="text", name="definition_text") - */ - private $definition; - - /** - * @return int - */ - public function getId(){ - return $this->id; - } - - /** - * @param Phrase $phrase - * @return void - */ - public function setPhrase(Phrase $phrase){ - $this->phrase = $phrase; - } - - /** - * @return Phrase - */ - public function getPhrase(){ - return $this->phrase; - } - - public function removePhrase() { - if ($this->phrase !== null) { - /*@var $phrase kateglo\application\models\Phrase */ - $phrase = $this->phrase; - $this->phrase = null; - $phrase->removeDefinition($this); - } - } - - /** - * @param string $definition - * @return void - */ - public function setDefinition($definition){ - $this->definition = $definition; - } - - /** - * @return string - */ - public function getDefinition(){ - return $this->definition; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/AdvancedDqlQueryTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/AdvancedDqlQueryTest.php deleted file mode 100644 index e7bb831..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/AdvancedDqlQueryTest.php +++ /dev/null @@ -1,181 +0,0 @@ - - */ -class AdvancedDqlQueryTest extends \Doctrine\Tests\OrmFunctionalTestCase -{ - protected function setUp() - { - $this->useModelSet('company'); - parent::setUp(); - - $this->generateFixture(); - } - - public function testAggregateWithHavingClause() - { - $dql = 'SELECT p.department, AVG(p.salary) AS avgSalary '. - 'FROM Doctrine\Tests\Models\Company\CompanyEmployee p '. - 'GROUP BY p.department HAVING SUM(p.salary) > 200000 ORDER BY p.department'; - - $result = $this->_em->createQuery($dql)->getScalarResult(); - - $this->assertEquals(2, count($result)); - $this->assertEquals('IT', $result[0]['department']); - $this->assertEquals(150000, $result[0]['avgSalary']); - $this->assertEquals('IT2', $result[1]['department']); - $this->assertEquals(600000, $result[1]['avgSalary']); - } - - public function testUnnamedScalarResultsAreOneBased() - { - $dql = 'SELECT p.department, AVG(p.salary) '. - 'FROM Doctrine\Tests\Models\Company\CompanyEmployee p '. - 'GROUP BY p.department HAVING SUM(p.salary) > 200000 ORDER BY p.department'; - - $result = $this->_em->createQuery($dql)->getScalarResult(); - - $this->assertEquals(2, count($result)); - $this->assertEquals(150000, $result[0][1]); - $this->assertEquals(600000, $result[1][1]); - } - - public function testOrderByResultVariableCollectionSize() - { - $dql = 'SELECT p.name, size(p.friends) AS friends ' . - 'FROM Doctrine\Tests\Models\Company\CompanyPerson p ' . - 'WHERE p.friends IS NOT EMPTY ' . - 'ORDER BY friends DESC, p.name DESC'; - - $result = $this->_em->createQuery($dql)->getScalarResult(); - - $this->assertEquals(4, count($result)); - - $this->assertEquals("Jonathan W.", $result[0]['name']); - $this->assertEquals(3, $result[0]['friends']); - - $this->assertEquals('Guilherme B.', $result[1]['name']); - $this->assertEquals(2, $result[1]['friends']); - - $this->assertEquals('Benjamin E.', $result[2]['name']); - $this->assertEquals(2, $result[2]['friends']); - - $this->assertEquals('Roman B.', $result[3]['name']); - $this->assertEquals(1, $result[3]['friends']); - } - - public function testIsNullAssocation() - { - $dql = 'SELECT p FROM Doctrine\Tests\Models\Company\CompanyPerson p '. - 'WHERE p.spouse IS NULL'; - $result = $this->_em->createQuery($dql)->getResult(); - - $this->assertEquals(2, count($result)); - $this->assertTrue($result[0]->getId() > 0); - $this->assertNull($result[0]->getSpouse()); - - $this->assertTrue($result[1]->getId() > 0); - $this->assertNull($result[1]->getSpouse()); - } - - public function testSelectSubselect() - { - $dql = 'SELECT p, (SELECT c.brand FROM Doctrine\Tests\Models\Company\CompanyCar c WHERE p.car = c) brandName '. - 'FROM Doctrine\Tests\Models\Company\CompanyManager p'; - $result = $this->_em->createQuery($dql)->getArrayResult(); - - $this->assertEquals(1, count($result)); - $this->assertEquals("Caramba", $result[0]['brandName']); - } - - public function testInSubselect() - { - $dql = "SELECT p.name FROM Doctrine\Tests\Models\Company\CompanyPerson p ". - "WHERE p.name IN (SELECT n.name FROM Doctrine\Tests\Models\Company\CompanyPerson n WHERE n.name = 'Roman B.')"; - $result = $this->_em->createQuery($dql)->getScalarResult(); - - $this->assertEquals(1, count($result)); - $this->assertEquals('Roman B.', $result[0]['name']); - } - - public function testGroupByMultipleFields() - { - $dql = 'SELECT p.department, p.name, count(p.id) FROM Doctrine\Tests\Models\Company\CompanyEmployee p '. - 'GROUP BY p.department, p.name'; - $result = $this->_em->createQuery($dql)->getResult(); - - $this->assertEquals(4, count($result)); - } - - public function testUpdateAs() - { - $dql = 'UPDATE Doctrine\Tests\Models\Company\CompanyEmployee AS p SET p.salary = 1'; - $this->_em->createQuery($dql)->execute(); - - $this->assertTrue(count($this->_em->createQuery( - 'SELECT count(p.id) FROM Doctrine\Tests\Models\Company\CompanyEmployee p WHERE p.salary = 1')->getResult()) > 0); - } - - /*public function testDeleteAs() - { - $dql = 'DELETE Doctrine\Tests\Models\Company\CompanyEmployee AS p'; - $this->_em->createQuery($dql)->getResult(); - - $this->assertEquals(0, count($this->_em->createQuery( - 'SELECT count(p) FROM Doctrine\Tests\Models\Company\CompanyEmployee p')->getResult())); - }*/ - - public function generateFixture() - { - $car = new CompanyCar('Caramba'); - - $manager1 = new CompanyManager(); - $manager1->setName('Roman B.'); - $manager1->setTitle('Foo'); - $manager1->setDepartment('IT'); - $manager1->setSalary(100000); - $manager1->setCar($car); - - $person2 = new CompanyEmployee(); - $person2->setName('Benjamin E.'); - $person2->setDepartment('IT'); - $person2->setSalary(200000); - - $person3 = new CompanyEmployee(); - $person3->setName('Guilherme B.'); - $person3->setDepartment('IT2'); - $person3->setSalary(400000); - - $person4 = new CompanyEmployee(); - $person4->setName('Jonathan W.'); - $person4->setDepartment('IT2'); - $person4->setSalary(800000); - - $person2->setSpouse($person3); - - $manager1->addFriend($person4); - $person2->addFriend($person3); - $person2->addFriend($person4); - $person3->addFriend($person4); - - $this->_em->persist($car); - $this->_em->persist($manager1); - $this->_em->persist($person2); - $this->_em->persist($person3); - $this->_em->persist($person4); - $this->_em->flush(); - $this->_em->clear(); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php deleted file mode 100644 index 695e10c..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php +++ /dev/null @@ -1,1232 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - public function testBasicUnitsOfWorkWithOneToManyAssociation() - { - // Create - $user = new CmsUser; - $user->name = 'Roman'; - $user->username = 'romanb'; - $user->status = 'developer'; - $this->_em->persist($user); - - $this->_em->flush(); - - $this->assertTrue(is_numeric($user->id)); - $this->assertTrue($this->_em->contains($user)); - - // Read - $user2 = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $user->id); - $this->assertTrue($user === $user2); - - // Add a phonenumber - $ph = new CmsPhonenumber; - $ph->phonenumber = "12345"; - $user->addPhonenumber($ph); - $this->_em->flush(); - $this->assertTrue($this->_em->contains($ph)); - $this->assertTrue($this->_em->contains($user)); - //$this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $user->phonenumbers); - - // Update name - $user->name = 'guilherme'; - $this->_em->flush(); - $this->assertEquals('guilherme', $user->name); - - // Add another phonenumber - $ph2 = new CmsPhonenumber; - $ph2->phonenumber = "6789"; - $user->addPhonenumber($ph2); - $this->_em->flush(); - $this->assertTrue($this->_em->contains($ph2)); - - // Delete - $this->_em->remove($user); - $this->assertTrue($this->_em->getUnitOfWork()->isScheduledForDelete($user)); - $this->assertTrue($this->_em->getUnitOfWork()->isScheduledForDelete($ph)); - $this->assertTrue($this->_em->getUnitOfWork()->isScheduledForDelete($ph2)); - $this->_em->flush(); - $this->assertFalse($this->_em->getUnitOfWork()->isScheduledForDelete($user)); - $this->assertFalse($this->_em->getUnitOfWork()->isScheduledForDelete($ph)); - $this->assertFalse($this->_em->getUnitOfWork()->isScheduledForDelete($ph2)); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($user)); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($ph)); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($ph2)); - } - - public function testOneToManyAssociationModification() - { - $user = new CmsUser; - $user->name = 'Roman'; - $user->username = 'romanb'; - $user->status = 'developer'; - - $ph1 = new CmsPhonenumber; - $ph1->phonenumber = "0301234"; - $ph2 = new CmsPhonenumber; - $ph2->phonenumber = "987654321"; - - $user->addPhonenumber($ph1); - $user->addPhonenumber($ph2); - - $this->_em->persist($user); - $this->_em->flush(); - - //$this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $user->phonenumbers); - - // Remove the first element from the collection - unset($user->phonenumbers[0]); - $ph1->user = null; // owning side! - - $this->_em->flush(); - - $this->assertEquals(1, count($user->phonenumbers)); - $this->assertNull($ph1->user); - } - - public function testBasicOneToOne() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - $user = new CmsUser; - $user->name = 'Roman'; - $user->username = 'romanb'; - $user->status = 'developer'; - - $address = new CmsAddress; - $address->country = 'Germany'; - $address->city = 'Berlin'; - $address->zip = '12345'; - - $user->address = $address; // inverse side - $address->user = $user; // owning side! - - $this->_em->persist($user); - $this->_em->flush(); - - // Check that the foreign key has been set - $userId = $this->_em->getConnection()->executeQuery( - "SELECT user_id FROM cms_addresses WHERE id=?", array($address->id) - )->fetchColumn(); - $this->assertTrue(is_numeric($userId)); - - $this->_em->clear(); - - $user2 = $this->_em->createQuery('select u from \Doctrine\Tests\Models\CMS\CmsUser u where u.id=?1') - ->setParameter(1, $userId) - ->getSingleResult(); - - // Address has been eager-loaded because it cant be lazy - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsAddress', $user2->address); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $user2->address); - } - - /** - * @group DDC-1230 - */ - public function testRemove() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_NEW"); - - $this->_em->persist($user); - - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_MANAGED, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_MANAGED"); - - $this->_em->remove($user); - - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_NEW"); - - $this->_em->persist($user); - $this->_em->flush(); - $id = $user->getId(); - - $this->_em->remove($user); - - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_REMOVED, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_REMOVED"); - $this->_em->flush(); - - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_NEW"); - - $this->assertNull($this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $id)); - } - - public function testOneToManyOrphanRemoval() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - - for ($i=0; $i<3; ++$i) { - $phone = new CmsPhonenumber; - $phone->phonenumber = 100 + $i; - $user->addPhonenumber($phone); - } - - $this->_em->persist($user); - - $this->_em->flush(); - - $user->getPhonenumbers()->remove(0); - $this->assertEquals(2, count($user->getPhonenumbers())); - - $this->_em->flush(); - - // Check that there are just 2 phonenumbers left - $count = $this->_em->getConnection()->fetchColumn("SELECT COUNT(*) FROM cms_phonenumbers"); - $this->assertEquals(2, $count); // only 2 remaining - - // check that clear() removes the others via orphan removal - $user->getPhonenumbers()->clear(); - $this->_em->flush(); - $this->assertEquals(0, $this->_em->getConnection()->fetchColumn("select count(*) from cms_phonenumbers")); - } - - public function testBasicQuery() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - $this->_em->persist($user); - $this->_em->flush(); - - $query = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u"); - - $users = $query->getResult(); - - $this->assertEquals(1, count($users)); - $this->assertEquals('Guilherme', $users[0]->name); - $this->assertEquals('gblanco', $users[0]->username); - $this->assertEquals('developer', $users[0]->status); - //$this->assertNull($users[0]->phonenumbers); - //$this->assertNull($users[0]->articles); - - $usersArray = $query->getArrayResult(); - - $this->assertTrue(is_array($usersArray)); - $this->assertEquals(1, count($usersArray)); - $this->assertEquals('Guilherme', $usersArray[0]['name']); - $this->assertEquals('gblanco', $usersArray[0]['username']); - $this->assertEquals('developer', $usersArray[0]['status']); - - $usersScalar = $query->getScalarResult(); - - $this->assertTrue(is_array($usersScalar)); - $this->assertEquals(1, count($usersScalar)); - $this->assertEquals('Guilherme', $usersScalar[0]['u_name']); - $this->assertEquals('gblanco', $usersScalar[0]['u_username']); - $this->assertEquals('developer', $usersScalar[0]['u_status']); - } - - public function testBasicOneToManyInnerJoin() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - $this->_em->persist($user); - $this->_em->flush(); - - $query = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u join u.phonenumbers p"); - - $users = $query->getResult(); - - $this->assertEquals(0, count($users)); - } - - public function testBasicOneToManyLeftJoin() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - $this->_em->persist($user); - $this->_em->flush(); - - $query = $this->_em->createQuery("select u,p from Doctrine\Tests\Models\CMS\CmsUser u left join u.phonenumbers p"); - - $users = $query->getResult(); - - $this->assertEquals(1, count($users)); - $this->assertEquals('Guilherme', $users[0]->name); - $this->assertEquals('gblanco', $users[0]->username); - $this->assertEquals('developer', $users[0]->status); - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $users[0]->phonenumbers); - $this->assertTrue($users[0]->phonenumbers->isInitialized()); - $this->assertEquals(0, $users[0]->phonenumbers->count()); - //$this->assertNull($users[0]->articles); - } - - public function testBasicRefresh() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - - $this->_em->persist($user); - $this->_em->flush(); - - $user->status = 'mascot'; - - $this->assertEquals('mascot', $user->status); - $this->_em->refresh($user); - $this->assertEquals('developer', $user->status); - } - - /** - * @group DDC-833 - */ - public function testRefreshResetsCollection() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - - // Add a phonenumber - $ph1 = new CmsPhonenumber; - $ph1->phonenumber = "12345"; - $user->addPhonenumber($ph1); - - // Add a phonenumber - $ph2 = new CmsPhonenumber; - $ph2->phonenumber = "54321"; - - $this->_em->persist($user); - $this->_em->persist($ph1); - $this->_em->persist($ph2); - $this->_em->flush(); - - $user->addPhonenumber($ph2); - - $this->assertEquals(2, count($user->phonenumbers)); - $this->_em->refresh($user); - - $this->assertEquals(1, count($user->phonenumbers)); - } - - /** - * @group DDC-833 - */ - public function testDqlRefreshResetsCollection() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - - // Add a phonenumber - $ph1 = new CmsPhonenumber; - $ph1->phonenumber = "12345"; - $user->addPhonenumber($ph1); - - // Add a phonenumber - $ph2 = new CmsPhonenumber; - $ph2->phonenumber = "54321"; - - $this->_em->persist($user); - $this->_em->persist($ph1); - $this->_em->persist($ph2); - $this->_em->flush(); - - $user->addPhonenumber($ph2); - - $this->assertEquals(2, count($user->phonenumbers)); - $dql = "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = ?1"; - $user = $this->_em->createQuery($dql) - ->setParameter(1, $user->id) - ->setHint(Query::HINT_REFRESH, true) - ->getSingleResult(); - - $this->assertEquals(1, count($user->phonenumbers)); - } - - /** - * @group DDC-833 - */ - public function testCreateEntityOfProxy() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - - // Add a phonenumber - $ph1 = new CmsPhonenumber; - $ph1->phonenumber = "12345"; - $user->addPhonenumber($ph1); - - // Add a phonenumber - $ph2 = new CmsPhonenumber; - $ph2->phonenumber = "54321"; - - $this->_em->persist($user); - $this->_em->persist($ph1); - $this->_em->persist($ph2); - $this->_em->flush(); - $this->_em->clear(); - - $userId = $user->id; - $user = $this->_em->getReference('Doctrine\Tests\Models\CMS\CmsUser', $user->id); - - $dql = "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = ?1"; - $user = $this->_em->createQuery($dql) - ->setParameter(1, $userId) - ->getSingleResult(); - - $this->assertEquals(1, count($user->phonenumbers)); - } - - public function testAddToCollectionDoesNotInitialize() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - - for ($i=0; $i<3; ++$i) { - $phone = new CmsPhonenumber; - $phone->phonenumber = 100 + $i; - $user->addPhonenumber($phone); - } - - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - - $this->assertEquals(3, $user->getPhonenumbers()->count()); - - $query = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u where u.username='gblanco'"); - - $gblanco = $query->getSingleResult(); - - $this->assertFalse($gblanco->getPhonenumbers()->isInitialized()); - - $newPhone = new CmsPhonenumber; - $newPhone->phonenumber = 555; - $gblanco->addPhonenumber($newPhone); - - $this->assertFalse($gblanco->getPhonenumbers()->isInitialized()); - $this->_em->persist($gblanco); - - $this->_em->flush(); - $this->_em->clear(); - - $query = $this->_em->createQuery("select u, p from Doctrine\Tests\Models\CMS\CmsUser u join u.phonenumbers p where u.username='gblanco'"); - $gblanco2 = $query->getSingleResult(); - $this->assertEquals(4, $gblanco2->getPhonenumbers()->count()); - } - - public function testInitializeCollectionWithNewObjectsRetainsNewObjects() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - - for ($i=0; $i<3; ++$i) { - $phone = new CmsPhonenumber; - $phone->phonenumber = 100 + $i; - $user->addPhonenumber($phone); - } - - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - - $this->assertEquals(3, $user->getPhonenumbers()->count()); - - $query = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u where u.username='gblanco'"); - - $gblanco = $query->getSingleResult(); - - $this->assertFalse($gblanco->getPhonenumbers()->isInitialized()); - - $newPhone = new CmsPhonenumber; - $newPhone->phonenumber = 555; - $gblanco->addPhonenumber($newPhone); - - $this->assertFalse($gblanco->getPhonenumbers()->isInitialized()); - $this->assertEquals(4, $gblanco->getPhonenumbers()->count()); - $this->assertTrue($gblanco->getPhonenumbers()->isInitialized()); - - $this->_em->flush(); - $this->_em->clear(); - - $query = $this->_em->createQuery("select u, p from Doctrine\Tests\Models\CMS\CmsUser u join u.phonenumbers p where u.username='gblanco'"); - $gblanco2 = $query->getSingleResult(); - $this->assertEquals(4, $gblanco2->getPhonenumbers()->count()); - } - - public function testSetSetAssociationWithGetReference() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - $this->_em->persist($user); - - $address = new CmsAddress; - $address->country = 'Germany'; - $address->city = 'Berlin'; - $address->zip = '12345'; - $this->_em->persist($address); - - $this->_em->flush(); - $this->_em->detach($address); - - $this->assertFalse($this->_em->contains($address)); - $this->assertTrue($this->_em->contains($user)); - - // Assume we only got the identifier of the address and now want to attach - // that address to the user without actually loading it, using getReference(). - $addressRef = $this->_em->getReference('Doctrine\Tests\Models\CMS\CmsAddress', $address->getId()); - - //$addressRef->getId(); - //\Doctrine\Common\Util\Debug::dump($addressRef); - - $user->setAddress($addressRef); // Ugh! Initializes address 'cause of $address->setUser($user)! - - $this->_em->flush(); - $this->_em->clear(); - - // Check with a fresh load that the association is indeed there - $query = $this->_em->createQuery("select u, a from Doctrine\Tests\Models\CMS\CmsUser u join u.address a where u.username='gblanco'"); - $gblanco = $query->getSingleResult(); - - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $gblanco); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsAddress', $gblanco->getAddress()); - $this->assertEquals('Berlin', $gblanco->getAddress()->getCity()); - - } - - public function testOneToManyCascadeRemove() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - - for ($i=0; $i<3; ++$i) { - $phone = new CmsPhonenumber; - $phone->phonenumber = 100 + $i; - $user->addPhonenumber($phone); - } - - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - - $query = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u where u.username='gblanco'"); - $gblanco = $query->getSingleResult(); - - $this->_em->remove($gblanco); - $this->_em->flush(); - - $this->_em->clear(); - - $this->assertEquals(0, $this->_em->createQuery( - "select count(p.phonenumber) from Doctrine\Tests\Models\CMS\CmsPhonenumber p") - ->getSingleScalarResult()); - - $this->assertEquals(0, $this->_em->createQuery( - "select count(u.id) from Doctrine\Tests\Models\CMS\CmsUser u") - ->getSingleScalarResult()); - } - - public function testTextColumnSaveAndRetrieve() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - - $this->_em->persist($user); - - $article = new \Doctrine\Tests\Models\CMS\CmsArticle(); - $article->text = "Lorem ipsum dolor sunt."; - $article->topic = "A Test Article!"; - $article->setAuthor($user); - - $this->_em->persist($article); - $this->_em->flush(); - $articleId = $article->id; - - $this->_em->clear(); - - // test find() with leading backslash at the same time - $articleNew = $this->_em->find('\Doctrine\Tests\Models\CMS\CmsArticle', $articleId); - $this->assertTrue($this->_em->contains($articleNew)); - $this->assertEquals("Lorem ipsum dolor sunt.", $articleNew->text); - - $this->assertNotSame($article, $articleNew); - - $articleNew->text = "Lorem ipsum dolor sunt. And stuff!"; - - $this->_em->flush(); - $this->_em->clear(); - - $articleNew = $this->_em->find('Doctrine\Tests\Models\CMS\CmsArticle', $articleId); - $this->assertEquals("Lorem ipsum dolor sunt. And stuff!", $articleNew->text); - $this->assertTrue($this->_em->contains($articleNew)); - } - - public function testFlushDoesNotIssueUnnecessaryUpdates() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - - $address = new CmsAddress; - $address->country = 'Germany'; - $address->city = 'Berlin'; - $address->zip = '12345'; - - $address->user = $user; - $user->address = $address; - - $article = new \Doctrine\Tests\Models\CMS\CmsArticle(); - $article->text = "Lorem ipsum dolor sunt."; - $article->topic = "A Test Article!"; - $article->setAuthor($user); - - $this->_em->persist($article); - $this->_em->persist($user); - - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - - $this->_em->flush(); - $this->_em->clear(); - - $query = $this->_em->createQuery('select u,a,ad from Doctrine\Tests\Models\CMS\CmsUser u join u.articles a join u.address ad'); - $user2 = $query->getSingleResult(); - - $this->assertEquals(1, count($user2->articles)); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsAddress', $user2->address); - - $oldLogger = $this->_em->getConnection()->getConfiguration()->getSQLLogger(); - $debugStack = new \Doctrine\DBAL\Logging\DebugStack; - $this->_em->getConnection()->getConfiguration()->setSQLLogger($debugStack); - - $this->_em->flush(); - $this->assertEquals(0, count($debugStack->queries)); - - $this->_em->getConnection()->getConfiguration()->setSQLLogger($oldLogger); - } - - public function testRemoveEntityByReference() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - - $userRef = $this->_em->getReference('Doctrine\Tests\Models\CMS\CmsUser', $user->getId()); - $this->_em->remove($userRef); - $this->_em->flush(); - $this->_em->clear(); - - $this->assertEquals(0, $this->_em->getConnection()->fetchColumn("select count(*) from cms_users")); - - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(null); - } - - public function testQueryEntityByReference() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - - $address = new CmsAddress; - $address->country = 'Germany'; - $address->city = 'Berlin'; - $address->zip = '12345'; - - $user->setAddress($address); - - $this->_em->transactional(function($em) use($user) { - $em->persist($user); - }); - $this->_em->clear(); - - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - - $userRef = $this->_em->getReference('Doctrine\Tests\Models\CMS\CmsUser', $user->getId()); - $address2 = $this->_em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsAddress a where a.user = :user') - ->setParameter('user', $userRef) - ->getSingleResult(); - - $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $address2->getUser()); - $this->assertTrue($userRef === $address2->getUser()); - $this->assertFalse($userRef->__isInitialized__); - $this->assertEquals('Germany', $address2->country); - $this->assertEquals('Berlin', $address2->city); - $this->assertEquals('12345', $address2->zip); - } - - public function testOneToOneNullUpdate() - { - $user = new CmsUser(); - $user->username = "beberlei"; - $user->name = "Benjamin E."; - $user->status = 'active'; - - $address = new CmsAddress(); - $address->city = "Bonn"; - $address->zip = "12354"; - $address->country = "Germany"; - $address->street = "somestreet"; - $address->user = $user; - - $this->_em->persist($address); - $this->_em->persist($user); - $this->_em->flush(); - - $this->assertEquals(1, $this->_em->getConnection()->fetchColumn("select 1 from cms_addresses where user_id = ".$user->id)); - - $address->user = null; - $this->_em->flush(); - - $this->assertNotEquals(1, $this->_em->getConnection()->fetchColumn("select 1 from cms_addresses where user_id = ".$user->id)); - } - - /** - * @group DDC-600 - * @group DDC-455 - */ - public function testNewAssociatedEntityDuringFlushThrowsException() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - $user = new CmsUser(); - $user->username = "beberlei"; - $user->name = "Benjamin E."; - $user->status = 'active'; - - $address = new CmsAddress(); - $address->city = "Bonn"; - $address->zip = "12354"; - $address->country = "Germany"; - $address->street = "somestreet"; - $address->user = $user; - - $this->_em->persist($address); - // pretend we forgot to persist $user - try { - $this->_em->flush(); // should raise an exception - $this->fail(); - } catch (\InvalidArgumentException $expected) {} - } - - /** - * @group DDC-600 - * @group DDC-455 - */ - public function testNewAssociatedEntityDuringFlushThrowsException2() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - $user = new CmsUser(); - $user->username = "beberlei"; - $user->name = "Benjamin E."; - $user->status = 'active'; - - $address = new CmsAddress(); - $address->city = "Bonn"; - $address->zip = "12354"; - $address->country = "Germany"; - $address->street = "somestreet"; - $address->user = $user; - - $this->_em->persist($address); - $this->_em->persist($user); - $this->_em->flush(); - - $u2 = new CmsUser; - $u2->username = "beberlei"; - $u2->name = "Benjamin E."; - $u2->status = 'inactive'; - $address->user = $u2; - // pretend we forgot to persist $u2 - try { - $this->_em->flush(); // should raise an exception - $this->fail(); - } catch (\InvalidArgumentException $expected) {} - } - - /** - * @group DDC-600 - * @group DDC-455 - */ - public function testNewAssociatedEntityDuringFlushThrowsException3() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - $art = new CmsArticle(); - $art->topic = 'topic'; - $art->text = 'the text'; - - $com = new CmsComment(); - $com->topic = 'Good'; - $com->text = 'Really good!'; - $art->addComment($com); - - $this->_em->persist($art); - // pretend we forgot to persist $com - try { - $this->_em->flush(); // should raise an exception - $this->fail(); - } catch (\InvalidArgumentException $expected) {} - } - - public function testOneToOneOrphanRemoval() - { - $user = new CmsUser(); - $user->username = "beberlei"; - $user->name = "Benjamin E."; - $user->status = 'active'; - - $address = new CmsAddress(); - $address->city = "Bonn"; - $address->zip = "12354"; - $address->country = "Germany"; - $address->street = "somestreet"; - $address->user = $user; - $user->address = $address; - - $this->_em->persist($address); - $this->_em->persist($user); - $this->_em->flush(); - $addressId = $address->getId(); - - $user->address = null; - - $this->_em->flush(); - - $this->assertEquals(0, $this->_em->getConnection()->fetchColumn("select count(*) from cms_addresses")); - - // check orphan removal through replacement - $user->address = $address; - $address->user = $user; - - $this->_em->flush(); - $this->assertEquals(1, $this->_em->getConnection()->fetchColumn("select count(*) from cms_addresses")); - - // remove $address to free up unique key id - $this->_em->remove($address); - $this->_em->flush(); - - $newAddress = new CmsAddress(); - $newAddress->city = "NewBonn"; - $newAddress->zip = "12354"; - $newAddress->country = "NewGermany"; - $newAddress->street = "somenewstreet"; - $newAddress->user = $user; - $user->address = $newAddress; - - $this->_em->flush(); - $this->assertEquals(1, $this->_em->getConnection()->fetchColumn("select count(*) from cms_addresses")); - } - - public function testGetPartialReferenceToUpdateObjectWithoutLoadingIt() - { - $user = new CmsUser(); - $user->username = "beberlei"; - $user->name = "Benjamin E."; - $user->status = 'active'; - $this->_em->persist($user); - $this->_em->flush(); - $userId = $user->id; - $this->_em->clear(); - - $user = $this->_em->getPartialReference('Doctrine\Tests\Models\CMS\CmsUser', $userId); - $this->assertTrue($this->_em->contains($user)); - $this->assertNull($user->getName()); - $this->assertEquals($userId, $user->id); - - $user->name = 'Stephan'; - $this->_em->flush(); - $this->_em->clear(); - - $this->assertEquals('Benjamin E.', $this->_em->find(get_class($user), $userId)->name); - } - - public function testMergePersistsNewEntities() - { - $user = new CmsUser(); - $user->username = "beberlei"; - $user->name = "Benjamin E."; - $user->status = 'active'; - - $managedUser = $this->_em->merge($user); - $this->assertEquals('beberlei', $managedUser->username); - $this->assertEquals('Benjamin E.', $managedUser->name); - $this->assertEquals('active', $managedUser->status); - - $this->assertTrue($user !== $managedUser); - $this->assertTrue($this->_em->contains($managedUser)); - - $this->_em->flush(); - $userId = $managedUser->id; - $this->_em->clear(); - - $user2 = $this->_em->find(get_class($managedUser), $userId); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $user2); - } - - public function testMergeThrowsExceptionIfEntityWithGeneratedIdentifierDoesNotExist() - { - $user = new CmsUser(); - $user->username = "beberlei"; - $user->name = "Benjamin E."; - $user->status = 'active'; - $user->id = 42; - try { - $this->_em->merge($user); - $this->fail(); - } catch (\Doctrine\ORM\EntityNotFoundException $enfe) {} - } - - /** - * @group DDC-634 - */ - public function testOneToOneMergeSetNull() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - $user = new CmsUser(); - $user->username = "beberlei"; - $user->name = "Benjamin E."; - $user->status = 'active'; - - $ph = new CmsPhonenumber(); - $ph->phonenumber = "12345"; - $user->addPhonenumber($ph); - - $this->_em->persist($user); - $this->_em->persist($ph); - $this->_em->flush(); - - $this->_em->clear(); - - $ph->user = null; - $managedPh = $this->_em->merge($ph); - - $this->_em->flush(); - $this->_em->clear(); - - $this->assertNull($this->_em->find(get_class($ph), $ph->phonenumber)->getUser()); - } - - /** - * @group DDC-952 - */ - public function testManyToOneFetchModeQuery() - { - $user = new CmsUser(); - $user->username = "beberlei"; - $user->name = "Benjamin E."; - $user->status = 'active'; - - $article = new CmsArticle(); - $article->topic = "foo"; - $article->text = "bar"; - $article->user = $user; - - $this->_em->persist($article); - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - - $qc = $this->getCurrentQueryCount(); - $dql = "SELECT a FROM Doctrine\Tests\Models\CMS\CmsArticle a WHERE a.id = ?1"; - $article = $this->_em->createQuery($dql) - ->setParameter(1, $article->id) - ->setFetchMode('Doctrine\Tests\Models\CMS\CmsArticle', 'user', \Doctrine\ORM\Mapping\ClassMetadata::FETCH_EAGER) - ->getSingleResult(); - $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $article->user, "It IS a proxy, ..."); - $this->assertTrue($article->user->__isInitialized__, "...but its initialized!"); - $this->assertEquals($qc+2, $this->getCurrentQueryCount()); - } - - /** - * @group DDC-1278 - */ - public function testClearWithEntityName() - { - $user = new CmsUser; - $user->name = 'Dominik'; - $user->username = 'domnikl'; - $user->status = 'developer'; - - $address = new CmsAddress(); - $address->city = "Springfield"; - $address->zip = "12354"; - $address->country = "Germany"; - $address->street = "Foo Street"; - $address->user = $user; - $user->address = $address; - - $article1 = new CmsArticle(); - $article1->topic = 'Foo'; - $article1->text = 'Foo Text'; - - $article2 = new CmsArticle(); - $article2->topic = 'Bar'; - $article2->text = 'Bar Text'; - - $user->addArticle($article1); - $user->addArticle($article2); - - $this->_em->persist($article1); - $this->_em->persist($article2); - $this->_em->persist($address); - $this->_em->persist($user); - $this->_em->flush(); - - $unitOfWork = $this->_em->getUnitOfWork(); - - $this->_em->clear('Doctrine\Tests\Models\CMS\CmsUser'); - - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_DETACHED, $unitOfWork->getEntityState($user)); - - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_MANAGED, $unitOfWork->getEntityState($address)); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_MANAGED, $unitOfWork->getEntityState($article1)); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_MANAGED, $unitOfWork->getEntityState($article2)); - - $this->_em->clear(); - - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_DETACHED, $unitOfWork->getEntityState($address)); - } - - /** - * @group DDC-720 - */ - public function testFlushSingleManagedEntity() - { - $user = new CmsUser; - $user->name = 'Dominik'; - $user->username = 'domnikl'; - $user->status = 'developer'; - - $this->_em->persist($user); - $this->_em->flush(); - - $user->status = 'administrator'; - $this->_em->flush($user); - $this->_em->clear(); - - $user = $this->_em->find(get_class($user), $user->id); - $this->assertEquals('administrator', $user->status); - } - - /** - * @group DDC-720 - */ - public function testFlushSingleUnmanagedEntity() - { - $user = new CmsUser; - $user->name = 'Dominik'; - $user->username = 'domnikl'; - $user->status = 'developer'; - - $this->setExpectedException('InvalidArgumentException', 'Entity has to be managed for single computation'); - $this->_em->flush($user); - } - - /** - * @group DDC-720 - */ - public function testFlushSingleAndNewEntity() - { - $user = new CmsUser; - $user->name = 'Dominik'; - $user->username = 'domnikl'; - $user->status = 'developer'; - - $this->_em->persist($user); - $this->_em->flush(); - - $otherUser = new CmsUser; - $otherUser->name = 'Dominik2'; - $otherUser->username = 'domnikl2'; - $otherUser->status = 'developer'; - - $user->status = 'administrator'; - - $this->_em->persist($otherUser); - $this->_em->flush($user); - - $this->assertTrue($this->_em->contains($otherUser), "Other user is contained in EntityManager"); - $this->assertTrue($otherUser->id > 0, "other user has an id"); - } - - /** - * @group DDC-720 - */ - public function testFlushAndCascadePersist() - { - $user = new CmsUser; - $user->name = 'Dominik'; - $user->username = 'domnikl'; - $user->status = 'developer'; - - $this->_em->persist($user); - $this->_em->flush(); - - $address = new CmsAddress(); - $address->city = "Springfield"; - $address->zip = "12354"; - $address->country = "Germany"; - $address->street = "Foo Street"; - $address->user = $user; - $user->address = $address; - - $this->_em->flush($user); - - $this->assertTrue($this->_em->contains($address), "Other user is contained in EntityManager"); - $this->assertTrue($address->id > 0, "other user has an id"); - } - - /** - * @group DDC-720 - */ - public function testFlushSingleAndNoCascade() - { - $user = new CmsUser; - $user->name = 'Dominik'; - $user->username = 'domnikl'; - $user->status = 'developer'; - - $this->_em->persist($user); - $this->_em->flush(); - - $article1 = new CmsArticle(); - $article1->topic = 'Foo'; - $article1->text = 'Foo Text'; - $article1->author = $user; - $user->articles[] = $article1; - - $this->setExpectedException('InvalidArgumentException', "A new entity was found through the relationship 'Doctrine\Tests\Models\CMS\CmsUser#articles'"); - $this->_em->flush($user); - } - - /** - * @group DDC-720 - * @group DDC-1612 - */ - public function testFlushSingleNewEntity() - { - $user = new CmsUser; - $user->name = 'Dominik'; - $user->username = 'domnikl'; - $user->status = 'developer'; - - $this->_em->persist($user); - $this->_em->flush($user); - } - - /** - * @group DDC-720 - */ - public function testProxyIsIgnored() - { - $user = new CmsUser; - $user->name = 'Dominik'; - $user->username = 'domnikl'; - $user->status = 'developer'; - - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - - $user = $this->_em->getReference(get_class($user), $user->id); - - $otherUser = new CmsUser; - $otherUser->name = 'Dominik2'; - $otherUser->username = 'domnikl2'; - $otherUser->status = 'developer'; - - $this->_em->persist($otherUser); - $this->_em->flush($user); - - $this->assertTrue($this->_em->contains($otherUser), "Other user is contained in EntityManager"); - $this->assertTrue($otherUser->id > 0, "other user has an id"); - } - - /** - * @group DDC-720 - */ - public function testFlushSingleSaveOnlySingle() - { - $user = new CmsUser; - $user->name = 'Dominik'; - $user->username = 'domnikl'; - $user->status = 'developer'; - $this->_em->persist($user); - - $user2 = new CmsUser; - $user2->name = 'Dominik'; - $user2->username = 'domnikl2'; - $user2->status = 'developer'; - $this->_em->persist($user2); - - $this->_em->flush(); - - $user->status = 'admin'; - $user2->status = 'admin'; - - $this->_em->flush($user); - $this->_em->clear(); - - $user2 = $this->_em->find(get_class($user2), $user2->id); - $this->assertEquals('developer', $user2->status); - } - - /** - * @group DDC-1585 - */ - public function testWrongAssocationInstance() - { - $user = new CmsUser; - $user->name = 'Dominik'; - $user->username = 'domnikl'; - $user->status = 'developer'; - $user->address = $user; - - $this->_em->persist($user); - - $this->setExpectedException("Doctrine\ORM\ORMException", "Found entity of type Doctrine\Tests\Models\CMS\CmsUser on association Doctrine\Tests\Models\CMS\CmsUser#address, but expecting Doctrine\Tests\Models\CMS\CmsAddress"); - $this->_em->flush(); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php deleted file mode 100644 index bd6c794..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php +++ /dev/null @@ -1,470 +0,0 @@ -useModelSet('company'); - parent::setUp(); - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - } - - public function testCRUD() - { - $person = new CompanyPerson; - $person->setName('Roman S. Borschel'); - - $this->_em->persist($person); - - $employee = new CompanyEmployee; - $employee->setName('Roman S. Borschel'); - $employee->setSalary(100000); - $employee->setDepartment('IT'); - - $this->_em->persist($employee); - - $employee->setName('Guilherme Blanco'); - $this->_em->flush(); - - $this->_em->clear(); - - $query = $this->_em->createQuery("select p from Doctrine\Tests\Models\Company\CompanyPerson p order by p.name desc"); - - $entities = $query->getResult(); - - $this->assertEquals(2, count($entities)); - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyPerson', $entities[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyEmployee', $entities[1]); - $this->assertTrue(is_numeric($entities[0]->getId())); - $this->assertTrue(is_numeric($entities[1]->getId())); - $this->assertEquals('Roman S. Borschel', $entities[0]->getName()); - $this->assertEquals('Guilherme Blanco', $entities[1]->getName()); - $this->assertEquals(100000, $entities[1]->getSalary()); - - $this->_em->clear(); - - $query = $this->_em->createQuery("select p from Doctrine\Tests\Models\Company\CompanyEmployee p"); - - $entities = $query->getResult(); - - $this->assertEquals(1, count($entities)); - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyEmployee', $entities[0]); - $this->assertTrue(is_numeric($entities[0]->getId())); - $this->assertEquals('Guilherme Blanco', $entities[0]->getName()); - $this->assertEquals(100000, $entities[0]->getSalary()); - - $this->_em->clear(); - - $guilherme = $this->_em->getRepository(get_class($employee))->findOneBy(array('name' => 'Guilherme Blanco')); - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyEmployee', $guilherme); - $this->assertEquals('Guilherme Blanco', $guilherme->getName()); - - $this->_em->clear(); - - $query = $this->_em->createQuery("update Doctrine\Tests\Models\Company\CompanyEmployee p set p.name = ?1, p.department = ?2 where p.name='Guilherme Blanco' and p.salary = ?3"); - $query->setParameter(1, 'NewName', 'string'); - $query->setParameter(2, 'NewDepartment'); - $query->setParameter(3, 100000); - $query->getSql(); - $numUpdated = $query->execute(); - $this->assertEquals(1, $numUpdated); - - $query = $this->_em->createQuery("delete from Doctrine\Tests\Models\Company\CompanyPerson p"); - $numDeleted = $query->execute(); - $this->assertEquals(2, $numDeleted); - } - - public function testMultiLevelUpdateAndFind() { - $manager = new CompanyManager; - $manager->setName('Roman S. Borschel'); - $manager->setSalary(100000); - $manager->setDepartment('IT'); - $manager->setTitle('CTO'); - $this->_em->persist($manager); - $this->_em->flush(); - - $manager->setName('Roman B.'); - $manager->setSalary(119000); - $manager->setTitle('CEO'); - $this->_em->persist($manager); - $this->_em->flush(); - - $this->_em->clear(); - - $manager = $this->_em->find('Doctrine\Tests\Models\Company\CompanyManager', $manager->getId()); - - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyManager', $manager); - $this->assertEquals('Roman B.', $manager->getName()); - $this->assertEquals(119000, $manager->getSalary()); - $this->assertEquals('CEO', $manager->getTitle()); - $this->assertTrue(is_numeric($manager->getId())); - } - - public function testFindOnBaseClass() { - $manager = new CompanyManager; - $manager->setName('Roman S. Borschel'); - $manager->setSalary(100000); - $manager->setDepartment('IT'); - $manager->setTitle('CTO'); - $this->_em->persist($manager); - $this->_em->flush(); - - $this->_em->clear(); - - $person = $this->_em->find('Doctrine\Tests\Models\Company\CompanyPerson', $manager->getId()); - - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyManager', $person); - $this->assertEquals('Roman S. Borschel', $person->getName()); - $this->assertEquals(100000, $person->getSalary()); - $this->assertEquals('CTO', $person->getTitle()); - $this->assertTrue(is_numeric($person->getId())); - //$this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyCar', $person->getCar()); - } - - public function testSelfReferencingOneToOne() { - $manager = new CompanyManager; - $manager->setName('John Smith'); - $manager->setSalary(100000); - $manager->setDepartment('IT'); - $manager->setTitle('CTO'); - - $wife = new CompanyPerson; - $wife->setName('Mary Smith'); - $wife->setSpouse($manager); - - $this->assertSame($manager, $wife->getSpouse()); - $this->assertSame($wife, $manager->getSpouse()); - - $this->_em->persist($manager); - $this->_em->persist($wife); - - $this->_em->flush(); - - //var_dump($this->_em->getConnection()->fetchAll('select * from company_persons')); - //var_dump($this->_em->getConnection()->fetchAll('select * from company_employees')); - //var_dump($this->_em->getConnection()->fetchAll('select * from company_managers')); - - $this->_em->clear(); - - $query = $this->_em->createQuery('select p, s from Doctrine\Tests\Models\Company\CompanyPerson p join p.spouse s where p.name=\'Mary Smith\''); - - $result = $query->getResult(); - $this->assertEquals(1, count($result)); - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyPerson', $result[0]); - $this->assertEquals('Mary Smith', $result[0]->getName()); - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyEmployee', $result[0]->getSpouse()); - $this->assertEquals('John Smith', $result[0]->getSpouse()->getName()); - $this->assertSame($result[0], $result[0]->getSpouse()->getSpouse()); - } - - public function testSelfReferencingManyToMany() - { - $person1 = new CompanyPerson; - $person1->setName('Roman'); - - $person2 = new CompanyPerson; - $person2->setName('Jonathan'); - - $person1->addFriend($person2); - - $this->assertEquals(1, count($person1->getFriends())); - $this->assertEquals(1, count($person2->getFriends())); - - - $this->_em->persist($person1); - $this->_em->persist($person2); - - $this->_em->flush(); - - $this->_em->clear(); - - $query = $this->_em->createQuery('select p, f from Doctrine\Tests\Models\Company\CompanyPerson p join p.friends f where p.name=?1'); - $query->setParameter(1, 'Roman'); - - $result = $query->getResult(); - $this->assertEquals(1, count($result)); - $this->assertEquals(1, count($result[0]->getFriends())); - $this->assertEquals('Roman', $result[0]->getName()); - - $friends = $result[0]->getFriends(); - $this->assertEquals('Jonathan', $friends[0]->getName()); - } - - public function testLazyLoading1() - { - $org = new CompanyOrganization; - $event1 = new CompanyAuction; - $event1->setData('auction'); - $org->addEvent($event1); - $event2 = new CompanyRaffle; - $event2->setData('raffle'); - $org->addEvent($event2); - - $this->_em->persist($org); - $this->_em->flush(); - $this->_em->clear(); - - $orgId = $org->getId(); - - $q = $this->_em->createQuery('select a from Doctrine\Tests\Models\Company\CompanyOrganization a where a.id = ?1'); - $q->setParameter(1, $orgId); - - $result = $q->getResult(); - - $this->assertEquals(1, count($result)); - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyOrganization', $result[0]); - $this->assertNull($result[0]->getMainEvent()); - - $events = $result[0]->getEvents(); - - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $events); - $this->assertFalse($events->isInitialized()); - - $this->assertEquals(2, count($events)); - if ($events[0] instanceof CompanyAuction) { - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyRaffle', $events[1]); - } else { - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyRaffle', $events[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyAuction', $events[1]); - } - } - - - public function testLazyLoading2() - { - $org = new CompanyOrganization; - $event1 = new CompanyAuction; - $event1->setData('auction'); - $org->setMainEvent($event1); - - $this->_em->persist($org); - $this->_em->flush(); - $this->_em->clear(); - - $q = $this->_em->createQuery('select a from Doctrine\Tests\Models\Company\CompanyEvent a where a.id = ?1'); - $q->setParameter(1, $event1->getId()); - - $result = $q->getResult(); - $this->assertEquals(1, count($result)); - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyAuction', $result[0], sprintf("Is of class %s",get_class($result[0]))); - - $this->_em->clear(); - - $q = $this->_em->createQuery('select a from Doctrine\Tests\Models\Company\CompanyOrganization a where a.id = ?1'); - $q->setParameter(1, $org->getId()); - - $result = $q->getResult(); - - $this->assertEquals(1, count($result)); - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyOrganization', $result[0]); - - $mainEvent = $result[0]->getMainEvent(); - // mainEvent should have been loaded because it can't be lazy - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyAuction', $mainEvent); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $mainEvent); - } - - /** - * @group DDC-368 - */ - public function testBulkUpdateIssueDDC368() - { - $dql = 'UPDATE Doctrine\Tests\Models\Company\CompanyEmployee AS p SET p.salary = 1'; - $this->_em->createQuery($dql)->execute(); - - $this->assertTrue(count($this->_em->createQuery( - 'SELECT count(p.id) FROM Doctrine\Tests\Models\Company\CompanyEmployee p WHERE p.salary = 1') - ->getResult()) > 0); - } - - /** - * @group DDC-1341 - */ - public function testBulkUpdateNonScalarParameterDDC1341() - { - $dql = 'UPDATE Doctrine\Tests\Models\Company\CompanyEmployee AS p SET p.startDate = ?0 WHERE p.department = ?1'; - $query = $this->_em->createQuery($dql) - ->setParameter(0, new \DateTime()) - ->setParameter(1, 'IT'); - - $result = $query->execute(); - - } - - /** - * @group DDC-130 - */ - public function testDeleteJoinTableRecords() - { - #$this->markTestSkipped('Nightmare! friends adds both ID 6-7 and 7-6 into two rows of the join table. How to detect this?'); - - $employee1 = new CompanyEmployee(); - $employee1->setName('gblanco'); - $employee1->setSalary(0); - $employee1->setDepartment('IT'); - - $employee2 = new CompanyEmployee(); - $employee2->setName('jwage'); - $employee2->setSalary(0); - $employee2->setDepartment('IT'); - - $employee1->addFriend($employee2); - - $this->_em->persist($employee1); - $this->_em->persist($employee2); - $this->_em->flush(); - - $employee1Id = $employee1->getId(); - - $this->_em->remove($employee1); - $this->_em->flush(); - - $this->assertNull($this->_em->find(get_class($employee1), $employee1Id)); - } - - /** - * @group DDC-728 - */ - public function testQueryForInheritedSingleValuedAssociation() - { - $manager = new CompanyManager(); - $manager->setName('gblanco'); - $manager->setSalary(1234); - $manager->setTitle('Awesome!'); - $manager->setDepartment('IT'); - - $person = new CompanyPerson(); - $person->setName('spouse'); - - $manager->setSpouse($person); - - $this->_em->persist($manager); - $this->_em->persist($person); - $this->_em->flush(); - $this->_em->clear(); - - $dql = "SELECT m FROM Doctrine\Tests\Models\Company\CompanyManager m WHERE m.spouse = ?1"; - $dqlManager = $this->_em->createQuery($dql)->setParameter(1, $person->getId())->getSingleResult(); - - $this->assertEquals($manager->getId(), $dqlManager->getId()); - $this->assertEquals($person->getId(), $dqlManager->getSpouse()->getId()); - } - - /** - * @group DDC-817 - */ - public function testFindByAssociation() - { - $manager = new CompanyManager(); - $manager->setName('gblanco'); - $manager->setSalary(1234); - $manager->setTitle('Awesome!'); - $manager->setDepartment('IT'); - - $person = new CompanyPerson(); - $person->setName('spouse'); - - $manager->setSpouse($person); - - $this->_em->persist($manager); - $this->_em->persist($person); - $this->_em->flush(); - $this->_em->clear(); - - $repos = $this->_em->getRepository('Doctrine\Tests\Models\Company\CompanyManager'); - $pmanager = $repos->findOneBy(array('spouse' => $person->getId())); - - $this->assertEquals($manager->getId(), $pmanager->getId()); - - $repos = $this->_em->getRepository('Doctrine\Tests\Models\Company\CompanyPerson'); - $pmanager = $repos->findOneBy(array('spouse' => $person->getId())); - - $this->assertEquals($manager->getId(), $pmanager->getId()); - } - - /** - * @group DDC-834 - */ - public function testGetReferenceEntityWithSubclasses() - { - $manager = new CompanyManager(); - $manager->setName('gblanco'); - $manager->setSalary(1234); - $manager->setTitle('Awesome!'); - $manager->setDepartment('IT'); - - $this->_em->persist($manager); - $this->_em->flush(); - $this->_em->clear(); - - $ref = $this->_em->getReference('Doctrine\Tests\Models\Company\CompanyPerson', $manager->getId()); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $ref, "Cannot Request a proxy from a class that has subclasses."); - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyPerson', $ref); - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyEmployee', $ref, "Direct fetch of the reference has to load the child class Emplyoee directly."); - $this->_em->clear(); - - $ref = $this->_em->getReference('Doctrine\Tests\Models\Company\CompanyManager', $manager->getId()); - $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $ref, "A proxy can be generated only if no subclasses exists for the requested reference."); - } - - /** - * @group DDC-992 - */ - public function testGetSubClassManyToManyCollection() - { - $manager = new CompanyManager(); - $manager->setName('gblanco'); - $manager->setSalary(1234); - $manager->setTitle('Awesome!'); - $manager->setDepartment('IT'); - - $person = new CompanyPerson(); - $person->setName('friend'); - - $manager->addFriend($person); - - $this->_em->persist($manager); - $this->_em->persist($person); - $this->_em->flush(); - $this->_em->clear(); - - $manager = $this->_em->find('Doctrine\Tests\Models\Company\CompanyManager', $manager->getId()); - $this->assertEquals(1, count($manager->getFriends())); - } - - /** - * @group DDC-1777 - */ - public function testExistsSubclass() - { - $manager = new CompanyManager(); - $manager->setName('gblanco'); - $manager->setSalary(1234); - $manager->setTitle('Awesome!'); - $manager->setDepartment('IT'); - - $this->assertFalse($this->_em->getUnitOfWork()->getEntityPersister(get_class($manager))->exists($manager)); - - $this->_em->persist($manager); - $this->_em->flush(); - - $this->assertTrue($this->_em->getUnitOfWork()->getEntityPersister(get_class($manager))->exists($manager)); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest2.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest2.php deleted file mode 100644 index 531b100..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest2.php +++ /dev/null @@ -1,176 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\CTIParent'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\CTIChild'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\CTIRelated'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\CTIRelated2') - )); - } catch (\Exception $ignored) { - // Swallow all exceptions. We do not test the schema tool here. - } - } - - public function testOneToOneAssocToBaseTypeBidirectional() - { - $child = new CTIChild; - $child->setData('hello'); - - $related = new CTIRelated; - $related->setCTIParent($child); - - $this->_em->persist($related); - $this->_em->persist($child); - - $this->_em->flush(); - $this->_em->clear(); - - $relatedId = $related->getId(); - - $related2 = $this->_em->find('Doctrine\Tests\ORM\Functional\CTIRelated', $relatedId); - - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\CTIRelated', $related2); - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\CTIChild', $related2->getCTIParent()); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $related2->getCTIParent()); - $this->assertEquals('hello', $related2->getCTIParent()->getData()); - - $this->assertSame($related2, $related2->getCTIParent()->getRelated()); - } - - public function testManyToManyToCTIHierarchy() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger()); - $mmrel = new CTIRelated2; - $child = new CTIChild; - $child->setData('child'); - $mmrel->addCTIChild($child); - - $this->_em->persist($mmrel); - $this->_em->persist($child); - - $this->_em->flush(); - $this->_em->clear(); - - $mmrel2 = $this->_em->find(get_class($mmrel), $mmrel->getId()); - $this->assertFalse($mmrel2->getCTIChildren()->isInitialized()); - $this->assertEquals(1, count($mmrel2->getCTIChildren())); - $this->assertTrue($mmrel2->getCTIChildren()->isInitialized()); - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\CTIChild', $mmrel2->getCTIChildren()->get(0)); - } -} - -/** - * @Entity @Table(name="cti_parents") - * @InheritanceType("JOINED") - * @DiscriminatorColumn(name="type", type="string") - * @DiscriminatorMap({"parent" = "CTIParent", "child" = "CTIChild"}) - */ -class CTIParent { - /** - * @Id @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - private $id; - - /** @OneToOne(targetEntity="CTIRelated", mappedBy="ctiParent") */ - private $related; - - public function getId() { - return $this->id; - } - - public function getRelated() { - return $this->related; - } - - public function setRelated($related) { - $this->related = $related; - $related->setCTIParent($this); - } -} - -/** - * @Entity @Table(name="cti_children") - */ -class CTIChild extends CTIParent { - /** - * @Column(type="string") - */ - private $data; - - public function getData() { - return $this->data; - } - - public function setData($data) { - $this->data = $data; - } - -} - -/** @Entity */ -class CTIRelated { - /** - * @Id @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - private $id; - - /** - * @OneToOne(targetEntity="CTIParent") - * @JoinColumn(name="ctiparent_id", referencedColumnName="id") - */ - private $ctiParent; - - public function getId() { - return $this->id; - } - - public function getCTIParent() { - return $this->ctiParent; - } - - public function setCTIParent($ctiParent) { - $this->ctiParent = $ctiParent; - } -} - -/** @Entity */ -class CTIRelated2 -{ - /** @Id @Column(type="integer") @GeneratedValue */ - private $id; - /** @ManyToMany(targetEntity="CTIChild") */ - private $ctiChildren; - - - public function __construct() { - $this->ctiChildren = new \Doctrine\Common\Collections\ArrayCollection; - } - - public function getId() { - return $this->id; - } - - public function addCTIChild(CTIChild $child) { - $this->ctiChildren->add($child); - } - - public function getCTIChildren() { - return $this->ctiChildren; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ClearEventTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ClearEventTest.php deleted file mode 100644 index e86edb5..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ClearEventTest.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ -class ClearEventTest extends \Doctrine\Tests\OrmFunctionalTestCase -{ - protected function setUp() { - parent::setUp(); - } - - public function testEventIsCalledOnClear() - { - $listener = new OnClearListener; - $this->_em->getEventManager()->addEventListener(Events::onClear, $listener); - - $this->_em->clear(); - - $this->assertTrue($listener->called); - } -} - -class OnClearListener -{ - public $called = false; - - public function onClear(OnClearEventArgs $args) - { - $this->called = true; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyTest.php deleted file mode 100644 index 1af930a..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyTest.php +++ /dev/null @@ -1,144 +0,0 @@ -useModelSet('navigation'); - parent::setUp(); - } - - public function putGermanysBrandenburderTor() - { - $country = new NavCountry("Germany"); - $this->_em->persist($country); - $poi = new NavPointOfInterest(100, 200, "Brandenburger Tor", $country); - $this->_em->persist($poi); - $this->_em->flush(); - $this->_em->clear(); - } - - public function putTripAroundEurope() - { - $poi = $this->_em->find('Doctrine\Tests\Models\Navigation\NavPointOfInterest', array('lat' => 100, 'long' => 200)); - - $tour = new NavTour("Trip around Europe"); - $tour->addPointOfInterest($poi); - - $this->_em->persist($tour); - $this->_em->flush(); - $this->_em->clear(); - - return $tour; - } - - public function testPersistCompositePkEntity() - { - $this->putGermanysBrandenburderTor(); - - $poi = $this->_em->find('Doctrine\Tests\Models\Navigation\NavPointOfInterest', array('lat' => 100, 'long' => 200)); - - $this->assertInstanceOf('Doctrine\Tests\Models\Navigation\NavPointOfInterest', $poi); - $this->assertEquals(100, $poi->getLat()); - $this->assertEquals(200, $poi->getLong()); - $this->assertEquals('Brandenburger Tor', $poi->getName()); - } - - /** - * @group DDC-1651 - */ - public function testSetParameterCompositeKeyObject() - { - $this->putGermanysBrandenburderTor(); - - $poi = $this->_em->find('Doctrine\Tests\Models\Navigation\NavPointOfInterest', array('lat' => 100, 'long' => 200)); - $photo = new NavPhotos($poi, "asdf"); - $this->_em->persist($photo); - $this->_em->flush(); - $this->_em->clear(); - - $dql = 'SELECT t FROM Doctrine\Tests\Models\Navigation\NavPhotos t WHERE t.poi = ?1'; - - $this->setExpectedException('Doctrine\ORM\Query\QueryException', 'A single-valued association path expression to an entity with a composite primary key is not supported.'); - $sql = $this->_em->createQuery($dql)->getSQL(); - } - - public function testManyToManyCompositeRelation() - { - $this->putGermanysBrandenburderTor(); - $tour = $this->putTripAroundEurope(); - - $tour = $this->_em->find('Doctrine\Tests\Models\Navigation\NavTour', $tour->getId()); - - $this->assertEquals(1, count($tour->getPointOfInterests())); - } - - public function testCompositeDqlEagerFetching() - { - $this->putGermanysBrandenburderTor(); - $this->putTripAroundEurope(); - - $dql = 'SELECT t, p, c FROM Doctrine\Tests\Models\Navigation\NavTour t ' . - 'INNER JOIN t.pois p INNER JOIN p.country c'; - $tours = $this->_em->createQuery($dql)->getResult(); - - $this->assertEquals(1, count($tours)); - - $pois = $tours[0]->getPointOfInterests(); - - $this->assertEquals(1, count($pois)); - $this->assertEquals('Brandenburger Tor', $pois[0]->getName()); - } - - public function testCompositeCollectionMemberExpression() - { - $this->markTestSkipped('How to test this?'); - - $this->putGermanysBrandenburderTor(); - $this->putTripAroundEurope(); - - $dql = 'SELECT t FROM Doctrine\Tests\Models\Navigation\NavTour t, Doctrine\Tests\Models\Navigation\NavPointOfInterest p ' . - 'WHERE p MEMBER OF t.pois'; - $tours = $this->_em->createQuery($dql) - ->getResult(); - - $this->assertEquals(1, count($tours)); - } - - public function testSpecifiyUnknownIdentifierPrimaryKeyFails() - { - $this->setExpectedException('Doctrine\ORM\ORMException', 'The identifier long is missing for a query of Doctrine\Tests\Models\Navigation\NavPointOfInterest'); - $poi = $this->_em->find('Doctrine\Tests\Models\Navigation\NavPointOfInterest', array('key1' => 100)); - } - - /** - * @group DDC-1939 - */ - public function testDeleteCompositePersistentCollection() - { - $this->putGermanysBrandenburderTor(); - - $poi = $this->_em->find('Doctrine\Tests\Models\Navigation\NavPointOfInterest', array('lat' => 100, 'long' => 200)); - $poi->addVisitor(new NavUser("test1")); - $poi->addVisitor(new NavUser("test2")); - - $this->_em->flush(); - - $poi->getVisitors()->clear(); - - $this->_em->flush(); - $this->_em->clear(); - - $poi = $this->_em->find('Doctrine\Tests\Models\Navigation\NavPointOfInterest', array('lat' => 100, 'long' => 200)); - $this->assertEquals(0, count($poi->getVisitors())); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/CustomTreeWalkersTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/CustomTreeWalkersTest.php deleted file mode 100644 index 72fc6d5..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/CustomTreeWalkersTest.php +++ /dev/null @@ -1,157 +0,0 @@ -. - */ - -namespace Doctrine\Tests\ORM\Functional; - -use Doctrine\ORM\Query; - -require_once __DIR__ . '/../../TestInit.php'; - -/** - * Test case for custom AST walking and modification. - * - * @author Roman Borschel - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link http://www.doctrine-project.org - * @since 2.0 - */ -class CustomTreeWalkersTest extends \Doctrine\Tests\OrmTestCase -{ - private $_em; - - protected function setUp() - { - $this->_em = $this->_getTestEntityManager(); - } - - public function assertSqlGeneration($dqlToBeTested, $sqlToBeConfirmed) - { - try { - $query = $this->_em->createQuery($dqlToBeTested); - $query->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\Tests\ORM\Functional\CustomTreeWalker')) - ->useQueryCache(false); - - $this->assertEquals($sqlToBeConfirmed, $query->getSql()); - $query->free(); - } catch (\Exception $e) { - $this->fail($e->getMessage() . ' at "' . $e->getFile() . '" on line ' . $e->getLine()); - - } - } - - public function testSupportsQueriesWithoutWhere() - { - $this->assertSqlGeneration( - 'select u from Doctrine\Tests\Models\CMS\CmsUser u', - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3, c0_.email_id AS email_id4 FROM cms_users c0_ WHERE c0_.id = 1" - ); - } - - public function testSupportsQueriesWithMultipleConditionalExpressions() - { - $this->assertSqlGeneration( - 'select u from Doctrine\Tests\Models\CMS\CmsUser u where u.name = :name or u.name = :otherName', - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3, c0_.email_id AS email_id4 FROM cms_users c0_ WHERE (c0_.name = ? OR c0_.name = ?) AND c0_.id = 1" - ); - } - - public function testSupportsQueriesWithSimpleConditionalExpression() - { - $this->assertSqlGeneration( - 'select u from Doctrine\Tests\Models\CMS\CmsUser u where u.name = :name', - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3, c0_.email_id AS email_id4 FROM cms_users c0_ WHERE c0_.name = ? AND c0_.id = 1" - ); - } -} - -class CustomTreeWalker extends Query\TreeWalkerAdapter -{ - public function walkSelectStatement(Query\AST\SelectStatement $selectStatement) - { - // Get the DQL aliases of all the classes we want to modify - $dqlAliases = array(); - - foreach ($this->_getQueryComponents() as $dqlAlias => $comp) { - // Hard-coded check just for demonstration: We want to modify the query if - // it involves the CmsUser class. - if ($comp['metadata']->name == 'Doctrine\Tests\Models\CMS\CmsUser') { - $dqlAliases[] = $dqlAlias; - } - } - - // Create our conditions for all involved classes - $factors = array(); - foreach ($dqlAliases as $alias) { - $pathExpr = new Query\AST\PathExpression(Query\AST\PathExpression::TYPE_STATE_FIELD, $alias, 'id'); - $pathExpr->type = Query\AST\PathExpression::TYPE_STATE_FIELD; - $comparisonExpr = new Query\AST\ComparisonExpression($pathExpr, '=', 1); - - $condPrimary = new Query\AST\ConditionalPrimary; - $condPrimary->simpleConditionalExpression = $comparisonExpr; - - $factor = new Query\AST\ConditionalFactor($condPrimary); - $factors[] = $factor; - } - - if (($whereClause = $selectStatement->whereClause) !== null) { - // There is already a WHERE clause, so append the conditions - $condExpr = $whereClause->conditionalExpression; - - // Since Phase 1 AST optimizations were included, we need to re-add the ConditionalExpression - if ( ! ($condExpr instanceof Query\AST\ConditionalExpression)) { - $condExpr = new Query\AST\ConditionalExpression(array($condExpr)); - - $whereClause->conditionalExpression = $condExpr; - } - - $existingTerms = $whereClause->conditionalExpression->conditionalTerms; - - if (count($existingTerms) > 1) { - // More than one term, so we need to wrap all these terms in a single root term - // i.e: "WHERE u.name = :foo or u.other = :bar" => "WHERE (u.name = :foo or u.other = :bar) AND " - - $primary = new Query\AST\ConditionalPrimary; - $primary->conditionalExpression = new Query\AST\ConditionalExpression($existingTerms); - $existingFactor = new Query\AST\ConditionalFactor($primary); - $term = new Query\AST\ConditionalTerm(array_merge(array($existingFactor), $factors)); - - $selectStatement->whereClause->conditionalExpression->conditionalTerms = array($term); - } else { - // Just one term so we can simply append our factors to that term - $singleTerm = $selectStatement->whereClause->conditionalExpression->conditionalTerms[0]; - - // Since Phase 1 AST optimizations were included, we need to re-add the ConditionalExpression - if ( ! ($singleTerm instanceof Query\AST\ConditionalTerm)) { - $singleTerm = new Query\AST\ConditionalTerm(array($singleTerm)); - - $selectStatement->whereClause->conditionalExpression->conditionalTerms[0] = $singleTerm; - } - - $singleTerm->conditionalFactors = array_merge($singleTerm->conditionalFactors, $factors); - $selectStatement->whereClause->conditionalExpression->conditionalTerms = array($singleTerm); - } - } else { - // Create a new WHERE clause with our factors - $term = new Query\AST\ConditionalTerm($factors); - $condExpr = new Query\AST\ConditionalExpression(array($term)); - $whereClause = new Query\AST\WhereClause($condExpr); - $selectStatement->whereClause = $whereClause; - } - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php deleted file mode 100644 index 999d52d..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php +++ /dev/null @@ -1,166 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - - $this->_sm = $this->_em->getConnection()->getSchemaManager(); - } - - public function testLoadMetadataFromDatabase() - { - if (!$this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { - $this->markTestSkipped('Platform does not support foreign keys.'); - } - - $table = new \Doctrine\DBAL\Schema\Table("dbdriver_foo"); - $table->addColumn('id', 'integer'); - $table->setPrimaryKey(array('id')); - $table->addColumn('bar', 'string', array('notnull' => false, 'length' => 200)); - - $this->_sm->dropAndCreateTable($table); - - $metadatas = $this->extractClassMetadata(array("DbdriverFoo")); - - $this->assertArrayHasKey('DbdriverFoo', $metadatas); - $metadata = $metadatas['DbdriverFoo']; - - $this->assertArrayHasKey('id', $metadata->fieldMappings); - $this->assertEquals('id', $metadata->fieldMappings['id']['fieldName']); - $this->assertEquals('id', strtolower($metadata->fieldMappings['id']['columnName'])); - $this->assertEquals('integer', (string)$metadata->fieldMappings['id']['type']); - - $this->assertArrayHasKey('bar', $metadata->fieldMappings); - $this->assertEquals('bar', $metadata->fieldMappings['bar']['fieldName']); - $this->assertEquals('bar', strtolower($metadata->fieldMappings['bar']['columnName'])); - $this->assertEquals('string', (string)$metadata->fieldMappings['bar']['type']); - $this->assertEquals(200, $metadata->fieldMappings['bar']['length']); - $this->assertTrue($metadata->fieldMappings['bar']['nullable']); - } - - public function testLoadMetadataWithForeignKeyFromDatabase() - { - if (!$this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { - $this->markTestSkipped('Platform does not support foreign keys.'); - } - - $tableB = new \Doctrine\DBAL\Schema\Table("dbdriver_bar"); - $tableB->addColumn('id', 'integer'); - $tableB->setPrimaryKey(array('id')); - - $this->_sm->dropAndCreateTable($tableB); - - $tableA = new \Doctrine\DBAL\Schema\Table("dbdriver_baz"); - $tableA->addColumn('id', 'integer'); - $tableA->setPrimaryKey(array('id')); - $tableA->addColumn('bar_id', 'integer'); - $tableA->addForeignKeyConstraint('dbdriver_bar', array('bar_id'), array('id')); - - $this->_sm->dropAndCreateTable($tableA); - - $metadatas = $this->extractClassMetadata(array("DbdriverBar", "DbdriverBaz")); - - $this->assertArrayHasKey('DbdriverBaz', $metadatas); - $bazMetadata = $metadatas['DbdriverBaz']; - - $this->assertArrayNotHasKey('barId', $bazMetadata->fieldMappings, "The foreign Key field should not be inflected as 'barId' field, its an association."); - $this->assertArrayHasKey('id', $bazMetadata->fieldMappings); - - $bazMetadata->associationMappings = \array_change_key_case($bazMetadata->associationMappings, \CASE_LOWER); - - $this->assertArrayHasKey('bar', $bazMetadata->associationMappings); - $this->assertEquals(ClassMetadataInfo::MANY_TO_ONE, $bazMetadata->associationMappings['bar']['type']); - } - - public function testDetectManyToManyTables() - { - if (!$this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { - $this->markTestSkipped('Platform does not support foreign keys.'); - } - - $metadatas = $this->extractClassMetadata(array("CmsUsers", "CmsGroups")); - - $this->assertArrayHasKey('CmsUsers', $metadatas, 'CmsUsers entity was not detected.'); - $this->assertArrayHasKey('CmsGroups', $metadatas, 'CmsGroups entity was not detected.'); - - $this->assertEquals(2, count($metadatas['CmsUsers']->associationMappings)); - $this->assertArrayHasKey('group', $metadatas['CmsUsers']->associationMappings); - $this->assertEquals(1, count($metadatas['CmsGroups']->associationMappings)); - $this->assertArrayHasKey('user', $metadatas['CmsGroups']->associationMappings); - } - - public function testIgnoreManyToManyTableWithoutFurtherForeignKeyDetails() - { - $tableB = new \Doctrine\DBAL\Schema\Table("dbdriver_bar"); - $tableB->addColumn('id', 'integer'); - $tableB->setPrimaryKey(array('id')); - - $tableA = new \Doctrine\DBAL\Schema\Table("dbdriver_baz"); - $tableA->addColumn('id', 'integer'); - $tableA->setPrimaryKey(array('id')); - - $tableMany = new \Doctrine\DBAL\Schema\Table("dbdriver_bar_baz"); - $tableMany->addColumn('bar_id', 'integer'); - $tableMany->addColumn('baz_id', 'integer'); - $tableMany->addForeignKeyConstraint('dbdriver_bar', array('bar_id'), array('id')); - - $metadatas = $this->convertToClassMetadata(array($tableA, $tableB), array($tableMany)); - - $this->assertEquals(0, count($metadatas['DbdriverBaz']->associationMappings), "no association mappings should be detected."); - } - - protected function convertToClassMetadata(array $entityTables, array $manyTables = array()) - { - $driver = new \Doctrine\ORM\Mapping\Driver\DatabaseDriver($this->_sm); - $driver->setTables($entityTables, $manyTables); - - $metadatas = array(); - foreach ($driver->getAllClassNames() AS $className) { - $class = new ClassMetadataInfo($className); - $driver->loadMetadataForClass($className, $class); - $metadatas[$className] = $class; - } - - return $metadatas; - } - - /** - * @param string $className - * @return ClassMetadata - */ - protected function extractClassMetadata(array $classNames) - { - $classNames = array_map('strtolower', $classNames); - $metadatas = array(); - - $driver = new \Doctrine\ORM\Mapping\Driver\DatabaseDriver($this->_sm); - foreach ($driver->getAllClassNames() as $className) { - if (!in_array(strtolower($className), $classNames)) { - continue; - } - $class = new ClassMetadataInfo($className); - $driver->loadMetadataForClass($className, $class); - $metadatas[$className] = $class; - } - - if (count($metadatas) != count($classNames)) { - $this->fail("Have not found all classes matching the names '" . implode(", ", $classNames) . "' only tables " . implode(", ", array_keys($metadatas))); - } - return $metadatas; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php deleted file mode 100644 index 11511a0..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php +++ /dev/null @@ -1,150 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\DefaultValueUser'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\DefaultValueAddress') - )); - } catch (\Exception $e) { - // Swallow all exceptions. We do not test the schema tool here. - } - } - - public function testSimpleDetachMerge() { - $user = new DefaultValueUser; - $user->name = 'romanb'; - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - - $userId = $user->id; // e.g. from $_REQUEST - $user2 = $this->_em->getReference(get_class($user), $userId); - - $this->_em->flush(); - $this->assertFalse($user2->__isInitialized__); - - $a = new DefaultValueAddress; - $a->country = 'de'; - $a->zip = '12345'; - $a->city = 'Berlin'; - $a->street = 'Sesamestreet'; - - $a->user = $user2; - $this->_em->persist($a); - $this->_em->flush(); - - $this->assertFalse($user2->__isInitialized__); - $this->_em->clear(); - - $a2 = $this->_em->find(get_class($a), $a->id); - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\DefaultValueUser', $a2->getUser()); - $this->assertEquals($userId, $a2->getUser()->getId()); - $this->assertEquals('Poweruser', $a2->getUser()->type); - } - - /** - * @group DDC-1386 - */ - public function testGetPartialReferenceWithDefaultValueNotEvalutedInFlush() - { - $user = new DefaultValueUser; - $user->name = 'romanb'; - $user->type = 'Normaluser'; - - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - - $user = $this->_em->getPartialReference('Doctrine\Tests\ORM\Functional\DefaultValueUser', $user->id); - $this->assertTrue($this->_em->getUnitOfWork()->isReadOnly($user)); - - $this->_em->flush(); - $this->_em->clear(); - - $user = $this->_em->find('Doctrine\Tests\ORM\Functional\DefaultValueUser', $user->id); - - $this->assertEquals('Normaluser', $user->type); - } -} - - -/** - * @Entity @Table(name="defaultvalueuser") - */ -class DefaultValueUser -{ - /** - * @Id @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - public $id; - /** - * @Column(type="string") - */ - public $name = ''; - /** - * @Column(type="string") - */ - public $type = 'Poweruser'; - /** - * @OneToOne(targetEntity="DefaultValueAddress", mappedBy="user", cascade={"persist"}) - */ - public $address; - - public function getId() {return $this->id;} -} - -/** - * CmsAddress - * - * @Entity @Table(name="defaultvalueaddresses") - */ -class DefaultValueAddress -{ - /** - * @Column(type="integer") - * @Id @GeneratedValue(strategy="AUTO") - */ - public $id; - - /** - * @Column(type="string", length=50) - */ - public $country; - - /** - * @Column(type="string", length=50) - */ - public $zip; - - /** - * @Column(type="string", length=50) - */ - public $city; - - /** - * Testfield for Schema Updating Tests. - */ - public $street; - - /** - * @OneToOne(targetEntity="DefaultValueUser") - * @JoinColumn(name="user_id", referencedColumnName="id") - */ - public $user; - - public function getUser() {return $this->user;} -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/DetachedEntityTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/DetachedEntityTest.php deleted file mode 100644 index f5c50eb..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/DetachedEntityTest.php +++ /dev/null @@ -1,218 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - public function testSimpleDetachMerge() { - $user = new CmsUser; - $user->name = 'Roman'; - $user->username = 'romanb'; - $user->status = 'dev'; - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - - // $user is now detached - - $this->assertFalse($this->_em->contains($user)); - - $user->name = 'Roman B.'; - - //$this->assertEquals(UnitOfWork::STATE_DETACHED, $this->_em->getUnitOfWork()->getEntityState($user)); - - $user2 = $this->_em->merge($user); - - $this->assertFalse($user === $user2); - $this->assertTrue($this->_em->contains($user2)); - $this->assertEquals('Roman B.', $user2->name); - } - - public function testSerializeUnserializeModifyMerge() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - - $ph1 = new CmsPhonenumber; - $ph1->phonenumber = "1234"; - $user->addPhonenumber($ph1); - - $this->_em->persist($user); - $this->_em->flush(); - $this->assertTrue($this->_em->contains($user)); - $this->assertTrue($user->phonenumbers->isInitialized()); - - $serialized = serialize($user); - $this->_em->clear(); - $this->assertFalse($this->_em->contains($user)); - unset($user); - - $user = unserialize($serialized); - - $this->assertEquals(1, count($user->getPhonenumbers()), "Pre-Condition: 1 Phonenumber"); - - $ph2 = new CmsPhonenumber; - $ph2->phonenumber = "56789"; - $user->addPhonenumber($ph2); - $oldPhonenumbers = $user->getPhonenumbers(); - $this->assertEquals(2, count($oldPhonenumbers), "Pre-Condition: 2 Phonenumbers"); - $this->assertFalse($this->_em->contains($user)); - - $this->_em->persist($ph2); - - // Merge back in - $user = $this->_em->merge($user); // merge cascaded to phonenumbers - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $user->phonenumbers[0]->user); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $user->phonenumbers[1]->user); - $im = $this->_em->getUnitOfWork()->getIdentityMap(); - $this->_em->flush(); - - $this->assertTrue($this->_em->contains($user), "Failed to assert that merged user is contained inside EntityManager persistence context."); - $phonenumbers = $user->getPhonenumbers(); - $this->assertNotSame($oldPhonenumbers, $phonenumbers, "Merge should replace the Detached Collection with a new PersistentCollection."); - $this->assertEquals(2, count($phonenumbers), "Failed to assert that two phonenumbers are contained in the merged users phonenumber collection."); - - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsPhonenumber', $phonenumbers[1]); - $this->assertTrue($this->_em->contains($phonenumbers[1]), "Failed to assert that second phonenumber in collection is contained inside EntityManager persistence context."); - - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsPhonenumber', $phonenumbers[0]); - $this->assertTrue($this->_em->getUnitOfWork()->isInIdentityMap($phonenumbers[0])); - $this->assertTrue($this->_em->contains($phonenumbers[0]), "Failed to assert that first phonenumber in collection is contained inside EntityManager persistence context."); - } - - /** - * @group DDC-203 - */ - public function testDetachedEntityThrowsExceptionOnFlush() - { - $ph = new CmsPhonenumber(); - $ph->phonenumber = '12345'; - $this->_em->persist($ph); - $this->_em->flush(); - $this->_em->clear(); - $this->_em->persist($ph); - try { - $this->_em->flush(); - $this->fail(); - } catch (\Exception $expected) {} - } - - public function testUninitializedLazyAssociationsAreIgnoredOnMerge() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - - $address = new CmsAddress; - $address->city = 'Berlin'; - $address->country = 'Germany'; - $address->street = 'Sesamestreet'; - $address->zip = 12345; - $address->setUser($user); - $this->_em->persist($address); - $this->_em->persist($user); - - $this->_em->flush(); - $this->_em->clear(); - - $address2 = $this->_em->find(get_class($address), $address->id); - $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $address2->user); - $this->assertFalse($address2->user->__isInitialized__); - $detachedAddress2 = unserialize(serialize($address2)); - $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $detachedAddress2->user); - $this->assertFalse($detachedAddress2->user->__isInitialized__); - - $managedAddress2 = $this->_em->merge($detachedAddress2); - $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $managedAddress2->user); - $this->assertFalse($managedAddress2->user === $detachedAddress2->user); - $this->assertFalse($managedAddress2->user->__isInitialized__); - } - - /** - * @group DDC-822 - */ - public function testUseDetachedEntityAsQueryParameter() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - - $this->_em->persist($user); - - $this->_em->flush(); - $this->_em->detach($user); - - $dql = "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = ?1"; - $query = $this->_em->createQuery($dql); - $query->setParameter(1, $user); - - $newUser = $query->getSingleResult(); - - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $newUser); - $this->assertEquals('gblanco', $newUser->username); - } - - /** - * @group DDC-920 - */ - public function testDetachManagedUnpersistedEntity() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - - $this->_em->persist($user); - $this->_em->detach($user); - - $this->_em->flush(); - - $this->assertFalse($this->_em->contains($user)); - $this->assertFalse($this->_em->getUnitOfWork()->isInIdentityMap($user)); - } - - /** - * @group DDC-1340 - */ - public function testMergeArticleWrongVersion() - { - $article = new CmsArticle(); - $article->topic = "test"; - $article->text = "test"; - - $this->_em->persist($article); - $this->_em->flush(); - - $this->_em->detach($article); - - $sql = "UPDATE cms_articles SET version = version+1 WHERE id = " . $article->id; - $this->_em->getConnection()->executeUpdate($sql); - - $this->setExpectedException('Doctrine\ORM\OptimisticLockException', 'The optimistic lock failed, version 1 was expected, but is actually 2'); - $this->_em->merge($article); - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php deleted file mode 100644 index b14ccaa..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php +++ /dev/null @@ -1,505 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - public function tearDown() - { - if ($this->_em) { - $this->_em->getConfiguration()->setEntityNamespaces(array()); - } - parent::tearDown(); - } - - public function loadFixture() - { - $user = new CmsUser; - $user->name = 'Roman'; - $user->username = 'romanb'; - $user->status = 'freak'; - $this->_em->persist($user); - - $user2 = new CmsUser; - $user2->name = 'Guilherme'; - $user2->username = 'gblanco'; - $user2->status = 'dev'; - $this->_em->persist($user2); - - $user3 = new CmsUser; - $user3->name = 'Benjamin'; - $user3->username = 'beberlei'; - $user3->status = null; - $this->_em->persist($user3); - - $this->_em->flush(); - - $user1Id = $user->getId(); - - unset($user); - unset($user2); - unset($user3); - - $this->_em->clear(); - - return $user1Id; - } - - public function loadAssociatedFixture() - { - $address = new CmsAddress(); - $address->city = "Berlin"; - $address->country = "Germany"; - $address->street = "Foostreet"; - $address->zip = "12345"; - - $user = new CmsUser(); - $user->name = 'Roman'; - $user->username = 'romanb'; - $user->status = 'freak'; - $user->setAddress($address); - - $this->_em->persist($user); - $this->_em->persist($address); - $this->_em->flush(); - $this->_em->clear(); - - return array($user->id, $address->id); - } - - public function buildUser($name, $username, $status, $address) - { - $user = new CmsUser(); - $user->name = $name; - $user->username = $username; - $user->status = $status; - $user->setAddress($address); - - $this->_em->persist($user); - $this->_em->flush(); - - return $user; - } - - public function buildAddress($country, $city, $street, $zip) - { - $address = new CmsAddress(); - $address->country = $country; - $address->city = $city; - $address->street = $street; - $address->zip = $zip; - - $this->_em->persist($address); - $this->_em->flush(); - - return $address; - } - - public function testBasicFind() - { - $user1Id = $this->loadFixture(); - $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser'); - - $user = $repos->find($user1Id); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser',$user); - $this->assertEquals('Roman', $user->name); - $this->assertEquals('freak', $user->status); - } - - public function testFindByField() - { - $user1Id = $this->loadFixture(); - $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser'); - - $users = $repos->findBy(array('status' => 'dev')); - $this->assertEquals(1, count($users)); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser',$users[0]); - $this->assertEquals('Guilherme', $users[0]->name); - $this->assertEquals('dev', $users[0]->status); - } - - public function testFindByAssociationWithIntegerAsParameter() - { - $address1 = $this->buildAddress('Germany', 'Berlim', 'Foo st.', '123456'); - $user1 = $this->buildUser('Benjamin', 'beberlei', 'dev', $address1); - - $address2 = $this->buildAddress('Brazil', 'São Paulo', 'Bar st.', '654321'); - $user2 = $this->buildUser('Guilherme', 'guilhermeblanco', 'freak', $address2); - - $address3 = $this->buildAddress('USA', 'Nashville', 'Woo st.', '321654'); - $user3 = $this->buildUser('Jonathan', 'jwage', 'dev', $address3); - - unset($address1); - unset($address2); - unset($address3); - - $this->_em->clear(); - - $repository = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsAddress'); - $addresses = $repository->findBy(array('user' => array($user1->getId(), $user2->getId()))); - - $this->assertEquals(2, count($addresses)); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsAddress',$addresses[0]); - } - - public function testFindByAssociationWithObjectAsParameter() - { - $address1 = $this->buildAddress('Germany', 'Berlim', 'Foo st.', '123456'); - $user1 = $this->buildUser('Benjamin', 'beberlei', 'dev', $address1); - - $address2 = $this->buildAddress('Brazil', 'São Paulo', 'Bar st.', '654321'); - $user2 = $this->buildUser('Guilherme', 'guilhermeblanco', 'freak', $address2); - - $address3 = $this->buildAddress('USA', 'Nashville', 'Woo st.', '321654'); - $user3 = $this->buildUser('Jonathan', 'jwage', 'dev', $address3); - - unset($address1); - unset($address2); - unset($address3); - - $this->_em->clear(); - - $repository = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsAddress'); - $addresses = $repository->findBy(array('user' => array($user1, $user2))); - - $this->assertEquals(2, count($addresses)); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsAddress',$addresses[0]); - } - - public function testFindFieldByMagicCall() - { - $user1Id = $this->loadFixture(); - $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser'); - - $users = $repos->findByStatus('dev'); - $this->assertEquals(1, count($users)); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser',$users[0]); - $this->assertEquals('Guilherme', $users[0]->name); - $this->assertEquals('dev', $users[0]->status); - } - - public function testFindAll() - { - $user1Id = $this->loadFixture(); - $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser'); - - $users = $repos->findAll(); - $this->assertEquals(3, count($users)); - } - - public function testFindByAlias() - { - $user1Id = $this->loadFixture(); - $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser'); - - $this->_em->getConfiguration()->addEntityNamespace('CMS', 'Doctrine\Tests\Models\CMS'); - - $repos = $this->_em->getRepository('CMS:CmsUser'); - - $users = $repos->findAll(); - $this->assertEquals(3, count($users)); - } - - /** - * @expectedException \Doctrine\ORM\ORMException - */ - public function testExceptionIsThrownWhenCallingFindByWithoutParameter() { - $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser') - ->findByStatus(); - } - - /** - * @expectedException \Doctrine\ORM\ORMException - */ - public function testExceptionIsThrownWhenUsingInvalidFieldName() { - $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser') - ->findByThisFieldDoesNotExist('testvalue'); - } - - /** - * @group locking - * @group DDC-178 - */ - public function testPessimisticReadLockWithoutTransaction_ThrowsException() - { - $this->setExpectedException('Doctrine\ORM\TransactionRequiredException'); - - $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser') - ->find(1, \Doctrine\DBAL\LockMode::PESSIMISTIC_READ); - } - - /** - * @group locking - * @group DDC-178 - */ - public function testPessimisticWriteLockWithoutTransaction_ThrowsException() - { - $this->setExpectedException('Doctrine\ORM\TransactionRequiredException'); - - $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser') - ->find(1, \Doctrine\DBAL\LockMode::PESSIMISTIC_WRITE); - } - - /** - * @group locking - * @group DDC-178 - */ - public function testOptimisticLockUnversionedEntity_ThrowsException() - { - $this->setExpectedException('Doctrine\ORM\OptimisticLockException'); - - $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser') - ->find(1, \Doctrine\DBAL\LockMode::OPTIMISTIC); - } - - /** - * @group locking - * @group DDC-178 - */ - public function testIdentityMappedOptimisticLockUnversionedEntity_ThrowsException() - { - $user = new CmsUser; - $user->name = 'Roman'; - $user->username = 'romanb'; - $user->status = 'freak'; - $this->_em->persist($user); - $this->_em->flush(); - - $userId = $user->id; - - $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $userId); - - $this->setExpectedException('Doctrine\ORM\OptimisticLockException'); - $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $userId, \Doctrine\DBAL\LockMode::OPTIMISTIC); - } - - /** - * @group DDC-819 - */ - public function testFindMagicCallByNullValue() - { - $this->loadFixture(); - - $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser'); - - $users = $repos->findByStatus(null); - $this->assertEquals(1, count($users)); - } - - /** - * @group DDC-819 - */ - public function testInvalidMagicCall() - { - $this->setExpectedException('BadMethodCallException'); - - $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser'); - $repos->foo(); - } - - /** - * @group DDC-817 - */ - public function testFindByAssociationKey_ExceptionOnInverseSide() - { - list($userId, $addressId) = $this->loadAssociatedFixture(); - $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser'); - - $this->setExpectedException('Doctrine\ORM\ORMException', "You cannot search for the association field 'Doctrine\Tests\Models\CMS\CmsUser#address', because it is the inverse side of an association. Find methods only work on owning side associations."); - $user = $repos->findBy(array('address' => $addressId)); - } - - /** - * @group DDC-817 - */ - public function testFindOneByAssociationKey() - { - list($userId, $addressId) = $this->loadAssociatedFixture(); - $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsAddress'); - $address = $repos->findOneBy(array('user' => $userId)); - - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsAddress', $address); - $this->assertEquals($addressId, $address->id); - } - - /** - * @group DDC-817 - */ - public function testFindByAssociationKey() - { - list($userId, $addressId) = $this->loadAssociatedFixture(); - $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsAddress'); - $addresses = $repos->findBy(array('user' => $userId)); - - $this->assertContainsOnly('Doctrine\Tests\Models\CMS\CmsAddress', $addresses); - $this->assertEquals(1, count($addresses)); - $this->assertEquals($addressId, $addresses[0]->id); - } - - /** - * @group DDC-817 - */ - public function testFindAssociationByMagicCall() - { - list($userId, $addressId) = $this->loadAssociatedFixture(); - $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsAddress'); - $addresses = $repos->findByUser($userId); - - $this->assertContainsOnly('Doctrine\Tests\Models\CMS\CmsAddress', $addresses); - $this->assertEquals(1, count($addresses)); - $this->assertEquals($addressId, $addresses[0]->id); - } - - /** - * @group DDC-817 - */ - public function testFindOneAssociationByMagicCall() - { - list($userId, $addressId) = $this->loadAssociatedFixture(); - $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsAddress'); - $address = $repos->findOneByUser($userId); - - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsAddress', $address); - $this->assertEquals($addressId, $address->id); - } - - public function testValidNamedQueryRetrieval() - { - $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser'); - - $query = $repos->createNamedQuery('all'); - - $this->assertInstanceOf('Doctrine\ORM\Query', $query); - $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u', $query->getDQL()); - } - - public function testInvalidNamedQueryRetrieval() - { - $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser'); - - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException'); - - $repos->createNamedQuery('invalidNamedQuery'); - } - - /** - * @group DDC-1087 - */ - public function testIsNullCriteriaDoesNotGenerateAParameter() - { - $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser'); - $users = $repos->findBy(array('status' => null, 'username' => 'romanb')); - - $params = $this->_sqlLoggerStack->queries[$this->_sqlLoggerStack->currentQuery]['params']; - $this->assertEquals(1, count($params), "Should only execute with one parameter."); - $this->assertEquals(array('romanb'), $params); - } - - public function testIsNullCriteria() - { - $this->loadFixture(); - - $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser'); - - $users = $repos->findBy(array('status' => null)); - $this->assertEquals(1, count($users)); - } - - /** - * @group DDC-1094 - */ - public function testFindByLimitOffset() - { - $this->loadFixture(); - - $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser'); - - $users1 = $repos->findBy(array(), null, 1, 0); - $users2 = $repos->findBy(array(), null, 1, 1); - - $this->assertEquals(3, count($repos->findBy(array()))); - $this->assertEquals(1, count($users1)); - $this->assertEquals(1, count($users2)); - $this->assertNotSame($users1[0], $users2[0]); - } - - /** - * @group DDC-1094 - */ - public function testFindByOrderBy() - { - $this->loadFixture(); - - $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser'); - $usersAsc = $repos->findBy(array(), array("username" => "ASC")); - $usersDesc = $repos->findBy(array(), array("username" => "DESC")); - - $this->assertEquals(3, count($usersAsc), "Pre-condition: only three users in fixture"); - $this->assertEquals(3, count($usersDesc), "Pre-condition: only three users in fixture"); - $this->assertSame($usersAsc[0], $usersDesc[2]); - $this->assertSame($usersAsc[2], $usersDesc[0]); - } - - - /** - * @group DDC-753 - */ - public function testDefaultRepositoryClassName() - { - $this->assertEquals($this->_em->getConfiguration()->getDefaultRepositoryClassName(), "Doctrine\ORM\EntityRepository"); - $this->_em->getConfiguration()->setDefaultRepositoryClassName("Doctrine\Tests\Models\DDC753\DDC753DefaultRepository"); - $this->assertEquals($this->_em->getConfiguration()->getDefaultRepositoryClassName(), "Doctrine\Tests\Models\DDC753\DDC753DefaultRepository"); - - $repos = $this->_em->getRepository('Doctrine\Tests\Models\DDC753\DDC753EntityWithDefaultCustomRepository'); - $this->assertInstanceOf("Doctrine\Tests\Models\DDC753\DDC753DefaultRepository", $repos); - $this->assertTrue($repos->isDefaultRepository()); - - - $repos = $this->_em->getRepository('Doctrine\Tests\Models\DDC753\DDC753EntityWithCustomRepository'); - $this->assertInstanceOf("Doctrine\Tests\Models\DDC753\DDC753CustomRepository", $repos); - $this->assertTrue($repos->isCustomRepository()); - - $this->assertEquals($this->_em->getConfiguration()->getDefaultRepositoryClassName(), "Doctrine\Tests\Models\DDC753\DDC753DefaultRepository"); - $this->_em->getConfiguration()->setDefaultRepositoryClassName("Doctrine\ORM\EntityRepository"); - $this->assertEquals($this->_em->getConfiguration()->getDefaultRepositoryClassName(), "Doctrine\ORM\EntityRepository"); - - } - - - /** - * @group DDC-753 - * @expectedException Doctrine\ORM\ORMException - * @expectedExceptionMessage Invalid repository class 'Doctrine\Tests\Models\DDC753\DDC753InvalidRepository'. it must be a Doctrine\ORM\EntityRepository. - */ - public function testSetDefaultRepositoryInvalidClassError() - { - $this->assertEquals($this->_em->getConfiguration()->getDefaultRepositoryClassName(), "Doctrine\ORM\EntityRepository"); - $this->_em->getConfiguration()->setDefaultRepositoryClassName("Doctrine\Tests\Models\DDC753\DDC753InvalidRepository"); - } - - /** - * @group DDC-1500 - */ - public function testInvalidOrientation() - { - $this->setExpectedException('Doctrine\ORM\ORMException', 'Invalid order by orientation specified for Doctrine\Tests\Models\CMS\CmsUser#username'); - - $repo = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser'); - $repo->findBy(array('status' => 'test'), array('username' => 'INVALID')); - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php deleted file mode 100644 index f8b41e0..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php +++ /dev/null @@ -1,583 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - - $class = $this->_em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $class->associationMappings['groups']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; - $class->associationMappings['articles']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; - - $class = $this->_em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsGroup'); - $class->associationMappings['users']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; - - $this->loadFixture(); - } - - public function tearDown() - { - parent::tearDown(); - - $class = $this->_em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $class->associationMappings['groups']['fetch'] = ClassMetadataInfo::FETCH_LAZY; - $class->associationMappings['articles']['fetch'] = ClassMetadataInfo::FETCH_LAZY; - - $class = $this->_em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsGroup'); - $class->associationMappings['users']['fetch'] = ClassMetadataInfo::FETCH_LAZY; - } - - /** - * @group DDC-546 - */ - public function testCountNotInitializesCollection() - { - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - $queryCount = $this->getCurrentQueryCount(); - - $this->assertFalse($user->groups->isInitialized()); - $this->assertEquals(3, count($user->groups)); - $this->assertFalse($user->groups->isInitialized()); - - foreach ($user->groups AS $group) { } - - $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount(), "Expecting two queries to be fired for count, then iteration."); - } - - /** - * @group DDC-546 - */ - public function testCountWhenNewEntityPresent() - { - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - - $newGroup = new \Doctrine\Tests\Models\CMS\CmsGroup(); - $newGroup->name = "Test4"; - - $user->addGroup($newGroup); - $this->_em->persist($newGroup); - - $this->assertFalse($user->groups->isInitialized()); - $this->assertEquals(4, count($user->groups)); - $this->assertFalse($user->groups->isInitialized()); - } - - /** - * @group DDC-546 - */ - public function testCountWhenInitialized() - { - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - $queryCount = $this->getCurrentQueryCount(); - - foreach ($user->groups AS $group) { } - - $this->assertTrue($user->groups->isInitialized()); - $this->assertEquals(3, count($user->groups)); - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Should only execute one query to initialize colleciton, no extra query for count() more."); - } - - /** - * @group DDC-546 - */ - public function testCountInverseCollection() - { - $group = $this->_em->find('Doctrine\Tests\Models\CMS\CmsGroup', $this->groupId); - $this->assertFalse($group->users->isInitialized(), "Pre-Condition"); - - $this->assertEquals(4, count($group->users)); - $this->assertFalse($group->users->isInitialized(), "Extra Lazy collection should not be initialized by counting the collection."); - } - - /** - * @group DDC-546 - */ - public function testCountOneToMany() - { - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - $this->assertFalse($user->groups->isInitialized(), "Pre-Condition"); - - $this->assertEquals(2, count($user->articles)); - } - - /** - * @group DDC-546 - */ - public function testFullSlice() - { - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - $this->assertFalse($user->groups->isInitialized(), "Pre-Condition: Collection is not initialized."); - - $someGroups = $user->groups->slice(null); - $this->assertEquals(3, count($someGroups)); - } - - /** - * @group DDC-546 - */ - public function testSlice() - { - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - $this->assertFalse($user->groups->isInitialized(), "Pre-Condition: Collection is not initialized."); - - $queryCount = $this->getCurrentQueryCount(); - - $someGroups = $user->groups->slice(0, 2); - - $this->assertContainsOnly('Doctrine\Tests\Models\CMS\CmsGroup', $someGroups); - $this->assertEquals(2, count($someGroups)); - $this->assertFalse($user->groups->isInitialized(), "Slice should not initialize the collection if it wasn't before!"); - - $otherGroup = $user->groups->slice(2, 1); - - $this->assertContainsOnly('Doctrine\Tests\Models\CMS\CmsGroup', $otherGroup); - $this->assertEquals(1, count($otherGroup)); - $this->assertFalse($user->groups->isInitialized()); - - foreach ($user->groups AS $group) { } - - $this->assertTrue($user->groups->isInitialized()); - $this->assertEquals(3, count($user->groups)); - - $this->assertEquals($queryCount + 3, $this->getCurrentQueryCount()); - } - - /** - * @group DDC-546 - */ - public function testSliceInitializedCollection() - { - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - $queryCount = $this->getCurrentQueryCount(); - - foreach ($user->groups AS $group) { } - - $someGroups = $user->groups->slice(0, 2); - - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount()); - - $this->assertEquals(2, count($someGroups)); - $this->assertTrue($user->groups->contains($someGroups[0])); - $this->assertTrue($user->groups->contains($someGroups[1])); - } - - /** - * @group DDC-546 - */ - public function testSliceInverseCollection() - { - $group = $this->_em->find('Doctrine\Tests\Models\CMS\CmsGroup', $this->groupId); - $this->assertFalse($group->users->isInitialized(), "Pre-Condition"); - $queryCount = $this->getCurrentQueryCount(); - - $someUsers = $group->users->slice(0, 2); - $otherUsers = $group->users->slice(2, 2); - - $this->assertContainsOnly('Doctrine\Tests\Models\CMS\CmsUser', $someUsers); - $this->assertContainsOnly('Doctrine\Tests\Models\CMS\CmsUser', $otherUsers); - $this->assertEquals(2, count($someUsers)); - $this->assertEquals(2, count($otherUsers)); - - // +2 queries executed by slice - $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount(), "Slicing two parts should only execute two additional queries."); - } - - /** - * @group DDC-546 - */ - public function testSliceOneToMany() - { - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - $this->assertFalse($user->articles->isInitialized(), "Pre-Condition: Collection is not initialized."); - - $queryCount = $this->getCurrentQueryCount(); - - $someArticle = $user->articles->slice(0, 1); - $otherArticle = $user->articles->slice(1, 1); - - $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount()); - } - - /** - * @group DDC-546 - */ - public function testContainsOneToMany() - { - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - $this->assertFalse($user->articles->isInitialized(), "Pre-Condition: Collection is not initialized."); - - // Test One to Many existance retrieved from DB - $article = $this->_em->find('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId); - $queryCount = $this->getCurrentQueryCount(); - - $this->assertTrue($user->articles->contains($article)); - $this->assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized."); - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount()); - - // Test One to Many existance with state new - $article = new \Doctrine\Tests\Models\CMS\CmsArticle(); - $article->topic = "Testnew"; - $article->text = "blub"; - - $queryCount = $this->getCurrentQueryCount(); - $this->assertFalse($user->articles->contains($article)); - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Checking for contains of new entity should cause no query to be executed."); - - // Test One to Many existance with state clear - $this->_em->persist($article); - $this->_em->flush(); - - $queryCount = $this->getCurrentQueryCount(); - $this->assertFalse($user->articles->contains($article)); - $this->assertEquals($queryCount+1, $this->getCurrentQueryCount(), "Checking for contains of persisted entity should cause one query to be executed."); - $this->assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized."); - - // Test One to Many existance with state managed - $article = new \Doctrine\Tests\Models\CMS\CmsArticle(); - $article->topic = "How to not fail anymore on tests"; - $article->text = "That is simple! Just write more tests!"; - - $this->_em->persist($article); - - $queryCount = $this->getCurrentQueryCount(); - - $this->assertFalse($user->articles->contains($article)); - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Checking for contains of managed entity (but not persisted) should cause no query to be executed."); - $this->assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized."); - } - - /** - * @group DDC-546 - */ - public function testContainsManyToMany() - { - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - $this->assertFalse($user->groups->isInitialized(), "Pre-Condition: Collection is not initialized."); - - // Test Many to Many existance retrieved from DB - $group = $this->_em->find('Doctrine\Tests\Models\CMS\CmsGroup', $this->groupId); - $queryCount = $this->getCurrentQueryCount(); - - $this->assertTrue($user->groups->contains($group)); - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Checking for contains of managed entity should cause one query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); - - // Test Many to Many existance with state new - $group = new \Doctrine\Tests\Models\CMS\CmsGroup(); - $group->name = "A New group!"; - - $queryCount = $this->getCurrentQueryCount(); - - $this->assertFalse($user->groups->contains($group)); - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Checking for contains of new entity should cause no query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); - - // Test Many to Many existance with state clear - $this->_em->persist($group); - $this->_em->flush(); - - $queryCount = $this->getCurrentQueryCount(); - - $this->assertFalse($user->groups->contains($group)); - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Checking for contains of persisted entity should cause one query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); - - // Test Many to Many existance with state managed - $group = new \Doctrine\Tests\Models\CMS\CmsGroup(); - $group->name = "My managed group"; - - $this->_em->persist($group); - - $queryCount = $this->getCurrentQueryCount(); - - $this->assertFalse($user->groups->contains($group)); - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Checking for contains of managed entity (but not persisted) should cause no query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); - } - - /** - * @group DDC-546 - */ - public function testContainsManyToManyInverse() - { - $group = $this->_em->find('Doctrine\Tests\Models\CMS\CmsGroup', $this->groupId); - $this->assertFalse($group->users->isInitialized(), "Pre-Condition: Collection is not initialized."); - - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - - $queryCount = $this->getCurrentQueryCount(); - $this->assertTrue($group->users->contains($user)); - $this->assertEquals($queryCount+1, $this->getCurrentQueryCount(), "Checking for contains of managed entity should cause one query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); - - $newUser = new \Doctrine\Tests\Models\CMS\CmsUser(); - $newUser->name = "A New group!"; - - $queryCount = $this->getCurrentQueryCount(); - $this->assertFalse($group->users->contains($newUser)); - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Checking for contains of new entity should cause no query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); - } - - /** - * - */ - public function testRemoveElementOneToMany() - { - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - $this->assertFalse($user->articles->isInitialized(), "Pre-Condition: Collection is not initialized."); - - // Test One to Many removal with Entity retrieved from DB - $article = $this->_em->find('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId); - $queryCount = $this->getCurrentQueryCount(); - - $user->articles->removeElement($article); - - $this->assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized."); - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount()); - - // Test One to Many removal with Entity state as new - $article = new \Doctrine\Tests\Models\CMS\CmsArticle(); - $article->topic = "Testnew"; - $article->text = "blub"; - - $queryCount = $this->getCurrentQueryCount(); - - $user->articles->removeElement($article); - - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Removing a new entity should cause no query to be executed."); - - // Test One to Many removal with Entity state as clean - $this->_em->persist($article); - $this->_em->flush(); - - $queryCount = $this->getCurrentQueryCount(); - - $user->articles->removeElement($article); - - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Removing a persisted entity should cause one query to be executed."); - $this->assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized."); - - // Test One to Many removal with Entity state as managed - $article = new \Doctrine\Tests\Models\CMS\CmsArticle(); - $article->topic = "How to not fail anymore on tests"; - $article->text = "That is simple! Just write more tests!"; - - $this->_em->persist($article); - - $queryCount = $this->getCurrentQueryCount(); - - $user->articles->removeElement($article); - - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Removing a managed entity should cause no query to be executed."); - } - - /** - * - */ - public function testRemoveElementManyToMany() - { - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - $this->assertFalse($user->groups->isInitialized(), "Pre-Condition: Collection is not initialized."); - - // Test Many to Many removal with Entity retrieved from DB - $group = $this->_em->find('Doctrine\Tests\Models\CMS\CmsGroup', $this->groupId); - $queryCount = $this->getCurrentQueryCount(); - - $user->groups->removeElement($group); - - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Removing a persisted entity should cause one query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); - - // Test Many to Many removal with Entity state as new - $group = new \Doctrine\Tests\Models\CMS\CmsGroup(); - $group->name = "A New group!"; - - $queryCount = $this->getCurrentQueryCount(); - - $user->groups->removeElement($group); - - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Removing new entity should cause no query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); - - // Test Many to Many removal with Entity state as clean - $this->_em->persist($group); - $this->_em->flush(); - - $queryCount = $this->getCurrentQueryCount(); - - $user->groups->removeElement($group); - - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Removing a persisted entity should cause one query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); - - // Test Many to Many removal with Entity state as managed - $group = new \Doctrine\Tests\Models\CMS\CmsGroup(); - $group->name = "A New group!"; - - $this->_em->persist($group); - - $queryCount = $this->getCurrentQueryCount(); - - $user->groups->removeElement($group); - - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Removing a managed entity should cause no query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); - } - - /** - * - */ - public function testRemoveElementManyToManyInverse() - { - $group = $this->_em->find('Doctrine\Tests\Models\CMS\CmsGroup', $this->groupId); - $this->assertFalse($group->users->isInitialized(), "Pre-Condition: Collection is not initialized."); - - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - $queryCount = $this->getCurrentQueryCount(); - - $group->users->removeElement($user); - - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Removing a managed entity should cause one query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); - - $newUser = new \Doctrine\Tests\Models\CMS\CmsUser(); - $newUser->name = "A New group!"; - - $queryCount = $this->getCurrentQueryCount(); - - $group->users->removeElement($newUser); - - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Removing a new entity should cause no query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); - } - - /** - * @group DDC-1399 - */ - public function testCountAfterAddThenFlush() - { - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - - $newGroup = new \Doctrine\Tests\Models\CMS\CmsGroup(); - $newGroup->name = "Test4"; - - $user->addGroup($newGroup); - $this->_em->persist($newGroup); - - $this->assertFalse($user->groups->isInitialized()); - $this->assertEquals(4, count($user->groups)); - $this->assertFalse($user->groups->isInitialized()); - - $this->_em->flush(); - - $this->assertEquals(4, count($user->groups)); - } - - /** - * @group DDC-1462 - */ - public function testSliceOnDirtyCollection() - { - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - /* @var $user CmsUser */ - - $newGroup = new \Doctrine\Tests\Models\CMS\CmsGroup(); - $newGroup->name = "Test4"; - - $user->addGroup($newGroup); - $this->_em->persist($newGroup); - - $qc = $this->getCurrentQueryCount(); - $groups = $user->groups->slice(0, 10); - - $this->assertEquals(4, count($groups)); - $this->assertEquals($qc + 1, $this->getCurrentQueryCount()); - } - - private function loadFixture() - { - $user1 = new \Doctrine\Tests\Models\CMS\CmsUser(); - $user1->username = "beberlei"; - $user1->name = "Benjamin"; - $user1->status = "active"; - - $user2 = new \Doctrine\Tests\Models\CMS\CmsUser(); - $user2->username = "jwage"; - $user2->name = "Jonathan"; - $user2->status = "active"; - - $user3 = new \Doctrine\Tests\Models\CMS\CmsUser(); - $user3->username = "romanb"; - $user3->name = "Roman"; - $user3->status = "active"; - - $user4 = new \Doctrine\Tests\Models\CMS\CmsUser(); - $user4->username = "gblanco"; - $user4->name = "Guilherme"; - $user4->status = "active"; - - $this->_em->persist($user1); - $this->_em->persist($user2); - $this->_em->persist($user3); - $this->_em->persist($user4); - - $group1 = new \Doctrine\Tests\Models\CMS\CmsGroup(); - $group1->name = "Test1"; - - $group2 = new \Doctrine\Tests\Models\CMS\CmsGroup(); - $group2->name = "Test2"; - - $group3 = new \Doctrine\Tests\Models\CMS\CmsGroup(); - $group3->name = "Test3"; - - $user1->addGroup($group1); - $user1->addGroup($group2); - $user1->addGroup($group3); - - $user2->addGroup($group1); - $user3->addGroup($group1); - $user4->addGroup($group1); - - $this->_em->persist($group1); - $this->_em->persist($group2); - $this->_em->persist($group3); - - $article1 = new \Doctrine\Tests\Models\CMS\CmsArticle(); - $article1->topic = "Test"; - $article1->text = "Test"; - $article1->setAuthor($user1); - - $article2 = new \Doctrine\Tests\Models\CMS\CmsArticle(); - $article2->topic = "Test"; - $article2->text = "Test"; - $article2->setAuthor($user1); - - $this->_em->persist($article1); - $this->_em->persist($article2); - - $this->_em->flush(); - $this->_em->clear(); - - $this->articleId = $article1->id; - $this->userId = $user1->getId(); - $this->groupId = $group1->id; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/FlushEventTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/FlushEventTest.php deleted file mode 100644 index 8167e85..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/FlushEventTest.php +++ /dev/null @@ -1,94 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - public function testPersistNewEntitiesOnPreFlush() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - $this->_em->getEventManager()->addEventListener(Events::onFlush, new OnFlushListener); - - $user = new CmsUser; - $user->username = 'romanb'; - $user->name = 'Roman'; - $user->status = 'Dev'; - - $this->_em->persist($user); - - $this->assertEquals(0, $user->phonenumbers->count()); - - $this->_em->flush(); - - $this->assertEquals(1, $user->phonenumbers->count()); - $this->assertTrue($this->_em->contains($user->phonenumbers->get(0))); - $this->assertTrue($user->phonenumbers->get(0)->getUser() === $user); - - $this->assertFalse($user->phonenumbers->isDirty()); - - // Can be used together with SQL Logging to check that a subsequent flush has - // nothing to do. This proofs the correctness of the changes that happened in onFlush. - //echo "SECOND FLUSH"; - //$this->_em->flush(); - } -} - -class OnFlushListener -{ - public function onFlush(OnFlushEventArgs $args) - { - //echo "---preFlush".PHP_EOL; - - $em = $args->getEntityManager(); - $uow = $em->getUnitOfWork(); - - foreach ($uow->getScheduledEntityInsertions() as $entity) { - - if ($entity instanceof CmsUser) { - // Adds a phonenumber to every newly persisted CmsUser ... - - $phone = new CmsPhonenumber; - $phone->phonenumber = 12345; - // Update object model - $entity->addPhonenumber($phone); - // Invoke regular persist call - $em->persist($phone); - // Explicitly calculate the changeset since onFlush is raised - // after changeset calculation! - $uow->computeChangeSet($em->getClassMetadata(get_class($phone)), $phone); - - // Take a snapshot because the UoW wont do this for us, because - // the UoW did not visit this collection. - // Alternatively we could provide an ->addVisitedCollection() method - // on the UoW. - $entity->getPhonenumbers()->takeSnapshot(); - } - - /*foreach ($uow->getEntityChangeSet($entity) as $field => $change) { - list ($old, $new) = $change; - - var_dump($old); - }*/ - - } - } -} - - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/HydrationCacheTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/HydrationCacheTest.php deleted file mode 100644 index 8974211..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/HydrationCacheTest.php +++ /dev/null @@ -1,86 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - - $user = new CmsUser; - $user->name = "Benjamin"; - $user->username = "beberlei"; - $user->status = 'active'; - - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - } - - public function testHydrationCache() - { - $cache = new ArrayCache(); - $dql = "SELECT u FROM Doctrine\Tests\Models\Cms\CmsUser u"; - - $users = $this->_em->createQuery($dql) - ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)) - ->getResult(); - - $c = $this->getCurrentQueryCount(); - $users = $this->_em->createQuery($dql) - ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)) - ->getResult(); - - $this->assertEquals($c, $this->getCurrentQueryCount(), "Should not execute query. Its cached!"); - - $users = $this->_em->createQuery($dql) - ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)) - ->getArrayResult(); - - $this->assertEquals($c + 1, $this->getCurrentQueryCount(), "Hydration is part of cache key."); - - $users = $this->_em->createQuery($dql) - ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)) - ->getArrayResult(); - - $this->assertEquals($c + 1, $this->getCurrentQueryCount(), "Hydration now cached"); - - $users = $this->_em->createQuery($dql) - ->setHydrationCacheProfile(new QueryCacheProfile(null, 'cachekey', $cache)) - ->getArrayResult(); - - $this->assertTrue($cache->contains('cachekey'), 'Explicit cache key'); - - $users = $this->_em->createQuery($dql) - ->setHydrationCacheProfile(new QueryCacheProfile(null, 'cachekey', $cache)) - ->getArrayResult(); - $this->assertEquals($c + 2, $this->getCurrentQueryCount(), "Hydration now cached"); - } - - public function testHydrationParametersSerialization() - { - $cache = new ArrayCache(); - $user = new CmsUser(); - $user->id = 1; - - $dql = "SELECT u FROM Doctrine\Tests\Models\Cms\CmsUser u WHERE u.id = ?1"; - $query = $this->_em->createQuery($dql) - ->setParameter(1, $user) - ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache)); - - $query->getResult(); - $c = $this->getCurrentQueryCount(); - $query->getResult(); - $this->assertEquals($c, $this->getCurrentQueryCount(), "Should not execute query. Its cached!"); - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/IdentityMapTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/IdentityMapTest.php deleted file mode 100644 index 84d0064..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/IdentityMapTest.php +++ /dev/null @@ -1,288 +0,0 @@ - - */ -class IdentityMapTest extends \Doctrine\Tests\OrmFunctionalTestCase -{ - protected function setUp() { - $this->useModelSet('cms'); - parent::setUp(); - } - - public function testBasicIdentityManagement() - { - $user = new CmsUser; - $user->status = 'dev'; - $user->username = 'romanb'; - $user->name = 'Roman B.'; - - $address = new CmsAddress; - $address->country = 'de'; - $address->zip = 1234; - $address->city = 'Berlin'; - - $user->setAddress($address); - - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - - $user2 = $this->_em->find(get_class($user), $user->getId()); - $this->assertTrue($user2 !== $user); - $user3 = $this->_em->find(get_class($user), $user->getId()); - $this->assertTrue($user2 === $user3); - - $address2 = $this->_em->find(get_class($address), $address->getId()); - $this->assertTrue($address2 !== $address); - $address3 = $this->_em->find(get_class($address), $address->getId()); - $this->assertTrue($address2 === $address3); - - $this->assertTrue($user2->getAddress() === $address2); // !!! - } - - public function testSingleValuedAssociationIdentityMapBehaviorWithRefresh() - { - $address = new CmsAddress; - $address->country = 'de'; - $address->zip = '12345'; - $address->city = 'Berlin'; - - $user1 = new CmsUser; - $user1->status = 'dev'; - $user1->username = 'romanb'; - $user1->name = 'Roman B.'; - - $user2 = new CmsUser; - $user2->status = 'dev'; - $user2->username = 'gblanco'; - $user2->name = 'Guilherme Blanco'; - - $address->setUser($user1); - - $this->_em->persist($address); - $this->_em->persist($user1); - $this->_em->persist($user2); - $this->_em->flush(); - - $this->assertSame($user1, $address->user); - - //external update to CmsAddress - $this->_em->getConnection()->executeUpdate('update cms_addresses set user_id = ?', array($user2->getId())); - - // But we want to have this external change! - // Solution 1: refresh(), broken atm! - $this->_em->refresh($address); - - // Now the association should be "correct", referencing $user2 - $this->assertSame($user2, $address->user); - $this->assertSame($user2->address, $address); // check back reference also - - // Attention! refreshes can result in broken bidirectional associations! this is currently expected! - // $user1 still points to $address! - $this->assertSame($user1->address, $address); - } - - public function testSingleValuedAssociationIdentityMapBehaviorWithRefreshQuery() - { - $address = new CmsAddress; - $address->country = 'de'; - $address->zip = '12345'; - $address->city = 'Berlin'; - - $user1 = new CmsUser; - $user1->status = 'dev'; - $user1->username = 'romanb'; - $user1->name = 'Roman B.'; - - $user2 = new CmsUser; - $user2->status = 'dev'; - $user2->username = 'gblanco'; - $user2->name = 'Guilherme Blanco'; - - $address->setUser($user1); - - $this->_em->persist($address); - $this->_em->persist($user1); - $this->_em->persist($user2); - $this->_em->flush(); - - - $this->assertSame($user1, $address->user); - - //external update to CmsAddress - $this->_em->getConnection()->executeUpdate('update cms_addresses set user_id = ?', array($user2->getId())); - - //select - $q = $this->_em->createQuery('select a, u from Doctrine\Tests\Models\CMS\CmsAddress a join a.user u'); - $address2 = $q->getSingleResult(); - - $this->assertSame($address, $address2); - - // Should still be $user1 - $this->assertSame($user1, $address2->user); - $this->assertTrue($user2->address === null); - - // But we want to have this external change! - // Solution 2: Alternatively, a refresh query should work - $q = $this->_em->createQuery('select a, u from Doctrine\Tests\Models\CMS\CmsAddress a join a.user u'); - $q->setHint(Query::HINT_REFRESH, true); - $address3 = $q->getSingleResult(); - - $this->assertSame($address, $address3); // should still be the same, always from identity map - - // Now the association should be "correct", referencing $user2 - $this->assertSame($user2, $address2->user); - $this->assertSame($user2->address, $address2); // check back reference also - - // Attention! refreshes can result in broken bidirectional associations! this is currently expected! - // $user1 still points to $address2! - $this->assertSame($user1->address, $address2); - } - - public function testCollectionValuedAssociationIdentityMapBehaviorWithRefreshQuery() - { - $user = new CmsUser; - $user->status = 'dev'; - $user->username = 'romanb'; - $user->name = 'Roman B.'; - - $phone1 = new CmsPhonenumber; - $phone1->phonenumber = 123; - - $phone2 = new CmsPhonenumber; - $phone2->phonenumber = 234; - - $phone3 = new CmsPhonenumber; - $phone3->phonenumber = 345; - - $user->addPhonenumber($phone1); - $user->addPhonenumber($phone2); - $user->addPhonenumber($phone3); - - $this->_em->persist($user); // cascaded to phone numbers - $this->_em->flush(); - - $this->assertEquals(3, count($user->getPhonenumbers())); - $this->assertFalse($user->getPhonenumbers()->isDirty()); - - //external update to CmsAddress - $this->_em->getConnection()->executeUpdate('insert into cms_phonenumbers (phonenumber, user_id) VALUES (?,?)', array(999, $user->getId())); - - //select - $q = $this->_em->createQuery('select u, p from Doctrine\Tests\Models\CMS\CmsUser u join u.phonenumbers p'); - $user2 = $q->getSingleResult(); - - $this->assertSame($user, $user2); - - // Should still be the same 3 phonenumbers - $this->assertEquals(3, count($user2->getPhonenumbers())); - - // But we want to have this external change! - // Solution 1: refresh(). - //$this->_em->refresh($user2); broken atm! - // Solution 2: Alternatively, a refresh query should work - $q = $this->_em->createQuery('select u, p from Doctrine\Tests\Models\CMS\CmsUser u join u.phonenumbers p'); - $q->setHint(Query::HINT_REFRESH, true); - $user3 = $q->getSingleResult(); - - $this->assertSame($user, $user3); // should still be the same, always from identity map - - // Now the collection should be refreshed with correct count - $this->assertEquals(4, count($user3->getPhonenumbers())); - } - - public function testCollectionValuedAssociationIdentityMapBehaviorWithRefresh() - { - $user = new CmsUser; - $user->status = 'dev'; - $user->username = 'romanb'; - $user->name = 'Roman B.'; - - $phone1 = new CmsPhonenumber; - $phone1->phonenumber = 123; - - $phone2 = new CmsPhonenumber; - $phone2->phonenumber = 234; - - $phone3 = new CmsPhonenumber; - $phone3->phonenumber = 345; - - $user->addPhonenumber($phone1); - $user->addPhonenumber($phone2); - $user->addPhonenumber($phone3); - - $this->_em->persist($user); // cascaded to phone numbers - $this->_em->flush(); - - $this->assertEquals(3, count($user->getPhonenumbers())); - - //external update to CmsAddress - $this->_em->getConnection()->executeUpdate('insert into cms_phonenumbers (phonenumber, user_id) VALUES (?,?)', array(999, $user->getId())); - - //select - $q = $this->_em->createQuery('select u, p from Doctrine\Tests\Models\CMS\CmsUser u join u.phonenumbers p'); - $user2 = $q->getSingleResult(); - - $this->assertSame($user, $user2); - - // Should still be the same 3 phonenumbers - $this->assertEquals(3, count($user2->getPhonenumbers())); - - // But we want to have this external change! - // Solution 1: refresh(). - $this->_em->refresh($user2); - - $this->assertSame($user, $user2); // should still be the same, always from identity map - - // Now the collection should be refreshed with correct count - $this->assertEquals(4, count($user2->getPhonenumbers())); - } - - public function testReusedSplObjectHashDoesNotConfuseUnitOfWork() - { - $hash1 = $this->subRoutine($this->_em); - // Make sure cycles are collected NOW, because a PersistentCollection references - // its owner, hence without forcing gc on cycles now the object will not (yet) - // be garbage collected and thus the object hash is not reused. - // This is not a memory leak! - gc_collect_cycles(); - - $user1 = new CmsUser; - $user1->status = 'dev'; - $user1->username = 'jwage'; - $user1->name = 'Jonathan W.'; - $hash2 = spl_object_hash($user1); - $this->assertEquals($hash1, $hash2); // Hash reused! - $this->_em->persist($user1); - $this->_em->flush(); - } - - private function subRoutine($em) { - $user = new CmsUser; - $user->status = 'dev'; - $user->username = 'romanb'; - $user->name = 'Roman B.'; - $em->persist($user); - $em->flush(); - $em->remove($user); - $em->flush(); - - return spl_object_hash($user); - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/IndexByAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/IndexByAssociationTest.php deleted file mode 100644 index bca4ea5..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/IndexByAssociationTest.php +++ /dev/null @@ -1,105 +0,0 @@ -useModelSet('stockexchange'); - parent::setUp(); - $this->loadFixture(); - } - - public function loadFixture() - { - $this->market = new Market("Some Exchange"); - $stock1 = new Stock("AAPL", 10, $this->market); - $stock2 = new Stock("GOOG", 20, $this->market); - - $this->bond = new Bond("MyBond"); - $this->bond->addStock($stock1); - $this->bond->addStock($stock2); - - $this->_em->persist($this->market); - $this->_em->persist($stock1); - $this->_em->persist($stock2); - $this->_em->persist($this->bond); - $this->_em->flush(); - $this->_em->clear(); - } - - public function testManyToOneFinder() - { - /* @var $market Doctrine\Tests\Models\StockExchange\Market */ - $market = $this->_em->find('Doctrine\Tests\Models\StockExchange\Market', $this->market->getId()); - - $this->assertEquals(2, count($market->stocks)); - $this->assertTrue(isset($market->stocks['AAPL']), "AAPL symbol has to be key in indexed assocation."); - $this->assertTrue(isset($market->stocks['GOOG']), "GOOG symbol has to be key in indexed assocation."); - $this->assertEquals("AAPL", $market->stocks['AAPL']->getSymbol()); - $this->assertEquals("GOOG", $market->stocks['GOOG']->getSymbol()); - } - - public function testManyToOneDQL() - { - $dql = "SELECT m, s FROM Doctrine\Tests\Models\StockExchange\Market m JOIN m.stocks s WHERE m.id = ?1"; - $market = $this->_em->createQuery($dql)->setParameter(1, $this->market->getId())->getSingleResult(); - - $this->assertEquals(2, count($market->stocks)); - $this->assertTrue(isset($market->stocks['AAPL']), "AAPL symbol has to be key in indexed assocation."); - $this->assertTrue(isset($market->stocks['GOOG']), "GOOG symbol has to be key in indexed assocation."); - $this->assertEquals("AAPL", $market->stocks['AAPL']->getSymbol()); - $this->assertEquals("GOOG", $market->stocks['GOOG']->getSymbol()); - } - - public function testManyToMany() - { - $bond = $this->_em->find('Doctrine\Tests\Models\StockExchange\Bond', $this->bond->getId()); - - $this->assertEquals(2, count($bond->stocks)); - $this->assertTrue(isset($bond->stocks['AAPL']), "AAPL symbol has to be key in indexed assocation."); - $this->assertTrue(isset($bond->stocks['GOOG']), "GOOG symbol has to be key in indexed assocation."); - $this->assertEquals("AAPL", $bond->stocks['AAPL']->getSymbol()); - $this->assertEquals("GOOG", $bond->stocks['GOOG']->getSymbol()); - } - - public function testManytoManyDQL() - { - $dql = "SELECT b, s FROM Doctrine\Tests\Models\StockExchange\Bond b JOIN b.stocks s WHERE b.id = ?1"; - $bond = $this->_em->createQuery($dql)->setParameter(1, $this->bond->getId())->getSingleResult(); - - $this->assertEquals(2, count($bond->stocks)); - $this->assertTrue(isset($bond->stocks['AAPL']), "AAPL symbol has to be key in indexed assocation."); - $this->assertTrue(isset($bond->stocks['GOOG']), "GOOG symbol has to be key in indexed assocation."); - $this->assertEquals("AAPL", $bond->stocks['AAPL']->getSymbol()); - $this->assertEquals("GOOG", $bond->stocks['GOOG']->getSymbol()); - } - - public function testDqlOverrideIndexBy() - { - $dql = "SELECT b, s FROM Doctrine\Tests\Models\StockExchange\Bond b JOIN b.stocks s INDEX BY s.id WHERE b.id = ?1"; - $bond = $this->_em->createQuery($dql)->setParameter(1, $this->bond->getId())->getSingleResult(); - - $this->assertEquals(2, count($bond->stocks)); - $this->assertFalse(isset($bond->stocks['AAPL']), "AAPL symbol not exists in re-indexed assocation."); - $this->assertFalse(isset($bond->stocks['GOOG']), "GOOG symbol not exists in re-indexed assocation."); - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php deleted file mode 100644 index 230f562..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php +++ /dev/null @@ -1,311 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\LifecycleCallbackTestEntity'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\LifecycleCallbackTestUser'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\LifecycleCallbackCascader'), - )); - } catch (\Exception $e) { - // Swallow all exceptions. We do not test the schema tool here. - } - } - - public function testPreSavePostSaveCallbacksAreInvoked() - { - $entity = new LifecycleCallbackTestEntity; - $entity->value = 'hello'; - $this->_em->persist($entity); - $this->_em->flush(); - - $this->assertTrue($entity->prePersistCallbackInvoked); - $this->assertTrue($entity->postPersistCallbackInvoked); - - $this->_em->clear(); - - $query = $this->_em->createQuery("select e from Doctrine\Tests\ORM\Functional\LifecycleCallbackTestEntity e"); - $result = $query->getResult(); - $this->assertTrue($result[0]->postLoadCallbackInvoked); - - $result[0]->value = 'hello again'; - - $this->_em->flush(); - - $this->assertEquals('changed from preUpdate callback!', $result[0]->value); - } - - public function testPreFlushCallbacksAreInvoked() - { - $entity = new LifecycleCallbackTestEntity; - $entity->value = 'hello'; - $this->_em->persist($entity); - - $this->_em->flush(); - - $this->assertTrue($entity->prePersistCallbackInvoked); - $this->assertTrue($entity->preFlushCallbackInvoked); - - $entity->preFlushCallbackInvoked = false; - $this->_em->flush(); - - $this->assertTrue($entity->preFlushCallbackInvoked); - - $entity->value = 'bye'; - $entity->preFlushCallbackInvoked = false; - $this->_em->flush(); - - $this->assertTrue($entity->preFlushCallbackInvoked); - } - - public function testChangesDontGetLost() - { - $user = new LifecycleCallbackTestUser; - $user->setName('Bob'); - $user->setValue('value'); - $this->_em->persist($user); - $this->_em->flush(); - - $user->setName('Alice'); - $this->_em->flush(); // Triggers preUpdate - - $this->_em->clear(); - - $user2 = $this->_em->find(get_class($user), $user->getId()); - - $this->assertEquals('Alice', $user2->getName()); - $this->assertEquals('Hello World', $user2->getValue()); - } - - /** - * @group DDC-194 - */ - public function testGetReferenceWithPostLoadEventIsDelayedUntilProxyTrigger() - { - $entity = new LifecycleCallbackTestEntity; - $entity->value = 'hello'; - $this->_em->persist($entity); - $this->_em->flush(); - $id = $entity->getId(); - - $this->_em->clear(); - - $reference = $this->_em->getReference('Doctrine\Tests\ORM\Functional\LifecycleCallbackTestEntity', $id); - $this->assertFalse($reference->postLoadCallbackInvoked); - - $reference->getValue(); // trigger proxy load - $this->assertTrue($reference->postLoadCallbackInvoked); - } - - /** - * @group DDC-958 - */ - public function testPostLoadTriggeredOnRefresh() - { - $entity = new LifecycleCallbackTestEntity; - $entity->value = 'hello'; - $this->_em->persist($entity); - $this->_em->flush(); - $id = $entity->getId(); - - $this->_em->clear(); - - $reference = $this->_em->find('Doctrine\Tests\ORM\Functional\LifecycleCallbackTestEntity', $id); - $this->assertTrue($reference->postLoadCallbackInvoked); - $reference->postLoadCallbackInvoked = false; - - $this->_em->refresh($reference); - $this->assertTrue($reference->postLoadCallbackInvoked, "postLoad should be invoked when refresh() is called."); - } - - /** - * @group DDC-113 - */ - public function testCascadedEntitiesCallsPrePersist() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - - $e1 = new LifecycleCallbackTestEntity; - $e2 = new LifecycleCallbackTestEntity; - - $c = new LifecycleCallbackCascader(); - $this->_em->persist($c); - - $c->entities[] = $e1; - $c->entities[] = $e2; - $e1->cascader = $c; - $e2->cascader = $c; - - //$this->_em->persist($c); - $this->_em->flush(); - - $this->assertTrue($e1->prePersistCallbackInvoked); - $this->assertTrue($e2->prePersistCallbackInvoked); - } - - public function testLifecycleCallbacksGetInherited() - { - $childMeta = $this->_em->getClassMetadata(__NAMESPACE__ . '\LifecycleCallbackChildEntity'); - $this->assertEquals(array('prePersist' => array(0 => 'doStuff')), $childMeta->lifecycleCallbacks); - } - - public function testLifecycleListener_ChangeUpdateChangeSet() - { - $listener = new LifecycleListenerPreUpdate; - $this->_em->getEventManager()->addEventListener(array('preUpdate'), $listener); - - $user = new LifecycleCallbackTestUser; - $user->setName('Bob'); - $user->setValue('value'); - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - - $dql = "SELECT u FROM Doctrine\Tests\ORM\Functional\LifecycleCallbackTestUser u WHERE u.name = 'Bob'"; - $bob = $this->_em->createQuery($dql)->getSingleResult(); - $bob->setName('Alice'); - - $this->_em->flush(); // preUpdate reverts Alice to Bob - $this->_em->clear(); - - $this->_em->getEventManager()->removeEventListener(array('preUpdate'), $listener); - - $bob = $this->_em->createQuery($dql)->getSingleResult(); - - $this->assertEquals('Bob', $bob->getName()); - } -} - -/** @Entity @HasLifecycleCallbacks */ -class LifecycleCallbackTestUser { - /** @Id @Column(type="integer") @GeneratedValue */ - private $id; - /** @Column(type="string") */ - private $value; - /** @Column(type="string") */ - private $name; - public function getId() {return $this->id;} - public function getValue() {return $this->value;} - public function setValue($value) {$this->value = $value;} - public function getName() {return $this->name;} - public function setName($name) {$this->name = $name;} - /** @PreUpdate */ - public function testCallback() {$this->value = 'Hello World';} -} - -/** - * @Entity - * @HasLifecycleCallbacks - * @Table(name="lc_cb_test_entity") - */ -class LifecycleCallbackTestEntity -{ - /* test stuff */ - public $prePersistCallbackInvoked = false; - public $postPersistCallbackInvoked = false; - public $postLoadCallbackInvoked = false; - - public $preFlushCallbackInvoked = false; - - /** - * @Id @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - private $id; - /** - * @Column(type="string", nullable=true) - */ - public $value; - - /** - * @ManyToOne(targetEntity="LifecycleCallbackCascader") - * @JoinColumn(name="cascader_id", referencedColumnName="id") - */ - public $cascader; - - public function getId() { - return $this->id; - } - - public function getValue() { - return $this->value; - } - - /** @PrePersist */ - public function doStuffOnPrePersist() { - $this->prePersistCallbackInvoked = true; - } - - /** @PostPersist */ - public function doStuffOnPostPersist() { - $this->postPersistCallbackInvoked = true; - } - - /** @PostLoad */ - public function doStuffOnPostLoad() { - $this->postLoadCallbackInvoked = true; - } - - /** @PreUpdate */ - public function doStuffOnPreUpdate() { - $this->value = 'changed from preUpdate callback!'; - } - - /** @PreFlush */ - public function doStuffOnPreFlush() { - $this->preFlushCallbackInvoked = true; - } -} - -/** - * @Entity - * @Table(name="lc_cb_test_cascade") - */ -class LifecycleCallbackCascader -{ - /** - * @Id @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - private $id; - - /** - * @OneToMany(targetEntity="LifecycleCallbackTestEntity", mappedBy="cascader", cascade={"persist"}) - */ - public $entities; - - public function __construct() - { - $this->entities = new \Doctrine\Common\Collections\ArrayCollection(); - } -} - -/** @MappedSuperclass @HasLifecycleCallbacks */ -class LifecycleCallbackParentEntity { - /** @PrePersist */ - function doStuff() { - - } -} - -/** @Entity @Table(name="lc_cb_childentity") */ -class LifecycleCallbackChildEntity extends LifecycleCallbackParentEntity { - /** @Id @Column(type="integer") @GeneratedValue */ - private $id; -} - -class LifecycleListenerPreUpdate -{ - public function preUpdate(PreUpdateEventArgs $eventArgs) - { - $eventArgs->setNewValue('name', 'Bob'); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/GearmanLockTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/GearmanLockTest.php deleted file mode 100644 index a67a44d..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/GearmanLockTest.php +++ /dev/null @@ -1,180 +0,0 @@ -markTestSkipped('pecl/gearman is required for this test to run.'); - } - - $this->useModelSet('cms'); - parent::setUp(); - $this->tasks = array(); - - $this->gearman = new \GearmanClient(); - $this->gearman->addServer(); - $this->gearman->setCompleteCallback(array($this, "gearmanTaskCompleted")); - - $article = new CmsArticle(); - $article->text = "my article"; - $article->topic = "Hello"; - - $this->_em->persist($article); - $this->_em->flush(); - - $this->articleId = $article->id; - } - - public function gearmanTaskCompleted($task) - { - $this->maxRunTime = max($this->maxRunTime, $task->data()); - } - - public function testFindWithLock() - { - $this->asyncFindWithLock('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId, LockMode::PESSIMISTIC_WRITE); - $this->asyncFindWithLock('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId, LockMode::PESSIMISTIC_WRITE); - - $this->assertLockWorked(); - } - - public function testFindWithWriteThenReadLock() - { - $this->asyncFindWithLock('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId, LockMode::PESSIMISTIC_WRITE); - $this->asyncFindWithLock('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId, LockMode::PESSIMISTIC_READ); - - $this->assertLockWorked(); - } - - public function testFindWithReadThenWriteLock() - { - $this->asyncFindWithLock('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId, LockMode::PESSIMISTIC_READ); - $this->asyncFindWithLock('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId, LockMode::PESSIMISTIC_WRITE); - - $this->assertLockWorked(); - } - - public function testFindWithOneLock() - { - $this->asyncFindWithLock('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId, LockMode::PESSIMISTIC_WRITE); - $this->asyncFindWithLock('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId, LockMode::NONE); - - $this->assertLockDoesNotBlock(); - } - - public function testDqlWithLock() - { - $this->asyncDqlWithLock('SELECT a FROM Doctrine\Tests\Models\CMS\CmsArticle a', array(), LockMode::PESSIMISTIC_WRITE); - $this->asyncFindWithLock('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId, LockMode::PESSIMISTIC_WRITE); - - $this->assertLockWorked(); - } - - public function testLock() - { - $this->asyncFindWithLock('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId, LockMode::PESSIMISTIC_WRITE); - $this->asyncLock('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId, LockMode::PESSIMISTIC_WRITE); - - $this->assertLockWorked(); - } - - public function testLock2() - { - $this->asyncFindWithLock('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId, LockMode::PESSIMISTIC_WRITE); - $this->asyncLock('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId, LockMode::PESSIMISTIC_READ); - - $this->assertLockWorked(); - } - - public function testLock3() - { - $this->asyncFindWithLock('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId, LockMode::PESSIMISTIC_READ); - $this->asyncLock('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId, LockMode::PESSIMISTIC_WRITE); - - $this->assertLockWorked(); - } - - public function testLock4() - { - $this->asyncFindWithLock('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId, LockMode::NONE); - $this->asyncLock('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId, LockMode::PESSIMISTIC_WRITE); - - $this->assertLockDoesNotBlock(); - } - - protected function assertLockDoesNotBlock() - { - $this->assertLockWorked($onlyForSeconds = 1); - } - - protected function assertLockWorked($forTime = 2, $notLongerThan = null) - { - if ($notLongerThan === null) { - $notLongerThan = $forTime + 1; - } - - $this->gearman->runTasks(); - - $this->assertTrue($this->maxRunTime > $forTime, - "Because of locking this tests should have run at least " . $forTime . " seconds, ". - "but only did for " . $this->maxRunTime . " seconds."); - $this->assertTrue($this->maxRunTime < $notLongerThan, - "The longest task should not run longer than " . $notLongerThan . " seconds, ". - "but did for " . $this->maxRunTime . " seconds." - ); - } - - protected function asyncFindWithLock($entityName, $entityId, $lockMode) - { - $this->startJob('findWithLock', array( - 'entityName' => $entityName, - 'entityId' => $entityId, - 'lockMode' => $lockMode, - )); - } - - protected function asyncDqlWithLock($dql, $params, $lockMode) - { - $this->startJob('dqlWithLock', array( - 'dql' => $dql, - 'dqlParams' => $params, - 'lockMode' => $lockMode, - )); - } - - protected function asyncLock($entityName, $entityId, $lockMode) - { - $this->startJob('lock', array( - 'entityName' => $entityName, - 'entityId' => $entityId, - 'lockMode' => $lockMode, - )); - } - - protected function startJob($fn, $fixture) - { - $this->gearman->addTask($fn, serialize(array( - 'conn' => $this->_em->getConnection()->getParams(), - 'fixture' => $fixture - ))); - - $this->assertEquals(GEARMAN_SUCCESS, $this->gearman->returnCode()); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/LockAgentWorker.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/LockAgentWorker.php deleted file mode 100644 index 146f2db..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/LockAgentWorker.php +++ /dev/null @@ -1,112 +0,0 @@ -addServer(); - $worker->addFunction("findWithLock", array($lockAgent, "findWithLock")); - $worker->addFunction("dqlWithLock", array($lockAgent, "dqlWithLock")); - $worker->addFunction('lock', array($lockAgent, 'lock')); - - while($worker->work()) { - if ($worker->returnCode() != GEARMAN_SUCCESS) { - echo "return_code: " . $worker->returnCode() . "\n"; - break; - } - } - } - - protected function process($job, \Closure $do) - { - $fixture = $this->processWorkload($job); - - $s = microtime(true); - $this->em->beginTransaction(); - $do($fixture, $this->em); - - sleep(1); - $this->em->rollback(); - $this->em->clear(); - $this->em->close(); - $this->em->getConnection()->close(); - - return (microtime(true) - $s); - } - - public function findWithLock($job) - { - return $this->process($job, function($fixture, $em) { - $entity = $em->find($fixture['entityName'], $fixture['entityId'], $fixture['lockMode']); - }); - } - - public function dqlWithLock($job) - { - return $this->process($job, function($fixture, $em) { - /* @var $query Doctrine\ORM\Query */ - $query = $em->createQuery($fixture['dql']); - $query->setLockMode($fixture['lockMode']); - $query->setParameters($fixture['dqlParams']); - $result = $query->getResult(); - }); - } - - public function lock($job) - { - return $this->process($job, function($fixture, $em) { - $entity = $em->find($fixture['entityName'], $fixture['entityId']); - $em->lock($entity, $fixture['lockMode']); - }); - } - - protected function processWorkload($job) - { - echo "Received job: " . $job->handle() . " for function " . $job->functionName() . "\n"; - - $workload = $job->workload(); - $workload = unserialize($workload); - - if (!isset($workload['conn']) || !is_array($workload['conn'])) { - throw new \InvalidArgumentException("Missing Database parameters"); - } - - $this->em = $this->createEntityManager($workload['conn']); - - if (!isset($workload['fixture'])) { - throw new \InvalidArgumentException("Missing Fixture parameters"); - } - return $workload['fixture']; - } - - protected function createEntityManager($conn) - { - $config = new \Doctrine\ORM\Configuration(); - $config->setProxyDir(__DIR__ . '/../../../Proxies'); - $config->setProxyNamespace('MyProject\Proxies'); - $config->setAutoGenerateProxyClasses(true); - - $annotDriver = $config->newDefaultAnnotationDriver(array(__DIR__ . '/../../../Models/')); - $config->setMetadataDriverImpl($annotDriver); - - $cache = new \Doctrine\Common\Cache\ArrayCache(); - $config->setMetadataCacheImpl($cache); - $config->setQueryCacheImpl($cache); - $config->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger()); - - $em = \Doctrine\ORM\EntityManager::create($conn, $config); - - return $em; - } -} - -LockAgentWorker::run(); \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/LockTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/LockTest.php deleted file mode 100644 index 2155809..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/LockTest.php +++ /dev/null @@ -1,184 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - $this->handles = array(); - } - - /** - * @group DDC-178 - * @group locking - */ - public function testLockVersionedEntity() { - $article = new CmsArticle(); - $article->text = "my article"; - $article->topic = "Hello"; - - $this->_em->persist($article); - $this->_em->flush(); - - $this->_em->lock($article, LockMode::OPTIMISTIC, $article->version); - } - - /** - * @group DDC-178 - * @group locking - */ - public function testLockVersionedEntity_MissmatchThrowsException() { - $article = new CmsArticle(); - $article->text = "my article"; - $article->topic = "Hello"; - - $this->_em->persist($article); - $this->_em->flush(); - - $this->setExpectedException('Doctrine\ORM\OptimisticLockException'); - $this->_em->lock($article, LockMode::OPTIMISTIC, $article->version + 1); - } - - /** - * @group DDC-178 - * @group locking - */ - public function testLockUnversionedEntity_ThrowsException() { - $user = new CmsUser(); - $user->name = "foo"; - $user->status = "active"; - $user->username = "foo"; - - $this->_em->persist($user); - $this->_em->flush(); - - $this->setExpectedException('Doctrine\ORM\OptimisticLockException'); - $this->_em->lock($user, LockMode::OPTIMISTIC); - } - - /** - * @group DDC-178 - * @group locking - */ - public function testLockUnmanagedEntity_ThrowsException() { - $article = new CmsArticle(); - - $this->setExpectedException('InvalidArgumentException', 'Entity Doctrine\Tests\Models\CMS\CmsArticle'); - $this->_em->lock($article, LockMode::OPTIMISTIC, $article->version + 1); - } - - /** - * @group DDC-178 - * @group locking - */ - public function testLockPessimisticRead_NoTransaction_ThrowsException() { - $article = new CmsArticle(); - $article->text = "my article"; - $article->topic = "Hello"; - - $this->_em->persist($article); - $this->_em->flush(); - - $this->setExpectedException('Doctrine\ORM\TransactionRequiredException'); - $this->_em->lock($article, LockMode::PESSIMISTIC_READ); - } - - /** - * @group DDC-178 - * @group locking - */ - public function testLockPessimisticWrite_NoTransaction_ThrowsException() { - $article = new CmsArticle(); - $article->text = "my article"; - $article->topic = "Hello"; - - $this->_em->persist($article); - $this->_em->flush(); - - $this->setExpectedException('Doctrine\ORM\TransactionRequiredException'); - $this->_em->lock($article, LockMode::PESSIMISTIC_WRITE); - } - - /** - * @group DDC-178 - * @group locking - */ - public function testLockPessimisticWrite() { - $writeLockSql = $this->_em->getConnection()->getDatabasePlatform()->getWriteLockSql(); - if (strlen($writeLockSql) == 0) { - $this->markTestSkipped('Database Driver has no Write Lock support.'); - } - - $article = new CmsArticle(); - $article->text = "my article"; - $article->topic = "Hello"; - - $this->_em->persist($article); - $this->_em->flush(); - - $this->_em->beginTransaction(); - try { - $this->_em->lock($article, LockMode::PESSIMISTIC_WRITE); - $this->_em->commit(); - } catch (\Exception $e) { - $this->_em->rollback(); - throw $e; - } - - $query = array_pop( $this->_sqlLoggerStack->queries ); - $this->assertContains($writeLockSql, $query['sql']); - } - - /** - * @group DDC-178 - */ - public function testLockPessimisticRead() { - $readLockSql = $this->_em->getConnection()->getDatabasePlatform()->getReadLockSql(); - if (strlen($readLockSql) == 0) { - $this->markTestSkipped('Database Driver has no Write Lock support.'); - } - - $article = new CmsArticle(); - $article->text = "my article"; - $article->topic = "Hello"; - - $this->_em->persist($article); - $this->_em->flush(); - - $this->_em->beginTransaction(); - try { - $this->_em->lock($article, LockMode::PESSIMISTIC_READ); - $this->_em->commit(); - } catch (\Exception $e) { - $this->_em->rollback(); - throw $e; - } - - $query = array_pop( $this->_sqlLoggerStack->queries ); - $this->assertContains($readLockSql, $query['sql']); - } - - /** - * @group DDC-1693 - */ - public function testLockOptimisticNonVersionedThrowsExceptionInDQL() - { - $dql = "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username = 'gblanco'"; - - $this->setExpectedException('Doctrine\ORM\OptimisticLockException', 'The optimistic lock on an entity failed.'); - $sql = $this->_em->createQuery($dql)->setHint( - \Doctrine\ORM\Query::HINT_LOCK_MODE, \Doctrine\DBAL\LockMode::OPTIMISTIC - )->getSQL(); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/OptimisticTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/OptimisticTest.php deleted file mode 100644 index e2341a1..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/OptimisticTest.php +++ /dev/null @@ -1,277 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\Locking\OptimisticJoinedParent'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\Locking\OptimisticJoinedChild'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\Locking\OptimisticStandard'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\Locking\OptimisticTimestamp') - )); - } catch (\Exception $e) { - // Swallow all exceptions. We do not test the schema tool here. - } - $this->_conn = $this->_em->getConnection(); - } - - public function testJoinedChildInsertSetsInitialVersionValue() - { - $test = new OptimisticJoinedChild(); - $test->name = 'child'; - $test->whatever = 'whatever'; - $this->_em->persist($test); - $this->_em->flush(); - - $this->assertEquals(1, $test->version); - - return $test; - } - - /** - * @depends testJoinedChildInsertSetsInitialVersionValue - */ - public function testJoinedChildFailureThrowsException(OptimisticJoinedChild $child) - { - $q = $this->_em->createQuery('SELECT t FROM Doctrine\Tests\ORM\Functional\Locking\OptimisticJoinedChild t WHERE t.id = :id'); - $q->setParameter('id', $child->id); - $test = $q->getSingleResult(); - - // Manually update/increment the version so we can try and save the same - // $test and make sure the exception is thrown saying the record was - // changed or updated since you read it - $this->_conn->executeQuery('UPDATE optimistic_joined_parent SET version = ? WHERE id = ?', array(2, $test->id)); - - // Now lets change a property and try and save it again - $test->whatever = 'ok'; - try { - $this->_em->flush(); - } catch (OptimisticLockException $e) { - $this->assertSame($test, $e->getEntity()); - } - } - - public function testJoinedParentInsertSetsInitialVersionValue() - { - $test = new OptimisticJoinedParent(); - $test->name = 'parent'; - $this->_em->persist($test); - $this->_em->flush(); - - $this->assertEquals(1, $test->version); - - return $test; - } - - /** - * @depends testJoinedParentInsertSetsInitialVersionValue - */ - public function testJoinedParentFailureThrowsException(OptimisticJoinedParent $parent) - { - $q = $this->_em->createQuery('SELECT t FROM Doctrine\Tests\ORM\Functional\Locking\OptimisticJoinedParent t WHERE t.id = :id'); - $q->setParameter('id', $parent->id); - $test = $q->getSingleResult(); - - // Manually update/increment the version so we can try and save the same - // $test and make sure the exception is thrown saying the record was - // changed or updated since you read it - $this->_conn->executeQuery('UPDATE optimistic_joined_parent SET version = ? WHERE id = ?', array(2, $test->id)); - - // Now lets change a property and try and save it again - $test->name = 'WHATT???'; - try { - $this->_em->flush(); - } catch (OptimisticLockException $e) { - $this->assertSame($test, $e->getEntity()); - } - } - - public function testMultipleFlushesDoIncrementalUpdates() - { - $test = new OptimisticStandard(); - - for ($i = 0; $i < 5; $i++) { - $test->name = 'test' . $i; - $this->_em->persist($test); - $this->_em->flush(); - - $this->assertInternalType('int', $test->getVersion()); - $this->assertEquals($i + 1, $test->getVersion()); - } - } - - public function testStandardInsertSetsInitialVersionValue() - { - $test = new OptimisticStandard(); - $test->name = 'test'; - $this->_em->persist($test); - $this->_em->flush(); - - $this->assertInternalType('int', $test->getVersion()); - $this->assertEquals(1, $test->getVersion()); - - return $test; - } - - /** - * @depends testStandardInsertSetsInitialVersionValue - */ - public function testStandardFailureThrowsException(OptimisticStandard $entity) - { - $q = $this->_em->createQuery('SELECT t FROM Doctrine\Tests\ORM\Functional\Locking\OptimisticStandard t WHERE t.id = :id'); - $q->setParameter('id', $entity->id); - $test = $q->getSingleResult(); - - // Manually update/increment the version so we can try and save the same - // $test and make sure the exception is thrown saying the record was - // changed or updated since you read it - $this->_conn->executeQuery('UPDATE optimistic_standard SET version = ? WHERE id = ?', array(2, $test->id)); - - // Now lets change a property and try and save it again - $test->name = 'WHATT???'; - try { - $this->_em->flush(); - } catch (OptimisticLockException $e) { - $this->assertSame($test, $e->getEntity()); - } - } - - public function testOptimisticTimestampSetsDefaultValue() - { - $test = new OptimisticTimestamp(); - $test->name = 'Testing'; - - $this->assertNull($test->version, "Pre-Condition"); - - $this->_em->persist($test); - $this->_em->flush(); - - $this->assertInstanceOf('DateTime', $test->version); - - return $test; - } - - /** - * @depends testOptimisticTimestampSetsDefaultValue - */ - public function testOptimisticTimestampFailureThrowsException(OptimisticTimestamp $entity) - { - $q = $this->_em->createQuery('SELECT t FROM Doctrine\Tests\ORM\Functional\Locking\OptimisticTimestamp t WHERE t.id = :id'); - $q->setParameter('id', $entity->id); - $test = $q->getSingleResult(); - - $this->assertInstanceOf('DateTime', $test->version); - - // Manually increment the version datetime column - $format = $this->_em->getConnection()->getDatabasePlatform()->getDateTimeFormatString(); - $this->_conn->executeQuery('UPDATE optimistic_timestamp SET version = ? WHERE id = ?', array(date($format, strtotime($test->version->format($format)) + 3600), $test->id)); - - // Try and update the record and it should throw an exception - $test->name = 'Testing again'; - try { - $this->_em->flush(); - } catch (OptimisticLockException $e) { - $this->assertSame($test, $e->getEntity()); - } - } -} - -/** - * @Entity - * @Table(name="optimistic_joined_parent") - * @InheritanceType("JOINED") - * @DiscriminatorColumn(name="discr", type="string") - * @DiscriminatorMap({"parent" = "OptimisticJoinedParent", "child" = "OptimisticJoinedChild"}) - */ -class OptimisticJoinedParent -{ - /** - * @Id @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - public $id; - - /** - * @Column(type="string", length=255) - */ - public $name; - - /** - * @Version @Column(type="integer") - */ - public $version; -} - -/** - * @Entity - * @Table(name="optimistic_joined_child") - */ -class OptimisticJoinedChild extends OptimisticJoinedParent -{ - /** - * @Column(type="string", length=255) - */ - public $whatever; -} - -/** - * @Entity - * @Table(name="optimistic_standard") - */ -class OptimisticStandard -{ - /** - * @Id @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - public $id; - - /** - * @Column(type="string", length=255) - */ - public $name; - - /** - * @Version @Column(type="integer") - */ - private $version; - - function getVersion() {return $this->version;} -} - -/** - * @Entity - * @Table(name="optimistic_timestamp") - */ -class OptimisticTimestamp -{ - /** - * @Id @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - public $id; - - /** - * @Column(type="string", length=255) - */ - public $name; - - /** - * @Version @Column(type="datetime") - */ - public $version; -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php deleted file mode 100644 index 1e1df9d..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php +++ /dev/null @@ -1,380 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - public function testUnsetManyToMany() - { - $user = $this->addCmsUserGblancoWithGroups(1); - - unset($user->groups[0]->users[0]); // inverse side - unset($user->groups[0]); // owning side! - - $this->_em->flush(); - - // Check that the link in the association table has been deleted - $this->assertGblancoGroupCountIs(0); - } - - public function testBasicManyToManyJoin() - { - $user = $this->addCmsUserGblancoWithGroups(1); - $this->_em->clear(); - - $this->assertEquals(0, $this->_em->getUnitOfWork()->size()); - - $query = $this->_em->createQuery("select u, g from Doctrine\Tests\Models\CMS\CmsUser u join u.groups g"); - - $result = $query->getResult(); - - $this->assertEquals(2, $this->_em->getUnitOfWork()->size()); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0]); - $this->assertEquals('Guilherme', $result[0]->name); - $this->assertEquals(1, $result[0]->getGroups()->count()); - $groups = $result[0]->getGroups(); - $this->assertEquals('Developers_0', $groups[0]->getName()); - - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_MANAGED, $this->_em->getUnitOfWork()->getEntityState($result[0])); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_MANAGED, $this->_em->getUnitOfWork()->getEntityState($groups[0])); - - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $groups); - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $groups[0]->getUsers()); - - $groups[0]->getUsers()->clear(); - $groups->clear(); - - $this->_em->flush(); - $this->_em->clear(); - - $query = $this->_em->createQuery("select u, g from Doctrine\Tests\Models\CMS\CmsUser u join u.groups g"); - $this->assertEquals(0, count($query->getResult())); - } - - public function testManyToManyAddRemove() - { - $user = $this->addCmsUserGblancoWithGroups(2); - $this->_em->clear(); - - $uRep = $this->_em->getRepository(get_class($user)); - - // Get user - $user = $uRep->findOneById($user->getId()); - - $this->assertNotNull($user, "Has to return exactly one entry."); - - $this->assertFalse($user->getGroups()->isInitialized()); - - // Check groups - $this->assertEquals(2, $user->getGroups()->count()); - - $this->assertTrue($user->getGroups()->isInitialized()); - - // Remove first group - unset($user->groups[0]); - //$user->getGroups()->remove(0); - - $this->_em->flush(); - $this->_em->clear(); - - // Reload same user - $user2 = $uRep->findOneById($user->getId()); - - // Check groups - $this->assertEquals(1, $user2->getGroups()->count()); - } - - public function testManyToManyInverseSideIgnored() - { - $user = $this->addCmsUserGblancoWithGroups(0); - - $group = new CmsGroup; - $group->name = 'Humans'; - - // modify directly, addUser() would also (properly) set the owning side - $group->users[] = $user; - - $this->_em->persist($user); - $this->_em->persist($group); - $this->_em->flush(); - $this->_em->clear(); - - // Association should not exist - $user2 = $this->_em->find(get_class($user), $user->getId()); - - $this->assertNotNull($user2, "Has to return exactly one entry."); - $this->assertEquals(0, $user2->getGroups()->count()); - } - - public function testManyToManyCollectionClearing() - { - $user = $this->addCmsUserGblancoWithGroups($groupCount = 10); - - // Check that there are indeed 10 links in the association table - $this->assertGblancoGroupCountIs($groupCount); - - $user->groups->clear(); - - $this->_em->flush(); - - // Check that the links in the association table have been deleted - $this->assertGblancoGroupCountIs(0); - } - - public function testManyToManyCollectionClearAndAdd() - { - $user = $this->addCmsUserGblancoWithGroups($groupCount = 10); - - $groups = $user->groups->toArray(); - $user->groups->clear(); - - foreach ($groups AS $group) { - $user->groups[] = $group; - } - - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $user->groups); - $this->assertTrue($user->groups->isDirty()); - - $this->assertEquals($groupCount, count($user->groups), "There should be 10 groups in the collection."); - - $this->_em->flush(); - - $this->assertGblancoGroupCountIs($groupCount); - } - - /** - * @param int $expectedGroupCount - */ - public function assertGblancoGroupCountIs($expectedGroupCount) - { - $countDql = "SELECT count(g.id) FROM Doctrine\Tests\Models\CMS\CmsUser u JOIN u.groups g WHERE u.username = 'gblanco'"; - $this->assertEquals( - $expectedGroupCount, - $this->_em->createQuery($countDql)->getSingleScalarResult(), - "Failed to verify that CmsUser with username 'gblanco' has a group count of 10 with a DQL count query." - ); - } - - public function testRetrieveManyToManyAndAddMore() - { - $user = $this->addCmsUserGblancoWithGroups(2); - - $group = new CmsGroup(); - $group->name = 'Developers_Fresh'; - $this->_em->persist($group); - $this->_em->flush(); - - $this->_em->clear(); - - /* @var $freshUser CmsUser */ - $freshUser = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $user->getId()); - $newGroup = new CmsGroup(); - $newGroup->setName('12Monkeys'); - $freshUser->addGroup($newGroup); - - $this->assertFalse($freshUser->groups->isInitialized(), "CmsUser::groups Collection has to be uninitialized for this test."); - - $this->_em->flush(); - - $this->assertFalse($freshUser->groups->isInitialized(), "CmsUser::groups Collection has to be uninitialized for this test."); - $this->assertEquals(3, count($freshUser->getGroups())); - $this->assertEquals(3, count($freshUser->getGroups()->getSnapshot()), "Snapshot of CmsUser::groups should contain 3 entries."); - - $this->_em->clear(); - - $freshUser = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $user->getId()); - $this->assertEquals(3, count($freshUser->getGroups())); - } - - /** - * @group DDC-130 - */ - public function testRemoveUserWithManyGroups() - { - $user = $this->addCmsUserGblancoWithGroups(2); - $userId = $user->getId(); - - $this->_em->remove($user); - $this->_em->flush(); - - $newUser = $this->_em->find(get_class($user), $userId); - $this->assertNull($newUser); - } - - /** - * @group DDC-130 - */ - public function testRemoveGroupWithUser() - { - $user = $this->addCmsUserGblancoWithGroups(2); - - foreach ($user->getGroups() AS $group) { - $this->_em->remove($group); - } - $this->_em->flush(); - $this->_em->clear(); - - $newUser = $this->_em->find(get_class($user), $user->getId()); - $this->assertEquals(0, count($newUser->getGroups())); - } - - public function testDereferenceCollectionDelete() - { - $user = $this->addCmsUserGblancoWithGroups(2); - $user->groups = null; - - $this->_em->flush(); - $this->_em->clear(); - - $newUser = $this->_em->find(get_class($user), $user->getId()); - $this->assertEquals(0, count($newUser->getGroups())); - } - - /** - * @group DDC-839 - */ - public function testWorkWithDqlHydratedEmptyCollection() - { - $user = $this->addCmsUserGblancoWithGroups(0); - $group = new CmsGroup(); - $group->name = "Developers0"; - $this->_em->persist($group); - - $this->_em->flush(); - $this->_em->clear(); - - $newUser = $this->_em->createQuery('SELECT u, g FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.groups g WHERE u.id = ?1') - ->setParameter(1, $user->getId()) - ->getSingleResult(); - $this->assertEquals(0, count($newUser->groups)); - $this->assertInternalType('array', $newUser->groups->getMapping()); - - $newUser->addGroup($group); - - $this->_em->flush(); - $this->_em->clear(); - - $newUser = $this->_em->find(get_class($user), $user->getId()); - $this->assertEquals(1, count($newUser->groups)); - } - - /** - * @param int $groupCount - * @return CmsUser - */ - public function addCmsUserGblancoWithGroups($groupCount = 1) - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - - for ($i=0; $i < $groupCount; ++$i) { - $group = new CmsGroup; - $group->name = 'Developers_' . $i; - $user->addGroup($group); - } - - $this->_em->persist($user); - $this->_em->flush(); - - $this->assertNotNull($user->getId(), "User 'gblanco' should have an ID assigned after the persist()/flush() operation."); - - return $user; - } - - /** - * @group DDC-980 - */ - public function testUpdateDeleteSizeSubselectQueries() - { - $this->_em->createQuery("DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE SIZE(u.groups) = 10")->execute(); - $this->_em->createQuery("UPDATE Doctrine\Tests\Models\CMS\CmsUser u SET u.status = 'inactive' WHERE SIZE(u.groups) = 10")->execute(); - } - - /** - * @group DDC-978 - */ - public function testClearAndResetCollection() - { - $user = $this->addCmsUserGblancoWithGroups(2); - $group1 = new CmsGroup; - $group1->name = 'Developers_New1'; - $group2 = new CmsGroup; - $group2->name = 'Developers_New2'; - - $this->_em->persist($group1); - $this->_em->persist($group2); - $this->_em->flush(); - $this->_em->clear(); - - $user = $this->_em->find(get_class($user), $user->id); - - $coll = new ArrayCollection(array($group1, $group2)); - $user->groups = $coll; - $this->_em->flush(); - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $user->groups, - "UnitOfWork should have replaced ArrayCollection with PersistentCollection."); - $this->_em->flush(); - - $this->_em->clear(); - - $user = $this->_em->find(get_class($user), $user->id); - $this->assertEquals(2, count($user->groups)); - $this->assertEquals('Developers_New1', $user->groups[0]->name); - $this->assertEquals('Developers_New2', $user->groups[1]->name); - } - - /** - * @group DDC-733 - */ - public function testInitializePersistentCollection() - { - $user = $this->addCmsUserGblancoWithGroups(2); - $this->_em->clear(); - - $user = $this->_em->find(get_class($user), $user->id); - - $this->assertFalse($user->groups->isInitialized(), "Pre-condition: lazy collection"); - $this->_em->getUnitOfWork()->initializeObject($user->groups); - $this->assertTrue($user->groups->isInitialized(), "Collection should be initialized after calling UnitOfWork::initializeObject()"); - } - - /** - * @group DDC-1189 - * @group DDC-956 - */ - public function testClearBeforeLazyLoad() - { - $user = $this->addCmsUserGblancoWithGroups(4); - - $this->_em->clear(); - - $user = $this->_em->find(get_class($user), $user->id); - $user->groups->clear(); - $this->assertEquals(0, count($user->groups)); - - $this->_em->flush(); - - $user = $this->_em->find(get_class($user), $user->id); - $this->assertEquals(0, count($user->groups)); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php deleted file mode 100644 index cfe9f1e..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php +++ /dev/null @@ -1,202 +0,0 @@ -useModelSet('ecommerce'); - parent::setUp(); - $this->firstProduct = new ECommerceProduct(); - $this->firstProduct->setName("First Product"); - $this->secondProduct = new ECommerceProduct(); - $this->secondProduct->setName("Second Product"); - $this->firstCategory = new ECommerceCategory(); - $this->firstCategory->setName("Business"); - $this->secondCategory = new ECommerceCategory(); - $this->secondCategory->setName("Home"); - } - - public function testSavesAManyToManyAssociationWithCascadeSaveSet() - { - $this->firstProduct->addCategory($this->firstCategory); - $this->firstProduct->addCategory($this->secondCategory); - $this->_em->persist($this->firstProduct); - $this->_em->flush(); - - $this->assertForeignKeysContain($this->firstProduct->getId(), $this->firstCategory->getId()); - $this->assertForeignKeysContain($this->firstProduct->getId(), $this->secondCategory->getId()); - } - - public function testRemovesAManyToManyAssociation() - { - $this->firstProduct->addCategory($this->firstCategory); - $this->firstProduct->addCategory($this->secondCategory); - $this->_em->persist($this->firstProduct); - $this->firstProduct->removeCategory($this->firstCategory); - - $this->_em->flush(); - - $this->assertForeignKeysNotContain($this->firstProduct->getId(), $this->firstCategory->getId()); - $this->assertForeignKeysContain($this->firstProduct->getId(), $this->secondCategory->getId()); - - $this->firstProduct->getCategories()->remove(1); - $this->_em->flush(); - - $this->assertForeignKeysNotContain($this->firstProduct->getId(), $this->secondCategory->getId()); - } - - public function testEagerLoadFromInverseSideAndLazyLoadFromOwningSide() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - $this->_createLoadingFixture(); - $categories = $this->_findCategories(); - $this->assertLazyLoadFromOwningSide($categories); - } - - public function testEagerLoadFromOwningSideAndLazyLoadFromInverseSide() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - $this->_createLoadingFixture(); - $products = $this->_findProducts(); - $this->assertLazyLoadFromInverseSide($products); - } - - private function _createLoadingFixture() - { - $this->firstProduct->addCategory($this->firstCategory); - $this->firstProduct->addCategory($this->secondCategory); - $this->secondProduct->addCategory($this->firstCategory); - $this->secondProduct->addCategory($this->secondCategory); - $this->_em->persist($this->firstProduct); - $this->_em->persist($this->secondProduct); - - $this->_em->flush(); - $this->_em->clear(); - } - - protected function _findProducts() - { - $query = $this->_em->createQuery('SELECT p, c FROM Doctrine\Tests\Models\ECommerce\ECommerceProduct p LEFT JOIN p.categories c ORDER BY p.id, c.id'); - //$query->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true); - $result = $query->getResult(); - $this->assertEquals(2, count($result)); - $cats1 = $result[0]->getCategories(); - $cats2 = $result[1]->getCategories(); - $this->assertTrue($cats1->isInitialized()); - $this->assertTrue($cats2->isInitialized()); - $this->assertFalse($cats1[0]->getProducts()->isInitialized()); - $this->assertFalse($cats2[0]->getProducts()->isInitialized()); - - return $result; - } - - protected function _findCategories() - { - $query = $this->_em->createQuery('SELECT c, p FROM Doctrine\Tests\Models\ECommerce\ECommerceCategory c LEFT JOIN c.products p ORDER BY c.id, p.id'); - //$query->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true); - $result = $query->getResult(); - $this->assertEquals(2, count($result)); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceCategory', $result[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceCategory', $result[1]); - $prods1 = $result[0]->getProducts(); - $prods2 = $result[1]->getProducts(); - $this->assertTrue($prods1->isInitialized()); - $this->assertTrue($prods2->isInitialized()); - - $this->assertFalse($prods1[0]->getCategories()->isInitialized()); - $this->assertFalse($prods2[0]->getCategories()->isInitialized()); - - return $result; - } - - public function assertLazyLoadFromInverseSide($products) - { - list ($firstProduct, $secondProduct) = $products; - - $firstProductCategories = $firstProduct->getCategories(); - $secondProductCategories = $secondProduct->getCategories(); - - $this->assertEquals(2, count($firstProductCategories)); - $this->assertEquals(2, count($secondProductCategories)); - - $this->assertTrue($firstProductCategories[0] === $secondProductCategories[0]); - $this->assertTrue($firstProductCategories[1] === $secondProductCategories[1]); - - $firstCategoryProducts = $firstProductCategories[0]->getProducts(); - $secondCategoryProducts = $firstProductCategories[1]->getProducts(); - - $this->assertFalse($firstCategoryProducts->isInitialized()); - $this->assertFalse($secondCategoryProducts->isInitialized()); - $this->assertEquals(0, $firstCategoryProducts->unwrap()->count()); - $this->assertEquals(0, $secondCategoryProducts->unwrap()->count()); - - $this->assertEquals(2, count($firstCategoryProducts)); // lazy-load - $this->assertTrue($firstCategoryProducts->isInitialized()); - $this->assertFalse($secondCategoryProducts->isInitialized()); - $this->assertEquals(2, count($secondCategoryProducts)); // lazy-load - $this->assertTrue($secondCategoryProducts->isInitialized()); - - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $firstCategoryProducts[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $firstCategoryProducts[1]); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $secondCategoryProducts[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $secondCategoryProducts[1]); - - $this->assertCollectionEquals($firstCategoryProducts, $secondCategoryProducts); - } - - public function assertLazyLoadFromOwningSide($categories) - { - list ($firstCategory, $secondCategory) = $categories; - - $firstCategoryProducts = $firstCategory->getProducts(); - $secondCategoryProducts = $secondCategory->getProducts(); - - $this->assertEquals(2, count($firstCategoryProducts)); - $this->assertEquals(2, count($secondCategoryProducts)); - - $this->assertTrue($firstCategoryProducts[0] === $secondCategoryProducts[0]); - $this->assertTrue($firstCategoryProducts[1] === $secondCategoryProducts[1]); - - $firstProductCategories = $firstCategoryProducts[0]->getCategories(); - $secondProductCategories = $firstCategoryProducts[1]->getCategories(); - - $this->assertFalse($firstProductCategories->isInitialized()); - $this->assertFalse($secondProductCategories->isInitialized()); - $this->assertEquals(0, $firstProductCategories->unwrap()->count()); - $this->assertEquals(0, $secondProductCategories->unwrap()->count()); - - $this->assertEquals(2, count($firstProductCategories)); // lazy-load - $this->assertTrue($firstProductCategories->isInitialized()); - $this->assertFalse($secondProductCategories->isInitialized()); - $this->assertEquals(2, count($secondProductCategories)); // lazy-load - $this->assertTrue($secondProductCategories->isInitialized()); - - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceCategory', $firstProductCategories[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceCategory', $firstProductCategories[1]); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceCategory', $secondProductCategories[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceCategory', $secondProductCategories[1]); - - $this->assertCollectionEquals($firstProductCategories, $secondProductCategories); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyEventTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyEventTest.php deleted file mode 100644 index 47c96b1..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyEventTest.php +++ /dev/null @@ -1,76 +0,0 @@ - - */ -class ManyToManyEventTest extends \Doctrine\Tests\OrmFunctionalTestCase -{ - /** - * @var PostUpdateListener - */ - private $listener; - - protected function setUp() - { - $this->useModelSet('cms'); - parent::setUp(); - $this->listener = new PostUpdateListener(); - $evm = $this->_em->getEventManager(); - $evm->addEventListener(Events::postUpdate, $this->listener); - } - - public function testListenerShouldBeNotifiedOnlyWhenUpdating() - { - $user = $this->createNewValidUser(); - $this->_em->persist($user); - $this->_em->flush(); - $this->assertFalse($this->listener->wasNotified); - - $group = new CmsGroup(); - $group->name = "admins"; - $user->addGroup($group); - $this->_em->persist($user); - $this->_em->flush(); - - $this->assertTrue($this->listener->wasNotified); - } - - /** - * @return CmsUser - */ - private function createNewValidUser() - { - $user = new CmsUser(); - $user->username = 'fran6co'; - $user->name = 'Francisco Facioni'; - $group = new CmsGroup(); - $group->name = "users"; - $user->addGroup($group); - return $user; - } -} - -class PostUpdateListener -{ - /** - * @var bool - */ - public $wasNotified = false; - - /** - * @param $args - */ - public function postUpdate($args) - { - $this->wasNotified = true; - } -} - - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php deleted file mode 100644 index 40518e0..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php +++ /dev/null @@ -1,124 +0,0 @@ -useModelSet('ecommerce'); - parent::setUp(); - $this->firstProduct = new ECommerceProduct(); - $this->secondProduct = new ECommerceProduct(); - $this->firstRelated = new ECommerceProduct(); - $this->firstRelated->setName("Business"); - $this->secondRelated = new ECommerceProduct(); - $this->secondRelated->setName("Home"); - } - - public function testSavesAManyToManyAssociationWithCascadeSaveSet() - { - $this->firstProduct->addRelated($this->firstRelated); - $this->firstProduct->addRelated($this->secondRelated); - $this->_em->persist($this->firstProduct); - $this->_em->flush(); - - $this->assertForeignKeysContain($this->firstProduct->getId(), - $this->firstRelated->getId()); - $this->assertForeignKeysContain($this->firstProduct->getId(), - $this->secondRelated->getId()); - } - - public function testRemovesAManyToManyAssociation() - { - $this->firstProduct->addRelated($this->firstRelated); - $this->firstProduct->addRelated($this->secondRelated); - $this->_em->persist($this->firstProduct); - $this->firstProduct->removeRelated($this->firstRelated); - - $this->_em->flush(); - - $this->assertForeignKeysNotContain($this->firstProduct->getId(), - $this->firstRelated->getId()); - $this->assertForeignKeysContain($this->firstProduct->getId(), - $this->secondRelated->getId()); - } - - public function testEagerLoadsOwningSide() - { - $this->_createLoadingFixture(); - $products = $this->_findProducts(); - $this->assertLoadingOfOwningSide($products); - } - - public function testLazyLoadsOwningSide() - { - $this->_createLoadingFixture(); - - $metadata = $this->_em->getClassMetadata('Doctrine\Tests\Models\ECommerce\ECommerceProduct'); - $metadata->associationMappings['related']['fetch'] = ClassMetadata::FETCH_LAZY; - - $query = $this->_em->createQuery('SELECT p FROM Doctrine\Tests\Models\ECommerce\ECommerceProduct p'); - $products = $query->getResult(); - $this->assertLoadingOfOwningSide($products); - } - - public function assertLoadingOfOwningSide($products) - { - list ($firstProduct, $secondProduct) = $products; - $this->assertEquals(2, count($firstProduct->getRelated())); - $this->assertEquals(2, count($secondProduct->getRelated())); - - $categories = $firstProduct->getRelated(); - $firstRelatedBy = $categories[0]->getRelated(); - $secondRelatedBy = $categories[1]->getRelated(); - - $this->assertEquals(2, count($firstRelatedBy)); - $this->assertEquals(2, count($secondRelatedBy)); - - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $firstRelatedBy[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $firstRelatedBy[1]); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $secondRelatedBy[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $secondRelatedBy[1]); - - $this->assertCollectionEquals($firstRelatedBy, $secondRelatedBy); - } - - protected function _createLoadingFixture() - { - $this->firstProduct->addRelated($this->firstRelated); - $this->firstProduct->addRelated($this->secondRelated); - $this->secondProduct->addRelated($this->firstRelated); - $this->secondProduct->addRelated($this->secondRelated); - $this->_em->persist($this->firstProduct); - $this->_em->persist($this->secondProduct); - - $this->_em->flush(); - $this->_em->clear(); - } - - protected function _findProducts() - { - $query = $this->_em->createQuery('SELECT p, r FROM Doctrine\Tests\Models\ECommerce\ECommerceProduct p LEFT JOIN p.related r ORDER BY p.id, r.id'); - return $query->getResult(); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyUnidirectionalAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyUnidirectionalAssociationTest.php deleted file mode 100644 index ba83d53..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyUnidirectionalAssociationTest.php +++ /dev/null @@ -1,108 +0,0 @@ -useModelSet('ecommerce'); - parent::setUp(); - $this->firstProduct = new ECommerceProduct(); - $this->firstProduct->setName('Doctrine 1.x Manual'); - $this->secondProduct = new ECommerceProduct(); - $this->secondProduct->setName('Doctrine 2.x Manual'); - $this->firstCart = new ECommerceCart(); - $this->secondCart = new ECommerceCart(); - } - - public function testSavesAManyToManyAssociationWithCascadeSaveSet() - { - $this->firstCart->addProduct($this->firstProduct); - $this->firstCart->addProduct($this->secondProduct); - $this->_em->persist($this->firstCart); - $this->_em->flush(); - - $this->assertForeignKeysContain($this->firstCart->getId(), $this->firstProduct->getId()); - $this->assertForeignKeysContain($this->firstCart->getId(), $this->secondProduct->getId()); - } - - public function testRemovesAManyToManyAssociation() - { - $this->firstCart->addProduct($this->firstProduct); - $this->firstCart->addProduct($this->secondProduct); - $this->_em->persist($this->firstCart); - $this->firstCart->removeProduct($this->firstProduct); - - $this->_em->flush(); - - $this->assertForeignKeysNotContain($this->firstCart->getId(), $this->firstProduct->getId()); - $this->assertForeignKeysContain($this->firstCart->getId(), $this->secondProduct->getId()); - } - - public function testEagerLoad() - { - $this->_createFixture(); - - $query = $this->_em->createQuery('SELECT c, p FROM Doctrine\Tests\Models\ECommerce\ECommerceCart c LEFT JOIN c.products p ORDER BY c.id, p.id'); - $result = $query->getResult(); - $firstCart = $result[0]; - $products = $firstCart->getProducts(); - $secondCart = $result[1]; - - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $products[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $products[1]); - $this->assertCollectionEquals($products, $secondCart->getProducts()); - //$this->assertEquals("Doctrine 1.x Manual", $products[0]->getName()); - //$this->assertEquals("Doctrine 2.x Manual", $products[1]->getName()); - } - - public function testLazyLoadsCollection() - { - $this->_createFixture(); - $metadata = $this->_em->getClassMetadata('Doctrine\Tests\Models\ECommerce\ECommerceCart'); - $metadata->associationMappings['products']['fetch'] = ClassMetadata::FETCH_LAZY; - - $query = $this->_em->createQuery('SELECT c FROM Doctrine\Tests\Models\ECommerce\ECommerceCart c'); - $result = $query->getResult(); - $firstCart = $result[0]; - $products = $firstCart->getProducts(); - $secondCart = $result[1]; - - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $products[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $products[1]); - $this->assertCollectionEquals($products, $secondCart->getProducts()); - } - - private function _createFixture() - { - $this->firstCart->addProduct($this->firstProduct); - $this->firstCart->addProduct($this->secondProduct); - $this->secondCart->addProduct($this->firstProduct); - $this->secondCart->addProduct($this->secondProduct); - $this->_em->persist($this->firstCart); - $this->_em->persist($this->secondCart); - - $this->_em->flush(); - $this->_em->clear(); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/MappedSuperclassTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/MappedSuperclassTest.php deleted file mode 100644 index f4439b9..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/MappedSuperclassTest.php +++ /dev/null @@ -1,47 +0,0 @@ -useModelSet('directorytree'); - parent::setUp(); - } - - public function testCRUD() - { - $root = new \Doctrine\Tests\Models\DirectoryTree\Directory(); - $root->setName('Root'); - $root->setPath('/root'); - - $directory = new \Doctrine\Tests\Models\DirectoryTree\Directory($root); - $directory->setName('TestA'); - $directory->setPath('/root/dir'); - - $file = new \Doctrine\Tests\Models\DirectoryTree\File($directory); - $file->setName('test-b.html'); - - $this->_em->persist($root); - $this->_em->persist($directory); - $this->_em->persist($file); - - $this->_em->flush(); - $this->_em->clear(); - - $cleanFile = $this->_em->find(get_class($file), $file->getId()); - - $this->assertInstanceOf('Doctrine\Tests\Models\DirectoryTree\Directory', $cleanFile->getParent()); - $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $cleanFile->getParent()); - $this->assertEquals($directory->getId(), $cleanFile->getParent()->getId()); - $this->assertInstanceOf('Doctrine\Tests\Models\DirectoryTree\Directory', $cleanFile->getParent()->getParent()); - $this->assertEquals($root->getId(), $cleanFile->getParent()->getParent()->getId()); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/NativeQueryTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/NativeQueryTest.php deleted file mode 100644 index eb46329..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/NativeQueryTest.php +++ /dev/null @@ -1,333 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - $this->platform = $this->_em->getConnection()->getDatabasePlatform(); - } - - public function testBasicNativeQuery() - { - $user = new CmsUser; - $user->name = 'Roman'; - $user->username = 'romanb'; - $user->status = 'dev'; - $this->_em->persist($user); - $this->_em->flush(); - - $this->_em->clear(); - - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addFieldResult('u', $this->platform->getSQLResultCasing('id'), 'id'); - $rsm->addFieldResult('u', $this->platform->getSQLResultCasing('name'), 'name'); - - $query = $this->_em->createNativeQuery('SELECT id, name FROM cms_users WHERE username = ?', $rsm); - $query->setParameter(1, 'romanb'); - - $users = $query->getResult(); - - $this->assertEquals(1, count($users)); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $users[0]); - $this->assertEquals('Roman', $users[0]->name); - } - - public function testBasicNativeQueryWithMetaResult() - { - $user = new CmsUser; - $user->name = 'Roman'; - $user->username = 'romanb'; - $user->status = 'dev'; - - $addr = new CmsAddress; - $addr->country = 'germany'; - $addr->zip = 10827; - $addr->city = 'Berlin'; - - - $user->setAddress($addr); - - $this->_em->persist($user); - $this->_em->flush(); - - $this->_em->clear(); - - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsAddress', 'a'); - $rsm->addFieldResult('a', $this->platform->getSQLResultCasing('id'), 'id'); - $rsm->addFieldResult('a', $this->platform->getSQLResultCasing('country'), 'country'); - $rsm->addFieldResult('a', $this->platform->getSQLResultCasing('zip'), 'zip'); - $rsm->addFieldResult('a', $this->platform->getSQLResultCasing('city'), 'city'); - $rsm->addMetaResult('a', $this->platform->getSQLResultCasing('user_id'), 'user_id'); - - $query = $this->_em->createNativeQuery('SELECT a.id, a.country, a.zip, a.city, a.user_id FROM cms_addresses a WHERE a.id = ?', $rsm); - $query->setParameter(1, $addr->id); - - $addresses = $query->getResult(); - - $this->assertEquals(1, count($addresses)); - $this->assertTrue($addresses[0] instanceof CmsAddress); - $this->assertEquals($addr->country, $addresses[0]->country); - $this->assertEquals($addr->zip, $addresses[0]->zip); - $this->assertEquals($addr->city, $addresses[0]->city); - $this->assertEquals($addr->street, $addresses[0]->street); - $this->assertTrue($addresses[0]->user instanceof CmsUser); - } - - public function testJoinedOneToManyNativeQuery() - { - $user = new CmsUser; - $user->name = 'Roman'; - $user->username = 'romanb'; - $user->status = 'dev'; - - $phone = new CmsPhonenumber; - $phone->phonenumber = 424242; - - $user->addPhonenumber($phone); - - $this->_em->persist($user); - $this->_em->flush(); - - $this->_em->clear(); - - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addFieldResult('u', $this->platform->getSQLResultCasing('id'), 'id'); - $rsm->addFieldResult('u', $this->platform->getSQLResultCasing('name'), 'name'); - $rsm->addFieldResult('u', $this->platform->getSQLResultCasing('status'), 'status'); - $rsm->addJoinedEntityResult('Doctrine\Tests\Models\CMS\CmsPhonenumber', 'p', 'u', 'phonenumbers'); - $rsm->addFieldResult('p', $this->platform->getSQLResultCasing('phonenumber'), 'phonenumber'); - - $query = $this->_em->createNativeQuery('SELECT id, name, status, phonenumber FROM cms_users INNER JOIN cms_phonenumbers ON id = user_id WHERE username = ?', $rsm); - $query->setParameter(1, 'romanb'); - - $users = $query->getResult(); - $this->assertEquals(1, count($users)); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $users[0]); - $this->assertEquals('Roman', $users[0]->name); - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $users[0]->getPhonenumbers()); - $this->assertTrue($users[0]->getPhonenumbers()->isInitialized()); - $this->assertEquals(1, count($users[0]->getPhonenumbers())); - $phones = $users[0]->getPhonenumbers(); - $this->assertEquals(424242, $phones[0]->phonenumber); - $this->assertTrue($phones[0]->getUser() === $users[0]); - - } - - public function testJoinedOneToOneNativeQuery() - { - $user = new CmsUser; - $user->name = 'Roman'; - $user->username = 'romanb'; - $user->status = 'dev'; - - $addr = new CmsAddress; - $addr->country = 'germany'; - $addr->zip = 10827; - $addr->city = 'Berlin'; - - - $user->setAddress($addr); - - $this->_em->persist($user); - $this->_em->flush(); - - $this->_em->clear(); - - - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addFieldResult('u', $this->platform->getSQLResultCasing('id'), 'id'); - $rsm->addFieldResult('u', $this->platform->getSQLResultCasing('name'), 'name'); - $rsm->addFieldResult('u', $this->platform->getSQLResultCasing('status'), 'status'); - $rsm->addJoinedEntityResult('Doctrine\Tests\Models\CMS\CmsAddress', 'a', 'u', 'address'); - $rsm->addFieldResult('a', $this->platform->getSQLResultCasing('a_id'), 'id'); - $rsm->addFieldResult('a', $this->platform->getSQLResultCasing('country'), 'country'); - $rsm->addFieldResult('a', $this->platform->getSQLResultCasing('zip'), 'zip'); - $rsm->addFieldResult('a', $this->platform->getSQLResultCasing('city'), 'city'); - - $query = $this->_em->createNativeQuery('SELECT u.id, u.name, u.status, a.id AS a_id, a.country, a.zip, a.city FROM cms_users u INNER JOIN cms_addresses a ON u.id = a.user_id WHERE u.username = ?', $rsm); - $query->setParameter(1, 'romanb'); - - $users = $query->getResult(); - - $this->assertEquals(1, count($users)); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $users[0]); - $this->assertEquals('Roman', $users[0]->name); - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $users[0]->getPhonenumbers()); - $this->assertFalse($users[0]->getPhonenumbers()->isInitialized()); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsAddress', $users[0]->getAddress()); - $this->assertTrue($users[0]->getAddress()->getUser() == $users[0]); - $this->assertEquals('germany', $users[0]->getAddress()->getCountry()); - $this->assertEquals(10827, $users[0]->getAddress()->getZipCode()); - $this->assertEquals('Berlin', $users[0]->getAddress()->getCity()); - } - - public function testFluentInterface() - { - $rsm = new ResultSetMapping; - - $q = $this->_em->createNativeQuery('SELECT id, name, status, phonenumber FROM cms_users INNER JOIN cms_phonenumbers ON id = user_id WHERE username = ?', $rsm); - $q2 = $q->setSql('foo', $rsm) - ->setResultSetMapping($rsm) - ->expireResultCache(true) - ->setHint('foo', 'bar') - ->setParameter(1, 'foo') - ->setParameters(array(2 => 'bar')) - ->setResultCacheDriver(null) - ->setResultCacheLifetime(3500); - - $this->assertSame($q, $q2); - } - - public function testJoinedOneToManyNativeQueryWithRSMBuilder() - { - $user = new CmsUser; - $user->name = 'Roman'; - $user->username = 'romanb'; - $user->status = 'dev'; - - $phone = new CmsPhonenumber; - $phone->phonenumber = 424242; - - $user->addPhonenumber($phone); - - $this->_em->persist($user); - $this->_em->flush(); - - $this->_em->clear(); - - $rsm = new ResultSetMappingBuilder($this->_em); - $rsm->addRootEntityFromClassMetadata('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addJoinedEntityFromClassMetadata('Doctrine\Tests\Models\CMS\CmsPhonenumber', 'p', 'u', 'phonenumbers'); - $query = $this->_em->createNativeQuery('SELECT u.*, p.* FROM cms_users u LEFT JOIN cms_phonenumbers p ON u.id = p.user_id WHERE username = ?', $rsm); - $query->setParameter(1, 'romanb'); - - $users = $query->getResult(); - $this->assertEquals(1, count($users)); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $users[0]); - $this->assertEquals('Roman', $users[0]->name); - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $users[0]->getPhonenumbers()); - $this->assertTrue($users[0]->getPhonenumbers()->isInitialized()); - $this->assertEquals(1, count($users[0]->getPhonenumbers())); - $phones = $users[0]->getPhonenumbers(); - $this->assertEquals(424242, $phones[0]->phonenumber); - $this->assertTrue($phones[0]->getUser() === $users[0]); - - $this->_em->clear(); - - $rsm = new ResultSetMappingBuilder($this->_em); - $rsm->addRootEntityFromClassMetadata('Doctrine\Tests\Models\CMS\CmsPhonenumber', 'p'); - $query = $this->_em->createNativeQuery('SELECT p.* FROM cms_phonenumbers p WHERE p.phonenumber = ?', $rsm); - $query->setParameter(1, $phone->phonenumber); - $phone = $query->getSingleResult(); - - $this->assertNotNull($phone->getUser()); - $this->assertEquals($user->name, $phone->getUser()->getName()); - } - - public function testJoinedOneToOneNativeQueryWithRSMBuilder() - { - $user = new CmsUser; - $user->name = 'Roman'; - $user->username = 'romanb'; - $user->status = 'dev'; - - $addr = new CmsAddress; - $addr->country = 'germany'; - $addr->zip = 10827; - $addr->city = 'Berlin'; - - - $user->setAddress($addr); - - $this->_em->persist($user); - $this->_em->flush(); - - $this->_em->clear(); - - - $rsm = new ResultSetMappingBuilder($this->_em); - $rsm->addRootEntityFromClassMetadata('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addJoinedEntityFromClassMetadata('Doctrine\Tests\Models\CMS\CmsAddress', 'a', 'u', 'address', array('id' => 'a_id')); - - $query = $this->_em->createNativeQuery('SELECT u.*, a.*, a.id AS a_id FROM cms_users u INNER JOIN cms_addresses a ON u.id = a.user_id WHERE u.username = ?', $rsm); - $query->setParameter(1, 'romanb'); - - $users = $query->getResult(); - - $this->assertEquals(1, count($users)); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $users[0]); - $this->assertEquals('Roman', $users[0]->name); - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $users[0]->getPhonenumbers()); - $this->assertFalse($users[0]->getPhonenumbers()->isInitialized()); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsAddress', $users[0]->getAddress()); - $this->assertTrue($users[0]->getAddress()->getUser() == $users[0]); - $this->assertEquals('germany', $users[0]->getAddress()->getCountry()); - $this->assertEquals(10827, $users[0]->getAddress()->getZipCode()); - $this->assertEquals('Berlin', $users[0]->getAddress()->getCity()); - - $this->_em->clear(); - - $rsm = new ResultSetMappingBuilder($this->_em); - $rsm->addRootEntityFromClassMetadata('Doctrine\Tests\Models\CMS\CmsAddress', 'a'); - $query = $this->_em->createNativeQuery('SELECT a.* FROM cms_addresses a WHERE a.id = ?', $rsm); - $query->setParameter(1, $addr->getId()); - $address = $query->getSingleResult(); - - $this->assertNotNull($address->getUser()); - $this->assertEquals($user->name, $address->getUser()->getName()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testRSMBuilderThrowsExceptionOnColumnConflict() - { - $rsm = new ResultSetMappingBuilder($this->_em); - $rsm->addRootEntityFromClassMetadata('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addJoinedEntityFromClassMetadata('Doctrine\Tests\Models\CMS\CmsAddress', 'a', 'u', 'address'); - } - - /** - * @group PR-39 - */ - public function testUnknownParentAliasThrowsException() - { - $rsm = new ResultSetMappingBuilder($this->_em); - $rsm->addRootEntityFromClassMetadata('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addJoinedEntityFromClassMetadata('Doctrine\Tests\Models\CMS\CmsAddress', 'a', 'un', 'address', array('id' => 'a_id')); - - $query = $this->_em->createNativeQuery('SELECT u.*, a.*, a.id AS a_id FROM cms_users u INNER JOIN cms_addresses a ON u.id = a.user_id WHERE u.username = ?', $rsm); - $query->setParameter(1, 'romanb'); - - $this->setExpectedException( - "Doctrine\ORM\Internal\Hydration\HydrationException", - "The parent object of entity result with alias 'a' was not found. The parent alias is 'un'." - ); - $users = $query->getResult(); - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/NotifyPolicyTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/NotifyPolicyTest.php deleted file mode 100644 index 069e11c..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/NotifyPolicyTest.php +++ /dev/null @@ -1,173 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\NotifyUser'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\NotifyGroup') - )); - } catch (\Exception $e) { - // Swallow all exceptions. We do not test the schema tool here. - } - } - - public function testChangeTracking() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - - $user = new NotifyUser(); - $group = new NotifyGroup(); - $user->setName('roman'); - $group->setName('dev'); - - $user->getGroups()->add($group); - $group->getUsers()->add($user); - - $this->_em->persist($user); - $this->_em->persist($group); - - $this->assertEquals(1, count($user->listeners)); - $this->assertEquals(1, count($group->listeners)); - - $this->_em->flush(); - $this->_em->clear(); - - $this->assertEquals(1, count($user->listeners)); - $this->assertEquals(1, count($group->listeners)); - - $userId = $user->getId(); - $groupId = $group->getId(); - unset($user, $group); - - $user = $this->_em->find(__NAMESPACE__.'\NotifyUser', $userId); - $this->assertEquals(1, $user->getGroups()->count()); - $group = $this->_em->find(__NAMESPACE__.'\NotifyGroup', $groupId); - $this->assertEquals(1, $group->getUsers()->count()); - - $this->assertEquals(1, count($user->listeners)); - $this->assertEquals(1, count($group->listeners)); - - $group2 = new NotifyGroup(); - $group2->setName('nerds'); - $this->_em->persist($group2); - $user->getGroups()->add($group2); - $group2->getUsers()->add($user); - - $group->setName('geeks'); - - $this->_em->flush(); - $this->_em->clear(); - - $this->assertEquals(1, count($user->listeners)); - $this->assertEquals(1, count($group->listeners)); - - $group2Id = $group2->getId(); - unset($group2, $user); - - $user = $this->_em->find(__NAMESPACE__.'\NotifyUser', $userId); - $this->assertEquals(2, $user->getGroups()->count()); - $group2 = $this->_em->find(__NAMESPACE__.'\NotifyGroup', $group2Id); - $this->assertEquals(1, $group2->getUsers()->count()); - $group = $this->_em->find(__NAMESPACE__.'\NotifyGroup', $groupId); - $this->assertEquals(1, $group->getUsers()->count()); - $this->assertEquals('geeks', $group->getName()); - } -} - -class NotifyBaseEntity implements NotifyPropertyChanged { - public $listeners = array(); - - public function addPropertyChangedListener(PropertyChangedListener $listener) { - $this->listeners[] = $listener; - } - - protected function onPropertyChanged($propName, $oldValue, $newValue) { - if ($this->listeners) { - foreach ($this->listeners as $listener) { - $listener->propertyChanged($this, $propName, $oldValue, $newValue); - } - } - } -} - -/** @Entity @ChangeTrackingPolicy("NOTIFY") */ -class NotifyUser extends NotifyBaseEntity { - /** @Id @Column(type="integer") @GeneratedValue */ - private $id; - - /** @Column */ - private $name; - - /** @ManyToMany(targetEntity="NotifyGroup") */ - private $groups; - - function __construct() { - $this->groups = new ArrayCollection; - } - - function getId() { - return $this->id; - } - - function getName() { - return $this->name; - } - - function setName($name) { - $this->onPropertyChanged('name', $this->name, $name); - $this->name = $name; - } - - function getGroups() { - return $this->groups; - } -} - -/** @Entity */ -class NotifyGroup extends NotifyBaseEntity { - /** @Id @Column(type="integer") @GeneratedValue */ - private $id; - - /** @Column */ - private $name; - - /** @ManyToMany(targetEntity="NotifyUser", mappedBy="groups") */ - private $users; - - function __construct() { - $this->users = new ArrayCollection; - } - - function getId() { - return $this->id; - } - - function getName() { - return $this->name; - } - - function setName($name) { - $this->onPropertyChanged('name', $this->name, $name); - $this->name = $name; - } - - function getUsers() { - return $this->users; - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManyBidirectionalAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManyBidirectionalAssociationTest.php deleted file mode 100644 index a9258da..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManyBidirectionalAssociationTest.php +++ /dev/null @@ -1,171 +0,0 @@ -useModelSet('ecommerce'); - parent::setUp(); - $this->product = new ECommerceProduct(); - $this->product->setName('Doctrine Cookbook'); - $this->firstFeature = new ECommerceFeature(); - $this->firstFeature->setDescription('Model writing tutorial'); - $this->secondFeature = new ECommerceFeature(); - $this->secondFeature->setDescription('Annotations examples'); - } - - public function testSavesAOneToManyAssociationWithCascadeSaveSet() { - $this->product->addFeature($this->firstFeature); - $this->product->addFeature($this->secondFeature); - $this->_em->persist($this->product); - $this->_em->flush(); - - $this->assertFeatureForeignKeyIs($this->product->getId(), $this->firstFeature); - $this->assertFeatureForeignKeyIs($this->product->getId(), $this->secondFeature); - } - - public function testSavesAnEmptyCollection() - { - $this->_em->persist($this->product); - $this->_em->flush(); - - $this->assertEquals(0, count($this->product->getFeatures())); - } - - public function testDoesNotSaveAnInverseSideSet() { - $this->product->brokenAddFeature($this->firstFeature); - $this->_em->persist($this->product); - $this->_em->flush(); - - $this->assertFeatureForeignKeyIs(null, $this->firstFeature); - } - - public function testRemovesOneToOneAssociation() - { - $this->product->addFeature($this->firstFeature); - $this->product->addFeature($this->secondFeature); - $this->_em->persist($this->product); - - $this->product->removeFeature($this->firstFeature); - $this->_em->flush(); - - $this->assertFeatureForeignKeyIs(null, $this->firstFeature); - $this->assertFeatureForeignKeyIs($this->product->getId(), $this->secondFeature); - } - - public function testEagerLoadsOneToManyAssociation() - { - $this->_createFixture(); - $query = $this->_em->createQuery('select p, f from Doctrine\Tests\Models\ECommerce\ECommerceProduct p join p.features f'); - $result = $query->getResult(); - $product = $result[0]; - - $features = $product->getFeatures(); - - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceFeature', $features[0]); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $features[0]->getProduct()); - $this->assertSame($product, $features[0]->getProduct()); - $this->assertEquals('Model writing tutorial', $features[0]->getDescription()); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceFeature', $features[1]); - $this->assertSame($product, $features[1]->getProduct()); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $features[1]->getProduct()); - $this->assertEquals('Annotations examples', $features[1]->getDescription()); - } - - public function testLazyLoadsObjectsOnTheOwningSide() - { - $this->_createFixture(); - - $query = $this->_em->createQuery('select p from Doctrine\Tests\Models\ECommerce\ECommerceProduct p'); - $result = $query->getResult(); - $product = $result[0]; - $features = $product->getFeatures(); - - $this->assertFalse($features->isInitialized()); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceFeature', $features[0]); - $this->assertTrue($features->isInitialized()); - $this->assertSame($product, $features[0]->getProduct()); - $this->assertEquals('Model writing tutorial', $features[0]->getDescription()); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceFeature', $features[1]); - $this->assertSame($product, $features[1]->getProduct()); - $this->assertEquals('Annotations examples', $features[1]->getDescription()); - } - - public function testLazyLoadsObjectsOnTheInverseSide() - { - $this->_createFixture(); - - $query = $this->_em->createQuery('select f from Doctrine\Tests\Models\ECommerce\ECommerceFeature f'); - $features = $query->getResult(); - - $product = $features[0]->getProduct(); - $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $product); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $product); - $this->assertFalse($product->__isInitialized__); - $this->assertSame('Doctrine Cookbook', $product->getName()); - $this->assertTrue($product->__isInitialized__); - } - - public function testLazyLoadsObjectsOnTheInverseSide2() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - $this->_createFixture(); - - $query = $this->_em->createQuery('select f,p from Doctrine\Tests\Models\ECommerce\ECommerceFeature f join f.product p'); - $features = $query->getResult(); - - $product = $features[0]->getProduct(); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $product); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $product); - $this->assertSame('Doctrine Cookbook', $product->getName()); - - $this->assertFalse($product->getFeatures()->isInitialized()); - - // This would trigger lazy-load - //$this->assertEquals(2, $product->getFeatures()->count()); - //$this->assertTrue($product->getFeatures()->contains($features[0])); - //$this->assertTrue($product->getFeatures()->contains($features[1])); - - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(null); - } - - public function testJoinFromOwningSide() - { - $query = $this->_em->createQuery('select f,p from Doctrine\Tests\Models\ECommerce\ECommerceFeature f join f.product p'); - $features = $query->getResult(); - $this->assertEquals(0, count($features)); - } - - private function _createFixture() - { - $this->product->addFeature($this->firstFeature); - $this->product->addFeature($this->secondFeature); - $this->_em->persist($this->product); - - $this->_em->flush(); - $this->_em->clear(); - } - - public function assertFeatureForeignKeyIs($value, ECommerceFeature $feature) { - $foreignKey = $this->_em->getConnection()->executeQuery( - 'SELECT product_id FROM ecommerce_features WHERE id=?', - array($feature->getId()) - )->fetchColumn(); - $this->assertEquals($value, $foreignKey); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManyOrphanRemovalTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManyOrphanRemovalTest.php deleted file mode 100644 index 28101cc..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManyOrphanRemovalTest.php +++ /dev/null @@ -1,75 +0,0 @@ -useModelSet('cms'); - - parent::setUp(); - - $user = new CmsUser; - $user->status = 'dev'; - $user->username = 'romanb'; - $user->name = 'Roman B.'; - - $phone = new CmsPhonenumber; - $phone->phonenumber = '123456'; - - $user->addPhonenumber($phone); - - $this->_em->persist($user); - $this->_em->flush(); - - $this->userId = $user->getId(); - $this->_em->clear(); - } - - public function testOrphanRemoval() - { - $userProxy = $this->_em->getReference('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - - $this->_em->remove($userProxy); - $this->_em->flush(); - $this->_em->clear(); - - $query = $this->_em->createQuery('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u'); - $result = $query->getResult(); - - $this->assertEquals(0, count($result), 'CmsUser should be removed by EntityManager'); - - $query = $this->_em->createQuery('SELECT p FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p'); - $result = $query->getResult(); - - $this->assertEquals(0, count($result), 'CmsPhonenumber should be removed by orphanRemoval'); - } - - /** - * @group DDC-1496 - */ - public function testOrphanRemovalUnitializedCollection() - { - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - - $user->phonenumbers->clear(); - $this->_em->flush(); - - $query = $this->_em->createQuery('SELECT p FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p'); - $result = $query->getResult(); - - $this->assertEquals(0, count($result), 'CmsPhonenumber should be removed by orphanRemoval'); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManySelfReferentialAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManySelfReferentialAssociationTest.php deleted file mode 100644 index d162171..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManySelfReferentialAssociationTest.php +++ /dev/null @@ -1,123 +0,0 @@ -useModelSet('ecommerce'); - parent::setUp(); - $this->parent = new ECommerceCategory(); - $this->parent->setName('Programming languages books'); - $this->firstChild = new ECommerceCategory(); - $this->firstChild->setName('Java books'); - $this->secondChild = new ECommerceCategory(); - $this->secondChild->setName('Php books'); - } - - public function testSavesAOneToManyAssociationWithCascadeSaveSet() { - $this->parent->addChild($this->firstChild); - $this->parent->addChild($this->secondChild); - $this->_em->persist($this->parent); - - $this->_em->flush(); - - $this->assertForeignKeyIs($this->parent->getId(), $this->firstChild); - $this->assertForeignKeyIs($this->parent->getId(), $this->secondChild); - } - - public function testSavesAnEmptyCollection() - { - $this->_em->persist($this->parent); - $this->_em->flush(); - - $this->assertEquals(0, count($this->parent->getChildren())); - } - - public function testDoesNotSaveAnInverseSideSet() { - $this->parent->brokenAddChild($this->firstChild); - $this->_em->persist($this->parent); - $this->_em->flush(); - - $this->assertForeignKeyIs(null, $this->firstChild); - } - - public function testRemovesOneToManyAssociation() - { - $this->parent->addChild($this->firstChild); - $this->parent->addChild($this->secondChild); - $this->_em->persist($this->parent); - - $this->parent->removeChild($this->firstChild); - $this->_em->flush(); - - $this->assertForeignKeyIs(null, $this->firstChild); - $this->assertForeignKeyIs($this->parent->getId(), $this->secondChild); - } - - public function testEagerLoadsOneToManyAssociation() - { - $this->_createFixture(); - - $query = $this->_em->createQuery('select c1, c2 from Doctrine\Tests\Models\ECommerce\ECommerceCategory c1 join c1.children c2'); - $result = $query->getResult(); - $this->assertEquals(1, count($result)); - $parent = $result[0]; - $children = $parent->getChildren(); - - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceCategory', $children[0]); - $this->assertSame($parent, $children[0]->getParent()); - $this->assertEquals(' books', strstr($children[0]->getName(), ' books')); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceCategory', $children[1]); - $this->assertSame($parent, $children[1]->getParent()); - $this->assertEquals(' books', strstr($children[1]->getName(), ' books')); - } - - public function testLazyLoadsOneToManyAssociation() - { - $this->_createFixture(); - $metadata = $this->_em->getClassMetadata('Doctrine\Tests\Models\ECommerce\ECommerceCategory'); - $metadata->associationMappings['children']['fetch'] = ClassMetadata::FETCH_LAZY; - - $query = $this->_em->createQuery('select c from Doctrine\Tests\Models\ECommerce\ECommerceCategory c order by c.id asc'); - $result = $query->getResult(); - $parent = $result[0]; - $children = $parent->getChildren(); - - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceCategory', $children[0]); - $this->assertSame($parent, $children[0]->getParent()); - $this->assertEquals(' books', strstr($children[0]->getName(), ' books')); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceCategory', $children[1]); - $this->assertSame($parent, $children[1]->getParent()); - $this->assertEquals(' books', strstr($children[1]->getName(), ' books')); - } - - private function _createFixture() - { - $this->parent->addChild($this->firstChild); - $this->parent->addChild($this->secondChild); - $this->_em->persist($this->parent); - - $this->_em->flush(); - $this->_em->clear(); - } - - public function assertForeignKeyIs($value, ECommerceCategory $child) { - $foreignKey = $this->_em->getConnection()->executeQuery('SELECT parent_id FROM ecommerce_categories WHERE id=?', array($child->getId()))->fetchColumn(); - $this->assertEquals($value, $foreignKey); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManyUnidirectionalAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManyUnidirectionalAssociationTest.php deleted file mode 100644 index 42fd292..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManyUnidirectionalAssociationTest.php +++ /dev/null @@ -1,86 +0,0 @@ -useModelSet('routing'); - parent::setUp(); - - $locations = array("Berlin", "Bonn", "Brasilia", "Atlanta"); - - foreach ($locations AS $locationName) { - $location = new RoutingLocation(); - $location->name = $locationName; - $this->_em->persist($location); - $this->locations[$locationName] = $location; - } - $this->_em->flush(); - } - - public function testPersistOwning_InverseCascade() - { - $leg = new RoutingLeg(); - $leg->fromLocation = $this->locations['Berlin']; - $leg->toLocation = $this->locations['Bonn']; - $leg->departureDate = new \DateTime("now"); - $leg->arrivalDate = new \DateTime("now +5 hours"); - - $route = new RoutingRoute(); - $route->legs[] = $leg; - - $this->_em->persist($route); - $this->_em->flush(); - $this->_em->clear(); - - $routes = $this->_em->createQuery( - "SELECT r, l, f, t FROM Doctrine\Tests\Models\Routing\RoutingRoute r ". - "JOIN r.legs l JOIN l.fromLocation f JOIN l.toLocation t" - )->getSingleResult(); - - $this->assertEquals(1, count($routes->legs)); - $this->assertEquals("Berlin", $routes->legs[0]->fromLocation->name); - $this->assertEquals("Bonn", $routes->legs[0]->toLocation->name); - } - - public function testLegsAreUniqueToRoutes() - { - $leg = new RoutingLeg(); - $leg->fromLocation = $this->locations['Berlin']; - $leg->toLocation = $this->locations['Bonn']; - $leg->departureDate = new \DateTime("now"); - $leg->arrivalDate = new \DateTime("now +5 hours"); - - $routeA = new RoutingRoute(); - $routeA->legs[] = $leg; - - $routeB = new RoutingRoute(); - $routeB->legs[] = $leg; - - $this->_em->persist($routeA); - $this->_em->persist($routeB); - - $exceptionThrown = false; - try { - // exception depending on the underyling Database Driver - $this->_em->flush(); - } catch(\Exception $e) { - $exceptionThrown = true; - } - - $this->assertTrue($exceptionThrown, "The underlying database driver throws an exception."); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneBidirectionalAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneBidirectionalAssociationTest.php deleted file mode 100644 index ced524c..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneBidirectionalAssociationTest.php +++ /dev/null @@ -1,151 +0,0 @@ -useModelSet('ecommerce'); - parent::setUp(); - $this->customer = new ECommerceCustomer(); - $this->customer->setName('John Doe'); - $this->cart = new ECommerceCart(); - $this->cart->setPayment('Credit card'); - } - - public function testSavesAOneToOneAssociationWithCascadeSaveSet() { - $this->customer->setCart($this->cart); - $this->_em->persist($this->customer); - $this->_em->flush(); - - $this->assertCartForeignKeyIs($this->customer->getId()); - } - - public function testDoesNotSaveAnInverseSideSet() { - $this->customer->brokenSetCart($this->cart); - $this->_em->persist($this->customer); - $this->_em->flush(); - - $this->assertCartForeignKeyIs(null); - } - - public function testRemovesOneToOneAssociation() - { - $this->customer->setCart($this->cart); - $this->_em->persist($this->customer); - $this->customer->removeCart(); - - $this->_em->flush(); - - $this->assertCartForeignKeyIs(null); - } - - public function testEagerLoad() - { - $this->_createFixture(); - - $query = $this->_em->createQuery('select c, ca from Doctrine\Tests\Models\ECommerce\ECommerceCustomer c join c.cart ca'); - $result = $query->getResult(); - $customer = $result[0]; - - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceCart', $customer->getCart()); - $this->assertEquals('paypal', $customer->getCart()->getPayment()); - } - - public function testLazyLoadsObjectsOnTheOwningSide() { - $this->_createFixture(); - $metadata = $this->_em->getClassMetadata('Doctrine\Tests\Models\ECommerce\ECommerceCart'); - $metadata->associationMappings['customer']['fetchMode'] = ClassMetadata::FETCH_LAZY; - - $query = $this->_em->createQuery('select c from Doctrine\Tests\Models\ECommerce\ECommerceCart c'); - $result = $query->getResult(); - $cart = $result[0]; - - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceCustomer', $cart->getCustomer()); - $this->assertEquals('Giorgio', $cart->getCustomer()->getName()); - } - - public function testInverseSideIsNeverLazy() - { - $this->_createFixture(); - $metadata = $this->_em->getClassMetadata('Doctrine\Tests\Models\ECommerce\ECommerceCustomer'); - $metadata->associationMappings['mentor']['fetch'] = ClassMetadata::FETCH_EAGER; - - $query = $this->_em->createQuery('select c from Doctrine\Tests\Models\ECommerce\ECommerceCustomer c'); - $result = $query->getResult(); - $customer = $result[0]; - - $this->assertNull($customer->getMentor()); - $this->assertInstanceOF('Doctrine\Tests\Models\ECommerce\ECommerceCart', $customer->getCart()); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $customer->getCart()); - $this->assertEquals('paypal', $customer->getCart()->getPayment()); - } - - public function testUpdateWithProxyObject() - { - $cust = new ECommerceCustomer; - $cust->setName('Roman'); - $cart = new ECommerceCart; - $cart->setPayment('CARD'); - $cust->setCart($cart); - - $this->_em->persist($cust); - $this->_em->flush(); - $this->_em->clear(); - - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceCart', $cust->getCart()); - $this->assertEquals('Roman', $cust->getName()); - $this->assertSame($cust, $cart->getCustomer()); - - $query = $this->_em->createQuery('select ca from Doctrine\Tests\Models\ECommerce\ECommerceCart ca where ca.id =?1'); - $query->setParameter(1, $cart->getId()); - - $cart2 = $query->getSingleResult(); - - $cart2->setPayment('CHEQUE'); - - $this->_em->flush(); - $this->_em->clear(); - - $query2 = $this->_em->createQuery('select ca, c from Doctrine\Tests\Models\ECommerce\ECommerceCart ca left join ca.customer c where ca.id =?1'); - $query2->setParameter(1, $cart->getId()); - - $cart3 = $query2->getSingleResult(); - - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceCustomer', $cart3->getCustomer()); - $this->assertEquals('Roman', $cart3->getCustomer()->getName()); - } - - protected function _createFixture() - { - $customer = new ECommerceCustomer; - $customer->setName('Giorgio'); - $cart = new ECommerceCart; - $cart->setPayment('paypal'); - $customer->setCart($cart); - - $this->_em->persist($customer); - - $this->_em->flush(); - $this->_em->clear(); - } - - public function assertCartForeignKeyIs($value) { - $foreignKey = $this->_em->getConnection()->executeQuery('SELECT customer_id FROM ecommerce_carts WHERE id=?', array($this->cart->getId()))->fetchColumn(); - $this->assertEquals($value, $foreignKey); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneEagerLoadingTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneEagerLoadingTest.php deleted file mode 100644 index 8c6bdf0..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneEagerLoadingTest.php +++ /dev/null @@ -1,307 +0,0 @@ -_em); - try { - $schemaTool->createSchema(array( - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\Train'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\TrainDriver'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\TrainOwner'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\Waggon'), - )); - } catch(\Exception $e) {} - } - - public function testEagerLoadOneToOneOwningSide() - { - $train = new Train(new TrainOwner("Alexander")); - $driver = new TrainDriver("Benjamin"); - $waggon = new Waggon(); - - $train->setDriver($driver); - $train->addWaggon($waggon); - - $this->_em->persist($train); // cascades - $this->_em->flush(); - $this->_em->clear(); - - $sqlCount = count($this->_sqlLoggerStack->queries); - - $train = $this->_em->find(get_class($train), $train->id); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $train->driver); - $this->assertEquals("Benjamin", $train->driver->name); - - $this->assertEquals($sqlCount + 1, count($this->_sqlLoggerStack->queries)); - } - - public function testEagerLoadOneToOneNullOwningSide() - { - $train = new Train(new TrainOwner("Alexander")); - - $this->_em->persist($train); // cascades - $this->_em->flush(); - $this->_em->clear(); - - $sqlCount = count($this->_sqlLoggerStack->queries); - - $train = $this->_em->find(get_class($train), $train->id); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $train->driver); - $this->assertNull($train->driver); - - $this->assertEquals($sqlCount + 1, count($this->_sqlLoggerStack->queries)); - } - - public function testEagerLoadOneToOneInverseSide() - { - $owner = new TrainOwner("Alexander"); - $train = new Train($owner); - - $this->_em->persist($train); // cascades - $this->_em->flush(); - $this->_em->clear(); - - $sqlCount = count($this->_sqlLoggerStack->queries); - - $driver = $this->_em->find(get_class($owner), $owner->id); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $owner->train); - $this->assertNotNull($owner->train); - - $this->assertEquals($sqlCount + 1, count($this->_sqlLoggerStack->queries)); - } - - public function testEagerLoadOneToOneNullInverseSide() - { - $driver = new TrainDriver("Dagny Taggert"); - - $this->_em->persist($driver); - $this->_em->flush(); - $this->_em->clear(); - - $this->assertNull($driver->train); - - $sqlCount = count($this->_sqlLoggerStack->queries); - - $driver = $this->_em->find(get_class($driver), $driver->id); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $driver->train); - $this->assertNull($driver->train); - - $this->assertEquals($sqlCount + 1, count($this->_sqlLoggerStack->queries)); - } - - public function testEagerLoadManyToOne() - { - $train = new Train(new TrainOwner("Alexander")); - $waggon = new Waggon(); - $train->addWaggon($waggon); - - $this->_em->persist($train); // cascades - $this->_em->flush(); - $this->_em->clear(); - - $waggon = $this->_em->find(get_class($waggon), $waggon->id); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $waggon->train); - $this->assertNotNull($waggon->train); - } - - public function testEagerLoadWithNullableColumnsGeneratesLeftJoinOnBothSides() - { - $train = new Train(new TrainOwner("Alexander")); - $driver = new TrainDriver("Benjamin"); - $train->setDriver($driver); - - $this->_em->persist($train); - $this->_em->flush(); - $this->_em->clear(); - - $train = $this->_em->find(get_class($train), $train->id); - $this->assertSQLEquals( - "SELECT t0.id AS id1, t0.driver_id AS driver_id2, t3.id AS id4, t3.name AS name5, t0.owner_id AS owner_id6, t7.id AS id8, t7.name AS name9 FROM Train t0 LEFT JOIN TrainDriver t3 ON t0.driver_id = t3.id INNER JOIN TrainOwner t7 ON t0.owner_id = t7.id WHERE t0.id = ?", - $this->_sqlLoggerStack->queries[$this->_sqlLoggerStack->currentQuery]['sql'] - ); - - $this->_em->clear(); - $driver = $this->_em->find(get_class($driver), $driver->id); - $this->assertSQLEquals( - "SELECT t0.id AS id1, t0.name AS name2, t3.id AS id4, t3.driver_id AS driver_id5, t3.owner_id AS owner_id6 FROM TrainOwner t0 LEFT JOIN Train t3 ON t3.owner_id = t0.id WHERE t0.id IN (?)", - $this->_sqlLoggerStack->queries[$this->_sqlLoggerStack->currentQuery]['sql'] - ); - } - - public function testEagerLoadWithNonNullableColumnsGeneratesInnerJoinOnOwningSide() - { - $waggon = new Waggon(); - - // It should have a train - $train = new Train(new TrainOwner("Alexander")); - $train->addWaggon($waggon); - - $this->_em->persist($train); - $this->_em->flush(); - $this->_em->clear(); - - $waggon = $this->_em->find(get_class($waggon), $waggon->id); - - // The last query is the eager loading of the owner of the train - $this->assertSQLEquals( - "SELECT t0.id AS id1, t0.name AS name2, t3.id AS id4, t3.driver_id AS driver_id5, t3.owner_id AS owner_id6 FROM TrainOwner t0 LEFT JOIN Train t3 ON t3.owner_id = t0.id WHERE t0.id IN (?)", - $this->_sqlLoggerStack->queries[$this->_sqlLoggerStack->currentQuery]['sql'] - ); - - // The one before is the fetching of the waggon and train - $this->assertSQLEquals( - "SELECT t0.id AS id1, t0.train_id AS train_id2, t3.id AS id4, t3.driver_id AS driver_id5, t3.owner_id AS owner_id6 FROM Waggon t0 INNER JOIN Train t3 ON t0.train_id = t3.id WHERE t0.id = ?", - $this->_sqlLoggerStack->queries[$this->_sqlLoggerStack->currentQuery - 1]['sql'] - ); - } - - public function testEagerLoadWithNonNullableColumnsGeneratesLeftJoinOnNonOwningSide() - { - $owner = new TrainOwner('Alexander'); - $train = new Train($owner); - $this->_em->persist($train); - $this->_em->flush(); - $this->_em->clear(); - - $waggon = $this->_em->find(get_class($owner), $owner->id); - $this->assertSQLEquals( - "SELECT t0.id AS id1, t0.name AS name2, t3.id AS id4, t3.driver_id AS driver_id5, t3.owner_id AS owner_id6 FROM TrainOwner t0 LEFT JOIN Train t3 ON t3.owner_id = t0.id WHERE t0.id = ?", - $this->_sqlLoggerStack->queries[$this->_sqlLoggerStack->currentQuery]['sql'] - ); - } -} - -/** - * @Entity - */ -class Train -{ - /** - * @id @column(type="integer") @generatedValue - * @var int - */ - public $id; - /** - * Owning side - * @OneToOne(targetEntity="TrainDriver", inversedBy="train", fetch="EAGER", cascade={"persist"}) - * @JoinColumn(nullable=true) - */ - public $driver; - /** - * Owning side - * @OneToOne(targetEntity="TrainOwner", inversedBy="train", fetch="EAGER", cascade={"persist"}) - * @JoinColumn(nullable=false) - */ - public $owner; - /** - * @oneToMany(targetEntity="Waggon", mappedBy="train", cascade={"persist"}) - */ - public $waggons; - - public function __construct(TrainOwner $owner) - { - $this->waggons = new \Doctrine\Common\Collections\ArrayCollection(); - $this->setOwner($owner); - } - - public function setDriver(TrainDriver $driver) - { - $this->driver = $driver; - $driver->setTrain($this); - } - - public function setOwner(TrainOwner $owner) - { - $this->owner = $owner; - $owner->setTrain($this); - } - - public function addWaggon(Waggon $w) - { - $w->setTrain($this); - $this->waggons[] = $w; - } -} - -/** - * @Entity - */ -class TrainDriver -{ - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; - /** @column(type="string") */ - public $name; - /** - * Inverse side - * @OneToOne(targetEntity="Train", mappedBy="driver", fetch="EAGER") - */ - public $train; - - public function __construct($name) - { - $this->name = $name; - } - - public function setTrain(Train $t) - { - $this->train = $t; - } -} - -/** - * @Entity - */ -class TrainOwner -{ - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; - /** @column(type="string") */ - public $name; - /** - * Inverse side - * @OneToOne(targetEntity="Train", mappedBy="owner", fetch="EAGER") - */ - public $train; - - public function __construct($name) - { - $this->name = $name; - } - - public function setTrain(Train $t) - { - $this->train = $t; - } -} - -/** - * @Entity - */ -class Waggon -{ - /** @id @generatedValue @column(type="integer") */ - public $id; - /** - * @ManyToOne(targetEntity="Train", inversedBy="waggons", fetch="EAGER") - * @JoinColumn(nullable=false) - */ - public $train; - - public function setTrain($train) - { - $this->train = $train; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneOrphanRemovalTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneOrphanRemovalTest.php deleted file mode 100644 index 6b3d0a2..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneOrphanRemovalTest.php +++ /dev/null @@ -1,94 +0,0 @@ -useModelSet('cms'); - - parent::setUp(); - } - - public function testOrphanRemoval() - { - $user = new CmsUser; - $user->status = 'dev'; - $user->username = 'romanb'; - $user->name = 'Roman B.'; - - $address = new CmsAddress; - $address->country = 'de'; - $address->zip = 1234; - $address->city = 'Berlin'; - - $user->setAddress($address); - - $this->_em->persist($user); - $this->_em->flush(); - - $userId = $user->getId(); - - $this->_em->clear(); - - $userProxy = $this->_em->getReference('Doctrine\Tests\Models\CMS\CmsUser', $userId); - - $this->_em->remove($userProxy); - $this->_em->flush(); - $this->_em->clear(); - - $query = $this->_em->createQuery('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u'); - $result = $query->getResult(); - - $this->assertEquals(0, count($result), 'CmsUser should be removed by EntityManager'); - - $query = $this->_em->createQuery('SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a'); - $result = $query->getResult(); - - $this->assertEquals(0, count($result), 'CmsAddress should be removed by orphanRemoval'); - } - - public function testOrphanRemovalWhenUnlink() - { - $user = new CmsUser; - $user->status = 'dev'; - $user->username = 'beberlei'; - $user->name = 'Bejamin Eberlei'; - - $email = new CmsEmail; - $email->email = 'beberlei@domain.com'; - - $user->setEmail($email); - - $this->_em->persist($user); - $this->_em->flush(); - - $userId = $user->getId(); - - $this->_em->clear(); - - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $userId); - - $user->setEmail(null); - - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - - $query = $this->_em->createQuery('SELECT e FROM Doctrine\Tests\Models\CMS\CmsEmail e'); - $result = $query->getResult(); - - $this->assertEquals(0, count($result), 'CmsEmail should be removed by orphanRemoval'); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneSelfReferentialAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneSelfReferentialAssociationTest.php deleted file mode 100644 index 326e7ae..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneSelfReferentialAssociationTest.php +++ /dev/null @@ -1,165 +0,0 @@ -useModelSet('ecommerce'); - parent::setUp(); - $this->customer = new ECommerceCustomer(); - $this->customer->setName('Anakin Skywalker'); - $this->mentor = new ECommerceCustomer(); - $this->mentor->setName('Obi-wan Kenobi'); - } - - public function testSavesAOneToOneAssociationWithCascadeSaveSet() { - $this->customer->setMentor($this->mentor); - $this->_em->persist($this->customer); - $this->_em->flush(); - - $this->assertForeignKeyIs($this->mentor->getId()); - } - - public function testRemovesOneToOneAssociation() - { - $this->customer->setMentor($this->mentor); - $this->_em->persist($this->customer); - $this->customer->removeMentor(); - - $this->_em->flush(); - - $this->assertForeignKeyIs(null); - } - - public function testFind() - { - $id = $this->_createFixture(); - - $customer = $this->_em->find('Doctrine\Tests\Models\ECommerce\ECommerceCustomer', $id); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $customer->getMentor()); - } - - public function testEagerLoadsAssociation() - { - $this->_createFixture(); - - $query = $this->_em->createQuery('select c, m from Doctrine\Tests\Models\ECommerce\ECommerceCustomer c left join c.mentor m order by c.id asc'); - $result = $query->getResult(); - $customer = $result[0]; - $this->assertLoadingOfAssociation($customer); - } - - /** - * @group mine - * @return unknown_type - */ - public function testLazyLoadsAssociation() - { - $this->_createFixture(); - - $metadata = $this->_em->getClassMetadata('Doctrine\Tests\Models\ECommerce\ECommerceCustomer'); - $metadata->associationMappings['mentor']['fetch'] = ClassMetadata::FETCH_LAZY; - - $query = $this->_em->createQuery("select c from Doctrine\Tests\Models\ECommerce\ECommerceCustomer c where c.name='Luke Skywalker'"); - $result = $query->getResult(); - $customer = $result[0]; - $this->assertLoadingOfAssociation($customer); - } - - public function testMultiSelfReference() - { - try { - $this->_schemaTool->createSchema(array( - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\MultiSelfReference') - )); - } catch (\Exception $e) { - // Swallow all exceptions. We do not test the schema tool here. - } - - $entity1 = new MultiSelfReference(); - $this->_em->persist($entity1); - $entity1->setOther1($entity2 = new MultiSelfReference); - $entity1->setOther2($entity3 = new MultiSelfReference); - $this->_em->flush(); - - $this->_em->clear(); - - $entity2 = $this->_em->find(get_class($entity1), $entity1->getId()); - - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\MultiSelfReference', $entity2->getOther1()); - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\MultiSelfReference', $entity2->getOther2()); - $this->assertNull($entity2->getOther1()->getOther1()); - $this->assertNull($entity2->getOther1()->getOther2()); - $this->assertNull($entity2->getOther2()->getOther1()); - $this->assertNull($entity2->getOther2()->getOther2()); - } - - public function assertLoadingOfAssociation($customer) - { - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceCustomer', $customer->getMentor()); - $this->assertEquals('Obi-wan Kenobi', $customer->getMentor()->getName()); - } - - public function assertForeignKeyIs($value) { - $foreignKey = $this->_em->getConnection()->executeQuery('SELECT mentor_id FROM ecommerce_customers WHERE id=?', array($this->customer->getId()))->fetchColumn(); - $this->assertEquals($value, $foreignKey); - } - - private function _createFixture() - { - $customer = new ECommerceCustomer; - $customer->setName('Luke Skywalker'); - $mentor = new ECommerceCustomer; - $mentor->setName('Obi-wan Kenobi'); - $customer->setMentor($mentor); - - $this->_em->persist($customer); - - $this->_em->flush(); - $this->_em->clear(); - - return $customer->getId(); - } -} - -/** - * @Entity - */ -class MultiSelfReference { - /** @Id @GeneratedValue(strategy="AUTO") @Column(type="integer") */ - private $id; - /** - * @OneToOne(targetEntity="MultiSelfReference", cascade={"persist"}) - * @JoinColumn(name="other1", referencedColumnName="id") - */ - private $other1; - /** - * @OneToOne(targetEntity="MultiSelfReference", cascade={"persist"}) - * @JoinColumn(name="other2", referencedColumnName="id") - */ - private $other2; - - public function getId() {return $this->id;} - public function setOther1($other1) {$this->other1 = $other1;} - public function getOther1() {return $this->other1;} - public function setOther2($other2) {$this->other2 = $other2;} - public function getOther2() {return $this->other2;} -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneUnidirectionalAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneUnidirectionalAssociationTest.php deleted file mode 100644 index 1ffae6b..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneUnidirectionalAssociationTest.php +++ /dev/null @@ -1,125 +0,0 @@ -useModelSet('ecommerce'); - parent::setUp(); - $this->product = new ECommerceProduct(); - $this->product->setName('Doctrine 2 Manual'); - $this->shipping = new ECommerceShipping(); - $this->shipping->setDays('5'); - } - - public function testSavesAOneToOneAssociationWithCascadeSaveSet() { - $this->product->setShipping($this->shipping); - $this->_em->persist($this->product); - $this->_em->flush(); - - $this->assertForeignKeyIs($this->shipping->getId()); - } - - public function testRemovesOneToOneAssociation() - { - $this->product->setShipping($this->shipping); - $this->_em->persist($this->product); - $this->product->removeShipping(); - - $this->_em->flush(); - - $this->assertForeignKeyIs(null); - } - - public function _testEagerLoad() - { - $this->_createFixture(); - - $query = $this->_em->createQuery('select p, s from Doctrine\Tests\Models\ECommerce\ECommerceProduct p left join p.shipping s'); - $result = $query->getResult(); - $product = $result[0]; - - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceShipping', $product->getShipping()); - $this->assertEquals(1, $product->getShipping()->getDays()); - } - - public function testLazyLoadsObjects() { - $this->_createFixture(); - $metadata = $this->_em->getClassMetadata('Doctrine\Tests\Models\ECommerce\ECommerceProduct'); - $metadata->associationMappings['shipping']['fetch'] = ClassMetadata::FETCH_LAZY; - - $query = $this->_em->createQuery('select p from Doctrine\Tests\Models\ECommerce\ECommerceProduct p'); - $result = $query->getResult(); - $product = $result[0]; - - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceShipping', $product->getShipping()); - $this->assertEquals(1, $product->getShipping()->getDays()); - } - - public function testDoesNotLazyLoadObjectsIfConfigurationDoesNotAllowIt() { - $this->_createFixture(); - - $query = $this->_em->createQuery('select p from Doctrine\Tests\Models\ECommerce\ECommerceProduct p'); - $query->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true); - - $result = $query->getResult(); - $product = $result[0]; - - $this->assertNull($product->getShipping()); - } - - protected function _createFixture() - { - $product = new ECommerceProduct; - $product->setName('Php manual'); - $shipping = new ECommerceShipping; - $shipping->setDays('1'); - $product->setShipping($shipping); - - $this->_em->persist($product); - - $this->_em->flush(); - $this->_em->clear(); - } - - public function assertForeignKeyIs($value) { - $foreignKey = $this->_em->getConnection()->executeQuery( - 'SELECT shipping_id FROM ecommerce_products WHERE id=?', - array($this->product->getId()) - )->fetchColumn(); - $this->assertEquals($value, $foreignKey); - } - - /** - * @group DDC-762 - */ - public function testNullForeignKey() - { - $product = new ECommerceProduct(); - $product->setName('Doctrine 2 Manual'); - - $this->_em->persist($product); - $this->_em->flush(); - - $product = $this->_em->find(get_class($product), $product->getId()); - - $this->assertNull($product->getShipping()); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OrderedCollectionTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OrderedCollectionTest.php deleted file mode 100644 index c2e131c..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OrderedCollectionTest.php +++ /dev/null @@ -1,113 +0,0 @@ -useModelSet('routing'); - parent::setUp(); - - $locations = array("Berlin", "Bonn", "Brasilia", "Atlanta"); - - foreach ($locations AS $locationName) { - $location = new RoutingLocation(); - $location->name = $locationName; - $this->_em->persist($location); - $this->locations[$locationName] = $location; - } - $this->_em->flush(); - } - - public function createPersistedRouteWithLegs() - { - $route = new RoutingRoute(); - - $leg1 = new RoutingLeg(); - $leg1->fromLocation = $this->locations['Berlin']; - $leg1->toLocation = $this->locations['Bonn']; - $leg1->departureDate = new \DateTime("now"); - $leg1->arrivalDate = new \DateTime("now +5 hours"); - - $leg2 = new RoutingLeg(); - $leg2->fromLocation = $this->locations['Bonn']; - $leg2->toLocation = $this->locations['Brasilia']; - $leg2->departureDate = new \DateTime("now +6 hours"); - $leg2->arrivalDate = new \DateTime("now +24 hours"); - - $route->legs[] = $leg2; - $route->legs[] = $leg1; - - $this->_em->persist($route); - $this->_em->flush(); - $routeId = $route->id; - $this->_em->clear(); - - return $routeId; - } - - public function testLazyManyToManyCollection_IsRetrievedWithOrderByClause() - { - $routeId = $this->createPersistedRouteWithLegs(); - - $route = $this->_em->find('Doctrine\Tests\Models\Routing\RoutingRoute', $routeId); - - $this->assertEquals(2, count($route->legs)); - $this->assertEquals("Berlin", $route->legs[0]->fromLocation->getName()); - $this->assertEquals("Bonn", $route->legs[1]->fromLocation->getName()); - } - - public function testLazyOneToManyCollection_IsRetrievedWithOrderByClause() - { - $route = new RoutingRoute(); - - $this->_em->persist($route); - $this->_em->flush(); - $routeId = $route->id; - - $booking1 = new RoutingRouteBooking(); - $booking1->passengerName = "Guilherme"; - $booking2 = new RoutingRouteBooking(); - $booking2->passengerName = "Benjamin"; - - $route->bookings[] = $booking1; - $booking1->route = $route; - $route->bookings[] = $booking2; - $booking2->route = $route; - - $this->_em->persist($booking1); - $this->_em->persist($booking2); - - $this->_em->flush(); - $this->_em->clear(); - - $route = $this->_em->find('Doctrine\Tests\Models\Routing\RoutingRoute', $routeId); - - $this->assertEquals(2, count($route->bookings)); - $this->assertEquals('Benjamin', $route->bookings[0]->getPassengerName()); - $this->assertEquals('Guilherme', $route->bookings[1]->getPassengerName()); - } - - public function testOrderedResultFromDqlQuery() - { - $routeId = $this->createPersistedRouteWithLegs(); - - $route = $this->_em->createQuery("SELECT r, l FROM Doctrine\Tests\Models\Routing\RoutingRoute r JOIN r.legs l WHERE r.id = ?1") - ->setParameter(1, $routeId) - ->getSingleResult(); - - $this->assertEquals(2, count($route->legs)); - $this->assertEquals("Berlin", $route->legs[0]->fromLocation->getName()); - $this->assertEquals("Bonn", $route->legs[1]->fromLocation->getName()); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OrderedJoinedTableInheritanceCollectionTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OrderedJoinedTableInheritanceCollectionTest.php deleted file mode 100644 index 8c0d37b..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OrderedJoinedTableInheritanceCollectionTest.php +++ /dev/null @@ -1,133 +0,0 @@ - - */ -class OrderedJoinedTableInheritanceCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase -{ - protected function setUp() { - parent::setUp(); - try { - $this->_schemaTool->createSchema(array( - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\OJTIC_Pet'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\OJTIC_Cat'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\OJTIC_Dog'), - )); - } catch (\Exception $e) { - // Swallow all exceptions. We do not test the schema tool here. - } - - $dog = new OJTIC_Dog(); - $dog->name = "Poofy"; - - $dog1 = new OJTIC_Dog(); - $dog1->name = "Zampa"; - $dog2 = new OJTIC_Dog(); - $dog2->name = "Aari"; - - $dog1->mother = $dog; - $dog2->mother = $dog; - - $dog->children[] = $dog1; - $dog->children[] = $dog2; - - $this->_em->persist($dog); - $this->_em->persist($dog1); - $this->_em->persist($dog2); - $this->_em->flush(); - $this->_em->clear(); - } - - public function testOrderdOneToManyCollection() - { - $poofy = $this->_em->createQuery("SELECT p FROM Doctrine\Tests\ORM\Functional\OJTIC_Pet p WHERE p.name = 'Poofy'")->getSingleResult(); - - $this->assertEquals('Aari', $poofy->children[0]->getName()); - $this->assertEquals('Zampa', $poofy->children[1]->getName()); - - $this->_em->clear(); - - $result = $this->_em->createQuery( - "SELECT p, c FROM Doctrine\Tests\ORM\Functional\OJTIC_Pet p JOIN p.children c WHERE p.name = 'Poofy'") - ->getResult(); - - $this->assertEquals(1, count($result)); - $poofy = $result[0]; - - $this->assertEquals('Aari', $poofy->children[0]->getName()); - $this->assertEquals('Zampa', $poofy->children[1]->getName()); - } -} - -/** - * @Entity - * @InheritanceType("JOINED") - * @DiscriminatorColumn(name="discr", type="string") - * @DiscriminatorMap({ - * "cat" = "OJTIC_Cat", - * "dog" = "OJTIC_Dog"}) - */ -abstract class OJTIC_Pet -{ - /** - * @Id - * @column(type="integer") - * @generatedValue(strategy="AUTO") - */ - public $id; - - /** - * - * @Column - */ - public $name; - - /** - * @ManyToOne(targetEntity="OJTIC_PET") - */ - public $mother; - - /** - * @OneToMany(targetEntity="OJTIC_Pet", mappedBy="mother") - * @OrderBy({"name" = "ASC"}) - */ - public $children; - - /** - * @ManyToMany(targetEntity="OJTIC_Pet") - * @JoinTable(name="OTJIC_Pet_Friends", - * joinColumns={@JoinColumn(name="pet_id", referencedColumnName="id")}, - * inverseJoinColumns={@JoinColumn(name="friend_id", referencedColumnName="id")}) - * @OrderBy({"name" = "ASC"}) - */ - public $friends; - - public function getName() - { - return $this->name; - } -} - -/** - * @Entity - */ -class OJTIC_Cat extends OJTIC_Pet -{ - -} - -/** - * @Entity - */ -class OJTIC_Dog extends OJTIC_Pet -{ - -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PaginationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PaginationTest.php deleted file mode 100644 index 9903535..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PaginationTest.php +++ /dev/null @@ -1,105 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - $this->populate(); - } - - public function testCountSimpleWithoutJoin() - { - $dql = "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u"; - $query = $this->_em->createQuery($dql); - - $paginator = new Paginator($query); - $this->assertEquals(3, count($paginator)); - } - - public function testCountWithFetchJoin() - { - $dql = "SELECT u,g FROM Doctrine\Tests\Models\CMS\CmsUser u JOIN u.groups g"; - $query = $this->_em->createQuery($dql); - - $paginator = new Paginator($query); - $this->assertEquals(3, count($paginator)); - } - - public function testIterateSimpleWithoutJoinFetchJoinHandlingOff() - { - $dql = "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u"; - $query = $this->_em->createQuery($dql); - - $paginator = new Paginator($query, false); - - $data = array(); - foreach ($paginator as $user) { - $data[] = $user; - } - $this->assertEquals(3, count($data)); - } - - public function testIterateSimpleWithoutJoinFetchJoinHandlingOn() - { - $dql = "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u"; - $query = $this->_em->createQuery($dql); - - $paginator = new Paginator($query, true); - - $data = array(); - foreach ($paginator as $user) { - $data[] = $user; - } - $this->assertEquals(3, count($data)); - } - - public function testIterateWithFetchJoin() - { - $dql = "SELECT u,g FROM Doctrine\Tests\Models\CMS\CmsUser u JOIN u.groups g"; - $query = $this->_em->createQuery($dql); - - $paginator = new Paginator($query, true); - - $data = array(); - foreach ($paginator as $user) { - $data[] = $user; - } - $this->assertEquals(3, count($data)); - } - - public function populate() - { - for ($i = 0; $i < 3; $i++) { - $user = new CmsUser(); - $user->name = "Name$i"; - $user->username = "username$i"; - $user->status = "active"; - $this->_em->persist($user); - - for ($j = 0; $j < 3; $j++) {; - $group = new CmsGroup(); - $group->name = "group$j"; - $user->addGroup($group); - $this->_em->persist($group); - } - } - $this->_em->flush(); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionTest.php deleted file mode 100644 index 2125966..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionTest.php +++ /dev/null @@ -1,98 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\PersistentCollectionHolder'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\PersistentCollectionContent'), - )); - } catch (\Exception $e) { - - } - PersistentObject::setObjectManager($this->_em); - } - - public function testPersist() - { - $collectionHolder = new PersistentCollectionHolder(); - $content = new PersistentCollectionContent('first element'); - $collectionHolder->addElement($content); - - $this->_em->persist($collectionHolder); - $this->_em->flush(); - $this->_em->clear(); - - $collectionHolder = $this->_em->find(__NAMESPACE__ . '\PersistentCollectionHolder', $collectionHolder->getId()); - $collectionHolder->getCollection(); - - $content = new PersistentCollectionContent('second element'); - $collectionHolder->addElement($content); - - $this->assertEquals(2, $collectionHolder->getCollection()->count()); - } - -} - -/** - * @Entity - */ -class PersistentCollectionHolder extends PersistentObject -{ - /** - * @Id @Column(type="integer") @GeneratedValue - * @var int - */ - protected $id; - - /** - * @var \Doctrine\Common\Collections\Collection - * @ManyToMany(targetEntity="PersistentCollectionContent", cascade={"all"}) - */ - protected $collection; - - public function __construct() - { - $this->collection = new \Doctrine\Common\Collections\ArrayCollection(); - } - - /** - * @param PersistentCollectionContent $element - */ - public function addElement(PersistentCollectionContent $element) - { - $this->collection->add($element); - } - - /** - * @return \Doctrine\Common\Collections\Collection - */ - public function getCollection() - { - return clone $this->collection; - } - -} - -/** - * @Entity - */ -class PersistentCollectionContent extends PersistentObject -{ - - /** - * @Id @Column(type="integer") @GeneratedValue - * @var int - */ - protected $id; - -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PersistentObjectTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PersistentObjectTest.php deleted file mode 100644 index 88e54ae..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PersistentObjectTest.php +++ /dev/null @@ -1,105 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\PersistentEntity'), - )); - } catch (\Exception $e) { - - } - PersistentObject::setObjectManager($this->_em); - } - - public function testPersist() - { - $entity = new PersistentEntity(); - $entity->setName("test"); - - $this->_em->persist($entity); - $this->_em->flush(); - } - - public function testFind() - { - $entity = new PersistentEntity(); - $entity->setName("test"); - - $this->_em->persist($entity); - $this->_em->flush(); - $this->_em->clear(); - - $entity = $this->_em->find(__NAMESPACE__ . '\PersistentEntity', $entity->getId()); - - $this->assertEquals('test', $entity->getName()); - $entity->setName('foobar'); - - $this->_em->flush(); - } - - public function testGetReference() - { - $entity = new PersistentEntity(); - $entity->setName("test"); - - $this->_em->persist($entity); - $this->_em->flush(); - $this->_em->clear(); - - $entity = $this->_em->getReference(__NAMESPACE__ . '\PersistentEntity', $entity->getId()); - - $this->assertEquals('test', $entity->getName()); - } - - public function testSetAssociation() - { - $entity = new PersistentEntity(); - $entity->setName("test"); - $entity->setParent($entity); - - $this->_em->persist($entity); - $this->_em->flush(); - $this->_em->clear(); - - $entity = $this->_em->getReference(__NAMESPACE__ . '\PersistentEntity', $entity->getId()); - $this->assertSame($entity, $entity->getParent()); - } -} - -/** - * @Entity - */ -class PersistentEntity extends PersistentObject -{ - /** - * @Id @Column(type="integer") @GeneratedValue - * @var int - */ - protected $id; - - /** - * @Column(type="string") - * @var string - */ - protected $name; - - /** - * @ManyToOne(targetEntity="PersistentEntity") - * @var PersistentEntity - */ - protected $parent; -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PostFlushEventTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PostFlushEventTest.php deleted file mode 100644 index 8198871..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PostFlushEventTest.php +++ /dev/null @@ -1,95 +0,0 @@ - - */ -class PostFlushEventTest extends \Doctrine\Tests\OrmFunctionalTestCase -{ - /** - * @var PostFlushListener - */ - private $listener; - - protected function setUp() - { - $this->useModelSet('cms'); - parent::setUp(); - $this->listener = new PostFlushListener(); - $evm = $this->_em->getEventManager(); - $evm->addEventListener(Events::postFlush, $this->listener); - } - - public function testListenerShouldBeNotified() - { - $this->_em->persist($this->createNewValidUser()); - $this->_em->flush(); - $this->assertTrue($this->listener->wasNotified); - } - - public function testListenerShouldNotBeNotifiedWhenFlushThrowsException() - { - $user = new CmsUser(); - $user->username = 'dfreudenberger'; - $this->_em->persist($user); - $exceptionRaised = false; - - try { - $this->_em->flush(); - } catch (\Exception $ex) { - $exceptionRaised = true; - } - - $this->assertTrue($exceptionRaised); - $this->assertFalse($this->listener->wasNotified); - } - - public function testListenerShouldReceiveEntityManagerThroughArgs() - { - $this->_em->persist($this->createNewValidUser()); - $this->_em->flush(); - $receivedEm = $this->listener->receivedArgs->getEntityManager(); - $this->assertSame($this->_em, $receivedEm); - } - - /** - * @return CmsUser - */ - private function createNewValidUser() - { - $user = new CmsUser(); - $user->username = 'dfreudenberger'; - $user->name = 'Daniel Freudenberger'; - return $user; - } -} - -class PostFlushListener -{ - /** - * @var bool - */ - public $wasNotified = false; - - /** - * @var PostFlushEventArgs - */ - public $receivedArgs; - - /** - * @param PostFlushEventArgs $args - */ - public function postFlush(PostFlushEventArgs $args) - { - $this->wasNotified = true; - $this->receivedArgs = $args; - } -} - - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PostgreSQLIdentityStrategyTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PostgreSQLIdentityStrategyTest.php deleted file mode 100644 index 4ee7b7c..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PostgreSQLIdentityStrategyTest.php +++ /dev/null @@ -1,53 +0,0 @@ -_em->getConnection()->getDatabasePlatform()->getName() != 'postgresql') { - $this->markTestSkipped('This test is special to the PostgreSQL IDENTITY key generation strategy.'); - } else { - try { - $this->_schemaTool->createSchema(array( - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\PostgreSQLIdentityEntity'), - )); - } catch (\Exception $e) { - // Swallow all exceptions. We do not test the schema tool here. - } - } - } - - protected function tearDown() { - parent::tearDown(); - // drop sequence manually due to dependency - $this->_em->getConnection()->exec('DROP SEQUENCE postgresqlidentityentity_id_seq CASCADE'); - } - - public function testPreSavePostSaveCallbacksAreInvoked() - { - $entity = new PostgreSQLIdentityEntity(); - $entity->setValue('hello'); - $this->_em->persist($entity); - $this->_em->flush(); - $this->assertTrue(is_numeric($entity->getId())); - $this->assertTrue($entity->getId() > 0); - $this->assertTrue($this->_em->contains($entity)); - } -} - -/** @Entity */ -class PostgreSQLIdentityEntity { - /** @Id @Column(type="integer") @GeneratedValue(strategy="IDENTITY") */ - private $id; - /** @Column(type="string") */ - private $value; - public function getId() {return $this->id;} - public function getValue() {return $this->value;} - public function setValue($value) {$this->value = $value;} -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php deleted file mode 100644 index 3707611..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php +++ /dev/null @@ -1,151 +0,0 @@ -cacheDataReflection = new \ReflectionProperty("Doctrine\Common\Cache\ArrayCache", "data"); - $this->cacheDataReflection->setAccessible(true); - $this->useModelSet('cms'); - parent::setUp(); - } - - /** - * @param ArrayCache $cache - * @return integer - */ - private function getCacheSize(ArrayCache $cache) - { - return sizeof($this->cacheDataReflection->getValue($cache)); - } - - - public function testQueryCache_DependsOnHints() - { - $query = $this->_em->createQuery('select ux from Doctrine\Tests\Models\CMS\CmsUser ux'); - - $cache = new ArrayCache(); - $query->setQueryCacheDriver($cache); - - $query->getResult(); - $this->assertEquals(1, $this->getCacheSize($cache)); - - $query->setHint('foo', 'bar'); - - $query->getResult(); - $this->assertEquals(2, $this->getCacheSize($cache)); - - return $query; - } - - /** - * @param $query - * @depends testQueryCache_DependsOnHints - */ - public function testQueryCache_DependsOnFirstResult($query) - { - $cache = $query->getQueryCacheDriver(); - $cacheCount = $this->getCacheSize($cache); - - $query->setFirstResult(10); - $query->setMaxResults(9999); - - $query->getResult(); - $this->assertEquals($cacheCount + 1, $this->getCacheSize($cache)); - } - - /** - * @param $query - * @depends testQueryCache_DependsOnHints - */ - public function testQueryCache_DependsOnMaxResults($query) - { - $cache = $query->getQueryCacheDriver(); - $cacheCount = $this->getCacheSize($cache); - - $query->setMaxResults(10); - - $query->getResult(); - $this->assertEquals($cacheCount + 1, $this->getCacheSize($cache)); - } - - /** - * @param $query - * @depends testQueryCache_DependsOnHints - */ - public function testQueryCache_DependsOnHydrationMode($query) - { - $cache = $query->getQueryCacheDriver(); - $cacheCount = $this->getCacheSize($cache); - - $query->getArrayResult(); - $this->assertEquals($cacheCount + 1, $this->getCacheSize($cache)); - } - - public function testQueryCache_NoHitSaveParserResult() - { - $this->_em->getConfiguration()->setQueryCacheImpl(new ArrayCache()); - - $query = $this->_em->createQuery('select ux from Doctrine\Tests\Models\CMS\CmsUser ux'); - - $cache = $this->getMock('Doctrine\Common\Cache\ArrayCache', array('doFetch', 'doSave', 'doGetStats')); - $cache->expects($this->at(0)) - ->method('doFetch') - ->with($this->isType('string')) - ->will($this->returnValue(false)); - $cache->expects($this->at(1)) - ->method('doSave') - ->with($this->isType('string'), $this->isInstanceOf('Doctrine\ORM\Query\ParserResult'), $this->equalTo(null)); - - $query->setQueryCacheDriver($cache); - - $users = $query->getResult(); - } - - public function testQueryCache_HitDoesNotSaveParserResult() - { - $this->_em->getConfiguration()->setQueryCacheImpl(new ArrayCache()); - - $query = $this->_em->createQuery('select ux from Doctrine\Tests\Models\CMS\CmsUser ux'); - - $sqlExecMock = $this->getMock('Doctrine\ORM\Query\Exec\AbstractSqlExecutor', array('execute')); - $sqlExecMock->expects($this->once()) - ->method('execute') - ->will($this->returnValue( 10 )); - - $parserResultMock = $this->getMock('Doctrine\ORM\Query\ParserResult'); - $parserResultMock->expects($this->once()) - ->method('getSqlExecutor') - ->will($this->returnValue($sqlExecMock)); - - $cache = $this->getMock('Doctrine\Common\Cache\CacheProvider', - array('doFetch', 'doContains', 'doSave', 'doDelete', 'doFlush', 'doGetStats')); - $cache->expects($this->once()) - ->method('doFetch') - ->with($this->isType('string')) - ->will($this->returnValue($parserResultMock)); - $cache->expects($this->never()) - ->method('doSave'); - - $query->setQueryCacheDriver($cache); - - $users = $query->getResult(); - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php deleted file mode 100644 index d62c60a..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php +++ /dev/null @@ -1,401 +0,0 @@ -useModelSet('company'); - parent::setUp(); - - $this->generateFixture(); - } - - public function testAggregateSum() - { - $salarySum = $this->_em->createQuery('SELECT SUM(m.salary) AS salary FROM Doctrine\Tests\Models\Company\CompanyManager m') - ->getSingleResult(); - - $this->assertEquals(1500000, $salarySum['salary']); - } - - public function testAggregateAvg() - { - $salaryAvg = $this->_em->createQuery('SELECT AVG(m.salary) AS salary FROM Doctrine\Tests\Models\Company\CompanyManager m') - ->getSingleResult(); - - $this->assertEquals(375000, round($salaryAvg['salary'], 0)); - } - - public function testAggregateMin() - { - $salary = $this->_em->createQuery('SELECT MIN(m.salary) AS salary FROM Doctrine\Tests\Models\Company\CompanyManager m') - ->getSingleResult(); - - $this->assertEquals(100000, $salary['salary']); - } - - public function testAggregateMax() - { - $salary = $this->_em->createQuery('SELECT MAX(m.salary) AS salary FROM Doctrine\Tests\Models\Company\CompanyManager m') - ->getSingleResult(); - - $this->assertEquals(800000, $salary['salary']); - } - - public function testAggregateCount() - { - $managerCount = $this->_em->createQuery('SELECT COUNT(m.id) AS managers FROM Doctrine\Tests\Models\Company\CompanyManager m') - ->getSingleResult(); - - $this->assertEquals(4, $managerCount['managers']); - } - - public function testFunctionAbs() - { - $result = $this->_em->createQuery('SELECT m, ABS(m.salary * -1) AS abs FROM Doctrine\Tests\Models\Company\CompanyManager m') - ->getResult(); - - $this->assertEquals(4, count($result)); - $this->assertEquals(100000, $result[0]['abs']); - $this->assertEquals(200000, $result[1]['abs']); - $this->assertEquals(400000, $result[2]['abs']); - $this->assertEquals(800000, $result[3]['abs']); - } - - public function testFunctionConcat() - { - $arg = $this->_em->createQuery('SELECT m, CONCAT(m.name, m.department) AS namedep FROM Doctrine\Tests\Models\Company\CompanyManager m') - ->getArrayResult(); - - $this->assertEquals(4, count($arg)); - $this->assertEquals('Roman B.IT', $arg[0]['namedep']); - $this->assertEquals('Benjamin E.HR', $arg[1]['namedep']); - $this->assertEquals('Guilherme B.Complaint Department', $arg[2]['namedep']); - $this->assertEquals('Jonathan W.Administration', $arg[3]['namedep']); - } - - public function testFunctionLength() - { - $result = $this->_em->createQuery('SELECT m, LENGTH(CONCAT(m.name, m.department)) AS namedeplength FROM Doctrine\Tests\Models\Company\CompanyManager m') - ->getArrayResult(); - - $this->assertEquals(4, count($result)); - $this->assertEquals(10, $result[0]['namedeplength']); - $this->assertEquals(13, $result[1]['namedeplength']); - $this->assertEquals(32, $result[2]['namedeplength']); - $this->assertEquals(25, $result[3]['namedeplength']); - } - - public function testFunctionLocate() - { - $dql = "SELECT m, LOCATE('e', LOWER(m.name)) AS loc, LOCATE('e', LOWER(m.name), 7) AS loc2 ". - "FROM Doctrine\Tests\Models\Company\CompanyManager m"; - - $result = $this->_em->createQuery($dql) - ->getArrayResult(); - - $this->assertEquals(4, count($result)); - $this->assertEquals(0, $result[0]['loc']); - $this->assertEquals(2, $result[1]['loc']); - $this->assertEquals(6, $result[2]['loc']); - $this->assertEquals(0, $result[3]['loc']); - $this->assertEquals(0, $result[0]['loc2']); - $this->assertEquals(10, $result[1]['loc2']); - $this->assertEquals(9, $result[2]['loc2']); - $this->assertEquals(0, $result[3]['loc2']); - } - - public function testFunctionLower() - { - $result = $this->_em->createQuery("SELECT m, LOWER(m.name) AS lowername FROM Doctrine\Tests\Models\Company\CompanyManager m") - ->getArrayResult(); - - $this->assertEquals(4, count($result)); - $this->assertEquals('roman b.', $result[0]['lowername']); - $this->assertEquals('benjamin e.', $result[1]['lowername']); - $this->assertEquals('guilherme b.', $result[2]['lowername']); - $this->assertEquals('jonathan w.', $result[3]['lowername']); - } - - public function testFunctionMod() - { - $result = $this->_em->createQuery("SELECT m, MOD(m.salary, 3500) AS amod FROM Doctrine\Tests\Models\Company\CompanyManager m") - ->getArrayResult(); - - $this->assertEquals(4, count($result)); - $this->assertEquals(2000, $result[0]['amod']); - $this->assertEquals(500, $result[1]['amod']); - $this->assertEquals(1000, $result[2]['amod']); - $this->assertEquals(2000, $result[3]['amod']); - } - - public function testFunctionSqrt() - { - $result = $this->_em->createQuery("SELECT m, SQRT(m.salary) AS sqrtsalary FROM Doctrine\Tests\Models\Company\CompanyManager m") - ->getArrayResult(); - - $this->assertEquals(4, count($result)); - $this->assertEquals(316, round($result[0]['sqrtsalary'])); - $this->assertEquals(447, round($result[1]['sqrtsalary'])); - $this->assertEquals(632, round($result[2]['sqrtsalary'])); - $this->assertEquals(894, round($result[3]['sqrtsalary'])); - } - - public function testFunctionUpper() - { - $result = $this->_em->createQuery("SELECT m, UPPER(m.name) AS uppername FROM Doctrine\Tests\Models\Company\CompanyManager m") - ->getArrayResult(); - - $this->assertEquals(4, count($result)); - $this->assertEquals('ROMAN B.', $result[0]['uppername']); - $this->assertEquals('BENJAMIN E.', $result[1]['uppername']); - $this->assertEquals('GUILHERME B.', $result[2]['uppername']); - $this->assertEquals('JONATHAN W.', $result[3]['uppername']); - } - - public function testFunctionSubstring() - { - $dql = "SELECT m, SUBSTRING(m.name, 1, 3) AS str1, SUBSTRING(m.name, 5) AS str2 ". - "FROM Doctrine\Tests\Models\Company\CompanyManager m"; - - $result = $this->_em->createQuery($dql) - ->getArrayResult(); - - $this->assertEquals(4, count($result)); - $this->assertEquals('Rom', $result[0]['str1']); - $this->assertEquals('Ben', $result[1]['str1']); - $this->assertEquals('Gui', $result[2]['str1']); - $this->assertEquals('Jon', $result[3]['str1']); - $this->assertEquals('n B.', $result[0]['str2']); - $this->assertEquals('amin E.', $result[1]['str2']); - $this->assertEquals('herme B.', $result[2]['str2']); - $this->assertEquals('than W.', $result[3]['str2']); - } - - public function testFunctionTrim() - { - $dql = "SELECT m, TRIM(TRAILING '.' FROM m.name) AS str1, ". - " TRIM(LEADING '.' FROM m.name) AS str2, TRIM(CONCAT(' ', CONCAT(m.name, ' '))) AS str3 ". - "FROM Doctrine\Tests\Models\Company\CompanyManager m"; - - $result = $this->_em->createQuery($dql)->getArrayResult(); - - $this->assertEquals(4, count($result)); - $this->assertEquals('Roman B', $result[0]['str1']); - $this->assertEquals('Benjamin E', $result[1]['str1']); - $this->assertEquals('Guilherme B', $result[2]['str1']); - $this->assertEquals('Jonathan W', $result[3]['str1']); - $this->assertEquals('Roman B.', $result[0]['str2']); - $this->assertEquals('Benjamin E.', $result[1]['str2']); - $this->assertEquals('Guilherme B.', $result[2]['str2']); - $this->assertEquals('Jonathan W.', $result[3]['str2']); - $this->assertEquals('Roman B.', $result[0]['str3']); - $this->assertEquals('Benjamin E.', $result[1]['str3']); - $this->assertEquals('Guilherme B.', $result[2]['str3']); - $this->assertEquals('Jonathan W.', $result[3]['str3']); - } - - public function testOperatorAdd() - { - $result = $this->_em->createQuery('SELECT m, m.salary+2500 AS add FROM Doctrine\Tests\Models\Company\CompanyManager m') - ->getResult(); - - $this->assertEquals(4, count($result)); - $this->assertEquals(102500, $result[0]['add']); - $this->assertEquals(202500, $result[1]['add']); - $this->assertEquals(402500, $result[2]['add']); - $this->assertEquals(802500, $result[3]['add']); - } - - public function testOperatorSub() - { - $result = $this->_em->createQuery('SELECT m, m.salary-2500 AS sub FROM Doctrine\Tests\Models\Company\CompanyManager m') - ->getResult(); - - $this->assertEquals(4, count($result)); - $this->assertEquals(97500, $result[0]['sub']); - $this->assertEquals(197500, $result[1]['sub']); - $this->assertEquals(397500, $result[2]['sub']); - $this->assertEquals(797500, $result[3]['sub']); - } - - public function testOperatorMultiply() - { - $result = $this->_em->createQuery('SELECT m, m.salary*2 AS op FROM Doctrine\Tests\Models\Company\CompanyManager m') - ->getResult(); - - $this->assertEquals(4, count($result)); - $this->assertEquals(200000, $result[0]['op']); - $this->assertEquals(400000, $result[1]['op']); - $this->assertEquals(800000, $result[2]['op']); - $this->assertEquals(1600000, $result[3]['op']); - } - - /** - * @group test - */ - public function testOperatorDiv() - { - $result = $this->_em->createQuery('SELECT m, (m.salary/0.5) AS op FROM Doctrine\Tests\Models\Company\CompanyManager m') - ->getResult(); - - $this->assertEquals(4, count($result)); - $this->assertEquals(200000, $result[0]['op']); - $this->assertEquals(400000, $result[1]['op']); - $this->assertEquals(800000, $result[2]['op']); - $this->assertEquals(1600000, $result[3]['op']); - } - - public function testConcatFunction() - { - $arg = $this->_em->createQuery('SELECT CONCAT(m.name, m.department) AS namedep FROM Doctrine\Tests\Models\Company\CompanyManager m order by namedep desc') - ->getArrayResult(); - - $this->assertEquals(4, count($arg)); - $this->assertEquals('Roman B.IT', $arg[0]['namedep']); - $this->assertEquals('Jonathan W.Administration', $arg[1]['namedep']); - $this->assertEquals('Guilherme B.Complaint Department', $arg[2]['namedep']); - $this->assertEquals('Benjamin E.HR', $arg[3]['namedep']); - } - - /** - * @group DDC-1014 - */ - public function testDateDiff() - { - $query = $this->_em->createQuery("SELECT DATE_DIFF(CURRENT_TIMESTAMP(), DATE_ADD(CURRENT_TIMESTAMP(), 10, 'day')) AS diff FROM Doctrine\Tests\Models\Company\CompanyManager m"); - $arg = $query->getArrayResult(); - - $this->assertEquals(-10, $arg[0]['diff'], "Should be roughly -10 (or -9)", 1); - - $query = $this->_em->createQuery("SELECT DATE_DIFF(DATE_ADD(CURRENT_TIMESTAMP(), 10, 'day'), CURRENT_TIMESTAMP()) AS diff FROM Doctrine\Tests\Models\Company\CompanyManager m"); - $arg = $query->getArrayResult(); - - $this->assertEquals(10, $arg[0]['diff'], "Should be roughly 10 (or 9)", 1); - } - - /** - * @group DDC-1014 - */ - public function testDateAdd() - { - $arg = $this->_em->createQuery("SELECT DATE_ADD(CURRENT_TIMESTAMP(), 10, 'day') AS add FROM Doctrine\Tests\Models\Company\CompanyManager m") - ->getArrayResult(); - - $this->assertTrue(strtotime($arg[0]['add']) > 0); - - $arg = $this->_em->createQuery("SELECT DATE_ADD(CURRENT_TIMESTAMP(), 10, 'month') AS add FROM Doctrine\Tests\Models\Company\CompanyManager m") - ->getArrayResult(); - - $this->assertTrue(strtotime($arg[0]['add']) > 0); - } - - /** - * @group DDC-1014 - */ - public function testDateSub() - { - $arg = $this->_em->createQuery("SELECT DATE_SUB(CURRENT_TIMESTAMP(), 10, 'day') AS add FROM Doctrine\Tests\Models\Company\CompanyManager m") - ->getArrayResult(); - - $this->assertTrue(strtotime($arg[0]['add']) > 0); - - $arg = $this->_em->createQuery("SELECT DATE_SUB(CURRENT_TIMESTAMP(), 10, 'month') AS add FROM Doctrine\Tests\Models\Company\CompanyManager m") - ->getArrayResult(); - - $this->assertTrue(strtotime($arg[0]['add']) > 0); - } - - /** - * @group DDC-1213 - */ - public function testBitOrComparison() - { - $dql = 'SELECT m, ' . - 'BIT_OR(4, 2) AS bit_or,' . - 'BIT_OR( (m.salary/100000) , 2 ) AS salary_bit_or ' . - 'FROM Doctrine\Tests\Models\Company\CompanyManager m ' . - 'ORDER BY ' . - 'm.id ' ; - $result = $this->_em->createQuery($dql)->getArrayResult(); - - $this->assertEquals(4 | 2, $result[0]['bit_or']); - $this->assertEquals(4 | 2, $result[1]['bit_or']); - $this->assertEquals(4 | 2, $result[2]['bit_or']); - $this->assertEquals(4 | 2, $result[3]['bit_or']); - - $this->assertEquals(($result[0][0]['salary']/100000) | 2, $result[0]['salary_bit_or']); - $this->assertEquals(($result[1][0]['salary']/100000) | 2, $result[1]['salary_bit_or']); - $this->assertEquals(($result[2][0]['salary']/100000) | 2, $result[2]['salary_bit_or']); - $this->assertEquals(($result[3][0]['salary']/100000) | 2, $result[3]['salary_bit_or']); - } - - /** - * @group DDC-1213 - */ - public function testBitAndComparison() - { - $dql = 'SELECT m, ' . - 'BIT_AND(4, 2) AS bit_and,' . - 'BIT_AND( (m.salary/100000) , 2 ) AS salary_bit_and ' . - 'FROM Doctrine\Tests\Models\Company\CompanyManager m ' . - 'ORDER BY ' . - 'm.id ' ; - $result = $this->_em->createQuery($dql)->getArrayResult(); - - $this->assertEquals(4 & 2, $result[0]['bit_and']); - $this->assertEquals(4 & 2, $result[1]['bit_and']); - $this->assertEquals(4 & 2, $result[2]['bit_and']); - $this->assertEquals(4 & 2, $result[3]['bit_and']); - - $this->assertEquals(($result[0][0]['salary']/100000) & 2, $result[0]['salary_bit_and']); - $this->assertEquals(($result[1][0]['salary']/100000) & 2, $result[1]['salary_bit_and']); - $this->assertEquals(($result[2][0]['salary']/100000) & 2, $result[2]['salary_bit_and']); - $this->assertEquals(($result[3][0]['salary']/100000) & 2, $result[3]['salary_bit_and']); - } - - protected function generateFixture() - { - $manager1 = new CompanyManager(); - $manager1->setName('Roman B.'); - $manager1->setTitle('Foo'); - $manager1->setDepartment('IT'); - $manager1->setSalary(100000); - - $manager2 = new CompanyManager(); - $manager2->setName('Benjamin E.'); - $manager2->setTitle('Foo'); - $manager2->setDepartment('HR'); - $manager2->setSalary(200000); - - $manager3 = new CompanyManager(); - $manager3->setName('Guilherme B.'); - $manager3->setTitle('Foo'); - $manager3->setDepartment('Complaint Department'); - $manager3->setSalary(400000); - - $manager4 = new CompanyManager(); - $manager4->setName('Jonathan W.'); - $manager4->setTitle('Foo'); - $manager4->setDepartment('Administration'); - $manager4->setSalary(800000); - - $this->_em->persist($manager1); - $this->_em->persist($manager2); - $this->_em->persist($manager3); - $this->_em->persist($manager4); - $this->_em->flush(); - $this->_em->clear(); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/QueryTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/QueryTest.php deleted file mode 100644 index ca4c936..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/QueryTest.php +++ /dev/null @@ -1,658 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - public function testSimpleQueries() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - - $query = $this->_em->createQuery("select u, upper(u.name) from Doctrine\Tests\Models\CMS\CmsUser u where u.username = 'gblanco'"); - - $result = $query->getResult(); - - $this->assertEquals(1, count($result)); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0][0]); - $this->assertEquals('Guilherme', $result[0][0]->name); - $this->assertEquals('gblanco', $result[0][0]->username); - $this->assertEquals('developer', $result[0][0]->status); - $this->assertEquals('GUILHERME', $result[0][1]); - - $resultArray = $query->getArrayResult(); - $this->assertEquals(1, count($resultArray)); - $this->assertTrue(is_array($resultArray[0][0])); - $this->assertEquals('Guilherme', $resultArray[0][0]['name']); - $this->assertEquals('gblanco', $resultArray[0][0]['username']); - $this->assertEquals('developer', $resultArray[0][0]['status']); - $this->assertEquals('GUILHERME', $resultArray[0][1]); - - $scalarResult = $query->getScalarResult(); - $this->assertEquals(1, count($scalarResult)); - $this->assertEquals('Guilherme', $scalarResult[0]['u_name']); - $this->assertEquals('gblanco', $scalarResult[0]['u_username']); - $this->assertEquals('developer', $scalarResult[0]['u_status']); - $this->assertEquals('GUILHERME', $scalarResult[0][1]); - - $query = $this->_em->createQuery("select upper(u.name) from Doctrine\Tests\Models\CMS\CmsUser u where u.username = 'gblanco'"); - $this->assertEquals('GUILHERME', $query->getSingleScalarResult()); - } - - public function testJoinQueries() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - - $article1 = new CmsArticle; - $article1->topic = "Doctrine 2"; - $article1->text = "This is an introduction to Doctrine 2."; - $user->addArticle($article1); - - $article2 = new CmsArticle; - $article2->topic = "Symfony 2"; - $article2->text = "This is an introduction to Symfony 2."; - $user->addArticle($article2); - - $this->_em->persist($user); - $this->_em->persist($article1); - $this->_em->persist($article2); - - $this->_em->flush(); - $this->_em->clear(); - - $query = $this->_em->createQuery("select u, a from Doctrine\Tests\Models\CMS\CmsUser u join u.articles a ORDER BY a.topic"); - $users = $query->getResult(); - $this->assertEquals(1, count($users)); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $users[0]); - $this->assertEquals(2, count($users[0]->articles)); - $this->assertEquals('Doctrine 2', $users[0]->articles[0]->topic); - $this->assertEquals('Symfony 2', $users[0]->articles[1]->topic); - } - - public function testUsingZeroBasedQueryParameterShouldWork() - { - $user = new CmsUser; - $user->name = 'Jonathan'; - $user->username = 'jwage'; - $user->status = 'developer'; - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - - $q = $this->_em->createQuery('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username = ?0'); - $q->setParameter(0, 'jwage'); - $user = $q->getSingleResult(); - - $this->assertNotNull($user); - } - - public function testUsingUnknownQueryParameterShouldThrowException() - { - $this->setExpectedException( - "Doctrine\ORM\Query\QueryException", - "Invalid parameter: token 2 is not defined in the query." - ); - - $q = $this->_em->createQuery('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name = ?1'); - $q->setParameter(2, 'jwage'); - $user = $q->getSingleResult(); - } - - public function testMismatchingParamExpectedParamCount() - { - $this->setExpectedException( - "Doctrine\ORM\Query\QueryException", - "Invalid parameter number: number of bound variables does not match number of tokens" - ); - - $q = $this->_em->createQuery('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name = ?1'); - $q->setParameter(1, 'jwage'); - $q->setParameter(2, 'jwage'); - - $user = $q->getSingleResult(); - } - - public function testInvalidInputParameterThrowsException() - { - $this->setExpectedException("Doctrine\ORM\Query\QueryException"); - - $q = $this->_em->createQuery('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name = ?'); - $q->setParameter(1, 'jwage'); - $user = $q->getSingleResult(); - } - - public function testSetParameters() - { - $q = $this->_em->createQuery('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name = ?1 AND u.status = ?2'); - $q->setParameters(array(1 => 'jwage', 2 => 'active')); - $users = $q->getResult(); - } - - /** - * @group DDC-1070 - */ - public function testIterateResultAsArrayAndParams() - { - $article1 = new CmsArticle; - $article1->topic = "Doctrine 2"; - $article1->text = "This is an introduction to Doctrine 2."; - - $article2 = new CmsArticle; - $article2->topic = "Symfony 2"; - $article2->text = "This is an introduction to Symfony 2."; - - $this->_em->persist($article1); - $this->_em->persist($article2); - - $this->_em->flush(); - $this->_em->clear(); - $articleId = $article1->id; - - $query = $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a WHERE a.topic = ?1"); - $articles = $query->iterate(array(1 => 'Doctrine 2'), Query::HYDRATE_ARRAY); - - $found = array(); - foreach ($articles AS $article) { - $found[] = $article; - } - $this->assertEquals(1, count($found)); - $this->assertEquals(array( - array(array('id' => $articleId, 'topic' => 'Doctrine 2', 'text' => 'This is an introduction to Doctrine 2.', 'version' => 1)) - ), $found); - } - - public function testIterateResult_IterativelyBuildUpUnitOfWork() - { - $article1 = new CmsArticle; - $article1->topic = "Doctrine 2"; - $article1->text = "This is an introduction to Doctrine 2."; - - $article2 = new CmsArticle; - $article2->topic = "Symfony 2"; - $article2->text = "This is an introduction to Symfony 2."; - - $this->_em->persist($article1); - $this->_em->persist($article2); - - $this->_em->flush(); - $this->_em->clear(); - - $query = $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a"); - $articles = $query->iterate(); - - $iteratedCount = 0; - $topics = array(); - foreach($articles AS $row) { - $article = $row[0]; - $topics[] = $article->topic; - - $identityMap = $this->_em->getUnitOfWork()->getIdentityMap(); - $identityMapCount = count($identityMap['Doctrine\Tests\Models\CMS\CmsArticle']); - $this->assertTrue($identityMapCount>$iteratedCount); - - $iteratedCount++; - } - - $this->assertEquals(array("Doctrine 2", "Symfony 2"), $topics); - $this->assertEquals(2, $iteratedCount); - - $this->_em->flush(); - $this->_em->clear(); - } - - public function testIterateResultClearEveryCycle() - { - $article1 = new CmsArticle; - $article1->topic = "Doctrine 2"; - $article1->text = "This is an introduction to Doctrine 2."; - - $article2 = new CmsArticle; - $article2->topic = "Symfony 2"; - $article2->text = "This is an introduction to Symfony 2."; - - $this->_em->persist($article1); - $this->_em->persist($article2); - - $this->_em->flush(); - $this->_em->clear(); - - $query = $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a"); - $articles = $query->iterate(); - - $iteratedCount = 0; - $topics = array(); - foreach($articles AS $row) { - $article = $row[0]; - $topics[] = $article->topic; - - $this->_em->clear(); - - $iteratedCount++; - } - - $this->assertEquals(array("Doctrine 2", "Symfony 2"), $topics); - $this->assertEquals(2, $iteratedCount); - - $this->_em->flush(); - } - - /** - * @expectedException \Doctrine\ORM\Query\QueryException - */ - public function testIterateResult_FetchJoinedCollection_ThrowsException() - { - $query = $this->_em->createQuery("SELECT u, a FROM Doctrine\Tests\Models\CMS\CmsUser u JOIN u.articles a"); - $articles = $query->iterate(); - } - - /** - * @expectedException Doctrine\ORM\NoResultException - */ - public function testGetSingleResultThrowsExceptionOnNoResult() - { - $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a") - ->getSingleResult(); - } - - /** - * @expectedException Doctrine\ORM\NoResultException - */ - public function testGetSingleScalarResultThrowsExceptionOnNoResult() - { - $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a") - ->getSingleScalarResult(); - } - - /** - * @expectedException Doctrine\ORM\NonUniqueResultException - */ - public function testGetSingleScalarResultThrowsExceptionOnNonUniqueResult() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - - $article1 = new CmsArticle; - $article1->topic = "Doctrine 2"; - $article1->text = "This is an introduction to Doctrine 2."; - $user->addArticle($article1); - - $article2 = new CmsArticle; - $article2->topic = "Symfony 2"; - $article2->text = "This is an introduction to Symfony 2."; - $user->addArticle($article2); - - $this->_em->persist($user); - $this->_em->persist($article1); - $this->_em->persist($article2); - - $this->_em->flush(); - $this->_em->clear(); - - $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a") - ->getSingleScalarResult(); - } - - public function testModifiedLimitQuery() - { - for ($i = 0; $i < 5; $i++) { - $user = new CmsUser; - $user->name = 'Guilherme' . $i; - $user->username = 'gblanco' . $i; - $user->status = 'developer'; - $this->_em->persist($user); - } - - $this->_em->flush(); - $this->_em->clear(); - - $data = $this->_em->createQuery('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u') - ->setFirstResult(1) - ->setMaxResults(2) - ->getResult(); - - $this->assertEquals(2, count($data)); - $this->assertEquals('gblanco1', $data[0]->username); - $this->assertEquals('gblanco2', $data[1]->username); - - $data = $this->_em->createQuery('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u') - ->setFirstResult(3) - ->setMaxResults(2) - ->getResult(); - - $this->assertEquals(2, count($data)); - $this->assertEquals('gblanco3', $data[0]->username); - $this->assertEquals('gblanco4', $data[1]->username); - - $data = $this->_em->createQuery('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u') - ->setFirstResult(3) - ->setMaxResults(2) - ->getScalarResult(); - } - - public function testSupportsQueriesWithEntityNamespaces() - { - $this->_em->getConfiguration()->addEntityNamespace('CMS', 'Doctrine\Tests\Models\CMS'); - - try { - $query = $this->_em->createQuery('UPDATE CMS:CmsUser u SET u.name = ?1'); - $this->assertEquals('UPDATE cms_users SET name = ?', $query->getSql()); - $query->free(); - } catch (\Exception $e) { - $this->fail($e->getMessage()); - } - - $this->_em->getConfiguration()->setEntityNamespaces(array()); - } - - /** - * @group DDC-604 - */ - public function testEntityParameters() - { - $article = new CmsArticle; - $article->topic = "dr. dolittle"; - $article->text = "Once upon a time ..."; - $author = new CmsUser; - $author->name = "anonymous"; - $author->username = "anon"; - $author->status = "here"; - $article->user = $author; - $this->_em->persist($author); - $this->_em->persist($article); - $this->_em->flush(); - $this->_em->clear(); - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - $q = $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a where a.topic = :topic and a.user = :user") - ->setParameter("user", $this->_em->getReference('Doctrine\Tests\Models\CMS\CmsUser', $author->id)) - ->setParameter("topic", "dr. dolittle"); - - $result = $q->getResult(); - $this->assertEquals(1, count($result)); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsArticle', $result[0]); - $this->assertEquals("dr. dolittle", $result[0]->topic); - $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $result[0]->user); - $this->assertFalse($result[0]->user->__isInitialized__); - } - - /** - * @group DDC-952 - */ - public function testEnableFetchEagerMode() - { - for ($i = 0; $i < 10; $i++) { - $article = new CmsArticle; - $article->topic = "dr. dolittle"; - $article->text = "Once upon a time ..."; - $author = new CmsUser; - $author->name = "anonymous"; - $author->username = "anon".$i; - $author->status = "here"; - $article->user = $author; - $this->_em->persist($author); - $this->_em->persist($article); - } - $this->_em->flush(); - $this->_em->clear(); - - $articles = $this->_em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsArticle a') - ->setFetchMode('Doctrine\Tests\Models\CMS\CmsArticle', 'user', ClassMetadata::FETCH_EAGER) - ->getResult(); - - $this->assertEquals(10, count($articles)); - foreach ($articles AS $article) { - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $article); - } - } - - /** - * @group DDC-991 - */ - public function testgetOneOrNullResult() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - - $query = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u where u.username = 'gblanco'"); - - $fetchedUser = $query->getOneOrNullResult(); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $fetchedUser); - $this->assertEquals('gblanco', $fetchedUser->username); - - $query = $this->_em->createQuery("select u.username from Doctrine\Tests\Models\CMS\CmsUser u where u.username = 'gblanco'"); - $fetchedUsername = $query->getOneOrNullResult(Query::HYDRATE_SINGLE_SCALAR); - $this->assertEquals('gblanco', $fetchedUsername); - } - - /** - * @group DDC-991 - */ - public function testgetOneOrNullResultSeveralRows() - { - $user = new CmsUser; - $user->name = 'Guilherme'; - $user->username = 'gblanco'; - $user->status = 'developer'; - $this->_em->persist($user); - $user = new CmsUser; - $user->name = 'Roman'; - $user->username = 'romanb'; - $user->status = 'developer'; - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - - $query = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u"); - - $this->setExpectedException('Doctrine\ORM\NonUniqueResultException'); - $fetchedUser = $query->getOneOrNullResult(); - } - - /** - * @group DDC-991 - */ - public function testgetOneOrNullResultNoRows() - { - $query = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u"); - $this->assertNull($query->getOneOrNullResult()); - - $query = $this->_em->createQuery("select u.username from Doctrine\Tests\Models\CMS\CmsUser u where u.username = 'gblanco'"); - $this->assertNull($query->getOneOrNullResult(Query::HYDRATE_SCALAR)); - } - - /** - * @group DBAL-171 - */ - public function testParameterOrder() - { - $user1 = new CmsUser; - $user1->name = 'Benjamin'; - $user1->username = 'beberlei'; - $user1->status = 'developer'; - $this->_em->persist($user1); - - $user2 = new CmsUser; - $user2->name = 'Roman'; - $user2->username = 'romanb'; - $user2->status = 'developer'; - $this->_em->persist($user2); - - $user3 = new CmsUser; - $user3->name = 'Jonathan'; - $user3->username = 'jwage'; - $user3->status = 'developer'; - $this->_em->persist($user3); - - $this->_em->flush(); - $this->_em->clear(); - - $query = $this->_em->createQuery("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.status = :a AND u.id IN (:b)"); - $query->setParameters(array( - 'b' => array($user1->id, $user2->id, $user3->id), - 'a' => 'developer', - )); - $result = $query->getResult(); - - $this->assertEquals(3, count($result)); - } - - public function testDqlWithAutoInferOfParameters() - { - $user = new CmsUser; - $user->name = 'Benjamin'; - $user->username = 'beberlei'; - $user->status = 'developer'; - $this->_em->persist($user); - - $user = new CmsUser; - $user->name = 'Roman'; - $user->username = 'romanb'; - $user->status = 'developer'; - $this->_em->persist($user); - - $user = new CmsUser; - $user->name = 'Jonathan'; - $user->username = 'jwage'; - $user->status = 'developer'; - $this->_em->persist($user); - - $this->_em->flush(); - $this->_em->clear(); - - $query = $this->_em->createQuery("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username IN (?0)"); - $query->setParameter(0, array('beberlei', 'jwage')); - - $users = $query->execute(); - - $this->assertEquals(2, count($users)); - } - - public function testQueryBuilderWithStringWhereClauseContainingOrAndConditionalPrimary() - { - $qb = $this->_em->createQueryBuilder(); - $qb->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->innerJoin('u.articles', 'a') - ->where('(u.id = 0) OR (u.id IS NULL)'); - - $query = $qb->getQuery(); - $users = $query->execute(); - - $this->assertEquals(0, count($users)); - } - - public function testQueryWithArrayOfEntitiesAsParameter() - { - $userA = new CmsUser; - $userA->name = 'Benjamin'; - $userA->username = 'beberlei'; - $userA->status = 'developer'; - $this->_em->persist($userA); - - $userB = new CmsUser; - $userB->name = 'Roman'; - $userB->username = 'romanb'; - $userB->status = 'developer'; - $this->_em->persist($userB); - - $userC = new CmsUser; - $userC->name = 'Jonathan'; - $userC->username = 'jwage'; - $userC->status = 'developer'; - $this->_em->persist($userC); - - $this->_em->flush(); - $this->_em->clear(); - - $query = $this->_em->createQuery("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u IN (?0) OR u.username = ?1"); - $query->setParameter(0, array($userA, $userC)); - $query->setParameter(1, 'beberlei'); - - $users = $query->execute(); - - $this->assertEquals(2, count($users)); - } - - public function testQueryWithHiddenAsSelectExpression() - { - $userA = new CmsUser; - $userA->name = 'Benjamin'; - $userA->username = 'beberlei'; - $userA->status = 'developer'; - $this->_em->persist($userA); - - $userB = new CmsUser; - $userB->name = 'Roman'; - $userB->username = 'romanb'; - $userB->status = 'developer'; - $this->_em->persist($userB); - - $userC = new CmsUser; - $userC->name = 'Jonathan'; - $userC->username = 'jwage'; - $userC->status = 'developer'; - $this->_em->persist($userC); - - $this->_em->flush(); - $this->_em->clear(); - - $query = $this->_em->createQuery("SELECT u, (SELECT COUNT(u2.id) FROM Doctrine\Tests\Models\CMS\CmsUser u2) AS HIDDEN total FROM Doctrine\Tests\Models\CMS\CmsUser u"); - $users = $query->execute(); - - $this->assertEquals(3, count($users)); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $users[0]); - } - - /** - * @group DDC-1651 - */ - public function testSetParameterBindingSingleIdentifierObjectConverted() - { - $userC = new CmsUser; - $userC->name = 'Jonathan'; - $userC->username = 'jwage'; - $userC->status = 'developer'; - $this->_em->persist($userC); - - $this->_em->flush(); - $this->_em->clear(); - - $q = $this->_em->createQuery("SELECT DISTINCT u from Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = ?1"); - $q->setParameter(1, $userC); - - $this->assertEquals($userC->id, $q->getParameter(1)); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ReadOnlyTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ReadOnlyTest.php deleted file mode 100644 index 2519a9c..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ReadOnlyTest.php +++ /dev/null @@ -1,94 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\ReadOnlyEntity'), - )); - } catch(\Exception $e) { - } - } - - public function testReadOnlyEntityNeverChangeTracked() - { - $readOnly = new ReadOnlyEntity("Test1", 1234); - $this->_em->persist($readOnly); - $this->_em->flush(); - - $readOnly->name = "Test2"; - $readOnly->numericValue = 4321; - - $this->_em->flush(); - $this->_em->clear(); - - $dbReadOnly = $this->_em->find('Doctrine\Tests\ORM\Functional\ReadOnlyEntity', $readOnly->id); - $this->assertEquals("Test1", $dbReadOnly->name); - $this->assertEquals(1234, $dbReadOnly->numericValue); - } - - /** - * @group DDC-1659 - */ - public function testClearReadOnly() - { - $readOnly = new ReadOnlyEntity("Test1", 1234); - $this->_em->persist($readOnly); - $this->_em->flush(); - $this->_em->getUnitOfWork()->markReadOnly($readOnly); - - $this->_em->clear(); - - $this->assertFalse($this->_em->getUnitOfWork()->isReadOnly($readOnly)); - } - - /** - * @group DDC-1659 - */ - public function testClearEntitiesReadOnly() - { - $readOnly = new ReadOnlyEntity("Test1", 1234); - $this->_em->persist($readOnly); - $this->_em->flush(); - $this->_em->getUnitOfWork()->markReadOnly($readOnly); - - $this->_em->clear(get_class($readOnly)); - - $this->assertFalse($this->_em->getUnitOfWork()->isReadOnly($readOnly)); - } -} - -/** - * @Entity(readOnly=true) - */ -class ReadOnlyEntity -{ - /** - * @Id @GeneratedValue @Column(type="integer") - * @var int - */ - public $id; - /** @column(type="string") */ - public $name; - /** @Column(type="integer") */ - public $numericValue; - - public function __construct($name, $number) - { - $this->name = $name; - $this->numericValue = $number; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ReferenceProxyTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ReferenceProxyTest.php deleted file mode 100644 index 3ce24e7..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ReferenceProxyTest.php +++ /dev/null @@ -1,250 +0,0 @@ - - * @author Benjamin Eberlei - */ -class ReferenceProxyTest extends \Doctrine\Tests\OrmFunctionalTestCase -{ - protected function setUp() - { - $this->useModelSet('ecommerce'); - parent::setUp(); - $this->_factory = new ProxyFactory( - $this->_em, - __DIR__ . '/../../Proxies', - 'Doctrine\Tests\Proxies', - true); - } - - public function createProduct() - { - $product = new ECommerceProduct(); - $product->setName('Doctrine Cookbook'); - $this->_em->persist($product); - - $this->_em->flush(); - $this->_em->clear(); - - return $product->getId(); - } - - public function createAuction() - { - $event = new CompanyAuction(); - $event->setData('Doctrine Cookbook'); - $this->_em->persist($event); - - $this->_em->flush(); - $this->_em->clear(); - - return $event->getId(); - } - - public function testLazyLoadsFieldValuesFromDatabase() - { - $id = $this->createProduct(); - - $productProxy = $this->_em->getReference('Doctrine\Tests\Models\ECommerce\ECommerceProduct', array('id' => $id)); - $this->assertEquals('Doctrine Cookbook', $productProxy->getName()); - } - - /** - * @group DDC-727 - */ - public function testAccessMetatadaForProxy() - { - $id = $this->createProduct(); - - $entity = $this->_em->getReference('Doctrine\Tests\Models\ECommerce\ECommerceProduct' , $id); - $class = $this->_em->getClassMetadata(get_class($entity)); - - $this->assertEquals('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $class->name); - } - - /** - * @group DDC-1033 - */ - public function testReferenceFind() - { - $id = $this->createProduct(); - - $entity = $this->_em->getReference('Doctrine\Tests\Models\ECommerce\ECommerceProduct' , $id); - $entity2 = $this->_em->find('Doctrine\Tests\Models\ECommerce\ECommerceProduct' , $id); - - $this->assertSame($entity, $entity2); - $this->assertEquals('Doctrine Cookbook', $entity2->getName()); - } - - /** - * @group DDC-1033 - */ - public function testCloneProxy() - { - $id = $this->createProduct(); - - /* @var $entity Doctrine\Tests\Models\ECommerce\ECommerceProduct */ - $entity = $this->_em->getReference('Doctrine\Tests\Models\ECommerce\ECommerceProduct' , $id); - - /* @var $clone Doctrine\Tests\Models\ECommerce\ECommerceProduct */ - $clone = clone $entity; - - $this->assertEquals($id, $entity->getId()); - $this->assertEquals('Doctrine Cookbook', $entity->getName()); - - $this->assertFalse($this->_em->contains($clone), "Cloning a reference proxy should return an unmanaged/detached entity."); - $this->assertEquals($id, $clone->getId(), "Cloning a reference proxy should return same id."); - $this->assertEquals('Doctrine Cookbook', $clone->getName(), "Cloning a reference proxy should return same product name."); - - // domain logic, Product::__clone sets isCloned public property - $this->assertTrue($clone->isCloned); - $this->assertFalse($entity->isCloned); - } - - /** - * @group DDC-733 - */ - public function testInitializeProxy() - { - $id = $this->createProduct(); - - /* @var $entity Doctrine\Tests\Models\ECommerce\ECommerceProduct */ - $entity = $this->_em->getReference('Doctrine\Tests\Models\ECommerce\ECommerceProduct' , $id); - - $this->assertFalse($entity->__isInitialized__, "Pre-Condition: Object is unitialized proxy."); - $this->_em->getUnitOfWork()->initializeObject($entity); - $this->assertTrue($entity->__isInitialized__, "Should be initialized after called UnitOfWork::initializeObject()"); - } - - /** - * @group DDC-1163 - */ - public function testInitializeChangeAndFlushProxy() - { - $id = $this->createProduct(); - - /* @var $entity Doctrine\Tests\Models\ECommerce\ECommerceProduct */ - $entity = $this->_em->getReference('Doctrine\Tests\Models\ECommerce\ECommerceProduct' , $id); - $entity->setName('Doctrine 2 Cookbook'); - - $this->_em->flush(); - $this->_em->clear(); - - $entity = $this->_em->getReference('Doctrine\Tests\Models\ECommerce\ECommerceProduct' , $id); - $this->assertEquals('Doctrine 2 Cookbook', $entity->getName()); - } - - /** - * @group DDC-1022 - */ - public function testWakeupCalledOnProxy() - { - $id = $this->createProduct(); - - /* @var $entity Doctrine\Tests\Models\ECommerce\ECommerceProduct */ - $entity = $this->_em->getReference('Doctrine\Tests\Models\ECommerce\ECommerceProduct' , $id); - - $this->assertFalse($entity->wakeUp); - - $entity->setName('Doctrine 2 Cookbook'); - - $this->assertTrue($entity->wakeUp, "Loading the proxy should call __wakeup()."); - } - - public function testDoNotInitializeProxyOnGettingTheIdentifier() - { - $id = $this->createProduct(); - - /* @var $entity Doctrine\Tests\Models\ECommerce\ECommerceProduct */ - $entity = $this->_em->getReference('Doctrine\Tests\Models\ECommerce\ECommerceProduct' , $id); - - $this->assertFalse($entity->__isInitialized__, "Pre-Condition: Object is unitialized proxy."); - $this->assertEquals($id, $entity->getId()); - $this->assertFalse($entity->__isInitialized__, "Getting the identifier doesn't initialize the proxy."); - } - - /** - * @group DDC-1625 - */ - public function testDoNotInitializeProxyOnGettingTheIdentifier_DDC_1625() - { - $id = $this->createAuction(); - - /* @var $entity Doctrine\Tests\Models\Company\CompanyAuction */ - $entity = $this->_em->getReference('Doctrine\Tests\Models\Company\CompanyAuction' , $id); - - $this->assertFalse($entity->__isInitialized__, "Pre-Condition: Object is unitialized proxy."); - $this->assertEquals($id, $entity->getId()); - $this->assertFalse($entity->__isInitialized__, "Getting the identifier doesn't initialize the proxy when extending."); - } - - public function testDoNotInitializeProxyOnGettingTheIdentifierAndReturnTheRightType() - { - $product = new ECommerceProduct(); - $product->setName('Doctrine Cookbook'); - - $shipping = new ECommerceShipping(); - $shipping->setDays(1); - $product->setShipping($shipping); - $this->_em->persist($product); - $this->_em->flush(); - $this->_em->clear(); - - $id = $shipping->getId(); - - $product = $this->_em->getRepository('Doctrine\Tests\Models\ECommerce\ECommerceProduct')->find($product->getId()); - - $entity = $product->getShipping(); - $this->assertFalse($entity->__isInitialized__, "Pre-Condition: Object is unitialized proxy."); - $this->assertEquals($id, $entity->getId()); - $this->assertSame($id, $entity->getId(), "Check that the id's are the same value, and type."); - $this->assertFalse($entity->__isInitialized__, "Getting the identifier doesn't initialize the proxy."); - } - - public function testInitializeProxyOnGettingSomethingOtherThanTheIdentifier() - { - $id = $this->createProduct(); - - /* @var $entity Doctrine\Tests\Models\ECommerce\ECommerceProduct */ - $entity = $this->_em->getReference('Doctrine\Tests\Models\ECommerce\ECommerceProduct' , $id); - - $this->assertFalse($entity->__isInitialized__, "Pre-Condition: Object is unitialized proxy."); - $this->assertEquals('Doctrine Cookbook', $entity->getName()); - $this->assertTrue($entity->__isInitialized__, "Getting something other than the identifier initializes the proxy."); - } - - /** - * @group DDC-1604 - */ - public function testCommonPersistenceProxy() - { - $id = $this->createProduct(); - - /* @var $entity Doctrine\Tests\Models\ECommerce\ECommerceProduct */ - $entity = $this->_em->getReference('Doctrine\Tests\Models\ECommerce\ECommerceProduct' , $id); - $className = \Doctrine\Common\Util\ClassUtils::getClass($entity); - - $this->assertInstanceOf('Doctrine\Common\Persistence\Proxy', $entity); - $this->assertFalse($entity->__isInitialized()); - $this->assertEquals('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $className); - - $restName = str_replace($this->_em->getConfiguration()->getProxyNamespace(), "", get_class($entity)); - $restName = substr(get_class($entity), strlen($this->_em->getConfiguration()->getProxyNamespace()) +1); - $proxyFileName = $this->_em->getConfiguration()->getProxyDir() . DIRECTORY_SEPARATOR . str_replace("\\", "", $restName) . ".php"; - $this->assertTrue(file_exists($proxyFileName), "Proxy file name cannot be found generically."); - - $entity->__load(); - $this->assertTrue($entity->__isInitialized()); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php deleted file mode 100644 index 2a50921..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php +++ /dev/null @@ -1,254 +0,0 @@ -cacheDataReflection = new \ReflectionProperty("Doctrine\Common\Cache\ArrayCache", "data"); - $this->cacheDataReflection->setAccessible(true); - $this->useModelSet('cms'); - parent::setUp(); - } - - /** - * @param ArrayCache $cache - * @return integer - */ - private function getCacheSize(ArrayCache $cache) - { - return sizeof($this->cacheDataReflection->getValue($cache)); - } - - public function testResultCache() - { - $user = new CmsUser; - $user->name = 'Roman'; - $user->username = 'romanb'; - $user->status = 'dev'; - $this->_em->persist($user); - $this->_em->flush(); - - - $query = $this->_em->createQuery('select ux from Doctrine\Tests\Models\CMS\CmsUser ux'); - - $cache = new ArrayCache(); - - $query->setResultCacheDriver($cache)->setResultCacheId('my_cache_id'); - - $this->assertFalse($cache->contains('my_cache_id')); - - $users = $query->getResult(); - - $this->assertTrue($cache->contains('my_cache_id')); - $this->assertEquals(1, count($users)); - $this->assertEquals('Roman', $users[0]->name); - - $this->_em->clear(); - - $query2 = $this->_em->createQuery('select ux from Doctrine\Tests\Models\CMS\CmsUser ux'); - $query2->setResultCacheDriver($cache)->setResultCacheId('my_cache_id'); - - $users = $query2->getResult(); - - $this->assertTrue($cache->contains('my_cache_id')); - $this->assertEquals(1, count($users)); - $this->assertEquals('Roman', $users[0]->name); - } - - public function testSetResultCacheId() - { - $cache = new ArrayCache; - - $query = $this->_em->createQuery('select ux from Doctrine\Tests\Models\CMS\CmsUser ux'); - $query->setResultCacheDriver($cache); - $query->setResultCacheId('testing_result_cache_id'); - - $this->assertFalse($cache->contains('testing_result_cache_id')); - - $users = $query->getResult(); - - $this->assertTrue($cache->contains('testing_result_cache_id')); - } - - public function testUseResultCache() - { - $cache = new \Doctrine\Common\Cache\ArrayCache(); - - $query = $this->_em->createQuery('select ux from Doctrine\Tests\Models\CMS\CmsUser ux'); - $query->useResultCache(true); - $query->setResultCacheDriver($cache); - $query->setResultCacheId('testing_result_cache_id'); - $users = $query->getResult(); - - $this->assertTrue($cache->contains('testing_result_cache_id')); - - $this->_em->getConfiguration()->setResultCacheImpl(new ArrayCache()); - } - - /** - * @group DDC-1026 - */ - public function testUseResultCacheParams() - { - $cache = new \Doctrine\Common\Cache\ArrayCache(); - - $sqlCount = count($this->_sqlLoggerStack->queries); - $query = $this->_em->createQuery('select ux from Doctrine\Tests\Models\CMS\CmsUser ux WHERE ux.id = ?1'); - $query->setParameter(1, 1); - $query->setResultCacheDriver($cache); - $query->useResultCache(true); - $query->getResult(); - - $query->setParameter(1, 2); - $query->getResult(); - - $this->assertEquals($sqlCount + 2, count($this->_sqlLoggerStack->queries), "Two non-cached queries."); - - $query->setParameter(1, 1); - $query->useResultCache(true); - $query->getResult(); - - $query->setParameter(1, 2); - $query->getResult(); - - $this->assertEquals($sqlCount + 2, count($this->_sqlLoggerStack->queries), "The next two sql should have been cached, but were not."); - } - - public function testNativeQueryResultCaching() - { - $rsm = new \Doctrine\ORM\Query\ResultSetMapping(); - $rsm->addScalarResult('id', 'u'); - $query = $this->_em->createNativeQuery('select u.id FROM cms_users u WHERE u.id = ?', $rsm); - $query->setParameter(1, 10); - - $cache = new ArrayCache(); - $query->setResultCacheDriver($cache)->useResultCache(true); - - $this->assertEquals(0, $this->getCacheSize($cache)); - $query->getResult(); - $this->assertEquals(1, $this->getCacheSize($cache)); - - return $query; - } - - /** - * @param string $query - * @depends testNativeQueryResultCaching - */ - public function testResultCacheNotDependsOnQueryHints($query) - { - $cache = $query->getResultCacheDriver(); - $cacheCount = $this->getCacheSize($cache); - - $query->setHint('foo', 'bar'); - $query->getResult(); - - $this->assertEquals($cacheCount, $this->getCacheSize($cache)); - } - - /** - * @param $query - * @depends testNativeQueryResultCaching - */ - public function testResultCacheDependsOnParameters($query) - { - $cache = $query->getResultCacheDriver(); - $cacheCount = $this->getCacheSize($cache); - - $query->setParameter(1, 50); - $query->getResult(); - - $this->assertEquals($cacheCount + 1, $this->getCacheSize($cache)); - } - - /** - * @param $query - * @depends testNativeQueryResultCaching - */ - public function testResultCacheNotDependsOnHydrationMode($query) - { - $cache = $query->getResultCacheDriver(); - $cacheCount = $this->getCacheSize($cache); - - $this->assertNotEquals(\Doctrine\ORM\Query::HYDRATE_ARRAY, $query->getHydrationMode()); - $query->getArrayResult(); - - $this->assertEquals($cacheCount, $this->getCacheSize($cache)); - } - - /** - * @group DDC-909 - */ - public function testResultCacheWithObjectParameter() - { - $user1 = new CmsUser; - $user1->name = 'Roman'; - $user1->username = 'romanb'; - $user1->status = 'dev'; - - $user2 = new CmsUser; - $user2->name = 'Benjamin'; - $user2->username = 'beberlei'; - $user2->status = 'dev'; - - $article = new CmsArticle(); - $article->text = "foo"; - $article->topic = "baz"; - $article->user = $user1; - - $this->_em->persist($article); - $this->_em->persist($user1); - $this->_em->persist($user2); - $this->_em->flush(); - - $query = $this->_em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsArticle a WHERE a.user = ?1'); - $query->setParameter(1, $user1); - - $cache = new ArrayCache(); - - $query->setResultCacheDriver($cache)->useResultCache(true); - - $articles = $query->getResult(); - - $this->assertEquals(1, count($articles)); - $this->assertEquals('baz', $articles[0]->topic); - - $this->_em->clear(); - - $query2 = $this->_em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsArticle a WHERE a.user = ?1'); - $query2->setParameter(1, $user1); - - $query2->setResultCacheDriver($cache)->useResultCache(true); - - $articles = $query2->getResult(); - - $this->assertEquals(1, count($articles)); - $this->assertEquals('baz', $articles[0]->topic); - - $query3 = $this->_em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsArticle a WHERE a.user = ?1'); - $query3->setParameter(1, $user2); - - $query3->setResultCacheDriver($cache)->useResultCache(true); - - $articles = $query3->getResult(); - - $this->assertEquals(0, count($articles)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SQLFilterTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SQLFilterTest.php deleted file mode 100644 index 31ebb2d..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SQLFilterTest.php +++ /dev/null @@ -1,1047 +0,0 @@ - - */ -class SQLFilterTest extends \Doctrine\Tests\OrmFunctionalTestCase -{ - private $userId, $userId2, $articleId, $articleId2; - private $groupId, $groupId2; - private $managerId, $managerId2, $contractId1, $contractId2; - private $organizationId, $eventId1, $eventId2; - - public function setUp() - { - $this->useModelSet('cms'); - $this->useModelSet('company'); - parent::setUp(); - } - - public function tearDown() - { - parent::tearDown(); - - $class = $this->_em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $class->associationMappings['groups']['fetch'] = ClassMetadataInfo::FETCH_LAZY; - $class->associationMappings['articles']['fetch'] = ClassMetadataInfo::FETCH_LAZY; - } - - public function testConfigureFilter() - { - $config = new \Doctrine\ORM\Configuration(); - - $config->addFilter("locale", "\Doctrine\Tests\ORM\Functional\MyLocaleFilter"); - - $this->assertEquals("\Doctrine\Tests\ORM\Functional\MyLocaleFilter", $config->getFilterClassName("locale")); - $this->assertNull($config->getFilterClassName("foo")); - } - - public function testEntityManagerEnableFilter() - { - $em = $this->_getEntityManager(); - $this->configureFilters($em); - - // Enable an existing filter - $filter = $em->getFilters()->enable("locale"); - $this->assertTrue($filter instanceof \Doctrine\Tests\ORM\Functional\MyLocaleFilter); - - // Enable the filter again - $filter2 = $em->getFilters()->enable("locale"); - $this->assertEquals($filter, $filter2); - - // Enable a non-existing filter - $exceptionThrown = false; - try { - $filter = $em->getFilters()->enable("foo"); - } catch (\InvalidArgumentException $e) { - $exceptionThrown = true; - } - $this->assertTrue($exceptionThrown); - } - - public function testEntityManagerEnabledFilters() - { - $em = $this->_getEntityManager(); - - // No enabled filters - $this->assertEquals(array(), $em->getFilters()->getEnabledFilters()); - - $this->configureFilters($em); - $filter = $em->getFilters()->enable("locale"); - $filter = $em->getFilters()->enable("soft_delete"); - - // Two enabled filters - $this->assertEquals(2, count($em->getFilters()->getEnabledFilters())); - - } - - public function testEntityManagerDisableFilter() - { - $em = $this->_getEntityManager(); - $this->configureFilters($em); - - // Enable the filter - $filter = $em->getFilters()->enable("locale"); - - // Disable it - $this->assertEquals($filter, $em->getFilters()->disable("locale")); - $this->assertEquals(0, count($em->getFilters()->getEnabledFilters())); - - // Disable a non-existing filter - $exceptionThrown = false; - try { - $filter = $em->getFilters()->disable("foo"); - } catch (\InvalidArgumentException $e) { - $exceptionThrown = true; - } - $this->assertTrue($exceptionThrown); - - // Disable a non-enabled filter - $exceptionThrown = false; - try { - $filter = $em->getFilters()->disable("locale"); - } catch (\InvalidArgumentException $e) { - $exceptionThrown = true; - } - $this->assertTrue($exceptionThrown); - } - - public function testEntityManagerGetFilter() - { - $em = $this->_getEntityManager(); - $this->configureFilters($em); - - // Enable the filter - $filter = $em->getFilters()->enable("locale"); - - // Get the filter - $this->assertEquals($filter, $em->getFilters()->getFilter("locale")); - - // Get a non-enabled filter - $exceptionThrown = false; - try { - $filter = $em->getFilters()->getFilter("soft_delete"); - } catch (\InvalidArgumentException $e) { - $exceptionThrown = true; - } - $this->assertTrue($exceptionThrown); - } - - protected function configureFilters($em) - { - // Add filters to the configuration of the EM - $config = $em->getConfiguration(); - $config->addFilter("locale", "\Doctrine\Tests\ORM\Functional\MyLocaleFilter"); - $config->addFilter("soft_delete", "\Doctrine\Tests\ORM\Functional\MySoftDeleteFilter"); - } - - protected function getMockConnection() - { - // Setup connection mock - $conn = $this->getMockBuilder('Doctrine\DBAL\Connection') - ->disableOriginalConstructor() - ->getMock(); - - return $conn; - } - - protected function getMockEntityManager() - { - // Setup connection mock - $em = $this->getMockBuilder('Doctrine\ORM\EntityManager') - ->disableOriginalConstructor() - ->getMock(); - - return $em; - } - - protected function addMockFilterCollection($em) - { - $filterCollection = $this->getMockBuilder('Doctrine\ORM\Query\FilterCollection') - ->disableOriginalConstructor() - ->getMock(); - - $em->expects($this->any()) - ->method('getFilters') - ->will($this->returnValue($filterCollection)); - - return $filterCollection; - } - - public function testSQLFilterGetSetParameter() - { - // Setup mock connection - $conn = $this->getMockConnection(); - $conn->expects($this->once()) - ->method('quote') - ->with($this->equalTo('en')) - ->will($this->returnValue("'en'")); - - $em = $this->getMockEntityManager($conn); - $em->expects($this->once()) - ->method('getConnection') - ->will($this->returnValue($conn)); - - $filterCollection = $this->addMockFilterCollection($em); - $filterCollection - ->expects($this->once()) - ->method('setFiltersStateDirty'); - - $filter = new MyLocaleFilter($em); - - $filter->setParameter('locale', 'en', DBALType::STRING); - - $this->assertEquals("'en'", $filter->getParameter('locale')); - } - - public function testSQLFilterSetParameterInfersType() - { - // Setup mock connection - $conn = $this->getMockConnection(); - $conn->expects($this->once()) - ->method('quote') - ->with($this->equalTo('en')) - ->will($this->returnValue("'en'")); - - $em = $this->getMockEntityManager($conn); - $em->expects($this->once()) - ->method('getConnection') - ->will($this->returnValue($conn)); - - $filterCollection = $this->addMockFilterCollection($em); - $filterCollection - ->expects($this->once()) - ->method('setFiltersStateDirty'); - - $filter = new MyLocaleFilter($em); - - $filter->setParameter('locale', 'en'); - - $this->assertEquals("'en'", $filter->getParameter('locale')); - } - - public function testSQLFilterAddConstraint() - { - // Set up metadata mock - $targetEntity = $this->getMockBuilder('Doctrine\ORM\Mapping\ClassMetadata') - ->disableOriginalConstructor() - ->getMock(); - - $filter = new MySoftDeleteFilter($this->getMockEntityManager()); - - // Test for an entity that gets extra filter data - $targetEntity->name = 'MyEntity\SoftDeleteNewsItem'; - $this->assertEquals('t1_.deleted = 0', $filter->addFilterConstraint($targetEntity, 't1_')); - - // Test for an entity that doesn't get extra filter data - $targetEntity->name = 'MyEntity\NoSoftDeleteNewsItem'; - $this->assertEquals('', $filter->addFilterConstraint($targetEntity, 't1_')); - - } - - public function testSQLFilterToString() - { - $em = $this->getMockEntityManager(); - $filterCollection = $this->addMockFilterCollection($em); - - $filter = new MyLocaleFilter($em); - $filter->setParameter('locale', 'en', DBALType::STRING); - $filter->setParameter('foo', 'bar', DBALType::STRING); - - $filter2 = new MyLocaleFilter($em); - $filter2->setParameter('foo', 'bar', DBALType::STRING); - $filter2->setParameter('locale', 'en', DBALType::STRING); - - $parameters = array( - 'foo' => array('value' => 'bar', 'type' => DBALType::STRING), - 'locale' => array('value' => 'en', 'type' => DBALType::STRING), - ); - - $this->assertEquals(serialize($parameters), ''.$filter); - $this->assertEquals(''.$filter, ''.$filter2); - } - - public function testQueryCache_DependsOnFilters() - { - $cacheDataReflection = new \ReflectionProperty("Doctrine\Common\Cache\ArrayCache", "data"); - $cacheDataReflection->setAccessible(true); - - $query = $this->_em->createQuery('select ux from Doctrine\Tests\Models\CMS\CmsUser ux'); - - $cache = new ArrayCache(); - $query->setQueryCacheDriver($cache); - - $query->getResult(); - $this->assertEquals(1, sizeof($cacheDataReflection->getValue($cache))); - - $conf = $this->_em->getConfiguration(); - $conf->addFilter("locale", "\Doctrine\Tests\ORM\Functional\MyLocaleFilter"); - $this->_em->getFilters()->enable("locale"); - - $query->getResult(); - $this->assertEquals(2, sizeof($cacheDataReflection->getValue($cache))); - - // Another time doesn't add another cache entry - $query->getResult(); - $this->assertEquals(2, sizeof($cacheDataReflection->getValue($cache))); - } - - public function testQueryGeneration_DependsOnFilters() - { - $query = $this->_em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsAddress a'); - $firstSQLQuery = $query->getSQL(); - - $conf = $this->_em->getConfiguration(); - $conf->addFilter("country", "\Doctrine\Tests\ORM\Functional\CMSCountryFilter"); - $this->_em->getFilters()->enable("country") - ->setParameter("country", "en", DBALType::STRING); - - $this->assertNotEquals($firstSQLQuery, $query->getSQL()); - } - - public function testToOneFilter() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - $this->loadFixtureData(); - - $query = $this->_em->createQuery('select ux, ua from Doctrine\Tests\Models\CMS\CmsUser ux JOIN ux.address ua'); - - // We get two users before enabling the filter - $this->assertEquals(2, count($query->getResult())); - - $conf = $this->_em->getConfiguration(); - $conf->addFilter("country", "\Doctrine\Tests\ORM\Functional\CMSCountryFilter"); - $this->_em->getFilters()->enable("country")->setParameter("country", "Germany", DBALType::STRING); - - // We get one user after enabling the filter - $this->assertEquals(1, count($query->getResult())); - } - - public function testManyToManyFilter() - { - $this->loadFixtureData(); - $query = $this->_em->createQuery('select ux, ug from Doctrine\Tests\Models\CMS\CmsUser ux JOIN ux.groups ug'); - - // We get two users before enabling the filter - $this->assertEquals(2, count($query->getResult())); - - $conf = $this->_em->getConfiguration(); - $conf->addFilter("group_prefix", "\Doctrine\Tests\ORM\Functional\CMSGroupPrefixFilter"); - $this->_em->getFilters()->enable("group_prefix")->setParameter("prefix", "bar_%", DBALType::STRING); - - // We get one user after enabling the filter - $this->assertEquals(1, count($query->getResult())); - - } - - public function testWhereFilter() - { - $this->loadFixtureData(); - $query = $this->_em->createQuery('select ug from Doctrine\Tests\Models\CMS\CmsGroup ug WHERE 1=1'); - - // We get two users before enabling the filter - $this->assertEquals(2, count($query->getResult())); - - $conf = $this->_em->getConfiguration(); - $conf->addFilter("group_prefix", "\Doctrine\Tests\ORM\Functional\CMSGroupPrefixFilter"); - $this->_em->getFilters()->enable("group_prefix")->setParameter("prefix", "bar_%", DBALType::STRING); - - // We get one user after enabling the filter - $this->assertEquals(1, count($query->getResult())); - } - - - private function loadLazyFixtureData() - { - $class = $this->_em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $class->associationMappings['articles']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; - $class->associationMappings['groups']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; - $this->loadFixtureData(); - } - - private function useCMSArticleTopicFilter() - { - $conf = $this->_em->getConfiguration(); - $conf->addFilter("article_topic", "\Doctrine\Tests\ORM\Functional\CMSArticleTopicFilter"); - $this->_em->getFilters()->enable("article_topic")->setParameter("topic", "Test1", DBALType::STRING); - } - - public function testOneToMany_ExtraLazyCountWithFilter() - { - $this->loadLazyFixtureData(); - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - - $this->assertFalse($user->articles->isInitialized()); - $this->assertEquals(2, count($user->articles)); - - $this->useCMSArticleTopicFilter(); - - $this->assertEquals(1, count($user->articles)); - } - - public function testOneToMany_ExtraLazyContainsWithFilter() - { - $this->loadLazyFixtureData(); - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - $filteredArticle = $this->_em->find('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId2); - - $this->assertFalse($user->articles->isInitialized()); - $this->assertTrue($user->articles->contains($filteredArticle)); - - $this->useCMSArticleTopicFilter(); - - $this->assertFalse($user->articles->contains($filteredArticle)); - } - - public function testOneToMany_ExtraLazySliceWithFilter() - { - $this->loadLazyFixtureData(); - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - - $this->assertFalse($user->articles->isInitialized()); - $this->assertEquals(2, count($user->articles->slice(0,10))); - - $this->useCMSArticleTopicFilter(); - - $this->assertEquals(1, count($user->articles->slice(0,10))); - } - - private function useCMSGroupPrefixFilter() - { - $conf = $this->_em->getConfiguration(); - $conf->addFilter("group_prefix", "\Doctrine\Tests\ORM\Functional\CMSGroupPrefixFilter"); - $this->_em->getFilters()->enable("group_prefix")->setParameter("prefix", "foo%", DBALType::STRING); - } - - public function testManyToMany_ExtraLazyCountWithFilter() - { - $this->loadLazyFixtureData(); - - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId2); - - $this->assertFalse($user->groups->isInitialized()); - $this->assertEquals(2, count($user->groups)); - - $this->useCMSGroupPrefixFilter(); - - $this->assertEquals(1, count($user->groups)); - } - - public function testManyToMany_ExtraLazyContainsWithFilter() - { - $this->loadLazyFixtureData(); - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId2); - $filteredArticle = $this->_em->find('Doctrine\Tests\Models\CMS\CmsGroup', $this->groupId2); - - $this->assertFalse($user->groups->isInitialized()); - $this->assertTrue($user->groups->contains($filteredArticle)); - - $this->useCMSGroupPrefixFilter(); - - $this->assertFalse($user->groups->contains($filteredArticle)); - } - - public function testManyToMany_ExtraLazySliceWithFilter() - { - $this->loadLazyFixtureData(); - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId2); - - $this->assertFalse($user->groups->isInitialized()); - $this->assertEquals(2, count($user->groups->slice(0,10))); - - $this->useCMSGroupPrefixFilter(); - - $this->assertEquals(1, count($user->groups->slice(0,10))); - } - - private function loadFixtureData() - { - $user = new CmsUser; - $user->name = 'Roman'; - $user->username = 'romanb'; - $user->status = 'developer'; - - $address = new CmsAddress; - $address->country = 'Germany'; - $address->city = 'Berlin'; - $address->zip = '12345'; - - $user->address = $address; // inverse side - $address->user = $user; // owning side! - - $group = new CmsGroup; - $group->name = 'foo_group'; - $user->addGroup($group); - - $article1 = new CmsArticle; - $article1->topic = "Test1"; - $article1->text = "Test"; - $article1->setAuthor($user); - - $article2 = new CmsArticle; - $article2->topic = "Test2"; - $article2->text = "Test"; - $article2->setAuthor($user); - - $this->_em->persist($article1); - $this->_em->persist($article2); - - $this->_em->persist($user); - - $user2 = new CmsUser; - $user2->name = 'Guilherme'; - $user2->username = 'gblanco'; - $user2->status = 'developer'; - - $address2 = new CmsAddress; - $address2->country = 'France'; - $address2->city = 'Paris'; - $address2->zip = '12345'; - - $user->address = $address2; // inverse side - $address2->user = $user2; // owning side! - - $user2->addGroup($group); - $group2 = new CmsGroup; - $group2->name = 'bar_group'; - $user2->addGroup($group2); - - $this->_em->persist($user2); - $this->_em->flush(); - $this->_em->clear(); - - $this->userId = $user->getId(); - $this->userId2 = $user2->getId(); - $this->articleId = $article1->id; - $this->articleId2 = $article2->id; - $this->groupId = $group->id; - $this->groupId2 = $group2->id; - } - - public function testJoinSubclassPersister_FilterOnlyOnRootTableWhenFetchingSubEntity() - { - $this->loadCompanyJoinedSubclassFixtureData(); - // Persister - $this->assertEquals(2, count($this->_em->getRepository('Doctrine\Tests\Models\Company\CompanyManager')->findAll())); - // SQLWalker - $this->assertEquals(2, count($this->_em->createQuery("SELECT cm FROM Doctrine\Tests\Models\Company\CompanyManager cm")->getResult())); - - // Enable the filter - $this->usePersonNameFilter('Guilh%'); - - $managers = $this->_em->getRepository('Doctrine\Tests\Models\Company\CompanyManager')->findAll(); - $this->assertEquals(1, count($managers)); - $this->assertEquals("Guilherme", $managers[0]->getName()); - - $this->assertEquals(1, count($this->_em->createQuery("SELECT cm FROM Doctrine\Tests\Models\Company\CompanyManager cm")->getResult())); - } - - public function testJoinSubclassPersister_FilterOnlyOnRootTableWhenFetchingRootEntity() - { - $this->loadCompanyJoinedSubclassFixtureData(); - $this->assertEquals(3, count($this->_em->getRepository('Doctrine\Tests\Models\Company\CompanyPerson')->findAll())); - $this->assertEquals(3, count($this->_em->createQuery("SELECT cp FROM Doctrine\Tests\Models\Company\CompanyPerson cp")->getResult())); - - // Enable the filter - $this->usePersonNameFilter('Guilh%'); - - $persons = $this->_em->getRepository('Doctrine\Tests\Models\Company\CompanyPerson')->findAll(); - $this->assertEquals(1, count($persons)); - $this->assertEquals("Guilherme", $persons[0]->getName()); - - $this->assertEquals(1, count($this->_em->createQuery("SELECT cp FROM Doctrine\Tests\Models\Company\CompanyPerson cp")->getResult())); - } - - private function loadCompanyJoinedSubclassFixtureData() - { - $manager = new CompanyManager; - $manager->setName('Roman'); - $manager->setTitle('testlead'); - $manager->setSalary(42); - $manager->setDepartment('persisters'); - - $manager2 = new CompanyManager; - $manager2->setName('Guilherme'); - $manager2->setTitle('devlead'); - $manager2->setSalary(42); - $manager2->setDepartment('parsers'); - - $person = new CompanyPerson; - $person->setName('Benjamin'); - - $this->_em->persist($manager); - $this->_em->persist($manager2); - $this->_em->persist($person); - $this->_em->flush(); - $this->_em->clear(); - } - - public function testSingleTableInheritance_FilterOnlyOnRootTableWhenFetchingSubEntity() - { - $this->loadCompanySingleTableInheritanceFixtureData(); - // Persister - $this->assertEquals(2, count($this->_em->getRepository('Doctrine\Tests\Models\Company\CompanyFlexUltraContract')->findAll())); - // SQLWalker - $this->assertEquals(2, count($this->_em->createQuery("SELECT cfc FROM Doctrine\Tests\Models\Company\CompanyFlexUltraContract cfc")->getResult())); - - // Enable the filter - $conf = $this->_em->getConfiguration(); - $conf->addFilter("completed_contract", "\Doctrine\Tests\ORM\Functional\CompletedContractFilter"); - $this->_em->getFilters() - ->enable("completed_contract") - ->setParameter("completed", true, DBALType::BOOLEAN); - - $this->assertEquals(1, count($this->_em->getRepository('Doctrine\Tests\Models\Company\CompanyFlexUltraContract')->findAll())); - $this->assertEquals(1, count($this->_em->createQuery("SELECT cfc FROM Doctrine\Tests\Models\Company\CompanyFlexUltraContract cfc")->getResult())); - } - - public function testSingleTableInheritance_FilterOnlyOnRootTableWhenFetchingRootEntity() - { - $this->loadCompanySingleTableInheritanceFixtureData(); - $this->assertEquals(4, count($this->_em->getRepository('Doctrine\Tests\Models\Company\CompanyFlexContract')->findAll())); - $this->assertEquals(4, count($this->_em->createQuery("SELECT cfc FROM Doctrine\Tests\Models\Company\CompanyFlexContract cfc")->getResult())); - - // Enable the filter - $conf = $this->_em->getConfiguration(); - $conf->addFilter("completed_contract", "\Doctrine\Tests\ORM\Functional\CompletedContractFilter"); - $this->_em->getFilters() - ->enable("completed_contract") - ->setParameter("completed", true, DBALType::BOOLEAN); - - $this->assertEquals(2, count($this->_em->getRepository('Doctrine\Tests\Models\Company\CompanyFlexContract')->findAll())); - $this->assertEquals(2, count($this->_em->createQuery("SELECT cfc FROM Doctrine\Tests\Models\Company\CompanyFlexContract cfc")->getResult())); - } - - private function loadCompanySingleTableInheritanceFixtureData() - { - $contract1 = new CompanyFlexUltraContract; - $contract2 = new CompanyFlexUltraContract; - $contract2->markCompleted(); - - $contract3 = new CompanyFlexContract; - $contract4 = new CompanyFlexContract; - $contract4->markCompleted(); - - $manager = new CompanyManager; - $manager->setName('Alexander'); - $manager->setSalary(42); - $manager->setDepartment('Doctrine'); - $manager->setTitle('Filterer'); - - $manager2 = new CompanyManager; - $manager2->setName('Benjamin'); - $manager2->setSalary(1337); - $manager2->setDepartment('Doctrine'); - $manager2->setTitle('Maintainer'); - - $contract1->addManager($manager); - $contract2->addManager($manager); - $contract3->addManager($manager); - $contract4->addManager($manager); - - $contract1->addManager($manager2); - - $contract1->setSalesPerson($manager); - $contract2->setSalesPerson($manager); - - $this->_em->persist($manager); - $this->_em->persist($manager2); - $this->_em->persist($contract1); - $this->_em->persist($contract2); - $this->_em->persist($contract3); - $this->_em->persist($contract4); - $this->_em->flush(); - $this->_em->clear(); - - $this->managerId = $manager->getId(); - $this->managerId2 = $manager2->getId(); - $this->contractId1 = $contract1->getId(); - $this->contractId2 = $contract2->getId(); - } - - private function useCompletedContractFilter() - { - $conf = $this->_em->getConfiguration(); - $conf->addFilter("completed_contract", "\Doctrine\Tests\ORM\Functional\CompletedContractFilter"); - $this->_em->getFilters() - ->enable("completed_contract") - ->setParameter("completed", true, DBALType::BOOLEAN); - } - - public function testManyToMany_ExtraLazyCountWithFilterOnSTI() - { - $this->loadCompanySingleTableInheritanceFixtureData(); - - $manager = $this->_em->find('Doctrine\Tests\Models\Company\CompanyManager', $this->managerId); - - $this->assertFalse($manager->managedContracts->isInitialized()); - $this->assertEquals(4, count($manager->managedContracts)); - - // Enable the filter - $this->useCompletedContractFilter(); - - $this->assertFalse($manager->managedContracts->isInitialized()); - $this->assertEquals(2, count($manager->managedContracts)); - } - - public function testManyToMany_ExtraLazyContainsWithFilterOnSTI() - { - $this->loadCompanySingleTableInheritanceFixtureData(); - - $manager = $this->_em->find('Doctrine\Tests\Models\Company\CompanyManager', $this->managerId); - $contract1 = $this->_em->find('Doctrine\Tests\Models\Company\CompanyContract', $this->contractId1); - $contract2 = $this->_em->find('Doctrine\Tests\Models\Company\CompanyContract', $this->contractId2); - - $this->assertFalse($manager->managedContracts->isInitialized()); - $this->assertTrue($manager->managedContracts->contains($contract1)); - $this->assertTrue($manager->managedContracts->contains($contract2)); - - // Enable the filter - $this->useCompletedContractFilter(); - - $this->assertFalse($manager->managedContracts->isInitialized()); - $this->assertFalse($manager->managedContracts->contains($contract1)); - $this->assertTrue($manager->managedContracts->contains($contract2)); - } - - public function testManyToMany_ExtraLazySliceWithFilterOnSTI() - { - $this->loadCompanySingleTableInheritanceFixtureData(); - - $manager = $this->_em->find('Doctrine\Tests\Models\Company\CompanyManager', $this->managerId); - - $this->assertFalse($manager->managedContracts->isInitialized()); - $this->assertEquals(4, count($manager->managedContracts->slice(0, 10))); - - // Enable the filter - $this->useCompletedContractFilter(); - - $this->assertFalse($manager->managedContracts->isInitialized()); - $this->assertEquals(2, count($manager->managedContracts->slice(0, 10))); - } - - private function usePersonNameFilter($name) - { - // Enable the filter - $conf = $this->_em->getConfiguration(); - $conf->addFilter("person_name", "\Doctrine\Tests\ORM\Functional\CompanyPersonNameFilter"); - $this->_em->getFilters() - ->enable("person_name") - ->setParameter("name", $name, DBALType::STRING); - } - - public function testManyToMany_ExtraLazyCountWithFilterOnCTI() - { - $this->loadCompanySingleTableInheritanceFixtureData(); - - $contract = $this->_em->find('Doctrine\Tests\Models\Company\CompanyFlexUltraContract', $this->contractId1); - - $this->assertFalse($contract->managers->isInitialized()); - $this->assertEquals(2, count($contract->managers)); - - // Enable the filter - $this->usePersonNameFilter('Benjamin'); - - $this->assertFalse($contract->managers->isInitialized()); - $this->assertEquals(1, count($contract->managers)); - } - - public function testManyToMany_ExtraLazyContainsWithFilterOnCTI() - { - $this->loadCompanySingleTableInheritanceFixtureData(); - - $contract = $this->_em->find('Doctrine\Tests\Models\Company\CompanyFlexUltraContract', $this->contractId1); - $manager1 = $this->_em->find('Doctrine\Tests\Models\Company\CompanyManager', $this->managerId); - $manager2 = $this->_em->find('Doctrine\Tests\Models\Company\CompanyManager', $this->managerId2); - - $this->assertFalse($contract->managers->isInitialized()); - $this->assertTrue($contract->managers->contains($manager1)); - $this->assertTrue($contract->managers->contains($manager2)); - - // Enable the filter - $this->usePersonNameFilter('Benjamin'); - - $this->assertFalse($contract->managers->isInitialized()); - $this->assertFalse($contract->managers->contains($manager1)); - $this->assertTrue($contract->managers->contains($manager2)); - } - - public function testManyToMany_ExtraLazySliceWithFilterOnCTI() - { - $this->loadCompanySingleTableInheritanceFixtureData(); - - $contract = $this->_em->find('Doctrine\Tests\Models\Company\CompanyFlexUltraContract', $this->contractId1); - - $this->assertFalse($contract->managers->isInitialized()); - $this->assertEquals(2, count($contract->managers->slice(0, 10))); - - // Enable the filter - $this->usePersonNameFilter('Benjamin'); - - $this->assertFalse($contract->managers->isInitialized()); - $this->assertEquals(1, count($contract->managers->slice(0, 10))); - } - - public function testOneToMany_ExtraLazyCountWithFilterOnSTI() - { - $this->loadCompanySingleTableInheritanceFixtureData(); - - $manager = $this->_em->find('Doctrine\Tests\Models\Company\CompanyManager', $this->managerId); - - $this->assertFalse($manager->soldContracts->isInitialized()); - $this->assertEquals(2, count($manager->soldContracts)); - - // Enable the filter - $this->useCompletedContractFilter(); - - $this->assertFalse($manager->soldContracts->isInitialized()); - $this->assertEquals(1, count($manager->soldContracts)); - } - - public function testOneToMany_ExtraLazyContainsWithFilterOnSTI() - { - $this->loadCompanySingleTableInheritanceFixtureData(); - - $manager = $this->_em->find('Doctrine\Tests\Models\Company\CompanyManager', $this->managerId); - $contract1 = $this->_em->find('Doctrine\Tests\Models\Company\CompanyContract', $this->contractId1); - $contract2 = $this->_em->find('Doctrine\Tests\Models\Company\CompanyContract', $this->contractId2); - - $this->assertFalse($manager->soldContracts->isInitialized()); - $this->assertTrue($manager->soldContracts->contains($contract1)); - $this->assertTrue($manager->soldContracts->contains($contract2)); - - // Enable the filter - $this->useCompletedContractFilter(); - - $this->assertFalse($manager->soldContracts->isInitialized()); - $this->assertFalse($manager->soldContracts->contains($contract1)); - $this->assertTrue($manager->soldContracts->contains($contract2)); - } - - public function testOneToMany_ExtraLazySliceWithFilterOnSTI() - { - - $this->loadCompanySingleTableInheritanceFixtureData(); - - $manager = $this->_em->find('Doctrine\Tests\Models\Company\CompanyManager', $this->managerId); - - $this->assertFalse($manager->soldContracts->isInitialized()); - $this->assertEquals(2, count($manager->soldContracts->slice(0, 10))); - - // Enable the filter - $this->useCompletedContractFilter(); - - $this->assertFalse($manager->soldContracts->isInitialized()); - $this->assertEquals(1, count($manager->soldContracts->slice(0, 10))); - } - private function loadCompanyOrganizationEventJoinedSubclassFixtureData() - { - $organization = new CompanyOrganization; - - $event1 = new CompanyAuction; - $event1->setData('foo'); - - $event2 = new CompanyAuction; - $event2->setData('bar'); - - $organization->addEvent($event1); - $organization->addEvent($event2); - - $this->_em->persist($organization); - $this->_em->flush(); - $this->_em->clear(); - - $this->organizationId = $organization->getId(); - $this->eventId1 = $event1->getId(); - $this->eventId2 = $event2->getId(); - } - - private function useCompanyEventIdFilter() - { - // Enable the filter - $conf = $this->_em->getConfiguration(); - $conf->addFilter("event_id", "\Doctrine\Tests\ORM\Functional\CompanyEventFilter"); - $this->_em->getFilters() - ->enable("event_id") - ->setParameter("id", $this->eventId2); - } - - - public function testOneToMany_ExtraLazyCountWithFilterOnCTI() - { - $this->loadCompanyOrganizationEventJoinedSubclassFixtureData(); - - $organization = $this->_em->find('Doctrine\Tests\Models\Company\CompanyOrganization', $this->organizationId); - - $this->assertFalse($organization->events->isInitialized()); - $this->assertEquals(2, count($organization->events)); - - // Enable the filter - $this->useCompanyEventIdFilter(); - - $this->assertFalse($organization->events->isInitialized()); - $this->assertEquals(1, count($organization->events)); - } - - public function testOneToMany_ExtraLazyContainsWithFilterOnCTI() - { - $this->loadCompanyOrganizationEventJoinedSubclassFixtureData(); - - $organization = $this->_em->find('Doctrine\Tests\Models\Company\CompanyOrganization', $this->organizationId); - - $event1 = $this->_em->find('Doctrine\Tests\Models\Company\CompanyEvent', $this->eventId1); - $event2 = $this->_em->find('Doctrine\Tests\Models\Company\CompanyEvent', $this->eventId2); - - $this->assertFalse($organization->events->isInitialized()); - $this->assertTrue($organization->events->contains($event1)); - $this->assertTrue($organization->events->contains($event2)); - - // Enable the filter - $this->useCompanyEventIdFilter(); - - $this->assertFalse($organization->events->isInitialized()); - $this->assertFalse($organization->events->contains($event1)); - $this->assertTrue($organization->events->contains($event2)); - } - - public function testOneToMany_ExtraLazySliceWithFilterOnCTI() - { - $this->loadCompanyOrganizationEventJoinedSubclassFixtureData(); - - $organization = $this->_em->find('Doctrine\Tests\Models\Company\CompanyOrganization', $this->organizationId); - - $this->assertFalse($organization->events->isInitialized()); - $this->assertEquals(2, count($organization->events->slice(0, 10))); - - // Enable the filter - $this->useCompanyEventIdFilter(); - - $this->assertFalse($organization->events->isInitialized()); - $this->assertEquals(1, count($organization->events->slice(0, 10))); - } -} - -class MySoftDeleteFilter extends SQLFilter -{ - public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias) - { - if ($targetEntity->name != "MyEntity\SoftDeleteNewsItem") { - return ""; - } - - return $targetTableAlias.'.deleted = 0'; - } -} - -class MyLocaleFilter extends SQLFilter -{ - public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias) - { - if (!in_array("LocaleAware", $targetEntity->reflClass->getInterfaceNames())) { - return ""; - } - - return $targetTableAlias.'.locale = ' . $this->getParameter('locale'); // getParam uses connection to quote the value. - } -} - -class CMSCountryFilter extends SQLFilter -{ - public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias) - { - if ($targetEntity->name != "Doctrine\Tests\Models\CMS\CmsAddress") { - return ""; - } - - return $targetTableAlias.'.country = ' . $this->getParameter('country'); // getParam uses connection to quote the value. - } -} - -class CMSGroupPrefixFilter extends SQLFilter -{ - public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias) - { - if ($targetEntity->name != "Doctrine\Tests\Models\CMS\CmsGroup") { - return ""; - } - - return $targetTableAlias.'.name LIKE ' . $this->getParameter('prefix'); // getParam uses connection to quote the value. - } -} - -class CMSArticleTopicFilter extends SQLFilter -{ - public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias) - { - if ($targetEntity->name != "Doctrine\Tests\Models\CMS\CmsArticle") { - return ""; - } - - return $targetTableAlias.'.topic = ' . $this->getParameter('topic'); // getParam uses connection to quote the value. - } -} - -class CompanyPersonNameFilter extends SQLFilter -{ - public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias, $targetTable = '') - { - if ($targetEntity->name != "Doctrine\Tests\Models\Company\CompanyPerson") { - return ""; - } - - return $targetTableAlias.'.name LIKE ' . $this->getParameter('name'); - } -} - -class CompletedContractFilter extends SQLFilter -{ - public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias, $targetTable = '') - { - if ($targetEntity->name != "Doctrine\Tests\Models\Company\CompanyContract") { - return ""; - } - - return $targetTableAlias.'.completed = ' . $this->getParameter('completed'); - } -} - -class CompanyEventFilter extends SQLFilter -{ - public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias, $targetTable = '') - { - if ($targetEntity->name != "Doctrine\Tests\Models\Company\CompanyEvent") { - return ""; - } - - return $targetTableAlias.'.id = ' . $this->getParameter('id'); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/CompanySchemaTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/CompanySchemaTest.php deleted file mode 100644 index a1e6dac..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/CompanySchemaTest.php +++ /dev/null @@ -1,68 +0,0 @@ -useModelSet('company'); - parent::setUp(); - } - - /** - * @group DDC-966 - * @return Schema - */ - public function testGeneratedSchema() - { - $schema = $this->_em->getConnection()->getSchemaManager()->createSchema(); - - $this->assertTrue($schema->hasTable('company_contracts')); - - return $schema; - } - - /** - * @group DDC-966 - * @depends testGeneratedSchema - */ - public function testSingleTableInheritance(Schema $schema) - { - $table = $schema->getTable('company_contracts'); - - // Check nullability constraints - $this->assertTrue($table->getColumn('id')->getNotnull()); - $this->assertTrue($table->getColumn('completed')->getNotnull()); - $this->assertFalse($table->getColumn('salesPerson_id')->getNotnull()); - $this->assertTrue($table->getColumn('discr')->getNotnull()); - $this->assertFalse($table->getColumn('fixPrice')->getNotnull()); - $this->assertFalse($table->getColumn('hoursWorked')->getNotnull()); - $this->assertFalse($table->getColumn('pricePerHour')->getNotnull()); - $this->assertFalse($table->getColumn('maxPrice')->getNotnull()); - } - - /** - * @group DBAL-115 - */ - public function testDropPartSchemaWithForeignKeys() - { - if (!$this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { - $this->markTestSkipped("Foreign Key test"); - } - - $sql = $this->_schemaTool->getDropSchemaSQL(array( - $this->_em->getClassMetadata('Doctrine\Tests\Models\Company\CompanyManager'), - )); - $this->assertEquals(4, count($sql)); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DDC214Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DDC214Test.php deleted file mode 100644 index eae3d4b..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DDC214Test.php +++ /dev/null @@ -1,90 +0,0 @@ -_em->getConnection(); - - if (strpos($conn->getDriver()->getName(), "sqlite") !== false) { - $this->markTestSkipped('SQLite does not support ALTER TABLE statements.'); - } - $this->schemaTool = new Tools\SchemaTool($this->_em); - } - - /** - * @group DDC-214 - */ - public function testCmsAddressModel() - { - $this->classes = array( - 'Doctrine\Tests\Models\CMS\CmsUser', - 'Doctrine\Tests\Models\CMS\CmsPhonenumber', - 'Doctrine\Tests\Models\CMS\CmsAddress', - 'Doctrine\Tests\Models\CMS\CmsGroup', - 'Doctrine\Tests\Models\CMS\CmsArticle' - ); - - $this->assertCreatedSchemaNeedsNoUpdates($this->classes); - } - - /** - * @group DDC-214 - */ - public function testCompanyModel() - { - $this->classes = array( - 'Doctrine\Tests\Models\Company\CompanyPerson', - 'Doctrine\Tests\Models\Company\CompanyEmployee', - 'Doctrine\Tests\Models\Company\CompanyManager', - 'Doctrine\Tests\Models\Company\CompanyOrganization', - 'Doctrine\Tests\Models\Company\CompanyEvent', - 'Doctrine\Tests\Models\Company\CompanyAuction', - 'Doctrine\Tests\Models\Company\CompanyRaffle', - 'Doctrine\Tests\Models\Company\CompanyCar' - ); - - $this->assertCreatedSchemaNeedsNoUpdates($this->classes); - } - - public function assertCreatedSchemaNeedsNoUpdates($classes) - { - $classMetadata = array(); - foreach ($classes AS $class) { - $classMetadata[] = $this->_em->getClassMetadata($class); - } - - try { - $this->schemaTool->createSchema($classMetadata); - } catch(\Exception $e) { - // was already created - } - - $sm = $this->_em->getConnection()->getSchemaManager(); - - $fromSchema = $sm->createSchema(); - $toSchema = $this->schemaTool->getSchemaFromMetadata($classMetadata); - - $comparator = new \Doctrine\DBAL\Schema\Comparator(); - $schemaDiff = $comparator->compare($fromSchema, $toSchema); - - $sql = $schemaDiff->toSql($this->_em->getConnection()->getDatabasePlatform()); - $sql = array_filter($sql, function($sql) { return strpos($sql, 'DROP') === false; }); - - $this->assertEquals(0, count($sql), "SQL: " . implode(PHP_EOL, $sql)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php deleted file mode 100644 index 0c1f0ae..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php +++ /dev/null @@ -1,92 +0,0 @@ -_em->getConnection()->getDatabasePlatform()->getName() !== 'mysql') { - $this->markTestSkipped('The ' . __CLASS__ .' requires the use of mysql.'); - } - } - - public function testGetCreateSchemaSql() - { - $classes = array( - $this->_em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsAddress'), - $this->_em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'), - $this->_em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsPhonenumber'), - ); - - $tool = new SchemaTool($this->_em); - $sql = $tool->getCreateSchemaSql($classes); - $this->assertEquals("CREATE TABLE cms_addresses (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, country VARCHAR(50) NOT NULL, zip VARCHAR(50) NOT NULL, city VARCHAR(50) NOT NULL, UNIQUE INDEX UNIQ_ACAC157BA76ED395 (user_id), PRIMARY KEY(id)) ENGINE = InnoDB", $sql[0]); - $this->assertEquals("CREATE TABLE cms_users (id INT AUTO_INCREMENT NOT NULL, status VARCHAR(50) DEFAULT NULL, username VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, email_id INT DEFAULT NULL, UNIQUE INDEX UNIQ_3AF03EC5F85E0677 (username), UNIQUE INDEX UNIQ_3AF03EC5A832C1C9 (email_id), PRIMARY KEY(id)) ENGINE = InnoDB", $sql[1]); - $this->assertEquals("CREATE TABLE cms_users_groups (user_id INT NOT NULL, group_id INT NOT NULL, INDEX IDX_7EA9409AA76ED395 (user_id), INDEX IDX_7EA9409AFE54D947 (group_id), PRIMARY KEY(user_id, group_id)) ENGINE = InnoDB", $sql[2]); - $this->assertEquals("CREATE TABLE cms_phonenumbers (phonenumber VARCHAR(50) NOT NULL, user_id INT DEFAULT NULL, INDEX IDX_F21F790FA76ED395 (user_id), PRIMARY KEY(phonenumber)) ENGINE = InnoDB", $sql[3]); - $this->assertEquals("ALTER TABLE cms_addresses ADD CONSTRAINT FK_ACAC157BA76ED395 FOREIGN KEY (user_id) REFERENCES cms_users (id)", $sql[4]); - $this->assertEquals("ALTER TABLE cms_users_groups ADD CONSTRAINT FK_7EA9409AA76ED395 FOREIGN KEY (user_id) REFERENCES cms_users (id)", $sql[5]); - $this->assertEquals("ALTER TABLE cms_phonenumbers ADD CONSTRAINT FK_F21F790FA76ED395 FOREIGN KEY (user_id) REFERENCES cms_users (id)", $sql[6]); - - $this->assertEquals(7, count($sql)); - } - - public function testGetCreateSchemaSql2() - { - $classes = array( - $this->_em->getClassMetadata('Doctrine\Tests\Models\Generic\DecimalModel') - ); - - $tool = new SchemaTool($this->_em); - $sql = $tool->getCreateSchemaSql($classes); - - $this->assertEquals(1, count($sql)); - $this->assertEquals("CREATE TABLE decimal_model (id INT AUTO_INCREMENT NOT NULL, `decimal` NUMERIC(5, 2) NOT NULL, `high_scale` NUMERIC(14, 4) NOT NULL, PRIMARY KEY(id)) ENGINE = InnoDB", $sql[0]); - } - - public function testGetCreateSchemaSql3() - { - $classes = array( - $this->_em->getClassMetadata('Doctrine\Tests\Models\Generic\BooleanModel') - ); - - $tool = new SchemaTool($this->_em); - $sql = $tool->getCreateSchemaSql($classes); - - $this->assertEquals(1, count($sql)); - $this->assertEquals("CREATE TABLE boolean_model (id INT AUTO_INCREMENT NOT NULL, booleanField TINYINT(1) NOT NULL, PRIMARY KEY(id)) ENGINE = InnoDB", $sql[0]); - } - - /** - * @group DBAL-204 - */ - public function testGetCreateSchemaSql4() - { - $classes = array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\\MysqlSchemaNamespacedEntity') - ); - - $tool = new SchemaTool($this->_em); - $sql = $tool->getCreateSchemaSql($classes); - - $this->assertEquals(0, count($sql)); - } - -} - -/** - * @Entity - * @Table("namespace.entity") - */ -class MysqlSchemaNamespacedEntity -{ - /** @Column(type="integer") @Id @GeneratedValue */ - public $id; -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/PostgreSqlSchemaToolTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/PostgreSqlSchemaToolTest.php deleted file mode 100644 index 79e7af9..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/PostgreSqlSchemaToolTest.php +++ /dev/null @@ -1,108 +0,0 @@ -_em->getConnection()->getDatabasePlatform()->getName() !== 'postgresql') { - $this->markTestSkipped('The ' . __CLASS__ .' requires the use of postgresql.'); - } - } - - public function testPostgresMetadataSequenceIncrementedBy10() - { - $address = $this->_em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsAddress'); - $this->assertEquals(1, $address->sequenceGeneratorDefinition['allocationSize']); - } - - public function testGetCreateSchemaSql() - { - $classes = array( - $this->_em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsAddress'), - $this->_em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'), - $this->_em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsPhonenumber'), - ); - - $tool = new SchemaTool($this->_em); - $sql = $tool->getCreateSchemaSql($classes); - $sqlCount = count($sql); - - $this->assertEquals("CREATE TABLE cms_addresses (id INT NOT NULL, user_id INT DEFAULT NULL, country VARCHAR(50) NOT NULL, zip VARCHAR(50) NOT NULL, city VARCHAR(50) NOT NULL, PRIMARY KEY(id))", array_shift($sql)); - $this->assertEquals("CREATE UNIQUE INDEX UNIQ_ACAC157BA76ED395 ON cms_addresses (user_id)", array_shift($sql)); - $this->assertEquals("CREATE TABLE cms_users (id INT NOT NULL, email_id INT DEFAULT NULL, status VARCHAR(50) DEFAULT NULL, username VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id))", array_shift($sql)); - $this->assertEquals("CREATE UNIQUE INDEX UNIQ_3AF03EC5F85E0677 ON cms_users (username)", array_shift($sql)); - $this->assertEquals("CREATE UNIQUE INDEX UNIQ_3AF03EC5A832C1C9 ON cms_users (email_id)", array_shift($sql)); - $this->assertEquals("CREATE TABLE cms_users_groups (user_id INT NOT NULL, group_id INT NOT NULL, PRIMARY KEY(user_id, group_id))", array_shift($sql)); - $this->assertEquals("CREATE INDEX IDX_7EA9409AA76ED395 ON cms_users_groups (user_id)", array_shift($sql)); - $this->assertEquals("CREATE INDEX IDX_7EA9409AFE54D947 ON cms_users_groups (group_id)", array_shift($sql)); - $this->assertEquals("CREATE TABLE cms_phonenumbers (phonenumber VARCHAR(50) NOT NULL, user_id INT DEFAULT NULL, PRIMARY KEY(phonenumber))", array_shift($sql)); - $this->assertEquals("CREATE INDEX IDX_F21F790FA76ED395 ON cms_phonenumbers (user_id)", array_shift($sql)); - $this->assertEquals("CREATE SEQUENCE cms_addresses_id_seq INCREMENT BY 1 MINVALUE 1 START 1", array_shift($sql)); - $this->assertEquals("CREATE SEQUENCE cms_users_id_seq INCREMENT BY 1 MINVALUE 1 START 1", array_shift($sql)); - $this->assertEquals("ALTER TABLE cms_addresses ADD CONSTRAINT FK_ACAC157BA76ED395 FOREIGN KEY (user_id) REFERENCES cms_users (id) NOT DEFERRABLE INITIALLY IMMEDIATE", array_shift($sql)); - $this->assertEquals("ALTER TABLE cms_users ADD CONSTRAINT FK_3AF03EC5A832C1C9 FOREIGN KEY (email_id) REFERENCES cms_emails (id) NOT DEFERRABLE INITIALLY IMMEDIATE", array_shift($sql)); - $this->assertEquals("ALTER TABLE cms_users_groups ADD CONSTRAINT FK_7EA9409AA76ED395 FOREIGN KEY (user_id) REFERENCES cms_users (id) NOT DEFERRABLE INITIALLY IMMEDIATE", array_shift($sql)); - $this->assertEquals("ALTER TABLE cms_users_groups ADD CONSTRAINT FK_7EA9409AFE54D947 FOREIGN KEY (group_id) REFERENCES cms_groups (id) NOT DEFERRABLE INITIALLY IMMEDIATE", array_shift($sql)); - $this->assertEquals("ALTER TABLE cms_phonenumbers ADD CONSTRAINT FK_F21F790FA76ED395 FOREIGN KEY (user_id) REFERENCES cms_users (id) NOT DEFERRABLE INITIALLY IMMEDIATE", array_shift($sql)); - - $this->assertEquals(array(), $sql, "SQL Array should be empty now."); - $this->assertEquals(17, $sqlCount, "Total of 17 queries should be executed"); - } - - public function testGetCreateSchemaSql2() - { - $classes = array( - $this->_em->getClassMetadata('Doctrine\Tests\Models\Generic\DecimalModel') - ); - - $tool = new SchemaTool($this->_em); - $sql = $tool->getCreateSchemaSql($classes); - - $this->assertEquals(2, count($sql)); - - $this->assertEquals('CREATE TABLE decimal_model (id INT NOT NULL, "decimal" NUMERIC(5, 2) NOT NULL, "high_scale" NUMERIC(14, 4) NOT NULL, PRIMARY KEY(id))', $sql[0]); - $this->assertEquals("CREATE SEQUENCE decimal_model_id_seq INCREMENT BY 1 MINVALUE 1 START 1", $sql[1]); - } - - public function testGetCreateSchemaSql3() - { - $classes = array( - $this->_em->getClassMetadata('Doctrine\Tests\Models\Generic\BooleanModel') - ); - - $tool = new SchemaTool($this->_em); - $sql = $tool->getCreateSchemaSql($classes); - - $this->assertEquals(2, count($sql)); - $this->assertEquals("CREATE TABLE boolean_model (id INT NOT NULL, booleanField BOOLEAN NOT NULL, PRIMARY KEY(id))", $sql[0]); - $this->assertEquals("CREATE SEQUENCE boolean_model_id_seq INCREMENT BY 1 MINVALUE 1 START 1", $sql[1]); - } - - public function testGetDropSchemaSql() - { - $classes = array( - $this->_em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsAddress'), - $this->_em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'), - $this->_em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsPhonenumber'), - ); - - $tool = new SchemaTool($this->_em); - $sql = $tool->getDropSchemaSQL($classes); - - $this->assertEquals(14, count($sql)); - $dropSequenceSQLs = 0; - foreach ($sql AS $stmt) { - if (strpos($stmt, "DROP SEQUENCE") === 0) { - $dropSequenceSQLs++; - } - } - $this->assertEquals(4, $dropSequenceSQLs, "Expect 4 sequences to be dropped."); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaValidatorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaValidatorTest.php deleted file mode 100644 index a575db0..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaValidatorTest.php +++ /dev/null @@ -1,50 +0,0 @@ - $classes) { - if ($modelSet == "customtype") { - continue; - } - $modelSets[] = array($modelSet); - } - return $modelSets; - } - - /** - * @dataProvider dataValidateModelSets - */ - public function testValidateModelSets($modelSet) - { - $validator = new SchemaValidator($this->_em); - - $classes = array(); - foreach (self::$_modelSets[$modelSet] as $className) { - $classes[] = $this->_em->getClassMetadata($className); - } - - foreach ($classes as $class) { - $ce = $validator->validateClass($class); - - foreach ($ce as $key => $error) { - if (strpos($error, "must be private or protected. Public fields may break lazy-loading.") !== false) { - unset($ce[$key]); - } - } - - $this->assertEquals(0, count($ce), "Invalid Modelset: " . $modelSet . " class " . $class->name . ": ". implode("\n", $ce)); - } - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SequenceGeneratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SequenceGeneratorTest.php deleted file mode 100644 index 8a71cc1..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SequenceGeneratorTest.php +++ /dev/null @@ -1,53 +0,0 @@ -_em->getConnection()->getDatabasePlatform()->supportsSequences()) { - $this->markTestSkipped('Only working for Databases that support sequences.'); - } - - try { - $this->_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\SequenceEntity'), - )); - } catch(\Exception $e) { - - } - } - - public function testHighAllocationSizeSequence() - { - for ($i = 0; $i < 11; $i++) { - $e = new SequenceEntity(); - $this->_em->persist($e); - } - $this->_em->flush(); - } -} - -/** - * @Entity - */ -class SequenceEntity -{ - /** - * @Id - * @column(type="integer") - * @GeneratedValue(strategy="SEQUENCE") - * @SequenceGenerator(allocationSize=5,sequenceName="person_id_seq") - */ - public $id; -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SingleTableInheritanceTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SingleTableInheritanceTest.php deleted file mode 100644 index 7271f42..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SingleTableInheritanceTest.php +++ /dev/null @@ -1,370 +0,0 @@ -useModelSet('company'); - parent::setUp(); - } - - public function persistRelatedEmployees() - { - $this->salesPerson = new \Doctrine\Tests\Models\Company\CompanyEmployee(); - $this->salesPerson->setName('Poor Sales Guy'); - $this->salesPerson->setDepartment('Sales'); - $this->salesPerson->setSalary(100); - - $engineer1 = new \Doctrine\Tests\Models\Company\CompanyEmployee(); - $engineer1->setName('Roman B.'); - $engineer1->setDepartment('IT'); - $engineer1->setSalary(100); - $this->engineers[] = $engineer1; - - $engineer2 = new \Doctrine\Tests\Models\Company\CompanyEmployee(); - $engineer2->setName('Jonathan W.'); - $engineer2->setDepartment('IT'); - $engineer2->setSalary(100); - $this->engineers[] = $engineer2; - - $engineer3 = new \Doctrine\Tests\Models\Company\CompanyEmployee(); - $engineer3->setName('Benjamin E.'); - $engineer3->setDepartment('IT'); - $engineer3->setSalary(100); - $this->engineers[] = $engineer3; - - $engineer4 = new \Doctrine\Tests\Models\Company\CompanyEmployee(); - $engineer4->setName('Guilherme B.'); - $engineer4->setDepartment('IT'); - $engineer4->setSalary(100); - $this->engineers[] = $engineer4; - - $this->_em->persist($this->salesPerson); - $this->_em->persist($engineer1); - $this->_em->persist($engineer2); - $this->_em->persist($engineer3); - $this->_em->persist($engineer4); - } - - public function loadFullFixture() - { - $this->persistRelatedEmployees(); - - $this->fix = new \Doctrine\Tests\Models\Company\CompanyFixContract(); - $this->fix->setFixPrice(1000); - $this->fix->setSalesPerson($this->salesPerson); - $this->fix->addEngineer($this->engineers[0]); - $this->fix->addEngineer($this->engineers[1]); - $this->fix->markCompleted(); - - $this->flex = new \Doctrine\Tests\Models\Company\CompanyFlexContract(); - $this->flex->setSalesPerson($this->salesPerson); - $this->flex->setHoursWorked(100); - $this->flex->setPricePerHour(100); - $this->flex->addEngineer($this->engineers[2]); - $this->flex->addEngineer($this->engineers[1]); - $this->flex->addEngineer($this->engineers[3]); - $this->flex->markCompleted(); - - $this->ultra = new \Doctrine\Tests\Models\Company\CompanyFlexUltraContract(); - $this->ultra->setSalesPerson($this->salesPerson); - $this->ultra->setHoursWorked(150); - $this->ultra->setPricePerHour(150); - $this->ultra->setMaxPrice(7000); - $this->ultra->addEngineer($this->engineers[3]); - $this->ultra->addEngineer($this->engineers[0]); - - $this->_em->persist($this->fix); - $this->_em->persist($this->flex); - $this->_em->persist($this->ultra); - $this->_em->flush(); - $this->_em->clear(); - } - - public function testPersistChildOfBaseClass() - { - $this->persistRelatedEmployees(); - - $fixContract = new \Doctrine\Tests\Models\Company\CompanyFixContract(); - $fixContract->setFixPrice(1000); - $fixContract->setSalesPerson($this->salesPerson); - - $this->_em->persist($fixContract); - $this->_em->flush(); - $this->_em->clear(); - - $contract = $this->_em->find('Doctrine\Tests\Models\Company\CompanyFixContract', $fixContract->getId()); - - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyFixContract', $contract); - $this->assertEquals(1000, $contract->getFixPrice()); - $this->assertEquals($this->salesPerson->getId(), $contract->getSalesPerson()->getId()); - } - - public function testPersistDeepChildOfBaseClass() - { - $this->persistRelatedEmployees(); - - $ultraContract = new \Doctrine\Tests\Models\Company\CompanyFlexUltraContract(); - $ultraContract->setSalesPerson($this->salesPerson); - $ultraContract->setHoursWorked(100); - $ultraContract->setPricePerHour(50); - $ultraContract->setMaxPrice(7000); - - $this->_em->persist($ultraContract); - $this->_em->flush(); - $this->_em->clear(); - - $contract = $this->_em->find('Doctrine\Tests\Models\Company\CompanyFlexUltraContract', $ultraContract->getId()); - - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyFlexUltraContract', $contract); - $this->assertEquals(7000, $contract->getMaxPrice()); - $this->assertEquals(100, $contract->getHoursWorked()); - $this->assertEquals(50, $contract->getPricePerHour()); - } - - public function testChildClassLifecycleUpdate() - { - $this->loadFullFixture(); - - $fix = $this->_em->find('Doctrine\Tests\Models\Company\CompanyContract', $this->fix->getId()); - $fix->setFixPrice(2500); - - $this->_em->flush(); - $this->_em->clear(); - - $newFix = $this->_em->find('Doctrine\Tests\Models\Company\CompanyContract', $this->fix->getId()); - $this->assertEquals(2500, $newFix->getFixPrice()); - } - - public function testChildClassLifecycleRemove() - { - $this->loadFullFixture(); - - $fix = $this->_em->find('Doctrine\Tests\Models\Company\CompanyContract', $this->fix->getId()); - $this->_em->remove($fix); - $this->_em->flush(); - - $this->assertNull($this->_em->find('Doctrine\Tests\Models\Company\CompanyContract', $this->fix->getId())); - } - - public function testFindAllForAbstractBaseClass() - { - $this->loadFullFixture(); - $contracts = $this->_em->getRepository('Doctrine\Tests\Models\Company\CompanyContract')->findAll(); - - $this->assertEquals(3, count($contracts)); - $this->assertContainsOnly('Doctrine\Tests\Models\Company\CompanyContract', $contracts); - } - - public function testFindAllForChildClass() - { - $this->loadFullFixture(); - - $this->assertEquals(1, count($this->_em->getRepository('Doctrine\Tests\Models\Company\CompanyFixContract')->findAll())); - $this->assertEquals(2, count($this->_em->getRepository('Doctrine\Tests\Models\Company\CompanyFlexContract')->findAll())); - $this->assertEquals(1, count($this->_em->getRepository('Doctrine\Tests\Models\Company\CompanyFlexUltraContract')->findAll())); - } - - public function testFindForAbstractBaseClass() - { - $this->loadFullFixture(); - - $contract = $this->_em->find('Doctrine\Tests\Models\Company\CompanyContract', $this->fix->getId()); - - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyFixContract', $contract); - $this->assertEquals(1000, $contract->getFixPrice()); - } - - public function testQueryForAbstractBaseClass() - { - $this->loadFullFixture(); - - $contracts = $this->_em->createQuery('SELECT c FROM Doctrine\Tests\Models\Company\CompanyContract c')->getResult(); - - $this->assertEquals(3, count($contracts)); - $this->assertContainsOnly('Doctrine\Tests\Models\Company\CompanyContract', $contracts); - } - - public function testQueryForChildClass() - { - $this->loadFullFixture(); - - $this->assertEquals(1, count($this->_em->createQuery('SELECT c FROM Doctrine\Tests\Models\Company\CompanyFixContract c')->getResult())); - $this->assertEquals(2, count($this->_em->createQuery('SELECT c FROM Doctrine\Tests\Models\Company\CompanyFlexContract c')->getResult())); - $this->assertEquals(1, count($this->_em->createQuery('SELECT c FROM Doctrine\Tests\Models\Company\CompanyFlexUltraContract c')->getResult())); - } - - public function testQueryBaseClassWithJoin() - { - $this->loadFullFixture(); - - $contracts = $this->_em->createQuery('SELECT c, p FROM Doctrine\Tests\Models\Company\CompanyContract c JOIN c.salesPerson p')->getResult(); - $this->assertEquals(3, count($contracts)); - $this->assertContainsOnly('Doctrine\Tests\Models\Company\CompanyContract', $contracts); - } - - public function testQueryScalarWithDiscrimnatorValue() - { - $this->loadFullFixture(); - - $contracts = $this->_em->createQuery('SELECT c FROM Doctrine\Tests\Models\Company\CompanyContract c ORDER BY c.id')->getScalarResult(); - - $discrValues = \array_map(function($a) { - return $a['c_discr']; - }, $contracts); - - sort($discrValues); - - $this->assertEquals(array('fix', 'flexible', 'flexultra'), $discrValues); - } - - public function testQueryChildClassWithCondition() - { - $this->loadFullFixture(); - - $dql = 'SELECT c FROM Doctrine\Tests\Models\Company\CompanyFixContract c WHERE c.fixPrice = ?1'; - $contract = $this->_em->createQuery($dql)->setParameter(1, 1000)->getSingleResult(); - - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyFixContract', $contract); - $this->assertEquals(1000, $contract->getFixPrice()); - } - - public function testUpdateChildClassWithCondition() - { - $this->loadFullFixture(); - - $dql = 'UPDATE Doctrine\Tests\Models\Company\CompanyFlexContract c SET c.hoursWorked = c.hoursWorked * 2 WHERE c.hoursWorked = 150'; - $affected = $this->_em->createQuery($dql)->execute(); - - $this->assertEquals(1, $affected); - - $flexContract = $this->_em->find('Doctrine\Tests\Models\Company\CompanyContract', $this->flex->getId()); - $ultraContract = $this->_em->find('Doctrine\Tests\Models\Company\CompanyContract', $this->ultra->getId()); - - $this->assertEquals(300, $ultraContract->getHoursWorked()); - $this->assertEquals(100, $flexContract->getHoursWorked()); - } - - public function testUpdateBaseClassWithCondition() - { - $this->loadFullFixture(); - - $dql = 'UPDATE Doctrine\Tests\Models\Company\CompanyContract c SET c.completed = true WHERE c.completed = false'; - $affected = $this->_em->createQuery($dql)->execute(); - - $this->assertEquals(1, $affected); - - $dql = 'UPDATE Doctrine\Tests\Models\Company\CompanyContract c SET c.completed = false'; - $affected = $this->_em->createQuery($dql)->execute(); - - $this->assertEquals(3, $affected); - } - - public function testDeleteByChildClassCondition() - { - $this->loadFullFixture(); - - $dql = 'DELETE Doctrine\Tests\Models\Company\CompanyFlexContract c'; - $affected = $this->_em->createQuery($dql)->execute(); - - $this->assertEquals(2, $affected); - } - - public function testDeleteByBaseClassCondition() - { - $this->loadFullFixture(); - - $dql = "DELETE Doctrine\Tests\Models\Company\CompanyContract c WHERE c.completed = true"; - $affected = $this->_em->createQuery($dql)->execute(); - - $this->assertEquals(2, $affected); - - $contracts = $this->_em->createQuery('SELECT c FROM Doctrine\Tests\Models\Company\CompanyContract c')->getResult(); - $this->assertEquals(1, count($contracts)); - - $this->assertFalse($contracts[0]->isCompleted(), "Only non completed contracts should be left."); - } - - /** - * @group DDC-130 - */ - public function testDeleteJoinTableRecords() - { - $this->loadFullFixture(); - - // remove managed copy of the fix contract - $this->_em->remove($this->_em->find(get_class($this->fix), $this->fix->getId())); - $this->_em->flush(); - - $this->assertNull($this->_em->find(get_class($this->fix), $this->fix->getId()), "Contract should not be present in the database anymore."); - } - - /** - * @group DDC-817 - */ - public function testFindByAssociation() - { - $this->loadFullFixture(); - - $repos = $this->_em->getRepository("Doctrine\Tests\Models\Company\CompanyContract"); - $contracts = $repos->findBy(array('salesPerson' => $this->salesPerson->getId())); - $this->assertEquals(3, count($contracts), "There should be 3 entities related to " . $this->salesPerson->getId() . " for 'Doctrine\Tests\Models\Company\CompanyContract'"); - - $repos = $this->_em->getRepository("Doctrine\Tests\Models\Company\CompanyFixContract"); - $contracts = $repos->findBy(array('salesPerson' => $this->salesPerson->getId())); - $this->assertEquals(1, count($contracts), "There should be 1 entities related to " . $this->salesPerson->getId() . " for 'Doctrine\Tests\Models\Company\CompanyFixContract'"); - - $repos = $this->_em->getRepository("Doctrine\Tests\Models\Company\CompanyFlexContract"); - $contracts = $repos->findBy(array('salesPerson' => $this->salesPerson->getId())); - $this->assertEquals(2, count($contracts), "There should be 2 entities related to " . $this->salesPerson->getId() . " for 'Doctrine\Tests\Models\Company\CompanyFlexContract'"); - - $repos = $this->_em->getRepository("Doctrine\Tests\Models\Company\CompanyFlexUltraContract"); - $contracts = $repos->findBy(array('salesPerson' => $this->salesPerson->getId())); - $this->assertEquals(1, count($contracts), "There should be 1 entities related to " . $this->salesPerson->getId() . " for 'Doctrine\Tests\Models\Company\CompanyFlexUltraContract'"); - } - - /** - * @group DDC-834 - */ - public function testGetReferenceEntityWithSubclasses() - { - $this->loadFullFixture(); - - $ref = $this->_em->getReference('Doctrine\Tests\Models\Company\CompanyContract', $this->fix->getId()); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $ref, "Cannot Request a proxy from a class that has subclasses."); - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyContract', $ref); - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyFixContract', $ref, "Direct fetch of the reference has to load the child class Emplyoee directly."); - $this->_em->clear(); - - $ref = $this->_em->getReference('Doctrine\Tests\Models\Company\CompanyFixContract', $this->fix->getId()); - $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $ref, "A proxy can be generated only if no subclasses exists for the requested reference."); - } - - /** - * @group DDC-952 - */ - public function testEagerLoadInheritanceHierachy() - { - $this->loadFullFixture(); - - $dql = 'SELECT f FROM Doctrine\Tests\Models\Company\CompanyFixContract f WHERE f.id = ?1'; - $contract = $this->_em->createQuery($dql) - ->setFetchMode('Doctrine\Tests\Models\Company\CompanyFixContract', 'salesPerson', ClassMetadata::FETCH_EAGER) - ->setParameter(1, $this->fix->getId()) - ->getSingleResult(); - - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $contract->getSalesPerson()); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/StandardEntityPersisterTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/StandardEntityPersisterTest.php deleted file mode 100644 index de103eb..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/StandardEntityPersisterTest.php +++ /dev/null @@ -1,110 +0,0 @@ - - */ -class StandardEntityPersisterTest extends \Doctrine\Tests\OrmFunctionalTestCase -{ - protected function setUp() - { - $this->useModelSet('ecommerce'); - parent::setUp(); - } - - public function testAcceptsForeignKeysAsCriteria() - { - $customer = new ECommerceCustomer(); - $customer->setName('John Doe'); - $cart = new ECommerceCart(); - $cart->setPayment('Credit card'); - $customer->setCart($cart); - $this->_em->persist($customer); - $this->_em->flush(); - $this->_em->clear(); - $cardId = $cart->getId(); - unset($cart); - - $class = $this->_em->getClassMetadata('Doctrine\Tests\Models\ECommerce\ECommerceCart'); - - $persister = $this->_em->getUnitOfWork()->getEntityPersister('Doctrine\Tests\Models\ECommerce\ECommerceCart'); - $newCart = new ECommerceCart(); - $this->_em->getUnitOfWork()->registerManaged($newCart, array('id' => $cardId), array()); - $persister->load(array('customer_id' => $customer->getId()), $newCart, $class->associationMappings['customer']); - $this->assertEquals('Credit card', $newCart->getPayment()); - } - - /** - * Ticket #2478 from Damon Jones (dljones) - */ - public function testAddPersistRetrieve() - { - $f1 = new ECommerceFeature; - $f1->setDescription('AC-3'); - - $f2 = new ECommerceFeature; - $f2->setDescription('DTS'); - - $p = new ECommerceProduct; - $p->addFeature($f1); - $p->addfeature($f2); - $this->_em->persist($p); - - $this->_em->flush(); - - $this->assertEquals(2, count($p->getFeatures())); - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $p->getFeatures()); - - $q = $this->_em->createQuery( - 'SELECT p, f - FROM Doctrine\Tests\Models\ECommerce\ECommerceProduct p - JOIN p.features f' - ); - - $res = $q->getResult(); - - $this->assertEquals(2, count($p->getFeatures())); - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $p->getFeatures()); - - // Check that the features are the same instances still - foreach ($p->getFeatures() as $feature) { - if ($feature->getDescription() == 'AC-3') { - $this->assertTrue($feature === $f1); - } else { - $this->assertTrue($feature === $f2); - } - } - - // Now we test how Hydrator affects IdentityMap - // (change from ArrayCollection to PersistentCollection) - $f3 = new ECommerceFeature(); - $f3->setDescription('XVID'); - $p->addFeature($f3); - - // Now we persist the Feature #3 - $this->_em->persist($p); - $this->_em->flush(); - - $q = $this->_em->createQuery( - 'SELECT p, f - FROM Doctrine\Tests\Models\ECommerce\ECommerceProduct p - JOIN p.features f' - ); - - $res = $q->getResult(); - - // Persisted Product now must have 3 Feature items - $this->assertEquals(3, count($res[0]->getFeatures())); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1040Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1040Test.php deleted file mode 100644 index 93dc0ee..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1040Test.php +++ /dev/null @@ -1,81 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - public function testReuseNamedEntityParameter() - { - $user = new CmsUser(); - $user->name = "John Galt"; - $user->username = "jgalt"; - $user->status = "inactive"; - - $article = new CmsArticle(); - $article->topic = "This is John Galt speaking!"; - $article->text = "Yadda Yadda!"; - $article->setAuthor($user); - - $this->_em->persist($user); - $this->_em->persist($article); - $this->_em->flush(); - - $dql = "SELECT a FROM Doctrine\Tests\Models\CMS\CmsArticle a WHERE a.user = :author"; - $this->_em->createQuery($dql) - ->setParameter('author', $user) - ->getResult(); - - $dql = "SELECT a FROM Doctrine\Tests\Models\CMS\CmsArticle a WHERE a.user = :author AND a.user = :author"; - $this->_em->createQuery($dql) - ->setParameter('author', $user) - ->getResult(); - - $dql = "SELECT a FROM Doctrine\Tests\Models\CMS\CmsArticle a WHERE a.topic = :topic AND a.user = :author AND a.user = :author"; - $farticle = $this->_em->createQuery($dql) - ->setParameter('author', $user) - ->setParameter('topic', 'This is John Galt speaking!') - ->getSingleResult(); - - $this->assertSame($article, $farticle); - } - - public function testUseMultiplePositionalParameters() - { - $user = new CmsUser(); - $user->name = "John Galt"; - $user->username = "jgalt"; - $user->status = "inactive"; - - $article = new CmsArticle(); - $article->topic = "This is John Galt speaking!"; - $article->text = "Yadda Yadda!"; - $article->setAuthor($user); - - $this->_em->persist($user); - $this->_em->persist($article); - $this->_em->flush(); - - $dql = "SELECT a FROM Doctrine\Tests\Models\CMS\CmsArticle a WHERE a.topic = ?1 AND a.user = ?2 AND a.user = ?3"; - $farticle = $this->_em->createQuery($dql) - ->setParameter(1, 'This is John Galt speaking!') - ->setParameter(2, $user) - ->setParameter(3, $user) - ->getSingleResult(); - - $this->assertSame($article, $farticle); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1041Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1041Test.php deleted file mode 100644 index 5b30c04..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1041Test.php +++ /dev/null @@ -1,33 +0,0 @@ -useModelSet('company'); - parent::setUp(); - } - - public function testGrabWrongSubtypeReturnsNull() - { - $fix = new \Doctrine\Tests\Models\Company\CompanyFixContract(); - $fix->setFixPrice(2000); - - $this->_em->persist($fix); - $this->_em->flush(); - - $id = $fix->getId(); - - $this->assertNull($this->_em->find('Doctrine\Tests\Models\Company\CompanyFlexContract', $id)); - $this->assertNull($this->_em->getReference('Doctrine\Tests\Models\Company\CompanyFlexContract', $id)); - $this->assertNull($this->_em->getPartialReference('Doctrine\Tests\Models\Company\CompanyFlexContract', $id)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1043Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1043Test.php deleted file mode 100644 index 31bd835..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1043Test.php +++ /dev/null @@ -1,36 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - public function testChangeSetPlusWeirdPHPCastingIntCastingRule() - { - $user = new \Doctrine\Tests\Models\CMS\CmsUser(); - $user->name = "John Galt"; - $user->username = "jgalt"; - $user->status = "+44"; - - $this->_em->persist($user); - $this->_em->flush(); - - $user->status = "44"; - $this->_em->flush(); - $this->_em->clear(); - - $user = $this->_em->find("Doctrine\Tests\Models\CMS\CmsUser", $user->id); - $this->assertSame("44", $user->status); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1050Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1050Test.php deleted file mode 100644 index 31c0733..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1050Test.php +++ /dev/null @@ -1,37 +0,0 @@ -markTestSkipped('performance skipped'); - $this->useModelSet('cms'); - parent::setUp(); - } - - public function testPerformance() - { - for ($i = 2; $i < 10000; ++$i) { - $user = new \Doctrine\Tests\Models\CMS\CmsUser(); - $user->status = 'developer'; - $user->username = 'jwage'+$i; - $user->name = 'Jonathan'; - $this->_em->persist($user); - } - $this->_em->flush(); - $this->_em->clear(); - - $s = microtime(true); - $users = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser')->findAll(); - $e = microtime(true); - echo __FUNCTION__ . " - " . ($e - $s) . " seconds" . PHP_EOL; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1080Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1080Test.php deleted file mode 100644 index 2b9d579..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1080Test.php +++ /dev/null @@ -1,317 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1080Foo'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1080Bar'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1080FooBar'), - )); - - $foo1 = new DDC1080Foo(); - $foo1->setFooTitle('foo title 1'); - $foo2 = new DDC1080Foo(); - $foo2->setFooTitle('foo title 2'); - - $bar1 = new DDC1080Bar(); - $bar1->setBarTitle('bar title 1'); - $bar2 = new DDC1080Bar(); - $bar2->setBarTitle('bar title 2'); - $bar3 = new DDC1080Bar(); - $bar3->setBarTitle('bar title 3'); - - $foobar1 = new DDC1080FooBar(); - $foobar1->setFoo($foo1); - $foobar1->setBar($bar1); - $foobar1->setOrderNr(0); - - $foobar2 = new DDC1080FooBar(); - $foobar2->setFoo($foo1); - $foobar2->setBar($bar2); - $foobar2->setOrderNr(0); - - $foobar3 = new DDC1080FooBar(); - $foobar3->setFoo($foo1); - $foobar3->setBar($bar3); - $foobar3->setOrderNr(0); - - $this->_em->persist($foo1); - $this->_em->persist($foo2); - $this->_em->persist($bar1); - $this->_em->persist($bar2); - $this->_em->persist($bar3); - $this->_em->flush(); - - $this->_em->persist($foobar1); - $this->_em->persist($foobar2); - $this->_em->persist($foobar3); - $this->_em->flush(); - $this->_em->clear(); - - $foo = $this->_em->find('Doctrine\Tests\ORM\Functional\Ticket\DDC1080Foo', $foo1->getFooId()); - $fooBars = $foo->getFooBars(); - - $this->assertEquals(3, count($fooBars), "Should return three foobars."); - } -} - - -/** - * @Entity - * @Table(name="foo") - */ -class DDC1080Foo -{ - - /** - * @Id - * @Column(name="fooID", type="integer") - * @GeneratedValue(strategy="AUTO") - */ - protected $_fooID; - /** - * @Column(name="fooTitle", type="string") - */ - protected $_fooTitle; - /** - * @OneToMany(targetEntity="DDC1080FooBar", mappedBy="_foo", - * cascade={"persist"}) - * @OrderBy({"_orderNr"="ASC"}) - */ - protected $_fooBars; - - public function __construct() - { - $this->_fooBars = new \Doctrine\Common\Collections\ArrayCollection(); - } - - /** - * @return the $fooID - */ - public function getFooID() - { - return $this->_fooID; - } - - /** - * @return the $fooTitle - */ - public function getFooTitle() - { - return $this->_fooTitle; - } - - /** - * @return the $fooBars - */ - public function getFooBars() - { - return $this->_fooBars; - } - - /** - * @param field_type $fooID - */ - public function setFooID($fooID) - { - $this->_fooID = $fooID; - } - - /** - * @param field_type $fooTitle - */ - public function setFooTitle($fooTitle) - { - $this->_fooTitle = $fooTitle; - } - - /** - * @param field_type $fooBars - */ - public function setFooBars($fooBars) - { - $this->_fooBars = $fooBars; - } - -} -/** - * @Entity - * @Table(name="bar") - */ -class DDC1080Bar -{ - - /** - * @Id - * @Column(name="barID", type="integer") - * @GeneratedValue(strategy="AUTO") - */ - protected $_barID; - /** - * @Column(name="barTitle", type="string") - */ - protected $_barTitle; - /** - * @OneToMany(targetEntity="DDC1080FooBar", mappedBy="_bar", - * cascade={"persist"}) - * @OrderBy({"_orderNr"="ASC"}) - */ - protected $_fooBars; - - public function __construct() - { - $this->_fooBars = new \Doctrine\Common\Collections\ArrayCollection(); - } - - /** - * @return the $barID - */ - public function getBarID() - { - return $this->_barID; - } - - /** - * @return the $barTitle - */ - public function getBarTitle() - { - return $this->_barTitle; - } - - /** - * @return the $fooBars - */ - public function getFooBars() - { - return $this->_fooBars; - } - - /** - * @param field_type $barID - */ - public function setBarID($barID) - { - $this->_barID = $barID; - } - - /** - * @param field_type $barTitle - */ - public function setBarTitle($barTitle) - { - $this->_barTitle = $barTitle; - } - - /** - * @param field_type $fooBars - */ - public function setFooBars($fooBars) - { - $this->_fooBars = $fooBars; - } - -} - -/** - * @Table(name="fooBar") - * @Entity - */ -class DDC1080FooBar -{ - - /** - * @ManyToOne(targetEntity="DDC1080Foo") - * @JoinColumn(name="fooID", referencedColumnName="fooID") - * @Id - */ - protected $_foo = null; - /** - * @ManyToOne(targetEntity="DDC1080Bar") - * @JoinColumn(name="barID", referencedColumnName="barID") - * @Id - */ - protected $_bar = null; - /** - * @var integer orderNr - * @Column(name="orderNr", type="integer", nullable=false) - */ - protected $_orderNr = null; - - /** - * Retrieve the foo property - * - * @return DDC1080Foo - */ - public function getFoo() - { - return $this->_foo; - } - - /** - * Set the foo property - * - * @param DDC1080Foo $foo - * @return DDC1080FooBar - */ - public function setFoo($foo) - { - $this->_foo = $foo; - return $this; - } - - /** - * Retrieve the bar property - * - * @return DDC1080Bar - */ - public function getBar() - { - return $this->_bar; - } - - /** - * Set the bar property - * - * @param DDC1080Bar $bar - * @return DDC1080FooBar - */ - public function setBar($bar) - { - $this->_bar = $bar; - return $this; - } - - /** - * Retrieve the orderNr property - * - * @return integer|null - */ - public function getOrderNr() - { - return $this->_orderNr; - } - - /** - * Set the orderNr property - * - * @param integer|null $orderNr - * @return DDC1080FooBar - */ - public function setOrderNr($orderNr) - { - $this->_orderNr = $orderNr; - return $this; - } - -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1113Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1113Test.php deleted file mode 100644 index 3e8a2fc..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1113Test.php +++ /dev/null @@ -1,99 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1113Engine'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1113Vehicle'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1113Car'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1113Bus'), - )); - } catch (\Exception $e) { - - } - } - - public function testIssue() - { - $car = new DDC1113Car(); - $car->engine = new DDC1113Engine(); - - $bus = new DDC1113Bus(); - $bus->engine = new DDC1113Engine(); - - $this->_em->persist($car); - $this->_em->flush(); - - $this->_em->persist($bus); - $this->_em->flush(); - - $this->_em->remove($bus); - $this->_em->remove($car); - $this->_em->flush(); - } - -} - -/** - * @Entity - * @InheritanceType("SINGLE_TABLE") - * @DiscriminatorMap({"car" = "DDC1113Car", "bus" = "DDC1113Bus"}) - */ -class DDC1113Vehicle -{ - - /** @Id @GeneratedValue @Column(type="integer") */ - public $id; - - /** - * @ManyToOne(targetEntity="DDC1113Vehicle") - */ - public $parent; - - /** @OneToOne(targetEntity="DDC1113Engine", cascade={"persist", "remove"}) */ - public $engine; - -} - -/** - * @Entity - */ -class DDC1113Car extends DDC1113Vehicle -{ - -} - -/** - * @Entity - */ -class DDC1113Bus extends DDC1113Vehicle -{ - -} - -/** - * @Entity - */ -class DDC1113Engine -{ - - /** @Id @GeneratedValue @Column(type="integer") */ - public $id; - -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1129Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1129Test.php deleted file mode 100644 index c481aa3..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1129Test.php +++ /dev/null @@ -1,46 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - public function testVersionFieldIgnoredInChangesetComputation() - { - $article = new \Doctrine\Tests\Models\CMS\CmsArticle(); - $article->text = "I don't know."; - $article->topic = "Who is John Galt?"; - - $this->_em->persist($article); - $this->_em->flush(); - - $this->assertEquals(1, $article->version); - - $class = $this->_em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsArticle'); - $uow = $this->_em->getUnitOfWork(); - - $uow->computeChangeSet($class, $article); - $changeSet = $uow->getEntityChangeSet($article); - $this->assertEquals(0, count($changeSet), "No changesets should be computed."); - - $article->text = "This is John Galt speaking."; - $this->_em->flush(); - - $this->assertEquals(2, $article->version); - - $uow->computeChangeSet($class, $article); - $changeSet = $uow->getEntityChangeSet($article); - $this->assertEquals(0, count($changeSet), "No changesets should be computed."); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1151Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1151Test.php deleted file mode 100644 index 51a2d45..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1151Test.php +++ /dev/null @@ -1,56 +0,0 @@ -_em->getConnection()->getDatabasePlatform()->getName() != 'postgresql') { - $this->markTestSkipped("This test is useful for all databases, but designed only for postgresql."); - } - - $sql = $this->_schemaTool->getCreateSchemaSql(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1151User'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1151Group'), - )); - - $this->assertEquals("CREATE TABLE \"User\" (id INT NOT NULL, PRIMARY KEY(id))", $sql[0]); - $this->assertEquals("CREATE TABLE ddc1151user_ddc1151group (ddc1151user_id INT NOT NULL, ddc1151group_id INT NOT NULL, PRIMARY KEY(ddc1151user_id, ddc1151group_id))", $sql[1]); - $this->assertEquals("CREATE INDEX IDX_88A3259AC5AD08A ON ddc1151user_ddc1151group (ddc1151user_id)", $sql[2]); - $this->assertEquals("CREATE INDEX IDX_88A32597357E0B1 ON ddc1151user_ddc1151group (ddc1151group_id)", $sql[3]); - $this->assertEquals("CREATE TABLE \"Group\" (id INT NOT NULL, PRIMARY KEY(id))", $sql[4]); - $this->assertEquals("CREATE SEQUENCE User_id_seq INCREMENT BY 1 MINVALUE 1 START 1", $sql[5]); - $this->assertEquals("CREATE SEQUENCE Group_id_seq INCREMENT BY 1 MINVALUE 1 START 1", $sql[6]); - $this->assertEquals("ALTER TABLE ddc1151user_ddc1151group ADD CONSTRAINT FK_88A3259AC5AD08A FOREIGN KEY (ddc1151user_id) REFERENCES \"User\" (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE", $sql[7]); - $this->assertEquals("ALTER TABLE ddc1151user_ddc1151group ADD CONSTRAINT FK_88A32597357E0B1 FOREIGN KEY (ddc1151group_id) REFERENCES \"Group\" (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE", $sql[8]); - } -} - -/** - * @Entity - * @Table(name="`User`") - */ -class DDC1151User -{ - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; - - /** @ManyToMany(targetEntity="DDC1151Group") */ - public $groups; -} - -/** - * @Entity - * @Table(name="`Group`") - */ -class DDC1151Group -{ - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1163Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1163Test.php deleted file mode 100644 index 1e8cae6..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1163Test.php +++ /dev/null @@ -1,215 +0,0 @@ -_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - $this->_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1163Product'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1163SpecialProduct'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1163ProxyHolder'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1163Tag'), - )); - } - - public function testIssue() - { - $this->createSpecialProductAndProxyHolderReferencingIt(); - $this->_em->clear(); - - $this->createProxyForSpecialProduct(); - - $this->setPropertyAndAssignTagToSpecialProduct(); - - // fails - $this->_em->flush(); - } - - private function createSpecialProductAndProxyHolderReferencingIt() - { - $specialProduct = new DDC1163SpecialProduct(); - $this->_em->persist($specialProduct); - - $proxyHolder = new DDC1163ProxyHolder(); - $this->_em->persist($proxyHolder); - - $proxyHolder->setSpecialProduct($specialProduct); - - $this->_em->flush(); - - $this->productId = $specialProduct->getId(); - $this->proxyHolderId = $proxyHolder->getId(); - } - - /** - * We want Doctrine to instantiate a lazy-load proxy for the previously created - * 'SpecialProduct' and register it. - * - * When Doctrine loads the 'ProxyHolder', it will do just that because the 'ProxyHolder' - * references the 'SpecialProduct'. - */ - private function createProxyForSpecialProduct() - { - /* @var $proxyHolder ProxyHolder */ - $proxyHolder = $this->_em->find(__NAMESPACE__ . '\\DDC1163ProxyHolder', $this->proxyHolderId); - - $this->assertInstanceOf(__NAMESPACE__.'\\DDC1163SpecialProduct', $proxyHolder->getSpecialProduct()); - } - - private function setPropertyAndAssignTagToSpecialProduct() - { - /* @var $specialProduct SpecialProduct */ - $specialProduct = $this->_em->find(__NAMESPACE__ . '\\DDC1163SpecialProduct', $this->productId); - - $this->assertInstanceOf(__NAMESPACE__.'\\DDC1163SpecialProduct', $specialProduct); - $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $specialProduct); - - $specialProduct->setSubclassProperty('foobar'); - - // this screams violation of law of demeter ;) - $this->assertEquals( - __NAMESPACE__.'\\DDC1163SpecialProduct', - $this->_em->getUnitOfWork()->getEntityPersister(get_class($specialProduct))->getClassMetadata()->name - ); - - $tag = new DDC1163Tag('Foo'); - $this->_em->persist($tag); - $tag->setProduct($specialProduct); - } -} - -/** - * @Entity - */ -class DDC1163ProxyHolder -{ - - /** - * @var int - * @Column(name="id", type="integer") - * @Id - * @GeneratedValue(strategy="AUTO") - */ - private $id; - /** - * @var SpecialProduct - * @OneToOne(targetEntity="DDC1163SpecialProduct") - */ - private $specialProduct; - - public function getId() - { - return $this->id; - } - - public function setSpecialProduct(DDC1163SpecialProduct $specialProduct) - { - $this->specialProduct = $specialProduct; - } - - public function getSpecialProduct() - { - return $this->specialProduct; - } - -} - -/** - * @Entity - * @InheritanceType("JOINED") - * @DiscriminatorColumn(name="type", type="string") - * @DiscriminatorMap({"special" = "DDC1163SpecialProduct"}) - */ -abstract class DDC1163Product -{ - - /** - * @var int - * @Column(name="id", type="integer") - * @Id - * @GeneratedValue(strategy="AUTO") - */ - protected $id; - - public function getId() - { - return $this->id; - } - -} - -/** - * @Entity - */ -class DDC1163SpecialProduct extends DDC1163Product -{ - - /** - * @var string - * @Column(name="subclass_property", type="string", nullable=true) - */ - private $subclassProperty; - - /** - * @param string $value - */ - public function setSubclassProperty($value) - { - $this->subclassProperty = $value; - } - -} - -/** - * @Entity - */ -class DDC1163Tag -{ - - /** - * @var int - * @Column(name="id", type="integer") - * @Id - * @GeneratedValue(strategy="AUTO") - */ - private $id; - /** - * @var string - * @Column(name="name", type="string") - */ - private $name; - /** - * @var Product - * @ManyToOne(targetEntity="DDC1163Product", inversedBy="tags") - * @JoinColumns({ - * @JoinColumn(name="product_id", referencedColumnName="id") - * }) - */ - private $product; - - /** - * @param string $name - */ - public function __construct($name) - { - $this->name = $name; - } - - /** - * @param Product $product - */ - public function setProduct(DDC1163Product $product) - { - $this->product = $product; - } - -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC117Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC117Test.php deleted file mode 100644 index 6ae4595..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC117Test.php +++ /dev/null @@ -1,464 +0,0 @@ -useModelSet('ddc117'); - parent::setUp(); - - $this->article1 = new DDC117Article("Foo"); - $this->article2 = new DDC117Article("Bar"); - - $this->_em->persist($this->article1); - $this->_em->persist($this->article2); - $this->_em->flush(); - - $this->reference = new DDC117Reference($this->article1, $this->article2, "Test-Description"); - $this->_em->persist($this->reference); - - $this->translation = new DDC117Translation($this->article1, "en", "Bar"); - $this->_em->persist($this->translation); - - $this->articleDetails = new DDC117ArticleDetails($this->article1, "Very long text"); - $this->_em->persist($this->articleDetails); - $this->_em->flush(); - - $this->_em->clear(); - } - - /** - * @group DDC-117 - */ - public function testAssociationOnlyCompositeKey() - { - $idCriteria = array('source' => $this->article1->id(), 'target' => $this->article2->id()); - - $mapRef = $this->_em->find("Doctrine\Tests\Models\DDC117\DDC117Reference", $idCriteria); - $this->assertInstanceOf("Doctrine\Tests\Models\DDC117\DDC117Reference", $mapRef); - $this->assertInstanceOf("Doctrine\Tests\Models\DDC117\DDC117Article", $mapRef->target()); - $this->assertInstanceOf("Doctrine\Tests\Models\DDC117\DDC117Article", $mapRef->source()); - $this->assertSame($mapRef, $this->_em->find("Doctrine\Tests\Models\DDC117\DDC117Reference", $idCriteria)); - - $this->_em->clear(); - - $dql = "SELECT r, s FROM "."Doctrine\Tests\Models\DDC117\DDC117Reference r JOIN r.source s WHERE r.source = ?1"; - $dqlRef = $this->_em->createQuery($dql)->setParameter(1, 1)->getSingleResult(); - - $this->assertInstanceOf("Doctrine\Tests\Models\DDC117\DDC117Reference", $mapRef); - $this->assertInstanceOf("Doctrine\Tests\Models\DDC117\DDC117Article", $mapRef->target()); - $this->assertInstanceOf("Doctrine\Tests\Models\DDC117\DDC117Article", $mapRef->source()); - $this->assertSame($dqlRef, $this->_em->find("Doctrine\Tests\Models\DDC117\DDC117Reference", $idCriteria)); - - $this->_em->clear(); - - $dql = "SELECT r, s FROM "."Doctrine\Tests\Models\DDC117\DDC117Reference r JOIN r.source s WHERE s.title = ?1"; - $dqlRef = $this->_em->createQuery($dql)->setParameter(1, 'Foo')->getSingleResult(); - - $this->assertInstanceOf("Doctrine\Tests\Models\DDC117\DDC117Reference", $dqlRef); - $this->assertInstanceOf("Doctrine\Tests\Models\DDC117\DDC117Article", $dqlRef->target()); - $this->assertInstanceOf("Doctrine\Tests\Models\DDC117\DDC117Article", $dqlRef->source()); - $this->assertSame($dqlRef, $this->_em->find("Doctrine\Tests\Models\DDC117\DDC117Reference", $idCriteria)); - - $dql = "SELECT r, s FROM "."Doctrine\Tests\Models\DDC117\DDC117Reference r JOIN r.source s WHERE s.title = ?1"; - $dqlRef = $this->_em->createQuery($dql)->setParameter(1, 'Foo')->getSingleResult(); - - $this->_em->contains($dqlRef); - } - - /** - * @group DDC-117 - */ - public function testUpdateAssocationEntity() - { - $idCriteria = array('source' => $this->article1->id(), 'target' => $this->article2->id()); - - $mapRef = $this->_em->find("Doctrine\Tests\Models\DDC117\DDC117Reference", $idCriteria); - $this->assertNotNull($mapRef); - $mapRef->setDescription("New Description!!"); - $this->_em->flush(); - $this->_em->clear(); - - $mapRef = $this->_em->find("Doctrine\Tests\Models\DDC117\DDC117Reference", $idCriteria); - - $this->assertEquals('New Description!!', $mapRef->getDescription()); - } - - /** - * @group DDC-117 - */ - public function testFetchDql() - { - $dql = "SELECT r, s FROM "."Doctrine\Tests\Models\DDC117\DDC117Reference r JOIN r.source s WHERE s.title = ?1"; - $refs = $this->_em->createQuery($dql)->setParameter(1, 'Foo')->getResult(); - - $this->assertTrue(count($refs) > 0, "Has to contain at least one Reference."); - - foreach ($refs AS $ref) { - $this->assertInstanceOf("Doctrine\Tests\Models\DDC117\DDC117Reference", $ref, "Contains only Reference instances."); - $this->assertTrue($this->_em->contains($ref), "Contains Reference in the IdentityMap."); - } - } - - /** - * @group DDC-117 - */ - public function testRemoveCompositeElement() - { - $idCriteria = array('source' => $this->article1->id(), 'target' => $this->article2->id()); - - $refRep = $this->_em->find("Doctrine\Tests\Models\DDC117\DDC117Reference", $idCriteria); - - $this->_em->remove($refRep); - $this->_em->flush(); - $this->_em->clear(); - - $this->assertNull($this->_em->find("Doctrine\Tests\Models\DDC117\DDC117Reference", $idCriteria)); - } - - /** - * @group DDC-117 - */ - public function testDqlRemoveCompositeElement() - { - $idCriteria = array('source' => $this->article1->id(), 'target' => $this->article2->id()); - - $dql = "DELETE "."Doctrine\Tests\Models\DDC117\DDC117Reference r WHERE r.source = ?1 AND r.target = ?2"; - $this->_em->createQuery($dql) - ->setParameter(1, $this->article1->id()) - ->setParameter(2, $this->article2->id()) - ->execute(); - - $this->assertNull($this->_em->find("Doctrine\Tests\Models\DDC117\DDC117Reference", $idCriteria)); - } - - /** - * @group DDC-117 - */ - public function testInverseSideAccess() - { - $this->article1 = $this->_em->find("Doctrine\Tests\Models\DDC117\DDC117Article", $this->article1->id()); - - $this->assertEquals(1, count($this->article1->references())); - - foreach ($this->article1->references() AS $this->reference) { - $this->assertInstanceOf("Doctrine\Tests\Models\DDC117\DDC117Reference", $this->reference); - $this->assertSame($this->article1, $this->reference->source()); - } - - $this->_em->clear(); - - $dql = 'SELECT a, r FROM '. 'Doctrine\Tests\Models\DDC117\DDC117Article a INNER JOIN a.references r WHERE a.id = ?1'; - $articleDql = $this->_em->createQuery($dql) - ->setParameter(1, $this->article1->id()) - ->getSingleResult(); - - $this->assertEquals(1, count($this->article1->references())); - - foreach ($this->article1->references() AS $this->reference) { - $this->assertInstanceOf("Doctrine\Tests\Models\DDC117\DDC117Reference", $this->reference); - $this->assertSame($this->article1, $this->reference->source()); - } - } - - /** - * @group DDC-117 - */ - public function testMixedCompositeKey() - { - $idCriteria = array('article' => $this->article1->id(), 'language' => 'en'); - - $this->translation = $this->_em->find('Doctrine\Tests\Models\DDC117\DDC117Translation', $idCriteria); - $this->assertInstanceOf('Doctrine\Tests\Models\DDC117\DDC117Translation', $this->translation); - - $this->assertSame($this->translation, $this->_em->find('Doctrine\Tests\Models\DDC117\DDC117Translation', $idCriteria)); - - $this->_em->clear(); - - $dql = 'SELECT t, a FROM ' . 'Doctrine\Tests\Models\DDC117\DDC117Translation t JOIN t.article a WHERE t.article = ?1 AND t.language = ?2'; - $dqlTrans = $this->_em->createQuery($dql) - ->setParameter(1, $this->article1->id()) - ->setParameter(2, 'en') - ->getSingleResult(); - - $this->assertInstanceOf('Doctrine\Tests\Models\DDC117\DDC117Translation', $this->translation); - } - - /** - * @group DDC-117 - */ - public function testMixedCompositeKeyViolateUniqueness() - { - $this->article1 = $this->_em->find('Doctrine\Tests\Models\DDC117\DDC117Article', $this->article1->id()); - $this->article1->addTranslation('en', 'Bar'); - $this->article1->addTranslation('en', 'Baz'); - - $exceptionThrown = false; - try { - // exception depending on the underyling Database Driver - $this->_em->flush(); - } catch(\Exception $e) { - $exceptionThrown = true; - } - - $this->assertTrue($exceptionThrown, "The underlying database driver throws an exception."); - } - - /** - * @group DDC-117 - */ - public function testOneToOneForeignObjectId() - { - $this->article1 = new DDC117Article("Foo"); - $this->_em->persist($this->article1); - $this->_em->flush(); - - $this->articleDetails = new DDC117ArticleDetails($this->article1, "Very long text"); - $this->_em->persist($this->articleDetails); - $this->_em->flush(); - - $this->articleDetails->update("not so very long text!"); - $this->_em->flush(); - $this->_em->clear(); - - /* @var $article DDC117Article */ - $article = $this->_em->find(get_class($this->article1), $this->article1->id()); - $this->assertEquals('not so very long text!', $article->getText()); - } - - /** - * @group DDC-117 - */ - public function testOneToOneCascadeRemove() - { - $article = $this->_em->find(get_class($this->article1), $this->article1->id()); - $this->_em->remove($article); - $this->_em->flush(); - - $this->assertFalse($this->_em->contains($article->getDetails())); - } - - /** - * @group DDC-117 - */ - public function testOneToOneCascadePersist() - { - if (!$this->_em->getConnection()->getDatabasePlatform()->prefersSequences()) { - $this->markTestSkipped('Test only works with databases that prefer sequences as ID strategy.'); - } - - $this->article1 = new DDC117Article("Foo"); - - $this->articleDetails = new DDC117ArticleDetails($this->article1, "Very long text"); - - $this->_em->persist($this->article1); - $this->_em->flush(); - } - - /** - * @group DDC-117 - */ - public function testReferencesToForeignKeyEntities() - { - $idCriteria = array('source' => $this->article1->id(), 'target' => $this->article2->id()); - $reference = $this->_em->find("Doctrine\Tests\Models\DDC117\DDC117Reference", $idCriteria); - - $idCriteria = array('article' => $this->article1->id(), 'language' => 'en'); - $translation = $this->_em->find('Doctrine\Tests\Models\DDC117\DDC117Translation', $idCriteria); - - $approveChanges = new DDC117ApproveChanges($reference->source()->getDetails(), $reference, $translation); - $this->_em->persist($approveChanges); - $this->_em->flush(); - $this->_em->clear(); - - $approveChanges = $this->_em->find("Doctrine\Tests\Models\DDC117\DDC117ApproveChanges", $approveChanges->getId()); - - $this->assertInstanceOf('Doctrine\Tests\Models\DDC117\DDC117ArticleDetails', $approveChanges->getArticleDetails()); - $this->assertInstanceOf('Doctrine\Tests\Models\DDC117\DDC117Reference', $approveChanges->getReference()); - $this->assertInstanceOf('Doctrine\Tests\Models\DDC117\DDC117Translation', $approveChanges->getTranslation()); - } - - /** - * @group DDC-117 - */ - public function testLoadOneToManyCollectionOfForeignKeyEntities() - { - /* @var $article DDC117Article */ - $article = $this->_em->find(get_class($this->article1), $this->article1->id()); - - $translations = $article->getTranslations(); - $this->assertFalse($translations->isInitialized()); - $this->assertContainsOnly('Doctrine\Tests\Models\DDC117\DDC117Translation', $translations); - $this->assertTrue($translations->isInitialized()); - } - - /** - * @group DDC-117 - */ - public function testLoadManyToManyCollectionOfForeignKeyEntities() - { - $editor = $this->loadEditorFixture(); - - $this->assertFalse($editor->reviewingTranslations->isInitialized()); - $this->assertContainsOnly("Doctrine\Tests\Models\DDC117\DDC117Translation", $editor->reviewingTranslations); - $this->assertTrue($editor->reviewingTranslations->isInitialized()); - - $this->_em->clear(); - - $dql = "SELECT e, t FROM Doctrine\Tests\Models\DDC117\DDC117Editor e JOIN e.reviewingTranslations t WHERE e.id = ?1"; - $editor = $this->_em->createQuery($dql)->setParameter(1, $editor->id)->getSingleResult(); - $this->assertTrue($editor->reviewingTranslations->isInitialized()); - $this->assertContainsOnly("Doctrine\Tests\Models\DDC117\DDC117Translation", $editor->reviewingTranslations); - } - - /** - * @group DDC-117 - */ - public function testClearManyToManyCollectionOfForeignKeyEntities() - { - $editor = $this->loadEditorFixture(); - $this->assertEquals(3, count($editor->reviewingTranslations)); - - $editor->reviewingTranslations->clear(); - $this->_em->flush(); - $this->_em->clear(); - - $editor = $this->_em->find(get_class($editor), $editor->id); - $this->assertEquals(0, count($editor->reviewingTranslations)); - } - - /** - * @group DDC-117 - */ - public function testLoadInverseManyToManyCollection() - { - $editor = $this->loadEditorFixture(); - - $this->assertInstanceOf('Doctrine\Tests\Models\DDC117\DDC117Translation', $editor->reviewingTranslations[0]); - - $reviewedBy = $editor->reviewingTranslations[0]->getReviewedByEditors(); - $this->assertEquals(1, count($reviewedBy)); - $this->assertSame($editor, $reviewedBy[0]); - - $this->_em->clear(); - - $dql = "SELECT t, e FROM Doctrine\Tests\Models\DDC117\DDC117Translation t ". - "JOIN t.reviewedByEditors e WHERE t.article = ?1 AND t.language = ?2"; - $trans = $this->_em->createQuery($dql) - ->setParameter(1, $this->translation->getArticleId()) - ->setParameter(2, $this->translation->getLanguage()) - ->getSingleResult(); - - $this->assertInstanceOf('Doctrine\Tests\Models\DDC117\DDC117Translation', $trans); - $this->assertContainsOnly('Doctrine\Tests\Models\DDC117\DDC117Editor', $trans->reviewedByEditors); - $this->assertEquals(1, count($trans->reviewedByEditors)); - } - - /** - * @group DDC-117 - */ - public function testLoadOneToManyOfSourceEntityWithAssociationIdentifier() - { - $editor = $this->loadEditorFixture(); - - $editor->addLastTranslation($editor->reviewingTranslations[0]); - $this->_em->flush(); - $this->_em->clear(); - - $editor = $this->_em->find(get_class($editor), $editor->id); - $lastTranslatedBy = $editor->reviewingTranslations[0]->getLastTranslatedBy(); - $lastTranslatedBy->count(); - - $this->assertEquals(1, count($lastTranslatedBy)); - } - - /** - * @return DDC117Editor - */ - private function loadEditorFixture() - { - $editor = new DDC117Editor("beberlei"); - - /* @var $article1 DDC117Article */ - $article1 = $this->_em->find(get_class($this->article1), $this->article1->id()); - foreach ($article1->getTranslations() AS $translation) { - $editor->reviewingTranslations[] = $translation; - } - - /* @var $article2 DDC117Article */ - $article2 = $this->_em->find(get_class($this->article2), $this->article2->id()); - $article2->addTranslation("de", "Vanille-Krapferl"); // omnomnom - $article2->addTranslation("fr", "Sorry can't speak french!"); - - foreach ($article2->getTranslations() AS $translation) { - $this->_em->persist($translation); // otherwise persisting the editor won't work, reachability! - $editor->reviewingTranslations[] = $translation; - } - - $this->_em->persist($editor); - $this->_em->flush(); - $this->_em->clear(); - - return $this->_em->find(get_class($editor), $editor->id); - } - - /** - * @group DDC-1519 - */ - public function testMergeForeignKeyIdentifierEntity() - { - $idCriteria = array('source' => $this->article1->id(), 'target' => $this->article2->id()); - - $refRep = $this->_em->find("Doctrine\Tests\Models\DDC117\DDC117Reference", $idCriteria); - - $this->_em->detach($refRep); - $refRep = $this->_em->merge($refRep); - - $this->assertEquals($this->article1->id(), $refRep->source()->id()); - $this->assertEquals($this->article2->id(), $refRep->target()->id()); - } - - /** - * @group DDC-1652 - */ - public function testArrayHydrationWithCompositeKey() - { - $dql = "SELECT r,s,t FROM Doctrine\Tests\Models\DDC117\DDC117Reference r INNER JOIN r.source s INNER JOIN r.target t"; - $before = count($this->_em->createQuery($dql)->getResult()); - - $this->article1 = $this->_em->find("Doctrine\Tests\Models\DDC117\DDC117Article", $this->article1->id()); - $this->article2 = $this->_em->find("Doctrine\Tests\Models\DDC117\DDC117Article", $this->article2->id()); - - $this->reference = new DDC117Reference($this->article2, $this->article1, "Test-Description"); - $this->_em->persist($this->reference); - - $this->reference = new DDC117Reference($this->article1, $this->article1, "Test-Description"); - $this->_em->persist($this->reference); - - $this->reference = new DDC117Reference($this->article2, $this->article2, "Test-Description"); - $this->_em->persist($this->reference); - - $this->_em->flush(); - - $dql = "SELECT r,s,t FROM Doctrine\Tests\Models\DDC117\DDC117Reference r INNER JOIN r.source s INNER JOIN r.target t"; - $data = $this->_em->createQuery($dql)->getArrayResult(); - - $this->assertEquals($before + 3, count($data)); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1181Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1181Test.php deleted file mode 100644 index 32856ac..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1181Test.php +++ /dev/null @@ -1,101 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1181Hotel'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1181Booking'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1181Room'), - )); - } - - /** - * @group DDC-1181 - */ - public function testIssue() - { - $hotel = new DDC1181Hotel(); - $room1 = new DDC1181Room(); - $room2 = new DDC1181Room(); - - $this->_em->persist($hotel); - $this->_em->persist($room1); - $this->_em->persist($room2); - $this->_em->flush(); - - $booking1 = new DDC1181Booking; - $booking1->hotel = $hotel; - $booking1->room = $room1; - $booking2 = new DDC1181Booking; - $booking2->hotel = $hotel; - $booking2->room = $room2; - $hotel->bookings[] = $booking1; - $hotel->bookings[] = $booking2; - - $this->_em->persist($booking1); - $this->_em->persist($booking2); - $this->_em->flush(); - - $this->_em->remove($hotel); - $this->_em->flush(); - } -} - -/** - * @Entity - */ -class DDC1181Hotel -{ - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; - - /** - * @oneToMany(targetEntity="DDC1181Booking", mappedBy="hotel", cascade={"remove"}) - * @var Booking[] - */ - public $bookings; - -} - -/** - * @Entity - */ -class DDC1181Booking -{ - /** - * @var Hotel - * - * @Id - * @ManyToOne(targetEntity="DDC1181Hotel", inversedBy="bookings") - * @JoinColumns({ - * @JoinColumn(name="hotel_id", referencedColumnName="id") - * }) - */ - public $hotel; - /** - * @var Room - * - * @Id - * @ManyToOne(targetEntity="DDC1181Room") - * @JoinColumns({ - * @JoinColumn(name="room_id", referencedColumnName="id") - * }) - */ - public $room; -} - -/** - * @Entity - */ -class DDC1181Room -{ - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1193Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1193Test.php deleted file mode 100644 index 6465fa6..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1193Test.php +++ /dev/null @@ -1,93 +0,0 @@ -_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - $this->_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1193Company'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1193Person'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1193Account') - )); - } - - /** - * @group DDC-1193 - */ - public function testIssue() - { - $company = new DDC1193Company(); - $person = new DDC1193Person(); - $account = new DDC1193Account(); - - $person->account = $account; - $person->company = $company; - - $company->member = $person; - - $this->_em->persist($company); - - $this->_em->flush(); - - $companyId = $company->id; - $accountId = $account->id; - $this->_em->clear(); - - $company = $this->_em->find(get_class($company), $companyId); - - $this->assertTrue($this->_em->getUnitOfWork()->isInIdentityMap($company), "Company is in identity map."); - $this->assertFalse($company->member->__isInitialized__, "Pre-Condition"); - $this->assertTrue($this->_em->getUnitOfWork()->isInIdentityMap($company->member), "Member is in identity map."); - - $this->_em->remove($company); - $this->_em->flush(); - - $this->assertEquals(count($this->_em->getRepository(get_class($account))->findAll()), 0); - } -} - -/** @Entity */ -class DDC1193Company { - /** - * @Id @Column(type="integer") - * @GeneratedValue - */ - public $id; - - /** @OneToOne(targetEntity="DDC1193Person", cascade={"persist", "remove"}) */ - public $member; - -} - -/** @Entity */ -class DDC1193Person { - /** - * @Id @Column(type="integer") - * @GeneratedValue - */ - public $id; - - /** - * @OneToOne(targetEntity="DDC1193Account", cascade={"persist", "remove"}) - */ - public $account; -} - -/** @Entity */ -class DDC1193Account { - /** - * @Id @Column(type="integer") - * @GeneratedValue - */ - public $id; - -} - - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1209Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1209Test.php deleted file mode 100644 index bddbbdf..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1209Test.php +++ /dev/null @@ -1,125 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1209_1'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1209_2'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1209_3') - )); - } catch(\Exception $e) { - } - } - - /** - * @group DDC-1209 - */ - public function testIdentifierCanHaveCustomType() - { - $this->_em->persist(new DDC1209_3()); - $this->_em->flush(); - } - - /** - * @group DDC-1209 - */ - public function testCompositeIdentifierCanHaveCustomType() - { - $future1 = new DDC1209_1(); - $this->_em->persist($future1); - - $this->_em->flush(); - - $future2 = new DDC1209_2($future1); - $this->_em->persist($future2); - - $this->_em->flush(); - } -} - -/** - * @Entity - */ -class DDC1209_1 -{ - /** - * @Id @GeneratedValue @Column(type="integer") - */ - private $id; - - public function getId() - { - return $this->id; - } -} - -/** - * @Entity - */ -class DDC1209_2 -{ - /** - * @Id - * @ManyToOne(targetEntity="DDC1209_1") - * @JoinColumn(referencedColumnName="id", nullable=false) - */ - private $future1; - /** - * @Id - * @Column(type="datetime", nullable=false) - */ - private $starting_datetime; - /** - * @Id - * @Column(type="datetime", nullable=false) - */ - private $during_datetime; - /** - * @Id - * @Column(type="datetime", nullable=false) - */ - private $ending_datetime; - - public function __construct(DDC1209_1 $future1) - { - $this->future1 = $future1; - $this->starting_datetime = new DateTime2(); - $this->during_datetime = new DateTime2(); - $this->ending_datetime = new DateTime2(); - } -} - -/** - * @Entity - */ -class DDC1209_3 -{ - /** - * @Id - * @Column(type="datetime", name="somedate") - */ - private $date; - - public function __construct() - { - $this->date = new DateTime2(); - } -} - -class DateTime2 extends \DateTime -{ - public function __toString() - { - return $this->format('Y'); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1225Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1225Test.php deleted file mode 100644 index 95dcc2b..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1225Test.php +++ /dev/null @@ -1,85 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1225_TestEntity1'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1225_TestEntity2'), - )); - } catch(\PDOException $e) { - - } - } - - public function testIssue() - { - $qb = $this->_em->createQueryBuilder(); - $qb->from('Doctrine\Tests\ORM\Functional\Ticket\DDC1225_TestEntity1', 'te1') - ->select('te1') - ->where('te1.testEntity2 = ?1') - ->setParameter(1, 0); - - $this->assertEquals( - strtolower('SELECT t0_.test_entity2_id AS test_entity2_id0 FROM te1 t0_ WHERE t0_.test_entity2_id = ?'), - strtolower($qb->getQuery()->getSQL()) - ); - } -} - -/** - * @Entity - * @Table(name="te1") - */ -class DDC1225_TestEntity1 -{ - /** - * @Id - * @ManyToOne(targetEntity="Doctrine\Tests\ORM\Functional\Ticket\DDC1225_TestEntity2") - * @JoinColumn(name="test_entity2_id", referencedColumnName="id", nullable=false) - */ - private $testEntity2; - - /** - * @param DDC1225_TestEntity2 $testEntity2 - */ - public function setTestEntity2(DDC1225_TestEntity2 $testEntity2) - { - $this->testEntity2 = $testEntity2; - } - - /** - * @return DDC1225_TestEntity2 - */ - public function getTestEntity2() - { - return $this->testEntity2; - } -} - -/** - * @Entity - * @Table(name="te2") - */ -class DDC1225_TestEntity2 -{ - /** - * @Id - * @GeneratedValue(strategy="AUTO") - * @Column(type="integer") - */ - private $id; -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1228Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1228Test.php deleted file mode 100644 index 6e14e21..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1228Test.php +++ /dev/null @@ -1,136 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1228User'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1228Profile'), - )); - } catch(\Exception $e) { - - } - } - - public function testOneToOnePersist() - { - $user = new DDC1228User; - $profile = new DDC1228Profile(); - $profile->name = "Foo"; - $user->profile = $profile; - - $this->_em->persist($user); - $this->_em->persist($profile); - $this->_em->flush(); - $this->_em->clear(); - - $user = $this->_em->find(__NAMESPACE__ . '\\DDC1228User', $user->id); - - $this->assertFalse($user->getProfile()->__isInitialized__, "Proxy is not initialized"); - $user->getProfile()->setName("Bar"); - $this->assertTrue($user->getProfile()->__isInitialized__, "Proxy is not initialized"); - - $this->assertEquals("Bar", $user->getProfile()->getName()); - $this->assertEquals(array("id" => 1, "name" => "Foo"), $this->_em->getUnitOfWork()->getOriginalEntityData($user->getProfile())); - - $this->_em->flush(); - $this->_em->clear(); - - $user = $this->_em->find(__NAMESPACE__ . '\\DDC1228User', $user->id); - $this->assertEquals("Bar", $user->getProfile()->getName()); - } - - public function testRefresh() - { - $user = new DDC1228User; - $profile = new DDC1228Profile(); - $profile->name = "Foo"; - $user->profile = $profile; - - $this->_em->persist($user); - $this->_em->persist($profile); - $this->_em->flush(); - $this->_em->clear(); - - $user = $this->_em->getReference(__NAMESPACE__ . '\\DDC1228User', $user->id); - - $this->_em->refresh($user); - $user->name = "Baz"; - $this->_em->flush(); - $this->_em->clear(); - - $user = $this->_em->find(__NAMESPACE__ . '\\DDC1228User', $user->id); - $this->assertEquals("Baz", $user->name); - } -} - -/** - * @Entity - */ -class DDC1228User -{ - /** - * @Id @Column(type="integer") @GeneratedValue - * @var int - */ - public $id; - - /** - * @Column(type="string") - * @var string - */ - public $name = 'Bar'; - - /** - * @OneToOne(targetEntity="DDC1228Profile") - * @var Profile - */ - public $profile; - - public function getProfile() - { - return $this->profile; - } -} - -/** - * @Entity - */ -class DDC1228Profile -{ - /** - * @Id @Column(type="integer") @GeneratedValue - * @var int - */ - public $id; - - /** - * @column(type="string") - * @var string - */ - public $name; - - public function getName() - { - return $this->name; - } - - public function setName($name) - { - $this->name = $name; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1238Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1238Test.php deleted file mode 100644 index 6783928..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1238Test.php +++ /dev/null @@ -1,100 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1238User'), - )); - } catch(\Exception $e) { - - } - } - - public function testIssue() - { - $user = new DDC1238User; - $user->setName("test"); - - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - - $userId = $user->getId(); - $this->_em->clear(); - - $user = $this->_em->getReference(__NAMESPACE__ . '\\DDC1238User', $userId); - $this->_em->clear(); - - $userId2 = $user->getId(); - $this->assertEquals($userId, $userId2, "This proxy can still be initialized."); - } - - public function testIssueProxyClear() - { - $user = new DDC1238User; - $user->setName("test"); - - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - - // force proxy load, getId() doesn't work anymore - $user->getName(); - $userId = $user->getId(); - $this->_em->clear(); - - $user = $this->_em->getReference(__NAMESPACE__ . '\\DDC1238User', $userId); - $this->_em->clear(); - - $user2 = $this->_em->getReference(__NAMESPACE__ . '\\DDC1238User', $userId); - - // force proxy load, getId() doesn't work anymore - $user->getName(); - $this->assertNull($user->getId(), "Now this is null, we already have a user instance of that type"); - } -} - -/** - * @Entity - */ -class DDC1238User -{ - /** @Id @GeneratedValue @Column(type="integer") */ - private $id; - - /** - * @Column - * @var string - */ - private $name; - - public function getId() - { - return $this->id; - } - - public function getName() - { - return $this->name; - } - - public function setName($name) - { - $this->name = $name; - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1250Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1250Test.php deleted file mode 100644 index 3a756da..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1250Test.php +++ /dev/null @@ -1,96 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1250ClientHistory'), - )); - } catch(\PDOException $e) { - - } - } - - public function testIssue() - { - $c1 = new DDC1250ClientHistory; - $c2 = new DDC1250ClientHistory; - $c1->declinedClientsHistory = $c2; - $c1->declinedBy = $c2; - $c2->declinedBy = $c1; - $c2->declinedClientsHistory= $c1; - - $this->_em->persist($c1); - $this->_em->persist($c2); - $this->_em->flush(); - $this->_em->clear(); - - $history = $this->_em->createQuery('SELECT h FROM ' . __NAMESPACE__ . '\\DDC1250ClientHistory h WHERE h.id = ?1') - ->setParameter(1, $c2->id)->getSingleResult(); - - $this->assertInstanceOf(__NAMESPACE__ . '\\DDC1250ClientHistory', $history); - } -} - -/** - * @Entity - */ -class DDC1250ClientHistory -{ - /** @Id @GeneratedValue @Column(type="integer") */ - public $id; - - /** @OneToOne(targetEntity="DDC1250ClientHistory", inversedBy="declinedBy") - * @JoinColumn(name="declined_clients_history_id", referencedColumnName="id") - */ - public $declinedClientsHistory; - - /** - * @OneToOne(targetEntity="DDC1250ClientHistory", mappedBy="declinedClientsHistory") - * @var - */ - public $declinedBy; -} - -/** - * -Entities\ClientsHistory: -type: entity -table: clients_history -fields: -id: -id: true -type: integer -unsigned: false -nullable: false -generator: -strategy: IDENTITY -[...skiped...] -oneToOne: -declinedClientsHistory: -targetEntity: Entities\ClientsHistory -joinColumn: -name: declined_clients_history_id -referencedColumnName: id -inversedBy: declinedBy -declinedBy: -targetEntity: Entities\ClientsHistory -mappedBy: declinedClientsHistory -lifecycleCallbacks: { } -repositoryClass: Entities\ClientsHistoryRepository - - - */ \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1276Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1276Test.php deleted file mode 100644 index a4f54b5..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1276Test.php +++ /dev/null @@ -1,50 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - public function testIssue() - { - $user = new CmsUser(); - $user->name = "Benjamin"; - $user->username = "beberlei"; - $user->status = "active"; - $this->_em->persist($user); - - for ($i = 0; $i < 2; $i++) { - $group = new CmsGroup(); - $group->name = "group".$i; - $user->groups[] = $group; - $this->_em->persist($group); - } - $this->_em->flush(); - $this->_em->clear(); - - $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $user->id); - $cloned = clone $user; - - $this->assertSame($user->groups, $cloned->groups); - $this->assertEquals(2, count($user->groups)); - $this->_em->merge($cloned); - - $this->assertEquals(2, count($user->groups)); - - $this->_em->flush(); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1300Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1300Test.php deleted file mode 100644 index 38278dc..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1300Test.php +++ /dev/null @@ -1,108 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1300Foo'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1300FooLocale'), - )); - } - - public function testIssue() - { - $foo = new DDC1300Foo(); - $foo->_fooReference = "foo"; - - $this->_em->persist($foo); - $this->_em->flush(); - - $locale = new DDC1300FooLocale(); - $locale->_foo = $foo; - $locale->_locale = "en"; - $locale->_title = "blub"; - - $this->_em->persist($locale); - $this->_em->flush(); - - $query = $this->_em->createQuery('SELECT f, fl FROM Doctrine\Tests\ORM\Functional\Ticket\DDC1300Foo f JOIN f._fooLocaleRefFoo fl'); - $result = $query->getResult(); - - $this->assertEquals(1, count($result)); - } -} - -/** - * @Entity - */ -class DDC1300Foo -{ - /** - * @var integer fooID - * @Column(name="fooID", type="integer", nullable=false) - * @GeneratedValue(strategy="AUTO") - * @Id - */ - public $_fooID = null; - - /** - * @var string fooReference - * @Column(name="fooReference", type="string", nullable=true, length=45) - */ - public $_fooReference = null; - - /** - * @OneToMany(targetEntity="DDC1300FooLocale", mappedBy="_foo", - * cascade={"persist"}) - */ - public $_fooLocaleRefFoo = null; - - /** - * Constructor - * - * @param array|Zend_Config|null $options - * @return Bug_Model_Foo - */ - public function __construct($options = null) - { - $this->_fooLocaleRefFoo = new \Doctrine\Common\Collections\ArrayCollection(); - } - -} - -/** - * @Entity - */ -class DDC1300FooLocale -{ - - /** - * @ManyToOne(targetEntity="DDC1300Foo") - * @JoinColumn(name="fooID", referencedColumnName="fooID") - * @Id - */ - public $_foo = null; - - /** - * @var string locale - * @Column(name="locale", type="string", nullable=false, length=5) - * @Id - */ - public $_locale = null; - - /** - * @var string title - * @Column(name="title", type="string", nullable=true, length=150) - */ - public $_title = null; - -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1301Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1301Test.php deleted file mode 100644 index 94d02f9..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1301Test.php +++ /dev/null @@ -1,148 +0,0 @@ -useModelSet('legacy'); - parent::setUp(); - - $class = $this->_em->getClassMetadata('Doctrine\Tests\Models\Legacy\LegacyUser'); - $class->associationMappings['_articles']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; - $class->associationMappings['_references']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; - $class->associationMappings['_cars']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; - - $this->loadFixture(); - } - - public function tearDown() - { - parent::tearDown(); - - $class = $this->_em->getClassMetadata('Doctrine\Tests\Models\Legacy\LegacyUser'); - $class->associationMappings['_articles']['fetch'] = ClassMetadataInfo::FETCH_LAZY; - $class->associationMappings['_references']['fetch'] = ClassMetadataInfo::FETCH_LAZY; - $class->associationMappings['_cars']['fetch'] = ClassMetadataInfo::FETCH_LAZY; - } - - public function testCountNotInitializesLegacyCollection() - { - $user = $this->_em->find('Doctrine\Tests\Models\Legacy\LegacyUser', $this->userId); - $queryCount = $this->getCurrentQueryCount(); - - $this->assertFalse($user->_articles->isInitialized()); - $this->assertEquals(2, count($user->_articles)); - $this->assertFalse($user->_articles->isInitialized()); - - foreach ($user->_articles AS $article) { } - - $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount(), "Expecting two queries to be fired for count, then iteration."); - } - - public function testCountNotInitializesLegacyCollectionWithForeignIdentifier() - { - $user = $this->_em->find('Doctrine\Tests\Models\Legacy\LegacyUser', $this->userId); - $queryCount = $this->getCurrentQueryCount(); - - $this->assertFalse($user->_references->isInitialized()); - $this->assertEquals(2, count($user->_references)); - $this->assertFalse($user->_references->isInitialized()); - - foreach ($user->_references AS $reference) { } - - $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount(), "Expecting two queries to be fired for count, then iteration."); - } - - public function testCountNotInitializesLegacyManyToManyCollection() - { - $user = $this->_em->find('Doctrine\Tests\Models\Legacy\LegacyUser', $this->userId); - $queryCount = $this->getCurrentQueryCount(); - - $this->assertFalse($user->_cars->isInitialized()); - $this->assertEquals(3, count($user->_cars)); - $this->assertFalse($user->_cars->isInitialized()); - - foreach ($user->_cars AS $reference) { } - - $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount(), "Expecting two queries to be fired for count, then iteration."); - } - - public function loadFixture() - { - $user1 = new \Doctrine\Tests\Models\Legacy\LegacyUser(); - $user1->_username = "beberlei"; - $user1->_name = "Benjamin"; - $user1->_status = "active"; - - $user2 = new \Doctrine\Tests\Models\Legacy\LegacyUser(); - $user2->_username = "jwage"; - $user2->_name = "Jonathan"; - $user2->_status = "active"; - - $user3 = new \Doctrine\Tests\Models\Legacy\LegacyUser(); - $user3->_username = "romanb"; - $user3->_name = "Roman"; - $user3->_status = "active"; - - $this->_em->persist($user1); - $this->_em->persist($user2); - $this->_em->persist($user3); - - $article1 = new \Doctrine\Tests\Models\Legacy\LegacyArticle(); - $article1->_topic = "Test"; - $article1->_text = "Test"; - $article1->setAuthor($user1); - - $article2 = new \Doctrine\Tests\Models\Legacy\LegacyArticle(); - $article2->_topic = "Test"; - $article2->_text = "Test"; - $article2->setAuthor($user1); - - $this->_em->persist($article1); - $this->_em->persist($article2); - - $car1 = new \Doctrine\Tests\Models\Legacy\LegacyCar(); - $car1->_description = "Test1"; - - $car2 = new \Doctrine\Tests\Models\Legacy\LegacyCar(); - $car2->_description = "Test2"; - - $car3 = new \Doctrine\Tests\Models\Legacy\LegacyCar(); - $car3->_description = "Test3"; - - $user1->addCar($car1); - $user1->addCar($car2); - $user1->addCar($car3); - - $user2->addCar($car1); - $user3->addCar($car1); - - $this->_em->persist($car1); - $this->_em->persist($car2); - $this->_em->persist($car3); - - $this->_em->flush(); - - $detail1 = new \Doctrine\Tests\Models\Legacy\LegacyUserReference($user1, $user2, "foo"); - $detail2 = new \Doctrine\Tests\Models\Legacy\LegacyUserReference($user1, $user3, "bar"); - - $this->_em->persist($detail1); - $this->_em->persist($detail2); - - $this->_em->flush(); - $this->_em->clear(); - - $this->userId = $user1->getId(); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1306Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1306Test.php deleted file mode 100644 index b143b00..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1306Test.php +++ /dev/null @@ -1,54 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - public function testIssue() - { - $phone = new CmsPhonenumber(); - $phone->phonenumber = "1234"; - - // puts user and phone into commit order calculator - $this->_em->persist($phone); - $this->_em->flush(); - - $address = new \Doctrine\Tests\Models\CMS\CmsAddress(); - $address->city = "bonn"; - $address->country = "Germany"; - $address->street = "somestreet!"; - $address->zip = 12345; - - $this->_em->persist($address); - - $user = new CmsUser(); - $user->username = "beberlei"; - $user->name = "benjamin"; - $user->status = "active"; - $user->setAddress($address); - - // puts user and address into commit order calculator, but does not calculate user dependencies new - $this->_em->persist($user); - $this->_em->flush(); - - $this->_em->remove($user->getAddress()); - $this->_em->remove($user); - $this->_em->flush(); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1335Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1335Test.php deleted file mode 100644 index 0500a0e..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1335Test.php +++ /dev/null @@ -1,218 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1335User'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1335Phone'), - )); - $this->loadFixture(); - } catch(\Exception $e) { - } - } - - - public function testDql() - { - $dql = 'SELECT u FROM ' . __NAMESPACE__ . '\DDC1335User u INDEX BY u.id'; - $query = $this->_em->createQuery($dql); - $result = $query->getResult(); - - $this->assertEquals(sizeof($result), 3); - $this->assertArrayHasKey(1, $result); - $this->assertArrayHasKey(2, $result); - $this->assertArrayHasKey(3, $result); - - $dql = 'SELECT u, p FROM '.__NAMESPACE__ . '\DDC1335User u INDEX BY u.email INNER JOIN u.phones p INDEX BY p.id'; - $query = $this->_em->createQuery($dql); - $result = $query->getResult(); - - $this->assertEquals(sizeof($result), 3); - $this->assertArrayHasKey('foo@foo.com', $result); - $this->assertArrayHasKey('bar@bar.com', $result); - $this->assertArrayHasKey('foobar@foobar.com', $result); - - $this->assertEquals(sizeof($result['foo@foo.com']->phones), 3); - $this->assertEquals(sizeof($result['bar@bar.com']->phones), 3); - $this->assertEquals(sizeof($result['foobar@foobar.com']->phones), 3); - - $foo = $result['foo@foo.com']->phones->toArray(); - $bar = $result['bar@bar.com']->phones->toArray(); - $foobar = $result['foobar@foobar.com']->phones->toArray(); - - $this->assertArrayHasKey(1, $foo); - $this->assertArrayHasKey(2, $foo); - $this->assertArrayHasKey(3, $foo); - - $this->assertArrayHasKey(4, $bar); - $this->assertArrayHasKey(5, $bar); - $this->assertArrayHasKey(6, $bar); - - $this->assertArrayHasKey(7, $foobar); - $this->assertArrayHasKey(8, $foobar); - $this->assertArrayHasKey(9, $foobar); - } - - public function testTicket() - { - $builder = $this->_em->createQueryBuilder(); - $builder->select('u')->from(__NAMESPACE__ . '\DDC1335User', 'u', 'u.id'); - - $dql = $builder->getQuery()->getDQL(); - $result = $builder->getQuery()->getResult(); - - $this->assertEquals(sizeof($result), 3); - $this->assertArrayHasKey(1, $result); - $this->assertArrayHasKey(2, $result); - $this->assertArrayHasKey(3, $result); - $this->assertEquals('SELECT u FROM ' . __NAMESPACE__ . '\DDC1335User u INDEX BY u.id', $dql); - } - - public function testIndexByUnique() - { - $builder = $this->_em->createQueryBuilder(); - $builder->select('u')->from(__NAMESPACE__ . '\DDC1335User', 'u', 'u.email'); - - $dql = $builder->getQuery()->getDQL(); - $result = $builder->getQuery()->getResult(); - - $this->assertEquals(sizeof($result), 3); - $this->assertArrayHasKey('foo@foo.com', $result); - $this->assertArrayHasKey('bar@bar.com', $result); - $this->assertArrayHasKey('foobar@foobar.com', $result); - $this->assertEquals('SELECT u FROM ' . __NAMESPACE__ . '\DDC1335User u INDEX BY u.email', $dql); - } - - public function testIndexWithJoin() - { - $builder = $this->_em->createQueryBuilder(); - $builder->select('u','p') - ->from(__NAMESPACE__ . '\DDC1335User', 'u', 'u.email') - ->join('u.phones', 'p', null, null, 'p.id'); - - $dql = $builder->getQuery()->getDQL(); - $result = $builder->getQuery()->getResult(); - - $this->assertEquals(sizeof($result), 3); - $this->assertArrayHasKey('foo@foo.com', $result); - $this->assertArrayHasKey('bar@bar.com', $result); - $this->assertArrayHasKey('foobar@foobar.com', $result); - - $this->assertEquals(sizeof($result['foo@foo.com']->phones), 3); - $this->assertEquals(sizeof($result['bar@bar.com']->phones), 3); - $this->assertEquals(sizeof($result['foobar@foobar.com']->phones), 3); - - $this->assertArrayHasKey(1, $result['foo@foo.com']->phones->toArray()); - $this->assertArrayHasKey(2, $result['foo@foo.com']->phones->toArray()); - $this->assertArrayHasKey(3, $result['foo@foo.com']->phones->toArray()); - - $this->assertArrayHasKey(4, $result['bar@bar.com']->phones->toArray()); - $this->assertArrayHasKey(5, $result['bar@bar.com']->phones->toArray()); - $this->assertArrayHasKey(6, $result['bar@bar.com']->phones->toArray()); - - $this->assertArrayHasKey(7, $result['foobar@foobar.com']->phones->toArray()); - $this->assertArrayHasKey(8, $result['foobar@foobar.com']->phones->toArray()); - $this->assertArrayHasKey(9, $result['foobar@foobar.com']->phones->toArray()); - - $this->assertEquals('SELECT u, p FROM '.__NAMESPACE__ . '\DDC1335User u INDEX BY u.email INNER JOIN u.phones p INDEX BY p.id', $dql); - } - - private function loadFixture() - { - $p1 = array('11 xxxx-xxxx','11 yyyy-yyyy','11 zzzz-zzzz'); - $p2 = array('22 xxxx-xxxx','22 yyyy-yyyy','22 zzzz-zzzz'); - $p3 = array('33 xxxx-xxxx','33 yyyy-yyyy','33 zzzz-zzzz'); - - $u1 = new DDC1335User("foo@foo.com", "Foo",$p1); - $u2 = new DDC1335User("bar@bar.com", "Bar",$p2); - $u3 = new DDC1335User("foobar@foobar.com", "Foo Bar",$p3); - - $this->_em->persist($u1); - $this->_em->persist($u2); - $this->_em->persist($u3); - $this->_em->flush(); - $this->_em->clear(); - } - -} - -/** - * @Entity - */ -class DDC1335User -{ - /** - * @Id @Column(type="integer") - * @GeneratedValue - */ - public $id; - - /** - * @Column(type="string", unique=true) - */ - public $email; - - /** - * @Column(type="string") - */ - public $name; - - /** - * @OneToMany(targetEntity="DDC1335Phone", mappedBy="user", cascade={"persist", "remove"}) - */ - public $phones; - - public function __construct($email, $name, array $numbers = array()) - { - $this->name = $name; - $this->email = $email; - $this->phones = new \Doctrine\Common\Collections\ArrayCollection(); - - foreach ($numbers as $number) { - $this->phones->add(new DDC1335Phone($this,$number)); - } - } -} - -/** - * @Entity - */ -class DDC1335Phone -{ - /** - * @Id - * @Column(name="id", type="integer") - * @GeneratedValue - */ - public $id; - - /** - * @Column(name="numericalValue", type="string", nullable = false) - */ - public $numericalValue; - - /** - * @ManyToOne(targetEntity="DDC1335User", inversedBy="phones") - * @JoinColumn(name="user_id", referencedColumnName="id", nullable = false) - */ - public $user; - - public function __construct($user, $number) - { - $this->user = $user; - $this->numericalValue = $number; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1360Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1360Test.php deleted file mode 100644 index f95f77e..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1360Test.php +++ /dev/null @@ -1,37 +0,0 @@ -_em->getConnection()->getDatabasePlatform()->getName() != "postgresql") { - $this->markTestSkipped("PostgreSQL only test."); - } - - $sql = $this->_schemaTool->getCreateSchemaSQL(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1360DoubleQuote') - )); - - $this->assertEquals(array( - 'CREATE TABLE "user"."user" (id INT NOT NULL, PRIMARY KEY(id))', - 'CREATE SEQUENCE "user".user_id_seq INCREMENT BY 1 MINVALUE 1 START 1', - ), $sql); - } -} - -/** - * @Entity @Table(name="`user`.`user`") - */ -class DDC1360DoubleQuote -{ - /** @Id @GeneratedValue @Column(type="integer") */ - public $id; -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1383Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1383Test.php deleted file mode 100644 index f6b5a24..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1383Test.php +++ /dev/null @@ -1,99 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1383AbstractEntity'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1383Entity'), - )); - } catch(\Exception $ignored) {} - } - - public function testFailingCase() - { - $parent = new DDC1383Entity(); - $child = new DDC1383Entity(); - - $child->setReference($parent); - - $this->_em->persist($parent); - $this->_em->persist($child); - - $id = $child->getId(); - - $this->_em->flush(); - $this->_em->clear(); - - // Try merging the parent entity - $child = $this->_em->merge($child); - $parent = $child->getReference(); - - // Parent is not instance of the abstract class - self::assertTrue($parent instanceof DDC1383AbstractEntity, - "Entity class is " . get_class($parent) . ', "DDC1383AbstractEntity" was expected'); - - // Parent is NOT instance of entity - self::assertTrue($parent instanceof DDC1383Entity, - "Entity class is " . get_class($parent) . ', "DDC1383Entity" was expected'); - } -} - -/** - * @Entity - * @InheritanceType("JOINED") - * @DiscriminatorColumn(name="discr", type="integer") - * @DiscriminatorMap({1 = "DDC1383Entity"}) - */ -abstract class DDC1383AbstractEntity -{ - /** - * @Id - * @Column(type="integer") - * @GeneratedValue - */ - protected $id; - - public function getId() - { - return $this->id; - } - - public function setId($id) - { - $this->id = $id; - } -} - -/** - * @Entity - */ -class DDC1383Entity extends DDC1383AbstractEntity -{ - /** - * @ManyToOne(targetEntity="DDC1383AbstractEntity") - */ - protected $reference; - - public function getReference() - { - return $this->reference; - } - - public function setReference(DDC1383AbstractEntity $reference) - { - $this->reference = $reference; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1392Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1392Test.php deleted file mode 100644 index 095b197..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1392Test.php +++ /dev/null @@ -1,127 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1392File'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1392Picture'), - )); - } catch (\Exception $ignored) { - } - } - - public function testFailingCase() - { - $file = new DDC1392File; - - $picture = new DDC1392Picture; - $picture->setFile($file); - - $em = $this->_em; - $em->persist($picture); - $em->flush(); - $em->clear(); - - $fileId = $file->getFileId(); - $pictureId = $picture->getPictureId(); - - $this->assertTrue($fileId > 0); - - $picture = $em->find(__NAMESPACE__ . '\DDC1392Picture', $pictureId); - $this->assertEquals(UnitOfWork::STATE_MANAGED, $em->getUnitOfWork()->getEntityState($picture->getFile()), "Lazy Proxy should be marked MANAGED."); - - $file = $picture->getFile(); - - // With this activated there will be no problem - //$file->__load(); - - $picture->setFile(null); - - $em->clear(); - - $em->merge($file); - - $em->flush(); - - $q = $this->_em->createQuery("SELECT COUNT(e) FROM " . __NAMESPACE__ . '\DDC1392File e'); - $result = $q->getSingleScalarResult(); - - self::assertEquals(1, $result); - } -} - -/** - * @Entity - */ -class DDC1392Picture -{ - /** - * @Column(name="picture_id", type="integer") - * @Id @GeneratedValue - */ - private $pictureId; - - /** - * @ManyToOne(targetEntity="DDC1392File", cascade={"persist", "remove"}) - * @JoinColumn(name="file_id", referencedColumnName="file_id") - */ - private $file; - - /** - * Get pictureId - */ - public function getPictureId() - { - return $this->pictureId; - } - - /** - * Set file - */ - public function setFile($value = null) - { - $this->file = $value; - } - - /** - * Get file - */ - public function getFile() - { - return $this->file; - } -} - -/** - * @Entity - */ -class DDC1392File -{ - /** - * @Column(name="file_id", type="integer") - * @Id - * @GeneratedValue(strategy="AUTO") - */ - public $fileId; - - /** - * Get fileId - */ - public function getFileId() - { - return $this->fileId; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1400Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1400Test.php deleted file mode 100644 index 2523b5b..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1400Test.php +++ /dev/null @@ -1,131 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1400Article'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1400User'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1400UserState'), - )); - } catch (\Exception $ignored) { - } - } - - public function testFailingCase() - { - $article = new DDC1400Article; - $user1 = new DDC1400User; - $user2 = new DDC1400User; - - $this->_em->persist($article); - $this->_em->persist($user1); - $this->_em->persist($user2); - $this->_em->flush(); - - $userState1 = new DDC1400UserState; - $userState1->article = $article; - $userState1->articleId = $article->id; - $userState1->user = $user1; - $userState1->userId = $user1->id; - - $userState2 = new DDC1400UserState; - $userState2->article = $article; - $userState2->articleId = $article->id; - $userState2->user = $user2; - $userState2->userId = $user2->id; - - $this->_em->persist($userState1); - $this->_em->persist($userState2); - - $this->_em->flush(); - $this->_em->clear(); - - $user1 = $this->_em->getReference(__NAMESPACE__.'\DDC1400User', $user1->id); - - $q = $this->_em->createQuery("SELECT a, s FROM ".__NAMESPACE__."\DDC1400Article a JOIN a.userStates s WITH s.user = :activeUser"); - $q->setParameter('activeUser', $user1); - $articles = $q->getResult(); - - $this->_em->flush(); - } -} - -/** - * @Entity - */ -class DDC1400Article -{ - /** - * @Id - * @Column(type="integer") - * @GeneratedValue - */ - public $id; - - /** - * @OneToMany(targetEntity="DDC1400UserState", mappedBy="article", indexBy="userId", fetch="EXTRA_LAZY") - */ - public $userStates; -} - -/** - * @Entity - */ -class DDC1400User -{ - - /** - * @Id - * @Column(type="integer") - * @GeneratedValue - */ - public $id; - - /** - * @OneToMany(targetEntity="DDC1400UserState", mappedBy="user", indexBy="articleId", fetch="EXTRA_LAZY") - */ - public $userStates; -} - -/** - * @Entity - */ -class DDC1400UserState -{ - - /** - * @Id - * @ManyToOne(targetEntity="DDC1400Article", inversedBy="userStates") - */ - public $article; - - /** - * @Id - * @ManyToOne(targetEntity="DDC1400User", inversedBy="userStates") - */ - public $user; - - /** - * @Column(name="user_id", type="integer") - */ - public $userId; - - /** - * @Column(name="article_id", type="integer") - */ - public $articleId; - -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1404Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1404Test.php deleted file mode 100644 index cc1d7c9..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1404Test.php +++ /dev/null @@ -1,129 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1404ParentEntity'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1404ChildEntity'), - )); - - $this->loadFixtures(); - - } catch (Exception $exc) { - } - } - - public function testTicket() - { - $repository = $this->_em->getRepository(__NAMESPACE__ . '\DDC1404ChildEntity'); - $queryAll = $repository->createNamedQuery('all'); - $queryFirst = $repository->createNamedQuery('first'); - $querySecond = $repository->createNamedQuery('second'); - - - $this->assertEquals('SELECT p FROM Doctrine\Tests\ORM\Functional\Ticket\DDC1404ChildEntity p', $queryAll->getDQL()); - $this->assertEquals('SELECT p FROM Doctrine\Tests\ORM\Functional\Ticket\DDC1404ChildEntity p WHERE p.id = 1', $queryFirst->getDQL()); - $this->assertEquals('SELECT p FROM Doctrine\Tests\ORM\Functional\Ticket\DDC1404ChildEntity p WHERE p.id = 2', $querySecond->getDQL()); - - - $this->assertEquals(sizeof($queryAll->getResult()), 2); - $this->assertEquals(sizeof($queryFirst->getResult()), 1); - $this->assertEquals(sizeof($querySecond->getResult()), 1); - } - - - public function loadFixtures() - { - $c1 = new DDC1404ChildEntity("ChildEntity 1"); - $c2 = new DDC1404ChildEntity("ChildEntity 2"); - - $this->_em->persist($c1); - $this->_em->persist($c2); - - $this->_em->flush(); - } - -} - -/** - * @MappedSuperclass - * - * @NamedQueries({ - * @NamedQuery(name="all", query="SELECT p FROM __CLASS__ p"), - * @NamedQuery(name="first", query="SELECT p FROM __CLASS__ p WHERE p.id = 1"), - * }) - */ -class DDC1404ParentEntity -{ - - /** - * @Id - * @Column(type="integer") - * @GeneratedValue() - */ - protected $id; - - /** - * @return integer - */ - public function getId() - { - return $this->id; - } - -} - -/** - * @Entity - * - * @NamedQueries({ - * @NamedQuery(name="first", query="SELECT p FROM __CLASS__ p WHERE p.id = 1"), - * @NamedQuery(name="second", query="SELECT p FROM __CLASS__ p WHERE p.id = 2") - * }) - */ -class DDC1404ChildEntity extends DDC1404ParentEntity -{ - - /** - * @column(type="string") - */ - private $name; - - /** - * @param string $name - */ - public function __construct($name) - { - $this->name = $name; - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * @param string $name - */ - public function setName($name) - { - $this->name = $name; - } - -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1430Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1430Test.php deleted file mode 100644 index cb16e91..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1430Test.php +++ /dev/null @@ -1,297 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1430Order'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1430OrderProduct'), - )); - $this->loadFixtures(); - } catch (\Exception $exc) { - - } - } - - public function testOrderByFields() - { - $repository = $this->_em->getRepository(__NAMESPACE__ . '\DDC1430Order'); - $builder = $repository->createQueryBuilder('o'); - $query = $builder->select('o.id, o.date, COUNT(p.id) AS p_count') - ->leftJoin('o.products', 'p') - ->groupBy('o.id, o.date') - ->orderBy('o.id') - ->getQuery(); - - $this->assertEquals('SELECT o.id, o.date, COUNT(p.id) AS p_count FROM Doctrine\Tests\ORM\Functional\Ticket\DDC1430Order o LEFT JOIN o.products p GROUP BY o.id, o.date ORDER BY o.id ASC', $query->getDQL()); - $this->assertSQLEquals('SELECT d0_.order_id AS order_id0, d0_.created_at AS created_at1, COUNT(d1_.id) AS sclr2 FROM DDC1430Order d0_ LEFT JOIN DDC1430OrderProduct d1_ ON d0_.order_id = d1_.order_id GROUP BY d0_.order_id, d0_.created_at ORDER BY d0_.order_id ASC', $query->getSQL()); - - - $result = $query->getResult(); - - $this->assertEquals(2, sizeof($result)); - - $this->assertArrayHasKey('id', $result[0]); - $this->assertArrayHasKey('id', $result[1]); - - $this->assertArrayHasKey('p_count', $result[0]); - $this->assertArrayHasKey('p_count', $result[1]); - - $this->assertEquals(1, $result[0]['id']); - $this->assertEquals(2, $result[1]['id']); - - $this->assertEquals(2, $result[0]['p_count']); - $this->assertEquals(3, $result[1]['p_count']); - } - - public function testOrderByAllObjectFields() - { - $repository = $this->_em->getRepository(__NAMESPACE__ . '\DDC1430Order'); - $builder = $repository->createQueryBuilder('o'); - $query = $builder->select('o, COUNT(p.id) AS p_count') - ->leftJoin('o.products', 'p') - ->groupBy('o.id, o.date, o.status') - ->orderBy('o.id') - ->getQuery(); - - - $this->assertEquals('SELECT o, COUNT(p.id) AS p_count FROM Doctrine\Tests\ORM\Functional\Ticket\DDC1430Order o LEFT JOIN o.products p GROUP BY o.id, o.date, o.status ORDER BY o.id ASC', $query->getDQL()); - $this->assertSQLEquals('SELECT d0_.order_id AS order_id0, d0_.created_at AS created_at1, d0_.order_status AS order_status2, COUNT(d1_.id) AS sclr3 FROM DDC1430Order d0_ LEFT JOIN DDC1430OrderProduct d1_ ON d0_.order_id = d1_.order_id GROUP BY d0_.order_id, d0_.created_at, d0_.order_status ORDER BY d0_.order_id ASC', $query->getSQL()); - - $result = $query->getResult(); - - - $this->assertEquals(2, sizeof($result)); - - $this->assertTrue($result[0][0] instanceof DDC1430Order); - $this->assertTrue($result[1][0] instanceof DDC1430Order); - - $this->assertEquals($result[0][0]->getId(), 1); - $this->assertEquals($result[1][0]->getId(), 2); - - $this->assertEquals($result[0]['p_count'], 2); - $this->assertEquals($result[1]['p_count'], 3); - } - - public function testTicket() - { - $repository = $this->_em->getRepository(__NAMESPACE__ . '\DDC1430Order'); - $builder = $repository->createQueryBuilder('o'); - $query = $builder->select('o, COUNT(p.id) AS p_count') - ->leftJoin('o.products', 'p') - ->groupBy('o') - ->orderBy('o.id') - ->getQuery(); - - - $this->assertEquals('SELECT o, COUNT(p.id) AS p_count FROM Doctrine\Tests\ORM\Functional\Ticket\DDC1430Order o LEFT JOIN o.products p GROUP BY o ORDER BY o.id ASC', $query->getDQL()); - $this->assertSQLEquals('SELECT d0_.order_id AS order_id0, d0_.created_at AS created_at1, d0_.order_status AS order_status2, COUNT(d1_.id) AS sclr3 FROM DDC1430Order d0_ LEFT JOIN DDC1430OrderProduct d1_ ON d0_.order_id = d1_.order_id GROUP BY d0_.order_id, d0_.created_at, d0_.order_status ORDER BY d0_.order_id ASC', $query->getSQL()); - - - $result = $query->getResult(); - - $this->assertEquals(2, sizeof($result)); - - $this->assertTrue($result[0][0] instanceof DDC1430Order); - $this->assertTrue($result[1][0] instanceof DDC1430Order); - - $this->assertEquals($result[0][0]->getId(), 1); - $this->assertEquals($result[1][0]->getId(), 2); - - $this->assertEquals($result[0]['p_count'], 2); - $this->assertEquals($result[1]['p_count'], 3); - } - - public function loadFixtures() - { - $o1 = new DDC1430Order('NEW'); - $o2 = new DDC1430Order('OK'); - - $o1->addProduct(new DDC1430OrderProduct(1.1)); - $o1->addProduct(new DDC1430OrderProduct(1.2)); - - $o2->addProduct(new DDC1430OrderProduct(2.1)); - $o2->addProduct(new DDC1430OrderProduct(2.2)); - $o2->addProduct(new DDC1430OrderProduct(2.3)); - - $this->_em->persist($o1); - $this->_em->persist($o2); - - $this->_em->flush(); - } - -} - -/** - * @Entity - */ -class DDC1430Order -{ - - /** - * @Id - * @Column(name="order_id", type="integer") - * @GeneratedValue() - */ - protected $id; - - /** - * @Column(name="created_at", type="datetime") - */ - private $date; - - /** - * @Column(name="order_status", type="string") - */ - private $status; - - /** - * @OneToMany(targetEntity="DDC1430OrderProduct", mappedBy="order", cascade={"persist", "remove"}) - * - * @var \Doctrine\Common\Collections\ArrayCollection $products - */ - private $products; - - /** - * @return integer - */ - public function getId() - { - return $this->id; - } - - public function __construct($status) - { - $this->status = $status; - $this->date = new \DateTime(); - $this->products = new \Doctrine\Common\Collections\ArrayCollection(); - } - /** - * @return \DateTime - */ - public function getDate() - { - return $this->date; - } - - /** - * @return string - */ - public function getStatus() - { - return $this->status; - } - - /** - * @param string $status - */ - public function setStatus($status) - { - $this->status = $status; - } - - /** - * @return \Doctrine\Common\Collections\ArrayCollection - */ - public function getProducts() - { - return $this->products; - } - - /** - * @param DDC1430OrderProduct $product - */ - public function addProduct(DDC1430OrderProduct $product) - { - $product->setOrder($this); - $this->products->add($product); - } -} - -/** - * @Entity - */ -class DDC1430OrderProduct -{ - - /** - * @Id - * @Column(type="integer") - * @GeneratedValue() - */ - protected $id; - - /** - * @var DDC1430Order $order - * - * @ManyToOne(targetEntity="DDC1430Order", inversedBy="products") - * @JoinColumn(name="order_id", referencedColumnName="order_id", nullable = false) - */ - private $order; - - /** - * @column(type="float") - */ - private $value; - - /** - * @param float $value - */ - public function __construct($value) - { - $this->value = $value; - } - - /** - * @return integer - */ - public function getId() - { - return $this->id; - } - - /** - * @return DDC1430Order - */ - public function getOrder() - { - return $this->order; - } - - /** - * @param DDC1430Order $order - */ - public function setOrder(DDC1430Order $order) - { - $this->order = $order; - } - - /** - * @return float - */ - public function getValue() - { - return $this->value; - } - - /** - * @param float $value - */ - public function setValue($value) - { - $this->value = $value; - } - -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1436Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1436Test.php deleted file mode 100644 index 906290c..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1436Test.php +++ /dev/null @@ -1,89 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1436Page'), - )); - } catch (\Exception $ignored) { - } - } - - public function testIdentityMap() - { - // fixtures - $parent = null; - for ($i = 0; $i < 3; $i++) { - $page = new DDC1436Page(); - $page->setParent($parent); - $this->_em->persist($page); - $parent = $page; - } - $this->_em->flush(); - $this->_em->clear(); - - $id = $parent->getId(); - - // step 1 - $page = $this->_em - ->createQuery('SELECT p, parent FROM ' . __NAMESPACE__ . '\DDC1436Page p LEFT JOIN p.parent parent WHERE p.id = :id') - ->setParameter('id', $id) - ->getOneOrNullResult(); - - $this->assertInstanceOf(__NAMESPACE__ . '\DDC1436Page', $page); - - // step 2 - $page = $this->_em->find(__NAMESPACE__ . '\DDC1436Page', $id); - $this->assertInstanceOf(__NAMESPACE__ . '\DDC1436Page', $page); - $this->assertInstanceOf(__NAMESPACE__ . '\DDC1436Page', $page->getParent()); - $this->assertInstanceOf(__NAMESPACE__ . '\DDC1436Page', $page->getParent()->getParent()); - } -} - -/** - * @Entity - */ -class DDC1436Page -{ - /** - * @Id - * @GeneratedValue - * @Column(type="integer", name="id") - */ - protected $id; - /** - * @ManyToOne(targetEntity="DDC1436Page") - * @JoinColumn(name="pid", referencedColumnName="id") - */ - protected $parent; - - public function getId() - { - return $this->id; - } - - /** - * @return DDC1436Page - */ - public function getParent() - { - return $this->parent; - } - - public function setParent($parent) - { - $this->parent = $parent; - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC144Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC144Test.php deleted file mode 100644 index dd6391a..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC144Test.php +++ /dev/null @@ -1,64 +0,0 @@ -_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - - $this->_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC144FlowElement'), - // $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC144Expression'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC144Operand'), - )); - - } - - /** - * @group DDC-144 - */ - public function testIssue() - { - - $operand = new DDC144Operand; - $operand->property = 'flowValue'; - $operand->operandProperty = 'operandValue'; - $this->_em->persist($operand); - $this->_em->flush(); - - } -} - -/** - * @Entity - * @Table(name="ddc144_flowelements") - * @InheritanceType("JOINED") - * @DiscriminatorColumn(type="string", name="discr") - * @DiscriminatorMap({"flowelement" = "DDC144FlowElement", "operand" = "DDC144Operand"}) - */ -class DDC144FlowElement { - /** - * @Id @Column(type="integer") @GeneratedValue - * @var integer - */ - public $id; - /** @Column */ - public $property; -} - -abstract class DDC144Expression extends DDC144FlowElement { - abstract function method(); -} - -/** @Entity @Table(name="ddc144_operands") */ -class DDC144Operand extends DDC144Expression { - /** @Column */ - public $operandProperty; - function method() {} -} - - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1452Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1452Test.php deleted file mode 100644 index aef2d10..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1452Test.php +++ /dev/null @@ -1,127 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - - try { - $this->_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1452EntityA'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1452EntityB'), - )); - } catch (\Exception $ignored) { - } - } - - public function testIssue() - { - $a1 = new DDC1452EntityA(); - $a1->title = "foo"; - - $a2 = new DDC1452EntityA(); - $a2->title = "bar"; - - $b = new DDC1452EntityB(); - $b->entityAFrom = $a1; - $b->entityATo = $a2; - - $this->_em->persist($a1); - $this->_em->persist($a2); - $this->_em->persist($b); - $this->_em->flush(); - $this->_em->clear(); - - $dql = "SELECT a, b, ba FROM " . __NAMESPACE__ . "\DDC1452EntityA AS a LEFT JOIN a.entitiesB AS b LEFT JOIN b.entityATo AS ba"; - $results = $this->_em->createQuery($dql)->setMaxResults(1)->getResult(); - - $this->assertSame($results[0], $results[0]->entitiesB[0]->entityAFrom); - $this->assertFalse( $results[0]->entitiesB[0]->entityATo instanceof \Doctrine\ORM\Proxy\Proxy ); - $this->assertInstanceOf('Doctrine\Common\Collections\Collection', $results[0]->entitiesB[0]->entityATo->getEntitiesB()); - } - - public function testFetchJoinOneToOneFromInverse() - { - $address = new \Doctrine\Tests\Models\CMS\CmsAddress(); - $address->city = "Bonn"; - $address->country = "Germany"; - $address->street = "Somestreet"; - $address->zip = 12345; - - $user = new \Doctrine\Tests\Models\CMS\CmsUser(); - $user->name = "beberlei"; - $user->username = "beberlei"; - $user->status = "active"; - $user->address = $address; - $address->user = $user; - - $this->_em->persist($address); - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - - $dql = "SELECT a, u FROM Doctrine\Tests\Models\CMS\CmsAddress a INNER JOIN a.user u"; - $data = $this->_em->createQuery($dql)->getResult(); - $this->_em->clear(); - - $this->assertFalse($data[0]->user instanceof \Doctrine\ORM\Proxy\Proxy); - - $dql = "SELECT u, a FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.address a"; - $data = $this->_em->createQuery($dql)->getResult(); - - $this->assertFalse($data[0]->address instanceof \Doctrine\ORM\Proxy\Proxy); - } -} - -/** - * @Entity - */ -class DDC1452EntityA -{ - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; - /** @Column */ - public $title; - /** @ManyToMany(targetEntity="DDC1452EntityB", mappedBy="entityAFrom") */ - public $entitiesB; - - public function __construct() - { - $this->entitiesB = new ArrayCollection(); - } - - public function getEntitiesB() - { - return $this->entitiesB; - } -} - -/** - * @Entity - */ -class DDC1452EntityB -{ - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; - - /** - * @ManyToOne(targetEntity="DDC1452EntityA", inversedBy="entitiesB") - */ - public $entityAFrom; - /** - * @ManyToOne(targetEntity="DDC1452EntityA") - */ - public $entityATo; -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1454Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1454Test.php deleted file mode 100644 index eaf9dd3..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1454Test.php +++ /dev/null @@ -1,69 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1454File'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1454Picture'), - )); - } catch (\Exception $ignored) { - - } - } - - public function testFailingCase() - { - $pic = new DDC1454Picture(); - $this->_em->getUnitOfWork()->getEntityState($pic); - } - -} - -/** - * @Entity - */ -class DDC1454Picture extends DDC1454File -{ - -} - -/** - * @Entity - * @InheritanceType("JOINED") - * @DiscriminatorColumn(name="discr", type="string") - * @DiscriminatorMap({"picture" = "DDC1454Picture"}) - */ -class DDC1454File -{ - /** - * @Column(name="file_id", type="integer") - * @Id - */ - public $fileId; - - public function __construct() { - $this->fileId = rand(); - } - - /** - * Get fileId - */ - public function getFileId() { - return $this->fileId; - } - -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1458Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1458Test.php deleted file mode 100644 index 745b51c..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1458Test.php +++ /dev/null @@ -1,131 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\TestEntity'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\TestAdditionalEntity') - )); - } - - public function testIssue() - { - $testEntity = new TestEntity(); - $testEntity->setValue(3); - $testEntity->setAdditional(new TestAdditionalEntity()); - $this->_em->persist($testEntity); - $this->_em->flush(); - $this->_em->clear(); - - // So here the value is 3 - $this->assertEquals(3, $testEntity->getValue()); - - $test = $this->_em->getRepository(__NAMESPACE__ . '\TestEntity')->find(1); - - // New value is set - $test->setValue(5); - - // So here the value is 5 - $this->assertEquals(5, $test->getValue()); - - // Get the additional entity - $additional = $test->getAdditional(); - - // Still 5.. - $this->assertEquals(5, $test->getValue()); - - // Force the proxy to load - $additional->getBool(); - - // The value should still be 5 - $this->assertEquals(5, $test->getValue()); - } -} - - -/** - * @Entity - */ -class TestEntity -{ - /** - * @Id - * @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - protected $id; - /** - * @Column(type="integer") - */ - protected $value; - /** - * @OneToOne(targetEntity="TestAdditionalEntity", inversedBy="entity", orphanRemoval=true, cascade={"persist", "remove"}) - */ - protected $additional; - - public function getValue() - { - return $this->value; - } - - public function setValue($value) - { - $this->value = $value; - } - - public function getAdditional() - { - return $this->additional; - } - - public function setAdditional($additional) - { - $this->additional = $additional; - } -} -/** - * @Entity - */ -class TestAdditionalEntity -{ - /** - * @Id - * @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - protected $id; - /** - * @OneToOne(targetEntity="TestEntity", mappedBy="additional") - */ - protected $entity; - /** - * @Column(type="boolean") - */ - protected $bool; - - public function __construct() - { - $this->bool = false; - } - - public function getBool() - { - return $this->bool; - } - - public function setBool($bool) - { - $this->bool = $bool; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1461Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1461Test.php deleted file mode 100644 index e6aa2e6..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1461Test.php +++ /dev/null @@ -1,86 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1461TwitterAccount'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1461User') - )); - } catch(\Exception $e) { - - } - } - - public function testChangeDetectionDeferredExplicit() - { - $user = new DDC1461User; - $this->_em->persist($user); - $this->_em->flush(); - - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_MANAGED, $this->_em->getUnitOfWork()->getEntityState($user, \Doctrine\ORM\UnitOfWork::STATE_NEW), "Entity should be managed."); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_MANAGED, $this->_em->getUnitOfWork()->getEntityState($user), "Entity should be managed."); - - $acc = new DDC1461TwitterAccount; - $user->twitterAccount = $acc; - - $this->_em->persist($user); - $this->_em->flush(); - - $user = $this->_em->find(get_class($user), $user->id); - $this->assertNotNull($user->twitterAccount); - } -} - -/** - * @Entity - * @ChangeTrackingPolicy("DEFERRED_EXPLICIT") - */ -class DDC1461User -{ - /** - * @Id - * @GeneratedValue(strategy="AUTO") - * @Column(type="integer") - */ - public $id; - - /** - * @OneToOne(targetEntity="DDC1461TwitterAccount", orphanRemoval=true, fetch="EAGER", cascade = {"persist"}, inversedBy="user") - * @var TwitterAccount - */ - public $twitterAccount; -} - -/** - * @Entity - * @ChangeTrackingPolicy("DEFERRED_EXPLICIT") - */ -class DDC1461TwitterAccount -{ - /** - * @Id - * @GeneratedValue(strategy="AUTO") - * @Column(type="integer") - */ - public $id; - - /** - * @OneToOne(targetEntity="DDC1461User", fetch="EAGER") - */ - public $user; -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php deleted file mode 100644 index 6ba0cd4..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php +++ /dev/null @@ -1,146 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1509AbstractFile'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1509File'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1509Picture'), - )); - } catch (\Exception $ignored) { - - } - } - - public function testFailingCase() - { - $file = new DDC1509File; - $thumbnail = new DDC1509File; - - $picture = new DDC1509Picture; - $picture->setFile($file); - $picture->setThumbnail($thumbnail); - - - /* @var $em \Doctrine\ORM\EntityManager */ - $em = $this->_em; - $em->persist($picture); - $em->flush(); - $em->clear(); - - $id = $picture->getPictureId(); - - $pic = $em->merge($picture); - /* @var $pic DDC1509Picture */ - - $this->assertNotNull($pic->getThumbnail()); - $this->assertNotNull($pic->getFile()); - } - -} - -/** - * @Entity - */ -class DDC1509Picture -{ - - /** - * @Column(type="integer") - * @Id - * @GeneratedValue(strategy="AUTO") - */ - private $id; - - /** - * @ManyToOne(targetEntity="DDC1509AbstractFile", cascade={"persist", "remove"}) - */ - private $thumbnail; - - /** - * @ManyToOne(targetEntity="DDC1509AbstractFile", cascade={"persist", "remove"}) - */ - private $file; - - /** - * Get pictureId - */ - public function getPictureId() - { - return $this->id; - } - - /** - * Set file - */ - public function setFile($value = null) - { - $this->file = $value; - } - - /** - * Get file - */ - public function getFile() - { - return $this->file; - } - - public function getThumbnail() - { - return $this->thumbnail; - } - - public function setThumbnail($thumbnail) - { - $this->thumbnail = $thumbnail; - } - -} - -/** - * @Entity - * @InheritanceType("SINGLE_TABLE") - * @DiscriminatorColumn(name="discr", type="string") - * @DiscriminatorMap({"file" = "DDC1509File"}) - */ -class DDC1509AbstractFile -{ - - /** - * @Column(type="integer") - * @Id - * @GeneratedValue(strategy="AUTO") - */ - public $id; - - /** - * Get fileId - */ - public function getFileId() - { - return $this->id; - } - -} - -/** - * @Entity - */ -class DDC1509File extends DDC1509AbstractFile -{ - -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1514Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1514Test.php deleted file mode 100644 index 17b0288..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1514Test.php +++ /dev/null @@ -1,113 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1514EntityA'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1514EntityB'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1514EntityC'), - )); - } catch (\Exception $ignored) { - } - } - - public function testIssue() - { - $a1 = new DDC1514EntityA(); - $a1->title = "foo"; - - $a2 = new DDC1514EntityA(); - $a2->title = "bar"; - - $b1 = new DDC1514EntityB(); - $b1->entityAFrom = $a1; - $b1->entityATo = $a2; - - $b2 = new DDC1514EntityB(); - $b2->entityAFrom = $a2; - $b2->entityATo = $a1; - - $c = new DDC1514EntityC(); - $c->title = "baz"; - $a2->entityC = $c; - - $this->_em->persist($a1); - $this->_em->persist($a2); - $this->_em->persist($b1); - $this->_em->persist($b2); - $this->_em->persist($c); - $this->_em->flush(); - $this->_em->clear(); - - $dql = "SELECT a, b, ba, c FROM " . __NAMESPACE__ . "\DDC1514EntityA AS a LEFT JOIN a.entitiesB AS b LEFT JOIN b.entityATo AS ba LEFT JOIN a.entityC AS c"; - $results = $this->_em->createQuery($dql)->getResult(); - - $this->assertInternalType('array', $results); - $this->assertTrue(count($results) >= 1, "At least one result expected in array"); - $this->assertEquals($c->title, $results[1]->entityC->title); - } -} - -/** - * @Entity - */ -class DDC1514EntityA -{ - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; - /** @Column */ - public $title; - /** @ManyToMany(targetEntity="DDC1514EntityB", mappedBy="entityAFrom") */ - public $entitiesB; - /** @ManyToOne(targetEntity="DDC1514EntityC") */ - public $entityC; - - public function __construct() - { - $this->entitiesB = new ArrayCollection(); - } -} - -/** - * @Entity - */ -class DDC1514EntityB -{ - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; - - /** - * @ManyToOne(targetEntity="DDC1514EntityA", inversedBy="entitiesB") - */ - public $entityAFrom; - /** - * @ManyToOne(targetEntity="DDC1514EntityA") - */ - public $entityATo; -} - -/** - * @Entity - */ -class DDC1514EntityC -{ - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; - /** @Column */ - public $title; -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1515Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1515Test.php deleted file mode 100644 index 9bd3360..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1515Test.php +++ /dev/null @@ -1,64 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1515Foo'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1515Bar'), - )); - } - - public function testIssue() - { - $bar = new DDC1515Bar(); - $this->_em->persist($bar); - $this->_em->flush(); - - $foo = new DDC1515Foo(); - $foo->bar = $bar; - $this->_em->persist($foo); - $this->_em->flush(); - $this->_em->clear(); - - $bar = $this->_em->find(__NAMESPACE__ . '\DDC1515Bar', $bar->id); - $this->assertInstanceOf(__NAMESPACE__.'\DDC1515Foo', $bar->foo); - } -} - -/** - * @Entity - */ -class DDC1515Foo -{ - /** - * @OneToOne(targetEntity="DDC1515Bar", inversedBy="foo") @Id - */ - public $bar; -} - -/** - * @Entity - */ -class DDC1515Bar -{ - /** - * @Id @Column(type="integer") @GeneratedValue - */ - public $id; - - /** - * @OneToOne(targetEntity="DDC1515Foo", mappedBy="bar") - */ - public $foo; -} - - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1526Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1526Test.php deleted file mode 100644 index 27d0a87..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1526Test.php +++ /dev/null @@ -1,67 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1526Menu'), - )); - } - - public function testIssue() - { - $parents = array(); - for ($i = 0; $i < 9; $i++) { - $entity = new DDC1526Menu; - - if (isset ($parents[($i % 3)])) { - $entity->parent = $parents[($i%3)]; - } - - $this->_em->persist($entity); - $parents[$i] = $entity; - } - $this->_em->flush(); - $this->_em->clear(); - - - $dql = "SELECT m, c - FROM " . __NAMESPACE__ . "\DDC1526Menu m - LEFT JOIN m.children c"; - $menus = $this->_em->createQuery($dql)->getResult(); - - // All Children collection now have to be initiailzed - foreach ($menus as $menu) { - $this->assertTrue($menu->children->isInitialized()); - } - } -} - -/** - * @Entity - */ -class DDC1526Menu -{ - /** - * @Column(type="integer") - * @Id - * @GeneratedValue - */ - public $id; - /** - * @ManyToOne(targetEntity="DDC1526Menu", inversedBy="children") - */ - public $parent; - - /** - * @OneToMany(targetEntity="DDC1526Menu", mappedBy="parent") - */ - public $children; -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1545Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1545Test.php deleted file mode 100644 index 6af9cc5..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1545Test.php +++ /dev/null @@ -1,201 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - private function initDb($link) - { - $article = new CmsArticle(); - $article->topic = 'foo'; - $article->text = 'foo'; - - $user = new CmsUser(); - $user->status = 'foo'; - $user->username = 'foo'; - $user->name = 'foo'; - - $user2 = new CmsUser(); - $user2->status = 'bar'; - $user2->username = 'bar'; - $user2->name = 'bar'; - - if ($link) { - $article->user = $user; - } - - $this->_em->persist($article); - $this->_em->persist($user); - $this->_em->persist($user2); - $this->_em->flush(); - $this->_em->clear(); - - $this->articleId = $article->id; - $this->userId = $user->id; - $this->user2Id = $user2->id; - } - - public function testLinkObjects() - { - $this->initDb(false); - - // don't join association - $article = $this->_em->find('Doctrine\Tests\Models\Cms\CmsArticle', $this->articleId); - - $user = $this->_em->find('Doctrine\Tests\Models\Cms\CmsUser', $this->userId); - - $article->user = $user; - - $this->_em->flush(); - $this->_em->clear(); - - $article = $this->_em - ->createQuery('SELECT a, u FROM Doctrine\Tests\Models\Cms\CmsArticle a LEFT JOIN a.user u WHERE a.id = :id') - ->setParameter('id', $this->articleId) - ->getOneOrNullResult(); - - $this->assertNotNull($article->user); - $this->assertEquals($user->id, $article->user->id); - } - - public function testLinkObjectsWithAssociationLoaded() - { - $this->initDb(false); - - // join association - $article = $this->_em - ->createQuery('SELECT a, u FROM Doctrine\Tests\Models\Cms\CmsArticle a LEFT JOIN a.user u WHERE a.id = :id') - ->setParameter('id', $this->articleId) - ->getOneOrNullResult(); - - $user = $this->_em->find('Doctrine\Tests\Models\Cms\CmsUser', $this->userId); - - $article->user = $user; - - $this->_em->flush(); - $this->_em->clear(); - - $article = $this->_em - ->createQuery('SELECT a, u FROM Doctrine\Tests\Models\Cms\CmsArticle a LEFT JOIN a.user u WHERE a.id = :id') - ->setParameter('id', $this->articleId) - ->getOneOrNullResult(); - - $this->assertNotNull($article->user); - $this->assertEquals($user->id, $article->user->id); - } - - public function testUnlinkObjects() - { - $this->initDb(true); - - // don't join association - $article = $this->_em->find('Doctrine\Tests\Models\Cms\CmsArticle', $this->articleId); - - $article->user = null; - - $this->_em->flush(); - $this->_em->clear(); - - $article = $this->_em - ->createQuery('SELECT a, u FROM Doctrine\Tests\Models\Cms\CmsArticle a LEFT JOIN a.user u WHERE a.id = :id') - ->setParameter('id', $this->articleId) - ->getOneOrNullResult(); - - $this->assertNull($article->user); - } - - public function testUnlinkObjectsWithAssociationLoaded() - { - $this->initDb(true); - - // join association - $article = $this->_em - ->createQuery('SELECT a, u FROM Doctrine\Tests\Models\Cms\CmsArticle a LEFT JOIN a.user u WHERE a.id = :id') - ->setParameter('id', $this->articleId) - ->getOneOrNullResult(); - - $article->user = null; - - $this->_em->flush(); - $this->_em->clear(); - - $article = $this->_em - ->createQuery('SELECT a, u FROM Doctrine\Tests\Models\Cms\CmsArticle a LEFT JOIN a.user u WHERE a.id = :id') - ->setParameter('id', $this->articleId) - ->getOneOrNullResult(); - - $this->assertNull($article->user); - } - - public function testChangeLink() - { - $this->initDb(false); - - // don't join association - $article = $this->_em->find('Doctrine\Tests\Models\Cms\CmsArticle', $this->articleId); - - $user2 = $this->_em->find('Doctrine\Tests\Models\Cms\CmsUser', $this->user2Id); - - $article->user = $user2; - - $this->_em->flush(); - $this->_em->clear(); - - $article = $this->_em - ->createQuery('SELECT a, u FROM Doctrine\Tests\Models\Cms\CmsArticle a LEFT JOIN a.user u WHERE a.id = :id') - ->setParameter('id', $this->articleId) - ->getOneOrNullResult(); - - $this->assertNotNull($article->user); - $this->assertEquals($user2->id, $article->user->id); - } - - public function testChangeLinkWithAssociationLoaded() - { - $this->initDb(false); - - // join association - $article = $this->_em - ->createQuery('SELECT a, u FROM Doctrine\Tests\Models\Cms\CmsArticle a LEFT JOIN a.user u WHERE a.id = :id') - ->setParameter('id', $this->articleId) - ->getOneOrNullResult(); - - $user2 = $this->_em->find('Doctrine\Tests\Models\Cms\CmsUser', $this->user2Id); - - $article->user = $user2; - - $this->_em->flush(); - $this->_em->clear(); - - $article = $this->_em - ->createQuery('SELECT a, u FROM Doctrine\Tests\Models\Cms\CmsArticle a LEFT JOIN a.user u WHERE a.id = :id') - ->setParameter('id', $this->articleId) - ->getOneOrNullResult(); - - $this->assertNotNull($article->user); - $this->assertEquals($user2->id, $article->user->id); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1548Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1548Test.php deleted file mode 100644 index 74c1fe1..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1548Test.php +++ /dev/null @@ -1,81 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1548E1'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1548E2'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1548Rel'), - )); - } - - public function testIssue() - { - $rel = new DDC1548Rel(); - $this->_em->persist($rel); - $this->_em->flush(); - - $e1 = new DDC1548E1(); - $e1->rel = $rel; - $this->_em->persist($e1); - $this->_em->flush(); - $this->_em->clear(); - - $obt = $this->_em->find(__NAMESPACE__ . '\DDC1548Rel', $rel->id); - - $this->assertNull($obt->e2); - } -} - -/** - * @Entity - */ -class DDC1548E1 -{ - /** - * @Id - * @OneToOne(targetEntity="DDC1548Rel", inversedBy="e1") - */ - public $rel; -} - -/** - * @Entity - */ -class DDC1548E2 -{ - /** - * @Id - * @OneToOne(targetEntity="DDC1548Rel", inversedBy="e2") - */ - public $rel; -} - -/** - * @Entity - */ -class DDC1548Rel -{ - /** - * @Id @GeneratedValue - * @Column(type="integer") - */ - public $id; - - /** - * @OneToOne(targetEntity="DDC1548E1", mappedBy="rel") - */ - public $e1; - /** - * @OneToOne(targetEntity="DDC1548E2", mappedBy="rel") - */ - public $e2; -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1594Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1594Test.php deleted file mode 100644 index b8dec40..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1594Test.php +++ /dev/null @@ -1,45 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - public function testIssue() - { - $user = new CmsUser(); - $user->status = 'foo'; - $user->username = 'foo'; - $user->name = 'foo'; - - $this->_em->persist($user); - $this->_em->flush(); - - $this->_em->clear(); - $detachedUser = clone $user; - $detachedUser->name = 'bar'; - $detachedUser->status = 'bar'; - - $newUser = $this->_em->getReference(get_class($user), $user->id); - - $mergedUser = $this->_em->merge($detachedUser); - - $this->assertNotSame($mergedUser, $detachedUser); - $this->assertEquals('bar', $detachedUser->getName()); - $this->assertEquals('bar', $mergedUser->getName()); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1595Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1595Test.php deleted file mode 100644 index d3116ce..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1595Test.php +++ /dev/null @@ -1,111 +0,0 @@ -_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\DebugStack); - - $this->_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1595BaseInheritance'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1595InheritedEntity1'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1595InheritedEntity2'), - )); - } - - public function testIssue() - { - $e1 = new DDC1595InheritedEntity1(); - - $this->_em->persist($e1); - $this->_em->flush(); - $this->_em->clear(); - - $sqlLogger = $this->_em->getConnection()->getConfiguration()->getSQLLogger(); - $repository = $this->_em->getRepository(__NAMESPACE__ . '\\DDC1595InheritedEntity1'); - - $entity1 = $repository->find($e1->id); - - // DDC-1596 - $this->assertSQLEquals( - "SELECT t0.id AS id1, t0.type FROM base t0 WHERE t0.id = ? AND t0.type IN ('Entity1')", - $sqlLogger->queries[count($sqlLogger->queries)]['sql'] - ); - - $entities = $entity1->getEntities()->getValues(); - - $this->assertSQLEquals( - "SELECT t0.id AS id1, t0.type FROM base t0 INNER JOIN entity1_entity2 ON t0.id = entity1_entity2.item WHERE entity1_entity2.parent = ? AND t0.type IN ('Entity2')", - $sqlLogger->queries[count($sqlLogger->queries)]['sql'] - ); - - $this->_em->clear(); - - $entity1 = $repository->find($e1->id); - $entities = $entity1->getEntities()->count(); - - $this->assertSQLEquals( - "SELECT COUNT(*) FROM entity1_entity2 t WHERE parent = ?", - $sqlLogger->queries[count($sqlLogger->queries)]['sql'] - ); - } -} - -/** - * @Entity - * @Table(name="base") - * - * @InheritanceType("SINGLE_TABLE") - * @DiscriminatorColumn(name="type", type="string") - * @DiscriminatorMap({ - * "Entity1" = "DDC1595InheritedEntity1", - * "Entity2" = "DDC1595InheritedEntity2" - * }) - */ -abstract class DDC1595BaseInheritance -{ - /** - * @Id @GeneratedValue - * @Column(type="integer") - * - * @var integer - */ - public $id; -} - -/** - * @Entity - * @Table(name="entity1") - */ -class DDC1595InheritedEntity1 extends DDC1595BaseInheritance -{ - /** - * @ManyToMany(targetEntity="DDC1595InheritedEntity2", fetch="EXTRA_LAZY") - * @JoinTable(name="entity1_entity2", - * joinColumns={@JoinColumn(name="parent", referencedColumnName="id")}, - * inverseJoinColumns={@JoinColumn(name="item", referencedColumnName="id")} - * ) - */ - protected $entities; - - public function getEntities() - { - return $this->entities; - } -} - -/** - * @Entity - * @Table(name="entity2") - */ -class DDC1595InheritedEntity2 extends DDC1595BaseInheritance -{ -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC163Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC163Test.php deleted file mode 100644 index 3126d54..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC163Test.php +++ /dev/null @@ -1,65 +0,0 @@ -useModelSet('company'); - parent::setUp(); - } - - /** - * @group DDC-163 - */ - public function testQueryWithOrConditionUsingTwoRelationOnSameEntity() - { - $p1 = new CompanyPerson; - $p1->setName('p1'); - - $p2 = new CompanyPerson; - $p2->setName('p2'); - - $p3 = new CompanyPerson; - $p3->setName('p3'); - - $p4 = new CompanyPerson; - $p4->setName('p4'); - - $p1->setSpouse($p3); - $p1->addFriend($p2); - $p2->addFriend($p3); - - $p3->addFriend($p4); - - $this->_em->persist($p1); - $this->_em->persist($p2); - $this->_em->persist($p3); - $this->_em->persist($p4); - - $this->_em->flush(); - $this->_em->clear(); - - $dql = 'SELECT PARTIAL person.{id,name}, PARTIAL spouse.{id,name}, PARTIAL friend.{id,name} - FROM Doctrine\Tests\Models\Company\CompanyPerson person - LEFT JOIN person.spouse spouse - LEFT JOIN person.friends friend - LEFT JOIN spouse.friends spouse_friend - LEFT JOIN friend.friends friend_friend - WHERE person.name=:name AND (spouse_friend.name=:name2 OR friend_friend.name=:name2)'; - - $q = $this->_em->createQuery($dql); - $q->setParameter('name', "p1"); - $q->setParameter('name2', "p4"); - $result = $q->getScalarResult(); - - $this->assertEquals('p3', $result[0]['spouse_name']); - $this->assertEquals('p1', $result[0]['person_name']); - $this->assertEquals('p2', $result[0]['friend_name']); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1643Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1643Test.php deleted file mode 100644 index 53d6bb6..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1643Test.php +++ /dev/null @@ -1,121 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - - $user1 = new CmsUser(); - $user1->username = "beberlei"; - $user1->name = "Benjamin"; - $user1->status = "active"; - $group1 = new CmsGroup(); - $group1->name = "test"; - $group2 = new CmsGroup(); - $group2->name = "test"; - $user1->addGroup($group1); - $user1->addGroup($group2); - $user2 = new CmsUser(); - $user2->username = "romanb"; - $user2->name = "Roman"; - $user2->status = "active"; - - $this->_em->persist($user1); - $this->_em->persist($user2); - $this->_em->persist($group1); - $this->_em->persist($group2); - $this->_em->flush(); - $this->_em->clear(); - - $this->user1 = $this->_em->find(get_class($user1), $user1->id); - $this->user2 = $this->_em->find(get_class($user1), $user2->id); - } - - public function testClonePersistentCollectionAndReuse() - { - $user1 = $this->user1; - - $user1->groups = clone $user1->groups; - - $this->_em->flush(); - $this->_em->clear(); - - $user1 = $this->_em->find(get_class($user1), $user1->id); - - $this->assertEquals(2, count($user1->groups)); - } - - public function testClonePersistentCollectionAndShare() - { - $user1 = $this->user1; - $user2 = $this->user2; - - $user2->groups = clone $user1->groups; - - $this->_em->flush(); - $this->_em->clear(); - - $user1 = $this->_em->find(get_class($user1), $user1->id); - $user2 = $this->_em->find(get_class($user1), $user2->id); - - $this->assertEquals(2, count($user1->groups)); - $this->assertEquals(2, count($user2->groups)); - } - - public function testCloneThenDirtyPersistentCollection() - { - $user1 = $this->user1; - $user2 = $this->user2; - - $group3 = new CmsGroup(); - $group3->name = "test"; - $user2->groups = clone $user1->groups; - $user2->groups->add($group3); - - $this->_em->persist($group3); - $this->_em->flush(); - $this->_em->clear(); - - $user1 = $this->_em->find(get_class($user1), $user1->id); - $user2 = $this->_em->find(get_class($user1), $user2->id); - - $this->assertEquals(3, count($user2->groups)); - $this->assertEquals(2, count($user1->groups)); - } - - public function testNotCloneAndPassAroundFlush() - { - $user1 = $this->user1; - $user2 = $this->user2; - - $group3 = new CmsGroup(); - $group3->name = "test"; - $user2->groups = $user1->groups; - $user2->groups->add($group3); - - $this->assertEQuals(1, count($user1->groups->getInsertDiff())); - - $this->_em->persist($group3); - $this->_em->flush(); - $this->_em->clear(); - - $user1 = $this->_em->find(get_class($user1), $user1->id); - $user2 = $this->_em->find(get_class($user1), $user2->id); - - $this->assertEquals(3, count($user2->groups)); - $this->assertEquals(3, count($user1->groups)); - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1654Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1654Test.php deleted file mode 100644 index 0169619..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1654Test.php +++ /dev/null @@ -1,103 +0,0 @@ -setUpEntitySchema(array( - __NAMESPACE__ . '\\DDC1654Post', - __NAMESPACE__ . '\\DDC1654Comment', - )); - } - - public function testManyToManyRemoveFromCollectionOrphanRemoval() - { - $post = new DDC1654Post(); - $post->comments[] = new DDC1654Comment(); - $post->comments[] = new DDC1654Comment(); - - $this->_em->persist($post); - $this->_em->flush(); - - $post->comments->remove(0); - $post->comments->remove(1); - - $this->_em->flush(); - $this->_em->clear(); - - $comments = $this->_em->getRepository(__NAMESPACE__ . '\\DDC1654Comment')->findAll(); - $this->assertEquals(0, count($comments)); - } - - public function testManyToManyRemoveElementFromCollectionOrphanRemoval() - { - $post = new DDC1654Post(); - $post->comments[] = new DDC1654Comment(); - $post->comments[] = new DDC1654Comment(); - - $this->_em->persist($post); - $this->_em->flush(); - - $post->comments->removeElement($post->comments[0]); - $post->comments->removeElement($post->comments[1]); - - $this->_em->flush(); - $this->_em->clear(); - - $comments = $this->_em->getRepository(__NAMESPACE__ . '\\DDC1654Comment')->findAll(); - $this->assertEquals(0, count($comments)); - } - - public function testManyToManyClearCollectionOrphanRemoval() - { - $post = new DDC1654Post(); - $post->comments[] = new DDC1654Comment(); - $post->comments[] = new DDC1654Comment(); - - $this->_em->persist($post); - $this->_em->flush(); - - $post->comments->clear(); - - $this->_em->flush(); - $this->_em->clear(); - - $comments = $this->_em->getRepository(__NAMESPACE__ . '\\DDC1654Comment')->findAll(); - $this->assertEquals(0, count($comments)); - - } -} - -/** - * @Entity - */ -class DDC1654Post -{ - /** - * @Id @Column(type="integer") @GeneratedValue - */ - public $id; - - /** - * @ManyToMany(targetEntity="DDC1654Comment", orphanRemoval=true, - * cascade={"persist"}) - */ - public $comments = array(); -} - -/** - * @Entity - */ -class DDC1654Comment -{ - /** - * @Id @Column(type="integer") @GeneratedValue - */ - public $id; -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1655Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1655Test.php deleted file mode 100644 index 22b20e7..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1655Test.php +++ /dev/null @@ -1,144 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1655Foo'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1655Bar'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1655Baz'), - )); - } catch(\Exception $e) { - - } - } - - public function testPostLoadOneToManyInheritance() - { - $cm = $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1655Foo'); - $this->assertEquals(array("postLoad" => array("postLoad")), $cm->lifecycleCallbacks); - - $cm = $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1655Bar'); - $this->assertEquals(array("postLoad" => array("postLoad", "postSubLoaded")), $cm->lifecycleCallbacks); - - $baz = new DDC1655Baz(); - $foo = new DDC1655Foo(); - $foo->baz = $baz; - $bar = new DDC1655Bar(); - $bar->baz = $baz; - - $this->_em->persist($foo); - $this->_em->persist($bar); - $this->_em->persist($baz); - $this->_em->flush(); - $this->_em->clear(); - - $baz = $this->_em->find(get_class($baz), $baz->id); - foreach ($baz->foos as $foo) { - $this->assertEquals(1, $foo->loaded, "should have loaded callback counter incremented for " . get_class($foo)); - } - } - - /** - * Check that post load is not executed several times when the entity - * is rehydrated again although its already known. - */ - public function testPostLoadInheritanceChild() - { - $bar = new DDC1655Bar(); - - $this->_em->persist($bar); - $this->_em->flush(); - $this->_em->clear(); - - $bar = $this->_em->find(get_class($bar), $bar->id); - $this->assertEquals(1, $bar->loaded); - $this->assertEquals(1, $bar->subLoaded); - - $bar = $this->_em->find(get_class($bar), $bar->id); - $this->assertEquals(1, $bar->loaded); - $this->assertEquals(1, $bar->subLoaded); - - $dql = "SELECT b FROM " . __NAMESPACE__ . "\DDC1655Bar b WHERE b.id = ?1"; - $bar = $this->_em->createQuery($dql)->setParameter(1, $bar->id)->getSingleResult(); - - $this->assertEquals(1, $bar->loaded); - $this->assertEquals(1, $bar->subLoaded); - - $this->_em->refresh($bar); - - $this->assertEquals(2, $bar->loaded); - $this->assertEquals(2, $bar->subLoaded); - } -} - -/** - * @Entity - * @InheritanceType("SINGLE_TABLE") - * @DiscriminatorMap({ - * "foo" = "DDC1655Foo", - * "bar" = "DDC1655Bar" - * }) - * @HasLifecycleCallbacks - */ -class DDC1655Foo -{ - /** @Id @GeneratedValue @Column(type="integer") */ - public $id; - - public $loaded = 0; - - /** - * @ManyToOne(targetEntity="DDC1655Baz", inversedBy="foos") - */ - public $baz; - - /** - * @PostLoad - */ - public function postLoad() - { - $this->loaded++; - } -} - -/** - * @Entity - * @HasLifecycleCallbacks - */ -class DDC1655Bar extends DDC1655Foo -{ - public $subLoaded; - - /** - * @PostLoad - */ - public function postSubLoaded() - { - $this->subLoaded++; - } -} - -/** - * @Entity - */ -class DDC1655Baz -{ - /** @Id @GeneratedValue @Column(type="integer") */ - public $id; - - /** - * @OneToMany(targetEntity="DDC1655Foo", mappedBy="baz") - */ - public $foos = array(); -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC168Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC168Test.php deleted file mode 100644 index 0b53780..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC168Test.php +++ /dev/null @@ -1,64 +0,0 @@ -useModelSet('company'); - parent::setUp(); - - $this->oldMetadata = $this->_em->getClassMetadata('Doctrine\Tests\Models\Company\CompanyEmployee'); - - $metadata = clone $this->oldMetadata; - ksort($metadata->reflFields); - $this->_em->getMetadataFactory()->setMetadataFor('Doctrine\Tests\Models\Company\CompanyEmployee', $metadata); - } - - public function tearDown() - { - $this->_em->getMetadataFactory()->setMetadataFor('Doctrine\Tests\Models\Company\CompanyEmployee', $this->oldMetadata); - parent::tearDown(); - } - - /** - * @group DDC-168 - */ - public function testJoinedSubclassPersisterRequiresSpecificOrderOfMetadataReflFieldsArray() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - - $spouse = new CompanyEmployee; - $spouse->setName("Blub"); - $spouse->setDepartment("Accounting"); - $spouse->setSalary(500); - - $employee = new CompanyEmployee; - $employee->setName("Foo"); - $employee->setDepartment("bar"); - $employee->setSalary(1000); - $employee->setSpouse($spouse); - - $this->_em->persist($spouse); - $this->_em->persist($employee); - - $this->_em->flush(); - $this->_em->clear(); - - $q = $this->_em->createQuery("SELECT e FROM Doctrine\Tests\Models\Company\CompanyEmployee e WHERE e.name = ?1"); - $q->setParameter(1, "Foo"); - $theEmployee = $q->getSingleResult(); - - $this->assertEquals("bar", $theEmployee->getDepartment()); - $this->assertEquals("Foo", $theEmployee->getName()); - $this->assertEquals(1000, $theEmployee->getSalary()); - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyEmployee', $theEmployee); - $this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyEmployee', $theEmployee->getSpouse()); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1695Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1695Test.php deleted file mode 100644 index dc1f884..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1695Test.php +++ /dev/null @@ -1,158 +0,0 @@ -_em->getConnection()->getDatabasePlatform()->getName() != "sqlite") { - $this->markTestSkipped("Only with sqlite"); - } - $dql = "SELECT n.smallText, n.publishDate FROM " . __NAMESPACE__ . "\\DDC1695News n"; - $sql = $this->_em->createQuery($dql)->getSQL(); - - $this->assertEquals( - 'SELECT d0_."SmallText" AS SmallText0, d0_."PublishDate" AS PublishDate1 FROM "DDC1695News" d0_', - $sql - ); - } -} - -/** - * @Table(name="`DDC1695News`") - * @Entity - */ -class DDC1695News -{ - /** - * @var integer $idNews - * - * @Column(name="`IdNews`", type="integer", nullable=false) - * @Id - * @GeneratedValue - */ - private $idNews; - - /** - * @var bigint $iduser - * - * @Column(name="`IdUser`", type="bigint", nullable=false) - */ - private $idUser; - - /** - * @var integer $idLanguage - * - * @Column(name="`IdLanguage`", type="integer", nullable=false) - */ - private $idLanguage; - - /** - * @var integer $idCondition - * - * @Column(name="`IdCondition`", type="integer", nullable=true) - */ - private $idCondition; - - /** - * @var integer $idHealthProvider - * - * @Column(name="`IdHealthProvider`", type="integer", nullable=true) - */ - private $idHealthProvider; - - /** - * @var integer $idSpeciality - * - * @Column(name="`IdSpeciality`", type="integer", nullable=true) - */ - private $idSpeciality; - - /** - * @var integer $idMedicineType - * - * @Column(name="`IdMedicineType`", type="integer", nullable=true) - */ - private $idMedicineType; - - /** - * @var integer $idTreatment - * - * @Column(name="`IdTreatment`", type="integer", nullable=true) - */ - private $idTreatment; - - /** - * @var string $title - * - * @Column(name="`Title`", type="string", nullable=true) - */ - private $title; - - /** - * @var string $smallText - * - * @Column(name="`SmallText`", type="string", nullable=true) - */ - private $smallText; - - /** - * @var string $longText - * - * @Column(name="`LongText`", type="string", nullable=true) - */ - private $longText; - - /** - * @var datetimetz $publishDate - * - * @Column(name="`PublishDate`", type="datetimetz", nullable=true) - */ - private $publishDate; - - /** - * @var tsvector $idxNews - * - * @Column(name="`IdxNews`", type="tsvector", nullable=true) - */ - private $idxNews; - - /** - * @var boolean $highlight - * - * @Column(name="`Highlight`", type="boolean", nullable=false) - */ - private $highlight; - - /** - * @var integer $order - * - * @Column(name="`Order`", type="integer", nullable=false) - */ - private $order; - - /** - * @var boolean $deleted - * - * @Column(name="`Deleted`", type="boolean", nullable=false) - */ - private $deleted; - - /** - * @var boolean $active - * - * @Column(name="`Active`", type="boolean", nullable=false) - */ - private $active; - - /** - * @var boolean $updateToHighlighted - * - * @Column(name="`UpdateToHighlighted`", type="boolean", nullable=true) - */ - private $updateToHighlighted; -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1778Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1778Test.php deleted file mode 100644 index aebc642..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1778Test.php +++ /dev/null @@ -1,74 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - - $this->user = new CmsUser(); - $this->user->username = "beberlei"; - $this->user->name = "Benjamin"; - $this->user->status = "active"; - - $this->phone = new CmsPhoneNumber(); - $this->phone->phonenumber = '0123456789'; - $this->user->addPhoneNumber($this->phone); - - $this->_em->persist($this->user); - $this->_em->persist($this->phone); - $this->_em->flush(); - $this->_em->clear(); - - $this->user = $this->_em->find('Doctrine\\Tests\\Models\\CMS\\CmsUser', $this->user->getId()); - $this->phone = $this->_em->find('Doctrine\\Tests\\Models\\CMS\\CmsPhonenumber', $this->phone->phonenumber); - } - - public function testClear() - { - $clonedNumbers = clone $this->user->getPhonenumbers(); - $clonedNumbers->clear(); - $this->_em->flush(); - $this->_em->clear(); - - $this->user = $this->_em->find('Doctrine\\Tests\\Models\\CMS\\CmsUser', $this->user->getId()); - - $this->assertCount(1, $this->user->getPhonenumbers()); - } - - public function testRemove() - { - $clonedNumbers = clone $this->user->getPhonenumbers(); - $clonedNumbers->remove(0); - $this->_em->flush(); - $this->_em->clear(); - - $this->user = $this->_em->find('Doctrine\\Tests\\Models\\CMS\\CmsUser', $this->user->getId()); - - $this->assertCount(1, $this->user->getPhonenumbers()); - } - - public function testRemoveElement() - { - $clonedNumbers = clone $this->user->getPhonenumbers(); - $clonedNumbers->removeElement($this->phone); - $this->_em->flush(); - $this->_em->clear(); - - $this->user = $this->_em->find('Doctrine\\Tests\\Models\\CMS\\CmsUser', $this->user->getId()); - - $this->assertCount(1, $this->user->getPhonenumbers()); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC192Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC192Test.php deleted file mode 100644 index 18eb769..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC192Test.php +++ /dev/null @@ -1,65 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC192User'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC192Phonenumber') - )); - } -} - - -/** - * @Entity @Table(name="ddc192_users") - */ -class DDC192User -{ - /** - * @Id @Column(name="id", type="integer") - * @GeneratedValue(strategy="AUTO") - */ - public $id; - - /** - * @Column(name="name", type="string") - */ - public $name; -} - - -/** - * @Entity @Table(name="ddc192_phonenumbers") - */ -class DDC192Phonenumber -{ - /** - * @Id @Column(name="phone", type="string", length=40) - */ - protected $phone; - - /** - * @Id - * @ManyToOne(targetEntity="DDC192User") - * @JoinColumn(name="userId", referencedColumnName="id") - */ - protected $User; - - - public function setPhone($value) { $this->phone = $value; } - - public function getPhone() { return $this->phone; } - - public function setUser(User $user) - { - $this->User = $user; - } - - public function getUser() { return $this->User; } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC199Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC199Test.php deleted file mode 100644 index 9084ec0..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC199Test.php +++ /dev/null @@ -1,100 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC199ParentClass'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC199ChildClass'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC199RelatedClass') - )); - } - - public function testPolymorphicLoading() - { - $child = new DDC199ChildClass; - $child->parentData = 'parentData'; - $child->childData = 'childData'; - $this->_em->persist($child); - - $related1 = new DDC199RelatedClass; - $related1->relatedData = 'related1'; - $related1->parent = $child; - $this->_em->persist($related1); - - $related2 = new DDC199RelatedClass; - $related2->relatedData = 'related2'; - $related2->parent = $child; - $this->_em->persist($related2); - - $this->_em->flush(); - $this->_em->clear(); - - $query = $this->_em->createQuery('select e,r from Doctrine\Tests\ORM\Functional\Ticket\DDC199ParentClass e join e.relatedEntities r'); - $result = $query->getResult(); - - $this->assertEquals(1, count($result)); - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Ticket\DDC199ParentClass', $result[0]); - $this->assertTrue($result[0]->relatedEntities->isInitialized()); - $this->assertEquals(2, $result[0]->relatedEntities->count()); - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Ticket\DDC199RelatedClass', $result[0]->relatedEntities[0]); - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Ticket\DDC199RelatedClass', $result[0]->relatedEntities[1]); - } -} - - -/** - * @Entity @Table(name="ddc199_entities") - * @InheritanceType("SINGLE_TABLE") - * @DiscriminatorColumn(name="discr", type="string") - * @DiscriminatorMap({"parent" = "DDC199ParentClass", "child" = "DDC199ChildClass"}) - */ -class DDC199ParentClass -{ - /** - * @Id @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - public $id; - - /** - * @Column(type="string") - */ - public $parentData; - - /** - * @OneToMany(targetEntity="DDC199RelatedClass", mappedBy="parent") - */ - public $relatedEntities; -} - - -/** @Entity */ -class DDC199ChildClass extends DDC199ParentClass -{ - /** - * @Column - */ - public $childData; -} - -/** @Entity @Table(name="ddc199_relatedclass") */ -class DDC199RelatedClass -{ - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; - /** @Column */ - public $relatedData; - - /** - * @ManyToOne(targetEntity="DDC199ParentClass", inversedBy="relatedEntities") - * @JoinColumn(name="parent_id", referencedColumnName="id") - */ - public $parent; -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC211Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC211Test.php deleted file mode 100644 index 6104c9c..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC211Test.php +++ /dev/null @@ -1,116 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC211User'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC211Group') - )); - } - - public function testIssue() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - - $user = new DDC211User; - $user->setName('John Doe'); - - $this->_em->persist($user); - $this->_em->flush(); - - $groupNames = array('group 1', 'group 2', 'group 3', 'group 4'); - foreach ($groupNames as $name) { - - $group = new DDC211Group; - $group->setName($name); - $this->_em->persist($group); - $this->_em->flush(); - - if (!$user->getGroups()->contains($group)) { - $user->getGroups()->add($group); - $group->getUsers()->add($user); - $this->_em->flush(); - } - } - - $this->assertEquals(4, $user->getGroups()->count()); - - } -} - - -/** - * @Entity - * @Table(name="ddc211_users") -*/ -class DDC211User -{ - /** - * @Id - * @Column(name="id", type="integer") - * @GeneratedValue(strategy="AUTO") - */ - protected $id; - - /** - * @Column(name="name", type="string") - */ - protected $name; - - /** - * @ManyToMany(targetEntity="DDC211Group", inversedBy="users") - * @JoinTable(name="user_groups", - * joinColumns={@JoinColumn(name="user_id", referencedColumnName="id")}, - * inverseJoinColumns={@JoinColumn(name="group_id", referencedColumnName="id")} - * ) - */ - protected $groups; - - public function __construct() { - $this->groups = new \Doctrine\Common\Collections\ArrayCollection(); - } - - public function setName($name) { $this->name = $name; } - - public function getGroups() { return $this->groups; } -} - -/** - * @Entity - * @Table(name="ddc211_groups") - */ -class DDC211Group -{ - /** - * @Id - * @Column(name="id", type="integer") - * @GeneratedValue(strategy="AUTO") - */ - protected $id; - - /** - * @Column(name="name", type="string") - */ - protected $name; - - /** - * @ManyToMany(targetEntity="DDC211User", mappedBy="groups") - */ - protected $users; - - public function __construct() { - $this->users = new \Doctrine\Common\Collections\ArrayCollection(); - } - - public function setName($name) { $this->name = $name; } - - public function getUsers() { return $this->users; } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC237Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC237Test.php deleted file mode 100644 index 413e564..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC237Test.php +++ /dev/null @@ -1,112 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC237EntityX'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC237EntityY'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC237EntityZ') - )); - } - - public function testUninitializedProxyIsInitializedOnFetchJoin() - { - $x = new DDC237EntityX; - $y = new DDC237EntityY; - $z = new DDC237EntityZ; - - $x->data = 'X'; - $y->data = 'Y'; - $z->data = 'Z'; - - $x->y = $y; - $z->y = $y; - - $this->_em->persist($x); - $this->_em->persist($y); - $this->_em->persist($z); - - $this->_em->flush(); - $this->_em->clear(); - - $x2 = $this->_em->find(get_class($x), $x->id); // proxy injected for Y - $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $x2->y); - $this->assertFalse($x2->y->__isInitialized__); - - // proxy for Y is in identity map - - $z2 = $this->_em->createQuery('select z,y from ' . get_class($z) . ' z join z.y y where z.id = ?1') - ->setParameter(1, $z->id) - ->getSingleResult(); - $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $z2->y); - $this->assertTrue($z2->y->__isInitialized__); - $this->assertEquals('Y', $z2->y->data); - $this->assertEquals($y->id, $z2->y->id); - - // since the Y is the same, the instance from the identity map is - // used, even if it is a proxy. - - $this->assertNotSame($x, $x2); - $this->assertNotSame($z, $z2); - $this->assertSame($z2->y, $x2->y); - $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $z2->y); - - } -} - - -/** - * @Entity @Table(name="ddc237_x") - */ -class DDC237EntityX -{ - /** - * @Id @Column(type="integer") @GeneratedValue - */ - public $id; - /** - * @Column(type="string") - */ - public $data; - /** - * @OneToOne(targetEntity="DDC237EntityY") - * @JoinColumn(name="y_id", referencedColumnName="id") - */ - public $y; -} - - -/** @Entity @Table(name="ddc237_y") */ -class DDC237EntityY -{ - /** - * @Id @Column(type="integer") @GeneratedValue - */ - public $id; - /** - * @Column(type="string") - */ - public $data; -} - -/** @Entity @Table(name="ddc237_z") */ -class DDC237EntityZ -{ - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; - /** @Column(type="string") */ - public $data; - - /** - * @OneToOne(targetEntity="DDC237EntityY") - * @JoinColumn(name="y_id", referencedColumnName="id") - */ - public $y; -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC258Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC258Test.php deleted file mode 100644 index 0d766ea..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC258Test.php +++ /dev/null @@ -1,142 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC258Super'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC258Class1'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC258Class2'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC258Class3'), - )); - } - - /** - * @group DDC-258 - */ - public function testIssue() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - - $c1 = new DDC258Class1(); - $c1->title = "Foo"; - $c1->description = "Foo"; - - $c2 = new DDC258Class2(); - $c2->title = "Bar"; - $c2->description = "Bar"; - $c2->text = "Bar"; - - $c3 = new DDC258Class3(); - $c3->apples = "Baz"; - $c3->bananas = "Baz"; - - $this->_em->persist($c1); - $this->_em->persist($c2); - $this->_em->persist($c3); - $this->_em->flush(); - $this->_em->clear(); - - $e2 = $this->_em->find('Doctrine\Tests\ORM\Functional\Ticket\DDC258Super', $c2->id); - - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Ticket\DDC258Class2', $e2); - $this->assertEquals('Bar', $e2->title); - $this->assertEquals('Bar', $e2->description); - $this->assertEquals('Bar', $e2->text); - - $all = $this->_em->getRepository(__NAMESPACE__.'\DDC258Super')->findAll(); - - foreach ($all as $obj) { - if ($obj instanceof DDC258Class1) { - $this->assertEquals('Foo', $obj->title); - $this->assertEquals('Foo', $obj->description); - } else if ($obj instanceof DDC258Class2) { - $this->assertTrue($e2 === $obj); - $this->assertEquals('Bar', $obj->title); - $this->assertEquals('Bar', $obj->description); - $this->assertEquals('Bar', $obj->text); - } else if ($obj instanceof DDC258Class3) { - $this->assertEquals('Baz', $obj->apples); - $this->assertEquals('Baz', $obj->bananas); - } else { - $this->fail('Instance of DDC258Class1, DDC258Class2 or DDC258Class3 expected.'); - } - } - } -} - -/** - * @Entity - * @Table(name="DDC258Super") - * @InheritanceType("JOINED") - * @DiscriminatorColumn(name="type", type="string") - * @DiscriminatorMap({"class1" = "DDC258Class1", "class2" = "DDC258Class2", "class3"="DDC258Class3"}) - */ -abstract class DDC258Super -{ - /** - * @Id @Column(name="id", type="integer") - * @GeneratedValue(strategy="AUTO") - */ - public $id; -} - -/** - * @Entity - */ -class DDC258Class1 extends DDC258Super -{ - /** - * @Column(name="title", type="string", length=150) - */ - public $title; - - /** - * @Column(name="content", type="string", length=500) - */ - public $description; -} - -/** - * @Entity - */ -class DDC258Class2 extends DDC258Super -{ - /** - * @Column(name="title", type="string", length=150) - */ - public $title; - - /** - * @Column(name="content", type="string", length=500) - */ - public $description; - - /** - * @Column(name="text", type="text") - */ - public $text; -} - -/** - * An extra class to demonstrate why title and description aren't in Super - * - * @Entity - */ -class DDC258Class3 extends DDC258Super -{ - /** - * @Column(name="title", type="string", length=150) - */ - public $apples; - - /** - * @Column(name="content", type="string", length=500) - */ - public $bananas; -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC279Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC279Test.php deleted file mode 100644 index 6d41ea8..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC279Test.php +++ /dev/null @@ -1,133 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC279EntityXAbstract'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC279EntityX'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC279EntityY'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC279EntityZ'), - )); - } - - /** - * @group DDC-279 - */ - public function testDDC279() - { - $x = new DDC279EntityX(); - $y = new DDC279EntityY(); - $z = new DDC279EntityZ(); - - $x->data = 'X'; - $y->data = 'Y'; - $z->data = 'Z'; - - $x->y = $y; - $y->z = $z; - - $this->_em->persist($x); - $this->_em->persist($y); - $this->_em->persist($z); - - $this->_em->flush(); - $this->_em->clear(); - - $query = $this->_em->createQuery( - 'SELECT x, y, z FROM Doctrine\Tests\ORM\Functional\Ticket\DDC279EntityX x '. - 'INNER JOIN x.y y INNER JOIN y.z z WHERE x.id = ?1' - )->setParameter(1, $x->id); - - $result = $query->getResult(); - - $expected1 = 'Y'; - $expected2 = 'Z'; - - $this->assertEquals(1, count($result)); - - $this->assertEquals($expected1, $result[0]->y->data); - $this->assertEquals($expected2, $result[0]->y->z->data); - } -} - - -/** - * @Entity - * @InheritanceType("JOINED") - * @DiscriminatorColumn(name="discr", type="string") - * @DiscriminatorMap({"DDC279EntityX" = "DDC279EntityX"}) - */ -abstract class DDC279EntityXAbstract -{ - /** - * @Id - * @GeneratedValue - * @Column(name="id", type="integer") - */ - public $id; - - /** - * @column(type="string") - */ - public $data; - -} - -/** - * @Entity - */ -class DDC279EntityX extends DDC279EntityXAbstract -{ - /** - * @OneToOne(targetEntity="DDC279EntityY") - * @JoinColumn(name="y_id", referencedColumnName="id") - */ - public $y; -} - -/** - * @Entity - */ -class DDC279EntityY -{ - /** - * @Id @GeneratedValue - * @Column(name="id", type="integer") - */ - public $id; - - /** - * @column(type="string") - */ - public $data; - - /** - * @OneToOne(targetEntity="DDC279EntityZ") - * @JoinColumn(name="z_id", referencedColumnName="id") - */ - public $z; -} - -/** - * @Entity - */ -class DDC279EntityZ -{ - /** - * @Id @GeneratedValue - * @Column(name="id", type="integer") - */ - public $id; - - /** - * @column(type="string") - */ - public $data; -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC309Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC309Test.php deleted file mode 100644 index 325ce8d..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC309Test.php +++ /dev/null @@ -1,73 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC309Country'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC309User'), - )); - } - - public function testTwoIterateHydrations() - { - $c1 = new DDC309Country(); - $c2 = new DDC309Country(); - $u1 = new DDC309User(); - $u2 = new DDC309User(); - - $this->_em->persist($c1); - $this->_em->persist($c2); - $this->_em->persist($u1); - $this->_em->persist($u2); - $this->_em->flush(); - $this->_em->clear(); - - $q = $this->_em->createQuery('SELECT c FROM Doctrine\Tests\ORM\Functional\Ticket\DDC309Country c')->iterate(); - $c = $q->next(); - - $this->assertEquals(1, $c[0]->id); - - $r = $this->_em->createQuery('SELECT u FROM Doctrine\Tests\ORM\Functional\Ticket\DDC309User u')->iterate(); - $u = $r->next(); // This line breaks - - $this->assertEquals(1, $u[0]->id); - - $c = $q->next(); - $u = $r->next(); - - $this->assertEquals(2, $c[0]->id); - $this->assertEquals(2, $u[0]->id); - } -} - -/** - * @Entity - */ -class DDC309Country -{ - /** - * @Id - * @Column(name="id", type="integer") - * @GeneratedValue - */ - public $id; -} - -/** - * @Entity - */ -class DDC309User -{ - /** - * @Id - * @Column(name="id", type="integer") - * @GeneratedValue - */ - public $id; -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC331Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC331Test.php deleted file mode 100644 index 2db32b9..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC331Test.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ -class DDC331Test extends \Doctrine\Tests\OrmFunctionalTestCase -{ - protected function setUp() { - $this->useModelSet('company'); - parent::setUp(); - } - - /** - * @group DDC-331 - */ - public function testSelectFieldOnRootEntity() - { - $q = $this->_em->createQuery('SELECT e.name FROM Doctrine\Tests\Models\Company\CompanyEmployee e'); - $this->assertEquals( - strtolower('SELECT c0_.name AS name0 FROM company_employees c1_ INNER JOIN company_persons c0_ ON c1_.id = c0_.id LEFT JOIN company_managers c2_ ON c1_.id = c2_.id'), - strtolower($q->getSql()) - ); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php deleted file mode 100644 index 757b5ab..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php +++ /dev/null @@ -1,157 +0,0 @@ -_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - $this->_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC345User'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC345Group'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC345Membership'), - )); - } - - public function testTwoIterateHydrations() - { - // Create User - $user = new DDC345User; - $user->name = 'Test User'; - $this->_em->persist($user); // $em->flush() does not change much here - - // Create Group - $group = new DDC345Group; - $group->name = 'Test Group'; - $this->_em->persist($group); // $em->flush() does not change much here - - $membership = new DDC345Membership; - $membership->group = $group; - $membership->user = $user; - $membership->state = 'active'; - - //$this->_em->persist($membership); // COMMENT OUT TO SEE BUG - /* - This should be not necessary, but without, its PrePersist is called twice, - $membership seems to be persisted twice, but all properties but the - ones set by LifecycleCallbacks are deleted. - */ - - $user->Memberships->add($membership); - $group->Memberships->add($membership); - - $this->_em->flush(); - - $this->assertEquals(1, $membership->prePersistCallCount); - $this->assertEquals(0, $membership->preUpdateCallCount); - $this->assertInstanceOf('DateTime', $membership->updated); - } -} - -/** - * @Entity - */ -class DDC345User -{ - /** - * @Id - * @Column(type="integer") - * @GeneratedValue - */ - public $id; - - /** @Column(type="string") */ - public $name; - - /** @OneToMany(targetEntity="DDC345Membership", mappedBy="user", cascade={"persist"}) */ - public $Memberships; - - public function __construct() - { - $this->Memberships = new \Doctrine\Common\Collections\ArrayCollection; - } -} - -/** - * @Entity - */ -class DDC345Group -{ - /** - * @Id - * @Column(type="integer") - * @GeneratedValue - */ - public $id; - - /** @Column(type="string") */ - public $name; - - /** @OneToMany(targetEntity="DDC345Membership", mappedBy="group", cascade={"persist"}) */ - public $Memberships; - - - public function __construct() - { - $this->Memberships = new \Doctrine\Common\Collections\ArrayCollection; - } -} - -/** - * @Entity - * @HasLifecycleCallbacks - * @Table(name="ddc345_memberships", uniqueConstraints={ - * @UniqueConstraint(name="ddc345_memship_fks", columns={"user_id","group_id"}) - * }) - */ -class DDC345Membership -{ - /** - * @Id - * @Column(type="integer") - * @GeneratedValue - */ - public $id; - - /** - * @OneToOne(targetEntity="DDC345User", inversedBy="Memberships") - * @JoinColumn(name="user_id", referencedColumnName="id", nullable=false) - */ - public $user; - - /** - * @OneToOne(targetEntity="DDC345Group", inversedBy="Memberships") - * @JoinColumn(name="group_id", referencedColumnName="id", nullable=false) - */ - public $group; - - /** @Column(type="string") */ - public $state; - - /** @Column(type="datetime") */ - public $updated; - - public $prePersistCallCount = 0; - public $preUpdateCallCount = 0; - - /** @PrePersist */ - public function doStuffOnPrePersist() - { - //echo "***** PrePersist\n"; - ++$this->prePersistCallCount; - $this->updated = new \DateTime; - } - - /** @PreUpdate */ - public function doStuffOnPreUpdate() - { - //echo "***** PreUpdate\n"; - ++$this->preUpdateCallCount; - $this->updated = new \DateTime; - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC353Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC353Test.php deleted file mode 100644 index df78359..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC353Test.php +++ /dev/null @@ -1,150 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC353File'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC353Picture'), - )); - } catch(\Exception $ignored) {} - } - - public function testWorkingCase() - { - $file = new DDC353File; - - $picture = new DDC353Picture; - $picture->setFile($file); - - $em = $this->_em; - $em->persist($picture); - $em->flush(); - $em->clear(); - - $fileId = $file->getFileId(); - $this->assertTrue($fileId > 0); - - $file = $em->getReference('Doctrine\Tests\ORM\Functional\Ticket\DDC353File', $fileId); - $this->assertEquals(UnitOfWork::STATE_MANAGED, $em->getUnitOfWork()->getEntityState($file), "Reference Proxy should be marked MANAGED."); - - $picture = $em->find('Doctrine\Tests\ORM\Functional\Ticket\DDC353Picture', $picture->getPictureId()); - $this->assertEquals(UnitOfWork::STATE_MANAGED, $em->getUnitOfWork()->getEntityState($picture->getFile()), "Lazy Proxy should be marked MANAGED."); - - $em->remove($picture); - $em->flush(); - } - - public function testFailingCase() - { - $file = new DDC353File; - - $picture = new DDC353Picture; - $picture->setFile($file); - - $em = $this->_em; - $em->persist($picture); - $em->flush(); - $em->clear(); - - $fileId = $file->getFileId(); - $pictureId = $picture->getPictureId(); - - $this->assertTrue($fileId > 0); - - $picture = $em->find('Doctrine\Tests\ORM\Functional\Ticket\DDC353Picture', $pictureId); - $this->assertEquals(UnitOfWork::STATE_MANAGED, $em->getUnitOfWork()->getEntityState($picture->getFile()), "Lazy Proxy should be marked MANAGED."); - - $em->remove($picture); - $em->flush(); - } -} - -/** - * @Entity - */ -class DDC353Picture -{ - /** - * @Column(name="picture_id", type="integer") - * @Id @GeneratedValue - */ - private $pictureId; - - /** - * @ManyToOne(targetEntity="DDC353File", cascade={"persist", "remove"}) - * @JoinColumns({ - * @JoinColumn(name="file_id", referencedColumnName="file_id") - * }) - */ - private $file; - - /** - * Get pictureId - */ - public function getPictureId() - { - return $this->pictureId; - } - - /** - * Set product - */ - public function setProduct($value) - { - $this->product = $value; - } - - /** - * Get product - */ - public function getProduct() - { - return $this->product; - } - - /** - * Set file - */ - public function setFile($value) - { - $this->file = $value; - } - - /** - * Get file - */ - public function getFile() - { - return $this->file; - } -} - -/** - * @Entity - */ -class DDC353File -{ - /** - * @Column(name="file_id", type="integer") - * @Id - * @GeneratedValue(strategy="AUTO") - */ - public $fileId; - - /** - * Get fileId - */ - public function getFileId() - { - return $this->fileId; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC371Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC371Test.php deleted file mode 100644 index 54f76b1..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC371Test.php +++ /dev/null @@ -1,69 +0,0 @@ -_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - $this->_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC371Parent'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC371Child') - )); - } - - public function testIssue() - { - $parent = new DDC371Parent; - $parent->data = 'parent'; - $parent->children = new \Doctrine\Common\Collections\ArrayCollection; - - $child = new DDC371Child; - $child->data = 'child'; - - $child->parent = $parent; - $parent->children->add($child); - - $this->_em->persist($parent); - $this->_em->persist($child); - - $this->_em->flush(); - $this->_em->clear(); - - $children = $this->_em->createQuery('select c,p from '.__NAMESPACE__.'\DDC371Child c ' - . 'left join c.parent p where c.id = 1 and p.id = 1') - ->setHint(Query::HINT_REFRESH, true) - ->getResult(); - - $this->assertEquals(1, count($children)); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $children[0]->parent); - $this->assertFalse($children[0]->parent->children->isInitialized()); - $this->assertEquals(0, $children[0]->parent->children->unwrap()->count()); - } -} - -/** @Entity */ -class DDC371Child { - /** @Id @Column(type="integer") @GeneratedValue */ - private $id; - /** @Column(type="string") */ - public $data; - /** @ManyToOne(targetEntity="DDC371Parent", inversedBy="children") @JoinColumn(name="parentId") */ - public $parent; -} - -/** @Entity */ -class DDC371Parent { - /** @Id @Column(type="integer") @GeneratedValue */ - private $id; - /** @Column(type="string") */ - public $data; - /** @OneToMany(targetEntity="DDC371Child", mappedBy="parent") */ - public $children; -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC381Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC381Test.php deleted file mode 100644 index 9b47bc8..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC381Test.php +++ /dev/null @@ -1,63 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC381Entity'), - )); - } catch(\Exception $e) { - - } - } - - public function testCallUnserializedProxyMethods() - { - $entity = new DDC381Entity(); - - $this->_em->persist($entity); - $this->_em->flush(); - $this->_em->clear(); - $persistedId = $entity->getId(); - - $entity = $this->_em->getReference('Doctrine\Tests\ORM\Functional\Ticket\DDC381Entity', $persistedId); - - // explicitly load proxy (getId() does not trigger reload of proxy) - $id = $entity->getOtherMethod(); - - $data = serialize($entity); - $entity = unserialize($data); - - $this->assertEquals($persistedId, $entity->getId()); - } -} - -/** - * @Entity - */ -class DDC381Entity -{ - /** - * @Id @Column(type="integer") @GeneratedValue - */ - protected $id; - - public function getId() - { - return $this->id; - } - - public function getOtherMethod() - { - - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC422Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC422Test.php deleted file mode 100644 index 3a6dbdb..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC422Test.php +++ /dev/null @@ -1,75 +0,0 @@ -_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - $this->_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC422Guest'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC422Customer'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC422Contact') - )); - } - - /** - * @group DDC-422 - */ - public function testIssue() - { - $customer = new DDC422Customer; - $this->_em->persist($customer); - $this->_em->flush(); - $this->_em->clear(); - - $customer = $this->_em->find(get_class($customer), $customer->id); - - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $customer->contacts); - $this->assertFalse($customer->contacts->isInitialized()); - $contact = new DDC422Contact; - $customer->contacts->add($contact); - $this->assertTrue($customer->contacts->isDirty()); - $this->assertFalse($customer->contacts->isInitialized()); - $this->_em->flush(); - - $this->assertEquals(1, $this->_em->getConnection()->fetchColumn("select count(*) from ddc422_customers_contacts")); - } -} - -/** - * @Entity - * @InheritanceType("JOINED") - * @DiscriminatorColumn(name="discr", type="string") - * @DiscriminatorMap({"guest" = "DDC422Guest", "customer" = "DDC422Customer"}) - */ -class DDC422Guest { - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; -} - -/** @Entity */ -class DDC422Customer extends DDC422Guest { - /** - * @ManyToMany(targetEntity="DDC422Contact", cascade={"persist","remove"}) - * @JoinTable(name="ddc422_customers_contacts", - * joinColumns={@JoinColumn(name="customer_id", referencedColumnName="id", onDelete="cascade" )}, - * inverseJoinColumns={@JoinColumn(name="contact_id", referencedColumnName="id", onDelete="cascade" )} - * ) - */ - public $contacts; - - public function __construct() { - $this->contacts = new \Doctrine\Common\Collections\ArrayCollection; - } -} - -/** @Entity */ -class DDC422Contact { - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC425Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC425Test.php deleted file mode 100644 index 084da56..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC425Test.php +++ /dev/null @@ -1,43 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC425Entity'), - //$this->_em->getClassMetadata(__NAMESPACE__ . '\DDC425Other') - )); - } - - /** - * @group DDC-425 - */ - public function testIssue() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - - $num = $this->_em->createQuery('DELETE '.__NAMESPACE__.'\DDC425Entity e WHERE e.someDatetimeField > ?1') - ->setParameter(1, new DateTime, Type::DATETIME) - ->getResult(); - $this->assertEquals(0, $num); - } -} - -/** @Entity */ -class DDC425Entity { - /** - * @Id @Column(type="integer") - * @GeneratedValue - */ - public $id; - - /** @Column(type="datetime") */ - public $someDatetimeField; -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php deleted file mode 100644 index 2b374a8..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php +++ /dev/null @@ -1,216 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\Ticket\DDC440Phone'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\Ticket\DDC440Client') - )); - } catch (\Exception $e) { - // Swallow all exceptions. We do not test the schema tool here. - } - } - - /** - * @group DDC-440 - */ - public function testOriginalEntityDataEmptyWhenProxyLoadedFromTwoAssociations() - { - - - /* The key of the problem is that the first phone is fetched via two association, main_phone and phones. - * - * You will notice that the original_entity_datas are not loaded for the first phone. (They are for the second) - * - * In the Client entity definition, if you define the main_phone relation after the phones relation, both assertions pass. - * (for the sake or this test, I defined the main_phone relation before the phones relation) - * - */ - - //Initialize some data - $client = new DDC440Client; - $client->setName('Client1'); - - $phone = new DDC440Phone; - $phone->setNumber('418 111-1111'); - $phone->setClient($client); - - $phone2 = new DDC440Phone; - $phone2->setNumber('418 222-2222'); - $phone2->setClient($client); - - $client->setMainPhone($phone); - - $this->_em->persist($client); - $this->_em->flush(); - $id = $client->getId(); - $this->_em->clear(); - - $uw = $this->_em->getUnitOfWork(); - $client = $this->_em->find('Doctrine\Tests\ORM\Functional\Ticket\DDC440Client', $id); - $clientPhones = $client->getPhones(); - $p1 = $clientPhones[0]; - $p2 = $clientPhones[1]; - - // Test the first phone. The assertion actually failed because original entity data is not set properly. - // This was because it is also set as MainPhone and that one is created as a proxy, not the - // original object when the find on Client is called. However loading proxies did not work correctly. - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Ticket\DDC440Phone', $p1); - $originalData = $uw->getOriginalEntityData($p1); - $this->assertEquals($phone->getNumber(), $originalData['number']); - - - //If you comment out previous test, this one should pass - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Ticket\DDC440Phone', $p2); - $originalData = $uw->getOriginalEntityData($p2); - $this->assertEquals($phone2->getNumber(), $originalData['number']); - } - -} - -/** - * @Entity - * @Table(name="phone") - */ -class DDC440Phone -{ - - /** - * @Column(name="id", type="integer") - * @Id - * @GeneratedValue(strategy="AUTO") - */ - protected $id; - /** - * @ManyToOne(targetEntity="DDC440Client",inversedBy="phones") - * @JoinColumns({ - * @JoinColumn(name="client_id", referencedColumnName="id") - * }) - */ - protected $client; - /** - * @Column(name="phonenumber", type="string") - */ - protected $number; - - public function setNumber($value) - { - $this->number = $value; - } - - public function getNumber() - { - return $this->number; - } - - public function setClient(DDC440Client $value, $update_inverse=true) - { - $this->client = $value; - if ($update_inverse) { - $value->addPhone($this); - } - } - - public function getClient() - { - return $this->client; - } - - public function getId() - { - return $this->id; - } - - public function setId($value) - { - $this->id = $value; - } - -} - -/** - * @Entity - * @Table(name="client") - */ -class DDC440Client -{ - - /** - * @Column(name="id", type="integer") - * @Id - * @GeneratedValue(strategy="AUTO") - */ - protected $id; - /** - * @OneToOne(targetEntity="DDC440Phone", fetch="EAGER") - * @JoinColumns({ - * @JoinColumn(name="main_phone_id", referencedColumnName="id",onDelete="SET NULL") - * }) - */ - protected $main_phone; - /** - * @OneToMany(targetEntity="DDC440Phone", mappedBy="client", cascade={"persist", "remove"}, fetch="EAGER") - * @orderBy({"number"="ASC"}) - */ - protected $phones; - /** - * @Column(name="name", type="string") - */ - protected $name; - - public function __construct() - { - - } - - public function setName($value) - { - $this->name = $value; - } - - public function getName() - { - return $this->name; - } - - public function addPhone(DDC440Phone $value) - { - $this->phones[] = $value; - $value->setClient($this, false); - } - - public function getPhones() - { - return $this->phones; - } - - public function setMainPhone(DDC440Phone $value) - { - $this->main_phone = $value; - } - - public function getMainPhone() - { - return $this->main_phone; - } - - public function getId() - { - return $this->id; - } - - public function setId($value) - { - $this->id = $value; - } - -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC444Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC444Test.php deleted file mode 100644 index d89e67a..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC444Test.php +++ /dev/null @@ -1,77 +0,0 @@ -_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - $this->_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC444User'), - )); - } - - public function testExplicitPolicy() - { - $classname = __NAMESPACE__ . "\DDC444User"; - - $u = new $classname; - $u->name = "Initial value"; - - $this->_em->persist($u); - $this->_em->flush(); - $this->_em->clear(); - - $q = $this->_em->createQuery("SELECT u FROM $classname u"); - $u = $q->getSingleResult(); - $this->assertEquals("Initial value", $u->name); - - $u->name = "Modified value"; - - // This should be NOOP as the change hasn't been persisted - $this->_em->flush(); - $this->_em->clear(); - - - $u = $this->_em->createQuery("SELECT u FROM $classname u"); - $u = $q->getSingleResult(); - - $this->assertEquals("Initial value", $u->name); - - - $u->name = "Modified value"; - $this->_em->persist($u); - // Now we however persisted it, and this should have updated our friend - $this->_em->flush(); - - $q = $this->_em->createQuery("SELECT u FROM $classname u"); - $u = $q->getSingleResult(); - - $this->assertEquals("Modified value", $u->name); - } -} - - -/** - * @Entity @Table(name="ddc444") - * @ChangeTrackingPolicy("DEFERRED_EXPLICIT") - */ -class DDC444User -{ - /** - * @Id @Column(name="id", type="integer") - * @GeneratedValue(strategy="AUTO") - */ - public $id; - - /** - * @Column(name="name", type="string") - */ - public $name; -} - - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC448Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC448Test.php deleted file mode 100644 index 4ea8308..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC448Test.php +++ /dev/null @@ -1,74 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC448MainTable'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC448ConnectedClass'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC448SubTable'), - )); - } - - public function testIssue() - { - $q = $this->_em->createQuery("select b from ".__NAMESPACE__."\\DDC448SubTable b where b.connectedClassId = ?1"); - $this->assertEquals( - strtolower('SELECT d0_.id AS id0, d0_.discr AS discr1, d0_.connectedClassId AS connectedClassId2 FROM SubTable s1_ INNER JOIN DDC448MainTable d0_ ON s1_.id = d0_.id WHERE d0_.connectedClassId = ?'), - strtolower($q->getSQL()) - ); - } -} - -/** - * @Entity - * @InheritanceType("JOINED") - * @DiscriminatorColumn(name="discr", type="smallint") - * @DiscriminatorMap({ - * "0" = "DDC448MainTable", - * "1" = "DDC448SubTable" - * }) - */ -class DDC448MainTable -{ - /** - * @Id - * @Column(name="id", type="integer") - * @GeneratedValue(strategy="AUTO") - */ - private $id; - - /** - * @ManyToOne(targetEntity="DDC448ConnectedClass", cascade={"all"}, fetch="EAGER") - * @JoinColumn(name="connectedClassId", referencedColumnName="id", onDelete="CASCADE", nullable=true) - */ - private $connectedClassId; -} - -/** - * @Entity - * @Table(name="connectedClass") - * @HasLifecycleCallbacks - */ -class DDC448ConnectedClass -{ - /** - * @Id - * @Column(name="id", type="integer") - * @GeneratedValue(strategy="AUTO") - */ - protected $id; // connected with DDC448MainTable -} - -/** - * @Entity - * @Table(name="SubTable") - */ -class DDC448SubTable extends DDC448MainTable -{ -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC493Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC493Test.php deleted file mode 100644 index 9e8d58b..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC493Test.php +++ /dev/null @@ -1,72 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC493Customer'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC493Distributor'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC493Contact') - )); - } - - public function testIssue() - { - $q = $this->_em->createQuery("select u, c.data from ".__NAMESPACE__."\\DDC493Distributor u JOIN u.contact c"); - $this->assertEquals( - strtolower('SELECT d0_.id AS id0, d1_.data AS data1, d0_.discr AS discr2, d0_.contact AS contact3 FROM DDC493Distributor d2_ INNER JOIN DDC493Customer d0_ ON d2_.id = d0_.id INNER JOIN DDC493Contact d1_ ON d0_.contact = d1_.id'), - strtolower($q->getSQL()) - ); - } -} - -/** - * @Entity - * @InheritanceType("JOINED") - * @DiscriminatorColumn(name="discr", type="string") - * @DiscriminatorMap({"distributor" = "DDC493Distributor", "customer" = "DDC493Customer"}) - */ -class DDC493Customer { - /** - * @Id - * @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - public $id; - /** - * @OneToOne(targetEntity="DDC493Contact", cascade={"remove","persist"}) - * @JoinColumn(name="contact", referencedColumnName="id") - */ - public $contact; - -} - -/** - * @Entity - */ -class DDC493Distributor extends DDC493Customer { -} - -/** - * @Entity - */ -class DDC493Contact -{ - /** - * @Id - * @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - public $id; - /** @Column(type="string") */ - public $data; -} - - - - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php deleted file mode 100644 index 22897ee..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php +++ /dev/null @@ -1,124 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - public function testMergeUnitializedManyToManyAndOneToManyCollections() - { - // Create User - $user = $this->createAndPersistUser(); - $this->_em->flush(); - - $this->assertTrue($this->_em->contains($user)); - $this->_em->clear(); - $this->assertFalse($this->_em->contains($user)); - - unset($user); - - // Reload User from DB *without* any associations (i.e. an uninitialized PersistantCollection) - $userReloaded = $this->loadUserFromEntityManager(); - - $this->assertTrue($this->_em->contains($userReloaded)); - $this->_em->clear(); - $this->assertFalse($this->_em->contains($userReloaded)); - - // freeze and unfreeze - $userClone = unserialize(serialize($userReloaded)); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $userClone); - - // detached user can't know about his phonenumbers - $this->assertEquals(0, count($userClone->getPhonenumbers())); - $this->assertFalse($userClone->getPhonenumbers()->isInitialized(), "User::phonenumbers should not be marked initialized."); - - // detached user can't know about his groups either - $this->assertEquals(0, count($userClone->getGroups())); - $this->assertFalse($userClone->getGroups()->isInitialized(), "User::groups should not be marked initialized."); - - // Merge back and flush - $userClone = $this->_em->merge($userClone); - - // Back in managed world I would expect to have my phonenumbers back but they aren't! - // Remember I didn't touch (and propably didn't need) them at all while in detached mode. - $this->assertEquals(4, count($userClone->getPhonenumbers()), 'Phonenumbers are not available anymore'); - - // This works fine as long as cmUser::groups doesn't cascade "merge" - $this->assertEquals(2, count($userClone->getGroups())); - - $this->_em->flush(); - $this->_em->clear(); - - $this->assertFalse($this->_em->contains($userClone)); - - // Reload user from DB - $userFromEntityManager = $this->loadUserFromEntityManager(); - - //Strange: Now the phonenumbers are back again - $this->assertEquals(4, count($userFromEntityManager->getPhonenumbers())); - - // This works fine as long as cmUser::groups doesn't cascade "merge" - // Otherwise group memberships are physically deleted now! - $this->assertEquals(2, count($userClone->getGroups())); - } - - protected function createAndPersistUser() - { - $user = new CmsUser(); - $user->name = 'Luka'; - $user->username = 'lukacho'; - $user->status = 'developer'; - - foreach(array(1111,2222,3333,4444) as $number) { - $phone = new CmsPhonenumber; - $phone->phonenumber = $number; - $user->addPhonenumber($phone); - } - - foreach(array('Moshers', 'Headbangers') as $groupName) { - $group = new CmsGroup; - $group->setName($groupName); - $user->addGroup($group); - } - - $this->_em->persist($user); - - return $user; - } - - /** - * @return Doctrine\Tests\Models\CMS\CmsUser - */ - protected function loadUserFromEntityManager() - { - return $this->_em - ->createQuery('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name like :name') - ->setParameter('name', 'Luka') - ->getSingleResult(); - } - -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC512Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC512Test.php deleted file mode 100644 index 97245ef..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC512Test.php +++ /dev/null @@ -1,94 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC512Customer'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC512OfferItem'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC512Item'), - )); - } - - public function testIssue() - { - $customer1 = new DDC512Customer(); - $item = new DDC512OfferItem(); - $customer1->item = $item; - $this->_em->persist($customer1); - - $customer2 = new DDC512Customer(); - $this->_em->persist($customer2); - - $this->_em->flush(); - $this->_em->clear(); - - $q = $this->_em->createQuery("select u,i from ".__NAMESPACE__."\\DDC512Customer u left join u.item i"); - $result = $q->getResult(); - - $this->assertEquals(2, count($result)); - $this->assertInstanceOf(__NAMESPACE__ . '\DDC512Customer', $result[0]); - $this->assertInstanceOf(__NAMESPACE__ . '\DDC512Customer', $result[1]); - if ($result[0]->id == $customer1->id) { - $this->assertInstanceOf(__NAMESPACE__ . '\DDC512OfferItem', $result[0]->item); - $this->assertEquals($item->id, $result[0]->item->id); - $this->assertNull($result[1]->item); - } else { - $this->assertInstanceOf(__NAMESPACE__ . '\DDC512OfferItem', $result[1]->item); - $this->assertNull($result[0]->item); - } - } -} - -/** - * @Entity - */ -class DDC512Customer { - /** - * @Id - * @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - public $id; - - /** - * NOTE that we can currently not name the join column the same as the field - * (item = item), this currently confuses Doctrine. - * - * @OneToOne(targetEntity="DDC512OfferItem", cascade={"remove","persist"}) - * @JoinColumn(name="item_id", referencedColumnName="id") - */ - public $item; -} - -/** - * @Entity - */ -class DDC512OfferItem extends DDC512Item -{ -} - -/** - * @Entity - * @InheritanceType("JOINED") - * @DiscriminatorColumn(name="discr", type="string") - * @DiscriminatorMap({"item" = "DDC512Item", "offerItem" = "DDC512OfferItem"}) - */ -class DDC512Item -{ - /** - * @Id - * @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - public $id; -} - - - - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC513Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC513Test.php deleted file mode 100644 index b71d674..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC513Test.php +++ /dev/null @@ -1,74 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC513OfferItem'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC513Item'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC513Price'), - )); - } - - public function testIssue() - { - $q = $this->_em->createQuery("select u from ".__NAMESPACE__."\\DDC513OfferItem u left join u.price p"); - $this->assertEquals( - strtolower('SELECT d0_.id AS id0, d0_.discr AS discr1, d0_.price AS price2 FROM DDC513OfferItem d1_ INNER JOIN DDC513Item d0_ ON d1_.id = d0_.id LEFT JOIN DDC513Price d2_ ON d0_.price = d2_.id'), - strtolower($q->getSQL()) - ); - } -} - -/** - * @Entity - */ -class DDC513OfferItem extends DDC513Item -{ -} - -/** - * @Entity - * @InheritanceType("JOINED") - * @DiscriminatorColumn(name="discr", type="string") - * @DiscriminatorMap({"item" = "DDC513Item", "offerItem" = "DDC513OfferItem"}) - */ -class DDC513Item -{ - /** - * @Id - * @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - public $id; - - /** - * @OneToOne(targetEntity="DDC513Price", cascade={"remove","persist"}) - * @JoinColumn(name="price", referencedColumnName="id") - */ - public $price; -} - -/** - * @Entity - */ -class DDC513Price { - /** - * @Id - * @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - public $id; - - /** @Column(type="string") */ - public $data; -} - - - - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC518Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC518Test.php deleted file mode 100644 index 2a34506..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC518Test.php +++ /dev/null @@ -1,36 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - public function testMergeWithRelatedNew() - { - $article = new \Doctrine\Tests\Models\CMS\CmsArticle(); - $article->text = "foo"; - $article->topic = "bar"; - - $this->_em->persist($article); - $this->_em->flush(); - $this->_em->detach($article); - $this->_em->clear(); - - $user = new \Doctrine\Tests\Models\CMS\CmsUser(); - $user->username = "beberlei"; - $user->name = "Benjamin Eberlei"; - $user->status = "active"; - $article->user = $user; - - $this->_em->persist($user); - $managedArticle = $this->_em->merge($article); - - $this->assertSame($article->user, $managedArticle->user); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC522Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC522Test.php deleted file mode 100644 index f029e95..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC522Test.php +++ /dev/null @@ -1,121 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC522Customer'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC522Cart'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC522ForeignKeyTest') - )); - } catch(\Exception $e) { - - } - } - - /** - * @group DDC-522 - */ - public function testJoinColumnWithSameNameAsAssociationField() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - - $cust = new DDC522Customer; - $cust->name = "name"; - $cart = new DDC522Cart; - $cart->total = 0; - $cust->cart = $cart; - $cart->customer = $cust; - $this->_em->persist($cust); - $this->_em->persist($cart); - $this->_em->flush(); - - $this->_em->clear(); - - $r = $this->_em->createQuery("select ca,c from ".get_class($cart)." ca join ca.customer c") - ->getResult(); - - $this->assertInstanceOf(__NAMESPACE__ . '\DDC522Cart', $r[0]); - $this->assertInstanceOf(__NAMESPACE__ . '\DDC522Customer', $r[0]->customer); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $r[0]->customer); - $this->assertEquals('name', $r[0]->customer->name); - - $fkt = new DDC522ForeignKeyTest(); - $fkt->cartId = $r[0]->id; // ignored for persistence - $fkt->cart = $r[0]; // must be set properly - $this->_em->persist($fkt); - $this->_em->flush(); - $this->_em->clear(); - - $fkt2 = $this->_em->find(get_class($fkt), $fkt->id); - $this->assertEquals($fkt->cart->id, $fkt2->cartId); - $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $fkt2->cart); - $this->assertFalse($fkt2->cart->__isInitialized__); - } - - /** - * @group DDC-522 - * @group DDC-762 - */ - public function testJoinColumnWithNullSameNameAssociationField() - { - $fkCust = new DDC522ForeignKeyTest; - $fkCust->name = "name"; - $fkCust->cart = null; - - $this->_em->persist($fkCust); - $this->_em->flush(); - $this->_em->clear(); - - $newCust = $this->_em->find(get_class($fkCust), $fkCust->id); - } -} - -/** @Entity */ -class DDC522Customer { - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; - /** @Column */ - public $name; - /** @OneToOne(targetEntity="DDC522Cart", mappedBy="customer") */ - public $cart; -} - -/** @Entity */ -class DDC522Cart { - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; - /** @Column(type="integer") */ - public $total; - /** - * @OneToOne(targetEntity="DDC522Customer", inversedBy="cart") - * @JoinColumn(name="customer", referencedColumnName="id") - */ - public $customer; -} - -/** @Entity */ -class DDC522ForeignKeyTest { - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; - /** @Column(type="integer", name="cart_id", nullable=true) */ - public $cartId; - /** - * @OneToOne(targetEntity="DDC522Cart") - * @JoinColumn(name="cart_id", referencedColumnName="id") - */ - public $cart; -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC531Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC531Test.php deleted file mode 100644 index 5e22c2c..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC531Test.php +++ /dev/null @@ -1,88 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC531Item'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC531SubItem'), - )); - } - - public function testIssue() - { - $item1 = new DDC531Item; - $item2 = new DDC531Item; - $item2->parent = $item1; - $item1->getChildren()->add($item2); - $this->_em->persist($item1); - $this->_em->persist($item2); - $this->_em->flush(); - $this->_em->clear(); - - $item3 = $this->_em->find(__NAMESPACE__ . '\DDC531Item', $item2->id); // Load child item first (id 2) - // parent will already be loaded, cannot be lazy because it has mapped subclasses and we would not - // know which proxy type to put in. - $this->assertInstanceOf(__NAMESPACE__ . '\DDC531Item', $item3->parent); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $item3->parent); - $item4 = $this->_em->find(__NAMESPACE__ . '\DDC531Item', $item1->id); // Load parent item (id 1) - $this->assertNull($item4->parent); - $this->assertNotNull($item4->getChildren()); - $this->assertTrue($item4->getChildren()->contains($item3)); // lazy-loads children - } -} - -/** - * @Entity - * @InheritanceType("SINGLE_TABLE") - * @DiscriminatorColumn(name="type", type="integer") - * @DiscriminatorMap({"0" = "DDC531Item", "1" = "DDC531SubItem"}) - */ -class DDC531Item -{ - /** - * @Id - * @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - public $id; - - /** - * @OneToMany(targetEntity="DDC531Item", mappedBy="parent") - */ - protected $children; - - /** - * @ManyToOne(targetEntity="DDC531Item", inversedBy="children") - * @JoinColumn(name="parentId", referencedColumnName="id") - */ - public $parent; - - public function __construct() - { - $this->children = new \Doctrine\Common\Collections\ArrayCollection; - } - - public function getParent() - { - return $this->parent; - } - - public function getChildren() - { - return $this->children; - } -} - -/** - * @Entity - */ -class DDC531SubItem extends DDC531Item -{ -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php deleted file mode 100644 index 3f899d7..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php +++ /dev/null @@ -1,48 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC588Site'), - )); - } - - public function testIssue() - { - $site = new DDC588Site('Foo'); - - $this->_em->persist($site); - $this->_em->flush(); - // Following should not result in exception - $this->_em->refresh($site); - } -} - -/** - * @Entity - */ -class DDC588Site -{ - /** - * @Id - * @Column(type="integer", name="site_id") - * @GeneratedValue - */ - public $id; - - /** - * @Column(type="string", length=45) - */ - protected $name = null; - - public function __construct($name = '') - { - $this->name = $name; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC599Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC599Test.php deleted file mode 100644 index b342796..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC599Test.php +++ /dev/null @@ -1,132 +0,0 @@ -_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - try { - $this->_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC599Item'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC599Subitem'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC599Child'), - )); - } catch (\Exception $ignored) {} - } - - public function testCascadeRemoveOnInheritanceHierachy() - { - $item = new DDC599Subitem; - $item->elem = "foo"; - $child = new DDC599Child; - $child->parent = $item; - $item->getChildren()->add($child); - $this->_em->persist($item); - $this->_em->persist($child); - $this->_em->flush(); - $this->_em->clear(); - - $item = $this->_em->find(__NAMESPACE__ . '\DDC599Item', $item->id); - - $this->_em->remove($item); - $this->_em->flush(); // Should not fail - - $this->assertFalse($this->_em->contains($item)); - $children = $item->getChildren(); - $this->assertFalse($this->_em->contains($children[0])); - - $this->_em->clear(); - - - $item2 = new DDC599Subitem; - $item2->elem = "bar"; - $this->_em->persist($item2); - $this->_em->flush(); - - $child2 = new DDC599Child; - $child2->parent = $item2; - $item2->getChildren()->add($child2); - $this->_em->persist($child2); - $this->_em->flush(); - - $this->_em->remove($item2); - $this->_em->flush(); // should not fail - - $this->assertFalse($this->_em->contains($item)); - $children = $item->getChildren(); - $this->assertFalse($this->_em->contains($children[0])); - } - - public function testCascadeRemoveOnChildren() - { - $class = $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC599Subitem'); - - $this->assertArrayHasKey('children', $class->associationMappings); - $this->assertTrue($class->associationMappings['children']['isCascadeRemove']); - } -} - -/** - * @Entity - * @InheritanceType("SINGLE_TABLE") - * @DiscriminatorColumn(name="type", type="integer") - * @DiscriminatorMap({"0" = "DDC599Item", "1" = "DDC599Subitem"}) - */ -class DDC599Item -{ - /** - * @Id - * @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - public $id; - - /** - * @OneToMany(targetEntity="DDC599Child", mappedBy="parent", cascade={"remove"}) - */ - protected $children; - - public function __construct() - { - $this->children = new \Doctrine\Common\Collections\ArrayCollection; - } - - public function getChildren() - { - return $this->children; - } -} - -/** - * @Entity - */ -class DDC599Subitem extends DDC599Item -{ - /** - * @Column(type="string") - */ - public $elem; -} - -/** - * @Entity - */ -class DDC599Child -{ - /** - * @Id - * @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - public $id; - - /** - * @ManyToOne(targetEntity="DDC599Item", inversedBy="children") - * @JoinColumn(name="parentId", referencedColumnName="id") - */ - public $parent; -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC618Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC618Test.php deleted file mode 100644 index b51ed39..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC618Test.php +++ /dev/null @@ -1,185 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC618Author'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC618Book') - )); - - // Create author 10/Joe with two books 22/JoeA and 20/JoeB - $author = new DDC618Author(); - $author->id = 10; - $author->name = 'Joe'; - $this->_em->persist($author); - - // Create author 11/Alice with two books 21/AliceA and 23/AliceB - $author = new DDC618Author(); - $author->id = 11; - $author->name = 'Alice'; - $author->addBook('In Wonderland'); - $author->addBook('Reloaded'); - $author->addBook('Test'); - - $this->_em->persist($author); - - $this->_em->flush(); - $this->_em->clear(); - } catch(\Exception $e) { - - } - } - - public function testIndexByHydrateObject() - { - $dql = 'SELECT A FROM Doctrine\Tests\ORM\Functional\Ticket\DDC618Author A INDEX BY A.name ORDER BY A.name ASC'; - $result = $this->_em->createQuery($dql)->getResult(\Doctrine\ORM\Query::HYDRATE_OBJECT); - - $joe = $this->_em->find('Doctrine\Tests\ORM\Functional\Ticket\DDC618Author', 10); - $alice = $this->_em->find('Doctrine\Tests\ORM\Functional\Ticket\DDC618Author', 11); - - $this->assertArrayHasKey('Joe', $result, "INDEX BY A.name should return an index by the name of 'Joe'."); - $this->assertArrayHasKey('Alice', $result, "INDEX BY A.name should return an index by the name of 'Alice'."); - } - - public function testIndexByHydrateArray() - { - $dql = 'SELECT A FROM Doctrine\Tests\ORM\Functional\Ticket\DDC618Author A INDEX BY A.name ORDER BY A.name ASC'; - $result = $this->_em->createQuery($dql)->getResult(\Doctrine\ORM\Query::HYDRATE_ARRAY); - - $joe = $this->_em->find('Doctrine\Tests\ORM\Functional\Ticket\DDC618Author', 10); - $alice = $this->_em->find('Doctrine\Tests\ORM\Functional\Ticket\DDC618Author', 11); - - $this->assertArrayHasKey('Joe', $result, "INDEX BY A.name should return an index by the name of 'Joe'."); - $this->assertArrayHasKey('Alice', $result, "INDEX BY A.name should return an index by the name of 'Alice'."); - } - - /** - * @group DDC-1018 - */ - public function testIndexByJoin() - { - $dql = 'SELECT A, B FROM Doctrine\Tests\ORM\Functional\Ticket\DDC618Author A '. - 'INNER JOIN A.books B INDEX BY B.title ORDER BY A.name ASC'; - $result = $this->_em->createQuery($dql)->getResult(\Doctrine\ORM\Query::HYDRATE_OBJECT); - - $this->assertEquals(3, count($result[0]->books)); // Alice, Joe doesnt appear because he has no books. - $this->assertEquals('Alice', $result[0]->name); - $this->assertTrue( isset($result[0]->books["In Wonderland"] ), "Indexing by title should have books by title."); - $this->assertTrue( isset($result[0]->books["Reloaded"] ), "Indexing by title should have books by title."); - $this->assertTrue( isset($result[0]->books["Test"] ), "Indexing by title should have books by title."); - - $result = $this->_em->createQuery($dql)->getResult(\Doctrine\ORM\Query::HYDRATE_ARRAY); - - $this->assertEquals(3, count($result[0]['books'])); // Alice, Joe doesnt appear because he has no books. - $this->assertEquals('Alice', $result[0]['name']); - $this->assertTrue( isset($result[0]['books']["In Wonderland"] ), "Indexing by title should have books by title."); - $this->assertTrue( isset($result[0]['books']["Reloaded"] ), "Indexing by title should have books by title."); - $this->assertTrue( isset($result[0]['books']["Test"] ), "Indexing by title should have books by title."); - } - - /** - * @group DDC-1018 - */ - public function testIndexByToOneJoinSilentlyIgnored() - { - $dql = 'SELECT B, A FROM Doctrine\Tests\ORM\Functional\Ticket\DDC618Book B '. - 'INNER JOIN B.author A INDEX BY A.name ORDER BY A.name ASC'; - $result = $this->_em->createQuery($dql)->getResult(\Doctrine\ORM\Query::HYDRATE_OBJECT); - - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Ticket\DDC618Book', $result[0]); - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Ticket\DDC618Author', $result[0]->author); - - $dql = 'SELECT B, A FROM Doctrine\Tests\ORM\Functional\Ticket\DDC618Book B '. - 'INNER JOIN B.author A INDEX BY A.name ORDER BY A.name ASC'; - $result = $this->_em->createQuery($dql)->getResult(\Doctrine\ORM\Query::HYDRATE_ARRAY); - - $this->assertEquals("Alice", $result[0]['author']['name']); - } - - /** - * @group DDC-1018 - */ - public function testCombineIndexBy() - { - $dql = 'SELECT A, B FROM Doctrine\Tests\ORM\Functional\Ticket\DDC618Author A INDEX BY A.id '. - 'INNER JOIN A.books B INDEX BY B.title ORDER BY A.name ASC'; - $result = $this->_em->createQuery($dql)->getResult(\Doctrine\ORM\Query::HYDRATE_OBJECT); - - $this->assertArrayHasKey(11, $result); // Alice - - $this->assertEquals(3, count($result[11]->books)); // Alice, Joe doesnt appear because he has no books. - $this->assertEquals('Alice', $result[11]->name); - $this->assertTrue( isset($result[11]->books["In Wonderland"] ), "Indexing by title should have books by title."); - $this->assertTrue( isset($result[11]->books["Reloaded"] ), "Indexing by title should have books by title."); - $this->assertTrue( isset($result[11]->books["Test"] ), "Indexing by title should have books by title."); - } -} - -/** - * @Entity - */ -class DDC618Author -{ - /** - * @Id - * @Column(type="integer") - */ - public $id; - - /** @Column(type="string") */ - public $name; - - /** - * @OneToMany(targetEntity="DDC618Book", mappedBy="author", cascade={"persist"}) - */ - public $books; - - public function __construct() - { - $this->books = new \Doctrine\Common\Collections\ArrayCollection; - } - - public function addBook($title) - { - $book = new DDC618Book($title, $this); - $this->books[] = $book; - } -} - -/** - * @Entity - */ -class DDC618Book -{ - /** - * @Id @GeneratedValue - * @Column(type="integer") - */ - public $id; - - /** @column(type="string") */ - public $title; - - /** @ManyToOne(targetEntity="DDC618Author", inversedBy="books") */ - public $author; - - function __construct($title, $author) - { - $this->title = $title; - $this->author = $author; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC633Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC633Test.php deleted file mode 100644 index 2ec4383..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC633Test.php +++ /dev/null @@ -1,102 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC633Patient'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC633Appointment'), - )); - } catch(\Exception $e) { - - } - } - - /** - * @group DDC-633 - * @group DDC-952 - * @group DDC-914 - */ - public function testOneToOneEager() - { - $app = new DDC633Appointment(); - $pat = new DDC633Patient(); - $app->patient = $pat; - $pat->appointment = $app; - - $this->_em->persist($app); - $this->_em->persist($pat); - $this->_em->flush(); - $this->_em->clear(); - - $eagerAppointment = $this->_em->find(__NAMESPACE__ . '\DDC633Appointment', $app->id); - - // Eager loading of one to one leads to fetch-join - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $eagerAppointment->patient); - $this->assertTrue($this->_em->contains($eagerAppointment->patient)); - } - - /** - * @group DDC-633 - * @group DDC-952 - */ - public function testDQLDeferredEagerLoad() - { - for ($i = 0; $i < 10; $i++) { - $app = new DDC633Appointment(); - $pat = new DDC633Patient(); - $app->patient = $pat; - $pat->appointment = $app; - - $this->_em->persist($app); - $this->_em->persist($pat); - } - $this->_em->flush(); - $this->_em->clear(); - - $appointments = $this->_em->createQuery("SELECT a FROM " . __NAMESPACE__ . "\DDC633Appointment a")->getResult(); - - foreach ($appointments AS $eagerAppointment) { - $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $eagerAppointment->patient); - $this->assertTrue($eagerAppointment->patient->__isInitialized__, "Proxy should already be initialized due to eager loading!"); - } - } -} - -/** - * @Entity - */ -class DDC633Appointment -{ - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; - - /** - * @OneToOne(targetEntity="DDC633Patient", inversedBy="appointment", fetch="EAGER") - */ - public $patient; - -} - -/** - * @Entity - */ -class DDC633Patient -{ - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; - - /** - * @OneToOne(targetEntity="DDC633Appointment", mappedBy="patient") - */ - public $appointment; -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC656Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC656Test.php deleted file mode 100644 index f2bbc2a..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC656Test.php +++ /dev/null @@ -1,82 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC656Entity') - )); - } catch(\Exception $e) { - - } - } - - public function testRecomputeSingleEntityChangeSet_PreservesFieldOrder() - { - $entity = new DDC656Entity(); - $entity->setName('test1'); - $entity->setType('type1'); - $this->_em->persist($entity); - - $this->_em->getUnitOfWork()->computeChangeSet($this->_em->getClassMetadata(get_class($entity)), $entity); - $data1 = $this->_em->getUnitOfWork()->getEntityChangeset($entity); - $entity->setType('type2'); - $this->_em->getUnitOfWork()->recomputeSingleEntityChangeSet($this->_em->getClassMetadata(get_class($entity)), $entity); - $data2 = $this->_em->getUnitOfWork()->getEntityChangeset($entity); - - $this->assertEquals(array_keys($data1), array_keys($data2)); - - $this->_em->flush(); - $this->_em->clear(); - - $persistedEntity = $this->_em->find(get_class($entity), $entity->specificationId); - $this->assertEquals('type2', $persistedEntity->getType()); - $this->assertEquals('test1', $persistedEntity->getName()); - } -} - -/** - * @Entity - */ -class DDC656Entity -{ - /** - * @Column(type="string") - */ - public $name; - - /** - * @Column(type="string") - */ - public $type; - - /** - * @Id @Column(type="integer") @GeneratedValue - */ - public $specificationId; - - public function getName() { - return $this->name; - } - - public function setName($name) { - $this->name = $name; - } - - public function getType() { - return $this->type; - } - - public function setType($type) { - $this->type = $type; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC657Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC657Test.php deleted file mode 100644 index cf3e5bd..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC657Test.php +++ /dev/null @@ -1,118 +0,0 @@ -useModelSet('generic'); - parent::setUp(); - - $this->loadFixtures(); - } - - public function testEntitySingleResult() - { - $query = $this->_em->createQuery('SELECT d FROM ' . self::NS . '\DateTimeModel d'); - $datetime = $query->setMaxResults(1)->getSingleResult(); - - $this->assertTrue($datetime instanceof DateTimeModel); - - $this->assertTrue($datetime->datetime instanceof \DateTime); - $this->assertTrue($datetime->time instanceof \DateTime); - $this->assertTrue($datetime->date instanceof \DateTime); - } - - public function testScalarResult() - { - $query = $this->_em->createQuery('SELECT d.id, d.time, d.date, d.datetime FROM ' . self::NS . '\DateTimeModel d ORDER BY d.date ASC'); - $result = $query->getScalarResult(); - - $this->assertCount(2,$result); - - $this->assertContains('11:11:11', $result[0]['time']); - $this->assertContains('2010-01-01', $result[0]['date']); - $this->assertContains('2010-01-01 11:11:11', $result[0]['datetime']); - - $this->assertContains('12:12:12', $result[1]['time']); - $this->assertContains('2010-02-02', $result[1]['date']); - $this->assertContains('2010-02-02 12:12:12', $result[1]['datetime']); - } - - public function testaTicketEntityArrayResult() - { - $query = $this->_em->createQuery('SELECT d FROM ' . self::NS . '\DateTimeModel d ORDER BY d.date ASC'); - $result = $query->getArrayResult(); - - $this->assertCount(2,$result); - - $this->assertTrue($result[0]['datetime'] instanceof \DateTime); - $this->assertTrue($result[0]['time'] instanceof \DateTime); - $this->assertTrue($result[0]['date'] instanceof \DateTime); - - $this->assertTrue($result[1]['datetime'] instanceof \DateTime); - $this->assertTrue($result[1]['time'] instanceof \DateTime); - $this->assertTrue($result[1]['date'] instanceof \DateTime); - } - - public function testTicketSingleResult() - { - $query = $this->_em->createQuery('SELECT d.id, d.time, d.date, d.datetime FROM ' . self::NS . '\DateTimeModel d ORDER BY d.date ASC'); - $datetime = $query->setMaxResults(1)->getSingleResult(); - - $this->assertTrue(is_array($datetime)); - - $this->assertTrue($datetime['datetime'] instanceof \DateTime); - $this->assertTrue($datetime['time'] instanceof \DateTime); - $this->assertTrue($datetime['date'] instanceof \DateTime); - } - - public function testTicketResult() - { - $query = $this->_em->createQuery('SELECT d.id, d.time, d.date, d.datetime FROM ' . self::NS . '\DateTimeModel d ORDER BY d.date ASC'); - $result = $query->getResult(); - - $this->assertCount(2,$result); - - $this->assertTrue($result[0]['time'] instanceof \DateTime); - $this->assertTrue($result[0]['date'] instanceof \DateTime); - $this->assertTrue($result[0]['datetime'] instanceof \DateTime); - $this->assertEquals('2010-01-01 11:11:11', $result[0]['datetime']->format('Y-m-d G:i:s')); - - $this->assertTrue($result[1]['time'] instanceof \DateTime); - $this->assertTrue($result[1]['date'] instanceof \DateTime); - $this->assertTrue($result[1]['datetime'] instanceof \DateTime); - $this->assertEquals('2010-02-02 12:12:12', $result[1]['datetime']->format('Y-m-d G:i:s')); - } - - public function loadFixtures() - { - $timezone = new \DateTimeZone('America/Sao_Paulo'); - - $dateTime1 = new DateTimeModel(); - $dateTime2 = new DateTimeModel(); - - $dateTime1->date = new \DateTime('2010-01-01', $timezone); - $dateTime1->time = new \DateTime('2010-01-01 11:11:11', $timezone); - $dateTime1->datetime= new \DateTime('2010-01-01 11:11:11', $timezone); - - $dateTime2->date = new \DateTime('2010-02-02', $timezone); - $dateTime2->time = new \DateTime('2010-02-02 12:12:12', $timezone); - $dateTime2->datetime= new \DateTime('2010-02-02 12:12:12', $timezone); - - $this->_em->persist($dateTime1); - $this->_em->persist($dateTime2); - - $this->_em->flush(); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC698Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC698Test.php deleted file mode 100644 index 4786cc1..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC698Test.php +++ /dev/null @@ -1,107 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC698Role'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC698Privilege') - )); - } catch(\Exception $e) { - - } - } - - public function testTicket() - { - $qb = $this->_em->createQueryBuilder(); - $qb->select('p', 'r') - ->from(__NAMESPACE__ . '\DDC698Privilege', 'p') - ->leftJoin('p.roles', 'r'); - - $sql = $qb->getQuery()->getSQL(); - - $this->assertEquals( - strtolower('SELECT p0_.privilegeID AS privilegeID0, p0_.name AS name1, r1_.roleID AS roleID2, r1_.name AS name3, r1_.shortName AS shortName4 FROM Privileges p0_ LEFT JOIN RolePrivileges r2_ ON p0_.privilegeID = r2_.privilegeID LEFT JOIN Roles r1_ ON r1_.roleID = r2_.roleID'), - strtolower($sql) - ); - } -} - -/** - * - * @Table(name="Roles") - * @Entity - */ -class DDC698Role -{ - /** - * @Id @Column(name="roleID", type="integer") - * @GeneratedValue(strategy="AUTO") - * - */ - protected $roleID; - - /** - * @Column(name="name", type="string", length=45) - * - * - */ - protected $name; - - /** - * @Column(name="shortName", type="string", length=45) - * - * - */ - protected $shortName; - - - - /** - * @ManyToMany(targetEntity="DDC698Privilege", inversedBy="roles") - * @JoinTable(name="RolePrivileges", - * joinColumns={@JoinColumn(name="roleID", referencedColumnName="roleID")}, - * inverseJoinColumns={@JoinColumn(name="privilegeID", referencedColumnName="privilegeID")} - * ) - */ - protected $privilege; - -} - - -/** - * - * @Table(name="Privileges") - * @Entity() - */ -class DDC698Privilege -{ - /** - * @Id @Column(name="privilegeID", type="integer") - * @GeneratedValue(strategy="AUTO") - * - */ - protected $privilegeID; - - /** - * @Column(name="name", type="string", length=45) - * - * - */ - protected $name; - - /** - * @ManyToMany(targetEntity="DDC698Role", mappedBy="privilege") - */ - protected $roles; -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC719Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC719Test.php deleted file mode 100644 index 6bd18ef..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC719Test.php +++ /dev/null @@ -1,112 +0,0 @@ -_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - $this->_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC719Group'), - )); - } - - public function testIsEmptySqlGeneration() - { - $q = $this->_em->createQuery('SELECT g, c FROM Doctrine\Tests\ORM\Functional\Ticket\DDC719Group g LEFT JOIN g.children c WHERE g.parents IS EMPTY'); - - $this->assertEquals( - strtolower('SELECT g0_.name AS name0, g0_.description AS description1, g0_.id AS id2, g1_.name AS name3, g1_.description AS description4, g1_.id AS id5 FROM groups g0_ LEFT JOIN groups_groups g2_ ON g0_.id = g2_.parent_id LEFT JOIN groups g1_ ON g1_.id = g2_.child_id WHERE (SELECT COUNT(*) FROM groups_groups g3_ WHERE g3_.child_id = g0_.id) = 0'), - strtolower($q->getSQL()) - ); - } -} - -/** - * @MappedSuperclass - */ -class Entity -{ - /** - * @Id @GeneratedValue - * @Column(type="integer") - */ - protected $id; - - public function getId() { return $this->id; } -} - -/** - * @Entity - * @Table(name="groups") - */ -class DDC719Group extends Entity { - /** @Column(type="string", nullable=false) */ - protected $name; - - /** @Column(type="string", nullable=true) */ - protected $description; - - /** - * @ManyToMany(targetEntity="DDC719Group", inversedBy="parents") - * @JoinTable(name="groups_groups", - * joinColumns={@JoinColumn(name="parent_id", referencedColumnName="id")}, - * inverseJoinColumns={@JoinColumn(name="child_id", referencedColumnName="id")} - * ) - */ - protected $children = NULL; - - /** - * @ManyToMany(targetEntity="DDC719Group", mappedBy="children") - */ - protected $parents = NULL; - - /** - * construct - */ - public function __construct() { - parent::__construct(); - - $this->channels = new ArrayCollection(); - $this->children = new ArrayCollection(); - $this->parents = new ArrayCollection(); - } - - /** - * adds group as new child - * - * @param Group $child - */ - public function addGroup(Group $child) { - if ( ! $this->children->contains($child)) { - $this->children->add($child); - $child->addGroup($this); - } - } - - /** - * adds channel as new child - * - * @param Channel $child - */ - public function addChannel(Channel $child) { - if ( ! $this->channels->contains($child)) { - $this->channels->add($child); - } - } - - /** - * getter & setter - */ - public function getName() { return $this->name; } - public function setName($name) { $this->name = $name; } - public function getDescription() { return $this->description; } - public function setDescription($description) { $this->description = $description; } - public function getChildren() { return $this->children; } - public function getParents() { return $this->parents; } - public function getChannels() { return $this->channels; } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC729Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC729Test.php deleted file mode 100644 index 3762497..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC729Test.php +++ /dev/null @@ -1,182 +0,0 @@ -_em); - $schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC729A'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC729B'), - )); - } catch(\Exception $e) { - - } - } - - public function testMergeManyToMany() - { - $a = new DDC729A(); - $b = new DDC729B(); - $a->related[] = $b; - - $this->_em->persist($a); - $this->_em->persist($b); - $this->_em->flush(); - $this->_em->clear(); - $aId = $a->id; - - $a = new DDC729A(); - $a->id = $aId; - - $this->assertInstanceOf('Doctrine\Common\Collections\ArrayCollection', $a->related); - - $a = $this->_em->merge($a); - - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $a->related); - - $this->assertFalse($a->related->isInitialized(), "Collection should not be marked initialized."); - $this->assertFalse($a->related->isDirty(), "Collection should not be marked as dirty."); - - $this->_em->flush(); - $this->_em->clear(); - - $a = $this->_em->find(__NAMESPACE__ . '\DDC729A', $aId); - $this->assertEquals(1, count($a->related)); - } - - public function testUnidirectionalMergeManyToMany() - { - $a = new DDC729A(); - $b1 = new DDC729B(); - $b2 = new DDC729B(); - $a->related[] = $b1; - - $this->_em->persist($a); - $this->_em->persist($b1); - $this->_em->persist($b2); - $this->_em->flush(); - $this->_em->clear(); - $aId = $a->id; - - $a = new DDC729A(); - $a->id = $aId; - - $a = $this->_em->merge($a); - - $a->related->set(0, $this->_em->merge($b1)); - - $a->related->set(1, $this->_em->merge($b2)); - - $this->_em->flush(); - $this->_em->clear(); - - $a = $this->_em->find(__NAMESPACE__ . '\DDC729A', $aId); - $this->assertEquals(2, count($a->related)); - } - - public function testBidirectionalMergeManyToMany() - { - $a = new DDC729A(); - $b1 = new DDC729B(); - $b2 = new DDC729B(); - $a->related[] = $b1; - - $this->_em->persist($a); - $this->_em->persist($b1); - $this->_em->persist($b2); - $this->_em->flush(); - $this->_em->clear(); - $aId = $a->id; - - $a = new DDC729A(); - $a->id = $aId; - - $a = $this->_em->merge($a); - - $a->related->set(0, $this->_em->merge($b1)); - $b1->related->set(0, $a); - - $a->related->set(1, $this->_em->merge($b2)); - $b2->related->set(0, $a); - - $this->_em->flush(); - $this->_em->clear(); - - $a = $this->_em->find(__NAMESPACE__ . '\DDC729A', $aId); - $this->assertEquals(2, count($a->related)); - } - - public function testBidirectionalMultiMergeManyToMany() - { - $a = new DDC729A(); - $b1 = new DDC729B(); - $b2 = new DDC729B(); - $a->related[] = $b1; - - $this->_em->persist($a); - $this->_em->persist($b1); - $this->_em->persist($b2); - $this->_em->flush(); - $this->_em->clear(); - $aId = $a->id; - - $a = new DDC729A(); - $a->id = $aId; - - $a = $this->_em->merge($a); - - $a->related->set(0, $this->_em->merge($b1)); - $b1->related->set(0, $this->_em->merge($a)); - - $a->related->set(1, $this->_em->merge($b2)); - $b2->related->set(0, $this->_em->merge($a)); - - $this->_em->flush(); - $this->_em->clear(); - - $a = $this->_em->find(__NAMESPACE__ . '\DDC729A', $aId); - $this->assertEquals(2, count($a->related)); - } -} - -/** - * @Entity - */ -class DDC729A -{ - /** @Id @GeneratedValue @Column(type="integer") */ - public $id; - - /** @ManyToMany(targetEntity="DDC729B", inversedBy="related") */ - public $related; - - public function __construct() - { - $this->related = new \Doctrine\Common\Collections\ArrayCollection(); - } -} - -/** - * @Entity - */ -class DDC729B -{ - /** @Id @GeneratedValue @Column(type="integer") */ - public $id; - - /** @ManyToMany(targetEntity="DDC729B", mappedBy="related") */ - public $related; - - public function __construct() - { - $this->related = new \Doctrine\Common\Collections\ArrayCollection(); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC735Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC735Test.php deleted file mode 100644 index 77ef6e1..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC735Test.php +++ /dev/null @@ -1,122 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC735Product'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC735Review') - )); - } catch(\Exception $e) { - - } - } - - public function testRemoveElement_AppliesOrphanRemoval() - { - // Create a product and its first review - $product = new DDC735Product; - $review = new DDC735Review($product); - - // Persist and flush - $this->_em->persist($product); - $this->_em->flush(); - - // Now you see it - $this->assertEquals(1, count($product->getReviews())); - - // Remove the review - $reviewId = $review->getId(); - $product->removeReview($review); - $this->_em->flush(); - - // Now you don't - $this->assertEquals(0, count($product->getReviews()), 'count($reviews) should be 0 after removing its only Review'); - - // Refresh - $this->_em->refresh($product); - - // It should still be 0 - $this->assertEquals(0, count($product->getReviews()), 'count($reviews) should still be 0 after the refresh'); - - // Review should also not be available anymore - $this->assertNull($this->_em->find(__NAMESPACE__.'\DDC735Review', $reviewId)); - } -} - -/** - * @Entity - */ -class DDC735Product -{ - /** - * @Id @Column(type="integer") @GeneratedValue - */ - protected $id; - - /** - * @OneToMany( - * targetEntity="DDC735Review", - * mappedBy="product", - * cascade={"persist"}, - * orphanRemoval=true - * ) - */ - protected $reviews; - - public function __construct() - { - $this->reviews = new ArrayCollection; - } - - public function getReviews() - { - return $this->reviews; - } - - public function addReview(DDC735Review $review) - { - $this->reviews->add($review); - } - - public function removeReview(DDC735Review $review) - { - $this->reviews->removeElement($review); - } -} - -/** - * @Entity - */ -class DDC735Review -{ - /** - * @Id @Column(type="integer") @GeneratedValue - */ - protected $id; - - /** - * @ManyToOne(targetEntity="DDC735Product", inversedBy="reviews") - */ - protected $product; - - public function __construct(DDC735Product $product) - { - $this->product = $product; - $product->addReview($this); - } - - public function getId() - { - return $this->id; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC736Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC736Test.php deleted file mode 100644 index 2dfeeec..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC736Test.php +++ /dev/null @@ -1,100 +0,0 @@ -useModelSet('ecommerce'); - parent::setUp(); - } - - /** - * @group DDC-736 - */ - public function testReorderEntityFetchJoinForHydration() - { - $cust = new ECommerceCustomer; - $cust->setName('roman'); - - $cart = new ECommerceCart; - $cart->setPayment('cash'); - $cart->setCustomer($cust); - - $this->_em->persist($cust); - $this->_em->persist($cart); - $this->_em->flush(); - $this->_em->clear(); - - $result = $this->_em->createQuery("select c, c.name, ca, ca.payment from Doctrine\Tests\Models\ECommerce\ECommerceCart ca join ca.customer c") - ->getSingleResult(/*\Doctrine\ORM\Query::HYDRATE_ARRAY*/); - - $cart2 = $result[0]; - unset($result[0]); - - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceCart', $cart2); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $cart2->getCustomer()); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceCustomer', $cart2->getCustomer()); - $this->assertEquals(array('name' => 'roman', 'payment' => 'cash'), $result); - } - - /** - * @group DDC-736 - * @group DDC-925 - * @group DDC-915 - */ - public function testDqlTreeWalkerReordering() - { - $cust = new ECommerceCustomer; - $cust->setName('roman'); - - $cart = new ECommerceCart; - $cart->setPayment('cash'); - $cart->setCustomer($cust); - - $this->_em->persist($cust); - $this->_em->persist($cart); - $this->_em->flush(); - $this->_em->clear(); - - $dql = "select c, c.name, ca, ca.payment from Doctrine\Tests\Models\ECommerce\ECommerceCart ca join ca.customer c"; - $result = $this->_em->createQuery($dql) - ->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\Tests\ORM\Functional\Ticket\DisableFetchJoinTreeWalker')) - ->getResult(); - - /* @var $cart2 Doctrine\Tests\Models\ECommerce\ECommerceCart */ - $cart2 = $result[0][0]; - $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $cart2->getCustomer()); - } -} - -class DisableFetchJoinTreeWalker extends \Doctrine\ORM\Query\TreeWalkerAdapter -{ - public function walkSelectStatement(AST\SelectStatement $AST) - { - $this->walkSelectClause($AST->selectClause); - } - - /** - * @param \Doctrine\ORM\Query\AST\SelectClause $selectClause - */ - public function walkSelectClause($selectClause) - { - foreach ($selectClause->selectExpressions AS $key => $selectExpr) { - /* @var $selectExpr \Doctrine\ORM\Query\AST\SelectExpression */ - if ($selectExpr->expression == "c") { - unset($selectClause->selectExpressions[$key]); - break; - } - } - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php deleted file mode 100644 index 7e6e200..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php +++ /dev/null @@ -1,130 +0,0 @@ -addServer('localhost'); - $memcache->flush(); - - $cacheDriver = new \Doctrine\Common\Cache\MemcacheCache(); - $cacheDriver->setMemcache($memcache); - - $this->_em->getMetadataFactory()->setCacheDriver($cacheDriver); - } else if (\extension_loaded('apc')) { - $this->_em->getMetadataFactory()->setCacheDriver(new \Doctrine\Common\Cache\ApcCache()); - } - - try { - $this->_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC742User'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC742Comment') - )); - } catch(\Exception $e) { - - } - - // make sure classes will be deserialized from caches - $this->_em->getMetadataFactory()->setMetadataFor(__NAMESPACE__ . '\DDC742User', null); - $this->_em->getMetadataFactory()->setMetadataFor(__NAMESPACE__ . '\DDC742Comment', null); - } - - public function testIssue() - { - $user = new DDC742User(); - $user->title = "Foo"; - $user->favoriteComments = new ArrayCollection(); - - $comment1 = new DDC742Comment(); - $comment1->content = "foo"; - - $comment2 = new DDC742Comment(); - $comment2->content = "bar"; - - $comment3 = new DDC742Comment(); - $comment3->content = "baz"; - - $user->favoriteComments->add($comment1); - $user->favoriteComments->add($comment2); - - $this->_em->persist($user); - $this->_em->persist($comment1); - $this->_em->persist($comment2); - $this->_em->persist($comment3); - $this->_em->flush(); - $this->_em->clear(); - - $user = $this->_em->find(get_class($user), $user->id); - $comment3 = $this->_em->find(get_class($comment3), $comment3->id); - $user->favoriteComments->add($comment3); - $this->_em->flush(); - } -} - -/** - * @Entity - * @Table(name="users") - */ -class DDC742User -{ - /** - * User Id - * - * @Id - * @GeneratedValue(strategy="AUTO") - * @Column(type="integer") - * @var integer - */ - public $id; - /** - * @Column(length=100, type="string") - * @var string - */ - public $title; - /** - * @ManyToMany(targetEntity="DDC742Comment", cascade={"persist"}, fetch="EAGER") - * @JoinTable( - * name="user_comments", - * joinColumns={@JoinColumn(name="user_id",referencedColumnName="id")}, - * inverseJoinColumns={@JoinColumn(name="comment_id", referencedColumnName="id")} - * ) - * - * @var Doctrine\ORM\PersistentCollection - */ - public $favoriteComments; -} - -/** - * @Entity - * @Table(name="comments") - */ -class DDC742Comment -{ - /** - * User Id - * - * @Id - * @GeneratedValue(strategy="AUTO") - * @Column(type="integer") - * @var integer - */ - public $id; - /** - * @Column(length=100, type="string") - * @var string - */ - public $content; -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC748Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC748Test.php deleted file mode 100644 index 9954a69..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC748Test.php +++ /dev/null @@ -1,64 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - public function testRefreshWithManyToOne() - { - $user = new CmsUser(); - $user->name = "beberlei"; - $user->status = "active"; - $user->username = "beberlei"; - - $article = new CmsArticle(); - $article->setAuthor($user); - $article->text = "foo"; - $article->topic = "bar"; - - $this->_em->persist($user); - $this->_em->persist($article); - $this->_em->flush(); - - $this->assertInstanceOf('Doctrine\Common\Collections\Collection', $user->articles); - $this->_em->refresh($article); - $this->assertTrue($article !== $user->articles, "The article should not be replaced on the inverse side of the relation."); - $this->assertInstanceOf('Doctrine\Common\Collections\Collection', $user->articles); - } - - public function testRefreshOneToOne() - { - $user = new CmsUser(); - $user->name = "beberlei"; - $user->status = "active"; - $user->username = "beberlei"; - - $address = new CmsAddress(); - $address->city = "Bonn"; - $address->country = "Germany"; - $address->street = "A street"; - $address->zip = 12345; - $address->setUser($user); - - $this->_em->persist($user); - $this->_em->persist($address); - $this->_em->flush(); - - $this->_em->refresh($address); - $this->assertSame($user, $address->user); - $this->assertSame($user->address, $address); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC758Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC758Test.php deleted file mode 100644 index 76bb3bb..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC758Test.php +++ /dev/null @@ -1,185 +0,0 @@ -markTestSkipped('Destroys testsuite'); - $this->useModelSet("cms"); - - parent::setUp(); - } - - /** - * Helper method to set cascade to merge only - */ - private function setCascadeMergeFor($class) - { - $metadata = $this->_em->getMetadataFactory()->getMetaDataFor($class); - foreach ($metadata->associationMappings as $key => $associationMapping) { - $metadata->associationMappings[$key]["isCascadePersist"] = false; - $metadata->associationMappings[$key]["isCascadeMerge"] = true; - $metadata->associationMappings[$key]["isCascadeRemove"] = false; - $metadata->associationMappings[$key]["isCascadeDetach"] = false; - } - } - - /** - * Test that changing associations on detached entities and then cascade merging them - * causes the database to be updated with the new associations. - * This specifically tests adding new associations. - */ - public function testManyToManyMergeAssociationAdds() - { - $this->setCascadeMergeFor('Doctrine\Tests\Models\CMS\CmsUser'); - $this->setCascadeMergeFor('Doctrine\Tests\Models\CMS\CmsGroup'); - - // Put entities in the database - $cmsUser = new CmsUser(); - $cmsUser->username = "dave"; - $cmsUser->name = "Dave Keen"; - $cmsUser->status = "testing"; - - $group1 = new CmsGroup(); - $group1->name = "Group 1"; - - $group2 = new CmsGroup(); - $group2->name = "Group 2"; - - $this->_em->persist($cmsUser); - $this->_em->persist($group1); - $this->_em->persist($group2); - $this->_em->flush(); - - $cmsUserId = $cmsUser->id; - $group1Id = $group1->id; - $group2Id = $group2->id; - - $this->_em->clear(); - - // Now create detached versions of the entities with some new associations. - $cmsUser = new CmsUser(); - $cmsUser->id = $cmsUserId; - $cmsUser->username = "dave"; - $cmsUser->name = "Dave Keen"; - $cmsUser->status = "testing"; - $cmsUser->groups = new ArrayCollection(); - - $group1 = new CmsGroup(); - $group1->id = $group1Id; - $group1->name = "Group 1"; - $group1->users = new ArrayCollection(); - - $group2 = new CmsGroup(); - $group2->id = $group2Id; - $group2->name = "Group 2"; - $group2->users = new ArrayCollection(); - - $cmsUser->addGroup($group1); - $cmsUser->addGroup($group2); - - // Cascade merge of cmsUser followed by a flush should add in the birectional new many-to-many associations between the user and the groups - $this->_em->merge($cmsUser); - $this->_em->flush(); - - $this->_em->clear(); - - $cmsUsers = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser')->findAll(); - $cmsGroups = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsGroup')->findAll(); - - // Check the entities are in the database - $this->assertEquals(1, sizeof($cmsUsers)); - $this->assertEquals(2, sizeof($cmsGroups)); - - // Check the associations between the entities are now in the database - $this->assertEquals(2, sizeof($cmsUsers[0]->groups)); - $this->assertEquals(1, sizeof($cmsGroups[0]->users)); - $this->assertEquals(1, sizeof($cmsGroups[1]->users)); - - $this->assertSame($cmsUsers[0]->groups[0], $cmsGroups[0]); - $this->assertSame($cmsUsers[0]->groups[1], $cmsGroups[1]); - $this->assertSame($cmsGroups[0]->users[0], $cmsUsers[0]); - $this->assertSame($cmsGroups[1]->users[0], $cmsUsers[0]); - } - - /** - * Test that changing associations on detached entities and then cascade merging them causes the - * database to be updated with the new associations. - */ - public function testManyToManyMergeAssociationRemoves() - { - $this->setCascadeMergeFor('Doctrine\Tests\Models\CMS\CmsUser'); - $this->setCascadeMergeFor('Doctrine\Tests\Models\CMS\CmsGroup'); - - $cmsUser = new CmsUser(); - $cmsUser->username = "dave"; - $cmsUser->name = "Dave Keen"; - $cmsUser->status = "testing"; - - $group1 = new CmsGroup(); - $group1->name = "Group 1"; - - $group2 = new CmsGroup(); - $group2->name = "Group 2"; - - $cmsUser->addGroup($group1); - $cmsUser->addGroup($group2); - - $this->_em->persist($cmsUser); - $this->_em->persist($group1); - $this->_em->persist($group2); - $this->_em->flush(); - - $cmsUserId = $cmsUser->id; - $group1Id = $group1->id; - $group2Id = $group2->id; - - $this->_em->clear(); - - // Now create detached versions of the entities with NO associations. - $cmsUser = new CmsUser(); - $cmsUser->id = $cmsUserId; - $cmsUser->username = "dave"; - $cmsUser->name = "Dave Keen"; - $cmsUser->status = "testing"; - $cmsUser->groups = new ArrayCollection(); - - $group1 = new CmsGroup(); - $group1->id = $group1Id; - $group1->name = "Group 1"; - $group1->users = new ArrayCollection(); - - $group2 = new CmsGroup(); - $group2->id = $group2Id; - $group2->name = "Group 2"; - $group2->users = new ArrayCollection(); - - // Cascade merge of cmsUser followed by a flush should result in the association array collection being empty - $this->_em->merge($cmsUser); - $this->_em->flush(); - - $this->_em->clear(); - - $cmsUsers = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser')->findAll(); - $cmsGroups = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsGroup')->findAll(); - - // Check the entities are in the database - $this->assertEquals(1, sizeof($cmsUsers)); - $this->assertEquals(2, sizeof($cmsGroups)); - - // Check the associations between the entities are now in the database - $this->assertEquals(0, sizeof($cmsUsers[0]->groups)); - $this->assertEquals(0, sizeof($cmsGroups[0]->users)); - $this->assertEquals(0, sizeof($cmsGroups[1]->users)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC767Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC767Test.php deleted file mode 100644 index 7ba337e..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC767Test.php +++ /dev/null @@ -1,74 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - /** - * @group DDC-767 - */ - public function testCollectionChangesInsideTransaction() - { - $user = new CmsUser(); - $user->name = "beberlei"; - $user->status = "active"; - $user->username = "beberlei"; - - $group1 = new CmsGroup(); - $group1->name = "foo"; - - $group2 = new CmsGroup(); - $group2->name = "bar"; - - $group3 = new CmsGroup(); - $group3->name = "baz"; - - $user->addGroup($group1); - $user->addGroup($group2); - - $this->_em->persist($user); - $this->_em->persist($group1); - $this->_em->persist($group2); - $this->_em->persist($group3); - - $this->_em->flush(); - $this->_em->clear(); - - /* @var $pUser CmsUser */ - $pUser = $this->_em->find(get_class($user), $user->id); - - $this->assertNotNull($pUser, "User not retrieved from database."); - - $groups = array(2, 3); - - try { - $this->_em->beginTransaction(); - - $pUser->groups->clear(); - - $this->_em->flush(); - - // Add new - foreach ($groups as $groupId) { - $pUser->addGroup($this->_em->find(get_class($group1), $groupId)); - } - - $this->_em->flush(); - $this->_em->commit(); - } catch(\Exception $e) { - $this->_em->rollback(); - } - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC809Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC809Test.php deleted file mode 100644 index c586afa..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC809Test.php +++ /dev/null @@ -1,109 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC809Variant'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC809SpecificationValue') - )); - - $conn = $this->_em->getConnection(); - $conn->insert('specification_value_test', array('specification_value_id' => 94589)); - $conn->insert('specification_value_test', array('specification_value_id' => 94593)); - $conn->insert('specification_value_test', array('specification_value_id' => 94606)); - $conn->insert('specification_value_test', array('specification_value_id' => 94607)); - $conn->insert('specification_value_test', array('specification_value_id' => 94609)); - $conn->insert('specification_value_test', array('specification_value_id' => 94711)); - - $conn->insert('variant_test', array('variant_id' => 545208)); - $conn->insert('variant_test', array('variant_id' => 545209)); - - $conn->insert('var_spec_value_test', array('variant_id' => 545208, 'specification_value_id' => 94606)); - $conn->insert('var_spec_value_test', array('variant_id' => 545208, 'specification_value_id' => 94607)); - $conn->insert('var_spec_value_test', array('variant_id' => 545208, 'specification_value_id' => 94609)); - $conn->insert('var_spec_value_test', array('variant_id' => 545208, 'specification_value_id' => 94711)); - - $conn->insert('var_spec_value_test', array('variant_id' => 545209, 'specification_value_id' => 94589)); - $conn->insert('var_spec_value_test', array('variant_id' => 545209, 'specification_value_id' => 94593)); - $conn->insert('var_spec_value_test', array('variant_id' => 545209, 'specification_value_id' => 94606)); - $conn->insert('var_spec_value_test', array('variant_id' => 545209, 'specification_value_id' => 94607)); - } - - /** - * @group DDC-809 - */ - public function testIssue() - { - $result = $this->_em->createQueryBuilder() - ->select('Variant, SpecificationValue') - ->from('Doctrine\Tests\ORM\Functional\Ticket\DDC809Variant', 'Variant') - ->leftJoin('Variant.SpecificationValues', 'SpecificationValue') - ->getQuery() - ->getResult(); - - $this->assertEquals(4, count($result[0]->getSpecificationValues()), "Works in test-setup."); - $this->assertEquals(4, count($result[1]->getSpecificationValues()), "Only returns 2 in the case of the hydration bug."); - } -} - -/** - * @Table(name="variant_test") - * @Entity - */ -class DDC809Variant -{ - /** - * @Column(name="variant_id", type="integer") - * @Id - */ - protected $variantId; - - /** - * @ManyToMany(targetEntity="DDC809SpecificationValue", inversedBy="Variants") - * @JoinTable(name="var_spec_value_test", - * joinColumns={ - * @JoinColumn(name="variant_id", referencedColumnName="variant_id") - * }, - * inverseJoinColumns={ - * @JoinColumn(name="specification_value_id", referencedColumnName="specification_value_id") - * } - * ) - */ - protected $SpecificationValues; - - public function getSpecificationValues() - { - return $this->SpecificationValues; - } -} - -/** - * @Table(name="specification_value_test") - * @Entity - */ -class DDC809SpecificationValue -{ - /** - * @Column(name="specification_value_id", type="integer") - * @Id - */ - protected $specificationValueId; - - /** - * @var Variant - * - * @ManyToMany(targetEntity="DDC809Variant", mappedBy="SpecificationValues") - */ - protected $Variants; -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC812Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC812Test.php deleted file mode 100644 index 4a80358..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC812Test.php +++ /dev/null @@ -1,48 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - /** - * @group DDC-812 - */ - public function testFetchJoinInitializesPreviouslyUninitializedCollectionOfManagedEntity() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - $article = new CmsArticle; - $article->topic = "hello"; - $article->text = "talk talk talk"; - - $comment = new CmsComment; - $comment->topic = "good!"; - $comment->text = "stuff!"; - $comment->article = $article; - - $this->_em->persist($article); - $this->_em->persist($comment); - $this->_em->flush(); - $this->_em->clear(); - - $article2 = $this->_em->find(get_class($article), $article->id); - - $article2Again = $this->_em->createQuery( - "select a, c from Doctrine\Tests\Models\CMS\CmsArticle a join a.comments c where a.id = ?1") - ->setParameter(1, $article->id) - ->getSingleResult(); - - $this->assertTrue($article2Again === $article2); - $this->assertTrue($article2Again->comments->isInitialized()); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC832Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC832Test.php deleted file mode 100644 index 599218b..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC832Test.php +++ /dev/null @@ -1,194 +0,0 @@ -_em->getConnection()->getDatabasePlatform(); - if ($platform->getName() == "oracle") { - $this->markTestSkipped('Doesnt run on Oracle.'); - } - - $this->_em->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger()); - try { - $this->_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC832JoinedIndex'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC832JoinedTreeIndex'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC832Like'), - )); - } catch(\Exception $e) { - - } - } - - public function tearDown() - { - /* @var $sm \Doctrine\DBAL\Schema\AbstractSchemaManager */ - $platform = $this->_em->getConnection()->getDatabasePlatform(); - $sm = $this->_em->getConnection()->getSchemaManager(); - $sm->dropTable($platform->quoteIdentifier('TREE_INDEX')); - $sm->dropTable($platform->quoteIdentifier('INDEX')); - $sm->dropTable($platform->quoteIdentifier('LIKE')); - } - - /** - * @group DDC-832 - */ - public function testQuotedTableBasicUpdate() - { - $like = new DDC832Like("test"); - $this->_em->persist($like); - $this->_em->flush(); - - $like->word = "test2"; - $this->_em->flush(); - } - - /** - * @group DDC-832 - */ - public function testQuotedTableBasicRemove() - { - $like = new DDC832Like("test"); - $this->_em->persist($like); - $this->_em->flush(); - - $this->_em->remove($like); - $this->_em->flush(); - } - - /** - * @group DDC-832 - */ - public function testQuotedTableJoinedUpdate() - { - $index = new DDC832JoinedIndex("test"); - $this->_em->persist($index); - $this->_em->flush(); - - $index->name = "asdf"; - $this->_em->flush(); - } - - /** - * @group DDC-832 - */ - public function testQuotedTableJoinedRemove() - { - $index = new DDC832JoinedIndex("test"); - $this->_em->persist($index); - $this->_em->flush(); - - $this->_em->remove($index); - $this->_em->flush(); - } - - /** - * @group DDC-832 - */ - public function testQuotedTableJoinedChildUpdate() - { - $index = new DDC832JoinedTreeIndex("test", 1, 2); - $this->_em->persist($index); - $this->_em->flush(); - - $index->name = "asdf"; - $this->_em->flush(); - } - - /** - * @group DDC-832 - */ - public function testQuotedTableJoinedChildRemove() - { - $index = new DDC832JoinedTreeIndex("test", 1, 2); - $this->_em->persist($index); - $this->_em->flush(); - - $this->_em->remove($index); - $this->_em->flush(); - } -} - -/** - * @Entity - * @Table(name="`LIKE`") - */ -class DDC832Like -{ - /** - * @Id @Column(type="integer") @GeneratedValue - */ - public $id; - - /** @Column(type="string") */ - public $word; - - /** - * @version - * @Column(type="integer") - */ - public $version; - - public function __construct($word) - { - $this->word = $word; - } -} - -/** - * @Entity - * @Table(name="`INDEX`") - * @InheritanceType("JOINED") - * @DiscriminatorColumn(name="discr", type="string") - * @DiscriminatorMap({"like" = "DDC832JoinedIndex", "fuzzy" = "DDC832JoinedTreeIndex"}) - */ -class DDC832JoinedIndex -{ - /** - * @Id @Column(type="integer") @GeneratedValue - */ - public $id; - - /** @Column(type="string") */ - public $name; - - /** - * @version - * @Column(type="integer") - */ - public $version; - - public function __construct($name) - { - $this->name = $name; - } -} - -/** - * @Entity - * @Table(name="`TREE_INDEX`") - */ -class DDC832JoinedTreeIndex extends DDC832JoinedIndex -{ - /** @Column(type="integer") */ - public $lft; - /** @Column(type="integer") */ - public $rgt; - - public function __construct($name, $lft, $rgt) - { - $this->name = $name; - $this->lft = $lft; - $this->rgt = $rgt; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC837Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC837Test.php deleted file mode 100644 index d44c3af..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC837Test.php +++ /dev/null @@ -1,198 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC837Super'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC837Class1'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC837Class2'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC837Class3'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC837Aggregate'), - )); - } - - /** - * @group DDC-837 - */ - public function testIssue() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); - - $c1 = new DDC837Class1(); - $c1->title = "Foo"; - $c1->description = "Foo"; - $aggregate1 = new DDC837Aggregate('test1'); - $c1->aggregate = $aggregate1; - - $c2 = new DDC837Class2(); - $c2->title = "Bar"; - $c2->description = "Bar"; - $c2->text = "Bar"; - $aggregate2 = new DDC837Aggregate('test2'); - $c2->aggregate = $aggregate2; - - $c3 = new DDC837Class3(); - $c3->apples = "Baz"; - $c3->bananas = "Baz"; - - $this->_em->persist($c1); - $this->_em->persist($aggregate1); - $this->_em->persist($c2); - $this->_em->persist($aggregate2); - $this->_em->persist($c3); - $this->_em->flush(); - $this->_em->clear(); - - // Test Class1 - $e1 = $this->_em->find('Doctrine\Tests\ORM\Functional\Ticket\DDC837Super', $c1->id); - - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Ticket\DDC837Class1', $e1); - $this->assertEquals('Foo', $e1->title); - $this->assertEquals('Foo', $e1->description); - $this->assertInstanceOf(__NAMESPACE__ . '\DDC837Aggregate', $e1->aggregate); - $this->assertEquals('test1', $e1->aggregate->getSysname()); - - // Test Class 2 - $e2 = $this->_em->find('Doctrine\Tests\ORM\Functional\Ticket\DDC837Super', $c2->id); - - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Ticket\DDC837Class2', $e2); - $this->assertEquals('Bar', $e2->title); - $this->assertEquals('Bar', $e2->description); - $this->assertEquals('Bar', $e2->text); - $this->assertInstanceOf(__NAMESPACE__ . '\DDC837Aggregate', $e2->aggregate); - $this->assertEquals('test2', $e2->aggregate->getSysname()); - - $all = $this->_em->getRepository(__NAMESPACE__.'\DDC837Super')->findAll(); - - foreach ($all as $obj) { - if ($obj instanceof DDC837Class1) { - $this->assertEquals('Foo', $obj->title); - $this->assertEquals('Foo', $obj->description); - } else if ($obj instanceof DDC837Class2) { - $this->assertTrue($e2 === $obj); - $this->assertEquals('Bar', $obj->title); - $this->assertEquals('Bar', $obj->description); - $this->assertEquals('Bar', $obj->text); - } else if ($obj instanceof DDC837Class3) { - $this->assertEquals('Baz', $obj->apples); - $this->assertEquals('Baz', $obj->bananas); - } else { - $this->fail('Instance of DDC837Class1, DDC837Class2 or DDC837Class3 expected.'); - } - } - } -} - -/** - * @Entity - * @Table(name="DDC837Super") - * @InheritanceType("JOINED") - * @DiscriminatorColumn(name="type", type="string") - * @DiscriminatorMap({"class1" = "DDC837Class1", "class2" = "DDC837Class2", "class3"="DDC837Class3"}) - */ -abstract class DDC837Super -{ - /** - * @Id @Column(name="id", type="integer") - * @GeneratedValue(strategy="AUTO") - */ - public $id; -} - -/** - * @Entity - */ -class DDC837Class1 extends DDC837Super -{ - /** - * @Column(name="title", type="string", length=150) - */ - public $title; - - /** - * @Column(name="content", type="string", length=500) - */ - public $description; - - /** - * @OneToOne(targetEntity="DDC837Aggregate") - */ - public $aggregate; -} - -/** - * @Entity - */ -class DDC837Class2 extends DDC837Super -{ - /** - * @Column(name="title", type="string", length=150) - */ - public $title; - - /** - * @Column(name="content", type="string", length=500) - */ - public $description; - - /** - * @Column(name="text", type="text") - */ - public $text; - - /** - * @OneToOne(targetEntity="DDC837Aggregate") - */ - public $aggregate; -} - -/** - * An extra class to demonstrate why title and description aren't in Super - * - * @Entity - */ -class DDC837Class3 extends DDC837Super -{ - /** - * @Column(name="title", type="string", length=150) - */ - public $apples; - - /** - * @Column(name="content", type="string", length=500) - */ - public $bananas; -} - -/** - * @Entity - */ -class DDC837Aggregate -{ - /** - * @Id @Column(name="id", type="integer") - * @GeneratedValue - */ - public $id; - - /** - * @Column(name="sysname", type="string") - */ - protected $sysname; - - public function __construct($sysname) - { - $this->sysname = $sysname; - } - - public function getSysname() - { - return $this->sysname; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC849Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC849Test.php deleted file mode 100644 index b17e605..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC849Test.php +++ /dev/null @@ -1,84 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - - $this->user = new CmsUser(); - $this->user->username = "beberlei"; - $this->user->name = "Benjamin"; - $this->user->status = "active"; - - $this->group1 = new CmsGroup(); - $this->group1->name = "Group 1"; - $this->group2 = new CmsGroup(); - $this->group2->name = "Group 2"; - - $this->user->addGroup($this->group1); - $this->user->addGroup($this->group2); - - $this->_em->persist($this->user); - $this->_em->persist($this->group1); - $this->_em->persist($this->group2); - - $this->_em->flush(); - $this->_em->clear(); - - $this->user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->user->getId()); - } - - public function testRemoveContains() - { - $group1 = $this->user->groups[0]; - $group2 = $this->user->groups[1]; - - $this->assertTrue($this->user->groups->contains($group1)); - $this->assertTrue($this->user->groups->contains($group2)); - - $this->user->groups->removeElement($group1); - $this->user->groups->remove(1); - - $this->assertFalse($this->user->groups->contains($group1)); - $this->assertFalse($this->user->groups->contains($group2)); - } - - public function testClearCount() - { - $this->user->addGroup(new CmsGroup); - $this->assertEquals(3, count($this->user->groups)); - - $this->user->groups->clear(); - - $this->assertEquals(0, $this->user->groups->count()); - $this->assertEquals(0, count($this->user->groups)); - } - - public function testClearContains() - { - $group1 = $this->user->groups[0]; - $group2 = $this->user->groups[1]; - - $this->assertTrue($this->user->groups->contains($group1)); - $this->assertTrue($this->user->groups->contains($group2)); - - $this->user->groups->clear(); - - $this->assertFalse($this->user->groups->contains($group1)); - $this->assertFalse($this->user->groups->contains($group2)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC881Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC881Test.php deleted file mode 100644 index 4ef3c08..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC881Test.php +++ /dev/null @@ -1,215 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC881User'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC881Phonenumber'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC881Phonecall'), - )); - } catch (\Exception $e) { - - } - } - - /** - * @group DDC-117 - * @group DDC-881 - */ - public function testIssue() - { - /* Create two test users: albert and alfons */ - $albert = new DDC881User; - $albert->setName("albert"); - $this->_em->persist($albert); - - $alfons = new DDC881User; - $alfons->setName("alfons"); - $this->_em->persist($alfons); - - $this->_em->flush(); - - /* Assign two phone numbers to each user */ - $phoneAlbert1 = new DDC881PhoneNumber(); - $phoneAlbert1->setUser($albert); - $phoneAlbert1->setId(1); - $phoneAlbert1->setPhoneNumber("albert home: 012345"); - $this->_em->persist($phoneAlbert1); - - $phoneAlbert2 = new DDC881PhoneNumber(); - $phoneAlbert2->setUser($albert); - $phoneAlbert2->setId(2); - $phoneAlbert2->setPhoneNumber("albert mobile: 67890"); - $this->_em->persist($phoneAlbert2); - - $phoneAlfons1 = new DDC881PhoneNumber(); - $phoneAlfons1->setId(1); - $phoneAlfons1->setUser($alfons); - $phoneAlfons1->setPhoneNumber("alfons home: 012345"); - $this->_em->persist($phoneAlfons1); - - $phoneAlfons2 = new DDC881PhoneNumber(); - $phoneAlfons2->setId(2); - $phoneAlfons2->setUser($alfons); - $phoneAlfons2->setPhoneNumber("alfons mobile: 67890"); - $this->_em->persist($phoneAlfons2); - - /* We call alfons and albert once on their mobile numbers */ - $call1 = new DDC881PhoneCall(); - $call1->setPhoneNumber($phoneAlfons2); - $this->_em->persist($call1); - - $call2 = new DDC881PhoneCall(); - $call2->setPhoneNumber($phoneAlbert2); - $this->_em->persist($call2); - - $this->_em->flush(); - $this->_em->clear(); - - // fetch-join that foreign-key/primary-key entity association - $dql = "SELECT c, p FROM " . __NAMESPACE__ . "\DDC881PhoneCall c JOIN c.phonenumber p"; - $calls = $this->_em->createQuery($dql)->getResult(); - - $this->assertEquals(2, count($calls)); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $calls[0]->getPhoneNumber()); - $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $calls[1]->getPhoneNumber()); - - $dql = "SELECT p, c FROM " . __NAMESPACE__ . "\DDC881PhoneNumber p JOIN p.calls c"; - $numbers = $this->_em->createQuery($dql)->getResult(); - - $this->assertEquals(2, count($numbers)); - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $numbers[0]->getCalls()); - $this->assertTrue($numbers[0]->getCalls()->isInitialized()); - } - -} - -/** - * @Entity - */ -class DDC881User -{ - - /** - * @Id - * @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - private $id; - /** - * @Column(type="string") - */ - private $name; - /** - * @OneToMany(targetEntity="DDC881PhoneNumber",mappedBy="id") - */ - private $phoneNumbers; - - public function getName() - { - return $this->name; - } - - public function setName($name) - { - $this->name = $name; - } -} - -/** - * @Entity - */ -class DDC881PhoneNumber -{ - - /** - * @Id - * @Column(type="integer") - */ - private $id; - /** - * @Id - * @ManyToOne(targetEntity="DDC881User",cascade={"all"}) - */ - private $user; - /** - * @Column(type="string") - */ - private $phonenumber; - - /** - * @OneToMany(targetEntity="DDC881PhoneCall", mappedBy="phonenumber") - */ - private $calls; - - public function __construct() - { - $this->calls = new \Doctrine\Common\Collections\ArrayCollection(); - } - - public function setId($id) - { - $this->id = $id; - } - - public function setUser(DDC881User $user) - { - $this->user = $user; - } - - public function setPhoneNumber($phoneNumber) - { - $this->phonenumber = $phoneNumber; - } - - public function getCalls() - { - return $this->calls; - } -} - -/** - * @Entity - */ -class DDC881PhoneCall -{ - - /** - * @Id - * @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - private $id; - /** - * @ManyToOne(targetEntity="DDC881PhoneNumber", inversedBy="calls", cascade={"all"}) - * @JoinColumns({ - * @JoinColumn(name="phonenumber_id", referencedColumnName="id"), - * @JoinColumn(name="user_id", referencedColumnName="user_id") - * }) - */ - private $phonenumber; - /** - * @Column(type="string",nullable=true) - */ - private $callDate; - - public function setPhoneNumber(DDC881PhoneNumber $phoneNumber) - { - $this->phonenumber = $phoneNumber; - } - - public function getPhoneNumber() - { - return $this->phonenumber; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php deleted file mode 100644 index cd2b584..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php +++ /dev/null @@ -1,39 +0,0 @@ -useModelSet('company'); - parent::setUp(); - } - - /** - * @group DDC-933 - */ - public function testLockCTIClass() - { - //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger()); - - $manager = new \Doctrine\Tests\Models\Company\CompanyManager(); - $manager->setName('beberlei'); - $manager->setSalary(1234); - $manager->setTitle('Vice Precident of This Test'); - $manager->setDepartment("Foo"); - - $this->_em->persist($manager); - $this->_em->flush(); - - $this->_em->beginTransaction(); - $this->_em->lock($manager, \Doctrine\DBAL\LockMode::PESSIMISTIC_READ); - $this->_em->rollback(); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC949Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC949Test.php deleted file mode 100644 index a3734b7..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC949Test.php +++ /dev/null @@ -1,43 +0,0 @@ -useModelSet('generic'); - parent::setUp(); - } - - /** - * @group DDC-949 - */ - public function testBooleanThroughRepository() - { - $true = new BooleanModel(); - $true->booleanField = true; - - $false = new BooleanModel(); - $false->booleanField = false; - - $this->_em->persist($true); - $this->_em->persist($false); - $this->_em->flush(); - $this->_em->clear(); - - $true = $this->_em->getRepository('Doctrine\Tests\Models\Generic\BooleanModel')->findOneBy(array('booleanField' => true)); - $false = $this->_em->getRepository('Doctrine\Tests\Models\Generic\BooleanModel')->findOneBy(array('booleanField' => false)); - - $this->assertInstanceOf('Doctrine\Tests\Models\Generic\BooleanModel', $true, "True model not found"); - $this->assertTrue($true->booleanField, "True Boolean Model should be true."); - - $this->assertInstanceOf('Doctrine\Tests\Models\Generic\BooleanModel', $false, "False model not found"); - $this->assertFalse($false->booleanField, "False Boolean Model should be false."); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC960Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC960Test.php deleted file mode 100644 index 99a29a5..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC960Test.php +++ /dev/null @@ -1,92 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC960Root'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC960Child') - )); - } catch(\Exception $e) { - - } - } - - /** - * @group DDC-960 - */ - public function testUpdateRootVersion() - { - $child = new DDC960Child('Test'); - $this->_em->persist($child); - $this->_em->flush(); - - $child->setName("Test2"); - - $this->_em->flush(); - - $this->assertEquals(2, $child->getVersion()); - } -} - -/** - * @Entity - * @InheritanceType("JOINED") - * @DiscriminatorMap({ - * "root" = "DDC960Root", - * "child" = "DDC960Child" - * }) - */ -class DDC960Root -{ - /** - * @Id @GeneratedValue @Column(type="integer") - */ - private $id; - - /** - * @Column(type="integer") @Version - */ - private $version; - - public function getId() - { - return $this->id; - } - - public function getVersion() - { - return $this->version; - } -} - -/** - * @Entity - */ -class DDC960Child extends DDC960Root -{ - /** - * @column(type="string") - * @var string - */ - private $name; - - public function __construct($name) - { - $this->name = $name; - } - - public function setName($name) - { - $this->name = $name; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC992Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC992Test.php deleted file mode 100644 index 001e380..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC992Test.php +++ /dev/null @@ -1,147 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC992Role'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC992Parent'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC992Child'), - )); - } catch(\Exception $e) { - - } - } - - public function testIssue() - { - $role = new DDC992Role(); - $role->name = "Parent"; - $child = new DDC992Role(); - $child->name = "child"; - - $role->extendedBy[] = $child; - $child->extends[] = $role; - - $this->_em->persist($role); - $this->_em->persist($child); - $this->_em->flush(); - $this->_em->clear(); - - $child = $this->_em->getRepository(get_class($role))->find($child->roleID); - $parents = count($child->extends); - $this->assertEquals(1, $parents); - foreach ($child->extends AS $parent) { - $this->assertEquals($role->getRoleID(), $parent->getRoleID()); - } - } - - public function testOneToManyChild() - { - $parent = new DDC992Parent(); - $child = new DDC992Child(); - $child->parent = $parent; - $parent->childs[] = $child; - - $this->_em->persist($parent); - $this->_em->persist($child); - $this->_em->flush(); - $this->_em->clear(); - - $parentRepository = $this->_em->getRepository(get_class($parent)); - $childRepository = $this->_em->getRepository(get_class($child)); - - $parent = $parentRepository->find($parent->id); - $this->assertEquals(1, count($parent->childs)); - $this->assertEquals(0, count($parent->childs[0]->childs())); - - $child = $parentRepository->findOneBy(array("id" => $child->id)); - $this->assertSame($parent->childs[0], $child); - - $this->_em->clear(); - - $child = $parentRepository->find($child->id); - $this->assertEquals(0, count($child->childs)); - - $this->_em->clear(); - - $child = $childRepository->find($child->id); - $this->assertEquals(0, count($child->childs)); - } -} - -/** - * @Entity - * @InheritanceType("JOINED") - * @DiscriminatorMap({"child" = "DDC992Child", "parent" = "DDC992Parent"}) - */ -class DDC992Parent -{ - /** @Id @GeneratedValue @Column(type="integer") */ - public $id; - /** @ManyToOne(targetEntity="DDC992Parent", inversedBy="childs") */ - public $parent; - /** @OneToMany(targetEntity="DDC992Child", mappedBy="parent") */ - public $childs; -} - -/** - * @Entity - */ -class DDC992Child extends DDC992Parent -{ - public function childs() - { - return $this->childs; - } -} - -/** - * @Entity - */ -class DDC992Role -{ - public function getRoleID() - { - return $this->roleID; - } - - /** - * @Id @Column(name="roleID", type="integer") - * @GeneratedValue(strategy="AUTO") - */ - public $roleID; - /** - * @Column (name="name", type="string", length=45) - */ - public $name; - /** - * @ManyToMany (targetEntity="DDC992Role", mappedBy="extends") - */ - public $extendedBy; - /** - * @ManyToMany (targetEntity="DDC992Role", inversedBy="extendedBy") - * @JoinTable (name="RoleRelations", - * joinColumns={@JoinColumn(name="roleID", referencedColumnName="roleID")}, - * inverseJoinColumns={@JoinColumn(name="extendsRoleID", referencedColumnName="roleID")} - * ) - */ - public $extends; - - public function __construct() { - $this->extends = new ArrayCollection; - $this->extendedBy = new ArrayCollection; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket2481Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket2481Test.php deleted file mode 100644 index e183102..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket2481Test.php +++ /dev/null @@ -1,44 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\Ticket\Ticket2481Product') - )); - } catch (\Exception $e) { - // Swallow all exceptions. We do not test the schema tool here. - } - $this->_conn = $this->_em->getConnection(); - } - - public function testEmptyInsert() - { - $test = new Ticket2481Product(); - $this->_em->persist($test); - $this->_em->flush(); - - $this->assertTrue($test->id > 0); - } -} - -/** - * @Entity - * @Table(name="ticket_2481_products") - */ -class Ticket2481Product -{ - /** - * @Id @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - public $id; -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket69.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket69.php deleted file mode 100644 index 1ca3511..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket69.php +++ /dev/null @@ -1,427 +0,0 @@ -_schemaTool->createSchema(array( - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\Ticket\Lemma'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\Ticket\Relation'), - $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\Ticket\RelationType') - )); - } catch (\Exception $e) { - // Swallow all exceptions. We do not test the schema tool here. - } - } - - public function testIssue() - { - //setup - $lemma1 = new Lemma; - $lemma1->setLemma('foo'); - - $lemma2 = new Lemma; - $lemma2->setLemma('bar'); - - $lemma3 = new Lemma; - $lemma3->setLemma('batz'); - - $lemma4 = new Lemma; - $lemma4->setLemma('bla'); - - $type1 = new RelationType; - $type1->setType('nonsense'); - $type1->setAbbreviation('non'); - - $type2 = new RelationType; - $type2->setType('quatsch'); - $type2->setAbbreviation('qu'); - - $relation1 = new Relation; - $relation1->setParent($lemma1); - $relation1->setChild($lemma2); - $relation1->setType($type1); - - $relation2 = new Relation; - $relation2->setParent($lemma1); - $relation2->setChild($lemma3); - $relation2->setType($type1); - - $relation3 = new Relation; - $relation3->setParent($lemma1); - $relation3->setChild($lemma4); - $relation3->setType($type2); - - $lemma1->addRelation($relation1); - $lemma1->addRelation($relation2); - $lemma1->addRelation($relation3); - - $this->_em->persist($type1); - $this->_em->persist($type2); - $this->_em->persist($lemma1); - $this->_em->persist($lemma2); - $this->_em->persist($lemma3); - $this->_em->persist($lemma4); - - $this->_em->flush(); - $this->_em->clear(); - //end setup - - // test One To Many - $query = $this->_em->createQuery("SELECT l FROM Doctrine\Tests\ORM\Functional\Ticket\Lemma l Where l.lemma = 'foo'"); - $res = $query->getResult(); - $lemma = $res[0]; - - $this->assertEquals('foo', $lemma->getLemma()); - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Ticket\Lemma', $lemma); - $relations = $lemma->getRelations(); - - foreach($relations as $relation) { - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Ticket\Relation', $relation); - $this->assertTrue($relation->getType()->getType() != ''); - } - - $this->_em->clear(); - - } -} - -/** - * @Entity - * @Table(name="lemma") - */ -class Lemma { - - const CLASS_NAME = __CLASS__; - - /** - * @var int - * @Id - * @Column(type="integer", name="lemma_id") - * @GeneratedValue(strategy="AUTO") - */ - private $id; - - /** - * - * @var string - * @Column(type="string", name="lemma_name", unique=true, length=255) - */ - private $lemma; - - - /** - * @var kateglo\application\utilities\collections\ArrayCollection - * @OneToMany(targetEntity="Relation", mappedBy="parent", cascade={"persist"}) - */ - private $relations; - - public function __construct() { - $this->types = new \Doctrine\Common\Collections\ArrayCollection(); - $this->relations = new \Doctrine\Common\Collections\ArrayCollection(); - } - - - /** - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * - * @param string $lemma - * @return void - */ - public function setLemma($lemma) { - $this->lemma = $lemma; - } - - /** - * - * @return string - */ - public function getLemma() { - return $this->lemma; - } - - - /** - * - * @param Relation $relation - * @return void - */ - public function addRelation(Relation $relation) { - $this->relations[] = $relation; - $relation->setParent($this); - } - - /** - * - * @param Relation $relation - * @return void - */ - public function removeRelation(Relation $relation) { - /*@var $removed Relation */ - $removed = $this->relations->removeElement($relation); - if ($removed !== null) { - $removed->removeParent(); - } - } - - /** - * - * @return kateglo\application\utilities\collections\ArrayCollection - */ - public function getRelations() { - return $this->relations; - } - -} - -/** - * - * @Entity - * @Table(name="relation") - */ -class Relation { - - const CLASS_NAME = __CLASS__; - - /** - * @var int - * @Id - * @Column(type="integer", name="relation_id") - * @GeneratedValue(strategy="AUTO") - */ - private $id; - - /** - * @var Lemma - * @ManyToOne(targetEntity="Lemma", inversedBy="relations") - * @JoinColumn(name="relation_parent_id", referencedColumnName="lemma_id") - */ - private $parent; - - /** - * @var Lemma - * @OneToOne(targetEntity="Lemma") - * @JoinColumn(name="relation_child_id", referencedColumnName="lemma_id") - */ - private $child; - - /** - * @var RelationType - * @ManyToOne(targetEntity="RelationType", inversedBy="relations") - * @JoinColumn(name="relation_type_id", referencedColumnName="relation_type_id") - */ - private $type; - - /** - * - * @param Lemma $parent - * @return void - */ - public function setParent(Lemma $parent) { - $this->parent = $parent; - } - - /** - * - * @return Phrase - */ - public function getParent() { - return $this->parent; - } - - /** - * - * @return void - */ - public function removeParent() { - if ($this->lemma !== null) { - /*@var $phrase Lemma */ - $lemma = $this->parent; - $this->parent = null; - $lemma->removeRelation($this); - } - } - - /** - * - * @param Lemma $child - * @return void - */ - public function setChild(Lemma $child) { - $this->child = $child; - } - - /** - * - * @return Lemma - */ - public function getChild() { - return $this->child; - } - - /** - * - * @param RelationType $type - * @return void - */ - public function setType(RelationType $type) { - $this->type = $type; - } - - /** - * - * @return RelationType - */ - public function getType() { - return $this->type; - } - - /** - * - * @return void - */ - public function removeType() { - if ($this->type !== null) { - /*@var $phrase RelationType */ - $type = $this->type; - $this->type = null; - $type->removeRelation($this); - } - } -} - -/** - * - * @Entity - * @Table(name="relation_type") - */ -class RelationType { - - const CLASS_NAME = __CLASS__; - - /** - * - * @var int - * @Id - * @Column(type="integer", name="relation_type_id") - * @GeneratedValue(strategy="AUTO") - */ - private $id; - - /** - * - * @var string - * @Column(type="string", name="relation_type_name", unique=true, length=255) - */ - private $type; - - /** - * - * @var string - * @Column(type="string", name="relation_type_abbreviation", unique=true, length=255) - */ - private $abbreviation; - - /** - * @var kateglo\application\utilities\collections\ArrayCollection - * @OneToMany(targetEntity="Relation", mappedBy="type", cascade={"persist"}) - */ - private $relations; - - public function __construct() { - $relations = new \Doctrine\Common\Collections\ArrayCollection(); - } - - /** - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * - * @param string $type - * @return void - */ - public function setType($type) { - $this->type = $type; - } - - /** - * - * @return string - */ - public function getType() { - return $this->type; - } - - /** - * - * @param string $abbreviation - * @return void - */ - public function setAbbreviation($abbreviation) { - $this->abbreviation = $abbreviation; - } - - /** - * - * @return string - */ - public function getAbbreviation() { - return $this->abbreviation; - } - - /** - * - * @param Relation $relation - * @return void - */ - public function addRelation(Relation $relation) { - $this->relations[] = $relation; - $relation->setType($this); - } - - /** - * - * @param Relation $relation - * @return void - */ - public function removeRelation(Relation $relation) { - /*@var $removed Relation */ - $removed = $this->relations->removeElement($relation); - if ($removed !== null) { - $removed->removeLemma(); - } - } - - /** - * - * @return kateglo\application\utilities\collections\ArrayCollection - */ - public function getRelations() { - return $this->relations; - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/TypeTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/TypeTest.php deleted file mode 100644 index 9ed8cf0..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/TypeTest.php +++ /dev/null @@ -1,182 +0,0 @@ -useModelSet('generic'); - parent::setUp(); - } - - public function testDecimal() - { - $decimal = new DecimalModel(); - $decimal->decimal = 0.15; - $decimal->highScale = 0.1515; - - $this->_em->persist($decimal); - $this->_em->flush(); - $this->_em->clear(); - - $dql = "SELECT d FROM Doctrine\Tests\Models\Generic\DecimalModel d"; - $decimal = $this->_em->createQuery($dql)->getSingleResult(); - - $this->assertEquals(0.15, $decimal->decimal); - $this->assertEquals(0.1515, $decimal->highScale); - } - - /** - * @group DDC-1394 - * @return void - */ - public function testBoolean() - { - $bool = new BooleanModel(); - $bool->booleanField = true; - - $this->_em->persist($bool); - $this->_em->flush(); - $this->_em->clear(); - - $dql = "SELECT b FROM Doctrine\Tests\Models\Generic\BooleanModel b WHERE b.booleanField = true"; - $bool = $this->_em->createQuery($dql)->getSingleResult(); - - $this->assertTrue($bool->booleanField); - - $bool->booleanField = false; - - $this->_em->flush(); - $this->_em->clear(); - - $dql = "SELECT b FROM Doctrine\Tests\Models\Generic\BooleanModel b WHERE b.booleanField = false"; - $bool = $this->_em->createQuery($dql)->getSingleResult(); - - $this->assertFalse($bool->booleanField); - } - - public function testArray() - { - $serialize = new SerializationModel(); - $serialize->array["foo"] = "bar"; - $serialize->array["bar"] = "baz"; - - $this->_em->persist($serialize); - $this->_em->flush(); - $this->_em->clear(); - - $dql = "SELECT s FROM Doctrine\Tests\Models\Generic\SerializationModel s"; - $serialize = $this->_em->createQuery($dql)->getSingleResult(); - - $this->assertEquals(array("foo" => "bar", "bar" => "baz"), $serialize->array); - } - - public function testObject() - { - $serialize = new SerializationModel(); - $serialize->object = new \stdClass(); - - $this->_em->persist($serialize); - $this->_em->flush(); - $this->_em->clear(); - - $dql = "SELECT s FROM Doctrine\Tests\Models\Generic\SerializationModel s"; - $serialize = $this->_em->createQuery($dql)->getSingleResult(); - - $this->assertInstanceOf('stdClass', $serialize->object); - } - - public function testDate() - { - $dateTime = new DateTimeModel(); - $dateTime->date = new \DateTime('2009-10-01', new \DateTimeZone('Europe/Berlin')); - - $this->_em->persist($dateTime); - $this->_em->flush(); - $this->_em->clear(); - - $dateTimeDb = $this->_em->find('Doctrine\Tests\Models\Generic\DateTimeModel', $dateTime->id); - - $this->assertInstanceOf('DateTime', $dateTimeDb->date); - $this->assertEquals('2009-10-01', $dateTimeDb->date->format('Y-m-d')); - } - - public function testDateTime() - { - $dateTime = new DateTimeModel(); - $dateTime->datetime = new \DateTime('2009-10-02 20:10:52', new \DateTimeZone('Europe/Berlin')); - - $this->_em->persist($dateTime); - $this->_em->flush(); - $this->_em->clear(); - - $dateTimeDb = $this->_em->find('Doctrine\Tests\Models\Generic\DateTimeModel', $dateTime->id); - - $this->assertInstanceOf('DateTime', $dateTimeDb->datetime); - $this->assertEquals('2009-10-02 20:10:52', $dateTimeDb->datetime->format('Y-m-d H:i:s')); - - $articles = $this->_em->getRepository( 'Doctrine\Tests\Models\Generic\DateTimeModel' )->findBy( array( 'datetime' => new \DateTime( "now" ) ) ); - $this->assertEquals( 0, count( $articles ) ); - } - - public function testDqlQueryBindDateTimeInstance() - { - $date = new \DateTime('2009-10-02 20:10:52', new \DateTimeZone('Europe/Berlin')); - - $dateTime = new DateTimeModel(); - $dateTime->datetime = $date; - - $this->_em->persist($dateTime); - $this->_em->flush(); - $this->_em->clear(); - - $dateTimeDb = $this->_em->createQuery('SELECT d FROM Doctrine\Tests\Models\Generic\DateTimeModel d WHERE d.datetime = ?1') - ->setParameter(1, $date, DBALType::DATETIME) - ->getSingleResult(); - } - - public function testDqlQueryBuilderBindDateTimeInstance() - { - $date = new \DateTime('2009-10-02 20:10:52', new \DateTimeZone('Europe/Berlin')); - - $dateTime = new DateTimeModel(); - $dateTime->datetime = $date; - - $this->_em->persist($dateTime); - $this->_em->flush(); - $this->_em->clear(); - - $dateTimeDb = $this->_em->createQueryBuilder() - ->select('d') - ->from('Doctrine\Tests\Models\Generic\DateTimeModel', 'd') - ->where('d.datetime = ?1') - ->setParameter(1, $date, DBALType::DATETIME) - ->getQuery()->getSingleResult(); - } - - public function testTime() - { - $dateTime = new DateTimeModel(); - $dateTime->time = new \DateTime('2010-01-01 19:27:20'); - - $this->_em->persist($dateTime); - $this->_em->flush(); - $this->_em->clear(); - - $dateTimeDb = $this->_em->find('Doctrine\Tests\Models\Generic\DateTimeModel', $dateTime->id); - - $this->assertInstanceOf('DateTime', $dateTime->time); - $this->assertEquals('19:27:20', $dateTime->time->format('H:i:s')); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/TypeValueSqlTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/TypeValueSqlTest.php deleted file mode 100644 index 1bd5184..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/TypeValueSqlTest.php +++ /dev/null @@ -1,105 +0,0 @@ -useModelSet('customtype'); - parent::setUp(); - } - - public function testUpperCaseStringType() - { - $entity = new CustomTypeUpperCase(); - $entity->lowerCaseString = 'foo'; - - $this->_em->persist($entity); - $this->_em->flush(); - - $id = $entity->id; - - $this->_em->clear(); - - $entity = $this->_em->find('\Doctrine\Tests\Models\CustomType\CustomTypeUpperCase', $id); - - $this->assertEquals('foo', $entity->lowerCaseString, 'Entity holds lowercase string'); - $this->assertEquals('FOO', $this->_em->getConnection()->fetchColumn("select lowerCaseString from customtype_uppercases where id=".$entity->id.""), 'Database holds uppercase string'); - } - - public function testTypeValueSqlWithAssociations() - { - $parent = new CustomTypeParent(); - $parent->customInteger = -1; - $parent->child = new CustomTypeChild(); - - $friend1 = new CustomTypeParent(); - $friend2 = new CustomTypeParent(); - - $parent->addMyFriend($friend1); - $parent->addMyFriend($friend2); - - $this->_em->persist($parent); - $this->_em->persist($friend1); - $this->_em->persist($friend2); - $this->_em->flush(); - - $parentId = $parent->id; - - $this->_em->clear(); - - $entity = $this->_em->find('Doctrine\Tests\Models\CustomType\CustomTypeParent', $parentId); - - $this->assertTrue($entity->customInteger < 0, 'Fetched customInteger negative'); - $this->assertEquals(1, $this->_em->getConnection()->fetchColumn("select customInteger from customtype_parents where id=".$entity->id.""), 'Database has stored customInteger positive'); - - $this->assertNotNull($parent->child, 'Child attached'); - $this->assertCount(2, $entity->getMyFriends(), '2 friends attached'); - } - - public function testSelectDQL() - { - $parent = new CustomTypeParent(); - $parent->customInteger = -1; - $parent->child = new CustomTypeChild(); - - $this->_em->persist($parent); - $this->_em->flush(); - - $parentId = $parent->id; - - $this->_em->clear(); - - $query = $this->_em->createQuery("SELECT p, p.customInteger, c from Doctrine\Tests\Models\CustomType\CustomTypeParent p JOIN p.child c where p.id = " . $parentId); - - $result = $query->getResult(); - - $this->assertEquals(1, count($result)); - $this->assertInstanceOf('Doctrine\Tests\Models\CustomType\CustomTypeParent', $result[0][0]); - $this->assertEquals(-1, $result[0][0]->customInteger); - - $this->assertEquals(-1, $result[0]['customInteger']); - - $this->assertEquals('foo', $result[0][0]->child->lowerCaseString); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/UnitOfWorkLifecycleTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/UnitOfWorkLifecycleTest.php deleted file mode 100644 index 08e3720..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/UnitOfWorkLifecycleTest.php +++ /dev/null @@ -1,71 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - public function testScheduleInsertManaged() - { - $user = new CmsUser(); - $user->username = "beberlei"; - $user->name = "Benjamin"; - $user->status = "active"; - $this->_em->persist($user); - $this->_em->flush(); - - $this->setExpectedException("Doctrine\ORM\ORMInvalidArgumentException", "A managed+dirty entity Doctrine\Tests\Models\CMS\CmsUser"); - $this->_em->getUnitOfWork()->scheduleForInsert($user); - } - - public function testScheduleInsertDeleted() - { - $user = new CmsUser(); - $user->username = "beberlei"; - $user->name = "Benjamin"; - $user->status = "active"; - $this->_em->persist($user); - $this->_em->flush(); - - $this->_em->remove($user); - - $this->setExpectedException("Doctrine\ORM\ORMInvalidArgumentException", "Removed entity Doctrine\Tests\Models\CMS\CmsUser"); - $this->_em->getUnitOfWork()->scheduleForInsert($user); - } - - public function testScheduleInsertTwice() - { - $user = new CmsUser(); - $user->username = "beberlei"; - $user->name = "Benjamin"; - $user->status = "active"; - - $this->_em->getUnitOfWork()->scheduleForInsert($user); - - $this->setExpectedException("Doctrine\ORM\ORMInvalidArgumentException", "Entity Doctrine\Tests\Models\CMS\CmsUser"); - $this->_em->getUnitOfWork()->scheduleForInsert($user); - } - - public function testAddToIdentityMapWithoutIdentity() - { - $user = new CmsUser(); - - $this->setExpectedException("Doctrine\ORM\ORMInvalidArgumentException", "The given entity of type 'Doctrine\Tests\Models\CMS\CmsUser' (Doctrine\Tests\Models\CMS\CmsUser@"); - $this->_em->getUnitOfWork()->registerManaged($user, array(), array()); - } - - public function testMarkReadOnlyNonManaged() - { - $user = new CmsUser(); - - $this->setExpectedException("Doctrine\ORM\ORMInvalidArgumentException", "Only managed entities can be marked or checked as read only. But Doctrine\Tests\Models\CMS\CmsUser@"); - $this->_em->getUnitOfWork()->markReadOnly($user); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ArrayHydratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ArrayHydratorTest.php deleted file mode 100644 index b72e361..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ArrayHydratorTest.php +++ /dev/null @@ -1,1147 +0,0 @@ -addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb' - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage' - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ArrayHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm); - - $this->assertEquals(2, count($result)); - - $this->assertTrue(is_array($result)); - - $this->assertEquals(1, $result[0]['id']); - $this->assertEquals('romanb', $result[0]['name']); - - $this->assertEquals(2, $result[1]['id']); - $this->assertEquals('jwage', $result[1]['name']); - } - - /** - * SELECT PARTIAL u.{id, name} AS user - * FROM Doctrine\Tests\Models\CMS\CmsUser u - */ - public function testSimpleEntityQueryWithAliasedUserEntity() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', 'user'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb' - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage' - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ArrayHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm); - - $this->assertEquals(2, count($result)); - - $this->assertTrue(is_array($result)); - - $this->assertArrayHasKey('user', $result[0]); - $this->assertEquals(1, $result[0]['user']['id']); - $this->assertEquals('romanb', $result[0]['user']['name']); - - $this->assertArrayHasKey('user', $result[1]); - $this->assertEquals(2, $result[1]['user']['id']); - $this->assertEquals('jwage', $result[1]['user']['name']); - } - - /** - * SELECT PARTIAL u.{id, name}, PARTIAL a.{id, topic} - * FROM Doctrine\Tests\Models\CMS\CmsUser u, Doctrine\Tests\Models\CMS\CmsArticle a - */ - public function testSimpleMultipleRootEntityQuery() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsArticle', 'a'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - $rsm->addFieldResult('a', 'a__id', 'id'); - $rsm->addFieldResult('a', 'a__topic', 'topic'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb', - 'a__id' => '1', - 'a__topic' => 'Cool things.' - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'a__id' => '2', - 'a__topic' => 'Cool things II.' - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ArrayHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm); - - $this->assertEquals(4, count($result)); - - $this->assertEquals(1, $result[0]['id']); - $this->assertEquals('romanb', $result[0]['name']); - - $this->assertEquals(1, $result[1]['id']); - $this->assertEquals('Cool things.', $result[1]['topic']); - - $this->assertEquals(2, $result[2]['id']); - $this->assertEquals('jwage', $result[2]['name']); - - $this->assertEquals(2, $result[3]['id']); - $this->assertEquals('Cool things II.', $result[3]['topic']); - } - - /** - * SELECT PARTIAL u.{id, name} AS user, PARTIAL a.{id, topic} - * FROM Doctrine\Tests\Models\CMS\CmsUser u, Doctrine\Tests\Models\CMS\CmsArticle a - */ - public function testSimpleMultipleRootEntityQueryWithAliasedUserEntity() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', 'user'); - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsArticle', 'a'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - $rsm->addFieldResult('a', 'a__id', 'id'); - $rsm->addFieldResult('a', 'a__topic', 'topic'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb', - 'a__id' => '1', - 'a__topic' => 'Cool things.' - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'a__id' => '2', - 'a__topic' => 'Cool things II.' - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ArrayHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm); - - $this->assertEquals(4, count($result)); - - $this->assertArrayHasKey('user', $result[0]); - $this->assertEquals(1, $result[0]['user']['id']); - $this->assertEquals('romanb', $result[0]['user']['name']); - - $this->assertArrayHasKey(0, $result[1]); - $this->assertEquals(1, $result[1][0]['id']); - $this->assertEquals('Cool things.', $result[1][0]['topic']); - - $this->assertArrayHasKey('user', $result[2]); - $this->assertEquals(2, $result[2]['user']['id']); - $this->assertEquals('jwage', $result[2]['user']['name']); - - $this->assertArrayHasKey(0, $result[3]); - $this->assertEquals(2, $result[3][0]['id']); - $this->assertEquals('Cool things II.', $result[3][0]['topic']); - } - - /** - * SELECT PARTIAL u.{id, name}, PARTIAL a.{id, topic} AS article - * FROM Doctrine\Tests\Models\CMS\CmsUser u, Doctrine\Tests\Models\CMS\CmsArticle a - */ - public function testSimpleMultipleRootEntityQueryWithAliasedArticleEntity() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsArticle', 'a', 'article'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - $rsm->addFieldResult('a', 'a__id', 'id'); - $rsm->addFieldResult('a', 'a__topic', 'topic'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb', - 'a__id' => '1', - 'a__topic' => 'Cool things.' - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'a__id' => '2', - 'a__topic' => 'Cool things II.' - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ArrayHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm); - - $this->assertEquals(4, count($result)); - - $this->assertArrayHasKey(0, $result[0]); - $this->assertEquals(1, $result[0][0]['id']); - $this->assertEquals('romanb', $result[0][0]['name']); - - $this->assertArrayHasKey('article', $result[1]); - $this->assertEquals(1, $result[1]['article']['id']); - $this->assertEquals('Cool things.', $result[1]['article']['topic']); - - $this->assertArrayHasKey(0, $result[2]); - $this->assertEquals(2, $result[2][0]['id']); - $this->assertEquals('jwage', $result[2][0]['name']); - - $this->assertArrayHasKey('article', $result[3]); - $this->assertEquals(2, $result[3]['article']['id']); - $this->assertEquals('Cool things II.', $result[3]['article']['topic']); - } - - /** - * SELECT PARTIAL u.{id, name} AS user, PARTIAL a.{id, topic} AS article - * FROM Doctrine\Tests\Models\CMS\CmsUser u, Doctrine\Tests\Models\CMS\CmsArticle a - */ - public function testSimpleMultipleRootEntityQueryWithAliasedEntities() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', 'user'); - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsArticle', 'a', 'article'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - $rsm->addFieldResult('a', 'a__id', 'id'); - $rsm->addFieldResult('a', 'a__topic', 'topic'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb', - 'a__id' => '1', - 'a__topic' => 'Cool things.' - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'a__id' => '2', - 'a__topic' => 'Cool things II.' - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ArrayHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm); - - $this->assertEquals(4, count($result)); - - $this->assertArrayHasKey('user', $result[0]); - $this->assertEquals(1, $result[0]['user']['id']); - $this->assertEquals('romanb', $result[0]['user']['name']); - - $this->assertArrayHasKey('article', $result[1]); - $this->assertEquals(1, $result[1]['article']['id']); - $this->assertEquals('Cool things.', $result[1]['article']['topic']); - - $this->assertArrayHasKey('user', $result[2]); - $this->assertEquals(2, $result[2]['user']['id']); - $this->assertEquals('jwage', $result[2]['user']['name']); - - $this->assertArrayHasKey('article', $result[3]); - $this->assertEquals(2, $result[3]['article']['id']); - $this->assertEquals('Cool things II.', $result[3]['article']['topic']); - } - - /** - * SELECT PARTIAL u.{id, status}, COUNT(p.phonenumber) AS numPhones - * FROM Doctrine\Tests\Models\CMS\CmsUser u - * JOIN u.phonenumbers p - * GROUP BY u.status, u.id - * - * @dataProvider provideDataForUserEntityResult - */ - public function testMixedQueryNormalJoin($userEntityKey) - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', $userEntityKey ?: null); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addScalarResult('sclr0', 'numPhones'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => '2', - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'sclr0' => '1', - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ArrayHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm); - - $this->assertEquals(2, count($result)); - $this->assertTrue(is_array($result)); - $this->assertTrue(is_array($result[0])); - $this->assertTrue(is_array($result[1])); - - // first user => 2 phonenumbers - $this->assertArrayHasKey($userEntityKey, $result[0]); - $this->assertEquals(2, $result[0]['numPhones']); - - // second user => 1 phonenumber - $this->assertArrayHasKey($userEntityKey, $result[1]); - $this->assertEquals(1, $result[1]['numPhones']); - } - - /** - * SELECT PARTIAL u.{id, status}, PARTIAL p.{phonenumber}, UPPER(u.name) AS nameUpper - * FROM Doctrine\Tests\Models\CMS\CmsUser u - * JOIN u.phonenumbers p - * - * @dataProvider provideDataForUserEntityResult - */ - public function testMixedQueryFetchJoin($userEntityKey) - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', $userEntityKey ?: null); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsPhonenumber', - 'p', - 'u', - 'phonenumbers' - ); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addScalarResult('sclr0', 'nameUpper'); - $rsm->addFieldResult('p', 'p__phonenumber', 'phonenumber'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '42', - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '43', - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'sclr0' => 'JWAGE', - 'p__phonenumber' => '91' - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ArrayHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm); - - $this->assertEquals(2, count($result)); - - $this->assertTrue(is_array($result)); - $this->assertTrue(is_array($result[0])); - $this->assertTrue(is_array($result[1])); - - // first user => 2 phonenumbers - $this->assertEquals(2, count($result[0][$userEntityKey]['phonenumbers'])); - $this->assertEquals('ROMANB', $result[0]['nameUpper']); - - // second user => 1 phonenumber - $this->assertEquals(1, count($result[1][$userEntityKey]['phonenumbers'])); - $this->assertEquals('JWAGE', $result[1]['nameUpper']); - - $this->assertEquals(42, $result[0][$userEntityKey]['phonenumbers'][0]['phonenumber']); - $this->assertEquals(43, $result[0][$userEntityKey]['phonenumbers'][1]['phonenumber']); - $this->assertEquals(91, $result[1][$userEntityKey]['phonenumbers'][0]['phonenumber']); - } - - /** - * SELECT PARTIAL u.{id, status}, UPPER(u.name) nameUpper - * FROM Doctrine\Tests\Models\CMS\CmsUser u - * INDEX BY u.id - * JOIN u.phonenumbers p - * INDEX BY p.phonenumber - * - * @dataProvider provideDataForUserEntityResult - */ - public function testMixedQueryFetchJoinCustomIndex($userEntityKey) - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', $userEntityKey ?: null); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsPhonenumber', - 'p', - 'u', - 'phonenumbers' - ); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addScalarResult('sclr0', 'nameUpper'); - $rsm->addFieldResult('p', 'p__phonenumber', 'phonenumber'); - $rsm->addIndexBy('u', 'id'); - $rsm->addIndexBy('p', 'phonenumber'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '42', - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '43', - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'sclr0' => 'JWAGE', - 'p__phonenumber' => '91' - ) - ); - - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ArrayHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm); - - $this->assertEquals(2, count($result)); - - $this->assertTrue(is_array($result)); - $this->assertTrue(is_array($result[1])); - $this->assertTrue(is_array($result[2])); - - // test the scalar values - $this->assertEquals('ROMANB', $result[1]['nameUpper']); - $this->assertEquals('JWAGE', $result[2]['nameUpper']); - - // first user => 2 phonenumbers. notice the custom indexing by user id - $this->assertEquals(2, count($result[1][$userEntityKey]['phonenumbers'])); - - // second user => 1 phonenumber. notice the custom indexing by user id - $this->assertEquals(1, count($result[2][$userEntityKey]['phonenumbers'])); - - // test the custom indexing of the phonenumbers - $this->assertTrue(isset($result[1][$userEntityKey]['phonenumbers']['42'])); - $this->assertTrue(isset($result[1][$userEntityKey]['phonenumbers']['43'])); - $this->assertTrue(isset($result[2][$userEntityKey]['phonenumbers']['91'])); - } - - /** - * select u.id, u.status, p.phonenumber, upper(u.name) nameUpper, a.id, a.topic - * from User u - * join u.phonenumbers p - * join u.articles a - * = - * select u.id, u.status, p.phonenumber, upper(u.name) as u__0, a.id, a.topic - * from USERS u - * inner join PHONENUMBERS p ON u.id = p.user_id - * inner join ARTICLES a ON u.id = a.user_id - */ - public function testMixedQueryMultipleFetchJoin() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsPhonenumber', - 'p', - 'u', - 'phonenumbers' - ); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsArticle', - 'a', - 'u', - 'articles' - ); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addScalarResult('sclr0', 'nameUpper'); - $rsm->addFieldResult('p', 'p__phonenumber', 'phonenumber'); - $rsm->addFieldResult('a', 'a__id', 'id'); - $rsm->addFieldResult('a', 'a__topic', 'topic'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '42', - 'a__id' => '1', - 'a__topic' => 'Getting things done!' - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '43', - 'a__id' => '1', - 'a__topic' => 'Getting things done!' - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '42', - 'a__id' => '2', - 'a__topic' => 'ZendCon' - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '43', - 'a__id' => '2', - 'a__topic' => 'ZendCon' - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'sclr0' => 'JWAGE', - 'p__phonenumber' => '91', - 'a__id' => '3', - 'a__topic' => 'LINQ' - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'sclr0' => 'JWAGE', - 'p__phonenumber' => '91', - 'a__id' => '4', - 'a__topic' => 'PHP6' - ), - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ArrayHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm); - - $this->assertEquals(2, count($result)); - $this->assertTrue(is_array($result)); - $this->assertTrue(is_array($result[0])); - $this->assertTrue(is_array($result[1])); - // first user => 2 phonenumbers, 2 articles - $this->assertEquals(2, count($result[0][0]['phonenumbers'])); - $this->assertEquals(2, count($result[0][0]['articles'])); - $this->assertEquals('ROMANB', $result[0]['nameUpper']); - // second user => 1 phonenumber, 2 articles - $this->assertEquals(1, count($result[1][0]['phonenumbers'])); - $this->assertEquals(2, count($result[1][0]['articles'])); - $this->assertEquals('JWAGE', $result[1]['nameUpper']); - - $this->assertEquals(42, $result[0][0]['phonenumbers'][0]['phonenumber']); - $this->assertEquals(43, $result[0][0]['phonenumbers'][1]['phonenumber']); - $this->assertEquals(91, $result[1][0]['phonenumbers'][0]['phonenumber']); - - $this->assertEquals('Getting things done!', $result[0][0]['articles'][0]['topic']); - $this->assertEquals('ZendCon', $result[0][0]['articles'][1]['topic']); - $this->assertEquals('LINQ', $result[1][0]['articles'][0]['topic']); - $this->assertEquals('PHP6', $result[1][0]['articles'][1]['topic']); - } - - /** - * select u.id, u.status, p.phonenumber, upper(u.name) nameUpper, a.id, a.topic, - * c.id, c.topic - * from User u - * join u.phonenumbers p - * join u.articles a - * left join a.comments c - * = - * select u.id, u.status, p.phonenumber, upper(u.name) as u__0, a.id, a.topic, - * c.id, c.topic - * from USERS u - * inner join PHONENUMBERS p ON u.id = p.user_id - * inner join ARTICLES a ON u.id = a.user_id - * left outer join COMMENTS c ON a.id = c.article_id - */ - public function testMixedQueryMultipleDeepMixedFetchJoin() - { - - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsPhonenumber', - 'p', - 'u', - 'phonenumbers' - ); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsArticle', - 'a', - 'u', - 'articles' - ); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsComment', - 'c', - 'a', - 'comments' - ); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addScalarResult('sclr0', 'nameUpper'); - $rsm->addFieldResult('p', 'p__phonenumber', 'phonenumber'); - $rsm->addFieldResult('a', 'a__id', 'id'); - $rsm->addFieldResult('a', 'a__topic', 'topic'); - $rsm->addFieldResult('c', 'c__id', 'id'); - $rsm->addFieldResult('c', 'c__topic', 'topic'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '42', - 'a__id' => '1', - 'a__topic' => 'Getting things done!', - 'c__id' => '1', - 'c__topic' => 'First!' - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '43', - 'a__id' => '1', - 'a__topic' => 'Getting things done!', - 'c__id' => '1', - 'c__topic' => 'First!' - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '42', - 'a__id' => '2', - 'a__topic' => 'ZendCon', - 'c__id' => null, - 'c__topic' => null - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '43', - 'a__id' => '2', - 'a__topic' => 'ZendCon', - 'c__id' => null, - 'c__topic' => null - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'sclr0' => 'JWAGE', - 'p__phonenumber' => '91', - 'a__id' => '3', - 'a__topic' => 'LINQ', - 'c__id' => null, - 'c__topic' => null - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'sclr0' => 'JWAGE', - 'p__phonenumber' => '91', - 'a__id' => '4', - 'a__topic' => 'PHP6', - 'c__id' => null, - 'c__topic' => null - ), - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ArrayHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm); - - $this->assertEquals(2, count($result)); - $this->assertTrue(is_array($result)); - $this->assertTrue(is_array($result[0])); - $this->assertTrue(is_array($result[1])); - - // first user => 2 phonenumbers, 2 articles, 1 comment on first article - $this->assertEquals(2, count($result[0][0]['phonenumbers'])); - $this->assertEquals(2, count($result[0][0]['articles'])); - $this->assertEquals(1, count($result[0][0]['articles'][0]['comments'])); - $this->assertEquals('ROMANB', $result[0]['nameUpper']); - // second user => 1 phonenumber, 2 articles, no comments - $this->assertEquals(1, count($result[1][0]['phonenumbers'])); - $this->assertEquals(2, count($result[1][0]['articles'])); - $this->assertEquals('JWAGE', $result[1]['nameUpper']); - - $this->assertEquals(42, $result[0][0]['phonenumbers'][0]['phonenumber']); - $this->assertEquals(43, $result[0][0]['phonenumbers'][1]['phonenumber']); - $this->assertEquals(91, $result[1][0]['phonenumbers'][0]['phonenumber']); - - $this->assertEquals('Getting things done!', $result[0][0]['articles'][0]['topic']); - $this->assertEquals('ZendCon', $result[0][0]['articles'][1]['topic']); - $this->assertEquals('LINQ', $result[1][0]['articles'][0]['topic']); - $this->assertEquals('PHP6', $result[1][0]['articles'][1]['topic']); - - $this->assertEquals('First!', $result[0][0]['articles'][0]['comments'][0]['topic']); - - $this->assertTrue(isset($result[0][0]['articles'][0]['comments'])); - - // empty comment collections - $this->assertTrue(is_array($result[0][0]['articles'][1]['comments'])); - $this->assertEquals(0, count($result[0][0]['articles'][1]['comments'])); - $this->assertTrue(is_array($result[1][0]['articles'][0]['comments'])); - $this->assertEquals(0, count($result[1][0]['articles'][0]['comments'])); - $this->assertTrue(is_array($result[1][0]['articles'][1]['comments'])); - $this->assertEquals(0, count($result[1][0]['articles'][1]['comments'])); - } - - /** - * Tests that the hydrator does not rely on a particular order of the rows - * in the result set. - * - * DQL: - * select c.id, c.position, c.name, b.id, b.position - * from \Doctrine\Tests\Models\Forum\ForumCategory c inner join c.boards b - * order by c.position asc, b.position asc - * - * Checks whether the boards are correctly assigned to the categories. - * - * The 'evil' result set that confuses the object population is displayed below. - * - * c.id | c.position | c.name | boardPos | b.id | b.category_id (just for clarity) - * 1 | 0 | First | 0 | 1 | 1 - * 2 | 0 | Second | 0 | 2 | 2 <-- - * 1 | 0 | First | 1 | 3 | 1 - * 1 | 0 | First | 2 | 4 | 1 - */ - public function testEntityQueryCustomResultSetOrder() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\Forum\ForumCategory', 'c'); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\Forum\ForumBoard', - 'b', - 'c', - 'boards' - ); - - $rsm->addFieldResult('c', 'c__id', 'id'); - $rsm->addFieldResult('c', 'c__position', 'position'); - $rsm->addFieldResult('c', 'c__name', 'name'); - $rsm->addFieldResult('b', 'b__id', 'id'); - $rsm->addFieldResult('b', 'b__position', 'position'); - - // Faked result set - $resultSet = array( - array( - 'c__id' => '1', - 'c__position' => '0', - 'c__name' => 'First', - 'b__id' => '1', - 'b__position' => '0', - //'b__category_id' => '1' - ), - array( - 'c__id' => '2', - 'c__position' => '0', - 'c__name' => 'Second', - 'b__id' => '2', - 'b__position' => '0', - //'b__category_id' => '2' - ), - array( - 'c__id' => '1', - 'c__position' => '0', - 'c__name' => 'First', - 'b__id' => '3', - 'b__position' => '1', - //'b__category_id' => '1' - ), - array( - 'c__id' => '1', - 'c__position' => '0', - 'c__name' => 'First', - 'b__id' => '4', - 'b__position' => '2', - //'b__category_id' => '1' - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ArrayHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm); - - $this->assertEquals(2, count($result)); - $this->assertTrue(is_array($result)); - $this->assertTrue(is_array($result[0])); - $this->assertTrue(is_array($result[1])); - $this->assertTrue(isset($result[0]['boards'])); - $this->assertEquals(3, count($result[0]['boards'])); - $this->assertTrue(isset($result[1]['boards'])); - $this->assertEquals(1, count($result[1]['boards'])); - } - - /** - * SELECT PARTIAL u.{id,status}, a.id, a.topic, c.id as cid, c.topic as ctopic - * FROM Doctrine\Tests\Models\CMS\CmsUser u - * LEFT JOIN u.articles a - * LEFT JOIN a.comments c - * - * @dataProvider provideDataForUserEntityResult - */ - public function testChainedJoinWithScalars($entityKey) - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', $entityKey ?: null); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addScalarResult('a__id', 'id'); - $rsm->addScalarResult('a__topic', 'topic'); - $rsm->addScalarResult('c__id', 'cid'); - $rsm->addScalarResult('c__topic', 'ctopic'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'a__id' => '1', - 'a__topic' => 'The First', - 'c__id' => '1', - 'c__topic' => 'First Comment' - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'a__id' => '1', - 'a__topic' => 'The First', - 'c__id' => '2', - 'c__topic' => 'Second Comment' - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'a__id' => '42', - 'a__topic' => 'The Answer', - 'c__id' => null, - 'c__topic' => null - ), - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ArrayHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm); - - $this->assertEquals(3, count($result)); - - $this->assertEquals(2, count($result[0][$entityKey])); // User array - $this->assertEquals(1, $result[0]['id']); - $this->assertEquals('The First', $result[0]['topic']); - $this->assertEquals(1, $result[0]['cid']); - $this->assertEquals('First Comment', $result[0]['ctopic']); - - $this->assertEquals(2, count($result[1][$entityKey])); // User array, duplicated - $this->assertEquals(1, $result[1]['id']); // duplicated - $this->assertEquals('The First', $result[1]['topic']); // duplicated - $this->assertEquals(2, $result[1]['cid']); - $this->assertEquals('Second Comment', $result[1]['ctopic']); - - $this->assertEquals(2, count($result[2][$entityKey])); // User array, duplicated - $this->assertEquals(42, $result[2]['id']); - $this->assertEquals('The Answer', $result[2]['topic']); - $this->assertNull($result[2]['cid']); - $this->assertNull($result[2]['ctopic']); - } - - /** - * SELECT PARTIAL u.{id, status} - * FROM Doctrine\Tests\Models\CMS\CmsUser u - */ - public function testResultIteration() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb' - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage' - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ArrayHydrator($this->_em); - $iterator = $hydrator->iterate($stmt, $rsm); - $rowNum = 0; - - while (($row = $iterator->next()) !== false) { - $this->assertEquals(1, count($row)); - $this->assertTrue(is_array($row[0])); - - if ($rowNum == 0) { - $this->assertEquals(1, $row[0]['id']); - $this->assertEquals('romanb', $row[0]['name']); - } else if ($rowNum == 1) { - $this->assertEquals(2, $row[0]['id']); - $this->assertEquals('jwage', $row[0]['name']); - } - - ++$rowNum; - } - } - - /** - * SELECT PARTIAL u.{id, status} - * FROM Doctrine\Tests\Models\CMS\CmsUser u - */ - public function testResultIterationWithAliasedUserEntity() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', 'user'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb' - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage' - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ArrayHydrator($this->_em); - $iterator = $hydrator->iterate($stmt, $rsm); - $rowNum = 0; - - while (($row = $iterator->next()) !== false) { - $this->assertEquals(1, count($row)); - $this->assertArrayHasKey(0, $row); - $this->assertArrayHasKey('user', $row[0]); - - if ($rowNum == 0) { - $this->assertEquals(1, $row[0]['user']['id']); - $this->assertEquals('romanb', $row[0]['user']['name']); - } else if ($rowNum == 1) { - $this->assertEquals(2, $row[0]['user']['id']); - $this->assertEquals('jwage', $row[0]['user']['name']); - } - - ++$rowNum; - } - } - - /** - * SELECT PARTIAL u.{id, name} - * FROM Doctrine\Tests\Models\CMS\CmsUser u - * - * @group DDC-644 - */ - public function testSkipUnknownColumns() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb', - 'foo' => 'bar', // unknown! - ), - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ArrayHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm); - - $this->assertEquals(1, count($result)); - $this->assertArrayHasKey('id', $result[0]); - $this->assertArrayHasKey('name', $result[0]); - $this->assertArrayNotHasKey('foo', $result[0]); - } - - /** - * SELECT PARTIAL u.{id, status}, UPPER(u.name) AS nameUpper - * FROM Doctrine\Tests\Models\CMS\CmsUser u - * - * @group DDC-1358 - * @dataProvider provideDataForUserEntityResult - */ - public function testMissingIdForRootEntity($userEntityKey) - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', $userEntityKey ?: null); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addScalarResult('sclr0', 'nameUpper'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - ), - array( - 'u__id' => null, - 'u__status' => null, - 'sclr0' => 'ROMANB', - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'sclr0' => 'JWAGE', - ), - array( - 'u__id' => null, - 'u__status' => null, - 'sclr0' => 'JWAGE', - ), - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ArrayHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm); - - $this->assertEquals(4, count($result), "Should hydrate four results."); - - $this->assertEquals('ROMANB', $result[0]['nameUpper']); - $this->assertEquals('ROMANB', $result[1]['nameUpper']); - $this->assertEquals('JWAGE', $result[2]['nameUpper']); - $this->assertEquals('JWAGE', $result[3]['nameUpper']); - - $this->assertEquals(array('id' => 1, 'status' => 'developer'), $result[0][$userEntityKey]); - $this->assertNull($result[1][$userEntityKey]); - $this->assertEquals(array('id' => 2, 'status' => 'developer'), $result[2][$userEntityKey]); - $this->assertNull($result[3][$userEntityKey]); - } - - /** - * SELECT PARTIAL u.{id, status}, UPPER(u.name) AS nameUpper - * FROM Doctrine\Tests\Models\CMS\CmsUser u - * INDEX BY u.id - * - * @group DDC-1385 - * @dataProvider provideDataForUserEntityResult - */ - public function testIndexByAndMixedResult($userEntityKey) - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', $userEntityKey ?: null); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addScalarResult('sclr0', 'nameUpper'); - $rsm->addIndexBy('u', 'id'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'sclr0' => 'JWAGE', - ), - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ArrayHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm); - - $this->assertEquals(2, count($result)); - - $this->assertTrue(isset($result[1])); - $this->assertEquals(1, $result[1][$userEntityKey]['id']); - - $this->assertTrue(isset($result[2])); - $this->assertEquals(2, $result[2][$userEntityKey]['id']); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/CustomHydratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/CustomHydratorTest.php deleted file mode 100644 index 09be6bc..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/CustomHydratorTest.php +++ /dev/null @@ -1,29 +0,0 @@ -_getTestEntityManager(); - $config = $em->getConfiguration(); - $config->addCustomHydrationMode('CustomHydrator', 'Doctrine\Tests\ORM\Hydration\CustomHydrator'); - - $hydrator = $em->newHydrator('CustomHydrator'); - $this->assertInstanceOf('Doctrine\Tests\ORM\Hydration\CustomHydrator', $hydrator); - $this->assertNull($config->getCustomHydrationMode('does not exist')); - } -} - -class CustomHydrator extends AbstractHydrator -{ - protected function hydrateAllData() - { - return $this->_stmt->fetchAll(PDO::FETCH_ASSOC); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/HydrationTestCase.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/HydrationTestCase.php deleted file mode 100644 index 6602403..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/HydrationTestCase.php +++ /dev/null @@ -1,30 +0,0 @@ -_em = $this->_getTestEntityManager(); - } - - /** Helper method */ - protected function _createParserResult($resultSetMapping, $isMixedQuery = false) - { - $parserResult = new ParserResult; - $parserResult->setResultSetMapping($resultSetMapping); - //$parserResult->setDefaultQueryComponentAlias(key($queryComponents)); - //$parserResult->setTableAliasMap($tableToClassAliasMap); - $parserResult->setMixedQuery($isMixedQuery); - return $parserResult; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ObjectHydratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ObjectHydratorTest.php deleted file mode 100644 index b6bc7cd..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ObjectHydratorTest.php +++ /dev/null @@ -1,1866 +0,0 @@ -addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb' - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage' - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(2, count($result)); - - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[1]); - - $this->assertEquals(1, $result[0]->id); - $this->assertEquals('romanb', $result[0]->name); - - $this->assertEquals(2, $result[1]->id); - $this->assertEquals('jwage', $result[1]->name); - } - - /** - * SELECT PARTIAL u.{id,name} AS user - * FROM Doctrine\Tests\Models\CMS\CmsUser u - */ - public function testSimpleEntityQueryWithAliasedUserEntity() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', 'user'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb' - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage' - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(2, count($result)); - - $this->assertArrayHasKey('user', $result[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0]['user']); - - $this->assertArrayHasKey('user', $result[1]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[1]['user']); - - $this->assertEquals(1, $result[0]['user']->id); - $this->assertEquals('romanb', $result[0]['user']->name); - - $this->assertEquals(2, $result[1]['user']->id); - $this->assertEquals('jwage', $result[1]['user']->name); - } - - /** - * SELECT PARTIAL u.{id, name}, PARTIAL a.{id, topic} - * FROM Doctrine\Tests\Models\CMS\CmsUser u, Doctrine\Tests\Models\CMS\CmsArticle a - */ - public function testSimpleMultipleRootEntityQuery() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsArticle', 'a'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - $rsm->addFieldResult('a', 'a__id', 'id'); - $rsm->addFieldResult('a', 'a__topic', 'topic'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb', - 'a__id' => '1', - 'a__topic' => 'Cool things.' - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'a__id' => '2', - 'a__topic' => 'Cool things II.' - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(4, count($result)); - - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsArticle', $result[1]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[2]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsArticle', $result[3]); - - $this->assertEquals(1, $result[0]->id); - $this->assertEquals('romanb', $result[0]->name); - - $this->assertEquals(1, $result[1]->id); - $this->assertEquals('Cool things.', $result[1]->topic); - - $this->assertEquals(2, $result[2]->id); - $this->assertEquals('jwage', $result[2]->name); - - $this->assertEquals(2, $result[3]->id); - $this->assertEquals('Cool things II.', $result[3]->topic); - } - - /** - * SELECT PARTIAL u.{id, name} AS user, PARTIAL a.{id, topic} - * FROM Doctrine\Tests\Models\CMS\CmsUser u, Doctrine\Tests\Models\CMS\CmsArticle a - */ - public function testSimpleMultipleRootEntityQueryWithAliasedUserEntity() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', 'user'); - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsArticle', 'a'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - $rsm->addFieldResult('a', 'a__id', 'id'); - $rsm->addFieldResult('a', 'a__topic', 'topic'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb', - 'a__id' => '1', - 'a__topic' => 'Cool things.' - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'a__id' => '2', - 'a__topic' => 'Cool things II.' - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(4, count($result)); - - $this->assertArrayHasKey('user', $result[0]); - $this->assertArrayNotHasKey(0, $result[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0]['user']); - $this->assertEquals(1, $result[0]['user']->id); - $this->assertEquals('romanb', $result[0]['user']->name); - - $this->assertArrayHasKey(0, $result[1]); - $this->assertArrayNotHasKey('user', $result[1]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsArticle', $result[1][0]); - $this->assertEquals(1, $result[1][0]->id); - $this->assertEquals('Cool things.', $result[1][0]->topic); - - $this->assertArrayHasKey('user', $result[2]); - $this->assertArrayNotHasKey(0, $result[2]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[2]['user']); - $this->assertEquals(2, $result[2]['user']->id); - $this->assertEquals('jwage', $result[2]['user']->name); - - $this->assertArrayHasKey(0, $result[3]); - $this->assertArrayNotHasKey('user', $result[3]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsArticle', $result[3][0]); - $this->assertEquals(2, $result[3][0]->id); - $this->assertEquals('Cool things II.', $result[3][0]->topic); - } - - /** - * SELECT PARTIAL u.{id, name}, PARTIAL a.{id, topic} AS article - * FROM Doctrine\Tests\Models\CMS\CmsUser u, Doctrine\Tests\Models\CMS\CmsArticle a - */ - public function testSimpleMultipleRootEntityQueryWithAliasedArticleEntity() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsArticle', 'a', 'article'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - $rsm->addFieldResult('a', 'a__id', 'id'); - $rsm->addFieldResult('a', 'a__topic', 'topic'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb', - 'a__id' => '1', - 'a__topic' => 'Cool things.' - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'a__id' => '2', - 'a__topic' => 'Cool things II.' - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(4, count($result)); - - $this->assertArrayHasKey(0, $result[0]); - $this->assertArrayNotHasKey('article', $result[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0][0]); - $this->assertEquals(1, $result[0][0]->id); - $this->assertEquals('romanb', $result[0][0]->name); - - $this->assertArrayHasKey('article', $result[1]); - $this->assertArrayNotHasKey(0, $result[1]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsArticle', $result[1]['article']); - $this->assertEquals(1, $result[1]['article']->id); - $this->assertEquals('Cool things.', $result[1]['article']->topic); - - $this->assertArrayHasKey(0, $result[2]); - $this->assertArrayNotHasKey('article', $result[2]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[2][0]); - $this->assertEquals(2, $result[2][0]->id); - $this->assertEquals('jwage', $result[2][0]->name); - - $this->assertArrayHasKey('article', $result[3]); - $this->assertArrayNotHasKey(0, $result[3]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsArticle', $result[3]['article']); - $this->assertEquals(2, $result[3]['article']->id); - $this->assertEquals('Cool things II.', $result[3]['article']->topic); - } - - /** - * SELECT PARTIAL u.{id, name} AS user, PARTIAL a.{id, topic} AS article - * FROM Doctrine\Tests\Models\CMS\CmsUser u, Doctrine\Tests\Models\CMS\CmsArticle a - */ - public function testSimpleMultipleRootEntityQueryWithAliasedEntities() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', 'user'); - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsArticle', 'a', 'article'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - $rsm->addFieldResult('a', 'a__id', 'id'); - $rsm->addFieldResult('a', 'a__topic', 'topic'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb', - 'a__id' => '1', - 'a__topic' => 'Cool things.' - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'a__id' => '2', - 'a__topic' => 'Cool things II.' - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(4, count($result)); - - $this->assertArrayHasKey('user', $result[0]); - $this->assertArrayNotHasKey('article', $result[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0]['user']); - $this->assertEquals(1, $result[0]['user']->id); - $this->assertEquals('romanb', $result[0]['user']->name); - - $this->assertArrayHasKey('article', $result[1]); - $this->assertArrayNotHasKey('user', $result[1]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsArticle', $result[1]['article']); - $this->assertEquals(1, $result[1]['article']->id); - $this->assertEquals('Cool things.', $result[1]['article']->topic); - - $this->assertArrayHasKey('user', $result[2]); - $this->assertArrayNotHasKey('article', $result[2]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[2]['user']); - $this->assertEquals(2, $result[2]['user']->id); - $this->assertEquals('jwage', $result[2]['user']->name); - - $this->assertArrayHasKey('article', $result[3]); - $this->assertArrayNotHasKey('user', $result[3]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsArticle', $result[3]['article']); - $this->assertEquals(2, $result[3]['article']->id); - $this->assertEquals('Cool things II.', $result[3]['article']->topic); - } - - /** - * SELECT PARTIAL u.{id, status}, COUNT(p.phonenumber) numPhones - * FROM User u - * JOIN u.phonenumbers p - * GROUP BY u.id - * - * @dataProvider provideDataForUserEntityResult - */ - public function testMixedQueryNormalJoin($userEntityKey) - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', $userEntityKey ?: null); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addScalarResult('sclr0', 'numPhones'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => '2', - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'sclr0' => '1', - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(2, count($result)); - - $this->assertInternalType('array', $result); - $this->assertInternalType('array', $result[0]); - $this->assertInternalType('array', $result[1]); - - // first user => 2 phonenumbers - $this->assertEquals(2, $result[0]['numPhones']); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0][$userEntityKey]); - - // second user => 1 phonenumber - $this->assertEquals(1, $result[1]['numPhones']); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[1][$userEntityKey]); - } - - /** - * SELECT PARTIAL u.{id, status}, PARTIAL p.{phonenumber}, UPPER(u.name) nameUpper - * FROM Doctrine\Tests\Models\CMS\CmsUser u - * JOIN u.phonenumbers p - * - * @dataProvider provideDataForUserEntityResult - */ - public function testMixedQueryFetchJoin($userEntityKey) - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', $userEntityKey ?: null); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsPhonenumber', - 'p', - 'u', - 'phonenumbers' - ); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addFieldResult('p', 'p__phonenumber', 'phonenumber'); - $rsm->addScalarResult('sclr0', 'nameUpper'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'p__phonenumber' => '42', - 'sclr0' => 'ROMANB', - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'p__phonenumber' => '43', - 'sclr0' => 'ROMANB', - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'p__phonenumber' => '91', - 'sclr0' => 'JWAGE', - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(2, count($result)); - - $this->assertInternalType('array', $result); - $this->assertInternalType('array', $result[0]); - $this->assertInternalType('array', $result[1]); - - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0][$userEntityKey]); - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $result[0][$userEntityKey]->phonenumbers); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsPhonenumber', $result[0][$userEntityKey]->phonenumbers[0]); - - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[1][$userEntityKey]); - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $result[1][$userEntityKey]->phonenumbers); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsPhonenumber', $result[0][$userEntityKey]->phonenumbers[1]); - - // first user => 2 phonenumbers - $this->assertEquals(2, count($result[0][$userEntityKey]->phonenumbers)); - $this->assertEquals('ROMANB', $result[0]['nameUpper']); - - // second user => 1 phonenumber - $this->assertEquals(1, count($result[1][$userEntityKey]->phonenumbers)); - $this->assertEquals('JWAGE', $result[1]['nameUpper']); - - $this->assertEquals(42, $result[0][$userEntityKey]->phonenumbers[0]->phonenumber); - $this->assertEquals(43, $result[0][$userEntityKey]->phonenumbers[1]->phonenumber); - $this->assertEquals(91, $result[1][$userEntityKey]->phonenumbers[0]->phonenumber); - } - - /** - * SELECT u, p, UPPER(u.name) nameUpper - * FROM User u - * INDEX BY u.id - * JOIN u.phonenumbers p - * INDEX BY p.phonenumber - * - * @dataProvider provideDataForUserEntityResult - */ - public function testMixedQueryFetchJoinCustomIndex($userEntityKey) - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', $userEntityKey ?: null); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsPhonenumber', - 'p', - 'u', - 'phonenumbers' - ); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addScalarResult('sclr0', 'nameUpper'); - $rsm->addFieldResult('p', 'p__phonenumber', 'phonenumber'); - $rsm->addIndexBy('u', 'id'); - $rsm->addIndexBy('p', 'phonenumber'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '42', - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '43', - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'sclr0' => 'JWAGE', - 'p__phonenumber' => '91' - ) - ); - - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(2, count($result)); - - $this->assertInternalType('array', $result); - $this->assertInternalType('array', $result[1]); - $this->assertInternalType('array', $result[2]); - - // test the scalar values - $this->assertEquals('ROMANB', $result[1]['nameUpper']); - $this->assertEquals('JWAGE', $result[2]['nameUpper']); - - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[1][$userEntityKey]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[2][$userEntityKey]); - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $result[1][$userEntityKey]->phonenumbers); - - // first user => 2 phonenumbers. notice the custom indexing by user id - $this->assertEquals(2, count($result[1][$userEntityKey]->phonenumbers)); - - // second user => 1 phonenumber. notice the custom indexing by user id - $this->assertEquals(1, count($result[2][$userEntityKey]->phonenumbers)); - - // test the custom indexing of the phonenumbers - $this->assertTrue(isset($result[1][$userEntityKey]->phonenumbers['42'])); - $this->assertTrue(isset($result[1][$userEntityKey]->phonenumbers['43'])); - $this->assertTrue(isset($result[2][$userEntityKey]->phonenumbers['91'])); - } - - /** - * SELECT u, p, UPPER(u.name) nameUpper, a - * FROM User u - * JOIN u.phonenumbers p - * JOIN u.articles a - * - * @dataProvider provideDataForUserEntityResult - */ - public function testMixedQueryMultipleFetchJoin($userEntityKey) - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', $userEntityKey ?: null); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsPhonenumber', - 'p', - 'u', - 'phonenumbers' - ); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsArticle', - 'a', - 'u', - 'articles' - ); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addScalarResult('sclr0', 'nameUpper'); - $rsm->addFieldResult('p', 'p__phonenumber', 'phonenumber'); - $rsm->addFieldResult('a', 'a__id', 'id'); - $rsm->addFieldResult('a', 'a__topic', 'topic'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '42', - 'a__id' => '1', - 'a__topic' => 'Getting things done!' - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '43', - 'a__id' => '1', - 'a__topic' => 'Getting things done!' - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '42', - 'a__id' => '2', - 'a__topic' => 'ZendCon' - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '43', - 'a__id' => '2', - 'a__topic' => 'ZendCon' - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'sclr0' => 'JWAGE', - 'p__phonenumber' => '91', - 'a__id' => '3', - 'a__topic' => 'LINQ' - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'sclr0' => 'JWAGE', - 'p__phonenumber' => '91', - 'a__id' => '4', - 'a__topic' => 'PHP6' - ), - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(2, count($result)); - - $this->assertTrue(is_array($result)); - $this->assertTrue(is_array($result[0])); - $this->assertTrue(is_array($result[1])); - - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0][$userEntityKey]); - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $result[0][$userEntityKey]->phonenumbers); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsPhonenumber', $result[0][$userEntityKey]->phonenumbers[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsPhonenumber', $result[0][$userEntityKey]->phonenumbers[1]); - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $result[0][$userEntityKey]->articles); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsArticle', $result[0][$userEntityKey]->articles[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsArticle', $result[0][$userEntityKey]->articles[1]); - - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[1][$userEntityKey]); - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $result[1][$userEntityKey]->phonenumbers); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsPhonenumber', $result[1][$userEntityKey]->phonenumbers[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsArticle', $result[1][$userEntityKey]->articles[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsArticle', $result[1][$userEntityKey]->articles[1]); - } - - /** - * SELECT u, p, UPPER(u.name) nameUpper, a, c - * FROM User u - * JOIN u.phonenumbers p - * JOIN u.articles a - * LEFT JOIN a.comments c - * - * @dataProvider provideDataForUserEntityResult - */ - public function testMixedQueryMultipleDeepMixedFetchJoin($userEntityKey) - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', $userEntityKey ?: null); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsPhonenumber', - 'p', - 'u', - 'phonenumbers' - ); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsArticle', - 'a', - 'u', - 'articles' - ); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsComment', - 'c', - 'a', - 'comments' - ); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addScalarResult('sclr0', 'nameUpper'); - $rsm->addFieldResult('p', 'p__phonenumber', 'phonenumber'); - $rsm->addFieldResult('a', 'a__id', 'id'); - $rsm->addFieldResult('a', 'a__topic', 'topic'); - $rsm->addFieldResult('c', 'c__id', 'id'); - $rsm->addFieldResult('c', 'c__topic', 'topic'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '42', - 'a__id' => '1', - 'a__topic' => 'Getting things done!', - 'c__id' => '1', - 'c__topic' => 'First!' - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '43', - 'a__id' => '1', - 'a__topic' => 'Getting things done!', - 'c__id' => '1', - 'c__topic' => 'First!' - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '42', - 'a__id' => '2', - 'a__topic' => 'ZendCon', - 'c__id' => null, - 'c__topic' => null - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '43', - 'a__id' => '2', - 'a__topic' => 'ZendCon', - 'c__id' => null, - 'c__topic' => null - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'sclr0' => 'JWAGE', - 'p__phonenumber' => '91', - 'a__id' => '3', - 'a__topic' => 'LINQ', - 'c__id' => null, - 'c__topic' => null - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'sclr0' => 'JWAGE', - 'p__phonenumber' => '91', - 'a__id' => '4', - 'a__topic' => 'PHP6', - 'c__id' => null, - 'c__topic' => null - ), - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(2, count($result)); - - $this->assertTrue(is_array($result)); - $this->assertTrue(is_array($result[0])); - $this->assertTrue(is_array($result[1])); - - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0][$userEntityKey]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[1][$userEntityKey]); - - // phonenumbers - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $result[0][$userEntityKey]->phonenumbers); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsPhonenumber', $result[0][$userEntityKey]->phonenumbers[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsPhonenumber', $result[0][$userEntityKey]->phonenumbers[1]); - - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $result[1][$userEntityKey]->phonenumbers); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsPhonenumber', $result[1][$userEntityKey]->phonenumbers[0]); - - // articles - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $result[0][$userEntityKey]->articles); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsArticle', $result[0][$userEntityKey]->articles[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsArticle', $result[0][$userEntityKey]->articles[1]); - - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsArticle', $result[1][$userEntityKey]->articles[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsArticle', $result[1][$userEntityKey]->articles[1]); - - // article comments - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $result[0][$userEntityKey]->articles[0]->comments); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsComment', $result[0][$userEntityKey]->articles[0]->comments[0]); - - // empty comment collections - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $result[0][$userEntityKey]->articles[1]->comments); - $this->assertEquals(0, count($result[0][$userEntityKey]->articles[1]->comments)); - - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $result[1][$userEntityKey]->articles[0]->comments); - $this->assertEquals(0, count($result[1][$userEntityKey]->articles[0]->comments)); - $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $result[1][$userEntityKey]->articles[1]->comments); - $this->assertEquals(0, count($result[1][$userEntityKey]->articles[1]->comments)); - } - - /** - * Tests that the hydrator does not rely on a particular order of the rows - * in the result set. - * - * DQL: - * select c, b from Doctrine\Tests\Models\Forum\ForumCategory c inner join c.boards b - * order by c.position asc, b.position asc - * - * Checks whether the boards are correctly assigned to the categories. - * - * The 'evil' result set that confuses the object population is displayed below. - * - * c.id | c.position | c.name | boardPos | b.id | b.category_id (just for clarity) - * 1 | 0 | First | 0 | 1 | 1 - * 2 | 0 | Second | 0 | 2 | 2 <-- - * 1 | 0 | First | 1 | 3 | 1 - * 1 | 0 | First | 2 | 4 | 1 - */ - public function testEntityQueryCustomResultSetOrder() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\Forum\ForumCategory', 'c'); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\Forum\ForumBoard', - 'b', - 'c', - 'boards' - ); - $rsm->addFieldResult('c', 'c__id', 'id'); - $rsm->addFieldResult('c', 'c__position', 'position'); - $rsm->addFieldResult('c', 'c__name', 'name'); - $rsm->addFieldResult('b', 'b__id', 'id'); - $rsm->addFieldResult('b', 'b__position', 'position'); - - // Faked result set - $resultSet = array( - array( - 'c__id' => '1', - 'c__position' => '0', - 'c__name' => 'First', - 'b__id' => '1', - 'b__position' => '0', - //'b__category_id' => '1' - ), - array( - 'c__id' => '2', - 'c__position' => '0', - 'c__name' => 'Second', - 'b__id' => '2', - 'b__position' => '0', - //'b__category_id' => '2' - ), - array( - 'c__id' => '1', - 'c__position' => '0', - 'c__name' => 'First', - 'b__id' => '3', - 'b__position' => '1', - //'b__category_id' => '1' - ), - array( - 'c__id' => '1', - 'c__position' => '0', - 'c__name' => 'First', - 'b__id' => '4', - 'b__position' => '2', - //'b__category_id' => '1' - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(2, count($result)); - - $this->assertInstanceOf('Doctrine\Tests\Models\Forum\ForumCategory', $result[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\Forum\ForumCategory', $result[1]); - - $this->assertTrue($result[0] !== $result[1]); - - $this->assertEquals(1, $result[0]->getId()); - $this->assertEquals(2, $result[1]->getId()); - - $this->assertTrue(isset($result[0]->boards)); - $this->assertEquals(3, count($result[0]->boards)); - - $this->assertTrue(isset($result[1]->boards)); - $this->assertEquals(1, count($result[1]->boards)); - } - - /** - * SELECT PARTIAL u.{id,name} - * FROM Doctrine\Tests\Models\CMS\CmsUser u - * - * @group DDC-644 - */ - public function testSkipUnknownColumns() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb', - 'foo' => 'bar', // unknown! - ), - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(1, count($result)); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0]); - } - - /** - * SELECT u.id, u.name - * FROM Doctrine\Tests\Models\CMS\CmsUser u - * - * @dataProvider provideDataForUserEntityResult - */ - public function testScalarQueryWithoutResultVariables($userEntityKey) - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', $userEntityKey ?: null); - $rsm->addScalarResult('sclr0', 'id'); - $rsm->addScalarResult('sclr1', 'name'); - - // Faked result set - $resultSet = array( - array( - 'sclr0' => '1', - 'sclr1' => 'romanb' - ), - array( - 'sclr0' => '2', - 'sclr1' => 'jwage' - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(2, count($result)); - - $this->assertInternalType('array', $result[0]); - $this->assertInternalType('array', $result[1]); - - $this->assertEquals(1, $result[0]['id']); - $this->assertEquals('romanb', $result[0]['name']); - - $this->assertEquals(2, $result[1]['id']); - $this->assertEquals('jwage', $result[1]['name']); - } - - /** - * SELECT p - * FROM Doctrine\Tests\Models\ECommerce\ECommerceProduct p - */ - public function testCreatesProxyForLazyLoadingWithForeignKeys() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\ECommerce\ECommerceProduct', 'p'); - $rsm->addFieldResult('p', 'p__id', 'id'); - $rsm->addFieldResult('p', 'p__name', 'name'); - $rsm->addMetaResult('p', 'p__shipping_id', 'shipping_id'); - - // Faked result set - $resultSet = array( - array( - 'p__id' => '1', - 'p__name' => 'Doctrine Book', - 'p__shipping_id' => 42 - ) - ); - - $proxyInstance = new \Doctrine\Tests\Models\ECommerce\ECommerceShipping(); - - // mocking the proxy factory - $proxyFactory = $this->getMock('Doctrine\ORM\Proxy\ProxyFactory', array('getProxy'), array(), '', false, false, false); - $proxyFactory->expects($this->once()) - ->method('getProxy') - ->with($this->equalTo('Doctrine\Tests\Models\ECommerce\ECommerceShipping'), array('id' => 42)) - ->will($this->returnValue($proxyInstance)); - - $this->_em->setProxyFactory($proxyFactory); - - // configuring lazy loading - $metadata = $this->_em->getClassMetadata('Doctrine\Tests\Models\ECommerce\ECommerceProduct'); - $metadata->associationMappings['shipping']['fetch'] = ClassMetadata::FETCH_LAZY; - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm); - - $this->assertEquals(1, count($result)); - - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $result[0]); - } - - /** - * SELECT p AS product - * FROM Doctrine\Tests\Models\ECommerce\ECommerceProduct p - */ - public function testCreatesProxyForLazyLoadingWithForeignKeysWithAliasedProductEntity() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\ECommerce\ECommerceProduct', 'p', 'product'); - $rsm->addFieldResult('p', 'p__id', 'id'); - $rsm->addFieldResult('p', 'p__name', 'name'); - $rsm->addMetaResult('p', 'p__shipping_id', 'shipping_id'); - - // Faked result set - $resultSet = array( - array( - 'p__id' => '1', - 'p__name' => 'Doctrine Book', - 'p__shipping_id' => 42 - ) - ); - - $proxyInstance = new \Doctrine\Tests\Models\ECommerce\ECommerceShipping(); - - // mocking the proxy factory - $proxyFactory = $this->getMock('Doctrine\ORM\Proxy\ProxyFactory', array('getProxy'), array(), '', false, false, false); - $proxyFactory->expects($this->once()) - ->method('getProxy') - ->with($this->equalTo('Doctrine\Tests\Models\ECommerce\ECommerceShipping'), array('id' => 42)) - ->will($this->returnValue($proxyInstance)); - - $this->_em->setProxyFactory($proxyFactory); - - // configuring lazy loading - $metadata = $this->_em->getClassMetadata('Doctrine\Tests\Models\ECommerce\ECommerceProduct'); - $metadata->associationMappings['shipping']['fetch'] = ClassMetadata::FETCH_LAZY; - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm); - - $this->assertEquals(1, count($result)); - - $this->assertInternalType('array', $result[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $result[0]['product']); - } - - /** - * SELECT PARTIAL u.{id, status}, PARTIAL a.{id, topic}, PARTIAL c.{id, topic} - * FROM Doctrine\Tests\Models\CMS\CmsUser u - * LEFT JOIN u.articles a - * LEFT JOIN a.comments c - */ - public function testChainedJoinWithEmptyCollections() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsArticle', - 'a', - 'u', - 'articles' - ); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsComment', - 'c', - 'a', - 'comments' - ); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addFieldResult('a', 'a__id', 'id'); - $rsm->addFieldResult('a', 'a__topic', 'topic'); - $rsm->addFieldResult('c', 'c__id', 'id'); - $rsm->addFieldResult('c', 'c__topic', 'topic'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'a__id' => null, - 'a__topic' => null, - 'c__id' => null, - 'c__topic' => null - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'a__id' => null, - 'a__topic' => null, - 'c__id' => null, - 'c__topic' => null - ), - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(2, count($result)); - - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[1]); - - $this->assertEquals(0, $result[0]->articles->count()); - $this->assertEquals(0, $result[1]->articles->count()); - } - - /** - * SELECT PARTIAL u.{id, status} AS user, PARTIAL a.{id, topic}, PARTIAL c.{id, topic} - * FROM Doctrine\Tests\Models\CMS\CmsUser u - * LEFT JOIN u.articles a - * LEFT JOIN a.comments c - */ - public function testChainedJoinWithEmptyCollectionsWithAliasedUserEntity() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', 'user'); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsArticle', - 'a', - 'u', - 'articles' - ); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsComment', - 'c', - 'a', - 'comments' - ); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addFieldResult('a', 'a__id', 'id'); - $rsm->addFieldResult('a', 'a__topic', 'topic'); - $rsm->addFieldResult('c', 'c__id', 'id'); - $rsm->addFieldResult('c', 'c__topic', 'topic'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'a__id' => null, - 'a__topic' => null, - 'c__id' => null, - 'c__topic' => null - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'a__id' => null, - 'a__topic' => null, - 'c__id' => null, - 'c__topic' => null - ), - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(2, count($result)); - - $this->assertInternalType('array', $result[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0]['user']); - - $this->assertInternalType('array', $result[1]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[1]['user']); - - $this->assertEquals(0, $result[0]['user']->articles->count()); - $this->assertEquals(0, $result[1]['user']->articles->count()); - } - - /** - * SELECT PARTIAL u.{id,status}, a.id, a.topic, c.id as cid, c.topic as ctopic - * FROM CmsUser u - * LEFT JOIN u.articles a - * LEFT JOIN a.comments c - * - * @group bubu - * @dataProvider provideDataForUserEntityResult - */ - /*public function testChainedJoinWithScalars($userEntityKey) - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', $userEntityKey ?: null); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addScalarResult('a__id', 'id'); - $rsm->addScalarResult('a__topic', 'topic'); - $rsm->addScalarResult('c__id', 'cid'); - $rsm->addScalarResult('c__topic', 'ctopic'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'a__id' => '1', - 'a__topic' => 'The First', - 'c__id' => '1', - 'c__topic' => 'First Comment' - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'a__id' => '1', - 'a__topic' => 'The First', - 'c__id' => '2', - 'c__topic' => 'Second Comment' - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'a__id' => '42', - 'a__topic' => 'The Answer', - 'c__id' => null, - 'c__topic' => null - ), - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - \Doctrine\Common\Util\Debug::dump($result, 3); - - $this->assertEquals(1, count($result)); - - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0][$userEntityKey]); // User object - $this->assertEquals(42, $result[0]['id']); - $this->assertEquals('The First', $result[0]['topic']); - $this->assertEquals(1, $result[0]['cid']); - $this->assertEquals('First Comment', $result[0]['ctopic']); - }*/ - - /** - * SELECT PARTIAL u.{id, name} - * FROM Doctrine\Tests\Models\CMS\CmsUser u - */ - public function testResultIteration() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb' - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage' - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $iterableResult = $hydrator->iterate($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - $rowNum = 0; - - while (($row = $iterableResult->next()) !== false) { - $this->assertEquals(1, count($row)); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $row[0]); - - if ($rowNum == 0) { - $this->assertEquals(1, $row[0]->id); - $this->assertEquals('romanb', $row[0]->name); - } else if ($rowNum == 1) { - $this->assertEquals(2, $row[0]->id); - $this->assertEquals('jwage', $row[0]->name); - } - - ++$rowNum; - } - } - - /** - * SELECT PARTIAL u.{id, name} - * FROM Doctrine\Tests\Models\CMS\CmsUser u - */ - public function testResultIterationWithAliasedUserEntity() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', 'user'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb' - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage' - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $iterableResult = $hydrator->iterate($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - $rowNum = 0; - - while (($row = $iterableResult->next()) !== false) { - $this->assertEquals(1, count($row)); - $this->assertArrayHasKey(0, $row); - $this->assertArrayHasKey('user', $row[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $row[0]['user']); - - if ($rowNum == 0) { - $this->assertEquals(1, $row[0]['user']->id); - $this->assertEquals('romanb', $row[0]['user']->name); - } else if ($rowNum == 1) { - $this->assertEquals(2, $row[0]['user']->id); - $this->assertEquals('jwage', $row[0]['user']->name); - } - - ++$rowNum; - } - } - - /** - * Checks if multiple joined multiple-valued collections is hydrated correctly. - * - * SELECT PARTIAL u.{id, status}, PARTIAL g.{id, name}, PARTIAL p.{phonenumber} - * FROM Doctrine\Tests\Models\CMS\CmsUser u - * - * @group DDC-809 - */ - public function testManyToManyHydration() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - $rsm->addJoinedEntityResult('Doctrine\Tests\Models\CMS\CmsGroup', 'g', 'u', 'groups'); - $rsm->addFieldResult('g', 'g__id', 'id'); - $rsm->addFieldResult('g', 'g__name', 'name'); - $rsm->addJoinedEntityResult('Doctrine\Tests\Models\CMS\CmsPhonenumber', 'p', 'u', 'phonenumbers'); - $rsm->addFieldResult('p', 'p__phonenumber', 'phonenumber'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb', - 'g__id' => '3', - 'g__name' => 'TestGroupB', - 'p__phonenumber' => 1111, - ), - array( - 'u__id' => '1', - 'u__name' => 'romanb', - 'g__id' => '5', - 'g__name' => 'TestGroupD', - 'p__phonenumber' => 1111, - ), - array( - 'u__id' => '1', - 'u__name' => 'romanb', - 'g__id' => '3', - 'g__name' => 'TestGroupB', - 'p__phonenumber' => 2222, - ), - array( - 'u__id' => '1', - 'u__name' => 'romanb', - 'g__id' => '5', - 'g__name' => 'TestGroupD', - 'p__phonenumber' => 2222, - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'g__id' => '2', - 'g__name' => 'TestGroupA', - 'p__phonenumber' => 3333, - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'g__id' => '3', - 'g__name' => 'TestGroupB', - 'p__phonenumber' => 3333, - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'g__id' => '4', - 'g__name' => 'TestGroupC', - 'p__phonenumber' => 3333, - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'g__id' => '5', - 'g__name' => 'TestGroupD', - 'p__phonenumber' => 3333, - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'g__id' => '2', - 'g__name' => 'TestGroupA', - 'p__phonenumber' => 4444, - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'g__id' => '3', - 'g__name' => 'TestGroupB', - 'p__phonenumber' => 4444, - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'g__id' => '4', - 'g__name' => 'TestGroupC', - 'p__phonenumber' => 4444, - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'g__id' => '5', - 'g__name' => 'TestGroupD', - 'p__phonenumber' => 4444, - ), - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(2, count($result)); - - $this->assertContainsOnly('Doctrine\Tests\Models\CMS\CmsUser', $result); - - $this->assertEquals(2, count($result[0]->groups)); - $this->assertEquals(2, count($result[0]->phonenumbers)); - - $this->assertEquals(4, count($result[1]->groups)); - $this->assertEquals(2, count($result[1]->phonenumbers)); - } - - /** - * Checks if multiple joined multiple-valued collections is hydrated correctly. - * - * SELECT PARTIAL u.{id, status} As user, PARTIAL g.{id, name}, PARTIAL p.{phonenumber} - * FROM Doctrine\Tests\Models\CMS\CmsUser u - * - * @group DDC-809 - */ - public function testManyToManyHydrationWithAliasedUserEntity() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', 'user'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - $rsm->addJoinedEntityResult('Doctrine\Tests\Models\CMS\CmsGroup', 'g', 'u', 'groups'); - $rsm->addFieldResult('g', 'g__id', 'id'); - $rsm->addFieldResult('g', 'g__name', 'name'); - $rsm->addJoinedEntityResult('Doctrine\Tests\Models\CMS\CmsPhonenumber', 'p', 'u', 'phonenumbers'); - $rsm->addFieldResult('p', 'p__phonenumber', 'phonenumber'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb', - 'g__id' => '3', - 'g__name' => 'TestGroupB', - 'p__phonenumber' => 1111, - ), - array( - 'u__id' => '1', - 'u__name' => 'romanb', - 'g__id' => '5', - 'g__name' => 'TestGroupD', - 'p__phonenumber' => 1111, - ), - array( - 'u__id' => '1', - 'u__name' => 'romanb', - 'g__id' => '3', - 'g__name' => 'TestGroupB', - 'p__phonenumber' => 2222, - ), - array( - 'u__id' => '1', - 'u__name' => 'romanb', - 'g__id' => '5', - 'g__name' => 'TestGroupD', - 'p__phonenumber' => 2222, - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'g__id' => '2', - 'g__name' => 'TestGroupA', - 'p__phonenumber' => 3333, - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'g__id' => '3', - 'g__name' => 'TestGroupB', - 'p__phonenumber' => 3333, - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'g__id' => '4', - 'g__name' => 'TestGroupC', - 'p__phonenumber' => 3333, - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'g__id' => '5', - 'g__name' => 'TestGroupD', - 'p__phonenumber' => 3333, - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'g__id' => '2', - 'g__name' => 'TestGroupA', - 'p__phonenumber' => 4444, - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'g__id' => '3', - 'g__name' => 'TestGroupB', - 'p__phonenumber' => 4444, - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'g__id' => '4', - 'g__name' => 'TestGroupC', - 'p__phonenumber' => 4444, - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage', - 'g__id' => '5', - 'g__name' => 'TestGroupD', - 'p__phonenumber' => 4444, - ), - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(2, count($result)); - - $this->assertInternalType('array', $result[0]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0]['user']); - $this->assertInternalType('array', $result[1]); - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[1]['user']); - - $this->assertEquals(2, count($result[0]['user']->groups)); - $this->assertEquals(2, count($result[0]['user']->phonenumbers)); - - $this->assertEquals(4, count($result[1]['user']->groups)); - $this->assertEquals(2, count($result[1]['user']->phonenumbers)); - } - - /** - * SELECT PARTIAL u.{id, status}, UPPER(u.name) as nameUpper - * FROM Doctrine\Tests\Models\CMS\CmsUser u - * - * @group DDC-1358 - * @dataProvider provideDataForUserEntityResult - */ - public function testMissingIdForRootEntity($userEntityKey) - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', $userEntityKey ?: null); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addScalarResult('sclr0', 'nameUpper'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - ), - array( - 'u__id' => null, - 'u__status' => null, - 'sclr0' => 'ROMANB', - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'sclr0' => 'JWAGE', - ), - array( - 'u__id' => null, - 'u__status' => null, - 'sclr0' => 'JWAGE', - ), - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(4, count($result), "Should hydrate four results."); - - $this->assertEquals('ROMANB', $result[0]['nameUpper']); - $this->assertEquals('ROMANB', $result[1]['nameUpper']); - $this->assertEquals('JWAGE', $result[2]['nameUpper']); - $this->assertEquals('JWAGE', $result[3]['nameUpper']); - - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0][$userEntityKey]); - $this->assertNull($result[1][$userEntityKey]); - - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[2][$userEntityKey]); - $this->assertNull($result[3][$userEntityKey]); - } - - /** - * SELECT PARTIAL u.{id, status}, PARTIAL p.{phonenumber}, UPPER(u.name) AS nameUpper - * FROM Doctrine\Tests\Models\CMS\CmsUser u - * LEFT JOIN u.phonenumbers u - * - * @group DDC-1358 - * @dataProvider provideDataForUserEntityResult - */ - public function testMissingIdForCollectionValuedChildEntity($userEntityKey) - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', $userEntityKey ?: null); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsPhonenumber', - 'p', - 'u', - 'phonenumbers' - ); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addScalarResult('sclr0', 'nameUpper'); - $rsm->addFieldResult('p', 'p__phonenumber', 'phonenumber'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '42', - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => null - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'sclr0' => 'JWAGE', - 'p__phonenumber' => '91' - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'sclr0' => 'JWAGE', - 'p__phonenumber' => null - ) - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(2, count($result)); - - $this->assertEquals(1, $result[0][$userEntityKey]->phonenumbers->count()); - $this->assertEquals(1, $result[1][$userEntityKey]->phonenumbers->count()); - } - - /** - * SELECT PARTIAL u.{id, status}, PARTIAL a.{id, city}, UPPER(u.name) AS nameUpper - * FROM Doctrine\Tests\Models\CMS\CmsUser u - * JOIN u.address a - * - * @group DDC-1358 - * @dataProvider provideDataForUserEntityResult - */ - public function testMissingIdForSingleValuedChildEntity($userEntityKey) - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', $userEntityKey ?: null); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsAddress', - 'a', - 'u', - 'address' - ); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addScalarResult('sclr0', 'nameUpper'); - $rsm->addFieldResult('a', 'a__id', 'id'); - $rsm->addFieldResult('a', 'a__city', 'city'); - $rsm->addMetaResult('a', 'user_id', 'user_id'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - 'a__id' => 1, - 'a__city' => 'Berlin', - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'sclr0' => 'BENJAMIN', - 'a__id' => null, - 'a__city' => null, - ), - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(2, count($result)); - - $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsAddress', $result[0][$userEntityKey]->address); - $this->assertNull($result[1][$userEntityKey]->address); - } - - /** - * SELECT PARTIAL u.{id, status}, UPPER(u.name) AS nameUpper - * FROM Doctrine\Tests\Models\CMS\CmsUser u - * INDEX BY u.id - * - * @group DDC-1385 - * @dataProvider provideDataForUserEntityResult - */ - public function testIndexByAndMixedResult($userEntityKey) - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', $userEntityKey ?: null); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addScalarResult('sclr0', 'nameUpper'); - $rsm->addIndexBy('u', 'id'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'sclr0' => 'ROMANB', - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'sclr0' => 'JWAGE', - ), - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals(2, count($result)); - - $this->assertTrue(isset($result[1])); - $this->assertEquals(1, $result[1][$userEntityKey]->id); - - $this->assertTrue(isset($result[2])); - $this->assertEquals(2, $result[2][$userEntityKey]->id); - } - - /** - * SELECT UPPER(u.name) AS nameUpper - * FROM Doctrine\Tests\Models\CMS\CmsUser u - * - * @group DDC-1385 - * @dataProvider provideDataForUserEntityResult - */ - public function testIndexByScalarsOnly($userEntityKey) - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', $userEntityKey ?: null); - $rsm->addScalarResult('sclr0', 'nameUpper'); - $rsm->addIndexByScalar('sclr0'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'sclr0' => 'ROMANB', - ), - array( - 'sclr0' => 'JWAGE', - ), - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - - $this->assertEquals( - array( - 'ROMANB' => array('nameUpper' => 'ROMANB'), - 'JWAGE' => array('nameUpper' => 'JWAGE') - ), - $result - ); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ResultSetMappingTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ResultSetMappingTest.php deleted file mode 100644 index 785c19b..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ResultSetMappingTest.php +++ /dev/null @@ -1,97 +0,0 @@ -_rsm = new ResultSetMapping; - $this->_em = $this->_getTestEntityManager(); - } - - /** - * For SQL: SELECT id, status, username, name FROM cms_users - */ - public function testBasicResultSetMapping() - { - $this->_rsm->addEntityResult( - 'Doctrine\Tests\Models\CMS\CmsUser', - 'u' - ); - $this->_rsm->addFieldResult('u', 'id', 'id'); - $this->_rsm->addFieldResult('u', 'status', 'status'); - $this->_rsm->addFieldResult('u', 'username', 'username'); - $this->_rsm->addFieldResult('u', 'name', 'name'); - - $this->assertFalse($this->_rsm->isScalarResult('id')); - $this->assertFalse($this->_rsm->isScalarResult('status')); - $this->assertFalse($this->_rsm->isScalarResult('username')); - $this->assertFalse($this->_rsm->isScalarResult('name')); - - $this->assertTrue($this->_rsm->getClassName('u') == 'Doctrine\Tests\Models\CMS\CmsUser'); - $class = $this->_rsm->getDeclaringClass('id'); - $this->assertTrue($class == 'Doctrine\Tests\Models\CMS\CmsUser'); - - $this->assertEquals('u', $this->_rsm->getEntityAlias('id')); - $this->assertEquals('u', $this->_rsm->getEntityAlias('status')); - $this->assertEquals('u', $this->_rsm->getEntityAlias('username')); - $this->assertEquals('u', $this->_rsm->getEntityAlias('name')); - - $this->assertEquals('id', $this->_rsm->getFieldName('id')); - $this->assertEquals('status', $this->_rsm->getFieldName('status')); - $this->assertEquals('username', $this->_rsm->getFieldName('username')); - $this->assertEquals('name', $this->_rsm->getFieldName('name')); - } - - /** - * @group DDC-1057 - * - * Fluent interface test, not a real result set mapping - */ - public function testFluentInterface() - { - $rms = $this->_rsm; - - $rms->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser','u') - ->addJoinedEntityResult('Doctrine\Tests\Models\CMS\CmsPhonenumber','p','u','phonenumbers') - ->addFieldResult('u', 'id', 'id') - ->addFieldResult('u', 'name', 'name') - ->setDiscriminatorColumn('name', 'name') - ->addIndexByColumn('id', 'id') - ->addIndexBy('username', 'username') - ->addIndexByScalar('sclr0') - ->addScalarResult('sclr0', 'numPhones') - ->addMetaResult('a', 'user_id', 'user_id'); - - - $this->assertTrue($rms->hasIndexBy('id')); - $this->assertTrue($rms->isFieldResult('id')); - $this->assertTrue($rms->isFieldResult('name')); - $this->assertTrue($rms->isScalarResult('sclr0')); - $this->assertTrue($rms->isRelation('p')); - $this->assertTrue($rms->hasParentAlias('p')); - $this->assertTrue($rms->isMixedResult()); - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ScalarHydratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ScalarHydratorTest.php deleted file mode 100644 index c8c376f..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ScalarHydratorTest.php +++ /dev/null @@ -1,101 +0,0 @@ -addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - - // Faked result set - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb' - ), - array( - 'u__id' => '2', - 'u__name' => 'jwage' - ) - ); - - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ScalarHydrator($this->_em); - - $result = $hydrator->hydrateAll($stmt, $rsm); - - $this->assertTrue(is_array($result)); - $this->assertEquals(2, count($result)); - $this->assertEquals('romanb', $result[0]['u_name']); - $this->assertEquals(1, $result[0]['u_id']); - $this->assertEquals('jwage', $result[1]['u_name']); - $this->assertEquals(2, $result[1]['u_id']); - } - - /** - * @group DDC-407 - */ - public function testHydrateScalarResults() - { - $rsm = new ResultSetMapping(); - $rsm->addScalarResult('foo1', 'foo'); - $rsm->addScalarResult('bar2', 'bar'); - $rsm->addScalarResult('baz3', 'baz'); - - $resultSet = array( - array( - 'foo1' => 'A', - 'bar2' => 'B', - 'baz3' => 'C', - ), - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ScalarHydrator($this->_em); - - $result = $hydrator->hydrateAll($stmt, $rsm); - } - - /** - * @group DDC-644 - */ - public function testSkipUnknownColumns() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - $rsm->addScalarResult('foo1', 'foo'); - $rsm->addScalarResult('bar2', 'bar'); - $rsm->addScalarResult('baz3', 'baz'); - - $resultSet = array( - array( - 'u__id' => '1', - 'u__name' => 'romanb', - 'foo1' => 'A', - 'bar2' => 'B', - 'baz3' => 'C', - 'foo' => 'bar', // Unknown! - ), - ); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ScalarHydrator($this->_em); - - $result = $hydrator->hydrateAll($stmt, $rsm); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/SingleScalarHydratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/SingleScalarHydratorTest.php deleted file mode 100644 index f6abe24..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/SingleScalarHydratorTest.php +++ /dev/null @@ -1,78 +0,0 @@ - 'result1', - 'resultSet' => array( - array( - 'u__name' => 'romanb' - ) - )), - // valid - array('name' => 'result2', - 'resultSet' => array( - array( - 'u__id' => '1' - ) - )), - // invalid - array('name' => 'result3', - 'resultSet' => array( - array( - 'u__id' => '1', - 'u__name' => 'romanb' - ) - )), - // invalid - array('name' => 'result4', - 'resultSet' => array( - array( - 'u__id' => '1' - ), - array( - 'u__id' => '2' - ) - )), - ); - } - - /** - * select u.name from CmsUser u where u.id = 1 - * - * @dataProvider singleScalarResultSetProvider - */ - public function testHydrateSingleScalar($name, $resultSet) - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__name', 'name'); - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\SingleScalarHydrator($this->_em); - - if ($name == 'result1') { - $result = $hydrator->hydrateAll($stmt, $rsm); - $this->assertEquals('romanb', $result); - } else if ($name == 'result2') { - $result = $hydrator->hydrateAll($stmt, $rsm); - $this->assertEquals(1, $result); - } else if ($name == 'result3' || $name == 'result4') { - try { - $result = $hydrator->hydrateAll($stmt, $rsm); - $this->fail(); - } catch (\Doctrine\ORM\NonUniqueResultException $e) {} - } - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Id/AssignedGeneratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Id/AssignedGeneratorTest.php deleted file mode 100644 index 3a009e5..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Id/AssignedGeneratorTest.php +++ /dev/null @@ -1,67 +0,0 @@ -_em = $this->_getTestEntityManager(); - $this->_assignedGen = new AssignedGenerator; - } - - public function testThrowsExceptionIfIdNotAssigned() - { - try { - $entity = new AssignedSingleIdEntity; - $this->_assignedGen->generate($this->_em, $entity); - $this->fail('Assigned generator did not throw exception even though ID was missing.'); - } catch (\Doctrine\ORM\ORMException $expected) {} - - try { - $entity = new AssignedCompositeIdEntity; - $this->_assignedGen->generate($this->_em, $entity); - $this->fail('Assigned generator did not throw exception even though ID was missing.'); - } catch (\Doctrine\ORM\ORMException $expected) {} - } - - public function testCorrectIdGeneration() - { - $entity = new AssignedSingleIdEntity; - $entity->myId = 1; - $id = $this->_assignedGen->generate($this->_em, $entity); - $this->assertEquals(array('myId' => 1), $id); - - $entity = new AssignedCompositeIdEntity; - $entity->myId2 = 2; - $entity->myId1 = 4; - $id = $this->_assignedGen->generate($this->_em, $entity); - $this->assertEquals(array('myId1' => 4, 'myId2' => 2), $id); - } -} - -/** @Entity */ -class AssignedSingleIdEntity { - /** @Id @Column(type="integer") */ - public $myId; -} - -/** @Entity */ -class AssignedCompositeIdEntity { - /** @Id @Column(type="integer") */ - public $myId1; - /** @Id @Column(type="integer") */ - public $myId2; -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Id/SequenceGeneratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Id/SequenceGeneratorTest.php deleted file mode 100644 index 6e50d5a..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Id/SequenceGeneratorTest.php +++ /dev/null @@ -1,40 +0,0 @@ -_em = $this->_getTestEntityManager(); - $this->_seqGen = new SequenceGenerator('seq', 10); - } - - public function testGeneration() - { - for ($i=0; $i < 42; ++$i) { - if ($i % 10 == 0) { - $this->_em->getConnection()->setFetchOneResult((int)($i / 10) * 10); - } - $id = $this->_seqGen->generate($this->_em, null); - $this->assertEquals($i, $id); - $this->assertEquals((int)($i / 10) * 10 + 10, $this->_seqGen->getCurrentMaxValue()); - $this->assertEquals($i + 1, $this->_seqGen->getNextValue()); - } - - - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php deleted file mode 100644 index 6d14c2a..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php +++ /dev/null @@ -1,685 +0,0 @@ -_loadDriver(); - - $class = new ClassMetadata($entityClassName); - $class->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - $mappingDriver->loadMetadataForClass($entityClassName, $class); - - return $class; - } - - public function testLoadMapping() - { - $entityClassName = 'Doctrine\Tests\ORM\Mapping\User'; - return $this->createClassMetadata($entityClassName); - } - - /** - * @depends testLoadMapping - * @param ClassMetadata $class - */ - public function testEntityTableNameAndInheritance($class) - { - $this->assertEquals('cms_users', $class->getTableName()); - $this->assertEquals(ClassMetadata::INHERITANCE_TYPE_NONE, $class->inheritanceType); - - return $class; - } - - /** - * @depends testEntityTableNameAndInheritance - * @param ClassMetadata $class - */ - public function testEntityIndexes($class) - { - $this->assertArrayHasKey('indexes', $class->table, 'ClassMetadata should have indexes key in table property.'); - $this->assertEquals(array( - 'name_idx' => array('columns' => array('name')), - 0 => array('columns' => array('user_email')) - ), $class->table['indexes']); - - return $class; - } - - /** - * @depends testEntityTableNameAndInheritance - * @param ClassMetadata $class - */ - public function testEntityUniqueConstraints($class) - { - $this->assertArrayHasKey('uniqueConstraints', $class->table, - 'ClassMetadata should have uniqueConstraints key in table property when Unique Constraints are set.'); - - $this->assertEquals(array( - "search_idx" => array("columns" => array("name", "user_email")) - ), $class->table['uniqueConstraints']); - - return $class; - } - - /** - * @depends testEntityTableNameAndInheritance - * @param ClassMetadata $class - */ - public function testEntitySequence($class) - { - $this->assertInternalType('array', $class->sequenceGeneratorDefinition, 'No Sequence Definition set on this driver.'); - $this->assertEquals( - array( - 'sequenceName' => 'tablename_seq', - 'allocationSize' => 100, - 'initialValue' => 1, - ), - $class->sequenceGeneratorDefinition - ); - } - - - /** - * @depends testEntityTableNameAndInheritance - * @param ClassMetadata $class - */ - public function testFieldMappings($class) - { - $this->assertEquals(3, count($class->fieldMappings)); - $this->assertTrue(isset($class->fieldMappings['id'])); - $this->assertTrue(isset($class->fieldMappings['name'])); - $this->assertTrue(isset($class->fieldMappings['email'])); - - return $class; - } - - /** - * @depends testEntityTableNameAndInheritance - * @param ClassMetadata $class - */ - public function testFieldMappingsColumnNames($class) - { - $this->assertEquals("id", $class->fieldMappings['id']['columnName']); - $this->assertEquals("name", $class->fieldMappings['name']['columnName']); - $this->assertEquals("user_email", $class->fieldMappings['email']['columnName']); - - return $class; - } - - /** - * @depends testEntityTableNameAndInheritance - * @param ClassMetadata $class - */ - public function testStringFieldMappings($class) - { - $this->assertEquals('string', $class->fieldMappings['name']['type']); - $this->assertEquals(50, $class->fieldMappings['name']['length']); - $this->assertTrue($class->fieldMappings['name']['nullable']); - $this->assertTrue($class->fieldMappings['name']['unique']); - - return $class; - } - - /** - * @depends testFieldMappings - * @param ClassMetadata $class - */ - public function testIdentifier($class) - { - $this->assertEquals(array('id'), $class->identifier); - $this->assertEquals('integer', $class->fieldMappings['id']['type']); - $this->assertEquals(ClassMetadata::GENERATOR_TYPE_AUTO, $class->generatorType, "ID-Generator is not ClassMetadata::GENERATOR_TYPE_AUTO"); - - return $class; - } - - /** - * @depends testIdentifier - * @param ClassMetadata $class - */ - public function testAssocations($class) - { - $this->assertEquals(3, count($class->associationMappings)); - - return $class; - } - - /** - * @depends testAssocations - * @param ClassMetadata $class - */ - public function testOwningOneToOneAssocation($class) - { - $this->assertTrue(isset($class->associationMappings['address'])); - $this->assertTrue($class->associationMappings['address']['isOwningSide']); - $this->assertEquals('user', $class->associationMappings['address']['inversedBy']); - // Check cascading - $this->assertTrue($class->associationMappings['address']['isCascadeRemove']); - $this->assertFalse($class->associationMappings['address']['isCascadePersist']); - $this->assertFalse($class->associationMappings['address']['isCascadeRefresh']); - $this->assertFalse($class->associationMappings['address']['isCascadeDetach']); - $this->assertFalse($class->associationMappings['address']['isCascadeMerge']); - - return $class; - } - - /** - * @depends testOwningOneToOneAssocation - * @param ClassMetadata $class - */ - public function testInverseOneToManyAssociation($class) - { - $this->assertTrue(isset($class->associationMappings['phonenumbers'])); - $this->assertFalse($class->associationMappings['phonenumbers']['isOwningSide']); - $this->assertTrue($class->associationMappings['phonenumbers']['isCascadePersist']); - $this->assertTrue($class->associationMappings['phonenumbers']['isCascadeRemove']); - $this->assertFalse($class->associationMappings['phonenumbers']['isCascadeRefresh']); - $this->assertFalse($class->associationMappings['phonenumbers']['isCascadeDetach']); - $this->assertFalse($class->associationMappings['phonenumbers']['isCascadeMerge']); - $this->assertTrue($class->associationMappings['phonenumbers']['orphanRemoval']); - - // Test Order By - $this->assertEquals(array('number' => 'ASC'), $class->associationMappings['phonenumbers']['orderBy']); - - return $class; - } - - /** - * @depends testInverseOneToManyAssociation - * @param ClassMetadata $class - */ - public function testManyToManyAssociationWithCascadeAll($class) - { - $this->assertTrue(isset($class->associationMappings['groups'])); - $this->assertTrue($class->associationMappings['groups']['isOwningSide']); - // Make sure that cascade-all works as expected - $this->assertTrue($class->associationMappings['groups']['isCascadeRemove']); - $this->assertTrue($class->associationMappings['groups']['isCascadePersist']); - $this->assertTrue($class->associationMappings['groups']['isCascadeRefresh']); - $this->assertTrue($class->associationMappings['groups']['isCascadeDetach']); - $this->assertTrue($class->associationMappings['groups']['isCascadeMerge']); - - $this->assertFalse(isset($class->associationMappings['groups']['orderBy'])); - - return $class; - } - - /** - * @depends testManyToManyAssociationWithCascadeAll - * @param ClassMetadata $class - */ - public function testLifecycleCallbacks($class) - { - $this->assertEquals(count($class->lifecycleCallbacks), 2); - $this->assertEquals($class->lifecycleCallbacks['prePersist'][0], 'doStuffOnPrePersist'); - $this->assertEquals($class->lifecycleCallbacks['postPersist'][0], 'doStuffOnPostPersist'); - - return $class; - } - - /** - * @depends testManyToManyAssociationWithCascadeAll - * @param ClassMetadata $class - */ - public function testLifecycleCallbacksSupportMultipleMethodNames($class) - { - $this->assertEquals(count($class->lifecycleCallbacks['prePersist']), 2); - $this->assertEquals($class->lifecycleCallbacks['prePersist'][1], 'doOtherStuffOnPrePersistToo'); - - return $class; - } - - /** - * @depends testLifecycleCallbacksSupportMultipleMethodNames - * @param ClassMetadata $class - */ - public function testJoinColumnUniqueAndNullable($class) - { - // Non-Nullability of Join Column - $this->assertFalse($class->associationMappings['groups']['joinTable']['joinColumns'][0]['nullable']); - $this->assertFalse($class->associationMappings['groups']['joinTable']['joinColumns'][0]['unique']); - - return $class; - } - - /** - * @depends testJoinColumnUniqueAndNullable - * @param ClassMetadata $class - */ - public function testColumnDefinition($class) - { - $this->assertEquals("CHAR(32) NOT NULL", $class->fieldMappings['email']['columnDefinition']); - $this->assertEquals("INT NULL", $class->associationMappings['groups']['joinTable']['inverseJoinColumns'][0]['columnDefinition']); - - return $class; - } - - /** - * @depends testColumnDefinition - * @param ClassMetadata $class - */ - public function testJoinColumnOnDelete($class) - { - $this->assertEquals('CASCADE', $class->associationMappings['address']['joinColumns'][0]['onDelete']); - - return $class; - } - - /** - * @group DDC-514 - */ - public function testDiscriminatorColumnDefaults() - { - if (strpos(get_class($this), 'PHPMappingDriver') !== false) { - $this->markTestSkipped('PHP Mapping Drivers have no defaults.'); - } - - $class = $this->createClassMetadata('Doctrine\Tests\ORM\Mapping\Animal'); - - $this->assertEquals( - array('name' => 'dtype', 'type' => 'string', 'length' => 255, 'fieldName' => 'dtype'), - $class->discriminatorColumn - ); - } - - /** - * @group DDC-869 - */ - public function testMappedSuperclassWithRepository() - { - $driver = $this->_loadDriver(); - $em = $this->_getTestEntityManager(); - $factory = new \Doctrine\ORM\Mapping\ClassMetadataFactory(); - - $em->getConfiguration()->setMetadataDriverImpl($driver); - $factory->setEntityManager($em); - - - $class = $factory->getMetadataFor('Doctrine\Tests\Models\DDC869\DDC869CreditCardPayment'); - - $this->assertTrue(isset($class->fieldMappings['id'])); - $this->assertTrue(isset($class->fieldMappings['value'])); - $this->assertTrue(isset($class->fieldMappings['creditCardNumber'])); - $this->assertEquals($class->customRepositoryClassName, "Doctrine\Tests\Models\DDC869\DDC869PaymentRepository"); - $this->assertInstanceOf("Doctrine\Tests\Models\DDC869\DDC869PaymentRepository", - $em->getRepository("Doctrine\Tests\Models\DDC869\DDC869CreditCardPayment")); - $this->assertTrue($em->getRepository("Doctrine\Tests\Models\DDC869\DDC869ChequePayment")->isTrue()); - - - - $class = $factory->getMetadataFor('Doctrine\Tests\Models\DDC869\DDC869ChequePayment'); - - $this->assertTrue(isset($class->fieldMappings['id'])); - $this->assertTrue(isset($class->fieldMappings['value'])); - $this->assertTrue(isset($class->fieldMappings['serialNumber'])); - $this->assertEquals($class->customRepositoryClassName, "Doctrine\Tests\Models\DDC869\DDC869PaymentRepository"); - $this->assertInstanceOf("Doctrine\Tests\Models\DDC869\DDC869PaymentRepository", - $em->getRepository("Doctrine\Tests\Models\DDC869\DDC869ChequePayment")); - $this->assertTrue($em->getRepository("Doctrine\Tests\Models\DDC869\DDC869ChequePayment")->isTrue()); - } - - /** - * @group DDC-1476 - */ - public function testDefaultFieldType() - { - $driver = $this->_loadDriver(); - $em = $this->_getTestEntityManager(); - $factory = new \Doctrine\ORM\Mapping\ClassMetadataFactory(); - - $em->getConfiguration()->setMetadataDriverImpl($driver); - $factory->setEntityManager($em); - - - $class = $factory->getMetadataFor('Doctrine\Tests\Models\DDC1476\DDC1476EntityWithDefaultFieldType'); - - - $this->assertArrayHasKey('id', $class->fieldMappings); - $this->assertArrayHasKey('name', $class->fieldMappings); - - - $this->assertArrayHasKey('type', $class->fieldMappings['id']); - $this->assertArrayHasKey('type', $class->fieldMappings['name']); - - $this->assertEquals('string', $class->fieldMappings['id']['type']); - $this->assertEquals('string', $class->fieldMappings['name']['type']); - - - - $this->assertArrayHasKey('fieldName', $class->fieldMappings['id']); - $this->assertArrayHasKey('fieldName', $class->fieldMappings['name']); - - $this->assertEquals('id', $class->fieldMappings['id']['fieldName']); - $this->assertEquals('name', $class->fieldMappings['name']['fieldName']); - - - - $this->assertArrayHasKey('columnName', $class->fieldMappings['id']); - $this->assertArrayHasKey('columnName', $class->fieldMappings['name']); - - $this->assertEquals('id', $class->fieldMappings['id']['columnName']); - $this->assertEquals('name', $class->fieldMappings['name']['columnName']); - - $this->assertEquals(ClassMetadataInfo::GENERATOR_TYPE_NONE, $class->generatorType); - } - - /** - * @group DDC-1170 - */ - public function testIdentifierColumnDefinition() - { - - $class = $this->createClassMetadata(__NAMESPACE__ . '\DDC1170Entity'); - - - $this->assertArrayHasKey('id', $class->fieldMappings); - $this->assertArrayHasKey('value', $class->fieldMappings); - - $this->assertArrayHasKey('columnDefinition', $class->fieldMappings['id']); - $this->assertArrayHasKey('columnDefinition', $class->fieldMappings['value']); - - $this->assertEquals("INT unsigned NOT NULL", $class->fieldMappings['id']['columnDefinition']); - $this->assertEquals("VARCHAR(255) NOT NULL", $class->fieldMappings['value']['columnDefinition']); - } -} - -/** - * @Entity - * @HasLifecycleCallbacks - * @Table( - * name="cms_users", - * uniqueConstraints={@UniqueConstraint(name="search_idx", columns={"name", "user_email"})}, - * indexes={@Index(name="name_idx", columns={"name"}), @Index(name="0", columns={"user_email"})} - * ) - */ -class User -{ - /** - * @Id - * @Column(type="integer") - * @generatedValue(strategy="AUTO") - * @SequenceGenerator(sequenceName="tablename_seq", initialValue=1, allocationSize=100) - **/ - public $id; - - /** - * @Column(length=50, nullable=true, unique=true) - */ - public $name; - - /** - * @Column(name="user_email", columnDefinition="CHAR(32) NOT NULL") - */ - public $email; - - /** - * @OneToOne(targetEntity="Address", cascade={"remove"}, inversedBy="user") - * @JoinColumn(onDelete="CASCADE") - */ - public $address; - - /** - * @OneToMany(targetEntity="Phonenumber", mappedBy="user", cascade={"persist"}, orphanRemoval=true) - * @OrderBy({"number"="ASC"}) - */ - public $phonenumbers; - - /** - * @ManyToMany(targetEntity="Group", cascade={"all"}) - * @JoinTable(name="cms_user_groups", - * joinColumns={@JoinColumn(name="user_id", referencedColumnName="id", nullable=false, unique=false)}, - * inverseJoinColumns={@JoinColumn(name="group_id", referencedColumnName="id", columnDefinition="INT NULL")} - * ) - */ - public $groups; - - - /** - * @PrePersist - */ - public function doStuffOnPrePersist() - { - } - - /** - * @PrePersist - */ - public function doOtherStuffOnPrePersistToo() { - } - - /** - * @PostPersist - */ - public function doStuffOnPostPersist() - { - - } - - public static function loadMetadata(ClassMetadataInfo $metadata) - { - $metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); - $metadata->setPrimaryTable(array( - 'name' => 'cms_users', - )); - $metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT); - $metadata->addLifecycleCallback('doStuffOnPrePersist', 'prePersist'); - $metadata->addLifecycleCallback('doOtherStuffOnPrePersistToo', 'prePersist'); - $metadata->addLifecycleCallback('doStuffOnPostPersist', 'postPersist'); - $metadata->mapField(array( - 'id' => true, - 'fieldName' => 'id', - 'type' => 'integer', - 'columnName' => 'id', - )); - $metadata->mapField(array( - 'fieldName' => 'name', - 'type' => 'string', - 'length' => 50, - 'unique' => true, - 'nullable' => true, - 'columnName' => 'name', - )); - $metadata->mapField(array( - 'fieldName' => 'email', - 'type' => 'string', - 'columnName' => 'user_email', - 'columnDefinition' => 'CHAR(32) NOT NULL', - )); - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); - $metadata->mapOneToOne(array( - 'fieldName' => 'address', - 'targetEntity' => 'Doctrine\\Tests\\ORM\\Mapping\\Address', - 'cascade' => - array( - 0 => 'remove', - ), - 'mappedBy' => NULL, - 'inversedBy' => 'user', - 'joinColumns' => - array( - 0 => - array( - 'name' => 'address_id', - 'referencedColumnName' => 'id', - 'onDelete' => 'CASCADE', - ), - ), - 'orphanRemoval' => false, - )); - $metadata->mapOneToMany(array( - 'fieldName' => 'phonenumbers', - 'targetEntity' => 'Doctrine\\Tests\\ORM\\Mapping\\Phonenumber', - 'cascade' => - array( - 1 => 'persist', - ), - 'mappedBy' => 'user', - 'orphanRemoval' => true, - 'orderBy' => - array( - 'number' => 'ASC', - ), - )); - $metadata->mapManyToMany(array( - 'fieldName' => 'groups', - 'targetEntity' => 'Doctrine\\Tests\\ORM\\Mapping\\Group', - 'cascade' => - array( - 0 => 'remove', - 1 => 'persist', - 2 => 'refresh', - 3 => 'merge', - 4 => 'detach', - ), - 'mappedBy' => NULL, - 'joinTable' => - array( - 'name' => 'cms_users_groups', - 'joinColumns' => - array( - 0 => - array( - 'name' => 'user_id', - 'referencedColumnName' => 'id', - 'unique' => false, - 'nullable' => false, - ), - ), - 'inverseJoinColumns' => - array( - 0 => - array( - 'name' => 'group_id', - 'referencedColumnName' => 'id', - 'columnDefinition' => 'INT NULL', - ), - ), - ), - 'orderBy' => NULL, - )); - $metadata->table['uniqueConstraints'] = array( - 'search_idx' => array('columns' => array('name', 'user_email')), - ); - $metadata->table['indexes'] = array( - 'name_idx' => array('columns' => array('name')), 0 => array('columns' => array('user_email')) - ); - $metadata->setSequenceGeneratorDefinition(array( - 'sequenceName' => 'tablename_seq', - 'allocationSize' => 100, - 'initialValue' => 1, - )); - } -} - -/** - * @Entity - * @InheritanceType("SINGLE_TABLE") - * @DiscriminatorMap({"cat" = "Cat", "dog" = "Dog"}) - */ -abstract class Animal -{ - /** - * @Id @Column(type="string") @GeneratedValue - */ - public $id; - - public static function loadMetadata(ClassMetadataInfo $metadata) - { - - } -} - -/** @Entity */ -class Cat extends Animal -{ - public static function loadMetadata(ClassMetadataInfo $metadata) - { - - } -} - -/** @Entity */ -class Dog extends Animal -{ - public static function loadMetadata(ClassMetadataInfo $metadata) - { - - } -} - - -/** - * @Entity - */ -class DDC1170Entity -{ - - /** - * @param string $value - */ - function __construct($value = null) - { - $this->value = $value; - } - - /** - * @Id - * @GeneratedValue(strategy="NONE") - * @Column(type="integer", columnDefinition = "INT unsigned NOT NULL") - **/ - private $id; - - /** - * @Column(columnDefinition = "VARCHAR(255) NOT NULL") - */ - private $value; - - /** - * @return integer - */ - public function getId() - { - return $this->id; - } - - /** - * @return string - */ - public function getValue() - { - return $this->value; - } - - public static function loadMetadata(ClassMetadataInfo $metadata) - { - $metadata->mapField(array( - 'id' => true, - 'fieldName' => 'id', - 'columnDefinition' => 'INT unsigned NOT NULL', - )); - - $metadata->mapField(array( - 'fieldName' => 'value', - 'columnDefinition' => 'VARCHAR(255) NOT NULL' - )); - - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE); - } - -} - -class Address {} -class Phonenumber {} -class Group {} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php deleted file mode 100644 index 4d7715e..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php +++ /dev/null @@ -1,340 +0,0 @@ -initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - $reader = new \Doctrine\Common\Annotations\AnnotationReader(new \Doctrine\Common\Cache\ArrayCache()); - $annotationDriver = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader); - - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException'); - $annotationDriver->loadMetadataForClass('stdClass', $cm); - } - - /** - * @group DDC-268 - */ - public function testColumnWithMissingTypeDefaultsToString() - { - $cm = new ClassMetadata('Doctrine\Tests\ORM\Mapping\ColumnWithoutType'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - $annotationDriver = $this->_loadDriver(); - - $annotationDriver->loadMetadataForClass('Doctrine\Tests\ORM\Mapping\InvalidColumn', $cm); - $this->assertEquals('string', $cm->fieldMappings['id']['type']); - } - - /** - * @group DDC-318 - */ - public function testGetAllClassNamesIsIdempotent() - { - $annotationDriver = $this->_loadDriverForCMSModels(); - $original = $annotationDriver->getAllClassNames(); - - $annotationDriver = $this->_loadDriverForCMSModels(); - $afterTestReset = $annotationDriver->getAllClassNames(); - - $this->assertEquals($original, $afterTestReset); - } - - /** - * @group DDC-318 - */ - public function testGetAllClassNamesIsIdempotentEvenWithDifferentDriverInstances() - { - $annotationDriver = $this->_loadDriverForCMSModels(); - $original = $annotationDriver->getAllClassNames(); - - $annotationDriver = $this->_loadDriverForCMSModels(); - $afterTestReset = $annotationDriver->getAllClassNames(); - - $this->assertEquals($original, $afterTestReset); - } - - /** - * @group DDC-318 - */ - public function testGetAllClassNamesReturnsAlreadyLoadedClassesIfAppropriate() - { - $rightClassName = 'Doctrine\Tests\Models\CMS\CmsUser'; - $this->_ensureIsLoaded($rightClassName); - - $annotationDriver = $this->_loadDriverForCMSModels(); - $classes = $annotationDriver->getAllClassNames(); - - $this->assertContains($rightClassName, $classes); - } - - /** - * @group DDC-318 - */ - public function testGetClassNamesReturnsOnlyTheAppropriateClasses() - { - $extraneousClassName = 'Doctrine\Tests\Models\ECommerce\ECommerceCart'; - $this->_ensureIsLoaded($extraneousClassName); - - $annotationDriver = $this->_loadDriverForCMSModels(); - $classes = $annotationDriver->getAllClassNames(); - - $this->assertNotContains($extraneousClassName, $classes); - } - - protected function _loadDriverForCMSModels() - { - $annotationDriver = $this->_loadDriver(); - $annotationDriver->addPaths(array(__DIR__ . '/../../Models/CMS/')); - return $annotationDriver; - } - - protected function _loadDriver() - { - return $this->createAnnotationDriver(); - } - - protected function _ensureIsLoaded($entityClassName) - { - new $entityClassName; - } - - /** - * @group DDC-671 - * - * Entities for this test are in AbstractMappingDriverTest - */ - public function testJoinTablesWithMappedSuperclassForAnnotationDriver() - { - $annotationDriver = $this->_loadDriver(); - $annotationDriver->addPaths(array(__DIR__ . '/../../Models/DirectoryTree/')); - - $em = $this->_getTestEntityManager(); - $em->getConfiguration()->setMetadataDriverImpl($annotationDriver); - $factory = new \Doctrine\ORM\Mapping\ClassMetadataFactory(); - $factory->setEntityManager($em); - - $classPage = $factory->getMetadataFor('Doctrine\Tests\Models\DirectoryTree\File'); - $this->assertEquals('Doctrine\Tests\Models\DirectoryTree\File', $classPage->associationMappings['parentDirectory']['sourceEntity']); - - $classDirectory = $factory->getMetadataFor('Doctrine\Tests\Models\DirectoryTree\Directory'); - $this->assertEquals('Doctrine\Tests\Models\DirectoryTree\Directory', $classDirectory->associationMappings['parentDirectory']['sourceEntity']); - } - - /** - * @group DDC-945 - */ - public function testInvalidMappedSuperClassWithManyToManyAssociation() - { - $annotationDriver = $this->_loadDriver(); - - $em = $this->_getTestEntityManager(); - $em->getConfiguration()->setMetadataDriverImpl($annotationDriver); - $factory = new \Doctrine\ORM\Mapping\ClassMetadataFactory(); - $factory->setEntityManager($em); - - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException', - "It is illegal to put an inverse side one-to-many or many-to-many association on ". - "mapped superclass 'Doctrine\Tests\ORM\Mapping\InvalidMappedSuperClass#users'"); - $usingInvalidMsc = $factory->getMetadataFor('Doctrine\Tests\ORM\Mapping\UsingInvalidMappedSuperClass'); - } - - /** - * @group DDC-1050 - */ - public function testInvalidMappedSuperClassWithInheritanceInformation() - { - $annotationDriver = $this->_loadDriver(); - - $em = $this->_getTestEntityManager(); - $em->getConfiguration()->setMetadataDriverImpl($annotationDriver); - $factory = new \Doctrine\ORM\Mapping\ClassMetadataFactory(); - $factory->setEntityManager($em); - - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException', - "Its not supported to define inheritance information on a mapped ". - "superclass 'Doctrine\Tests\ORM\Mapping\MappedSuperClassInheritence'."); - $usingInvalidMsc = $factory->getMetadataFor('Doctrine\Tests\ORM\Mapping\MappedSuperClassInheritence'); - } - - /** - * @group DDC-1034 - */ - public function testInheritanceSkipsParentLifecycleCallbacks() - { - $annotationDriver = $this->_loadDriver(); - - $cm = new ClassMetadata('Doctrine\Tests\ORM\Mapping\AnnotationChild'); - $em = $this->_getTestEntityManager(); - $em->getConfiguration()->setMetadataDriverImpl($annotationDriver); - $factory = new \Doctrine\ORM\Mapping\ClassMetadataFactory(); - $factory->setEntityManager($em); - - $cm = $factory->getMetadataFor('Doctrine\Tests\ORM\Mapping\AnnotationChild'); - $this->assertEquals(array("postLoad" => array("postLoad"), "preUpdate" => array("preUpdate")), $cm->lifecycleCallbacks); - - $cm = $factory->getMetadataFor('Doctrine\Tests\ORM\Mapping\AnnotationParent'); - $this->assertEquals(array("postLoad" => array("postLoad"), "preUpdate" => array("preUpdate")), $cm->lifecycleCallbacks); - } - - /** - * @group DDC-1156 - */ - public function testMappedSuperclassInMiddleOfInheritanceHierachy() - { - $annotationDriver = $this->_loadDriver(); - - $em = $this->_getTestEntityManager(); - $em->getConfiguration()->setMetadataDriverImpl($annotationDriver); - $factory = new \Doctrine\ORM\Mapping\ClassMetadataFactory(); - $factory->setEntityManager($em); - - $cm = $factory->getMetadataFor('Doctrine\Tests\ORM\Mapping\ChildEntity'); - } - - public function testInvalidFetchOptionThrowsException() - { - $annotationDriver = $this->_loadDriver(); - - $em = $this->_getTestEntityManager(); - $em->getConfiguration()->setMetadataDriverImpl($annotationDriver); - $factory = new \Doctrine\ORM\Mapping\ClassMetadataFactory(); - $factory->setEntityManager($em); - - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException', - "Entity 'Doctrine\Tests\ORM\Mapping\InvalidFetchOption' has a mapping with invalid fetch mode 'eager"); - $cm = $factory->getMetadataFor('Doctrine\Tests\ORM\Mapping\InvalidFetchOption'); - } -} - -/** - * @Entity - */ -class ColumnWithoutType -{ - /** @Id @Column */ - public $id; -} - -/** - * @MappedSuperclass - */ -class InvalidMappedSuperClass -{ - /** - * @ManyToMany(targetEntity="Doctrine\Tests\Models\CMS\CmsUser", mappedBy="invalid") - */ - private $users; -} - -/** - * @Entity - */ -class UsingInvalidMappedSuperClass extends InvalidMappedSuperClass -{ - /** - * @Id @Column(type="integer") @GeneratedValue - */ - private $id; -} - -/** - * @MappedSuperclass - * @InheritanceType("JOINED") - * @DiscriminatorMap({"test" = "ColumnWithoutType"}) - */ -class MappedSuperClassInheritence -{ - -} - -/** - * @Entity - * @InheritanceType("JOINED") - * @DiscriminatorMap({"parent" = "AnnotationParent", "child" = "AnnotationChild"}) - * @HasLifecycleCallbacks - */ -class AnnotationParent -{ - /** - * @Id @Column(type="integer") @GeneratedValue - */ - private $id; - - /** - * @PostLoad - */ - public function postLoad() - { - - } - - /** - * @PreUpdate - */ - public function preUpdate() - { - - } -} - -/** - * @Entity - * @HasLifecycleCallbacks - */ -class AnnotationChild extends AnnotationParent -{ - -} - -/** - * @Entity - * @InheritanceType("SINGLE_TABLE") - * @DiscriminatorMap({"s"="SuperEntity", "c"="ChildEntity"}) - */ -class SuperEntity -{ - /** @Id @Column(type="string") */ - private $id; -} - -/** - * @MappedSuperclass - */ -class MiddleMappedSuperclass extends SuperEntity -{ - /** @Column(type="string") */ - private $name; -} - -/** - * @Entity - */ -class ChildEntity extends MiddleMappedSuperclass -{ - /** - * @Column(type="string") - */ - private $text; -} - -/** - * @Entity - */ -class InvalidFetchOption -{ - /** - * @OneToMany(targetEntity="Doctrine\Tests\Models\CMS\CmsUser", fetch="eager") - */ - private $collection; -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php deleted file mode 100644 index ff7f040..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php +++ /dev/null @@ -1,319 +0,0 @@ -_factory = new ClassMetadataFactory(); - $this->_factory->setEntityManager($this->_getTestEntityManager()); - } - - /** - * @expectedException Doctrine\ORM\Mapping\MappingException - */ - public function testGetMetadataForTransientClassThrowsException() - { - $this->_factory->getMetadataFor('Doctrine\Tests\ORM\Mapping\TransientBaseClass'); - } - - public function testGetMetadataForSubclassWithTransientBaseClass() - { - $class = $this->_factory->getMetadataFor('Doctrine\Tests\ORM\Mapping\EntitySubClass'); - - $this->assertTrue(empty($class->subClasses)); - $this->assertTrue(empty($class->parentClasses)); - $this->assertTrue(isset($class->fieldMappings['id'])); - $this->assertTrue(isset($class->fieldMappings['name'])); - } - - public function testGetMetadataForSubclassWithMappedSuperclass() - { - $class = $this->_factory->getMetadataFor('Doctrine\Tests\ORM\Mapping\EntitySubClass2'); - - $this->assertTrue(empty($class->subClasses)); - $this->assertTrue(empty($class->parentClasses)); - - $this->assertTrue(isset($class->fieldMappings['mapped1'])); - $this->assertTrue(isset($class->fieldMappings['mapped2'])); - $this->assertTrue(isset($class->fieldMappings['id'])); - $this->assertTrue(isset($class->fieldMappings['name'])); - - $this->assertFalse(isset($class->fieldMappings['mapped1']['inherited'])); - $this->assertFalse(isset($class->fieldMappings['mapped2']['inherited'])); - $this->assertFalse(isset($class->fieldMappings['transient'])); - - $this->assertTrue(isset($class->associationMappings['mappedRelated1'])); - } - - /** - * @group DDC-869 - */ - public function testGetMetadataForSubclassWithMappedSuperclassWhithRepository() - { - $class = $this->_factory->getMetadataFor('Doctrine\Tests\Models\DDC869\DDC869CreditCardPayment'); - - $this->assertTrue(isset($class->fieldMappings['id'])); - $this->assertTrue(isset($class->fieldMappings['value'])); - $this->assertTrue(isset($class->fieldMappings['creditCardNumber'])); - $this->assertEquals($class->customRepositoryClassName, "Doctrine\Tests\Models\DDC869\DDC869PaymentRepository"); - - - $class = $this->_factory->getMetadataFor('Doctrine\Tests\Models\DDC869\DDC869ChequePayment'); - - $this->assertTrue(isset($class->fieldMappings['id'])); - $this->assertTrue(isset($class->fieldMappings['value'])); - $this->assertTrue(isset($class->fieldMappings['serialNumber'])); - $this->assertEquals($class->customRepositoryClassName, "Doctrine\Tests\Models\DDC869\DDC869PaymentRepository"); - - - // override repositoryClass - $class = $this->_factory->getMetadataFor('Doctrine\Tests\ORM\Mapping\SubclassWithRepository'); - - $this->assertTrue(isset($class->fieldMappings['id'])); - $this->assertTrue(isset($class->fieldMappings['value'])); - $this->assertEquals($class->customRepositoryClassName, "Doctrine\ORM\EntityRepository"); - } - - /** - * @group DDC-388 - */ - public function testSerializationWithPrivateFieldsFromMappedSuperclass() - { - - $class = $this->_factory->getMetadataFor(__NAMESPACE__ . '\\EntitySubClass2'); - - $class2 = unserialize(serialize($class)); - $class2->wakeupReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - $this->assertTrue(isset($class2->reflFields['mapped1'])); - $this->assertTrue(isset($class2->reflFields['mapped2'])); - $this->assertTrue(isset($class2->reflFields['mappedRelated1'])); - } - - /** - * @group DDC-1203 - */ - public function testUnmappedSuperclassInHierachy() - { - $class = $this->_factory->getMetadataFor(__NAMESPACE__ . '\\HierachyD'); - - $this->assertTrue(isset($class->fieldMappings['id'])); - $this->assertTrue(isset($class->fieldMappings['a'])); - $this->assertTrue(isset($class->fieldMappings['d'])); - } - - /** - * @group DDC-1204 - */ - public function testUnmappedEntityInHierachy() - { - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException', "Entity 'Doctrine\Tests\ORM\Mapping\HierachyBEntity' has to be part of the discriminator map of 'Doctrine\Tests\ORM\Mapping\HierachyBase' to be properly mapped in the inheritance hierachy. Alternatively you can make 'Doctrine\Tests\ORM\Mapping\HierachyBEntity' an abstract class to avoid this exception from occuring."); - - $class = $this->_factory->getMetadataFor(__NAMESPACE__ . '\\HierachyE'); - } - - /** - * @group DDC-1204 - * @group DDC-1203 - */ - public function testMappedSuperclassWithId() - { - $class = $this->_factory->getMetadataFor(__NAMESPACE__ . '\\SuperclassEntity'); - - $this->assertTrue(isset($class->fieldMappings['id'])); - } - - /** - * @group DDC-1156 - * @group DDC-1218 - */ - public function testGeneratedValueFromMappedSuperclass() - { - $class = $this->_factory->getMetadataFor(__NAMESPACE__ . '\\SuperclassEntity'); - /* @var $class ClassMetadataInfo */ - - $this->assertInstanceOf('Doctrine\ORM\Id\SequenceGenerator', $class->idGenerator); - $this->assertEquals(array('allocationSize' => 1, 'initialValue' => 10, 'sequenceName' => 'foo'), $class->sequenceGeneratorDefinition); - } - - /** - * @group DDC-1156 - * @group DDC-1218 - */ - public function testSequenceDefinitionInHierachyWithSandwichMappedSuperclass() - { - $class = $this->_factory->getMetadataFor(__NAMESPACE__ . '\\HierachyD'); - /* @var $class ClassMetadataInfo */ - - $this->assertInstanceOf('Doctrine\ORM\Id\SequenceGenerator', $class->idGenerator); - $this->assertEquals(array('allocationSize' => 1, 'initialValue' => 10, 'sequenceName' => 'foo'), $class->sequenceGeneratorDefinition); - } - - /** - * @group DDC-1156 - * @group DDC-1218 - */ - public function testMultipleMappedSuperclasses() - { - $class = $this->_factory->getMetadataFor(__NAMESPACE__ . '\\MediumSuperclassEntity'); - /* @var $class ClassMetadataInfo */ - - $this->assertInstanceOf('Doctrine\ORM\Id\SequenceGenerator', $class->idGenerator); - $this->assertEquals(array('allocationSize' => 1, 'initialValue' => 10, 'sequenceName' => 'foo'), $class->sequenceGeneratorDefinition); - } -} - -class TransientBaseClass { - private $transient1; - private $transient2; -} - -/** @Entity */ -class EntitySubClass extends TransientBaseClass -{ - /** @Id @Column(type="integer") */ - private $id; - /** @Column(type="string") */ - private $name; -} - -/** @MappedSuperclass */ -class MappedSuperclassBase { - /** @Column(type="integer") */ - private $mapped1; - /** @Column(type="string") */ - private $mapped2; - /** - * @OneToOne(targetEntity="MappedSuperclassRelated1") - * @JoinColumn(name="related1_id", referencedColumnName="id") - */ - private $mappedRelated1; - private $transient; -} -class MappedSuperclassRelated1 {} - -/** @Entity */ -class EntitySubClass2 extends MappedSuperclassBase { - /** @Id @Column(type="integer") */ - private $id; - /** @Column(type="string") */ - private $name; -} - -/** - * @Entity - * @InheritanceType("SINGLE_TABLE") - * @DiscriminatorColumn(name="type", type="string", length=20) - * @DiscriminatorMap({ - * "c" = "HierachyC", - * "d" = "HierachyD", - * "e" = "HierachyE" - * }) - */ -abstract class HierachyBase -{ - /** - * @Column(type="integer") @Id @GeneratedValue(strategy="SEQUENCE") - * @SequenceGenerator(sequenceName="foo", initialValue=10) - * @var int - */ - public $id; -} - -/** - * @MappedSuperclass - */ -abstract class HierachyASuperclass extends HierachyBase -{ - /** @Column(type="string") */ - public $a; -} - -/** - * @Entity - */ -class HierachyBEntity extends HierachyBase -{ - /** @Column(type="string") */ - public $b; -} - -/** - * @Entity - */ -class HierachyC extends HierachyBase -{ - /** @Column(type="string") */ - public $c; -} - -/** - * @Entity - */ -class HierachyD extends HierachyASuperclass -{ - /** @Column(type="string") */ - public $d; -} - -/** - * @Entity - */ -class HierachyE extends HierachyBEntity -{ - /** @Column(type="string") */ - public $e; -} - -/** - * @Entity - */ -class SuperclassEntity extends SuperclassBase -{ - -} - -/** - * @MappedSuperclass - */ -abstract class SuperclassBase -{ - /** - * @Column(type="integer") @Id @GeneratedValue(strategy="SEQUENCE") - * @SequenceGenerator(sequenceName="foo", initialValue=10) - * @var int - */ - public $id; -} - -/** - * @MappedSuperclass - */ -abstract class MediumSuperclassBase extends SuperclassBase -{ - -} - -/** - * @Entity - */ -class MediumSuperclassEntity extends MediumSuperclassBase -{ - -} - -/** - * @Entity(repositoryClass = "Doctrine\ORM\EntityRepository") - */ -class SubclassWithRepository extends \Doctrine\Tests\Models\DDC869\DDC869Payment -{ - -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataBuilderTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataBuilderTest.php deleted file mode 100644 index f14b60b..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataBuilderTest.php +++ /dev/null @@ -1,428 +0,0 @@ -. - */ - - -namespace Doctrine\Tests\ORM\Mapping; - -use Doctrine\ORM\Mapping\ClassMetadata; -use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder; - -/** - * @group DDC-659 - */ -class ClassMetadataBuilderTest extends \Doctrine\Tests\OrmTestCase -{ - /** - * @var ClassMetadata - */ - private $cm; - /** - * @var ClassMetadataBuilder - */ - private $builder; - - public function setUp() - { - $this->cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $this->cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - $this->builder = new ClassMetadataBuilder($this->cm); - } - - public function testSetMappedSuperClass() - { - $this->assertIsFluent($this->builder->setMappedSuperClass()); - $this->assertTrue($this->cm->isMappedSuperclass); - } - - public function testSetCustomRepositoryClass() - { - $this->assertIsFluent($this->builder->setCustomRepositoryClass('Doctrine\Tests\Models\CMS\CmsGroup')); - $this->assertEquals('Doctrine\Tests\Models\CMS\CmsGroup', $this->cm->customRepositoryClassName); - } - - public function testSetReadOnly() - { - $this->assertIsFluent($this->builder->setReadOnly()); - $this->assertTrue($this->cm->isReadOnly); - } - - public function testSetTable() - { - $this->assertIsFluent($this->builder->setTable('users')); - $this->assertEquals('users', $this->cm->table['name']); - } - - public function testAddIndex() - { - $this->assertIsFluent($this->builder->addIndex(array('username', 'name'), 'users_idx')); - $this->assertEquals(array('users_idx' => array('columns' => array('username', 'name'))), $this->cm->table['indexes']); - } - - public function testAddUniqueConstraint() - { - $this->assertIsFluent($this->builder->addUniqueConstraint(array('username', 'name'), 'users_idx')); - $this->assertEquals(array('users_idx' => array('columns' => array('username', 'name'))), $this->cm->table['uniqueConstraints']); - } - - public function testSetPrimaryTableRelated() - { - $this->builder->addUniqueConstraint(array('username', 'name'), 'users_idx'); - $this->builder->addIndex(array('username', 'name'), 'users_idx'); - $this->builder->setTable('users'); - - $this->assertEquals( - array( - 'name' => 'users', - 'indexes' => array('users_idx' => array('columns' => array('username', 'name'))), - 'uniqueConstraints' => array('users_idx' => array('columns' => array('username', 'name'))), - ), - $this->cm->table - ); - } - - public function testSetInheritanceJoined() - { - $this->assertIsFluent($this->builder->setJoinedTableInheritance()); - $this->assertEquals(ClassMetadata::INHERITANCE_TYPE_JOINED, $this->cm->inheritanceType); - } - - public function testSetInheritanceSingleTable() - { - $this->assertIsFluent($this->builder->setSingleTableInheritance()); - $this->assertEquals(ClassMetadata::INHERITANCE_TYPE_SINGLE_TABLE, $this->cm->inheritanceType); - } - - public function testSetDiscriminatorColumn() - { - $this->assertIsFluent($this->builder->setDiscriminatorColumn('discr', 'string', '124')); - $this->assertEquals(array('fieldName' => 'discr', 'name' => 'discr', 'type' => 'string', 'length' => '124'), $this->cm->discriminatorColumn); - } - - public function testAddDiscriminatorMapClass() - { - $this->assertIsFluent($this->builder->addDiscriminatorMapClass('test', 'Doctrine\Tests\Models\CMS\CmsUser')); - $this->assertIsFluent($this->builder->addDiscriminatorMapClass('test2', 'Doctrine\Tests\Models\CMS\CmsGroup')); - - $this->assertEquals(array('test' => 'Doctrine\Tests\Models\CMS\CmsUser', 'test2' => 'Doctrine\Tests\Models\CMS\CmsGroup'), $this->cm->discriminatorMap); - $this->assertEquals('test', $this->cm->discriminatorValue); - } - - public function testChangeTrackingPolicyExplicit() - { - $this->assertIsFluent($this->builder->setChangeTrackingPolicyDeferredExplicit()); - $this->assertEquals(ClassMetadata::CHANGETRACKING_DEFERRED_EXPLICIT, $this->cm->changeTrackingPolicy); - } - - public function testChangeTrackingPolicyNotify() - { - $this->assertIsFluent($this->builder->setChangeTrackingPolicyNotify()); - $this->assertEquals(ClassMetadata::CHANGETRACKING_NOTIFY, $this->cm->changeTrackingPolicy); - } - - public function testAddField() - { - $this->assertIsFluent($this->builder->addField('name', 'string')); - $this->assertEquals(array('columnName' => 'name', 'fieldName' => 'name', 'type' => 'string'), $this->cm->fieldMappings['name']); - } - - public function testCreateField() - { - $fieldBuilder = ($this->builder->createField('name', 'string')); - $this->assertInstanceOf('Doctrine\ORM\Mapping\Builder\FieldBuilder', $fieldBuilder); - - $this->assertFalse(isset($this->cm->fieldMappings['name'])); - $this->assertIsFluent($fieldBuilder->build()); - $this->assertEquals(array('columnName' => 'name', 'fieldName' => 'name', 'type' => 'string'), $this->cm->fieldMappings['name']); - } - - public function testCreateVersionedField() - { - $this->builder->createField('name', 'integer')->columnName('username')->length(124)->nullable()->columnDefinition('foobar')->unique()->isVersionField()->build(); - $this->assertEquals(array( - 'columnDefinition' => 'foobar', - 'columnName' => 'username', - 'default' => 1, - 'fieldName' => 'name', - 'length' => 124, - 'type' => 'integer', - 'nullable' => true, - 'unique' => true, - ), $this->cm->fieldMappings['name']); - } - - public function testCreatePrimaryField() - { - $this->builder->createField('id', 'integer')->isPrimaryKey()->generatedValue()->build(); - - $this->assertEquals(array('id'), $this->cm->identifier); - $this->assertEquals(array('columnName' => 'id', 'fieldName' => 'id', 'id' => true, 'type' => 'integer'), $this->cm->fieldMappings['id']); - } - - public function testAddLifecycleEvent() - { - $this->builder->addLifecycleEvent('getStatus', 'postLoad'); - - $this->assertEquals(array('postLoad' => array('getStatus')), $this->cm->lifecycleCallbacks); - } - - public function testCreateManyToOne() - { - $this->assertIsFluent( - $this->builder->createManyToOne('groups', 'Doctrine\Tests\Models\CMS\CmsGroup') - ->addJoinColumn('group_id', 'id', true, false, 'CASCADE') - ->cascadeAll() - ->fetchExtraLazy() - ->build() - ); - - $this->assertEquals(array('groups' => array ( - 'fieldName' => 'groups', - 'targetEntity' => 'Doctrine\\Tests\\Models\\CMS\\CmsGroup', - 'cascade' => array ( - 0 => 'remove', - 1 => 'persist', - 2 => 'refresh', - 3 => 'merge', - 4 => 'detach', - ), - 'fetch' => 4, - 'joinColumns' => array ( - 0 => - array ( - 'name' => 'group_id', - 'referencedColumnName' => 'id', - 'nullable' => true, - 'unique' => false, - 'onDelete' => 'CASCADE', - 'columnDefinition' => NULL, - ), - ), - 'type' => 2, - 'mappedBy' => NULL, - 'inversedBy' => NULL, - 'isOwningSide' => true, - 'sourceEntity' => 'Doctrine\\Tests\\Models\\CMS\\CmsUser', - 'isCascadeRemove' => true, - 'isCascadePersist' => true, - 'isCascadeRefresh' => true, - 'isCascadeMerge' => true, - 'isCascadeDetach' => true, - 'sourceToTargetKeyColumns' => - array ( - 'group_id' => 'id', - ), - 'joinColumnFieldNames' => - array ( - 'group_id' => 'group_id', - ), - 'targetToSourceKeyColumns' => - array ( - 'id' => 'group_id', - ), - 'orphanRemoval' => false, - ), - ), $this->cm->associationMappings); - } - - public function testCreateOneToOne() - { - $this->assertIsFluent( - $this->builder->createOneToOne('groups', 'Doctrine\Tests\Models\CMS\CmsGroup') - ->addJoinColumn('group_id', 'id', true, false, 'CASCADE') - ->cascadeAll() - ->fetchExtraLazy() - ->build() - ); - - $this->assertEquals(array('groups' => array ( - 'fieldName' => 'groups', - 'targetEntity' => 'Doctrine\\Tests\\Models\\CMS\\CmsGroup', - 'cascade' => array ( - 0 => 'remove', - 1 => 'persist', - 2 => 'refresh', - 3 => 'merge', - 4 => 'detach', - ), - 'fetch' => 4, - 'joinColumns' => array ( - 0 => - array ( - 'name' => 'group_id', - 'referencedColumnName' => 'id', - 'nullable' => true, - 'unique' => true, - 'onDelete' => 'CASCADE', - 'columnDefinition' => NULL, - ), - ), - 'type' => 1, - 'mappedBy' => NULL, - 'inversedBy' => NULL, - 'isOwningSide' => true, - 'sourceEntity' => 'Doctrine\\Tests\\Models\\CMS\\CmsUser', - 'isCascadeRemove' => true, - 'isCascadePersist' => true, - 'isCascadeRefresh' => true, - 'isCascadeMerge' => true, - 'isCascadeDetach' => true, - 'sourceToTargetKeyColumns' => - array ( - 'group_id' => 'id', - ), - 'joinColumnFieldNames' => - array ( - 'group_id' => 'group_id', - ), - 'targetToSourceKeyColumns' => - array ( - 'id' => 'group_id', - ), - 'orphanRemoval' => false, - ), - ), $this->cm->associationMappings); - } - - public function testCreateManyToMany() - { - $this->assertIsFluent( - $this->builder->createManyToMany('groups', 'Doctrine\Tests\Models\CMS\CmsGroup') - ->setJoinTable('groups_users') - ->addJoinColumn('group_id', 'id', true, false, 'CASCADE') - ->addInverseJoinColumn('user_id', 'id') - ->cascadeAll() - ->fetchExtraLazy() - ->build() - ); - - $this->assertEquals(array( - 'groups' => - array( - 'fieldName' => 'groups', - 'targetEntity' => 'Doctrine\\Tests\\Models\\CMS\\CmsGroup', - 'cascade' => - array( - 0 => 'remove', - 1 => 'persist', - 2 => 'refresh', - 3 => 'merge', - 4 => 'detach', - ), - 'fetch' => 4, - 'joinTable' => - array( - 'joinColumns' => - array( - 0 => - array( - 'name' => 'group_id', - 'referencedColumnName' => 'id', - 'nullable' => true, - 'unique' => false, - 'onDelete' => 'CASCADE', - 'columnDefinition' => NULL, - ), - ), - 'inverseJoinColumns' => - array( - 0 => - array( - 'name' => 'user_id', - 'referencedColumnName' => 'id', - 'nullable' => true, - 'unique' => false, - 'onDelete' => NULL, - 'columnDefinition' => NULL, - ), - ), - 'name' => 'groups_users', - ), - 'type' => 8, - 'mappedBy' => NULL, - 'inversedBy' => NULL, - 'isOwningSide' => true, - 'sourceEntity' => 'Doctrine\\Tests\\Models\\CMS\\CmsUser', - 'isCascadeRemove' => true, - 'isCascadePersist' => true, - 'isCascadeRefresh' => true, - 'isCascadeMerge' => true, - 'isCascadeDetach' => true, - 'isOnDeleteCascade' => true, - 'relationToSourceKeyColumns' => - array( - 'group_id' => 'id', - ), - 'joinTableColumns' => - array( - 0 => 'group_id', - 1 => 'user_id', - ), - 'relationToTargetKeyColumns' => - array( - 'user_id' => 'id', - ), - 'orphanRemoval' => false, - ), - ), $this->cm->associationMappings); - } - - public function testCreateOneToMany() - { - $this->assertIsFluent( - $this->builder->createOneToMany('groups', 'Doctrine\Tests\Models\CMS\CmsGroup') - ->mappedBy('test') - ->setOrderBy(array('test')) - ->setIndexBy('test') - ->build() - ); - - $this->assertEquals(array( - 'groups' => - array( - 'fieldName' => 'groups', - 'targetEntity' => 'Doctrine\\Tests\\Models\\CMS\\CmsGroup', - 'mappedBy' => 'test', - 'orderBy' => - array( - 0 => 'test', - ), - 'indexBy' => 'test', - 'type' => 4, - 'inversedBy' => NULL, - 'isOwningSide' => false, - 'sourceEntity' => 'Doctrine\\Tests\\Models\\CMS\\CmsUser', - 'fetch' => 2, - 'cascade' => - array( - ), - 'isCascadeRemove' => false, - 'isCascadePersist' => false, - 'isCascadeRefresh' => false, - 'isCascadeMerge' => false, - 'isCascadeDetach' => false, - 'orphanRemoval' => false, - ), - ), $this->cm->associationMappings); - } - - public function assertIsFluent($ret) - { - $this->assertSame($this->builder, $ret, "Return Value has to be same instance as used builder"); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php deleted file mode 100644 index cd1e4f3..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php +++ /dev/null @@ -1,181 +0,0 @@ -_createEntityManager($mockDriver); - - $conn = $entityManager->getConnection(); - $mockPlatform = $conn->getDatabasePlatform(); - $mockPlatform->setPrefersSequences(true); - $mockPlatform->setPrefersIdentityColumns(false); - - // Self-made metadata - $cm1 = new ClassMetadata('Doctrine\Tests\ORM\Mapping\TestEntity1'); - $cm1->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - $cm1->setPrimaryTable(array('name' => '`group`')); - // Add a mapped field - $cm1->mapField(array('fieldName' => 'name', 'type' => 'varchar')); - // Add a mapped field - $cm1->mapField(array('fieldName' => 'id', 'type' => 'integer', 'id' => true)); - // and a mapped association - $cm1->mapOneToOne(array('fieldName' => 'other', 'targetEntity' => 'TestEntity1', 'mappedBy' => 'this')); - // and an association on the owning side - $joinColumns = array( - array('name' => 'other_id', 'referencedColumnName' => 'id') - ); - $cm1->mapOneToOne(array('fieldName' => 'association', 'targetEntity' => 'TestEntity1', 'joinColumns' => $joinColumns)); - // and an id generator type - $cm1->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO); - - // SUT - $cmf = new \Doctrine\ORM\Mapping\ClassMetadataFactory(); - $cmf->setEntityManager($entityManager); - $cmf->setMetadataFor('Doctrine\Tests\ORM\Mapping\TestEntity1', $cm1); - - // Prechecks - $this->assertEquals(array(), $cm1->parentClasses); - $this->assertEquals(ClassMetadata::INHERITANCE_TYPE_NONE, $cm1->inheritanceType); - $this->assertTrue($cm1->hasField('name')); - $this->assertEquals(2, count($cm1->associationMappings)); - $this->assertEquals(ClassMetadata::GENERATOR_TYPE_AUTO, $cm1->generatorType); - $this->assertEquals('group', $cm1->table['name']); - - // Go - $cmMap1 = $cmf->getMetadataFor('Doctrine\Tests\ORM\Mapping\TestEntity1'); - - $this->assertSame($cm1, $cmMap1); - $this->assertEquals('group', $cmMap1->table['name']); - $this->assertTrue($cmMap1->table['quoted']); - $this->assertEquals(array(), $cmMap1->parentClasses); - $this->assertTrue($cmMap1->hasField('name')); - } - - public function testHasGetMetadata_NamespaceSeperatorIsNotNormalized() - { - require_once __DIR__."/../../Models/Global/GlobalNamespaceModel.php"; - - $metadataDriver = $this->createAnnotationDriver(array(__DIR__ . '/../../Models/Global/')); - - $entityManager = $this->_createEntityManager($metadataDriver); - - $mf = $entityManager->getMetadataFactory(); - $m1 = $mf->getMetadataFor("DoctrineGlobal_Article"); - $h1 = $mf->hasMetadataFor("DoctrineGlobal_Article"); - $h2 = $mf->hasMetadataFor("\DoctrineGlobal_Article"); - $m2 = $mf->getMetadataFor("\DoctrineGlobal_Article"); - - $this->assertNotSame($m1, $m2); - $this->assertFalse($h2); - $this->assertTrue($h1); - } - - /** - * @group DDC-1512 - */ - public function testIsTransient() - { - $cmf = new ClassMetadataFactory(); - $driver = $this->getMock('Doctrine\ORM\Mapping\Driver\Driver'); - $driver->expects($this->at(0)) - ->method('isTransient') - ->with($this->equalTo('Doctrine\Tests\Models\CMS\CmsUser')) - ->will($this->returnValue(true)); - $driver->expects($this->at(1)) - ->method('isTransient') - ->with($this->equalTo('Doctrine\Tests\Models\CMS\CmsArticle')) - ->will($this->returnValue(false)); - - $em = $this->_createEntityManager($driver); - - $this->assertTrue($em->getMetadataFactory()->isTransient('Doctrine\Tests\Models\CMS\CmsUser')); - $this->assertFalse($em->getMetadataFactory()->isTransient('Doctrine\Tests\Models\CMS\CmsArticle')); - } - - /** - * @group DDC-1512 - */ - public function testIsTransientEntityNamespace() - { - $cmf = new ClassMetadataFactory(); - $driver = $this->getMock('Doctrine\ORM\Mapping\Driver\Driver'); - $driver->expects($this->at(0)) - ->method('isTransient') - ->with($this->equalTo('Doctrine\Tests\Models\CMS\CmsUser')) - ->will($this->returnValue(true)); - $driver->expects($this->at(1)) - ->method('isTransient') - ->with($this->equalTo('Doctrine\Tests\Models\CMS\CmsArticle')) - ->will($this->returnValue(false)); - - $em = $this->_createEntityManager($driver); - $em->getConfiguration()->addEntityNamespace('CMS', 'Doctrine\Tests\Models\CMS'); - - $this->assertTrue($em->getMetadataFactory()->isTransient('CMS:CmsUser')); - $this->assertFalse($em->getMetadataFactory()->isTransient('CMS:CmsArticle')); - } - - protected function _createEntityManager($metadataDriver) - { - $driverMock = new DriverMock(); - $config = new \Doctrine\ORM\Configuration(); - $config->setProxyDir(__DIR__ . '/../../Proxies'); - $config->setProxyNamespace('Doctrine\Tests\Proxies'); - $eventManager = new EventManager(); - $conn = new ConnectionMock(array(), $driverMock, $config, $eventManager); - $mockDriver = new MetadataDriverMock(); - $config->setMetadataDriverImpl($metadataDriver); - - return EntityManagerMock::create($conn, $config, $eventManager); - } -} - -/* Test subject class with overriden factory method for mocking purposes */ -class ClassMetadataFactoryTestSubject extends \Doctrine\ORM\Mapping\ClassMetadataFactory -{ - private $mockMetadata = array(); - private $requestedClasses = array(); - - /** @override */ - protected function newClassMetadataInstance($className) - { - $this->requestedClasses[] = $className; - if ( ! isset($this->mockMetadata[$className])) { - throw new InvalidArgumentException("No mock metadata found for class $className."); - } - return $this->mockMetadata[$className]; - } - - public function setMetadataForClass($className, $metadata) - { - $this->mockMetadata[$className] = $metadata; - } - - public function getRequestedClasses() - { - return $this->requestedClasses; - } -} - -class TestEntity1 -{ - private $id; - private $name; - private $other; - private $association; -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataLoadEventTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataLoadEventTest.php deleted file mode 100644 index 70aae70..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataLoadEventTest.php +++ /dev/null @@ -1,56 +0,0 @@ -_getTestEntityManager(); - $metadataFactory = $em->getMetadataFactory(); - $evm = $em->getEventManager(); - $evm->addEventListener(Events::loadClassMetadata, $this); - $classMetadata = $metadataFactory->getMetadataFor('Doctrine\Tests\ORM\Mapping\LoadEventTestEntity'); - $this->assertTrue($classMetadata->hasField('about')); - $this->assertArrayHasKey('about', $classMetadata->reflFields); - $this->assertInstanceOf('ReflectionProperty', $classMetadata->reflFields['about']); - } - - public function loadClassMetadata(\Doctrine\ORM\Event\LoadClassMetadataEventArgs $eventArgs) - { - $classMetadata = $eventArgs->getClassMetadata(); - $field = array( - 'fieldName' => 'about', - 'type' => 'string', - 'length' => 255 - ); - $classMetadata->mapField($field); - } -} - -/** - * @Entity - * @Table(name="load_event_test_entity") - */ -class LoadEventTestEntity -{ - /** - * @Id @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - private $id; - /** - * @Column(type="string", length=255) - */ - private $name; - - private $about; -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php deleted file mode 100644 index d100f6f..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php +++ /dev/null @@ -1,553 +0,0 @@ -initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - // Test initial state - $this->assertTrue(count($cm->getReflectionProperties()) == 0); - $this->assertInstanceOf('ReflectionClass', $cm->reflClass); - $this->assertEquals('Doctrine\Tests\Models\CMS\CmsUser', $cm->name); - $this->assertEquals('Doctrine\Tests\Models\CMS\CmsUser', $cm->rootEntityName); - $this->assertEquals(array(), $cm->subClasses); - $this->assertEquals(array(), $cm->parentClasses); - $this->assertEquals(ClassMetadata::INHERITANCE_TYPE_NONE, $cm->inheritanceType); - - // Customize state - $cm->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_SINGLE_TABLE); - $cm->setSubclasses(array("One", "Two", "Three")); - $cm->setParentClasses(array("UserParent")); - $cm->setCustomRepositoryClass("UserRepository"); - $cm->setDiscriminatorColumn(array('name' => 'disc', 'type' => 'integer')); - $cm->mapOneToOne(array('fieldName' => 'phonenumbers', 'targetEntity' => 'CmsAddress', 'mappedBy' => 'foo')); - $cm->markReadOnly(); - $cm->addNamedQuery(array('name' => 'dql', 'query' => 'foo')); - $this->assertEquals(1, count($cm->associationMappings)); - - $serialized = serialize($cm); - $cm = unserialize($serialized); - $cm->wakeupReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - // Check state - $this->assertTrue(count($cm->getReflectionProperties()) > 0); - $this->assertEquals('Doctrine\Tests\Models\CMS', $cm->namespace); - $this->assertInstanceOf('ReflectionClass', $cm->reflClass); - $this->assertEquals('Doctrine\Tests\Models\CMS\CmsUser', $cm->name); - $this->assertEquals('UserParent', $cm->rootEntityName); - $this->assertEquals(array('Doctrine\Tests\Models\CMS\One', 'Doctrine\Tests\Models\CMS\Two', 'Doctrine\Tests\Models\CMS\Three'), $cm->subClasses); - $this->assertEquals(array('UserParent'), $cm->parentClasses); - $this->assertEquals('Doctrine\Tests\Models\CMS\UserRepository', $cm->customRepositoryClassName); - $this->assertEquals(array('name' => 'disc', 'type' => 'integer', 'fieldName' => 'disc'), $cm->discriminatorColumn); - $this->assertTrue($cm->associationMappings['phonenumbers']['type'] == ClassMetadata::ONE_TO_ONE); - $this->assertEquals(1, count($cm->associationMappings)); - $oneOneMapping = $cm->getAssociationMapping('phonenumbers'); - $this->assertTrue($oneOneMapping['fetch'] == ClassMetadata::FETCH_LAZY); - $this->assertEquals('phonenumbers', $oneOneMapping['fieldName']); - $this->assertEquals('Doctrine\Tests\Models\CMS\CmsAddress', $oneOneMapping['targetEntity']); - $this->assertTrue($cm->isReadOnly); - $this->assertEquals(array('dql' => array('name'=>'dql','query'=>'foo','dql'=>'foo')), $cm->namedQueries); - } - - public function testFieldIsNullable() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - // Explicit Nullable - $cm->mapField(array('fieldName' => 'status', 'nullable' => true, 'type' => 'string', 'length' => 50)); - $this->assertTrue($cm->isNullable('status')); - - // Explicit Not Nullable - $cm->mapField(array('fieldName' => 'username', 'nullable' => false, 'type' => 'string', 'length' => 50)); - $this->assertFalse($cm->isNullable('username')); - - // Implicit Not Nullable - $cm->mapField(array('fieldName' => 'name', 'type' => 'string', 'length' => 50)); - $this->assertFalse($cm->isNullable('name'), "By default a field should not be nullable."); - } - - /** - * @group DDC-115 - */ - public function testMapAssocationInGlobalNamespace() - { - require_once __DIR__."/../../Models/Global/GlobalNamespaceModel.php"; - - $cm = new ClassMetadata('DoctrineGlobal_Article'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - $cm->mapManyToMany(array( - 'fieldName' => 'author', - 'targetEntity' => 'DoctrineGlobal_User', - 'joinTable' => array( - 'name' => 'bar', - 'joinColumns' => array(array('name' => 'bar_id', 'referencedColumnName' => 'id')), - 'inverseJoinColumns' => array(array('name' => 'baz_id', 'referencedColumnName' => 'id')), - ), - )); - - $this->assertEquals("DoctrineGlobal_User", $cm->associationMappings['author']['targetEntity']); - } - - public function testMapManyToManyJoinTableDefaults() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - $cm->mapManyToMany( - array( - 'fieldName' => 'groups', - 'targetEntity' => 'CmsGroup' - )); - - $assoc = $cm->associationMappings['groups']; - //$this->assertInstanceOf('Doctrine\ORM\Mapping\ManyToManyMapping', $assoc); - $this->assertEquals(array( - 'name' => 'cmsuser_cmsgroup', - 'joinColumns' => array(array('name' => 'cmsuser_id', 'referencedColumnName' => 'id', 'onDelete' => 'CASCADE')), - 'inverseJoinColumns' => array(array('name' => 'cmsgroup_id', 'referencedColumnName' => 'id', 'onDelete' => 'CASCADE')) - ), $assoc['joinTable']); - $this->assertTrue($assoc['isOnDeleteCascade']); - } - - public function testSerializeManyToManyJoinTableCascade() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - $cm->mapManyToMany( - array( - 'fieldName' => 'groups', - 'targetEntity' => 'CmsGroup' - )); - - /* @var $assoc \Doctrine\ORM\Mapping\ManyToManyMapping */ - $assoc = $cm->associationMappings['groups']; - $assoc = unserialize(serialize($assoc)); - - $this->assertTrue($assoc['isOnDeleteCascade']); - } - - /** - * @group DDC-115 - */ - public function testSetDiscriminatorMapInGlobalNamespace() - { - require_once __DIR__."/../../Models/Global/GlobalNamespaceModel.php"; - - $cm = new ClassMetadata('DoctrineGlobal_User'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - $cm->setDiscriminatorMap(array('descr' => 'DoctrineGlobal_Article', 'foo' => 'DoctrineGlobal_User')); - - $this->assertEquals("DoctrineGlobal_Article", $cm->discriminatorMap['descr']); - $this->assertEquals("DoctrineGlobal_User", $cm->discriminatorMap['foo']); - } - - /** - * @group DDC-115 - */ - public function testSetSubClassesInGlobalNamespace() - { - require_once __DIR__."/../../Models/Global/GlobalNamespaceModel.php"; - - $cm = new ClassMetadata('DoctrineGlobal_User'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - $cm->setSubclasses(array('DoctrineGlobal_Article')); - - $this->assertEquals("DoctrineGlobal_Article", $cm->subClasses[0]); - } - - /** - * @group DDC-268 - */ - public function testSetInvalidVersionMapping_ThrowsException() - { - $field = array(); - $field['fieldName'] = 'foo'; - $field['type'] = 'string'; - - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException'); - $cm->setVersionMapping($field); - } - - public function testGetSingleIdentifierFieldName_MultipleIdentifierEntity_ThrowsException() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - $cm->isIdentifierComposite = true; - - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException'); - $cm->getSingleIdentifierFieldName(); - } - - public function testDuplicateAssociationMappingException() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - $a1 = array('fieldName' => 'foo', 'sourceEntity' => 'stdClass', 'targetEntity' => 'stdClass', 'mappedBy' => 'foo'); - $a2 = array('fieldName' => 'foo', 'sourceEntity' => 'stdClass', 'targetEntity' => 'stdClass', 'mappedBy' => 'foo'); - - $cm->addInheritedAssociationMapping($a1); - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException'); - $cm->addInheritedAssociationMapping($a2); - } - - public function testDuplicateColumnName_ThrowsMappingException() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - $cm->mapField(array('fieldName' => 'name', 'columnName' => 'name')); - - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException'); - $cm->mapField(array('fieldName' => 'username', 'columnName' => 'name')); - } - - public function testDuplicateColumnName_DiscriminatorColumn_ThrowsMappingException() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - $cm->mapField(array('fieldName' => 'name', 'columnName' => 'name')); - - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException'); - $cm->setDiscriminatorColumn(array('name' => 'name')); - } - - public function testDuplicateColumnName_DiscriminatorColumn2_ThrowsMappingException() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - $cm->setDiscriminatorColumn(array('name' => 'name')); - - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException'); - $cm->mapField(array('fieldName' => 'name', 'columnName' => 'name')); - } - - public function testDuplicateFieldAndAssocationMapping1_ThrowsException() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - $cm->mapField(array('fieldName' => 'name', 'columnName' => 'name')); - - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException'); - $cm->mapOneToOne(array('fieldName' => 'name', 'targetEntity' => 'CmsUser')); - } - - public function testDuplicateFieldAndAssocationMapping2_ThrowsException() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - $cm->mapOneToOne(array('fieldName' => 'name', 'targetEntity' => 'CmsUser')); - - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException'); - $cm->mapField(array('fieldName' => 'name', 'columnName' => 'name')); - } - - /** - * @group DDC-1224 - */ - public function testGetTemporaryTableNameSchema() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - $cm->setTableName('foo.bar'); - - $this->assertEquals('foo_bar_id_tmp', $cm->getTemporaryIdTableName()); - } - - public function testDefaultTableName() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - // When table's name is not given - $primaryTable = array(); - $cm->setPrimaryTable($primaryTable); - - $this->assertEquals('CmsUser', $cm->getTableName()); - $this->assertEquals('CmsUser', $cm->table['name']); - - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsAddress'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - // When joinTable's name is not given - $cm->mapManyToMany(array( - 'fieldName' => 'user', - 'targetEntity' => 'CmsUser', - 'inversedBy' => 'users', - 'joinTable' => array('joinColumns' => array(array('referencedColumnName' => 'id')), - 'inverseJoinColumns' => array(array('referencedColumnName' => 'id'))))); - $this->assertEquals('cmsaddress_cmsuser', $cm->associationMappings['user']['joinTable']['name']); - } - - public function testDefaultJoinColumnName() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsAddress'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - // this is really dirty, but it's the simpliest way to test whether - // joinColumn's name will be automatically set to user_id - $cm->mapOneToOne(array( - 'fieldName' => 'user', - 'targetEntity' => 'CmsUser', - 'joinColumns' => array(array('referencedColumnName' => 'id')))); - $this->assertEquals('user_id', $cm->associationMappings['user']['joinColumns'][0]['name']); - - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsAddress'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - $cm->mapManyToMany(array( - 'fieldName' => 'user', - 'targetEntity' => 'CmsUser', - 'inversedBy' => 'users', - 'joinTable' => array('name' => 'user_CmsUser', - 'joinColumns' => array(array('referencedColumnName' => 'id')), - 'inverseJoinColumns' => array(array('referencedColumnName' => 'id'))))); - $this->assertEquals('cmsaddress_id', $cm->associationMappings['user']['joinTable']['joinColumns'][0]['name']); - $this->assertEquals('cmsuser_id', $cm->associationMappings['user']['joinTable']['inverseJoinColumns'][0]['name']); - } - - /** - * @group DDC-886 - */ - public function testSetMultipleIdentifierSetsComposite() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - $cm->mapField(array('fieldName' => 'name')); - $cm->mapField(array('fieldName' => 'username')); - - $cm->setIdentifier(array('name', 'username')); - $this->assertTrue($cm->isIdentifierComposite); - } - - /** - * @group DDC-944 - */ - public function testMappingNotFound() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException', "No mapping found for field 'foo' on class 'Doctrine\Tests\Models\CMS\CmsUser'."); - $cm->getFieldMapping('foo'); - } - - /** - * @group DDC-961 - */ - public function testJoinTableMappingDefaults() - { - $cm = new ClassMetadata('DoctrineGlobal_Article'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - $cm->mapManyToMany(array('fieldName' => 'author', 'targetEntity' => 'Doctrine\Tests\Models\CMS\CmsUser')); - - $this->assertEquals('doctrineglobal_article_cmsuser', $cm->associationMappings['author']['joinTable']['name']); - } - - /** - * @group DDC-117 - */ - public function testMapIdentifierAssociation() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\DDC117\DDC117ArticleDetails'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - $cm->mapOneToOne(array( - 'fieldName' => 'article', - 'id' => true, - 'targetEntity' => 'Doctrine\Tests\Models\DDC117\DDC117Article', - 'joinColumns' => array(), - )); - - $this->assertTrue($cm->containsForeignIdentifier, "Identifier Association should set 'containsForeignIdentifier' boolean flag."); - $this->assertEquals(array("article"), $cm->identifier); - } - - /** - * @group DDC-117 - */ - public function testOrphanRemovalIdentifierAssociation() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\DDC117\DDC117ArticleDetails'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException', 'The orphan removal option is not allowed on an association that'); - $cm->mapOneToOne(array( - 'fieldName' => 'article', - 'id' => true, - 'targetEntity' => 'Doctrine\Tests\Models\DDC117\DDC117Article', - 'orphanRemoval' => true, - 'joinColumns' => array(), - )); - } - - /** - * @group DDC-117 - */ - public function testInverseIdentifierAssocation() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\DDC117\DDC117ArticleDetails'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException', 'An inverse association is not allowed to be identifier in'); - $cm->mapOneToOne(array( - 'fieldName' => 'article', - 'id' => true, - 'mappedBy' => 'details', // INVERSE! - 'targetEntity' => 'Doctrine\Tests\Models\DDC117\DDC117Article', - 'joinColumns' => array(), - )); - } - - /** - * @group DDC-117 - */ - public function testIdentifierAssocationManyToMany() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\DDC117\DDC117ArticleDetails'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException', 'Many-to-many or one-to-many associations are not allowed to be identifier in'); - $cm->mapManyToMany(array( - 'fieldName' => 'article', - 'id' => true, - 'targetEntity' => 'Doctrine\Tests\Models\DDC117\DDC117Article', - 'joinColumns' => array(), - )); - } - - /** - * @group DDC-996 - */ - public function testEmptyFieldNameThrowsException() - { - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException', - "The field or association mapping misses the 'fieldName' attribute in entity 'Doctrine\Tests\Models\CMS\CmsUser'."); - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - $cm->mapField(array('fieldName' => '')); - } - - public function testRetrievalOfNamedQueries() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - - $this->assertEquals(0, count($cm->getNamedQueries())); - - $cm->addNamedQuery(array( - 'name' => 'userById', - 'query' => 'SELECT u FROM __CLASS__ u WHERE u.id = ?1' - )); - - $this->assertEquals(1, count($cm->getNamedQueries())); - } - - public function testExistanceOfNamedQuery() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - - $cm->addNamedQuery(array( - 'name' => 'all', - 'query' => 'SELECT u FROM __CLASS__ u' - )); - - $this->assertTrue($cm->hasNamedQuery('all')); - $this->assertFalse($cm->hasNamedQuery('userById')); - } - - public function testRetrieveOfNamedQuery() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - - $cm->addNamedQuery(array( - 'name' => 'userById', - 'query' => 'SELECT u FROM __CLASS__ u WHERE u.id = ?1' - )); - - $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = ?1', $cm->getNamedQuery('userById')); - } - - public function testNamingCollisionNamedQueryShouldThrowException() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException'); - - $cm->addNamedQuery(array( - 'name' => 'userById', - 'query' => 'SELECT u FROM __CLASS__ u WHERE u.id = ?1' - )); - - $cm->addNamedQuery(array( - 'name' => 'userById', - 'query' => 'SELECT u FROM __CLASS__ u WHERE u.id = ?1' - )); - } - - /** - * @group DDC-1068 - */ - public function testClassCaseSensitivity() - { - $user = new \Doctrine\Tests\Models\CMS\CmsUser(); - $cm = new ClassMetadata('DOCTRINE\TESTS\MODELS\CMS\CMSUSER'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - $this->assertEquals('Doctrine\Tests\Models\CMS\CmsUser', $cm->name); - } - - /** - * @group DDC-659 - */ - public function testLifecycleCallbackNotFound() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - $cm->addLifecycleCallback('notfound', 'postLoad'); - - $this->setExpectedException("Doctrine\ORM\Mapping\MappingException", "Entity 'Doctrine\Tests\Models\CMS\CmsUser' has no method 'notfound' to be registered as lifecycle callback."); - $cm->validateLifecycleCallbacks(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - } - - /** - * @group ImproveErrorMessages - */ - public function testTargetEntityNotFound() - { - $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - $cm->mapManyToOne(array('fieldName' => 'address', 'targetEntity' => 'UnknownClass')); - - $this->setExpectedException("Doctrine\ORM\Mapping\MappingException", "The target-entity Doctrine\Tests\Models\CMS\UnknownClass cannot be found in 'Doctrine\Tests\Models\CMS\CmsUser#address'."); - $cm->validateAssocations(); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/DriverChainTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/DriverChainTest.php deleted file mode 100644 index 2383db6..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/DriverChainTest.php +++ /dev/null @@ -1,96 +0,0 @@ -getMock('Doctrine\ORM\Mapping\Driver\Driver'); - $driver1->expects($this->never()) - ->method('loadMetadataForClass'); - $driver1->expectS($this->never()) - ->method('isTransient'); - - $driver2 = $this->getMock('Doctrine\ORM\Mapping\Driver\Driver'); - $driver2->expects($this->at(0)) - ->method('loadMetadataForClass') - ->with($this->equalTo($className), $this->equalTo($classMetadata)); - $driver2->expects($this->at(1)) - ->method('isTransient') - ->with($this->equalTo($className)) - ->will($this->returnValue( true )); - - $chain->addDriver($driver1, 'Doctrine\Tests\Models\Company'); - $chain->addDriver($driver2, 'Doctrine\Tests\ORM\Mapping'); - - $chain->loadMetadataForClass($className, $classMetadata); - - $this->assertTrue( $chain->isTransient($className) ); - } - - public function testLoadMetadata_NoDelegatorFound_ThrowsMappingException() - { - $className = 'Doctrine\Tests\ORM\Mapping\DriverChainEntity'; - $classMetadata = new \Doctrine\ORM\Mapping\ClassMetadata($className); - - $chain = new DriverChain(); - - $this->setExpectedException('Doctrine\ORM\Mapping\MappingException'); - $chain->loadMetadataForClass($className, $classMetadata); - } - - public function testGatherAllClassNames() - { - $className = 'Doctrine\Tests\ORM\Mapping\DriverChainEntity'; - $classMetadata = new \Doctrine\ORM\Mapping\ClassMetadata($className); - - $chain = new DriverChain(); - - $driver1 = $this->getMock('Doctrine\ORM\Mapping\Driver\Driver'); - $driver1->expects($this->once()) - ->method('getAllClassNames') - ->will($this->returnValue(array('Doctrine\Tests\Models\Company\Foo'))); - - $driver2 = $this->getMock('Doctrine\ORM\Mapping\Driver\Driver'); - $driver2->expects($this->once()) - ->method('getAllClassNames') - ->will($this->returnValue(array('Doctrine\Tests\ORM\Mapping\Bar', 'Doctrine\Tests\ORM\Mapping\Baz', 'FooBarBaz'))); - - $chain->addDriver($driver1, 'Doctrine\Tests\Models\Company'); - $chain->addDriver($driver2, 'Doctrine\Tests\ORM\Mapping'); - - $this->assertEquals(array( - 'Doctrine\Tests\Models\Company\Foo', - 'Doctrine\Tests\ORM\Mapping\Bar', - 'Doctrine\Tests\ORM\Mapping\Baz' - ), $chain->getAllClassNames()); - } - - /** - * @group DDC-706 - */ - public function testIsTransient() - { - $chain = new DriverChain(); - $chain->addDriver($this->createAnnotationDriver(), 'Doctrine\Tests\Models\CMS'); - - $this->assertTrue($chain->isTransient('stdClass'), "stdClass isTransient"); - $this->assertFalse($chain->isTransient('Doctrine\Tests\Models\CMS\CmsUser'), "CmsUser is not Transient"); - } -} - -class DriverChainEntity -{ - -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php deleted file mode 100644 index b346973..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php +++ /dev/null @@ -1,31 +0,0 @@ -addMappingSource(__DIR__ . DIRECTORY_SEPARATOR . 'yaml'); - - $exporter = $cme->getExporter('php', $path); - $exporter->setMetadatas($cme->getMetadatas()); - $exporter->export(); - */ - - return new PHPDriver($path); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/StaticPHPMappingDriverTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/StaticPHPMappingDriverTest.php deleted file mode 100644 index 1a5a207..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/StaticPHPMappingDriverTest.php +++ /dev/null @@ -1,17 +0,0 @@ -. -*/ - -namespace Doctrine\Tests\ORM\Mapping\Symfony; - -/** - * @group DDC-1418 - */ -abstract class AbstractDriverTest extends \PHPUnit_Framework_TestCase -{ - public function testFindMappingFile() - { - $driver = $this->getDriver(array( - 'MyNamespace\MySubnamespace\EntityFoo' => 'foo', - 'MyNamespace\MySubnamespace\Entity' => $this->dir, - )); - - touch($filename = $this->dir.'/Foo'.$this->getFileExtension()); - $this->assertEquals($filename, $this->invoke($driver, '_findMappingFile', array('MyNamespace\MySubnamespace\Entity\Foo'))); - } - - public function testFindMappingFileInSubnamespace() - { - $driver = $this->getDriver(array( - 'MyNamespace\MySubnamespace\Entity' => $this->dir, - )); - - touch($filename = $this->dir.'/Foo.Bar'.$this->getFileExtension()); - $this->assertEquals($filename, $this->invoke($driver, '_findMappingFile', array('MyNamespace\MySubnamespace\Entity\Foo\Bar'))); - } - - public function testFindMappingFileNamespacedFoundFileNotFound() - { - $this->setExpectedException( - 'Doctrine\ORM\Mapping\MappingException', - "No mapping file found named '".$this->dir."/Foo".$this->getFileExtension()."' for class 'MyNamespace\MySubnamespace\Entity\Foo'." - ); - - $driver = $this->getDriver(array( - 'MyNamespace\MySubnamespace\Entity' => $this->dir, - )); - - $this->invoke($driver, '_findMappingFile', array('MyNamespace\MySubnamespace\Entity\Foo')); - } - - public function testFindMappingNamespaceNotFound() - { - $this->setExpectedException( - 'Doctrine\ORM\Mapping\MappingException', - "No mapping file found named 'Foo".$this->getFileExtension()."' for class 'MyOtherNamespace\MySubnamespace\Entity\Foo'." - ); - - $driver = $this->getDriver(array( - 'MyNamespace\MySubnamespace\Entity' => $this->dir, - )); - - $this->invoke($driver, '_findMappingFile', array('MyOtherNamespace\MySubnamespace\Entity\Foo')); - } - - protected function setUp() - { - $this->dir = sys_get_temp_dir().'/abstract_driver_test'; - @mkdir($this->dir, 0777, true); - } - - protected function tearDown() - { - $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->dir), \RecursiveIteratorIterator::CHILD_FIRST); - - foreach ($iterator as $path) { - if ($path->isDir()) { - @rmdir($path); - } else { - @unlink($path); - } - } - - @rmdir($this->dir); - } - - abstract protected function getFileExtension(); - abstract protected function getDriver(array $paths = array()); - - private function setField($obj, $field, $value) - { - $ref = new \ReflectionProperty($obj, $field); - $ref->setAccessible(true); - $ref->setValue($obj, $value); - } - - private function invoke($obj, $method, array $args = array()) { - $ref = new \ReflectionMethod($obj, $method); - $ref->setAccessible(true); - - return $ref->invokeArgs($obj, $args); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/Symfony/XmlDriverTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/Symfony/XmlDriverTest.php deleted file mode 100644 index 5908b67..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/Symfony/XmlDriverTest.php +++ /dev/null @@ -1,40 +0,0 @@ -. -*/ - -namespace Doctrine\Tests\ORM\Mapping\Symfony; - -use \Doctrine\ORM\Mapping\Driver\SimplifiedXmlDriver; - -/** - * @group DDC-1418 - */ -class XmlDriverTest extends AbstractDriverTest -{ - protected function getFileExtension() - { - return '.orm.xml'; - } - - protected function getDriver(array $paths = array()) - { - $driver = new SimplifiedXmlDriver(array_flip($paths)); - - return $driver; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/Symfony/YamlDriverTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/Symfony/YamlDriverTest.php deleted file mode 100644 index c5d8d1c..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/Symfony/YamlDriverTest.php +++ /dev/null @@ -1,40 +0,0 @@ -. -*/ - -namespace Doctrine\Tests\ORM\Mapping\Symfony; - -use \Doctrine\ORM\Mapping\Driver\SimplifiedYamlDriver; - -/** - * @group DDC-1418 - */ -class YamlDriverTest extends AbstractDriverTest -{ - protected function getFileExtension() - { - return '.orm.yml'; - } - - protected function getDriver(array $paths = array()) - { - $driver = new SimplifiedYamlDriver(array_flip($paths)); - - return $driver; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php deleted file mode 100644 index 6a852bc..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php +++ /dev/null @@ -1,96 +0,0 @@ -_loadDriver(); - - $class = new ClassMetadata($className); - $class->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - $mappingDriver->loadMetadataForClass($className, $class); - - $expectedMap = array( - "foo" => "Doctrine\Tests\ORM\Mapping\CTIFoo", - "bar" => "Doctrine\Tests\ORM\Mapping\CTIBar", - "baz" => "Doctrine\Tests\ORM\Mapping\CTIBaz", - ); - - $this->assertEquals(3, count($class->discriminatorMap)); - $this->assertEquals($expectedMap, $class->discriminatorMap); - } - - public function testIdentifierWithAssociationKey() - { - $driver = $this->_loadDriver(); - $em = $this->_getTestEntityManager(); - $factory = new \Doctrine\ORM\Mapping\ClassMetadataFactory(); - - $em->getConfiguration()->setMetadataDriverImpl($driver); - $factory->setEntityManager($em); - - $class = $factory->getMetadataFor('Doctrine\Tests\Models\DDC117\DDC117Translation'); - - $this->assertEquals(array('language', 'article'), $class->identifier); - $this->assertArrayHasKey('article', $class->associationMappings); - - $this->assertArrayHasKey('id', $class->associationMappings['article']); - $this->assertTrue($class->associationMappings['article']['id']); - } - - /** - * @group DDC-1468 - * - * @expectedException Doctrine\ORM\Mapping\MappingException - * @expectedExceptionMessage Invalid mapping file 'Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml' for class 'Doctrine\Tests\Models\Generic\SerializationModel'. - */ - public function testInvalidMappingFileException() - { - $this->createClassMetadata('Doctrine\Tests\Models\Generic\SerializationModel'); - } - - /** - * @param string $xmlMappingFile - * @dataProvider dataValidSchema - */ - public function testValidateXmlSchema($xmlMappingFile) - { - $xsdSchemaFile = __DIR__ . "/../../../../../doctrine-mapping.xsd"; - - $dom = new \DOMDocument('UTF-8'); - $dom->load($xmlMappingFile); - $this->assertTrue($dom->schemaValidate($xsdSchemaFile)); - } - - static public function dataValidSchema() - { - return array( - array(__DIR__ . "/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml"), - array(__DIR__ . "/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml"), - array(__DIR__ . "/xml/CatNoId.dcm.xml"), - ); - } -} - -class CTI -{ - public $id; -} - -class CTIFoo extends CTI {} -class CTIBar extends CTI {} -class CTIBaz extends CTI {} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php deleted file mode 100644 index 2757259..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php +++ /dev/null @@ -1,57 +0,0 @@ -markTestSkipped('Please install Symfony YAML Component into the include path of your PHP installation.'); - } - - return new YamlDriver(__DIR__ . DIRECTORY_SEPARATOR . 'yaml'); - } - - /** - * @group DDC-671 - * - * Entities for this test are in AbstractMappingDriverTest - */ - public function testJoinTablesWithMappedSuperclassForYamlDriver() - { - $yamlDriver = $this->_loadDriver(); - $yamlDriver->addPaths(array(__DIR__ . DIRECTORY_SEPARATOR . 'yaml')); - - $em = $this->_getTestEntityManager(); - $em->getConfiguration()->setMetadataDriverImpl($yamlDriver); - $factory = new \Doctrine\ORM\Mapping\ClassMetadataFactory(); - $factory->setEntityManager($em); - - $classPage = new ClassMetadata('Doctrine\Tests\Models\DirectoryTree\File'); - $classPage = $factory->getMetadataFor('Doctrine\Tests\Models\DirectoryTree\File'); - $this->assertEquals('Doctrine\Tests\Models\DirectoryTree\File', $classPage->associationMappings['parentDirectory']['sourceEntity']); - - $classDirectory = new ClassMetadata('Doctrine\Tests\Models\DirectoryTree\Directory'); - $classDirectory = $factory->getMetadataFor('Doctrine\Tests\Models\DirectoryTree\Directory'); - $this->assertEquals('Doctrine\Tests\Models\DirectoryTree\Directory', $classDirectory->associationMappings['parentDirectory']['sourceEntity']); - } - - /** - * @group DDC-1468 - * - * @expectedException Doctrine\ORM\Mapping\MappingException - * @expectedExceptionMessage Invalid mapping file 'Doctrine.Tests.Models.Generic.SerializationModel.dcm.yml' for class 'Doctrine\Tests\Models\Generic\SerializationModel'. - */ - public function testInvalidMappingFileException() - { - $this->createClassMetadata('Doctrine\Tests\Models\Generic\SerializationModel'); - } - -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.php deleted file mode 100644 index 56a9963..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.php +++ /dev/null @@ -1,12 +0,0 @@ -mapField(array( - 'id' => true, - 'fieldName' => 'id', -)); -$metadata->mapField(array( - 'fieldName' => 'name' -)); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE); \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.php deleted file mode 100644 index ad8b86d..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.php +++ /dev/null @@ -1,5 +0,0 @@ -mapField(array( - 'fieldName' => 'serialNumber', - 'type' => 'string', -)); \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.php deleted file mode 100644 index 1318333..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.php +++ /dev/null @@ -1,5 +0,0 @@ -mapField(array( - 'fieldName' => 'creditCardNumber', - 'type' => 'string', -)); \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869Payment.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869Payment.php deleted file mode 100644 index 1d1f551..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869Payment.php +++ /dev/null @@ -1,17 +0,0 @@ -mapField(array( - 'id' => true, - 'fieldName' => 'id', - 'type' => 'integer', - 'columnName' => 'id', -)); -$metadata->mapField(array( - 'fieldName' => 'value', - 'type' => 'float', - )); -$metadata->isMappedSuperclass = true; -$metadata->setCustomRepositoryClass("Doctrine\Tests\Models\DDC869\DDC869PaymentRepository"); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC1170Entity.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC1170Entity.php deleted file mode 100644 index 97f4624..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC1170Entity.php +++ /dev/null @@ -1,16 +0,0 @@ -mapField(array( - 'id' => true, - 'fieldName' => 'id', - 'columnDefinition' => 'INT unsigned NOT NULL', -)); - -$metadata->mapField(array( - 'fieldName' => 'value', - 'columnDefinition' => 'VARCHAR(255) NOT NULL' -)); - -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE); \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.User.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.User.php deleted file mode 100644 index 33020aa..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.User.php +++ /dev/null @@ -1,119 +0,0 @@ -setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); -$metadata->setPrimaryTable(array( - 'name' => 'cms_users', - )); -$metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT); -$metadata->addLifecycleCallback('doStuffOnPrePersist', 'prePersist'); -$metadata->addLifecycleCallback('doOtherStuffOnPrePersistToo', 'prePersist'); -$metadata->addLifecycleCallback('doStuffOnPostPersist', 'postPersist'); -$metadata->addNamedQuery(array( - 'name' => 'all', - 'query' => 'SELECT u FROM __CLASS__ u' -)); -$metadata->mapField(array( - 'id' => true, - 'fieldName' => 'id', - 'type' => 'integer', - 'columnName' => 'id', - )); -$metadata->mapField(array( - 'fieldName' => 'name', - 'type' => 'string', - 'length' => 50, - 'unique' => true, - 'nullable' => true, - 'columnName' => 'name', - )); -$metadata->mapField(array( - 'fieldName' => 'email', - 'type' => 'string', - 'columnName' => 'user_email', - 'columnDefinition' => 'CHAR(32) NOT NULL', - )); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); -$metadata->mapOneToOne(array( - 'fieldName' => 'address', - 'targetEntity' => 'Doctrine\\Tests\\ORM\\Mapping\\Address', - 'cascade' => - array( - 0 => 'remove', - ), - 'mappedBy' => NULL, - 'inversedBy' => 'user', - 'joinColumns' => - array( - 0 => - array( - 'name' => 'address_id', - 'referencedColumnName' => 'id', - 'onDelete' => 'CASCADE', - ), - ), - 'orphanRemoval' => false, - )); -$metadata->mapOneToMany(array( - 'fieldName' => 'phonenumbers', - 'targetEntity' => 'Doctrine\\Tests\\ORM\\Mapping\\Phonenumber', - 'cascade' => - array( - 1 => 'persist', - ), - 'mappedBy' => 'user', - 'orphanRemoval' => true, - 'orderBy' => - array( - 'number' => 'ASC', - ), - )); -$metadata->mapManyToMany(array( - 'fieldName' => 'groups', - 'targetEntity' => 'Doctrine\\Tests\\ORM\\Mapping\\Group', - 'cascade' => - array( - 0 => 'remove', - 1 => 'persist', - 2 => 'refresh', - 3 => 'merge', - 4 => 'detach', - ), - 'mappedBy' => NULL, - 'joinTable' => - array( - 'name' => 'cms_users_groups', - 'joinColumns' => - array( - 0 => - array( - 'name' => 'user_id', - 'referencedColumnName' => 'id', - 'unique' => false, - 'nullable' => false, - ), - ), - 'inverseJoinColumns' => - array( - 0 => - array( - 'name' => 'group_id', - 'referencedColumnName' => 'id', - 'columnDefinition' => 'INT NULL', - ), - ), - ), - 'orderBy' => NULL, - )); -$metadata->table['uniqueConstraints'] = array( - 'search_idx' => array('columns' => array('name', 'user_email')), -); -$metadata->table['indexes'] = array( - 'name_idx' => array('columns' => array('name')), 0 => array('columns' => array('user_email')) -); -$metadata->setSequenceGeneratorDefinition(array( - 'sequenceName' => 'tablename_seq', - 'allocationSize' => 100, - 'initialValue' => 1, - )); \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/CatNoId.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/CatNoId.dcm.xml deleted file mode 100644 index 6025d35..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/CatNoId.dcm.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC117.DDC117Translation.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC117.DDC117Translation.dcm.xml deleted file mode 100644 index c0df088..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC117.DDC117Translation.dcm.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.xml deleted file mode 100644 index 29b5f1d..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.xml deleted file mode 100644 index 05e2540..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.xml deleted file mode 100644 index daf01f0..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.xml deleted file mode 100644 index be9f760..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml deleted file mode 100644 index 36af855..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml deleted file mode 100644 index 6c2a235..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml deleted file mode 100644 index 14abaef..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.xml deleted file mode 100644 index 9f5ad7f..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml deleted file mode 100644 index f116fb0..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.yml deleted file mode 100644 index 3437a9b..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.yml +++ /dev/null @@ -1,8 +0,0 @@ -Doctrine\Tests\Models\DDC1476\DDC1476EntityWithDefaultFieldType: - type: entity - id: - id: - generator: - strategy: NONE - fields: - name: \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.yml deleted file mode 100644 index 94f2698..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.yml +++ /dev/null @@ -1,5 +0,0 @@ -Doctrine\Tests\Models\DDC869\DDC869ChequePayment: - type: entity - fields: - serialNumber: - type: string \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.yml deleted file mode 100644 index 153a99f..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.yml +++ /dev/null @@ -1,5 +0,0 @@ -Doctrine\Tests\Models\DDC869\DDC869CreditCardPayment: - type: entity - fields: - creditCardNumber: - type: string \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.yml deleted file mode 100644 index b776664..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.yml +++ /dev/null @@ -1,12 +0,0 @@ -Doctrine\Tests\Models\DDC869\DDC869Payment: - type: mappedSuperclass - repositoryClass : Doctrine\Tests\Models\DDC869\DDC869PaymentRepository - id: - id: - type: integer - unsigned: true - generator: - strategy: AUTO - fields: - value: - type: float \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DirectoryTree.AbstractContentItem.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DirectoryTree.AbstractContentItem.dcm.yml deleted file mode 100644 index 9c573a5..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DirectoryTree.AbstractContentItem.dcm.yml +++ /dev/null @@ -1,14 +0,0 @@ -Doctrine\Tests\Models\DirectoryTree\AbstractContentItem: - type: mappedSuperclass - id: - id: - type: integer - unsigned: true - generator: - strategy: AUTO - fields: - name: - type: string - manyToOne: - parentDirectory: - targetEntity: Doctrine\Tests\Models\DirectoryTree\Directory diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DirectoryTree.Directory.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DirectoryTree.Directory.dcm.yml deleted file mode 100644 index d2b93d4..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DirectoryTree.Directory.dcm.yml +++ /dev/null @@ -1,6 +0,0 @@ -Doctrine\Tests\Models\DirectoryTree\Directory: - type: entity - fields: - path: - type: string - length: 255 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DirectoryTree.File.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DirectoryTree.File.dcm.yml deleted file mode 100644 index cbc8edf..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DirectoryTree.File.dcm.yml +++ /dev/null @@ -1,6 +0,0 @@ -Doctrine\Tests\Models\DirectoryTree\File: - type: entity - fields: - extension: - type: string - length: 10 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.yml deleted file mode 100644 index 64f74b5..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.yml +++ /dev/null @@ -1,13 +0,0 @@ -\stdClass: - type: entity - id: - id: - type: integer - unsigned: true - generator: - strategy: AUTO - fields: - array: - type: array - object: - type: object \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.Animal.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.Animal.dcm.yml deleted file mode 100644 index cd6ec29..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.Animal.dcm.yml +++ /dev/null @@ -1,6 +0,0 @@ -Doctrine\Tests\ORM\Mapping\Animal: - type: entity - inheritanceType: SINGLE_TABLE - discriminatorMap: - cat: Cat - dog: Dog \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.yml deleted file mode 100644 index 8b2ac51..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.yml +++ /dev/null @@ -1,10 +0,0 @@ -Doctrine\Tests\ORM\Mapping\DDC1170Entity: - type: entity - id: - id: - columnDefinition: INT unsigned NOT NULL - generator: - strategy: NONE - fields: - value: - columnDefinition: VARCHAR(255) NOT NULL \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.User.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.User.dcm.yml deleted file mode 100644 index 3334749..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.User.dcm.yml +++ /dev/null @@ -1,68 +0,0 @@ -Doctrine\Tests\ORM\Mapping\User: - type: entity - table: cms_users - namedQueries: - all: SELECT u FROM __CLASS__ u - id: - id: - type: integer - generator: - strategy: AUTO - sequenceGenerator: - sequenceName: tablename_seq - allocationSize: 100 - initialValue: 1 - fields: - name: - type: string - length: 50 - nullable: true - unique: true - email: - type: string - column: user_email - columnDefinition: CHAR(32) NOT NULL - oneToOne: - address: - targetEntity: Address - inversedBy: user - joinColumn: - name: address_id - referencedColumnName: id - onDelete: CASCADE - cascade: [ remove ] - oneToMany: - phonenumbers: - targetEntity: Phonenumber - orphanRemoval: true - mappedBy: user - orderBy: - number: ASC - cascade: [ persist ] - manyToMany: - groups: - targetEntity: Group - joinTable: - name: cms_users_groups - joinColumns: - user_id: - referencedColumnName: id - nullable: false - unique: false - inverseJoinColumns: - group_id: - referencedColumnName: id - columnDefinition: INT NULL - cascade: - - all - lifecycleCallbacks: - prePersist: [ doStuffOnPrePersist, doOtherStuffOnPrePersistToo ] - postPersist: [ doStuffOnPostPersist ] - uniqueConstraints: - search_idx: - columns: name,user_email - indexes: - name_idx: - columns: name - 0: - columns: user_email \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/HydrationPerformanceTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/HydrationPerformanceTest.php deleted file mode 100644 index 07a202e..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/HydrationPerformanceTest.php +++ /dev/null @@ -1,461 +0,0 @@ - 0.7 seconds] - * - * MAXIMUM TIME: 1 second - */ - public function testSimpleQueryScalarHydrationPerformance10000Rows() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addFieldResult('u', 'u__username', 'username'); - $rsm->addFieldResult('u', 'u__name', 'name'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'u__username' => 'romanb', - 'u__name' => 'Roman', - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'u__username' => 'romanb', - 'u__name' => 'Roman', - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'u__username' => 'romanb', - 'u__name' => 'Roman', - ) - ); - - for ($i = 4; $i < 10000; ++$i) { - $resultSet[] = array( - 'u__id' => $i, - 'u__status' => 'developer', - 'u__username' => 'jwage', - 'u__name' => 'Jonathan', - ); - } - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ScalarHydrator($this->_em); - - $this->setMaxRunningTime(1); - $s = microtime(true); - $result = $hydrator->hydrateAll($stmt, $rsm); - $e = microtime(true); - echo __FUNCTION__ . " - " . ($e - $s) . " seconds" . PHP_EOL; - } - - /** - * Times for comparison: - * - * [romanb: 10000 rows => 1 second] - * - * MAXIMUM TIME: 2 seconds - */ - public function testSimpleQueryArrayHydrationPerformance10000Rows() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addFieldResult('u', 'u__username', 'username'); - $rsm->addFieldResult('u', 'u__name', 'name'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'u__username' => 'romanb', - 'u__name' => 'Roman', - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'u__username' => 'romanb', - 'u__name' => 'Roman', - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'u__username' => 'romanb', - 'u__name' => 'Roman', - ) - ); - - for ($i = 4; $i < 10000; ++$i) { - $resultSet[] = array( - 'u__id' => $i, - 'u__status' => 'developer', - 'u__username' => 'jwage', - 'u__name' => 'Jonathan', - ); - } - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ArrayHydrator($this->_em); - - $this->setMaxRunningTime(2); - $s = microtime(true); - $result = $hydrator->hydrateAll($stmt, $rsm); - $e = microtime(true); - echo __FUNCTION__ . " - " . ($e - $s) . " seconds" . PHP_EOL; - } - - /** - * Times for comparison: - * - * [romanb: 10000 rows => 1.4 seconds] - * - * MAXIMUM TIME: 3 seconds - */ - public function testMixedQueryFetchJoinArrayHydrationPerformance10000Rows() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsPhonenumber', - 'p', - 'u', - 'phonenumbers' - ); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addFieldResult('u', 'u__username', 'username'); - $rsm->addFieldResult('u', 'u__name', 'name'); - $rsm->addScalarResult('sclr0', 'nameUpper'); - $rsm->addFieldResult('p', 'p__phonenumber', 'phonenumber'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'u__username' => 'romanb', - 'u__name' => 'Roman', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '42', - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'u__username' => 'romanb', - 'u__name' => 'Roman', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '43', - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'u__username' => 'romanb', - 'u__name' => 'Roman', - 'sclr0' => 'JWAGE', - 'p__phonenumber' => '91' - ) - ); - - for ($i = 4; $i < 10000; ++$i) { - $resultSet[] = array( - 'u__id' => $i, - 'u__status' => 'developer', - 'u__username' => 'jwage', - 'u__name' => 'Jonathan', - 'sclr0' => 'JWAGE' . $i, - 'p__phonenumber' => '91' - ); - } - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ArrayHydrator($this->_em); - - $this->setMaxRunningTime(3); - $s = microtime(true); - $result = $hydrator->hydrateAll($stmt, $rsm); - $e = microtime(true); - echo __FUNCTION__ . " - " . ($e - $s) . " seconds" . PHP_EOL; - } - - /** - * [romanb: 10000 rows => 1.5 seconds] - * - * MAXIMUM TIME: 3 seconds - */ - public function testSimpleQueryPartialObjectHydrationPerformance10000Rows() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addFieldResult('u', 'u__username', 'username'); - $rsm->addFieldResult('u', 'u__name', 'name'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'u__username' => 'romanb', - 'u__name' => 'Roman', - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'u__username' => 'romanb', - 'u__name' => 'Roman', - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'u__username' => 'romanb', - 'u__name' => 'Roman', - ) - ); - - for ($i = 4; $i < 10000; ++$i) { - $resultSet[] = array( - 'u__id' => $i, - 'u__status' => 'developer', - 'u__username' => 'jwage', - 'u__name' => 'Jonathan', - ); - } - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - - $this->setMaxRunningTime(3); - $s = microtime(true); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - $e = microtime(true); - echo __FUNCTION__ . " - " . ($e - $s) . " seconds" . PHP_EOL; - } - - /** - * [romanb: 10000 rows => 3 seconds] - * - * MAXIMUM TIME: 4.5 seconds - */ - public function testSimpleQueryFullObjectHydrationPerformance10000Rows() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addFieldResult('u', 'u__username', 'username'); - $rsm->addFieldResult('u', 'u__name', 'name'); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsAddress', - 'a', - 'u', - 'address' - ); - $rsm->addFieldResult('a', 'a__id', 'id'); - //$rsm->addFieldResult('a', 'a__country', 'country'); - //$rsm->addFieldResult('a', 'a__zip', 'zip'); - //$rsm->addFieldResult('a', 'a__city', 'city'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'u__username' => 'romanb', - 'u__name' => 'Roman', - 'a__id' => '1' - ) - ); - - for ($i = 2; $i < 10000; ++$i) { - $resultSet[] = array( - 'u__id' => $i, - 'u__status' => 'developer', - 'u__username' => 'jwage', - 'u__name' => 'Jonathan', - 'a__id' => $i - ); - } - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - - $this->setMaxRunningTime(5); - $s = microtime(true); - $result = $hydrator->hydrateAll($stmt, $rsm); - $e = microtime(true); - echo __FUNCTION__ . " - " . ($e - $s) . " seconds" . PHP_EOL; - } - - /** - * [romanb: 2000 rows => 0.4 seconds] - * - * MAXIMUM TIME: 1 second - */ - public function testMixedQueryFetchJoinPartialObjectHydrationPerformance2000Rows() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsPhonenumber', - 'p', - 'u', - 'phonenumbers' - ); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addFieldResult('u', 'u__username', 'username'); - $rsm->addFieldResult('u', 'u__name', 'name'); - $rsm->addScalarResult('sclr0', 'nameUpper'); - $rsm->addFieldResult('p', 'p__phonenumber', 'phonenumber'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'u__username' => 'romanb', - 'u__name' => 'Roman', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '42', - ), - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'u__username' => 'romanb', - 'u__name' => 'Roman', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '43', - ), - array( - 'u__id' => '2', - 'u__status' => 'developer', - 'u__username' => 'romanb', - 'u__name' => 'Roman', - 'sclr0' => 'JWAGE', - 'p__phonenumber' => '91' - ) - ); - - for ($i = 4; $i < 2000; ++$i) { - $resultSet[] = array( - 'u__id' => $i, - 'u__status' => 'developer', - 'u__username' => 'jwage', - 'u__name' => 'Jonathan', - 'sclr0' => 'JWAGE' . $i, - 'p__phonenumber' => '91' - ); - } - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - - $this->setMaxRunningTime(1); - $s = microtime(true); - $result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true)); - $e = microtime(true); - echo __FUNCTION__ . " - " . ($e - $s) . " seconds" . PHP_EOL; - } - - /** - * [romanb: 2000 rows => 0.6 seconds] - * - * MAXIMUM TIME: 1 second - */ - public function testMixedQueryFetchJoinFullObjectHydrationPerformance2000Rows() - { - $rsm = new ResultSetMapping; - $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsPhonenumber', - 'p', - 'u', - 'phonenumbers' - ); - $rsm->addFieldResult('u', 'u__id', 'id'); - $rsm->addFieldResult('u', 'u__status', 'status'); - $rsm->addFieldResult('u', 'u__username', 'username'); - $rsm->addFieldResult('u', 'u__name', 'name'); - $rsm->addScalarResult('sclr0', 'nameUpper'); - $rsm->addFieldResult('p', 'p__phonenumber', 'phonenumber'); - $rsm->addJoinedEntityResult( - 'Doctrine\Tests\Models\CMS\CmsAddress', - 'a', - 'u', - 'address' - ); - $rsm->addFieldResult('a', 'a__id', 'id'); - - // Faked result set - $resultSet = array( - //row1 - array( - 'u__id' => '1', - 'u__status' => 'developer', - 'u__username' => 'romanb', - 'u__name' => 'Roman', - 'sclr0' => 'ROMANB', - 'p__phonenumber' => '42', - 'a__id' => '1' - ) - ); - - for ($i = 2; $i < 2000; ++$i) { - $resultSet[] = array( - 'u__id' => $i, - 'u__status' => 'developer', - 'u__username' => 'jwage', - 'u__name' => 'Jonathan', - 'sclr0' => 'JWAGE' . $i, - 'p__phonenumber' => '91', - 'a__id' => $i - ); - } - - $stmt = new HydratorMockStatement($resultSet); - $hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em); - - $this->setMaxRunningTime(1); - $s = microtime(true); - $result = $hydrator->hydrateAll($stmt, $rsm); - $e = microtime(true); - echo __FUNCTION__ . " - " . ($e - $s) . " seconds" . PHP_EOL; - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/InheritancePersisterPerformanceTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/InheritancePersisterPerformanceTest.php deleted file mode 100644 index 1c19264..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/InheritancePersisterPerformanceTest.php +++ /dev/null @@ -1,66 +0,0 @@ -useModelSet('company'); - parent::setUp(); - } - - public function testCompanyContract() - { - $person = new \Doctrine\Tests\Models\Company\CompanyEmployee(); - $person->setName('Poor Sales Guy'); - $person->setDepartment('Sales'); - $person->setSalary(100); - $this->_em->persist($person); - - for ($i = 0; $i < 33; $i++) { - $fix = new \Doctrine\Tests\Models\Company\CompanyFixContract(); - $fix->setFixPrice(1000); - $fix->setSalesPerson($person); - $fix->markCompleted(); - $this->_em->persist($fix); - - $flex = new \Doctrine\Tests\Models\Company\CompanyFlexContract(); - $flex->setSalesPerson($person); - $flex->setHoursWorked(100); - $flex->setPricePerHour(100); - $flex->markCompleted(); - $this->_em->persist($flex); - - $ultra = new \Doctrine\Tests\Models\Company\CompanyFlexUltraContract(); - $ultra->setSalesPerson($person); - $ultra->setHoursWorked(150); - $ultra->setPricePerHour(150); - $ultra->setMaxPrice(7000); - $this->_em->persist($ultra); - } - - $this->_em->flush(); - $this->_em->clear(); - - $start = microtime(true); - $contracts = $this->_em->getRepository('Doctrine\Tests\Models\Company\CompanyContract')->findAll(); - echo "99 CompanyContract: " . number_format(microtime(true) - $start, 6) . "\n"; - $this->assertEquals(99, count($contracts)); - - $this->_em->clear(); - - $start = microtime(true); - $contracts = $this->_em->getRepository('Doctrine\Tests\Models\Company\CompanyContract')->findAll(); - echo "99 CompanyContract: " . number_format(microtime(true) - $start, 6) . "\n"; - $this->assertEquals(99, count($contracts)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/InsertPerformanceTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/InsertPerformanceTest.php deleted file mode 100644 index 1c378df..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/InsertPerformanceTest.php +++ /dev/null @@ -1,56 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - /** - * [romanb: 10000 objects in ~8 seconds] - */ - public function testInsertPerformance() - { - $s = microtime(true); - - $conn = $this->_em->getConnection(); - - $this->setMaxRunningTime(10); - - //echo "Memory usage before: " . (memory_get_usage() / 1024) . " KB" . PHP_EOL; - - $batchSize = 20; - for ($i=1; $i<=10000; ++$i) { - $user = new CmsUser; - $user->status = 'user'; - $user->username = 'user' . $i; - $user->name = 'Mr.Smith-' . $i; - $this->_em->persist($user); - if (($i % $batchSize) == 0) { - $this->_em->flush(); - $this->_em->clear(); - } - } - - //gc_collect_cycles(); - //echo "Memory usage after: " . (memory_get_usage() / 1024) . " KB" . PHP_EOL; - - $e = microtime(true); - - echo ' Inserted 10000 objects in ' . ($e - $s) . ' seconds' . PHP_EOL; - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/PersisterPerformanceTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/PersisterPerformanceTest.php deleted file mode 100644 index ec43268..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/PersisterPerformanceTest.php +++ /dev/null @@ -1,121 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - public function testFindCmsArticle() - { - $author = new CmsUser(); - $author->name = "beberlei"; - $author->status = "active"; - $author->username = "beberlei"; - $this->_em->persist($author); - - $ids = array(); - for ($i = 0; $i < 100; $i++) { - $article = new CmsArticle(); - $article->text = "foo"; - $article->topic = "bar"; - $article->user = $author; - $this->_em->persist($article); - $ids[] = $article; - } - $this->_em->flush(); - $this->_em->clear(); - - $start = microtime(true); - $articles = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsArticle')->findAll(); - echo "100 CmsArticle findAll(): " . number_format(microtime(true) - $start, 6) . "\n"; - - $this->_em->clear(); - - $start = microtime(true); - $articles = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsArticle')->findAll(); - echo "100 CmsArticle findAll(): " . number_format(microtime(true) - $start, 6) . "\n"; - - $this->_em->clear(); - - $start = microtime(true); - for ($i = 0; $i < 100; $i++) { - $articles = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsArticle')->find($ids[$i]->id); - } - echo "100 CmsArticle find(): " . number_format(microtime(true) - $start, 6) . "\n"; - - $this->_em->clear(); - - $start = microtime(true); - for ($i = 0; $i < 100; $i++) { - $articles = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsArticle')->find($ids[$i]->id); - } - echo "100 CmsArticle find(): " . number_format(microtime(true) - $start, 6) . "\n"; - } - - public function testFindCmsGroup() - { - for ($i = 0; $i < 100; $i++) { - $group = new CmsGroup(); - $group->name = "foo" . $i; - $this->_em->persist($group); - } - $this->_em->flush(); - $this->_em->clear(); - - $start = microtime(true); - $articles = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsGroup')->findAll(); - echo "100 CmsGroup: " . number_format(microtime(true) - $start, 6) . "\n"; - - $this->_em->clear(); - - $start = microtime(true); - $articles = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsGroup')->findAll(); - echo "100 CmsGroup: " . number_format(microtime(true) - $start, 6) . "\n"; - } - - public function testFindCmsUser() - { - for ($i = 0; $i < 100; $i++) { - $user = new CmsUser(); - $user->name = "beberlei"; - $user->status = "active"; - $user->username = "beberlei".$i; - $this->_em->persist($user); - } - - $this->_em->flush(); - $this->_em->clear(); - - $start = microtime(true); - $articles = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser')->findAll(); - echo "100 CmsUser: " . number_format(microtime(true) - $start, 6) . "\n"; - - $this->_em->clear(); - - $start = microtime(true); - $articles = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser')->findAll(); - echo "100 CmsUser: " . number_format(microtime(true) - $start, 6) . "\n"; - } -} - - - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/UnitOfWorkPerformanceTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/UnitOfWorkPerformanceTest.php deleted file mode 100644 index 9320828..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/UnitOfWorkPerformanceTest.php +++ /dev/null @@ -1,51 +0,0 @@ -useModelSet('cms'); - parent::setUp(); - } - - public function testComputeChanges() - { - $n = 100; - - $users = array(); - for ($i=1; $i<=$n; ++$i) { - $user = new CmsUser; - $user->status = 'user'; - $user->username = 'user' . $i; - $user->name = 'Mr.Smith-' . $i; - $this->_em->persist($user); - $users[] = $user; - } - $this->_em->flush(); - - - foreach ($users AS $user) { - $user->status = 'other'; - $user->username = $user->username . '++'; - $user->name = str_replace('Mr.', 'Mrs.', $user->name); - } - - $s = microtime(true); - $this->_em->flush(); - $e = microtime(true); - - echo ' Compute ChangeSet '.$n.' objects in ' . ($e - $s) . ' seconds' . PHP_EOL; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/PersistentCollectionTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/PersistentCollectionTest.php deleted file mode 100644 index fd0dffb..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/PersistentCollectionTest.php +++ /dev/null @@ -1,37 +0,0 @@ - - */ -class PersistentCollectionTest extends \Doctrine\Tests\OrmTestCase -{ - private $_connectionMock; - private $_emMock; - - protected function setUp() - { - parent::setUp(); - // SUT - $this->_connectionMock = new ConnectionMock(array(), new \Doctrine\Tests\Mocks\DriverMock()); - $this->_emMock = EntityManagerMock::create($this->_connectionMock); - } - - public function testCanBePutInLazyLoadingMode() - { - $class = $this->_emMock->getClassMetadata('Doctrine\Tests\Models\ECommerce\ECommerceProduct'); - $collection = new PersistentCollection($this->_emMock, $class, new ArrayCollection); - $collection->setInitialized(false); - $this->assertFalse($collection->isInitialized()); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php deleted file mode 100644 index d1fe9a6..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php +++ /dev/null @@ -1,79 +0,0 @@ -_em = $this->_getTestEntityManager(); - - $this->_persister = new BasicEntityPersister($this->_em, $this->_em->getClassMetadata("Doctrine\Tests\Models\CustomType\CustomTypeParent")); - } - - public function testGetInsertSQLUsesTypeValuesSQL() - { - $method = new \ReflectionMethod($this->_persister, '_getInsertSQL'); - $method->setAccessible(true); - - $sql = $method->invoke($this->_persister); - - $this->assertEquals('INSERT INTO customtype_parents (customInteger, child_id) VALUES (ABS(?), ?)', $sql); - } - - public function testUpdateUsesTypeValuesSQL() - { - $child = new CustomTypeChild(); - - $parent = new CustomTypeParent(); - $parent->customInteger = 1; - $parent->child = $child; - - $this->_em->getUnitOfWork()->registerManaged($parent, array('id' => 1), array('customInteger' => 0, 'child' => null)); - $this->_em->getUnitOfWork()->registerManaged($child, array('id' => 1), array()); - - $this->_em->getUnitOfWork()->propertyChanged($parent, 'customInteger', 0, 1); - $this->_em->getUnitOfWork()->propertyChanged($parent, 'child', null, $child); - - $this->_persister->update($parent); - - $executeUpdates = $this->_em->getConnection()->getExecuteUpdates(); - - $this->assertEquals('UPDATE customtype_parents SET customInteger = ABS(?), child_id = ? WHERE id = ?', $executeUpdates[0]['query']); - } - - public function testGetSelectConditionSQLUsesTypeValuesSQL() - { - $method = new \ReflectionMethod($this->_persister, '_getSelectConditionSQL'); - $method->setAccessible(true); - - $sql = $method->invoke($this->_persister, array('customInteger' => 1, 'child' => 1)); - - $this->assertEquals('t0.customInteger = ABS(?) AND t0.child_id = ?', $sql); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Proxy/AutoloaderTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Proxy/AutoloaderTest.php deleted file mode 100644 index ff5bf0f..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Proxy/AutoloaderTest.php +++ /dev/null @@ -1,62 +0,0 @@ -. - */ - -namespace Doctrine\Tests\ORM\Proxy; - -use Doctrine\Tests\OrmTestCase; -use Doctrine\ORM\Proxy\Autoloader; - -/** - * @group DDC-1698 - */ -class AutoloaderTest extends OrmTestCase -{ - static public function dataResolveFile() - { - return array( - array('/tmp', 'MyProxy', 'MyProxy\__CG__\RealClass', '/tmp/__CG__RealClass.php'), - array('/tmp', 'MyProxy\Subdir', 'MyProxy\Subdir\__CG__\RealClass', '/tmp/__CG__RealClass.php'), - array('/tmp', 'MyProxy', 'MyProxy\__CG__\Other\RealClass', '/tmp/__CG__OtherRealClass.php'), - ); - } - - /** - * @dataProvider dataResolveFile - */ - public function testResolveFile($proxyDir, $proxyNamespace, $className, $expectedProxyFile) - { - $actualProxyFile = Autoloader::resolveFile($proxyDir, $proxyNamespace, $className); - $this->assertEquals($expectedProxyFile, $actualProxyFile); - } - - public function testAutoload() - { - if (file_exists(sys_get_temp_dir() ."/AutoloaderTestClass.php")) { - unlink(sys_get_temp_dir() ."/AutoloaderTestClass.php"); - } - - $autoloader = Autoloader::register(sys_get_temp_dir(), 'ProxyAutoloaderTest', function($proxyDir, $proxyNamespace, $className) { - file_put_contents(sys_get_temp_dir() . "/AutoloaderTestClass.php", "assertTrue(class_exists('ProxyAutoloaderTest\AutoloaderTestClass', true)); - unlink(sys_get_temp_dir() ."/AutoloaderTestClass.php"); - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Proxy/ProxyClassGeneratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Proxy/ProxyClassGeneratorTest.php deleted file mode 100644 index 894d500..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Proxy/ProxyClassGeneratorTest.php +++ /dev/null @@ -1,204 +0,0 @@ - - */ -class ProxyClassGeneratorTest extends \Doctrine\Tests\OrmTestCase -{ - private $_connectionMock; - private $_uowMock; - private $_emMock; - - /** - * @var \Doctrine\ORM\Proxy\ProxyFactory - */ - private $_proxyFactory; - - protected function setUp() - { - parent::setUp(); - $this->_connectionMock = new ConnectionMock(array(), new \Doctrine\Tests\Mocks\DriverMock()); - $this->_emMock = EntityManagerMock::create($this->_connectionMock); - $this->_uowMock = new UnitOfWorkMock($this->_emMock); - $this->_emMock->setUnitOfWork($this->_uowMock); - // SUT - $this->_proxyFactory = new ProxyFactory($this->_emMock, __DIR__ . '/generated', 'Proxies', true); - } - - protected function tearDown() - { - foreach (new \DirectoryIterator(__DIR__ . '/generated') as $file) { - if (strstr($file->getFilename(), '.php')) { - unlink($file->getPathname()); - } - } - } - - public function testReferenceProxyDelegatesLoadingToThePersister() - { - $identifier = array('id' => 42); - $proxyClass = 'Proxies\__CG__\Doctrine\Tests\Models\ECommerce\ECommerceFeature'; - $persister = $this->_getMockPersister(); - $this->_uowMock->setEntityPersister('Doctrine\Tests\Models\ECommerce\ECommerceFeature', $persister); - - $proxy = $this->_proxyFactory->getProxy('Doctrine\Tests\Models\ECommerce\ECommerceFeature', $identifier); - - $persister->expects($this->atLeastOnce()) - ->method('load') - ->with($this->equalTo($identifier), $this->isInstanceOf($proxyClass)) - ->will($this->returnValue(new \stdClass())); // fake return of entity instance - - $proxy->getDescription(); - } - - public function testReferenceProxyExecutesLoadingOnlyOnce() - { - $identifier = array('id' => 42); - $proxyClass = 'Proxies\__CG__\Doctrine\Tests\Models\ECommerce\ECommerceFeature'; - $persister = $this->_getMockPersister(); - $this->_uowMock->setEntityPersister('Doctrine\Tests\Models\ECommerce\ECommerceFeature', $persister); - $proxy = $this->_proxyFactory->getProxy('Doctrine\Tests\Models\ECommerce\ECommerceFeature', $identifier); - - $persister->expects($this->atLeastOnce()) - ->method('load') - ->with($this->equalTo($identifier), $this->isInstanceOf($proxyClass)) - ->will($this->returnValue(new \stdClass())); // fake return of entity instance - $proxy->getDescription(); - $proxy->getProduct(); - } - - public function testReferenceProxyRespectsMethodsParametersTypeHinting() - { - $proxyClass = 'Proxies\DoctrineTestsModelsECommerceECommerceFeatureProxy'; - $persister = $this->_getMockPersister(); - $this->_uowMock->setEntityPersister('Doctrine\Tests\Models\ECommerce\ECommerceFeature', $persister); - $proxy = $this->_proxyFactory->getProxy('Doctrine\Tests\Models\ECommerce\ECommerceFeature', null); - - $method = new \ReflectionMethod(get_class($proxy), 'setProduct'); - $params = $method->getParameters(); - - $this->assertEquals(1, count($params)); - $this->assertEquals('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $params[0]->getClass()->getName()); - } - - /** - * Test that the proxy behaves in regard to methods like &foo() correctly - */ - public function testProxyRespectsMethodsWhichReturnValuesByReference() { - $proxy = $this->_proxyFactory->getProxy('Doctrine\Tests\Models\Forum\ForumEntry', null); - $method = new \ReflectionMethod(get_class($proxy), 'getTopicByReference'); - - $this->assertTrue($method->returnsReference()); - } - - public function testCreatesAssociationProxyAsSubclassOfTheOriginalOne() - { - $proxyClass = 'Proxies\__CG__\Doctrine\Tests\Models\ECommerce\ECommerceFeature'; - $this->assertTrue(is_subclass_of($proxyClass, 'Doctrine\Tests\Models\ECommerce\ECommerceFeature')); - } - - - public function testAllowsConcurrentCreationOfBothProxyTypes() - { - $referenceProxyClass = 'Proxies\DoctrineTestsModelsECommerceECommerceFeatureProxy'; - $associationProxyClass = 'Proxies\DoctrineTestsModelsECommerceECommerceFeatureAProxy'; - $this->assertNotEquals($referenceProxyClass, $associationProxyClass); - } - - public function testNonNamespacedProxyGeneration() - { - require_once dirname(__FILE__)."/fixtures/NonNamespacedProxies.php"; - - $className = "\DoctrineOrmTestEntity"; - $proxyName = "DoctrineOrmTestEntity"; - $classMetadata = new \Doctrine\ORM\Mapping\ClassMetadata($className); - $classMetadata->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - $classMetadata->mapField(array('fieldName' => 'id', 'type' => 'integer')); - $classMetadata->setIdentifier(array('id')); - - $this->_proxyFactory->generateProxyClasses(array($classMetadata)); - - $classCode = file_get_contents(dirname(__FILE__)."/generated/__CG__".$proxyName.".php"); - - $this->assertNotContains("class DoctrineOrmTestEntity extends \\\\DoctrineOrmTestEntity", $classCode); - $this->assertContains("class DoctrineOrmTestEntity extends \\DoctrineOrmTestEntity", $classCode); - } - - public function testClassWithSleepProxyGeneration() - { - $className = "\Doctrine\Tests\ORM\Proxy\SleepClass"; - $proxyName = "DoctrineTestsORMProxySleepClass"; - $classMetadata = new \Doctrine\ORM\Mapping\ClassMetadata($className); - $classMetadata->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - $classMetadata->mapField(array('fieldName' => 'id', 'type' => 'integer')); - $classMetadata->setIdentifier(array('id')); - - $this->_proxyFactory->generateProxyClasses(array($classMetadata)); - - $classCode = file_get_contents(dirname(__FILE__)."/generated/__CG__".$proxyName.".php"); - - $this->assertEquals(1, substr_count($classCode, 'function __sleep')); - } - - /** - * @group DDC-1771 - */ - public function testSkipAbstractClassesOnGeneration() - { - $cm = new \Doctrine\ORM\Mapping\ClassMetadata(__NAMESPACE__ . '\\AbstractClass'); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - $this->assertNotNull($cm->reflClass); - - $num = $this->_proxyFactory->generateProxyClasses(array($cm)); - - $this->assertEquals(0, $num, "No proxies generated."); - } - - public function testNoConfigDir_ThrowsException() - { - $this->setExpectedException('Doctrine\ORM\Proxy\ProxyException'); - new ProxyFactory($this->_getTestEntityManager(), null, null); - } - - public function testNoNamespace_ThrowsException() - { - $this->setExpectedException('Doctrine\ORM\Proxy\ProxyException'); - new ProxyFactory($this->_getTestEntityManager(), __DIR__ . '/generated', null); - } - - protected function _getMockPersister() - { - $persister = $this->getMock('Doctrine\ORM\Persisters\BasicEntityPersister', array('load'), array(), '', false); - return $persister; - } -} - -class SleepClass -{ - public $id; - - public function __sleep() - { - return array('id'); - } -} - -abstract class AbstractClass -{ - -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Proxy/fixtures/NonNamespacedProxies.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Proxy/fixtures/NonNamespacedProxies.php deleted file mode 100644 index 88c06e4..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Proxy/fixtures/NonNamespacedProxies.php +++ /dev/null @@ -1,13 +0,0 @@ -. - */ - -namespace Doctrine\Tests\ORM\Query; - -require_once __DIR__ . '/../../TestInit.php'; - -/** - * Test case for testing the saving and referencing of query identifiers. - * - * @author Guilherme Blanco - * @author Janne Vanhala - * @author Konsta Vesterinen - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link http://www.phpdoctrine.org - * @since 2.0 - * @version $Revision$ - * @todo 1) [romanb] We might want to split the SQL generation tests into multiple - * testcases later since we'll have a lot of them and we might want to have special SQL - * generation tests for some dbms specific SQL syntaxes. - */ -class DeleteSqlGenerationTest extends \Doctrine\Tests\OrmTestCase -{ - private $_em; - - protected function setUp() { - $this->_em = $this->_getTestEntityManager(); - } - - public function assertSqlGeneration($dqlToBeTested, $sqlToBeConfirmed) - { - try { - $query = $this->_em->createQuery($dqlToBeTested); - parent::assertEquals($sqlToBeConfirmed, $query->getSql()); - $query->free(); - } catch (\Exception $e) { - $this->fail($e->getMessage()); - } - } - - public function testSupportsDeleteWithoutWhereAndFrom() - { - $this->assertSqlGeneration( - 'DELETE Doctrine\Tests\Models\CMS\CmsUser u', - 'DELETE FROM cms_users' - ); - } - - public function testSupportsDeleteWithoutWhere() - { - $this->assertSqlGeneration( - 'DELETE FROM Doctrine\Tests\Models\CMS\CmsUser u', - 'DELETE FROM cms_users' - ); - } - - public function testSupportsWhereClause() - { - $this->assertSqlGeneration( - 'DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = ?1', - 'DELETE FROM cms_users WHERE id = ?' - ); - } - - public function testSupportsWhereOrExpressions() - { - $this->assertSqlGeneration( - 'DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username = ?1 OR u.name = ?2', - 'DELETE FROM cms_users WHERE username = ? OR name = ?' - ); - } - - public function testSupportsWhereNestedConditionalExpressions() - { - $this->assertSqlGeneration( - 'DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = ?1 OR ( u.username = ?2 OR u.name = ?3)', - 'DELETE FROM cms_users WHERE id = ? OR (username = ? OR name = ?)' - ); - - //$this->assertSqlGeneration( - // 'DELETE FROM Doctrine\Tests\Models\CMS\CmsUser WHERE id = ?1', - // 'DELETE FROM cms_users WHERE id = ?' - //); - } - - public function testIsCaseAgnostic() - { - $this->assertSqlGeneration( - "delete from Doctrine\Tests\Models\CMS\CmsUser u where u.username = ?1", - "DELETE FROM cms_users WHERE username = ?" - ); - } - - public function testSupportsAndCondition() - { - $this->assertSqlGeneration( - "DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username = ?1 AND u.name = ?2", - "DELETE FROM cms_users WHERE username = ? AND name = ?" - ); - } - - public function testSupportsWhereNot() - { - $this->assertSqlGeneration( - "DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE NOT u.id != ?1", - "DELETE FROM cms_users WHERE NOT id <> ?" - ); - } - - public function testSupportsWhereNotWithParentheses() - { - $this->assertSqlGeneration( - "DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE NOT ( u.id != ?1 )", - "DELETE FROM cms_users WHERE NOT (id <> ?)" - ); - } - - public function testSupportsWhereNotWithAndExpression() - { - $this->assertSqlGeneration( - "DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE NOT ( u.id != ?1 AND u.username = ?2 )", - "DELETE FROM cms_users WHERE NOT (id <> ? AND username = ?)" - ); - } - - // ConditionalPrimary was already tested (see testSupportsWhereClause() and testSupportsWhereNot()) - - public function testSupportsGreaterThanComparisonClause() - { - // id = ? was already tested (see testDeleteWithWhere()) - $this->assertSqlGeneration( - "DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id > ?1", - "DELETE FROM cms_users WHERE id > ?" - ); - } - - public function testSupportsGreaterThanOrEqualToComparisonClause() - { - $this->assertSqlGeneration( - "DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id >= ?1", - "DELETE FROM cms_users WHERE id >= ?" - ); - } - - public function testSupportsLessThanComparisonClause() - { - $this->assertSqlGeneration( - "DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id < ?1", - "DELETE FROM cms_users WHERE id < ?" - ); - } - - public function testSupportsLessThanOrEqualToComparisonClause() - { - $this->assertSqlGeneration( - "DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id <= ?1", - "DELETE FROM cms_users WHERE id <= ?" - ); - } - - public function testSupportsNotEqualToComparisonClause() - { - $this->assertSqlGeneration( - "DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id <> ?1", - "DELETE FROM cms_users WHERE id <> ?" - ); - } - - public function testSupportsNotEqualToComparisonClauseExpressedWithExclamationMark() - { - $this->assertSqlGeneration( - "DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id != ?1", - "DELETE FROM cms_users WHERE id <> ?" - ); - } - - public function testSupportsNotBetweenClause() - { - $this->assertSqlGeneration( - "DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id NOT BETWEEN ?1 AND ?2", - "DELETE FROM cms_users WHERE id NOT BETWEEN ? AND ?" - ); - } - - public function testSupportsBetweenClauseUsedWithAndClause() - { - $this->assertSqlGeneration( - "DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id BETWEEN ?1 AND ?2 AND u.username != ?3", - "DELETE FROM cms_users WHERE id BETWEEN ? AND ? AND username <> ?" - ); - } - - public function testSupportsNotLikeClause() - { - // "WHERE" Expression LikeExpression - $this->assertSqlGeneration( - 'DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username NOT LIKE ?1', - 'DELETE FROM cms_users WHERE username NOT LIKE ?' - ); - } - - public function testSupportsLikeClauseWithEscapeExpression() - { - $this->assertSqlGeneration( - "DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username LIKE ?1 ESCAPE '\\'", - "DELETE FROM cms_users WHERE username LIKE ? ESCAPE '\\'" - ); - } - - public function testSupportsIsNullClause() - { - // "WHERE" Expression NullComparisonExpression - $this->assertSqlGeneration( - 'DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name IS NULL', - 'DELETE FROM cms_users WHERE name IS NULL' - ); - } - - public function testSupportsIsNotNullClause() - { - $this->assertSqlGeneration( - 'DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name IS NOT NULL', - 'DELETE FROM cms_users WHERE name IS NOT NULL' - ); - } - - public function testSupportsAtomExpressionAsClause() - { - $this->assertSqlGeneration( - 'DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE 1 = 1', - 'DELETE FROM cms_users WHERE 1 = 1' - ); - } - - public function testSupportsParameterizedAtomExpression() - { - $this->assertSqlGeneration( - 'DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE ?1 = 1', - 'DELETE FROM cms_users WHERE ? = 1' - ); - } - - public function testSupportsInClause() - { - $this->assertSqlGeneration( - 'DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id IN ( ?1, ?2, ?3, ?4 )', - 'DELETE FROM cms_users WHERE id IN (?, ?, ?, ?)' - ); - } - - public function testSupportsNotInClause() - { - $this->assertSqlGeneration( - 'DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id NOT IN ( ?1, ?2 )', - 'DELETE FROM cms_users WHERE id NOT IN (?, ?)' - ); - } - - /** - * @group DDC-980 - */ - public function testSubselectTableAliasReferencing() - { - $this->assertSqlGeneration( - 'DELETE Doctrine\Tests\Models\CMS\CmsUser u WHERE SIZE(u.groups) = 10', - 'DELETE FROM cms_users WHERE (SELECT COUNT(*) FROM cms_users_groups c0_ WHERE c0_.user_id = cms_users.id) = 10' - ); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/ExprTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/ExprTest.php deleted file mode 100644 index 265b2ba..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/ExprTest.php +++ /dev/null @@ -1,348 +0,0 @@ -. - */ - -namespace Doctrine\Tests\ORM\Query; - -use Doctrine\ORM\Query\Expr; -use Doctrine\ORM\Query; - -require_once __DIR__ . '/../../TestInit.php'; - -/** - * Test case for the DQL Expr class used for generating DQL snippets through - * a programmatic interface - * - * @author Jonathan H. Wage - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link http://www.phpdoctrine.org - * @since 2.0 - * @version $Revision$ - */ -class ExprTest extends \Doctrine\Tests\OrmTestCase -{ - private $_em; - - protected function setUp() - { - $this->_em = $this->_getTestEntityManager(); - $this->_expr = new Expr; - } - - public function testAvgExpr() - { - $this->assertEquals('AVG(u.id)', (string) $this->_expr->avg('u.id')); - } - - public function testMaxExpr() - { - $this->assertEquals('MAX(u.id)', (string) $this->_expr->max('u.id')); - } - - public function testMinExpr() - { - $this->assertEquals('MIN(u.id)', (string) $this->_expr->min('u.id')); - } - - public function testCountExpr() - { - $this->assertEquals('MAX(u.id)', (string) $this->_expr->max('u.id')); - } - - public function testCountDistinctExpr() - { - $this->assertEquals('COUNT(DISTINCT u.id)', (string) $this->_expr->countDistinct('u.id')); - } - - public function testExistsExpr() - { - $qb = $this->_em->createQueryBuilder(); - $qb->select('u')->from('User', 'u')->where('u.name = ?1'); - - $this->assertEquals('EXISTS(SELECT u FROM User u WHERE u.name = ?1)', (string) $this->_expr->exists($qb)); - } - - public function testAllExpr() - { - $qb = $this->_em->createQueryBuilder(); - $qb->select('u')->from('User', 'u')->where('u.name = ?1'); - - $this->assertEquals('ALL(SELECT u FROM User u WHERE u.name = ?1)', (string) $this->_expr->all($qb)); - } - - public function testSomeExpr() - { - $qb = $this->_em->createQueryBuilder(); - $qb->select('u')->from('User', 'u')->where('u.name = ?1'); - - $this->assertEquals('SOME(SELECT u FROM User u WHERE u.name = ?1)', (string) $this->_expr->some($qb)); - } - - public function testAnyExpr() - { - $qb = $this->_em->createQueryBuilder(); - $qb->select('u')->from('User', 'u')->where('u.name = ?1'); - - $this->assertEquals('ANY(SELECT u FROM User u WHERE u.name = ?1)', (string) $this->_expr->any($qb)); - } - - public function testNotExpr() - { - $qb = $this->_em->createQueryBuilder(); - $qb->select('u')->from('User', 'u')->where('u.name = ?1'); - - $this->assertEquals('NOT(SELECT u FROM User u WHERE u.name = ?1)', (string) $this->_expr->not($qb)); - } - - public function testAndExpr() - { - $this->assertEquals('1 = 1 AND 2 = 2', (string) $this->_expr->andx((string) $this->_expr->eq(1, 1), (string) $this->_expr->eq(2, 2))); - } - - public function testIntelligentParenthesisPreventionAndExpr() - { - $this->assertEquals( - '1 = 1 AND 2 = 2', - (string) $this->_expr->andx($this->_expr->orx($this->_expr->andx($this->_expr->eq(1, 1))), (string) $this->_expr->eq(2, 2)) - ); - } - - public function testOrExpr() - { - $this->assertEquals('1 = 1 OR 2 = 2', (string) $this->_expr->orx((string) $this->_expr->eq(1, 1), (string) $this->_expr->eq(2, 2))); - } - - public function testAbsExpr() - { - $this->assertEquals('ABS(1)', (string) $this->_expr->abs(1)); - } - - public function testProdExpr() - { - $this->assertEquals('1 * 2', (string) $this->_expr->prod(1, 2)); - } - - public function testDiffExpr() - { - $this->assertEquals('1 - 2', (string) $this->_expr->diff(1, 2)); - } - - public function testSumExpr() - { - $this->assertEquals('1 + 2', (string) $this->_expr->sum(1, 2)); - } - - public function testQuotientExpr() - { - $this->assertEquals('10 / 2', (string) $this->_expr->quot(10, 2)); - } - - public function testScopeInArithmeticExpr() - { - $this->assertEquals('(100 - 20) / 2', (string) $this->_expr->quot($this->_expr->diff(100, 20), 2)); - $this->assertEquals('100 - (20 / 2)', (string) $this->_expr->diff(100, $this->_expr->quot(20, 2))); - } - - public function testSquareRootExpr() - { - $this->assertEquals('SQRT(1)', (string) $this->_expr->sqrt(1)); - } - - public function testEqualExpr() - { - $this->assertEquals('1 = 1', (string) $this->_expr->eq(1, 1)); - } - - public function testLikeExpr() - { - $this->assertEquals('a.description LIKE :description', (string) $this->_expr->like('a.description', ':description')); - } - - public function testConcatExpr() - { - $this->assertEquals('CONCAT(u.first_name, u.last_name)', (string) $this->_expr->concat('u.first_name', 'u.last_name')); - } - - public function testSubstringExpr() - { - $this->assertEquals('SUBSTRING(a.title, 0, 25)', (string) $this->_expr->substring('a.title', 0, 25)); - } - - /** - * @group regression - * @group DDC-612 - */ - public function testSubstringExprAcceptsTwoArguments() - { - $this->assertEquals('SUBSTRING(a.title, 5)', (string) $this->_expr->substring('a.title', 5)); - } - - public function testLowerExpr() - { - $this->assertEquals('LOWER(u.first_name)', (string) $this->_expr->lower('u.first_name')); - } - - public function testUpperExpr() - { - $this->assertEquals('UPPER(u.first_name)', (string) $this->_expr->upper('u.first_name')); - } - - public function testLengthExpr() - { - $this->assertEquals('LENGTH(u.first_name)', (string) $this->_expr->length('u.first_name')); - } - - public function testGreaterThanExpr() - { - $this->assertEquals('5 > 2', (string) $this->_expr->gt(5, 2)); - } - - public function testLessThanExpr() - { - $this->assertEquals('2 < 5', (string) $this->_expr->lt(2, 5)); - } - - public function testStringLiteralExpr() - { - $this->assertEquals("'word'", (string) $this->_expr->literal('word')); - } - - public function testNumericLiteralExpr() - { - $this->assertEquals(5, (string) $this->_expr->literal(5)); - } - - /** - * @group regression - * @group DDC-610 - */ - public function testLiteralExprProperlyQuotesStrings() - { - $this->assertEquals("'00010001'", (string) $this->_expr->literal('00010001')); - } - - public function testGreaterThanOrEqualToExpr() - { - $this->assertEquals('5 >= 2', (string) $this->_expr->gte(5, 2)); - } - - public function testLessThanOrEqualTo() - { - $this->assertEquals('2 <= 5', (string) $this->_expr->lte(2, 5)); - } - - public function testBetweenExpr() - { - $this->assertEquals('u.id BETWEEN 3 AND 6', (string) $this->_expr->between('u.id', 3, 6)); - } - - public function testTrimExpr() - { - $this->assertEquals('TRIM(u.id)', (string) $this->_expr->trim('u.id')); - } - - public function testIsNullExpr() - { - $this->assertEquals('u.id IS NULL', (string) $this->_expr->isNull('u.id')); - } - - public function testIsNotNullExpr() - { - $this->assertEquals('u.id IS NOT NULL', (string) $this->_expr->isNotNull('u.id')); - } - - public function testInExpr() - { - $this->assertEquals('u.id IN(1, 2, 3)', (string) $this->_expr->in('u.id', array(1, 2, 3))); - } - - public function testInLiteralExpr() - { - $this->assertEquals("u.type IN('foo', 'bar')", (string) $this->_expr->in('u.type', array('foo', 'bar'))); - } - - public function testNotInExpr() - { - $this->assertEquals('u.id NOT IN(1, 2, 3)', (string) $this->_expr->notIn('u.id', array(1, 2, 3))); - } - - public function testNotInLiteralExpr() - { - $this->assertEquals("u.type NOT IN('foo', 'bar')", (string) $this->_expr->notIn('u.type', array('foo', 'bar'))); - } - - public function testAndxOrxExpr() - { - $andExpr = $this->_expr->andx(); - $andExpr->add($this->_expr->eq(1, 1)); - $andExpr->add($this->_expr->lt(1, 5)); - - $orExpr = $this->_expr->orx(); - $orExpr->add($andExpr); - $orExpr->add($this->_expr->eq(1, 1)); - - $this->assertEquals('(1 = 1 AND 1 < 5) OR 1 = 1', (string) $orExpr); - } - - public function testOrxExpr() - { - $orExpr = $this->_expr->orx(); - $orExpr->add($this->_expr->eq(1, 1)); - $orExpr->add($this->_expr->lt(1, 5)); - - $this->assertEquals('1 = 1 OR 1 < 5', (string) $orExpr); - } - - public function testOrderByCountExpr() - { - $orderExpr = $this->_expr->desc('u.username'); - - $this->assertEquals($orderExpr->count(), 1); - $this->assertEquals('u.username DESC', (string) $orderExpr); - } - - public function testOrderByOrder() - { - $orderExpr = $this->_expr->desc('u.username'); - $this->assertEquals('u.username DESC', (string) $orderExpr); - } - - public function testOrderByAsc() - { - $orderExpr = $this->_expr->asc('u.username'); - $this->assertEquals('u.username ASC', (string) $orderExpr); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testAddThrowsException() - { - $orExpr = $this->_expr->orx(); - $orExpr->add($this->_expr->quot(5, 2)); - } - - /** - * @group DDC-1683 - */ - public function testBooleanLiteral() - { - $this->assertEquals('true', $this->_expr->literal(true)); - $this->assertEquals('false', $this->_expr->literal(false)); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php deleted file mode 100644 index 2305287..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php +++ /dev/null @@ -1,601 +0,0 @@ -_em = $this->_getTestEntityManager(); - } - - public function assertValidDQL($dql, $debug = false) - { - try { - $parserResult = $this->parseDql($dql); - } catch (QueryException $e) { - if ($debug) { - echo $e->getTraceAsString() . PHP_EOL; - } - - $this->fail($e->getMessage()); - } - } - - public function assertInvalidDQL($dql, $debug = false) - { - try { - $parserResult = $this->parseDql($dql); - - $this->fail('No syntax errors were detected, when syntax errors were expected'); - } catch (QueryException $e) { - if ($debug) { - echo $e->getMessage() . PHP_EOL; - echo $e->getTraceAsString() . PHP_EOL; - } - } - } - - public function parseDql($dql, $hints = array()) - { - $query = $this->_em->createQuery($dql); - $query->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true); - $query->setDql($dql); - - foreach ($hints as $key => $value) { - $query->setHint($key, $value); - } - - $parser = new \Doctrine\ORM\Query\Parser($query); - - // We do NOT test SQL output here. That only unnecessarily slows down the tests! - $parser->setCustomOutputTreeWalker('Doctrine\Tests\Mocks\MockTreeWalker'); - - return $parser->parse(); - } - - public function testEmptyQueryString() - { - $this->assertInvalidDQL(''); - } - - public function testPlainFromClauseWithAlias() - { - $this->assertValidDQL('SELECT u.id FROM Doctrine\Tests\Models\CMS\CmsUser u'); - } - - public function testSelectSingleComponentWithAsterisk() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u'); - } - - public function testSelectSingleComponentWithMultipleColumns() - { - $this->assertValidDQL('SELECT u.name, u.username FROM Doctrine\Tests\Models\CMS\CmsUser u'); - } - - public function testSelectMultipleComponentsUsingMultipleFrom() - { - $this->assertValidDQL('SELECT u, p FROM Doctrine\Tests\Models\CMS\CmsUser u, Doctrine\Tests\Models\CMS\CmsPhonenumber p WHERE u = p.user'); - } - - public function testSelectMultipleComponentsWithAsterisk() - { - $this->assertValidDQL('SELECT u, p FROM Doctrine\Tests\Models\CMS\CmsUser u JOIN u.phonenumbers p'); - } - - public function testSelectDistinctIsSupported() - { - $this->assertValidDQL('SELECT DISTINCT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u'); - } - - public function testAggregateFunctionInSelect() - { - $this->assertValidDQL('SELECT COUNT(u.id) FROM Doctrine\Tests\Models\CMS\CmsUser u'); - } - - public function testDuplicatedAliasInAggregateFunction() - { - $this->assertInvalidDQL('SELECT COUNT(u.id) AS num, SUM(u.id) AS num FROM Doctrine\Tests\Models\CMS\CmsUser u'); - } - - public function testAggregateFunctionWithDistinctInSelect() - { - $this->assertValidDQL('SELECT COUNT(DISTINCT u.name) FROM Doctrine\Tests\Models\CMS\CmsUser u'); - } - - public function testFunctionalExpressionsSupportedInWherePart() - { - $this->assertValidDQL("SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE TRIM(u.name) = 'someone'"); - } - - public function testArithmeticExpressionsSupportedInWherePart() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE ((u.id + 5000) * u.id + 3) < 10000000'); - } - - public function testInExpressionSupportedInWherePart() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id IN (1, 2)'); - } - - public function testInExpressionWithoutSpacesSupportedInWherePart() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id IN (1,2,3)'); - } - - public function testNotInExpressionSupportedInWherePart() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id NOT IN (1)'); - } - - public function testInExpressionWithSingleValuedAssociationPathExpression() - { - $this->assertValidDQL("SELECT u FROM Doctrine\Tests\Models\Forum\ForumUser u WHERE u.avatar IN (?1, ?2)"); - } - - public function testInvalidInExpressionWithCollectionValuedAssociationPathExpression() - { - $this->assertInvalidDQL("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.phonenumbers IN (?1, ?2)"); - } - - public function testInstanceOfExpressionSupportedInWherePart() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\Company\CompanyPerson u WHERE u INSTANCE OF Doctrine\Tests\Models\Company\CompanyEmployee'); - } - - public function testInstanceOfExpressionWithInputParamSupportedInWherePart() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\Company\CompanyPerson u WHERE u INSTANCE OF ?1'); - } - - public function testNotInstanceOfExpressionSupportedInWherePart() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\Company\CompanyPerson u WHERE u NOT INSTANCE OF ?1'); - } - - public function testExistsExpressionSupportedInWherePart() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE EXISTS (SELECT p.phonenumber FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p WHERE p.phonenumber = 1234)'); - } - - public function testNotExistsExpressionSupportedInWherePart() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE NOT EXISTS (SELECT p.phonenumber FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p WHERE p.phonenumber = 1234)'); - } - - public function testAggregateFunctionInHavingClause() - { - $this->assertValidDQL('SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.phonenumbers p HAVING COUNT(p.phonenumber) > 2'); - $this->assertValidDQL("SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.phonenumbers p HAVING MAX(u.name) = 'romanb'"); - } - - public function testLeftJoin() - { - $this->assertValidDQL('SELECT u, p FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.phonenumbers p'); - } - - public function testJoin() - { - $this->assertValidDQL('SELECT u,p FROM Doctrine\Tests\Models\CMS\CmsUser u JOIN u.phonenumbers p'); - } - - public function testInnerJoin() - { - $this->assertValidDQL('SELECT u, p FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.phonenumbers p'); - } - - public function testMultipleLeftJoin() - { - $this->assertValidDQL('SELECT u, a, p FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.articles a LEFT JOIN u.phonenumbers p'); - } - - public function testMultipleInnerJoin() - { - $this->assertValidDQL('SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.articles a INNER JOIN u.phonenumbers p'); - } - - public function testMixingOfJoins() - { - $this->assertValidDQL('SELECT u.name, a.topic, p.phonenumber FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.articles a LEFT JOIN u.phonenumbers p'); - } - - public function testOrderBySingleColumn() - { - $this->assertValidDQL('SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u ORDER BY u.name'); - } - - public function testOrderBySingleColumnAscending() - { - $this->assertValidDQL('SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u ORDER BY u.name ASC'); - } - - public function testOrderBySingleColumnDescending() - { - $this->assertValidDQL('SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u ORDER BY u.name DESC'); - } - - public function testOrderByMultipleColumns() - { - $this->assertValidDQL('SELECT u.name, u.username FROM Doctrine\Tests\Models\CMS\CmsUser u ORDER BY u.username DESC, u.name DESC'); - } - - public function testSubselectInInExpression() - { - $this->assertValidDQL("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id NOT IN (SELECT u2.id FROM Doctrine\Tests\Models\CMS\CmsUser u2 WHERE u2.name = 'zYne')"); - } - - public function testSubselectInSelectPart() - { - $this->assertValidDQL("SELECT u.name, (SELECT COUNT(p.phonenumber) FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p WHERE p.phonenumber = 1234) pcount FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name = 'jon'"); - } - - public function testArithmeticExpressionInSelectPart() - { - $this->assertValidDQL("SELECT SUM(u.id) / COUNT(u.id) FROM Doctrine\Tests\Models\CMS\CmsUser u"); - } - - public function testArithmeticExpressionInSubselectPart() - { - $this->assertValidDQL("SELECT (SELECT SUM(u.id) / COUNT(u.id) FROM Doctrine\Tests\Models\CMS\CmsUser u2) value FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name = 'jon'"); - } - - public function testArithmeticExpressionWithParenthesisInSubselectPart() - { - $this->assertValidDQL("SELECT (SELECT (SUM(u.id) / COUNT(u.id)) FROM Doctrine\Tests\Models\CMS\CmsUser u2) value FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name = 'jon'"); - } - - /** - * @group DDC-1079 - */ - public function testSelectLiteralInSubselect() - { - $this->assertValidDQL('SELECT (SELECT 1 FROM Doctrine\Tests\Models\CMS\CmsUser u2) value FROM Doctrine\Tests\Models\CMS\CmsUser u'); - $this->assertValidDQL('SELECT (SELECT 0 FROM Doctrine\Tests\Models\CMS\CmsUser u2) value FROM Doctrine\Tests\Models\CMS\CmsUser u'); - } - - /** - * @group DDC-1077 - */ - public function testConstantValueInSelect() - { - $this->assertValidDQL("SELECT u.name, 'foo' AS bar FROM Doctrine\Tests\Models\CMS\CmsUser u", true); - } - - public function testDuplicateAliasInSubselectPart() - { - $this->assertInvalidDQL("SELECT (SELECT SUM(u.id) / COUNT(u.id) AS foo FROM Doctrine\Tests\Models\CMS\CmsUser u2) foo FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name = 'jon'"); - } - - public function testPositionalInputParameter() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = ?1'); - } - - public function testNamedInputParameter() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :id'); - } - - public function testJoinConditionOverrideNotSupported() - { - $this->assertInvalidDQL("SELECT u.name, p FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.phonenumbers p ON p.phonenumber = '123 123'"); - } - - public function testIndexByClauseWithOneComponent() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u INDEX BY u.id'); - } - - public function testIndexBySupportsJoins() - { - $this->assertValidDQL('SELECT u, a FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.articles a INDEX BY a.id'); // INDEX BY is now referring to articles - } - - public function testIndexBySupportsJoins2() - { - $this->assertValidDQL('SELECT u, p FROM Doctrine\Tests\Models\CMS\CmsUser u INDEX BY u.id LEFT JOIN u.phonenumbers p INDEX BY p.phonenumber'); - } - - public function testBetweenExpressionSupported() - { - $this->assertValidDQL("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name BETWEEN 'jepso' AND 'zYne'"); - } - - public function testNotBetweenExpressionSupported() - { - $this->assertValidDQL("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name NOT BETWEEN 'jepso' AND 'zYne'"); - } - - public function testLikeExpression() - { - $this->assertValidDQL("SELECT u.id FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name LIKE 'z%'"); - } - - public function testNotLikeExpression() - { - $this->assertValidDQL("SELECT u.id FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name NOT LIKE 'z%'"); - } - - public function testLikeExpressionWithCustomEscapeCharacter() - { - $this->assertValidDQL("SELECT u.id FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name LIKE 'z|%' ESCAPE '|'"); - } - - public function testFieldComparisonWithoutAlias() - { - $this->assertInvalidDQL("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE id = 1"); - } - - public function testDuplicatedAliasDeclaration() - { - $this->assertInvalidDQL("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.articles u WHERE u.id = 1"); - } - - public function testImplicitJoinInWhereOnSingleValuedAssociationPathExpression() - { - // This should be allowed because avatar is a single-value association. - // SQL: SELECT ... FROM forum_user fu INNER JOIN forum_avatar fa ON fu.avatar_id = fa.id WHERE fa.id = ? - $this->assertValidDQL("SELECT u FROM Doctrine\Tests\Models\Forum\ForumUser u JOIN u.avatar a WHERE a.id = ?1"); - } - - public function testImplicitJoinInWhereOnCollectionValuedPathExpression() - { - // This should be forbidden, because articles is a collection - $this->assertInvalidDQL("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u JOIN u.articles a WHERE a.title = ?"); - } - - public function testInvalidSyntaxIsRejected() - { - $this->assertInvalidDQL("FOOBAR CmsUser"); - $this->assertInvalidDQL("DELETE FROM Doctrine\Tests\Models\CMS\CmsUser.articles"); - $this->assertInvalidDQL("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u JOIN u.articles.comments"); - - // Currently UNDEFINED OFFSET error - $this->assertInvalidDQL("SELECT c FROM CmsUser.articles.comments c"); - } - - public function testUpdateWorksWithOneField() - { - $this->assertValidDQL("UPDATE Doctrine\Tests\Models\CMS\CmsUser u SET u.name = 'someone'"); - } - - public function testUpdateWorksWithMultipleFields() - { - $this->assertValidDQL("UPDATE Doctrine\Tests\Models\CMS\CmsUser u SET u.name = 'someone', u.username = 'some'"); - } - - public function testUpdateSupportsConditions() - { - $this->assertValidDQL("UPDATE Doctrine\Tests\Models\CMS\CmsUser u SET u.name = 'someone' WHERE u.id = 5"); - } - - public function testDeleteAll() - { - $this->assertValidDQL('DELETE FROM Doctrine\Tests\Models\CMS\CmsUser u'); - } - - public function testDeleteWithCondition() - { - $this->assertValidDQL('DELETE FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = 3'); - } - - /** - * The main use case for this generalized style of join is when a join condition - * does not involve a foreign key relationship that is mapped to an entity relationship. - */ - public function testImplicitJoinWithCartesianProductAndConditionInWhere() - { - $this->assertValidDQL("SELECT u, a FROM Doctrine\Tests\Models\CMS\CmsUser u, Doctrine\Tests\Models\CMS\CmsArticle a WHERE u.name = a.topic"); - } - - public function testAllExpressionWithCorrelatedSubquery() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id > ALL (SELECT u2.id FROM Doctrine\Tests\Models\CMS\CmsUser u2 WHERE u2.name = u.name)'); - } - - public function testCustomJoinsAndWithKeywordSupported() - { - $this->assertValidDQL('SELECT u, p FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.phonenumbers p WITH p.phonenumber = 123 WHERE u.id = 1'); - } - - public function testAnyExpressionWithCorrelatedSubquery() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id > ANY (SELECT u2.id FROM Doctrine\Tests\Models\CMS\CmsUser u2 WHERE u2.name = u.name)'); - } - - public function testSomeExpressionWithCorrelatedSubquery() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id > SOME (SELECT u2.id FROM Doctrine\Tests\Models\CMS\CmsUser u2 WHERE u2.name = u.name)'); - } - - public function testArithmeticExpressionWithoutParenthesisInWhereClause() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE SIZE(u.phonenumbers) + 1 > 10'); - } - - public function testMemberOfExpression() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE :param MEMBER OF u.phonenumbers'); - //$this->assertValidDQL("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE 'Joe' MEMBER OF u.nicknames"); - } - - public function testSizeFunction() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE SIZE(u.phonenumbers) > 1'); - } - - public function testEmptyCollectionComparisonExpression() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.phonenumbers IS EMPTY'); - } - - public function testSingleValuedAssociationFieldInWhere() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.address = ?1'); - $this->assertValidDQL('SELECT p FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p WHERE p.user = ?1'); - } - - public function testBooleanLiteralInWhere() - { - $this->assertValidDQL('SELECT b FROM Doctrine\Tests\Models\Generic\BooleanModel b WHERE b.booleanField = true'); - } - - public function testSubqueryInSelectExpression() - { - $this->assertValidDQL('select u, (select max(p.phonenumber) from Doctrine\Tests\Models\CMS\CmsPhonenumber p) maxId from Doctrine\Tests\Models\CMS\CmsUser u'); - } - - public function testUsageOfQComponentOutsideSubquery() - { - $this->assertInvalidDQL('select u, (select max(p.phonenumber) from Doctrine\Tests\Models\CMS\CmsPhonenumber p) maxId from Doctrine\Tests\Models\CMS\CmsUser u WHERE p.user = ?1'); - } - - public function testUnknownAbstractSchemaName() - { - $this->assertInvalidDQL('SELECT u FROM UnknownClassName u'); - } - - public function testCorrectPartialObjectLoad() - { - $this->assertValidDQL('SELECT PARTIAL u.{id,name} FROM Doctrine\Tests\Models\CMS\CmsUser u'); - } - - public function testIncorrectPartialObjectLoadBecauseOfMissingIdentifier() - { - $this->assertInvalidDQL('SELECT PARTIAL u.{name} FROM Doctrine\Tests\Models\CMS\CmsUser u'); - } - - public function testScalarExpressionInSelect() - { - $this->assertValidDQL('SELECT u, 42 + u.id AS someNumber FROM Doctrine\Tests\Models\CMS\CmsUser u'); - } - - public function testInputParameterInSelect() - { - $this->assertValidDQL('SELECT u, u.id + ?1 AS someNumber FROM Doctrine\Tests\Models\CMS\CmsUser u'); - } - - /** - * @group DDC-1091 - */ - public function testCustomFunctionsReturningStringInStringPrimary() - { - $this->_em->getConfiguration()->addCustomStringFunction('CC', 'Doctrine\ORM\Query\AST\Functions\ConcatFunction'); - - $this->assertValidDQL("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE CC('%', u.name) LIKE '%foo%'", true); - } - - /** - * @group DDC-505 - */ - public function testDQLKeywordInJoinIsAllowed() - { - $this->assertValidDQL('SELECT u FROM ' . __NAMESPACE__ . '\DQLKeywordsModelUser u JOIN u.group g'); - } - - /** - * @group DDC-505 - */ - public function testDQLKeywordInConditionIsAllowed() - { - $this->assertValidDQL('SELECT g FROM ' . __NAMESPACE__ . '\DQLKeywordsModelGroup g WHERE g.from=0'); - } - - /* The exception is currently thrown in the SQLWalker, not earlier. - public function testInverseSideSingleValuedAssociationPathNotAllowed() - { - $this->assertInvalidDQL('SELECT u.id FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.address = ?1'); - } - */ - - /** - * @group DDC-617 - */ - public function testSelectOnlyNonRootEntityAlias() - { - $this->assertInvalidDQL('SELECT g FROM Doctrine\Tests\Models\CMS\CmsUser u JOIN u.groups g'); - } - - /** - * @group DDC-1108 - */ - public function testInputParameterSingleChar() - { - $this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name = :q'); - } - - /** - * @group DDC-1053 - */ - public function testGroupBy() - { - $this->assertValidDQL('SELECT g.id, count(u.id) FROM Doctrine\Tests\Models\CMS\CmsGroup g JOIN g.users u GROUP BY g.id'); - } - - /** - * @group DDC-1053 - */ - public function testGroupByIdentificationVariable() - { - $this->assertValidDQL('SELECT g, count(u.id) FROM Doctrine\Tests\Models\CMS\CmsGroup g JOIN g.users u GROUP BY g'); - } - - /** - * @group DDC-1053 - */ - public function testGroupByUnknownIdentificationVariable() - { - $this->assertInvalidDQL('SELECT g, count(u.id) FROM Doctrine\Tests\Models\CMS\CmsGroup g JOIN g.users u GROUP BY m'); - } - - /** - * @group DDC-117 - */ - public function testSizeOfForeignKeyOneToManyPrimaryKeyEntity() - { - $this->assertValidDQL("SELECT a, t FROM Doctrine\Tests\Models\DDC117\DDC117Article a JOIN a.translations t WHERE SIZE(a.translations) > 0"); - } - - /** - * @group DDC-117 - */ - public function testSizeOfForeignKeyManyToManyPrimaryKeyEntity() - { - $this->assertValidDQL("SELECT e, t FROM Doctrine\Tests\Models\DDC117\DDC117Editor e JOIN e.reviewingTranslations t WHERE SIZE(e.reviewingTranslations) > 0"); - } - - public function testCaseSupportContainingNullIfExpression() - { - $this->assertValidDQL("SELECT u.id, NULLIF(u.name, u.name) AS shouldBeNull FROM Doctrine\Tests\Models\CMS\CmsUser u"); - } - - public function testCaseSupportContainingCoalesceExpression() - { - $this->assertValidDQL("select COALESCE(NULLIF(u.name, ''), u.username) as Display FROM Doctrine\Tests\Models\CMS\CmsUser u"); - } -} - -/** @Entity */ -class DQLKeywordsModelUser -{ - /** @Id @Column(type="integer") @GeneratedValue */ - private $id; - /** @OneToOne(targetEntity="DQLKeywordsModelGroup") */ - private $group; -} - -/** @Entity */ -class DQLKeywordsModelGroup -{ - /** @Id @Column(type="integer") @GeneratedValue */ - private $id; - /** @Column */ - private $from; -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/LexerTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/LexerTest.php deleted file mode 100644 index 29bba4b..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/LexerTest.php +++ /dev/null @@ -1,234 +0,0 @@ -moveNext(); - $token = $lexer->lookahead; - - $this->assertEquals(Lexer::T_IDENTIFIER, $token['type']); - $this->assertEquals('u', $token['value']); - } - - public function testScannerRecognizesIdentifierConsistingOfLetters() - { - $lexer = new Lexer('someIdentifier'); - - $lexer->moveNext(); - $token = $lexer->lookahead; - $this->assertEquals(Lexer::T_IDENTIFIER, $token['type']); - $this->assertEquals('someIdentifier', $token['value']); - } - - public function testScannerRecognizesIdentifierIncludingDigits() - { - $lexer = new Lexer('s0m31d3nt1f13r'); - - $lexer->moveNext(); - $token = $lexer->lookahead; - $this->assertEquals(Lexer::T_IDENTIFIER, $token['type']); - $this->assertEquals('s0m31d3nt1f13r', $token['value']); - } - - public function testScannerRecognizesIdentifierIncludingUnderscore() - { - $lexer = new Lexer('some_identifier'); - $lexer->moveNext(); - $token = $lexer->lookahead; - $this->assertEquals(Lexer::T_IDENTIFIER, $token['type']); - $this->assertEquals('some_identifier', $token['value']); - } - - public function testScannerRecognizesDecimalInteger() - { - $lexer = new Lexer('1234'); - $lexer->moveNext(); - $token = $lexer->lookahead; - $this->assertEquals(Lexer::T_INTEGER, $token['type']); - $this->assertEquals(1234, $token['value']); - } - - public function testScannerRecognizesFloat() - { - $lexer = new Lexer('1.234'); - $lexer->moveNext(); - $token = $lexer->lookahead; - $this->assertEquals(Lexer::T_FLOAT, $token['type']); - $this->assertEquals(1.234, $token['value']); - } - - public function testScannerRecognizesFloatWithExponent() - { - $lexer = new Lexer('1.2e3'); - $lexer->moveNext(); - $token = $lexer->lookahead; - $this->assertEquals(Lexer::T_FLOAT, $token['type']); - $this->assertEquals(1.2e3, $token['value']); - } - - public function testScannerRecognizesFloatWithExponent2() - { - $lexer = new Lexer('0.2e3'); - $lexer->moveNext(); - $token = $lexer->lookahead; - $this->assertEquals(Lexer::T_FLOAT, $token['type']); - $this->assertEquals(.2e3, $token['value']); - } - - public function testScannerRecognizesFloatWithNegativeExponent() - { - $lexer = new Lexer('7E-10'); - $lexer->moveNext(); - $token = $lexer->lookahead; - $this->assertEquals(Lexer::T_FLOAT, $token['type']); - $this->assertEquals(7E-10, $token['value']); - } - - public function testScannerRecognizesFloatBig() - { - $lexer = new Lexer('123456789.01'); - $lexer->moveNext(); - $token = $lexer->lookahead; - $this->assertEquals(Lexer::T_FLOAT, $token['type']); - $this->assertEquals(1.2345678901e8, $token['value']); - } - - public function testScannerRecognizesFloatContainingWhitespace() - { - $lexer = new Lexer('- 1.234e2'); - $lexer->moveNext(); - $token = $lexer->lookahead; - $this->assertEquals(Lexer::T_MINUS, $token['type']); - $this->assertEquals('-', $token['value']); - - $lexer->moveNext(); - $token = $lexer->lookahead; - $this->assertEquals(Lexer::T_FLOAT, $token['type']); - $this->assertNotEquals(-1.234e2, $token['value']); - $this->assertEquals(1.234e2, $token['value']); - } - - public function testScannerRecognizesStringContainingWhitespace() - { - $lexer = new Lexer("'This is a string.'"); - $lexer->moveNext(); - $token = $lexer->lookahead; - $this->assertEquals(Lexer::T_STRING, $token['type']); - $this->assertEquals("This is a string.", $token['value']); - } - - public function testScannerRecognizesStringContainingSingleQuotes() - { - $lexer = new Lexer("'abc''defg'''"); - $lexer->moveNext(); - $token = $lexer->lookahead; - $this->assertEquals(Lexer::T_STRING, $token['type']); - $this->assertEquals("abc'defg'", $token['value']); - } - - public function testScannerRecognizesInputParameter() - { - $lexer = new Lexer('?1'); - $lexer->moveNext(); - $token = $lexer->lookahead; - $this->assertEquals(Lexer::T_INPUT_PARAMETER, $token['type']); - $this->assertEquals('?1', $token['value']); - } - - public function testScannerRecognizesNamedInputParameter() - { - $lexer = new Lexer(':name'); - $lexer->moveNext(); - $token = $lexer->lookahead; - $this->assertEquals(Lexer::T_INPUT_PARAMETER, $token['type']); - $this->assertEquals(':name', $token['value']); - } - - public function testScannerTokenizesASimpleQueryCorrectly() - { - $dql = "SELECT u FROM My\Namespace\User u WHERE u.name = 'Jack O''Neil'"; - $lexer = new Lexer($dql); - - $tokens = array( - array( - 'value' => 'SELECT', - 'type' => Lexer::T_SELECT, - 'position' => 0 - ), - array( - 'value' => 'u', - 'type' => Lexer::T_IDENTIFIER, - 'position' => 7 - ), - array( - 'value' => 'FROM', - 'type' => Lexer::T_FROM, - 'position' => 9 - ), - array( - 'value' => 'My\Namespace\User', - 'type' => Lexer::T_IDENTIFIER, - 'position' => 14 - ), - array( - 'value' => 'u', - 'type' => Lexer::T_IDENTIFIER, - 'position' => 32 - ), - array( - 'value' => 'WHERE', - 'type' => Lexer::T_WHERE, - 'position' => 34 - ), - array( - 'value' => 'u', - 'type' => Lexer::T_IDENTIFIER, - 'position' => 40 - ), - array( - 'value' => '.', - 'type' => Lexer::T_DOT, - 'position' => 41 - ), - array( - 'value' => 'name', - 'type' => Lexer::T_IDENTIFIER, - 'position' => 42 - ), - array( - 'value' => '=', - 'type' => Lexer::T_EQUALS, - 'position' => 47 - ), - array( - 'value' => "Jack O'Neil", - 'type' => Lexer::T_STRING, - 'position' => 49 - ) - ); - - foreach ($tokens as $expected) { - $lexer->moveNext(); - $actual = $lexer->lookahead; - $this->assertEquals($expected['value'], $actual['value']); - $this->assertEquals($expected['type'], $actual['type']); - $this->assertEquals($expected['position'], $actual['position']); - } - - $this->assertFalse($lexer->moveNext()); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/ParserResultTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/ParserResultTest.php deleted file mode 100644 index 64f3afb..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/ParserResultTest.php +++ /dev/null @@ -1,48 +0,0 @@ -parserResult = new ParserResult(); - } - - public function testGetRsm() - { - $this->assertInstanceOf( - 'Doctrine\ORM\Query\ResultSetMapping', - $this->parserResult->getResultSetMapping() - ); - } - - public function testSetGetSqlExecutor() - { - $this->assertNull($this->parserResult->getSqlExecutor()); - - $executor = $this->getMock('Doctrine\ORM\Query\Exec\AbstractSqlExecutor', array('execute')); - $this->parserResult->setSqlExecutor($executor); - $this->assertSame($executor, $this->parserResult->getSqlExecutor()); - } - - public function testGetSqlParameterPosition() - { - $this->parserResult->addParameterMapping(1, 1); - $this->parserResult->addParameterMapping(1, 2); - $this->assertEquals(array(1, 2), $this->parserResult->getSqlParameterPositions(1)); - } - - public function testGetParameterMappings() - { - $this->assertInternalType('array', $this->parserResult->getParameterMappings()); - - $this->parserResult->addParameterMapping(1, 1); - $this->parserResult->addParameterMapping(1, 2); - $this->assertEquals(array(1 => array(1, 2)), $this->parserResult->getParameterMappings()); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/QueryTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/QueryTest.php deleted file mode 100644 index f975af3..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/QueryTest.php +++ /dev/null @@ -1,128 +0,0 @@ -_em = $this->_getTestEntityManager(); - } - - public function testGetParameters() - { - $query = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u where u.username = ?1"); - $this->assertEquals(array(), $query->getParameters()); - } - - public function testGetParameters_HasSomeAlready() - { - $query = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u where u.username = ?1"); - $query->setParameter(2, 84); - $this->assertEquals(array(2 => 84), $query->getParameters()); - } - - public function testSetParameters() - { - $query = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u where u.username = ?1"); - $query->setParameters(array(1 => 'foo', 2 => 'bar')); - $this->assertEquals(array(1 => 'foo', 2 => 'bar'), $query->getParameters()); - } - - public function testFree() - { - $query = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u where u.username = ?1"); - $query->setParameter(2, 84, \PDO::PARAM_INT); - - $query->free(); - - $this->assertEquals(array(), $query->getParameters()); - } - - public function testClone() - { - $dql = "select u from Doctrine\Tests\Models\CMS\CmsUser u where u.username = ?1"; - - $query = $this->_em->createQuery($dql); - $query->setParameter(2, 84, \PDO::PARAM_INT); - $query->setHint('foo', 'bar'); - - $cloned = clone $query; - - $this->assertEquals($dql, $cloned->getDql()); - $this->assertEquals(array(), $cloned->getParameters()); - $this->assertFalse($cloned->getHint('foo')); - } - - public function testFluentQueryInterface() - { - $q = $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a"); - $q2 = $q->expireQueryCache(true) - ->setQueryCacheLifetime(3600) - ->setQueryCacheDriver(null) - ->expireResultCache(true) - ->setHint('foo', 'bar') - ->setHint('bar', 'baz') - ->setParameter(1, 'bar') - ->setParameters(array(2 => 'baz')) - ->setResultCacheDriver(null) - ->setResultCacheId('foo') - ->setDql('foo') - ->setFirstResult(10) - ->setMaxResults(10); - - $this->assertSame($q2, $q); - } - - /** - * @group DDC-968 - */ - public function testHints() - { - $q = $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a"); - $q->setHint('foo', 'bar')->setHint('bar', 'baz'); - - $this->assertEquals('bar', $q->getHint('foo')); - $this->assertEquals('baz', $q->getHint('bar')); - $this->assertEquals(array('foo' => 'bar', 'bar' => 'baz'), $q->getHints()); - } - - /** - * @group DDC-1588 - */ - public function testQueryDefaultResultCache() - { - $this->_em->getConfiguration()->setResultCacheImpl(new ArrayCache()); - $q = $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a"); - $q->useResultCache(true); - $this->assertSame($this->_em->getConfiguration()->getResultCacheImpl(), $q->getQueryCacheProfile()->getResultCacheDriver()); - } - - /** - * @expectedException Doctrine\ORM\Query\QueryException - **/ - public function testIterateWithNoDistinctAndWrongSelectClause() - { - $q = $this->_em->createQuery("select u, a from Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.articles a"); - $q->iterate(); - } - - /** - * @expectedException Doctrine\ORM\Query\QueryException - **/ - public function testIterateWithNoDistinctAndWithValidSelectClause() - { - $q = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.articles a"); - $q->iterate(); - } - - public function testIterateWithDistinct() - { - $q = $this->_em->createQuery("SELECT DISTINCT u from Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.articles a"); - $q->iterate(); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php deleted file mode 100644 index 3362ec9..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php +++ /dev/null @@ -1,1601 +0,0 @@ -_em = $this->_getTestEntityManager(); - } - - /** - * Assert a valid SQL generation. - * - * @param string $dqlToBeTested - * @param string $sqlToBeConfirmed - * @param array $queryHints - * @param array $queryParams - */ - public function assertSqlGeneration($dqlToBeTested, $sqlToBeConfirmed, array $queryHints = array(), array $queryParams = array()) - { - try { - $query = $this->_em->createQuery($dqlToBeTested); - - foreach ($queryParams AS $name => $value) { - $query->setParameter($name, $value); - } - - $query->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true) - ->useQueryCache(false); - - foreach ($queryHints AS $name => $value) { - $query->setHint($name, $value); - } - - $sqlGenerated = $query->getSQL(); - - parent::assertEquals( - $sqlToBeConfirmed, - $sqlGenerated, - sprintf('"%s" is not equal of "%s"', $sqlGenerated, $sqlToBeConfirmed) - ); - - $query->free(); - } catch (\Exception $e) { - $this->fail($e->getMessage() ."\n".$e->getTraceAsString()); - } - } - - /** - * Asser an invalid SQL generation. - * - * @param string $dqlToBeTested - * @param string $expectedException - * @param array $queryHints - * @param array $queryParams - */ - public function assertInvalidSqlGeneration($dqlToBeTested, $expectedException, array $queryHints = array(), array $queryParams = array()) - { - $this->setExpectedException($expectedException); - - $query = $this->_em->createQuery($dqlToBeTested); - - foreach ($queryParams AS $name => $value) { - $query->setParameter($name, $value); - } - - $query->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true) - ->useQueryCache(false); - - foreach ($queryHints AS $name => $value) { - $query->setHint($name, $value); - } - - $sql = $query->getSql(); - $query->free(); - - // If we reached here, test failed - $this->fail($sql); - } - - - public function testSupportsSelectForAllFields() - { - $this->assertSqlGeneration( - 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u', - 'SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_' - ); - } - - public function testSupportsSelectForOneField() - { - $this->assertSqlGeneration( - 'SELECT u.id FROM Doctrine\Tests\Models\CMS\CmsUser u', - 'SELECT c0_.id AS id0 FROM cms_users c0_' - ); - } - - public function testSupportsSelectForOneNestedField() - { - $this->assertSqlGeneration( - 'SELECT u.id FROM Doctrine\Tests\Models\CMS\CmsArticle a JOIN a.user u', - 'SELECT c0_.id AS id0 FROM cms_articles c1_ INNER JOIN cms_users c0_ ON c1_.user_id = c0_.id' - ); - } - - public function testSupportsSelectForAllNestedField() - { - $this->assertSqlGeneration( - 'SELECT a FROM Doctrine\Tests\Models\CMS\CmsArticle a JOIN a.user u ORDER BY u.name ASC', - 'SELECT c0_.id AS id0, c0_.topic AS topic1, c0_.text AS text2, c0_.version AS version3 FROM cms_articles c0_ INNER JOIN cms_users c1_ ON c0_.user_id = c1_.id ORDER BY c1_.name ASC' - ); - } - - public function testSupportsSelectForMultipleColumnsOfASingleComponent() - { - $this->assertSqlGeneration( - 'SELECT u.username, u.name FROM Doctrine\Tests\Models\CMS\CmsUser u', - 'SELECT c0_.username AS username0, c0_.name AS name1 FROM cms_users c0_' - ); - } - - public function testSupportsSelectUsingMultipleFromComponents() - { - $this->assertSqlGeneration( - 'SELECT u, p FROM Doctrine\Tests\Models\CMS\CmsUser u, Doctrine\Tests\Models\CMS\CmsPhonenumber p WHERE u = p.user', - 'SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3, c1_.phonenumber AS phonenumber4 FROM cms_users c0_, cms_phonenumbers c1_ WHERE c0_.id = c1_.user_id' - ); - } - - public function testSupportsSelectWithCollectionAssociationJoin() - { - $this->assertSqlGeneration( - 'SELECT u, p FROM Doctrine\Tests\Models\CMS\CmsUser u JOIN u.phonenumbers p', - 'SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3, c1_.phonenumber AS phonenumber4 FROM cms_users c0_ INNER JOIN cms_phonenumbers c1_ ON c0_.id = c1_.user_id' - ); - } - - public function testSupportsSelectWithSingleValuedAssociationJoin() - { - $this->assertSqlGeneration( - 'SELECT u, a FROM Doctrine\Tests\Models\Forum\ForumUser u JOIN u.avatar a', - 'SELECT f0_.id AS id0, f0_.username AS username1, f1_.id AS id2 FROM forum_users f0_ INNER JOIN forum_avatars f1_ ON f0_.avatar_id = f1_.id' - ); - } - - public function testSelectCorrelatedSubqueryComplexMathematicalExpression() - { - $this->assertSqlGeneration( - 'SELECT (SELECT (count(p.phonenumber)+5)*10 FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p JOIN p.user ui WHERE ui.id = u.id) AS c FROM Doctrine\Tests\Models\CMS\CmsUser u', - 'SELECT (SELECT (count(c0_.phonenumber) + 5) * 10 AS sclr1 FROM cms_phonenumbers c0_ INNER JOIN cms_users c1_ ON c0_.user_id = c1_.id WHERE c1_.id = c2_.id) AS sclr0 FROM cms_users c2_' - ); - } - - public function testSelectComplexMathematicalExpression() - { - $this->assertSqlGeneration( - 'SELECT (count(p.phonenumber)+5)*10 FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p JOIN p.user ui WHERE ui.id = ?1', - 'SELECT (count(c0_.phonenumber) + 5) * 10 AS sclr0 FROM cms_phonenumbers c0_ INNER JOIN cms_users c1_ ON c0_.user_id = c1_.id WHERE c1_.id = ?' - ); - } - - /* NOT (YET?) SUPPORTED. - Can be supported if SimpleSelectExpresion supports SingleValuedPathExpression instead of StateFieldPathExpression. - - public function testSingleAssociationPathExpressionInSubselect() - { - $this->assertSqlGeneration( - 'SELECT (SELECT p.user FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p WHERE p.user = u) user_id FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = ?1', - 'SELECT (SELECT c0_.user_id FROM cms_phonenumbers c0_ WHERE c0_.user_id = c1_.id) AS sclr0 FROM cms_users c1_ WHERE c1_.id = ?' - ); - }*/ - - /** - * @group DDC-1077 - */ - public function testConstantValueInSelect() - { - $this->assertSqlGeneration( - "SELECT u.name, 'foo' AS bar FROM Doctrine\Tests\Models\CMS\CmsUser u", - "SELECT c0_.name AS name0, 'foo' AS sclr1 FROM cms_users c0_" - ); - } - - public function testSupportsOrderByWithAscAsDefault() - { - $this->assertSqlGeneration( - 'SELECT u FROM Doctrine\Tests\Models\Forum\ForumUser u ORDER BY u.id', - 'SELECT f0_.id AS id0, f0_.username AS username1 FROM forum_users f0_ ORDER BY f0_.id ASC' - ); - } - - public function testSupportsOrderByAsc() - { - $this->assertSqlGeneration( - 'SELECT u FROM Doctrine\Tests\Models\Forum\ForumUser u ORDER BY u.id asc', - 'SELECT f0_.id AS id0, f0_.username AS username1 FROM forum_users f0_ ORDER BY f0_.id ASC' - ); - } - public function testSupportsOrderByDesc() - { - $this->assertSqlGeneration( - 'SELECT u FROM Doctrine\Tests\Models\Forum\ForumUser u ORDER BY u.id desc', - 'SELECT f0_.id AS id0, f0_.username AS username1 FROM forum_users f0_ ORDER BY f0_.id DESC' - ); - } - - public function testSupportsSelectDistinct() - { - $this->assertSqlGeneration( - 'SELECT DISTINCT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u', - 'SELECT DISTINCT c0_.name AS name0 FROM cms_users c0_' - ); - } - - public function testSupportsAggregateFunctionInSelectedFields() - { - $this->assertSqlGeneration( - 'SELECT COUNT(u.id) FROM Doctrine\Tests\Models\CMS\CmsUser u GROUP BY u.id', - 'SELECT COUNT(c0_.id) AS sclr0 FROM cms_users c0_ GROUP BY c0_.id' - ); - } - - public function testSupportsAggregateFunctionWithSimpleArithmetic() - { - $this->assertSqlGeneration( - 'SELECT MAX(u.id + 4) * 2 FROM Doctrine\Tests\Models\CMS\CmsUser u', - 'SELECT MAX(c0_.id + 4) * 2 AS sclr0 FROM cms_users c0_' - ); - } - - public function testSupportsWhereClauseWithPositionalParameter() - { - $this->assertSqlGeneration( - 'select u from Doctrine\Tests\Models\Forum\ForumUser u where u.id = ?1', - 'SELECT f0_.id AS id0, f0_.username AS username1 FROM forum_users f0_ WHERE f0_.id = ?' - ); - } - - public function testSupportsWhereClauseWithNamedParameter() - { - $this->assertSqlGeneration( - 'select u from Doctrine\Tests\Models\Forum\ForumUser u where u.username = :name', - 'SELECT f0_.id AS id0, f0_.username AS username1 FROM forum_users f0_ WHERE f0_.username = ?' - ); - } - - public function testSupportsWhereAndClauseWithNamedParameters() - { - $this->assertSqlGeneration( - 'select u from Doctrine\Tests\Models\Forum\ForumUser u where u.username = :name and u.username = :name2', - 'SELECT f0_.id AS id0, f0_.username AS username1 FROM forum_users f0_ WHERE f0_.username = ? AND f0_.username = ?' - ); - } - - public function testSupportsCombinedWhereClauseWithNamedParameter() - { - $this->assertSqlGeneration( - 'select u from Doctrine\Tests\Models\Forum\ForumUser u where (u.username = :name OR u.username = :name2) AND u.id = :id', - 'SELECT f0_.id AS id0, f0_.username AS username1 FROM forum_users f0_ WHERE (f0_.username = ? OR f0_.username = ?) AND f0_.id = ?' - ); - } - - public function testSupportsAggregateFunctionInASelectDistinct() - { - $this->assertSqlGeneration( - 'SELECT COUNT(DISTINCT u.name) FROM Doctrine\Tests\Models\CMS\CmsUser u', - 'SELECT COUNT(DISTINCT c0_.name) AS sclr0 FROM cms_users c0_' - ); - } - - // Ticket #668 - public function testSupportsASqlKeywordInAStringLiteralParam() - { - $this->assertSqlGeneration( - "SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name LIKE '%foo OR bar%'", - "SELECT c0_.name AS name0 FROM cms_users c0_ WHERE c0_.name LIKE '%foo OR bar%'" - ); - } - - public function testSupportsArithmeticExpressionsInWherePart() - { - $this->assertSqlGeneration( - 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE ((u.id + 5000) * u.id + 3) < 10000000', - 'SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ WHERE (c0_.id + 5000) * c0_.id + 3 < 10000000' - ); - } - - public function testSupportsMultipleEntitiesInFromClause() - { - $this->assertSqlGeneration( - 'SELECT u, a FROM Doctrine\Tests\Models\CMS\CmsUser u, Doctrine\Tests\Models\CMS\CmsArticle a JOIN a.user u2 WHERE u.id = u2.id', - 'SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3, c1_.id AS id4, c1_.topic AS topic5, c1_.text AS text6, c1_.version AS version7 FROM cms_users c0_, cms_articles c1_ INNER JOIN cms_users c2_ ON c1_.user_id = c2_.id WHERE c0_.id = c2_.id' - ); - } - - public function testSupportsMultipleEntitiesInFromClauseUsingPathExpression() - { - $this->assertSqlGeneration( - 'SELECT u, a FROM Doctrine\Tests\Models\CMS\CmsUser u, Doctrine\Tests\Models\CMS\CmsArticle a WHERE u.id = a.user', - 'SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3, c1_.id AS id4, c1_.topic AS topic5, c1_.text AS text6, c1_.version AS version7 FROM cms_users c0_, cms_articles c1_ WHERE c0_.id = c1_.user_id' - ); - } - - public function testSupportsPlainJoinWithoutClause() - { - $this->assertSqlGeneration( - 'SELECT u.id, a.id from Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.articles a', - 'SELECT c0_.id AS id0, c1_.id AS id1 FROM cms_users c0_ LEFT JOIN cms_articles c1_ ON c0_.id = c1_.user_id' - ); - $this->assertSqlGeneration( - 'SELECT u.id, a.id from Doctrine\Tests\Models\CMS\CmsUser u JOIN u.articles a', - 'SELECT c0_.id AS id0, c1_.id AS id1 FROM cms_users c0_ INNER JOIN cms_articles c1_ ON c0_.id = c1_.user_id' - ); - } - - /** - * @group DDC-135 - */ - public function testSupportsJoinAndWithClauseRestriction() - { - $this->assertSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.articles a WITH a.topic LIKE '%foo%'", - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ LEFT JOIN cms_articles c1_ ON c0_.id = c1_.user_id AND (c1_.topic LIKE '%foo%')" - ); - $this->assertSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.articles a WITH a.topic LIKE '%foo%'", - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ INNER JOIN cms_articles c1_ ON c0_.id = c1_.user_id AND (c1_.topic LIKE '%foo%')" - ); - } - - /** - * @group DDC-135 - * @group DDC-177 - */ - public function testJoinOnClause_NotYetSupported_ThrowsException() - { - $this->setExpectedException('Doctrine\ORM\Query\QueryException'); - - $sql = $this->_em->createQuery( - "SELECT u, a FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.articles a ON a.topic LIKE '%foo%'" - )->getSql(); - } - - public function testSupportsMultipleJoins() - { - $this->assertSqlGeneration( - 'SELECT u.id, a.id, p.phonenumber, c.id from Doctrine\Tests\Models\CMS\CmsUser u JOIN u.articles a JOIN u.phonenumbers p JOIN a.comments c', - 'SELECT c0_.id AS id0, c1_.id AS id1, c2_.phonenumber AS phonenumber2, c3_.id AS id3 FROM cms_users c0_ INNER JOIN cms_articles c1_ ON c0_.id = c1_.user_id INNER JOIN cms_phonenumbers c2_ ON c0_.id = c2_.user_id INNER JOIN cms_comments c3_ ON c1_.id = c3_.article_id' - ); - } - - public function testSupportsTrimFunction() - { - $this->assertSqlGeneration( - "SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE TRIM(TRAILING ' ' FROM u.name) = 'someone'", - "SELECT c0_.name AS name0 FROM cms_users c0_ WHERE TRIM(TRAILING ' ' FROM c0_.name) = 'someone'" - ); - } - - // Ticket 894 - public function testSupportsBetweenClauseWithPositionalParameters() - { - $this->assertSqlGeneration( - "SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id BETWEEN ?1 AND ?2", - "SELECT c0_.name AS name0 FROM cms_users c0_ WHERE c0_.id BETWEEN ? AND ?" - ); - } - - public function testSupportsFunctionalExpressionsInWherePart() - { - $this->assertSqlGeneration( - "SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE TRIM(u.name) = 'someone'", - // String quoting in the SQL usually depends on the database platform. - // This test works with a mock connection which uses ' for string quoting. - "SELECT c0_.name AS name0 FROM cms_users c0_ WHERE TRIM(c0_.name) = 'someone'" - ); - } - - public function testSupportsInstanceOfExpressionsInWherePart() - { - $this->assertSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\Company\CompanyPerson u WHERE u INSTANCE OF Doctrine\Tests\Models\Company\CompanyEmployee", - "SELECT c0_.id AS id0, c0_.name AS name1, c0_.discr AS discr2 FROM company_persons c0_ WHERE c0_.discr IN ('employee')" - ); - } - - public function testSupportsInstanceOfExpressionInWherePartWithMultipleValues() - { - $this->assertSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\Company\CompanyPerson u WHERE u INSTANCE OF (Doctrine\Tests\Models\Company\CompanyEmployee, \Doctrine\Tests\Models\Company\CompanyManager)", - "SELECT c0_.id AS id0, c0_.name AS name1, c0_.discr AS discr2 FROM company_persons c0_ WHERE c0_.discr IN ('employee', 'manager')" - ); - } - - /** - * @group DDC-1194 - */ - public function testSupportsInstanceOfExpressionsInWherePartPrefixedSlash() - { - $this->assertSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\Company\CompanyPerson u WHERE u INSTANCE OF \Doctrine\Tests\Models\Company\CompanyEmployee", - "SELECT c0_.id AS id0, c0_.name AS name1, c0_.discr AS discr2 FROM company_persons c0_ WHERE c0_.discr IN ('employee')" - ); - } - - /** - * @group DDC-1194 - */ - public function testSupportsInstanceOfExpressionsInWherePartWithUnrelatedClass() - { - $this->assertInvalidSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\Company\CompanyPerson u WHERE u INSTANCE OF \Doctrine\Tests\Models\CMS\CmsUser", - "Doctrine\ORM\Query\QueryException" - ); - } - - public function testSupportsInstanceOfExpressionsInWherePartInDeeperLevel() - { - $this->assertSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\Company\CompanyEmployee u WHERE u INSTANCE OF Doctrine\Tests\Models\Company\CompanyManager", - "SELECT c0_.id AS id0, c0_.name AS name1, c1_.salary AS salary2, c1_.department AS department3, c1_.startDate AS startDate4, c0_.discr AS discr5 FROM company_employees c1_ INNER JOIN company_persons c0_ ON c1_.id = c0_.id WHERE c0_.discr IN ('manager')" - ); - } - - public function testSupportsInstanceOfExpressionsInWherePartInDeepestLevel() - { - $this->assertSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\Company\CompanyManager u WHERE u INSTANCE OF Doctrine\Tests\Models\Company\CompanyManager", - "SELECT c0_.id AS id0, c0_.name AS name1, c1_.salary AS salary2, c1_.department AS department3, c1_.startDate AS startDate4, c2_.title AS title5, c0_.discr AS discr6 FROM company_managers c2_ INNER JOIN company_employees c1_ ON c2_.id = c1_.id INNER JOIN company_persons c0_ ON c2_.id = c0_.id WHERE c0_.discr IN ('manager')" - ); - } - - public function testSupportsInstanceOfExpressionsUsingInputParameterInWherePart() - { - $this->assertSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\Company\CompanyPerson u WHERE u INSTANCE OF ?1", - "SELECT c0_.id AS id0, c0_.name AS name1, c0_.discr AS discr2 FROM company_persons c0_ WHERE c0_.discr IN ('employee')", - array(), array(1 => $this->_em->getClassMetadata('Doctrine\Tests\Models\Company\CompanyEmployee')) - ); - } - - // Ticket #973 - public function testSupportsSingleValuedInExpressionWithoutSpacesInWherePart() - { - $this->assertSqlGeneration( - "SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE IDENTITY(u.email) IN(46)", - "SELECT c0_.name AS name0 FROM cms_users c0_ WHERE c0_.email_id IN (46)" - ); - } - - public function testSupportsMultipleValuedInExpressionInWherePart() - { - $this->assertSqlGeneration( - 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id IN (1, 2)', - 'SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ WHERE c0_.id IN (1, 2)' - ); - } - - public function testSupportsNotInExpressionInWherePart() - { - $this->assertSqlGeneration( - 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE :id NOT IN (1)', - 'SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ WHERE ? NOT IN (1)' - ); - } - - public function testInExpressionWithSingleValuedAssociationPathExpressionInWherePart() - { - $this->assertSqlGeneration( - 'SELECT u FROM Doctrine\Tests\Models\Forum\ForumUser u WHERE u.avatar IN (?1, ?2)', - 'SELECT f0_.id AS id0, f0_.username AS username1 FROM forum_users f0_ WHERE f0_.avatar_id IN (?, ?)' - ); - } - - public function testInvalidInExpressionWithSingleValuedAssociationPathExpressionOnInverseSide() - { - // We do not support SingleValuedAssociationPathExpression on inverse side - $this->assertInvalidSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.address IN (?1, ?2)", - "Doctrine\ORM\Query\QueryException" - ); - } - - public function testSupportsConcatFunctionForMysqlAndPostgresql() - { - $connMock = $this->_em->getConnection(); - $orgPlatform = $connMock->getDatabasePlatform(); - - $connMock->setDatabasePlatform(new \Doctrine\DBAL\Platforms\MySqlPlatform); - $this->assertSqlGeneration( - "SELECT u.id FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE CONCAT(u.name, 's') = ?1", - "SELECT c0_.id AS id0 FROM cms_users c0_ WHERE CONCAT(c0_.name, 's') = ?" - ); - $this->assertSqlGeneration( - "SELECT CONCAT(u.id, u.name) FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = ?1", - "SELECT CONCAT(c0_.id, c0_.name) AS sclr0 FROM cms_users c0_ WHERE c0_.id = ?" - ); - - $connMock->setDatabasePlatform(new \Doctrine\DBAL\Platforms\PostgreSqlPlatform); - $this->assertSqlGeneration( - "SELECT u.id FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE CONCAT(u.name, 's') = ?1", - "SELECT c0_.id AS id0 FROM cms_users c0_ WHERE c0_.name || 's' = ?" - ); - $this->assertSqlGeneration( - "SELECT CONCAT(u.id, u.name) FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = ?1", - "SELECT c0_.id || c0_.name AS sclr0 FROM cms_users c0_ WHERE c0_.id = ?" - ); - - $connMock->setDatabasePlatform($orgPlatform); - } - - public function testSupportsExistsExpressionInWherePartWithCorrelatedSubquery() - { - $this->assertSqlGeneration( - 'SELECT u.id FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE EXISTS (SELECT p.phonenumber FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p WHERE p.phonenumber = u.id)', - 'SELECT c0_.id AS id0 FROM cms_users c0_ WHERE EXISTS (SELECT c1_.phonenumber FROM cms_phonenumbers c1_ WHERE c1_.phonenumber = c0_.id)' - ); - } - - /** - * @group DDC-593 - */ - public function testSubqueriesInComparisonExpression() - { - $this->assertSqlGeneration( - 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE (u.id >= (SELECT u2.id FROM Doctrine\Tests\Models\CMS\CmsUser u2 WHERE u2.name = :name)) AND (u.id <= (SELECT u3.id FROM Doctrine\Tests\Models\CMS\CmsUser u3 WHERE u3.name = :name))', - 'SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ WHERE (c0_.id >= (SELECT c1_.id FROM cms_users c1_ WHERE c1_.name = ?)) AND (c0_.id <= (SELECT c2_.id FROM cms_users c2_ WHERE c2_.name = ?))' - ); - } - - public function testSupportsMemberOfExpressionOneToMany() - { - // "Get all users who have $phone as a phonenumber." (*cough* doesnt really make sense...) - $q = $this->_em->createQuery('SELECT u.id FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE :param MEMBER OF u.phonenumbers'); - $q->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true); - - $phone = new \Doctrine\Tests\Models\CMS\CmsPhonenumber; - $phone->phonenumber = 101; - $q->setParameter('param', $phone); - - $this->assertEquals( - 'SELECT c0_.id AS id0 FROM cms_users c0_ WHERE EXISTS (SELECT 1 FROM cms_phonenumbers c1_ WHERE c0_.id = c1_.user_id AND c1_.phonenumber = ?)', - $q->getSql() - ); - } - - public function testSupportsMemberOfExpressionManyToMany() - { - // "Get all users who are members of $group." - $q = $this->_em->createQuery('SELECT u.id FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE :param MEMBER OF u.groups'); - $q->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true); - - $group = new \Doctrine\Tests\Models\CMS\CmsGroup; - $group->id = 101; - $q->setParameter('param', $group); - - $this->assertEquals( - 'SELECT c0_.id AS id0 FROM cms_users c0_ WHERE EXISTS (SELECT 1 FROM cms_users_groups c1_ INNER JOIN cms_groups c2_ ON c1_.group_id = c2_.id WHERE c1_.user_id = c0_.id AND c2_.id = ?)', - $q->getSql() - ); - } - - public function testSupportsMemberOfExpressionSelfReferencing() - { - // "Get all persons who have $person as a friend." - // Tough one: Many-many self-referencing ("friends") with class table inheritance - $q = $this->_em->createQuery('SELECT p FROM Doctrine\Tests\Models\Company\CompanyPerson p WHERE :param MEMBER OF p.friends'); - $person = new \Doctrine\Tests\Models\Company\CompanyPerson; - $this->_em->getClassMetadata(get_class($person))->setIdentifierValues($person, array('id' => 101)); - $q->setParameter('param', $person); - $this->assertEquals( - 'SELECT c0_.id AS id0, c0_.name AS name1, c1_.title AS title2, c2_.salary AS salary3, c2_.department AS department4, c2_.startDate AS startDate5, c0_.discr AS discr6, c0_.spouse_id AS spouse_id7, c1_.car_id AS car_id8 FROM company_persons c0_ LEFT JOIN company_managers c1_ ON c0_.id = c1_.id LEFT JOIN company_employees c2_ ON c0_.id = c2_.id WHERE EXISTS (SELECT 1 FROM company_persons_friends c3_ INNER JOIN company_persons c4_ ON c3_.friend_id = c4_.id WHERE c3_.person_id = c0_.id AND c4_.id = ?)', - $q->getSql() - ); - } - - public function testSupportsMemberOfWithSingleValuedAssociation() - { - // Impossible example, but it illustrates the purpose - $q = $this->_em->createQuery('SELECT u.id FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.email MEMBER OF u.groups'); - - $this->assertEquals( - 'SELECT c0_.id AS id0 FROM cms_users c0_ WHERE EXISTS (SELECT 1 FROM cms_users_groups c1_ INNER JOIN cms_groups c2_ ON c1_.group_id = c2_.id WHERE c1_.user_id = c0_.id AND c2_.id = c0_.email_id)', - $q->getSql() - ); - } - - public function testSupportsMemberOfWithIdentificationVariable() - { - // Impossible example, but it illustrates the purpose - $q = $this->_em->createQuery('SELECT u.id FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u MEMBER OF u.groups'); - - $this->assertEquals( - 'SELECT c0_.id AS id0 FROM cms_users c0_ WHERE EXISTS (SELECT 1 FROM cms_users_groups c1_ INNER JOIN cms_groups c2_ ON c1_.group_id = c2_.id WHERE c1_.user_id = c0_.id AND c2_.id = c0_.id)', - $q->getSql() - ); - } - - public function testSupportsCurrentDateFunction() - { - $q = $this->_em->createQuery('SELECT d.id FROM Doctrine\Tests\Models\Generic\DateTimeModel d WHERE d.datetime > current_date()'); - $q->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true); - $this->assertEquals('SELECT d0_.id AS id0 FROM date_time_model d0_ WHERE d0_.col_datetime > CURRENT_DATE', $q->getSql()); - } - - public function testSupportsCurrentTimeFunction() - { - $q = $this->_em->createQuery('SELECT d.id FROM Doctrine\Tests\Models\Generic\DateTimeModel d WHERE d.time > current_time()'); - $q->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true); - $this->assertEquals('SELECT d0_.id AS id0 FROM date_time_model d0_ WHERE d0_.col_time > CURRENT_TIME', $q->getSql()); - } - - public function testSupportsCurrentTimestampFunction() - { - $q = $this->_em->createQuery('SELECT d.id FROM Doctrine\Tests\Models\Generic\DateTimeModel d WHERE d.datetime > current_timestamp()'); - $q->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true); - $this->assertEquals('SELECT d0_.id AS id0 FROM date_time_model d0_ WHERE d0_.col_datetime > CURRENT_TIMESTAMP', $q->getSql()); - } - - public function testExistsExpressionInWhereCorrelatedSubqueryAssocCondition() - { - $this->assertSqlGeneration( - // DQL - // The result of this query consists of all employees whose spouses are also employees. - 'SELECT DISTINCT emp FROM Doctrine\Tests\Models\CMS\CmsEmployee emp - WHERE EXISTS ( - SELECT spouseEmp - FROM Doctrine\Tests\Models\CMS\CmsEmployee spouseEmp - WHERE spouseEmp = emp.spouse)', - // SQL - 'SELECT DISTINCT c0_.id AS id0, c0_.name AS name1 FROM cms_employees c0_' - . ' WHERE EXISTS (' - . 'SELECT c1_.id FROM cms_employees c1_ WHERE c1_.id = c0_.spouse_id' - . ')' - ); - } - - public function testExistsExpressionWithSimpleSelectReturningScalar() - { - $this->assertSqlGeneration( - // DQL - // The result of this query consists of all employees whose spouses are also employees. - 'SELECT DISTINCT emp FROM Doctrine\Tests\Models\CMS\CmsEmployee emp - WHERE EXISTS ( - SELECT 1 - FROM Doctrine\Tests\Models\CMS\CmsEmployee spouseEmp - WHERE spouseEmp = emp.spouse)', - // SQL - 'SELECT DISTINCT c0_.id AS id0, c0_.name AS name1 FROM cms_employees c0_' - . ' WHERE EXISTS (' - . 'SELECT 1 AS sclr2 FROM cms_employees c1_ WHERE c1_.id = c0_.spouse_id' - . ')' - ); - } - - public function testLimitFromQueryClass() - { - $q = $this->_em - ->createQuery('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u') - ->setMaxResults(10); - - $this->assertEquals('SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3, c0_.email_id AS email_id4 FROM cms_users c0_ LIMIT 10', $q->getSql()); - } - - public function testLimitAndOffsetFromQueryClass() - { - $q = $this->_em - ->createQuery('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u') - ->setMaxResults(10) - ->setFirstResult(0); - - $this->assertEquals('SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3, c0_.email_id AS email_id4 FROM cms_users c0_ LIMIT 10 OFFSET 0', $q->getSql()); - } - - public function testSizeFunction() - { - $this->assertSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE SIZE(u.phonenumbers) > 1", - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ WHERE (SELECT COUNT(*) FROM cms_phonenumbers c1_ WHERE c1_.user_id = c0_.id) > 1" - ); - } - - public function testSizeFunctionSupportsManyToMany() - { - $this->assertSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE SIZE(u.groups) > 1", - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ WHERE (SELECT COUNT(*) FROM cms_users_groups c1_ WHERE c1_.user_id = c0_.id) > 1" - ); - } - - public function testEmptyCollectionComparisonExpression() - { - $this->assertSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.phonenumbers IS EMPTY", - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ WHERE (SELECT COUNT(*) FROM cms_phonenumbers c1_ WHERE c1_.user_id = c0_.id) = 0" - ); - $this->assertSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.phonenumbers IS NOT EMPTY", - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ WHERE (SELECT COUNT(*) FROM cms_phonenumbers c1_ WHERE c1_.user_id = c0_.id) > 0" - ); - } - - public function testNestedExpressions() - { - $this->assertSqlGeneration( - "select u from Doctrine\Tests\Models\CMS\CmsUser u where u.id > 10 and u.id < 42 and ((u.id * 2) > 5)", - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ WHERE c0_.id > 10 AND c0_.id < 42 AND (c0_.id * 2 > 5)" - ); - } - - public function testNestedExpressions2() - { - $this->assertSqlGeneration( - "select u from Doctrine\Tests\Models\CMS\CmsUser u where (u.id > 10) and (u.id < 42 and ((u.id * 2) > 5)) or u.id <> 42", - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ WHERE (c0_.id > 10) AND (c0_.id < 42 AND (c0_.id * 2 > 5)) OR c0_.id <> 42" - ); - } - - public function testNestedExpressions3() - { - $this->assertSqlGeneration( - "select u from Doctrine\Tests\Models\CMS\CmsUser u where (u.id > 10) and (u.id between 1 and 10 or u.id in (1, 2, 3, 4, 5))", - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ WHERE (c0_.id > 10) AND (c0_.id BETWEEN 1 AND 10 OR c0_.id IN (1, 2, 3, 4, 5))" - ); - } - - public function testOrderByCollectionAssociationSize() - { - $this->assertSqlGeneration( - "select u, size(u.articles) as numArticles from Doctrine\Tests\Models\CMS\CmsUser u order by numArticles", - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3, (SELECT COUNT(*) FROM cms_articles c1_ WHERE c1_.user_id = c0_.id) AS sclr4 FROM cms_users c0_ ORDER BY sclr4 ASC" - ); - } - - public function testOrderBySupportsSingleValuedPathExpressionOwningSide() - { - $this->assertSqlGeneration( - "select a from Doctrine\Tests\Models\CMS\CmsArticle a order by a.user", - "SELECT c0_.id AS id0, c0_.topic AS topic1, c0_.text AS text2, c0_.version AS version3 FROM cms_articles c0_ ORDER BY c0_.user_id ASC" - ); - } - - /** - * @expectedException Doctrine\ORM\Query\QueryException - */ - public function testOrderBySupportsSingleValuedPathExpressionInverseSide() - { - $q = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u order by u.address"); - $q->getSQL(); - } - - public function testBooleanLiteralInWhereOnSqlite() - { - $oldPlat = $this->_em->getConnection()->getDatabasePlatform(); - $this->_em->getConnection()->setDatabasePlatform(new \Doctrine\DBAL\Platforms\SqlitePlatform); - - $this->assertSqlGeneration( - "SELECT b FROM Doctrine\Tests\Models\Generic\BooleanModel b WHERE b.booleanField = true", - "SELECT b0_.id AS id0, b0_.booleanField AS booleanField1 FROM boolean_model b0_ WHERE b0_.booleanField = 1" - ); - - $this->assertSqlGeneration( - "SELECT b FROM Doctrine\Tests\Models\Generic\BooleanModel b WHERE b.booleanField = false", - "SELECT b0_.id AS id0, b0_.booleanField AS booleanField1 FROM boolean_model b0_ WHERE b0_.booleanField = 0" - ); - - $this->_em->getConnection()->setDatabasePlatform($oldPlat); - } - - public function testBooleanLiteralInWhereOnPostgres() - { - $oldPlat = $this->_em->getConnection()->getDatabasePlatform(); - $this->_em->getConnection()->setDatabasePlatform(new \Doctrine\DBAL\Platforms\PostgreSqlPlatform); - - $this->assertSqlGeneration( - "SELECT b FROM Doctrine\Tests\Models\Generic\BooleanModel b WHERE b.booleanField = true", - "SELECT b0_.id AS id0, b0_.booleanField AS booleanfield1 FROM boolean_model b0_ WHERE b0_.booleanField = true" - ); - - $this->assertSqlGeneration( - "SELECT b FROM Doctrine\Tests\Models\Generic\BooleanModel b WHERE b.booleanField = false", - "SELECT b0_.id AS id0, b0_.booleanField AS booleanfield1 FROM boolean_model b0_ WHERE b0_.booleanField = false" - ); - - $this->_em->getConnection()->setDatabasePlatform($oldPlat); - } - - public function testSingleValuedAssociationFieldInWhere() - { - $this->assertSqlGeneration( - "SELECT p FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p WHERE p.user = ?1", - "SELECT c0_.phonenumber AS phonenumber0 FROM cms_phonenumbers c0_ WHERE c0_.user_id = ?" - ); - } - - public function testSingleValuedAssociationNullCheckOnOwningSide() - { - $this->assertSqlGeneration( - "SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.user IS NULL", - "SELECT c0_.id AS id0, c0_.country AS country1, c0_.zip AS zip2, c0_.city AS city3 FROM cms_addresses c0_ WHERE c0_.user_id IS NULL" - ); - } - - // Null check on inverse side has to happen through explicit JOIN. - // "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.address IS NULL" - // where the CmsUser is the inverse side is not supported. - public function testSingleValuedAssociationNullCheckOnInverseSide() - { - $this->assertSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.address a WHERE a.id IS NULL", - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ LEFT JOIN cms_addresses c1_ ON c0_.id = c1_.user_id WHERE c1_.id IS NULL" - ); - } - - /** - * @group DDC-339 - */ - public function testStringFunctionLikeExpression() - { - $this->assertSqlGeneration( - "SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE LOWER(u.name) LIKE '%foo OR bar%'", - "SELECT c0_.name AS name0 FROM cms_users c0_ WHERE LOWER(c0_.name) LIKE '%foo OR bar%'" - ); - $this->assertSqlGeneration( - "SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE LOWER(u.name) LIKE :str", - "SELECT c0_.name AS name0 FROM cms_users c0_ WHERE LOWER(c0_.name) LIKE ?" - ); - $this->assertSqlGeneration( - "SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE CONCAT(UPPER(u.name), '_moo') LIKE :str", - "SELECT c0_.name AS name0 FROM cms_users c0_ WHERE UPPER(c0_.name) || '_moo' LIKE ?" - ); - } - - /** - * @group DDC-338 - */ - public function testOrderedCollectionFetchJoined() - { - $this->assertSqlGeneration( - "SELECT r, l FROM Doctrine\Tests\Models\Routing\RoutingRoute r JOIN r.legs l", - "SELECT r0_.id AS id0, r1_.id AS id1, r1_.departureDate AS departureDate2, r1_.arrivalDate AS arrivalDate3 FROM RoutingRoute r0_ INNER JOIN RoutingRouteLegs r2_ ON r0_.id = r2_.route_id INNER JOIN RoutingLeg r1_ ON r1_.id = r2_.leg_id ". - "ORDER BY r1_.departureDate ASC" - ); - } - - public function testSubselectInSelect() - { - $this->assertSqlGeneration( - "SELECT u.name, (SELECT COUNT(p.phonenumber) FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p WHERE p.phonenumber = 1234) pcount FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name = 'jon'", - "SELECT c0_.name AS name0, (SELECT COUNT(c1_.phonenumber) AS dctrn__1 FROM cms_phonenumbers c1_ WHERE c1_.phonenumber = 1234) AS sclr1 FROM cms_users c0_ WHERE c0_.name = 'jon'" - ); - } - - /** - * @group locking - * @group DDC-178 - */ - public function testPessimisticWriteLockQueryHint() - { - if ($this->_em->getConnection()->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) { - $this->markTestSkipped('SqLite does not support Row locking at all.'); - } - - $this->assertSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username = 'gblanco'", - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 ". - "FROM cms_users c0_ WHERE c0_.username = 'gblanco' FOR UPDATE", - array(Query::HINT_LOCK_MODE => \Doctrine\DBAL\LockMode::PESSIMISTIC_WRITE) - ); - } - - /** - * @group locking - * @group DDC-178 - */ - public function testPessimisticReadLockQueryHintPostgreSql() - { - $this->_em->getConnection()->setDatabasePlatform(new \Doctrine\DBAL\Platforms\PostgreSqlPlatform); - - $this->assertSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username = 'gblanco'", - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 ". - "FROM cms_users c0_ WHERE c0_.username = 'gblanco' FOR SHARE", - array(Query::HINT_LOCK_MODE => \Doctrine\DBAL\LockMode::PESSIMISTIC_READ) - ); - } - - /** - * @group DDC-1693 - * @group locking - */ - public function testLockModeNoneQueryHint() - { - $this->assertSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username = 'gblanco'", - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 ". - "FROM cms_users c0_ WHERE c0_.username = 'gblanco'", - array(Query::HINT_LOCK_MODE => \Doctrine\DBAL\LockMode::NONE) - ); - } - - /** - * @group DDC-430 - */ - public function testSupportSelectWithMoreThan10InputParameters() - { - $this->assertSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = ?1 OR u.id = ?2 OR u.id = ?3 OR u.id = ?4 OR u.id = ?5 OR u.id = ?6 OR u.id = ?7 OR u.id = ?8 OR u.id = ?9 OR u.id = ?10 OR u.id = ?11", - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ WHERE c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ?" - ); - } - - /** - * @group locking - * @group DDC-178 - */ - public function testPessimisticReadLockQueryHintMySql() - { - $this->_em->getConnection()->setDatabasePlatform(new \Doctrine\DBAL\Platforms\MySqlPlatform); - - $this->assertSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username = 'gblanco'", - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 ". - "FROM cms_users c0_ WHERE c0_.username = 'gblanco' LOCK IN SHARE MODE", - array(Query::HINT_LOCK_MODE => \Doctrine\DBAL\LockMode::PESSIMISTIC_READ) - ); - } - - /** - * @group locking - * @group DDC-178 - */ - public function testPessimisticReadLockQueryHintOracle() - { - $this->_em->getConnection()->setDatabasePlatform(new \Doctrine\DBAL\Platforms\OraclePlatform); - - $this->assertSqlGeneration( - "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username = 'gblanco'", - "SELECT c0_.id AS ID0, c0_.status AS STATUS1, c0_.username AS USERNAME2, c0_.name AS NAME3 ". - "FROM cms_users c0_ WHERE c0_.username = 'gblanco' FOR UPDATE", - array(Query::HINT_LOCK_MODE => \Doctrine\DBAL\LockMode::PESSIMISTIC_READ) - ); - } - - /** - * @group DDC-431 - */ - public function testSupportToCustomDQLFunctions() - { - $config = $this->_em->getConfiguration(); - $config->addCustomNumericFunction('MYABS', 'Doctrine\Tests\ORM\Query\MyAbsFunction'); - - $this->assertSqlGeneration( - 'SELECT MYABS(p.phonenumber) FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p', - 'SELECT ABS(c0_.phonenumber) AS sclr0 FROM cms_phonenumbers c0_' - ); - - $config->setCustomNumericFunctions(array()); - } - - /** - * @group DDC-826 - */ - public function testMappedSuperclassAssociationJoin() - { - $this->assertSqlGeneration( - 'SELECT f FROM Doctrine\Tests\Models\DirectoryTree\File f JOIN f.parentDirectory d WHERE f.id = ?1', - 'SELECT f0_.id AS id0, f0_.extension AS extension1, f0_.name AS name2 FROM "file" f0_ INNER JOIN Directory d1_ ON f0_.parentDirectory_id = d1_.id WHERE f0_.id = ?' - ); - } - - /** - * @group DDC-1053 - */ - public function testGroupBy() - { - $this->assertSqlGeneration( - 'SELECT g.id, count(u.id) FROM Doctrine\Tests\Models\CMS\CmsGroup g JOIN g.users u GROUP BY g.id', - 'SELECT c0_.id AS id0, count(c1_.id) AS sclr1 FROM cms_groups c0_ INNER JOIN cms_users_groups c2_ ON c0_.id = c2_.group_id INNER JOIN cms_users c1_ ON c1_.id = c2_.user_id GROUP BY c0_.id' - ); - } - - /** - * @group DDC-1053 - */ - public function testGroupByIdentificationVariable() - { - $this->assertSqlGeneration( - 'SELECT g, count(u.id) FROM Doctrine\Tests\Models\CMS\CmsGroup g JOIN g.users u GROUP BY g', - 'SELECT c0_.id AS id0, c0_.name AS name1, count(c1_.id) AS sclr2 FROM cms_groups c0_ INNER JOIN cms_users_groups c2_ ON c0_.id = c2_.group_id INNER JOIN cms_users c1_ ON c1_.id = c2_.user_id GROUP BY c0_.id, c0_.name' - ); - } - - public function testCaseContainingNullIf() - { - $this->assertSqlGeneration( - "SELECT NULLIF(g.id, g.name) AS NullIfEqual FROM Doctrine\Tests\Models\CMS\CmsGroup g", - 'SELECT NULLIF(c0_.id, c0_.name) AS sclr0 FROM cms_groups c0_' - ); - } - - public function testCaseContainingCoalesce() - { - $this->assertSqlGeneration( - "SELECT COALESCE(NULLIF(u.name, ''), u.username) as Display FROM Doctrine\Tests\Models\CMS\CmsUser u", - "SELECT COALESCE(NULLIF(c0_.name, ''), c0_.username) AS sclr0 FROM cms_users c0_" - ); - } - - /** - * Test that the right discriminator data is inserted in a subquery. - */ - public function testSubSelectDiscriminator() - { - $this->assertSqlGeneration( - "SELECT u.name, (SELECT COUNT(cfc.id) total FROM Doctrine\Tests\Models\Company\CompanyFixContract cfc) as cfc_count FROM Doctrine\Tests\Models\CMS\CmsUser u", - "SELECT c0_.name AS name0, (SELECT COUNT(c1_.id) AS dctrn__total FROM company_contracts c1_ WHERE c1_.discr IN ('fix')) AS sclr1 FROM cms_users c0_" - ); - } - - public function testIdVariableResultVariableReuse() - { - $exceptionThrown = false; - try { - $query = $this->_em->createQuery("SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name IN (SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u)"); - - $query->getSql(); - $query->free(); - } catch (\Exception $e) { - $exceptionThrown = true; - } - - $this->assertTrue($exceptionThrown); - - } - - public function testSubSelectAliasesFromOuterQuery() - { - $this->assertSqlGeneration( - "SELECT uo, (SELECT ui.name FROM Doctrine\Tests\Models\CMS\CmsUser ui WHERE ui.id = uo.id) AS bar FROM Doctrine\Tests\Models\CMS\CmsUser uo", - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3, (SELECT c1_.name FROM cms_users c1_ WHERE c1_.id = c0_.id) AS sclr4 FROM cms_users c0_" - ); - } - - public function testSubSelectAliasesFromOuterQueryWithSubquery() - { - $this->assertSqlGeneration( - "SELECT uo, (SELECT ui.name FROM Doctrine\Tests\Models\CMS\CmsUser ui WHERE ui.id = uo.id AND ui.name IN (SELECT uii.name FROM Doctrine\Tests\Models\CMS\CmsUser uii)) AS bar FROM Doctrine\Tests\Models\CMS\CmsUser uo", - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3, (SELECT c1_.name FROM cms_users c1_ WHERE c1_.id = c0_.id AND c1_.name IN (SELECT c2_.name FROM cms_users c2_)) AS sclr4 FROM cms_users c0_" - ); - } - - public function testSubSelectAliasesFromOuterQueryReuseInWhereClause() - { - $this->assertSqlGeneration( - "SELECT uo, (SELECT ui.name FROM Doctrine\Tests\Models\CMS\CmsUser ui WHERE ui.id = uo.id) AS bar FROM Doctrine\Tests\Models\CMS\CmsUser uo WHERE bar = ?0", - "SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3, (SELECT c1_.name FROM cms_users c1_ WHERE c1_.id = c0_.id) AS sclr4 FROM cms_users c0_ WHERE sclr4 = ?" - ); - } - - /** - * @group DDC-1298 - */ - public function testSelectForeignKeyPKWithoutFields() - { - $this->assertSqlGeneration( - "SELECT t, s, l FROM Doctrine\Tests\Models\DDC117\DDC117Link l INNER JOIN l.target t INNER JOIN l.source s", - "SELECT d0_.article_id AS article_id0, d0_.title AS title1, d1_.article_id AS article_id2, d1_.title AS title3, d2_.source_id AS source_id4, d2_.target_id AS target_id5 FROM DDC117Link d2_ INNER JOIN DDC117Article d0_ ON d2_.target_id = d0_.article_id INNER JOIN DDC117Article d1_ ON d2_.source_id = d1_.article_id" - ); - } - - public function testGeneralCaseWithSingleWhenClause() - { - $this->assertSqlGeneration( - "SELECT g.id, CASE WHEN ((g.id / 2) > 18) THEN 1 ELSE 0 END AS test FROM Doctrine\Tests\Models\CMS\CmsGroup g", - "SELECT c0_.id AS id0, CASE WHEN (c0_.id / 2 > 18) THEN 1 ELSE 0 END AS sclr1 FROM cms_groups c0_" - ); - } - - public function testGeneralCaseWithMultipleWhenClause() - { - $this->assertSqlGeneration( - "SELECT g.id, CASE WHEN (g.id / 2 < 10) THEN 2 WHEN ((g.id / 2) > 20) THEN 1 ELSE 0 END AS test FROM Doctrine\Tests\Models\CMS\CmsGroup g", - "SELECT c0_.id AS id0, CASE WHEN (c0_.id / 2 < 10) THEN 2 WHEN (c0_.id / 2 > 20) THEN 1 ELSE 0 END AS sclr1 FROM cms_groups c0_" - ); - } - - public function testSimpleCaseWithSingleWhenClause() - { - $this->assertSqlGeneration( - "SELECT g FROM Doctrine\Tests\Models\CMS\CmsGroup g WHERE g.id = CASE g.name WHEN 'admin' THEN 1 ELSE 2 END", - "SELECT c0_.id AS id0, c0_.name AS name1 FROM cms_groups c0_ WHERE c0_.id = CASE c0_.name WHEN admin THEN 1 ELSE 2 END" - ); - } - - public function testSimpleCaseWithMultipleWhenClause() - { - $this->assertSqlGeneration( - "SELECT g FROM Doctrine\Tests\Models\CMS\CmsGroup g WHERE g.id = (CASE g.name WHEN 'admin' THEN 1 WHEN 'moderator' THEN 2 ELSE 3 END)", - "SELECT c0_.id AS id0, c0_.name AS name1 FROM cms_groups c0_ WHERE c0_.id = CASE c0_.name WHEN admin THEN 1 WHEN moderator THEN 2 ELSE 3 END" - ); - } - - public function testGeneralCaseWithSingleWhenClauseInSubselect() - { - $this->assertSqlGeneration( - "SELECT g FROM Doctrine\Tests\Models\CMS\CmsGroup g WHERE g.id IN (SELECT CASE WHEN ((g2.id / 2) > 18) THEN 2 ELSE 1 END FROM Doctrine\Tests\Models\CMS\CmsGroup g2)", - "SELECT c0_.id AS id0, c0_.name AS name1 FROM cms_groups c0_ WHERE c0_.id IN (SELECT CASE WHEN (c1_.id / 2 > 18) THEN 2 ELSE 1 END AS sclr2 FROM cms_groups c1_)" - ); - } - - public function testGeneralCaseWithMultipleWhenClauseInSubselect() - { - $this->assertSqlGeneration( - "SELECT g FROM Doctrine\Tests\Models\CMS\CmsGroup g WHERE g.id IN (SELECT CASE WHEN (g.id / 2 < 10) THEN 3 WHEN ((g.id / 2) > 20) THEN 2 ELSE 1 END FROM Doctrine\Tests\Models\CMS\CmsGroup g2)", - "SELECT c0_.id AS id0, c0_.name AS name1 FROM cms_groups c0_ WHERE c0_.id IN (SELECT CASE WHEN (c0_.id / 2 < 10) THEN 3 WHEN (c0_.id / 2 > 20) THEN 2 ELSE 1 END AS sclr2 FROM cms_groups c1_)" - ); - } - - public function testSimpleCaseWithSingleWhenClauseInSubselect() - { - $this->assertSqlGeneration( - "SELECT g FROM Doctrine\Tests\Models\CMS\CmsGroup g WHERE g.id IN (SELECT CASE g2.name WHEN 'admin' THEN 1 ELSE 2 END FROM Doctrine\Tests\Models\CMS\CmsGroup g2)", - "SELECT c0_.id AS id0, c0_.name AS name1 FROM cms_groups c0_ WHERE c0_.id IN (SELECT CASE c1_.name WHEN admin THEN 1 ELSE 2 END AS sclr2 FROM cms_groups c1_)" - ); - } - - public function testSimpleCaseWithMultipleWhenClauseInSubselect() - { - $this->assertSqlGeneration( - "SELECT g FROM Doctrine\Tests\Models\CMS\CmsGroup g WHERE g.id IN (SELECT CASE g2.name WHEN 'admin' THEN 1 WHEN 'moderator' THEN 2 ELSE 3 END FROM Doctrine\Tests\Models\CMS\CmsGroup g2)", - "SELECT c0_.id AS id0, c0_.name AS name1 FROM cms_groups c0_ WHERE c0_.id IN (SELECT CASE c1_.name WHEN admin THEN 1 WHEN moderator THEN 2 ELSE 3 END AS sclr2 FROM cms_groups c1_)" - ); - } - - /** - * @group DDC-1339 - */ - public function testIdentityFunctionInSelectClause() - { - $this->assertSqlGeneration( - "SELECT IDENTITY(u.email) as email_id FROM Doctrine\Tests\Models\CMS\CmsUser u", - "SELECT c0_.email_id AS sclr0 FROM cms_users c0_" - ); - } - - /** - * @group DDC-1339 - */ - public function testIdentityFunctionDoesNotAcceptStateField() - { - $this->assertInvalidSqlGeneration( - "SELECT IDENTITY(u.name) as name FROM Doctrine\Tests\Models\CMS\CmsUser u", - "Doctrine\ORM\Query\QueryException" - ); - } - - /** - * @group DDC-1389 - */ - public function testInheritanceTypeJoinInRootClassWithDisabledForcePartialLoad() - { - $this->assertSqlGeneration( - 'SELECT p FROM Doctrine\Tests\Models\Company\CompanyPerson p', - 'SELECT c0_.id AS id0, c0_.name AS name1, c1_.title AS title2, c2_.salary AS salary3, c2_.department AS department4, c2_.startDate AS startDate5, c0_.discr AS discr6, c0_.spouse_id AS spouse_id7, c1_.car_id AS car_id8 FROM company_persons c0_ LEFT JOIN company_managers c1_ ON c0_.id = c1_.id LEFT JOIN company_employees c2_ ON c0_.id = c2_.id', - array(Query::HINT_FORCE_PARTIAL_LOAD => false) - ); - } - - /** - * @group DDC-1389 - */ - public function testInheritanceTypeJoinInRootClassWithEnabledForcePartialLoad() - { - $this->assertSqlGeneration( - 'SELECT p FROM Doctrine\Tests\Models\Company\CompanyPerson p', - 'SELECT c0_.id AS id0, c0_.name AS name1, c0_.discr AS discr2 FROM company_persons c0_', - array(Query::HINT_FORCE_PARTIAL_LOAD => true) - ); - } - - /** - * @group DDC-1389 - */ - public function testInheritanceTypeJoinInChildClassWithDisabledForcePartialLoad() - { - $this->assertSqlGeneration( - 'SELECT e FROM Doctrine\Tests\Models\Company\CompanyEmployee e', - 'SELECT c0_.id AS id0, c0_.name AS name1, c1_.salary AS salary2, c1_.department AS department3, c1_.startDate AS startDate4, c2_.title AS title5, c0_.discr AS discr6, c0_.spouse_id AS spouse_id7, c2_.car_id AS car_id8 FROM company_employees c1_ INNER JOIN company_persons c0_ ON c1_.id = c0_.id LEFT JOIN company_managers c2_ ON c1_.id = c2_.id', - array(Query::HINT_FORCE_PARTIAL_LOAD => false) - ); - } - - /** - * @group DDC-1389 - */ - public function testInheritanceTypeJoinInChildClassWithEnabledForcePartialLoad() - { - $this->assertSqlGeneration( - 'SELECT e FROM Doctrine\Tests\Models\Company\CompanyEmployee e', - 'SELECT c0_.id AS id0, c0_.name AS name1, c1_.salary AS salary2, c1_.department AS department3, c1_.startDate AS startDate4, c0_.discr AS discr5 FROM company_employees c1_ INNER JOIN company_persons c0_ ON c1_.id = c0_.id', - array(Query::HINT_FORCE_PARTIAL_LOAD => true) - ); - } - - /** - * @group DDC-1389 - */ - public function testInheritanceTypeJoinInLeafClassWithDisabledForcePartialLoad() - { - $this->assertSqlGeneration( - 'SELECT m FROM Doctrine\Tests\Models\Company\CompanyManager m', - 'SELECT c0_.id AS id0, c0_.name AS name1, c1_.salary AS salary2, c1_.department AS department3, c1_.startDate AS startDate4, c2_.title AS title5, c0_.discr AS discr6, c0_.spouse_id AS spouse_id7, c2_.car_id AS car_id8 FROM company_managers c2_ INNER JOIN company_employees c1_ ON c2_.id = c1_.id INNER JOIN company_persons c0_ ON c2_.id = c0_.id', - array(Query::HINT_FORCE_PARTIAL_LOAD => false) - ); - } - - /** - * @group DDC-1389 - */ - public function testInheritanceTypeJoinInLeafClassWithEnabledForcePartialLoad() - { - $this->assertSqlGeneration( - 'SELECT m FROM Doctrine\Tests\Models\Company\CompanyManager m', - 'SELECT c0_.id AS id0, c0_.name AS name1, c1_.salary AS salary2, c1_.department AS department3, c1_.startDate AS startDate4, c2_.title AS title5, c0_.discr AS discr6 FROM company_managers c2_ INNER JOIN company_employees c1_ ON c2_.id = c1_.id INNER JOIN company_persons c0_ ON c2_.id = c0_.id', - array(Query::HINT_FORCE_PARTIAL_LOAD => true) - ); - } - - /** - * @group DDC-1389 - */ - public function testInheritanceTypeSingleTableInRootClassWithDisabledForcePartialLoad() - { - $this->assertSqlGeneration( - 'SELECT c FROM Doctrine\Tests\Models\Company\CompanyContract c', - "SELECT c0_.id AS id0, c0_.completed AS completed1, c0_.fixPrice AS fixPrice2, c0_.hoursWorked AS hoursWorked3, c0_.pricePerHour AS pricePerHour4, c0_.maxPrice AS maxPrice5, c0_.discr AS discr6, c0_.salesPerson_id AS salesPerson_id7 FROM company_contracts c0_ WHERE c0_.discr IN ('fix', 'flexible', 'flexultra')", - array(Query::HINT_FORCE_PARTIAL_LOAD => false) - ); - } - - /** - * @group DDC-1389 - */ - public function testInheritanceTypeSingleTableInRootClassWithEnabledForcePartialLoad() - { - $this->assertSqlGeneration( - 'SELECT c FROM Doctrine\Tests\Models\Company\CompanyContract c', - "SELECT c0_.id AS id0, c0_.completed AS completed1, c0_.fixPrice AS fixPrice2, c0_.hoursWorked AS hoursWorked3, c0_.pricePerHour AS pricePerHour4, c0_.maxPrice AS maxPrice5, c0_.discr AS discr6 FROM company_contracts c0_ WHERE c0_.discr IN ('fix', 'flexible', 'flexultra')", - array(Query::HINT_FORCE_PARTIAL_LOAD => true) - ); - } - - /** - * @group DDC-1389 - */ - public function testInheritanceTypeSingleTableInChildClassWithDisabledForcePartialLoad() - { - $this->assertSqlGeneration( - 'SELECT fc FROM Doctrine\Tests\Models\Company\CompanyFlexContract fc', - "SELECT c0_.id AS id0, c0_.completed AS completed1, c0_.hoursWorked AS hoursWorked2, c0_.pricePerHour AS pricePerHour3, c0_.maxPrice AS maxPrice4, c0_.discr AS discr5, c0_.salesPerson_id AS salesPerson_id6 FROM company_contracts c0_ WHERE c0_.discr IN ('flexible', 'flexultra')", - array(Query::HINT_FORCE_PARTIAL_LOAD => false) - ); - } - - /** - * @group DDC-1389 - */ - public function testInheritanceTypeSingleTableInChildClassWithEnabledForcePartialLoad() - { - $this->assertSqlGeneration( - 'SELECT fc FROM Doctrine\Tests\Models\Company\CompanyFlexContract fc', - "SELECT c0_.id AS id0, c0_.completed AS completed1, c0_.hoursWorked AS hoursWorked2, c0_.pricePerHour AS pricePerHour3, c0_.maxPrice AS maxPrice4, c0_.discr AS discr5 FROM company_contracts c0_ WHERE c0_.discr IN ('flexible', 'flexultra')", - array(Query::HINT_FORCE_PARTIAL_LOAD => true) - ); - } - - /** - * @group DDC-1389 - */ - public function testInheritanceTypeSingleTableInLeafClassWithDisabledForcePartialLoad() - { - $this->assertSqlGeneration( - 'SELECT fuc FROM Doctrine\Tests\Models\Company\CompanyFlexUltraContract fuc', - "SELECT c0_.id AS id0, c0_.completed AS completed1, c0_.hoursWorked AS hoursWorked2, c0_.pricePerHour AS pricePerHour3, c0_.maxPrice AS maxPrice4, c0_.discr AS discr5, c0_.salesPerson_id AS salesPerson_id6 FROM company_contracts c0_ WHERE c0_.discr IN ('flexultra')", - array(Query::HINT_FORCE_PARTIAL_LOAD => false) - ); - } - - /** - * @group DDC-1389 - */ - public function testInheritanceTypeSingleTableInLeafClassWithEnabledForcePartialLoad() - { - $this->assertSqlGeneration( - 'SELECT fuc FROM Doctrine\Tests\Models\Company\CompanyFlexUltraContract fuc', - "SELECT c0_.id AS id0, c0_.completed AS completed1, c0_.hoursWorked AS hoursWorked2, c0_.pricePerHour AS pricePerHour3, c0_.maxPrice AS maxPrice4, c0_.discr AS discr5 FROM company_contracts c0_ WHERE c0_.discr IN ('flexultra')", - array(Query::HINT_FORCE_PARTIAL_LOAD => true) - ); - } - - /** - * @group DDC-1161 - */ - public function testSelfReferenceWithOneToOneDoesNotDuplicateAlias() - { - $this->assertSqlGeneration( - 'SELECT p, pp FROM Doctrine\Tests\Models\Company\CompanyPerson p JOIN p.spouse pp', - "SELECT c0_.id AS id0, c0_.name AS name1, c1_.title AS title2, c2_.salary AS salary3, c2_.department AS department4, c2_.startDate AS startDate5, c3_.id AS id6, c3_.name AS name7, c4_.title AS title8, c5_.salary AS salary9, c5_.department AS department10, c5_.startDate AS startDate11, c0_.discr AS discr12, c0_.spouse_id AS spouse_id13, c1_.car_id AS car_id14, c3_.discr AS discr15, c3_.spouse_id AS spouse_id16, c4_.car_id AS car_id17 FROM company_persons c0_ LEFT JOIN company_managers c1_ ON c0_.id = c1_.id LEFT JOIN company_employees c2_ ON c0_.id = c2_.id INNER JOIN company_persons c3_ ON c0_.spouse_id = c3_.id LEFT JOIN company_managers c4_ ON c3_.id = c4_.id LEFT JOIN company_employees c5_ ON c3_.id = c5_.id", - array(Query::HINT_FORCE_PARTIAL_LOAD => false) - ); - } - - /** - * @group DDC-1384 - */ - public function testAliasDoesNotExceedPlatformDefinedLength() - { - $this->assertSqlGeneration( - 'SELECT m FROM ' . __NAMESPACE__ . '\\DDC1384Model m', - "SELECT d0_.aVeryLongIdentifierThatShouldBeShortenedByTheSQLWalker_fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo AS fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo0 FROM DDC1384Model d0_" - ); - } - - /** - * @group DDC-331 - * @group DDC-1384 - */ - public function testIssue331() - { - $this->assertSqlGeneration( - 'SELECT e.name FROM Doctrine\Tests\Models\Company\CompanyEmployee e', - 'SELECT c0_.name AS name0 FROM company_employees c1_ INNER JOIN company_persons c0_ ON c1_.id = c0_.id' - ); - } - /** - * @group DDC-1435 - */ - public function testForeignKeyAsPrimaryKeySubselect() - { - $this->assertSqlGeneration( - "SELECT s FROM Doctrine\Tests\Models\DDC117\DDC117Article s WHERE EXISTS (SELECT r FROM Doctrine\Tests\Models\DDC117\DDC117Reference r WHERE r.source = s)", - "SELECT d0_.article_id AS article_id0, d0_.title AS title1 FROM DDC117Article d0_ WHERE EXISTS (SELECT d1_.source_id, d1_.target_id FROM DDC117Reference d1_ WHERE d1_.source_id = d0_.article_id)" - ); - } - - /** - * @group DDC-1474 - */ - public function testSelectWithArithmeticExpressionBeforeField() - { - $this->assertSqlGeneration( - 'SELECT - e.value AS value, e.id FROM ' . __NAMESPACE__ . '\DDC1474Entity e', - 'SELECT -d0_.value AS sclr0, d0_.id AS id1 FROM DDC1474Entity d0_' - ); - - $this->assertSqlGeneration( - 'SELECT e.id, + e.value AS value FROM ' . __NAMESPACE__ . '\DDC1474Entity e', - 'SELECT d0_.id AS id0, +d0_.value AS sclr1 FROM DDC1474Entity d0_' - ); - } - - /** - * @group DDC-1430 - */ - public function testGroupByAllFieldsWhenObjectHasForeignKeys() - { - $this->assertSqlGeneration( - 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u GROUP BY u', - 'SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ GROUP BY c0_.id, c0_.status, c0_.username, c0_.name, c0_.email_id' - ); - - $this->assertSqlGeneration( - 'SELECT e FROM Doctrine\Tests\Models\CMS\CmsEmployee e GROUP BY e', - 'SELECT c0_.id AS id0, c0_.name AS name1 FROM cms_employees c0_ GROUP BY c0_.id, c0_.name, c0_.spouse_id' - ); - } - - /** - * @group DDC-1236 - */ - public function testGroupBySupportsResultVariable() - { - $this->assertSqlGeneration( - 'SELECT u, u.status AS st FROM Doctrine\Tests\Models\CMS\CmsUser u GROUP BY st', - 'SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3, c0_.status AS status4 FROM cms_users c0_ GROUP BY status4' - ); - } - - /** - * @group DDC-1236 - */ - public function testGroupBySupportsIdentificationVariable() - { - $this->assertSqlGeneration( - 'SELECT u AS user FROM Doctrine\Tests\Models\CMS\CmsUser u GROUP BY user', - 'SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ GROUP BY id0, status1, username2, name3' - ); - } - - /** - * @group DDC-1213 - */ - public function testSupportsBitComparison() - { - $this->assertSqlGeneration( - 'SELECT BIT_OR(4,2), BIT_AND(4,2), u FROM Doctrine\Tests\Models\CMS\CmsUser u', - 'SELECT (4 | 2) AS sclr0, (4 & 2) AS sclr1, c0_.id AS id2, c0_.status AS status3, c0_.username AS username4, c0_.name AS name5 FROM cms_users c0_' - ); - $this->assertSqlGeneration( - 'SELECT BIT_OR(u.id,2), BIT_AND(u.id,2) FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE BIT_OR(u.id,2) > 0', - 'SELECT (c0_.id | 2) AS sclr0, (c0_.id & 2) AS sclr1 FROM cms_users c0_ WHERE (c0_.id | 2) > 0' - ); - $this->assertSqlGeneration( - 'SELECT BIT_OR(u.id,2), BIT_AND(u.id,2) FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE BIT_AND(u.id , 4) > 0', - 'SELECT (c0_.id | 2) AS sclr0, (c0_.id & 2) AS sclr1 FROM cms_users c0_ WHERE (c0_.id & 4) > 0' - ); - $this->assertSqlGeneration( - 'SELECT BIT_OR(u.id,2), BIT_AND(u.id,2) FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE BIT_OR(u.id , 2) > 0 OR BIT_AND(u.id , 4) > 0', - 'SELECT (c0_.id | 2) AS sclr0, (c0_.id & 2) AS sclr1 FROM cms_users c0_ WHERE (c0_.id | 2) > 0 OR (c0_.id & 4) > 0' - ); - } - - /** - * @group DDC-1539 - */ - public function testParenthesesOnTheLeftHandOfComparison() - { - $this->assertSqlGeneration( - 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u where ( (u.id + u.id) * u.id ) > 100', - 'SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ WHERE (c0_.id + c0_.id) * c0_.id > 100' - ); - $this->assertSqlGeneration( - 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u where (u.id + u.id) * u.id > 100', - 'SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ WHERE (c0_.id + c0_.id) * c0_.id > 100' - ); - $this->assertSqlGeneration( - 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u where 100 < (u.id + u.id) * u.id ', - 'SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ WHERE 100 < (c0_.id + c0_.id) * c0_.id' - ); - } - - public function testCustomTypeValueSql() - { - if (DBALType::hasType('negative_to_positive')) { - DBALType::overrideType('negative_to_positive', 'Doctrine\Tests\DbalTypes\NegativeToPositiveType'); - } else { - DBALType::addType('negative_to_positive', 'Doctrine\Tests\DbalTypes\NegativeToPositiveType'); - } - - $this->assertSqlGeneration( - 'SELECT p.customInteger FROM Doctrine\Tests\Models\CustomType\CustomTypeParent p WHERE p.id = 1', - 'SELECT -(c0_.customInteger) AS customInteger0 FROM customtype_parents c0_ WHERE c0_.id = 1' - ); - } - - public function testCustomTypeValueSqlIgnoresIdentifierColumn() - { - if (DBALType::hasType('negative_to_positive')) { - DBALType::overrideType('negative_to_positive', 'Doctrine\Tests\DbalTypes\NegativeToPositiveType'); - } else { - DBALType::addType('negative_to_positive', 'Doctrine\Tests\DbalTypes\NegativeToPositiveType'); - } - - $this->assertSqlGeneration( - 'SELECT p.id FROM Doctrine\Tests\Models\CustomType\CustomTypeParent p WHERE p.id = 1', - 'SELECT c0_.id AS id0 FROM customtype_parents c0_ WHERE c0_.id = 1' - ); - } - - public function testCustomTypeValueSqlForAllFields() - { - if (DBALType::hasType('negative_to_positive')) { - DBALType::overrideType('negative_to_positive', 'Doctrine\Tests\DbalTypes\NegativeToPositiveType'); - } else { - DBALType::addType('negative_to_positive', 'Doctrine\Tests\DbalTypes\NegativeToPositiveType'); - } - - $this->assertSqlGeneration( - 'SELECT p FROM Doctrine\Tests\Models\CustomType\CustomTypeParent p', - 'SELECT c0_.id AS id0, -(c0_.customInteger) AS customInteger1 FROM customtype_parents c0_' - ); - } - - public function testCustomTypeValueSqlForPartialObject() - { - if (DBALType::hasType('negative_to_positive')) { - DBALType::overrideType('negative_to_positive', 'Doctrine\Tests\DbalTypes\NegativeToPositiveType'); - } else { - DBALType::addType('negative_to_positive', 'Doctrine\Tests\DbalTypes\NegativeToPositiveType'); - } - - $this->assertSqlGeneration( - 'SELECT partial p.{id, customInteger} FROM Doctrine\Tests\Models\CustomType\CustomTypeParent p', - 'SELECT c0_.id AS id0, -(c0_.customInteger) AS customInteger1 FROM customtype_parents c0_' - ); - } -} - - -class MyAbsFunction extends \Doctrine\ORM\Query\AST\Functions\FunctionNode -{ - public $simpleArithmeticExpression; - - /** - * @override - */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) - { - return 'ABS(' . $sqlWalker->walkSimpleArithmeticExpression($this->simpleArithmeticExpression) . ')'; - } - - /** - * @override - */ - public function parse(\Doctrine\ORM\Query\Parser $parser) - { - $lexer = $parser->getLexer(); - - $parser->match(\Doctrine\ORM\Query\Lexer::T_IDENTIFIER); - $parser->match(\Doctrine\ORM\Query\Lexer::T_OPEN_PARENTHESIS); - - $this->simpleArithmeticExpression = $parser->SimpleArithmeticExpression(); - - $parser->match(\Doctrine\ORM\Query\Lexer::T_CLOSE_PARENTHESIS); - } -} -/** - * @Entity - */ -class DDC1384Model -{ - /** - * @Id - * @Column(type="integer") - * @GeneratedValue - */ - protected $aVeryLongIdentifierThatShouldBeShortenedByTheSQLWalker_fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo; -} - - -/** - * @Entity - */ -class DDC1474Entity -{ - - /** - * @Id - * @Column(type="integer") - * @GeneratedValue() - */ - protected $id; - - /** - * @column(type="float") - */ - private $value; - - /** - * @param string $float - */ - public function __construct($float) - { - $this->value = $float; - } - - /** - * @return integer - */ - public function getId() - { - return $this->id; - } - - /** - * @return float - */ - public function getValue() - { - return $this->value; - } - - /** - * @param float $value - */ - public function setValue($value) - { - $this->value = $value; - } - -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/UpdateSqlGenerationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/UpdateSqlGenerationTest.php deleted file mode 100644 index a65efe0..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/UpdateSqlGenerationTest.php +++ /dev/null @@ -1,205 +0,0 @@ -. - */ - -namespace Doctrine\Tests\ORM\Query; - -use Doctrine\DBAL\Types\Type as DBALType; - -require_once __DIR__ . '/../../TestInit.php'; - -/** - * Test case for testing the saving and referencing of query identifiers. - * - * @author Guilherme Blanco - * @author Janne Vanhala - * @author Konsta Vesterinen - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link http://www.phpdoctrine.org - * @since 2.0 - * @version $Revision$ - * @todo 1) [romanb] We might want to split the SQL generation tests into multiple - * testcases later since we'll have a lot of them and we might want to have special SQL - * generation tests for some dbms specific SQL syntaxes. - */ -class UpdateSqlGenerationTest extends \Doctrine\Tests\OrmTestCase -{ - private $_em; - - protected function setUp() { - if (DBALType::hasType('negative_to_positive')) { - DBALType::overrideType('negative_to_positive', 'Doctrine\Tests\DbalTypes\NegativeToPositiveType'); - } else { - DBALType::addType('negative_to_positive', 'Doctrine\Tests\DbalTypes\NegativeToPositiveType'); - } - - $this->_em = $this->_getTestEntityManager(); - } - - public function assertSqlGeneration($dqlToBeTested, $sqlToBeConfirmed) - { - try { - $query = $this->_em->createQuery($dqlToBeTested); - parent::assertEquals($sqlToBeConfirmed, $query->getSql()); - $query->free(); - } catch (\Exception $e) { - $this->fail($e->getMessage()); - } - } - - public function testSupportsQueriesWithoutWhere() - { - $this->assertSqlGeneration( - 'UPDATE Doctrine\Tests\Models\CMS\CmsUser u SET u.name = ?1', - 'UPDATE cms_users SET name = ?' - ); - } - - public function testSupportsMultipleFieldsWithoutWhere() - { - $this->assertSqlGeneration( - 'UPDATE Doctrine\Tests\Models\CMS\CmsUser u SET u.name = ?1, u.username = ?2', - 'UPDATE cms_users SET name = ?, username = ?' - ); - } - - public function testSupportsWhereClauses() - { - $this->assertSqlGeneration( - 'UPDATE Doctrine\Tests\Models\CMS\CmsUser u SET u.name = ?1 WHERE u.id = ?2', - 'UPDATE cms_users SET name = ? WHERE id = ?' - ); - } - - public function testSupportsWhereClausesOnTheUpdatedField() - { - $this->assertSqlGeneration( - 'UPDATE Doctrine\Tests\Models\CMS\CmsUser u SET u.name = ?1 WHERE u.name = ?2', - 'UPDATE cms_users SET name = ? WHERE name = ?' - ); - } - - public function testSupportsMultipleWhereClause() - { - $this->assertSqlGeneration( - 'UPDATE Doctrine\Tests\Models\CMS\CmsUser u SET u.name = ?1 WHERE u.name = ?2 AND u.status = ?3', - 'UPDATE cms_users SET name = ? WHERE name = ? AND status = ?' - ); - } - - public function testSupportsInClause() - { - $this->assertSqlGeneration( - 'UPDATE Doctrine\Tests\Models\CMS\CmsUser u SET u.name = ?1 WHERE u.id IN (1, 3, 4)', - 'UPDATE cms_users SET name = ? WHERE id IN (1, 3, 4)' - ); - } - - public function testSupportsParametrizedInClause() - { - $this->assertSqlGeneration( - 'UPDATE Doctrine\Tests\Models\CMS\CmsUser u SET u.name = ?1 WHERE u.id IN (?2, ?3, ?4)', - 'UPDATE cms_users SET name = ? WHERE id IN (?, ?, ?)' - ); - } - - public function testSupportsNotInClause() - { - $this->assertSqlGeneration( - 'UPDATE Doctrine\Tests\Models\CMS\CmsUser u SET u.name = ?1 WHERE u.id NOT IN (1, 3, 4)', - 'UPDATE cms_users SET name = ? WHERE id NOT IN (1, 3, 4)' - ); - } - - public function testSupportsGreatherThanClause() - { - $this->assertSqlGeneration( - 'UPDATE Doctrine\Tests\Models\CMS\CmsUser u SET u.status = ?1 WHERE u.id > ?2', - 'UPDATE cms_users SET status = ? WHERE id > ?' - ); - } - - public function testSupportsGreatherThanOrEqualToClause() - { - $this->assertSqlGeneration( - 'UPDATE Doctrine\Tests\Models\CMS\CmsUser u SET u.status = ?1 WHERE u.id >= ?2', - 'UPDATE cms_users SET status = ? WHERE id >= ?' - ); - } - - public function testSupportsLessThanClause() - { - $this->assertSqlGeneration( - 'UPDATE Doctrine\Tests\Models\CMS\CmsUser u SET u.status = ?1 WHERE u.id < ?2', - 'UPDATE cms_users SET status = ? WHERE id < ?' - ); - } - - public function testSupportsLessThanOrEqualToClause() - { - $this->assertSqlGeneration( - 'UPDATE Doctrine\Tests\Models\CMS\CmsUser u SET u.status = ?1 WHERE u.id <= ?2', - 'UPDATE cms_users SET status = ? WHERE id <= ?' - ); - } - - public function testSupportsBetweenClause() - { - $this->assertSqlGeneration( - 'UPDATE Doctrine\Tests\Models\CMS\CmsUser u SET u.status = ?1 WHERE u.id BETWEEN :from AND :to', - 'UPDATE cms_users SET status = ? WHERE id BETWEEN ? AND ?' - ); - } - - public function testSingleValuedAssociationFieldInWhere() - { - $this->assertSqlGeneration( - "UPDATE Doctrine\Tests\Models\CMS\CmsPhonenumber p SET p.phonenumber = 1234 WHERE p.user = ?1", - "UPDATE cms_phonenumbers SET phonenumber = 1234 WHERE user_id = ?" - ); - } - - public function testSingleValuedAssociationFieldInSetClause() - { - $this->assertSqlGeneration( - "update Doctrine\Tests\Models\CMS\CmsComment c set c.article = null where c.article=?1", - "UPDATE cms_comments SET article_id = NULL WHERE article_id = ?" - ); - } - - /** - * @group DDC-980 - */ - public function testSubselectTableAliasReferencing() - { - $this->assertSqlGeneration( - "UPDATE Doctrine\Tests\Models\CMS\CmsUser u SET u.status = 'inactive' WHERE SIZE(u.groups) = 10", - "UPDATE cms_users SET status = 'inactive' WHERE (SELECT COUNT(*) FROM cms_users_groups c0_ WHERE c0_.user_id = cms_users.id) = 10" - ); - } - - public function testCustomTypeValueSqlCompletelyIgnoredInUpdateStatements() - { - $this->assertSqlGeneration( - 'UPDATE Doctrine\Tests\Models\CustomType\CustomTypeParent p SET p.customInteger = 1 WHERE p.id = 1', - 'UPDATE customtype_parents SET customInteger = 1 WHERE id = 1' - ); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/QueryBuilderTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/QueryBuilderTest.php deleted file mode 100644 index f078b89..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/QueryBuilderTest.php +++ /dev/null @@ -1,748 +0,0 @@ -. - */ - -namespace Doctrine\Tests\ORM; - -use Doctrine\ORM\QueryBuilder, - Doctrine\ORM\Query\Expr; - -require_once __DIR__ . '/../TestInit.php'; - -/** - * Test case for the QueryBuilder class used to build DQL query string in a - * object oriented way. - * - * @author Jonathan H. Wage - * @author Roman Borschel _em = $this->_getTestEntityManager(); - } - - protected function assertValidQueryBuilder(QueryBuilder $qb, $expectedDql) - { - $dql = $qb->getDql(); - $q = $qb->getQuery(); - - $this->assertEquals($expectedDql, $dql); - } - - public function testSelectSetsType() - { - $qb = $this->_em->createQueryBuilder() - ->delete('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->select('u.id', 'u.username'); - - $this->assertEquals($qb->getType(), QueryBuilder::SELECT); - } - - public function testEmptySelectSetsType() - { - $qb = $this->_em->createQueryBuilder() - ->delete('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->select(); - - $this->assertEquals($qb->getType(), QueryBuilder::SELECT); - } - - public function testDeleteSetsType() - { - $qb = $this->_em->createQueryBuilder() - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->delete(); - - $this->assertEquals($qb->getType(), QueryBuilder::DELETE); - } - - public function testUpdateSetsType() - { - $qb = $this->_em->createQueryBuilder() - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->update(); - - $this->assertEquals($qb->getType(), QueryBuilder::UPDATE); - } - - public function testSimpleSelect() - { - $qb = $this->_em->createQueryBuilder() - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->select('u.id', 'u.username'); - - $this->assertValidQueryBuilder($qb, 'SELECT u.id, u.username FROM Doctrine\Tests\Models\CMS\CmsUser u'); - } - - public function testSimpleDelete() - { - $qb = $this->_em->createQueryBuilder() - ->delete('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - - $this->assertValidQueryBuilder($qb, 'DELETE Doctrine\Tests\Models\CMS\CmsUser u'); - } - - public function testSimpleUpdate() - { - $qb = $this->_em->createQueryBuilder() - ->update('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->set('u.username', ':username'); - - $this->assertValidQueryBuilder($qb, 'UPDATE Doctrine\Tests\Models\CMS\CmsUser u SET u.username = :username'); - } - - public function testInnerJoin() - { - $qb = $this->_em->createQueryBuilder() - ->select('u', 'a') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->innerJoin('u.articles', 'a'); - - $this->assertValidQueryBuilder($qb, 'SELECT u, a FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.articles a'); - } - - public function testComplexInnerJoin() - { - $qb = $this->_em->createQueryBuilder() - ->select('u', 'a') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->innerJoin('u.articles', 'a', 'ON', 'u.id = a.author_id'); - - $this->assertValidQueryBuilder( - $qb, - 'SELECT u, a FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.articles a ON u.id = a.author_id' - ); - } - - public function testLeftJoin() - { - $qb = $this->_em->createQueryBuilder() - ->select('u', 'a') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->leftJoin('u.articles', 'a'); - - $this->assertValidQueryBuilder($qb, 'SELECT u, a FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.articles a'); - } - - public function testLeftJoinWithIndexBy() - { - $qb = $this->_em->createQueryBuilder() - ->select('u', 'a') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->leftJoin('u.articles', 'a', null, null, 'a.name'); - - $this->assertValidQueryBuilder($qb, 'SELECT u, a FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.articles a INDEX BY a.name'); - } - - public function testMultipleFrom() - { - $qb = $this->_em->createQueryBuilder() - ->select('u', 'g') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->from('Doctrine\Tests\Models\CMS\CmsGroup', 'g'); - - $this->assertValidQueryBuilder($qb, 'SELECT u, g FROM Doctrine\Tests\Models\CMS\CmsUser u, Doctrine\Tests\Models\CMS\CmsGroup g'); - } - - public function testMultipleFromWithJoin() - { - $qb = $this->_em->createQueryBuilder() - ->select('u', 'g') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->from('Doctrine\Tests\Models\CMS\CmsGroup', 'g') - ->innerJoin('u.articles', 'a', 'ON', 'u.id = a.author_id'); - - $this->assertValidQueryBuilder($qb, 'SELECT u, g FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.articles a ON u.id = a.author_id, Doctrine\Tests\Models\CMS\CmsGroup g'); - } - - public function testMultipleFromWithMultipleJoin() - { - $qb = $this->_em->createQueryBuilder() - ->select('u', 'g') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->from('Doctrine\Tests\Models\CMS\CmsArticle', 'a') - ->innerJoin('u.groups', 'g') - ->leftJoin('u.address', 'ad') - ->innerJoin('a.comments', 'c'); - - $this->assertValidQueryBuilder($qb, 'SELECT u, g FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.groups g LEFT JOIN u.address ad, Doctrine\Tests\Models\CMS\CmsArticle a INNER JOIN a.comments c'); - } - - public function testWhere() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where('u.id = :uid'); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid'); - } - - public function testComplexAndWhere() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where('u.id = :uid OR u.id = :uid2 OR u.id = :uid3') - ->andWhere('u.name = :name'); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE (u.id = :uid OR u.id = :uid2 OR u.id = :uid3) AND u.name = :name'); - } - - public function testAndWhere() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where('u.id = :uid') - ->andWhere('u.id = :uid2'); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid AND u.id = :uid2'); - } - - public function testOrWhere() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where('u.id = :uid') - ->orWhere('u.id = :uid2'); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid OR u.id = :uid2'); - } - - public function testComplexAndWhereOrWhereNesting() - { - $qb = $this->_em->createQueryBuilder(); - $qb->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where('u.id = :uid') - ->orWhere('u.id = :uid2') - ->andWhere('u.id = :uid3') - ->orWhere('u.name = :name1', 'u.name = :name2') - ->andWhere('u.name <> :noname'); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE (((u.id = :uid OR u.id = :uid2) AND u.id = :uid3) OR u.name = :name1 OR u.name = :name2) AND u.name <> :noname'); - } - - public function testAndWhereIn() - { - $qb = $this->_em->createQueryBuilder(); - $qb->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where('u.id = :uid') - ->andWhere($qb->expr()->in('u.id', array(1, 2, 3))); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid AND u.id IN(1, 2, 3)'); - } - - public function testOrWhereIn() - { - $qb = $this->_em->createQueryBuilder(); - $qb->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where('u.id = :uid') - ->orWhere($qb->expr()->in('u.id', array(1, 2, 3))); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid OR u.id IN(1, 2, 3)'); - } - - public function testAndWhereNotIn() - { - $qb = $this->_em->createQueryBuilder(); - $qb->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where('u.id = :uid') - ->andWhere($qb->expr()->notIn('u.id', array(1, 2, 3))); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid AND u.id NOT IN(1, 2, 3)'); - } - - public function testOrWhereNotIn() - { - $qb = $this->_em->createQueryBuilder(); - $qb->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where('u.id = :uid') - ->orWhere($qb->expr()->notIn('u.id', array(1, 2, 3))); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid OR u.id NOT IN(1, 2, 3)'); - } - - public function testGroupBy() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->groupBy('u.id') - ->addGroupBy('u.username'); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u GROUP BY u.id, u.username'); - } - - public function testHaving() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->groupBy('u.id') - ->having('COUNT(u.id) > 1'); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u GROUP BY u.id HAVING COUNT(u.id) > 1'); - } - - public function testAndHaving() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->groupBy('u.id') - ->having('COUNT(u.id) > 1') - ->andHaving('COUNT(u.id) < 1'); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u GROUP BY u.id HAVING COUNT(u.id) > 1 AND COUNT(u.id) < 1'); - } - - public function testOrHaving() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->groupBy('u.id') - ->having('COUNT(u.id) > 1') - ->andHaving('COUNT(u.id) < 1') - ->orHaving('COUNT(u.id) > 1'); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u GROUP BY u.id HAVING (COUNT(u.id) > 1 AND COUNT(u.id) < 1) OR COUNT(u.id) > 1'); - } - - public function testOrderBy() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->orderBy('u.username', 'ASC'); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u ORDER BY u.username ASC'); - } - - public function testOrderByWithExpression() - { - $qb = $this->_em->createQueryBuilder(); - $qb->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->orderBy($qb->expr()->asc('u.username')); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u ORDER BY u.username ASC'); - } - - public function testAddOrderBy() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->orderBy('u.username', 'ASC') - ->addOrderBy('u.username', 'DESC'); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u ORDER BY u.username ASC, u.username DESC'); - } - - public function testGetQuery() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $q = $qb->getQuery(); - - $this->assertEquals('Doctrine\ORM\Query', get_class($q)); - } - - public function testSetParameter() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where('u.id = :id') - ->setParameter('id', 1); - - $this->assertEquals(array('id' => 1), $qb->getParameters()); - } - - public function testSetParameters() - { - $qb = $this->_em->createQueryBuilder(); - $qb->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where($qb->expr()->orx('u.username = :username', 'u.username = :username2')); - - $qb->setParameters(array('username' => 'jwage', 'username2' => 'jonwage')); - - $this->assertEquals(array('username' => 'jwage', 'username2' => 'jonwage'), $qb->getQuery()->getParameters()); - } - - - public function testGetParameters() - { - $qb = $this->_em->createQueryBuilder(); - $qb->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where('u.id = :id'); - - $qb->setParameters(array('id' => 1)); - $this->assertEquals(array('id' => 1), $qb->getParameters()); - } - - public function testGetParameter() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where('u.id = :id'); - - $qb->setParameters(array('id' => 1)); - $this->assertEquals(1, $qb->getParameter('id')); - } - - public function testMultipleWhere() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where('u.id = :uid', 'u.id = :uid2'); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid AND u.id = :uid2'); - } - - public function testMultipleAndWhere() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->andWhere('u.id = :uid', 'u.id = :uid2'); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid AND u.id = :uid2'); - } - - public function testMultipleOrWhere() - { - $qb = $this->_em->createQueryBuilder(); - $qb->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->orWhere('u.id = :uid', $qb->expr()->eq('u.id', ':uid2')); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid OR u.id = :uid2'); - } - - public function testComplexWhere() - { - $qb = $this->_em->createQueryBuilder(); - $orExpr = $qb->expr()->orX(); - $orExpr->add($qb->expr()->eq('u.id', ':uid3')); - $orExpr->add($qb->expr()->in('u.id', array(1))); - - $qb->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where($orExpr); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid3 OR u.id IN(1)'); - } - - public function testWhereInWithStringLiterals() - { - $qb = $this->_em->createQueryBuilder(); - $qb->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where($qb->expr()->in('u.name', array('one', 'two', 'three'))); - - $this->assertValidQueryBuilder($qb, "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name IN('one', 'two', 'three')"); - - $qb->where($qb->expr()->in('u.name', array("O'Reilly", "O'Neil", 'Smith'))); - - $this->assertValidQueryBuilder($qb, "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name IN('O''Reilly', 'O''Neil', 'Smith')"); - } - - public function testWhereInWithObjectLiterals() - { - $qb = $this->_em->createQueryBuilder(); - $expr = $this->_em->getExpressionBuilder(); - $qb->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where($expr->in('u.name', array($expr->literal('one'), $expr->literal('two'), $expr->literal('three')))); - - $this->assertValidQueryBuilder($qb, "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name IN('one', 'two', 'three')"); - - $qb->where($expr->in('u.name', array($expr->literal("O'Reilly"), $expr->literal("O'Neil"), $expr->literal('Smith')))); - - $this->assertValidQueryBuilder($qb, "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name IN('O''Reilly', 'O''Neil', 'Smith')"); - } - - public function testNegation() - { - $expr = $this->_em->getExpressionBuilder(); - $orExpr = $expr->orX(); - $orExpr->add($expr->eq('u.id', ':uid3')); - $orExpr->add($expr->not($expr->in('u.id', array(1)))); - - $qb = $this->_em->createQueryBuilder(); - $qb->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where($orExpr); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid3 OR NOT(u.id IN(1))'); - } - - public function testSomeAllAny() - { - $qb = $this->_em->createQueryBuilder(); - $expr = $this->_em->getExpressionBuilder(); - - //$subquery = $qb->subquery('Doctrine\Tests\Models\CMS\CmsArticle', 'a')->select('a.id'); - - $qb->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where($expr->gt('u.id', $expr->all('select a.id from Doctrine\Tests\Models\CMS\CmsArticle a'))); - - $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id > ALL(select a.id from Doctrine\Tests\Models\CMS\CmsArticle a)'); - - } - - public function testMultipleIsolatedQueryConstruction() - { - $qb = $this->_em->createQueryBuilder(); - $expr = $this->_em->getExpressionBuilder(); - - $qb->select('u')->from('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - $qb->where($expr->eq('u.name', ':name')); - $qb->setParameter('name', 'romanb'); - - $q1 = $qb->getQuery(); - $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name = :name', $q1->getDql()); - $this->assertEquals(1, count($q1->getParameters())); - - // add another condition and construct a second query - $qb->andWhere($expr->eq('u.id', ':id')); - $qb->setParameter('id', 42); - - $q2 = $qb->getQuery(); - - $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name = :name AND u.id = :id', $q2->getDql()); - $this->assertTrue($q1 !== $q2); // two different, independent queries - $this->assertEquals(2, count($q2->getParameters())); - $this->assertEquals(1, count($q1->getParameters())); // $q1 unaffected - } - - public function testGetEntityManager() - { - $qb = $this->_em->createQueryBuilder(); - $this->assertEquals($this->_em, $qb->getEntityManager()); - } - - public function testInitialStateIsClean() - { - $qb = $this->_em->createQueryBuilder(); - $this->assertEquals(QueryBuilder::STATE_CLEAN, $qb->getState()); - } - - public function testAlteringQueryChangesStateToDirty() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - - $this->assertEquals(QueryBuilder::STATE_DIRTY, $qb->getState()); - } - - public function testSelectWithFuncExpression() - { - $qb = $this->_em->createQueryBuilder(); - $expr = $qb->expr(); - $qb->select($expr->count('e.id')); - - $this->assertValidQueryBuilder($qb, 'SELECT COUNT(e.id)'); - } - - public function testResetDQLPart() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where('u.username = ?1')->orderBy('u.username'); - - $this->assertEquals('u.username = ?1', (string)$qb->getDQLPart('where')); - $this->assertEquals(1, count($qb->getDQLPart('orderBy'))); - - $qb->resetDqlPart('where')->resetDqlPart('orderBy'); - - $this->assertNull($qb->getDQLPart('where')); - $this->assertEquals(0, count($qb->getDQLPart('orderBy'))); - } - - public function testResetDQLParts() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where('u.username = ?1')->orderBy('u.username'); - - $qb->resetDQLParts(array('where', 'orderBy')); - - $this->assertEquals(1, count($qb->getDQLPart('select'))); - $this->assertNull($qb->getDQLPart('where')); - $this->assertEquals(0, count($qb->getDQLPart('orderBy'))); - } - - public function testResetAllDQLParts() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where('u.username = ?1')->orderBy('u.username'); - - $qb->resetDQLParts(); - - $this->assertEquals(0, count($qb->getDQLPart('select'))); - $this->assertNull($qb->getDQLPart('where')); - $this->assertEquals(0, count($qb->getDQLPart('orderBy'))); - } - - /** - * @group DDC-867 - */ - public function testDeepClone() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->andWhere('u.username = ?1') - ->andWhere('u.status = ?2'); - - $expr = $qb->getDQLPart('where'); - $this->assertEquals(2, $expr->count(), "Modifying the second query should affect the first one."); - - $qb2 = clone $qb; - $qb2->andWhere('u.name = ?3'); - - $this->assertEquals(2, $expr->count(), "Modifying the second query should affect the first one."); - } - - public function testGetRootAlias() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - - $this->assertEquals('u', $qb->getRootAlias()); - } - - public function testGetRootAliases() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - - $this->assertEquals(array('u'), $qb->getRootAliases()); - } - - public function testGetRootEntities() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - - $this->assertEquals(array('Doctrine\Tests\Models\CMS\CmsUser'), $qb->getRootEntities()); - } - - public function testGetSeveralRootAliases() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u2'); - - $this->assertEquals(array('u', 'u2'), $qb->getRootAliases()); - $this->assertEquals('u', $qb->getRootAlias()); - } - - public function testBCAddJoinWithoutRootAlias() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->add('join', array('INNER JOIN u.groups g'), true); - - $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.groups g', $qb->getDQL()); - } - - /** - * @group DDC-1211 - */ - public function testEmptyStringLiteral() - { - $expr = $this->_em->getExpressionBuilder(); - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where($expr->eq('u.username', $expr->literal(""))); - - $this->assertEquals("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username = ''", $qb->getDQL()); - } - - /** - * @group DDC-1211 - */ - public function testEmptyNumericLiteral() - { - $expr = $this->_em->getExpressionBuilder(); - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where($expr->eq('u.username', $expr->literal(0))); - - $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username = 0', $qb->getDQL()); - } - - /** - * @group DDC-1227 - */ - public function testAddFromString() - { - $qb = $this->_em->createQueryBuilder() - ->add('select', 'u') - ->add('from', 'Doctrine\Tests\Models\CMS\CmsUser u'); - - $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u', $qb->getDQL()); - } - - /** - * @group DDC-1619 - */ - public function testAddDistinct() - { - $qb = $this->_em->createQueryBuilder() - ->select('u') - ->distinct() - ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u'); - - $this->assertEquals('SELECT DISTINCT u FROM Doctrine\Tests\Models\CMS\CmsUser u', $qb->getDQL()); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommandTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommandTest.php deleted file mode 100644 index a170731..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommandTest.php +++ /dev/null @@ -1,23 +0,0 @@ -getMock('Doctrine\ORM\Tools\EntityGenerator'); - $metadataExporter = $this->getMock('Doctrine\ORM\Tools\Export\ClassMetadataExporter'); - $command = new ConvertDoctrine1SchemaCommand(); - $command->setEntityGenerator($entityGenerator); - - $output = $this->getMock('Symfony\Component\Console\Output\OutputInterface'); - $output->expects($this->once()) - ->method('write') - ->with($this->equalTo('No Metadata Classes to process.' . PHP_EOL)); - - $command->convertDoctrine1Schema($this->_getTestEntityManager(), array(), sys_get_temp_dir(), 'annotation', 4, null, $output); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/ConvertDoctrine1SchemaTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/ConvertDoctrine1SchemaTest.php deleted file mode 100644 index c0af3a7..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/ConvertDoctrine1SchemaTest.php +++ /dev/null @@ -1,108 +0,0 @@ -. - */ - -namespace Doctrine\Tests\ORM\Tools; - -use Doctrine\ORM\Tools\Export\ClassMetadataExporter; -use Doctrine\ORM\Tools\ConvertDoctrine1Schema; -use Doctrine\Tests\Mocks\MetadataDriverMock; -use Doctrine\Tests\Mocks\DatabasePlatformMock; -use Doctrine\Tests\Mocks\EntityManagerMock; -use Doctrine\Tests\Mocks\ConnectionMock; -use Doctrine\Tests\Mocks\DriverMock; -use Doctrine\Common\EventManager; -use Doctrine\ORM\Tools\DisconnectedClassMetadataFactory; - -require_once __DIR__ . '/../../TestInit.php'; - -/** - * Test case for converting a Doctrine 1 style schema to Doctrine 2 mapping files - * - * @author Jonathan H. Wage - * @author Roman Borschel setProxyDir(__DIR__ . '/../../Proxies'); - $config->setProxyNamespace('Doctrine\Tests\Proxies'); - $eventManager = new EventManager(); - $conn = new ConnectionMock(array(), $driverMock, $config, $eventManager); - $mockDriver = new MetadataDriverMock(); - $config->setMetadataDriverImpl($metadataDriver); - - return EntityManagerMock::create($conn, $config, $eventManager); - } - - public function testTest() - { - if ( ! class_exists('Symfony\Component\Yaml\Yaml', true)) { - $this->markTestSkipped('Please install Symfony YAML Component into the include path of your PHP installation.'); - } - - $cme = new ClassMetadataExporter(); - $converter = new ConvertDoctrine1Schema(__DIR__ . '/doctrine1schema'); - - $exporter = $cme->getExporter('yml', __DIR__ . '/convert'); - $exporter->setOverwriteExistingFiles(true); - $exporter->setMetadata($converter->getMetadata()); - $exporter->export(); - - $this->assertTrue(file_exists(__DIR__ . '/convert/User.dcm.yml')); - $this->assertTrue(file_exists(__DIR__ . '/convert/Profile.dcm.yml')); - - $metadataDriver = new \Doctrine\ORM\Mapping\Driver\YamlDriver(__DIR__ . '/convert'); - $em = $this->_createEntityManager($metadataDriver); - $cmf = new DisconnectedClassMetadataFactory(); - $cmf->setEntityManager($em); - $metadata = $cmf->getAllMetadata(); - $profileClass = $cmf->getMetadataFor('Profile'); - $userClass = $cmf->getMetadataFor('User'); - - $this->assertEquals(2, count($metadata)); - $this->assertEquals('Profile', $profileClass->name); - $this->assertEquals('User', $userClass->name); - $this->assertEquals(4, count($profileClass->fieldMappings)); - $this->assertEquals(5, count($userClass->fieldMappings)); - $this->assertEquals('text', $userClass->fieldMappings['clob']['type']); - $this->assertEquals('test_alias', $userClass->fieldMappings['theAlias']['columnName']); - $this->assertEquals('theAlias', $userClass->fieldMappings['theAlias']['fieldName']); - - $this->assertEquals('Profile', $profileClass->associationMappings['User']['sourceEntity']); - $this->assertEquals('User', $profileClass->associationMappings['User']['targetEntity']); - - $this->assertEquals('username', $userClass->table['uniqueConstraints']['username']['columns'][0]); - } - - public function tearDown() - { - @unlink(__DIR__ . '/convert/User.dcm.yml'); - @unlink(__DIR__ . '/convert/Profile.dcm.yml'); - @rmdir(__DIR__ . '/convert'); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php deleted file mode 100644 index 185c7f9..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php +++ /dev/null @@ -1,294 +0,0 @@ -_namespace = uniqid("doctrine_"); - $this->_tmpDir = \sys_get_temp_dir(); - \mkdir($this->_tmpDir . \DIRECTORY_SEPARATOR . $this->_namespace); - $this->_generator = new EntityGenerator(); - $this->_generator->setAnnotationPrefix(""); - $this->_generator->setGenerateAnnotations(true); - $this->_generator->setGenerateStubMethods(true); - $this->_generator->setRegenerateEntityIfExists(false); - $this->_generator->setUpdateEntityIfExists(true); - } - - public function tearDown() - { - $ri = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->_tmpDir . '/' . $this->_namespace)); - foreach ($ri AS $file) { - /* @var $file \SplFileInfo */ - if ($file->isFile()) { - \unlink($file->getPathname()); - } - } - rmdir($this->_tmpDir . '/' . $this->_namespace); - } - - public function generateBookEntityFixture() - { - $metadata = new ClassMetadataInfo($this->_namespace . '\EntityGeneratorBook'); - $metadata->namespace = $this->_namespace; - $metadata->customRepositoryClassName = $this->_namespace . '\EntityGeneratorBookRepository'; - - $metadata->table['name'] = 'book'; - $metadata->table['uniqueConstraints']['name_uniq'] = array('columns' => array('name')); - $metadata->table['indexes']['status_idx'] = array('columns' => array('status')); - $metadata->mapField(array('fieldName' => 'name', 'type' => 'string')); - $metadata->mapField(array('fieldName' => 'status', 'type' => 'string', 'default' => 'published')); - $metadata->mapField(array('fieldName' => 'id', 'type' => 'integer', 'id' => true)); - $metadata->mapOneToOne(array('fieldName' => 'author', 'targetEntity' => 'Doctrine\Tests\ORM\Tools\EntityGeneratorAuthor', 'mappedBy' => 'book')); - $joinColumns = array( - array('name' => 'author_id', 'referencedColumnName' => 'id') - ); - $metadata->mapManyToMany(array( - 'fieldName' => 'comments', - 'targetEntity' => 'Doctrine\Tests\ORM\Tools\EntityGeneratorComment', - 'joinTable' => array( - 'name' => 'book_comment', - 'joinColumns' => array(array('name' => 'book_id', 'referencedColumnName' => 'id')), - 'inverseJoinColumns' => array(array('name' => 'comment_id', 'referencedColumnName' => 'id')), - ), - )); - $metadata->addLifecycleCallback('loading', 'postLoad'); - $metadata->addLifecycleCallback('willBeRemoved', 'preRemove'); - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); - - $this->_generator->writeEntityClass($metadata, $this->_tmpDir); - - return $metadata; - } - - /** - * @param ClassMetadataInfo $metadata - * @return EntityGeneratorBook - */ - public function newInstance($metadata) - { - $path = $this->_tmpDir . '/'. $this->_namespace . '/EntityGeneratorBook.php'; - $this->assertFileExists($path); - require_once $path; - - return new $metadata->name; - } - - public function testGeneratedEntityClass() - { - $metadata = $this->generateBookEntityFixture(); - - $book = $this->newInstance($metadata); - - $this->assertTrue(class_exists($metadata->name), "Class does not exist."); - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', '__construct'), "EntityGeneratorBook::__construct() missing."); - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'getId'), "EntityGeneratorBook::getId() missing."); - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'setName'), "EntityGeneratorBook::setName() missing."); - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'getName'), "EntityGeneratorBook::getName() missing."); - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'setAuthor'), "EntityGeneratorBook::setAuthor() missing."); - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'getAuthor'), "EntityGeneratorBook::getAuthor() missing."); - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'getComments'), "EntityGeneratorBook::getComments() missing."); - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'addComment'), "EntityGeneratorBook::addComment() missing."); - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'removeComment'), "EntityGeneratorBook::removeComment() missing."); - - $this->assertEquals('published', $book->getStatus()); - - $book->setName('Jonathan H. Wage'); - $this->assertEquals('Jonathan H. Wage', $book->getName()); - - $author = new EntityGeneratorAuthor(); - $book->setAuthor($author); - $this->assertEquals($author, $book->getAuthor()); - - $comment = new EntityGeneratorComment(); - $book->addComment($comment); - $this->assertInstanceOf('Doctrine\Common\Collections\ArrayCollection', $book->getComments()); - $this->assertEquals(new \Doctrine\Common\Collections\ArrayCollection(array($comment)), $book->getComments()); - $book->removeComment($comment); - $this->assertEquals(new \Doctrine\Common\Collections\ArrayCollection(array()), $book->getComments()); - } - - public function testEntityUpdatingWorks() - { - $metadata = $this->generateBookEntityFixture(); - $metadata->mapField(array('fieldName' => 'test', 'type' => 'string')); - - $this->_generator->writeEntityClass($metadata, $this->_tmpDir); - - $this->assertFileExists($this->_tmpDir . "/" . $this->_namespace . "/EntityGeneratorBook.php~"); - - $book = $this->newInstance($metadata); - $reflClass = new \ReflectionClass($metadata->name); - - $this->assertTrue($reflClass->hasProperty('name'), "Regenerating keeps property 'name'."); - $this->assertTrue($reflClass->hasProperty('status'), "Regenerating keeps property 'status'."); - $this->assertTrue($reflClass->hasProperty('id'), "Regenerating keeps property 'id'."); - - $this->assertTrue($reflClass->hasProperty('test'), "Check for property test failed."); - $this->assertTrue($reflClass->getProperty('test')->isPrivate(), "Check for private property test failed."); - $this->assertTrue($reflClass->hasMethod('getTest'), "Check for method 'getTest' failed."); - $this->assertTrue($reflClass->getMethod('getTest')->isPublic(), "Check for public visibility of method 'getTest' failed."); - $this->assertTrue($reflClass->hasMethod('setTest'), "Check for method 'getTest' failed."); - $this->assertTrue($reflClass->getMethod('getTest')->isPublic(), "Check for public visibility of method 'getTest' failed."); - } - - public function testEntityExtendsStdClass() - { - $this->_generator->setClassToExtend('stdClass'); - $metadata = $this->generateBookEntityFixture(); - - $book = $this->newInstance($metadata); - $this->assertInstanceOf('stdClass', $book); - } - - public function testLifecycleCallbacks() - { - $metadata = $this->generateBookEntityFixture(); - - $book = $this->newInstance($metadata); - $reflClass = new \ReflectionClass($metadata->name); - - $this->assertTrue($reflClass->hasMethod('loading'), "Check for postLoad lifecycle callback."); - $this->assertTrue($reflClass->hasMethod('willBeRemoved'), "Check for preRemove lifecycle callback."); - } - - public function testLoadMetadata() - { - $metadata = $this->generateBookEntityFixture(); - - $book = $this->newInstance($metadata); - - $cm = new \Doctrine\ORM\Mapping\ClassMetadata($metadata->name); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - $driver = $this->createAnnotationDriver(); - $driver->loadMetadataForClass($cm->name, $cm); - - $this->assertEquals($cm->columnNames, $metadata->columnNames); - $this->assertEquals($cm->getTableName(), $metadata->getTableName()); - $this->assertEquals($cm->lifecycleCallbacks, $metadata->lifecycleCallbacks); - $this->assertEquals($cm->identifier, $metadata->identifier); - $this->assertEquals($cm->idGenerator, $metadata->idGenerator); - $this->assertEquals($cm->customRepositoryClassName, $metadata->customRepositoryClassName); - } - - public function testLoadPrefixedMetadata() - { - $this->_generator->setAnnotationPrefix('ORM\\'); - $metadata = $this->generateBookEntityFixture(); - - $reader = new \Doctrine\Common\Annotations\AnnotationReader(); - $driver = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader, array()); - - $book = $this->newInstance($metadata); - - $cm = new \Doctrine\ORM\Mapping\ClassMetadata($metadata->name); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - - $driver->loadMetadataForClass($cm->name, $cm); - - $this->assertEquals($cm->columnNames, $metadata->columnNames); - $this->assertEquals($cm->getTableName(), $metadata->getTableName()); - $this->assertEquals($cm->lifecycleCallbacks, $metadata->lifecycleCallbacks); - $this->assertEquals($cm->identifier, $metadata->identifier); - $this->assertEquals($cm->idGenerator, $metadata->idGenerator); - $this->assertEquals($cm->customRepositoryClassName, $metadata->customRepositoryClassName); - } - - /** - * @dataProvider getParseTokensInEntityFileData - */ - public function testParseTokensInEntityFile($php, $classes) - { - $r = new \ReflectionObject($this->_generator); - $m = $r->getMethod('_parseTokensInEntityFile'); - $m->setAccessible(true); - - $p = $r->getProperty('_staticReflection'); - $p->setAccessible(true); - - $ret = $m->invoke($this->_generator, $php); - $this->assertEquals($classes, array_keys($p->getValue($this->_generator))); - } - - /** - * @group DDC-1784 - */ - public function testGenerateEntityWithSequenceGenerator() - { - $metadata = new ClassMetadataInfo($this->_namespace . '\DDC1784Entity'); - $metadata->namespace = $this->_namespace; - $metadata->mapField(array('fieldName' => 'id', 'type' => 'integer', 'id' => true)); - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE); - $metadata->setSequenceGeneratorDefinition(array( - 'sequenceName' => 'DDC1784_ID_SEQ', - 'allocationSize' => 1, - 'initialValue' => 2 - )); - $this->_generator->writeEntityClass($metadata, $this->_tmpDir); - - $filename = $this->_tmpDir . DIRECTORY_SEPARATOR - . $this->_namespace . DIRECTORY_SEPARATOR . 'DDC1784Entity.php'; - - $this->assertFileExists($filename); - require_once $filename; - - - $reflection = new \ReflectionProperty($metadata->name, 'id'); - $docComment = $reflection->getDocComment(); - - $this->assertContains('@Id', $docComment); - $this->assertContains('@Column(name="id", type="integer")', $docComment); - $this->assertContains('@GeneratedValue(strategy="SEQUENCE")', $docComment); - $this->assertContains('@SequenceGenerator(sequenceName="DDC1784_ID_SEQ", allocationSize=1, initialValue=2)', $docComment); - } - - - public function getParseTokensInEntityFileData() - { - return array( - array( - '. - */ - -namespace Doctrine\Tests\ORM\Tools\Export; - -use Doctrine\ORM\Tools\Export\ClassMetadataExporter; -use Doctrine\ORM\Mapping\ClassMetadataInfo; -use Doctrine\ORM\Tools\EntityGenerator; -use Doctrine\Tests\Mocks\MetadataDriverMock; -use Doctrine\Tests\Mocks\DatabasePlatformMock; -use Doctrine\Tests\Mocks\EntityManagerMock; -use Doctrine\Tests\Mocks\ConnectionMock; -use Doctrine\Tests\Mocks\DriverMock; -use Doctrine\Common\EventManager; -use Doctrine\ORM\Tools\DisconnectedClassMetadataFactory; -use Doctrine\ORM\Mapping\ClassMetadataFactory; - -require_once __DIR__ . '/../../../TestInit.php'; - -/** - * Test case for ClassMetadataExporter - * - * @author Jonathan H. Wage - * @author Roman Borschel setProxyDir(__DIR__ . '/../../Proxies'); - $config->setProxyNamespace('Doctrine\Tests\Proxies'); - $eventManager = new EventManager(); - $conn = new ConnectionMock(array(), $driverMock, $config, $eventManager); - $mockDriver = new MetadataDriverMock(); - $config->setMetadataDriverImpl($metadataDriver); - - return EntityManagerMock::create($conn, $config, $eventManager); - } - - protected function _createMetadataDriver($type, $path) - { - $mappingDriver = array( - 'php' => 'PHPDriver', - 'annotation' => 'AnnotationDriver', - 'xml' => 'XmlDriver', - 'yaml' => 'YamlDriver', - ); - $this->assertArrayHasKey($type, $mappingDriver, "There is no metadata driver for the type '" . $type . "'."); - $driverName = $mappingDriver[$type]; - - $class = 'Doctrine\ORM\Mapping\Driver\\' . $driverName; - if ($type === 'annotation') { - $driver = $this->createAnnotationDriver(array($path)); - } else { - $driver = new $class($path); - } - return $driver; - } - - protected function _createClassMetadataFactory($em, $type) - { - if ($type === 'annotation') { - $factory = new ClassMetadataFactory(); - } else { - $factory = new DisconnectedClassMetadataFactory(); - } - $factory->setEntityManager($em); - return $factory; - } - - public function testExportDirectoryAndFilesAreCreated() - { - $this->_deleteDirectory(__DIR__ . '/export/'.$this->_getType()); - - $type = $this->_getType(); - $metadataDriver = $this->_createMetadataDriver($type, __DIR__ . '/' . $type); - $em = $this->_createEntityManager($metadataDriver); - $cmf = $this->_createClassMetadataFactory($em, $type); - $metadata = $cmf->getAllMetadata(); - - $metadata[0]->name = 'Doctrine\Tests\ORM\Tools\Export\ExportedUser'; - - $this->assertEquals('Doctrine\Tests\ORM\Tools\Export\ExportedUser', $metadata[0]->name); - - $type = $this->_getType(); - $cme = new ClassMetadataExporter(); - $exporter = $cme->getExporter($type, __DIR__ . '/export/' . $type); - if ($type === 'annotation') { - $entityGenerator = new EntityGenerator(); - $entityGenerator->setAnnotationPrefix(""); - $exporter->setEntityGenerator($entityGenerator); - } - $this->_extension = $exporter->getExtension(); - - $exporter->setMetadata($metadata); - $exporter->export(); - - if ($type == 'annotation') { - $this->assertTrue(file_exists(__DIR__ . '/export/' . $type . '/'.str_replace('\\', '/', 'Doctrine\Tests\ORM\Tools\Export\ExportedUser').$this->_extension)); - } else { - $this->assertTrue(file_exists(__DIR__ . '/export/' . $type . '/Doctrine.Tests.ORM.Tools.Export.ExportedUser'.$this->_extension)); - } - } - - /** - * @depends testExportDirectoryAndFilesAreCreated - */ - public function testExportedMetadataCanBeReadBackIn() - { - $type = $this->_getType(); - - $metadataDriver = $this->_createMetadataDriver($type, __DIR__ . '/export/' . $type); - $em = $this->_createEntityManager($metadataDriver); - $cmf = $this->_createClassMetadataFactory($em, $type); - $metadata = $cmf->getAllMetadata(); - - $this->assertEquals(1, count($metadata)); - - $class = current($metadata); - - $this->assertEquals('Doctrine\Tests\ORM\Tools\Export\ExportedUser', $class->name); - - return $class; - } - - /** - * @depends testExportedMetadataCanBeReadBackIn - * @param ClassMetadataInfo $class - */ - public function testTableIsExported($class) - { - $this->assertEquals('cms_users', $class->table['name']); - - return $class; - } - - /** - * @depends testTableIsExported - * @param ClassMetadataInfo $class - */ - public function testTypeIsExported($class) - { - $this->assertFalse($class->isMappedSuperclass); - - return $class; - } - - /** - * @depends testTypeIsExported - * @param ClassMetadataInfo $class - */ - public function testIdentifierIsExported($class) - { - $this->assertEquals(ClassMetadataInfo::GENERATOR_TYPE_IDENTITY, $class->generatorType); - $this->assertEquals(array('id'), $class->identifier); - $this->assertTrue(isset($class->fieldMappings['id']['id']) && $class->fieldMappings['id']['id'] === true); - - return $class; - } - - /** - * @depends testIdentifierIsExported - * @param ClassMetadataInfo $class - */ - public function testFieldsAreExported($class) - { - $this->assertTrue(isset($class->fieldMappings['id']['id']) && $class->fieldMappings['id']['id'] === true); - $this->assertEquals('id', $class->fieldMappings['id']['fieldName']); - $this->assertEquals('integer', $class->fieldMappings['id']['type']); - $this->assertEquals('id', $class->fieldMappings['id']['columnName']); - - $this->assertEquals('name', $class->fieldMappings['name']['fieldName']); - $this->assertEquals('string', $class->fieldMappings['name']['type']); - $this->assertEquals(50, $class->fieldMappings['name']['length']); - $this->assertEquals('name', $class->fieldMappings['name']['columnName']); - - $this->assertEquals('email', $class->fieldMappings['email']['fieldName']); - $this->assertEquals('string', $class->fieldMappings['email']['type']); - $this->assertEquals('user_email', $class->fieldMappings['email']['columnName']); - $this->assertEquals('CHAR(32) NOT NULL', $class->fieldMappings['email']['columnDefinition']); - - return $class; - } - - /** - * @depends testFieldsAreExported - * @param ClassMetadataInfo $class - */ - public function testOneToOneAssociationsAreExported($class) - { - $this->assertTrue(isset($class->associationMappings['address'])); - $this->assertEquals('Doctrine\Tests\ORM\Tools\Export\Address', $class->associationMappings['address']['targetEntity']); - $this->assertEquals('address_id', $class->associationMappings['address']['joinColumns'][0]['name']); - $this->assertEquals('id', $class->associationMappings['address']['joinColumns'][0]['referencedColumnName']); - $this->assertEquals('CASCADE', $class->associationMappings['address']['joinColumns'][0]['onDelete']); - - $this->assertTrue($class->associationMappings['address']['isCascadeRemove']); - $this->assertTrue($class->associationMappings['address']['isCascadePersist']); - $this->assertFalse($class->associationMappings['address']['isCascadeRefresh']); - $this->assertFalse($class->associationMappings['address']['isCascadeMerge']); - $this->assertFalse($class->associationMappings['address']['isCascadeDetach']); - $this->assertTrue($class->associationMappings['address']['orphanRemoval']); - - return $class; - } - - /** - * @depends testFieldsAreExported - */ - public function testManyToOneAssociationsAreExported($class) - { - $this->assertTrue(isset($class->associationMappings['mainGroup'])); - $this->assertEquals('Doctrine\Tests\ORM\Tools\Export\Group', $class->associationMappings['mainGroup']['targetEntity']); - } - - /** - * @depends testOneToOneAssociationsAreExported - * @param ClassMetadataInfo $class - */ - public function testOneToManyAssociationsAreExported($class) - { - $this->assertTrue(isset($class->associationMappings['phonenumbers'])); - //$this->assertInstanceOf('Doctrine\ORM\Mapping\OneToManyMapping', $class->associationMappings['phonenumbers']); - $this->assertEquals('Doctrine\Tests\ORM\Tools\Export\Phonenumber', $class->associationMappings['phonenumbers']['targetEntity']); - $this->assertEquals('user', $class->associationMappings['phonenumbers']['mappedBy']); - $this->assertEquals(array('number' => 'ASC'), $class->associationMappings['phonenumbers']['orderBy']); - - $this->assertTrue($class->associationMappings['phonenumbers']['isCascadeRemove']); - $this->assertTrue($class->associationMappings['phonenumbers']['isCascadePersist']); - $this->assertFalse($class->associationMappings['phonenumbers']['isCascadeRefresh']); - $this->assertTrue($class->associationMappings['phonenumbers']['isCascadeMerge']); - $this->assertFalse($class->associationMappings['phonenumbers']['isCascadeDetach']); - $this->assertTrue($class->associationMappings['phonenumbers']['orphanRemoval']); - - return $class; - } - - /** - * @depends testOneToManyAssociationsAreExported - * @param ClassMetadataInfo $metadata - */ - public function testManyToManyAssociationsAreExported($class) - { - $this->assertTrue(isset($class->associationMappings['groups'])); - //$this->assertInstanceOf('Doctrine\ORM\Mapping\ManyToManyMapping', $class->associationMappings['groups']); - $this->assertEquals('Doctrine\Tests\ORM\Tools\Export\Group', $class->associationMappings['groups']['targetEntity']); - $this->assertEquals('cms_users_groups', $class->associationMappings['groups']['joinTable']['name']); - - $this->assertEquals('user_id', $class->associationMappings['groups']['joinTable']['joinColumns'][0]['name']); - $this->assertEquals('id', $class->associationMappings['groups']['joinTable']['joinColumns'][0]['referencedColumnName']); - - $this->assertEquals('group_id', $class->associationMappings['groups']['joinTable']['inverseJoinColumns'][0]['name']); - $this->assertEquals('id', $class->associationMappings['groups']['joinTable']['inverseJoinColumns'][0]['referencedColumnName']); - $this->assertEquals('INT NULL', $class->associationMappings['groups']['joinTable']['inverseJoinColumns'][0]['columnDefinition']); - - $this->assertTrue($class->associationMappings['groups']['isCascadeRemove']); - $this->assertTrue($class->associationMappings['groups']['isCascadePersist']); - $this->assertTrue($class->associationMappings['groups']['isCascadeRefresh']); - $this->assertTrue($class->associationMappings['groups']['isCascadeMerge']); - $this->assertTrue($class->associationMappings['groups']['isCascadeDetach']); - - return $class; - } - - /** - * @depends testManyToManyAssociationsAreExported - * @param ClassMetadataInfo $class - */ - public function testLifecycleCallbacksAreExported($class) - { - $this->assertTrue(isset($class->lifecycleCallbacks['prePersist'])); - $this->assertEquals(2, count($class->lifecycleCallbacks['prePersist'])); - $this->assertEquals('doStuffOnPrePersist', $class->lifecycleCallbacks['prePersist'][0]); - $this->assertEquals('doOtherStuffOnPrePersistToo', $class->lifecycleCallbacks['prePersist'][1]); - - $this->assertTrue(isset($class->lifecycleCallbacks['postPersist'])); - $this->assertEquals(1, count($class->lifecycleCallbacks['postPersist'])); - $this->assertEquals('doStuffOnPostPersist', $class->lifecycleCallbacks['postPersist'][0]); - - return $class; - } - - /** - * @depends testLifecycleCallbacksAreExported - * @param ClassMetadataInfo $class - */ - public function testCascadeIsExported($class) - { - $this->assertTrue($class->associationMappings['phonenumbers']['isCascadePersist']); - $this->assertTrue($class->associationMappings['phonenumbers']['isCascadeMerge']); - $this->assertTrue($class->associationMappings['phonenumbers']['isCascadeRemove']); - $this->assertFalse($class->associationMappings['phonenumbers']['isCascadeRefresh']); - $this->assertFalse($class->associationMappings['phonenumbers']['isCascadeDetach']); - $this->assertTrue($class->associationMappings['phonenumbers']['orphanRemoval']); - - return $class; - } - - /** - * @depends testCascadeIsExported - * @param ClassMetadataInfo $class - */ - public function testInversedByIsExported($class) - { - $this->assertEquals('user', $class->associationMappings['address']['inversedBy']); - } - /** - * @depends testExportDirectoryAndFilesAreCreated - */ - public function testCascadeAllCollapsed() - { - $type = $this->_getType(); - if ($type == 'xml') { - $xml = simplexml_load_file(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); - - $xml->registerXPathNamespace("d", "http://doctrine-project.org/schemas/orm/doctrine-mapping"); - $nodes = $xml->xpath("/d:doctrine-mapping/d:entity/d:one-to-many[@field='interests']/d:cascade/d:*"); - $this->assertEquals(1, count($nodes)); - - $this->assertEquals('cascade-all', $nodes[0]->getName()); - } elseif ($type == 'yaml') { - - $yaml = new \Symfony\Component\Yaml\Parser(); - $value = $yaml->parse(file_get_contents(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.yml')); - - $this->assertTrue(isset($value['Doctrine\Tests\ORM\Tools\Export\ExportedUser']['oneToMany']['interests']['cascade'])); - $this->assertEquals(1, count($value['Doctrine\Tests\ORM\Tools\Export\ExportedUser']['oneToMany']['interests']['cascade'])); - $this->assertEquals('all', $value['Doctrine\Tests\ORM\Tools\Export\ExportedUser']['oneToMany']['interests']['cascade'][0]); - - } else { - $this->markTestSkipped('Test aviable only for '.$type.' dirver'); - } - } - public function __destruct() - { -# $this->_deleteDirectory(__DIR__ . '/export/'.$this->_getType()); - } - - protected function _deleteDirectory($path) - { - if (is_file($path)) { - return unlink($path); - } else if (is_dir($path)) { - $files = glob(rtrim($path,'/').'/*'); - foreach ($files as $file){ - $this->_deleteDirectory($file); - } - return rmdir($path); - } - } -} - -class Address -{ - -} -class Phonenumber -{ - -} -class Group -{ - -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/AnnotationClassMetadataExporterTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/AnnotationClassMetadataExporterTest.php deleted file mode 100644 index c60281c..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/AnnotationClassMetadataExporterTest.php +++ /dev/null @@ -1,42 +0,0 @@ -. - */ - -namespace Doctrine\Tests\ORM\Tools\Export; - -require_once __DIR__ . '/../../../TestInit.php'; - -/** - * Test case for AnnotationClassMetadataExporterTest - * - * @author Jonathan H. Wage - * @author Roman Borschel . - */ - -namespace Doctrine\Tests\ORM\Tools\Export; - -require_once __DIR__ . '/../../../TestInit.php'; - -/** - * Test case for PhpClassMetadataExporterTest - * - * @author Jonathan H. Wage - * @author Roman Borschel . - */ - -namespace Doctrine\Tests\ORM\Tools\Export; - -require_once __DIR__ . '/../../../TestInit.php'; - -/** - * Test case for XmlClassMetadataExporterTest - * - * @author Jonathan H. Wage - * @author Roman Borschel . - */ - -namespace Doctrine\Tests\ORM\Tools\Export; - -require_once __DIR__ . '/../../../TestInit.php'; - -/** - * Test case for YamlClassMetadataExporterTest - * - * @author Jonathan H. Wage - * @author Roman Borschel markTestSkipped('Please install Symfony YAML Component into the include path of your PHP installation.'); - } - - return 'yaml'; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/annotation/Doctrine.Tests.ORM.Tools.Export.User.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/annotation/Doctrine.Tests.ORM.Tools.Export.User.php deleted file mode 100644 index 5a82cc6..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/annotation/Doctrine.Tests.ORM.Tools.Export.User.php +++ /dev/null @@ -1,73 +0,0 @@ -setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); -$metadata->setPrimaryTable(array( - 'name' => 'cms_users', - )); -$metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT); -$metadata->addLifecycleCallback('doStuffOnPrePersist', 'prePersist'); -$metadata->addLifecycleCallback('doOtherStuffOnPrePersistToo', 'prePersist'); -$metadata->addLifecycleCallback('doStuffOnPostPersist', 'postPersist'); -$metadata->mapField(array( - 'id' => true, - 'fieldName' => 'id', - 'type' => 'integer', - 'columnName' => 'id', - )); -$metadata->mapField(array( - 'fieldName' => 'name', - 'type' => 'string', - 'length' => 50, - 'unique' => true, - 'nullable' => true, - 'columnName' => 'name', - )); -$metadata->mapField(array( - 'fieldName' => 'email', - 'type' => 'string', - 'columnName' => 'user_email', - 'columnDefinition' => 'CHAR(32) NOT NULL', - )); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); -$metadata->mapManyToOne(array( - 'fieldName' => 'mainGroup', - 'targetEntity' => 'Doctrine\\Tests\\ORM\Tools\\Export\\Group', -)); -$metadata->mapOneToOne(array( - 'fieldName' => 'address', - 'targetEntity' => 'Doctrine\\Tests\\ORM\\Tools\\Export\\Address', - 'inversedBy' => 'user', - 'cascade' => - array( - 0 => 'persist', - ), - 'mappedBy' => NULL, - 'joinColumns' => - array( - 0 => - array( - 'name' => 'address_id', - 'referencedColumnName' => 'id', - 'onDelete' => 'CASCADE', - ), - ), - 'orphanRemoval' => true, - )); -$metadata->mapOneToMany(array( - 'fieldName' => 'phonenumbers', - 'targetEntity' => 'Doctrine\\Tests\\ORM\\Tools\\Export\\Phonenumber', - 'cascade' => - array( - 1 => 'persist', - 2 => 'merge', - ), - 'mappedBy' => 'user', - 'orphanRemoval' => true, - 'orderBy' => - array( - 'number' => 'ASC', - ), - )); -$metadata->mapManyToMany(array( - 'fieldName' => 'groups', - 'targetEntity' => 'Doctrine\\Tests\\ORM\\Tools\\Export\\Group', - 'cascade' => - array( - 0 => 'remove', - 1 => 'persist', - 2 => 'refresh', - 3 => 'merge', - 4 => 'detach', - ), - 'mappedBy' => NULL, - 'joinTable' => - array( - 'name' => 'cms_users_groups', - 'joinColumns' => - array( - 0 => - array( - 'name' => 'user_id', - 'referencedColumnName' => 'id', - 'unique' => false, - 'nullable' => false, - ), - ), - 'inverseJoinColumns' => - array( - 0 => - array( - 'name' => 'group_id', - 'referencedColumnName' => 'id', - 'columnDefinition' => 'INT NULL', - ), - ), - ), - 'orderBy' => NULL, - )); diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/xml/Doctrine.Tests.ORM.Tools.Export.User.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/xml/Doctrine.Tests.ORM.Tools.Export.User.dcm.xml deleted file mode 100644 index 22d2852..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/xml/Doctrine.Tests.ORM.Tools.Export.User.dcm.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/yaml/Doctrine.Tests.ORM.Tools.Export.User.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/yaml/Doctrine.Tests.ORM.Tools.Export.User.dcm.yml deleted file mode 100644 index 25071d9..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/yaml/Doctrine.Tests.ORM.Tools.Export.User.dcm.yml +++ /dev/null @@ -1,63 +0,0 @@ -Doctrine\Tests\ORM\Tools\Export\User: - type: entity - table: cms_users - id: - id: - type: integer - generator: - strategy: AUTO - fields: - name: - type: string - length: 50 - nullable: true - unique: true - email: - type: string - column: user_email - columnDefinition: CHAR(32) NOT NULL - oneToOne: - address: - targetEntity: Doctrine\Tests\ORM\Tools\Export\Address - joinColumn: - name: address_id - referencedColumnName: id - onDelete: CASCADE - cascade: [ persist ] - inversedBy: user - orphanRemoval: true - manyToOne: - mainGroup: - targetEntity: Doctrine\Tests\ORM\Tools\Export\Group - oneToMany: - phonenumbers: - targetEntity: Doctrine\Tests\ORM\Tools\Export\Phonenumber - mappedBy: user - orderBy: - number: ASC - cascade: [ persist, merge ] - orphanRemoval: true - interests: - targetEntity: Doctrine\Tests\ORM\Tools\Export\Interests - mappedBy: user - cascade: [ persist, merge, remove, refresh, detach ] - orphanRemoval: true - manyToMany: - groups: - targetEntity: Doctrine\Tests\ORM\Tools\Export\Group - joinTable: - name: cms_users_groups - joinColumns: - user_id: - referencedColumnName: id - nullable: false - unique: false - inverseJoinColumns: - group_id: - referencedColumnName: id - columnDefinition: INT NULL - cascade: - - all - lifecycleCallbacks: - prePersist: [ doStuffOnPrePersist, doOtherStuffOnPrePersistToo ] - postPersist: [ doStuffOnPostPersist ] diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/CountWalkerTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/CountWalkerTest.php deleted file mode 100644 index 816339d..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/CountWalkerTest.php +++ /dev/null @@ -1,78 +0,0 @@ -entityManager->createQuery( - 'SELECT p, c, a FROM Doctrine\Tests\ORM\Tools\Pagination\BlogPost p JOIN p.category c JOIN p.author a'); - $query->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\ORM\Tools\Pagination\CountWalker')); - $query->setHint(CountWalker::HINT_DISTINCT, true); - $query->setFirstResult(null)->setMaxResults(null); - - $this->assertEquals( - "SELECT count(DISTINCT b0_.id) AS sclr0 FROM BlogPost b0_ INNER JOIN Category c1_ ON b0_.category_id = c1_.id INNER JOIN Author a2_ ON b0_.author_id = a2_.id", $query->getSql() - ); - } - - public function testCountQuery_MixedResultsWithName() - { - $query = $this->entityManager->createQuery( - 'SELECT a, sum(a.name) as foo FROM Doctrine\Tests\ORM\Tools\Pagination\Author a'); - $query->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\ORM\Tools\Pagination\CountWalker')); - $query->setHint(CountWalker::HINT_DISTINCT, true); - $query->setFirstResult(null)->setMaxResults(null); - - $this->assertEquals( - "SELECT count(DISTINCT a0_.id) AS sclr0 FROM Author a0_", $query->getSql() - ); - } - - public function testCountQuery_KeepsGroupBy() - { - $query = $this->entityManager->createQuery( - 'SELECT b FROM Doctrine\Tests\ORM\Tools\Pagination\BlogPost b GROUP BY b.id'); - $query->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\ORM\Tools\Pagination\CountWalker')); - $query->setHint(CountWalker::HINT_DISTINCT, true); - $query->setFirstResult(null)->setMaxResults(null); - - $this->assertEquals( - "SELECT count(DISTINCT b0_.id) AS sclr0 FROM BlogPost b0_ GROUP BY b0_.id", $query->getSql() - ); - } - - public function testCountQuery_RemovesOrderBy() - { - $query = $this->entityManager->createQuery( - 'SELECT p, c, a FROM Doctrine\Tests\ORM\Tools\Pagination\BlogPost p JOIN p.category c JOIN p.author a ORDER BY a.name'); - $query->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\ORM\Tools\Pagination\CountWalker')); - $query->setHint(CountWalker::HINT_DISTINCT, true); - $query->setFirstResult(null)->setMaxResults(null); - - $this->assertEquals( - "SELECT count(DISTINCT b0_.id) AS sclr0 FROM BlogPost b0_ INNER JOIN Category c1_ ON b0_.category_id = c1_.id INNER JOIN Author a2_ ON b0_.author_id = a2_.id", $query->getSql() - ); - } - - public function testCountQuery_RemovesLimits() - { - $query = $this->entityManager->createQuery( - 'SELECT p, c, a FROM Doctrine\Tests\ORM\Tools\Pagination\BlogPost p JOIN p.category c JOIN p.author a'); - $query->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\ORM\Tools\Pagination\CountWalker')); - $query->setHint(CountWalker::HINT_DISTINCT, true); - $query->setFirstResult(null)->setMaxResults(null); - - $this->assertEquals( - "SELECT count(DISTINCT b0_.id) AS sclr0 FROM BlogPost b0_ INNER JOIN Category c1_ ON b0_.category_id = c1_.id INNER JOIN Author a2_ ON b0_.author_id = a2_.id", $query->getSql() - ); - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryWalkerTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryWalkerTest.php deleted file mode 100644 index f166ddd..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryWalkerTest.php +++ /dev/null @@ -1,36 +0,0 @@ -entityManager->createQuery( - 'SELECT p, c, a FROM Doctrine\Tests\ORM\Tools\Pagination\MyBlogPost p JOIN p.category c JOIN p.author a'); - $limitQuery = clone $query; - $limitQuery->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\ORM\Tools\Pagination\LimitSubqueryWalker')); - - $this->assertEquals( - "SELECT DISTINCT m0_.id AS id0 FROM MyBlogPost m0_ INNER JOIN Category c1_ ON m0_.category_id = c1_.id INNER JOIN Author a2_ ON m0_.author_id = a2_.id", $limitQuery->getSql() - ); - } - - public function testCountQuery_MixedResultsWithName() - { - $query = $this->entityManager->createQuery( - 'SELECT a, sum(a.name) as foo FROM Doctrine\Tests\ORM\Tools\Pagination\Author a'); - $limitQuery = clone $query; - $limitQuery->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\ORM\Tools\Pagination\LimitSubqueryWalker')); - - $this->assertEquals( - "SELECT DISTINCT a0_.id AS id0, sum(a0_.name) AS sclr1 FROM Author a0_", $limitQuery->getSql() - ); - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginationTestCase.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginationTestCase.php deleted file mode 100644 index a6e4c67..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginationTestCase.php +++ /dev/null @@ -1,142 +0,0 @@ -entityManager = $this->_getTestEntityManager(); - } -} - - -/** -* @Entity -*/ -class MyBlogPost -{ - - /** @Id @column(type="integer") @generatedValue */ - public $id; - /** - * @ManyToOne(targetEntity="Author") - */ - public $author; - /** - * @ManyToOne(targetEntity="Category") - */ - public $category; -} - -/** - * @Entity - */ -class MyAuthor -{ - - /** @Id @column(type="integer") @generatedValue */ - public $id; - -} - -/** -* @Entity -*/ -class MyCategory -{ - - /** @id @column(type="integer") @generatedValue */ - public $id; - -} - - -/** - * @Entity - */ -class BlogPost -{ - - /** @Id @column(type="integer") @generatedValue */ - public $id; - /** - * @ManyToOne(targetEntity="Author") - */ - public $author; - /** - * @ManyToOne(targetEntity="Category") - */ - public $category; -} - -/** - * @Entity - */ -class Author -{ - - /** @Id @column(type="integer") @generatedValue */ - public $id; - /** @Column(type="string") */ - public $name; - -} - -/** - * @Entity - */ -class Person -{ - - /** @Id @column(type="integer") @generatedValue */ - public $id; - /** @Column(type="string") */ - public $name; - /** @Column(type="string") */ - public $biography; - -} - -/** - * @Entity - */ -class Category -{ - - /** @id @column(type="integer") @generatedValue */ - public $id; - -} - - -/** @Entity @Table(name="groups") */ -class Group -{ - - /** @Id @column(type="integer") @generatedValue */ - public $id; - /** @ManyToMany(targetEntity="User", mappedBy="groups") */ - public $users; -} - -/** @Entity */ -class User -{ - - /** @Id @column(type="integer") @generatedValue */ - public $id; - /** - * @ManyToMany(targetEntity="Group", inversedBy="users") - * @JoinTable( - * name="user_group", - * joinColumns = {@JoinColumn(name="user_id", referencedColumnName="id")}, - * inverseJoinColumns = {@JoinColumn(name="group_id", referencedColumnName="id")} - * ) - */ - public $groups; -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/WhereInWalkerTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/WhereInWalkerTest.php deleted file mode 100644 index d7bcd0e..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/WhereInWalkerTest.php +++ /dev/null @@ -1,111 +0,0 @@ -entityManager->createQuery( - 'SELECT u, g FROM Doctrine\Tests\ORM\Tools\Pagination\User u JOIN u.groups g' - ); - $whereInQuery = clone $query; - $whereInQuery->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\ORM\Tools\Pagination\WhereInWalker')); - $whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, 10); - - $this->assertEquals( - "SELECT u0_.id AS id0, g1_.id AS id1 FROM User u0_ INNER JOIN user_group u2_ ON u0_.id = u2_.user_id INNER JOIN groups g1_ ON g1_.id = u2_.group_id WHERE u0_.id IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", $whereInQuery->getSql() - ); - } - - public function testCountQuery_MixedResultsWithName() - { - $query = $this->entityManager->createQuery( - 'SELECT a, sum(a.name) as foo FROM Doctrine\Tests\ORM\Tools\Pagination\Author a' - ); - $whereInQuery = clone $query; - $whereInQuery->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\ORM\Tools\Pagination\WhereInWalker')); - $whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, 10); - - $this->assertEquals( - "SELECT a0_.id AS id0, a0_.name AS name1, sum(a0_.name) AS sclr2 FROM Author a0_ WHERE a0_.id IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", $whereInQuery->getSql() - ); - } - - public function testWhereInQuery_SingleWhere() - { - $query = $this->entityManager->createQuery( - 'SELECT u, g FROM Doctrine\Tests\ORM\Tools\Pagination\User u JOIN u.groups g WHERE 1 = 1' - ); - $whereInQuery = clone $query; - $whereInQuery->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\ORM\Tools\Pagination\WhereInWalker')); - $whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, 10); - - $this->assertEquals( - "SELECT u0_.id AS id0, g1_.id AS id1 FROM User u0_ INNER JOIN user_group u2_ ON u0_.id = u2_.user_id INNER JOIN groups g1_ ON g1_.id = u2_.group_id WHERE 1 = 1 AND u0_.id IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", $whereInQuery->getSql() - ); - } - - public function testWhereInQuery_MultipleWhereWithAnd() - { - $query = $this->entityManager->createQuery( - 'SELECT u, g FROM Doctrine\Tests\ORM\Tools\Pagination\User u JOIN u.groups g WHERE 1 = 1 AND 2 = 2' - ); - $whereInQuery = clone $query; - $whereInQuery->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\ORM\Tools\Pagination\WhereInWalker')); - $whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, 10); - - $this->assertEquals( - "SELECT u0_.id AS id0, g1_.id AS id1 FROM User u0_ INNER JOIN user_group u2_ ON u0_.id = u2_.user_id INNER JOIN groups g1_ ON g1_.id = u2_.group_id WHERE 1 = 1 AND 2 = 2 AND u0_.id IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", $whereInQuery->getSql() - ); - } - - public function testWhereInQuery_MultipleWhereWithOr() - { - $query = $this->entityManager->createQuery( - 'SELECT u, g FROM Doctrine\Tests\ORM\Tools\Pagination\User u JOIN u.groups g WHERE 1 = 1 OR 2 = 2' - ); - $whereInQuery = clone $query; - $whereInQuery->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\ORM\Tools\Pagination\WhereInWalker')); - $whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, 10); - - $this->assertEquals( - "SELECT u0_.id AS id0, g1_.id AS id1 FROM User u0_ INNER JOIN user_group u2_ ON u0_.id = u2_.user_id INNER JOIN groups g1_ ON g1_.id = u2_.group_id WHERE (1 = 1 OR 2 = 2) AND u0_.id IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", $whereInQuery->getSql() - ); - } - - public function testWhereInQuery_MultipleWhereWithMixed_1() - { - $query = $this->entityManager->createQuery( - 'SELECT u, g FROM Doctrine\Tests\ORM\Tools\Pagination\User u JOIN u.groups g WHERE (1 = 1 OR 2 = 2) AND 3 = 3' - ); - $whereInQuery = clone $query; - $whereInQuery->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\ORM\Tools\Pagination\WhereInWalker')); - $whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, 10); - - $this->assertEquals( - "SELECT u0_.id AS id0, g1_.id AS id1 FROM User u0_ INNER JOIN user_group u2_ ON u0_.id = u2_.user_id INNER JOIN groups g1_ ON g1_.id = u2_.group_id WHERE (1 = 1 OR 2 = 2) AND 3 = 3 AND u0_.id IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", $whereInQuery->getSql() - ); - } - - public function testWhereInQuery_MultipleWhereWithMixed_2() - { - $query = $this->entityManager->createQuery( - 'SELECT u, g FROM Doctrine\Tests\ORM\Tools\Pagination\User u JOIN u.groups g WHERE 1 = 1 AND 2 = 2 OR 3 = 3' - ); - $whereInQuery = clone $query; - $whereInQuery->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\ORM\Tools\Pagination\WhereInWalker')); - $whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, 10); - - $this->assertEquals( - "SELECT u0_.id AS id0, g1_.id AS id1 FROM User u0_ INNER JOIN user_group u2_ ON u0_.id = u2_.user_id INNER JOIN groups g1_ ON g1_.id = u2_.group_id WHERE (1 = 1 AND 2 = 2 OR 3 = 3) AND u0_.id IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", $whereInQuery->getSql() - ); - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/ResolveTargetEntityListenerTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/ResolveTargetEntityListenerTest.php deleted file mode 100644 index 3cb627f..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/ResolveTargetEntityListenerTest.php +++ /dev/null @@ -1,129 +0,0 @@ -createAnnotationDriver(); - - $this->em = $this->_getTestEntityManager(); - $this->em->getConfiguration()->setMetadataDriverImpl($annotationDriver); - $this->factory = new ClassMetadataFactory; - $this->factory->setEntityManager($this->em); - $this->listener = new ResolveTargetEntityListener; - } - - /** - * @group DDC-1544 - */ - public function testResolveTargetEntityListenerCanResolveTargetEntity() - { - $evm = $this->em->getEventManager(); - $this->listener->addResolveTargetEntity( - 'Doctrine\Tests\ORM\Tools\ResolveTargetInterface', - 'Doctrine\Tests\ORM\Tools\ResolveTargetEntity', - array() - ); - $this->listener->addResolveTargetEntity( - 'Doctrine\Tests\ORM\Tools\TargetInterface', - 'Doctrine\Tests\ORM\Tools\TargetEntity', - array() - ); - $evm->addEventListener(Events::loadClassMetadata, $this->listener); - $cm = $this->factory->getMetadataFor('Doctrine\Tests\ORM\Tools\ResolveTargetEntity'); - $meta = $cm->associationMappings; - $this->assertSame('Doctrine\Tests\ORM\Tools\TargetEntity', $meta['manyToMany']['targetEntity']); - $this->assertSame('Doctrine\Tests\ORM\Tools\ResolveTargetEntity', $meta['manyToOne']['targetEntity']); - $this->assertSame('Doctrine\Tests\ORM\Tools\ResolveTargetEntity', $meta['oneToMany']['targetEntity']); - $this->assertSame('Doctrine\Tests\ORM\Tools\TargetEntity', $meta['oneToOne']['targetEntity']); - } -} - -interface ResolveTargetInterface -{ - public function getId(); -} - -interface TargetInterface extends ResolveTargetInterface -{ -} - -/** - * @Entity - */ -class ResolveTargetEntity implements ResolveTargetInterface -{ - /** - * @Id - * @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - private $id; - - /** - * @ManyToMany(targetEntity="Doctrine\Tests\ORM\Tools\TargetInterface") - */ - private $manyToMany; - - /** - * @ManyToOne(targetEntity="Doctrine\Tests\ORM\Tools\ResolveTargetInterface", inversedBy="oneToMany") - */ - private $manyToOne; - - /** - * @OneToMany(targetEntity="Doctrine\Tests\ORM\Tools\ResolveTargetInterface", mappedBy="manyToOne") - */ - private $oneToMany; - - /** - * @OneToOne(targetEntity="Doctrine\Tests\ORM\Tools\TargetInterface") - * @JoinColumn(name="target_entity_id", referencedColumnName="id") - */ - private $oneToOne; - - public function getId() - { - return $this->id; - } -} - -/** - * @Entity - */ -class TargetEntity implements TargetInterface -{ - /** - * @Id - * @Column(type="integer") - * @GeneratedValue(strategy="AUTO") - */ - private $id; - - public function getId() - { - return $this->id; - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php deleted file mode 100644 index 6e4b62e..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php +++ /dev/null @@ -1,132 +0,0 @@ -_getTestEntityManager(); - $schemaTool = new SchemaTool($em); - - $classes = array( - $em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsAddress'), - $em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsArticle'), - $em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsComment'), - $em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsEmployee'), - $em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsGroup'), - $em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsPhonenumber'), - $em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'), - ); - - $schema = $schemaTool->getSchemaFromMetadata($classes); - - $this->assertTrue($schema->hasTable('cms_users'), "Table cms_users should exist."); - $this->assertTrue($schema->getTable('cms_users')->columnsAreIndexed(array('username')), "username column should be indexed."); - } - - public function testColumnAnnotationOptionsAttribute() - { - $em = $this->_getTestEntityManager(); - $schemaTool = new SchemaTool($em); - - $classes = array( - $em->getClassMetadata(__NAMESPACE__ . '\\TestEntityWithColumnAnnotationOptionsAttribute'), - ); - - $schema = $schemaTool->getSchemaFromMetadata($classes); - - $expected = array('foo' => 'bar', 'baz' => array('key' => 'val')); - $this->assertEquals($expected, $schema->getTable('TestEntityWithColumnAnnotationOptionsAttribute')->getColumn('test')->getCustomSchemaOptions(), "options annotation are passed to the columns customSchemaOptions"); - } - - /** - * @group DDC-200 - */ - public function testPassColumnDefinitionToJoinColumn() - { - $customColumnDef = "MEDIUMINT(6) UNSIGNED NOT NULL"; - - $em = $this->_getTestEntityManager(); - $schemaTool = new SchemaTool($em); - - $avatar = $em->getClassMetadata('Doctrine\Tests\Models\Forum\ForumAvatar'); - $avatar->fieldMappings['id']['columnDefinition'] = $customColumnDef; - $user = $em->getClassMetadata('Doctrine\Tests\Models\Forum\ForumUser'); - - $classes = array($avatar, $user); - - $schema = $schemaTool->getSchemaFromMetadata($classes); - - $this->assertTrue($schema->hasTable('forum_users')); - $table = $schema->getTable("forum_users"); - $this->assertTrue($table->hasColumn('avatar_id')); - $this->assertEquals($customColumnDef, $table->getColumn('avatar_id')->getColumnDefinition()); - } - - /** - * @group DDC-283 - */ - public function testPostGenerateEvents() - { - $listener = new GenerateSchemaEventListener(); - - $em = $this->_getTestEntityManager(); - $em->getEventManager()->addEventListener( - array(ToolEvents::postGenerateSchemaTable, ToolEvents::postGenerateSchema), $listener - ); - $schemaTool = new SchemaTool($em); - - $classes = array( - $em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsAddress'), - $em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsArticle'), - $em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsComment'), - $em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsEmployee'), - $em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsGroup'), - $em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsPhonenumber'), - $em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'), - ); - - $schema = $schemaTool->getSchemaFromMetadata($classes); - - $this->assertEquals(count($classes), $listener->tableCalls); - $this->assertTrue($listener->schemaCalled); - } -} - -/** - * @Entity - */ -class TestEntityWithColumnAnnotationOptionsAttribute -{ - /** @Id @Column */ - private $id; - - /** - * @Column(type="string", options={"foo": "bar", "baz": {"key": "val"}}) - */ - private $test; -} - -class GenerateSchemaEventListener -{ - public $tableCalls = 0; - public $schemaCalled = false; - - public function postGenerateSchemaTable(GenerateSchemaTableEventArgs $eventArgs) - { - $this->tableCalls++; - } - - public function postGenerateSchema(GenerateSchemaEventArgs $eventArgs) - { - $this->schemaCalled = true; - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php deleted file mode 100644 index 6f2e912..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php +++ /dev/null @@ -1,267 +0,0 @@ -em = $this->_getTestEntityManager(); - $this->validator = new SchemaValidator($this->em); - } - - public function testCmsModelSet() - { - $this->em->getConfiguration()->getMetadataDriverImpl()->addPaths(array( - __DIR__ . "/../../Models/CMS" - )); - $this->validator->validateMapping(); - } - - public function testCompanyModelSet() - { - $this->em->getConfiguration()->getMetadataDriverImpl()->addPaths(array( - __DIR__ . "/../../Models/Company" - )); - $this->validator->validateMapping(); - } - - public function testECommerceModelSet() - { - $this->em->getConfiguration()->getMetadataDriverImpl()->addPaths(array( - __DIR__ . "/../../Models/ECommerce" - )); - $this->validator->validateMapping(); - } - - public function testForumModelSet() - { - $this->em->getConfiguration()->getMetadataDriverImpl()->addPaths(array( - __DIR__ . "/../../Models/Forum" - )); - $this->validator->validateMapping(); - } - - public function testNavigationModelSet() - { - $this->em->getConfiguration()->getMetadataDriverImpl()->addPaths(array( - __DIR__ . "/../../Models/Navigation" - )); - $this->validator->validateMapping(); - } - - public function testRoutingModelSet() - { - $this->em->getConfiguration()->getMetadataDriverImpl()->addPaths(array( - __DIR__ . "/../../Models/Routing" - )); - $this->validator->validateMapping(); - } - - /** - * @group DDC-1439 - */ - public function testInvalidManyToManyJoinColumnSchema() - { - $class1 = $this->em->getClassMetadata(__NAMESPACE__ . '\InvalidEntity1'); - $class2 = $this->em->getClassMetadata(__NAMESPACE__ . '\InvalidEntity2'); - - $ce = $this->validator->validateClass($class1); - - $this->assertEquals( - array( - "The inverse join columns of the many-to-many table 'Entity1Entity2' have to contain to ALL identifier columns of the target entity 'Doctrine\Tests\ORM\Tools\InvalidEntity2', however 'key4' are missing.", - "The join columns of the many-to-many table 'Entity1Entity2' have to contain to ALL identifier columns of the source entity 'Doctrine\Tests\ORM\Tools\InvalidEntity1', however 'key2' are missing." - ), - $ce - ); - } - - /** - * @group DDC-1439 - */ - public function testInvalidToOneJoinColumnSchema() - { - $class1 = $this->em->getClassMetadata(__NAMESPACE__ . '\InvalidEntity1'); - $class2 = $this->em->getClassMetadata(__NAMESPACE__ . '\InvalidEntity2'); - - $ce = $this->validator->validateClass($class2); - - $this->assertEquals( - array( - "The referenced column name 'id' has to be a primary key column on the target entity class 'Doctrine\Tests\ORM\Tools\InvalidEntity1'.", - "The join columns of the association 'assoc' have to match to ALL identifier columns of the target entity 'Doctrine\Tests\ORM\Tools\InvalidEntity2', however 'key1, key2' are missing." - ), - $ce - ); - } - - /** - * @group DDC-1587 - */ - public function testValidOneToOneAsIdentifierSchema() - { - $class1 = $this->em->getClassMetadata(__NAMESPACE__ . '\DDC1587ValidEntity2'); - $class2 = $this->em->getClassMetadata(__NAMESPACE__ . '\DDC1587ValidEntity1'); - - $ce = $this->validator->validateClass($class1); - - $this->assertEquals(array(), $ce); - } - - /** - * @group DDC-1649 - */ - public function testInvalidTripleAssociationAsKeyMapping() - { - $classThree = $this->em->getClassMetadata(__NAMESPACE__ . '\DDC1649Three'); - $ce = $this->validator->validateClass($classThree); - - $this->assertEquals(Array( - "Cannot map association 'Doctrine\Tests\ORM\Tools\DDC1649Three#two as identifier, because the target entity 'Doctrine\Tests\ORM\Tools\DDC1649Two' also maps an association as identifier.", - "The referenced column name 'id' has to be a primary key column on the target entity class 'Doctrine\Tests\ORM\Tools\DDC1649Two'." - ), $ce); - } -} - -/** - * @Entity - */ -class InvalidEntity1 -{ - /** - * @Id @Column - */ - protected $key1; - /** - * @Id @Column - */ - protected $key2; - /** - * @ManyToMany (targetEntity="InvalidEntity2") - * @JoinTable (name="Entity1Entity2", - * joinColumns={@JoinColumn(name="key1", referencedColumnName="key1")}, - * inverseJoinColumns={@JoinColumn(name="key3", referencedColumnName="key3")} - * ) - */ - protected $entity2; -} - -/** - * @Entity - */ -class InvalidEntity2 -{ - /** - * @Id @Column - */ - protected $key3; - - /** - * @Id @Column - */ - protected $key4; - - /** - * @ManyToOne(targetEntity="InvalidEntity1") - */ - protected $assoc; -} - -/** - * @Entity(repositoryClass="Entity\Repository\Agent") - * @Table(name="agent") - */ -class DDC1587ValidEntity1 -{ - /** - * @var int - * - * @Id @GeneratedValue - * @Column(name="pk", type="integer") - */ - private $pk; - - /** - * @var string - * - * @Column(name="name", type="string", length=32) - */ - private $name; - - /** - * @var Identifier - * - * @OneToOne(targetEntity="DDC1587ValidEntity2", cascade={"all"}, mappedBy="agent") - * @JoinColumn(name="pk", referencedColumnName="pk_agent") - */ - private $identifier; -} - -/** - * @Entity - * @Table - */ -class DDC1587ValidEntity2 -{ - /** - * @var DDC1587ValidEntity1 - * - * @Id - * @OneToOne(targetEntity="DDC1587ValidEntity1", inversedBy="identifier") - * @JoinColumn(name="pk_agent", referencedColumnName="pk", nullable=false) - */ - private $agent; - - /** - * @var string - * - * @Column(name="num", type="string", length=16, nullable=true) - */ - private $num; -} - -/** - * @Entity - */ -class DDC1649One -{ - /** - * @Id @Column @GeneratedValue - */ - public $id; -} - -/** - * @Entity - */ -class DDC1649Two -{ - /** @Id @ManyToOne(targetEntity="DDC1649One")@JoinColumn(name="id", referencedColumnName="id") */ - public $one; -} - -/** - * @Entity - */ -class DDC1649Three -{ - /** @Id @ManyToOne(targetEntity="DDC1649Two") @JoinColumn(name="id", - * referencedColumnName="id") */ - private $two; -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/SetupTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/SetupTest.php deleted file mode 100644 index 50db4b2..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/SetupTest.php +++ /dev/null @@ -1,110 +0,0 @@ -markTestSkipped("Test only runs in a dev-installation from Github"); - } - - $this->originalAutoloaderCount = count(spl_autoload_functions()); - $this->originalIncludePath = get_include_path(); - } - - public function tearDown() - { - if ( ! $this->originalIncludePath) { - return; - } - - set_include_path($this->originalIncludePath); - $loaders = spl_autoload_functions(); - for ($i = 0; $i < count($loaders); $i++) { - if ($i > $this->originalAutoloaderCount+1) { - spl_autoload_unregister($loaders[$i]); - } - } - } - - public function testGitAutoload() - { - Setup::registerAutoloadGit(__DIR__ . "/../../../../../"); - - $this->assertEquals($this->originalAutoloaderCount + 4, count(spl_autoload_functions())); - } - - public function testPEARAutoload() - { - set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ . "/../../../../../lib/vendor/doctrine-common/lib"); - - Setup::registerAutoloadPEAR(); - - $this->assertEquals($this->originalAutoloaderCount + 2, count(spl_autoload_functions())); - } - - public function testDirectoryAutoload() - { - Setup::registerAutoloadDirectory(__DIR__ . "/../../../../../lib/vendor/doctrine-common/lib"); - - $this->assertEquals($this->originalAutoloaderCount + 2, count(spl_autoload_functions())); - } - - public function testAnnotationConfiguration() - { - $config = Setup::createAnnotationMetadataConfiguration(array(), true); - - $this->assertInstanceOf('Doctrine\ORM\Configuration', $config); - $this->assertEquals(sys_get_temp_dir(), $config->getProxyDir()); - $this->assertEquals('DoctrineProxies', $config->getProxyNamespace()); - $this->assertInstanceOf('Doctrine\ORM\Mapping\Driver\AnnotationDriver', $config->getMetadataDriverImpl()); - } - - public function testXMLConfiguration() - { - $config = Setup::createXMLMetadataConfiguration(array(), true); - - $this->assertInstanceOf('Doctrine\ORM\Configuration', $config); - $this->assertInstanceOf('Doctrine\ORM\Mapping\Driver\XmlDriver', $config->getMetadataDriverImpl()); - } - - public function testYAMLConfiguration() - { - $config = Setup::createYAMLMetadataConfiguration(array(), true); - - $this->assertInstanceOf('Doctrine\ORM\Configuration', $config); - $this->assertInstanceOf('Doctrine\ORM\Mapping\Driver\YamlDriver', $config->getMetadataDriverImpl()); - } - - /** - * @group DDC-1350 - */ - public function testConfigureProxyDir() - { - $config = Setup::createAnnotationMetadataConfiguration(array(), true, "/foo"); - $this->assertEquals('/foo', $config->getProxyDir()); - } - - /** - * @group DDC-1350 - */ - public function testConfigureCache() - { - $cache = new ArrayCache(); - $config = Setup::createAnnotationMetadataConfiguration(array(), true, null, $cache); - - $this->assertSame($cache, $config->getResultCacheImpl()); - $this->assertSame($cache, $config->getMetadataCacheImpl()); - $this->assertSame($cache, $config->getQueryCacheImpl()); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/doctrine1schema/schema.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/doctrine1schema/schema.yml deleted file mode 100644 index efa24c7..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/doctrine1schema/schema.yml +++ /dev/null @@ -1,28 +0,0 @@ -User: - tableName: users - columns: - username: - type: string(255) - length: 100 - notnull: true - unique: true - password: - type: string(255) - clob: clob - test_alias as theAlias: - type: string(255) - indexes: - username: - fields: [username] - type: unique - -Profile: - columns: - first_name: string(255) - last_name: string(255) - user_id: integer - relations: - User: - onDelete: CASCADE - foreignType: one - type: one \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/UnitOfWorkTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/UnitOfWorkTest.php deleted file mode 100644 index 9cc20ad..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/UnitOfWorkTest.php +++ /dev/null @@ -1,312 +0,0 @@ -_connectionMock = new ConnectionMock(array(), new \Doctrine\Tests\Mocks\DriverMock()); - $this->_emMock = EntityManagerMock::create($this->_connectionMock); - // SUT - $this->_unitOfWork = new UnitOfWorkMock($this->_emMock); - $this->_emMock->setUnitOfWork($this->_unitOfWork); - } - - protected function tearDown() { - } - - public function testRegisterRemovedOnNewEntityIsIgnored() - { - $user = new ForumUser(); - $user->username = 'romanb'; - $this->assertFalse($this->_unitOfWork->isScheduledForDelete($user)); - $this->_unitOfWork->scheduleForDelete($user); - $this->assertFalse($this->_unitOfWork->isScheduledForDelete($user)); - } - - - /* Operational tests */ - - public function testSavingSingleEntityWithIdentityColumnForcesInsert() - { - // Setup fake persister and id generator for identity generation - $userPersister = new EntityPersisterMock($this->_emMock, $this->_emMock->getClassMetadata("Doctrine\Tests\Models\Forum\ForumUser")); - $this->_unitOfWork->setEntityPersister('Doctrine\Tests\Models\Forum\ForumUser', $userPersister); - //$idGeneratorMock = new IdentityIdGeneratorMock($this->_emMock); - //$this->_emMock->setIdGenerator('Doctrine\Tests\Models\Forum\ForumUser', $idGeneratorMock); - $userPersister->setMockIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_IDENTITY); - - // Test - $user = new ForumUser(); - $user->username = 'romanb'; - $this->_unitOfWork->persist($user); - - // Check - $this->assertEquals(0, count($userPersister->getInserts())); - $this->assertEquals(0, count($userPersister->getUpdates())); - $this->assertEquals(0, count($userPersister->getDeletes())); - $this->assertFalse($this->_unitOfWork->isInIdentityMap($user)); - // should no longer be scheduled for insert - $this->assertTrue($this->_unitOfWork->isScheduledForInsert($user)); - - // Now lets check whether a subsequent commit() does anything - $userPersister->reset(); - - // Test - $this->_unitOfWork->commit(); - - // Check. - $this->assertEquals(1, count($userPersister->getInserts())); - $this->assertEquals(0, count($userPersister->getUpdates())); - $this->assertEquals(0, count($userPersister->getDeletes())); - - // should have an id - $this->assertTrue(is_numeric($user->id)); - } - - /** - * Tests a scenario where a save() operation is cascaded from a ForumUser - * to its associated ForumAvatar, both entities using IDENTITY id generation. - */ - public function testCascadedIdentityColumnInsert() - { - // Setup fake persister and id generator for identity generation - //ForumUser - $userPersister = new EntityPersisterMock($this->_emMock, $this->_emMock->getClassMetadata("Doctrine\Tests\Models\Forum\ForumUser")); - $this->_unitOfWork->setEntityPersister('Doctrine\Tests\Models\Forum\ForumUser', $userPersister); - //$userIdGeneratorMock = new IdentityIdGeneratorMock($this->_emMock); - //$this->_emMock->setIdGenerator('Doctrine\Tests\Models\Forum\ForumUser', $userIdGeneratorMock); - $userPersister->setMockIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_IDENTITY); - // ForumAvatar - $avatarPersister = new EntityPersisterMock($this->_emMock, $this->_emMock->getClassMetadata("Doctrine\Tests\Models\Forum\ForumAvatar")); - $this->_unitOfWork->setEntityPersister('Doctrine\Tests\Models\Forum\ForumAvatar', $avatarPersister); - //$avatarIdGeneratorMock = new IdentityIdGeneratorMock($this->_emMock); - //$this->_emMock->setIdGenerator('Doctrine\Tests\Models\Forum\ForumAvatar', $avatarIdGeneratorMock); - $avatarPersister->setMockIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_IDENTITY); - - // Test - $user = new ForumUser(); - $user->username = 'romanb'; - $avatar = new ForumAvatar(); - $user->avatar = $avatar; - $this->_unitOfWork->persist($user); // save cascaded to avatar - - $this->_unitOfWork->commit(); - - $this->assertTrue(is_numeric($user->id)); - $this->assertTrue(is_numeric($avatar->id)); - - $this->assertEquals(1, count($userPersister->getInserts())); - $this->assertEquals(0, count($userPersister->getUpdates())); - $this->assertEquals(0, count($userPersister->getDeletes())); - - $this->assertEquals(1, count($avatarPersister->getInserts())); - $this->assertEquals(0, count($avatarPersister->getUpdates())); - $this->assertEquals(0, count($avatarPersister->getDeletes())); - } - - public function testChangeTrackingNotify() - { - $persister = new EntityPersisterMock($this->_emMock, $this->_emMock->getClassMetadata("Doctrine\Tests\ORM\NotifyChangedEntity")); - $this->_unitOfWork->setEntityPersister('Doctrine\Tests\ORM\NotifyChangedEntity', $persister); - $itemPersister = new EntityPersisterMock($this->_emMock, $this->_emMock->getClassMetadata("Doctrine\Tests\ORM\NotifyChangedRelatedItem")); - $this->_unitOfWork->setEntityPersister('Doctrine\Tests\ORM\NotifyChangedRelatedItem', $itemPersister); - - $entity = new NotifyChangedEntity; - $entity->setData('thedata'); - $this->_unitOfWork->persist($entity); - - $this->_unitOfWork->commit(); - $this->assertEquals(1, count($persister->getInserts())); - $persister->reset(); - - $this->assertTrue($this->_unitOfWork->isInIdentityMap($entity)); - - $entity->setData('newdata'); - $entity->setTransient('newtransientvalue'); - - $this->assertTrue($this->_unitOfWork->isScheduledForDirtyCheck($entity)); - - $this->assertEquals(array('data' => array('thedata', 'newdata')), $this->_unitOfWork->getEntityChangeSet($entity)); - - $item = new NotifyChangedRelatedItem(); - $entity->getItems()->add($item); - $item->setOwner($entity); - $this->_unitOfWork->persist($item); - - $this->_unitOfWork->commit(); - $this->assertEquals(1, count($itemPersister->getInserts())); - $persister->reset(); - $itemPersister->reset(); - - - $entity->getItems()->removeElement($item); - $item->setOwner(null); - $this->assertTrue($entity->getItems()->isDirty()); - $this->_unitOfWork->commit(); - $updates = $itemPersister->getUpdates(); - $this->assertEquals(1, count($updates)); - $this->assertTrue($updates[0] === $item); - } - - public function testGetEntityStateOnVersionedEntityWithAssignedIdentifier() - { - $persister = new EntityPersisterMock($this->_emMock, $this->_emMock->getClassMetadata("Doctrine\Tests\ORM\VersionedAssignedIdentifierEntity")); - $this->_unitOfWork->setEntityPersister('Doctrine\Tests\ORM\VersionedAssignedIdentifierEntity', $persister); - - $e = new VersionedAssignedIdentifierEntity(); - $e->id = 42; - $this->assertEquals(UnitOfWork::STATE_NEW, $this->_unitOfWork->getEntityState($e)); - $this->assertFalse($persister->isExistsCalled()); - } - - public function testGetEntityStateWithAssignedIdentity() - { - $persister = new EntityPersisterMock($this->_emMock, $this->_emMock->getClassMetadata("Doctrine\Tests\Models\CMS\CmsPhonenumber")); - $this->_unitOfWork->setEntityPersister('Doctrine\Tests\Models\CMS\CmsPhonenumber', $persister); - - $ph = new \Doctrine\Tests\Models\CMS\CmsPhonenumber(); - $ph->phonenumber = '12345'; - - $this->assertEquals(UnitOfWork::STATE_NEW, $this->_unitOfWork->getEntityState($ph)); - $this->assertTrue($persister->isExistsCalled()); - - $persister->reset(); - - // if the entity is already managed the exists() check should be skipped - $this->_unitOfWork->registerManaged($ph, array('phonenumber' => '12345'), array()); - $this->assertEquals(UnitOfWork::STATE_MANAGED, $this->_unitOfWork->getEntityState($ph)); - $this->assertFalse($persister->isExistsCalled()); - $ph2 = new \Doctrine\Tests\Models\CMS\CmsPhonenumber(); - $ph2->phonenumber = '12345'; - $this->assertEquals(UnitOfWork::STATE_DETACHED, $this->_unitOfWork->getEntityState($ph2)); - $this->assertFalse($persister->isExistsCalled()); - } -} - -/** - * @Entity - */ -class NotifyChangedEntity implements \Doctrine\Common\NotifyPropertyChanged -{ - private $_listeners = array(); - /** - * @Id - * @Column(type="integer") - * @GeneratedValue - */ - private $id; - /** - * @Column(type="string") - */ - private $data; - - private $transient; // not persisted - - /** @OneToMany(targetEntity="NotifyChangedRelatedItem", mappedBy="owner") */ - private $items; - - public function __construct() { - $this->items = new \Doctrine\Common\Collections\ArrayCollection; - } - - public function getId() { - return $this->id; - } - - public function getItems() { - return $this->items; - } - - public function setTransient($value) { - if ($value != $this->transient) { - $this->_onPropertyChanged('transient', $this->transient, $value); - $this->transient = $value; - } - } - - public function getData() { - return $this->data; - } - - public function setData($data) { - if ($data != $this->data) { - $this->_onPropertyChanged('data', $this->data, $data); - $this->data = $data; - } - } - - public function addPropertyChangedListener(\Doctrine\Common\PropertyChangedListener $listener) - { - $this->_listeners[] = $listener; - } - - protected function _onPropertyChanged($propName, $oldValue, $newValue) { - if ($this->_listeners) { - foreach ($this->_listeners as $listener) { - $listener->propertyChanged($this, $propName, $oldValue, $newValue); - } - } - } -} - -/** @Entity */ -class NotifyChangedRelatedItem -{ - /** - * @Id - * @Column(type="integer") - * @GeneratedValue - */ - private $id; - - /** @ManyToOne(targetEntity="NotifyChangedEntity", inversedBy="items") */ - private $owner; - - public function getId() { - return $this->id; - } - - public function getOwner() { - return $this->owner; - } - - public function setOwner($owner) { - $this->owner = $owner; - } -} - -/** @Entity */ -class VersionedAssignedIdentifierEntity -{ - /** - * @Id @Column(type="integer") - */ - public $id; - /** - * @Version @Column(type="integer") - */ - public $version; -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/OrmFunctionalTestCase.php b/vendor/doctrine/orm/tests/Doctrine/Tests/OrmFunctionalTestCase.php deleted file mode 100644 index c0895f0..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/OrmFunctionalTestCase.php +++ /dev/null @@ -1,416 +0,0 @@ - array( - 'Doctrine\Tests\Models\CMS\CmsUser', - 'Doctrine\Tests\Models\CMS\CmsPhonenumber', - 'Doctrine\Tests\Models\CMS\CmsAddress', - 'Doctrine\Tests\Models\CMS\CmsEmail', - 'Doctrine\Tests\Models\CMS\CmsGroup', - 'Doctrine\Tests\Models\CMS\CmsArticle', - 'Doctrine\Tests\Models\CMS\CmsComment', - ), - 'forum' => array(), - 'company' => array( - 'Doctrine\Tests\Models\Company\CompanyPerson', - 'Doctrine\Tests\Models\Company\CompanyEmployee', - 'Doctrine\Tests\Models\Company\CompanyManager', - 'Doctrine\Tests\Models\Company\CompanyOrganization', - 'Doctrine\Tests\Models\Company\CompanyEvent', - 'Doctrine\Tests\Models\Company\CompanyAuction', - 'Doctrine\Tests\Models\Company\CompanyRaffle', - 'Doctrine\Tests\Models\Company\CompanyCar', - 'Doctrine\Tests\Models\Company\CompanyContract', - ), - 'ecommerce' => array( - 'Doctrine\Tests\Models\ECommerce\ECommerceCart', - 'Doctrine\Tests\Models\ECommerce\ECommerceCustomer', - 'Doctrine\Tests\Models\ECommerce\ECommerceProduct', - 'Doctrine\Tests\Models\ECommerce\ECommerceShipping', - 'Doctrine\Tests\Models\ECommerce\ECommerceFeature', - 'Doctrine\Tests\Models\ECommerce\ECommerceCategory' - ), - 'generic' => array( - 'Doctrine\Tests\Models\Generic\BooleanModel', - 'Doctrine\Tests\Models\Generic\DateTimeModel', - 'Doctrine\Tests\Models\Generic\DecimalModel', - 'Doctrine\Tests\Models\Generic\SerializationModel', - ), - 'routing' => array( - 'Doctrine\Tests\Models\Routing\RoutingLeg', - 'Doctrine\Tests\Models\Routing\RoutingLocation', - 'Doctrine\Tests\Models\Routing\RoutingRoute', - 'Doctrine\Tests\Models\Routing\RoutingRouteBooking', - ), - 'navigation' => array( - 'Doctrine\Tests\Models\Navigation\NavUser', - 'Doctrine\Tests\Models\Navigation\NavCountry', - 'Doctrine\Tests\Models\Navigation\NavPhotos', - 'Doctrine\Tests\Models\Navigation\NavTour', - 'Doctrine\Tests\Models\Navigation\NavPointOfInterest', - ), - 'directorytree' => array( - 'Doctrine\Tests\Models\DirectoryTree\AbstractContentItem', - 'Doctrine\Tests\Models\DirectoryTree\File', - 'Doctrine\Tests\Models\DirectoryTree\Directory', - ), - 'ddc117' => array( - 'Doctrine\Tests\Models\DDC117\DDC117Article', - 'Doctrine\Tests\Models\DDC117\DDC117Reference', - 'Doctrine\Tests\Models\DDC117\DDC117Translation', - 'Doctrine\Tests\Models\DDC117\DDC117ArticleDetails', - 'Doctrine\Tests\Models\DDC117\DDC117ApproveChanges', - 'Doctrine\Tests\Models\DDC117\DDC117Editor', - 'Doctrine\Tests\Models\DDC117\DDC117Link', - ), - 'stockexchange' => array( - 'Doctrine\Tests\Models\StockExchange\Bond', - 'Doctrine\Tests\Models\StockExchange\Stock', - 'Doctrine\Tests\Models\StockExchange\Market', - ), - 'legacy' => array( - 'Doctrine\Tests\Models\Legacy\LegacyUser', - 'Doctrine\Tests\Models\Legacy\LegacyUserReference', - 'Doctrine\Tests\Models\Legacy\LegacyArticle', - 'Doctrine\Tests\Models\Legacy\LegacyCar', - ), - 'customtype' => array( - 'Doctrine\Tests\Models\CustomType\CustomTypeChild', - 'Doctrine\Tests\Models\CustomType\CustomTypeParent', - 'Doctrine\Tests\Models\CustomType\CustomTypeUpperCase', - ), - ); - - protected function useModelSet($setName) - { - $this->_usedModelSets[$setName] = true; - } - - /** - * Sweeps the database tables and clears the EntityManager. - */ - protected function tearDown() - { - $conn = static::$_sharedConn; - - $this->_sqlLoggerStack->enabled = false; - - if (isset($this->_usedModelSets['cms'])) { - $conn->executeUpdate('DELETE FROM cms_users_groups'); - $conn->executeUpdate('DELETE FROM cms_groups'); - $conn->executeUpdate('DELETE FROM cms_addresses'); - $conn->executeUpdate('DELETE FROM cms_phonenumbers'); - $conn->executeUpdate('DELETE FROM cms_comments'); - $conn->executeUpdate('DELETE FROM cms_articles'); - $conn->executeUpdate('DELETE FROM cms_users'); - } - - if (isset($this->_usedModelSets['ecommerce'])) { - $conn->executeUpdate('DELETE FROM ecommerce_carts_products'); - $conn->executeUpdate('DELETE FROM ecommerce_products_categories'); - $conn->executeUpdate('DELETE FROM ecommerce_products_related'); - $conn->executeUpdate('DELETE FROM ecommerce_carts'); - $conn->executeUpdate('DELETE FROM ecommerce_customers'); - $conn->executeUpdate('DELETE FROM ecommerce_features'); - $conn->executeUpdate('DELETE FROM ecommerce_products'); - $conn->executeUpdate('DELETE FROM ecommerce_shippings'); - $conn->executeUpdate('UPDATE ecommerce_categories SET parent_id = NULL'); - $conn->executeUpdate('DELETE FROM ecommerce_categories'); - } - - if (isset($this->_usedModelSets['company'])) { - $conn->executeUpdate('DELETE FROM company_contract_employees'); - $conn->executeUpdate('DELETE FROM company_contract_managers'); - $conn->executeUpdate('DELETE FROM company_contracts'); - $conn->executeUpdate('DELETE FROM company_persons_friends'); - $conn->executeUpdate('DELETE FROM company_managers'); - $conn->executeUpdate('DELETE FROM company_employees'); - $conn->executeUpdate('UPDATE company_persons SET spouse_id = NULL'); - $conn->executeUpdate('DELETE FROM company_persons'); - $conn->executeUpdate('DELETE FROM company_raffles'); - $conn->executeUpdate('DELETE FROM company_auctions'); - $conn->executeUpdate('UPDATE company_organizations SET main_event_id = NULL'); - $conn->executeUpdate('DELETE FROM company_events'); - $conn->executeUpdate('DELETE FROM company_organizations'); - } - - if (isset($this->_usedModelSets['generic'])) { - $conn->executeUpdate('DELETE FROM boolean_model'); - $conn->executeUpdate('DELETE FROM date_time_model'); - $conn->executeUpdate('DELETE FROM decimal_model'); - $conn->executeUpdate('DELETE FROM serialize_model'); - } - - if (isset($this->_usedModelSets['routing'])) { - $conn->executeUpdate('DELETE FROM RoutingRouteLegs'); - $conn->executeUpdate('DELETE FROM RoutingRouteBooking'); - $conn->executeUpdate('DELETE FROM RoutingRoute'); - $conn->executeUpdate('DELETE FROM RoutingLeg'); - $conn->executeUpdate('DELETE FROM RoutingLocation'); - } - - if(isset($this->_usedModelSets['navigation'])) { - $conn->executeUpdate('DELETE FROM navigation_tour_pois'); - $conn->executeUpdate('DELETE FROM navigation_photos'); - $conn->executeUpdate('DELETE FROM navigation_pois'); - $conn->executeUpdate('DELETE FROM navigation_tours'); - $conn->executeUpdate('DELETE FROM navigation_countries'); - } - if (isset($this->_usedModelSets['directorytree'])) { - $conn->executeUpdate('DELETE FROM ' . $this->_em->getConnection()->getDatabasePlatform()->quoteIdentifier("file")); - // MySQL doesnt know deferred deletions therefore only executing the second query gives errors. - $conn->executeUpdate('DELETE FROM Directory WHERE parentDirectory_id IS NOT NULL'); - $conn->executeUpdate('DELETE FROM Directory'); - } - if (isset($this->_usedModelSets['ddc117'])) { - return; - $conn->executeUpdate('DELETE FROM ddc117editor_ddc117translation'); - $conn->executeUpdate('DELETE FROM DDC117Editor'); - $conn->executeUpdate('DELETE FROM DDC117ApproveChanges'); - $conn->executeUpdate('DELETE FROM DDC117Link'); - $conn->executeUpdate('DELETE FROM DDC117Reference'); - $conn->executeUpdate('DELETE FROM DDC117ArticleDetails'); - $conn->executeUpdate('DELETE FROM DDC117Translation'); - $conn->executeUpdate('DELETE FROM DDC117Article'); - } - if (isset($this->_usedModelSets['stockexchange'])) { - $conn->executeUpdate('DELETE FROM exchange_bonds_stocks'); - $conn->executeUpdate('DELETE FROM exchange_bonds'); - $conn->executeUpdate('DELETE FROM exchange_stocks'); - $conn->executeUpdate('DELETE FROM exchange_markets'); - } - if (isset($this->_usedModelSets['legacy'])) { - $conn->executeUpdate('DELETE FROM legacy_users_cars'); - $conn->executeUpdate('DELETE FROM legacy_users_reference'); - $conn->executeUpdate('DELETE FROM legacy_articles'); - $conn->executeUpdate('DELETE FROM legacy_cars'); - $conn->executeUpdate('DELETE FROM legacy_users'); - } - - if (isset($this->_usedModelSets['customtype'])) { - $conn->executeUpdate('DELETE FROM customtype_parent_friends'); - $conn->executeUpdate('DELETE FROM customtype_parents'); - $conn->executeUpdate('DELETE FROM customtype_children'); - $conn->executeUpdate('DELETE FROM customtype_uppercases'); - } - - $this->_em->clear(); - } - - protected function setUpEntitySchema(array $classNames) - { - if ($this->_em === null) { - throw new \RuntimeException("EntityManager not set, you have to call parent::setUp() before invoking this method."); - } - - $classes = array(); - foreach ($classNames as $className) { - if ( ! isset(static::$_entityTablesCreated[$className])) { - static::$_entityTablesCreated[$className] = true; - $classes[] = $this->_em->getClassMetadata($className); - } - } - - if ($classes) { - $this->_schemaTool->createSchema($classes); - } - } - - /** - * Creates a connection to the test database, if there is none yet, and - * creates the necessary tables. - */ - protected function setUp() - { - $forceCreateTables = false; - - if ( ! isset(static::$_sharedConn)) { - static::$_sharedConn = TestUtil::getConnection(); - - if (static::$_sharedConn->getDriver() instanceof \Doctrine\DBAL\Driver\PDOSqlite\Driver) { - $forceCreateTables = true; - } - } - - if (isset($GLOBALS['DOCTRINE_MARK_SQL_LOGS'])) { - if (in_array(static::$_sharedConn->getDatabasePlatform()->getName(), array("mysql", "postgresql"))) { - static::$_sharedConn->executeQuery('SELECT 1 /*' . get_class($this) . '*/'); - } else if (static::$_sharedConn->getDatabasePlatform()->getName() == "oracle") { - static::$_sharedConn->executeQuery('SELECT 1 /*' . get_class($this) . '*/ FROM dual'); - } - } - - if ( ! $this->_em) { - $this->_em = $this->_getEntityManager(); - $this->_schemaTool = new \Doctrine\ORM\Tools\SchemaTool($this->_em); - } - - $classes = array(); - - foreach ($this->_usedModelSets as $setName => $bool) { - if ( ! isset(static::$_tablesCreated[$setName])/* || $forceCreateTables*/) { - foreach (static::$_modelSets[$setName] as $className) { - $classes[] = $this->_em->getClassMetadata($className); - } - - static::$_tablesCreated[$setName] = true; - } - } - - if ($classes) { - $this->_schemaTool->createSchema($classes); - } - - $this->_sqlLoggerStack->enabled = true; - } - - /** - * Gets an EntityManager for testing purposes. - * - * @param Configuration $config The Configuration to pass to the EntityManager. - * @param EventManager $eventManager The EventManager to pass to the EntityManager. - * @return EntityManager - */ - protected function _getEntityManager($config = null, $eventManager = null) { - // NOTE: Functional tests use their own shared metadata cache, because - // the actual database platform used during execution has effect on some - // metadata mapping behaviors (like the choice of the ID generation). - if (is_null(self::$_metadataCacheImpl)) { - if (isset($GLOBALS['DOCTRINE_CACHE_IMPL'])) { - self::$_metadataCacheImpl = new $GLOBALS['DOCTRINE_CACHE_IMPL']; - } else { - self::$_metadataCacheImpl = new \Doctrine\Common\Cache\ArrayCache; - } - } - - if (is_null(self::$_queryCacheImpl)) { - self::$_queryCacheImpl = new \Doctrine\Common\Cache\ArrayCache; - } - - $this->_sqlLoggerStack = new \Doctrine\DBAL\Logging\DebugStack(); - $this->_sqlLoggerStack->enabled = false; - - //FIXME: two different configs! $conn and the created entity manager have - // different configs. - $config = new \Doctrine\ORM\Configuration(); - $config->setMetadataCacheImpl(self::$_metadataCacheImpl); - $config->setQueryCacheImpl(self::$_queryCacheImpl); - $config->setProxyDir(__DIR__ . '/Proxies'); - $config->setProxyNamespace('Doctrine\Tests\Proxies'); - - $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver()); - - $conn = static::$_sharedConn; - $conn->getConfiguration()->setSQLLogger($this->_sqlLoggerStack); - - // get rid of more global state - $evm = $conn->getEventManager(); - foreach ($evm->getListeners() AS $event => $listeners) { - foreach ($listeners AS $listener) { - $evm->removeEventListener(array($event), $listener); - } - } - - if (isset($GLOBALS['db_event_subscribers'])) { - foreach (explode(",", $GLOBALS['db_event_subscribers']) AS $subscriberClass) { - $subscriberInstance = new $subscriberClass(); - $evm->addEventSubscriber($subscriberInstance); - } - } - - if (isset($GLOBALS['debug_uow_listener'])) { - $evm->addEventListener(array('onFlush'), new \Doctrine\ORM\Tools\DebugUnitOfWorkListener()); - } - - return \Doctrine\ORM\EntityManager::create($conn, $config); - } - - protected function onNotSuccessfulTest(\Exception $e) - { - if ($e instanceof \PHPUnit_Framework_AssertionFailedError) { - throw $e; - } - - if(isset($this->_sqlLoggerStack->queries) && count($this->_sqlLoggerStack->queries)) { - $queries = ""; - for($i = count($this->_sqlLoggerStack->queries)-1; $i > max(count($this->_sqlLoggerStack->queries)-25, 0) && isset($this->_sqlLoggerStack->queries[$i]); $i--) { - $query = $this->_sqlLoggerStack->queries[$i]; - $params = array_map(function($p) { if (is_object($p)) return get_class($p); else return "'".$p."'"; }, $query['params'] ?: array()); - $queries .= ($i+1).". SQL: '".$query['sql']."' Params: ".implode(", ", $params).PHP_EOL; - } - - $trace = $e->getTrace(); - $traceMsg = ""; - foreach($trace AS $part) { - if(isset($part['file'])) { - if(strpos($part['file'], "PHPUnit/") !== false) { - // Beginning with PHPUnit files we don't print the trace anymore. - break; - } - - $traceMsg .= $part['file'].":".$part['line'].PHP_EOL; - } - } - - $message = "[".get_class($e)."] ".$e->getMessage().PHP_EOL.PHP_EOL."With queries:".PHP_EOL.$queries.PHP_EOL."Trace:".PHP_EOL.$traceMsg; - - throw new \Exception($message, (int)$e->getCode(), $e); - } - throw $e; - } - - /** - * Using the SQL Logger Stack this method retrieves the current query count executed in this test. - * - * @return int - */ - protected function getCurrentQueryCount() - { - return count($this->_sqlLoggerStack->queries); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/OrmPerformanceTestCase.php b/vendor/doctrine/orm/tests/Doctrine/Tests/OrmPerformanceTestCase.php deleted file mode 100644 index ab8fcf5..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/OrmPerformanceTestCase.php +++ /dev/null @@ -1,60 +0,0 @@ -maxRunningTime != 0 && $time > $this->maxRunningTime) { - $this->fail( - sprintf( - 'expected running time: <= %s but was: %s', - - $this->maxRunningTime, - $time - ) - ); - } - } - - /** - * @param integer $maxRunningTime - * @throws InvalidArgumentException - * @since Method available since Release 2.3.0 - */ - public function setMaxRunningTime($maxRunningTime) - { - if (is_integer($maxRunningTime) && $maxRunningTime >= 0) { - $this->maxRunningTime = $maxRunningTime; - } else { - throw new \InvalidArgumentException; - } - } - - /** - * @return integer - * @since Method available since Release 2.3.0 - */ - public function getMaxRunningTime() - { - return $this->maxRunningTime; - } -} - diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/OrmTestCase.php b/vendor/doctrine/orm/tests/Doctrine/Tests/OrmTestCase.php deleted file mode 100644 index f9260d6..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/OrmTestCase.php +++ /dev/null @@ -1,122 +0,0 @@ -=')) { - $reader = new \Doctrine\Common\Annotations\CachedReader( - new \Doctrine\Common\Annotations\AnnotationReader(), new ArrayCache() - ); - } - else if (version_compare(\Doctrine\Common\Version::VERSION, '2.2.0-DEV', '>=')) { - // Register the ORM Annotations in the AnnotationRegistry - $reader = new \Doctrine\Common\Annotations\SimpleAnnotationReader(); - $reader->addNamespace('Doctrine\ORM\Mapping'); - $reader = new \Doctrine\Common\Annotations\CachedReader($reader, new ArrayCache()); - } - else if (version_compare(\Doctrine\Common\Version::VERSION, '2.1.0-BETA3-DEV', '>=')) { - $reader = new \Doctrine\Common\Annotations\AnnotationReader(); - $reader->setIgnoreNotImportedAnnotations(true); - $reader->setEnableParsePhpImports(false); - if ($alias) { - $reader->setAnnotationNamespaceAlias('Doctrine\ORM\Mapping\\', $alias); - } else { - $reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\'); - } - $reader = new \Doctrine\Common\Annotations\CachedReader( - new \Doctrine\Common\Annotations\IndexedReader($reader), new ArrayCache() - ); - } else { - $reader = new \Doctrine\Common\Annotations\AnnotationReader(); - if ($alias) { - $reader->setAnnotationNamespaceAlias('Doctrine\ORM\Mapping\\', $alias); - } else { - $reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\'); - } - } - \Doctrine\Common\Annotations\AnnotationRegistry::registerFile( - __DIR__ . "/../../../lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php"); - return new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader, (array)$paths); - } - - /** - * Creates an EntityManager for testing purposes. - * - * NOTE: The created EntityManager will have its dependant DBAL parts completely - * mocked out using a DriverMock, ConnectionMock, etc. These mocks can then - * be configured in the tests to simulate the DBAL behavior that is desired - * for a particular test, - * - * @return Doctrine\ORM\EntityManager - */ - protected function _getTestEntityManager($conn = null, $conf = null, $eventManager = null, $withSharedMetadata = true) - { - $metadataCache = $withSharedMetadata - ? self::getSharedMetadataCacheImpl() - : new \Doctrine\Common\Cache\ArrayCache; - - $config = new \Doctrine\ORM\Configuration(); - - $config->setMetadataCacheImpl($metadataCache); - $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver()); - $config->setQueryCacheImpl(self::getSharedQueryCacheImpl()); - $config->setProxyDir(__DIR__ . '/Proxies'); - $config->setProxyNamespace('Doctrine\Tests\Proxies'); - - if ($conn === null) { - $conn = array( - 'driverClass' => 'Doctrine\Tests\Mocks\DriverMock', - 'wrapperClass' => 'Doctrine\Tests\Mocks\ConnectionMock', - 'user' => 'john', - 'password' => 'wayne' - ); - } - - if (is_array($conn)) { - $conn = \Doctrine\DBAL\DriverManager::getConnection($conn, $config, $eventManager); - } - - return \Doctrine\Tests\Mocks\EntityManagerMock::create($conn, $config, $eventManager); - } - - private static function getSharedMetadataCacheImpl() - { - if (self::$_metadataCacheImpl === null) { - self::$_metadataCacheImpl = new \Doctrine\Common\Cache\ArrayCache; - } - - return self::$_metadataCacheImpl; - } - - private static function getSharedQueryCacheImpl() - { - if (self::$_queryCacheImpl === null) { - self::$_queryCacheImpl = new \Doctrine\Common\Cache\ArrayCache; - } - - return self::$_queryCacheImpl; - } - - public function assertSQLEquals($expectedSQL, $actualSQL, $failureMessage = null) - { - return $this->assertEquals(strtolower($expectedSQL), strtolower($actualSQL), $failureMessage); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/TestInit.php b/vendor/doctrine/orm/tests/Doctrine/Tests/TestInit.php deleted file mode 100644 index 3a35c21..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/TestInit.php +++ /dev/null @@ -1,43 +0,0 @@ -register(); - -if (isset($GLOBALS['DOCTRINE_DBAL_PATH'])) { - $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', $GLOBALS['DOCTRINE_DBAL_PATH']); -} else { - $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', __DIR__ . '/../../../lib/vendor/doctrine-dbal/lib'); -} -$classLoader->register(); - -$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\ORM', __DIR__ . '/../../../lib'); -$classLoader->register(); - -$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Tests', __DIR__ . '/../../'); -$classLoader->register(); - -$classLoader = new \Doctrine\Common\ClassLoader('Symfony', __DIR__ . "/../../../lib/vendor"); -$classLoader->register(); - -if (!file_exists(__DIR__."/Proxies")) { - if (!mkdir(__DIR__."/Proxies")) { - throw new Exception("Could not create " . __DIR__."/Proxies Folder."); - } -} -if (!file_exists(__DIR__."/ORM/Proxy/generated")) { - if (!mkdir(__DIR__."/ORM/Proxy/generated")) { - throw new Exception("Could not create " . __DIR__."/ORM/Proxy/generated Folder."); - } -} diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/TestUtil.php b/vendor/doctrine/orm/tests/Doctrine/Tests/TestUtil.php deleted file mode 100644 index b78d06e..0000000 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/TestUtil.php +++ /dev/null @@ -1,119 +0,0 @@ -real database connection using the following parameters - * of the $GLOBALS array: - * - * 'db_type' : The name of the Doctrine DBAL database driver to use. - * 'db_username' : The username to use for connecting. - * 'db_password' : The password to use for connecting. - * 'db_host' : The hostname of the database to connect to. - * 'db_name' : The name of the database to connect to. - * 'db_port' : The port of the database to connect to. - * - * Usually these variables of the $GLOBALS array are filled by PHPUnit based - * on an XML configuration file. If no such parameters exist, an SQLite - * in-memory database is used. - * - * IMPORTANT: - * 1) Each invocation of this method returns a NEW database connection. - * 2) The database is dropped and recreated to ensure it's clean. - * - * @return Doctrine\DBAL\Connection The database connection instance. - */ - public static function getConnection() - { - if (isset($GLOBALS['db_type'], $GLOBALS['db_username'], $GLOBALS['db_password'], - $GLOBALS['db_host'], $GLOBALS['db_name'], $GLOBALS['db_port']) && - isset($GLOBALS['tmpdb_type'], $GLOBALS['tmpdb_username'], $GLOBALS['tmpdb_password'], - $GLOBALS['tmpdb_host'], $GLOBALS['tmpdb_name'], $GLOBALS['tmpdb_port'])) { - $realDbParams = array( - 'driver' => $GLOBALS['db_type'], - 'user' => $GLOBALS['db_username'], - 'password' => $GLOBALS['db_password'], - 'host' => $GLOBALS['db_host'], - 'dbname' => $GLOBALS['db_name'], - 'port' => $GLOBALS['db_port'] - ); - $tmpDbParams = array( - 'driver' => $GLOBALS['tmpdb_type'], - 'user' => $GLOBALS['tmpdb_username'], - 'password' => $GLOBALS['tmpdb_password'], - 'host' => $GLOBALS['tmpdb_host'], - 'dbname' => $GLOBALS['tmpdb_name'], - 'port' => $GLOBALS['tmpdb_port'] - ); - - $realConn = \Doctrine\DBAL\DriverManager::getConnection($realDbParams); - - $platform = $realConn->getDatabasePlatform(); - - if ($platform->supportsCreateDropDatabase()) { - $dbname = $realConn->getDatabase(); - // Connect to tmpdb in order to drop and create the real test db. - $tmpConn = \Doctrine\DBAL\DriverManager::getConnection($tmpDbParams); - $realConn->close(); - - $tmpConn->getSchemaManager()->dropDatabase($dbname); - $tmpConn->getSchemaManager()->createDatabase($dbname); - - $tmpConn->close(); - } else { - $sm = $realConn->getSchemaManager(); - - /* @var $schema Schema */ - $schema = $sm->createSchema(); - $stmts = $schema->toDropSql($realConn->getDatabasePlatform()); - - foreach ($stmts AS $stmt) { - try { - $realConn->exec($stmt); - } catch(\Exception $e) { - // TODO: Now is this a real good idea? - } - } - } - - $conn = \Doctrine\DBAL\DriverManager::getConnection($realDbParams, null, null); - } else { - $params = array( - 'driver' => 'pdo_sqlite', - 'memory' => true - ); - if (isset($GLOBALS['db_path'])) { - $params['path'] = $GLOBALS['db_path']; - unlink($GLOBALS['db_path']); - } - $conn = \Doctrine\DBAL\DriverManager::getConnection($params); - } - - return $conn; - } - - /** - * @return \Doctrine\DBAL\Connection - */ - public static function getTempConnection() - { - $tmpDbParams = array( - 'driver' => $GLOBALS['tmpdb_type'], - 'user' => $GLOBALS['tmpdb_username'], - 'password' => $GLOBALS['tmpdb_password'], - 'host' => $GLOBALS['tmpdb_host'], - 'dbname' => $GLOBALS['tmpdb_name'], - 'port' => $GLOBALS['tmpdb_port'] - ); - - // Connect to tmpdb in order to drop and create the real test db. - return \Doctrine\DBAL\DriverManager::getConnection($tmpDbParams); - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/NativePhpunitTask.php b/vendor/doctrine/orm/tests/NativePhpunitTask.php deleted file mode 100644 index 8a3b190..0000000 --- a/vendor/doctrine/orm/tests/NativePhpunitTask.php +++ /dev/null @@ -1,249 +0,0 @@ - - */ -class NativePhpunitTask extends Task -{ - private $test; - private $testfile; - private $testdirectory; - private $configuration = null; - private $coverageClover = null; - private $junitlogfile = null; - private $haltonfailure = true; - private $haltonerror = true; - - public function setTestdirectory($directory) { - $this->testdirectory = $directory; - } - - public function setTest($test) { - $this->test = $test; - } - - public function setTestfile($testfile) { - $this->testfile = $testfile; - } - - public function setJunitlogfile($junitlogfile) { - if (strlen($junitlogfile) == 0) { - $junitlogfile = NULL; - } - - $this->junitlogfile = $junitlogfile; - } - - public function setConfiguration($configuration) { - if (strlen($configuration) == 0) { - $configuration = NULL; - } - - $this->configuration = $configuration; - } - - public function setCoverageClover($coverageClover) { - if (strlen($coverageClover) == 0) { - $coverageClover = NULL; - } - - $this->coverageClover = $coverageClover; - } - - public function setHaltonfailure($haltonfailures) { - $this->haltonfailure = $haltonfailures; - } - - public function setHaltonerror($haltonerrors) { - $this->haltonerror = $haltonerrors; - } - - public function init() - { - require_once "PHPUnit/Runner/Version.php"; - $version = PHPUnit_Runner_Version::id(); - - if (version_compare($version, '3.4.0') < 0) - { - throw new BuildException("NativePHPUnitTask requires PHPUnit version >= 3.2.0", $this->getLocation()); - } - - require_once 'PHPUnit/Util/Filter.php'; - - // point PHPUnit_MAIN_METHOD define to non-existing method - if (!defined('PHPUnit_MAIN_METHOD')) - { - define('PHPUnit_MAIN_METHOD', 'PHPUnitTask::undefined'); - } - } - - public function main() - { - if (!is_dir(realpath($this->testdirectory))) { - throw new BuildException("NativePHPUnitTask requires a Test Directory path given, '".$this->testdirectory."' given."); - } - set_include_path(realpath($this->testdirectory) . PATH_SEPARATOR . get_include_path()); - - $printer = new NativePhpunitPrinter(); - - $arguments = array( - 'configuration' => $this->configuration, - 'coverageClover' => $this->coverageClover, - 'junitLogfile' => $this->junitlogfile, - 'printer' => $printer, - ); - - require_once "PHPUnit/TextUI/TestRunner.php"; - $runner = new PHPUnit_TextUI_TestRunner(); - $suite = $runner->getTest($this->test, $this->testfile, true); - - try { - $result = $runner->doRun($suite, $arguments); - /* @var $result PHPUnit_Framework_TestResult */ - - if ( ($this->haltonfailure && $result->failureCount() > 0) || ($this->haltonerror && $result->errorCount() > 0) ) { - throw new BuildException("PHPUnit: ".$result->failureCount()." Failures and ".$result->errorCount()." Errors, ". - "last failure message: ".$printer->getMessages()); - } - - $this->log("PHPUnit Success: ".count($result->passed())." tests passed, no ". - "failures (".$result->skippedCount()." skipped, ".$result->notImplementedCount()." not implemented)"); - - // Hudson for example doesn't like the backslash in class names - if (file_exists($this->coverageClover)) { - $this->log("Generated Clover Coverage XML to: ".$this->coverageClover); - $content = file_get_contents($this->coverageClover); - $content = str_replace("\\", ".", $content); - file_put_contents($this->coverageClover, $content); - unset($content); - } - - } catch(\Exception $e) { - throw new BuildException("NativePhpunitTask failed: ".$e->getMessage()); - } - } -} - -class NativePhpunitPrinter extends PHPUnit_Util_Printer implements PHPUnit_Framework_TestListener -{ - private $_messages = array(); - - public function write($buffer) - { - // do nothing - } - - public function getMessages() - { - return $this->_messages; - } - - /** - * An error occurred. - * - * @param PHPUnit_Framework_Test $test - * @param Exception $e - * @param float $time - */ - public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) - { - $this->_messages[] = "Test ERROR: ".$test->getName().": ".$e->getMessage(); - } - - /** - * A failure occurred. - * - * @param PHPUnit_Framework_Test $test - * @param PHPUnit_Framework_AssertionFailedError $e - * @param float $time - */ - public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) - { - $this->_messages[] = "Test FAILED: ".$test->getName().": ".$e->getMessage(); - } - - /** - * Incomplete test. - * - * @param PHPUnit_Framework_Test $test - * @param Exception $e - * @param float $time - */ - public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) - { - - } - - /** - * Skipped test. - * - * @param PHPUnit_Framework_Test $test - * @param Exception $e - * @param float $time - * @since Method available since Release 3.0.0 - */ - public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) - { - - } - - /** - * A test suite started. - * - * @param PHPUnit_Framework_TestSuite $suite - * @since Method available since Release 2.2.0 - */ - public function startTestSuite(PHPUnit_Framework_TestSuite $suite) - { - - } - - /** - * A test suite ended. - * - * @param PHPUnit_Framework_TestSuite $suite - * @since Method available since Release 2.2.0 - */ - public function endTestSuite(PHPUnit_Framework_TestSuite $suite) - { - - } - - /** - * A test started. - * - * @param PHPUnit_Framework_Test $test - */ - public function startTest(PHPUnit_Framework_Test $test) - { - - } - - /** - * A test ended. - * - * @param PHPUnit_Framework_Test $test - * @param float $time - */ - public function endTest(PHPUnit_Framework_Test $test, $time) - { - - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/README.markdown b/vendor/doctrine/orm/tests/README.markdown deleted file mode 100644 index c1027ac..0000000 --- a/vendor/doctrine/orm/tests/README.markdown +++ /dev/null @@ -1,25 +0,0 @@ -# Running the Doctrine 2 Testsuite - -## Setting up a PHPUnit Configuration XML - -.. - -## Testing Lock-Support - -The Lock support in Doctrine 2 is tested using Gearman, which allows to run concurrent tasks in parallel. -Install Gearman with PHP as follows: - -1. Go to http://www.gearman.org and download the latest Gearman Server -2. Compile it and then call ldconfig -3. Start it up "gearmand -vvvv" -4. Install pecl/gearman by calling "gearman-beta" - -You can then go into tests/ and start up two workers: - - php Doctrine/Tests/ORM/Functional/Locking/LockAgentWorker.php - -Then run the locking test-suite: - - phpunit --configuration Doctrine/Tests/ORM/Functional/Locking/GearmanLockTest.php - -This can run considerable time, because it is using sleep() to test for the timing ranges of locks. \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/dbproperties.xml.dev b/vendor/doctrine/orm/tests/dbproperties.xml.dev deleted file mode 100644 index 503cb85..0000000 --- a/vendor/doctrine/orm/tests/dbproperties.xml.dev +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/travis/mysql.travis.xml b/vendor/doctrine/orm/tests/travis/mysql.travis.xml deleted file mode 100644 index f17a4b8..0000000 --- a/vendor/doctrine/orm/tests/travis/mysql.travis.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - ./../Doctrine/Tests/ORM - - - - - performance - locking_functional - - - - - diff --git a/vendor/doctrine/orm/tests/travis/pgsql.travis.xml b/vendor/doctrine/orm/tests/travis/pgsql.travis.xml deleted file mode 100644 index fa0581a..0000000 --- a/vendor/doctrine/orm/tests/travis/pgsql.travis.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - ./../Doctrine/Tests/ORM - - - - - - performance - locking_functional - - - - \ No newline at end of file diff --git a/vendor/doctrine/orm/tests/travis/sqlite.travis.xml b/vendor/doctrine/orm/tests/travis/sqlite.travis.xml deleted file mode 100644 index 5d310c3..0000000 --- a/vendor/doctrine/orm/tests/travis/sqlite.travis.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - ./../Doctrine/Tests/ORM - - - - - performance - locking_functional - - - - \ No newline at end of file diff --git a/vendor/doctrine/orm/tools/sandbox/Entities/Address.php b/vendor/doctrine/orm/tools/sandbox/Entities/Address.php deleted file mode 100644 index 717ea63..0000000 --- a/vendor/doctrine/orm/tools/sandbox/Entities/Address.php +++ /dev/null @@ -1,45 +0,0 @@ -id; - } - - public function getStreet() - { - return $this->street; - } - - public function setStreet($street) - { - $this->street = $street; - } - - public function getUser() - { - return $this->user; - } - - public function setUser(User $user) - { - if ($this->user !== $user) { - $this->user = $user; - $user->setAddress($this); - } - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tools/sandbox/Entities/User.php b/vendor/doctrine/orm/tools/sandbox/Entities/User.php deleted file mode 100644 index cd18421..0000000 --- a/vendor/doctrine/orm/tools/sandbox/Entities/User.php +++ /dev/null @@ -1,48 +0,0 @@ -id; - } - - public function getName() - { - return $this->name; - } - - public function setName($name) - { - $this->name = $name; - } - - public function getAddress() - { - return $this->address; - } - - public function setAddress(Address $address) - { - if ($this->address !== $address) { - $this->address = $address; - $address->setUser($this); - } - } -} \ No newline at end of file diff --git a/vendor/doctrine/orm/tools/sandbox/cli-config.php b/vendor/doctrine/orm/tools/sandbox/cli-config.php deleted file mode 100644 index c949668..0000000 --- a/vendor/doctrine/orm/tools/sandbox/cli-config.php +++ /dev/null @@ -1,36 +0,0 @@ -register(); -$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', realpath(__DIR__ . '/../../lib/vendor/doctrine-dbal/lib')); -$classLoader->register(); -$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', realpath(__DIR__ . '/../../lib/vendor/doctrine-common/lib')); -$classLoader->register(); -$classLoader = new \Doctrine\Common\ClassLoader('Symfony', realpath(__DIR__ . '/../../lib/vendor')); -$classLoader->register(); -$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__); -$classLoader->register(); -$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__); -$classLoader->register(); - -$config = new \Doctrine\ORM\Configuration(); -$config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache); -$driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__."/Entities")); -$config->setMetadataDriverImpl($driverImpl); - -$config->setProxyDir(__DIR__ . '/Proxies'); -$config->setProxyNamespace('Proxies'); - -$connectionOptions = array( - 'driver' => 'pdo_sqlite', - 'path' => 'database.sqlite' -); - -$em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config); - -$helpers = array( - 'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()), - 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em) -); \ No newline at end of file diff --git a/vendor/doctrine/orm/tools/sandbox/doctrine b/vendor/doctrine/orm/tools/sandbox/doctrine deleted file mode 100755 index 92f323f..0000000 --- a/vendor/doctrine/orm/tools/sandbox/doctrine +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env php -register(); -$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', realpath(__DIR__ . '/../../lib/vendor/doctrine-dbal/lib')); -$classLoader->register(); -$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', realpath(__DIR__ . '/../../lib/vendor/doctrine-common/lib')); -$classLoader->register(); -$classLoader = new \Doctrine\Common\ClassLoader('Symfony', realpath(__DIR__ . '/../../lib/vendor')); -$classLoader->register(); -$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__); -$classLoader->register(); -$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__); -$classLoader->register(); - -// Variable $helperSet is defined inside cli-config.php -require __DIR__ . '/cli-config.php'; - -$cli = new \Symfony\Component\Console\Application('Doctrine Command Line Interface', Doctrine\Common\Version::VERSION); -$cli->setCatchExceptions(true); -$helperSet = $cli->getHelperSet(); -foreach ($helpers as $name => $helper) { - $helperSet->set($helper, $name); -} -$cli->addCommands(array( - // DBAL Commands - new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(), - new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(), - - // ORM Commands - new \Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand(), - new \Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand(), - new \Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand(), - new \Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand(), - new \Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand(), - new \Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand(), - new \Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand(), - new \Doctrine\ORM\Tools\Console\Command\ConvertDoctrine1SchemaCommand(), - new \Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand(), - new \Doctrine\ORM\Tools\Console\Command\GenerateEntitiesCommand(), - new \Doctrine\ORM\Tools\Console\Command\GenerateProxiesCommand(), - new \Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand(), - new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(), - new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand(), - -)); -$cli->run(); diff --git a/vendor/doctrine/orm/tools/sandbox/index.php b/vendor/doctrine/orm/tools/sandbox/index.php deleted file mode 100644 index ad1cb9d..0000000 --- a/vendor/doctrine/orm/tools/sandbox/index.php +++ /dev/null @@ -1,62 +0,0 @@ -register(); -$classLoader = new ClassLoader('Doctrine\DBAL', realpath(__DIR__ . '/../../lib/vendor/doctrine-dbal/lib')); -$classLoader->register(); -$classLoader = new ClassLoader('Doctrine\Common', realpath(__DIR__ . '/../../lib/vendor/doctrine-common/lib')); -$classLoader->register(); -$classLoader = new ClassLoader('Symfony', realpath(__DIR__ . '/../../lib/vendor')); -$classLoader->register(); -$classLoader = new ClassLoader('Entities', __DIR__); -$classLoader->register(); -$classLoader = new ClassLoader('Proxies', __DIR__); -$classLoader->register(); - -// Set up caches -$config = new Configuration; -$cache = new ApcCache; -$config->setMetadataCacheImpl($cache); -$driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__."/Entities")); -$config->setMetadataDriverImpl($driverImpl); -$config->setQueryCacheImpl($cache); - -// Proxy configuration -$config->setProxyDir(__DIR__ . '/Proxies'); -$config->setProxyNamespace('Proxies'); -$config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache); - -// Database connection information -$connectionOptions = array( - 'driver' => 'pdo_sqlite', - 'path' => 'database.sqlite' -); - -// Create EntityManager -$em = EntityManager::create($connectionOptions, $config); - -## PUT YOUR TEST CODE BELOW - -$user = new User; -$address = new Address; - -echo 'Hello World!' . PHP_EOL; diff --git a/vendor/doctrine/orm/tools/sandbox/xml/Entities.Address.dcm.xml b/vendor/doctrine/orm/tools/sandbox/xml/Entities.Address.dcm.xml deleted file mode 100644 index 7e8dd01..0000000 --- a/vendor/doctrine/orm/tools/sandbox/xml/Entities.Address.dcm.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/doctrine/orm/tools/sandbox/xml/Entities.User.dcm.xml b/vendor/doctrine/orm/tools/sandbox/xml/Entities.User.dcm.xml deleted file mode 100644 index e548fd1..0000000 --- a/vendor/doctrine/orm/tools/sandbox/xml/Entities.User.dcm.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - diff --git a/vendor/doctrine/orm/tools/sandbox/yaml/Entities.Address.dcm.yml b/vendor/doctrine/orm/tools/sandbox/yaml/Entities.Address.dcm.yml deleted file mode 100644 index 140e902..0000000 --- a/vendor/doctrine/orm/tools/sandbox/yaml/Entities.Address.dcm.yml +++ /dev/null @@ -1,16 +0,0 @@ -Entities\Address: - type: entity - table: addresses - id: - id: - type: integer - generator: - strategy: AUTO - fields: - street: - type: string - length: 255 - oneToOne: - user: - targetEntity: User - mappedBy: address \ No newline at end of file diff --git a/vendor/doctrine/orm/tools/sandbox/yaml/Entities.User.dcm.yml b/vendor/doctrine/orm/tools/sandbox/yaml/Entities.User.dcm.yml deleted file mode 100644 index a93d48f..0000000 --- a/vendor/doctrine/orm/tools/sandbox/yaml/Entities.User.dcm.yml +++ /dev/null @@ -1,18 +0,0 @@ -Entities\User: - type: entity - table: users - id: - id: - type: integer - generator: - strategy: AUTO - fields: - name: - type: string - length: 50 - oneToOne: - address: - targetEntity: Address - joinColumn: - name: address_id - referencedColumnName: id diff --git a/vendor/egeloen/ckeditor-bundle/Ivory/CKEditorBundle b/vendor/egeloen/ckeditor-bundle/Ivory/CKEditorBundle deleted file mode 160000 index 98c4ddf..0000000 --- a/vendor/egeloen/ckeditor-bundle/Ivory/CKEditorBundle +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 98c4ddf260aaa663db1082a0cdd4302320cd0431 diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/Aop/InterceptorLoader.php b/vendor/jms/aop-bundle/JMS/AopBundle/Aop/InterceptorLoader.php deleted file mode 100644 index 79ac040..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/Aop/InterceptorLoader.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\Aop; - -use CG\Proxy\InterceptorLoaderInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Lazy-loading interceptor loader implementation. - * - * @author Johannes M. Schmitt - */ -class InterceptorLoader implements InterceptorLoaderInterface -{ - private $container; - private $interceptors; - private $loadedInterceptors = array(); - - public function __construct(ContainerInterface $container, array $interceptors) - { - $this->container = $container; - $this->interceptors = $interceptors; - } - - public function loadInterceptors(\ReflectionMethod $method) - { - if (!isset($this->interceptors[$method->class][$method->name])) { - return array(); - } - - if (isset($this->loadedInterceptors[$method->class][$method->name])) { - return $this->loadedInterceptors[$method->class][$method->name]; - } - - $interceptors = array(); - foreach ($this->interceptors[$method->class][$method->name] as $id) { - $interceptors[] = $this->container->get($id); - } - - return $this->loadedInterceptors[$method->class][$method->name] = $interceptors; - } -} \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/Aop/PointcutContainer.php b/vendor/jms/aop-bundle/JMS/AopBundle/Aop/PointcutContainer.php deleted file mode 100644 index 5c73741..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/Aop/PointcutContainer.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\Aop; - -final class PointcutContainer -{ - private $pointcuts; - - public function __construct(array $pointcuts) - { - $this->pointcuts = $pointcuts; - } - - public function getPointcuts() - { - return $this->pointcuts; - } -} \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/Aop/PointcutInterface.php b/vendor/jms/aop-bundle/JMS/AopBundle/Aop/PointcutInterface.php deleted file mode 100644 index a263d52..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/Aop/PointcutInterface.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\Aop; - -/** - * Pointcut Interface. - * - * Implementations of this class are responsible for making a decision on whether - * a certain method call matches the advice which is associated with this pointcut. - * - * @author Johannes M. Schmitt - */ -interface PointcutInterface -{ - /** - * Determines whether the advice applies to instances of the given class. - * - * There are some limits as to what you can do in this method. Namely, you may - * only base your decision on resources that are part of the ContainerBuilder. - * Specifically, you may not use any data in the class itself, such as - * annotations. - * - * @param \ReflectionClass $class - * @return boolean - */ - function matchesClass(\ReflectionClass $class); - - /** - * Determines whether the advice applies to the given method. - * - * This method is not limited in the way the matchesClass method is. It may - * use information in the associated class to make its decision. - * - * @param \ReflectionMethod $method - * @return boolean - */ - function matchesMethod(\ReflectionMethod $method); -} \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/Aop/RegexPointcut.php b/vendor/jms/aop-bundle/JMS/AopBundle/Aop/RegexPointcut.php deleted file mode 100644 index cbb1404..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/Aop/RegexPointcut.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\Aop; - -/** - * A regex pointcut implementation. - * - * Uses a regular expression for determining whether the pointcut matches. - * - * @author Johannes M. Schmitt - */ -class RegexPointcut implements PointcutInterface -{ - private $pattern; - - public function __construct($pattern) - { - $this->pattern = $pattern; - } - - public function matchesClass(\ReflectionClass $class) - { - return true; - } - - public function matchesMethod(\ReflectionMethod $method) - { - return 0 < preg_match('#'.$this->pattern.'#', sprintf('%s::%s', $method->class, $method->name)); - } -} \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/DependencyInjection/Compiler/PointcutMatchingPass.php b/vendor/jms/aop-bundle/JMS/AopBundle/DependencyInjection/Compiler/PointcutMatchingPass.php deleted file mode 100644 index 51967a6..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/DependencyInjection/Compiler/PointcutMatchingPass.php +++ /dev/null @@ -1,195 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\DependencyInjection\Compiler; - -use CG\Core\ClassUtils; - -use JMS\AopBundle\Exception\RuntimeException; -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\DependencyInjection\Reference; -use CG\Proxy\Enhancer; -use CG\Proxy\InterceptionGenerator; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Matches pointcuts against service methods. - * - * This pass will collect the advices that match a certain method, and then - * generate proxy classes where necessary. - * - * @author Johannes M. Schmitt - */ -class PointcutMatchingPass implements CompilerPassInterface -{ - private $pointcuts; - private $cacheDir; - private $container; - - public function __construct(array $pointcuts = null) - { - $this->pointcuts = $pointcuts; - } - - public function process(ContainerBuilder $container) - { - $this->container = $container; - $this->cacheDir = $container->getParameter('jms_aop.cache_dir').'/proxies'; - $pointcuts = $this->getPointcuts(); - - $interceptors = array(); - foreach ($container->getDefinitions() as $id => $definition) { - $this->processDefinition($definition, $pointcuts, $interceptors); - - $this->processInlineDefinitions($pointcuts, $interceptors, $definition->getArguments()); - $this->processInlineDefinitions($pointcuts, $interceptors, $definition->getMethodCalls()); - $this->processInlineDefinitions($pointcuts, $interceptors, $definition->getProperties()); - } - - $container - ->getDefinition('jms_aop.interceptor_loader') - ->addArgument($interceptors) - ; - } - - private function processInlineDefinitions($pointcuts, &$interceptors, array $a) { - foreach ($a as $k => $v) { - if ($v instanceof Definition) { - $this->processDefinition($v, $pointcuts, $interceptors); - } else if (is_array($v)) { - $this->processInlineDefinitions($pointcuts, $interceptors, $v); - } - } - } - - private function processDefinition(Definition $definition, $pointcuts, &$interceptors) - { - if ($definition->isSynthetic()) { - return; - } - - if ($definition->getFactoryService() || $definition->getFactoryClass()) { - return; - } - - if ($file = $definition->getFile()) { - require_once $file; - } - - if (!class_exists($definition->getClass())) { - return; - } - - $class = new \ReflectionClass($definition->getClass()); - - // check if class is matched - $matchingPointcuts = array(); - foreach ($pointcuts as $interceptor => $pointcut) { - if ($pointcut->matchesClass($class)) { - $matchingPointcuts[$interceptor] = $pointcut; - } - } - - if (empty($matchingPointcuts)) { - return; - } - - $this->addResources($class, $this->container); - - if ($class->isFinal()) { - return; - } - - $classAdvices = array(); - foreach ($class->getMethods(\ReflectionMethod::IS_PROTECTED | \ReflectionMethod::IS_PUBLIC) as $method) { - if ($method->isFinal()) { - continue; - } - - $advices = array(); - foreach ($matchingPointcuts as $interceptor => $pointcut) { - if ($pointcut->matchesMethod($method)) { - $advices[] = $interceptor; - } - } - - if (empty($advices)) { - continue; - } - - $classAdvices[$method->name] = $advices; - } - - if (empty($classAdvices)) { - return; - } - - $interceptors[ClassUtils::getUserClass($class->name)] = $classAdvices; - - $generator = new InterceptionGenerator(); - $generator->setFilter(function(\ReflectionMethod $method) use ($classAdvices) { - return isset($classAdvices[$method->name]); - }); - if ($file) { - $generator->setRequiredFile($file); - } - $enhancer = new Enhancer($class, array(), array( - $generator - )); - $enhancer->writeClass($filename = $this->cacheDir.'/'.str_replace('\\', '-', $class->name).'.php'); - $definition->setFile($filename); - $definition->setClass($enhancer->getClassName($class)); - $definition->addMethodCall('__CGInterception__setLoader', array( - new Reference('jms_aop.interceptor_loader') - )); - } - - private function addResources(\ReflectionClass $class) - { - do { - $this->container->addResource(new FileResource($class->getFilename())); - } while (($class = $class->getParentClass()) && $class->getFilename()); - } - - private function getPointcuts() - { - if (null !== $this->pointcuts) { - return $this->pointcuts; - } - - $pointcuts = $pointcutReferences = array(); - - foreach ($this->container->findTaggedServiceIds('jms_aop.pointcut') as $id => $attr) { - if (!isset($attr[0]['interceptor'])) { - throw new RuntimeException('You need to set the "interceptor" attribute for the "jms_aop.pointcut" tag of service "'.$id.'".'); - } - - $pointcutReferences[$attr[0]['interceptor']] = new Reference($id); - $pointcuts[$attr[0]['interceptor']] = $this->container->get($id); - } - - $this->container - ->getDefinition('jms_aop.pointcut_container') - ->addArgument($pointcutReferences) - ; - - return $pointcuts; - } -} diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/DependencyInjection/Configuration.php b/vendor/jms/aop-bundle/JMS/AopBundle/DependencyInjection/Configuration.php deleted file mode 100644 index 947cdf5..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/DependencyInjection/Configuration.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\DependencyInjection; - -use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\Config\Definition\ConfigurationInterface; - -/** - * This is the class that validates and merges configuration from your app/config files - * - * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class} - */ -class Configuration implements ConfigurationInterface -{ - /** - * {@inheritDoc} - */ - public function getConfigTreeBuilder() - { - $treeBuilder = new TreeBuilder(); - $treeBuilder->root('jms_aop') - ->children() - ->scalarNode('cache_dir')->cannotBeEmpty()->defaultValue('%kernel.cache_dir%/jms_aop')->end() - ->end() - ; - - return $treeBuilder; - } -} diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/DependencyInjection/JMSAopExtension.php b/vendor/jms/aop-bundle/JMS/AopBundle/DependencyInjection/JMSAopExtension.php deleted file mode 100644 index 6f9a1e3..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/DependencyInjection/JMSAopExtension.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\DependencyInjection; - -use JMS\AopBundle\Exception\RuntimeException; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\Config\FileLocator; -use Symfony\Component\HttpKernel\DependencyInjection\Extension; -use Symfony\Component\DependencyInjection\Loader; - -/** - * JMSAopExtension. - * - * @author Johannes M. Schmitt - */ -class JMSAopExtension extends Extension -{ - /** - * {@inheritDoc} - */ - public function load(array $configs, ContainerBuilder $container) - { - $configuration = new Configuration(); - $config = $this->processConfiguration($configuration, $configs); - - $cacheDir = $container->getParameterBag()->resolveValue($config['cache_dir']); - if (!is_dir($cacheDir)) { - if (false === @mkdir($cacheDir, 0777, true)) { - throw new RuntimeException(sprintf('Could not create cache directory "%s".', $cacheDir)); - } - } - $container->setParameter('jms_aop.cache_dir', $cacheDir); - - $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('services.xml'); - } -} diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/Exception/Exception.php b/vendor/jms/aop-bundle/JMS/AopBundle/Exception/Exception.php deleted file mode 100644 index 1cbc27e..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/Exception/Exception.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\Exception; - -/** - * Base exception for the AopBundle. - * - * @author Johannes M. Schmitt - */ -interface Exception -{ -} \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/Exception/RuntimeException.php b/vendor/jms/aop-bundle/JMS/AopBundle/Exception/RuntimeException.php deleted file mode 100644 index 02a0db4..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/Exception/RuntimeException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\Exception; - -/** - * RuntimeException for the AopBundle. - * - * @author Johannes M. Schmitt - */ -class RuntimeException extends \RuntimeException implements Exception -{ -} \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/JMSAopBundle.php b/vendor/jms/aop-bundle/JMS/AopBundle/JMSAopBundle.php deleted file mode 100644 index dbd6b8b..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/JMSAopBundle.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle; - -use Symfony\Component\DependencyInjection\Compiler\PassConfig; -use JMS\AopBundle\DependencyInjection\Compiler\PointcutMatchingPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\HttpKernel\Bundle\Bundle; - -class JMSAopBundle extends Bundle -{ - const VERSION = '1.0.0'; - - public function build(ContainerBuilder $container) - { - $container->addCompilerPass(new PointcutMatchingPass(), PassConfig::TYPE_AFTER_REMOVING); - } -} diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/README b/vendor/jms/aop-bundle/JMS/AopBundle/README deleted file mode 100644 index 72bab21..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/README +++ /dev/null @@ -1,8 +0,0 @@ -For documentation, see: - - Resources/doc - - -For license, see: - - Resources/meta/LICENSE \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/Resources/config/services.xml b/vendor/jms/aop-bundle/JMS/AopBundle/Resources/config/services.xml deleted file mode 100644 index c1caed4..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/Resources/config/services.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - JMS\AopBundle\Aop\InterceptorLoader - - - - - - - - - - diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/Resources/doc/index.rst b/vendor/jms/aop-bundle/JMS/AopBundle/Resources/doc/index.rst deleted file mode 100644 index e637fb0..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/Resources/doc/index.rst +++ /dev/null @@ -1,252 +0,0 @@ -======== -Overview -======== - -This bundle adds AOP capabilities to Symfony2. - -If you haven't heard of AOP yet, it basically allows you to separate a -cross-cutting concern (for example, security checks) into a dedicated class, -and not having to repeat that code in all places where it is needed. - -In other words, this allows you to execute custom code before, and after the -invocation of certain methods in your service layer, or your controllers. You -can also choose to skip the invocation of the original method, or throw exceptions. - -Installation ------------- -Checkout a copy of the code:: - - git submodule add https://github.com/schmittjoh/JMSAopBundle.git src/JMS/AopBundle - -Then register the bundle with your kernel:: - - // in AppKernel::registerBundles() - $bundles = array( - // ... - new JMS\AopBundle\JMSAopBundle(), - // ... - ); - -This bundle also requires the CG library for code generation:: - - git submodule add https://github.com/schmittjoh/cg-library.git vendor/cg-library - -Make sure that you also register the namespaces with the autoloader:: - - // app/autoload.php - $loader->registerNamespaces(array( - // ... - 'JMS' => __DIR__.'/../vendor/bundles', - 'CG' => __DIR__.'/../vendor/cg-library/src', - // ... - )); - - -Configuration -------------- -:: - - jms_aop: - cache_dir: %kernel.cache_dir%/jms_aop - - -Usage ------ -In order to execute custom code, you need two classes. First, you need a so-called -pointcut. The purpose of this class is to make a decision whether a method call -should be intercepted by a certain interceptor. This decision has to be made -statically only on the basis of the method signature itself. - -The second class is the interceptor. This class is being called instead -of the original method. It contains the custom code that you would like to -execute. At this point, you have access to the object on which the method is -called, and all the arguments which were passed to that method. - -Examples --------- - -1. Logging -~~~~~~~~~~ - -In this example, we will be implementing logging for all methods that contain -"delete". - -Pointcut -^^^^^^^^ - -:: - - name, 'delete'); - } - } - -:: - - # services.yml - services: - my_logging_pointcut: - class: LoggingPointcut - tags: - - { name: jms_aop.pointcut, interceptor: logging_interceptor } - - -LoggingInterceptor -^^^^^^^^^^^^^^^^^^ - -:: - - context = $context; - $this->logger = $logger; - } - - public function intercept(MethodInvocation $invocation) - { - $user = $this->context->getToken()->getUsername(); - $this->logger->info(sprintf('User "%s" invoked method "%s".', $user, $invocation->reflection->name)); - - // make sure to proceed with the invocation otherwise the original - // method will never be called - return $invocation->proceed(); - } - } - -:: - - # services.yml - services: - logging_interceptor: - class: LoggingInterceptor - arguments: [@security.context, @logger] - - -2. Transaction Management -~~~~~~~~~~~~~~~~~~~~~~~~~ - -In this example, we add a @Transactional annotation, and we automatically wrap all methods -where this annotation is declared in a transaction. - -Pointcut -^^^^^^^^ - -:: - - use Doctrine\Common\Annotations\Reader; - use JMS\AopBundle\Aop\PointcutInterface; - use JMS\DiExtraBundle\Annotation as DI; - - /** - * @DI\Service - * @DI\Tag("jms_aop.pointcut", attributes = {"interceptor" = "aop.transactional_interceptor"}) - * - * @author Johannes M. Schmitt - */ - class TransactionalPointcut implements PointcutInterface - { - private $reader; - - /** - * @DI\InjectParams({ - * "reader" = @DI\Inject("annotation_reader"), - * }) - * @param Reader $reader - */ - public function __construct(Reader $reader) - { - $this->reader = $reader; - } - - public function matchesClass(\ReflectionClass $class) - { - return true; - } - - public function matchesMethod(\ReflectionMethod $method) - { - return null !== $this->reader->getMethodAnnotation($method, 'Annotation\Transactional'); - } - } - -Interceptor -^^^^^^^^^^^ - -:: - - use Symfony\Component\HttpKernel\Log\LoggerInterface; - use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; - use CG\Proxy\MethodInvocation; - use CG\Proxy\MethodInterceptorInterface; - use Doctrine\ORM\EntityManager; - use JMS\DiExtraBundle\Annotation as DI; - - /** - * @DI\Service("aop.transactional_interceptor") - * - * @author Johannes M. Schmitt - */ - class TransactionalInterceptor implements MethodInterceptorInterface - { - private $em; - private $logger; - - /** - * @DI\InjectParams - * @param EntityManager $em - */ - public function __construct(EntityManager $em, LoggerInterface $logger) - { - $this->em = $em; - $this->logger = $logger; - } - - public function intercept(MethodInvocation $invocation) - { - $this->logger->info('Beginning transaction for method "'.$invocation.'")'); - $this->em->getConnection()->beginTransaction(); - try { - $rs = $invocation->proceed(); - - $this->logger->info(sprintf('Comitting transaction for method "%s" (method invocation successful)', $invocation)); - $this->em->getConnection()->commit(); - - return $rs; - } catch (\Exception $ex) { - if ($ex instanceof NotFoundHttpException) { - $this->logger->info(sprintf('Committing transaction for method "%s" (exception thrown, but no rollback)', $invocation)); - $this->em->getConnection()->commit(); - } else { - $this->logger->info(sprintf('Rolling back transaction for method "%s" (exception thrown)', $invocation)); - $this->em->getConnection()->rollBack(); - } - - throw $ex; - } - } - } diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/Resources/meta/LICENSE b/vendor/jms/aop-bundle/JMS/AopBundle/Resources/meta/LICENSE deleted file mode 100644 index 753842b..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/Resources/meta/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/composer.json b/vendor/jms/aop-bundle/JMS/AopBundle/composer.json deleted file mode 100644 index 1fe7e80..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/composer.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "jms/aop-bundle", - "description": "Adds AOP capabilities to Symfony2", - "keywords": ["annotations","aop"], - "type": "symfony-bundle", - "license": "Apache", - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "require": { - "symfony/framework-bundle": "2.*", - "jms/cg": "1.0.0" - }, - "autoload": { - "psr-0": { "JMS\\AopBundle": "" } - }, - "target-dir": "JMS/AopBundle" -} diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Aop/InterceptorLoader.php b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Aop/InterceptorLoader.php deleted file mode 100644 index 79ac040..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Aop/InterceptorLoader.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\Aop; - -use CG\Proxy\InterceptorLoaderInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Lazy-loading interceptor loader implementation. - * - * @author Johannes M. Schmitt - */ -class InterceptorLoader implements InterceptorLoaderInterface -{ - private $container; - private $interceptors; - private $loadedInterceptors = array(); - - public function __construct(ContainerInterface $container, array $interceptors) - { - $this->container = $container; - $this->interceptors = $interceptors; - } - - public function loadInterceptors(\ReflectionMethod $method) - { - if (!isset($this->interceptors[$method->class][$method->name])) { - return array(); - } - - if (isset($this->loadedInterceptors[$method->class][$method->name])) { - return $this->loadedInterceptors[$method->class][$method->name]; - } - - $interceptors = array(); - foreach ($this->interceptors[$method->class][$method->name] as $id) { - $interceptors[] = $this->container->get($id); - } - - return $this->loadedInterceptors[$method->class][$method->name] = $interceptors; - } -} \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Aop/PointcutContainer.php b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Aop/PointcutContainer.php deleted file mode 100644 index 5c73741..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Aop/PointcutContainer.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\Aop; - -final class PointcutContainer -{ - private $pointcuts; - - public function __construct(array $pointcuts) - { - $this->pointcuts = $pointcuts; - } - - public function getPointcuts() - { - return $this->pointcuts; - } -} \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Aop/PointcutInterface.php b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Aop/PointcutInterface.php deleted file mode 100644 index a263d52..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Aop/PointcutInterface.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\Aop; - -/** - * Pointcut Interface. - * - * Implementations of this class are responsible for making a decision on whether - * a certain method call matches the advice which is associated with this pointcut. - * - * @author Johannes M. Schmitt - */ -interface PointcutInterface -{ - /** - * Determines whether the advice applies to instances of the given class. - * - * There are some limits as to what you can do in this method. Namely, you may - * only base your decision on resources that are part of the ContainerBuilder. - * Specifically, you may not use any data in the class itself, such as - * annotations. - * - * @param \ReflectionClass $class - * @return boolean - */ - function matchesClass(\ReflectionClass $class); - - /** - * Determines whether the advice applies to the given method. - * - * This method is not limited in the way the matchesClass method is. It may - * use information in the associated class to make its decision. - * - * @param \ReflectionMethod $method - * @return boolean - */ - function matchesMethod(\ReflectionMethod $method); -} \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Aop/RegexPointcut.php b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Aop/RegexPointcut.php deleted file mode 100644 index cbb1404..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Aop/RegexPointcut.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\Aop; - -/** - * A regex pointcut implementation. - * - * Uses a regular expression for determining whether the pointcut matches. - * - * @author Johannes M. Schmitt - */ -class RegexPointcut implements PointcutInterface -{ - private $pattern; - - public function __construct($pattern) - { - $this->pattern = $pattern; - } - - public function matchesClass(\ReflectionClass $class) - { - return true; - } - - public function matchesMethod(\ReflectionMethod $method) - { - return 0 < preg_match('#'.$this->pattern.'#', sprintf('%s::%s', $method->class, $method->name)); - } -} \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/DependencyInjection/Compiler/PointcutMatchingPass.php b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/DependencyInjection/Compiler/PointcutMatchingPass.php deleted file mode 100644 index 51967a6..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/DependencyInjection/Compiler/PointcutMatchingPass.php +++ /dev/null @@ -1,195 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\DependencyInjection\Compiler; - -use CG\Core\ClassUtils; - -use JMS\AopBundle\Exception\RuntimeException; -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\DependencyInjection\Reference; -use CG\Proxy\Enhancer; -use CG\Proxy\InterceptionGenerator; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Matches pointcuts against service methods. - * - * This pass will collect the advices that match a certain method, and then - * generate proxy classes where necessary. - * - * @author Johannes M. Schmitt - */ -class PointcutMatchingPass implements CompilerPassInterface -{ - private $pointcuts; - private $cacheDir; - private $container; - - public function __construct(array $pointcuts = null) - { - $this->pointcuts = $pointcuts; - } - - public function process(ContainerBuilder $container) - { - $this->container = $container; - $this->cacheDir = $container->getParameter('jms_aop.cache_dir').'/proxies'; - $pointcuts = $this->getPointcuts(); - - $interceptors = array(); - foreach ($container->getDefinitions() as $id => $definition) { - $this->processDefinition($definition, $pointcuts, $interceptors); - - $this->processInlineDefinitions($pointcuts, $interceptors, $definition->getArguments()); - $this->processInlineDefinitions($pointcuts, $interceptors, $definition->getMethodCalls()); - $this->processInlineDefinitions($pointcuts, $interceptors, $definition->getProperties()); - } - - $container - ->getDefinition('jms_aop.interceptor_loader') - ->addArgument($interceptors) - ; - } - - private function processInlineDefinitions($pointcuts, &$interceptors, array $a) { - foreach ($a as $k => $v) { - if ($v instanceof Definition) { - $this->processDefinition($v, $pointcuts, $interceptors); - } else if (is_array($v)) { - $this->processInlineDefinitions($pointcuts, $interceptors, $v); - } - } - } - - private function processDefinition(Definition $definition, $pointcuts, &$interceptors) - { - if ($definition->isSynthetic()) { - return; - } - - if ($definition->getFactoryService() || $definition->getFactoryClass()) { - return; - } - - if ($file = $definition->getFile()) { - require_once $file; - } - - if (!class_exists($definition->getClass())) { - return; - } - - $class = new \ReflectionClass($definition->getClass()); - - // check if class is matched - $matchingPointcuts = array(); - foreach ($pointcuts as $interceptor => $pointcut) { - if ($pointcut->matchesClass($class)) { - $matchingPointcuts[$interceptor] = $pointcut; - } - } - - if (empty($matchingPointcuts)) { - return; - } - - $this->addResources($class, $this->container); - - if ($class->isFinal()) { - return; - } - - $classAdvices = array(); - foreach ($class->getMethods(\ReflectionMethod::IS_PROTECTED | \ReflectionMethod::IS_PUBLIC) as $method) { - if ($method->isFinal()) { - continue; - } - - $advices = array(); - foreach ($matchingPointcuts as $interceptor => $pointcut) { - if ($pointcut->matchesMethod($method)) { - $advices[] = $interceptor; - } - } - - if (empty($advices)) { - continue; - } - - $classAdvices[$method->name] = $advices; - } - - if (empty($classAdvices)) { - return; - } - - $interceptors[ClassUtils::getUserClass($class->name)] = $classAdvices; - - $generator = new InterceptionGenerator(); - $generator->setFilter(function(\ReflectionMethod $method) use ($classAdvices) { - return isset($classAdvices[$method->name]); - }); - if ($file) { - $generator->setRequiredFile($file); - } - $enhancer = new Enhancer($class, array(), array( - $generator - )); - $enhancer->writeClass($filename = $this->cacheDir.'/'.str_replace('\\', '-', $class->name).'.php'); - $definition->setFile($filename); - $definition->setClass($enhancer->getClassName($class)); - $definition->addMethodCall('__CGInterception__setLoader', array( - new Reference('jms_aop.interceptor_loader') - )); - } - - private function addResources(\ReflectionClass $class) - { - do { - $this->container->addResource(new FileResource($class->getFilename())); - } while (($class = $class->getParentClass()) && $class->getFilename()); - } - - private function getPointcuts() - { - if (null !== $this->pointcuts) { - return $this->pointcuts; - } - - $pointcuts = $pointcutReferences = array(); - - foreach ($this->container->findTaggedServiceIds('jms_aop.pointcut') as $id => $attr) { - if (!isset($attr[0]['interceptor'])) { - throw new RuntimeException('You need to set the "interceptor" attribute for the "jms_aop.pointcut" tag of service "'.$id.'".'); - } - - $pointcutReferences[$attr[0]['interceptor']] = new Reference($id); - $pointcuts[$attr[0]['interceptor']] = $this->container->get($id); - } - - $this->container - ->getDefinition('jms_aop.pointcut_container') - ->addArgument($pointcutReferences) - ; - - return $pointcuts; - } -} diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/DependencyInjection/Configuration.php b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/DependencyInjection/Configuration.php deleted file mode 100644 index 947cdf5..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/DependencyInjection/Configuration.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\DependencyInjection; - -use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\Config\Definition\ConfigurationInterface; - -/** - * This is the class that validates and merges configuration from your app/config files - * - * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class} - */ -class Configuration implements ConfigurationInterface -{ - /** - * {@inheritDoc} - */ - public function getConfigTreeBuilder() - { - $treeBuilder = new TreeBuilder(); - $treeBuilder->root('jms_aop') - ->children() - ->scalarNode('cache_dir')->cannotBeEmpty()->defaultValue('%kernel.cache_dir%/jms_aop')->end() - ->end() - ; - - return $treeBuilder; - } -} diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/DependencyInjection/JMSAopExtension.php b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/DependencyInjection/JMSAopExtension.php deleted file mode 100644 index 6f9a1e3..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/DependencyInjection/JMSAopExtension.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\DependencyInjection; - -use JMS\AopBundle\Exception\RuntimeException; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\Config\FileLocator; -use Symfony\Component\HttpKernel\DependencyInjection\Extension; -use Symfony\Component\DependencyInjection\Loader; - -/** - * JMSAopExtension. - * - * @author Johannes M. Schmitt - */ -class JMSAopExtension extends Extension -{ - /** - * {@inheritDoc} - */ - public function load(array $configs, ContainerBuilder $container) - { - $configuration = new Configuration(); - $config = $this->processConfiguration($configuration, $configs); - - $cacheDir = $container->getParameterBag()->resolveValue($config['cache_dir']); - if (!is_dir($cacheDir)) { - if (false === @mkdir($cacheDir, 0777, true)) { - throw new RuntimeException(sprintf('Could not create cache directory "%s".', $cacheDir)); - } - } - $container->setParameter('jms_aop.cache_dir', $cacheDir); - - $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('services.xml'); - } -} diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Exception/Exception.php b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Exception/Exception.php deleted file mode 100644 index 1cbc27e..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Exception/Exception.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\Exception; - -/** - * Base exception for the AopBundle. - * - * @author Johannes M. Schmitt - */ -interface Exception -{ -} \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Exception/RuntimeException.php b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Exception/RuntimeException.php deleted file mode 100644 index 02a0db4..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Exception/RuntimeException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\Exception; - -/** - * RuntimeException for the AopBundle. - * - * @author Johannes M. Schmitt - */ -class RuntimeException extends \RuntimeException implements Exception -{ -} \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/JMSAopBundle.php b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/JMSAopBundle.php deleted file mode 100644 index dbd6b8b..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/JMSAopBundle.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle; - -use Symfony\Component\DependencyInjection\Compiler\PassConfig; -use JMS\AopBundle\DependencyInjection\Compiler\PointcutMatchingPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\HttpKernel\Bundle\Bundle; - -class JMSAopBundle extends Bundle -{ - const VERSION = '1.0.0'; - - public function build(ContainerBuilder $container) - { - $container->addCompilerPass(new PointcutMatchingPass(), PassConfig::TYPE_AFTER_REMOVING); - } -} diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/README b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/README deleted file mode 100644 index 72bab21..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/README +++ /dev/null @@ -1,8 +0,0 @@ -For documentation, see: - - Resources/doc - - -For license, see: - - Resources/meta/LICENSE \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Resources/config/services.xml b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Resources/config/services.xml deleted file mode 100644 index c1caed4..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Resources/config/services.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - JMS\AopBundle\Aop\InterceptorLoader - - - - - - - - - - diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Resources/doc/index.rst b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Resources/doc/index.rst deleted file mode 100644 index e637fb0..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Resources/doc/index.rst +++ /dev/null @@ -1,252 +0,0 @@ -======== -Overview -======== - -This bundle adds AOP capabilities to Symfony2. - -If you haven't heard of AOP yet, it basically allows you to separate a -cross-cutting concern (for example, security checks) into a dedicated class, -and not having to repeat that code in all places where it is needed. - -In other words, this allows you to execute custom code before, and after the -invocation of certain methods in your service layer, or your controllers. You -can also choose to skip the invocation of the original method, or throw exceptions. - -Installation ------------- -Checkout a copy of the code:: - - git submodule add https://github.com/schmittjoh/JMSAopBundle.git src/JMS/AopBundle - -Then register the bundle with your kernel:: - - // in AppKernel::registerBundles() - $bundles = array( - // ... - new JMS\AopBundle\JMSAopBundle(), - // ... - ); - -This bundle also requires the CG library for code generation:: - - git submodule add https://github.com/schmittjoh/cg-library.git vendor/cg-library - -Make sure that you also register the namespaces with the autoloader:: - - // app/autoload.php - $loader->registerNamespaces(array( - // ... - 'JMS' => __DIR__.'/../vendor/bundles', - 'CG' => __DIR__.'/../vendor/cg-library/src', - // ... - )); - - -Configuration -------------- -:: - - jms_aop: - cache_dir: %kernel.cache_dir%/jms_aop - - -Usage ------ -In order to execute custom code, you need two classes. First, you need a so-called -pointcut. The purpose of this class is to make a decision whether a method call -should be intercepted by a certain interceptor. This decision has to be made -statically only on the basis of the method signature itself. - -The second class is the interceptor. This class is being called instead -of the original method. It contains the custom code that you would like to -execute. At this point, you have access to the object on which the method is -called, and all the arguments which were passed to that method. - -Examples --------- - -1. Logging -~~~~~~~~~~ - -In this example, we will be implementing logging for all methods that contain -"delete". - -Pointcut -^^^^^^^^ - -:: - - name, 'delete'); - } - } - -:: - - # services.yml - services: - my_logging_pointcut: - class: LoggingPointcut - tags: - - { name: jms_aop.pointcut, interceptor: logging_interceptor } - - -LoggingInterceptor -^^^^^^^^^^^^^^^^^^ - -:: - - context = $context; - $this->logger = $logger; - } - - public function intercept(MethodInvocation $invocation) - { - $user = $this->context->getToken()->getUsername(); - $this->logger->info(sprintf('User "%s" invoked method "%s".', $user, $invocation->reflection->name)); - - // make sure to proceed with the invocation otherwise the original - // method will never be called - return $invocation->proceed(); - } - } - -:: - - # services.yml - services: - logging_interceptor: - class: LoggingInterceptor - arguments: [@security.context, @logger] - - -2. Transaction Management -~~~~~~~~~~~~~~~~~~~~~~~~~ - -In this example, we add a @Transactional annotation, and we automatically wrap all methods -where this annotation is declared in a transaction. - -Pointcut -^^^^^^^^ - -:: - - use Doctrine\Common\Annotations\Reader; - use JMS\AopBundle\Aop\PointcutInterface; - use JMS\DiExtraBundle\Annotation as DI; - - /** - * @DI\Service - * @DI\Tag("jms_aop.pointcut", attributes = {"interceptor" = "aop.transactional_interceptor"}) - * - * @author Johannes M. Schmitt - */ - class TransactionalPointcut implements PointcutInterface - { - private $reader; - - /** - * @DI\InjectParams({ - * "reader" = @DI\Inject("annotation_reader"), - * }) - * @param Reader $reader - */ - public function __construct(Reader $reader) - { - $this->reader = $reader; - } - - public function matchesClass(\ReflectionClass $class) - { - return true; - } - - public function matchesMethod(\ReflectionMethod $method) - { - return null !== $this->reader->getMethodAnnotation($method, 'Annotation\Transactional'); - } - } - -Interceptor -^^^^^^^^^^^ - -:: - - use Symfony\Component\HttpKernel\Log\LoggerInterface; - use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; - use CG\Proxy\MethodInvocation; - use CG\Proxy\MethodInterceptorInterface; - use Doctrine\ORM\EntityManager; - use JMS\DiExtraBundle\Annotation as DI; - - /** - * @DI\Service("aop.transactional_interceptor") - * - * @author Johannes M. Schmitt - */ - class TransactionalInterceptor implements MethodInterceptorInterface - { - private $em; - private $logger; - - /** - * @DI\InjectParams - * @param EntityManager $em - */ - public function __construct(EntityManager $em, LoggerInterface $logger) - { - $this->em = $em; - $this->logger = $logger; - } - - public function intercept(MethodInvocation $invocation) - { - $this->logger->info('Beginning transaction for method "'.$invocation.'")'); - $this->em->getConnection()->beginTransaction(); - try { - $rs = $invocation->proceed(); - - $this->logger->info(sprintf('Comitting transaction for method "%s" (method invocation successful)', $invocation)); - $this->em->getConnection()->commit(); - - return $rs; - } catch (\Exception $ex) { - if ($ex instanceof NotFoundHttpException) { - $this->logger->info(sprintf('Committing transaction for method "%s" (exception thrown, but no rollback)', $invocation)); - $this->em->getConnection()->commit(); - } else { - $this->logger->info(sprintf('Rolling back transaction for method "%s" (exception thrown)', $invocation)); - $this->em->getConnection()->rollBack(); - } - - throw $ex; - } - } - } diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Resources/meta/LICENSE b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Resources/meta/LICENSE deleted file mode 100644 index 753842b..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Resources/meta/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/Aop/InterceptorLoaderTest.php b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/Aop/InterceptorLoaderTest.php deleted file mode 100644 index 1789973..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/Aop/InterceptorLoaderTest.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\Tests\Aop; - -use JMS\AopBundle\Aop\PointcutContainer; - -use JMS\AopBundle\Aop\InterceptorLoader; - -class InterceptorLoaderTest extends \PHPUnit_Framework_TestCase -{ - public function testLoadInterceptors() - { - $interceptor = $this->getMock('CG\Proxy\MethodInterceptorInterface'); - - list($loader, $container) = $this->getLoader(array( - 'JMS\AopBundle\Tests\Aop\InterceptorLoaderTestClass' => array( - 'foo' => array('foo'), - ), - )); - - $container - ->expects($this->once()) - ->method('get') - ->with($this->equalTo('foo')) - ->will($this->returnValue($interceptor)) - ; - - $method = new \ReflectionMethod('JMS\AopBundle\Tests\Aop\InterceptorLoaderTestClass', 'foo'); - - $this->assertSame(array($interceptor), $loader->loadInterceptors($method)); - // yes, twice - $this->assertSame(array($interceptor), $loader->loadInterceptors($method)); - } - - private function getLoader(array $interceptors = array()) - { - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - - return array(new InterceptorLoader($container, $interceptors), $container); - } -} - -class InterceptorLoaderTestClass -{ - public function foo() - { - } -} \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/Aop/RegexPointcutTest.php b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/Aop/RegexPointcutTest.php deleted file mode 100644 index 72f5295..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/Aop/RegexPointcutTest.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\Tests\Aop; - -use JMS\AopBundle\Aop\RegexPointcut; - -class RegexPointcutTest extends \PHPUnit_Framework_TestCase -{ - public function testMatchesClass() - { - $pointcut = new RegexPointcut(''); - $this->assertTrue($pointcut->matchesClass(new \ReflectionClass('stdClass'))); - } - - public function testMatchesMethod() - { - $pointcut = new RegexPointcut('foo$'); - - $method = new \ReflectionMethod('JMS\AopBundle\Tests\Aop\RegexPointcutTestClass', 'foo'); - $this->assertTrue($pointcut->matchesMethod($method)); - - $method = new \ReflectionMethod('JMS\AopBundle\Tests\Aop\RegexPointcutTestClass', 'bar'); - $this->assertFalse($pointcut->matchesMethod($method)); - } -} - -class RegexPointcutTestClass -{ - public function foo() {} - public function bar() {} -} \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/DependencyInjection/Compiler/Fixture/LoggingInterceptor.php b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/DependencyInjection/Compiler/Fixture/LoggingInterceptor.php deleted file mode 100644 index 0c0547c..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/DependencyInjection/Compiler/Fixture/LoggingInterceptor.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\Tests\DependencyInjection\Compiler\Fixture; - -use CG\Proxy\MethodInvocation; -use CG\Proxy\MethodInterceptorInterface; - -class LoggingInterceptor implements MethodInterceptorInterface -{ - private $log = array(); - - public function getLog() - { - return $this->log; - } - - public function intercept(MethodInvocation $invocation) - { - $this->log[] = $invocation->reflection->name; - - return $invocation->proceed(); - } -} \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/DependencyInjection/Compiler/Fixture/LoggingPointcut.php b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/DependencyInjection/Compiler/Fixture/LoggingPointcut.php deleted file mode 100644 index b7076cb..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/DependencyInjection/Compiler/Fixture/LoggingPointcut.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\Tests\DependencyInjection\Compiler\Fixture; - -use JMS\AopBundle\Aop\PointcutInterface; - -class LoggingPointcut implements PointcutInterface -{ - public function matchesClass(\ReflectionClass $class) - { - return true; - } - - public function matchesMethod(\ReflectionMethod $method) - { - return false !== strpos($method->name, 'delete'); - } -} \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/DependencyInjection/Compiler/Fixture/TestService.php b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/DependencyInjection/Compiler/Fixture/TestService.php deleted file mode 100644 index 99f2861..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/DependencyInjection/Compiler/Fixture/TestService.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\Tests\DependencyInjection\Compiler\Fixture; - -class TestService -{ - public function add() - { - return true; - } - - public function delete() - { - return true; - } -} \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/DependencyInjection/Compiler/PointcutMatchingPassTest.php b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/DependencyInjection/Compiler/PointcutMatchingPassTest.php deleted file mode 100644 index b75151c..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/Tests/DependencyInjection/Compiler/PointcutMatchingPassTest.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\AopBundle\Tests\DependencyInjection\Compiler; - -use JMS\AopBundle\Exception\RuntimeException; -use Symfony\Component\DependencyInjection\Compiler\ResolveParameterPlaceHoldersPass; -use JMS\AopBundle\DependencyInjection\JMSAopExtension; -use JMS\AopBundle\DependencyInjection\Compiler\PointcutMatchingPass; -use Symfony\Component\HttpKernel\Util\Filesystem; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class PointcutMatchingPassTest extends \PHPUnit_Framework_TestCase -{ - private $cacheDir; - private $fs; - - public function testProcess() - { - $container = $this->getContainer(); - - $container - ->register('pointcut', 'JMS\AopBundle\Tests\DependencyInjection\Compiler\Fixture\LoggingPointcut') - ->addTag('jms_aop.pointcut', array('interceptor' => 'interceptor')) - ; - $container - ->register('interceptor', 'JMS\AopBundle\Tests\DependencyInjection\Compiler\Fixture\LoggingInterceptor') - ; - $container - ->register('test', 'JMS\AopBundle\Tests\DependencyInjection\Compiler\Fixture\TestService') - ; - - $this->process($container); - - $service = $container->get('test'); - $this->assertInstanceOf('JMS\AopBundle\Tests\DependencyInjection\Compiler\Fixture\TestService', $service); - $this->assertTrue($service->add()); - $this->assertTrue($service->delete()); - $this->assertEquals(array('delete'), $container->get('interceptor')->getLog()); - } - - protected function setUp() - { - $this->cacheDir = sys_get_temp_dir().'/jms_aop_test'; - $this->fs = new Filesystem(); - - if (is_dir($this->cacheDir)) { - $this->fs->remove($this->cacheDir); - } - - if (false === @mkdir($this->cacheDir, 0777, true)) { - throw new RuntimeException(sprintf('Could not create cache dir "%s".', $this->cacheDir)); - } - } - - protected function tearDown() - { - $this->fs->remove($this->cacheDir); - } - - private function getContainer() - { - $container = new ContainerBuilder(); - - $extension = new JMSAopExtension(); - $extension->load(array(array( - 'cache_dir' => $this->cacheDir, - )), $container); - - return $container; - } - - private function process(ContainerBuilder $container) - { - $pass = new ResolveParameterPlaceHoldersPass(); - $pass->process($container); - - $pass = new PointcutMatchingPass(); - $pass->process($container); - } -} \ No newline at end of file diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/composer.json b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/composer.json deleted file mode 100644 index 1fe7e80..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/composer.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "jms/aop-bundle", - "description": "Adds AOP capabilities to Symfony2", - "keywords": ["annotations","aop"], - "type": "symfony-bundle", - "license": "Apache", - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "require": { - "symfony/framework-bundle": "2.*", - "jms/cg": "1.0.0" - }, - "autoload": { - "psr-0": { "JMS\\AopBundle": "" } - }, - "target-dir": "JMS/AopBundle" -} diff --git a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/phpunit.xml.dist b/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/phpunit.xml.dist deleted file mode 100644 index 7484342..0000000 --- a/vendor/jms/aop-bundle/JMS/AopBundle/schmittjoh-JMSAopBundle-8ef7db0/phpunit.xml.dist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - ./Tests - - - - - - performance - - - diff --git a/vendor/jms/cg/LICENSE b/vendor/jms/cg/LICENSE deleted file mode 100644 index f49a4e1..0000000 --- a/vendor/jms/cg/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/vendor/jms/cg/composer.json b/vendor/jms/cg/composer.json deleted file mode 100644 index edb5eec..0000000 --- a/vendor/jms/cg/composer.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "jms/cg", - "description": "Toolset for generating PHP code", - "keywords": ["code generation"], - "type": "library", - "license": "Apache", - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "require": { - "php": ">=5.3.0" - }, - "autoload": { - "psr-0": { "CG\\": "src/" } - } -} diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/LICENSE b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/LICENSE deleted file mode 100644 index f49a4e1..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/README.rst b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/README.rst deleted file mode 100644 index 22b4d90..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/README.rst +++ /dev/null @@ -1,9 +0,0 @@ -CG library provides a toolset for generating PHP code -===================================================== - -Overview --------- - -This library provides some tools that you commonly need for generating PHP code. -One of it's strength lies in the enhancement of existing classes with behaviors. - diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/composer.json b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/composer.json deleted file mode 100644 index edb5eec..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/composer.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "jms/cg", - "description": "Toolset for generating PHP code", - "keywords": ["code generation"], - "type": "library", - "license": "Apache", - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "require": { - "php": ">=5.3.0" - }, - "autoload": { - "psr-0": { "CG\\": "src/" } - } -} diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/phpunit.xml.dist b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/phpunit.xml.dist deleted file mode 100644 index 4f6c5e4..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/phpunit.xml.dist +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - ./tests/CG/ - - - - - - performance - - - diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/AbstractClassGenerator.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/AbstractClassGenerator.php deleted file mode 100644 index 203d9ba..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/AbstractClassGenerator.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Core; - -use CG\Generator\PhpClass; - -/** - * Abstract base class for all class generators. - * - * @author Johannes M. Schmitt - */ -abstract class AbstractClassGenerator implements ClassGeneratorInterface -{ - private $namingStrategy; - private $generatorStrategy; - - public function setNamingStrategy(NamingStrategyInterface $namingStrategy = null) - { - $this->namingStrategy = $namingStrategy; - } - - public function setGeneratorStrategy(GeneratorStrategyInterface $generatorStrategy = null) - { - $this->generatorStrategy = $generatorStrategy; - } - - public function getClassName(\ReflectionClass $class) - { - if (null === $this->namingStrategy) { - $this->namingStrategy = new DefaultNamingStrategy(); - } - - return $this->namingStrategy->getClassName($class); - } - - protected function generateCode(PhpClass $class) - { - if (null === $this->generatorStrategy) { - $this->generatorStrategy = new DefaultGeneratorStrategy(); - } - - return $this->generatorStrategy->generate($class); - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/ClassGeneratorInterface.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/ClassGeneratorInterface.php deleted file mode 100644 index 93ca18f..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/ClassGeneratorInterface.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Core; - -use CG\Generator\PhpClass; - -/** - * Interface for class generators. - * - * @author Johannes M. Schmitt - */ -interface ClassGeneratorInterface -{ - /** - * Generates the PHP class. - * - * @return string - */ - function generateClass(); -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/ClassUtils.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/ClassUtils.php deleted file mode 100644 index 3e33bd5..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/ClassUtils.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Core; - -use CG\Proxy\Enhancer; - -abstract class ClassUtils -{ - public static function getUserClass($className) - { - if (false === $pos = strrpos($className, '\\'.NamingStrategyInterface::SEPARATOR.'\\')) { - return $className; - } - - return substr($className, $pos + NamingStrategyInterface::SEPARATOR_LENGTH + 2); - } - - private final function __construct() {} -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/DefaultGeneratorStrategy.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/DefaultGeneratorStrategy.php deleted file mode 100644 index 28b60bf..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/DefaultGeneratorStrategy.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Core; - -use CG\Generator\DefaultVisitorInterface; -use CG\Generator\PhpClass; -use CG\Generator\DefaultVisitor; -use CG\Generator\DefaultNavigator; - -/** - * The default generator strategy. - * - * This strategy allows to change the order in which methods, properties and - * constants are sorted. - * - * @author Johannes M. Schmitt - */ -class DefaultGeneratorStrategy implements GeneratorStrategyInterface -{ - private $navigator; - private $visitor; - - public function __construct(DefaultVisitorInterface $visitor = null) - { - $this->navigator = new DefaultNavigator(); - $this->visitor = $visitor ?: new DefaultVisitor(); - } - - public function setConstantSortFunc(\Closure $func = null) - { - $this->navigator->setConstantSortFunc($func); - } - - public function setMethodSortFunc(\Closure $func = null) - { - $this->navigator->setMethodSortFunc($func); - } - - public function setPropertySortFunc(\Closure $func = null) - { - $this->navigator->setPropertySortFunc($func); - } - - public function generate(PhpClass $class) - { - $this->visitor->reset(); - $this->navigator->accept($this->visitor, $class); - - return $this->visitor->getContent(); - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/DefaultNamingStrategy.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/DefaultNamingStrategy.php deleted file mode 100644 index 600c995..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/DefaultNamingStrategy.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Core; - -/** - * The default naming strategy. - * - * @author Johannes M. Schmitt - */ -class DefaultNamingStrategy implements NamingStrategyInterface -{ - private $prefix; - - public function __construct($prefix = 'EnhancedProxy') - { - $this->prefix = $prefix; - } - - public function getClassName(\ReflectionClass $class) - { - $userClass = ClassUtils::getUserClass($class->name); - - return $this->prefix.'_'.sha1($class->name).'\\'.self::SEPARATOR.'\\'.$userClass; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/GeneratorStrategyInterface.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/GeneratorStrategyInterface.php deleted file mode 100644 index 2468bc1..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/GeneratorStrategyInterface.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Core; - -use CG\Generator\PhpClass; - -/** - * Generator Strategy Interface. - * - * Implementing classes are responsible for generating PHP code from the given - * PhpClass instance. - * - * @author Johannes M. Schmitt - */ -interface GeneratorStrategyInterface -{ - function generate(PhpClass $class); -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/NamingStrategyInterface.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/NamingStrategyInterface.php deleted file mode 100644 index c7c03fa..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/NamingStrategyInterface.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Core; - -/** - * The naming strategy interface. - * - * @author Johannes M. Schmitt - */ -interface NamingStrategyInterface -{ - const SEPARATOR = '__CG__'; - const SEPARATOR_LENGTH = 6; - - /** - * Returns the class name for the proxy class. - * - * The generated class name MUST be the concatenation of a nonempty prefix, - * the namespace separator __CG__, and the original class name. - * - * Examples: - * - * +----------------------------+------------------------------+ - * | Original Name | Generated Name | - * +============================+==============================+ - * | Foo\Bar | dred332\__CG__\Foo\Bar | - * | Bar\Baz | Foo\Doo\__CG__\Bar\Baz | - * +----------------------------+------------------------------+ - * - * @param \ReflectionClass $class - * @return string the class name for the generated class - */ - function getClassName(\ReflectionClass $class); -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/ReflectionUtils.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/ReflectionUtils.php deleted file mode 100644 index e7e9ea7..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Core/ReflectionUtils.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Core; - -abstract class ReflectionUtils -{ - public static function getOverrideableMethods(\ReflectionClass $class, $publicOnly = false) - { - $filter = \ReflectionMethod::IS_PUBLIC; - - if (!$publicOnly) { - $filter |= \ReflectionMethod::IS_PROTECTED; - } - - return array_filter( - $class->getMethods($filter), - function($method) { return !$method->isFinal() && !$method->isStatic(); } - ); - } - - public static function getUnindentedDocComment($docComment) - { - $lines = explode("\n", $docComment); - for ($i=0,$c=count($lines); $i<$c; $i++) { - if (0 === $i) { - $docBlock = $lines[0]."\n"; - continue; - } - - $docBlock .= ' '.ltrim($lines[$i]); - - if ($i+1 < $c) { - $docBlock .= "\n"; - } - } - - return $docBlock; - } - - private final function __construct() { } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/AbstractPhpMember.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/AbstractPhpMember.php deleted file mode 100644 index 5ae8aa4..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/AbstractPhpMember.php +++ /dev/null @@ -1,95 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -/** - * Abstract PHP member class. - * - * @author Johannes M. Schmitt - */ -abstract class AbstractPhpMember -{ - const VISIBILITY_PRIVATE = 'private'; - const VISIBILITY_PROTECTED = 'protected'; - const VISIBILITY_PUBLIC = 'public'; - - private $static = false; - private $visibility = self::VISIBILITY_PUBLIC; - private $name; - private $docblock; - - public function __construct($name = null) - { - $this->setName($name); - } - - public function setName($name) - { - $this->name = $name; - - return $this; - } - - public function setVisibility($visibility) - { - if ($visibility !== self::VISIBILITY_PRIVATE - && $visibility !== self::VISIBILITY_PROTECTED - && $visibility !== self::VISIBILITY_PUBLIC) { - throw new \InvalidArgumentException(sprintf('The visibility "%s" does not exist.', $visibility)); - } - - $this->visibility = $visibility; - - return $this; - } - - public function setStatic($bool) - { - $this->static = (Boolean) $bool; - - return $this; - } - - public function setDocblock($doc) - { - $this->docblock = $doc; - - return $this; - } - - public function isStatic() - { - return $this->static; - } - - public function getVisibility() - { - return $this->visibility; - } - - public function getName() - { - return $this->name; - } - - public function getDocblock() - { - return $this->docblock; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/DefaultNavigator.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/DefaultNavigator.php deleted file mode 100644 index 3d46bb3..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/DefaultNavigator.php +++ /dev/null @@ -1,172 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -/** - * The default navigator. - * - * This class is responsible for the default traversal algorithm of the different - * code elements. - * - * Unlike other visitor pattern implementations, this allows to separate the - * traversal logic from the objects that are traversed. - * - * @author Johannes M. Schmitt - */ -class DefaultNavigator -{ - private $constantSortFunc; - private $propertySortFunc; - private $methodSortFunc; - - /** - * Sets a custom constant sorting function. - * - * @param \Closure $func - */ - public function setConstantSortFunc(\Closure $func = null) - { - $this->constantSortFunc = $func; - } - - /** - * Sets a custom property sorting function. - * - * @param \Closure $func - */ - public function setPropertySortFunc(\Closure $func = null) - { - $this->propertySortFunc = $func; - } - - /** - * Sets a custom method sorting function. - * - * @param \Closure $func - */ - public function setMethodSortFunc(\Closure $func = null) - { - $this->methodSortFunc = $func; - } - - public function accept(DefaultVisitorInterface $visitor, PhpClass $class) - { - $visitor->startVisitingClass($class); - - $constants = $class->getConstants(); - if (!empty($constants)) { - uksort($constants, $this->getConstantSortFunc()); - - $visitor->startVisitingConstants(); - foreach ($constants as $name => $value) { - $visitor->visitConstant($name, $value); - } - $visitor->endVisitingConstants(); - } - - $properties = $class->getProperties(); - if (!empty($properties)) { - usort($properties, $this->getPropertySortFunc()); - - $visitor->startVisitingProperties(); - foreach ($properties as $property) { - $visitor->visitProperty($property); - } - $visitor->endVisitingProperties(); - } - - $methods = $class->getMethods(); - if (!empty($methods)) { - usort($methods, $this->getMethodSortFunc()); - - $visitor->startVisitingMethods(); - foreach ($methods as $method) { - $visitor->visitMethod($method); - } - $visitor->endVisitingMethods(); - } - - $visitor->endVisitingClass($class); - } - - private function getConstantSortFunc() - { - return $this->constantSortFunc ?: 'strcasecmp'; - } - - private function getMethodSortFunc() - { - if (null !== $this->methodSortFunc) { - return $this->methodSortFunc; - } - - static $defaultSortFunc; - if (empty($defaultSortFunc)) { - $defaultSortFunc = function($a, $b) { - if ($a->isStatic() !== $isStatic = $b->isStatic()) { - return $isStatic ? 1 : -1; - } - - if (($aV = $a->getVisibility()) !== $bV = $b->getVisibility()) { - $aV = 'public' === $aV ? 3 : ('protected' === $aV ? 2 : 1); - $bV = 'public' === $bV ? 3 : ('protected' === $bV ? 2 : 1); - - return $aV > $bV ? -1 : 1; - } - - $rs = strcasecmp($a->getName(), $b->getName()); - if (0 === $rs) { - return 0; - } - - return $rs > 0 ? -1 : 1; - }; - } - - return $defaultSortFunc; - } - - private function getPropertySortFunc() - { - if (null !== $this->propertySortFunc) { - return $this->propertySortFunc; - } - - static $defaultSortFunc; - if (empty($defaultSortFunc)) { - $defaultSortFunc = function($a, $b) { - if (($aV = $a->getVisibility()) !== $bV = $b->getVisibility()) { - $aV = 'public' === $aV ? 3 : ('protected' === $aV ? 2 : 1); - $bV = 'public' === $bV ? 3 : ('protected' === $bV ? 2 : 1); - - return $aV > $bV ? -1 : 1; - } - - $rs = strcasecmp($a->getName(), $b->getName()); - if (0 === $rs) { - return 0; - } - - return $rs > 0 ? -1 : 1; - }; - } - - return $defaultSortFunc; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/DefaultVisitor.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/DefaultVisitor.php deleted file mode 100644 index 5dd4094..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/DefaultVisitor.php +++ /dev/null @@ -1,237 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -/** - * The default code generation visitor. - * - * @author Johannes M. Schmitt - */ -class DefaultVisitor implements DefaultVisitorInterface -{ - private $writer; - - public function __construct() - { - $this->writer = new Writer(); - } - - public function reset() - { - $this->writer->reset(); - } - - public function startVisitingClass(PhpClass $class) - { - if ($namespace = $class->getNamespace()) { - $this->writer->write('namespace '.$namespace.';'."\n\n"); - } - - if ($files = $class->getRequiredFiles()) { - foreach ($files as $file) { - $this->writer->writeln('require_once '.var_export($file, true).';'); - } - - $this->writer->write("\n"); - } - - if ($useStatements = $class->getUseStatements()) { - foreach ($useStatements as $alias => $namespace) { - $this->writer->write('use '.$namespace); - - if (substr($namespace, strrpos($namespace, '\\') + 1) !== $alias) { - $this->writer->write(' as '.$alias); - } - - $this->writer->write(";\n"); - } - - $this->writer->write("\n"); - } - - if ($docblock = $class->getDocblock()) { - $this->writer->write($docblock); - } - - $this->writer->write('class '.$class->getShortName()); - - if ($parentClassName = $class->getParentClassName()) { - $this->writer->write(' extends '.('\\' === $parentClassName[0] ? $parentClassName : '\\'.$parentClassName)); - } - - $interfaceNames = $class->getInterfaceNames(); - if (!empty($interfaceNames)) { - $interfaceNames = array_unique($interfaceNames); - - $interfaceNames = array_map(function($name) { - if ('\\' === $name[0]) { - return $name; - } - - return '\\'.$name; - }, $interfaceNames); - - $this->writer->write(' implements '.implode(', ', $interfaceNames)); - } - - $this->writer - ->write("\n{\n") - ->indent() - ; - } - - public function startVisitingConstants() - { - } - - public function visitConstant($name, $value) - { - $this->writer->writeln('const '.$name.' = '.var_export($value, true).';'); - } - - public function endVisitingConstants() - { - $this->writer->write("\n"); - } - - public function startVisitingProperties() - { - } - - public function visitProperty(PhpProperty $property) - { - $this->writer->write($property->getVisibility().' '.($property->isStatic()? 'static ' : '').'$'.$property->getName()); - - if ($property->hasDefaultValue()) { - $this->writer->write(' = '.var_export($property->getDefaultValue(), true)); - } - - $this->writer->writeln(';'); - } - - public function endVisitingProperties() - { - $this->writer->write("\n"); - } - - public function startVisitingMethods() - { - } - - public function visitMethod(PhpMethod $method) - { - if ($docblock = $method->getDocblock()) { - $this->writer->writeln($docblock)->rtrim(); - } - - if ($method->isAbstract()) { - $this->writer->write('abstract '); - } - - $this->writer->write($method->getVisibility().' '); - - if ($method->isStatic()) { - $this->writer->write('static '); - } - - $this->writer->write('function '.$method->getName().'('); - - $this->writeParameters($method->getParameters()); - - if ($method->isAbstract()) { - $this->writer->write(");\n\n"); - - return; - } - - $this->writer - ->writeln(")") - ->writeln('{') - ->indent() - ->writeln($method->getBody()) - ->outdent() - ->rtrim() - ->write("}\n\n") - ; - } - - public function endVisitingMethods() - { - } - - public function endVisitingClass(PhpClass $class) - { - $this->writer - ->outdent() - ->rtrim() - ->write('}') - ; - } - - public function visitFunction(PhpFunction $function) - { - if ($namespace = $function->getNamespace()) { - $this->writer->write("namespace $namespace;\n\n"); - } - - $this->writer->write("function {$function->getName()}("); - $this->writeParameters($function->getParameters()); - $this->writer - ->write(")\n{\n") - ->indent() - ->writeln($function->getBody()) - ->outdent() - ->rtrim() - ->write('}') - ; - } - - public function getContent() - { - return $this->writer->getContent(); - } - - private function writeParameters(array $parameters) - { - $first = true; - foreach ($parameters as $parameter) { - if (!$first) { - $this->writer->write(', '); - } - $first = false; - - if ($type = $parameter->getType()) { - $this->writer->write( - ('array' === $type ? 'array' : ('\\' === $type[0] ? $type : '\\'. $type)) - .' ' - ); - } - - if ($parameter->isPassedByReference()) { - $this->writer->write('&'); - } - - $this->writer->write('$'.$parameter->getName()); - - if ($parameter->hasDefaultValue()) { - $this->writer->write(' = '.var_export($parameter->getDefaultValue(), true)); - } - } - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/DefaultVisitorInterface.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/DefaultVisitorInterface.php deleted file mode 100644 index d9532bb..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/DefaultVisitorInterface.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -/** - * The visitor interface required by the DefaultNavigator. - * - * @author Johannes M. Schmitt - */ -interface DefaultVisitorInterface -{ - /** - * Resets the visitors internal state to allow re-using the same instance. - * - * @return void - */ - function reset(); - - function startVisitingClass(PhpClass $class); - function startVisitingConstants(); - function visitConstant($name, $value); - function endVisitingConstants(); - function startVisitingProperties(); - function visitProperty(PhpProperty $property); - function endVisitingProperties(); - function startVisitingMethods(); - function visitMethod(PhpMethod $method); - function endVisitingMethods(); - function endVisitingClass(PhpClass $class); - function visitFunction(PhpFunction $function); -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/GeneratorUtils.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/GeneratorUtils.php deleted file mode 100644 index 8f7a44c..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/GeneratorUtils.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -/** - * Some Generator utils. - * - * @author Johannes M. Schmitt - */ -abstract class GeneratorUtils -{ - private final function __construct() {} - - public static function callMethod(\ReflectionMethod $method, array $params = null) - { - if (null === $params) { - $params = array_map(function($p) { return '$'.$p->name; }, $method->getParameters()); - } - - return '\\'.$method->getDeclaringClass()->name.'::'.$method->name.'('.implode(', ', $params).')'; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/PhpClass.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/PhpClass.php deleted file mode 100644 index e8496f0..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/PhpClass.php +++ /dev/null @@ -1,360 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -use Doctrine\Common\Annotations\PhpParser; - -use CG\Core\ReflectionUtils; - -/** - * Represents a PHP class. - * - * @author Johannes M. Schmitt - */ -class PhpClass -{ - private static $phpParser; - - private $name; - private $parentClassName; - private $interfaceNames = array(); - private $useStatements = array(); - private $constants = array(); - private $properties = array(); - private $requiredFiles = array(); - private $methods = array(); - private $abstract = false; - private $final = false; - private $docblock; - - public static function create($name = null) - { - return new self($name); - } - - public static function fromReflection(\ReflectionClass $ref) - { - $class = new static(); - $class - ->setName($ref->name) - ->setAbstract($ref->isAbstract()) - ->setFinal($ref->isFinal()) - ->setConstants($ref->getConstants()) - ; - - if (null === self::$phpParser) { - if (!class_exists('Doctrine\Common\Annotations\PhpParser')) { - self::$phpParser = false; - } else { - self::$phpParser = new PhpParser(); - } - } - - if (false !== self::$phpParser) { - $class->setUseStatements(self::$phpParser->parseClass($ref)); - } - - if ($docComment = $ref->getDocComment()) { - $class->setDocblock(ReflectionUtils::getUnindentedDocComment($docComment)); - } - - foreach ($ref->getMethods() as $method) { - $class->setMethod(static::createMethod($method)); - } - - foreach ($ref->getProperties() as $property) { - $class->setProperty(static::createProperty($property)); - } - - return $class; - } - - protected static function createMethod(\ReflectionMethod $method) - { - return PhpMethod::fromReflection($method); - } - - protected static function createProperty(\ReflectionProperty $property) - { - return PhpProperty::fromReflection($property); - } - - public function __construct($name = null) - { - $this->name = $name; - } - - public function setName($name) - { - $this->name = $name; - - return $this; - } - - public function setParentClassName($name) - { - $this->parentClassName = $name; - - return $this; - } - - public function setInterfaceNames(array $names) - { - $this->interfaceNames = $names; - - return $this; - } - - public function addInterfaceName($name) - { - $this->interfaceNames[] = $name; - - return $this; - } - - public function setRequiredFiles(array $files) - { - $this->requiredFiles = $files; - - return $this; - } - - public function addRequiredFile($file) - { - $this->requiredFiles[] = $file; - - return $this; - } - - public function setUseStatements(array $useStatements) - { - $this->useStatements = $useStatements; - - return $this; - } - - public function addUseStatement($namespace, $alias = null) - { - if (null === $alias) { - $alias = substr($namespace, strrpos($namespace, '\\') + 1); - } - - $this->useStatements[$alias] = $namespace; - - return $this; - } - - public function setConstants(array $constants) - { - $this->constants = $constants; - - return $this; - } - - public function setConstant($name, $value) - { - $this->constants[$name] = $value; - - return $this; - } - - public function hasConstant($name) - { - return array_key_exists($this->constants, $name); - } - - public function removeConstant($name) - { - if (!array_key_exists($name, $this->constants)) { - throw new \InvalidArgumentException(sprintf('The constant "%s" does not exist.', $name)); - } - - unset($this->constants[$name]); - - return $this; - } - - public function setProperties(array $properties) - { - $this->properties = $properties; - - return $this; - } - - public function setProperty(PhpProperty $property) - { - $this->properties[$property->getName()] = $property; - - return $this; - } - - public function hasProperty($property) - { - if ($property instanceof PhpProperty) { - $property = $property->getName(); - } - - return isset($this->properties[$property]); - } - - public function removeProperty($property) - { - if ($property instanceof PhpProperty) { - $property = $property->getName(); - } - - if (!array_key_exists($property, $this->properties)) { - throw new \InvalidArgumentException(sprintf('The property "%s" does not exist.', $property)); - } - unset($this->properties[$property]); - - return $this; - } - - public function setMethods(array $methods) - { - $this->methods = $methods; - - return $this; - } - - public function setMethod(PhpMethod $method) - { - $this->methods[$method->getName()] = $method; - - return $this; - } - - public function hasMethod($method) - { - if ($method instanceof PhpMethod) { - $method = $method->getName(); - } - - return isset($this->methods[$method]); - } - - public function removeMethod($method) - { - if ($method instanceof PhpMethod) { - $method = $method->getName(); - } - - if (!array_key_exists($method, $this->methods)) { - throw new \InvalidArgumentException(sprintf('The method "%s" does not exist.', $method)); - } - unset($this->methods[$method]); - - return $this; - } - - public function setAbstract($bool) - { - $this->abstract = (Boolean) $bool; - - return $this; - } - - public function setFinal($bool) - { - $this->final = (Boolean) $bool; - - return $this; - } - - public function setDocblock($block) - { - $this->docblock = $block; - - return $this; - } - - public function getName() - { - return $this->name; - } - - public function getParentClassName() - { - return $this->parentClassName; - } - - public function getInterfaceNames() - { - return $this->interfaceNames; - } - - public function getRequiredFiles() - { - return $this->requiredFiles; - } - - public function getUseStatements() - { - return $this->useStatements; - } - - public function getNamespace() - { - if (false === $pos = strrpos($this->name, '\\')) { - return null; - } - - return substr($this->name, 0, $pos); - } - - public function getShortName() - { - if (false === $pos = strrpos($this->name, '\\')) { - return $this->name; - } - - return substr($this->name, $pos+1); - } - - public function getConstants() - { - return $this->constants; - } - - public function getProperties() - { - return $this->properties; - } - - public function getMethods() - { - return $this->methods; - } - - public function isAbstract() - { - return $this->abstract; - } - - public function isFinal() - { - return $this->final; - } - - public function getDocblock() - { - return $this->docblock; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/PhpFunction.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/PhpFunction.php deleted file mode 100644 index 2c14511..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/PhpFunction.php +++ /dev/null @@ -1,146 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -/** - * Represents a PHP function. - * - * @author Johannes M. Schmitt - */ -class PhpFunction -{ - private $name; - private $namespace; - private $parameters = array(); - private $body = ''; - private $referenceReturned = false; - private $docblock; - - public static function create($name = null) - { - return new static($name); - } - - public function __construct($name = null) - { - $this->name = $name; - } - - public function setName($name) - { - $this->name = $name; - - return $this; - } - - public function setNamespace($namespace) - { - $this->namespace = $namespace; - - return $this; - } - - public function setParameters(array $parameters) - { - $this->parameters = $parameters; - - return $this; - } - - public function setReferenceReturned($bool) - { - $this->referenceReturned = (Boolean) $bool; - - return $this; - } - - public function replaceParameter($position, PhpParameter $parameter) - { - if ($position < 0 || $position > count($this->parameters)) { - throw new \InvalidArgumentException(sprintf('$position must be in the range [0, %d].', count($this->parameters))); - } - - $this->parameters[$position] = $parameter; - - return $this; - } - - public function addParameter(PhpParameter $parameter) - { - $this->parameters[] = $parameter; - - return $this; - } - - public function removeParameter($position) - { - if (!isset($this->parameters[$position])) { - throw new \InvalidArgumentException(sprintf('There is not parameter at position %d.', $position)); - } - - unset($this->parameters[$position]); - $this->parameters = array_values($this->parameters); - - return $this; - } - - public function setBody($body) - { - $this->body = $body; - - return $this; - } - - public function setDocblock($docBlock) - { - $this->docblock = $docBlock; - - return $this; - } - - public function getName() - { - return $this->name; - } - - public function getNamespace() - { - return $this->namespace; - } - - public function getParameters() - { - return $this->parameters; - } - - public function getBody() - { - return $this->body; - } - - public function getDocblock() - { - return $this->docblock; - } - - public function isReferenceReturned() - { - return $this->referenceReturned; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/PhpMethod.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/PhpMethod.php deleted file mode 100644 index f8b7314..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/PhpMethod.php +++ /dev/null @@ -1,158 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -use CG\Core\ReflectionUtils; - -/** - * Represents a PHP method. - * - * @author Johannes M. Schmitt - */ -class PhpMethod extends AbstractPhpMember -{ - private $final = false; - private $abstract = false; - private $parameters = array(); - private $referenceReturned = false; - private $body = ''; - - public static function create($name = null) - { - return new static($name); - } - - public static function fromReflection(\ReflectionMethod $ref) - { - $method = new static(); - $method - ->setFinal($ref->isFinal()) - ->setAbstract($ref->isAbstract()) - ->setStatic($ref->isStatic()) - ->setVisibility($ref->isPublic() ? self::VISIBILITY_PUBLIC : ($ref->isProtected() ? self::VISIBILITY_PROTECTED : self::VISIBILITY_PRIVATE)) - ->setReferenceReturned($ref->returnsReference()) - ->setName($ref->name) - ; - - if ($docComment = $ref->getDocComment()) { - $method->setDocblock(ReflectionUtils::getUnindentedDocComment($docComment)); - } - - foreach ($ref->getParameters() as $param) { - $method->addParameter(static::createParameter($param)); - } - - // FIXME: Extract body? - - return $method; - } - - protected static function createParameter(\ReflectionParameter $parameter) - { - return PhpParameter::fromReflection($parameter); - } - - public function setFinal($bool) - { - $this->final = (Boolean) $bool; - - return $this; - } - - public function setAbstract($bool) - { - $this->abstract = $bool; - - return $this; - } - - public function setReferenceReturned($bool) - { - $this->referenceReturned = (Boolean) $bool; - - return $this; - } - - public function setBody($body) - { - $this->body = $body; - - return $this; - } - - public function setParameters(array $parameters) - { - $this->parameters = array_values($parameters); - - return $this; - } - - public function addParameter(PhpParameter $parameter) - { - $this->parameters[] = $parameter; - - return $this; - } - - public function replaceParameter($position, PhpParameter $parameter) - { - if ($position < 0 || $position > strlen($this->parameters)) { - throw new \InvalidArgumentException(sprintf('The position must be in the range [0, %d].', strlen($this->parameters))); - } - $this->parameters[$position] = $parameter; - - return $this; - } - - public function removeParameter($position) - { - if (!isset($this->parameters[$position])) { - throw new \InvalidArgumentException(sprintf('There is no parameter at position "%d" does not exist.', $position)); - } - unset($this->parameters[$position]); - $this->parameters = array_values($this->parameters); - - return $this; - } - - public function isFinal() - { - return $this->final; - } - - public function isAbstract() - { - return $this->abstract; - } - - public function isReferenceReturned() - { - return $this->referenceReturned; - } - - public function getBody() - { - return $this->body; - } - - public function getParameters() - { - return $this->parameters; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/PhpParameter.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/PhpParameter.php deleted file mode 100644 index 0f8b2cb..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/PhpParameter.php +++ /dev/null @@ -1,126 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -/** - * Represents a PHP parameter. - * - * @author Johannes M. Schmitt - */ -class PhpParameter -{ - private $name; - private $defaultValue; - private $hasDefaultValue = false; - private $passedByReference = false; - private $type; - - public static function create($name = null) - { - return new static($name); - } - - public static function fromReflection(\ReflectionParameter $ref) - { - $parameter = new static(); - $parameter - ->setName($ref->name) - ->setPassedByReference($ref->isPassedByReference()) - ; - - if ($ref->isDefaultValueAvailable()) { - $parameter->setDefaultValue($ref->getDefaultValue()); - } - - if ($ref->isArray()) { - $parameter->setType('array'); - } else if ($class = $ref->getClass()) { - $parameter->setType($class->name); - } - - return $parameter; - } - - public function __construct($name = null) - { - $this->name = $name; - } - - public function setName($name) - { - $this->name = $name; - - return $this; - } - - public function setDefaultValue($value) - { - $this->defaultValue = $value; - $this->hasDefaultValue = true; - - return $this; - } - - public function unsetDefaultValue() - { - $this->defaultValue = null; - $this->hasDefaultValue = false; - - return $this; - } - - public function setPassedByReference($bool) - { - $this->passedByReference = (Boolean) $bool; - - return $this; - } - - public function setType($type) - { - $this->type = $type; - - return $this; - } - - public function getName() - { - return $this->name; - } - - public function getDefaultValue() - { - return $this->defaultValue; - } - - public function hasDefaultValue() - { - return $this->hasDefaultValue; - } - - public function isPassedByReference() - { - return $this->passedByReference; - } - - public function getType() - { - return $this->type; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/PhpProperty.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/PhpProperty.php deleted file mode 100644 index a5b33d8..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/PhpProperty.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -use CG\Core\ReflectionUtils; - -/** - * Represents a PHP property. - * - * @author Johannes M. Schmitt - */ -class PhpProperty extends AbstractPhpMember -{ - private $hasDefaultValue = false; - private $defaultValue; - - public static function create($name = null) - { - return new static($name); - } - - public static function fromReflection(\ReflectionProperty $ref) - { - $property = new static(); - $property - ->setName($ref->name) - ->setStatic($ref->isStatic()) - ->setVisibility($ref->isPublic() ? self::VISIBILITY_PUBLIC : ($ref->isProtected() ? self::VISIBILITY_PROTECTED : self::VISIBILITY_PRIVATE)) - ; - - if ($docComment = $ref->getDocComment()) { - $property->setDocblock(ReflectionUtils::getUnindentedDocComment($docComment)); - } - - $defaultProperties = $ref->getDeclaringClass()->getDefaultProperties(); - if (isset($defaultProperties[$ref->name])) { - $property->setDefaultValue($defaultProperties[$ref->name]); - } - - return $property; - } - - public function setDefaultValue($value) - { - $this->defaultValue = $value; - $this->hasDefaultValue = true; - - return $this; - } - - public function unsetDefaultValue() - { - $this->hasDefaultValue = false; - $this->defaultValue = null; - - return $this; - } - - public function hasDefaultValue() - { - return $this->hasDefaultValue; - } - - public function getDefaultValue() - { - return $this->defaultValue; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/Writer.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/Writer.php deleted file mode 100644 index 29ca853..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Generator/Writer.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -/** - * A writer implementation. - * - * This may be used to simplify writing well-formatted code. - * - * @author Johannes M. Schmitt - */ -class Writer -{ - private $content = ''; - private $indentationSpaces = 4; - private $indentationLevel = 0; - - public function indent() - { - $this->indentationLevel += 1; - - return $this; - } - - public function outdent() - { - $this->indentationLevel -= 1; - - if ($this->indentationLevel < 0) { - throw new \RuntimeException('The identation level cannot be less than zero.'); - } - - return $this; - } - - public function writeln($content) - { - $this->write($content."\n"); - - return $this; - } - - public function write($content) - { - $lines = explode("\n", $content); - for ($i=0,$c=count($lines); $i<$c; $i++) { - if ($this->indentationLevel > 0 - && !empty($lines[$i]) - && (empty($this->content) || "\n" === substr($this->content, -1))) { - $this->content .= str_repeat(' ', $this->indentationLevel * $this->indentationSpaces); - } - - $this->content .= $lines[$i]; - - if ($i+1 < $c) { - $this->content .= "\n"; - } - } - - return $this; - } - - public function rtrim() - { - $addNl = "\n" === substr($this->content, -1); - $this->content = rtrim($this->content); - - if ($addNl) { - $this->content .= "\n"; - } - - return $this; - } - - public function reset() - { - $this->content = ''; - $this->indentationLevel = 0; - - return $this; - } - - public function getContent() - { - return $this->content; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/Enhancer.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/Enhancer.php deleted file mode 100644 index 2ba73ed..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/Enhancer.php +++ /dev/null @@ -1,158 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Proxy; - -use CG\Core\NamingStrategyInterface; - -use CG\Generator\Writer; -use CG\Generator\PhpMethod; -use CG\Generator\PhpDocblock; -use CG\Generator\PhpClass; -use CG\Core\AbstractClassGenerator; - -/** - * Class enhancing generator implementation. - * - * This class enhances existing classes by generating a proxy and leveraging - * different generator implementation. - * - * There are several built-in generator such as lazy-initializing objects, or - * a generator for creating AOP joinpoints. - * - * @author Johannes M. Schmitt - */ -class Enhancer extends AbstractClassGenerator -{ - private $generatedClass; - private $class; - private $interfaces; - private $generators; - - public function __construct(\ReflectionClass $class, array $interfaces = array(), array $generators = array()) - { - if (empty($generators) && empty($interfaces)) { - throw new \RuntimeException('Either generators, or interfaces must be given.'); - } - - $this->class = $class; - $this->interfaces = $interfaces; - $this->generators = $generators; - } - - /** - * Creates a new instance of the enhanced class. - * - * @param array $args - * @return object - */ - public function createInstance(array $args = array()) - { - $generatedClass = $this->getClassName($this->class); - - if (!class_exists($generatedClass, false)) { - eval($this->generateClass()); - } - - $ref = new \ReflectionClass($generatedClass); - - return $ref->newInstanceArgs($args); - } - - public function writeClass($filename) - { - if (!is_dir($dir = dirname($filename))) { - if (false === @mkdir($dir, 0777, true)) { - throw new \RuntimeException(sprintf('Could not create directory "%s".', $dir)); - } - } - - if (!is_writable($dir)) { - throw new \RuntimeException(sprintf('The directory "%s" is not writable.', $dir)); - } - - file_put_contents($filename, "generateClass()); - } - - /** - * Creates a new enhanced class - * - * @return string - */ - public final function generateClass() - { - static $docBlock; - if (empty($docBlock)) { - $writer = new Writer(); - $writer - ->writeln('/**') - ->writeln(' * CG library enhanced proxy class.') - ->writeln(' *') - ->writeln(' * This code was generated automatically by the CG library, manual changes to it') - ->writeln(' * will be lost upon next generation.') - ->writeln(' */') - ; - $docBlock = $writer->getContent(); - } - - $this->generatedClass = PhpClass::create() - ->setDocblock($docBlock) - ->setParentClassName($this->class->name) - ; - - $proxyClassName = $this->getClassName($this->class); - if (false === strpos($proxyClassName, NamingStrategyInterface::SEPARATOR)) { - throw new \RuntimeException(sprintf('The proxy class name must be suffixed with "%s" and an optional string, but got "%s".', NamingStrategyInterface::SEPARATOR, $proxyClassName)); - } - $this->generatedClass->setName($proxyClassName); - - if (!empty($this->interfaces)) { - $this->generatedClass->setInterfaceNames(array_map(function($v) { return '\\'.$v; }, $this->interfaces)); - - foreach ($this->getInterfaceMethods() as $method) { - $method = PhpMethod::fromReflection($method); - $method->setAbstract(false); - - $this->generatedClass->setMethod($method); - } - } - - if (!empty($this->generators)) { - foreach ($this->generators as $generator) { - $generator->generate($this->class, $this->generatedClass); - } - } - - return $this->generateCode($this->generatedClass); - } - - /** - * Adds stub methods for the interfaces that have been implemented. - */ - protected function getInterfaceMethods() - { - $methods = array(); - - foreach ($this->interfaces as $interface) { - $ref = new \ReflectionClass($interface); - $methods = array_merge($methods, $ref->getMethods()); - } - - return $methods; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/GeneratorInterface.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/GeneratorInterface.php deleted file mode 100644 index e641ec5..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/GeneratorInterface.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Proxy; - -use CG\Generator\PhpClass; - -/** - * Interface for enhancing generators. - * - * @author Johannes M. Schmitt - */ -interface GeneratorInterface -{ - /** - * Generates the necessary changes in the class. - * - * @param \ReflectionClass $originalClass - * @param PhpClass $generatedClass The generated class - * @return void - */ - function generate(\ReflectionClass $originalClass, PhpClass $generatedClass); -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/InterceptionGenerator.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/InterceptionGenerator.php deleted file mode 100644 index 31a8ba6..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/InterceptionGenerator.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Proxy; - -use CG\Core\ClassUtils; - -use CG\Core\ReflectionUtils; - -use CG\Generator\PhpParameter; -use CG\Generator\PhpProperty; -use CG\Generator\PhpMethod; -use CG\Generator\PhpClass; - -/** - * Interception Generator. - * - * This generator creates joinpoints to allow for AOP advices. Right now, it only - * supports the most powerful around advice. - * - * @author Johannes M. Schmitt - */ -class InterceptionGenerator implements GeneratorInterface -{ - private $prefix = '__CGInterception__'; - private $filter; - private $requiredFile; - - public function setRequiredFile($file) - { - $this->requiredFile = $file; - } - - public function setPrefix($prefix) - { - $this->prefix = $prefix; - } - - public function setFilter(\Closure $filter) - { - $this->filter = $filter; - } - - public function generate(\ReflectionClass $originalClass, PhpClass $genClass) - { - $methods = ReflectionUtils::getOverrideableMethods($originalClass); - - if (null !== $this->filter) { - $methods = array_filter($methods, $this->filter); - } - - if (empty($methods)) { - return; - } - - if (!empty($this->requiredFile)) { - $genClass->addRequiredFile($this->requiredFile); - } - - $interceptorLoader = new PhpProperty(); - $interceptorLoader - ->setName($this->prefix.'loader') - ->setVisibility(PhpProperty::VISIBILITY_PRIVATE) - ; - $genClass->setProperty($interceptorLoader); - - $loaderSetter = new PhpMethod(); - $loaderSetter - ->setName($this->prefix.'setLoader') - ->setVisibility(PhpMethod::VISIBILITY_PUBLIC) - ->setBody('$this->'.$this->prefix.'loader = $loader;') - ; - $genClass->setMethod($loaderSetter); - $loaderParam = new PhpParameter(); - $loaderParam - ->setName('loader') - ->setType('CG\Proxy\InterceptorLoaderInterface') - ; - $loaderSetter->addParameter($loaderParam); - - $interceptorCode = - '$ref = new \ReflectionMethod(%s, %s);'."\n" - .'$interceptors = $this->'.$this->prefix.'loader->loadInterceptors($ref, $this, array(%s));'."\n" - .'$invocation = new \CG\Proxy\MethodInvocation($ref, $this, array(%s), $interceptors);'."\n\n" - .'return $invocation->proceed();' - ; - - foreach ($methods as $method) { - $params = array(); - foreach ($method->getParameters() as $param) { - $params[] = '$'.$param->name; - } - $params = implode(', ', $params); - - $genMethod = PhpMethod::fromReflection($method) - ->setBody(sprintf($interceptorCode, var_export(ClassUtils::getUserClass($method->class), true), var_export($method->name, true), $params, $params)) - ->setDocblock(null) - ; - $genClass->setMethod($genMethod); - } - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/InterceptorLoaderInterface.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/InterceptorLoaderInterface.php deleted file mode 100644 index 5deff19..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/InterceptorLoaderInterface.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Proxy; - -/** - * Interception Loader. - * - * Implementations of this interface are responsible for loading the interceptors - * for a certain method. - * - * @author Johannes M. Schmitt - */ -interface InterceptorLoaderInterface -{ - /** - * Loads interceptors. - * - * @param \ReflectionMethod $method - * @return array - */ - function loadInterceptors(\ReflectionMethod $method); -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/LazyInitializerGenerator.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/LazyInitializerGenerator.php deleted file mode 100644 index 8591599..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/LazyInitializerGenerator.php +++ /dev/null @@ -1,153 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Proxy; - -use CG\Generator\Writer; -use CG\Core\ReflectionUtils; -use CG\Generator\GeneratorUtils; -use CG\Generator\PhpParameter; -use CG\Generator\PhpMethod; -use CG\Generator\PhpProperty; -use CG\Generator\PhpClass; - -/** - * Generator for creating lazy-initializing instances. - * - * This generator enhances concrete classes to allow for them to be lazily - * initialized upon first access. - * - * @author Johannes M. Schmitt - */ -class LazyInitializerGenerator implements GeneratorInterface -{ - private $writer; - private $prefix = '__CG__'; - private $markerInterface; - - public function __construct() - { - $this->writer = new Writer(); - } - - public function setPrefix($prefix) - { - $this->prefix = $prefix; - } - - /** - * Sets the marker interface which should be implemented by the - * generated classes. - * - * @param string $interface The FQCN of the interface - */ - public function setMarkerInterface($interface) - { - $this->markerInterface = $interface; - } - - /** - * Generates the necessary methods in the class. - * - * @param \ReflectionClass $originalClass - * @param PhpClass $class - * @return void - */ - public function generate(\ReflectionClass $originalClass, PhpClass $class) - { - $methods = ReflectionUtils::getOverrideableMethods($originalClass, true); - - // no public, non final methods - if (empty($methods)) { - return; - } - - if (null !== $this->markerInterface) { - $class->setImplementedInterfaces(array_merge( - $class->getImplementedInterfaces(), - array($this->markerInterface) - )); - } - - $initializer = new PhpProperty(); - $initializer->setName($this->prefix.'lazyInitializer'); - $initializer->setVisibility(PhpProperty::VISIBILITY_PRIVATE); - $class->setProperty($initializer); - - $initialized = new PhpProperty(); - $initialized->setName($this->prefix.'initialized'); - $initialized->setDefaultValue(false); - $initialized->setVisibility(PhpProperty::VISIBILITY_PRIVATE); - $class->setProperty($initialized); - - $initializerSetter = new PhpMethod(); - $initializerSetter->setName($this->prefix.'setLazyInitializer'); - $initializerSetter->setBody('$this->'.$this->prefix.'lazyInitializer = $initializer;'); - - $parameter = new PhpParameter(); - $parameter->setName('initializer'); - $parameter->setType('\CG\Proxy\LazyInitializerInterface'); - $initializerSetter->addParameter($parameter); - $class->setMethod($initializerSetter); - - $this->addMethods($class, $methods); - - $initializingMethod = new PhpMethod(); - $initializingMethod->setName($this->prefix.'initialize'); - $initializingMethod->setVisibility(PhpMethod::VISIBILITY_PRIVATE); - $initializingMethod->setBody( - $this->writer - ->reset() - ->writeln('if (null === $this->'.$this->prefix.'lazyInitializer) {') - ->indent() - ->writeln('throw new \RuntimeException("'.$this->prefix.'setLazyInitializer() must be called prior to any other public method on this object.");') - ->outdent() - ->write("}\n\n") - ->writeln('$this->'.$this->prefix.'lazyInitializer->initializeObject($this);') - ->writeln('$this->'.$this->prefix.'initialized = true;') - ->getContent() - ); - $class->setMethod($initializingMethod); - } - - private function addMethods(PhpClass $class, array $methods) - { - foreach ($methods as $method) { - $initializingCode = 'if (false === $this->'.$this->prefix.'initialized) {'."\n" - .' $this->'.$this->prefix.'initialize();'."\n" - .'}'; - - if ($class->hasMethod($method->name)) { - $genMethod = $class->getMethod($method->name); - $genMethod->setBody( - $initializingCode."\n" - .$genMethod->getBody() - ); - - continue; - } - - $genMethod = PhpMethod::fromReflection($method); - $genMethod->setBody( - $initializingCode."\n\n" - .'return '.GeneratorUtils::callMethod($method).';' - ); - $class->setMethod($genMethod); - } - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/LazyInitializerInterface.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/LazyInitializerInterface.php deleted file mode 100644 index 7cfca5b..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/LazyInitializerInterface.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Proxy; - -/** - * Lazy Initializer. - * - * Implementations of this interface are responsible for lazily initializing - * object instances. - * - * @author Johannes M. Schmitt - */ -interface LazyInitializerInterface -{ - /** - * Initializes the passed object. - * - * @param object $object - * @return void - */ - function initializeObject($object); -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/MethodInterceptorInterface.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/MethodInterceptorInterface.php deleted file mode 100644 index f1a7997..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/MethodInterceptorInterface.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Proxy; - -/** - * Interface for Method Interceptors. - * - * Implementations of this interface can execute custom code before, and after the - * invocation of the actual method. In addition, they can also catch, or throw - * exceptions, modify the return value, or modify the arguments. - * - * This is also known as around advice in AOP terminology. - * - * @author Johannes M. Schmitt - */ -interface MethodInterceptorInterface -{ - /** - * Called when intercepting a method call. - * - * @param MethodInvocation $invocation - * @return mixed the return value for the method invocation - * @throws \Exception may throw any exception - */ - function intercept(MethodInvocation $invocation); -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/MethodInvocation.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/MethodInvocation.php deleted file mode 100644 index 11393f4..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/MethodInvocation.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Proxy; - -/** - * Represents a method invocation. - * - * This object contains information for the method invocation, such as the object - * on which the method is invoked, and the arguments that are passed to the method. - * - * Before the actual method is called, first all the interceptors must call the - * proceed() method on this class. - * - * @author Johannes M. Schmitt - */ -class MethodInvocation -{ - public $reflection; - public $object; - public $arguments; - - private $interceptors; - private $pointer; - - public function __construct(\ReflectionMethod $reflection, $object, array $arguments, array $interceptors) - { - $this->reflection = $reflection; - $this->object = $object; - $this->arguments = $arguments; - $this->interceptors = $interceptors; - $this->pointer = 0; - } - - /** - * Proceeds down the call-chain and eventually calls the original method. - * - * @return mixed - */ - public function proceed() - { - if (isset($this->interceptors[$this->pointer])) { - return $this->interceptors[$this->pointer++]->intercept($this); - } - - $this->reflection->setAccessible(true); - - return $this->reflection->invokeArgs($this->object, $this->arguments); - } - - /** - * Returns a string representation of the method. - * - * This is intended for debugging purposes only. - * - * @return string - */ - public function __toString() - { - return sprintf('%s::%s', $this->reflection->class, $this->reflection->name); - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/RegexInterceptionLoader.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/RegexInterceptionLoader.php deleted file mode 100644 index 74a7c37..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Proxy/RegexInterceptionLoader.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Proxy; - -class RegexInterceptionLoader implements InterceptorLoaderInterface -{ - private $interceptors; - - public function __construct(array $interceptors = array()) - { - $this->interceptors = $interceptors; - } - - public function loadInterceptors(\ReflectionMethod $method) - { - $signature = $method->class.'::'.$method->name; - - $matchingInterceptors = array(); - foreach ($this->interceptors as $pattern => $interceptor) { - if (preg_match('#'.$pattern.'#', $signature)) { - $matchingInterceptors[] = $this->initializeInterceptor($interceptor); - } - } - - return $matchingInterceptors; - } - - protected function initializeInterceptor($interceptor) - { - return $interceptor; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Version.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Version.php deleted file mode 100644 index 0ca6842..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/src/CG/Version.php +++ /dev/null @@ -1,8 +0,0 @@ -assertEquals('Foo', ClassUtils::getUserClass('Foo')); - $this->assertEquals('Bar', ClassUtils::getUserClass('FOO\__CG__\Bar')); - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Core/DefaultGeneratorStrategyTest.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Core/DefaultGeneratorStrategyTest.php deleted file mode 100644 index 2ab4638..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Core/DefaultGeneratorStrategyTest.php +++ /dev/null @@ -1,66 +0,0 @@ -setConstantSortFunc(function($a, $b) { - return strcasecmp($a, $b); - }); - $strategy->setMethodSortFunc($func = function($a, $b) { - return strcasecmp($a->getName(), $b->getName()); - }); - $strategy->setPropertySortFunc($func); - - $this->assertEquals( - $this->getContent('GenerationTestClass_A.php'), - $strategy->generate($this->getClass()) - ); - } - - public function testGenerateChangedConstantOrder() - { - $strategy = new DefaultGeneratorStrategy(); - $strategy->setConstantSortFunc(function($a, $b) { - return -1 * strcasecmp($a, $b); - }); - $strategy->setMethodSortFunc($func = function($a, $b) { - return strcasecmp($a->getName(), $b->getName()); - }); - $strategy->setPropertySortFunc($func); - - $this->assertEquals( - $this->getContent('GenerationTestClass_B.php'), - $strategy->generate($this->getClass()) - ); - } - - private function getContent($file) - { - return file_get_contents(__DIR__.'/generated/'.$file); - } - - private function getClass() - { - $class = PhpClass::create() - ->setName('GenerationTestClass') - ->setMethod(PhpMethod::create('a')) - ->setMethod(PhpMethod::create('b')) - ->setProperty(PhpProperty::create('a')) - ->setProperty(PhpProperty::create('b')) - ->setConstant('a', 'foo') - ->setConstant('b', 'bar') - ; - - return $class; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Core/ReflectionUtilsTest.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Core/ReflectionUtilsTest.php deleted file mode 100644 index d46f675..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Core/ReflectionUtilsTest.php +++ /dev/null @@ -1,48 +0,0 @@ -assertEquals(4, count($methods)); - - $methods = array_map(function($v) { return $v->name; }, $methods); - sort($methods); - $this->assertEquals(array('a', 'd', 'e', 'h'), $methods); - } - - public function testGetUnindentedDocComment() - { - $writer = new Writer(); - $comment = $writer - ->writeln('/**') - ->indent() - ->writeln(' * Foo.') - ->write(' */') - ->getContent() - ; - - $this->assertEquals("/**\n * Foo.\n */", ReflectionUtils::getUnindentedDocComment($comment)); - } -} - -abstract class OverridableReflectionTest -{ - public function a() { } - public final function b() { } - public static function c() { } - abstract public function d(); - protected function e() { } - protected final function f() {} - protected static function g() { } - abstract protected function h(); - private function i() { } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Core/generated/GenerationTestClass_A.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Core/generated/GenerationTestClass_A.php deleted file mode 100644 index 4f17cc8..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Core/generated/GenerationTestClass_A.php +++ /dev/null @@ -1,16 +0,0 @@ -class GenerationTestClass -{ - const a = 'foo'; - const b = 'bar'; - - public $a; - public $b; - - public function a() - { - } - - public function b() - { - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Core/generated/GenerationTestClass_B.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Core/generated/GenerationTestClass_B.php deleted file mode 100644 index 6a0c80c..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Core/generated/GenerationTestClass_B.php +++ /dev/null @@ -1,16 +0,0 @@ -class GenerationTestClass -{ - const b = 'bar'; - const a = 'foo'; - - public $a; - public $b; - - public function a() - { - } - - public function b() - { - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/AbstractPhpMemberTest.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/AbstractPhpMemberTest.php deleted file mode 100644 index 16f65c9..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/AbstractPhpMemberTest.php +++ /dev/null @@ -1,58 +0,0 @@ -getMember(); - - $this->assertFalse($member->isStatic()); - $this->assertSame($member, $member->setStatic(true)); - $this->assertTrue($member->isStatic()); - $this->assertSame($member, $member->setStatic(false)); - $this->assertFalse($member->isStatic()); - } - - public function testSetGetVisibility() - { - $member = $this->getMember(); - - $this->assertEquals('public', $member->getVisibility()); - $this->assertSame($member, $member->setVisibility('private')); - $this->assertEquals('private', $member->getVisibility()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testSetVisibilityThrowsExOnInvalidValue() - { - $member = $this->getMember(); - $member->setVisibility('foo'); - } - - public function testSetGetName() - { - $member = $this->getMember(); - - $this->assertNull($member->getName()); - $this->assertSame($member, $member->setName('foo')); - $this->assertEquals('foo', $member->getName()); - } - - public function testSetGetDocblock() - { - $member = $this->getMember(); - - $this->assertNull($member->getDocblock()); - $this->assertSame($member, $member->setDocblock('foo')); - $this->assertEquals('foo', $member->getDocblock()); - } - - private function getMember() - { - return $this->getMockForAbstractClass('CG\Generator\AbstractPhpMember'); - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/DefaultVisitorTest.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/DefaultVisitorTest.php deleted file mode 100644 index a159a1a..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/DefaultVisitorTest.php +++ /dev/null @@ -1,47 +0,0 @@ -setName('foo') - ->addParameter(PhpParameter::create('a')) - ->addParameter(PhpParameter::create('b')) - ->setBody( - $writer - ->writeln('if ($a === $b) {') - ->indent() - ->writeln('throw new \InvalidArgumentException(\'$a is not allowed to be the same as $b.\');') - ->outdent() - ->write("}\n\n") - ->write('return $b;') - ->getContent() - ) - ; - - $visitor = new DefaultVisitor(); - $visitor->visitFunction($function); - - $this->assertEquals($this->getContent('a_b_function.php'), $visitor->getContent()); - } - - private function getContent($filename) - { - if (!is_file($path = __DIR__.'/Fixture/generated/'.$filename)) { - throw new \InvalidArgumentException(sprintf('The file "%s" does not exist.', $path)); - } - - return file_get_contents($path); - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/Fixture/Entity.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/Fixture/Entity.php deleted file mode 100644 index 525a616..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/Fixture/Entity.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ -abstract class Entity -{ - /** - * @var integer - */ - private $id; - private $enabled = false; - - /** - * Another doc comment. - * - * @param unknown_type $a - * @param array $b - * @param \stdClass $c - * @param unknown_type $d - */ - public final function __construct($a, array &$b, \stdClass $c, $d = 'foo') - { - } - - abstract protected function foo(); - - private static function bar() - { - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/Fixture/generated/a_b_function.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/Fixture/generated/a_b_function.php deleted file mode 100644 index 8a79355..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/Fixture/generated/a_b_function.php +++ /dev/null @@ -1,8 +0,0 @@ -function foo($a, $b) -{ - if ($a === $b) { - throw new \InvalidArgumentException('$a is not allowed to be the same as $b.'); - } - - return $b; -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/PhpClassTest.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/PhpClassTest.php deleted file mode 100644 index ab35d16..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/PhpClassTest.php +++ /dev/null @@ -1,215 +0,0 @@ -setName('CG\Tests\Generator\Fixture\Entity') - ->setAbstract(true) - ->setDocblock('/** - * Doc Comment. - * - * @author Johannes M. Schmitt - */') - ->setProperty(PhpProperty::create('id') - ->setVisibility('private') - ->setDocblock('/** - * @var integer - */') - ) - ->setProperty(PhpProperty::create('enabled') - ->setVisibility('private') - ->setDefaultValue(false) - ) - ; - - $method = PhpMethod::create() - ->setName('__construct') - ->setFinal(true) - ->addParameter(new PhpParameter('a')) - ->addParameter(PhpParameter::create() - ->setName('b') - ->setType('array') - ->setPassedByReference(true) - ) - ->addParameter(PhpParameter::create() - ->setName('c') - ->setType('stdClass') - ) - ->addParameter(PhpParameter::create() - ->setName('d') - ->setDefaultValue('foo') - )->setDocblock('/** - * Another doc comment. - * - * @param unknown_type $a - * @param array $b - * @param \stdClass $c - * @param unknown_type $d - */') - ; - $class->setMethod($method); - - $class->setMethod(PhpMethod::create() - ->setName('foo') - ->setAbstract(true) - ->setVisibility('protected') - ); - - $class->setMethod(PhpMethod::create() - ->setName('bar') - ->setStatic(true) - ->setVisibility('private') - ); - - $this->assertEquals($class, PhpClass::fromReflection(new \ReflectionClass('CG\Tests\Generator\Fixture\Entity'))); - } - - public function testGetSetName() - { - $class = new PhpClass(); - $this->assertNull($class->getName()); - - $class = new PhpClass('foo'); - $this->assertEquals('foo', $class->getName()); - $this->assertSame($class, $class->setName('bar')); - $this->assertEquals('bar', $class->getName()); - } - - public function testSetGetConstants() - { - $class = new PhpClass(); - - $this->assertEquals(array(), $class->getConstants()); - $this->assertSame($class, $class->setConstants(array('foo' => 'bar'))); - $this->assertEquals(array('foo' => 'bar'), $class->getConstants()); - $this->assertSame($class, $class->setConstant('bar', 'baz')); - $this->assertEquals(array('foo' => 'bar', 'bar' => 'baz'), $class->getConstants()); - $this->assertSame($class, $class->removeConstant('foo')); - $this->assertEquals(array('bar' => 'baz'), $class->getConstants()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testRemoveConstantThrowsExceptionWhenConstantDoesNotExist() - { - $class = new PhpClass(); - $class->removeConstant('foo'); - } - - public function testSetIsAbstract() - { - $class = new PhpClass(); - - $this->assertFalse($class->isAbstract()); - $this->assertSame($class, $class->setAbstract(true)); - $this->assertTrue($class->isAbstract()); - $this->assertSame($class, $class->setAbstract(false)); - $this->assertFalse($class->isAbstract()); - } - - public function testSetIsFinal() - { - $class = new PhpClass(); - - $this->assertFalse($class->isFinal()); - $this->assertSame($class, $class->setFinal(true)); - $this->assertTrue($class->isFinal()); - $this->assertSame($class, $class->setFinal(false)); - $this->assertFalse($class->isFinal()); - } - - public function testSetGetParentClassName() - { - $class = new PhpClass(); - - $this->assertNull($class->getParentClassName()); - $this->assertSame($class, $class->setParentClassName('stdClass')); - $this->assertEquals('stdClass', $class->getParentClassName()); - $this->assertSame($class, $class->setParentClassName(null)); - $this->assertNull($class->getParentClassName()); - } - - public function testSetGetInterfaceNames() - { - $class = new PhpClass(); - - $this->assertEquals(array(), $class->getInterfaceNames()); - $this->assertSame($class, $class->setInterfaceNames(array('foo', 'bar'))); - $this->assertEquals(array('foo', 'bar'), $class->getInterfaceNames()); - $this->assertSame($class, $class->addInterfaceName('stdClass')); - $this->assertEquals(array('foo', 'bar', 'stdClass'), $class->getInterfaceNames()); - } - - public function testSetGetUseStatements() - { - $class = new PhpClass(); - - $this->assertEquals(array(), $class->getUseStatements()); - $this->assertSame($class, $class->setUseStatements(array('foo' => 'bar'))); - $this->assertEquals(array('foo' => 'bar'), $class->getUseStatements()); - $this->assertSame($class, $class->addUseStatement('Foo\Bar')); - $this->assertEquals(array('foo' => 'bar', 'Bar' => 'Foo\Bar'), $class->getUseStatements()); - $this->assertSame($class, $class->addUseStatement('Foo\Bar', 'Baz')); - $this->assertEquals(array('foo' => 'bar', 'Bar' => 'Foo\Bar', 'Baz' => 'Foo\Bar'), $class->getUseStatements()); - } - - public function testSetGetProperties() - { - $class = new PhpClass(); - - $this->assertEquals(array(), $class->getProperties()); - $this->assertSame($class, $class->setProperties($props = array('foo' => new PhpProperty()))); - $this->assertSame($props, $class->getProperties()); - $this->assertSame($class, $class->setProperty($prop = new PhpProperty('foo'))); - $this->assertSame(array('foo' => $prop), $class->getProperties()); - $this->assertTrue($class->hasProperty('foo')); - $this->assertSame($class, $class->removeProperty('foo')); - $this->assertEquals(array(), $class->getProperties()); - } - - public function testSetGetMethods() - { - $class = new PhpClass(); - - $this->assertEquals(array(), $class->getMethods()); - $this->assertSame($class, $class->setMethods($methods = array('foo' => new PhpMethod()))); - $this->assertSame($methods, $class->getMethods()); - $this->assertSame($class, $class->setMethod($method = new PhpMethod('foo'))); - $this->assertSame(array('foo' => $method), $class->getMethods()); - $this->assertTrue($class->hasMethod('foo')); - $this->assertSame($class, $class->removeMethod('foo')); - $this->assertEquals(array(), $class->getMethods()); - } - - public function testSetGetDocblock() - { - $class = new PhpClass(); - - $this->assertNull($class->getDocblock()); - $this->assertSame($class, $class->setDocblock('foo')); - $this->assertEquals('foo', $class->getDocblock()); - } - - public function testSetGetRequiredFiles() - { - $class = new PhpClass(); - - $this->assertEquals(array(), $class->getRequiredFiles()); - $this->assertSame($class, $class->setRequiredFiles(array('foo'))); - $this->assertEquals(array('foo'), $class->getRequiredFiles()); - $this->assertSame($class, $class->addRequiredFile('bar')); - $this->assertEquals(array('foo', 'bar'), $class->getRequiredFiles()); - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/PhpFunctionTest.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/PhpFunctionTest.php deleted file mode 100644 index 376b58a..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/PhpFunctionTest.php +++ /dev/null @@ -1,75 +0,0 @@ -assertNull($func->getName()); - $this->assertSame($func, $func->setName('foo')); - $this->assertEquals('foo', $func->getName()); - - $func = new PhpFunction('foo'); - $this->assertEquals('foo', $func->getName()); - } - - public function testSetGetNamespace() - { - $func = new PhpFunction(); - - $this->assertNull($func->getNamespace()); - $this->assertSame($func, $func->setNamespace('foo')); - $this->assertEquals('foo', $func->getNamespace()); - } - - public function testSetGetBody() - { - $func = new PhpFunction(); - - $this->assertSame('', $func->getBody()); - $this->assertSame($func, $func->setBody('foo')); - $this->assertEquals('foo', $func->getBody()); - } - - public function testSetGetParameters() - { - $func = new PhpFunction(); - - $this->assertEquals(array(), $func->getParameters()); - $this->assertSame($func, $func->setParameters(array($param = new PhpParameter()))); - $this->assertSame(array($param), $func->getParameters()); - $this->assertSame($func, $func->addParameter($param2 = new PhpParameter())); - $this->assertSame(array($param, $param2), $func->getParameters()); - $this->assertSame($func, $func->replaceParameter(1, $param3 = new PhpParameter())); - $this->assertSame(array($param, $param3), $func->getParameters()); - $this->assertSame($func, $func->removeParameter(0)); - $this->assertSame(array($param3), $func->getParameters()); - } - - public function testSetGetDocblock() - { - $func = new PhpFunction(); - - $this->assertNull($func->getDocblock()); - $this->assertSame($func, $func->setDocblock('foo')); - $this->assertEquals('foo', $func->getDocblock()); - } - - public function testSetIsReferenceReturned() - { - $func = new PhpFunction(); - - $this->assertFalse($func->isReferenceReturned()); - $this->assertSame($func, $func->setReferenceReturned(true)); - $this->assertTrue($func->isReferenceReturned()); - $this->assertSame($func, $func->setReferenceReturned(false)); - $this->assertFalse($func->isReferenceReturned()); - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/PhpMethodTest.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/PhpMethodTest.php deleted file mode 100644 index cd84bc5..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/PhpMethodTest.php +++ /dev/null @@ -1,74 +0,0 @@ -assertFalse($method->isFinal()); - $this->assertSame($method, $method->setFinal(true)); - $this->assertTrue($method->isFinal()); - $this->assertSame($method, $method->setFinal(false)); - $this->assertFalse($method->isFinal()); - } - - public function testSetIsAbstract() - { - $method = new PhpMethod(); - - $this->assertFalse($method->isAbstract()); - $this->assertSame($method, $method->setAbstract(true)); - $this->assertTrue($method->isAbstract()); - $this->assertSame($method, $method->setAbstract(false)); - $this->assertFalse($method->isAbstract()); - } - - public function testSetGetParameters() - { - $method = new PhpMethod(); - - $this->assertEquals(array(), $method->getParameters()); - $this->assertSame($method, $method->setParameters($params = array(new PhpParameter()))); - $this->assertSame($params, $method->getParameters()); - - $this->assertSame($method, $method->addParameter($param = new PhpParameter())); - $params[] = $param; - $this->assertSame($params, $method->getParameters()); - - $this->assertSame($method, $method->removeParameter(0)); - unset($params[0]); - $this->assertSame(array($param), $method->getParameters()); - - $this->assertSame($method, $method->addParameter($param = new PhpParameter())); - $params[] = $param; - $params = array_values($params); - $this->assertSame($params, $method->getParameters()); - } - - public function testSetGetBody() - { - $method = new PhpMethod(); - - $this->assertSame('', $method->getBody()); - $this->assertSame($method, $method->setBody('foo')); - $this->assertEquals('foo', $method->getBody()); - } - - public function testSetIsReferenceReturned() - { - $method = new PhpMethod(); - - $this->assertFalse($method->isReferenceReturned()); - $this->assertSame($method, $method->setReferenceReturned(true)); - $this->assertTrue($method->isReferenceReturned()); - $this->assertSame($method, $method->setReferenceReturned(false)); - $this->assertFalse($method->isReferenceReturned()); - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/PhpParameterTest.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/PhpParameterTest.php deleted file mode 100644 index 7586a97..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/PhpParameterTest.php +++ /dev/null @@ -1,51 +0,0 @@ -assertNull($param->getName()); - $this->assertSame($param, $param->setName('foo')); - $this->assertEquals('foo', $param->getName()); - } - - public function testSetGetDefaultValue() - { - $param = new PhpParameter(); - - $this->assertNull($param->getDefaultValue()); - $this->assertFalse($param->hasDefaultValue()); - $this->assertSame($param, $param->setDefaultValue('foo')); - $this->assertEquals('foo', $param->getDefaultValue()); - $this->assertTrue($param->hasDefaultValue()); - $this->assertSame($param, $param->unsetDefaultValue()); - $this->assertNull($param->getDefaultValue()); - $this->assertFalse($param->hasDefaultValue()); - } - - public function testSetIsPassedByReference() - { - $param = new PhpParameter(); - - $this->assertFalse($param->isPassedByReference()); - $this->assertSame($param, $param->setPassedByReference(true)); - $this->assertTrue($param->isPassedByReference()); - $this->assertSame($param, $param->setPassedByReference(false)); - $this->assertFalse($param->isPassedByReference()); - } - - public function testSetGetType() - { - $param = new PhpParameter(); - - $this->assertNull($param->getType()); - $this->assertSame($param, $param->setType('array')); - $this->assertEquals('array', $param->getType()); - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/PhpPropertyTest.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/PhpPropertyTest.php deleted file mode 100644 index df28f8f..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Generator/PhpPropertyTest.php +++ /dev/null @@ -1,22 +0,0 @@ -assertNull($prop->getDefaultValue()); - $this->assertFalse($prop->hasDefaultValue()); - $this->assertSame($prop, $prop->setDefaultValue('foo')); - $this->assertEquals('foo', $prop->getDefaultValue()); - $this->assertTrue($prop->hasDefaultValue()); - $this->assertSame($prop, $prop->unsetDefaultValue()); - $this->assertNull($prop->getDefaultValue()); - $this->assertFalse($prop->hasDefaultValue()); - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/EnhancerTest.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/EnhancerTest.php deleted file mode 100644 index 30770e2..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/EnhancerTest.php +++ /dev/null @@ -1,111 +0,0 @@ -setNamingStrategy($this->getNamingStrategy($generatedClass)); - - $this->assertEquals($this->getContent(substr($generatedClass, strrpos($generatedClass, '\\') + 1)), $enhancer->generateClass()); - } - - public function getGenerationTests() - { - return array( - array('CG\Tests\Proxy\Fixture\SimpleClass', 'CG\Tests\Proxy\Fixture\SimpleClass__CG__Enhanced', array('CG\Tests\Proxy\Fixture\MarkerInterface'), array()), - array('CG\Tests\Proxy\Fixture\SimpleClass', 'CG\Tests\Proxy\Fixture\SimpleClass__CG__Sluggable', array('CG\Tests\Proxy\Fixture\SluggableInterface'), array()), - array('CG\Tests\Proxy\Fixture\Entity', 'CG\Tests\Proxy\Fixture\Entity__CG__LazyInitializing', array(), array( - new LazyInitializerGenerator(), - )) - ); - } - - public function testInterceptionGenerator() - { - $enhancer = new Enhancer(new \ReflectionClass('CG\Tests\Proxy\Fixture\Entity'), array(), array( - $generator = new InterceptionGenerator() - )); - $enhancer->setNamingStrategy($this->getNamingStrategy('CG\Tests\Proxy\Fixture\Entity__CG__Traceable_'.sha1(microtime(true)))); - $generator->setPrefix(''); - - $traceable = $enhancer->createInstance(); - $traceable->setLoader($this->getLoader(array( - $interceptor1 = new TraceInterceptor(), - $interceptor2 = new TraceInterceptor(), - ))); - - $this->assertEquals('foo', $traceable->getName()); - $this->assertEquals('foo', $traceable->getName()); - $this->assertEquals(2, count($interceptor1->getLog())); - $this->assertEquals(2, count($interceptor2->getLog())); - } - - public function testLazyInitializerGenerator() - { - $enhancer = new Enhancer(new \ReflectionClass('CG\Tests\Proxy\Fixture\Entity'), array(), array( - $generator = new LazyInitializerGenerator(), - )); - $generator->setPrefix(''); - - $entity = $enhancer->createInstance(); - $entity->setLazyInitializer($initializer = new Initializer()); - $this->assertEquals('foo', $entity->getName()); - $this->assertSame($entity, $initializer->getLastObject()); - } - - private function getLoader(array $interceptors) - { - $loader = $this->getMock('CG\Proxy\InterceptorLoaderInterface'); - $loader - ->expects($this->any()) - ->method('loadInterceptors') - ->will($this->returnValue($interceptors)) - ; - - return $loader; - } - - private function getContent($file) - { - return file_get_contents(__DIR__.'/Fixture/generated/'.$file.'.php.gen'); - } - - private function getNamingStrategy($name) - { - $namingStrategy = $this->getMock('CG\Core\NamingStrategyInterface'); - $namingStrategy - ->expects($this->any()) - ->method('getClassName') - ->will($this->returnValue($name)) - ; - - return $namingStrategy; - } -} - -class Initializer implements LazyInitializerInterface -{ - private $lastObject; - - public function initializeObject($object) - { - $this->lastObject = $object; - } - - public function getLastObject() - { - return $this->lastObject; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/Entity.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/Entity.php deleted file mode 100644 index c7564a2..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/Entity.php +++ /dev/null @@ -1,23 +0,0 @@ -log; - } - - public function intercept(MethodInvocation $method) - { - $message = sprintf('%s::%s(', $method->reflection->class, $method->reflection->name); - - $logArgs = array(); - foreach ($method->arguments as $arg) { - $logArgs[] = var_export($arg, true); - } - $this->log[] = $message.implode(', ', $logArgs).')'; - - return $method->proceed(); - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/generated/Entity__CG__LazyInitializing.php.gen b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/generated/Entity__CG__LazyInitializing.php.gen deleted file mode 100644 index e7e4965..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/generated/Entity__CG__LazyInitializing.php.gen +++ /dev/null @@ -1,37 +0,0 @@ -namespace CG\Tests\Proxy\Fixture; - -/** - * CG library enhanced proxy class. - * - * This code was generated automatically by the CG library, manual changes to it - * will be lost upon next generation. - */ -class Entity__CG__LazyInitializing extends \CG\Tests\Proxy\Fixture\Entity -{ - private $__CG__lazyInitializer; - private $__CG__initialized = false; - - public function getName() - { - if (false === $this->__CG__initialized) { - $this->__CG__initialize(); - } - - return \CG\Tests\Proxy\Fixture\Entity::getName(); - } - - public function __CG__setLazyInitializer(\CG\Proxy\LazyInitializerInterface $initializer) - { - $this->__CG__lazyInitializer = $initializer; - } - - private function __CG__initialize() - { - if (null === $this->__CG__lazyInitializer) { - throw new \RuntimeException("__CG__setLazyInitializer() must be called prior to any other public method on this object."); - } - - $this->__CG__lazyInitializer->initializeObject($this); - $this->__CG__initialized = true; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/generated/SimpleClass__CG__Enhanced.php.gen b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/generated/SimpleClass__CG__Enhanced.php.gen deleted file mode 100644 index 3b367fc..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/generated/SimpleClass__CG__Enhanced.php.gen +++ /dev/null @@ -1,11 +0,0 @@ -namespace CG\Tests\Proxy\Fixture; - -/** - * CG library enhanced proxy class. - * - * This code was generated automatically by the CG library, manual changes to it - * will be lost upon next generation. - */ -class SimpleClass__CG__Enhanced extends \CG\Tests\Proxy\Fixture\SimpleClass implements \CG\Tests\Proxy\Fixture\MarkerInterface -{ -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/generated/SimpleClass__CG__Sluggable.php.gen b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/generated/SimpleClass__CG__Sluggable.php.gen deleted file mode 100644 index 1b6be0c..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/CG/Tests/Proxy/Fixture/generated/SimpleClass__CG__Sluggable.php.gen +++ /dev/null @@ -1,14 +0,0 @@ -namespace CG\Tests\Proxy\Fixture; - -/** - * CG library enhanced proxy class. - * - * This code was generated automatically by the CG library, manual changes to it - * will be lost upon next generation. - */ -class SimpleClass__CG__Sluggable extends \CG\Tests\Proxy\Fixture\SimpleClass implements \CG\Tests\Proxy\Fixture\SluggableInterface -{ - public function getSlug() - { - } -} \ No newline at end of file diff --git a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/bootstrap.php b/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/bootstrap.php deleted file mode 100644 index 76bcd6c..0000000 --- a/vendor/jms/cg/schmittjoh-cg-library-ce8ef43/tests/bootstrap.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - */ - -spl_autoload_register(function($class) -{ - if (0 === strpos($class, 'CG\Tests\\')) { - $path = __DIR__.'/../tests/'.strtr($class, '\\', '/').'.php'; - if (file_exists($path) && is_readable($path)) { - require_once $path; - - return true; - } - } else if (0 === strpos($class, 'CG\\')) { - $path = __DIR__.'/../src/'.($class = strtr($class, '\\', '/')).'.php'; - if (file_exists($path) && is_readable($path)) { - require_once $path; - - return true; - } - } else if (0 === strpos($class, 'Zend\\')) { - $path = __DIR__.'/../../zend-framework2/library/'.($class = strtr($class, '\\', '/')).'.php'; - if (file_exists($path) && is_readable($path)) { - require_once $path; - - return true; - } - } -}); - diff --git a/vendor/jms/cg/src/CG/Core/AbstractClassGenerator.php b/vendor/jms/cg/src/CG/Core/AbstractClassGenerator.php deleted file mode 100644 index 203d9ba..0000000 --- a/vendor/jms/cg/src/CG/Core/AbstractClassGenerator.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Core; - -use CG\Generator\PhpClass; - -/** - * Abstract base class for all class generators. - * - * @author Johannes M. Schmitt - */ -abstract class AbstractClassGenerator implements ClassGeneratorInterface -{ - private $namingStrategy; - private $generatorStrategy; - - public function setNamingStrategy(NamingStrategyInterface $namingStrategy = null) - { - $this->namingStrategy = $namingStrategy; - } - - public function setGeneratorStrategy(GeneratorStrategyInterface $generatorStrategy = null) - { - $this->generatorStrategy = $generatorStrategy; - } - - public function getClassName(\ReflectionClass $class) - { - if (null === $this->namingStrategy) { - $this->namingStrategy = new DefaultNamingStrategy(); - } - - return $this->namingStrategy->getClassName($class); - } - - protected function generateCode(PhpClass $class) - { - if (null === $this->generatorStrategy) { - $this->generatorStrategy = new DefaultGeneratorStrategy(); - } - - return $this->generatorStrategy->generate($class); - } -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Core/ClassGeneratorInterface.php b/vendor/jms/cg/src/CG/Core/ClassGeneratorInterface.php deleted file mode 100644 index 93ca18f..0000000 --- a/vendor/jms/cg/src/CG/Core/ClassGeneratorInterface.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Core; - -use CG\Generator\PhpClass; - -/** - * Interface for class generators. - * - * @author Johannes M. Schmitt - */ -interface ClassGeneratorInterface -{ - /** - * Generates the PHP class. - * - * @return string - */ - function generateClass(); -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Core/ClassUtils.php b/vendor/jms/cg/src/CG/Core/ClassUtils.php deleted file mode 100644 index 3e33bd5..0000000 --- a/vendor/jms/cg/src/CG/Core/ClassUtils.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Core; - -use CG\Proxy\Enhancer; - -abstract class ClassUtils -{ - public static function getUserClass($className) - { - if (false === $pos = strrpos($className, '\\'.NamingStrategyInterface::SEPARATOR.'\\')) { - return $className; - } - - return substr($className, $pos + NamingStrategyInterface::SEPARATOR_LENGTH + 2); - } - - private final function __construct() {} -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Core/DefaultGeneratorStrategy.php b/vendor/jms/cg/src/CG/Core/DefaultGeneratorStrategy.php deleted file mode 100644 index 28b60bf..0000000 --- a/vendor/jms/cg/src/CG/Core/DefaultGeneratorStrategy.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Core; - -use CG\Generator\DefaultVisitorInterface; -use CG\Generator\PhpClass; -use CG\Generator\DefaultVisitor; -use CG\Generator\DefaultNavigator; - -/** - * The default generator strategy. - * - * This strategy allows to change the order in which methods, properties and - * constants are sorted. - * - * @author Johannes M. Schmitt - */ -class DefaultGeneratorStrategy implements GeneratorStrategyInterface -{ - private $navigator; - private $visitor; - - public function __construct(DefaultVisitorInterface $visitor = null) - { - $this->navigator = new DefaultNavigator(); - $this->visitor = $visitor ?: new DefaultVisitor(); - } - - public function setConstantSortFunc(\Closure $func = null) - { - $this->navigator->setConstantSortFunc($func); - } - - public function setMethodSortFunc(\Closure $func = null) - { - $this->navigator->setMethodSortFunc($func); - } - - public function setPropertySortFunc(\Closure $func = null) - { - $this->navigator->setPropertySortFunc($func); - } - - public function generate(PhpClass $class) - { - $this->visitor->reset(); - $this->navigator->accept($this->visitor, $class); - - return $this->visitor->getContent(); - } -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Core/DefaultNamingStrategy.php b/vendor/jms/cg/src/CG/Core/DefaultNamingStrategy.php deleted file mode 100644 index 600c995..0000000 --- a/vendor/jms/cg/src/CG/Core/DefaultNamingStrategy.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Core; - -/** - * The default naming strategy. - * - * @author Johannes M. Schmitt - */ -class DefaultNamingStrategy implements NamingStrategyInterface -{ - private $prefix; - - public function __construct($prefix = 'EnhancedProxy') - { - $this->prefix = $prefix; - } - - public function getClassName(\ReflectionClass $class) - { - $userClass = ClassUtils::getUserClass($class->name); - - return $this->prefix.'_'.sha1($class->name).'\\'.self::SEPARATOR.'\\'.$userClass; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Core/GeneratorStrategyInterface.php b/vendor/jms/cg/src/CG/Core/GeneratorStrategyInterface.php deleted file mode 100644 index 2468bc1..0000000 --- a/vendor/jms/cg/src/CG/Core/GeneratorStrategyInterface.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Core; - -use CG\Generator\PhpClass; - -/** - * Generator Strategy Interface. - * - * Implementing classes are responsible for generating PHP code from the given - * PhpClass instance. - * - * @author Johannes M. Schmitt - */ -interface GeneratorStrategyInterface -{ - function generate(PhpClass $class); -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Core/NamingStrategyInterface.php b/vendor/jms/cg/src/CG/Core/NamingStrategyInterface.php deleted file mode 100644 index c7c03fa..0000000 --- a/vendor/jms/cg/src/CG/Core/NamingStrategyInterface.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Core; - -/** - * The naming strategy interface. - * - * @author Johannes M. Schmitt - */ -interface NamingStrategyInterface -{ - const SEPARATOR = '__CG__'; - const SEPARATOR_LENGTH = 6; - - /** - * Returns the class name for the proxy class. - * - * The generated class name MUST be the concatenation of a nonempty prefix, - * the namespace separator __CG__, and the original class name. - * - * Examples: - * - * +----------------------------+------------------------------+ - * | Original Name | Generated Name | - * +============================+==============================+ - * | Foo\Bar | dred332\__CG__\Foo\Bar | - * | Bar\Baz | Foo\Doo\__CG__\Bar\Baz | - * +----------------------------+------------------------------+ - * - * @param \ReflectionClass $class - * @return string the class name for the generated class - */ - function getClassName(\ReflectionClass $class); -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Core/ReflectionUtils.php b/vendor/jms/cg/src/CG/Core/ReflectionUtils.php deleted file mode 100644 index e7e9ea7..0000000 --- a/vendor/jms/cg/src/CG/Core/ReflectionUtils.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Core; - -abstract class ReflectionUtils -{ - public static function getOverrideableMethods(\ReflectionClass $class, $publicOnly = false) - { - $filter = \ReflectionMethod::IS_PUBLIC; - - if (!$publicOnly) { - $filter |= \ReflectionMethod::IS_PROTECTED; - } - - return array_filter( - $class->getMethods($filter), - function($method) { return !$method->isFinal() && !$method->isStatic(); } - ); - } - - public static function getUnindentedDocComment($docComment) - { - $lines = explode("\n", $docComment); - for ($i=0,$c=count($lines); $i<$c; $i++) { - if (0 === $i) { - $docBlock = $lines[0]."\n"; - continue; - } - - $docBlock .= ' '.ltrim($lines[$i]); - - if ($i+1 < $c) { - $docBlock .= "\n"; - } - } - - return $docBlock; - } - - private final function __construct() { } -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Generator/AbstractPhpMember.php b/vendor/jms/cg/src/CG/Generator/AbstractPhpMember.php deleted file mode 100644 index 5ae8aa4..0000000 --- a/vendor/jms/cg/src/CG/Generator/AbstractPhpMember.php +++ /dev/null @@ -1,95 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -/** - * Abstract PHP member class. - * - * @author Johannes M. Schmitt - */ -abstract class AbstractPhpMember -{ - const VISIBILITY_PRIVATE = 'private'; - const VISIBILITY_PROTECTED = 'protected'; - const VISIBILITY_PUBLIC = 'public'; - - private $static = false; - private $visibility = self::VISIBILITY_PUBLIC; - private $name; - private $docblock; - - public function __construct($name = null) - { - $this->setName($name); - } - - public function setName($name) - { - $this->name = $name; - - return $this; - } - - public function setVisibility($visibility) - { - if ($visibility !== self::VISIBILITY_PRIVATE - && $visibility !== self::VISIBILITY_PROTECTED - && $visibility !== self::VISIBILITY_PUBLIC) { - throw new \InvalidArgumentException(sprintf('The visibility "%s" does not exist.', $visibility)); - } - - $this->visibility = $visibility; - - return $this; - } - - public function setStatic($bool) - { - $this->static = (Boolean) $bool; - - return $this; - } - - public function setDocblock($doc) - { - $this->docblock = $doc; - - return $this; - } - - public function isStatic() - { - return $this->static; - } - - public function getVisibility() - { - return $this->visibility; - } - - public function getName() - { - return $this->name; - } - - public function getDocblock() - { - return $this->docblock; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Generator/DefaultNavigator.php b/vendor/jms/cg/src/CG/Generator/DefaultNavigator.php deleted file mode 100644 index 3d46bb3..0000000 --- a/vendor/jms/cg/src/CG/Generator/DefaultNavigator.php +++ /dev/null @@ -1,172 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -/** - * The default navigator. - * - * This class is responsible for the default traversal algorithm of the different - * code elements. - * - * Unlike other visitor pattern implementations, this allows to separate the - * traversal logic from the objects that are traversed. - * - * @author Johannes M. Schmitt - */ -class DefaultNavigator -{ - private $constantSortFunc; - private $propertySortFunc; - private $methodSortFunc; - - /** - * Sets a custom constant sorting function. - * - * @param \Closure $func - */ - public function setConstantSortFunc(\Closure $func = null) - { - $this->constantSortFunc = $func; - } - - /** - * Sets a custom property sorting function. - * - * @param \Closure $func - */ - public function setPropertySortFunc(\Closure $func = null) - { - $this->propertySortFunc = $func; - } - - /** - * Sets a custom method sorting function. - * - * @param \Closure $func - */ - public function setMethodSortFunc(\Closure $func = null) - { - $this->methodSortFunc = $func; - } - - public function accept(DefaultVisitorInterface $visitor, PhpClass $class) - { - $visitor->startVisitingClass($class); - - $constants = $class->getConstants(); - if (!empty($constants)) { - uksort($constants, $this->getConstantSortFunc()); - - $visitor->startVisitingConstants(); - foreach ($constants as $name => $value) { - $visitor->visitConstant($name, $value); - } - $visitor->endVisitingConstants(); - } - - $properties = $class->getProperties(); - if (!empty($properties)) { - usort($properties, $this->getPropertySortFunc()); - - $visitor->startVisitingProperties(); - foreach ($properties as $property) { - $visitor->visitProperty($property); - } - $visitor->endVisitingProperties(); - } - - $methods = $class->getMethods(); - if (!empty($methods)) { - usort($methods, $this->getMethodSortFunc()); - - $visitor->startVisitingMethods(); - foreach ($methods as $method) { - $visitor->visitMethod($method); - } - $visitor->endVisitingMethods(); - } - - $visitor->endVisitingClass($class); - } - - private function getConstantSortFunc() - { - return $this->constantSortFunc ?: 'strcasecmp'; - } - - private function getMethodSortFunc() - { - if (null !== $this->methodSortFunc) { - return $this->methodSortFunc; - } - - static $defaultSortFunc; - if (empty($defaultSortFunc)) { - $defaultSortFunc = function($a, $b) { - if ($a->isStatic() !== $isStatic = $b->isStatic()) { - return $isStatic ? 1 : -1; - } - - if (($aV = $a->getVisibility()) !== $bV = $b->getVisibility()) { - $aV = 'public' === $aV ? 3 : ('protected' === $aV ? 2 : 1); - $bV = 'public' === $bV ? 3 : ('protected' === $bV ? 2 : 1); - - return $aV > $bV ? -1 : 1; - } - - $rs = strcasecmp($a->getName(), $b->getName()); - if (0 === $rs) { - return 0; - } - - return $rs > 0 ? -1 : 1; - }; - } - - return $defaultSortFunc; - } - - private function getPropertySortFunc() - { - if (null !== $this->propertySortFunc) { - return $this->propertySortFunc; - } - - static $defaultSortFunc; - if (empty($defaultSortFunc)) { - $defaultSortFunc = function($a, $b) { - if (($aV = $a->getVisibility()) !== $bV = $b->getVisibility()) { - $aV = 'public' === $aV ? 3 : ('protected' === $aV ? 2 : 1); - $bV = 'public' === $bV ? 3 : ('protected' === $bV ? 2 : 1); - - return $aV > $bV ? -1 : 1; - } - - $rs = strcasecmp($a->getName(), $b->getName()); - if (0 === $rs) { - return 0; - } - - return $rs > 0 ? -1 : 1; - }; - } - - return $defaultSortFunc; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Generator/DefaultVisitor.php b/vendor/jms/cg/src/CG/Generator/DefaultVisitor.php deleted file mode 100644 index 5dd4094..0000000 --- a/vendor/jms/cg/src/CG/Generator/DefaultVisitor.php +++ /dev/null @@ -1,237 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -/** - * The default code generation visitor. - * - * @author Johannes M. Schmitt - */ -class DefaultVisitor implements DefaultVisitorInterface -{ - private $writer; - - public function __construct() - { - $this->writer = new Writer(); - } - - public function reset() - { - $this->writer->reset(); - } - - public function startVisitingClass(PhpClass $class) - { - if ($namespace = $class->getNamespace()) { - $this->writer->write('namespace '.$namespace.';'."\n\n"); - } - - if ($files = $class->getRequiredFiles()) { - foreach ($files as $file) { - $this->writer->writeln('require_once '.var_export($file, true).';'); - } - - $this->writer->write("\n"); - } - - if ($useStatements = $class->getUseStatements()) { - foreach ($useStatements as $alias => $namespace) { - $this->writer->write('use '.$namespace); - - if (substr($namespace, strrpos($namespace, '\\') + 1) !== $alias) { - $this->writer->write(' as '.$alias); - } - - $this->writer->write(";\n"); - } - - $this->writer->write("\n"); - } - - if ($docblock = $class->getDocblock()) { - $this->writer->write($docblock); - } - - $this->writer->write('class '.$class->getShortName()); - - if ($parentClassName = $class->getParentClassName()) { - $this->writer->write(' extends '.('\\' === $parentClassName[0] ? $parentClassName : '\\'.$parentClassName)); - } - - $interfaceNames = $class->getInterfaceNames(); - if (!empty($interfaceNames)) { - $interfaceNames = array_unique($interfaceNames); - - $interfaceNames = array_map(function($name) { - if ('\\' === $name[0]) { - return $name; - } - - return '\\'.$name; - }, $interfaceNames); - - $this->writer->write(' implements '.implode(', ', $interfaceNames)); - } - - $this->writer - ->write("\n{\n") - ->indent() - ; - } - - public function startVisitingConstants() - { - } - - public function visitConstant($name, $value) - { - $this->writer->writeln('const '.$name.' = '.var_export($value, true).';'); - } - - public function endVisitingConstants() - { - $this->writer->write("\n"); - } - - public function startVisitingProperties() - { - } - - public function visitProperty(PhpProperty $property) - { - $this->writer->write($property->getVisibility().' '.($property->isStatic()? 'static ' : '').'$'.$property->getName()); - - if ($property->hasDefaultValue()) { - $this->writer->write(' = '.var_export($property->getDefaultValue(), true)); - } - - $this->writer->writeln(';'); - } - - public function endVisitingProperties() - { - $this->writer->write("\n"); - } - - public function startVisitingMethods() - { - } - - public function visitMethod(PhpMethod $method) - { - if ($docblock = $method->getDocblock()) { - $this->writer->writeln($docblock)->rtrim(); - } - - if ($method->isAbstract()) { - $this->writer->write('abstract '); - } - - $this->writer->write($method->getVisibility().' '); - - if ($method->isStatic()) { - $this->writer->write('static '); - } - - $this->writer->write('function '.$method->getName().'('); - - $this->writeParameters($method->getParameters()); - - if ($method->isAbstract()) { - $this->writer->write(");\n\n"); - - return; - } - - $this->writer - ->writeln(")") - ->writeln('{') - ->indent() - ->writeln($method->getBody()) - ->outdent() - ->rtrim() - ->write("}\n\n") - ; - } - - public function endVisitingMethods() - { - } - - public function endVisitingClass(PhpClass $class) - { - $this->writer - ->outdent() - ->rtrim() - ->write('}') - ; - } - - public function visitFunction(PhpFunction $function) - { - if ($namespace = $function->getNamespace()) { - $this->writer->write("namespace $namespace;\n\n"); - } - - $this->writer->write("function {$function->getName()}("); - $this->writeParameters($function->getParameters()); - $this->writer - ->write(")\n{\n") - ->indent() - ->writeln($function->getBody()) - ->outdent() - ->rtrim() - ->write('}') - ; - } - - public function getContent() - { - return $this->writer->getContent(); - } - - private function writeParameters(array $parameters) - { - $first = true; - foreach ($parameters as $parameter) { - if (!$first) { - $this->writer->write(', '); - } - $first = false; - - if ($type = $parameter->getType()) { - $this->writer->write( - ('array' === $type ? 'array' : ('\\' === $type[0] ? $type : '\\'. $type)) - .' ' - ); - } - - if ($parameter->isPassedByReference()) { - $this->writer->write('&'); - } - - $this->writer->write('$'.$parameter->getName()); - - if ($parameter->hasDefaultValue()) { - $this->writer->write(' = '.var_export($parameter->getDefaultValue(), true)); - } - } - } -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Generator/DefaultVisitorInterface.php b/vendor/jms/cg/src/CG/Generator/DefaultVisitorInterface.php deleted file mode 100644 index d9532bb..0000000 --- a/vendor/jms/cg/src/CG/Generator/DefaultVisitorInterface.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -/** - * The visitor interface required by the DefaultNavigator. - * - * @author Johannes M. Schmitt - */ -interface DefaultVisitorInterface -{ - /** - * Resets the visitors internal state to allow re-using the same instance. - * - * @return void - */ - function reset(); - - function startVisitingClass(PhpClass $class); - function startVisitingConstants(); - function visitConstant($name, $value); - function endVisitingConstants(); - function startVisitingProperties(); - function visitProperty(PhpProperty $property); - function endVisitingProperties(); - function startVisitingMethods(); - function visitMethod(PhpMethod $method); - function endVisitingMethods(); - function endVisitingClass(PhpClass $class); - function visitFunction(PhpFunction $function); -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Generator/GeneratorUtils.php b/vendor/jms/cg/src/CG/Generator/GeneratorUtils.php deleted file mode 100644 index 8f7a44c..0000000 --- a/vendor/jms/cg/src/CG/Generator/GeneratorUtils.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -/** - * Some Generator utils. - * - * @author Johannes M. Schmitt - */ -abstract class GeneratorUtils -{ - private final function __construct() {} - - public static function callMethod(\ReflectionMethod $method, array $params = null) - { - if (null === $params) { - $params = array_map(function($p) { return '$'.$p->name; }, $method->getParameters()); - } - - return '\\'.$method->getDeclaringClass()->name.'::'.$method->name.'('.implode(', ', $params).')'; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Generator/PhpClass.php b/vendor/jms/cg/src/CG/Generator/PhpClass.php deleted file mode 100644 index e8496f0..0000000 --- a/vendor/jms/cg/src/CG/Generator/PhpClass.php +++ /dev/null @@ -1,360 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -use Doctrine\Common\Annotations\PhpParser; - -use CG\Core\ReflectionUtils; - -/** - * Represents a PHP class. - * - * @author Johannes M. Schmitt - */ -class PhpClass -{ - private static $phpParser; - - private $name; - private $parentClassName; - private $interfaceNames = array(); - private $useStatements = array(); - private $constants = array(); - private $properties = array(); - private $requiredFiles = array(); - private $methods = array(); - private $abstract = false; - private $final = false; - private $docblock; - - public static function create($name = null) - { - return new self($name); - } - - public static function fromReflection(\ReflectionClass $ref) - { - $class = new static(); - $class - ->setName($ref->name) - ->setAbstract($ref->isAbstract()) - ->setFinal($ref->isFinal()) - ->setConstants($ref->getConstants()) - ; - - if (null === self::$phpParser) { - if (!class_exists('Doctrine\Common\Annotations\PhpParser')) { - self::$phpParser = false; - } else { - self::$phpParser = new PhpParser(); - } - } - - if (false !== self::$phpParser) { - $class->setUseStatements(self::$phpParser->parseClass($ref)); - } - - if ($docComment = $ref->getDocComment()) { - $class->setDocblock(ReflectionUtils::getUnindentedDocComment($docComment)); - } - - foreach ($ref->getMethods() as $method) { - $class->setMethod(static::createMethod($method)); - } - - foreach ($ref->getProperties() as $property) { - $class->setProperty(static::createProperty($property)); - } - - return $class; - } - - protected static function createMethod(\ReflectionMethod $method) - { - return PhpMethod::fromReflection($method); - } - - protected static function createProperty(\ReflectionProperty $property) - { - return PhpProperty::fromReflection($property); - } - - public function __construct($name = null) - { - $this->name = $name; - } - - public function setName($name) - { - $this->name = $name; - - return $this; - } - - public function setParentClassName($name) - { - $this->parentClassName = $name; - - return $this; - } - - public function setInterfaceNames(array $names) - { - $this->interfaceNames = $names; - - return $this; - } - - public function addInterfaceName($name) - { - $this->interfaceNames[] = $name; - - return $this; - } - - public function setRequiredFiles(array $files) - { - $this->requiredFiles = $files; - - return $this; - } - - public function addRequiredFile($file) - { - $this->requiredFiles[] = $file; - - return $this; - } - - public function setUseStatements(array $useStatements) - { - $this->useStatements = $useStatements; - - return $this; - } - - public function addUseStatement($namespace, $alias = null) - { - if (null === $alias) { - $alias = substr($namespace, strrpos($namespace, '\\') + 1); - } - - $this->useStatements[$alias] = $namespace; - - return $this; - } - - public function setConstants(array $constants) - { - $this->constants = $constants; - - return $this; - } - - public function setConstant($name, $value) - { - $this->constants[$name] = $value; - - return $this; - } - - public function hasConstant($name) - { - return array_key_exists($this->constants, $name); - } - - public function removeConstant($name) - { - if (!array_key_exists($name, $this->constants)) { - throw new \InvalidArgumentException(sprintf('The constant "%s" does not exist.', $name)); - } - - unset($this->constants[$name]); - - return $this; - } - - public function setProperties(array $properties) - { - $this->properties = $properties; - - return $this; - } - - public function setProperty(PhpProperty $property) - { - $this->properties[$property->getName()] = $property; - - return $this; - } - - public function hasProperty($property) - { - if ($property instanceof PhpProperty) { - $property = $property->getName(); - } - - return isset($this->properties[$property]); - } - - public function removeProperty($property) - { - if ($property instanceof PhpProperty) { - $property = $property->getName(); - } - - if (!array_key_exists($property, $this->properties)) { - throw new \InvalidArgumentException(sprintf('The property "%s" does not exist.', $property)); - } - unset($this->properties[$property]); - - return $this; - } - - public function setMethods(array $methods) - { - $this->methods = $methods; - - return $this; - } - - public function setMethod(PhpMethod $method) - { - $this->methods[$method->getName()] = $method; - - return $this; - } - - public function hasMethod($method) - { - if ($method instanceof PhpMethod) { - $method = $method->getName(); - } - - return isset($this->methods[$method]); - } - - public function removeMethod($method) - { - if ($method instanceof PhpMethod) { - $method = $method->getName(); - } - - if (!array_key_exists($method, $this->methods)) { - throw new \InvalidArgumentException(sprintf('The method "%s" does not exist.', $method)); - } - unset($this->methods[$method]); - - return $this; - } - - public function setAbstract($bool) - { - $this->abstract = (Boolean) $bool; - - return $this; - } - - public function setFinal($bool) - { - $this->final = (Boolean) $bool; - - return $this; - } - - public function setDocblock($block) - { - $this->docblock = $block; - - return $this; - } - - public function getName() - { - return $this->name; - } - - public function getParentClassName() - { - return $this->parentClassName; - } - - public function getInterfaceNames() - { - return $this->interfaceNames; - } - - public function getRequiredFiles() - { - return $this->requiredFiles; - } - - public function getUseStatements() - { - return $this->useStatements; - } - - public function getNamespace() - { - if (false === $pos = strrpos($this->name, '\\')) { - return null; - } - - return substr($this->name, 0, $pos); - } - - public function getShortName() - { - if (false === $pos = strrpos($this->name, '\\')) { - return $this->name; - } - - return substr($this->name, $pos+1); - } - - public function getConstants() - { - return $this->constants; - } - - public function getProperties() - { - return $this->properties; - } - - public function getMethods() - { - return $this->methods; - } - - public function isAbstract() - { - return $this->abstract; - } - - public function isFinal() - { - return $this->final; - } - - public function getDocblock() - { - return $this->docblock; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Generator/PhpFunction.php b/vendor/jms/cg/src/CG/Generator/PhpFunction.php deleted file mode 100644 index 2c14511..0000000 --- a/vendor/jms/cg/src/CG/Generator/PhpFunction.php +++ /dev/null @@ -1,146 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -/** - * Represents a PHP function. - * - * @author Johannes M. Schmitt - */ -class PhpFunction -{ - private $name; - private $namespace; - private $parameters = array(); - private $body = ''; - private $referenceReturned = false; - private $docblock; - - public static function create($name = null) - { - return new static($name); - } - - public function __construct($name = null) - { - $this->name = $name; - } - - public function setName($name) - { - $this->name = $name; - - return $this; - } - - public function setNamespace($namespace) - { - $this->namespace = $namespace; - - return $this; - } - - public function setParameters(array $parameters) - { - $this->parameters = $parameters; - - return $this; - } - - public function setReferenceReturned($bool) - { - $this->referenceReturned = (Boolean) $bool; - - return $this; - } - - public function replaceParameter($position, PhpParameter $parameter) - { - if ($position < 0 || $position > count($this->parameters)) { - throw new \InvalidArgumentException(sprintf('$position must be in the range [0, %d].', count($this->parameters))); - } - - $this->parameters[$position] = $parameter; - - return $this; - } - - public function addParameter(PhpParameter $parameter) - { - $this->parameters[] = $parameter; - - return $this; - } - - public function removeParameter($position) - { - if (!isset($this->parameters[$position])) { - throw new \InvalidArgumentException(sprintf('There is not parameter at position %d.', $position)); - } - - unset($this->parameters[$position]); - $this->parameters = array_values($this->parameters); - - return $this; - } - - public function setBody($body) - { - $this->body = $body; - - return $this; - } - - public function setDocblock($docBlock) - { - $this->docblock = $docBlock; - - return $this; - } - - public function getName() - { - return $this->name; - } - - public function getNamespace() - { - return $this->namespace; - } - - public function getParameters() - { - return $this->parameters; - } - - public function getBody() - { - return $this->body; - } - - public function getDocblock() - { - return $this->docblock; - } - - public function isReferenceReturned() - { - return $this->referenceReturned; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Generator/PhpMethod.php b/vendor/jms/cg/src/CG/Generator/PhpMethod.php deleted file mode 100644 index f8b7314..0000000 --- a/vendor/jms/cg/src/CG/Generator/PhpMethod.php +++ /dev/null @@ -1,158 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -use CG\Core\ReflectionUtils; - -/** - * Represents a PHP method. - * - * @author Johannes M. Schmitt - */ -class PhpMethod extends AbstractPhpMember -{ - private $final = false; - private $abstract = false; - private $parameters = array(); - private $referenceReturned = false; - private $body = ''; - - public static function create($name = null) - { - return new static($name); - } - - public static function fromReflection(\ReflectionMethod $ref) - { - $method = new static(); - $method - ->setFinal($ref->isFinal()) - ->setAbstract($ref->isAbstract()) - ->setStatic($ref->isStatic()) - ->setVisibility($ref->isPublic() ? self::VISIBILITY_PUBLIC : ($ref->isProtected() ? self::VISIBILITY_PROTECTED : self::VISIBILITY_PRIVATE)) - ->setReferenceReturned($ref->returnsReference()) - ->setName($ref->name) - ; - - if ($docComment = $ref->getDocComment()) { - $method->setDocblock(ReflectionUtils::getUnindentedDocComment($docComment)); - } - - foreach ($ref->getParameters() as $param) { - $method->addParameter(static::createParameter($param)); - } - - // FIXME: Extract body? - - return $method; - } - - protected static function createParameter(\ReflectionParameter $parameter) - { - return PhpParameter::fromReflection($parameter); - } - - public function setFinal($bool) - { - $this->final = (Boolean) $bool; - - return $this; - } - - public function setAbstract($bool) - { - $this->abstract = $bool; - - return $this; - } - - public function setReferenceReturned($bool) - { - $this->referenceReturned = (Boolean) $bool; - - return $this; - } - - public function setBody($body) - { - $this->body = $body; - - return $this; - } - - public function setParameters(array $parameters) - { - $this->parameters = array_values($parameters); - - return $this; - } - - public function addParameter(PhpParameter $parameter) - { - $this->parameters[] = $parameter; - - return $this; - } - - public function replaceParameter($position, PhpParameter $parameter) - { - if ($position < 0 || $position > strlen($this->parameters)) { - throw new \InvalidArgumentException(sprintf('The position must be in the range [0, %d].', strlen($this->parameters))); - } - $this->parameters[$position] = $parameter; - - return $this; - } - - public function removeParameter($position) - { - if (!isset($this->parameters[$position])) { - throw new \InvalidArgumentException(sprintf('There is no parameter at position "%d" does not exist.', $position)); - } - unset($this->parameters[$position]); - $this->parameters = array_values($this->parameters); - - return $this; - } - - public function isFinal() - { - return $this->final; - } - - public function isAbstract() - { - return $this->abstract; - } - - public function isReferenceReturned() - { - return $this->referenceReturned; - } - - public function getBody() - { - return $this->body; - } - - public function getParameters() - { - return $this->parameters; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Generator/PhpParameter.php b/vendor/jms/cg/src/CG/Generator/PhpParameter.php deleted file mode 100644 index 0f8b2cb..0000000 --- a/vendor/jms/cg/src/CG/Generator/PhpParameter.php +++ /dev/null @@ -1,126 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -/** - * Represents a PHP parameter. - * - * @author Johannes M. Schmitt - */ -class PhpParameter -{ - private $name; - private $defaultValue; - private $hasDefaultValue = false; - private $passedByReference = false; - private $type; - - public static function create($name = null) - { - return new static($name); - } - - public static function fromReflection(\ReflectionParameter $ref) - { - $parameter = new static(); - $parameter - ->setName($ref->name) - ->setPassedByReference($ref->isPassedByReference()) - ; - - if ($ref->isDefaultValueAvailable()) { - $parameter->setDefaultValue($ref->getDefaultValue()); - } - - if ($ref->isArray()) { - $parameter->setType('array'); - } else if ($class = $ref->getClass()) { - $parameter->setType($class->name); - } - - return $parameter; - } - - public function __construct($name = null) - { - $this->name = $name; - } - - public function setName($name) - { - $this->name = $name; - - return $this; - } - - public function setDefaultValue($value) - { - $this->defaultValue = $value; - $this->hasDefaultValue = true; - - return $this; - } - - public function unsetDefaultValue() - { - $this->defaultValue = null; - $this->hasDefaultValue = false; - - return $this; - } - - public function setPassedByReference($bool) - { - $this->passedByReference = (Boolean) $bool; - - return $this; - } - - public function setType($type) - { - $this->type = $type; - - return $this; - } - - public function getName() - { - return $this->name; - } - - public function getDefaultValue() - { - return $this->defaultValue; - } - - public function hasDefaultValue() - { - return $this->hasDefaultValue; - } - - public function isPassedByReference() - { - return $this->passedByReference; - } - - public function getType() - { - return $this->type; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Generator/PhpProperty.php b/vendor/jms/cg/src/CG/Generator/PhpProperty.php deleted file mode 100644 index a5b33d8..0000000 --- a/vendor/jms/cg/src/CG/Generator/PhpProperty.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -use CG\Core\ReflectionUtils; - -/** - * Represents a PHP property. - * - * @author Johannes M. Schmitt - */ -class PhpProperty extends AbstractPhpMember -{ - private $hasDefaultValue = false; - private $defaultValue; - - public static function create($name = null) - { - return new static($name); - } - - public static function fromReflection(\ReflectionProperty $ref) - { - $property = new static(); - $property - ->setName($ref->name) - ->setStatic($ref->isStatic()) - ->setVisibility($ref->isPublic() ? self::VISIBILITY_PUBLIC : ($ref->isProtected() ? self::VISIBILITY_PROTECTED : self::VISIBILITY_PRIVATE)) - ; - - if ($docComment = $ref->getDocComment()) { - $property->setDocblock(ReflectionUtils::getUnindentedDocComment($docComment)); - } - - $defaultProperties = $ref->getDeclaringClass()->getDefaultProperties(); - if (isset($defaultProperties[$ref->name])) { - $property->setDefaultValue($defaultProperties[$ref->name]); - } - - return $property; - } - - public function setDefaultValue($value) - { - $this->defaultValue = $value; - $this->hasDefaultValue = true; - - return $this; - } - - public function unsetDefaultValue() - { - $this->hasDefaultValue = false; - $this->defaultValue = null; - - return $this; - } - - public function hasDefaultValue() - { - return $this->hasDefaultValue; - } - - public function getDefaultValue() - { - return $this->defaultValue; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Generator/Writer.php b/vendor/jms/cg/src/CG/Generator/Writer.php deleted file mode 100644 index 29ca853..0000000 --- a/vendor/jms/cg/src/CG/Generator/Writer.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Generator; - -/** - * A writer implementation. - * - * This may be used to simplify writing well-formatted code. - * - * @author Johannes M. Schmitt - */ -class Writer -{ - private $content = ''; - private $indentationSpaces = 4; - private $indentationLevel = 0; - - public function indent() - { - $this->indentationLevel += 1; - - return $this; - } - - public function outdent() - { - $this->indentationLevel -= 1; - - if ($this->indentationLevel < 0) { - throw new \RuntimeException('The identation level cannot be less than zero.'); - } - - return $this; - } - - public function writeln($content) - { - $this->write($content."\n"); - - return $this; - } - - public function write($content) - { - $lines = explode("\n", $content); - for ($i=0,$c=count($lines); $i<$c; $i++) { - if ($this->indentationLevel > 0 - && !empty($lines[$i]) - && (empty($this->content) || "\n" === substr($this->content, -1))) { - $this->content .= str_repeat(' ', $this->indentationLevel * $this->indentationSpaces); - } - - $this->content .= $lines[$i]; - - if ($i+1 < $c) { - $this->content .= "\n"; - } - } - - return $this; - } - - public function rtrim() - { - $addNl = "\n" === substr($this->content, -1); - $this->content = rtrim($this->content); - - if ($addNl) { - $this->content .= "\n"; - } - - return $this; - } - - public function reset() - { - $this->content = ''; - $this->indentationLevel = 0; - - return $this; - } - - public function getContent() - { - return $this->content; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Proxy/Enhancer.php b/vendor/jms/cg/src/CG/Proxy/Enhancer.php deleted file mode 100644 index 2ba73ed..0000000 --- a/vendor/jms/cg/src/CG/Proxy/Enhancer.php +++ /dev/null @@ -1,158 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Proxy; - -use CG\Core\NamingStrategyInterface; - -use CG\Generator\Writer; -use CG\Generator\PhpMethod; -use CG\Generator\PhpDocblock; -use CG\Generator\PhpClass; -use CG\Core\AbstractClassGenerator; - -/** - * Class enhancing generator implementation. - * - * This class enhances existing classes by generating a proxy and leveraging - * different generator implementation. - * - * There are several built-in generator such as lazy-initializing objects, or - * a generator for creating AOP joinpoints. - * - * @author Johannes M. Schmitt - */ -class Enhancer extends AbstractClassGenerator -{ - private $generatedClass; - private $class; - private $interfaces; - private $generators; - - public function __construct(\ReflectionClass $class, array $interfaces = array(), array $generators = array()) - { - if (empty($generators) && empty($interfaces)) { - throw new \RuntimeException('Either generators, or interfaces must be given.'); - } - - $this->class = $class; - $this->interfaces = $interfaces; - $this->generators = $generators; - } - - /** - * Creates a new instance of the enhanced class. - * - * @param array $args - * @return object - */ - public function createInstance(array $args = array()) - { - $generatedClass = $this->getClassName($this->class); - - if (!class_exists($generatedClass, false)) { - eval($this->generateClass()); - } - - $ref = new \ReflectionClass($generatedClass); - - return $ref->newInstanceArgs($args); - } - - public function writeClass($filename) - { - if (!is_dir($dir = dirname($filename))) { - if (false === @mkdir($dir, 0777, true)) { - throw new \RuntimeException(sprintf('Could not create directory "%s".', $dir)); - } - } - - if (!is_writable($dir)) { - throw new \RuntimeException(sprintf('The directory "%s" is not writable.', $dir)); - } - - file_put_contents($filename, "generateClass()); - } - - /** - * Creates a new enhanced class - * - * @return string - */ - public final function generateClass() - { - static $docBlock; - if (empty($docBlock)) { - $writer = new Writer(); - $writer - ->writeln('/**') - ->writeln(' * CG library enhanced proxy class.') - ->writeln(' *') - ->writeln(' * This code was generated automatically by the CG library, manual changes to it') - ->writeln(' * will be lost upon next generation.') - ->writeln(' */') - ; - $docBlock = $writer->getContent(); - } - - $this->generatedClass = PhpClass::create() - ->setDocblock($docBlock) - ->setParentClassName($this->class->name) - ; - - $proxyClassName = $this->getClassName($this->class); - if (false === strpos($proxyClassName, NamingStrategyInterface::SEPARATOR)) { - throw new \RuntimeException(sprintf('The proxy class name must be suffixed with "%s" and an optional string, but got "%s".', NamingStrategyInterface::SEPARATOR, $proxyClassName)); - } - $this->generatedClass->setName($proxyClassName); - - if (!empty($this->interfaces)) { - $this->generatedClass->setInterfaceNames(array_map(function($v) { return '\\'.$v; }, $this->interfaces)); - - foreach ($this->getInterfaceMethods() as $method) { - $method = PhpMethod::fromReflection($method); - $method->setAbstract(false); - - $this->generatedClass->setMethod($method); - } - } - - if (!empty($this->generators)) { - foreach ($this->generators as $generator) { - $generator->generate($this->class, $this->generatedClass); - } - } - - return $this->generateCode($this->generatedClass); - } - - /** - * Adds stub methods for the interfaces that have been implemented. - */ - protected function getInterfaceMethods() - { - $methods = array(); - - foreach ($this->interfaces as $interface) { - $ref = new \ReflectionClass($interface); - $methods = array_merge($methods, $ref->getMethods()); - } - - return $methods; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Proxy/GeneratorInterface.php b/vendor/jms/cg/src/CG/Proxy/GeneratorInterface.php deleted file mode 100644 index e641ec5..0000000 --- a/vendor/jms/cg/src/CG/Proxy/GeneratorInterface.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Proxy; - -use CG\Generator\PhpClass; - -/** - * Interface for enhancing generators. - * - * @author Johannes M. Schmitt - */ -interface GeneratorInterface -{ - /** - * Generates the necessary changes in the class. - * - * @param \ReflectionClass $originalClass - * @param PhpClass $generatedClass The generated class - * @return void - */ - function generate(\ReflectionClass $originalClass, PhpClass $generatedClass); -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Proxy/InterceptionGenerator.php b/vendor/jms/cg/src/CG/Proxy/InterceptionGenerator.php deleted file mode 100644 index 31a8ba6..0000000 --- a/vendor/jms/cg/src/CG/Proxy/InterceptionGenerator.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Proxy; - -use CG\Core\ClassUtils; - -use CG\Core\ReflectionUtils; - -use CG\Generator\PhpParameter; -use CG\Generator\PhpProperty; -use CG\Generator\PhpMethod; -use CG\Generator\PhpClass; - -/** - * Interception Generator. - * - * This generator creates joinpoints to allow for AOP advices. Right now, it only - * supports the most powerful around advice. - * - * @author Johannes M. Schmitt - */ -class InterceptionGenerator implements GeneratorInterface -{ - private $prefix = '__CGInterception__'; - private $filter; - private $requiredFile; - - public function setRequiredFile($file) - { - $this->requiredFile = $file; - } - - public function setPrefix($prefix) - { - $this->prefix = $prefix; - } - - public function setFilter(\Closure $filter) - { - $this->filter = $filter; - } - - public function generate(\ReflectionClass $originalClass, PhpClass $genClass) - { - $methods = ReflectionUtils::getOverrideableMethods($originalClass); - - if (null !== $this->filter) { - $methods = array_filter($methods, $this->filter); - } - - if (empty($methods)) { - return; - } - - if (!empty($this->requiredFile)) { - $genClass->addRequiredFile($this->requiredFile); - } - - $interceptorLoader = new PhpProperty(); - $interceptorLoader - ->setName($this->prefix.'loader') - ->setVisibility(PhpProperty::VISIBILITY_PRIVATE) - ; - $genClass->setProperty($interceptorLoader); - - $loaderSetter = new PhpMethod(); - $loaderSetter - ->setName($this->prefix.'setLoader') - ->setVisibility(PhpMethod::VISIBILITY_PUBLIC) - ->setBody('$this->'.$this->prefix.'loader = $loader;') - ; - $genClass->setMethod($loaderSetter); - $loaderParam = new PhpParameter(); - $loaderParam - ->setName('loader') - ->setType('CG\Proxy\InterceptorLoaderInterface') - ; - $loaderSetter->addParameter($loaderParam); - - $interceptorCode = - '$ref = new \ReflectionMethod(%s, %s);'."\n" - .'$interceptors = $this->'.$this->prefix.'loader->loadInterceptors($ref, $this, array(%s));'."\n" - .'$invocation = new \CG\Proxy\MethodInvocation($ref, $this, array(%s), $interceptors);'."\n\n" - .'return $invocation->proceed();' - ; - - foreach ($methods as $method) { - $params = array(); - foreach ($method->getParameters() as $param) { - $params[] = '$'.$param->name; - } - $params = implode(', ', $params); - - $genMethod = PhpMethod::fromReflection($method) - ->setBody(sprintf($interceptorCode, var_export(ClassUtils::getUserClass($method->class), true), var_export($method->name, true), $params, $params)) - ->setDocblock(null) - ; - $genClass->setMethod($genMethod); - } - } -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Proxy/InterceptorLoaderInterface.php b/vendor/jms/cg/src/CG/Proxy/InterceptorLoaderInterface.php deleted file mode 100644 index 5deff19..0000000 --- a/vendor/jms/cg/src/CG/Proxy/InterceptorLoaderInterface.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Proxy; - -/** - * Interception Loader. - * - * Implementations of this interface are responsible for loading the interceptors - * for a certain method. - * - * @author Johannes M. Schmitt - */ -interface InterceptorLoaderInterface -{ - /** - * Loads interceptors. - * - * @param \ReflectionMethod $method - * @return array - */ - function loadInterceptors(\ReflectionMethod $method); -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Proxy/LazyInitializerGenerator.php b/vendor/jms/cg/src/CG/Proxy/LazyInitializerGenerator.php deleted file mode 100644 index 8591599..0000000 --- a/vendor/jms/cg/src/CG/Proxy/LazyInitializerGenerator.php +++ /dev/null @@ -1,153 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Proxy; - -use CG\Generator\Writer; -use CG\Core\ReflectionUtils; -use CG\Generator\GeneratorUtils; -use CG\Generator\PhpParameter; -use CG\Generator\PhpMethod; -use CG\Generator\PhpProperty; -use CG\Generator\PhpClass; - -/** - * Generator for creating lazy-initializing instances. - * - * This generator enhances concrete classes to allow for them to be lazily - * initialized upon first access. - * - * @author Johannes M. Schmitt - */ -class LazyInitializerGenerator implements GeneratorInterface -{ - private $writer; - private $prefix = '__CG__'; - private $markerInterface; - - public function __construct() - { - $this->writer = new Writer(); - } - - public function setPrefix($prefix) - { - $this->prefix = $prefix; - } - - /** - * Sets the marker interface which should be implemented by the - * generated classes. - * - * @param string $interface The FQCN of the interface - */ - public function setMarkerInterface($interface) - { - $this->markerInterface = $interface; - } - - /** - * Generates the necessary methods in the class. - * - * @param \ReflectionClass $originalClass - * @param PhpClass $class - * @return void - */ - public function generate(\ReflectionClass $originalClass, PhpClass $class) - { - $methods = ReflectionUtils::getOverrideableMethods($originalClass, true); - - // no public, non final methods - if (empty($methods)) { - return; - } - - if (null !== $this->markerInterface) { - $class->setImplementedInterfaces(array_merge( - $class->getImplementedInterfaces(), - array($this->markerInterface) - )); - } - - $initializer = new PhpProperty(); - $initializer->setName($this->prefix.'lazyInitializer'); - $initializer->setVisibility(PhpProperty::VISIBILITY_PRIVATE); - $class->setProperty($initializer); - - $initialized = new PhpProperty(); - $initialized->setName($this->prefix.'initialized'); - $initialized->setDefaultValue(false); - $initialized->setVisibility(PhpProperty::VISIBILITY_PRIVATE); - $class->setProperty($initialized); - - $initializerSetter = new PhpMethod(); - $initializerSetter->setName($this->prefix.'setLazyInitializer'); - $initializerSetter->setBody('$this->'.$this->prefix.'lazyInitializer = $initializer;'); - - $parameter = new PhpParameter(); - $parameter->setName('initializer'); - $parameter->setType('\CG\Proxy\LazyInitializerInterface'); - $initializerSetter->addParameter($parameter); - $class->setMethod($initializerSetter); - - $this->addMethods($class, $methods); - - $initializingMethod = new PhpMethod(); - $initializingMethod->setName($this->prefix.'initialize'); - $initializingMethod->setVisibility(PhpMethod::VISIBILITY_PRIVATE); - $initializingMethod->setBody( - $this->writer - ->reset() - ->writeln('if (null === $this->'.$this->prefix.'lazyInitializer) {') - ->indent() - ->writeln('throw new \RuntimeException("'.$this->prefix.'setLazyInitializer() must be called prior to any other public method on this object.");') - ->outdent() - ->write("}\n\n") - ->writeln('$this->'.$this->prefix.'lazyInitializer->initializeObject($this);') - ->writeln('$this->'.$this->prefix.'initialized = true;') - ->getContent() - ); - $class->setMethod($initializingMethod); - } - - private function addMethods(PhpClass $class, array $methods) - { - foreach ($methods as $method) { - $initializingCode = 'if (false === $this->'.$this->prefix.'initialized) {'."\n" - .' $this->'.$this->prefix.'initialize();'."\n" - .'}'; - - if ($class->hasMethod($method->name)) { - $genMethod = $class->getMethod($method->name); - $genMethod->setBody( - $initializingCode."\n" - .$genMethod->getBody() - ); - - continue; - } - - $genMethod = PhpMethod::fromReflection($method); - $genMethod->setBody( - $initializingCode."\n\n" - .'return '.GeneratorUtils::callMethod($method).';' - ); - $class->setMethod($genMethod); - } - } -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Proxy/LazyInitializerInterface.php b/vendor/jms/cg/src/CG/Proxy/LazyInitializerInterface.php deleted file mode 100644 index 7cfca5b..0000000 --- a/vendor/jms/cg/src/CG/Proxy/LazyInitializerInterface.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Proxy; - -/** - * Lazy Initializer. - * - * Implementations of this interface are responsible for lazily initializing - * object instances. - * - * @author Johannes M. Schmitt - */ -interface LazyInitializerInterface -{ - /** - * Initializes the passed object. - * - * @param object $object - * @return void - */ - function initializeObject($object); -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Proxy/MethodInterceptorInterface.php b/vendor/jms/cg/src/CG/Proxy/MethodInterceptorInterface.php deleted file mode 100644 index f1a7997..0000000 --- a/vendor/jms/cg/src/CG/Proxy/MethodInterceptorInterface.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Proxy; - -/** - * Interface for Method Interceptors. - * - * Implementations of this interface can execute custom code before, and after the - * invocation of the actual method. In addition, they can also catch, or throw - * exceptions, modify the return value, or modify the arguments. - * - * This is also known as around advice in AOP terminology. - * - * @author Johannes M. Schmitt - */ -interface MethodInterceptorInterface -{ - /** - * Called when intercepting a method call. - * - * @param MethodInvocation $invocation - * @return mixed the return value for the method invocation - * @throws \Exception may throw any exception - */ - function intercept(MethodInvocation $invocation); -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Proxy/MethodInvocation.php b/vendor/jms/cg/src/CG/Proxy/MethodInvocation.php deleted file mode 100644 index 11393f4..0000000 --- a/vendor/jms/cg/src/CG/Proxy/MethodInvocation.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Proxy; - -/** - * Represents a method invocation. - * - * This object contains information for the method invocation, such as the object - * on which the method is invoked, and the arguments that are passed to the method. - * - * Before the actual method is called, first all the interceptors must call the - * proceed() method on this class. - * - * @author Johannes M. Schmitt - */ -class MethodInvocation -{ - public $reflection; - public $object; - public $arguments; - - private $interceptors; - private $pointer; - - public function __construct(\ReflectionMethod $reflection, $object, array $arguments, array $interceptors) - { - $this->reflection = $reflection; - $this->object = $object; - $this->arguments = $arguments; - $this->interceptors = $interceptors; - $this->pointer = 0; - } - - /** - * Proceeds down the call-chain and eventually calls the original method. - * - * @return mixed - */ - public function proceed() - { - if (isset($this->interceptors[$this->pointer])) { - return $this->interceptors[$this->pointer++]->intercept($this); - } - - $this->reflection->setAccessible(true); - - return $this->reflection->invokeArgs($this->object, $this->arguments); - } - - /** - * Returns a string representation of the method. - * - * This is intended for debugging purposes only. - * - * @return string - */ - public function __toString() - { - return sprintf('%s::%s', $this->reflection->class, $this->reflection->name); - } -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Proxy/RegexInterceptionLoader.php b/vendor/jms/cg/src/CG/Proxy/RegexInterceptionLoader.php deleted file mode 100644 index 74a7c37..0000000 --- a/vendor/jms/cg/src/CG/Proxy/RegexInterceptionLoader.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace CG\Proxy; - -class RegexInterceptionLoader implements InterceptorLoaderInterface -{ - private $interceptors; - - public function __construct(array $interceptors = array()) - { - $this->interceptors = $interceptors; - } - - public function loadInterceptors(\ReflectionMethod $method) - { - $signature = $method->class.'::'.$method->name; - - $matchingInterceptors = array(); - foreach ($this->interceptors as $pattern => $interceptor) { - if (preg_match('#'.$pattern.'#', $signature)) { - $matchingInterceptors[] = $this->initializeInterceptor($interceptor); - } - } - - return $matchingInterceptors; - } - - protected function initializeInterceptor($interceptor) - { - return $interceptor; - } -} \ No newline at end of file diff --git a/vendor/jms/cg/src/CG/Version.php b/vendor/jms/cg/src/CG/Version.php deleted file mode 100644 index 0ca6842..0000000 --- a/vendor/jms/cg/src/CG/Version.php +++ /dev/null @@ -1,8 +0,0 @@ - - */ -final class AfterSetup -{ -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/DoctrineListener.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/DoctrineListener.php deleted file mode 100644 index 3a834f0..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/DoctrineListener.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Annotation; - -use JMS\DiExtraBundle\Exception\InvalidTypeException; - -/** - * @Annotation - * @Target("CLASS") - */ -class DoctrineListener -{ - /** @var array @Required */ - public $events; - - /** @var string */ - public $connection; - - /** @var boolean */ - public $lazy = true; - - /** @var integer */ - public $priority = 0; - - public function __construct() - { - if (0 === func_num_args()) { - return; - } - $values = func_get_arg(0); - - if (!isset($values['value'])) { - throw new InvalidTypeException('DoctrineListener', 'value', 'array or string', null); - } - $this->events = (array) $values['value']; - - if (isset($values['connection'])) { - if (!is_string($values['connection'])) { - throw new InvalidTypeException('DoctrineListener', 'connection', 'string', $values['connection']); - } - $this->connection = $values['connection']; - } - - if (isset($values['lazy'])) { - if (!is_boolean($values['lazy'])) { - throw new InvalidTypeException('DoctrineListener', 'lazy', 'boolean', $values['lazy']); - } - $this->lazy = $values['lazy']; - } - - if (isset($values['priority'])) { - if (!is_integer($values['priority'])) { - throw new InvalidTypeException('DoctrineListener', 'priority', 'integer', $values['priority']); - } - $this->priority = $values['priority']; - } - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/FormType.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/FormType.php deleted file mode 100644 index 073b971..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/FormType.php +++ /dev/null @@ -1,37 +0,0 @@ - - */ -final class FormType -{ - /** @var string */ - public $alias; - - public function __construct() - { - if (0 === func_num_args()) { - return; - } - $values = func_get_arg(0); - - if (isset($values['value'])) { - $values['alias'] = $values['value']; - } - - if (isset($values['alias'])) { - if (!is_string($values['alias'])) { - throw new InvalidTypeException('FormType', 'alias', 'string', $values['alias']); - } - - $this->alias = $values['alias']; - } - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Inject.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Inject.php deleted file mode 100644 index f723003..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Inject.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Annotation; - -/** - * @Annotation - * @Target({"PROPERTY", "ANNOTATION"}) - */ -final class Inject extends Reference -{ -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/InjectParams.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/InjectParams.php deleted file mode 100644 index 44a4d82..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/InjectParams.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Annotation; - -use JMS\DiExtraBundle\Exception\InvalidTypeException; - -/** - * @Annotation - * @Target("METHOD") - */ -final class InjectParams -{ - /** @var array */ - public $params = array(); - - public function __construct() - { - if (0 === func_num_args()) { - return; - } - $values = func_get_arg(0); - - if (isset($values['params'])) { - $values['value'] = $values['params']; - } - - if (isset($values['value'])) { - if (!is_array($values['value'])) { - throw new InvalidTypeException('InjectParams', 'value', 'array', $values['value']); - } - - foreach ($values['value'] as $k => $v) { - if (!$v instanceof Inject) { - throw new InvalidTypeException('InjectParams', sprintf('value[%s]', $k), '@Inject', $v); - } - - $this->params[$k] = $v; - } - } - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/LookupMethod.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/LookupMethod.php deleted file mode 100644 index 30fef73..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/LookupMethod.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Annotation; - -/** - * @Annotation - * @Target("METHOD") - */ -final class LookupMethod extends Reference -{ -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Observe.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Observe.php deleted file mode 100644 index 000f827..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Observe.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Annotation; - -use JMS\DiExtraBundle\Exception\InvalidTypeException; - -/** - * @Annotation - * @Target("METHOD") - */ -final class Observe -{ - /** @var string @Required */ - public $event; - - /** @var integer */ - public $priority = 0; - - public function __construct() - { - if (0 === func_num_args()) { - return; - } - $values = func_get_arg(0); - - if (isset($values['event'])) { - $values['value'] = $values['event']; - } - - if (isset($values['value'])) { - if (!is_string($values['value'])) { - throw new InvalidTypeException('Observe', 'value', 'string', $values['value']); - } - - $this->event = $values['value']; - } - - if (isset($values['priority'])) { - if (!is_numeric($values['priority'])) { - throw new InvalidTypeException('Observe', 'priority', 'integer', $values['priority']); - } - - $this->priority = $values['priority']; - } - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Reference.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Reference.php deleted file mode 100644 index 853f514..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Reference.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Annotation; - -use JMS\DiExtraBundle\Exception\InvalidTypeException; - -abstract class Reference -{ - /** @var string */ - public $value; - - /** @var boolean */ - public $required; - - public final function __construct() - { - if (0 === func_num_args()) { - return; - } - $values = func_get_arg(0); - - if (isset($values['value'])) { - if (!is_string($values['value'])) { - throw new InvalidTypeException('Inject', 'value', 'string', $values['value']); - } - - $this->value = $values['value']; - } - - if (isset($values['required'])) { - if (!is_bool($values['required'])) { - throw new InvalidTypeException('Inject', 'required', 'boolean', $values['required']); - } - - $this->required = $values['required']; - } - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Service.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Service.php deleted file mode 100644 index caa0557..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Service.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Annotation; - -use JMS\DiExtraBundle\Exception\InvalidTypeException; - -/** - * @Annotation - * @Target("CLASS") - */ -final class Service -{ - /** @var string */ - public $id; - - /** @var string */ - public $parent; - - /** @var boolean */ - public $public; - - /** @var string */ - public $scope; - - /** @var boolean */ - public $abstract; - - public function __construct() - { - if (0 === func_num_args()) { - return; - } - $values = func_get_arg(0); - - if (isset($values['value'])) { - if (!is_string($values['value'])) { - throw new InvalidTypeException('Service', 'value', 'string', $values['value']); - } - - $this->id = $values['value']; - } - if (isset($values['parent'])) { - if (!is_string($values['parent'])) { - throw new InvalidTypeException('Service', 'parent', 'string', $values['parent']); - } - - $this->parent = $values['parent']; - } - if (isset($values['public'])) { - if (!is_bool($values['public'])) { - throw new InvalidTypeException('Service', 'public', 'boolean', $values['public']); - } - - $this->public = $values['public']; - } - if (isset($values['scope'])) { - if (!is_string($values['scope'])) { - throw new InvalidTypeException('Service', 'scope', 'string', $values['scope']); - } - - $this->scope = $values['scope']; - } - if (isset($values['abstract'])) { - if (!is_bool($values['abstract'])) { - throw new InvalidTypeException('Service', 'abstract', 'boolean', $values['abstract']); - } - - $this->abstract = $values['abstract']; - } - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Tag.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Tag.php deleted file mode 100644 index 55942be..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Tag.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Annotation; - -use JMS\DiExtraBundle\Exception\InvalidArgumentException; -use JMS\DiExtraBundle\Exception\InvalidTypeException; - -/** - * @Annotation - * @Target("CLASS") - */ -final class Tag -{ - /** @var string @Required */ - public $name; - - /** @var array */ - public $attributes = array(); - - public function __construct() - { - if (0 === func_num_args()) { - return; - } - $values = func_get_arg(0); - - if (!isset($values['value'])) { - throw new InvalidArgumentException('A value must be given for annotation "@Tag".'); - } - if (!is_string($values['value'])) { - throw new InvalidTypeException('Tag', 'value', 'string', $values['value']); - } - - $this->name = $values['value']; - - if (isset($values['attributes'])) { - if (!is_array($values['attributes'])) { - throw new InvalidTypeException('Tag', 'attributes', 'array', $values['attributes']); - } - - $this->attributes = $values['attributes']; - } - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Validator.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Validator.php deleted file mode 100644 index cc8e38a..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Annotation/Validator.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Annotation; - -use JMS\DiExtraBundle\Exception\InvalidTypeException; - -/** - * @Annotation - * @Target("CLASS") - */ -final class Validator -{ - /** @var string @Required */ - public $alias; - - public function __construct() - { - if (0 === func_num_args()) { - return; - } - $values = func_get_arg(0); - - if (isset($values['alias'])) { - $values['value'] = $values['alias']; - } - - if (!isset($values['value'])) { - throw new \InvalidArgumentException('A value must be given for @Validator annotations.'); - } - if (!is_string($values['value'])) { - throw new InvalidTypeException('Validator', 'value', 'string', $values['value']); - } - $this->alias = $values['value']; - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Config/FastDirectoriesResource.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Config/FastDirectoriesResource.php deleted file mode 100644 index 719ac41..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Config/FastDirectoriesResource.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Config; - -use JMS\DiExtraBundle\Finder\PatternFinder; - -use Symfony\Component\Config\Resource\ResourceInterface; - -class FastDirectoriesResource implements ResourceInterface -{ - private $finder; - - private $directories; - private $filePattern; - private $files = array(); - - public function __construct(array $directories, $filePattern = null) - { - $this->finder = new PatternFinder('.*', '*.php'); - $this->finder->setRegexPattern(true); - - $this->directories = $directories; - $this->filePattern = $filePattern ?: '*'; - } - - public function __toString() - { - return implode(', ', $this->directories); - } - - public function getResource() - { - return $this->directories; - } - - public function update() - { - $this->files = $this->getFiles(); - } - - public function isFresh($timestamp) - { - $files = $this->getFiles(); - - if (array_diff($this->files, $files) || array_diff($files, $this->files)) { - return false; - } - - foreach ($files as $file) { - if (filemtime($file) > $timestamp) { - return false; - } - } - - return true; - } - - private function getFiles() - { - return $this->finder->findFiles($this->directories); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Config/ServiceFilesResource.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Config/ServiceFilesResource.php deleted file mode 100644 index 40508b2..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Config/ServiceFilesResource.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Config; - -use JMS\DiExtraBundle\Finder\PatternFinder; -use Symfony\Component\Config\Resource\ResourceInterface; - -class ServiceFilesResource implements ResourceInterface -{ - private $files; - private $dirs; - - public function __construct(array $files, array $dirs) - { - $this->files = $files; - $this->dirs = $dirs; - } - - public function isFresh($timestamp) - { - $finder = new PatternFinder('JMS\DiExtraBundle\Annotation'); - $files = $finder->findFiles($this->dirs); - - return !array_diff($files, $this->files) && !array_diff($this->files, $files); - } - - public function __toString() - { - return implode(', ', $this->files); - } - - public function getResource() - { - return array($this->files, $this->dirs); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/Compiler/AnnotationConfigurationPass.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/Compiler/AnnotationConfigurationPass.php deleted file mode 100644 index cb8d77b..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/Compiler/AnnotationConfigurationPass.php +++ /dev/null @@ -1,120 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Alias; -use JMS\DiExtraBundle\Exception\RuntimeException; -use JMS\DiExtraBundle\Config\ServiceFilesResource; -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\Definition; -use JMS\DiExtraBundle\Finder\PatternFinder; -use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -class AnnotationConfigurationPass implements CompilerPassInterface -{ - private $kernel; - private $finder; - - public function __construct(KernelInterface $kernel) - { - $this->kernel = $kernel; - $this->finder = new PatternFinder('JMS\DiExtraBundle\Annotation'); - } - - public function process(ContainerBuilder $container) - { - $reader = $container->get('annotation_reader'); - $factory = $container->get('jms_di_extra.metadata.metadata_factory'); - $converter = $container->get('jms_di_extra.metadata.converter'); - - $directories = $this->getScanDirectories($container); - if (!$directories) { - $container->getCompiler()->addLogMessage('No directories configured for AnnotationConfigurationPass.'); - return; - } - - $files = $this->finder->findFiles($directories); - $container->addResource(new ServiceFilesResource($files, $directories)); - foreach ($files as $file) { - $container->addResource(new FileResource($file)); - require_once $file; - - $className = $this->getClassName($file); - - if (null === $metadata = $factory->getMetadataForClass($className)) { - continue; - } - if (null === $metadata->getOutsideClassMetadata()->id) { - continue; - } - - foreach ($converter->convert($metadata) as $id => $definition) { - $container->setDefinition($id, $definition); - } - } - } - - private function getScanDirectories(ContainerBuilder $c) - { - $bundles = $this->kernel->getBundles(); - $scanBundles = $c->getParameter('jms_di_extra.bundles'); - $scanAllBundles = $c->getParameter('jms_di_extra.all_bundles'); - - $directories = $c->getParameter('jms_di_extra.directories'); - foreach ($bundles as $name => $bundle) { - if (!$scanAllBundles && !in_array($name, $scanBundles, true)) { - continue; - } - - if ('JMSDiExtraBundle' === $name) { - continue; - } - - $directories[] = $bundle->getPath(); - } - - return $directories; - } - - /** - * Only supports one namespaced class per file - * - * @throws \RuntimeException if the class name cannot be extracted - * @param string $filename - * @return string the fully qualified class name - */ - private function getClassName($filename) - { - $src = file_get_contents($filename); - - if (!preg_match('/\bnamespace\s+([^;]+);/s', $src, $match)) { - throw new RuntimeException(sprintf('Namespace could not be determined for file "%s".', $filename)); - } - $namespace = $match[1]; - - if (!preg_match('/\bclass\s+([^\s]+)\s+(?:extends|implements|{)/s', $src, $match)) { - throw new RuntimeException(sprintf('Could not extract class name from file "%s".', $filename)); - } - - return $namespace.'\\'.$match[1]; - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/Compiler/IntegrationPass.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/Compiler/IntegrationPass.php deleted file mode 100644 index db3e488..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/Compiler/IntegrationPass.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Alias; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Integrates the bundle with external code. - * - * @author Johannes M. Schmitt - */ -class IntegrationPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - // replace Symfony2's default controller resolver - $container->setAlias('controller_resolver', new Alias('jms_di_extra.controller_resolver', false)); - - // replace SensioFrameworkExtraBundle's default template listener - if ($container->hasDefinition('sensio_framework_extra.view.listener')) { - $def = $container->getDefinition('sensio_framework_extra.view.listener'); - - // only overwrite if it has the default class otherwise the user has to do the integration manually - if ('%sensio_framework_extra.view.listener.class%' === $def->getClass()) { - $def->setClass('%jms_di_extra.template_listener.class%'); - } - } - - if ($container->hasDefinition('sensio_framework_extra.controller.listener')) { - $def = $container->getDefinition('sensio_framework_extra.controller.listener'); - - if ('%sensio_framework_extra.controller.listener.class%' === $def->getClass()) { - $def->setClass('%jms_di_extra.controller_listener.class%'); - } - } - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/Compiler/ResourceOptimizationPass.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/Compiler/ResourceOptimizationPass.php deleted file mode 100644 index ee73a0e..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/Compiler/ResourceOptimizationPass.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\DependencyInjection\Compiler; - -use JMS\DiExtraBundle\Config\FastDirectoriesResource; - -use Symfony\Component\Config\Resource\DirectoryResource; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -class ResourceOptimizationPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - $resources = $directories = array(); - - $ref = new \ReflectionProperty('Symfony\Component\Config\Resource\DirectoryResource', 'pattern'); - $ref->setAccessible(true); - - foreach ($container->getResources() as $resource) { - if ($resource instanceof DirectoryResource) { - if (null === $pattern = $ref->getValue($resource)) { - $pattern = '*'; - } - - $directories[$pattern][] = $resource->getResource(); - - continue; - } - - $resources[] = $resource; - } - - $sortFunc = function($a, $b) { - return strlen($a) - strlen($b); - }; - - foreach ($directories as $pattern => $pDirectories) { - $newResources = array(); - - usort($pDirectories, $sortFunc); - foreach ($pDirectories as $a) { - foreach ($newResources as $b) { - if (0 === strpos($a, $b)) { - continue 2; - } - } - - $newResources[] = $a; - } - - $directories[$pattern] = $newResources; - } - - foreach ($directories as $pattern => $pDirectories) { - $newResource = new FastDirectoriesResource($pDirectories, $pattern); - $newResource->update(); - $resources[] = $newResource; - } - - $ref = new \ReflectionProperty('Symfony\Component\DependencyInjection\ContainerBuilder', 'resources'); - $ref->setAccessible(true); - $ref->setValue($container, $resources); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/Configuration.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/Configuration.php deleted file mode 100644 index 52129b8..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/Configuration.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\DependencyInjection; - -use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\Config\Definition\ConfigurationInterface; - -class Configuration implements ConfigurationInterface -{ - public function getConfigTreeBuilder() - { - $tb = new TreeBuilder(); - - $tb - ->root('jms_di_extra', 'array') - ->children() - ->arrayNode('locations') - ->addDefaultsIfNotSet() - ->children() - ->booleanNode('all_bundles')->defaultFalse()->end() - ->arrayNode('bundles') - ->beforeNormalization() - ->ifString() - ->then(function($v) { - return preg_split('/\s*,\s*/', $v); - }) - ->end() - ->prototype('scalar')->end() - ->end() - ->arrayNode('directories') - ->beforeNormalization() - ->ifString() - ->then(function($v) { - return preg_split('/\s*,\s*/', $v); - }) - ->end() - ->prototype('scalar')->end() - ->end() - ->end() - ->end() - ->scalarNode('cache_dir')->defaultValue('%kernel.cache_dir%/diextra')->end() - ->arrayNode('metadata') - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('cache')->defaultValue('file')->cannotBeEmpty()->end() - ->end() - ->end() - ->end() - ->end(); - - return $tb; - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/JMSDiExtraExtension.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/JMSDiExtraExtension.php deleted file mode 100644 index 9c0266c..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/JMSDiExtraExtension.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\DependencyInjection; - -use JMS\DiExtraBundle\Exception\RuntimeException; -use Symfony\Component\DependencyInjection\Alias; -use Symfony\Component\Config\FileLocator; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\Config\Definition\Processor; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\HttpKernel\DependencyInjection\Extension; - -class JMSDiExtraExtension extends Extension -{ - public function load(array $configs, ContainerBuilder $container) - { - $config = $this->mergeConfigs($configs); - - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('services.xml'); - - $container->setParameter('jms_di_extra.all_bundles', $config['locations']['all_bundles']); - $container->setParameter('jms_di_extra.bundles', $config['locations']['bundles']); - $container->setParameter('jms_di_extra.directories', $config['locations']['directories']); - $container->setParameter('jms_di_extra.cache_dir', $config['cache_dir']); - - $this->configureMetadata($config['metadata'], $container, $config['cache_dir'].'/metadata'); - - $this->addClassesToCompile(array( - 'JMS\\DiExtraBundle\\HttpKernel\ControllerResolver', - )); - } - - private function configureMetadata(array $config, $container, $cacheDir) - { - if ('none' === $config['cache']) { - $container->removeAlias('jms_di_extra.metadata.cache'); - return; - } - - if ('file' === $config['cache']) { - $cacheDir = $container->getParameterBag()->resolveValue($cacheDir); - if (!file_exists($cacheDir)) { - if (false === @mkdir($cacheDir, 0777, true)) { - throw new RuntimeException(sprintf('The cache dir "%s" could not be created.', $cacheDir)); - } - } - if (!is_writable($cacheDir)) { - throw new RuntimeException(sprintf('The cache dir "%s" is not writable.', $cacheDir)); - } - - $container - ->getDefinition('jms_di_extra.metadata.cache.file_cache') - ->replaceArgument(0, $cacheDir) - ; - } else { - $container->setAlias('jms_di_extra.metadata.cache', new Alias($config['cache'], false)); - } - } - - private function mergeConfigs(array $configs) - { - $processor = new Processor(); - $configuration = new Configuration(); - - return $processor->process($configuration->getConfigTreeBuilder()->buildTree(), $configs); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/LookupMethodClassInterface.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/LookupMethodClassInterface.php deleted file mode 100644 index 40a506f..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/DependencyInjection/LookupMethodClassInterface.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\DependencyInjection; - -interface LookupMethodClassInterface -{ - function __jmsDiExtra_getOriginalClassName(); -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/EventListener/ControllerListener.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/EventListener/ControllerListener.php deleted file mode 100644 index cab730f..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/EventListener/ControllerListener.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\EventListener; - -use Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener as BaseControllerListener; -use CG\Core\ClassUtils; -use Doctrine\Common\Annotations\Reader; -use Symfony\Component\HttpKernel\Event\FilterControllerEvent; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationInterface; - -/** - * The ControllerListener class parses annotation blocks located in - * controller classes. - * - * @author Fabien Potencier - */ -class ControllerListener extends BaseControllerListener -{ - /** - * Modifies the Request object to apply configuration information found in - * controllers annotations like the template to render or HTTP caching - * configuration. - * - * @param FilterControllerEvent $event A FilterControllerEvent instance - */ - public function onKernelController(FilterControllerEvent $event) - { - if (!is_array($controller = $event->getController())) { - return; - } - - $object = new \ReflectionClass(ClassUtils::getUserClass(get_class($controller[0]))); - $method = $object->getMethod($controller[1]); - - $request = $event->getRequest(); - foreach ($this->reader->getMethodAnnotations($method) as $configuration) { - if ($configuration instanceof ConfigurationInterface) { - $request->attributes->set('_'.$configuration->getAliasName(), $configuration); - } - } - } -} diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/EventListener/TemplateListener.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/EventListener/TemplateListener.php deleted file mode 100644 index feacc35..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/EventListener/TemplateListener.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\EventListener; - -use CG\Core\ClassUtils; -use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference; -use Symfony\Component\HttpFoundation\Request; -use JMS\DiExtraBundle\DependencyInjection\LookupMethodClassInterface; -use Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener as FrameworkExtraTemplateListener; - -class TemplateListener extends FrameworkExtraTemplateListener -{ - protected function guessTemplateName($controller, Request $request, $engine = 'twig') - { - $controllerClass = get_class($controller[0]); - $userClass = ClassUtils::getUserClass($controllerClass); - - if ($controllerClass === $userClass) { - return parent::guessTemplateName($controller, $request, $engine); - } - - if (!preg_match('/Controller\\\(.+)Controller$/', $userClass, $matchController)) { - throw new \InvalidArgumentException(sprintf('The "%s" class does not look like a controller class (it must be in a "Controller" sub-namespace and the class name must end with "Controller")', $userClass)); - } - - if (!preg_match('/^(.+)Action$/', $controller[1], $matchAction)) { - throw new \InvalidArgumentException(sprintf('The "%s" method does not look like an action method (it does not end with Action)', $controller[1])); - } - - $bundle = $this->getBundleForClass($userClass); - - return new TemplateReference($bundle->getName(), $matchController[1], $matchAction[1], $request->getRequestFormat(), $engine); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Exception/Exception.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Exception/Exception.php deleted file mode 100644 index 293e70b..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Exception/Exception.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Exception; - -/** - * Base exception for the DiExtraBundle. - * - * @author Johannes M. Schmitt - */ -interface Exception -{ -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Exception/InvalidArgumentException.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Exception/InvalidArgumentException.php deleted file mode 100644 index 990c60f..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Exception; - -/** - * InvalidArgumentException for the DiExtraBundle. - * - * @author Johannes M. Schmitt - */ -class InvalidArgumentException extends \InvalidArgumentException implements Exception -{ -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Exception/InvalidTypeException.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Exception/InvalidTypeException.php deleted file mode 100644 index 7437778..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Exception/InvalidTypeException.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Exception; - -class InvalidTypeException extends InvalidArgumentException -{ - public function __construct($annotName, $attrName, $expected, $actual) - { - $msg = sprintf('The attribute "%s" on annotation "@%s" is expected to be of type %s, but got %s.', $attrName, $annotName, $expected, gettype($actual)); - - parent::__construct($msg); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Exception/RuntimeException.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Exception/RuntimeException.php deleted file mode 100644 index a47a6e4..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Exception/RuntimeException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Exception; - -/** - * RuntimeException for the DiExtraBundle. - * - * @author Johannes M. Schmitt - */ -class RuntimeException extends \RuntimeException implements Exception -{ -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Finder/PatternFinder.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Finder/PatternFinder.php deleted file mode 100644 index f4bea5f..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Finder/PatternFinder.php +++ /dev/null @@ -1,201 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Finder; - -use JMS\DiExtraBundle\Exception\RuntimeException; -use Symfony\Component\Finder\Finder; -use Symfony\Component\Process\ExecutableFinder; - -class PatternFinder -{ - const METHOD_GREP = 1; - const METHOD_FINDSTR = 2; - const METHOD_FINDER = 3; - - private static $method; - private static $grepPath; - - private $pattern; - private $filePattern; - private $recursive = true; - private $regexPattern = false; - - public function __construct($pattern, $filePattern = '*.php') - { - if (null === self::$method) { - self::determineMethod(); - } - - $this->pattern = $pattern; - $this->filePattern = $filePattern; - } - - public function setRecursive($bool) - { - $this->recursive = (Boolean) $bool; - } - - public function setRegexPattern($bool) - { - $this->regexPattern = (Boolean) $bool; - } - - public function findFiles(array $dirs) - { - // check for grep availability - if (self::METHOD_GREP === self::$method) { - return $this->findUsingGrep($dirs); - } - - // use FINDSTR on Windows - if (self::METHOD_FINDSTR === self::$method) { - return $this->findUsingFindstr($dirs); - } - - // this should really be avoided at all costs since it is damn slow - return $this->findUsingFinder($dirs); - } - - private function findUsingFindstr(array $dirs) - { - $cmd = 'FINDSTR /M /S /P'; - - if (!$this->recursive) { - $cmd .= ' /L'; - } - - $cmd .= ' /D:'.escapeshellarg(implode(';', $dirs)); - $cmd .= ' '.escapeshellarg($this->pattern); - $cmd .= ' '.$this->filePattern; - - exec($cmd, $lines, $exitCode); - - if (1 === $exitCode) { - return array(); - } - - if (0 !== $exitCode) { - throw new RuntimeException(sprintf('Command "%s" exited with non-successful status code. "%d".', $cmd, $exitCode)); - } - - // Looks like FINDSTR has different versions with different output formats. - // - // Supported format #1: - // C:\matched\dir1: - // Relative\Path\To\File1.php - // Relative\Path\To\File2.php - // C:\matched\dir2: - // Relative\Path\To\File3.php - // Relative\Path\To\File4.php - // - // Supported format #2: - // C:\matched\dir1\Relative\Path\To\File1.php - // C:\matched\dir1\Relative\Path\To\File2.php - // C:\matched\dir2\Relative\Path\To\File3.php - // C:\matched\dir2\Relative\Path\To\File4.php - - $files = array(); - $currentDir = ''; - foreach ($lines as $line) { - if (':' === substr($line, -1)) { - $currentDir = trim($line, ' :/').'/'; - continue; - } - - $files[] = $currentDir.$line; - } - - return $files; - } - - private function findUsingGrep(array $dirs) - { - $cmd = self::$grepPath; - - if (!$this->regexPattern) { - $cmd .= ' --fixed-strings'; - } else { - $cmd .= ' --extended-regexp'; - } - - if ($this->recursive) { - $cmd .= ' --directories=recurse'; - } else { - $cmd .= ' --directories=skip'; - } - - $cmd .= ' --devices=skip --files-with-matches --with-filename --max-count=1 --color=never --include='.$this->filePattern; - $cmd .= ' '.escapeshellarg($this->pattern); - - foreach ($dirs as $dir) { - $cmd .= ' '.escapeshellarg($dir); - } - exec($cmd, $files, $exitCode); - - if (1 === $exitCode) { - return array(); - } - - if (0 !== $exitCode) { - throw new RuntimeException(sprintf('Command "%s" exited with non-successful status code "%d".', $cmd, $exitCode)); - } - - return $files; - } - - private function findUsingFinder(array $dirs) - { - $finder = new Finder(); - $pattern = $this->pattern; - $regex = $this->regexPattern; - $finder - ->files() - ->name($this->filePattern) - ->in($dirs) - ->ignoreVCS(true) - ->filter(function($file) use ($pattern, $regex) { - if (!$regex) { - return false !== strpos(file_get_contents($file->getPathName()), $pattern); - } - - return 0 < preg_match('#'.$pattern.'#', file_get_contents($file->getPathName())); - }) - ; - - if (!$this->recursive) { - $finder->depth('<= 0'); - } - - return array_keys(iterator_to_array($finder)); - } - - private static function determineMethod() - { - $finder = new ExecutableFinder(); - $isWindows = 0 === stripos(PHP_OS, 'win'); - - if (!$isWindows && self::$grepPath = $finder->find('grep')) { - self::$method = self::METHOD_GREP; - } else if ($isWindows) { - self::$method = self::METHOD_FINDSTR; - } else { - self::$method = self::METHOD_FINDER; - } - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Generator/DefinitionInjectorGenerator.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Generator/DefinitionInjectorGenerator.php deleted file mode 100644 index 3bfea60..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Generator/DefinitionInjectorGenerator.php +++ /dev/null @@ -1,192 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Generator; - -use CG\Generator\Writer; -use Symfony\Component\DependencyInjection\Parameter; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Definition; - -/** - * Generates lightweight code for injecting a single definition. - * - * @author Johannes M. Schmitt - */ -class DefinitionInjectorGenerator -{ - private $nameGenerator; - private $inlinedDefinitions; - - public function __construct() - { - $this->nameGenerator = new NameGenerator(); - $this->inlinedDefinitions = new \SplObjectStorage(); - } - - public function generate(Definition $def) - { - $writer = new Writer(); - - $writer - ->writeln('writeln('/**') - ->writeln(' * This code has been auto-generated by the JMSDiExtraBundle.') - ->writeln(' *') - ->writeln(' * Manual changes to it will be lost.') - ->writeln(' */') - ->writeln('return function($container) {') - ->indent() - ; - - if ($file = $def->getFile()) { - $writer->writeln('require_once '.var_export($file, true).';'); - - require_once $file; - } - - foreach ($this->getInlineDefinitions($def) as $inlineDef) { - $name = $this->nameGenerator->nextName(); - $this->inlinedDefinitions[$inlineDef] = $name; - - $writer->writeln('$'.$name.' = new \\'.$inlineDef->getClass().$this->dumpArguments($inlineDef->getArguments()).';'); - } - - $writer->writeln('$instance = new \\'.$def->getClass().$this->dumpArguments($def->getArguments()).';'); - - foreach ($def->getMethodCalls() as $call) { - list($method, $arguments) = $call; - $writer->writeln('$instance->'.$method.$this->dumpArguments($arguments).';'); - } - - $ref = new \ReflectionClass($def->getClass()); - foreach ($def->getProperties() as $property => $value) { - $refProperty = $this->getReflectionProperty($ref, $property); - - if ($refProperty->isPublic()) { - $writer->writeln('$instance->'.$property.' = '.$this->dumpValue($value).';'); - } else { - $writer - ->writeln(sprintf("\$refProperty = new \ReflectionProperty(%s, %s);", var_export($refProperty->getDeclaringClass()->getName(), true), var_export($property, true))) - ->writeln('$refProperty->setAccessible(true);') - ->writeln('$refProperty->setValue($instance, '.$this->dumpValue($value).');') - ; - } - } - - if (method_exists($def, 'getInitMethod') && $def->getInitMethod()) { - $writer->writeln('$instance->'.$def->getInitMethod().'();'); - } - - $writer - ->writeln('return $instance;') - ->outdent() - ->writeln('};') - ; - - return $writer->getContent(); - } - - private function getReflectionProperty($ref, $property) - { - $origClass = $ref->getName(); - while (!$ref->hasProperty($property) && false !== $ref = $ref->getParentClass()); - - if (!$ref->hasProperty($property)) { - throw new \RuntimeException(sprintf('Could not find property "%s" anywhere in class "%s" or one of its parents.', $property, $origName)); - } - - return $ref->getProperty($property); - } - - private function getInlineDefinitions(Definition $def) - { - $defs = new \SplObjectStorage(); - $this->getDefinitionsFromArray($def->getArguments(), $defs); - $this->getDefinitionsFromArray($def->getMethodCalls(), $defs); - $this->getDefinitionsFromArray($def->getProperties(), $defs); - - return $defs; - } - - private function getDefinitionsFromArray(array $a, \SplObjectStorage $defs) - { - foreach ($a as $k => $v) { - if ($v instanceof Definition) { - $defs->attach($v); - } else if (is_array($v)) { - $this->getDefinitionsFromArray($v, $defs); - } - } - } - - private function dumpArguments(array $arguments) - { - $code = '('; - - $first = true; - foreach ($arguments as $argument) { - if (!$first) { - $code .= ', '; - } - $first = false; - - $code .= $this->dumpValue($argument); - } - - return $code.')'; - } - - private function dumpValue($value) - { - if (is_array($value)) { - $code = 'array('; - - $first = true; - foreach ($value as $k => $v) { - if (!$first) { - $code .= ', '; - } - $first = false; - - $code .= sprintf('%s => %s', var_export($k, true), $this->dumpValue($v)); - } - - return $code.')'; - } else if ($value instanceof Reference) { - if ('service_container' === (string) $value) { - return '$container'; - } - - return sprintf('$container->get(%s, %d)', var_export((string) $value, true), $value->getInvalidBehavior()); - } else if ($value instanceof Parameter) { - return sprintf('$container->getParameter(%s)', var_export((string) $value, true)); - } else if (is_scalar($value) || null === $value) { - // we do not support embedded parameters - if (is_string($value) && '%' === $value[0] && '%' !== $value[1]) { - return sprintf('$container->getParameter(%s)', var_export(substr($value, 1, -1), true)); - } - - return var_export($value, true); - } else if ($value instanceof Definition) { - return sprintf('$%s', $this->inlinedDefinitions[$value]); - } - - throw new \RuntimeException(sprintf('Found unsupported value of type %s during definition injector generation: "%s"', gettype($value), json_encode($value))); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Generator/LookupMethodClassGenerator.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Generator/LookupMethodClassGenerator.php deleted file mode 100644 index 54b02cf..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Generator/LookupMethodClassGenerator.php +++ /dev/null @@ -1,119 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Generator; - -use Metadata\ClassHierarchyMetadata; -use CG\Generator\PhpParameter; -use CG\Generator\PhpMethod; -use CG\Generator\PhpProperty; -use CG\Generator\PhpClass; -use CG\Proxy\GeneratorInterface; -use Symfony\Component\DependencyInjection\Parameter; -use Symfony\Component\DependencyInjection\Reference; - -class LookupMethodClassGenerator implements GeneratorInterface -{ - const PREFIX = '__jmsDiExtra_'; - - private $metadata; - private $requiredFile; - - public function __construct(ClassHierarchyMetadata $metadata) - { - $this->metadata = $metadata; - } - - public function setRequiredFile($file) - { - $this->requiredFile = $file; - } - - public function generate(\ReflectionClass $class, PhpClass $genClass) - { - if (!empty($this->requiredFile)) { - $genClass->addRequiredFile($this->requiredFile); - } - - $genClass->setProperty(PhpProperty::create() - ->setName(self::PREFIX.'container') - ->setVisibility('private') - ); - - $genClass->setMethod(PhpMethod::create() - ->setName(self::PREFIX.'setContainer') - ->addParameter(PhpParameter::create() - ->setName('container') - ->setType('Symfony\Component\DependencyInjection\ContainerInterface') - ) - ->setBody('$this->'.self::PREFIX.'container = $container;') - ); - - $genClass->addInterfaceName('JMS\DiExtraBundle\DependencyInjection\LookupMethodClassInterface'); - $genClass->setMethod(PhpMethod::create() - ->setName(self::PREFIX.'getOriginalClassName') - ->setFinal(true) - ->setBody('return '.var_export($class->name, true).';') - ); - - foreach ($this->getLookupMethods() as $name => $value) { - $genClass->setMethod(PhpMethod::fromReflection($class->getMethod($name)) - ->setAbstract(false) - ->setBody('return '.$this->dumpValue($value).';') - ->setDocblock(null) - ); - } - } - - private function getLookupMethods() - { - $outerClass = $this->metadata->getOutsideClassMetadata()->reflection; - $lookupMethods = array(); - foreach ($this->metadata->classMetadata as $classMetadata) { - if (!$classMetadata->lookupMethods) { - continue; - } - - foreach ($classMetadata->lookupMethods as $name => $value) { - // check if method has been overridden - if ($outerClass->getMethod($name)->class !== $classMetadata->reflection->name) { - continue; - } - - $lookupMethods[$name] = $value; - } - } - - return $lookupMethods; - } - - private function dumpValue($value) - { - if ($value instanceof Parameter) { - return '$this->'.self::PREFIX.'container->getParameter('.var_export((string) $value, true).')'; - } else if ($value instanceof Reference) { - return '$this->'.self::PREFIX.'container->get('.var_export((string) $value, true).', '.var_export($value->getInvalidBehavior(), true).')'; - } else if (is_string($value) && '%' === $value[0]) { - return '$this->'.self::PREFIX.'container->getParameter('.var_export(substr($value, 1, -1), true).')'; - } else if (is_array($value) || is_scalar($value) || null === $value) { - return var_export($value, true); - } - - throw new \RuntimeException(sprintf('Invalid value for lookup method: %s', json_encode($value))); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Generator/NameGenerator.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Generator/NameGenerator.php deleted file mode 100644 index df3c1c8..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Generator/NameGenerator.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Generator; - -class NameGenerator -{ - private $count = 0; - private $firstChars = 'abcdefghijklmnopqrstuvwxyz'; - private $firstCharsLength = 26; - private $nonFirstChars = 'abcdefghijklmnopqrstuvwxyz0123456789_'; - private $nonFirstCharsLength = 37; - private $reservedNames = array(); - - public function addReservedName($name) - { - $this->reservedNames[$name] = true; - } - - public function setFirstChars($chars) - { - $this->firstChars = $chars; - $this->firstCharsLength = strlen($chars); - } - - public function setNonFirstChars($chars) - { - $this->nonFirstChars = $chars; - $this->nonFirstCharsLength = strlen($chars); - } - - public function reset() - { - $this->count = 0; - } - - public function nextName() - { - while (true) { - $name = ''; - $i = $this->count; - - if ('' === $name) { - $name .= $this->firstChars[$i%$this->firstCharsLength]; - $i = intval($i/$this->firstCharsLength); - } - - while ($i > 0) { - $i -= 1; - $name .= $this->nonFirstChars[$i%$this->nonFirstCharsLength]; - $i = intval($i/$this->nonFirstCharsLength); - } - - $this->count += 1; - - // check that the name is not reserved - if (isset($this->reservedNames[$name])) { - continue; - } - - return $name; - } - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/HttpKernel/ControllerResolver.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/HttpKernel/ControllerResolver.php deleted file mode 100644 index f1a48ce..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/HttpKernel/ControllerResolver.php +++ /dev/null @@ -1,179 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\HttpKernel; - -use Metadata\ClassHierarchyMetadata; -use JMS\DiExtraBundle\Metadata\ClassMetadata; -use CG\Core\DefaultNamingStrategy; -use CG\Proxy\Enhancer; -use JMS\AopBundle\DependencyInjection\Compiler\PointcutMatchingPass; -use JMS\DiExtraBundle\Generator\DefinitionInjectorGenerator; -use JMS\DiExtraBundle\Generator\LookupMethodClassGenerator; -use JMS\DiExtraBundle\DependencyInjection\Dumper\PhpDumper; -use Metadata\MetadataFactory; -use Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass; -use Symfony\Component\DependencyInjection\Parameter; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\Config\ConfigCache; -use Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver as BaseControllerResolver; - -class ControllerResolver extends BaseControllerResolver -{ - protected function createController($controller) - { - if (false === $pos = strpos($controller, '::')) { - $count = substr_count($controller, ':'); - if (2 == $count) { - // controller in the a:b:c notation then - $controller = $this->parser->parse($controller); - $pos = strpos($controller, '::'); - } elseif (1 == $count) { - // controller in the service:method notation - list($service, $method) = explode(':', $controller); - - return array($this->container->get($service), $method); - } else { - throw new \LogicException(sprintf('Unable to parse the controller name "%s".', $controller)); - } - } - - $class = substr($controller, 0, $pos); - $method = substr($controller, $pos+2); - - if (!class_exists($class)) { - throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class)); - } - - $filename = $this->container->getParameter('jms_di_extra.cache_dir').'/controller_injectors/'.str_replace('\\', '', $class).'.php'; - $cache = new ConfigCache($filename, $this->container->getParameter('kernel.debug')); - - if (!$cache->isFresh()) { - $metadata = $this->container->get('jms_di_extra.metadata.metadata_factory')->getMetadataForClass($class); - if (null === $metadata) { - $metadata = new ClassHierarchyMetadata(); - $metadata->addClassMetadata(new ClassMetadata($class)); - } - - $this->prepareContainer($cache, $filename, $metadata); - } - - $inject = require $filename; - $controller = $inject($this->container); - - if ($controller instanceof ContainerAwareInterface) { - $controller->setContainer($this->container); - } - - return array($controller, $method); - } - - private function prepareContainer($cache, $containerFilename, $metadata) - { - $container = new ContainerBuilder(); - $container->setParameter('jms_aop.cache_dir', $this->container->getParameter('jms_di_extra.cache_dir')); - $def = $container - ->register('jms_aop.interceptor_loader', 'JMS\AopBundle\Aop\InterceptorLoader') - ->addArgument(new Reference('service_container')) - ->setPublic(false) - ; - - // add resources - $ref = $metadata->getOutsideClassMetadata()->reflection; - while ($ref && false !== $filename = $ref->getFilename()) { - $container->addResource(new FileResource($filename)); - $ref = $ref->getParentClass(); - } - - // add definitions - $definitions = $this->container->get('jms_di_extra.metadata.converter')->convert($metadata); - $serviceIds = $parameters = array(); - - $controllerDef = array_pop($definitions); - $container->setDefinition('controller', $controllerDef); - - foreach ($definitions as $id => $def) { - $container->setDefinition($id, $def); - } - - $this->generateLookupMethods($controllerDef, $metadata); - - $config = $container->getCompilerPassConfig(); - $config->setOptimizationPasses(array()); - $config->setRemovingPasses(array()); - $config->addPass(new ResolveDefinitionTemplatesPass()); - $config->addPass(new PointcutMatchingPass($this->container->get('jms_aop.pointcut_container')->getPointcuts())); - $config->addPass(new InlineServiceDefinitionsPass()); - $container->compile(); - - if (!file_exists($dir = dirname($containerFilename))) { - if (false === @mkdir($dir, 0777, true)) { - throw new \RuntimeException(sprintf('Could not create directory "%s".', $dir)); - } - } - - static $generator; - if (null === $generator) { - $generator = new DefinitionInjectorGenerator(); - } - - $cache->write($generator->generate($container->getDefinition('controller')), $container->getResources()); - } - - private function generateLookupMethods($def, $metadata) - { - $found = false; - foreach ($metadata->classMetadata as $cMetadata) { - if (!empty($cMetadata->lookupMethods)) { - $found = true; - break; - } - } - - if (!$found) { - return; - } - - $generator = new LookupMethodClassGenerator($metadata); - $outerClass = $metadata->getOutsideClassMetadata()->reflection; - - if ($file = $def->getFile()) { - $generator->setRequiredFile($file); - } - - $enhancer = new Enhancer( - $outerClass, - array(), - array( - $generator, - ) - ); - - $filename = $this->container->getParameter('jms_di_extra.cache_dir').'/lookup_method_classes/'.str_replace('\\', '-', $outerClass->name).'.php'; - $enhancer->writeClass($filename); - - $def->setFile($filename); - $def->setClass($enhancer->getClassName($outerClass)); - $def->addMethodCall('__jmsDiExtra_setContainer', array(new Reference('service_container'))); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/JMSDiExtraBundle.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/JMSDiExtraBundle.php deleted file mode 100644 index 6a88dbe..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/JMSDiExtraBundle.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle; - -use JMS\DiExtraBundle\DependencyInjection\Compiler\ResourceOptimizationPass; -use JMS\DiExtraBundle\DependencyInjection\Compiler\IntegrationPass; -use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\DependencyInjection\Compiler\PassConfig; -use JMS\DiExtraBundle\DependencyInjection\Compiler\AnnotationConfigurationPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\HttpKernel\Bundle\Bundle; - -class JMSDiExtraBundle extends Bundle -{ - const VERSION = '1.0.1'; - - private $kernel; - - public function __construct(KernelInterface $kernel) - { - $this->kernel = $kernel; - } - - public function build(ContainerBuilder $container) - { - $config = $container->getCompiler()->getPassConfig(); - $passes = $config->getBeforeOptimizationPasses(); - array_unshift($passes, new AnnotationConfigurationPass($this->kernel)); - $config->setBeforeOptimizationPasses($passes); - - $container->addCompilerPass(new IntegrationPass()); - $container->addCompilerPass(new ResourceOptimizationPass(), PassConfig::TYPE_AFTER_REMOVING); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Metadata/ClassMetadata.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Metadata/ClassMetadata.php deleted file mode 100644 index 7b992d9..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Metadata/ClassMetadata.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Metadata; - -use Metadata\ClassMetadata as BaseClassMetadata; - -class ClassMetadata extends BaseClassMetadata -{ - public $id; - public $parent; - public $scope; - public $public; - public $abstract; - public $tags = array(); - public $arguments; - public $methodCalls = array(); - public $lookupMethods = array(); - public $properties = array(); - public $initMethod; - - public function serialize() - { - return serialize(array( - $this->id, - $this->parent, - $this->scope, - $this->public, - $this->abstract, - $this->tags, - $this->arguments, - $this->methodCalls, - $this->lookupMethods, - $this->properties, - $this->initMethod, - parent::serialize(), - )); - } - - public function unserialize($str) - { - list( - $this->id, - $this->parent, - $this->scope, - $this->public, - $this->abstract, - $this->tags, - $this->arguments, - $this->methodCalls, - $this->lookupMethods, - $this->properties, - $this->initMethod, - $parentStr - ) = unserialize($str); - - parent::unserialize($parentStr); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Metadata/Driver/AnnotationDriver.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Metadata/Driver/AnnotationDriver.php deleted file mode 100644 index cbd2051..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Metadata/Driver/AnnotationDriver.php +++ /dev/null @@ -1,220 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Metadata\Driver; - -use JMS\DiExtraBundle\Annotation\AfterSetup; - -use JMS\DiExtraBundle\Annotation\FormType; - -use JMS\DiExtraBundle\Annotation\DoctrineListener; -use JMS\DiExtraBundle\Annotation\Reference as AnnotReference; -use JMS\DiExtraBundle\Annotation\LookupMethod; -use JMS\DiExtraBundle\Annotation\Validator; -use JMS\DiExtraBundle\Annotation\InjectParams; -use JMS\DiExtraBundle\Exception\InvalidTypeException; -use JMS\DiExtraBundle\Annotation\Observe; -use Doctrine\Common\Annotations\Reader; -use JMS\DiExtraBundle\Annotation\Inject; -use JMS\DiExtraBundle\Annotation\Service; -use JMS\DiExtraBundle\Annotation\Tag; -use JMS\DiExtraBundle\Metadata\ClassMetadata; -use Metadata\Driver\DriverInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Reference; - -class AnnotationDriver implements DriverInterface -{ - private $reader; - - public function __construct(Reader $reader) - { - $this->reader = $reader; - } - - public function loadMetadataForClass(\ReflectionClass $class) - { - $metadata = new ClassMetadata($className = $class->getName()); - if (false !== $filename = $class->getFilename()) { - $metadata->fileResources[] = $filename; - } - - // this is a bit of a hack, but avoids any timeout issues when a class - // is moved into one of the compiled classes files, and Doctrine - // Common 2.1 is used. - if (false !== strpos($filename, '/classes.php') - || false !== strpos($filename, '/bootstrap.php')) { - return null; - } - - foreach ($this->reader->getClassAnnotations($class) as $annot) { - if ($annot instanceof Service) { - if (null === $annot->id) { - $metadata->id = $this->generateId($className); - } else { - $metadata->id = $annot->id; - } - - $metadata->parent = $annot->parent; - $metadata->public = $annot->public; - $metadata->scope = $annot->scope; - $metadata->abstract = $annot->abstract; - } else if ($annot instanceof Tag) { - $metadata->tags[$annot->name][] = $annot->attributes; - } else if ($annot instanceof Validator) { - // automatically register as service if not done explicitly - if (null === $metadata->id) { - $metadata->id = $this->generateId($className); - } - - $metadata->tags['validator.constraint_validator'][] = array( - 'alias' => $annot->alias, - ); - } else if ($annot instanceof DoctrineListener) { - if (null === $metadata->id) { - $metadata->id = $this->generateId($className); - } - - foreach ($annot->events as $event) { - $metadata->tags['doctrine.event_listener'][] = array( - 'event' => $event, - 'connection' => $annot->connection ?: 'default', - 'lazy' => $annot->lazy, - 'priority' => $annot->priority, - ); - } - } else if ($annot instanceof FormType) { - if (null === $metadata->id) { - $metadata->id = $this->generateId($className); - } - - $alias = $annot->alias; - - // try to extract it from the class itself - if (null === $alias) { - $instance = unserialize(sprintf('O:%d:"%s":0:{}', strlen($className), $className)); - $alias = $instance->getName(); - } - - $metadata->tags['form.type'][] = array( - 'alias' => $alias, - ); - } - } - - $hasInjection = false; - foreach ($class->getProperties() as $property) { - if ($property->getDeclaringClass()->getName() !== $className) { - continue; - } - $name = $property->getName(); - - foreach ($this->reader->getPropertyAnnotations($property) as $annot) { - if ($annot instanceof Inject) { - $hasInjection = true; - $metadata->properties[$name] = $this->convertReferenceValue($name, $annot); - } - } - } - - foreach ($class->getMethods() as $method) { - if ($method->getDeclaringClass()->getName() !== $className) { - continue; - } - $name = $method->getName(); - - foreach ($this->reader->getMethodAnnotations($method) as $annot) { - if ($annot instanceof Observe) { - $metadata->tags['kernel.event_listener'][] = array( - 'event' => $annot->event, - 'method' => $name, - 'priority' => $annot->priority, - ); - } else if ($annot instanceof InjectParams) { - $params = array(); - foreach ($method->getParameters() as $param) { - if (!isset($annot->params[$paramName = $param->getName()])) { - $params[] = $this->convertReferenceValue($paramName, new Inject(array('value' => null))); - continue; - } - - $params[] = $this->convertReferenceValue($paramName, $annot->params[$paramName]); - } - - if (!$params) { - continue; - } - - $hasInjection = true; - - if ('__construct' === $name) { - $metadata->arguments = $params; - } else { - $metadata->methodCalls[] = array($name, $params); - } - } else if ($annot instanceof LookupMethod) { - $hasInjection = true; - - if ($method->isFinal()) { - throw new \RuntimeException(sprintf('The method "%s::%s" is marked as final and cannot be declared as lookup-method.', $className, $name)); - } - if ($method->isPrivate()) { - throw new \RuntimeException(sprintf('The method "%s::%s" is marked as private and cannot be declared as lookup-method.', $className, $name)); - } - if ($method->getParameters()) { - throw new \RuntimeException(sprintf('The method "%s::%s" must have a no-arguments signature if you want to use it as lookup-method.', $className, $name)); - } - - $metadata->lookupMethods[$name] = $this->convertReferenceValue('get' === substr($name, 0, 3) ? substr($name, 3) : $name, $annot); - } else if ($annot instanceof AfterSetup) { - if (!$method->isPublic()) { - throw new \RuntimeException(sprintf('The init method "%s::%s" must be public.', $method->class, $method->name)); - } - - $metadata->initMethod = $method->name; - } - } - } - - if (null == $metadata->id && !$hasInjection) { - return null; - } - - return $metadata; - } - - private function convertReferenceValue($name, AnnotReference $annot) - { - if (null === $annot->value) { - return new Reference($this->generateId($name), false !== $annot->required ? ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE : ContainerInterface::NULL_ON_INVALID_REFERENCE); - } - - if (false === strpos($annot->value, '%')) { - return new Reference($annot->value, false !== $annot->required ? ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE : ContainerInterface::NULL_ON_INVALID_REFERENCE); - } - - return $annot->value; - } - - private function generateId($name) - { - $name = preg_replace('/(?<=[a-zA-Z0-9])[A-Z]/', '_\\0', $name); - - return strtolower(strtr($name, '\\', '.')); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Metadata/MetadataConverter.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Metadata/MetadataConverter.php deleted file mode 100644 index a4f8ea5..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Metadata/MetadataConverter.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Metadata; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\Definition; -use Metadata\ClassHierarchyMetadata; - -class MetadataConverter -{ - /** - * Converts class hierarchy metadata to definition instances. - * - * @param ClassHierarchyMetadata $metadata - * @return array an array of Definition instances - */ - public function convert(ClassHierarchyMetadata $metadata) - { - static $count = 0; - $definitions = array(); - - $previous = null; - foreach ($metadata->classMetadata as $classMetadata) { - if (null === $previous && null === $classMetadata->parent) { - $definition = new Definition(); - } else { - $definition = new DefinitionDecorator( - $classMetadata->parent ?: $previous->id - ); - } - - $definition->setClass($classMetadata->name); - if (null !== $classMetadata->scope) { - $definition->setScope($classMetadata->scope); - } - if (null !== $classMetadata->public) { - $definition->setPublic($classMetadata->public); - } - if (null !== $classMetadata->abstract) { - $definition->setAbstract($classMetadata->abstract); - } - if (null !== $classMetadata->arguments) { - $definition->setArguments($classMetadata->arguments); - } - - $definition->setMethodCalls($classMetadata->methodCalls); - $definition->setTags($classMetadata->tags); - $definition->setProperties($classMetadata->properties); - - if (null === $classMetadata->id) { - $classMetadata->id = '_jms_di_extra.unnamed.service_'.$count++; - } - - if ($classMetadata->initMethod) { - if (!method_exists($definition, 'setInitMethod')) { - throw new \RuntimeException(sprintf('@AfterSetup is not available on your Symfony version.')); - } - - $definition->setInitMethod($classMetadata->initMethod); - } - - $definitions[$classMetadata->id] = $definition; - $previous = $classMetadata; - } - - return $definitions; - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/README b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/README deleted file mode 100644 index 72bab21..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/README +++ /dev/null @@ -1,8 +0,0 @@ -For documentation, see: - - Resources/doc - - -For license, see: - - Resources/meta/LICENSE \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Resources/config/services.xml b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Resources/config/services.xml deleted file mode 100644 index c1ac0d4..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Resources/config/services.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - JMS\DiExtraBundle\Metadata\Driver\AnnotationDriver - - Metadata\MetadataFactory - Metadata\Cache\FileCache - - JMS\DiExtraBundle\Metadata\MetadataConverter - JMS\DiExtraBundle\HttpKernel\ControllerResolver - - JMS\DiExtraBundle\EventListener\TemplateListener - JMS\DiExtraBundle\EventListener\ControllerListener - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Resources/doc/index.rst b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Resources/doc/index.rst deleted file mode 100644 index 9b7ece5..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Resources/doc/index.rst +++ /dev/null @@ -1,290 +0,0 @@ -======== -Overview -======== - -This bundle allows you to configure dependency injection using annotations. - -Installation ------------- -Add the following to your ``deps`` file:: - - [JMSDiExtraBundle] - git=https://github.com/schmittjoh/JMSDiExtraBundle.git - target=/bundles/JMS/DiExtraBundle - - ; Dependencies: - ;-------------- - [metadata] - git=https://github.com/schmittjoh/metadata.git - version=1.1.0 ; <- make sure to get 1.1, not 1.0 - -Then register the bundle with your kernel:: - - // in AppKernel::registerBundles() - $bundles = array( - // ... - new JMS\DiExtraBundle\JMSDiExtraBundle($this), - // ... - ); - -In addition, this bundle also requires the JMSAopBundle. See its documentation for -installation instructions:: - - https://github.com/schmittjoh/JMSAopBundle/blob/master/Resources/doc/index.rst - - -Make sure that you also register the namespaces with the autoloader:: - - // app/autoload.php - $loader->registerNamespaces(array( - // ... - 'JMS' => __DIR__.'/../vendor/bundles', - 'Metadata' => __DIR__.'/../vendor/metadata/src', - // ... - )); - - -Configuration -------------- -For optimal development performance (in production there is no difference either way), -it is recommended to explicitly configure the directories which should be scanned for -service classes (by default no directory is scanned):: - - jms_di_extra: - locations: - all_bundles: false - bundles: [FooBundle, AcmeBlogBundle, etc.] - directories: [%kernel.root_dir%/../src, some/other/dir] - -Usage ------ - -Non-Controller Classes -~~~~~~~~~~~~~~~~~~~~~~ - -Non-controller classes are configured, and managed by Symfony's DIC just like any -other service that you configure using YML, XML, or PHP. The only difference is -that you can do it via annotations which is a lot more convenient. - -You can use these annotations on services (for examples, see below): -@Service, @Inject, @InjectParams, @Observe, @Tag - -Note that you cannot use the @Inject annotation on private, or protected properties. -Likewise, the @InjectParams annotation does not work on protected, or private methods. - - -Controllers -~~~~~~~~~~~ - -Controllers are a special type of class which is also treated specially by this -bundle. The most notable difference is that you do not need to define these -classes as services. Yes, no services, but don't worry you can still use all of -the DIC's features, and even some more. - -- Constructor/Setter Injection:: - - em = $em; - $this->session = $session; - } - // ... some actions - } - - **Note:** Constructor Injection is not possible when a parent definition - also defines a constructor which is configured for injection. - -- Property Injection:: - - getMailer(); - } - } - - /** @DI\LookupMethod("mailer") */ - protected function getMailer() { /* empty body here */ } - } - -You can use this type of injection if you have a dependency that you do not -always need in the controller, and which is costly to initialize, like the -mailer in the example above. - - -Annotations ------------ - -@Inject -~~~~~~~~~ -This marks a property, or parameter for injection:: - - use JMS\DiExtraBundle\Annotation\Inject; - - class Controller - { - /** - * @Inject("security.context", required = false) - */ - private $securityContext; - - /** - * @Inject("%kernel.cache_dir%") - */ - private $cacheDir; - - /** - * @Inject - */ - private $session; - } - -If you do not specify the service explicitly, we will try to guess it based on the name -of the property or the parameter. - -@InjectParams -~~~~~~~~~~~~~~~ -This marks the parameters of a method for injection:: - - use JMS\DiExtraBundle\Annotation\Inject; - use JMS\DiExtraBundle\Annotation\InjectParams; - use JMS\DiExtraBundle\Annotation\Service; - - /** - * @Service - */ - class Listener - { - /** - * @InjectParams({ - * "em" = @Inject("doctrine.entity_manager") - * }) - */ - public function __construct(EntityManager $em, Session $session) - { - // ... - } - } - -If you don't define all parameters in the param map, we will try to guess which services -should be injected into the remaining parameters based on their name. - -@Service -~~~~~~~~ -Marks a class as service:: - - use JMS\DiExtraBundle\Annotation\Service; - - /** - * @Service("some.service.id", parent="another.service.id", public=false) - */ - class Listener - { - } - -If you do not explicitly define a service id, then we will generated a sensible default -based on the fully qualified class name for you. - -@Tag -~~~~ -Adds a tag to the service:: - - use JMS\DiExtraBundle\Annotation\Service; - use JMS\DiExtraBundle\Annotation\Tag; - - /** - * @Service - * @Tag("doctrine.event_listener", attributes = {"event" = "postGenerateSchema", lazy=true}) - */ - class Listener - { - // ... - } - -@Observe -~~~~~~~~ -Automatically registers a method as listener to a certain event:: - - use JMS\DiExtraBundle\Annotation\Observe; - use JMS\DiExtraBundle\Annotation\Service; - - /** - * @Service - */ - class RequestListener - { - /** - * @Observe("kernel.request", priority = 255) - */ - public function onKernelRequest() - { - // ... - } - } - -@Validator -~~~~~~~~~~ -Automatically registers the given class as constraint validator for the Validator component:: - - use JMS\DiExtraBundle\Annotation\Validator; - use Symfony\Component\Validator\Constraint; - use Symfony\Component\Validator\ConstraintValidator; - - /** - * @Validator("my_alias") - */ - class MyValidator extends ConstraintValidator - { - // ... - } - - class MyConstraint extends Constraint - { - // ... - public function validatedBy() - { - return 'my_alias'; - } - } - -The @Validator annotation also implies the @Service annotation if you do not specify it explicitly. -The alias which is passed to the @Validator annotation must match the string that is returned from -the ``validatedBy`` method of your constraint. - diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Resources/meta/LICENSE b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Resources/meta/LICENSE deleted file mode 100644 index 753842b..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/Resources/meta/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/composer.json b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/composer.json deleted file mode 100644 index cc6196c..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/composer.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "jms/di-extra-bundle", - "description": "Allows to configure dependency injection using annotations", - "keywords": ["annotations","dependency injection"], - "type": "symfony-bundle", - "license": "Apache", - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "require": { - "symfony/framework-bundle": "2.*", - "jms/metadata": "1.1.*" - }, - "autoload": { - "psr-0": { "JMS\\DiExtraBundle": "" } - }, - "target-dir": "JMS/DiExtraBundle" -} diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/AfterSetup.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/AfterSetup.php deleted file mode 100644 index 1fb2e2c..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/AfterSetup.php +++ /dev/null @@ -1,13 +0,0 @@ - - */ -final class AfterSetup -{ -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/DoctrineListener.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/DoctrineListener.php deleted file mode 100644 index 3a834f0..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/DoctrineListener.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Annotation; - -use JMS\DiExtraBundle\Exception\InvalidTypeException; - -/** - * @Annotation - * @Target("CLASS") - */ -class DoctrineListener -{ - /** @var array @Required */ - public $events; - - /** @var string */ - public $connection; - - /** @var boolean */ - public $lazy = true; - - /** @var integer */ - public $priority = 0; - - public function __construct() - { - if (0 === func_num_args()) { - return; - } - $values = func_get_arg(0); - - if (!isset($values['value'])) { - throw new InvalidTypeException('DoctrineListener', 'value', 'array or string', null); - } - $this->events = (array) $values['value']; - - if (isset($values['connection'])) { - if (!is_string($values['connection'])) { - throw new InvalidTypeException('DoctrineListener', 'connection', 'string', $values['connection']); - } - $this->connection = $values['connection']; - } - - if (isset($values['lazy'])) { - if (!is_boolean($values['lazy'])) { - throw new InvalidTypeException('DoctrineListener', 'lazy', 'boolean', $values['lazy']); - } - $this->lazy = $values['lazy']; - } - - if (isset($values['priority'])) { - if (!is_integer($values['priority'])) { - throw new InvalidTypeException('DoctrineListener', 'priority', 'integer', $values['priority']); - } - $this->priority = $values['priority']; - } - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/FormType.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/FormType.php deleted file mode 100644 index 073b971..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/FormType.php +++ /dev/null @@ -1,37 +0,0 @@ - - */ -final class FormType -{ - /** @var string */ - public $alias; - - public function __construct() - { - if (0 === func_num_args()) { - return; - } - $values = func_get_arg(0); - - if (isset($values['value'])) { - $values['alias'] = $values['value']; - } - - if (isset($values['alias'])) { - if (!is_string($values['alias'])) { - throw new InvalidTypeException('FormType', 'alias', 'string', $values['alias']); - } - - $this->alias = $values['alias']; - } - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Inject.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Inject.php deleted file mode 100644 index f723003..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Inject.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Annotation; - -/** - * @Annotation - * @Target({"PROPERTY", "ANNOTATION"}) - */ -final class Inject extends Reference -{ -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/InjectParams.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/InjectParams.php deleted file mode 100644 index 44a4d82..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/InjectParams.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Annotation; - -use JMS\DiExtraBundle\Exception\InvalidTypeException; - -/** - * @Annotation - * @Target("METHOD") - */ -final class InjectParams -{ - /** @var array */ - public $params = array(); - - public function __construct() - { - if (0 === func_num_args()) { - return; - } - $values = func_get_arg(0); - - if (isset($values['params'])) { - $values['value'] = $values['params']; - } - - if (isset($values['value'])) { - if (!is_array($values['value'])) { - throw new InvalidTypeException('InjectParams', 'value', 'array', $values['value']); - } - - foreach ($values['value'] as $k => $v) { - if (!$v instanceof Inject) { - throw new InvalidTypeException('InjectParams', sprintf('value[%s]', $k), '@Inject', $v); - } - - $this->params[$k] = $v; - } - } - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/LookupMethod.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/LookupMethod.php deleted file mode 100644 index 30fef73..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/LookupMethod.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Annotation; - -/** - * @Annotation - * @Target("METHOD") - */ -final class LookupMethod extends Reference -{ -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Observe.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Observe.php deleted file mode 100644 index 000f827..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Observe.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Annotation; - -use JMS\DiExtraBundle\Exception\InvalidTypeException; - -/** - * @Annotation - * @Target("METHOD") - */ -final class Observe -{ - /** @var string @Required */ - public $event; - - /** @var integer */ - public $priority = 0; - - public function __construct() - { - if (0 === func_num_args()) { - return; - } - $values = func_get_arg(0); - - if (isset($values['event'])) { - $values['value'] = $values['event']; - } - - if (isset($values['value'])) { - if (!is_string($values['value'])) { - throw new InvalidTypeException('Observe', 'value', 'string', $values['value']); - } - - $this->event = $values['value']; - } - - if (isset($values['priority'])) { - if (!is_numeric($values['priority'])) { - throw new InvalidTypeException('Observe', 'priority', 'integer', $values['priority']); - } - - $this->priority = $values['priority']; - } - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Reference.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Reference.php deleted file mode 100644 index 853f514..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Reference.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Annotation; - -use JMS\DiExtraBundle\Exception\InvalidTypeException; - -abstract class Reference -{ - /** @var string */ - public $value; - - /** @var boolean */ - public $required; - - public final function __construct() - { - if (0 === func_num_args()) { - return; - } - $values = func_get_arg(0); - - if (isset($values['value'])) { - if (!is_string($values['value'])) { - throw new InvalidTypeException('Inject', 'value', 'string', $values['value']); - } - - $this->value = $values['value']; - } - - if (isset($values['required'])) { - if (!is_bool($values['required'])) { - throw new InvalidTypeException('Inject', 'required', 'boolean', $values['required']); - } - - $this->required = $values['required']; - } - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Service.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Service.php deleted file mode 100644 index caa0557..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Service.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Annotation; - -use JMS\DiExtraBundle\Exception\InvalidTypeException; - -/** - * @Annotation - * @Target("CLASS") - */ -final class Service -{ - /** @var string */ - public $id; - - /** @var string */ - public $parent; - - /** @var boolean */ - public $public; - - /** @var string */ - public $scope; - - /** @var boolean */ - public $abstract; - - public function __construct() - { - if (0 === func_num_args()) { - return; - } - $values = func_get_arg(0); - - if (isset($values['value'])) { - if (!is_string($values['value'])) { - throw new InvalidTypeException('Service', 'value', 'string', $values['value']); - } - - $this->id = $values['value']; - } - if (isset($values['parent'])) { - if (!is_string($values['parent'])) { - throw new InvalidTypeException('Service', 'parent', 'string', $values['parent']); - } - - $this->parent = $values['parent']; - } - if (isset($values['public'])) { - if (!is_bool($values['public'])) { - throw new InvalidTypeException('Service', 'public', 'boolean', $values['public']); - } - - $this->public = $values['public']; - } - if (isset($values['scope'])) { - if (!is_string($values['scope'])) { - throw new InvalidTypeException('Service', 'scope', 'string', $values['scope']); - } - - $this->scope = $values['scope']; - } - if (isset($values['abstract'])) { - if (!is_bool($values['abstract'])) { - throw new InvalidTypeException('Service', 'abstract', 'boolean', $values['abstract']); - } - - $this->abstract = $values['abstract']; - } - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Tag.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Tag.php deleted file mode 100644 index 55942be..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Tag.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Annotation; - -use JMS\DiExtraBundle\Exception\InvalidArgumentException; -use JMS\DiExtraBundle\Exception\InvalidTypeException; - -/** - * @Annotation - * @Target("CLASS") - */ -final class Tag -{ - /** @var string @Required */ - public $name; - - /** @var array */ - public $attributes = array(); - - public function __construct() - { - if (0 === func_num_args()) { - return; - } - $values = func_get_arg(0); - - if (!isset($values['value'])) { - throw new InvalidArgumentException('A value must be given for annotation "@Tag".'); - } - if (!is_string($values['value'])) { - throw new InvalidTypeException('Tag', 'value', 'string', $values['value']); - } - - $this->name = $values['value']; - - if (isset($values['attributes'])) { - if (!is_array($values['attributes'])) { - throw new InvalidTypeException('Tag', 'attributes', 'array', $values['attributes']); - } - - $this->attributes = $values['attributes']; - } - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Validator.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Validator.php deleted file mode 100644 index cc8e38a..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Annotation/Validator.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Annotation; - -use JMS\DiExtraBundle\Exception\InvalidTypeException; - -/** - * @Annotation - * @Target("CLASS") - */ -final class Validator -{ - /** @var string @Required */ - public $alias; - - public function __construct() - { - if (0 === func_num_args()) { - return; - } - $values = func_get_arg(0); - - if (isset($values['alias'])) { - $values['value'] = $values['alias']; - } - - if (!isset($values['value'])) { - throw new \InvalidArgumentException('A value must be given for @Validator annotations.'); - } - if (!is_string($values['value'])) { - throw new InvalidTypeException('Validator', 'value', 'string', $values['value']); - } - $this->alias = $values['value']; - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Config/FastDirectoriesResource.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Config/FastDirectoriesResource.php deleted file mode 100644 index 719ac41..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Config/FastDirectoriesResource.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Config; - -use JMS\DiExtraBundle\Finder\PatternFinder; - -use Symfony\Component\Config\Resource\ResourceInterface; - -class FastDirectoriesResource implements ResourceInterface -{ - private $finder; - - private $directories; - private $filePattern; - private $files = array(); - - public function __construct(array $directories, $filePattern = null) - { - $this->finder = new PatternFinder('.*', '*.php'); - $this->finder->setRegexPattern(true); - - $this->directories = $directories; - $this->filePattern = $filePattern ?: '*'; - } - - public function __toString() - { - return implode(', ', $this->directories); - } - - public function getResource() - { - return $this->directories; - } - - public function update() - { - $this->files = $this->getFiles(); - } - - public function isFresh($timestamp) - { - $files = $this->getFiles(); - - if (array_diff($this->files, $files) || array_diff($files, $this->files)) { - return false; - } - - foreach ($files as $file) { - if (filemtime($file) > $timestamp) { - return false; - } - } - - return true; - } - - private function getFiles() - { - return $this->finder->findFiles($this->directories); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Config/ServiceFilesResource.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Config/ServiceFilesResource.php deleted file mode 100644 index 40508b2..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Config/ServiceFilesResource.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Config; - -use JMS\DiExtraBundle\Finder\PatternFinder; -use Symfony\Component\Config\Resource\ResourceInterface; - -class ServiceFilesResource implements ResourceInterface -{ - private $files; - private $dirs; - - public function __construct(array $files, array $dirs) - { - $this->files = $files; - $this->dirs = $dirs; - } - - public function isFresh($timestamp) - { - $finder = new PatternFinder('JMS\DiExtraBundle\Annotation'); - $files = $finder->findFiles($this->dirs); - - return !array_diff($files, $this->files) && !array_diff($this->files, $files); - } - - public function __toString() - { - return implode(', ', $this->files); - } - - public function getResource() - { - return array($this->files, $this->dirs); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/Compiler/AnnotationConfigurationPass.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/Compiler/AnnotationConfigurationPass.php deleted file mode 100644 index cb8d77b..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/Compiler/AnnotationConfigurationPass.php +++ /dev/null @@ -1,120 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Alias; -use JMS\DiExtraBundle\Exception\RuntimeException; -use JMS\DiExtraBundle\Config\ServiceFilesResource; -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\Definition; -use JMS\DiExtraBundle\Finder\PatternFinder; -use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -class AnnotationConfigurationPass implements CompilerPassInterface -{ - private $kernel; - private $finder; - - public function __construct(KernelInterface $kernel) - { - $this->kernel = $kernel; - $this->finder = new PatternFinder('JMS\DiExtraBundle\Annotation'); - } - - public function process(ContainerBuilder $container) - { - $reader = $container->get('annotation_reader'); - $factory = $container->get('jms_di_extra.metadata.metadata_factory'); - $converter = $container->get('jms_di_extra.metadata.converter'); - - $directories = $this->getScanDirectories($container); - if (!$directories) { - $container->getCompiler()->addLogMessage('No directories configured for AnnotationConfigurationPass.'); - return; - } - - $files = $this->finder->findFiles($directories); - $container->addResource(new ServiceFilesResource($files, $directories)); - foreach ($files as $file) { - $container->addResource(new FileResource($file)); - require_once $file; - - $className = $this->getClassName($file); - - if (null === $metadata = $factory->getMetadataForClass($className)) { - continue; - } - if (null === $metadata->getOutsideClassMetadata()->id) { - continue; - } - - foreach ($converter->convert($metadata) as $id => $definition) { - $container->setDefinition($id, $definition); - } - } - } - - private function getScanDirectories(ContainerBuilder $c) - { - $bundles = $this->kernel->getBundles(); - $scanBundles = $c->getParameter('jms_di_extra.bundles'); - $scanAllBundles = $c->getParameter('jms_di_extra.all_bundles'); - - $directories = $c->getParameter('jms_di_extra.directories'); - foreach ($bundles as $name => $bundle) { - if (!$scanAllBundles && !in_array($name, $scanBundles, true)) { - continue; - } - - if ('JMSDiExtraBundle' === $name) { - continue; - } - - $directories[] = $bundle->getPath(); - } - - return $directories; - } - - /** - * Only supports one namespaced class per file - * - * @throws \RuntimeException if the class name cannot be extracted - * @param string $filename - * @return string the fully qualified class name - */ - private function getClassName($filename) - { - $src = file_get_contents($filename); - - if (!preg_match('/\bnamespace\s+([^;]+);/s', $src, $match)) { - throw new RuntimeException(sprintf('Namespace could not be determined for file "%s".', $filename)); - } - $namespace = $match[1]; - - if (!preg_match('/\bclass\s+([^\s]+)\s+(?:extends|implements|{)/s', $src, $match)) { - throw new RuntimeException(sprintf('Could not extract class name from file "%s".', $filename)); - } - - return $namespace.'\\'.$match[1]; - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/Compiler/IntegrationPass.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/Compiler/IntegrationPass.php deleted file mode 100644 index db3e488..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/Compiler/IntegrationPass.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Alias; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Integrates the bundle with external code. - * - * @author Johannes M. Schmitt - */ -class IntegrationPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - // replace Symfony2's default controller resolver - $container->setAlias('controller_resolver', new Alias('jms_di_extra.controller_resolver', false)); - - // replace SensioFrameworkExtraBundle's default template listener - if ($container->hasDefinition('sensio_framework_extra.view.listener')) { - $def = $container->getDefinition('sensio_framework_extra.view.listener'); - - // only overwrite if it has the default class otherwise the user has to do the integration manually - if ('%sensio_framework_extra.view.listener.class%' === $def->getClass()) { - $def->setClass('%jms_di_extra.template_listener.class%'); - } - } - - if ($container->hasDefinition('sensio_framework_extra.controller.listener')) { - $def = $container->getDefinition('sensio_framework_extra.controller.listener'); - - if ('%sensio_framework_extra.controller.listener.class%' === $def->getClass()) { - $def->setClass('%jms_di_extra.controller_listener.class%'); - } - } - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/Compiler/ResourceOptimizationPass.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/Compiler/ResourceOptimizationPass.php deleted file mode 100644 index ee73a0e..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/Compiler/ResourceOptimizationPass.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\DependencyInjection\Compiler; - -use JMS\DiExtraBundle\Config\FastDirectoriesResource; - -use Symfony\Component\Config\Resource\DirectoryResource; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -class ResourceOptimizationPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - $resources = $directories = array(); - - $ref = new \ReflectionProperty('Symfony\Component\Config\Resource\DirectoryResource', 'pattern'); - $ref->setAccessible(true); - - foreach ($container->getResources() as $resource) { - if ($resource instanceof DirectoryResource) { - if (null === $pattern = $ref->getValue($resource)) { - $pattern = '*'; - } - - $directories[$pattern][] = $resource->getResource(); - - continue; - } - - $resources[] = $resource; - } - - $sortFunc = function($a, $b) { - return strlen($a) - strlen($b); - }; - - foreach ($directories as $pattern => $pDirectories) { - $newResources = array(); - - usort($pDirectories, $sortFunc); - foreach ($pDirectories as $a) { - foreach ($newResources as $b) { - if (0 === strpos($a, $b)) { - continue 2; - } - } - - $newResources[] = $a; - } - - $directories[$pattern] = $newResources; - } - - foreach ($directories as $pattern => $pDirectories) { - $newResource = new FastDirectoriesResource($pDirectories, $pattern); - $newResource->update(); - $resources[] = $newResource; - } - - $ref = new \ReflectionProperty('Symfony\Component\DependencyInjection\ContainerBuilder', 'resources'); - $ref->setAccessible(true); - $ref->setValue($container, $resources); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/Configuration.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/Configuration.php deleted file mode 100644 index 52129b8..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/Configuration.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\DependencyInjection; - -use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\Config\Definition\ConfigurationInterface; - -class Configuration implements ConfigurationInterface -{ - public function getConfigTreeBuilder() - { - $tb = new TreeBuilder(); - - $tb - ->root('jms_di_extra', 'array') - ->children() - ->arrayNode('locations') - ->addDefaultsIfNotSet() - ->children() - ->booleanNode('all_bundles')->defaultFalse()->end() - ->arrayNode('bundles') - ->beforeNormalization() - ->ifString() - ->then(function($v) { - return preg_split('/\s*,\s*/', $v); - }) - ->end() - ->prototype('scalar')->end() - ->end() - ->arrayNode('directories') - ->beforeNormalization() - ->ifString() - ->then(function($v) { - return preg_split('/\s*,\s*/', $v); - }) - ->end() - ->prototype('scalar')->end() - ->end() - ->end() - ->end() - ->scalarNode('cache_dir')->defaultValue('%kernel.cache_dir%/diextra')->end() - ->arrayNode('metadata') - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('cache')->defaultValue('file')->cannotBeEmpty()->end() - ->end() - ->end() - ->end() - ->end(); - - return $tb; - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/JMSDiExtraExtension.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/JMSDiExtraExtension.php deleted file mode 100644 index 9c0266c..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/JMSDiExtraExtension.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\DependencyInjection; - -use JMS\DiExtraBundle\Exception\RuntimeException; -use Symfony\Component\DependencyInjection\Alias; -use Symfony\Component\Config\FileLocator; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\Config\Definition\Processor; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\HttpKernel\DependencyInjection\Extension; - -class JMSDiExtraExtension extends Extension -{ - public function load(array $configs, ContainerBuilder $container) - { - $config = $this->mergeConfigs($configs); - - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('services.xml'); - - $container->setParameter('jms_di_extra.all_bundles', $config['locations']['all_bundles']); - $container->setParameter('jms_di_extra.bundles', $config['locations']['bundles']); - $container->setParameter('jms_di_extra.directories', $config['locations']['directories']); - $container->setParameter('jms_di_extra.cache_dir', $config['cache_dir']); - - $this->configureMetadata($config['metadata'], $container, $config['cache_dir'].'/metadata'); - - $this->addClassesToCompile(array( - 'JMS\\DiExtraBundle\\HttpKernel\ControllerResolver', - )); - } - - private function configureMetadata(array $config, $container, $cacheDir) - { - if ('none' === $config['cache']) { - $container->removeAlias('jms_di_extra.metadata.cache'); - return; - } - - if ('file' === $config['cache']) { - $cacheDir = $container->getParameterBag()->resolveValue($cacheDir); - if (!file_exists($cacheDir)) { - if (false === @mkdir($cacheDir, 0777, true)) { - throw new RuntimeException(sprintf('The cache dir "%s" could not be created.', $cacheDir)); - } - } - if (!is_writable($cacheDir)) { - throw new RuntimeException(sprintf('The cache dir "%s" is not writable.', $cacheDir)); - } - - $container - ->getDefinition('jms_di_extra.metadata.cache.file_cache') - ->replaceArgument(0, $cacheDir) - ; - } else { - $container->setAlias('jms_di_extra.metadata.cache', new Alias($config['cache'], false)); - } - } - - private function mergeConfigs(array $configs) - { - $processor = new Processor(); - $configuration = new Configuration(); - - return $processor->process($configuration->getConfigTreeBuilder()->buildTree(), $configs); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/LookupMethodClassInterface.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/LookupMethodClassInterface.php deleted file mode 100644 index 40a506f..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/DependencyInjection/LookupMethodClassInterface.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\DependencyInjection; - -interface LookupMethodClassInterface -{ - function __jmsDiExtra_getOriginalClassName(); -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/EventListener/ControllerListener.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/EventListener/ControllerListener.php deleted file mode 100644 index cab730f..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/EventListener/ControllerListener.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\EventListener; - -use Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener as BaseControllerListener; -use CG\Core\ClassUtils; -use Doctrine\Common\Annotations\Reader; -use Symfony\Component\HttpKernel\Event\FilterControllerEvent; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationInterface; - -/** - * The ControllerListener class parses annotation blocks located in - * controller classes. - * - * @author Fabien Potencier - */ -class ControllerListener extends BaseControllerListener -{ - /** - * Modifies the Request object to apply configuration information found in - * controllers annotations like the template to render or HTTP caching - * configuration. - * - * @param FilterControllerEvent $event A FilterControllerEvent instance - */ - public function onKernelController(FilterControllerEvent $event) - { - if (!is_array($controller = $event->getController())) { - return; - } - - $object = new \ReflectionClass(ClassUtils::getUserClass(get_class($controller[0]))); - $method = $object->getMethod($controller[1]); - - $request = $event->getRequest(); - foreach ($this->reader->getMethodAnnotations($method) as $configuration) { - if ($configuration instanceof ConfigurationInterface) { - $request->attributes->set('_'.$configuration->getAliasName(), $configuration); - } - } - } -} diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/EventListener/TemplateListener.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/EventListener/TemplateListener.php deleted file mode 100644 index feacc35..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/EventListener/TemplateListener.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\EventListener; - -use CG\Core\ClassUtils; -use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference; -use Symfony\Component\HttpFoundation\Request; -use JMS\DiExtraBundle\DependencyInjection\LookupMethodClassInterface; -use Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener as FrameworkExtraTemplateListener; - -class TemplateListener extends FrameworkExtraTemplateListener -{ - protected function guessTemplateName($controller, Request $request, $engine = 'twig') - { - $controllerClass = get_class($controller[0]); - $userClass = ClassUtils::getUserClass($controllerClass); - - if ($controllerClass === $userClass) { - return parent::guessTemplateName($controller, $request, $engine); - } - - if (!preg_match('/Controller\\\(.+)Controller$/', $userClass, $matchController)) { - throw new \InvalidArgumentException(sprintf('The "%s" class does not look like a controller class (it must be in a "Controller" sub-namespace and the class name must end with "Controller")', $userClass)); - } - - if (!preg_match('/^(.+)Action$/', $controller[1], $matchAction)) { - throw new \InvalidArgumentException(sprintf('The "%s" method does not look like an action method (it does not end with Action)', $controller[1])); - } - - $bundle = $this->getBundleForClass($userClass); - - return new TemplateReference($bundle->getName(), $matchController[1], $matchAction[1], $request->getRequestFormat(), $engine); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Exception/Exception.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Exception/Exception.php deleted file mode 100644 index 293e70b..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Exception/Exception.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Exception; - -/** - * Base exception for the DiExtraBundle. - * - * @author Johannes M. Schmitt - */ -interface Exception -{ -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Exception/InvalidArgumentException.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Exception/InvalidArgumentException.php deleted file mode 100644 index 990c60f..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Exception; - -/** - * InvalidArgumentException for the DiExtraBundle. - * - * @author Johannes M. Schmitt - */ -class InvalidArgumentException extends \InvalidArgumentException implements Exception -{ -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Exception/InvalidTypeException.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Exception/InvalidTypeException.php deleted file mode 100644 index 7437778..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Exception/InvalidTypeException.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Exception; - -class InvalidTypeException extends InvalidArgumentException -{ - public function __construct($annotName, $attrName, $expected, $actual) - { - $msg = sprintf('The attribute "%s" on annotation "@%s" is expected to be of type %s, but got %s.', $attrName, $annotName, $expected, gettype($actual)); - - parent::__construct($msg); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Exception/RuntimeException.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Exception/RuntimeException.php deleted file mode 100644 index a47a6e4..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Exception/RuntimeException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Exception; - -/** - * RuntimeException for the DiExtraBundle. - * - * @author Johannes M. Schmitt - */ -class RuntimeException extends \RuntimeException implements Exception -{ -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Finder/PatternFinder.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Finder/PatternFinder.php deleted file mode 100644 index f4bea5f..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Finder/PatternFinder.php +++ /dev/null @@ -1,201 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Finder; - -use JMS\DiExtraBundle\Exception\RuntimeException; -use Symfony\Component\Finder\Finder; -use Symfony\Component\Process\ExecutableFinder; - -class PatternFinder -{ - const METHOD_GREP = 1; - const METHOD_FINDSTR = 2; - const METHOD_FINDER = 3; - - private static $method; - private static $grepPath; - - private $pattern; - private $filePattern; - private $recursive = true; - private $regexPattern = false; - - public function __construct($pattern, $filePattern = '*.php') - { - if (null === self::$method) { - self::determineMethod(); - } - - $this->pattern = $pattern; - $this->filePattern = $filePattern; - } - - public function setRecursive($bool) - { - $this->recursive = (Boolean) $bool; - } - - public function setRegexPattern($bool) - { - $this->regexPattern = (Boolean) $bool; - } - - public function findFiles(array $dirs) - { - // check for grep availability - if (self::METHOD_GREP === self::$method) { - return $this->findUsingGrep($dirs); - } - - // use FINDSTR on Windows - if (self::METHOD_FINDSTR === self::$method) { - return $this->findUsingFindstr($dirs); - } - - // this should really be avoided at all costs since it is damn slow - return $this->findUsingFinder($dirs); - } - - private function findUsingFindstr(array $dirs) - { - $cmd = 'FINDSTR /M /S /P'; - - if (!$this->recursive) { - $cmd .= ' /L'; - } - - $cmd .= ' /D:'.escapeshellarg(implode(';', $dirs)); - $cmd .= ' '.escapeshellarg($this->pattern); - $cmd .= ' '.$this->filePattern; - - exec($cmd, $lines, $exitCode); - - if (1 === $exitCode) { - return array(); - } - - if (0 !== $exitCode) { - throw new RuntimeException(sprintf('Command "%s" exited with non-successful status code. "%d".', $cmd, $exitCode)); - } - - // Looks like FINDSTR has different versions with different output formats. - // - // Supported format #1: - // C:\matched\dir1: - // Relative\Path\To\File1.php - // Relative\Path\To\File2.php - // C:\matched\dir2: - // Relative\Path\To\File3.php - // Relative\Path\To\File4.php - // - // Supported format #2: - // C:\matched\dir1\Relative\Path\To\File1.php - // C:\matched\dir1\Relative\Path\To\File2.php - // C:\matched\dir2\Relative\Path\To\File3.php - // C:\matched\dir2\Relative\Path\To\File4.php - - $files = array(); - $currentDir = ''; - foreach ($lines as $line) { - if (':' === substr($line, -1)) { - $currentDir = trim($line, ' :/').'/'; - continue; - } - - $files[] = $currentDir.$line; - } - - return $files; - } - - private function findUsingGrep(array $dirs) - { - $cmd = self::$grepPath; - - if (!$this->regexPattern) { - $cmd .= ' --fixed-strings'; - } else { - $cmd .= ' --extended-regexp'; - } - - if ($this->recursive) { - $cmd .= ' --directories=recurse'; - } else { - $cmd .= ' --directories=skip'; - } - - $cmd .= ' --devices=skip --files-with-matches --with-filename --max-count=1 --color=never --include='.$this->filePattern; - $cmd .= ' '.escapeshellarg($this->pattern); - - foreach ($dirs as $dir) { - $cmd .= ' '.escapeshellarg($dir); - } - exec($cmd, $files, $exitCode); - - if (1 === $exitCode) { - return array(); - } - - if (0 !== $exitCode) { - throw new RuntimeException(sprintf('Command "%s" exited with non-successful status code "%d".', $cmd, $exitCode)); - } - - return $files; - } - - private function findUsingFinder(array $dirs) - { - $finder = new Finder(); - $pattern = $this->pattern; - $regex = $this->regexPattern; - $finder - ->files() - ->name($this->filePattern) - ->in($dirs) - ->ignoreVCS(true) - ->filter(function($file) use ($pattern, $regex) { - if (!$regex) { - return false !== strpos(file_get_contents($file->getPathName()), $pattern); - } - - return 0 < preg_match('#'.$pattern.'#', file_get_contents($file->getPathName())); - }) - ; - - if (!$this->recursive) { - $finder->depth('<= 0'); - } - - return array_keys(iterator_to_array($finder)); - } - - private static function determineMethod() - { - $finder = new ExecutableFinder(); - $isWindows = 0 === stripos(PHP_OS, 'win'); - - if (!$isWindows && self::$grepPath = $finder->find('grep')) { - self::$method = self::METHOD_GREP; - } else if ($isWindows) { - self::$method = self::METHOD_FINDSTR; - } else { - self::$method = self::METHOD_FINDER; - } - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Generator/DefinitionInjectorGenerator.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Generator/DefinitionInjectorGenerator.php deleted file mode 100644 index 3bfea60..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Generator/DefinitionInjectorGenerator.php +++ /dev/null @@ -1,192 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Generator; - -use CG\Generator\Writer; -use Symfony\Component\DependencyInjection\Parameter; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Definition; - -/** - * Generates lightweight code for injecting a single definition. - * - * @author Johannes M. Schmitt - */ -class DefinitionInjectorGenerator -{ - private $nameGenerator; - private $inlinedDefinitions; - - public function __construct() - { - $this->nameGenerator = new NameGenerator(); - $this->inlinedDefinitions = new \SplObjectStorage(); - } - - public function generate(Definition $def) - { - $writer = new Writer(); - - $writer - ->writeln('writeln('/**') - ->writeln(' * This code has been auto-generated by the JMSDiExtraBundle.') - ->writeln(' *') - ->writeln(' * Manual changes to it will be lost.') - ->writeln(' */') - ->writeln('return function($container) {') - ->indent() - ; - - if ($file = $def->getFile()) { - $writer->writeln('require_once '.var_export($file, true).';'); - - require_once $file; - } - - foreach ($this->getInlineDefinitions($def) as $inlineDef) { - $name = $this->nameGenerator->nextName(); - $this->inlinedDefinitions[$inlineDef] = $name; - - $writer->writeln('$'.$name.' = new \\'.$inlineDef->getClass().$this->dumpArguments($inlineDef->getArguments()).';'); - } - - $writer->writeln('$instance = new \\'.$def->getClass().$this->dumpArguments($def->getArguments()).';'); - - foreach ($def->getMethodCalls() as $call) { - list($method, $arguments) = $call; - $writer->writeln('$instance->'.$method.$this->dumpArguments($arguments).';'); - } - - $ref = new \ReflectionClass($def->getClass()); - foreach ($def->getProperties() as $property => $value) { - $refProperty = $this->getReflectionProperty($ref, $property); - - if ($refProperty->isPublic()) { - $writer->writeln('$instance->'.$property.' = '.$this->dumpValue($value).';'); - } else { - $writer - ->writeln(sprintf("\$refProperty = new \ReflectionProperty(%s, %s);", var_export($refProperty->getDeclaringClass()->getName(), true), var_export($property, true))) - ->writeln('$refProperty->setAccessible(true);') - ->writeln('$refProperty->setValue($instance, '.$this->dumpValue($value).');') - ; - } - } - - if (method_exists($def, 'getInitMethod') && $def->getInitMethod()) { - $writer->writeln('$instance->'.$def->getInitMethod().'();'); - } - - $writer - ->writeln('return $instance;') - ->outdent() - ->writeln('};') - ; - - return $writer->getContent(); - } - - private function getReflectionProperty($ref, $property) - { - $origClass = $ref->getName(); - while (!$ref->hasProperty($property) && false !== $ref = $ref->getParentClass()); - - if (!$ref->hasProperty($property)) { - throw new \RuntimeException(sprintf('Could not find property "%s" anywhere in class "%s" or one of its parents.', $property, $origName)); - } - - return $ref->getProperty($property); - } - - private function getInlineDefinitions(Definition $def) - { - $defs = new \SplObjectStorage(); - $this->getDefinitionsFromArray($def->getArguments(), $defs); - $this->getDefinitionsFromArray($def->getMethodCalls(), $defs); - $this->getDefinitionsFromArray($def->getProperties(), $defs); - - return $defs; - } - - private function getDefinitionsFromArray(array $a, \SplObjectStorage $defs) - { - foreach ($a as $k => $v) { - if ($v instanceof Definition) { - $defs->attach($v); - } else if (is_array($v)) { - $this->getDefinitionsFromArray($v, $defs); - } - } - } - - private function dumpArguments(array $arguments) - { - $code = '('; - - $first = true; - foreach ($arguments as $argument) { - if (!$first) { - $code .= ', '; - } - $first = false; - - $code .= $this->dumpValue($argument); - } - - return $code.')'; - } - - private function dumpValue($value) - { - if (is_array($value)) { - $code = 'array('; - - $first = true; - foreach ($value as $k => $v) { - if (!$first) { - $code .= ', '; - } - $first = false; - - $code .= sprintf('%s => %s', var_export($k, true), $this->dumpValue($v)); - } - - return $code.')'; - } else if ($value instanceof Reference) { - if ('service_container' === (string) $value) { - return '$container'; - } - - return sprintf('$container->get(%s, %d)', var_export((string) $value, true), $value->getInvalidBehavior()); - } else if ($value instanceof Parameter) { - return sprintf('$container->getParameter(%s)', var_export((string) $value, true)); - } else if (is_scalar($value) || null === $value) { - // we do not support embedded parameters - if (is_string($value) && '%' === $value[0] && '%' !== $value[1]) { - return sprintf('$container->getParameter(%s)', var_export(substr($value, 1, -1), true)); - } - - return var_export($value, true); - } else if ($value instanceof Definition) { - return sprintf('$%s', $this->inlinedDefinitions[$value]); - } - - throw new \RuntimeException(sprintf('Found unsupported value of type %s during definition injector generation: "%s"', gettype($value), json_encode($value))); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Generator/LookupMethodClassGenerator.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Generator/LookupMethodClassGenerator.php deleted file mode 100644 index 54b02cf..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Generator/LookupMethodClassGenerator.php +++ /dev/null @@ -1,119 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Generator; - -use Metadata\ClassHierarchyMetadata; -use CG\Generator\PhpParameter; -use CG\Generator\PhpMethod; -use CG\Generator\PhpProperty; -use CG\Generator\PhpClass; -use CG\Proxy\GeneratorInterface; -use Symfony\Component\DependencyInjection\Parameter; -use Symfony\Component\DependencyInjection\Reference; - -class LookupMethodClassGenerator implements GeneratorInterface -{ - const PREFIX = '__jmsDiExtra_'; - - private $metadata; - private $requiredFile; - - public function __construct(ClassHierarchyMetadata $metadata) - { - $this->metadata = $metadata; - } - - public function setRequiredFile($file) - { - $this->requiredFile = $file; - } - - public function generate(\ReflectionClass $class, PhpClass $genClass) - { - if (!empty($this->requiredFile)) { - $genClass->addRequiredFile($this->requiredFile); - } - - $genClass->setProperty(PhpProperty::create() - ->setName(self::PREFIX.'container') - ->setVisibility('private') - ); - - $genClass->setMethod(PhpMethod::create() - ->setName(self::PREFIX.'setContainer') - ->addParameter(PhpParameter::create() - ->setName('container') - ->setType('Symfony\Component\DependencyInjection\ContainerInterface') - ) - ->setBody('$this->'.self::PREFIX.'container = $container;') - ); - - $genClass->addInterfaceName('JMS\DiExtraBundle\DependencyInjection\LookupMethodClassInterface'); - $genClass->setMethod(PhpMethod::create() - ->setName(self::PREFIX.'getOriginalClassName') - ->setFinal(true) - ->setBody('return '.var_export($class->name, true).';') - ); - - foreach ($this->getLookupMethods() as $name => $value) { - $genClass->setMethod(PhpMethod::fromReflection($class->getMethod($name)) - ->setAbstract(false) - ->setBody('return '.$this->dumpValue($value).';') - ->setDocblock(null) - ); - } - } - - private function getLookupMethods() - { - $outerClass = $this->metadata->getOutsideClassMetadata()->reflection; - $lookupMethods = array(); - foreach ($this->metadata->classMetadata as $classMetadata) { - if (!$classMetadata->lookupMethods) { - continue; - } - - foreach ($classMetadata->lookupMethods as $name => $value) { - // check if method has been overridden - if ($outerClass->getMethod($name)->class !== $classMetadata->reflection->name) { - continue; - } - - $lookupMethods[$name] = $value; - } - } - - return $lookupMethods; - } - - private function dumpValue($value) - { - if ($value instanceof Parameter) { - return '$this->'.self::PREFIX.'container->getParameter('.var_export((string) $value, true).')'; - } else if ($value instanceof Reference) { - return '$this->'.self::PREFIX.'container->get('.var_export((string) $value, true).', '.var_export($value->getInvalidBehavior(), true).')'; - } else if (is_string($value) && '%' === $value[0]) { - return '$this->'.self::PREFIX.'container->getParameter('.var_export(substr($value, 1, -1), true).')'; - } else if (is_array($value) || is_scalar($value) || null === $value) { - return var_export($value, true); - } - - throw new \RuntimeException(sprintf('Invalid value for lookup method: %s', json_encode($value))); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Generator/NameGenerator.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Generator/NameGenerator.php deleted file mode 100644 index df3c1c8..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Generator/NameGenerator.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Generator; - -class NameGenerator -{ - private $count = 0; - private $firstChars = 'abcdefghijklmnopqrstuvwxyz'; - private $firstCharsLength = 26; - private $nonFirstChars = 'abcdefghijklmnopqrstuvwxyz0123456789_'; - private $nonFirstCharsLength = 37; - private $reservedNames = array(); - - public function addReservedName($name) - { - $this->reservedNames[$name] = true; - } - - public function setFirstChars($chars) - { - $this->firstChars = $chars; - $this->firstCharsLength = strlen($chars); - } - - public function setNonFirstChars($chars) - { - $this->nonFirstChars = $chars; - $this->nonFirstCharsLength = strlen($chars); - } - - public function reset() - { - $this->count = 0; - } - - public function nextName() - { - while (true) { - $name = ''; - $i = $this->count; - - if ('' === $name) { - $name .= $this->firstChars[$i%$this->firstCharsLength]; - $i = intval($i/$this->firstCharsLength); - } - - while ($i > 0) { - $i -= 1; - $name .= $this->nonFirstChars[$i%$this->nonFirstCharsLength]; - $i = intval($i/$this->nonFirstCharsLength); - } - - $this->count += 1; - - // check that the name is not reserved - if (isset($this->reservedNames[$name])) { - continue; - } - - return $name; - } - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/HttpKernel/ControllerResolver.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/HttpKernel/ControllerResolver.php deleted file mode 100644 index f1a48ce..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/HttpKernel/ControllerResolver.php +++ /dev/null @@ -1,179 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\HttpKernel; - -use Metadata\ClassHierarchyMetadata; -use JMS\DiExtraBundle\Metadata\ClassMetadata; -use CG\Core\DefaultNamingStrategy; -use CG\Proxy\Enhancer; -use JMS\AopBundle\DependencyInjection\Compiler\PointcutMatchingPass; -use JMS\DiExtraBundle\Generator\DefinitionInjectorGenerator; -use JMS\DiExtraBundle\Generator\LookupMethodClassGenerator; -use JMS\DiExtraBundle\DependencyInjection\Dumper\PhpDumper; -use Metadata\MetadataFactory; -use Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass; -use Symfony\Component\DependencyInjection\Parameter; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\Config\ConfigCache; -use Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver as BaseControllerResolver; - -class ControllerResolver extends BaseControllerResolver -{ - protected function createController($controller) - { - if (false === $pos = strpos($controller, '::')) { - $count = substr_count($controller, ':'); - if (2 == $count) { - // controller in the a:b:c notation then - $controller = $this->parser->parse($controller); - $pos = strpos($controller, '::'); - } elseif (1 == $count) { - // controller in the service:method notation - list($service, $method) = explode(':', $controller); - - return array($this->container->get($service), $method); - } else { - throw new \LogicException(sprintf('Unable to parse the controller name "%s".', $controller)); - } - } - - $class = substr($controller, 0, $pos); - $method = substr($controller, $pos+2); - - if (!class_exists($class)) { - throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class)); - } - - $filename = $this->container->getParameter('jms_di_extra.cache_dir').'/controller_injectors/'.str_replace('\\', '', $class).'.php'; - $cache = new ConfigCache($filename, $this->container->getParameter('kernel.debug')); - - if (!$cache->isFresh()) { - $metadata = $this->container->get('jms_di_extra.metadata.metadata_factory')->getMetadataForClass($class); - if (null === $metadata) { - $metadata = new ClassHierarchyMetadata(); - $metadata->addClassMetadata(new ClassMetadata($class)); - } - - $this->prepareContainer($cache, $filename, $metadata); - } - - $inject = require $filename; - $controller = $inject($this->container); - - if ($controller instanceof ContainerAwareInterface) { - $controller->setContainer($this->container); - } - - return array($controller, $method); - } - - private function prepareContainer($cache, $containerFilename, $metadata) - { - $container = new ContainerBuilder(); - $container->setParameter('jms_aop.cache_dir', $this->container->getParameter('jms_di_extra.cache_dir')); - $def = $container - ->register('jms_aop.interceptor_loader', 'JMS\AopBundle\Aop\InterceptorLoader') - ->addArgument(new Reference('service_container')) - ->setPublic(false) - ; - - // add resources - $ref = $metadata->getOutsideClassMetadata()->reflection; - while ($ref && false !== $filename = $ref->getFilename()) { - $container->addResource(new FileResource($filename)); - $ref = $ref->getParentClass(); - } - - // add definitions - $definitions = $this->container->get('jms_di_extra.metadata.converter')->convert($metadata); - $serviceIds = $parameters = array(); - - $controllerDef = array_pop($definitions); - $container->setDefinition('controller', $controllerDef); - - foreach ($definitions as $id => $def) { - $container->setDefinition($id, $def); - } - - $this->generateLookupMethods($controllerDef, $metadata); - - $config = $container->getCompilerPassConfig(); - $config->setOptimizationPasses(array()); - $config->setRemovingPasses(array()); - $config->addPass(new ResolveDefinitionTemplatesPass()); - $config->addPass(new PointcutMatchingPass($this->container->get('jms_aop.pointcut_container')->getPointcuts())); - $config->addPass(new InlineServiceDefinitionsPass()); - $container->compile(); - - if (!file_exists($dir = dirname($containerFilename))) { - if (false === @mkdir($dir, 0777, true)) { - throw new \RuntimeException(sprintf('Could not create directory "%s".', $dir)); - } - } - - static $generator; - if (null === $generator) { - $generator = new DefinitionInjectorGenerator(); - } - - $cache->write($generator->generate($container->getDefinition('controller')), $container->getResources()); - } - - private function generateLookupMethods($def, $metadata) - { - $found = false; - foreach ($metadata->classMetadata as $cMetadata) { - if (!empty($cMetadata->lookupMethods)) { - $found = true; - break; - } - } - - if (!$found) { - return; - } - - $generator = new LookupMethodClassGenerator($metadata); - $outerClass = $metadata->getOutsideClassMetadata()->reflection; - - if ($file = $def->getFile()) { - $generator->setRequiredFile($file); - } - - $enhancer = new Enhancer( - $outerClass, - array(), - array( - $generator, - ) - ); - - $filename = $this->container->getParameter('jms_di_extra.cache_dir').'/lookup_method_classes/'.str_replace('\\', '-', $outerClass->name).'.php'; - $enhancer->writeClass($filename); - - $def->setFile($filename); - $def->setClass($enhancer->getClassName($outerClass)); - $def->addMethodCall('__jmsDiExtra_setContainer', array(new Reference('service_container'))); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/JMSDiExtraBundle.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/JMSDiExtraBundle.php deleted file mode 100644 index 6a88dbe..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/JMSDiExtraBundle.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle; - -use JMS\DiExtraBundle\DependencyInjection\Compiler\ResourceOptimizationPass; -use JMS\DiExtraBundle\DependencyInjection\Compiler\IntegrationPass; -use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\DependencyInjection\Compiler\PassConfig; -use JMS\DiExtraBundle\DependencyInjection\Compiler\AnnotationConfigurationPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\HttpKernel\Bundle\Bundle; - -class JMSDiExtraBundle extends Bundle -{ - const VERSION = '1.0.1'; - - private $kernel; - - public function __construct(KernelInterface $kernel) - { - $this->kernel = $kernel; - } - - public function build(ContainerBuilder $container) - { - $config = $container->getCompiler()->getPassConfig(); - $passes = $config->getBeforeOptimizationPasses(); - array_unshift($passes, new AnnotationConfigurationPass($this->kernel)); - $config->setBeforeOptimizationPasses($passes); - - $container->addCompilerPass(new IntegrationPass()); - $container->addCompilerPass(new ResourceOptimizationPass(), PassConfig::TYPE_AFTER_REMOVING); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Metadata/ClassMetadata.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Metadata/ClassMetadata.php deleted file mode 100644 index 7b992d9..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Metadata/ClassMetadata.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Metadata; - -use Metadata\ClassMetadata as BaseClassMetadata; - -class ClassMetadata extends BaseClassMetadata -{ - public $id; - public $parent; - public $scope; - public $public; - public $abstract; - public $tags = array(); - public $arguments; - public $methodCalls = array(); - public $lookupMethods = array(); - public $properties = array(); - public $initMethod; - - public function serialize() - { - return serialize(array( - $this->id, - $this->parent, - $this->scope, - $this->public, - $this->abstract, - $this->tags, - $this->arguments, - $this->methodCalls, - $this->lookupMethods, - $this->properties, - $this->initMethod, - parent::serialize(), - )); - } - - public function unserialize($str) - { - list( - $this->id, - $this->parent, - $this->scope, - $this->public, - $this->abstract, - $this->tags, - $this->arguments, - $this->methodCalls, - $this->lookupMethods, - $this->properties, - $this->initMethod, - $parentStr - ) = unserialize($str); - - parent::unserialize($parentStr); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Metadata/Driver/AnnotationDriver.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Metadata/Driver/AnnotationDriver.php deleted file mode 100644 index cbd2051..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Metadata/Driver/AnnotationDriver.php +++ /dev/null @@ -1,220 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Metadata\Driver; - -use JMS\DiExtraBundle\Annotation\AfterSetup; - -use JMS\DiExtraBundle\Annotation\FormType; - -use JMS\DiExtraBundle\Annotation\DoctrineListener; -use JMS\DiExtraBundle\Annotation\Reference as AnnotReference; -use JMS\DiExtraBundle\Annotation\LookupMethod; -use JMS\DiExtraBundle\Annotation\Validator; -use JMS\DiExtraBundle\Annotation\InjectParams; -use JMS\DiExtraBundle\Exception\InvalidTypeException; -use JMS\DiExtraBundle\Annotation\Observe; -use Doctrine\Common\Annotations\Reader; -use JMS\DiExtraBundle\Annotation\Inject; -use JMS\DiExtraBundle\Annotation\Service; -use JMS\DiExtraBundle\Annotation\Tag; -use JMS\DiExtraBundle\Metadata\ClassMetadata; -use Metadata\Driver\DriverInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Reference; - -class AnnotationDriver implements DriverInterface -{ - private $reader; - - public function __construct(Reader $reader) - { - $this->reader = $reader; - } - - public function loadMetadataForClass(\ReflectionClass $class) - { - $metadata = new ClassMetadata($className = $class->getName()); - if (false !== $filename = $class->getFilename()) { - $metadata->fileResources[] = $filename; - } - - // this is a bit of a hack, but avoids any timeout issues when a class - // is moved into one of the compiled classes files, and Doctrine - // Common 2.1 is used. - if (false !== strpos($filename, '/classes.php') - || false !== strpos($filename, '/bootstrap.php')) { - return null; - } - - foreach ($this->reader->getClassAnnotations($class) as $annot) { - if ($annot instanceof Service) { - if (null === $annot->id) { - $metadata->id = $this->generateId($className); - } else { - $metadata->id = $annot->id; - } - - $metadata->parent = $annot->parent; - $metadata->public = $annot->public; - $metadata->scope = $annot->scope; - $metadata->abstract = $annot->abstract; - } else if ($annot instanceof Tag) { - $metadata->tags[$annot->name][] = $annot->attributes; - } else if ($annot instanceof Validator) { - // automatically register as service if not done explicitly - if (null === $metadata->id) { - $metadata->id = $this->generateId($className); - } - - $metadata->tags['validator.constraint_validator'][] = array( - 'alias' => $annot->alias, - ); - } else if ($annot instanceof DoctrineListener) { - if (null === $metadata->id) { - $metadata->id = $this->generateId($className); - } - - foreach ($annot->events as $event) { - $metadata->tags['doctrine.event_listener'][] = array( - 'event' => $event, - 'connection' => $annot->connection ?: 'default', - 'lazy' => $annot->lazy, - 'priority' => $annot->priority, - ); - } - } else if ($annot instanceof FormType) { - if (null === $metadata->id) { - $metadata->id = $this->generateId($className); - } - - $alias = $annot->alias; - - // try to extract it from the class itself - if (null === $alias) { - $instance = unserialize(sprintf('O:%d:"%s":0:{}', strlen($className), $className)); - $alias = $instance->getName(); - } - - $metadata->tags['form.type'][] = array( - 'alias' => $alias, - ); - } - } - - $hasInjection = false; - foreach ($class->getProperties() as $property) { - if ($property->getDeclaringClass()->getName() !== $className) { - continue; - } - $name = $property->getName(); - - foreach ($this->reader->getPropertyAnnotations($property) as $annot) { - if ($annot instanceof Inject) { - $hasInjection = true; - $metadata->properties[$name] = $this->convertReferenceValue($name, $annot); - } - } - } - - foreach ($class->getMethods() as $method) { - if ($method->getDeclaringClass()->getName() !== $className) { - continue; - } - $name = $method->getName(); - - foreach ($this->reader->getMethodAnnotations($method) as $annot) { - if ($annot instanceof Observe) { - $metadata->tags['kernel.event_listener'][] = array( - 'event' => $annot->event, - 'method' => $name, - 'priority' => $annot->priority, - ); - } else if ($annot instanceof InjectParams) { - $params = array(); - foreach ($method->getParameters() as $param) { - if (!isset($annot->params[$paramName = $param->getName()])) { - $params[] = $this->convertReferenceValue($paramName, new Inject(array('value' => null))); - continue; - } - - $params[] = $this->convertReferenceValue($paramName, $annot->params[$paramName]); - } - - if (!$params) { - continue; - } - - $hasInjection = true; - - if ('__construct' === $name) { - $metadata->arguments = $params; - } else { - $metadata->methodCalls[] = array($name, $params); - } - } else if ($annot instanceof LookupMethod) { - $hasInjection = true; - - if ($method->isFinal()) { - throw new \RuntimeException(sprintf('The method "%s::%s" is marked as final and cannot be declared as lookup-method.', $className, $name)); - } - if ($method->isPrivate()) { - throw new \RuntimeException(sprintf('The method "%s::%s" is marked as private and cannot be declared as lookup-method.', $className, $name)); - } - if ($method->getParameters()) { - throw new \RuntimeException(sprintf('The method "%s::%s" must have a no-arguments signature if you want to use it as lookup-method.', $className, $name)); - } - - $metadata->lookupMethods[$name] = $this->convertReferenceValue('get' === substr($name, 0, 3) ? substr($name, 3) : $name, $annot); - } else if ($annot instanceof AfterSetup) { - if (!$method->isPublic()) { - throw new \RuntimeException(sprintf('The init method "%s::%s" must be public.', $method->class, $method->name)); - } - - $metadata->initMethod = $method->name; - } - } - } - - if (null == $metadata->id && !$hasInjection) { - return null; - } - - return $metadata; - } - - private function convertReferenceValue($name, AnnotReference $annot) - { - if (null === $annot->value) { - return new Reference($this->generateId($name), false !== $annot->required ? ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE : ContainerInterface::NULL_ON_INVALID_REFERENCE); - } - - if (false === strpos($annot->value, '%')) { - return new Reference($annot->value, false !== $annot->required ? ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE : ContainerInterface::NULL_ON_INVALID_REFERENCE); - } - - return $annot->value; - } - - private function generateId($name) - { - $name = preg_replace('/(?<=[a-zA-Z0-9])[A-Z]/', '_\\0', $name); - - return strtolower(strtr($name, '\\', '.')); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Metadata/MetadataConverter.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Metadata/MetadataConverter.php deleted file mode 100644 index a4f8ea5..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Metadata/MetadataConverter.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Metadata; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\Definition; -use Metadata\ClassHierarchyMetadata; - -class MetadataConverter -{ - /** - * Converts class hierarchy metadata to definition instances. - * - * @param ClassHierarchyMetadata $metadata - * @return array an array of Definition instances - */ - public function convert(ClassHierarchyMetadata $metadata) - { - static $count = 0; - $definitions = array(); - - $previous = null; - foreach ($metadata->classMetadata as $classMetadata) { - if (null === $previous && null === $classMetadata->parent) { - $definition = new Definition(); - } else { - $definition = new DefinitionDecorator( - $classMetadata->parent ?: $previous->id - ); - } - - $definition->setClass($classMetadata->name); - if (null !== $classMetadata->scope) { - $definition->setScope($classMetadata->scope); - } - if (null !== $classMetadata->public) { - $definition->setPublic($classMetadata->public); - } - if (null !== $classMetadata->abstract) { - $definition->setAbstract($classMetadata->abstract); - } - if (null !== $classMetadata->arguments) { - $definition->setArguments($classMetadata->arguments); - } - - $definition->setMethodCalls($classMetadata->methodCalls); - $definition->setTags($classMetadata->tags); - $definition->setProperties($classMetadata->properties); - - if (null === $classMetadata->id) { - $classMetadata->id = '_jms_di_extra.unnamed.service_'.$count++; - } - - if ($classMetadata->initMethod) { - if (!method_exists($definition, 'setInitMethod')) { - throw new \RuntimeException(sprintf('@AfterSetup is not available on your Symfony version.')); - } - - $definition->setInitMethod($classMetadata->initMethod); - } - - $definitions[$classMetadata->id] = $definition; - $previous = $classMetadata; - } - - return $definitions; - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/README b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/README deleted file mode 100644 index 72bab21..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/README +++ /dev/null @@ -1,8 +0,0 @@ -For documentation, see: - - Resources/doc - - -For license, see: - - Resources/meta/LICENSE \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Resources/config/services.xml b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Resources/config/services.xml deleted file mode 100644 index c1ac0d4..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Resources/config/services.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - JMS\DiExtraBundle\Metadata\Driver\AnnotationDriver - - Metadata\MetadataFactory - Metadata\Cache\FileCache - - JMS\DiExtraBundle\Metadata\MetadataConverter - JMS\DiExtraBundle\HttpKernel\ControllerResolver - - JMS\DiExtraBundle\EventListener\TemplateListener - JMS\DiExtraBundle\EventListener\ControllerListener - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Resources/doc/index.rst b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Resources/doc/index.rst deleted file mode 100644 index 9b7ece5..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Resources/doc/index.rst +++ /dev/null @@ -1,290 +0,0 @@ -======== -Overview -======== - -This bundle allows you to configure dependency injection using annotations. - -Installation ------------- -Add the following to your ``deps`` file:: - - [JMSDiExtraBundle] - git=https://github.com/schmittjoh/JMSDiExtraBundle.git - target=/bundles/JMS/DiExtraBundle - - ; Dependencies: - ;-------------- - [metadata] - git=https://github.com/schmittjoh/metadata.git - version=1.1.0 ; <- make sure to get 1.1, not 1.0 - -Then register the bundle with your kernel:: - - // in AppKernel::registerBundles() - $bundles = array( - // ... - new JMS\DiExtraBundle\JMSDiExtraBundle($this), - // ... - ); - -In addition, this bundle also requires the JMSAopBundle. See its documentation for -installation instructions:: - - https://github.com/schmittjoh/JMSAopBundle/blob/master/Resources/doc/index.rst - - -Make sure that you also register the namespaces with the autoloader:: - - // app/autoload.php - $loader->registerNamespaces(array( - // ... - 'JMS' => __DIR__.'/../vendor/bundles', - 'Metadata' => __DIR__.'/../vendor/metadata/src', - // ... - )); - - -Configuration -------------- -For optimal development performance (in production there is no difference either way), -it is recommended to explicitly configure the directories which should be scanned for -service classes (by default no directory is scanned):: - - jms_di_extra: - locations: - all_bundles: false - bundles: [FooBundle, AcmeBlogBundle, etc.] - directories: [%kernel.root_dir%/../src, some/other/dir] - -Usage ------ - -Non-Controller Classes -~~~~~~~~~~~~~~~~~~~~~~ - -Non-controller classes are configured, and managed by Symfony's DIC just like any -other service that you configure using YML, XML, or PHP. The only difference is -that you can do it via annotations which is a lot more convenient. - -You can use these annotations on services (for examples, see below): -@Service, @Inject, @InjectParams, @Observe, @Tag - -Note that you cannot use the @Inject annotation on private, or protected properties. -Likewise, the @InjectParams annotation does not work on protected, or private methods. - - -Controllers -~~~~~~~~~~~ - -Controllers are a special type of class which is also treated specially by this -bundle. The most notable difference is that you do not need to define these -classes as services. Yes, no services, but don't worry you can still use all of -the DIC's features, and even some more. - -- Constructor/Setter Injection:: - - em = $em; - $this->session = $session; - } - // ... some actions - } - - **Note:** Constructor Injection is not possible when a parent definition - also defines a constructor which is configured for injection. - -- Property Injection:: - - getMailer(); - } - } - - /** @DI\LookupMethod("mailer") */ - protected function getMailer() { /* empty body here */ } - } - -You can use this type of injection if you have a dependency that you do not -always need in the controller, and which is costly to initialize, like the -mailer in the example above. - - -Annotations ------------ - -@Inject -~~~~~~~~~ -This marks a property, or parameter for injection:: - - use JMS\DiExtraBundle\Annotation\Inject; - - class Controller - { - /** - * @Inject("security.context", required = false) - */ - private $securityContext; - - /** - * @Inject("%kernel.cache_dir%") - */ - private $cacheDir; - - /** - * @Inject - */ - private $session; - } - -If you do not specify the service explicitly, we will try to guess it based on the name -of the property or the parameter. - -@InjectParams -~~~~~~~~~~~~~~~ -This marks the parameters of a method for injection:: - - use JMS\DiExtraBundle\Annotation\Inject; - use JMS\DiExtraBundle\Annotation\InjectParams; - use JMS\DiExtraBundle\Annotation\Service; - - /** - * @Service - */ - class Listener - { - /** - * @InjectParams({ - * "em" = @Inject("doctrine.entity_manager") - * }) - */ - public function __construct(EntityManager $em, Session $session) - { - // ... - } - } - -If you don't define all parameters in the param map, we will try to guess which services -should be injected into the remaining parameters based on their name. - -@Service -~~~~~~~~ -Marks a class as service:: - - use JMS\DiExtraBundle\Annotation\Service; - - /** - * @Service("some.service.id", parent="another.service.id", public=false) - */ - class Listener - { - } - -If you do not explicitly define a service id, then we will generated a sensible default -based on the fully qualified class name for you. - -@Tag -~~~~ -Adds a tag to the service:: - - use JMS\DiExtraBundle\Annotation\Service; - use JMS\DiExtraBundle\Annotation\Tag; - - /** - * @Service - * @Tag("doctrine.event_listener", attributes = {"event" = "postGenerateSchema", lazy=true}) - */ - class Listener - { - // ... - } - -@Observe -~~~~~~~~ -Automatically registers a method as listener to a certain event:: - - use JMS\DiExtraBundle\Annotation\Observe; - use JMS\DiExtraBundle\Annotation\Service; - - /** - * @Service - */ - class RequestListener - { - /** - * @Observe("kernel.request", priority = 255) - */ - public function onKernelRequest() - { - // ... - } - } - -@Validator -~~~~~~~~~~ -Automatically registers the given class as constraint validator for the Validator component:: - - use JMS\DiExtraBundle\Annotation\Validator; - use Symfony\Component\Validator\Constraint; - use Symfony\Component\Validator\ConstraintValidator; - - /** - * @Validator("my_alias") - */ - class MyValidator extends ConstraintValidator - { - // ... - } - - class MyConstraint extends Constraint - { - // ... - public function validatedBy() - { - return 'my_alias'; - } - } - -The @Validator annotation also implies the @Service annotation if you do not specify it explicitly. -The alias which is passed to the @Validator annotation must match the string that is returned from -the ``validatedBy`` method of your constraint. - diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Resources/meta/LICENSE b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Resources/meta/LICENSE deleted file mode 100644 index 753842b..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Resources/meta/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/DependencyInjection/Compiler/AnnotationConfigurationPassTest.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/DependencyInjection/Compiler/AnnotationConfigurationPassTest.php deleted file mode 100644 index 37c518a..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/DependencyInjection/Compiler/AnnotationConfigurationPassTest.php +++ /dev/null @@ -1,127 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference; - -use Symfony\Component\DependencyInjection\DefinitionDecorator; - -use Doctrine\Common\Annotations\AnnotationReader; -use JMS\DiExtraBundle\DependencyInjection\JMSDiExtraExtension; -use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use JMS\DiExtraBundle\DependencyInjection\Compiler\AnnotationConfigurationPass; - -class AnnotationConfigurationPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcess() - { - $container = $this->getContainer(array(), array( - __DIR__.'/../../Fixture/', - )); - $container->set('doctrine.entity_manager', $em = new \stdClass); - $container->set('session', $session = new \stdClass); - $container->set('database_connection', $dbCon = new \stdClass); - $container->set('router', $router = new \stdClass); - $container->setParameter('table_name', 'foo'); - $this->process($container); - - $this->assertTrue($container->hasDefinition('j_m_s.di_extra_bundle.tests.fixture.request_listener')); - $service = $container->get('j_m_s.di_extra_bundle.tests.fixture.request_listener'); - $this->assertAttributeEquals($em, 'em', $service); - $this->assertAttributeEquals($session, 'session', $service); - $this->assertAttributeEquals($dbCon, 'con', $service); - $this->assertAttributeEquals($router, 'router', $service); - $this->assertAttributeEquals('foo', 'table', $service); - } - - public function testProcessValidator() - { - $container = $this->getContainer(array(), array( - __DIR__.'/../../Fixture/Validator', - )); - $container->set('foo', $foo = new \stdClass); - $this->process($container); - - $this->assertTrue($container->hasDefinition('j_m_s.di_extra_bundle.tests.fixture.validator.validator')); - - $def = $container->getDefinition('j_m_s.di_extra_bundle.tests.fixture.validator.validator'); - $this->assertEquals(array( - 'validator.constraint_validator' => array( - array('alias' => 'foobar'), - ) - ), $def->getTags()); - - $v = $container->get('j_m_s.di_extra_bundle.tests.fixture.validator.validator'); - $this->assertAttributeEquals($foo, 'foo', $v); - } - - public function testConstructorWithInheritance() - { - $container = $this->getContainer(array(), array( - __DIR__.'/../../Functional/Bundle/TestBundle/Inheritance', - )); - $container->set('foo', $foo = new \stdClass); - $container->set('bar', $bar = new \stdClass); - $this->process($container); - - $this->assertTrue($container->hasDefinition('concrete_class')); - $this->assertTrue($container->hasDefinition('abstract_class')); - - $def = new DefinitionDecorator('abstract_class'); - $def->setClass('JMS\DiExtraBundle\Tests\Functional\Bundle\TestBundle\Inheritance\ConcreteClass'); - $def->addArgument(new Reference('foo')); - $def->addArgument(new Reference('bar')); - - $this->assertEquals($def, $container->getDefinition('concrete_class')); - } - - private function getContainer(array $bundles = array(), array $directories = array()) - { - $container = new ContainerBuilder(); - $container->set('annotation_reader', new AnnotationReader()); - $container->setParameter('kernel.debug', false); - - $extension = new JMSDiExtraExtension(); - $extension->load(array(array( - 'locations' => array( - 'bundles' => $bundles, - 'directories' => $directories, - ), - 'metadata' => array( - 'cache' => 'none', - ) - )), $container); - - return $container; - } - - private function process(ContainerBuilder $container, array $bundles = array()) - { - $kernel = $this->getMock('Symfony\Component\HttpKernel\KernelInterface'); - $kernel - ->expects($this->once()) - ->method('getBundles') - ->will($this->returnValue($bundles)) - ; - - $pass = new AnnotationConfigurationPass($kernel); - $pass->process($container); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/DependencyInjection/Compiler/Fixtures/a/b/.gitkeep b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/DependencyInjection/Compiler/Fixtures/a/b/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/DependencyInjection/Compiler/Fixtures/c/.gitkeep b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/DependencyInjection/Compiler/Fixtures/c/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/DependencyInjection/Compiler/ResourceOptimizationPassTest.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/DependencyInjection/Compiler/ResourceOptimizationPassTest.php deleted file mode 100644 index af86269..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/DependencyInjection/Compiler/ResourceOptimizationPassTest.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use JMS\DiExtraBundle\DependencyInjection\Compiler\ResourceOptimizationPass; -use Symfony\Component\Config\Resource\DirectoryResource; - -class ResourceOptimizationPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcess() - { - $container = new ContainerBuilder(); - $container->addResource(new DirectoryResource(__DIR__.'/Fixtures/a')); - $container->addResource(new DirectoryResource(__DIR__.'/Fixtures/a/b')); - $container->addResource(new DirectoryResource(__DIR__.'/Fixtures/c')); - $this->process($container); - - $resources = $container->getResources(); - $this->assertEquals(1, count($resources)); - $this->assertInstanceOf('JMS\DiExtraBundle\Config\FastDirectoriesResource', $resources[0]); - $this->assertEquals(array( - __DIR__.'/Fixtures/a', - __DIR__.'/Fixtures/c' - ), $resources[0]->getResource()); - $this->assertAttributeEquals('*', 'filePattern', $resources[0]); - } - - private function process(ContainerBuilder $container) - { - $pass = new ResourceOptimizationPass(); - $pass->process($container); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Finder/AbstractPatternFinderTest.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Finder/AbstractPatternFinderTest.php deleted file mode 100644 index bbcdb03..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Finder/AbstractPatternFinderTest.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\Finder; - -use JMS\DiExtraBundle\Finder\PatternFinder; -use Symfony\Component\Process\ExecutableFinder; - -abstract class AbstractPatternFinderTest extends \PHPUnit_Framework_TestCase -{ - public function testFindFiles() - { - $finder = $this->getFinder(); - - $expectedFiles = array( - realpath(__DIR__.'/../Fixture/NonEmptyDirectory/Service1.php'), - realpath(__DIR__.'/../Fixture/NonEmptyDirectory/SubDir1/Service2.php'), - realpath(__DIR__.'/../Fixture/NonEmptyDirectory/SubDir2/Service3.php'), - ); - - $foundFiles = $finder->findFiles(array(__DIR__.'/../Fixture/NonEmptyDirectory')); - $foundFiles = array_map('realpath', $foundFiles); - - $this->assertEquals(array(), array_diff($expectedFiles, $foundFiles)); - $this->assertEquals(array(), array_diff($foundFiles, $expectedFiles)); - } - - public function testFindFilesUsingGrepReturnsEmptyArrayWhenNoMatchesAreFound() - { - $finder = $this->getFinder(); - $this->assertEquals(array(), $finder->findFiles(array(__DIR__.'/../Fixture/EmptyDirectory'))); - } - - abstract protected function getFinder(); -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Finder/FindstrPatternFinderTest.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Finder/FindstrPatternFinderTest.php deleted file mode 100644 index e874edf..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Finder/FindstrPatternFinderTest.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\Finder; - -use JMS\DiExtraBundle\Finder\PatternFinder; - -class FindstrPatternFinderTest extends AbstractPatternFinderTest -{ - protected function getFinder() - { - if (0 !== stripos(PHP_OS, 'win')) { - $this->markTestSkipped('FINDSTR is only available on Windows.'); - } - - $finder = new PatternFinder('JMS\DiExtraBundle\Annotation'); - $ref = new \ReflectionProperty($finder, 'method'); - $ref->setAccessible(true); - $ref->setValue($finder, PatternFinder::METHOD_FINDSTR); - - return $finder; - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Finder/GrepPatternFinderTest.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Finder/GrepPatternFinderTest.php deleted file mode 100644 index fa94199..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Finder/GrepPatternFinderTest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\Finder; - -use JMS\DiExtraBundle\Finder\PatternFinder; - -class GrepPatternFinderTest extends AbstractPatternFinderTest -{ - protected function getFinder() - { - $finder = new PatternFinder('JMS\DiExtraBundle\Annotation'); - - $ref = new \ReflectionProperty($finder, 'grepPath'); - $ref->setAccessible(true); - if (null === $v = $ref->getValue($finder)) { - $this->markTestSkipped('grep is not available on your system.'); - } - - return $finder; - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Finder/PhpPatternFinderTest.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Finder/PhpPatternFinderTest.php deleted file mode 100644 index c3800cc..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Finder/PhpPatternFinderTest.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\Finder; - -use JMS\DiExtraBundle\Finder\PatternFinder; - -class PhpPatternFinderTest extends AbstractPatternFinderTest -{ - protected function getFinder() - { - $finder = new PatternFinder('JMS\DiExtraBundle\Annotation'); - $ref = new \ReflectionProperty($finder, 'method'); - $ref->setAccessible(true); - $ref->setValue($finder, PatternFinder::METHOD_FINDER); - - return $finder; - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/EmptyDirectory/.gitkeep b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/EmptyDirectory/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/LoginController.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/LoginController.php deleted file mode 100644 index 6e8b1bb..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/LoginController.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\Fixture; - -use JMS\DiExtraBundle\Annotation\Inject; - -/** - * Login Controller. - * - * @author Johannes M. Schmitt - */ -class LoginController -{ - /** - * @Inject("form.csrf_provider") - */ - private $csrfProvider; - - /** - * @Inject - */ - private $rememberMeServices; - - /** - * @Inject("security.context") - */ - private $securityContext; - - /** - * @Inject("security.authentication.trust_resolver") - */ - private $trustResolver; - - public function loginAction() - { - } - - public function getCsrfProvider() - { - return $this->csrfProvider; - } - - public function getRememberMeServices() - { - return $this->rememberMeServices; - } - - public function getSecurityContext() - { - return $this->securityContext; - } - - public function getTrustResolver() - { - return $this->trustResolver; - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/NonEmptyDirectory/DummyFile.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/NonEmptyDirectory/DummyFile.php deleted file mode 100644 index fe8dd78..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/NonEmptyDirectory/DummyFile.php +++ /dev/null @@ -1,3 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\Fixture\NonEmptyDirectory; - -use JMS\DiExtraBundle\Annotation as DI; - -/** @DI\Service */ -class Service1 -{ -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/NonEmptyDirectory/SubDir1/NonPhpFile.txt b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/NonEmptyDirectory/SubDir1/NonPhpFile.txt deleted file mode 100644 index 88e0de9..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/NonEmptyDirectory/SubDir1/NonPhpFile.txt +++ /dev/null @@ -1,10 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\Fixture\NonEmptyDirectory\SubDir1; - -use JMS\DiExtraBundle\Annotation\Service; - -/** @Service */ -class Service2 -{ -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/NonEmptyDirectory/SubDir2/Service3.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/NonEmptyDirectory/SubDir2/Service3.php deleted file mode 100644 index f751265..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/NonEmptyDirectory/SubDir2/Service3.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\Fixture\NonEmptyDirectory\SubDir2; - -use JMS\DiExtraBundle\Annotation as DI; - -/** @DI\Service */ -class Service1 -{ -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/RequestListener.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/RequestListener.php deleted file mode 100644 index e69ffcc..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/RequestListener.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\Fixture; - -use JMS\DiExtraBundle\Annotation as DI; - -/** - * @DI\Service - * - * @author Johannes M. Schmitt - */ -class RequestListener -{ - private $router; - private $session; - private $em; - private $con; - private $table; - - /** - * @DI\InjectParams({ - * "em" = @DI\Inject("doctrine.entity_manager") - * }) - */ - public function __construct($router, $session, $em) - { - $this->router = $router; - $this->session = $session; - $this->em = $em; - } - - /** - * @DI\InjectParams({ - * "table" = @DI\Inject("%table_name%") - * }) - */ - public function setConnection($databaseConnection, $table) - { - $this->con = $databaseConnection; - $this->table = $table; - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/Validator/Validator.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/Validator/Validator.php deleted file mode 100644 index 1ae4c0e..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Fixture/Validator/Validator.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\Fixture\Validator; - -use JMS\DiExtraBundle\Annotation\InjectParams; -use JMS\DiExtraBundle\Annotation\Validator as ValidatorAnnot; -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\ConstraintValidator; - -/** - * @ValidatorAnnot("foobar") - */ -class Validator extends ConstraintValidator -{ - private $foo; - - /** - * @InjectParams - */ - public function __construct($foo) - { - $this->foo = $foo; - } - - public function isValid($value, Constraint $constraint) - { - return true; - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/AppKernel.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/AppKernel.php deleted file mode 100644 index 6a8c682..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/AppKernel.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\Functional; - -require_once __DIR__.'/../bootstrap.php'; - -use Symfony\Component\HttpKernel\Util\Filesystem; -use Symfony\Component\Config\Loader\LoaderInterface; -use Symfony\Component\HttpKernel\Kernel; - -class AppKernel extends Kernel -{ - private $config; - - public function __construct($config) - { - parent::__construct('test', true); - - $fs = new Filesystem(); - if (!$fs->isAbsolutePath($config)) { - $config = __DIR__.'/config/'.$config; - } - - if (!file_exists($config)) { - throw new \RuntimeException(sprintf('The config file "%s" does not exist.', $config)); - } - - $this->config = $config; - } - - public function registerBundles() - { - return array( - new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(), - new \Symfony\Bundle\SecurityBundle\SecurityBundle(), - new \Symfony\Bundle\TwigBundle\TwigBundle(), - new \Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), - new \JMS\AopBundle\JMSAopBundle(), - new \JMS\DiExtraBundle\Tests\Functional\Bundle\TestBundle\JMSDiExtraTestBundle(), - new \JMS\DiExtraBundle\JMSDiExtraBundle($this), - new \JMS\SecurityExtraBundle\JMSSecurityExtraBundle(), - ); - } - - public function registerContainerConfiguration(LoaderInterface $loader) - { - $loader->load($this->config); - } - - public function getCacheDir() - { - return sys_get_temp_dir().'/JMSDiExtraBundle'; - } - - public function serialize() - { - return $this->config; - } - - public function unserialize($config) - { - $this->__construct($config); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/BaseTestCase.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/BaseTestCase.php deleted file mode 100644 index 8cc2a30..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/BaseTestCase.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\Functional; - -use Symfony\Component\HttpKernel\Util\Filesystem; - -use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; - -class BaseTestCase extends WebTestCase -{ - static protected function createKernel(array $options = array()) - { - return new AppKernel( - isset($options['config']) ? $options['config'] : 'default.yml' - ); - } - - protected function tearDown() - { - $this->cleanTmpDir(); - } - - protected function setUp() - { - $this->cleanTmpDir(); - } - - private function cleanTmpDir() - { - $fs = new Filesystem(); - $fs->remove(sys_get_temp_dir().'/JMSDiExtraBundle'); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Controller/AnotherSecuredController.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Controller/AnotherSecuredController.php deleted file mode 100644 index d517058..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Controller/AnotherSecuredController.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\Functional\Bundle\TestBundle\Controller; - -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; -use JMS\SecurityExtraBundle\Annotation\Secure; -use JMS\DiExtraBundle\Annotation as DI; - -/** - * Secured Controller. - * - * @author Johannes M. Schmitt - */ -class AnotherSecuredController -{ - /** - * @Route("/secure-action") - * @Secure("ROLE_FOO") - */ - public function secureAction() - { - throw new \Exception('Should never be called'); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Controller/RegisterController.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Controller/RegisterController.php deleted file mode 100644 index 8ec8c31..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Controller/RegisterController.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\Functional\Bundle\TestBundle\Controller; - -use Symfony\Component\HttpFoundation\Response; -use JMS\DiExtraBundle\Annotation as DI; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; - -/** - * @author Johannes M. Schmitt - */ -abstract class RegisterController -{ - /** - * @Route("/register") - */ - public function registerAction() - { - $mailer = $this->getMailer(); - - return new Response($mailer->getFromMail(), 200, array('Content-Type' => 'text/plain')); - } - - /** @DI\LookupMethod("test_mailer") */ - abstract protected function getMailer(); -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Controller/SecuredController.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Controller/SecuredController.php deleted file mode 100644 index 0bf831c..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Controller/SecuredController.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\Functional\Bundle\TestBundle\Controller; - -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; -use JMS\SecurityExtraBundle\Annotation\Secure; -use JMS\DiExtraBundle\Annotation as DI; - -/** - * @author Johannes M. Schmitt - */ -abstract class SecuredController -{ - /** - * @Route("/lookup-method-and-aop") - * @Secure("ROLE_FOO") - */ - public function secureAction() - { - throw new \Exception('Should never be called'); - } - - /** @DI\LookupMethod */ - abstract protected function getTestMailer(); -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Inheritance/AbstractClass.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Inheritance/AbstractClass.php deleted file mode 100644 index b3124c1..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Inheritance/AbstractClass.php +++ /dev/null @@ -1,31 +0,0 @@ -templating = $templating; - } - - public function getTemplating() - { - return $this->templating; - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Inheritance/ConcreteClass.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Inheritance/ConcreteClass.php deleted file mode 100644 index 2afb936..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Inheritance/ConcreteClass.php +++ /dev/null @@ -1,38 +0,0 @@ - - */ -class ConcreteClass extends AbstractClass -{ - private $foo; - private $bar; - - /** - * @DI\InjectParams - * - * @param stdClass $foo - * @param stdClass $bar - */ - public function __construct($foo, $bar) - { - $this->foo = $foo; - $this->bar = $bar; - } - - public function getFoo() - { - return $this->foo; - } - - public function getBar() - { - return $this->bar; - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/JMSDiExtraTestBundle.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/JMSDiExtraTestBundle.php deleted file mode 100644 index acf74ca..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/JMSDiExtraTestBundle.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\Functional\Bundle\TestBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; - -class JMSDiExtraTestBundle extends Bundle -{ -} diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Mailer/TestMailer.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Mailer/TestMailer.php deleted file mode 100644 index 89cc63d..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Bundle/TestBundle/Mailer/TestMailer.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\Functional\Bundle\TestBundle\Mailer; - -use JMS\DiExtraBundle\Annotation as DI; - -/** - * @DI\Service("test_mailer") - * - * @author Johannes M. Schmitt - */ -class TestMailer -{ - public function getFromMail() - { - return 'foo@bar.de'; - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/ControllerResolverTest.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/ControllerResolverTest.php deleted file mode 100644 index 76a7aab..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/ControllerResolverTest.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\Functional; - -class ControllerResolverTest extends BaseTestCase -{ - public function testLookupMethodIsCorrectlyImplemented() - { - $client = $this->createClient(); - $client->request('GET', '/register'); - - $this->assertEquals('foo@bar.de', $client->getResponse()->getContent()); - } - - public function testLookupMethodAndAopProxy() - { - $client = $this->createClient(); - $client->request('GET', '/lookup-method-and-aop'); - - $this->assertTrue($client->getResponse()->isRedirect('http://localhost/login'), substr((string) $client->getResponse(), 0, 512)); - - $client->insulate(); - $client->request('GET', '/lookup-method-and-aop'); - $this->assertTrue($client->getResponse()->isRedirect('http://localhost/login'), substr((string) $client->getResponse(), 0, 512)); - } - - public function testAopProxyWhenNoDiMetadata() - { - $client = $this->createClient(); - $client->request('GET', '/secure-action'); - - $this->assertTrue($client->getResponse()->isRedirect('http://localhost/login')); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Issue11Test.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Issue11Test.php deleted file mode 100644 index c2bc483..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/Issue11Test.php +++ /dev/null @@ -1,21 +0,0 @@ -createClient(); - - $container = self::$kernel->getContainer(); - $foo = $container->get('foo'); - $bar = $container->get('bar'); - $templating = $container->get('templating'); - - $concreteService = $container->get('concrete_class'); - $this->assertSame($templating, $concreteService->getTemplating()); - $this->assertSame($foo, $concreteService->getFoo()); - $this->assertSame($bar, $concreteService->getBar()); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/config/default.yml b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/config/default.yml deleted file mode 100644 index 31bf587..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/config/default.yml +++ /dev/null @@ -1,12 +0,0 @@ -imports: - - { resource: framework.yml } - - { resource: twig.yml } - - { resource: security.yml } - -jms_di_extra: - locations: - bundles: [JMSDiExtraTestBundle] - -services: - foo: { class: stdClass } - bar: { class: stdClass } \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/config/framework.yml b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/config/framework.yml deleted file mode 100644 index 0057272..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/config/framework.yml +++ /dev/null @@ -1,16 +0,0 @@ -framework: - secret: test - test: ~ - session: - storage_id: session.storage.filesystem - form: true - csrf_protection: true - validation: - enabled: true - enable_annotations: true - router: - resource: %kernel.root_dir%/config/routing.yml - -services: - logger: - class: Symfony\Component\HttpKernel\Log\NullLogger \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/config/routing.yml b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/config/routing.yml deleted file mode 100644 index 9c0c861..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/config/routing.yml +++ /dev/null @@ -1,3 +0,0 @@ -TestBundle: - type: annotation - resource: @JMSDiExtraTestBundle/Controller/ \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/config/security.yml b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/config/security.yml deleted file mode 100644 index eeb621e..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/config/security.yml +++ /dev/null @@ -1,13 +0,0 @@ -security: - providers: - in_memory: - users: - johannes: { password: login } - - encoders: - Symfony\Component\Security\Core\User\UserInterface: plaintext - - firewalls: - default: - form_login: ~ - anonymous: ~ diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/config/twig.yml b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/config/twig.yml deleted file mode 100644 index 2c8539a..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Functional/config/twig.yml +++ /dev/null @@ -1,7 +0,0 @@ -framework: - templating: - engines: [twig, php] - -twig: - debug: %kernel.debug% - strict_variables: %kernel.debug% \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Metadata/ClassMetadataTest.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Metadata/ClassMetadataTest.php deleted file mode 100644 index 18e8454..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Metadata/ClassMetadataTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests\Metadata; - -use JMS\DiExtraBundle\Metadata\ClassMetadata; - -class ClassMetadataTest extends \PHPUnit_Framework_TestCase -{ - public function testSerializeUnserialize() - { - $classMetadata = new ClassMetadata('JMS\DiExtraBundle\Tests\Fixture\LoginController'); - $classMetadata->arguments = array('foo', 'bar'); - $classMetadata->abstract = true; - $classMetadata->public = false; - $classMetadata->id = 'foo'; - - $this->assertEquals($classMetadata, unserialize(serialize($classMetadata))); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Metadata/Driver/AnnotationDriverTest.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Metadata/Driver/AnnotationDriverTest.php deleted file mode 100644 index b7a8056..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Metadata/Driver/AnnotationDriverTest.php +++ /dev/null @@ -1,37 +0,0 @@ -getDriver()->loadMetadataForClass(new \ReflectionClass('JMS\DiExtraBundle\Tests\Metadata\Driver\Fixture\LoginType')); - - $this->assertEquals('j_m_s.di_extra_bundle.tests.metadata.driver.fixture.login_type', $metadata->id); - $this->assertEquals(array( - 'form.type' => array( - array('alias' => 'login'), - ) - ), $metadata->tags); - } - - public function testFormTypeWithExplicitAlias() - { - $metadata = $this->getDriver()->loadMetadataForClass(new \ReflectionClass('JMS\DiExtraBundle\Tests\Metadata\Driver\Fixture\SignUpType')); - - $this->assertEquals(array( - 'form.type' => array( - array('alias' => 'foo'), - ) - ), $metadata->tags); - } - - private function getDriver() - { - return new AnnotationDriver(new AnnotationReader()); - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Metadata/Driver/Fixture/LoginType.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Metadata/Driver/Fixture/LoginType.php deleted file mode 100644 index 8bee517..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Metadata/Driver/Fixture/LoginType.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ -class LoginType extends AbstractType -{ - private $securityContext; - - public function __construct(SecurityContext $context) - { - $this->securityContext = $context; - } - - public function getName() - { - return 'login'; - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Metadata/Driver/Fixture/SignUpType.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Metadata/Driver/Fixture/SignUpType.php deleted file mode 100644 index 476a505..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/Metadata/Driver/Fixture/SignUpType.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\DiExtraBundle\Tests; - -use Symfony\Bundle\TwigBundle\TwigBundle; -use Symfony\Bundle\DoctrineBundle\DoctrineBundle; -use JMS\DiExtraBundle\JMSDiExtraBundle; -use JMS\SecurityExtraBundle\JMSSecurityExtraBundle; -use Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle; -use Symfony\Bundle\FrameworkBundle\DependencyInjection\FrameworkExtension; -use Symfony\Bundle\AsseticBundle\AsseticBundle; -use Symfony\Bundle\MonologBundle\MonologBundle; -use Symfony\Bundle\SecurityBundle\SecurityBundle; -use Symfony\Bundle\FrameworkBundle\FrameworkBundle; -use JMS\DiExtraBundle\Finder\ServiceFinder; - -/** - * @group performance - */ -class PerformanceTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getFinderMethods - */ - public function testServiceFinder($method) - { - $finder = new ServiceFinder(); - $ref = new \ReflectionMethod($finder, $method); - $ref->setAccessible(true); - - $bundles = array( - new FrameworkBundle(), - new SecurityBundle(), - new MonologBundle(), - new AsseticBundle(), - new DoctrineBundle(), - new TwigBundle(), - new SensioFrameworkExtraBundle(), - new JMSSecurityExtraBundle(), - ); - $bundles = array_map(function($v) { - return $v->getPath(); - }, $bundles); - - $bundles[] = __DIR__.'/../'; - - $time = microtime(true); - for ($i=0,$c=5; $i<$c; $i++) { - $ref->invoke($finder, $bundles); - } - $time = microtime(true) - $time; - $this->printResults('service finder ('.$method.')', $time, $c); - } - - public function getFinderMethods() - { - return array( - array('findUsingGrep'), - array('findUsingFinder'), - ); - } - - private function printResults($test, $time, $iterations) - { - if (0 == $iterations) { - throw new InvalidArgumentException('$iterations cannot be zero.'); - } - - $title = $test." results:\n"; - $iterationsText = sprintf("Iterations: %d\n", $iterations); - $totalTime = sprintf("Total Time: %.3f s\n", $time); - $iterationTime = sprintf("Time per iteration: %.3f ms\n", $time/$iterations * 1000); - - $max = max(strlen($title), strlen($iterationTime)) - 1; - - echo "\n".str_repeat('-', $max)."\n"; - echo $title; - echo str_repeat('=', $max)."\n"; - echo $iterationsText; - echo $totalTime; - echo $iterationTime; - echo str_repeat('-', $max)."\n"; - } -} \ No newline at end of file diff --git a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/bootstrap.php b/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/bootstrap.php deleted file mode 100644 index 91518c7..0000000 --- a/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/schmittjoh-JMSDiExtraBundle-03a343a/Tests/bootstrap.php +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - ./Tests - - - - - - performance - - - diff --git a/vendor/jms/metadata/CHANGELOG.md b/vendor/jms/metadata/CHANGELOG.md deleted file mode 100644 index 74da57e..0000000 --- a/vendor/jms/metadata/CHANGELOG.md +++ /dev/null @@ -1,18 +0,0 @@ -CHANGELOG -========= - -This changelog references all relevant changes: - -To get the diff between the two last versions, go to -https://github.com/schmittjoh/metadata/compare/1.0.0...1.1.0 - -* 1.1.0 (2011-10-04) - - * added support for metadata on interfaces - * added support for non annotation-based drivers - * added support for merging metadata - -This release is fully backwards compatible with the 1.0.0 release. Therefore, -the 1.0.x branch has been discontinued. - -* 1.0.0 (2011-07-09) diff --git a/vendor/jms/metadata/LICENSE b/vendor/jms/metadata/LICENSE deleted file mode 100644 index f49a4e1..0000000 --- a/vendor/jms/metadata/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/vendor/jms/metadata/composer.json b/vendor/jms/metadata/composer.json deleted file mode 100644 index e598e25..0000000 --- a/vendor/jms/metadata/composer.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "jms/metadata", - "description": "Class/method/property metadata management in PHP", - "keywords": ["annotations","metadata","yaml","xml"], - "type": "library", - "license": "Apache", - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "require": { - "php": ">=5.3.0" - }, - "autoload": { - "psr-0": { "Metadata\\": "src/" } - } -} diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/CHANGELOG.md b/vendor/jms/metadata/schmittjoh-metadata-84088bc/CHANGELOG.md deleted file mode 100644 index 74da57e..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/CHANGELOG.md +++ /dev/null @@ -1,18 +0,0 @@ -CHANGELOG -========= - -This changelog references all relevant changes: - -To get the diff between the two last versions, go to -https://github.com/schmittjoh/metadata/compare/1.0.0...1.1.0 - -* 1.1.0 (2011-10-04) - - * added support for metadata on interfaces - * added support for non annotation-based drivers - * added support for merging metadata - -This release is fully backwards compatible with the 1.0.0 release. Therefore, -the 1.0.x branch has been discontinued. - -* 1.0.0 (2011-07-09) diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/LICENSE b/vendor/jms/metadata/schmittjoh-metadata-84088bc/LICENSE deleted file mode 100644 index f49a4e1..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/README.rst b/vendor/jms/metadata/schmittjoh-metadata-84088bc/README.rst deleted file mode 100644 index 51517ff..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/README.rst +++ /dev/null @@ -1,37 +0,0 @@ -Metadata is a library for class/method/property metadata management in PHP -========================================================================== - -Overview --------- - -This library provides some commonly needed base classes for managing metadata -for classes, methods and properties. The metadata can come from many different -sources (annotations, YAML/XML/PHP configuration files). - -The metadata classes are used to abstract away that source and provide a common -interface for all of them. - -Usage ------ - -The library provides three classes that you can extend to add your application -specific properties, and flags: ``ClassMetadata``, ``MethodMetadata``, and -``PropertyMetadata`` - -After you have added, your properties in sub-classes, you also need to add -``DriverInterface`` implementations which know how to populate these classes -from the different metadata sources. - -Finally, you can use the ``MetadataFactory`` to retrieve the metadata:: - - getMetadataForClass('MyNamespace\MyObject'); - diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/composer.json b/vendor/jms/metadata/schmittjoh-metadata-84088bc/composer.json deleted file mode 100644 index e598e25..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/composer.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "jms/metadata", - "description": "Class/method/property metadata management in PHP", - "keywords": ["annotations","metadata","yaml","xml"], - "type": "library", - "license": "Apache", - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "require": { - "php": ">=5.3.0" - }, - "autoload": { - "psr-0": { "Metadata\\": "src/" } - } -} diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/phpunit.xml.dist b/vendor/jms/metadata/schmittjoh-metadata-84088bc/phpunit.xml.dist deleted file mode 100644 index 38db7c3..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/phpunit.xml.dist +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - ./tests/Metadata/ - - - - - - performance - - - diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Cache/CacheInterface.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Cache/CacheInterface.php deleted file mode 100644 index dbf3ccb..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Cache/CacheInterface.php +++ /dev/null @@ -1,35 +0,0 @@ -dir = rtrim($dir, '\\/'); - } - - public function loadClassMetadataFromCache(\ReflectionClass $class) - { - $path = $this->dir.'/'.strtr($class->getName(), '\\', '-').'.cache.php'; - if (!file_exists($path)) { - return null; - } - - return include $path; - } - - public function putClassMetadataInCache(ClassMetadata $metadata) - { - $path = $this->dir.'/'.strtr($metadata->name, '\\', '-').'.cache.php'; - file_put_contents($path, 'dir.'/'.strtr($class->getName(), '\\', '-').'.cache.php'; - if (file_exists($path)) { - unlink($path); - } - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/ClassHierarchyMetadata.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/ClassHierarchyMetadata.php deleted file mode 100644 index c90a5e4..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/ClassHierarchyMetadata.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Metadata; - -/** - * Represents the metadata for the entire class hierarchy. - * - * @author Johannes M. Schmitt - */ -class ClassHierarchyMetadata -{ - public $classMetadata = array(); - - public function addClassMetadata(ClassMetadata $metadata) - { - $this->classMetadata[$metadata->name] = $metadata; - } - - public function getRootClassMetadata() - { - return reset($this->classMetadata); - } - - public function getOutsideClassMetadata() - { - return end($this->classMetadata); - } - - public function isFresh($timestamp) - { - foreach ($this->classMetadata as $metadata) { - if (!$metadata->isFresh($timestamp)) { - return false; - } - } - - return true; - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/ClassMetadata.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/ClassMetadata.php deleted file mode 100644 index 2479a4f..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/ClassMetadata.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Metadata; - -/** - * Base class for class metadata. - * - * This class is intended to be extended to add your own application specific - * properties, and flags. - * - * @author Johannes M. Schmitt - */ -class ClassMetadata implements \Serializable -{ - public $name; - public $reflection; - public $methodMetadata = array(); - public $propertyMetadata = array(); - public $fileResources = array(); - public $createdAt; - - public function __construct($name) - { - $this->name = $name; - - $this->reflection = new \ReflectionClass($name); - $this->createdAt = time(); - } - - public function addMethodMetadata(MethodMetadata $metadata) - { - $this->methodMetadata[$metadata->name] = $metadata; - } - - public function addPropertyMetadata(PropertyMetadata $metadata) - { - $this->propertyMetadata[$metadata->name] = $metadata; - } - - public function isFresh($timestamp = null) - { - if (null === $timestamp) { - $timestamp = $this->createdAt; - } - - foreach ($this->fileResources as $filepath) { - if (!file_exists($filepath)) { - return false; - } - - if ($timestamp < filemtime($filepath)) { - return false; - } - } - - return true; - } - - public function serialize() - { - return serialize(array( - $this->name, - $this->methodMetadata, - $this->propertyMetadata, - $this->fileResources, - $this->createdAt, - )); - } - - public function unserialize($str) - { - list( - $this->name, - $this->methodMetadata, - $this->propertyMetadata, - $this->fileResources, - $this->createdAt - ) = unserialize($str); - - $this->reflection = new \ReflectionClass($this->name); - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/AbstractFileDriver.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/AbstractFileDriver.php deleted file mode 100644 index b02f387..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/AbstractFileDriver.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -abstract class AbstractFileDriver implements DriverInterface -{ - private $locator; - - public function __construct(FileLocatorInterface $locator) - { - $this->locator = $locator; - } - - public function loadMetadataForClass(\ReflectionClass $class) - { - if (null === $path = $this->locator->findFileForClass($class, $this->getExtension())) { - return null; - } - - return $this->loadMetadataFromFile($class, $path); - } - - /** - * Parses the content of the file, and converts it to the desired metadata. - * - * @param string $file - * @return ClassMetadata|null - */ - abstract protected function loadMetadataFromFile(\ReflectionClass $class, $file); - - /** - * Returns the extension of the file. - * - * @return string - */ - abstract protected function getExtension(); -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/DriverChain.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/DriverChain.php deleted file mode 100644 index 809ccf1..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/DriverChain.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Metadata\Driver; - -final class DriverChain implements DriverInterface -{ - private $drivers; - - public function __construct(array $drivers) - { - $this->drivers = $drivers; - } - - public function loadMetadataForClass(\ReflectionClass $class) - { - foreach ($this->drivers as $driver) { - if (null !== $metadata = $driver->loadMetadataForClass($class)) { - return $metadata; - } - } - - return null; - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/DriverInterface.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/DriverInterface.php deleted file mode 100644 index 57ed66d..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/DriverInterface.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Metadata\Driver; - -interface DriverInterface -{ - function loadMetadataForClass(\ReflectionClass $class); -} diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/FileLocator.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/FileLocator.php deleted file mode 100644 index 41f7b99..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/FileLocator.php +++ /dev/null @@ -1,29 +0,0 @@ -dirs = $dirs; - } - - public function findFileForClass(\ReflectionClass $class, $extension) - { - foreach ($this->dirs as $prefix => $dir) { - if (0 !== strpos($class->getNamespaceName(), $prefix)) { - continue; - } - - $path = $dir.'/'.str_replace('\\', '.', substr($class->getName(), strlen($prefix)+1)).'.'.$extension; - if (file_exists($path)) { - return $path; - } - } - - return null; - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/FileLocatorInterface.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/FileLocatorInterface.php deleted file mode 100644 index 5092f3d..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Driver/FileLocatorInterface.php +++ /dev/null @@ -1,8 +0,0 @@ -container = $container; - $this->realDriverId = $realDriverId; - } - - public function loadMetadataForClass(\ReflectionClass $class) - { - return $this->container->get($this->realDriverId)->loadMetadataForClass($class); - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/MergeableClassMetadata.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/MergeableClassMetadata.php deleted file mode 100644 index 13ec158..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/MergeableClassMetadata.php +++ /dev/null @@ -1,23 +0,0 @@ -name = $object->name; - $this->reflection = $object->reflection; - $this->methodMetadata = array_merge($this->methodMetadata, $object->methodMetadata); - $this->propertyMetadata = array_merge($this->propertyMetadata, $object->propertyMetadata); - $this->fileResources = array_merge($this->fileResources, $object->fileResources); - - if ($object->createdAt < $this->createdAt) { - $this->createdAt = $object->createdAt; - } - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/MergeableInterface.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/MergeableInterface.php deleted file mode 100644 index 1da234f..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/MergeableInterface.php +++ /dev/null @@ -1,8 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Metadata; - -use Metadata\Driver\DriverInterface; -use Metadata\Cache\CacheInterface; - -final class MetadataFactory implements MetadataFactoryInterface -{ - private $driver; - private $cache; - private $loadedMetadata = array(); - private $loadedClassMetadata = array(); - private $hierarchyMetadataClass; - private $includeInterfaces = false; - private $debug; - - public function __construct(DriverInterface $driver, $hierarchyMetadataClass = 'Metadata\ClassHierarchyMetadata', $debug = false) - { - $this->driver = $driver; - $this->hierarchyMetadataClass = $hierarchyMetadataClass; - $this->debug = $debug; - } - - public function setIncludeInterfaces($bool) - { - $this->includeInterfaces = (Boolean) $bool; - } - - public function setCache(CacheInterface $cache) - { - $this->cache = $cache; - } - - public function getMetadataForClass($className) - { - if (isset($this->loadedMetadata[$className])) { - return $this->loadedMetadata[$className]; - } - - $metadata = null; - foreach ($this->getClassHierarchy($className) as $class) { - if (isset($this->loadedClassMetadata[$name = $class->getName()])) { - $this->addClassMetadata($metadata, $this->loadedClassMetadata[$name]); - continue; - } - - // check the cache - if (null !== $this->cache - && (null !== $classMetadata = $this->cache->loadClassMetadataFromCache($class))) { - if ($this->debug && !$classMetadata->isFresh()) { - $this->cache->evictClassMetadataFromCache($classMetadata->reflection); - } else { - $this->loadedClassMetadata[$name] = $classMetadata; - $this->addClassMetadata($metadata, $classMetadata); - continue; - } - } - - // load from source - if (null !== $classMetadata = $this->driver->loadMetadataForClass($class)) { - $this->loadedClassMetadata[$name] = $classMetadata; - $this->addClassMetadata($metadata, $classMetadata); - - if (null !== $this->cache) { - $this->cache->putClassMetadataInCache($classMetadata); - } - - continue; - } - } - - return $this->loadedMetadata[$className] = $metadata; - } - - private function addClassMetadata(&$metadata, $toAdd) - { - if ($toAdd instanceof MergeableInterface) { - if (null === $metadata) { - $metadata = clone $toAdd; - } else { - $metadata->merge($toAdd); - } - } else { - if (null === $metadata) { - $metadata = new $this->hierarchyMetadataClass; - } - - $metadata->addClassMetadata($toAdd); - } - } - - private function getClassHierarchy($class) - { - $classes = array(); - $refl = new \ReflectionClass($class); - - do { - $classes[] = $refl; - } while (false !== $refl = $refl->getParentClass()); - - $classes = array_reverse($classes, false); - - if (!$this->includeInterfaces) { - return $classes; - } - - $addedInterfaces = array(); - $newHierarchy = array(); - - foreach ($classes as $class) { - foreach ($class->getInterfaces() as $interface) { - if (isset($addedInterfaces[$interface->getName()])) { - continue; - } - $addedInterfaces[$interface->getName()] = true; - - $newHierarchy[] = $interface; - } - - $newHierarchy[] = $class; - } - - return $newHierarchy; - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/MetadataFactoryInterface.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/MetadataFactoryInterface.php deleted file mode 100644 index d7fa68a..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/MetadataFactoryInterface.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Metadata; - -interface MetadataFactoryInterface -{ - function getMetadataForClass($className); -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/MethodMetadata.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/MethodMetadata.php deleted file mode 100644 index db2d501..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/MethodMetadata.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Metadata; - -/** - * Base class for method metadata. - * - * This class is intended to be extended to add your application specific - * properties, and flags. - * - * @author Johannes M. Schmitt - */ -class MethodMetadata implements \Serializable -{ - public $class; - public $name; - public $reflection; - - public function __construct($class, $name) - { - $this->class = $class; - $this->name = $name; - - $this->reflection = new \ReflectionMethod($class, $name); - $this->reflection->setAccessible(true); - } - - public function invoke($obj, array $args = array()) - { - return $this->reflection->invokeArgs($obj, $args); - } - - public function serialize() - { - return serialize(array($this->class, $this->name)); - } - - public function unserialize($str) - { - list($this->class, $this->name) = unserialize($str); - - $this->reflection = new \ReflectionMethod($this->class, $this->name); - $this->reflection->setAccessible(true); - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/PropertyMetadata.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/PropertyMetadata.php deleted file mode 100644 index a581ce0..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/PropertyMetadata.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Metadata; - -/** - * Base class for property metadata. - * - * This class is intended to be extended to add your application specific - * properties, and flags. - * - * @author Johannes M. Schmitt - */ -class PropertyMetadata implements \Serializable -{ - public $class; - public $name; - public $reflection; - - public function __construct($class, $name) - { - $this->class = $class; - $this->name = $name; - - $this->reflection = new \ReflectionProperty($class, $name); - $this->reflection->setAccessible(true); - } - - public function getValue($obj) - { - return $this->reflection->getValue($obj); - } - - public function setValue($obj, $value) - { - $this->reflection->setValue($obj, $value); - } - - public function serialize() - { - return serialize(array( - $this->class, - $this->name, - )); - } - - public function unserialize($str) - { - list($this->class, $this->name) = unserialize($str); - - $this->reflection = new \ReflectionProperty($this->class, $this->name); - $this->reflection->setAccessible(true); - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Version.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Version.php deleted file mode 100644 index 0ea37d6..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/src/Metadata/Version.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Metadata; - -final class Version -{ - const VERSION = '1.1.1'; -} diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Cache/FileCacheTest.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Cache/FileCacheTest.php deleted file mode 100644 index 5c308b5..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Cache/FileCacheTest.php +++ /dev/null @@ -1,23 +0,0 @@ -assertNull($cache->loadClassMetadataFromCache($refl = new \ReflectionClass('Metadata\Tests\Fixtures\TestObject'))); - $cache->putClassMetadataInCache($metadata = new ClassMetadata('Metadata\Tests\Fixtures\TestObject')); - - $this->assertEquals($metadata, $cache->loadClassMetadataFromCache($refl)); - - $cache->evictClassMetadataFromCache($refl); - $this->assertNull($cache->loadClassMetadataFromCache($refl)); - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/ClassMetadataTest.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/ClassMetadataTest.php deleted file mode 100644 index cc5a1ce..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/ClassMetadataTest.php +++ /dev/null @@ -1,39 +0,0 @@ -assertEquals('Metadata\Tests\Fixtures\TestObject', $metadata->name); - $this->assertEquals('Metadata\Tests\Fixtures\TestObject', $metadata->reflection->getName()); - } - - public function testSerializeUnserialize() - { - $metadata = new ClassMetadata('Metadata\Tests\Fixtures\TestObject'); - - $this->assertEquals($metadata, unserialize(serialize($metadata))); - } - - public function testIsFresh() - { - $ref = new \ReflectionClass('Metadata\Tests\Fixtures\TestObject'); - touch($ref->getFilename()); - sleep(2); - - $metadata = new ClassMetadata($ref->getName()); - $metadata->fileResources[] = $ref->getFilename(); - $this->assertTrue($metadata->isFresh()); - - sleep(2); - clearstatcache($ref->getFilename()); - touch($ref->getFilename()); - $this->assertFalse($metadata->isFresh()); - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Driver/DriverChainTest.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Driver/DriverChainTest.php deleted file mode 100644 index a175587..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Driver/DriverChainTest.php +++ /dev/null @@ -1,37 +0,0 @@ -getMock('Metadata\\Driver\\DriverInterface'); - $driver - ->expects($this->once()) - ->method('loadMetadataForClass') - ->will($this->returnValue($metadata = new ClassMetadata('\stdClass'))) - ; - $chain = new DriverChain(array($driver)); - - $this->assertSame($metadata, $chain->loadMetadataForClass(new \ReflectionClass('\stdClass'))); - } - - public function testLoadMetadataForClassReturnsNullWhenNoMetadataIsFound() - { - $driver = new DriverChain(array()); - $this->assertNull($driver->loadMetadataForClass(new \ReflectionClass('\stdClass'))); - - $driver = $this->getMock('Metadata\\Driver\\DriverInterface'); - $driver - ->expects($this->once()) - ->method('loadMetadataForClass') - ->will($this->returnValue(null)) - ; - $driverChain = new DriverChain(array($driver)); - $this->assertNull($driver->loadMetadataForClass(new \ReflectionClass('\stdClass'))); - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Driver/FileLocatorTest.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Driver/FileLocatorTest.php deleted file mode 100644 index e121eba..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Driver/FileLocatorTest.php +++ /dev/null @@ -1,26 +0,0 @@ - __DIR__.'/Fixture/A', - 'Metadata\Tests\Driver\Fixture\B' => __DIR__.'/Fixture/B', - 'Metadata\Tests\Driver\Fixture\C' => __DIR__.'/Fixture/C', - )); - - $ref = new \ReflectionClass('Metadata\Tests\Driver\Fixture\A\A'); - $this->assertEquals(realpath(__DIR__.'/Fixture/A/A.xml'), realpath($locator->findFileForClass($ref, 'xml'))); - - $ref = new \ReflectionClass('Metadata\Tests\Driver\Fixture\B\B'); - $this->assertNull($locator->findFileForClass($ref, 'xml')); - - $ref = new \ReflectionClass('Metadata\Tests\Driver\Fixture\C\SubDir\C'); - $this->assertEquals(realpath(__DIR__.'/Fixture/C/SubDir.C.yml'), realpath($locator->findFileForClass($ref, 'yml'))); - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Driver/Fixture/A/A.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Driver/Fixture/A/A.php deleted file mode 100644 index 3ea6df1..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Driver/Fixture/A/A.php +++ /dev/null @@ -1,5 +0,0 @@ -foo; - } - - private function setFoo($foo) - { - $this->foo = $foo; - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Fixtures/TestParent.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Fixtures/TestParent.php deleted file mode 100644 index 940cb5b..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/Fixtures/TestParent.php +++ /dev/null @@ -1,7 +0,0 @@ -propertyMetadata['foo'] = 'bar'; - $parentMetadata->propertyMetadata['baz'] = 'baz'; - $parentMetadata->methodMetadata['foo'] = 'bar'; - $parentMetadata->createdAt = 2; - $parentMetadata->fileResources[] = 'foo'; - - $childMetadata = new MergeableClassMetadata('Metadata\Tests\Fixtures\TestObject'); - $childMetadata->propertyMetadata['foo'] = 'baz'; - $childMetadata->methodMetadata['foo'] = 'baz'; - $childMetadata->createdAt = 1; - $childMetadata->fileResources[] = 'bar'; - - $parentMetadata->merge($childMetadata); - $this->assertEquals('Metadata\Tests\Fixtures\TestObject', $parentMetadata->name); - $this->assertEquals('Metadata\Tests\Fixtures\TestObject', $parentMetadata->reflection->getName()); - $this->assertEquals(array('foo' => 'baz', 'baz' => 'baz',), $parentMetadata->propertyMetadata); - $this->assertEquals(array('foo' => 'baz',), $parentMetadata->methodMetadata); - $this->assertEquals(1, $parentMetadata->createdAt); - $this->assertEquals(array('foo', 'bar'), $parentMetadata->fileResources); - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/MetadataFactoryTest.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/MetadataFactoryTest.php deleted file mode 100644 index 193250c..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/MetadataFactoryTest.php +++ /dev/null @@ -1,184 +0,0 @@ -getMock('Metadata\Driver\DriverInterface'); - - $driver - ->expects($this->at(0)) - ->method('loadMetadataForClass') - ->with($this->equalTo(new \ReflectionClass('Metadata\Tests\Fixtures\TestObject'))) - ->will($this->returnCallback(function($class) { - return new ClassMetadata($class->getName()); - })) - ; - $driver - ->expects($this->at(1)) - ->method('loadMetadataForClass') - ->with($this->equalTo(new \ReflectionClass('Metadata\Tests\Fixtures\TestParent'))) - ->will($this->returnCallback(function($class) { - return new ClassMetadata($class->getName()); - })) - ; - - $factory = new MetadataFactory($driver); - $metadata = $factory->getMetadataForClass('Metadata\Tests\Fixtures\TestParent'); - - $this->assertInstanceOf('Metadata\ClassHierarchyMetadata', $metadata); - $this->assertEquals(2, count($metadata->classMetadata)); - } - - public function testGetMetadataForClassWhenMergeable() - { - $driver = $this->getMock('Metadata\Driver\DriverInterface'); - - $driver - ->expects($this->at(0)) - ->method('loadMetadataForClass') - ->with($this->equalTo(new \ReflectionClass('Metadata\Tests\Fixtures\TestObject'))) - ->will($this->returnCallback(function($class) { - return new MergeableClassMetadata($class->getName()); - })) - ; - $driver - ->expects($this->at(1)) - ->method('loadMetadataForClass') - ->with($this->equalTo(new \ReflectionClass('Metadata\Tests\Fixtures\TestParent'))) - ->will($this->returnCallback(function($class) { - return new MergeableClassMetadata($class->getName()); - })) - ; - - $factory = new MetadataFactory($driver); - $metadata = $factory->getMetadataForClass('Metadata\Tests\Fixtures\TestParent'); - - $this->assertInstanceOf('Metadata\MergeableClassMetadata', $metadata); - $this->assertEquals('Metadata\Tests\Fixtures\TestParent', $metadata->name); - } - - public function testGetMetadataWithComplexHierarchy() - { - $driver = $this->getMock('Metadata\Driver\DriverInterface'); - - $driver - ->expects($this->any()) - ->method('loadMetadataForClass') - ->will($this->returnCallback(function($class) { - $metadata = new MergeableClassMetadata($class->name); - - switch ($class->name) { - case 'Metadata\Tests\Fixtures\ComplexHierarchy\BaseClass': - $metadata->propertyMetadata['foo'] = new PropertyMetadata($class->name, 'foo'); - break; - - case 'Metadata\Tests\Fixtures\ComplexHierarchy\SubClassA': - $metadata->propertyMetadata['bar'] = new PropertyMetadata($class->name, 'bar'); - break; - - case 'Metadata\Tests\Fixtures\ComplexHierarchy\SubClassB': - $metadata->propertyMetadata['baz'] = new PropertyMetadata($class->name, 'baz'); - break; - - default: - throw new \RuntimeException(sprintf('Unsupported class "%s".', $class->name)); - } - - return $metadata; - })) - ; - - $factory = new MetadataFactory($driver); - - $subClassA = $factory->getMetadataForClass('Metadata\Tests\Fixtures\ComplexHierarchy\SubClassA'); - $this->assertInstanceOf('Metadata\MergeableClassMetadata', $subClassA); - $this->assertEquals(array('foo', 'bar'), array_keys($subClassA->propertyMetadata)); - - $subClassB = $factory->getMetadataForClass('Metadata\Tests\Fixtures\ComplexHierarchy\SubClassB'); - $this->assertInstanceOf('Metadata\MergeableClassMetadata', $subClassB); - $this->assertEquals(array('foo', 'baz'), array_keys($subClassB->propertyMetadata)); - } - - public function testGetMetadataWithCache() - { - $driver = $this->getMock('Metadata\Driver\DriverInterface'); - $driver - ->expects($this->once()) - ->method('loadMetadataForClass') - ->will($this->returnValue($metadata = new ClassMetadata('Metadata\Tests\Fixtures\TestObject'))) - ; - - $factory = new MetadataFactory($driver); - - $cache = $this->getMock('Metadata\Cache\CacheInterface'); - $cache - ->expects($this->once()) - ->method('loadClassMetadataFromCache') - ->with($this->equalTo(new \ReflectionClass('Metadata\Tests\Fixtures\TestObject'))) - ->will($this->returnValue(null)) - ; - $cache - ->expects($this->once()) - ->method('putClassMetadataInCache') - ->with($this->equalTo($metadata)) - ; - $factory->setCache($cache); - - $this->assertSame($metadata, reset($factory->getMetadataForClass('Metadata\Tests\Fixtures\TestObject')->classMetadata)); - } - - public function testGetMetadataReturnsNullIfNoMetadataIsFound() - { - $driver = $this->getMock('Metadata\Driver\DriverInterface'); - $driver - ->expects($this->once()) - ->method('loadMetadataForClass') - ->will($this->returnValue(null)) - ; - - $factory = new MetadataFactory($driver); - - $this->assertNull($factory->getMetadataForClass('stdClass')); - } - - public function testGetMetadataWithInterfaces() - { - $driver = $this->getMock('Metadata\Driver\DriverInterface'); - - $driver - ->expects($this->at(3)) - ->method('loadMetadataForClass') - ->with($this->equalTo(new \ReflectionClass('Metadata\Tests\Fixtures\ComplexHierarchy\SubClassA'))) - ; - $driver - ->expects($this->at(2)) - ->method('loadMetadataForClass') - ->with($this->equalTo(new \ReflectionClass('Metadata\Tests\Fixtures\ComplexHierarchy\InterfaceB'))) - ; - $driver - ->expects($this->at(1)) - ->method('loadMetadataForClass') - ->with($this->equalTo(new \ReflectionClass('Metadata\Tests\Fixtures\ComplexHierarchy\BaseClass'))) - ; - $driver - ->expects($this->at(0)) - ->method('loadMetadataForClass') - ->with($this->equalTo(new \ReflectionClass('Metadata\Tests\Fixtures\ComplexHierarchy\InterfaceA'))) - ; - - $factory = new MetadataFactory($driver); - $factory->setIncludeInterfaces(true); - - $factory->getMetadataForClass('Metadata\Tests\Fixtures\ComplexHierarchy\SubClassA'); - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/MethodMetadataTest.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/MethodMetadataTest.php deleted file mode 100644 index 7ab9af6..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/MethodMetadataTest.php +++ /dev/null @@ -1,36 +0,0 @@ -assertEquals('Metadata\Tests\Fixtures\TestObject', $metadata->class); - $this->assertEquals('setFoo', $metadata->name); - $this->assertEquals(new \ReflectionMethod('Metadata\Tests\Fixtures\TestObject', 'setFoo'), $metadata->reflection); - } - - public function testSerializeUnserialize() - { - $metadata = new MethodMetadata('Metadata\Tests\Fixtures\TestObject', 'setFoo'); - - $this->assertEquals($metadata, unserialize(serialize($metadata))); - } - - public function testInvoke() - { - $obj = new TestObject(); - $metadata = new MethodMetadata('Metadata\Tests\Fixtures\TestObject', 'setFoo'); - - $this->assertNull($obj->getFoo()); - $metadata->invoke($obj, array('foo')); - $this->assertEquals('foo', $obj->getFoo()); - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/PropertyMetadataTest.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/PropertyMetadataTest.php deleted file mode 100644 index 46f1a27..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/Metadata/Tests/PropertyMetadataTest.php +++ /dev/null @@ -1,36 +0,0 @@ -assertEquals('Metadata\Tests\Fixtures\TestObject', $metadata->class); - $this->assertEquals('foo', $metadata->name); - $this->assertEquals(new \ReflectionProperty('Metadata\Tests\Fixtures\TestObject', 'foo'), $metadata->reflection); - } - - public function testSerializeUnserialize() - { - $metadata = new PropertyMetadata('Metadata\Tests\Fixtures\TestObject', 'foo'); - - $this->assertEquals($metadata, unserialize(serialize($metadata))); - } - - public function testSetGetValue() - { - $obj = new TestObject(); - $metadata = new PropertyMetadata('Metadata\Tests\Fixtures\TestObject', 'foo'); - - $this->assertNull($metadata->getValue($obj)); - $metadata->setValue($obj, 'foo'); - $this->assertEquals('foo', $metadata->getValue($obj)); - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/bootstrap.php b/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/bootstrap.php deleted file mode 100644 index 7a9f78f..0000000 --- a/vendor/jms/metadata/schmittjoh-metadata-84088bc/tests/bootstrap.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - */ - -spl_autoload_register(function($class) -{ - if (0 === strpos($class, 'Metadata\Tests\\')) { - $path = __DIR__.'/../tests/'.strtr($class, '\\', '/').'.php'; - if (file_exists($path) && is_readable($path)) { - require_once $path; - - return true; - } - } else if (0 === strpos($class, 'Metadata\\')) { - $path = __DIR__.'/../src/'.($class = strtr($class, '\\', '/')).'.php'; - if (file_exists($path) && is_readable($path)) { - require_once $path; - - return true; - } - } else if (0 === strpos($class, 'Symfony\\')) { - $path = __DIR__.'/../../symfony/src/'.strtr($class, '\\', '/').'.php'; - - if (file_exists($path) && is_readable($path)) { - require_once $path; - - return true; - } - } -}); - diff --git a/vendor/jms/metadata/src/Metadata/Cache/CacheInterface.php b/vendor/jms/metadata/src/Metadata/Cache/CacheInterface.php deleted file mode 100644 index dbf3ccb..0000000 --- a/vendor/jms/metadata/src/Metadata/Cache/CacheInterface.php +++ /dev/null @@ -1,35 +0,0 @@ -dir = rtrim($dir, '\\/'); - } - - public function loadClassMetadataFromCache(\ReflectionClass $class) - { - $path = $this->dir.'/'.strtr($class->getName(), '\\', '-').'.cache.php'; - if (!file_exists($path)) { - return null; - } - - return include $path; - } - - public function putClassMetadataInCache(ClassMetadata $metadata) - { - $path = $this->dir.'/'.strtr($metadata->name, '\\', '-').'.cache.php'; - file_put_contents($path, 'dir.'/'.strtr($class->getName(), '\\', '-').'.cache.php'; - if (file_exists($path)) { - unlink($path); - } - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/src/Metadata/ClassHierarchyMetadata.php b/vendor/jms/metadata/src/Metadata/ClassHierarchyMetadata.php deleted file mode 100644 index c90a5e4..0000000 --- a/vendor/jms/metadata/src/Metadata/ClassHierarchyMetadata.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Metadata; - -/** - * Represents the metadata for the entire class hierarchy. - * - * @author Johannes M. Schmitt - */ -class ClassHierarchyMetadata -{ - public $classMetadata = array(); - - public function addClassMetadata(ClassMetadata $metadata) - { - $this->classMetadata[$metadata->name] = $metadata; - } - - public function getRootClassMetadata() - { - return reset($this->classMetadata); - } - - public function getOutsideClassMetadata() - { - return end($this->classMetadata); - } - - public function isFresh($timestamp) - { - foreach ($this->classMetadata as $metadata) { - if (!$metadata->isFresh($timestamp)) { - return false; - } - } - - return true; - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/src/Metadata/ClassMetadata.php b/vendor/jms/metadata/src/Metadata/ClassMetadata.php deleted file mode 100644 index 2479a4f..0000000 --- a/vendor/jms/metadata/src/Metadata/ClassMetadata.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Metadata; - -/** - * Base class for class metadata. - * - * This class is intended to be extended to add your own application specific - * properties, and flags. - * - * @author Johannes M. Schmitt - */ -class ClassMetadata implements \Serializable -{ - public $name; - public $reflection; - public $methodMetadata = array(); - public $propertyMetadata = array(); - public $fileResources = array(); - public $createdAt; - - public function __construct($name) - { - $this->name = $name; - - $this->reflection = new \ReflectionClass($name); - $this->createdAt = time(); - } - - public function addMethodMetadata(MethodMetadata $metadata) - { - $this->methodMetadata[$metadata->name] = $metadata; - } - - public function addPropertyMetadata(PropertyMetadata $metadata) - { - $this->propertyMetadata[$metadata->name] = $metadata; - } - - public function isFresh($timestamp = null) - { - if (null === $timestamp) { - $timestamp = $this->createdAt; - } - - foreach ($this->fileResources as $filepath) { - if (!file_exists($filepath)) { - return false; - } - - if ($timestamp < filemtime($filepath)) { - return false; - } - } - - return true; - } - - public function serialize() - { - return serialize(array( - $this->name, - $this->methodMetadata, - $this->propertyMetadata, - $this->fileResources, - $this->createdAt, - )); - } - - public function unserialize($str) - { - list( - $this->name, - $this->methodMetadata, - $this->propertyMetadata, - $this->fileResources, - $this->createdAt - ) = unserialize($str); - - $this->reflection = new \ReflectionClass($this->name); - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/src/Metadata/Driver/AbstractFileDriver.php b/vendor/jms/metadata/src/Metadata/Driver/AbstractFileDriver.php deleted file mode 100644 index b02f387..0000000 --- a/vendor/jms/metadata/src/Metadata/Driver/AbstractFileDriver.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -abstract class AbstractFileDriver implements DriverInterface -{ - private $locator; - - public function __construct(FileLocatorInterface $locator) - { - $this->locator = $locator; - } - - public function loadMetadataForClass(\ReflectionClass $class) - { - if (null === $path = $this->locator->findFileForClass($class, $this->getExtension())) { - return null; - } - - return $this->loadMetadataFromFile($class, $path); - } - - /** - * Parses the content of the file, and converts it to the desired metadata. - * - * @param string $file - * @return ClassMetadata|null - */ - abstract protected function loadMetadataFromFile(\ReflectionClass $class, $file); - - /** - * Returns the extension of the file. - * - * @return string - */ - abstract protected function getExtension(); -} \ No newline at end of file diff --git a/vendor/jms/metadata/src/Metadata/Driver/DriverChain.php b/vendor/jms/metadata/src/Metadata/Driver/DriverChain.php deleted file mode 100644 index 809ccf1..0000000 --- a/vendor/jms/metadata/src/Metadata/Driver/DriverChain.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Metadata\Driver; - -final class DriverChain implements DriverInterface -{ - private $drivers; - - public function __construct(array $drivers) - { - $this->drivers = $drivers; - } - - public function loadMetadataForClass(\ReflectionClass $class) - { - foreach ($this->drivers as $driver) { - if (null !== $metadata = $driver->loadMetadataForClass($class)) { - return $metadata; - } - } - - return null; - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/src/Metadata/Driver/DriverInterface.php b/vendor/jms/metadata/src/Metadata/Driver/DriverInterface.php deleted file mode 100644 index 57ed66d..0000000 --- a/vendor/jms/metadata/src/Metadata/Driver/DriverInterface.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Metadata\Driver; - -interface DriverInterface -{ - function loadMetadataForClass(\ReflectionClass $class); -} diff --git a/vendor/jms/metadata/src/Metadata/Driver/FileLocator.php b/vendor/jms/metadata/src/Metadata/Driver/FileLocator.php deleted file mode 100644 index 41f7b99..0000000 --- a/vendor/jms/metadata/src/Metadata/Driver/FileLocator.php +++ /dev/null @@ -1,29 +0,0 @@ -dirs = $dirs; - } - - public function findFileForClass(\ReflectionClass $class, $extension) - { - foreach ($this->dirs as $prefix => $dir) { - if (0 !== strpos($class->getNamespaceName(), $prefix)) { - continue; - } - - $path = $dir.'/'.str_replace('\\', '.', substr($class->getName(), strlen($prefix)+1)).'.'.$extension; - if (file_exists($path)) { - return $path; - } - } - - return null; - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/src/Metadata/Driver/FileLocatorInterface.php b/vendor/jms/metadata/src/Metadata/Driver/FileLocatorInterface.php deleted file mode 100644 index 5092f3d..0000000 --- a/vendor/jms/metadata/src/Metadata/Driver/FileLocatorInterface.php +++ /dev/null @@ -1,8 +0,0 @@ -container = $container; - $this->realDriverId = $realDriverId; - } - - public function loadMetadataForClass(\ReflectionClass $class) - { - return $this->container->get($this->realDriverId)->loadMetadataForClass($class); - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/src/Metadata/MergeableClassMetadata.php b/vendor/jms/metadata/src/Metadata/MergeableClassMetadata.php deleted file mode 100644 index 13ec158..0000000 --- a/vendor/jms/metadata/src/Metadata/MergeableClassMetadata.php +++ /dev/null @@ -1,23 +0,0 @@ -name = $object->name; - $this->reflection = $object->reflection; - $this->methodMetadata = array_merge($this->methodMetadata, $object->methodMetadata); - $this->propertyMetadata = array_merge($this->propertyMetadata, $object->propertyMetadata); - $this->fileResources = array_merge($this->fileResources, $object->fileResources); - - if ($object->createdAt < $this->createdAt) { - $this->createdAt = $object->createdAt; - } - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/src/Metadata/MergeableInterface.php b/vendor/jms/metadata/src/Metadata/MergeableInterface.php deleted file mode 100644 index 1da234f..0000000 --- a/vendor/jms/metadata/src/Metadata/MergeableInterface.php +++ /dev/null @@ -1,8 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Metadata; - -use Metadata\Driver\DriverInterface; -use Metadata\Cache\CacheInterface; - -final class MetadataFactory implements MetadataFactoryInterface -{ - private $driver; - private $cache; - private $loadedMetadata = array(); - private $loadedClassMetadata = array(); - private $hierarchyMetadataClass; - private $includeInterfaces = false; - private $debug; - - public function __construct(DriverInterface $driver, $hierarchyMetadataClass = 'Metadata\ClassHierarchyMetadata', $debug = false) - { - $this->driver = $driver; - $this->hierarchyMetadataClass = $hierarchyMetadataClass; - $this->debug = $debug; - } - - public function setIncludeInterfaces($bool) - { - $this->includeInterfaces = (Boolean) $bool; - } - - public function setCache(CacheInterface $cache) - { - $this->cache = $cache; - } - - public function getMetadataForClass($className) - { - if (isset($this->loadedMetadata[$className])) { - return $this->loadedMetadata[$className]; - } - - $metadata = null; - foreach ($this->getClassHierarchy($className) as $class) { - if (isset($this->loadedClassMetadata[$name = $class->getName()])) { - $this->addClassMetadata($metadata, $this->loadedClassMetadata[$name]); - continue; - } - - // check the cache - if (null !== $this->cache - && (null !== $classMetadata = $this->cache->loadClassMetadataFromCache($class))) { - if ($this->debug && !$classMetadata->isFresh()) { - $this->cache->evictClassMetadataFromCache($classMetadata->reflection); - } else { - $this->loadedClassMetadata[$name] = $classMetadata; - $this->addClassMetadata($metadata, $classMetadata); - continue; - } - } - - // load from source - if (null !== $classMetadata = $this->driver->loadMetadataForClass($class)) { - $this->loadedClassMetadata[$name] = $classMetadata; - $this->addClassMetadata($metadata, $classMetadata); - - if (null !== $this->cache) { - $this->cache->putClassMetadataInCache($classMetadata); - } - - continue; - } - } - - return $this->loadedMetadata[$className] = $metadata; - } - - private function addClassMetadata(&$metadata, $toAdd) - { - if ($toAdd instanceof MergeableInterface) { - if (null === $metadata) { - $metadata = clone $toAdd; - } else { - $metadata->merge($toAdd); - } - } else { - if (null === $metadata) { - $metadata = new $this->hierarchyMetadataClass; - } - - $metadata->addClassMetadata($toAdd); - } - } - - private function getClassHierarchy($class) - { - $classes = array(); - $refl = new \ReflectionClass($class); - - do { - $classes[] = $refl; - } while (false !== $refl = $refl->getParentClass()); - - $classes = array_reverse($classes, false); - - if (!$this->includeInterfaces) { - return $classes; - } - - $addedInterfaces = array(); - $newHierarchy = array(); - - foreach ($classes as $class) { - foreach ($class->getInterfaces() as $interface) { - if (isset($addedInterfaces[$interface->getName()])) { - continue; - } - $addedInterfaces[$interface->getName()] = true; - - $newHierarchy[] = $interface; - } - - $newHierarchy[] = $class; - } - - return $newHierarchy; - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/src/Metadata/MetadataFactoryInterface.php b/vendor/jms/metadata/src/Metadata/MetadataFactoryInterface.php deleted file mode 100644 index d7fa68a..0000000 --- a/vendor/jms/metadata/src/Metadata/MetadataFactoryInterface.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Metadata; - -interface MetadataFactoryInterface -{ - function getMetadataForClass($className); -} \ No newline at end of file diff --git a/vendor/jms/metadata/src/Metadata/MethodMetadata.php b/vendor/jms/metadata/src/Metadata/MethodMetadata.php deleted file mode 100644 index db2d501..0000000 --- a/vendor/jms/metadata/src/Metadata/MethodMetadata.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Metadata; - -/** - * Base class for method metadata. - * - * This class is intended to be extended to add your application specific - * properties, and flags. - * - * @author Johannes M. Schmitt - */ -class MethodMetadata implements \Serializable -{ - public $class; - public $name; - public $reflection; - - public function __construct($class, $name) - { - $this->class = $class; - $this->name = $name; - - $this->reflection = new \ReflectionMethod($class, $name); - $this->reflection->setAccessible(true); - } - - public function invoke($obj, array $args = array()) - { - return $this->reflection->invokeArgs($obj, $args); - } - - public function serialize() - { - return serialize(array($this->class, $this->name)); - } - - public function unserialize($str) - { - list($this->class, $this->name) = unserialize($str); - - $this->reflection = new \ReflectionMethod($this->class, $this->name); - $this->reflection->setAccessible(true); - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/src/Metadata/PropertyMetadata.php b/vendor/jms/metadata/src/Metadata/PropertyMetadata.php deleted file mode 100644 index a581ce0..0000000 --- a/vendor/jms/metadata/src/Metadata/PropertyMetadata.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Metadata; - -/** - * Base class for property metadata. - * - * This class is intended to be extended to add your application specific - * properties, and flags. - * - * @author Johannes M. Schmitt - */ -class PropertyMetadata implements \Serializable -{ - public $class; - public $name; - public $reflection; - - public function __construct($class, $name) - { - $this->class = $class; - $this->name = $name; - - $this->reflection = new \ReflectionProperty($class, $name); - $this->reflection->setAccessible(true); - } - - public function getValue($obj) - { - return $this->reflection->getValue($obj); - } - - public function setValue($obj, $value) - { - $this->reflection->setValue($obj, $value); - } - - public function serialize() - { - return serialize(array( - $this->class, - $this->name, - )); - } - - public function unserialize($str) - { - list($this->class, $this->name) = unserialize($str); - - $this->reflection = new \ReflectionProperty($this->class, $this->name); - $this->reflection->setAccessible(true); - } -} \ No newline at end of file diff --git a/vendor/jms/metadata/src/Metadata/Version.php b/vendor/jms/metadata/src/Metadata/Version.php deleted file mode 100644 index 0ea37d6..0000000 --- a/vendor/jms/metadata/src/Metadata/Version.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Metadata; - -final class Version -{ - const VERSION = '1.1.1'; -} diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/PreAuthorize.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/PreAuthorize.php deleted file mode 100644 index 0128138..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/PreAuthorize.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Annotation; - -use JMS\SecurityExtraBundle\Exception\InvalidArgumentException; - -/** - * Annotation for expression-based access control. - * - * @Annotation - * @Target("METHOD") - * - * @author Johannes M. Schmitt - */ -final class PreAuthorize -{ - /** - * @Required - * @var string - */ - public $expr; - - public function __construct() - { - if (0 === func_num_args()) { - return; - } - $values = func_get_arg(0); - - if (isset($values['value'])) { - $values['expr'] = $values['value']; - } - if (!isset($values['expr'])) { - throw new InvalidArgumentException('The "expr" attribute must be set for annotation @PreAuthorize.'); - } - - if (!is_string($values['expr'])) { - throw new InvalidArgumentException(sprintf('The "expr" attribute of annotation @PreAuthorize must be a string, but got "%s".', gettype($values['expr']))); - } - - $this->expr = $values['expr']; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/RunAs.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/RunAs.php deleted file mode 100644 index 94de7a3..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/RunAs.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Annotation; - -use JMS\SecurityExtraBundle\Exception\InvalidArgumentException; - -/** - * @Annotation - * @Target("METHOD") - */ -final class RunAs -{ - public $roles; - - public function __construct(array $values) - { - if (isset($values['value'])) { - $values['roles'] = $values['value']; - } - if (!isset($values['roles'])) { - throw new InvalidArgumentException('"roles" must be defined for RunAs annotation.'); - } - - $this->roles = array_map('trim', explode(',', $values['roles'])); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/SatisfiesParentSecurityPolicy.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/SatisfiesParentSecurityPolicy.php deleted file mode 100644 index e087f2f..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/SatisfiesParentSecurityPolicy.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Annotation; - -/** - * This must be declared on classes which inherit from classes that have - * requested method invocation securing capabilities. - * - * It indicates to the analyzer that the developer is aware of these security - * restrictions, and has applied them to the root class in an appropriate - * fashion. - * - * We cannot do this automatically without properly analyzing the control flow, - * and in some cases it is not possible at all. See the following example: - * - * - * // child class - * public function editComment($commentId) - * { - * // retrieve comment from database - * $comment = $this->entityManager->find($commentId); - * - * return parent::editComment($comment); - * } - * - * // base class which is inherited from - * /** - * * @SecureParam(name="comment", permissions="EDIT") - * *\/ - * public function editComment(Comment $comment) - * { - * // do some supposedly secure action - * } - * - * - * The above example can be rewritten so that we can apply security checks - * automatically: - * - * - * // child class - * public function editComment($commentId) - * { - * // retrieve comment from database - * $comment = $this->entityManager->find($commentId); - * - * return $this->doEditComment($comment); - * } - * - * // base class which is inherited from - * /** - * * @SecureParam(name="comment", permissions="EDIT") - * *\/ - * protected function doEditComment(Comment $comment) - * { - * // do some secure action - * } - * - * - * @Annotation - * @Target("METHOD") - * @author Johannes M. Schmitt - */ -final class SatisfiesParentSecurityPolicy -{ -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/Secure.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/Secure.php deleted file mode 100644 index bffd8fd..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/Secure.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Annotation; - -use JMS\SecurityExtraBundle\Exception\InvalidArgumentException; - -/** - * Represents a @Secure annotation. - * - * @Annotation - * @Target("METHOD") - * @author Johannes M. Schmitt - */ -final class Secure -{ - public $roles; - - public function __construct(array $values) - { - if (isset($values['value'])) { - $values['roles'] = $values['value']; - } - if (!isset($values['roles'])) { - throw new InvalidArgumentException('You must define a "roles" attribute for each Secure annotation.'); - } - - $this->roles = array_map('trim', explode(',', $values['roles'])); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/SecureParam.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/SecureParam.php deleted file mode 100644 index ec098b7..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/SecureParam.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Annotation; - -use JMS\SecurityExtraBundle\Exception\InvalidArgumentException; - -/** - * Represents a @SecureParam annotation. - * - * @Annotation - * @Target("METHOD") - * @author Johannes M. Schmitt - */ -final class SecureParam -{ - public $name; - public $permissions; - - public function __construct(array $values) - { - if (!isset($values['name'])) { - throw new InvalidArgumentException('You must define a "name" attribute for each SecureParam annotation.'); - } - if (!isset($values['permissions'])) { - throw new InvalidArgumentException('You must define a "permissions" attribute for each SecureParam annotation.'); - } - - $this->name = $values['name']; - - $this->permissions = array_map('trim', explode(',', $values['permissions'])); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/SecureReturn.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/SecureReturn.php deleted file mode 100644 index 35e071e..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Annotation/SecureReturn.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Annotation; - -use JMS\SecurityExtraBundle\Exception\InvalidArgumentException; - -/** - * Represents a @SecureReturn annotation. - * - * @Annotation - * @Target("METHOD") - * @author Johannes M. Schmitt - */ -final class SecureReturn -{ - public $permissions; - - public function __construct(array $values) - { - if (isset($values['value'])) { - $values['permissions'] = $values['value']; - } - if (!isset($values['permissions'])) { - throw new InvalidArgumentException('You must define a "permissions" attribute for each SecureReturn annotation.'); - } - - $this->permissions = array_map('trim', explode(',', $values['permissions'])); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/CHANGELOG-1.1.md b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/CHANGELOG-1.1.md deleted file mode 100644 index a76156b..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/CHANGELOG-1.1.md +++ /dev/null @@ -1,38 +0,0 @@ -This document details all changes from JMSSecurityExtraBundle 1.0.x to 1.1: - -- The configuration option "secure_controllers" has been removed. This setting is - now automatically enabled, but it requires the JMSDiExtraBundle. - -- The dependencies of this bundle have changed: - - * The metadata library 1.1 version is now required instead of the 1.0 version - (if you are using the Standard Edition, just change the "version=origin/1.0.x" - line from your deps file to "version=1.1.0"). - * The JMSAopBundle is now required. For installation instructions, please see - https://github.com/schmittjoh/JMSAopBundle - * The JMSDiExtraBundle is now required if you want to secure your non-service - controllers (if you only have service controllers, you don't need it). For - installation instructions, see https://github.com/schmittjoh/JMSDiExtraBundle - -- The attribute "IS_IDDQD" has been renamed to "ROLE_IDDQD" - -- A powerful expression-based authorization language has been added which works - in combination with the existing voting system. Since it is much more powerful - than the built-in voters, and also much faster, you are highly encouraged to - migrate your existing authorization rules to expressions, and eventually disable - the built-in voters entirely. Some examples for how to convert simple attributes - to their equivalent expressions are listed below: - - * IS_AUTHENTICATED_ANONYMOUSLY -> "permitAll" - * IS_AUTHENTICATED_REMEMBERED -> "isAuthenticated()" - * IS_AUTHENTICATED_FULLY -> "isFullyAuthenticated()" - * ROLE_FOO -> "hasRole('ROLE_FOO')" - -- The ability to configure method access control (e.g. for controller actions) - in the DI configuration has been added. Note that for non-service controllers - the JMSDiExtraBundle is required. - -- The "is_expr_granted" Twig function has been added if you want to check an - expression from a Twig template. - - diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/AccessControlConfiguration.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/AccessControlConfiguration.php deleted file mode 100644 index dc547a1..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/AccessControlConfiguration.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\DependencyInjection; - -use Symfony\Component\Config\Definition\ConfigurationInterface; - -use Symfony\Component\HttpKernel\Kernel; - -use Symfony\Bundle\SecurityBundle\DependencyInjection\MainConfiguration as BaseConfiguration; -use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory; -use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; - -/** - * Enhances the access_control section configuration. - * - * @author Johannes M. Schmitt - */ -class AccessControlConfiguration implements ConfigurationInterface -{ - /** - * Generates the configuration tree builder. - * - * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder - */ - public function getConfigTreeBuilder() - { - $tb = new TreeBuilder(); - $rootNode = $tb->root('security'); - - $rootNode - ->ignoreExtraKeys() - ->fixXmlConfig('rule', 'access_control') - ->children() - ->arrayNode('access_control') - ->cannotBeOverwritten() - ->prototype('array') - ->fixXmlConfig('role') - ->validate() - ->always(function($v) { - if (!empty($v['roles']) && isset($v['access'])) { - throw new \Exception('"roles", and "access" cannot be set at the same time.'); - } - - if (empty($v['roles'])) { - unset($v['roles']); - } - - return $v; - }) - ->end() - ->children() - ->scalarNode('requires_channel')->defaultNull()->end() - ->scalarNode('path')->defaultNull()->end() - ->scalarNode('host')->defaultNull()->end() - ->scalarNode('ip')->defaultNull()->end() - ->arrayNode('methods') - ->beforeNormalization()->ifString()->then(function($v) { return preg_split('/\s*,\s*/', $v); })->end() - ->prototype('scalar')->end() - ->end() - ->arrayNode('roles') - ->beforeNormalization()->ifString()->then(function($v) { return preg_split('/\s*,\s*/', $v); })->end() - ->prototype('scalar')->end() - ->end() - ->scalarNode('access')->end() - ->end() - ->end() - ->end() - ->end() - ; - - return $tb; - } -} diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Compiler/AddAfterInvocationProvidersPass.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Compiler/AddAfterInvocationProvidersPass.php deleted file mode 100644 index 64547b1..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Compiler/AddAfterInvocationProvidersPass.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * Collects after invocation providers. - * - * @author Johannes M. Schmitt - */ -class AddAfterInvocationProvidersPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('security.access.after_invocation_manager')) { - return; - } - - $providers = array(); - foreach (array_keys($container->findTaggedServiceIds('security.after_invocation.provider')) as $id) { - if ('security.access.after_invocation.acl_provider' === $id && !$container->has('security.acl.provider')) { - continue; - } - - $providers[] = new Reference($id); - } - - $container - ->getDefinition('security.access.after_invocation_manager') - ->setArguments(array($providers)) - ; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Compiler/AddExpressionCompilersPass.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Compiler/AddExpressionCompilersPass.php deleted file mode 100644 index 6b63a42..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Compiler/AddExpressionCompilersPass.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\DependencyInjection\Compiler; - -use JMS\SecurityExtraBundle\Exception\RuntimeException; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -class AddExpressionCompilersPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('security.expressions.compiler')) { - return; - } - - $compilerDef = $container->getDefinition('security.expressions.compiler'); - foreach ($container->findTaggedServiceIds('security.expressions.function_compiler') - as $id => $attr) { - $compilerDef->addMethodCall('addFunctionCompiler', array(new Reference($id))); - } - - foreach ($container->findTaggedServiceIds('security.expressions.type_compiler') - as $id => $attr) { - $compilerDef->addMethodCall('addTypeCompiler', array(new Reference($id))); - } - - $serviceMap = $parameterMap = array(); - foreach ($container->findTaggedServiceIds('security.expressions.variable') as $id => $attributes) { - foreach ($attributes as $attr) { - if (!isset($attr['variable']) || (!isset($attr['service']) && !isset($attr['parameter']))) { - throw new RuntimeException(sprintf('"variable", and either "service" or "parameter" must be given for tag "security.expressions.variable" for service id "%s".', $id)); - } - - if (isset($attr['service'])) { - $serviceMap[$attr['variable']] = $attr['service']; - $container - ->findDefinition($attr['service']) - ->setPublic(true) - ; - } else { - $parameterMap[$attr['variable']] = $attr['parameter']; - } - } - } - $container->getDefinition('security.expressions.variable_compiler') - ->addMethodCall('setMaps', array($serviceMap, $parameterMap)); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Compiler/CollectSecuredServicesPass.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Compiler/CollectSecuredServicesPass.php deleted file mode 100644 index b813b89..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Compiler/CollectSecuredServicesPass.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Collects secured services. - * - * @author Johannes M. Schmitt - */ -class CollectSecuredServicesPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - $securedClasses = array(); - foreach ($container->findTaggedServiceIds('security.secure_service') as $id => $attr) { - $securedClasses[] = $container->getDefinition($id)->getClass(); - } - - $container - ->getDefinition('security.access.pointcut') - ->addMethodCall('setSecuredClasses', array($securedClasses)) - ; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Compiler/DisableVotersPass.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Compiler/DisableVotersPass.php deleted file mode 100644 index fb35bb9..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Compiler/DisableVotersPass.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -class DisableVotersPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if ($container->getParameter('security.role_voter.disabled')) { - $container->removeDefinition('security.access.role_hierarchy_voter'); - $container->removeDefinition('security.access.simple_role_voter'); - } - - if ($container->getParameter('security.authenticated_voter.disabled')) { - $container->removeDefinition('security.access.authenticated_voter'); - } - - if ($container->hasDefinition('security.acl.voter.basic_permissions')) { - if ($container->getParameter('security.acl_voter.disabled')) { - $container->removeDefinition('security.acl.voter.basic_permissions'); - } else { - $container->getDefinition('security.acl.voter.basic_permissions') - ->setClass('JMS\SecurityExtraBundle\Security\Acl\Voter\AclVoter'); - } - } - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Compiler/IntegrationPass.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Compiler/IntegrationPass.php deleted file mode 100644 index abfcdb2..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Compiler/IntegrationPass.php +++ /dev/null @@ -1,22 +0,0 @@ -hasAlias('security.acl.provider') - && !$container->hasDefinition('security.acl.provider')) { - $container->removeDefinition('security.acl.permission_evaluator'); - } - - if ($container->hasDefinition('security.role_hierarchy')) { - $container->getDefinition('security.role_hierarchy') - ->setPublic(true); - } - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Configuration.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Configuration.php deleted file mode 100644 index 70cf1d5..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/Configuration.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\DependencyInjection; - -use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\Config\Definition\ConfigurationInterface; - -class Configuration implements ConfigurationInterface -{ - public function getConfigTreeBuilder() - { - $tb = new TreeBuilder(); - $tb - ->root('jms_security_extra') - ->validate() - ->always(function($v) { - if ($v['method_access_control'] && !$v['expressions']) { - throw new \Exception('You need to enable expressions if you want to configure method access via the DI config.'); - } - - return $v; - }) - ->end() - ->children() - ->booleanNode('secure_all_services')->defaultFalse()->end() - ->booleanNode('enable_iddqd_attribute')->defaultFalse()->end() - ->scalarNode('cache_dir')->cannotBeEmpty()->defaultValue('%kernel.cache_dir%/jms_security')->end() - ->booleanNode('expressions')->defaultFalse()->end() - ->arrayNode('voters') - ->addDefaultsIfNotSet() - ->canBeUnset() - ->children() - ->booleanNode('disable_authenticated')->defaultFalse()->end() - ->booleanNode('disable_role')->defaultFalse()->end() - ->booleanNode('disable_acl')->defaultFalse()->end() - ->end() - ->end() - ->arrayNode('method_access_control') - ->useAttributeAsKey('pattern') - ->prototype('scalar')->isRequired()->cannotBeEmpty()->end() - ->end() - ->end() - ->end() - ; - - return $tb; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/JMSSecurityExtraExtension.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/JMSSecurityExtraExtension.php deleted file mode 100644 index cd2e1c2..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/JMSSecurityExtraExtension.php +++ /dev/null @@ -1,100 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\DependencyInjection; - -use Symfony\Component\DependencyInjection\Reference; - -use JMS\SecurityExtraBundle\Exception\RuntimeException; -use Symfony\Component\HttpKernel\DependencyInjection\Extension; -use Symfony\Component\Config\FileLocator; -use Symfony\Component\Config\Definition\Processor; -use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * JMSSecurityExtraExtension. - * - * @author Johannes M. Schmitt - */ -class JMSSecurityExtraExtension extends Extension -{ - public function load(array $configs, ContainerBuilder $container) - { - $bundles = $container->getParameter('kernel.bundles'); - if (!isset($bundles['JMSAopBundle'])) { - throw new RuntimeException('The JMSSecurityExtraBundle requires the JMSAopBundle, please make sure to enable it in your AppKernel.'); - } - - $config = $this->processConfiguration(new Configuration(), $configs); - - $loader = new XmlFileLoader($container, new FileLocator(array(__DIR__.'/../Resources/config/'))); - $loader->load('services.xml'); - - $container->setParameter('security.access.secure_all_services', $config['secure_all_services']); - - $cacheDir = $container->getParameterBag()->resolveValue($config['cache_dir']); - if (!is_dir($cacheDir)) { - if (false === @mkdir($cacheDir, 0777, true)) { - throw new RuntimeException(sprintf('Could not create cache directory "%s".', $cacheDir)); - } - } - $container->setParameter('security.extra.cache_dir', $cacheDir); - - if ($config['expressions']) { - $loader->load('security_expressions.xml'); - - if (!is_dir($cacheDir.'/expressions')) { - if (false === @mkdir($cacheDir.'/expressions', 0777, true)) { - throw new RuntimeException(sprintf('Could not create cache directory "%s".', $cacheDir.'/expressions')); - } - } - - $container->getDefinition('security.expressions.voter') - ->addMethodCall('setCacheDir', array($cacheDir.'/expressions')); - } - - $disableAllVoters = !isset($config['voters']); - $container->setParameter('security.authenticated_voter.disabled', - $disableAllVoters || $config['voters']['disable_authenticated']); - $container->setParameter('security.role_voter.disabled', - $disableAllVoters || $config['voters']['disable_role']); - $container->setParameter('security.acl_voter.disabled', - $disableAllVoters || $config['voters']['disable_acl']); - - if ($config['enable_iddqd_attribute']) { - $container - ->getDefinition('security.extra.iddqd_voter') - ->addTag('security.voter') - ; - - // FIXME: Also add an iddqd after invocation provider - } - - if ($config['method_access_control']) { - $driverDef = $container->getDefinition('security.extra.driver_chain'); - $args = $driverDef->getArguments(); - array_unshift($args[0], new Reference('security.extra.config_driver')); - $driverDef->setArguments($args); - - $container->setParameter('security.access.method_access_control', - $config['method_access_control']); - } - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/SecurityExtension.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/SecurityExtension.php deleted file mode 100644 index 96ddf99..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/DependencyInjection/SecurityExtension.php +++ /dev/null @@ -1,130 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\DependencyInjection; - -use Symfony\Component\HttpKernel\DependencyInjection\Extension; -use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension as BaseSecurityExtension; -use Symfony\Component\HttpKernel\Kernel; -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\Config\FileLocator; - -/** - * Enhances the access_control section of the SecurityBundle. - * - * @author Johannes M. Schmitt - */ -class SecurityExtension extends Extension -{ - private $extension; - - public function __construct(BaseSecurityExtension $extension) - { - $this->extension = $extension; - } - - public function getAlias() - { - return $this->extension->getAlias(); - } - - public function getNamespace() - { - return $this->extension->getNamespace(); - } - - public function getXsdValidationBasePath() - { - return $this->extension->getXsdValidationBasePath(); - } - - public function getClassesToCompile() - { - return array_merge(parent::getClassesToCompile(), $this->extension->getClassesToCompile()); - } - - public function load(array $configs, ContainerBuilder $container) - { - $parentConfigs = array(); - - foreach ($configs as $config) { - if (isset($config['rule'])) { - unset($config['rule']); - } - if (isset($config['access_control'])) { - unset($config['access_control']); - } - - $parentConfigs[] = $config; - } - $this->extension->load($parentConfigs, $container); - - $config = $this->processConfiguration(new AccessControlConfiguration(), $configs); - $this->createAuthorization($config, $container); - } - - public function __call($method, array $args) - { - return call_user_func_array(array($this->extension, $method), $args); - } - - private function createAuthorization($config, ContainerBuilder $container) - { - if (!$config['access_control']) { - return; - } - - $this->addClassesToCompile(array( - 'Symfony\\Component\\Security\\Http\\AccessMap', - )); - - foreach ($config['access_control'] as $access) { - $matcher = $this->invokeParent('createRequestMatcher', array( - $container, - $access['path'], - $access['host'], - count($access['methods']) === 0 ? null : $access['methods'], - $access['ip'] - )); - - if (isset($access['roles'])) { - $attributes = $access['roles']; - } else { - $def = new DefinitionDecorator('security.expressions.expression'); - $def->addArgument($access['access']); - $container->setDefinition($exprId = 'security.expressions.expression.'.sha1($access['access']), $def); - - $attributes = array(new Reference($exprId)); - } - - $container->getDefinition('security.access_map') - ->addMethodCall('add', array($matcher, $attributes, $access['requires_channel'])); - } - } - - private function invokeParent($method, array $args = array()) - { - $ref = new \ReflectionMethod($this->extension, $method); - $ref->setAccessible(true); - - return $ref->invokeArgs($this->extension, $args); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Exception/Exception.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Exception/Exception.php deleted file mode 100644 index b6606f9..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Exception/Exception.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Exception; - -/** - * Base exception for the SecurityExtraBundle. - * - * @author Johannes M. Schmitt - */ -interface Exception -{ -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Exception/InvalidArgumentException.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Exception/InvalidArgumentException.php deleted file mode 100644 index 6a9f2ae..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Exception; - -/** - * InvalidArgumentException for the SecurityExtraBundle. - * - * @author Johannes M. Schmitt - */ -class InvalidArgumentException extends \InvalidArgumentException implements Exception -{ -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Exception/RuntimeException.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Exception/RuntimeException.php deleted file mode 100644 index b7bb573..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Exception/RuntimeException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Exception; - -/** - * RuntimeException for the SecurityExtraBundle. - * - * @author Johannes M. Schmitt - */ -class RuntimeException extends \RuntimeException implements Exception -{ -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/JMSSecurityExtraBundle.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/JMSSecurityExtraBundle.php deleted file mode 100644 index 6f5c0e3..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/JMSSecurityExtraBundle.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle; - -use JMS\SecurityExtraBundle\DependencyInjection\SecurityExtension; -use JMS\SecurityExtraBundle\DependencyInjection\Compiler\IntegrationPass; -use JMS\SecurityExtraBundle\DependencyInjection\Compiler\DisableVotersPass; -use JMS\SecurityExtraBundle\DependencyInjection\Compiler\AddExpressionCompilersPass; -use Symfony\Component\DependencyInjection\Compiler\PassConfig; -use JMS\SecurityExtraBundle\DependencyInjection\Compiler\AddAfterInvocationProvidersPass; -use JMS\SecurityExtraBundle\DependencyInjection\Compiler\CollectSecuredServicesPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\HttpKernel\Bundle\Bundle; - -/** - * Registers our custom compiler pass. - * - * @author Johannes M. Schmitt - */ -class JMSSecurityExtraBundle extends Bundle -{ - const VERSION = '1.1.0'; - - public function build(ContainerBuilder $container) - { - if (!$container->hasExtension('security')) { - throw new \LogicException('The JMSSecurityExtraBundle must be registered after the SecurityBundle in your AppKernel.php.'); - } - $container->registerExtension(new SecurityExtension($container->getExtension('security'))); - - $passConfig = $container->getCompilerPassConfig(); - - // needs to run before voter collection - $passes = $passConfig->getBeforeOptimizationPasses(); - array_unshift($passes, new DisableVotersPass()); - $passConfig->setBeforeOptimizationPasses($passes); - - $passConfig->addPass(new AddAfterInvocationProvidersPass()); - $passConfig->addPass(new CollectSecuredServicesPass()); - $passConfig->addPass(new AddExpressionCompilersPass()); - $passConfig->addPass(new IntegrationPass()); - } -} diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Metadata/ClassMetadata.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Metadata/ClassMetadata.php deleted file mode 100644 index 5f692cb..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Metadata/ClassMetadata.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Metadata; - -use JMS\SecurityExtraBundle\Exception\RuntimeException; -use JMS\SecurityExtraBundle\Exception\InvalidArgumentException; -use Metadata\MethodMetadata; -use Metadata\MergeableInterface; -use Metadata\MergeableClassMetadata; - -/** - * Contains class metadata information - * - * @author Johannes M. Schmitt - */ -class ClassMetadata extends MergeableClassMetadata -{ - public function addMethodMetadata(MethodMetadata $metadata) - { - if ($this->reflection->isFinal()) { - throw new RuntimeException(sprintf('Class "%s" is declared final, and cannot be secured.', $reflection->name)); - } - - if ($metadata->reflection->isStatic()) { - throw new RuntimeException(sprintf('Method "%s::%s" is declared static and cannot be secured.', $metadata->reflection->class, $metadata->reflection->name)); - } - - if ($metadata->reflection->isFinal()) { - throw new RuntimeException(sprintf('Method "%s::%s" is declared final and cannot be secured.', $metadata->reflection->class, $metadata->reflection->name)); - } - - parent::addMethodMetadata($metadata); - } - - public function merge(MergeableInterface $metadata) - { - if (!$metadata instanceof ClassMetadata) { - throw new InvalidArgumentException('$metadata must be an instance of ClassMetadata.'); - } - - foreach ($this->methodMetadata as $name => $methodMetadata) { - // check if metadata was declared on an interface - if (!$metadata->reflection->hasMethod($name)) { - continue; - } - - if ($metadata->reflection->getMethod($name)->getDeclaringClass()->name - !== $methodMetadata->class) { - if (!isset($metadata->methodMetadata[$name])) { - if ($methodMetadata->reflection->isAbstract()) { - continue; - } - - throw new RuntimeException(sprintf( - 'You have overridden a secured method "%s::%s" in "%s". ' - .'Please copy over the applicable security metadata, and ' - .'also add @SatisfiesParentSecurityPolicy.', - $methodMetadata->reflection->class, - $name, - $metadata->reflection->name - )); - } - - if (!$metadata->methodMetadata[$name]->satisfiesParentSecurityPolicy) { - throw new RuntimeException(sprintf('Unresolved security metadata conflict for method "%s::%s" in "%s". Please copy the respective annotations, and add @SatisfiesParentSecurityPolicy to the child method.', $metadata->reflection->name, $name, $methodMetadata->reflection->getDeclaringClass()->getFilename())); - } - } - } - - parent::merge($metadata); - } - - public function isProxyRequired() - { - return !empty($this->methodMetadata); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Metadata/Driver/AnnotationDriver.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Metadata/Driver/AnnotationDriver.php deleted file mode 100644 index 7617c60..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Metadata/Driver/AnnotationDriver.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Metadata\Driver; - -use JMS\SecurityExtraBundle\Exception\InvalidArgumentException; -use Doctrine\Common\Annotations\Reader; -use JMS\SecurityExtraBundle\Annotation\PreAuthorize; -use JMS\SecurityExtraBundle\Annotation\RunAs; -use JMS\SecurityExtraBundle\Annotation\SatisfiesParentSecurityPolicy; -use JMS\SecurityExtraBundle\Annotation\Secure; -use JMS\SecurityExtraBundle\Annotation\SecureParam; -use JMS\SecurityExtraBundle\Annotation\SecureReturn; -use JMS\SecurityExtraBundle\Metadata\ClassMetadata; -use JMS\SecurityExtraBundle\Metadata\MethodMetadata; -use Metadata\Driver\DriverInterface; -use \ReflectionClass; -use \ReflectionMethod; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Expression; - -/** - * Loads security annotations and converts them to metadata - * - * @author Johannes M. Schmitt - */ -class AnnotationDriver implements DriverInterface -{ - private $reader; - - public function __construct(Reader $reader) - { - $this->reader = $reader; - } - - public function loadMetadataForClass(ReflectionClass $reflection) - { - $metadata = new ClassMetadata($reflection->getName()); - - foreach ($reflection->getMethods(ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED) as $method) { - // check if the method was defined on this class - if ($method->getDeclaringClass()->getName() !== $reflection->getName()) { - continue; - } - - $annotations = $this->reader->getMethodAnnotations($method); - - if ($annotations && null !== $methodMetadata = $this->convertMethodAnnotations($method, $annotations)) { - $metadata->addMethodMetadata($methodMetadata); - } - } - - return $metadata; - } - - private function convertMethodAnnotations(\ReflectionMethod $method, array $annotations) - { - $parameters = array(); - foreach ($method->getParameters() as $index => $parameter) { - $parameters[$parameter->getName()] = $index; - } - - $methodMetadata = new MethodMetadata($method->getDeclaringClass()->getName(), $method->getName()); - $hasSecurityMetadata = false; - foreach ($annotations as $annotation) { - if ($annotation instanceof Secure) { - $methodMetadata->roles = $annotation->roles; - $hasSecurityMetadata = true; - } else if ($annotation instanceof PreAuthorize) { - $methodMetadata->roles = array(new Expression($annotation->expr)); - $hasSecurityMetadata = true; - } else if ($annotation instanceof SecureParam) { - if (!isset($parameters[$annotation->name])) { - throw new InvalidArgumentException(sprintf('The parameter "%s" does not exist for method "%s".', $annotation->name, $method->getName())); - } - - $methodMetadata->addParamPermissions($parameters[$annotation->name], $annotation->permissions); - $hasSecurityMetadata = true; - } else if ($annotation instanceof SecureReturn) { - $methodMetadata->returnPermissions = $annotation->permissions; - $hasSecurityMetadata = true; - } else if ($annotation instanceof SatisfiesParentSecurityPolicy) { - $methodMetadata->satisfiesParentSecurityPolicy = true; - $hasSecurityMetadata = true; - } else if ($annotation instanceof RunAs) { - $methodMetadata->runAsRoles = $annotation->roles; - $hasSecurityMetadata = true; - } - } - - return $hasSecurityMetadata ? $methodMetadata : null; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Metadata/Driver/ConfigDriver.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Metadata/Driver/ConfigDriver.php deleted file mode 100644 index 00dd89e..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Metadata/Driver/ConfigDriver.php +++ /dev/null @@ -1,100 +0,0 @@ - - */ -class ConfigDriver implements DriverInterface -{ - private $bundles; - private $config; - - public function __construct(array $bundles, array $config) - { - uasort($bundles, function($a, $b) { - return strlen($b) - strlen($a); - }); - - foreach ($bundles as $name => $namespace) { - $bundles[$name] = substr($namespace, 0, strrpos($namespace, '\\')); - } - - $this->bundles = $bundles; - $this->config = $config; - } - - public function loadMetadataForClass(\ReflectionClass $class) - { - $metadata = new ClassMetadata($class->name); - - foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $method) { - if ($method->getDeclaringClass()->name !== $class->name) { - continue; - } - - $expression = null; - if (null !== $notation = $this->getControllerNotation($method)) { - $expression = $this->getExpressionForSignature($notation); - } - - if (null === $expression && null === $expression = - $this->getExpressionForSignature($method->class.'::'.$method->name)) { - continue; - } - - $methodMetadata = new MethodMetadata($method->class, $method->name); - $methodMetadata->roles = array(new Expression($expression)); - $metadata->addMethodMetadata($methodMetadata); - } - - if (!$metadata->methodMetadata) { - return null; - } - - return $metadata; - } - - private function getExpressionForSignature($signature) - { - foreach ($this->config as $pattern => $expr) { - if (!preg_match('#'.$pattern.'#i', $signature)) { - continue; - } - - return $expr; - } - - return null; - } - - // TODO: Is it feasible to reverse-engineer the notation for service controllers? - private function getControllerNotation(\ReflectionMethod $method) - { - $signature = $method->class.'::'.$method->name; - - // check if class is a controller - if (0 === preg_match('#\\\\Controller\\\\([^\\\\]+)Controller::(.+)Action$#', $signature, $match)) { - return null; - } - - foreach ($this->bundles as $name => $namespace) { - if (0 !== strpos($method->class, $namespace)) { - continue; - } - - // controller notation (AcmeBundle:Foo:foo) - return $name.':'.$match[1].':'.$match[2]; - } - - return null; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Metadata/MethodMetadata.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Metadata/MethodMetadata.php deleted file mode 100644 index 6bec7ce..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Metadata/MethodMetadata.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Metadata; - -use Metadata\MethodMetadata as BaseMethodMetadata; - -/** - * Contains method metadata information - * - * @author Johannes M. Schmitt - */ -class MethodMetadata extends BaseMethodMetadata -{ - public $roles = array(); - public $paramPermissions = array(); - public $returnPermissions = array(); - public $runAsRoles = array(); - public $satisfiesParentSecurityPolicy = false; - - /** - * Adds a parameter restriction - * - * @param integer $index 0-based - * @param array $permissions - */ - public function addParamPermissions($index, array $permissions) - { - $this->paramPermissions[$index] = $permissions; - } - - public function isDeclaredOnInterface() - { - foreach ($this->reflection->getDeclaringClass()->getInterfaces() as $interface) { - if ($interface->hasMethod($this->name)) { - return true; - } - } - - return false; - } - - /** - * This allows to merge in metadata from an interface - * - * @param MethodMetadata $method - * @return void - */ - public function merge(MethodMetadata $method) - { - if (!$this->roles) { - $this->roles = $method->roles; - } - - if (!$this->returnPermissions) { - $this->returnPermissions = $method->returnPermissions; - } - - if (!$this->runAsRoles) { - $this->runAsRoles = $method->runAsRoles; - } - - foreach ($method->paramPermissions as $index => $permissions) { - if (!isset($this->paramPermissions[$index])) { - $this->paramPermissions[$index] = $permissions; - } - } - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/README b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/README deleted file mode 100644 index 72bab21..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/README +++ /dev/null @@ -1,8 +0,0 @@ -For documentation, see: - - Resources/doc - - -For license, see: - - Resources/meta/LICENSE \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Resources/config/security_expressions.xml b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Resources/config/security_expressions.xml deleted file mode 100644 index 493e2ea..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Resources/config/security_expressions.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - JMS\SecurityExtraBundle\Security\Acl\Expression\PermissionEvaluator - JMS\SecurityExtraBundle\Security\Acl\Expression\HasPermissionFunctionCompiler - - JMS\SecurityExtraBundle\Security\Authorization\Expression\LazyLoadingExpressionVoter - JMS\SecurityExtraBundle\Security\Authorization\Expression\ContainerAwareExpressionHandler - - JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler - JMS\SecurityExtraBundle\Security\Authorization\Expression\Expression - - JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\ContainerAwareVariableCompiler - JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\ParameterExpressionCompiler - - JMS\SecurityExtraBundle\Metadata\Driver\ConfigDriver - - JMS\SecurityExtraBundle\Twig\SecurityExtension - - - - - - - - - - %kernel.bundles% - %security.access.method_access_control% - - - - - - - - - - - - - - - - - - - - security.expressions.compiler - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Resources/config/services.xml b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Resources/config/services.xml deleted file mode 100644 index 0ad446c..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Resources/config/services.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - JMS\SecurityExtraBundle\Security\Authorization\Interception\MethodSecurityInterceptor - - - JMS\SecurityExtraBundle\Security\Authorization\RunAsManager - JMS\SecurityExtraBundle\Security\Authentication\Provider\RunAsAuthenticationProvider - RunAsToken - ROLE_ - - JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AfterInvocationManager - JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AclAfterInvocationProvider - - JMS\SecurityExtraBundle\Security\Authorization\Voter\IddqdVoter - - Metadata\MetadataFactory - Metadata\Driver\LazyLoadingDriver - Metadata\Driver\DriverChain - JMS\SecurityExtraBundle\Metadata\Driver\AnnotationDriver - Metadata\Cache\FileCache - - - - - %security.run_as.key% - %security.run_as.role_prefix% - - - - - - - - - - - - - - - %security.access.secure_all_services% - %security.access.method_access_control% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - security.extra.metadata_driver - - - - - - - - %security.extra.cache_dir% - %kernel.debug% - - - - - - \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Resources/doc/index.rst b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Resources/doc/index.rst deleted file mode 100644 index 8b41a2f..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Resources/doc/index.rst +++ /dev/null @@ -1,352 +0,0 @@ -======== -Overview -======== - -This bundle enhances the Symfony2 Security Component by adding several new features. - -Features: - -- powerful expression-based authorization language -- method security authorization -- authorization configuration via annotations - -Installation ------------- -Add the following to your ``deps`` file:: - - [JMSSecurityExtraBundle] - git=https://github.com/schmittjoh/JMSSecurityExtraBundle.git - target=/bundles/JMS/SecurityExtraBundle - - ; Dependencies: - ;-------------- - [metadata] - git=https://github.com/schmittjoh/metadata.git - version=1.1.0 ; <- make sure to get 1.1, not 1.0 - - ; see https://github.com/schmittjoh/JMSAopBundle/blob/master/Resources/doc/index.rst - [JMSAopBundle] - git=https://github.com/schmittjoh/JMSAopBundle.git - target=/bundles/JMS/AopBundle - - [cg-library] - git=https://github.com/schmittjoh/cg-library.git - - ; This dependency is optional (you need it if you are using non-service controllers): - ; see https://github.com/schmittjoh/JMSDiExtraBundle/blob/master/Resources/doc/index.rst - [JMSDiExtraBundle] - git=https://github.com/schmittjoh/JMSDiExtraBundle.git - target=/bundles/JMS/DiExtraBundle - -Then register the bundle with your kernel:: - - // in AppKernel::registerBundles() - $bundles = array( - // ... - new JMS\AopBundle\JMSAopBundle(), - new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(), - new JMS\DiExtraBundle\JMSDiExtraBundle($this), - // ... - ); - -Make sure that you also register the namespaces with the autoloader:: - - // app/autoload.php - $loader->registerNamespaces(array( - // ... - 'JMS' => __DIR__.'/../vendor/bundles', - 'Metadata' => __DIR__.'/../vendor/metadata/src', - 'CG' => __DIR__.'/../vendor/cg-library/src', - // ... - )); - -Configuration -------------- - -Below, you find the default configuration:: - - # app/config/config.yml - jms_security_extra: - # Whether you want to secure all services (true), or only secure specific - # services (false); see also below - secure_all_services: false - - # Enabling this setting will add an additional special attribute "IS_IDDQD". - # Anybody with this attribute will effectively bypass all security checks. - enable_iddqd_attribute: false - - # Enables expression language - expressions: false - - # Allows you to disable some, or all built-in voters - voters: - disable_authenticated: false - disable_role: false - disable_acl: false - - # Allows you to specify access control rules for specific methods, such - # as controller actions - method_access_control: { } - - -Expression-based Authorization Language ---------------------------------------- -The expression language is a very powerful alternative to the simple attributes -of the security voting system. They allow to perform complex access decision -checks, and because they are compiled down to raw PHP, they are much faster than -the built-in voters. Also they are lazy-loading by nature, so you will also -save some resources for example by not having to initialize the entire ACL system -on each request. - -Programmatic Usage -~~~~~~~~~~~~~~~~~~ -You can execute expressions programmatically by using the ``isGranted`` method -of the SecurityContext. Some examples:: - - use JMS\SecurityExtraBundle\Security\Authorization\Expression\Expression; - - $securityContext->isGranted(array(new Expression('hasRole("A")'))); - $securityContext->isGranted(array(new Expression('hasRole("A") or (hasRole("B") and hasRole("C"))'))); - $securityContext->isGranted(array(new Expression('hasPermission(object, "VIEW")'), $object)); - $securityContext->isGranted(array(new Expression('token.getUsername() == "Johannes"'))); - -Twig Usage -~~~~~~~~~~ -You can check expressions from Twig templates using the ``is_expr_granted`` -function. Some examples:: - - is_expr_granted("hasRole('FOO')") - is_expr_granted("hasPermission(object, 'VIEW')", object) - -Usage in Access Control -~~~~~~~~~~~~~~~~~~~~~~~ -You can also use expressions in the ``access_control``:: - - security: - access_control: - - { path: ^/foo, access: "hasRole('FOO') and hasRole('BAR')" } - -Annotation-based Usage -~~~~~~~~~~~~~~~~~~~~~~ -see @PreAuthorize in the annotation reference - -Reference -~~~~~~~~~ -+-----------------------------------+--------------------------------------------+ -| Expression | Description | -+===================================+============================================+ -| hasRole('ROLE') | Checks whether the token has a certain | -| | role. | -+-----------------------------------+--------------------------------------------+ -| hasAnyRole('ROLE1', 'ROLE2', ...) | Checks whether the token has any of the | -| | given roles. | -+-----------------------------------+--------------------------------------------+ -| isAnonymous() | Checks whether the token is anonymous. | -+-----------------------------------+--------------------------------------------+ -| isRememberMe() | Checks whether the token is remember me. | -+-----------------------------------+--------------------------------------------+ -| isFullyAuthenticated() | Checks whether the token is fully | -| | authenticated. | -+-----------------------------------+--------------------------------------------+ -| isAuthenticated() | Checks whether the token is not anonymous. | -+-----------------------------------+--------------------------------------------+ -| hasPermission(*var*, 'PERMISSION')| Checks whether the token has the given | -| | permission for the given object (requires | -| | the ACL system). | -+-----------------------------------+--------------------------------------------+ -| token | Variable that refers to the token | -| | which is currently in the security context.| -+-----------------------------------+--------------------------------------------+ -| user | Variable that refers to the user | -| | which is currently in the security context.| -+-----------------------------------+--------------------------------------------+ -| object | Variable that refers to the object for | -| | which access is being requested. | -+-----------------------------------+--------------------------------------------+ -| #*paramName* | Any identifier prefixed with # refers to | -| | a parameter of the same name that is passed| -| | to the method where the expression is used.| -+-----------------------------------+--------------------------------------------+ -| and / && | Binary "and" operator | -+-----------------------------------+--------------------------------------------+ -| or / || | Binary "or" operator | -+-----------------------------------+--------------------------------------------+ -| == | Binary "is equal" operator | -+-----------------------------------+--------------------------------------------+ -| not / ! | Negation operator | -+-----------------------------------+--------------------------------------------+ - -Method Security Authorization ------------------------------ -Generally, you can secure all public, or protected methods which are non-static, -and non-final. Private methods cannot be secured. You can also add metadata for -abstract methods, or interfaces which will then be applied to their concrete -implementations automatically. - -Access Control via DI configuration -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -You can specify access control **expressions** in the DI configuration:: - - # config.yml - jms_security_extra: - method_access_control: - ':loginAction$': 'isAnonymous()' - 'AcmeFooBundle:.*:deleteAction': 'hasRole("ROLE_ADMIN")' - '^MyNamespace\MyService::foo$': 'hasPermission(#user, "VIEW")' - -The pattern is a case-sensitive regular expression which is matched against two notations. -The first match is being used. - -First, your pattern is matched against the notation for non-service controllers. -This obviously is only done if your class is actually a controller, e.g. -``AcmeFooBundle:Add:new`` for a controller named ``AddController`` and a method -named ``newAction`` in a sub-namespace ``Controller`` in a bundle named ``AcmeFooBundle``. - -Last, your pattern is matched against the concatenation of the class name, and -the method name that is being called, e.g. ``My\Fully\Qualified\ClassName::myMethodName``. - -**Note:** If you would like to secure non-service controllers, the -``JMSDiExtraBundle`` must be installed. - -Access Control via Annotations -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -If you like to secure a service with annotations, you need to enable annotation -configuration for this service:: - - - - - -In case, you like to configure all services via annotations, you can also set -``secure_all_services`` to true. Then, you do not need to add a tag for each -service. - - -Annotations ------------ -@PreAuthorize -~~~~~~~~~~~~~ -This annotation lets you define an expression (see the expression language -paragraph) which is executed prior to invoking a method:: - - myPrivateService->aMethodOnlyToBeInvokedThroughASpecificChannel(); - } - } - -@SatisfiesParentSecurityPolicy -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -This must be defined on a method that overrides a method which has security metadata. -It is there to ensure that you are aware the security of the overridden method cannot -be enforced anymore, and that you must copy over all annotations if you want to keep -them. diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Resources/meta/LICENSE b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Resources/meta/LICENSE deleted file mode 100644 index 753842b..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Resources/meta/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Acl/Expression/HasPermissionFunctionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Acl/Expression/HasPermissionFunctionCompiler.php deleted file mode 100644 index 340617b..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Acl/Expression/HasPermissionFunctionCompiler.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Acl\Expression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ConstantExpression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\Func\FunctionCompilerInterface; - -class HasPermissionFunctionCompiler implements FunctionCompilerInterface -{ - public function getName() - { - return 'hasPermission'; - } - - public function compilePreconditions(ExpressionCompiler $compiler, FunctionExpression $function) - { - $compiler->verifyItem('token', 'Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - } - - public function compile(ExpressionCompiler $compiler, FunctionExpression $function) - { - $compiler - ->compileInternal(new VariableExpression('permission_evaluator')) - ->write('->hasPermission(') - ->compileInternal(new VariableExpression('token')) - ->write(', ') - ->compileInternal($function->args[0]) - ->write(', ') - ; - - if ($function->args[1] instanceof ConstantExpression) { - $compiler->write(var_export(strtoupper($function->args[1]->value), true).')'); - - return; - } - - $compiler - ->write('strtoupper(') - ->compileInternal($function->args[1]) - ->write('))') - ; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Acl/Expression/PermissionEvaluator.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Acl/Expression/PermissionEvaluator.php deleted file mode 100644 index 96111fc..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Acl/Expression/PermissionEvaluator.php +++ /dev/null @@ -1,122 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Acl\Expression; - -use Symfony\Component\Security\Acl\Exception\NoAceFoundException; -use Symfony\Component\Security\Acl\Exception\AclNotFoundException; -use Symfony\Component\Security\Acl\Model\ObjectIdentityInterface; -use Symfony\Component\Security\Acl\Permission\PermissionMapInterface; -use Symfony\Component\Security\Acl\Model\AclProviderInterface; -use Symfony\Component\Security\Acl\Model\SecurityIdentityRetrievalStrategyInterface; -use Symfony\Component\Security\Acl\Model\ObjectIdentityRetrievalStrategyInterface; -use Symfony\Component\HttpKernel\Log\LoggerInterface; -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; - -class PermissionEvaluator -{ - private $aclProvider; - private $oidRetrievalStrategy; - private $sidRetrievalStrategy; - private $permissionMap; - private $allowIfObjectIdentityUnavailable; - private $logger; - - public function __construct(AclProviderInterface $aclProvider, - ObjectIdentityRetrievalStrategyInterface $oidRetrievalStrategy, - SecurityIdentityRetrievalStrategyInterface $sidRetrievalStrategy, - PermissionMapInterface $permissionMap, - $allowIfObjectIdentityUnavailable = true, - LoggerInterface $logger = null) - { - $this->aclProvider = $aclProvider; - $this->oidRetrievalStrategy = $oidRetrievalStrategy; - $this->sidRetrievalStrategy = $sidRetrievalStrategy; - $this->permissionMap = $permissionMap; - $this->allowIfObjectIdentityUnavailable = $allowIfObjectIdentityUnavailable; - $this->logger = $logger; - } - - public function hasPermission(TokenInterface $token, $object, $permission) - { - if (null === $masks = $this->permissionMap->getMasks($permission, $object)) { - return false; - } - - if (null === $object) { - if (null !== $this->logger) { - $this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable? 'grant access' : 'abstain')); - } - - return $this->allowIfObjectIdentityUnavailable ? true : false; - } else if ($object instanceof FieldVote) { - $field = $object->getField(); - $object = $object->getDomainObject(); - } else { - $field = null; - } - - if ($object instanceof ObjectIdentityInterface) { - $oid = $object; - } else if (null === $oid = $this->oidRetrievalStrategy->getObjectIdentity($object)) { - if (null !== $this->logger) { - $this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable? 'grant access' : 'abstain')); - } - - return $this->allowIfObjectIdentityUnavailable ? true : false; - } - - $sids = $this->sidRetrievalStrategy->getSecurityIdentities($token); - - try { - $acl = $this->aclProvider->findAcl($oid, $sids); - - if (null === $field && $acl->isGranted($masks, $sids, false)) { - if (null !== $this->logger) { - $this->logger->debug('ACL found, permission granted. Voting to grant access'); - } - - return true; - } else if (null !== $field && $acl->isFieldGranted($field, $masks, $sids, false)) { - if (null !== $this->logger) { - $this->logger->debug('ACL found, permission granted. Voting to grant access'); - } - - return true; - } - - if (null !== $this->logger) { - $this->logger->debug('ACL found, insufficient permissions. Voting to deny access.'); - } - - return false; - } catch (AclNotFoundException $noAcl) { - if (null !== $this->logger) { - $this->logger->debug('No ACL found for the object identity. Voting to deny access.'); - } - - return false; - } catch (NoAceFoundException $noAce) { - if (null !== $this->logger) { - $this->logger->debug('ACL found, no ACE applicable. Voting to deny access.'); - } - - return false; - } - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Acl/Voter/AclVoter.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Acl/Voter/AclVoter.php deleted file mode 100644 index bad27d8..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Acl/Voter/AclVoter.php +++ /dev/null @@ -1,136 +0,0 @@ - - */ -class AclVoter implements VoterInterface -{ - private $aclProvider; - private $permissionMap; - private $objectIdentityRetrievalStrategy; - private $securityIdentityRetrievalStrategy; - private $allowIfObjectIdentityUnavailable; - private $logger; - - public function __construct(AclProviderInterface $aclProvider, ObjectIdentityRetrievalStrategyInterface $oidRetrievalStrategy, SecurityIdentityRetrievalStrategyInterface $sidRetrievalStrategy, PermissionMapInterface $permissionMap, LoggerInterface $logger = null, $allowIfObjectIdentityUnavailable = true) - { - $this->aclProvider = $aclProvider; - $this->permissionMap = $permissionMap; - $this->objectIdentityRetrievalStrategy = $oidRetrievalStrategy; - $this->securityIdentityRetrievalStrategy = $sidRetrievalStrategy; - $this->logger = $logger; - $this->allowIfObjectIdentityUnavailable = $allowIfObjectIdentityUnavailable; - } - - public function supportsAttribute($attribute) - { - return $this->permissionMap->contains($attribute); - } - - public function vote(TokenInterface $token, $object, array $attributes) - { - foreach ($attributes as $attribute) { - if (null === $masks = $this->permissionMap->getMasks((string) $attribute, $object)) { - continue; - } - - if (null === $object) { - if (null !== $this->logger) { - $this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable? 'grant access' : 'abstain')); - } - - return $this->allowIfObjectIdentityUnavailable ? self::ACCESS_GRANTED : self::ACCESS_ABSTAIN; - } else if ($object instanceof FieldVote) { - $field = $object->getField(); - $object = $object->getDomainObject(); - } else { - $field = null; - } - - if ($object instanceof ObjectIdentityInterface) { - $oid = $object; - } else if (null === $oid = $this->objectIdentityRetrievalStrategy->getObjectIdentity($object)) { - if (null !== $this->logger) { - $this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable? 'grant access' : 'abstain')); - } - - return $this->allowIfObjectIdentityUnavailable ? self::ACCESS_GRANTED : self::ACCESS_ABSTAIN; - } - - if (!$this->supportsClass($oid->getType())) { - return self::ACCESS_ABSTAIN; - } - - $sids = $this->securityIdentityRetrievalStrategy->getSecurityIdentities($token); - - try { - $acl = $this->aclProvider->findAcl($oid, $sids); - - if (null === $field && $acl->isGranted($masks, $sids, false)) { - if (null !== $this->logger) { - $this->logger->debug('ACL found, permission granted. Voting to grant access'); - } - - return self::ACCESS_GRANTED; - } else if (null !== $field && $acl->isFieldGranted($field, $masks, $sids, false)) { - if (null !== $this->logger) { - $this->logger->debug('ACL found, permission granted. Voting to grant access'); - } - - return self::ACCESS_GRANTED; - } - - if (null !== $this->logger) { - $this->logger->debug('ACL found, insufficient permissions. Voting to deny access.'); - } - - return self::ACCESS_DENIED; - } catch (AclNotFoundException $noAcl) { - if (null !== $this->logger) { - $this->logger->debug('No ACL found for the object identity. Voting to deny access.'); - } - - return self::ACCESS_DENIED; - } catch (NoAceFoundException $noAce) { - if (null !== $this->logger) { - $this->logger->debug('ACL found, no ACE applicable. Voting to deny access.'); - } - - return self::ACCESS_DENIED; - } - } - - // no attribute was supported - return self::ACCESS_ABSTAIN; - } - - /** - * You can override this method when writing a voter for a specific domain - * class. - * - * @param string $class The class name - * - * @return Boolean - */ - public function supportsClass($class) - { - return true; - } -} diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authentication/Provider/RunAsAuthenticationProvider.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authentication/Provider/RunAsAuthenticationProvider.php deleted file mode 100644 index 6958805..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authentication/Provider/RunAsAuthenticationProvider.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authentication\Provider; - -use Symfony\Component\Security\Core\Exception\BadCredentialsException; -use JMS\SecurityExtraBundle\Security\Authentication\Token\RunAsUserToken; -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; -use Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface; - -/** - * Class which authenticates RunAsTokens. - * - * @author Johannes M. Schmitt - */ -class RunAsAuthenticationProvider implements AuthenticationProviderInterface -{ - private $key; - - public function __construct($key) - { - $this->key = $key; - } - - public function authenticate(TokenInterface $token) - { - if (!$this->supports($token)) { - return null; - } - - if ($token->getKey() === $this->key) { - return $token; - } else { - throw new BadCredentialsException('The keys do not match.'); - } - } - - public function supports(TokenInterface $token) - { - return $token instanceof RunAsUserToken; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authentication/Token/RunAsUserToken.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authentication/Token/RunAsUserToken.php deleted file mode 100644 index 0672f2a..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authentication/Token/RunAsUserToken.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authentication\Token; - -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; -use Symfony\Component\Security\Core\Authentication\Token\AbstractToken; - -/** - * This token is automatically generated by the RunAsManager when an invocation - * is supposed to be run with a different Token. - * - * @author Johannes M. Schmitt - */ -class RunAsUserToken extends AbstractToken -{ - private $originalToken; - private $key; - private $credentials; - - public function __construct($key, $user, $credentials, array $roles, TokenInterface $originalToken) - { - parent::__construct($roles); - - $this->originalToken = $originalToken; - $this->credentials = $credentials; - $this->key = $key; - - $this->setUser($user); - $this->setAuthenticated(true); - } - - public function getKey() - { - return $this->key; - } - - public function getOriginalToken() - { - return $this->originalToken; - } - - public function getCredentials() - { - return $this->credentials; - } - - public function eraseCredentials() - { - parent::eraseCredentials(); - - $this->credentials = null; - } - - public function serialize() - { - return serialize(array( - $this->originalToken, - $this->key, - $this->credentials, - parent::serialize(), - )); - } - - public function unserialize($str) - { - list($this->originalToken, $this->key, $this->credentials, $parentStr) = unserialize($str); - parent::unserialize($parentStr); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/AfterInvocation/AclAfterInvocationProvider.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/AfterInvocation/AclAfterInvocationProvider.php deleted file mode 100644 index a004e92..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/AfterInvocation/AclAfterInvocationProvider.php +++ /dev/null @@ -1,111 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation; - -use Symfony\Component\HttpKernel\Log\LoggerInterface; -use Symfony\Component\Security\Acl\Exception\AclNotFoundException; -use Symfony\Component\Security\Acl\Exception\NoAceFoundException; -use Symfony\Component\Security\Acl\Model\SecurityIdentityRetrievalStrategyInterface; -use Symfony\Component\Security\Acl\Model\ObjectIdentityRetrievalStrategyInterface; -use Symfony\Component\Security\Acl\Model\AclProviderInterface; -use Symfony\Component\Security\Acl\Permission\PermissionMapInterface; -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; -use Symfony\Component\Security\Core\Exception\AccessDeniedException; - -/** - * This after invocation provider filters returned objects based on ACLs. - * - * @author Johannes M. Schmitt - */ -class AclAfterInvocationProvider implements AfterInvocationProviderInterface -{ - private $aclProvider; - private $oidRetrievalStrategy; - private $sidRetrievalStrategy; - private $permissionMap; - private $logger; - - public function __construct(AclProviderInterface $aclProvider, ObjectIdentityRetrievalStrategyInterface $oidRetrievalStrategy, SecurityIdentityRetrievalStrategyInterface $sidRetrievalStrategy, PermissionMapInterface $permissionMap, LoggerInterface $logger = null) - { - $this->aclProvider = $aclProvider; - $this->oidRetrievalStrategy = $oidRetrievalStrategy; - $this->sidRetrievalStrategy = $sidRetrievalStrategy; - $this->permissionMap = $permissionMap; - $this->logger = $logger; - } - - public function decide(TokenInterface $token, $secureObject, array $attributes, $returnedObject) - { - if (null === $returnedObject) { - if (null !== $this->logger) { - $this->logger->debug('Returned object was null, skipping security check.'); - } - - return null; - } - - foreach ($attributes as $attribute) { - if (!$this->supportsAttribute($attribute)) { - continue; - } - - if (null === $oid = $this->oidRetrievalStrategy->getObjectIdentity($returnedObject)) { - if (null !== $this->logger) { - $this->logger->debug('Returned object was no domain object, skipping security check.'); - } - - return $returnedObject; - } - - $sids = $this->sidRetrievalStrategy->getSecurityIdentities($token); - - try { - $acl = $this->aclProvider->findAcl($oid, $sids); - if ($acl->isGranted($this->permissionMap->getMasks($attribute, $returnedObject), $sids, false)) { - return $returnedObject; - } - - if (null !== $this->logger) { - $this->logger->debug('Token has been denied access for returned object.'); - } - } catch (AclNotFoundException $noAcl) { - throw new AccessDeniedException('No applicable ACL found for domain object.'); - } catch (NoAceFoundException $noAce) { - if (null !== $this->logger) { - $this->logger->debug('No applicable ACE found for the given Token, denying access.'); - } - } - - throw new AccessDeniedException('ACL has denied access for attribute: '.$attribute); - } - - // no attribute was supported - return $returnedObject; - } - - public function supportsAttribute($attribute) - { - return $this->permissionMap->contains($attribute); - } - - public function supportsClass($className) - { - return true; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/AfterInvocation/AfterInvocationManager.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/AfterInvocation/AfterInvocationManager.php deleted file mode 100644 index 88beeae..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/AfterInvocation/AfterInvocationManager.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation; - -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; - -/** - * This is the pendant to the AccessDecisionManager which is used to make - * access decisions after a method has been executed. - * - * @author Johannes M. Schmitt - */ -class AfterInvocationManager implements AfterInvocationManagerInterface -{ - private $providers; - - public function __construct(array $providers) - { - $this->providers = $providers; - } - - /** - * {@inheritDoc} - */ - public function decide(TokenInterface $token, $secureInvocation, array $attributes, $returnedObject) - { - foreach ($this->providers as $provider) { - $returnedObject = $provider->decide($token, $secureInvocation, $attributes, $returnedObject); - } - - return $returnedObject; - } - - /** - * {@inheritDoc} - */ - public function supportsAttribute($attribute) - { - foreach ($this->providers as $provider) { - if (true === $provider->supportsAttribute($attribute)) { - return true; - } - } - - return false; - } - - /** - * {@inheritDoc} - */ - public function supportsClass($className) - { - foreach ($this->providers as $provider) { - if (true === $provider->supportsClass($className)) { - return true; - } - } - - return false; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/AfterInvocation/AfterInvocationManagerInterface.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/AfterInvocation/AfterInvocationManagerInterface.php deleted file mode 100644 index c02ec50..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/AfterInvocation/AfterInvocationManagerInterface.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation; - -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; - -/** - * AfterInvocationManagerInterface - * - * @author Johannes M. Schmitt - */ -interface AfterInvocationManagerInterface -{ - /** - * Makes an access decision after the invocation of a method - * - * @param TokenInterface $token - * @param object $secureObject - * @param array $attributes - * @param mixed $returnedValue the value that was returned by the method invocation - * @return mixed the filter return value - */ - function decide(TokenInterface $token, $secureObject, array $attributes, $returnedValue); - - /** - * Determines whether the given attribute is supported - * - * @param string $attribute - * @return Boolean - */ - function supportsAttribute($attribute); - - /** - * Determines whether the given class is supported - * - * @param string $className the class of the secure object - * @return Boolean - */ - function supportsClass($className); -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/AfterInvocation/AfterInvocationProviderInterface.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/AfterInvocation/AfterInvocationProviderInterface.php deleted file mode 100644 index e75466b..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/AfterInvocation/AfterInvocationProviderInterface.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation; - -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; - -/** - * AfterInvocationProviderInterface - * - * @author Johannes M. Schmitt - */ -interface AfterInvocationProviderInterface -{ - function decide(TokenInterface $token, $secureObject, array $attributes, $returnedObject); - function supportsAttribute($attribute); - function supportsClass($className); -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/AndExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/AndExpression.php deleted file mode 100644 index e01d396..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/AndExpression.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class AndExpression implements ExpressionInterface -{ - public $left; - public $right; - - public function __construct(ExpressionInterface $left, ExpressionInterface $right) - { - $this->left = $left; - $this->right = $right; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/ArrayExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/ArrayExpression.php deleted file mode 100644 index cb039bf..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/ArrayExpression.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class ArrayExpression implements ExpressionInterface -{ - public $elements; - - public function __construct(array $elements) - { - $this->elements = $elements; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/ConstantExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/ConstantExpression.php deleted file mode 100644 index 963f1ed..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/ConstantExpression.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class ConstantExpression implements ExpressionInterface -{ - public $value; - - public function __construct($value) - { - $this->value = $value; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/ExpressionInterface.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/ExpressionInterface.php deleted file mode 100644 index 91af129..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/ExpressionInterface.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -interface ExpressionInterface -{ -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/FunctionExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/FunctionExpression.php deleted file mode 100644 index 5e52e98..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/FunctionExpression.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class FunctionExpression implements ExpressionInterface -{ - /** READ-ONLY */ - public $name; - public $args; - - public function __construct($name, array $args) - { - $this->name = $name; - $this->args = $args; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/GetItemExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/GetItemExpression.php deleted file mode 100644 index 2df5eb0..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/GetItemExpression.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class GetItemExpression -{ - public $array; - public $key; - - public function __construct(ExpressionInterface $array, ExpressionInterface $key) - { - $this->array = $array; - $this->key = $key; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/GetPropertyExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/GetPropertyExpression.php deleted file mode 100644 index fe070ab..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/GetPropertyExpression.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class GetPropertyExpression implements ExpressionInterface -{ - public $object; - public $name; - - public function __construct(ExpressionInterface $obj, $name) - { - $this->object = $obj; - $this->name = $name; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/IsEqualExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/IsEqualExpression.php deleted file mode 100644 index 89f83f7..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/IsEqualExpression.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class IsEqualExpression implements ExpressionInterface -{ - public $left; - public $right; - - public function __construct(ExpressionInterface $left, ExpressionInterface $right) - { - $this->left = $left; - $this->right = $right; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/MethodCallExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/MethodCallExpression.php deleted file mode 100644 index 22f3274..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/MethodCallExpression.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class MethodCallExpression implements ExpressionInterface -{ - public $object; - public $method; - public $args; - - public function __construct(ExpressionInterface $obj, $method, array $args) - { - $this->object = $obj; - $this->method = $method; - $this->args = $args; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/NotExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/NotExpression.php deleted file mode 100644 index aa730c0..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/NotExpression.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class NotExpression implements ExpressionInterface -{ - public $expr; - - public function __construct(ExpressionInterface $expr) - { - $this->expr = $expr; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/OrExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/OrExpression.php deleted file mode 100644 index a3d1f03..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/OrExpression.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class OrExpression implements ExpressionInterface -{ - public $left; - public $right; - - public function __construct(ExpressionInterface $left, ExpressionInterface $right) - { - $this->left = $left; - $this->right = $right; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/ParameterExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/ParameterExpression.php deleted file mode 100644 index f382e5c..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/ParameterExpression.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class ParameterExpression implements ExpressionInterface -{ - public $name; - - public function __construct($name) - { - $this->name = $name; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/VariableExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/VariableExpression.php deleted file mode 100644 index c48c02e..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Ast/VariableExpression.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class VariableExpression implements ExpressionInterface -{ - public $name; - public $allowNull; - - public function __construct($name, $allowNull = false) - { - $this->name = $name; - $this->allowNull = $allowNull; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/AndExpressionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/AndExpressionCompiler.php deleted file mode 100644 index e488a32..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/AndExpressionCompiler.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler; - -class AndExpressionCompiler extends BinaryExprCompiler -{ - public function getType() - { - return 'JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\AndExpression'; - } - - protected function getOperator() - { - return '&&'; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/BinaryExprCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/BinaryExprCompiler.php deleted file mode 100644 index 0dcd154..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/BinaryExprCompiler.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ExpressionInterface; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -/** - * Base Compiler for Binary Operators. - * - * @author Johannes M. Schmitt - */ -abstract class BinaryExprCompiler implements TypeCompilerInterface -{ - public function compilePreconditions(ExpressionCompiler $compiler, ExpressionInterface $expr) - { - $compiler - ->compilePreconditions($expr->left) - ->compilePreconditions($expr->right) - ; - } - - public function compile(ExpressionCompiler $compiler, ExpressionInterface $expr) - { - $compiler - ->write("(") - ->compileInternal($expr->left) - ->write(") ".$this->getOperator()." (") - ->compileInternal($expr->right) - ->write(")") - ; - } - - abstract protected function getOperator(); -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/ContainerAwareVariableCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/ContainerAwareVariableCompiler.php deleted file mode 100644 index 809ffc2..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/ContainerAwareVariableCompiler.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler; - -use Symfony\Component\DependencyInjection\ContainerInterface; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ExpressionInterface; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\VariableExpressionCompiler; - -class ContainerAwareVariableCompiler extends VariableExpressionCompiler -{ - private $serviceMap = array(); - private $parameterMap = array(); - - public function setMaps(array $serviceMap, array $parameterMap) - { - $this->serviceMap = $serviceMap; - $this->parameterMap = $parameterMap; - } - - public function compile(ExpressionCompiler $compiler, ExpressionInterface $expr) - { - if (isset($this->serviceMap[$expr->name])) { - $compiler->write("\$context['container']->get('{$this->serviceMap[$expr->name]}'"); - - if ($expr->allowNull) { - $compiler->write(", ".ContainerInterface::NULL_ON_INVALID_REFERENCE); - } - - $compiler->write(")"); - - return; - } - - if (isset($this->parameterMap[$expr->name])) { - $compiler->write("\$context['container']->getParameter('{$this->parameterMap[$expr->name]}')"); - - return; - } - - parent::compile($compiler, $expr); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/AuthenticationTrustFunctionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/AuthenticationTrustFunctionCompiler.php deleted file mode 100644 index aa98f6c..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/AuthenticationTrustFunctionCompiler.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\Func; - -use JMS\SecurityExtraBundle\Exception\InvalidArgumentException; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -abstract class AuthenticationTrustFunctionCompiler implements FunctionCompilerInterface -{ - public function compilePreconditions(ExpressionCompiler $compiler, FunctionExpression $function) - { - if (!empty($function->args)) { - throw new InvalidArgumentException(sprintf('The '.$this->getName().'() function does not accept any arguments, but got "%s".', var_export($function->args, true))); - } - - $compiler->verifyItem('token', 'Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/FunctionCompilerInterface.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/FunctionCompilerInterface.php deleted file mode 100644 index b364f0b..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/FunctionCompilerInterface.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\Func; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -interface FunctionCompilerInterface -{ - function getName(); - function compilePreconditions(ExpressionCompiler $compiler, FunctionExpression $function); - function compile(ExpressionCompiler $compiler, FunctionExpression $function); -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/HasAnyRoleFunctionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/HasAnyRoleFunctionCompiler.php deleted file mode 100644 index 02e71fa..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/HasAnyRoleFunctionCompiler.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\Func; - -use JMS\SecurityExtraBundle\Exception\RuntimeException; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -class HasAnyRoleFunctionCompiler implements FunctionCompilerInterface -{ - private $rolesExpr; - - public function getName() - { - return 'hasAnyRole'; - } - - public function compilePreconditions(ExpressionCompiler $compiler, FunctionExpression $function) - { - if (0 === count($function->args)) { - throw new RuntimeException('The function hasAnyRole() expects at least one argument, but got none.'); - } - - $this->rolesExpr = $compiler->getRolesExpr(); - } - - public function compile(ExpressionCompiler $compiler, FunctionExpression $function) - { - $compiler->write("("); - - $first = true; - foreach ($function->args as $arg) { - if (!$first) { - $compiler->write(" || "); - } - $first = false; - - $compiler - ->write("isset({$this->rolesExpr}[") - ->compileInternal($arg) - ->write("])") - ; - } - - $compiler->write(")"); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/HasRoleFunctionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/HasRoleFunctionCompiler.php deleted file mode 100644 index 77a9834..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/HasRoleFunctionCompiler.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\Func; - -use JMS\SecurityExtraBundle\Exception\RuntimeException; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -class HasRoleFunctionCompiler implements FunctionCompilerInterface -{ - private $rolesExpr; - - public function getName() - { - return 'hasRole'; - } - - public function compilePreconditions(ExpressionCompiler $compiler, FunctionExpression $function) - { - if (1 !== count($function->args)) { - throw new RuntimeException(sprintf('The hasRole() function expects exactly one argument, but got "%s".', var_export($function->args, true))); - } - - $this->rolesExpr = $compiler->getRolesExpr(); - } - - public function compile(ExpressionCompiler $compiler, FunctionExpression $function) - { - $compiler - ->write("isset({$this->rolesExpr}[") - ->compileInternal($function->args[0]) - ->write("])") - ; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/IsAnonymousFunctionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/IsAnonymousFunctionCompiler.php deleted file mode 100644 index 412825d..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/IsAnonymousFunctionCompiler.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\Func; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -class IsAnonymousFunctionCompiler extends AuthenticationTrustFunctionCompiler -{ - public function getName() - { - return 'isAnonymous'; - } - - public function compile(ExpressionCompiler $compiler, FunctionExpression $function) - { - $compiler - ->compileInternal(new VariableExpression('trust_resolver')) - ->write("->isAnonymous(\$context['token'])"); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/IsAuthenticatedFunctionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/IsAuthenticatedFunctionCompiler.php deleted file mode 100644 index ead97d8..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/IsAuthenticatedFunctionCompiler.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\Func; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -class IsAuthenticatedFunctionCompiler extends AuthenticationTrustFunctionCompiler -{ - public function getName() - { - return 'isAuthenticated'; - } - - public function compile(ExpressionCompiler $compiler, FunctionExpression $function) - { - $compiler - ->write("!") - ->compileInternal(new VariableExpression('trust_resolver')) - ->write("->isAnonymous(\$context['token'])") - ; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/IsFullyAuthenticatedFunctionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/IsFullyAuthenticatedFunctionCompiler.php deleted file mode 100644 index 366ef07..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/IsFullyAuthenticatedFunctionCompiler.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\Func; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -class IsFullyAuthenticatedFunctionCompiler extends AuthenticationTrustFunctionCompiler -{ - public function getName() - { - return 'isFullyAuthenticated'; - } - - public function compile(ExpressionCompiler $compiler, FunctionExpression $function) - { - $compiler - ->compileInternal(new VariableExpression('trust_resolver')) - ->write("->isFullFledged(\$context['token'])"); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/IsRememberMeFunctionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/IsRememberMeFunctionCompiler.php deleted file mode 100644 index cbba7c8..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/Func/IsRememberMeFunctionCompiler.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\Func; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -class IsRememberMeFunctionCompiler extends AuthenticationTrustFunctionCompiler -{ - public function getName() - { - return 'isRememberMe'; - } - - public function compile(ExpressionCompiler $compiler, FunctionExpression $function) - { - $compiler - ->compileInternal(new VariableExpression('trust_resolver')) - ->write("->isRememberMe(\$context['token'])"); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/IsEqualExpressionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/IsEqualExpressionCompiler.php deleted file mode 100644 index 93a8b23..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/IsEqualExpressionCompiler.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler; - -class IsEqualExpressionCompiler extends BinaryExprCompiler -{ - public function getType() - { - return 'JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\IsEqualExpression'; - } - - protected function getOperator() - { - return '==='; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/NotExpressionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/NotExpressionCompiler.php deleted file mode 100644 index 1fccae8..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/NotExpressionCompiler.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ExpressionInterface; - -class NotExpressionCompiler implements TypeCompilerInterface -{ - public function getType() - { - return 'JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\NotExpression'; - } - - public function compilePreconditions(ExpressionCompiler $compiler, ExpressionInterface $expr) - { - $compiler->compilePreconditions($expr->expr); - } - - public function compile(ExpressionCompiler $compiler, ExpressionInterface $expr) - { - $compiler - ->write('!(') - ->compileInternal($expr->expr) - ->write(')') - ; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/OrExpressionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/OrExpressionCompiler.php deleted file mode 100644 index 4a4554e..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/OrExpressionCompiler.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler; - -class OrExpressionCompiler extends BinaryExprCompiler -{ - public function getType() - { - return 'JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\OrExpression'; - } - - protected function getOperator() - { - return '||'; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/ParameterExpressionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/ParameterExpressionCompiler.php deleted file mode 100644 index 678a119..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/ParameterExpressionCompiler.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ExpressionInterface; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\TypeCompilerInterface; - -class ParameterExpressionCompiler implements TypeCompilerInterface -{ - public function getType() - { - return 'JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ParameterExpression'; - } - - public function compilePreconditions(ExpressionCompiler $compiler, ExpressionInterface $parameter) - { - $compiler->verifyItem('object', 'CG\Proxy\MethodInvocation'); - - if (!isset($compiler->attributes['parameter_mapping_name'])) { - $this->addParameterMapping($compiler); - } - - $compiler - ->writeln("if (!isset(\${$compiler->attributes['parameter_mapping_name']}['{$parameter->name}'])) {") - ->indent() - ->write("throw new RuntimeException(sprintf('There is no parameter with name \"{$parameter->name}\" for method \"%s\".', ") - ->compileInternal(new VariableExpression('object')) - ->writeln("));") - ->outdent() - ->write("}\n\n") - ; - } - - public function compile(ExpressionCompiler $compiler, ExpressionInterface $parameter) - { - $compiler - ->compileInternal(new VariableExpression('object')) - ->write("->arguments[") - ->write("\${$compiler->attributes['parameter_mapping_name']}") - ->write("['{$parameter->name}']]") - ; - } - - private function addParameterMapping(ExpressionCompiler $compiler) - { - $name = $compiler->nextName(); - $indexName = $compiler->nextName(); - $paramName = $compiler->nextName(); - - $compiler - ->setAttribute('parameter_mapping_name', $name) - ->writeln("\$$name = array();") - ->write("foreach (") - ->compileInternal(new VariableExpression('object')) - ->writeln("->reflection->getParameters() as \$$indexName => \$$paramName) {") - ->indent() - ->writeln("\${$name}[\${$paramName}->name] = \$$indexName;") - ->outdent() - ->writeln("}\n") - ; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/TypeCompilerInterface.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/TypeCompilerInterface.php deleted file mode 100644 index 949a631..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/TypeCompilerInterface.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ExpressionInterface; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -interface TypeCompilerInterface -{ - function getType(); - function compilePreconditions(ExpressionCompiler $compiler, ExpressionInterface $expr); - function compile(ExpressionCompiler $compiler, ExpressionInterface $expr); -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/VariableExpressionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/VariableExpressionCompiler.php deleted file mode 100644 index ad1841c..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Compiler/VariableExpressionCompiler.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ExpressionInterface; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -class VariableExpressionCompiler implements TypeCompilerInterface -{ - public function getType() - { - return 'JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression'; - } - - public function compilePreconditions(ExpressionCompiler $compiler, ExpressionInterface $expr) - { - if ('user' === $expr->name) { - $compiler - ->setAttribute('user_var_name', $name = $compiler->nextName()) - ->write("\$$name = ") - ->compileInternal(new VariableExpression('token')) - ->write("->getUser();\n\n") - ; - } - } - - public function compile(ExpressionCompiler $compiler, ExpressionInterface $expr) - { - if ('permitAll' === $expr->name) { - $compiler->write('true'); - - return; - } - - if ('denyAll' === $expr->name) { - $compiler->write('false'); - - return; - } - - if ('user' === $expr->name) { - $compiler->write("\${$compiler->attributes['user_var_name']}"); - - return; - } - - if ($expr->allowNull) { - $compiler->write("(isset(\$context['{$expr->name}']) ? "); - } - - $compiler->write("\$context['{$expr->name}']"); - - if ($expr->allowNull) { - $compiler->write(" : null)"); - } - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ContainerAwareExpressionHandler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ContainerAwareExpressionHandler.php deleted file mode 100644 index f2d29af..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ContainerAwareExpressionHandler.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionHandlerInterface; -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Lazy-loading container aware expression handler. - * - * @author Johannes M. Schmitt - */ -class ContainerAwareExpressionHandler implements ExpressionHandlerInterface -{ - private $container; - - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - public function createContext(TokenInterface $token, $object) - { - return array( - 'container' => $this->container, - 'token' => $token, - 'object' => $object, - ); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/DefaultExpressionHandler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/DefaultExpressionHandler.php deleted file mode 100644 index 70e4e13..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/DefaultExpressionHandler.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression; - -use Symfony\Component\Security\Core\Role\RoleHierarchyInterface; -use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface; -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; - -class DefaultExpressionHandler implements ExpressionHandlerInterface -{ - private $trustResolver; - private $roleHierarchy; - - public function __construct(AuthenticationTrustResolverInterface $trustResolver, - RoleHierarchyInterface $roleHierarchy = null) - { - $this->trustResolver = $trustResolver; - $this->roleHierarchy = $roleHierarchy; - } - - public function createContext(TokenInterface $token, $object) - { - $context = array( - 'token' => $token, - 'object' => $object, - 'trust_resolver' => $this->trustResolver, - ); - - if (null !== $this->roleHierarchy) { - $context['role_hierarchy'] = $this->roleHierarchy; - } - - return $context; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Expression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Expression.php deleted file mode 100644 index 219218d..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/Expression.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression; - -final class Expression -{ - /** READ-ONLY */ - public $expression; - - public function __construct($expression) - { - $this->expression = $expression; - } - - public function getHashCode() - { - return sha1($this->expression); - } - - public function __toString() - { - return 'EXPRESSION('.$this->expression.')'; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ExpressionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ExpressionCompiler.php deleted file mode 100644 index fbfc69a..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ExpressionCompiler.php +++ /dev/null @@ -1,395 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression; - -use JMS\SecurityExtraBundle\Exception\RuntimeException; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\TypeCompilerInterface; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\IsEqualExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\Func\FunctionCompilerInterface; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ExpressionInterface; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\OrExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\MethodCallExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\GetPropertyExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\GetItemExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ConstantExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ArrayExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\AndExpression; - -class ExpressionCompiler -{ - public $attributes = array(); - - private $indentationLevel = 0; - private $indentationSpaces = 4; - - private $nameCount = 0; - private $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; - private $charCount = 52; - private $reservedNames = array('context' => true); - - private $itemExists = array(); - private $itemType = array(); - private $rolesName; - - private $code; - private $parser; - private $typeCompilers; - private $functionCompilers; - - public function __construct() - { - $this->addTypeCompiler(new Compiler\AndExpressionCompiler()); - $this->addTypeCompiler(new Compiler\IsEqualExpressionCompiler()); - $this->addTypeCompiler(new Compiler\OrExpressionCompiler()); - $this->addTypeCompiler(new Compiler\VariableExpressionCompiler()); - $this->addTypeCompiler(new Compiler\NotExpressionCompiler()); - - $this->functionCompilers = array( - 'isAnonymous' => new Compiler\Func\IsAnonymousFunctionCompiler(), - 'isAuthenticated' => new Compiler\Func\IsAuthenticatedFunctionCompiler(), - 'isRememberMe' => new Compiler\Func\IsRememberMeFunctionCompiler(), - 'isFullyAuthenticated' => new Compiler\Func\IsFullyAuthenticatedFunctionCompiler(), - 'hasRole' => new Compiler\Func\HasRoleFunctionCompiler(), - 'hasAnyRole' => new Compiler\Func\HasAnyRoleFunctionCompiler(), - ); - } - - public function setAttribute($name, $value) - { - $this->attributes[$name] = $value; - - return $this; - } - - public function addTypeCompiler(TypeCompilerInterface $compiler) - { - $this->typeCompilers[$compiler->getType()] = $compiler; - } - - public function addFunctionCompiler(FunctionCompilerInterface $compiler) - { - $this->functionCompilers[$compiler->getName()] = $compiler; - } - - public function compileExpression(Expression $expr) - { - return $this->compile($this->getParser()->parse($expr->expression), - $expr->expression); - } - - public function compile(ExpressionInterface $expr, $raw = null) - { - $this->nameCount = 0; - $this->code = ''; - $this->itemExists = $this->itemType = $this->attributes = array(); - $this->rolesName = null; - - if ($raw) { - $this->writeln('// Expression: '.$raw); - } - - $this - ->writeln('return function(array $context) {') - ->indent() - ->compilePreconditions($expr) - ->write('return ') - ->compileInternal($expr) - ->writeln(';') - ->outdent() - ->writeln('};') - ; - - return $this->code; - } - - public function indent() - { - $this->indentationLevel += 1; - - return $this; - } - - public function outdent() - { - $this->indentationLevel -= 1; - - if ($this->indentationLevel < 0) { - throw new RuntimeException('The identation level cannot be less than zero.'); - } - - return $this; - } - - public function writeln($content) - { - $this->write($content."\n"); - - return $this; - } - - public function getRolesExpr() - { - if (null !== $this->rolesName) { - return '$'.$this->rolesName; - } - - $this->verifyItem('token', 'Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - - $this->rolesName = $rolesName = $this->nextName(); - $hierarchyName = $this->nextName(); - $tmpName = $this->nextName(); - $this - ->writeln("\$$rolesName = \$context['token']->getRoles();") - ->write("if (null !== \$$hierarchyName = ") - ->compileInternal(new VariableExpression('role_hierarchy', true)) - ->writeln(") {") - ->indent() - ->writeln("\$$rolesName = \${$hierarchyName}->getReachableRoles(\$$rolesName);") - ->outdent() - ->write("}\n\n") - ->writeln("\$$tmpName = array();") - ->writeln("foreach (\$$rolesName as \$role) {") - ->indent() - ->writeln("\${$tmpName}[\$role->getRole()] = true;") - ->outdent() - ->writeln("}") - ->write("\$$rolesName = \$$tmpName;\n\n") - ; - - return '$'.$rolesName; - } - - public function verifyItem($key, $expectedType = null) - { - if (!isset($this->itemExists[$key])) { - $this->itemExists[$key] = true; - - $this - ->writeln("if (!isset(\$context['$key'])) {") - ->indent() - ->writeln("throw new RuntimeException('The context contains no item with key \"$key\".');") - ->outdent() - ->write("}\n\n") - ; - } - - if (null !== $expectedType) { - if (isset($this->itemType[$key])) { - if ($this->itemType[$key] !== $expectedType) { - throw new RuntimeException(sprintf('Cannot verify that item "%s" is of type "%s" because it is already expected to be of type "%s".', - $key, $expectedType, $this->itemType[$key] - )); - } - - return $this; - } - - $this - ->writeln("if (!\$context['$key'] instanceof $expectedType) {") - ->indent() - ->writeln("throw new RuntimeException(sprintf('The item \"$key\" is expected to be of type \"$expectedType\", but got \"%s\".', get_class(\$context['$key'])));") - ->outdent() - ->write("}\n\n") - ; - } - - return $this; - } - - public function write($content) - { - $lines = explode("\n", $content); - for ($i=0,$c=count($lines); $i<$c; $i++) { - if ($this->indentationLevel > 0 - && !empty($lines[$i]) - && (empty($this->code) || "\n" === substr($this->code, -1))) { - $this->code .= str_repeat(' ', $this->indentationLevel * $this->indentationSpaces); - } - - $this->code .= $lines[$i]; - - if ($i+1 < $c) { - $this->code .= "\n"; - } - } - - return $this; - } - - public function nextName() - { - while (true) { - $name = ''; - $i = $this->nameCount; - - $name .= $this->chars[$i % $this->charCount]; - $i = intval($i / $this->charCount); - - while ($i > 0) { - $i -= 1; - $name .= $this->chars[$i % $this->charCount]; - $i = intval($i / $this->charCount); - } - - $this->nameCount += 1; - - // check that the name is not reserved - if (isset($this->reservedNames[$name])) { - continue; - } - - return $name; - } - } - - public function compilePreconditions(ExpressionInterface $expr) - { - if ($typeCompiler = $this->findTypeCompiler(get_class($expr))) { - $typeCompiler->compilePreconditions($this, $expr); - - return $this; - } - - if ($expr instanceof FunctionExpression) { - $this->getFunctionCompiler($expr->name)->compilePreconditions($this, $expr); - - foreach ($expr->args as $arg) { - $this->compilePreconditions($arg); - } - - return $this; - } - - if ($expr instanceof VariableExpression) { - $this->getVariableCompiler($expr->name)->compilePreconditions($this, $expr); - - return $this; - } - - if ($expr instanceof MethodCallExpression) { - $this->compilePreconditions($expr->object); - - foreach ($expr->args as $arg) { - $this->compilePreconditions($arg); - } - - return $this; - } - - if ($expr instanceof GetPropertyExpression) { - $this->compilePreconditions($expr->object); - - return $this; - } - - return $this; - } - - public function compileInternal(ExpressionInterface $expr) - { - if ($typeCompiler = $this->findTypeCompiler(get_class($expr))) { - $typeCompiler->compile($this, $expr); - - return $this; - } - - if ($expr instanceof ArrayExpression) { - $this->code .= 'array('; - foreach ($expr->elements as $key => $value) { - $this->code .= var_export($key, true).' => '; - $this->compileInternal($value); - $this->code .= ','; - } - $this->code .= ')'; - - return $this; - } - - if ($expr instanceof ConstantExpression) { - $this->code .= var_export($expr->value, true); - - return $this; - } - - if ($expr instanceof FunctionExpression) { - $this->getFunctionCompiler($expr->name)->compile($this, $expr); - - return $this; - } - - if ($expr instanceof GetItemExpression) { - $this->compileInternal($expr->array); - $this->code .= '['.$expr->key.']'; - - return $this; - } - - if ($expr instanceof GetPropertyExpression) { - $this->compileInternal($expr->object); - $this->code .= '->'.$expr->name; - - return $this; - } - - if ($expr instanceof MethodCallExpression) { - $this->compileInternal($expr->object); - $this->code .= '->'.$expr->method.'('; - - $first = true; - foreach ($expr->args as $arg) { - if (!$first) { - $this->code .= ', '; - } - $first = false; - - $this->compileInternal($arg); - } - $this->code .= ')'; - - return $this; - } - - throw new RuntimeException(sprintf('Unknown expression "%s".', get_class($expr))); - } - - public function getFunctionCompiler($name) - { - if (!isset($this->functionCompilers[$name])) { - throw new RuntimeException(sprintf('There is no compiler for function "%s".', $name)); - } - - return $this->functionCompilers[$name]; - } - - private function findTypeCompiler($type) - { - return isset($this->typeCompilers[$type]) ? $this->typeCompilers[$type] : null; - } - - private function getParser() - { - if (null !== $this->parser) { - return $this->parser; - } - - return $this->parser = new ExpressionParser(); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ExpressionHandlerInterface.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ExpressionHandlerInterface.php deleted file mode 100644 index 24e6024..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ExpressionHandlerInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression; - -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; - -interface ExpressionHandlerInterface -{ - function createContext(TokenInterface $token, $object); -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ExpressionLexer.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ExpressionLexer.php deleted file mode 100644 index e1f4445..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ExpressionLexer.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression; - -use JMS\SecurityExtraBundle\Exception\InvalidArgumentException; - -final class ExpressionLexer -{ - public $token; - public $lookahead; - - private $tokens; - private $pointer; - - const T_STRING = 1; - const T_IDENTIFIER = 2; - const T_NONE = 3; - const T_COMMA = 4; - const T_OPEN_PARENTHESIS = 5; - const T_CLOSE_PARENTHESIS = 6; - const T_AND = 7; - const T_OR = 8; - const T_PARAMETER = 9; - const T_OBJECT_OPERATOR = 10; - const T_OPEN_BRACKET = 11; - const T_CLOSE_BRACKET = 12; - const T_OPEN_BRACE = 13; - const T_CLOSE_BRACE = 14; - const T_COLON = 15; - const T_IS_EQUAL = 16; - const T_NOT = 17; - - public static function getLiteral($type) - { - static $constants; - - if (null === $constants) { - $ref = new \ReflectionClass(get_called_class()); - $constants = $ref->getConstants(); - } - - if (false === $literal = array_search($type, $constants, true)) { - throw new InvalidArgumentException(sprintf('There is no token of value "%s".', $type)); - } - - return $literal; - } - - public function initialize($input) - { - static $pattern = '/(#?[a-z][a-z0-9]*|\'(?:[^\']|(?<=\\\\)\')*\'|"(?:[^"]|(?<=\\\\)")*"|&&|\|\||==)|\s+|(.)/i'; - - $parts = preg_split($pattern, $input, -1, PREG_SPLIT_OFFSET_CAPTURE - | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); - - $tokens = array(); - foreach ($parts as $part) { - list($value, $position) = $part; - $type = self::T_NONE; - - if ("'" === $value[0] || '"' === $value[0]) { - $type = self::T_STRING; - $value = substr($value, 1, -1); - } else if (',' === $value) { - $type = self::T_COMMA; - } else if ('(' === $value) { - $type = self::T_OPEN_PARENTHESIS; - } else if (')' === $value) { - $type = self::T_CLOSE_PARENTHESIS; - } else if ('[' === $value) { - $type = self::T_OPEN_BRACKET; - } else if (']' === $value) { - $type = self::T_CLOSE_BRACKET; - } else if ('{' === $value) { - $type = self::T_OPEN_BRACE; - } else if ('}' === $value) { - $type = self::T_CLOSE_BRACE; - } else if ('&&' === $value || 'and' === strtolower($value)) { - $type = self::T_AND; - } else if ('||' === $value || 'or' === strtolower($value)) { - $type = self::T_OR; - } else if ('!' === $value || 'not' === strtolower($value)) { - $type = self::T_NOT; - } else if (':' === $value) { - $type = self::T_COLON; - } else if ('.' === $value) { - $type = self::T_OBJECT_OPERATOR; - } else if ('==' === $value) { - $type = self::T_IS_EQUAL; - } else if ('#' === $value[0]) { - $type = self::T_PARAMETER; - $value = substr($value, 1); - } else if (ctype_alpha($value)) { - $type = self::T_IDENTIFIER; - } - - $tokens[] = array( - 'type' => $type, - 'value' => $value, - 'position' => $position, - ); - } - - $this->tokens = $tokens; - $this->pointer = -1; - $this->next(); - } - - public function next() - { - $this->pointer += 1; - $this->token = $this->lookahead; - $this->lookahead = isset($this->tokens[$this->pointer]) ? - $this->tokens[$this->pointer] : null; - - return $this->lookahead !== null; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ExpressionParser.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ExpressionParser.php deleted file mode 100644 index 98fd32e..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ExpressionParser.php +++ /dev/null @@ -1,290 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\NotExpression; - -use JMS\SecurityExtraBundle\Exception\RuntimeException; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\IsEqualExpression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ParameterExpression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ConstantExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\OrExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\AndExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ArrayExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\GetItemExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\GetPropertyExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\MethodCallExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ExpressionInterface; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; - -final class ExpressionParser -{ - const PRECEDENCE_OR = 10; - const PRECEDENCE_AND = 15; - const PRECEDENCE_IS_EQUAL = 20; - const PRECEDENCE_NOT = 30; - - private $lexer; - - public function __construct() - { - $this->lexer = new ExpressionLexer(); - } - - public function parse($str) - { - $this->lexer->initialize($str); - - return $this->Expression(); - } - - private function Expression($precedence = 0) - { - $expr = $this->Primary(); - - while (true) { - if (ExpressionLexer::T_AND === $this->lexer->lookahead['type'] - && $precedence <= self::PRECEDENCE_AND) { - $this->lexer->next(); - - $expr = new AndExpression($expr, $this->Expression( - self::PRECEDENCE_AND + 1)); - continue; - } - - if (ExpressionLexer::T_OR === $this->lexer->lookahead['type'] - && $precedence <= self::PRECEDENCE_OR) { - $this->lexer->next(); - - $expr = new OrExpression($expr, $this->Expression( - self::PRECEDENCE_OR + 1)); - continue; - } - - if (ExpressionLexer::T_IS_EQUAL === $this->lexer->lookahead['type'] - && $precedence <= self::PRECEDENCE_IS_EQUAL) { - $this->lexer->next(); - - $expr = new IsEqualExpression($expr, $this->Expression( - self::PRECEDENCE_IS_EQUAL + 1)); - continue; - } - - break; - } - - return $expr; - } - - private function Primary() - { - if (ExpressionLexer::T_NOT === $this->lexer->lookahead['type']) { - $this->lexer->next(); - $expr = new NotExpression($this->Expression(self::PRECEDENCE_NOT)); - - return $this->Suffix($expr); - } - - if (ExpressionLexer::T_OPEN_PARENTHESIS === $this->lexer->lookahead['type']) { - $this->lexer->next(); - $expr = $this->Expression(); - $this->match(ExpressionLexer::T_CLOSE_PARENTHESIS); - - return $this->Suffix($expr); - } - - if (ExpressionLexer::T_STRING === $this->lexer->lookahead['type']) { - return new ConstantExpression($this->match(ExpressionLexer::T_STRING)); - } - - if (ExpressionLexer::T_OPEN_BRACE === $this->lexer->lookahead['type']) { - return $this->Suffix($this->MapExpr()); - } - - if (ExpressionLexer::T_OPEN_BRACKET === $this->lexer->lookahead['type']) { - return $this->Suffix($this->ListExpr()); - } - - if (ExpressionLexer::T_IDENTIFIER === $this->lexer->lookahead['type']) { - $name = $this->match(ExpressionLexer::T_IDENTIFIER); - - if (ExpressionLexer::T_OPEN_PARENTHESIS === $this->lexer->lookahead['type']) { - $args = $this->Arguments(); - - return $this->Suffix(new FunctionExpression($name, $args)); - } - - return $this->Suffix(new VariableExpression($name)); - } - - if (ExpressionLexer::T_PARAMETER === $this->lexer->lookahead['type']) { - return $this->Suffix(new ParameterExpression($this->match(ExpressionLexer::T_PARAMETER))); - } - - $this->error('primary expression'); - } - - private function ListExpr() - { - $this->match(ExpressionLexer::T_OPEN_BRACKET); - - $elements = array(); - while (ExpressionLexer::T_CLOSE_BRACKET !== $this->lexer->lookahead['type']) { - $elements[] = $this->Expression(); - - if (ExpressionLexer::T_COMMA !== $this->lexer->lookahead['type']) { - break; - } - $this->lexer->next(); - } - - $this->match(ExpressionLexer::T_CLOSE_BRACKET); - - return new ArrayExpression($elements); - } - - private function MapExpr() - { - $this->match(ExpressionLexer::T_OPEN_BRACE); - - $entries = array(); - while (ExpressionLexer::T_CLOSE_BRACE !== $this->lexer->lookahead['type']) { - $key = $this->match(ExpressionLexer::T_STRING); - $this->match(ExpressionLexer::T_COLON); - $entries[$key] = $this->Expression(); - - if (ExpressionLexer::T_COMMA !== $this->lexer->lookahead['type']) { - break; - } - - $this->lexer->next(); - } - - $this->match(ExpressionLexer::T_CLOSE_BRACE); - - return new ArrayExpression($entries); - } - - private function Suffix(ExpressionInterface $expr) - { - while (true) { - if (ExpressionLexer::T_OBJECT_OPERATOR === $this->lexer->lookahead['type']) { - $this->lexer->next(); - $name = $this->match(ExpressionLexer::T_IDENTIFIER); - - if (ExpressionLexer::T_OPEN_PARENTHESIS === $this->lexer->lookahead['type']) { - $args = $this->Arguments(); - $expr = new MethodCallExpression($expr, $name, $args); - continue; - } - - $expr = new GetPropertyExpression($expr, $name); - continue; - } - - if (ExpressionLexer::T_OPEN_BRACKET === $this->lexer->lookahead['type']) { - $this->lexer->next(); - $key = $this->Expression(); - $this->match(ExpressionLexer::T_CLOSE_BRACKET); - $expr = new GetItemExpression($expr, $key); - continue; - } - - break; - } - - return $expr; - } - - private function FunctionCall() - { - $name = $this->match(ExpressionLexer::T_IDENTIFIER); - $args = $this->Arguments(); - - return new FunctionExpression($name, $args); - } - - private function Arguments() - { - $this->match(ExpressionLexer::T_OPEN_PARENTHESIS); - $args = array(); - - while (ExpressionLexer::T_CLOSE_PARENTHESIS !== $this->lexer->lookahead['type']) { - $args[] = $this->Expression(); - - if (ExpressionLexer::T_COMMA !== $this->lexer->lookahead['type']) { - break; - } - - $this->match(ExpressionLexer::T_COMMA); - } - $this->match(ExpressionLexer::T_CLOSE_PARENTHESIS); - - return $args; - } - - private function Value() - { - return $this->matchAny(array(ExpressionLexer::T_STRING)); - } - - private function matchAny(array $types) - { - if (null !== $this->lexer->lookahead) { - foreach ($types as $type) { - if ($type === $this->lexer->lookahead['type']) { - $this->lexer->next(); - - return $this->lexer->token['value']; - } - } - } - - $this->error(sprintf('one of these tokens "%s"', - implode('", "', array_map(array('JMS\SecurityExtraBundle\Security\Authorization\Expression\Lexer', 'getLiteral'), $types)) - )); - } - - private function match($type) - { - if (null === $this->lexer->lookahead - || $type !== $this->lexer->lookahead['type']) { - $this->error(sprintf('token "%s"', ExpressionLexer::getLiteral($type))); - } - - $this->lexer->next(); - - return $this->lexer->token['value']; - } - - private function error($expected) - { - $actual = null === $this->lexer->lookahead ? 'end of file' - : sprintf('token "%s" with value "%s" at position %d', - ExpressionLexer::getLiteral($this->lexer->lookahead['type']), - $this->lexer->lookahead['value'], - $this->lexer->lookahead['position']); - - throw new RuntimeException(sprintf('Expected %s, but got %s.', $expected, $actual)); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ExpressionVoter.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ExpressionVoter.php deleted file mode 100644 index cf04742..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/ExpressionVoter.php +++ /dev/null @@ -1,114 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression; - -use JMS\SecurityExtraBundle\Exception\RuntimeException; -use Symfony\Component\Security\Core\Role\RoleHierarchyInterface; -use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface; -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; -use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; - -/** - * Expression-based voter. - * - * This voter allows to use complex access expression in a high-performance - * way. This is the preferred voter for any non-simple access checks. - * - * @author Johannes M. Schmitt - */ -class ExpressionVoter implements VoterInterface -{ - private $evaluators = array(); - private $compiler; - private $cacheDir; - private $expressionHandler; - - public function __construct(ExpressionHandlerInterface $expressionHandler) { - $this->expressionHandler = $expressionHandler; - } - - public function setCacheDir($cacheDir) - { - $this->cacheDir = $cacheDir; - } - - public function setCompiler(ExpressionCompiler $compiler) - { - $this->compiler = $compiler; - } - - public function vote(TokenInterface $token, $object, array $attributes) - { - $result = VoterInterface::ACCESS_ABSTAIN; - - foreach ($attributes as $attribute) { - if (!$attribute instanceof Expression) { - continue; - } - - $result = VoterInterface::ACCESS_DENIED; - if (!isset($this->evaluators[$attribute->expression])) { - $this->evaluators[$attribute->expression] = - $this->createEvaluator($attribute); - } - - if (call_user_func($this->evaluators[$attribute->expression], - $this->expressionHandler->createContext($token, $object))) { - return VoterInterface::ACCESS_GRANTED; - } - } - - return $result; - } - - public function supportsAttribute($attribute) - { - return $attribute instanceof Expression; - } - - public function supportsClass($class) - { - return true; - } - - protected function getCompiler() - { - if (null === $this->compiler) { - throw new RuntimeException('A compiler must be set.'); - } - - return $this->compiler; - } - - private function createEvaluator(Expression $expr) - { - if ($this->cacheDir) { - if (is_file($file = $this->cacheDir.'/'.sha1($expr->expression).'.php')) { - return require $file; - } - - $source = $this->getCompiler()->compileExpression($expr); - file_put_contents($file, "getCompiler()->compileExpression($expr)); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/LazyLoadingExpressionVoter.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/LazyLoadingExpressionVoter.php deleted file mode 100644 index b9d577e..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Expression/LazyLoadingExpressionVoter.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression; - -use Symfony\Component\DependencyInjection\ContainerInterface; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionVoter; - -class LazyLoadingExpressionVoter extends ExpressionVoter -{ - private $container; - private $compilerId; - - public function setLazyCompiler(ContainerInterface $container, $id) - { - $this->container = $container; - $this->compilerId = $id; - } - - protected function getCompiler() - { - return $this->container->get($this->compilerId); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Interception/MethodSecurityInterceptor.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Interception/MethodSecurityInterceptor.php deleted file mode 100644 index 8d4c63a..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Interception/MethodSecurityInterceptor.php +++ /dev/null @@ -1,150 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Interception; - -use JMS\SecurityExtraBundle\Exception\RuntimeException; -use CG\Core\ClassUtils; - -use CG\Proxy\MethodInterceptorInterface; -use CG\Proxy\MethodInvocation; -use JMS\SecurityExtraBundle\Metadata\MethodMetadata; -use JMS\SecurityExtraBundle\Security\Authentication\Token\RunAsUserToken; -use JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AfterInvocationManagerInterface; -use JMS\SecurityExtraBundle\Security\Authorization\RunAsManagerInterface; -use Metadata\MetadataFactoryInterface; -use Symfony\Component\HttpKernel\Log\LoggerInterface; -use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface; -use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface; -use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Security\Core\Exception\AccessDeniedException; -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; -use Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException; - -/** - * All invocations of secure methods will go through this class. - * - * @author Johannes M. Schmitt - */ -class MethodSecurityInterceptor implements MethodInterceptorInterface -{ - private $alwaysAuthenticate; - private $securityContext; - private $metadataFactory; - private $authenticationManager; - private $accessDecisionManager; - private $afterInvocationManager; - private $runAsManager; - private $logger; - - public function __construct(SecurityContext $securityContext, AuthenticationManagerInterface $authenticationManager, AccessDecisionManagerInterface $accessDecisionManager, - AfterInvocationManagerInterface $afterInvocationManager, RunAsManagerInterface $runAsManager, MetadataFactoryInterface $metadataFactory, LoggerInterface $logger = null) - { - $this->alwaysAuthenticate = false; - $this->securityContext = $securityContext; - $this->metadataFactory = $metadataFactory; - $this->authenticationManager = $authenticationManager; - $this->accessDecisionManager = $accessDecisionManager; - $this->afterInvocationManager = $afterInvocationManager; - $this->runAsManager = $runAsManager; - $this->logger = $logger; - } - - public function setAlwaysAuthenticate($boolean) - { - $this->alwaysAuthenticate = !!$boolean; - } - - public function intercept(MethodInvocation $method) - { - $metadata = $this->metadataFactory->getMetadataForClass($method->reflection->class); - - // no security metadata, proceed - if (empty($metadata) || !isset($metadata->methodMetadata[$method->reflection->name])) { - return $method->proceed(); - } - $metadata = $metadata->methodMetadata[$method->reflection->name]; - - if (null === $token = $this->securityContext->getToken()) { - throw new AuthenticationCredentialsNotFoundException( - 'The security context was not populated with a Token.' - ); - } - - if ($this->alwaysAuthenticate || !$token->isAuthenticated()) { - $token = $this->authenticationManager->authenticate($token); - $this->securityContext->setToken($token); - } - - if (!empty($metadata->roles) && false === $this->accessDecisionManager->decide($token, $metadata->roles, $method)) { - throw new AccessDeniedException('Token does not have the required roles.'); - } - - if (!empty($metadata->paramPermissions)) { - foreach ($method->arguments as $index => $argument) { - if (null !== $argument && isset($metadata->paramPermissions[$index]) && false === $this->accessDecisionManager->decide($token, $metadata->paramPermissions[$index], $argument)) { - throw new AccessDeniedException(sprintf('Token does not have the required permissions for method "%s::%s".', $method->reflection->class, $method->reflection->name)); - } - } - } - - $runAsToken = null; - if (!empty($metadata->runAsRoles)) { - $runAsToken = $this->runAsManager->buildRunAs($token, $method, $metadata->runAsRoles); - - if (null !== $this->logger) { - $this->logger->debug('Populating security context with RunAsToken'); - } - - if (null === $runAsToken) { - throw new RuntimeException('RunAsManager must not return null from buildRunAs().'); - } - - $this->securityContext->setToken($runAsToken); - } - - try { - $returnValue = $method->proceed(); - - if (null !== $runAsToken) { - $this->restoreOriginalToken($runAsToken); - } - - if (empty($metadata->returnPermissions)) { - return $returnValue; - } - - return $this->afterInvocationManager->decide($this->securityContext->getToken(), $method, $metadata->returnPermissions, $returnValue); - } catch (\Exception $failed) { - if (null !== $runAsToken) { - $this->restoreOriginalToken($runAsToken); - } - - throw $failed; - } - } - - private function restoreOriginalToken(RunAsUserToken $runAsToken) - { - if (null !== $this->logger) { - $this->logger->debug('Populating security context with original Token.'); - } - - $this->securityContext->setToken($runAsToken->getOriginalToken()); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Interception/SecurityPointcut.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Interception/SecurityPointcut.php deleted file mode 100644 index 9cba96c..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Interception/SecurityPointcut.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Interception; - -use CG\Core\ClassUtils; -use Metadata\MetadataFactoryInterface; -use JMS\AopBundle\Aop\PointcutInterface; - -class SecurityPointcut implements PointcutInterface -{ - private $metadataFactory; - private $secureAllServices; - private $securedClasses = array(); - private $patterns; - - public function __construct(MetadataFactoryInterface $metadataFactory, $secureAllServices = false, array $patterns = array()) - { - $this->metadataFactory = $metadataFactory; - $this->secureAllServices = $secureAllServices; - $this->patterns = $patterns; - } - - public function setSecuredClasses(array $classes) - { - $this->securedClasses = $classes; - } - - public function matchesClass(\ReflectionClass $class) - { - if ($this->secureAllServices) { - return true; - } - - if ('Controller' === substr(ClassUtils::getUserClass($class->name), -10)) { - return true; - } - - foreach ($this->patterns as $pattern => $expr) { - // if not for all patterns the class is specified, then we need to scan all - // classes to catch all methods - if (false === $pos = strpos($pattern, '::')) { - // controller notation is already checked by JMSDiExtraBundle, - // we can safely ignore these patterns here - if (2 === substr_count($pattern, ':')) { - continue; - } - - return true; - } - - if (0 < preg_match('#'.substr($pattern, 0, $pos).'$#', $class->name)) { - return true; - } - } - - foreach ($this->securedClasses as $securedClass) { - if ($class->name === $securedClass || $class->isSubclassOf($securedClass)) { - return true; - } - } - - return false; - } - - public function matchesMethod(\ReflectionMethod $method) - { - $userClass = ClassUtils::getUserClass($method->class); - $metadata = $this->metadataFactory->getMetadataForClass($userClass); - - if (null === $metadata) { - return false; - } - - return isset($metadata->methodMetadata[$method->name]); - } -} diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/RunAsManager.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/RunAsManager.php deleted file mode 100644 index f1884df..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/RunAsManager.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization; - -use JMS\SecurityExtraBundle\Security\Authentication\Token\RunAsUserToken; -use Symfony\Component\Security\Core\Role\Role; -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; - -/** - * The RunAsManager creates throw-away Tokens which are temporarily injected into - * the security context for the duration of the invocation of a specific method. - * - * @author Johannes M. Schmitt - */ -class RunAsManager implements RunAsManagerInterface -{ - private $key; - private $rolePrefix; - - public function __construct($key, $rolePrefix = 'ROLE_') - { - $this->key = $key; - $this->rolePrefix = $rolePrefix; - } - - /** - * {@inheritDoc} - */ - public function buildRunAs(TokenInterface $token, $secureObject, array $attributes) - { - $roles = array(); - foreach ($attributes as $attribute) - { - if ($this->supportsAttribute($attribute)) { - $roles[] = new Role($attribute); - } - } - - if (0 === count($roles)) { - return null; - } - - $roles = array_merge($roles, $token->getRoles()); - - return new RunAsUserToken($this->key, $token->getUser(), $token->getCredentials(), $roles, $token); - } - - /** - * {@inheritDoc} - */ - public function supportsAttribute($attribute) - { - return !empty($attribute) && 0 === strpos($attribute, $this->rolePrefix); - } - - /** - * {@inheritDoc} - */ - public function supportsClass($className) - { - return true; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/RunAsManagerInterface.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/RunAsManagerInterface.php deleted file mode 100644 index a2b4909..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/RunAsManagerInterface.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization; - -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; - -/** - * RunAsManagerInterface - * - * @author Johannes M. Schmitt - */ -interface RunAsManagerInterface -{ - /** - * Creates a temporary RunAsToken. - * - * The returned Token must have a complementing AuthenticationProvider implementation. - * - * @param TokenInterface $token the original Token - * @param object $secureObject the secure object which caused this call - * @param array $attributes an array of attributes to apply to the built token - * @return TokenInterface - */ - function buildRunAs(TokenInterface $token, $secureObject, array $attributes); - - /** - * Whether this RunAsManager supports the given attribute - * - * @param string $attribute - * @return Boolean - */ - function supportsAttribute($attribute); - - /** - * Whether this RunAsManager supports the given class. - * - * @param string $className The class of the secure object which requests RunAs capabilities - * @return Boolean - */ - function supportsClass($className); -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Voter/IddqdVoter.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Voter/IddqdVoter.php deleted file mode 100644 index 663cd4e..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Voter/IddqdVoter.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Voter; - -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; -use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; - -/** - * This voter adds a special role "ROLE_IDDQD" which effectively bypasses any, - * and all security checks. - * - * Most of the time, you will want to use this rule in combination with a - * @RunAs annotation to disable security checks for the invocation of a - * specific method. - * - * @author Johannes M. Schmitt - */ -class IddqdVoter implements VoterInterface -{ - public function vote(TokenInterface $token, $object, array $attributes) - { - return $this->isIddqd($token) ? VoterInterface::ACCESS_GRANTED : VoterInterface::ACCESS_ABSTAIN; - } - - protected function isIddqd(TokenInterface $token) - { - foreach ($token->getRoles() as $role) { - if ('ROLE_IDDQD' === $role->getRole()) { - return true; - } - } - - return false; - } - - public function supportsAttribute($attribute) - { - return true; - } - - public function supportsClass($class) - { - return true; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Twig/SecurityExtension.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Twig/SecurityExtension.php deleted file mode 100644 index 21ad8aa..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Twig/SecurityExtension.php +++ /dev/null @@ -1,35 +0,0 @@ -context = $context; - } - - public function getFunctions() - { - return array( - 'is_expr_granted' => new \Twig_Function_Method($this, 'isExprGranted', array( - 'is_safe' => true, - )), - ); - } - - public function isExprGranted($expr, $object = null) - { - return $this->context->isGranted(array(new Expression($expr)), $object); - } - - public function getName() - { - return 'jms_security_extra'; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/composer.json b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/composer.json deleted file mode 100644 index 00e4113..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/composer.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "jms/security-extra-bundle", - "description": "Enhances the Symfony2 Security Component by adding several new features", - "keywords": ["annotations","authorization"], - "type": "symfony-bundle", - "license": "Apache", - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "require": { - "symfony/framework-bundle": "2.*", - "jms/metadata": "1.1.*", - "jms/aop-bundle": "1.0.*" - }, - "recommend": { - "jms/di-extra-bundle": "1.0.*" - }, - "autoload": { - "psr-0": { "JMS\\SecurityExtraBundle": "" } - }, - "target-dir": "JMS/SecurityExtraBundle" -} diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/PreAuthorize.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/PreAuthorize.php deleted file mode 100644 index 0128138..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/PreAuthorize.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Annotation; - -use JMS\SecurityExtraBundle\Exception\InvalidArgumentException; - -/** - * Annotation for expression-based access control. - * - * @Annotation - * @Target("METHOD") - * - * @author Johannes M. Schmitt - */ -final class PreAuthorize -{ - /** - * @Required - * @var string - */ - public $expr; - - public function __construct() - { - if (0 === func_num_args()) { - return; - } - $values = func_get_arg(0); - - if (isset($values['value'])) { - $values['expr'] = $values['value']; - } - if (!isset($values['expr'])) { - throw new InvalidArgumentException('The "expr" attribute must be set for annotation @PreAuthorize.'); - } - - if (!is_string($values['expr'])) { - throw new InvalidArgumentException(sprintf('The "expr" attribute of annotation @PreAuthorize must be a string, but got "%s".', gettype($values['expr']))); - } - - $this->expr = $values['expr']; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/RunAs.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/RunAs.php deleted file mode 100644 index 94de7a3..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/RunAs.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Annotation; - -use JMS\SecurityExtraBundle\Exception\InvalidArgumentException; - -/** - * @Annotation - * @Target("METHOD") - */ -final class RunAs -{ - public $roles; - - public function __construct(array $values) - { - if (isset($values['value'])) { - $values['roles'] = $values['value']; - } - if (!isset($values['roles'])) { - throw new InvalidArgumentException('"roles" must be defined for RunAs annotation.'); - } - - $this->roles = array_map('trim', explode(',', $values['roles'])); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/SatisfiesParentSecurityPolicy.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/SatisfiesParentSecurityPolicy.php deleted file mode 100644 index e087f2f..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/SatisfiesParentSecurityPolicy.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Annotation; - -/** - * This must be declared on classes which inherit from classes that have - * requested method invocation securing capabilities. - * - * It indicates to the analyzer that the developer is aware of these security - * restrictions, and has applied them to the root class in an appropriate - * fashion. - * - * We cannot do this automatically without properly analyzing the control flow, - * and in some cases it is not possible at all. See the following example: - * - * - * // child class - * public function editComment($commentId) - * { - * // retrieve comment from database - * $comment = $this->entityManager->find($commentId); - * - * return parent::editComment($comment); - * } - * - * // base class which is inherited from - * /** - * * @SecureParam(name="comment", permissions="EDIT") - * *\/ - * public function editComment(Comment $comment) - * { - * // do some supposedly secure action - * } - * - * - * The above example can be rewritten so that we can apply security checks - * automatically: - * - * - * // child class - * public function editComment($commentId) - * { - * // retrieve comment from database - * $comment = $this->entityManager->find($commentId); - * - * return $this->doEditComment($comment); - * } - * - * // base class which is inherited from - * /** - * * @SecureParam(name="comment", permissions="EDIT") - * *\/ - * protected function doEditComment(Comment $comment) - * { - * // do some secure action - * } - * - * - * @Annotation - * @Target("METHOD") - * @author Johannes M. Schmitt - */ -final class SatisfiesParentSecurityPolicy -{ -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/Secure.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/Secure.php deleted file mode 100644 index bffd8fd..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/Secure.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Annotation; - -use JMS\SecurityExtraBundle\Exception\InvalidArgumentException; - -/** - * Represents a @Secure annotation. - * - * @Annotation - * @Target("METHOD") - * @author Johannes M. Schmitt - */ -final class Secure -{ - public $roles; - - public function __construct(array $values) - { - if (isset($values['value'])) { - $values['roles'] = $values['value']; - } - if (!isset($values['roles'])) { - throw new InvalidArgumentException('You must define a "roles" attribute for each Secure annotation.'); - } - - $this->roles = array_map('trim', explode(',', $values['roles'])); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/SecureParam.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/SecureParam.php deleted file mode 100644 index ec098b7..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/SecureParam.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Annotation; - -use JMS\SecurityExtraBundle\Exception\InvalidArgumentException; - -/** - * Represents a @SecureParam annotation. - * - * @Annotation - * @Target("METHOD") - * @author Johannes M. Schmitt - */ -final class SecureParam -{ - public $name; - public $permissions; - - public function __construct(array $values) - { - if (!isset($values['name'])) { - throw new InvalidArgumentException('You must define a "name" attribute for each SecureParam annotation.'); - } - if (!isset($values['permissions'])) { - throw new InvalidArgumentException('You must define a "permissions" attribute for each SecureParam annotation.'); - } - - $this->name = $values['name']; - - $this->permissions = array_map('trim', explode(',', $values['permissions'])); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/SecureReturn.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/SecureReturn.php deleted file mode 100644 index 35e071e..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Annotation/SecureReturn.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Annotation; - -use JMS\SecurityExtraBundle\Exception\InvalidArgumentException; - -/** - * Represents a @SecureReturn annotation. - * - * @Annotation - * @Target("METHOD") - * @author Johannes M. Schmitt - */ -final class SecureReturn -{ - public $permissions; - - public function __construct(array $values) - { - if (isset($values['value'])) { - $values['permissions'] = $values['value']; - } - if (!isset($values['permissions'])) { - throw new InvalidArgumentException('You must define a "permissions" attribute for each SecureReturn annotation.'); - } - - $this->permissions = array_map('trim', explode(',', $values['permissions'])); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/CHANGELOG-1.1.md b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/CHANGELOG-1.1.md deleted file mode 100644 index a76156b..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/CHANGELOG-1.1.md +++ /dev/null @@ -1,38 +0,0 @@ -This document details all changes from JMSSecurityExtraBundle 1.0.x to 1.1: - -- The configuration option "secure_controllers" has been removed. This setting is - now automatically enabled, but it requires the JMSDiExtraBundle. - -- The dependencies of this bundle have changed: - - * The metadata library 1.1 version is now required instead of the 1.0 version - (if you are using the Standard Edition, just change the "version=origin/1.0.x" - line from your deps file to "version=1.1.0"). - * The JMSAopBundle is now required. For installation instructions, please see - https://github.com/schmittjoh/JMSAopBundle - * The JMSDiExtraBundle is now required if you want to secure your non-service - controllers (if you only have service controllers, you don't need it). For - installation instructions, see https://github.com/schmittjoh/JMSDiExtraBundle - -- The attribute "IS_IDDQD" has been renamed to "ROLE_IDDQD" - -- A powerful expression-based authorization language has been added which works - in combination with the existing voting system. Since it is much more powerful - than the built-in voters, and also much faster, you are highly encouraged to - migrate your existing authorization rules to expressions, and eventually disable - the built-in voters entirely. Some examples for how to convert simple attributes - to their equivalent expressions are listed below: - - * IS_AUTHENTICATED_ANONYMOUSLY -> "permitAll" - * IS_AUTHENTICATED_REMEMBERED -> "isAuthenticated()" - * IS_AUTHENTICATED_FULLY -> "isFullyAuthenticated()" - * ROLE_FOO -> "hasRole('ROLE_FOO')" - -- The ability to configure method access control (e.g. for controller actions) - in the DI configuration has been added. Note that for non-service controllers - the JMSDiExtraBundle is required. - -- The "is_expr_granted" Twig function has been added if you want to check an - expression from a Twig template. - - diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/AccessControlConfiguration.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/AccessControlConfiguration.php deleted file mode 100644 index dc547a1..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/AccessControlConfiguration.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\DependencyInjection; - -use Symfony\Component\Config\Definition\ConfigurationInterface; - -use Symfony\Component\HttpKernel\Kernel; - -use Symfony\Bundle\SecurityBundle\DependencyInjection\MainConfiguration as BaseConfiguration; -use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory; -use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; - -/** - * Enhances the access_control section configuration. - * - * @author Johannes M. Schmitt - */ -class AccessControlConfiguration implements ConfigurationInterface -{ - /** - * Generates the configuration tree builder. - * - * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder - */ - public function getConfigTreeBuilder() - { - $tb = new TreeBuilder(); - $rootNode = $tb->root('security'); - - $rootNode - ->ignoreExtraKeys() - ->fixXmlConfig('rule', 'access_control') - ->children() - ->arrayNode('access_control') - ->cannotBeOverwritten() - ->prototype('array') - ->fixXmlConfig('role') - ->validate() - ->always(function($v) { - if (!empty($v['roles']) && isset($v['access'])) { - throw new \Exception('"roles", and "access" cannot be set at the same time.'); - } - - if (empty($v['roles'])) { - unset($v['roles']); - } - - return $v; - }) - ->end() - ->children() - ->scalarNode('requires_channel')->defaultNull()->end() - ->scalarNode('path')->defaultNull()->end() - ->scalarNode('host')->defaultNull()->end() - ->scalarNode('ip')->defaultNull()->end() - ->arrayNode('methods') - ->beforeNormalization()->ifString()->then(function($v) { return preg_split('/\s*,\s*/', $v); })->end() - ->prototype('scalar')->end() - ->end() - ->arrayNode('roles') - ->beforeNormalization()->ifString()->then(function($v) { return preg_split('/\s*,\s*/', $v); })->end() - ->prototype('scalar')->end() - ->end() - ->scalarNode('access')->end() - ->end() - ->end() - ->end() - ->end() - ; - - return $tb; - } -} diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Compiler/AddAfterInvocationProvidersPass.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Compiler/AddAfterInvocationProvidersPass.php deleted file mode 100644 index 64547b1..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Compiler/AddAfterInvocationProvidersPass.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * Collects after invocation providers. - * - * @author Johannes M. Schmitt - */ -class AddAfterInvocationProvidersPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('security.access.after_invocation_manager')) { - return; - } - - $providers = array(); - foreach (array_keys($container->findTaggedServiceIds('security.after_invocation.provider')) as $id) { - if ('security.access.after_invocation.acl_provider' === $id && !$container->has('security.acl.provider')) { - continue; - } - - $providers[] = new Reference($id); - } - - $container - ->getDefinition('security.access.after_invocation_manager') - ->setArguments(array($providers)) - ; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Compiler/AddExpressionCompilersPass.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Compiler/AddExpressionCompilersPass.php deleted file mode 100644 index 6b63a42..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Compiler/AddExpressionCompilersPass.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\DependencyInjection\Compiler; - -use JMS\SecurityExtraBundle\Exception\RuntimeException; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -class AddExpressionCompilersPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('security.expressions.compiler')) { - return; - } - - $compilerDef = $container->getDefinition('security.expressions.compiler'); - foreach ($container->findTaggedServiceIds('security.expressions.function_compiler') - as $id => $attr) { - $compilerDef->addMethodCall('addFunctionCompiler', array(new Reference($id))); - } - - foreach ($container->findTaggedServiceIds('security.expressions.type_compiler') - as $id => $attr) { - $compilerDef->addMethodCall('addTypeCompiler', array(new Reference($id))); - } - - $serviceMap = $parameterMap = array(); - foreach ($container->findTaggedServiceIds('security.expressions.variable') as $id => $attributes) { - foreach ($attributes as $attr) { - if (!isset($attr['variable']) || (!isset($attr['service']) && !isset($attr['parameter']))) { - throw new RuntimeException(sprintf('"variable", and either "service" or "parameter" must be given for tag "security.expressions.variable" for service id "%s".', $id)); - } - - if (isset($attr['service'])) { - $serviceMap[$attr['variable']] = $attr['service']; - $container - ->findDefinition($attr['service']) - ->setPublic(true) - ; - } else { - $parameterMap[$attr['variable']] = $attr['parameter']; - } - } - } - $container->getDefinition('security.expressions.variable_compiler') - ->addMethodCall('setMaps', array($serviceMap, $parameterMap)); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Compiler/CollectSecuredServicesPass.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Compiler/CollectSecuredServicesPass.php deleted file mode 100644 index b813b89..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Compiler/CollectSecuredServicesPass.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Collects secured services. - * - * @author Johannes M. Schmitt - */ -class CollectSecuredServicesPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - $securedClasses = array(); - foreach ($container->findTaggedServiceIds('security.secure_service') as $id => $attr) { - $securedClasses[] = $container->getDefinition($id)->getClass(); - } - - $container - ->getDefinition('security.access.pointcut') - ->addMethodCall('setSecuredClasses', array($securedClasses)) - ; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Compiler/DisableVotersPass.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Compiler/DisableVotersPass.php deleted file mode 100644 index fb35bb9..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Compiler/DisableVotersPass.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -class DisableVotersPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if ($container->getParameter('security.role_voter.disabled')) { - $container->removeDefinition('security.access.role_hierarchy_voter'); - $container->removeDefinition('security.access.simple_role_voter'); - } - - if ($container->getParameter('security.authenticated_voter.disabled')) { - $container->removeDefinition('security.access.authenticated_voter'); - } - - if ($container->hasDefinition('security.acl.voter.basic_permissions')) { - if ($container->getParameter('security.acl_voter.disabled')) { - $container->removeDefinition('security.acl.voter.basic_permissions'); - } else { - $container->getDefinition('security.acl.voter.basic_permissions') - ->setClass('JMS\SecurityExtraBundle\Security\Acl\Voter\AclVoter'); - } - } - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Compiler/IntegrationPass.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Compiler/IntegrationPass.php deleted file mode 100644 index abfcdb2..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Compiler/IntegrationPass.php +++ /dev/null @@ -1,22 +0,0 @@ -hasAlias('security.acl.provider') - && !$container->hasDefinition('security.acl.provider')) { - $container->removeDefinition('security.acl.permission_evaluator'); - } - - if ($container->hasDefinition('security.role_hierarchy')) { - $container->getDefinition('security.role_hierarchy') - ->setPublic(true); - } - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Configuration.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Configuration.php deleted file mode 100644 index 70cf1d5..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/Configuration.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\DependencyInjection; - -use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\Config\Definition\ConfigurationInterface; - -class Configuration implements ConfigurationInterface -{ - public function getConfigTreeBuilder() - { - $tb = new TreeBuilder(); - $tb - ->root('jms_security_extra') - ->validate() - ->always(function($v) { - if ($v['method_access_control'] && !$v['expressions']) { - throw new \Exception('You need to enable expressions if you want to configure method access via the DI config.'); - } - - return $v; - }) - ->end() - ->children() - ->booleanNode('secure_all_services')->defaultFalse()->end() - ->booleanNode('enable_iddqd_attribute')->defaultFalse()->end() - ->scalarNode('cache_dir')->cannotBeEmpty()->defaultValue('%kernel.cache_dir%/jms_security')->end() - ->booleanNode('expressions')->defaultFalse()->end() - ->arrayNode('voters') - ->addDefaultsIfNotSet() - ->canBeUnset() - ->children() - ->booleanNode('disable_authenticated')->defaultFalse()->end() - ->booleanNode('disable_role')->defaultFalse()->end() - ->booleanNode('disable_acl')->defaultFalse()->end() - ->end() - ->end() - ->arrayNode('method_access_control') - ->useAttributeAsKey('pattern') - ->prototype('scalar')->isRequired()->cannotBeEmpty()->end() - ->end() - ->end() - ->end() - ; - - return $tb; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/JMSSecurityExtraExtension.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/JMSSecurityExtraExtension.php deleted file mode 100644 index cd2e1c2..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/JMSSecurityExtraExtension.php +++ /dev/null @@ -1,100 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\DependencyInjection; - -use Symfony\Component\DependencyInjection\Reference; - -use JMS\SecurityExtraBundle\Exception\RuntimeException; -use Symfony\Component\HttpKernel\DependencyInjection\Extension; -use Symfony\Component\Config\FileLocator; -use Symfony\Component\Config\Definition\Processor; -use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * JMSSecurityExtraExtension. - * - * @author Johannes M. Schmitt - */ -class JMSSecurityExtraExtension extends Extension -{ - public function load(array $configs, ContainerBuilder $container) - { - $bundles = $container->getParameter('kernel.bundles'); - if (!isset($bundles['JMSAopBundle'])) { - throw new RuntimeException('The JMSSecurityExtraBundle requires the JMSAopBundle, please make sure to enable it in your AppKernel.'); - } - - $config = $this->processConfiguration(new Configuration(), $configs); - - $loader = new XmlFileLoader($container, new FileLocator(array(__DIR__.'/../Resources/config/'))); - $loader->load('services.xml'); - - $container->setParameter('security.access.secure_all_services', $config['secure_all_services']); - - $cacheDir = $container->getParameterBag()->resolveValue($config['cache_dir']); - if (!is_dir($cacheDir)) { - if (false === @mkdir($cacheDir, 0777, true)) { - throw new RuntimeException(sprintf('Could not create cache directory "%s".', $cacheDir)); - } - } - $container->setParameter('security.extra.cache_dir', $cacheDir); - - if ($config['expressions']) { - $loader->load('security_expressions.xml'); - - if (!is_dir($cacheDir.'/expressions')) { - if (false === @mkdir($cacheDir.'/expressions', 0777, true)) { - throw new RuntimeException(sprintf('Could not create cache directory "%s".', $cacheDir.'/expressions')); - } - } - - $container->getDefinition('security.expressions.voter') - ->addMethodCall('setCacheDir', array($cacheDir.'/expressions')); - } - - $disableAllVoters = !isset($config['voters']); - $container->setParameter('security.authenticated_voter.disabled', - $disableAllVoters || $config['voters']['disable_authenticated']); - $container->setParameter('security.role_voter.disabled', - $disableAllVoters || $config['voters']['disable_role']); - $container->setParameter('security.acl_voter.disabled', - $disableAllVoters || $config['voters']['disable_acl']); - - if ($config['enable_iddqd_attribute']) { - $container - ->getDefinition('security.extra.iddqd_voter') - ->addTag('security.voter') - ; - - // FIXME: Also add an iddqd after invocation provider - } - - if ($config['method_access_control']) { - $driverDef = $container->getDefinition('security.extra.driver_chain'); - $args = $driverDef->getArguments(); - array_unshift($args[0], new Reference('security.extra.config_driver')); - $driverDef->setArguments($args); - - $container->setParameter('security.access.method_access_control', - $config['method_access_control']); - } - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/SecurityExtension.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/SecurityExtension.php deleted file mode 100644 index 96ddf99..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/DependencyInjection/SecurityExtension.php +++ /dev/null @@ -1,130 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\DependencyInjection; - -use Symfony\Component\HttpKernel\DependencyInjection\Extension; -use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension as BaseSecurityExtension; -use Symfony\Component\HttpKernel\Kernel; -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\Config\FileLocator; - -/** - * Enhances the access_control section of the SecurityBundle. - * - * @author Johannes M. Schmitt - */ -class SecurityExtension extends Extension -{ - private $extension; - - public function __construct(BaseSecurityExtension $extension) - { - $this->extension = $extension; - } - - public function getAlias() - { - return $this->extension->getAlias(); - } - - public function getNamespace() - { - return $this->extension->getNamespace(); - } - - public function getXsdValidationBasePath() - { - return $this->extension->getXsdValidationBasePath(); - } - - public function getClassesToCompile() - { - return array_merge(parent::getClassesToCompile(), $this->extension->getClassesToCompile()); - } - - public function load(array $configs, ContainerBuilder $container) - { - $parentConfigs = array(); - - foreach ($configs as $config) { - if (isset($config['rule'])) { - unset($config['rule']); - } - if (isset($config['access_control'])) { - unset($config['access_control']); - } - - $parentConfigs[] = $config; - } - $this->extension->load($parentConfigs, $container); - - $config = $this->processConfiguration(new AccessControlConfiguration(), $configs); - $this->createAuthorization($config, $container); - } - - public function __call($method, array $args) - { - return call_user_func_array(array($this->extension, $method), $args); - } - - private function createAuthorization($config, ContainerBuilder $container) - { - if (!$config['access_control']) { - return; - } - - $this->addClassesToCompile(array( - 'Symfony\\Component\\Security\\Http\\AccessMap', - )); - - foreach ($config['access_control'] as $access) { - $matcher = $this->invokeParent('createRequestMatcher', array( - $container, - $access['path'], - $access['host'], - count($access['methods']) === 0 ? null : $access['methods'], - $access['ip'] - )); - - if (isset($access['roles'])) { - $attributes = $access['roles']; - } else { - $def = new DefinitionDecorator('security.expressions.expression'); - $def->addArgument($access['access']); - $container->setDefinition($exprId = 'security.expressions.expression.'.sha1($access['access']), $def); - - $attributes = array(new Reference($exprId)); - } - - $container->getDefinition('security.access_map') - ->addMethodCall('add', array($matcher, $attributes, $access['requires_channel'])); - } - } - - private function invokeParent($method, array $args = array()) - { - $ref = new \ReflectionMethod($this->extension, $method); - $ref->setAccessible(true); - - return $ref->invokeArgs($this->extension, $args); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Exception/Exception.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Exception/Exception.php deleted file mode 100644 index b6606f9..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Exception/Exception.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Exception; - -/** - * Base exception for the SecurityExtraBundle. - * - * @author Johannes M. Schmitt - */ -interface Exception -{ -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Exception/InvalidArgumentException.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Exception/InvalidArgumentException.php deleted file mode 100644 index 6a9f2ae..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Exception; - -/** - * InvalidArgumentException for the SecurityExtraBundle. - * - * @author Johannes M. Schmitt - */ -class InvalidArgumentException extends \InvalidArgumentException implements Exception -{ -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Exception/RuntimeException.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Exception/RuntimeException.php deleted file mode 100644 index b7bb573..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Exception/RuntimeException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Exception; - -/** - * RuntimeException for the SecurityExtraBundle. - * - * @author Johannes M. Schmitt - */ -class RuntimeException extends \RuntimeException implements Exception -{ -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/JMSSecurityExtraBundle.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/JMSSecurityExtraBundle.php deleted file mode 100644 index 6f5c0e3..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/JMSSecurityExtraBundle.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle; - -use JMS\SecurityExtraBundle\DependencyInjection\SecurityExtension; -use JMS\SecurityExtraBundle\DependencyInjection\Compiler\IntegrationPass; -use JMS\SecurityExtraBundle\DependencyInjection\Compiler\DisableVotersPass; -use JMS\SecurityExtraBundle\DependencyInjection\Compiler\AddExpressionCompilersPass; -use Symfony\Component\DependencyInjection\Compiler\PassConfig; -use JMS\SecurityExtraBundle\DependencyInjection\Compiler\AddAfterInvocationProvidersPass; -use JMS\SecurityExtraBundle\DependencyInjection\Compiler\CollectSecuredServicesPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\HttpKernel\Bundle\Bundle; - -/** - * Registers our custom compiler pass. - * - * @author Johannes M. Schmitt - */ -class JMSSecurityExtraBundle extends Bundle -{ - const VERSION = '1.1.0'; - - public function build(ContainerBuilder $container) - { - if (!$container->hasExtension('security')) { - throw new \LogicException('The JMSSecurityExtraBundle must be registered after the SecurityBundle in your AppKernel.php.'); - } - $container->registerExtension(new SecurityExtension($container->getExtension('security'))); - - $passConfig = $container->getCompilerPassConfig(); - - // needs to run before voter collection - $passes = $passConfig->getBeforeOptimizationPasses(); - array_unshift($passes, new DisableVotersPass()); - $passConfig->setBeforeOptimizationPasses($passes); - - $passConfig->addPass(new AddAfterInvocationProvidersPass()); - $passConfig->addPass(new CollectSecuredServicesPass()); - $passConfig->addPass(new AddExpressionCompilersPass()); - $passConfig->addPass(new IntegrationPass()); - } -} diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Metadata/ClassMetadata.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Metadata/ClassMetadata.php deleted file mode 100644 index 5f692cb..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Metadata/ClassMetadata.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Metadata; - -use JMS\SecurityExtraBundle\Exception\RuntimeException; -use JMS\SecurityExtraBundle\Exception\InvalidArgumentException; -use Metadata\MethodMetadata; -use Metadata\MergeableInterface; -use Metadata\MergeableClassMetadata; - -/** - * Contains class metadata information - * - * @author Johannes M. Schmitt - */ -class ClassMetadata extends MergeableClassMetadata -{ - public function addMethodMetadata(MethodMetadata $metadata) - { - if ($this->reflection->isFinal()) { - throw new RuntimeException(sprintf('Class "%s" is declared final, and cannot be secured.', $reflection->name)); - } - - if ($metadata->reflection->isStatic()) { - throw new RuntimeException(sprintf('Method "%s::%s" is declared static and cannot be secured.', $metadata->reflection->class, $metadata->reflection->name)); - } - - if ($metadata->reflection->isFinal()) { - throw new RuntimeException(sprintf('Method "%s::%s" is declared final and cannot be secured.', $metadata->reflection->class, $metadata->reflection->name)); - } - - parent::addMethodMetadata($metadata); - } - - public function merge(MergeableInterface $metadata) - { - if (!$metadata instanceof ClassMetadata) { - throw new InvalidArgumentException('$metadata must be an instance of ClassMetadata.'); - } - - foreach ($this->methodMetadata as $name => $methodMetadata) { - // check if metadata was declared on an interface - if (!$metadata->reflection->hasMethod($name)) { - continue; - } - - if ($metadata->reflection->getMethod($name)->getDeclaringClass()->name - !== $methodMetadata->class) { - if (!isset($metadata->methodMetadata[$name])) { - if ($methodMetadata->reflection->isAbstract()) { - continue; - } - - throw new RuntimeException(sprintf( - 'You have overridden a secured method "%s::%s" in "%s". ' - .'Please copy over the applicable security metadata, and ' - .'also add @SatisfiesParentSecurityPolicy.', - $methodMetadata->reflection->class, - $name, - $metadata->reflection->name - )); - } - - if (!$metadata->methodMetadata[$name]->satisfiesParentSecurityPolicy) { - throw new RuntimeException(sprintf('Unresolved security metadata conflict for method "%s::%s" in "%s". Please copy the respective annotations, and add @SatisfiesParentSecurityPolicy to the child method.', $metadata->reflection->name, $name, $methodMetadata->reflection->getDeclaringClass()->getFilename())); - } - } - } - - parent::merge($metadata); - } - - public function isProxyRequired() - { - return !empty($this->methodMetadata); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Metadata/Driver/AnnotationDriver.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Metadata/Driver/AnnotationDriver.php deleted file mode 100644 index 7617c60..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Metadata/Driver/AnnotationDriver.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Metadata\Driver; - -use JMS\SecurityExtraBundle\Exception\InvalidArgumentException; -use Doctrine\Common\Annotations\Reader; -use JMS\SecurityExtraBundle\Annotation\PreAuthorize; -use JMS\SecurityExtraBundle\Annotation\RunAs; -use JMS\SecurityExtraBundle\Annotation\SatisfiesParentSecurityPolicy; -use JMS\SecurityExtraBundle\Annotation\Secure; -use JMS\SecurityExtraBundle\Annotation\SecureParam; -use JMS\SecurityExtraBundle\Annotation\SecureReturn; -use JMS\SecurityExtraBundle\Metadata\ClassMetadata; -use JMS\SecurityExtraBundle\Metadata\MethodMetadata; -use Metadata\Driver\DriverInterface; -use \ReflectionClass; -use \ReflectionMethod; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Expression; - -/** - * Loads security annotations and converts them to metadata - * - * @author Johannes M. Schmitt - */ -class AnnotationDriver implements DriverInterface -{ - private $reader; - - public function __construct(Reader $reader) - { - $this->reader = $reader; - } - - public function loadMetadataForClass(ReflectionClass $reflection) - { - $metadata = new ClassMetadata($reflection->getName()); - - foreach ($reflection->getMethods(ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED) as $method) { - // check if the method was defined on this class - if ($method->getDeclaringClass()->getName() !== $reflection->getName()) { - continue; - } - - $annotations = $this->reader->getMethodAnnotations($method); - - if ($annotations && null !== $methodMetadata = $this->convertMethodAnnotations($method, $annotations)) { - $metadata->addMethodMetadata($methodMetadata); - } - } - - return $metadata; - } - - private function convertMethodAnnotations(\ReflectionMethod $method, array $annotations) - { - $parameters = array(); - foreach ($method->getParameters() as $index => $parameter) { - $parameters[$parameter->getName()] = $index; - } - - $methodMetadata = new MethodMetadata($method->getDeclaringClass()->getName(), $method->getName()); - $hasSecurityMetadata = false; - foreach ($annotations as $annotation) { - if ($annotation instanceof Secure) { - $methodMetadata->roles = $annotation->roles; - $hasSecurityMetadata = true; - } else if ($annotation instanceof PreAuthorize) { - $methodMetadata->roles = array(new Expression($annotation->expr)); - $hasSecurityMetadata = true; - } else if ($annotation instanceof SecureParam) { - if (!isset($parameters[$annotation->name])) { - throw new InvalidArgumentException(sprintf('The parameter "%s" does not exist for method "%s".', $annotation->name, $method->getName())); - } - - $methodMetadata->addParamPermissions($parameters[$annotation->name], $annotation->permissions); - $hasSecurityMetadata = true; - } else if ($annotation instanceof SecureReturn) { - $methodMetadata->returnPermissions = $annotation->permissions; - $hasSecurityMetadata = true; - } else if ($annotation instanceof SatisfiesParentSecurityPolicy) { - $methodMetadata->satisfiesParentSecurityPolicy = true; - $hasSecurityMetadata = true; - } else if ($annotation instanceof RunAs) { - $methodMetadata->runAsRoles = $annotation->roles; - $hasSecurityMetadata = true; - } - } - - return $hasSecurityMetadata ? $methodMetadata : null; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Metadata/Driver/ConfigDriver.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Metadata/Driver/ConfigDriver.php deleted file mode 100644 index 00dd89e..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Metadata/Driver/ConfigDriver.php +++ /dev/null @@ -1,100 +0,0 @@ - - */ -class ConfigDriver implements DriverInterface -{ - private $bundles; - private $config; - - public function __construct(array $bundles, array $config) - { - uasort($bundles, function($a, $b) { - return strlen($b) - strlen($a); - }); - - foreach ($bundles as $name => $namespace) { - $bundles[$name] = substr($namespace, 0, strrpos($namespace, '\\')); - } - - $this->bundles = $bundles; - $this->config = $config; - } - - public function loadMetadataForClass(\ReflectionClass $class) - { - $metadata = new ClassMetadata($class->name); - - foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $method) { - if ($method->getDeclaringClass()->name !== $class->name) { - continue; - } - - $expression = null; - if (null !== $notation = $this->getControllerNotation($method)) { - $expression = $this->getExpressionForSignature($notation); - } - - if (null === $expression && null === $expression = - $this->getExpressionForSignature($method->class.'::'.$method->name)) { - continue; - } - - $methodMetadata = new MethodMetadata($method->class, $method->name); - $methodMetadata->roles = array(new Expression($expression)); - $metadata->addMethodMetadata($methodMetadata); - } - - if (!$metadata->methodMetadata) { - return null; - } - - return $metadata; - } - - private function getExpressionForSignature($signature) - { - foreach ($this->config as $pattern => $expr) { - if (!preg_match('#'.$pattern.'#i', $signature)) { - continue; - } - - return $expr; - } - - return null; - } - - // TODO: Is it feasible to reverse-engineer the notation for service controllers? - private function getControllerNotation(\ReflectionMethod $method) - { - $signature = $method->class.'::'.$method->name; - - // check if class is a controller - if (0 === preg_match('#\\\\Controller\\\\([^\\\\]+)Controller::(.+)Action$#', $signature, $match)) { - return null; - } - - foreach ($this->bundles as $name => $namespace) { - if (0 !== strpos($method->class, $namespace)) { - continue; - } - - // controller notation (AcmeBundle:Foo:foo) - return $name.':'.$match[1].':'.$match[2]; - } - - return null; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Metadata/MethodMetadata.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Metadata/MethodMetadata.php deleted file mode 100644 index 6bec7ce..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Metadata/MethodMetadata.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Metadata; - -use Metadata\MethodMetadata as BaseMethodMetadata; - -/** - * Contains method metadata information - * - * @author Johannes M. Schmitt - */ -class MethodMetadata extends BaseMethodMetadata -{ - public $roles = array(); - public $paramPermissions = array(); - public $returnPermissions = array(); - public $runAsRoles = array(); - public $satisfiesParentSecurityPolicy = false; - - /** - * Adds a parameter restriction - * - * @param integer $index 0-based - * @param array $permissions - */ - public function addParamPermissions($index, array $permissions) - { - $this->paramPermissions[$index] = $permissions; - } - - public function isDeclaredOnInterface() - { - foreach ($this->reflection->getDeclaringClass()->getInterfaces() as $interface) { - if ($interface->hasMethod($this->name)) { - return true; - } - } - - return false; - } - - /** - * This allows to merge in metadata from an interface - * - * @param MethodMetadata $method - * @return void - */ - public function merge(MethodMetadata $method) - { - if (!$this->roles) { - $this->roles = $method->roles; - } - - if (!$this->returnPermissions) { - $this->returnPermissions = $method->returnPermissions; - } - - if (!$this->runAsRoles) { - $this->runAsRoles = $method->runAsRoles; - } - - foreach ($method->paramPermissions as $index => $permissions) { - if (!isset($this->paramPermissions[$index])) { - $this->paramPermissions[$index] = $permissions; - } - } - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/README b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/README deleted file mode 100644 index 72bab21..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/README +++ /dev/null @@ -1,8 +0,0 @@ -For documentation, see: - - Resources/doc - - -For license, see: - - Resources/meta/LICENSE \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Resources/config/security_expressions.xml b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Resources/config/security_expressions.xml deleted file mode 100644 index 493e2ea..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Resources/config/security_expressions.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - JMS\SecurityExtraBundle\Security\Acl\Expression\PermissionEvaluator - JMS\SecurityExtraBundle\Security\Acl\Expression\HasPermissionFunctionCompiler - - JMS\SecurityExtraBundle\Security\Authorization\Expression\LazyLoadingExpressionVoter - JMS\SecurityExtraBundle\Security\Authorization\Expression\ContainerAwareExpressionHandler - - JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler - JMS\SecurityExtraBundle\Security\Authorization\Expression\Expression - - JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\ContainerAwareVariableCompiler - JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\ParameterExpressionCompiler - - JMS\SecurityExtraBundle\Metadata\Driver\ConfigDriver - - JMS\SecurityExtraBundle\Twig\SecurityExtension - - - - - - - - - - %kernel.bundles% - %security.access.method_access_control% - - - - - - - - - - - - - - - - - - - - security.expressions.compiler - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Resources/config/services.xml b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Resources/config/services.xml deleted file mode 100644 index 0ad446c..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Resources/config/services.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - JMS\SecurityExtraBundle\Security\Authorization\Interception\MethodSecurityInterceptor - - - JMS\SecurityExtraBundle\Security\Authorization\RunAsManager - JMS\SecurityExtraBundle\Security\Authentication\Provider\RunAsAuthenticationProvider - RunAsToken - ROLE_ - - JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AfterInvocationManager - JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AclAfterInvocationProvider - - JMS\SecurityExtraBundle\Security\Authorization\Voter\IddqdVoter - - Metadata\MetadataFactory - Metadata\Driver\LazyLoadingDriver - Metadata\Driver\DriverChain - JMS\SecurityExtraBundle\Metadata\Driver\AnnotationDriver - Metadata\Cache\FileCache - - - - - %security.run_as.key% - %security.run_as.role_prefix% - - - - - - - - - - - - - - - %security.access.secure_all_services% - %security.access.method_access_control% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - security.extra.metadata_driver - - - - - - - - %security.extra.cache_dir% - %kernel.debug% - - - - - - \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Resources/doc/index.rst b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Resources/doc/index.rst deleted file mode 100644 index 8b41a2f..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Resources/doc/index.rst +++ /dev/null @@ -1,352 +0,0 @@ -======== -Overview -======== - -This bundle enhances the Symfony2 Security Component by adding several new features. - -Features: - -- powerful expression-based authorization language -- method security authorization -- authorization configuration via annotations - -Installation ------------- -Add the following to your ``deps`` file:: - - [JMSSecurityExtraBundle] - git=https://github.com/schmittjoh/JMSSecurityExtraBundle.git - target=/bundles/JMS/SecurityExtraBundle - - ; Dependencies: - ;-------------- - [metadata] - git=https://github.com/schmittjoh/metadata.git - version=1.1.0 ; <- make sure to get 1.1, not 1.0 - - ; see https://github.com/schmittjoh/JMSAopBundle/blob/master/Resources/doc/index.rst - [JMSAopBundle] - git=https://github.com/schmittjoh/JMSAopBundle.git - target=/bundles/JMS/AopBundle - - [cg-library] - git=https://github.com/schmittjoh/cg-library.git - - ; This dependency is optional (you need it if you are using non-service controllers): - ; see https://github.com/schmittjoh/JMSDiExtraBundle/blob/master/Resources/doc/index.rst - [JMSDiExtraBundle] - git=https://github.com/schmittjoh/JMSDiExtraBundle.git - target=/bundles/JMS/DiExtraBundle - -Then register the bundle with your kernel:: - - // in AppKernel::registerBundles() - $bundles = array( - // ... - new JMS\AopBundle\JMSAopBundle(), - new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(), - new JMS\DiExtraBundle\JMSDiExtraBundle($this), - // ... - ); - -Make sure that you also register the namespaces with the autoloader:: - - // app/autoload.php - $loader->registerNamespaces(array( - // ... - 'JMS' => __DIR__.'/../vendor/bundles', - 'Metadata' => __DIR__.'/../vendor/metadata/src', - 'CG' => __DIR__.'/../vendor/cg-library/src', - // ... - )); - -Configuration -------------- - -Below, you find the default configuration:: - - # app/config/config.yml - jms_security_extra: - # Whether you want to secure all services (true), or only secure specific - # services (false); see also below - secure_all_services: false - - # Enabling this setting will add an additional special attribute "IS_IDDQD". - # Anybody with this attribute will effectively bypass all security checks. - enable_iddqd_attribute: false - - # Enables expression language - expressions: false - - # Allows you to disable some, or all built-in voters - voters: - disable_authenticated: false - disable_role: false - disable_acl: false - - # Allows you to specify access control rules for specific methods, such - # as controller actions - method_access_control: { } - - -Expression-based Authorization Language ---------------------------------------- -The expression language is a very powerful alternative to the simple attributes -of the security voting system. They allow to perform complex access decision -checks, and because they are compiled down to raw PHP, they are much faster than -the built-in voters. Also they are lazy-loading by nature, so you will also -save some resources for example by not having to initialize the entire ACL system -on each request. - -Programmatic Usage -~~~~~~~~~~~~~~~~~~ -You can execute expressions programmatically by using the ``isGranted`` method -of the SecurityContext. Some examples:: - - use JMS\SecurityExtraBundle\Security\Authorization\Expression\Expression; - - $securityContext->isGranted(array(new Expression('hasRole("A")'))); - $securityContext->isGranted(array(new Expression('hasRole("A") or (hasRole("B") and hasRole("C"))'))); - $securityContext->isGranted(array(new Expression('hasPermission(object, "VIEW")'), $object)); - $securityContext->isGranted(array(new Expression('token.getUsername() == "Johannes"'))); - -Twig Usage -~~~~~~~~~~ -You can check expressions from Twig templates using the ``is_expr_granted`` -function. Some examples:: - - is_expr_granted("hasRole('FOO')") - is_expr_granted("hasPermission(object, 'VIEW')", object) - -Usage in Access Control -~~~~~~~~~~~~~~~~~~~~~~~ -You can also use expressions in the ``access_control``:: - - security: - access_control: - - { path: ^/foo, access: "hasRole('FOO') and hasRole('BAR')" } - -Annotation-based Usage -~~~~~~~~~~~~~~~~~~~~~~ -see @PreAuthorize in the annotation reference - -Reference -~~~~~~~~~ -+-----------------------------------+--------------------------------------------+ -| Expression | Description | -+===================================+============================================+ -| hasRole('ROLE') | Checks whether the token has a certain | -| | role. | -+-----------------------------------+--------------------------------------------+ -| hasAnyRole('ROLE1', 'ROLE2', ...) | Checks whether the token has any of the | -| | given roles. | -+-----------------------------------+--------------------------------------------+ -| isAnonymous() | Checks whether the token is anonymous. | -+-----------------------------------+--------------------------------------------+ -| isRememberMe() | Checks whether the token is remember me. | -+-----------------------------------+--------------------------------------------+ -| isFullyAuthenticated() | Checks whether the token is fully | -| | authenticated. | -+-----------------------------------+--------------------------------------------+ -| isAuthenticated() | Checks whether the token is not anonymous. | -+-----------------------------------+--------------------------------------------+ -| hasPermission(*var*, 'PERMISSION')| Checks whether the token has the given | -| | permission for the given object (requires | -| | the ACL system). | -+-----------------------------------+--------------------------------------------+ -| token | Variable that refers to the token | -| | which is currently in the security context.| -+-----------------------------------+--------------------------------------------+ -| user | Variable that refers to the user | -| | which is currently in the security context.| -+-----------------------------------+--------------------------------------------+ -| object | Variable that refers to the object for | -| | which access is being requested. | -+-----------------------------------+--------------------------------------------+ -| #*paramName* | Any identifier prefixed with # refers to | -| | a parameter of the same name that is passed| -| | to the method where the expression is used.| -+-----------------------------------+--------------------------------------------+ -| and / && | Binary "and" operator | -+-----------------------------------+--------------------------------------------+ -| or / || | Binary "or" operator | -+-----------------------------------+--------------------------------------------+ -| == | Binary "is equal" operator | -+-----------------------------------+--------------------------------------------+ -| not / ! | Negation operator | -+-----------------------------------+--------------------------------------------+ - -Method Security Authorization ------------------------------ -Generally, you can secure all public, or protected methods which are non-static, -and non-final. Private methods cannot be secured. You can also add metadata for -abstract methods, or interfaces which will then be applied to their concrete -implementations automatically. - -Access Control via DI configuration -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -You can specify access control **expressions** in the DI configuration:: - - # config.yml - jms_security_extra: - method_access_control: - ':loginAction$': 'isAnonymous()' - 'AcmeFooBundle:.*:deleteAction': 'hasRole("ROLE_ADMIN")' - '^MyNamespace\MyService::foo$': 'hasPermission(#user, "VIEW")' - -The pattern is a case-sensitive regular expression which is matched against two notations. -The first match is being used. - -First, your pattern is matched against the notation for non-service controllers. -This obviously is only done if your class is actually a controller, e.g. -``AcmeFooBundle:Add:new`` for a controller named ``AddController`` and a method -named ``newAction`` in a sub-namespace ``Controller`` in a bundle named ``AcmeFooBundle``. - -Last, your pattern is matched against the concatenation of the class name, and -the method name that is being called, e.g. ``My\Fully\Qualified\ClassName::myMethodName``. - -**Note:** If you would like to secure non-service controllers, the -``JMSDiExtraBundle`` must be installed. - -Access Control via Annotations -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -If you like to secure a service with annotations, you need to enable annotation -configuration for this service:: - - - - - -In case, you like to configure all services via annotations, you can also set -``secure_all_services`` to true. Then, you do not need to add a tag for each -service. - - -Annotations ------------ -@PreAuthorize -~~~~~~~~~~~~~ -This annotation lets you define an expression (see the expression language -paragraph) which is executed prior to invoking a method:: - - myPrivateService->aMethodOnlyToBeInvokedThroughASpecificChannel(); - } - } - -@SatisfiesParentSecurityPolicy -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -This must be defined on a method that overrides a method which has security metadata. -It is there to ensure that you are aware the security of the overridden method cannot -be enforced anymore, and that you must copy over all annotations if you want to keep -them. diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Resources/meta/LICENSE b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Resources/meta/LICENSE deleted file mode 100644 index 753842b..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Resources/meta/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Acl/Expression/HasPermissionFunctionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Acl/Expression/HasPermissionFunctionCompiler.php deleted file mode 100644 index 340617b..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Acl/Expression/HasPermissionFunctionCompiler.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Acl\Expression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ConstantExpression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\Func\FunctionCompilerInterface; - -class HasPermissionFunctionCompiler implements FunctionCompilerInterface -{ - public function getName() - { - return 'hasPermission'; - } - - public function compilePreconditions(ExpressionCompiler $compiler, FunctionExpression $function) - { - $compiler->verifyItem('token', 'Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - } - - public function compile(ExpressionCompiler $compiler, FunctionExpression $function) - { - $compiler - ->compileInternal(new VariableExpression('permission_evaluator')) - ->write('->hasPermission(') - ->compileInternal(new VariableExpression('token')) - ->write(', ') - ->compileInternal($function->args[0]) - ->write(', ') - ; - - if ($function->args[1] instanceof ConstantExpression) { - $compiler->write(var_export(strtoupper($function->args[1]->value), true).')'); - - return; - } - - $compiler - ->write('strtoupper(') - ->compileInternal($function->args[1]) - ->write('))') - ; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Acl/Expression/PermissionEvaluator.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Acl/Expression/PermissionEvaluator.php deleted file mode 100644 index 96111fc..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Acl/Expression/PermissionEvaluator.php +++ /dev/null @@ -1,122 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Acl\Expression; - -use Symfony\Component\Security\Acl\Exception\NoAceFoundException; -use Symfony\Component\Security\Acl\Exception\AclNotFoundException; -use Symfony\Component\Security\Acl\Model\ObjectIdentityInterface; -use Symfony\Component\Security\Acl\Permission\PermissionMapInterface; -use Symfony\Component\Security\Acl\Model\AclProviderInterface; -use Symfony\Component\Security\Acl\Model\SecurityIdentityRetrievalStrategyInterface; -use Symfony\Component\Security\Acl\Model\ObjectIdentityRetrievalStrategyInterface; -use Symfony\Component\HttpKernel\Log\LoggerInterface; -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; - -class PermissionEvaluator -{ - private $aclProvider; - private $oidRetrievalStrategy; - private $sidRetrievalStrategy; - private $permissionMap; - private $allowIfObjectIdentityUnavailable; - private $logger; - - public function __construct(AclProviderInterface $aclProvider, - ObjectIdentityRetrievalStrategyInterface $oidRetrievalStrategy, - SecurityIdentityRetrievalStrategyInterface $sidRetrievalStrategy, - PermissionMapInterface $permissionMap, - $allowIfObjectIdentityUnavailable = true, - LoggerInterface $logger = null) - { - $this->aclProvider = $aclProvider; - $this->oidRetrievalStrategy = $oidRetrievalStrategy; - $this->sidRetrievalStrategy = $sidRetrievalStrategy; - $this->permissionMap = $permissionMap; - $this->allowIfObjectIdentityUnavailable = $allowIfObjectIdentityUnavailable; - $this->logger = $logger; - } - - public function hasPermission(TokenInterface $token, $object, $permission) - { - if (null === $masks = $this->permissionMap->getMasks($permission, $object)) { - return false; - } - - if (null === $object) { - if (null !== $this->logger) { - $this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable? 'grant access' : 'abstain')); - } - - return $this->allowIfObjectIdentityUnavailable ? true : false; - } else if ($object instanceof FieldVote) { - $field = $object->getField(); - $object = $object->getDomainObject(); - } else { - $field = null; - } - - if ($object instanceof ObjectIdentityInterface) { - $oid = $object; - } else if (null === $oid = $this->oidRetrievalStrategy->getObjectIdentity($object)) { - if (null !== $this->logger) { - $this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable? 'grant access' : 'abstain')); - } - - return $this->allowIfObjectIdentityUnavailable ? true : false; - } - - $sids = $this->sidRetrievalStrategy->getSecurityIdentities($token); - - try { - $acl = $this->aclProvider->findAcl($oid, $sids); - - if (null === $field && $acl->isGranted($masks, $sids, false)) { - if (null !== $this->logger) { - $this->logger->debug('ACL found, permission granted. Voting to grant access'); - } - - return true; - } else if (null !== $field && $acl->isFieldGranted($field, $masks, $sids, false)) { - if (null !== $this->logger) { - $this->logger->debug('ACL found, permission granted. Voting to grant access'); - } - - return true; - } - - if (null !== $this->logger) { - $this->logger->debug('ACL found, insufficient permissions. Voting to deny access.'); - } - - return false; - } catch (AclNotFoundException $noAcl) { - if (null !== $this->logger) { - $this->logger->debug('No ACL found for the object identity. Voting to deny access.'); - } - - return false; - } catch (NoAceFoundException $noAce) { - if (null !== $this->logger) { - $this->logger->debug('ACL found, no ACE applicable. Voting to deny access.'); - } - - return false; - } - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Acl/Voter/AclVoter.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Acl/Voter/AclVoter.php deleted file mode 100644 index bad27d8..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Acl/Voter/AclVoter.php +++ /dev/null @@ -1,136 +0,0 @@ - - */ -class AclVoter implements VoterInterface -{ - private $aclProvider; - private $permissionMap; - private $objectIdentityRetrievalStrategy; - private $securityIdentityRetrievalStrategy; - private $allowIfObjectIdentityUnavailable; - private $logger; - - public function __construct(AclProviderInterface $aclProvider, ObjectIdentityRetrievalStrategyInterface $oidRetrievalStrategy, SecurityIdentityRetrievalStrategyInterface $sidRetrievalStrategy, PermissionMapInterface $permissionMap, LoggerInterface $logger = null, $allowIfObjectIdentityUnavailable = true) - { - $this->aclProvider = $aclProvider; - $this->permissionMap = $permissionMap; - $this->objectIdentityRetrievalStrategy = $oidRetrievalStrategy; - $this->securityIdentityRetrievalStrategy = $sidRetrievalStrategy; - $this->logger = $logger; - $this->allowIfObjectIdentityUnavailable = $allowIfObjectIdentityUnavailable; - } - - public function supportsAttribute($attribute) - { - return $this->permissionMap->contains($attribute); - } - - public function vote(TokenInterface $token, $object, array $attributes) - { - foreach ($attributes as $attribute) { - if (null === $masks = $this->permissionMap->getMasks((string) $attribute, $object)) { - continue; - } - - if (null === $object) { - if (null !== $this->logger) { - $this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable? 'grant access' : 'abstain')); - } - - return $this->allowIfObjectIdentityUnavailable ? self::ACCESS_GRANTED : self::ACCESS_ABSTAIN; - } else if ($object instanceof FieldVote) { - $field = $object->getField(); - $object = $object->getDomainObject(); - } else { - $field = null; - } - - if ($object instanceof ObjectIdentityInterface) { - $oid = $object; - } else if (null === $oid = $this->objectIdentityRetrievalStrategy->getObjectIdentity($object)) { - if (null !== $this->logger) { - $this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable? 'grant access' : 'abstain')); - } - - return $this->allowIfObjectIdentityUnavailable ? self::ACCESS_GRANTED : self::ACCESS_ABSTAIN; - } - - if (!$this->supportsClass($oid->getType())) { - return self::ACCESS_ABSTAIN; - } - - $sids = $this->securityIdentityRetrievalStrategy->getSecurityIdentities($token); - - try { - $acl = $this->aclProvider->findAcl($oid, $sids); - - if (null === $field && $acl->isGranted($masks, $sids, false)) { - if (null !== $this->logger) { - $this->logger->debug('ACL found, permission granted. Voting to grant access'); - } - - return self::ACCESS_GRANTED; - } else if (null !== $field && $acl->isFieldGranted($field, $masks, $sids, false)) { - if (null !== $this->logger) { - $this->logger->debug('ACL found, permission granted. Voting to grant access'); - } - - return self::ACCESS_GRANTED; - } - - if (null !== $this->logger) { - $this->logger->debug('ACL found, insufficient permissions. Voting to deny access.'); - } - - return self::ACCESS_DENIED; - } catch (AclNotFoundException $noAcl) { - if (null !== $this->logger) { - $this->logger->debug('No ACL found for the object identity. Voting to deny access.'); - } - - return self::ACCESS_DENIED; - } catch (NoAceFoundException $noAce) { - if (null !== $this->logger) { - $this->logger->debug('ACL found, no ACE applicable. Voting to deny access.'); - } - - return self::ACCESS_DENIED; - } - } - - // no attribute was supported - return self::ACCESS_ABSTAIN; - } - - /** - * You can override this method when writing a voter for a specific domain - * class. - * - * @param string $class The class name - * - * @return Boolean - */ - public function supportsClass($class) - { - return true; - } -} diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authentication/Provider/RunAsAuthenticationProvider.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authentication/Provider/RunAsAuthenticationProvider.php deleted file mode 100644 index 6958805..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authentication/Provider/RunAsAuthenticationProvider.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authentication\Provider; - -use Symfony\Component\Security\Core\Exception\BadCredentialsException; -use JMS\SecurityExtraBundle\Security\Authentication\Token\RunAsUserToken; -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; -use Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface; - -/** - * Class which authenticates RunAsTokens. - * - * @author Johannes M. Schmitt - */ -class RunAsAuthenticationProvider implements AuthenticationProviderInterface -{ - private $key; - - public function __construct($key) - { - $this->key = $key; - } - - public function authenticate(TokenInterface $token) - { - if (!$this->supports($token)) { - return null; - } - - if ($token->getKey() === $this->key) { - return $token; - } else { - throw new BadCredentialsException('The keys do not match.'); - } - } - - public function supports(TokenInterface $token) - { - return $token instanceof RunAsUserToken; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authentication/Token/RunAsUserToken.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authentication/Token/RunAsUserToken.php deleted file mode 100644 index 0672f2a..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authentication/Token/RunAsUserToken.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authentication\Token; - -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; -use Symfony\Component\Security\Core\Authentication\Token\AbstractToken; - -/** - * This token is automatically generated by the RunAsManager when an invocation - * is supposed to be run with a different Token. - * - * @author Johannes M. Schmitt - */ -class RunAsUserToken extends AbstractToken -{ - private $originalToken; - private $key; - private $credentials; - - public function __construct($key, $user, $credentials, array $roles, TokenInterface $originalToken) - { - parent::__construct($roles); - - $this->originalToken = $originalToken; - $this->credentials = $credentials; - $this->key = $key; - - $this->setUser($user); - $this->setAuthenticated(true); - } - - public function getKey() - { - return $this->key; - } - - public function getOriginalToken() - { - return $this->originalToken; - } - - public function getCredentials() - { - return $this->credentials; - } - - public function eraseCredentials() - { - parent::eraseCredentials(); - - $this->credentials = null; - } - - public function serialize() - { - return serialize(array( - $this->originalToken, - $this->key, - $this->credentials, - parent::serialize(), - )); - } - - public function unserialize($str) - { - list($this->originalToken, $this->key, $this->credentials, $parentStr) = unserialize($str); - parent::unserialize($parentStr); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/AfterInvocation/AclAfterInvocationProvider.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/AfterInvocation/AclAfterInvocationProvider.php deleted file mode 100644 index a004e92..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/AfterInvocation/AclAfterInvocationProvider.php +++ /dev/null @@ -1,111 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation; - -use Symfony\Component\HttpKernel\Log\LoggerInterface; -use Symfony\Component\Security\Acl\Exception\AclNotFoundException; -use Symfony\Component\Security\Acl\Exception\NoAceFoundException; -use Symfony\Component\Security\Acl\Model\SecurityIdentityRetrievalStrategyInterface; -use Symfony\Component\Security\Acl\Model\ObjectIdentityRetrievalStrategyInterface; -use Symfony\Component\Security\Acl\Model\AclProviderInterface; -use Symfony\Component\Security\Acl\Permission\PermissionMapInterface; -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; -use Symfony\Component\Security\Core\Exception\AccessDeniedException; - -/** - * This after invocation provider filters returned objects based on ACLs. - * - * @author Johannes M. Schmitt - */ -class AclAfterInvocationProvider implements AfterInvocationProviderInterface -{ - private $aclProvider; - private $oidRetrievalStrategy; - private $sidRetrievalStrategy; - private $permissionMap; - private $logger; - - public function __construct(AclProviderInterface $aclProvider, ObjectIdentityRetrievalStrategyInterface $oidRetrievalStrategy, SecurityIdentityRetrievalStrategyInterface $sidRetrievalStrategy, PermissionMapInterface $permissionMap, LoggerInterface $logger = null) - { - $this->aclProvider = $aclProvider; - $this->oidRetrievalStrategy = $oidRetrievalStrategy; - $this->sidRetrievalStrategy = $sidRetrievalStrategy; - $this->permissionMap = $permissionMap; - $this->logger = $logger; - } - - public function decide(TokenInterface $token, $secureObject, array $attributes, $returnedObject) - { - if (null === $returnedObject) { - if (null !== $this->logger) { - $this->logger->debug('Returned object was null, skipping security check.'); - } - - return null; - } - - foreach ($attributes as $attribute) { - if (!$this->supportsAttribute($attribute)) { - continue; - } - - if (null === $oid = $this->oidRetrievalStrategy->getObjectIdentity($returnedObject)) { - if (null !== $this->logger) { - $this->logger->debug('Returned object was no domain object, skipping security check.'); - } - - return $returnedObject; - } - - $sids = $this->sidRetrievalStrategy->getSecurityIdentities($token); - - try { - $acl = $this->aclProvider->findAcl($oid, $sids); - if ($acl->isGranted($this->permissionMap->getMasks($attribute, $returnedObject), $sids, false)) { - return $returnedObject; - } - - if (null !== $this->logger) { - $this->logger->debug('Token has been denied access for returned object.'); - } - } catch (AclNotFoundException $noAcl) { - throw new AccessDeniedException('No applicable ACL found for domain object.'); - } catch (NoAceFoundException $noAce) { - if (null !== $this->logger) { - $this->logger->debug('No applicable ACE found for the given Token, denying access.'); - } - } - - throw new AccessDeniedException('ACL has denied access for attribute: '.$attribute); - } - - // no attribute was supported - return $returnedObject; - } - - public function supportsAttribute($attribute) - { - return $this->permissionMap->contains($attribute); - } - - public function supportsClass($className) - { - return true; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/AfterInvocation/AfterInvocationManager.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/AfterInvocation/AfterInvocationManager.php deleted file mode 100644 index 88beeae..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/AfterInvocation/AfterInvocationManager.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation; - -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; - -/** - * This is the pendant to the AccessDecisionManager which is used to make - * access decisions after a method has been executed. - * - * @author Johannes M. Schmitt - */ -class AfterInvocationManager implements AfterInvocationManagerInterface -{ - private $providers; - - public function __construct(array $providers) - { - $this->providers = $providers; - } - - /** - * {@inheritDoc} - */ - public function decide(TokenInterface $token, $secureInvocation, array $attributes, $returnedObject) - { - foreach ($this->providers as $provider) { - $returnedObject = $provider->decide($token, $secureInvocation, $attributes, $returnedObject); - } - - return $returnedObject; - } - - /** - * {@inheritDoc} - */ - public function supportsAttribute($attribute) - { - foreach ($this->providers as $provider) { - if (true === $provider->supportsAttribute($attribute)) { - return true; - } - } - - return false; - } - - /** - * {@inheritDoc} - */ - public function supportsClass($className) - { - foreach ($this->providers as $provider) { - if (true === $provider->supportsClass($className)) { - return true; - } - } - - return false; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/AfterInvocation/AfterInvocationManagerInterface.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/AfterInvocation/AfterInvocationManagerInterface.php deleted file mode 100644 index c02ec50..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/AfterInvocation/AfterInvocationManagerInterface.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation; - -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; - -/** - * AfterInvocationManagerInterface - * - * @author Johannes M. Schmitt - */ -interface AfterInvocationManagerInterface -{ - /** - * Makes an access decision after the invocation of a method - * - * @param TokenInterface $token - * @param object $secureObject - * @param array $attributes - * @param mixed $returnedValue the value that was returned by the method invocation - * @return mixed the filter return value - */ - function decide(TokenInterface $token, $secureObject, array $attributes, $returnedValue); - - /** - * Determines whether the given attribute is supported - * - * @param string $attribute - * @return Boolean - */ - function supportsAttribute($attribute); - - /** - * Determines whether the given class is supported - * - * @param string $className the class of the secure object - * @return Boolean - */ - function supportsClass($className); -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/AfterInvocation/AfterInvocationProviderInterface.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/AfterInvocation/AfterInvocationProviderInterface.php deleted file mode 100644 index e75466b..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/AfterInvocation/AfterInvocationProviderInterface.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation; - -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; - -/** - * AfterInvocationProviderInterface - * - * @author Johannes M. Schmitt - */ -interface AfterInvocationProviderInterface -{ - function decide(TokenInterface $token, $secureObject, array $attributes, $returnedObject); - function supportsAttribute($attribute); - function supportsClass($className); -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/AndExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/AndExpression.php deleted file mode 100644 index e01d396..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/AndExpression.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class AndExpression implements ExpressionInterface -{ - public $left; - public $right; - - public function __construct(ExpressionInterface $left, ExpressionInterface $right) - { - $this->left = $left; - $this->right = $right; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/ArrayExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/ArrayExpression.php deleted file mode 100644 index cb039bf..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/ArrayExpression.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class ArrayExpression implements ExpressionInterface -{ - public $elements; - - public function __construct(array $elements) - { - $this->elements = $elements; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/ConstantExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/ConstantExpression.php deleted file mode 100644 index 963f1ed..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/ConstantExpression.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class ConstantExpression implements ExpressionInterface -{ - public $value; - - public function __construct($value) - { - $this->value = $value; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/ExpressionInterface.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/ExpressionInterface.php deleted file mode 100644 index 91af129..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/ExpressionInterface.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -interface ExpressionInterface -{ -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/FunctionExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/FunctionExpression.php deleted file mode 100644 index 5e52e98..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/FunctionExpression.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class FunctionExpression implements ExpressionInterface -{ - /** READ-ONLY */ - public $name; - public $args; - - public function __construct($name, array $args) - { - $this->name = $name; - $this->args = $args; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/GetItemExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/GetItemExpression.php deleted file mode 100644 index 2df5eb0..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/GetItemExpression.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class GetItemExpression -{ - public $array; - public $key; - - public function __construct(ExpressionInterface $array, ExpressionInterface $key) - { - $this->array = $array; - $this->key = $key; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/GetPropertyExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/GetPropertyExpression.php deleted file mode 100644 index fe070ab..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/GetPropertyExpression.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class GetPropertyExpression implements ExpressionInterface -{ - public $object; - public $name; - - public function __construct(ExpressionInterface $obj, $name) - { - $this->object = $obj; - $this->name = $name; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/IsEqualExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/IsEqualExpression.php deleted file mode 100644 index 89f83f7..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/IsEqualExpression.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class IsEqualExpression implements ExpressionInterface -{ - public $left; - public $right; - - public function __construct(ExpressionInterface $left, ExpressionInterface $right) - { - $this->left = $left; - $this->right = $right; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/MethodCallExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/MethodCallExpression.php deleted file mode 100644 index 22f3274..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/MethodCallExpression.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class MethodCallExpression implements ExpressionInterface -{ - public $object; - public $method; - public $args; - - public function __construct(ExpressionInterface $obj, $method, array $args) - { - $this->object = $obj; - $this->method = $method; - $this->args = $args; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/NotExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/NotExpression.php deleted file mode 100644 index aa730c0..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/NotExpression.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class NotExpression implements ExpressionInterface -{ - public $expr; - - public function __construct(ExpressionInterface $expr) - { - $this->expr = $expr; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/OrExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/OrExpression.php deleted file mode 100644 index a3d1f03..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/OrExpression.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class OrExpression implements ExpressionInterface -{ - public $left; - public $right; - - public function __construct(ExpressionInterface $left, ExpressionInterface $right) - { - $this->left = $left; - $this->right = $right; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/ParameterExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/ParameterExpression.php deleted file mode 100644 index f382e5c..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/ParameterExpression.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class ParameterExpression implements ExpressionInterface -{ - public $name; - - public function __construct($name) - { - $this->name = $name; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/VariableExpression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/VariableExpression.php deleted file mode 100644 index c48c02e..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Ast/VariableExpression.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast; - -class VariableExpression implements ExpressionInterface -{ - public $name; - public $allowNull; - - public function __construct($name, $allowNull = false) - { - $this->name = $name; - $this->allowNull = $allowNull; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/AndExpressionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/AndExpressionCompiler.php deleted file mode 100644 index e488a32..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/AndExpressionCompiler.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler; - -class AndExpressionCompiler extends BinaryExprCompiler -{ - public function getType() - { - return 'JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\AndExpression'; - } - - protected function getOperator() - { - return '&&'; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/BinaryExprCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/BinaryExprCompiler.php deleted file mode 100644 index 0dcd154..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/BinaryExprCompiler.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ExpressionInterface; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -/** - * Base Compiler for Binary Operators. - * - * @author Johannes M. Schmitt - */ -abstract class BinaryExprCompiler implements TypeCompilerInterface -{ - public function compilePreconditions(ExpressionCompiler $compiler, ExpressionInterface $expr) - { - $compiler - ->compilePreconditions($expr->left) - ->compilePreconditions($expr->right) - ; - } - - public function compile(ExpressionCompiler $compiler, ExpressionInterface $expr) - { - $compiler - ->write("(") - ->compileInternal($expr->left) - ->write(") ".$this->getOperator()." (") - ->compileInternal($expr->right) - ->write(")") - ; - } - - abstract protected function getOperator(); -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/ContainerAwareVariableCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/ContainerAwareVariableCompiler.php deleted file mode 100644 index 809ffc2..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/ContainerAwareVariableCompiler.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler; - -use Symfony\Component\DependencyInjection\ContainerInterface; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ExpressionInterface; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\VariableExpressionCompiler; - -class ContainerAwareVariableCompiler extends VariableExpressionCompiler -{ - private $serviceMap = array(); - private $parameterMap = array(); - - public function setMaps(array $serviceMap, array $parameterMap) - { - $this->serviceMap = $serviceMap; - $this->parameterMap = $parameterMap; - } - - public function compile(ExpressionCompiler $compiler, ExpressionInterface $expr) - { - if (isset($this->serviceMap[$expr->name])) { - $compiler->write("\$context['container']->get('{$this->serviceMap[$expr->name]}'"); - - if ($expr->allowNull) { - $compiler->write(", ".ContainerInterface::NULL_ON_INVALID_REFERENCE); - } - - $compiler->write(")"); - - return; - } - - if (isset($this->parameterMap[$expr->name])) { - $compiler->write("\$context['container']->getParameter('{$this->parameterMap[$expr->name]}')"); - - return; - } - - parent::compile($compiler, $expr); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/AuthenticationTrustFunctionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/AuthenticationTrustFunctionCompiler.php deleted file mode 100644 index aa98f6c..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/AuthenticationTrustFunctionCompiler.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\Func; - -use JMS\SecurityExtraBundle\Exception\InvalidArgumentException; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -abstract class AuthenticationTrustFunctionCompiler implements FunctionCompilerInterface -{ - public function compilePreconditions(ExpressionCompiler $compiler, FunctionExpression $function) - { - if (!empty($function->args)) { - throw new InvalidArgumentException(sprintf('The '.$this->getName().'() function does not accept any arguments, but got "%s".', var_export($function->args, true))); - } - - $compiler->verifyItem('token', 'Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/FunctionCompilerInterface.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/FunctionCompilerInterface.php deleted file mode 100644 index b364f0b..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/FunctionCompilerInterface.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\Func; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -interface FunctionCompilerInterface -{ - function getName(); - function compilePreconditions(ExpressionCompiler $compiler, FunctionExpression $function); - function compile(ExpressionCompiler $compiler, FunctionExpression $function); -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/HasAnyRoleFunctionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/HasAnyRoleFunctionCompiler.php deleted file mode 100644 index 02e71fa..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/HasAnyRoleFunctionCompiler.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\Func; - -use JMS\SecurityExtraBundle\Exception\RuntimeException; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -class HasAnyRoleFunctionCompiler implements FunctionCompilerInterface -{ - private $rolesExpr; - - public function getName() - { - return 'hasAnyRole'; - } - - public function compilePreconditions(ExpressionCompiler $compiler, FunctionExpression $function) - { - if (0 === count($function->args)) { - throw new RuntimeException('The function hasAnyRole() expects at least one argument, but got none.'); - } - - $this->rolesExpr = $compiler->getRolesExpr(); - } - - public function compile(ExpressionCompiler $compiler, FunctionExpression $function) - { - $compiler->write("("); - - $first = true; - foreach ($function->args as $arg) { - if (!$first) { - $compiler->write(" || "); - } - $first = false; - - $compiler - ->write("isset({$this->rolesExpr}[") - ->compileInternal($arg) - ->write("])") - ; - } - - $compiler->write(")"); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/HasRoleFunctionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/HasRoleFunctionCompiler.php deleted file mode 100644 index 77a9834..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/HasRoleFunctionCompiler.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\Func; - -use JMS\SecurityExtraBundle\Exception\RuntimeException; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -class HasRoleFunctionCompiler implements FunctionCompilerInterface -{ - private $rolesExpr; - - public function getName() - { - return 'hasRole'; - } - - public function compilePreconditions(ExpressionCompiler $compiler, FunctionExpression $function) - { - if (1 !== count($function->args)) { - throw new RuntimeException(sprintf('The hasRole() function expects exactly one argument, but got "%s".', var_export($function->args, true))); - } - - $this->rolesExpr = $compiler->getRolesExpr(); - } - - public function compile(ExpressionCompiler $compiler, FunctionExpression $function) - { - $compiler - ->write("isset({$this->rolesExpr}[") - ->compileInternal($function->args[0]) - ->write("])") - ; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/IsAnonymousFunctionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/IsAnonymousFunctionCompiler.php deleted file mode 100644 index 412825d..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/IsAnonymousFunctionCompiler.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\Func; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -class IsAnonymousFunctionCompiler extends AuthenticationTrustFunctionCompiler -{ - public function getName() - { - return 'isAnonymous'; - } - - public function compile(ExpressionCompiler $compiler, FunctionExpression $function) - { - $compiler - ->compileInternal(new VariableExpression('trust_resolver')) - ->write("->isAnonymous(\$context['token'])"); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/IsAuthenticatedFunctionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/IsAuthenticatedFunctionCompiler.php deleted file mode 100644 index ead97d8..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/IsAuthenticatedFunctionCompiler.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\Func; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -class IsAuthenticatedFunctionCompiler extends AuthenticationTrustFunctionCompiler -{ - public function getName() - { - return 'isAuthenticated'; - } - - public function compile(ExpressionCompiler $compiler, FunctionExpression $function) - { - $compiler - ->write("!") - ->compileInternal(new VariableExpression('trust_resolver')) - ->write("->isAnonymous(\$context['token'])") - ; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/IsFullyAuthenticatedFunctionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/IsFullyAuthenticatedFunctionCompiler.php deleted file mode 100644 index 366ef07..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/IsFullyAuthenticatedFunctionCompiler.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\Func; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -class IsFullyAuthenticatedFunctionCompiler extends AuthenticationTrustFunctionCompiler -{ - public function getName() - { - return 'isFullyAuthenticated'; - } - - public function compile(ExpressionCompiler $compiler, FunctionExpression $function) - { - $compiler - ->compileInternal(new VariableExpression('trust_resolver')) - ->write("->isFullFledged(\$context['token'])"); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/IsRememberMeFunctionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/IsRememberMeFunctionCompiler.php deleted file mode 100644 index cbba7c8..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/Func/IsRememberMeFunctionCompiler.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\Func; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -class IsRememberMeFunctionCompiler extends AuthenticationTrustFunctionCompiler -{ - public function getName() - { - return 'isRememberMe'; - } - - public function compile(ExpressionCompiler $compiler, FunctionExpression $function) - { - $compiler - ->compileInternal(new VariableExpression('trust_resolver')) - ->write("->isRememberMe(\$context['token'])"); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/IsEqualExpressionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/IsEqualExpressionCompiler.php deleted file mode 100644 index 93a8b23..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/IsEqualExpressionCompiler.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler; - -class IsEqualExpressionCompiler extends BinaryExprCompiler -{ - public function getType() - { - return 'JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\IsEqualExpression'; - } - - protected function getOperator() - { - return '==='; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/NotExpressionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/NotExpressionCompiler.php deleted file mode 100644 index 1fccae8..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/NotExpressionCompiler.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ExpressionInterface; - -class NotExpressionCompiler implements TypeCompilerInterface -{ - public function getType() - { - return 'JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\NotExpression'; - } - - public function compilePreconditions(ExpressionCompiler $compiler, ExpressionInterface $expr) - { - $compiler->compilePreconditions($expr->expr); - } - - public function compile(ExpressionCompiler $compiler, ExpressionInterface $expr) - { - $compiler - ->write('!(') - ->compileInternal($expr->expr) - ->write(')') - ; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/OrExpressionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/OrExpressionCompiler.php deleted file mode 100644 index 4a4554e..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/OrExpressionCompiler.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler; - -class OrExpressionCompiler extends BinaryExprCompiler -{ - public function getType() - { - return 'JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\OrExpression'; - } - - protected function getOperator() - { - return '||'; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/ParameterExpressionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/ParameterExpressionCompiler.php deleted file mode 100644 index 678a119..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/ParameterExpressionCompiler.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ExpressionInterface; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\TypeCompilerInterface; - -class ParameterExpressionCompiler implements TypeCompilerInterface -{ - public function getType() - { - return 'JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ParameterExpression'; - } - - public function compilePreconditions(ExpressionCompiler $compiler, ExpressionInterface $parameter) - { - $compiler->verifyItem('object', 'CG\Proxy\MethodInvocation'); - - if (!isset($compiler->attributes['parameter_mapping_name'])) { - $this->addParameterMapping($compiler); - } - - $compiler - ->writeln("if (!isset(\${$compiler->attributes['parameter_mapping_name']}['{$parameter->name}'])) {") - ->indent() - ->write("throw new RuntimeException(sprintf('There is no parameter with name \"{$parameter->name}\" for method \"%s\".', ") - ->compileInternal(new VariableExpression('object')) - ->writeln("));") - ->outdent() - ->write("}\n\n") - ; - } - - public function compile(ExpressionCompiler $compiler, ExpressionInterface $parameter) - { - $compiler - ->compileInternal(new VariableExpression('object')) - ->write("->arguments[") - ->write("\${$compiler->attributes['parameter_mapping_name']}") - ->write("['{$parameter->name}']]") - ; - } - - private function addParameterMapping(ExpressionCompiler $compiler) - { - $name = $compiler->nextName(); - $indexName = $compiler->nextName(); - $paramName = $compiler->nextName(); - - $compiler - ->setAttribute('parameter_mapping_name', $name) - ->writeln("\$$name = array();") - ->write("foreach (") - ->compileInternal(new VariableExpression('object')) - ->writeln("->reflection->getParameters() as \$$indexName => \$$paramName) {") - ->indent() - ->writeln("\${$name}[\${$paramName}->name] = \$$indexName;") - ->outdent() - ->writeln("}\n") - ; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/TypeCompilerInterface.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/TypeCompilerInterface.php deleted file mode 100644 index 949a631..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/TypeCompilerInterface.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ExpressionInterface; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -interface TypeCompilerInterface -{ - function getType(); - function compilePreconditions(ExpressionCompiler $compiler, ExpressionInterface $expr); - function compile(ExpressionCompiler $compiler, ExpressionInterface $expr); -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/VariableExpressionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/VariableExpressionCompiler.php deleted file mode 100644 index ad1841c..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Compiler/VariableExpressionCompiler.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ExpressionInterface; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -class VariableExpressionCompiler implements TypeCompilerInterface -{ - public function getType() - { - return 'JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression'; - } - - public function compilePreconditions(ExpressionCompiler $compiler, ExpressionInterface $expr) - { - if ('user' === $expr->name) { - $compiler - ->setAttribute('user_var_name', $name = $compiler->nextName()) - ->write("\$$name = ") - ->compileInternal(new VariableExpression('token')) - ->write("->getUser();\n\n") - ; - } - } - - public function compile(ExpressionCompiler $compiler, ExpressionInterface $expr) - { - if ('permitAll' === $expr->name) { - $compiler->write('true'); - - return; - } - - if ('denyAll' === $expr->name) { - $compiler->write('false'); - - return; - } - - if ('user' === $expr->name) { - $compiler->write("\${$compiler->attributes['user_var_name']}"); - - return; - } - - if ($expr->allowNull) { - $compiler->write("(isset(\$context['{$expr->name}']) ? "); - } - - $compiler->write("\$context['{$expr->name}']"); - - if ($expr->allowNull) { - $compiler->write(" : null)"); - } - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ContainerAwareExpressionHandler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ContainerAwareExpressionHandler.php deleted file mode 100644 index f2d29af..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ContainerAwareExpressionHandler.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionHandlerInterface; -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Lazy-loading container aware expression handler. - * - * @author Johannes M. Schmitt - */ -class ContainerAwareExpressionHandler implements ExpressionHandlerInterface -{ - private $container; - - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - public function createContext(TokenInterface $token, $object) - { - return array( - 'container' => $this->container, - 'token' => $token, - 'object' => $object, - ); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/DefaultExpressionHandler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/DefaultExpressionHandler.php deleted file mode 100644 index 70e4e13..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/DefaultExpressionHandler.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression; - -use Symfony\Component\Security\Core\Role\RoleHierarchyInterface; -use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface; -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; - -class DefaultExpressionHandler implements ExpressionHandlerInterface -{ - private $trustResolver; - private $roleHierarchy; - - public function __construct(AuthenticationTrustResolverInterface $trustResolver, - RoleHierarchyInterface $roleHierarchy = null) - { - $this->trustResolver = $trustResolver; - $this->roleHierarchy = $roleHierarchy; - } - - public function createContext(TokenInterface $token, $object) - { - $context = array( - 'token' => $token, - 'object' => $object, - 'trust_resolver' => $this->trustResolver, - ); - - if (null !== $this->roleHierarchy) { - $context['role_hierarchy'] = $this->roleHierarchy; - } - - return $context; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Expression.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Expression.php deleted file mode 100644 index 219218d..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/Expression.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression; - -final class Expression -{ - /** READ-ONLY */ - public $expression; - - public function __construct($expression) - { - $this->expression = $expression; - } - - public function getHashCode() - { - return sha1($this->expression); - } - - public function __toString() - { - return 'EXPRESSION('.$this->expression.')'; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ExpressionCompiler.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ExpressionCompiler.php deleted file mode 100644 index fbfc69a..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ExpressionCompiler.php +++ /dev/null @@ -1,395 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression; - -use JMS\SecurityExtraBundle\Exception\RuntimeException; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\TypeCompilerInterface; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\IsEqualExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\Func\FunctionCompilerInterface; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ExpressionInterface; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\OrExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\MethodCallExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\GetPropertyExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\GetItemExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ConstantExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ArrayExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\AndExpression; - -class ExpressionCompiler -{ - public $attributes = array(); - - private $indentationLevel = 0; - private $indentationSpaces = 4; - - private $nameCount = 0; - private $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; - private $charCount = 52; - private $reservedNames = array('context' => true); - - private $itemExists = array(); - private $itemType = array(); - private $rolesName; - - private $code; - private $parser; - private $typeCompilers; - private $functionCompilers; - - public function __construct() - { - $this->addTypeCompiler(new Compiler\AndExpressionCompiler()); - $this->addTypeCompiler(new Compiler\IsEqualExpressionCompiler()); - $this->addTypeCompiler(new Compiler\OrExpressionCompiler()); - $this->addTypeCompiler(new Compiler\VariableExpressionCompiler()); - $this->addTypeCompiler(new Compiler\NotExpressionCompiler()); - - $this->functionCompilers = array( - 'isAnonymous' => new Compiler\Func\IsAnonymousFunctionCompiler(), - 'isAuthenticated' => new Compiler\Func\IsAuthenticatedFunctionCompiler(), - 'isRememberMe' => new Compiler\Func\IsRememberMeFunctionCompiler(), - 'isFullyAuthenticated' => new Compiler\Func\IsFullyAuthenticatedFunctionCompiler(), - 'hasRole' => new Compiler\Func\HasRoleFunctionCompiler(), - 'hasAnyRole' => new Compiler\Func\HasAnyRoleFunctionCompiler(), - ); - } - - public function setAttribute($name, $value) - { - $this->attributes[$name] = $value; - - return $this; - } - - public function addTypeCompiler(TypeCompilerInterface $compiler) - { - $this->typeCompilers[$compiler->getType()] = $compiler; - } - - public function addFunctionCompiler(FunctionCompilerInterface $compiler) - { - $this->functionCompilers[$compiler->getName()] = $compiler; - } - - public function compileExpression(Expression $expr) - { - return $this->compile($this->getParser()->parse($expr->expression), - $expr->expression); - } - - public function compile(ExpressionInterface $expr, $raw = null) - { - $this->nameCount = 0; - $this->code = ''; - $this->itemExists = $this->itemType = $this->attributes = array(); - $this->rolesName = null; - - if ($raw) { - $this->writeln('// Expression: '.$raw); - } - - $this - ->writeln('return function(array $context) {') - ->indent() - ->compilePreconditions($expr) - ->write('return ') - ->compileInternal($expr) - ->writeln(';') - ->outdent() - ->writeln('};') - ; - - return $this->code; - } - - public function indent() - { - $this->indentationLevel += 1; - - return $this; - } - - public function outdent() - { - $this->indentationLevel -= 1; - - if ($this->indentationLevel < 0) { - throw new RuntimeException('The identation level cannot be less than zero.'); - } - - return $this; - } - - public function writeln($content) - { - $this->write($content."\n"); - - return $this; - } - - public function getRolesExpr() - { - if (null !== $this->rolesName) { - return '$'.$this->rolesName; - } - - $this->verifyItem('token', 'Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - - $this->rolesName = $rolesName = $this->nextName(); - $hierarchyName = $this->nextName(); - $tmpName = $this->nextName(); - $this - ->writeln("\$$rolesName = \$context['token']->getRoles();") - ->write("if (null !== \$$hierarchyName = ") - ->compileInternal(new VariableExpression('role_hierarchy', true)) - ->writeln(") {") - ->indent() - ->writeln("\$$rolesName = \${$hierarchyName}->getReachableRoles(\$$rolesName);") - ->outdent() - ->write("}\n\n") - ->writeln("\$$tmpName = array();") - ->writeln("foreach (\$$rolesName as \$role) {") - ->indent() - ->writeln("\${$tmpName}[\$role->getRole()] = true;") - ->outdent() - ->writeln("}") - ->write("\$$rolesName = \$$tmpName;\n\n") - ; - - return '$'.$rolesName; - } - - public function verifyItem($key, $expectedType = null) - { - if (!isset($this->itemExists[$key])) { - $this->itemExists[$key] = true; - - $this - ->writeln("if (!isset(\$context['$key'])) {") - ->indent() - ->writeln("throw new RuntimeException('The context contains no item with key \"$key\".');") - ->outdent() - ->write("}\n\n") - ; - } - - if (null !== $expectedType) { - if (isset($this->itemType[$key])) { - if ($this->itemType[$key] !== $expectedType) { - throw new RuntimeException(sprintf('Cannot verify that item "%s" is of type "%s" because it is already expected to be of type "%s".', - $key, $expectedType, $this->itemType[$key] - )); - } - - return $this; - } - - $this - ->writeln("if (!\$context['$key'] instanceof $expectedType) {") - ->indent() - ->writeln("throw new RuntimeException(sprintf('The item \"$key\" is expected to be of type \"$expectedType\", but got \"%s\".', get_class(\$context['$key'])));") - ->outdent() - ->write("}\n\n") - ; - } - - return $this; - } - - public function write($content) - { - $lines = explode("\n", $content); - for ($i=0,$c=count($lines); $i<$c; $i++) { - if ($this->indentationLevel > 0 - && !empty($lines[$i]) - && (empty($this->code) || "\n" === substr($this->code, -1))) { - $this->code .= str_repeat(' ', $this->indentationLevel * $this->indentationSpaces); - } - - $this->code .= $lines[$i]; - - if ($i+1 < $c) { - $this->code .= "\n"; - } - } - - return $this; - } - - public function nextName() - { - while (true) { - $name = ''; - $i = $this->nameCount; - - $name .= $this->chars[$i % $this->charCount]; - $i = intval($i / $this->charCount); - - while ($i > 0) { - $i -= 1; - $name .= $this->chars[$i % $this->charCount]; - $i = intval($i / $this->charCount); - } - - $this->nameCount += 1; - - // check that the name is not reserved - if (isset($this->reservedNames[$name])) { - continue; - } - - return $name; - } - } - - public function compilePreconditions(ExpressionInterface $expr) - { - if ($typeCompiler = $this->findTypeCompiler(get_class($expr))) { - $typeCompiler->compilePreconditions($this, $expr); - - return $this; - } - - if ($expr instanceof FunctionExpression) { - $this->getFunctionCompiler($expr->name)->compilePreconditions($this, $expr); - - foreach ($expr->args as $arg) { - $this->compilePreconditions($arg); - } - - return $this; - } - - if ($expr instanceof VariableExpression) { - $this->getVariableCompiler($expr->name)->compilePreconditions($this, $expr); - - return $this; - } - - if ($expr instanceof MethodCallExpression) { - $this->compilePreconditions($expr->object); - - foreach ($expr->args as $arg) { - $this->compilePreconditions($arg); - } - - return $this; - } - - if ($expr instanceof GetPropertyExpression) { - $this->compilePreconditions($expr->object); - - return $this; - } - - return $this; - } - - public function compileInternal(ExpressionInterface $expr) - { - if ($typeCompiler = $this->findTypeCompiler(get_class($expr))) { - $typeCompiler->compile($this, $expr); - - return $this; - } - - if ($expr instanceof ArrayExpression) { - $this->code .= 'array('; - foreach ($expr->elements as $key => $value) { - $this->code .= var_export($key, true).' => '; - $this->compileInternal($value); - $this->code .= ','; - } - $this->code .= ')'; - - return $this; - } - - if ($expr instanceof ConstantExpression) { - $this->code .= var_export($expr->value, true); - - return $this; - } - - if ($expr instanceof FunctionExpression) { - $this->getFunctionCompiler($expr->name)->compile($this, $expr); - - return $this; - } - - if ($expr instanceof GetItemExpression) { - $this->compileInternal($expr->array); - $this->code .= '['.$expr->key.']'; - - return $this; - } - - if ($expr instanceof GetPropertyExpression) { - $this->compileInternal($expr->object); - $this->code .= '->'.$expr->name; - - return $this; - } - - if ($expr instanceof MethodCallExpression) { - $this->compileInternal($expr->object); - $this->code .= '->'.$expr->method.'('; - - $first = true; - foreach ($expr->args as $arg) { - if (!$first) { - $this->code .= ', '; - } - $first = false; - - $this->compileInternal($arg); - } - $this->code .= ')'; - - return $this; - } - - throw new RuntimeException(sprintf('Unknown expression "%s".', get_class($expr))); - } - - public function getFunctionCompiler($name) - { - if (!isset($this->functionCompilers[$name])) { - throw new RuntimeException(sprintf('There is no compiler for function "%s".', $name)); - } - - return $this->functionCompilers[$name]; - } - - private function findTypeCompiler($type) - { - return isset($this->typeCompilers[$type]) ? $this->typeCompilers[$type] : null; - } - - private function getParser() - { - if (null !== $this->parser) { - return $this->parser; - } - - return $this->parser = new ExpressionParser(); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ExpressionHandlerInterface.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ExpressionHandlerInterface.php deleted file mode 100644 index 24e6024..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ExpressionHandlerInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression; - -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; - -interface ExpressionHandlerInterface -{ - function createContext(TokenInterface $token, $object); -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ExpressionLexer.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ExpressionLexer.php deleted file mode 100644 index e1f4445..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ExpressionLexer.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression; - -use JMS\SecurityExtraBundle\Exception\InvalidArgumentException; - -final class ExpressionLexer -{ - public $token; - public $lookahead; - - private $tokens; - private $pointer; - - const T_STRING = 1; - const T_IDENTIFIER = 2; - const T_NONE = 3; - const T_COMMA = 4; - const T_OPEN_PARENTHESIS = 5; - const T_CLOSE_PARENTHESIS = 6; - const T_AND = 7; - const T_OR = 8; - const T_PARAMETER = 9; - const T_OBJECT_OPERATOR = 10; - const T_OPEN_BRACKET = 11; - const T_CLOSE_BRACKET = 12; - const T_OPEN_BRACE = 13; - const T_CLOSE_BRACE = 14; - const T_COLON = 15; - const T_IS_EQUAL = 16; - const T_NOT = 17; - - public static function getLiteral($type) - { - static $constants; - - if (null === $constants) { - $ref = new \ReflectionClass(get_called_class()); - $constants = $ref->getConstants(); - } - - if (false === $literal = array_search($type, $constants, true)) { - throw new InvalidArgumentException(sprintf('There is no token of value "%s".', $type)); - } - - return $literal; - } - - public function initialize($input) - { - static $pattern = '/(#?[a-z][a-z0-9]*|\'(?:[^\']|(?<=\\\\)\')*\'|"(?:[^"]|(?<=\\\\)")*"|&&|\|\||==)|\s+|(.)/i'; - - $parts = preg_split($pattern, $input, -1, PREG_SPLIT_OFFSET_CAPTURE - | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); - - $tokens = array(); - foreach ($parts as $part) { - list($value, $position) = $part; - $type = self::T_NONE; - - if ("'" === $value[0] || '"' === $value[0]) { - $type = self::T_STRING; - $value = substr($value, 1, -1); - } else if (',' === $value) { - $type = self::T_COMMA; - } else if ('(' === $value) { - $type = self::T_OPEN_PARENTHESIS; - } else if (')' === $value) { - $type = self::T_CLOSE_PARENTHESIS; - } else if ('[' === $value) { - $type = self::T_OPEN_BRACKET; - } else if (']' === $value) { - $type = self::T_CLOSE_BRACKET; - } else if ('{' === $value) { - $type = self::T_OPEN_BRACE; - } else if ('}' === $value) { - $type = self::T_CLOSE_BRACE; - } else if ('&&' === $value || 'and' === strtolower($value)) { - $type = self::T_AND; - } else if ('||' === $value || 'or' === strtolower($value)) { - $type = self::T_OR; - } else if ('!' === $value || 'not' === strtolower($value)) { - $type = self::T_NOT; - } else if (':' === $value) { - $type = self::T_COLON; - } else if ('.' === $value) { - $type = self::T_OBJECT_OPERATOR; - } else if ('==' === $value) { - $type = self::T_IS_EQUAL; - } else if ('#' === $value[0]) { - $type = self::T_PARAMETER; - $value = substr($value, 1); - } else if (ctype_alpha($value)) { - $type = self::T_IDENTIFIER; - } - - $tokens[] = array( - 'type' => $type, - 'value' => $value, - 'position' => $position, - ); - } - - $this->tokens = $tokens; - $this->pointer = -1; - $this->next(); - } - - public function next() - { - $this->pointer += 1; - $this->token = $this->lookahead; - $this->lookahead = isset($this->tokens[$this->pointer]) ? - $this->tokens[$this->pointer] : null; - - return $this->lookahead !== null; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ExpressionParser.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ExpressionParser.php deleted file mode 100644 index 98fd32e..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ExpressionParser.php +++ /dev/null @@ -1,290 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\NotExpression; - -use JMS\SecurityExtraBundle\Exception\RuntimeException; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\IsEqualExpression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ParameterExpression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression; - -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ConstantExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\OrExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\AndExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ArrayExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\GetItemExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\GetPropertyExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\MethodCallExpression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ExpressionInterface; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression; - -final class ExpressionParser -{ - const PRECEDENCE_OR = 10; - const PRECEDENCE_AND = 15; - const PRECEDENCE_IS_EQUAL = 20; - const PRECEDENCE_NOT = 30; - - private $lexer; - - public function __construct() - { - $this->lexer = new ExpressionLexer(); - } - - public function parse($str) - { - $this->lexer->initialize($str); - - return $this->Expression(); - } - - private function Expression($precedence = 0) - { - $expr = $this->Primary(); - - while (true) { - if (ExpressionLexer::T_AND === $this->lexer->lookahead['type'] - && $precedence <= self::PRECEDENCE_AND) { - $this->lexer->next(); - - $expr = new AndExpression($expr, $this->Expression( - self::PRECEDENCE_AND + 1)); - continue; - } - - if (ExpressionLexer::T_OR === $this->lexer->lookahead['type'] - && $precedence <= self::PRECEDENCE_OR) { - $this->lexer->next(); - - $expr = new OrExpression($expr, $this->Expression( - self::PRECEDENCE_OR + 1)); - continue; - } - - if (ExpressionLexer::T_IS_EQUAL === $this->lexer->lookahead['type'] - && $precedence <= self::PRECEDENCE_IS_EQUAL) { - $this->lexer->next(); - - $expr = new IsEqualExpression($expr, $this->Expression( - self::PRECEDENCE_IS_EQUAL + 1)); - continue; - } - - break; - } - - return $expr; - } - - private function Primary() - { - if (ExpressionLexer::T_NOT === $this->lexer->lookahead['type']) { - $this->lexer->next(); - $expr = new NotExpression($this->Expression(self::PRECEDENCE_NOT)); - - return $this->Suffix($expr); - } - - if (ExpressionLexer::T_OPEN_PARENTHESIS === $this->lexer->lookahead['type']) { - $this->lexer->next(); - $expr = $this->Expression(); - $this->match(ExpressionLexer::T_CLOSE_PARENTHESIS); - - return $this->Suffix($expr); - } - - if (ExpressionLexer::T_STRING === $this->lexer->lookahead['type']) { - return new ConstantExpression($this->match(ExpressionLexer::T_STRING)); - } - - if (ExpressionLexer::T_OPEN_BRACE === $this->lexer->lookahead['type']) { - return $this->Suffix($this->MapExpr()); - } - - if (ExpressionLexer::T_OPEN_BRACKET === $this->lexer->lookahead['type']) { - return $this->Suffix($this->ListExpr()); - } - - if (ExpressionLexer::T_IDENTIFIER === $this->lexer->lookahead['type']) { - $name = $this->match(ExpressionLexer::T_IDENTIFIER); - - if (ExpressionLexer::T_OPEN_PARENTHESIS === $this->lexer->lookahead['type']) { - $args = $this->Arguments(); - - return $this->Suffix(new FunctionExpression($name, $args)); - } - - return $this->Suffix(new VariableExpression($name)); - } - - if (ExpressionLexer::T_PARAMETER === $this->lexer->lookahead['type']) { - return $this->Suffix(new ParameterExpression($this->match(ExpressionLexer::T_PARAMETER))); - } - - $this->error('primary expression'); - } - - private function ListExpr() - { - $this->match(ExpressionLexer::T_OPEN_BRACKET); - - $elements = array(); - while (ExpressionLexer::T_CLOSE_BRACKET !== $this->lexer->lookahead['type']) { - $elements[] = $this->Expression(); - - if (ExpressionLexer::T_COMMA !== $this->lexer->lookahead['type']) { - break; - } - $this->lexer->next(); - } - - $this->match(ExpressionLexer::T_CLOSE_BRACKET); - - return new ArrayExpression($elements); - } - - private function MapExpr() - { - $this->match(ExpressionLexer::T_OPEN_BRACE); - - $entries = array(); - while (ExpressionLexer::T_CLOSE_BRACE !== $this->lexer->lookahead['type']) { - $key = $this->match(ExpressionLexer::T_STRING); - $this->match(ExpressionLexer::T_COLON); - $entries[$key] = $this->Expression(); - - if (ExpressionLexer::T_COMMA !== $this->lexer->lookahead['type']) { - break; - } - - $this->lexer->next(); - } - - $this->match(ExpressionLexer::T_CLOSE_BRACE); - - return new ArrayExpression($entries); - } - - private function Suffix(ExpressionInterface $expr) - { - while (true) { - if (ExpressionLexer::T_OBJECT_OPERATOR === $this->lexer->lookahead['type']) { - $this->lexer->next(); - $name = $this->match(ExpressionLexer::T_IDENTIFIER); - - if (ExpressionLexer::T_OPEN_PARENTHESIS === $this->lexer->lookahead['type']) { - $args = $this->Arguments(); - $expr = new MethodCallExpression($expr, $name, $args); - continue; - } - - $expr = new GetPropertyExpression($expr, $name); - continue; - } - - if (ExpressionLexer::T_OPEN_BRACKET === $this->lexer->lookahead['type']) { - $this->lexer->next(); - $key = $this->Expression(); - $this->match(ExpressionLexer::T_CLOSE_BRACKET); - $expr = new GetItemExpression($expr, $key); - continue; - } - - break; - } - - return $expr; - } - - private function FunctionCall() - { - $name = $this->match(ExpressionLexer::T_IDENTIFIER); - $args = $this->Arguments(); - - return new FunctionExpression($name, $args); - } - - private function Arguments() - { - $this->match(ExpressionLexer::T_OPEN_PARENTHESIS); - $args = array(); - - while (ExpressionLexer::T_CLOSE_PARENTHESIS !== $this->lexer->lookahead['type']) { - $args[] = $this->Expression(); - - if (ExpressionLexer::T_COMMA !== $this->lexer->lookahead['type']) { - break; - } - - $this->match(ExpressionLexer::T_COMMA); - } - $this->match(ExpressionLexer::T_CLOSE_PARENTHESIS); - - return $args; - } - - private function Value() - { - return $this->matchAny(array(ExpressionLexer::T_STRING)); - } - - private function matchAny(array $types) - { - if (null !== $this->lexer->lookahead) { - foreach ($types as $type) { - if ($type === $this->lexer->lookahead['type']) { - $this->lexer->next(); - - return $this->lexer->token['value']; - } - } - } - - $this->error(sprintf('one of these tokens "%s"', - implode('", "', array_map(array('JMS\SecurityExtraBundle\Security\Authorization\Expression\Lexer', 'getLiteral'), $types)) - )); - } - - private function match($type) - { - if (null === $this->lexer->lookahead - || $type !== $this->lexer->lookahead['type']) { - $this->error(sprintf('token "%s"', ExpressionLexer::getLiteral($type))); - } - - $this->lexer->next(); - - return $this->lexer->token['value']; - } - - private function error($expected) - { - $actual = null === $this->lexer->lookahead ? 'end of file' - : sprintf('token "%s" with value "%s" at position %d', - ExpressionLexer::getLiteral($this->lexer->lookahead['type']), - $this->lexer->lookahead['value'], - $this->lexer->lookahead['position']); - - throw new RuntimeException(sprintf('Expected %s, but got %s.', $expected, $actual)); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ExpressionVoter.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ExpressionVoter.php deleted file mode 100644 index cf04742..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/ExpressionVoter.php +++ /dev/null @@ -1,114 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression; - -use JMS\SecurityExtraBundle\Exception\RuntimeException; -use Symfony\Component\Security\Core\Role\RoleHierarchyInterface; -use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface; -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; -use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; - -/** - * Expression-based voter. - * - * This voter allows to use complex access expression in a high-performance - * way. This is the preferred voter for any non-simple access checks. - * - * @author Johannes M. Schmitt - */ -class ExpressionVoter implements VoterInterface -{ - private $evaluators = array(); - private $compiler; - private $cacheDir; - private $expressionHandler; - - public function __construct(ExpressionHandlerInterface $expressionHandler) { - $this->expressionHandler = $expressionHandler; - } - - public function setCacheDir($cacheDir) - { - $this->cacheDir = $cacheDir; - } - - public function setCompiler(ExpressionCompiler $compiler) - { - $this->compiler = $compiler; - } - - public function vote(TokenInterface $token, $object, array $attributes) - { - $result = VoterInterface::ACCESS_ABSTAIN; - - foreach ($attributes as $attribute) { - if (!$attribute instanceof Expression) { - continue; - } - - $result = VoterInterface::ACCESS_DENIED; - if (!isset($this->evaluators[$attribute->expression])) { - $this->evaluators[$attribute->expression] = - $this->createEvaluator($attribute); - } - - if (call_user_func($this->evaluators[$attribute->expression], - $this->expressionHandler->createContext($token, $object))) { - return VoterInterface::ACCESS_GRANTED; - } - } - - return $result; - } - - public function supportsAttribute($attribute) - { - return $attribute instanceof Expression; - } - - public function supportsClass($class) - { - return true; - } - - protected function getCompiler() - { - if (null === $this->compiler) { - throw new RuntimeException('A compiler must be set.'); - } - - return $this->compiler; - } - - private function createEvaluator(Expression $expr) - { - if ($this->cacheDir) { - if (is_file($file = $this->cacheDir.'/'.sha1($expr->expression).'.php')) { - return require $file; - } - - $source = $this->getCompiler()->compileExpression($expr); - file_put_contents($file, "getCompiler()->compileExpression($expr)); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/LazyLoadingExpressionVoter.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/LazyLoadingExpressionVoter.php deleted file mode 100644 index b9d577e..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Expression/LazyLoadingExpressionVoter.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Expression; - -use Symfony\Component\DependencyInjection\ContainerInterface; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionVoter; - -class LazyLoadingExpressionVoter extends ExpressionVoter -{ - private $container; - private $compilerId; - - public function setLazyCompiler(ContainerInterface $container, $id) - { - $this->container = $container; - $this->compilerId = $id; - } - - protected function getCompiler() - { - return $this->container->get($this->compilerId); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Interception/MethodSecurityInterceptor.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Interception/MethodSecurityInterceptor.php deleted file mode 100644 index 8d4c63a..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Interception/MethodSecurityInterceptor.php +++ /dev/null @@ -1,150 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Interception; - -use JMS\SecurityExtraBundle\Exception\RuntimeException; -use CG\Core\ClassUtils; - -use CG\Proxy\MethodInterceptorInterface; -use CG\Proxy\MethodInvocation; -use JMS\SecurityExtraBundle\Metadata\MethodMetadata; -use JMS\SecurityExtraBundle\Security\Authentication\Token\RunAsUserToken; -use JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AfterInvocationManagerInterface; -use JMS\SecurityExtraBundle\Security\Authorization\RunAsManagerInterface; -use Metadata\MetadataFactoryInterface; -use Symfony\Component\HttpKernel\Log\LoggerInterface; -use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface; -use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface; -use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Security\Core\Exception\AccessDeniedException; -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; -use Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException; - -/** - * All invocations of secure methods will go through this class. - * - * @author Johannes M. Schmitt - */ -class MethodSecurityInterceptor implements MethodInterceptorInterface -{ - private $alwaysAuthenticate; - private $securityContext; - private $metadataFactory; - private $authenticationManager; - private $accessDecisionManager; - private $afterInvocationManager; - private $runAsManager; - private $logger; - - public function __construct(SecurityContext $securityContext, AuthenticationManagerInterface $authenticationManager, AccessDecisionManagerInterface $accessDecisionManager, - AfterInvocationManagerInterface $afterInvocationManager, RunAsManagerInterface $runAsManager, MetadataFactoryInterface $metadataFactory, LoggerInterface $logger = null) - { - $this->alwaysAuthenticate = false; - $this->securityContext = $securityContext; - $this->metadataFactory = $metadataFactory; - $this->authenticationManager = $authenticationManager; - $this->accessDecisionManager = $accessDecisionManager; - $this->afterInvocationManager = $afterInvocationManager; - $this->runAsManager = $runAsManager; - $this->logger = $logger; - } - - public function setAlwaysAuthenticate($boolean) - { - $this->alwaysAuthenticate = !!$boolean; - } - - public function intercept(MethodInvocation $method) - { - $metadata = $this->metadataFactory->getMetadataForClass($method->reflection->class); - - // no security metadata, proceed - if (empty($metadata) || !isset($metadata->methodMetadata[$method->reflection->name])) { - return $method->proceed(); - } - $metadata = $metadata->methodMetadata[$method->reflection->name]; - - if (null === $token = $this->securityContext->getToken()) { - throw new AuthenticationCredentialsNotFoundException( - 'The security context was not populated with a Token.' - ); - } - - if ($this->alwaysAuthenticate || !$token->isAuthenticated()) { - $token = $this->authenticationManager->authenticate($token); - $this->securityContext->setToken($token); - } - - if (!empty($metadata->roles) && false === $this->accessDecisionManager->decide($token, $metadata->roles, $method)) { - throw new AccessDeniedException('Token does not have the required roles.'); - } - - if (!empty($metadata->paramPermissions)) { - foreach ($method->arguments as $index => $argument) { - if (null !== $argument && isset($metadata->paramPermissions[$index]) && false === $this->accessDecisionManager->decide($token, $metadata->paramPermissions[$index], $argument)) { - throw new AccessDeniedException(sprintf('Token does not have the required permissions for method "%s::%s".', $method->reflection->class, $method->reflection->name)); - } - } - } - - $runAsToken = null; - if (!empty($metadata->runAsRoles)) { - $runAsToken = $this->runAsManager->buildRunAs($token, $method, $metadata->runAsRoles); - - if (null !== $this->logger) { - $this->logger->debug('Populating security context with RunAsToken'); - } - - if (null === $runAsToken) { - throw new RuntimeException('RunAsManager must not return null from buildRunAs().'); - } - - $this->securityContext->setToken($runAsToken); - } - - try { - $returnValue = $method->proceed(); - - if (null !== $runAsToken) { - $this->restoreOriginalToken($runAsToken); - } - - if (empty($metadata->returnPermissions)) { - return $returnValue; - } - - return $this->afterInvocationManager->decide($this->securityContext->getToken(), $method, $metadata->returnPermissions, $returnValue); - } catch (\Exception $failed) { - if (null !== $runAsToken) { - $this->restoreOriginalToken($runAsToken); - } - - throw $failed; - } - } - - private function restoreOriginalToken(RunAsUserToken $runAsToken) - { - if (null !== $this->logger) { - $this->logger->debug('Populating security context with original Token.'); - } - - $this->securityContext->setToken($runAsToken->getOriginalToken()); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Interception/SecurityPointcut.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Interception/SecurityPointcut.php deleted file mode 100644 index 9cba96c..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Interception/SecurityPointcut.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Interception; - -use CG\Core\ClassUtils; -use Metadata\MetadataFactoryInterface; -use JMS\AopBundle\Aop\PointcutInterface; - -class SecurityPointcut implements PointcutInterface -{ - private $metadataFactory; - private $secureAllServices; - private $securedClasses = array(); - private $patterns; - - public function __construct(MetadataFactoryInterface $metadataFactory, $secureAllServices = false, array $patterns = array()) - { - $this->metadataFactory = $metadataFactory; - $this->secureAllServices = $secureAllServices; - $this->patterns = $patterns; - } - - public function setSecuredClasses(array $classes) - { - $this->securedClasses = $classes; - } - - public function matchesClass(\ReflectionClass $class) - { - if ($this->secureAllServices) { - return true; - } - - if ('Controller' === substr(ClassUtils::getUserClass($class->name), -10)) { - return true; - } - - foreach ($this->patterns as $pattern => $expr) { - // if not for all patterns the class is specified, then we need to scan all - // classes to catch all methods - if (false === $pos = strpos($pattern, '::')) { - // controller notation is already checked by JMSDiExtraBundle, - // we can safely ignore these patterns here - if (2 === substr_count($pattern, ':')) { - continue; - } - - return true; - } - - if (0 < preg_match('#'.substr($pattern, 0, $pos).'$#', $class->name)) { - return true; - } - } - - foreach ($this->securedClasses as $securedClass) { - if ($class->name === $securedClass || $class->isSubclassOf($securedClass)) { - return true; - } - } - - return false; - } - - public function matchesMethod(\ReflectionMethod $method) - { - $userClass = ClassUtils::getUserClass($method->class); - $metadata = $this->metadataFactory->getMetadataForClass($userClass); - - if (null === $metadata) { - return false; - } - - return isset($metadata->methodMetadata[$method->name]); - } -} diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/RunAsManager.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/RunAsManager.php deleted file mode 100644 index f1884df..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/RunAsManager.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization; - -use JMS\SecurityExtraBundle\Security\Authentication\Token\RunAsUserToken; -use Symfony\Component\Security\Core\Role\Role; -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; - -/** - * The RunAsManager creates throw-away Tokens which are temporarily injected into - * the security context for the duration of the invocation of a specific method. - * - * @author Johannes M. Schmitt - */ -class RunAsManager implements RunAsManagerInterface -{ - private $key; - private $rolePrefix; - - public function __construct($key, $rolePrefix = 'ROLE_') - { - $this->key = $key; - $this->rolePrefix = $rolePrefix; - } - - /** - * {@inheritDoc} - */ - public function buildRunAs(TokenInterface $token, $secureObject, array $attributes) - { - $roles = array(); - foreach ($attributes as $attribute) - { - if ($this->supportsAttribute($attribute)) { - $roles[] = new Role($attribute); - } - } - - if (0 === count($roles)) { - return null; - } - - $roles = array_merge($roles, $token->getRoles()); - - return new RunAsUserToken($this->key, $token->getUser(), $token->getCredentials(), $roles, $token); - } - - /** - * {@inheritDoc} - */ - public function supportsAttribute($attribute) - { - return !empty($attribute) && 0 === strpos($attribute, $this->rolePrefix); - } - - /** - * {@inheritDoc} - */ - public function supportsClass($className) - { - return true; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/RunAsManagerInterface.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/RunAsManagerInterface.php deleted file mode 100644 index a2b4909..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/RunAsManagerInterface.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization; - -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; - -/** - * RunAsManagerInterface - * - * @author Johannes M. Schmitt - */ -interface RunAsManagerInterface -{ - /** - * Creates a temporary RunAsToken. - * - * The returned Token must have a complementing AuthenticationProvider implementation. - * - * @param TokenInterface $token the original Token - * @param object $secureObject the secure object which caused this call - * @param array $attributes an array of attributes to apply to the built token - * @return TokenInterface - */ - function buildRunAs(TokenInterface $token, $secureObject, array $attributes); - - /** - * Whether this RunAsManager supports the given attribute - * - * @param string $attribute - * @return Boolean - */ - function supportsAttribute($attribute); - - /** - * Whether this RunAsManager supports the given class. - * - * @param string $className The class of the secure object which requests RunAs capabilities - * @return Boolean - */ - function supportsClass($className); -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Voter/IddqdVoter.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Voter/IddqdVoter.php deleted file mode 100644 index 663cd4e..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Security/Authorization/Voter/IddqdVoter.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Security\Authorization\Voter; - -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; -use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; - -/** - * This voter adds a special role "ROLE_IDDQD" which effectively bypasses any, - * and all security checks. - * - * Most of the time, you will want to use this rule in combination with a - * @RunAs annotation to disable security checks for the invocation of a - * specific method. - * - * @author Johannes M. Schmitt - */ -class IddqdVoter implements VoterInterface -{ - public function vote(TokenInterface $token, $object, array $attributes) - { - return $this->isIddqd($token) ? VoterInterface::ACCESS_GRANTED : VoterInterface::ACCESS_ABSTAIN; - } - - protected function isIddqd(TokenInterface $token) - { - foreach ($token->getRoles() as $role) { - if ('ROLE_IDDQD' === $role->getRole()) { - return true; - } - } - - return false; - } - - public function supportsAttribute($attribute) - { - return true; - } - - public function supportsClass($class) - { - return true; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/DependencyInjection/Compiler/AddAfterInvocationProvidersPassTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/DependencyInjection/Compiler/AddAfterInvocationProvidersPassTest.php deleted file mode 100644 index 277f374..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/DependencyInjection/Compiler/AddAfterInvocationProvidersPassTest.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Tests\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Definition; -use JMS\SecurityExtraBundle\DependencyInjection\Compiler\AddAfterInvocationProvidersPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class AddAfterInvocationProvidersPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcessStopsWhenNoAfterInvocationManager() - { - $container = $this->getContainer(); - $container - ->expects($this->once()) - ->method('hasDefinition') - ->with($this->equalTo('security.access.after_invocation_manager')) - ->will($this->returnValue(false)) - ; - $container - ->expects($this->never()) - ->method('findTaggedServiceIds') - ; - - $this->process($container); - } - - public function testProcessRemovesAclProviderIfAclIsNotActive() - { - $container = new ContainerBuilder(); - $container->setDefinition('security.access.after_invocation_manager', $manager = new Definition()); - - $container - ->register('security.access.after_invocation.acl_provider') - ->addTag('security.after_invocation.provider') - ; - - $this->assertEquals(array(), $manager->getArguments()); - $this->process($container); - $this->assertEquals(array(array()), $manager->getArguments()); - } - - public function testProcess() - { - $container = new ContainerBuilder(); - - $container->setDefinition('security.access.after_invocation_manager', $manager = new Definition()); - - $provider1 = new Definition(); - $provider1->addTag('security.after_invocation.provider'); - $container->setDefinition('provider1', $provider1); - - $provider2 = new Definition(); - $provider2->addTag('security.after_invocation.provider'); - $container->setDefinition('provider2', $provider2); - - $this->process($container); - - $arguments = $manager->getArguments(); - $this->assertEquals(2, count($providers = $arguments[0])); - $this->assertEquals('provider1', (string) $providers[0]); - $this->assertEquals('provider2', (string) $providers[1]); - } - - protected function process(ContainerBuilder $container) - { - $pass = new AddAfterInvocationProvidersPass(); - $pass->process($container); - } - - protected function getContainer() - { - return $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder'); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/DependencyInjection/Compiler/CollectSecuredServicesPassTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/DependencyInjection/Compiler/CollectSecuredServicesPassTest.php deleted file mode 100644 index bef1ffb..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/DependencyInjection/Compiler/CollectSecuredServicesPassTest.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Tests\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; - -use JMS\SecurityExtraBundle\DependencyInjection\Compiler\CollectSecuredServicesPass; - -class CollectSecuredServicesPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcess() - { - $container = new ContainerBuilder(); - $container - ->register('security.access.pointcut', 'JMS\SecurityExtraBundle\Security\Authorization\Interception\SecurityPointcut') - ; - - $container - ->register('a', 'stdClass') - ->addTag('security.secure_service') - ; - $container - ->register('b', 'stdClass') - ->addTag('security.secure_service') - ; - - $pass = new CollectSecuredServicesPass(); - $pass->process($container); - - $this->assertEquals(array( - array('setSecuredClasses', array(array('stdClass', 'stdClass'))), - ), $container->getDefinition('security.access.pointcut')->getMethodCalls()); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/DependencyInjection/JMSSecurityExtraExtensionTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/DependencyInjection/JMSSecurityExtraExtensionTest.php deleted file mode 100644 index 37019fd..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/DependencyInjection/JMSSecurityExtraExtensionTest.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Tests\DependencyInjection; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use JMS\SecurityExtraBundle\DependencyInjection\JMSSecurityExtraExtension; - -class JMSSecurityExtraExtensionTest extends \PHPUnit_Framework_TestCase -{ - private $extension; - - public function testConfigLoad() - { - $config = array(); - $this->extension->load(array($config), $container = $this->getContainer()); - - $this->assertTrue($container->hasDefinition('security.access.method_interceptor')); - $this->assertFalse($container->getParameter('security.access.secure_all_services')); - $this->assertFalse($container->getDefinition('security.extra.iddqd_voter')->hasTag('security.voter')); - } - - public function testConfigLoadSecureAll() - { - $this->extension->load(array(array('secure_all_services' => true)), - $container = $this->getContainer()); - - $this->assertTrue($container->getParameter('security.access.secure_all_services')); - } - - public function testConfigLoadEnableIddqdAttribute() - { - $this->extension->load(array(array('enable_iddqd_attribute' => true)), - $container = $this->getContainer()); - - $this->assertTrue($container->getDefinition('security.extra.iddqd_voter')->hasTag('security.voter')); - } - - public function testConfigLoadWithMethodAccessControl() - { - $this->extension->load(array(array( - 'expressions' => true, - 'method_access_control' => array( - ':login$' => 'hasRole("FOO")', - ) - )), $container = $this->getContainer()); - - $this->assertEquals(array(':login$' => 'hasRole("FOO")'), - $container->getParameter('security.access.method_access_control')); - } - - /** - * @expectedException \RuntimeException - */ - public function testConfigLoadThrowsExceptionWhenMethodAccessControlWithoutExpressions() - { - $this->extension->load(array(array( - 'expressions' => false, - 'method_access_control' => array('foo' => 'bar'), - )), $this->getContainer()); - } - - protected function setUp() - { - $this->extension = new JMSSecurityExtraExtension(); - } - - private function getContainer() - { - $container = new ContainerBuilder(); - $container->setParameter('kernel.cache_dir', sys_get_temp_dir()); - $container->setParameter('kernel.bundles', array('JMSAopBundle' => 'JMS\AopBundle\JMSAopBundle')); - - return $container; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/AbstractMethodNotDirectlyOverwrittenInDirectChildService.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/AbstractMethodNotDirectlyOverwrittenInDirectChildService.php deleted file mode 100644 index 5bd3647..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/AbstractMethodNotDirectlyOverwrittenInDirectChildService.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Tests\Fixtures; - -use JMS\SecurityExtraBundle\Annotation\SecureReturn; -use JMS\SecurityExtraBundle\Annotation\SecureParam; -use JMS\SecurityExtraBundle\Annotation\Secure; - -interface AMNDOIDCS_Interface -{ - /** - * @SecureReturn(permissions="VIEW") - */ - function abstractMethod(); -} - -abstract class AMNDOIDCS_DirectChild implements AMNDOIDCS_Interface -{ -} - -class AbstractMethodNotDirectlyOverwrittenInDirectChildService extends AMNDOIDCS_DirectChild -{ - /** - * Some comment - */ - public function abstractMethod() - { - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/Annotation/NonSecurityAnnotation.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/Annotation/NonSecurityAnnotation.php deleted file mode 100644 index a1e9e81..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/Annotation/NonSecurityAnnotation.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Tests\Fixtures\Annotation; - -/** @Annotation */ -final class NonSecurityAnnotation -{ -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/ComplexService.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/ComplexService.php deleted file mode 100644 index f3f9b8a..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/ComplexService.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Tests\Fixtures; - -use JMS\SecurityExtraBundle\Annotation\SecureReturn; -use JMS\SecurityExtraBundle\Annotation\SecureParam; -use JMS\SecurityExtraBundle\Annotation\Secure; - -interface E { - /** - * @SecureReturn(permissions="VIEW,UNDELETE") - */ - function retrieve(); -} -interface F { - /** - * @SecureParam(name="secure", permissions="OWNER") - * @SecureParam(name="foo", permissions="MASTER, EDIT") - */ - function delete($foo, $asdf, $secure); -} -interface C { } -interface D extends F {} -interface B extends C, E { } -abstract class G implements F, E { - /** - * @Secure(roles="ROLE_FOO, IS_AUTHENTICATED_FULLY") - * @SecureParam(name="secure", permissions="FOO") - * @SecureReturn(permissions="WOW") - */ - abstract function abstractMethod($foo, $secure); -} -class A extends G implements C, B, D { - public function retrieve() { } - public function delete($one, $two, $three) { } - public function abstractMethod($asdf, $wohoo) { } -} -class ComplexService extends A implements C { } diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/CorrectSubService.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/CorrectSubService.php deleted file mode 100644 index e8eed1f..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/CorrectSubService.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Tests\Fixtures; - -use JMS\SecurityExtraBundle\Annotation\SatisfiesParentSecurityPolicy; -use JMS\SecurityExtraBundle\Annotation\SecureReturn; - -class CorrectSubService extends MainService -{ - /** - * @SatisfiesParentSecurityPolicy - * @SecureReturn(permissions="VIEW") - */ - public function differentMethodSignature($comment) - { - return parent::differentMethodSignature($comment); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/MainService.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/MainService.php deleted file mode 100644 index eadd4ef..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/MainService.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Tests\Fixtures; - -use JMS\SecurityExtraBundle\Annotation\Secure; -use JMS\SecurityExtraBundle\Tests\Fixtures\Annotation\NonSecurityAnnotation; -use JMS\SecurityExtraBundle\Annotation\SecureParam; - -class MainService -{ - /** - * This Method has no relevant security annotations - * @NonSecurityAnnotation - */ - public function foo() - { - } - - /** - * @SecureParam(name="comment", permissions="EDIT") - */ - public function differentMethodSignature($comment) - { - // some secure action - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/SubService.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/SubService.php deleted file mode 100644 index 5933365..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Fixtures/SubService.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Tests\Fixtures; - -class SubService extends MainService -{ - public function differentMethodSignature($commentId) - { - $comment = 'asdgasdf'.$commentId; - - return MainService::differentMethodSignature($comment); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/AppKernel.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/AppKernel.php deleted file mode 100644 index eaab813..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/AppKernel.php +++ /dev/null @@ -1,97 +0,0 @@ -isAbsolutePath($config)) { - $config = __DIR__.'/config/'.$config; - } - - if (!file_exists($config)) { - throw new \RuntimeException(sprintf('The config file "%s" does not exist.', $config)); - } - - $this->config = $config; - } - - public function registerBundles() - { - return array( - new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(), - new \Symfony\Bundle\SecurityBundle\SecurityBundle(), - new \Symfony\Bundle\DoctrineBundle\DoctrineBundle(), - new \Symfony\Bundle\TwigBundle\TwigBundle(), - new TestBundle(), - new FormLoginBundle(), - new \Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), - new \JMS\AopBundle\JMSAopBundle(), - new \JMS\DiExtraBundle\JMSDiExtraBundle($this), - new \JMS\SecurityExtraBundle\JMSSecurityExtraBundle(), - ); - } - - public function registerContainerConfiguration(LoaderInterface $loader) - { - $loader->load($this->config); - } - - public function getCacheDir() - { - return sys_get_temp_dir().'/JMSSecurityExtraBundle/'.sha1($this->config); - } - - protected function getContainerClass() - { - return parent::getContainerClass().sha1($this->config); - } - - public function serialize() - { - return $this->config; - } - - public function unserialize($str) - { - $this->__construct($str); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/BaseTestCase.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/BaseTestCase.php deleted file mode 100644 index ea0ff91..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/BaseTestCase.php +++ /dev/null @@ -1,64 +0,0 @@ -remove(sys_get_temp_dir().'/JMSSecurityExtraBundle'); - } - - protected function tearDown() - { - parent::tearDown(); - - $fs = new Filesystem(); - $fs->remove(sys_get_temp_dir().'/JMSSecurityExtraBundle'); - } - - protected function login($client, $username = null, $password = null) - { - if (empty($username) || empty($password)) { - $username = 'johannes'; - $password = 'test'; - } - - $crawler = $client->request('get', '/login')->selectButton('login'); - $form = $crawler->form(); - - $form['_username'] = $username; - $form['_password'] = $password; - $client->submit($form); - - $security = $client->getProfile()->getCollector('security'); - - $this->assertTrue(is_string($security->getUser()) && strlen($security->getUser()) > 0); - $this->assertTrue($security->isAuthenticated(), 'Logged in user is not authenticated.'); - } - - protected final function importDatabaseSchema() - { - $em = self::$kernel->getContainer()->get('em'); - - $metadata = $em->getMetadataFactory()->getAllMetadata(); - if (!empty($metadata)) { - $schemaTool = new \Doctrine\ORM\Tools\SchemaTool($em); - $schemaTool->createSchema($metadata); - } - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/MethodAccessControlTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/MethodAccessControlTest.php deleted file mode 100644 index 46c713b..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/MethodAccessControlTest.php +++ /dev/null @@ -1,77 +0,0 @@ -createClient(array('config' => 'method_access_control.yml')); - - $client->request('GET', '/add'); - $response = $client->getResponse(); - - $this->assertEquals(302, $response->getStatusCode()); - $this->assertEquals('http://localhost/login', $response->headers->get('Location')); - } - - public function testControllerEditActionIsNotSecure() - { - $client = $this->createClient(array('config' => 'method_access_control.yml')); - - $client->request('GET', '/edit'); - $response = $client->getResponse(); - - $this->assertEquals(200, $response->getStatusCode()); - } - - /** - * @expectedException Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException - */ - public function testUserManagerDeleteIsSecure() - { - $this->createClient(array('config' => 'method_access_control.yml')); - - $manager = self::$kernel->getContainer()->get('user_manager'); - - $this->assertNotEquals( - 'JMS\SecurityExtraBundle\Tests\Functional\TestBundle\User\UserManager', - get_class($manager) - ); - $manager->delete(); - } - - public function testAcl() - { - $client = $this->createClient(array('config' => 'acl_enabled.yml')); - $client->insulate(); - - $this->importDatabaseSchema(); - $this->login($client); - - $client->request('POST', '/post/add', array('title' => 'Foo')); - - $response = $client->getResponse(); - $this->assertEquals('/post/edit/1', $response->headers->get('Location'), - substr($response, 0, 2000)); - - $client->request('GET', '/post/edit/1'); - $response = $client->getResponse(); - $this->assertEquals(200, $response->getStatusCode(), substr($response, 0, 2000)); - $this->assertEquals('Foo', $response->getContent()); - } - - public function testRoleHierarchyIsRespected() - { - $client = $this->createClient(array('config' => 'all_voters_disabled.yml')); - $client->insulate(); - - $this->login($client); - - $client->request('GET', '/post/list'); - - $response = $client->getResponse(); - $this->assertEquals(200, $response->getStatusCode(), substr($response, 0, 2000)); - $this->assertEquals('list', $response->getContent(), substr($response, 0, 2000)); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/Resources/views/base.html.twig b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/Resources/views/base.html.twig deleted file mode 100644 index c19978f..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/Resources/views/base.html.twig +++ /dev/null @@ -1,13 +0,0 @@ - - - - - {% block title %}Welcome!{% endblock %} - {% block stylesheets %}{% endblock %} - - - - {% block body %}{% endblock %} - {% block javascripts %}{% endblock %} - - diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/Controller/CrudController.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/Controller/CrudController.php deleted file mode 100644 index ae90060..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/Controller/CrudController.php +++ /dev/null @@ -1,18 +0,0 @@ -request->request->get('title')) { - throw new HttpException(400); - } - - $this->em->getConnection()->beginTransaction(); - try { - $post = new Post($title); - $this->em->persist($post); - $this->em->flush(); - - $oid = ObjectIdentity::fromDomainObject($post); - $acl = $this->getAclProvider()->createAcl($oid); - - $sid = UserSecurityIdentity::fromToken($this->context->getToken()); - $acl->insertObjectAce($sid, MaskBuilder::MASK_OWNER); - $this->getAclProvider()->updateAcl($acl); - - $this->em->getConnection()->commit(); - - return new Response('', 201, array( - 'Location' => $this->router->generate('post_controller_edit', array('id' => $post->getId())), - )); - } catch (\Exception $ex) { - $this->em->getConnection()->rollBack(); - $this->em->close(); - - throw $ex; - } - } - - /** - * @PreAuthorize("hasPermission(#post, 'edit')") - */ - public function editPostAction(Post $post) - { - return new Response($post->getTitle()); - } - - /** - * @PreAuthorize("hasRole('ROLE_BAR')") - */ - public function listPostAction() - { - return new Response('list'); - } - - /** @DI\LookupMethod("security.acl.provider") */ - protected function getAclProvider() { } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/Entity/Post.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/Entity/Post.php deleted file mode 100644 index 07b8237..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/Entity/Post.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ -class Post -{ - /** - * @ORM\Id - * @ORM\GeneratedValue(strategy="AUTO") - * @ORM\Column(type="integer") - */ - private $id; - - /** - * @ORM\Column(type = "string") - */ - private $title; - - public function __construct($title) - { - $this->title = $title; - } - - public function getId() - { - return $this->id; - } - - public function getTitle() - { - return $this->title; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/Logger/FileLogger.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/Logger/FileLogger.php deleted file mode 100644 index b8e7ed1..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/Logger/FileLogger.php +++ /dev/null @@ -1,60 +0,0 @@ -dir = $logDir; - } - - public function emerg($message, array $context = array()) - { - $this->log('[EMERG] '.$message); - } - - public function alert($message, array $context = array()) - { - $this->log('[ALERT] '.$message); - } - - public function crit($message, array $context = array()) - { - $this->log('[CRIT] '.$message); - } - - public function err($message, array $context = array()) - { - $this->log('[ERR] '.$message); - } - - public function warn($message, array $context = array()) - { - $this->log('[WARN] '.$message); - } - - public function notice($message, array $context = array()) - { - $this->log('[NOTICE] '.$message); - } - - public function info($message, array $context = array()) - { - $this->log('[INFO] '.$message); - } - - public function debug($message, array $context = array()) - { - $this->log('[DEBUG] '.$message); - } - - private function log($message) - { - file_put_contents($this->dir.'/log', $message."\n", FILE_APPEND); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/Resources/views/is_expr_granted.html.twig b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/Resources/views/is_expr_granted.html.twig deleted file mode 100644 index ba9d5fa..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/Resources/views/is_expr_granted.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% if (is_expr_granted("hasRole('FOO')")) -%} -granted -{%- else -%} -denied -{%- endif %} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/TestBundle.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/TestBundle.php deleted file mode 100644 index e1dda5d..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/TestBundle/TestBundle.php +++ /dev/null @@ -1,10 +0,0 @@ -context->setToken(new UsernamePasswordToken('foo', 'bar', 'baz', array('FOO'))); - - $this->assertEquals('granted', - $this->twig->render('TestBundle::is_expr_granted.html.twig')); - } - - public function testIsExprGranted() - { - $this->context->setToken(new AnonymousToken('foo', 'bar')); - - $this->assertEquals('denied', - $this->twig->render('TestBundle::is_expr_granted.html.twig')); - } - - protected function setUp() - { - parent::setUp(); - - $this->createClient(array('config' => 'all_voters_disabled.yml')); - $this->context = self::$kernel->getContainer()->get('security.context'); - $this->twig = self::$kernel->getContainer()->get('twig'); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/VoterDisablingTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/VoterDisablingTest.php deleted file mode 100644 index 3ef0a3b..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/VoterDisablingTest.php +++ /dev/null @@ -1,48 +0,0 @@ -createClient(array('config' => 'all_voters_disabled.yml')); - $client->insulate(); - - $adm = self::$kernel->getContainer()->get('security.access.decision_manager'); - - $this->assertEquals(1, count($voters = $this->getField($adm, 'voters'))); - $this->assertInstanceOf('JMS\SecurityExtraBundle\Security\Authorization\Expression\LazyLoadingExpressionVoter', $voters[0]); - } - - public function testDefault() - { - $client = $this->createClient(array('config' => 'default.yml')); - $client->insulate(); - - $adm = self::$kernel->getContainer()->get('security.access.decision_manager'); - - $this->assertEquals(2, count($voters = $this->getField($adm, 'voters'))); - $this->assertInstanceOf('Symfony\Component\Security\Core\Authorization\Voter\RoleVoter', $voters[0]); - $this->assertInstanceOf('Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter', $voters[1]); - } - - public function testSomeVotersDisabled() - { - $client = $this->createClient(array('config' => 'some_voters_disabled.yml')); - $client->insulate(); - - $adm = self::$kernel->getContainer()->get('security.access.decision_manager'); - - $this->assertEquals(1, count($voters = $this->getField($adm, 'voters'))); - $this->assertInstanceOf('Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter', $voters[0]); - } - - private function getField($obj, $field) - { - $ref = new \ReflectionProperty($obj, $field); - $ref->setAccessible(true); - - return $ref->getValue($obj); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/acl_enabled.yml b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/acl_enabled.yml deleted file mode 100644 index 8f5810a..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/acl_enabled.yml +++ /dev/null @@ -1,9 +0,0 @@ -imports: - - { resource: default.yml } - -security: - acl: ~ - -jms_security_extra: - expressions: true - voters: false \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/all_voters_disabled.yml b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/all_voters_disabled.yml deleted file mode 100644 index bc23cd5..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/all_voters_disabled.yml +++ /dev/null @@ -1,6 +0,0 @@ -imports: - - { resource: default.yml } - -jms_security_extra: - expressions: true - voters: false \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/default.yml b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/default.yml deleted file mode 100644 index b31f647..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/default.yml +++ /dev/null @@ -1,5 +0,0 @@ -imports: - - { resource: framework.yml } - - { resource: twig.yml } - - { resource: security.yml } - - { resource: doctrine.yml } diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/doctrine.yml b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/doctrine.yml deleted file mode 100644 index a065105..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/doctrine.yml +++ /dev/null @@ -1,13 +0,0 @@ -services: - em: @doctrine.orm.entity_manager - -doctrine: - dbal: - driver: pdo_sqlite - path: %kernel.cache_dir%/sqlite.db - - orm: - auto_generate_proxy_classes: %kernel.debug% - entity_managers: - default: - auto_mapping: true diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/framework.yml b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/framework.yml deleted file mode 100644 index a1268a2..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/framework.yml +++ /dev/null @@ -1,18 +0,0 @@ -services: - logger: - class: JMS\SecurityExtraBundle\Tests\Functional\TestBundle\Logger\FileLogger - arguments: [%kernel.cache_dir%] - -framework: - secret: test - profiler: ~ - test: ~ - session: - storage_id: session.storage.filesystem - form: true - csrf_protection: true - validation: - enabled: true - enable_annotations: true - router: - resource: %kernel.root_dir%/config/routing.yml \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/method_access_control.yml b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/method_access_control.yml deleted file mode 100644 index d05ed40..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/method_access_control.yml +++ /dev/null @@ -1,12 +0,0 @@ -imports: - - { resource: default.yml } - -services: - user_manager: - class: JMS\SecurityExtraBundle\Tests\Functional\TestBundle\User\UserManager - -jms_security_extra: - expressions: ~ - method_access_control: - 'UserManager::delete$': 'hasRole("FOO")' - 'TestBundle:Crud:add': 'hasRole("FOO")' \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/routing.yml b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/routing.yml deleted file mode 100644 index c9e4b6e..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/routing.yml +++ /dev/null @@ -1,27 +0,0 @@ -crud_controller_add: - pattern: /add - defaults: - _controller: TestBundle:Crud:add - -crud_controller_edit: - pattern: /edit - defaults: - _controller: TestBundle:Crud:edit - -post_controller_add: - pattern: /post/add - defaults: - _controller: TestBundle:Post:newPost - -post_controller_edit: - pattern: /post/edit/{id} - defaults: - _controller: TestBundle:Post:editPost - -post_controller_list: - pattern: /post/list - defaults: - _controller: TestBundle:Post:listPost - -form_login_bundle: - resource: @FormLoginBundle/Resources/config/routing.yml \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/security.yml b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/security.yml deleted file mode 100644 index ef95b1d..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/security.yml +++ /dev/null @@ -1,17 +0,0 @@ -security: - providers: - in_memory: - users: - johannes: { password: test, roles: [ROLE_FOO] } - - role_hierarchy: - ROLE_FOO: [ROLE_BAR] - - encoders: - Symfony\Component\Security\Core\User\UserInterface: plaintext - - firewalls: - default: - form_login: ~ - anonymous: ~ - logout: ~ diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/some_voters_disabled.yml b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/some_voters_disabled.yml deleted file mode 100644 index 0af61d2..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/some_voters_disabled.yml +++ /dev/null @@ -1,10 +0,0 @@ -imports: - - { resource: default.yml } - -security: - acl: ~ - -jms_security_extra: - voters: - disable_role: true - disable_acl: true diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/twig.yml b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/twig.yml deleted file mode 100644 index 2c8539a..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Functional/config/twig.yml +++ /dev/null @@ -1,7 +0,0 @@ -framework: - templating: - engines: [twig, php] - -twig: - debug: %kernel.debug% - strict_variables: %kernel.debug% \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Metadata/ClassMetadataTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Metadata/ClassMetadataTest.php deleted file mode 100644 index 1ec1d4d..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Metadata/ClassMetadataTest.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Tests\Metadata; - -use Doctrine\Common\Annotations\AnnotationReader; - -use JMS\SecurityExtraBundle\Metadata\Driver\AnnotationDriver; - -use Metadata\MetadataFactory; - -class ClassMetadataTest extends \PHPUnit_Framework_TestCase -{ - /** - * @expectedException \RuntimeException - * @expectedMessage You have overridden a secured method "differentMethodSignature" in "SubService". Please copy over the applicable security metadata, and also add @SatisfiesParentSecurityPolicy. - */ - public function testAnalyzeThrowsExceptionWhenSecureMethodIsOverridden() - { - $this->getFactory()->getMetadataForClass('JMS\SecurityExtraBundle\Tests\Fixtures\SubService'); - } - - public function testAnalyzeThrowsNoExceptionWhenAbstractMethodIsNotOverridenInDirectChildClass() - { - $metadata = $this - ->getFactory() - ->getMetadataForClass('JMS\SecurityExtraBundle\Tests\Fixtures\AbstractMethodNotDirectlyOverwrittenInDirectChildService') - ; - - $this->assertTrue(isset($metadata->methodMetadata['abstractMethod'])); - - $metadata = $metadata->methodMetadata['abstractMethod']; - $this->assertEquals(array('VIEW'), $metadata->returnPermissions); - } - - public function testAnalyzeThrowsNoExceptionWhenSatisfiesParentSecurityPolicyIsDefined() - { - $metadata = $this - ->getFactory() - ->getMetadataForClass('JMS\SecurityExtraBundle\Tests\Fixtures\CorrectSubService') - ; - - $methods = $metadata->methodMetadata; - $this->assertTrue(isset($methods['differentMethodSignature'])); - - $metadata = $methods['differentMethodSignature']; - $this->assertEquals(array(), $metadata->roles); - $this->assertEquals(array(), $metadata->paramPermissions); - $this->assertEquals(array('VIEW'), $metadata->returnPermissions); - } - - public function testAnalyzeWithComplexHierarchy() - { - $metadata = $this - ->getFactory() - ->getMetadataForClass('JMS\SecurityExtraBundle\Tests\Fixtures\ComplexService') - ; - - $methods = $metadata->methodMetadata; - $this->assertTrue(isset($methods['delete'], $methods['retrieve'], $methods['abstractMethod'])); - - $metadata = $methods['delete']; - $this->assertEquals(array(0 => array('MASTER', 'EDIT'), 2 => array('OWNER')), $metadata->paramPermissions); - $this->assertEquals(array(), $metadata->returnPermissions); - $this->assertEquals(array(), $metadata->roles); - - $metadata = $methods['retrieve']; - $this->assertEquals(array('VIEW', 'UNDELETE'), $metadata->returnPermissions); - $this->assertEquals(array(), $metadata->paramPermissions); - $this->assertEquals(array(), $metadata->roles); - - $metadata = $methods['abstractMethod']; - $this->assertEquals(array('ROLE_FOO', 'IS_AUTHENTICATED_FULLY'), $metadata->roles); - $this->assertEquals(array(1 => array('FOO')), $metadata->paramPermissions); - $this->assertEquals(array('WOW'), $metadata->returnPermissions); - } - - public function testAnalyze() - { - $metadata = $this - ->getFactory() - ->getMetadataForClass('JMS\SecurityExtraBundle\Tests\Fixtures\MainService') - ; - - $methods = $metadata->methodMetadata; - $this->assertTrue(isset($methods['differentMethodSignature'])); - - $metadata = $methods['differentMethodSignature']; - $this->assertEquals(array(array('EDIT')), $metadata->paramPermissions); - $this->assertEquals(array(), $metadata->returnPermissions); - $this->assertEquals(array(), $metadata->roles); - $this->assertFalse($metadata->isDeclaredOnInterface()); - } - - private function getFactory() - { - $factory = new MetadataFactory(new AnnotationDriver(new AnnotationReader())); - $factory->setIncludeInterfaces(true); - - return $factory; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Metadata/Driver/AnnotationDriverTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Metadata/Driver/AnnotationDriverTest.php deleted file mode 100644 index a300a4c..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Metadata/Driver/AnnotationDriverTest.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Tests\Mapping\Driver; - -use Doctrine\Common\Annotations\AnnotationReader; - -use JMS\SecurityExtraBundle\Metadata\Driver\AnnotationDriver; - -require_once __DIR__.'/Fixtures/services.php'; - -class AnnotationDriverTest extends \PHPUnit_Framework_TestCase -{ - public function testLoadMetadataFromClass() - { - $driver = new AnnotationDriver(new AnnotationReader()); - - $metadata = $driver->loadMetadataForClass(new \ReflectionClass('JMS\SecurityExtraBundle\Tests\Mapping\Driver\FooService')); - $this->assertTrue(isset($metadata->methodMetadata['foo'])); - $method = $metadata->methodMetadata['foo']; - $this->assertEquals(array('ROLE_USER', 'ROLE_ADMIN', 'ROLE_SUPERADMIN'), $method->roles); - $this->assertEquals(array(), $method->returnPermissions); - $this->assertEquals(array(0 => array('VIEW')), $method->paramPermissions); - - $metadata = $driver->loadMetadataForClass(new \ReflectionClass('JMS\SecurityExtraBundle\Tests\Mapping\Driver\FooInterface')); - $this->assertTrue(isset($metadata->methodMetadata['foo'])); - $method = $metadata->methodMetadata['foo']; - $this->assertEquals(array(), $method->roles); - $this->assertEquals(array(0 => array('OWNER'), 1 => array('EDIT')), $method->paramPermissions); - $this->assertEquals(array('MASTER'), $method->returnPermissions); - } - - public function testLoadMetadataFromClassWithShortNotation() - { - $driver = new AnnotationDriver(new AnnotationReader()); - - $metadata = $driver->loadMetadataForClass(new \ReflectionClass('JMS\SecurityExtraBundle\Tests\Mapping\Driver\FooService')); - $this->assertTrue(isset($metadata->methodMetadata['shortNotation'])); - $method = $metadata->methodMetadata['shortNotation']; - $this->assertEquals(array('ROLE_FOO', 'ROLE_BAR'), $method->roles); - } - - public function testLoadMetadataFromClassDoesNotProcessMethodsForWhichNoSecurityMetadataExists() - { - $driver = new AnnotationDriver(new AnnotationReader()); - - $metadata = $driver->loadMetadataForClass(new \ReflectionClass('JMS\SecurityExtraBundle\Tests\Fixtures\MainService')); - $this->assertTrue(class_exists('JMS\SecurityExtraBundle\Tests\Fixtures\Annotation\NonSecurityAnnotation', false)); - $this->assertFalse(isset($metadata->methodMetadata['foo'])); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Metadata/Driver/ConfigDriverTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Metadata/Driver/ConfigDriverTest.php deleted file mode 100644 index fab043e..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Metadata/Driver/ConfigDriverTest.php +++ /dev/null @@ -1,54 +0,0 @@ - 'hasRole("FOO")', - )); - - $metadata = $driver->loadMetadataForClass($this->getClass('Controller\\CrudController')); - - $this->assertEquals(5, count($metadata->methodMetadata)); - - $metadata = $metadata->methodMetadata; - foreach (array('addAction', 'deleteAction', 'editAction', 'showAction', 'newAction') as $action) { - $this->assertArrayHasKey($action, $metadata); - $this->assertEquals(array(new Expression('hasRole("FOO")')), $metadata[$action]->roles); - } - } - - public function testLoadMetadataControllerNotation() - { - $driver = new ConfigDriver(array( - 'AcmeFooBundle' => 'JMS\SecurityExtraBundle\Tests\Metadata\Driver\Fixtures\AcmeFooBundle', - ), array( - '^AcmeFooBundle:.*:delete.*$' => 'hasRole("ROLE_ADMIN")', - )); - - $metadata = $driver->loadMetadataForClass($this->getClass('Controller\\CrudController')); - - $this->assertEquals(1, count($metadata->methodMetadata)); - $this->assertArrayHasKey('deleteAction', $metadata->methodMetadata); - $this->assertEquals(array(new Expression('hasRole("ROLE_ADMIN")')), $metadata->methodMetadata['deleteAction']->roles); - } - - public function testLoadMetadataWithoutConfig() - { - $driver = new ConfigDriver(array(), array()); - $this->assertNull($driver->loadMetadataForClass($this->getClass('Controller\\CrudController'))); - } - - private function getClass($name) - { - return new \ReflectionClass('JMS\SecurityExtraBundle\Tests\Metadata\Driver\Fixtures\\'.$name); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Metadata/Driver/Fixtures/Controller/CrudController.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Metadata/Driver/Fixtures/Controller/CrudController.php deleted file mode 100644 index df1cbb8..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Metadata/Driver/Fixtures/Controller/CrudController.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Tests\Mapping\Driver; - -use JMS\SecurityExtraBundle\Annotation\SecureReturn; -use JMS\SecurityExtraBundle\Annotation\SecureParam; -use JMS\SecurityExtraBundle\Annotation\Secure; - -class FooService implements FooInterface -{ - /** - * @Secure(roles="ROLE_USER, ROLE_ADMIN, ROLE_SUPERADMIN") - * @SecureParam(name="param", permissions="VIEW") - */ - public function foo($param, $anotherParam) { } - - /** - * @Secure("ROLE_FOO, ROLE_BAR") - */ - public function shortNotation() { } -} -interface FooInterface -{ - /** - * @SecureParam(name="param", permissions="OWNER") - * @SecureParam(name="anotherParam", permissions="EDIT") - * @SecureReturn(permissions="MASTER") - */ - function foo($param, $anotherParam); -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Acl/Expression/HasPermissionFunctionCompilerTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Acl/Expression/HasPermissionFunctionCompilerTest.php deleted file mode 100644 index 551e755..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Acl/Expression/HasPermissionFunctionCompilerTest.php +++ /dev/null @@ -1,40 +0,0 @@ -compiler->compile(new FunctionExpression('hasPermission', - array(new VariableExpression('foo'), new ConstantExpression('VIEW')))); - - $this->assertContains( - "\$context['permission_evaluator']->hasPermission(\$context['token'], \$context['foo'], 'VIEW');", - $source); - } - - public function testCompileUpperCasesPermissions() - { - $source = $this->compiler->compile(new FunctionExpression('hasPermission', - array(new VariableExpression('foo'), new ConstantExpression('view')))); - - $this->assertContains( - "\$context['permission_evaluator']->hasPermission(\$context['token'], \$context['foo'], 'VIEW');", - $source); - } - - protected function setUp() - { - $this->compiler = new ExpressionCompiler(); - $this->compiler->addFunctionCompiler(new HasPermissionFunctionCompiler()); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Acl/Expression/PermissionEvaluatorTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Acl/Expression/PermissionEvaluatorTest.php deleted file mode 100644 index 880914b..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Acl/Expression/PermissionEvaluatorTest.php +++ /dev/null @@ -1,143 +0,0 @@ -permissionMap->expects($this->once()) - ->method('getMasks') - ->with('VIEW', $this->oid) - ->will($this->returnValue(array(1, 2, 3, 4))); - $this->sidStrategy->expects($this->once()) - ->method('getSecurityIdentities') - ->with($this->token) - ->will($this->returnValue(array($this->sid))); - - $this->provider->expects($this->once()) - ->method('findAcl') - ->with($this->oid) - ->will($this->returnValue($this->acl)); - - $this->acl->expects($this->once()) - ->method('isGranted') - ->with(array(1, 2, 3, 4), array($this->sid), false) - ->will($this->returnValue(true)); - - $this->assertTrue($this->evaluator->hasPermission($this->token, $this->oid, 'VIEW')); - } - - public function testHasPermissionReturnsFalseWhenNoMasksExist() - { - $this->permissionMap->expects($this->once()) - ->method('getMasks') - ->with('FOO', $this->object) - ->will($this->returnValue(null)); - - $this->assertFalse($this->evaluator->hasPermission($this->token, $this->object, 'FOO')); - } - - public function testHasPermissionWhenNoObjectIsGiven() - { - $this->permissionMap->expects($this->once()) - ->method('getMasks') - ->with('FOO', null) - ->will($this->returnValue(array(1))); - - $this->assertTrue($this->evaluator->hasPermission($this->token, null, 'FOO')); - } - - public function testHasPermissionWhenNoObjectIdentityIsAvailable() - { - $this->permissionMap->expects($this->once()) - ->method('getMasks') - ->with('FOO', $this->object) - ->will($this->returnValue(array(1))); - - $this->oidStrategy->expects($this->once()) - ->method('getObjectIdentity') - ->with($this->object) - ->will($this->returnValue(null)); - - $this->assertTrue($this->evaluator->hasPermission($this->token, $this->object, 'FOO')); - } - - public function testHasPermissionWhenAclIsNotFound() - { - $this->permissionMap->expects($this->once()) - ->method('getMasks') - ->with('FOO', $this->oid) - ->will($this->returnValue(array(1))); - - $this->sidStrategy->expects($this->once()) - ->method('getSecurityIdentities') - ->with($this->token) - ->will($this->returnValue(array($this->sid))); - - $this->provider->expects($this->once()) - ->method('findAcl') - ->with($this->oid) - ->will($this->throwException(new AclNotFoundException())); - - $this->assertFalse($this->evaluator->hasPermission($this->token, $this->oid, 'FOO')); - } - - public function testHasPermissionWhenAceIsNotFound() - { - $this->permissionMap->expects($this->once()) - ->method('getMasks') - ->with('FOO', $this->oid) - ->will($this->returnValue(array(1))); - - $this->sidStrategy->expects($this->once()) - ->method('getSecurityIdentities') - ->with($this->token) - ->will($this->returnValue(array($this->sid))); - - $this->provider->expects($this->once()) - ->method('findAcl') - ->with($this->oid) - ->will($this->returnValue($this->acl)); - - $this->acl->expects($this->once()) - ->method('isGranted') - ->with(array(1), array($this->sid)) - ->will($this->throwException(new NoAceFoundException())); - - $this->assertFalse($this->evaluator->hasPermission($this->token, $this->oid, 'FOO')); - } - - protected function setUp() - { - $this->token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - $this->oid = $this->getMock('Symfony\Component\Security\Acl\Model\ObjectIdentityInterface'); - $this->sid = $this->getMock('Symfony\Component\Security\Acl\Model\SecurityIdentityInterface'); - $this->acl = $this->getMock('Symfony\Component\Security\Acl\Model\AclInterface'); - $this->object = new \stdClass; - $this->provider = $this->getMock('Symfony\Component\Security\Acl\Model\AclProviderInterface'); - $this->oidStrategy = $this->getMock('Symfony\Component\Security\Acl\Model\ObjectIdentityRetrievalStrategyInterface'); - $this->sidStrategy = $this->getMock('Symfony\Component\Security\Acl\Model\SecurityIdentityRetrievalStrategyInterface'); - $this->permissionMap = $this->getMock('Symfony\Component\Security\Acl\Permission\PermissionMapInterface'); - $this->evaluator = new PermissionEvaluator($this->provider, $this->oidStrategy, $this->sidStrategy, $this->permissionMap); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Acl/Voter/AclVoterTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Acl/Voter/AclVoterTest.php deleted file mode 100644 index 16f2301..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Acl/Voter/AclVoterTest.php +++ /dev/null @@ -1,396 +0,0 @@ -getVoter(); - - $permissionMap - ->expects($this->once()) - ->method('contains') - ->with($this->identicalTo($attribute)) - ->will($this->returnValue($supported)) - ; - - $this->assertSame($supported, $voter->supportsAttribute($attribute)); - } - - public function getSupportsAttributeTests() - { - return array( - array('foo', true), - array('foo', false), - ); - } - - /** - * @dataProvider getSupportsClassTests - */ - public function testSupportsClass($class) - { - list($voter,,,,) = $this->getVoter(); - - $this->assertTrue($voter->supportsClass($class)); - } - - public function getSupportsClassTests() - { - return array( - array('foo'), - array('bar'), - array('moo'), - ); - } - - public function testVote() - { - list($voter,, $permissionMap,,) = $this->getVoter(); - $permissionMap - ->expects($this->atLeastOnce()) - ->method('getMasks') - ->will($this->returnValue(null)) - ; - - $this->assertSame(VoterInterface::ACCESS_ABSTAIN, $voter->vote($this->getToken(), null, array('VIEW', 'EDIT', 'DELETE'))); - } - - /** - * @dataProvider getTrueFalseTests - */ - public function testVoteWhenNoObjectIsPassed($allowIfObjectIdentityUnavailable) - { - list($voter,, $permissionMap,,) = $this->getVoter($allowIfObjectIdentityUnavailable); - $permissionMap - ->expects($this->once()) - ->method('getMasks') - ->will($this->returnValue(array())) - ; - - if ($allowIfObjectIdentityUnavailable) { - $vote = VoterInterface::ACCESS_GRANTED; - } else { - $vote = VoterInterface::ACCESS_ABSTAIN; - } - - $this->assertSame($vote, $voter->vote($this->getToken(), null, array('VIEW'))); - } - - /** - * @dataProvider getTrueFalseTests - */ - public function testVoteWhenOidStrategyReturnsNull($allowIfUnavailable) - { - list($voter,, $permissionMap, $oidStrategy,) = $this->getVoter($allowIfUnavailable); - $permissionMap - ->expects($this->once()) - ->method('getMasks') - ->will($this->returnValue(array())) - ; - - $oidStrategy - ->expects($this->once()) - ->method('getObjectIdentity') - ->will($this->returnValue(null)) - ; - - if ($allowIfUnavailable) { - $vote = VoterInterface::ACCESS_GRANTED; - } else { - $vote = VoterInterface::ACCESS_ABSTAIN; - } - - $this->assertSame($vote, $voter->vote($this->getToken(), new \stdClass(), array('VIEW'))); - } - - public function getTrueFalseTests() - { - return array(array(true), array(false)); - } - - public function testVoteNoAclFound() - { - list($voter, $provider, $permissionMap, $oidStrategy, $sidStrategy) = $this->getVoter(); - - $permissionMap - ->expects($this->once()) - ->method('getMasks') - ->will($this->returnValue(array())) - ; - - $oidStrategy - ->expects($this->once()) - ->method('getObjectIdentity') - ->will($this->returnValue($oid = new ObjectIdentity('1', 'Foo'))) - ; - - $sidStrategy - ->expects($this->once()) - ->method('getSecurityIdentities') - ->will($this->returnValue($sids = array(new UserSecurityIdentity('johannes', 'Foo'), new RoleSecurityIdentity('ROLE_FOO')))) - ; - - $provider - ->expects($this->once()) - ->method('findAcl') - ->with($this->equalTo($oid), $this->equalTo($sids)) - ->will($this->throwException(new AclNotFoundException('Not found.'))) - ; - - $this->assertSame(VoterInterface::ACCESS_DENIED, $voter->vote($this->getToken(), new \stdClass(), array('VIEW'))); - } - - /** - * @dataProvider getTrueFalseTests - */ - public function testVoteGrantsAccess($grant) - { - list($voter, $provider, $permissionMap, $oidStrategy, $sidStrategy) = $this->getVoter(); - - $permissionMap - ->expects($this->once()) - ->method('getMasks') - ->with($this->equalTo('VIEW')) - ->will($this->returnValue($masks = array(1, 2, 3))) - ; - - $oidStrategy - ->expects($this->once()) - ->method('getObjectIdentity') - ->will($this->returnValue($oid = new ObjectIdentity('1', 'Foo'))) - ; - - $sidStrategy - ->expects($this->once()) - ->method('getSecurityIdentities') - ->will($this->returnValue($sids = array(new UserSecurityIdentity('johannes', 'Foo'), new RoleSecurityIdentity('ROLE_FOO')))) - ; - - $provider - ->expects($this->once()) - ->method('findAcl') - ->with($this->equalTo($oid), $this->equalTo($sids)) - ->will($this->returnValue($acl = $this->getMock('Symfony\Component\Security\Acl\Model\AclInterface'))) - ; - - $acl - ->expects($this->once()) - ->method('isGranted') - ->with($this->identicalTo($masks), $this->equalTo($sids), $this->isFalse()) - ->will($this->returnValue($grant)) - ; - - if ($grant) { - $vote = VoterInterface::ACCESS_GRANTED; - } else { - $vote = VoterInterface::ACCESS_DENIED; - } - - $this->assertSame($vote, $voter->vote($this->getToken(), new \stdClass(), array('VIEW'))); - } - - public function testVoteNoAceFound() - { - list($voter, $provider, $permissionMap, $oidStrategy, $sidStrategy) = $this->getVoter(); - - $permissionMap - ->expects($this->once()) - ->method('getMasks') - ->with($this->equalTo('VIEW')) - ->will($this->returnValue($masks = array(1, 2, 3))) - ; - - $oidStrategy - ->expects($this->once()) - ->method('getObjectIdentity') - ->will($this->returnValue($oid = new ObjectIdentity('1', 'Foo'))) - ; - - $sidStrategy - ->expects($this->once()) - ->method('getSecurityIdentities') - ->will($this->returnValue($sids = array(new UserSecurityIdentity('johannes', 'Foo'), new RoleSecurityIdentity('ROLE_FOO')))) - ; - - $provider - ->expects($this->once()) - ->method('findAcl') - ->with($this->equalTo($oid), $this->equalTo($sids)) - ->will($this->returnValue($acl = $this->getMock('Symfony\Component\Security\Acl\Model\AclInterface'))) - ; - - $acl - ->expects($this->once()) - ->method('isGranted') - ->with($this->identicalTo($masks), $this->equalTo($sids), $this->isFalse()) - ->will($this->throwException(new NoAceFoundException('No ACE'))) - ; - - $this->assertSame(VoterInterface::ACCESS_DENIED, $voter->vote($this->getToken(), new \stdClass(), array('VIEW'))); - } - - /** - * @dataProvider getTrueFalseTests - */ - public function testVoteGrantsFieldAccess($grant) - { - list($voter, $provider, $permissionMap, $oidStrategy, $sidStrategy) = $this->getVoter(); - - $permissionMap - ->expects($this->once()) - ->method('getMasks') - ->with($this->equalTo('VIEW')) - ->will($this->returnValue($masks = array(1, 2, 3))) - ; - - $oidStrategy - ->expects($this->once()) - ->method('getObjectIdentity') - ->will($this->returnValue($oid = new ObjectIdentity('1', 'Foo'))) - ; - - $sidStrategy - ->expects($this->once()) - ->method('getSecurityIdentities') - ->will($this->returnValue($sids = array(new UserSecurityIdentity('johannes', 'Foo'), new RoleSecurityIdentity('ROLE_FOO')))) - ; - - $provider - ->expects($this->once()) - ->method('findAcl') - ->with($this->equalTo($oid), $this->equalTo($sids)) - ->will($this->returnValue($acl = $this->getMock('Symfony\Component\Security\Acl\Model\AclInterface'))) - ; - - $acl - ->expects($this->once()) - ->method('isFieldGranted') - ->with($this->identicalTo('foo'), $this->identicalTo($masks), $this->equalTo($sids), $this->isFalse()) - ->will($this->returnValue($grant)) - ; - - if ($grant) { - $vote = VoterInterface::ACCESS_GRANTED; - } else { - $vote = VoterInterface::ACCESS_DENIED; - } - - $this->assertSame($vote, $voter->vote($this->getToken(), new FieldVote(new \stdClass(), 'foo'), array('VIEW'))); - } - - public function testVoteNoFieldAceFound() - { - list($voter, $provider, $permissionMap, $oidStrategy, $sidStrategy) = $this->getVoter(); - - $permissionMap - ->expects($this->once()) - ->method('getMasks') - ->with($this->equalTo('VIEW')) - ->will($this->returnValue($masks = array(1, 2, 3))) - ; - - $oidStrategy - ->expects($this->once()) - ->method('getObjectIdentity') - ->will($this->returnValue($oid = new ObjectIdentity('1', 'Foo'))) - ; - - $sidStrategy - ->expects($this->once()) - ->method('getSecurityIdentities') - ->will($this->returnValue($sids = array(new UserSecurityIdentity('johannes', 'Foo'), new RoleSecurityIdentity('ROLE_FOO')))) - ; - - $provider - ->expects($this->once()) - ->method('findAcl') - ->with($this->equalTo($oid), $this->equalTo($sids)) - ->will($this->returnValue($acl = $this->getMock('Symfony\Component\Security\Acl\Model\AclInterface'))) - ; - - $acl - ->expects($this->once()) - ->method('isFieldGranted') - ->with($this->identicalTo('foo'), $this->identicalTo($masks), $this->equalTo($sids), $this->isFalse()) - ->will($this->throwException(new NoAceFoundException('No ACE'))) - ; - - $this->assertSame(VoterInterface::ACCESS_DENIED, $voter->vote($this->getToken(), new FieldVote(new \stdClass(), 'foo'), array('VIEW'))); - } - - public function testWhenReceivingAnObjectIdentityInterfaceWeDontRetrieveANewObjectIdentity() - { - list($voter, $provider, $permissionMap, $oidStrategy, $sidStrategy) = $this->getVoter(); - - $oid = new ObjectIdentity('someID','someType'); - - $permissionMap - ->expects($this->once()) - ->method('getMasks') - ->with($this->equalTo('VIEW')) - ->will($this->returnValue($masks = array(1, 2, 3))) - ; - - $oidStrategy - ->expects($this->never()) - ->method('getObjectIdentity') - ; - - $sidStrategy - ->expects($this->once()) - ->method('getSecurityIdentities') - ->will($this->returnValue($sids = array(new UserSecurityIdentity('johannes', 'Foo'), new RoleSecurityIdentity('ROLE_FOO')))) - ; - - $provider - ->expects($this->once()) - ->method('findAcl') - ->with($this->equalTo($oid), $this->equalTo($sids)) - ->will($this->returnValue($acl = $this->getMock('Symfony\Component\Security\Acl\Model\AclInterface'))) - ; - - $acl - ->expects($this->once()) - ->method('isGranted') - ->with($this->identicalTo($masks), $this->equalTo($sids), $this->isFalse()) - ->will($this->throwException(new NoAceFoundException('No ACE'))) - ; - - $voter->vote($this->getToken(), $oid, array('VIEW')); - } - - protected function getToken() - { - return $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - } - - protected function getVoter($allowIfObjectIdentityUnavailable = true) - { - $provider = $this->getMock('Symfony\Component\Security\Acl\Model\AclProviderInterface'); - $permissionMap = $this->getMock('Symfony\Component\Security\Acl\Permission\PermissionMapInterface'); - $oidStrategy = $this->getMock('Symfony\Component\Security\Acl\Model\ObjectIdentityRetrievalStrategyInterface'); - $sidStrategy = $this->getMock('Symfony\Component\Security\Acl\Model\SecurityIdentityRetrievalStrategyInterface'); - - return array( - new AclVoter($provider, $oidStrategy, $sidStrategy, $permissionMap, null, $allowIfObjectIdentityUnavailable), - $provider, - $permissionMap, - $oidStrategy, - $sidStrategy, - ); - } -} diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authentication/Provider/RunAsAuthenticationProviderTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authentication/Provider/RunAsAuthenticationProviderTest.php deleted file mode 100644 index ddba3f7..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authentication/Provider/RunAsAuthenticationProviderTest.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Tests\Security\Authentication\Provider; - -use JMS\SecurityExtraBundle\Security\Authentication\Token\RunAsUserToken; - -use JMS\SecurityExtraBundle\Security\Authentication\Provider\RunAsAuthenticationProvider; - -class RunAsAuthenticationProviderTest extends \PHPUnit_Framework_TestCase -{ - public function testAuthenticateReturnsNullIfTokenISUnsupported() - { - $provider = new RunAsAuthenticationProvider('foo'); - $token = $this->GetMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - - $this->assertNull($provider->authenticate($token)); - } - - /** - * @expectedException Symfony\Component\Security\Core\Exception\BadCredentialsException - */ - public function testAuthenticateThrowsExceptionWhenKeysDontMatch() - { - $provider = new RunAsAuthenticationProvider('foo'); - $token = $this->getSupportedToken(); - $token - ->expects($this->once()) - ->method('getKey') - ->will($this->returnValue('moo')) - ; - - $provider->authenticate($token); - } - - public function testAuthenticate() - { - $provider = new RunAsAuthenticationProvider('foo'); - $token = $this->getSupportedToken(); - $token - ->expects($this->once()) - ->method('getKey') - ->will($this->returnValue('foo')) - ; - - $this->assertSame($token, $provider->authenticate($token)); - } - - public function testSupportsDoesNotAcceptInvalidToken() - { - $provider = new RunAsAuthenticationProvider('foo'); - $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - - $this->assertFalse($provider->supports($token)); - } - - public function testSupports() - { - $provider = new RunAsAuthenticationProvider('foo'); - - $token = $this->getSupportedToken(); - $this->assertTrue($provider->supports($token)); - } - - protected function getSupportedToken() - { - return $this->getMockBuilder('JMS\SecurityExtraBundle\Security\Authentication\Token\RunAsUserToken') - ->disableOriginalConstructor() - ->getMock(); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authentication/Token/RunAsUserTokenTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authentication/Token/RunAsUserTokenTest.php deleted file mode 100644 index 3c35ec2..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authentication/Token/RunAsUserTokenTest.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Tests\Security\Authentication\Token; - -use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; - -use Symfony\Component\Security\Core\Role\Role; -use JMS\SecurityExtraBundle\Security\Authentication\Token\RunAsUserToken; - -class RunAsUserTokenTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $user = $this->getMock('Symfony\Component\Security\Core\User\UserInterface'); - $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - - $runAsToken = new RunAsUserToken('foo', $user, 'secret', array('ROLE_FOO'), $token); - $this->assertSame($user, $runAsToken->getUser()); - $this->assertSame('secret', $runAsToken->getCredentials()); - $this->assertSame($token, $runAsToken->getOriginalToken()); - $this->assertEquals(array(new Role('ROLE_FOO')), $runAsToken->getRoles()); - $this->assertSame('foo', $runAsToken->getKey()); - } - - public function testEraseCredentials() - { - $token = new RunAsUserToken('foo', 'foo', 'secret', array(), $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')); - $this->assertEquals('secret', $token->getCredentials()); - $token->eraseCredentials(); - $this->assertNull($token->getCredentials()); - } - - public function testSerializeUnserialize() - { - $token = new RunAsUserToken('foo', 'bar', 'secret', array(), new UsernamePasswordToken('foo', 'pass', 'foo', array())); - $this->assertEquals($token, unserialize(serialize($token))); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/AfterInvocation/AclAfterInvocationProviderTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/AfterInvocation/AclAfterInvocationProviderTest.php deleted file mode 100644 index 4dc39d3..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/AfterInvocation/AclAfterInvocationProviderTest.php +++ /dev/null @@ -1,248 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Tests\Security\Authorization\AfterInvocation; - -use Symfony\Component\Security\Acl\Exception\NoAceFoundException; - -use Symfony\Component\Security\Acl\Exception\AclNotFoundException; -use Symfony\Component\Security\Acl\Domain\ObjectIdentity; -use JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AclAfterInvocationProvider; - -class AclAfterInvocationProviderTest extends \PHPUnit_Framework_TestCase -{ - public function testDecideReturnsNullWhenObjectIsNull() - { - $provider = new AclAfterInvocationProvider($this->getAclProvider(), $this->getOidStrategy(), $this->getSidStrategy(), $this->getPermissionMap()); - - $this->assertNull($provider->decide($this->getToken(), null, array(), null)); - } - - public function testDecideDoesNotModifyReturnedObjectWhenNoAttributeIsSupported() - { - $provider = new AclAfterInvocationProvider($this->getAclProvider(), $this->getOidStrategy(), $this->getSidStrategy(), $this->getPermissionMap()); - - $returnedObject = new \stdClass; - $this->assertSame($returnedObject, $provider->decide($this->getToken(), null, array('foo', 'moo'), $returnedObject)); - } - - public function testDecideDoesNotModifyReturnedObjectWhenNoObjectIdentityCanBeRetrieved() - { - $oidStrategy = $this->getOidStrategy(); - $oidStrategy - ->expects($this->once()) - ->method('getObjectIdentity') - ->will($this->returnValue(null)) - ; - - $permissionMap = $this->getPermissionMap(); - $permissionMap - ->expects($this->once()) - ->method('contains') - ->will($this->returnValue(true)) - ; - - $returnedObject = array('foo' => 'moo'); - $provider = new AclAfterInvocationProvider($this->getAclProvider(), $oidStrategy, $this->getSidStrategy(), $permissionMap); - $this->assertSame($returnedObject, $provider->decide($this->getToken(), null, array('foo'), $returnedObject)); - } - - /** - * @expectedException Symfony\Component\Security\Core\Exception\AccessDeniedException - */ - public function testDecideThrowsAccessDeniedExceptionWhenNoAclIsFound() - { - $oidStrategy = $this->getOidStrategy(); - $oidStrategy - ->expects($this->once()) - ->method('getObjectIdentity') - ->will($this->returnValue(new ObjectIdentity(1, 'foo'))) - ; - - $sidStrategy = $this->getSidStrategy(); - $sidStrategy - ->expects($this->once()) - ->method('getSecurityIdentities') - ->will($this->returnValue(array())) - ; - - $permissionMap = $this->getPermissionMap(); - $permissionMap - ->expects($this->once()) - ->method('contains') - ->will($this->returnValue(true)) - ; - - $aclProvider = $this->getAclProvider(); - $aclProvider - ->expects($this->once()) - ->method('findAcl') - ->will($this->throwException(new AclNotFoundException('No ACL'))) - ; - - $provider = new AclAfterInvocationProvider($aclProvider, $oidStrategy, $sidStrategy, $permissionMap); - $provider->decide($this->getToken(), null, array('foo'), 'foo'); - } - - /** - * @expectedException Symfony\Component\Security\Core\Exception\AccessDeniedException - */ - public function testDecideThrowsAccessDeniedExceptionWhenNoAceIsFound() - { - $masks = array(1, 3); - $permissionMap = $this->getPermissionMap(); - $permissionMap - ->expects($this->once()) - ->method('contains') - ->will($this->returnValue(true)) - ; - $permissionMap - ->expects($this->once()) - ->method('getMasks') - ->will($this->returnValue($masks)) - ; - - $acl = $this->getMock('Symfony\Component\Security\Acl\Model\AclInterface'); - $acl - ->expects($this->once()) - ->method('isGranted') - ->will($this->throwException(new NoAceFoundException('No ACE'))) - ; - - $aclProvider = $this->getAclProvider(); - $aclProvider - ->expects($this->once()) - ->method('findAcl') - ->will($this->returnValue($acl)) - ; - - $oidStrategy = $this->getOidStrategy(); - $oidStrategy - ->expects($this->once()) - ->method('getObjectIdentity') - ->will($this->returnValue(new ObjectIdentity(1, 'foo'))) - ; - - $sidStrategy = $this->getSidStrategy(); - $sidStrategy - ->expects($this->once()) - ->method('getSecurityIdentities') - ->will($this->returnValue(array('foo'))) - ; - - $provider = new AclAfterInvocationProvider($aclProvider, $oidStrategy, $sidStrategy, $permissionMap); - $provider->decide($this->getToken(), null, array('foo'), array('foo')); - } - - public function testDecide() - { - $masks = array(1, 3); - $permissionMap = $this->getPermissionMap(); - $permissionMap - ->expects($this->once()) - ->method('contains') - ->will($this->returnValue(true)) - ; - $permissionMap - ->expects($this->once()) - ->method('getMasks') - ->will($this->returnValue($masks)) - ; - - $acl = $this->getMock('Symfony\Component\Security\Acl\Model\AclInterface'); - $acl - ->expects($this->once()) - ->method('isGranted') - ->will($this->returnValue(true)) - ; - - $aclProvider = $this->getAclProvider(); - $aclProvider - ->expects($this->once()) - ->method('findAcl') - ->will($this->returnValue($acl)) - ; - - $oidStrategy = $this->getOidStrategy(); - $oidStrategy - ->expects($this->once()) - ->method('getObjectIdentity') - ->will($this->returnValue(new ObjectIdentity(1, 'foo'))) - ; - - $sidStrategy = $this->getSidStrategy(); - $sidStrategy - ->expects($this->once()) - ->method('getSecurityIdentities') - ->will($this->returnValue(array('foo'))) - ; - - $provider = new AclAfterInvocationProvider($aclProvider, $oidStrategy, $sidStrategy, $permissionMap); - $this->assertSame(array('foo'), $provider->decide($this->getToken(), null, array('foo'), array('foo'))); - } - - public function testSupportsAttribute() - { - $aclProvider = $this->getAclProvider(); - $oidStrategy = $this->getOidStrategy(); - $sidStrategy = $this->getSidStrategy(); - $permissionMap = $this->getPermissionMap(); - - $permissionMap - ->expects($this->at(0)) - ->method('contains') - ->with($this->equalTo('foo')) - ->will($this->returnValue(true)) - ; - $permissionMap - ->expects($this->at(1)) - ->method('contains') - ->with($this->equalTo('asdf')) - ->wilL($this->returnValue(false)) - ; - - $provider = new AclAfterInvocationProvider($aclProvider, $oidStrategy, $sidStrategy, $permissionMap); - $this->assertTrue($provider->supportsAttribute('foo')); - $this->assertFalse($provider->supportsAttribute('asdf')); - } - - protected function getToken() - { - return $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - } - - protected function getPermissionMap() - { - return $this->getMock('Symfony\Component\Security\Acl\Permission\PermissionMapInterface'); - } - - protected function getAclProvider() - { - return $this->getMock('Symfony\Component\Security\Acl\Model\AclProviderInterface'); - } - - protected function getOidStrategy() - { - return $this->getMock('Symfony\Component\Security\Acl\Model\ObjectIdentityRetrievalStrategyInterface'); - } - - protected function getSidStrategy() - { - return $this->getMock('Symfony\Component\Security\Acl\Model\SecurityIdentityRetrievalStrategyInterface'); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/AfterInvocation/AfterInvocationManagerTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/AfterInvocation/AfterInvocationManagerTest.php deleted file mode 100644 index fa88d0d..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/AfterInvocation/AfterInvocationManagerTest.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Tests\Security\Authorization\AfterInvocation; - -use JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AfterInvocationManager; - -class AfterInvocationManagerTest extends \PHPUnit_Framework_TestCase -{ - public function testDecide() - { - $attributes = array('FOO'); - - $provider1 = $this->getProvider(); - $provider1 - ->expects($this->once()) - ->method('decide') - ->with( - $this->isInstanceOf('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'), - $this->anything(), - $this->equalTo($attributes), - $this->equalTo('foo') - ) - ->will($this->returnValue('bar')) - ; - - $provider2 = $this->getProvider(); - $provider2 - ->expects($this->once()) - ->method('decide') - ->with( - $this->isInstanceOf('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'), - $this->anything(), - $this->equalTo($attributes), - $this->equalTo('bar') - ) - ->will($this->returnValue('moo')) - ; - - $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - - $manager = new AfterInvocationManager(array($provider1, $provider2)); - $this->assertEquals('moo', $manager->decide($token, 'sth', $attributes, 'foo')); - } - - /** - * @dataProvider getSupportsTests - */ - public function testSupportsAttribute($attribute, $supported) - { - $provider = $this->getProvider(); - $provider - ->expects($this->once()) - ->method('supportsAttribute') - ->with($this->equalTo($attribute)) - ->will($this->returnValue($supported)) - ; - - $manager = new AfterInvocationManager(array($provider)); - $this->assertSame($supported, $manager->supportsAttribute($attribute)); - } - - /** - * @dataProvider getSupportsTests - */ - public function testSupportsClass($class, $supported) - { - $provider = $this->getProvider(); - $provider - ->expects($this->once()) - ->method('supportsClass') - ->with($this->equalTo($class)) - ->will($this->returnValue($supported)) - ; - - $manager = new AfterInvocationManager(array($provider)); - $this->assertSame($supported, $manager->supportsClass($class)); - } - - public function getSupportsTests() - { - return array( - array('FOO', true), - array('BAR', false), - ); - } - - protected function getProvider() - { - return $this->getMock('JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AfterInvocationProviderInterface'); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/ExpressionCompilerTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/ExpressionCompilerTest.php deleted file mode 100644 index 925a72d..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/ExpressionCompilerTest.php +++ /dev/null @@ -1,150 +0,0 @@ -compiler->compileExpression(new Expression('isAnonymous()'))); - - $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - - $trustResolver = $this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface'); - $trustResolver->expects($this->once()) - ->method('isAnonymous') - ->with($token) - ->will($this->returnValue(true)); - - $context = array( - 'token' => $token, - 'trust_resolver' => $trustResolver, - ); - - $this->assertTrue($evaluator($context)); - } - - public function testCompileComplexExpression() - { - $evaluator = eval($this->compiler->compileExpression( - new Expression('hasRole("ADMIN") or hasAnyRole("FOO", "BAR")'))); - - $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - $token->expects($this->once()) - ->method('getRoles') - ->will($this->returnValue(array(new Role('FOO')))); - $this->assertTrue($evaluator(array('token' => $token))); - - $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - $token->expects($this->once()) - ->method('getRoles') - ->will($this->returnValue(array(new Role('BAZ')))); - $this->assertFalse($evaluator(array('token' => $token))); - } - - /** - * @dataProvider getPrecedenceTests - */ - public function testCompilePrecedence($expected, $a, $b, $c) - { - $evaluator = eval($this->compiler->compileExpression( - new Expression('A and (B or C)'))); - - $this->assertSame($expected, $evaluator(array('A' => $a, 'B' => $b, 'C' => $c))); - } - - public function getPrecedenceTests() - { - return array( - array(true, true, true, false), - array(true, true, true, true), - array(true, true, false, true), - array(false, true, false, false), - array(false, false, true, true), - array(false, false, true, false), - array(false, false, false, true), - array(false, false, false, false), - ); - } - - public function testCompileWhenParameterIsWrappedInMethodCall() - { - $this->compiler->addTypeCompiler(new ParameterExpressionCompiler()); - $this->compiler->addFunctionCompiler(new HasPermissionFunctionCompiler()); - - // the first call ensure that state is reset correctly - $this->compiler->compileExpression(new Expression( - 'hasPermission(#project.getCompany(), "OPERATOR")')); - $evaluator = eval($this->compiler->compileExpression( - new Expression('hasPermission(#project.getCompany(), "OPERATOR")'))); - - $secureObject = new SecuredObject(); - $project = new Project(); - $permissionEvaluator = $this->getMockBuilder('JMS\SecurityExtraBundle\Security\Acl\Expression\PermissionEvaluator') - ->disableOriginalConstructor() - ->getMock(); - $permissionEvaluator->expects($this->once()) - ->method('hasPermission') - ->will($this->returnValue(false)); - - $context = array( - 'token' => $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'), - 'object' => new MethodInvocation(new \ReflectionMethod($secureObject, 'delete'), $secureObject, array($project), array()), - 'permission_evaluator' => $permissionEvaluator, - ); - - $this->assertFalse($evaluator($context)); - } - - /** - * @dataProvider getUnaryNotTests - */ - public function testCompileWithUnaryOperator($roles, $expected) - { - $evaluator = eval($this->compiler->compileExpression(new Expression( - 'not hasRole("FOO") and !hasRole("BAR") and hasRole("BAZ")'))); - - $roles = array_map(function($v) { - return new Role($v); - }, $roles); - - $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - $token->expects($this->once()) - ->method('getRoles') - ->will($this->returnValue($roles)); - - $this->assertSame($expected, $evaluator(array('token' => $token))); - } - - public function getUnaryNotTests() - { - return array( - array(array('FOO'), false), - array(array(), false), - array(array('BAR'), false), - array(array('BAZ'), true), - array(array('FOO', 'BAR'), false), - array(array('FOO', 'BAZ'), false), - array(array('BAR', 'BAZ'), false), - ); - } - - protected function setUp() - { - $this->compiler = new ExpressionCompiler(); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/ExpressionLexerTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/ExpressionLexerTest.php deleted file mode 100644 index 34b87d0..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/ExpressionLexerTest.php +++ /dev/null @@ -1,27 +0,0 @@ -lexer->initialize('#contact'); - - $this->assertEquals(array( - 'type' => ExpressionLexer::T_PARAMETER, - 'value' => 'contact', - 'position' => 0, - ), $this->lexer->lookahead); - $this->assertFalse($this->lexer->next()); - } - - protected function setUp() - { - $this->lexer = new ExpressionLexer(); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/ExpressionParserTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/ExpressionParserTest.php deleted file mode 100644 index 3472470..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/ExpressionParserTest.php +++ /dev/null @@ -1,158 +0,0 @@ -assertEquals(new FunctionExpression('isAnonymous', array()), - $this->parser->parse('isAnonymous()')); - } - - public function testSingleFunctionWithOneArgument() - { - $this->assertEquals(new FunctionExpression('hasRole', array( - new ConstantExpression('ROLE_ADMIN'))), - $this->parser->parse('hasRole("ROLE_ADMIN")')); - } - - public function testSingleFunctionWithMultipleArguments() - { - $this->assertEquals(new FunctionExpression('hasAnyRole', array( - new ConstantExpression('FOO'), new ConstantExpression('BAR'))), - $this->parser->parse('hasAnyRole("FOO", "BAR",)')); - } - - public function testComplexFunctionExpression() - { - $expected = new OrExpression(new FunctionExpression('hasRole', array( - new ConstantExpression('ADMIN'))), - new FunctionExpression('hasAnyRole', array(new ConstantExpression('FOO'), - new ConstantExpression('BAR')))); - - $this->assertEquals($expected, $this->parser->parse('hasRole("ADMIN") or hasAnyRole("FOO", "BAR")')); - } - - public function testAnd() - { - $expected = new AndExpression( - new FunctionExpression('isAnonymous', array()), - new FunctionExpression('hasRole', array(new ConstantExpression('FOO')))); - - $this->assertEquals($expected, $this->parser->parse('isAnonymous() && hasRole("FOO")')); - $this->assertEquals($expected, $this->parser->parse('isAnonymous() and hasRole("FOO")')); - } - - /** - * @dataProvider getPrecedenceTests - */ - public function testPrecendence($expected, $expr) - { - $this->assertEquals($expected, $this->parser->parse($expr)); - } - - public function getPrecedenceTests() - { - $tests = array(); - - $expected = new OrExpression( - new AndExpression(new VariableExpression('A'), new VariableExpression('B')), - new VariableExpression('C') - ); - $tests[] = array($expected, 'A && B || C'); - $tests[] = array($expected, '(A && B) || C'); - - $expected = new OrExpression( - new VariableExpression('C'), - new AndExpression(new VariableExpression('A'), new VariableExpression('B')) - ); - $tests[] = array($expected, 'C || A && B'); - $tests[] = array($expected, 'C || (A && B)'); - - $expected = new AndExpression( - new AndExpression(new VariableExpression('A'), new VariableExpression('B')), - new VariableExpression('C') - ); - $tests[] = array($expected, 'A && B && C'); - - $expected = new AndExpression( - new VariableExpression('A'), - new OrExpression(new VariableExpression('B'), new VariableExpression('C')) - ); - $tests[] = array($expected, 'A && (B || C)'); - - return $tests; - } - - public function testGetProperty() - { - $expected = new GetPropertyExpression(new VariableExpression('A'), 'foo'); - $this->assertEquals($expected, $this->parser->parse('A.foo')); - } - - public function testMethodCall() - { - $expected = new MethodCallExpression(new VariableExpression('A'), 'foo', array()); - $this->assertEquals($expected, $this->parser->parse('A.foo()')); - } - - public function testArray() - { - $expected = new ArrayExpression(array( - 'foo' => new ConstantExpression('bar'), - )); - $this->assertEquals($expected, $this->parser->parse('{"foo":"bar",}')); - $this->assertEquals($expected, $this->parser->parse('{"foo":"bar"}')); - - $expected = new ArrayExpression(array( - new ConstantExpression('foo'), - new ConstantExpression('bar'), - )); - $this->assertEquals($expected, $this->parser->parse('["foo","bar",]')); - $this->assertEquals($expected, $this->parser->parse('["foo","bar"]')); - } - - public function testGetItem() - { - $expected = new GetItemExpression( - new GetPropertyExpression(new VariableExpression('A'), 'foo'), - new ConstantExpression('foo') - ); - $this->assertEquals($expected, $this->parser->parse('A.foo["foo"]')); - } - - public function testParameter() - { - $expected = new ParameterExpression('contact'); - $this->assertEquals($expected, $this->parser->parse('#contact')); - } - - public function testIsEqual() - { - $expected = new IsEqualExpression(new MethodCallExpression( - new VariableExpression('user'), 'getUsername', array()), - new ConstantExpression('Johannes')); - $this->assertEquals($expected, $this->parser->parse('user.getUsername() == "Johannes"')); - } - - protected function setUp() - { - $this->parser = new ExpressionParser; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/ExpressionVoterTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/ExpressionVoterTest.php deleted file mode 100644 index e162b34..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/ExpressionVoterTest.php +++ /dev/null @@ -1,113 +0,0 @@ -voter->setCacheDir(null); - - $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - $token->expects($this->once()) - ->method('getRoles') - ->will($this->returnValue(array(new Role('ROLE_FOO')))); - - $this->assertSame(VoterInterface::ACCESS_GRANTED, $this->voter->vote( - $token, - new \stdClass, - array(new Expression('hasRole("ROLE_FOO")')) - )); - } - - /** - * @dataProvider getVoteTests - */ - public function testVote($token, $object, array $attributes, $expected) - { - $this->assertSame($expected, $this->voter->vote($token, $object, $attributes)); - } - - public function getVoteTests() - { - $tests = array(); - - $tests[] = array( - $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'), - new \stdClass(), - array('ROLE_FOO'), - VoterInterface::ACCESS_ABSTAIN, - ); - - $tests[] = array( - $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\AnonymousToken') - ->disableOriginalConstructor()->getMock(), - new \stdClass(), - array(new Expression('isAnonymous()')), - VoterInterface::ACCESS_GRANTED, - ); - - $tests[] = array( - $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\AnonymousToken') - ->disableOriginalConstructor()->getMock(), - new \stdClass(), - array(new Expression('isAuthenticated()')), - VoterInterface::ACCESS_DENIED, - ); - - return $tests; - } - - public function testSupportsAttribute() - { - $this->assertFalse($this->voter->supportsAttribute('ROLE_FOO')); - $this->assertFalse($this->voter->supportsAttribute('A')); - $this->assertTrue($this->voter->supportsAttribute(new Expression('A'))); - } - - public function testSupportsClass() - { - $this->assertTrue($this->voter->supportsClass('stdClass')); - } - - protected function setUp() - { - $handler = new DefaultExpressionHandler(new AuthenticationTrustResolver( - 'Symfony\Component\Security\Core\Authentication\Token\AnonymousToken', - 'Symfony\Component\Security\Core\Authentication\Token\RememberMeToken')); - - $this->voter = new ExpressionVoter($handler); - $this->voter->setCompiler(new ExpressionCompiler()); - - $this->fs = new Filesystem(); - $this->cacheDir = sys_get_temp_dir().'/'.uniqid('expression_voter', true); - - if (is_dir($this->cacheDir)) { - $this->fs->remove($this->cacheDir); - } - - if (false === @mkdir($this->cacheDir, 0777, true)) { - throw new \RuntimeException(sprintf('Could not create cache dir "%s".', $this->cacheDir)); - } - } - - protected function tearDown() - { - if (null !== $this->fs) { - $this->fs->remove($this->cacheDir); - } - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/Fixture/Issue22/Project.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/Fixture/Issue22/Project.php deleted file mode 100644 index ffacf2f..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/Fixture/Issue22/Project.php +++ /dev/null @@ -1,18 +0,0 @@ -company = new \stdClass; - } - - public function getCompany() - { - return $this->company; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/Fixture/Issue22/SecuredObject.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/Fixture/Issue22/SecuredObject.php deleted file mode 100644 index 027c610..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Expression/Fixture/Issue22/SecuredObject.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Tests\Security\Authorization\Expression; - -use CG\Proxy\MethodInvocation; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Expression; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\ParameterExpressionCompiler; -use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler; - -class ParameterExpressionCompilerTest extends \PHPUnit_Framework_TestCase -{ - private $compiler; - - public function testCompile() - { - $evaluator = eval($source = $this->compiler->compileExpression(new Expression( - '#foo == "bar"'))); - - $object = new ParameterAccessTest; - $reflection = new \ReflectionMethod($object, 'secure'); - $invocation = new MethodInvocation($reflection, $object, array('bar'), array()); - $this->assertTrue($evaluator(array('object' => $invocation))); - - $invocation->arguments = array('foo'); - $this->assertFalse($evaluator(array('object' => $invocation))); - } - - /** - * @expectedException \RuntimeException - */ - public function testCompileThrowsExceptionWhenNoMethodInvocation() - { - $evaluator = eval($this->compiler->compileExpression(new Expression( - '#foo == "fofo"'))); - - $evaluator(array('object' => new \stdClass)); - } - - protected function setUp() - { - $this->compiler = new ExpressionCompiler(); - $this->compiler->addTypeCompiler(new ParameterExpressionCompiler()); - } -} - -class ParameterAccessTest -{ - public function secure($foo) - { - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Interception/MethodSecurityInterceptorTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Interception/MethodSecurityInterceptorTest.php deleted file mode 100644 index e6634b3..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Interception/MethodSecurityInterceptorTest.php +++ /dev/null @@ -1,314 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace JMS\SecurityExtraBundle\Tests\Security\Authorization\Interception; - -use JMS\SecurityExtraBundle\Exception\RuntimeException; -use JMS\SecurityExtraBundle\Metadata\MethodMetadata; - -use JMS\SecurityExtraBundle\Metadata\ClassMetadata; - -use Metadata\MetadataFactoryInterface; - -use JMS\SecurityExtraBundle\Security\Authentication\Token\RunAsUserToken; -use Symfony\Component\Security\Core\Exception\AuthenticationException; -use JMS\SecurityExtraBundle\Security\Authorization\Interception\MethodSecurityInterceptor; -use CG\Proxy\MethodInvocation; - -class MethodSecurityInterceptorTest extends \PHPUnit_Framework_TestCase -{ - /** - * @expectedException Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException - */ - public function testInvokeThrowsExceptionWhenSecurityContextHasNoToken() - { - list($interceptor, $securityContext,,,,) = $this->getInterceptor(); - - $securityContext - ->expects($this->once()) - ->method('getToken') - ->will($this->returnValue(null)) - ; - - $this->getInvocation($interceptor)->proceed(); - } - - /** - * @expectedException Symfony\Component\Security\Core\Exception\AuthenticationException - */ - public function testInvokeAuthenticatesTokenIfItIsNotYetAuthenticated() - { - list($interceptor, $securityContext, $authManager,,,) = $this->getInterceptor(); - - $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - $token - ->expects($this->once()) - ->method('isAuthenticated') - ->will($this->returnValue(false)) - ; - - $securityContext - ->expects($this->once()) - ->method('getToken') - ->will($this->returnValue($token)) - ; - - $authManager - ->expects($this->once()) - ->method('authenticate') - ->will($this->throwException(new AuthenticationException('Could not authenticate.'))) - ; - - $this->getInvocation($interceptor)->proceed(); - } - - /** - * @expectedException Symfony\Component\Security\Core\Exception\AuthenticationException - */ - public function testInvokeAuthenticatesTokenIfAlwaysAuthenticateIsTrue() - { - list($interceptor, $securityContext, $authManager,,,) = $this->getInterceptor(); - - $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - - $securityContext - ->expects($this->once()) - ->method('getToken') - ->will($this->returnValue($token)) - ; - - $authManager - ->expects($this->once()) - ->method('authenticate') - ->will($this->throwException(new AuthenticationException('Could not authenticate.'))) - ; - - $invocation = $this->getInvocation($interceptor); - $interceptor->setAlwaysAuthenticate(true); - - $invocation->proceed(); - } - - /** - * @expectedException Symfony\Component\Security\Core\Exception\AccessDeniedException - */ - public function testInvokeCallsADMForRolesAndThrowsExceptionWhenInsufficientPriviledges() - { - $factory = $this->getMock('Metadata\MetadataFactoryInterface'); - $metadata = new ClassMetadata('JMS\SecurityExtraBundle\Tests\Security\Authorization\Interception\SecureService'); - $metadata->methodMetadata['foo'] = new MethodMetadata('JMS\SecurityExtraBundle\Tests\Security\Authorization\Interception\SecureService', 'foo'); - $metadata->methodMetadata['foo']->roles = array('ROLE_FOO'); - $factory - ->expects($this->once()) - ->method('getMetadataForClass') - ->with($this->equalTo($metadata->reflection->name)) - ->will($this->returnValue($metadata)) - ; - - list($interceptor, $context, $authManager, $adm,,) = $this->getInterceptor($factory); - - $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - $token - ->expects($this->once()) - ->method('isAuthenticated') - ->will($this->returnValue(false)) - ; - - $context - ->expects($this->once()) - ->method('getToken') - ->will($this->returnValue($token)) - ; - $context - ->expects($this->once()) - ->method('setToken') - ->with($this->equalTo($token)) - ; - - $authManager - ->expects($this->once()) - ->method('authenticate') - ->will($this->returnValue($token)) - ; - - $invocation = $this->getInvocation($interceptor); - $adm - ->expects($this->once()) - ->method('decide') - ->with($this->equalTo($token), $this->equalTo(array('ROLE_FOO')), $this->equalTo($invocation)) - ->will($this->returnValue(false)) - ; - - $invocation->proceed(); - } - - /** - * @expectedException Symfony\Component\Security\Core\Exception\AccessDeniedException - */ - public function testInvokeCallsADMForEachParamPermissionsAndThrowsExceptionOnInsufficientPermissions() - { - $factory = $this->getMock('Metadata\MetadataFactoryInterface'); - $metadata = new ClassMetadata('JMS\SecurityExtraBundle\Tests\Security\Authorization\Interception\SecureService'); - $metadata->methodMetadata['foo'] = new MethodMetadata('JMS\SecurityExtraBundle\Tests\Security\Authorization\Interception\SecureService', 'foo'); - $metadata->methodMetadata['foo']->paramPermissions = array( - $p0 = array('ROLE_FOO', 'ROLE_ASDF'), - $p1 = array('ROLE_MOO'), - ); - $factory - ->expects($this->once()) - ->method('getMetadataForClass') - ->with($this->equalTo($metadata->reflection->name)) - ->will($this->returnValue($metadata)) - ; - - list($interceptor, $context,, $adm,,) = $this->getInterceptor($factory); - - $context - ->expects($this->once()) - ->method('getToken') - ->will($this->returnValue($token = $this->getToken())) - ; - - $invocation = $this->getInvocation($interceptor); - $adm - ->expects($this->at(0)) - ->method('decide') - ->with($this->equalTo($token), $this->equalTo($p0), $this->equalTo(new \stdClass())) - ->will($this->returnValue(true)) - ; - $adm - ->expects($this->at(1)) - ->method('decide') - ->with($this->equalTo($token), $this->equalTo($p1), $this->equalTo(new \stdClass())) - ->will($this->returnValue(false)) - ; - - $invocation->proceed(); - } - - /** - * @expectedException \RuntimeException - */ - public function testInvokehandlesExceptionsFromWithintheInvokedMethodGracefully() - { - $factory = $this->getMock('Metadata\MetadataFactoryInterface'); - $metadata = new ClassMetadata('JMS\SecurityExtraBundle\Tests\Security\Authorization\Interception\SecureService'); - $metadata->methodMetadata['throwException'] = new MethodMetadata('JMS\SecurityExtraBundle\Tests\Security\Authorization\Interception\SecureService', 'foo'); - $metadata->methodMetadata['throwException']->runAsRoles = array('ROLE_FOO'); - $factory - ->expects($this->once()) - ->method('getMetadataForClass') - ->with($this->equalTo($metadata->reflection->name)) - ->will($this->returnValue($metadata)) - ; - - list($interceptor, $context,,,, $runAsManager) = $this->getInterceptor($factory); - $invocation = $this->getInvocation($interceptor, 'throwException'); - - $token = $this->getToken(); - $context - ->expects($this->once()) - ->method('getToken') - ->will($this->returnValue($token)) - ; - - $runAsToken = new RunAsUserToken('asdf', 'user', 'foo', array('ROLE_FOO'), $token); - $runAsManager - ->expects($this->once()) - ->method('buildRunAs') - ->will($this->returnValue($runAsToken)) - ; - - $context - ->expects($this->exactly(2)) - ->method('setToken') - ; - - $invocation->proceed(); - } - - protected function getToken($isAuthenticated = true) - { - $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); - $token - ->expects($this->once()) - ->method('isAuthenticated') - ->will($this->returnValue($isAuthenticated)) - ; - - return $token; - } - - protected function getInterceptor(MetadataFactoryInterface $metadataFactory = null) - { - if (null === $metadataFactory) { - $metadataFactory = $this->getMock('Metadata\MetadataFactoryInterface'); - - $metadata = new ClassMetadata('JMS\SecurityExtraBundle\Tests\Security\Authorization\Interception\SecureService'); - $metadata->methodMetadata['foo'] = new MethodMetadata('JMS\SecurityExtraBundle\Tests\Security\Authorization\Interception\SecureService', 'foo'); - - $metadataFactory - ->expects($this->once()) - ->method('getMetadataForClass') - ->with($this->equalTo('JMS\SecurityExtraBundle\Tests\Security\Authorization\Interception\SecureService')) - ->will($this->returnValue($metadata)) - ; - } - - $securityContext = $this->getMockBuilder('Symfony\Component\Security\Core\SecurityContext') - ->disableOriginalConstructor() - ->getMock(); - - $authenticationManager = $this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface'); - $accessDecisionManager = $this->getMock('Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface'); - $afterInvocationManager = $this->getMock('JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AfterInvocationManagerInterface'); - $runAsManager = $this->getMock('JMS\SecurityExtraBundle\Security\Authorization\RunAsManagerInterface'); - - return array( - new MethodSecurityInterceptor($securityContext, $authenticationManager, $accessDecisionManager, $afterInvocationManager, $runAsManager, $metadataFactory), - $securityContext, - $authenticationManager, - $accessDecisionManager, - $afterInvocationManager, - $runAsManager, - ); - } - - protected function getInvocation(MethodSecurityInterceptor $interceptor, $method = 'foo', $arguments = array()) - { - if ('foo' === $method && 0 === count($arguments)) { - $arguments = array(new \stdClass(), new \stdClass()); - } - $object = new SecureService(); - - return new MethodInvocation(new \ReflectionMethod($object, $method), $object, $arguments, array($interceptor)); - } -} - -class SecureService -{ - public function foo($param, $other) - { - return $param; - } - - public function throwException() - { - throw new RuntimeException; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Interception/SecurityPointcutTest.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Interception/SecurityPointcutTest.php deleted file mode 100644 index b275568..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Tests/Security/Authorization/Interception/SecurityPointcutTest.php +++ /dev/null @@ -1,34 +0,0 @@ -metadataFactory, false, array( - 'Foo::bar' => 'foo', - 'login$' => 'foo', - )); - - $this->assertTrue($pointcut->matchesClass(new \ReflectionClass('stdClass'))); - } - - public function testMatchesClassReturnsFalseForControllerNotation() - { - $pointcut = new SecurityPointcut($this->metadataFactory, false, array( - 'AcmeFooBundle:Foo:foo' => 'foo', - )); - - $this->assertFalse($pointcut->matchesClass(new \ReflectionClass('stdClass'))); - } - - protected function setUp() - { - $this->metadataFactory = $this->getMock('Metadata\MetadataFactoryInterface'); - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Twig/SecurityExtension.php b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Twig/SecurityExtension.php deleted file mode 100644 index 21ad8aa..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/Twig/SecurityExtension.php +++ /dev/null @@ -1,35 +0,0 @@ -context = $context; - } - - public function getFunctions() - { - return array( - 'is_expr_granted' => new \Twig_Function_Method($this, 'isExprGranted', array( - 'is_safe' => true, - )), - ); - } - - public function isExprGranted($expr, $object = null) - { - return $this->context->isGranted(array(new Expression($expr)), $object); - } - - public function getName() - { - return 'jms_security_extra'; - } -} \ No newline at end of file diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/composer.json b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/composer.json deleted file mode 100644 index 00e4113..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/composer.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "jms/security-extra-bundle", - "description": "Enhances the Symfony2 Security Component by adding several new features", - "keywords": ["annotations","authorization"], - "type": "symfony-bundle", - "license": "Apache", - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "require": { - "symfony/framework-bundle": "2.*", - "jms/metadata": "1.1.*", - "jms/aop-bundle": "1.0.*" - }, - "recommend": { - "jms/di-extra-bundle": "1.0.*" - }, - "autoload": { - "psr-0": { "JMS\\SecurityExtraBundle": "" } - }, - "target-dir": "JMS/SecurityExtraBundle" -} diff --git a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/phpunit.xml.dist b/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/phpunit.xml.dist deleted file mode 100644 index e57dcda..0000000 --- a/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/schmittjoh-JMSSecurityExtraBundle-3730eb1/phpunit.xml.dist +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - ./Tests - - - diff --git a/vendor/kriswallsmith/assetic/.gitignore b/vendor/kriswallsmith/assetic/.gitignore deleted file mode 100644 index 192c9c6..0000000 --- a/vendor/kriswallsmith/assetic/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -phpunit.xml -vendor/ -composer.phar -composer.lock diff --git a/vendor/kriswallsmith/assetic/.travis.yml b/vendor/kriswallsmith/assetic/.travis.yml deleted file mode 100644 index a801b15..0000000 --- a/vendor/kriswallsmith/assetic/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: php - -php: - - 5.3 - - 5.4 - -before_script: - - wget http://getcomposer.org/composer.phar - - php composer.phar install --dev - - git clone https://github.com/kamicane/packager.git vendor/packager --quiet --depth 1 - - git clone https://github.com/leafo/lessphp.git vendor/lessphp --quiet --depth 1 - - git clone https://github.com/mrclay/minify.git vendor/minify --quiet --depth 1 - - svn checkout http://cssmin.googlecode.com/svn/trunk/ vendor/cssmin --quiet - - wget --quiet -O javascript-packer.zip "http://joliclic.free.fr/php/javascript-packer/telechargement.php?id=2&action=telecharger" && mkdir -p vendor/packer && unzip -qq javascript-packer.zip -d vendor/packer; rm javascript-packer.zip - -script: phpunit --configuration phpunit.travis.xml diff --git a/vendor/kriswallsmith/assetic/CHANGELOG-1.0.md b/vendor/kriswallsmith/assetic/CHANGELOG-1.0.md deleted file mode 100644 index 91bb9bf..0000000 --- a/vendor/kriswallsmith/assetic/CHANGELOG-1.0.md +++ /dev/null @@ -1,29 +0,0 @@ -1.0.3 (March 2, 2012) ---------------------- - - * Added "boring" option to Compass filter - * Fixed accumulation of load paths in Compass filter - * Fixed issues in CssImport and CssRewrite filters - -1.0.2 (August 26, 2011) ------------------------ - - * Twig 1.2 compatibility - * Fixed filtering of large LessCSS assets - * Fixed escaping of commands on Windows - * Misc fixes to Compass filter - * Removed default CssEmbed charset - -1.0.1 (July 15, 2011) ---------------------- - - * Fixed Twig error handling - * Removed use of STDIN - * Added inheritance of environment variables - * Fixed Compass on Windows - * Improved escaping of commands - -1.0.0 (July 10, 2011) ---------------------- - - * Initial release diff --git a/vendor/kriswallsmith/assetic/CHANGELOG-1.1.md b/vendor/kriswallsmith/assetic/CHANGELOG-1.1.md deleted file mode 100755 index 48ed70d..0000000 --- a/vendor/kriswallsmith/assetic/CHANGELOG-1.1.md +++ /dev/null @@ -1,9 +0,0 @@ -1.1.0 (???) ---------------------- - - * Added the UglifyJsFilter - * added support for asset variables: - - Asset variables allow you to pre-compile your assets for a finite set of known - variable values, and then to simply deliver the correct asset version at runtime. - For example, this is helpful for assets with language, or browser-specific code. diff --git a/vendor/kriswallsmith/assetic/LICENSE b/vendor/kriswallsmith/assetic/LICENSE deleted file mode 100644 index 1060e5b..0000000 --- a/vendor/kriswallsmith/assetic/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010-2012 OpenSky Project Inc - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/kriswallsmith/assetic/README.md b/vendor/kriswallsmith/assetic/README.md deleted file mode 100644 index e12e341..0000000 --- a/vendor/kriswallsmith/assetic/README.md +++ /dev/null @@ -1,284 +0,0 @@ -# Assetic ![project status](http://stillmaintained.com/kriswallsmith/assetic.png) # - -Assetic is an asset management framework for PHP. - -``` php -dump(); -``` - -Assets ------- - -An Assetic asset is something with filterable content that can be loaded and -dumped. An asset also includes metadata, some of which can be manipulated and -some of which is immutable. - -| **Property** | **Accessor** | **Mutator** | -|--------------|-----------------|---------------| -| content | getContent | setContent | -| mtime | getLastModified | n/a | -| source root | getSourceRoot | n/a | -| source path | getSourcePath | n/a | -| target path | getTargetPath | setTargetPath | - -Filters -------- - -Filters can be applied to manipulate assets. - -``` php -dump(); -``` - -The filters applied to the collection will cascade to each asset leaf if you -iterate over it. - -``` php -dump(); -} -``` - -The core provides the following filters in the `Assetic\Filter` namespace: - - * `CoffeeScriptFilter`: compiles CoffeeScript into Javascript - * `CssEmbedFilter`: embeds image data in your stylesheets - * `CssImportFilter`: inlines imported stylesheets - * `CssMinFilter`: minifies CSS - * `CssRewriteFilter`: fixes relative URLs in CSS assets when moving to a new URL - * `GoogleClosure\CompilerApiFilter`: compiles Javascript using the Google Closure Compiler API - * `GoogleClosure\CompilerJarFilter`: compiles Javascript using the Google Closure Compiler JAR - * `JpegoptimFilter`: optimize your JPEGs - * `JpegtranFilter`: optimize your JPEGs - * `LessFilter`: parses LESS into CSS (using less.js with node.js) - * `LessphpFilter`: parses LESS into CSS (using lessphp) - * `OptiPngFilter`: optimize your PNGs - * `PackerFilter`: compresses Javascript using Dean Edwards's Packer - * `PngoutFilter`: optimize your PNGs - * `CompassFilter`: Compass CSS authoring framework - * `Sass\SassFilter`: parses SASS into CSS - * `Sass\ScssFilter`: parses SCSS into CSS - * `SprocketsFilter`: Sprockets Javascript dependency management - * `StylusFilter`: parses STYL into CSS - * `Yui\CssCompressorFilter`: compresses CSS using the YUI compressor - * `Yui\JsCompressorFilter`: compresses Javascript using the YUI compressor - -Asset Manager -------------- - -An asset manager is provided for organizing assets. - -``` php -set('jquery', new FileAsset('/path/to/jquery.js')); -$am->set('base_css', new GlobAsset('/path/to/css/*')); -``` - -The asset manager can also be used to reference assets to avoid duplication. - -``` php -set('my_plugin', new AssetCollection(array( - new AssetReference($am, 'jquery'), - new FileAsset('/path/to/jquery.plugin.js'), -))); -``` - -Filter Manager --------------- - -A filter manager is also provided for organizing filters. - -``` php -set('sass', new SassFilter('/path/to/parser/sass')); -$fm->set('yui_css', new Yui\CssCompressorFilter('/path/to/yuicompressor.jar')); -``` - -Asset Factory -------------- - -If you'd rather not create all these objects by hand, you can use the asset -factory, which will do most of the work for you. - -``` php -setAssetManager($am); -$factory->setFilterManager($fm); -$factory->setDebug(true); - -$css = $factory->createAsset(array( - '@reset', // load the asset manager's "reset" asset - 'css/src/*.scss', // load every scss files from "/path/to/asset/directory/css/src/" -), array( - 'scss', // filter through the filter manager's "scss" filter - '?yui_css', // don't use this filter in debug mode -)); - -echo $css->dump(); -``` - -Prefixing a filter name with a question mark, as `yui_css` is here, will cause -that filter to be omitted when the factory is in debug mode. - -Caching -------- - -A simple caching mechanism is provided to avoid unnecessary work. - -``` php -dump(); -$js->dump(); -$js->dump(); -``` - -Static Assets -------------- - -Alternatively you can just write filtered assets to your web directory and be -done with it. - -``` php -writeManagerAssets($am); -``` - -Twig ----- - -To use the Assetic [Twig][3] extension you must register it to your Twig -environment: - -``` php -addExtension(new AsseticExtension($factory, $debug)); -``` - -Once in place, the extension exposes a stylesheets and a javascripts tag with a syntax similar -to what the asset factory uses: - -``` html+jinja -{% stylesheets '/path/to/sass/main.sass' filter='sass,?yui_css' output='css/all.css' %} - -{% endstylesheets %} -``` - -This example will render one `link` element on the page that includes a URL -where the filtered asset can be found. - -When the extension is in debug mode, this same tag will render multiple `link` -elements, one for each asset referenced by the `css/src/*.sass` glob. The -specified filters will still be applied, unless they are marked as optional -using the `?` prefix. - -This behavior can also be triggered by setting a `debug` attribute on the tag: - -``` html+jinja -{% stylesheets 'css/*' debug=true %} ... {% stylesheets %} -``` - -These assets need to be written to the web directory so these URLs don't -return 404 errors. - -``` php -setLoader('twig', new TwigFormulaLoader($twig)); - -// loop through all your templates -foreach ($templates as $template) { - $resource = new TwigResource($twigLoader, $template); - $am->addResource($resource, 'twig'); -} - -$writer = new AssetWriter('/path/to/web'); -$writer->writeManagerAssets($am); -``` - ---- - -Assetic is based on the Python [webassets][1] library (available on -[GitHub][2]). - -[1]: http://elsdoerfer.name/docs/webassets -[2]: https://github.com/miracle2k/webassets -[3]: http://twig.sensiolabs.org diff --git a/vendor/kriswallsmith/assetic/composer.json b/vendor/kriswallsmith/assetic/composer.json deleted file mode 100644 index 160ac60..0000000 --- a/vendor/kriswallsmith/assetic/composer.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "kriswallsmith/assetic", - "minimum-stability": "dev", - "description": "Asset Management for PHP", - "keywords": ["assets", "compression", "minification"], - "homepage": "https://github.com/kriswallsmith/assetic", - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "Kris Wallsmith", - "email": "kris.wallsmith@gmail.com", - "homepage": "http://kriswallsmith.net/" - } - ], - "require": { - "php": ">=5.3.0", - "symfony/process": "2.1.*" - }, - "require-dev": { - "twig/twig": ">=1.6.0,<2.0", - "leafo/lessphp": "*" - }, - "minimum-stability": "dev", - "suggest": { - "twig/twig": "Assetic provides the integration with the Twig templating engine", - "leafo/lessphp": "Assetic provides the integration with the lessphp LESS compiler" - }, - "autoload": { - "psr-0": { "Assetic": "src/" } - }, - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - } -} diff --git a/vendor/kriswallsmith/assetic/docs/en/build.md b/vendor/kriswallsmith/assetic/docs/en/build.md deleted file mode 100644 index d560172..0000000 --- a/vendor/kriswallsmith/assetic/docs/en/build.md +++ /dev/null @@ -1,32 +0,0 @@ -Building and Dumping Assets ---------------------------- - -The is the simplest approach to using Assetic. It involves two steps: - - 1. Create a PHP script in your web directory that uses the Assetic OOP API to - create and output an asset. - 2. Reference that file from your template. - -For example, you could create a file in your web directory at -`assets/javascripts.php` with the following code: - - use Assetic\Asset\AssetCollection; - use Assetic\Asset\FileAsset; - use Assetic\Filter\Yui\JsCompressorFilter as YuiCompressorFilter; - - $js = new AssetCollection(array( - new FileAsset(__DIR__.'/jquery.js'), - new FileAsset(__DIR__.'/application.js'), - ), array( - new YuiCompressorFilter('/path/to/yuicompressor.jar'), - )); - - header('Content-Type: application/js'); - echo $js->dump(); - -In your HTML template you would include this generated Javascript using a -simple ` - -Next: [Basic Concepts](concepts.md) diff --git a/vendor/kriswallsmith/assetic/docs/en/concepts.md b/vendor/kriswallsmith/assetic/docs/en/concepts.md deleted file mode 100644 index 7af7b1f..0000000 --- a/vendor/kriswallsmith/assetic/docs/en/concepts.md +++ /dev/null @@ -1,129 +0,0 @@ -In order to use the Assetic OOP API you must first understand the two central -concepts of Assetic: assets and filters. - -### What is an Asset? - -As asset is an object that has content and metadata which can be loaded and -dumped. Your assets will probably fall into three categories: Javascripts, -stylesheets and images. Most assets will be loaded from files in your -filesystem, but they can also be loaded via HTTP, a database, from a string, -or virtually anything else. All that an asset has to do is fulfill Assetic's -basic asset interface. - -### What is a Filter? - -A filter is an object that acts upon an asset's content when that asset is -loaded and/or dumped. Similar to assets, a filter can do virtually anything, -as long as it implements Assetic's filter interface. - -Here is a list of some of the tools that can be applied to assets using a -filter: - - * CoffeeScript - * CssEmbed - * CssMin - * Google Closure Compiler - * jpegoptim - * jpegtran - * Less - * LessPHP - * optipng - * Packager - * pngout - * SASS - * Sprockets (version 1) - * Stylus - * YUI Compressor - -### Using Assets and Filters - -You need to start by creating an asset object. This will probably mean -instantiating a `FileAsset` instance, which takes a filesystem path as its -first argument: - - $asset = new Assetic\Asset\FileAsset('/path/to/main.css'); - -Once you have an asset you can begin adding filters to it by calling -`ensureFilter()`. For example, you can add a filter that applies the YUI -Compressor to the contents of the asset: - - $yui = new Assetic\Filter\Yui\CssCompressorFilter('/path/to/yui.jar'); - $asset->ensureFilter($yui); - -Once you've added as many filters as you'd like you can output the finished -asset to the browser: - - header('Content-Type: text/css'); - echo $asset->dump(); - -### Asset Collections - -It is a good idea to combine assets of the same type into a single file to -avoid unnecessary HTTP requests. You can do this in Assetic using the -`AssetCollection` class. This class is just like any other asset in Assetic's -eyes as it implements the asset interface, but under the hood it allows you to -combine multiple assets into one. - - use Assetic\Asset\AssetCollection; - - $asset = new AssetCollection(array( - new FileAsset('/path/to/js/jquery.js'), - new FileAsset('/path/to/js/jquery.plugin.js'), - new FileAsset('/path/to/js/application.js'), - )); - -### Nested Asset Collections - -The collection class implements the asset interface and all assets passed into -a collection must implement the same interface, which means you can easily -nest collections within one another: - - use Assetic\Asset\AssetCollection; - use Assetic\Asset\GlobAsset; - use Assetic\Asset\HttpAsset; - - $asset = new AssetCollection(array( - new HttpAsset('http://example.com/jquery.min.js'), - new GlobAsset('/path/to/js/*'), - )); - -The `HttpAsset` class is a special asset class that loads a file over HTTP; -`GlobAsset` is a special asset collection class that loads files based on a -filesystem glob -- both implement the asset interface. - -This concept of nesting asset collection become even more powerful when you -start applying different sets of filters to each collection. Imagine some of -your application's stylesheets are written in SASS, while some are written in -vanilla CSS. You can combine all of these into one seamless CSS asset: - - use Assetic\Asset\AssetCollection; - use Assetic\Asset\GlobAsset; - use Assetic\Filter\SassFilter; - use Assetic\Filter\Yui\CssCompressorFilter; - - $css = new AssetCollection(array( - new GlobAsset('/path/to/sass/*.sass', array(new SassFilter())), - new GlobAsset('/path/to/css/*.css'), - ), array( - new YuiCompressorFilter('/path/to/yuicompressor.jar'), - )); - -You'll notice I've also applied the YUI compressor filter to the combined -asset so all CSS will be minified. - -### Iterating over an Asset Collection - -Once you have an asset collection you can iterate over it like you would a -plain old PHP array: - - echo "Source paths:\n"; - foreach ($collection as $asset) { - echo ' - '.$asset->getSourcePath()."\n"; - } - -The asset collection iterates recursively, which means you will only see the -"leaf" assets during iteration. Iteration also includes a smart filter which -ensures you only see each asset once, even if the same asset has been included -multiple times. - -Next: [Defining Assets "On The Fly"](define.md) diff --git a/vendor/kriswallsmith/assetic/docs/en/define.md b/vendor/kriswallsmith/assetic/docs/en/define.md deleted file mode 100644 index 3d8d3b1..0000000 --- a/vendor/kriswallsmith/assetic/docs/en/define.md +++ /dev/null @@ -1,145 +0,0 @@ -Defining Assets "On The Fly" ----------------------------- - -The second approach to using Assetic involves defining your application's -assets "on the fly" in your templates, instead of in an isolated PHP file. -Using this approach, your PHP template would look something like this: - - - -This call to `assetic_javascripts()` serves a dual purpose. It will be read by -the Assetic "formula loader" which will extract an asset "formula" that can be -used to build, dump and output the asset. It will also be executed when the -template is rendered, at which time the path to the output asset is output. - -Assetic includes the following templating helper functions: - - * `assetic_image()` - * `assetic_javascripts()` - * `assetic_stylesheets()` - -Defining assets on the fly is a much more sophisticated technique and -therefore relies on services to do the heavy lifting. The main one being the -asset factory. - -### Asset Factory - -The asset factory knows how to create asset objects using only arrays and -scalar values as input. This is the same string syntax used by the `assetic_*` -template helper functions. - - use Assetic\Factory\AssetFactory; - - $factory = new AssetFactory('/path/to/web'); - $js = $factory->createAsset(array( - 'js/jquery.js', - 'js/jquery.plugin.js', - 'js/application.js', - )); - -### Filter Manager - -You can also apply filters to asset created by the factory. To do this you -must setup a `FilterManager`, which organizes filters by a name. - - use Assetic\FilterManager; - use Assetic\Filter\GoogleClosure\ApiFilter as ClosureFilter; - - $fm = new FilterManager(); - $fm->set('closure', new ClosureFilter()); - $factory->setFilterManager($fm); - - $js = $factory->createAsset('js/*', 'closure'); - -This code creates an instance of the Google Closure Compiler filter and -assigns it the name `closure` using a filter manager. This filter manager is -then injected into the asset factory, making the filter available as `closure` -when creating assets. - -### Debug Mode - -The asset factory also introduces the concept of a debug mode. This mode -allows you to omit certain filters from assets the factory creates depending -on whether it is enabled or not. - -For example, the YUI Compressor is awesome, but it is only appropriate in a -production environment as it is very difficult to debug minified Javascript. - - use Asset\Factory\AssetFactory; - - $factory = new AssetFactory('/path/to/web', true); // debug mode is on - $factory->setFilterManager($fm); - $js = $factory->createAsset('js/*', '?closure'); - -By prefixing the `closure` filter's name with a question mark, we are telling -the factory this filter is optional and should only be applied with debug mode -is off. - -### Asset Manager and Asset References - -The asset factory provides another special string syntax that allows you to -reference assets you defined elsewhere. These are called "asset references" -and involve an asset manager which, similar to the filter manager, organizes -assets by name. - - use Assetic\AssetManager; - use Assetic\Asset\FileAsset; - use Assetic\Factory\AssetFactory; - - $am = new AssetManager(); - $am->set('jquery', new FileAsset('/path/to/jquery.js')); - - $factory = new AssetFactory('/path/to/web'); - $factory->setAssetManager($am); - - $js = $factory->createAsset(array( - '@jquery', - 'js/application.js', - )); - -### Extracting Assets from Templates - -Once you've defined a set of assets in your templates you must use the -"formula loader" service to extract these asset definitions. - - use Assetic\Factory\Loader\FunctionCallsFormulaLoader; - use Assetic\Factory\Resource\FileResource; - - $loader = new FunctionCallsFormulaLoader($factory); - $formulae = $loader->load(new FileResource('/path/to/template.php')); - -These asset formulae aren't much use by themselves. They each include just -enough information for the asset factory to create the intended asset object. -In order for these to be useful they must be wrapped in the special -`LazyAssetManager`. - -### The Lazy Asset Manager - -This service is a composition of the asset factory and one or more formula -loaders. It acts as the glue between these services behind the scenes, but can -be used just like a normal asset manager on the surface. - - use Assetic\Asset\FileAsset; - use Assetic\Factory\LazyAssetManager; - use Assetic\Factory\Loader\FunctionCallsFormulaLoader; - use Assetic\Factory\Resource\DirectoryResource; - - $am = new LazyAssetManager($factory); - $am->set('jquery', new FileAsset('/path/to/jquery.js')); - $am->setLoader('php', new FunctionCallsFormulaLoader($factory)); - $am->addResource(new DirectoryResource('/path/to/templates', '/\.php$/'), 'php'); - -### Asset Writer - -Finally, once you've create an asset manager that knows about every asset -you've defined in your templates, you must use an asset writer to actually -create the files your templates are going to be referencing. - - use Assetic\AssetWriter; - - $writer = new AssetWriter('/path/to/web'); - $writer->writeManagerAssets($am); - -After running this script, all of the assets in your asset manager will be -loaded into memory, filtered with their configured filters and dumped to your -web directory as static files, ready to be served. diff --git a/vendor/kriswallsmith/assetic/docs/en/index.md b/vendor/kriswallsmith/assetic/docs/en/index.md deleted file mode 100644 index 46dc590..0000000 --- a/vendor/kriswallsmith/assetic/docs/en/index.md +++ /dev/null @@ -1,7 +0,0 @@ -Table Of Contents ------------------ - - 1. [Introduction](introduction.md) - 2. [Building and Dumping Assets](build.md) - 3. [Basic Concepts](concepts.md) - 4. [Defining Assets "On The Fly"](define.md) diff --git a/vendor/kriswallsmith/assetic/docs/en/introduction.md b/vendor/kriswallsmith/assetic/docs/en/introduction.md deleted file mode 100644 index 352f496..0000000 --- a/vendor/kriswallsmith/assetic/docs/en/introduction.md +++ /dev/null @@ -1,21 +0,0 @@ -What is Assetic? ----------------- - -Assetic is an asset management framework for PHP 5.3. Assetic enables you to -use a variety of third party tools that will help bring order to your -application's Javascripts, stylesheets and images. - -How Do I Use Assetic? ---------------------- - -There are two distinct approaches you can take when using Assetic: - - 1. Build, dump and output assets in PHP files that you reference directly - from your templates - 2. Defining assets in your templates ("on the fly") and use a loader to - extract, dump and output them - -The first approach is simpler, but the second, with all its moving parts, -offers more flexibility and opportunity for optimization. - -Next: [Building and Dumping Assets](build.md) diff --git a/vendor/kriswallsmith/assetic/docs/ja/build.md b/vendor/kriswallsmith/assetic/docs/ja/build.md deleted file mode 100644 index bee59ba..0000000 --- a/vendor/kriswallsmith/assetic/docs/ja/build.md +++ /dev/null @@ -1,30 +0,0 @@ -アセットのビルドとダンプ ---------------------------- - -Asseticを使う一番単純な方法は、次の2ステップからなります。 - - 1. 公開領域内にPHPスクリプトを作成し、Assetic OOP APIを使用してアセットの作成・出力を行う - 2. テンプレートから上記のファイルを参照する - -例えば、公開領域内に`assets/javascripts.php`ファイルを作成し、 -下記のようなコードを記述します。 - - use Assetic\Asset\AssetCollection; - use Assetic\Asset\FileAsset; - use Assetic\Filter\Yui\JsCompressorFilter as YuiCompressorFilter; - - $js = new AssetCollection(array( - new FileAsset(__DIR__.'/jquery.js'), - new FileAsset(__DIR__.'/application.js'), - ), array( - new YuiCompressorFilter('/path/to/yuicompressor.jar'), - )); - - header('Content-Type: application/js'); - echo $js->dump(); - -HTMLテンプレート側では、単に` - -Next: [コンセプト](concepts.md) diff --git a/vendor/kriswallsmith/assetic/docs/ja/concepts.md b/vendor/kriswallsmith/assetic/docs/ja/concepts.md deleted file mode 100644 index 3479b20..0000000 --- a/vendor/kriswallsmith/assetic/docs/ja/concepts.md +++ /dev/null @@ -1,121 +0,0 @@ -Assetic OOP APIを使用するためには、まず、[アセット」と「フィルタ」の2つの重要なコンセプトを理解する必要があります。 - -### アセット - -アセットとは、読み込み、及びダンプが可能な、コンテンツとメタデータを内包しているオブジェクトの事を指します。 -大体の場合において3つのカテゴリー、すなわち、Javascriptとスタイルシート、画像のどれかに属することになるでしょう。 -読み込みの方法としては、ファイルシステムからがほとんどですが、 -HTTPやデータベース経由でも、文字列としてでも読み込みが可能で、事実上あらゆるものが読み込み可能です。 -Asseticのアセットインターフェースを満足させさえすれば良いのです。 - - -### フィルタ - -フィルタは、アセットが読み込まれる、かつ/もしくは、ダンプされる際に、 -アセットコンテンツに対して作用するオブジェクトです。 -アセットと同様に、Asseticのフィルタインターフェースを実装することで、 -どのような作用も可能になります。 - -フィルタを用いて、アセットに適用できるツール群の一覧です。 - - * CoffeeScript - * CssEmbed - * CssMin - * Google Closure Compiler - * jpegoptim - * jpegtran - * Less - * LessPHP - * optipng - * Packager - * pngout - * SASS - * Sprockets (version 1) - * Stylus - * YUI Compressor - - -### アセットとフィルタの使用 - -まずはアセットオブジェクトを作成することから始まります。 -多くの場合は`FileAsset`をインスタンス化し、ファイルシステムのパスを第一引数に渡します。 - - $asset = new Assetic\Asset\FileAsset('/path/to/main.css'); - -アセットオブジェクトを作成したら、`ensureFilter()`を呼び、フィルタを追加します。 -例えば、アセットコンテンツにYUI Compressorを適用してみましょう。 - - $yui = new Assetic\Filter\Yui\CssCompressorFilter('/path/to/yui.jar'); - $asset->ensureFilter($yui); - -任意のフィルタを追加したら、完成したアセットをブラウザに出力してみましょう。 - - header('Content-Type: text/css'); - echo $asset->dump(); - -### アセットコレクション - -1つのファイルに同じ種類のアセットをまとめて、不要なHTTPリクエストを抑えてみるのも良いでしょう。 -Asseticでは`AsseticColletion`クラスを使用することで可能となります。 -Assetic内部的には、このクラス自体は他のアセットと同様に、アセットインターフェースを実装したものですが、 -複数のアセットを1つにまとめることが可能になります。 - - use Assetic\Asset\AssetCollection; - - $asset = new AssetCollection(array( - new FileAsset('/path/to/js/jquery.js'), - new FileAsset('/path/to/js/jquery.plugin.js'), - new FileAsset('/path/to/js/application.js'), - )); - -### ネストしたアセットコレクション - -コレクションクラス自体がアセットインターフェースを実装し、コレクション内のアセットも同様に -アセットインターフェースを実装しているので、簡単にネストすることができます。 - - use Assetic\Asset\AssetCollection; - use Assetic\Asset\GlobAsset; - use Assetic\Asset\HttpAsset; - - $asset = new AssetCollection(array( - new HttpAsset('http://example.com/jquery.min.js'), - new GlobAsset('/path/to/js/*'), - )); - -`HttpAsset`は、HTTP経由でファイルを読み込むアセットクラス。 -`GlobAsset`は、ファイルシステムのglobを基にファイル群を読み込むアセットコレクションクラス。 -両者ともにアセットインターフェースを実装しています。 - -このネストしたアセットコレクションという概念は、コレクションそれぞれに異なる -フィルタ群を適用しようとしたときに、効果を発揮します。 -例えば、スタイルシートがSAASで記述されたものと、vanilla CSSを用いて記述されたものからなる -アプリケーションを考えた場合、次のようにして、全てを1つのシームレスなCSSアセットにまとめることができます。 - - use Assetic\Asset\AssetCollection; - use Assetic\Asset\GlobAsset; - use Assetic\Filter\SassFilter; - use Assetic\Filter\Yui\CssCompressorFilter; - - $css = new AssetCollection(array( - new GlobAsset('/path/to/sass/*.sass', array(new SassFilter())), - new GlobAsset('/path/to/css/*.css'), - ), array( - new YuiCompressorFilter('/path/to/yuicompressor.jar'), - )); - -上記の例では、1つにまとめられたCSSを、さらにYUI compressorフィルタを適用することで、全体を圧縮しています。 - -### アセットコレクションのイテレーション - -アセットコレクションは、旧来のPHP配列のように、イテレートできます。 - - echo "Source paths:\n"; - foreach ($collection as $asset) { - echo ' - '.$asset->getSourcePath()."\n"; - } - -アセットコレクションのイテレーションは再帰的で、「葉」にあたるアセットの取得を行います。 -また、気の利いたフィルタを内蔵しているので、同じアセットがコレクション内に複数存在する場合でも、 -一度だけのインクルードが保証されます。 - -Next: [アセットを「オンザフライ」で定義する](define.md) diff --git a/vendor/kriswallsmith/assetic/docs/ja/define.md b/vendor/kriswallsmith/assetic/docs/ja/define.md deleted file mode 100644 index 3b04436..0000000 --- a/vendor/kriswallsmith/assetic/docs/ja/define.md +++ /dev/null @@ -1,140 +0,0 @@ -アセットの「オンザフライ」な定義 ----------------------------------------- - -Asseticの使用方法二つ目は、独立したPHPファイルを使用する代わりに、 -テンプレートで「オンザフライ」にアセット定義をする方法です。 -このアプローチでは、PHPテンプレートは下記のようになります。 - - - -`assetic_javascripts()`の呼び出しは2つの目的を兼ねています。 -まず、「フォーミュラローダー」により走査され、アセットの構築、ダンプ、及び出力を行うための「フォーミュラ(処方箋)」が抽出されます。 -また、テンプレートのレンダー時にも実行され、アセットの出力パスが出力されます。 - -Asseticには下記のようなヘルパー関数があります。 - - * `assetic_image()` - * `assetic_javascripts()` - * `assetic_stylesheets()` - -アセットをオンザフライに定義するということは、より高度なテクニックであり、 -そのため、重い仕事をするサービスに依存することになります。 -そのうちの重要なものがアセットファクトリです。 - -### アセットファクトリ - -アセットファクトリは、アセットオブジェクトを、配列とスカラ値のみから、 -どのように作成するのか把握しています。 -`assetic_*`ヘルパー関数で使用する記法と同様のものとなります。 - - use Assetic\Factory\AssetFactory; - - $factory = new AssetFactory('/path/to/web'); - $js = $factory->createAsset(array( - 'js/jquery.js', - 'js/jquery.plugin.js', - 'js/application.js', - )); - -### フィルタマネージャー - -ファクトリによって作成されたアセットに対しても、フィルタを適用することができます。 -そのためには、`FilterManager`を設定して、名前を定義しフィルタを構成します。 - - use Assetic\FilterManager; - use Assetic\Filter\GoogleClosure\ApiFilter as ClosureFilter; - - $fm = new FilterManager(); - $fm->set('closure', new ClosureFilter()); - $factory->setFilterManager($fm); - - $js = $factory->createAsset('js/*', 'closure'); - -上記の例では、Google Closure Compilerフィルタをインスタンス化し、 -フィルタマネージャーを通じて`closure`という名前をつけています。 -このフィルタマネージャーをアセットファクトリに渡すことで、 -アセット作成時には、`closure`という名前でフィルタを使用できるようになります。 - -### デバッグモード - -アセットファクトリは、デバッグモードというコンセプトも取り入れており、 -デバッグモードの設定により、ファクトリが作成するアセットから、 -特定のフィルタを除外することができます。 - -たとえば、YUI Compressorは大変素晴らしいのですが、圧縮されたJavascriptを -デバッグするのは大変難しく、プロダクション環境でのみの使用が適切でしょう。 - - use Asset\Factory\AssetFactory; - - $factory = new AssetFactory('/path/to/web', true); // デバッグモードON - $factory->setFilterManager($fm); - $js = $factory->createAsset('js/*', '?closure'); - -フィルタ名`closure`の前にクエスチョンマークを記述すると、ファクトリに対して、 -このフィルタはオプションであり、 -デバッグモードがOFFの時にのみ適用するように通知することができます。 - -### アセットマネージャーとアセットリファレンス - -アセットファクトリにはもう一つ特別な記法があり、別の場所で定義した -アセットを参照することができるようになります。 -これを「アセットリファレンス」と呼び、アセットマネージャーを通じて、 -フィルタマネージャーと同様の、名前によるアセットの構成が可能です。 - - use Assetic\AssetManager; - use Assetic\Asset\FileAsset; - use Assetic\Factory\AssetFactory; - - $am = new AssetManager(); - $am->set('jquery', new FileAsset('/path/to/jquery.js')); - - $factory = new AssetFactory('/path/to/web'); - $factory->setAssetManager($am); - - $js = $factory->createAsset(array( - '@jquery', - 'js/application.js', - )); - -### テンプレートからのアセット抽出 - -テンプレート内でアセット群を定義したら、「フォーミュラローダー」サービスを使用して、 -アセットの定義を抽出します。 - - use Assetic\Factory\Loader\FunctionCallsFormulaLoader; - use Assetic\Factory\Resource\FileResource; - - $loader = new FunctionCallsFormulaLoader($factory); - $formulae = $loader->load(new FileResource('/path/to/template.php')); - -これらのフォーミュラ自体は、それ自体で使途はあまりなく、 -アセットファクトリが目的のアセットオブジェクトを作成するに足る情報しか持っていません。 -`LazyAssetManager`でラップすることで有益なものとなります。 - -### レイジーなアセットマネージャー - -このサービスは、アセットファクトリと、1つ以上のフォーミュラローダーから成っており、 -裏方のサービス間のグルとして動作しますが、表面上では、通常のアセットマネージャーと同じように使用することができます。 - - use Assetic\Asset\FileAsset; - use Assetic\Factory\LazyAssetManager; - use Assetic\Factory\Loader\FunctionCallsFormulaLoader; - use Assetic\Factory\Resource\DirectoryResource; - - $am = new LazyAssetManager($factory); - $am->set('jquery', new FileAsset('/path/to/jquery.js')); - $am->setLoader('php', new FunctionCallsFormulaLoader($factory)); - $am->addResource(new DirectoryResource('/path/to/templates', '/\.php$/'), 'php'); - -### アセットライター - -作成したアセットマネージャーが、テンプレート内で定義した全てのアセットを把握したら、 -アセットライターを使用して、テンプレートが参照することになる実際のファイルを作成します。 - - use Assetic\AssetWriter; - - $writer = new AssetWriter('/path/to/web'); - $writer->writeManagerAssets($am); - -上記のスクリプトを実行すると、アセットマネージャー内のすべてのアセットがメモリに読み込まれ、 -指定したフィルタが適用された後、公開領域に静的ファイルとしてダンプされ、準備完了となります。 diff --git a/vendor/kriswallsmith/assetic/docs/ja/index.md b/vendor/kriswallsmith/assetic/docs/ja/index.md deleted file mode 100644 index 138280d..0000000 --- a/vendor/kriswallsmith/assetic/docs/ja/index.md +++ /dev/null @@ -1,7 +0,0 @@ -目次 ------ - - 1. [イントロダクション](introduction.md) - 2. [アセットの構築とダンプ](build.md) - 3. [コンセプト](concepts.md) - 4. [アセットを「オンザフライ」で定義する](define.md) diff --git a/vendor/kriswallsmith/assetic/docs/ja/introduction.md b/vendor/kriswallsmith/assetic/docs/ja/introduction.md deleted file mode 100644 index 0f45a8e..0000000 --- a/vendor/kriswallsmith/assetic/docs/ja/introduction.md +++ /dev/null @@ -1,18 +0,0 @@ -Asseticとは ------------------ - -Asseticは、PHP5.3用のアセット管理フレームワークです。 -Asseticを導入することで、Javascriptやスタイルシート、画像をコントロールする -様々なサードパーティー製のツールを使用できるようになります。 - -Asseticの使用方法 ---------------------- - -2つの異なるアプローチがあります。 - - 1. アセットのビルド、ダンプ、出力をPHPファイルで行い、テンプレートからそのファイルを直接参照する方法 - 2. テンプレート内でアセットを(「オンザフライ」に)定義し、抽出やダンプ、出力にローダーを使用する方法 - -前者はいくらかシンプルである一方、後者は動的で柔軟性に富み、最適化が可能となります。 - -Next: [アセットの構築とダンプ](build.md) diff --git a/vendor/kriswallsmith/assetic/phpunit.travis.xml b/vendor/kriswallsmith/assetic/phpunit.travis.xml deleted file mode 100644 index 3a27eea..0000000 --- a/vendor/kriswallsmith/assetic/phpunit.travis.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - ./tests/Assetic/Test/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ./src/Assetic/ - - - diff --git a/vendor/kriswallsmith/assetic/phpunit.xml.dist b/vendor/kriswallsmith/assetic/phpunit.xml.dist deleted file mode 100644 index f22113e..0000000 --- a/vendor/kriswallsmith/assetic/phpunit.xml.dist +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - ./tests/Assetic/Test/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ./src/Assetic/ - - - diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCache.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCache.php deleted file mode 100644 index 9b8a59b..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCache.php +++ /dev/null @@ -1,168 +0,0 @@ - - */ -class AssetCache implements AssetInterface -{ - private $asset; - private $cache; - - public function __construct(AssetInterface $asset, CacheInterface $cache) - { - $this->asset = $asset; - $this->cache = $cache; - } - - public function ensureFilter(FilterInterface $filter) - { - $this->asset->ensureFilter($filter); - } - - public function getFilters() - { - return $this->asset->getFilters(); - } - - public function clearFilters() - { - $this->asset->clearFilters(); - } - - public function load(FilterInterface $additionalFilter = null) - { - $cacheKey = self::getCacheKey($this->asset, $additionalFilter, 'load'); - if ($this->cache->has($cacheKey)) { - $this->asset->setContent($this->cache->get($cacheKey)); - return; - } - - $this->asset->load($additionalFilter); - $this->cache->set($cacheKey, $this->asset->getContent()); - } - - public function dump(FilterInterface $additionalFilter = null) - { - $cacheKey = self::getCacheKey($this->asset, $additionalFilter, 'dump'); - if ($this->cache->has($cacheKey)) { - return $this->cache->get($cacheKey); - } - - $content = $this->asset->dump($additionalFilter); - $this->cache->set($cacheKey, $content); - - return $content; - } - - public function getContent() - { - return $this->asset->getContent(); - } - - public function setContent($content) - { - $this->asset->setContent($content); - } - - public function getSourceRoot() - { - return $this->asset->getSourceRoot(); - } - - public function getSourcePath() - { - return $this->asset->getSourcePath(); - } - - public function getTargetPath() - { - return $this->asset->getTargetPath(); - } - - public function setTargetPath($targetPath) - { - $this->asset->setTargetPath($targetPath); - } - - public function getLastModified() - { - return $this->asset->getLastModified(); - } - - public function getVars() - { - return $this->asset->getVars(); - } - - public function setValues(array $values) - { - $this->asset->setValues($values); - } - - public function getValues() - { - return $this->asset->getValues(); - } - - /** - * Returns a cache key for the current asset. - * - * The key is composed of everything but an asset's content: - * - * * source root - * * source path - * * target url - * * last modified - * * filters - * - * @param AssetInterface $asset The asset - * @param FilterInterface $additionalFilter Any additional filter being applied - * @param string $salt Salt for the key - * - * @return string A key for identifying the current asset - */ - static private function getCacheKey(AssetInterface $asset, FilterInterface $additionalFilter = null, $salt = '') - { - if ($additionalFilter) { - $asset = clone $asset; - $asset->ensureFilter($additionalFilter); - } - - $cacheKey = $asset->getSourceRoot(); - $cacheKey .= $asset->getSourcePath(); - $cacheKey .= $asset->getTargetPath(); - $cacheKey .= $asset->getLastModified(); - - foreach ($asset->getFilters() as $filter) { - if ($filter instanceof HashableInterface) { - $cacheKey .= $filter->hash(); - } else { - $cacheKey .= serialize($filter); - } - } - - if ($values = $asset->getValues()) { - asort($values); - $cacheKey .= serialize($values); - } - - return md5($cacheKey.$salt); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollection.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollection.php deleted file mode 100644 index 491d8dd..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollection.php +++ /dev/null @@ -1,217 +0,0 @@ - - */ -class AssetCollection implements \IteratorAggregate, AssetCollectionInterface -{ - private $assets; - private $filters; - private $sourceRoot; - private $targetPath; - private $content; - private $clones; - private $vars; - private $values; - - /** - * Constructor. - * - * @param array $assets Assets for the current collection - * @param array $filters Filters for the current collection - * @param string $sourceRoot The root directory - */ - public function __construct($assets = array(), $filters = array(), $sourceRoot = null, array $vars = array()) - { - $this->assets = array(); - foreach ($assets as $asset) { - $this->add($asset); - } - - $this->filters = new FilterCollection($filters); - $this->sourceRoot = $sourceRoot; - $this->clones = new \SplObjectStorage(); - $this->vars = $vars; - $this->values = array(); - } - - public function all() - { - return $this->assets; - } - - public function add(AssetInterface $asset) - { - $this->assets[] = $asset; - } - - public function removeLeaf(AssetInterface $needle, $graceful = false) - { - foreach ($this->assets as $i => $asset) { - $clone = isset($this->clones[$asset]) ? $this->clones[$asset] : null; - if (in_array($needle, array($asset, $clone), true)) { - unset($this->clones[$asset], $this->assets[$i]); - return true; - } elseif ($asset instanceof AssetCollectionInterface && $asset->removeLeaf($needle, true)) { - return true; - } - } - - if ($graceful) { - return false; - } - - throw new \InvalidArgumentException('Leaf not found.'); - } - - public function replaceLeaf(AssetInterface $needle, AssetInterface $replacement, $graceful = false) - { - foreach ($this->assets as $i => $asset) { - $clone = isset($this->clones[$asset]) ? $this->clones[$asset] : null; - if (in_array($needle, array($asset, $clone), true)) { - unset($this->clones[$asset]); - $this->assets[$i] = $replacement; - return true; - } elseif ($asset instanceof AssetCollectionInterface && $asset->replaceLeaf($needle, $replacement, true)) { - return true; - } - } - - if ($graceful) { - return false; - } - - throw new \InvalidArgumentException('Leaf not found.'); - } - - public function ensureFilter(FilterInterface $filter) - { - $this->filters->ensure($filter); - } - - public function getFilters() - { - return $this->filters->all(); - } - - public function clearFilters() - { - $this->filters->clear(); - } - - public function load(FilterInterface $additionalFilter = null) - { - // loop through leaves and load each asset - $parts = array(); - foreach ($this as $asset) { - $asset->load($additionalFilter); - $parts[] = $asset->getContent(); - } - - $this->content = implode("\n", $parts); - } - - public function dump(FilterInterface $additionalFilter = null) - { - // loop through leaves and dump each asset - $parts = array(); - foreach ($this as $asset) { - $parts[] = $asset->dump($additionalFilter); - } - - return implode("\n", $parts); - } - - public function getContent() - { - return $this->content; - } - - public function setContent($content) - { - $this->content = $content; - } - - public function getSourceRoot() - { - return $this->sourceRoot; - } - - public function getSourcePath() - { - } - - public function getTargetPath() - { - return $this->targetPath; - } - - public function setTargetPath($targetPath) - { - $this->targetPath = $targetPath; - } - - /** - * Returns the highest last-modified value of all assets in the current collection. - * - * @return integer|null A UNIX timestamp - */ - public function getLastModified() - { - if (!count($this->assets)) { - return; - } - - $mapper = function (AssetInterface $asset) - { - return $asset->getLastModified(); - }; - - return max(array_map($mapper, $this->assets)); - } - - /** - * Returns an iterator for looping recursively over unique leaves. - */ - public function getIterator() - { - return new \RecursiveIteratorIterator(new AssetCollectionFilterIterator(new AssetCollectionIterator($this, $this->clones))); - } - - public function getVars() - { - return $this->vars; - } - - public function setValues(array $values) - { - $this->values = $values; - - foreach ($this as $asset) { - $asset->setValues(array_intersect_key($values, array_flip($asset->getVars()))); - } - } - - public function getValues() - { - return $this->values; - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollectionInterface.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollectionInterface.php deleted file mode 100644 index a5a9bac..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollectionInterface.php +++ /dev/null @@ -1,53 +0,0 @@ - - */ -interface AssetCollectionInterface extends AssetInterface, \Traversable -{ - /** - * Returns all child assets. - * - * @return array An array of AssetInterface objects - */ - function all(); - - /** - * Adds an asset to the current collection. - * - * @param AssetInterface $asset An asset - */ - function add(AssetInterface $asset); - - /** - * Removes a leaf. - * - * @param AssetInterface $needle The leaf to remove - * - * @throws \InvalidArgumentException If the asset cannot be found - */ - function removeLeaf(AssetInterface $leaf); - - /** - * Replaces an existing leaf with a new one. - * - * @param AssetInterface $needle The current asset to replace - * @param AssetInterface $replacement The new asset - * - * @throws InvalidArgumentException If the asset cannot be found - */ - function replaceLeaf(AssetInterface $needle, AssetInterface $replacement); -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetInterface.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetInterface.php deleted file mode 100644 index f324317..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetInterface.php +++ /dev/null @@ -1,156 +0,0 @@ - - */ -interface AssetInterface -{ - /** - * Ensures the current asset includes the supplied filter. - * - * @param FilterInterface $filter A filter - */ - function ensureFilter(FilterInterface $filter); - - /** - * Returns an array of filters currently applied. - * - * @return array An array of filters - */ - function getFilters(); - - /** - * Clears all filters from the current asset. - */ - function clearFilters(); - - /** - * Loads the asset into memory and applies load filters. - * - * You may provide an additional filter to apply during load. - * - * @param FilterInterface $additionalFilter An additional filter - */ - function load(FilterInterface $additionalFilter = null); - - /** - * Applies dump filters and returns the asset as a string. - * - * You may provide an additional filter to apply during dump. - * - * Dumping an asset should not change its state. - * - * If the current asset has not been loaded yet, it should be - * automatically loaded at this time. - * - * @param FilterInterface $additionalFilter An additional filter - * - * @return string The filtered content of the current asset - */ - function dump(FilterInterface $additionalFilter = null); - - /** - * Returns the loaded content of the current asset. - * - * @return string The content - */ - function getContent(); - - /** - * Sets the content of the current asset. - * - * Filters can use this method to change the content of the asset. - * - * @param string $content The asset content - */ - function setContent($content); - - /** - * Returns an absolute path or URL to the source asset's root directory. - * - * This value should be an absolute path to a directory in the filesystem, - * an absolute URL with no path, or null. - * - * For example: - * - * * '/path/to/web' - * * 'http://example.com' - * * null - * - * @return string|null The asset's root - */ - function getSourceRoot(); - - /** - * Returns the relative path for the source asset. - * - * This value can be combined with the asset's source root (if both are - * non-null) to get something compatible with file_get_contents(). - * - * For example: - * - * * 'js/main.js' - * * 'main.js' - * * null - * - * @return string|null The source asset path - */ - function getSourcePath(); - - /** - * Returns the URL for the current asset. - * - * @return string|null A web URL where the asset will be dumped - */ - function getTargetPath(); - - /** - * Sets the URL for the current asset. - * - * @param string $targetPath A web URL where the asset will be dumped - */ - function setTargetPath($targetPath); - - /** - * Returns the time the current asset was last modified. - * - * @return integer|null A UNIX timestamp - */ - function getLastModified(); - - /** - * Returns an array of variable names for this asset. - * - * @return array - */ - function getVars(); - - /** - * Sets the values for the asset's variables. - * - * @param array $values - */ - function setValues(array $values); - - /** - * Returns the current values for this asset. - * - * @return array an array of strings - */ - function getValues(); -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetReference.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetReference.php deleted file mode 100644 index 488877a..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetReference.php +++ /dev/null @@ -1,134 +0,0 @@ - - */ -class AssetReference implements AssetInterface -{ - private $am; - private $name; - private $filters = array(); - - public function __construct(AssetManager $am, $name) - { - $this->am = $am; - $this->name = $name; - } - - public function ensureFilter(FilterInterface $filter) - { - $this->filters[] = $filter; - } - - public function getFilters() - { - $this->flushFilters(); - - return $this->callAsset(__FUNCTION__); - } - - public function clearFilters() - { - $this->filters = array(); - $this->callAsset(__FUNCTION__); - } - - public function load(FilterInterface $additionalFilter = null) - { - $this->flushFilters(); - - return $this->callAsset(__FUNCTION__, array($additionalFilter)); - } - - public function dump(FilterInterface $additionalFilter = null) - { - $this->flushFilters(); - - return $this->callAsset(__FUNCTION__, array($additionalFilter)); - } - - public function getContent() - { - return $this->callAsset(__FUNCTION__); - } - - public function setContent($content) - { - $this->callAsset(__FUNCTION__, array($content)); - } - - public function getSourceRoot() - { - return $this->callAsset(__FUNCTION__); - } - - public function getSourcePath() - { - return $this->callAsset(__FUNCTION__); - } - - public function getTargetPath() - { - return $this->callAsset(__FUNCTION__); - } - - public function setTargetPath($targetPath) - { - $this->callAsset(__FUNCTION__, array($targetPath)); - } - - public function getLastModified() - { - return $this->callAsset(__FUNCTION__); - } - - public function getVars() - { - return $this->callAsset(__FUNCTION__); - } - - public function getValues() - { - return $this->callAsset(__FUNCTION__); - } - - public function setValues(array $values) - { - $this->callAsset(__FUNCTION__, array($values)); - } - - // private - - private function callAsset($method, $arguments = array()) - { - $asset = $this->am->get($this->name); - - return call_user_func_array(array($asset, $method), $arguments); - } - - private function flushFilters() - { - $asset = $this->am->get($this->name); - - while ($filter = array_shift($this->filters)) { - $asset->ensureFilter($filter); - } - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/BaseAsset.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/BaseAsset.php deleted file mode 100644 index 1ce93ae..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Asset/BaseAsset.php +++ /dev/null @@ -1,169 +0,0 @@ - - */ -abstract class BaseAsset implements AssetInterface -{ - private $filters; - private $sourceRoot; - private $sourcePath; - private $targetPath; - private $content; - private $loaded; - private $vars; - private $values; - - /** - * Constructor. - * - * @param array $filters Filters for the asset - */ - public function __construct($filters = array(), $sourceRoot = null, $sourcePath = null, array $vars = array()) - { - $this->filters = new FilterCollection($filters); - $this->sourceRoot = $sourceRoot; - $this->sourcePath = $sourcePath; - $this->vars = $vars; - $this->values = array(); - $this->loaded = false; - } - - public function __clone() - { - $this->filters = clone $this->filters; - } - - public function ensureFilter(FilterInterface $filter) - { - $this->filters->ensure($filter); - } - - public function getFilters() - { - return $this->filters->all(); - } - - public function clearFilters() - { - $this->filters->clear(); - } - - /** - * Encapsulates asset loading logic. - * - * @param string $content The asset content - * @param FilterInterface $additionalFilter An additional filter - */ - protected function doLoad($content, FilterInterface $additionalFilter = null) - { - $filter = clone $this->filters; - if ($additionalFilter) { - $filter->ensure($additionalFilter); - } - - $asset = clone $this; - $asset->setContent($content); - - $filter->filterLoad($asset); - $this->content = $asset->getContent(); - - $this->loaded = true; - } - - public function dump(FilterInterface $additionalFilter = null) - { - if (!$this->loaded) { - $this->load(); - } - - $filter = clone $this->filters; - if ($additionalFilter) { - $filter->ensure($additionalFilter); - } - - $asset = clone $this; - $filter->filterDump($asset); - - return $asset->getContent(); - } - - public function getContent() - { - return $this->content; - } - - public function setContent($content) - { - $this->content = $content; - } - - public function getSourceRoot() - { - return $this->sourceRoot; - } - - public function getSourcePath() - { - return $this->sourcePath; - } - - public function getTargetPath() - { - return $this->targetPath; - } - - public function setTargetPath($targetPath) - { - if ($this->vars) { - foreach ($this->vars as $var) { - if (false === strpos($targetPath, $var)) { - throw new \RuntimeException(sprintf('The asset target path "%s" must contain the variable "{%s}".', $targetPath, $var)); - } - } - } - - $this->targetPath = $targetPath; - } - - public function getVars() - { - return $this->vars; - } - - public function setValues(array $values) - { - foreach ($values as $var => $v) { - if (!in_array($var, $this->vars, true)) { - throw new \InvalidArgumentException(sprintf('The asset with source path "%s" has no variable named "%s".', $this->sourcePath, $var)); - } - } - - $this->values = $values; - $this->loaded = false; - } - - public function getValues() - { - return $this->values; - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/FileAsset.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/FileAsset.php deleted file mode 100644 index d622950..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Asset/FileAsset.php +++ /dev/null @@ -1,78 +0,0 @@ - - */ -class FileAsset extends BaseAsset -{ - private $source; - - /** - * Constructor. - * - * @param string $source An absolute path - * @param array $filters An array of filters - * @param string $sourceRoot The source asset root directory - * @param string $sourcePath The source asset path - * - * @throws \InvalidArgumentException If the supplied root doesn't match the source when guessing the path - */ - public function __construct($source, $filters = array(), $sourceRoot = null, $sourcePath = null, array $vars = array()) - { - if (null === $sourceRoot) { - $sourceRoot = dirname($source); - if (null === $sourcePath) { - $sourcePath = basename($source); - } - } elseif (null === $sourcePath) { - if (0 !== strpos($source, $sourceRoot)) { - throw new \InvalidArgumentException(sprintf('The source "%s" is not in the root directory "%s"', $source, $sourceRoot)); - } - - $sourcePath = substr($source, strlen($sourceRoot) + 1); - } - - $this->source = $source; - - parent::__construct($filters, $sourceRoot, $sourcePath, $vars); - } - - public function load(FilterInterface $additionalFilter = null) - { - $source = PathUtils::resolvePath($this->source, $this->getVars(), - $this->getValues()); - - if (!is_file($source)) { - throw new \RuntimeException(sprintf('The source file "%s" does not exist.', $source)); - } - - $this->doLoad(file_get_contents($source), $additionalFilter); - } - - public function getLastModified() - { - $source = PathUtils::resolvePath($this->source, $this->getVars(), - $this->getValues()); - - if (!is_file($source)) { - throw new \RuntimeException(sprintf('The source file "%s" does not exist.', $source)); - } - return filemtime($source); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/GlobAsset.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/GlobAsset.php deleted file mode 100644 index 4f8559c..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Asset/GlobAsset.php +++ /dev/null @@ -1,111 +0,0 @@ - - */ -class GlobAsset extends AssetCollection -{ - private $globs; - private $initialized; - - /** - * Constructor. - * - * @param string|array $globs A single glob path or array of paths - * @param array $filters An array of filters - * @param string $root The root directory - */ - public function __construct($globs, $filters = array(), $root = null, array $vars = array()) - { - $this->globs = (array) $globs; - $this->initialized = false; - - parent::__construct(array(), $filters, $root, $vars); - } - - public function all() - { - if (!$this->initialized) { - $this->initialize(); - } - - return parent::all(); - } - - public function load(FilterInterface $additionalFilter = null) - { - if (!$this->initialized) { - $this->initialize(); - } - - parent::load($additionalFilter); - } - - public function dump(FilterInterface $additionalFilter = null) - { - if (!$this->initialized) { - $this->initialize(); - } - - return parent::dump($additionalFilter); - } - - public function getLastModified() - { - if (!$this->initialized) { - $this->initialize(); - } - - return parent::getLastModified(); - } - - public function getIterator() - { - if (!$this->initialized) { - $this->initialize(); - } - - return parent::getIterator(); - } - - public function setValues(array $values) - { - parent::setValues($values); - $this->initialized = false; - } - - /** - * Initializes the collection based on the glob(s) passed in. - */ - private function initialize() - { - foreach ($this->globs as $glob) { - $glob = PathUtils::resolvePath($glob, $this->getVars(), $this->getValues()); - - if (false !== $paths = glob($glob)) { - foreach ($paths as $path) { - $this->add(new FileAsset($path, array(), $this->getSourceRoot())); - } - } - } - - $this->initialized = true; - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/HttpAsset.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/HttpAsset.php deleted file mode 100644 index d1dcfe0..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Asset/HttpAsset.php +++ /dev/null @@ -1,79 +0,0 @@ - - */ -class HttpAsset extends BaseAsset -{ - private $sourceUrl; - private $ignoreErrors; - - /** - * Constructor. - * - * @param string $sourceUrl The source URL - * @param array $filters An array of filters - * - * @throws \InvalidArgumentException If the first argument is not an URL - */ - public function __construct($sourceUrl, $filters = array(), $ignoreErrors = false, array $vars = array()) - { - if (0 === strpos($sourceUrl, '//')) { - $sourceUrl = 'http:'.$sourceUrl; - } elseif (false === strpos($sourceUrl, '://')) { - throw new \InvalidArgumentException(sprintf('"%s" is not a valid URL.', $sourceUrl)); - } - - $this->sourceUrl = $sourceUrl; - $this->ignoreErrors = $ignoreErrors; - - list($scheme, $url) = explode('://', $sourceUrl, 2); - list($host, $path) = explode('/', $url, 2); - - parent::__construct($filters, $scheme.'://'.$host, $path, $vars); - } - - public function load(FilterInterface $additionalFilter = null) - { - if (false === $content = @file_get_contents(PathUtils::resolvePath( - $this->sourceUrl, $this->getVars(), $this->getValues()))) { - if ($this->ignoreErrors) { - return; - } else { - throw new \RuntimeException(sprintf('Unable to load asset from URL "%s"', $this->sourceUrl)); - } - } - - $this->doLoad($content, $additionalFilter); - } - - public function getLastModified() - { - if (false !== @file_get_contents($this->sourceUrl, false, stream_context_create(array('http' => array('method' => 'HEAD'))))) { - foreach ($http_response_header as $header) { - if (0 === stripos($header, 'Last-Modified: ')) { - list(, $mtime) = explode(':', $header, 2); - - return strtotime(trim($mtime)); - } - } - } - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionFilterIterator.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionFilterIterator.php deleted file mode 100644 index f9ad79b..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionFilterIterator.php +++ /dev/null @@ -1,84 +0,0 @@ - - */ -class AssetCollectionFilterIterator extends \RecursiveFilterIterator -{ - private $visited; - private $sources; - - /** - * Constructor. - * - * @param AssetCollectionIterator $iterator The inner iterator - * @param array $visited An array of visited asset objects - * @param array $sources An array of visited source strings - */ - public function __construct(AssetCollectionIterator $iterator, array $visited = array(), array $sources = array()) - { - parent::__construct($iterator); - - $this->visited = $visited; - $this->sources = $sources; - } - - /** - * Determines whether the current asset is a duplicate. - * - * De-duplication is performed based on either strict equality or by - * matching sources. - * - * @return Boolean Returns true if we have not seen this asset yet - */ - public function accept() - { - $asset = $this->getInnerIterator()->current(true); - $duplicate = false; - - // check strict equality - if (in_array($asset, $this->visited, true)) { - $duplicate = true; - } else { - $this->visited[] = $asset; - } - - // check source - $sourceRoot = $asset->getSourceRoot(); - $sourcePath = $asset->getSourcePath(); - if ($sourceRoot && $sourcePath) { - $source = $sourceRoot.'/'.$sourcePath; - if (in_array($source, $this->sources)) { - $duplicate = true; - } else { - $this->sources[] = $source; - } - } - - return !$duplicate; - } - - /** - * Passes visited objects and source URLs to the child iterator. - */ - public function getChildren() - { - return new self($this->getInnerIterator()->getChildren(), $this->visited, $this->sources); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionIterator.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionIterator.php deleted file mode 100644 index 09330fe..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionIterator.php +++ /dev/null @@ -1,109 +0,0 @@ - - */ -class AssetCollectionIterator implements \RecursiveIterator -{ - private $assets; - private $filters; - private $output; - private $clones; - - public function __construct(AssetCollectionInterface $coll, \SplObjectStorage $clones) - { - $this->assets = $coll->all(); - $this->filters = $coll->getFilters(); - $this->output = $coll->getTargetPath(); - $this->clones = $clones; - - if (false === $pos = strpos($this->output, '.')) { - $this->output .= '_*'; - } else { - $this->output = substr($this->output, 0, $pos).'_*'.substr($this->output, $pos); - } - } - - /** - * Returns a copy of the current asset with filters and a target URL applied. - * - * @param Boolean $raw Returns the unmodified asset if true - */ - public function current($raw = false) - { - $asset = current($this->assets); - - if ($raw) { - return $asset; - } - - // clone once - if (!isset($this->clones[$asset])) { - $clone = $this->clones[$asset] = clone $asset; - - // generate a target path based on asset name - $name = sprintf('%s_%d', pathinfo($asset->getSourcePath(), PATHINFO_FILENAME) ?: 'part', $this->key() + 1); - $clone->setTargetPath(str_replace('*', $name, $this->output)); - } else { - $clone = $this->clones[$asset]; - } - - // cascade filters - foreach ($this->filters as $filter) { - $clone->ensureFilter($filter); - } - - return $clone; - } - - public function key() - { - return key($this->assets); - } - - public function next() - { - return next($this->assets); - } - - public function rewind() - { - return reset($this->assets); - } - - public function valid() - { - return false !== current($this->assets); - } - - public function hasChildren() - { - return current($this->assets) instanceof AssetCollectionInterface; - } - - /** - * @uses current() - */ - public function getChildren() - { - return new self($this->current(), $this->clones); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Asset/StringAsset.php b/vendor/kriswallsmith/assetic/src/Assetic/Asset/StringAsset.php deleted file mode 100644 index 6d6dc5f..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Asset/StringAsset.php +++ /dev/null @@ -1,55 +0,0 @@ - - */ -class StringAsset extends BaseAsset -{ - private $content; - private $lastModified; - - /** - * Constructor. - * - * @param string $content The content of the asset - * @param array $filters Filters for the asset - * @param string $sourceRoot The source asset root directory - * @param string $sourcePath The source asset path - */ - public function __construct($content, $filters = array(), $sourceRoot = null, $sourcePath = null) - { - $this->content = $content; - - parent::__construct($filters, $sourceRoot, $sourcePath); - } - - public function load(FilterInterface $additionalFilter = null) - { - $this->doLoad($this->content, $additionalFilter); - } - - public function setLastModified($lastModified) - { - $this->lastModified = $lastModified; - } - - public function getLastModified() - { - return $this->lastModified; - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/AssetManager.php b/vendor/kriswallsmith/assetic/src/Assetic/AssetManager.php deleted file mode 100644 index 0746356..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/AssetManager.php +++ /dev/null @@ -1,79 +0,0 @@ - - */ -class AssetManager -{ - private $assets = array(); - - /** - * Gets an asset by name. - * - * @param string $name The asset name - * - * @return AssetInterface The asset - * - * @throws \InvalidArgumentException If there is no asset by that name - */ - public function get($name) - { - if (!isset($this->assets[$name])) { - throw new \InvalidArgumentException(sprintf('There is no "%s" asset.', $name)); - } - - return $this->assets[$name]; - } - - /** - * Checks if the current asset manager has a certain asset. - * - * @param string $name an asset name - * - * @return Boolean True if the asset has been set, false if not - */ - public function has($name) - { - return isset($this->assets[$name]); - } - - /** - * Registers an asset to the current asset manager. - * - * @param string $name The asset name - * @param AssetInterface $asset The asset - */ - public function set($name, AssetInterface $asset) - { - if (!ctype_alnum(str_replace('_', '', $name))) { - throw new \InvalidArgumentException(sprintf('The name "%s" is invalid.', $name)); - } - - $this->assets[$name] = $asset; - } - - /** - * Returns an array of asset names. - * - * @return array An array of asset names - */ - public function getNames() - { - return array_keys($this->assets); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/AssetWriter.php b/vendor/kriswallsmith/assetic/src/Assetic/AssetWriter.php deleted file mode 100644 index 75f1ae5..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/AssetWriter.php +++ /dev/null @@ -1,107 +0,0 @@ - - * @author Johannes M. Schmitt - */ -class AssetWriter -{ - private $dir; - private $varValues; - - /** - * Constructor. - * - * @param string $dir The base web directory - */ - public function __construct($dir, array $varValues = array()) - { - foreach ($varValues as $var => $values) { - foreach ($values as $value) { - if (!is_string($value)) { - throw new \InvalidArgumentException(sprintf('All variable values must be strings, but got %s for variable "%s".', json_encode($value), $var)); - } - } - } - - $this->dir = $dir; - $this->varValues = $varValues; - } - - public function writeManagerAssets(AssetManager $am) - { - foreach ($am->getNames() as $name) { - $this->writeAsset($am->get($name)); - } - } - - public function writeAsset(AssetInterface $asset) - { - foreach ($this->getCombinations($asset->getVars()) as $combination) { - $asset->setValues($combination); - - static::write($this->dir.'/'.PathUtils::resolvePath( - $asset->getTargetPath(), $asset->getVars(), $asset->getValues()), - $asset->dump()); - } - } - - private function getCombinations(array $vars) - { - if (!$vars) { - return array(array()); - } - - $combinations = array(); - $nbValues = array(); - foreach ($this->varValues as $var => $values) { - if (!in_array($var, $vars, true)) { - continue; - } - - $nbValues[$var] = count($values); - } - - for ($i=array_product($nbValues),$c=$i*2; $i<$c; $i++) { - $k = $i; - $combination = array(); - - foreach ($vars as $var) { - $combination[$var] = $this->varValues[$var][$k % $nbValues[$var]]; - $k = intval($k/$nbValues[$var]); - } - - $combinations[] = $combination; - } - - return $combinations; - } - - static protected function write($path, $contents) - { - if (!is_dir($dir = dirname($path)) && false === @mkdir($dir, 0777, true)) { - throw new \RuntimeException('Unable to create directory '.$dir); - } - - if (false === @file_put_contents($path, $contents)) { - throw new \RuntimeException('Unable to write file '.$path); - } - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Cache/ApcCache.php b/vendor/kriswallsmith/assetic/src/Assetic/Cache/ApcCache.php deleted file mode 100644 index 2285588..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Cache/ApcCache.php +++ /dev/null @@ -1,66 +0,0 @@ - - */ -class ApcCache implements CacheInterface -{ - public $ttl = 0; - - /** - * @see CacheInterface::has() - */ - public function has($key) - { - return apc_exists($key); - } - - /** - * @see CacheInterface::get() - */ - public function get($key) - { - $value = apc_fetch($key, $success); - - if (!$success) { - throw new \RuntimeException('There is no cached value for ' . $key); - } - - return $value; - } - - /** - * @see CacheInterface::set() - */ - public function set($key, $value) - { - $store = apc_store($key, $value, $this->ttl); - - if (!$store) { - throw new \RuntimeException('Unable to store "' . $key . '" for ' . $this->ttl . ' seconds.'); - } - - return $store; - } - - /** - * @see CacheInterface::remove() - */ - public function remove($key) - { - return apc_delete($key); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Cache/CacheInterface.php b/vendor/kriswallsmith/assetic/src/Assetic/Cache/CacheInterface.php deleted file mode 100644 index 8b9334d..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Cache/CacheInterface.php +++ /dev/null @@ -1,53 +0,0 @@ - - */ -interface CacheInterface -{ - /** - * Checks if the cache has a value for a key. - * - * @param string $key A unique key - * - * @return Boolean Whether the cache has a value for this key - */ - function has($key); - - /** - * Returns the value for a key. - * - * @param string $key A unique key - * - * @return string|null The value in the cache - */ - function get($key); - - /** - * Sets a value in the cache. - * - * @param string $key A unique key - * @param string $value The value to cache - */ - function set($key, $value); - - /** - * Removes a value from the cache. - * - * @param string $key A unique key - */ - function remove($key); -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Cache/ConfigCache.php b/vendor/kriswallsmith/assetic/src/Assetic/Cache/ConfigCache.php deleted file mode 100644 index de60c9e..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Cache/ConfigCache.php +++ /dev/null @@ -1,123 +0,0 @@ - - */ -class ConfigCache -{ - private $dir; - - /** - * Construct. - * - * @param string $dir The cache directory - */ - public function __construct($dir) - { - $this->dir = $dir; - } - - /** - * Checks of the cache has a file. - * - * @param string $resource A cache key - * - * @return Boolean True if a file exists - */ - public function has($resource) - { - return file_exists($this->getSourcePath($resource)); - } - - /** - * Writes a value to a file. - * - * @param string $resource A cache key - * @param mixed $value A value to cache - */ - public function set($resource, $value) - { - $path = $this->getSourcePath($resource); - - if (!is_dir($dir = dirname($path)) && false === @mkdir($dir, 0777, true)) { - // @codeCoverageIgnoreStart - throw new \RuntimeException('Unable to create directory '.$dir); - // @codeCoverageIgnoreEnd - } - - if (false === @file_put_contents($path, sprintf("getSourcePath($resource); - - if (!file_exists($path)) { - throw new \RuntimeException('There is no cached value for '.$resource); - } - - return include $path; - } - - /** - * Returns a timestamp for when the cache was created. - * - * @param string $resource A cache key - * - * @return integer A UNIX timestamp - */ - public function getTimestamp($resource) - { - $path = $this->getSourcePath($resource); - - if (!file_exists($path)) { - throw new \RuntimeException('There is no cached value for '.$resource); - } - - if (false === $mtime = @filemtime($path)) { - // @codeCoverageIgnoreStart - throw new \RuntimeException('Unable to determine file mtime for '.$path); - // @codeCoverageIgnoreEnd - } - - return $mtime; - } - - /** - * Returns the path where the file corresponding to the supplied cache key can be included from. - * - * @param string $resource A cache key - * - * @return string A file path - */ - private function getSourcePath($resource) - { - $key = md5($resource); - - return $this->dir.'/'.$key[0].'/'.$key.'.php'; - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Cache/ExpiringCache.php b/vendor/kriswallsmith/assetic/src/Assetic/Cache/ExpiringCache.php deleted file mode 100644 index 9e95b6d..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Cache/ExpiringCache.php +++ /dev/null @@ -1,60 +0,0 @@ - - */ -class ExpiringCache implements CacheInterface -{ - private $cache; - private $lifetime; - - public function __construct(CacheInterface $cache, $lifetime) - { - $this->cache = $cache; - $this->lifetime = $lifetime; - } - - public function has($key) - { - if ($this->cache->has($key)) { - if (time() < $this->cache->get($key.'.expires')) { - return true; - } - - $this->cache->remove($key.'.expires'); - $this->cache->remove($key); - } - - return false; - } - - public function get($key) - { - return $this->cache->get($key); - } - - public function set($key, $value) - { - $this->cache->set($key.'.expires', time() + $this->lifetime); - $this->cache->set($key, $value); - } - - public function remove($key) - { - $this->cache->remove($key.'.expires'); - $this->cache->remove($key); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Cache/FilesystemCache.php b/vendor/kriswallsmith/assetic/src/Assetic/Cache/FilesystemCache.php deleted file mode 100644 index 45cfbdb..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Cache/FilesystemCache.php +++ /dev/null @@ -1,65 +0,0 @@ - - */ -class FilesystemCache implements CacheInterface -{ - private $dir; - - public function __construct($dir) - { - $this->dir = $dir; - } - - public function has($key) - { - return file_exists($this->dir.'/'.$key); - } - - public function get($key) - { - $path = $this->dir.'/'.$key; - - if (!file_exists($path)) { - throw new \RuntimeException('There is no cached value for '.$key); - } - - return file_get_contents($path); - } - - public function set($key, $value) - { - if (!is_dir($this->dir) && false === @mkdir($this->dir, 0777, true)) { - throw new \RuntimeException('Unable to create directory '.$this->dir); - } - - $path = $this->dir.'/'.$key; - - if (false === @file_put_contents($path, $value)) { - throw new \RuntimeException('Unable to write file '.$path); - } - } - - public function remove($key) - { - $path = $this->dir.'/'.$key; - - if (file_exists($path) && false === @unlink($path)) { - throw new \RuntimeException('Unable to remove file '.$path); - } - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Exception/Exception.php b/vendor/kriswallsmith/assetic/src/Assetic/Exception/Exception.php deleted file mode 100644 index 1d1e928..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Exception/Exception.php +++ /dev/null @@ -1,21 +0,0 @@ - - */ -interface Exception -{ -} \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Exception/FilterException.php b/vendor/kriswallsmith/assetic/src/Assetic/Exception/FilterException.php deleted file mode 100644 index 82203de..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Exception/FilterException.php +++ /dev/null @@ -1,73 +0,0 @@ - - */ -class FilterException extends \RuntimeException implements Exception -{ - private $originalMessage; - private $input; - - public static function fromProcess(Process $proc) - { - $message = sprintf("An error occurred while running:\n%s", $proc->getCommandLine()); - - $errorOutput = $proc->getErrorOutput(); - if (!empty($errorOutput)) { - $message .= "\n\nError Output:\n".str_replace("\r", '', $errorOutput); - } - - $output = $proc->getOutput(); - if (!empty($output)) { - $message .= "\n\nOutput:\n".str_replace("\r", '', $output); - } - - return new self($message); - } - - public function __construct($message, $code = 0, \Exception $previous = null) - { - parent::__construct($message, $code, $previous); - - $this->originalMessage = $message; - } - - public function setInput($input) - { - $this->input = $input; - $this->updateMessage(); - - return $this; - } - - public function getInput() - { - return $this->input; - } - - private function updateMessage() - { - $message = $this->originalMessage; - - if (!empty($this->input)) { - $message .= "\n\nInput:\n".$this->input; - } - - $this->message = $message; - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticExtension.php b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticExtension.php deleted file mode 100644 index 6d91443..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticExtension.php +++ /dev/null @@ -1,76 +0,0 @@ -factory = $factory; - $this->functions = array(); - $this->valueSupplier = $valueSupplier; - - foreach ($functions as $function => $options) { - if (is_integer($function) && is_string($options)) { - $this->functions[$options] = array('filter' => $options); - } else { - $this->functions[$function] = $options + array('filter' => $function); - } - } - } - - public function getTokenParsers() - { - return array( - new AsseticTokenParser($this->factory, 'javascripts', 'js/*.js'), - new AsseticTokenParser($this->factory, 'stylesheets', 'css/*.css'), - new AsseticTokenParser($this->factory, 'image', 'images/*', true), - ); - } - - public function getFunctions() - { - $functions = array(); - foreach ($this->functions as $function => $filter) { - $functions[$function] = new AsseticFilterFunction($function); - } - - return $functions; - } - - public function getGlobals() - { - return array( - 'assetic' => array( - 'debug' => $this->factory->isDebug(), - 'vars' => null !== $this->valueSupplier ? $this->valueSupplier->getValues() : array(), - ), - ); - } - - public function getFilterInvoker($function) - { - return new AsseticFilterInvoker($this->factory, $this->functions[$function]); - } - - public function getName() - { - return 'assetic'; - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterFunction.php b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterFunction.php deleted file mode 100644 index c5c79a8..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterFunction.php +++ /dev/null @@ -1,29 +0,0 @@ -filter = $filter; - - parent::__construct($options); - } - - public function compile() - { - return sprintf('$this->env->getExtension(\'assetic\')->getFilterInvoker(\'%s\')->invoke', $this->filter); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterInvoker.php b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterInvoker.php deleted file mode 100644 index 78accd5..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterInvoker.php +++ /dev/null @@ -1,61 +0,0 @@ - - */ -class AsseticFilterInvoker -{ - private $factory; - private $filters; - private $options; - - public function __construct($factory, $filter) - { - $this->factory = $factory; - - if (is_array($filter) && isset($filter['filter'])) { - $this->filters = (array) $filter['filter']; - $this->options = isset($filter['options']) ? (array) $filter['options'] : array(); - } else { - $this->filters = (array) $filter; - $this->options = array(); - } - } - - public function getFactory() - { - return $this->factory; - } - - public function getFilters() - { - return $this->filters; - } - - public function getOptions() - { - return $this->options; - } - - public function invoke($input, array $options = array()) - { - $asset = $this->factory->createAsset($input, $this->filters, $options + $this->options); - - return $asset->getTargetPath(); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticNode.php b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticNode.php deleted file mode 100644 index ac823b7..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticNode.php +++ /dev/null @@ -1,166 +0,0 @@ - $body); - - $attributes = array_replace( - array('debug' => null, 'combine' => null, 'var_name' => 'asset_url'), - $attributes, - array('asset' => $asset, 'inputs' => $inputs, 'filters' => $filters, 'name' => $name) - ); - - parent::__construct($nodes, $attributes, $lineno, $tag); - } - - public function compile(\Twig_Compiler $compiler) - { - $compiler->addDebugInfo($this); - - $combine = $this->getAttribute('combine'); - $debug = $this->getAttribute('debug'); - - if (null === $combine && null !== $debug) { - $combine = !$debug; - } - - if (null === $combine) { - $compiler - ->write("if (isset(\$context['assetic']['debug']) && \$context['assetic']['debug']) {\n") - ->indent() - ; - - $this->compileDebug($compiler); - - $compiler - ->outdent() - ->write("} else {\n") - ->indent() - ; - - $this->compileAsset($compiler, $this->getAttribute('asset'), $this->getAttribute('name')); - - $compiler - ->outdent() - ->write("}\n") - ; - } elseif ($combine) { - $this->compileAsset($compiler, $this->getAttribute('asset'), $this->getAttribute('name')); - } else { - $this->compileDebug($compiler); - } - - $compiler - ->write('unset($context[') - ->repr($this->getAttribute('var_name')) - ->raw("]);\n") - ; - } - - protected function compileDebug(\Twig_Compiler $compiler) - { - $i = 0; - foreach ($this->getAttribute('asset') as $leaf) { - $leafName = $this->getAttribute('name').'_'.$i++; - $this->compileAsset($compiler, $leaf, $leafName); - } - } - - protected function compileAsset(\Twig_Compiler $compiler, AssetInterface $asset, $name) - { - if ($vars = $asset->getVars()) { - $compiler->write("// check variable conditions\n"); - - foreach ($vars as $var) { - $compiler - ->write("if (!isset(\$context['assetic']['vars']['$var'])) {\n") - ->indent() - ->write("throw new \RuntimeException(sprintf('The asset \"".$name."\" expected variable \"".$var."\" to be set, but got only these vars: %s. Did you set-up a value supplier?', isset(\$context['assetic']['vars']) && \$context['assetic']['vars'] ? implode(', ', \$context['assetic']['vars']) : '# none #'));\n") - ->outdent() - ->write("}\n") - ; - } - - $compiler->raw("\n"); - } - - $compiler - ->write("// asset \"$name\"\n") - ->write('$context[') - ->repr($this->getAttribute('var_name')) - ->raw('] = ') - ; - - $this->compileAssetUrl($compiler, $asset, $name); - - $compiler - ->raw(";\n") - ->subcompile($this->getNode('body')) - ; - } - - protected function compileAssetUrl(\Twig_Compiler $compiler, AssetInterface $asset, $name) - { - if (!$vars = $asset->getVars()) { - $compiler->repr($asset->getTargetPath()); - - return; - } - - $compiler - ->raw("strtr(") - ->string($asset->getTargetPath()) - ->raw(", array("); - ; - - $first = true; - foreach ($vars as $var) { - if (!$first) { - $compiler->raw(", "); - } - $first = false; - - $compiler - ->string("{".$var."}") - ->raw(" => \$context['assetic']['vars']['$var']") - ; - } - - $compiler - ->raw("))") - ; - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticTokenParser.php b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticTokenParser.php deleted file mode 100644 index c63fd06..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticTokenParser.php +++ /dev/null @@ -1,150 +0,0 @@ -factory = $factory; - $this->tag = $tag; - $this->output = $output; - $this->single = $single; - $this->extensions = $extensions; - } - - public function parse(\Twig_Token $token) - { - $inputs = array(); - $filters = array(); - $name = null; - $attributes = array( - 'output' => $this->output, - 'var_name' => 'asset_url', - 'vars' => array(), - ); - - $stream = $this->parser->getStream(); - while (!$stream->test(\Twig_Token::BLOCK_END_TYPE)) { - if ($stream->test(\Twig_Token::STRING_TYPE)) { - // '@jquery', 'js/src/core/*', 'js/src/extra.js' - $inputs[] = $stream->next()->getValue(); - } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'filter')) { - // filter='yui_js' - $stream->next(); - $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); - $filters = array_merge($filters, array_filter(array_map('trim', explode(',', $stream->expect(\Twig_Token::STRING_TYPE)->getValue())))); - } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'output')) { - // output='js/packed/*.js' OR output='js/core.js' - $stream->next(); - $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); - $attributes['output'] = $stream->expect(\Twig_Token::STRING_TYPE)->getValue(); - } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'name')) { - // name='core_js' - $stream->next(); - $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); - $name = $stream->expect(\Twig_Token::STRING_TYPE)->getValue(); - } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'as')) { - // as='the_url' - $stream->next(); - $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); - $attributes['var_name'] = $stream->expect(\Twig_Token::STRING_TYPE)->getValue(); - } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'debug')) { - // debug=true - $stream->next(); - $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); - $attributes['debug'] = 'true' == $stream->expect(\Twig_Token::NAME_TYPE, array('true', 'false'))->getValue(); - } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'combine')) { - // combine=true - $stream->next(); - $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); - $attributes['combine'] = 'true' == $stream->expect(\Twig_Token::NAME_TYPE, array('true', 'false'))->getValue(); - } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'vars')) { - // vars=['locale','browser'] - $stream->next(); - $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); - $stream->expect(\Twig_Token::PUNCTUATION_TYPE, '['); - - while ($stream->test(\Twig_Token::STRING_TYPE)) { - $attributes['vars'][] = $stream->expect(\Twig_Token::STRING_TYPE)->getValue(); - - if (!$stream->test(\Twig_Token::PUNCTUATION_TYPE, ',')) { - break; - } - - $stream->next(); - } - - $stream->expect(\Twig_Token::PUNCTUATION_TYPE, ']'); - } elseif ($stream->test(\Twig_Token::NAME_TYPE, $this->extensions)) { - // an arbitrary configured attribute - $key = $stream->next()->getValue(); - $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); - $attributes[$key] = $stream->expect(\Twig_Token::STRING_TYPE)->getValue(); - } else { - $token = $stream->getCurrent(); - throw new \Twig_Error_Syntax(sprintf('Unexpected token "%s" of value "%s"', \Twig_Token::typeToEnglish($token->getType(), $token->getLine()), $token->getValue()), $token->getLine()); - } - } - - $stream->expect(\Twig_Token::BLOCK_END_TYPE); - - $endtag = 'end'.$this->getTag(); - $test = function(\Twig_Token $token) use($endtag) { return $token->test($endtag); }; - $body = $this->parser->subparse($test, true); - - $stream->expect(\Twig_Token::BLOCK_END_TYPE); - - if ($this->single && 1 < count($inputs)) { - $inputs = array_slice($inputs, -1); - } - - if (!$name) { - $name = $this->factory->generateAssetName($inputs, $filters, $attributes); - } - - $asset = $this->factory->createAsset($inputs, $filters, $attributes + array('name' => $name)); - - return $this->createNode($asset, $body, $inputs, $filters, $name, $attributes, $token->getLine(), $this->getTag()); - } - - public function getTag() - { - return $this->tag; - } - - protected function createNode(AssetInterface $asset, \Twig_NodeInterface $body, array $inputs, array $filters, $name, array $attributes = array(), $lineno = 0, $tag = null) - { - return new AsseticNode($asset, $body, $inputs, $filters, $name, $attributes, $lineno, $tag); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigFormulaLoader.php b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigFormulaLoader.php deleted file mode 100644 index 6edd25b..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigFormulaLoader.php +++ /dev/null @@ -1,97 +0,0 @@ - - */ -class TwigFormulaLoader implements FormulaLoaderInterface -{ - private $twig; - - public function __construct(\Twig_Environment $twig) - { - $this->twig = $twig; - } - - public function load(ResourceInterface $resource) - { - try { - $tokens = $this->twig->tokenize($resource->getContent(), (string) $resource); - $nodes = $this->twig->parse($tokens); - } catch (\Exception $e) { - return array(); - } - - return $this->loadNode($nodes); - } - - /** - * Loads assets from the supplied node. - * - * @return array An array of asset formulae indexed by name - */ - private function loadNode(\Twig_Node $node) - { - $formulae = array(); - - if ($node instanceof AsseticNode) { - $formulae[$node->getAttribute('name')] = array( - $node->getAttribute('inputs'), - $node->getAttribute('filters'), - array( - 'output' => $node->getAttribute('asset')->getTargetPath(), - 'name' => $node->getAttribute('name'), - 'debug' => $node->getAttribute('debug'), - 'combine' => $node->getAttribute('combine'), - 'vars' => $node->getAttribute('vars'), - ), - ); - } elseif ($node instanceof \Twig_Node_Expression_Function) { - $name = version_compare(\Twig_Environment::VERSION, '1.2.0-DEV', '<') - ? $node->getNode('name')->getAttribute('name') - : $node->getAttribute('name'); - - if ($this->twig->getFunction($name) instanceof AsseticFilterFunction) { - $arguments = array(); - foreach ($node->getNode('arguments') as $argument) { - $arguments[] = eval('return '.$this->twig->compile($argument).';'); - } - - $invoker = $this->twig->getExtension('assetic')->getFilterInvoker($name); - - $inputs = isset($arguments[0]) ? (array) $arguments[0] : array(); - $filters = $invoker->getFilters(); - $options = array_replace($invoker->getOptions(), isset($arguments[1]) ? $arguments[1] : array()); - - if (!isset($options['name'])) { - $options['name'] = $invoker->getFactory()->generateAssetName($inputs, $filters, $options); - } - - $formulae[$options['name']] = array($inputs, $filters, $options); - } - } - - foreach ($node as $child) { - if ($child instanceof \Twig_Node) { - $formulae += $this->loadNode($child); - } - } - - return $formulae; - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigResource.php b/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigResource.php deleted file mode 100644 index 58d4b45..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigResource.php +++ /dev/null @@ -1,54 +0,0 @@ - - */ -class TwigResource implements ResourceInterface -{ - private $loader; - private $name; - - public function __construct(\Twig_LoaderInterface $loader, $name) - { - $this->loader = $loader; - $this->name = $name; - } - - public function getContent() - { - try { - return $this->loader->getSource($this->name); - } catch (\Twig_Error_Loader $e) { - return ''; - } - } - - public function isFresh($timestamp) - { - try { - return $this->loader->isFresh($this->name, $timestamp); - } catch (\Twig_Error_Loader $e) { - return false; - } - } - - public function __toString() - { - return $this->name; - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/AssetFactory.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/AssetFactory.php deleted file mode 100644 index e946d86..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Factory/AssetFactory.php +++ /dev/null @@ -1,386 +0,0 @@ - - */ -class AssetFactory -{ - private $root; - private $debug; - private $output; - private $workers; - private $am; - private $fm; - - /** - * Constructor. - * - * @param string $root The default root directory - * @param string $output The default output string - * @param Boolean $debug Filters prefixed with a "?" will be omitted in debug mode - */ - public function __construct($root, $debug = false) - { - $this->root = rtrim($root, '/'); - $this->debug = $debug; - $this->output = 'assetic/*'; - $this->workers = array(); - } - - /** - * Sets debug mode for the current factory. - * - * @param Boolean $debug Debug mode - */ - public function setDebug($debug) - { - $this->debug = $debug; - } - - /** - * Checks if the factory is in debug mode. - * - * @return Boolean Debug mode - */ - public function isDebug() - { - return $this->debug; - } - - /** - * Sets the default output string. - * - * @param string $output The default output string - */ - public function setDefaultOutput($output) - { - $this->output = $output; - } - - /** - * Adds a factory worker. - * - * @param WorkerInterface $worker A worker - */ - public function addWorker(WorkerInterface $worker) - { - $this->workers[] = $worker; - } - - /** - * Returns the current asset manager. - * - * @return AssetManager|null The asset manager - */ - public function getAssetManager() - { - return $this->am; - } - - /** - * Sets the asset manager to use when creating asset references. - * - * @param AssetManager $am The asset manager - */ - public function setAssetManager(AssetManager $am) - { - $this->am = $am; - } - - /** - * Returns the current filter manager. - * - * @return FilterManager|null The filter manager - */ - public function getFilterManager() - { - return $this->fm; - } - - /** - * Sets the filter manager to use when adding filters. - * - * @param FilterManager $fm The filter manager - */ - public function setFilterManager(FilterManager $fm) - { - $this->fm = $fm; - } - - /** - * Creates a new asset. - * - * Prefixing a filter name with a question mark will cause it to be - * omitted when the factory is in debug mode. - * - * Available options: - * - * * output: An output string - * * name: An asset name for interpolation in output patterns - * * debug: Forces debug mode on or off for this asset - * * root: An array or string of more root directories - * - * @param array|string $inputs An array of input strings - * @param array|string $filters An array of filter names - * @param array $options An array of options - * - * @return AssetCollection An asset collection - */ - public function createAsset($inputs = array(), $filters = array(), array $options = array()) - { - if (!is_array($inputs)) { - $inputs = array($inputs); - } - - if (!is_array($filters)) { - $filters = array($filters); - } - - if (!isset($options['output'])) { - $options['output'] = $this->output; - } - - if (!isset($options['vars'])) { - $options['vars'] = array(); - } - - if (!isset($options['debug'])) { - $options['debug'] = $this->debug; - } - - if (!isset($options['root'])) { - $options['root'] = array($this->root); - } else { - if (!is_array($options['root'])) { - $options['root'] = array($options['root']); - } - - $options['root'][] = $this->root; - } - - if (!isset($options['name'])) { - $options['name'] = $this->generateAssetName($inputs, $filters, $options); - } - - $asset = $this->createAssetCollection(array(), $options); - $extensions = array(); - - // inner assets - foreach ($inputs as $input) { - if (is_array($input)) { - // nested formula - $asset->add(call_user_func_array(array($this, 'createAsset'), $input)); - } else { - $asset->add($this->parseInput($input, $options)); - $extensions[pathinfo($input, PATHINFO_EXTENSION)] = true; - } - } - - // filters - foreach ($filters as $filter) { - if ('?' != $filter[0]) { - $asset->ensureFilter($this->getFilter($filter)); - } elseif (!$options['debug']) { - $asset->ensureFilter($this->getFilter(substr($filter, 1))); - } - } - - // append variables - if (!empty($options['vars'])) { - $toAdd = array(); - foreach ($options['vars'] as $var) { - if (false !== strpos($options['output'], '{'.$var.'}')) { - continue; - } - - $toAdd[] = '{'.$var.'}'; - } - - if ($toAdd) { - $options['output'] = str_replace('*', '*.'.implode('.', $toAdd), $options['output']); - } - } - - // append consensus extension if missing - if (1 == count($extensions) && !pathinfo($options['output'], PATHINFO_EXTENSION) && $extension = key($extensions)) { - $options['output'] .= '.'.$extension; - } - - // output --> target url - $asset->setTargetPath(str_replace('*', $options['name'], $options['output'])); - - // apply workers and return - return $this->applyWorkers($asset); - } - - public function generateAssetName($inputs, $filters, $options = array()) - { - foreach (array_diff(array_keys($options), array('output', 'debug', 'root')) as $key) { - unset($options[$key]); - } - - ksort($options); - - return substr(sha1(serialize($inputs).serialize($filters).serialize($options)), 0, 7); - } - - /** - * Parses an input string string into an asset. - * - * The input string can be one of the following: - * - * * A reference: If the string starts with an "at" sign it will be interpreted as a reference to an asset in the asset manager - * * An absolute URL: If the string contains "://" or starts with "//" it will be interpreted as an HTTP asset - * * A glob: If the string contains a "*" it will be interpreted as a glob - * * A path: Otherwise the string is interpreted as a filesystem path - * - * Both globs and paths will be absolutized using the current root directory. - * - * @param string $input An input string - * @param array $options An array of options - * - * @return AssetInterface An asset - */ - protected function parseInput($input, array $options = array()) - { - if ('@' == $input[0]) { - return $this->createAssetReference(substr($input, 1)); - } - - if (false !== strpos($input, '://') || 0 === strpos($input, '//')) { - return $this->createHttpAsset($input, $options['vars']); - } - - if (self::isAbsolutePath($input)) { - if ($root = self::findRootDir($input, $options['root'])) { - $path = ltrim(substr($input, strlen($root)), '/'); - } else { - $path = null; - } - } else { - $root = $this->root; - $path = $input; - $input = $this->root.'/'.$path; - } - if (false !== strpos($input, '*')) { - return $this->createGlobAsset($input, $root, $options['vars']); - } else { - return $this->createFileAsset($input, $root, $path, $options['vars']); - } - } - - protected function createAssetCollection(array $assets = array(), array $options = array()) - { - return new AssetCollection($assets, array(), null, isset($options['vars']) ? $options['vars'] : array()); - } - - protected function createAssetReference($name) - { - if (!$this->am) { - throw new \LogicException('There is no asset manager.'); - } - - return new AssetReference($this->am, $name); - } - - protected function createHttpAsset($sourceUrl, $vars) - { - return new HttpAsset($sourceUrl, array(), false, $vars); - } - - protected function createGlobAsset($glob, $root = null, $vars) - { - return new GlobAsset($glob, array(), $root, $vars); - } - - protected function createFileAsset($source, $root = null, $path = null, $vars) - { - return new FileAsset($source, array(), $root, $path, $vars); - } - - protected function getFilter($name) - { - if (!$this->fm) { - throw new \LogicException('There is no filter manager.'); - } - - return $this->fm->get($name); - } - - /** - * Filters an asset collection through the factory workers. - * - * Each leaf asset will be processed first, followed by the asset - * collection itself. - * - * @param AssetCollectionInterface $asset An asset collection - */ - private function applyWorkers(AssetCollectionInterface $asset) - { - foreach ($asset as $leaf) { - foreach ($this->workers as $worker) { - $retval = $worker->process($leaf); - - if ($retval instanceof AssetInterface && $leaf !== $retval) { - $asset->replaceLeaf($leaf, $retval); - } - } - } - - foreach ($this->workers as $worker) { - $retval = $worker->process($asset); - - if ($retval instanceof AssetInterface) { - $asset = $retval; - } - } - - return $asset instanceof AssetCollectionInterface ? $asset : $this->createAssetCollection(array($asset)); - } - - static private function isAbsolutePath($path) - { - return '/' == $path[0] || '\\' == $path[0] || (3 < strlen($path) && ctype_alpha($path[0]) && $path[1] == ':' && ('\\' == $path[2] || '/' == $path[2])); - } - - /** - * Loops through the root directories and returns the first match. - * - * @param string $path An absolute path - * @param array $roots An array of root directories - * - * @return string|null The matching root directory, if found - */ - static private function findRootDir($path, array $roots) - { - foreach ($roots as $root) { - if (0 === strpos($path, $root)) { - return $root; - } - } - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/LazyAssetManager.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/LazyAssetManager.php deleted file mode 100644 index d742279..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Factory/LazyAssetManager.php +++ /dev/null @@ -1,204 +0,0 @@ - - */ -class LazyAssetManager extends AssetManager -{ - private $factory; - private $loaders; - private $resources; - private $formulae; - private $loaded; - private $loading; - - /** - * Constructor. - * - * @param AssetFactory $factory The asset factory - * @param array $loaders An array of loaders indexed by alias - */ - public function __construct(AssetFactory $factory, $loaders = array()) - { - $this->factory = $factory; - $this->loaders = array(); - $this->resources = array(); - $this->formulae = array(); - $this->loaded = false; - $this->loading = false; - - foreach ($loaders as $alias => $loader) { - $this->setLoader($alias, $loader); - } - } - - /** - * Adds a loader to the asset manager. - * - * @param string $alias An alias for the loader - * @param FormulaLoaderInterface $loader A loader - */ - public function setLoader($alias, FormulaLoaderInterface $loader) - { - $this->loaders[$alias] = $loader; - $this->loaded = false; - } - - /** - * Adds a resource to the asset manager. - * - * @param ResourceInterface $resource A resource - * @param string $loader The loader alias for this resource - */ - public function addResource(ResourceInterface $resource, $loader) - { - $this->resources[$loader][] = $resource; - $this->loaded = false; - } - - /** - * Returns an array of resources. - * - * @return array An array of resources - */ - public function getResources() - { - $resources = array(); - foreach ($this->resources as $r) { - $resources = array_merge($resources, $r); - } - - return $resources; - } - - /** - * Checks for an asset formula. - * - * @param string $name An asset name - * - * @return Boolean If there is a formula - */ - public function hasFormula($name) - { - if (!$this->loaded) { - $this->load(); - } - - return isset($this->formulae[$name]); - } - - /** - * Returns an asset's formula. - * - * @param string $name An asset name - * - * @return array The formula - * - * @throws \InvalidArgumentException If there is no formula by that name - */ - public function getFormula($name) - { - if (!$this->loaded) { - $this->load(); - } - - if (!isset($this->formulae[$name])) { - throw new \InvalidArgumentException(sprintf('There is no "%s" formula.', $name)); - } - - return $this->formulae[$name]; - } - - /** - * Sets a formula on the asset manager. - * - * @param string $name An asset name - * @param array $formula A formula - */ - public function setFormula($name, array $formula) - { - $this->formulae[$name] = $formula; - } - - /** - * Loads formulae from resources. - * - * @throws \LogicException If a resource has been added to an invalid loader - */ - public function load() - { - if ($this->loading) { - return; - } - - if ($diff = array_diff(array_keys($this->resources), array_keys($this->loaders))) { - throw new \LogicException('The following loader(s) are not registered: '.implode(', ', $diff)); - } - - $this->loading = true; - - foreach ($this->resources as $loader => $resources) { - foreach ($resources as $resource) { - $this->formulae = array_replace($this->formulae, $this->loaders[$loader]->load($resource)); - } - } - - $this->loaded = true; - $this->loading = false; - } - - public function get($name) - { - if (!$this->loaded) { - $this->load(); - } - - if (!parent::has($name) && isset($this->formulae[$name])) { - list($inputs, $filters, $options) = $this->formulae[$name]; - $options['name'] = $name; - parent::set($name, $this->factory->createAsset($inputs, $filters, $options)); - } - - return parent::get($name); - } - - public function has($name) - { - if (!$this->loaded) { - $this->load(); - } - - return isset($this->formulae[$name]) || parent::has($name); - } - - public function getNames() - { - if (!$this->loaded) { - $this->load(); - } - - return array_unique(array_merge(parent::getNames(), array_keys($this->formulae))); - } - - public function isDebug() - { - return $this->factory->isDebug(); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/BasePhpFormulaLoader.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/BasePhpFormulaLoader.php deleted file mode 100644 index a205a03..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/BasePhpFormulaLoader.php +++ /dev/null @@ -1,159 +0,0 @@ - - */ -abstract class BasePhpFormulaLoader implements FormulaLoaderInterface -{ - protected $factory; - protected $prototypes; - - public function __construct(AssetFactory $factory) - { - $this->factory = $factory; - $this->prototypes = array(); - - foreach ($this->registerPrototypes() as $prototype => $options) { - $this->addPrototype($prototype, $options); - } - } - - public function addPrototype($prototype, array $options = array()) - { - $tokens = token_get_all('prototypes[$prototype] = array($tokens, $options); - } - - public function load(ResourceInterface $resource) - { - if (!$nbProtos = count($this->prototypes)) { - throw new \LogicException('There are no prototypes registered.'); - } - - $buffers = array_fill(0, $nbProtos, ''); - $bufferLevels = array_fill(0, $nbProtos, 0); - $buffersInWildcard = array(); - - $tokens = token_get_all($resource->getContent()); - $calls = array(); - - while ($token = array_shift($tokens)) { - $current = self::tokenToString($token); - // loop through each prototype (by reference) - foreach (array_keys($this->prototypes) as $i) { - $prototype =& $this->prototypes[$i][0]; - $options = $this->prototypes[$i][1]; - $buffer =& $buffers[$i]; - $level =& $bufferLevels[$i]; - - if (isset($buffersInWildcard[$i])) { - switch ($current) { - case '(': ++$level; break; - case ')': --$level; break; - } - - $buffer .= $current; - - if (!$level) { - $calls[] = array($buffer.';', $options); - $buffer = ''; - unset($buffersInWildcard[$i]); - } - } elseif ($current == self::tokenToString(current($prototype))) { - $buffer .= $current; - if ('*' == self::tokenToString(next($prototype))) { - $buffersInWildcard[$i] = true; - ++$level; - } - } else { - reset($prototype); - unset($buffersInWildcard[$i]); - $buffer = ''; - } - } - } - - $formulae = array(); - foreach ($calls as $call) { - $formulae += call_user_func_array(array($this, 'processCall'), $call); - } - - return $formulae; - } - - private function processCall($call, array $protoOptions = array()) - { - $tmp = tempnam(sys_get_temp_dir(), 'assetic'); - file_put_contents($tmp, implode("\n", array( - 'registerSetupCode(), - $call, - 'echo serialize($_call);', - ))); - $args = unserialize(shell_exec('php '.escapeshellarg($tmp))); - unlink($tmp); - - $inputs = isset($args[0]) ? self::argumentToArray($args[0]) : array(); - $filters = isset($args[1]) ? self::argumentToArray($args[1]) : array(); - $options = isset($args[2]) ? $args[2] : array(); - - if (!isset($options['debug'])) { - $options['debug'] = $this->factory->isDebug(); - } - - if (!is_array($options)) { - throw new \RuntimeException('The third argument must be omitted, null or an array.'); - } - - // apply the prototype options - $options += $protoOptions; - - if (!isset($options['name'])) { - $options['name'] = $this->factory->generateAssetName($inputs, $filters, $options); - } - - return array($options['name'] => array($inputs, $filters, $options)); - } - - /** - * Returns an array of prototypical calls and options. - * - * @return array Prototypes and options - */ - abstract protected function registerPrototypes(); - - /** - * Returns setup code for the reflection scriptlet. - * - * @return string Some PHP setup code - */ - abstract protected function registerSetupCode(); - - static protected function tokenToString($token) - { - return is_array($token) ? $token[1] : $token; - } - - static protected function argumentToArray($argument) - { - return is_array($argument) ? $argument : array_filter(array_map('trim', explode(',', $argument))); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/CachedFormulaLoader.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/CachedFormulaLoader.php deleted file mode 100644 index 174fdd2..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/CachedFormulaLoader.php +++ /dev/null @@ -1,68 +0,0 @@ - - */ -class CachedFormulaLoader implements FormulaLoaderInterface -{ - private $loader; - private $configCache; - private $debug; - - /** - * Constructor. - * - * When the loader is in debug mode it will ensure the cached formulae - * are fresh before returning them. - * - * @param FormulaLoaderInterface $loader A formula loader - * @param ConfigCache $configCache A config cache - * @param Boolean $debug The debug mode - */ - public function __construct(FormulaLoaderInterface $loader, ConfigCache $configCache, $debug = false) - { - $this->loader = $loader; - $this->configCache = $configCache; - $this->debug = $debug; - } - - public function load(ResourceInterface $resources) - { - if (!$resources instanceof IteratorResourceInterface) { - $resources = array($resources); - } - - $formulae = array(); - - foreach ($resources as $resource) { - $id = (string) $resource; - if (!$this->configCache->has($id) || ($this->debug && !$resource->isFresh($this->configCache->getTimestamp($id)))) { - $formulae += $this->loader->load($resource); - $this->configCache->set($id, $formulae); - } else { - $formulae += $this->configCache->get($id); - } - } - - return $formulae; - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/FormulaLoaderInterface.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/FormulaLoaderInterface.php deleted file mode 100644 index f1e877d..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/FormulaLoaderInterface.php +++ /dev/null @@ -1,34 +0,0 @@ - - */ -interface FormulaLoaderInterface -{ - /** - * Loads formulae from a resource. - * - * Formulae should be loaded the same regardless of the current debug - * mode. Debug considerations should happen downstream. - * - * @param ResourceInterface $resource A resource - * - * @return array An array of formulae - */ - function load(ResourceInterface $resource); -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/FunctionCallsFormulaLoader.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/FunctionCallsFormulaLoader.php deleted file mode 100644 index 9147806..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/FunctionCallsFormulaLoader.php +++ /dev/null @@ -1,53 +0,0 @@ - - */ -class FunctionCallsFormulaLoader extends BasePhpFormulaLoader -{ - protected function registerPrototypes() - { - return array( - 'assetic_javascripts(*)' => array('output' => 'js/*.js'), - 'assetic_stylesheets(*)' => array('output' => 'css/*.css'), - 'assetic_image(*)' => array('output' => 'images/*'), - ); - } - - protected function registerSetupCode() - { - return <<<'EOF' -function assetic_javascripts() -{ - global $_call; - $_call = func_get_args(); -} - -function assetic_stylesheets() -{ - global $_call; - $_call = func_get_args(); -} - -function assetic_image() -{ - global $_call; - $_call = func_get_args(); -} - -EOF; - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/CoalescingDirectoryResource.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/CoalescingDirectoryResource.php deleted file mode 100644 index 07f880e..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/CoalescingDirectoryResource.php +++ /dev/null @@ -1,112 +0,0 @@ - - */ -class CoalescingDirectoryResource implements IteratorResourceInterface -{ - private $directories; - - public function __construct($directories) - { - $this->directories = array(); - - foreach ($directories as $directory) { - $this->addDirectory($directory); - } - } - - public function addDirectory(IteratorResourceInterface $directory) - { - $this->directories[] = $directory; - } - - public function isFresh($timestamp) - { - foreach ($this->getFileResources() as $file) { - if (!$file->isFresh($timestamp)) { - return false; - } - } - - return true; - } - - public function getContent() - { - $parts = array(); - foreach ($this->getFileResources() as $file) { - $parts[] = $file->getContent(); - } - - return implode("\n", $parts); - } - - /** - * Returns a string to uniquely identify the current resource. - * - * @return string An identifying string - */ - public function __toString() - { - $parts = array(); - foreach ($this->directories as $directory) { - $parts[] = (string) $directory; - } - - return implode(',', $parts); - } - - public function getIterator() - { - return new \ArrayIterator($this->getFileResources()); - } - - /** - * Returns the relative version of a filename. - * - * @param ResourceInterface $file The file - * @param ResourceInterface $directory The directory - * - * @return string The name to compare with files from other directories - */ - protected function getRelativeName(ResourceInterface $file, ResourceInterface $directory) - { - return substr((string) $file, strlen((string) $directory)); - } - - /** - * Performs the coalesce. - * - * @return array An array of file resources - */ - private function getFileResources() - { - $paths = array(); - - foreach ($this->directories as $directory) { - foreach ($directory as $file) { - $relative = $this->getRelativeName($file, $directory); - - if (!isset($paths[$relative])) { - $paths[$relative] = $file; - } - } - } - - return array_values($paths); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/DirectoryResource.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/DirectoryResource.php deleted file mode 100644 index 3580d20..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/DirectoryResource.php +++ /dev/null @@ -1,133 +0,0 @@ - - */ -class DirectoryResource implements IteratorResourceInterface -{ - private $path; - private $pattern; - - /** - * Constructor. - * - * @param string $path A directory path - * @param string $pattern A filename pattern - */ - public function __construct($path, $pattern = null) - { - if (DIRECTORY_SEPARATOR != substr($path, -1)) { - $path .= DIRECTORY_SEPARATOR; - } - - $this->path = $path; - $this->pattern = $pattern; - } - - public function isFresh($timestamp) - { - if (!is_dir($this->path) || filemtime($this->path) > $timestamp) { - return false; - } - - foreach ($this as $resource) { - if (!$resource->isFresh($timestamp)) { - return false; - } - } - - return true; - } - - /** - * Returns the combined content of all inner resources. - */ - public function getContent() - { - $content = array(); - foreach ($this as $resource) { - $content[] = $resource->getContent(); - } - - return implode("\n", $content); - } - - public function __toString() - { - return $this->path; - } - - public function getIterator() - { - return is_dir($this->path) - ? new DirectoryResourceIterator($this->getInnerIterator()) - : new \EmptyIterator(); - } - - protected function getInnerIterator() - { - return new DirectoryResourceFilterIterator(new \RecursiveDirectoryIterator($this->path), $this->pattern); - } -} - -/** - * An iterator that converts file objects into file resources. - * - * @author Kris Wallsmith - * @access private - */ -class DirectoryResourceIterator extends \RecursiveIteratorIterator -{ - public function current() - { - return new FileResource(parent::current()->getPathname()); - } -} - -/** - * Filters files by a basename pattern. - * - * @author Kris Wallsmith - * @access private - */ -class DirectoryResourceFilterIterator extends \RecursiveFilterIterator -{ - protected $pattern; - - public function __construct(\RecursiveDirectoryIterator $iterator, $pattern = null) - { - parent::__construct($iterator); - - $this->pattern = $pattern; - } - - public function accept() - { - $file = $this->current(); - $name = $file->getBasename(); - - if ($file->isDir()) { - return '.' != $name[0]; - } else { - return null === $this->pattern || 0 < preg_match($this->pattern, $name); - } - } - - public function getChildren() - { - return new self(new \RecursiveDirectoryIterator($this->current()->getPathname()), $this->pattern); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/FileResource.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/FileResource.php deleted file mode 100644 index 1486f3e..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/FileResource.php +++ /dev/null @@ -1,47 +0,0 @@ - - */ -class FileResource implements ResourceInterface -{ - private $path; - - /** - * Constructor. - * - * @param string $path The path to a file - */ - public function __construct($path) - { - $this->path = $path; - } - - public function isFresh($timestamp) - { - return file_exists($this->path) && filemtime($this->path) <= $timestamp; - } - - public function getContent() - { - return file_exists($this->path) ? file_get_contents($this->path) : ''; - } - - public function __toString() - { - return $this->path; - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/IteratorResourceInterface.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/IteratorResourceInterface.php deleted file mode 100644 index 02d797f..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/IteratorResourceInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - */ -interface IteratorResourceInterface extends ResourceInterface, \IteratorAggregate -{ -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/ResourceInterface.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/ResourceInterface.php deleted file mode 100644 index d53ffcd..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/ResourceInterface.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ -interface ResourceInterface -{ - /** - * Checks if a timestamp represents the latest resource. - * - * @param integer $timestamp A UNIX timestamp - * - * @return Boolean True if the timestamp is up to date - */ - function isFresh($timestamp); - - /** - * Returns the content of the resource. - * - * @return string The content - */ - function getContent(); - - /** - * Returns a unique string for the current resource. - * - * @return string A unique string to identity the current resource - */ - function __toString(); -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/EnsureFilterWorker.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/EnsureFilterWorker.php deleted file mode 100644 index 189cab8..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/EnsureFilterWorker.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @todo A better asset-matcher mechanism - */ -class EnsureFilterWorker implements WorkerInterface -{ - const CHECK_SOURCE = 1; - const CHECK_TARGET = 2; - - private $pattern; - private $filter; - private $flags; - - /** - * Constructor. - * - * @param string $pattern A regex for checking the asset's target URL - * @param FilterInterface $filter A filter to apply if the regex matches - * @param integer $flags Flags for what to check - */ - public function __construct($pattern, FilterInterface $filter, $flags = null) - { - if (null === $flags) { - $flags = self::CHECK_SOURCE | self::CHECK_TARGET; - } - - $this->pattern = $pattern; - $this->filter = $filter; - $this->flags = $flags; - } - - public function process(AssetInterface $asset) - { - if ( - (self::CHECK_SOURCE === (self::CHECK_SOURCE & $this->flags) && preg_match($this->pattern, $asset->getSourcePath())) - || - (self::CHECK_TARGET === (self::CHECK_TARGET & $this->flags) && preg_match($this->pattern, $asset->getTargetPath())) - ) { - $asset->ensureFilter($this->filter); - } - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/WorkerInterface.php b/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/WorkerInterface.php deleted file mode 100644 index 003e4e4..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/WorkerInterface.php +++ /dev/null @@ -1,31 +0,0 @@ - - */ -interface WorkerInterface -{ - /** - * Processes an asset. - * - * @param AssetInterface $asset An asset - * - * @return AssetInterface|null May optionally return a replacement asset - */ - function process(AssetInterface $asset); -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/BaseCssFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/BaseCssFilter.php deleted file mode 100644 index 0447fbc..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/BaseCssFilter.php +++ /dev/null @@ -1,71 +0,0 @@ - - */ -abstract class BaseCssFilter implements FilterInterface -{ - /** - * Filters all references -- url() and "@import" -- through a callable. - * - * @param string $content The CSS - * @param mixed $callback A PHP callable - * - * @return string The filtered CSS - */ - protected function filterReferences($content, $callback, $limit = -1, & $count = 0) - { - $content = $this->filterUrls($content, $callback, $limit, $count); - $content = $this->filterImports($content, $callback, $limit, $count, false); - - return $content; - } - - /** - * Filters all CSS url()'s through a callable. - * - * @param string $content The CSS - * @param mixed $callback A PHP callable - * @param integer $limit Limit the number of replacements - * @param integer $count Will be populated with the count - * - * @return string The filtered CSS - */ - protected function filterUrls($content, $callback, $limit = -1, & $count = 0) - { - return preg_replace_callback('/url\((["\']?)(?.*?)(\\1)\)/', $callback, $content, $limit, $count); - } - - /** - * Filters all CSS imports through a callable. - * - * @param string $content The CSS - * @param mixed $callback A PHP callable - * @param integer $limit Limit the number of replacements - * @param integer $count Will be populated with the count - * @param Boolean $includeUrl Whether to include url() in the pattern - * - * @return string The filtered CSS - */ - protected function filterImports($content, $callback, $limit = -1, & $count = 0, $includeUrl = true) - { - $pattern = $includeUrl - ? '/@import (?:url\()?(\'|"|)(?[^\'"\)\n\r]*)\1\)?;?/' - : '/@import (?!url\()(\'|"|)(?[^\'"\)\n\r]*)\1;?/'; - - return preg_replace_callback($pattern, $callback, $content, $limit, $count); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CallablesFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CallablesFilter.php deleted file mode 100644 index 323d11c..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CallablesFilter.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -class CallablesFilter implements FilterInterface -{ - private $loader; - private $dumper; - - public function __construct($loader = null, $dumper = null) - { - $this->loader = $loader; - $this->dumper = $dumper; - } - - public function filterLoad(AssetInterface $asset) - { - if (null !== $callable = $this->loader) { - $callable($asset); - } - } - - public function filterDump(AssetInterface $asset) - { - if (null !== $callable = $this->dumper) { - $callable($asset); - } - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CoffeeScriptFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CoffeeScriptFilter.php deleted file mode 100644 index 13a54e7..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CoffeeScriptFilter.php +++ /dev/null @@ -1,73 +0,0 @@ - - */ -class CoffeeScriptFilter implements FilterInterface -{ - private $coffeePath; - private $nodePath; - - // coffee options - private $bare; - - public function __construct($coffeePath = '/usr/bin/coffee', $nodePath = '/usr/bin/node') - { - $this->coffeePath = $coffeePath; - $this->nodePath = $nodePath; - } - - public function setBare($bare) - { - $this->bare = $bare; - } - - public function filterLoad(AssetInterface $asset) - { - $input = tempnam(sys_get_temp_dir(), 'assetic_coffeescript'); - file_put_contents($input, $asset->getContent()); - - $pb = new ProcessBuilder(array( - $this->nodePath, - $this->coffeePath, - '-cp', - )); - - if ($this->bare) { - $pb->add('--bare'); - } - - $pb->add($input); - $proc = $pb->getProcess(); - $code = $proc->run(); - unlink($input); - - if (0 < $code) { - throw FilterException::fromProcess($proc)->setInput($asset->getContent()); - } - - $asset->setContent($proc->getOutput()); - } - - public function filterDump(AssetInterface $asset) - { - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CompassFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CompassFilter.php deleted file mode 100644 index a4de031..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CompassFilter.php +++ /dev/null @@ -1,358 +0,0 @@ - - */ -class CompassFilter implements FilterInterface -{ - private $compassPath; - private $rubyPath; - private $scss; - - // sass options - private $unixNewlines; - private $debugInfo; - private $cacheLocation; - private $noCache; - - // compass options - private $force; - private $style; - private $quiet; - private $boring; - private $noLineComments; - private $imagesDir; - private $javascriptsDir; - - // compass configuration file options - private $plugins = array(); - private $loadPaths = array(); - private $httpPath; - private $httpImagesPath; - private $generatedImagesPath; - private $httpJavascriptsPath; - - public function __construct($compassPath = '/usr/bin/compass', $rubyPath = null) - { - $this->compassPath = $compassPath; - $this->rubyPath = $rubyPath; - $this->cacheLocation = sys_get_temp_dir(); - - if ('cli' !== php_sapi_name()) { - $this->boring = true; - } - } - - public function setScss($scss) - { - $this->scss = $scss; - } - - // sass options setters - public function setUnixNewlines($unixNewlines) - { - $this->unixNewlines = $unixNewlines; - } - - public function setDebugInfo($debugInfo) - { - $this->debugInfo = $debugInfo; - } - - public function setCacheLocation($cacheLocation) - { - $this->cacheLocation = $cacheLocation; - } - - public function setNoCache($noCache) - { - $this->noCache = $noCache; - } - - // compass options setters - public function setForce($force) - { - $this->force = $force; - } - - public function setStyle($style) - { - $this->style = $style; - } - - public function setQuiet($quiet) - { - $this->quiet = $quiet; - } - - public function setBoring($boring) - { - $this->boring = $boring; - } - - public function setNoLineComments($noLineComments) - { - $this->noLineComments = $noLineComments; - } - - public function setImagesDir($imagesDir) - { - $this->imagesDir = $imagesDir; - } - - public function setJavascriptsDir($javascriptsDir) - { - $this->javascriptsDir = $javascriptsDir; - } - - // compass configuration file options setters - public function setPlugins(array $plugins) - { - $this->plugins = $plugins; - } - - public function addPlugin($plugin) - { - $this->plugins[] = $plugin; - } - - public function setLoadPaths(array $loadPaths) - { - $this->loadPaths = $loadPaths; - } - - public function addLoadPath($loadPath) - { - $this->loadPaths[] = $loadPath; - } - - public function setHttpPath($httpPath) - { - $this->httpPath = $httpPath; - } - - public function setHttpImagesPath($httpImagesPath) - { - $this->httpImagesPath = $httpImagesPath; - } - - public function setGeneratedImagesPath($generatedImagesPath) - { - $this->generatedImagesPath = $generatedImagesPath; - } - - public function setHttpJavascriptsPath($httpJavascriptsPath) - { - $this->httpJavascriptsPath = $httpJavascriptsPath; - } - - public function filterLoad(AssetInterface $asset) - { - $root = $asset->getSourceRoot(); - $path = $asset->getSourcePath(); - - $loadPaths = $this->loadPaths; - if ($root && $path) { - $loadPaths[] = dirname($root.'/'.$path); - } - - // compass does not seems to handle symlink, so we use realpath() - $tempDir = realpath(sys_get_temp_dir()); - - $compassProcessArgs = array( - $this->compassPath, - 'compile', - $tempDir, - ); - if (null !== $this->rubyPath) { - array_unshift($compassProcessArgs, $this->rubyPath); - } - - $pb = new ProcessBuilder($compassProcessArgs); - $pb->inheritEnvironmentVariables(); - - if ($this->force) { - $pb->add('--force'); - } - - if ($this->style) { - $pb->add('--output-style')->add($this->style); - } - - if ($this->quiet) { - $pb->add('--quiet'); - } - - if ($this->boring) { - $pb->add('--boring'); - } - - if ($this->noLineComments) { - $pb->add('--no-line-comments'); - } - - // these two options are not passed into the config file - // because like this, compass adapts this to be xxx_dir or xxx_path - // whether it's an absolute path or not - if ($this->imagesDir) { - $pb->add('--images-dir')->add($this->imagesDir); - } - - if ($this->javascriptsDir) { - $pb->add('--javascripts-dir')->add($this->javascriptsDir); - } - - // options in config file - $optionsConfig = array(); - - if (!empty($loadPaths)) { - $optionsConfig['additional_import_paths'] = $loadPaths; - } - - if ($this->unixNewlines) { - $optionsConfig['sass_options']['unix_newlines'] = true; - } - - if ($this->debugInfo) { - $optionsConfig['sass_options']['debug_info'] = true; - } - - if ($this->cacheLocation) { - $optionsConfig['sass_options']['cache_location'] = $this->cacheLocation; - } - - if ($this->noCache) { - $optionsConfig['sass_options']['no_cache'] = true; - } - - if ($this->httpPath) { - $optionsConfig['http_path'] = $this->httpPath; - } - - if ($this->httpImagesPath) { - $optionsConfig['http_images_path'] = $this->httpImagesPath; - } - - if ($this->generatedImagesPath) { - $optionsConfig['generated_images_path'] = $this->generatedImagesPath; - } - - if ($this->httpJavascriptsPath) { - $optionsConfig['http_javascripts_path'] = $this->httpJavascriptsPath; - } - - // options in configuration file - if (count($optionsConfig)) { - $config = array(); - foreach ($this->plugins as $plugin) { - $config[] = sprintf("require '%s'", addcslashes($plugin, '\\')); - } - foreach ($optionsConfig as $name => $value) { - if (!is_array($value)) { - $config[] = sprintf('%s = "%s"', $name, addcslashes($value, '\\')); - } elseif (!empty($value)) { - $config[] = sprintf('%s = %s', $name, $this->formatArrayToRuby($value)); - } - } - - $configFile = tempnam($tempDir, 'assetic_compass'); - file_put_contents($configFile, implode("\n", $config)."\n"); - $pb->add('--config')->add($configFile); - } - - $pb->add('--sass-dir')->add('')->add('--css-dir')->add(''); - - // compass choose the type (sass or scss from the filename) - if (null !== $this->scss) { - $type = $this->scss ? 'scss' : 'sass'; - } elseif ($path) { - // FIXME: what if the extension is something else? - $type = pathinfo($path, PATHINFO_EXTENSION); - } else { - $type = 'scss'; - } - - $tempName = tempnam($tempDir, 'assetic_compass'); - unlink($tempName); // FIXME: don't use tempnam() here - - // input - $input = $tempName.'.'.$type; - - // work-around for https://github.com/chriseppstein/compass/issues/748 - if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - $input = str_replace('\\', '/', $input); - } - - $pb->add($input); - file_put_contents($input, $asset->getContent()); - - // output - $output = $tempName.'.css'; - - // it's not really usefull but... https://github.com/chriseppstein/compass/issues/376 - $pb->setEnv('HOME', sys_get_temp_dir()); - - $proc = $pb->getProcess(); - $code = $proc->run(); - - if (0 < $code) { - unlink($input); - if (isset($configFile)) { - unlink($configFile); - } - - throw FilterException::fromProcess($proc)->setInput($asset->getContent()); - } - - $asset->setContent(file_get_contents($output)); - - unlink($input); - unlink($output); - if (isset($configFile)) { - unlink($configFile); - } - } - - public function filterDump(AssetInterface $asset) - { - } - - private function formatArrayToRuby($array) - { - $output = array(); - - // does we have an associative array ? - if (count(array_filter(array_keys($array), "is_numeric")) != count($array)) { - foreach ($array as $name => $value) { - $output[] = sprintf(' :%s => "%s"', $name, addcslashes($value, '\\')); - } - $output = "{\n".implode(",\n", $output)."\n}"; - } else { - foreach ($array as $name => $value) { - $output[] = sprintf(' "%s"', addcslashes($value, '\\')); - } - $output = "[\n".implode(",\n", $output)."\n]"; - } - - return $output; - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssEmbedFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssEmbedFilter.php deleted file mode 100644 index 7e8a80b..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssEmbedFilter.php +++ /dev/null @@ -1,139 +0,0 @@ - - */ -class CssEmbedFilter implements FilterInterface -{ - private $jarPath; - private $javaPath; - private $charset; - private $mhtml; // Enable MHTML mode. - private $mhtmlRoot; // Use as the MHTML root for the file. - private $root; // Prepends to all relative URLs. - private $skipMissing; // Don't throw an error for missing image files. - private $maxUriLength; // Maximum length for a data URI. Defaults to 32768. - private $maxImageSize; // Maximum image size (in bytes) to convert. - - public function __construct($jarPath, $javaPath = '/usr/bin/java') - { - $this->jarPath = $jarPath; - $this->javaPath = $javaPath; - } - - public function setCharset($charset) - { - $this->charset = $charset; - } - - public function setMhtml($mhtml) - { - $this->mhtml = $mhtml; - } - - public function setMhtmlRoot($mhtmlRoot) - { - $this->mhtmlRoot = $mhtmlRoot; - } - - public function setRoot($root) - { - $this->root = $root; - } - - public function setSkipMissing($skipMissing) - { - $this->skipMissing = $skipMissing; - } - - public function setMaxUriLength($maxUriLength) - { - $this->maxUriLength = $maxUriLength; - } - - public function setMaxImageSize($maxImageSize) - { - $this->maxImageSize = $maxImageSize; - } - - public function filterLoad(AssetInterface $asset) - { - } - - public function filterDump(AssetInterface $asset) - { - $pb = new ProcessBuilder(array( - $this->javaPath, - '-jar', - $this->jarPath, - )); - - if (null !== $this->charset) { - $pb->add('--charset')->add($this->charset); - } - - if ($this->mhtml) { - $pb->add('--mhtml'); - } - - if (null !== $this->mhtmlRoot) { - $pb->add('--mhtmlroot')->add($this->mhtmlRoot); - } - - // automatically define root if not already defined - if (null === $this->root) { - $root = $asset->getSourceRoot(); - $path = $asset->getSourcePath(); - - if ($root && $path) { - $pb->add('--root')->add(dirname($root.'/'.$path)); - } - } else { - $pb->add('--root')->add($this->root); - } - - if ($this->skipMissing) { - $pb->add('--skip-missing'); - } - - if (null !== $this->maxUriLength) { - $pb->add('--max-uri-length')->add($this->maxUriLength); - } - - if (null !== $this->maxImageSize) { - $pb->add('--max-image-size')->add($this->maxImageSize); - } - - // input - $pb->add($input = tempnam(sys_get_temp_dir(), 'assetic_cssembed')); - file_put_contents($input, $asset->getContent()); - - $proc = $pb->getProcess(); - $code = $proc->run(); - unlink($input); - - if (0 < $code) { - throw FilterException::fromProcess($proc)->setInput($asset->getContent()); - } - - $asset->setContent($proc->getOutput()); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssImportFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssImportFilter.php deleted file mode 100644 index aa1a7d9..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssImportFilter.php +++ /dev/null @@ -1,107 +0,0 @@ - - */ -class CssImportFilter extends BaseCssFilter -{ - private $importFilter; - - /** - * Constructor. - * - * @param FilterInterface $importFilter Filter for each imported asset - */ - public function __construct(FilterInterface $importFilter = null) - { - $this->importFilter = $importFilter ?: new CssRewriteFilter(); - } - - public function filterLoad(AssetInterface $asset) - { - $importFilter = $this->importFilter; - $sourceRoot = $asset->getSourceRoot(); - $sourcePath = $asset->getSourcePath(); - - $callback = function($matches) use($importFilter, $sourceRoot, $sourcePath) - { - if (!$matches['url'] || null === $sourceRoot) { - return $matches[0]; - } - - $importRoot = $sourceRoot; - - if (false !== strpos($matches['url'], '://')) { - // absolute - list($importScheme, $tmp) = explode('://', $matches['url'], 2); - list($importHost, $importPath) = explode('/', $tmp, 2); - $importRoot = $importScheme.'://'.$importHost; - } elseif (0 === strpos($matches['url'], '//')) { - // protocol-relative - list($importHost, $importPath) = explode('/', substr($matches['url'], 2), 2); - $importHost = '//'.$importHost; - } elseif ('/' == $matches['url'][0]) { - // root-relative - $importPath = substr($matches['url'], 1); - } elseif (null !== $sourcePath) { - // document-relative - $importPath = $matches['url']; - if ('.' != $sourceDir = dirname($sourcePath)) { - $importPath = $sourceDir.'/'.$importPath; - } - } else { - return $matches[0]; - } - - // ignore other imports - if ('css' != pathinfo($importPath, PATHINFO_EXTENSION)) { - return $matches[0]; - } - - $importSource = $importRoot.'/'.$importPath; - if (false !== strpos($importSource, '://') || 0 === strpos($importSource, '//')) { - $import = new HttpAsset($importSource, array($importFilter), true); - } elseif (!file_exists($importSource)) { - // ignore not found imports - return $matches[0]; - } else { - $import = new FileAsset($importSource, array($importFilter), $importRoot, $importPath); - } - - $import->setTargetPath($sourcePath); - - return $import->dump(); - }; - - $content = $asset->getContent(); - $lastHash = md5($content); - - do { - $content = $this->filterImports($content, $callback); - $hash = md5($content); - } while ($lastHash != $hash && $lastHash = $hash); - - $asset->setContent($content); - } - - public function filterDump(AssetInterface $asset) - { - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssMinFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssMinFilter.php deleted file mode 100644 index cc01672..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssMinFilter.php +++ /dev/null @@ -1,74 +0,0 @@ - - */ -class CssMinFilter implements FilterInterface -{ - private $filters; - private $plugins; - - public function __construct() - { - $this->filters = array(); - $this->plugins = array(); - } - - public function setFilters(array $filters) - { - $this->filters = $filters; - } - - public function setFilter($name, $value) - { - $this->filters[$name] = $value; - } - - public function setPlugins(array $plugins) - { - $this->plugins = $plugins; - } - - public function setPlugin($name, $value) - { - $this->plugins[$name] = $value; - } - - public function filterLoad(AssetInterface $asset) - { - } - - public function filterDump(AssetInterface $asset) - { - $filters = $this->filters; - $plugins = $this->plugins; - - if (isset($filters['ImportImports']) && true === $filters['ImportImports']) { - $root = $asset->getSourceRoot(); - $path = $asset->getSourcePath(); - if ($root && $path) { - $filters['ImportImports'] = array('BasePath' => dirname($root.'/'.$path)); - } else { - unset($filters['ImportImports']); - } - } - - $asset->setContent(\CssMin::minify($asset->getContent(), $filters, $plugins)); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssRewriteFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssRewriteFilter.php deleted file mode 100644 index c431437..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssRewriteFilter.php +++ /dev/null @@ -1,94 +0,0 @@ - - */ -class CssRewriteFilter extends BaseCssFilter -{ - public function filterLoad(AssetInterface $asset) - { - } - - public function filterDump(AssetInterface $asset) - { - $sourceBase = $asset->getSourceRoot(); - $sourcePath = $asset->getSourcePath(); - $targetPath = $asset->getTargetPath(); - - if (null === $sourcePath || null === $targetPath || $sourcePath == $targetPath) { - return; - } - - // learn how to get from the target back to the source - if (false !== strpos($sourceBase, '://')) { - list($scheme, $url) = explode('://', $sourceBase.'/'.$sourcePath, 2); - list($host, $path) = explode('/', $url, 2); - - $host = $scheme.'://'.$host.'/'; - $path = false === strpos($path, '/') ? '' : dirname($path); - $path .= '/'; - } else { - // assume source and target are on the same host - $host = ''; - - // pop entries off the target until it fits in the source - if ('.' == dirname($sourcePath)) { - $path = str_repeat('../', substr_count($targetPath, '/')); - } elseif ('.' == $targetDir = dirname($targetPath)) { - $path = dirname($sourcePath).'/'; - } else { - $path = ''; - while (0 !== strpos($sourcePath, $targetDir)) { - if (false !== $pos = strrpos($targetDir, '/')) { - $targetDir = substr($targetDir, 0, $pos); - $path .= '../'; - } else { - $targetDir = ''; - $path .= '../'; - break; - } - } - $path .= ltrim(substr(dirname($sourcePath).'/', strlen($targetDir)), '/'); - } - } - - $content = $this->filterReferences($asset->getContent(), function($matches) use($host, $path) - { - if (false !== strpos($matches['url'], '://') || 0 === strpos($matches['url'], '//') || 0 === strpos($matches['url'], 'data:')) { - // absolute or protocol-relative or data uri - return $matches[0]; - } - - if ('/' == $matches['url'][0]) { - // root relative - return str_replace($matches['url'], $host.$matches['url'], $matches[0]); - } - - // document relative - $url = $matches['url']; - while (0 === strpos($url, '../') && 2 <= substr_count($path, '/')) { - $path = substr($path, 0, strrpos(rtrim($path, '/'), '/') + 1); - $url = substr($url, 3); - } - - return str_replace($matches['url'], $host.$path.$url, $matches[0]); - }); - - $asset->setContent($content); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterCollection.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterCollection.php deleted file mode 100644 index 1ee743d..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterCollection.php +++ /dev/null @@ -1,82 +0,0 @@ - - */ -class FilterCollection implements FilterInterface, \IteratorAggregate, \Countable -{ - private $filters = array(); - - public function __construct($filters = array()) - { - foreach ($filters as $filter) { - $this->ensure($filter); - } - } - - /** - * Checks that the current collection contains the supplied filter. - * - * If the supplied filter is another filter collection, each of its - * filters will be checked. - */ - public function ensure(FilterInterface $filter) - { - if ($filter instanceof \Traversable) { - foreach ($filter as $f) { - $this->ensure($f); - } - } elseif (!in_array($filter, $this->filters, true)) { - $this->filters[] = $filter; - } - } - - public function all() - { - return $this->filters; - } - - public function clear() - { - $this->filters = array(); - } - - public function filterLoad(AssetInterface $asset) - { - foreach ($this->filters as $filter) { - $filter->filterLoad($asset); - } - } - - public function filterDump(AssetInterface $asset) - { - foreach ($this->filters as $filter) { - $filter->filterDump($asset); - } - } - - public function getIterator() - { - return new \ArrayIterator($this->filters); - } - - public function count() - { - return count($this->filters); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterInterface.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterInterface.php deleted file mode 100644 index 0d816c2..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterInterface.php +++ /dev/null @@ -1,36 +0,0 @@ - - */ -interface FilterInterface -{ - /** - * Filters an asset after it has been loaded. - * - * @param AssetInterface $asset An asset - */ - function filterLoad(AssetInterface $asset); - - /** - * Filters an asset just before it's dumped. - * - * @param AssetInterface $asset An asset - */ - function filterDump(AssetInterface $asset); -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/BaseCompilerFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/BaseCompilerFilter.php deleted file mode 100644 index e571158..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/BaseCompilerFilter.php +++ /dev/null @@ -1,84 +0,0 @@ - - */ -abstract class BaseCompilerFilter implements FilterInterface -{ - // compilation levels - const COMPILE_WHITESPACE_ONLY = 'WHITESPACE_ONLY'; - const COMPILE_SIMPLE_OPTIMIZATIONS = 'SIMPLE_OPTIMIZATIONS'; - const COMPILE_ADVANCED_OPTIMIZATIONS = 'ADVANCED_OPTIMIZATIONS'; - - // formatting modes - const FORMAT_PRETTY_PRINT = 'pretty_print'; - const FORMAT_PRINT_INPUT_DELIMITER = 'print_input_delimiter'; - - // warning levels - const LEVEL_QUIET = 'QUIET'; - const LEVEL_DEFAULT = 'DEFAULT'; - const LEVEL_VERBOSE = 'VERBOSE'; - - protected $compilationLevel; - protected $jsExterns; - protected $externsUrl; - protected $excludeDefaultExterns; - protected $formatting; - protected $useClosureLibrary; - protected $warningLevel; - - public function setCompilationLevel($compilationLevel) - { - $this->compilationLevel = $compilationLevel; - } - - public function setJsExterns($jsExterns) - { - $this->jsExterns = $jsExterns; - } - - public function setExternsUrl($externsUrl) - { - $this->externsUrl = $externsUrl; - } - - public function setExcludeDefaultExterns($excludeDefaultExterns) - { - $this->excludeDefaultExterns = $excludeDefaultExterns; - } - - public function setFormatting($formatting) - { - $this->formatting = $formatting; - } - - public function setUseClosureLibrary($useClosureLibrary) - { - $this->useClosureLibrary = $useClosureLibrary; - } - - public function setWarningLevel($warningLevel) - { - $this->warningLevel = $warningLevel; - } - - public function filterLoad(AssetInterface $asset) - { - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerApiFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerApiFilter.php deleted file mode 100644 index 4945961..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerApiFilter.php +++ /dev/null @@ -1,100 +0,0 @@ - - */ -class CompilerApiFilter extends BaseCompilerFilter -{ - public function filterDump(AssetInterface $asset) - { - $query = array( - 'js_code' => $asset->getContent(), - 'output_format' => 'json', - 'output_info' => 'compiled_code', - ); - - if (null !== $this->compilationLevel) { - $query['compilation_level'] = $this->compilationLevel; - } - - if (null !== $this->jsExterns) { - $query['js_externs'] = $this->jsExterns; - } - - if (null !== $this->externsUrl) { - $query['externs_url'] = $this->externsUrl; - } - - if (null !== $this->excludeDefaultExterns) { - $query['exclude_default_externs'] = $this->excludeDefaultExterns ? 'true' : 'false'; - } - - if (null !== $this->formatting) { - $query['formatting'] = $this->formatting; - } - - if (null !== $this->useClosureLibrary) { - $query['use_closure_library'] = $this->useClosureLibrary ? 'true' : 'false'; - } - - if (null !== $this->warningLevel) { - $query['warning_level'] = $this->warningLevel; - } - - if (preg_match('/1|yes|on|true/i', ini_get('allow_url_fopen'))) { - $context = stream_context_create(array('http' => array( - 'method' => 'POST', - 'header' => 'Content-Type: application/x-www-form-urlencoded', - 'content' => http_build_query($query), - ))); - - $response = file_get_contents('http://closure-compiler.appspot.com/compile', false, $context); - $data = json_decode($response); - - } elseif (defined('CURLOPT_POST') && !in_array('curl_init', explode(',', ini_get('disable_functions')))) { - - $ch = curl_init('http://closure-compiler.appspot.com/compile'); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/x-www-form-urlencoded')); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $query); - curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15); - $response = curl_exec($ch); - curl_close($ch); - - $data = json_decode($response); - } else { - throw new \RuntimeException("There is no known way to contact closure compiler available"); - } - - if (isset($data->serverErrors) && 0 < count($data->serverErrors)) { - // @codeCoverageIgnoreStart - throw new \RuntimeException(sprintf('The Google Closure Compiler API threw some server errors: '.print_r($data->serverErrors, true))); - // @codeCoverageIgnoreEnd - } - - if (isset($data->errors) && 0 < count($data->errors)) { - // @codeCoverageIgnoreStart - throw new \RuntimeException(sprintf('The Google Closure Compiler API threw some errors: '.print_r($data->errors, true))); - // @codeCoverageIgnoreEnd - } - - $asset->setContent($data->compiledCode); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerJarFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerJarFilter.php deleted file mode 100644 index a86f06d..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerJarFilter.php +++ /dev/null @@ -1,90 +0,0 @@ - - */ -class CompilerJarFilter extends BaseCompilerFilter -{ - private $jarPath; - private $javaPath; - - public function __construct($jarPath, $javaPath = '/usr/bin/java') - { - $this->jarPath = $jarPath; - $this->javaPath = $javaPath; - } - - public function filterDump(AssetInterface $asset) - { - $cleanup = array(); - - $pb = new ProcessBuilder(array( - $this->javaPath, - '-jar', - $this->jarPath, - )); - - if (null !== $this->compilationLevel) { - $pb->add('--compilation_level')->add($this->compilationLevel); - } - - if (null !== $this->jsExterns) { - $cleanup[] = $externs = tempnam(sys_get_temp_dir(), 'assetic_google_closure_compiler'); - file_put_contents($externs, $this->jsExterns); - $pb->add('--externs')->add($externs); - } - - if (null !== $this->externsUrl) { - $cleanup[] = $externs = tempnam(sys_get_temp_dir(), 'assetic_google_closure_compiler'); - file_put_contents($externs, file_get_contents($this->externsUrl)); - $pb->add('--externs')->add($externs); - } - - if (null !== $this->excludeDefaultExterns) { - $pb->add('--use_only_custom_externs'); - } - - if (null !== $this->formatting) { - $pb->add('--formatting')->add($this->formatting); - } - - if (null !== $this->useClosureLibrary) { - $pb->add('--manage_closure_dependencies'); - } - - if (null !== $this->warningLevel) { - $pb->add('--warning_level')->add($this->warningLevel); - } - - $pb->add('--js')->add($cleanup[] = $input = tempnam(sys_get_temp_dir(), 'assetic_google_closure_compiler')); - file_put_contents($input, $asset->getContent()); - - $proc = $pb->getProcess(); - $code = $proc->run(); - array_map('unlink', $cleanup); - - if (0 < $code) { - throw FilterException::fromProcess($proc)->setInput($asset->getContent()); - } - - $asset->setContent($proc->getOutput()); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/GssFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/GssFilter.php deleted file mode 100644 index 895b3a2..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/GssFilter.php +++ /dev/null @@ -1,142 +0,0 @@ - - */ -class GssFilter implements FilterInterface -{ - private $jarPath; - private $javaPath; - private $allowUnrecognizedFunctions; - private $allowedNonStandardFunctions; - private $copyrightNotice; - private $define; - private $gssFunctionMapProvider; - private $inputOrientation; - private $outputOrientation; - private $prettyPrint; - - public function __construct($jarPath, $javaPath = '/usr/bin/java') - { - $this->jarPath = $jarPath; - $this->javaPath = $javaPath; - } - - public function setAllowUnrecognizedFunctions($allowUnrecognizedFunctions) - { - $this->allowUnrecognizedFunctions = $allowUnrecognizedFunctions; - } - - public function setAllowedNonStandardFunctions($allowNonStandardFunctions) - { - $this->allowedNonStandardFunctions = $allowNonStandardFunctions; - } - - public function setCopyrightNotice($copyrightNotice) - { - $this->copyrightNotice = $copyrightNotice; - } - - public function setDefine($define) - { - $this->define = $define; - } - - public function setGssFunctionMapProvider($gssFunctionMapProvider) - { - $this->gssFunctionMapProvider = $gssFunctionMapProvider; - } - - public function setInputOrientation($inputOrientation) - { - $this->inputOrientation = $inputOrientation; - } - - public function setOutputOrientation($outputOrientation) - { - $this->outputOrientation = $outputOrientation; - } - - public function setPrettyPrint($prettyPrint) - { - $this->prettyPrint = $prettyPrint; - } - - public function filterLoad(AssetInterface $asset) - { - $cleanup = array(); - - $pb = new ProcessBuilder(array( - $this->javaPath, - '-jar', - $this->jarPath, - )); - - if (null !== $this->allowUnrecognizedFunctions) { - $pb->add('--allow-unrecognized-functions'); - } - - if (null !== $this->allowedNonStandardFunctions) { - $pb->add('--allowed_non_standard_functions')->add($this->allowedNonStandardFunctions); - } - - if (null !== $this->copyrightNotice) { - $pb->add('--copyright-notice')->add($this->copyrightNotice); - } - - if (null !== $this->define) { - $pb->add('--define')->add($this->define); - } - - if (null !== $this->gssFunctionMapProvider) { - $pb->add('--gss-function-map-provider')->add($this->gssFunctionMapProvider); - } - - if (null !== $this->inputOrientation) { - $pb->add('--input-orientation')->add($this->inputOrientation); - } - - if (null !== $this->outputOrientation) { - $pb->add('--output-orientation')->add($this->outputOrientation); - } - - if (null !== $this->prettyPrint) { - $pb->add('--pretty-print'); - } - - $pb->add($cleanup[] = $input = tempnam(sys_get_temp_dir(), 'assetic_google_closure_stylesheets_compiler')); - file_put_contents($input, $asset->getContent()); - - $proc = $pb->getProcess(); - $code = $proc->run(); - array_map('unlink', $cleanup); - - if (0 < $code) { - throw FilterException::fromProcess($proc)->setInput($asset->getContent()); - } - - $asset->setContent($proc->getOutput()); - } - - public function filterDump(AssetInterface $asset) - { - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/HashableInterface.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/HashableInterface.php deleted file mode 100644 index 6e9aed9..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/HashableInterface.php +++ /dev/null @@ -1,29 +0,0 @@ - - */ -interface HashableInterface -{ - /** - * Generates a hash for the object - * - * @return string Object hash - */ - function hash(); -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/JSMinFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/JSMinFilter.php deleted file mode 100644 index 1a8a7a7..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/JSMinFilter.php +++ /dev/null @@ -1,34 +0,0 @@ - - */ -class JSMinFilter implements FilterInterface -{ - public function filterLoad(AssetInterface $asset) - { - } - - public function filterDump(AssetInterface $asset) - { - $asset->setContent(\JSMin::minify($asset->getContent())); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/JSMinPlusFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/JSMinPlusFilter.php deleted file mode 100644 index f61d446..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/JSMinPlusFilter.php +++ /dev/null @@ -1,34 +0,0 @@ - - */ -class JSMinPlusFilter implements FilterInterface -{ - public function filterLoad(AssetInterface $asset) - { - } - - public function filterDump(AssetInterface $asset) - { - $asset->setContent(\JSMinPlus::minify($asset->getContent())); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegoptimFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegoptimFilter.php deleted file mode 100644 index 6b97e6c..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegoptimFilter.php +++ /dev/null @@ -1,81 +0,0 @@ - - */ -class JpegoptimFilter implements FilterInterface -{ - private $jpegoptimBin; - private $stripAll; - private $max; - - /** - * Constructor. - * - * @param string $jpegoptimBin Path to the jpegoptim binary - */ - public function __construct($jpegoptimBin = '/usr/bin/jpegoptim') - { - $this->jpegoptimBin = $jpegoptimBin; - } - - public function setStripAll($stripAll) - { - $this->stripAll = $stripAll; - } - - public function setMax($max) - { - $this->max = $max; - } - - public function filterLoad(AssetInterface $asset) - { - } - - public function filterDump(AssetInterface $asset) - { - $pb = new ProcessBuilder(array($this->jpegoptimBin)); - - if ($this->stripAll) { - $pb->add('--strip-all'); - } - - if ($this->max) { - $pb->add('--max='.$this->max); - } - - $pb->add($input = tempnam(sys_get_temp_dir(), 'assetic_jpegoptim')); - file_put_contents($input, $asset->getContent()); - - $proc = $pb->getProcess(); - $proc->run(); - - if (false !== strpos($proc->getOutput(), 'ERROR')) { - unlink($input); - throw FilterException::fromProcess($proc)->setInput($asset->getContent()); - } - - $asset->setContent(file_get_contents($input)); - - unlink($input); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegtranFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegtranFilter.php deleted file mode 100644 index 95a3547..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegtranFilter.php +++ /dev/null @@ -1,103 +0,0 @@ - - */ -class JpegtranFilter implements FilterInterface -{ - const COPY_NONE = 'none'; - const COPY_COMMENTS = 'comments'; - const COPY_ALL = 'all'; - - private $jpegtranBin; - private $optimize; - private $copy; - private $progressive; - private $restart; - - /** - * Constructor. - * - * @param string $jpegtranBin Path to the jpegtran binary - */ - public function __construct($jpegtranBin = '/usr/bin/jpegtran') - { - $this->jpegtranBin = $jpegtranBin; - } - - public function setOptimize($optimize) - { - $this->optimize = $optimize; - } - - public function setCopy($copy) - { - $this->copy = $copy; - } - - public function setProgressive($progressive) - { - $this->progressive = $progressive; - } - - public function setRestart($restart) - { - $this->restart = $restart; - } - - public function filterLoad(AssetInterface $asset) - { - } - - public function filterDump(AssetInterface $asset) - { - $pb = new ProcessBuilder(array($this->jpegtranBin)); - - if ($this->optimize) { - $pb->add('-optimize'); - } - - if ($this->copy) { - $pb->add('-copy')->add($this->copy); - } - - if ($this->progressive) { - $pb->add('-progressive'); - } - - if (null !== $this->restart) { - $pb->add('-restart')->add($this->restart); - } - - $pb->add($input = tempnam(sys_get_temp_dir(), 'assetic_jpegtran')); - file_put_contents($input, $asset->getContent()); - - $proc = $pb->getProcess(); - $code = $proc->run(); - unlink($input); - - if (0 < $code) { - throw FilterException::fromProcess($proc)->setInput($asset->getContent()); - } - - $asset->setContent($proc->getOutput()); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessFilter.php deleted file mode 100644 index cd7e32c..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessFilter.php +++ /dev/null @@ -1,114 +0,0 @@ - - */ -class LessFilter implements FilterInterface -{ - private $nodeBin; - private $nodePaths; - private $compress; - - /** - * Constructor. - * - * @param string $nodeBin The path to the node binary - * @param array $nodePaths An array of node paths - */ - public function __construct($nodeBin = '/usr/bin/node', array $nodePaths = array()) - { - $this->nodeBin = $nodeBin; - $this->nodePaths = $nodePaths; - } - - public function setCompress($compress) - { - $this->compress = $compress; - } - - public function filterLoad(AssetInterface $asset) - { - static $format = <<<'EOF' -var less = require('less'); -var sys = require(process.binding('natives').util ? 'util' : 'sys'); - -new(less.Parser)(%s).parse(%s, function(e, tree) { - if (e) { - less.writeError(e); - process.exit(2); - } - - try { - sys.print(tree.toCSS(%s)); - } catch (e) { - less.writeError(e); - process.exit(3); - } -}); - -EOF; - - $root = $asset->getSourceRoot(); - $path = $asset->getSourcePath(); - - // parser options - $parserOptions = array(); - if ($root && $path) { - $parserOptions['paths'] = array(dirname($root.'/'.$path)); - $parserOptions['filename'] = basename($path); - } - - // tree options - $treeOptions = array(); - if (null !== $this->compress) { - $treeOptions['compress'] = $this->compress; - } - - $pb = new ProcessBuilder(); - $pb->inheritEnvironmentVariables(); - - // node.js configuration - if (0 < count($this->nodePaths)) { - $pb->setEnv('NODE_PATH', implode(':', $this->nodePaths)); - } - - $pb->add($this->nodeBin)->add($input = tempnam(sys_get_temp_dir(), 'assetic_less')); - file_put_contents($input, sprintf($format, - json_encode($parserOptions), - json_encode($asset->getContent()), - json_encode($treeOptions) - )); - - $proc = $pb->getProcess(); - $code = $proc->run(); - unlink($input); - - if (0 < $code) { - throw FilterException::fromProcess($proc)->setInput($asset->getContent()); - } - - $asset->setContent($proc->getOutput()); - } - - public function filterDump(AssetInterface $asset) - { - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessphpFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessphpFilter.php deleted file mode 100644 index 590f041..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessphpFilter.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @author Kris Wallsmith - */ -class LessphpFilter implements FilterInterface -{ - private $presets = array(); - - public function setPresets(array $presets) - { - $this->presets = $presets; - } - - public function filterLoad(AssetInterface $asset) - { - $root = $asset->getSourceRoot(); - $path = $asset->getSourcePath(); - - $lc = new \lessc(); - if ($root && $path) { - $lc->importDir = dirname($root.'/'.$path); - } - - $asset->setContent($lc->parse($asset->getContent(), $this->presets)); - } - - public function filterDump(AssetInterface $asset) - { - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/OptiPngFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/OptiPngFilter.php deleted file mode 100644 index 19da807..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/OptiPngFilter.php +++ /dev/null @@ -1,75 +0,0 @@ - - */ -class OptiPngFilter implements FilterInterface -{ - private $optipngBin; - private $level; - - /** - * Constructor. - * - * @param string $optipngBin Path to the optipng binary - */ - public function __construct($optipngBin = '/usr/bin/optipng') - { - $this->optipngBin = $optipngBin; - } - - public function setLevel($level) - { - $this->level = $level; - } - - public function filterLoad(AssetInterface $asset) - { - } - - public function filterDump(AssetInterface $asset) - { - $pb = new ProcessBuilder(array($this->optipngBin)); - - if (null !== $this->level) { - $pb->add('-o')->add($this->level); - } - - $pb->add('-out')->add($output = tempnam(sys_get_temp_dir(), 'assetic_optipng')); - unlink($output); - - $pb->add($input = tempnam(sys_get_temp_dir(), 'assetic_optipng')); - file_put_contents($input, $asset->getContent()); - - $proc = $pb->getProcess(); - $code = $proc->run(); - - if (0 < $code) { - unlink($input); - throw FilterException::fromProcess($proc)->setInput($asset->getContent()); - } - - $asset->setContent(file_get_contents($output)); - - unlink($input); - unlink($output); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/PackagerFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/PackagerFilter.php deleted file mode 100644 index c3a331b..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/PackagerFilter.php +++ /dev/null @@ -1,64 +0,0 @@ - - */ -class PackagerFilter implements FilterInterface -{ - private $packages; - - public function __construct(array $packages = array()) - { - $this->packages = $packages; - } - - public function addPackage($package) - { - $this->packages[] = $package; - } - - public function filterLoad(AssetInterface $asset) - { - static $manifest = <<getContent()); - - $packager = new \Packager(array_merge(array($package), $this->packages)); - $content = $packager->build(array(), array(), array('Application'.$hash)); - - unlink($package.'/package.yml'); - unlink($package.'/source.js'); - rmdir($package); - - $asset->setContent($content); - } - - public function filterDump(AssetInterface $asset) - { - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/PackerFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/PackerFilter.php deleted file mode 100644 index 5d6640b..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/PackerFilter.php +++ /dev/null @@ -1,56 +0,0 @@ - - */ -class PackerFilter implements FilterInterface -{ - protected $encoding = 'None'; - - protected $fastDecode = true; - - protected $specialChars = false; - - public function setEncoding($encoding) - { - $this->encoding = $encoding; - } - - public function setFastDecode($fastDecode) - { - $this->fastDecode = (bool) $fastDecode; - } - - public function setSpecialChars($specialChars) - { - $this->specialChars = (bool) $specialChars; - } - - public function filterLoad(AssetInterface $asset) - { - } - - public function filterDump(AssetInterface $asset) - { - $packer = new \JavaScriptPacker($asset->getContent(), $this->encoding, $this->fastDecode, $this->specialChars); - $asset->setContent($packer->pack()); - } -} \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/PngoutFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/PngoutFilter.php deleted file mode 100644 index 8e5169a..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/PngoutFilter.php +++ /dev/null @@ -1,128 +0,0 @@ - - */ -class PngoutFilter implements FilterInterface -{ - // -c# - const COLOR_GREY = '0'; - const COLOR_RGB = '2'; - const COLOR_PAL = '3'; - const COLOR_GRAY_ALPHA = '4'; - const COLOR_RGB_ALPHA = '6'; - - // -f# - const FILTER_NONE = '0'; - const FILTER_X = '1'; - const FILTER_Y = '2'; - const FILTER_X_Y = '3'; - const FILTER_PAETH = '4'; - const FILTER_MIXED = '5'; - - // -s# - const STRATEGY_XTREME = '0'; - const STRATEGY_INTENSE = '1'; - const STRATEGY_LONGEST_MATCH = '2'; - const STRATEGY_HUFFMAN_ONLY = '3'; - const STRATEGY_UNCOMPRESSED = '4'; - - private $pngoutBin; - private $color; - private $filter; - private $strategy; - private $blockSplitThreshold; - - /** - * Constructor. - * - * @param string $pngoutBin Path to the pngout binary - */ - public function __construct($pngoutBin = '/usr/bin/pngout') - { - $this->pngoutBin = $pngoutBin; - } - - public function setColor($color) - { - $this->color = $color; - } - - public function setFilter($filter) - { - $this->filter = $filter; - } - - public function setStrategy($strategy) - { - $this->strategy = $strategy; - } - - public function setBlockSplitThreshold($blockSplitThreshold) - { - $this->blockSplitThreshold = $blockSplitThreshold; - } - - public function filterLoad(AssetInterface $asset) - { - } - - public function filterDump(AssetInterface $asset) - { - $pb = new ProcessBuilder(array($this->pngoutBin)); - - if (null !== $this->color) { - $pb->add('-c'.$this->color); - } - - if (null !== $this->filter) { - $pb->add('-f'.$this->filter); - } - - if (null !== $this->strategy) { - $pb->add('-s'.$this->strategy); - } - - if (null !== $this->blockSplitThreshold) { - $pb->add('-b'.$this->blockSplitThreshold); - } - - $pb->add($input = tempnam(sys_get_temp_dir(), 'assetic_pngout')); - file_put_contents($input, $asset->getContent()); - - $output = tempnam(sys_get_temp_dir(), 'assetic_pngout'); - unlink($output); - $pb->add($output .= '.png'); - - $proc = $pb->getProcess(); - $code = $proc->run(); - - if (0 < $code) { - unlink($input); - throw FilterException::fromProcess($proc)->setInput($asset->getContent()); - } - - $asset->setContent(file_get_contents($output)); - - unlink($input); - unlink($output); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/SassFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/SassFilter.php deleted file mode 100644 index 364b4d8..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/SassFilter.php +++ /dev/null @@ -1,176 +0,0 @@ - - */ -class SassFilter implements FilterInterface -{ - const STYLE_NESTED = 'nested'; - const STYLE_EXPANDED = 'expanded'; - const STYLE_COMPACT = 'compact'; - const STYLE_COMPRESSED = 'compressed'; - - private $sassPath; - private $rubyPath; - private $unixNewlines; - private $scss; - private $style; - private $quiet; - private $debugInfo; - private $lineNumbers; - private $loadPaths = array(); - private $cacheLocation; - private $noCache; - private $compass; - - public function __construct($sassPath = '/usr/bin/sass', $rubyPath = null) - { - $this->sassPath = $sassPath; - $this->rubyPath = $rubyPath; - $this->cacheLocation = realpath(sys_get_temp_dir()); - } - - public function setUnixNewlines($unixNewlines) - { - $this->unixNewlines = $unixNewlines; - } - - public function setScss($scss) - { - $this->scss = $scss; - } - - public function setStyle($style) - { - $this->style = $style; - } - - public function setQuiet($quiet) - { - $this->quiet = $quiet; - } - - public function setDebugInfo($debugInfo) - { - $this->debugInfo = $debugInfo; - } - - public function setLineNumbers($lineNumbers) - { - $this->lineNumbers = $lineNumbers; - } - - public function addLoadPath($loadPath) - { - $this->loadPaths[] = $loadPath; - } - - public function setCacheLocation($cacheLocation) - { - $this->cacheLocation = $cacheLocation; - } - - public function setNoCache($noCache) - { - $this->noCache = $noCache; - } - - public function setCompass($compass) - { - $this->compass = $compass; - } - - public function filterLoad(AssetInterface $asset) - { - $sassProcessArgs = array($this->sassPath); - if (null !== $this->rubyPath) { - array_unshift($sassProcessArgs, $this->rubyPath); - } - - $pb = new ProcessBuilder($sassProcessArgs); - - $root = $asset->getSourceRoot(); - $path = $asset->getSourcePath(); - - if ($root && $path) { - $pb->add('--load-path')->add(dirname($root.'/'.$path)); - } - - if ($this->unixNewlines) { - $pb->add('--unix-newlines'); - } - - if (true === $this->scss || (null === $this->scss && 'scss' == pathinfo($path, PATHINFO_EXTENSION))) { - $pb->add('--scss'); - } - - if ($this->style) { - $pb->add('--style')->add($this->style); - } - - if ($this->quiet) { - $pb->add('--quiet'); - } - - if ($this->debugInfo) { - $pb->add('--debug-info'); - } - - if ($this->lineNumbers) { - $pb->add('--line-numbers'); - } - - foreach ($this->loadPaths as $loadPath) { - $pb->add('--load-path')->add($loadPath); - } - - if ($this->cacheLocation) { - $pb->add('--cache-location')->add($this->cacheLocation); - } - - if ($this->noCache) { - $pb->add('--no-cache'); - } - - if ($this->compass) { - $pb->add('--compass'); - } - - // input - $pb->add($input = tempnam(sys_get_temp_dir(), 'assetic_sass')); - file_put_contents($input, $asset->getContent()); - - $proc = $pb->getProcess(); - $code = $proc->run(); - unlink($input); - - if (0 < $code) { - throw FilterException::fromProcess($proc)->setInput($asset->getContent()); - } - - $asset->setContent($proc->getOutput()); - } - - public function filterDump(AssetInterface $asset) - { - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/ScssFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/ScssFilter.php deleted file mode 100644 index 452c6d2..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/ScssFilter.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ -class ScssFilter extends SassFilter -{ - public function __construct($sassPath = '/usr/bin/sass', $rubyPath = null) - { - parent::__construct($sassPath, $rubyPath); - - $this->setScss(true); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/SprocketsFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/SprocketsFilter.php deleted file mode 100644 index 29bc71c..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/SprocketsFilter.php +++ /dev/null @@ -1,148 +0,0 @@ - - */ -class SprocketsFilter implements FilterInterface -{ - private $sprocketsLib; - private $rubyBin; - private $includeDirs; - private $assetRoot; - - /** - * Constructor. - * - * @param string $sprocketsLib Path to the Sprockets lib/ directory - * @param string $rubyBin Path to the ruby binary - */ - public function __construct($sprocketsLib = null, $rubyBin = '/usr/bin/ruby') - { - $this->sprocketsLib = $sprocketsLib; - $this->rubyBin = $rubyBin; - $this->includeDirs = array(); - } - - public function addIncludeDir($directory) - { - $this->includeDirs[] = $directory; - } - - public function setAssetRoot($assetRoot) - { - $this->assetRoot = $assetRoot; - } - - /** - * Hack around a bit, get the job done. - */ - public function filterLoad(AssetInterface $asset) - { - static $format = <<<'EOF' -#!/usr/bin/env ruby - -require %s -%s -options = { :load_path => [], - :source_files => [%s], - :expand_paths => false } - -%ssecretary = Sprockets::Secretary.new(options) -secretary.install_assets if options[:asset_root] -print secretary.concatenation - -EOF; - - $more = ''; - - foreach ($this->includeDirs as $directory) { - $more .= 'options[:load_path] << '.var_export($directory, true)."\n"; - } - - if (null !== $this->assetRoot) { - $more .= 'options[:asset_root] = '.var_export($this->assetRoot, true)."\n"; - } - - if ($more) { - $more .= "\n"; - } - - $tmpAsset = tempnam(sys_get_temp_dir(), 'assetic_sprockets'); - file_put_contents($tmpAsset, $asset->getContent()); - - $input = tempnam(sys_get_temp_dir(), 'assetic_sprockets'); - file_put_contents($input, sprintf($format, - $this->sprocketsLib - ? sprintf('File.join(%s, \'sprockets\')', var_export($this->sprocketsLib, true)) - : '\'sprockets\'', - $this->getHack($asset), - var_export($tmpAsset, true), - $more - )); - - $pb = new ProcessBuilder(array( - $this->rubyBin, - $input, - )); - - $proc = $pb->getProcess(); - $code = $proc->run(); - unlink($tmpAsset); - unlink($input); - - if (0 < $code) { - throw FilterException::fromProcess($proc)->setInput($asset->getContent()); - } - - $asset->setContent($proc->getOutput()); - } - - public function filterDump(AssetInterface $asset) - { - } - - private function getHack(AssetInterface $asset) - { - static $format = <<<'EOF' - -module Sprockets - class Preprocessor - protected - def pathname_for_relative_require_from(source_line) - Sprockets::Pathname.new(@environment, File.join(%s, location_from(source_line))) - end - end -end - -EOF; - - $root = $asset->getSourceRoot(); - $path = $asset->getSourcePath(); - - if ($root && $path) { - return sprintf($format, var_export(dirname($root.'/'.$path), true)); - } - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/StylusFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/StylusFilter.php deleted file mode 100644 index 1ecc958..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/StylusFilter.php +++ /dev/null @@ -1,117 +0,0 @@ - - */ -class StylusFilter implements FilterInterface -{ - private $nodeBin; - private $nodePaths; - private $compress; - - /** - * Constructs filter. - * - * @param string $nodeBin The path to the node binary - * @param array $nodePaths An array of node paths - */ - public function __construct($nodeBin = '/usr/bin/node', array $nodePaths = array()) - { - $this->nodeBin = $nodeBin; - $this->nodePaths = $nodePaths; - } - - /** - * Enable output compression. - * - * @param boolean $compress - */ - public function setCompress($compress) - { - $this->compress = $compress; - } - - /** - * {@inheritdoc} - */ - public function filterLoad(AssetInterface $asset) - { - static $format = <<<'EOF' -var stylus = require('stylus'); -var sys = require(process.binding('natives').util ? 'util' : 'sys'); - -stylus(%s, %s).render(function(e, css){ - if (e) { - throw e; - } - - sys.print(css); - process.exit(0); -}); - -EOF; - - $root = $asset->getSourceRoot(); - $path = $asset->getSourcePath(); - - // parser options - $parserOptions = array(); - if ($root && $path) { - $parserOptions['paths'] = array(dirname($root.'/'.$path)); - $parserOptions['filename'] = basename($path); - } - - if (null !== $this->compress) { - $parserOptions['compress'] = $this->compress; - } - - $pb = new ProcessBuilder(); - $pb->inheritEnvironmentVariables(); - - // node.js configuration - if (0 < count($this->nodePaths)) { - $pb->setEnv('NODE_PATH', implode(':', $this->nodePaths)); - } - - $pb->add($this->nodeBin)->add($input = tempnam(sys_get_temp_dir(), 'assetic_stylus')); - file_put_contents($input, sprintf($format, - json_encode($asset->getContent()), - json_encode($parserOptions) - )); - - $proc = $pb->getProcess(); - $code = $proc->run(); - unlink($input); - - if (0 < $code) { - throw FilterException::fromProcess($proc)->setInput($asset->getContent()); - } - - $asset->setContent($proc->getOutput()); - } - - /** - * {@inheritdoc} - */ - public function filterDump(AssetInterface $asset) - { - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/UglifyJsFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/UglifyJsFilter.php deleted file mode 100644 index c84841a..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/UglifyJsFilter.php +++ /dev/null @@ -1,136 +0,0 @@ - - */ -class UglifyJsFilter implements FilterInterface -{ - private $uglifyJsPath; - private $nodeJsPath; - - private $noCopyright; - private $beautify; - private $unsafe; - - /** - * @param string $uglifyJsPath Absolute path to the uglifyjs executable - * @param string $nodeJsPath Absolute path to the folder containg node.js executable - */ - public function __construct($uglifyJsPath, $nodeJsPath = null) - { - $this->uglifyJsPath = $uglifyJsPath; - $this->nodeJsPath = $nodeJsPath; - } - - /** - * Removes the first block of comments as well - * @param bool $noCopyright True to enable - */ - public function setNoCopyright($noCopyright) - { - $this->noCopyright = $noCopyright; - } - - /** - * Output indented code - * @param bool $beautify True to enable - */ - public function setBeautify($beautify) - { - $this->beautify = $beautify; - } - - /** - * Enable additional optimizations that are known to be unsafe in some situations. - * @param bool $unsafe True to enable - */ - public function setUnsafe($unsafe) - { - $this->unsafe = $unsafe; - } - - /** - * @see Assetic\Filter\FilterInterface::filterLoad() - */ - public function filterLoad(AssetInterface $asset) - { - } - - /** - * Run the asset through UglifyJs - * - * @see Assetic\Filter\FilterInterface::filterDump() - */ - public function filterDump(AssetInterface $asset) - { - $executables = array(); - - if ($this->nodeJsPath !== null) { - $executables[] = $this->nodeJsPath; - } - - $executables[] = $this->uglifyJsPath; - - $pb = new ProcessBuilder($executables); - - if ($this->noCopyright) { - $pb->add('--no-copyright'); - } - - if ($this->beautify) { - $pb->add('--beautify'); - } - - if ($this->unsafe) { - $pb->add('--unsafe'); - } - - // input and output files - $input = tempnam(sys_get_temp_dir(), 'input'); - $output = tempnam(sys_get_temp_dir(), 'output'); - - file_put_contents($input, $asset->getContent()); - $pb->add('-o')->add($output)->add($input); - - $proc = $pb->getProcess(); - $code = $proc->run(); - unlink($input); - - if (0 < $code) { - if (file_exists($output)) { - unlink($output); - } - - if (127 === $code) { - throw new \RuntimeException('Path to node executable could not be resolved.'); - } - - throw FilterException::fromProcess($proc)->setInput($asset->getContent()); - } elseif (!file_exists($output)) { - throw new \RuntimeException('Error creating output file.'); - } - - $uglifiedJs = file_get_contents($output); - unlink($output); - - $asset->setContent($uglifiedJs); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/BaseCompressorFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/BaseCompressorFilter.php deleted file mode 100644 index 920987a..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/BaseCompressorFilter.php +++ /dev/null @@ -1,107 +0,0 @@ - - */ -abstract class BaseCompressorFilter implements FilterInterface -{ - private $jarPath; - private $javaPath; - private $charset; - private $lineBreak; - - public function __construct($jarPath, $javaPath = '/usr/bin/java') - { - $this->jarPath = $jarPath; - $this->javaPath = $javaPath; - } - - public function setCharset($charset) - { - $this->charset = $charset; - } - - public function setLineBreak($lineBreak) - { - $this->lineBreak = $lineBreak; - } - - public function filterLoad(AssetInterface $asset) - { - } - - /** - * Compresses a string. - * - * @param string $content The content to compress - * @param string $type The type of content, either "js" or "css" - * @param array $options An indexed array of additional options - * - * @return string The compressed content - */ - protected function compress($content, $type, $options = array()) - { - $pb = new ProcessBuilder(array( - $this->javaPath, - '-jar', - $this->jarPath, - )); - - foreach ($options as $option) { - $pb->add($option); - } - - if (null !== $this->charset) { - $pb->add('--charset')->add($this->charset); - } - - if (null !== $this->lineBreak) { - $pb->add('--line-break')->add($this->lineBreak); - } - - // input and output files - $tempDir = realpath(sys_get_temp_dir()); - $input = tempnam($tempDir, 'YUI-IN-'); - $output = tempnam($tempDir, 'YUI-OUT-'); - file_put_contents($input, $content); - $pb->add('-o')->add($output)->add('--type')->add($type)->add($input); - - $proc = $pb->getProcess(); - $code = $proc->run(); - unlink($input); - - if (0 < $code) { - if (file_exists($output)) { - unlink($output); - } - - throw FilterException::fromProcess($proc)->setInput($content); - } elseif (!file_exists($output)) { - throw new \RuntimeException('Error creating output file.'); - } - - $retval = file_get_contents($output); - unlink($output); - - return $retval; - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/CssCompressorFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/CssCompressorFilter.php deleted file mode 100644 index 26f7646..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/CssCompressorFilter.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ -class CssCompressorFilter extends BaseCompressorFilter -{ - public function filterDump(AssetInterface $asset) - { - $asset->setContent($this->compress($asset->getContent(), 'css')); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/JsCompressorFilter.php b/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/JsCompressorFilter.php deleted file mode 100644 index db48cf5..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/JsCompressorFilter.php +++ /dev/null @@ -1,61 +0,0 @@ - - */ -class JsCompressorFilter extends BaseCompressorFilter -{ - private $nomunge; - private $preserveSemi; - private $disableOptimizations; - - public function setNomunge($nomunge = true) - { - $this->nomunge = $nomunge; - } - - public function setPreserveSemi($preserveSemi) - { - $this->preserveSemi = $preserveSemi; - } - - public function setDisableOptimizations($disableOptimizations) - { - $this->disableOptimizations = $disableOptimizations; - } - - public function filterDump(AssetInterface $asset) - { - $options = array(); - - if ($this->nomunge) { - $options[] = '--nomunge'; - } - - if ($this->preserveSemi) { - $options[] = '--preserve-semi'; - } - - if ($this->disableOptimizations) { - $options[] = '--disable-optimizations'; - } - - $asset->setContent($this->compress($asset->getContent(), 'js', $options)); - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/FilterManager.php b/vendor/kriswallsmith/assetic/src/Assetic/FilterManager.php deleted file mode 100644 index ee7a37a..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/FilterManager.php +++ /dev/null @@ -1,64 +0,0 @@ - - */ -class FilterManager -{ - private $filters = array(); - - public function set($alias, FilterInterface $filter) - { - $this->checkName($alias); - - $this->filters[$alias] = $filter; - } - - public function get($alias) - { - if (!isset($this->filters[$alias])) { - throw new \InvalidArgumentException(sprintf('There is no "%s" filter.', $alias)); - } - - return $this->filters[$alias]; - } - - public function has($alias) - { - return isset($this->filters[$alias]); - } - - public function getNames() - { - return array_keys($this->filters); - } - - /** - * Checks that a name is valid. - * - * @param string $name An asset name candidate - * - * @throws \InvalidArgumentException If the asset name is invalid - */ - protected function checkName($name) - { - if (!ctype_alnum(str_replace('_', '', $name))) { - throw new \InvalidArgumentException(sprintf('The name "%s" is invalid.', $name)); - } - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Util/PathUtils.php b/vendor/kriswallsmith/assetic/src/Assetic/Util/PathUtils.php deleted file mode 100644 index 244d1a7..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Util/PathUtils.php +++ /dev/null @@ -1,31 +0,0 @@ - - */ -abstract class PathUtils -{ - public static function resolvePath($path, array $vars, array $values) - { - $map = array(); - foreach ($vars as $var) { - if (false === strpos($path, '{'.$var.'}')) { - continue; - } - - if (!isset($values[$var])) { - throw new \InvalidArgumentException(sprintf('The path "%s" contains the variable "%s", but was not given any value for it.', $path, $var)); - } - - $map['{'.$var.'}'] = $values[$var]; - } - - return strtr($path, $map); - } - - private final function __construct() { } -} \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/src/Assetic/Util/TraversableString.php b/vendor/kriswallsmith/assetic/src/Assetic/Util/TraversableString.php deleted file mode 100644 index 9f1a633..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/Util/TraversableString.php +++ /dev/null @@ -1,44 +0,0 @@ - - */ -class TraversableString implements \IteratorAggregate, \Countable -{ - private $one; - private $many; - - public function __construct($one, array $many) - { - $this->one = $one; - $this->many = $many; - } - - public function getIterator() - { - return new \ArrayIterator($this->many); - } - - public function count() - { - return count($this->many); - } - - public function __toString() - { - return (string) $this->one; - } -} diff --git a/vendor/kriswallsmith/assetic/src/Assetic/ValueSupplierInterface.php b/vendor/kriswallsmith/assetic/src/Assetic/ValueSupplierInterface.php deleted file mode 100644 index ee87b9b..0000000 --- a/vendor/kriswallsmith/assetic/src/Assetic/ValueSupplierInterface.php +++ /dev/null @@ -1,29 +0,0 @@ - - */ -interface ValueSupplierInterface -{ - /** - * Returns a map of values. - * - * @return array - */ - function getValues(); -} \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/src/functions.php b/vendor/kriswallsmith/assetic/src/functions.php deleted file mode 100644 index 264589e..0000000 --- a/vendor/kriswallsmith/assetic/src/functions.php +++ /dev/null @@ -1,121 +0,0 @@ -factory = $factory; -} - -/** - * Returns an array of javascript URLs. - * - * @param array|string $inputs Input strings - * @param array|string $filters Filter names - * @param array $options An array of options - * - * @return array An array of javascript URLs - */ -function assetic_javascripts($inputs = array(), $filters = array(), array $options = array()) -{ - if (!isset($options['output'])) { - $options['output'] = 'js/*.js'; - } - - return _assetic_urls($inputs, $filters, $options); -} - -/** - * Returns an array of stylesheet URLs. - * - * @param array|string $inputs Input strings - * @param array|string $filters Filter names - * @param array $options An array of options - * - * @return array An array of stylesheet URLs - */ -function assetic_stylesheets($inputs = array(), $filters = array(), array $options = array()) -{ - if (!isset($options['output'])) { - $options['output'] = 'css/*.css'; - } - - return _assetic_urls($inputs, $filters, $options); -} - -/** - * Returns an image URL. - * - * @param string $input An input - * @param array|string $filters Filter names - * @param array $options An array of options - * - * @return string An image URL - */ -function assetic_image($input, $filters = array(), array $options = array()) -{ - if (!isset($options['output'])) { - $options['output'] = 'images/*'; - } - - $urls = _assetic_urls($input, $filters, $options); - - return current($urls); -} - -/** - * Returns an array of asset urls. - * - * @param array|string $inputs Input strings - * @param array|string $filters Filter names - * @param array $options An array of options - * - * @return array An array of URLs - */ -function _assetic_urls($inputs = array(), $filters = array(), array $options = array()) -{ - global $_assetic; - - if (!is_array($inputs)) { - $inputs = array_filter(array_map('trim', explode(',', $inputs))); - } - - if (!is_array($filters)) { - $filters = array_filter(array_map('trim', explode(',', $filters))); - } - - $coll = $_assetic->factory->createAsset($inputs, $filters, $options); - - $debug = isset($options['debug']) ? $options['debug'] : $_assetic->factory->isDebug(); - $combine = isset($options['combine']) ? $options['combine'] : !$debug; - - $one = $coll->getTargetPath(); - if ($combine) { - $many = array(); - foreach ($coll as $leaf) { - $many[] = $leaf->getTargetPath(); - } - } else { - $many = array($one); - } - - return new TraversableString($one, $many); -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetCacheTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetCacheTest.php deleted file mode 100644 index 9484f2a..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetCacheTest.php +++ /dev/null @@ -1,175 +0,0 @@ -inner = $this->getMock('Assetic\\Asset\\AssetInterface'); - $this->cache = $this->getMock('Assetic\\Cache\\CacheInterface'); - - $this->asset = new AssetCache($this->inner, $this->cache); - } - - public function testLoadFromCache() - { - $content = 'asdf'; - $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); - - $this->inner->expects($this->once()) - ->method('getFilters') - ->will($this->returnValue(array($filter))); - $this->cache->expects($this->once()) - ->method('has') - ->with($this->isType('string')) - ->will($this->returnValue(true)); - $this->cache->expects($this->once()) - ->method('get') - ->with($this->isType('string')) - ->will($this->returnValue($content)); - $this->inner->expects($this->once()) - ->method('setContent') - ->with($content); - - $this->asset->load($filter); - } - - public function testLoadToCache() - { - $content = 'asdf'; - - $this->inner->expects($this->once()) - ->method('getFilters') - ->will($this->returnValue(array())); - $this->cache->expects($this->once()) - ->method('has') - ->with($this->isType('string')) - ->will($this->returnValue(false)); - $this->inner->expects($this->once())->method('load'); - $this->inner->expects($this->once()) - ->method('getContent') - ->will($this->returnValue($content)); - $this->cache->expects($this->once()) - ->method('set') - ->with($this->isType('string'), $content); - - $this->asset->load(); - } - - public function testDumpFromCache() - { - $content = 'asdf'; - - $this->inner->expects($this->once()) - ->method('getFilters') - ->will($this->returnValue(array())); - $this->cache->expects($this->once()) - ->method('has') - ->with($this->isType('string')) - ->will($this->returnValue(true)); - $this->cache->expects($this->once()) - ->method('get') - ->with($this->isType('string')) - ->will($this->returnValue($content)); - - $this->assertEquals($content, $this->asset->dump(), '->dump() returns the cached value'); - } - - public function testDumpToCache() - { - $content = 'asdf'; - - $this->inner->expects($this->once()) - ->method('getFilters') - ->will($this->returnValue(array())); - $this->cache->expects($this->once()) - ->method('has') - ->with($this->isType('string')) - ->will($this->returnValue(false)); - $this->inner->expects($this->once()) - ->method('dump') - ->will($this->returnValue($content)); - $this->cache->expects($this->once()) - ->method('set') - ->with($this->isType('string'), $content); - - $this->assertEquals($content, $this->asset->dump(), '->dump() returns the dumped value'); - } - - public function testEnsureFilter() - { - $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); - $this->inner->expects($this->once())->method('ensureFilter'); - $this->asset->ensureFilter($filter); - } - - public function testGetFilters() - { - $this->inner->expects($this->once()) - ->method('getFilters') - ->will($this->returnValue(array())); - - $this->assertInternalType('array', $this->asset->getFilters(), '->getFilters() returns the inner asset filters'); - } - - public function testGetContent() - { - $this->inner->expects($this->once()) - ->method('getContent') - ->will($this->returnValue('asdf')); - - $this->assertEquals('asdf', $this->asset->getContent(), '->getContent() returns the inner asset content'); - } - - public function testSetContent() - { - $this->inner->expects($this->once()) - ->method('setContent') - ->with('asdf'); - - $this->asset->setContent('asdf'); - } - - public function testGetSourceRoot() - { - $this->inner->expects($this->once()) - ->method('getSourceRoot') - ->will($this->returnValue('asdf')); - - $this->assertEquals('asdf', $this->asset->getSourceRoot(), '->getSourceRoot() returns the inner asset source root'); - } - - public function testGetSourcePath() - { - $this->inner->expects($this->once()) - ->method('getSourcePath') - ->will($this->returnValue('asdf')); - - $this->assertEquals('asdf', $this->asset->getSourcePath(), '->getSourcePath() returns the inner asset source path'); - } - - public function testGetLastModified() - { - $this->inner->expects($this->once()) - ->method('getLastModified') - ->will($this->returnValue(123)); - - $this->assertEquals(123, $this->asset->getLastModified(), '->getLastModified() returns the inner asset last modified'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetCollectionTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetCollectionTest.php deleted file mode 100644 index 9dd095f..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetCollectionTest.php +++ /dev/null @@ -1,318 +0,0 @@ -assertInstanceOf('Assetic\\Asset\\AssetInterface', $coll, 'AssetCollection implements AssetInterface'); - } - - public function testLoadFilter() - { - $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); - $filter->expects($this->once())->method('filterLoad'); - - $coll = new AssetCollection(array(new StringAsset('')), array($filter)); - $coll->load(); - } - - public function testDumpFilter() - { - $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); - $filter->expects($this->once())->method('filterDump'); - - $coll = new AssetCollection(array(new StringAsset('')), array($filter)); - $coll->dump(); - } - - public function testNestedCollectionLoad() - { - $content = 'foobar'; - - $count = 0; - $matches = array(); - $filter = new CallablesFilter(function($asset) use ($content, & $matches, & $count) - { - ++$count; - if ($content == $asset->getContent()) { - $matches[] = $asset; - } - }); - - $innerColl = new AssetCollection(array(new StringAsset($content))); - $outerColl = new AssetCollection(array($innerColl), array($filter)); - $outerColl->load(); - - $this->assertEquals(1, count($matches), '->load() applies filters to leaves'); - $this->assertEquals(1, $count, '->load() applies filters to leaves only'); - } - - public function testMixedIteration() - { - $asset = new StringAsset('asset'); - $nestedAsset = new StringAsset('nested'); - $innerColl = new AssetCollection(array($nestedAsset)); - - $contents = array(); - $filter = new CallablesFilter(function($asset) use(& $contents) - { - $contents[] = $asset->getContent(); - }); - - $coll = new AssetCollection(array($asset, $innerColl), array($filter)); - $coll->load(); - - $this->assertEquals(array('asset', 'nested'), $contents, '->load() iterates over multiple levels'); - } - - public function testLoadDedupBySourceUrl() - { - $asset1 = new StringAsset('asset', array(), '/some/dir', 'foo.bar'); - $asset2 = new StringAsset('asset', array(), '/some/dir', 'foo.bar'); - - $coll = new AssetCollection(array($asset1, $asset2)); - $coll->load(); - - $this->assertEquals('asset', $coll->getContent(), '->load() detects duplicate assets based on source URL'); - } - - public function testLoadDedupByStrictEquality() - { - $asset = new StringAsset('foo'); - - $coll = new AssetCollection(array($asset, $asset)); - $coll->load(); - - $this->assertEquals('foo', $coll->getContent(), '->load() detects duplicate assets based on strict equality'); - } - - public function testDumpDedupBySourceUrl() - { - $asset1 = new StringAsset('asset', array(), '/some/dir', 'foo.bar'); - $asset2 = new StringAsset('asset', array(), '/some/dir', 'foo.bar'); - - $coll = new AssetCollection(array($asset1, $asset2)); - $coll->load(); - - $this->assertEquals('asset', $coll->dump(), '->dump() detects duplicate assets based on source URL'); - } - - public function testDumpDedupByStrictEquality() - { - $asset = new StringAsset('foo'); - - $coll = new AssetCollection(array($asset, $asset)); - $coll->load(); - - $this->assertEquals('foo', $coll->dump(), '->dump() detects duplicate assets based on strict equality'); - } - - public function testIterationFilters() - { - $count = 0; - $filter = new CallablesFilter(function() use(&$count) { ++$count; }); - - $coll = new AssetCollection(); - $coll->add(new StringAsset('')); - $coll->ensureFilter($filter); - - foreach ($coll as $asset) { - $asset->dump(); - } - - $this->assertEquals(1, $count, 'collection filters are called when child assets are iterated over'); - } - - public function testSetContent() - { - $coll = new AssetCollection(); - $coll->setContent('asdf'); - - $this->assertEquals('asdf', $coll->getContent(), '->setContent() sets the content'); - } - - /** - * @dataProvider getTimestampsAndExpected - */ - public function testGetLastModified($timestamps, $expected) - { - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - - for ($i = 0; $i < count($timestamps); $i++) { - $asset->expects($this->at($i)) - ->method('getLastModified') - ->will($this->returnValue($timestamps[$i])); - } - - $coll = new AssetCollection(array_fill(0, count($timestamps), $asset)); - - $this->assertEquals($expected, $coll->getLastModified(), '->getLastModifed() returns the highest last modified'); - } - - public function getTimestampsAndExpected() - { - return array( - array(array(1, 2, 3), 3), - array(array(5, 4, 3), 5), - array(array(3, 8, 5), 8), - array(array(3, 8, null), 8), - ); - } - - public function testRecursiveIteration() - { - $asset1 = $this->getMock('Assetic\\Asset\\AssetInterface'); - $asset2 = $this->getMock('Assetic\\Asset\\AssetInterface'); - $asset3 = $this->getMock('Assetic\\Asset\\AssetInterface'); - $asset4 = $this->getMock('Assetic\\Asset\\AssetInterface'); - - $coll3 = new AssetCollection(array($asset1, $asset2)); - $coll2 = new AssetCollection(array($asset3, $coll3)); - $coll1 = new AssetCollection(array($asset4, $coll2)); - - $i = 0; - foreach ($coll1 as $a) { - $i++; - } - - $this->assertEquals(4, $i, 'iteration with a recursive iterator is recursive'); - } - - public function testRecursiveDeduplication() - { - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - - $coll3 = new AssetCollection(array($asset, $asset)); - $coll2 = new AssetCollection(array($asset, $coll3)); - $coll1 = new AssetCollection(array($asset, $coll2)); - - $i = 0; - foreach ($coll1 as $a) { - $i++; - } - - $this->assertEquals(1, $i, 'deduplication is performed recursively'); - } - - public function testIteration() - { - $asset1 = new StringAsset('asset1', array(), '/some/dir', 'foo.css'); - $asset2 = new StringAsset('asset2', array(), '/some/dir', 'foo.css'); - $asset3 = new StringAsset('asset3', array(), '/some/dir', 'bar.css'); - - $coll = new AssetCollection(array($asset1, $asset2, $asset3)); - - $count = 0; - foreach ($coll as $a) { - ++$count; - } - - $this->assertEquals(2, $count, 'iterator filters duplicates based on url'); - } - - public function testBasenameCollision() - { - $asset1 = new StringAsset('asset1', array(), '/some/dir', 'foo/foo.css'); - $asset2 = new StringAsset('asset2', array(), '/some/dir', 'bar/foo.css'); - - $coll = new AssetCollection(array($asset1, $asset2)); - - $urls = array(); - foreach ($coll as $leaf) { - $urls[] = $leaf->getTargetPath(); - } - - $this->assertEquals(2, count(array_unique($urls)), 'iterator prevents basename collisions'); - } - - public function testEmptyMtime() - { - $coll = new AssetCollection(); - $this->assertNull($coll->getLastModified(), '->getLastModified() returns null on empty collection'); - } - - public function testLeafManipulation() - { - $coll = new AssetCollection(array(new StringAsset('asdf'))); - - foreach ($coll as $leaf) { - $leaf->setTargetPath('asdf'); - } - - foreach ($coll as $leaf) { - $this->assertEquals('asdf', $leaf->getTargetPath(), 'leaf changes persist between iterations'); - } - } - - public function testRemoveLeaf() - { - $coll = new AssetCollection(array( - $leaf = new StringAsset('asdf'), - )); - - $this->assertTrue($coll->removeLeaf($leaf)); - } - - public function testRemoveRecursiveLeaf() - { - $coll = new AssetCollection(array( - new AssetCollection(array( - $leaf = new StringAsset('asdf'), - )) - )); - - $this->assertTrue($coll->removeLeaf($leaf)); - } - - public function testRemoveInvalidLeaf() - { - $this->setExpectedException('InvalidArgumentException'); - - $coll = new AssetCollection(); - $coll->removeLeaf(new StringAsset('asdf')); - } - - public function testReplaceLeaf() - { - $coll = new AssetCollection(array( - $leaf = new StringAsset('asdf'), - )); - - $this->assertTrue($coll->replaceLeaf($leaf, new StringAsset('foo'))); - } - - public function testReplaceRecursiveLeaf() - { - $coll = new AssetCollection(array( - new AssetCollection(array( - $leaf = new StringAsset('asdf'), - )), - )); - - $this->assertTrue($coll->replaceLeaf($leaf, new StringAsset('foo'))); - } - - public function testReplaceInvalidLeaf() - { - $this->setExpectedException('InvalidArgumentException'); - - $coll = new AssetCollection(); - $coll->replaceLeaf(new StringAsset('foo'), new StringAsset('bar')); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetReferenceTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetReferenceTest.php deleted file mode 100644 index 3a62b77..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetReferenceTest.php +++ /dev/null @@ -1,126 +0,0 @@ -am = $this->getMock('Assetic\\AssetManager'); - $this->ref = new AssetReference($this->am, 'foo'); - } - - /** - * @dataProvider getMethodAndRetVal - */ - public function testMethods($method, $returnValue) - { - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - - $this->am->expects($this->once()) - ->method('get') - ->with('foo') - ->will($this->returnValue($asset)); - $asset->expects($this->once()) - ->method($method) - ->will($this->returnValue($returnValue)); - - $this->assertEquals($returnValue, $this->ref->$method(), '->'.$method.'() returns the asset value'); - } - - public function getMethodAndRetVal() - { - return array( - array('getContent', 'asdf'), - array('getSourceRoot', 'asdf'), - array('getSourcePath', 'asdf'), - array('getTargetPath', 'asdf'), - array('getLastModified', 123), - ); - } - - public function testLazyFilters() - { - $this->am->expects($this->never())->method('get'); - $this->ref->ensureFilter($this->getMock('Assetic\\Filter\\FilterInterface')); - } - - public function testFilterFlush() - { - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - - $this->am->expects($this->exactly(2)) - ->method('get') - ->with('foo') - ->will($this->returnValue($asset)); - $asset->expects($this->once())->method('ensureFilter'); - $asset->expects($this->once()) - ->method('getFilters') - ->will($this->returnValue(array())); - - $this->ref->ensureFilter($this->getMock('Assetic\\Filter\\FilterInterface')); - - $this->assertInternalType('array', $this->ref->getFilters(), '->getFilters() flushes and returns filters'); - } - - public function testSetContent() - { - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - - $this->am->expects($this->once()) - ->method('get') - ->with('foo') - ->will($this->returnValue($asset)); - $asset->expects($this->once()) - ->method('setContent') - ->with('asdf'); - - $this->ref->setContent('asdf'); - } - - public function testLoad() - { - $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - - $this->am->expects($this->exactly(2)) - ->method('get') - ->with('foo') - ->will($this->returnValue($asset)); - $asset->expects($this->once()) - ->method('load') - ->with($filter); - - $this->ref->load($filter); - } - - public function testDump() - { - $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - - $this->am->expects($this->exactly(2)) - ->method('get') - ->with('foo') - ->will($this->returnValue($asset)); - $asset->expects($this->once()) - ->method('dump') - ->with($filter); - - $this->ref->dump($filter); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/FileAssetTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/FileAssetTest.php deleted file mode 100644 index c11d4c0..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/FileAssetTest.php +++ /dev/null @@ -1,72 +0,0 @@ -assertInstanceOf('Assetic\\Asset\\AssetInterface', $asset, 'Asset implements AssetInterface'); - } - - public function testLazyLoading() - { - $asset = new FileAsset(__FILE__); - $this->assertEmpty($asset->getContent(), 'The asset content is empty before load'); - - $asset->load(); - $this->assertNotEmpty($asset->getContent(), 'The asset content is not empty after load'); - } - - public function testGetLastModifiedType() - { - $asset = new FileAsset(__FILE__); - $this->assertInternalType('integer', $asset->getLastModified(), '->getLastModified() returns an integer'); - } - - public function testGetLastModifiedTypeFileNotFound() - { - $asset = new FileAsset(__DIR__ . "/foo/bar/baz.css"); - - $this->setExpectedException("RuntimeException", "The source file"); - $asset->getLastModified(); - } - - public function testGetLastModifiedValue() - { - $asset = new FileAsset(__FILE__); - $this->assertLessThan(time(), $asset->getLastModified(), '->getLastModified() returns the mtime'); - } - - public function testDefaultBaseAndPath() - { - $asset = new FileAsset(__FILE__); - $this->assertEquals(__DIR__, $asset->getSourceRoot(), '->__construct() defaults base to the asset directory'); - $this->assertEquals(basename(__FILE__), $asset->getSourcePath(), '->__construct() defaults path to the asset basename'); - } - - public function testPathGuessing() - { - $asset = new FileAsset(__FILE__, array(), __DIR__); - $this->assertEquals(basename(__FILE__), $asset->getSourcePath(), '->__construct() guesses the asset path'); - } - - public function testInvalidBase() - { - $this->setExpectedException('InvalidArgumentException'); - - $asset = new FileAsset(__FILE__, array(), __DIR__.'/foo'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/GlobAssetTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/GlobAssetTest.php deleted file mode 100644 index e0d7199..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/GlobAssetTest.php +++ /dev/null @@ -1,61 +0,0 @@ -assertInstanceOf('Assetic\\Asset\\AssetInterface', $asset, 'Asset implements AssetInterface'); - } - - public function testIteration() - { - $assets = new GlobAsset(__DIR__.'/*.php'); - $this->assertGreaterThan(0, iterator_count($assets), 'GlobAsset initializes for iteration'); - } - - public function testRecursiveIteration() - { - $assets = new GlobAsset(__DIR__.'/*.php'); - $this->assertGreaterThan(0, iterator_count($assets), 'GlobAsset initializes for recursive iteration'); - } - - public function testGetLastModifiedType() - { - $assets = new GlobAsset(__DIR__.'/*.php'); - $this->assertInternalType('integer', $assets->getLastModified(), '->getLastModified() returns an integer'); - } - - public function testGetLastModifiedValue() - { - $assets = new GlobAsset(__DIR__.'/*.php'); - $this->assertLessThan(time(), $assets->getLastModified(), '->getLastModified() returns a file mtime'); - } - - public function testLoad() - { - $assets = new GlobAsset(__DIR__.'/*.php'); - $assets->load(); - - $this->assertNotEmpty($assets->getContent(), '->load() loads contents'); - } - - public function testDump() - { - $assets = new GlobAsset(__DIR__.'/*.php'); - $this->assertNotEmpty($assets->dump(), '->dump() dumps contents'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/HttpAssetTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/HttpAssetTest.php deleted file mode 100644 index 960492a..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/HttpAssetTest.php +++ /dev/null @@ -1,58 +0,0 @@ -markTestSkipped('The OpenSSL extension is not loaded.'); - } - - $asset = new HttpAsset(self::JQUERY); - $this->assertInternalType('integer', $asset->getLastModified(), '->getLastModified() returns an integer'); - } - - public function testProtocolRelativeUrl() - { - $asset = new HttpAsset(substr(self::JQUERY, 6)); - $asset->load(); - $this->assertNotEmpty($asset->getContent()); - } - - public function testMalformedUrl() - { - $this->setExpectedException('InvalidArgumentException'); - - new HttpAsset(__FILE__); - } - - public function testInvalidUrl() - { - $this->setExpectedException('RuntimeException'); - - $asset = new HttpAsset('http://invalid.com/foobar'); - $asset->load(); - } - - public function testSourceMetadata() - { - $asset = new HttpAsset(self::JQUERY); - $this->assertEquals('https://ajax.googleapis.com', $asset->getSourceRoot(), '->__construct() set the source root'); - $this->assertEquals('ajax/libs/jquery/1.6.1/jquery.min.js', $asset->getSourcePath(), '->__construct() set the source path'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/StringAssetTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/StringAssetTest.php deleted file mode 100644 index 7994a38..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/StringAssetTest.php +++ /dev/null @@ -1,79 +0,0 @@ -assertInstanceOf('Assetic\\Asset\\AssetInterface', $asset, 'Asset implements AssetInterface'); - } - - public function testLoadAppliesFilters() - { - $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); - $filter->expects($this->once())->method('filterLoad'); - - $asset = new StringAsset('foo', array($filter)); - $asset->load(); - } - - public function testAutomaticLoad() - { - $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); - $filter->expects($this->once())->method('filterLoad'); - - $asset = new StringAsset('foo', array($filter)); - $asset->dump(); - } - - public function testGetFilters() - { - $asset = new StringAsset(''); - $this->assertInternalType('array', $asset->getFilters(), '->getFilters() returns an array'); - } - - public function testLoadAppliesAdditionalFilter() - { - $asset = new StringAsset(''); - $asset->load(); - - $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); - $filter->expects($this->once()) - ->method('filterLoad') - ->with($asset); - - $asset->load($filter); - } - - public function testDumpAppliesAdditionalFilter() - { - $asset = new StringAsset(''); - - $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); - $filter->expects($this->once()) - ->method('filterDump') - ->with($asset); - - $asset->dump($filter); - } - - public function testLastModified() - { - $asset = new StringAsset(''); - $asset->setLastModified(123); - $this->assertEquals(123, $asset->getLastModified(), '->getLastModified() return the set last modified value'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/AssetManagerTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/AssetManagerTest.php deleted file mode 100644 index d459855..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/AssetManagerTest.php +++ /dev/null @@ -1,53 +0,0 @@ -am = new AssetManager(); - } - - public function testGetAsset() - { - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - $this->am->set('foo', $asset); - $this->assertSame($asset, $this->am->get('foo'), '->get() returns an asset'); - } - - public function testGetInvalidAsset() - { - $this->setExpectedException('InvalidArgumentException'); - $this->am->get('foo'); - } - - public function testHas() - { - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - $this->am->set('foo', $asset); - - $this->assertTrue($this->am->has('foo'), '->has() returns true if the asset is set'); - $this->assertFalse($this->am->has('bar'), '->has() returns false if the asset is not set'); - } - - public function testInvalidName() - { - $this->setExpectedException('InvalidArgumentException'); - - $this->am->set('@foo', $this->getMock('Assetic\\Asset\\AssetInterface')); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/AssetWriterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/AssetWriterTest.php deleted file mode 100644 index ed8061e..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/AssetWriterTest.php +++ /dev/null @@ -1,206 +0,0 @@ -dir = sys_get_temp_dir().'/assetic_tests_'.rand(11111, 99999); - mkdir($this->dir); - $this->writer = new AssetWriter($this->dir, array( - 'locale' => array('en', 'de', 'fr'), - 'browser' => array('ie', 'firefox', 'other'), - 'gzip' => array('gzip', '') - )); - } - - protected function tearDown() - { - array_map('unlink', glob($this->dir.'/*')); - rmdir($this->dir); - } - - public function testWriteManagerAssets() - { - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - $am = $this->getMock('Assetic\\AssetManager'); - - $am->expects($this->once()) - ->method('getNames') - ->will($this->returnValue(array('foo'))); - $am->expects($this->once()) - ->method('get') - ->with('foo') - ->will($this->returnValue($asset)); - $asset->expects($this->atLeastOnce()) - ->method('getTargetPath') - ->will($this->returnValue('target_url')); - $asset->expects($this->once()) - ->method('dump') - ->will($this->returnValue('content')); - $asset->expects($this->atLeastOnce()) - ->method('getVars') - ->will($this->returnValue(array())); - $asset->expects($this->atLeastOnce()) - ->method('getValues') - ->will($this->returnValue(array())); - - $this->writer->writeManagerAssets($am); - - $this->assertFileExists($this->dir.'/target_url'); - $this->assertEquals('content', file_get_contents($this->dir.'/target_url')); - } - - public function testWriteAssetWithVars() - { - $asset = $this->getMock('Assetic\Asset\AssetInterface'); - $asset->expects($this->atLeastOnce()) - ->method('getVars') - ->will($this->returnValue(array('locale'))); - - $self = $this; - $expectedValues = array( - array('locale' => 'en'), - array('locale' => 'de'), - array('locale' => 'fr'), - ); - $asset->expects($this->exactly(3)) - ->method('setValues') - ->will($this->returnCallback(function($values) use($self, $expectedValues) { - static $counter = 0; - $self->assertEquals($expectedValues[$counter++], $values); - })); - $asset->expects($this->exactly(3)) - ->method('getValues') - ->will($this->returnCallback(function() use($expectedValues) { - static $counter = 0; - return $expectedValues[$counter++]; - })); - - $asset->expects($this->exactly(3)) - ->method('dump') - ->will($this->onConsecutiveCalls('en', 'de', 'fr')); - - $asset->expects($this->atLeastOnce()) - ->method('getTargetPath') - ->will($this->returnValue('target.{locale}')); - - $this->writer->writeAsset($asset); - - $this->assertFileExists($this->dir.'/target.en'); - $this->assertFileExists($this->dir.'/target.de'); - $this->assertFileExists($this->dir.'/target.fr'); - $this->assertEquals('en', file_get_contents($this->dir.'/target.en')); - $this->assertEquals('de', file_get_contents($this->dir.'/target.de')); - $this->assertEquals('fr', file_get_contents($this->dir.'/target.fr')); - } - - public function testAssetWithInputVars() - { - $asset = new FileAsset(__DIR__.'/Fixture/messages.{locale}.js', - array(), null, null, array('locale')); - $asset->setTargetPath('messages.{locale}.js'); - - $this->writer->writeAsset($asset); - - $this->assertFileExists($this->dir.'/messages.en.js'); - $this->assertFileExists($this->dir.'/messages.de.js'); - $this->assertFileExists($this->dir.'/messages.fr.js'); - $this->assertEquals('var messages = {"text.greeting": "Hello %name%!"};', - file_get_contents($this->dir.'/messages.en.js')); - $this->assertEquals('var messages = {"text.greeting": "Hallo %name%!"};', - file_get_contents($this->dir.'/messages.de.js')); - $this->assertEquals('var messages = {"text.greet": "All\u00f4 %name%!"};', - file_get_contents($this->dir.'/messages.fr.js')); - } - - /** - * @dataProvider getCombinationTests - */ - public function testGetCombinations($vars, $expectedCombinations) - { - $ref = new \ReflectionMethod($this->writer, 'getCombinations'); - $ref->setAccessible(true); - - $this->assertEquals($expectedCombinations, $ref->invoke($this->writer, $vars)); - } - - public function getCombinationTests() - { - $tests = array(); - - // no variables - $tests[] = array( - array(), - array(array()) - ); - - // one variables - $tests[] = array( - array('locale'), - array( - array('locale' => 'en'), - array('locale' => 'de'), - array('locale' => 'fr'), - ) - ); - - // two variables - $tests[] = array( - array('locale', 'browser'), - array( - array('locale' => 'en', 'browser' => 'ie'), - array('locale' => 'de', 'browser' => 'ie'), - array('locale' => 'fr', 'browser' => 'ie'), - array('locale' => 'en', 'browser' => 'firefox'), - array('locale' => 'de', 'browser' => 'firefox'), - array('locale' => 'fr', 'browser' => 'firefox'), - array('locale' => 'en', 'browser' => 'other'), - array('locale' => 'de', 'browser' => 'other'), - array('locale' => 'fr', 'browser' => 'other'), - ) - ); - - // three variables - $tests[] = array( - array('locale', 'browser', 'gzip'), - array( - array('locale' => 'en', 'browser' => 'ie', 'gzip' => 'gzip'), - array('locale' => 'de', 'browser' => 'ie', 'gzip' => 'gzip'), - array('locale' => 'fr', 'browser' => 'ie', 'gzip' => 'gzip'), - array('locale' => 'en', 'browser' => 'firefox', 'gzip' => 'gzip'), - array('locale' => 'de', 'browser' => 'firefox', 'gzip' => 'gzip'), - array('locale' => 'fr', 'browser' => 'firefox', 'gzip' => 'gzip'), - array('locale' => 'en', 'browser' => 'other', 'gzip' => 'gzip'), - array('locale' => 'de', 'browser' => 'other', 'gzip' => 'gzip'), - array('locale' => 'fr', 'browser' => 'other', 'gzip' => 'gzip'), - array('locale' => 'en', 'browser' => 'ie', 'gzip' => ''), - array('locale' => 'de', 'browser' => 'ie', 'gzip' => ''), - array('locale' => 'fr', 'browser' => 'ie', 'gzip' => ''), - array('locale' => 'en', 'browser' => 'firefox', 'gzip' => ''), - array('locale' => 'de', 'browser' => 'firefox', 'gzip' => ''), - array('locale' => 'fr', 'browser' => 'firefox', 'gzip' => ''), - array('locale' => 'en', 'browser' => 'other', 'gzip' => ''), - array('locale' => 'de', 'browser' => 'other', 'gzip' => ''), - array('locale' => 'fr', 'browser' => 'other', 'gzip' => ''), - ) - ); - - return $tests; - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ApcCacheTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ApcCacheTest.php deleted file mode 100644 index 659c06f..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ApcCacheTest.php +++ /dev/null @@ -1,42 +0,0 @@ -markTestSkipped('APC must be installed and enabled.'); - } - } - - public function testCache() - { - $cache = new ApcCache(); - - $this->assertFalse($cache->has('foo')); - - $cache->set('foo', 'bar'); - $this->assertEquals('bar', $cache->get('foo')); - - $this->assertTrue($cache->has('foo')); - - $cache->remove('foo'); - $this->assertFalse($cache->has('foo')); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ConfigCacheTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ConfigCacheTest.php deleted file mode 100644 index 78ab541..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ConfigCacheTest.php +++ /dev/null @@ -1,65 +0,0 @@ -dir = sys_get_temp_dir().'/assetic/tests/config_cache'; - $this->cache = new ConfigCache($this->dir); - } - - protected function tearDown() - { - foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->dir, \FilesystemIterator::SKIP_DOTS)) as $file) { - unlink($file->getPathname()); - } - } - - public function testCache() - { - $this->cache->set('foo', array(1, 2, 3)); - $this->assertEquals(array(1, 2, 3), $this->cache->get('foo'), '->get() returns the ->set() value'); - } - - public function testTimestamp() - { - $this->cache->set('bar', array(4, 5, 6)); - $this->assertInternalType('integer', $time = $this->cache->getTimestamp('bar'), '->getTimestamp() returns an integer'); - $this->assertNotEmpty($time, '->getTimestamp() returns a non-empty number'); - } - - public function testInvalidValue() - { - $this->setExpectedException('RuntimeException'); - $this->cache->get('_invalid'); - } - - public function testInvalidTimestamp() - { - $this->setExpectedException('RuntimeException'); - $this->cache->getTimestamp('_invalid'); - } - - public function testHas() - { - $this->cache->set('foo', 'bar'); - $this->assertTrue($this->cache->has('foo')); - $this->assertFalse($this->cache->has('_invalid')); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ExpiringCacheTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ExpiringCacheTest.php deleted file mode 100644 index b67cab3..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ExpiringCacheTest.php +++ /dev/null @@ -1,111 +0,0 @@ -inner = $this->getMock('Assetic\\Cache\\CacheInterface'); - $this->lifetime = 3600; - $this->cache = new ExpiringCache($this->inner, $this->lifetime); - } - - public function testHasExpired() - { - $key = 'asdf'; - $expiresKey = 'asdf.expires'; - $thePast = 0; - - $this->inner->expects($this->once()) - ->method('has') - ->with($key) - ->will($this->returnValue(true)); - $this->inner->expects($this->once()) - ->method('get') - ->with($expiresKey) - ->will($this->returnValue($thePast)); - $this->inner->expects($this->at(2)) - ->method('remove') - ->with($expiresKey); - $this->inner->expects($this->at(3)) - ->method('remove') - ->with($key); - - $this->assertFalse($this->cache->has($key), '->has() returns false if an expired value exists'); - } - - public function testHasNotExpired() - { - $key = 'asdf'; - $expiresKey = 'asdf.expires'; - $theFuture = time() * 2; - - $this->inner->expects($this->once()) - ->method('has') - ->with($key) - ->will($this->returnValue(true)); - $this->inner->expects($this->once()) - ->method('get') - ->with($expiresKey) - ->will($this->returnValue($theFuture)); - - $this->assertTrue($this->cache->has($key), '->has() returns true if a value the not expired'); - } - - public function testSetLifetime() - { - $key = 'asdf'; - $expiresKey = 'asdf.expires'; - $value = 'qwerty'; - - $this->inner->expects($this->at(0)) - ->method('set') - ->with($expiresKey, $this->greaterThanOrEqual(time() + $this->lifetime)); - $this->inner->expects($this->at(1)) - ->method('set') - ->with($key, $value); - - $this->cache->set($key, $value); - } - - public function testRemove() - { - $key = 'asdf'; - $expiresKey = 'asdf.expires'; - - $this->inner->expects($this->at(0)) - ->method('remove') - ->with($expiresKey); - $this->inner->expects($this->at(1)) - ->method('remove') - ->with($key); - - $this->cache->remove($key); - } - - public function testGet() - { - $this->inner->expects($this->once()) - ->method('get') - ->with('foo') - ->will($this->returnValue('bar')); - - $this->assertEquals('bar', $this->cache->get('foo'), '->get() returns the cached value'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/FilesystemCacheTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/FilesystemCacheTest.php deleted file mode 100644 index daf41e9..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/FilesystemCacheTest.php +++ /dev/null @@ -1,52 +0,0 @@ -assertFalse($cache->has('foo')); - - $cache->set('foo', 'bar'); - $this->assertEquals('bar', $cache->get('foo')); - - $this->assertTrue($cache->has('foo')); - - $cache->remove('foo'); - $this->assertFalse($cache->has('foo')); - } - - public function testSetCreatesDir() - { - $dir = sys_get_temp_dir().'/assetic/fscachetest'; - - $tearDown = function() use($dir) - { - array_map('unlink', glob($dir.'/*')); - @rmdir($dir); - }; - - $tearDown(); - - $cache = new FilesystemCache($dir); - $cache->set('foo', 'bar'); - - $this->assertFileExists($dir.'/foo'); - - $tearDown(); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/AsseticExtensionTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/AsseticExtensionTest.php deleted file mode 100644 index 360e03a..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/AsseticExtensionTest.php +++ /dev/null @@ -1,204 +0,0 @@ -markTestSkipped('Twig is not installed.'); - } - - $this->am = $this->getMock('Assetic\\AssetManager'); - $this->fm = $this->getMock('Assetic\\FilterManager'); - - $this->valueSupplier = $this->getMock('Assetic\ValueSupplierInterface'); - - $this->factory = new AssetFactory(__DIR__.'/templates'); - $this->factory->setAssetManager($this->am); - $this->factory->setFilterManager($this->fm); - - $this->twig = new \Twig_Environment(); - $this->twig->setLoader(new \Twig_Loader_Filesystem(__DIR__.'/templates')); - $this->twig->addExtension(new AsseticExtension($this->factory, array(), $this->valueSupplier)); - } - - public function testReference() - { - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - $this->am->expects($this->any()) - ->method('get') - ->with('foo') - ->will($this->returnValue($asset)); - - $xml = $this->renderXml('reference.twig'); - $this->assertEquals(1, count($xml->asset)); - $this->assertStringStartsWith('css/', (string) $xml->asset['url']); - } - - public function testGlob() - { - $xml = $this->renderXml('glob.twig'); - $this->assertEquals(1, count($xml->asset)); - $this->assertStringStartsWith('css/', (string) $xml->asset['url']); - } - - public function testAbsolutePath() - { - $xml = $this->renderXml('absolute_path.twig'); - $this->assertEquals(1, count($xml->asset)); - $this->assertStringStartsWith('css/', (string) $xml->asset['url']); - } - - public function testFilters() - { - $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); - - $this->fm->expects($this->at(0)) - ->method('get') - ->with('foo') - ->will($this->returnValue($filter)); - $this->fm->expects($this->at(1)) - ->method('get') - ->with('bar') - ->will($this->returnValue($filter)); - - $xml = $this->renderXml('filters.twig'); - $this->assertEquals(1, count($xml->asset)); - $this->assertStringStartsWith('css/', (string) $xml->asset['url']); - } - - public function testOptionalFilter() - { - $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); - - $this->fm->expects($this->once()) - ->method('get') - ->with('foo') - ->will($this->returnValue($filter)); - - $xml = $this->renderXml('optional_filter.twig'); - $this->assertEquals(1, count($xml->asset)); - $this->assertStringStartsWith('css/', (string) $xml->asset['url']); - } - - public function testOutputPattern() - { - $xml = $this->renderXml('output_pattern.twig'); - $this->assertEquals(1, count($xml->asset)); - $this->assertStringStartsWith('css/packed/', (string) $xml->asset['url']); - $this->assertStringEndsWith('.css', (string) $xml->asset['url']); - } - - public function testOutput() - { - $xml = $this->renderXml('output_url.twig'); - $this->assertEquals(1, count($xml->asset)); - $this->assertEquals('explicit_url.css', (string) $xml->asset['url']); - } - - public function testMixture() - { - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - $this->am->expects($this->any()) - ->method('get') - ->with('foo') - ->will($this->returnValue($asset)); - - $xml = $this->renderXml('mixture.twig'); - $this->assertEquals(1, count($xml->asset)); - $this->assertEquals('packed/mixture', (string) $xml->asset['url']); - } - - public function testDebug() - { - $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); - - $this->fm->expects($this->once()) - ->method('get') - ->with('bar') - ->will($this->returnValue($filter)); - - $xml = $this->renderXml('debug.twig'); - $this->assertEquals(2, count($xml->asset)); - $this->assertStringStartsWith('css/packed_', (string) $xml->asset[0]['url']); - $this->assertStringEndsWith('.css', (string) $xml->asset[0]['url']); - } - - public function testCombine() - { - $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); - - $this->fm->expects($this->once()) - ->method('get') - ->with('bar') - ->will($this->returnValue($filter)); - - $xml = $this->renderXml('combine.twig'); - $this->assertEquals(1, count($xml->asset)); - $this->assertEquals('css/packed.css', (string) $xml->asset[0]['url']); - } - - public function testImage() - { - $xml = $this->renderXml('image.twig'); - $this->assertEquals(1, count($xml->image)); - $this->assertStringEndsWith('.png', (string) $xml->image[0]['url']); - } - - public function testFilterFunction() - { - $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); - - $this->fm->expects($this->once()) - ->method('get') - ->with('some_filter') - ->will($this->returnValue($filter)); - - $this->twig->addExtension(new AsseticExtension($this->factory, array( - 'some_func' => array( - 'filter' => 'some_filter', - 'options' => array('output' => 'css/*.css'), - ), - ))); - - $xml = $this->renderXml('function.twig'); - $this->assertEquals(1, count($xml->asset)); - $this->assertStringEndsWith('.css', (string) $xml->asset[0]['url']); - } - - public function testVariables() - { - $this->valueSupplier->expects($this->once()) - ->method('getValues') - ->will($this->returnValue(array('foo' => 'a', 'bar' => 'b'))); - - $xml = $this->renderXml('variables.twig'); - $this->assertEquals(2, $xml->url->count()); - $this->assertEquals("js/7d0828c_foo_1.a.b.js", (string) $xml->url[0]); - $this->assertEquals("js/7d0828c_variable_input.a_2.a.b.js", (string) $xml->url[1]); - } - - private function renderXml($name, $context = array()) - { - return new \SimpleXMLElement($this->twig->loadTemplate($name)->render($context)); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/TwigFormulaLoaderTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/TwigFormulaLoaderTest.php deleted file mode 100644 index ba0f99c..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/TwigFormulaLoaderTest.php +++ /dev/null @@ -1,97 +0,0 @@ -markTestSkipped('Twig is not installed.'); - } - - $this->am = $this->getMock('Assetic\\AssetManager'); - $this->fm = $this->getMock('Assetic\\FilterManager'); - - $factory = new AssetFactory(__DIR__.'/templates'); - $factory->setAssetManager($this->am); - $factory->setFilterManager($this->fm); - - $twig = new \Twig_Environment(); - $twig->addExtension(new AsseticExtension($factory, array( - 'some_func' => array( - 'filter' => 'some_filter', - 'options' => array('output' => 'css/*.css'), - ), - ))); - - $this->loader = new TwigFormulaLoader($twig); - } - - public function testMixture() - { - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - - $expected = array( - 'mixture' => array( - array('foo', 'foo/*', '@foo'), - array(), - array( - 'output' => 'packed/mixture', - 'name' => 'mixture', - 'debug' => false, - 'combine' => null, - 'vars' => array(), - ), - ), - ); - - $resource = $this->getMock('Assetic\\Factory\\Resource\\ResourceInterface'); - $resource->expects($this->once()) - ->method('getContent') - ->will($this->returnValue(file_get_contents(__DIR__.'/templates/mixture.twig'))); - $this->am->expects($this->any()) - ->method('get') - ->with('foo') - ->will($this->returnValue($asset)); - - $formulae = $this->loader->load($resource); - $this->assertEquals($expected, $formulae); - } - - public function testFunction() - { - $expected = array( - 'my_asset' => array( - array('path/to/asset'), - array('some_filter'), - array('output' => 'css/*.css', 'name' => 'my_asset'), - ), - ); - - $resource = $this->getMock('Assetic\\Factory\\Resource\\ResourceInterface'); - $resource->expects($this->once()) - ->method('getContent') - ->will($this->returnValue(file_get_contents(__DIR__.'/templates/function.twig'))); - - $formulae = $this->loader->load($resource); - $this->assertEquals($expected, $formulae); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/TwigResourceTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/TwigResourceTest.php deleted file mode 100644 index 771da9f..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/TwigResourceTest.php +++ /dev/null @@ -1,48 +0,0 @@ -markTestSkipped('Twig is not installed.'); - } - } - - public function testInvalidTemplateNameGetContent() - { - $loader = $this->getMock('Twig_LoaderInterface'); - $loader->expects($this->once()) - ->method('getSource') - ->with('asdf') - ->will($this->throwException(new \Twig_Error_Loader(''))); - - $resource = new TwigResource($loader, 'asdf'); - $this->assertEquals('', $resource->getContent()); - } - - public function testInvalidTemplateNameIsFresh() - { - $loader = $this->getMock('Twig_LoaderInterface'); - $loader->expects($this->once()) - ->method('isFresh') - ->with('asdf', 1234) - ->will($this->throwException(new \Twig_Error_Loader(''))); - - $resource = new TwigResource($loader, 'asdf'); - $this->assertFalse($resource->isFresh(1234)); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/absolute_path.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/absolute_path.twig deleted file mode 100644 index 05dc382..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/absolute_path.twig +++ /dev/null @@ -1,3 +0,0 @@ - -{% stylesheets '/path/to/something.css' as='foo' %}{% endstylesheets %} - diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/combine.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/combine.twig deleted file mode 100644 index e1ab5f9..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/combine.twig +++ /dev/null @@ -1,3 +0,0 @@ - -{% stylesheets 'foo.css' 'bar.css' filter='?foo,bar' output='css/packed.css' debug=true combine=true %}{% endstylesheets %} - diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/debug.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/debug.twig deleted file mode 100644 index 550292e..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/debug.twig +++ /dev/null @@ -1,3 +0,0 @@ - -{% stylesheets 'foo.css' 'bar.css' filter='?foo,bar' output='css/packed.css' debug=true %}{% endstylesheets %} - diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/filters.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/filters.twig deleted file mode 100644 index d211384..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/filters.twig +++ /dev/null @@ -1,3 +0,0 @@ - -{% stylesheets 'foo' filter='foo, bar' %}{% endstylesheets %} - diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/function.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/function.twig deleted file mode 100644 index 0284197..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/function.twig +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/glob.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/glob.twig deleted file mode 100644 index 4624933..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/glob.twig +++ /dev/null @@ -1,3 +0,0 @@ - -{% stylesheets 'css/src/*' %}{% endstylesheets %} - diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/image.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/image.twig deleted file mode 100644 index 902ecf0..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/image.twig +++ /dev/null @@ -1,3 +0,0 @@ - -{% image 'images/foo.png' %}{% endimage %} - diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/mixture.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/mixture.twig deleted file mode 100644 index 482e6ec..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/mixture.twig +++ /dev/null @@ -1,3 +0,0 @@ - -{% stylesheets 'foo' 'foo/*' '@foo' output='packed/*' name='mixture' %}{% endstylesheets %} - diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/optional_filter.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/optional_filter.twig deleted file mode 100644 index 4a4dbb6..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/optional_filter.twig +++ /dev/null @@ -1,3 +0,0 @@ - -{% stylesheets 'foo' filter='?foo' %}{% endstylesheets %} - diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/output_pattern.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/output_pattern.twig deleted file mode 100644 index cf85897..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/output_pattern.twig +++ /dev/null @@ -1,3 +0,0 @@ - -{% stylesheets 'foo' output='css/packed/*.css' %}{% endstylesheets %} - diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/output_url.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/output_url.twig deleted file mode 100644 index 51a2a2d..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/output_url.twig +++ /dev/null @@ -1,3 +0,0 @@ - -{% stylesheets 'foo' output='explicit_url.css' %}{% endstylesheets %} - diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/reference.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/reference.twig deleted file mode 100644 index 371c4b7..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/reference.twig +++ /dev/null @@ -1,3 +0,0 @@ - -{% stylesheets '@foo' %}{% endstylesheets %} - diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/variables.twig b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/variables.twig deleted file mode 100644 index 111cff4..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/templates/variables.twig +++ /dev/null @@ -1,5 +0,0 @@ - - {% javascripts "foo.js" "variable_input.{foo}.js" vars=["foo", "bar"] debug=true %} - {{ asset_url }} - {% endjavascripts %} - \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/AssetFactoryTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/AssetFactoryTest.php deleted file mode 100644 index 7bfa8bc..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/AssetFactoryTest.php +++ /dev/null @@ -1,203 +0,0 @@ -am = $this->getMock('Assetic\\AssetManager'); - $this->fm = $this->getMock('Assetic\\FilterManager'); - - $this->factory = new AssetFactory(__DIR__); - $this->factory->setAssetManager($this->am); - $this->factory->setFilterManager($this->fm); - } - - public function testNoAssetManagerReference() - { - $this->setExpectedException('LogicException', 'There is no asset manager.'); - - $factory = new AssetFactory('.'); - $factory->createAsset(array('@foo')); - } - - public function testNoAssetManagerNotReference() - { - $factory = new AssetFactory('.'); - $this->assertInstanceOf('Assetic\\Asset\\AssetInterface', $factory->createAsset(array('foo'))); - } - - public function testNoFilterManager() - { - $this->setExpectedException('LogicException', 'There is no filter manager.'); - - $factory = new AssetFactory('.'); - $factory->createAsset(array('foo'), array('foo')); - } - - public function testCreateAssetReference() - { - $referenced = $this->getMock('Assetic\\Asset\\AssetInterface'); - - $this->am->expects($this->any()) - ->method('get') - ->with('jquery') - ->will($this->returnValue($referenced)); - - $assets = $this->factory->createAsset(array('@jquery')); - $arr = iterator_to_array($assets); - $this->assertInstanceOf('Assetic\\Asset\\AssetReference', $arr[0], '->createAsset() creates a reference'); - } - - /** - * @dataProvider getHttpUrls - */ - public function testCreateHttpAsset($sourceUrl) - { - $assets = $this->factory->createAsset(array($sourceUrl)); - $arr = iterator_to_array($assets); - $this->assertInstanceOf('Assetic\\Asset\\HttpAsset', $arr[0], '->createAsset() creates an HTTP asset'); - } - - public function getHttpUrls() - { - return array( - array('http://example.com/foo.css'), - array('https://example.com/foo.css'), - array('//example.com/foo.css'), - ); - } - - public function testCreateFileAsset() - { - $assets = $this->factory->createAsset(array(basename(__FILE__))); - $arr = iterator_to_array($assets); - $this->assertInstanceOf('Assetic\\Asset\\FileAsset', $arr[0], '->createAsset() creates a file asset'); - } - - public function testCreateGlobAsset() - { - $assets = $this->factory->createAsset(array('*')); - $arr = iterator_to_array($assets); - $this->assertInstanceOf('Assetic\\Asset\\FileAsset', $arr[0], '->createAsset() uses a glob to create a file assets'); - } - - public function testCreateAssetCollection() - { - $asset = $this->factory->createAsset(array('*', basename(__FILE__))); - $this->assertInstanceOf('Assetic\\Asset\\AssetCollection', $asset, '->createAsset() creates an asset collection'); - } - - public function testFilter() - { - $this->fm->expects($this->once()) - ->method('get') - ->with('foo') - ->will($this->returnValue($this->getMock('Assetic\\Filter\\FilterInterface'))); - - $asset = $this->factory->createAsset(array(), array('foo')); - $this->assertEquals(1, count($asset->getFilters()), '->createAsset() adds filters'); - } - - public function testInvalidFilter() - { - $this->setExpectedException('InvalidArgumentException'); - - $this->fm->expects($this->once()) - ->method('get') - ->with('foo') - ->will($this->throwException(new \InvalidArgumentException())); - - $asset = $this->factory->createAsset(array(), array('foo')); - } - - public function testOptionalInvalidFilter() - { - $this->factory->setDebug(true); - - $asset = $this->factory->createAsset(array(), array('?foo')); - - $this->assertEquals(0, count($asset->getFilters()), '->createAsset() does not add an optional invalid filter'); - } - - public function testIncludingOptionalFilter() - { - $this->fm->expects($this->once()) - ->method('get') - ->with('foo') - ->will($this->returnValue($this->getMock('Assetic\\Filter\\FilterInterface'))); - - $this->factory->createAsset(array('foo.css'), array('?foo')); - } - - public function testWorkers() - { - $worker = $this->getMock('Assetic\\Factory\\Worker\\WorkerInterface'); - - // called once on the collection and once on each leaf - $worker->expects($this->exactly(3)) - ->method('process') - ->with($this->isInstanceOf('Assetic\\Asset\\AssetInterface')); - - $this->factory->addWorker($worker); - $this->factory->createAsset(array('foo.js', 'bar.js')); - } - - public function testWorkerReturn() - { - $worker = $this->getMock('Assetic\\Factory\\Worker\\WorkerInterface'); - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - - $worker->expects($this->at(2)) - ->method('process') - ->with($this->isInstanceOf('Assetic\\Asset\\AssetCollectionInterface')) - ->will($this->returnValue($asset)); - - $this->factory->addWorker($worker); - $coll = $this->factory->createAsset(array('foo.js', 'bar.js')); - - $this->assertEquals(1, count(iterator_to_array($coll))); - } - - public function testNestedFormula() - { - $this->fm->expects($this->once()) - ->method('get') - ->with('foo') - ->will($this->returnValue($this->getMock('Assetic\\Filter\\FilterInterface'))); - - $inputs = array( - 'css/main.css', - array( - // nested formula - array('css/more.sass'), - array('foo'), - ), - ); - - $asset = $this->factory->createAsset($inputs, array(), array('output' => 'css/*.css')); - - $i = 0; - foreach ($asset as $leaf) { - $i++; - } - - $this->assertEquals(2, $i); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/LazyAssetManagerTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/LazyAssetManagerTest.php deleted file mode 100644 index 46cdf94..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/LazyAssetManagerTest.php +++ /dev/null @@ -1,96 +0,0 @@ -factory = $this->getMockBuilder('Assetic\\Factory\\AssetFactory') - ->disableOriginalConstructor() - ->getMock(); - - $this->am = new LazyAssetManager($this->factory); - } - - public function testGetFromLoader() - { - $resource = $this->getMock('Assetic\\Factory\\Resource\\ResourceInterface'); - $loader = $this->getMock('Assetic\\Factory\\Loader\\FormulaLoaderInterface'); - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - - $formula = array( - array('js/core.js', 'js/more.js'), - array('?yui_js'), - array('output' => 'js/all.js') - ); - - $loader->expects($this->once()) - ->method('load') - ->with($resource) - ->will($this->returnValue(array('foo' => $formula))); - $this->factory->expects($this->once()) - ->method('createAsset') - ->with($formula[0], $formula[1], $formula[2] + array('name' => 'foo')) - ->will($this->returnValue($asset)); - - $this->am->setLoader('foo', $loader); - $this->am->addResource($resource, 'foo'); - - $this->assertSame($asset, $this->am->get('foo'), '->get() returns an asset from the loader'); - - // test the "once" expectations - $this->am->get('foo'); - } - - public function testGetResources() - { - $resources = array( - $this->getMock('Assetic\\Factory\\Resource\\ResourceInterface'), - $this->getMock('Assetic\\Factory\\Resource\\ResourceInterface'), - ); - - $this->am->addResource($resources[0], 'foo'); - $this->am->addResource($resources[1], 'bar'); - - $ret = $this->am->getResources(); - - foreach ($resources as $resource) { - $this->assertTrue(in_array($resource, $ret, true)); - } - } - - public function testGetResourcesEmpty() - { - $this->am->getResources(); - } - - public function testSetFormula() - { - $this->am->setFormula('foo', array()); - $this->am->load(); - $this->assertTrue($this->am->hasFormula('foo'), '->load() does not remove manually added formulae'); - } - - public function testIsDebug() - { - $this->factory->expects($this->once()) - ->method('isDebug') - ->will($this->returnValue(false)); - - $this->assertSame(false, $this->am->isDebug(), '->isDebug() proxies the factory'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/CachedFormulaLoaderTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/CachedFormulaLoaderTest.php deleted file mode 100644 index 5253003..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/CachedFormulaLoaderTest.php +++ /dev/null @@ -1,138 +0,0 @@ -loader = $this->getMock('Assetic\\Factory\\Loader\\FormulaLoaderInterface'); - $this->configCache = $this->getMockBuilder('Assetic\\Cache\\ConfigCache') - ->disableOriginalConstructor() - ->getMock(); - $this->resource = $this->getMock('Assetic\\Factory\\Resource\\ResourceInterface'); - } - - public function testNotDebug() - { - $expected = array( - 'foo' => array(array(), array(), array()), - 'bar' => array(array(), array(), array()), - ); - - $this->configCache->expects($this->once()) - ->method('has') - ->with($this->isType('string')) - ->will($this->returnValue(false)); - $this->loader->expects($this->once()) - ->method('load') - ->with($this->resource) - ->will($this->returnValue($expected)); - $this->configCache->expects($this->once()) - ->method('set') - ->with($this->isType('string'), $expected); - - $loader = new CachedFormulaLoader($this->loader, $this->configCache); - $this->assertEquals($expected, $loader->load($this->resource), '->load() returns formulae'); - } - - public function testNotDebugCached() - { - $expected = array( - 'foo' => array(array(), array(), array()), - 'bar' => array(array(), array(), array()), - ); - - $this->configCache->expects($this->once()) - ->method('has') - ->with($this->isType('string')) - ->will($this->returnValue(true)); - $this->resource->expects($this->never()) - ->method('isFresh'); - $this->configCache->expects($this->once()) - ->method('get') - ->with($this->isType('string')) - ->will($this->returnValue($expected)); - - $loader = new CachedFormulaLoader($this->loader, $this->configCache); - $this->assertEquals($expected, $loader->load($this->resource), '->load() returns formulae'); - } - - public function testDebugCached() - { - $timestamp = 123; - $expected = array( - 'foo' => array(array(), array(), array()), - 'bar' => array(array(), array(), array()), - ); - - $this->configCache->expects($this->once()) - ->method('has') - ->with($this->isType('string')) - ->will($this->returnValue(true)); - $this->configCache->expects($this->once()) - ->method('getTimestamp') - ->with($this->isType('string')) - ->will($this->returnValue($timestamp)); - $this->resource->expects($this->once()) - ->method('isFresh') - ->with($timestamp) - ->will($this->returnValue(true)); - $this->loader->expects($this->never()) - ->method('load'); - $this->configCache->expects($this->once()) - ->method('get') - ->with($this->isType('string')) - ->will($this->returnValue($expected)); - - $loader = new CachedFormulaLoader($this->loader, $this->configCache, true); - $this->assertEquals($expected, $loader->load($this->resource), '->load() returns formulae'); - } - - public function testDebugCachedStale() - { - $timestamp = 123; - $expected = array( - 'foo' => array(array(), array(), array()), - 'bar' => array(array(), array(), array()), - ); - - $this->configCache->expects($this->once()) - ->method('has') - ->with($this->isType('string')) - ->will($this->returnValue(true)); - $this->configCache->expects($this->once()) - ->method('getTimestamp') - ->with($this->isType('string')) - ->will($this->returnValue($timestamp)); - $this->resource->expects($this->once()) - ->method('isFresh') - ->with($timestamp) - ->will($this->returnValue(false)); - $this->loader->expects($this->once()) - ->method('load') - ->with($this->resource) - ->will($this->returnValue($expected)); - $this->configCache->expects($this->once()) - ->method('set') - ->with($this->isType('string'), $expected); - - $loader = new CachedFormulaLoader($this->loader, $this->configCache, true); - $this->assertEquals($expected, $loader->load($this->resource), '->load() returns formulae'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/FunctionCallsFormulaLoaderTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/FunctionCallsFormulaLoaderTest.php deleted file mode 100644 index 6b631bf..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/FunctionCallsFormulaLoaderTest.php +++ /dev/null @@ -1,69 +0,0 @@ -getMock('Assetic\\Factory\\Resource\\ResourceInterface'); - $factory = $this->getMockBuilder('Assetic\\Factory\\AssetFactory') - ->disableOriginalConstructor() - ->getMock(); - - $resource->expects($this->once()) - ->method('getContent') - ->will($this->returnValue('')); - $factory->expects($this->once()) - ->method('generateAssetName') - ->will($this->returnValue($name)); - - $loader = new FunctionCallsFormulaLoader($factory); - $formulae = $loader->load($resource); - - $this->assertEquals($expected, $formulae); - } - - public function getJavascriptInputs() - { - return array( - array('assetic_javascripts', '"js/core.js"', 'asdf', array('asdf' => array(array('js/core.js'), array(), array('debug' => false, 'output' => 'js/*.js', 'name' => 'asdf', )))), - array('assetic_javascripts', "'js/core.js'", 'asdf', array('asdf' => array(array('js/core.js'), array(), array('debug' => false, 'output' => 'js/*.js', 'name' => 'asdf', )))), - array('assetic_javascripts', "array('js/core.js')", 'asdf', array('asdf' => array(array('js/core.js'), array(), array('debug' => false, 'output' => 'js/*.js', 'name' => 'asdf', )))), - array('assetic_javascripts', 'array("js/core.js")', 'asdf', array('asdf' => array(array('js/core.js'), array(), array('debug' => false, 'output' => 'js/*.js', 'name' => 'asdf', )))), - array('assetic_image', '"images/logo.gif"', 'asdf', array('asdf' => array(array('images/logo.gif'), array(), array('debug' => false, 'output' => 'images/*', 'name' => 'asdf')))), - ); - } - - public function testComplexFormula() - { - $factory = new AssetFactory(__DIR__.'/templates', true); - $loader = new FunctionCallsFormulaLoader($factory); - $resource = new FileResource(__DIR__.'/templates/debug.php'); - $formulae = $loader->load($resource); - - $this->assertEquals(array( - 'test123' => array( - array('foo.css', 'bar.css'), - array('?foo', 'bar'), - array('name' => 'test123', 'output' => 'css/packed.css', 'debug' => true), - ), - ), $formulae); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/templates/debug.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/templates/debug.php deleted file mode 100644 index 750c25d..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Loader/templates/debug.php +++ /dev/null @@ -1,8 +0,0 @@ - - 'test123', 'output' => 'css/packed.css', 'debug' => true)) as $url): ?> - - - diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/CoalescingDirectoryResourceTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/CoalescingDirectoryResourceTest.php deleted file mode 100644 index 32e8887..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/CoalescingDirectoryResourceTest.php +++ /dev/null @@ -1,42 +0,0 @@ -assertEquals(array( - realpath(__DIR__.'/Fixtures/dir1/file1.txt'), - realpath(__DIR__.'/Fixtures/dir1/file2.txt'), - realpath(__DIR__.'/Fixtures/dir2/file3.txt'), - ), $paths, 'files from multiple directories are merged'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/DirectoryResourceTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/DirectoryResourceTest.php deleted file mode 100644 index bbe5cff..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/DirectoryResourceTest.php +++ /dev/null @@ -1,108 +0,0 @@ -assertTrue($resource->isFresh(time() + 5)); - $this->assertFalse($resource->isFresh(0)); - } - - /** - * @dataProvider getPatterns - */ - public function testGetContent($pattern) - { - $resource = new DirectoryResource(__DIR__, $pattern); - $content = $resource->getContent(); - - $this->assertInternalType('string', $content); - } - - public function getPatterns() - { - return array( - array(null), - array('/\.php$/'), - array('/\.foo$/'), - ); - } - - /** - * @dataProvider getPatternsAndEmpty - */ - public function testIteration($pattern, $empty) - { - $resource = new DirectoryResource(__DIR__, $pattern); - - $count = 0; - foreach ($resource as $r) { - ++$count; - $this->assertInstanceOf('Assetic\\Factory\\Resource\\ResourceInterface', $r); - } - - if ($empty) { - $this->assertEmpty($count); - } else { - $this->assertNotEmpty($count); - } - } - - public function getPatternsAndEmpty() - { - return array( - array(null, false), - array('/\.php$/', false), - array('/\.foo$/', true), - ); - } - - public function testRecursiveIteration() - { - $resource = new DirectoryResource(realpath(__DIR__.'/..'), '/^'.preg_quote(basename(__FILE__)).'$/'); - - $count = 0; - foreach ($resource as $r) { - ++$count; - } - - $this->assertEquals(1, $count); - } - - /** - * @dataProvider getPaths - */ - public function testTrailingSlash($path) - { - $resource = new DirectoryResource($path); - $this->assertStringEndsWith(DIRECTORY_SEPARATOR, (string) $resource, 'path ends with a slash'); - } - - public function getPaths() - { - return array( - array(__DIR__), - array(__DIR__.DIRECTORY_SEPARATOR), - ); - } - - public function testInvalidDirectory() - { - $resource = new DirectoryResource(__DIR__.'foo'); - $this->assertEquals(0, iterator_count($resource), 'works for non-existent directory'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/FileResourceTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/FileResourceTest.php deleted file mode 100644 index 4864c80..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/FileResourceTest.php +++ /dev/null @@ -1,42 +0,0 @@ -assertTrue($resource->isFresh(time() + 5)); - $this->assertFalse($resource->isFresh(0)); - } - - public function testGetContent() - { - $resource = new FileResource(__FILE__); - $this->assertEquals(file_get_contents(__FILE__), $resource->getContent()); - } - - public function testIsFreshOnInvalidPath() - { - $resource = new FileResource(__FILE__.'foo'); - $this->assertFalse($resource->isFresh(time()), '->isFresh() returns false if the file does not exist'); - } - - public function testGetContentOnInvalidPath() - { - $resource = new FileResource(__FILE__.'foo'); - $this->assertSame('', $resource->getContent(), '->getContent() returns an empty string when path is invalid'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir1/file1.txt b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir1/file1.txt deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir1/file2.txt b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir1/file2.txt deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir2/file1.txt b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir2/file1.txt deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir2/file3.txt b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Resource/Fixtures/dir2/file3.txt deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Worker/EnsureFilterWorkerTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Worker/EnsureFilterWorkerTest.php deleted file mode 100644 index bdcffe5..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Factory/Worker/EnsureFilterWorkerTest.php +++ /dev/null @@ -1,47 +0,0 @@ -getMock('Assetic\\Filter\\FilterInterface'); - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - - $asset->expects($this->once()) - ->method('getTargetPath') - ->will($this->returnValue('css/main.css')); - $asset->expects($this->once()) - ->method('ensureFilter') - ->with($filter); - - $worker = new EnsureFilterWorker('/\.css$/', $filter); - $worker->process($asset); - } - - public function testNonMatch() - { - $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - - $asset->expects($this->once()) - ->method('getTargetPath') - ->will($this->returnValue('js/all.js')); - $asset->expects($this->never())->method('ensureFilter'); - - $worker = new EnsureFilterWorker('/\.css$/', $filter); - $worker->process($asset); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/BaseImageFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/BaseImageFilterTest.php deleted file mode 100644 index eb26c19..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/BaseImageFilterTest.php +++ /dev/null @@ -1,24 +0,0 @@ -file($data) : $finfo->buffer($data); - - self::assertEquals($expected, $actual, $message); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CallablesFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CallablesFilterTest.php deleted file mode 100644 index 252f2d1..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CallablesFilterTest.php +++ /dev/null @@ -1,39 +0,0 @@ -assertInstanceOf('Assetic\\Filter\\FilterInterface', $filter, 'CallablesFilter implements FilterInterface'); - } - - public function testLoader() - { - $nb = 0; - $filter = new CallablesFilter(function($asset) use(&$nb) { $nb++; }); - $filter->filterLoad($this->getMock('Assetic\\Asset\\AssetInterface')); - $this->assertEquals(1, $nb, '->filterLoad() calls the loader callable'); - } - - public function testDumper() - { - $nb = 0; - $filter = new CallablesFilter(null, function($asset) use(&$nb) { $nb++; }); - $filter->filterDump($this->getMock('Assetic\\Asset\\AssetInterface')); - $this->assertEquals(1, $nb, '->filterDump() calls the loader callable'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CoffeeScriptFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CoffeeScriptFilterTest.php deleted file mode 100644 index 5c46cef..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CoffeeScriptFilterTest.php +++ /dev/null @@ -1,73 +0,0 @@ -markTestSkipped('There is no COFFEE_BIN or NODE_BIN environment variable.'); - } - - $this->filter = new CoffeeScriptFilter($_SERVER['COFFEE_BIN'], $_SERVER['NODE_BIN']); - } - - public function testFilterLoad() - { - $expected = << x * x'); - $asset->load(); - - $this->filter->filterLoad($asset); - - $this->assertEquals($expected, $asset->getContent()); - } - - public function testBare() - { - $expected = << x * x'); - $asset->load(); - - $this->filter->setBare(true); - $this->filter->filterLoad($asset); - - $this->assertEquals($expected, $asset->getContent()); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CompassFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CompassFilterTest.php deleted file mode 100644 index 4231e8a..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CompassFilterTest.php +++ /dev/null @@ -1,66 +0,0 @@ - - * @group integration - */ -class CompassFilterTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!isset($_SERVER['COMPASS_BIN'])) { - $this->markTestSkipped('There is no COMPASS_BIN environment variable.'); - } - } - - public function testFilterLoadWithScss() - { - $asset = new FileAsset(__DIR__.'/fixtures/compass/stylesheet.scss'); - $asset->load(); - - $filter = new CompassFilter($_SERVER['COMPASS_BIN']); - $filter->filterLoad($asset); - - $this->assertContains('.test-class', $asset->getContent()); - $this->assertContains('font-size: 2em;', $asset->getContent()); - } - - public function testFilterLoadWithSass() - { - $asset = new FileAsset(__DIR__.'/fixtures/compass/stylesheet.sass'); - $asset->load(); - - $filter = new CompassFilter($_SERVER['COMPASS_BIN']); - $filter->filterLoad($asset); - - $this->assertContains('.test-class', $asset->getContent()); - $this->assertContains('font-size: 2em;', $asset->getContent()); - } - - public function testCompassMixin() - { - $asset = new FileAsset(__DIR__.'/fixtures/compass/compass.sass'); - $asset->load(); - - $filter = new CompassFilter($_SERVER['COMPASS_BIN']); - $filter->filterLoad($asset); - - $this->assertContains('text-decoration', $asset->getContent()); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssEmbedFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssEmbedFilterTest.php deleted file mode 100644 index 579abf2..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssEmbedFilterTest.php +++ /dev/null @@ -1,54 +0,0 @@ -markTestSkipped('There is no CSSEMBED_JAR environment variable.'); - } - } - - public function testCssEmbedDataUri() - { - $data = base64_encode(file_get_contents(__DIR__.'/fixtures/home.png')); - - $asset = new FileAsset(__DIR__ . '/fixtures/cssembed/test.css'); - $asset->load(); - - $filter = new CssEmbedFilter($_SERVER['CSSEMBED_JAR']); - $filter->filterDump($asset); - - $this->assertContains('url(data:image/png;base64,'.$data, $asset->getContent()); - } - - public function testCssEmbedMhtml() - { - $asset = new FileAsset(__DIR__ . '/fixtures/cssembed/test.css'); - $asset->load(); - - $filter = new CssEmbedFilter($_SERVER['CSSEMBED_JAR']); - $filter->setMhtml(true); - $filter->setMhtmlRoot('/test'); - $filter->filterDump($asset); - - $this->assertContains('url(mhtml:/test/!', $asset->getContent()); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssImportFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssImportFilterTest.php deleted file mode 100644 index ecde8e1..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssImportFilterTest.php +++ /dev/null @@ -1,67 +0,0 @@ -setTargetPath('foo/bar.css'); - $asset->ensureFilter($filter1); - $asset->ensureFilter($filter2); - - $expected = <<assertEquals($expected, $asset->dump(), '->filterLoad() inlines CSS imports'); - } - - /** - * The order of these two filters is only interchangeable because one acts on - * load and the other on dump. We need a more scalable solution. - */ - public function getFilters() - { - return array( - array(new CssImportFilter(), new CssRewriteFilter()), - array(new CssRewriteFilter(), new CssImportFilter()), - ); - } - - public function testNonCssImport() - { - $asset = new FileAsset(__DIR__.'/fixtures/cssimport/noncssimport.css', array(), __DIR__.'/fixtures/cssimport', 'noncssimport.css'); - $asset->load(); - - $filter = new CssImportFilter(); - $filter->filterLoad($asset); - - $this->assertEquals(file_get_contents(__DIR__.'/fixtures/cssimport/noncssimport.css'), $asset->getContent(), '->filterLoad() skips non css'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssMinFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssMinFilterTest.php deleted file mode 100644 index abba852..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssMinFilterTest.php +++ /dev/null @@ -1,40 +0,0 @@ -markTestSkipped('CssMin is not installed.'); - } - } - - public function testRelativeSourceUrlImportImports() - { - $asset = new FileAsset(__DIR__.'/fixtures/cssmin/main.css'); - $asset->load(); - - $filter = new CssMinFilter(__DIR__.'/fixtures/cssmin'); - $filter->setFilter('ImportImports', true); - $filter->filterDump($asset); - - $this->assertEquals('body{color:white}body{background:black}', $asset->getContent()); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssRewriteFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssRewriteFilterTest.php deleted file mode 100644 index 4c497bf..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CssRewriteFilterTest.php +++ /dev/null @@ -1,124 +0,0 @@ -setTargetPath($targetPath); - $asset->load(); - - $filter = new CssRewriteFilter(); - $filter->filterLoad($asset); - $filter->filterDump($asset); - - $this->assertEquals(sprintf($format, $expectedUrl), $asset->getContent(), '->filterDump() rewrites relative urls'); - } - - public function provideUrls() - { - return array( - // url variants - array('body { background: url(%s); }', 'css/body.css', 'css/build/main.css', '../images/bg.gif', '../../images/bg.gif'), - array('body { background: url("%s"); }', 'css/body.css', 'css/build/main.css', '../images/bg.gif', '../../images/bg.gif'), - array('body { background: url(\'%s\'); }', 'css/body.css', 'css/build/main.css', '../images/bg.gif', '../../images/bg.gif'), - - //url with data: - array('body { background: url(\'%s\'); }', 'css/body.css', 'css/build/main.css', 'data:image/png;base64,abcdef=', 'data:image/png;base64,abcdef='), - array('body { background: url(\'%s\'); }', 'css/body.css', 'css/build/main.css', '../images/bg-data:.gif', '../../images/bg-data:.gif'), - - // @import variants - array('@import "%s";', 'css/imports.css', 'css/build/main.css', 'import.css', '../import.css'), - array('@import url(%s);', 'css/imports.css', 'css/build/main.css', 'import.css', '../import.css'), - array('@import url("%s");', 'css/imports.css', 'css/build/main.css', 'import.css', '../import.css'), - array('@import url(\'%s\');', 'css/imports.css', 'css/build/main.css', 'import.css', '../import.css'), - - // path diffs - array('body { background: url(%s); }', 'css/body/bg.css', 'css/build/main.css', '../../images/bg.gif', '../../images/bg.gif'), - array('body { background: url(%s); }', 'css/body.css', 'main.css', '../images/bg.gif', 'css/../images/bg.gif'), // fixme - array('body { background: url(%s); }', 'body.css', 'css/main.css', 'images/bg.gif', '../images/bg.gif'), - array('body { background: url(%s); }', 'source/css/body.css', 'output/build/main.css', '../images/bg.gif', '../../source/images/bg.gif'), - array('body { background: url(%s); }', 'css/body.css', 'css/build/main.css', '//example.com/images/bg.gif', '//example.com/images/bg.gif'), - - // url diffs - array('body { background: url(%s); }', 'css/body.css', 'css/build/main.css', 'http://foo.com/bar.gif', 'http://foo.com/bar.gif'), - array('body { background: url(%s); }', 'css/body.css', 'css/build/main.css', '/images/foo.gif', '/images/foo.gif'), - array('body { background: url(%s); }', 'css/body.css', 'css/build/main.css', 'http://foo.com/images/foo.gif', 'http://foo.com/images/foo.gif'), - ); - } - - /** - * @dataProvider provideMultipleUrls - */ - public function testMultipleUrls($format, $sourcePath, $targetPath, $inputUrl1, $inputUrl2, $expectedUrl1, $expectedUrl2) - { - $asset = new StringAsset(sprintf($format, $inputUrl1, $inputUrl2), array(), null, $sourcePath); - $asset->setTargetPath($targetPath); - $asset->load(); - - $filter = new CssRewriteFilter(); - $filter->filterLoad($asset); - $filter->filterDump($asset); - - $this->assertEquals(sprintf($format, $expectedUrl1, $expectedUrl2), $asset->getContent(), '->filterDump() rewrites relative urls'); - } - - public function provideMultipleUrls() - { - return array( - // multiple url - array('body { background: url(%s); background: url(%s); }', 'css/body.css', 'css/build/main.css', '../images/bg.gif', '../images/bg2.gif', '../../images/bg.gif', '../../images/bg2.gif'), - array("body { background: url(%s);\nbackground: url(%s); }", 'css/body.css', 'css/build/main.css', '../images/bg.gif', '../images/bg2.gif', '../../images/bg.gif', '../../images/bg2.gif'), - - // multiple import - array('@import "%s"; @import "%s";', 'css/imports.css', 'css/build/main.css', 'import.css', 'import2.css', '../import.css', '../import2.css'), - array("@import \"%s\";\n@import \"%s\";", 'css/imports.css', 'css/build/main.css', 'import.css', 'import2.css', '../import.css', '../import2.css'), - - // mixed urls and imports - array('@import "%s"; body { background: url(%s); }', 'css/body.css', 'css/build/main.css', 'import.css', '../images/bg2.gif', '../import.css', '../../images/bg2.gif'), - array("@import \"%s\";\nbody { background: url(%s); }", 'css/body.css', 'css/build/main.css', 'import.css', '../images/bg2.gif', '../import.css', '../../images/bg2.gif'), - ); - } - - public function testNoTargetPath() - { - $content = 'body { background: url(foo.gif); }'; - - $asset = new StringAsset($content); - $asset->load(); - - $filter = new CssRewriteFilter(); - $filter->filterDump($asset); - - $this->assertEquals($content, $asset->getContent(), '->filterDump() urls are not changed without urls'); - } - - public function testExternalSource() - { - $asset = new StringAsset('body { background: url(../images/bg.gif); }', array(), 'http://www.example.com', 'css/main.css'); - $asset->setTargetPath('css/packed/main.css'); - $asset->load(); - - $filter = new CssRewriteFilter(); - $filter->filterDump($asset); - - $this->assertContains('http://www.example.com/css/../images/bg.gif', $asset->getContent(), '->filterDump() rewrites references in external stylesheets'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/FilterCollectionTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/FilterCollectionTest.php deleted file mode 100644 index 277c773..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/FilterCollectionTest.php +++ /dev/null @@ -1,59 +0,0 @@ -assertInstanceOf('Assetic\\Filter\\FilterInterface', $filter, 'FilterCollection implements FilterInterface'); - } - - public function testEnsure() - { - $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - - $filter->expects($this->once())->method('filterLoad'); - - $coll = new FilterCollection(); - $coll->ensure($filter); - $coll->ensure($filter); - $coll->filterLoad($asset); - } - - public function testAll() - { - $filter = new FilterCollection(array( - $this->getMock('Assetic\\Filter\\FilterInterface'), - $this->getMock('Assetic\\Filter\\FilterInterface'), - )); - - $this->assertInternalType('array', $filter->all(), '->all() returns an array'); - } - - public function testEmptyAll() - { - $filter = new FilterCollection(); - $this->assertInternalType('array', $filter->all(), '->all() returns an array'); - } - - public function testCountable() - { - $filters = new FilterCollection(array($this->getMock('Assetic\\Filter\\FilterInterface'))); - - $this->assertEquals(1, count($filters), 'Countable returns the count'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GoogleClosure/CompilerApiFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GoogleClosure/CompilerApiFilterTest.php deleted file mode 100644 index a8458d0..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GoogleClosure/CompilerApiFilterTest.php +++ /dev/null @@ -1,59 +0,0 @@ -load(); - - $filter = new CompilerApiFilter(); - $filter->setCompilationLevel(CompilerApiFilter::COMPILE_SIMPLE_OPTIMIZATIONS); - $filter->setJsExterns(''); - $filter->setExternsUrl(''); - $filter->setExcludeDefaultExterns(true); - $filter->setFormatting(CompilerApiFilter::FORMAT_PRETTY_PRINT); - $filter->setUseClosureLibrary(false); - $filter->setWarningLevel(CompilerApiFilter::LEVEL_VERBOSE); - - $filter->filterLoad($asset); - $filter->filterDump($asset); - - $this->assertEquals($expected, $asset->getContent()); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GoogleClosure/CompilerJarFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GoogleClosure/CompilerJarFilterTest.php deleted file mode 100644 index 2edb9c6..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GoogleClosure/CompilerJarFilterTest.php +++ /dev/null @@ -1,53 +0,0 @@ -markTestSkipped('There is no CLOSURE_JAR environment variable.'); - } - - $input = <<load(); - - $filter = new CompilerJarFilter($_SERVER['CLOSURE_JAR']); - $filter->filterLoad($asset); - $filter->filterDump($asset); - - $this->assertEquals($expected, $asset->getContent()); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GssFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GssFilterTest.php deleted file mode 100644 index 2b4c7bc..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/GssFilterTest.php +++ /dev/null @@ -1,45 +0,0 @@ -markTestSkipped('There is no GSS_JAR environment variable.'); - } - - $input = <<load(); - - $filter = new GssFilter($_SERVER['GSS_JAR']); - $filter->filterLoad($asset); - - $this->assertEquals($expected, $asset->getContent()); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JSMinFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JSMinFilterTest.php deleted file mode 100644 index b0d6c21..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JSMinFilterTest.php +++ /dev/null @@ -1,39 +0,0 @@ -markTestSkipped('JSMin is not installed.'); - } - } - - public function testRelativeSourceUrlImportImports() - { - $asset = new FileAsset(__DIR__.'/fixtures/jsmin/js.js'); - $asset->load(); - - $filter = new JSMinFilter(); - $filter->filterDump($asset); - - $this->assertEquals('var a="abc";;;var bbb="u";', $asset->getContent()); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JSMinPlusFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JSMinPlusFilterTest.php deleted file mode 100644 index 72e769a..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JSMinPlusFilterTest.php +++ /dev/null @@ -1,39 +0,0 @@ -markTestSkipped('JSMinPlus is not installed.'); - } - } - - public function testRelativeSourceUrlImportImports() - { - $asset = new FileAsset(__DIR__.'/fixtures/jsmin/js.js'); - $asset->load(); - - $filter = new JSMinPlusFilter(); - $filter->filterDump($asset); - - $this->assertEquals('var a="abc",bbb="u"', $asset->getContent()); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JpegoptimFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JpegoptimFilterTest.php deleted file mode 100644 index d0a6761..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JpegoptimFilterTest.php +++ /dev/null @@ -1,45 +0,0 @@ -markTestSkipped('No jpegoptim configuration.'); - } - - $this->filter = new JpegoptimFilter($_SERVER['JPEGOPTIM_BIN']); - } - - public function testFilter() - { - $asset = new FileAsset(__DIR__.'/fixtures/home.jpg'); - $asset->load(); - - $before = $asset->getContent(); - $this->filter->filterDump($asset); - - $this->assertNotEmpty($asset->getContent(), '->filterLoad() sets content'); - $this->assertNotEquals($before, $asset->getContent(), '->filterDump() changes the content'); - $this->assertMimeType('image/jpeg', $asset->getContent(), '->filterDump() creates JPEG data'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JpegtranFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JpegtranFilterTest.php deleted file mode 100644 index 10245f6..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/JpegtranFilterTest.php +++ /dev/null @@ -1,45 +0,0 @@ -markTestSkipped('No jpegtran configuration.'); - } - - $this->filter = new JpegtranFilter($_SERVER['JPEGTRAN_BIN']); - } - - public function testFilter() - { - $asset = new FileAsset(__DIR__.'/fixtures/home.jpg'); - $asset->load(); - - $before = $asset->getContent(); - $this->filter->filterDump($asset); - - $this->assertNotEmpty($asset->getContent(), '->filterLoad() sets content'); - $this->assertNotEquals($before, $asset->getContent(), '->filterDump() changes the content'); - $this->assertMimeType('image/jpeg', $asset->getContent(), '->filterDump() creates JPEG data'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/LessFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/LessFilterTest.php deleted file mode 100644 index ce97a86..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/LessFilterTest.php +++ /dev/null @@ -1,63 +0,0 @@ -markTestSkipped('No node.js configuration.'); - } - - $this->filter = new LessFilter($_SERVER['NODE_BIN'], array($_SERVER['NODE_PATH'])); - } - - public function testFilterLoad() - { - $asset = new StringAsset('.foo{.bar{width:1+1;}}'); - $asset->load(); - - $this->filter->filterLoad($asset); - - $this->assertEquals(".foo .bar {\n width: 2;\n}\n", $asset->getContent(), '->filterLoad() parses the content'); - } - - public function testImport() - { - $expected = <<load(); - - $this->filter->filterLoad($asset); - - $this->assertEquals($expected, $asset->getContent(), '->filterLoad() sets an include path based on source url'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/LessphpFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/LessphpFilterTest.php deleted file mode 100644 index 08a8031..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/LessphpFilterTest.php +++ /dev/null @@ -1,67 +0,0 @@ -filter = new LessphpFilter(); - } - - public function testFilterLoad() - { - $asset = new StringAsset('.foo{.bar{width:1+ 1;}}'); - $asset->load(); - - $this->filter->filterLoad($asset); - - $this->assertEquals(".foo .bar { width:2; }\n", $asset->getContent(), '->filterLoad() parses the content'); - } - - public function testImport() - { - $expected = <<load(); - - $this->filter->filterLoad($asset); - - $this->assertEquals($expected, $asset->getContent(), '->filterLoad() sets an include path based on source url'); - } - - public function testPresets() - { - $asset = new StringAsset('.foo { color: @bar }'); - $asset->load(); - - $this->filter->setPresets(array( - 'bar' => 'green' - )); - - $this->filter->filterLoad($asset); - - $this->assertEquals(".foo { color:green; }\n", $asset->getContent(), '->setPresets() to pass variables into lessphp filter'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/OptiPngFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/OptiPngFilterTest.php deleted file mode 100644 index c2f72c7..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/OptiPngFilterTest.php +++ /dev/null @@ -1,56 +0,0 @@ -markTestSkipped('No OptiPNG configuration.'); - } - - $this->filter = new OptiPngFilter($_SERVER['OPTIPNG_BIN']); - } - - /** - * @dataProvider getImages - */ - public function testFilter($image) - { - $asset = new FileAsset($image); - $asset->load(); - - $before = $asset->getContent(); - $this->filter->filterDump($asset); - - $this->assertNotEmpty($asset->getContent(), '->filterDump() sets content'); - $this->assertNotEquals($before, $asset->getContent(), '->filterDump() changes the content'); - $this->assertMimeType('image/png', $asset->getContent(), '->filterDump() creates PNG data'); - } - - public function getImages() - { - return array( - array(__DIR__.'/fixtures/home.gif'), - array(__DIR__.'/fixtures/home.png'), - ); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PackagerFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PackagerFilterTest.php deleted file mode 100644 index 7dcdaa0..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PackagerFilterTest.php +++ /dev/null @@ -1,69 +0,0 @@ -markTestSkipped('Packager is not available.'); - } - } - - public function testPackager() - { - $expected = <<load(); - - $filter = new PackagerFilter(); - $filter->addPackage(__DIR__.'/fixtures/packager/lib'); - $filter->filterLoad($asset); - - $this->assertEquals($expected, $asset->getContent(), '->filterLoad() runs packager'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PackerFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PackerFilterTest.php deleted file mode 100644 index 8bad914..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PackerFilterTest.php +++ /dev/null @@ -1,36 +0,0 @@ -markTestSkipped('JavaScriptPacker is not installed.'); - } - } - - public function testPacker() - { - $asset = new FileAsset(__DIR__.'/fixtures/packer/example.js'); - $asset->load(); - - $filter = new PackerFilter(); - $filter->filterDump($asset); - - $this->assertEquals("var exampleFunction=function(arg1,arg2){alert('exampleFunction called!')}", $asset->getContent()); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PngoutFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PngoutFilterTest.php deleted file mode 100644 index 23c0712..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PngoutFilterTest.php +++ /dev/null @@ -1,57 +0,0 @@ -markTestSkipped('No pngout configuration.'); - } - - $this->filter = new PngoutFilter($_SERVER['PNGOUT_BIN']); - } - - /** - * @dataProvider getImages - */ - public function testFilter($image) - { - $asset = new FileAsset($image); - $asset->load(); - - $before = $asset->getContent(); - $this->filter->filterDump($asset); - - $this->assertNotEmpty($asset->getContent(), '->filterLoad() sets content'); - $this->assertNotEquals($before, $asset->getContent(), '->filterLoad() changes the content'); - $this->assertMimeType('image/png', $asset->getContent(), '->filterLoad() creates PNG data'); - } - - public function getImages() - { - return array( - array(__DIR__.'/fixtures/home.gif'), - array(__DIR__.'/fixtures/home.jpg'), - array(__DIR__.'/fixtures/home.png'), - ); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Sass/SassFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Sass/SassFilterTest.php deleted file mode 100644 index 874e591..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Sass/SassFilterTest.php +++ /dev/null @@ -1,70 +0,0 @@ -markTestSkipped('There is no SASS_BIN environment variable.'); - } - - $this->filter = new SassFilter($_SERVER['SASS_BIN']); - } - - public function testSass() - { - $input = <<load(); - - $this->filter->setStyle(SassFilter::STYLE_COMPACT); - $this->filter->filterLoad($asset); - - $this->assertEquals("body { color: red; }\n", $asset->getContent(), '->filterLoad() parses the sass'); - } - - public function testScssGuess() - { - $input = <<<'EOF' -$red: #F00; - -.foo { - color: $red; -} - -EOF; - - $expected = '.foo { color: red; }'; - - $asset = new StringAsset($input, array(), null, 'foo.scss'); - $asset->load(); - - $this->filter->setStyle(SassFilter::STYLE_COMPACT); - $this->filter->filterLoad($asset); - - $this->assertEquals(".foo { color: red; }\n", $asset->getContent(), '->filterLoad() detects SCSS based on source path extension'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Sass/ScssFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Sass/ScssFilterTest.php deleted file mode 100644 index a08fe0e..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Sass/ScssFilterTest.php +++ /dev/null @@ -1,44 +0,0 @@ -markTestSkipped('There is no SASS_BIN environment variable.'); - } - - $asset = new FileAsset(__DIR__.'/../fixtures/sass/main.scss'); - $asset->load(); - - $filter = new ScssFilter($_SERVER['SASS_BIN']); - $filter->setStyle(ScssFilter::STYLE_COMPACT); - $filter->filterLoad($asset); - - $expected = <<assertEquals($expected, $asset->getContent(), '->filterLoad() loads imports'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/SprocketsFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/SprocketsFilterTest.php deleted file mode 100644 index 8694dc5..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/SprocketsFilterTest.php +++ /dev/null @@ -1,69 +0,0 @@ -markTestSkipped('There is no sprockets configuration.'); - } - - $this->assetRoot = sys_get_temp_dir().'/assetic_sprockets'; - if (is_dir($this->assetRoot)) { - $this->cleanup(); - } else { - mkdir($this->assetRoot); - } - } - - protected function tearDown() - { - $this->cleanup(); - } - - private function cleanup() - { - $it = new \RecursiveDirectoryIterator($this->assetRoot); - foreach (new \RecursiveIteratorIterator($it) as $path => $file) { - if (is_file($path)) { - unlink($path); - } - } - } - - public function testFilterLoad() - { - $asset = new FileAsset(__DIR__.'/fixtures/sprockets/main.js'); - $asset->load(); - - $filter = new SprocketsFilter($_SERVER['SPROCKETS_LIB'], $_SERVER['RUBY_BIN']); - $filter->addIncludeDir(__DIR__.'/fixtures/sprockets/lib1'); - $filter->addIncludeDir(__DIR__.'/fixtures/sprockets/lib2'); - $filter->setAssetRoot($this->assetRoot); - $filter->filterLoad($asset); - - $this->assertContains('/* header.js */', $asset->getContent()); - $this->assertContains('/* include.js */', $asset->getContent()); - $this->assertContains('/* footer.js */', $asset->getContent()); - $this->assertFileExists($this->assetRoot.'/images/image.gif'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/StylusFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/StylusFilterTest.php deleted file mode 100644 index 03fc729..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/StylusFilterTest.php +++ /dev/null @@ -1,53 +0,0 @@ -markTestSkipped('No node.js configuration.'); - } - - $this->filter = new StylusFilter($_SERVER['NODE_BIN'], array($_SERVER['NODE_PATH'])); - } - - public function testFilterLoad() - { - $asset = new StringAsset("body\n font 12px Helvetica, Arial, sans-serif\n color black"); - $asset->load(); - - $this->filter->filterLoad($asset); - - $this->assertEquals("body {\n font: 12px Helvetica, Arial, sans-serif;\n color: #000;\n}\n", $asset->getContent(), '->filterLoad() parses the content'); - } - - public function testFilterLoadWithCompression() - { - $asset = new StringAsset("body\n font 12px Helvetica, Arial, sans-serif\n color black;"); - $asset->load(); - - $this->filter->setCompress(true); - $this->filter->filterLoad($asset); - - $this->assertEquals("body{font:12px Helvetica,Arial,sans-serif;color:#000}\n", $asset->getContent(), '->filterLoad() parses the content and compress it'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/UglifyJsFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/UglifyJsFilterTest.php deleted file mode 100644 index bc4b242..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/UglifyJsFilterTest.php +++ /dev/null @@ -1,100 +0,0 @@ -markTestSkipped('There is no uglifyJs configuration.'); - } - - $this->asset = new FileAsset(__DIR__.'/fixtures/uglifyjs/script.js'); - $this->asset->load(); - - if (isset($_SERVER['NODE_BIN'])) { - $this->filter = new UglifyJsFilter($_SERVER['UGLIFYJS_BIN'], $_SERVER['NODE_BIN']); - } else { - $this->filter = new UglifyJsFilter($_SERVER['UGLIFYJS_BIN']); - } - } - - protected function tearDown() - { - $this->asset = null; - $this->filter = null; - } - - public function testUglify() - { - $this->filter->filterDump($this->asset); - - $expected = <<assertSame($expected, $this->asset->getContent()); - } - - public function testUnsafeUglify() - { - $this->filter->setUnsafe(true); - $this->filter->filterDump($this->asset); - - $expected = <<assertSame($expected, $this->asset->getContent()); - } - - public function testBeautifyUglify() - { - $this->filter->setBeautify(true); - $this->filter->filterDump($this->asset); - - $expected = <<assertSame($expected, $this->asset->getContent()); - } - - public function testNoCopyrightUglify() - { - $this->filter->setNoCopyright(true); - $this->filter->filterDump($this->asset); - - $expected = 'function bar(a){return var2.push(a),a}var foo=new Array(1,2,3,4),bar=Array(a,b,c),var1=new Array(5),var2=new Array(a),foo=function(a){return a};'; - $this->assertSame($expected, $this->asset->getContent()); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/BaseCompressorFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/BaseCompressorFilterTest.php deleted file mode 100644 index 39491b1..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/BaseCompressorFilterTest.php +++ /dev/null @@ -1,31 +0,0 @@ -assertInstanceOf('Assetic\\Filter\\FilterInterface', $filter, 'BaseCompressorFilter implements FilterInterface'); - } -} - -class YuiCompressorFilterForTest extends BaseCompressorFilter -{ - public function filterDump(AssetInterface $asset) - { - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/CssCompressorFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/CssCompressorFilterTest.php deleted file mode 100644 index 61f9fd8..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/CssCompressorFilterTest.php +++ /dev/null @@ -1,23 +0,0 @@ -assertInstanceOf('Assetic\\Filter\\FilterInterface', $filter, 'CssCompressorFilter implements FilterInterface'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/JsCompressorFilterTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/JsCompressorFilterTest.php deleted file mode 100644 index c391837..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/Yui/JsCompressorFilterTest.php +++ /dev/null @@ -1,62 +0,0 @@ -assertInstanceOf('Assetic\\Filter\\FilterInterface', $filter, 'JsCompressorFilter implements FilterInterface'); - } - - /** - * @group integration - */ - public function testFilterDump() - { - if (!isset($_SERVER['YUI_COMPRESSOR_JAR'])) { - $this->markTestSkipped('There is no YUI_COMPRESSOR_JAR environment variable.'); - } - - $source = <<load(); - - $filter = new JsCompressorFilter($_SERVER['YUI_COMPRESSOR_JAR']); - $filter->filterDump($asset); - - $this->assertEquals($expected, $asset->getContent(), '->filterDump()'); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/compass.sass b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/compass.sass deleted file mode 100644 index dfc99fb..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/compass.sass +++ /dev/null @@ -1,4 +0,0 @@ -@import "compass/typography/links/hover-link" - -a - @include hover-link diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/partials/_sass.sass b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/partials/_sass.sass deleted file mode 100644 index 8593aab..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/partials/_sass.sass +++ /dev/null @@ -1,4 +0,0 @@ -@import "compass/utilities" - -@mixin mixin-test($fontSize: 1em) - font-size: $fontSize \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/partials/_scss.scss b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/partials/_scss.scss deleted file mode 100644 index 896ba5b..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/partials/_scss.scss +++ /dev/null @@ -1,6 +0,0 @@ -@import "compass/utilities"; - -@mixin mixin-test($fontSize: 1em) -{ - font-size: $fontSize; -} \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/stylesheet.sass b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/stylesheet.sass deleted file mode 100644 index 569d84e..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/stylesheet.sass +++ /dev/null @@ -1,4 +0,0 @@ -@import "partials/sass" - -.test-class - @include mixin-test(2em) \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/stylesheet.scss b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/stylesheet.scss deleted file mode 100644 index 461884c..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/compass/stylesheet.scss +++ /dev/null @@ -1,6 +0,0 @@ -@import "partials/scss"; - -.test-class -{ - @include mixin-test(2em); -} \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssembed/test.css b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssembed/test.css deleted file mode 100644 index 370982c..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssembed/test.css +++ /dev/null @@ -1,4 +0,0 @@ -.test -{ - background: url(../home.png); -} \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/import.css b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/import.css deleted file mode 100644 index e2c77fe..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/import.css +++ /dev/null @@ -1,2 +0,0 @@ -/* import.css */ -body { color: red; } \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/main.css b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/main.css deleted file mode 100644 index 1a90d49..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/main.css +++ /dev/null @@ -1,4 +0,0 @@ -/* main.css */ -@import "import.css"; -@import url('more/evenmore/deep1.css'); -body { color: black; } \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more.sass b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more.sass deleted file mode 100644 index 1463b16..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more.sass +++ /dev/null @@ -1 +0,0 @@ -/* more.sass */ \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/bg.gif b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/bg.gif deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/deep1.css b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/deep1.css deleted file mode 100644 index 433b341..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/deep1.css +++ /dev/null @@ -1,2 +0,0 @@ -/* more/evenmore/deep1.css */ -@import url(deep2.css); \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/deep2.css b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/deep2.css deleted file mode 100644 index 645a40e..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/more/evenmore/deep2.css +++ /dev/null @@ -1,4 +0,0 @@ -/* more/evenmore/deep2.css */ -body { - background: url(bg.gif); -} \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/noncssimport.css b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/noncssimport.css deleted file mode 100644 index 2cea30f..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssimport/noncssimport.css +++ /dev/null @@ -1,2 +0,0 @@ -/* noncssimport.css */ -@import "more.sass"; \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssmin/fonts.css b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssmin/fonts.css deleted file mode 100644 index 2d135f6..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssmin/fonts.css +++ /dev/null @@ -1,3 +0,0 @@ -body { - color: white; -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssmin/main.css b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssmin/main.css deleted file mode 100644 index 8fbabc8..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/cssmin/main.css +++ /dev/null @@ -1,5 +0,0 @@ -@import url("fonts.css"); - -body { - background: black; -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/home.gif b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/home.gif deleted file mode 100644 index edda5603d352c0483c577cf208db53cb7ef13471..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 61 zcmZ?wbhEHbC5UDGKfoZ!!NA49#mp$kz$D1XEXer(2tzUh z12fQ#NPvZdlaUdL4`vDgJ)(FaTYrk~7(Q*CwD^^RPU!s(ss;rnA{dE zWm7n%vc#{t^UjVq7gtTUzPeu5Bi)x&rzUu6dWpB+d|UL+X^LIIZ{AzM`{!+8Zr}AY cVT#W6n0+f4v7|ftIx;YR|DNig)WpGT%PfAtr%uP&B4N6T+sVqF1Y6Dc{<>}%WQgJKk&;S4S%ti^{?(UXy z`G5C~Oqb5N7GFUtX;;NvEW0Fx^;}V5n3!A`8LR<&whSHs diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/lib1/header.js b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/lib1/header.js deleted file mode 100644 index c60f8d5..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/lib1/header.js +++ /dev/null @@ -1,3 +0,0 @@ -/* header.js */ - -//= provide "assets" diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/lib2/footer.js b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/lib2/footer.js deleted file mode 100644 index 5ce2b9c..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/lib2/footer.js +++ /dev/null @@ -1 +0,0 @@ -/* footer.js */ diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/main.js b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/main.js deleted file mode 100644 index 6ea483a..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/sprockets/main.js +++ /dev/null @@ -1,5 +0,0 @@ -//= require
- -//= require "include" - -//= require
diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/uglifyjs/script.js b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/uglifyjs/script.js deleted file mode 100644 index a7c2233..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/uglifyjs/script.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright - */ - -var foo = new Array(1, 2, 3, 4); -var bar = Array(a, b, c); -var var1 = new Array(5); -var var2 = new Array(a); - -function bar(foo) { - var2.push(foo); - return foo; -} - -// comment -var foo = function (var1) { - return var1; -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/FilterManagerTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/FilterManagerTest.php deleted file mode 100644 index 6d54a71..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/FilterManagerTest.php +++ /dev/null @@ -1,58 +0,0 @@ -fm = new FilterManager(); - } - - public function testInvalidName() - { - $this->setExpectedException('InvalidArgumentException'); - - $this->fm->get('foo'); - } - - public function testGetFilter() - { - $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); - $name = 'foo'; - - $this->fm->set($name, $filter); - - $this->assertSame($filter, $this->fm->get($name), '->set() sets a filter'); - } - - public function testHas() - { - $this->fm->set('foo', $this->getMock('Assetic\\Filter\\FilterInterface')); - $this->assertTrue($this->fm->has('foo'), '->has() returns true if the filter is set'); - } - - public function testHasInvalid() - { - $this->assertFalse($this->fm->has('foo'), '->has() returns false if the filter is not set'); - } - - public function testInvalidAlias() - { - $this->setExpectedException('InvalidArgumentException'); - $this->fm->set('@foo', $this->getMock('Assetic\\Filter\\FilterInterface')); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Fixture/messages.de.js b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Fixture/messages.de.js deleted file mode 100644 index d2c7780..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Fixture/messages.de.js +++ /dev/null @@ -1 +0,0 @@ -var messages = {"text.greeting": "Hallo %name%!"}; \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Fixture/messages.en.js b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Fixture/messages.en.js deleted file mode 100644 index 3eb9da2..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Fixture/messages.en.js +++ /dev/null @@ -1 +0,0 @@ -var messages = {"text.greeting": "Hello %name%!"}; \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Fixture/messages.fr.js b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Fixture/messages.fr.js deleted file mode 100644 index 8fd4c4d..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Fixture/messages.fr.js +++ /dev/null @@ -1 +0,0 @@ -var messages = {"text.greet": "All\u00f4 %name%!"}; \ No newline at end of file diff --git a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Util/TraversableStringTest.php b/vendor/kriswallsmith/assetic/tests/Assetic/Test/Util/TraversableStringTest.php deleted file mode 100644 index 47bd05a..0000000 --- a/vendor/kriswallsmith/assetic/tests/Assetic/Test/Util/TraversableStringTest.php +++ /dev/null @@ -1,35 +0,0 @@ -assertEquals('foo', (string) $foo); - } - - public function testArray() - { - $foo = new TraversableString('foo', array('foo', 'bar')); - - $values = array(); - foreach ($foo as $value) { - $values[] = $value; - } - - $this->assertEquals(array('foo', 'bar'), $values); - } -} diff --git a/vendor/kriswallsmith/assetic/tests/bootstrap.php b/vendor/kriswallsmith/assetic/tests/bootstrap.php deleted file mode 100644 index f366669..0000000 --- a/vendor/kriswallsmith/assetic/tests/bootstrap.php +++ /dev/null @@ -1,46 +0,0 @@ -add('Assetic\Test', __DIR__); - -if (isset($_SERVER['TWIG_LIB'])) { - $loader->add('Twig_', $_SERVER['TWIG_LIB']); -} - -if (isset($_SERVER['LESSPHP'])) { - require_once $_SERVER['LESSPHP']; -} - -if (isset($_SERVER['CSSMIN'])) { - require_once $_SERVER['CSSMIN']; -} - -if (isset($_SERVER['JSMIN'])) { - require_once $_SERVER['JSMIN']; -} - -if (isset($_SERVER['JSMINPLUS'])) { - require_once $_SERVER['JSMINPLUS']; -} - -if (isset($_SERVER['PACKAGER'])) { - require_once $_SERVER['PACKAGER']; -} - -if (isset($_SERVER['PACKER'])) { - require_once $_SERVER['PACKER']; -} diff --git a/vendor/monolog/monolog/.travis.yml b/vendor/monolog/monolog/.travis.yml deleted file mode 100644 index eb35049..0000000 --- a/vendor/monolog/monolog/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: php - -php: - - 5.3 - - 5.4 - -before_script: - - curl -s http://getcomposer.org/installer | php - - php composer.phar install --dev - -script: phpunit diff --git a/vendor/monolog/monolog/CHANGELOG.mdown b/vendor/monolog/monolog/CHANGELOG.mdown deleted file mode 100644 index ddaa16e..0000000 --- a/vendor/monolog/monolog/CHANGELOG.mdown +++ /dev/null @@ -1,38 +0,0 @@ -* 1.1.0 (2012-04-23) - - Changes: - - * Added Monolog\Logger::isHandling() to check if a handler will - handle the given log level - * Added ChromePHPHandler - * Added MongoDBHandler - * Added GelfHandler (for use with Graylog2 servers) - * Added SocketHandler (for use with syslog-ng for example) - * Added NormalizerFormatter - * Added the possibility to change the activation strategy of the FingersCrossedHandler - * Added possibility to show microseconds in logs - * Added `server` and `referer` to WebProcessor output - -* 1.0.2 (2011-10-24) - - Changes: - - * Fixed bug in IE with large response headers and FirePHPHandler - -* 1.0.1 (2011-08-25) - - Changes: - - * Added MemoryPeakUsageProcessor and MemoryUsageProcessor - * Added Monolog\Logger::getName() to get a logger's channel name - -* 1.0.0 (2011-07-06) - - Changes: - - * Added IntrospectionProcessor to get info from where the logger was called - * Fixed WebProcessor in CLI - -* 1.0.0-RC1 (2011-07-01) - - * Initial release diff --git a/vendor/monolog/monolog/LICENSE b/vendor/monolog/monolog/LICENSE deleted file mode 100644 index 5df1c39..0000000 --- a/vendor/monolog/monolog/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/monolog/monolog/README.mdown b/vendor/monolog/monolog/README.mdown deleted file mode 100644 index 786aac1..0000000 --- a/vendor/monolog/monolog/README.mdown +++ /dev/null @@ -1,172 +0,0 @@ -Monolog - Logging for PHP 5.3 -============================= - -[![Build Status](https://secure.travis-ci.org/Seldaek/monolog.png)](http://travis-ci.org/Seldaek/monolog) - -Usage ------ - - use Monolog\Logger; - use Monolog\Handler\StreamHandler; - - // create a log channel - $log = new Logger('name'); - $log->pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING)); - - // add records to the log - $log->addWarning('Foo'); - $log->addError('Bar'); - -Core Concepts -------------- - -Every Logger instance has a channel (name) and a stack of handlers. Whenever -you add a record to the logger, it traverses the handler stack. Each handler -decides whether it handled fully the record, and if so, the propagation of the -record ends there. - -This allow for flexible logging setups, for example having a FileHandler at -the bottom of the stack that will log anything to disk, and on top of that add -a MailHandler that will send emails only when an error message is logged. -Handlers also have a bubbling property which define whether they block the -record or not if they handled it. In this example, setting the MailHandler's -$bubble argument to true means that all records will propagate to the -FileHandler, even the errors that are handled by the MailHandler. - -You can create many Loggers, each defining a channel (e.g.: db, request, -router, ..) and each of them combining various handlers, which can be shared -or not. The channel is reflected in the logs and allows you to easily see or -filter records. - -Each Handler also has a Formatter, a default one with settings that make sense -will be created if you don't set one. The formatters normalize and format -incoming records so that they can be used by the handlers to output useful -information. - -Custom severity levels are not available. Only six levels (debug, info, -warning, error, critical, alert) are present for basic filtering purposes, but -for sorting and other use cases that would require flexibility, you should add -Processors to the Logger that can add extra information (tags, user ip, ..) to -the records before they are handled. - -Log Levels ----------- - -Monolog exposes 6 log levels. Although it is possible to add more by extending -the classes you need, these are generally enough. - -- **DEBUG** (100): Detailed debug information. - -- **INFO** (200): Interesting events. Examples: User logs in, SQL logs. - -- **WARNING** (300): Exceptional occurrences that are not errors. Examples: - Use of deprecated APIs, poor use of an API, undesirable things that are not - necessarily wrong. - -- **ERROR** (400): Runtime errors that do not require immediate action but - should typically be logged and monitored. - -- **CRITICAL** (500): Critical conditions. Example: Application component - unavailable, unexpected exception. - -- **ALERT** (550): Action must be taken immediately. Example: Entire website - down, database unavailable, etc. This should trigger the SMS alerts and wake - you up. - -Docs -==== - -**See the doc/ directory for more detailed documentation. The following is only a list of all parts that come with Monolog.** - -Handlers --------- - -- _StreamHandler_: Logs records into any php stream, use this for log files. -- _RotatingFileHandler_: Logs records to a file and creates one logfile per day. - It will also delete files older than $maxFiles. You should use - [logrotate](http://linuxcommand.org/man_pages/logrotate8.html) for high profile - setups though, this is just meant as a quick and dirty solution. -- _FirePHPHandler_: Handler for [FirePHP](http://www.firephp.org/), providing - inline `console` messages within [FireBug](http://getfirebug.com/). -- _ChromePHPHandler_: Handler for [ChromePHP](http://www.chromephp.com/), providing - inline `console` messages within Chrome. -- _MongoDBHandler_: Handler to write records in MongoDB via a - [Mongo](http://pecl.php.net/package/mongo) extension connection. -- _NativeMailHandler_: Sends emails using PHP's mail() function. -- _SwiftMailerHandler_: Sends emails using a SwiftMailer instance. -- _SyslogHandler_: Logs records to the syslog. -- _GelfHandler_: Logs records to a [Graylog2](http://www.graylog2.org) server. -- _SocketHandler_: Logs records to [sockets](http://php.net/fsockopen), use this - for UNIX and TCP sockets. See an [example](https://github.com/Seldaek/monolog/blob/master/doc/sockets.md). - -Wrappers / Special Handlers ---------------------------- - -- _FingersCrossedHandler_: A very interesting wrapper. It takes a logger as - parameter and will accumulate log records of all levels until a record - exceeds the defined severity level. At which point it delivers all records, - including those of lower severity, to the handler it wraps. This means that - until an error actually happens you will not see anything in your logs, but - when it happens you will have the full information, including debug and info - records. This provides you with all the information you need, but only when - you need it. -- _NullHandler_: Any record it can handle will be thrown away. This can be used - to put on top of an existing handler stack to disable it temporarily. -- _BufferHandler_: This handler will buffer all the log records it receives - until close() is called at which point it will call handleBatch() on the - handler it wraps with all the log messages at once. This is very useful to - send an email with all records at once for example instead of having one mail - for every log record. -- _GroupHandler_: This handler groups other handlers. Every record received is - sent to all the handlers it is configured with. -- _TestHandler_: Used for testing, it records everything that is sent to it and - has accessors to read out the information. - -Formatters ----------- - -- _LineFormatter_: Formats a log record into a one-line string. -- _NormalizerFormatter_: Normalizes objects/resources down to strings so a record can easily be serialized/encoded. -- _JsonFormatter_: Encodes a log record into json. -- _WildfireFormatter_: Used to format log records into the Wildfire/FirePHP protocol, only useful for the FirePHPHandler. -- _ChromePHPFormatter_: Used to format log records into the ChromePHP format, only useful for the ChromePHPHandler. -- _GelfFormatter_: Used to format log records into Gelf message instances, only useful for the GelfHandler. - -Processors ----------- - -- _IntrospectionProcessor_: Adds the line/file/class/method from which the log call originated. -- _WebProcessor_: Adds the current request URI, request method and client IP to a log record. -- _MemoryUsageProcessor_: Adds the current memory usage to a log record. -- _MemoryPeakUsageProcessor_: Adds the peak memory usage to a log record. - -About -===== - -Requirements ------------- - -- Any flavor of PHP 5.3 should do -- [optional] PHPUnit 3.5+ to execute the test suite (phpunit --version) - -Submitting bugs and feature requests ------------------------------------- - -Bugs and feature request are tracked on [GitHub](https://github.com/Seldaek/monolog/issues) - -Author ------- - -Jordi Boggiano - -
-See also the list of [contributors](https://github.com/Seldaek/monolog/contributors) which participated in this project. - -License -------- - -Monolog is licensed under the MIT License - see the LICENSE file for details - -Acknowledgements ----------------- - -This library is heavily inspired by Python's [Logbook](http://packages.python.org/Logbook/) -library, although most concepts have been adjusted to fit to the PHP world. diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/.gitignore b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/.gitignore deleted file mode 100644 index aba4f4e..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -vendor -composer.phar -phpunit.xml -composer.lock diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/.travis.yml b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/.travis.yml deleted file mode 100644 index eb35049..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: php - -php: - - 5.3 - - 5.4 - -before_script: - - curl -s http://getcomposer.org/installer | php - - php composer.phar install --dev - -script: phpunit diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/CHANGELOG.mdown b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/CHANGELOG.mdown deleted file mode 100644 index ddaa16e..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/CHANGELOG.mdown +++ /dev/null @@ -1,38 +0,0 @@ -* 1.1.0 (2012-04-23) - - Changes: - - * Added Monolog\Logger::isHandling() to check if a handler will - handle the given log level - * Added ChromePHPHandler - * Added MongoDBHandler - * Added GelfHandler (for use with Graylog2 servers) - * Added SocketHandler (for use with syslog-ng for example) - * Added NormalizerFormatter - * Added the possibility to change the activation strategy of the FingersCrossedHandler - * Added possibility to show microseconds in logs - * Added `server` and `referer` to WebProcessor output - -* 1.0.2 (2011-10-24) - - Changes: - - * Fixed bug in IE with large response headers and FirePHPHandler - -* 1.0.1 (2011-08-25) - - Changes: - - * Added MemoryPeakUsageProcessor and MemoryUsageProcessor - * Added Monolog\Logger::getName() to get a logger's channel name - -* 1.0.0 (2011-07-06) - - Changes: - - * Added IntrospectionProcessor to get info from where the logger was called - * Fixed WebProcessor in CLI - -* 1.0.0-RC1 (2011-07-01) - - * Initial release diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/LICENSE b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/LICENSE deleted file mode 100644 index 5df1c39..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/README.mdown b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/README.mdown deleted file mode 100644 index 786aac1..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/README.mdown +++ /dev/null @@ -1,172 +0,0 @@ -Monolog - Logging for PHP 5.3 -============================= - -[![Build Status](https://secure.travis-ci.org/Seldaek/monolog.png)](http://travis-ci.org/Seldaek/monolog) - -Usage ------ - - use Monolog\Logger; - use Monolog\Handler\StreamHandler; - - // create a log channel - $log = new Logger('name'); - $log->pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING)); - - // add records to the log - $log->addWarning('Foo'); - $log->addError('Bar'); - -Core Concepts -------------- - -Every Logger instance has a channel (name) and a stack of handlers. Whenever -you add a record to the logger, it traverses the handler stack. Each handler -decides whether it handled fully the record, and if so, the propagation of the -record ends there. - -This allow for flexible logging setups, for example having a FileHandler at -the bottom of the stack that will log anything to disk, and on top of that add -a MailHandler that will send emails only when an error message is logged. -Handlers also have a bubbling property which define whether they block the -record or not if they handled it. In this example, setting the MailHandler's -$bubble argument to true means that all records will propagate to the -FileHandler, even the errors that are handled by the MailHandler. - -You can create many Loggers, each defining a channel (e.g.: db, request, -router, ..) and each of them combining various handlers, which can be shared -or not. The channel is reflected in the logs and allows you to easily see or -filter records. - -Each Handler also has a Formatter, a default one with settings that make sense -will be created if you don't set one. The formatters normalize and format -incoming records so that they can be used by the handlers to output useful -information. - -Custom severity levels are not available. Only six levels (debug, info, -warning, error, critical, alert) are present for basic filtering purposes, but -for sorting and other use cases that would require flexibility, you should add -Processors to the Logger that can add extra information (tags, user ip, ..) to -the records before they are handled. - -Log Levels ----------- - -Monolog exposes 6 log levels. Although it is possible to add more by extending -the classes you need, these are generally enough. - -- **DEBUG** (100): Detailed debug information. - -- **INFO** (200): Interesting events. Examples: User logs in, SQL logs. - -- **WARNING** (300): Exceptional occurrences that are not errors. Examples: - Use of deprecated APIs, poor use of an API, undesirable things that are not - necessarily wrong. - -- **ERROR** (400): Runtime errors that do not require immediate action but - should typically be logged and monitored. - -- **CRITICAL** (500): Critical conditions. Example: Application component - unavailable, unexpected exception. - -- **ALERT** (550): Action must be taken immediately. Example: Entire website - down, database unavailable, etc. This should trigger the SMS alerts and wake - you up. - -Docs -==== - -**See the doc/ directory for more detailed documentation. The following is only a list of all parts that come with Monolog.** - -Handlers --------- - -- _StreamHandler_: Logs records into any php stream, use this for log files. -- _RotatingFileHandler_: Logs records to a file and creates one logfile per day. - It will also delete files older than $maxFiles. You should use - [logrotate](http://linuxcommand.org/man_pages/logrotate8.html) for high profile - setups though, this is just meant as a quick and dirty solution. -- _FirePHPHandler_: Handler for [FirePHP](http://www.firephp.org/), providing - inline `console` messages within [FireBug](http://getfirebug.com/). -- _ChromePHPHandler_: Handler for [ChromePHP](http://www.chromephp.com/), providing - inline `console` messages within Chrome. -- _MongoDBHandler_: Handler to write records in MongoDB via a - [Mongo](http://pecl.php.net/package/mongo) extension connection. -- _NativeMailHandler_: Sends emails using PHP's mail() function. -- _SwiftMailerHandler_: Sends emails using a SwiftMailer instance. -- _SyslogHandler_: Logs records to the syslog. -- _GelfHandler_: Logs records to a [Graylog2](http://www.graylog2.org) server. -- _SocketHandler_: Logs records to [sockets](http://php.net/fsockopen), use this - for UNIX and TCP sockets. See an [example](https://github.com/Seldaek/monolog/blob/master/doc/sockets.md). - -Wrappers / Special Handlers ---------------------------- - -- _FingersCrossedHandler_: A very interesting wrapper. It takes a logger as - parameter and will accumulate log records of all levels until a record - exceeds the defined severity level. At which point it delivers all records, - including those of lower severity, to the handler it wraps. This means that - until an error actually happens you will not see anything in your logs, but - when it happens you will have the full information, including debug and info - records. This provides you with all the information you need, but only when - you need it. -- _NullHandler_: Any record it can handle will be thrown away. This can be used - to put on top of an existing handler stack to disable it temporarily. -- _BufferHandler_: This handler will buffer all the log records it receives - until close() is called at which point it will call handleBatch() on the - handler it wraps with all the log messages at once. This is very useful to - send an email with all records at once for example instead of having one mail - for every log record. -- _GroupHandler_: This handler groups other handlers. Every record received is - sent to all the handlers it is configured with. -- _TestHandler_: Used for testing, it records everything that is sent to it and - has accessors to read out the information. - -Formatters ----------- - -- _LineFormatter_: Formats a log record into a one-line string. -- _NormalizerFormatter_: Normalizes objects/resources down to strings so a record can easily be serialized/encoded. -- _JsonFormatter_: Encodes a log record into json. -- _WildfireFormatter_: Used to format log records into the Wildfire/FirePHP protocol, only useful for the FirePHPHandler. -- _ChromePHPFormatter_: Used to format log records into the ChromePHP format, only useful for the ChromePHPHandler. -- _GelfFormatter_: Used to format log records into Gelf message instances, only useful for the GelfHandler. - -Processors ----------- - -- _IntrospectionProcessor_: Adds the line/file/class/method from which the log call originated. -- _WebProcessor_: Adds the current request URI, request method and client IP to a log record. -- _MemoryUsageProcessor_: Adds the current memory usage to a log record. -- _MemoryPeakUsageProcessor_: Adds the peak memory usage to a log record. - -About -===== - -Requirements ------------- - -- Any flavor of PHP 5.3 should do -- [optional] PHPUnit 3.5+ to execute the test suite (phpunit --version) - -Submitting bugs and feature requests ------------------------------------- - -Bugs and feature request are tracked on [GitHub](https://github.com/Seldaek/monolog/issues) - -Author ------- - -Jordi Boggiano - -
-See also the list of [contributors](https://github.com/Seldaek/monolog/contributors) which participated in this project. - -License -------- - -Monolog is licensed under the MIT License - see the LICENSE file for details - -Acknowledgements ----------------- - -This library is heavily inspired by Python's [Logbook](http://packages.python.org/Logbook/) -library, although most concepts have been adjusted to fit to the PHP world. diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/composer.json b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/composer.json deleted file mode 100644 index c8c28b0..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/composer.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "monolog/monolog", - "description": "Logging for PHP 5.3", - "keywords": ["log","logging"], - "homepage": "http://github.com/Seldaek/monolog", - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "mlehner/gelf-php": "1.0.*" - }, - "suggest": { - "mlehner/gelf-php": "Allow sending log messages to a GrayLog2 server" - }, - "autoload": { - "psr-0": {"Monolog": "src/"} - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/doc/extending.md b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/doc/extending.md deleted file mode 100644 index fcd7af2..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/doc/extending.md +++ /dev/null @@ -1,76 +0,0 @@ -Extending Monolog -================= - -Monolog is fully extensible, allowing you to adapt your logger to your needs. - -Writing your own handler ------------------------- - -Monolog provides many built-in handlers. But if the one you need does not -exist, you can write it and use it in your logger. The only requirement is -to implement `Monolog\Handler\HandlerInterface`. - -Let's write a PDOHandler to log records to a database. We will extend the -abstract class provided by Monolog to keep things DRY. - -```php -pdo = $pdo; - parent::__construct($level, $bubble); - } - - protected function write(array $record) - { - if (!$this->initialized) { - $this->initialize(); - } - - $this->statement->execute(array( - 'channel' => $record['channel'], - 'level' => $record['level'], - 'message' => $record['formatted'], - 'time' => $record['datetime']->format('U'), - )); - } - - private function initialize() - { - $this->pdo->exec( - 'CREATE TABLE IF NOT EXISTS monolog ' - .'(channel VARCHAR(255), level INTEGER, message LONGTEXT, time INTEGER UNSIGNED)' - ); - $this->statement = $this->pdo->prepare( - 'INSERT INTO monolog (channel, level, message, time) VALUES (:channel, :level, :message, :time)' - ); - - $this->initialized = true; - } -} -``` - -You can now use this handler in your logger: - -```php -pushHandler(new PDOHandler(new PDO('sqlite:logs.sqlite')); - -// You can now use your logger -$logger->addInfo('My logger is now ready'); -``` - -The `Monolog\Handler\AbstractProcessingHandler` class provides most of the -logic needed for the handler, including the use of processors and the formatting -of the record (which is why we use ``$record['formatted']`` instead of ``$record['message']``). diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/doc/sockets.md b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/doc/sockets.md deleted file mode 100644 index fad30a9..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/doc/sockets.md +++ /dev/null @@ -1,37 +0,0 @@ -Sockets Handler -=============== - -This handler allows you to write your logs to sockets using [fsockopen](http://php.net/fsockopen) -or [pfsockopen](http://php.net/pfsockopen). - -Persistent sockets are mainly useful in web environments where you gain some performance not closing/opening -the connections between requests. - -Basic Example -------------- - -```php -setPersistent(true); - -// Now add the handler -$logger->pushHandler($handler, Logger::DEBUG); - -// You can now use your logger -$logger->addInfo('My logger is now ready'); - -``` - -In this example, using syslog-ng, you should see the log on the log server: - - cweb1 [2012-02-26 00:12:03] my_logger.INFO: My logger is now ready [] [] - diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/doc/usage.md b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/doc/usage.md deleted file mode 100644 index a3cfc7f..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/doc/usage.md +++ /dev/null @@ -1,124 +0,0 @@ -Using Monolog -============= - -Installation ------------- - -Monolog is available on Packagist ([monolog/monolog](http://packagist.org/packages/monolog/monolog)) -and as such installable via [Composer](http://getcomposer.org/). - -If you do not use Composer, you can grab the code from GitHub, and use any -PSR-0 compatible autoloader (e.g. the [Symfony2 ClassLoader component](https://github.com/symfony/ClassLoader)) -to load Monolog classes. - -Configuring a logger --------------------- - -Here is a basic setup to log to a file and to firephp on the DEBUG level: - -```php -pushHandler(new StreamHandler(__DIR__.'/my_app.log', Logger::DEBUG)); -$logger->pushHandler(new FirePHPHandler()); - -// You can now use your logger -$logger->addInfo('My logger is now ready'); -``` - -Let's explain it. The first step is to create the logger instance which will -be used in your code. The argument is a channel name, which is useful when -you use several loggers (see below for more details about it). - -The logger itself does not know how to handle a record. It delegates it to -some handlers. The code above registers two handlers in the stack to allow -handling records in two different ways. - -Note that the FirePHPHandler is called first as it is added on top of the -stack. This allows you to temporarily add a logger with bubbling disabled if -you want to override other configured loggers. - -Adding extra data in the records --------------------------------- - -Monolog provides two different ways to add extra informations along the simple -textual message. - -### Using the logging context - -The first way is the context, allowing to pass an array of data along the -record: - -```php -addInfo('Adding a new user', array('username' => 'Seldaek')); -``` - -Simple handlers (like the StreamHandler for instance) will simply format -the array to a string but richer handlers can take advantage of the context -(FirePHP is able to display arrays in pretty way for instance). - -### Using processors - -The second way is to add extra data for all records by using a processor. -Processors can be any callable. They will get the record as parameter and -must return it after having eventually changed the `extra` part of it. Let's -write a processor adding some dummy data in the record: - -```php -pushProcessor(function ($record) { - $record['extra']['dummy'] = 'Hello world!'; - - return $record; -}); -``` - -Monolog provides some built-in processors that can be used in your project. -Look at the README file for the list. - -> Tip: processors can also be registered on a specific handler instead of - the logger to apply only for this handler. - -Leveraging channels -------------------- - -Channels are a great way to identify to which part of the application a record -is related. This is useful in big applications (and is leveraged by -MonologBundle in Symfony2). You can then easily grep through log files for -example to filter this or that type of log record. - -Using different loggers with the same handlers allow to identify the logger -that issued the record (through the channel name) by keeping the same handlers -(for instance to use a single log file). - -```php -pushHandler($stream); -$logger->pushHandler($firephp); - -// Create a logger for the security-related stuff with a different channel -$securityLogger = new Logger('security'); -$securityLogger->pushHandler($stream); -$securityLogger->pushHandler($firephp); -``` diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/phpunit.xml.dist b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/phpunit.xml.dist deleted file mode 100644 index 1754570..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/phpunit.xml.dist +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - tests/Monolog/ - - - - - - src/Monolog/ - - - diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/ChromePHPFormatter.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/ChromePHPFormatter.php deleted file mode 100644 index 44335b5..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/ChromePHPFormatter.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -/** - * Formats a log message according to the ChromePHP array format - * - * @author Christophe Coevoet - */ -class ChromePHPFormatter implements FormatterInterface -{ - /** - * Translates Monolog log levels to Wildfire levels. - */ - private $logLevels = array( - Logger::DEBUG => 'log', - Logger::INFO => 'info', - Logger::WARNING => 'warn', - Logger::ERROR => 'error', - Logger::CRITICAL => 'error', - Logger::ALERT => 'error', - ); - - /** - * {@inheritdoc} - */ - public function format(array $record) - { - // Retrieve the line and file if set and remove them from the formatted extra - $backtrace = 'unknown'; - if (isset($record['extra']['file']) && isset($record['extra']['line'])) { - $backtrace = $record['extra']['file'].' : '.$record['extra']['line']; - unset($record['extra']['file']); - unset($record['extra']['line']); - } - - $message = array('message' => $record['message']); - if ($record['context']) { - $message['context'] = $record['context']; - } - if ($record['extra']) { - $message['extra'] = $record['extra']; - } - if (count($message) === 1) { - $message = reset($message); - } - - return array( - $record['channel'], - $message, - $backtrace, - $this->logLevels[$record['level']], - ); - } - - public function formatBatch(array $records) - { - $formatted = array(); - - foreach ($records as $record) { - $formatted[] = $this->format($record); - } - - return $formatted; - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/FormatterInterface.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/FormatterInterface.php deleted file mode 100644 index 77891de..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/FormatterInterface.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -/** - * Interface for formatters - * - * @author Jordi Boggiano - */ -interface FormatterInterface -{ - /** - * Formats a log record. - * - * @param array $record A record to format - * @return mixed The formatted record - */ - function format(array $record); - - /** - * Formats a set of log records. - * - * @param array $records A set of records to format - * @return mixed The formatted set of records - */ - function formatBatch(array $records); -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/GelfMessageFormatter.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/GelfMessageFormatter.php deleted file mode 100644 index 95c17ad..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/GelfMessageFormatter.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; -use Gelf\Message; - -/** - * Serializes a log message according to Wildfire's header requirements - * - * @author Matt Lehner - */ -class GelfMessageFormatter extends NormalizerFormatter -{ - /** - * @var string the name of the system for the Gelf log message - */ - protected $systemName; - - /** - * @var string a prefix for 'extra' fields from the Monolog record (optional) - */ - protected $extraPrefix; - - /** - * @var string a prefix for 'context' fields from the Monolog record (optional) - */ - protected $contextPrefix; - - /** - * Translates Monolog log levels to Graylog2 log priorities. - */ - private $logLevels = array( - Logger::DEBUG => LOG_DEBUG, - Logger::INFO => LOG_INFO, - Logger::WARNING => LOG_WARNING, - Logger::ERROR => LOG_ERR, - Logger::CRITICAL => LOG_CRIT, - Logger::ALERT => LOG_ALERT, - ); - - public function __construct($systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_') - { - parent::__construct('U.u'); - - $this->systemName = $systemName ?: gethostname(); - - $this->extraPrefix = $extraPrefix; - $this->contextPrefix = $contextPrefix; - } - - /** - * {@inheritdoc} - */ - public function format(array $record) - { - $record = parent::format($record); - $message = new Message(); - $message - ->setTimestamp($record['datetime']) - ->setShortMessage((string) $record['message']) - ->setFacility($record['channel']) - ->setHost($this->systemName) - ->setLine(isset($record['extra']['line']) ? $record['extra']['line'] : null) - ->setFile(isset($record['extra']['file']) ? $record['extra']['file'] : null) - ->setLevel($this->logLevels[$record['level']]); - - // Do not duplicate these values in the additional fields - unset($record['extra']['line']); - unset($record['extra']['file']); - - foreach ($record['extra'] as $key => $val) { - $message->setAdditional($this->extraPrefix . $key, is_scalar($val) ? $val : $this->toJson($val)); - } - - foreach ($record['context'] as $key => $val) { - $message->setAdditional($this->contextPrefix . $key, is_scalar($val) ? $val : $this->toJson($val)); - } - - return $message; - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/JsonFormatter.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/JsonFormatter.php deleted file mode 100644 index ab20179..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/JsonFormatter.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -/** - * Encodes whatever record data is passed to it as json - * - * This can be useful to log to databases or remote APIs - * - * @author Jordi Boggiano - */ -class JsonFormatter implements FormatterInterface -{ - /** - * {@inheritdoc} - */ - public function format(array $record) - { - return json_encode($record); - } - - /** - * {@inheritdoc} - */ - public function formatBatch(array $records) - { - return json_encode($records); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/LineFormatter.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/LineFormatter.php deleted file mode 100644 index 61d3b8c..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/LineFormatter.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -/** - * Formats incoming records into a one-line string - * - * This is especially useful for logging to files - * - * @author Jordi Boggiano - * @author Christophe Coevoet - */ -class LineFormatter extends NormalizerFormatter -{ - const SIMPLE_FORMAT = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"; - - protected $format; - - /** - * @param string $format The format of the message - * @param string $dateFormat The format of the timestamp: one supported by DateTime::format - */ - public function __construct($format = null, $dateFormat = null) - { - $this->format = $format ?: static::SIMPLE_FORMAT; - parent::__construct($dateFormat); - } - - /** - * {@inheritdoc} - */ - public function format(array $record) - { - $vars = parent::format($record); - - $output = $this->format; - foreach ($vars['extra'] as $var => $val) { - if (false !== strpos($output, '%extra.'.$var.'%')) { - $output = str_replace('%extra.'.$var.'%', $this->convertToString($val), $output); - unset($vars['extra'][$var]); - } - } - foreach ($vars as $var => $val) { - $output = str_replace('%'.$var.'%', $this->convertToString($val), $output); - } - - return $output; - } - - public function formatBatch(array $records) - { - $message = ''; - foreach ($records as $record) { - $message .= $this->format($record); - } - - return $message; - } - - protected function normalize($data) - { - if (is_bool($data) || is_null($data)) { - return var_export($data, true); - } - - return parent::normalize($data); - } - - protected function convertToString($data) - { - if (null === $data || is_scalar($data)) { - return (string) $data; - } - - if (version_compare(PHP_VERSION, '5.4.0', '>=')) { - return json_encode($this->normalize($data), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); - } - - return stripslashes(json_encode($this->normalize($data))); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/NormalizerFormatter.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/NormalizerFormatter.php deleted file mode 100644 index 09cadb7..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/NormalizerFormatter.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -/** - * Normalizes incoming records to remove objects/resources so it's easier to dump to various targets - * - * @author Jordi Boggiano - */ -class NormalizerFormatter implements FormatterInterface -{ - const SIMPLE_DATE = "Y-m-d H:i:s"; - - protected $dateFormat; - - /** - * @param string $dateFormat The format of the timestamp: one supported by DateTime::format - */ - public function __construct($dateFormat = null) - { - $this->dateFormat = $dateFormat ?: static::SIMPLE_DATE; - } - - /** - * {@inheritdoc} - */ - public function format(array $record) - { - return $this->normalize($record); - } - - /** - * {@inheritdoc} - */ - public function formatBatch(array $records) - { - foreach ($records as $key => $record) { - $records[$key] = $this->format($record); - } - - return $records; - } - - protected function normalize($data) - { - if (null === $data || is_scalar($data)) { - return $data; - } - - if (is_array($data) || $data instanceof \Traversable) { - $normalized = array(); - - foreach ($data as $key => $value) { - $normalized[$key] = $this->normalize($value); - } - - return $normalized; - } - - if ($data instanceof \DateTime) { - return $data->format($this->dateFormat); - } - - if (is_resource($data)) { - return '[resource]'; - } - - return sprintf("[object] (%s: %s)", get_class($data), $this->toJson($data)); - } - - protected function toJson($data) - { - if (version_compare(PHP_VERSION, '5.4.0', '>=')) { - return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); - } - - return json_encode($data); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/WildfireFormatter.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/WildfireFormatter.php deleted file mode 100644 index 4c393a9..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Formatter/WildfireFormatter.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -/** - * Serializes a log message according to Wildfire's header requirements - * - * @author Eric Clemmons (@ericclemmons) - * @author Christophe Coevoet - * @author Kirill chEbba Chebunin - */ -class WildfireFormatter implements FormatterInterface -{ - /** - * Translates Monolog log levels to Wildfire levels. - */ - private $logLevels = array( - Logger::DEBUG => 'LOG', - Logger::INFO => 'INFO', - Logger::WARNING => 'WARN', - Logger::ERROR => 'ERROR', - Logger::CRITICAL => 'ERROR', - Logger::ALERT => 'ERROR', - ); - - /** - * {@inheritdoc} - */ - public function format(array $record) - { - // Retrieve the line and file if set and remove them from the formatted extra - $file = $line = ''; - if (isset($record['extra']['file'])) { - $file = $record['extra']['file']; - unset($record['extra']['file']); - } - if (isset($record['extra']['line'])) { - $line = $record['extra']['line']; - unset($record['extra']['line']); - } - - $message = array('message' => $record['message']); - if ($record['context']) { - $message['context'] = $record['context']; - } - if ($record['extra']) { - $message['extra'] = $record['extra']; - } - if (count($message) === 1) { - $message = reset($message); - } - - // Create JSON object describing the appearance of the message in the console - $json = json_encode(array( - array( - 'Type' => $this->logLevels[$record['level']], - 'File' => $file, - 'Line' => $line, - 'Label' => $record['channel'], - ), - $message, - )); - - // The message itself is a serialization of the above JSON object + it's length - return sprintf( - '%s|%s|', - strlen($json), - $json - ); - } - - public function formatBatch(array $records) - { - throw new \BadMethodCallException('Batch formatting does not make sense for the WildfireFormatter'); - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/AbstractHandler.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/AbstractHandler.php deleted file mode 100644 index 1349c25..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/AbstractHandler.php +++ /dev/null @@ -1,173 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\LineFormatter; - -/** - * Base Handler class providing the Handler structure - * - * @author Jordi Boggiano - */ -abstract class AbstractHandler implements HandlerInterface -{ - protected $level = Logger::DEBUG; - protected $bubble = false; - - /** - * @var FormatterInterface - */ - protected $formatter; - protected $processors = array(); - - /** - * @param integer $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($level = Logger::DEBUG, $bubble = true) - { - $this->level = $level; - $this->bubble = $bubble; - } - - /** - * {@inheritdoc} - */ - public function isHandling(array $record) - { - return $record['level'] >= $this->level; - } - - /** - * {@inheritdoc} - */ - public function handleBatch(array $records) - { - foreach ($records as $record) { - $this->handle($record); - } - } - - /** - * Closes the handler. - * - * This will be called automatically when the object is destroyed - */ - public function close() - { - } - - /** - * {@inheritdoc} - */ - public function pushProcessor($callback) - { - if (!is_callable($callback)) { - throw new \InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given'); - } - array_unshift($this->processors, $callback); - } - - /** - * {@inheritdoc} - */ - public function popProcessor() - { - if (!$this->processors) { - throw new \LogicException('You tried to pop from an empty processor stack.'); - } - return array_shift($this->processors); - } - - /** - * {@inheritdoc} - */ - public function setFormatter(FormatterInterface $formatter) - { - $this->formatter = $formatter; - } - - /** - * {@inheritdoc} - */ - public function getFormatter() - { - if (!$this->formatter) { - $this->formatter = $this->getDefaultFormatter(); - } - - return $this->formatter; - } - - /** - * Sets minimum logging level at which this handler will be triggered. - * - * @param integer $level - */ - public function setLevel($level) - { - $this->level = $level; - } - - /** - * Gets minimum logging level at which this handler will be triggered. - * - * @return integer - */ - public function getLevel() - { - return $this->level; - } - - /** - * Sets the bubbling behavior. - * - * @param Boolean $bubble True means that bubbling is not permitted. - * False means that this handler allows bubbling. - */ - public function setBubble($bubble) - { - $this->bubble = $bubble; - } - - /** - * Gets the bubbling behavior. - * - * @return Boolean True means that bubbling is not permitted. - * False means that this handler allows bubbling. - */ - public function getBubble() - { - return $this->bubble; - } - - public function __destruct() - { - try { - $this->close(); - } catch(\Exception $e) { - // do nothing - } - } - - /** - * Gets the default formatter. - * - * @return FormatterInterface - */ - protected function getDefaultFormatter() - { - return new LineFormatter(); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/AbstractProcessingHandler.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/AbstractProcessingHandler.php deleted file mode 100644 index 9babe03..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/AbstractProcessingHandler.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\LineFormatter; - -/** - * Base Handler class providing the Handler structure - * - * Classes extending it should (in most cases) only implement write($record) - * - * @author Jordi Boggiano - * @author Christophe Coevoet - */ -abstract class AbstractProcessingHandler extends AbstractHandler -{ - /** - * {@inheritdoc} - */ - public function handle(array $record) - { - if ($record['level'] < $this->level) { - return false; - } - - $record = $this->processRecord($record); - - $record['formatted'] = $this->getFormatter()->format($record); - - $this->write($record); - - return false === $this->bubble; - } - - /** - * Writes the record down to the log of the implementing handler - * - * @param array $record - * @return void - */ - abstract protected function write(array $record); - - /** - * Processes a record. - * - * @param array $record - * @return array - */ - protected function processRecord(array $record) - { - if ($this->processors) { - foreach ($this->processors as $processor) { - $record = call_user_func($processor, $record); - } - } - - return $record; - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/BufferHandler.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/BufferHandler.php deleted file mode 100644 index 7031607..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/BufferHandler.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Buffers all records until closing the handler and then pass them as batch. - * - * This is useful for a MailHandler to send only one mail per request instead of - * sending one per log message. - * - * @author Christophe Coevoet - */ -class BufferHandler extends AbstractHandler -{ - protected $handler; - protected $bufferSize; - protected $buffer = array(); - - /** - * @param HandlerInterface $handler Handler. - * @param integer $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. - * @param integer $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct(HandlerInterface $handler, $bufferSize = 0, $level = Logger::DEBUG, $bubble = true) - { - parent::__construct($level, $bubble); - $this->handler = $handler; - $this->bufferSize = $bufferSize; - } - - /** - * {@inheritdoc} - */ - public function handle(array $record) - { - if ($record['level'] < $this->level) { - return false; - } - - $this->buffer[] = $record; - if ($this->bufferSize > 0 && count($this->buffer) > $this->bufferSize) { - array_shift($this->buffer); - } - - return false === $this->bubble; - } - - /** - * {@inheritdoc} - */ - public function close() - { - $this->handler->handleBatch($this->buffer); - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/ChromePHPHandler.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/ChromePHPHandler.php deleted file mode 100644 index 4d7ae8c..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/ChromePHPHandler.php +++ /dev/null @@ -1,127 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\ChromePHPFormatter; - -/** - * Handler sending logs to the ChromePHP extension (http://www.chromephp.com/) - * - * @author Christophe Coevoet - */ -class ChromePHPHandler extends AbstractProcessingHandler -{ - /** - * Version of the extension - */ - const VERSION = '3.0'; - - /** - * Header name - */ - const HEADER_NAME = 'X-ChromePhp-Data'; - - static protected $initialized = false; - - static protected $json = array( - 'version' => self::VERSION, - 'columns' => array('label', 'log', 'backtrace', 'type'), - 'rows' => array(), - ); - - protected $sendHeaders = true; - - /** - * {@inheritdoc} - */ - public function handleBatch(array $records) - { - $messages = array(); - - foreach ($records as $record) { - if ($record['level'] < $this->level) { - continue; - } - $messages[] = $this->processRecord($record); - } - - if (!empty($messages)) { - $messages = $this->getFormatter()->formatBatch($messages); - self::$json['rows'] = array_merge(self::$json['rows'], $messages); - $this->send(); - } - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter() - { - return new ChromePHPFormatter(); - } - - /** - * Creates & sends header for a record - * - * @see sendHeader() - * @see send() - * @param array $record - */ - protected function write(array $record) - { - self::$json['rows'][] = $record['formatted']; - - $this->send(); - } - - /** - * Sends the log header - * - * @see sendHeader() - */ - protected function send() - { - if (!self::$initialized) { - $this->sendHeaders = $this->headersAccepted(); - self::$json['request_uri'] = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; - - self::$initialized = true; - } - - $this->sendHeader(self::HEADER_NAME, base64_encode(utf8_encode(json_encode(self::$json)))); - } - - /** - * Send header string to the client - * - * @param string $header - * @param string $content - */ - protected function sendHeader($header, $content) - { - if (!headers_sent() && $this->sendHeaders) { - header(sprintf('%s: %s', $header, $content)); - } - } - - /** - * Verifies if the headers are accepted by the current user agent - * - * @return Boolean - */ - protected function headersAccepted() - { - return !isset($_SERVER['HTTP_USER_AGENT']) - || preg_match('{\bChrome/\d+[\.\d+]*\b}', $_SERVER['HTTP_USER_AGENT']); - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php deleted file mode 100644 index 54b9a8d..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler\FingersCrossed; - -/** - * Interface for activation strategies for the FingersCrossedHandler. - * - * @author Johannes M. Schmitt - */ -interface ActivationStrategyInterface -{ - /** - * Returns whether the given record activates the handler. - * - * @param array $record - * @return Boolean - */ - function isHandlerActivated(array $record); -} \ No newline at end of file diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php deleted file mode 100644 index 2cfe6dd..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler\FingersCrossed; - -/** - * Error level based activation strategy. - * - * @author Johannes M. Schmitt - */ -class ErrorLevelActivationStrategy implements ActivationStrategyInterface -{ - private $actionLevel; - - public function __construct($actionLevel) - { - $this->actionLevel = $actionLevel; - } - - public function isHandlerActivated(array $record) - { - return $record['level'] >= $this->actionLevel; - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/FingersCrossedHandler.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/FingersCrossedHandler.php deleted file mode 100644 index 3731fa8..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/FingersCrossedHandler.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy; -use Monolog\Handler\FingersCrossed\ActivationStrategyInterface; -use Monolog\Logger; - -/** - * Buffers all records until a certain level is reached - * - * The advantage of this approach is that you don't get any clutter in your log files. - * Only requests which actually trigger an error (or whatever your actionLevel is) will be - * in the logs, but they will contain all records, not only those above the level threshold. - * - * @author Jordi Boggiano - */ -class FingersCrossedHandler extends AbstractHandler -{ - protected $handler; - protected $activationStrategy; - protected $buffering = true; - protected $bufferSize; - protected $buffer = array(); - protected $stopBuffering; - - /** - * @param callback|HandlerInterface $handler Handler or factory callback($record, $fingersCrossedHandler). - * @param int|ActivationStrategyInterface $activationStrategy Strategy which determines when this handler takes action - * @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - * @param Boolean $stopBuffering Whether the handler should stop buffering after being triggered (default true) - */ - public function __construct($handler, $activationStrategy = null, $bufferSize = 0, $bubble = true, $stopBuffering = true) - { - if (null === $activationStrategy) { - $activationStrategy = new ErrorLevelActivationStrategy(Logger::WARNING); - } - if (!$activationStrategy instanceof ActivationStrategyInterface) { - $activationStrategy = new ErrorLevelActivationStrategy($activationStrategy); - } - - $this->handler = $handler; - $this->activationStrategy = $activationStrategy; - $this->bufferSize = $bufferSize; - $this->bubble = $bubble; - $this->stopBuffering = $stopBuffering; - } - - /** - * {@inheritdoc} - */ - public function isHandling(array $record) - { - return true; - } - - /** - * {@inheritdoc} - */ - public function handle(array $record) - { - if ($this->buffering) { - $this->buffer[] = $record; - if ($this->bufferSize > 0 && count($this->buffer) > $this->bufferSize) { - array_shift($this->buffer); - } - if ($this->activationStrategy->isHandlerActivated($record)) { - if ($this->stopBuffering) { - $this->buffering = false; - } - if (!$this->handler instanceof HandlerInterface) { - $this->handler = call_user_func($this->handler, $record, $this); - } - if (!$this->handler instanceof HandlerInterface) { - throw new \RuntimeException("The factory callback should return a HandlerInterface"); - } - $this->handler->handleBatch($this->buffer); - $this->buffer = array(); - } - } else { - $this->handler->handle($record); - } - - return false === $this->bubble; - } - - /** - * Resets the state of the handler. Stops forwarding records to the wrapped handler. - */ - public function reset() - { - $this->buffering = true; - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/FirePHPHandler.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/FirePHPHandler.php deleted file mode 100644 index 8cc10e9..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/FirePHPHandler.php +++ /dev/null @@ -1,161 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\WildfireFormatter; - -/** - * Simple FirePHP Handler (http://www.firephp.org/), which uses the Wildfire protocol. - * - * @author Eric Clemmons (@ericclemmons) - */ -class FirePHPHandler extends AbstractProcessingHandler -{ - /** - * WildFire JSON header message format - */ - const PROTOCOL_URI = 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2'; - - /** - * FirePHP structure for parsing messages & their presentation - */ - const STRUCTURE_URI = 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1'; - - /** - * Must reference a "known" plugin, otherwise headers won't display in FirePHP - */ - const PLUGIN_URI = 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3'; - - /** - * Header prefix for Wildfire to recognize & parse headers - */ - const HEADER_PREFIX = 'X-Wf'; - - /** - * Whether or not Wildfire vendor-specific headers have been generated & sent yet - */ - protected static $initialized = false; - - /** - * Shared static message index between potentially multiple handlers - * @var int - */ - protected static $messageIndex = 1; - - protected $sendHeaders = true; - - /** - * Base header creation function used by init headers & record headers - * - * @param array $meta Wildfire Plugin, Protocol & Structure Indexes - * @param string $message Log message - * @return array Complete header string ready for the client as key and message as value - */ - protected function createHeader(array $meta, $message) - { - $header = sprintf('%s-%s', self::HEADER_PREFIX, join('-', $meta)); - - return array($header => $message); - } - - /** - * Creates message header from record - * - * @see createHeader() - * @param array $record - * @return string - */ - protected function createRecordHeader(array $record) - { - // Wildfire is extensible to support multiple protocols & plugins in a single request, - // but we're not taking advantage of that (yet), so we're using "1" for simplicity's sake. - return $this->createHeader( - array(1, 1, 1, self::$messageIndex++), - $record['formatted'] - ); - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter() - { - return new WildfireFormatter(); - } - - /** - * Wildfire initialization headers to enable message parsing - * - * @see createHeader() - * @see sendHeader() - * @return array - */ - protected function getInitHeaders() - { - // Initial payload consists of required headers for Wildfire - return array_merge( - $this->createHeader(array('Protocol', 1), self::PROTOCOL_URI), - $this->createHeader(array(1, 'Structure', 1), self::STRUCTURE_URI), - $this->createHeader(array(1, 'Plugin', 1), self::PLUGIN_URI) - ); - } - - /** - * Send header string to the client - * - * @param string $header - * @param string $content - */ - protected function sendHeader($header, $content) - { - if (!headers_sent() && $this->sendHeaders) { - header(sprintf('%s: %s', $header, $content)); - } - } - - /** - * Creates & sends header for a record, ensuring init headers have been sent prior - * - * @see sendHeader() - * @see sendInitHeaders() - * @param array $record - */ - protected function write(array $record) - { - // WildFire-specific headers must be sent prior to any messages - if (!self::$initialized) { - $this->sendHeaders = $this->headersAccepted(); - - foreach ($this->getInitHeaders() as $header => $content) { - $this->sendHeader($header, $content); - } - - self::$initialized = true; - } - - $header = $this->createRecordHeader($record); - $this->sendHeader(key($header), current($header)); - } - - /** - * Verifies if the headers are accepted by the current user agent - * - * @return Boolean - */ - protected function headersAccepted() - { - return !isset($_SERVER['HTTP_USER_AGENT']) - || preg_match('{\bFirePHP/\d+\.\d+\b}', $_SERVER['HTTP_USER_AGENT']) - || isset($_SERVER['HTTP_X_FIREPHP_VERSION']); - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/GelfHandler.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/GelfHandler.php deleted file mode 100644 index 7346029..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/GelfHandler.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Gelf\IMessagePublisher; -use Monolog\Logger; -use Monolog\Handler\AbstractProcessingHandler; -use Monolog\Formatter\GelfMessageFormatter; - -/** - * Handler to send messages to a Graylog2 (http://www.graylog2.org) server - * - * @author Matt Lehner - */ -class GelfHandler extends AbstractProcessingHandler -{ - /** - * @var Gelf\IMessagePublisher the publisher object that sends the message to the server - */ - protected $publisher; - - /** - * @param Gelf\IMessagePublisher $publisher a publisher object - * @param integer $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct(IMessagePublisher $publisher, $level = Logger::DEBUG, $bubble = true) - { - parent::__construct($level, $bubble); - - $this->publisher = $publisher; - } - - /** - * {@inheritdoc} - */ - public function close() - { - $this->publisher = null; - } - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - $this->publisher->publish($record['formatted']); - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter() - { - return new GelfMessageFormatter(); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/GroupHandler.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/GroupHandler.php deleted file mode 100644 index c94c52f..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/GroupHandler.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -/** - * Forwards records to multiple handlers - * - * @author Lenar Lõhmus - */ -class GroupHandler extends AbstractHandler -{ - protected $handlers; - - /** - * @param array $handlers Array of Handlers. - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct(array $handlers, $bubble = true) - { - foreach ($handlers as $handler) { - if (!$handler instanceof HandlerInterface) { - throw new \InvalidArgumentException('The first argument of the GroupHandler must be an array of HandlerInterface instances.'); - } - } - - $this->handlers = $handlers; - $this->bubble = $bubble; - } - - /** - * {@inheritdoc} - */ - public function isHandling(array $record) - { - foreach ($this->handlers as $handler) { - if ($handler->isHandling($record)) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function handle(array $record) - { - foreach ($this->handlers as $handler) { - $handler->handle($record); - } - - return false === $this->bubble; - } - - /** - * {@inheritdoc} - */ - public function handleBatch(array $records) - { - foreach ($this->handlers as $handler) { - $handler->handleBatch($records); - } - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/HandlerInterface.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/HandlerInterface.php deleted file mode 100644 index 24f82d7..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/HandlerInterface.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\FormatterInterface; - -/** - * Interface that all Monolog Handlers must implement - * - * @author Jordi Boggiano - */ -interface HandlerInterface -{ - /** - * Checks whether the given record will be handled by this handler. - * - * This is mostly done for performance reasons, to avoid calling processors for nothing. - * - * @return Boolean - */ - function isHandling(array $record); - - /** - * Handles a record. - * - * The return value of this function controls the bubbling process of the handler stack. - * - * @param array $record The record to handle - * @return Boolean True means that this handler handled the record, and that bubbling is not permitted. - * False means the record was either not processed or that this handler allows bubbling. - */ - function handle(array $record); - - /** - * Handles a set of records at once. - * - * @param array $records The records to handle (an array of record arrays) - */ - function handleBatch(array $records); - - /** - * Adds a processor in the stack. - * - * @param callable $callback - */ - function pushProcessor($callback); - - /** - * Removes the processor on top of the stack and returns it. - * - * @return callable - */ - function popProcessor(); - - /** - * Sets the formatter. - * - * @param FormatterInterface $formatter - */ - function setFormatter(FormatterInterface $formatter); - - /** - * Gets the formatter. - * - * @return FormatterInterface - */ - function getFormatter(); -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/MailHandler.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/MailHandler.php deleted file mode 100644 index 94ed841..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/MailHandler.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -/** - * Base class for all mail handlers - * - * @author Gyula Sallai - */ -abstract class MailHandler extends AbstractProcessingHandler -{ - /** - * {@inheritdoc} - */ - public function handleBatch(array $records) - { - $messages = array(); - - foreach ($records as $record) { - if ($record['level'] < $this->level) { - continue; - } - $messages[] = $this->processRecord($record); - } - - if (!empty($messages)) { - $this->send((string) $this->getFormatter()->formatBatch($messages), $messages); - } - } - - /** - * Send a mail with the given content - * - * @param string $content - * @param array $records the array of log records that formed this content - */ - abstract protected function send($content, array $records); - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - $this->send((string) $record['formatted'], array($record)); - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/MongoDBHandler.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/MongoDBHandler.php deleted file mode 100644 index 210bb19..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/MongoDBHandler.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\NormalizerFormatter; - -/** - * Logs to a MongoDB database. - * - * usage example: - * - * $log = new Logger('application'); - * $mongodb = new MongoDBHandler(new \Mongo("mongodb://localhost:27017"), "logs", "prod"); - * $log->pushHandler($mongodb); - * - * @author Thomas Tourlourat - */ -class MongoDBHandler extends AbstractProcessingHandler -{ - private $mongoCollection; - - public function __construct(\Mongo $mongo, $database, $collection, $level = Logger::DEBUG, $bubble = true) - { - $this->mongoCollection = $mongo->selectCollection($database, $collection); - - parent::__construct($level, $bubble); - } - - protected function write(array $record) - { - $this->mongoCollection->save($record["formatted"]); - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter() - { - return new NormalizerFormatter(); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/NativeMailerHandler.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/NativeMailerHandler.php deleted file mode 100644 index 6933ff6..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/NativeMailerHandler.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * NativeMailerHandler uses the mail() function to send the emails - * - * @author Christophe Coevoet - */ -class NativeMailerHandler extends MailHandler -{ - protected $to; - protected $subject; - protected $headers; - - /** - * @param string $to The receiver of the mail - * @param string $subject The subject of the mail - * @param string $from The sender of the mail - * @param integer $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($to, $subject, $from, $level = Logger::ERROR, $bubble = true) - { - parent::__construct($level, $bubble); - $this->to = $to; - $this->subject = $subject; - $this->headers = sprintf("From: %s\r\nContent-type: text/plain; charset=utf-8\r\n", $from); - } - - /** - * {@inheritdoc} - */ - protected function send($content, array $records) - { - mail($this->to, $this->subject, wordwrap($content, 70), $this->headers); - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/NullHandler.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/NullHandler.php deleted file mode 100644 index 7caf4a2..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/NullHandler.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Blackhole - * - * Any record it can handle will be thrown away. This can be used - * to put on top of an existing stack to override it temporarily. - * - * @author Jordi Boggiano - */ -class NullHandler extends AbstractHandler -{ - /** - * @param integer $level The minimum logging level at which this handler will be triggered - */ - public function __construct($level = Logger::DEBUG) - { - parent::__construct($level, false); - } - - /** - * {@inheritdoc} - */ - public function handle(array $record) - { - if ($record['level'] < $this->level) { - return false; - } - - return true; - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/RotatingFileHandler.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/RotatingFileHandler.php deleted file mode 100644 index ebecd56..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/RotatingFileHandler.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Stores logs to files that are rotated every day and a limited number of files are kept. - * - * This rotation is only intended to be used as a workaround. Using logrotate to - * handle the rotation is strongly encouraged when you can use it. - * - * @author Christophe Coevoet - */ -class RotatingFileHandler extends StreamHandler -{ - protected $filename; - protected $maxFiles; - protected $mustRotate; - - /** - * @param string $filename - * @param integer $maxFiles The maximal amount of files to keep (0 means unlimited) - * @param integer $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true) - { - $this->filename = $filename; - $this->maxFiles = (int) $maxFiles; - - $fileInfo = pathinfo($this->filename); - $timedFilename = $fileInfo['dirname'].'/'.$fileInfo['filename'].'-'.date('Y-m-d'); - if (!empty($fileInfo['extension'])) { - $timedFilename .= '.'.$fileInfo['extension']; - } - - // disable rotation upfront if files are unlimited - if (0 === $this->maxFiles) { - $this->mustRotate = false; - } - - parent::__construct($timedFilename, $level, $bubble); - } - - /** - * {@inheritdoc} - */ - public function close() - { - parent::close(); - - if (true === $this->mustRotate) { - $this->rotate(); - } - } - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - // on the first record written, if the log is new, we should rotate (once per day) - if (null === $this->mustRotate) { - $this->mustRotate = !file_exists($this->url); - } - - parent::write($record); - } - - /** - * Rotates the files. - */ - protected function rotate() - { - $fileInfo = pathinfo($this->filename); - $glob = $fileInfo['dirname'].'/'.$fileInfo['filename'].'-*'; - if (!empty($fileInfo['extension'])) { - $glob .= '.'.$fileInfo['extension']; - } - $iterator = new \GlobIterator($glob); - $count = $iterator->count(); - if ($this->maxFiles >= $count) { - // no files to remove - return; - } - - // Sorting the files by name to remove the older ones - $array = iterator_to_array($iterator); - usort($array, function($a, $b) { - return strcmp($b->getFilename(), $a->getFilename()); - }); - - foreach (array_slice($array, $this->maxFiles) as $file) { - if ($file->isWritable()) { - unlink($file->getRealPath()); - } - } - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/SocketHandler.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/SocketHandler.php deleted file mode 100644 index b44fad7..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/SocketHandler.php +++ /dev/null @@ -1,272 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Stores to any socket - uses fsockopen() or pfsockopen(). - * - * @author Pablo de Leon Belloc - * @see http://php.net/manual/en/function.fsockopen.php - */ -class SocketHandler extends AbstractProcessingHandler -{ - private $connectionString; - private $connectionTimeout; - private $resource; - private $timeout = 0; - private $persistent = false; - private $errno; - private $errstr; - - /** - * @param string $connectionString Socket connection string - * @param integer $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($connectionString, $level = Logger::DEBUG, $bubble = true) - { - parent::__construct($level, $bubble); - $this->connectionString = $connectionString; - $this->connectionTimeout = (float) ini_get('default_socket_timeout'); - } - - /** - * Connect (if necessary) and write to the socket - * - * @param array $record - * - * @throws \UnexpectedValueException - * @throws \RuntimeException - */ - public function write(array $record) - { - $this->connectIfNotConnected(); - $this->writeToSocket((string) $record['formatted']); - } - - /** - * We will not close a PersistentSocket instance so it can be reused in other requests. - */ - public function close() - { - if (!$this->isPersistent()) { - $this->closeSocket(); - } - } - - /** - * Close socket, if open - */ - public function closeSocket() - { - if (is_resource($this->resource)) { - fclose($this->resource); - $this->resource = null; - } - } - - /** - * Set socket connection to nbe persistent. It only has effect before the connection is initiated. - * - * @param type $boolean - */ - public function setPersistent($boolean) - { - $this->persistent = (boolean) $boolean; - } - - /** - * Set connection timeout. Only has effect before we connect. - * - * @param integer $seconds - * - * @see http://php.net/manual/en/function.fsockopen.php - */ - public function setConnectionTimeout($seconds) - { - $this->validateTimeout($seconds); - $this->connectionTimeout = (float) $seconds; - } - - /** - * Set write timeout. Only has effect before we connect. - * - * @param type $seconds - * - * @see http://php.net/manual/en/function.stream-set-timeout.php - */ - public function setTimeout($seconds) - { - $this->validateTimeout($seconds); - $this->timeout = (int) $seconds; - } - - /** - * Get current connection string - * - * @return string - */ - public function getConnectionString() - { - return $this->connectionString; - } - - /** - * Get persistent setting - * - * @return boolean - */ - public function isPersistent() - { - return $this->persistent; - } - - /** - * Get current connection timeout setting - * - * @return float - */ - public function getConnectionTimeout() - { - return $this->connectionTimeout; - } - - /** - * Get current in-transfer timeout - * - * @return float - */ - public function getTimeout() - { - return $this->timeout; - } - - /** - * Check to see if the socket is currently available. - * - * UDP might appear to be connected but might fail when writing. See http://php.net/fsockopen for details. - * - * @return boolean - */ - public function isConnected() - { - return is_resource($this->resource) - && !feof($this->resource); // on TCP - other party can close connection. - } - - /** - * Wrapper to allow mocking - */ - protected function pfsockopen() - { - return @pfsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeout); - } - - /** - * Wrapper to allow mocking - */ - protected function fsockopen() - { - return @fsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeout); - } - - /** - * Wrapper to allow mocking - */ - protected function streamSetTimeout() - { - return stream_set_timeout($this->resource, $this->timeout); - } - - /** - * Wrapper to allow mocking - */ - protected function fwrite($data) - { - return @fwrite($this->resource, $data); - } - - /** - * Wrapper to allow mocking - */ - protected function streamGetMetadata() - { - return stream_get_meta_data($this->resource); - } - - private function validateTimeout($value) - { - $ok = filter_var($value, FILTER_VALIDATE_INT, array('options' => array( - 'min_range' => 0, - ))); - if ($ok === false) { - throw new \InvalidArgumentException("Timeout must be 0 or a positive integer (got $value)"); - } - } - - private function connectIfNotConnected() - { - if ($this->isConnected()) { - return; - } - $this->connect(); - } - - private function connect() - { - $this->createSocketResource(); - $this->setSocketTimeout(); - } - - private function createSocketResource() - { - if ($this->isPersistent()) { - $resource = $this->pfsockopen(); - } else { - $resource = $this->fsockopen(); - } - if (!$resource) { - throw new \UnexpectedValueException("Failed connecting to $this->connectionString ($this->errno: $this->errstr)"); - } - $this->resource = $resource; - } - - private function setSocketTimeout() - { - if (!$this->streamSetTimeout()) { - throw new \UnexpectedValueException("Failed setting timeout with stream_set_timeout()"); - } - } - - private function writeToSocket($data) - { - $length = strlen($data); - $sent = 0; - while ($this->isConnected() && $sent < $length) { - $chunk = $this->fwrite(substr($data, $sent)); - if ($chunk === false) { - throw new \RuntimeException("Could not write to socket"); - } - $sent += $chunk; - $socketInfo = $this->streamGetMetadata(); - if ($socketInfo['timed_out']) { - throw new \RuntimeException("Write timed-out"); - } - } - if (!$this->isConnected() && $sent < $length) { - throw new \RuntimeException("End-of-file reached, probably we got disconnected (sent $sent of $length)"); - } - } - -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/StreamHandler.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/StreamHandler.php deleted file mode 100644 index 5593054..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/StreamHandler.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Stores to any stream resource - * - * Can be used to store into php://stderr, remote and local files, etc. - * - * @author Jordi Boggiano - */ -class StreamHandler extends AbstractProcessingHandler -{ - protected $stream; - protected $url; - - /** - * @param string $stream - * @param integer $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($stream, $level = Logger::DEBUG, $bubble = true) - { - parent::__construct($level, $bubble); - if (is_resource($stream)) { - $this->stream = $stream; - } else { - $this->url = $stream; - } - } - - /** - * {@inheritdoc} - */ - public function close() - { - if (is_resource($this->stream)) { - fclose($this->stream); - } - $this->stream = null; - } - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - if (null === $this->stream) { - if (!$this->url) { - throw new \LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().'); - } - $this->stream = @fopen($this->url, 'a'); - if (!is_resource($this->stream)) { - $this->stream = null; - throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened; it may be invalid or not writable.', $this->url)); - } - } - fwrite($this->stream, (string) $record['formatted']); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/SwiftMailerHandler.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/SwiftMailerHandler.php deleted file mode 100644 index addc4c4..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/SwiftMailerHandler.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * SwiftMailerHandler uses Swift_Mailer to send the emails - * - * @author Gyula Sallai - */ -class SwiftMailerHandler extends MailHandler -{ - protected $mailer; - protected $message; - - /** - * @param \Swift_Mailer $mailer The mailer to use - * @param callback|\Swift_Message $message An example message for real messages, only the body will be replaced - * @param integer $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct(\Swift_Mailer $mailer, $message, $level = Logger::ERROR, $bubble = true) - { - parent::__construct($level, $bubble); - $this->mailer = $mailer; - if (!$message instanceof \Swift_Message && is_callable($message)) { - $message = call_user_func($message); - } - if (!$message instanceof \Swift_Message) { - throw new \InvalidArgumentException('You must provide either a Swift_Message instance or a callback returning it'); - } - $this->message = $message; - } - - /** - * {@inheritdoc} - */ - protected function send($content, array $records) - { - $message = clone $this->message; - $message->setBody($content); - - $this->mailer->send($message); - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/SyslogHandler.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/SyslogHandler.php deleted file mode 100644 index 444a592..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/SyslogHandler.php +++ /dev/null @@ -1,108 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Logs to syslog service. - * - * usage example: - * - * $log = new Logger('application'); - * $syslog = new SyslogHandler('myfacility', 'local6'); - * $formatter = new LineFormatter("%channel%.%level_name%: %message% %extra%"); - * $syslog->setFormatter($formatter); - * $log->pushHandler($syslog); - * - * @author Sven Paulus - */ -class SyslogHandler extends AbstractProcessingHandler -{ - /** - * Translates Monolog log levels to syslog log priorities. - */ - private $logLevels = array( - Logger::DEBUG => LOG_DEBUG, - Logger::INFO => LOG_INFO, - Logger::WARNING => LOG_WARNING, - Logger::ERROR => LOG_ERR, - Logger::CRITICAL => LOG_CRIT, - Logger::ALERT => LOG_ALERT, - ); - - /** - * List of valid log facility names. - */ - private $facilities = array( - 'auth' => LOG_AUTH, - 'authpriv' => LOG_AUTHPRIV, - 'cron' => LOG_CRON, - 'daemon' => LOG_DAEMON, - 'kern' => LOG_KERN, - 'lpr' => LOG_LPR, - 'mail' => LOG_MAIL, - 'news' => LOG_NEWS, - 'syslog' => LOG_SYSLOG, - 'user' => LOG_USER, - 'uucp' => LOG_UUCP, - ); - - /** - * @param string $ident - * @param mixed $facility - * @param integer $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($ident, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true) - { - parent::__construct($level, $bubble); - - if (!defined('PHP_WINDOWS_VERSION_BUILD')) { - $this->facilities['local0'] = LOG_LOCAL0; - $this->facilities['local1'] = LOG_LOCAL1; - $this->facilities['local2'] = LOG_LOCAL2; - $this->facilities['local3'] = LOG_LOCAL3; - $this->facilities['local4'] = LOG_LOCAL4; - $this->facilities['local5'] = LOG_LOCAL5; - $this->facilities['local6'] = LOG_LOCAL6; - $this->facilities['local7'] = LOG_LOCAL7; - } - - // convert textual description of facility to syslog constant - if (array_key_exists(strtolower($facility), $this->facilities)) { - $facility = $this->facilities[strtolower($facility)]; - } else if (!in_array($facility, array_values($this->facilities), true)) { - throw new \UnexpectedValueException('Unknown facility value "'.$facility.'" given'); - } - - if (!openlog($ident, LOG_PID, $facility)) { - throw new \LogicException('Can\'t open syslog for ident "'.$ident.'" and facility "'.$facility.'"'); - } - } - - /** - * {@inheritdoc} - */ - public function close() - { - closelog(); - } - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - syslog($this->logLevels[$record['level']], (string) $record['formatted']); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/TestHandler.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/TestHandler.php deleted file mode 100644 index 8f47855..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Handler/TestHandler.php +++ /dev/null @@ -1,120 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Used for testing purposes. - * - * It records all records and gives you access to them for verification. - * - * @author Jordi Boggiano - */ -class TestHandler extends AbstractProcessingHandler -{ - protected $records = array(); - protected $recordsByLevel = array(); - - public function getRecords() - { - return $this->records; - } - - public function hasAlert($record) - { - return $this->hasRecord($record, Logger::ALERT); - } - - public function hasCritical($record) - { - return $this->hasRecord($record, Logger::CRITICAL); - } - - public function hasError($record) - { - return $this->hasRecord($record, Logger::ERROR); - } - - public function hasWarning($record) - { - return $this->hasRecord($record, Logger::WARNING); - } - - public function hasInfo($record) - { - return $this->hasRecord($record, Logger::INFO); - } - - public function hasDebug($record) - { - return $this->hasRecord($record, Logger::DEBUG); - } - - public function hasAlertRecords() - { - return isset($this->recordsByLevel[Logger::ALERT]); - } - - public function hasCriticalRecords() - { - return isset($this->recordsByLevel[Logger::CRITICAL]); - } - - public function hasErrorRecords() - { - return isset($this->recordsByLevel[Logger::ERROR]); - } - - public function hasWarningRecords() - { - return isset($this->recordsByLevel[Logger::WARNING]); - } - - public function hasInfoRecords() - { - return isset($this->recordsByLevel[Logger::INFO]); - } - - public function hasDebugRecords() - { - return isset($this->recordsByLevel[Logger::DEBUG]); - } - - protected function hasRecord($record, $level) - { - if (!isset($this->recordsByLevel[$level])) { - return false; - } - - if (is_array($record)) { - $record = $record['message']; - } - - foreach ($this->recordsByLevel[$level] as $rec) { - if ($rec['message'] === $record) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - $this->recordsByLevel[$record['level']][] = $record; - $this->records[] = $record; - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Logger.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Logger.php deleted file mode 100644 index 91a6ca4..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Logger.php +++ /dev/null @@ -1,421 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -use Monolog\Handler\HandlerInterface; -use Monolog\Handler\StreamHandler; - -/** - * Monolog log channel - * - * It contains a stack of Handlers and a stack of Processors, - * and uses them to store records that are added to it. - * - * @author Jordi Boggiano - */ -class Logger -{ - /** - * Detailed debug information - */ - const DEBUG = 100; - - /** - * Interesting events - * - * Examples: User logs in, SQL logs. - */ - const INFO = 200; - - /** - * Exceptional occurrences that are not errors - * - * Examples: Use of deprecated APIs, poor use of an API, - * undesirable things that are not necessarily wrong. - */ - const WARNING = 300; - - /** - * Runtime errors - */ - const ERROR = 400; - - /** - * Critical conditions - * - * Example: Application component unavailable, unexpected exception. - */ - const CRITICAL = 500; - - /** - * Action must be taken immediately - * - * Example: Entire website down, database unavailable, etc. - * This should trigger the SMS alerts and wake you up. - */ - const ALERT = 550; - - protected static $levels = array( - 100 => 'DEBUG', - 200 => 'INFO', - 300 => 'WARNING', - 400 => 'ERROR', - 500 => 'CRITICAL', - 550 => 'ALERT', - ); - - protected $name; - - /** - * The handler stack - * - * @var array of Monolog\Handler\HandlerInterface - */ - protected $handlers = array(); - - protected $processors = array(); - - /** - * @param string $name The logging channel - */ - public function __construct($name) - { - $this->name = $name; - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Pushes a handler on to the stack. - * - * @param HandlerInterface $handler - */ - public function pushHandler(HandlerInterface $handler) - { - array_unshift($this->handlers, $handler); - } - - /** - * Pops a handler from the stack - * - * @return HandlerInterface - */ - public function popHandler() - { - if (!$this->handlers) { - throw new \LogicException('You tried to pop from an empty handler stack.'); - } - return array_shift($this->handlers); - } - - /** - * Adds a processor on to the stack. - * - * @param callable $callback - */ - public function pushProcessor($callback) - { - if (!is_callable($callback)) { - throw new \InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given'); - } - array_unshift($this->processors, $callback); - } - - /** - * Removes the processor on top of the stack and returns it. - * - * @return callable - */ - public function popProcessor() - { - if (!$this->processors) { - throw new \LogicException('You tried to pop from an empty processor stack.'); - } - return array_shift($this->processors); - } - - /** - * Adds a log record. - * - * @param integer $level The logging level - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function addRecord($level, $message, array $context = array()) - { - if (!$this->handlers) { - $this->pushHandler(new StreamHandler('php://stderr', self::DEBUG)); - } - $record = array( - 'message' => (string) $message, - 'context' => $context, - 'level' => $level, - 'level_name' => self::getLevelName($level), - 'channel' => $this->name, - 'datetime' => \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true))), - 'extra' => array(), - ); - // check if any message will handle this message - $handlerKey = null; - foreach ($this->handlers as $key => $handler) { - if ($handler->isHandling($record)) { - $handlerKey = $key; - break; - } - } - // none found - if (null === $handlerKey) { - return false; - } - // found at least one, process message and dispatch it - foreach ($this->processors as $processor) { - $record = call_user_func($processor, $record); - } - while (isset($this->handlers[$handlerKey]) && - false === $this->handlers[$handlerKey]->handle($record)) { - $handlerKey++; - } - - return true; - } - - /** - * Adds a log record at the DEBUG level. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function addDebug($message, array $context = array()) - { - return $this->addRecord(self::DEBUG, $message, $context); - } - - /** - * Adds a log record at the INFO level. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function addInfo($message, array $context = array()) - { - return $this->addRecord(self::INFO, $message, $context); - } - - /** - * Adds a log record at the WARNING level. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function addWarning($message, array $context = array()) - { - return $this->addRecord(self::WARNING, $message, $context); - } - - /** - * Adds a log record at the ERROR level. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function addError($message, array $context = array()) - { - return $this->addRecord(self::ERROR, $message, $context); - } - - /** - * Adds a log record at the CRITICAL level. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function addCritical($message, array $context = array()) - { - return $this->addRecord(self::CRITICAL, $message, $context); - } - - /** - * Adds a log record at the ALERT level. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function addAlert($message, array $context = array()) - { - return $this->addRecord(self::ALERT, $message, $context); - } - - /** - * Gets the name of the logging level. - * - * @param integer $level - * @return string - */ - public static function getLevelName($level) - { - return self::$levels[$level]; - } - - /** - * Checks whether the Logger has a handler that listens on the given level - * - * @param integer $level - * @return Boolean - */ - public function isHandling($level) - { - $record = array( - 'message' => '', - 'context' => array(), - 'level' => $level, - 'level_name' => self::getLevelName($level), - 'channel' => $this->name, - 'datetime' => new \DateTime(), - 'extra' => array(), - ); - - foreach ($this->handlers as $key => $handler) { - if ($handler->isHandling($record)) { - return true; - } - } - - return false; - } - - // ZF Logger Compat - - /** - * Adds a log record at the DEBUG level. - * - * This method allows to have an easy ZF compatibility. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function debug($message, array $context = array()) - { - return $this->addRecord(self::DEBUG, $message, $context); - } - - /** - * Adds a log record at the INFO level. - * - * This method allows to have an easy ZF compatibility. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function info($message, array $context = array()) - { - return $this->addRecord(self::INFO, $message, $context); - } - - /** - * Adds a log record at the INFO level. - * - * This method allows to have an easy ZF compatibility. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function notice($message, array $context = array()) - { - return $this->addRecord(self::INFO, $message, $context); - } - - /** - * Adds a log record at the WARNING level. - * - * This method allows to have an easy ZF compatibility. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function warn($message, array $context = array()) - { - return $this->addRecord(self::WARNING, $message, $context); - } - - /** - * Adds a log record at the ERROR level. - * - * This method allows to have an easy ZF compatibility. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function err($message, array $context = array()) - { - return $this->addRecord(self::ERROR, $message, $context); - } - - /** - * Adds a log record at the CRITICAL level. - * - * This method allows to have an easy ZF compatibility. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function crit($message, array $context = array()) - { - return $this->addRecord(self::CRITICAL, $message, $context); - } - - /** - * Adds a log record at the ALERT level. - * - * This method allows to have an easy ZF compatibility. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function alert($message, array $context = array()) - { - return $this->addRecord(self::ALERT, $message, $context); - } - - /** - * Adds a log record at the ALERT level. - * - * This method allows to have an easy ZF compatibility. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function emerg($message, array $context = array()) - { - return $this->addRecord(self::ALERT, $message, $context); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Processor/IntrospectionProcessor.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Processor/IntrospectionProcessor.php deleted file mode 100644 index f03e347..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Processor/IntrospectionProcessor.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * Injects line/file:class/function where the log message came from - * - * Warning: This only works if the handler processes the logs directly. - * If you put the processor on a handler that is behind a FingersCrossedHandler - * for example, the processor will only be called once the trigger level is reached, - * and all the log records will have the same file/line/.. data from the call that - * triggered the FingersCrossedHandler. - * - * @author Jordi Boggiano - */ -class IntrospectionProcessor -{ - /** - * @param array $record - * @return array - */ - public function __invoke(array $record) - { - $trace = debug_backtrace(); - - // skip first since it's always the current method - array_shift($trace); - // the call_user_func call is also skipped - array_shift($trace); - - $i = 0; - while (isset($trace[$i]['class']) && false !== strpos($trace[$i]['class'], 'Monolog\\')) { - $i++; - } - - // we should have the call source now - $record['extra'] = array_merge( - $record['extra'], - array( - 'file' => isset($trace[$i-1]['file']) ? $trace[$i-1]['file'] : null, - 'line' => isset($trace[$i-1]['line']) ? $trace[$i-1]['line'] : null, - 'class' => isset($trace[$i]['class']) ? $trace[$i]['class'] : null, - 'function' => isset($trace[$i]['function']) ? $trace[$i]['function'] : null, - ) - ); - - return $record; - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Processor/MemoryPeakUsageProcessor.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Processor/MemoryPeakUsageProcessor.php deleted file mode 100644 index 77e0324..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Processor/MemoryPeakUsageProcessor.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * Injects memory_get_peak_usage in all records - * - * @see Monolog\Processor\MemoryProcessor::__construct() for options - * @author Rob Jensen - */ -class MemoryPeakUsageProcessor extends MemoryProcessor -{ - /** - * @param array $record - * @return array - */ - public function __invoke(array $record) - { - $bytes = memory_get_peak_usage($this->realUsage); - $formatted = self::formatBytes($bytes); - - $record['extra'] = array_merge( - $record['extra'], - array( - 'memory_peak_usage' => $formatted, - ) - ); - - return $record; - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Processor/MemoryProcessor.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Processor/MemoryProcessor.php deleted file mode 100644 index 7a41238..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Processor/MemoryProcessor.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * Some methods that are common for all memory processors - * - * @author Rob Jensen - */ -abstract class MemoryProcessor -{ - protected $realUsage; - - /** - * @param boolean $realUsage - */ - public function __construct($realUsage = true) - { - $this->realUsage = (boolean) $realUsage; - } - - /** - * Formats bytes into a human readable string - * - * @param int $bytes - * @return string - */ - protected static function formatBytes($bytes) - { - $bytes = (int) $bytes; - - if ($bytes > 1024*1024) { - return round($bytes/1024/1024, 2).' MB'; - } elseif ($bytes > 1024) { - return round($bytes/1024, 2).' KB'; - } - - return $bytes . ' B'; - } - -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Processor/MemoryUsageProcessor.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Processor/MemoryUsageProcessor.php deleted file mode 100644 index 0867459..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Processor/MemoryUsageProcessor.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * Injects memory_get_usage in all records - * - * @see Monolog\Processor\MemoryProcessor::__construct() for options - * @author Rob Jensen - */ -class MemoryUsageProcessor extends MemoryProcessor -{ - /** - * @param array $record - * @return array - */ - public function __invoke(array $record) - { - $bytes = memory_get_usage($this->realUsage); - $formatted = self::formatBytes($bytes); - - $record['extra'] = array_merge( - $record['extra'], - array( - 'memory_usage' => $formatted, - ) - ); - - return $record; - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Processor/WebProcessor.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Processor/WebProcessor.php deleted file mode 100644 index 61000a0..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/src/Monolog/Processor/WebProcessor.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * Injects url/method and remote IP of the current web request in all records - * - * @author Jordi Boggiano - */ -class WebProcessor -{ - protected $serverData; - - /** - * @param mixed $serverData array or object w/ ArrayAccess that provides access to the $_SERVER data - */ - public function __construct($serverData = null) - { - if (null === $serverData) { - $this->serverData =& $_SERVER; - } elseif (is_array($serverData) || $serverData instanceof \ArrayAccess) { - $this->serverData = $serverData; - } else { - throw new \UnexpectedValueException('$serverData must be an array or object implementing ArrayAccess.'); - } - } - - /** - * @param array $record - * @return array - */ - public function __invoke(array $record) - { - // skip processing if for some reason request data - // is not present (CLI or wonky SAPIs) - if (!isset($this->serverData['REQUEST_URI'])) { - return $record; - } - - if (!isset($this->serverData['HTTP_REFERER'])) { - $this->serverData['HTTP_REFERER'] = null; - } - - $record['extra'] = array_merge( - $record['extra'], - array( - 'url' => $this->serverData['REQUEST_URI'], - 'ip' => $this->serverData['REMOTE_ADDR'], - 'http_method' => $this->serverData['REQUEST_METHOD'], - 'server' => $this->serverData['SERVER_NAME'], - 'referrer' => $this->serverData['HTTP_REFERER'], - ) - ); - - return $record; - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/ChromePHPFormatterTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/ChromePHPFormatterTest.php deleted file mode 100644 index e7f7334..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/ChromePHPFormatterTest.php +++ /dev/null @@ -1,158 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -class ChromePHPFormatterTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Monolog\Formatter\ChromePHPFormatter::format - */ - public function testDefaultFormat() - { - $formatter = new ChromePHPFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('ip' => '127.0.0.1'), - 'message' => 'log', - ); - - $message = $formatter->format($record); - - $this->assertEquals( - array( - 'meh', - array( - 'message' => 'log', - 'context' => array('from' => 'logger'), - 'extra' => array('ip' => '127.0.0.1'), - ), - 'unknown', - 'error' - ), - $message - ); - } - - /** - * @covers Monolog\Formatter\ChromePHPFormatter::format - */ - public function testFormatWithFileAndLine() - { - $formatter = new ChromePHPFormatter(); - $record = array( - 'level' => Logger::CRITICAL, - 'level_name' => 'CRITICAL', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('ip' => '127.0.0.1', 'file' => 'test', 'line' => 14), - 'message' => 'log', - ); - - $message = $formatter->format($record); - - $this->assertEquals( - array( - 'meh', - array( - 'message' => 'log', - 'context' => array('from' => 'logger'), - 'extra' => array('ip' => '127.0.0.1'), - ), - 'test : 14', - 'error' - ), - $message - ); - } - - /** - * @covers Monolog\Formatter\ChromePHPFormatter::format - */ - public function testFormatWithoutContext() - { - $formatter = new ChromePHPFormatter(); - $record = array( - 'level' => Logger::DEBUG, - 'level_name' => 'DEBUG', - 'channel' => 'meh', - 'context' => array(), - 'datetime' => new \DateTime("@0"), - 'extra' => array(), - 'message' => 'log', - ); - - $message = $formatter->format($record); - - $this->assertEquals( - array( - 'meh', - 'log', - 'unknown', - 'log' - ), - $message - ); - } - - /** - * @covers Monolog\Formatter\ChromePHPFormatter::formatBatch - */ - public function testBatchFormatThrowException() - { - $formatter = new ChromePHPFormatter(); - $records = array( - array( - 'level' => Logger::INFO, - 'level_name' => 'INFO', - 'channel' => 'meh', - 'context' => array(), - 'datetime' => new \DateTime("@0"), - 'extra' => array(), - 'message' => 'log', - ), - array( - 'level' => Logger::WARNING, - 'level_name' => 'WARNING', - 'channel' => 'foo', - 'context' => array(), - 'datetime' => new \DateTime("@0"), - 'extra' => array(), - 'message' => 'log2', - ), - ); - - $this->assertEquals( - array( - array( - 'meh', - 'log', - 'unknown', - 'info' - ), - array( - 'foo', - 'log2', - 'unknown', - 'warn' - ), - ), - $formatter->formatBatch($records) - ); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/GelfMessageFormatterTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/GelfMessageFormatterTest.php deleted file mode 100644 index 9409268..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/GelfMessageFormatterTest.php +++ /dev/null @@ -1,150 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -class GelfMessageFormatterTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Monolog\Formatter\GelfMessageFormatter::format - */ - public function testDefaultFormatter() - { - $formatter = new GelfMessageFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array(), - 'datetime' => new \DateTime("@0"), - 'extra' => array(), - 'message' => 'log', - ); - - $message = $formatter->format($record); - - $this->assertInstanceOf('Gelf\Message', $message); - $this->assertEquals(0, $message->getTimestamp()); - $this->assertEquals('log', $message->getShortMessage()); - $this->assertEquals('meh', $message->getFacility()); - $this->assertEquals(null, $message->getLine()); - $this->assertEquals(null, $message->getFile()); - $this->assertEquals(LOG_ERR, $message->getLevel()); - $this->assertNotEmpty($message->getHost()); - - $formatter = new GelfMessageFormatter('mysystem'); - - $message = $formatter->format($record); - - $this->assertInstanceOf('Gelf\Message', $message); - $this->assertEquals('mysystem', $message->getHost()); - } - - /** - * @covers Monolog\Formatter\GelfMessageFormatter::format - */ - public function testFormatWithFileAndLine() - { - $formatter = new GelfMessageFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('file' => 'test', 'line' => 14), - 'message' => 'log', - ); - - $message = $formatter->format($record); - - $this->assertInstanceOf('Gelf\Message', $message); - $this->assertEquals('test', $message->getFile()); - $this->assertEquals(14, $message->getLine()); - } - - /** - * @covers Monolog\Formatter\GelfMessageFormatter::format - */ - public function testFormatWithContext() - { - $formatter = new GelfMessageFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('key' => 'pair'), - 'message' => 'log' - ); - - $message = $formatter->format($record); - - $this->assertInstanceOf('Gelf\Message', $message); - - $message_array = $message->toArray(); - - $this->assertArrayHasKey('_ctxt_from', $message_array); - $this->assertEquals('logger', $message_array['_ctxt_from']); - - // Test with extraPrefix - $formatter = new GelfMessageFormatter(null, null, 'CTX'); - $message = $formatter->format($record); - - $this->assertInstanceOf('Gelf\Message', $message); - - $message_array = $message->toArray(); - - $this->assertArrayHasKey('_CTXfrom', $message_array); - $this->assertEquals('logger', $message_array['_CTXfrom']); - - } - - /** - * @covers Monolog\Formatter\GelfMessageFormatter::format - */ - public function testFormatWithExtra() - { - $formatter = new GelfMessageFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('key' => 'pair'), - 'message' => 'log' - ); - - $message = $formatter->format($record); - - $this->assertInstanceOf('Gelf\Message', $message); - - $message_array = $message->toArray(); - - $this->assertArrayHasKey('_key', $message_array); - $this->assertEquals('pair', $message_array['_key']); - - // Test with extraPrefix - $formatter = new GelfMessageFormatter(null, 'EXT'); - $message = $formatter->format($record); - - $this->assertInstanceOf('Gelf\Message', $message); - - $message_array = $message->toArray(); - - $this->assertArrayHasKey('_EXTkey', $message_array); - $this->assertEquals('pair', $message_array['_EXTkey']); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/JsonFormatterTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/JsonFormatterTest.php deleted file mode 100644 index ba6152c..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/JsonFormatterTest.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; -use Monolog\TestCase; - -class JsonFormatterTest extends TestCase -{ - /** - * @covers Monolog\Formatter\JsonFormatter::format - */ - public function testFormat() - { - $formatter = new JsonFormatter(); - $record = $this->getRecord(); - $this->assertEquals(json_encode($record), $formatter->format($record)); - } - - /** - * @covers Monolog\Formatter\JsonFormatter::formatBatch - */ - public function testFormatBatch() - { - $formatter = new JsonFormatter(); - $records = array( - $this->getRecord(Logger::WARNING), - $this->getRecord(Logger::DEBUG), - ); - $this->assertEquals(json_encode($records), $formatter->formatBatch($records)); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/LineFormatterTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/LineFormatterTest.php deleted file mode 100644 index 0c07dc2..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/LineFormatterTest.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -/** - * @covers Monolog\Formatter\LineFormatter - */ -class LineFormatterTest extends \PHPUnit_Framework_TestCase -{ - public function testDefFormatWithString() - { - $formatter = new LineFormatter(null, 'Y-m-d'); - $message = $formatter->format(array( - 'level_name' => 'WARNING', - 'channel' => 'log', - 'context' => array(), - 'message' => 'foo', - 'datetime' => new \DateTime, - 'extra' => array(), - )); - $this->assertEquals('['.date('Y-m-d').'] log.WARNING: foo [] []'."\n", $message); - } - - public function testDefFormatWithArrayContext() - { - $formatter = new LineFormatter(null, 'Y-m-d'); - $message = $formatter->format(array( - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'message' => 'foo', - 'datetime' => new \DateTime, - 'extra' => array(), - 'context' => array( - 'foo' => 'bar', - 'baz' => 'qux', - ) - )); - $this->assertEquals('['.date('Y-m-d').'] meh.ERROR: foo {"foo":"bar","baz":"qux"} []'."\n", $message); - } - - public function testDefFormatExtras() - { - $formatter = new LineFormatter(null, 'Y-m-d'); - $message = $formatter->format(array( - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array(), - 'datetime' => new \DateTime, - 'extra' => array('ip' => '127.0.0.1'), - 'message' => 'log', - )); - $this->assertEquals('['.date('Y-m-d').'] meh.ERROR: log [] {"ip":"127.0.0.1"}'."\n", $message); - } - - public function testFormatExtras() - { - $formatter = new LineFormatter("[%datetime%] %channel%.%level_name%: %message% %context% %extra.file% %extra%\n", 'Y-m-d'); - $message = $formatter->format(array( - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array(), - 'datetime' => new \DateTime, - 'extra' => array('ip' => '127.0.0.1', 'file' => 'test'), - 'message' => 'log', - )); - $this->assertEquals('['.date('Y-m-d').'] meh.ERROR: log [] test {"ip":"127.0.0.1"}'."\n", $message); - } - - public function testDefFormatWithObject() - { - $formatter = new LineFormatter(null, 'Y-m-d'); - $message = $formatter->format(array( - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array(), - 'datetime' => new \DateTime, - 'extra' => array('foo' => new TestFoo, 'bar' => new TestBar, 'baz' => array(), 'res' => fopen('php://memory', 'rb')), - 'message' => 'foobar', - )); - if (version_compare(PHP_VERSION, '5.4.0', '>=')) { - $this->assertEquals('['.date('Y-m-d').'] meh.ERROR: foobar [] {"foo":"[object] (Monolog\\\\Formatter\\\\TestFoo: {\\"foo\\":\\"foo\\"})","bar":"[object] (Monolog\\\\Formatter\\\\TestBar: {})","baz":[],"res":"[resource]"}'."\n", $message); - } else { - $this->assertEquals('['.date('Y-m-d').'] meh.ERROR: foobar [] {"foo":"[object] (Monolog\\Formatter\\TestFoo: {"foo":"foo"})","bar":"[object] (Monolog\\Formatter\\TestBar: {})","baz":[],"res":"[resource]"}'."\n", $message); - } - } - - public function testBatchFormat() - { - $formatter = new LineFormatter(null, 'Y-m-d'); - $message = $formatter->formatBatch(array( - array( - 'level_name' => 'CRITICAL', - 'channel' => 'test', - 'message' => 'bar', - 'context' => array(), - 'datetime' => new \DateTime, - 'extra' => array(), - ), - array( - 'level_name' => 'WARNING', - 'channel' => 'log', - 'message' => 'foo', - 'context' => array(), - 'datetime' => new \DateTime, - 'extra' => array(), - ), - )); - $this->assertEquals('['.date('Y-m-d').'] test.CRITICAL: bar [] []'."\n".'['.date('Y-m-d').'] log.WARNING: foo [] []'."\n", $message); - } -} - -class TestFoo -{ - public $foo = 'foo'; -} - -class TestBar -{ - public function __toString() - { - return 'bar'; - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/NormalizerFormatterTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/NormalizerFormatterTest.php deleted file mode 100644 index 8a5e6d6..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/NormalizerFormatterTest.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -/** - * @covers Monolog\Formatter\NormalizerFormatter - */ -class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase -{ - public function testFormat() - { - $formatter = new NormalizerFormatter('Y-m-d'); - $formatted = $formatter->format(array( - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'message' => 'foo', - 'datetime' => new \DateTime, - 'extra' => array('foo' => new TestFooNorm, 'bar' => new TestBarNorm, 'baz' => array(), 'res' => fopen('php://memory', 'rb')), - 'context' => array( - 'foo' => 'bar', - 'baz' => 'qux', - ) - )); - - $this->assertEquals(array( - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'message' => 'foo', - 'datetime' => date('Y-m-d'), - 'extra' => array( - 'foo' => '[object] (Monolog\\Formatter\\TestFooNorm: {"foo":"foo"})', - 'bar' => '[object] (Monolog\\Formatter\\TestBarNorm: {})', - 'baz' => array(), - 'res' => '[resource]', - ), - 'context' => array( - 'foo' => 'bar', - 'baz' => 'qux', - ) - ), $formatted); - } - - public function testBatchFormat() - { - $formatter = new NormalizerFormatter('Y-m-d'); - $formatted = $formatter->formatBatch(array( - array( - 'level_name' => 'CRITICAL', - 'channel' => 'test', - 'message' => 'bar', - 'context' => array(), - 'datetime' => new \DateTime, - 'extra' => array(), - ), - array( - 'level_name' => 'WARNING', - 'channel' => 'log', - 'message' => 'foo', - 'context' => array(), - 'datetime' => new \DateTime, - 'extra' => array(), - ), - )); - $this->assertEquals(array( - array( - 'level_name' => 'CRITICAL', - 'channel' => 'test', - 'message' => 'bar', - 'context' => array(), - 'datetime' => date('Y-m-d'), - 'extra' => array(), - ), - array( - 'level_name' => 'WARNING', - 'channel' => 'log', - 'message' => 'foo', - 'context' => array(), - 'datetime' => date('Y-m-d'), - 'extra' => array(), - ), - ), $formatted); - } -} - -class TestFooNorm -{ - public $foo = 'foo'; -} - -class TestBarNorm -{ - public function __toString() - { - return 'bar'; - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/WildfireFormatterTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/WildfireFormatterTest.php deleted file mode 100644 index 0b07e33..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Formatter/WildfireFormatterTest.php +++ /dev/null @@ -1,111 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -class WildfireFormatterTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Monolog\Formatter\WildfireFormatter::format - */ - public function testDefaultFormat() - { - $wildfire = new WildfireFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('ip' => '127.0.0.1'), - 'message' => 'log', - ); - - $message = $wildfire->format($record); - - $this->assertEquals( - '125|[{"Type":"ERROR","File":"","Line":"","Label":"meh"},' - .'{"message":"log","context":{"from":"logger"},"extra":{"ip":"127.0.0.1"}}]|', - $message - ); - } - - /** - * @covers Monolog\Formatter\WildfireFormatter::format - */ - public function testFormatWithFileAndLine() - { - $wildfire = new WildfireFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('ip' => '127.0.0.1', 'file' => 'test', 'line' => 14), - 'message' => 'log', - ); - - $message = $wildfire->format($record); - - $this->assertEquals( - '129|[{"Type":"ERROR","File":"test","Line":14,"Label":"meh"},' - .'{"message":"log","context":{"from":"logger"},"extra":{"ip":"127.0.0.1"}}]|', - $message - ); - } - - /** - * @covers Monolog\Formatter\WildfireFormatter::format - */ - public function testFormatWithoutContext() - { - $wildfire = new WildfireFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array(), - 'datetime' => new \DateTime("@0"), - 'extra' => array(), - 'message' => 'log', - ); - - $message = $wildfire->format($record); - - $this->assertEquals( - '58|[{"Type":"ERROR","File":"","Line":"","Label":"meh"},"log"]|', - $message - ); - } - - /** - * @covers Monolog\Formatter\WildfireFormatter::formatBatch - * @expectedException BadMethodCallException - */ - public function testBatchFormatThrowException() - { - $wildfire = new WildfireFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array(), - 'datetime' => new \DateTime("@0"), - 'extra' => array(), - 'message' => 'log', - ); - - $wildfire->formatBatch(array($record)); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Functional/Handler/FirePHPHandlerTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Functional/Handler/FirePHPHandlerTest.php deleted file mode 100644 index 49a4263..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Functional/Handler/FirePHPHandlerTest.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -spl_autoload_register(function($class) -{ - $file = __DIR__.'/../../../../src/'.strtr($class, '\\', '/').'.php'; - if (file_exists($file)) { - require $file; - return true; - } -}); - -use Monolog\Logger; -use Monolog\Handler\FirePHPHandler; -use Monolog\Handler\ChromePHPHandler; - -$logger = new Logger('firephp'); -$logger->pushHandler(new FirePHPHandler); -$logger->pushHandler(new ChromePHPHandler()); - -$logger->addDebug('Debug'); -$logger->addInfo('Info'); -$logger->addWarning('Warning'); -$logger->addError('Error'); diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/AbstractHandlerTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/AbstractHandlerTest.php deleted file mode 100644 index 01d522f..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/AbstractHandlerTest.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; -use Monolog\Formatter\LineFormatter; -use Monolog\Processor\WebProcessor; - -class AbstractHandlerTest extends TestCase -{ - /** - * @covers Monolog\Handler\AbstractHandler::__construct - * @covers Monolog\Handler\AbstractHandler::getLevel - * @covers Monolog\Handler\AbstractHandler::setLevel - * @covers Monolog\Handler\AbstractHandler::getBubble - * @covers Monolog\Handler\AbstractHandler::setBubble - * @covers Monolog\Handler\AbstractHandler::getFormatter - * @covers Monolog\Handler\AbstractHandler::setFormatter - */ - public function testConstructAndGetSet() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler', array(Logger::WARNING, false)); - $this->assertEquals(Logger::WARNING, $handler->getLevel()); - $this->assertEquals(false, $handler->getBubble()); - - $handler->setLevel(Logger::ERROR); - $handler->setBubble(true); - $handler->setFormatter($formatter = new LineFormatter); - $this->assertEquals(Logger::ERROR, $handler->getLevel()); - $this->assertEquals(true, $handler->getBubble()); - $this->assertSame($formatter, $handler->getFormatter()); - } - - /** - * @covers Monolog\Handler\AbstractHandler::handleBatch - */ - public function testHandleBatch() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler'); - $handler->expects($this->exactly(2)) - ->method('handle'); - $handler->handleBatch(array($this->getRecord(), $this->getRecord())); - } - - /** - * @covers Monolog\Handler\AbstractHandler::isHandling - */ - public function testIsHandling() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler', array(Logger::WARNING, false)); - $this->assertTrue($handler->isHandling($this->getRecord())); - $this->assertFalse($handler->isHandling($this->getRecord(Logger::DEBUG))); - } - - /** - * @covers Monolog\Handler\AbstractHandler::getFormatter - * @covers Monolog\Handler\AbstractHandler::getDefaultFormatter - */ - public function testGetFormatterInitializesDefault() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler'); - $this->assertInstanceOf('Monolog\Formatter\LineFormatter', $handler->getFormatter()); - } - - /** - * @covers Monolog\Handler\AbstractHandler::pushProcessor - * @covers Monolog\Handler\AbstractHandler::popProcessor - * @expectedException LogicException - */ - public function testPushPopProcessor() - { - $logger = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler'); - $processor1 = new WebProcessor; - $processor2 = new WebProcessor; - - $logger->pushProcessor($processor1); - $logger->pushProcessor($processor2); - - $this->assertEquals($processor2, $logger->popProcessor()); - $this->assertEquals($processor1, $logger->popProcessor()); - $logger->popProcessor(); - } - - /** - * @covers Monolog\Handler\AbstractHandler::pushProcessor - * @expectedException InvalidArgumentException - */ - public function testPushProcessorWithNonCallable() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler'); - - $handler->pushProcessor(new \stdClass()); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/AbstractProcessingHandlerTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/AbstractProcessingHandlerTest.php deleted file mode 100644 index a8d31a8..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/AbstractProcessingHandlerTest.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; -use Monolog\Processor\WebProcessor; - -class AbstractProcessingHandlerTest extends TestCase -{ - /** - * @covers Monolog\Handler\AbstractProcessingHandler::handle - */ - public function testHandleLowerLevelMessage() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractProcessingHandler', array(Logger::WARNING, true)); - $this->assertFalse($handler->handle($this->getRecord(Logger::DEBUG))); - } - - /** - * @covers Monolog\Handler\AbstractProcessingHandler::handle - */ - public function testHandleBubbling() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractProcessingHandler', array(Logger::DEBUG, true)); - $this->assertFalse($handler->handle($this->getRecord())); - } - - /** - * @covers Monolog\Handler\AbstractProcessingHandler::handle - */ - public function testHandleNotBubbling() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractProcessingHandler', array(Logger::DEBUG, false)); - $this->assertTrue($handler->handle($this->getRecord())); - } - - /** - * @covers Monolog\Handler\AbstractProcessingHandler::handle - */ - public function testHandleIsFalseWhenNotHandled() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractProcessingHandler', array(Logger::WARNING, false)); - $this->assertTrue($handler->handle($this->getRecord())); - $this->assertFalse($handler->handle($this->getRecord(Logger::DEBUG))); - } - - /** - * @covers Monolog\Handler\AbstractProcessingHandler::processRecord - */ - public function testProcessRecord() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractProcessingHandler'); - $handler->pushProcessor(new WebProcessor(array( - 'REQUEST_URI' => '', - 'REQUEST_METHOD' => '', - 'REMOTE_ADDR' => '', - 'REQUEST_URI' => '', - 'SERVER_NAME' => '', - ))); - $handledRecord = null; - $handler->expects($this->once()) - ->method('write') - ->will($this->returnCallback(function($record) use (&$handledRecord){ - $handledRecord = $record; - })) - ; - $handler->handle($this->getRecord()); - $this->assertEquals(5, count($handledRecord['extra'])); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/BufferHandlerTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/BufferHandlerTest.php deleted file mode 100644 index dca29d1..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/BufferHandlerTest.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -class BufferHandlerTest extends TestCase -{ - /** - * @covers Monolog\Handler\BufferHandler::__construct - * @covers Monolog\Handler\BufferHandler::handle - * @covers Monolog\Handler\BufferHandler::close - */ - public function testHandleBuffers() - { - $test = new TestHandler(); - $handler = new BufferHandler($test); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::INFO)); - $this->assertFalse($test->hasDebugRecords()); - $this->assertFalse($test->hasInfoRecords()); - $handler->close(); - $this->assertTrue($test->hasInfoRecords()); - $this->assertTrue(count($test->getRecords()) === 2); - } - - /** - * @covers Monolog\Handler\BufferHandler::close - */ - public function testDestructPropagatesRecords() - { - $test = new TestHandler(); - $handler = new BufferHandler($test); - $handler->handle($this->getRecord(Logger::WARNING)); - $handler->handle($this->getRecord(Logger::DEBUG)); - unset($handler); - $this->assertTrue($test->hasWarningRecords()); - $this->assertTrue($test->hasDebugRecords()); - } - - /** - * @covers Monolog\Handler\BufferHandler::handle - */ - public function testHandleBufferLimit() - { - $test = new TestHandler(); - $handler = new BufferHandler($test, 2); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::INFO)); - $handler->handle($this->getRecord(Logger::WARNING)); - $handler->close(); - $this->assertTrue($test->hasWarningRecords()); - $this->assertTrue($test->hasInfoRecords()); - $this->assertFalse($test->hasDebugRecords()); - } - - /** - * @covers Monolog\Handler\BufferHandler::handle - */ - public function testHandleLevel() - { - $test = new TestHandler(); - $handler = new BufferHandler($test, 0, Logger::INFO); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::INFO)); - $handler->handle($this->getRecord(Logger::WARNING)); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->close(); - $this->assertTrue($test->hasWarningRecords()); - $this->assertTrue($test->hasInfoRecords()); - $this->assertFalse($test->hasDebugRecords()); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/ChromePHPHandlerTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/ChromePHPHandlerTest.php deleted file mode 100644 index 812ea07..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/ChromePHPHandlerTest.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -/** - * @covers Monolog\Handler\ChromePHPHandler - */ -class ChromePHPHandlerTest extends TestCase -{ - protected function setUp() - { - TestChromePHPHandler::reset(); - } - - public function testHeaders() - { - $handler = new TestChromePHPHandler(); - $handler->setFormatter($this->getIdentityFormatter()); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::WARNING)); - - $expected = array( - 'X-ChromePhp-Data' => base64_encode(utf8_encode(json_encode(array( - 'version' => ChromePHPHandler::VERSION, - 'columns' => array('label', 'log', 'backtrace', 'type'), - 'rows' => array( - 'test', - 'test', - ), - 'request_uri' => '', - )))) - ); - - $this->assertEquals($expected, $handler->getHeaders()); - } - - public function testConcurrentHandlers() - { - $handler = new TestChromePHPHandler(); - $handler->setFormatter($this->getIdentityFormatter()); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::WARNING)); - - $handler2 = new TestChromePHPHandler(); - $handler2->setFormatter($this->getIdentityFormatter()); - $handler2->handle($this->getRecord(Logger::DEBUG)); - $handler2->handle($this->getRecord(Logger::WARNING)); - - $expected = array( - 'X-ChromePhp-Data' => base64_encode(utf8_encode(json_encode(array( - 'version' => ChromePHPHandler::VERSION, - 'columns' => array('label', 'log', 'backtrace', 'type'), - 'rows' => array( - 'test', - 'test', - 'test', - 'test', - ), - 'request_uri' => '', - )))) - ); - - $this->assertEquals($expected, $handler2->getHeaders()); - } -} - -class TestChromePHPHandler extends ChromePHPHandler -{ - protected $headers = array(); - - public static function reset() - { - self::$initialized = false; - self::$json['rows'] = array(); - } - - protected function sendHeader($header, $content) - { - $this->headers[$header] = $content; - } - - public function getHeaders() - { - return $this->headers; - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/FingersCrossedHandlerTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/FingersCrossedHandlerTest.php deleted file mode 100644 index 602324f..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/FingersCrossedHandlerTest.php +++ /dev/null @@ -1,151 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; -use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy; - -class FingersCrossedHandlerTest extends TestCase -{ - /** - * @covers Monolog\Handler\FingersCrossedHandler::__construct - * @covers Monolog\Handler\FingersCrossedHandler::handle - */ - public function testHandleBuffers() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler($test); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::INFO)); - $this->assertFalse($test->hasDebugRecords()); - $this->assertFalse($test->hasInfoRecords()); - $handler->handle($this->getRecord(Logger::WARNING)); - $this->assertTrue($test->hasInfoRecords()); - $this->assertTrue(count($test->getRecords()) === 3); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::handle - */ - public function testHandleStopsBufferingAfterTrigger() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler($test); - $handler->handle($this->getRecord(Logger::WARNING)); - $handler->handle($this->getRecord(Logger::DEBUG)); - $this->assertTrue($test->hasWarningRecords()); - $this->assertTrue($test->hasDebugRecords()); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::handle - * @covers Monolog\Handler\FingersCrossedHandler::reset - */ - public function testHandleRestartBufferingAfterReset() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler($test); - $handler->handle($this->getRecord(Logger::WARNING)); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->reset(); - $handler->handle($this->getRecord(Logger::INFO)); - $this->assertTrue($test->hasWarningRecords()); - $this->assertTrue($test->hasDebugRecords()); - $this->assertFalse($test->hasInfoRecords()); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::handle - */ - public function testHandleRestartBufferingAfterBeingTriggeredWhenStopBufferingIsDisabled() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler($test, Logger::WARNING, 0, false, false); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::WARNING)); - $handler->handle($this->getRecord(Logger::INFO)); - $this->assertTrue($test->hasWarningRecords()); - $this->assertTrue($test->hasDebugRecords()); - $this->assertFalse($test->hasInfoRecords()); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::handle - */ - public function testHandleBufferLimit() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler($test, Logger::WARNING, 2); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::INFO)); - $handler->handle($this->getRecord(Logger::WARNING)); - $this->assertTrue($test->hasWarningRecords()); - $this->assertTrue($test->hasInfoRecords()); - $this->assertFalse($test->hasDebugRecords()); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::handle - */ - public function testHandleWithCallback() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler(function($record, $handler) use ($test) { - return $test; - }); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::INFO)); - $this->assertFalse($test->hasDebugRecords()); - $this->assertFalse($test->hasInfoRecords()); - $handler->handle($this->getRecord(Logger::WARNING)); - $this->assertTrue($test->hasInfoRecords()); - $this->assertTrue(count($test->getRecords()) === 3); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::handle - * @expectedException RuntimeException - */ - public function testHandleWithBadCallbackThrowsException() - { - $handler = new FingersCrossedHandler(function($record, $handler) { - return 'foo'; - }); - $handler->handle($this->getRecord(Logger::WARNING)); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::isHandling - */ - public function testIsHandlingAlways() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler($test, Logger::ERROR); - $this->assertTrue($handler->isHandling($this->getRecord(Logger::DEBUG))); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::__construct - */ - public function testActivationStrategy() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler($test, new ErrorLevelActivationStrategy(Logger::WARNING)); - $handler->handle($this->getRecord(Logger::DEBUG)); - $this->assertFalse($test->hasDebugRecords()); - $handler->handle($this->getRecord(Logger::WARNING)); - $this->assertTrue($test->hasDebugRecords()); - $this->assertTrue($test->hasWarningRecords()); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/FirePHPHandlerTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/FirePHPHandlerTest.php deleted file mode 100644 index a9e0b5b..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/FirePHPHandlerTest.php +++ /dev/null @@ -1,94 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -/** - * @covers Monolog\Handler\FirePHPHandler - */ -class FirePHPHandlerTest extends TestCase -{ - public function setUp() - { - TestFirePHPHandler::reset(); - } - - public function testHeaders() - { - $handler = new TestFirePHPHandler; - $handler->setFormatter($this->getIdentityFormatter()); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::WARNING)); - - $expected = array( - 'X-Wf-Protocol-1' => 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2', - 'X-Wf-1-Structure-1' => 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1', - 'X-Wf-1-Plugin-1' => 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3', - 'X-Wf-1-1-1-1' => 'test', - 'X-Wf-1-1-1-2' => 'test', - ); - - $this->assertEquals($expected, $handler->getHeaders()); - } - - public function testConcurrentHandlers() - { - $handler = new TestFirePHPHandler; - $handler->setFormatter($this->getIdentityFormatter()); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::WARNING)); - - $handler2 = new TestFirePHPHandler; - $handler2->setFormatter($this->getIdentityFormatter()); - $handler2->handle($this->getRecord(Logger::DEBUG)); - $handler2->handle($this->getRecord(Logger::WARNING)); - - $expected = array( - 'X-Wf-Protocol-1' => 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2', - 'X-Wf-1-Structure-1' => 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1', - 'X-Wf-1-Plugin-1' => 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3', - 'X-Wf-1-1-1-1' => 'test', - 'X-Wf-1-1-1-2' => 'test', - ); - - $expected2 = array( - 'X-Wf-1-1-1-3' => 'test', - 'X-Wf-1-1-1-4' => 'test', - ); - - $this->assertEquals($expected, $handler->getHeaders()); - $this->assertEquals($expected2, $handler2->getHeaders()); - } -} - -class TestFirePHPHandler extends FirePHPHandler -{ - protected $headers = array(); - - public static function reset() - { - self::$initialized = false; - self::$messageIndex = 1; - } - - protected function sendHeader($header, $content) - { - $this->headers[$header] = $content; - } - - public function getHeaders() - { - return $this->headers; - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/Fixtures/.gitkeep b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/Fixtures/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/GelfHandlerTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/GelfHandlerTest.php deleted file mode 100644 index 8b39590..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/GelfHandlerTest.php +++ /dev/null @@ -1,102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; -use Monolog\Formatter\GelfMessageFormatter; -use Gelf\MessagePublisher; -use Gelf\Message; - -class MockMessagePublisher extends MessagePublisher -{ - public function publish(Message $message) { - $this->lastMessage = $message; - } - - public $lastMessage = null; -} - -class GelfHandlerTest extends TestCase -{ - public function setUp() - { - if (!class_exists("Gelf\MessagePublisher")) { - $this->markTestSkipped("mlehner/gelf-php not installed"); - } - } - - /** - * @covers Monolog\Handler\GelfHandler::__construct - */ - public function testConstruct() - { - $handler = new GelfHandler($this->getMessagePublisher()); - $this->assertInstanceOf('Monolog\Handler\GelfHandler', $handler); - } - - protected function getHandler($messagePublisher) - { - $handler = new GelfHandler($messagePublisher); - return $handler; - } - - protected function getMessagePublisher() - { - return new MockMessagePublisher('localhost'); - } - - public function testDebug() - { - $messagePublisher = $this->getMessagePublisher(); - $handler = $this->getHandler($messagePublisher); - - $record = $this->getRecord(Logger::DEBUG, "A test debug message"); - $handler->handle($record); - - $this->assertEquals(LOG_DEBUG, $messagePublisher->lastMessage->getLevel()); - $this->assertEquals('test', $messagePublisher->lastMessage->getFacility()); - $this->assertEquals($record['message'], $messagePublisher->lastMessage->getShortMessage()); - $this->assertEquals(null, $messagePublisher->lastMessage->getFullMessage()); - } - - public function testWarning() - { - $messagePublisher = $this->getMessagePublisher(); - $handler = $this->getHandler($messagePublisher); - - $record = $this->getRecord(Logger::WARNING, "A test warning message"); - $handler->handle($record); - - $this->assertEquals(LOG_WARNING, $messagePublisher->lastMessage->getLevel()); - $this->assertEquals('test', $messagePublisher->lastMessage->getFacility()); - $this->assertEquals($record['message'], $messagePublisher->lastMessage->getShortMessage()); - $this->assertEquals(null, $messagePublisher->lastMessage->getFullMessage()); - } - - public function testInjectedGelfMessageFormatter() - { - $messagePublisher = $this->getMessagePublisher(); - $handler = $this->getHandler($messagePublisher); - - $handler->setFormatter(new GelfMessageFormatter('mysystem', 'EXT', 'CTX')); - - $record = $this->getRecord(Logger::WARNING, "A test warning message"); - $record['extra']['blarg'] = 'yep'; - $record['context']['from'] = 'logger'; - $handler->handle($record); - - $this->assertEquals('mysystem', $messagePublisher->lastMessage->getHost()); - $this->assertArrayHasKey('_EXTblarg', $messagePublisher->lastMessage->toArray()); - $this->assertArrayHasKey('_CTXfrom', $messagePublisher->lastMessage->toArray()); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/GroupHandlerTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/GroupHandlerTest.php deleted file mode 100644 index 44d77a5..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/GroupHandlerTest.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -class GroupHandlerTest extends TestCase -{ - /** - * @covers Monolog\Handler\GroupHandler::__construct - * @expectedException InvalidArgumentException - */ - public function testConstructorOnlyTakesHandler() - { - new GroupHandler(array(new TestHandler(), "foo")); - } - - /** - * @covers Monolog\Handler\GroupHandler::__construct - * @covers Monolog\Handler\GroupHandler::handle - */ - public function testHandle() - { - $testHandlers = array(new TestHandler(), new TestHandler()); - $handler = new GroupHandler($testHandlers); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::INFO)); - foreach ($testHandlers as $test) { - $this->assertTrue($test->hasDebugRecords()); - $this->assertTrue($test->hasInfoRecords()); - $this->assertTrue(count($test->getRecords()) === 2); - } - } - - /** - * @covers Monolog\Handler\GroupHandler::handleBatch - */ - public function testHandleBatch() - { - $testHandlers = array(new TestHandler(), new TestHandler()); - $handler = new GroupHandler($testHandlers); - $handler->handleBatch(array($this->getRecord(Logger::DEBUG), $this->getRecord(Logger::INFO))); - foreach ($testHandlers as $test) { - $this->assertTrue($test->hasDebugRecords()); - $this->assertTrue($test->hasInfoRecords()); - $this->assertTrue(count($test->getRecords()) === 2); - } - } - - /** - * @covers Monolog\Handler\GroupHandler::isHandling - */ - public function testIsHandling() - { - $testHandlers = array(new TestHandler(Logger::ERROR), new TestHandler(Logger::WARNING)); - $handler = new GroupHandler($testHandlers); - $this->assertTrue($handler->isHandling($this->getRecord(Logger::ERROR))); - $this->assertTrue($handler->isHandling($this->getRecord(Logger::WARNING))); - $this->assertFalse($handler->isHandling($this->getRecord(Logger::DEBUG))); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/MailHandlerTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/MailHandlerTest.php deleted file mode 100644 index c8d9ef5..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/MailHandlerTest.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\TestCase; - -class MailHandlerTest extends TestCase -{ - /** - * @covers Monolog\Handler\MailHandler::handleBatch - */ - public function testHandleBatch() - { - $formatter = $this->getMock('Monolog\\Formatter\\FormatterInterface'); - $formatter->expects($this->once()) - ->method('formatBatch'); // Each record is formatted - - $handler = $this->getMockForAbstractClass('Monolog\\Handler\\MailHandler'); - $handler->expects($this->once()) - ->method('send'); - $handler->expects($this->never()) - ->method('write'); // write is for individual records - - $handler->setFormatter($formatter); - - $handler->handleBatch($this->getMultipleRecords()); - } - - /** - * @covers Monolog\Handler\MailHandler::handleBatch - */ - public function testHandleBatchNotSendsMailIfMessagesAreBelowLevel() - { - $records = array( - $this->getRecord(Logger::DEBUG, 'debug message 1'), - $this->getRecord(Logger::DEBUG, 'debug message 2'), - $this->getRecord(Logger::INFO, 'information'), - ); - - $handler = $this->getMockForAbstractClass('Monolog\\Handler\\MailHandler'); - $handler->expects($this->never()) - ->method('send'); - $handler->setLevel(Logger::ERROR); - - $handler->handleBatch($records); - } - - /** - * @covers Monolog\Handler\MailHandler::write - */ - public function testHandle() - { - $handler = $this->getMockForAbstractClass('Monolog\\Handler\\MailHandler'); - - $record = $this->getRecord(); - $records = array($record); - $records[0]['formatted'] = '['.$record['datetime']->format('Y-m-d H:i:s').'] test.WARNING: test [] []'."\n"; - - $handler->expects($this->once()) - ->method('send') - ->with($records[0]['formatted'], $records); - - $handler->handle($record); - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/MongoDBHandlerTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/MongoDBHandlerTest.php deleted file mode 100644 index 2326c98..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/MongoDBHandlerTest.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -class MongoDBHandlerTest extends TestCase -{ - public function testHandle() - { - $mongo = $this->getMock('Mongo', array('selectCollection')); - $collection = $this->getMock('stdClass', array('save')); - - $mongo->expects($this->once()) - ->method('selectCollection') - ->with('DB', 'Collection') - ->will($this->returnValue($collection)); - - $record = $this->getRecord(Logger::WARNING, 'test', array('data' => new \stdClass, 'foo' => 34)); - - $expected = array( - 'message' => 'test', - 'context' => array('data' => '[object] (stdClass: {})', 'foo' => 34), - 'level' => Logger::WARNING, - 'level_name' => 'WARNING', - 'channel' => 'test', - 'datetime' => $record['datetime']->format('Y-m-d H:i:s'), - 'extra' => array(), - ); - - $collection->expects($this->once()) - ->method('save') - ->with($expected); - - $handler = new MongoDBHandler($mongo, 'DB', 'Collection'); - $handler->handle($record); - } -} - -if (!class_exists('Mongo')) { - class Mongo { - public function selectCollection() {} - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/NullHandlerTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/NullHandlerTest.php deleted file mode 100644 index 12d1316..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/NullHandlerTest.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -/** - * @covers Monolog\Handler\NullHandler::handle - */ -class NullHandlerTest extends TestCase -{ - public function testHandle() - { - $handler = new NullHandler(); - $this->assertTrue($handler->handle($this->getRecord())); - } - - public function testHandleLowerLevelRecord() - { - $handler = new NullHandler(Logger::WARNING); - $this->assertFalse($handler->handle($this->getRecord(Logger::DEBUG))); - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/RotatingFileHandlerTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/RotatingFileHandlerTest.php deleted file mode 100644 index 790f216..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/RotatingFileHandlerTest.php +++ /dev/null @@ -1,100 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -/** - * @covers Monolog\Handler\RotatingFileHandler - */ -class RotatingFileHandlerTest extends TestCase -{ - public function setUp() - { - $dir = __DIR__.'/Fixtures'; - chmod($dir, 0777); - if (!is_writable($dir)) { - $this->markTestSkipped($dir.' must be writeable to test the RotatingFileHandler.'); - } - } - - public function testRotationCreatesNewFile() - { - touch(__DIR__.'/Fixtures/foo-'.date('Y-m-d', time() - 86400).'.rot'); - - $handler = new RotatingFileHandler(__DIR__.'/Fixtures/foo.rot'); - $handler->setFormatter($this->getIdentityFormatter()); - $handler->handle($this->getRecord()); - - $log = __DIR__.'/Fixtures/foo-'.date('Y-m-d').'.rot'; - $this->assertTrue(file_exists($log)); - $this->assertEquals('test', file_get_contents($log)); - } - - /** - * @dataProvider rotationTests - */ - public function testRotation($createFile) - { - touch($old1 = __DIR__.'/Fixtures/foo-'.date('Y-m-d', time() - 86400).'.rot'); - touch($old2 = __DIR__.'/Fixtures/foo-'.date('Y-m-d', time() - 86400 * 2).'.rot'); - touch($old3 = __DIR__.'/Fixtures/foo-'.date('Y-m-d', time() - 86400 * 3).'.rot'); - touch($old4 = __DIR__.'/Fixtures/foo-'.date('Y-m-d', time() - 86400 * 4).'.rot'); - - $log = __DIR__.'/Fixtures/foo-'.date('Y-m-d').'.rot'; - - if ($createFile) { - touch($log); - } - - $handler = new RotatingFileHandler(__DIR__.'/Fixtures/foo.rot', 2); - $handler->setFormatter($this->getIdentityFormatter()); - $handler->handle($this->getRecord()); - - $handler->close(); - - $this->assertTrue(file_exists($log)); - $this->assertTrue(file_exists($old1)); - $this->assertEquals($createFile, file_exists($old2)); - $this->assertEquals($createFile, file_exists($old3)); - $this->assertEquals($createFile, file_exists($old4)); - $this->assertEquals('test', file_get_contents($log)); - } - - public function rotationTests() - { - return array( - 'Rotation is triggered when the file of the current day is not present' - => array(true), - 'Rotation is not triggered when the file is already present' - => array(false), - ); - } - - public function testReuseCurrentFile() - { - $log = __DIR__.'/Fixtures/foo-'.date('Y-m-d').'.rot'; - file_put_contents($log, "foo"); - $handler = new RotatingFileHandler(__DIR__.'/Fixtures/foo.rot'); - $handler->setFormatter($this->getIdentityFormatter()); - $handler->handle($this->getRecord()); - $this->assertEquals('footest', file_get_contents($log)); - } - - public function tearDown() - { - foreach (glob(__DIR__.'/Fixtures/*.rot') as $file) { - unlink($file); - } - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/SocketHandlerTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/SocketHandlerTest.php deleted file mode 100644 index 741a412..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/SocketHandlerTest.php +++ /dev/null @@ -1,284 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -/** - * @author Pablo de Leon Belloc - */ -class SocketHandlerTest extends TestCase -{ - /** - * @var Monolog\Handler\SocketHandler - */ - private $handler; - - /** - * @var resource - */ - private $res; - - /** - * @expectedException UnexpectedValueException - */ - public function testInvalidHostname() - { - $this->createHandler('garbage://here'); - $this->writeRecord('data'); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testBadConnectionTimeout() - { - $this->createHandler('localhost:1234'); - $this->handler->setConnectionTimeout(-1); - } - - public function testSetConnectionTimeout() - { - $this->createHandler('localhost:1234'); - $this->handler->setConnectionTimeout(10); - $this->assertEquals(10, $this->handler->getConnectionTimeout()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testBadTimeout() - { - $this->createHandler('localhost:1234'); - $this->handler->setTimeout(-1); - } - - public function testSetTimeout() - { - $this->createHandler('localhost:1234'); - $this->handler->setTimeout(10); - $this->assertEquals(10, $this->handler->getTimeout()); - } - - public function testSetConnectionString() - { - $this->createHandler('tcp://localhost:9090'); - $this->assertEquals('tcp://localhost:9090', $this->handler->getConnectionString()); - } - - /** - * @expectedException UnexpectedValueException - */ - public function testExceptionIsThrownOnFsockopenError() - { - $this->setMockHandler(array('fsockopen')); - $this->handler->expects($this->once()) - ->method('fsockopen') - ->will($this->returnValue(false)); - $this->writeRecord('Hello world'); - } - - /** - * @expectedException UnexpectedValueException - */ - public function testExceptionIsThrownOnPfsockopenError() - { - $this->setMockHandler(array('pfsockopen')); - $this->handler->expects($this->once()) - ->method('pfsockopen') - ->will($this->returnValue(false)); - $this->handler->setPersistent(true); - $this->writeRecord('Hello world'); - } - - /** - * @expectedException UnexpectedValueException - */ - public function testExceptionIsThrownIfCannotSetTimeout() - { - $this->setMockHandler(array('streamSetTimeout')); - $this->handler->expects($this->once()) - ->method('streamSetTimeout') - ->will($this->returnValue(false)); - $this->writeRecord('Hello world'); - } - - /** - * @expectedException RuntimeException - */ - public function testWriteFailsOnIfFwriteReturnsFalse() - { - $this->setMockHandler(array('fwrite')); - - $callback = function($arg) - { - $map = array( - 'Hello world' => 6, - 'world' => false, - ); - return $map[$arg]; - }; - - $this->handler->expects($this->exactly(2)) - ->method('fwrite') - ->will($this->returnCallback($callback)); - - $this->writeRecord('Hello world'); - } - - /** - * @expectedException RuntimeException - */ - public function testWriteFailsIfStreamTimesOut() - { - $this->setMockHandler(array('fwrite', 'streamGetMetadata')); - - $callback = function($arg) - { - $map = array( - 'Hello world' => 6, - 'world' => 5, - ); - return $map[$arg]; - }; - - $this->handler->expects($this->exactly(1)) - ->method('fwrite') - ->will($this->returnCallback($callback)); - $this->handler->expects($this->exactly(1)) - ->method('streamGetMetadata') - ->will($this->returnValue(array('timed_out' => true))); - - - $this->writeRecord('Hello world'); - } - - /** - * @expectedException RuntimeException - */ - public function testWriteFailsOnIncompleteWrite() - { - $this->setMockHandler(array('fwrite', 'streamGetMetadata')); - - $res = $this->res; - $callback = function($string) use ($res) - { - fclose($res); - return strlen('Hello'); - }; - - $this->handler->expects($this->exactly(1)) - ->method('fwrite') - ->will($this->returnCallback($callback)); - $this->handler->expects($this->exactly(1)) - ->method('streamGetMetadata') - ->will($this->returnValue(array('timed_out' => false))); - - $this->writeRecord('Hello world'); - } - - public function testWriteWithMemoryFile() - { - $this->setMockHandler(); - $this->writeRecord('test1'); - $this->writeRecord('test2'); - $this->writeRecord('test3'); - fseek($this->res, 0); - $this->assertEquals('test1test2test3', fread($this->res, 1024)); - } - - public function testWriteWithMock() - { - $this->setMockHandler(array('fwrite')); - - $callback = function($arg) - { - $map = array( - 'Hello world' => 6, - 'world' => 5, - ); - return $map[$arg]; - }; - - $this->handler->expects($this->exactly(2)) - ->method('fwrite') - ->will($this->returnCallback($callback)); - - $this->writeRecord('Hello world'); - } - - public function testClose() - { - $this->setMockHandler(); - $this->writeRecord('Hello world'); - $this->assertInternalType('resource', $this->res); - $this->handler->close(); - $this->assertFalse(is_resource($this->res), "Expected resource to be closed after closing handler"); - } - - public function testCloseDoesNotClosePersistentSocket() - { - $this->setMockHandler(); - $this->handler->setPersistent(true); - $this->writeRecord('Hello world'); - $this->assertTrue(is_resource($this->res)); - $this->handler->close(); - $this->assertTrue(is_resource($this->res)); - } - - private function createHandler($connectionString) - { - $this->handler = new SocketHandler($connectionString); - $this->handler->setFormatter($this->getIdentityFormatter()); - } - - private function writeRecord($string) - { - $this->handler->handle($this->getRecord(Logger::WARNING, $string)); - } - - private function setMockHandler(array $methods = array()) - { - $this->res = fopen('php://memory', 'a'); - - $defaultMethods = array('fsockopen', 'pfsockopen', 'streamSetTimeout'); - $newMethods = array_diff($methods, $defaultMethods); - - $finalMethods = array_merge($defaultMethods, $newMethods); - - $this->handler = $this->getMock( - '\Monolog\Handler\SocketHandler', $finalMethods, array('localhost:1234') - ); - - if (!in_array('fsockopen', $methods)) { - $this->handler->expects($this->any()) - ->method('fsockopen') - ->will($this->returnValue($this->res)); - } - - if (!in_array('pfsockopen', $methods)) { - $this->handler->expects($this->any()) - ->method('pfsockopen') - ->will($this->returnValue($this->res)); - } - - if (!in_array('streamSetTimeout', $methods)) { - $this->handler->expects($this->any()) - ->method('streamSetTimeout') - ->will($this->returnValue(true)); - } - - $this->handler->setFormatter($this->getIdentityFormatter()); - } - -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/StreamHandlerTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/StreamHandlerTest.php deleted file mode 100644 index 6f7cbec..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/StreamHandlerTest.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -class StreamHandlerTest extends TestCase -{ - /** - * @covers Monolog\Handler\StreamHandler::__construct - * @covers Monolog\Handler\StreamHandler::write - */ - public function testWrite() - { - $handle = fopen('php://memory', 'a+'); - $handler = new StreamHandler($handle); - $handler->setFormatter($this->getIdentityFormatter()); - $handler->handle($this->getRecord(Logger::WARNING, 'test')); - $handler->handle($this->getRecord(Logger::WARNING, 'test2')); - $handler->handle($this->getRecord(Logger::WARNING, 'test3')); - fseek($handle, 0); - $this->assertEquals('testtest2test3', fread($handle, 100)); - } - - /** - * @covers Monolog\Handler\StreamHandler::close - */ - public function testClose() - { - $handle = fopen('php://memory', 'a+'); - $handler = new StreamHandler($handle); - $this->assertTrue(is_resource($handle)); - $handler->close(); - $this->assertFalse(is_resource($handle)); - } - - /** - * @covers Monolog\Handler\StreamHandler::write - */ - public function testWriteCreatesTheStreamResource() - { - $handler = new StreamHandler('php://memory'); - $handler->handle($this->getRecord()); - } - - /** - * @expectedException LogicException - * @covers Monolog\Handler\StreamHandler::__construct - * @covers Monolog\Handler\StreamHandler::write - */ - public function testWriteMissingResource() - { - $handler = new StreamHandler(null); - $handler->handle($this->getRecord()); - } - - /** - * @expectedException UnexpectedValueException - * @covers Monolog\Handler\StreamHandler::__construct - * @covers Monolog\Handler\StreamHandler::write - */ - public function testWriteInvalidResource() - { - $handler = new StreamHandler('bogus://url'); - $handler->handle($this->getRecord()); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/SyslogHandlerTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/SyslogHandlerTest.php deleted file mode 100644 index b2382f4..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/SyslogHandlerTest.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -class SyslogHandlerTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Monolog\Handler\SyslogHandler::__construct - */ - public function testConstruct() - { - $handler = new SyslogHandler('test'); - $this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler); - - $handler = new SyslogHandler('test', LOG_USER); - $this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler); - - $handler = new SyslogHandler('test', 'user'); - $this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler); - } - - /** - * @covers Monolog\Handler\SyslogHandler::__construct - */ - public function testConstructInvalidFacility() - { - $this->setExpectedException('UnexpectedValueException'); - $handler = new SyslogHandler('test', 'unknown'); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/TestHandlerTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/TestHandlerTest.php deleted file mode 100644 index 1addf7e..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Handler/TestHandlerTest.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -/** - * @covers Monolog\Handler\TestHandler - */ -class TestHandlerTest extends TestCase -{ - /** - * @dataProvider methodProvider - */ - public function testHandler($method, $level) - { - $handler = new TestHandler; - $record = $this->getRecord($level, 'test'.$method); - $this->assertFalse($handler->{'has'.$method}($record)); - $this->assertFalse($handler->{'has'.$method.'Records'}()); - $handler->handle($record); - - $this->assertFalse($handler->{'has'.$method}('bar')); - $this->assertTrue($handler->{'has'.$method}($record)); - $this->assertTrue($handler->{'has'.$method}('test'.$method)); - $this->assertTrue($handler->{'has'.$method.'Records'}()); - - $records = $handler->getRecords(); - unset($records[0]['formatted']); - $this->assertEquals(array($record), $records); - } - - public function methodProvider() - { - return array( - array('Alert' , Logger::ALERT), - array('Critical', Logger::CRITICAL), - array('Error' , Logger::ERROR), - array('Warning' , Logger::WARNING), - array('Info' , Logger::INFO), - array('Debug' , Logger::DEBUG), - ); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/LoggerTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/LoggerTest.php deleted file mode 100644 index 403913b..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/LoggerTest.php +++ /dev/null @@ -1,367 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -use Monolog\Processor\WebProcessor; -use Monolog\Handler\TestHandler; - -class LoggerTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Monolog\Logger::getName - */ - public function testGetName() - { - $logger = new Logger('foo'); - $this->assertEquals('foo', $logger->getName()); - } - - /** - * @covers Monolog\Logger::__construct - */ - public function testChannel() - { - $logger = new Logger('foo'); - $handler = new TestHandler; - $logger->pushHandler($handler); - $logger->addWarning('test'); - list($record) = $handler->getRecords(); - $this->assertEquals('foo', $record['channel']); - } - - /** - * @covers Monolog\Logger::addRecord - */ - public function testLog() - { - $logger = new Logger(__METHOD__); - - $handler = $this->getMock('Monolog\Handler\NullHandler', array('handle')); - $handler->expects($this->once()) - ->method('handle'); - $logger->pushHandler($handler); - - $this->assertTrue($logger->addWarning('test')); - } - - /** - * @covers Monolog\Logger::addRecord - */ - public function testLogNotHandled() - { - $logger = new Logger(__METHOD__); - - $handler = $this->getMock('Monolog\Handler\NullHandler', array('handle'), array(Logger::ERROR)); - $handler->expects($this->never()) - ->method('handle'); - $logger->pushHandler($handler); - - $this->assertFalse($logger->addWarning('test')); - } - - /** - * @covers Monolog\Logger::pushHandler - * @covers Monolog\Logger::popHandler - * @expectedException LogicException - */ - public function testPushPopHandler() - { - $logger = new Logger(__METHOD__); - $handler1 = new TestHandler; - $handler2 = new TestHandler; - - $logger->pushHandler($handler1); - $logger->pushHandler($handler2); - - $this->assertEquals($handler2, $logger->popHandler()); - $this->assertEquals($handler1, $logger->popHandler()); - $logger->popHandler(); - } - - /** - * @covers Monolog\Logger::pushProcessor - * @covers Monolog\Logger::popProcessor - * @expectedException LogicException - */ - public function testPushPopProcessor() - { - $logger = new Logger(__METHOD__); - $processor1 = new WebProcessor; - $processor2 = new WebProcessor; - - $logger->pushProcessor($processor1); - $logger->pushProcessor($processor2); - - $this->assertEquals($processor2, $logger->popProcessor()); - $this->assertEquals($processor1, $logger->popProcessor()); - $logger->popProcessor(); - } - - /** - * @covers Monolog\Logger::pushProcessor - * @expectedException InvalidArgumentException - */ - public function testPushProcessorWithNonCallable() - { - $logger = new Logger(__METHOD__); - - $logger->pushProcessor(new \stdClass()); - } - - /** - * @covers Monolog\Logger::addRecord - */ - public function testProcessorsAreExecuted() - { - $logger = new Logger(__METHOD__); - $handler = new TestHandler; - $logger->pushHandler($handler); - $logger->pushProcessor(function($record) { - $record['extra']['win'] = true; - return $record; - }); - $logger->addError('test'); - list($record) = $handler->getRecords(); - $this->assertTrue($record['extra']['win']); - } - - /** - * @covers Monolog\Logger::addRecord - */ - public function testProcessorsAreCalledOnlyOnce() - { - $logger = new Logger(__METHOD__); - $handler = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler->expects($this->any()) - ->method('isHandling') - ->will($this->returnValue(true)) - ; - $handler->expects($this->any()) - ->method('handle') - ->will($this->returnValue(true)) - ; - $logger->pushHandler($handler); - - $processor = $this->getMockBuilder('Monolog\Processor\WebProcessor') - ->disableOriginalConstructor() - ->setMethods(array('__invoke')) - ->getMock() - ; - $processor->expects($this->once()) - ->method('__invoke') - ->will($this->returnArgument(0)) - ; - $logger->pushProcessor($processor); - - $logger->addError('test'); - } - - /** - * @covers Monolog\Logger::addRecord - */ - public function testProcessorsNotCalledWhenNotHandled() - { - $logger = new Logger(__METHOD__); - $handler = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler->expects($this->once()) - ->method('isHandling') - ->will($this->returnValue(false)) - ; - $logger->pushHandler($handler); - $that = $this; - $logger->pushProcessor(function($record) use ($that){ - $that->fail('The processor should not be called'); - }); - $logger->addAlert('test'); - } - - /** - * @covers Monolog\Logger::addRecord - */ - public function testHandlersNotCalledBeforeFirstHandling() - { - $logger = new Logger(__METHOD__); - - $handler1 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler1->expects($this->never()) - ->method('isHandling') - ->will($this->returnValue(false)) - ; - $handler1->expects($this->once()) - ->method('handle') - ->will($this->returnValue(false)) - ; - $logger->pushHandler($handler1); - - $handler2 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler2->expects($this->once()) - ->method('isHandling') - ->will($this->returnValue(true)) - ; - $handler2->expects($this->once()) - ->method('handle') - ->will($this->returnValue(false)) - ; - $logger->pushHandler($handler2); - - $handler3 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler3->expects($this->once()) - ->method('isHandling') - ->will($this->returnValue(false)) - ; - $handler3->expects($this->never()) - ->method('handle') - ; - $logger->pushHandler($handler3); - - $logger->debug('test'); - } - - /** - * @covers Monolog\Logger::addRecord - */ - public function testBubblingWhenTheHandlerReturnsFalse() - { - $logger = new Logger(__METHOD__); - - $handler1 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler1->expects($this->any()) - ->method('isHandling') - ->will($this->returnValue(true)) - ; - $handler1->expects($this->once()) - ->method('handle') - ->will($this->returnValue(false)) - ; - $logger->pushHandler($handler1); - - $handler2 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler2->expects($this->any()) - ->method('isHandling') - ->will($this->returnValue(true)) - ; - $handler2->expects($this->once()) - ->method('handle') - ->will($this->returnValue(false)) - ; - $logger->pushHandler($handler2); - - $logger->debug('test'); - } - - /** - * @covers Monolog\Logger::addRecord - */ - public function testNotBubblingWhenTheHandlerReturnsTrue() - { - $logger = new Logger(__METHOD__); - - $handler1 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler1->expects($this->any()) - ->method('isHandling') - ->will($this->returnValue(true)) - ; - $handler1->expects($this->never()) - ->method('handle') - ; - $logger->pushHandler($handler1); - - $handler2 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler2->expects($this->any()) - ->method('isHandling') - ->will($this->returnValue(true)) - ; - $handler2->expects($this->once()) - ->method('handle') - ->will($this->returnValue(true)) - ; - $logger->pushHandler($handler2); - - $logger->debug('test'); - } - - /** - * @covers Monolog\Logger::isHandling - */ - public function testIsHandling() - { - $logger = new Logger(__METHOD__); - - $handler1 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler1->expects($this->any()) - ->method('isHandling') - ->will($this->returnValue(false)) - ; - - $logger->pushHandler($handler1); - $this->assertFalse($logger->isHandling(Logger::DEBUG)); - - $handler2 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler2->expects($this->any()) - ->method('isHandling') - ->will($this->returnValue(true)) - ; - - $logger->pushHandler($handler2); - $this->assertTrue($logger->isHandling(Logger::DEBUG)); - } - - /** - * @dataProvider logMethodProvider - * @covers Monolog\Logger::addDebug - * @covers Monolog\Logger::addInfo - * @covers Monolog\Logger::addWarning - * @covers Monolog\Logger::addError - * @covers Monolog\Logger::addCritical - * @covers Monolog\Logger::addAlert - * @covers Monolog\Logger::debug - * @covers Monolog\Logger::info - * @covers Monolog\Logger::notice - * @covers Monolog\Logger::warn - * @covers Monolog\Logger::err - * @covers Monolog\Logger::crit - * @covers Monolog\Logger::alert - * @covers Monolog\Logger::emerg - */ - public function testLogMethods($method, $expectedLevel) - { - $logger = new Logger('foo'); - $handler = new TestHandler; - $logger->pushHandler($handler); - $logger->{$method}('test'); - list($record) = $handler->getRecords(); - $this->assertEquals($expectedLevel, $record['level']); - } - - public function logMethodProvider() - { - return array( - // monolog methods - array('addDebug', Logger::DEBUG), - array('addInfo', Logger::INFO), - array('addWarning', Logger::WARNING), - array('addError', Logger::ERROR), - array('addCritical', Logger::CRITICAL), - array('addAlert', Logger::ALERT), - - // ZF/Sf2 compat methods - array('debug', Logger::DEBUG), - array('info', Logger::INFO), - array('notice', Logger::INFO), - array('warn', Logger::WARNING), - array('err', Logger::ERROR), - array('crit', Logger::CRITICAL), - array('alert', Logger::ALERT), - array('emerg', Logger::ALERT), - ); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Processor/IntrospectionProcessorTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Processor/IntrospectionProcessorTest.php deleted file mode 100644 index be78df8..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Processor/IntrospectionProcessorTest.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -use Monolog\TestCase; -use Monolog\Handler\TestHandler; - -class IntrospectionProcessorTest extends TestCase -{ - public function getHandler() - { - $processor = new IntrospectionProcessor(); - $handler = new TestHandler(); - $handler->pushProcessor($processor); - return $handler; - } - - public function testProcessorFromClass() - { - $handler = $this->getHandler(); - $tester = new \Acme\Tester; - $tester->test($handler, $this->getRecord()); - list($record) = $handler->getRecords(); - $this->assertEquals(__FILE__, $record['extra']['file']); - $this->assertEquals(57, $record['extra']['line']); - $this->assertEquals('Acme\Tester', $record['extra']['class']); - $this->assertEquals('test', $record['extra']['function']); - } - - public function testProcessorFromFunc() - { - $handler = $this->getHandler(); - \Acme\tester($handler, $this->getRecord()); - list($record) = $handler->getRecords(); - $this->assertEquals(__FILE__, $record['extra']['file']); - $this->assertEquals(63, $record['extra']['line']); - $this->assertEquals(null, $record['extra']['class']); - $this->assertEquals('Acme\tester', $record['extra']['function']); - } -} - -namespace Acme; - -class Tester -{ - function test($handler, $record) - { - $handler->handle($record); - } -} - -function tester($handler, $record) -{ - $handler->handle($record); -} \ No newline at end of file diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php deleted file mode 100644 index 4bdf22c..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -use Monolog\TestCase; - -class MemoryPeakUsageProcessorTest extends TestCase -{ - /** - * @covers Monolog\Processor\MemoryPeakUsageProcessor::__invoke - * @covers Monolog\Processor\MemoryProcessor::formatBytes - */ - public function testProcessor() - { - $processor = new MemoryPeakUsageProcessor(); - $record = $processor($this->getRecord()); - $this->assertArrayHasKey('memory_peak_usage', $record['extra']); - $this->assertRegExp('#[0-9.]+ (M|K)?B$#', $record['extra']['memory_peak_usage']); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Processor/MemoryUsageProcessorTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Processor/MemoryUsageProcessorTest.php deleted file mode 100644 index a30d6de..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Processor/MemoryUsageProcessorTest.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -use Monolog\TestCase; - -class MemoryUsageProcessorTest extends TestCase -{ - /** - * @covers Monolog\Processor\MemoryUsageProcessor::__invoke - * @covers Monolog\Processor\MemoryProcessor::formatBytes - */ - public function testProcessor() - { - $processor = new MemoryUsageProcessor(); - $record = $processor($this->getRecord()); - $this->assertArrayHasKey('memory_usage', $record['extra']); - $this->assertRegExp('#[0-9.]+ (M|K)?B$#', $record['extra']['memory_usage']); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Processor/WebProcessorTest.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Processor/WebProcessorTest.php deleted file mode 100644 index 04a5422..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/Processor/WebProcessorTest.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -use Monolog\TestCase; - -class WebProcessorTest extends TestCase -{ - public function testProcessor() - { - $server = array( - 'REQUEST_URI' => 'A', - 'REMOTE_ADDR' => 'B', - 'REQUEST_METHOD' => 'C', - 'HTTP_REFERER' => 'D', - 'SERVER_NAME' => 'F', - ); - - $processor = new WebProcessor($server); - $record = $processor($this->getRecord()); - $this->assertEquals($server['REQUEST_URI'], $record['extra']['url']); - $this->assertEquals($server['REMOTE_ADDR'], $record['extra']['ip']); - $this->assertEquals($server['REQUEST_METHOD'], $record['extra']['http_method']); - $this->assertEquals($server['HTTP_REFERER'], $record['extra']['referrer']); - $this->assertEquals($server['SERVER_NAME'], $record['extra']['server']); - } - - public function testProcessorDoNothingIfNoRequestUri() - { - $server = array( - 'REMOTE_ADDR' => 'B', - 'REQUEST_METHOD' => 'C', - ); - $processor = new WebProcessor($server); - $record = $processor($this->getRecord()); - $this->assertEmpty($record['extra']); - } - - public function testProcessorReturnNullIfNoHttpReferer() - { - $server = array( - 'REQUEST_URI' => 'A', - 'REMOTE_ADDR' => 'B', - 'REQUEST_METHOD' => 'C', - 'SERVER_NAME' => 'F', - ); - $processor = new WebProcessor($server); - $record = $processor($this->getRecord()); - $this->assertNull($record['extra']['referrer']); - } - - /** - * @expectedException UnexpectedValueException - */ - public function testInvalidData() - { - new WebProcessor(new \stdClass); - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/TestCase.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/TestCase.php deleted file mode 100644 index 1067b91..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/Monolog/TestCase.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -class TestCase extends \PHPUnit_Framework_TestCase -{ - /** - * @return array Record - */ - protected function getRecord($level = Logger::WARNING, $message = 'test', $context = array()) - { - return array( - 'message' => $message, - 'context' => $context, - 'level' => $level, - 'level_name' => Logger::getLevelName($level), - 'channel' => 'test', - 'datetime' => \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true))), - 'extra' => array(), - ); - } - - /** - * @return array - */ - protected function getMultipleRecords() - { - return array( - $this->getRecord(Logger::DEBUG, 'debug message 1'), - $this->getRecord(Logger::DEBUG, 'debug message 2'), - $this->getRecord(Logger::INFO, 'information'), - $this->getRecord(Logger::WARNING, 'warning'), - $this->getRecord(Logger::ERROR, 'error') - ); - } - - /** - * @return Monolog\Formatter\FormatterInterface - */ - protected function getIdentityFormatter() - { - $formatter = $this->getMock('Monolog\\Formatter\\FormatterInterface'); - $formatter->expects($this->any()) - ->method('format') - ->will($this->returnCallback(function($record) { return $record['message']; })); - - return $formatter; - } -} diff --git a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/bootstrap.php b/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/bootstrap.php deleted file mode 100644 index b5a1963..0000000 --- a/vendor/monolog/monolog/Seldaek-monolog-abc80e0/tests/bootstrap.php +++ /dev/null @@ -1,13 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -require_once __DIR__ . "/../vendor/autoload.php"; -require_once __DIR__.'/Monolog/TestCase.php'; diff --git a/vendor/monolog/monolog/composer.json b/vendor/monolog/monolog/composer.json deleted file mode 100644 index c8c28b0..0000000 --- a/vendor/monolog/monolog/composer.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "monolog/monolog", - "description": "Logging for PHP 5.3", - "keywords": ["log","logging"], - "homepage": "http://github.com/Seldaek/monolog", - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "mlehner/gelf-php": "1.0.*" - }, - "suggest": { - "mlehner/gelf-php": "Allow sending log messages to a GrayLog2 server" - }, - "autoload": { - "psr-0": {"Monolog": "src/"} - } -} diff --git a/vendor/monolog/monolog/doc/extending.md b/vendor/monolog/monolog/doc/extending.md deleted file mode 100644 index fcd7af2..0000000 --- a/vendor/monolog/monolog/doc/extending.md +++ /dev/null @@ -1,76 +0,0 @@ -Extending Monolog -================= - -Monolog is fully extensible, allowing you to adapt your logger to your needs. - -Writing your own handler ------------------------- - -Monolog provides many built-in handlers. But if the one you need does not -exist, you can write it and use it in your logger. The only requirement is -to implement `Monolog\Handler\HandlerInterface`. - -Let's write a PDOHandler to log records to a database. We will extend the -abstract class provided by Monolog to keep things DRY. - -```php -pdo = $pdo; - parent::__construct($level, $bubble); - } - - protected function write(array $record) - { - if (!$this->initialized) { - $this->initialize(); - } - - $this->statement->execute(array( - 'channel' => $record['channel'], - 'level' => $record['level'], - 'message' => $record['formatted'], - 'time' => $record['datetime']->format('U'), - )); - } - - private function initialize() - { - $this->pdo->exec( - 'CREATE TABLE IF NOT EXISTS monolog ' - .'(channel VARCHAR(255), level INTEGER, message LONGTEXT, time INTEGER UNSIGNED)' - ); - $this->statement = $this->pdo->prepare( - 'INSERT INTO monolog (channel, level, message, time) VALUES (:channel, :level, :message, :time)' - ); - - $this->initialized = true; - } -} -``` - -You can now use this handler in your logger: - -```php -pushHandler(new PDOHandler(new PDO('sqlite:logs.sqlite')); - -// You can now use your logger -$logger->addInfo('My logger is now ready'); -``` - -The `Monolog\Handler\AbstractProcessingHandler` class provides most of the -logic needed for the handler, including the use of processors and the formatting -of the record (which is why we use ``$record['formatted']`` instead of ``$record['message']``). diff --git a/vendor/monolog/monolog/doc/sockets.md b/vendor/monolog/monolog/doc/sockets.md deleted file mode 100644 index fad30a9..0000000 --- a/vendor/monolog/monolog/doc/sockets.md +++ /dev/null @@ -1,37 +0,0 @@ -Sockets Handler -=============== - -This handler allows you to write your logs to sockets using [fsockopen](http://php.net/fsockopen) -or [pfsockopen](http://php.net/pfsockopen). - -Persistent sockets are mainly useful in web environments where you gain some performance not closing/opening -the connections between requests. - -Basic Example -------------- - -```php -setPersistent(true); - -// Now add the handler -$logger->pushHandler($handler, Logger::DEBUG); - -// You can now use your logger -$logger->addInfo('My logger is now ready'); - -``` - -In this example, using syslog-ng, you should see the log on the log server: - - cweb1 [2012-02-26 00:12:03] my_logger.INFO: My logger is now ready [] [] - diff --git a/vendor/monolog/monolog/doc/usage.md b/vendor/monolog/monolog/doc/usage.md deleted file mode 100644 index a3cfc7f..0000000 --- a/vendor/monolog/monolog/doc/usage.md +++ /dev/null @@ -1,124 +0,0 @@ -Using Monolog -============= - -Installation ------------- - -Monolog is available on Packagist ([monolog/monolog](http://packagist.org/packages/monolog/monolog)) -and as such installable via [Composer](http://getcomposer.org/). - -If you do not use Composer, you can grab the code from GitHub, and use any -PSR-0 compatible autoloader (e.g. the [Symfony2 ClassLoader component](https://github.com/symfony/ClassLoader)) -to load Monolog classes. - -Configuring a logger --------------------- - -Here is a basic setup to log to a file and to firephp on the DEBUG level: - -```php -pushHandler(new StreamHandler(__DIR__.'/my_app.log', Logger::DEBUG)); -$logger->pushHandler(new FirePHPHandler()); - -// You can now use your logger -$logger->addInfo('My logger is now ready'); -``` - -Let's explain it. The first step is to create the logger instance which will -be used in your code. The argument is a channel name, which is useful when -you use several loggers (see below for more details about it). - -The logger itself does not know how to handle a record. It delegates it to -some handlers. The code above registers two handlers in the stack to allow -handling records in two different ways. - -Note that the FirePHPHandler is called first as it is added on top of the -stack. This allows you to temporarily add a logger with bubbling disabled if -you want to override other configured loggers. - -Adding extra data in the records --------------------------------- - -Monolog provides two different ways to add extra informations along the simple -textual message. - -### Using the logging context - -The first way is the context, allowing to pass an array of data along the -record: - -```php -addInfo('Adding a new user', array('username' => 'Seldaek')); -``` - -Simple handlers (like the StreamHandler for instance) will simply format -the array to a string but richer handlers can take advantage of the context -(FirePHP is able to display arrays in pretty way for instance). - -### Using processors - -The second way is to add extra data for all records by using a processor. -Processors can be any callable. They will get the record as parameter and -must return it after having eventually changed the `extra` part of it. Let's -write a processor adding some dummy data in the record: - -```php -pushProcessor(function ($record) { - $record['extra']['dummy'] = 'Hello world!'; - - return $record; -}); -``` - -Monolog provides some built-in processors that can be used in your project. -Look at the README file for the list. - -> Tip: processors can also be registered on a specific handler instead of - the logger to apply only for this handler. - -Leveraging channels -------------------- - -Channels are a great way to identify to which part of the application a record -is related. This is useful in big applications (and is leveraged by -MonologBundle in Symfony2). You can then easily grep through log files for -example to filter this or that type of log record. - -Using different loggers with the same handlers allow to identify the logger -that issued the record (through the channel name) by keeping the same handlers -(for instance to use a single log file). - -```php -pushHandler($stream); -$logger->pushHandler($firephp); - -// Create a logger for the security-related stuff with a different channel -$securityLogger = new Logger('security'); -$securityLogger->pushHandler($stream); -$securityLogger->pushHandler($firephp); -``` diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php deleted file mode 100644 index 44335b5..0000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -/** - * Formats a log message according to the ChromePHP array format - * - * @author Christophe Coevoet - */ -class ChromePHPFormatter implements FormatterInterface -{ - /** - * Translates Monolog log levels to Wildfire levels. - */ - private $logLevels = array( - Logger::DEBUG => 'log', - Logger::INFO => 'info', - Logger::WARNING => 'warn', - Logger::ERROR => 'error', - Logger::CRITICAL => 'error', - Logger::ALERT => 'error', - ); - - /** - * {@inheritdoc} - */ - public function format(array $record) - { - // Retrieve the line and file if set and remove them from the formatted extra - $backtrace = 'unknown'; - if (isset($record['extra']['file']) && isset($record['extra']['line'])) { - $backtrace = $record['extra']['file'].' : '.$record['extra']['line']; - unset($record['extra']['file']); - unset($record['extra']['line']); - } - - $message = array('message' => $record['message']); - if ($record['context']) { - $message['context'] = $record['context']; - } - if ($record['extra']) { - $message['extra'] = $record['extra']; - } - if (count($message) === 1) { - $message = reset($message); - } - - return array( - $record['channel'], - $message, - $backtrace, - $this->logLevels[$record['level']], - ); - } - - public function formatBatch(array $records) - { - $formatted = array(); - - foreach ($records as $record) { - $formatted[] = $this->format($record); - } - - return $formatted; - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php b/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php deleted file mode 100644 index 77891de..0000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -/** - * Interface for formatters - * - * @author Jordi Boggiano - */ -interface FormatterInterface -{ - /** - * Formats a log record. - * - * @param array $record A record to format - * @return mixed The formatted record - */ - function format(array $record); - - /** - * Formats a set of log records. - * - * @param array $records A set of records to format - * @return mixed The formatted set of records - */ - function formatBatch(array $records); -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php deleted file mode 100644 index 95c17ad..0000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; -use Gelf\Message; - -/** - * Serializes a log message according to Wildfire's header requirements - * - * @author Matt Lehner - */ -class GelfMessageFormatter extends NormalizerFormatter -{ - /** - * @var string the name of the system for the Gelf log message - */ - protected $systemName; - - /** - * @var string a prefix for 'extra' fields from the Monolog record (optional) - */ - protected $extraPrefix; - - /** - * @var string a prefix for 'context' fields from the Monolog record (optional) - */ - protected $contextPrefix; - - /** - * Translates Monolog log levels to Graylog2 log priorities. - */ - private $logLevels = array( - Logger::DEBUG => LOG_DEBUG, - Logger::INFO => LOG_INFO, - Logger::WARNING => LOG_WARNING, - Logger::ERROR => LOG_ERR, - Logger::CRITICAL => LOG_CRIT, - Logger::ALERT => LOG_ALERT, - ); - - public function __construct($systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_') - { - parent::__construct('U.u'); - - $this->systemName = $systemName ?: gethostname(); - - $this->extraPrefix = $extraPrefix; - $this->contextPrefix = $contextPrefix; - } - - /** - * {@inheritdoc} - */ - public function format(array $record) - { - $record = parent::format($record); - $message = new Message(); - $message - ->setTimestamp($record['datetime']) - ->setShortMessage((string) $record['message']) - ->setFacility($record['channel']) - ->setHost($this->systemName) - ->setLine(isset($record['extra']['line']) ? $record['extra']['line'] : null) - ->setFile(isset($record['extra']['file']) ? $record['extra']['file'] : null) - ->setLevel($this->logLevels[$record['level']]); - - // Do not duplicate these values in the additional fields - unset($record['extra']['line']); - unset($record['extra']['file']); - - foreach ($record['extra'] as $key => $val) { - $message->setAdditional($this->extraPrefix . $key, is_scalar($val) ? $val : $this->toJson($val)); - } - - foreach ($record['context'] as $key => $val) { - $message->setAdditional($this->contextPrefix . $key, is_scalar($val) ? $val : $this->toJson($val)); - } - - return $message; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php deleted file mode 100644 index ab20179..0000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -/** - * Encodes whatever record data is passed to it as json - * - * This can be useful to log to databases or remote APIs - * - * @author Jordi Boggiano - */ -class JsonFormatter implements FormatterInterface -{ - /** - * {@inheritdoc} - */ - public function format(array $record) - { - return json_encode($record); - } - - /** - * {@inheritdoc} - */ - public function formatBatch(array $records) - { - return json_encode($records); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php deleted file mode 100644 index 61d3b8c..0000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -/** - * Formats incoming records into a one-line string - * - * This is especially useful for logging to files - * - * @author Jordi Boggiano - * @author Christophe Coevoet - */ -class LineFormatter extends NormalizerFormatter -{ - const SIMPLE_FORMAT = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"; - - protected $format; - - /** - * @param string $format The format of the message - * @param string $dateFormat The format of the timestamp: one supported by DateTime::format - */ - public function __construct($format = null, $dateFormat = null) - { - $this->format = $format ?: static::SIMPLE_FORMAT; - parent::__construct($dateFormat); - } - - /** - * {@inheritdoc} - */ - public function format(array $record) - { - $vars = parent::format($record); - - $output = $this->format; - foreach ($vars['extra'] as $var => $val) { - if (false !== strpos($output, '%extra.'.$var.'%')) { - $output = str_replace('%extra.'.$var.'%', $this->convertToString($val), $output); - unset($vars['extra'][$var]); - } - } - foreach ($vars as $var => $val) { - $output = str_replace('%'.$var.'%', $this->convertToString($val), $output); - } - - return $output; - } - - public function formatBatch(array $records) - { - $message = ''; - foreach ($records as $record) { - $message .= $this->format($record); - } - - return $message; - } - - protected function normalize($data) - { - if (is_bool($data) || is_null($data)) { - return var_export($data, true); - } - - return parent::normalize($data); - } - - protected function convertToString($data) - { - if (null === $data || is_scalar($data)) { - return (string) $data; - } - - if (version_compare(PHP_VERSION, '5.4.0', '>=')) { - return json_encode($this->normalize($data), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); - } - - return stripslashes(json_encode($this->normalize($data))); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php deleted file mode 100644 index 09cadb7..0000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -/** - * Normalizes incoming records to remove objects/resources so it's easier to dump to various targets - * - * @author Jordi Boggiano - */ -class NormalizerFormatter implements FormatterInterface -{ - const SIMPLE_DATE = "Y-m-d H:i:s"; - - protected $dateFormat; - - /** - * @param string $dateFormat The format of the timestamp: one supported by DateTime::format - */ - public function __construct($dateFormat = null) - { - $this->dateFormat = $dateFormat ?: static::SIMPLE_DATE; - } - - /** - * {@inheritdoc} - */ - public function format(array $record) - { - return $this->normalize($record); - } - - /** - * {@inheritdoc} - */ - public function formatBatch(array $records) - { - foreach ($records as $key => $record) { - $records[$key] = $this->format($record); - } - - return $records; - } - - protected function normalize($data) - { - if (null === $data || is_scalar($data)) { - return $data; - } - - if (is_array($data) || $data instanceof \Traversable) { - $normalized = array(); - - foreach ($data as $key => $value) { - $normalized[$key] = $this->normalize($value); - } - - return $normalized; - } - - if ($data instanceof \DateTime) { - return $data->format($this->dateFormat); - } - - if (is_resource($data)) { - return '[resource]'; - } - - return sprintf("[object] (%s: %s)", get_class($data), $this->toJson($data)); - } - - protected function toJson($data) - { - if (version_compare(PHP_VERSION, '5.4.0', '>=')) { - return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); - } - - return json_encode($data); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php deleted file mode 100644 index 4c393a9..0000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -/** - * Serializes a log message according to Wildfire's header requirements - * - * @author Eric Clemmons (@ericclemmons) - * @author Christophe Coevoet - * @author Kirill chEbba Chebunin - */ -class WildfireFormatter implements FormatterInterface -{ - /** - * Translates Monolog log levels to Wildfire levels. - */ - private $logLevels = array( - Logger::DEBUG => 'LOG', - Logger::INFO => 'INFO', - Logger::WARNING => 'WARN', - Logger::ERROR => 'ERROR', - Logger::CRITICAL => 'ERROR', - Logger::ALERT => 'ERROR', - ); - - /** - * {@inheritdoc} - */ - public function format(array $record) - { - // Retrieve the line and file if set and remove them from the formatted extra - $file = $line = ''; - if (isset($record['extra']['file'])) { - $file = $record['extra']['file']; - unset($record['extra']['file']); - } - if (isset($record['extra']['line'])) { - $line = $record['extra']['line']; - unset($record['extra']['line']); - } - - $message = array('message' => $record['message']); - if ($record['context']) { - $message['context'] = $record['context']; - } - if ($record['extra']) { - $message['extra'] = $record['extra']; - } - if (count($message) === 1) { - $message = reset($message); - } - - // Create JSON object describing the appearance of the message in the console - $json = json_encode(array( - array( - 'Type' => $this->logLevels[$record['level']], - 'File' => $file, - 'Line' => $line, - 'Label' => $record['channel'], - ), - $message, - )); - - // The message itself is a serialization of the above JSON object + it's length - return sprintf( - '%s|%s|', - strlen($json), - $json - ); - } - - public function formatBatch(array $records) - { - throw new \BadMethodCallException('Batch formatting does not make sense for the WildfireFormatter'); - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php deleted file mode 100644 index 1349c25..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php +++ /dev/null @@ -1,173 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\LineFormatter; - -/** - * Base Handler class providing the Handler structure - * - * @author Jordi Boggiano - */ -abstract class AbstractHandler implements HandlerInterface -{ - protected $level = Logger::DEBUG; - protected $bubble = false; - - /** - * @var FormatterInterface - */ - protected $formatter; - protected $processors = array(); - - /** - * @param integer $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($level = Logger::DEBUG, $bubble = true) - { - $this->level = $level; - $this->bubble = $bubble; - } - - /** - * {@inheritdoc} - */ - public function isHandling(array $record) - { - return $record['level'] >= $this->level; - } - - /** - * {@inheritdoc} - */ - public function handleBatch(array $records) - { - foreach ($records as $record) { - $this->handle($record); - } - } - - /** - * Closes the handler. - * - * This will be called automatically when the object is destroyed - */ - public function close() - { - } - - /** - * {@inheritdoc} - */ - public function pushProcessor($callback) - { - if (!is_callable($callback)) { - throw new \InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given'); - } - array_unshift($this->processors, $callback); - } - - /** - * {@inheritdoc} - */ - public function popProcessor() - { - if (!$this->processors) { - throw new \LogicException('You tried to pop from an empty processor stack.'); - } - return array_shift($this->processors); - } - - /** - * {@inheritdoc} - */ - public function setFormatter(FormatterInterface $formatter) - { - $this->formatter = $formatter; - } - - /** - * {@inheritdoc} - */ - public function getFormatter() - { - if (!$this->formatter) { - $this->formatter = $this->getDefaultFormatter(); - } - - return $this->formatter; - } - - /** - * Sets minimum logging level at which this handler will be triggered. - * - * @param integer $level - */ - public function setLevel($level) - { - $this->level = $level; - } - - /** - * Gets minimum logging level at which this handler will be triggered. - * - * @return integer - */ - public function getLevel() - { - return $this->level; - } - - /** - * Sets the bubbling behavior. - * - * @param Boolean $bubble True means that bubbling is not permitted. - * False means that this handler allows bubbling. - */ - public function setBubble($bubble) - { - $this->bubble = $bubble; - } - - /** - * Gets the bubbling behavior. - * - * @return Boolean True means that bubbling is not permitted. - * False means that this handler allows bubbling. - */ - public function getBubble() - { - return $this->bubble; - } - - public function __destruct() - { - try { - $this->close(); - } catch(\Exception $e) { - // do nothing - } - } - - /** - * Gets the default formatter. - * - * @return FormatterInterface - */ - protected function getDefaultFormatter() - { - return new LineFormatter(); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php deleted file mode 100644 index 9babe03..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\LineFormatter; - -/** - * Base Handler class providing the Handler structure - * - * Classes extending it should (in most cases) only implement write($record) - * - * @author Jordi Boggiano - * @author Christophe Coevoet - */ -abstract class AbstractProcessingHandler extends AbstractHandler -{ - /** - * {@inheritdoc} - */ - public function handle(array $record) - { - if ($record['level'] < $this->level) { - return false; - } - - $record = $this->processRecord($record); - - $record['formatted'] = $this->getFormatter()->format($record); - - $this->write($record); - - return false === $this->bubble; - } - - /** - * Writes the record down to the log of the implementing handler - * - * @param array $record - * @return void - */ - abstract protected function write(array $record); - - /** - * Processes a record. - * - * @param array $record - * @return array - */ - protected function processRecord(array $record) - { - if ($this->processors) { - foreach ($this->processors as $processor) { - $record = call_user_func($processor, $record); - } - } - - return $record; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php deleted file mode 100644 index 7031607..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Buffers all records until closing the handler and then pass them as batch. - * - * This is useful for a MailHandler to send only one mail per request instead of - * sending one per log message. - * - * @author Christophe Coevoet - */ -class BufferHandler extends AbstractHandler -{ - protected $handler; - protected $bufferSize; - protected $buffer = array(); - - /** - * @param HandlerInterface $handler Handler. - * @param integer $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. - * @param integer $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct(HandlerInterface $handler, $bufferSize = 0, $level = Logger::DEBUG, $bubble = true) - { - parent::__construct($level, $bubble); - $this->handler = $handler; - $this->bufferSize = $bufferSize; - } - - /** - * {@inheritdoc} - */ - public function handle(array $record) - { - if ($record['level'] < $this->level) { - return false; - } - - $this->buffer[] = $record; - if ($this->bufferSize > 0 && count($this->buffer) > $this->bufferSize) { - array_shift($this->buffer); - } - - return false === $this->bubble; - } - - /** - * {@inheritdoc} - */ - public function close() - { - $this->handler->handleBatch($this->buffer); - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php deleted file mode 100644 index 4d7ae8c..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php +++ /dev/null @@ -1,127 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\ChromePHPFormatter; - -/** - * Handler sending logs to the ChromePHP extension (http://www.chromephp.com/) - * - * @author Christophe Coevoet - */ -class ChromePHPHandler extends AbstractProcessingHandler -{ - /** - * Version of the extension - */ - const VERSION = '3.0'; - - /** - * Header name - */ - const HEADER_NAME = 'X-ChromePhp-Data'; - - static protected $initialized = false; - - static protected $json = array( - 'version' => self::VERSION, - 'columns' => array('label', 'log', 'backtrace', 'type'), - 'rows' => array(), - ); - - protected $sendHeaders = true; - - /** - * {@inheritdoc} - */ - public function handleBatch(array $records) - { - $messages = array(); - - foreach ($records as $record) { - if ($record['level'] < $this->level) { - continue; - } - $messages[] = $this->processRecord($record); - } - - if (!empty($messages)) { - $messages = $this->getFormatter()->formatBatch($messages); - self::$json['rows'] = array_merge(self::$json['rows'], $messages); - $this->send(); - } - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter() - { - return new ChromePHPFormatter(); - } - - /** - * Creates & sends header for a record - * - * @see sendHeader() - * @see send() - * @param array $record - */ - protected function write(array $record) - { - self::$json['rows'][] = $record['formatted']; - - $this->send(); - } - - /** - * Sends the log header - * - * @see sendHeader() - */ - protected function send() - { - if (!self::$initialized) { - $this->sendHeaders = $this->headersAccepted(); - self::$json['request_uri'] = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; - - self::$initialized = true; - } - - $this->sendHeader(self::HEADER_NAME, base64_encode(utf8_encode(json_encode(self::$json)))); - } - - /** - * Send header string to the client - * - * @param string $header - * @param string $content - */ - protected function sendHeader($header, $content) - { - if (!headers_sent() && $this->sendHeaders) { - header(sprintf('%s: %s', $header, $content)); - } - } - - /** - * Verifies if the headers are accepted by the current user agent - * - * @return Boolean - */ - protected function headersAccepted() - { - return !isset($_SERVER['HTTP_USER_AGENT']) - || preg_match('{\bChrome/\d+[\.\d+]*\b}', $_SERVER['HTTP_USER_AGENT']); - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php b/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php deleted file mode 100644 index 54b9a8d..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler\FingersCrossed; - -/** - * Interface for activation strategies for the FingersCrossedHandler. - * - * @author Johannes M. Schmitt - */ -interface ActivationStrategyInterface -{ - /** - * Returns whether the given record activates the handler. - * - * @param array $record - * @return Boolean - */ - function isHandlerActivated(array $record); -} \ No newline at end of file diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php b/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php deleted file mode 100644 index 2cfe6dd..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler\FingersCrossed; - -/** - * Error level based activation strategy. - * - * @author Johannes M. Schmitt - */ -class ErrorLevelActivationStrategy implements ActivationStrategyInterface -{ - private $actionLevel; - - public function __construct($actionLevel) - { - $this->actionLevel = $actionLevel; - } - - public function isHandlerActivated(array $record) - { - return $record['level'] >= $this->actionLevel; - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php deleted file mode 100644 index 3731fa8..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy; -use Monolog\Handler\FingersCrossed\ActivationStrategyInterface; -use Monolog\Logger; - -/** - * Buffers all records until a certain level is reached - * - * The advantage of this approach is that you don't get any clutter in your log files. - * Only requests which actually trigger an error (or whatever your actionLevel is) will be - * in the logs, but they will contain all records, not only those above the level threshold. - * - * @author Jordi Boggiano - */ -class FingersCrossedHandler extends AbstractHandler -{ - protected $handler; - protected $activationStrategy; - protected $buffering = true; - protected $bufferSize; - protected $buffer = array(); - protected $stopBuffering; - - /** - * @param callback|HandlerInterface $handler Handler or factory callback($record, $fingersCrossedHandler). - * @param int|ActivationStrategyInterface $activationStrategy Strategy which determines when this handler takes action - * @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - * @param Boolean $stopBuffering Whether the handler should stop buffering after being triggered (default true) - */ - public function __construct($handler, $activationStrategy = null, $bufferSize = 0, $bubble = true, $stopBuffering = true) - { - if (null === $activationStrategy) { - $activationStrategy = new ErrorLevelActivationStrategy(Logger::WARNING); - } - if (!$activationStrategy instanceof ActivationStrategyInterface) { - $activationStrategy = new ErrorLevelActivationStrategy($activationStrategy); - } - - $this->handler = $handler; - $this->activationStrategy = $activationStrategy; - $this->bufferSize = $bufferSize; - $this->bubble = $bubble; - $this->stopBuffering = $stopBuffering; - } - - /** - * {@inheritdoc} - */ - public function isHandling(array $record) - { - return true; - } - - /** - * {@inheritdoc} - */ - public function handle(array $record) - { - if ($this->buffering) { - $this->buffer[] = $record; - if ($this->bufferSize > 0 && count($this->buffer) > $this->bufferSize) { - array_shift($this->buffer); - } - if ($this->activationStrategy->isHandlerActivated($record)) { - if ($this->stopBuffering) { - $this->buffering = false; - } - if (!$this->handler instanceof HandlerInterface) { - $this->handler = call_user_func($this->handler, $record, $this); - } - if (!$this->handler instanceof HandlerInterface) { - throw new \RuntimeException("The factory callback should return a HandlerInterface"); - } - $this->handler->handleBatch($this->buffer); - $this->buffer = array(); - } - } else { - $this->handler->handle($record); - } - - return false === $this->bubble; - } - - /** - * Resets the state of the handler. Stops forwarding records to the wrapped handler. - */ - public function reset() - { - $this->buffering = true; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php deleted file mode 100644 index 8cc10e9..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php +++ /dev/null @@ -1,161 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\WildfireFormatter; - -/** - * Simple FirePHP Handler (http://www.firephp.org/), which uses the Wildfire protocol. - * - * @author Eric Clemmons (@ericclemmons) - */ -class FirePHPHandler extends AbstractProcessingHandler -{ - /** - * WildFire JSON header message format - */ - const PROTOCOL_URI = 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2'; - - /** - * FirePHP structure for parsing messages & their presentation - */ - const STRUCTURE_URI = 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1'; - - /** - * Must reference a "known" plugin, otherwise headers won't display in FirePHP - */ - const PLUGIN_URI = 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3'; - - /** - * Header prefix for Wildfire to recognize & parse headers - */ - const HEADER_PREFIX = 'X-Wf'; - - /** - * Whether or not Wildfire vendor-specific headers have been generated & sent yet - */ - protected static $initialized = false; - - /** - * Shared static message index between potentially multiple handlers - * @var int - */ - protected static $messageIndex = 1; - - protected $sendHeaders = true; - - /** - * Base header creation function used by init headers & record headers - * - * @param array $meta Wildfire Plugin, Protocol & Structure Indexes - * @param string $message Log message - * @return array Complete header string ready for the client as key and message as value - */ - protected function createHeader(array $meta, $message) - { - $header = sprintf('%s-%s', self::HEADER_PREFIX, join('-', $meta)); - - return array($header => $message); - } - - /** - * Creates message header from record - * - * @see createHeader() - * @param array $record - * @return string - */ - protected function createRecordHeader(array $record) - { - // Wildfire is extensible to support multiple protocols & plugins in a single request, - // but we're not taking advantage of that (yet), so we're using "1" for simplicity's sake. - return $this->createHeader( - array(1, 1, 1, self::$messageIndex++), - $record['formatted'] - ); - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter() - { - return new WildfireFormatter(); - } - - /** - * Wildfire initialization headers to enable message parsing - * - * @see createHeader() - * @see sendHeader() - * @return array - */ - protected function getInitHeaders() - { - // Initial payload consists of required headers for Wildfire - return array_merge( - $this->createHeader(array('Protocol', 1), self::PROTOCOL_URI), - $this->createHeader(array(1, 'Structure', 1), self::STRUCTURE_URI), - $this->createHeader(array(1, 'Plugin', 1), self::PLUGIN_URI) - ); - } - - /** - * Send header string to the client - * - * @param string $header - * @param string $content - */ - protected function sendHeader($header, $content) - { - if (!headers_sent() && $this->sendHeaders) { - header(sprintf('%s: %s', $header, $content)); - } - } - - /** - * Creates & sends header for a record, ensuring init headers have been sent prior - * - * @see sendHeader() - * @see sendInitHeaders() - * @param array $record - */ - protected function write(array $record) - { - // WildFire-specific headers must be sent prior to any messages - if (!self::$initialized) { - $this->sendHeaders = $this->headersAccepted(); - - foreach ($this->getInitHeaders() as $header => $content) { - $this->sendHeader($header, $content); - } - - self::$initialized = true; - } - - $header = $this->createRecordHeader($record); - $this->sendHeader(key($header), current($header)); - } - - /** - * Verifies if the headers are accepted by the current user agent - * - * @return Boolean - */ - protected function headersAccepted() - { - return !isset($_SERVER['HTTP_USER_AGENT']) - || preg_match('{\bFirePHP/\d+\.\d+\b}', $_SERVER['HTTP_USER_AGENT']) - || isset($_SERVER['HTTP_X_FIREPHP_VERSION']); - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php deleted file mode 100644 index 7346029..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Gelf\IMessagePublisher; -use Monolog\Logger; -use Monolog\Handler\AbstractProcessingHandler; -use Monolog\Formatter\GelfMessageFormatter; - -/** - * Handler to send messages to a Graylog2 (http://www.graylog2.org) server - * - * @author Matt Lehner - */ -class GelfHandler extends AbstractProcessingHandler -{ - /** - * @var Gelf\IMessagePublisher the publisher object that sends the message to the server - */ - protected $publisher; - - /** - * @param Gelf\IMessagePublisher $publisher a publisher object - * @param integer $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct(IMessagePublisher $publisher, $level = Logger::DEBUG, $bubble = true) - { - parent::__construct($level, $bubble); - - $this->publisher = $publisher; - } - - /** - * {@inheritdoc} - */ - public function close() - { - $this->publisher = null; - } - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - $this->publisher->publish($record['formatted']); - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter() - { - return new GelfMessageFormatter(); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php deleted file mode 100644 index c94c52f..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -/** - * Forwards records to multiple handlers - * - * @author Lenar Lõhmus - */ -class GroupHandler extends AbstractHandler -{ - protected $handlers; - - /** - * @param array $handlers Array of Handlers. - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct(array $handlers, $bubble = true) - { - foreach ($handlers as $handler) { - if (!$handler instanceof HandlerInterface) { - throw new \InvalidArgumentException('The first argument of the GroupHandler must be an array of HandlerInterface instances.'); - } - } - - $this->handlers = $handlers; - $this->bubble = $bubble; - } - - /** - * {@inheritdoc} - */ - public function isHandling(array $record) - { - foreach ($this->handlers as $handler) { - if ($handler->isHandling($record)) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function handle(array $record) - { - foreach ($this->handlers as $handler) { - $handler->handle($record); - } - - return false === $this->bubble; - } - - /** - * {@inheritdoc} - */ - public function handleBatch(array $records) - { - foreach ($this->handlers as $handler) { - $handler->handleBatch($records); - } - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php b/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php deleted file mode 100644 index 24f82d7..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\FormatterInterface; - -/** - * Interface that all Monolog Handlers must implement - * - * @author Jordi Boggiano - */ -interface HandlerInterface -{ - /** - * Checks whether the given record will be handled by this handler. - * - * This is mostly done for performance reasons, to avoid calling processors for nothing. - * - * @return Boolean - */ - function isHandling(array $record); - - /** - * Handles a record. - * - * The return value of this function controls the bubbling process of the handler stack. - * - * @param array $record The record to handle - * @return Boolean True means that this handler handled the record, and that bubbling is not permitted. - * False means the record was either not processed or that this handler allows bubbling. - */ - function handle(array $record); - - /** - * Handles a set of records at once. - * - * @param array $records The records to handle (an array of record arrays) - */ - function handleBatch(array $records); - - /** - * Adds a processor in the stack. - * - * @param callable $callback - */ - function pushProcessor($callback); - - /** - * Removes the processor on top of the stack and returns it. - * - * @return callable - */ - function popProcessor(); - - /** - * Sets the formatter. - * - * @param FormatterInterface $formatter - */ - function setFormatter(FormatterInterface $formatter); - - /** - * Gets the formatter. - * - * @return FormatterInterface - */ - function getFormatter(); -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php deleted file mode 100644 index 94ed841..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -/** - * Base class for all mail handlers - * - * @author Gyula Sallai - */ -abstract class MailHandler extends AbstractProcessingHandler -{ - /** - * {@inheritdoc} - */ - public function handleBatch(array $records) - { - $messages = array(); - - foreach ($records as $record) { - if ($record['level'] < $this->level) { - continue; - } - $messages[] = $this->processRecord($record); - } - - if (!empty($messages)) { - $this->send((string) $this->getFormatter()->formatBatch($messages), $messages); - } - } - - /** - * Send a mail with the given content - * - * @param string $content - * @param array $records the array of log records that formed this content - */ - abstract protected function send($content, array $records); - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - $this->send((string) $record['formatted'], array($record)); - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php deleted file mode 100644 index 210bb19..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\NormalizerFormatter; - -/** - * Logs to a MongoDB database. - * - * usage example: - * - * $log = new Logger('application'); - * $mongodb = new MongoDBHandler(new \Mongo("mongodb://localhost:27017"), "logs", "prod"); - * $log->pushHandler($mongodb); - * - * @author Thomas Tourlourat - */ -class MongoDBHandler extends AbstractProcessingHandler -{ - private $mongoCollection; - - public function __construct(\Mongo $mongo, $database, $collection, $level = Logger::DEBUG, $bubble = true) - { - $this->mongoCollection = $mongo->selectCollection($database, $collection); - - parent::__construct($level, $bubble); - } - - protected function write(array $record) - { - $this->mongoCollection->save($record["formatted"]); - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter() - { - return new NormalizerFormatter(); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php deleted file mode 100644 index 6933ff6..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * NativeMailerHandler uses the mail() function to send the emails - * - * @author Christophe Coevoet - */ -class NativeMailerHandler extends MailHandler -{ - protected $to; - protected $subject; - protected $headers; - - /** - * @param string $to The receiver of the mail - * @param string $subject The subject of the mail - * @param string $from The sender of the mail - * @param integer $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($to, $subject, $from, $level = Logger::ERROR, $bubble = true) - { - parent::__construct($level, $bubble); - $this->to = $to; - $this->subject = $subject; - $this->headers = sprintf("From: %s\r\nContent-type: text/plain; charset=utf-8\r\n", $from); - } - - /** - * {@inheritdoc} - */ - protected function send($content, array $records) - { - mail($this->to, $this->subject, wordwrap($content, 70), $this->headers); - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php deleted file mode 100644 index 7caf4a2..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Blackhole - * - * Any record it can handle will be thrown away. This can be used - * to put on top of an existing stack to override it temporarily. - * - * @author Jordi Boggiano - */ -class NullHandler extends AbstractHandler -{ - /** - * @param integer $level The minimum logging level at which this handler will be triggered - */ - public function __construct($level = Logger::DEBUG) - { - parent::__construct($level, false); - } - - /** - * {@inheritdoc} - */ - public function handle(array $record) - { - if ($record['level'] < $this->level) { - return false; - } - - return true; - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php deleted file mode 100644 index ebecd56..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Stores logs to files that are rotated every day and a limited number of files are kept. - * - * This rotation is only intended to be used as a workaround. Using logrotate to - * handle the rotation is strongly encouraged when you can use it. - * - * @author Christophe Coevoet - */ -class RotatingFileHandler extends StreamHandler -{ - protected $filename; - protected $maxFiles; - protected $mustRotate; - - /** - * @param string $filename - * @param integer $maxFiles The maximal amount of files to keep (0 means unlimited) - * @param integer $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true) - { - $this->filename = $filename; - $this->maxFiles = (int) $maxFiles; - - $fileInfo = pathinfo($this->filename); - $timedFilename = $fileInfo['dirname'].'/'.$fileInfo['filename'].'-'.date('Y-m-d'); - if (!empty($fileInfo['extension'])) { - $timedFilename .= '.'.$fileInfo['extension']; - } - - // disable rotation upfront if files are unlimited - if (0 === $this->maxFiles) { - $this->mustRotate = false; - } - - parent::__construct($timedFilename, $level, $bubble); - } - - /** - * {@inheritdoc} - */ - public function close() - { - parent::close(); - - if (true === $this->mustRotate) { - $this->rotate(); - } - } - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - // on the first record written, if the log is new, we should rotate (once per day) - if (null === $this->mustRotate) { - $this->mustRotate = !file_exists($this->url); - } - - parent::write($record); - } - - /** - * Rotates the files. - */ - protected function rotate() - { - $fileInfo = pathinfo($this->filename); - $glob = $fileInfo['dirname'].'/'.$fileInfo['filename'].'-*'; - if (!empty($fileInfo['extension'])) { - $glob .= '.'.$fileInfo['extension']; - } - $iterator = new \GlobIterator($glob); - $count = $iterator->count(); - if ($this->maxFiles >= $count) { - // no files to remove - return; - } - - // Sorting the files by name to remove the older ones - $array = iterator_to_array($iterator); - usort($array, function($a, $b) { - return strcmp($b->getFilename(), $a->getFilename()); - }); - - foreach (array_slice($array, $this->maxFiles) as $file) { - if ($file->isWritable()) { - unlink($file->getRealPath()); - } - } - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php deleted file mode 100644 index b44fad7..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php +++ /dev/null @@ -1,272 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Stores to any socket - uses fsockopen() or pfsockopen(). - * - * @author Pablo de Leon Belloc - * @see http://php.net/manual/en/function.fsockopen.php - */ -class SocketHandler extends AbstractProcessingHandler -{ - private $connectionString; - private $connectionTimeout; - private $resource; - private $timeout = 0; - private $persistent = false; - private $errno; - private $errstr; - - /** - * @param string $connectionString Socket connection string - * @param integer $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($connectionString, $level = Logger::DEBUG, $bubble = true) - { - parent::__construct($level, $bubble); - $this->connectionString = $connectionString; - $this->connectionTimeout = (float) ini_get('default_socket_timeout'); - } - - /** - * Connect (if necessary) and write to the socket - * - * @param array $record - * - * @throws \UnexpectedValueException - * @throws \RuntimeException - */ - public function write(array $record) - { - $this->connectIfNotConnected(); - $this->writeToSocket((string) $record['formatted']); - } - - /** - * We will not close a PersistentSocket instance so it can be reused in other requests. - */ - public function close() - { - if (!$this->isPersistent()) { - $this->closeSocket(); - } - } - - /** - * Close socket, if open - */ - public function closeSocket() - { - if (is_resource($this->resource)) { - fclose($this->resource); - $this->resource = null; - } - } - - /** - * Set socket connection to nbe persistent. It only has effect before the connection is initiated. - * - * @param type $boolean - */ - public function setPersistent($boolean) - { - $this->persistent = (boolean) $boolean; - } - - /** - * Set connection timeout. Only has effect before we connect. - * - * @param integer $seconds - * - * @see http://php.net/manual/en/function.fsockopen.php - */ - public function setConnectionTimeout($seconds) - { - $this->validateTimeout($seconds); - $this->connectionTimeout = (float) $seconds; - } - - /** - * Set write timeout. Only has effect before we connect. - * - * @param type $seconds - * - * @see http://php.net/manual/en/function.stream-set-timeout.php - */ - public function setTimeout($seconds) - { - $this->validateTimeout($seconds); - $this->timeout = (int) $seconds; - } - - /** - * Get current connection string - * - * @return string - */ - public function getConnectionString() - { - return $this->connectionString; - } - - /** - * Get persistent setting - * - * @return boolean - */ - public function isPersistent() - { - return $this->persistent; - } - - /** - * Get current connection timeout setting - * - * @return float - */ - public function getConnectionTimeout() - { - return $this->connectionTimeout; - } - - /** - * Get current in-transfer timeout - * - * @return float - */ - public function getTimeout() - { - return $this->timeout; - } - - /** - * Check to see if the socket is currently available. - * - * UDP might appear to be connected but might fail when writing. See http://php.net/fsockopen for details. - * - * @return boolean - */ - public function isConnected() - { - return is_resource($this->resource) - && !feof($this->resource); // on TCP - other party can close connection. - } - - /** - * Wrapper to allow mocking - */ - protected function pfsockopen() - { - return @pfsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeout); - } - - /** - * Wrapper to allow mocking - */ - protected function fsockopen() - { - return @fsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeout); - } - - /** - * Wrapper to allow mocking - */ - protected function streamSetTimeout() - { - return stream_set_timeout($this->resource, $this->timeout); - } - - /** - * Wrapper to allow mocking - */ - protected function fwrite($data) - { - return @fwrite($this->resource, $data); - } - - /** - * Wrapper to allow mocking - */ - protected function streamGetMetadata() - { - return stream_get_meta_data($this->resource); - } - - private function validateTimeout($value) - { - $ok = filter_var($value, FILTER_VALIDATE_INT, array('options' => array( - 'min_range' => 0, - ))); - if ($ok === false) { - throw new \InvalidArgumentException("Timeout must be 0 or a positive integer (got $value)"); - } - } - - private function connectIfNotConnected() - { - if ($this->isConnected()) { - return; - } - $this->connect(); - } - - private function connect() - { - $this->createSocketResource(); - $this->setSocketTimeout(); - } - - private function createSocketResource() - { - if ($this->isPersistent()) { - $resource = $this->pfsockopen(); - } else { - $resource = $this->fsockopen(); - } - if (!$resource) { - throw new \UnexpectedValueException("Failed connecting to $this->connectionString ($this->errno: $this->errstr)"); - } - $this->resource = $resource; - } - - private function setSocketTimeout() - { - if (!$this->streamSetTimeout()) { - throw new \UnexpectedValueException("Failed setting timeout with stream_set_timeout()"); - } - } - - private function writeToSocket($data) - { - $length = strlen($data); - $sent = 0; - while ($this->isConnected() && $sent < $length) { - $chunk = $this->fwrite(substr($data, $sent)); - if ($chunk === false) { - throw new \RuntimeException("Could not write to socket"); - } - $sent += $chunk; - $socketInfo = $this->streamGetMetadata(); - if ($socketInfo['timed_out']) { - throw new \RuntimeException("Write timed-out"); - } - } - if (!$this->isConnected() && $sent < $length) { - throw new \RuntimeException("End-of-file reached, probably we got disconnected (sent $sent of $length)"); - } - } - -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php deleted file mode 100644 index 5593054..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Stores to any stream resource - * - * Can be used to store into php://stderr, remote and local files, etc. - * - * @author Jordi Boggiano - */ -class StreamHandler extends AbstractProcessingHandler -{ - protected $stream; - protected $url; - - /** - * @param string $stream - * @param integer $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($stream, $level = Logger::DEBUG, $bubble = true) - { - parent::__construct($level, $bubble); - if (is_resource($stream)) { - $this->stream = $stream; - } else { - $this->url = $stream; - } - } - - /** - * {@inheritdoc} - */ - public function close() - { - if (is_resource($this->stream)) { - fclose($this->stream); - } - $this->stream = null; - } - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - if (null === $this->stream) { - if (!$this->url) { - throw new \LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().'); - } - $this->stream = @fopen($this->url, 'a'); - if (!is_resource($this->stream)) { - $this->stream = null; - throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened; it may be invalid or not writable.', $this->url)); - } - } - fwrite($this->stream, (string) $record['formatted']); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php deleted file mode 100644 index addc4c4..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * SwiftMailerHandler uses Swift_Mailer to send the emails - * - * @author Gyula Sallai - */ -class SwiftMailerHandler extends MailHandler -{ - protected $mailer; - protected $message; - - /** - * @param \Swift_Mailer $mailer The mailer to use - * @param callback|\Swift_Message $message An example message for real messages, only the body will be replaced - * @param integer $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct(\Swift_Mailer $mailer, $message, $level = Logger::ERROR, $bubble = true) - { - parent::__construct($level, $bubble); - $this->mailer = $mailer; - if (!$message instanceof \Swift_Message && is_callable($message)) { - $message = call_user_func($message); - } - if (!$message instanceof \Swift_Message) { - throw new \InvalidArgumentException('You must provide either a Swift_Message instance or a callback returning it'); - } - $this->message = $message; - } - - /** - * {@inheritdoc} - */ - protected function send($content, array $records) - { - $message = clone $this->message; - $message->setBody($content); - - $this->mailer->send($message); - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php deleted file mode 100644 index 444a592..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php +++ /dev/null @@ -1,108 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Logs to syslog service. - * - * usage example: - * - * $log = new Logger('application'); - * $syslog = new SyslogHandler('myfacility', 'local6'); - * $formatter = new LineFormatter("%channel%.%level_name%: %message% %extra%"); - * $syslog->setFormatter($formatter); - * $log->pushHandler($syslog); - * - * @author Sven Paulus - */ -class SyslogHandler extends AbstractProcessingHandler -{ - /** - * Translates Monolog log levels to syslog log priorities. - */ - private $logLevels = array( - Logger::DEBUG => LOG_DEBUG, - Logger::INFO => LOG_INFO, - Logger::WARNING => LOG_WARNING, - Logger::ERROR => LOG_ERR, - Logger::CRITICAL => LOG_CRIT, - Logger::ALERT => LOG_ALERT, - ); - - /** - * List of valid log facility names. - */ - private $facilities = array( - 'auth' => LOG_AUTH, - 'authpriv' => LOG_AUTHPRIV, - 'cron' => LOG_CRON, - 'daemon' => LOG_DAEMON, - 'kern' => LOG_KERN, - 'lpr' => LOG_LPR, - 'mail' => LOG_MAIL, - 'news' => LOG_NEWS, - 'syslog' => LOG_SYSLOG, - 'user' => LOG_USER, - 'uucp' => LOG_UUCP, - ); - - /** - * @param string $ident - * @param mixed $facility - * @param integer $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($ident, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true) - { - parent::__construct($level, $bubble); - - if (!defined('PHP_WINDOWS_VERSION_BUILD')) { - $this->facilities['local0'] = LOG_LOCAL0; - $this->facilities['local1'] = LOG_LOCAL1; - $this->facilities['local2'] = LOG_LOCAL2; - $this->facilities['local3'] = LOG_LOCAL3; - $this->facilities['local4'] = LOG_LOCAL4; - $this->facilities['local5'] = LOG_LOCAL5; - $this->facilities['local6'] = LOG_LOCAL6; - $this->facilities['local7'] = LOG_LOCAL7; - } - - // convert textual description of facility to syslog constant - if (array_key_exists(strtolower($facility), $this->facilities)) { - $facility = $this->facilities[strtolower($facility)]; - } else if (!in_array($facility, array_values($this->facilities), true)) { - throw new \UnexpectedValueException('Unknown facility value "'.$facility.'" given'); - } - - if (!openlog($ident, LOG_PID, $facility)) { - throw new \LogicException('Can\'t open syslog for ident "'.$ident.'" and facility "'.$facility.'"'); - } - } - - /** - * {@inheritdoc} - */ - public function close() - { - closelog(); - } - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - syslog($this->logLevels[$record['level']], (string) $record['formatted']); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php deleted file mode 100644 index 8f47855..0000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php +++ /dev/null @@ -1,120 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Used for testing purposes. - * - * It records all records and gives you access to them for verification. - * - * @author Jordi Boggiano - */ -class TestHandler extends AbstractProcessingHandler -{ - protected $records = array(); - protected $recordsByLevel = array(); - - public function getRecords() - { - return $this->records; - } - - public function hasAlert($record) - { - return $this->hasRecord($record, Logger::ALERT); - } - - public function hasCritical($record) - { - return $this->hasRecord($record, Logger::CRITICAL); - } - - public function hasError($record) - { - return $this->hasRecord($record, Logger::ERROR); - } - - public function hasWarning($record) - { - return $this->hasRecord($record, Logger::WARNING); - } - - public function hasInfo($record) - { - return $this->hasRecord($record, Logger::INFO); - } - - public function hasDebug($record) - { - return $this->hasRecord($record, Logger::DEBUG); - } - - public function hasAlertRecords() - { - return isset($this->recordsByLevel[Logger::ALERT]); - } - - public function hasCriticalRecords() - { - return isset($this->recordsByLevel[Logger::CRITICAL]); - } - - public function hasErrorRecords() - { - return isset($this->recordsByLevel[Logger::ERROR]); - } - - public function hasWarningRecords() - { - return isset($this->recordsByLevel[Logger::WARNING]); - } - - public function hasInfoRecords() - { - return isset($this->recordsByLevel[Logger::INFO]); - } - - public function hasDebugRecords() - { - return isset($this->recordsByLevel[Logger::DEBUG]); - } - - protected function hasRecord($record, $level) - { - if (!isset($this->recordsByLevel[$level])) { - return false; - } - - if (is_array($record)) { - $record = $record['message']; - } - - foreach ($this->recordsByLevel[$level] as $rec) { - if ($rec['message'] === $record) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - $this->recordsByLevel[$record['level']][] = $record; - $this->records[] = $record; - } -} \ No newline at end of file diff --git a/vendor/monolog/monolog/src/Monolog/Logger.php b/vendor/monolog/monolog/src/Monolog/Logger.php deleted file mode 100644 index 91a6ca4..0000000 --- a/vendor/monolog/monolog/src/Monolog/Logger.php +++ /dev/null @@ -1,421 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -use Monolog\Handler\HandlerInterface; -use Monolog\Handler\StreamHandler; - -/** - * Monolog log channel - * - * It contains a stack of Handlers and a stack of Processors, - * and uses them to store records that are added to it. - * - * @author Jordi Boggiano - */ -class Logger -{ - /** - * Detailed debug information - */ - const DEBUG = 100; - - /** - * Interesting events - * - * Examples: User logs in, SQL logs. - */ - const INFO = 200; - - /** - * Exceptional occurrences that are not errors - * - * Examples: Use of deprecated APIs, poor use of an API, - * undesirable things that are not necessarily wrong. - */ - const WARNING = 300; - - /** - * Runtime errors - */ - const ERROR = 400; - - /** - * Critical conditions - * - * Example: Application component unavailable, unexpected exception. - */ - const CRITICAL = 500; - - /** - * Action must be taken immediately - * - * Example: Entire website down, database unavailable, etc. - * This should trigger the SMS alerts and wake you up. - */ - const ALERT = 550; - - protected static $levels = array( - 100 => 'DEBUG', - 200 => 'INFO', - 300 => 'WARNING', - 400 => 'ERROR', - 500 => 'CRITICAL', - 550 => 'ALERT', - ); - - protected $name; - - /** - * The handler stack - * - * @var array of Monolog\Handler\HandlerInterface - */ - protected $handlers = array(); - - protected $processors = array(); - - /** - * @param string $name The logging channel - */ - public function __construct($name) - { - $this->name = $name; - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Pushes a handler on to the stack. - * - * @param HandlerInterface $handler - */ - public function pushHandler(HandlerInterface $handler) - { - array_unshift($this->handlers, $handler); - } - - /** - * Pops a handler from the stack - * - * @return HandlerInterface - */ - public function popHandler() - { - if (!$this->handlers) { - throw new \LogicException('You tried to pop from an empty handler stack.'); - } - return array_shift($this->handlers); - } - - /** - * Adds a processor on to the stack. - * - * @param callable $callback - */ - public function pushProcessor($callback) - { - if (!is_callable($callback)) { - throw new \InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given'); - } - array_unshift($this->processors, $callback); - } - - /** - * Removes the processor on top of the stack and returns it. - * - * @return callable - */ - public function popProcessor() - { - if (!$this->processors) { - throw new \LogicException('You tried to pop from an empty processor stack.'); - } - return array_shift($this->processors); - } - - /** - * Adds a log record. - * - * @param integer $level The logging level - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function addRecord($level, $message, array $context = array()) - { - if (!$this->handlers) { - $this->pushHandler(new StreamHandler('php://stderr', self::DEBUG)); - } - $record = array( - 'message' => (string) $message, - 'context' => $context, - 'level' => $level, - 'level_name' => self::getLevelName($level), - 'channel' => $this->name, - 'datetime' => \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true))), - 'extra' => array(), - ); - // check if any message will handle this message - $handlerKey = null; - foreach ($this->handlers as $key => $handler) { - if ($handler->isHandling($record)) { - $handlerKey = $key; - break; - } - } - // none found - if (null === $handlerKey) { - return false; - } - // found at least one, process message and dispatch it - foreach ($this->processors as $processor) { - $record = call_user_func($processor, $record); - } - while (isset($this->handlers[$handlerKey]) && - false === $this->handlers[$handlerKey]->handle($record)) { - $handlerKey++; - } - - return true; - } - - /** - * Adds a log record at the DEBUG level. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function addDebug($message, array $context = array()) - { - return $this->addRecord(self::DEBUG, $message, $context); - } - - /** - * Adds a log record at the INFO level. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function addInfo($message, array $context = array()) - { - return $this->addRecord(self::INFO, $message, $context); - } - - /** - * Adds a log record at the WARNING level. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function addWarning($message, array $context = array()) - { - return $this->addRecord(self::WARNING, $message, $context); - } - - /** - * Adds a log record at the ERROR level. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function addError($message, array $context = array()) - { - return $this->addRecord(self::ERROR, $message, $context); - } - - /** - * Adds a log record at the CRITICAL level. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function addCritical($message, array $context = array()) - { - return $this->addRecord(self::CRITICAL, $message, $context); - } - - /** - * Adds a log record at the ALERT level. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function addAlert($message, array $context = array()) - { - return $this->addRecord(self::ALERT, $message, $context); - } - - /** - * Gets the name of the logging level. - * - * @param integer $level - * @return string - */ - public static function getLevelName($level) - { - return self::$levels[$level]; - } - - /** - * Checks whether the Logger has a handler that listens on the given level - * - * @param integer $level - * @return Boolean - */ - public function isHandling($level) - { - $record = array( - 'message' => '', - 'context' => array(), - 'level' => $level, - 'level_name' => self::getLevelName($level), - 'channel' => $this->name, - 'datetime' => new \DateTime(), - 'extra' => array(), - ); - - foreach ($this->handlers as $key => $handler) { - if ($handler->isHandling($record)) { - return true; - } - } - - return false; - } - - // ZF Logger Compat - - /** - * Adds a log record at the DEBUG level. - * - * This method allows to have an easy ZF compatibility. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function debug($message, array $context = array()) - { - return $this->addRecord(self::DEBUG, $message, $context); - } - - /** - * Adds a log record at the INFO level. - * - * This method allows to have an easy ZF compatibility. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function info($message, array $context = array()) - { - return $this->addRecord(self::INFO, $message, $context); - } - - /** - * Adds a log record at the INFO level. - * - * This method allows to have an easy ZF compatibility. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function notice($message, array $context = array()) - { - return $this->addRecord(self::INFO, $message, $context); - } - - /** - * Adds a log record at the WARNING level. - * - * This method allows to have an easy ZF compatibility. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function warn($message, array $context = array()) - { - return $this->addRecord(self::WARNING, $message, $context); - } - - /** - * Adds a log record at the ERROR level. - * - * This method allows to have an easy ZF compatibility. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function err($message, array $context = array()) - { - return $this->addRecord(self::ERROR, $message, $context); - } - - /** - * Adds a log record at the CRITICAL level. - * - * This method allows to have an easy ZF compatibility. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function crit($message, array $context = array()) - { - return $this->addRecord(self::CRITICAL, $message, $context); - } - - /** - * Adds a log record at the ALERT level. - * - * This method allows to have an easy ZF compatibility. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function alert($message, array $context = array()) - { - return $this->addRecord(self::ALERT, $message, $context); - } - - /** - * Adds a log record at the ALERT level. - * - * This method allows to have an easy ZF compatibility. - * - * @param string $message The log message - * @param array $context The log context - * @return Boolean Whether the record has been processed - */ - public function emerg($message, array $context = array()) - { - return $this->addRecord(self::ALERT, $message, $context); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php deleted file mode 100644 index f03e347..0000000 --- a/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * Injects line/file:class/function where the log message came from - * - * Warning: This only works if the handler processes the logs directly. - * If you put the processor on a handler that is behind a FingersCrossedHandler - * for example, the processor will only be called once the trigger level is reached, - * and all the log records will have the same file/line/.. data from the call that - * triggered the FingersCrossedHandler. - * - * @author Jordi Boggiano - */ -class IntrospectionProcessor -{ - /** - * @param array $record - * @return array - */ - public function __invoke(array $record) - { - $trace = debug_backtrace(); - - // skip first since it's always the current method - array_shift($trace); - // the call_user_func call is also skipped - array_shift($trace); - - $i = 0; - while (isset($trace[$i]['class']) && false !== strpos($trace[$i]['class'], 'Monolog\\')) { - $i++; - } - - // we should have the call source now - $record['extra'] = array_merge( - $record['extra'], - array( - 'file' => isset($trace[$i-1]['file']) ? $trace[$i-1]['file'] : null, - 'line' => isset($trace[$i-1]['line']) ? $trace[$i-1]['line'] : null, - 'class' => isset($trace[$i]['class']) ? $trace[$i]['class'] : null, - 'function' => isset($trace[$i]['function']) ? $trace[$i]['function'] : null, - ) - ); - - return $record; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php deleted file mode 100644 index 77e0324..0000000 --- a/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * Injects memory_get_peak_usage in all records - * - * @see Monolog\Processor\MemoryProcessor::__construct() for options - * @author Rob Jensen - */ -class MemoryPeakUsageProcessor extends MemoryProcessor -{ - /** - * @param array $record - * @return array - */ - public function __invoke(array $record) - { - $bytes = memory_get_peak_usage($this->realUsage); - $formatted = self::formatBytes($bytes); - - $record['extra'] = array_merge( - $record['extra'], - array( - 'memory_peak_usage' => $formatted, - ) - ); - - return $record; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php deleted file mode 100644 index 7a41238..0000000 --- a/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * Some methods that are common for all memory processors - * - * @author Rob Jensen - */ -abstract class MemoryProcessor -{ - protected $realUsage; - - /** - * @param boolean $realUsage - */ - public function __construct($realUsage = true) - { - $this->realUsage = (boolean) $realUsage; - } - - /** - * Formats bytes into a human readable string - * - * @param int $bytes - * @return string - */ - protected static function formatBytes($bytes) - { - $bytes = (int) $bytes; - - if ($bytes > 1024*1024) { - return round($bytes/1024/1024, 2).' MB'; - } elseif ($bytes > 1024) { - return round($bytes/1024, 2).' KB'; - } - - return $bytes . ' B'; - } - -} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php deleted file mode 100644 index 0867459..0000000 --- a/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * Injects memory_get_usage in all records - * - * @see Monolog\Processor\MemoryProcessor::__construct() for options - * @author Rob Jensen - */ -class MemoryUsageProcessor extends MemoryProcessor -{ - /** - * @param array $record - * @return array - */ - public function __invoke(array $record) - { - $bytes = memory_get_usage($this->realUsage); - $formatted = self::formatBytes($bytes); - - $record['extra'] = array_merge( - $record['extra'], - array( - 'memory_usage' => $formatted, - ) - ); - - return $record; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php deleted file mode 100644 index 61000a0..0000000 --- a/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * Injects url/method and remote IP of the current web request in all records - * - * @author Jordi Boggiano - */ -class WebProcessor -{ - protected $serverData; - - /** - * @param mixed $serverData array or object w/ ArrayAccess that provides access to the $_SERVER data - */ - public function __construct($serverData = null) - { - if (null === $serverData) { - $this->serverData =& $_SERVER; - } elseif (is_array($serverData) || $serverData instanceof \ArrayAccess) { - $this->serverData = $serverData; - } else { - throw new \UnexpectedValueException('$serverData must be an array or object implementing ArrayAccess.'); - } - } - - /** - * @param array $record - * @return array - */ - public function __invoke(array $record) - { - // skip processing if for some reason request data - // is not present (CLI or wonky SAPIs) - if (!isset($this->serverData['REQUEST_URI'])) { - return $record; - } - - if (!isset($this->serverData['HTTP_REFERER'])) { - $this->serverData['HTTP_REFERER'] = null; - } - - $record['extra'] = array_merge( - $record['extra'], - array( - 'url' => $this->serverData['REQUEST_URI'], - 'ip' => $this->serverData['REMOTE_ADDR'], - 'http_method' => $this->serverData['REQUEST_METHOD'], - 'server' => $this->serverData['SERVER_NAME'], - 'referrer' => $this->serverData['HTTP_REFERER'], - ) - ); - - return $record; - } -} diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Composer/ScriptHandler.php b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Composer/ScriptHandler.php deleted file mode 100644 index 2e0e96d..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Composer/ScriptHandler.php +++ /dev/null @@ -1,172 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\DistributionBundle\Composer; - -use Symfony\Component\ClassLoader\ClassCollectionLoader; -use Symfony\Component\Process\Process; -use Symfony\Component\Process\PhpExecutableFinder; - -/** - * @author Jordi Boggiano - */ -class ScriptHandler -{ - public static function buildBootstrap($event) - { - $options = self::getOptions($event); - $appDir = $options['symfony-app-dir']; - - if (!is_dir($appDir)) { - echo 'The symfony-app-dir ('.$appDir.') specified in composer.json was not found in '.getcwd().', can not build bootstrap file.'.PHP_EOL; - - return; - } - - static::executeBuildBootstrap($appDir, $options['process-timeout']); - } - - public static function clearCache($event) - { - $options = self::getOptions($event); - $appDir = $options['symfony-app-dir']; - - if (!is_dir($appDir)) { - echo 'The symfony-app-dir ('.$appDir.') specified in composer.json was not found in '.getcwd().', can not clear the cache.'.PHP_EOL; - - return; - } - - static::executeCommand($event, $appDir, 'cache:clear --no-warmup', $options['process-timeout']); - } - - public static function installAssets($event) - { - $options = self::getOptions($event); - $appDir = $options['symfony-app-dir']; - $webDir = $options['symfony-web-dir']; - - $symlink = ''; - if ($options['symfony-assets-install'] == 'symlink') { - $symlink = '--symlink '; - } elseif ($options['symfony-assets-install'] == 'relative') { - $symlink = '--symlink --relative '; - } - - if (!is_dir($webDir)) { - echo 'The symfony-web-dir ('.$webDir.') specified in composer.json was not found in '.getcwd().', can not install assets.'.PHP_EOL; - - return; - } - - static::executeCommand($event, $appDir, 'assets:install '.$symlink.escapeshellarg($webDir)); - } - - public static function installRequirementsFile($event) - { - $options = self::getOptions($event); - $appDir = $options['symfony-app-dir']; - - if (!is_dir($appDir)) { - echo 'The symfony-app-dir ('.$appDir.') specified in composer.json was not found in '.getcwd().', can not install the requirements file.'.PHP_EOL; - - return; - } - - copy(__DIR__.'/../Resources/skeleton/app/SymfonyRequirements.php', $appDir.'/SymfonyRequirements.php'); - copy(__DIR__.'/../Resources/skeleton/app/check.php', $appDir.'/check.php'); - - $webDir = $options['symfony-web-dir']; - - if (is_file($webDir.'/config.php')) { - copy(__DIR__.'/../Resources/skeleton/web/config.php', $webDir.'/config.php'); - } - } - - public static function doBuildBootstrap($appDir) - { - $file = $appDir.'/bootstrap.php.cache'; - if (file_exists($file)) { - unlink($file); - } - - ClassCollectionLoader::load(array( - 'Symfony\\Component\\DependencyInjection\\ContainerAwareInterface', - // Cannot be included because annotations will parse the big compiled class file - //'Symfony\\Component\\DependencyInjection\\ContainerAware', - 'Symfony\\Component\\DependencyInjection\\Container', - 'Symfony\\Component\\HttpKernel\\Kernel', - 'Symfony\\Component\\ClassLoader\\ClassCollectionLoader', - 'Symfony\\Component\\ClassLoader\\ApcClassLoader', - 'Symfony\\Component\\HttpKernel\\Bundle\\Bundle', - 'Symfony\\Component\\Config\\ConfigCache', - 'Symfony\\Bundle\\FrameworkBundle\\HttpKernel', - // cannot be included as commands are discovered based on the path to this class via Reflection - //'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle', - ), dirname($file), basename($file, '.php.cache'), false, false, '.php.cache'); - - file_put_contents($file, sprintf("getIO()->isDecorated()) { - $console.= ' --ansi'; - } - - $process = new Process($php.' '.$console.' '.$cmd, null, null, null, $timeout); - $process->run(function ($type, $buffer) { echo $buffer; }); - } - - protected static function executeBuildBootstrap($appDir, $timeout = 300) - { - $php = escapeshellarg(self::getPhp()); - $cmd = escapeshellarg(__DIR__.'/../Resources/bin/build_bootstrap.php'); - $appDir = escapeshellarg($appDir); - - $process = new Process($php.' '.$cmd.' '.$appDir, null, null, null, $timeout); - $process->run(function ($type, $buffer) { echo $buffer; }); - } - - protected static function getOptions($event) - { - $options = array_merge(array( - 'symfony-app-dir' => 'app', - 'symfony-web-dir' => 'web', - 'symfony-assets-install' => 'hard' - ), $event->getComposer()->getPackage()->getExtra()); - - $options['symfony-assets-install'] = getenv('SYMFONY_ASSETS_INSTALL') ?: $options['symfony-assets-install']; - - $options['process-timeout'] = $event->getComposer()->getConfig()->get('process-timeout'); - - return $options; - } - - protected static function getPhp() - { - $phpFinder = new PhpExecutableFinder; - if (!$phpPath = $phpFinder->find()) { - throw new \RuntimeException('The php executable could not be found, add it to your PATH environment variable and try again'); - } - - return $phpPath; - } -} diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Configurator.php b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Configurator.php deleted file mode 100644 index 8138398..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Configurator.php +++ /dev/null @@ -1,186 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\DistributionBundle\Configurator; - -use Sensio\Bundle\DistributionBundle\Configurator\Step\StepInterface; -use Symfony\Component\Yaml\Yaml; - -/** - * Configurator. - * - * @author Marc Weistroff - */ -class Configurator -{ - protected $filename; - protected $steps; - protected $parameters; - - public function __construct($kernelDir) - { - $this->kernelDir = $kernelDir; - $this->filename = $kernelDir.'/config/parameters.yml'; - - $this->steps = array(); - $this->parameters = $this->read(); - } - - public function isFileWritable() - { - return is_writable($this->filename); - } - - public function clean() - { - if (file_exists($this->getCacheFilename())) { - @unlink($this->getCacheFilename()); - } - } - - /** - * @param StepInterface $step - */ - public function addStep(StepInterface $step) - { - $this->steps[] = $step; - } - - /** - * @param integer $index - * - * @return StepInterface - */ - public function getStep($index) - { - if (isset($this->steps[$index])) { - return $this->steps[$index]; - } - } - - /** - * @return array - */ - public function getSteps() - { - return $this->steps; - } - - /** - * @return array - */ - public function getParameters() - { - return $this->parameters; - } - - /** - * @return integer - */ - public function getStepCount() - { - return count($this->steps); - } - - /** - * @param array $parameters - */ - public function mergeParameters($parameters) - { - $this->parameters = array_merge($this->parameters, $parameters); - } - - /** - * @return array - */ - public function getRequirements() - { - $majors = array(); - foreach ($this->steps as $step) { - foreach ($step->checkRequirements() as $major) { - $majors[] = $major; - } - } - - return $majors; - } - - /** - * @return array - */ - public function getOptionalSettings() - { - $minors = array(); - foreach ($this->steps as $step) { - foreach ($step->checkOptionalSettings() as $minor) { - $minors[] = $minor; - } - } - - return $minors; - } - - /** - * Renders parameters as a string. - * - * @return string - */ - public function render() - { - return Yaml::dump(array('parameters' => $this->parameters)); - } - - /** - * Writes parameters to parameters.yml or temporary in the cache directory. - * - * @return boolean - */ - public function write() - { - $filename = $this->isFileWritable() ? $this->filename : $this->getCacheFilename(); - - return file_put_contents($filename, $this->render()); - } - - /** - * Reads parameters from file. - * - * @return array - */ - protected function read() - { - $filename = $this->filename; - if (!$this->isFileWritable() && file_exists($this->getCacheFilename())) { - $filename = $this->getCacheFilename(); - } - - $ret = Yaml::parse($filename); - if (false === $ret || array() === $ret) { - throw new \InvalidArgumentException(sprintf('The %s file is not valid.', $filename)); - } - - if (isset($ret['parameters']) && is_array($ret['parameters'])) { - return $ret['parameters']; - } else { - return array(); - } - } - - /** - * getCacheFilename - * - * @return string - */ - protected function getCacheFilename() - { - return $this->kernelDir.'/cache/parameters.yml'; - } -} diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Form/DoctrineStepType.php b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Form/DoctrineStepType.php deleted file mode 100644 index fa315c5..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Form/DoctrineStepType.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\DistributionBundle\Configurator\Form; - -use Sensio\Bundle\DistributionBundle\Configurator\Step\DoctrineStep; -use Symfony\Component\Form\AbstractType; -use Symfony\Component\Form\FormBuilderInterface; - -/** - * Doctrine Form Type. - * - * @author Fabien Potencier - */ -class DoctrineStepType extends AbstractType -{ - public function buildForm(FormBuilderInterface $builder, array $options) - { - $builder - ->add('driver', 'choice', array('choices' => DoctrineStep::getDrivers())) - ->add('name', 'text') - ->add('host', 'text') - ->add('port', 'text', array('required' => false)) - ->add('user', 'text') - ->add('password', 'repeated', array( - 'required' => false, - 'type' => 'password', - 'first_name' => 'password', - 'second_name' => 'password_again', - 'invalid_message' => 'The password fields must match.', - )) - ; - } - - public function getName() - { - return 'distributionbundle_doctrine_step'; - } -} diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Form/SecretStepType.php b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Form/SecretStepType.php deleted file mode 100644 index c62ebd1..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Form/SecretStepType.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\DistributionBundle\Configurator\Form; - -use Symfony\Component\Form\AbstractType; -use Symfony\Component\Form\FormBuilderInterface; - -/** - * Secret Form Type. - * - * @author Marc Weistroff - */ -class SecretStepType extends AbstractType -{ - public function buildForm(FormBuilderInterface $builder, array $options) - { - $builder->add('secret', 'text'); - } - - public function getName() - { - return 'distributionbundle_secret_step'; - } -} diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Step/DoctrineStep.php b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Step/DoctrineStep.php deleted file mode 100644 index ba2163e..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Step/DoctrineStep.php +++ /dev/null @@ -1,143 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\DistributionBundle\Configurator\Step; - -use Sensio\Bundle\DistributionBundle\Configurator\Form\DoctrineStepType; -use Symfony\Component\Validator\Constraints as Assert; - -/** - * Doctrine Step. - * - * @author Fabien Potencier - */ -class DoctrineStep implements StepInterface -{ - /** - * @Assert\Choice(callback="getDriverKeys") - */ - public $driver; - - /** - * @Assert\NotBlank - */ - public $host; - - /** - * @Assert\Min(0) - */ - public $port; - - /** - * @Assert\NotBlank - */ - public $name; - - /** - * @Assert\NotBlank - */ - public $user; - - public $password; - - public function __construct(array $parameters) - { - foreach ($parameters as $key => $value) { - if (0 === strpos($key, 'database_')) { - $parameters[substr($key, 9)] = $value; - $key = substr($key, 9); - $this->$key = $value; - } - } - } - - /** - * @see StepInterface - */ - public function getFormType() - { - return new DoctrineStepType(); - } - - /** - * @see StepInterface - */ - public function checkRequirements() - { - $messages = array(); - - if (!class_exists('\PDO')) { - $messages[] = 'PDO extension is mandatory.'; - } else { - $drivers = \PDO::getAvailableDrivers(); - if (0 == count($drivers)) { - $messages[] = 'Please install PDO drivers.'; - } - } - - return $messages; - } - - /** - * @see StepInterface - */ - public function checkOptionalSettings() - { - return array(); - } - - /** - * @see StepInterface - */ - public function update(StepInterface $data) - { - $parameters = array(); - - foreach ($data as $key => $value) { - $parameters['database_'.$key] = $value; - } - - return $parameters; - } - - /** - * @see StepInterface - */ - public function getTemplate() - { - return 'SensioDistributionBundle:Configurator/Step:doctrine.html.twig'; - } - - /** - * @return array - */ - static public function getDriverKeys() - { - return array_keys(static::getDrivers()); - } - - /** - * @return array - */ - static public function getDrivers() - { - return array( - 'pdo_mysql' => 'MySQL (PDO)', - 'pdo_sqlite' => 'SQLite (PDO)', - 'pdo_pgsql' => 'PosgreSQL (PDO)', - 'oci8' => 'Oracle (native)', - 'ibm_db2' => 'IBM DB2 (native)', - 'pdo_oci' => 'Oracle (PDO)', - 'pdo_ibm' => 'IBM DB2 (PDO)', - 'pdo_sqlsrv' => 'SQLServer (PDO)', - ); - } -} diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Step/SecretStep.php b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Step/SecretStep.php deleted file mode 100644 index d2333ba..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Step/SecretStep.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\DistributionBundle\Configurator\Step; - -use Sensio\Bundle\DistributionBundle\Configurator\Form\SecretStepType; -use Symfony\Component\Validator\Constraints as Assert; - -/** - * Secret Step. - * - * @author Fabien Potencier - */ -class SecretStep implements StepInterface -{ - /** - * @Assert\NotBlank - */ - public $secret; - - public function __construct(array $parameters) - { - if (array_key_exists('secret', $parameters)){ - $this->secret = $parameters['secret']; - - if ('ThisTokenIsNotSoSecretChangeIt' == $this->secret) { - $this->secret = $this->generateRandomSecret(); - } - } else { - $this->secret = $this->generateRandomSecret(); - } - - } - - private function generateRandomSecret() - { - return hash('sha1', uniqid(mt_rand())); - } - - /** - * @see StepInterface - */ - public function getFormType() - { - return new SecretStepType(); - } - - /** - * @see StepInterface - */ - public function checkRequirements() - { - return array(); - } - - /** - * checkOptionalSettings - */ - public function checkOptionalSettings() - { - return array(); - } - - /** - * @see StepInterface - */ - public function update(StepInterface $data) - { - return array('secret' => $data->secret); - } - - /** - * @see StepInterface - */ - public function getTemplate() - { - return 'SensioDistributionBundle:Configurator/Step:secret.html.twig'; - } -} diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Step/StepInterface.php b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Step/StepInterface.php deleted file mode 100644 index 94767ee..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Configurator/Step/StepInterface.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\DistributionBundle\Configurator\Step; - -use Symfony\Component\Form\Type\FormTypeInterface; - -/** - * StepInterface. - * - * @author Marc Weistroff - */ -interface StepInterface -{ - /** - * __construct - * - * @param array $parameters - */ - function __construct(array $parameters); - - /** - * Returns the form used for configuration. - * - * @return FormTypeInterface - */ - function getFormType(); - - /** - * Checks for requirements. - * - * @return array - */ - function checkRequirements(); - - /** - * Checks for optional setting it could be nice to have. - * - * @return array - */ - function checkOptionalSettings(); - - /** - * Returns the template to be renderer for this step. - * - * @return string - */ - function getTemplate(); - - /** - * Updates form data parameters. - * - * @param array $parameters - * @return array - */ - function update(StepInterface $data); -} diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Controller/ConfiguratorController.php b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Controller/ConfiguratorController.php deleted file mode 100644 index 07214cf..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Controller/ConfiguratorController.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\DistributionBundle\Controller; - -use Symfony\Component\DependencyInjection\ContainerAware; -use Symfony\Component\HttpFoundation\RedirectResponse; - -/** - * ConfiguratorController. - * - * @author Fabien Potencier - */ -class ConfiguratorController extends ContainerAware -{ - /** - * @return Response A Response instance - */ - public function stepAction($index = 0) - { - $configurator = $this->container->get('sensio.distribution.webconfigurator'); - - $step = $configurator->getStep($index); - $form = $this->container->get('form.factory')->create($step->getFormType(), $step); - - $request = $this->container->get('request'); - if ('POST' === $request->getMethod()) { - $form->bindRequest($request); - if ($form->isValid()) { - $configurator->mergeParameters($step->update($form->getData())); - $configurator->write(); - - $index++; - - if ($index < $configurator->getStepCount()) { - return new RedirectResponse($this->container->get('router')->generate('_configurator_step', array('index' => $index))); - } - - return new RedirectResponse($this->container->get('router')->generate('_configurator_final')); - } - } - - return $this->container->get('templating')->renderResponse($step->getTemplate(), array( - 'form' => $form->createView(), - 'index' => $index, - 'count' => $configurator->getStepCount(), - 'version' => $this->getVersion(), - )); - } - - public function checkAction() - { - $configurator = $this->container->get('sensio.distribution.webconfigurator'); - - // Trying to get as much requirements as possible - $majors = $configurator->getRequirements(); - $minors = $configurator->getOptionalSettings(); - - $url = $this->container->get('router')->generate('_configurator_step', array('index' => 0)); - - if (empty($majors) && empty($minors)) { - return new RedirectResponse($url); - } - - return $this->container->get('templating')->renderResponse('SensioDistributionBundle::Configurator/check.html.twig', array( - 'majors' => $majors, - 'minors' => $minors, - 'url' => $url, - 'version' => $this->getVersion(), - )); - } - - public function finalAction() - { - $configurator = $this->container->get('sensio.distribution.webconfigurator'); - $configurator->clean(); - - try { - $welcomeUrl = $this->container->get('router')->generate('_welcome'); - } catch (\Exception $e) { - $welcomeUrl = null; - } - - return $this->container->get('templating')->renderResponse('SensioDistributionBundle::Configurator/final.html.twig', array( - 'welcome_url' => $welcomeUrl, - 'parameters' => $configurator->render(), - 'yml_path' => $this->container->getParameter('kernel.root_dir').'/config/parameters.yml', - 'is_writable' => $configurator->isFileWritable(), - 'version' => $this->getVersion(), - )); - } - - public function getVersion() - { - $kernel = $this->container->get('kernel'); - - return $kernel::VERSION; - } -} diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/DependencyInjection/SensioDistributionExtension.php b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/DependencyInjection/SensioDistributionExtension.php deleted file mode 100644 index 4363d57..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/DependencyInjection/SensioDistributionExtension.php +++ /dev/null @@ -1,33 +0,0 @@ - - */ -class SensioDistributionExtension extends Extension -{ - public function load(array $configs, ContainerBuilder $container) - { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - - $loader->load('webconfigurator.xml'); - } - - public function getNamespace() - { - return 'http://symfony.com/schema/dic/symfony/sensiodistribution'; - } - - public function getAlias() - { - return 'sensio_distribution'; - } -} diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/LICENSE b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/LICENSE deleted file mode 100644 index c6aa7e3..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010,2011 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build.sh b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build.sh deleted file mode 100644 index ad9ee9b..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/sh - -# This file is part of the Symfony Standard Edition. -# -# (c) Fabien Potencier -# -# For the full copyright and license information, please view the LICENSE -# file that was distributed with this source code. - -DIR=`php -r "echo realpath(dirname(\\$_SERVER['argv'][0]));"` -cd $DIR -VERSION=`grep ' VERSION ' vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php | sed -E "s/.*'(.+)'.*/\1/g"` - -if [ ! -d "$DIR/build" ]; then - mkdir -p $DIR/build -fi - -# Without vendors -rm -rf /tmp/Symfony -mkdir /tmp/Symfony -cp -r app /tmp/Symfony/ -cp -r src /tmp/Symfony/ -cp -r web /tmp/Symfony/ -cp README.md /tmp/Symfony/ -cp LICENSE /tmp/Symfony/ -cp composer.json /tmp/Symfony/ -cp composer.lock /tmp/Symfony/ -cd /tmp/Symfony -sudo rm -rf app/cache/* app/logs/* .git* -chmod 777 app/cache app/logs - -# DS_Store cleanup -find . -name .DS_Store | xargs rm -rf - - -cd .. -# avoid the creation of ._* files -export COPY_EXTENDED_ATTRIBUTES_DISABLE=true -export COPYFILE_DISABLE=true -tar zcpf $DIR/build/Symfony_Standard_$VERSION.tgz Symfony -sudo rm -f $DIR/build/Symfony_Standard_$VERSION.zip -zip -rq $DIR/build/Symfony_Standard_$VERSION.zip Symfony - -# With vendors -cd $DIR -rm -rf /tmp/vendor -mkdir /tmp/vendor -TARGET=/tmp/vendor - -if [ ! -d "$DIR/vendor" ]; then - echo "The master vendor directory does not exist" - exit -fi - -cp -r $DIR/vendor/* $TARGET/ - -# Doctrine ORM -cd $TARGET/doctrine/orm && rm -rf UPGRADE* build* bin tests tools lib/vendor - -# Doctrine DBAL -cd $TARGET/doctrine/dbal && rm -rf bin build* tests lib/vendor - -# Doctrine Common -cd $TARGET/doctrine/common && rm -rf build* tests lib/vendor - -# Swiftmailer -cd $TARGET/swiftmailer/swiftmailer && rm -rf CHANGES README* build* docs notes test-suite tests create_pear_package.php package* - -# Symfony -cd $TARGET/symfony/symfony && rm -rf README.md phpunit.xml* tests *.sh vendor - -# Twig -cd $TARGET/twig/twig && rm -rf AUTHORS CHANGELOG README.markdown bin doc package.xml.tpl phpunit.xml* test - -# Twig Extensions -cd $TARGET/twig/extensions && rm -rf README doc phpunit.xml* test - -# Monolog -cd $TARGET/monolog/monolog && rm -rf README.markdown phpunit.xml* tests - -# Sensio -cd $TARGET/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/ && rm -rf phpunit.xml* Tests CHANGELOG* -cd $TARGET/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/ && rm -rf phpunit.xml* Tests CHANGELOG* -cd $TARGET/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/ && rm -rf phpunit.xml* Tests CHANGELOG* - -# JMS -cd $TARGET/jms/metadata && rm -rf README.rst phpunit.xml* tests -cd $TARGET/jms/cg && rm -rf README.rst phpunit.xml* tests -cd $TARGET/jms/aop-bundle/JMS/AopBundle && rm -rf phpunit.xml* Tests -cd $TARGET/jms/di-extra-bundle/JMS/DiExtraBundle && rm -rf phpunit.xml* Tests -cd $TARGET/jms/security-extra-bundle/JMS/SecurityExtraBundle/ && rm -rf phpunit.xml* Tests - -# cleanup -find $TARGET -name .git | xargs rm -rf - -find $TARGET -name .gitignore | xargs rm -rf - -find $TARGET -name .gitmodules | xargs rm -rf - -find $TARGET -name .svn | xargs rm -rf - - -cd /tmp/ -mv /tmp/vendor /tmp/Symfony/ -tar zcpf $DIR/build/Symfony_Standard_Vendors_$VERSION.tgz Symfony -sudo rm -f $DIR/build/Symfony_Standard_Vendors_$VERSION.zip -zip -rq $DIR/build/Symfony_Standard_Vendors_$VERSION.zip Symfony diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php deleted file mode 100644 index 082e711..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env php - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -$argv = $_SERVER['argv']; - -// allow the base path to be passed as the first argument, or default -if (isset($argv[1])) { - $appDir = $argv[1]; -} else { - if (!$appDir = realpath(__DIR__.'/../../../../../../../../app')) { - exit('Looks like you don\'t have a standard layout.'); - } -} - -require_once $appDir.'/autoload.php'; - -\Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::doBuildBootstrap($appDir); diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/config/routing/webconfigurator.xml b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/config/routing/webconfigurator.xml deleted file mode 100644 index 6dae8b5..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/config/routing/webconfigurator.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - SensioDistributionBundle:Configurator:check - - - - SensioDistributionBundle:Configurator:step - - - - SensioDistributionBundle:Configurator:final - - diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/config/webconfigurator.xml b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/config/webconfigurator.xml deleted file mode 100644 index fcf3e64..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/config/webconfigurator.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Sensio\Bundle\DistributionBundle\Configurator\Configurator - - - - - %kernel.root_dir% - - - - diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/css/configure.css b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/css/configure.css deleted file mode 100644 index 359bba1..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/css/configure.css +++ /dev/null @@ -1,153 +0,0 @@ -@import url("install.css"); - -h1 { - margin-top: 10px; - font-size: 26px; -} - -#symfony-wrapper { - padding-top: 0; -} - -#symfony-search { - position: absolute; - top: 50px; - right: 30px; -} - -#symfony-search-field { - width: 190px; -} - -#symfony-search label { - display: block; - float: left; - width: 20px; - height: 25px; - background: url(../images/search.png) no-repeat left 5px; -} - -#symfony-search label span { - display: none; -} - -input[type=text] { - border: 1px solid #DADADA; - background: white url(../images/field-background.gif) repeat-x left top; - padding: 5px 6px; - color: #565656; - font-family: "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif; - font-size: 12px; -} - - -.symfony-button-grey, .symfony-button-green { - font-size: 0.85em; - font-weight: bold; - cursor: pointer; - display: inline-block; - outline: none; - text-align: center; - text-transform: uppercase; - padding: 3px 10px; - text-shadow: 0 1px 1px rgba(0,0,0,.3); - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} - -.symfony-button-grey { - color: #868686; - font-weight: normal; - padding: 5px 10px; - border: solid 1px #d7d7d7; - background: #ffffff; - background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#d7d7d7)); - background: -moz-linear-gradient(top, #ffffff, #d7d7d7); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#d7d7d7'); -} - -.symfony-button-green { - padding: 5px 12px; - color: white; - border: solid 1px #a7da39; - background: #a7da39; - background: -webkit-gradient(linear, left top, left bottom, from(#a7da39), to(#6a9211)); - background: -moz-linear-gradient(top, #a7da39, #6a9211); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#a7da39', endColorstr='#6a9211'); -} - -.symfony-block-steps span { - display: inline-block; - padding: 2px 3px; - font-size: 11px; - line-height: 15px; - color: #868686; - font-weight: bold; - text-transform: uppercase; -} - -.symfony-block-steps span.selected { - background-color: #aacd4e; - color: #FFFFFF; -} - - -.symfony-form-row { - padding-bottom: 40px; -} - -.symfony-form-column { - width: 430px; - float: left; -} - -.symfony-form-footer { - padding-top: 20px; - clear: both; -} - -.symfony-form-field { - height: 20px; -} - -.symfony-form-row label { - display: block; - padding-bottom: 8px; -} - -.symfony-form-field input[type=text], -.symfony-form-field input[type=password], -.symfony-form-field textarea, -.symfony-form-field select { - font-size: 13px; - color: #565656; - width: 200px; -} - -.symfony-form-field input[type=text], -.symfony-form-field input[type=password], -.symfony-form-field textarea { - border: 1px solid #dadada; - background: #FFFFFF url(../images/background-textfield.gif) repeat-x left top; - width: 194px; - padding: 5px 6px; -} - -.symfony-form-errors ul { - padding: 0; -} - -.symfony-form-errors li { - background: url(../images/notification.gif) no-repeat left 6px; - font-size: 11px; - line-height: 16px; - color: #759e1a; - padding: 10px 25px; -} - -.symfony-configuration { - margin: 10px 0; - width: 100%; - height: 240px; -} diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/css/install.css b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/css/install.css deleted file mode 100644 index 64bbdbd..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/css/install.css +++ /dev/null @@ -1,148 +0,0 @@ -/* -Copyright (c) 2010, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.com/yui/license.html -version: 2.8.2r1 - -Reset -*/ - -html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var,optgroup{font-style:inherit;font-weight:inherit;}del,ins{text-decoration:none;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:baseline;}sub{vertical-align:baseline;}legend{color:#000;}input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}input,button,textarea,select{*font-size:100%;} - -html, body { - background-color: #EFEFEF; -} - -body { - font-size: 14px; - font-family: "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif; - color: #313131; -} - -a { - color: #08C; - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - -strong { - font-weight: bold; -} - -em { - font-style: italic; -} - -h1, h2, h3 { - font-family: Georgia, "Times New Roman", Times, serif; - color: #404040; -} - -h1 { - font-size: 45px; - padding-bottom: 30px; -} - -h2 { - font-weight: bold; - color: #FFFFFF; - /* Font is reset to sans-serif (like body) */ - font-family: "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif; - margin-bottom: 10px; - background-color: #aacd4e; - padding: 2px 4px; - display: inline-block; - text-transform: uppercase; -} - -p { - line-height: 20px; - padding-bottom: 20px; -} - -ul a { - background: url(../images/blue-arrow.png) no-repeat right 6px; - padding-right: 10px; -} - -ul, ol { - padding-left: 20px; -} - -li { - padding-bottom: 18px; -} - -ol li { - list-style-type: decimal; -} - -ul li { - list-style-type: none; -} - -#symfony-header { - position: relative; - padding: 30px 30px 20px 30px; -} - -#symfony-wrapper { - width: 970px; - margin: 0 auto; - padding-top: 50px; -} - -#symfony-content { - background-color: white; - border: 1px solid #DFDFDF; - padding: 50px; - -moz-border-radius: 16px; - -webkit-border-radius: 16px; - border-radius: 16px; - margin-bottom: 5px; -} - - -.symfony-blocks-install { - overflow: hidden; -} - -.symfony-blocks-install .symfony-block-logo { - float: left; - width: 358px; -} - -.symfony-blocks-install .symfony-block-content { - float: left; - width: 510px; -} - -.symfony-install-continue { - font-size: 0.95em; - padding-left: 0; -} - -.symfony-install-continue li { - padding-bottom: 10px; -} - -.version { - text-align: right; - font-size: 10px; - margin-right: 20px; -} - -.ok { - color: #fff; - font-family: "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif; - background-color: #6d6; - padding: 10px; - margin-bottom: 20px; -} - -.ko { - background-color: #d66; -} diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/images/background-textfield.gif b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/images/background-textfield.gif deleted file mode 100644 index 7c0efc1087c3cedd2a95deaef7322d4770170ff3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 63 zcmZ?wbhEHbWMp7vSj52a_3PL7@8AFZ`}fzcU$0)hVt@g~pDbXe4u}M)WngCUU{vO0 Gum%7TE)u5z diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/images/blue-arrow.png b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/images/blue-arrow.png deleted file mode 100644 index fa82d4b4fff6414062efb2a02049cfeb9e8e7cb1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^tU%1c!3HD^Kbl$tDajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_d9Md6+I= zhqi>4PnzMOuO)K~*(RkoSoCn7)R^#~T4CSujwM;<0=t>E&QEnQ(&y3G(9U?$#xX^m ckwt=G)hqGzY5M*n+r|-FL<1!X8KKK0Y+4-K|Ip_DgLX_ZFS}O27 zD6VZ4Vy_V55P%DwO+Snf_;2^FO_X=lLt9ZPzz)z@c~ldI{Q@#slCUp96W9qfs%tQ*oXL6(4`+eocJ>~>XTi!Tx6`NE0#k>{2Oo} ztK9}W2EBZ;)|i=(L{i>6UU}sHFa>93DOU?()OGNh>)?K^U==8P)fsB(g!Z`H)Oe2K zAL8V3c}P=UQK;p237iK()-qO$m3q1_)5Uf>)l?g3abZDzzr3uhc^8WX1k|b(vZuwUYd`2nOcXxJ?f6`A^uQ+Js>k0*)1Z4Ms zn^LJ1IeVQ{e)veSS*BUf_2AsdWHfQT>0~mg)MIP0(fZmtg+pPwU~40@=~Q74tpCV* z?ho@%#bU9aI76NxIeHwFNF*?aMWwIcY>?`WCUqU3p`BrU7P-H#KQlGy-*EQ!{qC?| zBHyTwqR}XwX|T}E>o*E#8G_CNzUOjq9hiOEpwp*$E~o3w^mcAenG2uk(7mCIUZ>~% zB=me1mhaCn;Cq#;BX2o}t+|y3?+$Lc6{R^^&pjZF^ diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/images/logo-big.gif b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/images/logo-big.gif deleted file mode 100644 index 721f12ab02990589a95fff62345c84113fdd724a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4060 zcmV<24g99On!ZT*x1;yu(DTG zS)`+-n3tKcv9gPbjB#*s*x1>=y}wsgSc{2_etdtvzQ1vAa-^iC|Ns9mE;9fB{{R30 z000000000000000A^8LW000^QEC2ui0LTFD06+!*peBxFX`X1Rt}Gk83n9<)@&;|L z?|kq7KvCh4DH@N+q;kn@I**4!a7wNEB7&!O%k6rZ0-SYBP7%N8w0g}wl;67tdrn6i z7zK=e&+iW!248M)Zv}OSh)4nueR}{;jge_mggyz0m~;}6d=r^#36(4kpH344oT-fi z3|beej#~l%01~B23!)~Ew@0tAyl9Jj5E6{AdJS3(sT93N0J<6j&qo%>eadRr*xh{r z!PQE-;o=zv-i@|T+}#!Chz_Czbpo)|O%kZyP3air@Yv)Mwct>INcgrixR+%KGjE;( z9vUc(R4D-zDtIfvAP^UO-quN^BTt$Mk0aOr>_dh! zT;u_Qx=Ofe`20iwPc$VGfNnw{1riOFpF|^p*a%NEM_{f1r^JBX5wVN>CZYB*3C=|n zpFp0WwF)F+O3;ILVy2M?I;It zFhGS%MDZL^!=(_;Z6{=vB0+Vr2-%D}6i^#`GzNiy16fIAfCI+mm}3Mzu0@9d^9iX7 z7DgH=K$1%45L}Z~I-#79>s6V^Lw!I{WCkE{^5qgG4K}5gY*3KO01zf&RVrgXaiv)a zB?W*54CKiG1pu_k1(&G|rPYhl2>Qtcu)MQ{0UGh4jWyjw#6(b>h;&PN(vVmRpsEX@yjLn{-ujscXY zTOf)|D@(kIjWfe8VNzIiC`*k0p^U-;fuB^R18uZPlxfnL;1=Nx1m!9LrB|a48zwO6 zCL!Zq3L;|dDi&;!hbpkf+a6@h<=PFiitM{ezwu@eWRxY4woL<}?g2pq7I2%e01Gqx z!>S3dQLM%>4PkMU0yr=)$S9|*^2#i??DESdq@{&^Fl$gR5*yYm-4XxlOd-!c@4zut zCu`8scPC_tsR#jMTwSyN9pT`IK%-EOXer!yjtNTiOhUUkkA}pY#3j~4yGt`@_6X-0 zf%I{&WmuqV`B6=s2^G@JA&w)=t-^ukAu$}aWV0YM6e+MNwGm-27k3KG>0N@~Bkm0L8J8mi z6f)4G8!&-CrUZ;r@Lnb;=no`nA(61?*y*N#y-%PqjZV0uDvIc@c^rb0 zjrfuh-O+?krb2|86vZI9fXYbV>Rzg_Boc6`E$Km$lXY;V9++6mqcDMt*r-z}rGW@8 z>H#TQXjCfNs2Le%FJzezz%L?EfCH|=j7^XxGISZQH!TAE`dVA(O%F=c$<;w2{} z*fH0|1)XD&r!A!ipuO;rO2Xs=6RTuSrqJ^f2B1KmC@|0>Ad?g9Y$x~nlBGEmvk{7F z0wx{xy-oiArISrir>U0U%m_LXT!EYsJh|XaJrqL;#@HV|wPerp%~WclL`DI=MZSLO z%qbfz1=g$=fSU$Y5&p9t2}X2OCwNq;D_C9tod;EE1Yo6FxyvuB3Ks+}qcP`u-vfU`;PYzf%MzW zkm~^d5ztEj8~_^gi9iuVaex>Kkbtb*MlFsdfnqbjy$HlH1Di8JyAUfjqL_d=K8=~Y zAQw6fSPliA^XQb`mW0!-S3ecv9<^$^f&l=8Mbt{02B?*)`pB(rCo+QM{)@N%(#;62 z3r`CGx74wjKrLsrn?p??#>J}52;8$Ue=+>wB5b&7C14JH9XGn}(D-jXHi6REb_5CU zU`q78Q34dp;1S4}J|6Ddk1L1c+!~MtH=|jUNkC!~D3h;7@LzMC;Is?x*UUw@kcRi> zTow061?b~K;kG=UAOkowHM&6nQhb7XH5q1l4nSp@!kl%P^NRy8#4X0S*8_Lvs_@yhd6u2v`6}Pq~2Ke!2`h+VmJrcIq*x)~GZo8J}CN0jZLY zsY8bA+GwCO%dm=V zHT-#H-0n6TzOAuqi~A7To>7a>-HU1)2B_>lf&>^KXigNM0u+GtP=$o(a~mL_su%!I zw~%hX0Px%Zz$7bHb5RU{^9lPd%q#;KhAH|2mD7shP8^E0I!RMcdxh}%p)0XN%=UO2*L3Cn(30NHi1)x|Oe1i-v?N}7+Hb=G; z$wnqVloK}}3$dwy^)!sU0eqsx1RAhWFD23Id$5=QeE8C8q_-0Nt_HwaE;U{C;o(Kt zXd@`EVNOh(4sU-0JlMXbo9b`nNDybIOrZ+QXQC$^7b`MI>4jC+QJ;-Sx&c#>cTAWZ z2=LH6AE15&A0oaJ`r-tvg<+EQ-ohrS_`DNJiVSq}@}SQ!^c#qe29Y9g`AG0SA2J%! zhz-0NMlJ(9#7{u?rK12B(374TVD$=se-65kz9wA7c_)nARq%IG=CE=9J`j1&@PCbP zeoB`PuryYsg(d~(1F?q)XIFY%fPi|yeJ=5PJHU0BP=UO+DDM|bm7sxZfP1hoaW%Ir z9iw$XV1i4)K7OKd*f2}}(03^zc0n+KTHs0w*dZN+4X#%NDA)-4w-y|j9R{HaoCkC@ z*aSh?dd!oAIpBOS#}cG+e0#tIE++}hLx4RHcUK4tBO`q6w*(l70bmC%d$$AkHz2C8 zhDp$cdO&+faD&Vvbz{J6XwY!Imjuw)MO>H;w zrIH;JaXw>g@%9DD236pgmP){oFN2nD*>Y4VJYYGO3gDGcb(h^{JGmwTyB1UgP?vIL zYtPt*rzTsmI7SOVn13lE39yVQ@c_v4n7R;Z41j4JHSJU zo|&4extgrmny&epuo;`OIh(Xuo3?qIxS2fUm1(6(0Eh`PBN8X5S(R-voEr0vjwvK( z(poa`n@SQez6Djvq>pO<+FCbcphWVj5tD|H%UAH43=_ zH*Uj3CWB7x!H+RW0-{(VD1ZdKSS#v<1fiz^YH=BoSru>wq9-~a5b7Nnvy5d%0-lq8 z+twq_mHrcQ>UIlvqUf&>OSId&!jQ}QCz@~A6tSS7Gt zDT1J8dIV}_V{FEze6urC#%BLQXClyLz*S`bnfjnWa3fwbWUFcfh4W;A3aS}~tE4)r z`+=%H24cUet3YN1snQb4p%%$WWq@h|_2L$a#ih2|sfJo(ZFZ=|iG zV|3PEP)Y(7WtLc4W#3h*C*ZBLkr+84b)=yH1P}q6!6R0xS1T2I0lT8YdIAKiunkie zwIu=wKmedYHuOrYDgYrxGgEol0$CAr9h<0*5vpz$bJ6w@va_;9@G%91TLA!8OP~PQ z#RCa6XqiO|gSi4r3jnxgHFo7c3BW#C@QOLJ)f=p~0_+o=Ex?-(07;R@rMkeOxw!(V za~9!Xsb||RdRYZ=MxC=+QO3ywRXY?cX_=h^050^lKcGR|bGEy%1aSES1u(QV;J2}f O01+?)X4L~B0028L!THSq diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/images/logo-small.gif b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/images/logo-small.gif deleted file mode 100644 index 703cf45fc78e6d31d4a9af460252b536b1c9854e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1698 zcmV;T23`3_Nk%w1VYUE10K^&q%gfAUVr4x$Kl1YON=QuQ<>lDe*q4@=v9Pj!eSesj znO9X=ad2|Jy}yf!jHIKbv9Yp#e1F*3*>P`jS5;V~q@}*Tzl({C|Ns9mE;9fB{{R30 z000000000000000A^8LW000^QEC2ui0JZ==06+!*peBxFX^z0-1i_MJ3+p_pEh_&5dM^QH^o`2q?YC;|Y#eo6?SBFL~IkO9*W zUWrg(6a+6t1e9~gkzoUD0u)q?cL8IkHxMNMW_YDz4U&xn4G;-%fMrJwrreB*aD?3_ z1wa){Fo|t|jsdNTB$!ozNI7K6ROJ$p6pPVgF9`4wMB>|mt0D|wjG70m21m-KH6S4q zhKOfKG;JyM!j7010!F!0IkQPpts|OdaKxZQty_Z;XW06P@mIDOfgM&{!i#`0fD`e3 zQEdyS&0Nj2C9?Kr8lnz-R4p>0a~KE_K`S#&yS5Dk42ZH}fWWNn-@r{EpxZBi&EUv6 z8aN0#2?2n~qoYCA9N}^4*n51eZlv`Vo}$7KN0+^P4l3M z2>3zos9Q+@lo%19fEJ&v_eMl=Ver}i6~3L26fm|Wb=^(lB>@IXO1OprcmzanA$V+L zb^~<*z@))9>6GxyTD2hYPk$N-mINXQ^p_PtcqCwBVHzYQp9trqhK*03$jI3zp=`EL z4gk;<4l+DyFhEu)P)UL+z8NDzFH^jr%?TK>h?fa6iXfN(BusNv6&G%ik!z~7xy6*t zIl-j}Y9eFPWF!!y%L|M_g5H-VU{nL2eF8edifzfKN)iT20F<12yZv3FsjK z;Rr5efTm$DL^*<=i7qz6og;{q#A5}anraE7fn!1!py{+pbtXdbOp509;L?wY*qD(5 z06@@Q5uSu`O>_G}VTmEZ{vb*JgE&xUL1w2rpe-Fev@4h-90G~<(Y|8JzQl6785e#5UFuM(io2~!?FPxpW2UiiX#KE~* z@e34008|A3Hij{FaHUIu9SUF;&k<9N3>-uiQxHZ4U%WA%01CV85UvN?MKf#F{QQ#6 zwS{a20W27sMHohcl(Pv9{JSJU??&s;yP0%mi5&wxi^V4(W-tK+3tD074XPv%P67Jn zgWlPu)oR5^7&M*1$rz+WHy1@*`e+rU;lOHbgVTm}65KMKgaFOHA#`1H_0h5o&rIGb zE)5zmMj3GkP)KY67-azeT>((?w-JLB@U8#{nAQ0qC1>EkRbD)Is|#A0lK2~y79sN} zNG@y24sdXt_r~;iTHpx_=E*BaSP{$|$EWviZgdX{vBSluA zfC7ZqxHo|4cW)@0O6rG$hWUwSS3w4Z5G8{2&1zKz6h<&!@COo>P*Ep(L223&B{pG- z2y^&^Ds~qJqs^mjH~7XN@K6{!CC`PjdZDVeRKRC^iZLxrq7p~2JUof2D@uqT9E_kv z39)c17fSdz2oVk(|*9gP26mT@rLI(4sh?6#MCjsXOoCcz2gl2{9QVN>M zDBh=%)a0N50dPS1QV22^6&KcVi9jlXAybu*3hZqF zu;Jn-Qqr8K6@)kfNWj!GMXb&_vW`!zqp1P`D-sM~lX-ZeEsNm?6HFs{LTHX2-e5P0 zkjo5$5s}2!XM@Adqk=r!%(|SQh-ZjzVV3BW)ka{=J|u_>4l{-2o)9YhVN4aQ+W{Xl zVi%ZY#c|acCDCl7u_MR{1AEbx1k!1WaqiPJ^IWEzLb9vsZ1bQIlEVaoGL-Z@6r#YP s-o}b>F^nP~2bk%~rANzE00$7X3b6#@NZAEF2Ha}_46x5i%M$_sJDrx#NB{r; diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/images/notification.gif b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/public/webconfigurator/images/notification.gif deleted file mode 100644 index 017fac8d8c940c37f18bb67713483c38c360b5b4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 206 zcmZ?wbhEHb6lM@-I3mFC>htAm&sXicS+Vwf$f4T}FF##eeJ)_#`LM%xnvUFQdHwn7 z=1Ym2F2%3E5b^*2|5a!GfFuJcK=CIFBLjl~gAPa&$W8`UZv_@cj?Z&6cBwRQux9G8 z2PodpRD7_<;KPplXB}Bib?_zgtn@LQy<9!y))K9?7uH;hJd@OTzulnvMkXtR^R)|2 Sj+sgf4-aGuh%6Fdum%7^qDo`{ diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/app/SymfonyRequirements.php b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/app/SymfonyRequirements.php deleted file mode 100644 index cfd55a7..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/app/SymfonyRequirements.php +++ /dev/null @@ -1,603 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Represents a single PHP requirement, e.g. an installed extension. - * It can be a mandatory requirement or an optional recommendation. - * There is a special subclass, named PhpIniRequirement, to check a php.ini configuration. - * - * This file must be compatible with PHP 5.2+. - * - * ************** CAUTION ************** - * - * DO NOT EDIT THIS FILE AS IT WILL BE OVERRIDEN BY COMPOSER - * - * If you want to change this file, edit the one in the - * SensioDistributionBundle instead. - * - * ************** CAUTION ************** - * - * @author Tobias Schultze - */ -class Requirement -{ - private $fulfilled; - private $testMessage; - private $helpText; - private $helpHtml; - private $optional; - - /** - * Constructor that initializes the requirement. - * - * @param Boolean $fulfilled Whether the requirement is fulfilled - * @param string $testMessage The message for testing the requirement - * @param string $helpHtml The help text formatted in HTML for resolving the problem - * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) - * @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement - */ - public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false) - { - $this->fulfilled = (Boolean) $fulfilled; - $this->testMessage = (string) $testMessage; - $this->helpHtml = (string) $helpHtml; - $this->helpText = null === $helpText ? strip_tags($this->helpHtml) : (string) $helpText; - $this->optional = (Boolean) $optional; - } - - /** - * Returns whether the requirement is fulfilled. - * - * @return Boolean true if fulfilled, otherwise false - */ - public function isFulfilled() - { - return $this->fulfilled; - } - - /** - * Returns the message for testing the requirement. - * - * @return string The test message - */ - public function getTestMessage() - { - return $this->testMessage; - } - - /** - * Returns the help text for resolving the problem - * - * @return string The help text - */ - public function getHelpText() - { - return $this->helpText; - } - - /** - * Returns the help text formatted in HTML. - * - * @return string The HTML help - */ - public function getHelpHtml() - { - return $this->helpHtml; - } - - /** - * Returns whether this is only an optional recommendation and not a mandatory requirement. - * - * @return Boolean true if optional, false if mandatory - */ - public function isOptional() - { - return $this->optional; - } -} - -/** - * Represents a PHP requirement in form of a php.ini configuration. - * - * @author Tobias Schultze - */ -class PhpIniRequirement extends Requirement -{ - /** - * Constructor that initializes the requirement. - * - * @param string $cfgName The configuration name used for ini_get() - * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false, - or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement - * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. - This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. - Example: You require a config to be true but PHP later removes this config and defaults it to true internally. - * @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived) - * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived) - * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) - * @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement - */ - public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false) - { - $cfgValue = ini_get($cfgName); - - if (is_callable($evaluation)) { - if (null === $testMessage || null === $helpHtml) { - throw new InvalidArgumentException('You must provide the parameters testMessage and helpHtml for a callback evaluation.'); - } - - $fulfilled = call_user_func($evaluation, $cfgValue); - } else { - if (null === $testMessage) { - $testMessage = sprintf('%s %s be %s in php.ini', - $cfgName, - $optional ? 'should' : 'must', - $evaluation ? 'enabled' : 'disabled' - ); - } - - if (null === $helpHtml) { - $helpHtml = sprintf('Set %s to %s in php.ini*.', - $cfgName, - $evaluation ? 'on' : 'off' - ); - } - - $fulfilled = $evaluation == $cfgValue; - } - - parent::__construct($fulfilled || ($approveCfgAbsence && false === $cfgValue), $testMessage, $helpHtml, $helpText, $optional); - } -} - -/** - * A RequirementCollection represents a set of Requirement instances. - * - * Users of PHP 5.2 should be able to run the requirements checks. - * This is why the class must be compatible with PHP 5.2 - * (e.g. not using namespaces and closures). - * - * @author Tobias Schultze - */ -class RequirementCollection implements IteratorAggregate -{ - private $requirements = array(); - - /** - * Gets the current RequirementCollection as an Iterator. - * - * @return Traversable A Traversable interface - */ - public function getIterator() - { - return new ArrayIterator($this->requirements); - } - - /** - * Adds a Requirement. - * - * @param Requirement $requirement A Requirement instance - */ - public function add(Requirement $requirement) - { - $this->requirements[] = $requirement; - } - - /** - * Adds a mandatory requirement. - * - * @param Boolean $fulfilled Whether the requirement is fulfilled - * @param string $testMessage The message for testing the requirement - * @param string $helpHtml The help text formatted in HTML for resolving the problem - * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) - */ - public function addRequirement($fulfilled, $testMessage, $helpHtml, $helpText = null) - { - $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, false)); - } - - /** - * Adds an optional recommendation. - * - * @param Boolean $fulfilled Whether the recommendation is fulfilled - * @param string $testMessage The message for testing the recommendation - * @param string $helpHtml The help text formatted in HTML for resolving the problem - * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) - */ - public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText = null) - { - $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, true)); - } - - /** - * Adds a mandatory requirement in form of a php.ini configuration. - * - * @param string $cfgName The configuration name used for ini_get() - * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false, - or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement - * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. - This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. - Example: You require a config to be true but PHP later removes this config and defaults it to true internally. - * @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived) - * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived) - * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) - */ - public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null) - { - $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, false)); - } - - /** - * Adds an optional recommendation in form of a php.ini configuration. - * - * @param string $cfgName The configuration name used for ini_get() - * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false, - or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement - * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. - This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. - Example: You require a config to be true but PHP later removes this config and defaults it to true internally. - * @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived) - * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived) - * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) - */ - public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null) - { - $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, true)); - } - - /** - * Adds a requirement collection to the current set of requirements. - * - * @param RequirementCollection $collection A RequirementCollection instance - */ - public function addCollection(RequirementCollection $collection) - { - $this->requirements = array_merge($this->requirements, $collection->all()); - } - - /** - * Returns both requirements and recommendations. - * - * @return array Array of Requirement instances - */ - public function all() - { - return $this->requirements; - } - - /** - * Returns all mandatory requirements. - * - * @return array Array of Requirement instances - */ - public function getRequirements() - { - $array = array(); - foreach ($this->requirements as $req) { - if (!$req->isOptional()) { - $array[] = $req; - } - } - - return $array; - } - - /** - * Returns the mandatory requirements that were not met. - * - * @return array Array of Requirement instances - */ - public function getFailedRequirements() - { - $array = array(); - foreach ($this->requirements as $req) { - if (!$req->isFulfilled() && !$req->isOptional()) { - $array[] = $req; - } - } - - return $array; - } - - /** - * Returns all optional recommmendations. - * - * @return array Array of Requirement instances - */ - public function getRecommendations() - { - $array = array(); - foreach ($this->requirements as $req) { - if ($req->isOptional()) { - $array[] = $req; - } - } - - return $array; - } - - /** - * Returns the recommendations that were not met. - * - * @return array Array of Requirement instances - */ - public function getFailedRecommendations() - { - $array = array(); - foreach ($this->requirements as $req) { - if (!$req->isFulfilled() && $req->isOptional()) { - $array[] = $req; - } - } - - return $array; - } - - /** - * Returns whether a php.ini configuration is not correct. - * - * @return Boolean php.ini configuration problem? - */ - public function hasPhpIniConfigIssue() - { - foreach ($this->requirements as $req) { - if (!$req->isFulfilled() && $req instanceof PhpIniRequirement) { - return true; - } - } - - return false; - } - - /** - * Returns the PHP configuration file (php.ini) path. - * - * @return string|false php.ini file path - */ - public function getPhpIniConfigPath() - { - return get_cfg_var('cfg_file_path'); - } -} - -/** - * This class specifies all requirements and optional recommendations that - * are necessary to run the Symfony Standard Edition. - * - * @author Tobias Schultze - */ -class SymfonyRequirements extends RequirementCollection -{ - const REQUIRED_PHP_VERSION = '5.3.3'; - - /** - * Constructor that initializes the requirements. - */ - public function __construct() - { - /* mandatory requirements follow */ - - $installedPhpVersion = phpversion(); - - $this->addRequirement( - version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>='), - sprintf('PHP version must be at least %s (%s installed)', self::REQUIRED_PHP_VERSION, $installedPhpVersion), - sprintf('You are running PHP version "%s", but Symfony needs at least PHP "%s" to run. - Before using Symfony, upgrade your PHP installation, preferably to the latest version.', - $installedPhpVersion, self::REQUIRED_PHP_VERSION), - sprintf('Install PHP %s or newer (installed version is %s)', self::REQUIRED_PHP_VERSION, $installedPhpVersion) - ); - - $this->addRequirement( - is_dir(__DIR__.'/../vendor/composer'), - 'Vendor libraries must be installed', - 'Vendor libraries are missing. Install composer following instructions from http://getcomposer.org/. ' . - 'Then run "php composer.phar install" to install them.' - ); - - $this->addRequirement( - file_get_contents(__FILE__) == file_get_contents(__DIR__.'/../vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/app/SymfonyRequirements.php'), - 'Outdated requirements file', - 'Your requirements file is outdated. Run composer install and re-check your configuration.' - ); - - $baseDir = basename(__DIR__); - $this->addRequirement( - is_writable(__DIR__.'/cache'), - "$baseDir/cache/ directory must be writable", - "Change the permissions of the \"$baseDir/cache/\" directory so that the web server can write into it." - ); - - $this->addRequirement( - is_writable(__DIR__.'/logs'), - "$baseDir/logs/ directory must be writable", - "Change the permissions of the \"$baseDir/logs/\" directory so that the web server can write into it." - ); - - $this->addPhpIniRequirement( - 'date.timezone', true, false, - 'date.timezone setting must be set', - 'Set the "date.timezone" setting in php.ini* (like Europe/Paris).' - ); - - if (version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>=')) { - $this->addRequirement( - (in_array(date_default_timezone_get(), DateTimeZone::listIdentifiers())), - sprintf('Default timezone "%s" is not supported by your installation of PHP', date_default_timezone_get()), - 'Fix your php.ini file (check for typos and have a look at the list of deprecated timezones http://php.net/manual/en/timezones.others.php).' - ); - } - - $this->addRequirement( - function_exists('json_encode'), - 'json_encode() must be available', - 'Install and enable the JSON extension.' - ); - - $this->addRequirement( - function_exists('session_start'), - 'session_start() must be available', - 'Install and enable the session extension.' - ); - - $this->addRequirement( - function_exists('ctype_alpha'), - 'ctype_alpha() must be available', - 'Install and enable the ctype extension.' - ); - - $this->addRequirement( - function_exists('token_get_all'), - 'token_get_all() must be available', - 'Install and enable the Tokenizer extension.' - ); - - $this->addRequirement( - function_exists('simplexml_import_dom'), - 'simplexml_import_dom() must be available', - 'Install and enable the SimpleXML extension.' - ); - - $this->addRequirement( - !(function_exists('apc_store') && ini_get('apc.enabled')) || version_compare(phpversion('apc'), '3.0.17', '>='), - 'APC version must be at least 3.0.17', - 'Upgrade your APC extension (3.0.17+)' - ); - - $this->addPhpIniRequirement('detect_unicode', false); - - $this->addPhpIniRequirement( - 'suhosin.executor.include.whitelist', - create_function('$cfgValue', 'return false !== stripos($cfgValue, "phar");'), - true, - 'suhosin.executor.include.whitelist must be configured correctly in php.ini', - 'Add "phar" to suhosin.executor.include.whitelist in php.ini*.' - ); - - $pcreVersion = defined('PCRE_VERSION') ? (float) PCRE_VERSION : null; - - $this->addRequirement( - null !== $pcreVersion && $pcreVersion > 8.0, - sprintf('PCRE extension must be available and at least 8.0 (%s installed)', $pcreVersion ? $pcreVersion : 'not'), - 'Upgrade your PCRE extension (8.0+)' - ); - - /* optional recommendations follow */ - - $this->addRecommendation( - version_compare($installedPhpVersion, '5.3.4', '>='), - sprintf('Your project might not work properly ("Notice: Trying to get property of non-object") due to the PHP bug #52083 before PHP 5.3.4 (%s installed)', $installedPhpVersion), - 'Install PHP 5.3.4 or newer' - ); - - $this->addRecommendation( - version_compare($installedPhpVersion, '5.3.8', '>='), - sprintf('Annotations might not work properly due to the PHP bug #55156 before PHP 5.3.8 (%s installed)', $installedPhpVersion), - 'Install PHP 5.3.8 or newer if your project uses annotations' - ); - - $this->addRecommendation( - class_exists('DomDocument'), - 'PHP-XML module should be installed', - 'Install and enable the PHP-XML module.' - ); - - $this->addRecommendation( - function_exists('mb_strlen'), - 'mb_strlen() should be available', - 'Install and enable the mbstring extension.' - ); - - $this->addRecommendation( - function_exists('iconv'), - 'iconv() should be available', - 'Install and enable the iconv extension.' - ); - - $this->addRecommendation( - function_exists('utf8_decode'), - 'utf8_decode() should be available', - 'Install and enable the XML extension.' - ); - - if (!defined('PHP_WINDOWS_VERSION_BUILD')) { - $this->addRecommendation( - function_exists('posix_isatty'), - 'posix_isatty() should be available', - 'Install and enable the php_posix extension (used to colorize the CLI output).' - ); - } - - $this->addRecommendation( - class_exists('Locale'), - 'intl extension should be available', - 'Install and enable the intl extension (used for validators).' - ); - - if (class_exists('Locale')) { - if (defined('INTL_ICU_VERSION')) { - $version = INTL_ICU_VERSION; - } else { - $reflector = new ReflectionExtension('intl'); - - ob_start(); - $reflector->info(); - $output = strip_tags(ob_get_clean()); - - preg_match('/^ICU version +(?:=> )?(.*)$/m', $output, $matches); - $version = $matches[1]; - } - - $this->addRecommendation( - version_compare($version, '4.0', '>='), - 'intl ICU version should be at least 4+', - 'Upgrade your intl extension with a newer ICU version (4+).' - ); - } - - $accelerator = - (function_exists('apc_store') && ini_get('apc.enabled')) - || - function_exists('eaccelerator_put') && ini_get('eaccelerator.enable') - || - function_exists('xcache_set') - ; - - $this->addRecommendation( - $accelerator, - 'a PHP accelerator should be installed', - 'Install and enable a PHP accelerator like APC (highly recommended).' - ); - - $this->addPhpIniRecommendation('short_open_tag', false); - - $this->addPhpIniRecommendation('magic_quotes_gpc', false, true); - - $this->addPhpIniRecommendation('register_globals', false, true); - - $this->addPhpIniRecommendation('session.auto_start', false); - - $this->addRecommendation( - class_exists('PDO'), - 'PDO should be installed', - 'Install PDO (mandatory for Doctrine).' - ); - - if (class_exists('PDO')) { - $drivers = PDO::getAvailableDrivers(); - $this->addRecommendation( - count($drivers), - sprintf('PDO should have some drivers installed (currently available: %s)', count($drivers) ? implode(', ', $drivers) : 'none'), - 'Install PDO drivers (mandatory for Doctrine).' - ); - } - } -} diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/app/check.php b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/app/check.php deleted file mode 100644 index daa6d0a..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/app/check.php +++ /dev/null @@ -1,55 +0,0 @@ -getPhpIniConfigPath(); - -echo "********************************\n"; -echo "* *\n"; -echo "* Symfony requirements check *\n"; -echo "* *\n"; -echo "********************************\n\n"; - -echo $iniPath ? sprintf("* Configuration file used by PHP: %s\n\n", $iniPath) : "* WARNING: No configuration file (php.ini) used by PHP!\n\n"; - -echo "** ATTENTION **\n"; -echo "* The PHP CLI can use a different php.ini file\n"; -echo "* than the one used with your web server.\n"; -if ('\\' == DIRECTORY_SEPARATOR) { - echo "* (especially on the Windows platform)\n"; -} -echo "* To be on the safe side, please also launch the requirements check\n"; -echo "* from your web server using the web/config.php script.\n"; - -echo_title('Mandatory requirements'); - -foreach ($symfonyRequirements->getRequirements() as $req) { - echo_requirement($req); -} - -echo_title('Optional recommendations'); - -foreach ($symfonyRequirements->getRecommendations() as $req) { - echo_requirement($req); -} - -/** - * Prints a Requirement instance - */ -function echo_requirement(Requirement $requirement) -{ - $result = $requirement->isFulfilled() ? 'OK' : ($requirement->isOptional() ? 'WARNING' : 'ERROR'); - echo ' ' . str_pad($result, 9); - echo $requirement->getTestMessage() . "\n"; - - if (!$requirement->isFulfilled()) { - echo sprintf(" %s\n\n", $requirement->getHelpText()); - } -} - -function echo_title($title) -{ - echo "\n** $title **\n\n"; -} diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/web/config.php b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/web/config.php deleted file mode 100644 index ad215f3..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/web/config.php +++ /dev/null @@ -1,98 +0,0 @@ -getFailedRequirements(); -$minorProblems = $symfonyRequirements->getFailedRecommendations(); - -?> - - - - - - Symfony Configuration - - -
-
-
- - -
-

Welcome!

-

Welcome to your new Symfony project.

-

- This script will guide you through the basic configuration of your project. - You can also do the same by editing the ‘app/config/parameters.yml’ file directly. -

- - -

Major problems

-

Major problems have been detected and must be fixed before continuing:

-
    - -
  1. getHelpHtml() ?>
  2. - -
- - - -

Recommendations

-

- Additionally, toTo enhance your Symfony experience, - it’s recommended that you fix the following: -

-
    - -
  1. getHelpHtml() ?>
  2. - -
- - - hasPhpIniConfigIssue()): ?> -

* - getPhpIniConfigPath()): ?> - Changes to the php.ini file must be done in "getPhpIniConfigPath() ?>". - - To change settings, create a "php.ini". - -

- - - -

Your configuration looks good to run Symfony.

- - - -
-
-
-
Symfony Standard Edition
-
- - diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/Step/doctrine.html.twig b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/Step/doctrine.html.twig deleted file mode 100644 index 444d592..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/Step/doctrine.html.twig +++ /dev/null @@ -1,31 +0,0 @@ -{% extends "SensioDistributionBundle::Configurator/layout.html.twig" %} - -{% block title %}Symfony - Configure database{% endblock %} - -{% block content %} - {% form_theme form "SensioDistributionBundle::Configurator/form.html.twig" %} - {% include "SensioDistributionBundle::Configurator/steps.html.twig" with { "index": index, "count": count } %} - -

Configure your Database

-

If your website needs a database connection, please configure it here.

- - {{ form_errors(form) }} -
-
- {{ form_row(form.driver) }} - {{ form_row(form.host) }} - {{ form_row(form.name) }} -
-
- {{ form_row(form.user) }} - {{ form_row(form.password) }} -
- - {{ form_rest(form) }} - - - -{% endblock %} diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/Step/secret.html.twig b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/Step/secret.html.twig deleted file mode 100644 index 4718e7d..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/Step/secret.html.twig +++ /dev/null @@ -1,44 +0,0 @@ -{% extends "SensioDistributionBundle::Configurator/layout.html.twig" %} - -{% block title %}Symfony - Configure global Secret{% endblock %} - -{% block content %} - {% form_theme form "SensioDistributionBundle::Configurator/form.html.twig" %} - {% include "SensioDistributionBundle::Configurator/steps.html.twig" with { "index": index, "count": count } %} - -

Global Secret

-

Configure the global secret for your website (the secret is used for the CSRF protection among other things):

- - {{ form_errors(form) }} -
-
- {{ form_label(form.secret) }} -
- {{ form_widget(form.secret) }} - Generate -
- {{ form_errors(form.secret) }} -
-
-
- - {{ form_rest(form) }} - - - - - - -{% endblock %} diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/check.html.twig b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/check.html.twig deleted file mode 100644 index 52a0648..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/check.html.twig +++ /dev/null @@ -1,43 +0,0 @@ -{% extends "SensioDistributionBundle::Configurator/layout.html.twig" %} - -{% block content %} - {% if majors|length %} -

Major Problems that need to be fixed now

-

- We have detected {{ majors|length }} major problems. - You must fix them before continuing: -

-
    - {% for message in majors %} -
  1. {{ message }}
  2. - {% endfor %} -
- {% endif %} - - {% if minors|length %} -

Some Recommandations

- -

- {% if majors|length %} - Additionally, we - {% else %} - We - {% endif %} - have detected some minor problems that we recommend you to fix to have a better Symfony - experience: - -

    - {% for message in minors %} -
  1. {{ message }}
  2. - {% endfor %} -
-

- - {% endif %} - - {% if not majors|length %} - - {% endif %} -{% endblock %} diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/final.html.twig b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/final.html.twig deleted file mode 100644 index f4a0237..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/final.html.twig +++ /dev/null @@ -1,28 +0,0 @@ -{% extends "SensioDistributionBundle::Configurator/layout.html.twig" %} - -{% block content_class %}config_done{% endblock %} -{% block content %} -

Well done!

- {% if is_writable %} -

Your distribution is configured!

- {% else %} -

Your distribution is almost configured but...

- {% endif %} -

- - {% if is_writable %} - Your parameters.yml file has been overwritten with these parameters (in {{ yml_path }}): - {% else %} - Your parameters.yml file is not writeable! Here are the parameters you can copy and paste in {{ yml_path }}: - {% endif %} - -

- - - - {% if welcome_url %} - - {% endif %} -{% endblock %} diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/form.html.twig b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/form.html.twig deleted file mode 100644 index c92b314..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/form.html.twig +++ /dev/null @@ -1,34 +0,0 @@ -{% extends "form_div_layout.html.twig" %} - -{% block form_rows %} -
- {{ form_errors(form) }} -
- {% for child in form %} - {{ form_row(child) }} - {% endfor %} -{% endblock %} - -{% block form_row %} -
- {{ form_label(form) }} -
- {{ form_widget(form) }} -
- {{ form_errors(form) }} -
-
-
-{% endblock %} - -{% block form_label %} - {% if label is empty %} - {% set label = name|humanize %} - {% endif %} - -{% endblock %} diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/layout.html.twig b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/layout.html.twig deleted file mode 100644 index 3238fc3..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/layout.html.twig +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - {% block title %}Web Configurator Bundle{% endblock %} - - - -
-
- Symfony logo -
-
- {% block content %}{% endblock %} -
-
Symfony Standard Edition v.{{ version }}
-
- - diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/steps.html.twig b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/steps.html.twig deleted file mode 100644 index c228827..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views/Configurator/steps.html.twig +++ /dev/null @@ -1,14 +0,0 @@ -
- {% for i in 1..count %} - - {% if i == index + 1 %} - Step {{ i }} - {% else %} - Step {{ i }} - {% endif %} - - {% if i != count %} - > - {% endif %} - {% endfor %} -
diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/SensioDistributionBundle.php b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/SensioDistributionBundle.php deleted file mode 100644 index 88a2913..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/SensioDistributionBundle.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\DistributionBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; -use Sensio\Bundle\DistributionBundle\Configurator\Step\DoctrineStep; -use Sensio\Bundle\DistributionBundle\Configurator\Step\SecretStep; - -/** - * SensioDistributionBundle. - * - * @author Fabien Potencier - * @author Marc Weistroff - */ -class SensioDistributionBundle extends Bundle -{ - public function boot() - { - $configurator = $this->container->get('sensio.distribution.webconfigurator'); - $configurator->addStep(new DoctrineStep($configurator->getParameters())); - $configurator->addStep(new SecretStep($configurator->getParameters())); - } -} diff --git a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/composer.json b/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/composer.json deleted file mode 100644 index 1a60e63..0000000 --- a/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/composer.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "sensio/distribution-bundle", - "description": "The base bundle for the Symfony Distributions", - "keywords": ["distribution","configuration"], - "type": "symfony-bundle", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "require": { - "symfony/framework-bundle": "2.1.*" - }, - "autoload": { - "psr-0": { "Sensio\\Bundle\\DistributionBundle": "" } - }, - "target-dir": "Sensio/Bundle/DistributionBundle" -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/.gitignore b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/.gitignore deleted file mode 100644 index 1f83134..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -coverage -phpunit.xml -vendor -composer.lock diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/.travis.yml b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/.travis.yml deleted file mode 100644 index 96f6fb3..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: php - -php: - - 5.3 - - 5.4 - -before_script: - - wget http://getcomposer.org/composer.phar - - php composer.phar install diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/CHANGELOG-2.1.md b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/CHANGELOG-2.1.md deleted file mode 100644 index 165e0f9..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/CHANGELOG-2.1.md +++ /dev/null @@ -1,6 +0,0 @@ -CHANGELOG for 2.1.x -=================== - - * added the possibility to configure the id name for the Doctrine converter via the id option - * [BC break] The ParamConverterInterface::apply() method now must return a - Boolean value indicating if a conversion was done. diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Cache.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Cache.php deleted file mode 100644 index 959174c..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Cache.php +++ /dev/null @@ -1,171 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * The Cache class handles the @Cache annotation parts. - * - * @author Fabien Potencier - * @Annotation - */ -class Cache extends ConfigurationAnnotation -{ - /** - * The expiration date as a valid date for the strtotime() function. - * - * @var string - */ - protected $expires; - - /** - * The number of seconds that the response is considered fresh by a private - * cache like a web browser. - * - * @var integer - */ - protected $maxage; - - /** - * The number of seconds that the response is considered fresh by a public - * cache like a reverse proxy cache. - * - * @var integer - */ - protected $smaxage; - - /** - * Whether or not the response is public or not. - * - * @var integer - */ - protected $public; - - /** - * Additional "Vary:"-headers - * - * @var array - */ - protected $vary = array(); - - /** - * Returns the expiration date for the Expires header field. - * - * @return string - */ - public function getExpires() - { - return $this->expires; - } - - /** - * Sets the expiration date for the Expires header field. - * - * @param string $expires A valid php date - */ - public function setExpires($expires) - { - $this->expires = $expires; - } - - /** - * Sets the number of seconds for the max-age cache-control header field. - * - * @param integer $maxage A number of seconds - */ - public function setMaxAge($maxage) - { - $this->maxage = $maxage; - } - - /** - * Returns the number of seconds the response is considered fresh by a - * private cache. - * - * @return integer - */ - public function getMaxAge() - { - return $this->maxage; - } - - /** - * Sets the number of seconds for the s-maxage cache-control header field. - * - * @param integer $smaxage A number of seconds - */ - public function setSMaxAge($smaxage) - { - $this->smaxage = $smaxage; - } - - /** - * Returns the number of seconds the response is considered fresh by a - * public cache. - * - * @return integer - */ - public function getSMaxAge() - { - return $this->smaxage; - } - - /** - * Returns whether or not a response is public. - * - * @return Boolean - */ - public function isPublic() - { - return (Boolean) $this->public; - } - - /** - * Sets a response public. - * - * @param Boolean $public A boolean value - */ - public function setPublic($public) - { - $this->public = (Boolean) $public; - } - - /** - * Returns the custom "Vary"-headers - * - * @return array - */ - public function getVary() - { - return $this->vary; - } - - /** - * Add additional "Vary:"-headers - * - * @param array $vary - */ - public function setVary($vary) - { - $this->vary = $vary; - } - - /** - * Returns the annotation alias name. - * - * @return string - * @see ConfigurationInterface - */ - public function getAliasName() - { - return 'cache'; - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/ConfigurationAnnotation.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/ConfigurationAnnotation.php deleted file mode 100644 index 678de1a..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/ConfigurationAnnotation.php +++ /dev/null @@ -1,22 +0,0 @@ - - */ -abstract class ConfigurationAnnotation implements ConfigurationInterface -{ - public function __construct(array $values) - { - foreach ($values as $k => $v) { - if (!method_exists($this, $name = 'set'.$k)) { - throw new \RuntimeException(sprintf('Unknown key "%s" for annotation "@%s".', $k, get_class($this))); - } - - $this->$name($v); - } - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/ConfigurationInterface.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/ConfigurationInterface.php deleted file mode 100644 index a30df65..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/ConfigurationInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * ConfigurationInterface. - * - * @author Fabien Potencier - */ -interface ConfigurationInterface -{ - /** - * Returns the alias name for an annotated configuration. - * - * @return string - */ - function getAliasName(); -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Method.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Method.php deleted file mode 100644 index 2edad3b..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Method.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * The Method class handles the @Method annotation parts. - * - * @author Fabien Potencier - * @Annotation - */ -class Method extends ConfigurationAnnotation -{ - /** - * An array of restricted HTTP methods. - * - * @var array - */ - protected $methods = array(); - - /** - * Returns the array of HTTP methods. - * - * @return array - */ - public function getMethods() - { - return $this->methods; - } - - /** - * Sets the HTTP methods. - * - * @param array|string $methods An HTTP method or an array of HTTP methods - */ - public function setMethods($methods) - { - $this->methods = is_array($methods) ? $methods : array($methods); - } - - /** - * Sets the HTTP methods. - * - * @param array|string $methods An HTTP method or an array of HTTP methods - */ - public function setValue($methods) - { - $this->setMethods($methods); - } - - /** - * Returns the annotation alias name. - * - * @return string - * @see ConfigurationInterface - */ - public function getAliasName() - { - return 'method'; - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/ParamConverter.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/ParamConverter.php deleted file mode 100644 index 66dfcc5..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/ParamConverter.php +++ /dev/null @@ -1,179 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * The ParamConverter class handles the @ParamConverter annotation parts. - * - * @ParamConverter("post", class="BlogBundle:Post") - * - * @author Fabien Potencier - * @Annotation - */ -class ParamConverter extends ConfigurationAnnotation -{ - /** - * The parameter name. - * - * @var string - */ - protected $name; - - /** - * The parameter class. - * - * @var string - */ - protected $class; - - /** - * An array of options. - * - * @var array - */ - protected $options = array(); - - /** - * Whether or not the parameter is optional. - * - * @var Boolean - */ - protected $optional = false; - - /** - * Use explicitly named converter instead of iterating by priorities. - * - * @var string - */ - protected $converter; - - /** - * Returns the parameter name. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Sets the parameter name. - * - * @param string $name The parameter name - */ - public function setValue($name) - { - $this->setName($name); - } - - /** - * Sets the parameter name. - * - * @param string $name The parameter name - */ - public function setName($name) - { - $this->name = $name; - } - - /** - * Returns the parameter class name. - * - * @return string $name - */ - public function getClass() - { - return $this->class; - } - - /** - * Sets the parameter class name. - * - * @param string $class The parameter class name - */ - public function setClass($class) - { - $this->class = $class; - } - - /** - * Returns an array of options. - * - * @return array - */ - public function getOptions() - { - return $this->options; - } - - /** - * Sets an array of options. - * - * @param array $options An array of options - */ - public function setOptions($options) - { - $this->options = $options; - } - - /** - * Sets whether or not the parameter is optional. - * - * @param Boolean $optional Wether the parameter is optional - */ - public function setIsOptional($optional) - { - $this->optional = (Boolean) $optional; - } - - /** - * Returns whether or not the parameter is optional. - * - * @return Boolean - */ - public function isOptional() - { - return $this->optional; - } - - /** - * Get explicit converter name. - * - * @return string - */ - public function getConverter() - { - return $this->converter; - } - - /** - * Set explicit converter name - * - * @param string $converter - */ - public function setConverter($converter) - { - $this->converter = $converter; - } - - /** - * Returns the annotation alias name. - * - * @return string - * @see ConfigurationInterface - */ - public function getAliasName() - { - return 'converters'; - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Route.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Route.php deleted file mode 100644 index efdaf76..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Route.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * @author Kris Wallsmith - * @Annotation - */ -class Route extends BaseRoute -{ - protected $service; - - public function setService($service) - { - $this->service = $service; - } - - public function getService() - { - return $this->service; - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Template.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Template.php deleted file mode 100644 index bd87e17..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Template.php +++ /dev/null @@ -1,148 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * The Template class handles the @Template annotation parts. - * - * @author Fabien Potencier - * @Annotation - */ -class Template extends ConfigurationAnnotation -{ - /** - * The template reference. - * - * @var TemplateReference - */ - protected $template; - - /** - * The template engine used when a specific template isnt specified - * - * @var string - */ - protected $engine = 'twig'; - - /** - * The associative array of template variables. - * - * @var array - */ - protected $vars = array(); - - /** - * Should the template be streamed? - * - * @var Boolean - */ - protected $streamable = false; - - /** - * Returns the array of templates variables. - * - * @return array - */ - public function getVars() - { - return $this->vars; - } - - /** - * @param Boolean $streamable - */ - public function setIsStreamable($streamable) - { - $this->streamable = $streamable; - } - - /** - * @return Boolean - */ - public function isStreamable() - { - return (Boolean) $this->streamable; - } - - /** - * Sets the template variables - * - * @param array $vars The template variables - */ - public function setVars($vars) - { - $this->vars = $vars; - } - - /** - * Returns the engine used when guessing template names - * - * @return string - */ - public function getEngine() - { - return $this->engine; - } - - /** - * Sets the engine used when guessing template names - * - * @param string - */ - public function setEngine($engine) - { - $this->engine = $engine; - } - - /** - * Sets the template logic name. - * - * @param string $template The template logic name - */ - public function setValue($template) - { - $this->setTemplate($template); - } - - /** - * Returns the template reference. - * - * @return TemplateReference - */ - public function getTemplate() - { - return $this->template; - } - - /** - * Sets the template reference. - * - * @param TemplateReference|string $template The template reference - */ - public function setTemplate($template) - { - $this->template = $template; - } - - /** - * Returns the annotation alias name. - * - * @return string - * @see ConfigurationInterface - */ - public function getAliasName() - { - return 'template'; - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/DependencyInjection/Compiler/AddParamConverterPass.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/DependencyInjection/Compiler/AddParamConverterPass.php deleted file mode 100644 index be39dae..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/DependencyInjection/Compiler/AddParamConverterPass.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\FrameworkExtraBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Adds tagged request.param_converter services to converter.manager service - * - * @author Fabien Potencier - */ -class AddParamConverterPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (false === $container->hasDefinition('sensio_framework_extra.converter.manager')) { - return; - } - - $definition = $container->getDefinition('sensio_framework_extra.converter.manager'); - - foreach ($container->findTaggedServiceIds('request.param_converter') as $id => $converters) { - foreach ($converters as $converter) { - $name = isset($converter['converter']) ? $converter['converter'] : null; - $priority = isset($converter['priority']) ? $converter['priority'] : 0; - - if ($priority === "false") { - $priority = null; - } - - $definition->addMethodCall('add', array(new Reference($id), $priority, $name)); - } - } - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/DependencyInjection/Configuration.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/DependencyInjection/Configuration.php deleted file mode 100644 index 9f12c88..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/DependencyInjection/Configuration.php +++ /dev/null @@ -1,57 +0,0 @@ - - */ -class Configuration implements ConfigurationInterface -{ - /** - * Generates the configuration tree. - * - * @return NodeInterface - */ - public function getConfigTreeBuilder() - { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('sensio_framework_extra', 'array'); - - $rootNode - ->children() - ->arrayNode('router') - ->addDefaultsIfNotSet() - ->children() - ->booleanNode('annotations')->defaultTrue()->end() - ->end() - ->end() - ->arrayNode('request') - ->addDefaultsIfNotSet() - ->children() - ->booleanNode('converters')->defaultTrue()->end() - ->end() - ->end() - ->arrayNode('view') - ->addDefaultsIfNotSet() - ->children() - ->booleanNode('annotations')->defaultTrue()->end() - ->end() - ->end() - ->arrayNode('cache') - ->addDefaultsIfNotSet() - ->children() - ->booleanNode('annotations')->defaultTrue()->end() - ->end() - ->end() - ->end() - ; - - return $treeBuilder; - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/DependencyInjection/SensioFrameworkExtraExtension.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/DependencyInjection/SensioFrameworkExtraExtension.php deleted file mode 100644 index 2294ef6..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/DependencyInjection/SensioFrameworkExtraExtension.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * SensioFrameworkExtraExtension. - * - * @author Fabien Potencier - */ -class SensioFrameworkExtraExtension extends Extension -{ - public function load(array $configs, ContainerBuilder $container) - { - $configuration = $this->getConfiguration($configs, $container); - $config = $this->processConfiguration($configuration, $configs); - - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('services.xml'); - - $annotationsToLoad = array(); - - if ($config['router']['annotations']) { - $annotationsToLoad[] = 'routing.xml'; - } - - if ($config['request']['converters']) { - $annotationsToLoad[] = 'converters.xml'; - } - - if ($config['view']['annotations']) { - $annotationsToLoad[] = 'view.xml'; - } - - if ($config['cache']['annotations']) { - $annotationsToLoad[] = 'cache.xml'; - } - - if ($annotationsToLoad) { - // must be first - $loader->load('annotations.xml'); - - foreach ($annotationsToLoad as $config) { - $loader->load($config); - } - } - } - - /** - * Returns the base path for the XSD files. - * - * @return string The XSD base path - */ - public function getXsdValidationBasePath() - { - return __DIR__.'/../Resources/config/schema'; - } - - public function getNamespace() - { - return 'http://symfony.com/schema/dic/symfony_extra'; - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/EventListener/CacheListener.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/EventListener/CacheListener.php deleted file mode 100644 index 3dd6e87..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/EventListener/CacheListener.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * The CacheListener class has the responsability to modify the - * Response object when a controller uses the @Cache annotation. - * - * @author Fabien Potencier - */ -class CacheListener -{ - /** - * Modifies the response to apply HTTP expiration header fields. - * - * @param FilterResponseEvent $event The notified event - */ - public function onKernelResponse(FilterResponseEvent $event) - { - if (!$configuration = $event->getRequest()->attributes->get('_cache')) { - return; - } - - $response = $event->getResponse(); - - if (!$response->isSuccessful()) { - return; - } - - if (null !== $configuration->getSMaxAge()) { - $response->setSharedMaxAge($configuration->getSMaxAge()); - } - - if (null !== $configuration->getMaxAge()) { - $response->setMaxAge($configuration->getMaxAge()); - } - - if (null !== $configuration->getExpires()) { - $date = \DateTime::createFromFormat('U', strtotime($configuration->getExpires()), new \DateTimeZone('UTC')); - $response->setExpires($date); - } - - if (null !== $configuration->getVary()) { - $response->setVary($configuration->getVary()); - } - - if ($configuration->isPublic()) { - $response->setPublic(); - } - - $event->setResponse($response); - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/EventListener/ControllerListener.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/EventListener/ControllerListener.php deleted file mode 100644 index a4fb72f..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/EventListener/ControllerListener.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * The ControllerListener class parses annotation blocks located in - * controller classes. - * - * @author Fabien Potencier - */ -class ControllerListener -{ - /** - * @var \Doctrine\Common\Annotations\Reader - */ - protected $reader; - - /** - * Constructor. - * - * @param Reader $reader An Reader instance - */ - public function __construct(Reader $reader) - { - $this->reader = $reader; - } - - /** - * Modifies the Request object to apply configuration information found in - * controllers annotations like the template to render or HTTP caching - * configuration. - * - * @param FilterControllerEvent $event A FilterControllerEvent instance - */ - public function onKernelController(FilterControllerEvent $event) - { - if (!is_array($controller = $event->getController())) { - return; - } - - $className = class_exists('Doctrine\Common\Util\ClassUtils') ? ClassUtils::getClass($controller[0]) : get_class($controller[0]); - $object = new \ReflectionClass($className); - $method = $object->getMethod($controller[1]); - - $classConfigurations = $this->getConfigurations($this->reader->getClassAnnotations($object)); - $methodConfigurations = $this->getConfigurations($this->reader->getMethodAnnotations($method)); - - $configurations = array_merge($classConfigurations, $methodConfigurations); - - $request = $event->getRequest(); - foreach ($configurations as $key => $attributes) { - if (is_array($attributes) && count($attributes) == 1) { - $attributes = $attributes[0]; - } - $request->attributes->set($key, $attributes); - } - } - - protected function getConfigurations(array $annotations) - { - $configurations = array(); - foreach ($annotations as $configuration) { - if ($configuration instanceof ConfigurationInterface) { - $configurations['_'.$configuration->getAliasName()][] = $configuration; - } - } - - return $configurations; - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/EventListener/ParamConverterListener.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/EventListener/ParamConverterListener.php deleted file mode 100644 index 30a71dc..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/EventListener/ParamConverterListener.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * The ParamConverterListener handles the @ParamConverter annotation. - * - * @author Fabien Potencier - */ -class ParamConverterListener -{ - /** - * @var Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager - */ - protected $manager; - - /** - * Constructor. - * - * @param ParamConverterManager $manager A ParamConverterManager instance - */ - public function __construct(ParamConverterManager $manager) - { - $this->manager = $manager; - } - - /** - * Modifies the ParamConverterManager instance. - * - * @param FilterControllerEvent $event A FilterControllerEvent instance - */ - public function onKernelController(FilterControllerEvent $event) - { - $controller = $event->getController(); - $request = $event->getRequest(); - $configurations = array(); - - if ($configuration = $request->attributes->get('_converters')) { - foreach (is_array($configuration) ? $configuration : array($configuration) as $configuration) { - $configurations[$configuration->getName()] = $configuration; - } - } - - if (is_array($controller)) { - $r = new \ReflectionMethod($controller[0], $controller[1]); - } else { - $r = new \ReflectionFunction($controller); - } - - // automatically apply conversion for non-configured objects - foreach ($r->getParameters() as $param) { - if (!$param->getClass() || $param->getClass()->isInstance($request)) { - continue; - } - - $name = $param->getName(); - - if (!isset($configurations[$name])) { - $configuration = new ParamConverter(array()); - $configuration->setName($name); - $configuration->setClass($param->getClass()->getName()); - - $configurations[$name] = $configuration; - } elseif (null === $configurations[$name]->getClass()) { - $configurations[$name]->setClass($param->getClass()->getName()); - } - - $configurations[$name]->setIsOptional($param->isOptional()); - } - - $this->manager->apply($request, $configurations); - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/EventListener/TemplateListener.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/EventListener/TemplateListener.php deleted file mode 100644 index c8e2aa1..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/EventListener/TemplateListener.php +++ /dev/null @@ -1,126 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * The TemplateListener class handles the @Template annotation. - * - * @author Fabien Potencier - */ -class TemplateListener -{ - /** - * @var Symfony\Component\DependencyInjection\ContainerInterface - */ - protected $container; - - /** - * Constructor. - * - * @param ContainerInterface $container The service container instance - */ - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - /** - * Guesses the template name to render and its variables and adds them to - * the request object. - * - * @param FilterControllerEvent $event A FilterControllerEvent instance - */ - public function onKernelController(FilterControllerEvent $event) - { - if (!is_array($controller = $event->getController())) { - return; - } - - $request = $event->getRequest(); - - if (!$configuration = $request->attributes->get('_template')) { - return; - } - - if (!$configuration->getTemplate()) { - $guesser = $this->container->get('sensio_framework_extra.view.guesser'); - $configuration->setTemplate($guesser->guessTemplateName($controller, $request, $configuration->getEngine())); - } - - $request->attributes->set('_template', $configuration->getTemplate()); - $request->attributes->set('_template_vars', $configuration->getVars()); - $request->attributes->set('_template_streamable', $configuration->isStreamable()); - - // all controller method arguments - if (!$configuration->getVars()) { - $r = new \ReflectionObject($controller[0]); - - $vars = array(); - foreach ($r->getMethod($controller[1])->getParameters() as $param) { - $vars[] = $param->getName(); - } - - $request->attributes->set('_template_default_vars', $vars); - } - } - - /** - * Renders the template and initializes a new response object with the - * rendered template content. - * - * @param GetResponseForControllerResultEvent $event A GetResponseForControllerResultEvent instance - */ - public function onKernelView(GetResponseForControllerResultEvent $event) - { - $request = $event->getRequest(); - $parameters = $event->getControllerResult(); - $templating = $this->container->get('templating'); - - if (null === $parameters) { - if (!$vars = $request->attributes->get('_template_vars')) { - if (!$vars = $request->attributes->get('_template_default_vars')) { - return; - } - } - - $parameters = array(); - foreach ($vars as $var) { - $parameters[$var] = $request->attributes->get($var); - } - } - - if (!is_array($parameters)) { - return $parameters; - } - - if (!$template = $request->attributes->get('_template')) { - return $parameters; - } - - if (!$request->attributes->get('_template_streamable')) { - $event->setResponse($templating->renderResponse($template, $parameters)); - } else { - $callback = function () use ($templating, $template, $parameters) { - return $templating->stream($template, $parameters); - }; - - - $event->setResponse(new StreamedResponse($callback)); - } - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/LICENSE b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/LICENSE deleted file mode 100644 index c6aa7e3..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010,2011 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/README.md b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/README.md deleted file mode 100644 index 00918ae..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/README.md +++ /dev/null @@ -1,6 +0,0 @@ -SensioFrameworkExtraBundle -========================== - -This bundle provides a way to configure your controllers with annotations. - -Read about it on its [official homepage](http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/index.html). diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/DateTimeParamConverter.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/DateTimeParamConverter.php deleted file mode 100644 index 61c3cd6..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/DateTimeParamConverter.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter; - -use Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationInterface; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use DateTime; - -/** - * Convert DateTime instances from request attribute variable. - * - * @author Benjamin Eberlei - */ -class DateTimeParamConverter implements ParamConverterInterface -{ - public function apply(Request $request, ConfigurationInterface $configuration) - { - $param = $configuration->getName(); - - if (!$request->attributes->has($param)) { - return false; - } - - $options = $configuration->getOptions(); - $value = $request->attributes->get($param); - - $date = isset($options['format']) - ? DateTime::createFromFormat($options['format'], $value) - : new DateTime($value); - - if (!$date) { - throw new NotFoundHttpException('Invalid date given.'); - } - - $request->attributes->set($param, $date); - - return true; - } - - public function supports(ConfigurationInterface $configuration) - { - if (null === $configuration->getClass()) { - return false; - } - - return "DateTime" === $configuration->getClass(); - } -} - diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/DoctrineParamConverter.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/DoctrineParamConverter.php deleted file mode 100644 index 9197a6e..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/DoctrineParamConverter.php +++ /dev/null @@ -1,161 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * DoctrineParamConverter. - * - * @author Fabien Potencier - */ -class DoctrineParamConverter implements ParamConverterInterface -{ - /** - * @var ManagerRegistry - */ - protected $registry; - - public function __construct(ManagerRegistry $registry = null) - { - $this->registry = $registry; - } - - public function apply(Request $request, ConfigurationInterface $configuration) - { - $name = $configuration->getName(); - $class = $configuration->getClass(); - $options = $this->getOptions($configuration); - - // find by identifier? - if (false === $object = $this->find($class, $request, $options, $name)) { - // find by criteria - if (false === $object = $this->findOneBy($class, $request, $options)) { - if ($configuration->isOptional()) { - $object = null; - } else { - throw new \LogicException('Unable to guess how to get a Doctrine instance from the request information.'); - } - } - } - - if (null === $object && false === $configuration->isOptional()) { - throw new NotFoundHttpException(sprintf('%s object not found.', $class)); - } - - $request->attributes->set($name, $object); - - return true; - } - - protected function find($class, Request $request, $options, $name) - { - if ($options['mapping'] || $options['exclude']) { - return false; - } - - $id = $this->getIdentifier($request, $options, $name); - - if (!$id) { - return false; - } - - return $this->registry->getRepository($class, $options['entity_manager'])->find($id); - } - - protected function getIdentifier(Request $request, $options, $name) - { - if (isset($options['id'])) { - if (!is_array($options['id'])) { - $name = $options['id']; - } elseif (is_array($options['id'])) { - $id = array(); - foreach ($options['id'] as $field) { - $id[$field] = $request->attributes->get($field); - } - return $id; - } - } - - if ($request->attributes->has($name)) { - return $request->attributes->get($name); - } - - if ($request->attributes->has('id')) { - return $request->attributes->get('id'); - } - - return false; - } - - protected function findOneBy($class, Request $request, $options) - { - if (!$options['mapping']) { - $keys = $request->attributes->keys(); - $options['mapping'] = $keys ? array_combine($keys, $keys) : array(); - } - - foreach ($options['exclude'] as $exclude) { - unset($options['mapping'][$exclude]); - } - - if (!$options['mapping']) { - return false; - } - - $criteria = array(); - $metadata = $this->registry->getManager($options['entity_manager'])->getClassMetadata($class); - - foreach ($options['mapping'] as $attribute => $field) { - if ($metadata->hasField($field) || ($metadata->hasAssociation($field) && $metadata->isSingleValuedAssociation($field))) { - $criteria[$field] = $request->attributes->get($attribute); - } - } - - if (!$criteria) { - return false; - } - - return $this->registry->getRepository($class, $options['entity_manager'])->findOneBy($criteria); - } - - public function supports(ConfigurationInterface $configuration) - { - // if there is no manager, this means that only Doctrine DBAL is configured - if (null === $this->registry || !count($this->registry->getManagers())) { - return false; - } - - if (null === $configuration->getClass()) { - return false; - } - - $options = $this->getOptions($configuration); - - // Doctrine Entity? - return ! $this->registry->getManager($options['entity_manager']) - ->getMetadataFactory() - ->isTransient($configuration->getClass()); - } - - protected function getOptions(ConfigurationInterface $configuration) - { - return array_replace(array( - 'entity_manager' => null, - 'exclude' => array(), - 'mapping' => array(), - ), $configuration->getOptions()); - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/ParamConverterInterface.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/ParamConverterInterface.php deleted file mode 100644 index d5e0390..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/ParamConverterInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * - * - * @author Fabien Potencier - */ -interface ParamConverterInterface -{ - function apply(Request $request, ConfigurationInterface $configuration); - - function supports(ConfigurationInterface $configuration); -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/ParamConverterManager.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/ParamConverterManager.php deleted file mode 100644 index 1bdd998..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/ParamConverterManager.php +++ /dev/null @@ -1,142 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * Managers converters. - * - * @author Fabien Potencier - * @author Henrik Bjornskov - */ -class ParamConverterManager -{ - /** - * @var array - */ - protected $converters = array(); - - /** - * @var array - */ - protected $namedConverters = array(); - - /** - * Applies all converters to the passed configurations and stops when a - * converter is applied it will move on to the next configuration and so on. - * - * @param Request $request - * @param array|object $configurations - */ - public function apply(Request $request, $configurations) - { - if (is_object($configurations)) { - $configurations = array($configurations); - } - - foreach ($configurations as $configuration) { - $this->applyConverter($request, $configuration); - } - } - - /** - * Apply converter on request based on the given configuration. - * - * @param Request $request - * @param ConfigurationInterface $configuration - */ - protected function applyConverter(Request $request, $configuration) - { - $value = $request->attributes->get($configuration->getName()); - $className = $configuration->getClass(); - - // If the value is already an instance of the class we are trying to convert it into - // we should continue as no convertion is required - if (is_object($value) && $value instanceof $className) { - return; - } - - if ($converterName = $configuration->getConverter()) { - if (!isset($this->namedConverters[$converterName])) { - throw new \RuntimeException(sprintf( - "No converter named '%s' found for conversion of parameter '%s'.", - $converterName, $configuration->getName() - )); - } - - $converter = $this->namedConverters[$converterName]; - - if (!$converter->supports($configuration)) { - throw new \RuntimeException(sprintf( - "Converter '%s' does not support conversion of parameter '%s'.", - $converterName, $configuration->getName() - )); - } - - $converter->apply($request, $configuration); - return; - } - - foreach ($this->all() as $converter) { - if ($converter->supports($configuration)) { - if ($converter->apply($request, $configuration)) { - return; - } - } - } - } - - /** - * Adds a parameter converter. - * - * Converters match either explicitly via $name or by iteration over all - * converters with a $priority. If you pass a $priority = null then the - * added converter will not be part of the iteration chain and can only - * be invoked explicitly. - * - * @param ParamConverterInterface $converter A ParamConverterInterface instance - * @param integer $priority The priority (between -10 and 10). - * @param string $name Name of the converter. - */ - public function add(ParamConverterInterface $converter, $priority = 0, $name = null) - { - if ($priority !== null) { - if (!isset($this->converters[$priority])) { - $this->converters[$priority] = array(); - } - - $this->converters[$priority][] = $converter; - } - - if (null !== $name) { - $this->namedConverters[$name] = $converter; - } - } - - /** - * Returns all registered param converters. - * - * @return array An array of param converters - */ - public function all() - { - krsort($this->converters); - - $converters = array(); - foreach ($this->converters as $all) { - $converters = array_merge($converters, $all); - } - - return $converters; - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/annotations.xml b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/annotations.xml deleted file mode 100644 index 7d2a7eb..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/annotations.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener - - - - - - - - - diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/cache.xml b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/cache.xml deleted file mode 100644 index 4ebc930..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/cache.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/converters.xml b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/converters.xml deleted file mode 100644 index dd8a535..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/converters.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener - Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager - Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter - Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DateTimeParamConverter - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/routing.xml b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/routing.xml deleted file mode 100644 index b3b58cd..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/routing.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - Symfony\Component\Routing\Loader\AnnotationDirectoryLoader - Symfony\Component\Routing\Loader\AnnotationFileLoader - Sensio\Bundle\FrameworkExtraBundle\Routing\AnnotatedRouteControllerLoader - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/services.xml b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/services.xml deleted file mode 100644 index 6c76e61..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/services.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Sensio\Bundle\FrameworkExtraBundle\Templating\TemplateGuesser - - - - - - - - - diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/view.xml b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/view.xml deleted file mode 100644 index e182902..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/config/view.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener - - - - - - - - - - diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/cache.rst b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/cache.rst deleted file mode 100644 index a05d9f6..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/cache.rst +++ /dev/null @@ -1,60 +0,0 @@ -@Cache -====== - -Usage ------ - -The ``@Cache`` annotation makes it easy to define HTTP caching:: - - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; - - /** - * @Cache(expires="tomorrow") - */ - public function indexAction() - { - } - -You can also use the annotation on a class to define caching for all methods:: - - /** - * @Cache(expires="tomorrow") - */ - class BlogController extends Controller - { - } - -When there is a conflict between the class configuration and the method -configuration, the latter overrides the former:: - - /** - * @Cache(expires="tomorrow") - */ - class BlogController extends Controller - { - /** - * @Cache(expires="+2 days") - */ - public function indexAction() - { - } - } - -Attributes ----------- - -Here is a list of accepted attributes and their HTTP header equivalent: - -============================== =============== -Annotation Response Method -============================== =============== -``@Cache(expires="tomorrow")`` ``$response->setExpires()`` -``@Cache(smaxage="15")`` ``$response->setSharedMaxAge()`` -``@Cache(maxage="15")`` ``$response->setMaxAge()`` -``@Cache(vary=["Cookie"])`` ``$response->setVary()`` -============================== =============== - -.. note:: - - The ``expires`` attribute takes any valid date understood by the PHP - ``strtotime()`` function. diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/converters.rst b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/converters.rst deleted file mode 100644 index 633bb3b..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/converters.rst +++ /dev/null @@ -1,217 +0,0 @@ -@ParamConverter -=============== - -Usage ------ - -The ``@ParamConverter`` annotation calls *converters* to convert request -parameters to objects. These objects are stored as request attributes and so -they can be injected as controller method arguments:: - - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; - use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; - - /** - * @Route("/blog/{id}") - * @ParamConverter("post", class="SensioBlogBundle:Post") - */ - public function showAction(Post $post) - { - } - -Several things happens under the hood: - -* The converter tries to get a ``SensioBlogBundle:Post`` object from the - request attributes (request attributes comes from route placeholders -- here - ``id``); - -* If no ``Post`` object is found, a ``404`` Response is generated; - -* If a ``Post`` object is found, a new ``post`` request attribute is defined - (accessible via ``$request->attributes->get('post')``); - -* As for any other request attribute, it is automatically injected in the - controller when present in the method signature. - -If you use type hinting as in the example above, you can even omit the -``@ParamConverter`` annotation altogether:: - - // automatic with method signature - public function showAction(Post $post) - { - } - -To detect which converter is run on a parameter the following process is run: - -* If an explicit converter choice was made with - ``@ParamConverter(converter="name")`` the converter with the given name is - chosen. -* Otherwise all registered parameter converters are iterated by priority. - The ``supports()`` method is invoked to check if a param converter can - convert the request into the required parameter. If it returns ``true`` - the param converter is invoked. - -Built-in Converters -------------------- - -The bundle has two built-in converter, the Doctrine one and a DateTime -converter. - -Doctrine Converter -~~~~~~~~~~~~~~~~~~ - -Converter Name: ``doctrine.orm`` - -The Doctrine Converter attempts to convert request attributes to Doctrine -entities fetched from the database. Two different approaches are possible: - -- Fetch object by primary key -- Fetch object by one or several fields which contain unique values in the - database. - -The following algorithm determines which operation will be performed. - -- If an ``{id}`` parameter is present in the route, find object by primary key. -- If an option ``'id'`` is configured and matches route parameters, find object by primary key. -- If the previous rules do not apply, attempt to find one entity by matching - route parameters to entity fields. You can control this process by - configuring ``exclude`` parameters or a attribute to field name ``mapping``. - -By default, the Doctrine converter uses the *default* entity manager. This can -be configured with the ``entity_manager`` option:: - - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; - use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; - - /** - * @Route("/blog/{id}") - * @ParamConverter("post", class="SensioBlogBundle:Post", options={"entity_manager" = "foo"}) - */ - public function showAction(Post $post) - { - } - -If the placeholder has not the same name as the primary key, pass the ``id`` -option:: - - /** - * @Route("/blog/{post_id}") - * @ParamConverter("post", class="SensioBlogBundle:Post", options={"id" = "post_id"}) - */ - public function showAction(Post $post) - { - } - -This also allows you to have multiple converters in one action:: - - /** - * @Route("/blog/{id}/comments/{comment_id}") - * @ParamConverter("comment", class="SensioBlogBundle:Comment", options={"id" = "comment_id"}) - */ - public function showAction(Post $post, Comment $comment) - { - } - -In the example above, the post parameter is handled automatically, but the comment is -configured with the annotation since they can not both follow the default convention. - -If you want to match an entity using multiple fields use ``mapping``:: - - /** - * @Route("/blog/{date}/{slug}/comments/{comment_slug}") - * @ParamConverter("post", options={"mapping": {"date": "date", "slug": "slug"}) - * @ParamConverter("comment", options={"mapping": {"comment_slug": "slug"}) - */ - public function showAction(Post $post, Comment $comment) - { - } - -If you are matching an entity using several fields, but you want to exclude a -route parameter from being part of the criteria:: - - /** - * @Route("/blog/{date}/{slug}") - * @ParamConverter("post", options={"exclude": ["date"]}) - */ - public function showAction(Post $post, \DateTime $date) - { - } - -DateTime Converter -~~~~~~~~~~~~~~~~~~ - -Converter Name: ``datetime`` - -The datetime converter converts any route or request attribute into a datetime -instance:: - - /** - * @Route("/blog/archive/{start}/{end}") - */ - public function archiveAction(DateTime $start, DateTime $end) - { - } - -By default any date format that can be parsed by the ``DateTime`` constructor -is accepted. You can be stricter with input given through the options:: - - /** - * @Route("/blog/archive/{start}/{end}") - * @ParamConverter("start", options={"format": "Y-m-d"}) - * @ParamConverter("end", options={"format": "Y-m-d"}) - */ - public function archiveAction(DateTime $start, DateTime $end) - { - } - -Creating a Converter --------------------- - -All converters must implement the -:class:`Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\ParamConverterInterface`:: - - namespace Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter; - - use Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationInterface; - use Symfony\Component\HttpFoundation\Request; - - interface ParamConverterInterface - { - function apply(Request $request, ConfigurationInterface $configuration); - - function supports(ConfigurationInterface $configuration); - } - -The ``supports()`` method must return ``true`` when it is able to convert the -given configuration (a ``ParamConverter`` instance). - -The ``ParamConverter`` instance has three information about the annotation: - -* ``name``: The attribute name; -* ``class``: The attribute class name (can be any string representing a class - name); -* ``options``: An array of options - -The ``apply()`` method is called whenever a configuration is supported. Based -on the request attributes, it should set an attribute named -``$configuration->getName()``, which stores an object of class -``$configuration->getClass()``. - -To register your converter service you must add a tag to your service - -.. configuration-block:: - - .. code-block:: xml - - - - - -You can register a converter by priority, by name or both. If you don't -specifiy a priority or name the converter will be added to the converter stack -with a priority of `0`. To explicitly disable the registration by priority you -have to set `priority="false"` in your tag definition. - -.. tip:: - - Use the ``DoctrineParamConverter`` class as a template for your own converters. diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/routing.rst b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/routing.rst deleted file mode 100644 index f993691..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/routing.rst +++ /dev/null @@ -1,166 +0,0 @@ -@Route and @Method -================== - -Usage ------ - -The @Route annotation maps a route pattern with a controller:: - - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; - - class PostController extends Controller - { - /** - * @Route("/") - */ - public function indexAction() - { - // ... - } - } - -The ``index`` action of the ``Post`` controller is now mapped to the ``/`` -URL. This is equivalent to the following YAML configuration: - -.. code-block:: yaml - - blog_home: - pattern: / - defaults: { _controller: SensioBlogBundle:Post:index } - -Like any route pattern, you can define placeholders, requirements, and default -values:: - - /** - * @Route("/{id}", requirements={"id" = "\d+"}, defaults={"foo" = "bar"}) - */ - public function showAction($id) - { - } - -You can also match more than one URL by defining additional ``@Route`` -annotations:: - - /** - * @Route("/", defaults={"id" = 1}) - * @Route("/{id}") - */ - public function showAction($id) - { - } - -Activation ----------- - -The routes need to be imported to be active as any other routing resources -(note the ``annotation`` type): - -.. code-block:: yaml - - # app/config/routing.yml - - # import routes from a controller class - post: - resource: "@SensioBlogBundle/Controller/PostController.php" - type: annotation - -You can also import a whole directory: - -.. code-block:: yaml - - # import routes from a controller directory - blog: - resource: "@SensioBlogBundle/Controller" - type: annotation - -As for any other resource, you can "mount" the routes under a given prefix: - -.. code-block:: yaml - - post: - resource: "@SensioBlogBundle/Controller/PostController.php" - prefix: /blog - type: annotation - -Route Name ----------- - -A route defined with the ``@Route`` annotation is given a default name composed -of the bundle name, the controller name and the action name. That would be -``sensio_blog_post_index`` for the above example; - -The ``name`` attribute can be used to override this default route name:: - - /** - * @Route("/", name="blog_home") - */ - public function indexAction() - { - // ... - } - -Route Prefix ------------- - -A ``@Route`` annotation on a controller class defines a prefix for all action -routes:: - - /** - * @Route("/blog") - */ - class PostController extends Controller - { - /** - * @Route("/{id}") - */ - public function showAction($id) - { - } - } - -The ``show`` action is now mapped to the ``/blog/{id}`` pattern. - -Route Method ------------- - -There is a shortcut ``@Method`` annotation to specify the HTTP method allowed -for the route. To use it, import the ``Method`` annotation namespace:: - - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; - - /** - * @Route("/blog") - */ - class PostController extends Controller - { - /** - * @Route("/edit/{id}") - * @Method({"GET", "POST"}) - */ - public function editAction($id) - { - } - } - -The ``edit`` action is now mapped to the ``/blog/edit/{id}`` pattern if the HTTP -method used is either GET or POST. - -The ``@Method`` annotation is only considered when an action is annotated with -``@Route``. - -Controller as Service ---------------------- - -The ``@Route`` annotation on a controller class can also be used to assign the -controller class to a service so that the controller resolver will instantiate -the controller by fetching it from the DI container instead of calling ``new -PostController()`` itself:: - - /** - * @Route(service="my_post_controller_service") - */ - class PostController extends Controller - { - // ... - } diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/view.rst b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/view.rst deleted file mode 100644 index 92ff80e..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/view.rst +++ /dev/null @@ -1,87 +0,0 @@ -@Template -========= - -Usage ------ - -The ``@Template`` annotation associates a controller with a template name:: - - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; - - /** - * @Template("SensioBlogBundle:Post:show.html.twig") - */ - public function showAction($id) - { - // get the Post - $post = ...; - - return array('post' => $post); - } - -When using the ``@Template`` annotation, the controller should return an -array of parameters to pass to the view instead of a ``Response`` object. - -.. tip:: - If the action returns a ``Response`` object, the ``@Template`` - annotation is simply ignored. - -If the template is named after the controller and action names, which is the -case for the above example, you can even omit the annotation value:: - - /** - * @Template - */ - public function showAction($id) - { - // get the Post - $post = ...; - - return array('post' => $post); - } - -..note:: - - If you are using PHP as a templating system, you need to make it - explicit:: - - /** - * @Template(engine="php") - */ - public function showAction($id) - { - // ... - } - -And if the only parameters to pass to the template are method arguments, you -can use the ``vars`` attribute instead of returning an array. This is very -useful in combination with the ``@ParamConverter`` :doc:`annotation -`:: - - /** - * @ParamConverter("post", class="SensioBlogBundle:Post") - * @Template("SensioBlogBundle:Post:show.html.twig", vars={"post"}) - */ - public function showAction(Post $post) - { - } - -which, thanks to conventions, is equivalent to the following configuration:: - - /** - * @Template(vars={"post"}) - */ - public function showAction(Post $post) - { - } - -You can make it even more concise as all method arguments are automatically -passed to the template if the method returns ``null`` and no ``vars`` -attribute is defined:: - - /** - * @Template - */ - public function showAction(Post $post) - { - } diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/index.rst b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/index.rst deleted file mode 100644 index fcf7a30..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/index.rst +++ /dev/null @@ -1,145 +0,0 @@ -SensioFrameworkExtraBundle -========================== - -The default Symfony2 ``FrameworkBundle`` implements a basic but robust and -flexible MVC framework. `SensioFrameworkExtraBundle`_ extends it to add sweet -conventions and annotations. It allows for more concise controllers. - -Installation ------------- - -`Download`_ the bundle and put it under the ``Sensio\Bundle\`` namespace. -Then, like for any other bundle, include it in your Kernel class:: - - public function registerBundles() - { - $bundles = array( - ... - - new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), - ); - - ... - } - -Configuration -------------- - -All features provided by the bundle are enabled by default when the bundle is -registered in your Kernel class. - -The default configuration is as follow: - -.. configuration-block:: - - .. code-block:: yaml - - sensio_framework_extra: - router: { annotations: true } - request: { converters: true } - view: { annotations: true } - cache: { annotations: true } - - .. code-block:: xml - - - - - - - - - - .. code-block:: php - - // load the profiler - $container->loadFromExtension('sensio_framework_extra', array( - 'router' => array('annotations' => true), - 'request' => array('converters' => true), - 'view' => array('annotations' => true), - 'cache' => array('annotations' => true), - )); - -You can disable some annotations and conventions by defining one or more -settings to false. - -Annotations for Controllers ---------------------------- - -Annotations are a great way to easily configure your controllers, from the -routes to the cache configuration. - -Even if annotations are not a native feature of PHP, it still has several -advantages over the classic Symfony2 configuration methods: - -* Code and configuration are in the same place (the controller class); -* Simple to learn and to use; -* Concise to write; -* Makes your Controller thin (as its sole responsibility is to get data from - the Model). - -.. tip:: - - If you use view classes, annotations are a great way to avoid creating - view classes for simple and common use cases. - -The following annotations are defined by the bundle: - -.. toctree:: - :maxdepth: 1 - - annotations/routing - annotations/converters - annotations/view - annotations/cache - -This example shows all the available annotations in action:: - - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; - use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; - - /** - * @Route("/blog") - * @Cache(expires="tomorrow") - */ - class AnnotController extends Controller - { - /** - * @Route("/") - * @Template - */ - public function indexAction() - { - $posts = ...; - - return array('posts' => $posts); - } - - /** - * @Route("/{id}") - * @Method("GET") - * @ParamConverter("post", class="SensioBlogBundle:Post") - * @Template("SensioBlogBundle:Annot:post.html.twig", vars={"post"}) - * @Cache(smaxage="15") - */ - public function showAction(Post $post) - { - } - } - -As the ``showAction`` method follows some conventions, you can omit some -annotations:: - - /** - * @Route("/{id}") - * @Cache(smaxage="15") - */ - public function showAction(Post $post) - { - } - -.. _`SensioFrameworkExtraBundle`: https://github.com/sensio/SensioFrameworkExtraBundle -.. _`Download`: http://github.com/sensio/SensioFrameworkExtraBundle diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Routing/AnnotatedRouteControllerLoader.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Routing/AnnotatedRouteControllerLoader.php deleted file mode 100644 index 1396abc..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Routing/AnnotatedRouteControllerLoader.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * AnnotatedRouteControllerLoader is an implementation of AnnotationClassLoader - * that sets the '_controller' default based on the class and method names. - * - * It also parse the @Method annotation. - * - * @author Fabien Potencier - */ -class AnnotatedRouteControllerLoader extends AnnotationClassLoader -{ - /** - * Configures the _controller default parameter and eventually the _method - * requirement of a given Route instance. - * - * @param Route $route A Route instance - * @param ReflectionClass $class A ReflectionClass instance - * @param ReflectionMethod $method A ReflectionClass method - */ - protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot) - { - // controller - $classAnnot = $this->reader->getClassAnnotation($class, $this->routeAnnotationClass); - if ($classAnnot instanceof FrameworkExtraBundleRoute && $service = $classAnnot->getService()) { - $route->setDefault('_controller', $service.':'.$method->getName()); - } else { - $route->setDefault('_controller', $class->getName().'::'.$method->getName()); - } - - // requirements (@Method) - foreach ($this->reader->getMethodAnnotations($method) as $configuration) { - if ($configuration instanceof Method) { - $route->setRequirement('_method', implode('|', $configuration->getMethods())); - } - } - } - - /** - * Makes the default route name more sane by removing common keywords. - * - * @param ReflectionClass $class A ReflectionClass instance - * @param ReflectionMethod $method A ReflectionMethod instance - * @return string - */ - protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method) - { - $routeName = parent::getDefaultRouteName($class, $method); - - return preg_replace(array( - '/(bundle|controller)_/', - '/action(_\d+)?$/', - '/__/' - ), array( - '_', - '\\1', - '_' - ), $routeName); - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/SensioFrameworkExtraBundle.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/SensioFrameworkExtraBundle.php deleted file mode 100644 index 2574a09..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/SensioFrameworkExtraBundle.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * SensioFrameworkExtraBundle. - * - * @author Fabien Potencier - */ -class SensioFrameworkExtraBundle extends Bundle -{ - public function build(ContainerBuilder $container) - { - parent::build($container); - - $container->addCompilerPass(new AddParamConverterPass()); - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Templating/TemplateGuesser.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Templating/TemplateGuesser.php deleted file mode 100644 index f80b2eb..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Templating/TemplateGuesser.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * The TemplateGuesser class handles the guessing of template name based on controller - * - * @author Fabien Potencier - */ -class TemplateGuesser -{ - /** - * @var Symfony\Component\HttpKernel\KernelInterface - */ - protected $kernel; - - /** - * Constructor. - * - * @param KernelInterface $kernel A KernelInterface instance - */ - public function __construct(KernelInterface $kernel) - { - $this->kernel = $kernel; - } - - /** - * Guesses and returns the template name to render based on the controller - * and action names. - * - * @param array $controller An array storing the controller object and action method - * @param Request $request A Request instance - * @param string $engine - * @return TemplateReference template reference - * @throws \InvalidArgumentException - */ - public function guessTemplateName($controller, Request $request, $engine = 'twig') - { - $className = class_exists('Doctrine\Common\Util\ClassUtils') ? ClassUtils::getClass($controller[0]) : get_class($controller[0]); - - if (!preg_match('/Controller\\\(.+)Controller$/', $className, $matchController)) { - throw new \InvalidArgumentException(sprintf('The "%s" class does not look like a controller class (it must be in a "Controller" sub-namespace and the class name must end with "Controller")', get_class($controller[0]))); - - } - if (!preg_match('/^(.+)Action$/', $controller[1], $matchAction)) { - throw new \InvalidArgumentException(sprintf('The "%s" method does not look like an action method (it does not end with Action)', $controller[1])); - } - - $bundle = $this->getBundleForClass($className); - - return new TemplateReference($bundle->getName(), $matchController[1], $matchAction[1], $request->getRequestFormat(), $engine); - } - - /** - * Returns the Bundle instance in which the given class name is located. - * - * @param string $class A fully qualified controller class name - * @param Bundle $bundle A Bundle instance - * @throws \InvalidArgumentException - */ - protected function getBundleForClass($class) - { - $reflectionClass = new \ReflectionClass($class); - $bundles = $this->kernel->getBundles(); - - do { - $namespace = $reflectionClass->getNamespaceName(); - foreach ($bundles as $bundle) { - if (0 === strpos($namespace, $bundle->getNamespace())) { - return $bundle; - } - } - $reflectionClass = $reflectionClass->getParentClass(); - } while ($reflectionClass); - - throw new \InvalidArgumentException(sprintf('The "%s" class does not belong to a registered bundle.', $class)); - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/Configuration/ConfigurationAnnotationTest.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/Configuration/ConfigurationAnnotationTest.php deleted file mode 100644 index 2725d6b..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/Configuration/ConfigurationAnnotationTest.php +++ /dev/null @@ -1,18 +0,0 @@ -getMockForAbstractClass('Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationAnnotation', array( - array( - 'doesNotExists' => true, - ), - )); - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/EventListener/CacheListenerTest.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/EventListener/CacheListenerTest.php deleted file mode 100644 index c7d5072..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/EventListener/CacheListenerTest.php +++ /dev/null @@ -1,101 +0,0 @@ -listener = new CacheListener(); - $this->response = new Response(); - $this->cache = new Cache(array()); - $this->request = $this->createRequest($this->cache); - $this->event = $this->createEventMock($this->request, $this->response); - } - - public function testWontReassignResponseWhenResponseIsUnsuccessful() - { - $this->event - ->expects($this->never()) - ->method('setResponse') - ; - - $this->response->setStatusCode(404); - - $this->assertInternalType('null', $this->listener->onKernelResponse($this->event)); - } - - public function testWontReassignResponseWhenNoConfigurationIsPresent() - { - $this->event - ->expects($this->never()) - ->method('setResponse') - ; - - $this->request->attributes->remove('_cache'); - - $this->assertInternalType('null', $this->listener->onKernelResponse($this->event)); - } - - public function testResponseIsPublicIfConfigurationIsPublic() - { - $request = $this->createRequest(new Cache(array( - 'public' => true, - ))); - - $this->listener->onKernelResponse($this->createEventMock($request, $this->response)); - - $this->assertTrue($this->response->headers->hasCacheControlDirective('public')); - $this->assertFalse($this->response->headers->hasCacheControlDirective('private')); - } - - public function testConfigurationAttributesAreSetOnResponse() - { - $this->assertInternalType('null', $this->response->getMaxAge()); - $this->assertInternalType('null', $this->response->getExpires()); - $this->assertFalse($this->response->headers->hasCacheControlDirective('s-maxage')); - - $this->request->attributes->set('_cache', new Cache(array( - 'expires' => 'tomorrow', - 'smaxage' => '15', - 'maxage' => '15', - ))); - - $this->listener->onKernelResponse($this->event); - - $this->assertEquals('15', $this->response->getMaxAge()); - $this->assertEquals('15', $this->response->headers->getCacheControlDirective('s-maxage')); - $this->assertInstanceOf('DateTime', $this->response->getExpires()); - } - - protected function createRequest(Cache $cache = null) - { - return new Request(array(), array(), array( - '_cache' => $cache, - )); - } - - protected function createEventMock(Request $request, Response $response) - { - $event = $this->getMock('Symfony\Component\HttpKernel\Event\FilterResponseEvent', array(), array(), '', null); - $event - ->expects($this->any()) - ->method('getRequest') - ->will($this->returnValue($request)) - ; - - $event - ->expects($this->any()) - ->method('getResponse') - ->will($this->returnValue($response)) - ; - - return $event; - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/EventListener/ControllerListenerTest.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/EventListener/ControllerListenerTest.php deleted file mode 100644 index 7dc59b6..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/EventListener/ControllerListenerTest.php +++ /dev/null @@ -1,104 +0,0 @@ -listener = new ControllerListener(new AnnotationReader()); - $this->request = $this->createRequest(); - } - - public function tearDown() - { - $this->listener = null; - $this->request = null; - } - - public function testCacheAnnotationAtMethod() - { - $controller = new FooControllerCacheAtMethod(); - - $this->event = $this->getFilterControllerEvent(array($controller, 'barAction'), $this->request); - $this->listener->onKernelController($this->event); - - $this->assertNotNull($this->getReadedCache()); - $this->assertEquals(FooControllerCacheAtMethod::METHOD_SMAXAGE, $this->getReadedCache()->getSMaxAge()); - } - - public function testCacheAnnotationAtClass() - { - $controller = new FooControllerCacheAtClass(); - $this->event = $this->getFilterControllerEvent(array($controller, 'barAction'), $this->request); - $this->listener->onKernelController($this->event); - - $this->assertNotNull($this->getReadedCache()); - $this->assertEquals(FooControllerCacheAtClass::CLASS_SMAXAGE, $this->getReadedCache()->getSMaxAge()); - } - - public function testCacheAnnotationAtClassAndMethod() - { - $controller = new FooControllerCacheAtClassAndMethod(); - $this->event = $this->getFilterControllerEvent(array($controller, 'barAction'), $this->request); - $this->listener->onKernelController($this->event); - - $this->assertNotNull($this->getReadedCache()); - $this->assertEquals(FooControllerCacheAtClassAndMethod::METHOD_SMAXAGE, $this->getReadedCache()->getSMaxAge()); - - $this->event = $this->getFilterControllerEvent(array($controller, 'bar2Action'), $this->request); - $this->listener->onKernelController($this->event); - - $this->assertNotNull($this->getReadedCache()); - $this->assertEquals(FooControllerCacheAtClassAndMethod::CLASS_SMAXAGE, $this->getReadedCache()->getSMaxAge()); - } - - public function testMultipleAnnotationsOnMethod() - { - $controller = new FooControllerCacheAtClassAndMethod(); - $this->event = $this->getFilterControllerEvent(array($controller, 'bar3Action'), $this->request); - $this->listener->onKernelController($this->event); - - $annotations = $this->getReadedCache(); - $this->assertNotNull($annotations); - $this->assertArrayHasKey(0, $annotations); - $this->assertInstanceOf('Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache', $annotations[0]); - $this->assertEquals(FooControllerCacheAtClassAndMethod::METHOD_SMAXAGE, $annotations[0]->getSMaxAge()); - - $this->assertArrayHasKey(1, $annotations); - $this->assertInstanceOf('Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache', $annotations[1]); - $this->assertEquals(FooControllerCacheAtClassAndMethod::METHOD_SECOND_SMAXAGE, $annotations[1]->getSMaxAge()); - - $this->assertEquals(2, count($annotations)); - } - - protected function createRequest(Cache $cache = null) - { - return new Request(array(), array(), array( - '_cache' => $cache, - )); - } - - protected function getFilterControllerEvent($controller, Request $request) - { - $mockKernel = $this->getMockForAbstractClass('Symfony\Component\HttpKernel\Kernel', array('', '')); - - return new FilterControllerEvent($mockKernel, $controller, $request, HttpKernelInterface::MASTER_REQUEST); - } - - protected function getReadedCache() - { - return $this->request->attributes->get('_cache'); - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/EventListener/Fixture/FooControllerCacheAtClass.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/EventListener/Fixture/FooControllerCacheAtClass.php deleted file mode 100644 index 619f7fc..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/EventListener/Fixture/FooControllerCacheAtClass.php +++ /dev/null @@ -1,17 +0,0 @@ -getMock('Symfony\Component\HttpKernel\HttpKernelInterface'); - $request = new Request(); - - $manager = $this->getMock('Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager'); - $manager->expects($this->once()) - ->method('apply') - ->with($this->equalTo($request), $this->equalTo(array())); - - $listener = new ParamConverterListener($manager); - $event = new FilterControllerEvent($kernel, array(new TestController(), 'execute'), $request, null); - - $listener->onKernelController($event); - } -} - -class TestController -{ - public function execute(Request $request) {} -} - diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/Request/ParamConverter/DateTimeParamConverterTest.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/Request/ParamConverter/DateTimeParamConverterTest.php deleted file mode 100644 index 544c14e..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/Request/ParamConverter/DateTimeParamConverterTest.php +++ /dev/null @@ -1,69 +0,0 @@ -converter = new DateTimeParamConverter(); - } - - public function testSupports() - { - $config = $this->createConfiguration("DateTime"); - $this->assertTrue($this->converter->supports($config)); - - $config = $this->createConfiguration(__CLASS__); - $this->assertFalse($this->converter->supports($config)); - - $config = $this->createConfiguration(); - $this->assertFalse($this->converter->supports($config)); - } - - public function testApply() - { - $request = new Request(array(), array(), array('start' => '2012-07-21 00:00:00')); - $config = $this->createConfiguration("DateTime", "start"); - - $this->converter->apply($request, $config); - - $this->assertInstanceOf("DateTime", $request->attributes->get('start')); - $this->assertEquals('2012-07-21', $request->attributes->get('start')->format('Y-m-d')); - } - - public function testApplyWithFormatInvalidDate404Exception() - { - $request = new Request(array(), array(), array('start' => '2012-07-21')); - $config = $this->createConfiguration("DateTime", "start"); - $config->expects($this->any())->method('getOptions')->will($this->returnValue(array('format' => 'd.m.Y'))); - - $this->setExpectedException('Symfony\Component\HttpKernel\Exception\NotFoundHttpException', 'Invalid date given.'); - $this->converter->apply($request, $config); - } - - public function createConfiguration($class = null, $name = null) - { - $config = $this->getMock( - 'Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationInterface', array( - 'getClass', 'getAliasName', 'getOptions', 'getName', - )); - if ($name !== null) { - $config->expects($this->any()) - ->method('getName') - ->will($this->returnValue($name)); - } - if ($class !== null) { - $config->expects($this->any()) - ->method('getClass') - ->will($this->returnValue($class)); - } - - return $config; - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/Request/ParamConverter/DoctrineParamConverterTest.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/Request/ParamConverter/DoctrineParamConverterTest.php deleted file mode 100644 index e9090b0..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/Request/ParamConverter/DoctrineParamConverterTest.php +++ /dev/null @@ -1,170 +0,0 @@ -markTestSkipped(); - } - - $this->manager = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry'); - $this->converter = new DoctrineParamConverter($this->manager); - } - - public function createConfiguration($class = null, array $options = null, $name = 'arg', $isOptional = false) - { - $config = $this->getMock( - 'Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationInterface', array( - 'getClass', 'getAliasName', 'getOptions', 'isOptional', 'getName', - )); - if ($options !== null) { - $config->expects($this->once()) - ->method('getOptions') - ->will($this->returnValue($options)); - } - if ($class !== null) { - $config->expects($this->any()) - ->method('getClass') - ->will($this->returnValue($class)); - } - $config->expects($this->any()) - ->method('getName') - ->will($this->returnValue($name)); - $config->expects($this->any()) - ->method('isOptional') - ->will($this->returnValue($isOptional)); - - return $config; - } - - public function testApplyWithNoIdAndData() - { - $request = new Request(); - $config = $this->createConfiguration(null, array()); - $objectManager = $this->getMock('Doctrine\Common\Persistence\ObjectManager'); - - $this->setExpectedException('LogicException'); - $this->converter->apply($request, $config); - } - - public function testApplyWithNoIdAndDataOptional() - { - $request = new Request(); - $config = $this->createConfiguration(null, array(), 'arg', true); - $objectManager = $this->getMock('Doctrine\Common\Persistence\ObjectManager'); - - $ret = $this->converter->apply($request, $config); - - $this->assertTrue($ret); - $this->assertNull($request->attributes->get('arg')); - } - - public function testApplyWithId() - { - $request = new Request(); - $request->attributes->set('id', 1); - - $config = $this->createConfiguration('stdClass', array('id' => 'id'), 'arg'); - - $objectRepository = $this->getMock('Doctrine\Common\Persistence\ObjectRepository'); - $this->manager->expects($this->once()) - ->method('getRepository') - ->will($this->returnValue($objectRepository)); - - $objectRepository->expects($this->once()) - ->method('find') - ->with($this->equalTo(1)) - ->will($this->returnValue($object =new \stdClass)); - - $ret = $this->converter->apply($request, $config); - - $this->assertTrue($ret); - $this->assertSame($object, $request->attributes->get('arg')); - } - - public function testApplyWithMappingAndExclude() - { - $request = new Request(); - $request->attributes->set('foo', 1); - $request->attributes->set('bar', 2); - - $config = $this->createConfiguration( - 'stdClass', - array('mapping' => array('foo' => 'Foo'), 'exclude' => array('bar')), - 'arg' - ); - - $objectManager = $this->getMock('Doctrine\Common\Persistence\ObjectManager'); - $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - - $this->manager->expects($this->once()) - ->method('getManager') - ->will($this->returnValue($objectManager)); - $objectManager->expects($this->once()) - ->method('getClassMetadata') - ->will($this->returnValue($metadata)); - - $metadata->expects($this->once()) - ->method('hasField') - ->with($this->equalTo('Foo')) - ->will($this->returnValue(true)); - - $objectRepository = $this->getMock('Doctrine\Common\Persistence\ObjectRepository'); - $this->manager->expects($this->once()) - ->method('getRepository') - ->will($this->returnValue($objectRepository)); - - $objectRepository->expects($this->once()) - ->method('findOneBy') - ->with($this->equalTo(array('Foo' => 1))) - ->will($this->returnValue($object =new \stdClass)); - - $ret = $this->converter->apply($request, $config); - - $this->assertTrue($ret); - $this->assertSame($object, $request->attributes->get('arg')); - } - - public function testSupports() - { - $config = $this->createConfiguration('stdClass', array()); - $metadataFactory = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadataFactory'); - $metadataFactory->expects($this->once()) - ->method('isTransient') - ->with($this->equalTo('stdClass')) - ->will($this->returnValue( false )); - - $objectManager = $this->getMock('Doctrine\Common\Persistence\ObjectManager'); - $objectManager->expects($this->once()) - ->method('getMetadataFactory') - ->will($this->returnValue($metadataFactory)); - - $this->manager->expects($this->once()) - ->method('getManagers') - ->will($this->returnValue(array($objectManager))); - - $this->manager->expects($this->once()) - ->method('getManager') - ->will($this->returnValue($objectManager)); - - $ret = $this->converter->supports($config); - - $this->assertTrue($ret, "Should be supported"); - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/Request/ParamConverter/ParamConverterManagerTest.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/Request/ParamConverter/ParamConverterManagerTest.php deleted file mode 100644 index 7c26206..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/Request/ParamConverter/ParamConverterManagerTest.php +++ /dev/null @@ -1,166 +0,0 @@ -manager = new ParamConverterManager(); - } - - public function testPriorities() - { - $this->assertEquals(array(), $this->manager->all()); - - $high = $this->createParamConverterMock(); - $low = $this->createParamConverterMock(); - - $this->manager->add($low); - $this->manager->add($high, 10); - - $this->assertEquals(array( - $high, - $low, - ), $this->manager->all()); - } - - public function testApply() - { - $supported = $this->createParamConverterMock(); - $supported - ->expects($this->once()) - ->method('supports') - ->will($this->returnValue(true)) - ; - $supported - ->expects($this->once()) - ->method('apply') - ->will($this->returnValue(false)) - ; - - $invalid = $this->createParamConverterMock(); - $invalid - ->expects($this->once()) - ->method('supports') - ->will($this->returnValue(false)) - ; - $invalid - ->expects($this->never()) - ->method('apply') - ; - - $configurations = array( - new Configuration\ParamConverter(array( - 'name' => 'var', - )), - ); - - $this->manager->add($supported); - $this->manager->add($invalid); - $this->manager->apply(new Request(), $configurations); - } - - public function testApplyNamedConverter() - { - $converter = $this->createParamConverterMock(); - $converter - ->expects($this->any()) - ->method('supports') - ->will($this->returnValue(True)) - ; - - $converter - ->expects($this->any()) - ->method('apply') - ; - - $this->manager->add($converter, 0, "test"); - - $request = new Request(); - $request->attributes->set('param', '1234'); - - $configuration = new Configuration\ParamConverter(array( - 'name' => 'param', - 'class' => 'stdClass', - 'converter' => 'test', - )); - - $this->manager->apply($request, array($configuration)); - } - - public function testApplyNamedConverterNotSupportsParameter() - { - $converter = $this->createParamConverterMock(); - $converter - ->expects($this->any()) - ->method('supports') - ->will($this->returnValue(false)) - ; - - $this->manager->add($converter, 0, "test"); - - $request = new Request(); - $request->attributes->set('param', '1234'); - - $configuration = new Configuration\ParamConverter(array( - 'name' => 'param', - 'class' => 'stdClass', - 'converter' => 'test', - )); - - $this->setExpectedException("RuntimeException", "Converter 'test' does not support conversion of parameter 'param'."); - $this->manager->apply($request, array($configuration)); - } - - public function testApplyNamedConverterNoConverter() - { - $request = new Request(); - $request->attributes->set('param', '1234'); - - $configuration = new Configuration\ParamConverter(array( - 'name' => 'param', - 'class' => 'stdClass', - 'converter' => 'test', - )); - - $this->setExpectedException("RuntimeException", "No converter named 'test' found for conversion of parameter 'param'."); - $this->manager->apply($request, array($configuration)); - } - - public function testApplyNotCalledOnAlreadyConvertedObjects() - { - - $converter = $this->createParamConverterMock(); - $converter - ->expects($this->never()) - ->method('supports') - ; - - $converter - ->expects($this->never()) - ->method('apply') - ; - - $this->manager->add($converter); - - $request = new Request(); - $request->attributes->set('converted', new \stdClass); - - $configuration = new Configuration\ParamConverter(array( - 'name' => 'converted', - 'class' => 'stdClass', - )); - - $this->manager->apply($request, array($configuration)); - } - - protected function createParamConverterMock() - { - return $this->getMock('Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInterface'); - } -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/UPGRADE.md b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/UPGRADE.md deleted file mode 100644 index 692f1f1..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/UPGRADE.md +++ /dev/null @@ -1,50 +0,0 @@ -UPGRADE FROM 2.0 to 2.1 -======================= - -### DoctrineParamConverter: Request Attributes with same name as Arguments - -Previously the DoctrineParamConverter defaulted to finding objects by 'id' -parameter. This is unintuitive and is now overwritten by a behavior where -the request attributes with the same name as entity arguments is matched -with higher priority. - -This might cause problems if you are using this parameter for another object conversion. - -### DoctrineParamConverter with multiple Arguments may clash - -In 2.0 the parameter converter matched only entity fields against route parameters. -With 2.1, the matching now also includes single-valued associations. Depending -on fields in entities this might lead to clashes when you update to the latest version. - -Example that may break with the latest (2.1) version: - - /** - * @Route("/user/{email}/{address}") - * @ParamConverter("address", class="MyBundle:Address", options={"id": "address"}) - */ - public function showAction(User $user, Address $address) - { - } - - class User - { - /** @ORM\Column(type="string") */ - public $email; - /** @ORM\ManyToOne(targetEntity="Address") */ - public $address; - } - -Since address exists as field in `User` and User is not searched by primary key but -by field, this scenario now adds `address` to the criteria to find a user instance. -In scenarios of related entities this might even (just) work, but you never know. - -You can fix this by configuring explicit mapping for `User`: - - /** - * @Route("/user/{email}/{address}") - * @ParamConverter("address", options={"id": "address"}) - * @ParamConverter("email", options={"exclude": ["address"]}) - */ - public function showAction(User $user, Address $address) - { - } diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/composer.json b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/composer.json deleted file mode 100644 index 5935192..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/composer.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "sensio/framework-extra-bundle", - "description": "This bundle provides a way to configure your controllers with annotations", - "keywords": ["annotations","controllers"], - "type": "symfony-bundle", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "require": { - "symfony/framework-bundle": "2.1.*", - "doctrine/common": ">=2.1,<2.4-dev" - }, - "autoload": { - "psr-0": { "Sensio\\Bundle\\FrameworkExtraBundle": "" } - }, - "target-dir": "Sensio/Bundle/FrameworkExtraBundle", - "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev" - } - }, - "minimum-stability": "dev" -} diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/phpunit.xml.dist b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/phpunit.xml.dist deleted file mode 100644 index cfa0dd3..0000000 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/phpunit.xml.dist +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - ./Tests - - - - - - ./ - - ./Resources - ./Tests - ./vendor - - - - diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/.gitignore b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/.gitignore deleted file mode 100644 index 6852100..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -phpunit.xml -vendor -composer.lock diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/.travis.yml b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/.travis.yml deleted file mode 100644 index 96f6fb3..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: php - -php: - - 5.3 - - 5.4 - -before_script: - - wget http://getcomposer.org/composer.phar - - php composer.phar install diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateBundleCommand.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateBundleCommand.php deleted file mode 100644 index c326907..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateBundleCommand.php +++ /dev/null @@ -1,316 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Command; - -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; -use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; -use Sensio\Bundle\GeneratorBundle\Generator\BundleGenerator; -use Sensio\Bundle\GeneratorBundle\Manipulator\KernelManipulator; -use Sensio\Bundle\GeneratorBundle\Manipulator\RoutingManipulator; -use Sensio\Bundle\GeneratorBundle\Command\Helper\DialogHelper; - -/** - * Generates bundles. - * - * @author Fabien Potencier - */ -class GenerateBundleCommand extends ContainerAwareCommand -{ - private $generator; - - /** - * @see Command - */ - protected function configure() - { - $this - ->setDefinition(array( - new InputOption('namespace', '', InputOption::VALUE_REQUIRED, 'The namespace of the bundle to create'), - new InputOption('dir', '', InputOption::VALUE_REQUIRED, 'The directory where to create the bundle'), - new InputOption('bundle-name', '', InputOption::VALUE_REQUIRED, 'The optional bundle name'), - new InputOption('format', '', InputOption::VALUE_REQUIRED, 'Use the format for configuration files (php, xml, yml, or annotation)', 'annotation'), - new InputOption('structure', '', InputOption::VALUE_NONE, 'Whether to generate the whole directory structure'), - )) - ->setDescription('Generates a bundle') - ->setHelp(<<generate:bundle command helps you generates new bundles. - -By default, the command interacts with the developer to tweak the generation. -Any passed option will be used as a default value for the interaction -(--namespace is the only one needed if you follow the -conventions): - -php app/console generate:bundle --namespace=Acme/BlogBundle - -Note that you can use / instead of \\ for the namespace delimiter to avoid any -problem. - -If you want to disable any user interaction, use --no-interaction but don't forget to pass all needed options: - -php app/console generate:bundle --namespace=Acme/BlogBundle --dir=src [--bundle-name=...] --no-interaction - -Note that the bundle namespace must end with "Bundle". -EOT - ) - ->setName('generate:bundle') - ; - } - - /** - * @see Command - * - * @throws \InvalidArgumentException When namespace doesn't end with Bundle - * @throws \RuntimeException When bundle can't be executed - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $dialog = $this->getDialogHelper(); - - if ($input->isInteractive()) { - if (!$dialog->askConfirmation($output, $dialog->getQuestion('Do you confirm generation', 'yes', '?'), true)) { - $output->writeln('Command aborted'); - - return 1; - } - } - - foreach (array('namespace', 'dir') as $option) { - if (null === $input->getOption($option)) { - throw new \RuntimeException(sprintf('The "%s" option must be provided.', $option)); - } - } - - $namespace = Validators::validateBundleNamespace($input->getOption('namespace')); - if (!$bundle = $input->getOption('bundle-name')) { - $bundle = strtr($namespace, array('\\' => '')); - } - $bundle = Validators::validateBundleName($bundle); - $dir = Validators::validateTargetDir($input->getOption('dir'), $bundle, $namespace); - $format = Validators::validateFormat($input->getOption('format')); - $structure = $input->getOption('structure'); - - $dialog->writeSection($output, 'Bundle generation'); - - if (!$this->getContainer()->get('filesystem')->isAbsolutePath($dir)) { - $dir = getcwd().'/'.$dir; - } - - $generator = $this->getGenerator(); - $generator->generate($namespace, $bundle, $dir, $format, $structure); - - $output->writeln('Generating the bundle code: OK'); - - $errors = array(); - $runner = $dialog->getRunner($output, $errors); - - // check that the namespace is already autoloaded - $runner($this->checkAutoloader($output, $namespace, $bundle, $dir)); - - // register the bundle in the Kernel class - $runner($this->updateKernel($dialog, $input, $output, $this->getContainer()->get('kernel'), $namespace, $bundle)); - - // routing - $runner($this->updateRouting($dialog, $input, $output, $bundle, $format)); - - $dialog->writeGeneratorSummary($output, $errors); - } - - protected function interact(InputInterface $input, OutputInterface $output) - { - $dialog = $this->getDialogHelper(); - $dialog->writeSection($output, 'Welcome to the Symfony2 bundle generator'); - - // namespace - $output->writeln(array( - '', - 'Your application code must be written in bundles. This command helps', - 'you generate them easily.', - '', - 'Each bundle is hosted under a namespace (like Acme/Bundle/BlogBundle).', - 'The namespace should begin with a "vendor" name like your company name, your', - 'project name, or your client name, followed by one or more optional category', - 'sub-namespaces, and it should end with the bundle name itself', - '(which must have Bundle as a suffix).', - '', - 'See http://symfony.com/doc/current/cookbook/bundles/best_practices.html#index-1 for more', - 'details on bundle naming conventions.', - '', - 'Use / instead of \\ for the namespace delimiter to avoid any problem.', - '', - )); - - $namespace = $dialog->askAndValidate($output, $dialog->getQuestion('Bundle namespace', $input->getOption('namespace')), array('Sensio\Bundle\GeneratorBundle\Command\Validators', 'validateBundleNamespace'), false, $input->getOption('namespace')); - $input->setOption('namespace', $namespace); - - // bundle name - $bundle = $input->getOption('bundle-name') ?: strtr($namespace, array('\\Bundle\\' => '', '\\' => '')); - $output->writeln(array( - '', - 'In your code, a bundle is often referenced by its name. It can be the', - 'concatenation of all namespace parts but it\'s really up to you to come', - 'up with a unique name (a good practice is to start with the vendor name).', - 'Based on the namespace, we suggest '.$bundle.'.', - '', - )); - $bundle = $dialog->askAndValidate($output, $dialog->getQuestion('Bundle name', $bundle), array('Sensio\Bundle\GeneratorBundle\Command\Validators', 'validateBundleName'), false, $bundle); - $input->setOption('bundle-name', $bundle); - - // target dir - $dir = $input->getOption('dir') ?: dirname($this->getContainer()->getParameter('kernel.root_dir')).'/src'; - $output->writeln(array( - '', - 'The bundle can be generated anywhere. The suggested default directory uses', - 'the standard conventions.', - '', - )); - $dir = $dialog->askAndValidate($output, $dialog->getQuestion('Target directory', $dir), function ($dir) use ($bundle, $namespace) { return Validators::validateTargetDir($dir, $bundle, $namespace); }, false, $dir); - $input->setOption('dir', $dir); - - // format - $output->writeln(array( - '', - 'Determine the format to use for the generated configuration.', - '', - )); - $format = $dialog->askAndValidate($output, $dialog->getQuestion('Configuration format (yml, xml, php, or annotation)', $input->getOption('format')), array('Sensio\Bundle\GeneratorBundle\Command\Validators', 'validateFormat'), false, $input->getOption('format')); - $input->setOption('format', $format); - - // optional files to generate - $output->writeln(array( - '', - 'To help you get started faster, the command can generate some', - 'code snippets for you.', - '', - )); - - $structure = $input->getOption('structure'); - if (!$structure && $dialog->askConfirmation($output, $dialog->getQuestion('Do you want to generate the whole directory structure', 'no', '?'), false)) { - $structure = true; - } - $input->setOption('structure', $structure); - - // summary - $output->writeln(array( - '', - $this->getHelper('formatter')->formatBlock('Summary before generation', 'bg=blue;fg=white', true), - '', - sprintf("You are going to generate a \"%s\\%s\" bundle\nin \"%s\" using the \"%s\" format.", $namespace, $bundle, $dir, $format), - '', - )); - } - - protected function checkAutoloader(OutputInterface $output, $namespace, $bundle, $dir) - { - $output->write('Checking that the bundle is autoloaded: '); - if (!class_exists($namespace.'\\'.$bundle)) { - return array( - '- Edit the composer.json file and register the bundle', - ' namespace in the "autoload" section:', - '', - ); - } - } - - protected function updateKernel($dialog, InputInterface $input, OutputInterface $output, KernelInterface $kernel, $namespace, $bundle) - { - $auto = true; - if ($input->isInteractive()) { - $auto = $dialog->askConfirmation($output, $dialog->getQuestion('Confirm automatic update of your Kernel', 'yes', '?'), true); - } - - $output->write('Enabling the bundle inside the Kernel: '); - $manip = new KernelManipulator($kernel); - try { - $ret = $auto ? $manip->addBundle($namespace.'\\'.$bundle) : false; - - if (!$ret) { - $reflected = new \ReflectionObject($kernel); - - return array( - sprintf('- Edit %s', $reflected->getFilename()), - ' and add the following bundle in the AppKernel::registerBundles() method:', - '', - sprintf(' new %s(),', $namespace.'\\'.$bundle), - '', - ); - } - } catch (\RuntimeException $e) { - return array( - sprintf('Bundle %s is already defined in AppKernel::registerBundles().', $namespace.'\\'.$bundle), - '', - ); - } - } - - protected function updateRouting($dialog, InputInterface $input, OutputInterface $output, $bundle, $format) - { - $auto = true; - if ($input->isInteractive()) { - $auto = $dialog->askConfirmation($output, $dialog->getQuestion('Confirm automatic update of the Routing', 'yes', '?'), true); - } - - $output->write('Importing the bundle routing resource: '); - $routing = new RoutingManipulator($this->getContainer()->getParameter('kernel.root_dir').'/config/routing.yml'); - try { - $ret = $auto ? $routing->addResource($bundle, $format) : false; - if (!$ret) { - if ('annotation' === $format) { - $help = sprintf(" resource: \"@%s/Controller/\"\n type: annotation\n", $bundle); - } else { - $help = sprintf(" resource: \"@%s/Resources/config/routing.%s\"\n", $bundle, $format); - } - $help .= " prefix: /\n"; - - return array( - '- Import the bundle\'s routing resource in the app main routing file:', - '', - sprintf(' %s:', $bundle), - $help, - '', - ); - } - } catch (\RuntimeException $e) { - return array( - sprintf('Bundle %s is already imported.', $bundle), - '', - ); - } - } - - protected function getGenerator() - { - if (null === $this->generator) { - $this->generator = new BundleGenerator($this->getContainer()->get('filesystem'), __DIR__.'/../Resources/skeleton/bundle'); - } - - return $this->generator; - } - - public function setGenerator(BundleGenerator $generator) - { - $this->generator = $generator; - } - - protected function getDialogHelper() - { - $dialog = $this->getHelperSet()->get('dialog'); - if (!$dialog || get_class($dialog) !== 'Sensio\Bundle\GeneratorBundle\Command\Helper\DialogHelper') { - $this->getHelperSet()->set($dialog = new DialogHelper()); - } - - return $dialog; - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineCommand.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineCommand.php deleted file mode 100644 index 6c784f5..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineCommand.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Command; - -use Doctrine\Bundle\DoctrineBundle\Mapping\MetadataFactory; -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; - -abstract class GenerateDoctrineCommand extends ContainerAwareCommand -{ - public function isEnabled() - { - return class_exists('Doctrine\\Bundle\\DoctrineBundle\\DoctrineBundle'); - } - - protected function parseShortcutNotation($shortcut) - { - $entity = str_replace('/', '\\', $shortcut); - - if (false === $pos = strpos($entity, ':')) { - throw new \InvalidArgumentException(sprintf('The entity name must contain a : ("%s" given, expecting something like AcmeBlogBundle:Blog/Post)', $entity)); - } - - return array(substr($entity, 0, $pos), substr($entity, $pos + 1)); - } - - protected function getEntityMetadata($entity) - { - $factory = new MetadataFactory($this->getContainer()->get('doctrine')); - - return $factory->getClassMetadata($entity)->getMetadata(); - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineCrudCommand.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineCrudCommand.php deleted file mode 100644 index dfe049a..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineCrudCommand.php +++ /dev/null @@ -1,274 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Command; - -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; -use Symfony\Component\Console\Command\Command; -use Sensio\Bundle\GeneratorBundle\Generator\DoctrineCrudGenerator; -use Sensio\Bundle\GeneratorBundle\Generator\DoctrineFormGenerator; -use Sensio\Bundle\GeneratorBundle\Command\Helper\DialogHelper; -use Sensio\Bundle\GeneratorBundle\Manipulator\RoutingManipulator; - -/** - * Generates a CRUD for a Doctrine entity. - * - * @author Fabien Potencier - */ -class GenerateDoctrineCrudCommand extends GenerateDoctrineCommand -{ - private $generator; - private $formGenerator; - - /** - * @see Command - */ - protected function configure() - { - $this - ->setDefinition(array( - new InputOption('entity', '', InputOption::VALUE_REQUIRED, 'The entity class name to initialize (shortcut notation)'), - new InputOption('route-prefix', '', InputOption::VALUE_REQUIRED, 'The route prefix'), - new InputOption('with-write', '', InputOption::VALUE_NONE, 'Whether or not to generate create, new and delete actions'), - new InputOption('format', '', InputOption::VALUE_REQUIRED, 'Use the format for configuration files (php, xml, yml, or annotation)', 'annotation'), - )) - ->setDescription('Generates a CRUD based on a Doctrine entity') - ->setHelp(<<doctrine:generate:crud command generates a CRUD based on a Doctrine entity. - -The default command only generates the list and show actions. - -php app/console doctrine:generate:crud --entity=AcmeBlogBundle:Post --route-prefix=post_admin - -Using the --with-write option allows to generate the new, edit and delete actions. - -php app/console doctrine:generate:crud --entity=AcmeBlogBundle:Post --route-prefix=post_admin --with-write -EOT - ) - ->setName('doctrine:generate:crud') - ->setAliases(array('generate:doctrine:crud')) - ; - } - - /** - * @see Command - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $dialog = $this->getDialogHelper(); - - if ($input->isInteractive()) { - if (!$dialog->askConfirmation($output, $dialog->getQuestion('Do you confirm generation', 'yes', '?'), true)) { - $output->writeln('Command aborted'); - - return 1; - } - } - - $entity = Validators::validateEntityName($input->getOption('entity')); - list($bundle, $entity) = $this->parseShortcutNotation($entity); - - $format = Validators::validateFormat($input->getOption('format')); - $prefix = $this->getRoutePrefix($input, $entity); - $withWrite = $input->getOption('with-write'); - - $dialog->writeSection($output, 'CRUD generation'); - - $entityClass = $this->getContainer()->get('doctrine')->getEntityNamespace($bundle).'\\'.$entity; - $metadata = $this->getEntityMetadata($entityClass); - $bundle = $this->getContainer()->get('kernel')->getBundle($bundle); - - $generator = $this->getGenerator(); - $generator->generate($bundle, $entity, $metadata[0], $format, $prefix, $withWrite); - - $output->writeln('Generating the CRUD code: OK'); - - $errors = array(); - $runner = $dialog->getRunner($output, $errors); - - // form - if ($withWrite) { - $this->generateForm($bundle, $entity, $metadata); - $output->writeln('Generating the Form code: OK'); - } - - // routing - if ('annotation' != $format) { - $runner($this->updateRouting($dialog, $input, $output, $bundle, $format, $entity, $prefix)); - } - - $dialog->writeGeneratorSummary($output, $errors); - } - - protected function interact(InputInterface $input, OutputInterface $output) - { - $dialog = $this->getDialogHelper(); - $dialog->writeSection($output, 'Welcome to the Doctrine2 CRUD generator'); - - // namespace - $output->writeln(array( - '', - 'This command helps you generate CRUD controllers and templates.', - '', - 'First, you need to give the entity for which you want to generate a CRUD.', - 'You can give an entity that does not exist yet and the wizard will help', - 'you defining it.', - '', - 'You must use the shortcut notation like AcmeBlogBundle:Post.', - '', - )); - - $entity = $dialog->askAndValidate($output, $dialog->getQuestion('The Entity shortcut name', $input->getOption('entity')), array('Sensio\Bundle\GeneratorBundle\Command\Validators', 'validateEntityName'), false, $input->getOption('entity')); - $input->setOption('entity', $entity); - list($bundle, $entity) = $this->parseShortcutNotation($entity); - - // Entity exists? - $entityClass = $this->getContainer()->get('doctrine')->getEntityNamespace($bundle).'\\'.$entity; - $metadata = $this->getEntityMetadata($entityClass); - - // write? - $withWrite = $input->getOption('with-write') ?: false; - $output->writeln(array( - '', - 'By default, the generator creates two actions: list and show.', - 'You can also ask it to generate "write" actions: new, update, and delete.', - '', - )); - $withWrite = $dialog->askConfirmation($output, $dialog->getQuestion('Do you want to generate the "write" actions', $withWrite ? 'yes' : 'no', '?'), $withWrite); - $input->setOption('with-write', $withWrite); - - // format - $format = $input->getOption('format'); - $output->writeln(array( - '', - 'Determine the format to use for the generated CRUD.', - '', - )); - $format = $dialog->askAndValidate($output, $dialog->getQuestion('Configuration format (yml, xml, php, or annotation)', $format), array('Sensio\Bundle\GeneratorBundle\Command\Validators', 'validateFormat'), false, $format); - $input->setOption('format', $format); - - // route prefix - $prefix = $this->getRoutePrefix($input, $entity); - $output->writeln(array( - '', - 'Determine the routes prefix (all the routes will be "mounted" under this', - 'prefix: /prefix/, /prefix/new, ...).', - '', - )); - $prefix = $dialog->ask($output, $dialog->getQuestion('Routes prefix', '/'.$prefix), '/'.$prefix); - $input->setOption('route-prefix', $prefix); - - // summary - $output->writeln(array( - '', - $this->getHelper('formatter')->formatBlock('Summary before generation', 'bg=blue;fg=white', true), - '', - sprintf("You are going to generate a CRUD controller for \"%s:%s\"", $bundle, $entity), - sprintf("using the \"%s\" format.", $format), - '', - )); - } - - /** - * Tries to generate forms if they don't exist yet and if we need write operations on entities. - */ - private function generateForm($bundle, $entity, $metadata) - { - try { - $this->getFormGenerator()->generate($bundle, $entity, $metadata[0]); - } catch (\RuntimeException $e ) { - // form already exists - } - } - - private function updateRouting($dialog, InputInterface $input, OutputInterface $output, $bundle, $format, $entity, $prefix) - { - $auto = true; - if ($input->isInteractive()) { - $auto = $dialog->askConfirmation($output, $dialog->getQuestion('Confirm automatic update of the Routing', 'yes', '?'), true); - } - - $output->write('Importing the CRUD routes: '); - $this->getContainer()->get('filesystem')->mkdir($bundle->getPath().'/Resources/config/'); - $routing = new RoutingManipulator($bundle->getPath().'/Resources/config/routing.yml'); - try { - $ret = $auto ? $routing->addResource($bundle->getName(), $format, '/'.$prefix, 'routing/'.strtolower(str_replace('\\', '_', $entity))) : false; - } catch (\RuntimeException $exc) { - $ret = false; - } - - if (!$ret) { - $help = sprintf(" resource: \"@%s/Resources/config/routing/%s.%s\"\n", $bundle->getName(), strtolower(str_replace('\\', '_', $entity)), $format); - $help .= sprintf(" prefix: /%s\n", $prefix); - - return array( - '- Import the bundle\'s routing resource in the bundle routing file', - sprintf(' (%s).', $bundle->getPath().'/Resources/config/routing.yml'), - '', - sprintf(' %s:', $bundle->getName().('' !== $prefix ? '_'.str_replace('/', '_', $prefix) : '')), - $help, - '', - ); - } - } - - protected function getRoutePrefix(InputInterface $input, $entity) - { - $prefix = $input->getOption('route-prefix') ?: strtolower(str_replace(array('\\', '/'), '_', $entity)); - - if ($prefix && '/' === $prefix[0]) { - $prefix = substr($prefix, 1); - } - - return $prefix; - } - - protected function getGenerator() - { - if (null === $this->generator) { - $this->generator = new DoctrineCrudGenerator($this->getContainer()->get('filesystem'), __DIR__.'/../Resources/skeleton/crud'); - } - - return $this->generator; - } - - public function setGenerator(DoctrineCrudGenerator $generator) - { - $this->generator = $generator; - } - - protected function getFormGenerator() - { - if (null === $this->formGenerator) { - $this->formGenerator = new DoctrineFormGenerator($this->getContainer()->get('filesystem'), __DIR__.'/../Resources/skeleton/form'); - } - - return $this->formGenerator; - } - - public function setFormGenerator(DoctrineFormGenerator $formGenerator) - { - $this->formGenerator = $formGenerator; - } - - protected function getDialogHelper() - { - $dialog = $this->getHelperSet()->get('dialog'); - if (!$dialog || get_class($dialog) !== 'Sensio\Bundle\GeneratorBundle\Command\Helper\DialogHelper') { - $this->getHelperSet()->set($dialog = new DialogHelper()); - } - - return $dialog; - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineEntityCommand.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineEntityCommand.php deleted file mode 100644 index 5e0c89e..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineEntityCommand.php +++ /dev/null @@ -1,312 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Command; - -use Sensio\Bundle\GeneratorBundle\Generator\DoctrineEntityGenerator; -use Sensio\Bundle\GeneratorBundle\Command\Helper\DialogHelper; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Doctrine\DBAL\Types\Type; - -/** - * Initializes a Doctrine entity inside a bundle. - * - * @author Fabien Potencier - */ -class GenerateDoctrineEntityCommand extends GenerateDoctrineCommand -{ - private $generator; - - protected function configure() - { - $this - ->setName('doctrine:generate:entity') - ->setAliases(array('generate:doctrine:entity')) - ->setDescription('Generates a new Doctrine entity inside a bundle') - ->addOption('entity', null, InputOption::VALUE_REQUIRED, 'The entity class name to initialize (shortcut notation)') - ->addOption('fields', null, InputOption::VALUE_REQUIRED, 'The fields to create with the new entity') - ->addOption('format', null, InputOption::VALUE_REQUIRED, 'Use the format for configuration files (php, xml, yml, or annotation)', 'annotation') - ->addOption('with-repository', null, InputOption::VALUE_NONE, 'Whether to generate the entity repository or not') - ->setHelp(<<doctrine:generate:entity task generates a new Doctrine -entity inside a bundle: - -php app/console doctrine:generate:entity --entity=AcmeBlogBundle:Blog/Post - -The above command would initialize a new entity in the following entity -namespace Acme\BlogBundle\Entity\Blog\Post. - -You can also optionally specify the fields you want to generate in the new -entity: - -php app/console doctrine:generate:entity --entity=AcmeBlogBundle:Blog/Post --fields="title:string(255) body:text" - -The command can also generate the corresponding entity repository class with the ---with-repository option: - -php app/console doctrine:generate:entity --entity=AcmeBlogBundle:Blog/Post --with-repository - -By default, the command uses annotations for the mapping information; change it -with --format: - -php app/console doctrine:generate:entity --entity=AcmeBlogBundle:Blog/Post --format=yml - -To deactivate the interaction mode, simply use the `--no-interaction` option -without forgetting to pass all needed options: - -php app/console doctrine:generate:entity --entity=AcmeBlogBundle:Blog/Post --format=annotation --fields="title:string(255) body:text" --with-repository --no-interaction -EOT - ); - } - - /** - * @throws \InvalidArgumentException When the bundle doesn't end with Bundle (Example: "Bundle/MySampleBundle") - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $dialog = $this->getDialogHelper(); - - if ($input->isInteractive()) { - if (!$dialog->askConfirmation($output, $dialog->getQuestion('Do you confirm generation', 'yes', '?'), true)) { - $output->writeln('Command aborted'); - - return 1; - } - } - - $entity = Validators::validateEntityName($input->getOption('entity')); - list($bundle, $entity) = $this->parseShortcutNotation($entity); - $format = Validators::validateFormat($input->getOption('format')); - $fields = $this->parseFields($input->getOption('fields')); - - $dialog->writeSection($output, 'Entity generation'); - - $bundle = $this->getContainer()->get('kernel')->getBundle($bundle); - - $generator = $this->getGenerator(); - $generator->generate($bundle, $entity, $format, array_values($fields), $input->getOption('with-repository')); - - $output->writeln('Generating the entity code: OK'); - - $dialog->writeGeneratorSummary($output, array()); - } - - protected function interact(InputInterface $input, OutputInterface $output) - { - $dialog = $this->getDialogHelper(); - $dialog->writeSection($output, 'Welcome to the Doctrine2 entity generator'); - - // namespace - $output->writeln(array( - '', - 'This command helps you generate Doctrine2 entities.', - '', - 'First, you need to give the entity name you want to generate.', - 'You must use the shortcut notation like AcmeBlogBundle:Post.', - '' - )); - - while (true) { - $entity = $dialog->askAndValidate($output, $dialog->getQuestion('The Entity shortcut name', $input->getOption('entity')), array('Sensio\Bundle\GeneratorBundle\Command\Validators', 'validateEntityName'), false, $input->getOption('entity')); - - list($bundle, $entity) = $this->parseShortcutNotation($entity); - - // check reserved words - if ($this->getGenerator()->isReservedKeyword($entity)){ - $output->writeln(sprintf(' "%s" is a reserved word.', $entity)); - continue; - } - - try { - $b = $this->getContainer()->get('kernel')->getBundle($bundle); - - if (!file_exists($b->getPath().'/Entity/'.str_replace('\\', '/', $entity).'.php')) { - break; - } - - $output->writeln(sprintf('Entity "%s:%s" already exists.', $bundle, $entity)); - } catch (\Exception $e) { - $output->writeln(sprintf('Bundle "%s" does not exist.', $bundle)); - } - } - $input->setOption('entity', $bundle.':'.$entity); - - // format - $output->writeln(array( - '', - 'Determine the format to use for the mapping information.', - '', - )); - $format = $dialog->askAndValidate($output, $dialog->getQuestion('Configuration format (yml, xml, php, or annotation)', $input->getOption('format')), array('Sensio\Bundle\GeneratorBundle\Command\Validators', 'validateFormat'), false, $input->getOption('format')); - $input->setOption('format', $format); - - // fields - $input->setOption('fields', $this->addFields($input, $output, $dialog)); - - // repository? - $output->writeln(''); - $withRepository = $dialog->askConfirmation($output, $dialog->getQuestion('Do you want to generate an empty repository class', $input->getOption('with-repository') ? 'yes' : 'no', '?'), $input->getOption('with-repository')); - $input->setOption('with-repository', $withRepository); - - // summary - $output->writeln(array( - '', - $this->getHelper('formatter')->formatBlock('Summary before generation', 'bg=blue;fg=white', true), - '', - sprintf("You are going to generate a \"%s:%s\" Doctrine2 entity", $bundle, $entity), - sprintf("using the \"%s\" format.", $format), - '', - )); - } - - private function parseFields($input) - { - if (is_array($input)) { - return $input; - } - - $fields = array(); - foreach (explode(' ', $input) as $value) { - $elements = explode(':', $value); - $name = $elements[0]; - if (strlen($name)) { - $type = isset($elements[1]) ? $elements[1] : 'string'; - preg_match_all('/(.*)\((.*)\)/', $type, $matches); - $type = isset($matches[1][0]) ? $matches[1][0] : $type; - $length = isset($matches[2][0]) ? $matches[2][0] : null; - - $fields[$name] = array('fieldName' => $name, 'type' => $type, 'length' => $length); - } - } - - return $fields; - } - - private function addFields(InputInterface $input, OutputInterface $output, DialogHelper $dialog) - { - $fields = $this->parseFields($input->getOption('fields')); - $output->writeln(array( - '', - 'Instead of starting with a blank entity, you can add some fields now.', - 'Note that the primary key will be added automatically (named id).', - '', - )); - $output->write('Available types: '); - - $types = array_keys(Type::getTypesMap()); - $count = 20; - foreach ($types as $i => $type) { - if ($count > 50) { - $count = 0; - $output->writeln(''); - } - $count += strlen($type); - $output->write(sprintf('%s', $type)); - if (count($types) != $i + 1) { - $output->write(', '); - } else { - $output->write('.'); - } - } - $output->writeln(''); - - $fieldValidator = function ($type) use ($types) { - // FIXME: take into account user-defined field types - if (!in_array($type, $types)) { - throw new \InvalidArgumentException(sprintf('Invalid type "%s".', $type)); - } - - return $type; - }; - - $lengthValidator = function ($length) { - if (!$length) { - return $length; - } - - $result = filter_var($length, FILTER_VALIDATE_INT, array( - 'options' => array('min_range' => 1) - )); - - if (false === $result) { - throw new \InvalidArgumentException(sprintf('Invalid length "%s".', $length)); - } - - return $length; - }; - - while (true) { - $output->writeln(''); - $self = $this; - $name = $dialog->askAndValidate($output, $dialog->getQuestion('New field name (press to stop adding fields)', null), function ($name) use ($fields, $self) { - if (isset($fields[$name]) || 'id' == $name) { - throw new \InvalidArgumentException(sprintf('Field "%s" is already defined.', $name)); - } - - // check reserved words - if ($self->getGenerator()->isReservedKeyword($name)){ - throw new \InvalidArgumentException(sprintf('Name "%s" is a reserved word.', $name)); - } - - return $name; - }); - if (!$name) { - break; - } - - $defaultType = 'string'; - - if (substr($name, -3) == '_at') { - $defaultType = 'datetime'; - } elseif (substr($name, -3) == '_id') { - $defaultType = 'integer'; - } - - $type = $dialog->askAndValidate($output, $dialog->getQuestion('Field type', $defaultType), $fieldValidator, false, $defaultType); - - $data = array('fieldName' => $name, 'type' => $type); - - if ($type == 'string') { - $data['length'] = $dialog->askAndValidate($output, $dialog->getQuestion('Field length', 255), $lengthValidator, false, 255); - } - - $fields[$name] = $data; - } - - return $fields; - } - - public function getGenerator() - { - if (null === $this->generator) { - $this->generator = new DoctrineEntityGenerator($this->getContainer()->get('filesystem'), $this->getContainer()->get('doctrine')); - } - - return $this->generator; - } - - public function setGenerator(DoctrineEntityGenerator $generator) - { - $this->generator = $generator; - } - - protected function getDialogHelper() - { - $dialog = $this->getHelperSet()->get('dialog'); - if (!$dialog || get_class($dialog) !== 'Sensio\Bundle\GeneratorBundle\Command\Helper\DialogHelper') { - $this->getHelperSet()->set($dialog = new DialogHelper()); - } - - return $dialog; - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineFormCommand.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineFormCommand.php deleted file mode 100644 index 412b46a..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineFormCommand.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Command; - -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; -use Symfony\Component\Console\Command\Command; -use Sensio\Bundle\GeneratorBundle\Generator\DoctrineFormGenerator; - -/** - * Generates a form type class for a given Doctrine entity. - * - * @author Fabien Potencier - * @author Hugo Hamon - */ -class GenerateDoctrineFormCommand extends GenerateDoctrineCommand -{ - /** - * @see Command - */ - protected function configure() - { - $this - ->setDefinition(array( - new InputArgument('entity', InputArgument::REQUIRED, 'The entity class name to initialize (shortcut notation)'), - )) - ->setDescription('Generates a form type class based on a Doctrine entity') - ->setHelp(<<doctrine:generate:form command generates a form class based on a Doctrine entity. - -php app/console doctrine:generate:form AcmeBlogBundle:Post -EOT - ) - ->setName('doctrine:generate:form') - ->setAliases(array('generate:doctrine:form')) - ; - } - - /** - * @see Command - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $entity = Validators::validateEntityName($input->getArgument('entity')); - list($bundle, $entity) = $this->parseShortcutNotation($entity); - - $entityClass = $this->getContainer()->get('doctrine')->getEntityNamespace($bundle).'\\'.$entity; - $metadata = $this->getEntityMetadata($entityClass); - $bundle = $this->getApplication()->getKernel()->getBundle($bundle); - - $generator = new DoctrineFormGenerator($this->getContainer()->get('filesystem'), __DIR__.'/../Resources/skeleton/form'); - $generator->generate($bundle, $entity, $metadata[0]); - - $output->writeln(sprintf( - 'The new %s.php class file has been created under %s.', - $generator->getClassName(), - $generator->getClassPath() - )); - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/Helper/DialogHelper.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/Helper/DialogHelper.php deleted file mode 100644 index c0d8c10..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/Helper/DialogHelper.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Command\Helper; - -use Symfony\Component\Console\Helper\DialogHelper as BaseDialogHelper; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Generates bundles. - * - * @author Fabien Potencier - */ -class DialogHelper extends BaseDialogHelper -{ - public function writeGeneratorSummary(OutputInterface $output, $errors) - { - if (!$errors) { - $this->writeSection($output, 'You can now start using the generated code!'); - } else { - $this->writeSection($output, array( - 'The command was not able to configure everything automatically.', - 'You must do the following changes manually.', - ), 'error'); - - $output->writeln($errors); - } - } - - public function getRunner(OutputInterface $output, &$errors) - { - $runner = function ($err) use ($output, &$errors) { - if ($err) { - $output->writeln('FAILED'); - $errors = array_merge($errors, $err); - } else { - $output->writeln('OK'); - } - }; - - return $runner; - } - - public function writeSection(OutputInterface $output, $text, $style = 'bg=blue;fg=white') - { - $output->writeln(array( - '', - $this->getHelperSet()->get('formatter')->formatBlock($text, $style, true), - '', - )); - } - - public function getQuestion($question, $default, $sep = ':') - { - return $default ? sprintf('%s [%s]%s ', $question, $default, $sep) : sprintf('%s%s ', $question, $sep); - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/Validators.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/Validators.php deleted file mode 100644 index 7904da2..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/Validators.php +++ /dev/null @@ -1,160 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Command; - -/** - * Validator functions. - * - * @author Fabien Potencier - */ -class Validators -{ - static public function validateBundleNamespace($namespace) - { - if (!preg_match('/Bundle$/', $namespace)) { - throw new \InvalidArgumentException('The namespace must end with Bundle.'); - } - - $namespace = strtr($namespace, '/', '\\'); - if (!preg_match('/^(?:[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\\\?)+$/', $namespace)) { - throw new \InvalidArgumentException('The namespace contains invalid characters.'); - } - - // validate reserved keywords - $reserved = self::getReservedWords(); - foreach (explode('\\', $namespace) as $word) { - if (in_array(strtolower($word), $reserved)) { - throw new \InvalidArgumentException(sprintf('The namespace cannot contain PHP reserved words ("%s").', $word)); - } - } - - // validate that the namespace is at least one level deep - if (false === strpos($namespace, '\\')) { - $msg = array(); - $msg[] = sprintf('The namespace must contain a vendor namespace (e.g. "VendorName\%s" instead of simply "%s").', $namespace, $namespace); - $msg[] = 'If you\'ve specified a vendor namespace, did you forget to surround it with quotes (init:bundle "Acme\BlogBundle")?'; - - throw new \InvalidArgumentException(implode("\n\n", $msg)); - } - - return $namespace; - } - - static public function validateBundleName($bundle) - { - if (!preg_match('/Bundle$/', $bundle)) { - throw new \InvalidArgumentException('The bundle name must end with Bundle.'); - } - - return $bundle; - } - - static public function validateTargetDir($dir, $bundle, $namespace) - { - // add trailing / if necessary - return '/' === substr($dir, -1, 1) ? $dir : $dir.'/'; - } - - static public function validateFormat($format) - { - $format = strtolower($format); - - if (!in_array($format, array('php', 'xml', 'yml', 'annotation'))) { - throw new \RuntimeException(sprintf('Format "%s" is not supported.', $format)); - } - - return $format; - } - - static public function validateEntityName($entity) - { - if (false === $pos = strpos($entity, ':')) { - throw new \InvalidArgumentException(sprintf('The entity name must contain a : ("%s" given, expecting something like AcmeBlogBundle:Blog/Post)', $entity)); - } - - return $entity; - } - - static public function getReservedWords() - { - return array( - 'abstract', - 'and', - 'array', - 'as', - 'break', - 'case', - 'catch', - 'class', - 'clone', - 'const', - 'continue', - 'declare', - 'default', - 'do', - 'else', - 'elseif', - 'enddeclare', - 'endfor', - 'endforeach', - 'endif', - 'endswitch', - 'endwhile', - 'extends', - 'final', - 'for', - 'foreach', - 'function', - 'global', - 'goto', - 'if', - 'implements', - 'interface', - 'instanceof', - 'namespace', - 'new', - 'or', - 'private', - 'protected', - 'public', - 'static', - 'switch', - 'throw', - 'try', - 'use', - 'var', - 'while', - 'xor', - '__CLASS__', - '__DIR__', - '__FILE__', - '__LINE__', - '__FUNCTION__', - '__METHOD__', - '__NAMESPACE__', - 'die', - 'echo', - 'empty', - 'exit', - 'eval', - 'include', - 'include_once', - 'isset', - 'list', - 'require', - 'require_once', - 'return', - 'print', - 'unset', - ); - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Generator/BundleGenerator.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Generator/BundleGenerator.php deleted file mode 100644 index 049cdec..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Generator/BundleGenerator.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Generator; - -use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\DependencyInjection\Container; - -/** - * Generates a bundle. - * - * @author Fabien Potencier - */ -class BundleGenerator extends Generator -{ - private $filesystem; - private $skeletonDir; - - public function __construct(Filesystem $filesystem, $skeletonDir) - { - $this->filesystem = $filesystem; - $this->skeletonDir = $skeletonDir; - } - - public function generate($namespace, $bundle, $dir, $format, $structure) - { - $dir .= '/'.strtr($namespace, '\\', '/'); - if (file_exists($dir)) { - throw new \RuntimeException(sprintf('Unable to generate the bundle as the target directory "%s" is not empty.', realpath($dir))); - } - - $basename = substr($bundle, 0, -6); - $parameters = array( - 'namespace' => $namespace, - 'bundle' => $bundle, - 'format' => $format, - 'bundle_basename' => $basename, - 'extension_alias' => Container::underscore($basename), - ); - - $this->renderFile($this->skeletonDir, 'Bundle.php', $dir.'/'.$bundle.'.php', $parameters); - $this->renderFile($this->skeletonDir, 'Extension.php', $dir.'/DependencyInjection/'.$basename.'Extension.php', $parameters); - $this->renderFile($this->skeletonDir, 'Configuration.php', $dir.'/DependencyInjection/Configuration.php', $parameters); - $this->renderFile($this->skeletonDir, 'DefaultController.php', $dir.'/Controller/DefaultController.php', $parameters); - $this->renderFile($this->skeletonDir, 'DefaultControllerTest.php', $dir.'/Tests/Controller/DefaultControllerTest.php', $parameters); - $this->renderFile($this->skeletonDir, 'index.html.twig', $dir.'/Resources/views/Default/index.html.twig', $parameters); - - if ('xml' === $format || 'annotation' === $format) { - $this->renderFile($this->skeletonDir, 'services.xml', $dir.'/Resources/config/services.xml', $parameters); - } else { - $this->renderFile($this->skeletonDir, 'services.'.$format, $dir.'/Resources/config/services.'.$format, $parameters); - } - - if ('annotation' != $format) { - $this->renderFile($this->skeletonDir, 'routing.'.$format, $dir.'/Resources/config/routing.'.$format, $parameters); - } - - if ($structure) { - $this->filesystem->mkdir($dir.'/Resources/doc'); - $this->filesystem->touch($dir.'/Resources/doc/index.rst'); - $this->filesystem->mkdir($dir.'/Resources/translations'); - $this->filesystem->copy($this->skeletonDir.'/messages.fr.xlf', $dir.'/Resources/translations/messages.fr.xlf'); - $this->filesystem->mkdir($dir.'/Resources/public/css'); - $this->filesystem->mkdir($dir.'/Resources/public/images'); - $this->filesystem->mkdir($dir.'/Resources/public/js'); - } - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Generator/DoctrineCrudGenerator.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Generator/DoctrineCrudGenerator.php deleted file mode 100644 index 72eb9aa..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Generator/DoctrineCrudGenerator.php +++ /dev/null @@ -1,290 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Generator; - -use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\HttpKernel\Bundle\BundleInterface; -use Doctrine\ORM\Mapping\ClassMetadataInfo; - -/** - * Generates a CRUD controller. - * - * @author Fabien Potencier - */ -class DoctrineCrudGenerator extends Generator -{ - protected $filesystem; - protected $skeletonDir; - protected $routePrefix; - protected $routeNamePrefix; - protected $bundle; - protected $entity; - protected $metadata; - protected $format; - protected $actions; - - /** - * Constructor. - * - * @param Filesystem $filesystem A Filesystem instance - * @param string $skeletonDir Path to the skeleton directory - */ - public function __construct(Filesystem $filesystem, $skeletonDir) - { - $this->filesystem = $filesystem; - $this->skeletonDir = $skeletonDir; - } - - /** - * Generate the CRUD controller. - * - * @param BundleInterface $bundle A bundle object - * @param string $entity The entity relative class name - * @param ClassMetadataInfo $metadata The entity class metadata - * @param string $format The configuration format (xml, yaml, annotation) - * @param string $routePrefix The route name prefix - * @param array $needWriteActions Wether or not to generate write actions - * - * @throws \RuntimeException - */ - public function generate(BundleInterface $bundle, $entity, ClassMetadataInfo $metadata, $format, $routePrefix, $needWriteActions) - { - $this->routePrefix = $routePrefix; - $this->routeNamePrefix = str_replace('/', '_', $routePrefix); - $this->actions = $needWriteActions ? array('index', 'show', 'new', 'edit', 'delete') : array('index', 'show'); - - if (count($metadata->identifier) > 1) { - throw new \RuntimeException('The CRUD generator does not support entity classes with multiple primary keys.'); - } - - if (!in_array('id', $metadata->identifier)) { - throw new \RuntimeException('The CRUD generator expects the entity object has a primary key field named "id" with a getId() method.'); - } - - $this->entity = $entity; - $this->bundle = $bundle; - $this->metadata = $metadata; - $this->setFormat($format); - - $this->generateControllerClass(); - - $dir = sprintf('%s/Resources/views/%s', $this->bundle->getPath(), str_replace('\\', '/', $this->entity)); - - if (!file_exists($dir)) { - $this->filesystem->mkdir($dir, 0777); - } - - $this->generateIndexView($dir); - - if (in_array('show', $this->actions)) { - $this->generateShowView($dir); - } - - if (in_array('new', $this->actions)) { - $this->generateNewView($dir); - } - - if (in_array('edit', $this->actions)) { - $this->generateEditView($dir); - } - - $this->generateTestClass(); - $this->generateConfiguration(); - } - - /** - * Sets the configuration format. - * - * @param string $format The configuration format - */ - private function setFormat($format) - { - switch ($format) { - case 'yml': - case 'xml': - case 'php': - case 'annotation': - $this->format = $format; - break; - default: - $this->format = 'yml'; - break; - } - } - - /** - * Generates the routing configuration. - * - */ - private function generateConfiguration() - { - if (!in_array($this->format, array('yml', 'xml', 'php'))) { - return; - } - - $target = sprintf( - '%s/Resources/config/routing/%s.%s', - $this->bundle->getPath(), - strtolower(str_replace('\\', '_', $this->entity)), - $this->format - ); - - $this->renderFile($this->skeletonDir, 'config/routing.'.$this->format, $target, array( - 'actions' => $this->actions, - 'route_prefix' => $this->routePrefix, - 'route_name_prefix' => $this->routeNamePrefix, - 'bundle' => $this->bundle->getName(), - 'entity' => $this->entity, - )); - } - - /** - * Generates the controller class only. - * - */ - private function generateControllerClass() - { - $dir = $this->bundle->getPath(); - - $parts = explode('\\', $this->entity); - $entityClass = array_pop($parts); - $entityNamespace = implode('\\', $parts); - - $target = sprintf( - '%s/Controller/%s/%sController.php', - $dir, - str_replace('\\', '/', $entityNamespace), - $entityClass - ); - - if (file_exists($target)) { - throw new \RuntimeException('Unable to generate the controller as it already exists.'); - } - - $this->renderFile($this->skeletonDir, 'controller.php', $target, array( - 'actions' => $this->actions, - 'route_prefix' => $this->routePrefix, - 'route_name_prefix' => $this->routeNamePrefix, - 'dir' => $this->skeletonDir, - 'bundle' => $this->bundle->getName(), - 'entity' => $this->entity, - 'entity_class' => $entityClass, - 'namespace' => $this->bundle->getNamespace(), - 'entity_namespace' => $entityNamespace, - 'format' => $this->format, - )); - } - - /** - * Generates the functional test class only. - * - */ - private function generateTestClass() - { - $parts = explode('\\', $this->entity); - $entityClass = array_pop($parts); - $entityNamespace = implode('\\', $parts); - - $dir = $this->bundle->getPath() .'/Tests/Controller'; - $target = $dir .'/'. str_replace('\\', '/', $entityNamespace).'/'. $entityClass .'ControllerTest.php'; - - $this->renderFile($this->skeletonDir, 'tests/test.php', $target, array( - 'route_prefix' => $this->routePrefix, - 'route_name_prefix' => $this->routeNamePrefix, - 'entity' => $this->entity, - 'entity_class' => $entityClass, - 'namespace' => $this->bundle->getNamespace(), - 'entity_namespace' => $entityNamespace, - 'actions' => $this->actions, - 'dir' => $this->skeletonDir, - )); - } - - /** - * Generates the index.html.twig template in the final bundle. - * - * @param string $dir The path to the folder that hosts templates in the bundle - */ - private function generateIndexView($dir) - { - $this->renderFile($this->skeletonDir, 'views/index.html.twig', $dir.'/index.html.twig', array( - 'dir' => $this->skeletonDir, - 'entity' => $this->entity, - 'fields' => $this->metadata->fieldMappings, - 'actions' => $this->actions, - 'record_actions' => $this->getRecordActions(), - 'route_prefix' => $this->routePrefix, - 'route_name_prefix' => $this->routeNamePrefix, - )); - } - - /** - * Generates the show.html.twig template in the final bundle. - * - * @param string $dir The path to the folder that hosts templates in the bundle - */ - private function generateShowView($dir) - { - $this->renderFile($this->skeletonDir, 'views/show.html.twig', $dir.'/show.html.twig', array( - 'dir' => $this->skeletonDir, - 'entity' => $this->entity, - 'fields' => $this->metadata->fieldMappings, - 'actions' => $this->actions, - 'route_prefix' => $this->routePrefix, - 'route_name_prefix' => $this->routeNamePrefix, - )); - } - - /** - * Generates the new.html.twig template in the final bundle. - * - * @param string $dir The path to the folder that hosts templates in the bundle - */ - private function generateNewView($dir) - { - $this->renderFile($this->skeletonDir, 'views/new.html.twig', $dir.'/new.html.twig', array( - 'dir' => $this->skeletonDir, - 'route_prefix' => $this->routePrefix, - 'route_name_prefix' => $this->routeNamePrefix, - 'entity' => $this->entity, - 'actions' => $this->actions, - )); - } - - /** - * Generates the edit.html.twig template in the final bundle. - * - * @param string $dir The path to the folder that hosts templates in the bundle - */ - private function generateEditView($dir) - { - $this->renderFile($this->skeletonDir, 'views/edit.html.twig', $dir.'/edit.html.twig', array( - 'dir' => $this->skeletonDir, - 'route_prefix' => $this->routePrefix, - 'route_name_prefix' => $this->routeNamePrefix, - 'entity' => $this->entity, - 'actions' => $this->actions, - )); - } - - /** - * Returns an array of record actions to generate (edit, show). - * - * @return array - */ - private function getRecordActions() - { - return array_filter($this->actions, function($item) { - return in_array($item, array('show', 'edit')); - }); - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Generator/DoctrineEntityGenerator.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Generator/DoctrineEntityGenerator.php deleted file mode 100644 index cc050eb..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Generator/DoctrineEntityGenerator.php +++ /dev/null @@ -1,119 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Generator; - -use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\HttpKernel\Bundle\BundleInterface; -use Symfony\Bridge\Doctrine\RegistryInterface; -use Doctrine\ORM\Mapping\ClassMetadataInfo; -use Doctrine\ORM\Tools\EntityGenerator; -use Doctrine\ORM\Tools\EntityRepositoryGenerator; -use Doctrine\ORM\Tools\Export\ClassMetadataExporter; - -/** - * Generates a form class based on a Doctrine entity. - * - * @author Fabien Potencier - * @author Jonathan H. Wage - */ -class DoctrineEntityGenerator extends Generator -{ - private $filesystem; - private $registry; - - public function __construct(Filesystem $filesystem, RegistryInterface $registry) - { - $this->filesystem = $filesystem; - $this->registry = $registry; - } - - public function generate(BundleInterface $bundle, $entity, $format, array $fields, $withRepository) - { - // configure the bundle (needed if the bundle does not contain any Entities yet) - $config = $this->registry->getEntityManager(null)->getConfiguration(); - $config->setEntityNamespaces(array_merge( - array($bundle->getName() => $bundle->getNamespace().'\\Entity'), - $config->getEntityNamespaces() - )); - - $entityClass = $this->registry->getEntityNamespace($bundle->getName()).'\\'.$entity; - $entityPath = $bundle->getPath().'/Entity/'.str_replace('\\', '/', $entity).'.php'; - if (file_exists($entityPath)) { - throw new \RuntimeException(sprintf('Entity "%s" already exists.', $entityClass)); - } - - $class = new ClassMetadataInfo($entityClass); - if ($withRepository) { - $class->customRepositoryClassName = $entityClass.'Repository'; - } - $class->mapField(array('fieldName' => 'id', 'type' => 'integer', 'id' => true)); - $class->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); - foreach ($fields as $field) { - $class->mapField($field); - } - - $entityGenerator = $this->getEntityGenerator(); - if ('annotation' === $format) { - $entityGenerator->setGenerateAnnotations(true); - $entityCode = $entityGenerator->generateEntityClass($class); - $mappingPath = $mappingCode = false; - } else { - $cme = new ClassMetadataExporter(); - $exporter = $cme->getExporter('yml' == $format ? 'yaml' : $format); - $mappingPath = $bundle->getPath().'/Resources/config/doctrine/'.str_replace('\\', '.', $entity).'.orm.'.$format; - - if (file_exists($mappingPath)) { - throw new \RuntimeException(sprintf('Cannot generate entity when mapping "%s" already exists.', $mappingPath)); - } - - $mappingCode = $exporter->exportClassMetadata($class); - $entityGenerator->setGenerateAnnotations(false); - $entityCode = $entityGenerator->generateEntityClass($class); - } - - $this->filesystem->mkdir(dirname($entityPath)); - file_put_contents($entityPath, $entityCode); - - if ($mappingPath) { - $this->filesystem->mkdir(dirname($mappingPath)); - file_put_contents($mappingPath, $mappingCode); - } - - if ($withRepository) { - $path = $bundle->getPath().str_repeat('/..', substr_count(get_class($bundle), '\\')); - $this->getRepositoryGenerator()->writeEntityRepositoryClass($class->customRepositoryClassName, $path); - } - } - - public function isReservedKeyword($keyword) - { - return $this->registry->getConnection()->getDatabasePlatform()->getReservedKeywordsList()->isKeyword($keyword); - } - - protected function getEntityGenerator() - { - $entityGenerator = new EntityGenerator(); - $entityGenerator->setGenerateAnnotations(false); - $entityGenerator->setGenerateStubMethods(true); - $entityGenerator->setRegenerateEntityIfExists(false); - $entityGenerator->setUpdateEntityIfExists(true); - $entityGenerator->setNumSpaces(4); - $entityGenerator->setAnnotationPrefix('ORM\\'); - - return $entityGenerator; - } - - protected function getRepositoryGenerator() - { - return new EntityRepositoryGenerator(); - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Generator/DoctrineFormGenerator.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Generator/DoctrineFormGenerator.php deleted file mode 100644 index f083ebc..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Generator/DoctrineFormGenerator.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Generator; - -use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\HttpKernel\Bundle\BundleInterface; -use Doctrine\ORM\Mapping\ClassMetadataInfo; - -/** - * Generates a form class based on a Doctrine entity. - * - * @author Fabien Potencier - * @author Hugo Hamon - */ -class DoctrineFormGenerator extends Generator -{ - private $filesystem; - private $skeletonDir; - private $className; - private $classPath; - - public function __construct(Filesystem $filesystem, $skeletonDir) - { - $this->filesystem = $filesystem; - $this->skeletonDir = $skeletonDir; - } - - public function getClassName() - { - return $this->className; - } - - public function getClassPath() - { - return $this->classPath; - } - - /** - * Generates the entity form class if it does not exist. - * - * @param BundleInterface $bundle The bundle in which to create the class - * @param string $entity The entity relative class name - * @param ClassMetadataInfo $metadata The entity metadata class - */ - public function generate(BundleInterface $bundle, $entity, ClassMetadataInfo $metadata) - { - $parts = explode('\\', $entity); - $entityClass = array_pop($parts); - - $this->className = $entityClass.'Type'; - $dirPath = $bundle->getPath().'/Form'; - $this->classPath = $dirPath.'/'.str_replace('\\', '/', $entity).'Type.php'; - - if (file_exists($this->classPath)) { - throw new \RuntimeException(sprintf('Unable to generate the %s form class as it already exists under the %s file', $this->className, $this->classPath)); - } - - if (count($metadata->identifier) > 1) { - throw new \RuntimeException('The form generator does not support entity classes with multiple primary keys.'); - } - - $parts = explode('\\', $entity); - array_pop($parts); - - $this->renderFile($this->skeletonDir, 'FormType.php', $this->classPath, array( - 'dir' => $this->skeletonDir, - 'fields' => $this->getFieldsFromMetadata($metadata), - 'namespace' => $bundle->getNamespace(), - 'entity_namespace' => implode('\\', $parts), - 'entity_class' => $entityClass, - 'form_class' => $this->className, - 'form_type_name' => strtolower(str_replace('\\', '_', $bundle->getNamespace()).($parts ? '_' : '').implode('_', $parts).'_'.$this->className), - )); - } - - /** - * Returns an array of fields. Fields can be both column fields and - * association fields. - * - * @param ClassMetadataInfo $metadata - * @return array $fields - */ - private function getFieldsFromMetadata(ClassMetadataInfo $metadata) - { - $fields = (array) $metadata->fieldNames; - - // Remove the primary key field if it's not managed manually - if (!$metadata->isIdentifierNatural()) { - $fields = array_diff($fields, $metadata->identifier); - } - - foreach ($metadata->associationMappings as $fieldName => $relation) { - if ($relation['type'] !== ClassMetadataInfo::ONE_TO_MANY) { - $fields[] = $fieldName; - } - } - - return $fields; - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Generator/Generator.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Generator/Generator.php deleted file mode 100644 index a5d9f3f..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Generator/Generator.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Generator; - -/** - * Generator is the base class for all generators. - * - * @author Fabien Potencier - */ -class Generator -{ - protected function render($skeletonDir, $template, $parameters) - { - $twig = new \Twig_Environment(new \Twig_Loader_Filesystem($skeletonDir), array( - 'debug' => true, - 'cache' => false, - 'strict_variables' => true, - 'autoescape' => false, - )); - - return $twig->render($template, $parameters); - } - - protected function renderFile($skeletonDir, $template, $target, $parameters) - { - if (!is_dir(dirname($target))) { - mkdir(dirname($target), 0777, true); - } - - return file_put_contents($target, $this->render($skeletonDir, $template, $parameters)); - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/LICENSE b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/LICENSE deleted file mode 100644 index c60ef6c..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Manipulator/KernelManipulator.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Manipulator/KernelManipulator.php deleted file mode 100644 index 8b1bbe7..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Manipulator/KernelManipulator.php +++ /dev/null @@ -1,105 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Manipulator; - -use Symfony\Component\HttpKernel\KernelInterface; - -/** - * Changes the PHP code of a Kernel. - * - * @author Fabien Potencier - */ -class KernelManipulator extends Manipulator -{ - private $kernel; - private $reflected; - - /** - * Constructor. - * - * @param KernelInterface $kernel A KernelInterface instance - */ - public function __construct(KernelInterface $kernel) - { - $this->kernel = $kernel; - $this->reflected = new \ReflectionObject($kernel); - } - - /** - * Adds a bundle at the end of the existing ones. - * - * @param string $bundle The bundle class name - * - * @return Boolean true if it worked, false otherwise - * - * @throws \RuntimeException If bundle is already defined - */ - public function addBundle($bundle) - { - if (!$this->reflected->getFilename()) { - return false; - } - - $src = file($this->reflected->getFilename()); - $method = $this->reflected->getMethod('registerBundles'); - $lines = array_slice($src, $method->getStartLine() - 1, $method->getEndLine() - $method->getStartLine() + 1); - - // Don't add same bundle twice - if (false !== strpos(implode('', $lines), $bundle)) { - throw new \RuntimeException(sprintf('Bundle "%s" is already defined in "AppKernel::registerBundles()".', $bundle)); - } - - $this->setCode(token_get_all('getStartLine()); - while ($token = $this->next()) { - // $bundles - if (T_VARIABLE !== $token[0] || '$bundles' !== $token[1]) { - continue; - } - - // = - $this->next(); - - // array - $token = $this->next(); - if (T_ARRAY !== $token[0]) { - return false; - } - - // add the bundle at the end of the array - while ($token = $this->next()) { - // look for ); - if (')' !== $this->value($token)) { - continue; - } - - if (';' !== $this->value($this->peek())) { - continue; - } - - // ; - $this->next(); - - $lines = array_merge( - array_slice($src, 0, $this->line - 2), - // Appends a separator comma to the current last position of the array - array(rtrim(rtrim($src[$this->line - 2]), ',') . ",\n"), - array(sprintf(" new %s(),\n", $bundle)), - array_slice($src, $this->line - 1) - ); - - file_put_contents($this->reflected->getFilename(), implode('', $lines)); - - return true; - } - } - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Manipulator/Manipulator.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Manipulator/Manipulator.php deleted file mode 100644 index a97baa7..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Manipulator/Manipulator.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Manipulator; - - -/** - * Changes the PHP code of a Kernel. - * - * @author Fabien Potencier - */ -class Manipulator -{ - protected $tokens; - protected $line; - - /** - * Sets the code to manipulate. - * - * @param array $tokens An array of PHP tokens - * @param integer $line The start line of the code - */ - protected function setCode(array $tokens, $line = 0) - { - $this->tokens = $tokens; - $this->line = $line; - } - - /** - * Gets the next token. - * - * @param mixed A PHP token - */ - protected function next() - { - while ($token = array_shift($this->tokens)) { - $this->line += substr_count($this->value($token), "\n"); - - if (is_array($token) && in_array($token[0], array(T_WHITESPACE, T_COMMENT, T_DOC_COMMENT))) { - continue; - } - - return $token; - } - } - - /** - * Peeks the next token. - * - * @param mixed A PHP token - */ - protected function peek($nb = 1) - { - $i = 0; - $tokens = $this->tokens; - while ($token = array_shift($tokens)) { - if (is_array($token) && in_array($token[0], array(T_WHITESPACE, T_COMMENT, T_DOC_COMMENT))) { - continue; - } - - ++$i; - if ($i == $nb) { - return $token; - } - } - } - - /** - * Gets the value of a token. - * - * @param string The token value - */ - protected function value($token) - { - return is_array($token) ? $token[1] : $token; - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Manipulator/RoutingManipulator.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Manipulator/RoutingManipulator.php deleted file mode 100644 index 0026c47..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Manipulator/RoutingManipulator.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Manipulator; - -/** - * Changes the PHP code of a YAML routing file. - * - * @author Fabien Potencier - */ -class RoutingManipulator extends Manipulator -{ - private $file; - - /** - * Constructor. - * - * @param string $file The YAML routing file path - */ - public function __construct($file) - { - $this->file = $file; - } - - /** - * Adds a routing resource at the top of the existing ones. - * - * @param string $bundle - * @param string $format - * @param string $prefix - * @param string $path - * - * @return Boolean true if it worked, false otherwise - * - * @throws \RuntimeException If bundle is already imported - */ - public function addResource($bundle, $format, $prefix = '/', $path = 'routing') - { - $current = ''; - if (file_exists($this->file)) { - $current = file_get_contents($this->file); - - // Don't add same bundle twice - if (false !== strpos($current, $bundle)) { - throw new \RuntimeException(sprintf('Bundle "%s" is already imported.', $bundle)); - } - } elseif (!is_dir($dir = dirname($this->file))) { - mkdir($dir, 0777, true); - } - - $code = sprintf("%s:\n", $bundle.('/' !== $prefix ? '_'.str_replace('/', '_', substr($prefix, 1)) : '')); - if ('annotation' == $format) { - $code .= sprintf(" resource: \"@%s/Controller/\"\n type: annotation\n", $bundle); - } else { - $code .= sprintf(" resource: \"@%s/Resources/config/%s.%s\"\n", $bundle, $path, $format); - } - $code .= sprintf(" prefix: %s\n", $prefix); - $code .= "\n"; - $code .= $current; - - if (false === file_put_contents($this->file, $code)) { - return false; - } - - return true; - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/README.md b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/README.md deleted file mode 100644 index 8b033db..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/README.md +++ /dev/null @@ -1,10 +0,0 @@ -SensioGeneratorBundle -===================== - -The `SensioGeneratorBundle` extends the default Symfony2 command line -interface by providing new interactive and intuitive commands for generating -code skeletons like bundles, form classes, or CRUD controllers based on a -Doctrine 2 schema. - -More information in the official -[documentation](http://symfony.com/doc/current/bundles/SensioGeneratorBundle/index.html). diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/doc/commands/generate_bundle.rst b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/doc/commands/generate_bundle.rst deleted file mode 100644 index 90d04ba..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/doc/commands/generate_bundle.rst +++ /dev/null @@ -1,68 +0,0 @@ -Generating a New Bundle Skeleton -================================ - -Usage ------ - -The ``generate:bundle`` generates a new bundle structure and automatically -activates it in the application. - -By default the command is run in the interactive mode and asks questions to -determine the bundle name, location, configuration format and default -structure: - -.. code-block:: bash - - php app/console generate:bundle - -To deactivate the interactive mode, use the `--no-interaction` option but don't -forget to pass all needed options: - -.. code-block:: bash - - php app/console generate:bundle --namespace=Acme/Bundle/BlogBundle --no-interaction - -Available Options ------------------ - -* ``--namespace``: The namespace of the bundle to create. The namespace should - begin with a "vendor" name like your company name, your project name, or - your client name, followed by one or more optional category sub-namespaces, - and it should end with the bundle name itself (which must have Bundle as a - suffix): - - .. code-block:: bash - - php app/console generate:bundle --namespace=Acme/Bundle/BlogBundle - -* ``--bundle-name``: The optional bundle name. It must be a string ending with - the ``Bundle`` suffix: - - .. code-block:: bash - - php app/console generate:bundle --bundle-name=AcmeBlogBundle - -* ``--dir``: The directory in which to store the bundle. By convention, the - command detects and uses the applications's ``src/`` folder: - - .. code-block:: bash - - php app/console generate:bundle --dir=/var/www/myproject/src - -* ``--format``: (**annotation**) [values: yml, xml, php or annotation] - Determine the format to use for the generated configuration files like - routing. By default, the command uses the ``annotation`` format. Choosing - the ``annotation`` format expects the ``SensioFrameworkExtraBundle`` is - already installed: - - .. code-block:: bash - - php app/console generate:bundle --format=annotation - -* ``--structure``: (**no**) [values: yes|no] Whether or not to generate a - complete default directory structure including empty public folders for - documentation, web assets and translations dictionaries: - - .. code-block:: bash - - php app/console generate:bundle --structure=yes diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/doc/commands/generate_doctrine_crud.rst b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/doc/commands/generate_doctrine_crud.rst deleted file mode 100644 index 07acc08..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/doc/commands/generate_doctrine_crud.rst +++ /dev/null @@ -1,65 +0,0 @@ -Generating a CRUD Controller Based on a Doctrine Entity -======================================================= - -Usage ------ - -The ``generate:doctrine:crud`` generates a basic controller for a given entity -located in a given bundle. This controller allows to perform the five basic -operations on a model. - -* Listing all records, -* Showing one given record identified by its primary key, -* Creating a new record, -* Editing an existing record, -* Deleting an existing record. - -By default the command is run in the interactive mode and asks questions to -determine the entity name, the route prefix or whether or not to generate write -actions: - -.. code-block:: bash - - php app/console generate:doctrine:crud - -To deactivate the interactive mode, use the `--no-interaction` option but don't -forget to pass all needed options: - -.. code-block:: bash - - php app/console generate:doctrine:crud --entity=AcmeBlogBundle:Post --format=annotation --with-write --no-interaction - -Available Options ------------------ - -* ``--entity``: The entity name given as a shortcut notation containing the - bundle name in which the entity is located and the name of the entity. For - example: ``AcmeBlogBundle:Post``: - - .. code-block:: bash - - php app/console generate:doctrine:crud --entity=AcmeBlogBundle:Post - -* ``--route-prefix``: The prefix to use for each route that identifies an - action: - - .. code-block:: bash - - php app/console generate:doctrine:crud --route-prefix=acme_post - -* ``--with-write``: (**no**) [values: yes|no] Whether or not to generate the - `new`, `create`, `edit`, `update` and `delete` actions: - - .. code-block:: bash - - php app/console generate:doctrine:crud --with-write - -* ``--format``: (**annotation**) [values: yml, xml, php or annotation] - Determine the format to use for the generated configuration files like - routing. By default, the command uses the ``annotation`` format. Choosing - the ``annotation`` format expects the ``SensioFrameworkExtraBundle`` is - already installed: - - .. code-block:: bash - - php app/console generate:doctrine:crud --format=annotation diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/doc/commands/generate_doctrine_entity.rst b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/doc/commands/generate_doctrine_entity.rst deleted file mode 100644 index 7c362bd..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/doc/commands/generate_doctrine_entity.rst +++ /dev/null @@ -1,55 +0,0 @@ -Generating a New Doctrine Entity Stub -===================================== - -Usage ------ - -The ``generate:doctrine:entity`` command generates a new Doctrine entity stub -including the mapping definition and the class properties, getters and setters. - -By default the command is run in the interactive mode and asks questions to -determine the bundle name, location, configuration format and default -structure: - -.. code-block:: bash - - php app/console generate:doctrine:entity - -The command can be run in a non interactive mode by using the -``--non-interaction`` option without forgetting all needed options: - -.. code-block:: bash - - php app/console generate:doctrine:entity --non-interaction --entity=AcmeBlogBundle:Post --fields="title:string(100) body:text" --format=xml - -Available Options ------------------ - -* ``--entity``: The entity name given as a shortcut notation containing the - bundle name in which the entity is located and the name of the entity. For - example: ``AcmeBlogBundle:Post``: - - .. code-block:: bash - - php app/console generate:doctrine:entity --entity=AcmeBlogBundle:Post - -* ``--fields``: The list of fields to generate in the entity class: - - .. code-block:: bash - - php app/console generate:doctrine:entity --fields="title:string(100) body:text" - -* ``--format``: (**annotation**) [values: yml, xml, php or annotation] This - option determines the format to use for the generated configuration files - like routing. By default, the command uses the ``annotation`` format: - - .. code-block:: bash - - php app/console generate:doctrine:entity --format=annotation - -* ``--with-repository``: This option tells whether or not to generate the - related Doctrine `EntityRepository` class: - - .. code-block:: bash - - php app/console generate:doctrine:entity --with-repository diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/doc/commands/generate_doctrine_form.rst b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/doc/commands/generate_doctrine_form.rst deleted file mode 100644 index 6bc9a60..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/doc/commands/generate_doctrine_form.rst +++ /dev/null @@ -1,23 +0,0 @@ -Generating a New Form Type Class Based on a Doctrine Entity -=========================================================== - -Usage ------ - -The ``generate:doctrine:form`` generates a basic form type class by using the -metadata mapping of a given entity class: - -.. code-block:: bash - - php app/console generate:doctrine:form AcmeBlogBundle:Post - -Required Arguments ------------------- - -* ``entity``: The entity name given as a shortcut notation containing the - bundle name in which the entity is located and the name of the entity. For - example: ``AcmeBlogBundle:Post``: - - .. code-block:: bash - - php app/console generate:doctrine:form AcmeBlogBundle:Post diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/doc/index.rst b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/doc/index.rst deleted file mode 100644 index a3ae3bc..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/doc/index.rst +++ /dev/null @@ -1,42 +0,0 @@ -SensioGeneratorBundle -========================== - -The ``SensioGeneratorBundle`` extends the default Symfony2 command line -interface by providing new interactive and intuitive commands for generating -code skeletons like bundles, form classes or CRUD controllers based on a -Doctrine 2 schema. - -Installation ------------- - -`Download`_ the bundle and put it under the ``Sensio\\Bundle\\`` namespace. -Then, like for any other bundle, include it in your Kernel class:: - - public function registerBundles() - { - $bundles = array( - ... - - new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(), - ); - - ... - } - -List of Available Commands --------------------------- - -The ``SensioGeneratorBundle`` comes with four new commands that can be run in -interactive mode or not. The interactive mode asks you some questions to -configure the command parameters to generate the definitive code. The list of -new commands are listed below: - -.. toctree:: - :maxdepth: 1 - - commands/generate_bundle - commands/generate_doctrine_crud - commands/generate_doctrine_entity - commands/generate_doctrine_form - -.. _Download: http://github.com/sensio/SensioGeneratorBundle \ No newline at end of file diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/Bundle.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/Bundle.php deleted file mode 100644 index 7721df5..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/Bundle.php +++ /dev/null @@ -1,9 +0,0 @@ -root('{{ extension_alias }}'); - - // Here you should define the parameters that are allowed to - // configure your bundle. See the documentation linked above for - // more information on that topic. - - return $treeBuilder; - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/DefaultController.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/DefaultController.php deleted file mode 100644 index 2d98904..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/DefaultController.php +++ /dev/null @@ -1,28 +0,0 @@ -render('{{ bundle }}:Default:index.html.twig', array('name' => $name)); - {%- else -%} - return array('name' => $name); - {%- endif %} - - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/DefaultControllerTest.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/DefaultControllerTest.php deleted file mode 100644 index 9c76faa..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/DefaultControllerTest.php +++ /dev/null @@ -1,17 +0,0 @@ -request('GET', '/hello/Fabien'); - - $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0); - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/Extension.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/Extension.php deleted file mode 100644 index e493003..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/Extension.php +++ /dev/null @@ -1,37 +0,0 @@ -processConfiguration($configuration, $configs); - - {% if format == 'yml' -%} - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('services.yml'); - {%- elseif format == 'xml' or format == 'annotation' -%} - $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('services.xml'); - {%- elseif format == 'php' -%} - $loader = new Loader\PhpFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('services.php'); - {%- endif %} - - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/index.html.twig b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/index.html.twig deleted file mode 100644 index e64fdb0..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/index.html.twig +++ /dev/null @@ -1 +0,0 @@ -Hello {% raw %}{{ name }}{% endraw %}! diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/messages.fr.xlf b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/messages.fr.xlf deleted file mode 100644 index fd59e6c..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/messages.fr.xlf +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - Symfony2 is great - J'aime Symfony2 - - - - diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/routing.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/routing.php deleted file mode 100644 index 67ae142..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/routing.php +++ /dev/null @@ -1,11 +0,0 @@ -add('{{ bundle }}_homepage', new Route('/hello/{name}', array( - '_controller' => '{{ bundle }}:Default:index', -))); - -return $collection; diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/routing.xml b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/routing.xml deleted file mode 100644 index b3164bf..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/routing.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - {{ bundle }}:Default:index - - diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/routing.yml b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/routing.yml deleted file mode 100644 index c418ad9..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/routing.yml +++ /dev/null @@ -1,3 +0,0 @@ -{{ bundle }}_homepage: - pattern: /hello/{name} - defaults: { _controller: {{ bundle }}:Default:index } diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/services.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/services.php deleted file mode 100644 index 71d6080..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/services.php +++ /dev/null @@ -1,21 +0,0 @@ -setDefinition( - '{{ extension_alias }}.example', - new Definition( - '{{ namespace }}\Example', - array( - new Reference('service_id'), - "plain_value", - new Parameter('parameter_name'), - ) - ) -); - -*/ \ No newline at end of file diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/services.xml b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/services.xml deleted file mode 100644 index 5f2c82f..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/services.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/services.yml b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/services.yml deleted file mode 100644 index 411a0f3..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/services.yml +++ /dev/null @@ -1,7 +0,0 @@ -parameters: -# {{ extension_alias }}.example.class: {{ namespace }}\Example - -services: -# {{ extension_alias }}.example: -# class: %{{ extension_alias }}.example.class% -# arguments: [@service_id, "plain_value", %parameter%] diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/create.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/create.php deleted file mode 100644 index 455e11f..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/create.php +++ /dev/null @@ -1,42 +0,0 @@ - - /** - * Creates a new {{ entity }} entity. - * -{% if 'annotation' == format %} - * @Route("/create", name="{{ route_name_prefix }}_create") - * @Method("post") - * @Template("{{ bundle }}:{{ entity }}:new.html.twig") -{% endif %} - */ - public function createAction() - { - $entity = new {{ entity_class }}(); - $request = $this->getRequest(); - $form = $this->createForm(new {{ entity_class }}Type(), $entity); - $form->bindRequest($request); - - if ($form->isValid()) { - $em = $this->getDoctrine()->getManager(); - $em->persist($entity); - $em->flush(); - - {% if 'show' in actions -%} - return $this->redirect($this->generateUrl('{{ route_name_prefix }}_show', array('id' => $entity->getId()))); - {%- else -%} - return $this->redirect($this->generateUrl('{{ route_name_prefix }}')); - {%- endif %} - - } - -{% if 'annotation' == format %} - return array( - 'entity' => $entity, - 'form' => $form->createView(), - ); -{% else %} - return $this->render('{{ bundle }}:{{ entity|replace({'\\': '/'}) }}:new.html.twig', array( - 'entity' => $entity, - 'form' => $form->createView(), - )); -{% endif %} - } diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/delete.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/delete.php deleted file mode 100644 index 1d01735..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/delete.php +++ /dev/null @@ -1,38 +0,0 @@ - - /** - * Deletes a {{ entity }} entity. - * -{% if 'annotation' == format %} - * @Route("/{id}/delete", name="{{ route_name_prefix }}_delete") - * @Method("post") -{% endif %} - */ - public function deleteAction($id) - { - $form = $this->createDeleteForm($id); - $request = $this->getRequest(); - - $form->bindRequest($request); - - if ($form->isValid()) { - $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('{{ bundle }}:{{ entity }}')->find($id); - - if (!$entity) { - throw $this->createNotFoundException('Unable to find {{ entity }} entity.'); - } - - $em->remove($entity); - $em->flush(); - } - - return $this->redirect($this->generateUrl('{{ route_name_prefix }}')); - } - - private function createDeleteForm($id) - { - return $this->createFormBuilder(array('id' => $id)) - ->add('id', 'hidden') - ->getForm() - ; - } \ No newline at end of file diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/edit.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/edit.php deleted file mode 100644 index 2371bed..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/edit.php +++ /dev/null @@ -1,36 +0,0 @@ - - /** - * Displays a form to edit an existing {{ entity }} entity. - * -{% if 'annotation' == format %} - * @Route("/{id}/edit", name="{{ route_name_prefix }}_edit") - * @Template() -{% endif %} - */ - public function editAction($id) - { - $em = $this->getDoctrine()->getManager(); - - $entity = $em->getRepository('{{ bundle }}:{{ entity }}')->find($id); - - if (!$entity) { - throw $this->createNotFoundException('Unable to find {{ entity }} entity.'); - } - - $editForm = $this->createForm(new {{ entity_class }}Type(), $entity); - $deleteForm = $this->createDeleteForm($id); - -{% if 'annotation' == format %} - return array( - 'entity' => $entity, - 'edit_form' => $editForm->createView(), - 'delete_form' => $deleteForm->createView(), - ); -{% else %} - return $this->render('{{ bundle }}:{{ entity|replace({'\\': '/'}) }}:edit.html.twig', array( - 'entity' => $entity, - 'edit_form' => $editForm->createView(), - 'delete_form' => $deleteForm->createView(), - )); -{% endif %} - } diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/index.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/index.php deleted file mode 100644 index 6da9ec0..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/index.php +++ /dev/null @@ -1,25 +0,0 @@ - - /** - * Lists all {{ entity }} entities. - * -{% if 'annotation' == format %} - * @Route("/", name="{{ route_name_prefix }}") - * @Template() -{% endif %} - */ - public function indexAction() - { - $em = $this->getDoctrine()->getManager(); - - $entities = $em->getRepository('{{ bundle }}:{{ entity }}')->findAll(); - -{% if 'annotation' == format %} - return array( - 'entities' => $entities, - ); -{% else %} - return $this->render('{{ bundle }}:{{ entity|replace({'\\': '/'}) }}:index.html.twig', array( - 'entities' => $entities, - )); -{% endif %} - } diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/new.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/new.php deleted file mode 100644 index b79c311..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/new.php +++ /dev/null @@ -1,26 +0,0 @@ - - /** - * Displays a form to create a new {{ entity }} entity. - * -{% if 'annotation' == format %} - * @Route("/new", name="{{ route_name_prefix }}_new") - * @Template() -{% endif %} - */ - public function newAction() - { - $entity = new {{ entity_class }}(); - $form = $this->createForm(new {{ entity_class }}Type(), $entity); - -{% if 'annotation' == format %} - return array( - 'entity' => $entity, - 'form' => $form->createView(), - ); -{% else %} - return $this->render('{{ bundle }}:{{ entity|replace({'\\': '/'}) }}:new.html.twig', array( - 'entity' => $entity, - 'form' => $form->createView(), - )); -{% endif %} - } diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/show.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/show.php deleted file mode 100644 index abe5000..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/show.php +++ /dev/null @@ -1,39 +0,0 @@ - - /** - * Finds and displays a {{ entity }} entity. - * -{% if 'annotation' == format %} - * @Route("/{id}/show", name="{{ route_name_prefix }}_show") - * @Template() -{% endif %} - */ - public function showAction($id) - { - $em = $this->getDoctrine()->getManager(); - - $entity = $em->getRepository('{{ bundle }}:{{ entity }}')->find($id); - - if (!$entity) { - throw $this->createNotFoundException('Unable to find {{ entity }} entity.'); - } -{% if 'delete' in actions %} - - $deleteForm = $this->createDeleteForm($id); -{% endif %} - -{% if 'annotation' == format %} - return array( - 'entity' => $entity, -{% if 'delete' in actions %} - 'delete_form' => $deleteForm->createView(), -{% endif %} - ); -{% else %} - return $this->render('{{ bundle }}:{{ entity|replace({'\\': '/'}) }}:show.html.twig', array( - 'entity' => $entity, -{% if 'delete' in actions %} - 'delete_form' => $deleteForm->createView(), -{%- endif %} - )); -{% endif %} - } diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/update.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/update.php deleted file mode 100644 index 1b2a6a2..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/actions/update.php +++ /dev/null @@ -1,48 +0,0 @@ - - /** - * Edits an existing {{ entity }} entity. - * -{% if 'annotation' == format %} - * @Route("/{id}/update", name="{{ route_name_prefix }}_update") - * @Method("post") - * @Template("{{ bundle }}:{{ entity }}:edit.html.twig") -{% endif %} - */ - public function updateAction($id) - { - $em = $this->getDoctrine()->getManager(); - - $entity = $em->getRepository('{{ bundle }}:{{ entity }}')->find($id); - - if (!$entity) { - throw $this->createNotFoundException('Unable to find {{ entity }} entity.'); - } - - $editForm = $this->createForm(new {{ entity_class }}Type(), $entity); - $deleteForm = $this->createDeleteForm($id); - - $request = $this->getRequest(); - - $editForm->bindRequest($request); - - if ($editForm->isValid()) { - $em->persist($entity); - $em->flush(); - - return $this->redirect($this->generateUrl('{{ route_name_prefix }}_edit', array('id' => $id))); - } - -{% if 'annotation' == format %} - return array( - 'entity' => $entity, - 'edit_form' => $editForm->createView(), - 'delete_form' => $deleteForm->createView(), - ); -{% else %} - return $this->render('{{ bundle }}:{{ entity|replace({'\\': '/'}) }}:edit.html.twig', array( - 'entity' => $entity, - 'edit_form' => $editForm->createView(), - 'delete_form' => $deleteForm->createView(), - )); -{% endif %} - } diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/config/routing.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/config/routing.php deleted file mode 100644 index a47d00d..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/config/routing.php +++ /dev/null @@ -1,52 +0,0 @@ -add('{{ route_name_prefix }}', new Route('/', array( - '_controller' => '{{ bundle }}:{{ entity }}:index', -))); -{% endif %} - -{% if 'show' in actions %} -$collection->add('{{ route_name_prefix }}_show', new Route('/{id}/show', array( - '_controller' => '{{ bundle }}:{{ entity }}:show', -))); -{% endif %} - -{% if 'new' in actions %} -$collection->add('{{ route_name_prefix }}_new', new Route('/new', array( - '_controller' => '{{ bundle }}:{{ entity }}:new', -))); - -$collection->add('{{ route_name_prefix }}_create', new Route( - '/create', - array('_controller' => '{{ bundle }}:{{ entity }}:create'), - array('_method' => 'post') -)); -{% endif %} - -{% if 'edit' in actions %} -$collection->add('{{ route_name_prefix }}_edit', new Route('/{id}/edit', array( - '_controller' => '{{ bundle }}:{{ entity }}:edit', -))); - -$collection->add('{{ route_name_prefix }}_update', new Route( - '/{id}/update', - array('_controller' => '{{ bundle }}:{{ entity }}:update'), - array('_method' => 'post') -)); -{% endif %} - -{% if 'delete' in actions %} -$collection->add('{{ route_name_prefix }}_delete', new Route( - '/{id}/delete', - array('_controller' => '{{ bundle }}:{{ entity }}:delete'), - array('_method' => 'post') -)); -{% endif %} - -return $collection; diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/config/routing.xml b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/config/routing.xml deleted file mode 100644 index 50fd85e..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/config/routing.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - {{ bundle }}:{{ entity }}:index - - - - {{ bundle }}:{{ entity }}:show - - -{% if 'new' in actions %} - - {{ bundle }}:{{ entity }}:new - - - - {{ bundle }}:{{ entity }}:create - post - -{% endif %} - -{% if 'edit' in actions %} - - {{ bundle }}:{{ entity }}:edit - - - - {{ bundle }}:{{ entity }}:update - post - -{% endif %} - -{% if 'delete' in actions %} - - {{ bundle }}:{{ entity }}:delete - post - -{% endif %} - - diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/config/routing.yml b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/config/routing.yml deleted file mode 100644 index a992678..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/config/routing.yml +++ /dev/null @@ -1,40 +0,0 @@ -{% if 'index' in actions %} -{{ route_name_prefix }}: - pattern: / - defaults: { _controller: "{{ bundle }}:{{ entity }}:index" } -{% endif %} - -{% if 'show' in actions %} -{{ route_name_prefix }}_show: - pattern: /{id}/show - defaults: { _controller: "{{ bundle }}:{{ entity }}:show" } -{% endif %} - -{% if 'new' in actions %} -{{ route_name_prefix }}_new: - pattern: /new - defaults: { _controller: "{{ bundle }}:{{ entity }}:new" } - -{{ route_name_prefix }}_create: - pattern: /create - defaults: { _controller: "{{ bundle }}:{{ entity }}:create" } - requirements: { _method: post } -{% endif %} - -{% if 'edit' in actions %} -{{ route_name_prefix }}_edit: - pattern: /{id}/edit - defaults: { _controller: "{{ bundle }}:{{ entity }}:edit" } - -{{ route_name_prefix }}_update: - pattern: /{id}/update - defaults: { _controller: "{{ bundle }}:{{ entity }}:update" } - requirements: { _method: post } -{% endif %} - -{% if 'delete' in actions %} -{{ route_name_prefix }}_delete: - pattern: /{id}/delete - defaults: { _controller: "{{ bundle }}:{{ entity }}:delete" } - requirements: { _method: post } -{% endif %} \ No newline at end of file diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/controller.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/controller.php deleted file mode 100644 index e58856d..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/controller.php +++ /dev/null @@ -1,49 +0,0 @@ -request('GET', '/{{ route_prefix }}/'); - $this->assertTrue(200 === $client->getResponse()->getStatusCode()); - $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); - - // Fill in the form and submit it - $form = $crawler->selectButton('Create')->form(array( - '{{ entity_class|lower }}[field_name]' => 'Test', - // ... other fields to fill - )); - - $client->submit($form); - $crawler = $client->followRedirect(); - - // Check data in the show view - $this->assertTrue($crawler->filter('td:contains("Test")')->count() > 0); - - // Edit the entity - $crawler = $client->click($crawler->selectLink('Edit')->link()); - - $form = $crawler->selectButton('Edit')->form(array( - '{{ entity_class|lower }}[field_name]' => 'Foo', - // ... other fields to fill - )); - - $client->submit($form); - $crawler = $client->followRedirect(); - - // Check the element contains an attribute with value equals "Foo" - $this->assertTrue($crawler->filter('[value="Foo"]')->count() > 0); - - // Delete the entity - $client->submit($crawler->selectButton('Delete')->form()); - $crawler = $client->followRedirect(); - - // Check the entity has been delete on the list - $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); - } \ No newline at end of file diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/tests/others/short_scenario.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/tests/others/short_scenario.php deleted file mode 100644 index 09866f0..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/tests/others/short_scenario.php +++ /dev/null @@ -1,14 +0,0 @@ - - public function testCompleteScenario() - { - // Create a new client to browse the application - $client = static::createClient(); - - // Go to the list view - $crawler = $client->request('GET', '/{{ route_prefix }}/'); - $this->assertTrue(200 === $client->getResponse()->getStatusCode()); - - // Go to the show view - $crawler = $client->click($crawler->selectLink('show')->link()); - $this->assertTrue(200 === $client->getResponse()->getStatusCode()); - } \ No newline at end of file diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/tests/test.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/tests/test.php deleted file mode 100644 index afb382f..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/tests/test.php +++ /dev/null @@ -1,18 +0,0 @@ -{{ entity }} edit - -
- {{ "{{ form_widget(edit_form) }}" }} -

- -

- - -{% set hide_edit, hide_delete = true, false %} -{% include 'views/others/record_actions.html.twig' %} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/index.html.twig b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/index.html.twig deleted file mode 100644 index 882984e..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/index.html.twig +++ /dev/null @@ -1,56 +0,0 @@ -

{{ entity }} list

- -
- - - {%- for field, metadata in fields %} - - - - {%- endfor %} - - - - - - {{ '{% for entity in entities %}' }} - - - {%- for field, metadata in fields %} - {%- if loop.first and ('show' in actions) %} - - - - {%- elseif metadata.type in ['date', 'datetime'] %} - - - - {%- else %} - - - - {%- endif %} - - {%- if loop.last %} - - - - {%- endif %} - {%- endfor %} - - - {{ '{% endfor %}' }} - -
{{ field|capitalize }}Actions
{{ '{{ entity.'~ field|replace({'_': ''}) ~' }}' }}{{ '{% if entity.'~ field|replace({'_': ''}) ~' %}{{ entity.'~ field|replace({'_': ''}) ~'|date(\'Y-m-d H:i:s\') }}{% endif %}' }}{{ '{{ entity.'~ field|replace({'_': ''}) ~' }}' }} - {%- include "views/others/actions.html.twig" %} -
- -{% if 'new' in actions %} - -{% endif %} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/new.html.twig b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/new.html.twig deleted file mode 100644 index 06422f6..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/new.html.twig +++ /dev/null @@ -1,11 +0,0 @@ -

{{ entity }} creation

- -
- {{ "{{ form_widget(form) }}" }} -

- -

-
- -{% set hide_edit, hide_delete = true, true %} -{% include 'views/others/record_actions.html.twig' %} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/others/actions.html.twig b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/others/actions.html.twig deleted file mode 100644 index 5137ff2..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/others/actions.html.twig +++ /dev/null @@ -1,12 +0,0 @@ - -
    - - {%- for action in record_actions %} - -
  • - {{ action }} -
  • - - {%- endfor %} - -
diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/others/record_actions.html.twig b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/others/record_actions.html.twig deleted file mode 100644 index 13c2673..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/others/record_actions.html.twig +++ /dev/null @@ -1,22 +0,0 @@ -
    -
  • - - Back to the list - -
  • -{% if ('edit' in actions) and (not hide_edit) %} -
  • - - Edit - -
  • -{% endif %} -{% if ('delete' in actions) and (not hide_delete) %} -
  • -
    - {{ '{{ form_widget(delete_form) }}' }} - -
    -
  • -{% endif %} -
diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/show.html.twig b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/show.html.twig deleted file mode 100644 index 2badbd0..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/show.html.twig +++ /dev/null @@ -1,28 +0,0 @@ -

{{ entity }}

- - - - {%- for field, metadata in fields %} - - - - - {%- if metadata.type in ['date', 'datetime'] %} - - - - {%- else %} - - - - {%- endif %} - - - - {%- endfor %} - - -
{{ field|capitalize }}{{ '{{ entity.'~ field|replace({'_': ''}) ~'|date(\'Y-m-d H:i:s\') }}' }}{{ '{{ entity.'~ field|replace({'_': ''}) ~' }}' }}
- -{% set hide_edit, hide_delete = false, false %} -{% include 'views/others/record_actions.html.twig' %} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/form/FormType.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/form/FormType.php deleted file mode 100644 index 60154ee..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/form/FormType.php +++ /dev/null @@ -1,34 +0,0 @@ -add('{{ field }}') - - {%- endfor %} - - ; - } - - public function setDefaultOptions(OptionsResolverInterface $resolver) - { - $resolver->setDefaults(array( - 'data_class' => '{{ namespace }}\Entity{{ entity_namespace ? '\\' ~ entity_namespace : '' }}\{{ entity_class }}' - )); - } - - public function getName() - { - return '{{ form_type_name }}'; - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/SensioGeneratorBundle.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/SensioGeneratorBundle.php deleted file mode 100644 index 5c4e799..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/SensioGeneratorBundle.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Sensio\Bundle\GeneratorBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; - -/** - * SensioGeneratorBundle. - * - * @author Fabien Potencier - */ -class SensioGeneratorBundle extends Bundle -{ -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateBundleCommandTest.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateBundleCommandTest.php deleted file mode 100644 index 35decd7..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateBundleCommandTest.php +++ /dev/null @@ -1,101 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Tests\Command; - -use Symfony\Component\Console\Tester\CommandTester; -use Sensio\Bundle\GeneratorBundle\Command\GenerateBundleCommand; - -class GenerateBundleCommandTest extends GenerateCommandTest -{ - /** - * @dataProvider getInteractiveCommandData - */ - public function testInteractiveCommand($options, $input, $expected) - { - list($namespace, $bundle, $dir, $format, $structure) = $expected; - - $generator = $this->getGenerator(); - $generator - ->expects($this->once()) - ->method('generate') - ->with($namespace, $bundle, $dir, $format, $structure) - ; - - $tester = new CommandTester($this->getCommand($generator, $input)); - $tester->execute($options); - } - - public function getInteractiveCommandData() - { - $tmp = sys_get_temp_dir(); - - return array( - array(array('--dir' => $tmp), "Foo/BarBundle\n", array('Foo\BarBundle', 'FooBarBundle', $tmp.'/', 'annotation', false)), - array(array('--dir' => $tmp), "Foo/BarBundle\nBarBundle\nfoo\nyml\nn", array('Foo\BarBundle', 'BarBundle', 'foo/', 'yml', false)), - array(array('--dir' => $tmp, '--format' => 'yml', '--bundle-name' => 'BarBundle', '--structure' => true), "Foo/BarBundle\n", array('Foo\BarBundle', 'BarBundle', $tmp.'/', 'yml', true)), - ); - } - - /** - * @dataProvider getNonInteractiveCommandData - */ - public function testNonInteractiveCommand($options, $expected) - { - list($namespace, $bundle, $dir, $format, $structure) = $expected; - - $generator = $this->getGenerator(); - $generator - ->expects($this->once()) - ->method('generate') - ->with($namespace, $bundle, $dir, $format, $structure) - ; - - $tester = new CommandTester($this->getCommand($generator, '')); - $tester->execute($options, array('interactive' => false)); - } - - public function getNonInteractiveCommandData() - { - $tmp = sys_get_temp_dir(); - - return array( - array(array('--dir' => $tmp, '--namespace' => 'Foo/BarBundle'), array('Foo\BarBundle', 'FooBarBundle', $tmp.'/', 'annotation', false)), - array(array('--dir' => $tmp, '--namespace' => 'Foo/BarBundle', '--format' => 'yml', '--bundle-name' => 'BarBundle', '--structure' => true), array('Foo\BarBundle', 'BarBundle', $tmp.'/', 'yml', true)), - ); - } - - protected function getCommand($generator, $input) - { - $command = $this - ->getMockBuilder('Sensio\Bundle\GeneratorBundle\Command\GenerateBundleCommand') - ->setMethods(array('checkAutoloader', 'updateKernel', 'updateRouting')) - ->getMock() - ; - - $command->setContainer($this->getContainer()); - $command->setHelperSet($this->getHelperSet($input)); - $command->setGenerator($generator); - - return $command; - } - - protected function getGenerator() - { - // get a noop generator - return $this - ->getMockBuilder('Sensio\Bundle\GeneratorBundle\Generator\BundleGenerator') - ->disableOriginalConstructor() - ->setMethods(array('generate')) - ->getMock() - ; - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateCommandTest.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateCommandTest.php deleted file mode 100644 index 93d9a50..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateCommandTest.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Tests\Command; - -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Helper\FormatterHelper; -use Sensio\Bundle\GeneratorBundle\Command\Helper\DialogHelper; -use Symfony\Component\DependencyInjection\Container; - -abstract class GenerateCommandTest extends \PHPUnit_Framework_TestCase -{ - protected function getHelperSet($input) - { - $dialog = new DialogHelper(); - $dialog->setInputStream($this->getInputStream($input)); - - return new HelperSet(array(new FormatterHelper(), $dialog)); - } - - protected function getBundle() - { - $bundle = $this->getMock('Symfony\Component\HttpKernel\Bundle\BundleInterface'); - $bundle - ->expects($this->any()) - ->method('getPath') - ->will($this->returnValue(sys_get_temp_dir())) - ; - - return $bundle; - } - - protected function getInputStream($input) - { - $stream = fopen('php://memory', 'r+', false); - fputs($stream, $input.str_repeat("\n", 10)); - rewind($stream); - - return $stream; - } - - protected function getContainer() - { - $kernel = $this->getMock('Symfony\Component\HttpKernel\KernelInterface'); - $kernel - ->expects($this->any()) - ->method('getBundle') - ->will($this->returnValue($this->getBundle())) - ; - - $filesystem = $this->getMock('Symfony\Component\Filesystem\Filesystem'); - $filesystem - ->expects($this->any()) - ->method('isAbsolutePath') - ->will($this->returnValue(true)) - ; - - $container = new Container(); - $container->set('kernel', $kernel); - $container->set('filesystem', $filesystem); - - $container->setParameter('kernel.root_dir', sys_get_temp_dir()); - - return $container; - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateDoctrineCrudCommandTest.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateDoctrineCrudCommandTest.php deleted file mode 100644 index ffea942..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateDoctrineCrudCommandTest.php +++ /dev/null @@ -1,141 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Tests\Command; - -use Symfony\Component\Console\Tester\CommandTester; -use Sensio\Bundle\GeneratorBundle\Command\GenerateDoctrineCrudCommand; - -class GenerateDoctrineCrudCommandTest extends GenerateCommandTest -{ - /** - * @dataProvider getInteractiveCommandData - */ - public function testInteractiveCommand($options, $input, $expected) - { - list($entity, $format, $prefix, $withWrite) = $expected; - - $generator = $this->getGenerator(); - $generator - ->expects($this->once()) - ->method('generate') - ->with($this->getBundle(), $entity, $this->getDoctrineMetadata(), $format, $prefix, $withWrite) - ; - - $tester = new CommandTester($this->getCommand($generator, $input)); - $tester->execute($options); - } - - public function getInteractiveCommandData() - { - return array( - array(array(), "AcmeBlogBundle:Blog/Post\n", array('Blog\\Post', 'annotation', 'blog_post', false)), - array(array('--entity' => 'AcmeBlogBundle:Blog/Post'), '', array('Blog\\Post', 'annotation', 'blog_post', false)), - array(array(), "AcmeBlogBundle:Blog/Post\ny\nyml\nfoobar\n", array('Blog\\Post', 'yml', 'foobar', true)), - array(array(), "AcmeBlogBundle:Blog/Post\ny\nyml\n/foobar\n", array('Blog\\Post', 'yml', 'foobar', true)), - array(array('--entity' => 'AcmeBlogBundle:Blog/Post', '--format' => 'yml', '--route-prefix' => 'foo', '--with-write' => true), '', array('Blog\\Post', 'yml', 'foo', true)), - ); - } - - /** - * @dataProvider getNonInteractiveCommandData - */ - public function testNonInteractiveCommand($options, $expected) - { - list($entity, $format, $prefix, $withWrite) = $expected; - - $generator = $this->getGenerator(); - $generator - ->expects($this->once()) - ->method('generate') - ->with($this->getBundle(), $entity, $this->getDoctrineMetadata(), $format, $prefix, $withWrite) - ; - - $tester = new CommandTester($this->getCommand($generator, '')); - $tester->execute($options, array('interactive' => false)); - } - - public function getNonInteractiveCommandData() - { - return array( - array(array('--entity' => 'AcmeBlogBundle:Blog/Post'), array('Blog\\Post', 'annotation', 'blog_post', false)), - array(array('--entity' => 'AcmeBlogBundle:Blog/Post', '--format' => 'yml', '--route-prefix' => 'foo', '--with-write' => true), array('Blog\\Post', 'yml', 'foo', true)), - ); - } - - protected function getCommand($generator, $input) - { - $command = $this - ->getMockBuilder('Sensio\Bundle\GeneratorBundle\Command\GenerateDoctrineCrudCommand') - ->setMethods(array('getEntityMetadata')) - ->getMock() - ; - - $command - ->expects($this->any()) - ->method('getEntityMetadata') - ->will($this->returnValue(array($this->getDoctrineMetadata()))) - ; - - $command->setContainer($this->getContainer()); - $command->setHelperSet($this->getHelperSet($input)); - $command->setGenerator($generator); - $command->setFormGenerator($this->getFormGenerator()); - - return $command; - } - - protected function getDoctrineMetadata() - { - return $this - ->getMockBuilder('Doctrine\ORM\Mapping\ClassMetadataInfo') - ->disableOriginalConstructor() - ->getMock() - ; - } - - protected function getGenerator() - { - // get a noop generator - return $this - ->getMockBuilder('Sensio\Bundle\GeneratorBundle\Generator\DoctrineCrudGenerator') - ->disableOriginalConstructor() - ->setMethods(array('generate')) - ->getMock() - ; - } - - protected function getFormGenerator() - { - return $this - ->getMockBuilder('Sensio\Bundle\GeneratorBundle\Generator\DoctrineFormGenerator') - ->disableOriginalConstructor() - ->setMethods(array('generate')) - ->getMock() - ; - } - - protected function getContainer() - { - $container = parent::getContainer(); - - $registry = $this->getMock('Symfony\Bridge\Doctrine\RegistryInterface'); - $registry - ->expects($this->any()) - ->method('getEntityNamespace') - ->will($this->returnValue('Foo\\FooBundle\\Entity')) - ; - - $container->set('doctrine', $registry); - - return $container; - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateDoctrineEntityCommandTest.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateDoctrineEntityCommandTest.php deleted file mode 100644 index 5ef35c2..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateDoctrineEntityCommandTest.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Tests\Command; - -use Symfony\Component\Console\Tester\CommandTester; -use Sensio\Bundle\GeneratorBundle\Command\GenerateDoctrineEntityCommand; - -class GenerateDoctrineEntityCommandTest extends GenerateCommandTest -{ - /** - * @dataProvider getInteractiveCommandData - */ - public function testInteractiveCommand($options, $input, $expected) - { - list($entity, $format, $fields) = $expected; - - $generator = $this->getGenerator(); - $generator - ->expects($this->once()) - ->method('generate') - ->with($this->getBundle(), $entity, $format, $fields) - ; - - $tester = new CommandTester($this->getCommand($generator, $input)); - $tester->execute($options); - } - - public function getInteractiveCommandData() - { - return array( - array(array(), "AcmeBlogBundle:Blog/Post\n", array('Blog\\Post', 'annotation', array())), - array(array('--entity' => 'AcmeBlogBundle:Blog/Post'), '', array('Blog\\Post', 'annotation', array())), - array(array(), "AcmeBlogBundle:Blog/Post\nyml\n\n", array('Blog\\Post', 'yml', array())), - array(array(), "AcmeBlogBundle:Blog/Post\nyml\ntitle\n\n255\ndescription\ntext\n\n", array('Blog\\Post', 'yml', array( - array('fieldName' => 'title', 'type' => 'string', 'length' => 255), - array('fieldName' => 'description', 'type' => 'text'), - ))), - ); - } - - /** - * @dataProvider getNonInteractiveCommandData - */ - public function testNonInteractiveCommand($options, $expected) - { - list($entity, $format, $fields) = $expected; - - $generator = $this->getGenerator(); - $generator - ->expects($this->once()) - ->method('generate') - ->with($this->getBundle(), $entity, $format, $fields) - ; - $generator - ->expects($this->any()) - ->method('isReservedKeyword') - ->will($this->returnValue(false)) - ; - - $tester = new CommandTester($this->getCommand($generator, '')); - $tester->execute($options, array('interactive' => false)); - } - - public function getNonInteractiveCommandData() - { - return array( - array(array('--entity' => 'AcmeBlogBundle:Blog/Post'), array('Blog\\Post', 'annotation', array())), - array(array('--entity' => 'AcmeBlogBundle:Blog/Post', '--format' => 'yml', '--fields' => 'title:string(255) description:text'), array('Blog\\Post', 'yml', array( - array('fieldName' => 'title', 'type' => 'string', 'length' => 255), - array('fieldName' => 'description', 'type' => 'text', 'length' => ''), - ))), - ); - } - - protected function getCommand($generator, $input) - { - $command = new GenerateDoctrineEntityCommand(); - $command->setContainer($this->getContainer()); - $command->setHelperSet($this->getHelperSet($input)); - $command->setGenerator($generator); - - return $command; - } - - protected function getGenerator() - { - // get a noop generator - return $this - ->getMockBuilder('Sensio\Bundle\GeneratorBundle\Generator\DoctrineEntityGenerator') - ->disableOriginalConstructor() - ->setMethods(array('generate', 'isReservedKeyword')) - ->getMock() - ; - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Generator/BundleGeneratorTest.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Generator/BundleGeneratorTest.php deleted file mode 100644 index 3f5f850..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Generator/BundleGeneratorTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Tests\Generator; - -use Sensio\Bundle\GeneratorBundle\Generator\BundleGenerator; - -class BundleGeneratorTest extends GeneratorTest -{ - public function testGenerateYaml() - { - $generator = new BundleGenerator($this->filesystem, __DIR__.'/../../Resources/skeleton/bundle'); - $generator->generate('Foo\BarBundle', 'FooBarBundle', $this->tmpDir, 'yml', false); - - $files = array( - 'FooBarBundle.php', - 'Controller/DefaultController.php', - 'Resources/views/Default/index.html.twig', - 'Resources/config/routing.yml', - 'Tests/Controller/DefaultControllerTest.php', - 'Resources/config/services.yml', - 'DependencyInjection/Configuration.php', - 'DependencyInjection/FooBarExtension.php', - ); - foreach ($files as $file) { - $this->assertTrue(file_exists($this->tmpDir.'/Foo/BarBundle/'.$file), sprintf('%s has been generated', $file)); - } - - $content = file_get_contents($this->tmpDir.'/Foo/BarBundle/FooBarBundle.php'); - $this->assertContains('namespace Foo\\BarBundle', $content); - - $content = file_get_contents($this->tmpDir.'/Foo/BarBundle/Controller/DefaultController.php'); - $this->assertContains('public function indexAction', $content); - $this->assertNotContains('@Route("/hello/{name}"', $content); - - $content = file_get_contents($this->tmpDir.'/Foo/BarBundle/Resources/views/Default/index.html.twig'); - $this->assertContains('Hello {{ name }}!', $content); - } - - public function testGenerateAnnotation() - { - $generator = new BundleGenerator($this->filesystem, __DIR__.'/../../Resources/skeleton/bundle'); - $generator->generate('Foo\BarBundle', 'FooBarBundle', $this->tmpDir, 'annotation', false); - - $this->assertFalse(file_exists($this->tmpDir.'/Foo/BarBundle/Resources/config/routing.yml')); - $this->assertFalse(file_exists($this->tmpDir.'/Foo/BarBundle/Resources/config/routing.xml')); - - $content = file_get_contents($this->tmpDir.'/Foo/BarBundle/Controller/DefaultController.php'); - $this->assertContains('@Route("/hello/{name}"', $content); - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Generator/DoctrineCrudGeneratorTest.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Generator/DoctrineCrudGeneratorTest.php deleted file mode 100644 index 6a7f5ee..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Generator/DoctrineCrudGeneratorTest.php +++ /dev/null @@ -1,206 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Tests\Generator; - -use Sensio\Bundle\GeneratorBundle\Generator\DoctrineCrudGenerator; - -class DoctrineCrudGeneratorTest extends GeneratorTest -{ - public function testGenerateYamlFull() - { - $this->getGenerator()->generate($this->getBundle(), 'Post', $this->getMetadata(), 'yml', '/post', true); - - $files = array( - 'Controller/PostController.php', - 'Tests/Controller/PostControllerTest.php', - 'Resources/config/routing/post.yml', - 'Resources/views/Post/index.html.twig', - 'Resources/views/Post/show.html.twig', - 'Resources/views/Post/new.html.twig', - 'Resources/views/Post/edit.html.twig', - ); - foreach ($files as $file) { - $this->assertTrue(file_exists($this->tmpDir.'/'.$file), sprintf('%s has been generated', $file)); - } - - $files = array( - 'Resources/config/routing/post.xml', - ); - foreach ($files as $file) { - $this->assertFalse(file_exists($this->tmpDir.'/'.$file), sprintf('%s has not been generated', $file)); - } - - $content = file_get_contents($this->tmpDir.'/Controller/PostController.php'); - $strings = array( - 'namespace Foo\BarBundle\Controller;', - 'public function indexAction', - 'public function showAction', - 'public function newAction', - 'public function editAction', - ); - foreach ($strings as $string) { - $this->assertContains($string, $content); - } - } - - public function testGenerateXml() - { - $this->getGenerator()->generate($this->getBundle(), 'Post', $this->getMetadata(), 'xml', '/post', false); - - $files = array( - 'Controller/PostController.php', - 'Tests/Controller/PostControllerTest.php', - 'Resources/config/routing/post.xml', - 'Resources/views/Post/index.html.twig', - 'Resources/views/Post/show.html.twig', - ); - foreach ($files as $file) { - $this->assertTrue(file_exists($this->tmpDir.'/'.$file), sprintf('%s has been generated', $file)); - } - - $files = array( - 'Resources/config/routing/post.yml', - 'Resources/views/Post/new.html.twig', - 'Resources/views/Post/edit.html.twig', - ); - foreach ($files as $file) { - $this->assertFalse(file_exists($this->tmpDir.'/'.$file), sprintf('%s has not been generated', $file)); - } - - $content = file_get_contents($this->tmpDir.'/Controller/PostController.php'); - $strings = array( - 'namespace Foo\BarBundle\Controller;', - 'public function indexAction', - 'public function showAction', - ); - foreach ($strings as $string) { - $this->assertContains($string, $content); - } - - $content = file_get_contents($this->tmpDir.'/Controller/PostController.php'); - $strings = array( - 'public function newAction', - 'public function editAction', - '@Route', - ); - foreach ($strings as $string) { - $this->assertNotContains($string, $content); - } - } - - public function testGenerateAnnotationWrite() - { - $this->getGenerator()->generate($this->getBundle(), 'Post', $this->getMetadata(), 'annotation', '/post', true); - - $files = array( - 'Controller/PostController.php', - 'Tests/Controller/PostControllerTest.php', - 'Resources/views/Post/index.html.twig', - 'Resources/views/Post/show.html.twig', - 'Resources/views/Post/new.html.twig', - 'Resources/views/Post/edit.html.twig', - ); - foreach ($files as $file) { - $this->assertTrue(file_exists($this->tmpDir.'/'.$file), sprintf('%s has been generated', $file)); - } - - $files = array( - 'Resources/config/routing/post.yml', - 'Resources/config/routing/post.xml', - ); - foreach ($files as $file) { - $this->assertFalse(file_exists($this->tmpDir.'/'.$file), sprintf('%s has not been generated', $file)); - } - - $content = file_get_contents($this->tmpDir.'/Controller/PostController.php'); - $strings = array( - 'namespace Foo\BarBundle\Controller;', - 'public function indexAction', - 'public function showAction', - 'public function newAction', - 'public function editAction', - '@Route', - ); - foreach ($strings as $string) { - $this->assertContains($string, $content); - } - } - - public function testGenerateAnnotation() - { - $this->getGenerator()->generate($this->getBundle(), 'Post', $this->getMetadata(), 'annotation', '/post', false); - - $files = array( - 'Controller/PostController.php', - 'Tests/Controller/PostControllerTest.php', - 'Resources/views/Post/index.html.twig', - 'Resources/views/Post/show.html.twig', - ); - foreach ($files as $file) { - $this->assertTrue(file_exists($this->tmpDir.'/'.$file), sprintf('%s has been generated', $file)); - } - - $files = array( - 'Resources/config/routing/post.yml', - 'Resources/config/routing/post.xml', - 'Resources/views/Post/new.html.twig', - 'Resources/views/Post/edit.html.twig', - ); - foreach ($files as $file) { - $this->assertFalse(file_exists($this->tmpDir.'/'.$file), sprintf('%s has not been generated', $file)); - } - - $content = file_get_contents($this->tmpDir.'/Controller/PostController.php'); - $strings = array( - 'namespace Foo\BarBundle\Controller;', - 'public function indexAction', - 'public function showAction', - '@Route', - ); - foreach ($strings as $string) { - $this->assertContains($string, $content); - } - - $content = file_get_contents($this->tmpDir.'/Controller/PostController.php'); - $strings = array( - 'public function newAction', - 'public function editAction', - ); - foreach ($strings as $string) { - $this->assertNotContains($string, $content); - } - } - - protected function getGenerator() - { - return new DoctrineCrudGenerator($this->filesystem, __DIR__.'/../../Resources/skeleton/crud'); - } - - protected function getBundle() - { - $bundle = $this->getMock('Symfony\Component\HttpKernel\Bundle\BundleInterface'); - $bundle->expects($this->any())->method('getPath')->will($this->returnValue($this->tmpDir)); - $bundle->expects($this->any())->method('getName')->will($this->returnValue('FooBarBundle')); - $bundle->expects($this->any())->method('getNamespace')->will($this->returnValue('Foo\BarBundle')); - - return $bundle; - } - - public function getMetadata() - { - $metadata = $this->getMockBuilder('Doctrine\ORM\Mapping\ClassMetadataInfo')->disableOriginalConstructor()->getMock(); - $metadata->identifier = array('id'); - $metadata->fieldMappings = array('title' => array('type' => 'string')); - - return $metadata; - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Generator/DoctrineFormGeneratorTest.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Generator/DoctrineFormGeneratorTest.php deleted file mode 100644 index 3255221..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Generator/DoctrineFormGeneratorTest.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Tests\Generator; - -use Sensio\Bundle\GeneratorBundle\Generator\DoctrineFormGenerator; - -class DoctrineFormGeneratorTest extends GeneratorTest -{ - public function testGenerate() - { - $generator = new DoctrineFormGenerator($this->filesystem, __DIR__.'/../../Resources/skeleton/form'); - - $bundle = $this->getMock('Symfony\Component\HttpKernel\Bundle\BundleInterface'); - $bundle->expects($this->any())->method('getPath')->will($this->returnValue($this->tmpDir)); - $bundle->expects($this->any())->method('getNamespace')->will($this->returnValue('Foo\BarBundle')); - - $metadata = $this->getMockBuilder('Doctrine\ORM\Mapping\ClassMetadataInfo')->disableOriginalConstructor()->getMock(); - $metadata->identifier = array('id'); - $metadata->associationMappings = array('title' => array('type' => 'string')); - - $generator->generate($bundle, 'Post', $metadata); - - $this->assertTrue(file_exists($this->tmpDir.'/Form/PostType.php')); - - $content = file_get_contents($this->tmpDir.'/Form/PostType.php'); - $this->assertContains('->add(\'title\')', $content); - $this->assertContains('class PostType extends AbstractType', $content); - $this->assertContains("'data_class' => 'Foo\BarBundle\Entity\Post'", $content); - $this->assertContains("'foo_barbundle_posttype'", $content); - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Generator/GeneratorTest.php b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Generator/GeneratorTest.php deleted file mode 100644 index 4435b4a..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Generator/GeneratorTest.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Sensio\Bundle\GeneratorBundle\Tests\Generator; - -use Symfony\Component\Filesystem\Filesystem; - -abstract class GeneratorTest extends \PHPUnit_Framework_TestCase -{ - protected $filesystem; - protected $tmpDir; - - public function setUp() - { - $this->tmpDir = sys_get_temp_dir().'/sf2'; - $this->filesystem = new Filesystem(); - $this->filesystem->remove($this->tmpDir); - } - - public function tearDown() - { - $this->filesystem->remove($this->tmpDir); - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/composer.json b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/composer.json deleted file mode 100644 index 9195908..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/composer.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "sensio/generator-bundle", - "description": "This bundle generates code for you", - "keywords": [], - "type": "symfony-bundle", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "require": { - "symfony/framework-bundle": "2.1.*" - }, - "require-dev": { - "symfony/doctrine-bridge": "2.1.*", - "doctrine/orm": ">=2.1,<2.4-dev", - "twig/twig": ">=1.8,<2.0-dev" - }, - "autoload": { - "psr-0": { "Sensio\\Bundle\\GeneratorBundle": "" } - }, - "target-dir": "Sensio/Bundle/GeneratorBundle", - "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev" - } - } -} diff --git a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/phpunit.xml.dist b/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/phpunit.xml.dist deleted file mode 100644 index 6eb1ca0..0000000 --- a/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/phpunit.xml.dist +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - ./Tests - - - - - - ./ - - ./Resources - ./Tests - ./vendor - - - - diff --git a/vendor/swiftmailer/swiftmailer/.gitignore b/vendor/swiftmailer/swiftmailer/.gitignore deleted file mode 100644 index 0aa62f5..0000000 --- a/vendor/swiftmailer/swiftmailer/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.DS_Store -tests/acceptance.conf.php -tests/smoke.conf.php -build/* -.project -.settings/* diff --git a/vendor/swiftmailer/swiftmailer/CHANGES b/vendor/swiftmailer/swiftmailer/CHANGES deleted file mode 100644 index a6a53ab..0000000 --- a/vendor/swiftmailer/swiftmailer/CHANGES +++ /dev/null @@ -1,100 +0,0 @@ -Changelog since Version 4.x.x -============================= - -4.2.2 (2012-XX-XX) ------------------- - - * n/a - -4.2.1 (2012-07-13) ------------------- - - * changed the coding standards to PSR-1/2 - * fixed issue with autoloading - * added NativeQpContentEncoder to enhance performance (for PHP 5.3+) - -4.2.0 (2012-06-29) ------------------- - - * added documentation about how to use the Japanese support introduced in 4.1.8 - * added a way to override the default configuration in a lazy way - * changed the PEAR init script to lazy-load the initialization - * fixed a bug when calling Swift_Preferences before anything else (regression introduced in 4.1.8) - -4.1.8 (2012-06-17) ------------------- - - * added Japanese iso-2022-jp support - * changed the init script to lazy-load the initialization - * fixed docblocks (@id) which caused some problems with libraries parsing the dobclocks - * fixed Swift_Mime_Headers_IdentificationHeader::setId() when passed an array of ids - * fixed encoding of email addresses in headers - * added replacements setter to the Decorator plugin - -4.1.7 (2012-04-26) ------------------- - - * fixed QpEncoder safeMapShareId property - -4.1.6 (2012-03-23) ------------------- - - * reduced the size of serialized Messages - -4.1.5 (2012-01-04) ------------------- - - * enforced Swift_Spool::queueMessage() to return a Boolean - * made an optimization to the memory spool: start the transport only when required - * prevented stream_socket_client() from generating an error and throw a Swift_TransportException instead - * fixed a PHP warning when calling to mail() when safe_mode is off - * many doc tweaks - -4.1.4 (2011-12-16) ------------------- - - * added a memory spool (Swift_MemorySpool) - * fixed too many opened files when sending emails with attachments - -4.1.3 (2011-10-27) ------------------- - - * added STARTTLS support - * added missing @return tags on fluent methods - * added a MessageLogger plugin that logs all sent messages - * added composer.json - -4.1.2 (2011-09-13) ------------------- - - * fixed wrong detection of magic_quotes_runtime - * fixed fatal errors when no To or Subject header has been set - * fixed charset on parameter header continuations - * added documentation about how to install Swiftmailer from the PEAR channel - * fixed various typos and markup problem in the documentation - * fixed warning when cache directory does not exist - * fixed "slashes are escaped" bug - * changed require_once() to require() in autoload - -4.1.1 (2011-07-04) ------------------- - - * added missing file in PEAR package - -4.1.0 (2011-06-30) ------------------- - - * documentation has been converted to ReST - -4.1.0 RC1 (2011-06-17) ----------------------- - -New features: - - * changed the Decorator Plugin to allow replacements in all headers - * added Swift_Mime_Grammar and Swift_Validate to validate an email address - * modified the autoloader to lazy-initialize Swiftmailer - * removed Swift_Mailer::batchSend() - * added NullTransport - * added new plugins: RedirectingPlugin and ImpersonatePlugin - * added a way to send messages asynchronously (Spool) diff --git a/vendor/swiftmailer/swiftmailer/LICENSE b/vendor/swiftmailer/swiftmailer/LICENSE deleted file mode 100644 index fc8a5de..0000000 --- a/vendor/swiftmailer/swiftmailer/LICENSE +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/vendor/swiftmailer/swiftmailer/README b/vendor/swiftmailer/swiftmailer/README deleted file mode 100644 index dfede07..0000000 --- a/vendor/swiftmailer/swiftmailer/README +++ /dev/null @@ -1,16 +0,0 @@ -Swift Mailer ------------- - -Swift Mailer is a component based mailing solution for PHP 5. -It is released under the LGPL license. - -Homepage: http://swiftmailer.org -Documentation: http://swiftmailer.org/docs -Mailing List: http://groups.google.com/group/swiftmailer -Bugs: https://github.com/swiftmailer/swiftmailer/issues -Repository: https://github.com/swiftmailer/swiftmailer - -Swift Mailer is highly object-oriented by design and lends itself -to use in complex web application with a great deal of flexibility. - -For full details on usage, see the documentation. diff --git a/vendor/swiftmailer/swiftmailer/README.git b/vendor/swiftmailer/swiftmailer/README.git deleted file mode 100644 index 3baef7c..0000000 --- a/vendor/swiftmailer/swiftmailer/README.git +++ /dev/null @@ -1,67 +0,0 @@ -This README applies to anyone who checks out the source from git. - -If you're reading this page on github.com, and you don't have git -installed or know about git, you can download this repository by -using the "download" button on github.com, right above the file -list. - -PREAMBLE: ---------- - -The git repository is structured in the expected way where "master" is the -main branch you should use if you want to have bleeding-edge updates. Any -other branch should be ignored since it will likely contain unstable -and/or experimental developments. - -Generally speaking you should feel safe using the "master" branch in -production code. Anything likely to break will be committed to another -branch. Only bugfixes and clean non-breaking feature additions will be -performed in master. - -All releases (post version 4.0.0) are tagged using the version number of -that release. Earlier versions exist in a subversion repository at the -old sourceforge project page. - - -WHAT IS SWIFT MAILER? ---------------------- - -Swift Mailer is a component based mailing solution for PHP 5. -It is released under the LGPL license. - -Homepage: http://swiftmailer.org/ -Documentation: http://swiftmailer.org/docs -Mailing List: http://groups.google.com/group/swiftmailer -Bugs: https://github.com/swiftmailer/swiftmailer/issues -Repository: https://github.com/swiftmailer/swiftmailer - -Swift Mailer is highly object-oriented by design and lends itself -to use in complex web application with a great deal of flexibility. - -For full details on usage, see the documentation. - - -WHY SO MUCH CLUTTER? --------------------- -As you can probably see, there are a lot more files in here than you find in -the pre-packaged versions. That's because I store notes (UML, RFCs etc) in -the repository. - -The main library files live in /lib and the tests live in /tests. You can run -the tests by pointing your web browser at /test-suite, or by running the -command "php test-suite/run.php". Some tests will be "skipped" if -tests/smoke.conf.php and tests/acceptance.conf.php are not editted. This is -harmless and normal. - -If you want to create a bundled-up package from subversion you can do so if -you have Ant (http://ant.apache.org/) installed. Simply run "ant package" -from this directory and the tar.gz file will be created in the /build -directory. - -Running the command "ant" with no arguments will bundle up the package without -compressing it into a tar.gz file. - -Tests can also be run using "ant test" provided php is on your PATH -environment variable. - -EoM diff --git a/vendor/swiftmailer/swiftmailer/VERSION b/vendor/swiftmailer/swiftmailer/VERSION deleted file mode 100644 index 64a59ba..0000000 --- a/vendor/swiftmailer/swiftmailer/VERSION +++ /dev/null @@ -1 +0,0 @@ -Swift-4.2.2-DEV diff --git a/vendor/swiftmailer/swiftmailer/build.xml b/vendor/swiftmailer/swiftmailer/build.xml deleted file mode 100644 index c4e234f..0000000 --- a/vendor/swiftmailer/swiftmailer/build.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/swiftmailer/swiftmailer/composer.json b/vendor/swiftmailer/swiftmailer/composer.json deleted file mode 100644 index b1d6d8c..0000000 --- a/vendor/swiftmailer/swiftmailer/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "swiftmailer/swiftmailer", - "type": "library", - "description": "Swiftmailer, free feature-rich PHP mailer", - "keywords": ["mail","mailer"], - "homepage": "http://swiftmailer.org", - "license": "LGPL", - "authors": [ - { - "name": "Chris Corbyn", - "email": "" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "require": { - "php": ">=5.2.4" - }, - "autoload": { - "files": ["lib/swift_required.php"] - }, - "extra": { - "branch-alias": { - "dev-master": "4.2-dev" - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/create_pear_package.php b/vendor/swiftmailer/swiftmailer/create_pear_package.php deleted file mode 100644 index 521d650..0000000 --- a/vendor/swiftmailer/swiftmailer/create_pear_package.php +++ /dev/null @@ -1,42 +0,0 @@ - date('Y-m-d'), - 'time' => date('H:m:00'), - 'version' => $argv[1], - 'api_version' => $argv[1], - 'stability' => $argv[2], - 'api_stability' => $argv[2], -); - -$context['files'] = ''; -$path = realpath(dirname(__FILE__).'/lib/classes/Swift'); -foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::LEAVES_ONLY) as $file) -{ - if (preg_match('/\.php$/', $file)) - { - $name = str_replace($path.'/', '', $file); - $context['files'] .= ' '."\n"; - } -} - -$template = file_get_contents(dirname(__FILE__).'/package.xml.tpl'); -$content = preg_replace_callback('/\{\{\s*([a-zA-Z0-9_]+)\s*\}\}/', 'replace_parameters', $template); -file_put_contents(dirname(__FILE__).'/package.xml', $content); - -function replace_parameters($matches) -{ - global $context; - - return isset($context[$matches[1]]) ? $context[$matches[1]] : null; -} diff --git a/vendor/swiftmailer/swiftmailer/doc/headers.rst b/vendor/swiftmailer/swiftmailer/doc/headers.rst deleted file mode 100644 index 9e41bfb..0000000 --- a/vendor/swiftmailer/swiftmailer/doc/headers.rst +++ /dev/null @@ -1,742 +0,0 @@ -Message Headers -=============== - -Sometimes you'll want to add your own headers to a message or modify/remove -headers that are already present. You work with the message's HeaderSet to do -this. - -Header Basics -------------- - -All MIME entities in Swift Mailer -- including the message itself -- -store their headers in a single object called a HeaderSet. This HeaderSet is -retrieved with the ``getHeaders()`` method. - -As mentioned in the previous chapter, everything that forms a part of a message -in Swift Mailer is a MIME entity that is represented by an instance of -``Swift_Mime_MimeEntity``. This includes -- most notably -- the message object -itself, attachments, MIME parts and embedded images. Each of these MIME entities -consists of a body and a set of headers that describe the body. - -For all of the "standard" headers in these MIME entities, such as the -``Content-Type``, there are named methods for working with them, such as -``setContentType()`` and ``getContentType()``. This is because headers are a -moderately complex area of the library. Each header has a slightly different -required structure that it must meet in order to comply with the standards that -govern email (and that are checked by spam blockers etc). - -You fetch the HeaderSet from a MIME entity like so: - -.. code-block:: php - - $message = Swift_Message::newInstance(); - - // Fetch the HeaderSet from a Message object - $headers = $message->getHeaders(); - - $attachment = Swift_Attachment::fromPath('document.pdf'); - - // Fetch the HeaderSet from an attachment object - $headers = $attachment->getHeaders(); - -The job of the HeaderSet is to contain and manage instances of Header objects. -Depending upon the MIME entity the HeaderSet came from, the contents of the -HeaderSet will be different, since an attachment for example has a different -set of headers to those in a message. - -You can find out what the HeaderSet contains with a quick loop, dumping out -the names of the headers: - -.. code-block:: php - - foreach ($headers->getAll() as $header) { - printf("%s
\n", $header->getFieldName()); - } - - /* - Content-Transfer-Encoding - Content-Type - MIME-Version - Date - Message-ID - From - Subject - To - */ - -You can also dump out the rendered HeaderSet by calling its ``toString()`` -method: - -.. code-block:: php - - echo $headers->toString(); - - /* - Message-ID: <1234869991.499a9ee7f1d5e@swift.generated> - Date: Tue, 17 Feb 2009 22:26:31 +1100 - Subject: Awesome subject! - From: sender@example.org - To: recipient@example.org - MIME-Version: 1.0 - Content-Type: text/plain; charset=utf-8 - Content-Transfer-Encoding: quoted-printable - */ - -Where the complexity comes in is when you want to modify an existing header. -This complexity comes from the fact that each header can be of a slightly -different type (such as a Date header, or a header that contains email -addresses, or a header that has key-value parameters on it!). Each header in the -HeaderSet is an instance of ``Swift_Mime_Header``. They all have common -functionality, but knowing exactly what type of header you're working with will -allow you a little more control. - -You can determine the type of header by comparing the return value of its -``getFieldType()`` method with the constants ``TYPE_TEXT``, -``TYPE_PARAMETERIZED``, ``TYPE_DATE``, ``TYPE_MAILBOX``, ``TYPE_ID`` and -``TYPE_PATH`` which are defined in ``Swift_Mime_Header``. - - -.. code-block:: php - - foreach ($headers->getAll() as $header) { - switch ($header->getFieldType()) { - case Swift_Mime_Header::TYPE_TEXT: $type = 'text'; - break; - case Swift_Mime_Header::TYPE_PARAMETERIZED: $type = 'parameterized'; - break; - case Swift_Mime_Header::TYPE_MAILBOX: $type = 'mailbox'; - break; - case Swift_Mime_Header::TYPE_DATE: $type = 'date'; - break; - case Swift_Mime_Header::TYPE_ID: $type = 'ID'; - break; - case Swift_Mime_Header::TYPE_PATH: $type = 'path'; - break; - } - printf("%s: is a %s header
\n", $header->getFieldName(), $type); - } - - /* - Content-Transfer-Encoding: is a text header - Content-Type: is a parameterized header - MIME-Version: is a text header - Date: is a date header - Message-ID: is a ID header - From: is a mailbox header - Subject: is a text header - To: is a mailbox header - */ - -Headers can be removed from the set, modified within the set, or added to the -set. - -The following sections show you how to work with the HeaderSet and explain the -details of each implementation of ``Swift_Mime_Header`` that may -exist within the HeaderSet. - -Header Types ------------- - -Because all headers are modeled on different data (dates, addresses, text!) -there are different types of Header in Swift Mailer. Swift Mailer attempts to -categorize all possible MIME headers into more general groups, defined by a -small number of classes. - -Text Headers -~~~~~~~~~~~~ - -Text headers are the simplest type of Header. They contain textual information -with no special information included within it -- for example the Subject -header in a message. - -There's nothing particularly interesting about a text header, though it is -probably the one you'd opt to use if you need to add a custom header to a -message. It represents text just like you'd think it does. If the text -contains characters that are not permitted in a message header (such as new -lines, or non-ascii characters) then the header takes care of encoding the -text so that it can be used. - -No header -- including text headers -- in Swift Mailer is vulnerable to -header-injection attacks. Swift Mailer breaks any attempt at header injection by -encoding the dangerous data into a non-dangerous form. - -It's easy to add a new text header to a HeaderSet. You do this by calling the -HeaderSet's ``addTextHeader()`` method. - -.. code-block:: php - - $message = Swift_Message::newInstance(); - - $headers = $message->getHeaders(); - - $headers->addTextHeader('Your-Header-Name', 'the header value'); - -Changing the value of an existing text header is done by calling it's -``setValue()`` method. - -.. code-block:: php - - $subject = $message->getHeaders()->get('Subject'); - - $subject->setValue('new subject'); - -When output via ``toString()``, a text header produces something like the -following: - -.. code-block:: php - - $subject = $message->getHeaders()->get('Subject'); - - $subject->setValue('amazing subject line'); - - echo $subject->toString(); - - /* - - Subject: amazing subject line - - */ - -If the header contains any characters that are outside of the US-ASCII range -however, they will be encoded. This is nothing to be concerned about since -mail clients will decode them back. - -.. code-block:: php - - $subject = $message->getHeaders()->get('Subject'); - - $subject->setValue('contains – dash'); - - echo $subject->toString(); - - /* - - Subject: contains =?utf-8?Q?=E2=80=93?= dash - - */ - -Parameterized Headers -~~~~~~~~~~~~~~~~~~~~~ - -Parameterized headers are text headers that contain key-value parameters -following the textual content. The Content-Type header of a message is a -parameterized header since it contains charset information after the content -type. - -The parameterized header type is a special type of text header. It extends the -text header by allowing additional information to follow it. All of the methods -from text headers are available in addition to the methods described here. - -Adding a parameterized header to a HeaderSet is done by using the -``addParameterizedHeader()`` method which takes a text value like -``addTextHeader()`` but it also accepts an associative array of -key-value parameters. - -.. code-block:: php - - $message = Swift_Message::newInstance(); - - $headers = $message->getHeaders(); - - $headers->addParameterizedHeader( - 'Header-Name', 'header value', - array('foo' => 'bar') - ); - -To change the text value of the header, call it's ``setValue()`` method just as -you do with text headers. - -To change the parameters in the header, call the header's ``setParameters()`` -method or the ``setParameter()`` method (note the pluralization). - -.. code-block:: php - - $type = $message->getHeaders()->get('Content-Type'); - - // setParameters() takes an associative array - $type->setParameters(array( - 'name' => 'file.txt', - 'charset' => 'iso-8859-1' - )); - - // setParameter() takes two args for $key and $value - $type->setParameter('charset', 'iso-8859-1'); - -When output via ``toString()``, a parameterized header produces something like -the following: - -.. code-block:: php - - $type = $message->getHeaders()->get('Content-Type'); - - $type->setValue('text/html'); - $type->setParameter('charset', 'utf-8'); - - echo $type->toString(); - - /* - - Content-Type: text/html; charset=utf-8 - - */ - -If the header contains any characters that are outside of the US-ASCII range -however, they will be encoded, just like they are for text headers. This is -nothing to be concerned about since mail clients will decode them back. -Likewise, if the parameters contain any non-ascii characters they will be -encoded so that they can be transmitted safely. - -.. code-block:: php - - $attachment = Swift_Attachment::newInstance(); - - $disp = $attachment->getHeaders()->get('Content-Disposition'); - - $disp->setValue('attachment'); - $disp->setParameter('filename', 'report–may.pdf'); - - echo $disp->toString(); - - /* - - Content-Disposition: attachment; filename*=utf-8''report%E2%80%93may.pdf - - */ - -Date Headers -~~~~~~~~~~~~ - -Date headers contains an RFC 2822 formatted date (i.e. what PHP's ``date('r')`` -returns). They are used anywhere a date or time is needed to be presented as a -message header. - -The data on which a date header is modeled is simply a UNIX timestamp such as -that returned by ``time()`` or ``strtotime()``. The timestamp is used to create -a correctly structured RFC 2822 formatted date such as -``Tue, 17 Feb 2009 22:26:31 +1100``. - -The obvious place this header type is used is in the ``Date:`` header of the -message itself. - -It's easy to add a new date header to a HeaderSet. You do this by calling -the HeaderSet's ``addDateHeader()`` method. - -.. code-block:: php - - $message = Swift_Message::newInstance(); - - $headers = $message->getHeaders(); - - $headers->addDateHeader('Your-Header-Name', strtotime('3 days ago')); - -Changing the value of an existing date header is done by calling it's -``setTimestamp()`` method. - -.. code-block:: php - - $date = $message->getHeaders()->get('Date'); - - $date->setTimestamp(time()); - -When output via ``toString()``, a date header produces something like the -following: - -.. code-block:: php - - $date = $message->getHeaders()->get('Date'); - - echo $date->toString(); - - /* - - Date: Wed, 18 Feb 2009 13:35:02 +1100 - - */ - -Mailbox (e-mail address) Headers -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Mailbox headers contain one or more email addresses, possibly with -personalized names attached to them. The data on which they are modeled is -represented by an associative array of email addresses and names. - -Mailbox headers are probably the most complex header type to understand in -Swift Mailer because they accept their input as an array which can take various -forms, as described in the previous chapter. - -All of the headers that contain e-mail addresses in a message -- with the -exception of ``Return-Path:`` which has a stricter syntax -- use this header -type. That is, ``To:``, ``From:`` etc. - -You add a new mailbox header to a HeaderSet by calling the HeaderSet's -``addMailboxHeader()`` method. - -.. code-block:: php - - $message = Swift_Message::newInstance(); - - $headers = $message->getHeaders(); - - $headers->addMailboxHeader('Your-Header-Name', array( - 'person1@example.org' => 'Person Name One', - 'person2@example.org', - 'person3@example.org', - 'person4@example.org' => 'Another named person' - )); - -Changing the value of an existing mailbox header is done by calling it's -``setNameAddresses()`` method. - -.. code-block:: php - - $to = $message->getHeaders()->get('To'); - - $to->setNameAddresses(array( - 'joe@example.org' => 'Joe Bloggs', - 'john@example.org' => 'John Doe', - 'no-name@example.org' - )); - -If you don't wish to concern yourself with the complicated accepted input -formats accepted by ``setNameAddresses()`` as described in the previous chapter -and you only want to set one or more addresses (not names) then you can just -use the ``setAddresses()`` method instead. - -.. code-block:: php - - $to = $message->getHeaders()->get('To'); - - $to->setAddresses(array( - 'joe@example.org', - 'john@example.org', - 'no-name@example.org' - )); - -.. note:: - - Both methods will accept the above input format in practice. - -If all you want to do is set a single address in the header, you can use a -string as the input parameter to ``setAddresses()`` and/or -``setNameAddresses()``. - -.. code-block:: php - - $to = $message->getHeaders()->get('To'); - - $to->setAddresses('joe-bloggs@example.org'); - -When output via ``toString()``, a mailbox header produces something like the -following: - -.. code-block:: php - - $to = $message->getHeaders()->get('To'); - - $to->setNameAddresses(array( - 'person1@example.org' => 'Name of Person', - 'person2@example.org', - 'person3@example.org' => 'Another Person' - )); - - echo $to->toString(); - - /* - - To: Name of Person , person2@example.org, Another Person - - - */ - -ID Headers -~~~~~~~~~~ - -ID headers contain identifiers for the entity (or the message). The most -notable ID header is the Message-ID header on the message itself. - -An ID that exists inside an ID header looks more-or-less less like an email -address. For example, ``<1234955437.499becad62ec2@example.org>``. -The part to the left of the @ sign is usually unique, based on the current time -and some random factor. The part on the right is usually a domain name. - -Any ID passed the an ID header's ``setId()`` method absolutely MUST conform to -this structure, otherwise you'll get an Exception thrown at you by Swift Mailer -(a ``Swift_RfcComplianceException``). This is to ensure that the generated -email complies with relevant RFC documents and therefore is less likely to be -blocked as spam. - -It's easy to add a new ID header to a HeaderSet. You do this by calling -the HeaderSet's ``addIdHeader()`` method. - -.. code-block:: php - - $message = Swift_Message::newInstance(); - - $headers = $message->getHeaders(); - - $headers->addIdHeader('Your-Header-Name', '123456.unqiue@example.org'); - -Changing the value of an existing date header is done by calling its -``setId()`` method. - -.. code-block:: php - - $msgId = $message->getHeaders()->get('Message-ID'); - - $msgId->setId(time() . '.' . uniqid('thing') . '@example.org'); - -When output via ``toString()``, an ID header produces something like the -following: - -.. code-block:: php - - $msgId = $message->getHeaders()->get('Message-ID'); - - echo $msgId->toString(); - - /* - - Message-ID: <1234955437.499becad62ec2@example.org> - - */ - -Path Headers -~~~~~~~~~~~~ - -Path headers are like very-restricted mailbox headers. They contain a single -email address with no associated name. The Return-Path header of a message is -a path header. - -You add a new path header to a HeaderSet by calling the HeaderSet's -``addPathHeader()`` method. - -.. code-block:: php - - $message = Swift_Message::newInstance(); - - $headers = $message->getHeaders(); - - $headers->addPathHeader('Your-Header-Name', 'person@example.org'); - - -Changing the value of an existing path header is done by calling its -``setAddress()`` method. - -.. code-block:: php - - $return = $message->getHeaders()->get('Return-Path'); - - $return->setAddress('my-address@example.org'); - -When output via ``toString()``, a path header produces something like the -following: - -.. code-block:: php - - $return = $message->getHeaders()->get('Return-Path'); - - $return->setAddress('person@example.org'); - - echo $return->toString(); - - /* - - Return-Path: - - */ - -Header Operations ------------------ - -Working with the headers in a message involves knowing how to use the methods -on the HeaderSet and on the individual Headers within the HeaderSet. - -Adding new Headers -~~~~~~~~~~~~~~~~~~ - -New headers can be added to the HeaderSet by using one of the provided -``add..Header()`` methods. - -To add a header to a MIME entity (such as the message): - -Get the HeaderSet from the entity by via its ``getHeaders()`` method. - -* Add the header to the HeaderSet by calling one of the ``add..Header()`` - methods. - -The added header will appear in the message when it is sent. - -.. code-block:: php - - // Adding a custom header to a message - $message = Swift_Message::newInstance(); - $headers = $message->getHeaders(); - $headers->addTextHeader('X-Mine', 'something here'); - - // Adding a custom header to an attachment - $attachment = Swift_Attachment::fromPath('/path/to/doc.pdf'); - $attachment->getHeaders()->addDateHeader('X-Created-Time', time()); - -Retrieving Headers -~~~~~~~~~~~~~~~~~~ - -Headers are retrieved through the HeaderSet's ``get()`` and ``getAll()`` -methods. - -To get a header, or several headers from a MIME entity: - -* Get the HeaderSet from the entity by via its ``getHeaders()`` method. - -* Get the header(s) from the HeaderSet by calling either ``get()`` or - ``getAll()``. - -When using ``get()`` a single header is returned that matches the name (case -insensitive) that is passed to it. When using ``getAll()`` with a header name, -an array of headers with that name are returned. Calling ``getAll()`` with no -arguments returns an array of all headers present in the entity. - -.. note:: - - It's valid for some headers to appear more than once in a message (e.g. - the Received header). For this reason ``getAll()`` exists to fetch all - headers with a specified name. In addition, ``get()`` accepts an optional - numerical index, starting from zero to specify which header you want more - specifically. - -.. note:: - - If you want to modify the contents of the header and you don't know for - sure what type of header it is then you may need to check the type by - calling its ``getFieldType()`` method. - - .. code-block:: php - - $headers = $message->getHeaders(); - - // Get the To: header - $toHeader = $headers->get('To'); - - // Get all headers named "X-Foo" - $fooHeaders = $headers->getAll('X-Foo'); - - // Get the second header named "X-Foo" - $foo = $headers->get('X-Foo', 1); - - // Get all headers that are present - $all = $headers->getAll(); - -Check if a Header Exists -~~~~~~~~~~~~~~~~~~~~~~~~ - -You can check if a named header is present in a HeaderSet by calling its -``has()`` method. - -To check if a header exists: - -* Get the HeaderSet from the entity by via its ``getHeaders()`` method. - -* Call the HeaderSet's ``has()`` method specifying the header you're looking - for. - -If the header exists, ``true`` will be returned or ``false`` if not. - -.. note:: - - It's valid for some headers to appear more than once in a message (e.g. - the Received header). For this reason ``has()`` accepts an optional - numerical index, starting from zero to specify which header you want to - check more specifically. - - .. code-block:: php - - $headers = $message->getHeaders(); - - // Check if the To: header exists - if ($headers->has('To')) { - echo 'To: exists'; - } - - // Check if an X-Foo header exists twice (i.e. check for the 2nd one) - if ($headers->has('X-Foo', 1)) { - echo 'Second X-Foo header exists'; - } - -Removing Headers -~~~~~~~~~~~~~~~~ - -Removing a Header from the HeaderSet is done by calling the HeaderSet's -``remove()`` or ``removeAll()`` methods. - -To remove an existing header: - -* Get the HeaderSet from the entity by via its ``getHeaders()`` method. - -* Call the HeaderSet's ``remove()`` or ``removeAll()`` methods specifying the - header you want to remove. - -When calling ``remove()`` a single header will be removed. When calling -``removeAll()`` all headers with the given name will be removed. If no headers -exist with the given name, no errors will occur. - -.. note:: - - It's valid for some headers to appear more than once in a message (e.g. - the Received header). For this reason ``remove()`` accepts an optional - numerical index, starting from zero to specify which header you want to - check more specifically. For the same reason, ``removeAll()`` exists to - remove all headers that have the given name. - - .. code-block:: php - - $headers = $message->getHeaders(); - - // Remove the Subject: header - $headers->remove('Subject'); - - // Remove all X-Foo headers - $headers->removeAll('X-Foo'); - - // Remove only the second X-Foo header - $headers->remove('X-Foo', 1); - -Modifying a Header's Content -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To change a Header's content you should know what type of header it is and then -call it's appropriate setter method. All headers also have a -``setFieldBodyModel()`` method that accepts a mixed parameter and delegates to -the correct setter. - -To modify an existing header: - -* Get the HeaderSet from the entity by via its ``getHeaders()`` method. - -* Get the Header by using the HeaderSet's ``get()``. - -* Call the Header's appropriate setter method or call the header's - ``setFieldBodyModel()`` method. - -The header will be updated inside the HeaderSet and the changes will be seen -when the message is sent. - -.. code-block:: php - - $headers = $message->getHeaders(); - - // Change the Subject: header - $subj = $headers->get('Subject'); - $subj->setValue('new subject here'); - - // Change the To: header - $to = $headers->get('To'); - $to->setNameAddresses(array( - 'person@example.org' => 'Person', - 'thing@example.org' - )); - - // Using the setFieldBodyModel() just delegates to the correct method - // So here to calls setNameAddresses() - $to->setFieldBodyModel(array( - 'person@example.org' => 'Person', - 'thing@example.org' - )); diff --git a/vendor/swiftmailer/swiftmailer/doc/help-resources.rst b/vendor/swiftmailer/swiftmailer/doc/help-resources.rst deleted file mode 100644 index 9820653..0000000 --- a/vendor/swiftmailer/swiftmailer/doc/help-resources.rst +++ /dev/null @@ -1,44 +0,0 @@ -Getting Help -============ - -There are a number of ways you can get help when using Swift Mailer, depending -upon the nature of your problem. For bug reports and feature requests create a -new ticket in Github. For general advice ask on the Google Group -(swiftmailer). - -Submitting Bugs & Feature Requests ----------------------------------- - -Bugs and feature requests should be posted on Github. - -If you post a bug or request a feature in the forum, or on the Google Group -you will most likely be asked to create a ticket in `Github`_ since it is -the simply not feasible to manage such requests from a number of a different -sources. - -When you go to Github you will be asked to create a username and password -before you can create a ticket. This is free and takes very little time. - -When you create your ticket, do not assign it to any milestones. A developer -will assess your ticket and re-assign it as needed. - -If your ticket is reporting a bug present in the current version, which was -not present in the previous version please include the tag "regression" in -your ticket. - -Github will update you when work is performed on your ticket. - -Ask on the Google Group ------------------------ - -You can seek advice at Google Groups, within the "swiftmailer" `group`_. - -You can post messages to this group if you want help, or there's something you -wish to discuss with the developers and with other users. - -This is probably the fastest way to get help since it is primarily email-based -for most users, though bug reports should not be posted here since they may -not be resolved. - -.. _`Github`: https://github.com/swiftmailer/swiftmailer/issues -.. _`group`: http://groups.google.com/group/swiftmailer diff --git a/vendor/swiftmailer/swiftmailer/doc/including-the-files.rst b/vendor/swiftmailer/swiftmailer/doc/including-the-files.rst deleted file mode 100644 index cd18350..0000000 --- a/vendor/swiftmailer/swiftmailer/doc/including-the-files.rst +++ /dev/null @@ -1,56 +0,0 @@ -Including Swift Mailer (Autoloading) -==================================== - -If you are using Composer, Swift Mailer will be automatically autoloaded. - -If not, you can use the built-in autoloader by requiring the -``swift_required.php`` file:: - - require_once '/path/to/swift-mailer/lib/swift_required.php'; - - /* rest of code goes here */ - -If you want to override the default Swift Mailer configuration, call the -``init()`` method on the ``Swift`` class and pass it a valid PHP callable (a -PHP function name, a PHP 5.3 anonymous function, ...):: - - require_once '/path/to/swift-mailer/lib/swift_required.php'; - - function swiftmailer_configurator() { - // configure Swift Mailer - - Swift_DependencyContainer::getInstance()->... - Swift_Preferences::getInstance()->... - } - - Swift::init('swiftmailer_configurator'); - - /* rest of code goes here */ - -The advantage of using the ``init()`` method is that your code will be -executed only if you use Swift Mailer in your script. - -.. note:: - - While Swift Mailer's autoloader is designed to play nicely with other - autoloaders, sometimes you may have a need to avoid using Swift Mailer's - autoloader and use your own instead. Include the ``swift_init.php`` - instead of the ``swift_required.php`` if you need to do this. The very - minimum include is the ``swift_init.php`` file since Swift Mailer will not - work without the dependency injection this file sets up: - - .. code-block:: php - - require_once '/path/to/swift-mailer/lib/swift_init.php'; - - /* rest of code goes here */ - -For PHP versions starting with 5.3 it is recommended using the native quoted -printable encoder. It uses PHP’s native ``quoted_printable_encode()``-function -to achieve much better performance:: - - Swift::init(function () { - Swift_DependencyContainer::getInstance() - ->register('mime.qpcontentencoder') - ->asAliasOf('mime.nativeqpcontentencoder'); - }); diff --git a/vendor/swiftmailer/swiftmailer/doc/index.rst b/vendor/swiftmailer/swiftmailer/doc/index.rst deleted file mode 100644 index a1a0a92..0000000 --- a/vendor/swiftmailer/swiftmailer/doc/index.rst +++ /dev/null @@ -1,16 +0,0 @@ -Swiftmailer -=========== - -.. toctree:: - :maxdepth: 2 - - introduction - overview - installing - help-resources - including-the-files - messages - headers - sending - plugins - japanese diff --git a/vendor/swiftmailer/swiftmailer/doc/installing.rst b/vendor/swiftmailer/swiftmailer/doc/installing.rst deleted file mode 100644 index 31d8fe5..0000000 --- a/vendor/swiftmailer/swiftmailer/doc/installing.rst +++ /dev/null @@ -1,201 +0,0 @@ -Installing the Library -====================== - -Installing Swift Mailer is trivial. Usually it's just a case of uploading the -extracted source files to your web server. - -Installing from PEAR --------------------- - -If you want to install Swift Mailer globally on your machine, the easiest -installation method is using the PEAR channel. - -To install the Swift Mailer PEAR package: - -* Run the command ``pear channel-discover pear.swiftmailer.org``. - -* Then, run the command ``pear install swift/swift``. - -Installing from a Package -------------------------- - -Most users will download a package from the Swift Mailer website and install -Swift Mailer using this. - -If you downloaded Swift Mailer as a ``.tar.gz`` or -``.zip`` file installation is as simple as extracting the archive -and uploading it to your web server. - -Extracting the Library -~~~~~~~~~~~~~~~~~~~~~~ - -You extract the archive by using your favorite unarchiving tool such as -``tar`` or 7-Zip. - -You will need to have access to a program that can open uncompress the -archive. On Windows computers, 7-Zip will work. On Mac and Linux systems you -can use ``tar`` on the command line. - -To extract your downloaded package: - -* Use the "extract" facility of your archiving software. - -The source code will be placed into a directory with the same name as the -archive (e.g. Swift-4.0.0-b1). - -The following example shows the process on Mac OS X and Linux systems using -the ``tar`` command. - -.. code-block:: bash - - $ ls - Swift-4.0.0-dev.tar.gz - $ tar xvzf Swift-4.0.0-dev.tar.gz - Swift-4.0.0-dev/ - Swift-4.0.0-dev/lib/ - Swift-4.0.0-dev/lib/classes/ - Swift-4.0.0-dev/lib/classes/Swift/ - Swift-4.0.0-dev/lib/classes/Swift/ByteStream/ - Swift-4.0.0-dev/lib/classes/Swift/CharacterReader/ - Swift-4.0.0-dev/lib/classes/Swift/CharacterReaderFactory/ - Swift-4.0.0-dev/lib/classes/Swift/CharacterStream/ - Swift-4.0.0-dev/lib/classes/Swift/Encoder/ - - ... etc etc ... - - Swift-4.0.0-dev/tests/unit/Swift/Transport/LoadBalancedTransportTest.php - Swift-4.0.0-dev/tests/unit/Swift/Transport/SendmailTransportTest.php - Swift-4.0.0-dev/tests/unit/Swift/Transport/StreamBufferTest.php - $ cd Swift-4.0.0-dev - $ ls - CHANGES LICENSE.GPL LICENSE.LGPL README VERSION examples lib test-suite tests - $ - -Installing from Git -------------------- - -It's possible to download and install Swift Mailer directly from github.com if -you want to keep up-to-date with ease. - -Swift Mailer's source code is kept in a git repository at github.com so you -can get the source directly from the repository. - -.. note:: - - You do not need to have git installed to use Swift Mailer from github. If - you don't have git installed, go to `github`_ and click the "Download" - button. - -Cloning the Repository -~~~~~~~~~~~~~~~~~~~~~~ - -The repository can be cloned from git://github.com/swiftmailer/swiftmailer.git -using the ``git clone`` command. - -You will need to have ``git`` installed before you can use the -``git clone`` command. - -To clone the repository: - -* Open your favorite terminal environment (command line). - -* Move to the directory you want to clone to. - -* Run the command ``git clone git://github.com/swiftmailer/swiftmailer.git - swiftmailer``. - -The source code will be downloaded into a directory called "swiftmailer". - -The example shows the process on a UNIX-like system such as Linux, BSD or Mac -OS X. - -.. code-block:: bash - - $ cd source_code/ - $ git clone git://github.com/swiftmailer/swiftmailer.git swiftmailer - Initialized empty Git repository in /Users/chris/source_code/swiftmailer/.git/ - remote: Counting objects: 6815, done. - remote: Compressing objects: 100% (2761/2761), done. - remote: Total 6815 (delta 3641), reused 6326 (delta 3286) - Receiving objects: 100% (6815/6815), 4.35 MiB | 162 KiB/s, done. - Resolving deltas: 100% (3641/3641), done. - Checking out files: 100% (1847/1847), done. - $ cd swiftmailer/ - $ ls - CHANGES LICENSE.LGPL README.git VERSION docs lib test-suite util - LICENSE.GPL README TODO build.xml examples notes tests - $ - -Uploading to your Host ----------------------- - -You only need to upload the "lib/" directory to your web host for production -use. All other files and directories are support files not needed in -production. - -You will need FTP, ``rsync`` or similar software installed in order to upload -the "lib/" directory to your web host. - -To upload Swift Mailer: - -* Open your FTP program, or a command line if you prefer rsync/scp. - -* Upload the "lib/" directory to your hosting account. - -The files needed to use Swift Mailer should now be accessible to PHP on your -host. - -The following example shows show you can upload the files using -``rsync`` on Linux or OS X. - -.. note:: - - You do not need to place the files inside your web root. They only need to - be in a place where your PHP scripts can "include" them. - - .. code-block:: bash - - $ rsync -rvz lib d11wtq@swiftmailer.org:swiftmailer - building file list ... done - created directory swiftmailer - lib/ - lib/mime_types.php - lib/preferences.php - lib/swift_required.php - lib/classes/ - lib/classes/Swift/ - lib/classes/Swift/Attachment.php - lib/classes/Swift/CharacterReader.php - ... etc etc ... - lib/dependency_maps/ - lib/dependency_maps/cache_deps.php - lib/dependency_maps/mime_deps.php - lib/dependency_maps/transport_deps.php - - sent 151692 bytes received 2974 bytes 5836.45 bytes/sec - total size is 401405 speedup is 2.60 - $ - -.. _`github`: http://github.com/swiftmailer/swiftmailer - -Troubleshooting ---------------- - -Swift Mailer does not work when used with function overloading as implemented -by ``mbstring`` (``mbstring.func_overload`` set to ``2``). A workaround is to -temporarily change the internal encoding to ``ASCII`` when sending an email: - -.. code-block:: php - - if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) - { - $mbEncoding = mb_internal_encoding(); - mb_internal_encoding('ASCII'); - } - - // Create your message and send it with Swift Mailer - - if (isset($mbEncoding)) - { - mb_internal_encoding($mbEncoding); - } diff --git a/vendor/swiftmailer/swiftmailer/doc/introduction.rst b/vendor/swiftmailer/swiftmailer/doc/introduction.rst deleted file mode 100644 index 39ab034..0000000 --- a/vendor/swiftmailer/swiftmailer/doc/introduction.rst +++ /dev/null @@ -1,135 +0,0 @@ -Introduction -============ - -Swift Mailer is a component-based library for sending e-mails from PHP -applications. - -Organization of this Book -------------------------- - -This book has been written so that those who need information quickly are able -to find what they need, and those who wish to learn more advanced topics can -read deeper into each chapter. - -The book begins with an overview of Swift Mailer, discussing what's included -in the package and preparing you for the remainder of the book. - -It is possible to read this user guide just like any other book (from -beginning to end). Each chapter begins with a discussion of the contents it -contains, followed by a short code sample designed to give you a head start. -As you get further into a chapter you will learn more about Swift Mailer's -capabilities, but often you will be able to head directly to the topic you -wish to learn about. - -Throughout this book you will be presented with code samples, which most -people should find ample to implement Swift Mailer appropriately in their own -projects. We will also use diagrams where appropriate, and where we believe -readers may find it helpful we will discuss some related theory, including -reference to certain documents you are able to find online. - -Code Samples ------------- - -Code samples presented in this book will be displayed on a different colored -background in a monospaced font. Samples are not to be taken as copy & paste -code snippets. - -Code examples are used through the book to clarify what is written in text. -They will sometimes be usable as-is, but they should always be taken as -outline/pseudo code only. - -A code sample will look like this:: - - class AClass - { - ... - } - - //A Comment - $obj = new AClass($arg1, $arg2, ... ); - - /* A note about another way of doing something - $obj = AClass::newInstance($arg1, $arg2, ... ); - - */ - -The presence of 3 dots ``...`` in a code sample indicates that we have left -out a chunk of the code for brevity, they are not actually part of the code. - -We will often place multi-line comments ``/* ... */`` in the code so that we -can show alternative ways of achieving the same result. - -You should read the code examples given and try to understand them. They are -kept concise so that you are not overwhelmed with information. - -History of Swift Mailer ------------------------ - -Swift Mailer began back in 2005 as a one-class project for sending mail over -SMTP. It has since grown into the flexible component-based library that is in -development today. - -Chris Corbyn first posted Swift Mailer on a web forum asking for comments from -other developers. It was never intended as a fully supported open source -project, but members of the forum began to adopt it and make use of it. - -Very quickly feature requests were coming for the ability to add attachments -and use SMTP authentication, along with a number of other "obvious" missing -features. Considering the only alternative was PHPMailer it seemed like a good -time to bring some fresh tools to the table. Chris began working towards a -more component based, PHP5-like approach unlike the existing single-class, -legacy PHP4 approach taken by PHPMailer. - -Members of the forum offered a lot of advice and critique on the code as he -worked through this project and released versions 2 and 3 of the library in -2005 and 2006, which by then had been broken down into smaller classes -offering more flexibility and supporting plugins. To this day the Swift Mailer -team still receive a lot of feature requests from users both on the forum and -in by email. - -Until 2008 Chris was the sole developer of Swift Mailer, but entering 2009 he -gained the support of two experienced developers well-known to him: Paul -Annesley and Christopher Thompson. This has been an extremely welcome change. - -As of September 2009, Chris handed over the maintenance of Swift Mailer to -Fabien Potencier. - -Now 2009 and in its fourth major version Swift Mailer is more object-oriented -and flexible than ever, both from a usability standpoint and from a -development standpoint. - -By no means is Swift Mailer ready to call "finished". There are still many -features that can be added to the library along with the constant refactoring -that happens behind the scenes. - -It's a Library! ---------------- - -Swift Mailer is not an application - it's a library. - -To most experienced developers this is probably an obvious point to make, but -it's certainly worth mentioning. Many people often contact us having gotten -the completely wrong end of the stick in terms of what Swift Mailer is -actually for. - -It's not an application. It does not have a graphical user interface. It -cannot be opened in your web browser directly. - -It's a library (or a framework if you like). It provides a whole lot of -classes that do some very complicated things, so that you don't have to. You -"use" Swift Mailer within an application so that your application can have the -ability to send emails. - -The component-based structure of the library means that you are free to -implement it in a number of different ways and that you can pick and choose -what you want to use. - -An application on the other hand (such as a blog or a forum) is already "put -together" in a particular way, (usually) provides a graphical user interface -and most likely doesn't offer a great deal of integration with your own -application. - -Embrace the structure of the library and use the components it offers to your -advantage. Learning what the components do, rather than blindly copying and -pasting existing code will put you in a great position to build a powerful -application! diff --git a/vendor/swiftmailer/swiftmailer/doc/japanese.rst b/vendor/swiftmailer/swiftmailer/doc/japanese.rst deleted file mode 100644 index 34afa7b..0000000 --- a/vendor/swiftmailer/swiftmailer/doc/japanese.rst +++ /dev/null @@ -1,22 +0,0 @@ -Using Swift Mailer for Japanese Emails -====================================== - -To send emails in Japanese, you need to tweak the default configuration. - -After requiring the Swift Mailer autoloader (by including the -``swift_required.php`` file), call the ``Swift::init()`` method with the -following code:: - - require_once '/path/to/swift-mailer/lib/swift_required.php'; - - Swift::init(function () { - Swift_DependencyContainer::getInstance() - ->register('mime.qpheaderencoder') - ->asAliasOf('mime.base64headerencoder'); - - Swift_Preferences::getInstance()->setCharset('iso-2022-jp'); - }); - - /* rest of code goes here */ - -That's all! diff --git a/vendor/swiftmailer/swiftmailer/doc/messages.rst b/vendor/swiftmailer/swiftmailer/doc/messages.rst deleted file mode 100644 index b56698d..0000000 --- a/vendor/swiftmailer/swiftmailer/doc/messages.rst +++ /dev/null @@ -1,964 +0,0 @@ -Creating Messages -================= - -Creating messages in Swift Mailer is done by making use of the various MIME -entities provided with the library. Complex messages can be quickly created -with very little effort. - -Quick Reference for Creating a Message ---------------------------------------- - -You can think of creating a Message as being similar to the steps you perform -when you click the Compose button in your mail client. You give it a subject, -specify some recipients, add any attachments and write your message. - -To create a Message: - -* Call the ``newInstance()`` method of ``Swift_Message``. - -* Set your sender address (``From:``) with ``setFrom()`` or ``setSender()``. - -* Set a subject line with ``setSubject()``. - -* Set recipients with ``setTo()``, ``setCc()`` and/or ``setBcc()``. - -* Set a body with ``setBody()``. - -* Add attachments with ``attach()``. - -.. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the message - $message = Swift_Message::newInstance() - - // Give the message a subject - ->setSubject('Your subject') - - // Set the From address with an associative array - ->setFrom(array('john@doe.com' => 'John Doe')) - - // Set the To addresses with an associative array - ->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name')) - - // Give it a body - ->setBody('Here is the message itself') - - // And optionally an alternative body - ->addPart('Here is the message itself', 'text/html') - - // Optionally add any attachments - ->attach(Swift_Attachment::fromPath('my-document.pdf')) - ; - -Message Basics --------------- - -A message is a container for anything you want to send to somebody else. There -are several basic aspects of a message that you should know. - -An e-mail message is made up of several relatively simple entities that are -combined in different ways to achieve different results. All of these entities -have the same fundamental outline but serve a different purpose. The Message -itself can be defined as a MIME entity, an Attachment is a MIME entity, all -MIME parts are MIME entities -- and so on! - -The basic units of each MIME entity -- be it the Message itself, or an -Attachment -- are its Headers and its body: - -.. code-block:: text - - Header-Name: A header value - Other-Header: Another value - - The body content itself - -The Headers of a MIME entity, and its body must conform to some strict -standards defined by various RFC documents. Swift Mailer ensures that these -specifications are followed by using various types of object, including -Encoders and different Header types to generate the entity. - -The Structure of a Message -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Of all of the MIME entities, a message -- ``Swift_Message`` -is the largest and most complex. It has many properties that can be updated -and it can contain other MIME entities -- attachments for example -- -nested inside it. - -A Message has a lot of different Headers which are there to present -information about the message to the recipients' mail client. Most of these -headers will be familiar to the majority of users, but we'll list the basic -ones. Although it's possible to work directly with the Headers of a Message -(or other MIME entity), the standard Headers have accessor methods provided to -abstract away the complex details for you. For example, although the Date on a -message is written with a strict format, you only need to pass a UNIX -timestamp to ``setDate()``. - -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| Header | Description | Accessors | -+===============================+====================================================================================================================================+=============================================+ -| ``Message-ID`` | Identifies this message with a unique ID, usually containing the domain name and time generated | ``getId()`` / ``setId()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Return-Path`` | Specifies where bounces should go (Swift Mailer reads this for other uses) | ``getReturnPath()`` / ``setReturnPath()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``From`` | Specifies the address of the person who the message is from. This can be multiple addresses if multiple people wrote the message. | ``getFrom()`` / ``setFrom()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Sender`` | Specifies the address of the person who physically sent the message (higher precedence than ``From:``) | ``getSender()`` / ``setSender()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``To`` | Specifies the addresses of the intended recipients | ``getTo()`` / ``setTo()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Cc`` | Specifies the addresses of recipients who will be copied in on the message | ``getCc()`` / ``setCc()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Bcc`` | Specifies the addresses of recipients who the message will be blind-copied to. Other recipients will not be aware of these copies. | ``getBcc()`` / ``setBcc()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Reply-To`` | Specifies the address where replies are sent to | ``getReplyTo()`` / ``setReplyTo()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Subject`` | Specifies the subject line that is displayed in the recipients' mail client | ``getSubject()`` / ``setSubject()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Date`` | Specifies the date at which the message was sent | ``getDate()`` / ``setDate()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Content-Type`` | Specifies the format of the message (usually text/plain or text/html) | ``getContentType()`` / ``setContentType()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Content-Transfer-Encoding`` | Specifies the encoding scheme in the message | ``getEncoder()`` / ``setEncoder()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ - -Working with a Message Object -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Although there are a lot of available methods on a message object, you only -need to make use of a small subset of them. Usually you'll use -``setSubject()``, ``setTo()`` and -``setFrom()`` before setting the body of your message with -``setBody()``. - -Calling methods is simple. You just call them like functions, but using the -object operator "``->``" to do so. If you've created -a message object and called it ``$message`` then you'd set a -subject on it like so: - -.. code-block:: php - - require_once 'lib/swift_required.php'; - - $message = Swift_Message::newInstance(); - $message->setSubject('My subject'); - -All MIME entities (including a message) have a ``toString()`` -method that you can call if you want to take a look at what is going to be -sent. For example, if you ``echo -$message->toString();`` you would see something like this: - -.. code-block:: bash - - Message-ID: <1230173678.4952f5eeb1432@swift.generated> - Date: Thu, 25 Dec 2008 13:54:38 +1100 - Subject: Example subject - From: Chris Corbyn - To: Receiver Name - MIME-Version: 1.0 - Content-Type: text/plain; charset=utf-8 - Content-Transfer-Encoding: quoted-printable - - Here is the message - -We'll take a closer look at the methods you use to create your message in the -following sections. - -Adding Content to Your Message ------------------------------- - -Rich content can be added to messages in Swift Mailer with relative ease by -calling methods such as ``setSubject()``, ``setBody()``, ``addPart()`` and -``attach()``. - -Setting the Subject Line -~~~~~~~~~~~~~~~~~~~~~~~~ - -The subject line, displayed in the recipients' mail client can be set with the -``setSubject()`` method, or as a parameter to ``Swift_Message::newInstance()``. - -To set the subject of your Message: - -* Call the ``setSubject()`` method of the Message, or specify it at the time - you create the message. - - .. code-block:: php - - // Pass it as a parameter when you create the message - $message = Swift_Message::newInstance('My amazing subject'); - - // Or set it after like this - $message->setSubject('My amazing subject'); - -Setting the Body Content -~~~~~~~~~~~~~~~~~~~~~~~~ - -The body of the message -- seen when the user opens the message -- -is specified by calling the ``setBody()`` method. If an alternative body is to -be included ``addPart()`` can be used. - -The body of a message is the main part that is read by the user. Often people -want to send a message in HTML format (``text/html``), other -times people want to send in plain text (``text/plain``), or -sometimes people want to send both versions and allow the recipient to chose -how they view the message. - -As a rule of thumb, if you're going to send a HTML email, always include a -plain-text equivalent of the same content so that users who prefer to read -plain text can do so. - -To set the body of your Message: - -* Call the ``setBody()`` method of the Message, or specify it at the time you - create the message. - -* Add any alternative bodies with ``addPart()``. - -If the recipient's mail client offers preferences for displaying text vs. HTML -then the mail client will present that part to the user where available. In -other cases the mail client will display the "best" part it can - usually HTML -if you've included HTML. - -.. code-block:: php - - // Pass it as a parameter when you create the message - $message = Swift_Message::newInstance('Subject here', 'My amazing body'); - - // Or set it after like this - $message->setBody('My amazing body', 'text/html'); - - // Add alternative parts with addPart() - $message->addPart('My amazing body in plain text', 'text/plain'); - -Attaching Files ---------------- - -Attachments are downloadable parts of a message and can be added by calling -the ``attach()`` method on the message. You can add attachments that exist on -disk, or you can create attachments on-the-fly. - -Attachments are actually an interesting area of Swift Mailer and something -that could put a lot of power at your fingertips if you grasp the concept -behind the way a message is held together. - -Although we refer to files sent over e-mails as "attachments" -- because -they're attached to the message -- lots of other parts of the message are -actually "attached" even if we don't refer to these parts as attachments. - -File attachments are created by the ``Swift_Attachment`` class -and then attached to the message via the ``attach()`` method on -it. For all of the "every day" MIME types such as all image formats, word -documents, PDFs and spreadsheets you don't need to explicitly set the -content-type of the attachment, though it would do no harm to do so. For less -common formats you should set the content-type -- which we'll cover in a -moment. - -Attaching Existing Files -~~~~~~~~~~~~~~~~~~~~~~~~ - -Files that already exist, either on disk or at a URL can be attached to a -message with just one line of code, using ``Swift_Attachment::fromPath()``. - -You can attach files that exist locally, or if your PHP installation has -``allow_url_fopen`` turned on you can attach files from other -websites. - -To attach an existing file: - -* Create an attachment with ``Swift_Attachment::fromPath()``. - -* Add the attachment to the message with ``attach()``. - -The attachment will be presented to the recipient as a downloadable file with -the same filename as the one you attached. - -.. code-block:: php - - // Create the attachment - // * Note that you can technically leave the content-type parameter out - $attachment = Swift_Attachment::fromPath('/path/to/image.jpg', 'image/jpeg'); - - // Attach it to the message - $message->attach($attachment); - - - // The two statements above could be written in one line instead - $message->attach(Swift_Attachment::fromPath('/path/to/image.jpg')); - - - // You can attach files from a URL if allow_url_fopen is on in php.ini - $message->attach(Swift_Attachment::fromPath('http://site.tld/logo.png')); - -Setting the Filename -~~~~~~~~~~~~~~~~~~~~ - -Usually you don't need to explicitly set the filename of an attachment because -the name of the attached file will be used by default, but if you want to set -the filename you use the ``setFilename()`` method of the Attachment. - -To change the filename of an attachment: - -* Call its ``setFilename()`` method. - -The attachment will be attached in the normal way, but meta-data sent inside -the email will rename the file to something else. - -.. code-block:: php - - // Create the attachment and call its setFilename() method - $attachment = Swift_Attachment::fromPath('/path/to/image.jpg') - ->setFilename('cool.jpg'); - - - // Because there's a fluid interface, you can do this in one statement - $message->attach( - Swift_Attachment::fromPath('/path/to/image.jpg')->setFilename('cool.jpg') - ); - -Attaching Dynamic Content -~~~~~~~~~~~~~~~~~~~~~~~~~ - -Files that are generated at runtime, such as PDF documents or images created -via GD can be attached directly to a message without writing them out to disk. -Use the standard ``Swift_Attachment::newInstance()`` method. - -To attach dynamically created content: - -* Create your content as you normally would. - -* Create an attachment with ``Swift_Attachment::newInstance()``, specifying - the source data of your content along with a name and the content-type. - -* Add the attachment to the message with ``attach()``. - -The attachment will be presented to the recipient as a downloadable file -with the filename and content-type you specify. - -.. note:: - - If you would usually write the file to disk anyway you should just attach - it with ``Swift_Attachment::fromPath()`` since this will use less memory: - - .. code-block:: php - - // Create your file contents in the normal way, but don't write them to disk - $data = create_my_pdf_data(); - - // Create the attachment with your data - $attachment = Swift_Attachment::newInstance($data, 'my-file.pdf', 'application/pdf'); - - // Attach it to the message - $message->attach($attachment); - - - // You can alternatively use method chaining to build the attachment - $attachment = Swift_Attachment::newInstance() - ->setFilename('my-file.pdf') - ->setContentType('application/pdf') - ->setBody($data) - ; - -Changing the Disposition -~~~~~~~~~~~~~~~~~~~~~~~~ - -Attachments just appear as files that can be saved to the Desktop if desired. -You can make attachment appear inline where possible by using the -``setDisposition()`` method of an attachment. - -To make an attachment appear inline: - -* Call its ``setDisposition()`` method. - -The attachment will be displayed within the email viewing window if the mail -client knows how to display it. - -.. note:: - - If you try to create an inline attachment for a non-displayable file type - such as a ZIP file, the mail client should just present the attachment as - normal: - - .. code-block:: php - - // Create the attachment and call its setDisposition() method - $attachment = Swift_Attachment::fromPath('/path/to/image.jpg') - ->setDisposition('inline'); - - - // Because there's a fluid interface, you can do this in one statement - $message->attach( - Swift_Attachment::fromPath('/path/to/image.jpg')->setDisposition('inline') - ); - -Embedding Inline Media Files -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Often people want to include an image or other content inline with a HTML -message. It's easy to do this with HTML linking to remote resources, but this -approach is usually blocked by mail clients. Swift Mailer allows you to embed -your media directly into the message. - -Mail clients usually block downloads from remote resources because this -technique was often abused as a mean of tracking who opened an email. If -you're sending a HTML email and you want to include an image in the message -another approach you can take is to embed the image directly. - -Swift Mailer makes embedding files into messages extremely streamlined. You -embed a file by calling the ``embed()`` method of the message, -which returns a value you can use in a ``src`` or -``href`` attribute in your HTML. - -Just like with attachments, it's possible to embed dynamically generated -content without having an existing file available. - -The embedded files are sent in the email as a special type of attachment that -has a unique ID used to reference them within your HTML attributes. On mail -clients that do not support embedded files they may appear as attachments. - -Although this is commonly done for images, in theory it will work for any -displayable (or playable) media type. Support for other media types (such as -video) is dependent on the mail client however. - -Embedding Existing Files -........................ - -Files that already exist, either on disk or at a URL can be embedded in a -message with just one line of code, using ``Swift_EmbeddedFile::fromPath()``. - -You can embed files that exist locally, or if your PHP installation has -``allow_url_fopen`` turned on you can embed files from other websites. - -To embed an existing file: - -* Create a message object with ``Swift_Message::newInstance()``. - -* Set the body as HTML, and embed a file at the correct point in the message with ``embed()``. - -The file will be displayed with the message inline with the HTML wherever its ID -is used as a ``src`` attribute. - -.. note:: - - ``Swift_Image`` and ``Swift_EmbeddedFile`` are just aliases of one - another. ``Swift_Image`` exists for semantic purposes. - -.. note:: - - You can embed files in two stages if you prefer. Just capture the return - value of ``embed()`` in a variable and use that as the ``src`` attribute. - - .. code-block:: php - - // Create the message - $message = Swift_Message::newInstance('My subject'); - - // Set the body - $message->setBody( - '' . - ' ' . - ' ' . - ' Here is an image Image' . - ' Rest of message' . - ' ' . - '', - 'text/html' // Mark the content-type as HTML - ); - - // You can embed files from a URL if allow_url_fopen is on in php.ini - $message->setBody( - '' . - ' ' . - ' ' . - ' Here is an image Image' . - ' Rest of message' . - ' ' . - '', - 'text/html' - ); - - - // If placing the embed() code inline becomes cumbersome - // it's easy to do this in two steps - $cid = $message->embed(Swift_Image::fromPath('image.png')); - - $message->setBody( - '' . - ' ' . - ' ' . - ' Here is an image Image' . - ' Rest of message' . - ' ' . - '', - 'text/html' // Mark the content-type as HTML - ); - -Embedding Dynamic Content -......................... - -Images that are generated at runtime, such as images created via GD can be -embedded directly to a message without writing them out to disk. Use the -standard ``Swift_Image::newInstance()`` method. - -To embed dynamically created content: - -* Create a message object with ``Swift_Message::newInstance()``. - -* Set the body as HTML, and embed a file at the correct point in the message - with ``embed()``. You will need to specify a filename and a content-type. - -The file will be displayed with the message inline with the HTML wherever its ID -is used as a ``src`` attribute. - -.. note:: - - ``Swift_Image`` and ``Swift_EmbeddedFile`` are just aliases of one - another. ``Swift_Image`` exists for semantic purposes. - -.. note:: - - You can embed files in two stages if you prefer. Just capture the return - value of ``embed()`` in a variable and use that as the ``src`` attribute. - - .. code-block:: php - - // Create your file contents in the normal way, but don't write them to disk - $img_data = create_my_image_data(); - - //Create the message - $message = Swift_Message::newInstance('My subject'); - - //Set the body - $message->setBody( - '' . - ' ' . - ' ' . - ' Here is an image Image' . - ' Rest of message' . - ' ' . - '', - 'text/html' // Mark the content-type as HTML - ); - - - // If placing the embed() code inline becomes cumbersome - // it's easy to do this in two steps - $cid = $message->embed(Swift_Image::newInstance($img_data, 'image.jpg', 'image/jpeg')); - - $message->setBody( - '' . - ' ' . - ' ' . - ' Here is an image Image' . - ' Rest of message' . - ' ' . - '', - 'text/html' // Mark the content-type as HTML - ); - -Adding Recipients to Your Message ---------------------------------- - -Recipients are specified within the message itself via ``setTo()``, ``setCc()`` -and ``setBcc()``. Swift Mailer reads these recipients from the message when it -gets sent so that it knows where to send the message to. - -Message recipients are one of three types: - -* ``To:`` recipients -- the primary recipients (required) - -* ``Cc:`` recipients -- receive a copy of the message (optional) - -* ``Bcc:`` recipients -- hidden from other recipients (optional) - -Each type can contain one, or several addresses. It's possible to list only -the addresses of the recipients, or you can personalize the address by -providing the real name of the recipient. - -.. sidebar:: Syntax for Addresses - - If you only wish to refer to a single email address (for example your - ``From:`` address) then you can just use a string. - - .. code-block:: php - - $message->setFrom('some@address.tld'); - - If you want to include a name then you must use an associative array. - - .. code-block:: php - - $message->setFrom(array('some@address.tld' => 'The Name')); - - If you want to include multiple addresses then you must use an array. - - .. code-block:: php - - $message->setTo(array('some@address.tld', 'other@address.tld')); - - You can mix personalized (addresses with a name) and non-personalized - addresses in the same list by mixing the use of associative and - non-associative array syntax. - - .. code-block:: php - - $message->setTo(array( - 'recipient-with-name@example.org' => 'Recipient Name One', - 'no-name@example.org', // Note that this is not a key-value pair - 'named-recipient@example.org' => 'Recipient Name Two' - )); - -Setting ``To:`` Recipients -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -``To:`` recipients are required in a message and are set with the -``setTo()`` or ``addTo()`` methods of the message. - -To set ``To:`` recipients, create the message object using either -``new Swift_Message( ... )`` or ``Swift_Message::newInstance( ... )``, -then call the ``setTo()`` method with a complete array of addresses, or use the -``addTo()`` method to iteratively add recipients. - -The ``setTo()`` method accepts input in various formats as described earlier in -this chapter. The ``addTo()`` method takes either one or two parameters. The -first being the email address and the second optional parameter being the name -of the recipient. - -``To:`` recipients are visible in the message headers and will be -seen by the other recipients. - -.. note:: - - Multiple calls to ``setTo()`` will not add new recipients -- each - call overrides the previous calls. If you want to iteratively add - recipients, use the ``addTo()`` method. - - .. code-block:: php - - // Using setTo() to set all recipients in one go - $message->setTo(array( - 'person1@example.org', - 'person2@otherdomain.org' => 'Person 2 Name', - 'person3@example.org', - 'person4@example.org', - 'person5@example.org' => 'Person 5 Name' - )); - - // Using addTo() to add recipients iteratively - $message->addTo('person1@example.org'); - $message->addTo('person2@example.org', 'Person 2 Name'); - -Setting ``Cc:`` Recipients -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -``Cc:`` recipients are set with the ``setCc()`` or ``addCc()`` methods of the -message. - -To set ``Cc:`` recipients, create the message object using either -``new Swift_Message( ... )`` or ``Swift_Message::newInstance( ... )``, then call -the ``setCc()`` method with a complete array of addresses, or use the -``addCc()`` method to iteratively add recipients. - -The ``setCc()`` method accepts input in various formats as described earlier in -this chapter. The ``addCc()`` method takes either one or two parameters. The -first being the email address and the second optional parameter being the name -of the recipient. - -``Cc:`` recipients are visible in the message headers and will be -seen by the other recipients. - -.. note:: - - Multiple calls to ``setCc()`` will not add new recipients -- each - call overrides the previous calls. If you want to iteratively add Cc: - recipients, use the ``addCc()`` method. - - .. code-block:: php - - // Using setCc() to set all recipients in one go - $message->setCc(array( - 'person1@example.org', - 'person2@otherdomain.org' => 'Person 2 Name', - 'person3@example.org', - 'person4@example.org', - 'person5@example.org' => 'Person 5 Name' - )); - - // Using addCc() to add recipients iteratively - $message->addCc('person1@example.org'); - $message->addCc('person2@example.org', 'Person 2 Name'); - -Setting ``Bcc:`` Recipients -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -``Bcc:`` recipients receive a copy of the message without anybody else knowing -it, and are set with the ``setBcc()`` or ``addBcc()`` methods of the message. - -To set ``Bcc:`` recipients, create the message object using either ``new -Swift_Message( ... )`` or ``Swift_Message::newInstance( ... )``, then call the -``setBcc()`` method with a complete array of addresses, or use -the ``addBcc()`` method to iteratively add recipients. - -The ``setBcc()`` method accepts input in various formats as described earlier in -this chapter. The ``addBcc()`` method takes either one or two parameters. The -first being the email address and the second optional parameter being the name -of the recipient. - -Only the individual ``Bcc:`` recipient will see their address in the message -headers. Other recipients (including other ``Bcc:`` recipients) will not see the -address. - -.. note:: - - Multiple calls to ``setBcc()`` will not add new recipients -- each - call overrides the previous calls. If you want to iteratively add Bcc: - recipients, use the ``addBcc()`` method. - - .. code-block:: php - - // Using setBcc() to set all recipients in one go - $message->setBcc(array( - 'person1@example.org', - 'person2@otherdomain.org' => 'Person 2 Name', - 'person3@example.org', - 'person4@example.org', - 'person5@example.org' => 'Person 5 Name' - )); - - // Using addBcc() to add recipients iteratively - $message->addBcc('person1@example.org'); - $message->addBcc('person2@example.org', 'Person 2 Name'); - -Specifying Sender Details -------------------------- - -An email must include information about who sent it. Usually this is managed -by the ``From:`` address, however there are other options. - -The sender information is contained in three possible places: - -* ``From:`` -- the address(es) of who wrote the message (required) - -* ``Sender:`` -- the address of the single person who sent the message - (optional) - -* ``Return-Path:`` -- the address where bounces should go to (optional) - -You must always include a ``From:`` address by using ``setFrom()`` on the -message. Swift Mailer will use this as the default ``Return-Path:`` unless -otherwise specified. - -The ``Sender:`` address exists because the person who actually sent the email -may not be the person who wrote the email. It has a higher precedence than the -``From:`` address and will be used as the ``Return-Path:`` unless otherwise -specified. - -Setting the ``From:`` Address -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -A ``From:`` address is required and is set with the ``setFrom()`` method of the -message. ``From:`` addresses specify who actually wrote the email, and usually who sent it. - -What most people probably don't realise is that you can have more than one -``From:`` address if more than one person wrote the email -- for example if an -email was put together by a committee. - -To set the ``From:`` address(es): - -* Call the ``setFrom()`` method on the Message. - -The ``From:`` address(es) are visible in the message headers and -will be seen by the recipients. - -.. note:: - - If you set multiple ``From:`` addresses then you absolutely must set a - ``Sender:`` address to indicate who physically sent the message. - - .. code-block:: php - - // Set a single From: address - $message->setFrom('your@address.tld'); - - // Set a From: address including a name - $message->setFrom(array('your@address.tld' => 'Your Name')); - - // Set multiple From: addresses if multiple people wrote the email - $message->setFrom(array( - 'person1@example.org' => 'Sender One', - 'person2@example.org' => 'Sender Two' - )); - -Setting the ``Sender:`` Address -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -A ``Sender:`` address specifies who sent the message and is set with the -``setSender()`` method of the message. - -To set the ``Sender:`` address: - -* Call the ``setSender()`` method on the Message. - -The ``Sender:`` address is visible in the message headers and will be seen by -the recipients. - -This address will be used as the ``Return-Path:`` unless otherwise specified. - -.. note:: - - If you set multiple ``From:`` addresses then you absolutely must set a - ``Sender:`` address to indicate who physically sent the message. - -You must not set more than one sender address on a message because it's not -possible for more than one person to send a single message. - -.. code-block:: php - - $message->setSender('your@address.tld'); - -Setting the ``Return-Path:`` (Bounce) Address -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The ``Return-Path:`` address specifies where bounce notifications should -be sent and is set with the ``setReturnPath()`` method of the message. - -You can only have one ``Return-Path:`` and it must not include -a personal name. - -To set the ``Return-Path:`` address: - -* Call the ``setReturnPath()`` method on the Message. - -Bouce notifications will be sent to this address. - -.. code-block:: php - - $message->setReturnPath('bounces@address.tld'); - -Requesting a Read Receipt -------------------------- - -It is possible to request a read-receipt to be sent to an address when the -email is opened. To request a read receipt set the address with -``setReadReceiptTo()``. - -To request a read receipt: - -* Set the address you want the receipt to be sent to with the - ``setReadReceiptTo()`` method on the Message. - -When the email is opened, if the mail client supports it a notification will be sent to this address. - -.. note:: - - Read receipts won't work for the majority of recipients since many mail - clients auto-disable them. Those clients that will send a read receipt - will make the user aware that one has been requested. - - .. code-block:: php - - $message->setReadReceiptTo('your@address.tld'); - -Setting the Character Set -------------------------- - -The character set of the message (and it's MIME parts) is set with the -``setCharset()`` method. You can also change the global default of UTF-8 by -working with the ``Swift_Preferences`` class. - -Swift Mailer will default to the UTF-8 character set unless otherwise -overridden. UTF-8 will work in most instances since it includes all of the -standard US keyboard characters in addition to most international characters. - -It is absolutely vital however that you know what character set your message -(or it's MIME parts) are written in otherwise your message may be received -completely garbled. - -There are two places in Swift Mailer where you can change the character set: - -* In the ``Swift_Preferences`` class - -* On each individual message and/or MIME part - -To set the character set of your Message: - -* Change the global UTF-8 setting by calling - ``Swift_Preferences::setCharset()``; or - -* Call the ``setCharset()`` method on the message or the MIME part. - - .. code-block:: php - - // Approach 1: Change the global setting (suggested) - Swift_Preferences::getInstance()->setCharset('iso-8859-2'); - - // Approach 2: Call the setCharset() method of the message - $message = Swift_Message::newInstance() - ->setCharset('iso-8859-2'); - - // Apprach 3: Specify the charset when setting the body - $message->setBody('My body', 'text/html', 'iso-8859-2'); - - // Approach 4: Specify the charset for each part added - $message->addPart('My part', 'text/plain', 'iso-8859-2'); - -Setting the Line Length ------------------------ - -The length of lines in a message can be changed by using the ``setMaxLineLength()`` method on the message. It should be kept to less than -1000 characters. - -Swift Mailer defaults to using 78 characters per line in a message. This is -done for historical reasons and so that the message can be easily viewed in -plain-text terminals. - -To change the maximum length of lines in your Message: - -* Call the ``setMaxLineLength()`` method on the Message. - -Lines that are longer than the line length specified will be wrapped between -words. - -.. note:: - - You should never set a maximum length longer than 1000 characters - according to RFC 2822. Doing so could have unspecified side-effects such - as truncating parts of your message when it is transported between SMTP - servers. - - .. code-block:: php - - $message->setMaxLineLength(1000); - -Setting the Message Priority ----------------------------- - -You can change the priority of the message with ``setPriority()``. Setting the -priority will not change the way your email is sent -- it is purely an -indicative setting for the recipient. - -The priority of a message is an indication to the recipient what significance -it has. Swift Mailer allows you to set the priority by calling the ``setPriority`` method. This method takes an integer value between 1 and 5: - -* Highest -* High -* Normal -* Low -* Lowest - -To set the message priority: - -* Set the priority as an integer between 1 and 5 with the ``setPriority()`` - method on the Message. - -.. code-block:: php - - // Indicate "High" priority - $message->setPriority(2); diff --git a/vendor/swiftmailer/swiftmailer/doc/overview.rst b/vendor/swiftmailer/swiftmailer/doc/overview.rst deleted file mode 100644 index c912617..0000000 --- a/vendor/swiftmailer/swiftmailer/doc/overview.rst +++ /dev/null @@ -1,161 +0,0 @@ -Library Overview -================ - -Most features (and more) of your every day mail client software are provided -by Swift Mailer, using object-oriented PHP code as the interface. - -In this chapter we will take a short tour of the various components, which put -together form the Swift Mailer library as a whole. You will learn key -terminology used throughout the rest of this book and you will gain a little -understanding of the classes you will work with as you integrate Swift Mailer -into your application. - -This chapter is intended to prepare you for the information contained in the -subsequent chapters of this book. You may choose to skip this chapter if you -are fairly technically minded, though it is likely to save you some time in -the long run if you at least read between the lines here. - -System Requirements -------------------- - -The basic requirements to operate Swift Mailer are extremely minimal and -easily achieved. Historically, Swift Mailer has supported both PHP 4 and PHP 5 -by following a parallel development workflow. Now in it's fourth major -version, and Swift Mailer operates on servers running PHP 5.2 or higher. - -The library aims to work with as many PHP 5 projects as possible: - -* PHP 5.2 or higher, with the SPL extension (standard) - -* Limited network access to connect to remote SMTP servers - -* 8 MB or more memory limit (Swift Mailer uses around 2 MB) - -Component Breakdown -------------------- - -Swift Mailer is made up of many classes. Each of these classes can be grouped -into a general "component" group which describes the task it is designed to -perform. - -We'll take a brief look at the components which form Swift Mailer in this -section of the book. - -The Mailer -~~~~~~~~~~ - -The mailer class, ``Swift_Mailer`` is the central class in the library where -all of the other components meet one another. ``Swift_Mailer`` acts as a sort -of message dispatcher, communicating with the underlying Transport to deliver -your Message to all intended recipients. - -If you were to dig around in the source code for Swift Mailer you'd notice -that ``Swift_Mailer`` itself is pretty bare. It delegates to other objects for -most tasks and in theory, if you knew the internals of Swift Mailer well you -could by-pass this class entirely. We wouldn't advise doing such a thing -however -- there are reasons this class exists: - -* for consistency, regardless of the Transport used - -* to provide abstraction from the internals in the event internal API changes - are made - -* to provide convenience wrappers around aspects of the internal API - -An instance of ``Swift_Mailer`` is created by the developer before sending any -Messages. - -Transports -~~~~~~~~~~ - -Transports are the classes in Swift Mailer that are responsible for -communicating with a service in order to deliver a Message. There are several -types of Transport in Swift Mailer, all of which implement the Swift_Transport -interface and offer underlying start(), stop() and send() methods. - -Typically you will not need to know how a Transport works under-the-surface, -you will only need to know how to create an instance of one, and which one to -use for your environment. - -+---------------------------------+---------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ -| Class | Features | Pros/cons | -+=================================+=============================================================================================+===============================================================================================================================================+ -| ``Swift_SmtpTransport`` | Sends messages over SMTP; Supports Authentication; Supports Encryption | Very portable; Pleasingly predictable results; Provides good feedback | -+---------------------------------+---------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ -| ``Swift_SendmailTransport`` | Communicates with a locally installed ``sendmail`` executable (Linux/UNIX) | Quick time-to-run; Provides less-accurate feedback than SMTP; Requires ``sendmail`` installation | -+---------------------------------+---------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ -| ``Swift_MailTransport`` | Uses PHP's built-in ``mail()`` function | Very portable; Potentially unpredictable results; Provides extremely weak feedback | -+---------------------------------+---------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ -| ``Swift_LoadBalancedTransport`` | Cycles through a collection of the other Transports to manage load-reduction | Provides graceful fallback if one Transport fails (e.g. an SMTP server is down); Keeps the load on remote services down by spreading the work | -+---------------------------------+---------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ -| ``Swift_FailoverTransport`` | Works in conjunction with a collection of the other Transports to provide high-availability | Provides graceful fallback if one Transport fails (e.g. an SMTP server is down) | -+---------------------------------+---------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ - -MIME Entities -~~~~~~~~~~~~~ - -Everything that forms part of a Message is called a MIME Entity. All MIME -entities in Swift Mailer share a common set of features. There are various -types of MIME entity that serve different purposes such as Attachments and -MIME parts. - -An e-mail message is made up of several relatively simple entities that are -combined in different ways to achieve different results. All of these entities -have the same fundamental outline but serve a different purpose. The Message -itself can be defined as a MIME entity, an Attachment is a MIME entity, all -MIME parts are MIME entities -- and so on! - -The basic units of each MIME entity -- be it the Message itself, or an -Attachment -- are its Headers and its body: - -.. code-block:: text - - Other-Header: Another value - - The body content itself - -The Headers of a MIME entity, and its body must conform to some strict -standards defined by various RFC documents. Swift Mailer ensures that these -specifications are followed by using various types of object, including -Encoders and different Header types to generate the entity. - -Each MIME component implements the base ``Swift_Mime_MimeEntity`` interface, -which offers methods for retrieving Headers, adding new Headers, changing the -Encoder, updating the body and so on! - -All MIME entities have one Header in common -- the Content-Type Header, -updated with the entity's ``setContentType()`` method. - -Encoders -~~~~~~~~ - -Encoders are used to transform the content of Messages generated in Swift -Mailer into a format that is safe to send across the internet and that -conforms to RFC specifications. - -Generally speaking you will not need to interact with the Encoders in Swift -Mailer -- the correct settings will be handled by the library itself. -However they are probably worth a brief mention in the event that you do want -to play with them. - -Both the Headers and the body of all MIME entities (including the Message -itself) use Encoders to ensure the data they contain can be sent over the -internet without becoming corrupted or misinterpreted. - -There are two types of Encoder: Base64 and Quoted-Printable. - -Plugins -~~~~~~~ - -Plugins exist to extend, or modify the behaviour of Swift Mailer. They respond -to Events that are fired within the Transports during sending. - -There are a number of Plugins provided as part of the base Swift Mailer -package and they all follow a common interface to respond to Events fired -within the library. Interfaces are provided to "listen" to each type of Event -fired and to act as desired when a listened-to Event occurs. - -Although several plugins are provided with Swift Mailer out-of-the-box, the -Events system has been specifically designed to make it easy for experienced -object-oriented developers to write their own plugins in order to achieve -goals that may not be possible with the base library. diff --git a/vendor/swiftmailer/swiftmailer/doc/plugins.rst b/vendor/swiftmailer/swiftmailer/doc/plugins.rst deleted file mode 100644 index e423476..0000000 --- a/vendor/swiftmailer/swiftmailer/doc/plugins.rst +++ /dev/null @@ -1,385 +0,0 @@ -Plugins -======= - -Plugins are provided with Swift Mailer and can be used to extend the behavior -of the library in ways that simple class inheritance would be more complex. - -AntiFlood Plugin ----------------- - -Many SMTP servers have limits on the number of messages that may be sent -during any single SMTP connection. The AntiFlood plugin provides a way to stay -within this limit while still managing a large number of emails. - -A typical limit for a single connection is 100 emails. If the server you -connect to imposes such a limit, it expects you to disconnect after that -number of emails has been sent. You could manage this manually within a loop, -but the AntiFlood plugin provides the necessary wrapper code so that you don't -need to worry about this logic. - -Regardless of limits imposed by the server, it's usually a good idea to be -conservative with the resources of the SMTP server. Sending will become -sluggish if the server is being over-used so using the AntiFlood plugin will -not be a bad idea even if no limits exist. - -The AntiFlood plugin's logic is basically to disconnect and the immediately -re-connect with the SMTP server every X number of emails sent, where X is a -number you specify to the plugin. - -You can also specify a time period in seconds that Swift Mailer should pause -for between the disconnect/re-connect process. It's a good idea to pause for a -short time (say 30 seconds every 100 emails) simply to give the SMTP server a -chance to process its queue and recover some resources. - -Using the AntiFlood Plugin -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The AntiFlood Plugin -- like all plugins -- is added with the Mailer class' -``registerPlugin()`` method. It takes two constructor parameters: the number of -emails to pause after, and optionally the number of seconds to pause for. - -To use the AntiFlood plugin: - -* Create an instance of the Mailer using any Transport you choose. - -* Create an instance of the ``Swift_Plugins_AntiFloodPlugin`` class, passing - in one or two constructor parameters. - -* Register the plugin using the Mailer's ``registerPlugin()`` method. - -* Continue using Swift Mailer to send messages as normal. - -When Swift Mailer sends messages it will count the number of messages that -have been sent since the last re-connect. Once the number hits your specified -threshold it will disconnect and re-connect, optionally pausing for a -specified amount of time. - -.. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the Mailer using any Transport - $mailer = Swift_Mailer::newInstance( - Swift_SmtpTransport::newInstance('smtp.example.org', 25) - ); - - // Use AntiFlood to re-connect after 100 emails - $mailer->registerPlugin(new Swift_Plugins_AntiFloodPlugin(100)); - - // And specify a time in seconds to pause for (30 secs) - $mailer->registerPlugin(new Swift_Plugins_AntiFloodPlugin(100, 30)); - - // Continue sending as normal - for ($lotsOfRecipients as $recipient) { - ... - - $mailer->send( ... ); - } - -Throttler Plugin ----------------- - -If your SMTP server has restrictions in place to limit the rate at which you -send emails, then your code will need to be aware of this rate-limiting. The -Throttler plugin makes Swift Mailer run at a rate-limited speed. - -Many shared hosts don't open their SMTP servers as a free-for-all. Usually -they have policies in place (probably to discourage spammers) that only allow -you to send a fixed number of emails per-hour/day. - -The Throttler plugin supports two modes of rate-limiting and with each, you -will need to do that math to figure out the values you want. The plugin can -limit based on the number of emails per minute, or the number of -bytes-transferred per-minute. - -Using the Throttler Plugin -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The Throttler Plugin -- like all plugins -- is added with the Mailer class' -``registerPlugin()`` method. It has two required constructor parameters that -tell it how to do its rate-limiting. - -To use the Throttler plugin: - -* Create an instance of the Mailer using any Transport you choose. - -* Create an instance of the ``Swift_Plugins_ThrottlerPlugin`` class, passing - the number of emails, or bytes you wish to limit by, along with the mode - you're using. - -* Register the plugin using the Mailer's ``registerPlugin()`` method. - -* Continue using Swift Mailer to send messages as normal. - -When Swift Mailer sends messages it will keep track of the rate at which sending -messages is occurring. If it realises that sending is happening too fast, it -will cause your program to ``sleep()`` for enough time to average out the rate. - -.. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the Mailer using any Transport - $mailer = Swift_Mailer::newInstance( - Swift_SmtpTransport::newInstance('smtp.example.org', 25) - ); - - // Rate limit to 100 emails per-minute - $mailer->registerPlugin(new Swift_Plugins_ThrottlerPlugin( - 100, Swift_Plugins_ThrottlerPlugin::MESSAGES_PER_MINUTE - )); - - // Rate limit to 10MB per-minute - $mailer->registerPlugin(new Swift_Plugins_ThrottlerPlugin( - 1024 * 1024 * 10, Swift_Plugins_ThrottlerPlugin::BYTES_PER_MINUTE - )); - - // Continue sending as normal - for ($lotsOfRecipients as $recipient) { - ... - - $mailer->send( ... ); - } - -Logger Plugin -------------- - -The Logger plugins helps with debugging during the process of sending. It can -help to identify why an SMTP server is rejecting addresses, or any other -hard-to-find problems that may arise. - -The Logger plugin comes in two parts. There's the plugin itself, along with -one of a number of possible Loggers that you may choose to use. For example, -the logger may output messages directly in realtime, or it may capture -messages in an array. - -One other notable feature is the way in which the Logger plugin changes -Exception messages. If Exceptions are being thrown but the error message does -not provide conclusive information as to the source of the problem (such as an -ambiguous SMTP error) the Logger plugin includes the entire SMTP transcript in -the error message so that debugging becomes a simpler task. - -There are a few available Loggers included with Swift Mailer, but writing your -own implementation is incredibly simple and is achieved by creating a short -class that implements the ``Swift_Plugins_Logger`` interface. - -* ``Swift_Plugins_Loggers_ArrayLogger``: Keeps a collection of log messages - inside an array. The array content can be cleared or dumped out to the - screen. - -* ``Swift_Plugins_Loggers_EchoLogger``: Prints output to the screen in - realtime. Handy for very rudimentary debug output. - -Using the Logger Plugin -~~~~~~~~~~~~~~~~~~~~~~~ - -The Logger Plugin -- like all plugins -- is added with the Mailer class' -``registerPlugin()`` method. It accepts an instance of ``Swift_Plugins_Logger`` -in its constructor. - -To use the Logger plugin: - -* Create an instance of the Mailer using any Transport you choose. - -* Create an instance of the a Logger implementation of - ``Swift_Plugins_Logger``. - -* Create an instance of the ``Swift_Plugins_LoggerPlugin`` class, passing the - created Logger instance to its constructor. - -* Register the plugin using the Mailer's ``registerPlugin()`` method. - -* Continue using Swift Mailer to send messages as normal. - -* Dump the contents of the log with the logger's ``dump()`` method. - -When Swift Mailer sends messages it will keep a log of all the interactions -with the underlying Transport being used. Depending upon the Logger that has -been used the behaviour will differ, but all implementations offer a way to -get the contents of the log. - -.. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the Mailer using any Transport - $mailer = Swift_Mailer::newInstance( - Swift_SmtpTransport::newInstance('smtp.example.org', 25) - ); - - // To use the ArrayLogger - $logger = new Swift_Plugins_Loggers_ArrayLogger(); - $mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($logger)); - - // Or to use the Echo Logger - $logger = new Swift_Plugins_Loggers_EchoLogger(); - $mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($logger)); - - // Continue sending as normal - for ($lotsOfRecipients as $recipient) { - ... - - $mailer->send( ... ); - } - - // Dump the log contents - // NOTE: The EchoLogger dumps in realtime so dump() does nothing for it - echo $logger->dump(); - -Decorator Plugin ----------------- - -Often there's a need to send the same message to multiple recipients, but with -tiny variations such as the recipient's name being used inside the message -body. The Decorator plugin aims to provide a solution for allowing these small -differences. - -The decorator plugin works by intercepting the sending process of Swift -Mailer, reading the email address in the To: field and then looking up a set -of replacements for a template. - -While the use of this plugin is simple, it is probably the most commonly -misunderstood plugin due to the way in which it works. The typical mistake -users make is to try registering the plugin multiple times (once for each -recipient) -- inside a loop for example. This is incorrect. - -The Decorator plugin should be registered just once, but containing the list -of all recipients prior to sending. It will use this list of recipients to -find the required replacements during sending. - -Using the Decorator Plugin -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To use the Decorator plugin, simply create an associative array of replacements -based on email addresses and then use the mailer's ``registerPlugin()`` method -to add the plugin. - -First create an associative array of replacements based on the email addresses -you'll be sending the message to. - -.. note:: - - The replacements array becomes a 2-dimensional array whose keys are the - email addresses and whose values are an associative array of replacements - for that email address. The curly braces used in this example can be any - type of syntax you choose, provided they match the placeholders in your - email template. - - .. code-block:: php - - $replacements = array(); - foreach ($users as $user) { - $replacements[$user['email']] = array( - '{username}'=>$user['username'], - '{password}'=>$user['password'] - ); - } - -Now create an instance of the Decorator plugin using this array of replacements -and then register it with the Mailer. Do this only once! - -.. code-block:: php - - $decorator = new Swift_Plugins_DecoratorPlugin($replacements); - - $mailer->registerPlugin($decorator); - -When you create your message, replace elements in the body (and/or the subject -line) with your placeholders. - -.. code-block:: php - - $message = Swift_Message::newInstance() - ->setSubject('Important notice for {username}') - ->setBody( - "Hello {username}, we have reset your password to {password}\n" . - "Please log in and change it at your earliest convenience." - ) - ; - - foreach ($users as $user) { - $message->addTo($user['email']); - } - -When you send this message to each of your recipients listed in your -``$replacements`` array they will receive a message customized for just -themselves. For example, the message used above when received may appear like -this to one user: - -.. code-block:: text - - Subject: Important notice for smilingsunshine2009 - - Hello smilingsunshine2009, we have reset your password to rainyDays - Please log in and change it at your earliest convenience. - -While another use may receive the message as: - -.. code-block:: text - - Subject: Important notice for billy-bo-bob - - Hello billy-bo-bob, we have reset your password to dancingOctopus - Please log in and change it at your earliest convenience. - -While the decorator plugin provides a means to solve this problem, there are -various ways you could tackle this problem without the need for a plugin. -We're trying to come up with a better way ourselves and while we have several -(obvious) ideas we don't quite have the perfect solution to go ahead and -implement it. Watch this space. - -Providing Your Own Replacements Lookup for the Decorator -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Filling an array with replacements may not be the best solution for providing -replacement information to the decorator. If you have a more elegant algorithm -that performs replacement lookups on-the-fly you may provide your own -implementation. - -Providing your own replacements lookup implementation for the Decorator is -simply a matter of passing an instance of ``Swift_Plugins_Decorator_Replacements`` to the decorator plugin's constructor, -rather than passing in an array. - -The Replacements interface is very simple to implement since it has just one -method: ``getReplacementsFor($address)``. - -Imagine you want to look up replacements from a database on-the-fly, you might -provide an implementation that does this. You need to create a small class. - -.. code-block:: php - - class DbReplacements implements Swift_Plugins_Decorator_Replacements { - public function getReplacementsFor($address) { - $sql = sprintf( - "SELECT * FROM user WHERE email = '%s'", - mysql_real_escape_string($address) - ); - - $result = mysql_query($sql); - - if ($row = mysql_fetch_assoc($result)) { - return array( - '{username}'=>$row['username'], - '{password}'=>$row['password'] - ); - } - } - } - -Now all you need to do is pass an instance of your class into the Decorator -plugin's constructor instead of passing an array. - -.. code-block:: php - - $decorator = new Swift_Plugins_DecoratorPlugin(new DbReplacements()); - - $mailer->registerPlugin($decorator); - -For each message sent, the plugin will call your class' ``getReplacementsFor()`` -method to find the array of replacements it needs. - -.. note:: - - If your lookup algorithm is case sensitive, you should transform the - ``$address`` argument as appropriate -- for example by passing it - through ``strtolower()``. diff --git a/vendor/swiftmailer/swiftmailer/doc/sending.rst b/vendor/swiftmailer/swiftmailer/doc/sending.rst deleted file mode 100644 index 29bf05e..0000000 --- a/vendor/swiftmailer/swiftmailer/doc/sending.rst +++ /dev/null @@ -1,592 +0,0 @@ -Sending Messages -================ - -Quick Reference for Sending a Message -------------------------------------- - -Sending a message is very straightforward. You create a Transport, use it to -create the Mailer, then you use the Mailer to send the message. - -To send a Message: - -* Create a Transport from one of the provided Transports -- - ``Swift_SmtpTransport``, ``Swift_SendmailTransport``, ``Swift_MailTransport`` - or one of the aggregate Transports. - -* Create an instance of the ``Swift_Mailer`` class, using the Transport as - it's constructor parameter. - -* Create a Message. - -* Send the message via the ``send()`` method on the Mailer object. - -.. caution:: - - The ``Swift_SmtpTransport`` and ``Swift_SendmailTransport`` transports use - ``proc_*`` PHP functions, which might not be available on your PHP - installation. You can easily check if that the case by running the - following PHP script: ``setUsername('your username') - ->setPassword('your password') - ; - - /* - You could alternatively use a different transport such as Sendmail or Mail: - - // Sendmail - $transport = Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -bs'); - - // Mail - $transport = Swift_MailTransport::newInstance(); - */ - - // Create the Mailer using your created Transport - $mailer = Swift_Mailer::newInstance($transport); - - // Create a message - $message = Swift_Message::newInstance('Wonderful Subject') - ->setFrom(array('john@doe.com' => 'John Doe')) - ->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name')) - ->setBody('Here is the message itself') - ; - - // Send the message - $result = $mailer->send($message); - -Transport Types -~~~~~~~~~~~~~~~ - -A Transport is the component which actually does the sending. You need to -provide a Transport object to the Mailer class and there are several possible -options. - -Typically you will not need to know how a Transport works under-the-surface, -you will only need to know how to create an instance of one, and which one to -use for your environment. - -The SMTP Transport -.................. - -The SMTP Transport sends messages over the (standardized) Simple Message -Transfer Protocol. It can deal with encryption and authentication. - -The SMTP Transport, ``Swift_SmtpTransport`` is without doubt the most commonly -used Transport because it will work on 99% of web servers (I just made that -number up, but you get the idea). All the server needs is the ability to -connect to a remote (or even local) SMTP server on the correct port number -(usually 25). - -SMTP servers often require users to authenticate with a username and password -before any mail can be sent to other domains. This is easily achieved using -Swift Mailer with the SMTP Transport. - -SMTP is a protocol -- in other words it's a "way" of communicating a job -to be done (i.e. sending a message). The SMTP protocol is the fundamental -basis on which messages are delivered all over the internet 7 days a week, 365 -days a year. For this reason it's the most "direct" method of sending messages -you can use and it's the one that will give you the most power and feedback -(such as delivery failures) when using Swift Mailer. - -Because SMTP is generally run as a remote service (i.e. you connect to it over -the network/internet) it's extremely portable from server-to-server. You can -easily store the SMTP server address and port number in a configuration file -within your application and adjust the settings accordingly if the code is -moved or if the SMTP server is changed. - -Some SMTP servers -- Google for example -- use encryption for security reasons. -Swift Mailer supports using both SSL and TLS encryption settings. - -Using the SMTP Transport -^^^^^^^^^^^^^^^^^^^^^^^^ - -The SMTP Transport is easy to use. Most configuration options can be set with -the constructor. - -To use the SMTP Transport you need to know which SMTP server your code needs -to connect to. Ask your web host if you're not sure. Lots of people ask me who -to connect to -- I really can't answer that since it's a setting that's -extremely specific to your hosting environment. - -To use the SMTP Transport: - -* Call ``Swift_SmtpTransport::newInstance()`` with the SMTP server name and - optionally with a port number (defaults to 25). - -* Use the returned object to create the Mailer. - -A connection to the SMTP server will be established upon the first call to -``send()``. - -.. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the Transport - $transport = Swift_SmtpTransport::newInstance('smtp.example.org', 25); - - // Create the Mailer using your created Transport - $mailer = Swift_Mailer::newInstance($transport); - - /* - It's also possible to use multiple method calls - - $transport = Swift_SmtpTransport::newInstance() - ->setHost('smtp.example.org') - ->setPort(25) - ; - */ - -Encrypted SMTP -^^^^^^^^^^^^^^ - -You can use SSL or TLS encryption with the SMTP Transport by specifying it as -a parameter or with a method call. - -To use encryption with the SMTP Transport: - -* Pass the encryption setting as a third parameter to - ``Swift_SmtpTransport::newInstance()``; or - -* Call the ``setEncryption()`` method on the Transport. - -A connection to the SMTP server will be established upon the first call to -``send()``. The connection will be initiated with the correct encryption -settings. - -.. note:: - - For SSL or TLS encryption to work your PHP installation must have - appropriate OpenSSL transports wrappers. You can check if "tls" and/or - "ssl" are present in your PHP installation by using the PHP function - ``stream_get_transports()`` - - .. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the Transport - $transport = Swift_SmtpTransport::newInstance('smtp.example.org', 587, 'ssl'); - - // Create the Mailer using your created Transport - $mailer = Swift_Mailer::newInstance($transport); - - /* - It's also possible to use multiple method calls - - $transport = Swift_SmtpTransport::newInstance() - ->setHost('smtp.example.org') - ->setPort(587) - ->setEncryption('ssl') - ; - */ - -SMTP with a Username and Password -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Some servers require authentication. You can provide a username and password -with ``setUsername()`` and ``setPassword()`` methods. - -To use a username and password with the SMTP Transport: - -* Create the Transport with ``Swift_SmtpTransport::newInstance()``. - -* Call the ``setUsername()`` and ``setPassword()`` methods on the Transport. - -Your username and password will be used to authenticate upon first connect -when ``send()`` are first used on the Mailer. - -If authentication fails, an Exception of type ``Swift_TransportException`` will -be thrown. - -.. note:: - - If you need to know early whether or not authentication has failed and an - Exception is going to be thrown, call the ``start()`` method on the - created Transport. - - .. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the Transport the call setUsername() and setPassword() - $transport = Swift_SmtpTransport::newInstance('smtp.example.org', 25) - ->setUsername('username') - ->setPassword('password') - ; - - // Create the Mailer using your created Transport - $mailer = Swift_Mailer::newInstance($transport); - -The Sendmail Transport -...................... - -The Sendmail Transport sends messages by communicating with a locally -installed MTA -- such as ``sendmail``. - -The Sendmail Transport, ``Swift_SendmailTransport`` does not directly connect to -any remote services. It is designed for Linux servers that have ``sendmail`` -installed. The Transport starts a local ``sendmail`` process and sends messages -to it. Usually the ``sendmail`` process will respond quickly as it spools your -messages to disk before sending them. - -The Transport is named the Sendmail Transport for historical reasons -(``sendmail`` was the "standard" UNIX tool for sending e-mail for years). It -will send messages using other transfer agents such as Exim or Postfix despite -its name, provided they have the relevant sendmail wrappers so that they can be -started with the correct command-line flags. - -It's a common misconception that because the Sendmail Transport returns a -result very quickly it must therefore deliver messages to recipients quickly --- this is not true. It's not slow by any means, but it's certainly not -faster than SMTP when it comes to getting messages to the intended recipients. -This is because sendmail itself sends the messages over SMTP once they have -been quickly spooled to disk. - -The Sendmail Transport has the potential to be just as smart of the SMTP -Transport when it comes to notifying Swift Mailer about which recipients were -rejected, but in reality the majority of locally installed ``sendmail`` -instances are not configured well enough to provide any useful feedback. As such -Swift Mailer may report successful deliveries where they did in fact fail before -they even left your server. - -You can run the Sendmail Transport in two different modes specified by command -line flags: - -* "``-bs``" runs in SMTP mode so theoretically it will act like the SMTP - Transport - -* "``-t``" runs in piped mode with no feedback, but theoretically faster, - though not advised - -You can think of the Sendmail Transport as a sort of asynchronous SMTP Transport --- though if you have problems with delivery failures you should try using the -SMTP Transport instead. Swift Mailer isn't doing the work here, it's simply -passing the work to somebody else (i.e. ``sendmail``). - -Using the Sendmail Transport -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -To use the Sendmail Transport you simply need to call -``Swift_SendmailTransport::newInstance()`` with the command as a parameter. - -To use the Sendmail Transport you need to know where ``sendmail`` or another MTA -exists on the server. Swift Mailer uses a default value of -``/usr/sbin/sendmail``, which should work on most systems. - -You specify the entire command as a parameter (i.e. including the command line -flags). Swift Mailer supports operational modes of "``-bs``" (default) and -"``-t``". - -.. note:: - - If you run sendmail in "``-t``" mode you will get no feedback as to whether - or not sending has succeeded. Use "``-bs``" unless you have a reason not to. - -To use the Sendmail Transport: - -* Call ``Swift_SendmailTransport::newInstance()`` with the command, including - the correct command line flags. The default is to use ``/usr/sbin/sendmail - -bs`` if this is not specified. - -* Use the returned object to create the Mailer. - -A sendmail process will be started upon the first call to ``send()``. If the -process cannot be started successfully an Exception of type -``Swift_TransportException`` will be thrown. - -.. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the Transport - $transport = Swift_SendmailTransport::newInstance('/usr/sbin/exim -bs'); - - // Create the Mailer using your created Transport - $mailer = Swift_Mailer::newInstance($transport); - -The Mail Transport -.................. - -The Mail Transport sends messages by delegating to PHP's internal -``mail()`` function. - -In my experience -- and others' -- the ``mail()`` function is not particularly -predictable, or helpful. - -Quite notably, the ``mail()`` function behaves entirely differently between -Linux and Windows servers. On linux it uses ``sendmail``, but on Windows it uses -SMTP. - -In order for the ``mail()`` function to even work at all ``php.ini`` needs to be -configured correctly, specifying the location of sendmail or of an SMTP server. - -The problem with ``mail()`` is that it "tries" to simplify things to the point -that it actually makes things more complex due to poor interface design. The -developers of Swift Mailer have gone to a lot of effort to make the Mail -Transport work with a reasonable degree of consistency. - -Serious drawbacks when using this Transport are: - -* Unpredictable message headers - -* Lack of feedback regarding delivery failures - -* Lack of support for several plugins that require real-time delivery feedback - -It's a last resort, and we say that with a passion! - -Using the Mail Transport -^^^^^^^^^^^^^^^^^^^^^^^^ - -To use the Mail Transport you simply need to call -``Swift_MailTransport::newInstance()``. It's unlikely you'll need to configure -the Transport. - -To use the Mail Transport: - -* Call ``Swift_MailTransport::newInstance()``. - -* Use the returned object to create the Mailer. - -Messages will be sent using the ``mail()`` function. - -.. note:: - - The ``mail()`` function can take a ``$additional_parameters`` parameter. - Swift Mailer sets this to "``-f%s``" by default, where the "%s" is - substituted with the address of the sender (via a ``sprintf()``) at send - time. You may override this default by passing an argument to - ``newInstance()``. - - .. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the Transport - $transport = Swift_MailTransport::newInstance(); - - // Create the Mailer using your created Transport - $mailer = Swift_Mailer::newInstance($transport); - -Available Methods for Sending Messages -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The Mailer class offers two methods for sending Messages -- ``send()``. -Each behaves in a slightly different way. - -When a message is sent in Swift Mailer, the Mailer class communicates with -whichever Transport class you have chosen to use. - -Each recipient in the message should either be accepted or rejected by the -Transport. For example, if the domain name on the email address is not -reachable the SMTP Transport may reject the address because it cannot process -it. Whichever method you use -- ``send()`` -- Swift Mailer will return -an integer indicating the number of accepted recipients. - -.. note:: - - It's possible to find out which recipients were rejected -- we'll cover that - later in this chapter. - -Using the ``send()`` Method -........................... - -The ``send()`` method of the ``Swift_Mailer`` class sends a message using -exactly the same logic as your Desktop mail client would use. Just pass it a -Message and get a result. - -To send a Message with ``send()``: - -* Create a Transport from one of the provided Transports -- - ``Swift_SmtpTransport``, ``Swift_SendmailTransport``, - ``Swift_MailTransport`` or one of the aggregate Transports. - -* Create an instance of the ``Swift_Mailer`` class, using the Transport as - it's constructor parameter. - -* Create a Message. - -* Send the message via the ``send()`` method on the Mailer object. - -The message will be sent just like it would be sent if you used your mail -client. An integer is returned which includes the number of successful -recipients. If none of the recipients could be sent to then zero will be -returned, which equates to a boolean ``false``. If you set two -``To:`` recipients and three ``Bcc:`` recipients in the message and all of the -recipients are delivered to successfully then the value 5 will be returned. - -.. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the Transport - $transport = Swift_SmtpTransport::newInstance('localhost', 25); - - // Create the Mailer using your created Transport - $mailer = Swift_Mailer::newInstance($transport); - - // Create a message - $message = Swift_Message::newInstance('Wonderful Subject') - ->setFrom(array('john@doe.com' => 'John Doe')) - ->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name')) - ->setBody('Here is the message itself') - ; - - // Send the message - $numSent = $mailer->send($message); - - printf("Sent %d messages\n", $numSent); - - /* Note that often that only the boolean equivalent of the - return value is of concern (zero indicates FALSE) - - if ($mailer->send($message)) - { - echo "Sent\n"; - } - else - { - echo "Failed\n"; - } - - */ - -Sending Emails in Batch -....................... - -If you want to send a separate message to each recipient so that only their -own address shows up in the ``To:`` field, follow the following recipe: - -* Create a Transport from one of the provided Transports -- - ``Swift_SmtpTransport``, ``Swift_SendmailTransport``, - ``Swift_MailTransport`` or one of the aggregate Transports. - -* Create an instance of the ``Swift_Mailer`` class, using the Transport as - it's constructor parameter. - -* Create a Message. - -* Iterate over the recipients and send message via the ``send()`` method on - the Mailer object. - -Each recipient of the messages receives a different copy with only their own -email address on the ``To:`` field. - -.. note:: - - In the following example, two emails are sent. One to each of - ``receiver@domain.org`` and ``other@domain.org``. These recipients will - not be aware of each other. - - .. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the Transport - $transport = Swift_SmtpTransport::newInstance('localhost', 25); - - // Create the Mailer using your created Transport - $mailer = Swift_Mailer::newInstance($transport); - - // Create a message - $message = Swift_Message::newInstance('Wonderful Subject') - ->setFrom(array('john@doe.com' => 'John Doe')) - ->setBody('Here is the message itself') - ; - - // Send the message - $failedRecipients = array(); - $numSent = 0; - $to = array('receiver@domain.org', 'other@domain.org' => 'A name'); - - foreach ($to as $address => $name) - { - if (is_int($address)) { - $message->setTo($name); - } else { - $message->setTo(array($address => $name)); - } - - $numSent += $mailer->send($message, $failedRecipients); - } - - printf("Sent %d messages\n", $numSent); - -Finding out Rejected Addresses -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -It's possible to get a list of addresses that were rejected by the Transport -by using a by-reference parameter to ``send()``. - -As Swift Mailer attempts to send the message to each address given to it, if a -recipient is rejected it will be added to the array. You can pass an existing -array, otherwise one will be created by-reference. - -Collecting the list of recipients that were rejected can be useful in -circumstances where you need to "prune" a mailing list for example when some -addresses cannot be delivered to. - -Getting Failures By-reference -............................. - -Collecting delivery failures by-reference with the ``send()`` method is as -simple as passing a variable name to the method call. - -To get failed recipients by-reference: - -* Pass a by-reference variable name to the ``send()`` method of the Mailer - class. - -If the Transport rejects any of the recipients, the culprit addresses will be -added to the array provided by-reference. - -.. note:: - - If the variable name does not yet exist, it will be initialized as an - empty array and then failures will be added to that array. If the variable - already exists it will be type-cast to an array and failures will be added - to it. - - .. code-block:: php - - $mailer = Swift_Mailer::newInstance( ... ); - - $message = Swift_Message::newInstance( ... ) - ->setFrom( ... ) - ->setTo(array( - 'receiver@bad-domain.org' => 'Receiver Name', - 'other@domain.org' => 'A name', - 'other-receiver@bad-domain.org' => 'Other Name' - )) - ->setBody( ... ) - ; - - // Pass a variable name to the send() method - if (!$mailer->send($message, $failures)) - { - echo "Failures:"; - print_r($failures); - } - - /* - Failures: - Array ( - 0 => receiver@bad-domain.org, - 1 => other-receiver@bad-domain.org - ) - */ diff --git a/vendor/swiftmailer/swiftmailer/doc/uml/Encoders.graffle b/vendor/swiftmailer/swiftmailer/doc/uml/Encoders.graffle deleted file mode 100644 index f895752b70947592db74b6a3b8a6bd135a9fd150..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3503 zcmV;g4N&qQiwFP!000030PS6EQ`@)}{tUmumk&GLSx6-LC3cr~Cj@BOOAAXvd$*G> z#!(V4j-A>HA=~MHzmo0vRW^_oh=XTJ?O5mN_0gjv>B!#y<91>RH`w(|$9}T|8(>Gk zw&4s+d-P`KvUj|v?)>p~d;dR&XPw^P=SRZSGCd-kUml#EbcCI~X0tt=TDaLf>>Uc{ zrzhQ>K;vjOk3Q}QJ7Yqouba*JeBRKRRKsv4OwendyUrB5WN}I(+oKAN0U7MjWP;dJ z*`ZGdra|6rZ|z^>#oM+)%o}{FFR*)J5Af}NlRc$@rcLk&yKljMb9uW|p=q0jPH2>$ zf|w&E-F0<#v$gLLmlpXg&0)it*yhM}X4A$Qy?f{C!=Z&~j`y3PP(mIetpVjk$bNGf zXOQ-cIPJkdGmk`R5_g81%kYkF-{@Y)u^cxN2#XsC%$JYjBvYv+>n4co%r!@5T*OfJ z8`u@V_oQm9(KU1nM+z?1EtZIXUCKGuY+|=9b7bc#9Of!KknT=(gC>=ZS5z_)(;uv1 z4t0XFSw;Y~_8_AF1O#6L>9q`n-yj4aR|*zMq5{Lv&e%0Qq2st$3p=ZFXnIpiU!+UE ztYE>I2yX;-$*NH>Ovi_gF`HnUWWlto1vytCzM5%x4DKB4EgL*6jiq~D)ap^LPE8w! z@g#v5=)A}JAfXaP7=)f2#$kzeL#dYAiowKDi?tLfqs2td9r`Gl>8NmV0lp~;YN&E+ zS3oV)kiVx&5ld-+2JQ+X&>BF6X{oq#h3R(5B5uEY!Ktcqjgy6s1>%ZpyRI`&2t|46 z64SU2Lz8(8R9S=c7E_$k zRgnlKRooR+P=vuC96}`v(vyWLhgXIFcpWnyON49dQNL z$~ZsQ3Bj&i6Z0oBv5EQ%;+ zHqGN{xvWvpqS?AUaAx+vSU{X4H#Guccu##o=?0T273 z=CMh7_?GZ=KVg?PrEYQ6EPe}KV9)%QYty9KB-tkvF7fyo=ciy$yJ=)`6UiVuUEP7m z(6p?iL|PaM_U6{!WXeL98r zs9TQpLAug;SwD33xyMiW<5_7c=^uV4%K{^pr>sO=%Dzj6u&>*m>HlX;M|1>5eZw&v zod#)=7TkNYEBX_)!1lNP(6I@*vid{NA9{1s^ZG+$th*j2KzNU>8_eMN`*$j7u%%%t z`g`BS10>7+k&Cg-Zmz5urdKM}pX%<)DU|1zQv=wE-kLyMpr z^zj8{P3#`id&gbmx-qx*&n+4iTUF)u9gsD<6LGA-GnyFj43svHXIeGSRF-E_do1Oh z;6*c&)&FYiWajEtKv6M4jW7xM$8leE{i+bcBK#`67BVFD$n2D}NZ+~U;C+F?RBS1f zbnYOAW>IR?aO*g>O}lvBw)^|2d++sw^ekXatw>rs+OD7|jNPHy+DvvAYj&@#$f{eB z@34(s(>OM7@!+#LAmis^9oOob7x$8qamS zqHb5Vbe!r=**s)A+e_+daYwtrbPj2If<2pDVOMa5!qtLcPauv!+=W0nnR&uCgf_ip zlERHnv&rQC#jYbvFs&kijIlq%^rw}A=`kU5z*E|TMJk5ly0a-^N>hJ3`38q-rafTZ zt2oN!#Bp()O_s$*b{k~PSNp>qL|J7$n>Of1F852IwnS=6_We9Wl_T@;-TegKg|m@D``aT-PHdAsKA@IUm-e(*Vc1&k0OX8^ zl3xEbI{+Ccv^DUGlU8v|5?6Li(ln(Zx9F%MX|Uw@iq@hMGOS&=Q~pS6?BJHg(IcE2 z5P!fK6MzQuSttb^ld4gdN1eL9s9Wvuohbi^TO|h~8K+8ws0={$p@E+XLq5Tj9U9PD zvZ!cs3n`)|DQw60c}@+8(&~d{s~l|`%vcpAmz7V5v>3C9qITDb-mFCJtsOQO&?@Gw zP3L#M1AbtXFlQS{+Q{8xq}3}d^%`!~*Km(bD_$h&5(i|Yb0vzQaE>TO+dzt` zkAu`c058`EfO$W@q7@}r*dCEF+tLr50Q%c=*CaS~0PxrTHZ7XJrioo&YZ~024TtP> zV1IjP&Ac(S!U#p6_bQN&IS!NTdBXm-IhoRm2_7#)gC>areTM^|A790{g5&+VmYxSW zo27(np2qVavzq<<%j?R6_j43kQxy?HNt6{$lezmjWmN!I_F9l-N|Z>E8weFH(90l@ zsdta7^1@8zv0WCFAHrM7W{{7y=iUkeo4W(_=vccaVf`3@poU5TlnY-609DH^L0sQg zxfc8Flt2!x>|+&B5)d0=5#}VxpGcxcOOk8fn4d{}4>hG)atlgGm7oe`O;RQ8xm;tE zA41z*{I-?@IWa&(p(7 zykR7;-qnB>k+O-jDAsQnsadh|tazY%Sdl7DilSHRs}|sH0JIF0>2Dp6J5Wg+ViXC!%g=5dK#j9IIW04jc8@_?5z6jmbJIn3-~-r%W9kNpBqxqg4=3wnR&G3)VyMf*4H>mff31ZPI3Ga}6C=q1>gJ|K>8g#~X+ zv(8?(IgBI;twi?vO)B6KT0Mee3p$PH*7OKt7Z&r+db#G~&#RC`dmHrE-didiGG!qC zYzwGp0qBXh3ZHU(U)dgI%>n&oKPa+W?Wr0=+T6yd=WwO`=tph31@==oY4gf#pE4V! zz(1RBB*fa0{gd=i^_#32h0e?Y_D&t+8b|J8Ty!L)Kbf9+6=Rcc-UPlb=lTdo*yH=G z1O=Q>!4B=xi5W?mxOc8wm=Jt-mj8?KwC8l`1ThvK>XwJ2Dmc{_v}vNisOmF=3#%iJ zDRY(|SU&0#j?v>MBfz})IsJKGYw?qb=XZ)0A%W(A4$#F|pw{|zQRC(-_JcmMF?oo* z$Ifz$F(z5zAShKgS(Urnr){uzcl)(`Vh`{wr^oQV{@tDtr#<**<|UhexHH^L*cG~c zqkA33FvVu!oMRKh0t+S??U`$iOq*lFgIxjeY<6EO1?c63A10mhd|AhuP3+A4x6nU5 z*62=kgC?4dUsSRQ9Gc$L(ihp>EQ>D~6XA`(F2&~8shO(!{ zFQ>K6W`s=yvXjCvQwO@oo1R`c^M@dwir*XVJ{9#$!pjYZ#6qo0+x$Ai{4t!9p-=b2 za}mpba0cd(eYk*D^P!#}A`t-U9zc6g5)gbXNv|bM_zgk;a_s9zlo*f0;Lg~k6St1z zUM=jb4x8EEe@Nf}f)9tKG$qRWN6x`c5pu#$myhrPZSQOE9+r*Y$#O%f-!6VVbPpUt zoXH2>O_F*bX_bZh-zP9F_cWF~09!`UN zpW-2@Uaoo6!pXKzjGRov^4QPm{LM`Ze!j1mYCX6!%_eiDd?@N@VlHIq6{nr&m zYp|t03CXabrN7XgPwm1SjVsvDJ!e{-Ove=M4>VXGoY~gmZtBX8U?nr5{OFY%y9!3G zh|Ya`GH-l$Cv;ZsXM-)n2Q$CG#=ZwV`pVQe^pDFtP&YeVmX!X|!$-7lxtMWxB)_!Y zIiqPwT%S#Q;LM9Dy)$!NS`n!UOwrULT6e*2Prr(#!-9rGQwlV(hW}Z{SjTTg1QG{s zf~`$A#YYLJH}-m0|3ic9Guw(Prx(9Mlg}SSFYqWum{BDD)WcuRWN+_)P(qwYzBtY# dlTFZwk616kA77^y1;pF!{{uPR7LWUs0009F*SY`z diff --git a/vendor/swiftmailer/swiftmailer/doc/uml/Mime.graffle b/vendor/swiftmailer/swiftmailer/doc/uml/Mime.graffle deleted file mode 100644 index e1e33cbf16ea45d29ad48eb9b2f37959292881b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5575 zcmV;&6*%f2iwFP!000030PS6CbK5r7{v7`bzWLBe-gRUE1b9i)?8vgyxa-(%tR&m6 zcXntIlGsqBLQ-+Oo&NU)NL?u2Y*Us5G02P~i97&7;+zK$4h|1q{r%g>Rld?7bbRlp zr?3T{D%9)ww&M+cditUJ=7sU}@2~e>{om1fr~BK*u`+g@Fj6i)9G;$Zl&3Ea4%*|f zOAii?x<|^z>B(hRVRalF9G^W^o(`jE{PN)7=H{klaj90%A92C(;3DwHG>C3bS!FL+ zftDTFPuXRX+LxNcj@nKydcF7L)n|J9y4{PMuk_TqrNN13({Ha1_)&J!@gh2)!E5m9 zVD@!Zgk9U|SrM!9V^Z_HkQD?L|MKKj7zON>U$Yjr{E_Dj0)H}YowIL02UfrDQr6;E z2UDSxJVa&-lGK@32eUepYfmD-ZT~R|qxm(XU_uXO=R217)e1Yl>j!gz>Fp*0H?zZw zODcAG~9ZtcYfti~ulR0Qdqy1)-M^yu_yRHwXd9-36~C^#G@5 zJHx;Um5v`=-+I|1M@~3)t=r{0pFLouH&T95_(!%FQ-<;I$nQ-?)QhspGnoUre&cjgE=_cok3^5pp#MDE0W4Yj;A~CzHAwTY-HQeIpuR|3ir456$2o2;um{ z0Q^H$V-eMiMKF#<2#7^kY5t+XSVYsA$d}&UUeZQ{m8)JKDBU4d{y}d$R*!uNnL5)@ zv8~8bCLwzmilvML=PR=k#j{2*Z(f#JH&+$6u$b%L6qR{TL+8J=s6^Vjmh1~I+gGuLrLWM7 zEN|czUgR>mb(c$}9(N+rcU(6uu`Dw0Lfc{Z)=sXI5}tuLz;hHYDA!?sG{_X3_38`I zLMDdL*jM;h4eLP5c4|r?b3Y33qTn{O65kc3T&Gaw2RHhW|8X4)`V2IF7_bBE?`m%b zHaU|jeBKu>E6hi|LOliKfgv~8GzUMJ8%TGUlJHEWP`(pX_A3D)Jbv#y^ytk-cM9 z)c>3w4sv5Te`4(*C>|O=ygNPdhBR>4@YO3Ey?AeQZ!^PQp%-#tAC}{mUJ+!TN7^!$ zdxcl?@U8}BT`hnbf?8^*)mKBPwE$B?O(iX8;8Inb$q}S&RU0qa`1^T!cIPz_k;l@+ zO?m!eM8YQI%-#fz^a5yD5_{?S+luFJ!D=_pFdvE7Wq6dRIHnRKW?$Hd7wsS<&BQXf ziXpLVJ6QI{aW{iyH7%b&G`D<+n`ilQEkn8|MRZRNXmnvk!)FV}pOD@(t=yZIGp)_I z%rwDVW@;^u8L926fEq?E6g$M!maf4vR|NznVq^}1G69XKEk27?)x5_;dNb;KGYoOv zY6#ZSRZ!clrsAnv4V#s2HG~s3QYa@Ky`s3+MA1mB*G5lMCtS^pQdI;@WfN62THM38 zO;rR9&^|2iG6N*Fv=6VQeb~HP`*Jc;^H$cpsj%1gi^QS0YHHNdQgt;gC0gl%EHrep zRVX8e>UF5>g&#Um>P?QhqX4uBQTacNfKF7bn<>A+nl!jX+rZjJbPff}JykjD+6;$+ zM67UCXyQ821OV2LS0y?JY=p|=38o@YH)J@$BZd<|0}C6}0!_V^9@dXD;6W>Q=wU1Z zr6NAQBI-N#hBq`&!aAXrOez6snPwwh_t2CpopM^a#%blD6;cf!^Q_%8*wr_>v*VSh zxTQf9Q>g^DOwdfkA`-DAVyzFcejV>TT4BMaoup1iCur6WV%Igs-jIq)$$lbWN~Zs) zOy7KH1UuH5QJOk73HxX0y1xDp_F4*T=(QBM{(MzOs9J#yfC~iVi$Ys;lWc5u8h1U4 zGYdlkTL2i1BzlINno6R#_Ngf&ToLP(UFUqpZp=`LsV=Y!na#v4IYE`Uwblu0Q!q=k zc`AQ}_Te<&K($k(03I!@X446$1RyXA1mrw*HO^1KuH_s~^dL#s*UX&5Y+56SO*w3C zB~RzB52TrKOMrp2PG%>l*WXD3nz&`aeZ??9d3qfK7YN9)bhWWm7dXs_sI}B^#ROv& zItUHTY(Z11;p3|z+&M}&gDg#py&-YxlxBKzb?Fh2)NYN`?$Q}})P6_9&>9GqG$l<; znr`Lt4K?`+i>R-#a0}?OhDKEI*I4p{Wrc-p2@|;O?dJwHF;aOd5fDw&W$B++s@)9PwaB+MNV`plxJ*V`zA@* zKGB+I`!cnQ^oxn;7dt)vczpVw?)ioCQen^QYA-p^?snUqx9^V6y35B;&Q4Fxj+c*J zemJ~nzn=<6`T`+iElQui5q@`}s9J&&cA&OM*O6FYI}+qdm7sb#6c$S*v&*m?fh;;Z6> zLgr=9&nPMgM+H=DCJ~mg8|f1Wiq~qn{w3ju$L0No=NhfX;CpLFfQl0 zWGj&}nFT;$-@-;9$$rCzI&7e3GF&J}ImvLh!f-eGdUhSt=PwjD+4NnJxgz&DH&yyh5Jo&S<-Ff#cb^;_S>O1fQ|b*E`xTR~!E(Naw!_ze zU@y+9wIT&Esh^x4L&3bnY_Q=+m~wX*(}1aQpJ%;3eL;a{abXQY={qYn8Z$ps|2+;J8K|nAvu4QsI^vyTQd*~2{wZ@Yb{iv`Uzg4$t(t! zC+vq1>IDLFZn_fFHwZ=Ag*Iuua&VL zkd<@}mqSvlbGh?U=T_D^5!hLYGNH8rSfR4X@oh_3qt^030I(X?Xr(hjji@bBAR(#t zI-sX&i2@s@ZW2RNHDsuU{y1wCn~FD%mtqlUaOj>Xb6?BIy){PeF(nQeG9=-9LZxz= z$5}MkxMf(bOyneJBBv=Z2)>(aZg?!Wt&L<{$^@&4%$qcv>?EtgMnbDh0xfyd8hO*H z6GozvCLZh8V9SPQ2O;o|DQK+$C{Z zBXQ!pPzXt!rlDyKwro{ewj@qs5~r>+qG4o>#S{Br<-dywRk| zkdAywn$}2~n7&ZwE42kAPK%Tg4Q5V2nzv+5VlpQ-pR$&`O=9|+awBB9aczV<89T9M za}ov))Fx9W>CTtbX^qs0!Q!OHz;i?7X?=i2c4x9jlKlXXh8l@j(vKz)YmJE2w(Wq1 zp|Ep3qG@yM#*N!P-oVnj4N!6B}ydGL3+wPlD2?6I*oVgiDzd*$Q(~cP8c&1JYzvmEL^GoYu&kK6qh6qCPV@ zqDvtw3n(c#G4Q^EOoPLTsuiF~737s8NimL8qDTRTR3J$CGtr8+f5>1*HFDf1vup-4 zau9wLST}{}dv;!$;&qy{c4*m4K>C<<-9|t$prOeG=8vs@8`+8UEXgp36L%BTnh0T7zG5sPY&#H^c%L={WOeLbSLb%$JU26z zQH^r(PT*Jh1Yf?(4V&eLwUOmJyb~D^Wfk#|VaAG(QJ8s=UGpl+&1 zaC3V^63R+K8CUHDB?HDgXGE*;z6!UC0~|_Hz${A7F+aTteB50J^RpAjrs1jI`%LF6 zFbgp;B>%Ykjj+kJF*>s8+Rf&femP@0E-reMXP&)4V zmyD+_g!`5o()lAewQgy!Xyp9SXT}%)jPk=v#(H8&P6-ME6ZmBmm>0ibKkqw2est)~ zouXx$z*^u>qHlZDbgDFT^0?k|TN)uvp49#2yE@uUbr?x2#( zI8reV7hp*>niS(nIieI|N`-jU2$jc{d`B@&XOo!twX&j+se;}*pG2#xwDIt9uMZT_-APO#z5aOMUR1FB4ikh8HyG{6IC`7S3 z%%mAm-oNq!-6_+Y#BSJQKV<#=IlKq6iH$5bl*auMKZnahKZ^X(J1a&fNuusuBg00_MP^o!dYbl7kE`~&=b zc>VUH+h*rG$E4duzkK=q(-~-=d^&Dleql0iKD#%apO>k^VmM9OeMVRh{nZ0;5;A#p+7$wy)JAH0ZThJBB#T*mIvimT*aSeQpGYns_YCU*i8*fRCM zs;~Cm84P!@qr3iicN)Eb=y;%^mVNHIw|7HVb_A=K3FSwx+}Kqza?Rm9=978yeK}$? z^0*n?^_a~35{`Wjc#I1(au~-4Kd@|exU9JQ4c(#92 z4(Xjq5U>ZaG=V9bTFiYeH0WB_3+d^NPKTx?rCF5t)RMqpvajeWSay6(DPKH@zNdpFz?@fN7<}%*>M(e8vBv7l*YUgWk20-X%s*zD VzxW)xOdDSB{SO2kTt$6+0RTlqtKk3u diff --git a/vendor/swiftmailer/swiftmailer/doc/uml/Transports.graffle b/vendor/swiftmailer/swiftmailer/doc/uml/Transports.graffle deleted file mode 100644 index 5670e2b65ada6e01406334a4b462f58e8f48f4fd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3061 zcmVFR$!k`4GK0ih`&)N3_0pskCgy+3{0lD+r;eCXT4SBN~zb^h1_1#wG& zj^Ub?)BR)Xy7_Lmy!Gcne*Ztmm(}LS`iU^GEe{Lz>!Y(;RoL1s77qsl8y1Vl&10c{ zR%Kt2=7fl7mw;KqICO?N&#%hc9O;Fe+vbt7yi(}bu z;*KDGk7f;XGz{H_(+mjeHm$_JPUKvB*mn+XtLvmX9HcrtkZufggH#nSSJn~*lP`2& zj&%%^O_oHlyemq(KoKOcCrNv9N%$`SqL{i1T1cb=$EnpGvOJ;cqV}Vc%yMjb16zNL z-}$721*0$gA<#=Q8&QTq@7Ohledyq%GEI6xO?8N$%`!Zy?hM_V40s@XmDO}qo)s`Ic`Zh*EtC3bt{q2YCtXvDb<W8~h!=PoWHn5H?lmh)iHWH@*oz4 zQ)qvMn4tOF??lp|xJg9cwh%NWRc&<_`L;#7>JXurafdKUl<#hw8f|5el@3AkF$!Th z&O{knj&9l9+Qh|;nH2NX@zqMa@qKaC)8u7TPhM8_NESeTd4O*-+}%xpG$02z#oH6#%eVrxl)m(62lY;%bBHj|$vM5ZHXT7+*O2K7XQ zCyNSEnXW1r`Ksg(qD02YpzewVsiFW--Vx|WO(}^<6o?bF#1{tnVccd?;@2QZM!<{O z5oYw8jo;Egs$;058}PR-`GNek@?@#pBO^su>Mlx|6|>XpHYtHF#hALBBC1iE{bakR z#AAc)UdrtLC)j;*5j8_Qe`%!PFQvK=Q(*WDK8{>uZod)sgofWCt-Kxr2HZaJ`gm|O z>~tWaYpVf7LVMWR84C+T52ERp0kKkAP}_BFs5?IyYf>!nJ+jPG4jtjn!+c8(@)vn^ z5mHoj9f#QKg1#L#wT|E5ni8~N1qplySw&kB$zB$C%KW62Mis0-mI=8z3*)YNuR&GY320}8UK@>?Q*=JM1&N7PMFI$Z&>u_ zFMisUF~H0;9ar6cpEPWqgVhMcb_6ompTCf=CiFiU#nJVkLgo z#8TkJmnN#R%+f?!dTCN2I3<-7-qNHZX^iyj9LAa~Po7=+Z* zSHEm!yc*S8$|)oMkW)rdW}iRlsVTPwa5Shprlty_^c&bsByx--7D zhJ1@O_0;w7gi!U!=QsW~Se-O?oAjVS;Uf6y#4*t0fWAdyA`Ts6Eq9wzlPTX2SHrTv zdhIqT(h@#bMP1hC3N*DKN_59buJHV>Kr9#3vVRD;l=)tt(f7*V+Ie}`e`N_ZluFC0 zp+r=y1hkoIC~2hvpgx~W4cAo-SG4AoDHef>Pf8_e6PU+219)Gh#{e?Q18Fi2dxrpZB6k~@@LHnU}_r)m|_N)8DMTOU|tUKMj&Ql zVX>x&SsJg1>C>;Ew26QzmomW20CSTW=6Hj8t@cxVT+vEXT-m(s6ghi4$LqzFY}4jP zH*GA(!j?|{*~DzNFWdhR_5S=t82Aqsy=mo%9`!B9e-?;78Kj%kRp@W#c<_F`&&Q+~ z1K;LXvU8JgTdwo@7_B_rK;J+nnLS3HG09D4l52c4rxKpKQ?-o)mh3Tzj7t8(RMKl; za(gg%41WBg&Q{)|KT`JSVRztPp<`~JL(kK@Q0NC&nuGN5TGB}F)k*yH9a z*u9}|BneJnmQ_G8A3QhGa{w5uco%w=IJWe>ONT>}{MW0})9&R}jfJwgW08^7nPk;3 z+CrRZV#-dvS!h2CwVAL8I6K>k;BFN0Yfi_FMQ)phc6&dxOz54t#vL@1A;x0*5s|*J zJgc3KNEQe5;E-0G%yixY!PshjB3LCh9id*c#J#$1L!6GrmTvN25DuDdJcL?Dx4kgB zogb#pn;Y?r_R+kTGzO9vdY|#yQokAjq{Zvx>!S1HjRi+@MR}S)THp>bUl-0S=Z-hH z>5e_uyAH%pk@v{pHhK`^q;QZF>zibj`QyWjxyUCvD)~%Yn(m!sA9A=^pDa^_4q%ipCT1h1K1MqNasetzm%JIM=mf-47vq z4reszW-)!{q5QdPTAgtu*;xTgC0PJqPcH2#3OitFP!N1l#L^2F!^NirhC;B_VIoa{ za`D0$y2I0)z-~ylACd9C^A=z>zLBM-(rG~4i^h?QvD-h_Q54)Gz!1jrH7WCo>dd5( zhxlLf^n?BJ7KreFNA{=Mse7pWee`#&and{NU0#bSXy1OYjc%2EH!rWjr(XN?#y%wJ z)f2VZls?>ly1ft&Yquwdje8>V?#>=n-^Zy!IGqOVK7$?n`dZC`7DlsuU}Q8J%r3o7 zR&XeW#Ei0o3$yrZ2UE;27pSG-J78zjl6t59H1MRRRSGl^fFh}&P>DZ)k*@8^>h@mY zKsVjN>uGd6@bwkc%}d9AoDW^e8EnQ%C_Q_zLs+M0t|^@Rd@@bG8-21a_nSc-kHN|> z;Mfbmqo0|OL;v}kC+1B~mox7E+Jh&=wh*M)&5m7uv*;4^)^bdD#E10i5FyeLu>}lo zX)*P@K-ARRso?12sVSy3VUAnN#Jw<&KZ=rA3AsqHhl65x6mxzB$H+lN*%3-gV$*3% z`TR-r3U*_FIW2@b&`KaEr9>b_lO;wepIo<}XlEoM`&jqG>%b=ZaFG8$W3gsW&3^y@ D6q4x9 diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php deleted file mode 100644 index ecaf0ef..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php +++ /dev/null @@ -1,81 +0,0 @@ -createDependenciesFor('mime.attachment') - ); - - $this->setBody($data); - $this->setFilename($filename); - if ($contentType) { - $this->setContentType($contentType); - } - } - - /** - * Create a new Attachment. - * @param string|Swift_OutputByteStream $data - * @param string $filename - * @param string $contentType - * @return Swift_Mime_Attachment - */ - public static function newInstance($data = null, $filename = null, $contentType = null) - { - return new self($data, $filename, $contentType); - } - - /** - * Create a new Attachment from a filesystem path. - * @param string $path - * @param string $contentType optional - * @return Swift_Mime_Attachment - */ - public static function fromPath($path, $contentType = null) - { - return self::newInstance()->setFile( - new Swift_ByteStream_FileByteStream($path), - $contentType - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php deleted file mode 100644 index 1d51bad..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php +++ /dev/null @@ -1,164 +0,0 @@ -_filters[$key] = $filter; - } - - /** - * Remove an already present StreamFilter based on its $key. - * @param string $key - */ - public function removeFilter($key) - { - unset($this->_filters[$key]); - } - - /** - * Writes $bytes to the end of the stream. - * @param string $bytes - * @throws Swift_IoException - */ - public function write($bytes) - { - $this->_writeBuffer .= $bytes; - foreach ($this->_filters as $filter) { - if ($filter->shouldBuffer($this->_writeBuffer)) { - return; - } - } - $this->_doWrite($this->_writeBuffer); - - return ++$this->_sequence; - } - - /** - * For any bytes that are currently buffered inside the stream, force them - * off the buffer. - * - * @throws Swift_IoException - */ - public function commit() - { - $this->_doWrite($this->_writeBuffer); - } - - /** - * Attach $is to this stream. - * The stream acts as an observer, receiving all data that is written. - * All {@link write()} and {@link flushBuffers()} operations will be mirrored. - * - * @param Swift_InputByteStream $is - */ - public function bind(Swift_InputByteStream $is) - { - $this->_mirrors[] = $is; - } - - /** - * Remove an already bound stream. - * If $is is not bound, no errors will be raised. - * If the stream currently has any buffered data it will be written to $is - * before unbinding occurs. - * - * @param Swift_InputByteStream $is - */ - public function unbind(Swift_InputByteStream $is) - { - foreach ($this->_mirrors as $k => $stream) { - if ($is === $stream) { - if ($this->_writeBuffer !== '') { - $stream->write($this->_filter($this->_writeBuffer)); - } - unset($this->_mirrors[$k]); - } - } - } - - /** - * Flush the contents of the stream (empty it) and set the internal pointer - * to the beginning. - * @throws Swift_IoException - */ - public function flushBuffers() - { - if ($this->_writeBuffer !== '') { - $this->_doWrite($this->_writeBuffer); - } - $this->_flush(); - - foreach ($this->_mirrors as $stream) { - $stream->flushBuffers(); - } - } - - // -- Private methods - - /** Run $bytes through all filters */ - private function _filter($bytes) - { - foreach ($this->_filters as $filter) { - $bytes = $filter->filter($bytes); - } - - return $bytes; - } - - /** Just write the bytes to the stream */ - private function _doWrite($bytes) - { - $this->_commit($this->_filter($bytes)); - - foreach ($this->_mirrors as $stream) { - $stream->write($bytes); - } - - $this->_writeBuffer = ''; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/ArrayByteStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/ArrayByteStream.php deleted file mode 100644 index 06fb414..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/ArrayByteStream.php +++ /dev/null @@ -1,170 +0,0 @@ -_array = $stack; - $this->_arraySize = count($stack); - } elseif (is_string($stack)) { - $this->write($stack); - } else { - $this->_array = array(); - } - } - - /** - * Reads $length bytes from the stream into a string and moves the pointer - * through the stream by $length. If less bytes exist than are requested the - * remaining bytes are given instead. If no bytes are remaining at all, boolean - * false is returned. - * @param int $length - * @return string - */ - public function read($length) - { - if ($this->_offset == $this->_arraySize) { - return false; - } - - // Don't use array slice - $end = $length + $this->_offset; - $end = $this->_arraySize<$end - ?$this->_arraySize - :$end; - $ret = ''; - for (; $this->_offset < $end; ++$this->_offset) { - $ret .= $this->_array[$this->_offset]; - } - - return $ret; - } - - /** - * Writes $bytes to the end of the stream. - * @param string $bytes - */ - public function write($bytes) - { - $to_add = str_split($bytes); - foreach ($to_add as $value) { - $this->_array[] = $value; - } - $this->_arraySize = count($this->_array); - - foreach ($this->_mirrors as $stream) { - $stream->write($bytes); - } - } - - /** - * Not used. - */ - public function commit() - { - } - - /** - * Attach $is to this stream. - * The stream acts as an observer, receiving all data that is written. - * All {@link write()} and {@link flushBuffers()} operations will be mirrored. - * - * @param Swift_InputByteStream $is - */ - public function bind(Swift_InputByteStream $is) - { - $this->_mirrors[] = $is; - } - - /** - * Remove an already bound stream. - * If $is is not bound, no errors will be raised. - * If the stream currently has any buffered data it will be written to $is - * before unbinding occurs. - * - * @param Swift_InputByteStream $is - */ - public function unbind(Swift_InputByteStream $is) - { - foreach ($this->_mirrors as $k => $stream) { - if ($is === $stream) { - unset($this->_mirrors[$k]); - } - } - } - - /** - * Move the internal read pointer to $byteOffset in the stream. - * @param int $byteOffset - * @return boolean - */ - public function setReadPointer($byteOffset) - { - if ($byteOffset > $this->_arraySize) { - $byteOffset = $this->_arraySize; - } elseif ($byteOffset < 0) { - $byteOffset = 0; - } - - $this->_offset = $byteOffset; - } - - /** - * Flush the contents of the stream (empty it) and set the internal pointer - * to the beginning. - */ - public function flushBuffers() - { - $this->_offset = 0; - $this->_array = array(); - $this->_arraySize = 0; - - foreach ($this->_mirrors as $stream) { - $stream->flushBuffers(); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/FileByteStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/FileByteStream.php deleted file mode 100644 index 1dd2d29..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/FileByteStream.php +++ /dev/null @@ -1,212 +0,0 @@ -_path = $path; - $this->_mode = $writable ? 'w+b' : 'rb'; - - if (function_exists('get_magic_quotes_runtime') && @get_magic_quotes_runtime() == 1) { - $this->_quotes = true; - } - } - - /** - * Get the complete path to the file. - * @return string - */ - public function getPath() - { - return $this->_path; - } - - /** - * Reads $length bytes from the stream into a string and moves the pointer - * through the stream by $length. If less bytes exist than are requested the - * remaining bytes are given instead. If no bytes are remaining at all, boolean - * false is returned. - * @param int $length - * @return string - * @throws Swift_IoException - */ - public function read($length) - { - $fp = $this->_getReadHandle(); - if (!feof($fp)) { - if ($this->_quotes) { - ini_set('magic_quotes_runtime', 0); - } - $bytes = fread($fp, $length); - if ($this->_quotes) { - ini_set('magic_quotes_runtime', 1); - } - $this->_offset = ftell($fp); - - return $bytes; - } else { - $this->_resetReadHandle(); - - return false; - } - } - - /** - * Move the internal read pointer to $byteOffset in the stream. - * @param int $byteOffset - * @return boolean - */ - public function setReadPointer($byteOffset) - { - if (isset($this->_reader)) { - $this->_seekReadStreamToPosition($byteOffset); - } - $this->_offset = $byteOffset; - } - - // -- Private methods - - /** Just write the bytes to the file */ - protected function _commit($bytes) - { - fwrite($this->_getWriteHandle(), $bytes); - $this->_resetReadHandle(); - } - - /** Not used */ - protected function _flush() - { - } - - /** Get the resource for reading */ - private function _getReadHandle() - { - if (!isset($this->_reader)) { - if (!$this->_reader = fopen($this->_path, 'rb')) { - throw new Swift_IoException( - 'Unable to open file for reading [' . $this->_path . ']' - ); - } - if ($this->_offset <> 0) { - $this->_getReadStreamSeekableStatus(); - $this->_seekReadStreamToPosition($this->_offset); - } - } - - return $this->_reader; - } - - /** Get the resource for writing */ - private function _getWriteHandle() - { - if (!isset($this->_writer)) { - if (!$this->_writer = fopen($this->_path, $this->_mode)) { - throw new Swift_IoException( - 'Unable to open file for writing [' . $this->_path . ']' - ); - } - } - - return $this->_writer; - } - - /** Force a reload of the resource for reading */ - private function _resetReadHandle() - { - if (isset($this->_reader)) { - fclose($this->_reader); - $this->_reader = null; - } - } - - /** Check if ReadOnly Stream is seekable */ - private function _getReadStreamSeekableStatus() - { - $metas = stream_get_meta_data($this->_reader); - $this->_seekable = $metas['seekable']; - } - - /** Streams in a readOnly stream ensuring copy if needed */ - private function _seekReadStreamToPosition($offset) - { - if ($this->_seekable===null) { - $this->_getReadStreamSeekableStatus(); - } - if ($this->_seekable === false) { - $currentPos = ftell($this->_reader); - if ($currentPos<$offset) { - $toDiscard = $offset-$currentPos; - fread($this->_reader, $toDiscard); - - return; - } - $this->_copyReadStream(); - } - fseek($this->_reader, $offset, SEEK_SET); - } - - /** Copy a readOnly Stream to ensure seekability */ - private function _copyReadStream() - { - if ($tmpFile = fopen('php://temp/maxmemory:4096', 'w+b')) { - /* We have opened a php:// Stream Should work without problem */ - } elseif (function_exists('sys_get_temp_dir') && is_writable(sys_get_temp_dir()) && ($tmpFile = tmpfile())) { - /* We have opened a tmpfile */ - } else { - throw new Swift_IoException('Unable to copy the file to make it seekable, sys_temp_dir is not writable, php://memory not available'); - } - $currentPos = ftell($this->_reader); - fclose($this->_reader); - $source = fopen($this->_path, 'rb'); - if (!$source) { - throw new Swift_IoException('Unable to open file for copying [' . $this->_path . ']'); - } - fseek($tmpFile, 0, SEEK_SET); - while (!feof($source)) { - fwrite($tmpFile, fread($source, 4096)); - } - fseek($tmpFile, $currentPos, SEEK_SET); - fclose($source); - $this->_reader = $tmpFile; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader.php deleted file mode 100644 index 3048c3c..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader.php +++ /dev/null @@ -1,59 +0,0 @@ - - */ -interface Swift_CharacterReader -{ - const MAP_TYPE_INVALID = 0x01; - const MAP_TYPE_FIXED_LEN = 0x02; - const MAP_TYPE_POSITIONS = 0x03; - - /** - * Returns the complete charactermap - * - * @param string $string - * @param int $startOffset - * @param array $currentMap - * @param mixed $ignoredChars - * @return int - */ - public function getCharPositions($string, $startOffset, &$currentMap, &$ignoredChars); - - /** - * Returns mapType - * @return int mapType - */ - public function getMapType(); - - /** - * Returns an integer which specifies how many more bytes to read. - * A positive integer indicates the number of more bytes to fetch before invoking - * this method again. - * A value of zero means this is already a valid character. - * A value of -1 means this cannot possibly be a valid character. - * @param int[] $bytes - * @return int - */ - public function validateByteSequence($bytes, $size); - - /** - * Returns the number of bytes which should be read to start each character. - * For fixed width character sets this should be the number of - * octets-per-character. For multibyte character sets this will probably be 1. - * @return int - */ - public function getInitialByteSize(); -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php deleted file mode 100644 index 884fa5f..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php +++ /dev/null @@ -1,89 +0,0 @@ - - */ -class Swift_CharacterReader_GenericFixedWidthReader implements Swift_CharacterReader -{ - /** - * The number of bytes in a single character. - * @var int - * @access private - */ - private $_width; - - /** - * Creates a new GenericFixedWidthReader using $width bytes per character. - * @param int $width - */ - public function __construct($width) - { - $this->_width = $width; - } - - /** - * Returns the complete charactermap - * - * @param string $string - * @param int $startOffset - * @param array $currentMap - * @param mixed $ignoredChars - * @return $int - */ - public function getCharPositions($string, $startOffset, &$currentMap, &$ignoredChars) - { - $strlen = strlen($string); - // % and / are CPU intensive, so, maybe find a better way - $ignored = $strlen%$this->_width; - $ignoredChars = substr($string, - $ignored); - $currentMap = $this->_width; - - return ($strlen - $ignored)/$this->_width; - } - - /** - * Returns mapType - * @return int mapType - */ - public function getMapType() - { - return self::MAP_TYPE_FIXED_LEN; - } - - /** - * Returns an integer which specifies how many more bytes to read. - * A positive integer indicates the number of more bytes to fetch before invoking - * this method again. - * A value of zero means this is already a valid character. - * A value of -1 means this cannot possibly be a valid character. - * @param string $bytes - * @return int - */ - public function validateByteSequence($bytes, $size) - { - $needed = $this->_width - $size; - - return ($needed > -1) ? $needed : -1; - } - - /** - * Returns the number of bytes which should be read to start each character. - * @return int - */ - public function getInitialByteSize() - { - return $this->_width; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/UsAsciiReader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/UsAsciiReader.php deleted file mode 100644 index cc268ae..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/UsAsciiReader.php +++ /dev/null @@ -1,75 +0,0 @@ -"\x07F") { // Invalid char - $currentMap[$i+$startOffset]=$string[$i]; - } - } - - return $strlen; - } - - /** - * Returns mapType - * @return int mapType - */ - public function getMapType() - { - return self::MAP_TYPE_INVALID; - } - - /** - * Returns an integer which specifies how many more bytes to read. - * A positive integer indicates the number of more bytes to fetch before invoking - * this method again. - * A value of zero means this is already a valid character. - * A value of -1 means this cannot possibly be a valid character. - * @param string $bytes - * @return int - */ - public function validateByteSequence($bytes, $size) - { - $byte = reset($bytes); - if (1 == count($bytes) && $byte >= 0x00 && $byte <= 0x7F) { - return 0; - } else { - return -1; - } - } - - /** - * Returns the number of bytes which should be read to start each character. - * @return int - */ - public function getInitialByteSize() - { - return 1; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/Utf8Reader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/Utf8Reader.php deleted file mode 100644 index d381320..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/Utf8Reader.php +++ /dev/null @@ -1,171 +0,0 @@ - - */ -class Swift_CharacterReader_Utf8Reader implements Swift_CharacterReader -{ - /** Pre-computed for optimization */ - private static $length_map=array( -//N=0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, //0x0N - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, //0x1N - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, //0x2N - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, //0x3N - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, //0x4N - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, //0x5N - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, //0x6N - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, //0x7N - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //0x8N - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //0x9N - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //0xAN - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //0xBN - 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, //0xCN - 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, //0xDN - 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, //0xEN - 4,4,4,4,4,4,4,4,5,5,5,5,6,6,0,0 //0xFN - ); - - private static $s_length_map=array( - "\x00"=>1, "\x01"=>1, "\x02"=>1, "\x03"=>1, "\x04"=>1, "\x05"=>1, "\x06"=>1, "\x07"=>1, - "\x08"=>1, "\x09"=>1, "\x0a"=>1, "\x0b"=>1, "\x0c"=>1, "\x0d"=>1, "\x0e"=>1, "\x0f"=>1, - "\x10"=>1, "\x11"=>1, "\x12"=>1, "\x13"=>1, "\x14"=>1, "\x15"=>1, "\x16"=>1, "\x17"=>1, - "\x18"=>1, "\x19"=>1, "\x1a"=>1, "\x1b"=>1, "\x1c"=>1, "\x1d"=>1, "\x1e"=>1, "\x1f"=>1, - "\x20"=>1, "\x21"=>1, "\x22"=>1, "\x23"=>1, "\x24"=>1, "\x25"=>1, "\x26"=>1, "\x27"=>1, - "\x28"=>1, "\x29"=>1, "\x2a"=>1, "\x2b"=>1, "\x2c"=>1, "\x2d"=>1, "\x2e"=>1, "\x2f"=>1, - "\x30"=>1, "\x31"=>1, "\x32"=>1, "\x33"=>1, "\x34"=>1, "\x35"=>1, "\x36"=>1, "\x37"=>1, - "\x38"=>1, "\x39"=>1, "\x3a"=>1, "\x3b"=>1, "\x3c"=>1, "\x3d"=>1, "\x3e"=>1, "\x3f"=>1, - "\x40"=>1, "\x41"=>1, "\x42"=>1, "\x43"=>1, "\x44"=>1, "\x45"=>1, "\x46"=>1, "\x47"=>1, - "\x48"=>1, "\x49"=>1, "\x4a"=>1, "\x4b"=>1, "\x4c"=>1, "\x4d"=>1, "\x4e"=>1, "\x4f"=>1, - "\x50"=>1, "\x51"=>1, "\x52"=>1, "\x53"=>1, "\x54"=>1, "\x55"=>1, "\x56"=>1, "\x57"=>1, - "\x58"=>1, "\x59"=>1, "\x5a"=>1, "\x5b"=>1, "\x5c"=>1, "\x5d"=>1, "\x5e"=>1, "\x5f"=>1, - "\x60"=>1, "\x61"=>1, "\x62"=>1, "\x63"=>1, "\x64"=>1, "\x65"=>1, "\x66"=>1, "\x67"=>1, - "\x68"=>1, "\x69"=>1, "\x6a"=>1, "\x6b"=>1, "\x6c"=>1, "\x6d"=>1, "\x6e"=>1, "\x6f"=>1, - "\x70"=>1, "\x71"=>1, "\x72"=>1, "\x73"=>1, "\x74"=>1, "\x75"=>1, "\x76"=>1, "\x77"=>1, - "\x78"=>1, "\x79"=>1, "\x7a"=>1, "\x7b"=>1, "\x7c"=>1, "\x7d"=>1, "\x7e"=>1, "\x7f"=>1, - "\x80"=>0, "\x81"=>0, "\x82"=>0, "\x83"=>0, "\x84"=>0, "\x85"=>0, "\x86"=>0, "\x87"=>0, - "\x88"=>0, "\x89"=>0, "\x8a"=>0, "\x8b"=>0, "\x8c"=>0, "\x8d"=>0, "\x8e"=>0, "\x8f"=>0, - "\x90"=>0, "\x91"=>0, "\x92"=>0, "\x93"=>0, "\x94"=>0, "\x95"=>0, "\x96"=>0, "\x97"=>0, - "\x98"=>0, "\x99"=>0, "\x9a"=>0, "\x9b"=>0, "\x9c"=>0, "\x9d"=>0, "\x9e"=>0, "\x9f"=>0, - "\xa0"=>0, "\xa1"=>0, "\xa2"=>0, "\xa3"=>0, "\xa4"=>0, "\xa5"=>0, "\xa6"=>0, "\xa7"=>0, - "\xa8"=>0, "\xa9"=>0, "\xaa"=>0, "\xab"=>0, "\xac"=>0, "\xad"=>0, "\xae"=>0, "\xaf"=>0, - "\xb0"=>0, "\xb1"=>0, "\xb2"=>0, "\xb3"=>0, "\xb4"=>0, "\xb5"=>0, "\xb6"=>0, "\xb7"=>0, - "\xb8"=>0, "\xb9"=>0, "\xba"=>0, "\xbb"=>0, "\xbc"=>0, "\xbd"=>0, "\xbe"=>0, "\xbf"=>0, - "\xc0"=>2, "\xc1"=>2, "\xc2"=>2, "\xc3"=>2, "\xc4"=>2, "\xc5"=>2, "\xc6"=>2, "\xc7"=>2, - "\xc8"=>2, "\xc9"=>2, "\xca"=>2, "\xcb"=>2, "\xcc"=>2, "\xcd"=>2, "\xce"=>2, "\xcf"=>2, - "\xd0"=>2, "\xd1"=>2, "\xd2"=>2, "\xd3"=>2, "\xd4"=>2, "\xd5"=>2, "\xd6"=>2, "\xd7"=>2, - "\xd8"=>2, "\xd9"=>2, "\xda"=>2, "\xdb"=>2, "\xdc"=>2, "\xdd"=>2, "\xde"=>2, "\xdf"=>2, - "\xe0"=>3, "\xe1"=>3, "\xe2"=>3, "\xe3"=>3, "\xe4"=>3, "\xe5"=>3, "\xe6"=>3, "\xe7"=>3, - "\xe8"=>3, "\xe9"=>3, "\xea"=>3, "\xeb"=>3, "\xec"=>3, "\xed"=>3, "\xee"=>3, "\xef"=>3, - "\xf0"=>4, "\xf1"=>4, "\xf2"=>4, "\xf3"=>4, "\xf4"=>4, "\xf5"=>4, "\xf6"=>4, "\xf7"=>4, - "\xf8"=>5, "\xf9"=>5, "\xfa"=>5, "\xfb"=>5, "\xfc"=>6, "\xfd"=>6, "\xfe"=>0, "\xff"=>0, - ); - - /** - * Returns the complete charactermap - * - * @param string $string - * @param int $startOffset - * @param array $currentMap - * @param mixed $ignoredChars - */ - public function getCharPositions($string, $startOffset, &$currentMap, &$ignoredChars) - { - if (!isset($currentMap['i']) || !isset($currentMap['p'])) { - $currentMap['p'] = $currentMap['i'] = array(); - } - $strlen=strlen($string); - $charPos=count($currentMap['p']); - $foundChars=0; - $invalid=false; - for ($i=0; $i<$strlen; ++$i) { - $char=$string[$i]; - $size=self::$s_length_map[$char]; - if ($size==0) { - /* char is invalid, we must wait for a resync */ - $invalid=true; - continue; - } else { - if ($invalid==true) { - /* We mark the chars as invalid and start a new char */ - $currentMap['p'][$charPos+$foundChars]=$startOffset+$i; - $currentMap['i'][$charPos+$foundChars]=true; - ++$foundChars; - $invalid=false; - } - if (($i+$size) > $strlen) { - $ignoredChars=substr($string, $i); - break; - } - for ($j=1; $j<$size; ++$j) { - $char=$string[$i+$j]; - if ($char>"\x7F" && $char<"\xC0") { - // Valid - continue parsing - } else { - /* char is invalid, we must wait for a resync */ - $invalid=true; - continue 2; - } - } - /* Ok we got a complete char here */ - $currentMap['p'][$charPos+$foundChars]=$startOffset+$i+$size; - $i+=$j-1; - ++$foundChars; - } - } - - return $foundChars; - } - - /** - * Returns mapType - * @return int mapType - */ - public function getMapType() - { - return self::MAP_TYPE_POSITIONS; - } - - /** - * Returns an integer which specifies how many more bytes to read. - * A positive integer indicates the number of more bytes to fetch before invoking - * this method again. - * A value of zero means this is already a valid character. - * A value of -1 means this cannot possibly be a valid character. - * @param string $bytes - * @return int - */ - public function validateByteSequence($bytes, $size) - { - if ($size<1) { - return -1; - } - $needed = self::$length_map[$bytes[0]] - $size; - - return ($needed > -1) - ? $needed - : -1 - ; - } - - /** - * Returns the number of bytes which should be read to start each character. - * @return int - */ - public function getInitialByteSize() - { - return 1; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReaderFactory.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReaderFactory.php deleted file mode 100644 index b01c493..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReaderFactory.php +++ /dev/null @@ -1,25 +0,0 @@ -init(); - } - - public function __wakeup() - { - $this->init(); - } - - public function init() - { - if (count(self::$_map) > 0) { - return; - } - - $prefix = 'Swift_CharacterReader_'; - - $singleByte = array( - 'class' => $prefix . 'GenericFixedWidthReader', - 'constructor' => array(1) - ); - - $doubleByte = array( - 'class' => $prefix . 'GenericFixedWidthReader', - 'constructor' => array(2) - ); - - $fourBytes = array( - 'class' => $prefix . 'GenericFixedWidthReader', - 'constructor' => array(4) - ); - - //Utf-8 - self::$_map['utf-?8'] = array( - 'class' => $prefix . 'Utf8Reader', - 'constructor' => array() - ); - - //7-8 bit charsets - self::$_map['(us-)?ascii'] = $singleByte; - self::$_map['(iso|iec)-?8859-?[0-9]+'] = $singleByte; - self::$_map['windows-?125[0-9]'] = $singleByte; - self::$_map['cp-?[0-9]+'] = $singleByte; - self::$_map['ansi'] = $singleByte; - self::$_map['macintosh'] = $singleByte; - self::$_map['koi-?7'] = $singleByte; - self::$_map['koi-?8-?.+'] = $singleByte; - self::$_map['mik'] = $singleByte; - self::$_map['(cork|t1)'] = $singleByte; - self::$_map['v?iscii'] = $singleByte; - - //16 bits - self::$_map['(ucs-?2|utf-?16)'] = $doubleByte; - - //32 bits - self::$_map['(ucs-?4|utf-?32)'] = $fourBytes; - - //Fallback - self::$_map['.*'] = $singleByte; - } - - /** - * Returns a CharacterReader suitable for the charset applied. - * @param string $charset - * @return Swift_CharacterReader - */ - public function getReaderFor($charset) - { - $charset = trim(strtolower($charset)); - foreach (self::$_map as $pattern => $spec) { - $re = '/^' . $pattern . '$/D'; - if (preg_match($re, $charset)) { - if (!array_key_exists($pattern, self::$_loaded)) { - $reflector = new ReflectionClass($spec['class']); - if ($reflector->getConstructor()) { - $reader = $reflector->newInstanceArgs($spec['constructor']); - } else { - $reader = $reflector->newInstance(); - } - self::$_loaded[$pattern] = $reader; - } - - return self::$_loaded[$pattern]; - } - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream.php deleted file mode 100644 index 5464656..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream.php +++ /dev/null @@ -1,82 +0,0 @@ -setCharacterReaderFactory($factory); - $this->setCharacterSet($charset); - } - - /** - * Set the character set used in this CharacterStream. - * @param string $charset - */ - public function setCharacterSet($charset) - { - $this->_charset = $charset; - $this->_charReader = null; - } - - /** - * Set the CharacterReaderFactory for multi charset support. - * @param Swift_CharacterReaderFactory $factory - */ - public function setCharacterReaderFactory(Swift_CharacterReaderFactory $factory) - { - $this->_charReaderFactory = $factory; - } - - /** - * Overwrite this character stream using the byte sequence in the byte stream. - * @param Swift_OutputByteStream $os output stream to read from - */ - public function importByteStream(Swift_OutputByteStream $os) - { - if (!isset($this->_charReader)) { - $this->_charReader = $this->_charReaderFactory - ->getReaderFor($this->_charset); - } - - $startLength = $this->_charReader->getInitialByteSize(); - while (false !== $bytes = $os->read($startLength)) { - $c = array(); - for ($i = 0, $len = strlen($bytes); $i < $len; ++$i) { - $c[] = self::$_byteMap[$bytes[$i]]; - } - $size = count($c); - $need = $this->_charReader - ->validateByteSequence($c, $size); - if ($need > 0 && - false !== $bytes = $os->read($need)) - { - for ($i = 0, $len = strlen($bytes); $i < $len; ++$i) { - $c[] = self::$_byteMap[$bytes[$i]]; - } - } - $this->_array[] = $c; - ++$this->_array_size; - } - } - - /** - * Import a string a bytes into this CharacterStream, overwriting any existing - * data in the stream. - * @param string $string - */ - public function importString($string) - { - $this->flushContents(); - $this->write($string); - } - - /** - * Read $length characters from the stream and move the internal pointer - * $length further into the stream. - * @param int $length - * @return string - */ - public function read($length) - { - if ($this->_offset == $this->_array_size) { - return false; - } - - // Don't use array slice - $arrays = array(); - $end = $length + $this->_offset; - for ($i = $this->_offset; $i < $end; ++$i) { - if (!isset($this->_array[$i])) { - break; - } - $arrays[] = $this->_array[$i]; - } - $this->_offset += $i - $this->_offset; // Limit function calls - $chars = false; - foreach ($arrays as $array) { - $chars .= implode('', array_map('chr', $array)); - } - - return $chars; - } - - /** - * Read $length characters from the stream and return a 1-dimensional array - * containing there octet values. - * @param int $length - * @return int[] - */ - public function readBytes($length) - { - if ($this->_offset == $this->_array_size) { - return false; - } - $arrays = array(); - $end = $length + $this->_offset; - for ($i = $this->_offset; $i < $end; ++$i) { - if (!isset($this->_array[$i])) { - break; - } - $arrays[] = $this->_array[$i]; - } - $this->_offset += ($i - $this->_offset); // Limit function calls - - return call_user_func_array('array_merge', $arrays); - } - - /** - * Write $chars to the end of the stream. - * @param string $chars - */ - public function write($chars) - { - if (!isset($this->_charReader)) { - $this->_charReader = $this->_charReaderFactory->getReaderFor( - $this->_charset); - } - - $startLength = $this->_charReader->getInitialByteSize(); - - $fp = fopen('php://memory', 'w+b'); - fwrite($fp, $chars); - unset($chars); - fseek($fp, 0, SEEK_SET); - - $buffer = array(0); - $buf_pos = 1; - $buf_len = 1; - $has_datas = true; - do { - $bytes = array(); - // Buffer Filing - if ($buf_len - $buf_pos < $startLength) { - $buf = array_splice($buffer, $buf_pos); - $new = $this->_reloadBuffer($fp, 100); - if ($new) { - $buffer = array_merge($buf, $new); - $buf_len = count($buffer); - $buf_pos = 0; - } else { - $has_datas = false; - } - } - if ($buf_len - $buf_pos > 0) { - $size = 0; - for ($i = 0; $i < $startLength && isset($buffer[$buf_pos]); ++$i) { - ++$size; - $bytes[] = $buffer[$buf_pos++]; - } - $need = $this->_charReader->validateByteSequence( - $bytes, $size); - if ($need > 0) { - if ($buf_len - $buf_pos < $need) { - $new = $this->_reloadBuffer($fp, $need); - - if ($new) { - $buffer = array_merge($buffer, $new); - $buf_len = count($buffer); - } - } - for ($i = 0; $i < $need && isset($buffer[$buf_pos]); ++$i) { - $bytes[] = $buffer[$buf_pos++]; - } - } - $this->_array[] = $bytes; - ++$this->_array_size; - } - } while ($has_datas); - - fclose($fp); - } - - /** - * Move the internal pointer to $charOffset in the stream. - * @param int $charOffset - */ - public function setPointer($charOffset) - { - if ($charOffset > $this->_array_size) { - $charOffset = $this->_array_size; - } elseif ($charOffset < 0) { - $charOffset = 0; - } - $this->_offset = $charOffset; - } - - /** - * Empty the stream and reset the internal pointer. - */ - public function flushContents() - { - $this->_offset = 0; - $this->_array = array(); - $this->_array_size = 0; - } - - private function _reloadBuffer($fp, $len) - { - if (!feof($fp) && ($bytes = fread($fp, $len)) !== false) { - $buf = array(); - for ($i = 0, $len = strlen($bytes); $i < $len; ++$i) { - $buf[] = self::$_byteMap[$bytes[$i]]; - } - - return $buf; - } - - return false; - } - - private static function _initializeMaps() - { - if (!isset(self::$_charMap)) { - self::$_charMap = array(); - for ($byte = 0; $byte < 256; ++$byte) { - self::$_charMap[$byte] = chr($byte); - } - self::$_byteMap = array_flip(self::$_charMap); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/NgCharacterStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/NgCharacterStream.php deleted file mode 100644 index d40a974..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/NgCharacterStream.php +++ /dev/null @@ -1,283 +0,0 @@ -. - - */ - -/** - * A CharacterStream implementation which stores characters in an internal array. - * @package Swift - * @subpackage CharacterStream - * @author Xavier De Cock - */ - -class Swift_CharacterStream_NgCharacterStream implements Swift_CharacterStream -{ - /** - * The char reader (lazy-loaded) for the current charset. - * @var Swift_CharacterReader - * @access private - */ - private $_charReader; - - /** - * A factory for creatiing CharacterReader instances. - * @var Swift_CharacterReaderFactory - * @access private - */ - private $_charReaderFactory; - - /** - * The character set this stream is using. - * @var string - * @access private - */ - private $_charset; - - /** - * The datas stored as is - * - * @var string - */ - private $_datas = ""; - - /** - * Number of bytes in the stream - * - * @var int - */ - private $_datasSize = 0; - - /** - * Map - * - * @var mixed - */ - private $_map; - - /** - * Map Type - * - * @var int - */ - private $_mapType = 0; - - /** - * Number of characters in the stream - * - * @var int - */ - private $_charCount = 0; - - /** - * Position in the stream - * - * @var unknown_type - */ - private $_currentPos = 0; - - /** - * The constructor - * - * @param Swift_CharacterReaderFactory $factory - * @param unknown_type $charset - */ - public function __construct(Swift_CharacterReaderFactory $factory, $charset) - { - $this->setCharacterReaderFactory($factory); - $this->setCharacterSet($charset); - } - - /* -- Changing parameters of the stream -- */ - - /** - * Set the character set used in this CharacterStream. - * @param string $charset - */ - public function setCharacterSet($charset) - { - $this->_charset = $charset; - $this->_charReader = null; - $this->_mapType = 0; - } - - /** - * Set the CharacterReaderFactory for multi charset support. - * @param Swift_CharacterReaderFactory $factory - */ - public function setCharacterReaderFactory(Swift_CharacterReaderFactory $factory) - { - $this->_charReaderFactory = $factory; - } - - /** - * @see Swift_CharacterStream::flushContents() - * - */ - public function flushContents() - { - $this->_datas = null; - $this->_map = null; - $this->_charCount = 0; - $this->_currentPos = 0; - $this->_datasSize = 0; - } - - /** - * @see Swift_CharacterStream::importByteStream() - * - * @param Swift_OutputByteStream $os - */ - public function importByteStream(Swift_OutputByteStream $os) - { - $this->flushContents(); - $blocks=512; - $os->setReadPointer(0); - while(false!==($read = $os->read($blocks))) - $this->write($read); - } - - /** - * @see Swift_CharacterStream::importString() - * - * @param string $string - */ - public function importString($string) - { - $this->flushContents(); - $this->write($string); - } - - /** - * @see Swift_CharacterStream::read() - * - * @param int $length - * @return string - */ - public function read($length) - { - if ($this->_currentPos>=$this->_charCount) { - return false; - } - $ret=false; - $length = ($this->_currentPos+$length > $this->_charCount) - ? $this->_charCount - $this->_currentPos - : $length; - switch ($this->_mapType) { - case Swift_CharacterReader::MAP_TYPE_FIXED_LEN: - $len = $length*$this->_map; - $ret = substr($this->_datas, - $this->_currentPos * $this->_map, - $len); - $this->_currentPos += $length; - break; - - case Swift_CharacterReader::MAP_TYPE_INVALID: - $end = $this->_currentPos + $length; - $end = $end > $this->_charCount - ?$this->_charCount - :$end; - $ret = ''; - for (; $this->_currentPos < $length; ++$this->_currentPos) { - if (isset ($this->_map[$this->_currentPos])) { - $ret .= '?'; - } else { - $ret .= $this->_datas[$this->_currentPos]; - } - } - break; - - case Swift_CharacterReader::MAP_TYPE_POSITIONS: - $end = $this->_currentPos + $length; - $end = $end > $this->_charCount - ?$this->_charCount - :$end; - $ret = ''; - $start = 0; - if ($this->_currentPos>0) { - $start = $this->_map['p'][$this->_currentPos-1]; - } - $to = $start; - for (; $this->_currentPos < $end; ++$this->_currentPos) { - if (isset($this->_map['i'][$this->_currentPos])) { - $ret .= substr($this->_datas, $start, $to - $start).'?'; - $start = $this->_map['p'][$this->_currentPos]; - } else { - $to = $this->_map['p'][$this->_currentPos]; - } - } - $ret .= substr($this->_datas, $start, $to - $start); - break; - } - - return $ret; - } - - /** - * @see Swift_CharacterStream::readBytes() - * - * @param int $length - * @return int[] - */ - public function readBytes($length) - { - $read=$this->read($length); - if ($read!==false) { - $ret = array_map('ord', str_split($read, 1)); - - return $ret; - } - - return false; - } - - /** - * @see Swift_CharacterStream::setPointer() - * - * @param int $charOffset - */ - public function setPointer($charOffset) - { - if ($this->_charCount<$charOffset) { - $charOffset=$this->_charCount; - } - $this->_currentPos = $charOffset; - } - - /** - * @see Swift_CharacterStream::write() - * - * @param string $chars - */ - public function write($chars) - { - if (!isset($this->_charReader)) { - $this->_charReader = $this->_charReaderFactory->getReaderFor( - $this->_charset); - $this->_map = array(); - $this->_mapType = $this->_charReader->getMapType(); - } - $ignored=''; - $this->_datas .= $chars; - $this->_charCount += $this->_charReader->getCharPositions(substr($this->_datas, $this->_datasSize), $this->_datasSize, $this->_map, $ignored); - if ($ignored!==false) { - $this->_datasSize=strlen($this->_datas)-strlen($ignored); - } else { - $this->_datasSize=strlen($this->_datas); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ConfigurableSpool.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ConfigurableSpool.php deleted file mode 100644 index 1c7d59f..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ConfigurableSpool.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Base class for Spools (implements time and message limits). - * @package Swift - * @author Fabien Potencier - */ -abstract class Swift_ConfigurableSpool implements Swift_Spool -{ - /** The maximum number of messages to send per flush */ - private $_message_limit; - - /** The time limit per flush */ - private $_time_limit; - - /** - * Sets the maximum number of messages to send per flush. - * @param int $limit The limit - */ - public function setMessageLimit($limit) - { - $this->_message_limit = (int) $limit; - } - - /** - * Gets the maximum number of messages to send per flush. - * @return int The limit - */ - public function getMessageLimit() - { - return $this->_message_limit; - } - - /** - * Sets the time limit (in seconds) per flush. - * @param int $limit The limit - */ - public function setTimeLimit($limit) - { - $this->_time_limit = (int) $limit; - } - - /** - * Gets the time limit (in seconds) per flush. - * @return int The limit - */ - public function getTimeLimit() - { - return $this->_time_limit; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php deleted file mode 100644 index 5f5f914..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php +++ /dev/null @@ -1,341 +0,0 @@ -_store); - } - - /** - * Test if an item is registered in this container with the given name. - * @param string $itemName - * @return boolean - * @see register() - */ - public function has($itemName) - { - return array_key_exists($itemName, $this->_store) - && isset($this->_store[$itemName]['lookupType']); - } - - /** - * Lookup the item with the given $itemName. - * @param string $itemName - * @return mixed - * @throws Swift_DependencyException If the dependency is not found - * @see register() - */ - public function lookup($itemName) - { - if (!$this->has($itemName)) { - throw new Swift_DependencyException( - 'Cannot lookup dependency "' . $itemName . '" since it is not registered.' - ); - } - - switch ($this->_store[$itemName]['lookupType']) { - case self::TYPE_ALIAS: - return $this->_createAlias($itemName); - case self::TYPE_VALUE: - return $this->_getValue($itemName); - case self::TYPE_INSTANCE: - return $this->_createNewInstance($itemName); - case self::TYPE_SHARED: - return $this->_createSharedInstance($itemName); - } - } - - /** - * Create an array of arguments passed to the constructor of $itemName. - * @param string $itemName - * @return array - */ - public function createDependenciesFor($itemName) - { - $args = array(); - if (isset($this->_store[$itemName]['args'])) { - $args = $this->_resolveArgs($this->_store[$itemName]['args']); - } - - return $args; - } - - /** - * Register a new dependency with $itemName. - * This method returns the current DependencyContainer instance because it - * requires the use of the fluid interface to set the specific details for the - * dependency. - * - * @param string $itemName - * @return Swift_DependencyContainer - * @see asNewInstanceOf(), asSharedInstanceOf(), asValue() - */ - public function register($itemName) - { - $this->_store[$itemName] = array(); - $this->_endPoint =& $this->_store[$itemName]; - - return $this; - } - - /** - * Specify the previously registered item as a literal value. - * {@link register()} must be called before this will work. - * - * @param mixed $value - * @return Swift_DependencyContainer - */ - public function asValue($value) - { - $endPoint =& $this->_getEndPoint(); - $endPoint['lookupType'] = self::TYPE_VALUE; - $endPoint['value'] = $value; - - return $this; - } - - /** - * Specify the previously registered item as an alias of another item. - * @param string $lookup - * @return Swift_DependencyContainer - */ - public function asAliasOf($lookup) - { - $endPoint =& $this->_getEndPoint(); - $endPoint['lookupType'] = self::TYPE_ALIAS; - $endPoint['ref'] = $lookup; - - return $this; - } - - /** - * Specify the previously registered item as a new instance of $className. - * {@link register()} must be called before this will work. - * Any arguments can be set with {@link withDependencies()}, - * {@link addConstructorValue()} or {@link addConstructorLookup()}. - * - * @param string $className - * @return Swift_DependencyContainer - * @see withDependencies(), addConstructorValue(), addConstructorLookup() - */ - public function asNewInstanceOf($className) - { - $endPoint =& $this->_getEndPoint(); - $endPoint['lookupType'] = self::TYPE_INSTANCE; - $endPoint['className'] = $className; - - return $this; - } - - /** - * Specify the previously registered item as a shared instance of $className. - * {@link register()} must be called before this will work. - * @param string $className - * @return Swift_DependencyContainer - */ - public function asSharedInstanceOf($className) - { - $endPoint =& $this->_getEndPoint(); - $endPoint['lookupType'] = self::TYPE_SHARED; - $endPoint['className'] = $className; - - return $this; - } - - /** - * Specify a list of injected dependencies for the previously registered item. - * This method takes an array of lookup names. - * - * @param array $lookups - * @return Swift_DependencyContainer - * @see addConstructorValue(), addConstructorLookup() - */ - public function withDependencies(array $lookups) - { - $endPoint =& $this->_getEndPoint(); - $endPoint['args'] = array(); - foreach ($lookups as $lookup) { - $this->addConstructorLookup($lookup); - } - - return $this; - } - - /** - * Specify a literal (non looked up) value for the constructor of the - * previously registered item. - * - * @param mixed $value - * @return Swift_DependencyContainer - * @see withDependencies(), addConstructorLookup() - */ - public function addConstructorValue($value) - { - $endPoint =& $this->_getEndPoint(); - if (!isset($endPoint['args'])) { - $endPoint['args'] = array(); - } - $endPoint['args'][] = array('type' => 'value', 'item' => $value); - - return $this; - } - - /** - * Specify a dependency lookup for the constructor of the previously - * registered item. - * - * @param string $lookup - * @return Swift_DependencyContainer - * @see withDependencies(), addConstructorValue() - */ - public function addConstructorLookup($lookup) - { - $endPoint =& $this->_getEndPoint(); - if (!isset($this->_endPoint['args'])) { - $endPoint['args'] = array(); - } - $endPoint['args'][] = array('type' => 'lookup', 'item' => $lookup); - - return $this; - } - - // -- Private methods - - /** Get the literal value with $itemName */ - private function _getValue($itemName) - { - return $this->_store[$itemName]['value']; - } - - /** Resolve an alias to another item */ - private function _createAlias($itemName) - { - return $this->lookup($this->_store[$itemName]['ref']); - } - - /** Create a fresh instance of $itemName */ - private function _createNewInstance($itemName) - { - $reflector = new ReflectionClass($this->_store[$itemName]['className']); - if ($reflector->getConstructor()) { - return $reflector->newInstanceArgs( - $this->createDependenciesFor($itemName) - ); - } else { - return $reflector->newInstance(); - } - } - - /** Create and register a shared instance of $itemName */ - private function _createSharedInstance($itemName) - { - if (!isset($this->_store[$itemName]['instance'])) { - $this->_store[$itemName]['instance'] = $this->_createNewInstance($itemName); - } - - return $this->_store[$itemName]['instance']; - } - - /** Get the current endpoint in the store */ - private function &_getEndPoint() - { - if (!isset($this->_endPoint)) { - throw new BadMethodCallException( - 'Component must first be registered by calling register()' - ); - } - - return $this->_endPoint; - } - - /** Get an argument list with dependencies resolved */ - private function _resolveArgs(array $args) - { - $resolved = array(); - foreach ($args as $argDefinition) { - switch ($argDefinition['type']) { - case 'lookup': - $resolved[] = $this->_lookupRecursive($argDefinition['item']); - break; - case 'value': - $resolved[] = $argDefinition['item']; - break; - } - } - - return $resolved; - } - - /** Resolve a single dependency with an collections */ - private function _lookupRecursive($item) - { - if (is_array($item)) { - $collection = array(); - foreach ($item as $k => $v) { - $collection[$k] = $this->_lookupRecursive($v); - } - - return $collection; - } else { - return $this->lookup($item); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyException.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyException.php deleted file mode 100644 index e048438..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyException.php +++ /dev/null @@ -1,26 +0,0 @@ -createDependenciesFor('mime.embeddedfile') - ); - - $this->setBody($data); - $this->setFilename($filename); - if ($contentType) { - $this->setContentType($contentType); - } - } - - /** - * Create a new EmbeddedFile. - * @param string|Swift_OutputByteStream $data - * @param string $filename - * @param string $contentType - * @return Swift_Mime_EmbeddedFile - */ - public static function newInstance($data = null, $filename = null, $contentType = null) - { - return new self($data, $filename, $contentType); - } - - /** - * Create a new EmbeddedFile from a filesystem path. - * @param string $path - * @return Swift_Mime_EmbeddedFile - */ - public static function fromPath($path) - { - return self::newInstance()->setFile( - new Swift_ByteStream_FileByteStream($path) - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder.php deleted file mode 100644 index ff9807d..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder.php +++ /dev/null @@ -1,27 +0,0 @@ -= $maxLineLength || 76 < $maxLineLength) { - $maxLineLength = 76; - } - - $encodedString = base64_encode($string); - $firstLine = ''; - - if (0 != $firstLineOffset) { - $firstLine = substr( - $encodedString, 0, $maxLineLength - $firstLineOffset - ) . "\r\n"; - $encodedString = substr( - $encodedString, $maxLineLength - $firstLineOffset - ); - } - - return $firstLine . trim(chunk_split($encodedString, $maxLineLength, "\r\n")); - } - - /** - * Does nothing. - */ - public function charsetChanged($charset) - { - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/QpEncoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/QpEncoder.php deleted file mode 100644 index 746d68e..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/QpEncoder.php +++ /dev/null @@ -1,275 +0,0 @@ - '=00', 1 => '=01', 2 => '=02', 3 => '=03', 4 => '=04', - 5 => '=05', 6 => '=06', 7 => '=07', 8 => '=08', 9 => '=09', - 10 => '=0A', 11 => '=0B', 12 => '=0C', 13 => '=0D', 14 => '=0E', - 15 => '=0F', 16 => '=10', 17 => '=11', 18 => '=12', 19 => '=13', - 20 => '=14', 21 => '=15', 22 => '=16', 23 => '=17', 24 => '=18', - 25 => '=19', 26 => '=1A', 27 => '=1B', 28 => '=1C', 29 => '=1D', - 30 => '=1E', 31 => '=1F', 32 => '=20', 33 => '=21', 34 => '=22', - 35 => '=23', 36 => '=24', 37 => '=25', 38 => '=26', 39 => '=27', - 40 => '=28', 41 => '=29', 42 => '=2A', 43 => '=2B', 44 => '=2C', - 45 => '=2D', 46 => '=2E', 47 => '=2F', 48 => '=30', 49 => '=31', - 50 => '=32', 51 => '=33', 52 => '=34', 53 => '=35', 54 => '=36', - 55 => '=37', 56 => '=38', 57 => '=39', 58 => '=3A', 59 => '=3B', - 60 => '=3C', 61 => '=3D', 62 => '=3E', 63 => '=3F', 64 => '=40', - 65 => '=41', 66 => '=42', 67 => '=43', 68 => '=44', 69 => '=45', - 70 => '=46', 71 => '=47', 72 => '=48', 73 => '=49', 74 => '=4A', - 75 => '=4B', 76 => '=4C', 77 => '=4D', 78 => '=4E', 79 => '=4F', - 80 => '=50', 81 => '=51', 82 => '=52', 83 => '=53', 84 => '=54', - 85 => '=55', 86 => '=56', 87 => '=57', 88 => '=58', 89 => '=59', - 90 => '=5A', 91 => '=5B', 92 => '=5C', 93 => '=5D', 94 => '=5E', - 95 => '=5F', 96 => '=60', 97 => '=61', 98 => '=62', 99 => '=63', - 100 => '=64', 101 => '=65', 102 => '=66', 103 => '=67', 104 => '=68', - 105 => '=69', 106 => '=6A', 107 => '=6B', 108 => '=6C', 109 => '=6D', - 110 => '=6E', 111 => '=6F', 112 => '=70', 113 => '=71', 114 => '=72', - 115 => '=73', 116 => '=74', 117 => '=75', 118 => '=76', 119 => '=77', - 120 => '=78', 121 => '=79', 122 => '=7A', 123 => '=7B', 124 => '=7C', - 125 => '=7D', 126 => '=7E', 127 => '=7F', 128 => '=80', 129 => '=81', - 130 => '=82', 131 => '=83', 132 => '=84', 133 => '=85', 134 => '=86', - 135 => '=87', 136 => '=88', 137 => '=89', 138 => '=8A', 139 => '=8B', - 140 => '=8C', 141 => '=8D', 142 => '=8E', 143 => '=8F', 144 => '=90', - 145 => '=91', 146 => '=92', 147 => '=93', 148 => '=94', 149 => '=95', - 150 => '=96', 151 => '=97', 152 => '=98', 153 => '=99', 154 => '=9A', - 155 => '=9B', 156 => '=9C', 157 => '=9D', 158 => '=9E', 159 => '=9F', - 160 => '=A0', 161 => '=A1', 162 => '=A2', 163 => '=A3', 164 => '=A4', - 165 => '=A5', 166 => '=A6', 167 => '=A7', 168 => '=A8', 169 => '=A9', - 170 => '=AA', 171 => '=AB', 172 => '=AC', 173 => '=AD', 174 => '=AE', - 175 => '=AF', 176 => '=B0', 177 => '=B1', 178 => '=B2', 179 => '=B3', - 180 => '=B4', 181 => '=B5', 182 => '=B6', 183 => '=B7', 184 => '=B8', - 185 => '=B9', 186 => '=BA', 187 => '=BB', 188 => '=BC', 189 => '=BD', - 190 => '=BE', 191 => '=BF', 192 => '=C0', 193 => '=C1', 194 => '=C2', - 195 => '=C3', 196 => '=C4', 197 => '=C5', 198 => '=C6', 199 => '=C7', - 200 => '=C8', 201 => '=C9', 202 => '=CA', 203 => '=CB', 204 => '=CC', - 205 => '=CD', 206 => '=CE', 207 => '=CF', 208 => '=D0', 209 => '=D1', - 210 => '=D2', 211 => '=D3', 212 => '=D4', 213 => '=D5', 214 => '=D6', - 215 => '=D7', 216 => '=D8', 217 => '=D9', 218 => '=DA', 219 => '=DB', - 220 => '=DC', 221 => '=DD', 222 => '=DE', 223 => '=DF', 224 => '=E0', - 225 => '=E1', 226 => '=E2', 227 => '=E3', 228 => '=E4', 229 => '=E5', - 230 => '=E6', 231 => '=E7', 232 => '=E8', 233 => '=E9', 234 => '=EA', - 235 => '=EB', 236 => '=EC', 237 => '=ED', 238 => '=EE', 239 => '=EF', - 240 => '=F0', 241 => '=F1', 242 => '=F2', 243 => '=F3', 244 => '=F4', - 245 => '=F5', 246 => '=F6', 247 => '=F7', 248 => '=F8', 249 => '=F9', - 250 => '=FA', 251 => '=FB', 252 => '=FC', 253 => '=FD', 254 => '=FE', - 255 => '=FF' - ); - - protected static $_safeMapShare = array(); - - /** - * A map of non-encoded ascii characters. - * @var string[] - * @access protected - */ - protected $_safeMap = array(); - - /** - * Creates a new QpEncoder for the given CharacterStream. - * @param Swift_CharacterStream $charStream to use for reading characters - * @param Swift_StreamFilter $filter if input should be canonicalized - */ - public function __construct(Swift_CharacterStream $charStream, Swift_StreamFilter $filter = null) - { - $this->_charStream = $charStream; - if (!isset(self::$_safeMapShare[$this->getSafeMapShareId()])) { - $this->initSafeMap(); - self::$_safeMapShare[$this->getSafeMapShareId()] = $this->_safeMap; - } else { - $this->_safeMap = self::$_safeMapShare[$this->getSafeMapShareId()]; - } - $this->_filter = $filter; - } - - public function __sleep() - { - return array('_charStream', '_filter'); - } - - public function __wakeup() - { - if (!isset(self::$_safeMapShare[$this->getSafeMapShareId()])) { - $this->initSafeMap(); - self::$_safeMapShare[$this->getSafeMapShareId()] = $this->_safeMap; - } else { - $this->_safeMap = self::$_safeMapShare[$this->getSafeMapShareId()]; - } - } - - protected function getSafeMapShareId() - { - return get_class($this); - } - - protected function initSafeMap() - { - foreach (array_merge( - array(0x09, 0x20), range(0x21, 0x3C), range(0x3E, 0x7E)) as $byte) - { - $this->_safeMap[$byte] = chr($byte); - } - } - - /** - * Takes an unencoded string and produces a QP encoded string from it. - * QP encoded strings have a maximum line length of 76 characters. - * If the first line needs to be shorter, indicate the difference with - * $firstLineOffset. - * @param string $string to encode - * @param int $firstLineOffset, optional - * @param int $maxLineLength, optional, 0 indicates the default of 76 chars - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) - { - if ($maxLineLength > 76 || $maxLineLength <= 0) { - $maxLineLength = 76; - } - - $thisLineLength = $maxLineLength - $firstLineOffset; - - $lines = array(); - $lNo = 0; - $lines[$lNo] = ''; - $currentLine =& $lines[$lNo++]; - $size=$lineLen=0; - - $this->_charStream->flushContents(); - $this->_charStream->importString($string); - - //Fetching more than 4 chars at one is slower, as is fetching fewer bytes - // Conveniently 4 chars is the UTF-8 safe number since UTF-8 has up to 6 - // bytes per char and (6 * 4 * 3 = 72 chars per line) * =NN is 3 bytes - while (false !== $bytes = $this->_nextSequence()) { - //If we're filtering the input - if (isset($this->_filter)) { - //If we can't filter because we need more bytes - while ($this->_filter->shouldBuffer($bytes)) { - //Then collect bytes into the buffer - if (false === $moreBytes = $this->_nextSequence(1)) { - break; - } - - foreach ($moreBytes as $b) { - $bytes[] = $b; - } - } - //And filter them - $bytes = $this->_filter->filter($bytes); - } - - $enc = $this->_encodeByteSequence($bytes, $size); - if ($currentLine && $lineLen+$size >= $thisLineLength) { - $lines[$lNo] = ''; - $currentLine =& $lines[$lNo++]; - $thisLineLength = $maxLineLength; - $lineLen=0; - } - $lineLen+=$size; - $currentLine .= $enc; - } - - return $this->_standardize(implode("=\r\n", $lines)); - } - - /** - * Updates the charset used. - * @param string $charset - */ - public function charsetChanged($charset) - { - $this->_charStream->setCharacterSet($charset); - } - - // -- Protected methods - - /** - * Encode the given byte array into a verbatim QP form. - * @param int[] $bytes - * @return string - * @access protected - */ - protected function _encodeByteSequence(array $bytes, &$size) - { - $ret = ''; - $size=0; - foreach ($bytes as $b) { - if (isset($this->_safeMap[$b])) { - $ret .= $this->_safeMap[$b]; - ++$size; - } else { - $ret .= self::$_qpMap[$b]; - $size+=3; - } - } - - return $ret; - } - - /** - * Get the next sequence of bytes to read from the char stream. - * @param int $size number of bytes to read - * @return int[] - * @access protected - */ - protected function _nextSequence($size = 4) - { - return $this->_charStream->readBytes($size); - } - - /** - * Make sure CRLF is correct and HT/SPACE are in valid places. - * @param string $string - * @return string - * @access protected - */ - protected function _standardize($string) - { - $string = str_replace(array("\t=0D=0A", " =0D=0A", "=0D=0A"), - array("=09\r\n", "=20\r\n", "\r\n"), $string - ); - switch ($end = ord(substr($string, -1))) { - case 0x09: - case 0x20: - $string = substr_replace($string, self::$_qpMap[$end], -1); - } - - return $string; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Rfc2231Encoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Rfc2231Encoder.php deleted file mode 100644 index 180abeb..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Rfc2231Encoder.php +++ /dev/null @@ -1,81 +0,0 @@ -_charStream = $charStream; - } - - /** - * Takes an unencoded string and produces a string encoded according to - * RFC 2231 from it. - * @param string $string to encode - * @param int $firstLineOffset - * @param int $maxLineLength, optional, 0 indicates the default of 75 bytes - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) - { - $lines = array(); $lineCount = 0; - $lines[] = ''; - $currentLine =& $lines[$lineCount++]; - - if (0 >= $maxLineLength) { - $maxLineLength = 75; - } - - $this->_charStream->flushContents(); - $this->_charStream->importString($string); - - $thisLineLength = $maxLineLength - $firstLineOffset; - - while (false !== $char = $this->_charStream->read(4)) { - $encodedChar = rawurlencode($char); - if (0 != strlen($currentLine) - && strlen($currentLine . $encodedChar) > $thisLineLength) - { - $lines[] = ''; - $currentLine =& $lines[$lineCount++]; - $thisLineLength = $maxLineLength; - } - $currentLine .= $encodedChar; - } - - return implode("\r\n", $lines); - } - - /** - * Updates the charset used. - * @param string $charset - */ - public function charsetChanged($charset) - { - $this->_charStream->setCharacterSet($charset); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoding.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoding.php deleted file mode 100644 index 6dd753e..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoding.php +++ /dev/null @@ -1,66 +0,0 @@ -lookup($key); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandEvent.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandEvent.php deleted file mode 100644 index 629976a..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandEvent.php +++ /dev/null @@ -1,61 +0,0 @@ -_command = $command; - $this->_successCodes = $successCodes; - } - - /** - * Get the command which was sent to the server. - * @return string - */ - public function getCommand() - { - return $this->_command; - } - - /** - * Get the numeric response codes which indicate success for this command. - * @return int[] - */ - public function getSuccessCodes() - { - return $this->_successCodes; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandListener.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandListener.php deleted file mode 100644 index b714236..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandListener.php +++ /dev/null @@ -1,24 +0,0 @@ -_source = $source; - } - - /** - * Get the source object of this event. - * @return object - */ - public function getSource() - { - return $this->_source; - } - - /** - * Prevent this Event from bubbling any further up the stack. - * @param boolean $cancel, optional - */ - public function cancelBubble($cancel = true) - { - $this->_bubbleCancelled = $cancel; - } - - /** - * Returns true if this Event will not bubble any further up the stack. - * @return boolean - */ - public function bubbleCancelled() - { - return $this->_bubbleCancelled; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseEvent.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseEvent.php deleted file mode 100644 index 737d064..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseEvent.php +++ /dev/null @@ -1,62 +0,0 @@ -_response = $response; - $this->_valid = $valid; - } - - /** - * Get the response which was received from the server. - * @return string - */ - public function getResponse() - { - return $this->_response; - } - - /** - * Get the success status of this Event. - * @return boolean - */ - public function isValid() - { - return $this->_valid; - } - -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseListener.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseListener.php deleted file mode 100644 index c34def8..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseListener.php +++ /dev/null @@ -1,24 +0,0 @@ -_message = $message; - $this->_result = self::RESULT_PENDING; - } - - /** - * Get the Transport used to send the Message. - * @return Swift_Transport - */ - public function getTransport() - { - return $this->getSource(); - } - - /** - * Get the Message being sent. - * @return Swift_Mime_Message - */ - public function getMessage() - { - return $this->_message; - } - - /** - * Set the array of addresses that failed in sending. - * @param array $recipients - */ - public function setFailedRecipients($recipients) - { - $this->_failedRecipients = $recipients; - } - - /** - * Get an recipient addresses which were not accepted for delivery. - * @return string[] - */ - public function getFailedRecipients() - { - return $this->_failedRecipients; - } - - /** - * Set the result of sending. - * @return int - */ - public function setResult($result) - { - $this->_result = $result; - } - - /** - * Get the result of this Event. - * The return value is a bitmask from - * {@link RESULT_PENDING, RESULT_SUCCESS, RESULT_TENTATIVE, RESULT_FAILED} - * @return int - */ - public function getResult() - { - return $this->_result; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SendListener.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SendListener.php deleted file mode 100644 index 5585dc8..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SendListener.php +++ /dev/null @@ -1,30 +0,0 @@ -_eventMap = array( - 'Swift_Events_CommandEvent' => 'Swift_Events_CommandListener', - 'Swift_Events_ResponseEvent' => 'Swift_Events_ResponseListener', - 'Swift_Events_SendEvent' => 'Swift_Events_SendListener', - 'Swift_Events_TransportChangeEvent' => 'Swift_Events_TransportChangeListener', - 'Swift_Events_TransportExceptionEvent' => 'Swift_Events_TransportExceptionListener' - ); - } - - /** - * Create a new SendEvent for $source and $message. - * - * @param Swift_Transport $source - * @param Swift_Mime_Message - * @return Swift_Events_SendEvent - */ - public function createSendEvent(Swift_Transport $source, Swift_Mime_Message $message) - { - return new Swift_Events_SendEvent($source, $message); - } - - /** - * Create a new CommandEvent for $source and $command. - * - * @param Swift_Transport $source - * @param string $command That will be executed - * @param array $successCodes That are needed - * @return Swift_Events_CommandEvent - */ - public function createCommandEvent(Swift_Transport $source, $command, $successCodes = array()) - { - return new Swift_Events_CommandEvent($source, $command, $successCodes); - } - - /** - * Create a new ResponseEvent for $source and $response. - * - * @param Swift_Transport $source - * @param string $response - * @param boolean $valid If the response is valid - * @return Swift_Events_ResponseEvent - */ - public function createResponseEvent(Swift_Transport $source, $response, $valid) - { - return new Swift_Events_ResponseEvent($source, $response, $valid); - } - - /** - * Create a new TransportChangeEvent for $source. - * - * @param Swift_Transport $source - * @return Swift_Events_TransportChangeEvent - */ - public function createTransportChangeEvent(Swift_Transport $source) - { - return new Swift_Events_TransportChangeEvent($source); - } - - /** - * Create a new TransportExceptionEvent for $source. - * - * @param Swift_Transport $source - * @param Swift_TransportException $ex - * @return Swift_Events_TransportExceptionEvent - */ - public function createTransportExceptionEvent(Swift_Transport $source, Swift_TransportException $ex) - { - return new Swift_Events_TransportExceptionEvent($source, $ex); - } - - /** - * Bind an event listener to this dispatcher. - * - * @param Swift_Events_EventListener $listener - */ - public function bindEventListener(Swift_Events_EventListener $listener) - { - foreach ($this->_listeners as $l) { - //Already loaded - if ($l === $listener) { - return; - } - } - $this->_listeners[] = $listener; - } - - /** - * Dispatch the given Event to all suitable listeners. - * - * @param Swift_Events_EventObject $evt - * @param string $target method - */ - public function dispatchEvent(Swift_Events_EventObject $evt, $target) - { - $this->_prepareBubbleQueue($evt); - $this->_bubble($evt, $target); - } - - // -- Private methods - - /** Queue listeners on a stack ready for $evt to be bubbled up it */ - private function _prepareBubbleQueue(Swift_Events_EventObject $evt) - { - $this->_bubbleQueue = array(); - $evtClass = get_class($evt); - foreach ($this->_listeners as $listener) { - if (array_key_exists($evtClass, $this->_eventMap) - && ($listener instanceof $this->_eventMap[$evtClass])) - { - $this->_bubbleQueue[] = $listener; - } - } - } - - /** Bubble $evt up the stack calling $target() on each listener */ - private function _bubble(Swift_Events_EventObject $evt, $target) - { - if (!$evt->bubbleCancelled() && $listener = array_shift($this->_bubbleQueue)) { - $listener->$target($evt); - $this->_bubble($evt, $target); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeEvent.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeEvent.php deleted file mode 100644 index 6a7d2f7..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeEvent.php +++ /dev/null @@ -1,27 +0,0 @@ -getSource(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeListener.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeListener.php deleted file mode 100644 index fa1a717..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeListener.php +++ /dev/null @@ -1,48 +0,0 @@ -_exception = $ex; - } - - /** - * Get the TransportException thrown. - * @return Swift_TransportException - */ - public function getException() - { - return $this->_exception; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportExceptionListener.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportExceptionListener.php deleted file mode 100644 index 14ed927..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportExceptionListener.php +++ /dev/null @@ -1,24 +0,0 @@ -createDependenciesFor('transport.failover') - ); - - $this->setTransports($transports); - } - - /** - * Create a new FailoverTransport instance. - * @param string $transports - * @return Swift_FailoverTransport - */ - public static function newInstance($transports = array()) - { - return new self($transports); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileSpool.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileSpool.php deleted file mode 100644 index 7e80a44..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileSpool.php +++ /dev/null @@ -1,190 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Stores Messages on the filesystem. - * @package Swift - * @author Fabien Potencier - * @author Xavier De Cock - */ -class Swift_FileSpool extends Swift_ConfigurableSpool -{ - /** The spool directory */ - private $_path; - - /** - * File WriteRetry Limit - * @var int - */ - private $_retryLimit=10; - - /** - * Create a new FileSpool. - * @param string $path - * @throws Swift_IoException - */ - public function __construct($path) - { - $this->_path = $path; - - if (!file_exists($this->_path)) { - if (!mkdir($this->_path, 0777, true)) { - throw new Swift_IoException('Unable to create Path ['.$this->_path.']'); - } - } - } - - /** - * Tests if this Spool mechanism has started. - * - * @return boolean - */ - public function isStarted() - { - return true; - } - - /** - * Starts this Spool mechanism. - */ - public function start() - { - } - - /** - * Stops this Spool mechanism. - */ - public function stop() - { - } - - /** - * Allow to manage the enqueuing retry limit. - * Default, is ten and allows over 64^20 different fileNames - * - * @param integer $limit - */ - public function setRetryLimit($limit) - { - $this->_retryLimit=$limit; - } - - /** - * Queues a message. - * @param Swift_Mime_Message $message The message to store - * @return boolean - * @throws Swift_IoException - */ - public function queueMessage(Swift_Mime_Message $message) - { - $ser = serialize($message); - $fileName=$this->_path.'/'.$this->getRandomString(10); - for ($i = 0; $i < $this->_retryLimit; ++$i) { - /* We try an exclusive creation of the file. This is an atomic operation, it avoid locking mechanism */ - $fp = @fopen($fileName.'.message', 'x'); - if (false !== $fp) { - if (false === fwrite($fp, $ser)) { - return false; - } - - return fclose($fp); - } else { - /* The file allready exists, we try a longer fileName */ - $fileName.=$this->getRandomString(1); - } - } - - throw new Swift_IoException('Unable to create a file for enqueuing Message'); - } - - /** - * Execute a recovery if for anyreason a process is sending for too long - * - * @param int $timeout in second Defaults is for very slow smtp responses - */ - public function recover($timeout=900) - { - foreach (new DirectoryIterator($this->_path) as $file) { - $file = $file->getRealPath(); - - if (substr($file, -16)=='.message.sending') { - $lockedtime=filectime($file); - if ((time()-$lockedtime)>$timeout) { - rename($file, substr($file, 0, -8)); - } - } - } - } - - /** - * Sends messages using the given transport instance. - * - * @param Swift_Transport $transport A transport instance - * @param string[] &$failedRecipients An array of failures by-reference - * - * @return int The number of sent emails - */ - public function flushQueue(Swift_Transport $transport, &$failedRecipients = null) - { - if (!$transport->isStarted()) { - $transport->start(); - } - - $failedRecipients = (array) $failedRecipients; - $count = 0; - $time = time(); - foreach (new DirectoryIterator($this->_path) as $file) { - $file = $file->getRealPath(); - - if (substr($file, -8) != '.message') { - continue; - } - - /* We try a rename, it's an atomic operation, and avoid locking the file */ - if (rename($file, $file.'.sending')) { - $message = unserialize(file_get_contents($file.'.sending')); - - $count += $transport->send($message, $failedRecipients); - - unlink($file.'.sending'); - } else { - /* This message has just been catched by another process */ - continue; - } - - if ($this->getMessageLimit() && $count >= $this->getMessageLimit()) { - break; - } - - if ($this->getTimeLimit() && (time() - $time) >= $this->getTimeLimit()) { - break; - } - } - - return $count; - } - - /** - * Returns a random string needed to generate a fileName for the queue. - * @param int $count - */ - protected function getRandomString($count) - { - // This string MUST stay FS safe, avoid special chars - $base="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-."; - $ret=''; - $strlen=strlen($base); - for ($i=0; $i<$count; ++$i) { - $ret.=$base[((int) rand(0,$strlen-1))]; - } - - return $ret; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileStream.php deleted file mode 100644 index 0faeb52..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileStream.php +++ /dev/null @@ -1,24 +0,0 @@ -setFile( - new Swift_ByteStream_FileByteStream($path) - ); - - return $image; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/InputByteStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/InputByteStream.php deleted file mode 100644 index 8627183..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/InputByteStream.php +++ /dev/null @@ -1,70 +0,0 @@ -_stream = $stream; - } - - /** - * Set a string into the cache under $itemKey for the namespace $nsKey. - * @param string $nsKey - * @param string $itemKey - * @param string $string - * @param int $mode - * @see MODE_WRITE, MODE_APPEND - */ - public function setString($nsKey, $itemKey, $string, $mode) - { - $this->_prepareCache($nsKey); - switch ($mode) { - case self::MODE_WRITE: - $this->_contents[$nsKey][$itemKey] = $string; - break; - case self::MODE_APPEND: - if (!$this->hasKey($nsKey, $itemKey)) { - $this->_contents[$nsKey][$itemKey] = ''; - } - $this->_contents[$nsKey][$itemKey] .= $string; - break; - default: - throw new Swift_SwiftException( - 'Invalid mode [' . $mode . '] used to set nsKey='. - $nsKey . ', itemKey=' . $itemKey - ); - } - } - - /** - * Set a ByteStream into the cache under $itemKey for the namespace $nsKey. - * @param string $nsKey - * @param string $itemKey - * @param Swift_OutputByteStream $os - * @param int $mode - * @see MODE_WRITE, MODE_APPEND - */ - public function importFromByteStream($nsKey, $itemKey, Swift_OutputByteStream $os, $mode) - { - $this->_prepareCache($nsKey); - switch ($mode) { - case self::MODE_WRITE: - $this->clearKey($nsKey, $itemKey); - case self::MODE_APPEND: - if (!$this->hasKey($nsKey, $itemKey)) { - $this->_contents[$nsKey][$itemKey] = ''; - } - while (false !== $bytes = $os->read(8192)) { - $this->_contents[$nsKey][$itemKey] .= $bytes; - } - break; - default: - throw new Swift_SwiftException( - 'Invalid mode [' . $mode . '] used to set nsKey='. - $nsKey . ', itemKey=' . $itemKey - ); - } - } - - /** - * Provides a ByteStream which when written to, writes data to $itemKey. - * NOTE: The stream will always write in append mode. - * @param string $nsKey - * @param string $itemKey - * @return Swift_InputByteStream - */ - public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $writeThrough = null) - { - $is = clone $this->_stream; - $is->setKeyCache($this); - $is->setNsKey($nsKey); - $is->setItemKey($itemKey); - if (isset($writeThrough)) { - $is->setWriteThroughStream($writeThrough); - } - - return $is; - } - - /** - * Get data back out of the cache as a string. - * @param string $nsKey - * @param string $itemKey - * @return string - */ - public function getString($nsKey, $itemKey) - { - $this->_prepareCache($nsKey); - if ($this->hasKey($nsKey, $itemKey)) { - return $this->_contents[$nsKey][$itemKey]; - } - } - - /** - * Get data back out of the cache as a ByteStream. - * @param string $nsKey - * @param string $itemKey - * @param Swift_InputByteStream $is to write the data to - */ - public function exportToByteStream($nsKey, $itemKey, Swift_InputByteStream $is) - { - $this->_prepareCache($nsKey); - $is->write($this->getString($nsKey, $itemKey)); - } - - /** - * Check if the given $itemKey exists in the namespace $nsKey. - * @param string $nsKey - * @param string $itemKey - * @return boolean - */ - public function hasKey($nsKey, $itemKey) - { - $this->_prepareCache($nsKey); - - return array_key_exists($itemKey, $this->_contents[$nsKey]); - } - - /** - * Clear data for $itemKey in the namespace $nsKey if it exists. - * @param string $nsKey - * @param string $itemKey - */ - public function clearKey($nsKey, $itemKey) - { - unset($this->_contents[$nsKey][$itemKey]); - } - - /** - * Clear all data in the namespace $nsKey if it exists. - * @param string $nsKey - */ - public function clearAll($nsKey) - { - unset($this->_contents[$nsKey]); - } - - // -- Private methods - - /** - * Initialize the namespace of $nsKey if needed. - * @param string $nsKey - * @access private - */ - private function _prepareCache($nsKey) - { - if (!array_key_exists($nsKey, $this->_contents)) { - $this->_contents[$nsKey] = array(); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php deleted file mode 100644 index 0fd7633..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php +++ /dev/null @@ -1,307 +0,0 @@ -_stream = $stream; - $this->_path = $path; - - if (function_exists('get_magic_quotes_runtime') && @get_magic_quotes_runtime() == 1) { - $this->_quotes = true; - } - } - - /** - * Set a string into the cache under $itemKey for the namespace $nsKey. - * @param string $nsKey - * @param string $itemKey - * @param string $string - * @param int $mode - * @throws Swift_IoException - * @see MODE_WRITE, MODE_APPEND - */ - public function setString($nsKey, $itemKey, $string, $mode) - { - $this->_prepareCache($nsKey); - switch ($mode) { - case self::MODE_WRITE: - $fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_START); - break; - case self::MODE_APPEND: - $fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_END); - break; - default: - throw new Swift_SwiftException( - 'Invalid mode [' . $mode . '] used to set nsKey='. - $nsKey . ', itemKey=' . $itemKey - ); - break; - } - fwrite($fp, $string); - $this->_freeHandle($nsKey, $itemKey); - } - - /** - * Set a ByteStream into the cache under $itemKey for the namespace $nsKey. - * @param string $nsKey - * @param string $itemKey - * @param Swift_OutputByteStream $os - * @param int $mode - * @see MODE_WRITE, MODE_APPEND - * @throws Swift_IoException - */ - public function importFromByteStream($nsKey, $itemKey, Swift_OutputByteStream $os, $mode) - { - $this->_prepareCache($nsKey); - switch ($mode) { - case self::MODE_WRITE: - $fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_START); - break; - case self::MODE_APPEND: - $fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_END); - break; - default: - throw new Swift_SwiftException( - 'Invalid mode [' . $mode . '] used to set nsKey='. - $nsKey . ', itemKey=' . $itemKey - ); - break; - } - while (false !== $bytes = $os->read(8192)) { - fwrite($fp, $bytes); - } - $this->_freeHandle($nsKey, $itemKey); - } - - /** - * Provides a ByteStream which when written to, writes data to $itemKey. - * NOTE: The stream will always write in append mode. - * @param string $nsKey - * @param string $itemKey - * @return Swift_InputByteStream - */ - public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $writeThrough = null) - { - $is = clone $this->_stream; - $is->setKeyCache($this); - $is->setNsKey($nsKey); - $is->setItemKey($itemKey); - if (isset($writeThrough)) { - $is->setWriteThroughStream($writeThrough); - } - - return $is; - } - - /** - * Get data back out of the cache as a string. - * @param string $nsKey - * @param string $itemKey - * @return string - * @throws Swift_IoException - */ - public function getString($nsKey, $itemKey) - { - $this->_prepareCache($nsKey); - if ($this->hasKey($nsKey, $itemKey)) { - $fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_START); - if ($this->_quotes) { - ini_set('magic_quotes_runtime', 0); - } - $str = ''; - while (!feof($fp) && false !== $bytes = fread($fp, 8192)) { - $str .= $bytes; - } - if ($this->_quotes) { - ini_set('magic_quotes_runtime', 1); - } - $this->_freeHandle($nsKey, $itemKey); - - return $str; - } - } - - /** - * Get data back out of the cache as a ByteStream. - * @param string $nsKey - * @param string $itemKey - * @param Swift_InputByteStream $is to write the data to - */ - public function exportToByteStream($nsKey, $itemKey, Swift_InputByteStream $is) - { - if ($this->hasKey($nsKey, $itemKey)) { - $fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_START); - if ($this->_quotes) { - ini_set('magic_quotes_runtime', 0); - } - while (!feof($fp) && false !== $bytes = fread($fp, 8192)) { - $is->write($bytes); - } - if ($this->_quotes) { - ini_set('magic_quotes_runtime', 1); - } - $this->_freeHandle($nsKey, $itemKey); - } - } - - /** - * Check if the given $itemKey exists in the namespace $nsKey. - * @param string $nsKey - * @param string $itemKey - * @return boolean - */ - public function hasKey($nsKey, $itemKey) - { - return is_file($this->_path . '/' . $nsKey . '/' . $itemKey); - } - - /** - * Clear data for $itemKey in the namespace $nsKey if it exists. - * @param string $nsKey - * @param string $itemKey - */ - public function clearKey($nsKey, $itemKey) - { - if ($this->hasKey($nsKey, $itemKey)) { - $this->_freeHandle($nsKey, $itemKey); - unlink($this->_path . '/' . $nsKey . '/' . $itemKey); - } - } - - /** - * Clear all data in the namespace $nsKey if it exists. - * @param string $nsKey - */ - public function clearAll($nsKey) - { - if (array_key_exists($nsKey, $this->_keys)) { - foreach ($this->_keys[$nsKey] as $itemKey=>$null) { - $this->clearKey($nsKey, $itemKey); - } - if (is_dir($this->_path . '/' . $nsKey)) { - rmdir($this->_path . '/' . $nsKey); - } - unset($this->_keys[$nsKey]); - } - } - - // -- Private methods - - /** - * Initialize the namespace of $nsKey if needed. - * @param string $nsKey - * @access private - */ - private function _prepareCache($nsKey) - { - $cacheDir = $this->_path . '/' . $nsKey; - if (!is_dir($cacheDir)) { - if (!mkdir($cacheDir)) { - throw new Swift_IoException('Failed to create cache directory ' . $cacheDir); - } - $this->_keys[$nsKey] = array(); - } - } - - /** - * Get a file handle on the cache item. - * @param string $nsKey - * @param string $itemKey - * @param int $position - * @return resource - * @access private - */ - private function _getHandle($nsKey, $itemKey, $position) - { - if (!isset($this->_keys[$nsKey][$itemKey])) { - $openMode = $this->hasKey($nsKey, $itemKey) - ? 'r+b' - : 'w+b' - ; - $fp = fopen($this->_path . '/' . $nsKey . '/' . $itemKey, $openMode); - $this->_keys[$nsKey][$itemKey] = $fp; - } - if (self::POSITION_START == $position) { - fseek($this->_keys[$nsKey][$itemKey], 0, SEEK_SET); - } elseif (self::POSITION_END == $position) { - fseek($this->_keys[$nsKey][$itemKey], 0, SEEK_END); - } - - return $this->_keys[$nsKey][$itemKey]; - } - - private function _freeHandle($nsKey, $itemKey) - { - $fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_CURRENT); - fclose($fp); - $this->_keys[$nsKey][$itemKey] = null; - } - - /** - * Destructor. - */ - public function __destruct() - { - foreach ($this->_keys as $nsKey=>$null) { - $this->clearAll($nsKey); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DummyKeyCache.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DummyKeyCache.php deleted file mode 100644 index a266256..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DummyKeyCache.php +++ /dev/null @@ -1,114 +0,0 @@ -. - - */ - -/** - * A basic KeyCache backed by an array. - * @package Swift - * @subpackage KeyCache - * @author Xavier De Cock - */ -class Swift_KeyCache_DummyKeyCache implements Swift_KeyCache -{ - /** - * Set a string into the cache under $itemKey for the namespace $nsKey. - * @param string $nsKey - * @param string $itemKey - * @param string $string - * @param int $mode - * @see MODE_WRITE, MODE_APPEND - */ - public function setString($nsKey, $itemKey, $string, $mode) - { - } - - /** - * Set a ByteStream into the cache under $itemKey for the namespace $nsKey. - * @param string $nsKey - * @param string $itemKey - * @param Swift_OutputByteStream $os - * @param int $mode - * @see MODE_WRITE, MODE_APPEND - */ - public function importFromByteStream($nsKey, $itemKey, Swift_OutputByteStream $os, $mode) - { - } - - /** - * Provides a ByteStream which when written to, writes data to $itemKey. - * NOTE: The stream will always write in append mode. - * @param string $nsKey - * @param string $itemKey - * @return Swift_InputByteStream - */ - public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $writeThrough = null) - { - return false; - } - - /** - * Get data back out of the cache as a string. - * @param string $nsKey - * @param string $itemKey - * @return string - */ - public function getString($nsKey, $itemKey) - { - return false; - } - - /** - * Get data back out of the cache as a ByteStream. - * @param string $nsKey - * @param string $itemKey - * @param Swift_InputByteStream $is to write the data to - */ - public function exportToByteStream($nsKey, $itemKey, Swift_InputByteStream $is) - { - return false; - } - - /** - * Check if the given $itemKey exists in the namespace $nsKey. - * @param string $nsKey - * @param string $itemKey - * @return boolean - */ - public function hasKey($nsKey, $itemKey) - { - return false; - } - - /** - * Clear data for $itemKey in the namespace $nsKey if it exists. - * @param string $nsKey - * @param string $itemKey - */ - public function clearKey($nsKey, $itemKey) - { - } - - /** - * Clear all data in the namespace $nsKey if it exists. - * @param string $nsKey - */ - public function clearAll($nsKey) - { - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/KeyCacheInputStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/KeyCacheInputStream.php deleted file mode 100644 index 2213ae4..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/KeyCacheInputStream.php +++ /dev/null @@ -1,48 +0,0 @@ -_keyCache = $keyCache; - } - - /** - * Specify a stream to write through for each write(). - * @param Swift_InputByteStream $is - */ - public function setWriteThroughStream(Swift_InputByteStream $is) - { - $this->_writeThrough = $is; - } - - /** - * Writes $bytes to the end of the stream. - * @param string $bytes - * @param Swift_InputByteStream $is, optional - */ - public function write($bytes, Swift_InputByteStream $is = null) - { - $this->_keyCache->setString( - $this->_nsKey, $this->_itemKey, $bytes, Swift_KeyCache::MODE_APPEND - ); - if (isset($is)) { - $is->write($bytes); - } - if (isset($this->_writeThrough)) { - $this->_writeThrough->write($bytes); - } - } - - /** - * Not used. - */ - public function commit() - { - } - - /** - * Not used. - */ - public function bind(Swift_InputByteStream $is) - { - } - - /** - * Not used. - */ - public function unbind(Swift_InputByteStream $is) - { - } - - /** - * Flush the contents of the stream (empty it) and set the internal pointer - * to the beginning. - */ - public function flushBuffers() - { - $this->_keyCache->clearKey($this->_nsKey, $this->_itemKey); - } - - /** - * Set the nsKey which will be written to. - * @param string $nsKey - */ - public function setNsKey($nsKey) - { - $this->_nsKey = $nsKey; - } - - /** - * Set the itemKey which will be written to. - * @param string $itemKey - */ - public function setItemKey($itemKey) - { - $this->_itemKey = $itemKey; - } - - /** - * Any implementation should be cloneable, allowing the clone to access a - * separate $nsKey and $itemKey. - */ - public function __clone() - { - $this->_writeThrough = null; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/LoadBalancedTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/LoadBalancedTransport.php deleted file mode 100644 index d3742b0..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/LoadBalancedTransport.php +++ /dev/null @@ -1,43 +0,0 @@ -createDependenciesFor('transport.loadbalanced') - ); - - $this->setTransports($transports); - } - - /** - * Create a new LoadBalancedTransport instance. - * @param string $transports - * @return Swift_LoadBalancedTransport - */ - public static function newInstance($transports = array()) - { - return new self($transports); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MailTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MailTransport.php deleted file mode 100644 index b580691..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MailTransport.php +++ /dev/null @@ -1,43 +0,0 @@ -createDependenciesFor('transport.mail') - ); - - $this->setExtraParams($extraParams); - } - - /** - * Create a new MailTransport instance. - * @param string $extraParams To be passed to mail() - * @return Swift_MailTransport - */ - public static function newInstance($extraParams = '-f%s') - { - return new self($extraParams); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php deleted file mode 100644 index cda0044..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php +++ /dev/null @@ -1,111 +0,0 @@ -_transport = $transport; - } - - /** - * Create a new Mailer instance. - * - * @param Swift_Transport $transport - * @return Swift_Mailer - */ - public static function newInstance(Swift_Transport $transport) - { - return new self($transport); - } - - /** - * Create a new class instance of one of the message services - * For example 'mimepart' would create a 'message.mimepart' instance - * - * @param string $service - * @return object - */ - public function createMessage($service = 'message') - { - return Swift_DependencyContainer::getInstance() - ->lookup('message.'.$service); - } - - /** - * Send the given Message like it would be sent in a mail client. - * - * All recipients (with the exception of Bcc) will be able to see the other - * recipients this message was sent to. - * - * Recipient/sender data will be retrieved from the Message object. - * - * The return value is the number of recipients who were accepted for - * delivery. - * - * @param Swift_Mime_Message $message - * @param array &$failedRecipients, optional - * @return int - */ - public function send(Swift_Mime_Message $message, &$failedRecipients = null) - { - $failedRecipients = (array) $failedRecipients; - - if (!$this->_transport->isStarted()) { - $this->_transport->start(); - } - - $sent = 0; - - try { - $sent = $this->_transport->send($message, $failedRecipients); - } catch (Swift_RfcComplianceException $e) { - foreach ($message->getTo() as $address => $name) { - $failedRecipients[] = $address; - } - } - - return $sent; - } - - /** - * Register a plugin using a known unique key (e.g. myPlugin). - * - * @param Swift_Events_EventListener $plugin - * @param string $key - */ - public function registerPlugin(Swift_Events_EventListener $plugin) - { - $this->_transport->registerPlugin($plugin); - } - - /** - * The Transport used to send messages. - * @return Swift_Transport - */ - public function getTransport() - { - return $this->_transport; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/ArrayRecipientIterator.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/ArrayRecipientIterator.php deleted file mode 100644 index fe59484..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/ArrayRecipientIterator.php +++ /dev/null @@ -1,54 +0,0 @@ -_recipients = $recipients; - } - - /** - * Returns true only if there are more recipients to send to. - * @return boolean - */ - public function hasNext() - { - return !empty($this->_recipients); - } - - /** - * Returns an array where the keys are the addresses of recipients and the - * values are the names. - * e.g. ('foo@bar' => 'Foo') or ('foo@bar' => NULL) - * @return array - */ - public function nextRecipient() - { - return array_splice($this->_recipients, 0, 1); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/RecipientIterator.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/RecipientIterator.php deleted file mode 100644 index 02f08b9..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/RecipientIterator.php +++ /dev/null @@ -1,32 +0,0 @@ - 'Foo') or ('foo@bar' => NULL) - * @return array - */ - public function nextRecipient(); -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MemorySpool.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MemorySpool.php deleted file mode 100644 index 7efa77c..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MemorySpool.php +++ /dev/null @@ -1,82 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Stores Messages in memory. - * @package Swift - * @author Fabien Potencier - */ -class Swift_MemorySpool implements Swift_Spool -{ - protected $messages = array(); - - /** - * Tests if this Transport mechanism has started. - * @return boolean - */ - public function isStarted() - { - return true; - } - - /** - * Starts this Transport mechanism. - */ - public function start() - { - } - - /** - * Stops this Transport mechanism. - */ - public function stop() - { - } - - /** - * Stores a message in the queue. - * - * @param Swift_Mime_Message $message The message to store - * - * @return boolean Whether the operation has succeeded - */ - public function queueMessage(Swift_Mime_Message $message) - { - $this->messages[] = $message; - - return true; - } - - /** - * Sends messages using the given transport instance. - * - * @param Swift_Transport $transport A transport instance - * @param string[] &$failedRecipients An array of failures by-reference - * - * @return int The number of sent emails - */ - public function flushQueue(Swift_Transport $transport, &$failedRecipients = null) - { - if (!$this->messages) { - return 0; - } - - if (!$transport->isStarted()) { - $transport->start(); - } - - $count = 0; - while ($message = array_pop($this->messages)) { - $count += $transport->send($message, $failedRecipients); - } - - return $count; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php deleted file mode 100644 index c7004d2..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php +++ /dev/null @@ -1,77 +0,0 @@ -createDependenciesFor('mime.message') - ); - - if (!isset($charset)) { - $charset = Swift_DependencyContainer::getInstance() - ->lookup('properties.charset'); - } - $this->setSubject($subject); - $this->setBody($body); - $this->setCharset($charset); - if ($contentType) { - $this->setContentType($contentType); - } - } - - /** - * Create a new Message. - * @param string $subject - * @param string $body - * @param string $contentType - * @param string $charset - * @return Swift_Mime_Message - */ - public static function newInstance($subject = null, $body = null, $contentType = null, $charset = null) - { - return new self($subject, $body, $contentType, $charset); - } - - /** - * Add a MimePart to this Message. - * @param string|Swift_OutputByteStream $body - * @param string $contentType - * @param string $charset - */ - public function addPart($body, $contentType = null, $charset = null) - { - return $this->attach(Swift_MimePart::newInstance( - $body, $contentType, $charset - )); - } - - public function __wakeup() - { - Swift_DependencyContainer::getInstance()->createDependenciesFor('mime.message'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Attachment.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Attachment.php deleted file mode 100644 index 1ec529c..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Attachment.php +++ /dev/null @@ -1,139 +0,0 @@ -setDisposition('attachment'); - $this->setContentType('application/octet-stream'); - $this->_mimeTypes = $mimeTypes; - } - - /** - * Get the nesting level used for this attachment. - * Always returns {@link LEVEL_MIXED}. - * @return int - */ - public function getNestingLevel() - { - return self::LEVEL_MIXED; - } - - /** - * Get the Content-Disposition of this attachment. - * By default attachments have a disposition of "attachment". - * @return string - */ - public function getDisposition() - { - return $this->_getHeaderFieldModel('Content-Disposition'); - } - - /** - * Set the Content-Disposition of this attachment. - * @param string $disposition - * @return Swift_Mime_Attachment - */ - public function setDisposition($disposition) - { - if (!$this->_setHeaderFieldModel('Content-Disposition', $disposition)) { - $this->getHeaders()->addParameterizedHeader( - 'Content-Disposition', $disposition - ); - } - - return $this; - } - - /** - * Get the filename of this attachment when downloaded. - * @return string - */ - public function getFilename() - { - return $this->_getHeaderParameter('Content-Disposition', 'filename'); - } - - /** - * Set the filename of this attachment. - * @param string $filename - * @return Swift_Mime_Attachment - */ - public function setFilename($filename) - { - $this->_setHeaderParameter('Content-Disposition', 'filename', $filename); - $this->_setHeaderParameter('Content-Type', 'name', $filename); - - return $this; - } - - /** - * Get the file size of this attachment. - * @return int - */ - public function getSize() - { - return $this->_getHeaderParameter('Content-Disposition', 'size'); - } - - /** - * Set the file size of this attachment. - * @param int $size - * @return Swift_Mime_Attachment - */ - public function setSize($size) - { - $this->_setHeaderParameter('Content-Disposition', 'size', $size); - - return $this; - } - - /** - * Set the file that this attachment is for. - * @param Swift_FileStream $file - * @param string $contentType optional - * @return Swift_Mime_Attachment - */ - public function setFile(Swift_FileStream $file, $contentType = null) - { - $this->setFilename(basename($file->getPath())); - $this->setBody($file, $contentType); - if (!isset($contentType)) { - $extension = strtolower(substr( - $file->getPath(), strrpos($file->getPath(), '.') + 1 - )); - - if (array_key_exists($extension, $this->_mimeTypes)) { - $this->setContentType($this->_mimeTypes[$extension]); - } - } - - return $this; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/CharsetObserver.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/CharsetObserver.php deleted file mode 100644 index c0c7526..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/CharsetObserver.php +++ /dev/null @@ -1,24 +0,0 @@ -= $maxLineLength || 76 < $maxLineLength) { - $maxLineLength = 76; - } - - $remainder = 0; - - while (false !== $bytes = $os->read(8190)) { - $encoded = base64_encode($bytes); - $encodedTransformed = ''; - $thisMaxLineLength = $maxLineLength - $remainder - $firstLineOffset; - - while ($thisMaxLineLength < strlen($encoded)) { - $encodedTransformed .= substr($encoded, 0, $thisMaxLineLength) . "\r\n"; - $firstLineOffset = 0; - $encoded = substr($encoded, $thisMaxLineLength); - $thisMaxLineLength = $maxLineLength; - $remainder = 0; - } - - if (0 < $remainingLength = strlen($encoded)) { - $remainder += $remainingLength; - $encodedTransformed .= $encoded; - $encoded = null; - } - - $is->write($encodedTransformed); - } - } - - /** - * Get the name of this encoding scheme. - * Returns the string 'base64'. - * @return string - */ - public function getName() - { - return 'base64'; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php deleted file mode 100644 index 9442299..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php +++ /dev/null @@ -1,58 +0,0 @@ -read(8192)) { - $string .= $bytes; - } - - $is->write($this->encodeString($string)); - } - - /** - * Get the MIME name of this content encoding scheme. - * @return string - */ - public function getName() - { - return 'quoted-printable'; - } - - /** - * Encode a given string to produce an encoded string. - * @param string $string - * @param int $firstLineOffset if first line needs to be shorter - * @param int $maxLineLength - 0 indicates the default length for this encoding - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, - $maxLineLength = 0) - { - return quoted_printable_encode($string); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php deleted file mode 100644 index a453d5e..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php +++ /dev/null @@ -1,159 +0,0 @@ -_name = $name; - $this->_canonical = $canonical; - } - - /** - * Encode a given string to produce an encoded string. - * @param string $string - * @param int $firstLineOffset, ignored - * @param int $maxLineLength - 0 means no wrapping will occur - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) - { - if ($this->_canonical) { - $string = $this->_canonicalize($string); - } - - return $this->_safeWordWrap($string, $maxLineLength, "\r\n"); - } - - /** - * Encode stream $in to stream $out. - * @param Swift_OutputByteStream $in - * @param Swift_InputByteStream $out - * @param int $firstLineOffset, ignored - * @param int $maxLineLength, optional, 0 means no wrapping will occur - */ - public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0) - { - $leftOver = ''; - while (false !== $bytes = $os->read(8192)) { - $toencode = $leftOver . $bytes; - if ($this->_canonical) { - $toencode = $this->_canonicalize($toencode); - } - $wrapped = $this->_safeWordWrap($toencode, $maxLineLength, "\r\n"); - $lastLinePos = strrpos($wrapped, "\r\n"); - $leftOver = substr($wrapped, $lastLinePos); - $wrapped = substr($wrapped, 0, $lastLinePos); - - $is->write($wrapped); - } - if (strlen($leftOver)) { - $is->write($leftOver); - } - } - - /** - * Get the name of this encoding scheme. - * @return string - */ - public function getName() - { - return $this->_name; - } - - /** - * Not used. - */ - public function charsetChanged($charset) - { - } - - // -- Private methods - - /** - * A safer (but weaker) wordwrap for unicode. - * @param string $string - * @param int $length - * @param string $le - * @return string - * @access private - */ - private function _safeWordwrap($string, $length = 75, $le = "\r\n") - { - if (0 >= $length) { - return $string; - } - - $originalLines = explode($le, $string); - - $lines = array(); - $lineCount = 0; - - foreach ($originalLines as $originalLine) { - $lines[] = ''; - $currentLine =& $lines[$lineCount++]; - - //$chunks = preg_split('/(?<=[\ \t,\.!\?\-&\+\/])/', $originalLine); - $chunks = preg_split('/(?<=\s)/', $originalLine); - - foreach ($chunks as $chunk) { - if (0 != strlen($currentLine) - && strlen($currentLine . $chunk) > $length) - { - $lines[] = ''; - $currentLine =& $lines[$lineCount++]; - } - $currentLine .= $chunk; - } - } - - return implode("\r\n", $lines); - } - - /** - * Canonicalize string input (fix CRLF). - * @param string $string - * @return string - * @access private - */ - private function _canonicalize($string) - { - return str_replace( - array("\r\n", "\r", "\n"), - array("\n", "\n", "\r\n"), - $string - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php deleted file mode 100644 index 7895929..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php +++ /dev/null @@ -1,120 +0,0 @@ -_dotEscape = $dotEscape; - parent::__construct($charStream, $filter); - } - - public function __sleep() - { - return array('_charStream', '_filter', '_dotEscape'); - } - - protected function getSafeMapShareId() - { - return get_class($this).($this->_dotEscape ? '.dotEscape' : ''); - } - - protected function initSafeMap() - { - parent::initSafeMap(); - if ($this->_dotEscape) { - /* Encode . as =2e for buggy remote servers */ - unset($this->_safeMap[0x2e]); - } - } - - /** - * Encode stream $in to stream $out. - * QP encoded strings have a maximum line length of 76 characters. - * If the first line needs to be shorter, indicate the difference with - * $firstLineOffset. - * @param Swift_OutputByteStream $os output stream - * @param Swift_InputByteStream $is input stream - * @param int $firstLineOffset - * @param int $maxLineLength - */ - public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0) - { - if ($maxLineLength > 76 || $maxLineLength <= 0) { - $maxLineLength = 76; - } - - $thisLineLength = $maxLineLength - $firstLineOffset; - - $this->_charStream->flushContents(); - $this->_charStream->importByteStream($os); - - $currentLine = ''; - $prepend = ''; - $size=$lineLen=0; - - while (false !== $bytes = $this->_nextSequence()) { - //If we're filtering the input - if (isset($this->_filter)) { - //If we can't filter because we need more bytes - while ($this->_filter->shouldBuffer($bytes)) { - //Then collect bytes into the buffer - if (false === $moreBytes = $this->_nextSequence(1)) { - break; - } - - foreach ($moreBytes as $b) { - $bytes[] = $b; - } - } - //And filter them - $bytes = $this->_filter->filter($bytes); - } - - $enc = $this->_encodeByteSequence($bytes, $size); - if ($currentLine && $lineLen+$size >= $thisLineLength) { - $is->write($prepend . $this->_standardize($currentLine)); - $currentLine = ''; - $prepend = "=\r\n"; - $thisLineLength = $maxLineLength; - $lineLen=0; - } - $lineLen+=$size; - $currentLine .= $enc; - } - if (strlen($currentLine)) { - $is->write($prepend . $this->_standardize($currentLine)); - } - } - - /** - * Get the name of this encoding scheme. - * Returns the string 'quoted-printable'. - * @return string - */ - public function getName() - { - return 'quoted-printable'; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EmbeddedFile.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EmbeddedFile.php deleted file mode 100644 index 7874be3..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EmbeddedFile.php +++ /dev/null @@ -1,43 +0,0 @@ -setDisposition('inline'); - $this->setId($this->getId()); - } - - /** - * Get the nesting level of this EmbeddedFile. - * Returns {@link LEVEL_RELATED}. - * @return int - */ - public function getNestingLevel() - { - return self::LEVEL_RELATED; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EncodingObserver.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EncodingObserver.php deleted file mode 100644 index f41f8ab..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EncodingObserver.php +++ /dev/null @@ -1,24 +0,0 @@ -init(); - } - - public function __wakeup() - { - $this->init(); - } - - protected function init() - { - if (count(self::$_specials) > 0) { - return; - } - - self::$_specials = array( - '(', ')', '<', '>', '[', ']', - ':', ';', '@', ',', '.', '"' - ); - - /*** Refer to RFC 2822 for ABNF grammar ***/ - - //All basic building blocks - self::$_grammar['NO-WS-CTL'] = '[\x01-\x08\x0B\x0C\x0E-\x19\x7F]'; - self::$_grammar['WSP'] = '[ \t]'; - self::$_grammar['CRLF'] = '(?:\r\n)'; - self::$_grammar['FWS'] = '(?:(?:' . self::$_grammar['WSP'] . '*' . - self::$_grammar['CRLF'] . ')?' . self::$_grammar['WSP'] . ')'; - self::$_grammar['text'] = '[\x00-\x08\x0B\x0C\x0E-\x7F]'; - self::$_grammar['quoted-pair'] = '(?:\\\\' . self::$_grammar['text'] . ')'; - self::$_grammar['ctext'] = '(?:' . self::$_grammar['NO-WS-CTL'] . - '|[\x21-\x27\x2A-\x5B\x5D-\x7E])'; - //Uses recursive PCRE (?1) -- could be a weak point?? - self::$_grammar['ccontent'] = '(?:' . self::$_grammar['ctext'] . '|' . - self::$_grammar['quoted-pair'] . '|(?1))'; - self::$_grammar['comment'] = '(\((?:' . self::$_grammar['FWS'] . '|' . - self::$_grammar['ccontent']. ')*' . self::$_grammar['FWS'] . '?\))'; - self::$_grammar['CFWS'] = '(?:(?:' . self::$_grammar['FWS'] . '?' . - self::$_grammar['comment'] . ')*(?:(?:' . self::$_grammar['FWS'] . '?' . - self::$_grammar['comment'] . ')|' . self::$_grammar['FWS'] . '))'; - self::$_grammar['qtext'] = '(?:' . self::$_grammar['NO-WS-CTL'] . - '|[\x21\x23-\x5B\x5D-\x7E])'; - self::$_grammar['qcontent'] = '(?:' . self::$_grammar['qtext'] . '|' . - self::$_grammar['quoted-pair'] . ')'; - self::$_grammar['quoted-string'] = '(?:' . self::$_grammar['CFWS'] . '?"' . - '(' . self::$_grammar['FWS'] . '?' . self::$_grammar['qcontent'] . ')*' . - self::$_grammar['FWS'] . '?"' . self::$_grammar['CFWS'] . '?)'; - self::$_grammar['atext'] = '[a-zA-Z0-9!#\$%&\'\*\+\-\/=\?\^_`\{\}\|~]'; - self::$_grammar['atom'] = '(?:' . self::$_grammar['CFWS'] . '?' . - self::$_grammar['atext'] . '+' . self::$_grammar['CFWS'] . '?)'; - self::$_grammar['dot-atom-text'] = '(?:' . self::$_grammar['atext'] . '+' . - '(\.' . self::$_grammar['atext'] . '+)*)'; - self::$_grammar['dot-atom'] = '(?:' . self::$_grammar['CFWS'] . '?' . - self::$_grammar['dot-atom-text'] . '+' . self::$_grammar['CFWS'] . '?)'; - self::$_grammar['word'] = '(?:' . self::$_grammar['atom'] . '|' . - self::$_grammar['quoted-string'] . ')'; - self::$_grammar['phrase'] = '(?:' . self::$_grammar['word'] . '+?)'; - self::$_grammar['no-fold-quote'] = '(?:"(?:' . self::$_grammar['qtext'] . - '|' . self::$_grammar['quoted-pair'] . ')*")'; - self::$_grammar['dtext'] = '(?:' . self::$_grammar['NO-WS-CTL'] . - '|[\x21-\x5A\x5E-\x7E])'; - self::$_grammar['no-fold-literal'] = '(?:\[(?:' . self::$_grammar['dtext'] . - '|' . self::$_grammar['quoted-pair'] . ')*\])'; - - //Message IDs - self::$_grammar['id-left'] = '(?:' . self::$_grammar['dot-atom-text'] . '|' . - self::$_grammar['no-fold-quote'] . ')'; - self::$_grammar['id-right'] = '(?:' . self::$_grammar['dot-atom-text'] . '|' . - self::$_grammar['no-fold-literal'] . ')'; - - //Addresses, mailboxes and paths - self::$_grammar['local-part'] = '(?:' . self::$_grammar['dot-atom'] . '|' . - self::$_grammar['quoted-string'] . ')'; - self::$_grammar['dcontent'] = '(?:' . self::$_grammar['dtext'] . '|' . - self::$_grammar['quoted-pair'] . ')'; - self::$_grammar['domain-literal'] = '(?:' . self::$_grammar['CFWS'] . '?\[(' . - self::$_grammar['FWS'] . '?' . self::$_grammar['dcontent'] . ')*?' . - self::$_grammar['FWS'] . '?\]' . self::$_grammar['CFWS'] . '?)'; - self::$_grammar['domain'] = '(?:' . self::$_grammar['dot-atom'] . '|' . - self::$_grammar['domain-literal'] . ')'; - self::$_grammar['addr-spec'] = '(?:' . self::$_grammar['local-part'] . '@' . - self::$_grammar['domain'] . ')'; - } - - /** - * Get the grammar defined for $name token. - * @param string $name execatly as written in the RFC - * @return string - */ - public function getDefinition($name) - { - if (array_key_exists($name, self::$_grammar)) { - return self::$_grammar[$name]; - } else { - throw new Swift_RfcComplianceException( - "No such grammar '" . $name . "' defined." - ); - } - } - - /** - * Returns the tokens defined in RFC 2822 (and some related RFCs). - * @return array - */ - public function getGrammarDefinitions() - { - return self::$_grammar; - } - - /** - * Returns the current special characters used in the syntax which need to be escaped. - * @return array - */ - public function getSpecials() - { - return self::$_specials; - } - - /** - * Escape special characters in a string (convert to quoted-pairs). - * @param string $token - * @param string[] $include additonal chars to escape - * @param string[] $exclude chars from escaping - * @return string - */ - public function escapeSpecials($token, $include = array(), $exclude = array()) - { - foreach ( - array_merge(array('\\'), array_diff(self::$_specials, $exclude), $include) as $char) - { - $token = str_replace($char, '\\' . $char, $token); - } - - return $token; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Header.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Header.php deleted file mode 100644 index 6b492d2..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Header.php +++ /dev/null @@ -1,83 +0,0 @@ -getName(), "\r\n"); - mb_internal_encoding($old); - - return $newstring; - } - - return parent::encodeString($string, $firstLineOffset, $maxLineLength); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php deleted file mode 100644 index 86e9f76..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php +++ /dev/null @@ -1,65 +0,0 @@ -_safeMap[$byte] = chr($byte); - } - } - - /** - * Get the name of this encoding scheme. - * Returns the string 'Q'. - * @return string - */ - public function getName() - { - return 'Q'; - } - - /** - * Takes an unencoded string and produces a Q encoded string from it. - * @param string $string to encode - * @param int $firstLineOffset, optional - * @param int $maxLineLength, optional, 0 indicates the default of 76 chars - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0, $charst = 'utf-8') - { - return str_replace(array(' ', '=20', "=\r\n"), array('_', '_', "\r\n"), - parent::encodeString($string, $firstLineOffset, $maxLineLength) - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderFactory.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderFactory.php deleted file mode 100644 index d1e3df4..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderFactory.php +++ /dev/null @@ -1,67 +0,0 @@ -setGrammar($grammar); - } - - /** - * Set the character set used in this Header. - * @param string $charset - */ - public function setCharset($charset) - { - $this->clearCachedValueIf($charset != $this->_charset); - $this->_charset = $charset; - if (isset($this->_encoder)) { - $this->_encoder->charsetChanged($charset); - } - } - - /** - * Get the character set used in this Header. - * @return string - */ - public function getCharset() - { - return $this->_charset; - } - - /** - * Set the language used in this Header. - * For example, for US English, 'en-us'. - * This can be unspecified. - * @param string $lang - */ - public function setLanguage($lang) - { - $this->clearCachedValueIf($this->_lang != $lang); - $this->_lang = $lang; - } - - /** - * Get the language used in this Header. - * @return string - */ - public function getLanguage() - { - return $this->_lang; - } - - /** - * Set the encoder used for encoding the header. - * @param Swift_Mime_HeaderEncoder $encoder - */ - public function setEncoder(Swift_Mime_HeaderEncoder $encoder) - { - $this->_encoder = $encoder; - $this->setCachedValue(null); - } - - /** - * Get the encoder used for encoding this Header. - * @return Swift_Mime_HeaderEncoder - */ - public function getEncoder() - { - return $this->_encoder; - } - - /** - * Set the grammar used for the header. - * @param Swift_Mime_Grammar $grammar - */ - public function setGrammar(Swift_Mime_Grammar $grammar) - { - $this->_grammar = $grammar; - $this->setCachedValue(null); - } - - /** - * Get the grammar used for this Header. - * @return Swift_Mime_Grammar - */ - public function getGrammar() - { - return $this->_grammar; - } - - /** - * Get the name of this header (e.g. charset). - * @return string - */ - public function getFieldName() - { - return $this->_name; - } - - /** - * Set the maximum length of lines in the header (excluding EOL). - * @param int $lineLength - */ - public function setMaxLineLength($lineLength) - { - $this->clearCachedValueIf($this->_lineLength != $lineLength); - $this->_lineLength = $lineLength; - } - - /** - * Get the maximum permitted length of lines in this Header. - * @return int - */ - public function getMaxLineLength() - { - return $this->_lineLength; - } - - /** - * Get this Header rendered as a RFC 2822 compliant string. - * @return string - * @throws Swift_RfcComplianceException - */ - public function toString() - { - return $this->_tokensToString($this->toTokens()); - } - - /** - * Returns a string representation of this object. - * - * @return string - * - * @see toString() - */ - public function __toString() - { - return $this->toString(); - } - - // -- Points of extension - - /** - * Set the name of this Header field. - * @param string $name - * @access protected - */ - protected function setFieldName($name) - { - $this->_name = $name; - } - - /** - * Produces a compliant, formatted RFC 2822 'phrase' based on the string given. - * @param Swift_Mime_Header $header - * @param string $string as displayed - * @param string $charset of the text - * @param Swift_Mime_HeaderEncoder $encoder - * @param boolean $shorten the first line to make remove for header name - * @return string - */ - protected function createPhrase(Swift_Mime_Header $header, $string, $charset, Swift_Mime_HeaderEncoder $encoder = null, $shorten = false) - { - //Treat token as exactly what was given - $phraseStr = $string; - //If it's not valid - if (!preg_match('/^' . $this->getGrammar()->getDefinition('phrase') . '$/D', $phraseStr)) { - // .. but it is just ascii text, try escaping some characters - // and make it a quoted-string - if (preg_match('/^' . $this->getGrammar()->getDefinition('text') . '*$/D', $phraseStr)) { - $phraseStr = $this->getGrammar()->escapeSpecials( - $phraseStr, array('"'), $this->getGrammar()->getSpecials() - ); - $phraseStr = '"' . $phraseStr . '"'; - } else { // ... otherwise it needs encoding - //Determine space remaining on line if first line - if ($shorten) { - $usedLength = strlen($header->getFieldName() . ': '); - } else { - $usedLength = 0; - } - $phraseStr = $this->encodeWords($header, $string, $usedLength); - } - } - - return $phraseStr; - } - - /** - * Encode needed word tokens within a string of input. - * @param string $input - * @param string $usedLength, optional - * @return string - */ - protected function encodeWords(Swift_Mime_Header $header, $input, $usedLength = -1) - { - $value = ''; - - $tokens = $this->getEncodableWordTokens($input); - - foreach ($tokens as $token) { - //See RFC 2822, Sect 2.2 (really 2.2 ??) - if ($this->tokenNeedsEncoding($token)) { - //Don't encode starting WSP - $firstChar = substr($token, 0, 1); - switch ($firstChar) { - case ' ': - case "\t": - $value .= $firstChar; - $token = substr($token, 1); - } - - if (-1 == $usedLength) { - $usedLength = strlen($header->getFieldName() . ': ') + strlen($value); - } - $value .= $this->getTokenAsEncodedWord($token, $usedLength); - - $header->setMaxLineLength(76); //Forefully override - } else { - $value .= $token; - } - } - - return $value; - } - - /** - * Test if a token needs to be encoded or not. - * @param string $token - * @return boolean - */ - protected function tokenNeedsEncoding($token) - { - return preg_match('~[\x00-\x08\x10-\x19\x7F-\xFF\r\n]~', $token); - } - - /** - * Splits a string into tokens in blocks of words which can be encoded quickly. - * @param string $string - * @return string[] - */ - protected function getEncodableWordTokens($string) - { - $tokens = array(); - - $encodedToken = ''; - //Split at all whitespace boundaries - foreach (preg_split('~(?=[\t ])~', $string) as $token) { - if ($this->tokenNeedsEncoding($token)) { - $encodedToken .= $token; - } else { - if (strlen($encodedToken) > 0) { - $tokens[] = $encodedToken; - $encodedToken = ''; - } - $tokens[] = $token; - } - } - if (strlen($encodedToken)) { - $tokens[] = $encodedToken; - } - - return $tokens; - } - - /** - * Get a token as an encoded word for safe insertion into headers. - * @param string $token to encode - * @param int $firstLineOffset, optional - * @return string - */ - protected function getTokenAsEncodedWord($token, $firstLineOffset = 0) - { - //Adjust $firstLineOffset to account for space needed for syntax - $charsetDecl = $this->_charset; - if (isset($this->_lang)) { - $charsetDecl .= '*' . $this->_lang; - } - $encodingWrapperLength = strlen( - '=?' . $charsetDecl . '?' . $this->_encoder->getName() . '??=' - ); - - if ($firstLineOffset >= 75) { //Does this logic need to be here? - $firstLineOffset = 0; - } - - $encodedTextLines = explode("\r\n", - $this->_encoder->encodeString( - $token, $firstLineOffset, 75 - $encodingWrapperLength, $this->_charset - ) - ); - - if (strtolower($this->_charset) !== 'iso-2022-jp') { // special encoding for iso-2022-jp using mb_encode_mimeheader - foreach ($encodedTextLines as $lineNum => $line) { - $encodedTextLines[$lineNum] = '=?' . $charsetDecl . - '?' . $this->_encoder->getName() . - '?' . $line . '?='; - } - } - - return implode("\r\n ", $encodedTextLines); - } - - /** - * Generates tokens from the given string which include CRLF as individual tokens. - * @param string $token - * @return string[] - * @access protected - */ - protected function generateTokenLines($token) - { - return preg_split('~(\r\n)~', $token, -1, PREG_SPLIT_DELIM_CAPTURE); - } - - /** - * Set a value into the cache. - * @param string $value - * @access protected - */ - protected function setCachedValue($value) - { - $this->_cachedValue = $value; - } - - /** - * Get the value in the cache. - * @return string - * @access protected - */ - protected function getCachedValue() - { - return $this->_cachedValue; - } - - /** - * Clear the cached value if $condition is met. - * @param boolean $condition - * @access protected - */ - protected function clearCachedValueIf($condition) - { - if ($condition) { - $this->setCachedValue(null); - } - } - - // -- Private methods - - /** - * Generate a list of all tokens in the final header. - * @param string $string The string to tokenize - * @return array An array of tokens as strings - * @access protected - */ - protected function toTokens($string = null) - { - if (is_null($string)) { - $string = $this->getFieldBody(); - } - - $tokens = array(); - - //Generate atoms; split at all invisible boundaries followed by WSP - foreach (preg_split('~(?=[ \t])~', $string) as $token) { - $tokens = array_merge($tokens, $this->generateTokenLines($token)); - } - - return $tokens; - } - - /** - * Takes an array of tokens which appear in the header and turns them into - * an RFC 2822 compliant string, adding FWSP where needed. - * @param string[] $tokens - * @return string - * @access private - */ - private function _tokensToString(array $tokens) - { - $lineCount = 0; - $headerLines = array(); - $headerLines[] = $this->_name . ': '; - $currentLine =& $headerLines[$lineCount++]; - - //Build all tokens back into compliant header - foreach ($tokens as $i => $token) { - //Line longer than specified maximum or token was just a new line - if (("\r\n" == $token) || - ($i > 0 && strlen($currentLine . $token) > $this->_lineLength) - && 0 < strlen($currentLine)) - { - $headerLines[] = ''; - $currentLine =& $headerLines[$lineCount++]; - } - - //Append token to the line - if ("\r\n" != $token) { - $currentLine .= $token; - } - } - - //Implode with FWS (RFC 2822, 2.2.3) - return implode("\r\n", $headerLines) . "\r\n"; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/DateHeader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/DateHeader.php deleted file mode 100644 index 8749ec3..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/DateHeader.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - *
- * @param string $name of Header - * @param Swift_Mime_Grammar $grammar - */ - public function __construct($name, Swift_Mime_Grammar $grammar) - { - $this->setFieldName($name); - parent::__construct($grammar); - } - - /** - * Get the type of Header that this instance represents. - * @return int - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - */ - public function getFieldType() - { - return self::TYPE_DATE; - } - - /** - * Set the model for the field body. - * This method takes a UNIX timestamp. - * @param int $model - */ - public function setFieldBodyModel($model) - { - $this->setTimestamp($model); - } - - /** - * Get the model for the field body. - * This method returns a UNIX timestamp. - * @return mixed - */ - public function getFieldBodyModel() - { - return $this->getTimestamp(); - } - - /** - * Get the UNIX timestamp of the Date in this Header. - * @return int - */ - public function getTimestamp() - { - return $this->_timestamp; - } - - /** - * Set the UNIX timestamp of the Date in this Header. - * @param int $timestamp - */ - public function setTimestamp($timestamp) - { - if (!is_null($timestamp)) { - $timestamp = (int) $timestamp; - } - $this->clearCachedValueIf($this->_timestamp != $timestamp); - $this->_timestamp = $timestamp; - } - - /** - * Get the string value of the body in this Header. - * This is not necessarily RFC 2822 compliant since folding white space will - * not be added at this stage (see {@link toString()} for that). - * @return string - * @see toString() - */ - public function getFieldBody() - { - if (!$this->getCachedValue()) { - if (isset($this->_timestamp)) { - $this->setCachedValue(date('r', $this->_timestamp)); - } - } - - return $this->getCachedValue(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php deleted file mode 100644 index ccd473b..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php +++ /dev/null @@ -1,160 +0,0 @@ -setFieldName($name); - parent::__construct($grammar); - } - - /** - * Get the type of Header that this instance represents. - * @return int - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - */ - public function getFieldType() - { - return self::TYPE_ID; - } - - /** - * Set the model for the field body. - * This method takes a string ID, or an array of IDs - * @param mixed $model - * @throws Swift_RfcComplianceException - */ - public function setFieldBodyModel($model) - { - $this->setId($model); - } - - /** - * Get the model for the field body. - * This method returns an array of IDs - * @return array - */ - public function getFieldBodyModel() - { - return $this->getIds(); - } - - /** - * Set the ID used in the value of this header. - * @param string|array $id - * @throws Swift_RfcComplianceException - */ - public function setId($id) - { - $this->setIds(is_array($id) ? $id : array($id)); - } - - /** - * Get the ID used in the value of this Header. - * If multiple IDs are set only the first is returned. - * @return string - */ - public function getId() - { - if (count($this->_ids) > 0) { - return $this->_ids[0]; - } - } - - /** - * Set a collection of IDs to use in the value of this Header. - * @param string[] $ids - * @throws Swift_RfcComplianceException - */ - public function setIds(array $ids) - { - $actualIds = array(); - - foreach ($ids as $id) { - $this->_assertValidId($id); - $actualIds[] = $id; - } - - $this->clearCachedValueIf($this->_ids != $actualIds); - $this->_ids = $actualIds; - } - - /** - * Get the list of IDs used in this Header. - * @return string[] - */ - public function getIds() - { - return $this->_ids; - } - - /** - * Get the string value of the body in this Header. - * This is not necessarily RFC 2822 compliant since folding white space will - * not be added at this stage (see {@link toString()} for that). - * @return string - * @see toString() - * @throws Swift_RfcComplianceException - */ - public function getFieldBody() - { - if (!$this->getCachedValue()) { - $angleAddrs = array(); - - foreach ($this->_ids as $id) { - $angleAddrs[] = '<' . $id . '>'; - } - - $this->setCachedValue(implode(' ', $angleAddrs)); - } - - return $this->getCachedValue(); - } - - /** - * Throws an Exception if the id passed does not comply with RFC 2822. - * @param string $id - * @throws Swift_RfcComplianceException - */ - private function _assertValidId($id) - { - if (!preg_match( - '/^' . $this->getGrammar()->getDefinition('id-left') . '@' . - $this->getGrammar()->getDefinition('id-right') . '$/D', - $id - )) - { - throw new Swift_RfcComplianceException( - 'Invalid ID given <' . $id . '>' - ); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php deleted file mode 100644 index a4f1bcc..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php +++ /dev/null @@ -1,316 +0,0 @@ -setFieldName($name); - $this->setEncoder($encoder); - parent::__construct($grammar); - } - - /** - * Get the type of Header that this instance represents. - * @return int - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - */ - public function getFieldType() - { - return self::TYPE_MAILBOX; - } - - /** - * Set the model for the field body. - * This method takes a string, or an array of addresses. - * @param mixed $model - * @throws Swift_RfcComplianceException - */ - public function setFieldBodyModel($model) - { - $this->setNameAddresses($model); - } - - /** - * Get the model for the field body. - * This method returns an associative array like {@link getNameAddresses()} - * @return array - * @throws Swift_RfcComplianceException - */ - public function getFieldBodyModel() - { - return $this->getNameAddresses(); - } - - /** - * Set a list of mailboxes to be shown in this Header. - * The mailboxes can be a simple array of addresses, or an array of - * key=>value pairs where (email => personalName). - * Example: - * - * setNameAddresses(array( - * 'chris@swiftmailer.org' => 'Chris Corbyn', - * 'mark@swiftmailer.org' //No associated personal name - * )); - * ?> - * - * @param string|string[] $mailboxes - * @throws Swift_RfcComplianceException - * @see __construct() - * @see setAddresses() - * @see setValue() - */ - public function setNameAddresses($mailboxes) - { - $this->_mailboxes = $this->normalizeMailboxes((array) $mailboxes); - $this->setCachedValue(null); //Clear any cached value - } - - /** - * Get the full mailbox list of this Header as an array of valid RFC 2822 strings. - * Example: - * - * 'Chris Corbyn', - * 'mark@swiftmailer.org' => 'Mark Corbyn') - * ); - * print_r($header->getNameAddressStrings()); - * // array ( - * // 0 => Chris Corbyn , - * // 1 => Mark Corbyn - * // ) - * ?> - * - * @return string[] - * @throws Swift_RfcComplianceException - * @see getNameAddresses() - * @see toString() - */ - public function getNameAddressStrings() - { - return $this->_createNameAddressStrings($this->getNameAddresses()); - } - - /** - * Get all mailboxes in this Header as key=>value pairs. - * The key is the address and the value is the name (or null if none set). - * Example: - * - * 'Chris Corbyn', - * 'mark@swiftmailer.org' => 'Mark Corbyn') - * ); - * print_r($header->getNameAddresses()); - * // array ( - * // chris@swiftmailer.org => Chris Corbyn, - * // mark@swiftmailer.org => Mark Corbyn - * // ) - * ?> - * - * @return string[] - * @see getAddresses() - * @see getNameAddressStrings() - */ - public function getNameAddresses() - { - return $this->_mailboxes; - } - - /** - * Makes this Header represent a list of plain email addresses with no names. - * Example: - * - * setAddresses( - * array('one@domain.tld', 'two@domain.tld', 'three@domain.tld') - * ); - * ?> - * - * @param string[] $addresses - * @throws Swift_RfcComplianceException - * @see setNameAddresses() - * @see setValue() - */ - public function setAddresses($addresses) - { - $this->setNameAddresses(array_values((array) $addresses)); - } - - /** - * Get all email addresses in this Header. - * @return string[] - * @see getNameAddresses() - */ - public function getAddresses() - { - return array_keys($this->_mailboxes); - } - - /** - * Remove one or more addresses from this Header. - * @param string|string[] $addresses - */ - public function removeAddresses($addresses) - { - $this->setCachedValue(null); - foreach ((array) $addresses as $address) { - unset($this->_mailboxes[$address]); - } - } - - /** - * Get the string value of the body in this Header. - * This is not necessarily RFC 2822 compliant since folding white space will - * not be added at this stage (see {@link toString()} for that). - * @return string - * @throws Swift_RfcComplianceException - * @see toString() - */ - public function getFieldBody() - { - //Compute the string value of the header only if needed - if (is_null($this->getCachedValue())) { - $this->setCachedValue($this->createMailboxListString($this->_mailboxes)); - } - - return $this->getCachedValue(); - } - - // -- Points of extension - - /** - * Normalizes a user-input list of mailboxes into consistent key=>value pairs. - * @param string[] $mailboxes - * @return string[] - * @access protected - */ - protected function normalizeMailboxes(array $mailboxes) - { - $actualMailboxes = array(); - - foreach ($mailboxes as $key => $value) { - if (is_string($key)) { //key is email addr - $address = $key; - $name = $value; - } else { - $address = $value; - $name = null; - } - $this->_assertValidAddress($address); - $actualMailboxes[$address] = $name; - } - - return $actualMailboxes; - } - - /** - * Produces a compliant, formatted display-name based on the string given. - * @param string $displayName as displayed - * @param boolean $shorten the first line to make remove for header name - * @return string - * @access protected - */ - protected function createDisplayNameString($displayName, $shorten = false) - { - return $this->createPhrase($this, $displayName, - $this->getCharset(), $this->getEncoder(), $shorten - ); - } - - /** - * Creates a string form of all the mailboxes in the passed array. - * @param string[] $mailboxes - * @return string - * @throws Swift_RfcComplianceException - * @access protected - */ - protected function createMailboxListString(array $mailboxes) - { - return implode(', ', $this->_createNameAddressStrings($mailboxes)); - } - - /** - * Redefine the encoding requirements for mailboxes. Commas and semicolons are used to separate - * multiple addresses, and should therefore be encoded - * @param string $token - * @return boolean - */ - protected function tokenNeedsEncoding($token) - { - return preg_match('/[,;]/', $token) || parent::tokenNeedsEncoding($token); - } - - // -- Private methods - - /** - * Return an array of strings conforming the the name-addr spec of RFC 2822. - * @param string[] $mailboxes - * @return string[] - * @access private - */ - private function _createNameAddressStrings(array $mailboxes) - { - $strings = array(); - - foreach ($mailboxes as $email => $name) { - $mailboxStr = $email; - if (!is_null($name)) { - $nameStr = $this->createDisplayNameString($name, empty($strings)); - $mailboxStr = $nameStr . ' <' . $mailboxStr . '>'; - } - $strings[] = $mailboxStr; - } - - return $strings; - } - - /** - * Throws an Exception if the address passed does not comply with RFC 2822. - * @param string $address - * @throws Swift_RfcComplianceException If invalid. - * @access private - */ - private function _assertValidAddress($address) - { - if (!preg_match('/^' . $this->getGrammar()->getDefinition('addr-spec') . '$/D', - $address)) - { - throw new Swift_RfcComplianceException( - 'Address in mailbox given [' . $address . - '] does not comply with RFC 2822, 3.6.2.' - ); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php deleted file mode 100644 index 11a657b..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php +++ /dev/null @@ -1,248 +0,0 @@ -_paramEncoder = $paramEncoder; - } - - /** - * Get the type of Header that this instance represents. - * @return int - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - */ - public function getFieldType() - { - return self::TYPE_PARAMETERIZED; - } - - /** - * Set the character set used in this Header. - * @param string $charset - */ - public function setCharset($charset) - { - parent::setCharset($charset); - if (isset($this->_paramEncoder)) { - $this->_paramEncoder->charsetChanged($charset); - } - } - - /** - * Set the value of $parameter. - * @param string $parameter - * @param string $value - */ - public function setParameter($parameter, $value) - { - $this->setParameters(array_merge($this->getParameters(), array($parameter => $value))); - } - - /** - * Get the value of $parameter. - * @return string - */ - public function getParameter($parameter) - { - $params = $this->getParameters(); - - return array_key_exists($parameter, $params) - ? $params[$parameter] - : null; - } - - /** - * Set an associative array of parameter names mapped to values. - * @param string[] - */ - public function setParameters(array $parameters) - { - $this->clearCachedValueIf($this->_params != $parameters); - $this->_params = $parameters; - } - - /** - * Returns an associative array of parameter names mapped to values. - * @return string[] - */ - public function getParameters() - { - return $this->_params; - } - - /** - * Get the value of this header prepared for rendering. - * @return string - */ - public function getFieldBody() //TODO: Check caching here - { - $body = parent::getFieldBody(); - foreach ($this->_params as $name => $value) { - if (!is_null($value)) { - //Add the parameter - $body .= '; ' . $this->_createParameter($name, $value); - } - } - - return $body; - } - - // -- Protected methods - - /** - * Generate a list of all tokens in the final header. - * This doesn't need to be overridden in theory, but it is for implementation - * reasons to prevent potential breakage of attributes. - * @param string $string The string to tokenize - * @return array An array of tokens as strings - * @access protected - */ - protected function toTokens($string = null) - { - $tokens = parent::toTokens(parent::getFieldBody()); - - //Try creating any parameters - foreach ($this->_params as $name => $value) { - if (!is_null($value)) { - //Add the semi-colon separator - $tokens[count($tokens)-1] .= ';'; - $tokens = array_merge($tokens, $this->generateTokenLines( - ' ' . $this->_createParameter($name, $value) - )); - } - } - - return $tokens; - } - - // -- Private methods - - /** - * Render a RFC 2047 compliant header parameter from the $name and $value. - * @param string $name - * @param string $value - * @return string - * @access private - */ - private function _createParameter($name, $value) - { - $origValue = $value; - - $encoded = false; - //Allow room for parameter name, indices, "=" and DQUOTEs - $maxValueLength = $this->getMaxLineLength() - strlen($name . '=*N"";') - 1; - $firstLineOffset = 0; - - //If it's not already a valid parameter value... - if (!preg_match('/^' . self::TOKEN_REGEX . '$/D', $value)) { - //TODO: text, or something else?? - //... and it's not ascii - if (!preg_match('/^' . $this->getGrammar()->getDefinition('text') . '*$/D', $value)) { - $encoded = true; - //Allow space for the indices, charset and language - $maxValueLength = $this->getMaxLineLength() - strlen($name . '*N*="";') - 1; - $firstLineOffset = strlen( - $this->getCharset() . "'" . $this->getLanguage() . "'" - ); - } - } - - //Encode if we need to - if ($encoded || strlen($value) > $maxValueLength) { - if (isset($this->_paramEncoder)) { - $value = $this->_paramEncoder->encodeString( - $origValue, $firstLineOffset, $maxValueLength, $this->getCharset() - ); - } else { //We have to go against RFC 2183/2231 in some areas for interoperability - $value = $this->getTokenAsEncodedWord($origValue); - $encoded = false; - } - } - - $valueLines = isset($this->_paramEncoder) ? explode("\r\n", $value) : array($value); - - //Need to add indices - if (count($valueLines) > 1) { - $paramLines = array(); - foreach ($valueLines as $i => $line) { - $paramLines[] = $name . '*' . $i . - $this->_getEndOfParameterValue($line, true, $i == 0); - } - - return implode(";\r\n ", $paramLines); - } else { - return $name . $this->_getEndOfParameterValue( - $valueLines[0], $encoded, true - ); - } - } - - /** - * Returns the parameter value from the "=" and beyond. - * @param string $value to append - * @param boolean $encoded - * @param boolean $firstLine - * @return string - * @access private - */ - private function _getEndOfParameterValue($value, $encoded = false, $firstLine = false) - { - if (!preg_match('/^' . self::TOKEN_REGEX . '$/D', $value)) { - $value = '"' . $value . '"'; - } - $prepend = '='; - if ($encoded) { - $prepend = '*='; - if ($firstLine) { - $prepend = '*=' . $this->getCharset() . "'" . $this->getLanguage() . - "'"; - } - } - - return $prepend . $value; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php deleted file mode 100644 index 2fe2531..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php +++ /dev/null @@ -1,131 +0,0 @@ -setFieldName($name); - parent::__construct($grammar); - } - - /** - * Get the type of Header that this instance represents. - * @return int - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - */ - public function getFieldType() - { - return self::TYPE_PATH; - } - - /** - * Set the model for the field body. - * This method takes a string for an address. - * @param string $model - * @throws Swift_RfcComplianceException - */ - public function setFieldBodyModel($model) - { - $this->setAddress($model); - } - - /** - * Get the model for the field body. - * This method returns a string email address. - * @return mixed - */ - public function getFieldBodyModel() - { - return $this->getAddress(); - } - - /** - * Set the Address which should appear in this Header. - * @param string $address - * @throws Swift_RfcComplianceException - */ - public function setAddress($address) - { - if (is_null($address)) { - $this->_address = null; - } elseif ('' == $address) { - $this->_address = ''; - } else { - $this->_assertValidAddress($address); - $this->_address = $address; - } - $this->setCachedValue(null); - } - - /** - * Get the address which is used in this Header (if any). - * Null is returned if no address is set. - * @return string - */ - public function getAddress() - { - return $this->_address; - } - - /** - * Get the string value of the body in this Header. - * This is not necessarily RFC 2822 compliant since folding white space will - * not be added at this stage (see {@link toString()} for that). - * @return string - * @see toString() - */ - public function getFieldBody() - { - if (!$this->getCachedValue()) { - if (isset($this->_address)) { - $this->setCachedValue('<' . $this->_address . '>'); - } - } - - return $this->getCachedValue(); - } - - /** - * Throws an Exception if the address passed does not comply with RFC 2822. - * @param string $address - * @throws Swift_RfcComplianceException If invalid. - * @access private - */ - private function _assertValidAddress($address) - { - if (!preg_match('/^' . $this->getGrammar()->getDefinition('addr-spec') . '$/D', - $address)) - { - throw new Swift_RfcComplianceException( - 'Address set in PathHeader does not comply with addr-spec of RFC 2822.' - ); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/UnstructuredHeader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/UnstructuredHeader.php deleted file mode 100644 index 3a7c920..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/UnstructuredHeader.php +++ /dev/null @@ -1,103 +0,0 @@ -setFieldName($name); - $this->setEncoder($encoder); - parent::__construct($grammar); - } - - /** - * Get the type of Header that this instance represents. - * @return int - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - */ - public function getFieldType() - { - return self::TYPE_TEXT; - } - - /** - * Set the model for the field body. - * This method takes a string for the field value. - * @param string $model - */ - public function setFieldBodyModel($model) - { - $this->setValue($model); - } - - /** - * Get the model for the field body. - * This method returns a string. - * @return string - */ - public function getFieldBodyModel() - { - return $this->getValue(); - } - - /** - * Get the (unencoded) value of this header. - * @return string - */ - public function getValue() - { - return $this->_value; - } - - /** - * Set the (unencoded) value of this header. - * @param string $value - */ - public function setValue($value) - { - $this->clearCachedValueIf($this->_value != $value); - $this->_value = $value; - } - - /** - * Get the value of this header prepared for rendering. - * @return string - */ - public function getFieldBody() - { - if (!$this->getCachedValue()) { - $this->setCachedValue( - $this->encodeWords($this, $this->_value) - ); - } - - return $this->getCachedValue(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Message.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Message.php deleted file mode 100644 index 2103bdd..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Message.php +++ /dev/null @@ -1,226 +0,0 @@ - 'Real Name'). - * - * If the second parameter is provided and the first is a string, then $name - * is associated with the address. - * - * @param mixed $address - * @param string $name optional - */ - public function setSender($address, $name = null); - - /** - * Get the sender address for this message. - * - * This has a higher significance than the From address. - * - * @return string - */ - public function getSender(); - - /** - * Set the From address of this message. - * - * It is permissible for multiple From addresses to be set using an array. - * - * If multiple From addresses are used, you SHOULD set the Sender address and - * according to RFC 2822, MUST set the sender address. - * - * An array can be used if display names are to be provided: i.e. - * array('email@address.com' => 'Real Name'). - * - * If the second parameter is provided and the first is a string, then $name - * is associated with the address. - * - * @param mixed $addresses - * @param string $name optional - */ - public function setFrom($addresses, $name = null); - - /** - * Get the From address(es) of this message. - * - * This method always returns an associative array where the keys are the - * addresses. - * - * @return string[] - */ - public function getFrom(); - - /** - * Set the Reply-To address(es). - * - * Any replies from the receiver will be sent to this address. - * - * It is permissible for multiple reply-to addresses to be set using an array. - * - * This method has the same synopsis as {@link setFrom()} and {@link setTo()}. - * - * If the second parameter is provided and the first is a string, then $name - * is associated with the address. - * - * @param mixed $addresses - * @param string $name optional - */ - public function setReplyTo($addresses, $name = null); - - /** - * Get the Reply-To addresses for this message. - * - * This method always returns an associative array where the keys provide the - * email addresses. - * - * @return string[] - */ - public function getReplyTo(); - - /** - * Set the To address(es). - * - * Recipients set in this field will receive a copy of this message. - * - * This method has the same synopsis as {@link setFrom()} and {@link setCc()}. - * - * If the second parameter is provided and the first is a string, then $name - * is associated with the address. - * - * @param mixed $addresses - * @param string $name optional - */ - public function setTo($addresses, $name = null); - - /** - * Get the To addresses for this message. - * - * This method always returns an associative array, whereby the keys provide - * the actual email addresses. - * - * @return string[] - */ - public function getTo(); - - /** - * Set the Cc address(es). - * - * Recipients set in this field will receive a 'carbon-copy' of this message. - * - * This method has the same synopsis as {@link setFrom()} and {@link setTo()}. - * - * @param mixed $addresses - * @param string $name optional - */ - public function setCc($addresses, $name = null); - - /** - * Get the Cc addresses for this message. - * - * This method always returns an associative array, whereby the keys provide - * the actual email addresses. - * - * @return string[] - */ - public function getCc(); - - /** - * Set the Bcc address(es). - * - * Recipients set in this field will receive a 'blind-carbon-copy' of this - * message. - * - * In other words, they will get the message, but any other recipients of the - * message will have no such knowledge of their receipt of it. - * - * This method has the same synopsis as {@link setFrom()} and {@link setTo()}. - * - * @param mixed $addresses - * @param string $name optional - */ - public function setBcc($addresses, $name = null); - - /** - * Get the Bcc addresses for this message. - * - * This method always returns an associative array, whereby the keys provide - * the actual email addresses. - * - * @return string[] - */ - public function getBcc(); -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/MimeEntity.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/MimeEntity.php deleted file mode 100644 index 6dc61e6..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/MimeEntity.php +++ /dev/null @@ -1,101 +0,0 @@ -setContentType('text/plain'); - if (!is_null($charset)) { - $this->setCharset($charset); - } - } - - /** - * Set the body of this entity, either as a string, or as an instance of - * {@link Swift_OutputByteStream}. - * - * @param mixed $body - * @param string $contentType optional - * @param string $charset optional - * @param Swift_Mime_MimePart - */ - public function setBody($body, $contentType = null, $charset = null) - { - if (isset($charset)) { - $this->setCharset($charset); - } - $body = $this->_convertString($body); - - parent::setBody($body, $contentType); - - return $this; - } - - /** - * Get the character set of this entity. - * - * @return string - */ - public function getCharset() - { - return $this->_getHeaderParameter('Content-Type', 'charset'); - } - - /** - * Set the character set of this entity. - * - * @param string $charset - * @param Swift_Mime_MimePart - */ - public function setCharset($charset) - { - $this->_setHeaderParameter('Content-Type', 'charset', $charset); - if ($charset !== $this->_userCharset) { - $this->_clearCache(); - } - $this->_userCharset = $charset; - parent::charsetChanged($charset); - - return $this; - } - - /** - * Get the format of this entity (i.e. flowed or fixed). - * - * @return string - */ - public function getFormat() - { - return $this->_getHeaderParameter('Content-Type', 'format'); - } - - /** - * Set the format of this entity (flowed or fixed). - * - * @param string $format - * @param Swift_Mime_MimePart - */ - public function setFormat($format) - { - $this->_setHeaderParameter('Content-Type', 'format', $format); - $this->_userFormat = $format; - - return $this; - } - - /** - * Test if delsp is being used for this entity. - * - * @return boolean - */ - public function getDelSp() - { - return ($this->_getHeaderParameter('Content-Type', 'delsp') == 'yes') - ? true - : false; - } - - /** - * Turn delsp on or off for this entity. - * - * @param boolean $delsp - * @param Swift_Mime_MimePart - */ - public function setDelSp($delsp = true) - { - $this->_setHeaderParameter('Content-Type', 'delsp', $delsp ? 'yes' : null); - $this->_userDelSp = $delsp; - - return $this; - } - - /** - * Get the nesting level of this entity. - * - * @return int - * @see LEVEL_TOP, LEVEL_ALTERNATIVE, LEVEL_MIXED, LEVEL_RELATED - */ - public function getNestingLevel() - { - return $this->_nestingLevel; - } - - /** - * Receive notification that the charset has changed on this document, or a - * parent document. - * - * @param string $charset - */ - public function charsetChanged($charset) - { - $this->setCharset($charset); - } - - // -- Protected methods - - /** Fix the content-type and encoding of this entity */ - protected function _fixHeaders() - { - parent::_fixHeaders(); - if (count($this->getChildren())) { - $this->_setHeaderParameter('Content-Type', 'charset', null); - $this->_setHeaderParameter('Content-Type', 'format', null); - $this->_setHeaderParameter('Content-Type', 'delsp', null); - } else { - $this->setCharset($this->_userCharset); - $this->setFormat($this->_userFormat); - $this->setDelSp($this->_userDelSp); - } - } - - /** Set the nesting level of this entity */ - protected function _setNestingLevel($level) - { - $this->_nestingLevel = $level; - } - - /** Encode charset when charset is not utf-8 */ - protected function _convertString($string) - { - $charset = strtolower($this->getCharset()); - if (!in_array($charset, array('utf-8', 'iso-8859-1', ""))) { - // mb_convert_encoding must be the first one to check, since iconv cannot convert some words. - if (function_exists('mb_convert_encoding')) { - $string = mb_convert_encoding($string, $charset, 'utf-8'); - } elseif (function_exists('iconv')) { - $string = iconv($charset, 'utf-8//TRANSLIT//IGNORE', $string); - } else { - throw new Swift_SwiftException('No suitable convert encoding function (use UTF-8 as your harset or install the mbstring or iconv extension).'); - } - - return $string; - } - - return $string; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ParameterizedHeader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ParameterizedHeader.php deleted file mode 100644 index 74fed64..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ParameterizedHeader.php +++ /dev/null @@ -1,31 +0,0 @@ -_encoder = $encoder; - $this->_paramEncoder = $paramEncoder; - $this->_grammar = $grammar; - $this->_charset = $charset; - } - - /** - * Create a new Mailbox Header with a list of $addresses. - * @param string $name - * @param array|string $addresses - * @return Swift_Mime_Header - */ - public function createMailboxHeader($name, $addresses = null) - { - $header = new Swift_Mime_Headers_MailboxHeader($name, $this->_encoder, $this->_grammar); - if (isset($addresses)) { - $header->setFieldBodyModel($addresses); - } - $this->_setHeaderCharset($header); - - return $header; - } - - /** - * Create a new Date header using $timestamp (UNIX time). - * @param string $name - * @param int $timestamp - * @return Swift_Mime_Header - */ - public function createDateHeader($name, $timestamp = null) - { - $header = new Swift_Mime_Headers_DateHeader($name, $this->_grammar); - if (isset($timestamp)) { - $header->setFieldBodyModel($timestamp); - } - $this->_setHeaderCharset($header); - - return $header; - } - - /** - * Create a new basic text header with $name and $value. - * @param string $name - * @param string $value - * @return Swift_Mime_Header - */ - public function createTextHeader($name, $value = null) - { - $header = new Swift_Mime_Headers_UnstructuredHeader($name, $this->_encoder, $this->_grammar); - if (isset($value)) { - $header->setFieldBodyModel($value); - } - $this->_setHeaderCharset($header); - - return $header; - } - - /** - * Create a new ParameterizedHeader with $name, $value and $params. - * @param string $name - * @param string $value - * @param array $params - * @return Swift_Mime_ParameterizedHeader - */ - public function createParameterizedHeader($name, $value = null, - $params = array()) - { - $header = new Swift_Mime_Headers_ParameterizedHeader($name, - $this->_encoder, (strtolower($name) == 'content-disposition') - ? $this->_paramEncoder - : null, - $this->_grammar - ); - if (isset($value)) { - $header->setFieldBodyModel($value); - } - foreach ($params as $k => $v) { - $header->setParameter($k, $v); - } - $this->_setHeaderCharset($header); - - return $header; - } - - /** - * Create a new ID header for Message-ID or Content-ID. - * @param string $name - * @param string|array $ids - * @return Swift_Mime_Header - */ - public function createIdHeader($name, $ids = null) - { - $header = new Swift_Mime_Headers_IdentificationHeader($name, $this->_grammar); - if (isset($ids)) { - $header->setFieldBodyModel($ids); - } - $this->_setHeaderCharset($header); - - return $header; - } - - /** - * Create a new Path header with an address (path) in it. - * @param string $name - * @param string $path - * @return Swift_Mime_Header - */ - public function createPathHeader($name, $path = null) - { - $header = new Swift_Mime_Headers_PathHeader($name, $this->_grammar); - if (isset($path)) { - $header->setFieldBodyModel($path); - } - $this->_setHeaderCharset($header); - - return $header; - } - - /** - * Notify this observer that the entity's charset has changed. - * @param string $charset - */ - public function charsetChanged($charset) - { - $this->_charset = $charset; - $this->_encoder->charsetChanged($charset); - $this->_paramEncoder->charsetChanged($charset); - } - - // -- Private methods - - /** Apply the charset to the Header */ - private function _setHeaderCharset(Swift_Mime_Header $header) - { - if (isset($this->_charset)) { - $header->setCharset($this->_charset); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php deleted file mode 100644 index 2314a35..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php +++ /dev/null @@ -1,376 +0,0 @@ -_factory = $factory; - if (isset($charset)) { - $this->setCharset($charset); - } - } - - /** - * Set the charset used by these headers. - * - * @param string $charset - */ - public function setCharset($charset) - { - $this->_charset = $charset; - $this->_factory->charsetChanged($charset); - $this->_notifyHeadersOfCharset($charset); - } - - /** - * Add a new Mailbox Header with a list of $addresses. - * - * @param string $name - * @param array|string $addresses - */ - public function addMailboxHeader($name, $addresses = null) - { - $this->_storeHeader($name, - $this->_factory->createMailboxHeader($name, $addresses)); - } - - /** - * Add a new Date header using $timestamp (UNIX time). - * - * @param string $name - * @param int $timestamp - */ - public function addDateHeader($name, $timestamp = null) - { - $this->_storeHeader($name, - $this->_factory->createDateHeader($name, $timestamp)); - } - - /** - * Add a new basic text header with $name and $value. - * - * @param string $name - * @param string $value - */ - public function addTextHeader($name, $value = null) - { - $this->_storeHeader($name, - $this->_factory->createTextHeader($name, $value)); - } - - /** - * Add a new ParameterizedHeader with $name, $value and $params. - * - * @param string $name - * @param string $value - * @param array $params - */ - public function addParameterizedHeader($name, $value = null, $params = array()) - { - $this->_storeHeader($name, - $this->_factory->createParameterizedHeader($name, $value, - $params)); - } - - /** - * Add a new ID header for Message-ID or Content-ID. - * - * @param string $name - * @param string|array $ids - */ - public function addIdHeader($name, $ids = null) - { - $this->_storeHeader($name, $this->_factory->createIdHeader($name, $ids)); - } - - /** - * Add a new Path header with an address (path) in it. - * - * @param string $name - * @param string $path - */ - public function addPathHeader($name, $path = null) - { - $this->_storeHeader($name, $this->_factory->createPathHeader($name, $path)); - } - - /** - * Returns true if at least one header with the given $name exists. - * - * If multiple headers match, the actual one may be specified by $index. - * - * @param string $name - * @param int $index - * - * @return boolean - */ - public function has($name, $index = 0) - { - $lowerName = strtolower($name); - - return array_key_exists($lowerName, $this->_headers) - && array_key_exists($index, $this->_headers[$lowerName]); - } - - /** - * Set a header in the HeaderSet. - * - * The header may be a previously fetched header via {@link get()} or it may - * be one that has been created separately. - * - * If $index is specified, the header will be inserted into the set at this - * offset. - * - * @param Swift_Mime_Header $header - * @param int $index - */ - public function set(Swift_Mime_Header $header, $index = 0) - { - $this->_storeHeader($header->getFieldName(), $header, $index); - } - - /** - * Get the header with the given $name. - * - * If multiple headers match, the actual one may be specified by $index. - * Returns NULL if none present. - * - * @param string $name - * @param int $index - * - * @return Swift_Mime_Header - */ - public function get($name, $index = 0) - { - if ($this->has($name, $index)) { - $lowerName = strtolower($name); - - return $this->_headers[$lowerName][$index]; - } - } - - /** - * Get all headers with the given $name. - * - * @param string $name - * - * @return array - */ - public function getAll($name = null) - { - if (!isset($name)) { - $headers = array(); - foreach ($this->_headers as $collection) { - $headers = array_merge($headers, $collection); - } - - return $headers; - } - - $lowerName = strtolower($name); - if (!array_key_exists($lowerName, $this->_headers)) { - return array(); - } - - return $this->_headers[$lowerName]; - } - - /** - * Remove the header with the given $name if it's set. - * - * If multiple headers match, the actual one may be specified by $index. - * - * @param string $name - * @param int $index - */ - public function remove($name, $index = 0) - { - $lowerName = strtolower($name); - unset($this->_headers[$lowerName][$index]); - } - - /** - * Remove all headers with the given $name. - * - * @param string $name - */ - public function removeAll($name) - { - $lowerName = strtolower($name); - unset($this->_headers[$lowerName]); - } - - /** - * Create a new instance of this HeaderSet. - * - * @return Swift_Mime_HeaderSet - */ - public function newInstance() - { - return new self($this->_factory); - } - - /** - * Define a list of Header names as an array in the correct order. - * - * These Headers will be output in the given order where present. - * - * @param array $sequence - */ - public function defineOrdering(array $sequence) - { - $this->_order = array_flip(array_map('strtolower', $sequence)); - } - - /** - * Set a list of header names which must always be displayed when set. - * - * Usually headers without a field value won't be output unless set here. - * - * @param array $names - */ - public function setAlwaysDisplayed(array $names) - { - $this->_required = array_flip(array_map('strtolower', $names)); - } - - /** - * Notify this observer that the entity's charset has changed. - * - * @param string $charset - */ - public function charsetChanged($charset) - { - $this->setCharset($charset); - } - - /** - * Returns a string with a representation of all headers. - * - * @return string - */ - public function toString() - { - $string = ''; - $headers = $this->_headers; - if ($this->_canSort()) { - uksort($headers, array($this, '_sortHeaders')); - } - foreach ($headers as $collection) { - foreach ($collection as $header) { - if ($this->_isDisplayed($header) || $header->getFieldBody() != '') { - $string .= $header->toString(); - } - } - } - - return $string; - } - - /** - * Returns a string representation of this object. - * - * @return string - * - * @see toString() - */ - public function __toString() - { - return $this->toString(); - } - - // -- Private methods - - /** Save a Header to the internal collection */ - private function _storeHeader($name, Swift_Mime_Header $header, $offset = null) - { - if (!isset($this->_headers[strtolower($name)])) { - $this->_headers[strtolower($name)] = array(); - } - if (!isset($offset)) { - $this->_headers[strtolower($name)][] = $header; - } else { - $this->_headers[strtolower($name)][$offset] = $header; - } - } - - /** Test if the headers can be sorted */ - private function _canSort() - { - return count($this->_order) > 0; - } - - /** uksort() algorithm for Header ordering */ - private function _sortHeaders($a, $b) - { - $lowerA = strtolower($a); - $lowerB = strtolower($b); - $aPos = array_key_exists($lowerA, $this->_order) - ? $this->_order[$lowerA] - : -1; - $bPos = array_key_exists($lowerB, $this->_order) - ? $this->_order[$lowerB] - : -1; - - if ($aPos == -1) { - return 1; - } elseif ($bPos == -1) { - return -1; - } - - return ($aPos < $bPos) ? -1 : 1; - } - - /** Test if the given Header is always displayed */ - private function _isDisplayed(Swift_Mime_Header $header) - { - return array_key_exists(strtolower($header->getFieldName()), $this->_required); - } - - /** Notify all Headers of the new charset */ - private function _notifyHeadersOfCharset($charset) - { - foreach ($this->_headers as $headerGroup) { - foreach ($headerGroup as $header) { - $header->setCharset($charset); - } - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php deleted file mode 100644 index 6481978..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php +++ /dev/null @@ -1,611 +0,0 @@ -getHeaders()->defineOrdering(array( - 'Return-Path', - 'Sender', - 'Message-ID', - 'Date', - 'Subject', - 'From', - 'Reply-To', - 'To', - 'Cc', - 'Bcc', - 'MIME-Version', - 'Content-Type', - 'Content-Transfer-Encoding' - )); - $this->getHeaders()->setAlwaysDisplayed( - array('Date', 'Message-ID', 'From') - ); - $this->getHeaders()->addTextHeader('MIME-Version', '1.0'); - $this->setDate(time()); - $this->setId($this->getId()); - $this->getHeaders()->addMailboxHeader('From'); - } - - /** - * Always returns {@link LEVEL_TOP} for a message instance. - * @return int - */ - public function getNestingLevel() - { - return self::LEVEL_TOP; - } - - /** - * Set the subject of this message. - * @param string $subject - * @return Swift_Mime_SimpleMessage - */ - public function setSubject($subject) - { - if (!$this->_setHeaderFieldModel('Subject', $subject)) { - $this->getHeaders()->addTextHeader('Subject', $subject); - } - - return $this; - } - - /** - * Get the subject of this message. - * @return string - */ - public function getSubject() - { - return $this->_getHeaderFieldModel('Subject'); - } - - /** - * Set the date at which this message was created. - * @param int $date - * @return Swift_Mime_SimpleMessage - */ - public function setDate($date) - { - if (!$this->_setHeaderFieldModel('Date', $date)) { - $this->getHeaders()->addDateHeader('Date', $date); - } - - return $this; - } - - /** - * Get the date at which this message was created. - * @return int - */ - public function getDate() - { - return $this->_getHeaderFieldModel('Date'); - } - - /** - * Set the return-path (the bounce address) of this message. - * @param string $address - * @return Swift_Mime_SimpleMessage - */ - public function setReturnPath($address) - { - if (!$this->_setHeaderFieldModel('Return-Path', $address)) { - $this->getHeaders()->addPathHeader('Return-Path', $address); - } - - return $this; - } - - /** - * Get the return-path (bounce address) of this message. - * @return string - */ - public function getReturnPath() - { - return $this->_getHeaderFieldModel('Return-Path'); - } - - /** - * Set the sender of this message. - * This does not override the From field, but it has a higher significance. - * @param string $sender - * @param string $name optional - * @return Swift_Mime_SimpleMessage - */ - public function setSender($address, $name = null) - { - if (!is_array($address) && isset($name)) { - $address = array($address => $name); - } - - if (!$this->_setHeaderFieldModel('Sender', (array) $address)) { - $this->getHeaders()->addMailboxHeader('Sender', (array) $address); - } - - return $this; - } - - /** - * Get the sender of this message. - * @return string - */ - public function getSender() - { - return $this->_getHeaderFieldModel('Sender'); - } - - /** - * Add a From: address to this message. - * - * If $name is passed this name will be associated with the address. - * - * @param string $address - * @param string $name optional - */ - public function addFrom($address, $name = null) - { - $current = $this->getFrom(); - $current[$address] = $name; - - return $this->setFrom($current); - } - - /** - * Set the from address of this message. - * - * You may pass an array of addresses if this message is from multiple people. - * - * If $name is passed and the first parameter is a string, this name will be - * associated with the address. - * - * @param string $addresses - * @param string $name optional - * @return Swift_Mime_SimpleMessage - */ - public function setFrom($addresses, $name = null) - { - if (!is_array($addresses) && isset($name)) { - $addresses = array($addresses => $name); - } - - if (!$this->_setHeaderFieldModel('From', (array) $addresses)) { - $this->getHeaders()->addMailboxHeader('From', (array) $addresses); - } - - return $this; - } - - /** - * Get the from address of this message. - * - * @return string - */ - public function getFrom() - { - return $this->_getHeaderFieldModel('From'); - } - - /** - * Add a Reply-To: address to this message. - * - * If $name is passed this name will be associated with the address. - * - * @param string $address - * @param string $name optional - * @return Swift_Mime_SimpleMessage - */ - public function addReplyTo($address, $name = null) - { - $current = $this->getReplyTo(); - $current[$address] = $name; - - return $this->setReplyTo($current); - } - - /** - * Set the reply-to address of this message. - * - * You may pass an array of addresses if replies will go to multiple people. - * - * If $name is passed and the first parameter is a string, this name will be - * associated with the address. - * - * @param string $addresses - * @param string $name optional - * @return Swift_Mime_SimpleMessage - */ - public function setReplyTo($addresses, $name = null) - { - if (!is_array($addresses) && isset($name)) { - $addresses = array($addresses => $name); - } - - if (!$this->_setHeaderFieldModel('Reply-To', (array) $addresses)) { - $this->getHeaders()->addMailboxHeader('Reply-To', (array) $addresses); - } - - return $this; - } - - /** - * Get the reply-to address of this message. - * - * @return string - */ - public function getReplyTo() - { - return $this->_getHeaderFieldModel('Reply-To'); - } - - /** - * Add a To: address to this message. - * - * If $name is passed this name will be associated with the address. - * - * @param string $address - * @param string $name optional - * @return Swift_Mime_SimpleMessage - */ - public function addTo($address, $name = null) - { - $current = $this->getTo(); - $current[$address] = $name; - - return $this->setTo($current); - } - - /** - * Set the to addresses of this message. - * - * If multiple recipients will receive the message and array should be used. - * - * If $name is passed and the first parameter is a string, this name will be - * associated with the address. - * - * @param array $addresses - * @param string $name optional - * @return Swift_Mime_SimpleMessage - */ - public function setTo($addresses, $name = null) - { - if (!is_array($addresses) && isset($name)) { - $addresses = array($addresses => $name); - } - - if (!$this->_setHeaderFieldModel('To', (array) $addresses)) { - $this->getHeaders()->addMailboxHeader('To', (array) $addresses); - } - - return $this; - } - - /** - * Get the To addresses of this message. - * - * @return array - */ - public function getTo() - { - return $this->_getHeaderFieldModel('To'); - } - - /** - * Add a Cc: address to this message. - * - * If $name is passed this name will be associated with the address. - * - * @param string $address - * @param string $name optional - * @return Swift_Mime_SimpleMessage - */ - public function addCc($address, $name = null) - { - $current = $this->getCc(); - $current[$address] = $name; - - return $this->setCc($current); - } - - /** - * Set the Cc addresses of this message. - * - * If $name is passed and the first parameter is a string, this name will be - * associated with the address. - * - * @param array $addresses - * @param string $name optional - * @return Swift_Mime_SimpleMessage - */ - public function setCc($addresses, $name = null) - { - if (!is_array($addresses) && isset($name)) { - $addresses = array($addresses => $name); - } - - if (!$this->_setHeaderFieldModel('Cc', (array) $addresses)) { - $this->getHeaders()->addMailboxHeader('Cc', (array) $addresses); - } - - return $this; - } - - /** - * Get the Cc address of this message. - * - * @return array - */ - public function getCc() - { - return $this->_getHeaderFieldModel('Cc'); - } - - /** - * Add a Bcc: address to this message. - * - * If $name is passed this name will be associated with the address. - * - * @param string $address - * @param string $name optional - * @return Swift_Mime_SimpleMessage - */ - public function addBcc($address, $name = null) - { - $current = $this->getBcc(); - $current[$address] = $name; - - return $this->setBcc($current); - } - - /** - * Set the Bcc addresses of this message. - * - * If $name is passed and the first parameter is a string, this name will be - * associated with the address. - * - * @param array $addresses - * @param string $name optional - * @return Swift_Mime_SimpleMessage - */ - public function setBcc($addresses, $name = null) - { - if (!is_array($addresses) && isset($name)) { - $addresses = array($addresses => $name); - } - - if (!$this->_setHeaderFieldModel('Bcc', (array) $addresses)) { - $this->getHeaders()->addMailboxHeader('Bcc', (array) $addresses); - } - - return $this; - } - - /** - * Get the Bcc addresses of this message. - * - * @return array - */ - public function getBcc() - { - return $this->_getHeaderFieldModel('Bcc'); - } - - /** - * Set the priority of this message. - * The value is an integer where 1 is the highest priority and 5 is the lowest. - * @param int $priority - * @return Swift_Mime_SimpleMessage - */ - public function setPriority($priority) - { - $priorityMap = array( - 1 => 'Highest', - 2 => 'High', - 3 => 'Normal', - 4 => 'Low', - 5 => 'Lowest' - ); - $pMapKeys = array_keys($priorityMap); - if ($priority > max($pMapKeys)) { - $priority = max($pMapKeys); - } elseif ($priority < min($pMapKeys)) { - $priority = min($pMapKeys); - } - if (!$this->_setHeaderFieldModel('X-Priority', - sprintf('%d (%s)', $priority, $priorityMap[$priority]))) - { - $this->getHeaders()->addTextHeader('X-Priority', - sprintf('%d (%s)', $priority, $priorityMap[$priority])); - } - - return $this; - } - - /** - * Get the priority of this message. - * The returned value is an integer where 1 is the highest priority and 5 - * is the lowest. - * @return int - */ - public function getPriority() - { - list($priority) = sscanf($this->_getHeaderFieldModel('X-Priority'), - '%[1-5]' - ); - - return isset($priority) ? $priority : 3; - } - - /** - * Ask for a delivery receipt from the recipient to be sent to $addresses - * @param array $addresses - * @return Swift_Mime_SimpleMessage - */ - public function setReadReceiptTo($addresses) - { - if (!$this->_setHeaderFieldModel('Disposition-Notification-To', $addresses)) { - $this->getHeaders() - ->addMailboxHeader('Disposition-Notification-To', $addresses); - } - - return $this; - } - - /** - * Get the addresses to which a read-receipt will be sent. - * @return string - */ - public function getReadReceiptTo() - { - return $this->_getHeaderFieldModel('Disposition-Notification-To'); - } - - /** - * Attach a {@link Swift_Mime_MimeEntity} such as an Attachment or MimePart. - * @param Swift_Mime_MimeEntity $entity - * @return Swift_Mime_SimpleMessage - */ - public function attach(Swift_Mime_MimeEntity $entity) - { - $this->setChildren(array_merge($this->getChildren(), array($entity))); - - return $this; - } - - /** - * Remove an already attached entity. - * @param Swift_Mime_MimeEntity $entity - * @return Swift_Mime_SimpleMessage - */ - public function detach(Swift_Mime_MimeEntity $entity) - { - $newChildren = array(); - foreach ($this->getChildren() as $child) { - if ($entity !== $child) { - $newChildren[] = $child; - } - } - $this->setChildren($newChildren); - - return $this; - } - - /** - * Attach a {@link Swift_Mime_MimeEntity} and return it's CID source. - * This method should be used when embedding images or other data in a message. - * @param Swift_Mime_MimeEntity $entity - * @return string - */ - public function embed(Swift_Mime_MimeEntity $entity) - { - $this->attach($entity); - - return 'cid:' . $entity->getId(); - } - - /** - * Get this message as a complete string. - * @return string - */ - public function toString() - { - if (count($children = $this->getChildren()) > 0 && $this->getBody() != '') { - $this->setChildren(array_merge(array($this->_becomeMimePart()), $children)); - $string = parent::toString(); - $this->setChildren($children); - } else { - $string = parent::toString(); - } - - return $string; - } - - /** - * Returns a string representation of this object. - * - * @return string - * - * @see toString() - */ - public function __toString() - { - return $this->toString(); - } - - /** - * Write this message to a {@link Swift_InputByteStream}. - * @param Swift_InputByteStream $is - */ - public function toByteStream(Swift_InputByteStream $is) - { - if (count($children = $this->getChildren()) > 0 && $this->getBody() != '') { - $this->setChildren(array_merge(array($this->_becomeMimePart()), $children)); - parent::toByteStream($is); - $this->setChildren($children); - } else { - parent::toByteStream($is); - } - } - - // -- Protected methods - - /** @see Swift_Mime_SimpleMimeEntity::_getIdField() */ - protected function _getIdField() - { - return 'Message-ID'; - } - - // -- Private methods - - /** Turn the body of this message into a child of itself if needed */ - private function _becomeMimePart() - { - $part = new parent($this->getHeaders()->newInstance(), $this->getEncoder(), - $this->_getCache(), $this->_getGrammar(), $this->_userCharset - ); - $part->setContentType($this->_userContentType); - $part->setBody($this->getBody()); - $part->setFormat($this->_userFormat); - $part->setDelSp($this->_userDelSp); - $part->_setNestingLevel($this->_getTopNestingLevel()); - - return $part; - } - - /** Get the highest nesting level nested inside this message */ - private function _getTopNestingLevel() - { - $highestLevel = $this->getNestingLevel(); - foreach ($this->getChildren() as $child) { - $childLevel = $child->getNestingLevel(); - if ($highestLevel < $childLevel) { - $highestLevel = $childLevel; - } - } - - return $highestLevel; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php deleted file mode 100644 index 5f0878c..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php +++ /dev/null @@ -1,797 +0,0 @@ - array(self::LEVEL_TOP, self::LEVEL_MIXED), - 'multipart/alternative' => array(self::LEVEL_MIXED, self::LEVEL_ALTERNATIVE), - 'multipart/related' => array(self::LEVEL_ALTERNATIVE, self::LEVEL_RELATED) - ); - - /** A set of filter rules to define what level an entity should be nested at */ - private $_compoundLevelFilters = array(); - - /** The nesting level of this entity */ - private $_nestingLevel = self::LEVEL_ALTERNATIVE; - - /** A KeyCache instance used during encoding and streaming */ - private $_cache; - - /** Direct descendants of this entity */ - private $_immediateChildren = array(); - - /** All descendants of this entity */ - private $_children = array(); - - /** The maximum line length of the body of this entity */ - private $_maxLineLength = 78; - - /** The order in which alternative mime types should appear */ - private $_alternativePartOrder = array( - 'text/plain' => 1, - 'text/html' => 2, - 'multipart/related' => 3 - ); - - /** The CID of this entity */ - private $_id; - - /** The key used for accessing the cache */ - private $_cacheKey; - - protected $_userContentType; - - /** - * Create a new SimpleMimeEntity with $headers, $encoder and $cache. - * @param Swift_Mime_HeaderSet $headers - * @param Swift_Mime_ContentEncoder $encoder - * @param Swift_KeyCache $cache - * @param Swift_Mime_Grammar $grammar - */ - public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_Mime_Grammar $grammar) - { - $this->_cacheKey = uniqid(); - $this->_cache = $cache; - $this->_headers = $headers; - $this->_grammar = $grammar; - $this->setEncoder($encoder); - $this->_headers->defineOrdering( - array('Content-Type', 'Content-Transfer-Encoding') - ); - - // This array specifies that, when the entire MIME document contains - // $compoundLevel, then for each child within $level, if its Content-Type - // is $contentType then it should be treated as if it's level is - // $neededLevel instead. I tried to write that unambiguously! :-\ - // Data Structure: - // array ( - // $compoundLevel => array( - // $level => array( - // $contentType => $neededLevel - // ) - // ) - // ) - - $this->_compoundLevelFilters = array( - (self::LEVEL_ALTERNATIVE + self::LEVEL_RELATED) => array( - self::LEVEL_ALTERNATIVE => array( - 'text/plain' => self::LEVEL_ALTERNATIVE, - 'text/html' => self::LEVEL_RELATED - ) - ) - ); - - $this->_id = $this->getRandomId(); - } - - /** - * Generate a new Content-ID or Message-ID for this MIME entity. - * @return string - */ - public function generateId() - { - $this->setId($this->getRandomId()); - - return $this->_id; - } - - /** - * Get the {@link Swift_Mime_HeaderSet} for this entity. - * @return Swift_Mime_HeaderSet - */ - public function getHeaders() - { - return $this->_headers; - } - - /** - * Get the nesting level of this entity. - * @return int - * @see LEVEL_TOP, LEVEL_MIXED, LEVEL_RELATED, LEVEL_ALTERNATIVE - */ - public function getNestingLevel() - { - return $this->_nestingLevel; - } - - /** - * Get the Content-type of this entity. - * @return string - */ - public function getContentType() - { - return $this->_getHeaderFieldModel('Content-Type'); - } - - /** - * Set the Content-type of this entity. - * @param string $type - * @return Swift_Mime_SimpleMimeEntity - */ - public function setContentType($type) - { - $this->_setContentTypeInHeaders($type); - // Keep track of the value so that if the content-type changes automatically - // due to added child entities, it can be restored if they are later removed - $this->_userContentType = $type; - - return $this; - } - - /** - * Get the CID of this entity. - * The CID will only be present in headers if a Content-ID header is present. - * @return string - */ - public function getId() - { - return $this->_headers->has($this->_getIdField()) - ? current((array) $this->_getHeaderFieldModel($this->_getIdField())) - : $this->_id; - } - - /** - * Set the CID of this entity. - * @param string $id - * @return Swift_Mime_SimpleMimeEntity - */ - public function setId($id) - { - if (!$this->_setHeaderFieldModel($this->_getIdField(), $id)) { - $this->_headers->addIdHeader($this->_getIdField(), $id); - } - $this->_id = $id; - - return $this; - } - - /** - * Get the description of this entity. - * This value comes from the Content-Description header if set. - * @return string - */ - public function getDescription() - { - return $this->_getHeaderFieldModel('Content-Description'); - } - - /** - * Set the description of this entity. - * This method sets a value in the Content-ID header. - * @param string $description - * @return Swift_Mime_SimpleMimeEntity - */ - public function setDescription($description) - { - if (!$this->_setHeaderFieldModel('Content-Description', $description)) { - $this->_headers->addTextHeader('Content-Description', $description); - } - - return $this; - } - - /** - * Get the maximum line length of the body of this entity. - * @return int - */ - public function getMaxLineLength() - { - return $this->_maxLineLength; - } - - /** - * Set the maximum line length of lines in this body. - * Though not enforced by the library, lines should not exceed 1000 chars. - * @param int $length - * @return Swift_Mime_SimpleMimeEntity - */ - public function setMaxLineLength($length) - { - $this->_maxLineLength = $length; - - return $this; - } - - /** - * Get all children added to this entity. - * @return array of Swift_Mime_Entity - */ - public function getChildren() - { - return $this->_children; - } - - /** - * Set all children of this entity. - * @param array $children Swiift_Mime_Entity instances - * @param int $compoundLevel For internal use only - * @return Swift_Mime_SimpleMimeEntity - */ - public function setChildren(array $children, $compoundLevel = null) - { - //TODO: Try to refactor this logic - - $compoundLevel = isset($compoundLevel) - ? $compoundLevel - : $this->_getCompoundLevel($children) - ; - - $immediateChildren = array(); - $grandchildren = array(); - $newContentType = $this->_userContentType; - - foreach ($children as $child) { - $level = $this->_getNeededChildLevel($child, $compoundLevel); - if (empty($immediateChildren)) { //first iteration - $immediateChildren = array($child); - } else { - $nextLevel = $this->_getNeededChildLevel($immediateChildren[0], $compoundLevel); - if ($nextLevel == $level) { - $immediateChildren[] = $child; - } elseif ($level < $nextLevel) { - //Re-assign immediateChildren to grandchilden - $grandchildren = array_merge($grandchildren, $immediateChildren); - //Set new children - $immediateChildren = array($child); - } else { - $grandchildren[] = $child; - } - } - } - - if (!empty($immediateChildren)) { - $lowestLevel = $this->_getNeededChildLevel($immediateChildren[0], $compoundLevel); - - //Determine which composite media type is needed to accomodate the - // immediate children - foreach ($this->_compositeRanges as $mediaType => $range) { - if ($lowestLevel > $range[0] - && $lowestLevel <= $range[1]) - { - $newContentType = $mediaType; - break; - } - } - - //Put any grandchildren in a subpart - if (!empty($grandchildren)) { - $subentity = $this->_createChild(); - $subentity->_setNestingLevel($lowestLevel); - $subentity->setChildren($grandchildren, $compoundLevel); - array_unshift($immediateChildren, $subentity); - } - } - - $this->_immediateChildren = $immediateChildren; - $this->_children = $children; - $this->_setContentTypeInHeaders($newContentType); - $this->_fixHeaders(); - $this->_sortChildren(); - - return $this; - } - - /** - * Get the body of this entity as a string. - * @return string - */ - public function getBody() - { - return ($this->_body instanceof Swift_OutputByteStream) - ? $this->_readStream($this->_body) - : $this->_body; - } - - /** - * Set the body of this entity, either as a string, or as an instance of - * {@link Swift_OutputByteStream}. - * @param mixed $body - * @param string $contentType optional - * @return Swift_Mime_SimpleMimeEntity - */ - public function setBody($body, $contentType = null) - { - if ($body !== $this->_body) { - $this->_clearCache(); - } - - $this->_body = $body; - if (isset($contentType)) { - $this->setContentType($contentType); - } - - return $this; - } - - /** - * Get the encoder used for the body of this entity. - * @return Swift_Mime_ContentEncoder - */ - public function getEncoder() - { - return $this->_encoder; - } - - /** - * Set the encoder used for the body of this entity. - * @param Swift_Mime_ContentEncoder $encoder - * @return Swift_Mime_SimpleMimeEntity - */ - public function setEncoder(Swift_Mime_ContentEncoder $encoder) - { - if ($encoder !== $this->_encoder) { - $this->_clearCache(); - } - - $this->_encoder = $encoder; - $this->_setEncoding($encoder->getName()); - $this->_notifyEncoderChanged($encoder); - - return $this; - } - - /** - * Get the boundary used to separate children in this entity. - * @return string - */ - public function getBoundary() - { - if (!isset($this->_boundary)) { - $this->_boundary = '_=_swift_v4_' . time() . uniqid() . '_=_'; - } - - return $this->_boundary; - } - - /** - * Set the boundary used to separate children in this entity. - * @param string $boundary - * @throws Swift_RfcComplianceException - * @return Swift_Mime_SimpleMimeEntity - */ - public function setBoundary($boundary) - { - $this->_assertValidBoundary($boundary); - $this->_boundary = $boundary; - - return $this; - } - - /** - * Receive notification that the charset of this entity, or a parent entity - * has changed. - * @param string $charset - */ - public function charsetChanged($charset) - { - $this->_notifyCharsetChanged($charset); - } - - /** - * Receive notification that the encoder of this entity or a parent entity - * has changed. - * @param Swift_Mime_ContentEncoder $encoder - */ - public function encoderChanged(Swift_Mime_ContentEncoder $encoder) - { - $this->_notifyEncoderChanged($encoder); - } - - /** - * Get this entire entity as a string. - * @return string - */ - public function toString() - { - $string = $this->_headers->toString(); - if (isset($this->_body) && empty($this->_immediateChildren)) { - if ($this->_cache->hasKey($this->_cacheKey, 'body')) { - $body = $this->_cache->getString($this->_cacheKey, 'body'); - } else { - $body = "\r\n" . $this->_encoder->encodeString($this->getBody(), 0, - $this->getMaxLineLength() - ); - $this->_cache->setString($this->_cacheKey, 'body', $body, - Swift_KeyCache::MODE_WRITE - ); - } - $string .= $body; - } - - if (!empty($this->_immediateChildren)) { - foreach ($this->_immediateChildren as $child) { - $string .= "\r\n\r\n--" . $this->getBoundary() . "\r\n"; - $string .= $child->toString(); - } - $string .= "\r\n\r\n--" . $this->getBoundary() . "--\r\n"; - } - - return $string; - } - - /** - * Returns a string representation of this object. - * - * @return string - * - * @see toString() - */ - public function __toString() - { - return $this->toString(); - } - - /** - * Write this entire entity to a {@link Swift_InputByteStream}. - * @param Swift_InputByteStream - */ - public function toByteStream(Swift_InputByteStream $is) - { - $is->write($this->_headers->toString()); - $is->commit(); - - if (empty($this->_immediateChildren)) { - if (isset($this->_body)) { - if ($this->_cache->hasKey($this->_cacheKey, 'body')) { - $this->_cache->exportToByteStream($this->_cacheKey, 'body', $is); - } else { - $cacheIs = $this->_cache->getInputByteStream($this->_cacheKey, 'body'); - if ($cacheIs) { - $is->bind($cacheIs); - } - - $is->write("\r\n"); - - if ($this->_body instanceof Swift_OutputByteStream) { - $this->_body->setReadPointer(0); - - $this->_encoder->encodeByteStream($this->_body, $is, 0, - $this->getMaxLineLength() - ); - } else { - $is->write($this->_encoder->encodeString( - $this->getBody(), 0, $this->getMaxLineLength() - )); - } - - if ($cacheIs) { - $is->unbind($cacheIs); - } - } - } - } - - if (!empty($this->_immediateChildren)) { - foreach ($this->_immediateChildren as $child) { - $is->write("\r\n\r\n--" . $this->getBoundary() . "\r\n"); - $child->toByteStream($is); - } - $is->write("\r\n\r\n--" . $this->getBoundary() . "--\r\n"); - } - } - - // -- Protected methods - - /** - * Get the name of the header that provides the ID of this entity */ - protected function _getIdField() - { - return 'Content-ID'; - } - - /** - * Get the model data (usually an array or a string) for $field. - */ - protected function _getHeaderFieldModel($field) - { - if ($this->_headers->has($field)) { - return $this->_headers->get($field)->getFieldBodyModel(); - } - } - - /** - * Set the model data for $field. - */ - protected function _setHeaderFieldModel($field, $model) - { - if ($this->_headers->has($field)) { - $this->_headers->get($field)->setFieldBodyModel($model); - - return true; - } else { - return false; - } - } - - /** - * Get the parameter value of $parameter on $field header. - */ - protected function _getHeaderParameter($field, $parameter) - { - if ($this->_headers->has($field)) { - return $this->_headers->get($field)->getParameter($parameter); - } - } - - /** - * Set the parameter value of $parameter on $field header. - */ - protected function _setHeaderParameter($field, $parameter, $value) - { - if ($this->_headers->has($field)) { - $this->_headers->get($field)->setParameter($parameter, $value); - - return true; - } else { - return false; - } - } - - /** - * Re-evaluate what content type and encoding should be used on this entity. - */ - protected function _fixHeaders() - { - if (count($this->_immediateChildren)) { - $this->_setHeaderParameter('Content-Type', 'boundary', - $this->getBoundary() - ); - $this->_headers->remove('Content-Transfer-Encoding'); - } else { - $this->_setHeaderParameter('Content-Type', 'boundary', null); - $this->_setEncoding($this->_encoder->getName()); - } - } - - /** - * Get the KeyCache used in this entity. - */ - protected function _getCache() - { - return $this->_cache; - } - - /** - * Get the grammar used for validation. - * @return Swift_Mime_Grammar - */ - protected function _getGrammar() - { - return $this->_grammar; - } - - /** - * Empty the KeyCache for this entity. - */ - protected function _clearCache() - { - $this->_cache->clearKey($this->_cacheKey, 'body'); - } - - /** - * Returns a random Content-ID or Message-ID. - * @return string - */ - protected function getRandomId() - { - $idLeft = time() . '.' . uniqid(); - $idRight = !empty($_SERVER['SERVER_NAME']) - ? $_SERVER['SERVER_NAME'] - : 'swift.generated'; - $id = $idLeft . '@' . $idRight; - - try { - $this->_assertValidId($id); - } catch (Swift_RfcComplianceException $e) { - $id = $idLeft . '@swift.generated'; - } - - return $id; - } - - // -- Private methods - - private function _readStream(Swift_OutputByteStream $os) - { - $string = ''; - while (false !== $bytes = $os->read(8192)) { - $string .= $bytes; - } - - return $string; - } - - private function _setEncoding($encoding) - { - if (!$this->_setHeaderFieldModel('Content-Transfer-Encoding', $encoding)) { - $this->_headers->addTextHeader('Content-Transfer-Encoding', $encoding); - } - } - - private function _assertValidBoundary($boundary) - { - if (!preg_match( - '/^[a-z0-9\'\(\)\+_\-,\.\/:=\?\ ]{0,69}[a-z0-9\'\(\)\+_\-,\.\/:=\?]$/Di', - $boundary)) - { - throw new Swift_RfcComplianceException('Mime boundary set is not RFC 2046 compliant.'); - } - } - - private function _setContentTypeInHeaders($type) - { - if (!$this->_setHeaderFieldModel('Content-Type', $type)) { - $this->_headers->addParameterizedHeader('Content-Type', $type); - } - } - - private function _setNestingLevel($level) - { - $this->_nestingLevel = $level; - } - - private function _getCompoundLevel($children) - { - $level = 0; - foreach ($children as $child) { - $level |= $child->getNestingLevel(); - } - - return $level; - } - - private function _getNeededChildLevel($child, $compoundLevel) - { - $filter = array(); - foreach ($this->_compoundLevelFilters as $bitmask => $rules) { - if (($compoundLevel & $bitmask) === $bitmask) { - $filter = $rules + $filter; - } - } - - $realLevel = $child->getNestingLevel(); - $lowercaseType = strtolower($child->getContentType()); - - if (isset($filter[$realLevel]) - && isset($filter[$realLevel][$lowercaseType])) - { - return $filter[$realLevel][$lowercaseType]; - } else { - return $realLevel; - } - } - - private function _createChild() - { - return new self($this->_headers->newInstance(), - $this->_encoder, $this->_cache, $this->_grammar); - } - - private function _notifyEncoderChanged(Swift_Mime_ContentEncoder $encoder) - { - foreach ($this->_immediateChildren as $child) { - $child->encoderChanged($encoder); - } - } - - private function _notifyCharsetChanged($charset) - { - $this->_encoder->charsetChanged($charset); - $this->_headers->charsetChanged($charset); - foreach ($this->_immediateChildren as $child) { - $child->charsetChanged($charset); - } - } - - private function _sortChildren() - { - $shouldSort = false; - foreach ($this->_immediateChildren as $child) { - //NOTE: This include alternative parts moved into a related part - if ($child->getNestingLevel() == self::LEVEL_ALTERNATIVE) { - $shouldSort = true; - break; - } - } - - //Sort in order of preference, if there is one - if ($shouldSort) { - usort($this->_immediateChildren, array($this, '_childSortAlgorithm')); - } - } - - private function _childSortAlgorithm($a, $b) - { - $typePrefs = array(); - $types = array( - strtolower($a->getContentType()), - strtolower($b->getContentType()) - ); - foreach ($types as $type) { - $typePrefs[] = (array_key_exists($type, $this->_alternativePartOrder)) - ? $this->_alternativePartOrder[$type] - : (max($this->_alternativePartOrder) + 1); - } - - return ($typePrefs[0] >= $typePrefs[1]) ? 1 : -1; - } - - // -- Destructor - - /** - * Empties it's own contents from the cache. - */ - public function __destruct() - { - $this->_cache->clearAll($this->_cacheKey); - } - - /** - * Throws an Exception if the id passed does not comply with RFC 2822. - * @param string $id - * @throws Swift_RfcComplianceException - */ - private function _assertValidId($id) - { - if (!preg_match( - '/^' . $this->_grammar->getDefinition('id-left') . '@' . - $this->_grammar->getDefinition('id-right') . '$/D', - $id - )) - { - throw new Swift_RfcComplianceException( - 'Invalid ID given <' . $id . '>' - ); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MimePart.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MimePart.php deleted file mode 100644 index ee060e8..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MimePart.php +++ /dev/null @@ -1,56 +0,0 @@ -createDependenciesFor('mime.part') - ); - - if (!isset($charset)) { - $charset = Swift_DependencyContainer::getInstance() - ->lookup('properties.charset'); - } - $this->setBody($body); - $this->setCharset($charset); - if ($contentType) { - $this->setContentType($contentType); - } - } - - /** - * Create a new MimePart. - * @param string $body - * @param string $contentType - * @param string $charset - * @return Swift_Mime_MimePart - */ - public static function newInstance($body = null, $contentType = null, $charset = null) - { - return new self($body, $contentType, $charset); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/NullTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/NullTransport.php deleted file mode 100644 index ab930e1..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/NullTransport.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Pretends messages have been sent, but just ignores them. - * @package Swift - * @author Fabien Potencier - */ -class Swift_NullTransport extends Swift_Transport_NullTransport -{ - /** - * Create a new NullTransport. - */ - public function __construct() - { - call_user_func_array( - array($this, 'Swift_Transport_NullTransport::__construct'), - Swift_DependencyContainer::getInstance() - ->createDependenciesFor('transport.null') - ); - } - - /** - * Create a new NullTransport instance. - * @return Swift_NullTransport - */ - public static function newInstance() - { - return new self(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/OutputByteStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/OutputByteStream.php deleted file mode 100644 index 325ce2f..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/OutputByteStream.php +++ /dev/null @@ -1,39 +0,0 @@ -setThreshold($threshold); - $this->setSleepTime($sleep); - $this->_sleeper = $sleeper; - } - - /** - * Set the number of emails to send before restarting. - * @param int $threshold - */ - public function setThreshold($threshold) - { - $this->_threshold = $threshold; - } - - /** - * Get the number of emails to send before restarting. - * @return int - */ - public function getThreshold() - { - return $this->_threshold; - } - - /** - * Set the number of seconds to sleep for during a restart. - * @param int $sleep time - */ - public function setSleepTime($sleep) - { - $this->_sleep = $sleep; - } - - /** - * Get the number of seconds to sleep for during a restart. - * @return int - */ - public function getSleepTime() - { - return $this->_sleep; - } - - /** - * Invoked immediately before the Message is sent. - * @param Swift_Events_SendEvent $evt - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - } - - /** - * Invoked immediately after the Message is sent. - * @param Swift_Events_SendEvent $evt - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - ++$this->_counter; - if ($this->_counter >= $this->_threshold) { - $transport = $evt->getTransport(); - $transport->stop(); - if ($this->_sleep) { - $this->sleep($this->_sleep); - } - $transport->start(); - $this->_counter = 0; - } - } - - /** - * Sleep for $seconds. - * @param int $seconds - */ - public function sleep($seconds) - { - if (isset($this->_sleeper)) { - $this->_sleeper->sleep($seconds); - } else { - sleep($seconds); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php deleted file mode 100644 index 0180e9f..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php +++ /dev/null @@ -1,157 +0,0 @@ -getMessage(); - $message->toByteStream($this); - } - - /** - * Invoked immediately following a command being sent. - * @param Swift_Events_ResponseEvent $evt - */ - public function commandSent(Swift_Events_CommandEvent $evt) - { - $command = $evt->getCommand(); - $this->_out += strlen($command); - } - - /** - * Invoked immediately following a response coming back. - * @param Swift_Events_ResponseEvent $evt - */ - public function responseReceived(Swift_Events_ResponseEvent $evt) - { - $response = $evt->getResponse(); - $this->_in += strlen($response); - } - - /** - * Called when a message is sent so that the outgoing counter can be increased. - * @param string $bytes - */ - public function write($bytes) - { - $this->_out += strlen($bytes); - foreach ($this->_mirrors as $stream) { - $stream->write($bytes); - } - } - - /** - * Not used. - */ - public function commit() - { - } - - /** - * Attach $is to this stream. - * The stream acts as an observer, receiving all data that is written. - * All {@link write()} and {@link flushBuffers()} operations will be mirrored. - * - * @param Swift_InputByteStream $is - */ - public function bind(Swift_InputByteStream $is) - { - $this->_mirrors[] = $is; - } - - /** - * Remove an already bound stream. - * If $is is not bound, no errors will be raised. - * If the stream currently has any buffered data it will be written to $is - * before unbinding occurs. - * - * @param Swift_InputByteStream $is - */ - public function unbind(Swift_InputByteStream $is) - { - foreach ($this->_mirrors as $k => $stream) { - if ($is === $stream) { - unset($this->_mirrors[$k]); - } - } - } - - /** - * Not used. - */ - public function flushBuffers() - { - foreach ($this->_mirrors as $stream) { - $stream->flushBuffers(); - } - } - - /** - * Get the total number of bytes sent to the server. - * @return int - */ - public function getBytesOut() - { - return $this->_out; - } - - /** - * Get the total number of bytes received from the server. - * @return int - */ - public function getBytesIn() - { - return $this->_in; - } - - /** - * Reset the internal counters to zero. - */ - public function reset() - { - $this->_out = 0; - $this->_in = 0; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Decorator/Replacements.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Decorator/Replacements.php deleted file mode 100644 index 995388c..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Decorator/Replacements.php +++ /dev/null @@ -1,34 +0,0 @@ - - * $replacements = array( - * "address1@domain.tld" => array("{a}" => "b", "{c}" => "d"), - * "address2@domain.tld" => array("{a}" => "x", "{c}" => "y") - * ) - *
- * - * When using an instance of {@link Swift_Plugins_Decorator_Replacements}, - * the object should return just the array of replacements for the address - * given to {@link Swift_Plugins_Decorator_Replacements::getReplacementsFor()}. - * - * @param mixed $replacements Array or Swift_Plugins_Decorator_Replacements - */ - public function __construct($replacements) - { - $this->setReplacements($replacements); - } - - /** - * Sets replacements. - * - * @param mixed $replacements Array or Swift_Plugins_Decorator_Replacements - * - * @see __construct() - */ - public function setReplacements($replacements) - { - if (!($replacements instanceof \Swift_Plugins_Decorator_Replacements)) { - $this->_replacements = (array) $replacements; - } else { - $this->_replacements = $replacements; - } - } - - /** - * Invoked immediately before the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - $message = $evt->getMessage(); - $this->_restoreMessage($message); - $to = array_keys($message->getTo()); - $address = array_shift($to); - if ($replacements = $this->getReplacementsFor($address)) { - $body = $message->getBody(); - $search = array_keys($replacements); - $replace = array_values($replacements); - $bodyReplaced = str_replace( - $search, $replace, $body - ); - if ($body != $bodyReplaced) { - $this->_originalBody = $body; - $message->setBody($bodyReplaced); - } - - foreach ($message->getHeaders()->getAll() as $header) { - $body = $header->getFieldBodyModel(); - $count = 0; - if (is_array($body)) { - $bodyReplaced = array(); - foreach ($body as $key => $value) { - $count1 = 0; - $count2 = 0; - $key = is_string($key) ? str_replace($search, $replace, $key, $count1) : $key; - $value = is_string($value) ? str_replace($search, $replace, $value, $count2) : $value; - $bodyReplaced[$key] = $value; - - if (!$count && ($count1 || $count2)) { - $count = 1; - } - } - } else { - $bodyReplaced = str_replace($search, $replace, $body, $count); - } - - if ($count) { - $this->_originalHeaders[$header->getFieldName()] = $body; - $header->setFieldBodyModel($bodyReplaced); - } - } - - $children = (array) $message->getChildren(); - foreach ($children as $child) { - list($type, ) = sscanf($child->getContentType(), '%[^/]/%s'); - if ('text' == $type) { - $body = $child->getBody(); - $bodyReplaced = str_replace( - $search, $replace, $body - ); - if ($body != $bodyReplaced) { - $child->setBody($bodyReplaced); - $this->_originalChildBodies[$child->getId()] = $body; - } - } - } - $this->_lastMessage = $message; - } - } - - /** - * Find a map of replacements for the address. - * - * If this plugin was provided with a delegate instance of - * {@link Swift_Plugins_Decorator_Replacements} then the call will be - * delegated to it. Otherwise, it will attempt to find the replacements - * from the array provided in the constructor. - * - * If no replacements can be found, an empty value (NULL) is returned. - * - * @param string $address - * - * @return array - */ - public function getReplacementsFor($address) - { - if ($this->_replacements instanceof Swift_Plugins_Decorator_Replacements) { - return $this->_replacements->getReplacementsFor($address); - } else { - return isset($this->_replacements[$address]) - ? $this->_replacements[$address] - : null - ; - } - } - - /** - * Invoked immediately after the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - $this->_restoreMessage($evt->getMessage()); - } - - // -- Private methods - - /** Restore a changed message back to its original state */ - private function _restoreMessage(Swift_Mime_Message $message) - { - if ($this->_lastMessage === $message) { - if (isset($this->_originalBody)) { - $message->setBody($this->_originalBody); - $this->_originalBody = null; - } - if (!empty($this->_originalHeaders)) { - foreach ($message->getHeaders()->getAll() as $header) { - if (array_key_exists($header->getFieldName(), $this->_originalHeaders)) { - $header->setFieldBodyModel($this->_originalHeaders[$header->getFieldName()]); - } - } - $this->_originalHeaders = array(); - } - if (!empty($this->_originalChildBodies)) { - $children = (array) $message->getChildren(); - foreach ($children as $child) { - $id = $child->getId(); - if (array_key_exists($id, $this->_originalChildBodies)) { - $child->setBody($this->_originalChildBodies[$id]); - } - } - $this->_originalChildBodies = array(); - } - $this->_lastMessage = null; - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ImpersonatePlugin.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ImpersonatePlugin.php deleted file mode 100644 index b977903..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ImpersonatePlugin.php +++ /dev/null @@ -1,71 +0,0 @@ -_sender = $sender; - } - - /** - * Invoked immediately before the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - $message = $evt->getMessage(); - $headers = $message->getHeaders(); - - // save current recipients - $headers->addPathHeader('X-Swift-Return-Path', $message->getReturnPath()); - - // replace them with the one to send to - $message->setReturnPath($this->_sender); - } - - /** - * Invoked immediately after the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - $message = $evt->getMessage(); - - // restore original headers - $headers = $message->getHeaders(); - - if ($headers->has('X-Swift-Return-Path')) { - $message->setReturnPath($headers->get('X-Swift-Return-Path')->getAddress()); - $headers->removeAll('X-Swift-Return-Path'); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Logger.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Logger.php deleted file mode 100644 index 3a25bd4..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Logger.php +++ /dev/null @@ -1,35 +0,0 @@ -_logger = $logger; - } - - /** - * Add a log entry. - * - * @param string $entry - */ - public function add($entry) - { - $this->_logger->add($entry); - } - - /** - * Clear the log contents. - */ - public function clear() - { - $this->_logger->clear(); - } - - /** - * Get this log as a string. - * - * @return string - */ - public function dump() - { - return $this->_logger->dump(); - } - - /** - * Invoked immediately following a command being sent. - * - * @param Swift_Events_ResponseEvent $evt - */ - public function commandSent(Swift_Events_CommandEvent $evt) - { - $command = $evt->getCommand(); - $this->_logger->add(sprintf(">> %s", $command)); - } - - /** - * Invoked immediately following a response coming back. - * - * @param Swift_Events_ResponseEvent $evt - */ - public function responseReceived(Swift_Events_ResponseEvent $evt) - { - $response = $evt->getResponse(); - $this->_logger->add(sprintf("<< %s", $response)); - } - - /** - * Invoked just before a Transport is started. - * - * @param Swift_Events_TransportChangeEvent $evt - */ - public function beforeTransportStarted(Swift_Events_TransportChangeEvent $evt) - { - $transportName = get_class($evt->getSource()); - $this->_logger->add(sprintf("++ Starting %s", $transportName)); - } - - /** - * Invoked immediately after the Transport is started. - * - * @param Swift_Events_TransportChangeEvent $evt - */ - public function transportStarted(Swift_Events_TransportChangeEvent $evt) - { - $transportName = get_class($evt->getSource()); - $this->_logger->add(sprintf("++ %s started", $transportName)); - } - - /** - * Invoked just before a Transport is stopped. - * - * @param Swift_Events_TransportChangeEvent $evt - */ - public function beforeTransportStopped(Swift_Events_TransportChangeEvent $evt) - { - $transportName = get_class($evt->getSource()); - $this->_logger->add(sprintf("++ Stopping %s", $transportName)); - } - - /** - * Invoked immediately after the Transport is stopped. - * - * @param Swift_Events_TransportChangeEvent $evt - */ - public function transportStopped(Swift_Events_TransportChangeEvent $evt) - { - $transportName = get_class($evt->getSource()); - $this->_logger->add(sprintf("++ %s stopped", $transportName)); - } - - /** - * Invoked as a TransportException is thrown in the Transport system. - * - * @param Swift_Events_TransportExceptionEvent $evt - */ - public function exceptionThrown(Swift_Events_TransportExceptionEvent $evt) - { - $e = $evt->getException(); - $message = $e->getMessage(); - $this->_logger->add(sprintf("!! %s", $message)); - $message .= PHP_EOL; - $message .= 'Log data:' . PHP_EOL; - $message .= $this->_logger->dump(); - $evt->cancelBubble(); - throw new Swift_TransportException($message); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php deleted file mode 100644 index fa6ef33..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php +++ /dev/null @@ -1,70 +0,0 @@ -_size = $size; - } - - /** - * Add a log entry. - * @param string $entry - */ - public function add($entry) - { - $this->_log[] = $entry; - while (count($this->_log) > $this->_size) { - array_shift($this->_log); - } - } - - /** - * Clear the log contents. - */ - public function clear() - { - $this->_log = array(); - } - - /** - * Get this log as a string. - * @return string - */ - public function dump() - { - return implode(PHP_EOL, $this->_log); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/EchoLogger.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/EchoLogger.php deleted file mode 100644 index 7c5fb41..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/EchoLogger.php +++ /dev/null @@ -1,59 +0,0 @@ -_isHtml = $isHtml; - } - - /** - * Add a log entry. - * @param string $entry - */ - public function add($entry) - { - if ($this->_isHtml) { - printf('%s%s%s', htmlspecialchars($entry, ENT_QUOTES), '
', PHP_EOL); - } else { - printf('%s%s', $entry, PHP_EOL); - } - } - - /** - * Not implemented. - */ - public function clear() - { - } - - /** - * Not implemented. - */ - public function dump() - { - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/MessageLogger.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/MessageLogger.php deleted file mode 100644 index cfd3589..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/MessageLogger.php +++ /dev/null @@ -1,76 +0,0 @@ -messages = array(); - } - - /** - * Get the message list - * - * @return array - */ - public function getMessages() - { - return $this->messages; - } - - /** - * Get the message count - * - * @return int count - */ - public function countMessages() - { - return count($this->messages); - } - - /** - * Empty the message list - * - */ - public function clear() - { - $this->messages = array(); - } - - /** - * Invoked immediately before the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - $this->messages[] = clone $evt->getMessage(); - } - - /** - * Invoked immediately after the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Pop/Pop3Connection.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Pop/Pop3Connection.php deleted file mode 100644 index 6ce2593..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Pop/Pop3Connection.php +++ /dev/null @@ -1,34 +0,0 @@ -_host = $host; - $this->_port = $port; - $this->_crypto = $crypto; - } - - /** - * Create a new PopBeforeSmtpPlugin for $host and $port. - * - * @param string $host - * @param int $port - * @param string $cypto as "tls" or "ssl" - * - * @return Swift_Plugins_PopBeforeSmtpPlugin - */ - public static function newInstance($host, $port = 110, $crypto = null) - { - return new self($host, $port, $crypto); - } - - /** - * Set a Pop3Connection to delegate to instead of connecting directly. - * - * @param Swift_Plugins_Pop_Pop3Connection $connection - */ - public function setConnection(Swift_Plugins_Pop_Pop3Connection $connection) - { - $this->_connection = $connection; - - return $this; - } - - /** - * Bind this plugin to a specific SMTP transport instance. - * - * @param Swift_Transport - */ - public function bindSmtp(Swift_Transport $smtp) - { - $this->_transport = $smtp; - } - - /** - * Set the connection timeout in seconds (default 10). - * - * @param int $timeout - */ - public function setTimeout($timeout) - { - $this->_timeout = (int) $timeout; - - return $this; - } - - /** - * Set the username to use when connecting (if needed). - * - * @param string $username - */ - public function setUsername($username) - { - $this->_username = $username; - - return $this; - } - - /** - * Set the password to use when connecting (if needed). - * - * @param string $password - */ - public function setPassword($password) - { - $this->_password = $password; - - return $this; - } - - /** - * Connect to the POP3 host and authenticate. - * - * @throws Swift_Plugins_Pop_Pop3Exception if connection fails - */ - public function connect() - { - if (isset($this->_connection)) { - $this->_connection->connect(); - } else { - if (!isset($this->_socket)) { - if (!$socket = fsockopen( - $this->_getHostString(), $this->_port, $errno, $errstr, $this->_timeout)) - { - throw new Swift_Plugins_Pop_Pop3Exception( - sprintf('Failed to connect to POP3 host [%s]: %s', $this->_host, $errstr) - ); - } - $this->_socket = $socket; - - if (false === $greeting = fgets($this->_socket)) { - throw new Swift_Plugins_Pop_Pop3Exception( - sprintf('Failed to connect to POP3 host [%s]', trim($greeting)) - ); - } - - $this->_assertOk($greeting); - - if ($this->_username) { - $this->_command(sprintf("USER %s\r\n", $this->_username)); - $this->_command(sprintf("PASS %s\r\n", $this->_password)); - } - } - } - } - - /** - * Disconnect from the POP3 host. - */ - public function disconnect() - { - if (isset($this->_connection)) { - $this->_connection->disconnect(); - } else { - $this->_command("QUIT\r\n"); - if (!fclose($this->_socket)) { - throw new Swift_Plugins_Pop_Pop3Exception( - sprintf('POP3 host [%s] connection could not be stopped', $this->_host) - ); - } - $this->_socket = null; - } - } - - /** - * Invoked just before a Transport is started. - * - * @param Swift_Events_TransportChangeEvent $evt - */ - public function beforeTransportStarted(Swift_Events_TransportChangeEvent $evt) - { - if (isset($this->_transport)) { - if ($this->_transport !== $evt->getTransport()) { - return; - } - } - - $this->connect(); - $this->disconnect(); - } - - /** - * Not used. - */ - public function transportStarted(Swift_Events_TransportChangeEvent $evt) - { - } - - /** - * Not used. - */ - public function beforeTransportStopped(Swift_Events_TransportChangeEvent $evt) - { - } - - /** - * Not used. - */ - public function transportStopped(Swift_Events_TransportChangeEvent $evt) - { - } - - // -- Private Methods - - private function _command($command) - { - if (!fwrite($this->_socket, $command)) { - throw new Swift_Plugins_Pop_Pop3Exception( - sprintf('Failed to write command [%s] to POP3 host', trim($command)) - ); - } - - if (false === $response = fgets($this->_socket)) { - throw new Swift_Plugins_Pop_Pop3Exception( - sprintf('Failed to read from POP3 host after command [%s]', trim($command)) - ); - } - - $this->_assertOk($response); - - return $response; - } - - private function _assertOk($response) - { - if (substr($response, 0, 3) != '+OK') { - throw new Swift_Plugins_Pop_Pop3Exception( - sprintf('POP3 command failed [%s]', trim($response)) - ); - } - } - - private function _getHostString() - { - $host = $this->_host; - switch (strtolower($this->_crypto)) { - case 'ssl': - $host = 'ssl://' . $host; - break; - - case 'tls': - $host = 'tls://' . $host; - break; - } - - return $host; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/RedirectingPlugin.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/RedirectingPlugin.php deleted file mode 100644 index 9dfb09f..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/RedirectingPlugin.php +++ /dev/null @@ -1,105 +0,0 @@ -_recipient = $recipient; - } - - /** - * Set the recipient of all messages. - * @param int $threshold - */ - public function setRecipient($recipient) - { - $this->_recipient = $recipient; - } - - /** - * Get the recipient of all messages. - * @return int - */ - public function getRecipient() - { - return $this->_recipient; - } - - /** - * Invoked immediately before the Message is sent. - * @param Swift_Events_SendEvent $evt - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - $message = $evt->getMessage(); - $headers = $message->getHeaders(); - - // save current recipients - $headers->addMailboxHeader('X-Swift-To', $message->getTo()); - $headers->addMailboxHeader('X-Swift-Cc', $message->getCc()); - $headers->addMailboxHeader('X-Swift-Bcc', $message->getBcc()); - - // replace them with the one to send to - $message->setTo($this->_recipient); - $headers->removeAll('Cc'); - $headers->removeAll('Bcc'); - } - - /** - * Invoked immediately after the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - $this->_restoreMessage($evt->getMessage()); - } - - // -- Private methods - - private function _restoreMessage(Swift_Mime_Message $message) - { - // restore original headers - $headers = $message->getHeaders(); - - if ($headers->has('X-Swift-To')) { - $message->setTo($headers->get('X-Swift-To')->getNameAddresses()); - $headers->removeAll('X-Swift-To'); - } - - if ($headers->has('X-Swift-Cc')) { - $message->setCc($headers->get('X-Swift-Cc')->getNameAddresses()); - $headers->removeAll('X-Swift-Cc'); - } - - if ($headers->has('X-Swift-Bcc')) { - $message->setBcc($headers->get('X-Swift-Bcc')->getNameAddresses()); - $headers->removeAll('X-Swift-Bcc'); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporter.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporter.php deleted file mode 100644 index 339a637..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporter.php +++ /dev/null @@ -1,32 +0,0 @@ -_reporter = $reporter; - } - - /** - * Not used. - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - } - - /** - * Invoked immediately after the Message is sent. - * @param Swift_Events_SendEvent $evt - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - $message = $evt->getMessage(); - $failures = array_flip($evt->getFailedRecipients()); - foreach ((array) $message->getTo() as $address => $null) { - $this->_reporter->notify( - $message, $address, (array_key_exists($address, $failures) - ? Swift_Plugins_Reporter::RESULT_FAIL - : Swift_Plugins_Reporter::RESULT_PASS) - ); - } - foreach ((array) $message->getCc() as $address => $null) { - $this->_reporter->notify( - $message, $address, (array_key_exists($address, $failures) - ? Swift_Plugins_Reporter::RESULT_FAIL - : Swift_Plugins_Reporter::RESULT_PASS) - ); - } - foreach ((array) $message->getBcc() as $address => $null) { - $this->_reporter->notify( - $message, $address, (array_key_exists($address, $failures) - ? Swift_Plugins_Reporter::RESULT_FAIL - : Swift_Plugins_Reporter::RESULT_PASS) - ); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HitReporter.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HitReporter.php deleted file mode 100644 index fb51b26..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HitReporter.php +++ /dev/null @@ -1,57 +0,0 @@ -_failures_cache[$address])) { - $this->_failures[] = $address; - $this->_failures_cache[$address] = true; - } - } - - /** - * Get an array of addresses for which delivery failed. - * @return array - */ - public function getFailedRecipients() - { - return $this->_failures; - } - - /** - * Clear the buffer (empty the list). - */ - public function clear() - { - $this->_failures = $this->_failures_cache = array(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HtmlReporter.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HtmlReporter.php deleted file mode 100644 index cf841a6..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HtmlReporter.php +++ /dev/null @@ -1,39 +0,0 @@ -" . PHP_EOL; - echo "PASS " . $address . PHP_EOL; - echo "" . PHP_EOL; - flush(); - } else { - echo "
" . PHP_EOL; - echo "FAIL " . $address . PHP_EOL; - echo "
" . PHP_EOL; - flush(); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Sleeper.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Sleeper.php deleted file mode 100644 index 149d226..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Sleeper.php +++ /dev/null @@ -1,24 +0,0 @@ -_rate = $rate; - $this->_mode = $mode; - $this->_sleeper = $sleeper; - $this->_timer = $timer; - } - - /** - * Invoked immediately before the Message is sent. - * @param Swift_Events_SendEvent $evt - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - $time = $this->getTimestamp(); - if (!isset($this->_start)) { - $this->_start = $time; - } - $duration = $time - $this->_start; - - if (self::BYTES_PER_MINUTE == $this->_mode) { - $sleep = $this->_throttleBytesPerMinute($duration); - } else { - $sleep = $this->_throttleMessagesPerMinute($duration); - } - - if ($sleep > 0) { - $this->sleep($sleep); - } - } - - /** - * Invoked when a Message is sent. - * @param Swift_Events_SendEvent $evt - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - parent::sendPerformed($evt); - ++$this->_messages; - } - - /** - * Sleep for $seconds. - * @param int $seconds - */ - public function sleep($seconds) - { - if (isset($this->_sleeper)) { - $this->_sleeper->sleep($seconds); - } else { - sleep($seconds); - } - } - - /** - * Get the current UNIX timestamp - * @return int - */ - public function getTimestamp() - { - if (isset($this->_timer)) { - return $this->_timer->getTimestamp(); - } else { - return time(); - } - } - - // -- Private methods - - /** - * Get a number of seconds to sleep for. - * @param int $timePassed - * @return int - * @access private - */ - private function _throttleBytesPerMinute($timePassed) - { - $expectedDuration = $this->getBytesOut() / ($this->_rate / 60); - - return (int) ceil($expectedDuration - $timePassed); - } - - /** - * Get a number of seconds to sleep for. - * @param int $timePassed - * @return int - * @access private - */ - private function _throttleMessagesPerMinute($timePassed) - { - $expectedDuration = $this->_messages / ($this->_rate / 60); - - return (int) ceil($expectedDuration - $timePassed); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Timer.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Timer.php deleted file mode 100644 index a9b1cd5..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Timer.php +++ /dev/null @@ -1,24 +0,0 @@ -register('properties.charset')->asValue($charset); - - return $this; - } - - /** - * Set the directory where temporary files can be saved. - * @param string $dir - * @return Swift_Preferences - */ - public function setTempDir($dir) - { - Swift_DependencyContainer::getInstance() - ->register('tempdir')->asValue($dir); - - return $this; - } - - /** - * Set the type of cache to use (i.e. "disk" or "array"). - * @param string $type - * @return Swift_Preferences - */ - public function setCacheType($type) - { - Swift_DependencyContainer::getInstance() - ->register('cache')->asAliasOf(sprintf('cache.%s', $type)); - - return $this; - } - - /** - * Add the - * @param boolean $dotEscape - * @return Swift_Preferences - */ - public function setQPDotEscape($dotEscape) - { - $dotEscape=!empty($dotEscape); - Swift_DependencyContainer::getInstance() - -> register('mime.qpcontentencoder') - -> asNewInstanceOf('Swift_Mime_ContentEncoder_QpContentEncoder') - -> withDependencies(array('mime.charstream', 'mime.bytecanonicalizer')) - -> addConstructorValue($dotEscape); - - return $this; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ReplacementFilterFactory.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ReplacementFilterFactory.php deleted file mode 100644 index 3b5f59e..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ReplacementFilterFactory.php +++ /dev/null @@ -1,25 +0,0 @@ -createDependenciesFor('transport.sendmail') - ); - - $this->setCommand($command); - } - - /** - * Create a new SendmailTransport instance. - * @param string $command - * @return Swift_SendmailTransport - */ - public static function newInstance($command = '/usr/sbin/sendmail -bs') - { - return new self($command); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php deleted file mode 100644 index b134416..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php +++ /dev/null @@ -1,49 +0,0 @@ -createDependenciesFor('transport.smtp') - ); - - $this->setHost($host); - $this->setPort($port); - $this->setEncryption($security); - } - - /** - * Create a new SmtpTransport instance. - * @param string $host - * @param int $port - * @param string $security - * @return Swift_SmtpTransport - */ - public static function newInstance($host = 'localhost', $port = 25, $security = null) - { - return new self($host, $port, $security); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Spool.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Spool.php deleted file mode 100644 index be7bc71..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Spool.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Interface for spools. - * @package Swift - * @author Fabien Potencier - */ -interface Swift_Spool -{ - /** - * Starts this Spool mechanism. - */ - public function start(); - - /** - * Stops this Spool mechanism. - */ - public function stop(); - - /** - * Tests if this Spool mechanism has started. - * - * @return boolean - */ - public function isStarted(); - - /** - * Queues a message. - * @param Swift_Mime_Message $message The message to store - * - * @return boolean Whether the operation has succeeded - */ - public function queueMessage(Swift_Mime_Message $message); - - /** - * Sends messages using the given transport instance. - * - * @param Swift_Transport $transport A transport instance - * @param string[] &$failedRecipients An array of failures by-reference - * - * @return int The number of sent emails - */ - public function flushQueue(Swift_Transport $transport, &$failedRecipients = null); -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SpoolTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SpoolTransport.php deleted file mode 100644 index 75fb784..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SpoolTransport.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Stores Messages in a queue. - * @package Swift - * @author Fabien Potencier - */ -class Swift_SpoolTransport extends Swift_Transport_SpoolTransport -{ - /** - * Create a new SpoolTransport. - * @param Swift_Spool $spool - */ - public function __construct(Swift_Spool $spool) - { - $arguments = Swift_DependencyContainer::getInstance() - ->createDependenciesFor('transport.spool'); - - $arguments[] = $spool; - - call_user_func_array( - array($this, 'Swift_Transport_SpoolTransport::__construct'), - $arguments - ); - } - - /** - * Create a new SpoolTransport instance. - * @param Swift_Spool $spool - * @return Swift_SpoolTransport - */ - public static function newInstance(Swift_Spool $spool) - { - return new self($spool); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilter.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilter.php deleted file mode 100644 index d777747..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilter.php +++ /dev/null @@ -1,31 +0,0 @@ -_search = $search; - $this->_index = array(); - $this->_tree = array(); - $this->_replace = array(); - $this->_repSize = array(); - - $tree = null; - $i = null; - $last_size = $size = 0; - foreach ($search as $i => $search_element) { - if ($tree !== null) { - $tree[-1] = min (count($replace) - 1, $i - 1); - $tree[-2] = $last_size; - } - $tree = &$this->_tree; - if (is_array ($search_element)) { - foreach ($search_element as $k => $char) { - $this->_index[$char] = true; - if (!isset($tree[$char])) { - $tree[$char] = array(); - } - $tree = &$tree[$char]; - } - $last_size = $k+1; - $size = max($size, $last_size); - } else { - $last_size = 1; - if (!isset($tree[$search_element])) { - $tree[$search_element] = array(); - } - $tree = &$tree[$search_element]; - $size = max($last_size, $size); - $this->_index[$search_element] = true; - } - } - if ($i !== null) { - $tree[-1] = min (count ($replace) - 1, $i); - $tree[-2] = $last_size; - $this->_treeMaxLen = $size; - } - foreach ($replace as $rep) { - if (!is_array($rep)) { - $rep = array ($rep); - } - $this->_replace[] = $rep; - } - for ($i = count($this->_replace) - 1; $i >= 0; --$i) { - $this->_replace[$i] = $rep = $this->filter($this->_replace[$i], $i); - $this->_repSize[$i] = count($rep); - } - } - - /** - * Returns true if based on the buffer passed more bytes should be buffered. - * @param array $buffer - * @return boolean - */ - public function shouldBuffer($buffer) - { - $endOfBuffer = end($buffer); - - return isset ($this->_index[$endOfBuffer]); - } - - /** - * Perform the actual replacements on $buffer and return the result. - * @param array $buffer - * @return array - */ - public function filter($buffer, $_minReplaces = -1) - { - if ($this->_treeMaxLen == 0) { - return $buffer; - } - - $newBuffer = array(); - $buf_size = count($buffer); - for ($i = 0; $i < $buf_size; ++$i) { - $search_pos = $this->_tree; - $last_found = PHP_INT_MAX; - // We try to find if the next byte is part of a search pattern - for ($j = 0; $j <= $this->_treeMaxLen; ++$j) { - // We have a new byte for a search pattern - if (isset ($buffer [$p = $i + $j]) && isset($search_pos[$buffer[$p]])) { - $search_pos = $search_pos[$buffer[$p]]; - // We have a complete pattern, save, in case we don't find a better match later - if (isset($search_pos[- 1]) && $search_pos[-1] < $last_found - && $search_pos[-1] > $_minReplaces) - { - $last_found = $search_pos[-1]; - $last_size = $search_pos[-2]; - } - } - // We got a complete pattern - elseif ($last_found !== PHP_INT_MAX) { - // Adding replacement datas to output buffer - $rep_size = $this->_repSize[$last_found]; - for ($j = 0; $j < $rep_size; ++$j) { - $newBuffer[] = $this->_replace[$last_found][$j]; - } - // We Move cursor forward - $i += $last_size - 1; - // Edge Case, last position in buffer - if ($i >= $buf_size) { - $newBuffer[] = $buffer[$i]; - } - - // We start the next loop - continue 2; - } else { - // this byte is not in a pattern and we haven't found another pattern - break; - } - } - // Normal byte, move it to output buffer - $newBuffer[] = $buffer[$i]; - } - - return $newBuffer; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilter.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilter.php deleted file mode 100644 index 8932ea7..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilter.php +++ /dev/null @@ -1,61 +0,0 @@ -_search = $search; - $this->_replace = $replace; - } - - /** - * Returns true if based on the buffer passed more bytes should be buffered. - * @param string $buffer - * @return boolean - */ - public function shouldBuffer($buffer) - { - $endOfBuffer = substr($buffer, -1); - foreach ((array) $this->_search as $needle) { - if (false !== strpos($needle, $endOfBuffer)) { - return true; - } - } - - return false; - } - - /** - * Perform the actual replacements on $buffer and return the result. - * @param string $buffer - * @return string - */ - public function filter($buffer) - { - return str_replace($this->_search, $this->_replace, $buffer); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilterFactory.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilterFactory.php deleted file mode 100644 index 2485f5b..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilterFactory.php +++ /dev/null @@ -1,44 +0,0 @@ -_filters[$search][$replace])) { - if (!isset($this->_filters[$search])) { - $this->_filters[$search] = array(); - } - - if (!isset($this->_filters[$search][$replace])) { - $this->_filters[$search][$replace] = array(); - } - - $this->_filters[$search][$replace] - = new Swift_StreamFilters_StringReplacementFilter($search, $replace); - } - - return $this->_filters[$search][$replace]; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SwiftException.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SwiftException.php deleted file mode 100644 index 5365bc2..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SwiftException.php +++ /dev/null @@ -1,26 +0,0 @@ -_eventDispatcher = $dispatcher; - $this->_buffer = $buf; - $this->_lookupHostname(); - } - - /** - * Set the name of the local domain which Swift will identify itself as. - * This should be a fully-qualified domain name and should be truly the domain - * you're using. If your server doesn't have a domain name, use the IP in square - * brackets (i.e. [127.0.0.1]). - * - * @param string $domain - * @return Swift_Transport_AbstractSmtpTransport - */ - public function setLocalDomain($domain) - { - $this->_domain = $domain; - - return $this; - } - - /** - * Get the name of the domain Swift will identify as. - * - * @return string - */ - public function getLocalDomain() - { - return $this->_domain; - } - - /** - * Sets the sourceIp - * @param string $source - */ - public function setSourceIp($source) - { - $this->_sourceIp=$source; - } - - /** - * Returns the ip used to connect to the destination - * @return string - */ - public function getSourceIp() - { - return $this->_sourceIp; - } - - /** - * Start the SMTP connection. - */ - public function start() - { - if (!$this->_started) { - if ($evt = $this->_eventDispatcher->createTransportChangeEvent($this)) { - $this->_eventDispatcher->dispatchEvent($evt, 'beforeTransportStarted'); - if ($evt->bubbleCancelled()) { - return; - } - } - - try { - $this->_buffer->initialize($this->_getBufferParams()); - } catch (Swift_TransportException $e) { - $this->_throwException($e); - } - $this->_readGreeting(); - $this->_doHeloCommand(); - - if ($evt) { - $this->_eventDispatcher->dispatchEvent($evt, 'transportStarted'); - } - - $this->_started = true; - } - } - - /** - * Test if an SMTP connection has been established. - * - * @return boolean - */ - public function isStarted() - { - return $this->_started; - } - - /** - * Send the given Message. - * - * Recipient/sender data will be retrieved from the Message API. - * The return value is the number of recipients who were accepted for delivery. - * - * @param Swift_Mime_Message $message - * @param string[] &$failedRecipients to collect failures by-reference - * @return int - */ - public function send(Swift_Mime_Message $message, &$failedRecipients = null) - { - $sent = 0; - $failedRecipients = (array) $failedRecipients; - - if ($evt = $this->_eventDispatcher->createSendEvent($this, $message)) { - $this->_eventDispatcher->dispatchEvent($evt, 'beforeSendPerformed'); - if ($evt->bubbleCancelled()) { - return 0; - } - } - - if (!$reversePath = $this->_getReversePath($message)) { - throw new Swift_TransportException( - 'Cannot send message without a sender address' - ); - } - - $to = (array) $message->getTo(); - $cc = (array) $message->getCc(); - $bcc = (array) $message->getBcc(); - - $message->setBcc(array()); - - try { - $sent += $this->_sendTo($message, $reversePath, $to, $failedRecipients); - $sent += $this->_sendCc($message, $reversePath, $cc, $failedRecipients); - $sent += $this->_sendBcc($message, $reversePath, $bcc, $failedRecipients); - } catch (Exception $e) { - $message->setBcc($bcc); - throw $e; - } - - $message->setBcc($bcc); - - if ($evt) { - if ($sent == count($to) + count($cc) + count($bcc)) { - $evt->setResult(Swift_Events_SendEvent::RESULT_SUCCESS); - } elseif ($sent > 0) { - $evt->setResult(Swift_Events_SendEvent::RESULT_TENTATIVE); - } else { - $evt->setResult(Swift_Events_SendEvent::RESULT_FAILED); - } - $evt->setFailedRecipients($failedRecipients); - $this->_eventDispatcher->dispatchEvent($evt, 'sendPerformed'); - } - - $message->generateId(); //Make sure a new Message ID is used - - return $sent; - } - - /** - * Stop the SMTP connection. - */ - public function stop() - { - if ($this->_started) { - if ($evt = $this->_eventDispatcher->createTransportChangeEvent($this)) { - $this->_eventDispatcher->dispatchEvent($evt, 'beforeTransportStopped'); - if ($evt->bubbleCancelled()) { - return; - } - } - - try { - $this->executeCommand("QUIT\r\n", array(221)); - } catch (Swift_TransportException $e) {} - - try { - $this->_buffer->terminate(); - - if ($evt) { - $this->_eventDispatcher->dispatchEvent($evt, 'transportStopped'); - } - } catch (Swift_TransportException $e) { - $this->_throwException($e); - } - } - $this->_started = false; - } - - /** - * Register a plugin. - * - * @param Swift_Events_EventListener $plugin - */ - public function registerPlugin(Swift_Events_EventListener $plugin) - { - $this->_eventDispatcher->bindEventListener($plugin); - } - - /** - * Reset the current mail transaction. - */ - public function reset() - { - $this->executeCommand("RSET\r\n", array(250)); - } - - /** - * Get the IoBuffer where read/writes are occurring. - * - * @return Swift_Transport_IoBuffer - */ - public function getBuffer() - { - return $this->_buffer; - } - - /** - * Run a command against the buffer, expecting the given response codes. - * - * If no response codes are given, the response will not be validated. - * If codes are given, an exception will be thrown on an invalid response. - * - * @param string $command - * @param int[] $codes - * @param string[] &$failures - * @return string - */ - public function executeCommand($command, $codes = array(), &$failures = null) - { - $failures = (array) $failures; - $seq = $this->_buffer->write($command); - $response = $this->_getFullResponse($seq); - if ($evt = $this->_eventDispatcher->createCommandEvent($this, $command, $codes)) { - $this->_eventDispatcher->dispatchEvent($evt, 'commandSent'); - } - $this->_assertResponseCode($response, $codes); - - return $response; - } - - // -- Protected methods - - /** Read the opening SMTP greeting */ - protected function _readGreeting() - { - $this->_assertResponseCode($this->_getFullResponse(0), array(220)); - } - - /** Send the HELO welcome */ - protected function _doHeloCommand() - { - $this->executeCommand( - sprintf("HELO %s\r\n", $this->_domain), array(250) - ); - } - - /** Send the MAIL FROM command */ - protected function _doMailFromCommand($address) - { - $this->executeCommand( - sprintf("MAIL FROM: <%s>\r\n", $address), array(250) - ); - } - - /** Send the RCPT TO command */ - protected function _doRcptToCommand($address) - { - $this->executeCommand( - sprintf("RCPT TO: <%s>\r\n", $address), array(250, 251, 252) - ); - } - - /** Send the DATA command */ - protected function _doDataCommand() - { - $this->executeCommand("DATA\r\n", array(354)); - } - - /** Stream the contents of the message over the buffer */ - protected function _streamMessage(Swift_Mime_Message $message) - { - $this->_buffer->setWriteTranslations(array("\r\n." => "\r\n..")); - try { - $message->toByteStream($this->_buffer); - $this->_buffer->flushBuffers(); - } catch (Swift_TransportException $e) { - $this->_throwException($e); - } - $this->_buffer->setWriteTranslations(array()); - $this->executeCommand("\r\n.\r\n", array(250)); - } - - /** Determine the best-use reverse path for this message */ - protected function _getReversePath(Swift_Mime_Message $message) - { - $return = $message->getReturnPath(); - $sender = $message->getSender(); - $from = $message->getFrom(); - $path = null; - if (!empty($return)) { - $path = $return; - } elseif (!empty($sender)) { - // Don't use array_keys - reset($sender); // Reset Pointer to first pos - $path = key($sender); // Get key - } elseif (!empty($from)) { - reset($from); // Reset Pointer to first pos - $path = key($from); // Get key - } - - return $path; - } - - /** Throw a TransportException, first sending it to any listeners */ - protected function _throwException(Swift_TransportException $e) - { - if ($evt = $this->_eventDispatcher->createTransportExceptionEvent($this, $e)) { - $this->_eventDispatcher->dispatchEvent($evt, 'exceptionThrown'); - if (!$evt->bubbleCancelled()) { - throw $e; - } - } else { - throw $e; - } - } - - /** Throws an Exception if a response code is incorrect */ - protected function _assertResponseCode($response, $wanted) - { - list($code) = sscanf($response, '%3d'); - $valid = (empty($wanted) || in_array($code, $wanted)); - - if ($evt = $this->_eventDispatcher->createResponseEvent($this, $response, - $valid)) - { - $this->_eventDispatcher->dispatchEvent($evt, 'responseReceived'); - } - - if (!$valid) { - $this->_throwException( - new Swift_TransportException( - 'Expected response code ' . implode('/', $wanted) . ' but got code ' . - '"' . $code . '", with message "' . $response . '"' - ) - ); - } - } - - /** Get an entire multi-line response using its sequence number */ - protected function _getFullResponse($seq) - { - $response = ''; - try { - do { - $line = $this->_buffer->readLine($seq); - $response .= $line; - } while (null !== $line && false !== $line && ' ' != $line{3}); - } catch (Swift_TransportException $e) { - $this->_throwException($e); - } - - return $response; - } - - // -- Private methods - - /** Send an email to the given recipients from the given reverse path */ - private function _doMailTransaction($message, $reversePath, array $recipients, array &$failedRecipients) - { - $sent = 0; - $this->_doMailFromCommand($reversePath); - foreach ($recipients as $forwardPath) { - try { - $this->_doRcptToCommand($forwardPath); - $sent++; - } catch (Swift_TransportException $e) { - $failedRecipients[] = $forwardPath; - } - } - - if ($sent != 0) { - $this->_doDataCommand(); - $this->_streamMessage($message); - } else { - $this->reset(); - } - - return $sent; - } - - /** Send a message to the given To: recipients */ - private function _sendTo(Swift_Mime_Message $message, $reversePath, array $to, array &$failedRecipients) - { - if (empty($to)) { - return 0; - } - - return $this->_doMailTransaction($message, $reversePath, array_keys($to), - $failedRecipients); - } - - /** Send a message to the given Cc: recipients */ - private function _sendCc(Swift_Mime_Message $message, $reversePath, array $cc, array &$failedRecipients) - { - if (empty($cc)) { - return 0; - } - - return $this->_doMailTransaction($message, $reversePath, array_keys($cc), - $failedRecipients); - } - - /** Send a message to all Bcc: recipients */ - private function _sendBcc(Swift_Mime_Message $message, $reversePath, array $bcc, array &$failedRecipients) - { - $sent = 0; - foreach ($bcc as $forwardPath => $name) { - $message->setBcc(array($forwardPath => $name)); - $sent += $this->_doMailTransaction( - $message, $reversePath, array($forwardPath), $failedRecipients - ); - } - - return $sent; - } - - /** Try to determine the hostname of the server this is run on */ - private function _lookupHostname() - { - if (!empty($_SERVER['SERVER_NAME']) - && $this->_isFqdn($_SERVER['SERVER_NAME'])) - { - $this->_domain = $_SERVER['SERVER_NAME']; - } elseif (!empty($_SERVER['SERVER_ADDR'])) { - $this->_domain = sprintf('[%s]', $_SERVER['SERVER_ADDR']); - } - } - - /** Determine is the $hostname is a fully-qualified name */ - private function _isFqdn($hostname) - { - //We could do a really thorough check, but there's really no point - if (false !== $dotPos = strpos($hostname, '.')) { - return ($dotPos > 0) && ($dotPos != strlen($hostname) - 1); - } else { - return false; - } - } - - /** - * Destructor. - */ - public function __destruct() - { - $this->stop(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php deleted file mode 100644 index 641e17e..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php +++ /dev/null @@ -1,77 +0,0 @@ -executeCommand("AUTH CRAM-MD5\r\n", array(334)); - $challenge = base64_decode(substr($challenge, 4)); - $message = base64_encode( - $username . ' ' . $this->_getResponse($password, $challenge) - ); - $agent->executeCommand(sprintf("%s\r\n", $message), array(235)); - - return true; - } catch (Swift_TransportException $e) { - $agent->executeCommand("RSET\r\n", array(250)); - - return false; - } - } - - /** - * Generate a CRAM-MD5 response from a server challenge. - * @param string $secret - * @param string $challenge - * @return string - */ - private function _getResponse($secret, $challenge) - { - if (strlen($secret) > 64) { - $secret = pack('H32', md5($secret)); - } - - if (strlen($secret) < 64) { - $secret = str_pad($secret, 64, chr(0)); - } - - $k_ipad = substr($secret, 0, 64) ^ str_repeat(chr(0x36), 64); - $k_opad = substr($secret, 0, 64) ^ str_repeat(chr(0x5C), 64); - - $inner = pack('H32', md5($k_ipad . $challenge)); - $digest = md5($k_opad . $inner); - - return $digest; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php deleted file mode 100644 index 3a18aee..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php +++ /dev/null @@ -1,49 +0,0 @@ -executeCommand("AUTH LOGIN\r\n", array(334)); - $agent->executeCommand(sprintf("%s\r\n", base64_encode($username)), array(334)); - $agent->executeCommand(sprintf("%s\r\n", base64_encode($password)), array(235)); - - return true; - } catch (Swift_TransportException $e) { - $agent->executeCommand("RSET\r\n", array(250)); - - return false; - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php deleted file mode 100644 index 1c8b472..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php +++ /dev/null @@ -1,48 +0,0 @@ -executeCommand(sprintf("AUTH PLAIN %s\r\n", $message), array(235)); - - return true; - } catch (Swift_TransportException $e) { - $agent->executeCommand("RSET\r\n", array(250)); - - return false; - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php deleted file mode 100644 index b9d7221..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php +++ /dev/null @@ -1,250 +0,0 @@ -setAuthenticators($authenticators); - } - - /** - * Set the Authenticators which can process a login request. - * @param Swift_Transport_Esmtp_Authenticator[] $authenticators - */ - public function setAuthenticators(array $authenticators) - { - $this->_authenticators = $authenticators; - } - - /** - * Get the Authenticators which can process a login request. - * @return Swift_Transport_Esmtp_Authenticator[] - */ - public function getAuthenticators() - { - return $this->_authenticators; - } - - /** - * Set the username to authenticate with. - * @param string $username - */ - public function setUsername($username) - { - $this->_username = $username; - } - - /** - * Get the username to authenticate with. - * @return string - */ - public function getUsername() - { - return $this->_username; - } - - /** - * Set the password to authenticate with. - * @param string $password - */ - public function setPassword($password) - { - $this->_password = $password; - } - - /** - * Get the password to authenticate with. - * @return string - */ - public function getPassword() - { - return $this->_password; - } - - /** - * Set the auth mode to use to authenticate. - * @param string $mode - */ - public function setAuthMode($mode) - { - $this->_auth_mode = $mode; - } - - /** - * Get the auth mode to use to authenticate. - * @return string - */ - public function getAuthMode() - { - return $this->_auth_mode; - } - - /** - * Get the name of the ESMTP extension this handles. - * @return boolean - */ - public function getHandledKeyword() - { - return 'AUTH'; - } - - /** - * Set the parameters which the EHLO greeting indicated. - * @param string[] $parameters - */ - public function setKeywordParams(array $parameters) - { - $this->_esmtpParams = $parameters; - } - - /** - * Runs immediately after a EHLO has been issued. - * @param Swift_Transport_SmtpAgent $agent to read/write - */ - public function afterEhlo(Swift_Transport_SmtpAgent $agent) - { - if ($this->_username) { - $count = 0; - foreach ($this->_getAuthenticatorsForAgent() as $authenticator) { - if (in_array(strtolower($authenticator->getAuthKeyword()), - array_map('strtolower', $this->_esmtpParams))) - { - $count++; - if ($authenticator->authenticate($agent, $this->_username, $this->_password)) { - return; - } - } - } - throw new Swift_TransportException( - 'Failed to authenticate on SMTP server with username "' . - $this->_username . '" using ' . $count . ' possible authenticators' - ); - } - } - - /** - * Not used. - */ - public function getMailParams() - { - return array(); - } - - /** - * Not used. - */ - public function getRcptParams() - { - return array(); - } - - /** - * Not used. - */ - public function onCommand(Swift_Transport_SmtpAgent $agent, $command, $codes = array(), &$failedRecipients = null, &$stop = false) - { - } - - /** - * Returns +1, -1 or 0 according to the rules for usort(). - * This method is called to ensure extensions can be execute in an appropriate order. - * @param string $esmtpKeyword to compare with - * @return int - */ - public function getPriorityOver($esmtpKeyword) - { - return 0; - } - - /** - * Returns an array of method names which are exposed to the Esmtp class. - * @return string[] - */ - public function exposeMixinMethods() - { - return array('setUsername', 'getUsername', 'setPassword', 'getPassword', 'setAuthMode', 'getAuthMode'); - } - - /** - * Not used. - */ - public function resetState() - { - } - - // -- Protected methods - - /** - * Returns the authenticator list for the given agent. - * @param Swift_Transport_SmtpAgent $agent - * @return array - * @access protected - */ - protected function _getAuthenticatorsForAgent() - { - if (!$mode = strtolower($this->_auth_mode)) { - return $this->_authenticators; - } - - foreach ($this->_authenticators as $authenticator) { - if (strtolower($authenticator->getAuthKeyword()) == $mode) { - return array($authenticator); - } - } - - throw new Swift_TransportException('Auth mode '.$mode.' is invalid'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Authenticator.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Authenticator.php deleted file mode 100644 index d14dccb..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Authenticator.php +++ /dev/null @@ -1,33 +0,0 @@ -. - * @return string[] - */ - public function getMailParams(); - - /** - * Get params which are appended to RCPT TO:<>. - * @return string[] - */ - public function getRcptParams(); - - /** - * Runs when a command is due to be sent. - * @param Swift_Transport_SmtpAgent $agent to read/write - * @param string $command to send - * @param int[] $codes expected in response - * @param string[] &$failedRecipients - * @param boolean &$stop to be set true if the command is now sent - */ - public function onCommand(Swift_Transport_SmtpAgent $agent, $command, $codes = array(), &$failedRecipients = null, &$stop = false); - - /** - * Returns +1, -1 or 0 according to the rules for usort(). - * This method is called to ensure extensions can be execute in an appropriate order. - * @param string $esmtpKeyword to compare with - * @return int - */ - public function getPriorityOver($esmtpKeyword); - - /** - * Returns an array of method names which are exposed to the Esmtp class. - * @return string[] - */ - public function exposeMixinMethods(); - - /** - * Tells this handler to clear any buffers and reset its state. - */ - public function resetState(); -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php deleted file mode 100644 index 82226a7..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php +++ /dev/null @@ -1,370 +0,0 @@ - 'tcp', - 'host' => 'localhost', - 'port' => 25, - 'timeout' => 30, - 'blocking' => 1, - 'tls' => false, - 'type' => Swift_Transport_IoBuffer::TYPE_SOCKET - ); - - /** - * Creates a new EsmtpTransport using the given I/O buffer. - * @param Swift_Transport_IoBuffer $buf - * @param Swift_Transport_EsmtpHandler[] $extensionHandlers - * @param Swift_Events_EventDispatcher $dispatcher - */ - public function __construct(Swift_Transport_IoBuffer $buf, array $extensionHandlers, Swift_Events_EventDispatcher $dispatcher) - { - parent::__construct($buf, $dispatcher); - $this->setExtensionHandlers($extensionHandlers); - } - - /** - * Set the host to connect to. - * @param string $host - * @return Swift_Transport_EsmtpTransport - */ - public function setHost($host) - { - $this->_params['host'] = $host; - - return $this; - } - - /** - * Get the host to connect to. - * @return string - */ - public function getHost() - { - return $this->_params['host']; - } - - /** - * Set the port to connect to. - * @param int $port - * @return Swift_Transport_EsmtpTransport - */ - public function setPort($port) - { - $this->_params['port'] = (int) $port; - - return $this; - } - - /** - * Get the port to connect to. - * @return int - */ - public function getPort() - { - return $this->_params['port']; - } - - /** - * Set the connection timeout. - * @param int $timeout seconds - * @return Swift_Transport_EsmtpTransport - */ - public function setTimeout($timeout) - { - $this->_params['timeout'] = (int) $timeout; - $this->_buffer->setParam('timeout', (int) $timeout); - - return $this; - } - - /** - * Get the connection timeout. - * @return int - */ - public function getTimeout() - { - return $this->_params['timeout']; - } - - /** - * Set the encryption type (tls or ssl) - * @param string $encryption - * @return Swift_Transport_EsmtpTransport - */ - public function setEncryption($enc) - { - if ('tls' == $enc) { - $this->_params['protocol'] = 'tcp'; - $this->_params['tls'] = true; - } else { - $this->_params['protocol'] = $enc; - $this->_params['tls'] = false; - } - - return $this; - } - - /** - * Get the encryption type. - * @return string - */ - public function getEncryption() - { - return $this->_params['tls'] ? 'tls' : $this->_params['protocol']; - } - - /** - * Sets the sourceIp - * @param string $source - * @return Swift_Transport_EsmtpTransport - */ - public function setSourceIp($source) - { - $this->_params['sourceIp']=$source; - - return $this; - } - - /** - * Returns the ip used to connect to the destination - * @return string - */ - public function getSourceIp() - { - return $this->_params['sourceIp']; - } - - /** - * Set ESMTP extension handlers. - * @param Swift_Transport_EsmtpHandler[] $handlers - * @return Swift_Transport_EsmtpTransport - */ - public function setExtensionHandlers(array $handlers) - { - $assoc = array(); - foreach ($handlers as $handler) { - $assoc[$handler->getHandledKeyword()] = $handler; - } - uasort($assoc, array($this, '_sortHandlers')); - $this->_handlers = $assoc; - $this->_setHandlerParams(); - - return $this; - } - - /** - * Get ESMTP extension handlers. - * @return Swift_Transport_EsmtpHandler[] - */ - public function getExtensionHandlers() - { - return array_values($this->_handlers); - } - - /** - * Run a command against the buffer, expecting the given response codes. - * If no response codes are given, the response will not be validated. - * If codes are given, an exception will be thrown on an invalid response. - * @param string $command - * @param int[] $codes - * @param string[] &$failures - * @return string - */ - public function executeCommand($command, $codes = array(), &$failures = null) - { - $failures = (array) $failures; - $stopSignal = false; - $response = null; - foreach ($this->_getActiveHandlers() as $handler) { - $response = $handler->onCommand( - $this, $command, $codes, $failures, $stopSignal - ); - if ($stopSignal) { - return $response; - } - } - - return parent::executeCommand($command, $codes, $failures); - } - - // -- Mixin invocation code - - /** Mixin handling method for ESMTP handlers */ - public function __call($method, $args) - { - foreach ($this->_handlers as $handler) { - if (in_array(strtolower($method), - array_map('strtolower', (array) $handler->exposeMixinMethods()) - )) - { - $return = call_user_func_array(array($handler, $method), $args); - //Allow fluid method calls - if (is_null($return) && substr($method, 0, 3) == 'set') { - return $this; - } else { - return $return; - } - } - } - trigger_error('Call to undefined method ' . $method, E_USER_ERROR); - } - - // -- Protected methods - - /** Get the params to initialize the buffer */ - protected function _getBufferParams() - { - return $this->_params; - } - - /** Overridden to perform EHLO instead */ - protected function _doHeloCommand() - { - try { - $response = $this->executeCommand( - sprintf("EHLO %s\r\n", $this->_domain), array(250) - ); - } catch (Swift_TransportException $e) { - return parent::_doHeloCommand(); - } - - if ($this->_params['tls']) { - try { - $this->executeCommand("STARTTLS\r\n", array(220)); - - if (!$this->_buffer->startTLS()) { - throw new Swift_TransportException('Unable to connect with TLS encryption'); - } - - try { - $response = $this->executeCommand( - sprintf("EHLO %s\r\n", $this->_domain), array(250) - ); - } catch (Swift_TransportException $e) { - return parent::_doHeloCommand(); - } - } catch (Swift_TransportException $e) { - $this->_throwException($e); - } - } - - $this->_capabilities = $this->_getCapabilities($response); - $this->_setHandlerParams(); - foreach ($this->_getActiveHandlers() as $handler) { - $handler->afterEhlo($this); - } - } - - /** Overridden to add Extension support */ - protected function _doMailFromCommand($address) - { - $handlers = $this->_getActiveHandlers(); - $params = array(); - foreach ($handlers as $handler) { - $params = array_merge($params, (array) $handler->getMailParams()); - } - $paramStr = !empty($params) ? ' ' . implode(' ', $params) : ''; - $this->executeCommand( - sprintf("MAIL FROM: <%s>%s\r\n", $address, $paramStr), array(250) - ); - } - - /** Overridden to add Extension support */ - protected function _doRcptToCommand($address) - { - $handlers = $this->_getActiveHandlers(); - $params = array(); - foreach ($handlers as $handler) { - $params = array_merge($params, (array) $handler->getRcptParams()); - } - $paramStr = !empty($params) ? ' ' . implode(' ', $params) : ''; - $this->executeCommand( - sprintf("RCPT TO: <%s>%s\r\n", $address, $paramStr), array(250, 251, 252) - ); - } - - // -- Private methods - - /** Determine ESMTP capabilities by function group */ - private function _getCapabilities($ehloResponse) - { - $capabilities = array(); - $ehloResponse = trim($ehloResponse); - $lines = explode("\r\n", $ehloResponse); - array_shift($lines); - foreach ($lines as $line) { - if (preg_match('/^[0-9]{3}[ -]([A-Z0-9-]+)((?:[ =].*)?)$/Di', $line, $matches)) { - $keyword = strtoupper($matches[1]); - $paramStr = strtoupper(ltrim($matches[2], ' =')); - $params = !empty($paramStr) ? explode(' ', $paramStr) : array(); - $capabilities[$keyword] = $params; - } - } - - return $capabilities; - } - - /** Set parameters which are used by each extension handler */ - private function _setHandlerParams() - { - foreach ($this->_handlers as $keyword => $handler) { - if (array_key_exists($keyword, $this->_capabilities)) { - $handler->setKeywordParams($this->_capabilities[$keyword]); - } - } - } - - /** Get ESMTP handlers which are currently ok to use */ - private function _getActiveHandlers() - { - $handlers = array(); - foreach ($this->_handlers as $keyword => $handler) { - if (array_key_exists($keyword, $this->_capabilities)) { - $handlers[] = $handler; - } - } - - return $handlers; - } - - /** Custom sort for extension handler ordering */ - private function _sortHandlers($a, $b) - { - return $a->getPriorityOver($b->getHandledKeyword()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/FailoverTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/FailoverTransport.php deleted file mode 100644 index 6f94290..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/FailoverTransport.php +++ /dev/null @@ -1,86 +0,0 @@ -_transports); - $sent = 0; - - for ($i = 0; $i < $maxTransports - && $transport = $this->_getNextTransport(); ++$i) - { - try { - if (!$transport->isStarted()) { - $transport->start(); - } - - return $transport->send($message, $failedRecipients); - } catch (Swift_TransportException $e) { - $this->_killCurrentTransport(); - } - } - - if (count($this->_transports) == 0) { - throw new Swift_TransportException( - 'All Transports in FailoverTransport failed, or no Transports available' - ); - } - - return $sent; - } - - // -- Protected methods - - protected function _getNextTransport() - { - if (!isset($this->_currentTransport)) { - $this->_currentTransport = parent::_getNextTransport(); - } - - return $this->_currentTransport; - } - - protected function _killCurrentTransport() - { - $this->_currentTransport = null; - parent::_killCurrentTransport(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/IoBuffer.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/IoBuffer.php deleted file mode 100644 index d11c423..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/IoBuffer.php +++ /dev/null @@ -1,59 +0,0 @@ -_transports = $transports; - $this->_deadTransports = array(); - } - - /** - * Get $transports to delegate to. - * - * @return array Swift_Transport - */ - public function getTransports() - { - return array_merge($this->_transports, $this->_deadTransports); - } - - /** - * Test if this Transport mechanism has started. - * - * @return boolean - */ - public function isStarted() - { - return count($this->_transports) > 0; - } - - /** - * Start this Transport mechanism. - */ - public function start() - { - $this->_transports = array_merge($this->_transports, $this->_deadTransports); - } - - /** - * Stop this Transport mechanism. - */ - public function stop() - { - foreach ($this->_transports as $transport) { - $transport->stop(); - } - } - - /** - * Send the given Message. - * - * Recipient/sender data will be retrieved from the Message API. - * The return value is the number of recipients who were accepted for delivery. - * - * @param Swift_Mime_Message $message - * @param string[] &$failedRecipients to collect failures by-reference - * @return int - */ - public function send(Swift_Mime_Message $message, &$failedRecipients = null) - { - $maxTransports = count($this->_transports); - $sent = 0; - - for ($i = 0; $i < $maxTransports - && $transport = $this->_getNextTransport(); ++$i) - { - try { - if (!$transport->isStarted()) { - $transport->start(); - } - if ($sent = $transport->send($message, $failedRecipients)) { - break; - } - } catch (Swift_TransportException $e) { - $this->_killCurrentTransport(); - } - } - - if (count($this->_transports) == 0) { - throw new Swift_TransportException( - 'All Transports in LoadBalancedTransport failed, or no Transports available' - ); - } - - return $sent; - } - - /** - * Register a plugin. - * - * @param Swift_Events_EventListener $plugin - */ - public function registerPlugin(Swift_Events_EventListener $plugin) - { - foreach ($this->_transports as $transport) { - $transport->registerPlugin($plugin); - } - } - - // -- Protected methods - - /** - * Rotates the transport list around and returns the first instance. - * - * @return Swift_Transport - * @access protected - */ - protected function _getNextTransport() - { - if ($next = array_shift($this->_transports)) { - $this->_transports[] = $next; - } - - return $next; - } - - /** - * Tag the currently used (top of stack) transport as dead/useless. - * - * @access protected - */ - protected function _killCurrentTransport() - { - if ($transport = array_pop($this->_transports)) { - try { - $transport->stop(); - } catch (Exception $e) { - } - $this->_deadTransports[] = $transport; - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/MailInvoker.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/MailInvoker.php deleted file mode 100644 index 0bf1f96..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/MailInvoker.php +++ /dev/null @@ -1,34 +0,0 @@ -_invoker = $invoker; - $this->_eventDispatcher = $eventDispatcher; - } - - /** - * Not used. - */ - public function isStarted() - { - return false; - } - - /** - * Not used. - */ - public function start() - { - } - - /** - * Not used. - */ - public function stop() - { - } - - /** - * Set the additional parameters used on the mail() function. - * - * This string is formatted for sprintf() where %s is the sender address. - * - * @param string $params - * @return Swift_Transport_MailTransport - */ - public function setExtraParams($params) - { - $this->_extraParams = $params; - - return $this; - } - - /** - * Get the additional parameters used on the mail() function. - * - * This string is formatted for sprintf() where %s is the sender address. - * - * @return string - */ - public function getExtraParams() - { - return $this->_extraParams; - } - - /** - * Send the given Message. - * - * Recipient/sender data will be retrieved from the Message API. - * The return value is the number of recipients who were accepted for delivery. - * - * @param Swift_Mime_Message $message - * @param string[] &$failedRecipients to collect failures by-reference - * @return int - */ - public function send(Swift_Mime_Message $message, &$failedRecipients = null) - { - $failedRecipients = (array) $failedRecipients; - - if ($evt = $this->_eventDispatcher->createSendEvent($this, $message)) { - $this->_eventDispatcher->dispatchEvent($evt, 'beforeSendPerformed'); - if ($evt->bubbleCancelled()) { - return 0; - } - } - - $count = ( - count((array) $message->getTo()) - + count((array) $message->getCc()) - + count((array) $message->getBcc()) - ); - - $toHeader = $message->getHeaders()->get('To'); - $subjectHeader = $message->getHeaders()->get('Subject'); - - if (!$toHeader) { - throw new Swift_TransportException( - 'Cannot send message without a recipient' - ); - } - $to = $toHeader->getFieldBody(); - $subject = $subjectHeader ? $subjectHeader->getFieldBody() : ''; - - $reversePath = $this->_getReversePath($message); - - //Remove headers that would otherwise be duplicated - $message->getHeaders()->remove('To'); - $message->getHeaders()->remove('Subject'); - - $messageStr = $message->toString(); - - $message->getHeaders()->set($toHeader); - $message->getHeaders()->set($subjectHeader); - - //Separate headers from body - if (false !== $endHeaders = strpos($messageStr, "\r\n\r\n")) { - $headers = substr($messageStr, 0, $endHeaders) . "\r\n"; //Keep last EOL - $body = substr($messageStr, $endHeaders + 4); - } else { - $headers = $messageStr . "\r\n"; - $body = ''; - } - - unset($messageStr); - - if ("\r\n" != PHP_EOL) { - //Non-windows (not using SMTP) - $headers = str_replace("\r\n", PHP_EOL, $headers); - $body = str_replace("\r\n", PHP_EOL, $body); - } else { - //Windows, using SMTP - $headers = str_replace("\r\n.", "\r\n..", $headers); - $body = str_replace("\r\n.", "\r\n..", $body); - } - - if ($this->_invoker->mail($to, $subject, $body, $headers, - sprintf($this->_extraParams, $reversePath))) - { - if ($evt) { - $evt->setResult(Swift_Events_SendEvent::RESULT_SUCCESS); - $evt->setFailedRecipients($failedRecipients); - $this->_eventDispatcher->dispatchEvent($evt, 'sendPerformed'); - } - } else { - $failedRecipients = array_merge( - $failedRecipients, - array_keys((array) $message->getTo()), - array_keys((array) $message->getCc()), - array_keys((array) $message->getBcc()) - ); - - if ($evt) { - $evt->setResult(Swift_Events_SendEvent::RESULT_FAILED); - $evt->setFailedRecipients($failedRecipients); - $this->_eventDispatcher->dispatchEvent($evt, 'sendPerformed'); - } - - $message->generateId(); - - $count = 0; - } - - return $count; - } - - /** - * Register a plugin. - * - * @param Swift_Events_EventListener $plugin - */ - public function registerPlugin(Swift_Events_EventListener $plugin) - { - $this->_eventDispatcher->bindEventListener($plugin); - } - - // -- Private methods - - /** Determine the best-use reverse path for this message */ - private function _getReversePath(Swift_Mime_Message $message) - { - $return = $message->getReturnPath(); - $sender = $message->getSender(); - $from = $message->getFrom(); - $path = null; - if (!empty($return)) { - $path = $return; - } elseif (!empty($sender)) { - $keys = array_keys($sender); - $path = array_shift($keys); - } elseif (!empty($from)) { - $keys = array_keys($from); - $path = array_shift($keys); - } - - return $path; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/NullTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/NullTransport.php deleted file mode 100644 index 87dedcd..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/NullTransport.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Pretends messages have been sent, but just ignores them. - * @package Swift - * @author Fabien Potencier - */ -class Swift_Transport_NullTransport implements Swift_Transport -{ - /** The event dispatcher from the plugin API */ - private $_eventDispatcher; - - /** - * Constructor. - */ - public function __construct(Swift_Events_EventDispatcher $eventDispatcher) - { - $this->_eventDispatcher = $eventDispatcher; - } - - /** - * Tests if this Transport mechanism has started. - * - * @return boolean - */ - public function isStarted() - { - return true; - } - - /** - * Starts this Transport mechanism. - */ - public function start() - { - } - - /** - * Stops this Transport mechanism. - */ - public function stop() - { - } - - /** - * Sends the given message. - * - * @param Swift_Mime_Message $message - * @param string[] &$failedRecipients to collect failures by-reference - * - * @return int The number of sent emails - */ - public function send(Swift_Mime_Message $message, &$failedRecipients = null) - { - if ($evt = $this->_eventDispatcher->createSendEvent($this, $message)) { - $this->_eventDispatcher->dispatchEvent($evt, 'beforeSendPerformed'); - if ($evt->bubbleCancelled()) { - return 0; - } - } - - if ($evt) { - $evt->setResult(Swift_Events_SendEvent::RESULT_SUCCESS); - $this->_eventDispatcher->dispatchEvent($evt, 'sendPerformed'); - } - - return 0; - } - - /** - * Register a plugin. - * - * @param Swift_Events_EventListener $plugin - */ - public function registerPlugin(Swift_Events_EventListener $plugin) - { - $this->_eventDispatcher->bindEventListener($plugin); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php deleted file mode 100644 index 4b36682..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php +++ /dev/null @@ -1,153 +0,0 @@ - 30, - 'blocking' => 1, - 'command' => '/usr/sbin/sendmail -bs', - 'type' => Swift_Transport_IoBuffer::TYPE_PROCESS - ); - - /** - * Create a new SendmailTransport with $buf for I/O. - * @param Swift_Transport_IoBuffer $buf - * @param Swift_Events_EventDispatcher $dispatcher - */ - public function __construct(Swift_Transport_IoBuffer $buf, Swift_Events_EventDispatcher $dispatcher) - { - parent::__construct($buf, $dispatcher); - } - - /** - * Start the standalone SMTP session if running in -bs mode. - */ - public function start() - { - if (false !== strpos($this->getCommand(), ' -bs')) { - parent::start(); - } - } - - /** - * Set the command to invoke. - * If using -t mode you are strongly advised to include -oi or -i in the - * flags. For example: /usr/sbin/sendmail -oi -t - * Swift will append a -f flag if one is not present. - * The recommended mode is "-bs" since it is interactive and failure notifications - * are hence possible. - * @param string $command - * @return Swift_Transport_SendmailTransport - */ - public function setCommand($command) - { - $this->_params['command'] = $command; - - return $this; - } - - /** - * Get the sendmail command which will be invoked. - * @return string - */ - public function getCommand() - { - return $this->_params['command']; - } - - /** - * Send the given Message. - * Recipient/sender data will be retrieved from the Message API. - * The return value is the number of recipients who were accepted for delivery. - * NOTE: If using 'sendmail -t' you will not be aware of any failures until - * they bounce (i.e. send() will always return 100% success). - * @param Swift_Mime_Message $message - * @param string[] &$failedRecipients to collect failures by-reference - * @return int - */ - public function send(Swift_Mime_Message $message, &$failedRecipients = null) - { - $failedRecipients = (array) $failedRecipients; - $command = $this->getCommand(); - $buffer = $this->getBuffer(); - - if (false !== strpos($command, ' -t')) { - if ($evt = $this->_eventDispatcher->createSendEvent($this, $message)) { - $this->_eventDispatcher->dispatchEvent($evt, 'beforeSendPerformed'); - if ($evt->bubbleCancelled()) { - return 0; - } - } - - if (false === strpos($command, ' -f')) { - $command .= ' -f' . $this->_getReversePath($message); - } - - $buffer->initialize(array_merge($this->_params, array('command' => $command))); - - if (false === strpos($command, ' -i') && false === strpos($command, ' -oi')) { - $buffer->setWriteTranslations(array("\r\n" => "\n", "\n." => "\n..")); - } else { - $buffer->setWriteTranslations(array("\r\n"=>"\n")); - } - - $count = count((array) $message->getTo()) - + count((array) $message->getCc()) - + count((array) $message->getBcc()) - ; - $message->toByteStream($buffer); - $buffer->flushBuffers(); - $buffer->setWriteTranslations(array()); - $buffer->terminate(); - - if ($evt) { - $evt->setResult(Swift_Events_SendEvent::RESULT_SUCCESS); - $evt->setFailedRecipients($failedRecipients); - $this->_eventDispatcher->dispatchEvent($evt, 'sendPerformed'); - } - - $message->generateId(); - } elseif (false !== strpos($command, ' -bs')) { - $count = parent::send($message, $failedRecipients); - } else { - $this->_throwException(new Swift_TransportException( - 'Unsupported sendmail command flags [' . $command . ']. ' . - 'Must be one of "-bs" or "-t" but can include additional flags.' - )); - } - - return $count; - } - - // -- Protected methods - - /** Get the params to initialize the buffer */ - protected function _getBufferParams() - { - return $this->_params; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SimpleMailInvoker.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SimpleMailInvoker.php deleted file mode 100644 index 795bd15..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SimpleMailInvoker.php +++ /dev/null @@ -1,51 +0,0 @@ -. - - */ - -/** - * This is the implementation class for {@link Swift_Transport_MailInvoker}. - * - * @package Swift - * @subpackage Transport - * @author Chris Corbyn - */ -class Swift_Transport_SimpleMailInvoker implements Swift_Transport_MailInvoker -{ - /** - * Send mail via the mail() function. - * - * This method takes the same arguments as PHP mail(). - * - * @param string $to - * @param string $subject - * @param string $body - * @param string $headers - * @param string $extraParams - * - * @return boolean - */ - public function mail($to, $subject, $body, $headers = null, $extraParams = null) - { - if (!ini_get('safe_mode')) { - return @mail($to, $subject, $body, $headers, $extraParams); - } else { - return @mail($to, $subject, $body, $headers); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SmtpAgent.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SmtpAgent.php deleted file mode 100644 index 27fa533..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SmtpAgent.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Stores Messages in a queue. - * @package Swift - * @author Fabien Potencier - */ -class Swift_Transport_SpoolTransport implements Swift_Transport -{ - /** The spool instance */ - private $_spool; - - /** The event dispatcher from the plugin API */ - private $_eventDispatcher; - - /** - * Constructor. - */ - public function __construct(Swift_Events_EventDispatcher $eventDispatcher, Swift_Spool $spool = null) - { - $this->_eventDispatcher = $eventDispatcher; - $this->_spool = $spool; - } - - /** - * Sets the spool object. - * @param Swift_Spool $spool - * @return Swift_Transport_SpoolTransport - */ - public function setSpool(Swift_Spool $spool) - { - $this->_spool = $spool; - - return $this; - } - - /** - * Get the spool object. - * @return Swift_Spool - */ - public function getSpool() - { - return $this->_spool; - } - - /** - * Tests if this Transport mechanism has started. - * - * @return boolean - */ - public function isStarted() - { - return true; - } - - /** - * Starts this Transport mechanism. - */ - public function start() - { - } - - /** - * Stops this Transport mechanism. - */ - public function stop() - { - } - - /** - * Sends the given message. - * - * @param Swift_Mime_Message $message - * @param string[] &$failedRecipients to collect failures by-reference - * - * @return int The number of sent emails - */ - public function send(Swift_Mime_Message $message, &$failedRecipients = null) - { - if ($evt = $this->_eventDispatcher->createSendEvent($this, $message)) { - $this->_eventDispatcher->dispatchEvent($evt, 'beforeSendPerformed'); - if ($evt->bubbleCancelled()) { - return 0; - } - } - - $success = $this->_spool->queueMessage($message); - - if ($evt) { - $evt->setResult($success ? Swift_Events_SendEvent::RESULT_SUCCESS : Swift_Events_SendEvent::RESULT_FAILED); - $this->_eventDispatcher->dispatchEvent($evt, 'sendPerformed'); - } - - return 1; - } - - /** - * Register a plugin. - * - * @param Swift_Events_EventListener $plugin - */ - public function registerPlugin(Swift_Events_EventListener $plugin) - { - $this->_eventDispatcher->bindEventListener($plugin); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php deleted file mode 100644 index fd3498b..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php +++ /dev/null @@ -1,299 +0,0 @@ -_replacementFactory = $replacementFactory; - } - - /** - * Perform any initialization needed, using the given $params. - * Parameters will vary depending upon the type of IoBuffer used. - * @param array $params - */ - public function initialize(array $params) - { - $this->_params = $params; - switch ($params['type']) { - case self::TYPE_PROCESS: - $this->_establishProcessConnection(); - break; - case self::TYPE_SOCKET: - default: - $this->_establishSocketConnection(); - break; - } - } - - /** - * Set an individual param on the buffer (e.g. switching to SSL). - * @param string $param - * @param mixed $value - */ - public function setParam($param, $value) - { - if (isset($this->_stream)) { - switch ($param) { - case 'timeout': - if ($this->_stream) { - stream_set_timeout($this->_stream, $value); - } - break; - - case 'blocking': - if ($this->_stream) { - stream_set_blocking($this->_stream, 1); - } - - } - } - $this->_params[$param] = $value; - } - - public function startTLS() - { - return stream_socket_enable_crypto($this->_stream, true, STREAM_CRYPTO_METHOD_TLS_CLIENT); - } - - /** - * Perform any shutdown logic needed. - */ - public function terminate() - { - if (isset($this->_stream)) { - switch ($this->_params['type']) { - case self::TYPE_PROCESS: - fclose($this->_in); - fclose($this->_out); - proc_close($this->_stream); - break; - case self::TYPE_SOCKET: - default: - fclose($this->_stream); - break; - } - } - $this->_stream = null; - $this->_out = null; - $this->_in = null; - } - - /** - * Set an array of string replacements which should be made on data written - * to the buffer. This could replace LF with CRLF for example. - * @param string[] $replacements - */ - public function setWriteTranslations(array $replacements) - { - foreach ($this->_translations as $search => $replace) { - if (!isset($replacements[$search])) { - $this->removeFilter($search); - unset($this->_translations[$search]); - } - } - - foreach ($replacements as $search => $replace) { - if (!isset($this->_translations[$search])) { - $this->addFilter( - $this->_replacementFactory->createFilter($search, $replace), $search - ); - $this->_translations[$search] = true; - } - } - } - - /** - * Get a line of output (including any CRLF). - * The $sequence number comes from any writes and may or may not be used - * depending upon the implementation. - * @param int $sequence of last write to scan from - * @return string - */ - public function readLine($sequence) - { - if (isset($this->_out) && !feof($this->_out)) { - $line = fgets($this->_out); - if (strlen($line)==0) { - $metas = stream_get_meta_data($this->_out); - if ($metas['timed_out']) { - throw new Swift_IoException( - 'Connection to ' . - $this->_getReadConnectionDescription() . - ' Timed Out' - ); - } - } - - return $line; - } - } - - /** - * Reads $length bytes from the stream into a string and moves the pointer - * through the stream by $length. If less bytes exist than are requested the - * remaining bytes are given instead. If no bytes are remaining at all, boolean - * false is returned. - * @param int $length - * @return string - */ - public function read($length) - { - if (isset($this->_out) && !feof($this->_out)) { - $ret = fread($this->_out, $length); - if (strlen($ret)==0) { - $metas = stream_get_meta_data($this->_out); - if ($metas['timed_out']) { - throw new Swift_IoException( - 'Connection to ' . - $this->_getReadConnectionDescription() . - ' Timed Out' - ); - } - } - - return $ret; - } - } - - /** Not implemented */ - public function setReadPointer($byteOffset) - { - } - - // -- Protected methods - - /** Flush the stream contents */ - protected function _flush() - { - if (isset($this->_in)) { - fflush($this->_in); - } - } - - /** Write this bytes to the stream */ - protected function _commit($bytes) - { - if (isset($this->_in) - && fwrite($this->_in, $bytes)) - { - return ++$this->_sequence; - } - } - - // -- Private methods - - /** - * Establishes a connection to a remote server. - * @access private - */ - private function _establishSocketConnection() - { - $host = $this->_params['host']; - if (!empty($this->_params['protocol'])) { - $host = $this->_params['protocol'] . '://' . $host; - } - $timeout = 15; - if (!empty($this->_params['timeout'])) { - $timeout = $this->_params['timeout']; - } - $options = array(); - if (!empty($this->_params['sourceIp'])) { - $options['socket']['bindto']=$this->_params['sourceIp'].':0'; - } - $this->_stream = @stream_socket_client($host.':'.$this->_params['port'], $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, stream_context_create($options)); - if (false === $this->_stream) { - throw new Swift_TransportException( - 'Connection could not be established with host ' . $this->_params['host'] . - ' [' . $errstr . ' #' . $errno . ']' - ); - } - if (!empty($this->_params['blocking'])) { - stream_set_blocking($this->_stream, 1); - } else { - stream_set_blocking($this->_stream, 0); - } - stream_set_timeout($this->_stream, $timeout); - $this->_in =& $this->_stream; - $this->_out =& $this->_stream; - } - - /** - * Opens a process for input/output. - * @access private - */ - private function _establishProcessConnection() - { - $command = $this->_params['command']; - $descriptorSpec = array( - 0 => array('pipe', 'r'), - 1 => array('pipe', 'w'), - 2 => array('pipe', 'w') - ); - $this->_stream = proc_open($command, $descriptorSpec, $pipes); - stream_set_blocking($pipes[2], 0); - if ($err = stream_get_contents($pipes[2])) { - throw new Swift_TransportException( - 'Process could not be started [' . $err . ']' - ); - } - $this->_in =& $pipes[0]; - $this->_out =& $pipes[1]; - } - - private function _getReadConnectionDescription() - { - switch ($this->_params['type']) { - case self::TYPE_PROCESS: - return 'Process '.$this->_params['command']; - break; - - case self::TYPE_SOCKET: - default: - $host = $this->_params['host']; - if (!empty($this->_params['protocol'])) { - $host = $this->_params['protocol'] . '://' . $host; - } - $host.=':'.$this->_params['port']; - - return $host; - break; - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/TransportException.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/TransportException.php deleted file mode 100644 index 886076f..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/TransportException.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ -class Swift_Validate -{ - /** - * Grammar Object - * @var Swift_Mime_Grammar - */ - private static $grammar = null; - - /** - * Checks if an email matches the current grammars - * @param string $email - */ - public static function email($email) - { - if (self::$grammar===null) { - self::$grammar = Swift_DependencyContainer::getInstance() - ->lookup('mime.grammar'); - } - - return preg_match( - '/^' . self::$grammar->getDefinition('addr-spec') . '$/D', - $email - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/dependency_maps/cache_deps.php b/vendor/swiftmailer/swiftmailer/lib/dependency_maps/cache_deps.php deleted file mode 100644 index e49e8b8..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/dependency_maps/cache_deps.php +++ /dev/null @@ -1,23 +0,0 @@ - register('cache') - -> asAliasOf('cache.array') - - -> register('tempdir') - -> asValue('/tmp') - - -> register('cache.null') - -> asSharedInstanceOf('Swift_KeyCache_NullKeyCache') - - -> register('cache.array') - -> asSharedInstanceOf('Swift_KeyCache_ArrayKeyCache') - -> withDependencies(array('cache.inputstream')) - - -> register('cache.disk') - -> asSharedInstanceOf('Swift_KeyCache_DiskKeyCache') - -> withDependencies(array('cache.inputstream', 'tempdir')) - - -> register('cache.inputstream') - -> asNewInstanceOf('Swift_KeyCache_SimpleKeyCacheInputStream') -; diff --git a/vendor/swiftmailer/swiftmailer/lib/dependency_maps/message_deps.php b/vendor/swiftmailer/swiftmailer/lib/dependency_maps/message_deps.php deleted file mode 100644 index 272cb3a..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/dependency_maps/message_deps.php +++ /dev/null @@ -1,9 +0,0 @@ - register('message.message') - -> asNewInstanceOf('Swift_Message') - - -> register('message.mimepart') - -> asNewInstanceOf('Swift_MimePart') -; diff --git a/vendor/swiftmailer/swiftmailer/lib/dependency_maps/mime_deps.php b/vendor/swiftmailer/swiftmailer/lib/dependency_maps/mime_deps.php deleted file mode 100644 index 9122c8f..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/dependency_maps/mime_deps.php +++ /dev/null @@ -1,110 +0,0 @@ - register('properties.charset') - -> asValue('utf-8') - - -> register('mime.grammar') - -> asSharedInstanceOf('Swift_Mime_Grammar') - - -> register('mime.message') - -> asNewInstanceOf('Swift_Mime_SimpleMessage') - -> withDependencies(array( - 'mime.headerset', - 'mime.qpcontentencoder', - 'cache', - 'mime.grammar', - 'properties.charset' - )) - - -> register('mime.part') - -> asNewInstanceOf('Swift_Mime_MimePart') - -> withDependencies(array( - 'mime.headerset', - 'mime.qpcontentencoder', - 'cache', - 'mime.grammar', - 'properties.charset' - )) - - -> register('mime.attachment') - -> asNewInstanceOf('Swift_Mime_Attachment') - -> withDependencies(array( - 'mime.headerset', - 'mime.base64contentencoder', - 'cache', - 'mime.grammar' - )) - -> addConstructorValue($swift_mime_types) - - -> register('mime.embeddedfile') - -> asNewInstanceOf('Swift_Mime_EmbeddedFile') - -> withDependencies(array( - 'mime.headerset', - 'mime.base64contentencoder', - 'cache', - 'mime.grammar' - )) - -> addConstructorValue($swift_mime_types) - - -> register('mime.headerfactory') - -> asNewInstanceOf('Swift_Mime_SimpleHeaderFactory') - -> withDependencies(array( - 'mime.qpheaderencoder', - 'mime.rfc2231encoder', - 'mime.grammar', - 'properties.charset' - )) - - -> register('mime.headerset') - -> asNewInstanceOf('Swift_Mime_SimpleHeaderSet') - -> withDependencies(array('mime.headerfactory', 'properties.charset')) - - -> register('mime.qpheaderencoder') - -> asNewInstanceOf('Swift_Mime_HeaderEncoder_QpHeaderEncoder') - -> withDependencies(array('mime.charstream')) - - -> register('mime.base64headerencoder') - -> asNewInstanceOf('Swift_Mime_HeaderEncoder_Base64HeaderEncoder') - -> withDependencies(array('mime.charstream')) - - -> register('mime.charstream') - -> asNewInstanceOf('Swift_CharacterStream_NgCharacterStream') - -> withDependencies(array('mime.characterreaderfactory', 'properties.charset')) - - -> register('mime.bytecanonicalizer') - -> asSharedInstanceOf('Swift_StreamFilters_ByteArrayReplacementFilter') - -> addConstructorValue(array(array(0x0D, 0x0A), array(0x0D), array(0x0A))) - -> addConstructorValue(array(array(0x0A), array(0x0A), array(0x0D, 0x0A))) - - -> register('mime.characterreaderfactory') - -> asSharedInstanceOf('Swift_CharacterReaderFactory_SimpleCharacterReaderFactory') - - -> register('mime.qpcontentencoder') - -> asNewInstanceOf('Swift_Mime_ContentEncoder_QpContentEncoder') - -> withDependencies(array('mime.charstream', 'mime.bytecanonicalizer')) - - -> register('mime.nativeqpcontentencoder') - -> asNewInstanceOf('Swift_Mime_ContentEncoder_NativeQpContentEncoder') - - -> register('mime.7bitcontentencoder') - -> asNewInstanceOf('Swift_Mime_ContentEncoder_PlainContentEncoder') - -> addConstructorValue('7bit') - -> addConstructorValue(true) - - -> register('mime.8bitcontentencoder') - -> asNewInstanceOf('Swift_Mime_ContentEncoder_PlainContentEncoder') - -> addConstructorValue('8bit') - -> addConstructorValue(true) - - -> register('mime.base64contentencoder') - -> asSharedInstanceOf('Swift_Mime_ContentEncoder_Base64ContentEncoder') - - -> register('mime.rfc2231encoder') - -> asNewInstanceOf('Swift_Encoder_Rfc2231Encoder') - -> withDependencies(array('mime.charstream')) -; - -unset($swift_mime_types); diff --git a/vendor/swiftmailer/swiftmailer/lib/dependency_maps/transport_deps.php b/vendor/swiftmailer/swiftmailer/lib/dependency_maps/transport_deps.php deleted file mode 100644 index f969932..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/dependency_maps/transport_deps.php +++ /dev/null @@ -1,68 +0,0 @@ - register('transport.smtp') - -> asNewInstanceOf('Swift_Transport_EsmtpTransport') - -> withDependencies(array( - 'transport.buffer', - array('transport.authhandler'), - 'transport.eventdispatcher' - )) - - -> register('transport.sendmail') - -> asNewInstanceOf('Swift_Transport_SendmailTransport') - -> withDependencies(array( - 'transport.buffer', - 'transport.eventdispatcher' - )) - - -> register('transport.mail') - -> asNewInstanceOf('Swift_Transport_MailTransport') - -> withDependencies(array('transport.mailinvoker', 'transport.eventdispatcher')) - - -> register('transport.loadbalanced') - -> asNewInstanceOf('Swift_Transport_LoadBalancedTransport') - - -> register('transport.failover') - -> asNewInstanceOf('Swift_Transport_FailoverTransport') - - -> register('transport.spool') - -> asNewInstanceOf('Swift_Transport_SpoolTransport') - -> withDependencies(array('transport.eventdispatcher')) - - -> register('transport.null') - -> asNewInstanceOf('Swift_Transport_NullTransport') - -> withDependencies(array('transport.eventdispatcher')) - - -> register('transport.mailinvoker') - -> asSharedInstanceOf('Swift_Transport_SimpleMailInvoker') - - -> register('transport.buffer') - -> asNewInstanceOf('Swift_Transport_StreamBuffer') - -> withDependencies(array('transport.replacementfactory')) - - -> register('transport.authhandler') - -> asNewInstanceOf('Swift_Transport_Esmtp_AuthHandler') - -> withDependencies(array( - array( - 'transport.crammd5auth', - 'transport.loginauth', - 'transport.plainauth' - ) - )) - - -> register('transport.crammd5auth') - -> asNewInstanceOf('Swift_Transport_Esmtp_Auth_CramMd5Authenticator') - - -> register('transport.loginauth') - -> asNewInstanceOf('Swift_Transport_Esmtp_Auth_LoginAuthenticator') - - -> register('transport.plainauth') - -> asNewInstanceOf('Swift_Transport_Esmtp_Auth_PlainAuthenticator') - - -> register('transport.eventdispatcher') - -> asNewInstanceOf('Swift_Events_SimpleEventDispatcher') - - -> register('transport.replacementfactory') - -> asSharedInstanceOf('Swift_StreamFilters_StringReplacementFilterFactory') -; diff --git a/vendor/swiftmailer/swiftmailer/lib/mime_types.php b/vendor/swiftmailer/swiftmailer/lib/mime_types.php deleted file mode 100644 index 3baebb2..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/mime_types.php +++ /dev/null @@ -1,76 +0,0 @@ - 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', - 'avi' => 'video/avi', - 'bmp' => 'image/bmp', - 'bz2' => 'application/x-bz2', - 'csv' => 'text/csv', - 'dmg' => 'application/x-apple-diskimage', - 'doc' => 'application/msword', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'eml' => 'message/rfc822', - 'aps' => 'application/postscript', - 'exe' => 'application/x-ms-dos-executable', - 'flv' => 'video/x-flv', - 'gif' => 'image/gif', - 'gz' => 'application/x-gzip', - 'hqx' => 'application/stuffit', - 'htm' => 'text/html', - 'html' => 'text/html', - 'jar' => 'application/x-java-archive', - 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'm3u' => 'audio/x-mpegurl', - 'm4a' => 'audio/mp4', - 'mdb' => 'application/x-msaccess', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mov' => 'video/quicktime', - 'mp3' => 'audio/mpeg', - 'mp4' => 'video/mp4', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'odg' => 'vnd.oasis.opendocument.graphics', - 'odp' => 'vnd.oasis.opendocument.presentation', - 'odt' => 'vnd.oasis.opendocument.text', - 'ods' => 'vnd.oasis.opendocument.spreadsheet', - 'ogg' => 'audio/ogg', - 'pdf' => 'application/pdf', - 'png' => 'image/png', - 'ppt' => 'application/vnd.ms-powerpoint', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'ps' => 'application/postscript', - 'rar' => 'application/x-rar-compressed', - 'rtf' => 'application/rtf', - 'tar' => 'application/x-tar', - 'sit' => 'application/x-stuffit', - 'svg' => 'image/svg+xml', - 'tif' => 'image/tiff', - 'tiff' => 'image/tiff', - 'ttf' => 'application/x-font-truetype', - 'txt' => 'text/plain', - 'vcf' => 'text/x-vcard', - 'wav' => 'audio/wav', - 'wma' => 'audio/x-ms-wma', - 'wmv' => 'audio/x-ms-wmv', - 'xls' => 'application/excel', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xml' => 'application/xml', - 'zip' => 'application/zip' -); diff --git a/vendor/swiftmailer/swiftmailer/lib/preferences.php b/vendor/swiftmailer/swiftmailer/lib/preferences.php deleted file mode 100644 index d8aa8e3..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/preferences.php +++ /dev/null @@ -1,21 +0,0 @@ -setCharset('utf-8'); - -// Without these lines the default caching mechanism is "array" but this uses a lot of memory. -// If possible, use a disk cache to enable attaching large attachments etc. -// You can override the default temporary directory by setting the TMPDIR environment variable. -if (function_exists('sys_get_temp_dir') && is_writable(sys_get_temp_dir())) { - Swift_Preferences::getInstance() - -> setTempDir(sys_get_temp_dir()) - -> setCacheType('disk'); -} - -Swift_Preferences::getInstance()->setQPDotEscape(false); diff --git a/vendor/swiftmailer/swiftmailer/lib/swift_init.php b/vendor/swiftmailer/swiftmailer/lib/swift_init.php deleted file mode 100644 index 5897e6f..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/swift_init.php +++ /dev/null @@ -1,28 +0,0 @@ - - - Some test message - chris@w3style.co.uk - mark@swiftmailer.org - chris.corbyn@sitepoint.com - text/plain - - Here's a recipe for beef stifado - - - text/html - - This is the other part - - - - application/pdf - stifado.pdf - /path/to/stifado.pdf - - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc0821.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc0821.txt deleted file mode 100644 index d877b72..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc0821.txt +++ /dev/null @@ -1,4050 +0,0 @@ - - - - RFC 821 - - - - - - SIMPLE MAIL TRANSFER PROTOCOL - - - - Jonathan B. Postel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - August 1982 - - - - Information Sciences Institute - University of Southern California - 4676 Admiralty Way - Marina del Rey, California 90291 - - (213) 822-1511 - - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - TABLE OF CONTENTS - - 1. INTRODUCTION .................................................. 1 - - 2. THE SMTP MODEL ................................................ 2 - - 3. THE SMTP PROCEDURE ............................................ 4 - - 3.1. Mail ..................................................... 4 - 3.2. Forwarding ............................................... 7 - 3.3. Verifying and Expanding .................................. 8 - 3.4. Sending and Mailing ..................................... 11 - 3.5. Opening and Closing ..................................... 13 - 3.6. Relaying ................................................ 14 - 3.7. Domains ................................................. 17 - 3.8. Changing Roles .......................................... 18 - - 4. THE SMTP SPECIFICATIONS ...................................... 19 - - 4.1. SMTP Commands ........................................... 19 - 4.1.1. Command Semantics ..................................... 19 - 4.1.2. Command Syntax ........................................ 27 - 4.2. SMTP Replies ............................................ 34 - 4.2.1. Reply Codes by Function Group ......................... 35 - 4.2.2. Reply Codes in Numeric Order .......................... 36 - 4.3. Sequencing of Commands and Replies ...................... 37 - 4.4. State Diagrams .......................................... 39 - 4.5. Details ................................................. 41 - 4.5.1. Minimum Implementation ................................ 41 - 4.5.2. Transparency .......................................... 41 - 4.5.3. Sizes ................................................. 42 - - APPENDIX A: TCP ................................................. 44 - APPENDIX B: NCP ................................................. 45 - APPENDIX C: NITS ................................................ 46 - APPENDIX D: X.25 ................................................ 47 - APPENDIX E: Theory of Reply Codes ............................... 48 - APPENDIX F: Scenarios ........................................... 51 - - GLOSSARY ......................................................... 64 - - REFERENCES ....................................................... 67 - - - - -Network Working Group J. Postel -Request for Comments: DRAFT ISI -Replaces: RFC 788, 780, 772 August 1982 - - SIMPLE MAIL TRANSFER PROTOCOL - - -1. INTRODUCTION - - The objective of Simple Mail Transfer Protocol (SMTP) is to transfer - mail reliably and efficiently. - - SMTP is independent of the particular transmission subsystem and - requires only a reliable ordered data stream channel. Appendices A, - B, C, and D describe the use of SMTP with various transport services. - A Glossary provides the definitions of terms as used in this - document. - - An important feature of SMTP is its capability to relay mail across - transport service environments. A transport service provides an - interprocess communication environment (IPCE). An IPCE may cover one - network, several networks, or a subset of a network. It is important - to realize that transport systems (or IPCEs) are not one-to-one with - networks. A process can communicate directly with another process - through any mutually known IPCE. Mail is an application or use of - interprocess communication. Mail can be communicated between - processes in different IPCEs by relaying through a process connected - to two (or more) IPCEs. More specifically, mail can be relayed - between hosts on different transport systems by a host on both - transport systems. - - - - - - - - - - - - - - - - - - - - - - - - -Postel [Page 1] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - -2. THE SMTP MODEL - - The SMTP design is based on the following model of communication: as - the result of a user mail request, the sender-SMTP establishes a - two-way transmission channel to a receiver-SMTP. The receiver-SMTP - may be either the ultimate destination or an intermediate. SMTP - commands are generated by the sender-SMTP and sent to the - receiver-SMTP. SMTP replies are sent from the receiver-SMTP to the - sender-SMTP in response to the commands. - - Once the transmission channel is established, the SMTP-sender sends a - MAIL command indicating the sender of the mail. If the SMTP-receiver - can accept mail it responds with an OK reply. The SMTP-sender then - sends a RCPT command identifying a recipient of the mail. If the - SMTP-receiver can accept mail for that recipient it responds with an - OK reply; if not, it responds with a reply rejecting that recipient - (but not the whole mail transaction). The SMTP-sender and - SMTP-receiver may negotiate several recipients. When the recipients - have been negotiated the SMTP-sender sends the mail data, terminating - with a special sequence. If the SMTP-receiver successfully processes - the mail data it responds with an OK reply. The dialog is purposely - lock-step, one-at-a-time. - - ------------------------------------------------------------- - - - +----------+ +----------+ - +------+ | | | | - | User |<-->| | SMTP | | - +------+ | Sender- |Commands/Replies| Receiver-| - +------+ | SMTP |<-------------->| SMTP | +------+ - | File |<-->| | and Mail | |<-->| File | - |System| | | | | |System| - +------+ +----------+ +----------+ +------+ - - - Sender-SMTP Receiver-SMTP - - Model for SMTP Use - - Figure 1 - - ------------------------------------------------------------- - - The SMTP provides mechanisms for the transmission of mail; directly - from the sending user's host to the receiving user's host when the - - - -[Page 2] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - two host are connected to the same transport service, or via one or - more relay SMTP-servers when the source and destination hosts are not - connected to the same transport service. - - To be able to provide the relay capability the SMTP-server must be - supplied with the name of the ultimate destination host as well as - the destination mailbox name. - - The argument to the MAIL command is a reverse-path, which specifies - who the mail is from. The argument to the RCPT command is a - forward-path, which specifies who the mail is to. The forward-path - is a source route, while the reverse-path is a return route (which - may be used to return a message to the sender when an error occurs - with a relayed message). - - When the same message is sent to multiple recipients the SMTP - encourages the transmission of only one copy of the data for all the - recipients at the same destination host. - - The mail commands and replies have a rigid syntax. Replies also have - a numeric code. In the following, examples appear which use actual - commands and replies. The complete lists of commands and replies - appears in Section 4 on specifications. - - Commands and replies are not case sensitive. That is, a command or - reply word may be upper case, lower case, or any mixture of upper and - lower case. Note that this is not true of mailbox user names. For - some hosts the user name is case sensitive, and SMTP implementations - must take case to preserve the case of user names as they appear in - mailbox arguments. Host names are not case sensitive. - - Commands and replies are composed of characters from the ASCII - character set [1]. When the transport service provides an 8-bit byte - (octet) transmission channel, each 7-bit character is transmitted - right justified in an octet with the high order bit cleared to zero. - - When specifying the general form of a command or reply, an argument - (or special symbol) will be denoted by a meta-linguistic variable (or - constant), for example, "" or "". Here the - angle brackets indicate these are meta-linguistic variables. - However, some arguments use the angle brackets literally. For - example, an actual reverse-path is enclosed in angle brackets, i.e., - "" is an instance of (the - angle brackets are actually transmitted in the command or reply). - - - - - -Postel [Page 3] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - -3. THE SMTP PROCEDURES - - This section presents the procedures used in SMTP in several parts. - First comes the basic mail procedure defined as a mail transaction. - Following this are descriptions of forwarding mail, verifying mailbox - names and expanding mailing lists, sending to terminals instead of or - in combination with mailboxes, and the opening and closing exchanges. - At the end of this section are comments on relaying, a note on mail - domains, and a discussion of changing roles. Throughout this section - are examples of partial command and reply sequences, several complete - scenarios are presented in Appendix F. - - 3.1. MAIL - - There are three steps to SMTP mail transactions. The transaction - is started with a MAIL command which gives the sender - identification. A series of one or more RCPT commands follows - giving the receiver information. Then a DATA command gives the - mail data. And finally, the end of mail data indicator confirms - the transaction. - - The first step in the procedure is the MAIL command. The - contains the source mailbox. - - MAIL FROM: - - This command tells the SMTP-receiver that a new mail - transaction is starting and to reset all its state tables and - buffers, including any recipients or mail data. It gives the - reverse-path which can be used to report errors. If accepted, - the receiver-SMTP returns a 250 OK reply. - - The can contain more than just a mailbox. The - is a reverse source routing list of hosts and - source mailbox. The first host in the should be - the host sending this command. - - The second step in the procedure is the RCPT command. - - RCPT TO: - - This command gives a forward-path identifying one recipient. - If accepted, the receiver-SMTP returns a 250 OK reply, and - stores the forward-path. If the recipient is unknown the - receiver-SMTP returns a 550 Failure reply. This second step of - the procedure can be repeated any number of times. - - - -[Page 4] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - The can contain more than just a mailbox. The - is a source routing list of hosts and the - destination mailbox. The first host in the - should be the host receiving this command. - - The third step in the procedure is the DATA command. - - DATA - - If accepted, the receiver-SMTP returns a 354 Intermediate reply - and considers all succeeding lines to be the message text. - When the end of text is received and stored the SMTP-receiver - sends a 250 OK reply. - - Since the mail data is sent on the transmission channel the end - of the mail data must be indicated so that the command and - reply dialog can be resumed. SMTP indicates the end of the - mail data by sending a line containing only a period. A - transparency procedure is used to prevent this from interfering - with the user's text (see Section 4.5.2). - - Please note that the mail data includes the memo header - items such as Date, Subject, To, Cc, From [2]. - - The end of mail data indicator also confirms the mail - transaction and tells the receiver-SMTP to now process the - stored recipients and mail data. If accepted, the - receiver-SMTP returns a 250 OK reply. The DATA command should - fail only if the mail transaction was incomplete (for example, - no recipients), or if resources are not available. - - The above procedure is an example of a mail transaction. These - commands must be used only in the order discussed above. - Example 1 (below) illustrates the use of these commands in a mail - transaction. - - - - - - - - - - - - - - -Postel [Page 5] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - ------------------------------------------------------------- - - Example of the SMTP Procedure - - This SMTP example shows mail sent by Smith at host Alpha.ARPA, - to Jones, Green, and Brown at host Beta.ARPA. Here we assume - that host Alpha contacts host Beta directly. - - S: MAIL FROM: - R: 250 OK - - S: RCPT TO: - R: 250 OK - - S: RCPT TO: - R: 550 No such user here - - S: RCPT TO: - R: 250 OK - - S: DATA - R: 354 Start mail input; end with . - S: Blah blah blah... - S: ...etc. etc. etc. - S: . - R: 250 OK - - The mail has now been accepted for Jones and Brown. Green did - not have a mailbox at host Beta. - - Example 1 - - ------------------------------------------------------------- - - - - - - - - - - - - - - - - -[Page 6] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - 3.2. FORWARDING - - There are some cases where the destination information in the - is incorrect, but the receiver-SMTP knows the - correct destination. In such cases, one of the following replies - should be used to allow the sender to contact the correct - destination. - - 251 User not local; will forward to - - This reply indicates that the receiver-SMTP knows the user's - mailbox is on another host and indicates the correct - forward-path to use in the future. Note that either the - host or user or both may be different. The receiver takes - responsibility for delivering the message. - - 551 User not local; please try - - This reply indicates that the receiver-SMTP knows the user's - mailbox is on another host and indicates the correct - forward-path to use. Note that either the host or user or - both may be different. The receiver refuses to accept mail - for this user, and the sender must either redirect the mail - according to the information provided or return an error - response to the originating user. - - Example 2 illustrates the use of these responses. - - ------------------------------------------------------------- - - Example of Forwarding - - Either - - S: RCPT TO: - R: 251 User not local; will forward to - - Or - - S: RCPT TO: - R: 551 User not local; please try - - Example 2 - - ------------------------------------------------------------- - - - - -Postel [Page 7] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - 3.3. VERIFYING AND EXPANDING - - SMTP provides as additional features, commands to verify a user - name or expand a mailing list. This is done with the VRFY and - EXPN commands, which have character string arguments. For the - VRFY command, the string is a user name, and the response may - include the full name of the user and must include the mailbox of - the user. For the EXPN command, the string identifies a mailing - list, and the multiline response may include the full name of the - users and must give the mailboxes on the mailing list. - - "User name" is a fuzzy term and used purposely. If a host - implements the VRFY or EXPN commands then at least local mailboxes - must be recognized as "user names". If a host chooses to - recognize other strings as "user names" that is allowed. - - In some hosts the distinction between a mailing list and an alias - for a single mailbox is a bit fuzzy, since a common data structure - may hold both types of entries, and it is possible to have mailing - lists of one mailbox. If a request is made to verify a mailing - list a positive response can be given if on receipt of a message - so addressed it will be delivered to everyone on the list, - otherwise an error should be reported (e.g., "550 That is a - mailing list, not a user"). If a request is made to expand a user - name a positive response can be formed by returning a list - containing one name, or an error can be reported (e.g., "550 That - is a user name, not a mailing list"). - - In the case of a multiline reply (normal for EXPN) exactly one - mailbox is to be specified on each line of the reply. In the case - of an ambiguous request, for example, "VRFY Smith", where there - are two Smith's the response must be "553 User ambiguous". - - The case of verifying a user name is straightforward as shown in - example 3. - - - - - - - - - - - - - - -[Page 8] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - ------------------------------------------------------------- - - Example of Verifying a User Name - - Either - - S: VRFY Smith - R: 250 Fred Smith - - Or - - S: VRFY Smith - R: 251 User not local; will forward to - - Or - - S: VRFY Jones - R: 550 String does not match anything. - - Or - - S: VRFY Jones - R: 551 User not local; please try - - Or - - S: VRFY Gourzenkyinplatz - R: 553 User ambiguous. - - Example 3 - - ------------------------------------------------------------- - - - - - - - - - - - - - - - - - -Postel [Page 9] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - The case of expanding a mailbox list requires a multiline reply as - shown in example 4. - - ------------------------------------------------------------- - - Example of Expanding a Mailing List - - Either - - S: EXPN Example-People - R: 250-Jon Postel - R: 250-Fred Fonebone - R: 250-Sam Q. Smith - R: 250-Quincy Smith <@USC-ISIF.ARPA:Q-Smith@ISI-VAXA.ARPA> - R: 250- - R: 250 - - Or - - S: EXPN Executive-Washroom-List - R: 550 Access Denied to You. - - Example 4 - - ------------------------------------------------------------- - - The character string arguments of the VRFY and EXPN commands - cannot be further restricted due to the variety of implementations - of the user name and mailbox list concepts. On some systems it - may be appropriate for the argument of the EXPN command to be a - file name for a file containing a mailing list, but again there is - a variety of file naming conventions in the Internet. - - The VRFY and EXPN commands are not included in the minimum - implementation (Section 4.5.1), and are not required to work - across relays when they are implemented. - - - - - - - - - - - - - -[Page 10] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - 3.4. SENDING AND MAILING - - The main purpose of SMTP is to deliver messages to user's - mailboxes. A very similar service provided by some hosts is to - deliver messages to user's terminals (provided the user is active - on the host). The delivery to the user's mailbox is called - "mailing", the delivery to the user's terminal is called - "sending". Because in many hosts the implementation of sending is - nearly identical to the implementation of mailing these two - functions are combined in SMTP. However the sending commands are - not included in the required minimum implementation - (Section 4.5.1). Users should have the ability to control the - writing of messages on their terminals. Most hosts permit the - users to accept or refuse such messages. - - The following three command are defined to support the sending - options. These are used in the mail transaction instead of the - MAIL command and inform the receiver-SMTP of the special semantics - of this transaction: - - SEND FROM: - - The SEND command requires that the mail data be delivered to - the user's terminal. If the user is not active (or not - accepting terminal messages) on the host a 450 reply may - returned to a RCPT command. The mail transaction is - successful if the message is delivered the terminal. - - SOML FROM: - - The Send Or MaiL command requires that the mail data be - delivered to the user's terminal if the user is active (and - accepting terminal messages) on the host. If the user is - not active (or not accepting terminal messages) then the - mail data is entered into the user's mailbox. The mail - transaction is successful if the message is delivered either - to the terminal or the mailbox. - - SAML FROM: - - The Send And MaiL command requires that the mail data be - delivered to the user's terminal if the user is active (and - accepting terminal messages) on the host. In any case the - mail data is entered into the user's mailbox. The mail - transaction is successful if the message is delivered the - mailbox. - - - -Postel [Page 11] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - The same reply codes that are used for the MAIL commands are used - for these commands. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[Page 12] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - 3.5. OPENING AND CLOSING - - At the time the transmission channel is opened there is an - exchange to ensure that the hosts are communicating with the hosts - they think they are. - - The following two commands are used in transmission channel - opening and closing: - - HELO - - QUIT - - In the HELO command the host sending the command identifies - itself; the command may be interpreted as saying "Hello, I am - ". - - ------------------------------------------------------------- - - Example of Connection Opening - - R: 220 BBN-UNIX.ARPA Simple Mail Transfer Service Ready - S: HELO USC-ISIF.ARPA - R: 250 BBN-UNIX.ARPA - - Example 5 - - ------------------------------------------------------------- - - ------------------------------------------------------------- - - Example of Connection Closing - - S: QUIT - R: 221 BBN-UNIX.ARPA Service closing transmission channel - - Example 6 - - ------------------------------------------------------------- - - - - - - - - - - -Postel [Page 13] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - 3.6. RELAYING - - The forward-path may be a source route of the form - "@ONE,@TWO:JOE@THREE", where ONE, TWO, and THREE are hosts. This - form is used to emphasize the distinction between an address and a - route. The mailbox is an absolute address, and the route is - information about how to get there. The two concepts should not - be confused. - - Conceptually the elements of the forward-path are moved to the - reverse-path as the message is relayed from one server-SMTP to - another. The reverse-path is a reverse source route, (i.e., a - source route from the current location of the message to the - originator of the message). When a server-SMTP deletes its - identifier from the forward-path and inserts it into the - reverse-path, it must use the name it is known by in the - environment it is sending into, not the environment the mail came - from, in case the server-SMTP is known by different names in - different environments. - - If when the message arrives at an SMTP the first element of the - forward-path is not the identifier of that SMTP the element is not - deleted from the forward-path and is used to determine the next - SMTP to send the message to. In any case, the SMTP adds its own - identifier to the reverse-path. - - Using source routing the receiver-SMTP receives mail to be relayed - to another server-SMTP The receiver-SMTP may accept or reject the - task of relaying the mail in the same way it accepts or rejects - mail for a local user. The receiver-SMTP transforms the command - arguments by moving its own identifier from the forward-path to - the beginning of the reverse-path. The receiver-SMTP then becomes - a sender-SMTP, establishes a transmission channel to the next SMTP - in the forward-path, and sends it the mail. - - The first host in the reverse-path should be the host sending the - SMTP commands, and the first host in the forward-path should be - the host receiving the SMTP commands. - - Notice that the forward-path and reverse-path appear in the SMTP - commands and replies, but not necessarily in the message. That - is, there is no need for these paths and especially this syntax to - appear in the "To:" , "From:", "CC:", etc. fields of the message - header. - - If a server-SMTP has accepted the task of relaying the mail and - - - -[Page 14] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - later finds that the forward-path is incorrect or that the mail - cannot be delivered for whatever reason, then it must construct an - "undeliverable mail" notification message and send it to the - originator of the undeliverable mail (as indicated by the - reverse-path). - - This notification message must be from the server-SMTP at this - host. Of course, server-SMTPs should not send notification - messages about problems with notification messages. One way to - prevent loops in error reporting is to specify a null reverse-path - in the MAIL command of a notification message. When such a - message is relayed it is permissible to leave the reverse-path - null. A MAIL command with a null reverse-path appears as follows: - - MAIL FROM:<> - - An undeliverable mail notification message is shown in example 7. - This notification is in response to a message originated by JOE at - HOSTW and sent via HOSTX to HOSTY with instructions to relay it on - to HOSTZ. What we see in the example is the transaction between - HOSTY and HOSTX, which is the first step in the return of the - notification message. - - - - - - - - - - - - - - - - - - - - - - - - - - - -Postel [Page 15] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - ------------------------------------------------------------- - - Example Undeliverable Mail Notification Message - - S: MAIL FROM:<> - R: 250 ok - S: RCPT TO:<@HOSTX.ARPA:JOE@HOSTW.ARPA> - R: 250 ok - S: DATA - R: 354 send the mail data, end with . - S: Date: 23 Oct 81 11:22:33 - S: From: SMTP@HOSTY.ARPA - S: To: JOE@HOSTW.ARPA - S: Subject: Mail System Problem - S: - S: Sorry JOE, your message to SAM@HOSTZ.ARPA lost. - S: HOSTZ.ARPA said this: - S: "550 No Such User" - S: . - R: 250 ok - - Example 7 - - ------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - -[Page 16] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - 3.7. DOMAINS - - Domains are a recently introduced concept in the ARPA Internet - mail system. The use of domains changes the address space from a - flat global space of simple character string host names to a - hierarchically structured rooted tree of global addresses. The - host name is replaced by a domain and host designator which is a - sequence of domain element strings separated by periods with the - understanding that the domain elements are ordered from the most - specific to the most general. - - For example, "USC-ISIF.ARPA", "Fred.Cambridge.UK", and - "PC7.LCS.MIT.ARPA" might be host-and-domain identifiers. - - Whenever domain names are used in SMTP only the official names are - used, the use of nicknames or aliases is not allowed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Postel [Page 17] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - 3.8. CHANGING ROLES - - The TURN command may be used to reverse the roles of the two - programs communicating over the transmission channel. - - If program-A is currently the sender-SMTP and it sends the TURN - command and receives an ok reply (250) then program-A becomes the - receiver-SMTP. - - If program-B is currently the receiver-SMTP and it receives the - TURN command and sends an ok reply (250) then program-B becomes - the sender-SMTP. - - To refuse to change roles the receiver sends the 502 reply. - - Please note that this command is optional. It would not normally - be used in situations where the transmission channel is TCP. - However, when the cost of establishing the transmission channel is - high, this command may be quite useful. For example, this command - may be useful in supporting be mail exchange using the public - switched telephone system as a transmission channel, especially if - some hosts poll other hosts for mail exchanges. - - - - - - - - - - - - - - - - - - - - - - - - - - - -[Page 18] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - -4. THE SMTP SPECIFICATIONS - - 4.1. SMTP COMMANDS - - 4.1.1. COMMAND SEMANTICS - - The SMTP commands define the mail transfer or the mail system - function requested by the user. SMTP commands are character - strings terminated by . The command codes themselves are - alphabetic characters terminated by if parameters follow - and otherwise. The syntax of mailboxes must conform to - receiver site conventions. The SMTP commands are discussed - below. The SMTP replies are discussed in the Section 4.2. - - A mail transaction involves several data objects which are - communicated as arguments to different commands. The - reverse-path is the argument of the MAIL command, the - forward-path is the argument of the RCPT command, and the mail - data is the argument of the DATA command. These arguments or - data objects must be transmitted and held pending the - confirmation communicated by the end of mail data indication - which finalizes the transaction. The model for this is that - distinct buffers are provided to hold the types of data - objects, that is, there is a reverse-path buffer, a - forward-path buffer, and a mail data buffer. Specific commands - cause information to be appended to a specific buffer, or cause - one or more buffers to be cleared. - - HELLO (HELO) - - This command is used to identify the sender-SMTP to the - receiver-SMTP. The argument field contains the host name of - the sender-SMTP. - - The receiver-SMTP identifies itself to the sender-SMTP in - the connection greeting reply, and in the response to this - command. - - This command and an OK reply to it confirm that both the - sender-SMTP and the receiver-SMTP are in the initial state, - that is, there is no transaction in progress and all state - tables and buffers are cleared. - - - - - - - -Postel [Page 19] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - MAIL (MAIL) - - This command is used to initiate a mail transaction in which - the mail data is delivered to one or more mailboxes. The - argument field contains a reverse-path. - - The reverse-path consists of an optional list of hosts and - the sender mailbox. When the list of hosts is present, it - is a "reverse" source route and indicates that the mail was - relayed through each host on the list (the first host in the - list was the most recent relay). This list is used as a - source route to return non-delivery notices to the sender. - As each relay host adds itself to the beginning of the list, - it must use its name as known in the IPCE to which it is - relaying the mail rather than the IPCE from which the mail - came (if they are different). In some types of error - reporting messages (for example, undeliverable mail - notifications) the reverse-path may be null (see Example 7). - - This command clears the reverse-path buffer, the - forward-path buffer, and the mail data buffer; and inserts - the reverse-path information from this command into the - reverse-path buffer. - - RECIPIENT (RCPT) - - This command is used to identify an individual recipient of - the mail data; multiple recipients are specified by multiple - use of this command. - - The forward-path consists of an optional list of hosts and a - required destination mailbox. When the list of hosts is - present, it is a source route and indicates that the mail - must be relayed to the next host on the list. If the - receiver-SMTP does not implement the relay function it may - user the same reply it would for an unknown local user - (550). - - When mail is relayed, the relay host must remove itself from - the beginning forward-path and put itself at the beginning - of the reverse-path. When mail reaches its ultimate - destination (the forward-path contains only a destination - mailbox), the receiver-SMTP inserts it into the destination - mailbox in accordance with its host mail conventions. - - - - - -[Page 20] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - For example, mail received at relay host A with arguments - - FROM: - TO:<@HOSTA.ARPA,@HOSTB.ARPA:USERC@HOSTD.ARPA> - - will be relayed on to host B with arguments - - FROM:<@HOSTA.ARPA:USERX@HOSTY.ARPA> - TO:<@HOSTB.ARPA:USERC@HOSTD.ARPA>. - - This command causes its forward-path argument to be appended - to the forward-path buffer. - - DATA (DATA) - - The receiver treats the lines following the command as mail - data from the sender. This command causes the mail data - from this command to be appended to the mail data buffer. - The mail data may contain any of the 128 ASCII character - codes. - - The mail data is terminated by a line containing only a - period, that is the character sequence "." (see - Section 4.5.2 on Transparency). This is the end of mail - data indication. - - The end of mail data indication requires that the receiver - must now process the stored mail transaction information. - This processing consumes the information in the reverse-path - buffer, the forward-path buffer, and the mail data buffer, - and on the completion of this command these buffers are - cleared. If the processing is successful the receiver must - send an OK reply. If the processing fails completely the - receiver must send a failure reply. - - When the receiver-SMTP accepts a message either for relaying - or for final delivery it inserts at the beginning of the - mail data a time stamp line. The time stamp line indicates - the identity of the host that sent the message, and the - identity of the host that received the message (and is - inserting this time stamp), and the date and time the - message was received. Relayed messages will have multiple - time stamp lines. - - When the receiver-SMTP makes the "final delivery" of a - message it inserts at the beginning of the mail data a - - - -Postel [Page 21] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - return path line. The return path line preserves the - information in the from the MAIL command. - Here, final delivery means the message leaves the SMTP - world. Normally, this would mean it has been delivered to - the destination user, but in some cases it may be further - processed and transmitted by another mail system. - - It is possible for the mailbox in the return path be - different from the actual sender's mailbox, for example, - if error responses are to be delivered a special error - handling mailbox rather than the message senders. - - The preceding two paragraphs imply that the final mail data - will begin with a return path line, followed by one or more - time stamp lines. These lines will be followed by the mail - data header and body [2]. See Example 8. - - Special mention is needed of the response and further action - required when the processing following the end of mail data - indication is partially successful. This could arise if - after accepting several recipients and the mail data, the - receiver-SMTP finds that the mail data can be successfully - delivered to some of the recipients, but it cannot be to - others (for example, due to mailbox space allocation - problems). In such a situation, the response to the DATA - command must be an OK reply. But, the receiver-SMTP must - compose and send an "undeliverable mail" notification - message to the originator of the message. Either a single - notification which lists all of the recipients that failed - to get the message, or separate notification messages must - be sent for each failed recipient (see Example 7). All - undeliverable mail notification messages are sent using the - MAIL command (even if they result from processing a SEND, - SOML, or SAML command). - - - - - - - - - - - - - - - -[Page 22] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - ------------------------------------------------------------- - - Example of Return Path and Received Time Stamps - - Return-Path: <@GHI.ARPA,@DEF.ARPA,@ABC.ARPA:JOE@ABC.ARPA> - Received: from GHI.ARPA by JKL.ARPA ; 27 Oct 81 15:27:39 PST - Received: from DEF.ARPA by GHI.ARPA ; 27 Oct 81 15:15:13 PST - Received: from ABC.ARPA by DEF.ARPA ; 27 Oct 81 15:01:59 PST - Date: 27 Oct 81 15:01:01 PST - From: JOE@ABC.ARPA - Subject: Improved Mailing System Installed - To: SAM@JKL.ARPA - - This is to inform you that ... - - Example 8 - - ------------------------------------------------------------- - - SEND (SEND) - - This command is used to initiate a mail transaction in which - the mail data is delivered to one or more terminals. The - argument field contains a reverse-path. This command is - successful if the message is delivered to a terminal. - - The reverse-path consists of an optional list of hosts and - the sender mailbox. When the list of hosts is present, it - is a "reverse" source route and indicates that the mail was - relayed through each host on the list (the first host in the - list was the most recent relay). This list is used as a - source route to return non-delivery notices to the sender. - As each relay host adds itself to the beginning of the list, - it must use its name as known in the IPCE to which it is - relaying the mail rather than the IPCE from which the mail - came (if they are different). - - This command clears the reverse-path buffer, the - forward-path buffer, and the mail data buffer; and inserts - the reverse-path information from this command into the - reverse-path buffer. - - SEND OR MAIL (SOML) - - This command is used to initiate a mail transaction in which - the mail data is delivered to one or more terminals or - - - -Postel [Page 23] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - mailboxes. For each recipient the mail data is delivered to - the recipient's terminal if the recipient is active on the - host (and accepting terminal messages), otherwise to the - recipient's mailbox. The argument field contains a - reverse-path. This command is successful if the message is - delivered to a terminal or the mailbox. - - The reverse-path consists of an optional list of hosts and - the sender mailbox. When the list of hosts is present, it - is a "reverse" source route and indicates that the mail was - relayed through each host on the list (the first host in the - list was the most recent relay). This list is used as a - source route to return non-delivery notices to the sender. - As each relay host adds itself to the beginning of the list, - it must use its name as known in the IPCE to which it is - relaying the mail rather than the IPCE from which the mail - came (if they are different). - - This command clears the reverse-path buffer, the - forward-path buffer, and the mail data buffer; and inserts - the reverse-path information from this command into the - reverse-path buffer. - - SEND AND MAIL (SAML) - - This command is used to initiate a mail transaction in which - the mail data is delivered to one or more terminals and - mailboxes. For each recipient the mail data is delivered to - the recipient's terminal if the recipient is active on the - host (and accepting terminal messages), and for all - recipients to the recipient's mailbox. The argument field - contains a reverse-path. This command is successful if the - message is delivered to the mailbox. - - The reverse-path consists of an optional list of hosts and - the sender mailbox. When the list of hosts is present, it - is a "reverse" source route and indicates that the mail was - relayed through each host on the list (the first host in the - list was the most recent relay). This list is used as a - source route to return non-delivery notices to the sender. - As each relay host adds itself to the beginning of the list, - it must use its name as known in the IPCE to which it is - relaying the mail rather than the IPCE from which the mail - came (if they are different). - - This command clears the reverse-path buffer, the - - - -[Page 24] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - forward-path buffer, and the mail data buffer; and inserts - the reverse-path information from this command into the - reverse-path buffer. - - RESET (RSET) - - This command specifies that the current mail transaction is - to be aborted. Any stored sender, recipients, and mail data - must be discarded, and all buffers and state tables cleared. - The receiver must send an OK reply. - - VERIFY (VRFY) - - This command asks the receiver to confirm that the argument - identifies a user. If it is a user name, the full name of - the user (if known) and the fully specified mailbox are - returned. - - This command has no effect on any of the reverse-path - buffer, the forward-path buffer, or the mail data buffer. - - EXPAND (EXPN) - - This command asks the receiver to confirm that the argument - identifies a mailing list, and if so, to return the - membership of that list. The full name of the users (if - known) and the fully specified mailboxes are returned in a - multiline reply. - - This command has no effect on any of the reverse-path - buffer, the forward-path buffer, or the mail data buffer. - - HELP (HELP) - - This command causes the receiver to send helpful information - to the sender of the HELP command. The command may take an - argument (e.g., any command name) and return more specific - information as a response. - - This command has no effect on any of the reverse-path - buffer, the forward-path buffer, or the mail data buffer. - - - - - - - - -Postel [Page 25] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - NOOP (NOOP) - - This command does not affect any parameters or previously - entered commands. It specifies no action other than that - the receiver send an OK reply. - - This command has no effect on any of the reverse-path - buffer, the forward-path buffer, or the mail data buffer. - - QUIT (QUIT) - - This command specifies that the receiver must send an OK - reply, and then close the transmission channel. - - The receiver should not close the transmission channel until - it receives and replies to a QUIT command (even if there was - an error). The sender should not close the transmission - channel until it send a QUIT command and receives the reply - (even if there was an error response to a previous command). - If the connection is closed prematurely the receiver should - act as if a RSET command had been received (canceling any - pending transaction, but not undoing any previously - completed transaction), the sender should act as if the - command or transaction in progress had received a temporary - error (4xx). - - TURN (TURN) - - This command specifies that the receiver must either (1) - send an OK reply and then take on the role of the - sender-SMTP, or (2) send a refusal reply and retain the role - of the receiver-SMTP. - - If program-A is currently the sender-SMTP and it sends the - TURN command and receives an OK reply (250) then program-A - becomes the receiver-SMTP. Program-A is then in the initial - state as if the transmission channel just opened, and it - then sends the 220 service ready greeting. - - If program-B is currently the receiver-SMTP and it receives - the TURN command and sends an OK reply (250) then program-B - becomes the sender-SMTP. Program-B is then in the initial - state as if the transmission channel just opened, and it - then expects to receive the 220 service ready greeting. - - To refuse to change roles the receiver sends the 502 reply. - - - -[Page 26] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - There are restrictions on the order in which these command may - be used. - - The first command in a session must be the HELO command. - The HELO command may be used later in a session as well. If - the HELO command argument is not acceptable a 501 failure - reply must be returned and the receiver-SMTP must stay in - the same state. - - The NOOP, HELP, EXPN, and VRFY commands can be used at any - time during a session. - - The MAIL, SEND, SOML, or SAML commands begin a mail - transaction. Once started a mail transaction consists of - one of the transaction beginning commands, one or more RCPT - commands, and a DATA command, in that order. A mail - transaction may be aborted by the RSET command. There may - be zero or more transactions in a session. - - If the transaction beginning command argument is not - acceptable a 501 failure reply must be returned and the - receiver-SMTP must stay in the same state. If the commands - in a transaction are out of order a 503 failure reply must - be returned and the receiver-SMTP must stay in the same - state. - - The last command in a session must be the QUIT command. The - QUIT command can not be used at any other time in a session. - - 4.1.2. COMMAND SYNTAX - - The commands consist of a command code followed by an argument - field. Command codes are four alphabetic characters. Upper - and lower case alphabetic characters are to be treated - identically. Thus, any of the following may represent the mail - command: - - MAIL Mail mail MaIl mAIl - - This also applies to any symbols representing parameter values, - such as "TO" or "to" for the forward-path. Command codes and - the argument fields are separated by one or more spaces. - However, within the reverse-path and forward-path arguments - case is important. In particular, in some hosts the user - "smith" is different from the user "Smith". - - - - -Postel [Page 27] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - The argument field consists of a variable length character - string ending with the character sequence . The receiver - is to take no action until this sequence is received. - - Square brackets denote an optional argument field. If the - option is not taken, the appropriate default is implied. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[Page 28] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - The following are the SMTP commands: - - HELO - - MAIL FROM: - - RCPT TO: - - DATA - - RSET - - SEND FROM: - - SOML FROM: - - SAML FROM: - - VRFY - - EXPN - - HELP [ ] - - NOOP - - QUIT - - TURN - - - - - - - - - - - - - - - - - - - - -Postel [Page 29] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - The syntax of the above argument fields (using BNF notation - where applicable) is given below. The "..." notation indicates - that a field may be repeated one or more times. - - ::= - - ::= - - ::= "<" [ ":" ] ">" - - ::= | "," - - ::= "@" - - ::= | "." - - ::= | "#" | "[" "]" - - ::= "@" - - ::= | - - ::= - - ::= | - - ::= | - - ::= | | "-" - - ::= | "." - - ::= | - - ::= """ """ - - ::= "\" | "\" | | - - ::= | "\" - - ::= "." "." "." - - ::= | - - ::= - - - - -[Page 30] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - ::= the carriage return character (ASCII code 13) - - ::= the line feed character (ASCII code 10) - - ::= the space character (ASCII code 32) - - ::= one, two, or three digits representing a decimal - integer value in the range 0 through 255 - - ::= any one of the 52 alphabetic characters A through Z - in upper case and a through z in lower case - - ::= any one of the 128 ASCII characters, but not any - or - - ::= any one of the ten digits 0 through 9 - - ::= any one of the 128 ASCII characters except , - , quote ("), or backslash (\) - - ::= any one of the 128 ASCII characters (no exceptions) - - ::= "<" | ">" | "(" | ")" | "[" | "]" | "\" | "." - | "," | ";" | ":" | "@" """ | the control - characters (ASCII codes 0 through 31 inclusive and - 127) - - Note that the backslash, "\", is a quote character, which is - used to indicate that the next character is to be used - literally (instead of its normal interpretation). For example, - "Joe\,Smith" could be used to indicate a single nine character - user field with comma being the fourth character of the field. - - Hosts are generally known by names which are translated to - addresses in each host. Note that the name elements of domains - are the official names -- no use of nicknames or aliases is - allowed. - - Sometimes a host is not known to the translation function and - communication is blocked. To bypass this barrier two numeric - forms are also allowed for host "names". One form is a decimal - integer prefixed by a pound sign, "#", which indicates the - number is the address of the host. Another form is four small - decimal integers separated by dots and enclosed by brackets, - e.g., "[123.255.37.2]", which indicates a 32-bit ARPA Internet - Address in four 8-bit fields. - - - -Postel [Page 31] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - The time stamp line and the return path line are formally - defined as follows: - - ::= "Return-Path:" - - ::= "Received:" - - ::= ";" - - - ::= "FROM" - - ::= "BY" - - ::= [] [] [] [] - - ::= "VIA" - - ::= "WITH" - - ::= "ID" - - ::= "FOR" - - ::= The standard names for links are registered with - the Network Information Center. - - ::= The standard names for protocols are - registered with the Network Information Center. - - ::=
::= the one or two decimal integer day of the month in - the range 1 to 31. - - ::= "JAN" | "FEB" | "MAR" | "APR" | "MAY" | "JUN" | - "JUL" | "AUG" | "SEP" | "OCT" | "NOV" | "DEC" - - ::= the two decimal integer year of the century in the - range 00 to 99. - - - - - -[Page 32] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - ::= the two decimal integer hour of the day in the - range 00 to 24. - - ::= the two decimal integer minute of the hour in the - range 00 to 59. - - ::= the two decimal integer second of the minute in the - range 00 to 59. - - ::= "UT" for Universal Time (the default) or other - time zone designator (as in [2]). - - - - ------------------------------------------------------------- - - Return Path Example - - Return-Path: <@CHARLIE.ARPA,@BAKER.ARPA:JOE@ABLE.ARPA> - - Example 9 - - ------------------------------------------------------------- - - ------------------------------------------------------------- - - Time Stamp Line Example - - Received: FROM ABC.ARPA BY XYZ.ARPA ; 22 OCT 81 09:23:59 PDT - - Received: from ABC.ARPA by XYZ.ARPA via TELENET with X25 - id M12345 for Smith@PDQ.ARPA ; 22 OCT 81 09:23:59 PDT - - Example 10 - - ------------------------------------------------------------- - - - - - - - - - - - - - -Postel [Page 33] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - 4.2. SMTP REPLIES - - Replies to SMTP commands are devised to ensure the synchronization - of requests and actions in the process of mail transfer, and to - guarantee that the sender-SMTP always knows the state of the - receiver-SMTP. Every command must generate exactly one reply. - - The details of the command-reply sequence are made explicit in - Section 5.3 on Sequencing and Section 5.4 State Diagrams. - - An SMTP reply consists of a three digit number (transmitted as - three alphanumeric characters) followed by some text. The number - is intended for use by automata to determine what state to enter - next; the text is meant for the human user. It is intended that - the three digits contain enough encoded information that the - sender-SMTP need not examine the text and may either discard it or - pass it on to the user, as appropriate. In particular, the text - may be receiver-dependent and context dependent, so there are - likely to be varying texts for each reply code. A discussion of - the theory of reply codes is given in Appendix E. Formally, a - reply is defined to be the sequence: a three-digit code, , - one line of text, and , or a multiline reply (as defined in - Appendix E). Only the EXPN and HELP commands are expected to - result in multiline replies in normal circumstances, however - multiline replies are allowed for any command. - - - - - - - - - - - - - - - - - - - - - - - - -[Page 34] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - 4.2.1. REPLY CODES BY FUNCTION GROUPS - - 500 Syntax error, command unrecognized - [This may include errors such as command line too long] - 501 Syntax error in parameters or arguments - 502 Command not implemented - 503 Bad sequence of commands - 504 Command parameter not implemented - - 211 System status, or system help reply - 214 Help message - [Information on how to use the receiver or the meaning of a - particular non-standard command; this reply is useful only - to the human user] - - 220 Service ready - 221 Service closing transmission channel - 421 Service not available, - closing transmission channel - [This may be a reply to any command if the service knows it - must shut down] - - 250 Requested mail action okay, completed - 251 User not local; will forward to - 450 Requested mail action not taken: mailbox unavailable - [E.g., mailbox busy] - 550 Requested action not taken: mailbox unavailable - [E.g., mailbox not found, no access] - 451 Requested action aborted: error in processing - 551 User not local; please try - 452 Requested action not taken: insufficient system storage - 552 Requested mail action aborted: exceeded storage allocation - 553 Requested action not taken: mailbox name not allowed - [E.g., mailbox syntax incorrect] - 354 Start mail input; end with . - 554 Transaction failed - - - - - - - - - - - - - -Postel [Page 35] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - 4.2.2. NUMERIC ORDER LIST OF REPLY CODES - - 211 System status, or system help reply - 214 Help message - [Information on how to use the receiver or the meaning of a - particular non-standard command; this reply is useful only - to the human user] - 220 Service ready - 221 Service closing transmission channel - 250 Requested mail action okay, completed - 251 User not local; will forward to - - 354 Start mail input; end with . - - 421 Service not available, - closing transmission channel - [This may be a reply to any command if the service knows it - must shut down] - 450 Requested mail action not taken: mailbox unavailable - [E.g., mailbox busy] - 451 Requested action aborted: local error in processing - 452 Requested action not taken: insufficient system storage - - 500 Syntax error, command unrecognized - [This may include errors such as command line too long] - 501 Syntax error in parameters or arguments - 502 Command not implemented - 503 Bad sequence of commands - 504 Command parameter not implemented - 550 Requested action not taken: mailbox unavailable - [E.g., mailbox not found, no access] - 551 User not local; please try - 552 Requested mail action aborted: exceeded storage allocation - 553 Requested action not taken: mailbox name not allowed - [E.g., mailbox syntax incorrect] - 554 Transaction failed - - - - - - - - - - - - - -[Page 36] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - 4.3. SEQUENCING OF COMMANDS AND REPLIES - - The communication between the sender and receiver is intended to - be an alternating dialogue, controlled by the sender. As such, - the sender issues a command and the receiver responds with a - reply. The sender must wait for this response before sending - further commands. - - One important reply is the connection greeting. Normally, a - receiver will send a 220 "Service ready" reply when the connection - is completed. The sender should wait for this greeting message - before sending any commands. - - Note: all the greeting type replies have the official name of - the server host as the first word following the reply code. - - For example, - - 220 USC-ISIF.ARPA Service ready - - The table below lists alternative success and failure replies for - each command. These must be strictly adhered to; a receiver may - substitute text in the replies, but the meaning and action implied - by the code numbers and by the specific command reply sequence - cannot be altered. - - COMMAND-REPLY SEQUENCES - - Each command is listed with its possible replies. The prefixes - used before the possible replies are "P" for preliminary (not - used in SMTP), "I" for intermediate, "S" for success, "F" for - failure, and "E" for error. The 421 reply (service not - available, closing transmission channel) may be given to any - command if the SMTP-receiver knows it must shut down. This - listing forms the basis for the State Diagrams in Section 4.4. - - CONNECTION ESTABLISHMENT - S: 220 - F: 421 - HELO - S: 250 - E: 500, 501, 504, 421 - MAIL - S: 250 - F: 552, 451, 452 - E: 500, 501, 421 - - - -Postel [Page 37] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - RCPT - S: 250, 251 - F: 550, 551, 552, 553, 450, 451, 452 - E: 500, 501, 503, 421 - DATA - I: 354 -> data -> S: 250 - F: 552, 554, 451, 452 - F: 451, 554 - E: 500, 501, 503, 421 - RSET - S: 250 - E: 500, 501, 504, 421 - SEND - S: 250 - F: 552, 451, 452 - E: 500, 501, 502, 421 - SOML - S: 250 - F: 552, 451, 452 - E: 500, 501, 502, 421 - SAML - S: 250 - F: 552, 451, 452 - E: 500, 501, 502, 421 - VRFY - S: 250, 251 - F: 550, 551, 553 - E: 500, 501, 502, 504, 421 - EXPN - S: 250 - F: 550 - E: 500, 501, 502, 504, 421 - HELP - S: 211, 214 - E: 500, 501, 502, 504, 421 - NOOP - S: 250 - E: 500, 421 - QUIT - S: 221 - E: 500 - TURN - S: 250 - F: 502 - E: 500, 503 - - - - -[Page 38] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - 4.4. STATE DIAGRAMS - - Following are state diagrams for a simple-minded SMTP - implementation. Only the first digit of the reply codes is used. - There is one state diagram for each group of SMTP commands. The - command groupings were determined by constructing a model for each - command and then collecting together the commands with - structurally identical models. - - For each command there are three possible outcomes: "success" - (S), "failure" (F), and "error" (E). In the state diagrams below - we use the symbol B for "begin", and the symbol W for "wait for - reply". - - First, the diagram that represents most of the SMTP commands: - - - 1,3 +---+ - ----------->| E | - | +---+ - | - +---+ cmd +---+ 2 +---+ - | B |---------->| W |---------->| S | - +---+ +---+ +---+ - | - | 4,5 +---+ - ----------->| F | - +---+ - - - This diagram models the commands: - - HELO, MAIL, RCPT, RSET, SEND, SOML, SAML, VRFY, EXPN, HELP, - NOOP, QUIT, TURN. - - - - - - - - - - - - - - - -Postel [Page 39] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - A more complex diagram models the DATA command: - - - +---+ DATA +---+ 1,2 +---+ - | B |---------->| W |-------------------->| E | - +---+ +---+ ------------>+---+ - 3| |4,5 | - | | | - -------------- ----- | - | | | +---+ - | ---------- -------->| S | - | | | | +---+ - | | ------------ - | | | | - V 1,3| |2 | - +---+ data +---+ --------------->+---+ - | |---------->| W | | F | - +---+ +---+-------------------->+---+ - 4,5 - - - Note that the "data" here is a series of lines sent from the - sender to the receiver with no response expected until the last - line is sent. - - - - - - - - - - - - - - - - - - - - - - - - - -[Page 40] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - 4.5. DETAILS - - 4.5.1. MINIMUM IMPLEMENTATION - - In order to make SMTP workable, the following minimum - implementation is required for all receivers: - - COMMANDS -- HELO - MAIL - RCPT - DATA - RSET - NOOP - QUIT - - 4.5.2. TRANSPARENCY - - Without some provision for data transparency the character - sequence "." ends the mail text and cannot be sent - by the user. In general, users are not aware of such - "forbidden" sequences. To allow all user composed text to be - transmitted transparently the following procedures are used. - - 1. Before sending a line of mail text the sender-SMTP checks - the first character of the line. If it is a period, one - additional period is inserted at the beginning of the line. - - 2. When a line of mail text is received by the receiver-SMTP - it checks the line. If the line is composed of a single - period it is the end of mail. If the first character is a - period and there are other characters on the line, the first - character is deleted. - - The mail data may contain any of the 128 ASCII characters. All - characters are to be delivered to the recipient's mailbox - including format effectors and other control characters. If - the transmission channel provides an 8-bit byte (octets) data - stream, the 7-bit ASCII codes are transmitted right justified - in the octets with the high order bits cleared to zero. - - In some systems it may be necessary to transform the data as - it is received and stored. This may be necessary for hosts - that use a different character set than ASCII as their local - character set, or that store data in records rather than - - - - - -Postel [Page 41] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - strings. If such transforms are necessary, they must be - reversible -- especially if such transforms are applied to - mail being relayed. - - 4.5.3. SIZES - - There are several objects that have required minimum maximum - sizes. That is, every implementation must be able to receive - objects of at least these sizes, but must not send objects - larger than these sizes. - - - **************************************************** - * * - * TO THE MAXIMUM EXTENT POSSIBLE, IMPLEMENTATION * - * TECHNIQUES WHICH IMPOSE NO LIMITS ON THE LENGTH * - * OF THESE OBJECTS SHOULD BE USED. * - * * - **************************************************** - - user - - The maximum total length of a user name is 64 characters. - - domain - - The maximum total length of a domain name or number is 64 - characters. - - path - - The maximum total length of a reverse-path or - forward-path is 256 characters (including the punctuation - and element separators). - - command line - - The maximum total length of a command line including the - command word and the is 512 characters. - - reply line - - The maximum total length of a reply line including the - reply code and the is 512 characters. - - - - - -[Page 42] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - text line - - The maximum total length of a text line including the - is 1000 characters (but not counting the leading - dot duplicated for transparency). - - recipients buffer - - The maximum total number of recipients that must be - buffered is 100 recipients. - - - **************************************************** - * * - * TO THE MAXIMUM EXTENT POSSIBLE, IMPLEMENTATION * - * TECHNIQUES WHICH IMPOSE NO LIMITS ON THE LENGTH * - * OF THESE OBJECTS SHOULD BE USED. * - * * - **************************************************** - - Errors due to exceeding these limits may be reported by using - the reply codes, for example: - - 500 Line too long. - - 501 Path too long - - 552 Too many recipients. - - 552 Too much mail data. - - - - - - - - - - - - - - - - - - - -Postel [Page 43] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - -APPENDIX A - - TCP Transport service - - The Transmission Control Protocol [3] is used in the ARPA - Internet, and in any network following the US DoD standards for - internetwork protocols. - - Connection Establishment - - The SMTP transmission channel is a TCP connection established - between the sender process port U and the receiver process port - L. This single full duplex connection is used as the - transmission channel. This protocol is assigned the service - port 25 (31 octal), that is L=25. - - Data Transfer - - The TCP connection supports the transmission of 8-bit bytes. - The SMTP data is 7-bit ASCII characters. Each character is - transmitted as an 8-bit byte with the high-order bit cleared to - zero. - - - - - - - - - - - - - - - - - - - - - - - - - - - -[Page 44] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - -APPENDIX B - - NCP Transport service - - The ARPANET Host-to-Host Protocol [4] (implemented by the Network - Control Program) may be used in the ARPANET. - - Connection Establishment - - The SMTP transmission channel is established via NCP between - the sender process socket U and receiver process socket L. The - Initial Connection Protocol [5] is followed resulting in a pair - of simplex connections. This pair of connections is used as - the transmission channel. This protocol is assigned the - contact socket 25 (31 octal), that is L=25. - - Data Transfer - - The NCP data connections are established in 8-bit byte mode. - The SMTP data is 7-bit ASCII characters. Each character is - transmitted as an 8-bit byte with the high-order bit cleared to - zero. - - - - - - - - - - - - - - - - - - - - - - - - - - - -Postel [Page 45] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - -APPENDIX C - - NITS - - The Network Independent Transport Service [6] may be used. - - Connection Establishment - - The SMTP transmission channel is established via NITS between - the sender process and receiver process. The sender process - executes the CONNECT primitive, and the waiting receiver - process executes the ACCEPT primitive. - - Data Transfer - - The NITS connection supports the transmission of 8-bit bytes. - The SMTP data is 7-bit ASCII characters. Each character is - transmitted as an 8-bit byte with the high-order bit cleared to - zero. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[Page 46] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - -APPENDIX D - - X.25 Transport service - - It may be possible to use the X.25 service [7] as provided by the - Public Data Networks directly, however, it is suggested that a - reliable end-to-end protocol such as TCP be used on top of X.25 - connections. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Postel [Page 47] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - -APPENDIX E - - Theory of Reply Codes - - The three digits of the reply each have a special significance. - The first digit denotes whether the response is good, bad or - incomplete. An unsophisticated sender-SMTP will be able to - determine its next action (proceed as planned, redo, retrench, - etc.) by simply examining this first digit. A sender-SMTP that - wants to know approximately what kind of error occurred (e.g., - mail system error, command syntax error) may examine the second - digit, reserving the third digit for the finest gradation of - information. - - There are five values for the first digit of the reply code: - - 1yz Positive Preliminary reply - - The command has been accepted, but the requested action - is being held in abeyance, pending confirmation of the - information in this reply. The sender-SMTP should send - another command specifying whether to continue or abort - the action. - - [Note: SMTP does not have any commands that allow this - type of reply, and so does not have the continue or - abort commands.] - - 2yz Positive Completion reply - - The requested action has been successfully completed. A - new request may be initiated. - - 3yz Positive Intermediate reply - - The command has been accepted, but the requested action - is being held in abeyance, pending receipt of further - information. The sender-SMTP should send another command - specifying this information. This reply is used in - command sequence groups. - - 4yz Transient Negative Completion reply - - The command was not accepted and the requested action did - not occur. However, the error condition is temporary and - the action may be requested again. The sender should - - - -[Page 48] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - return to the beginning of the command sequence (if any). - It is difficult to assign a meaning to "transient" when - two different sites (receiver- and sender- SMTPs) must - agree on the interpretation. Each reply in this category - might have a different time value, but the sender-SMTP is - encouraged to try again. A rule of thumb to determine if - a reply fits into the 4yz or the 5yz category (see below) - is that replies are 4yz if they can be repeated without - any change in command form or in properties of the sender - or receiver. (E.g., the command is repeated identically - and the receiver does not put up a new implementation.) - - 5yz Permanent Negative Completion reply - - The command was not accepted and the requested action did - not occur. The sender-SMTP is discouraged from repeating - the exact request (in the same sequence). Even some - "permanent" error conditions can be corrected, so the - human user may want to direct the sender-SMTP to - reinitiate the command sequence by direct action at some - point in the future (e.g., after the spelling has been - changed, or the user has altered the account status). - - The second digit encodes responses in specific categories: - - x0z Syntax -- These replies refer to syntax errors, - syntactically correct commands that don't fit any - functional category, and unimplemented or superfluous - commands. - - x1z Information -- These are replies to requests for - information, such as status or help. - - x2z Connections -- These are replies referring to the - transmission channel. - - x3z Unspecified as yet. - - x4z Unspecified as yet. - - x5z Mail system -- These replies indicate the status of - the receiver mail system vis-a-vis the requested - transfer or other mail system action. - - The third digit gives a finer gradation of meaning in each - category specified by the second digit. The list of replies - - - -Postel [Page 49] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - illustrates this. Each reply text is recommended rather than - mandatory, and may even change according to the command with - which it is associated. On the other hand, the reply codes - must strictly follow the specifications in this section. - Receiver implementations should not invent new codes for - slightly different situations from the ones described here, but - rather adapt codes already defined. - - For example, a command such as NOOP whose successful execution - does not offer the sender-SMTP any new information will return - a 250 reply. The response is 502 when the command requests an - unimplemented non-site-specific action. A refinement of that - is the 504 reply for a command that is implemented, but that - requests an unimplemented parameter. - - The reply text may be longer than a single line; in these cases - the complete text must be marked so the sender-SMTP knows when it - can stop reading the reply. This requires a special format to - indicate a multiple line reply. - - The format for multiline replies requires that every line, - except the last, begin with the reply code, followed - immediately by a hyphen, "-" (also known as minus), followed by - text. The last line will begin with the reply code, followed - immediately by , optionally some text, and . - - For example: - 123-First line - 123-Second line - 123-234 text beginning with numbers - 123 The last line - - In many cases the sender-SMTP then simply needs to search for - the reply code followed by at the beginning of a line, and - ignore all preceding lines. In a few cases, there is important - data for the sender in the reply "text". The sender will know - these cases from the current context. - - - - - - - - - - - - -[Page 50] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - -APPENDIX F - - Scenarios - - This section presents complete scenarios of several types of SMTP - sessions. - - A Typical SMTP Transaction Scenario - - This SMTP example shows mail sent by Smith at host USC-ISIF, to - Jones, Green, and Brown at host BBN-UNIX. Here we assume that - host USC-ISIF contacts host BBN-UNIX directly. The mail is - accepted for Jones and Brown. Green does not have a mailbox at - host BBN-UNIX. - - ------------------------------------------------------------- - - R: 220 BBN-UNIX.ARPA Simple Mail Transfer Service Ready - S: HELO USC-ISIF.ARPA - R: 250 BBN-UNIX.ARPA - - S: MAIL FROM: - R: 250 OK - - S: RCPT TO: - R: 250 OK - - S: RCPT TO: - R: 550 No such user here - - S: RCPT TO: - R: 250 OK - - S: DATA - R: 354 Start mail input; end with . - S: Blah blah blah... - S: ...etc. etc. etc. - S: . - R: 250 OK - - S: QUIT - R: 221 BBN-UNIX.ARPA Service closing transmission channel - - Scenario 1 - - ------------------------------------------------------------- - - - -Postel [Page 51] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - Aborted SMTP Transaction Scenario - - ------------------------------------------------------------- - - R: 220 MIT-Multics.ARPA Simple Mail Transfer Service Ready - S: HELO ISI-VAXA.ARPA - R: 250 MIT-Multics.ARPA - - S: MAIL FROM: - R: 250 OK - - S: RCPT TO: - R: 250 OK - - S: RCPT TO: - R: 550 No such user here - - S: RSET - R: 250 OK - - S: QUIT - R: 221 MIT-Multics.ARPA Service closing transmission channel - - Scenario 2 - - ------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - -[Page 52] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - Relayed Mail Scenario - - ------------------------------------------------------------- - - Step 1 -- Source Host to Relay Host - - R: 220 USC-ISIE.ARPA Simple Mail Transfer Service Ready - S: HELO MIT-AI.ARPA - R: 250 USC-ISIE.ARPA - - S: MAIL FROM: - R: 250 OK - - S: RCPT TO:<@USC-ISIE.ARPA:Jones@BBN-VAX.ARPA> - R: 250 OK - - S: DATA - R: 354 Start mail input; end with . - S: Date: 2 Nov 81 22:33:44 - S: From: John Q. Public - S: Subject: The Next Meeting of the Board - S: To: Jones@BBN-Vax.ARPA - S: - S: Bill: - S: The next meeting of the board of directors will be - S: on Tuesday. - S: John. - S: . - R: 250 OK - - S: QUIT - R: 221 USC-ISIE.ARPA Service closing transmission channel - - - - - - - - - - - - - - - - - -Postel [Page 53] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - Step 2 -- Relay Host to Destination Host - - R: 220 BBN-VAX.ARPA Simple Mail Transfer Service Ready - S: HELO USC-ISIE.ARPA - R: 250 BBN-VAX.ARPA - - S: MAIL FROM:<@USC-ISIE.ARPA:JQP@MIT-AI.ARPA> - R: 250 OK - - S: RCPT TO: - R: 250 OK - - S: DATA - R: 354 Start mail input; end with . - S: Received: from MIT-AI.ARPA by USC-ISIE.ARPA ; - 2 Nov 81 22:40:10 UT - S: Date: 2 Nov 81 22:33:44 - S: From: John Q. Public - S: Subject: The Next Meeting of the Board - S: To: Jones@BBN-Vax.ARPA - S: - S: Bill: - S: The next meeting of the board of directors will be - S: on Tuesday. - S: John. - S: . - R: 250 OK - - S: QUIT - R: 221 USC-ISIE.ARPA Service closing transmission channel - - Scenario 3 - - ------------------------------------------------------------- - - - - - - - - - - - - - - - -[Page 54] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - Verifying and Sending Scenario - - ------------------------------------------------------------- - - R: 220 SU-SCORE.ARPA Simple Mail Transfer Service Ready - S: HELO MIT-MC.ARPA - R: 250 SU-SCORE.ARPA - - S: VRFY Crispin - R: 250 Mark Crispin - - S: SEND FROM: - R: 250 OK - - S: RCPT TO: - R: 250 OK - - S: DATA - R: 354 Start mail input; end with . - S: Blah blah blah... - S: ...etc. etc. etc. - S: . - R: 250 OK - - S: QUIT - R: 221 SU-SCORE.ARPA Service closing transmission channel - - Scenario 4 - - ------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - -Postel [Page 55] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - Sending and Mailing Scenarios - - First the user's name is verified, then an attempt is made to - send to the user's terminal. When that fails, the messages is - mailed to the user's mailbox. - - ------------------------------------------------------------- - - R: 220 SU-SCORE.ARPA Simple Mail Transfer Service Ready - S: HELO MIT-MC.ARPA - R: 250 SU-SCORE.ARPA - - S: VRFY Crispin - R: 250 Mark Crispin - - S: SEND FROM: - R: 250 OK - - S: RCPT TO: - R: 450 User not active now - - S: RSET - R: 250 OK - - S: MAIL FROM: - R: 250 OK - - S: RCPT TO: - R: 250 OK - - S: DATA - R: 354 Start mail input; end with . - S: Blah blah blah... - S: ...etc. etc. etc. - S: . - R: 250 OK - - S: QUIT - R: 221 SU-SCORE.ARPA Service closing transmission channel - - Scenario 5 - - ------------------------------------------------------------- - - - - - - -[Page 56] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - Doing the preceding scenario more efficiently. - - ------------------------------------------------------------- - - R: 220 SU-SCORE.ARPA Simple Mail Transfer Service Ready - S: HELO MIT-MC.ARPA - R: 250 SU-SCORE.ARPA - - S: VRFY Crispin - R: 250 Mark Crispin - - S: SOML FROM: - R: 250 OK - - S: RCPT TO: - R: 250 User not active now, so will do mail. - - S: DATA - R: 354 Start mail input; end with . - S: Blah blah blah... - S: ...etc. etc. etc. - S: . - R: 250 OK - - S: QUIT - R: 221 SU-SCORE.ARPA Service closing transmission channel - - Scenario 6 - - ------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - -Postel [Page 57] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - Mailing List Scenario - - First each of two mailing lists are expanded in separate sessions - with different hosts. Then the message is sent to everyone that - appeared on either list (but no duplicates) via a relay host. - - ------------------------------------------------------------- - - Step 1 -- Expanding the First List - - R: 220 MIT-AI.ARPA Simple Mail Transfer Service Ready - S: HELO SU-SCORE.ARPA - R: 250 MIT-AI.ARPA - - S: EXPN Example-People - R: 250- - R: 250-Fred Fonebone - R: 250-Xenon Y. Zither - R: 250-Quincy Smith <@USC-ISIF.ARPA:Q-Smith@ISI-VAXA.ARPA> - R: 250- - R: 250 - - S: QUIT - R: 221 MIT-AI.ARPA Service closing transmission channel - - - - - - - - - - - - - - - - - - - - - - - - - -[Page 58] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - Step 2 -- Expanding the Second List - - R: 220 MIT-MC.ARPA Simple Mail Transfer Service Ready - S: HELO SU-SCORE.ARPA - R: 250 MIT-MC.ARPA - - S: EXPN Interested-Parties - R: 250-Al Calico - R: 250- - R: 250-Quincy Smith <@USC-ISIF.ARPA:Q-Smith@ISI-VAXA.ARPA> - R: 250- - R: 250 - - S: QUIT - R: 221 MIT-MC.ARPA Service closing transmission channel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Postel [Page 59] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - Step 3 -- Mailing to All via a Relay Host - - R: 220 USC-ISIE.ARPA Simple Mail Transfer Service Ready - S: HELO SU-SCORE.ARPA - R: 250 USC-ISIE.ARPA - - S: MAIL FROM: - R: 250 OK - S: RCPT TO:<@USC-ISIE.ARPA:ABC@MIT-MC.ARPA> - R: 250 OK - S: RCPT TO:<@USC-ISIE.ARPA:Fonebone@USC-ISIQA.ARPA> - R: 250 OK - S: RCPT TO:<@USC-ISIE.ARPA:XYZ@MIT-AI.ARPA> - R: 250 OK - S: RCPT - TO:<@USC-ISIE.ARPA,@USC-ISIF.ARPA:Q-Smith@ISI-VAXA.ARPA> - R: 250 OK - S: RCPT TO:<@USC-ISIE.ARPA:joe@FOO-UNIX.ARPA> - R: 250 OK - S: RCPT TO:<@USC-ISIE.ARPA:xyz@BAR-UNIX.ARPA> - R: 250 OK - S: RCPT TO:<@USC-ISIE.ARPA:fred@BBN-UNIX.ARPA> - R: 250 OK - - S: DATA - R: 354 Start mail input; end with . - S: Blah blah blah... - S: ...etc. etc. etc. - S: . - R: 250 OK - - S: QUIT - R: 221 USC-ISIE.ARPA Service closing transmission channel - - Scenario 7 - - ------------------------------------------------------------- - - - - - - - - - - - - -[Page 60] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - Forwarding Scenarios - - ------------------------------------------------------------- - - R: 220 USC-ISIF.ARPA Simple Mail Transfer Service Ready - S: HELO LBL-UNIX.ARPA - R: 250 USC-ISIF.ARPA - - S: MAIL FROM: - R: 250 OK - - S: RCPT TO: - R: 251 User not local; will forward to - - S: DATA - R: 354 Start mail input; end with . - S: Blah blah blah... - S: ...etc. etc. etc. - S: . - R: 250 OK - - S: QUIT - R: 221 USC-ISIF.ARPA Service closing transmission channel - - Scenario 8 - - ------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - -Postel [Page 61] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - ------------------------------------------------------------- - - Step 1 -- Trying the Mailbox at the First Host - - R: 220 USC-ISIF.ARPA Simple Mail Transfer Service Ready - S: HELO LBL-UNIX.ARPA - R: 250 USC-ISIF.ARPA - - S: MAIL FROM: - R: 250 OK - - S: RCPT TO: - R: 251 User not local; will forward to - - S: RSET - R: 250 OK - - S: QUIT - R: 221 USC-ISIF.ARPA Service closing transmission channel - - Step 2 -- Delivering the Mail at the Second Host - - R: 220 USC-ISI.ARPA Simple Mail Transfer Service Ready - S: HELO LBL-UNIX.ARPA - R: 250 USC-ISI.ARPA - - S: MAIL FROM: - R: 250 OK - - S: RCPT TO: - R: OK - - S: DATA - R: 354 Start mail input; end with . - S: Blah blah blah... - S: ...etc. etc. etc. - S: . - R: 250 OK - - S: QUIT - R: 221 USC-ISI.ARPA Service closing transmission channel - - Scenario 9 - - ------------------------------------------------------------- - - - - -[Page 62] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - Too Many Recipients Scenario - - ------------------------------------------------------------- - - R: 220 BERKELEY.ARPA Simple Mail Transfer Service Ready - S: HELO USC-ISIF.ARPA - R: 250 BERKELEY.ARPA - - S: MAIL FROM: - R: 250 OK - - S: RCPT TO: - R: 250 OK - - S: RCPT TO: - R: 552 Recipient storage full, try again in another transaction - - S: DATA - R: 354 Start mail input; end with . - S: Blah blah blah... - S: ...etc. etc. etc. - S: . - R: 250 OK - - S: MAIL FROM: - R: 250 OK - - S: RCPT TO: - R: 250 OK - - S: DATA - R: 354 Start mail input; end with . - S: Blah blah blah... - S: ...etc. etc. etc. - S: . - R: 250 OK - - S: QUIT - R: 221 BERKELEY.ARPA Service closing transmission channel - - Scenario 10 - - ------------------------------------------------------------- - - Note that a real implementation must handle many recipients as - specified in Section 4.5.3. - - - -Postel [Page 63] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - -GLOSSARY - - ASCII - - American Standard Code for Information Interchange [1]. - - command - - A request for a mail service action sent by the sender-SMTP to the - receiver-SMTP. - - domain - - The hierarchially structured global character string address of a - host computer in the mail system. - - end of mail data indication - - A special sequence of characters that indicates the end of the - mail data. In particular, the five characters carriage return, - line feed, period, carriage return, line feed, in that order. - - host - - A computer in the internetwork environment on which mailboxes or - SMTP processes reside. - - line - - A a sequence of ASCII characters ending with a . - - mail data - - A sequence of ASCII characters of arbitrary length, which conforms - to the standard set in the Standard for the Format of ARPA - Internet Text Messages (RFC 822 [2]). - - mailbox - - A character string (address) which identifies a user to whom mail - is to be sent. Mailbox normally consists of the host and user - specifications. The standard mailbox naming convention is defined - to be "user@domain". Additionally, the "container" in which mail - is stored. - - - - - -[Page 64] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - - receiver-SMTP process - - A process which transfers mail in cooperation with a sender-SMTP - process. It waits for a connection to be established via the - transport service. It receives SMTP commands from the - sender-SMTP, sends replies, and performs the specified operations. - - reply - - A reply is an acknowledgment (positive or negative) sent from - receiver to sender via the transmission channel in response to a - command. The general form of a reply is a completion code - (including error codes) followed by a text string. The codes are - for use by programs and the text is usually intended for human - users. - - sender-SMTP process - - A process which transfers mail in cooperation with a receiver-SMTP - process. A local language may be used in the user interface - command/reply dialogue. The sender-SMTP initiates the transport - service connection. It initiates SMTP commands, receives replies, - and governs the transfer of mail. - - session - - The set of exchanges that occur while the transmission channel is - open. - - transaction - - The set of exchanges required for one message to be transmitted - for one or more recipients. - - transmission channel - - A full-duplex communication path between a sender-SMTP and a - receiver-SMTP for the exchange of commands, replies, and mail - text. - - transport service - - Any reliable stream-oriented data communication services. For - example, NCP, TCP, NITS. - - - - - -Postel [Page 65] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - user - - A human being (or a process on behalf of a human being) wishing to - obtain mail transfer service. In addition, a recipient of - computer mail. - - word - - A sequence of printing characters. - - - - The characters carriage return and line feed (in that order). - - - - The space character. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[Page 66] Postel - - - -RFC 821 August 1982 - Simple Mail Transfer Protocol - - - -REFERENCES - - [1] ASCII - - ASCII, "USA Code for Information Interchange", United States of - America Standards Institute, X3.4, 1968. Also in: Feinler, E. - and J. Postel, eds., "ARPANET Protocol Handbook", NIC 7104, for - the Defense Communications Agency by SRI International, Menlo - Park, California, Revised January 1978. - - [2] RFC 822 - - Crocker, D., "Standard for the Format of ARPA Internet Text - Messages," RFC 822, Department of Electrical Engineering, - University of Delaware, August 1982. - - [3] TCP - - Postel, J., ed., "Transmission Control Protocol - DARPA Internet - Program Protocol Specification", RFC 793, USC/Information Sciences - Institute, NTIS AD Number A111091, September 1981. Also in: - Feinler, E. and J. Postel, eds., "Internet Protocol Transition - Workbook", SRI International, Menlo Park, California, March 1982. - - [4] NCP - - McKenzie,A., "Host/Host Protocol for the ARPA Network", NIC 8246, - January 1972. Also in: Feinler, E. and J. Postel, eds., "ARPANET - Protocol Handbook", NIC 7104, for the Defense Communications - Agency by SRI International, Menlo Park, California, Revised - January 1978. - - [5] Initial Connection Protocol - - Postel, J., "Official Initial Connection Protocol", NIC 7101, - 11 June 1971. Also in: Feinler, E. and J. Postel, eds., "ARPANET - Protocol Handbook", NIC 7104, for the Defense Communications - Agency by SRI International, Menlo Park, California, Revised - January 1978. - - [6] NITS - - PSS/SG3, "A Network Independent Transport Service", Study Group 3, - The Post Office PSS Users Group, February 1980. Available from - the DCPU, National Physical Laboratory, Teddington, UK. - - - - -Postel [Page 67] - - - -August 1982 RFC 821 -Simple Mail Transfer Protocol - - - - [7] X.25 - - CCITT, "Recommendation X.25 - Interface Between Data Terminal - Equipment (DTE) and Data Circuit-terminating Equipment (DCE) for - Terminals Operating in the Packet Mode on Public Data Networks," - CCITT Orange Book, Vol. VIII.2, International Telephone and - Telegraph Consultative Committee, Geneva, 1976. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[Page 68] Postel - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc0822.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc0822.txt deleted file mode 100644 index 35b09a3..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc0822.txt +++ /dev/null @@ -1,2901 +0,0 @@ - - - - - - - RFC # 822 - - Obsoletes: RFC #733 (NIC #41952) - - - - - - - - - - - - - STANDARD FOR THE FORMAT OF - - ARPA INTERNET TEXT MESSAGES - - - - - - - August 13, 1982 - - - - - - - Revised by - - David H. Crocker - - - Dept. of Electrical Engineering - University of Delaware, Newark, DE 19711 - Network: DCrocker @ UDel-Relay - - - - - - - - - - - - - - - - Standard for ARPA Internet Text Messages - - - TABLE OF CONTENTS - - - PREFACE .................................................... ii - - 1. INTRODUCTION ........................................... 1 - - 1.1. Scope ............................................ 1 - 1.2. Communication Framework .......................... 2 - - 2. NOTATIONAL CONVENTIONS ................................. 3 - - 3. LEXICAL ANALYSIS OF MESSAGES ........................... 5 - - 3.1. General Description .............................. 5 - 3.2. Header Field Definitions ......................... 9 - 3.3. Lexical Tokens ................................... 10 - 3.4. Clarifications ................................... 11 - - 4. MESSAGE SPECIFICATION .................................. 17 - - 4.1. Syntax ........................................... 17 - 4.2. Forwarding ....................................... 19 - 4.3. Trace Fields ..................................... 20 - 4.4. Originator Fields ................................ 21 - 4.5. Receiver Fields .................................. 23 - 4.6. Reference Fields ................................. 23 - 4.7. Other Fields ..................................... 24 - - 5. DATE AND TIME SPECIFICATION ............................ 26 - - 5.1. Syntax ........................................... 26 - 5.2. Semantics ........................................ 26 - - 6. ADDRESS SPECIFICATION .................................. 27 - - 6.1. Syntax ........................................... 27 - 6.2. Semantics ........................................ 27 - 6.3. Reserved Address ................................. 33 - - 7. BIBLIOGRAPHY ........................................... 34 - - - APPENDIX - - A. EXAMPLES ............................................... 36 - B. SIMPLE FIELD PARSING ................................... 40 - C. DIFFERENCES FROM RFC #733 .............................. 41 - D. ALPHABETICAL LISTING OF SYNTAX RULES ................... 44 - - - August 13, 1982 - i - RFC #822 - - - - - Standard for ARPA Internet Text Messages - - - PREFACE - - - By 1977, the Arpanet employed several informal standards for - the text messages (mail) sent among its host computers. It was - felt necessary to codify these practices and provide for those - features that seemed imminent. The result of that effort was - Request for Comments (RFC) #733, "Standard for the Format of ARPA - Network Text Message", by Crocker, Vittal, Pogran, and Henderson. - The specification attempted to avoid major changes in existing - software, while permitting several new features. - - This document revises the specifications in RFC #733, in - order to serve the needs of the larger and more complex ARPA - Internet. Some of RFC #733's features failed to gain adequate - acceptance. In order to simplify the standard and the software - that follows it, these features have been removed. A different - addressing scheme is used, to handle the case of inter-network - mail; and the concept of re-transmission has been introduced. - - This specification is intended for use in the ARPA Internet. - However, an attempt has been made to free it of any dependence on - that environment, so that it can be applied to other network text - message systems. - - The specification of RFC #733 took place over the course of - one year, using the ARPANET mail environment, itself, to provide - an on-going forum for discussing the capabilities to be included. - More than twenty individuals, from across the country, partici- - pated in the original discussion. The development of this - revised specification has, similarly, utilized network mail-based - group discussion. Both specification efforts greatly benefited - from the comments and ideas of the participants. - - The syntax of the standard, in RFC #733, was originally - specified in the Backus-Naur Form (BNF) meta-language. Ken L. - Harrenstien, of SRI International, was responsible for re-coding - the BNF into an augmented BNF that makes the representation - smaller and easier to understand. - - - - - - - - - - - - - August 13, 1982 - ii - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - 1. INTRODUCTION - - 1.1. SCOPE - - This standard specifies a syntax for text messages that are - sent among computer users, within the framework of "electronic - mail". The standard supersedes the one specified in ARPANET - Request for Comments #733, "Standard for the Format of ARPA Net- - work Text Messages". - - In this context, messages are viewed as having an envelope - and contents. The envelope contains whatever information is - needed to accomplish transmission and delivery. The contents - compose the object to be delivered to the recipient. This stan- - dard applies only to the format and some of the semantics of mes- - sage contents. It contains no specification of the information - in the envelope. - - However, some message systems may use information from the - contents to create the envelope. It is intended that this stan- - dard facilitate the acquisition of such information by programs. - - Some message systems may store messages in formats that - differ from the one specified in this standard. This specifica- - tion is intended strictly as a definition of what message content - format is to be passed BETWEEN hosts. - - Note: This standard is NOT intended to dictate the internal for- - mats used by sites, the specific message system features - that they are expected to support, or any of the charac- - teristics of user interface programs that create or read - messages. - - A distinction should be made between what the specification - REQUIRES and what it ALLOWS. Messages can be made complex and - rich with formally-structured components of information or can be - kept small and simple, with a minimum of such information. Also, - the standard simplifies the interpretation of differing visual - formats in messages; only the visual aspect of a message is - affected and not the interpretation of information within it. - Implementors may choose to retain such visual distinctions. - - The formal definition is divided into four levels. The bot- - tom level describes the meta-notation used in this document. The - second level describes basic lexical analyzers that feed tokens - to higher-level parsers. Next is an overall specification for - messages; it permits distinguishing individual fields. Finally, - there is definition of the contents of several structured fields. - - - - August 13, 1982 - 1 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - 1.2. COMMUNICATION FRAMEWORK - - Messages consist of lines of text. No special provisions - are made for encoding drawings, facsimile, speech, or structured - text. No significant consideration has been given to questions - of data compression or to transmission and storage efficiency, - and the standard tends to be free with the number of bits con- - sumed. For example, field names are specified as free text, - rather than special terse codes. - - A general "memo" framework is used. That is, a message con- - sists of some information in a rigid format, followed by the main - part of the message, with a format that is not specified in this - document. The syntax of several fields of the rigidly-formated - ("headers") section is defined in this specification; some of - these fields must be included in all messages. - - The syntax that distinguishes between header fields is - specified separately from the internal syntax for particular - fields. This separation is intended to allow simple parsers to - operate on the general structure of messages, without concern for - the detailed structure of individual header fields. Appendix B - is provided to facilitate construction of these parsers. - - In addition to the fields specified in this document, it is - expected that other fields will gain common use. As necessary, - the specifications for these "extension-fields" will be published - through the same mechanism used to publish this document. Users - may also wish to extend the set of fields that they use - privately. Such "user-defined fields" are permitted. - - The framework severely constrains document tone and appear- - ance and is primarily useful for most intra-organization communi- - cations and well-structured inter-organization communication. - It also can be used for some types of inter-process communica- - tion, such as simple file transfer and remote job entry. A more - robust framework might allow for multi-font, multi-color, multi- - dimension encoding of information. A less robust one, as is - present in most single-machine message systems, would more - severely constrain the ability to add fields and the decision to - include specific fields. In contrast with paper-based communica- - tion, it is interesting to note that the RECEIVER of a message - can exercise an extraordinary amount of control over the - message's appearance. The amount of actual control available to - message receivers is contingent upon the capabilities of their - individual message systems. - - - - - - August 13, 1982 - 2 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - 2. NOTATIONAL CONVENTIONS - - This specification uses an augmented Backus-Naur Form (BNF) - notation. The differences from standard BNF involve naming rules - and indicating repetition and "local" alternatives. - - 2.1. RULE NAMING - - Angle brackets ("<", ">") are not used, in general. The - name of a rule is simply the name itself, rather than "". - Quotation-marks enclose literal text (which may be upper and/or - lower case). Certain basic rules are in uppercase, such as - SPACE, TAB, CRLF, DIGIT, ALPHA, etc. Angle brackets are used in - rule definitions, and in the rest of this document, whenever - their presence will facilitate discerning the use of rule names. - - 2.2. RULE1 / RULE2: ALTERNATIVES - - Elements separated by slash ("/") are alternatives. There- - fore "foo / bar" will accept foo or bar. - - 2.3. (RULE1 RULE2): LOCAL ALTERNATIVES - - Elements enclosed in parentheses are treated as a single - element. Thus, "(elem (foo / bar) elem)" allows the token - sequences "elem foo elem" and "elem bar elem". - - 2.4. *RULE: REPETITION - - The character "*" preceding an element indicates repetition. - The full form is: - - *element - - indicating at least and at most occurrences of element. - Default values are 0 and infinity so that "*(element)" allows any - number, including zero; "1*element" requires at least one; and - "1*2element" allows one or two. - - 2.5. [RULE]: OPTIONAL - - Square brackets enclose optional elements; "[foo bar]" is - equivalent to "*1(foo bar)". - - 2.6. NRULE: SPECIFIC REPETITION - - "(element)" is equivalent to "*(element)"; that is, - exactly occurrences of (element). Thus 2DIGIT is a 2-digit - number, and 3ALPHA is a string of three alphabetic characters. - - - August 13, 1982 - 3 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - 2.7. #RULE: LISTS - - A construct "#" is defined, similar to "*", as follows: - - #element - - indicating at least and at most elements, each separated - by one or more commas (","). This makes the usual form of lists - very easy; a rule such as '(element *("," element))' can be shown - as "1#element". Wherever this construct is used, null elements - are allowed, but do not contribute to the count of elements - present. That is, "(element),,(element)" is permitted, but - counts as only two elements. Therefore, where at least one ele- - ment is required, at least one non-null element must be present. - Default values are 0 and infinity so that "#(element)" allows any - number, including zero; "1#element" requires at least one; and - "1#2element" allows one or two. - - 2.8. ; COMMENTS - - A semi-colon, set off some distance to the right of rule - text, starts a comment that continues to the end of line. This - is a simple way of including useful notes in parallel with the - specifications. - - - - - - - - - - - - - - - - - - - - - - - - - - - - August 13, 1982 - 4 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - 3. LEXICAL ANALYSIS OF MESSAGES - - 3.1. GENERAL DESCRIPTION - - A message consists of header fields and, optionally, a body. - The body is simply a sequence of lines containing ASCII charac- - ters. It is separated from the headers by a null line (i.e., a - line with nothing preceding the CRLF). - - 3.1.1. LONG HEADER FIELDS - - Each header field can be viewed as a single, logical line of - ASCII characters, comprising a field-name and a field-body. - For convenience, the field-body portion of this conceptual - entity can be split into a multiple-line representation; this - is called "folding". The general rule is that wherever there - may be linear-white-space (NOT simply LWSP-chars), a CRLF - immediately followed by AT LEAST one LWSP-char may instead be - inserted. Thus, the single line - - To: "Joe & J. Harvey" , JJV @ BBN - - can be represented as: - - To: "Joe & J. Harvey" , - JJV@BBN - - and - - To: "Joe & J. Harvey" - , JJV - @BBN - - and - - To: "Joe & - J. Harvey" , JJV @ BBN - - The process of moving from this folded multiple-line - representation of a header field to its single line represen- - tation is called "unfolding". Unfolding is accomplished by - regarding CRLF immediately followed by a LWSP-char as - equivalent to the LWSP-char. - - Note: While the standard permits folding wherever linear- - white-space is permitted, it is recommended that struc- - tured fields, such as those containing addresses, limit - folding to higher-level syntactic breaks. For address - fields, it is recommended that such folding occur - - - August 13, 1982 - 5 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - between addresses, after the separating comma. - - 3.1.2. STRUCTURE OF HEADER FIELDS - - Once a field has been unfolded, it may be viewed as being com- - posed of a field-name followed by a colon (":"), followed by a - field-body, and terminated by a carriage-return/line-feed. - The field-name must be composed of printable ASCII characters - (i.e., characters that have values between 33. and 126., - decimal, except colon). The field-body may be composed of any - ASCII characters, except CR or LF. (While CR and/or LF may be - present in the actual text, they are removed by the action of - unfolding the field.) - - Certain field-bodies of headers may be interpreted according - to an internal syntax that some systems may wish to parse. - These fields are called "structured fields". Examples - include fields containing dates and addresses. Other fields, - such as "Subject" and "Comments", are regarded simply as - strings of text. - - Note: Any field which has a field-body that is defined as - other than simply is to be treated as a struc- - tured field. - - Field-names, unstructured field bodies and structured - field bodies each are scanned by their own, independent - "lexical" analyzers. - - 3.1.3. UNSTRUCTURED FIELD BODIES - - For some fields, such as "Subject" and "Comments", no struc- - turing is assumed, and they are treated simply as s, as - in the message body. Rules of folding apply to these fields, - so that such field bodies which occupy several lines must - therefore have the second and successive lines indented by at - least one LWSP-char. - - 3.1.4. STRUCTURED FIELD BODIES - - To aid in the creation and reading of structured fields, the - free insertion of linear-white-space (which permits folding - by inclusion of CRLFs) is allowed between lexical tokens. - Rather than obscuring the syntax specifications for these - structured fields with explicit syntax for this linear-white- - space, the existence of another "lexical" analyzer is assumed. - This analyzer does not apply for unstructured field bodies - that are simply strings of text, as described above. The - analyzer provides an interpretation of the unfolded text - - - August 13, 1982 - 6 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - composing the body of the field as a sequence of lexical sym- - bols. - - These symbols are: - - - individual special characters - - quoted-strings - - domain-literals - - comments - - atoms - - The first four of these symbols are self-delimiting. Atoms - are not; they are delimited by the self-delimiting symbols and - by linear-white-space. For the purposes of regenerating - sequences of atoms and quoted-strings, exactly one SPACE is - assumed to exist, and should be used, between them. (Also, in - the "Clarifications" section on "White Space", below, note the - rules about treatment of multiple contiguous LWSP-chars.) - - So, for example, the folded body of an address field - - ":sysmail"@ Some-Group. Some-Org, - Muhammed.(I am the greatest) Ali @(the)Vegas.WBA - - - - - - - - - - - - - - - - - - - - - - - - - - - - - August 13, 1982 - 7 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - is analyzed into the following lexical symbols and types: - - :sysmail quoted string - @ special - Some-Group atom - . special - Some-Org atom - , special - Muhammed atom - . special - (I am the greatest) comment - Ali atom - @ atom - (the) comment - Vegas atom - . special - WBA atom - - The canonical representations for the data in these addresses - are the following strings: - - ":sysmail"@Some-Group.Some-Org - - and - - Muhammed.Ali@Vegas.WBA - - Note: For purposes of display, and when passing such struc- - tured information to other systems, such as mail proto- - col services, there must be NO linear-white-space - between s that are separated by period (".") or - at-sign ("@") and exactly one SPACE between all other - s. Also, headers should be in a folded form. - - - - - - - - - - - - - - - - - - - August 13, 1982 - 8 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - 3.2. HEADER FIELD DEFINITIONS - - These rules show a field meta-syntax, without regard for the - particular type or internal syntax. Their purpose is to permit - detection of fields; also, they present to higher-level parsers - an image of each field as fitting on one line. - - field = field-name ":" [ field-body ] CRLF - - field-name = 1* - - field-body = field-body-contents - [CRLF LWSP-char field-body] - - field-body-contents = - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - August 13, 1982 - 9 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - 3.3. LEXICAL TOKENS - - The following rules are used to define an underlying lexical - analyzer, which feeds tokens to higher level parsers. See the - ANSI references, in the Bibliography. - - ; ( Octal, Decimal.) - CHAR = ; ( 0-177, 0.-127.) - ALPHA = - ; (101-132, 65.- 90.) - ; (141-172, 97.-122.) - DIGIT = ; ( 60- 71, 48.- 57.) - CTL = ; ( 177, 127.) - CR = ; ( 15, 13.) - LF = ; ( 12, 10.) - SPACE = ; ( 40, 32.) - HTAB = ; ( 11, 9.) - <"> = ; ( 42, 34.) - CRLF = CR LF - - LWSP-char = SPACE / HTAB ; semantics = SPACE - - linear-white-space = 1*([CRLF] LWSP-char) ; semantics = SPACE - ; CRLF => folding - - specials = "(" / ")" / "<" / ">" / "@" ; Must be in quoted- - / "," / ";" / ":" / "\" / <"> ; string, to use - / "." / "[" / "]" ; within a word. - - delimiters = specials / linear-white-space / comment - - text = atoms, specials, - CR & bare LF, but NOT ; comments and - including CRLF> ; quoted-strings are - ; NOT recognized. - - atom = 1* - - quoted-string = <"> *(qtext/quoted-pair) <">; Regular qtext or - ; quoted chars. - - qtext = , ; => may be folded - "\" & CR, and including - linear-white-space> - - domain-literal = "[" *(dtext / quoted-pair) "]" - - - - - August 13, 1982 - 10 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - dtext = may be folded - "]", "\" & CR, & including - linear-white-space> - - comment = "(" *(ctext / quoted-pair / comment) ")" - - ctext = may be folded - ")", "\" & CR, & including - linear-white-space> - - quoted-pair = "\" CHAR ; may quote any char - - phrase = 1*word ; Sequence of words - - word = atom / quoted-string - - - 3.4. CLARIFICATIONS - - 3.4.1. QUOTING - - Some characters are reserved for special interpretation, such - as delimiting lexical tokens. To permit use of these charac- - ters as uninterpreted data, a quoting mechanism is provided. - To quote a character, precede it with a backslash ("\"). - - This mechanism is not fully general. Characters may be quoted - only within a subset of the lexical constructs. In particu- - lar, quoting is limited to use within: - - - quoted-string - - domain-literal - - comment - - Within these constructs, quoting is REQUIRED for CR and "\" - and for the character(s) that delimit the token (e.g., "(" and - ")" for a comment). However, quoting is PERMITTED for any - character. - - Note: In particular, quoting is NOT permitted within atoms. - For example when the local-part of an addr-spec must - contain a special character, a quoted string must be - used. Therefore, a specification such as: - - Full\ Name@Domain - - is not legal and must be specified as: - - "Full Name"@Domain - - - August 13, 1982 - 11 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - 3.4.2. WHITE SPACE - - Note: In structured field bodies, multiple linear space ASCII - characters (namely HTABs and SPACEs) are treated as - single spaces and may freely surround any symbol. In - all header fields, the only place in which at least one - LWSP-char is REQUIRED is at the beginning of continua- - tion lines in a folded field. - - When passing text to processes that do not interpret text - according to this standard (e.g., mail protocol servers), then - NO linear-white-space characters should occur between a period - (".") or at-sign ("@") and a . Exactly ONE SPACE should - be used in place of arbitrary linear-white-space and comment - sequences. - - Note: Within systems conforming to this standard, wherever a - member of the list of delimiters is allowed, LWSP-chars - may also occur before and/or after it. - - Writers of mail-sending (i.e., header-generating) programs - should realize that there is no network-wide definition of the - effect of ASCII HT (horizontal-tab) characters on the appear- - ance of text at another network host; therefore, the use of - tabs in message headers, though permitted, is discouraged. - - 3.4.3. COMMENTS - - A comment is a set of ASCII characters, which is enclosed in - matching parentheses and which is not within a quoted-string - The comment construct permits message originators to add text - which will be useful for human readers, but which will be - ignored by the formal semantics. Comments should be retained - while the message is subject to interpretation according to - this standard. However, comments must NOT be included in - other cases, such as during protocol exchanges with mail - servers. - - Comments nest, so that if an unquoted left parenthesis occurs - in a comment string, there must also be a matching right - parenthesis. When a comment acts as the delimiter between a - sequence of two lexical symbols, such as two atoms, it is lex- - ically equivalent with a single SPACE, for the purposes of - regenerating the sequence, such as when passing the sequence - onto a mail protocol server. Comments are detected as such - only within field-bodies of structured fields. - - If a comment is to be "folded" onto multiple lines, then the - syntax for folding must be adhered to. (See the "Lexical - - - August 13, 1982 - 12 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - Analysis of Messages" section on "Folding Long Header Fields" - above, and the section on "Case Independence" below.) Note - that the official semantics therefore do not "see" any - unquoted CRLFs that are in comments, although particular pars- - ing programs may wish to note their presence. For these pro- - grams, it would be reasonable to interpret a "CRLF LWSP-char" - as being a CRLF that is part of the comment; i.e., the CRLF is - kept and the LWSP-char is discarded. Quoted CRLFs (i.e., a - backslash followed by a CR followed by a LF) still must be - followed by at least one LWSP-char. - - 3.4.4. DELIMITING AND QUOTING CHARACTERS - - The quote character (backslash) and characters that delimit - syntactic units are not, generally, to be taken as data that - are part of the delimited or quoted unit(s). In particular, - the quotation-marks that define a quoted-string, the - parentheses that define a comment and the backslash that - quotes a following character are NOT part of the quoted- - string, comment or quoted character. A quotation-mark that is - to be part of a quoted-string, a parenthesis that is to be - part of a comment and a backslash that is to be part of either - must each be preceded by the quote-character backslash ("\"). - Note that the syntax allows any character to be quoted within - a quoted-string or comment; however only certain characters - MUST be quoted to be included as data. These characters are - the ones that are not part of the alternate text group (i.e., - ctext or qtext). - - The one exception to this rule is that a single SPACE is - assumed to exist between contiguous words in a phrase, and - this interpretation is independent of the actual number of - LWSP-chars that the creator places between the words. To - include more than one SPACE, the creator must make the LWSP- - chars be part of a quoted-string. - - Quotation marks that delimit a quoted string and backslashes - that quote the following character should NOT accompany the - quoted-string when the string is passed to processes that do - not interpret data according to this specification (e.g., mail - protocol servers). - - 3.4.5. QUOTED-STRINGS - - Where permitted (i.e., in words in structured fields) quoted- - strings are treated as a single symbol. That is, a quoted- - string is equivalent to an atom, syntactically. If a quoted- - string is to be "folded" onto multiple lines, then the syntax - for folding must be adhered to. (See the "Lexical Analysis of - - - August 13, 1982 - 13 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - Messages" section on "Folding Long Header Fields" above, and - the section on "Case Independence" below.) Therefore, the - official semantics do not "see" any bare CRLFs that are in - quoted-strings; however particular parsing programs may wish - to note their presence. For such programs, it would be rea- - sonable to interpret a "CRLF LWSP-char" as being a CRLF which - is part of the quoted-string; i.e., the CRLF is kept and the - LWSP-char is discarded. Quoted CRLFs (i.e., a backslash fol- - lowed by a CR followed by a LF) are also subject to rules of - folding, but the presence of the quoting character (backslash) - explicitly indicates that the CRLF is data to the quoted - string. Stripping off the first following LWSP-char is also - appropriate when parsing quoted CRLFs. - - 3.4.6. BRACKETING CHARACTERS - - There is one type of bracket which must occur in matched pairs - and may have pairs nested within each other: - - o Parentheses ("(" and ")") are used to indicate com- - ments. - - There are three types of brackets which must occur in matched - pairs, and which may NOT be nested: - - o Colon/semi-colon (":" and ";") are used in address - specifications to indicate that the included list of - addresses are to be treated as a group. - - o Angle brackets ("<" and ">") are generally used to - indicate the presence of a one machine-usable refer- - ence (e.g., delimiting mailboxes), possibly including - source-routing to the machine. - - o Square brackets ("[" and "]") are used to indicate the - presence of a domain-literal, which the appropriate - name-domain is to use directly, bypassing normal - name-resolution mechanisms. - - 3.4.7. CASE INDEPENDENCE - - Except as noted, alphabetic strings may be represented in any - combination of upper and lower case. The only syntactic units - - - - - - - - - August 13, 1982 - 14 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - which requires preservation of case information are: - - - text - - qtext - - dtext - - ctext - - quoted-pair - - local-part, except "Postmaster" - - When matching any other syntactic unit, case is to be ignored. - For example, the field-names "From", "FROM", "from", and even - "FroM" are semantically equal and should all be treated ident- - ically. - - When generating these units, any mix of upper and lower case - alphabetic characters may be used. The case shown in this - specification is suggested for message-creating processes. - - Note: The reserved local-part address unit, "Postmaster", is - an exception. When the value "Postmaster" is being - interpreted, it must be accepted in any mixture of - case, including "POSTMASTER", and "postmaster". - - 3.4.8. FOLDING LONG HEADER FIELDS - - Each header field may be represented on exactly one line con- - sisting of the name of the field and its body, and terminated - by a CRLF; this is what the parser sees. For readability, the - field-body portion of long header fields may be "folded" onto - multiple lines of the actual field. "Long" is commonly inter- - preted to mean greater than 65 or 72 characters. The former - length serves as a limit, when the message is to be viewed on - most simple terminals which use simple display software; how- - ever, the limit is not imposed by this standard. - - Note: Some display software often can selectively fold lines, - to suit the display terminal. In such cases, sender- - provided folding can interfere with the display - software. - - 3.4.9. BACKSPACE CHARACTERS - - ASCII BS characters (Backspace, decimal 8) may be included in - texts and quoted-strings to effect overstriking. However, any - use of backspaces which effects an overstrike to the left of - the beginning of the text or quoted-string is prohibited. - - - - - - August 13, 1982 - 15 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - 3.4.10. NETWORK-SPECIFIC TRANSFORMATIONS - - During transmission through heterogeneous networks, it may be - necessary to force data to conform to a network's local con- - ventions. For example, it may be required that a CR be fol- - lowed either by LF, making a CRLF, or by , if the CR is - to stand alone). Such transformations are reversed, when the - message exits that network. - - When crossing network boundaries, the message should be - treated as passing through two modules. It will enter the - first module containing whatever network-specific transforma- - tions that were necessary to permit migration through the - "current" network. It then passes through the modules: - - o Transformation Reversal - - The "current" network's idiosyncracies are removed and - the message is returned to the canonical form speci- - fied in this standard. - - o Transformation - - The "next" network's local idiosyncracies are imposed - on the message. - - ------------------ - From ==> | Remove Net-A | - Net-A | idiosyncracies | - ------------------ - || - \/ - Conformance - with standard - || - \/ - ------------------ - | Impose Net-B | ==> To - | idiosyncracies | Net-B - ------------------ - - - - - - - - - - - - August 13, 1982 - 16 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - 4. MESSAGE SPECIFICATION - - 4.1. SYNTAX - - Note: Due to an artifact of the notational conventions, the syn- - tax indicates that, when present, some fields, must be in - a particular order. Header fields are NOT required to - occur in any particular order, except that the message - body must occur AFTER the headers. It is recommended - that, if present, headers be sent in the order "Return- - Path", "Received", "Date", "From", "Subject", "Sender", - "To", "cc", etc. - - This specification permits multiple occurrences of most - fields. Except as noted, their interpretation is not - specified here, and their use is discouraged. - - The following syntax for the bodies of various fields should - be thought of as describing each field body as a single long - string (or line). The "Lexical Analysis of Message" section on - "Long Header Fields", above, indicates how such long strings can - be represented on more than one line in the actual transmitted - message. - - message = fields *( CRLF *text ) ; Everything after - ; first null line - ; is message body - - fields = dates ; Creation time, - source ; author id & one - 1*destination ; address required - *optional-field ; others optional - - source = [ trace ] ; net traversals - originator ; original mail - [ resent ] ; forwarded - - trace = return ; path to sender - 1*received ; receipt tags - - return = "Return-path" ":" route-addr ; return address - - received = "Received" ":" ; one per relay - ["from" domain] ; sending host - ["by" domain] ; receiving host - ["via" atom] ; physical path - *("with" atom) ; link/mail protocol - ["id" msg-id] ; receiver msg id - ["for" addr-spec] ; initial form - - - August 13, 1982 - 17 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - ";" date-time ; time received - - originator = authentic ; authenticated addr - [ "Reply-To" ":" 1#address] ) - - authentic = "From" ":" mailbox ; Single author - / ( "Sender" ":" mailbox ; Actual submittor - "From" ":" 1#mailbox) ; Multiple authors - ; or not sender - - resent = resent-authentic - [ "Resent-Reply-To" ":" 1#address] ) - - resent-authentic = - = "Resent-From" ":" mailbox - / ( "Resent-Sender" ":" mailbox - "Resent-From" ":" 1#mailbox ) - - dates = orig-date ; Original - [ resent-date ] ; Forwarded - - orig-date = "Date" ":" date-time - - resent-date = "Resent-Date" ":" date-time - - destination = "To" ":" 1#address ; Primary - / "Resent-To" ":" 1#address - / "cc" ":" 1#address ; Secondary - / "Resent-cc" ":" 1#address - / "bcc" ":" #address ; Blind carbon - / "Resent-bcc" ":" #address - - optional-field = - / "Message-ID" ":" msg-id - / "Resent-Message-ID" ":" msg-id - / "In-Reply-To" ":" *(phrase / msg-id) - / "References" ":" *(phrase / msg-id) - / "Keywords" ":" #phrase - / "Subject" ":" *text - / "Comments" ":" *text - / "Encrypted" ":" 1#2word - / extension-field ; To be defined - / user-defined-field ; May be pre-empted - - msg-id = "<" addr-spec ">" ; Unique message id - - - - - - - August 13, 1982 - 18 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - extension-field = - - - user-defined-field = - - - 4.2. FORWARDING - - Some systems permit mail recipients to forward a message, - retaining the original headers, by adding some new fields. This - standard supports such a service, through the "Resent-" prefix to - field names. - - Whenever the string "Resent-" begins a field name, the field - has the same semantics as a field whose name does not have the - prefix. However, the message is assumed to have been forwarded - by an original recipient who attached the "Resent-" field. This - new field is treated as being more recent than the equivalent, - original field. For example, the "Resent-From", indicates the - person that forwarded the message, whereas the "From" field indi- - cates the original author. - - Use of such precedence information depends upon partici- - pants' communication needs. For example, this standard does not - dictate when a "Resent-From:" address should receive replies, in - lieu of sending them to the "From:" address. - - Note: In general, the "Resent-" fields should be treated as con- - taining a set of information that is independent of the - set of original fields. Information for one set should - not automatically be taken from the other. The interpre- - tation of multiple "Resent-" fields, of the same type, is - undefined. - - In the remainder of this specification, occurrence of legal - "Resent-" fields are treated identically with the occurrence of - - - - - - - - - August 13, 1982 - 19 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - fields whose names do not contain this prefix. - - 4.3. TRACE FIELDS - - Trace information is used to provide an audit trail of mes- - sage handling. In addition, it indicates a route back to the - sender of the message. - - The list of known "via" and "with" values are registered - with the Network Information Center, SRI International, Menlo - Park, California. - - 4.3.1. RETURN-PATH - - This field is added by the final transport system that - delivers the message to its recipient. The field is intended - to contain definitive information about the address and route - back to the message's originator. - - Note: The "Reply-To" field is added by the originator and - serves to direct replies, whereas the "Return-Path" - field is used to identify a path back to the origina- - tor. - - While the syntax indicates that a route specification is - optional, every attempt should be made to provide that infor- - mation in this field. - - 4.3.2. RECEIVED - - A copy of this field is added by each transport service that - relays the message. The information in the field can be quite - useful for tracing transport problems. - - The names of the sending and receiving hosts and time-of- - receipt may be specified. The "via" parameter may be used, to - indicate what physical mechanism the message was sent over, - such as Arpanet or Phonenet, and the "with" parameter may be - used to indicate the mail-, or connection-, level protocol - that was used, such as the SMTP mail protocol, or X.25 tran- - sport protocol. - - Note: Several "with" parameters may be included, to fully - specify the set of protocols that were used. - - Some transport services queue mail; the internal message iden- - tifier that is assigned to the message may be noted, using the - "id" parameter. When the sending host uses a destination - address specification that the receiving host reinterprets, by - - - August 13, 1982 - 20 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - expansion or transformation, the receiving host may wish to - record the original specification, using the "for" parameter. - For example, when a copy of mail is sent to the member of a - distribution list, this parameter may be used to record the - original address that was used to specify the list. - - 4.4. ORIGINATOR FIELDS - - The standard allows only a subset of the combinations possi- - ble with the From, Sender, Reply-To, Resent-From, Resent-Sender, - and Resent-Reply-To fields. The limitation is intentional. - - 4.4.1. FROM / RESENT-FROM - - This field contains the identity of the person(s) who wished - this message to be sent. The message-creation process should - default this field to be a single, authenticated machine - address, indicating the AGENT (person, system or process) - entering the message. If this is not done, the "Sender" field - MUST be present. If the "From" field IS defaulted this way, - the "Sender" field is optional and is redundant with the - "From" field. In all cases, addresses in the "From" field - must be machine-usable (addr-specs) and may not contain named - lists (groups). - - 4.4.2. SENDER / RESENT-SENDER - - This field contains the authenticated identity of the AGENT - (person, system or process) that sends the message. It is - intended for use when the sender is not the author of the mes- - sage, or to indicate who among a group of authors actually - sent the message. If the contents of the "Sender" field would - be completely redundant with the "From" field, then the - "Sender" field need not be present and its use is discouraged - (though still legal). In particular, the "Sender" field MUST - be present if it is NOT the same as the "From" Field. - - The Sender mailbox specification includes a word sequence - which must correspond to a specific agent (i.e., a human user - or a computer program) rather than a standard address. This - indicates the expectation that the field will identify the - single AGENT (person, system, or process) responsible for - sending the mail and not simply include the name of a mailbox - from which the mail was sent. For example in the case of a - shared login name, the name, by itself, would not be adequate. - The local-part address unit, which refers to this agent, is - expected to be a computer system term, and not (for example) a - generalized person reference which can be used outside the - network text message context. - - - August 13, 1982 - 21 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - Since the critical function served by the "Sender" field is - identification of the agent responsible for sending mail and - since computer programs cannot be held accountable for their - behavior, it is strongly recommended that when a computer pro- - gram generates a message, the HUMAN who is responsible for - that program be referenced as part of the "Sender" field mail- - box specification. - - 4.4.3. REPLY-TO / RESENT-REPLY-TO - - This field provides a general mechanism for indicating any - mailbox(es) to which responses are to be sent. Three typical - uses for this feature can be distinguished. In the first - case, the author(s) may not have regular machine-based mail- - boxes and therefore wish(es) to indicate an alternate machine - address. In the second case, an author may wish additional - persons to be made aware of, or responsible for, replies. A - somewhat different use may be of some help to "text message - teleconferencing" groups equipped with automatic distribution - services: include the address of that service in the "Reply- - To" field of all messages submitted to the teleconference; - then participants can "reply" to conference submissions to - guarantee the correct distribution of any submission of their - own. - - Note: The "Return-Path" field is added by the mail transport - service, at the time of final deliver. It is intended - to identify a path back to the orginator of the mes- - sage. The "Reply-To" field is added by the message - originator and is intended to direct replies. - - 4.4.4. AUTOMATIC USE OF FROM / SENDER / REPLY-TO - - For systems which automatically generate address lists for - replies to messages, the following recommendations are made: - - o The "Sender" field mailbox should be sent notices of - any problems in transport or delivery of the original - messages. If there is no "Sender" field, then the - "From" field mailbox should be used. - - o The "Sender" field mailbox should NEVER be used - automatically, in a recipient's reply message. - - o If the "Reply-To" field exists, then the reply should - go to the addresses indicated in that field and not to - the address(es) indicated in the "From" field. - - - - - August 13, 1982 - 22 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - o If there is a "From" field, but no "Reply-To" field, - the reply should be sent to the address(es) indicated - in the "From" field. - - Sometimes, a recipient may actually wish to communicate with - the person that initiated the message transfer. In such - cases, it is reasonable to use the "Sender" address. - - This recommendation is intended only for automated use of - originator-fields and is not intended to suggest that replies - may not also be sent to other recipients of messages. It is - up to the respective mail-handling programs to decide what - additional facilities will be provided. - - Examples are provided in Appendix A. - - 4.5. RECEIVER FIELDS - - 4.5.1. TO / RESENT-TO - - This field contains the identity of the primary recipients of - the message. - - 4.5.2. CC / RESENT-CC - - This field contains the identity of the secondary (informa- - tional) recipients of the message. - - 4.5.3. BCC / RESENT-BCC - - This field contains the identity of additional recipients of - the message. The contents of this field are not included in - copies of the message sent to the primary and secondary reci- - pients. Some systems may choose to include the text of the - "Bcc" field only in the author(s)'s copy, while others may - also include it in the text sent to all those indicated in the - "Bcc" list. - - 4.6. REFERENCE FIELDS - - 4.6.1. MESSAGE-ID / RESENT-MESSAGE-ID - - This field contains a unique identifier (the local-part - address unit) which refers to THIS version of THIS message. - The uniqueness of the message identifier is guaranteed by the - host which generates it. This identifier is intended to be - machine readable and not necessarily meaningful to humans. A - message identifier pertains to exactly one instantiation of a - particular message; subsequent revisions to the message should - - - August 13, 1982 - 23 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - each receive new message identifiers. - - 4.6.2. IN-REPLY-TO - - The contents of this field identify previous correspon- - dence which this message answers. Note that if message iden- - tifiers are used in this field, they must use the msg-id - specification format. - - 4.6.3. REFERENCES - - The contents of this field identify other correspondence - which this message references. Note that if message identif- - iers are used, they must use the msg-id specification format. - - 4.6.4. KEYWORDS - - This field contains keywords or phrases, separated by - commas. - - 4.7. OTHER FIELDS - - 4.7.1. SUBJECT - - This is intended to provide a summary, or indicate the - nature, of the message. - - 4.7.2. COMMENTS - - Permits adding text comments onto the message without - disturbing the contents of the message's body. - - 4.7.3. ENCRYPTED - - Sometimes, data encryption is used to increase the - privacy of message contents. If the body of a message has - been encrypted, to keep its contents private, the "Encrypted" - field can be used to note the fact and to indicate the nature - of the encryption. The first parameter indicates the - software used to encrypt the body, and the second, optional - is intended to aid the recipient in selecting the - proper decryption key. This code word may be viewed as an - index to a table of keys held by the recipient. - - Note: Unfortunately, headers must contain envelope, as well - as contents, information. Consequently, it is neces- - sary that they remain unencrypted, so that mail tran- - sport services may access them. Since names, - addresses, and "Subject" field contents may contain - - - August 13, 1982 - 24 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - sensitive information, this requirement limits total - message privacy. - - Names of encryption software are registered with the Net- - work Information Center, SRI International, Menlo Park, Cali- - fornia. - - 4.7.4. EXTENSION-FIELD - - A limited number of common fields have been defined in - this document. As network mail requirements dictate, addi- - tional fields may be standardized. To provide user-defined - fields with a measure of safety, in name selection, such - extension-fields will never have names that begin with the - string "X-". - - Names of Extension-fields are registered with the Network - Information Center, SRI International, Menlo Park, California. - - 4.7.5. USER-DEFINED-FIELD - - Individual users of network mail are free to define and - use additional header fields. Such fields must have names - which are not already used in the current specification or in - any definitions of extension-fields, and the overall syntax of - these user-defined-fields must conform to this specification's - rules for delimiting and folding fields. Due to the - extension-field publishing process, the name of a user- - defined-field may be pre-empted - - Note: The prefatory string "X-" will never be used in the - names of Extension-fields. This provides user-defined - fields with a protected set of names. - - - - - - - - - - - - - - - - - - - August 13, 1982 - 25 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - 5. DATE AND TIME SPECIFICATION - - 5.1. SYNTAX - - date-time = [ day "," ] date time ; dd mm yy - ; hh:mm:ss zzz - - day = "Mon" / "Tue" / "Wed" / "Thu" - / "Fri" / "Sat" / "Sun" - - date = 1*2DIGIT month 2DIGIT ; day month year - ; e.g. 20 Jun 82 - - month = "Jan" / "Feb" / "Mar" / "Apr" - / "May" / "Jun" / "Jul" / "Aug" - / "Sep" / "Oct" / "Nov" / "Dec" - - time = hour zone ; ANSI and Military - - hour = 2DIGIT ":" 2DIGIT [":" 2DIGIT] - ; 00:00:00 - 23:59:59 - - zone = "UT" / "GMT" ; Universal Time - ; North American : UT - / "EST" / "EDT" ; Eastern: - 5/ - 4 - / "CST" / "CDT" ; Central: - 6/ - 5 - / "MST" / "MDT" ; Mountain: - 7/ - 6 - / "PST" / "PDT" ; Pacific: - 8/ - 7 - / 1ALPHA ; Military: Z = UT; - ; A:-1; (J not used) - ; M:-12; N:+1; Y:+12 - / ( ("+" / "-") 4DIGIT ) ; Local differential - ; hours+min. (HHMM) - - 5.2. SEMANTICS - - If included, day-of-week must be the day implied by the date - specification. - - Time zone may be indicated in several ways. "UT" is Univer- - sal Time (formerly called "Greenwich Mean Time"); "GMT" is per- - mitted as a reference to Universal Time. The military standard - uses a single character for each zone. "Z" is Universal Time. - "A" indicates one hour earlier, and "M" indicates 12 hours ear- - lier; "N" is one hour later, and "Y" is 12 hours later. The - letter "J" is not used. The other remaining two forms are taken - from ANSI standard X3.51-1975. One allows explicit indication of - the amount of offset from UT; the other uses common 3-character - strings for indicating time zones in North America. - - - August 13, 1982 - 26 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - 6. ADDRESS SPECIFICATION - - 6.1. SYNTAX - - address = mailbox ; one addressee - / group ; named list - - group = phrase ":" [#mailbox] ";" - - mailbox = addr-spec ; simple address - / phrase route-addr ; name & addr-spec - - route-addr = "<" [route] addr-spec ">" - - route = 1#("@" domain) ":" ; path-relative - - addr-spec = local-part "@" domain ; global address - - local-part = word *("." word) ; uninterpreted - ; case-preserved - - domain = sub-domain *("." sub-domain) - - sub-domain = domain-ref / domain-literal - - domain-ref = atom ; symbolic reference - - 6.2. SEMANTICS - - A mailbox receives mail. It is a conceptual entity which - does not necessarily pertain to file storage. For example, some - sites may choose to print mail on their line printer and deliver - the output to the addressee's desk. - - A mailbox specification comprises a person, system or pro- - cess name reference, a domain-dependent string, and a name-domain - reference. The name reference is optional and is usually used to - indicate the human name of a recipient. The name-domain refer- - ence specifies a sequence of sub-domains. The domain-dependent - string is uninterpreted, except by the final sub-domain; the rest - of the mail service merely transmits it as a literal string. - - 6.2.1. DOMAINS - - A name-domain is a set of registered (mail) names. A name- - domain specification resolves to a subordinate name-domain - specification or to a terminal domain-dependent string. - Hence, domain specification is extensible, permitting any - number of registration levels. - - - August 13, 1982 - 27 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - Name-domains model a global, logical, hierarchical addressing - scheme. The model is logical, in that an address specifica- - tion is related to name registration and is not necessarily - tied to transmission path. The model's hierarchy is a - directed graph, called an in-tree, such that there is a single - path from the root of the tree to any node in the hierarchy. - If more than one path actually exists, they are considered to - be different addresses. - - The root node is common to all addresses; consequently, it is - not referenced. Its children constitute "top-level" name- - domains. Usually, a service has access to its own full domain - specification and to the names of all top-level name-domains. - - The "top" of the domain addressing hierarchy -- a child of the - root -- is indicated by the right-most field, in a domain - specification. Its child is specified to the left, its child - to the left, and so on. - - Some groups provide formal registration services; these con- - stitute name-domains that are independent logically of - specific machines. In addition, networks and machines impli- - citly compose name-domains, since their membership usually is - registered in name tables. - - In the case of formal registration, an organization implements - a (distributed) data base which provides an address-to-route - mapping service for addresses of the form: - - person@registry.organization - - Note that "organization" is a logical entity, separate from - any particular communication network. - - A mechanism for accessing "organization" is universally avail- - able. That mechanism, in turn, seeks an instantiation of the - registry; its location is not indicated in the address specif- - ication. It is assumed that the system which operates under - the name "organization" knows how to find a subordinate regis- - try. The registry will then use the "person" string to deter- - mine where to send the mail specification. - - The latter, network-oriented case permits simple, direct, - attachment-related address specification, such as: - - user@host.network - - Once the network is accessed, it is expected that a message - will go directly to the host and that the host will resolve - - - August 13, 1982 - 28 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - the user name, placing the message in the user's mailbox. - - 6.2.2. ABBREVIATED DOMAIN SPECIFICATION - - Since any number of levels is possible within the domain - hierarchy, specification of a fully qualified address can - become inconvenient. This standard permits abbreviated domain - specification, in a special case: - - For the address of the sender, call the left-most - sub-domain Level N. In a header address, if all of - the sub-domains above (i.e., to the right of) Level N - are the same as those of the sender, then they do not - have to appear in the specification. Otherwise, the - address must be fully qualified. - - This feature is subject to approval by local sub- - domains. Individual sub-domains may require their - member systems, which originate mail, to provide full - domain specification only. When permitted, abbrevia- - tions may be present only while the message stays - within the sub-domain of the sender. - - Use of this mechanism requires the sender's sub-domain - to reserve the names of all top-level domains, so that - full specifications can be distinguished from abbrevi- - ated specifications. - - For example, if a sender's address is: - - sender@registry-A.registry-1.organization-X - - and one recipient's address is: - - recipient@registry-B.registry-1.organization-X - - and another's is: - - recipient@registry-C.registry-2.organization-X - - then ".registry-1.organization-X" need not be specified in the - the message, but "registry-C.registry-2" DOES have to be - specified. That is, the first two addresses may be abbrevi- - ated, but the third address must be fully specified. - - When a message crosses a domain boundary, all addresses must - be specified in the full format, ending with the top-level - name-domain in the right-most field. It is the responsibility - of mail forwarding services to ensure that addresses conform - - - August 13, 1982 - 29 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - with this requirement. In the case of abbreviated addresses, - the relaying service must make the necessary expansions. It - should be noted that it often is difficult for such a service - to locate all occurrences of address abbreviations. For exam- - ple, it will not be possible to find such abbreviations within - the body of the message. The "Return-Path" field can aid - recipients in recovering from these errors. - - Note: When passing any portion of an addr-spec onto a process - which does not interpret data according to this stan- - dard (e.g., mail protocol servers). There must be NO - LWSP-chars preceding or following the at-sign or any - delimiting period ("."), such as shown in the above - examples, and only ONE SPACE between contiguous - s. - - 6.2.3. DOMAIN TERMS - - A domain-ref must be THE official name of a registry, network, - or host. It is a symbolic reference, within a name sub- - domain. At times, it is necessary to bypass standard mechan- - isms for resolving such references, using more primitive - information, such as a network host address rather than its - associated host name. - - To permit such references, this standard provides the domain- - literal construct. Its contents must conform with the needs - of the sub-domain in which it is interpreted. - - Domain-literals which refer to domains within the ARPA Inter- - net specify 32-bit Internet addresses, in four 8-bit fields - noted in decimal, as described in Request for Comments #820, - "Assigned Numbers." For example: - - [10.0.3.19] - - Note: THE USE OF DOMAIN-LITERALS IS STRONGLY DISCOURAGED. It - is permitted only as a means of bypassing temporary - system limitations, such as name tables which are not - complete. - - The names of "top-level" domains, and the names of domains - under in the ARPA Internet, are registered with the Network - Information Center, SRI International, Menlo Park, California. - - 6.2.4. DOMAIN-DEPENDENT LOCAL STRING - - The local-part of an addr-spec in a mailbox specification - (i.e., the host's name for the mailbox) is understood to be - - - August 13, 1982 - 30 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - whatever the receiving mail protocol server allows. For exam- - ple, some systems do not understand mailbox references of the - form "P. D. Q. Bach", but others do. - - This specification treats periods (".") as lexical separators. - Hence, their presence in local-parts which are not quoted- - strings, is detected. However, such occurrences carry NO - semantics. That is, if a local-part has periods within it, an - address parser will divide the local-part into several tokens, - but the sequence of tokens will be treated as one uninter- - preted unit. The sequence will be re-assembled, when the - address is passed outside of the system such as to a mail pro- - tocol service. - - For example, the address: - - First.Last@Registry.Org - - is legal and does not require the local-part to be surrounded - with quotation-marks. (However, "First Last" DOES require - quoting.) The local-part of the address, when passed outside - of the mail system, within the Registry.Org domain, is - "First.Last", again without quotation marks. - - 6.2.5. BALANCING LOCAL-PART AND DOMAIN - - In some cases, the boundary between local-part and domain can - be flexible. The local-part may be a simple string, which is - used for the final determination of the recipient's mailbox. - All other levels of reference are, therefore, part of the - domain. - - For some systems, in the case of abbreviated reference to the - local and subordinate sub-domains, it may be possible to - specify only one reference within the domain part and place - the other, subordinate name-domain references within the - local-part. This would appear as: - - mailbox.sub1.sub2@this-domain - - Such a specification would be acceptable to address parsers - which conform to RFC #733, but do not support this newer - Internet standard. While contrary to the intent of this stan- - dard, the form is legal. - - Also, some sub-domains have a specification syntax which does - not conform to this standard. For example: - - sub-net.mailbox@sub-domain.domain - - - August 13, 1982 - 31 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - uses a different parsing sequence for local-part than for - domain. - - Note: As a rule, the domain specification should contain - fields which are encoded according to the syntax of - this standard and which contain generally-standardized - information. The local-part specification should con- - tain only that portion of the address which deviates - from the form or intention of the domain field. - - 6.2.6. MULTIPLE MAILBOXES - - An individual may have several mailboxes and wish to receive - mail at whatever mailbox is convenient for the sender to - access. This standard does not provide a means of specifying - "any member of" a list of mailboxes. - - A set of individuals may wish to receive mail as a single unit - (i.e., a distribution list). The construct permits - specification of such a list. Recipient mailboxes are speci- - fied within the bracketed part (":" - ";"). A copy of the - transmitted message is to be sent to each mailbox listed. - This standard does not permit recursive specification of - groups within groups. - - While a list must be named, it is not required that the con- - tents of the list be included. In this case, the
- serves only as an indication of group distribution and would - appear in the form: - - name:; - - Some mail services may provide a group-list distribution - facility, accepting a single mailbox reference, expanding it - to the full distribution list, and relaying the mail to the - list's members. This standard provides no additional syntax - for indicating such a service. Using the address - alternative, while listing one mailbox in it, can mean either - that the mailbox reference will be expanded to a list or that - there is a group with one member. - - 6.2.7. EXPLICIT PATH SPECIFICATION - - At times, a message originator may wish to indicate the - transmission path that a message should follow. This is - called source routing. The normal addressing scheme, used in - an addr-spec, is carefully separated from such information; - the portion of a route-addr is provided for such occa- - sions. It specifies the sequence of hosts and/or transmission - - - August 13, 1982 - 32 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - services that are to be traversed. Both domain-refs and - domain-literals may be used. - - Note: The use of source routing is discouraged. Unless the - sender has special need of path restriction, the choice - of transmission route should be left to the mail tran- - sport service. - - 6.3. RESERVED ADDRESS - - It often is necessary to send mail to a site, without know- - ing any of its valid addresses. For example, there may be mail - system dysfunctions, or a user may wish to find out a person's - correct address, at that site. - - This standard specifies a single, reserved mailbox address - (local-part) which is to be valid at each site. Mail sent to - that address is to be routed to a person responsible for the - site's mail system or to a person with responsibility for general - site operation. The name of the reserved local-part address is: - - Postmaster - - so that "Postmaster@domain" is required to be valid. - - Note: This reserved local-part must be matched without sensi- - tivity to alphabetic case, so that "POSTMASTER", "postmas- - ter", and even "poStmASteR" is to be accepted. - - - - - - - - - - - - - - - - - - - - - - - - August 13, 1982 - 33 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - 7. BIBLIOGRAPHY - - - ANSI. "USA Standard Code for Information Interchange," X3.4. - American National Standards Institute: New York (1968). Also - in: Feinler, E. and J. Postel, eds., "ARPANET Protocol Hand- - book", NIC 7104. - - ANSI. "Representations of Universal Time, Local Time Differen- - tials, and United States Time Zone References for Information - Interchange," X3.51-1975. American National Standards Insti- - tute: New York (1975). - - Bemer, R.W., "Time and the Computer." In: Interface Age (Feb. - 1979). - - Bennett, C.J. "JNT Mail Protocol". Joint Network Team, Ruther- - ford and Appleton Laboratory: Didcot, England. - - Bhushan, A.K., Pogran, K.T., Tomlinson, R.S., and White, J.E. - "Standardizing Network Mail Headers," ARPANET Request for - Comments No. 561, Network Information Center No. 18516; SRI - International: Menlo Park (September 1973). - - Birrell, A.D., Levin, R., Needham, R.M., and Schroeder, M.D. - "Grapevine: An Exercise in Distributed Computing," Communica- - tions of the ACM 25, 4 (April 1982), 260-274. - - Crocker, D.H., Vittal, J.J., Pogran, K.T., Henderson, D.A. - "Standard for the Format of ARPA Network Text Message," - ARPANET Request for Comments No. 733, Network Information - Center No. 41952. SRI International: Menlo Park (November - 1977). - - Feinler, E.J. and Postel, J.B. ARPANET Protocol Handbook, Net- - work Information Center No. 7104 (NTIS AD A003890). SRI - International: Menlo Park (April 1976). - - Harary, F. "Graph Theory". Addison-Wesley: Reading, Mass. - (1969). - - Levin, R. and Schroeder, M. "Transport of Electronic Messages - through a Network," TeleInformatics 79, pp. 29-33. North - Holland (1979). Also as Xerox Palo Alto Research Center - Technical Report CSL-79-4. - - Myer, T.H. and Henderson, D.A. "Message Transmission Protocol," - ARPANET Request for Comments, No. 680, Network Information - Center No. 32116. SRI International: Menlo Park (1975). - - - August 13, 1982 - 34 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - NBS. "Specification of Message Format for Computer Based Message - Systems, Recommended Federal Information Processing Standard." - National Bureau of Standards: Gaithersburg, Maryland - (October 1981). - - NIC. Internet Protocol Transition Workbook. Network Information - Center, SRI-International, Menlo Park, California (March - 1982). - - Oppen, D.C. and Dalal, Y.K. "The Clearinghouse: A Decentralized - Agent for Locating Named Objects in a Distributed Environ- - ment," OPD-T8103. Xerox Office Products Division: Palo Alto, - CA. (October 1981). - - Postel, J.B. "Assigned Numbers," ARPANET Request for Comments, - No. 820. SRI International: Menlo Park (August 1982). - - Postel, J.B. "Simple Mail Transfer Protocol," ARPANET Request - for Comments, No. 821. SRI International: Menlo Park (August - 1982). - - Shoch, J.F. "Internetwork naming, addressing and routing," in - Proc. 17th IEEE Computer Society International Conference, pp. - 72-79, Sept. 1978, IEEE Cat. No. 78 CH 1388-8C. - - Su, Z. and Postel, J. "The Domain Naming Convention for Internet - User Applications," ARPANET Request for Comments, No. 819. - SRI International: Menlo Park (August 1982). - - - - - - - - - - - - - - - - - - - - - - - - August 13, 1982 - 35 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - APPENDIX - - - A. EXAMPLES - - A.1. ADDRESSES - - A.1.1. Alfred Neuman - - A.1.2. Neuman@BBN-TENEXA - - These two "Alfred Neuman" examples have identical seman- - tics, as far as the operation of the local host's mail sending - (distribution) program (also sometimes called its "mailer") - and the remote host's mail protocol server are concerned. In - the first example, the "Alfred Neuman" is ignored by the - mailer, as "Neuman@BBN-TENEXA" completely specifies the reci- - pient. The second example contains no superfluous informa- - tion, and, again, "Neuman@BBN-TENEXA" is the intended reci- - pient. - - Note: When the message crosses name-domain boundaries, then - these specifications must be changed, so as to indicate - the remainder of the hierarchy, starting with the top - level. - - A.1.3. "George, Ted" - - This form might be used to indicate that a single mailbox - is shared by several users. The quoted string is ignored by - the originating host's mailer, because "Shared@Group.Arpanet" - completely specifies the destination mailbox. - - A.1.4. Wilt . (the Stilt) Chamberlain@NBA.US - - The "(the Stilt)" is a comment, which is NOT included in - the destination mailbox address handed to the originating - system's mailer. The local-part of the address is the string - "Wilt.Chamberlain", with NO space between the first and second - words. - - A.1.5. Address Lists - - Gourmets: Pompous Person , - Childs@WGBH.Boston, Galloping Gourmet@ - ANT.Down-Under (Australian National Television), - Cheapie@Discount-Liquors;, - Cruisers: Port@Portugal, Jones@SEA;, - Another@Somewhere.SomeOrg - - - August 13, 1982 - 36 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - This group list example points out the use of comments and the - mixing of addresses and groups. - - A.2. ORIGINATOR ITEMS - - A.2.1. Author-sent - - George Jones logs into his host as "Jones". He sends - mail himself. - - From: Jones@Group.Org - - or - - From: George Jones - - A.2.2. Secretary-sent - - George Jones logs in as Jones on his host. His secre- - tary, who logs in as Secy sends mail for him. Replies to the - mail should go to George. - - From: George Jones - Sender: Secy@Other-Group - - A.2.3. Secretary-sent, for user of shared directory - - George Jones' secretary sends mail for George. Replies - should go to George. - - From: George Jones - Sender: Secy@Other-Group - - Note that there need not be a space between "Jones" and the - "<", but adding a space enhances readability (as is the case - in other examples. - - A.2.4. Committee activity, with one author - - George is a member of a committee. He wishes to have any - replies to his message go to all committee members. - - From: George Jones - Sender: Jones@Host - Reply-To: The Committee: Jones@Host.Net, - Smith@Other.Org, - Doe@Somewhere-Else; - - Note that if George had not included himself in the - - - August 13, 1982 - 37 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - enumeration of The Committee, he would not have gotten an - implicit reply; the presence of the "Reply-to" field SUPER- - SEDES the sending of a reply to the person named in the "From" - field. - - A.2.5. Secretary acting as full agent of author - - George Jones asks his secretary (Secy@Host) to send a - message for him in his capacity as Group. He wants his secre- - tary to handle all replies. - - From: George Jones - Sender: Secy@Host - Reply-To: Secy@Host - - A.2.6. Agent for user without online mailbox - - A friend of George's, Sarah, is visiting. George's - secretary sends some mail to a friend of Sarah in computer- - land. Replies should go to George, whose mailbox is Jones at - Registry. - - From: Sarah Friendly - Sender: Secy-Name - Reply-To: Jones@Registry. - - A.2.7. Agent for member of a committee - - George's secretary sends out a message which was authored - jointly by all the members of a committee. Note that the name - of the committee cannot be specified, since names are - not permitted in the From field. - - From: Jones@Host, - Smith@Other-Host, - Doe@Somewhere-Else - Sender: Secy@SHost - - - - - - - - - - - - - - - August 13, 1982 - 38 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - A.3. COMPLETE HEADERS - - A.3.1. Minimum required - - Date: 26 Aug 76 1429 EDT Date: 26 Aug 76 1429 EDT - From: Jones@Registry.Org or From: Jones@Registry.Org - Bcc: To: Smith@Registry.Org - - Note that the "Bcc" field may be empty, while the "To" field - is required to have at least one address. - - A.3.2. Using some of the additional fields - - Date: 26 Aug 76 1430 EDT - From: George Jones - Sender: Secy@SHOST - To: "Al Neuman"@Mad-Host, - Sam.Irving@Other-Host - Message-ID: - - A.3.3. About as complex as you're going to get - - Date : 27 Aug 76 0932 PDT - From : Ken Davis - Subject : Re: The Syntax in the RFC - Sender : KSecy@Other-Host - Reply-To : Sam.Irving@Reg.Organization - To : George Jones , - Al.Neuman@MAD.Publisher - cc : Important folk: - Tom Softwood , - "Sam Irving"@Other-Host;, - Standard Distribution: - /main/davis/people/standard@Other-Host, - "standard.dist.3"@Tops-20-Host>; - Comment : Sam is away on business. He asked me to handle - his mail for him. He'll be able to provide a - more accurate explanation when he returns - next week. - In-Reply-To: , George's message - X-Special-action: This is a sample of user-defined field- - names. There could also be a field-name - "Special-action", but its name might later be - preempted - Message-ID: <4231.629.XYzi-What@Other-Host> - - - - - - - August 13, 1982 - 39 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - B. SIMPLE FIELD PARSING - - Some mail-reading software systems may wish to perform only - minimal processing, ignoring the internal syntax of structured - field-bodies and treating them the same as unstructured-field- - bodies. Such software will need only to distinguish: - - o Header fields from the message body, - - o Beginnings of fields from lines which continue fields, - - o Field-names from field-contents. - - The abbreviated set of syntactic rules which follows will - suffice for this purpose. It describes a limited view of mes- - sages and is a subset of the syntactic rules provided in the main - part of this specification. One small exception is that the con- - tents of field-bodies consist only of text: - - B.1. SYNTAX - - - message = *field *(CRLF *text) - - field = field-name ":" [field-body] CRLF - - field-name = 1* - - field-body = *text [CRLF LWSP-char field-body] - - - B.2. SEMANTICS - - Headers occur before the message body and are terminated by - a null line (i.e., two contiguous CRLFs). - - A line which continues a header field begins with a SPACE or - HTAB character, while a line beginning a field starts with a - printable character which is not a colon. - - A field-name consists of one or more printable characters - (excluding colon, space, and control-characters). A field-name - MUST be contained on one line. Upper and lower case are not dis- - tinguished when comparing field-names. - - - - - - - - August 13, 1982 - 40 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - C. DIFFERENCES FROM RFC #733 - - The following summarizes the differences between this stan- - dard and the one specified in Arpanet Request for Comments #733, - "Standard for the Format of ARPA Network Text Messages". The - differences are listed in the order of their occurrence in the - current specification. - - C.1. FIELD DEFINITIONS - - C.1.1. FIELD NAMES - - These now must be a sequence of printable characters. They - may not contain any LWSP-chars. - - C.2. LEXICAL TOKENS - - C.2.1. SPECIALS - - The characters period ("."), left-square bracket ("["), and - right-square bracket ("]") have been added. For presentation - purposes, and when passing a specification to a system that - does not conform to this standard, periods are to be contigu- - ous with their surrounding lexical tokens. No linear-white- - space is permitted between them. The presence of one LWSP- - char between other tokens is still directed. - - C.2.2. ATOM - - Atoms may not contain SPACE. - - C.2.3. SPECIAL TEXT - - ctext and qtext have had backslash ("\") added to the list of - prohibited characters. - - C.2.4. DOMAINS - - The lexical tokens and have been - added. - - C.3. MESSAGE SPECIFICATION - - C.3.1. TRACE - - The "Return-path:" and "Received:" fields have been specified. - - - - - - August 13, 1982 - 41 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - C.3.2. FROM - - The "From" field must contain machine-usable addresses (addr- - spec). Multiple addresses may be specified, but named-lists - (groups) may not. - - C.3.3. RESENT - - The meta-construct of prefacing field names with the string - "Resent-" has been added, to indicate that a message has been - forwarded by an intermediate recipient. - - C.3.4. DESTINATION - - A message must contain at least one destination address field. - "To" and "CC" are required to contain at least one address. - - C.3.5. IN-REPLY-TO - - The field-body is no longer a comma-separated list, although a - sequence is still permitted. - - C.3.6. REFERENCE - - The field-body is no longer a comma-separated list, although a - sequence is still permitted. - - C.3.7. ENCRYPTED - - A field has been specified that permits senders to indicate - that the body of a message has been encrypted. - - C.3.8. EXTENSION-FIELD - - Extension fields are prohibited from beginning with the char- - acters "X-". - - C.4. DATE AND TIME SPECIFICATION - - C.4.1. SIMPLIFICATION - - Fewer optional forms are permitted and the list of three- - letter time zones has been shortened. - - C.5. ADDRESS SPECIFICATION - - - - - - - August 13, 1982 - 42 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - C.5.1. ADDRESS - - The use of quoted-string, and the ":"-atom-":" construct, have - been removed. An address now is either a single mailbox - reference or is a named list of addresses. The latter indi- - cates a group distribution. - - C.5.2. GROUPS - - Group lists are now required to to have a name. Group lists - may not be nested. - - C.5.3. MAILBOX - - A mailbox specification may indicate a person's name, as - before. Such a named list no longer may specify multiple - mailboxes and may not be nested. - - C.5.4. ROUTE ADDRESSING - - Addresses now are taken to be absolute, global specifications, - independent of transmission paths. The construct has - been provided, to permit explicit specification of transmis- - sion path. RFC #733's use of multiple at-signs ("@") was - intended as a general syntax for indicating routing and/or - hierarchical addressing. The current standard separates these - specifications and only one at-sign is permitted. - - C.5.5. AT-SIGN - - The string " at " no longer is used as an address delimiter. - Only at-sign ("@") serves the function. - - C.5.6. DOMAINS - - Hierarchical, logical name-domains have been added. - - C.6. RESERVED ADDRESS - - The local-part "Postmaster" has been reserved, so that users can - be guaranteed at least one valid address at a site. - - - - - - - - - - - August 13, 1982 - 43 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - D. ALPHABETICAL LISTING OF SYNTAX RULES - - address = mailbox ; one addressee - / group ; named list - addr-spec = local-part "@" domain ; global address - ALPHA = - ; (101-132, 65.- 90.) - ; (141-172, 97.-122.) - atom = 1* - authentic = "From" ":" mailbox ; Single author - / ( "Sender" ":" mailbox ; Actual submittor - "From" ":" 1#mailbox) ; Multiple authors - ; or not sender - CHAR = ; ( 0-177, 0.-127.) - comment = "(" *(ctext / quoted-pair / comment) ")" - CR = ; ( 15, 13.) - CRLF = CR LF - ctext = may be folded - ")", "\" & CR, & including - linear-white-space> - CTL = ; ( 177, 127.) - date = 1*2DIGIT month 2DIGIT ; day month year - ; e.g. 20 Jun 82 - dates = orig-date ; Original - [ resent-date ] ; Forwarded - date-time = [ day "," ] date time ; dd mm yy - ; hh:mm:ss zzz - day = "Mon" / "Tue" / "Wed" / "Thu" - / "Fri" / "Sat" / "Sun" - delimiters = specials / linear-white-space / comment - destination = "To" ":" 1#address ; Primary - / "Resent-To" ":" 1#address - / "cc" ":" 1#address ; Secondary - / "Resent-cc" ":" 1#address - / "bcc" ":" #address ; Blind carbon - / "Resent-bcc" ":" #address - DIGIT = ; ( 60- 71, 48.- 57.) - domain = sub-domain *("." sub-domain) - domain-literal = "[" *(dtext / quoted-pair) "]" - domain-ref = atom ; symbolic reference - dtext = may be folded - "]", "\" & CR, & including - linear-white-space> - extension-field = - - - - August 13, 1982 - 44 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - field = field-name ":" [ field-body ] CRLF - fields = dates ; Creation time, - source ; author id & one - 1*destination ; address required - *optional-field ; others optional - field-body = field-body-contents - [CRLF LWSP-char field-body] - field-body-contents = - - field-name = 1* - group = phrase ":" [#mailbox] ";" - hour = 2DIGIT ":" 2DIGIT [":" 2DIGIT] - ; 00:00:00 - 23:59:59 - HTAB = ; ( 11, 9.) - LF = ; ( 12, 10.) - linear-white-space = 1*([CRLF] LWSP-char) ; semantics = SPACE - ; CRLF => folding - local-part = word *("." word) ; uninterpreted - ; case-preserved - LWSP-char = SPACE / HTAB ; semantics = SPACE - mailbox = addr-spec ; simple address - / phrase route-addr ; name & addr-spec - message = fields *( CRLF *text ) ; Everything after - ; first null line - ; is message body - month = "Jan" / "Feb" / "Mar" / "Apr" - / "May" / "Jun" / "Jul" / "Aug" - / "Sep" / "Oct" / "Nov" / "Dec" - msg-id = "<" addr-spec ">" ; Unique message id - optional-field = - / "Message-ID" ":" msg-id - / "Resent-Message-ID" ":" msg-id - / "In-Reply-To" ":" *(phrase / msg-id) - / "References" ":" *(phrase / msg-id) - / "Keywords" ":" #phrase - / "Subject" ":" *text - / "Comments" ":" *text - / "Encrypted" ":" 1#2word - / extension-field ; To be defined - / user-defined-field ; May be pre-empted - orig-date = "Date" ":" date-time - originator = authentic ; authenticated addr - [ "Reply-To" ":" 1#address] ) - phrase = 1*word ; Sequence of words - - - - - August 13, 1982 - 45 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - qtext = , ; => may be folded - "\" & CR, and including - linear-white-space> - quoted-pair = "\" CHAR ; may quote any char - quoted-string = <"> *(qtext/quoted-pair) <">; Regular qtext or - ; quoted chars. - received = "Received" ":" ; one per relay - ["from" domain] ; sending host - ["by" domain] ; receiving host - ["via" atom] ; physical path - *("with" atom) ; link/mail protocol - ["id" msg-id] ; receiver msg id - ["for" addr-spec] ; initial form - ";" date-time ; time received - - resent = resent-authentic - [ "Resent-Reply-To" ":" 1#address] ) - resent-authentic = - = "Resent-From" ":" mailbox - / ( "Resent-Sender" ":" mailbox - "Resent-From" ":" 1#mailbox ) - resent-date = "Resent-Date" ":" date-time - return = "Return-path" ":" route-addr ; return address - route = 1#("@" domain) ":" ; path-relative - route-addr = "<" [route] addr-spec ">" - source = [ trace ] ; net traversals - originator ; original mail - [ resent ] ; forwarded - SPACE = ; ( 40, 32.) - specials = "(" / ")" / "<" / ">" / "@" ; Must be in quoted- - / "," / ";" / ":" / "\" / <"> ; string, to use - / "." / "[" / "]" ; within a word. - sub-domain = domain-ref / domain-literal - text = atoms, specials, - CR & bare LF, but NOT ; comments and - including CRLF> ; quoted-strings are - ; NOT recognized. - time = hour zone ; ANSI and Military - trace = return ; path to sender - 1*received ; receipt tags - user-defined-field = - - word = atom / quoted-string - - - - - August 13, 1982 - 46 - RFC #822 - - - - Standard for ARPA Internet Text Messages - - - zone = "UT" / "GMT" ; Universal Time - ; North American : UT - / "EST" / "EDT" ; Eastern: - 5/ - 4 - / "CST" / "CDT" ; Central: - 6/ - 5 - / "MST" / "MDT" ; Mountain: - 7/ - 6 - / "PST" / "PDT" ; Pacific: - 8/ - 7 - / 1ALPHA ; Military: Z = UT; - <"> = ; ( 42, 34.) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - August 13, 1982 - 47 - RFC #822 - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc1341.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc1341.txt deleted file mode 100644 index 1be6f7d..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc1341.txt +++ /dev/null @@ -1,5265 +0,0 @@ - - - - - - - Network Working Group N. Borenstein, Bellcore - Request for Comments: 1341 N. Freed, Innosoft - June 1992 - - - - MIME (Multipurpose Internet Mail Extensions): - - - Mechanisms for Specifying and Describing - the Format of Internet Message Bodies - - - Status of this Memo - - This RFC specifies an IAB standards track protocol for the - Internet community, and requests discussion and suggestions - for improvements. Please refer to the current edition of - the "IAB Official Protocol Standards" for the - standardization state and status of this protocol. - Distribution of this memo is unlimited. - - Abstract - - RFC 822 defines a message representation protocol which - specifies considerable detail about message headers, but - which leaves the message content, or message body, as flat - ASCII text. This document redefines the format of message - bodies to allow multi-part textual and non-textual message - bodies to be represented and exchanged without loss of - information. This is based on earlier work documented in - RFC 934 and RFC 1049, but extends and revises that work. - Because RFC 822 said so little about message bodies, this - document is largely orthogonal to (rather than a revision - of) RFC 822. - - In particular, this document is designed to provide - facilities to include multiple objects in a single message, - to represent body text in character sets other than US- - ASCII, to represent formatted multi-font text messages, to - represent non-textual material such as images and audio - fragments, and generally to facilitate later extensions - defining new types of Internet mail for use by cooperating - mail agents. - - This document does NOT extend Internet mail header fields to - permit anything other than US-ASCII text data. It is - recognized that such extensions are necessary, and they are - the subject of a companion document [RFC -1342]. - - A table of contents appears at the end of this document. - - - - - - - Borenstein & Freed [Page i] - - - - - - - - 1 Introduction - - Since its publication in 1982, RFC 822 [RFC-822] has defined - the standard format of textual mail messages on the - Internet. Its success has been such that the RFC 822 format - has been adopted, wholly or partially, well beyond the - confines of the Internet and the Internet SMTP transport - defined by RFC 821 [RFC-821]. As the format has seen wider - use, a number of limitations have proven increasingly - restrictive for the user community. - - RFC 822 was intended to specify a format for text messages. - As such, non-text messages, such as multimedia messages that - might include audio or images, are simply not mentioned. - Even in the case of text, however, RFC 822 is inadequate for - the needs of mail users whose languages require the use of - character sets richer than US ASCII [US-ASCII]. Since RFC - 822 does not specify mechanisms for mail containing audio, - video, Asian language text, or even text in most European - languages, additional specifications are needed - - One of the notable limitations of RFC 821/822 based mail - systems is the fact that they limit the contents of - electronic mail messages to relatively short lines of - seven-bit ASCII. This forces users to convert any non- - textual data that they may wish to send into seven-bit bytes - representable as printable ASCII characters before invoking - a local mail UA (User Agent, a program with which human - users send and receive mail). Examples of such encodings - currently used in the Internet include pure hexadecimal, - uuencode, the 3-in-4 base 64 scheme specified in RFC 1113, - the Andrew Toolkit Representation [ATK], and many others. - - The limitations of RFC 822 mail become even more apparent as - gateways are designed to allow for the exchange of mail - messages between RFC 822 hosts and X.400 hosts. X.400 [X400] - specifies mechanisms for the inclusion of non-textual body - parts within electronic mail messages. The current - standards for the mapping of X.400 messages to RFC 822 - messages specify that either X.400 non-textual body parts - should be converted to (not encoded in) an ASCII format, or - that they should be discarded, notifying the RFC 822 user - that discarding has occurred. This is clearly undesirable, - as information that a user may wish to receive is lost. - Even though a user's UA may not have the capability of - dealing with the non-textual body part, the user might have - some mechanism external to the UA that can extract useful - information from the body part. Moreover, it does not allow - for the fact that the message may eventually be gatewayed - back into an X.400 message handling system (i.e., the X.400 - message is "tunneled" through Internet mail), where the - non-textual information would definitely become useful - again. - - - - - Borenstein & Freed [Page 1] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - This document describes several mechanisms that combine to - solve most of these problems without introducing any serious - incompatibilities with the existing world of RFC 822 mail. - In particular, it describes: - - 1. A MIME-Version header field, which uses a version number - to declare a message to be conformant with this - specification and allows mail processing agents to - distinguish between such messages and those generated - by older or non-conformant software, which is presumed - to lack such a field. - - 2. A Content-Type header field, generalized from RFC 1049 - [RFC-1049], which can be used to specify the type and - subtype of data in the body of a message and to fully - specify the native representation (encoding) of such - data. - - 2.a. A "text" Content-Type value, which can be used to - represent textual information in a number of - character sets and formatted text description - languages in a standardized manner. - - 2.b. A "multipart" Content-Type value, which can be - used to combine several body parts, possibly of - differing types of data, into a single message. - - 2.c. An "application" Content-Type value, which can be - used to transmit application data or binary data, - and hence, among other uses, to implement an - electronic mail file transfer service. - - 2.d. A "message" Content-Type value, for encapsulating - a mail message. - - 2.e An "image" Content-Type value, for transmitting - still image (picture) data. - - 2.f. An "audio" Content-Type value, for transmitting - audio or voice data. - - 2.g. A "video" Content-Type value, for transmitting - video or moving image data, possibly with audio as - part of the composite video data format. - - 3. A Content-Transfer-Encoding header field, which can be - used to specify an auxiliary encoding that was applied - to the data in order to allow it to pass through mail - transport mechanisms which may have data or character - set limitations. - - 4. Two optional header fields that can be used to further - describe the data in a message body, the Content-ID and - Content-Description header fields. - - - - Borenstein & Freed [Page 2] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - MIME has been carefully designed as an extensible mechanism, - and it is expected that the set of content-type/subtype - pairs and their associated parameters will grow - significantly with time. Several other MIME fields, notably - including character set names, are likely to have new values - defined over time. In order to ensure that the set of such - values is developed in an orderly, well-specified, and - public manner, MIME defines a registration process which - uses the Internet Assigned Numbers Authority (IANA) as a - central registry for such values. Appendix F provides - details about how IANA registration is accomplished. - - Finally, to specify and promote interoperability, Appendix A - of this document provides a basic applicability statement - for a subset of the above mechanisms that defines a minimal - level of "conformance" with this document. - - HISTORICAL NOTE: Several of the mechanisms described in - this document may seem somewhat strange or even baroque at - first reading. It is important to note that compatibility - with existing standards AND robustness across existing - practice were two of the highest priorities of the working - group that developed this document. In particular, - compatibility was always favored over elegance. - - 2 Notations, Conventions, and Generic BNF Grammar - - This document is being published in two versions, one as - plain ASCII text and one as PostScript. The latter is - recommended, though the textual contents are identical. An - Andrew-format copy of this document is also available from - the first author (Borenstein). - - Although the mechanisms specified in this document are all - described in prose, most are also described formally in the - modified BNF notation of RFC 822. Implementors will need to - be familiar with this notation in order to understand this - specification, and are referred to RFC 822 for a complete - explanation of the modified BNF notation. - - Some of the modified BNF in this document makes reference to - syntactic entities that are defined in RFC 822 and not in - this document. A complete formal grammar, then, is obtained - by combining the collected grammar appendix of this document - with that of RFC 822. - - The term CRLF, in this document, refers to the sequence of - the two ASCII characters CR (13) and LF (10) which, taken - together, in this order, denote a line break in RFC 822 - mail. - - The term "character set", wherever it is used in this - document, refers to a coded character set, in the sense of - ISO character set standardization work, and must not be - - - - Borenstein & Freed [Page 3] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - misinterpreted as meaning "a set of characters." - - The term "message", when not further qualified, means either - the (complete or "top-level") message being transferred on a - network, or a message encapsulated in a body of type - "message". - - The term "body part", in this document, means one of the - parts of the body of a multipart entity. A body part has a - header and a body, so it makes sense to speak about the body - of a body part. - - The term "entity", in this document, means either a message - or a body part. All kinds of entities share the property - that they have a header and a body. - - The term "body", when not further qualified, means the body - of an entity, that is the body of either a message or of a - body part. - - Note : the previous four definitions are clearly circular. - This is unavoidable, since the overal structure of a MIME - message is indeed recursive. - - In this document, all numeric and octet values are given in - decimal notation. - - It must be noted that Content-Type values, subtypes, and - parameter names as defined in this document are case- - insensitive. However, parameter values are case-sensitive - unless otherwise specified for the specific parameter. - - FORMATTING NOTE: This document has been carefully formatted - for ease of reading. The PostScript version of this - document, in particular, places notes like this one, which - may be skipped by the reader, in a smaller, italicized, - font, and indents it as well. In the text version, only the - indentation is preserved, so if you are reading the text - version of this you might consider using the PostScript - version instead. However, all such notes will be indented - and preceded by "NOTE:" or some similar introduction, even - in the text version. - - The primary purpose of these non-essential notes is to - convey information about the rationale of this document, or - to place this document in the proper historical or - evolutionary context. Such information may be skipped by - those who are focused entirely on building a compliant - implementation, but may be of use to those who wish to - understand why this document is written as it is. - - For ease of recognition, all BNF definitions have been - placed in a fixed-width font in the PostScript version of - this document. - - - - Borenstein & Freed [Page 4] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - 3 The MIME-Version Header Field - - Since RFC 822 was published in 1982, there has really been - only one format standard for Internet messages, and there - has been little perceived need to declare the format - standard in use. This document is an independent document - that complements RFC 822. Although the extensions in this - document have been defined in such a way as to be compatible - with RFC 822, there are still circumstances in which it - might be desirable for a mail-processing agent to know - whether a message was composed with the new standard in - mind. - - Therefore, this document defines a new header field, "MIME- - Version", which is to be used to declare the version of the - Internet message body format standard in use. - - Messages composed in accordance with this document MUST - include such a header field, with the following verbatim - text: - - MIME-Version: 1.0 - - The presence of this header field is an assertion that the - message has been composed in compliance with this document. - - Since it is possible that a future document might extend the - message format standard again, a formal BNF is given for the - content of the MIME-Version field: - - MIME-Version := text - - Thus, future format specifiers, which might replace or - extend "1.0", are (minimally) constrained by the definition - of "text", which appears in RFC 822. - - Note that the MIME-Version header field is required at the - top level of a message. It is not required for each body - part of a multipart entity. It is required for the embedded - headers of a body of type "message" if and only if the - embedded message is itself claimed to be MIME-compliant. - - - - - - - - - - - - - - - - - Borenstein & Freed [Page 5] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - 4 The Content-Type Header Field - - The purpose of the Content-Type field is to describe the - data contained in the body fully enough that the receiving - user agent can pick an appropriate agent or mechanism to - present the data to the user, or otherwise deal with the - data in an appropriate manner. - - HISTORICAL NOTE: The Content-Type header field was first - defined in RFC 1049. RFC 1049 Content-types used a simpler - and less powerful syntax, but one that is largely compatible - with the mechanism given here. - - The Content-Type header field is used to specify the nature - of the data in the body of an entity, by giving type and - subtype identifiers, and by providing auxiliary information - that may be required for certain types. After the type and - subtype names, the remainder of the header field is simply a - set of parameters, specified in an attribute/value notation. - The set of meaningful parameters differs for the different - types. The ordering of parameters is not significant. - Among the defined parameters is a "charset" parameter by - which the character set used in the body may be declared. - Comments are allowed in accordance with RFC 822 rules for - structured header fields. - - In general, the top-level Content-Type is used to declare - the general type of data, while the subtype specifies a - specific format for that type of data. Thus, a Content-Type - of "image/xyz" is enough to tell a user agent that the data - is an image, even if the user agent has no knowledge of the - specific image format "xyz". Such information can be used, - for example, to decide whether or not to show a user the raw - data from an unrecognized subtype -- such an action might be - reasonable for unrecognized subtypes of text, but not for - unrecognized subtypes of image or audio. For this reason, - registered subtypes of audio, image, text, and video, should - not contain embedded information that is really of a - different type. Such compound types should be represented - using the "multipart" or "application" types. - - Parameters are modifiers of the content-subtype, and do not - fundamentally affect the requirements of the host system. - Although most parameters make sense only with certain - content-types, others are "global" in the sense that they - might apply to any subtype. For example, the "boundary" - parameter makes sense only for the "multipart" content-type, - but the "charset" parameter might make sense with several - content-types. - - An initial set of seven Content-Types is defined by this - document. This set of top-level names is intended to be - substantially complete. It is expected that additions to - the larger set of supported types can generally be - - - - Borenstein & Freed [Page 6] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - accomplished by the creation of new subtypes of these - initial types. In the future, more top-level types may be - defined only by an extension to this standard. If another - primary type is to be used for any reason, it must be given - a name starting with "X-" to indicate its non-standard - status and to avoid a potential conflict with a future - official name. - - In the Extended BNF notation of RFC 822, a Content-Type - header field value is defined as follows: - - Content-Type := type "/" subtype *[";" parameter] - - type := "application" / "audio" - / "image" / "message" - / "multipart" / "text" - / "video" / x-token - - x-token := - - subtype := token - - parameter := attribute "=" value - - attribute := token - - value := token / quoted-string - - token := 1* - - tspecials := "(" / ")" / "<" / ">" / "@" ; Must be in - / "," / ";" / ":" / "\" / <"> ; quoted-string, - / "/" / "[" / "]" / "?" / "." ; to use within - / "=" ; parameter values - - Note that the definition of "tspecials" is the same as the - RFC 822 definition of "specials" with the addition of the - three characters "/", "?", and "=". - - Note also that a subtype specification is MANDATORY. There - are no default subtypes. - - The type, subtype, and parameter names are not case - sensitive. For example, TEXT, Text, and TeXt are all - equivalent. Parameter values are normally case sensitive, - but certain parameters are interpreted to be case- - insensitive, depending on the intended use. (For example, - multipart boundaries are case-sensitive, but the "access- - type" for message/External-body is not case-sensitive.) - - Beyond this syntax, the only constraint on the definition of - subtype names is the desire that their uses must not - conflict. That is, it would be undesirable to have two - - - - Borenstein & Freed [Page 7] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - different communities using "Content-Type: - application/foobar" to mean two different things. The - process of defining new content-subtypes, then, is not - intended to be a mechanism for imposing restrictions, but - simply a mechanism for publicizing the usages. There are, - therefore, two acceptable mechanisms for defining new - Content-Type subtypes: - - 1. Private values (starting with "X-") may be - defined bilaterally between two cooperating - agents without outside registration or - standardization. - - 2. New standard values must be documented, - registered with, and approved by IANA, as - described in Appendix F. Where intended for - public use, the formats they refer to must - also be defined by a published specification, - and possibly offered for standardization. - - The seven standard initial predefined Content-Types are - detailed in the bulk of this document. They are: - - text -- textual information. The primary subtype, - "plain", indicates plain (unformatted) text. No - special software is required to get the full - meaning of the text, aside from support for the - indicated character set. Subtypes are to be used - for enriched text in forms where application - software may enhance the appearance of the text, - but such software must not be required in order to - get the general idea of the content. Possible - subtypes thus include any readable word processor - format. A very simple and portable subtype, - richtext, is defined in this document. - multipart -- data consisting of multiple parts of - independent data types. Four initial subtypes - are defined, including the primary "mixed" - subtype, "alternative" for representing the same - data in multiple formats, "parallel" for parts - intended to be viewed simultaneously, and "digest" - for multipart entities in which each part is of - type "message". - message -- an encapsulated message. A body of - Content-Type "message" is itself a fully formatted - RFC 822 conformant message which may contain its - own different Content-Type header field. The - primary subtype is "rfc822". The "partial" - subtype is defined for partial messages, to permit - the fragmented transmission of bodies that are - thought to be too large to be passed through mail - transport facilities. Another subtype, - "External-body", is defined for specifying large - bodies by reference to an external data source. - - - - Borenstein & Freed [Page 8] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - image -- image data. Image requires a display device - (such as a graphical display, a printer, or a FAX - machine) to view the information. Initial - subtypes are defined for two widely-used image - formats, jpeg and gif. - audio -- audio data, with initial subtype "basic". - Audio requires an audio output device (such as a - speaker or a telephone) to "display" the contents. - video -- video data. Video requires the capability to - display moving images, typically including - specialized hardware and software. The initial - subtype is "mpeg". - application -- some other kind of data, typically - either uninterpreted binary data or information to - be processed by a mail-based application. The - primary subtype, "octet-stream", is to be used in - the case of uninterpreted binary data, in which - case the simplest recommended action is to offer - to write the information into a file for the user. - Two additional subtypes, "ODA" and "PostScript", - are defined for transporting ODA and PostScript - documents in bodies. Other expected uses for - "application" include spreadsheets, data for - mail-based scheduling systems, and languages for - "active" (computational) email. (Note that active - email entails several securityconsiderations, - which are discussed later in this memo, - particularly in the context of - application/PostScript.) - - Default RFC 822 messages are typed by this protocol as plain - text in the US-ASCII character set, which can be explicitly - specified as "Content-type: text/plain; charset=us-ascii". - If no Content-Type is specified, either by error or by an - older user agent, this default is assumed. In the presence - of a MIME-Version header field, a receiving User Agent can - also assume that plain US-ASCII text was the sender's - intent. In the absence of a MIME-Version specification, - plain US-ASCII text must still be assumed, but the sender's - intent might have been otherwise. - - RATIONALE: In the absence of any Content-Type header field - or MIME-Version header field, it is impossible to be certain - that a message is actually text in the US-ASCII character - set, since it might well be a message that, using the - conventions that predate this document, includes text in - another character set or non-textual data in a manner that - cannot be automatically recognized (e.g., a uuencoded - compressed UNIX tar file). Although there is no fully - acceptable alternative to treating such untyped messages as - "text/plain; charset=us-ascii", implementors should remain - aware that if a message lacks both the MIME-Version and the - Content-Type header fields, it may in practice contain - almost anything. - - - - Borenstein & Freed [Page 9] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - It should be noted that the list of Content-Type values - given here may be augmented in time, via the mechanisms - described above, and that the set of subtypes is expected to - grow substantially. - - When a mail reader encounters mail with an unknown Content- - type value, it should generally treat it as equivalent to - "application/octet-stream", as described later in this - document. - - 5 The Content-Transfer-Encoding Header Field - - Many Content-Types which could usefully be transported via - email are represented, in their "natural" format, as 8-bit - character or binary data. Such data cannot be transmitted - over some transport protocols. For example, RFC 821 - restricts mail messages to 7-bit US-ASCII data with 1000 - character lines. - - It is necessary, therefore, to define a standard mechanism - for re-encoding such data into a 7-bit short-line format. - This document specifies that such encodings will be - indicated by a new "Content-Transfer-Encoding" header field. - The Content-Transfer-Encoding field is used to indicate the - type of transformation that has been used in order to - represent the body in an acceptable manner for transport. - - Unlike Content-Types, a proliferation of Content-Transfer- - Encoding values is undesirable and unnecessary. However, - establishing only a single Content-Transfer-Encoding - mechanism does not seem possible. There is a tradeoff - between the desire for a compact and efficient encoding of - largely-binary data and the desire for a readable encoding - of data that is mostly, but not entirely, 7-bit data. For - this reason, at least two encoding mechanisms are necessary: - a "readable" encoding and a "dense" encoding. - - The Content-Transfer-Encoding field is designed to specify - an invertible mapping between the "native" representation of - a type of data and a representation that can be readily - exchanged using 7 bit mail transport protocols, such as - those defined by RFC 821 (SMTP). This field has not been - defined by any previous standard. The field's value is a - single token specifying the type of encoding, as enumerated - below. Formally: - - Content-Transfer-Encoding := "BASE64" / "QUOTED-PRINTABLE" / - "8BIT" / "7BIT" / - "BINARY" / x-token - - These values are not case sensitive. That is, Base64 and - BASE64 and bAsE64 are all equivalent. An encoding type of - 7BIT requires that the body is already in a seven-bit mail- - ready representation. This is the default value -- that is, - - - - Borenstein & Freed [Page 10] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - "Content-Transfer-Encoding: 7BIT" is assumed if the - Content-Transfer-Encoding header field is not present. - - The values "8bit", "7bit", and "binary" all imply that NO - encoding has been performed. However, they are potentially - useful as indications of the kind of data contained in the - object, and therefore of the kind of encoding that might - need to be performed for transmission in a given transport - system. "7bit" means that the data is all represented as - short lines of US-ASCII data. "8bit" means that the lines - are short, but there may be non-ASCII characters (octets - with the high-order bit set). "Binary" means that not only - may non-ASCII characters be present, but also that the lines - are not necessarily short enough for SMTP transport. - - The difference between "8bit" (or any other conceivable - bit-width token) and the "binary" token is that "binary" - does not require adherence to any limits on line length or - to the SMTP CRLF semantics, while the bit-width tokens do - require such adherence. If the body contains data in any - bit-width other than 7-bit, the appropriate bit-width - Content-Transfer-Encoding token must be used (e.g., "8bit" - for unencoded 8 bit wide data). If the body contains binary - data, the "binary" Content-Transfer-Encoding token must be - used. - - NOTE: The distinction between the Content-Transfer-Encoding - values of "binary," "8bit," etc. may seem unimportant, in - that all of them really mean "none" -- that is, there has - been no encoding of the data for transport. However, clear - labeling will be of enormous value to gateways between - future mail transport systems with differing capabilities in - transporting data that do not meet the restrictions of RFC - 821 transport. - - As of the publication of this document, there are no - standardized Internet transports for which it is legitimate - to include unencoded 8-bit or binary data in mail bodies. - Thus there are no circumstances in which the "8bit" or - "binary" Content-Transfer-Encoding is actually legal on the - Internet. However, in the event that 8-bit or binary mail - transport becomes a reality in Internet mail, or when this - document is used in conjunction with any other 8-bit or - binary-capable transport mechanism, 8-bit or binary bodies - should be labeled as such using this mechanism. - - NOTE: The five values defined for the Content-Transfer- - Encoding field imply nothing about the Content-Type other - than the algorithm by which it was encoded or the transport - system requirements if unencoded. - - Implementors may, if necessary, define new Content- - Transfer-Encoding values, but must use an x-token, which is - a name prefixed by "X-" to indicate its non-standard status, - - - - Borenstein & Freed [Page 11] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - e.g., "Content-Transfer-Encoding: x-my-new-encoding". - However, unlike Content-Types and subtypes, the creation of - new Content-Transfer-Encoding values is explicitly and - strongly discouraged, as it seems likely to hinder - interoperability with little potential benefit. Their use - is allowed only as the result of an agreement between - cooperating user agents. - - If a Content-Transfer-Encoding header field appears as part - of a message header, it applies to the entire body of that - message. If a Content-Transfer-Encoding header field - appears as part of a body part's headers, it applies only to - the body of that body part. If an entity is of type - "multipart" or "message", the Content-Transfer-Encoding is - not permitted to have any value other than a bit width - (e.g., "7bit", "8bit", etc.) or "binary". - - It should be noted that email is character-oriented, so that - the mechanisms described here are mechanisms for encoding - arbitrary byte streams, not bit streams. If a bit stream is - to be encoded via one of these mechanisms, it must first be - converted to an 8-bit byte stream using the network standard - bit order ("big-endian"), in which the earlier bits in a - stream become the higher-order bits in a byte. A bit stream - not ending at an 8-bit boundary must be padded with zeroes. - This document provides a mechanism for noting the addition - of such padding in the case of the application Content-Type, - which has a "padding" parameter. - - The encoding mechanisms defined here explicitly encode all - data in ASCII. Thus, for example, suppose an entity has - header fields such as: - - Content-Type: text/plain; charset=ISO-8859-1 - Content-transfer-encoding: base64 - - This should be interpreted to mean that the body is a base64 - ASCII encoding of data that was originally in ISO-8859-1, - and will be in that character set again after decoding. - - The following sections will define the two standard encoding - mechanisms. The definition of new content-transfer- - encodings is explicitly discouraged and should only occur - when absolutely necessary. All content-transfer-encoding - namespace except that beginning with "X-" is explicitly - reserved to the IANA for future use. Private agreements - about content-transfer-encodings are also explicitly - discouraged. - - Certain Content-Transfer-Encoding values may only be used on - certain Content-Types. In particular, it is expressly - forbidden to use any encodings other than "7bit", "8bit", or - "binary" with any Content-Type that recursively includes - other Content-Type fields, notably the "multipart" and - - - - Borenstein & Freed [Page 12] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - "message" Content-Types. All encodings that are desired for - bodies of type multipart or message must be done at the - innermost level, by encoding the actual body that needs to - be encoded. - - NOTE ON ENCODING RESTRICTIONS: Though the prohibition - against using content-transfer-encodings on data of type - multipart or message may seem overly restrictive, it is - necessary to prevent nested encodings, in which data are - passed through an encoding algorithm multiple times, and - must be decoded multiple times in order to be properly - viewed. Nested encodings add considerable complexity to - user agents: aside from the obvious efficiency problems - with such multiple encodings, they can obscure the basic - structure of a message. In particular, they can imply that - several decoding operations are necessary simply to find out - what types of objects a message contains. Banning nested - encodings may complicate the job of certain mail gateways, - but this seems less of a problem than the effect of nested - encodings on user agents. - - NOTE ON THE RELATIONSHIP BETWEEN CONTENT-TYPE AND CONTENT- - TRANSFER-ENCODING: It may seem that the Content-Transfer- - Encoding could be inferred from the characteristics of the - Content-Type that is to be encoded, or, at the very least, - that certain Content-Transfer-Encodings could be mandated - for use with specific Content-Types. There are several - reasons why this is not the case. First, given the varying - types of transports used for mail, some encodings may be - appropriate for some Content-Type/transport combinations and - not for others. (For example, in an 8-bit transport, no - encoding would be required for text in certain character - sets, while such encodings are clearly required for 7-bit - SMTP.) Second, certain Content-Types may require different - types of transfer encoding under different circumstances. - For example, many PostScript bodies might consist entirely - of short lines of 7-bit data and hence require little or no - encoding. Other PostScript bodies (especially those using - Level 2 PostScript's binary encoding mechanism) may only be - reasonably represented using a binary transport encoding. - Finally, since Content-Type is intended to be an open-ended - specification mechanism, strict specification of an - association between Content-Types and encodings effectively - couples the specification of an application protocol with a - specific lower-level transport. This is not desirable since - the developers of a Content-Type should not have to be aware - of all the transports in use and what their limitations are. - - NOTE ON TRANSLATING ENCODINGS: The quoted-printable and - base64 encodings are designed so that conversion between - them is possible. The only issue that arises in such a - conversion is the handling of line breaks. When converting - from quoted-printable to base64 a line break must be - converted into a CRLF sequence. Similarly, a CRLF sequence - - - - Borenstein & Freed [Page 13] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - in base64 data should be converted to a quoted-printable - line break, but ONLY when converting text data. - - NOTE ON CANONICAL ENCODING MODEL: There was some - confusion, in earlier drafts of this memo, regarding the - model for when email data was to be converted to canonical - form and encoded, and in particular how this process would - affect the treatment of CRLFs, given that the representation - of newlines varies greatly from system to system. For this - reason, a canonical model for encoding is presented as - Appendix H. - - 5.1 Quoted-Printable Content-Transfer-Encoding - - The Quoted-Printable encoding is intended to represent data - that largely consists of octets that correspond to printable - characters in the ASCII character set. It encodes the data - in such a way that the resulting octets are unlikely to be - modified by mail transport. If the data being encoded are - mostly ASCII text, the encoded form of the data remains - largely recognizable by humans. A body which is entirely - ASCII may also be encoded in Quoted-Printable to ensure the - integrity of the data should the message pass through a - character-translating, and/or line-wrapping gateway. - - In this encoding, octets are to be represented as determined - by the following rules: - - Rule #1: (General 8-bit representation) Any octet, - except those indicating a line break according to the - newline convention of the canonical form of the data - being encoded, may be represented by an "=" followed by - a two digit hexadecimal representation of the octet's - value. The digits of the hexadecimal alphabet, for this - purpose, are "0123456789ABCDEF". Uppercase letters must - be - used when sending hexadecimal data, though a robust - implementation may choose to recognize lowercase - letters on receipt. Thus, for example, the value 12 - (ASCII form feed) can be represented by "=0C", and the - value 61 (ASCII EQUAL SIGN) can be represented by - "=3D". Except when the following rules allow an - alternative encoding, this rule is mandatory. - - Rule #2: (Literal representation) Octets with decimal - values of 33 through 60 inclusive, and 62 through 126, - inclusive, MAY be represented as the ASCII characters - which correspond to those octets (EXCLAMATION POINT - through LESS THAN, and GREATER THAN through TILDE, - respectively). - - Rule #3: (White Space): Octets with values of 9 and 32 - MAY be represented as ASCII TAB (HT) and SPACE - characters, respectively, but MUST NOT be so - - - - Borenstein & Freed [Page 14] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - represented at the end of an encoded line. Any TAB (HT) - or SPACE characters on an encoded line MUST thus be - followed on that line by a printable character. In - particular, an "=" at the end of an encoded line, - indicating a soft line break (see rule #5) may follow - one or more TAB (HT) or SPACE characters. It follows - that an octet with value 9 or 32 appearing at the end - of an encoded line must be represented according to - Rule #1. This rule is necessary because some MTAs - (Message Transport Agents, programs which transport - messages from one user to another, or perform a part of - such transfers) are known to pad lines of text with - SPACEs, and others are known to remove "white space" - characters from the end of a line. Therefore, when - decoding a Quoted-Printable body, any trailing white - space on a line must be deleted, as it will necessarily - have been added by intermediate transport agents. - - Rule #4 (Line Breaks): A line break in a text body - part, independent of what its representation is - following the canonical representation of the data - being encoded, must be represented by a (RFC 822) line - break, which is a CRLF sequence, in the Quoted- - Printable encoding. If isolated CRs and LFs, or LF CR - and CR LF sequences are allowed to appear in binary - data according to the canonical form, they must be - represented using the "=0D", "=0A", "=0A=0D" and - "=0D=0A" notations respectively. - - Note that many implementation may elect to encode the - local representation of various content types directly. - In particular, this may apply to plain text material on - systems that use newline conventions other than CRLF - delimiters. Such an implementation is permissible, but - the generation of line breaks must be generalized to - account for the case where alternate representations of - newline sequences are used. - - Rule #5 (Soft Line Breaks): The Quoted-Printable - encoding REQUIRES that encoded lines be no more than 76 - characters long. If longer lines are to be encoded with - the Quoted-Printable encoding, 'soft' line breaks must - be used. An equal sign as the last character on a - encoded line indicates such a non-significant ('soft') - line break in the encoded text. Thus if the "raw" form - of the line is a single unencoded line that says: - - Now's the time for all folk to come to the aid of - their country. - - This can be represented, in the Quoted-Printable - encoding, as - - - - - - Borenstein & Freed [Page 15] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - Now's the time = - for all folk to come= - to the aid of their country. - - This provides a mechanism with which long lines are - encoded in such a way as to be restored by the user - agent. The 76 character limit does not count the - trailing CRLF, but counts all other characters, - including any equal signs. - - Since the hyphen character ("-") is represented as itself in - the Quoted-Printable encoding, care must be taken, when - encapsulating a quoted-printable encoded body in a multipart - entity, to ensure that the encapsulation boundary does not - appear anywhere in the encoded body. (A good strategy is to - choose a boundary that includes a character sequence such as - "=_" which can never appear in a quoted-printable body. See - the definition of multipart messages later in this - document.) - - NOTE: The quoted-printable encoding represents something of - a compromise between readability and reliability in - transport. Bodies encoded with the quoted-printable - encoding will work reliably over most mail gateways, but may - not work perfectly over a few gateways, notably those - involving translation into EBCDIC. (In theory, an EBCDIC - gateway could decode a quoted-printable body and re-encode - it using base64, but such gateways do not yet exist.) A - higher level of confidence is offered by the base64 - Content-Transfer-Encoding. A way to get reasonably reliable - transport through EBCDIC gateways is to also quote the ASCII - characters - - !"#$@[\]^`{|}~ - - according to rule #1. See Appendix B for more information. - - Because quoted-printable data is generally assumed to be - line-oriented, it is to be expected that the breaks between - the lines of quoted printable data may be altered in - transport, in the same manner that plain text mail has - always been altered in Internet mail when passing between - systems with differing newline conventions. If such - alterations are likely to constitute a corruption of the - data, it is probably more sensible to use the base64 - encoding rather than the quoted-printable encoding. - - - - - - - - - - - - Borenstein & Freed [Page 16] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - 5.2 Base64 Content-Transfer-Encoding - - The Base64 Content-Transfer-Encoding is designed to - represent arbitrary sequences of octets in a form that is - not humanly readable. The encoding and decoding algorithms - are simple, but the encoded data are consistently only about - 33 percent larger than the unencoded data. This encoding is - based on the one used in Privacy Enhanced Mail applications, - as defined in RFC 1113. The base64 encoding is adapted - from RFC 1113, with one change: base64 eliminates the "*" - mechanism for embedded clear text. - - A 65-character subset of US-ASCII is used, enabling 6 bits - to be represented per printable character. (The extra 65th - character, "=", is used to signify a special processing - function.) - - NOTE: This subset has the important property that it is - represented identically in all versions of ISO 646, - including US ASCII, and all characters in the subset are - also represented identically in all versions of EBCDIC. - Other popular encodings, such as the encoding used by the - UUENCODE utility and the base85 encoding specified as part - of Level 2 PostScript, do not share these properties, and - thus do not fulfill the portability requirements a binary - transport encoding for mail must meet. - - The encoding process represents 24-bit groups of input bits - as output strings of 4 encoded characters. Proceeding from - left to right, a 24-bit input group is formed by - concatenating 3 8-bit input groups. These 24 bits are then - treated as 4 concatenated 6-bit groups, each of which is - translated into a single digit in the base64 alphabet. When - encoding a bit stream via the base64 encoding, the bit - stream must be presumed to be ordered with the most- - significant-bit first. That is, the first bit in the stream - will be the high-order bit in the first byte, and the eighth - bit will be the low-order bit in the first byte, and so on. - - Each 6-bit group is used as an index into an array of 64 - printable characters. The character referenced by the index - is placed in the output string. These characters, identified - in Table 1, below, are selected so as to be universally - representable, and the set excludes characters with - particular significance to SMTP (e.g., ".", "CR", "LF") and - to the encapsulation boundaries defined in this document - (e.g., "-"). - - - - - - - - - - - Borenstein & Freed [Page 17] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - Table 1: The Base64 Alphabet - - Value Encoding Value Encoding Value Encoding Value - Encoding - 0 A 17 R 34 i 51 z - 1 B 18 S 35 j 52 0 - 2 C 19 T 36 k 53 1 - 3 D 20 U 37 l 54 2 - 4 E 21 V 38 m 55 3 - 5 F 22 W 39 n 56 4 - 6 G 23 X 40 o 57 5 - 7 H 24 Y 41 p 58 6 - 8 I 25 Z 42 q 59 7 - 9 J 26 a 43 r 60 8 - 10 K 27 b 44 s 61 9 - 11 L 28 c 45 t 62 + - 12 M 29 d 46 u 63 / - 13 N 30 e 47 v - 14 O 31 f 48 w (pad) = - 15 P 32 g 49 x - 16 Q 33 h 50 y - - The output stream (encoded bytes) must be represented in - lines of no more than 76 characters each. All line breaks - or other characters not found in Table 1 must be ignored by - decoding software. In base64 data, characters other than - those in Table 1, line breaks, and other white space - probably indicate a transmission error, about which a - warning message or even a message rejection might be - appropriate under some circumstances. - - Special processing is performed if fewer than 24 bits are - available at the end of the data being encoded. A full - encoding quantum is always completed at the end of a body. - When fewer than 24 input bits are available in an input - group, zero bits are added (on the right) to form an - integral number of 6-bit groups. Output character positions - which are not required to represent actual input data are - set to the character "=". Since all base64 input is an - integral number of octets, only the following cases can - arise: (1) the final quantum of encoding input is an - integral multiple of 24 bits; here, the final unit of - encoded output will be an integral multiple of 4 characters - with no "=" padding, (2) the final quantum of encoding input - is exactly 8 bits; here, the final unit of encoded output - will be two characters followed by two "=" padding - characters, or (3) the final quantum of encoding input is - exactly 16 bits; here, the final unit of encoded output will - be three characters followed by one "=" padding character. - - Care must be taken to use the proper octets for line breaks - if base64 encoding is applied directly to text material that - has not been converted to canonical form. In particular, - text line breaks should be converted into CRLF sequences - - - - Borenstein & Freed [Page 18] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - prior to base64 encoding. The important thing to note is - that this may be done directly by the encoder rather than in - a prior canonicalization step in some implementations. - - NOTE: There is no need to worry about quoting apparent - encapsulation boundaries within base64-encoded parts of - multipart entities because no hyphen characters are used in - the base64 encoding. - - 6 Additional Optional Content- Header Fields - - 6.1 Optional Content-ID Header Field - - In constructing a high-level user agent, it may be desirable - to allow one body to make reference to another. - Accordingly, bodies may be labeled using the "Content-ID" - header field, which is syntactically identical to the - "Message-ID" header field: - - Content-ID := msg-id - - Like the Message-ID values, Content-ID values must be - generated to be as unique as possible. - - 6.2 Optional Content-Description Header Field - - The ability to associate some descriptive information with a - given body is often desirable. For example, it may be useful - to mark an "image" body as "a picture of the Space Shuttle - Endeavor." Such text may be placed in the Content- - Description header field. - - Content-Description := *text - - The description is presumed to be given in the US-ASCII - character set, although the mechanism specified in [RFC- - 1342] may be used for non-US-ASCII Content-Description - values. - - - - - - - - - - - - - - - - - - - - Borenstein & Freed [Page 19] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - 7 The Predefined Content-Type Values - - This document defines seven initial Content-Type values and - an extension mechanism for private or experimental types. - Further standard types must be defined by new published - specifications. It is expected that most innovation in new - types of mail will take place as subtypes of the seven types - defined here. The most essential characteristics of the - seven content-types are summarized in Appendix G. - - 7.1 The Text Content-Type - - The text Content-Type is intended for sending material which - is principally textual in form. It is the default Content- - Type. A "charset" parameter may be used to indicate the - character set of the body text. The primary subtype of text - is "plain". This indicates plain (unformatted) text. The - default Content-Type for Internet mail is "text/plain; - charset=us-ascii". - - Beyond plain text, there are many formats for representing - what might be known as "extended text" -- text with embedded - formatting and presentation information. An interesting - characteristic of many such representations is that they are - to some extent readable even without the software that - interprets them. It is useful, then, to distinguish them, - at the highest level, from such unreadable data as images, - audio, or text represented in an unreadable form. In the - absence of appropriate interpretation software, it is - reasonable to show subtypes of text to the user, while it is - not reasonable to do so with most nontextual data. - - Such formatted textual data should be represented using - subtypes of text. Plausible subtypes of text are typically - given by the common name of the representation format, e.g., - "text/richtext". - - 7.1.1 The charset parameter - - A critical parameter that may be specified in the Content- - Type field for text data is the character set. This is - specified with a "charset" parameter, as in: - - Content-type: text/plain; charset=us-ascii - - Unlike some other parameter values, the values of the - charset parameter are NOT case sensitive. The default - character set, which must be assumed in the absence of a - charset parameter, is US-ASCII. - - An initial list of predefined character set names can be - found at the end of this section. Additional character sets - may be registered with IANA as described in Appendix F, - although the standardization of their use requires the usual - - - - Borenstein & Freed [Page 20] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - IAB review and approval. Note that if the specified - character set includes 8-bit data, a Content-Transfer- - Encoding header field and a corresponding encoding on the - data are required in order to transmit the body via some - mail transfer protocols, such as SMTP. - - The default character set, US-ASCII, has been the subject of - some confusion and ambiguity in the past. Not only were - there some ambiguities in the definition, there have been - wide variations in practice. In order to eliminate such - ambiguity and variations in the future, it is strongly - recommended that new user agents explicitly specify a - character set via the Content-Type header field. "US-ASCII" - does not indicate an arbitrary seven-bit character code, but - specifies that the body uses character coding that uses the - exact correspondence of codes to characters specified in - ASCII. National use variations of ISO 646 [ISO-646] are NOT - ASCII and their use in Internet mail is explicitly - discouraged. The omission of the ISO 646 character set is - deliberate in this regard. The character set name of "US- - ASCII" explicitly refers to ANSI X3.4-1986 [US-ASCII] only. - The character set name "ASCII" is reserved and must not be - used for any purpose. - - NOTE: RFC 821 explicitly specifies "ASCII", and references - an earlier version of the American Standard. Insofar as one - of the purposes of specifying a Content-Type and character - set is to permit the receiver to unambiguously determine how - the sender intended the coded message to be interpreted, - assuming anything other than "strict ASCII" as the default - would risk unintentional and incompatible changes to the - semantics of messages now being transmitted. This also - implies that messages containing characters coded according - to national variations on ISO 646, or using code-switching - procedures (e.g., those of ISO 2022), as well as 8-bit or - multiple octet character encodings MUST use an appropriate - character set specification to be consistent with this - specification. - - The complete US-ASCII character set is listed in [US-ASCII]. - Note that the control characters including DEL (0-31, 127) - have no defined meaning apart from the combination CRLF - (ASCII values 13 and 10) indicating a new line. Two of the - characters have de facto meanings in wide use: FF (12) often - means "start subsequent text on the beginning of a new - page"; and TAB or HT (9) often (though not always) means - "move the cursor to the next available column after the - current position where the column number is a multiple of 8 - (counting the first column as column 0)." Apart from this, - any use of the control characters or DEL in a body must be - part of a private agreement between the sender and - recipient. Such private agreements are discouraged and - should be replaced by the other capabilities of this - document. - - - - Borenstein & Freed [Page 21] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - NOTE: Beyond US-ASCII, an enormous proliferation of - character sets is possible. It is the opinion of the IETF - working group that a large number of character sets is NOT a - good thing. We would prefer to specify a single character - set that can be used universally for representing all of the - world's languages in electronic mail. Unfortunately, - existing practice in several communities seems to point to - the continued use of multiple character sets in the near - future. For this reason, we define names for a small number - of character sets for which a strong constituent base - exists. It is our hope that ISO 10646 or some other - effort will eventually define a single world character set - which can then be specified for use in Internet mail, but in - the advance of that definition we cannot specify the use of - ISO 10646, Unicode, or any other character set whose - definition is, as of this writing, incomplete. - - The defined charset values are: - - US-ASCII -- as defined in [US-ASCII]. - - ISO-8859-X -- where "X" is to be replaced, as - necessary, for the parts of ISO-8859 [ISO- - 8859]. Note that the ISO 646 character sets - have deliberately been omitted in favor of - their 8859 replacements, which are the - designated character sets for Internet mail. - As of the publication of this document, the - legitimate values for "X" are the digits 1 - through 9. - - Note that the character set used, if anything other than - US-ASCII, must always be explicitly specified in the - Content-Type field. - - No other character set name may be used in Internet mail - without the publication of a formal specification and its - registration with IANA as described in Appendix F, or by - private agreement, in which case the character set name must - begin with "X-". - - Implementors are discouraged from defining new character - sets for mail use unless absolutely necessary. - - The "charset" parameter has been defined primarily for the - purpose of textual data, and is described in this section - for that reason. However, it is conceivable that non- - textual data might also wish to specify a charset value for - some purpose, in which case the same syntax and values - should be used. - - In general, mail-sending software should always use the - "lowest common denominator" character set possible. For - example, if a body contains only US-ASCII characters, it - - - - Borenstein & Freed [Page 22] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - should be marked as being in the US-ASCII character set, not - ISO-8859-1, which, like all the ISO-8859 family of character - sets, is a superset of US-ASCII. More generally, if a - widely-used character set is a subset of another character - set, and a body contains only characters in the widely-used - subset, it should be labeled as being in that subset. This - will increase the chances that the recipient will be able to - view the mail correctly. - - 7.1.2 The Text/plain subtype - - The primary subtype of text is "plain". This indicates - plain (unformatted) text. The default Content-Type for - Internet mail, "text/plain; charset=us-ascii", describes - existing Internet practice, that is, it is the type of body - defined by RFC 822. - - 7.1.3 The Text/richtext subtype - - In order to promote the wider interoperability of simple - formatted text, this document defines an extremely simple - subtype of "text", the "richtext" subtype. This subtype was - designed to meet the following criteria: - - 1. The syntax must be extremely simple to parse, - so that even teletype-oriented mail systems can - easily strip away the formatting information and - leave only the readable text. - - 2. The syntax must be extensible to allow for new - formatting commands that are deemed essential. - - 3. The capabilities must be extremely limited, to - ensure that it can represent no more than is - likely to be representable by the user's primary - word processor. While this limits what can be - sent, it increases the likelihood that what is - sent can be properly displayed. - - 4. The syntax must be compatible with SGML, so - that, with an appropriate DTD (Document Type - Definition, the standard mechanism for defining a - document type using SGML), a general SGML parser - could be made to parse richtext. However, despite - this compatibility, the syntax should be far - simpler than full SGML, so that no SGML knowledge - is required in order to implement it. - - The syntax of "richtext" is very simple. It is assumed, at - the top-level, to be in the US-ASCII character set, unless - of course a different charset parameter was specified in the - Content-type field. All characters represent themselves, - with the exception of the "<" character (ASCII 60), which is - used to mark the beginning of a formatting command. - - - - Borenstein & Freed [Page 23] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - Formatting instructions consist of formatting commands - surrounded by angle brackets ("<>", ASCII 60 and 62). Each - formatting command may be no more than 40 characters in - length, all in US-ASCII, restricted to the alphanumeric and - hyphen ("-") characters. Formatting commands may be preceded - by a forward slash or solidus ("/", ASCII 47), making them - negations, and such negations must always exist to balance - the initial opening commands, except as noted below. Thus, - if the formatting command "" appears at some point, - there must later be a "" to balance it. There are - only three exceptions to this "balancing" rule: First, the - command "" is used to represent a literal "<" character. - Second, the command "" is used to represent a required - line break. (Otherwise, CRLFs in the data are treated as - equivalent to a single SPACE character.) Finally, the - command "" is used to represent a page break. (NOTE: - The 40 character limit on formatting commands does not - include the "<", ">", or "/" characters that might be - attached to such commands.) - - Initially defined formatting commands, not all of which will - be implemented by all richtext implementations, include: - - Bold -- causes the subsequent text to be in a bold - font. - Italic -- causes the subsequent text to be in an italic - font. - Fixed -- causes the subsequent text to be in a fixed - width font. - Smaller -- causes the subsequent text to be in a - smaller font. - Bigger -- causes the subsequent text to be in a bigger - font. - Underline -- causes the subsequent text to be - underlined. - Center -- causes the subsequent text to be centered. - FlushLeft -- causes the subsequent text to be left - justified. - FlushRight -- causes the subsequent text to be right - justified. - Indent -- causes the subsequent text to be indented at - the left margin. - IndentRight -- causes the subsequent text to be - indented at the right margin. - Outdent -- causes the subsequent text to be outdented - at the left margin. - OutdentRight -- causes the subsequent text to be - outdented at the right margin. - SamePage -- causes the subsequent text to be grouped, - if possible, on one page. - Subscript -- causes the subsequent text to be - interpreted as a subscript. - - - - - - Borenstein & Freed [Page 24] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - Superscript -- causes the subsequent text to be - interpreted as a superscript. - Heading -- causes the subsequent text to be interpreted - as a page heading. - Footing -- causes the subsequent text to be interpreted - as a page footing. - ISO-8859-X (for any value of X that is legal as a - "charset" parameter) -- causes the subsequent text - to be interpreted as text in the appropriate - character set. - US-ASCII -- causes the subsequent text to be - interpreted as text in the US-ASCII character set. - Excerpt -- causes the subsequent text to be interpreted - as a textual excerpt from another source. - Typically this will be displayed using indentation - and an alternate font, but such decisions are up - to the viewer. - Paragraph -- causes the subsequent text to be - interpreted as a single paragraph, with - appropriate paragraph breaks (typically blank - space) before and after. - Signature -- causes the subsequent text to be - interpreted as a "signature". Some systems may - wish to display signatures in a smaller font or - otherwise set them apart from the main text of the - message. - Comment -- causes the subsequent text to be interpreted - as a comment, and hence not shown to the reader. - No-op -- has no effect on the subsequent text. - lt -- is replaced by a literal "<" character. No - balancing is allowed. - nl -- causes a line break. No balancing is - allowed. - np -- causes a page break. No balancing is - allowed. - - Each positive formatting command affects all subsequent text - until the matching negative formatting command. Such pairs - of formatting commands must be properly balanced and nested. - Thus, a proper way to describe text in bold italics is: - - the-text - - or, alternately, - - the-text - - but, in particular, the following is illegal - richtext: - - the-text - - NOTE: The nesting requirement for formatting commands - imposes a slightly higher burden upon the composers of - - - - Borenstein & Freed [Page 25] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - richtext bodies, but potentially simplifies richtext - displayers by allowing them to be stack-based. The main - goal of richtext is to be simple enough to make multifont, - formatted email widely readable, so that those with the - capability of sending it will be able to do so with - confidence. Thus slightly increased complexity in the - composing software was deemed a reasonable tradeoff for - simplified reading software. Nonetheless, implementors of - richtext readers are encouraged to follow the general - Internet guidelines of being conservative in what you send - and liberal in what you accept. Those implementations that - can do so are encouraged to deal reasonably with improperly - nested richtext. - - Implementations must regard any unrecognized formatting - command as equivalent to "No-op", thus facilitating future - extensions to "richtext". Private extensions may be defined - using formatting commands that begin with "X-", by analogy - to Internet mail header field names. - - It is worth noting that no special behavior is required for - the TAB (HT) character. It is recommended, however, that, at - least when fixed-width fonts are in use, the common - semantics of the TAB (HT) character should be observed, - namely that it moves to the next column position that is a - multiple of 8. (In other words, if a TAB (HT) occurs in - column n, where the leftmost column is column 0, then that - TAB (HT) should be replaced by 8-(n mod 8) SPACE - characters.) - - Richtext also differentiates between "hard" and "soft" line - breaks. A line break (CRLF) in the richtext data stream is - interpreted as a "soft" line break, one that is included - only for purposes of mail transport, and is to be treated as - white space by richtext interpreters. To include a "hard" - line break (one that must be displayed as such), the "" - or " formatting constructs should be used. In - general, a soft line break should be treated as white space, - but when soft line breaks immediately follow a or a - tag they should be ignored rather than treated - as white space. - - Putting all this together, the following "text/richtext" - body fragment: - - Now is the time for - all good men - (and women>) to - come - - to the aid of their - - - - - - - Borenstein & Freed [Page 26] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - beloved country. Stupid - quote! -- the end - - represents the following formatted text (which will, no - doubt, look cryptic in the text-only version of this - document): - - Now is the time for all good men (and ) to - come to the aid of their - beloved - - country. -- the end - - Richtext conformance: A minimal richtext implementation is - one that simply converts "" to "<", converts CRLFs to - SPACE, converts to a newline according to local newline - convention, removes everything between a command - and the next balancing command, and removes all - other formatting commands (all text enclosed in angle - brackets). - - NOTE ON THE RELATIONSHIP OF RICHTEXT TO SGML: Richtext is - decidedly not SGML, and must not be used to transport - arbitrary SGML documents. Those who wish to use SGML - document types as a mail transport format must define a new - text or application subtype, e.g., "text/sgml-dtd-whatever" - or "application/sgml-dtd-whatever", depending on the - perceived readability of the DTD in use. Richtext is - designed to be compatible with SGML, and specifically so - that it will be possible to define a richtext DTD if one is - needed. However, this does not imply that arbitrary SGML - can be called richtext, nor that richtext implementors have - any need to understand SGML; the description in this - document is a complete definition of richtext, which is far - simpler than complete SGML. - - NOTE ON THE INTENDED USE OF RICHTEXT: It is recognized that - implementors of future mail systems will want rich text - functionality far beyond that currently defined for - richtext. The intent of richtext is to provide a common - format for expressing that functionality in a form in which - much of it, at least, will be understood by interoperating - software. Thus, in particular, software with a richer - notion of formatted text than richtext can still use - richtext as its basic representation, but can extend it with - new formatting commands and by hiding information specific - to that software system in richtext comments. As such - systems evolve, it is expected that the definition of - richtext will be further refined by future published - specifications, but richtext as defined here provides a - platform on which evolutionary refinements can be based. - - IMPLEMENTATION NOTE: In some environments, it might be - impossible to combine certain richtext formatting commands, - - - - Borenstein & Freed [Page 27] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - whereas in others they might be combined easily. For - example, the combination of and might - produce bold italics on systems that support such fonts, but - there exist systems that can make text bold or italicized, - but not both. In such cases, the most recently issued - recognized formatting command should be preferred. - - One of the major goals in the design of richtext was to make - it so simple that even text-only mailers will implement - richtext-to-plain-text translators, thus increasing the - likelihood that multifont text will become "safe" to use - very widely. To demonstrate this simplicity, an extremely - simple 35-line C program that converts richtext input into - plain text output is included in Appendix D. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Borenstein & Freed [Page 28] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - 7.2 The Multipart Content-Type - - In the case of multiple part messages, in which one or more - different sets of data are combined in a single body, a - "multipart" Content-Type field must appear in the entity's - header. The body must then contain one or more "body parts," - each preceded by an encapsulation boundary, and the last one - followed by a closing boundary. Each part starts with an - encapsulation boundary, and then contains a body part - consisting of header area, a blank line, and a body area. - Thus a body part is similar to an RFC 822 message in syntax, - but different in meaning. - - A body part is NOT to be interpreted as actually being an - RFC 822 message. To begin with, NO header fields are - actually required in body parts. A body part that starts - with a blank line, therefore, is allowed and is a body part - for which all default values are to be assumed. In such a - case, the absence of a Content-Type header field implies - that the encapsulation is plain US-ASCII text. The only - header fields that have defined meaning for body parts are - those the names of which begin with "Content-". All other - header fields are generally to be ignored in body parts. - Although they should generally be retained in mail - processing, they may be discarded by gateways if necessary. - Such other fields are permitted to appear in body parts but - should not be depended on. "X-" fields may be created for - experimental or private purposes, with the recognition that - the information they contain may be lost at some gateways. - - The distinction between an RFC 822 message and a body part - is subtle, but important. A gateway between Internet and - X.400 mail, for example, must be able to tell the difference - between a body part that contains an image and a body part - that contains an encapsulated message, the body of which is - an image. In order to represent the latter, the body part - must have "Content-Type: message", and its body (after the - blank line) must be the encapsulated message, with its own - "Content-Type: image" header field. The use of similar - syntax facilitates the conversion of messages to body parts, - and vice versa, but the distinction between the two must be - understood by implementors. (For the special case in which - all parts actually are messages, a "digest" subtype is also - defined.) - - As stated previously, each body part is preceded by an - encapsulation boundary. The encapsulation boundary MUST NOT - appear inside any of the encapsulated parts. Thus, it is - crucial that the composing agent be able to choose and - specify the unique boundary that will separate the parts. - - All present and future subtypes of the "multipart" type must - use an identical syntax. Subtypes may differ in their - semantics, and may impose additional restrictions on syntax, - - - - Borenstein & Freed [Page 29] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - but must conform to the required syntax for the multipart - type. This requirement ensures that all conformant user - agents will at least be able to recognize and separate the - parts of any multipart entity, even of an unrecognized - subtype. - - As stated in the definition of the Content-Transfer-Encoding - field, no encoding other than "7bit", "8bit", or "binary" is - permitted for entities of type "multipart". The multipart - delimiters and header fields are always 7-bit ASCII in any - case, and data within the body parts can be encoded on a - part-by-part basis, with Content-Transfer-Encoding fields - for each appropriate body part. - - Mail gateways, relays, and other mail handling agents are - commonly known to alter the top-level header of an RFC 822 - message. In particular, they frequently add, remove, or - reorder header fields. Such alterations are explicitly - forbidden for the body part headers embedded in the bodies - of messages of type "multipart." - - 7.2.1 Multipart: The common syntax - - All subtypes of "multipart" share a common syntax, defined - in this section. A simple example of a multipart message - also appears in this section. An example of a more complex - multipart message is given in Appendix C. - - The Content-Type field for multipart entities requires one - parameter, "boundary", which is used to specify the - encapsulation boundary. The encapsulation boundary is - defined as a line consisting entirely of two hyphen - characters ("-", decimal code 45) followed by the boundary - parameter value from the Content-Type header field. - - NOTE: The hyphens are for rough compatibility with the - earlier RFC 934 method of message encapsulation, and for - ease of searching for the boundaries in some - implementations. However, it should be noted that multipart - messages are NOT completely compatible with RFC 934 - encapsulations; in particular, they do not obey RFC 934 - quoting conventions for embedded lines that begin with - hyphens. This mechanism was chosen over the RFC 934 - mechanism because the latter causes lines to grow with each - level of quoting. The combination of this growth with the - fact that SMTP implementations sometimes wrap long lines - made the RFC 934 mechanism unsuitable for use in the event - that deeply-nested multipart structuring is ever desired. - - Thus, a typical multipart Content-Type header field might - look like this: - - Content-Type: multipart/mixed; - - - - - Borenstein & Freed [Page 30] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - boundary=gc0p4Jq0M2Yt08jU534c0p - - This indicates that the entity consists of several parts, - each itself with a structure that is syntactically identical - to an RFC 822 message, except that the header area might be - completely empty, and that the parts are each preceded by - the line - - --gc0p4Jq0M2Yt08jU534c0p - - Note that the encapsulation boundary must occur at the - beginning of a line, i.e., following a CRLF, and that that - initial CRLF is considered to be part of the encapsulation - boundary rather than part of the preceding part. The - boundary must be followed immediately either by another CRLF - and the header fields for the next part, or by two CRLFs, in - which case there are no header fields for the next part (and - it is therefore assumed to be of Content-Type text/plain). - - NOTE: The CRLF preceding the encapsulation line is - considered part of the boundary so that it is possible to - have a part that does not end with a CRLF (line break). - Body parts that must be considered to end with line breaks, - therefore, should have two CRLFs preceding the encapsulation - line, the first of which is part of the preceding body part, - and the second of which is part of the encapsulation - boundary. - - The requirement that the encapsulation boundary begins with - a CRLF implies that the body of a multipart entity must - itself begin with a CRLF before the first encapsulation line - -- that is, if the "preamble" area is not used, the entity - headers must be followed by TWO CRLFs. This is indeed how - such entities should be composed. A tolerant mail reading - program, however, may interpret a body of type multipart - that begins with an encapsulation line NOT initiated by a - CRLF as also being an encapsulation boundary, but a - compliant mail sending program must not generate such - entities. - - Encapsulation boundaries must not appear within the - encapsulations, and must be no longer than 70 characters, - not counting the two leading hyphens. - - The encapsulation boundary following the last body part is a - distinguished delimiter that indicates that no further body - parts will follow. Such a delimiter is identical to the - previous delimiters, with the addition of two more hyphens - at the end of the line: - - --gc0p4Jq0M2Yt08jU534c0p-- - - There appears to be room for additional information prior to - the first encapsulation boundary and following the final - - - - Borenstein & Freed [Page 31] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - boundary. These areas should generally be left blank, and - implementations should ignore anything that appears before - the first boundary or after the last one. - - NOTE: These "preamble" and "epilogue" areas are not used - because of the lack of proper typing of these parts and the - lack of clear semantics for handling these areas at - gateways, particularly X.400 gateways. - - NOTE: Because encapsulation boundaries must not appear in - the body parts being encapsulated, a user agent must - exercise care to choose a unique boundary. The boundary in - the example above could have been the result of an algorithm - designed to produce boundaries with a very low probability - of already existing in the data to be encapsulated without - having to prescan the data. Alternate algorithms might - result in more 'readable' boundaries for a recipient with an - old user agent, but would require more attention to the - possibility that the boundary might appear in the - encapsulated part. The simplest boundary possible is - something like "---", with a closing boundary of "-----". - - As a very simple example, the following multipart message - has two parts, both of them plain text, one of them - explicitly typed and one of them implicitly typed: - - From: Nathaniel Borenstein - To: Ned Freed - Subject: Sample message - MIME-Version: 1.0 - Content-type: multipart/mixed; boundary="simple - boundary" - - This is the preamble. It is to be ignored, though it - is a handy place for mail composers to include an - explanatory note to non-MIME compliant readers. - --simple boundary - - This is implicitly typed plain ASCII text. - It does NOT end with a linebreak. - --simple boundary - Content-type: text/plain; charset=us-ascii - - This is explicitly typed plain ASCII text. - It DOES end with a linebreak. - - --simple boundary-- - This is the epilogue. It is also to be ignored. - - The use of a Content-Type of multipart in a body part within - another multipart entity is explicitly allowed. In such - cases, for obvious reasons, care must be taken to ensure - that each nested multipart entity must use a different - boundary delimiter. See Appendix C for an example of nested - - - - Borenstein & Freed [Page 32] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - multipart entities. - - The use of the multipart Content-Type with only a single - body part may be useful in certain contexts, and is - explicitly permitted. - - The only mandatory parameter for the multipart Content-Type - is the boundary parameter, which consists of 1 to 70 - characters from a set of characters known to be very robust - through email gateways, and NOT ending with white space. - (If a boundary appears to end with white space, the white - space must be presumed to have been added by a gateway, and - should be deleted.) It is formally specified by the - following BNF: - - boundary := 0*69 bcharsnospace - - bchars := bcharsnospace / " " - - bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / "+" / - "_" - / "," / "-" / "." / "/" / ":" / "=" / "?" - - Overall, the body of a multipart entity may be specified as - follows: - - multipart-body := preamble 1*encapsulation - close-delimiter epilogue - - encapsulation := delimiter CRLF body-part - - delimiter := CRLF "--" boundary ; taken from Content-Type - field. - ; when content-type is - multipart - ; There must be no space - ; between "--" and boundary. - - close-delimiter := delimiter "--" ; Again, no space before - "--" - - preamble := *text ; to be ignored upon - receipt. - - epilogue := *text ; to be ignored upon - receipt. - - body-part = <"message" as defined in RFC 822, - with all header fields optional, and with the - specified delimiter not occurring anywhere in - the message body, either on a line by itself - or as a substring anywhere. Note that the - - - - - - Borenstein & Freed [Page 33] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - semantics of a part differ from the semantics - of a message, as described in the text.> - - NOTE: Conspicuously missing from the multipart type is a - notion of structured, related body parts. In general, it - seems premature to try to standardize interpart structure - yet. It is recommended that those wishing to provide a more - structured or integrated multipart messaging facility should - define a subtype of multipart that is syntactically - identical, but that always expects the inclusion of a - distinguished part that can be used to specify the structure - and integration of the other parts, probably referring to - them by their Content-ID field. If this approach is used, - other implementations will not recognize the new subtype, - but will treat it as the primary subtype (multipart/mixed) - and will thus be able to show the user the parts that are - recognized. - - 7.2.2 The Multipart/mixed (primary) subtype - - The primary subtype for multipart, "mixed", is intended for - use when the body parts are independent and intended to be - displayed serially. Any multipart subtypes that an - implementation does not recognize should be treated as being - of subtype "mixed". - - 7.2.3 The Multipart/alternative subtype - - The multipart/alternative type is syntactically identical to - multipart/mixed, but the semantics are different. In - particular, each of the parts is an "alternative" version of - the same information. User agents should recognize that the - content of the various parts are interchangeable. The user - agent should either choose the "best" type based on the - user's environment and preferences, or offer the user the - available alternatives. In general, choosing the best type - means displaying only the LAST part that can be displayed. - This may be used, for example, to send mail in a fancy text - format in such a way that it can easily be displayed - anywhere: - - From: Nathaniel Borenstein - To: Ned Freed - Subject: Formatted text mail - MIME-Version: 1.0 - Content-Type: multipart/alternative; boundary=boundary42 - - - --boundary42 - Content-Type: text/plain; charset=us-ascii - - ...plain text version of message goes here.... - - - - - - Borenstein & Freed [Page 34] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - --boundary42 - Content-Type: text/richtext - - .... richtext version of same message goes here ... - --boundary42 - Content-Type: text/x-whatever - - .... fanciest formatted version of same message goes here - ... - --boundary42-- - - In this example, users whose mail system understood the - "text/x-whatever" format would see only the fancy version, - while other users would see only the richtext or plain text - version, depending on the capabilities of their system. - - In general, user agents that compose multipart/alternative - entities should place the body parts in increasing order of - preference, that is, with the preferred format last. For - fancy text, the sending user agent should put the plainest - format first and the richest format last. Receiving user - agents should pick and display the last format they are - capable of displaying. In the case where one of the - alternatives is itself of type "multipart" and contains - unrecognized sub-parts, the user agent may choose either to - show that alternative, an earlier alternative, or both. - - NOTE: From an implementor's perspective, it might seem more - sensible to reverse this ordering, and have the plainest - alternative last. However, placing the plainest alternative - first is the friendliest possible option when - mutlipart/alternative entities are viewed using a non-MIME- - compliant mail reader. While this approach does impose some - burden on compliant mail readers, interoperability with - older mail readers was deemed to be more important in this - case. - - It may be the case that some user agents, if they can - recognize more than one of the formats, will prefer to offer - the user the choice of which format to view. This makes - sense, for example, if mail includes both a nicely-formatted - image version and an easily-edited text version. What is - most critical, however, is that the user not automatically - be shown multiple versions of the same data. Either the - user should be shown the last recognized version or should - explicitly be given the choice. - - - - - - - - - - - - Borenstein & Freed [Page 35] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - 7.2.4 The Multipart/digest subtype - - This document defines a "digest" subtype of the multipart - Content-Type. This type is syntactically identical to - multipart/mixed, but the semantics are different. In - particular, in a digest, the default Content-Type value for - a body part is changed from "text/plain" to - "message/rfc822". This is done to allow a more readable - digest format that is largely compatible (except for the - quoting convention) with RFC 934. - - A digest in this format might, then, look something like - this: - - From: Moderator-Address - MIME-Version: 1.0 - Subject: Internet Digest, volume 42 - Content-Type: multipart/digest; - boundary="---- next message ----" - - - ------ next message ---- - - From: someone-else - Subject: my opinion - - ...body goes here ... - - ------ next message ---- - - From: someone-else-again - Subject: my different opinion - - ... another body goes here... - - ------ next message ------ - - 7.2.5 The Multipart/parallel subtype - - This document defines a "parallel" subtype of the multipart - Content-Type. This type is syntactically identical to - multipart/mixed, but the semantics are different. In - particular, in a parallel entity, all of the parts are - intended to be presented in parallel, i.e., simultaneously, - on hardware and software that are capable of doing so. - Composing agents should be aware that many mail readers will - lack this capability and will show the parts serially in any - event. - - - - - - - - - - Borenstein & Freed [Page 36] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - 7.3 The Message Content-Type - - It is frequently desirable, in sending mail, to encapsulate - another mail message. For this common operation, a special - Content-Type, "message", is defined. The primary subtype, - message/rfc822, has no required parameters in the Content- - Type field. Additional subtypes, "partial" and "External- - body", do have required parameters. These subtypes are - explained below. - - NOTE: It has been suggested that subtypes of message might - be defined for forwarded or rejected messages. However, - forwarded and rejected messages can be handled as multipart - messages in which the first part contains any control or - descriptive information, and a second part, of type - message/rfc822, is the forwarded or rejected message. - Composing rejection and forwarding messages in this manner - will preserve the type information on the original message - and allow it to be correctly presented to the recipient, and - hence is strongly encouraged. - - As stated in the definition of the Content-Transfer-Encoding - field, no encoding other than "7bit", "8bit", or "binary" is - permitted for messages or parts of type "message". The - message header fields are always US-ASCII in any case, and - data within the body can still be encoded, in which case the - Content-Transfer-Encoding header field in the encapsulated - message will reflect this. Non-ASCII text in the headers of - an encapsulated message can be specified using the - mechanisms described in [RFC-1342]. - - Mail gateways, relays, and other mail handling agents are - commonly known to alter the top-level header of an RFC 822 - message. In particular, they frequently add, remove, or - reorder header fields. Such alterations are explicitly - forbidden for the encapsulated headers embedded in the - bodies of messages of type "message." - - 7.3.1 The Message/rfc822 (primary) subtype - - A Content-Type of "message/rfc822" indicates that the body - contains an encapsulated message, with the syntax of an RFC - 822 message. - - 7.3.2 The Message/Partial subtype - - A subtype of message, "partial", is defined in order to - allow large objects to be delivered as several separate - pieces of mail and automatically reassembled by the - receiving user agent. (The concept is similar to IP - fragmentation/reassembly in the basic Internet Protocols.) - This mechanism can be used when intermediate transport - agents limit the size of individual messages that can be - sent. Content-Type "message/partial" thus indicates that - - - - Borenstein & Freed [Page 37] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - the body contains a fragment of a larger message. - - Three parameters must be specified in the Content-Type field - of type message/partial: The first, "id", is a unique - identifier, as close to a world-unique identifier as - possible, to be used to match the parts together. (In - general, the identifier is essentially a message-id; if - placed in double quotes, it can be any message-id, in - accordance with the BNF for "parameter" given earlier in - this specification.) The second, "number", an integer, is - the part number, which indicates where this part fits into - the sequence of fragments. The third, "total", another - integer, is the total number of parts. This third subfield - is required on the final part, and is optional on the - earlier parts. Note also that these parameters may be given - in any order. - - Thus, part 2 of a 3-part message may have either of the - following header fields: - - Content-Type: Message/Partial; - number=2; total=3; - id="oc=jpbe0M2Yt4s@thumper.bellcore.com"; - - Content-Type: Message/Partial; - id="oc=jpbe0M2Yt4s@thumper.bellcore.com"; - number=2 - - But part 3 MUST specify the total number of parts: - - Content-Type: Message/Partial; - number=3; total=3; - id="oc=jpbe0M2Yt4s@thumper.bellcore.com"; - - Note that part numbering begins with 1, not 0. - - When the parts of a message broken up in this manner are put - together, the result is a complete RFC 822 format message, - which may have its own Content-Type header field, and thus - may contain any other data type. - - Message fragmentation and reassembly: The semantics of a - reassembled partial message must be those of the "inner" - message, rather than of a message containing the inner - message. This makes it possible, for example, to send a - large audio message as several partial messages, and still - have it appear to the recipient as a simple audio message - rather than as an encapsulated message containing an audio - message. That is, the encapsulation of the message is - considered to be "transparent". - - When generating and reassembling the parts of a - message/partial message, the headers of the encapsulated - message must be merged with the headers of the enclosing - - - - Borenstein & Freed [Page 38] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - entities. In this process the following rules must be - observed: - - (1) All of the headers from the initial enclosing - entity (part one), except those that start with - "Content-" and "Message-ID", must be copied, in - order, to the new message. - - (2) Only those headers in the enclosed message - which start with "Content-" and "Message-ID" must - be appended, in order, to the headers of the new - message. Any headers in the enclosed message - which do not start with "Content-" (except for - "Message-ID") will be ignored. - - (3) All of the headers from the second and any - subsequent messages will be ignored. - - For example, if an audio message is broken into two parts, - the first part might look something like this: - - X-Weird-Header-1: Foo - From: Bill@host.com - To: joe@otherhost.com - Subject: Audio mail - Message-ID: id1@host.com - MIME-Version: 1.0 - Content-type: message/partial; - id="ABC@host.com"; - number=1; total=2 - - X-Weird-Header-1: Bar - X-Weird-Header-2: Hello - Message-ID: anotherid@foo.com - Content-type: audio/basic - Content-transfer-encoding: base64 - - ... first half of encoded audio data goes here... - - and the second half might look something like this: - - From: Bill@host.com - To: joe@otherhost.com - Subject: Audio mail - MIME-Version: 1.0 - Message-ID: id2@host.com - Content-type: message/partial; - id="ABC@host.com"; number=2; total=2 - - ... second half of encoded audio data goes here... - - Then, when the fragmented message is reassembled, the - resulting message to be displayed to the user should look - something like this: - - - - Borenstein & Freed [Page 39] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - X-Weird-Header-1: Foo - From: Bill@host.com - To: joe@otherhost.com - Subject: Audio mail - Message-ID: anotherid@foo.com - MIME-Version: 1.0 - Content-type: audio/basic - Content-transfer-encoding: base64 - - ... first half of encoded audio data goes here... - ... second half of encoded audio data goes here... - - It should be noted that, because some message transfer - agents may choose to automatically fragment large messages, - and because such agents may use different fragmentation - thresholds, it is possible that the pieces of a partial - message, upon reassembly, may prove themselves to comprise a - partial message. This is explicitly permitted. - - It should also be noted that the inclusion of a "References" - field in the headers of the second and subsequent pieces of - a fragmented message that references the Message-Id on the - previous piece may be of benefit to mail readers that - understand and track references. However, the generation of - such "References" fields is entirely optional. - - 7.3.3 The Message/External-Body subtype - - The external-body subtype indicates that the actual body - data are not included, but merely referenced. In this case, - the parameters describe a mechanism for accessing the - external data. - - When a message body or body part is of type - "message/external-body", it consists of a header, two - consecutive CRLFs, and the message header for the - encapsulated message. If another pair of consecutive CRLFs - appears, this of course ends the message header for the - encapsulated message. However, since the encapsulated - message's body is itself external, it does NOT appear in the - area that follows. For example, consider the following - message: - - Content-type: message/external-body; access- - type=local-file; - name=/u/nsb/Me.gif - - Content-type: image/gif - - THIS IS NOT REALLY THE BODY! - - The area at the end, which might be called the "phantom - body", is ignored for most external-body messages. However, - it may be used to contain auxilliary information for some - - - - Borenstein & Freed [Page 40] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - such messages, as indeed it is when the access-type is - "mail-server". Of the access-types defined by this - document, the phantom body is used only when the access-type - is "mail-server". In all other cases, the phantom body is - ignored. - - The only always-mandatory parameter for message/external- - body is "access-type"; all of the other parameters may be - mandatory or optional depending on the value of access-type. - - ACCESS-TYPE -- One or more case-insensitive words, - comma-separated, indicating supported access - mechanisms by which the file or data may be - obtained. Values include, but are not limited to, - "FTP", "ANON-FTP", "TFTP", "AFS", "LOCAL-FILE", - and "MAIL-SERVER". Future values, except for - experimental values beginning with "X-", must be - registered with IANA, as described in Appendix F . - - In addition, the following two parameters are optional for - ALL access-types: - - EXPIRATION -- The date (in the RFC 822 "date-time" - syntax, as extended by RFC 1123 to permit 4 digits - in the date field) after which the existence of - the external data is not guaranteed. - - SIZE -- The size (in octets) of the data. The - intent of this parameter is to help the recipient - decide whether or not to expend the necessary - resources to retrieve the external data. - - PERMISSION -- A field that indicates whether or - not it is expected that clients might also attempt - to overwrite the data. By default, or if - permission is "read", the assumption is that they - are not, and that if the data is retrieved once, - it is never needed again. If PERMISSION is "read- - write", this assumption is invalid, and any local - copy must be considered no more than a cache. - "Read" and "Read-write" are the only defined - values of permission. - - The precise semantics of the access-types defined here are - described in the sections that follow. - - 7.3.3.1 The "ftp" and "tftp" access-types - - An access-type of FTP or TFTP indicates that the message - body is accessible as a file using the FTP [RFC-959] or TFTP - [RFC-783] protocols, respectively. For these access-types, - the following additional parameters are mandatory: - - - - - - Borenstein & Freed [Page 41] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - NAME -- The name of the file that contains the - actual body data. - - SITE -- A machine from which the file may be - obtained, using the given protocol - - Before the data is retrieved, using these protocols, the - user will generally need to be asked to provide a login id - and a password for the machine named by the site parameter. - - In addition, the following optional parameters may also - appear when the access-type is FTP or ANON-FTP: - - DIRECTORY -- A directory from which the data named - by NAME should be retrieved. - - MODE -- A transfer mode for retrieving the - information, e.g. "image". - - 7.3.3.2 The "anon-ftp" access-type - - The "anon-ftp" access-type is identical to the "ftp" access - type, except that the user need not be asked to provide a - name and password for the specified site. Instead, the ftp - protocol will be used with login "anonymous" and a password - that corresponds to the user's email address. - - 7.3.3.3 The "local-file" and "afs" access-types - - An access-type of "local-file" indicates that the actual - body is accessible as a file on the local machine. An - access-type of "afs" indicates that the file is accessible - via the global AFS file system. In both cases, only a - single parameter is required: - - NAME -- The name of the file that contains the - actual body data. - - The following optional parameter may be used to describe the - locality of reference for the data, that is, the site or - sites at which the file is expected to be visible: - - SITE -- A domain specifier for a machine or set of - machines that are known to have access to the data - file. Asterisks may be used for wildcard matching - to a part of a domain name, such as - "*.bellcore.com", to indicate a set of machines on - which the data should be directly visible, while a - single asterisk may be used to indicate a file - that is expected to be universally available, - e.g., via a global file system. - - 7.3.3.4 The "mail-server" access-type - - - - - Borenstein & Freed [Page 42] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - The "mail-server" access-type indicates that the actual body - is available from a mail server. The mandatory parameter - for this access-type is: - - SERVER -- The email address of the mail server - from which the actual body data can be obtained. - - Because mail servers accept a variety of syntax, some of - which is multiline, the full command to be sent to a mail - server is not included as a parameter on the content-type - line. Instead, it may be provided as the "phantom body" - when the content-type is message/external-body and the - access-type is mail-server. - - Note that MIME does not define a mail server syntax. - Rather, it allows the inclusion of arbitrary mail server - commands in the phantom body. Implementations should - include the phantom body in the body of the message it sends - to the mail server address to retrieve the relevant data. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Borenstein & Freed [Page 43] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - 7.3.3.5 Examples and Further Explanations - - With the emerging possibility of very wide-area file - systems, it becomes very hard to know in advance the set of - machines where a file will and will not be accessible - directly from the file system. Therefore it may make sense - to provide both a file name, to be tried directly, and the - name of one or more sites from which the file is known to be - accessible. An implementation can try to retrieve remote - files using FTP or any other protocol, using anonymous file - retrieval or prompting the user for the necessary name and - password. If an external body is accessible via multiple - mechanisms, the sender may include multiple parts of type - message/external-body within an entity of type - multipart/alternative. - - However, the external-body mechanism is not intended to be - limited to file retrieval, as shown by the mail-server - access-type. Beyond this, one can imagine, for example, - using a video server for external references to video clips. - - If an entity is of type "message/external-body", then the - body of the entity will contain the header fields of the - encapsulated message. The body itself is to be found in the - external location. This means that if the body of the - "message/external-body" message contains two consecutive - CRLFs, everything after those pairs is NOT part of the - message itself. For most message/external-body messages, - this trailing area must simply be ignored. However, it is a - convenient place for additional data that cannot be included - in the content-type header field. In particular, if the - "access-type" value is "mail-server", then the trailing area - must contain commands to be sent to the mail server at the - address given by NAME@SITE, where NAME and SITE are the - values of the NAME and SITE parameters, respectively. - - The embedded message header fields which appear in the body - of the message/external-body data can be used to declare the - Content-type of the external body. Thus a complete - message/external-body message, referring to a document in - PostScript format, might look like this: - - From: Whomever - Subject: whatever - MIME-Version: 1.0 - Message-ID: id1@host.com - Content-Type: multipart/alternative; boundary=42 - - - --42 - Content-Type: message/external-body; - name="BodyFormats.ps"; - - - - - - Borenstein & Freed [Page 44] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - site="thumper.bellcore.com"; - access-type=ANON-FTP; - directory="pub"; - mode="image"; - expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" - - Content-type: application/postscript - - --42 - Content-Type: message/external-body; - name="/u/nsb/writing/rfcs/RFC-XXXX.ps"; - site="thumper.bellcore.com"; - access-type=AFS - expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" - - Content-type: application/postscript - - --42 - Content-Type: message/external-body; - access-type=mail-server - server="listserv@bogus.bitnet"; - expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" - - Content-type: application/postscript - - get rfc-xxxx doc - - --42-- - - Like the message/partial type, the message/external-body - type is intended to be transparent, that is, to convey the - data type in the external body rather than to convey a - message with a body of that type. Thus the headers on the - outer and inner parts must be merged using the same rules as - for message/partial. In particular, this means that the - Content-type header is overridden, but the From and Subject - headers are preserved. - - Note that since the external bodies are not transported as - mail, they need not conform to the 7-bit and line length - requirements, but might in fact be binary files. Thus a - Content-Transfer-Encoding is not generally necessary, though - it is permitted. - - Note that the body of a message of type "message/external- - body" is governed by the basic syntax for an RFC 822 - message. In particular, anything before the first - consecutive pair of CRLFs is header information, while - anything after it is body information, which is ignored for - most access-types. - - - - - - - - Borenstein & Freed [Page 45] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - 7.4 The Application Content-Type - - The "application" Content-Type is to be used for data which - do not fit in any of the other categories, and particularly - for data to be processed by mail-based uses of application - programs. This is information which must be processed by an - application before it is viewable or usable to a user. - Expected uses for Content-Type application include mail- - based file transfer, spreadsheets, data for mail-based - scheduling systems, and languages for "active" - (computational) email. (The latter, in particular, can pose - security problems which should be understood by - implementors, and are considered in detail in the discussion - of the application/PostScript content-type.) - - For example, a meeting scheduler might define a standard - representation for information about proposed meeting dates. - An intelligent user agent would use this information to - conduct a dialog with the user, and might then send further - mail based on that dialog. More generally, there have been - several "active" messaging languages developed in which - programs in a suitably specialized language are sent through - the mail and automatically run in the recipient's - environment. - - Such applications may be defined as subtypes of the - "application" Content-Type. This document defines three - subtypes: octet-stream, ODA, and PostScript. - - In general, the subtype of application will often be the - name of the application for which the data are intended. - This does not mean, however, that any application program - name may be used freely as a subtype of application. Such - usages must be registered with IANA, as described in - Appendix F. - - 7.4.1 The Application/Octet-Stream (primary) subtype - - The primary subtype of application, "octet-stream", may be - used to indicate that a body contains binary data. The set - of possible parameters includes, but is not limited to: - - NAME -- a suggested name for the binary data if - stored as a file. - - TYPE -- the general type or category of binary - data. This is intended as information for the - human recipient rather than for any automatic - processing. - - CONVERSIONS -- the set of operations that have - been performed on the data before putting it in - the mail (and before any Content-Transfer-Encoding - that might have been applied). If multiple - - - - Borenstein & Freed [Page 46] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - conversions have occurred, they must be separated - by commas and specified in the order they were - applied -- that is, the leftmost conversion must - have occurred first, and conversions are undone - from right to left. Note that NO conversion - values are defined by this document. Any - conversion values that that do not begin with "X-" - must be preceded by a published specification and - by registration with IANA, as described in - Appendix F. - - PADDING -- the number of bits of padding that were - appended to the bitstream comprising the actual - contents to produce the enclosed byte-oriented - data. This is useful for enclosing a bitstream in - a body when the total number of bits is not a - multiple of the byte size. - - The values for these attributes are left undefined at - present, but may require specification in the future. An - example of a common (though UNIX-specific) usage might be: - - Content-Type: application/octet-stream; - name=foo.tar.Z; type=tar; - conversions="x-encrypt,x-compress" - - However, it should be noted that the use of such conversions - is explicitly discouraged due to a lack of portability and - standardization. The use of uuencode is particularly - discouraged, in favor of the Content-Transfer-Encoding - mechanism, which is both more standardized and more portable - across mail boundaries. - - The recommended action for an implementation that receives - application/octet-stream mail is to simply offer to put the - data in a file, with any Content-Transfer-Encoding undone, - or perhaps to use it as input to a user-specified process. - - To reduce the danger of transmitting rogue programs through - the mail, it is strongly recommended that implementations - NOT implement a path-search mechanism whereby an arbitrary - program named in the Content-Type parameter (e.g., an - "interpreter=" parameter) is found and executed using the - mail body as input. - - 7.4.2 The Application/PostScript subtype - - A Content-Type of "application/postscript" indicates a - PostScript program. The language is defined in - [POSTSCRIPT]. It is recommended that Postscript as sent - through email should use Postscript document structuring - conventions if at all possible, and correctly. - - - - - - Borenstein & Freed [Page 47] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - The execution of general-purpose PostScript interpreters - entails serious security risks, and implementors are - discouraged from simply sending PostScript email bodies to - "off-the-shelf" interpreters. While it is usually safe to - send PostScript to a printer, where the potential for harm - is greatly constrained, implementors should consider all of - the following before they add interactive display of - PostScript bodies to their mail readers. - - The remainder of this section outlines some, though probably - not all, of the possible problems with sending PostScript - through the mail. - - Dangerous operations in the PostScript language include, but - may not be limited to, the PostScript operators deletefile, - renamefile, filenameforall, and file. File is only - dangerous when applied to something other than standard - input or output. Implementations may also define additional - nonstandard file operators; these may also pose a threat to - security. Filenameforall, the wildcard file search - operator, may appear at first glance to be harmless. Note, - however, that this operator has the potential to reveal - information about what files the recipient has access to, - and this information may itself be sensitive. Message - senders should avoid the use of potentially dangerous file - operators, since these operators are quite likely to be - unavailable in secure PostScript implementations. Message- - receiving and -displaying software should either completely - disable all potentially dangerous file operators or take - special care not to delegate any special authority to their - operation. These operators should be viewed as being done by - an outside agency when interpreting PostScript documents. - Such disabling and/or checking should be done completely - outside of the reach of the PostScript language itself; care - should be taken to insure that no method exists for - reenabling full-function versions of these operators. - - The PostScript language provides facilities for exiting the - normal interpreter, or server, loop. Changes made in this - "outer" environment are customarily retained across - documents, and may in some cases be retained semipermanently - in nonvolatile memory. The operators associated with exiting - the interpreter loop have the potential to interfere with - subsequent document processing. As such, their unrestrained - use constitutes a threat of service denial. PostScript - operators that exit the interpreter loop include, but may - not be limited to, the exitserver and startjob operators. - Message-sending software should not generate PostScript that - depends on exiting the interpreter loop to operate. The - ability to exit will probably be unavailable in secure - PostScript implementations. Message-receiving and - -displaying software should, if possible, disable the - ability to make retained changes to the PostScript - environment. Eliminate the startjob and exitserver commands. - - - - Borenstein & Freed [Page 48] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - If these commands cannot be eliminated, at least set the - password associated with them to a hard-to-guess value. - - PostScript provides operators for setting system-wide and - device-specific parameters. These parameter settings may be - retained across jobs and may potentially pose a threat to - the correct operation of the interpreter. The PostScript - operators that set system and device parameters include, but - may not be limited to, the setsystemparams and setdevparams - operators. Message-sending software should not generate - PostScript that depends on the setting of system or device - parameters to operate correctly. The ability to set these - parameters will probably be unavailable in secure PostScript - implementations. Message-receiving and -displaying software - should, if possible, disable the ability to change system - and device parameters. If these operators cannot be - disabled, at least set the password associated with them to - a hard-to-guess value. - - Some PostScript implementations provide nonstandard - facilities for the direct loading and execution of machine - code. Such facilities are quite obviously open to - substantial abuse. Message-sending software should not - make use of such features. Besides being totally hardware- - specific, they are also likely to be unavailable in secure - implementations of PostScript. Message-receiving and - -displaying software should not allow such operators to be - used if they exist. - - PostScript is an extensible language, and many, if not most, - implementations of it provide a number of their own - extensions. This document does not deal with such extensions - explicitly since they constitute an unknown factor. - Message-sending software should not make use of nonstandard - extensions; they are likely to be missing from some - implementations. Message-receiving and -displaying software - should make sure that any nonstandard PostScript operators - are secure and don't present any kind of threat. - - It is possible to write PostScript that consumes huge - amounts of various system resources. It is also possible to - write PostScript programs that loop infinitely. Both types - of programs have the potential to cause damage if sent to - unsuspecting recipients. Message-sending software should - avoid the construction and dissemination of such programs, - which is antisocial. Message-receiving and -displaying - software should provide appropriate mechanisms to abort - processing of a document after a reasonable amount of time - has elapsed. In addition, PostScript interpreters should be - limited to the consumption of only a reasonable amount of - any given system resource. - - Finally, bugs may exist in some PostScript interpreters - which could possibly be exploited to gain unauthorized - - - - Borenstein & Freed [Page 49] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - access to a recipient's system. Apart from noting this - possibility, there is no specific action to take to prevent - this, apart from the timely correction of such bugs if any - are found. - - 7.4.3 The Application/ODA subtype - - The "ODA" subtype of application is used to indicate that a - body contains information encoded according to the Office - Document Architecture [ODA] standards, using the ODIF - representation format. For application/oda, the Content- - Type line should also specify an attribute/value pair that - indicates the document application profile (DAP), using the - key word "profile". Thus an appropriate header field might - look like this: - - Content-Type: application/oda; profile=Q112 - - Consult the ODA standard [ODA] for further information. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Borenstein & Freed [Page 50] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - 7.5 The Image Content-Type - - A Content-Type of "image" indicates that the bodycontains an - image. The subtype names the specific image format. These - names are case insensitive. Two initial subtypes are "jpeg" - for the JPEG format, JFIF encoding, and "gif" for GIF format - [GIF]. - - The list of image subtypes given here is neither exclusive - nor exhaustive, and is expected to grow as more types are - registered with IANA, as described in Appendix F. - - 7.6 The Audio Content-Type - - A Content-Type of "audio" indicates that the body contains - audio data. Although there is not yet a consensus on an - "ideal" audio format for use with computers, there is a - pressing need for a format capable of providing - interoperable behavior. - - The initial subtype of "basic" is specified to meet this - requirement by providing an absolutely minimal lowest common - denominator audio format. It is expected that richer - formats for higher quality and/or lower bandwidth audio will - be defined by a later document. - - The content of the "audio/basic" subtype is audio encoded - using 8-bit ISDN u-law [PCM]. When this subtype is present, - a sample rate of 8000 Hz and a single channel is assumed. - - 7.7 The Video Content-Type - - A Content-Type of "video" indicates that the body contains a - time-varying-picture image, possibly with color and - coordinated sound. The term "video" is used extremely - generically, rather than with reference to any particular - technology or format, and is not meant to preclude subtypes - such as animated drawings encoded compactly. The subtype - "mpeg" refers to video coded according to the MPEG standard - [MPEG]. - - Note that although in general this document strongly - discourages the mixing of multiple media in a single body, - it is recognized that many so-called "video" formats include - a representation for synchronized audio, and this is - explicitly permitted for subtypes of "video". - - 7.8 Experimental Content-Type Values - - A Content-Type value beginning with the characters "X-" is a - private value, to be used by consenting mail systems by - mutual agreement. Any format without a rigorous and public - definition must be named with an "X-" prefix, and publicly - specified values shall never begin with "X-". (Older - - - - Borenstein & Freed [Page 51] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - versions of the widely-used Andrew system use the "X-BE2" - name, so new systems should probably choose a different - name.) - - In general, the use of "X-" top-level types is strongly - discouraged. Implementors should invent subtypes of the - existing types whenever possible. The invention of new - types is intended to be restricted primarily to the - development of new media types for email, such as digital - odors or holography, and not for new data formats in - general. In many cases, a subtype of application will be - more appropriate than a new top-level type. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Borenstein & Freed [Page 52] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - Summary - - Using the MIME-Version, Content-Type, and Content-Transfer- - Encoding header fields, it is possible to include, in a - standardized way, arbitrary types of data objects with RFC - 822 conformant mail messages. No restrictions imposed by - either RFC 821 or RFC 822 are violated, and care has been - taken to avoid problems caused by additional restrictions - imposed by the characteristics of some Internet mail - transport mechanisms (see Appendix B). The "multipart" and - "message" Content-Types allow mixing and hierarchical - structuring of objects of different types in a single - message. Further Content-Types provide a standardized - mechanism for tagging messages or body parts as audio, - image, or several other kinds of data. A distinguished - parameter syntax allows further specification of data format - details, particularly the specification of alternate - character sets. Additional optional header fields provide - mechanisms for certain extensions deemed desirable by many - implementors. Finally, a number of useful Content-Types are - defined for general use by consenting user agents, notably - text/richtext, message/partial, and message/external-body. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Borenstein & Freed [Page 53] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - Acknowledgements - - This document is the result of the collective effort of a - large number of people, at several IETF meetings, on the - IETF-SMTP and IETF-822 mailing lists, and elsewhere. - Although any enumeration seems doomed to suffer from - egregious omissions, the following are among the many - contributors to this effort: - - Harald Tveit Alvestrand Timo Lehtinen - Randall Atkinson John R. MacMillan - Philippe Brandon Rick McGowan - Kevin Carosso Leo Mclaughlin - Uhhyung Choi Goli Montaser-Kohsari - Cristian Constantinof Keith Moore - Mark Crispin Tom Moore - Dave Crocker Erik Naggum - Terry Crowley Mark Needleman - Walt Daniels John Noerenberg - Frank Dawson Mats Ohrman - Hitoshi Doi Julian Onions - Kevin Donnelly Michael Patton - Keith Edwards David J. Pepper - Chris Eich Blake C. Ramsdell - Johnny Eriksson Luc Rooijakkers - Craig Everhart Marshall T. Rose - Patrik Faeltstroem Jonathan Rosenberg - Erik E. Fair Jan Rynning - Roger Fajman Harri Salminen - Alain Fontaine Michael Sanderson - James M. Galvin Masahiro Sekiguchi - Philip Gladstone Mark Sherman - Thomas Gordon Keld Simonsen - Phill Gross Bob Smart - James Hamilton Peter Speck - Steve Hardcastle-Kille Henry Spencer - David Herron Einar Stefferud - Bruce Howard Michael Stein - Bill Janssen Klaus Steinberger - Olle Jaernefors Peter Svanberg - Risto Kankkunen James Thompson - Phil Karn Steve Uhler - Alan Katz Stuart Vance - Tim Kehres Erik van der Poel - Neil Katin Guido van Rossum - Kyuho Kim Peter Vanderbilt - Anders Klemets Greg Vaudreuil - John Klensin Ed Vielmetti - Valdis Kletniek Ryan Waldron - Jim Knowles Wally Wedel - Stev Knowles Sven-Ove Westberg - Bob Kummerfeld Brian Wideen - - - - - - Borenstein & Freed [Page 54] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - Pekka Kytolaakso John Wobus - Stellan Lagerstr.m Glenn Wright - Vincent Lau Rayan Zachariassen - Donald Lindsay David Zimmerman - The authors apologize for any omissions from this list, - which are certainly unintentional. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Borenstein & Freed [Page 55] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - Appendix A -- Minimal MIME-Conformance - - The mechanisms described in this document are open-ended. - It is definitely not expected that all implementations will - support all of the Content-Types described, nor that they - will all share the same extensions. In order to promote - interoperability, however, it is useful to define the - concept of "MIME-conformance" to define a certain level of - implementation that allows the useful interworking of - messages with content that differs from US ASCII text. In - this section, we specify the requirements for such - conformance. - - A mail user agent that is MIME-conformant MUST: - - 1. Always generate a "MIME-Version: 1.0" header - field. - - 2. Recognize the Content-Transfer-Encoding header - field, and decode all received data encoded with - either the quoted-printable or base64 - implementations. Encode any data sent that is - not in seven-bit mail-ready representation using - one of these transformations and include the - appropriate Content-Transfer-Encoding header - field, unless the underlying transport mechanism - supports non-seven-bit data, as SMTP does not. - - 3. Recognize and interpret the Content-Type - header field, and avoid showing users raw data - with a Content-Type field other than text. Be - able to send at least text/plain messages, with - the character set specified as a parameter if it - is not US-ASCII. - - 4. Explicitly handle the following Content-Type - values, to at least the following extents: - - Text: - -- Recognize and display "text" mail - with the character set "US-ASCII." - -- Recognize other character sets at - least to the extent of being able - to inform the user about what - character set the message uses. - -- Recognize the "ISO-8859-*" character - sets to the extent of being able to - display those characters that are - common to ISO-8859-* and US-ASCII, - namely all characters represented - by octet values 0-127. - -- For unrecognized subtypes, show or - offer to show the user the "raw" - version of the data. An ability at - - - - Borenstein & Freed [Page 56] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - least to convert "text/richtext" to - plain text, as shown in Appendix D, - is encouraged, but not required for - conformance. - Message: - --Recognize and display at least the - primary (822) encapsulation. - Multipart: - -- Recognize the primary (mixed) - subtype. Display all relevant - information on the message level - and the body part header level and - then display or offer to display - each of the body parts - individually. - -- Recognize the "alternative" subtype, - and avoid showing the user - redundant parts of - multipart/alternative mail. - -- Treat any unrecognized subtypes as if - they were "mixed". - Application: - -- Offer the ability to remove either of - the two types of Content-Transfer- - Encoding defined in this document - and put the resulting information - in a user file. - - 5. Upon encountering any unrecognized Content- - Type, an implementation must treat it as if it had - a Content-Type of "application/octet-stream" with - no parameter sub-arguments. How such data are - handled is up to an implementation, but likely - options for handling such unrecognized data - include offering the user to write it into a file - (decoded from its mail transport format) or - offering the user to name a program to which the - decoded data should be passed as input. - Unrecognized predefined types, which in a MIME- - conformant mailer might still include audio, - image, or video, should also be treated in this - way. - - A user agent that meets the above conditions is said to be - MIME-conformant. The meaning of this phrase is that it is - assumed to be "safe" to send virtually any kind of - properly-marked data to users of such mail systems, because - such systems will at least be able to treat the data as - undifferentiated binary, and will not simply splash it onto - the screen of unsuspecting users. There is another sense - in which it is always "safe" to send data in a format that - is MIME-conformant, which is that such data will not break - or be broken by any known systems that are conformant with - RFC 821 and RFC 822. User agents that are MIME-conformant - - - - Borenstein & Freed [Page 57] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - have the additional guarantee that the user will not be - shown data that were never intended to be viewed as text. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Borenstein & Freed [Page 58] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - Appendix B -- General Guidelines For Sending Email Data - - Internet email is not a perfect, homogeneous system. Mail - may become corrupted at several stages in its travel to a - final destination. Specifically, email sent throughout the - Internet may travel across many networking technologies. - Many networking and mail technologies do not support the - full functionality possible in the SMTP transport - environment. Mail traversing these systems is likely to be - modified in such a way that it can be transported. - - There exist many widely-deployed non-conformant MTAs in the - Internet. These MTAs, speaking the SMTP protocol, alter - messages on the fly to take advantage of the internal data - structure of the hosts they are implemented on, or are just - plain broken. - - The following guidelines may be useful to anyone devising a - data format (Content-Type) that will survive the widest - range of networking technologies and known broken MTAs - unscathed. Note that anything encoded in the base64 - encoding will satisfy these rules, but that some well-known - mechanisms, notably the UNIX uuencode facility, will not. - Note also that anything encoded in the Quoted-Printable - encoding will survive most gateways intact, but possibly not - some gateways to systems that use the EBCDIC character set. - - (1) Under some circumstances the encoding used for - data may change as part of normal gateway or user - agent operation. In particular, conversion from - base64 to quoted-printable and vice versa may be - necessary. This may result in the confusion of - CRLF sequences with line breaks in text body - parts. As such, the persistence of CRLF as - something other than a line break should not be - relied on. - - (2) Many systems may elect to represent and store - text data using local newline conventions. Local - newline conventions may not match the RFC822 CRLF - convention -- systems are known that use plain CR, - plain LF, CRLF, or counted records. The result is - that isolated CR and LF characters are not well - tolerated in general; they may be lost or - converted to delimiters on some systems, and hence - should not be relied on. - - (3) TAB (HT) characters may be misinterpreted or - may be automatically converted to variable numbers - of spaces. This is unavoidable in some - environments, notably those not based on the ASCII - character set. Such conversion is STRONGLY - DISCOURAGED, but it may occur, and mail formats - should not rely on the persistence of TAB (HT) - - - - Borenstein & Freed [Page 59] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - characters. - - (4) Lines longer than 76 characters may be wrapped - or truncated in some environments. Line wrapping - and line truncation are STRONGLY DISCOURAGED, but - unavoidable in some cases. Applications which - require long lines should somehow differentiate - between soft and hard line breaks. (A simple way - to do this is to use the quoted-printable - encoding.) - - (5) Trailing "white space" characters (SPACE, TAB - (HT)) on a line may be discarded by some transport - agents, while other transport agents may pad lines - with these characters so that all lines in a mail - file are of equal length. The persistence of - trailing white space, therefore, should not be - relied on. - - (6) Many mail domains use variations on the ASCII - character set, or use character sets such as - EBCDIC which contain most but not all of the US- - ASCII characters. The correct translation of - characters not in the "invariant" set cannot be - depended on across character converting gateways. - For example, this situation is a problem when - sending uuencoded information across BITNET, an - EBCDIC system. Similar problems can occur without - crossing a gateway, since many Internet hosts use - character sets other than ASCII internally. The - definition of Printable Strings in X.400 adds - further restrictions in certain special cases. In - particular, the only characters that are known to - be consistent across all gateways are the 73 - characters that correspond to the upper and lower - case letters A-Z and a-z, the 10 digits 0-9, and - the following eleven special characters: - - "'" (ASCII code 39) - "(" (ASCII code 40) - ")" (ASCII code 41) - "+" (ASCII code 43) - "," (ASCII code 44) - "-" (ASCII code 45) - "." (ASCII code 46) - "/" (ASCII code 47) - ":" (ASCII code 58) - "=" (ASCII code 61) - "?" (ASCII code 63) - - A maximally portable mail representation, such as - the base64 encoding, will confine itself to - relatively short lines of text in which the only - meaningful characters are taken from this set of - - - - Borenstein & Freed [Page 60] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - 73 characters. - - Please note that the above list is NOT a list of recommended - practices for MTAs. RFC 821 MTAs are prohibited from - altering the character of white space or wrapping long - lines. These BAD and illegal practices are known to occur - on established networks, and implementions should be robust - in dealing with the bad effects they can cause. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Borenstein & Freed [Page 61] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - Appendix C -- A Complex Multipart Example - - What follows is the outline of a complex multipart message. - This message has five parts to be displayed serially: two - introductory plain text parts, an embedded multipart - message, a richtext part, and a closing encapsulated text - message in a non-ASCII character set. The embedded - multipart message has two parts to be displayed in parallel, - a picture and an audio fragment. - - MIME-Version: 1.0 - From: Nathaniel Borenstein - Subject: A multipart example - Content-Type: multipart/mixed; - boundary=unique-boundary-1 - - This is the preamble area of a multipart message. - Mail readers that understand multipart format - should ignore this preamble. - If you are reading this text, you might want to - consider changing to a mail reader that understands - how to properly display multipart messages. - --unique-boundary-1 - - ...Some text appears here... - [Note that the preceding blank line means - no header fields were given and this is text, - with charset US ASCII. It could have been - done with explicit typing as in the next part.] - - --unique-boundary-1 - Content-type: text/plain; charset=US-ASCII - - This could have been part of the previous part, - but illustrates explicit versus implicit - typing of body parts. - - --unique-boundary-1 - Content-Type: multipart/parallel; - boundary=unique-boundary-2 - - - --unique-boundary-2 - Content-Type: audio/basic - Content-Transfer-Encoding: base64 - - ... base64-encoded 8000 Hz single-channel - u-law-format audio data goes here.... - - --unique-boundary-2 - Content-Type: image/gif - Content-Transfer-Encoding: Base64 - - - - - - Borenstein & Freed [Page 62] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - ... base64-encoded image data goes here.... - - --unique-boundary-2-- - - --unique-boundary-1 - Content-type: text/richtext - - This is richtext. - Isn't it - cool? - - --unique-boundary-1 - Content-Type: message/rfc822 - - From: (name in US-ASCII) - Subject: (subject in US-ASCII) - Content-Type: Text/plain; charset=ISO-8859-1 - Content-Transfer-Encoding: Quoted-printable - - ... Additional text in ISO-8859-1 goes here ... - - --unique-boundary-1-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Borenstein & Freed [Page 63] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - Appendix D -- A Simple Richtext-to-Text Translator in C - - One of the major goals in the design of the richtext subtype - of the text Content-Type is to make formatted text so simple - that even text-only mailers will implement richtext-to- - plain-text translators, thus increasing the likelihood that - multifont text will become "safe" to use very widely. To - demonstrate this simplicity, what follows is an extremely - simple 44-line C program that converts richtext input into - plain text output: - - #include - #include - main() { - int c, i; - char token[50]; - - while((c = getc(stdin)) != EOF) { - if (c == '<') { - for (i=0; (i<49 && (c = getc(stdin)) != '>' - && c != EOF); ++i) { - token[i] = isupper(c) ? tolower(c) : c; - } - if (c == EOF) break; - if (c != '>') while ((c = getc(stdin)) != - '>' - && c != EOF) {;} - if (c == EOF) break; - token[i] = '\0'; - if (!strcmp(token, "lt")) { - putc('<', stdout); - } else if (!strcmp(token, "nl")) { - putc('\n', stdout); - } else if (!strcmp(token, "/paragraph")) { - fputs("\n\n", stdout); - } else if (!strcmp(token, "comment")) { - int commct=1; - while (commct > 0) { - while ((c = getc(stdin)) != '<' - && c != EOF) ; - if (c == EOF) break; - for (i=0; (c = getc(stdin)) != '>' - && c != EOF; ++i) { - token[i] = isupper(c) ? - tolower(c) : c; - } - if (c== EOF) break; - token[i] = NULL; - if (!strcmp(token, "/comment")) -- - commct; - if (!strcmp(token, "comment")) - ++commct; - - - - - - Borenstein & Freed [Page 64] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - } - } /* Ignore all other tokens */ - } else if (c != '\n') putc(c, stdout); - } - putc('\n', stdout); /* for good measure */ - } - It should be noted that one can do considerably better than - this in displaying richtext data on a dumb terminal. In - particular, one can replace font information such as "bold" - with textual emphasis (like *this* or _T_H_I_S_). One can - also properly handle the richtext formatting commands - regarding indentation, justification, and others. However, - the above program is all that is necessary in order to - present richtext on a dumb terminal. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Borenstein & Freed [Page 65] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - Appendix E -- Collected Grammar - - This appendix contains the complete BNF grammar for all the - syntax specified by this document. - - By itself, however, this grammar is incomplete. It refers - to several entities that are defined by RFC 822. Rather - than reproduce those definitions here, and risk - unintentional differences between the two, this document - simply refers the reader to RFC 822 for the remaining - definitions. Wherever a term is undefined, it refers to the - RFC 822 definition. - - attribute := token - - body-part = <"message" as defined in RFC 822, - with all header fields optional, and with the - specified delimiter not occurring anywhere in - the message body, either on a line by itself - or as a substring anywhere.> - - boundary := 0*69 bcharsnospace - - bchars := bcharsnospace / " " - - bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / "+" / - "_" - / "," / "-" / "." / "/" / ":" / "=" / "?" - - close-delimiter := delimiter "--" - - Content-Description := *text - - Content-ID := msg-id - - Content-Transfer-Encoding := "BASE64" / "QUOTED- - PRINTABLE" / - "8BIT" / "7BIT" / - "BINARY" / x-token - - Content-Type := type "/" subtype *[";" parameter] - - delimiter := CRLF "--" boundary ; taken from Content-Type - field. - ; when content-type is - multipart - ; There should be no space - ; between "--" and boundary. - - encapsulation := delimiter CRLF body-part - - epilogue := *text ; to be ignored upon - receipt. - - - - - Borenstein & Freed [Page 66] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - MIME-Version := 1*text - - multipart-body := preamble 1*encapsulation close-delimiter - epilogue - - parameter := attribute "=" value - - preamble := *text ; to be ignored upon - receipt. - - subtype := token - - token := 1* - - tspecials := "(" / ")" / "<" / ">" / "@" ; Must be in - / "," / ";" / ":" / "\" / <"> ; quoted-string, - / "/" / "[" / "]" / "?" / "." ; to use within - / "=" ; parameter values - - - type := "application" / "audio" ; case- - insensitive - / "image" / "message" - / "multipart" / "text" - / "video" / x-token - - value := token / quoted-string - - x-token := - - - - - - - - - - - - - - - - - - - - - - - - - - - - Borenstein & Freed [Page 67] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - Appendix F -- IANA Registration Procedures - - MIME has been carefully designed to have extensible - mechanisms, and it is expected that the set of content- - type/subtype pairs and their associated parameters will grow - significantly with time. Several other MIME fields, notably - character set names, access-type parameters for the - message/external-body type, conversions parameters for the - application type, and possibly even Content-Transfer- - Encoding values, are likely to have new values defined over - time. In order to ensure that the set of such values is - developed in an orderly, well-specified, and public manner, - MIME defines a registration process which uses the Internet - Assigned Numbers Authority (IANA) as a central registry for - such values. - - In general, parameters in the content-type header field are - used to convey supplemental information for various content - types, and their use is defined when the content-type and - subtype are defined. New parameters should not be defined - as a way to introduce new functionality. - - In order to simplify and standardize the registration - process, this appendix gives templates for the registration - of new values with IANA. Each of these is given in the form - of an email message template, to be filled in by the - registering party. - - F.1 Registration of New Content-type/subtype Values - - Note that MIME is generally expected to be extended by - subtypes. If a new fundamental top-level type is needed, - its specification should be published as an RFC or - submitted in a form suitable to become an RFC, and be - subject to the Internet standards process. - - To: IANA@isi.edu - Subject: Registration of new MIME content-type/subtype - - MIME type name: - - (If the above is not an existing top-level MIME type, - please explain why an existing type cannot be used.) - - MIME subtype name: - - Required parameters: - - Optional parameters: - - Encoding considerations: - - Security considerations: - - - - - Borenstein & Freed [Page 68] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - Published specification: - - (The published specification must be an Internet RFC or - RFC-to-be if a new top-level type is being defined, and - must be a publicly available specification in any - case.) - - Person & email address to contact for further - information: - F.2 Registration of New Character Set Values - - To: IANA@isi.edu - Subject: Registration of new MIME character set value - - MIME character set name: - - Published specification: - - (The published specification must be an Internet RFC or - RFC-to-be or an international standard.) - - Person & email address to contact for further - information: - - F.3 Registration of New Access-type Values for - Message/external-body - - To: IANA@isi.edu - Subject: Registration of new MIME Access-type for - Message/external-body content-type - - MIME access-type name: - - Required parameters: - - Optional parameters: - - Published specification: - - (The published specification must be an Internet RFC or - RFC-to-be.) - - Person & email address to contact for further - information: - - - F.4 Registration of New Conversions Values for Application - - To: IANA@isi.edu - Subject: Registration of new MIME Conversions value - for Application content-type - - MIME Conversions name: - - - - - Borenstein & Freed [Page 69] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - Published specification: - - (The published specification must be an Internet RFC or - RFC-to-be.) - - Person & email address to contact for further - information: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Borenstein & Freed [Page 70] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - Appendix G -- Summary of the Seven Content-types - - Content-type: text - - Subtypes defined by this document: plain, richtext - - Important Parameters: charset - - Encoding notes: quoted-printable generally preferred if an - encoding is needed and the character set is mostly an - ASCII superset. - - Security considerations: Rich text formats such as TeX and - Troff often contain mechanisms for executing arbitrary - commands or file system operations, and should not be - used automatically unless these security problems have - been addressed. Even plain text may contain control - characters that can be used to exploit the capabilities - of "intelligent" terminals and cause security - violations. User interfaces designed to run on such - terminals should be aware of and try to prevent such - problems. - ________________________________________________________________ - - Content-type: multipart - - Subtypes defined by this document: mixed, alternative, - digest, parallel. - - Important Parameters: boundary - - Encoding notes: No content-transfer-encoding is permitted. - - ________________________________________________________________ - - Content-type: message - - Subtypes defined by this document: rfc822, partial, - external-body - - Important Parameters: id, number, total - - Encoding notes: No content-transfer-encoding is permitted. - - ________________________________________________________________ - - Content-type: application - - Subtypes defined by this document: octet-stream, - postscript, oda - - Important Parameters: profile - - - - - - Borenstein & Freed [Page 71] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - Encoding notes: base64 generally preferred for octet-stream - or other unreadable subtypes. - - Security considerations: This type is intended for the - transmission of data to be interpreted by locally-installed - programs. If used, for example, to transmit executable - binary programs or programs in general-purpose interpreted - languages, such as LISP programs or shell scripts, severe - security problems could result. In general, authors of - mail-reading agents are cautioned against giving their - systems the power to execute mail-based application data - without carefully considering the security implications. - While it is certainly possible to define safe application - formats and even safe interpreters for unsafe formats, each - interpreter should be evaluated separately for possible - security problems. - ________________________________________________________________ - - Content-type: image - - Subtypes defined by this document: jpeg, gif - - Important Parameters: none - - Encoding notes: base64 generally preferred - - ________________________________________________________________ - - Content-type: audio - - Subtypes defined by this document: basic - - Important Parameters: none - - Encoding notes: base64 generally preferred - - ________________________________________________________________ - - Content-type: video - - Subtypes defined by this document: mpeg - - Important Parameters: none - - Encoding notes: base64 generally preferred - - - - - - - - - - - - - Borenstein & Freed [Page 72] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - Appendix H -- Canonical Encoding Model - - - - There was some confusion, in earlier drafts of this memo, - regarding the model for when email data was to be converted - to canonical form and encoded, and in particular how this - process would affect the treatment of CRLFs, given that the - representation of newlines varies greatly from system to - system. For this reason, a canonical model for encoding is - presented below. - - The process of composing a MIME message part can be modelled - as being done in a number of steps. Note that these steps - are roughly similar to those steps used in RFC1113: - - Step 1. Creation of local form. - - The body part to be transmitted is created in the system's - native format. The native character set is used, and where - appropriate local end of line conventions are used as well. - The may be a UNIX-style text file, or a Sun raster image, or - a VMS indexed file, or audio data in a system-dependent - format stored only in memory, or anything else that - corresponds to the local model for the representation of - some form of information. - - Step 2. Conversion to canonical form. - - The entire body part, including "out-of-band" information - such as record lengths and possibly file attribute - information, is converted to a universal canonical form. - The specific content type of the body part as well as its - associated attributes dictate the nature of the canonical - form that is used. Conversion to the proper canonical form - may involve character set conversion, transformation of - audio data, compression, or various other operations - specific to the various content types. - - For example, in the case of text/plain data, the text must - be converted to a supported character set and lines must be - delimited with CRLF delimiters in accordance with RFC822. - Note that the restriction on line lengths implied by RFC822 - is eliminated if the next step employs either quoted- - printable or base64 encoding. - - Step 3. Apply transfer encoding. - - A Content-Transfer-Encoding appropriate for this body part - is applied. Note that there is no fixed relationship - between the content type and the transfer encoding. In - particular, it may be appropriate to base the choice of - base64 or quoted-printable on character frequency counts - which are specific to a given instance of body part. - - - - Borenstein & Freed [Page 73] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - Step 4. Insertion into message. - - The encoded object is inserted into a MIME message with - appropriate body part headers and boundary markers. - - It is vital to note that these steps are only a model; they - are specifically NOT a blueprint for how an actual system - would be built. In particular, the model fails to account - for two common designs: - - 1. In many cases the conversion to a canonical - form prior to encoding will be subsumed into the - encoder itself, which understands local formats - directly. For example, the local newline - convention for text bodyparts might be carried - through to the encoder itself along with knowledge - of what that format is. - - 2. The output of the encoders may have to pass - through one or more additional steps prior to - being transmitted as a message. As such, the - output of the encoder may not be compliant with - the formats specified by RFC822. In particular, - once again it may be appropriate for the - converter's output to be expressed using local - newline conventions rather than using the standard - RFC822 CRLF delimiters. - - Other implementation variations are conceivable as well. - The only important aspect of this discussion is that the - resulting messages are consistent with those produced by the - model described here. - - - - - - - - - - - - - - - - - - - - - - - - - - Borenstein & Freed [Page 74] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - References - - [US-ASCII] Coded Character Set--7-Bit American Standard Code - for Information Interchange, ANSI X3.4-1986. - - [ATK] Borenstein, Nathaniel S., Multimedia Applications - Development with the Andrew Toolkit, Prentice-Hall, 1990. - - [GIF] Graphics Interchange Format (Version 89a), Compuserve, - Inc., Columbus, Ohio, 1990. - - [ISO-2022] International Standard--Information Processing-- - ISO 7-bit and 8-bit coded character sets--Code extension - techniques, ISO 2022:1986. - - [ISO-8859] Information Processing -- 8-bit Single-Byte Coded - Graphic Character Sets -- Part 1: Latin Alphabet No. 1, ISO - 8859-1:1987. Part 2: Latin alphabet No. 2, ISO 8859-2, - 1987. Part 3: Latin alphabet No. 3, ISO 8859-3, 1988. Part - 4: Latin alphabet No. 4, ISO 8859-4, 1988. Part 5: - Latin/Cyrillic alphabet, ISO 8859-5, 1988. Part 6: - Latin/Arabic alphabet, ISO 8859-6, 1987. Part 7: - Latin/Greek alphabet, ISO 8859-7, 1987. Part 8: - Latin/Hebrew alphabet, ISO 8859-8, 1988. Part 9: Latin - alphabet No. 5, ISO 8859-9, 1990. - - [ISO-646] International Standard--Information Processing-- - ISO 7-bit coded character set for information interchange, - ISO 646:1983. - - [MPEG] Video Coding Draft Standard ISO 11172 CD, ISO - IEC/TJC1/SC2/WG11 (Motion Picture Experts Group), May, 1991. - - [ODA] ISO 8613; Information Processing: Text and Office - System; Office Document Architecture (ODA) and Interchange - Format (ODIF), Part 1-8, 1989. - - [PCM] CCITT, Fascicle III.4 - Recommendation G.711, Geneva, - 1972, "Pulse Code Modulation (PCM) of Voice Frequencies". - - [POSTSCRIPT] Adobe Systems, Inc., PostScript Language - Reference Manual, Addison-Wesley, 1985. - - [X400] Schicker, Pietro, "Message Handling Systems, X.400", - Message Handling Systems and Distributed Applications, E. - Stefferud, O-j. Jacobsen, and P. Schicker, eds., North- - Holland, 1989, pp. 3-41. - - [RFC-783] Sollins, K.R. TFTP Protocol (revision 2). June, - 1981, MIT, RFC-783. - - [RFC-821] Postel, J.B. Simple Mail Transfer Protocol. - August, 1982, USC/Information Sciences Institute, RFC-821. - - - - - Borenstein & Freed [Page 75] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - [RFC-822] Crocker, D. Standard for the format of ARPA - Internet text messages. August, 1982, UDEL, RFC-822. - - [RFC-934] Rose, M.T.; Stefferud, E.A. Proposed standard - for message encapsulation. January, 1985, Delaware - and NMA, RFC-934. - - [RFC-959] Postel, J.B.; Reynolds, J.K. File Transfer - Protocol. October, 1985, USC/Information Sciences - Institute, RFC-959. - - [RFC-1049] Sirbu, M.A. Content-Type header field for - Internet messages. March, 1988, CMU, RFC-1049. - - [RFC-1113] Linn, J. Privacy enhancement for Internet - electronic mail: Part I - message encipherment and - authentication procedures. August, 1989, IAB Privacy Task - Force, RFC-1113. - - [RFC-1154] Robinson, D.; Ullmann, R. Encoding header field - for Internet messages. April, 1990, Prime Computer, - Inc., RFC-1154. - - [RFC-1342] Moore, Keith, Representation of Non-Ascii Text in - Internet Message Headers. June, 1992, University of - Tennessee, RFC-1342. - - Security Considerations - - Security issues are discussed in Section 7.4.2 and in - Appendix G. Implementors should pay special attention to - the security implications of any mail content-types that can - cause the remote execution of any actions in the recipient's - environment. In such cases, the discussion of the - applicaton/postscript content-type in Section 7.4.2 may - serve as a model for considering other content-types with - remote execution capabilities. - - - - - - - - - - - - - - - - - - - - - Borenstein & Freed [Page 76] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - Authors' Addresses - - For more information, the authors of this document may be - contacted via Internet mail: - - Nathaniel S. Borenstein - MRE 2D-296, Bellcore - 445 South St. - Morristown, NJ 07962-1910 - - Phone: +1 201 829 4270 - Fax: +1 201 829 7019 - Email: nsb@bellcore.com - - - Ned Freed - Innosoft International, Inc. - 250 West First Street - Suite 240 - Claremont, CA 91711 - - Phone: +1 714 624 7907 - Fax: +1 714 621 5319 - Email: ned@innosoft.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Borenstein & Freed [Page 77] - - - - - RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992 - - - - - - THIS PAGE INTENTIONALLY LEFT BLANK. - - Please discard this page and place the following table of - contents after the title page. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Borenstein & Freed [Page i] - - - - - - - - - Table of Contents - - - 1 Introduction....................................... 1 - 2 Notations, Conventions, and Generic BNF Grammar.... 3 - 3 The MIME-Version Header Field...................... 5 - 4 The Content-Type Header Field...................... 6 - 5 The Content-Transfer-Encoding Header Field......... 10 - 5.1 Quoted-Printable Content-Transfer-Encoding......... 14 - 5.2 Base64 Content-Transfer-Encoding................... 17 - 6 Additional Optional Content- Header Fields......... 19 - 6.1 Optional Content-ID Header Field................... 19 - 6.2 Optional Content-Description Header Field.......... 19 - 7 The Predefined Content-Type Values................. 20 - 7.1 The Text Content-Type.............................. 20 - 7.1.1 The charset parameter.............................. 20 - 7.1.2 The Text/plain subtype............................. 23 - 7.1.3 The Text/richtext subtype.......................... 23 - 7.2 The Multipart Content-Type......................... 29 - 7.2.1 Multipart: The common syntax...................... 30 - 7.2.2 The Multipart/mixed (primary) subtype.............. 34 - 7.2.3 The Multipart/alternative subtype.................. 34 - 7.2.4 The Multipart/digest subtype....................... 36 - 7.2.5 The Multipart/parallel subtype..................... 36 - 7.3 The Message Content-Type........................... 37 - 7.3.1 The Message/rfc822 (primary) subtype............... 37 - 7.3.2 The Message/Partial subtype........................ 37 - 7.3.3 The Message/External-Body subtype.................. 40 - 7.4 The Application Content-Type....................... 46 - 7.4.1 The Application/Octet-Stream (primary) subtype..... 46 - 7.4.2 The Application/PostScript subtype................. 47 - 7.4.3 The Application/ODA subtype........................ 50 - 7.5 The Image Content-Type............................. 51 - 7.6 The Audio Content-Type............................. 51 - 7.7 The Video Content-Type............................. 51 - 7.8 Experimental Content-Type Values................... 51 - Summary............................................ 53 - Acknowledgements................................... 54 - Appendix A -- Minimal MIME-Conformance............. 56 - Appendix B -- General Guidelines For Sending Email Data59 - Appendix C -- A Complex Multipart Example.......... 62 - Appendix D -- A Simple Richtext-to-Text Translator in C64 - Appendix E -- Collected Grammar.................... 66 - Appendix F -- IANA Registration Procedures......... 68 - F.1 Registration of New Content-type/subtype Values..68 - F.2 Registration of New Character Set Values...... 69 - F.3 Registration of New Access-type Values for Message/external-body69 - F.4 Registration of New Conversions Values for Application69 - Appendix G -- Summary of the Seven Content-types... 71 - Appendix H -- Canonical Encoding Model............. 73 - References......................................... 75 - Security Considerations............................ 76 - Authors' Addresses................................. 77 - - - - Borenstein & Freed [Page ii] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Borenstein & Freed [Page iii] - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc1521.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc1521.txt deleted file mode 100644 index 074ba41..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc1521.txt +++ /dev/null @@ -1,4539 +0,0 @@ - - - - - - -Network Working Group N. Borenstein -Request for Comments: 1521 Bellcore -Obsoletes: 1341 N. Freed -Category: Standards Track Innosoft - September 1993 - - - MIME (Multipurpose Internet Mail Extensions) Part One: - Mechanisms for Specifying and Describing - the Format of Internet Message Bodies - -Status of this Memo - - This RFC specifies an Internet standards track protocol for the - Internet community, and requests discussion and suggestions for - improvements. Please refer to the current edition of the "Internet - Official Protocol Standards" for the standardization state and status - of this protocol. Distribution of this memo is unlimited. - -Abstract - - STD 11, RFC 822 defines a message representation protocol which - specifies considerable detail about message headers, but which leaves - the message content, or message body, as flat ASCII text. This - document redefines the format of message bodies to allow multi-part - textual and non-textual message bodies to be represented and - exchanged without loss of information. This is based on earlier work - documented in RFC 934 and STD 11, RFC 1049, but extends and revises - that work. Because RFC 822 said so little about message bodies, this - document is largely orthogonal to (rather than a revision of) RFC - 822. - - In particular, this document is designed to provide facilities to - include multiple objects in a single message, to represent body text - in character sets other than US-ASCII, to represent formatted multi- - font text messages, to represent non-textual material such as images - and audio fragments, and generally to facilitate later extensions - defining new types of Internet mail for use by cooperating mail - agents. - - This document does NOT extend Internet mail header fields to permit - anything other than US-ASCII text data. Such extensions are the - subject of a companion document [RFC-1522]. - - This document is a revision of RFC 1341. Significant differences - from RFC 1341 are summarized in Appendix H. - - - - - -Borenstein & Freed [Page 1] - -RFC 1521 MIME September 1993 - - -Table of Contents - - 1. Introduction....................................... 3 - 2. Notations, Conventions, and Generic BNF Grammar.... 6 - 3. The MIME-Version Header Field...................... 7 - 4. The Content-Type Header Field...................... 9 - 5. The Content-Transfer-Encoding Header Field......... 13 - 5.1. Quoted-Printable Content-Transfer-Encoding......... 18 - 5.2. Base64 Content-Transfer-Encoding................... 21 - 6. Additional Content-Header Fields................... 23 - 6.1. Optional Content-ID Header Field................... 23 - 6.2. Optional Content-Description Header Field.......... 24 - 7. The Predefined Content-Type Values................. 24 - 7.1. The Text Content-Type.............................. 24 - 7.1.1. The charset parameter.............................. 25 - 7.1.2. The Text/plain subtype............................. 28 - 7.2. The Multipart Content-Type......................... 28 - 7.2.1. Multipart: The common syntax...................... 29 - 7.2.2. The Multipart/mixed (primary) subtype.............. 34 - 7.2.3. The Multipart/alternative subtype.................. 34 - 7.2.4. The Multipart/digest subtype....................... 36 - 7.2.5. The Multipart/parallel subtype..................... 37 - 7.2.6. Other Multipart subtypes........................... 37 - 7.3. The Message Content-Type........................... 38 - 7.3.1. The Message/rfc822 (primary) subtype............... 38 - 7.3.2. The Message/Partial subtype........................ 39 - 7.3.3. The Message/External-Body subtype.................. 42 - 7.3.3.1. The "ftp" and "tftp" access-types............... 44 - 7.3.3.2. The "anon-ftp" access-type...................... 45 - 7.3.3.3. The "local-file" and "afs" access-types......... 45 - 7.3.3.4. The "mail-server" access-type................... 45 - 7.3.3.5. Examples and Further Explanations............... 46 - 7.4. The Application Content-Type....................... 49 - 7.4.1. The Application/Octet-Stream (primary) subtype..... 50 - 7.4.2. The Application/PostScript subtype................. 50 - 7.4.3. Other Application subtypes......................... 53 - 7.5. The Image Content-Type............................. 53 - 7.6. The Audio Content-Type............................. 54 - 7.7. The Video Content-Type............................. 54 - 7.8. Experimental Content-Type Values................... 54 - 8. Summary............................................ 56 - 9. Security Considerations............................ 56 - 10. Authors' Addresses................................. 57 - 11. Acknowledgements................................... 58 - Appendix A -- Minimal MIME-Conformance.................... 60 - Appendix B -- General Guidelines For Sending Email Data... 63 - Appendix C -- A Complex Multipart Example................. 66 - Appendix D -- Collected Grammar........................... 68 - - - -Borenstein & Freed [Page 2] - -RFC 1521 MIME September 1993 - - - Appendix E -- IANA Registration Procedures................ 72 - E.1 Registration of New Content-type/subtype Values...... 72 - E.2 Registration of New Access-type Values - for Message/external-body............................ 73 - Appendix F -- Summary of the Seven Content-types.......... 74 - Appendix G -- Canonical Encoding Model.................... 76 - Appendix H -- Changes from RFC 1341....................... 78 - References................................................ 80 - -1. Introduction - - Since its publication in 1982, STD 11, RFC 822 [RFC-822] has defined - the standard format of textual mail messages on the Internet. Its - success has been such that the RFC 822 format has been adopted, - wholly or partially, well beyond the confines of the Internet and the - Internet SMTP transport defined by STD 10, RFC 821 [RFC-821]. As the - format has seen wider use, a number of limitations have proven - increasingly restrictive for the user community. - - RFC 822 was intended to specify a format for text messages. As such, - non-text messages, such as multimedia messages that might include - audio or images, are simply not mentioned. Even in the case of text, - however, RFC 822 is inadequate for the needs of mail users whose - languages require the use of character sets richer than US ASCII - [US-ASCII]. Since RFC 822 does not specify mechanisms for mail - containing audio, video, Asian language text, or even text in most - European languages, additional specifications are needed. - - One of the notable limitations of RFC 821/822 based mail systems is - the fact that they limit the contents of electronic mail messages to - relatively short lines of seven-bit ASCII. This forces users to - convert any non-textual data that they may wish to send into seven- - bit bytes representable as printable ASCII characters before invoking - a local mail UA (User Agent, a program with which human users send - and receive mail). Examples of such encodings currently used in the - Internet include pure hexadecimal, uuencode, the 3-in-4 base 64 - scheme specified in RFC 1421, the Andrew Toolkit Representation - [ATK], and many others. - - The limitations of RFC 822 mail become even more apparent as gateways - are designed to allow for the exchange of mail messages between RFC - 822 hosts and X.400 hosts. X.400 [X400] specifies mechanisms for the - inclusion of non-textual body parts within electronic mail messages. - The current standards for the mapping of X.400 messages to RFC 822 - messages specify either that X.400 non-textual body parts must be - converted to (not encoded in) an ASCII format, or that they must be - discarded, notifying the RFC 822 user that discarding has occurred. - This is clearly undesirable, as information that a user may wish to - - - -Borenstein & Freed [Page 3] - -RFC 1521 MIME September 1993 - - - receive is lost. Even though a user's UA may not have the capability - of dealing with the non-textual body part, the user might have some - mechanism external to the UA that can extract useful information from - the body part. Moreover, it does not allow for the fact that the - message may eventually be gatewayed back into an X.400 message - handling system (i.e., the X.400 message is "tunneled" through - Internet mail), where the non-textual information would definitely - become useful again. - - This document describes several mechanisms that combine to solve most - of these problems without introducing any serious incompatibilities - with the existing world of RFC 822 mail. In particular, it - describes: - - 1. A MIME-Version header field, which uses a version number to - declare a message to be conformant with this specification and - allows mail processing agents to distinguish between such - messages and those generated by older or non-conformant software, - which is presumed to lack such a field. - - 2. A Content-Type header field, generalized from RFC 1049 [RFC-1049], - which can be used to specify the type and subtype of data in the - body of a message and to fully specify the native representation - (encoding) of such data. - - 2.a. A "text" Content-Type value, which can be used to represent - textual information in a number of character sets and - formatted text description languages in a standardized - manner. - - 2.b. A "multipart" Content-Type value, which can be used to - combine several body parts, possibly of differing types of - data, into a single message. - - 2.c. An "application" Content-Type value, which can be used to - transmit application data or binary data, and hence, among - other uses, to implement an electronic mail file transfer - service. - - 2.d. A "message" Content-Type value, for encapsulating another - mail message. - - 2.e An "image" Content-Type value, for transmitting still image - (picture) data. - - 2.f. An "audio" Content-Type value, for transmitting audio or - voice data. - - - - -Borenstein & Freed [Page 4] - -RFC 1521 MIME September 1993 - - - 2.g. A "video" Content-Type value, for transmitting video or - moving image data, possibly with audio as part of the - composite video data format. - - 3. A Content-Transfer-Encoding header field, which can be used to - specify an auxiliary encoding that was applied to the data in - order to allow it to pass through mail transport mechanisms which - may have data or character set limitations. - - 4. Two additional header fields that can be used to further describe - the data in a message body, the Content-ID and Content- - Description header fields. - - MIME has been carefully designed as an extensible mechanism, and it - is expected that the set of content-type/subtype pairs and their - associated parameters will grow significantly with time. Several - other MIME fields, notably including character set names, are likely - to have new values defined over time. In order to ensure that the - set of such values is developed in an orderly, well-specified, and - public manner, MIME defines a registration process which uses the - Internet Assigned Numbers Authority (IANA) as a central registry for - such values. Appendix E provides details about how IANA registration - is accomplished. - - Finally, to specify and promote interoperability, Appendix A of this - document provides a basic applicability statement for a subset of the - above mechanisms that defines a minimal level of "conformance" with - this document. - - HISTORICAL NOTE: Several of the mechanisms described in this - document may seem somewhat strange or even baroque at first - reading. It is important to note that compatibility with existing - standards AND robustness across existing practice were two of the - highest priorities of the working group that developed this - document. In particular, compatibility was always favored over - elegance. - - MIME was first defined and published as RFCs 1341 and 1342 [RFC-1341] - [RFC-1342]. This document is a relatively minor updating of RFC - 1341, and is intended to supersede it. The differences between this - document and RFC 1341 are summarized in Appendix H. Please refer to - the current edition of the "IAB Official Protocol Standards" for the - standardization state and status of this protocol. Several other RFC - documents will be of interest to the MIME implementor, in particular - [RFC 1343], [RFC-1344], and [RFC-1345]. - - - - - - -Borenstein & Freed [Page 5] - -RFC 1521 MIME September 1993 - - -2. Notations, Conventions, and Generic BNF Grammar - - This document is being published in two versions, one as plain ASCII - text and one as PostScript (PostScript is a trademark of Adobe - Systems Incorporated.). While the text version is the official - specification, some will find the PostScript version easier to read. - The textual contents are identical. An Andrew-format copy of this - document is also available from the first author (Borenstein). - - Although the mechanisms specified in this document are all described - in prose, most are also described formally in the modified BNF - notation of RFC 822. Implementors will need to be familiar with this - notation in order to understand this specification, and are referred - to RFC 822 for a complete explanation of the modified BNF notation. - - Some of the modified BNF in this document makes reference to - syntactic entities that are defined in RFC 822 and not in this - document. A complete formal grammar, then, is obtained by combining - the collected grammar appendix of this document with that of RFC 822 - plus the modifications to RFC 822 defined in RFC 1123, which - specifically changes the syntax for `return', `date' and `mailbox'. - - The term CRLF, in this document, refers to the sequence of the two - ASCII characters CR (13) and LF (10) which, taken together, in this - order, denote a line break in RFC 822 mail. - - The term "character set" is used in this document to refer to a - method used with one or more tables to convert encoded text to a - series of octets. This definition is intended to allow various kinds - of text encodings, from simple single-table mappings such as ASCII to - complex table switching methods such as those that use ISO 2022's - techniques. However, a MIME character set name must fully specify - the mapping to be performed. - - The term "message", when not further qualified, means either the - (complete or "top-level") message being transferred on a network, or - a message encapsulated in a body of type "message". - - The term "body part", in this document, means one of the parts of the - body of a multipart entity. A body part has a header and a body, so - it makes sense to speak about the body of a body part. - - The term "entity", in this document, means either a message or a body - part. All kinds of entities share the property that they have a - header and a body. - - The term "body", when not further qualified, means the body of an - entity, that is the body of either a message or of a body part. - - - -Borenstein & Freed [Page 6] - -RFC 1521 MIME September 1993 - - - NOTE: The previous four definitions are clearly circular. This is - unavoidable, since the overall structure of a MIME message is - indeed recursive. - - In this document, all numeric and octet values are given in decimal - notation. - - It must be noted that Content-Type values, subtypes, and parameter - names as defined in this document are case-insensitive. However, - parameter values are case-sensitive unless otherwise specified for - the specific parameter. - - FORMATTING NOTE: This document has been carefully formatted for - ease of reading. The PostScript version of this document, in - particular, places notes like this one, which may be skipped by - the reader, in a smaller, italicized, font, and indents it as - well. In the text version, only the indentation is preserved, so - if you are reading the text version of this you might consider - using the PostScript version instead. However, all such notes will - be indented and preceded by "NOTE:" or some similar introduction, - even in the text version. - - The primary purpose of these non-essential notes is to convey - information about the rationale of this document, or to place this - document in the proper historical or evolutionary context. Such - information may be skipped by those who are focused entirely on - building a conformant implementation, but may be of use to those - who wish to understand why this document is written as it is. - - For ease of recognition, all BNF definitions have been placed in a - fixed-width font in the PostScript version of this document. - -3. The MIME-Version Header Field - - Since RFC 822 was published in 1982, there has really been only one - format standard for Internet messages, and there has been little - perceived need to declare the format standard in use. This document - is an independent document that complements RFC 822. Although the - extensions in this document have been defined in such a way as to be - compatible with RFC 822, there are still circumstances in which it - might be desirable for a mail-processing agent to know whether a - message was composed with the new standard in mind. - - Therefore, this document defines a new header field, "MIME-Version", - which is to be used to declare the version of the Internet message - body format standard in use. - - Messages composed in accordance with this document MUST include such - - - -Borenstein & Freed [Page 7] - -RFC 1521 MIME September 1993 - - - a header field, with the following verbatim text: - - MIME-Version: 1.0 - - The presence of this header field is an assertion that the message - has been composed in compliance with this document. - - Since it is possible that a future document might extend the message - format standard again, a formal BNF is given for the content of the - MIME-Version field: - - version := "MIME-Version" ":" 1*DIGIT "." 1*DIGIT - - Thus, future format specifiers, which might replace or extend "1.0", - are constrained to be two integer fields, separated by a period. If - a message is received with a MIME-version value other than "1.0", it - cannot be assumed to conform with this specification. - - Note that the MIME-Version header field is required at the top level - of a message. It is not required for each body part of a multipart - entity. It is required for the embedded headers of a body of type - "message" if and only if the embedded message is itself claimed to be - MIME-conformant. - - It is not possible to fully specify how a mail reader that conforms - with MIME as defined in this document should treat a message that - might arrive in the future with some value of MIME-Version other than - "1.0". However, conformant software is encouraged to check the - version number and at least warn the user if an unrecognized MIME- - version is encountered. - - It is also worth noting that version control for specific content- - types is not accomplished using the MIME-Version mechanism. In - particular, some formats (such as application/postscript) have - version numbering conventions that are internal to the document - format. Where such conventions exist, MIME does nothing to supersede - them. Where no such conventions exist, a MIME type might use a - "version" parameter in the content-type field if necessary. - - NOTE TO IMPLEMENTORS: All header fields defined in this document, - including MIME-Version, Content-type, etc., are subject to the - general syntactic rules for header fields specified in RFC 822. In - particular, all can include comments, which means that the following - two MIME-Version fields are equivalent: - - MIME-Version: 1.0 - MIME-Version: 1.0 (Generated by GBD-killer 3.7) - - - - -Borenstein & Freed [Page 8] - -RFC 1521 MIME September 1993 - - -4. The Content-Type Header Field - - The purpose of the Content-Type field is to describe the data - contained in the body fully enough that the receiving user agent can - pick an appropriate agent or mechanism to present the data to the - user, or otherwise deal with the data in an appropriate manner. - - HISTORICAL NOTE: The Content-Type header field was first defined in - RFC 1049. RFC 1049 Content-types used a simpler and less powerful - syntax, but one that is largely compatible with the mechanism given - here. - - The Content-Type header field is used to specify the nature of the - data in the body of an entity, by giving type and subtype - identifiers, and by providing auxiliary information that may be - required for certain types. After the type and subtype names, the - remainder of the header field is simply a set of parameters, - specified in an attribute/value notation. The set of meaningful - parameters differs for the different types. In particular, there are - NO globally-meaningful parameters that apply to all content-types. - Global mechanisms are best addressed, in the MIME model, by the - definition of additional Content-* header fields. The ordering of - parameters is not significant. Among the defined parameters is a - "charset" parameter by which the character set used in the body may - be declared. Comments are allowed in accordance with RFC 822 rules - for structured header fields. - - In general, the top-level Content-Type is used to declare the general - type of data, while the subtype specifies a specific format for that - type of data. Thus, a Content-Type of "image/xyz" is enough to tell - a user agent that the data is an image, even if the user agent has no - knowledge of the specific image format "xyz". Such information can - be used, for example, to decide whether or not to show a user the raw - data from an unrecognized subtype -- such an action might be - reasonable for unrecognized subtypes of text, but not for - unrecognized subtypes of image or audio. For this reason, registered - subtypes of audio, image, text, and video, should not contain - embedded information that is really of a different type. Such - compound types should be represented using the "multipart" or - "application" types. - - Parameters are modifiers of the content-subtype, and do not - fundamentally affect the requirements of the host system. Although - most parameters make sense only with certain content-types, others - are "global" in the sense that they might apply to any subtype. For - example, the "boundary" parameter makes sense only for the - "multipart" content-type, but the "charset" parameter might make - sense with several content-types. - - - -Borenstein & Freed [Page 9] - -RFC 1521 MIME September 1993 - - - An initial set of seven Content-Types is defined by this document. - This set of top-level names is intended to be substantially complete. - It is expected that additions to the larger set of supported types - can generally be accomplished by the creation of new subtypes of - these initial types. In the future, more top-level types may be - defined only by an extension to this standard. If another primary - type is to be used for any reason, it must be given a name starting - with "X-" to indicate its non-standard status and to avoid a - potential conflict with a future official name. - - In the Augmented BNF notation of RFC 822, a Content-Type header field - value is defined as follows: - - content := "Content-Type" ":" type "/" subtype *(";" - parameter) - ; case-insensitive matching of type and subtype - - type := "application" / "audio" - / "image" / "message" - / "multipart" / "text" - / "video" / extension-token - ; All values case-insensitive - - extension-token := x-token / iana-token - - iana-token := - - x-token := - - subtype := token ; case-insensitive - - parameter := attribute "=" value - - attribute := token ; case-insensitive - - value := token / quoted-string - - token := 1* - - tspecials := "(" / ")" / "<" / ">" / "@" - / "," / ";" / ":" / "\" / <"> - / "/" / "[" / "]" / "?" / "=" - ; Must be in quoted-string, - ; to use within parameter values - - - -Borenstein & Freed [Page 10] - -RFC 1521 MIME September 1993 - - - Note that the definition of "tspecials" is the same as the RFC 822 - definition of "specials" with the addition of the three characters - "/", "?", and "=", and the removal of ".". - - Note also that a subtype specification is MANDATORY. There are no - default subtypes. - - The type, subtype, and parameter names are not case sensitive. For - example, TEXT, Text, and TeXt are all equivalent. Parameter values - are normally case sensitive, but certain parameters are interpreted - to be case-insensitive, depending on the intended use. (For example, - multipart boundaries are case-sensitive, but the "access-type" for - message/External-body is not case-sensitive.) - - Beyond this syntax, the only constraint on the definition of subtype - names is the desire that their uses must not conflict. That is, it - would be undesirable to have two different communities using - "Content-Type: application/foobar" to mean two different things. The - process of defining new content-subtypes, then, is not intended to be - a mechanism for imposing restrictions, but simply a mechanism for - publicizing the usages. There are, therefore, two acceptable - mechanisms for defining new Content-Type subtypes: - - 1. Private values (starting with "X-") may be - defined bilaterally between two cooperating - agents without outside registration or - standardization. - - 2. New standard values must be documented, - registered with, and approved by IANA, as - described in Appendix E. Where intended for - public use, the formats they refer to must - also be defined by a published specification, - and possibly offered for standardization. - - The seven standard initial predefined Content-Types are detailed in - the bulk of this document. They are: - - text -- textual information. The primary subtype, - "plain", indicates plain (unformatted) text. No - special software is required to get the full - meaning of the text, aside from support for the - indicated character set. Subtypes are to be used - for enriched text in forms where application - software may enhance the appearance of the text, - but such software must not be required in order to - get the general idea of the content. Possible - subtypes thus include any readable word processor - - - -Borenstein & Freed [Page 11] - -RFC 1521 MIME September 1993 - - - format. A very simple and portable subtype, - richtext, was defined in RFC 1341, with a future - revision expected. - - multipart -- data consisting of multiple parts of - independent data types. Four initial subtypes - are defined, including the primary "mixed" - subtype, "alternative" for representing the same - data in multiple formats, "parallel" for parts - intended to be viewed simultaneously, and "digest" - for multipart entities in which each part is of - type "message". - - message -- an encapsulated message. A body of - Content-Type "message" is itself all or part of a - fully formatted RFC 822 conformant message which - may contain its own different Content-Type header - field. The primary subtype is "rfc822". The - "partial" subtype is defined for partial messages, - to permit the fragmented transmission of bodies - that are thought to be too large to be passed - through mail transport facilities. Another - subtype, "External-body", is defined for - specifying large bodies by reference to an - external data source. - - image -- image data. Image requires a display device - (such as a graphical display, a printer, or a FAX - machine) to view the information. Initial - subtypes are defined for two widely-used image - formats, jpeg and gif. - - audio -- audio data, with initial subtype "basic". - Audio requires an audio output device (such as a - speaker or a telephone) to "display" the contents. - - video -- video data. Video requires the capability to - display moving images, typically including - specialized hardware and software. The initial - subtype is "mpeg". - - application -- some other kind of data, typically - either uninterpreted binary data or information to - be processed by a mail-based application. The - primary subtype, "octet-stream", is to be used in - the case of uninterpreted binary data, in which - case the simplest recommended action is to offer - to write the information into a file for the user. - - - -Borenstein & Freed [Page 12] - -RFC 1521 MIME September 1993 - - - An additional subtype, "PostScript", is defined - for transporting PostScript documents in bodies. - Other expected uses for "application" include - spreadsheets, data for mail-based scheduling - systems, and languages for "active" - (computational) email. (Note that active email - and other application data may entail several - security considerations, which are discussed later - in this memo, particularly in the context of - application/PostScript.) - - Default RFC 822 messages are typed by this protocol as plain text in - the US-ASCII character set, which can be explicitly specified as - "Content-type: text/plain; charset=us-ascii". If no Content-Type is - specified, this default is assumed. In the presence of a MIME- - Version header field, a receiving User Agent can also assume that - plain US-ASCII text was the sender's intent. In the absence of a - MIME-Version specification, plain US-ASCII text must still be - assumed, but the sender's intent might have been otherwise. - - RATIONALE: In the absence of any Content-Type header field or - MIME-Version header field, it is impossible to be certain that a - message is actually text in the US-ASCII character set, since it - might well be a message that, using the conventions that predate - this document, includes text in another character set or non- - textual data in a manner that cannot be automatically recognized - (e.g., a uuencoded compressed UNIX tar file). Although there is - no fully acceptable alternative to treating such untyped messages - as "text/plain; charset=us-ascii", implementors should remain - aware that if a message lacks both the MIME-Version and the - Content-Type header fields, it may in practice contain almost - anything. - - It should be noted that the list of Content-Type values given here - may be augmented in time, via the mechanisms described above, and - that the set of subtypes is expected to grow substantially. - - When a mail reader encounters mail with an unknown Content-type - value, it should generally treat it as equivalent to - "application/octet-stream", as described later in this document. - -5. The Content-Transfer-Encoding Header Field - - Many Content-Types which could usefully be transported via email are - represented, in their "natural" format, as 8-bit character or binary - data. Such data cannot be transmitted over some transport protocols. - For example, RFC 821 restricts mail messages to 7-bit US-ASCII data - with lines no longer than 1000 characters. - - - -Borenstein & Freed [Page 13] - -RFC 1521 MIME September 1993 - - - It is necessary, therefore, to define a standard mechanism for re- - encoding such data into a 7-bit short-line format. This document - specifies that such encodings will be indicated by a new "Content- - Transfer-Encoding" header field. The Content-Transfer-Encoding field - is used to indicate the type of transformation that has been used in - order to represent the body in an acceptable manner for transport. - - Unlike Content-Types, a proliferation of Content-Transfer-Encoding - values is undesirable and unnecessary. However, establishing only a - single Content-Transfer-Encoding mechanism does not seem possible. - There is a tradeoff between the desire for a compact and efficient - encoding of largely-binary data and the desire for a readable - encoding of data that is mostly, but not entirely, 7-bit data. For - this reason, at least two encoding mechanisms are necessary: a - "readable" encoding and a "dense" encoding. - - The Content-Transfer-Encoding field is designed to specify an - invertible mapping between the "native" representation of a type of - data and a representation that can be readily exchanged using 7 bit - mail transport protocols, such as those defined by RFC 821 (SMTP). - This field has not been defined by any previous standard. The field's - value is a single token specifying the type of encoding, as - enumerated below. Formally: - - encoding := "Content-Transfer-Encoding" ":" mechanism - - mechanism := "7bit" ; case-insensitive - / "quoted-printable" - / "base64" - / "8bit" - / "binary" - / x-token - - These values are not case sensitive. That is, Base64 and BASE64 and - bAsE64 are all equivalent. An encoding type of 7BIT requires that - the body is already in a seven-bit mail-ready representation. This - is the default value -- that is, "Content-Transfer-Encoding: 7BIT" is - assumed if the Content-Transfer-Encoding header field is not present. - - The values "8bit", "7bit", and "binary" all mean that NO encoding has - been performed. However, they are potentially useful as indications - of the kind of data contained in the object, and therefore of the - kind of encoding that might need to be performed for transmission in - a given transport system. In particular: - - "7bit" means that the data is all represented as short - lines of US-ASCII data. - - - - -Borenstein & Freed [Page 14] - -RFC 1521 MIME September 1993 - - - "8bit" means that the lines are short, but there may be - non-ASCII characters (octets with the high-order - bit set). - - "Binary" means that not only may non-ASCII characters - be present, but also that the lines are not - necessarily short enough for SMTP transport. - - The difference between "8bit" (or any other conceivable bit-width - token) and the "binary" token is that "binary" does not require - adherence to any limits on line length or to the SMTP CRLF semantics, - while the bit-width tokens do require such adherence. If the body - contains data in any bit-width other than 7-bit, the appropriate - bit-width Content-Transfer-Encoding token must be used (e.g., "8bit" - for unencoded 8 bit wide data). If the body contains binary data, - the "binary" Content-Transfer-Encoding token must be used. - - NOTE: The distinction between the Content-Transfer-Encoding values - of "binary", "8bit", etc. may seem unimportant, in that all of - them really mean "none" -- that is, there has been no encoding of - the data for transport. However, clear labeling will be of - enormous value to gateways between future mail transport systems - with differing capabilities in transporting data that do not meet - the restrictions of RFC 821 transport. - - Mail transport for unencoded 8-bit data is defined in RFC-1426 - [RFC-1426]. As of the publication of this document, there are no - standardized Internet mail transports for which it is legitimate - to include unencoded binary data in mail bodies. Thus there are - no circumstances in which the "binary" Content-Transfer-Encoding - is actually legal on the Internet. However, in the event that - binary mail transport becomes a reality in Internet mail, or when - this document is used in conjunction with any other binary-capable - transport mechanism, binary bodies should be labeled as such using - this mechanism. - - NOTE: The five values defined for the Content-Transfer-Encoding - field imply nothing about the Content-Type other than the - algorithm by which it was encoded or the transport system - requirements if unencoded. - - Implementors may, if necessary, define new Content-Transfer-Encoding - values, but must use an x-token, which is a name prefixed by "X-" to - indicate its non-standard status, e.g., "Content-Transfer-Encoding: - x-my-new-encoding". However, unlike Content-Types and subtypes, the - creation of new Content-Transfer-Encoding values is explicitly and - strongly discouraged, as it seems likely to hinder interoperability - with little potential benefit. Their use is allowed only as the - - - -Borenstein & Freed [Page 15] - -RFC 1521 MIME September 1993 - - - result of an agreement between cooperating user agents. - - If a Content-Transfer-Encoding header field appears as part of a - message header, it applies to the entire body of that message. If a - Content-Transfer-Encoding header field appears as part of a body - part's headers, it applies only to the body of that body part. If an - entity is of type "multipart" or "message", the Content-Transfer- - Encoding is not permitted to have any value other than a bit width - (e.g., "7bit", "8bit", etc.) or "binary". - - It should be noted that email is character-oriented, so that the - mechanisms described here are mechanisms for encoding arbitrary octet - streams, not bit streams. If a bit stream is to be encoded via one - of these mechanisms, it must first be converted to an 8-bit byte - stream using the network standard bit order ("big-endian"), in which - the earlier bits in a stream become the higher-order bits in a byte. - A bit stream not ending at an 8-bit boundary must be padded with - zeroes. This document provides a mechanism for noting the addition - of such padding in the case of the application Content-Type, which - has a "padding" parameter. - - The encoding mechanisms defined here explicitly encode all data in - ASCII. Thus, for example, suppose an entity has header fields such - as: - - Content-Type: text/plain; charset=ISO-8859-1 - Content-transfer-encoding: base64 - - This must be interpreted to mean that the body is a base64 ASCII - encoding of data that was originally in ISO-8859-1, and will be in - that character set again after decoding. - - The following sections will define the two standard encoding - mechanisms. The definition of new content-transfer-encodings is - explicitly discouraged and should only occur when absolutely - necessary. All content-transfer-encoding namespace except that - beginning with "X-" is explicitly reserved to the IANA for future - use. Private agreements about content-transfer-encodings are also - explicitly discouraged. - - Certain Content-Transfer-Encoding values may only be used on certain - Content-Types. In particular, it is expressly forbidden to use any - encodings other than "7bit", "8bit", or "binary" with any Content- - Type that recursively includes other Content-Type fields, notably the - "multipart" and "message" Content-Types. All encodings that are - desired for bodies of type multipart or message must be done at the - innermost level, by encoding the actual body that needs to be - encoded. - - - -Borenstein & Freed [Page 16] - -RFC 1521 MIME September 1993 - - - NOTE ON ENCODING RESTRICTIONS: Though the prohibition against - using content-transfer-encodings on data of type multipart or - message may seem overly restrictive, it is necessary to prevent - nested encodings, in which data are passed through an encoding - algorithm multiple times, and must be decoded multiple times in - order to be properly viewed. Nested encodings add considerable - complexity to user agents: aside from the obvious efficiency - problems with such multiple encodings, they can obscure the basic - structure of a message. In particular, they can imply that - several decoding operations are necessary simply to find out what - types of objects a message contains. Banning nested encodings may - complicate the job of certain mail gateways, but this seems less - of a problem than the effect of nested encodings on user agents. - - NOTE ON THE RELATIONSHIP BETWEEN CONTENT-TYPE AND CONTENT- - TRANSFER-ENCODING: It may seem that the Content-Transfer-Encoding - could be inferred from the characteristics of the Content-Type - that is to be encoded, or, at the very least, that certain - Content-Transfer-Encodings could be mandated for use with specific - Content-Types. There are several reasons why this is not the case. - First, given the varying types of transports used for mail, some - encodings may be appropriate for some Content-Type/transport - combinations and not for others. (For example, in an 8-bit - transport, no encoding would be required for text in certain - character sets, while such encodings are clearly required for 7- - bit SMTP.) Second, certain Content-Types may require different - types of transfer encoding under different circumstances. For - example, many PostScript bodies might consist entirely of short - lines of 7-bit data and hence require little or no encoding. - Other PostScript bodies (especially those using Level 2 - PostScript's binary encoding mechanism) may only be reasonably - represented using a binary transport encoding. Finally, since - Content-Type is intended to be an open-ended specification - mechanism, strict specification of an association between - Content-Types and encodings effectively couples the specification - of an application protocol with a specific lower-level transport. - This is not desirable since the developers of a Content-Type - should not have to be aware of all the transports in use and what - their limitations are. - - NOTE ON TRANSLATING ENCODINGS: The quoted-printable and base64 - encodings are designed so that conversion between them is - possible. The only issue that arises in such a conversion is the - handling of line breaks. When converting from quoted-printable to - base64 a line break must be converted into a CRLF sequence. - Similarly, a CRLF sequence in base64 data must be converted to a - quoted-printable line break, but ONLY when converting text data. - - - - -Borenstein & Freed [Page 17] - -RFC 1521 MIME September 1993 - - - NOTE ON CANONICAL ENCODING MODEL: There was some confusion, in - earlier drafts of this memo, regarding the model for when email - data was to be converted to canonical form and encoded, and in - particular how this process would affect the treatment of CRLFs, - given that the representation of newlines varies greatly from - system to system, and the relationship between content-transfer- - encodings and character sets. For this reason, a canonical model - for encoding is presented as Appendix G. - -5.1. Quoted-Printable Content-Transfer-Encoding - - The Quoted-Printable encoding is intended to represent data that - largely consists of octets that correspond to printable characters in - the ASCII character set. It encodes the data in such a way that the - resulting octets are unlikely to be modified by mail transport. If - the data being encoded are mostly ASCII text, the encoded form of the - data remains largely recognizable by humans. A body which is - entirely ASCII may also be encoded in Quoted-Printable to ensure the - integrity of the data should the message pass through a character- - translating, and/or line-wrapping gateway. - - In this encoding, octets are to be represented as determined by the - following rules: - - Rule #1: (General 8-bit representation) Any octet, except those - indicating a line break according to the newline convention of the - canonical (standard) form of the data being encoded, may be - represented by an "=" followed by a two digit hexadecimal - representation of the octet's value. The digits of the - hexadecimal alphabet, for this purpose, are "0123456789ABCDEF". - Uppercase letters must be used when sending hexadecimal data, - though a robust implementation may choose to recognize lowercase - letters on receipt. Thus, for example, the value 12 (ASCII form - feed) can be represented by "=0C", and the value 61 (ASCII EQUAL - SIGN) can be represented by "=3D". Except when the following - rules allow an alternative encoding, this rule is mandatory. - - Rule #2: (Literal representation) Octets with decimal values of 33 - through 60 inclusive, and 62 through 126, inclusive, MAY be - represented as the ASCII characters which correspond to those - octets (EXCLAMATION POINT through LESS THAN, and GREATER THAN - through TILDE, respectively). - - Rule #3: (White Space): Octets with values of 9 and 32 MAY be - represented as ASCII TAB (HT) and SPACE characters, respectively, - but MUST NOT be so represented at the end of an encoded line. Any - TAB (HT) or SPACE characters on an encoded line MUST thus be - followed on that line by a printable character. In particular, an - - - -Borenstein & Freed [Page 18] - -RFC 1521 MIME September 1993 - - - "=" at the end of an encoded line, indicating a soft line break - (see rule #5) may follow one or more TAB (HT) or SPACE characters. - It follows that an octet with value 9 or 32 appearing at the end - of an encoded line must be represented according to Rule #1. This - rule is necessary because some MTAs (Message Transport Agents, - programs which transport messages from one user to another, or - perform a part of such transfers) are known to pad lines of text - with SPACEs, and others are known to remove "white space" - characters from the end of a line. Therefore, when decoding a - Quoted-Printable body, any trailing white space on a line must be - deleted, as it will necessarily have been added by intermediate - transport agents. - - Rule #4 (Line Breaks): A line break in a text body, independent of - what its representation is following the canonical representation - of the data being encoded, must be represented by a (RFC 822) line - break, which is a CRLF sequence, in the Quoted-Printable encoding. - Since the canonical representation of types other than text do not - generally include the representation of line breaks, no hard line - breaks (i.e. line breaks that are intended to be meaningful and - to be displayed to the user) should occur in the quoted-printable - encoding of such types. Of course, occurrences of "=0D", "=0A", - "0A=0D" and "=0D=0A" will eventually be encountered. In general, - however, base64 is preferred over quoted-printable for binary - data. - - Note that many implementations may elect to encode the local - representation of various content types directly, as described in - Appendix G. In particular, this may apply to plain text material - on systems that use newline conventions other than CRLF - delimiters. Such an implementation is permissible, but the - generation of line breaks must be generalized to account for the - case where alternate representations of newline sequences are - used. - - Rule #5 (Soft Line Breaks): The Quoted-Printable encoding REQUIRES - that encoded lines be no more than 76 characters long. If longer - lines are to be encoded with the Quoted-Printable encoding, 'soft' - line breaks must be used. An equal sign as the last character on a - encoded line indicates such a non-significant ('soft') line break - in the encoded text. Thus if the "raw" form of the line is a - single unencoded line that says: - - Now's the time for all folk to come to the aid of - their country. - - This can be represented, in the Quoted-Printable encoding, as - - - - -Borenstein & Freed [Page 19] - -RFC 1521 MIME September 1993 - - - Now's the time = - for all folk to come= - to the aid of their country. - - This provides a mechanism with which long lines are encoded in - such a way as to be restored by the user agent. The 76 character - limit does not count the trailing CRLF, but counts all other - characters, including any equal signs. - - Since the hyphen character ("-") is represented as itself in the - Quoted-Printable encoding, care must be taken, when encapsulating a - quoted-printable encoded body in a multipart entity, to ensure that - the encapsulation boundary does not appear anywhere in the encoded - body. (A good strategy is to choose a boundary that includes a - character sequence such as "=_" which can never appear in a quoted- - printable body. See the definition of multipart messages later in - this document.) - - NOTE: The quoted-printable encoding represents something of a - compromise between readability and reliability in transport. - Bodies encoded with the quoted-printable encoding will work - reliably over most mail gateways, but may not work perfectly over - a few gateways, notably those involving translation into EBCDIC. - (In theory, an EBCDIC gateway could decode a quoted-printable body - and re-encode it using base64, but such gateways do not yet - exist.) A higher level of confidence is offered by the base64 - Content-Transfer-Encoding. A way to get reasonably reliable - transport through EBCDIC gateways is to also quote the ASCII - characters - - !"#$@[\]^`{|}~ - - according to rule #1. See Appendix B for more information. - - Because quoted-printable data is generally assumed to be line- - oriented, it is to be expected that the representation of the breaks - between the lines of quoted printable data may be altered in - transport, in the same manner that plain text mail has always been - altered in Internet mail when passing between systems with differing - newline conventions. If such alterations are likely to constitute a - corruption of the data, it is probably more sensible to use the - base64 encoding rather than the quoted-printable encoding. - - WARNING TO IMPLEMENTORS: If binary data are encoded in quoted- - printable, care must be taken to encode CR and LF characters as "=0D" - and "=0A", respectively. In particular, a CRLF sequence in binary - data should be encoded as "=0D=0A". Otherwise, if CRLF were - represented as a hard line break, it might be incorrectly decoded on - - - -Borenstein & Freed [Page 20] - -RFC 1521 MIME September 1993 - - - platforms with different line break conventions. - - For formalists, the syntax of quoted-printable data is described by - the following grammar: - - quoted-printable := ([*(ptext / SPACE / TAB) ptext] ["="] CRLF) - ; Maximum line length of 76 characters excluding CRLF - - ptext := octet / 127, =, SPACE, or TAB, - ; and is recommended for any characters not listed in - ; Appendix B as "mail-safe". - -5.2. Base64 Content-Transfer-Encoding - - The Base64 Content-Transfer-Encoding is designed to represent - arbitrary sequences of octets in a form that need not be humanly - readable. The encoding and decoding algorithms are simple, but the - encoded data are consistently only about 33 percent larger than the - unencoded data. This encoding is virtually identical to the one used - in Privacy Enhanced Mail (PEM) applications, as defined in RFC 1421. - The base64 encoding is adapted from RFC 1421, with one change: base64 - eliminates the "*" mechanism for embedded clear text. - - A 65-character subset of US-ASCII is used, enabling 6 bits to be - represented per printable character. (The extra 65th character, "=", - is used to signify a special processing function.) - - NOTE: This subset has the important property that it is - represented identically in all versions of ISO 646, including US - ASCII, and all characters in the subset are also represented - identically in all versions of EBCDIC. Other popular encodings, - such as the encoding used by the uuencode utility and the base85 - encoding specified as part of Level 2 PostScript, do not share - these properties, and thus do not fulfill the portability - requirements a binary transport encoding for mail must meet. - - The encoding process represents 24-bit groups of input bits as output - strings of 4 encoded characters. Proceeding from left to right, a - 24-bit input group is formed by concatenating 3 8-bit input groups. - These 24 bits are then treated as 4 concatenated 6-bit groups, each - of which is translated into a single digit in the base64 alphabet. - When encoding a bit stream via the base64 encoding, the bit stream - must be presumed to be ordered with the most-significant-bit first. - - - -Borenstein & Freed [Page 21] - -RFC 1521 MIME September 1993 - - - That is, the first bit in the stream will be the high-order bit in - the first byte, and the eighth bit will be the low-order bit in the - first byte, and so on. - - Each 6-bit group is used as an index into an array of 64 printable - characters. The character referenced by the index is placed in the - output string. These characters, identified in Table 1, below, are - selected so as to be universally representable, and the set excludes - characters with particular significance to SMTP (e.g., ".", CR, LF) - and to the encapsulation boundaries defined in this document (e.g., - "-"). - - Table 1: The Base64 Alphabet - - Value Encoding Value Encoding Value Encoding Value Encoding - 0 A 17 R 34 i 51 z - 1 B 18 S 35 j 52 0 - 2 C 19 T 36 k 53 1 - 3 D 20 U 37 l 54 2 - 4 E 21 V 38 m 55 3 - 5 F 22 W 39 n 56 4 - 6 G 23 X 40 o 57 5 - 7 H 24 Y 41 p 58 6 - 8 I 25 Z 42 q 59 7 - 9 J 26 a 43 r 60 8 - 10 K 27 b 44 s 61 9 - 11 L 28 c 45 t 62 + - 12 M 29 d 46 u 63 / - 13 N 30 e 47 v - 14 O 31 f 48 w (pad) = - 15 P 32 g 49 x - 16 Q 33 h 50 y - - The output stream (encoded bytes) must be represented in lines of no - more than 76 characters each. All line breaks or other characters - not found in Table 1 must be ignored by decoding software. In base64 - data, characters other than those in Table 1, line breaks, and other - white space probably indicate a transmission error, about which a - warning message or even a message rejection might be appropriate - under some circumstances. - - Special processing is performed if fewer than 24 bits are available - at the end of the data being encoded. A full encoding quantum is - always completed at the end of a body. When fewer than 24 input bits - are available in an input group, zero bits are added (on the right) - to form an integral number of 6-bit groups. Padding at the end of - the data is performed using the '=' character. Since all base64 - input is an integral number of octets, only the following cases can - - - -Borenstein & Freed [Page 22] - -RFC 1521 MIME September 1993 - - - arise: (1) the final quantum of encoding input is an integral - multiple of 24 bits; here, the final unit of encoded output will be - an integral multiple of 4 characters with no "=" padding, (2) the - final quantum of encoding input is exactly 8 bits; here, the final - unit of encoded output will be two characters followed by two "=" - padding characters, or (3) the final quantum of encoding input is - exactly 16 bits; here, the final unit of encoded output will be three - characters followed by one "=" padding character. - - Because it is used only for padding at the end of the data, the - occurrence of any '=' characters may be taken as evidence that the - end of the data has been reached (without truncation in transit). No - such assurance is possible, however, when the number of octets - transmitted was a multiple of three. - - Any characters outside of the base64 alphabet are to be ignored in - base64-encoded data. The same applies to any illegal sequence of - characters in the base64 encoding, such as "=====" - - Care must be taken to use the proper octets for line breaks if base64 - encoding is applied directly to text material that has not been - converted to canonical form. In particular, text line breaks must be - converted into CRLF sequences prior to base64 encoding. The important - thing to note is that this may be done directly by the encoder rather - than in a prior canonicalization step in some implementations. - - NOTE: There is no need to worry about quoting apparent - encapsulation boundaries within base64-encoded parts of multipart - entities because no hyphen characters are used in the base64 - encoding. - -6. Additional Content-Header Fields - -6.1. Optional Content-ID Header Field - - In constructing a high-level user agent, it may be desirable to allow - one body to make reference to another. Accordingly, bodies may be - labeled using the "Content-ID" header field, which is syntactically - identical to the "Message-ID" header field: - - id := "Content-ID" ":" msg-id - Like the Message-ID values, Content-ID values must be generated to be - world-unique. - - The Content-ID value may be used for uniquely identifying MIME - entities in several contexts, particularly for cacheing data - referenced by the message/external-body mechanism. Although the - Content-ID header is generally optional, its use is mandatory in - - - -Borenstein & Freed [Page 23] - -RFC 1521 MIME September 1993 - - - implementations which generate data of the optional MIME Content-type - "message/external-body". That is, each message/external-body entity - must have a Content-ID field to permit cacheing of such data. - - It is also worth noting that the Content-ID value has special - semantics in the case of the multipart/alternative content-type. - This is explained in the section of this document dealing with - multipart/alternative. - -6.2. Optional Content-Description Header Field - - The ability to associate some descriptive information with a given - body is often desirable. For example, it may be useful to mark an - "image" body as "a picture of the Space Shuttle Endeavor." Such text - may be placed in the Content-Description header field. - - description := "Content-Description" ":" *text - - The description is presumed to be given in the US-ASCII character - set, although the mechanism specified in [RFC-1522] may be used for - non-US-ASCII Content-Description values. - -7. The Predefined Content-Type Values - - This document defines seven initial Content-Type values and an - extension mechanism for private or experimental types. Further - standard types must be defined by new published specifications. It - is expected that most innovation in new types of mail will take place - as subtypes of the seven types defined here. The most essential - characteristics of the seven content-types are summarized in Appendix - F. - -7.1 The Text Content-Type - - The text Content-Type is intended for sending material which is - principally textual in form. It is the default Content-Type. A - "charset" parameter may be used to indicate the character set of the - body text for some text subtypes, notably including the primary - subtype, "text/plain", which indicates plain (unformatted) text. The - default Content-Type for Internet mail is "text/plain; charset=us- - ascii". - - Beyond plain text, there are many formats for representing what might - be known as "extended text" -- text with embedded formatting and - presentation information. An interesting characteristic of many such - representations is that they are to some extent readable even without - the software that interprets them. It is useful, then, to - distinguish them, at the highest level, from such unreadable data as - - - -Borenstein & Freed [Page 24] - -RFC 1521 MIME September 1993 - - - images, audio, or text represented in an unreadable form. In the - absence of appropriate interpretation software, it is reasonable to - show subtypes of text to the user, while it is not reasonable to do - so with most nontextual data. - - Such formatted textual data should be represented using subtypes of - text. Plausible subtypes of text are typically given by the common - name of the representation format, e.g., "text/richtext" [RFC-1341]. - -7.1.1. The charset parameter - - A critical parameter that may be specified in the Content-Type field - for text/plain data is the character set. This is specified with a - "charset" parameter, as in: - - Content-type: text/plain; charset=us-ascii - - Unlike some other parameter values, the values of the charset - parameter are NOT case sensitive. The default character set, which - must be assumed in the absence of a charset parameter, is US-ASCII. - - The specification for any future subtypes of "text" must specify - whether or not they will also utilize a "charset" parameter, and may - possibly restrict its values as well. When used with a particular - body, the semantics of the "charset" parameter should be identical to - those specified here for "text/plain", i.e., the body consists - entirely of characters in the given charset. In particular, definers - of future text subtypes should pay close attention the the - implications of multibyte character sets for their subtype - definitions. - - This RFC specifies the definition of the charset parameter for the - purposes of MIME to be a unique mapping of a byte stream to glyphs, a - mapping which does not require external profiling information. - - An initial list of predefined character set names can be found at the - end of this section. Additional character sets may be registered - with IANA, although the standardization of their use requires the - usual IESG [RFC-1340] review and approval. Note that if the - specified character set includes 8-bit data, a Content-Transfer- - Encoding header field and a corresponding encoding on the data are - required in order to transmit the body via some mail transfer - protocols, such as SMTP. - - The default character set, US-ASCII, has been the subject of some - confusion and ambiguity in the past. Not only were there some - ambiguities in the definition, there have been wide variations in - practice. In order to eliminate such ambiguity and variations in the - - - -Borenstein & Freed [Page 25] - -RFC 1521 MIME September 1993 - - - future, it is strongly recommended that new user agents explicitly - specify a character set via the Content-Type header field. "US- - ASCII" does not indicate an arbitrary seven-bit character code, but - specifies that the body uses character coding that uses the exact - correspondence of codes to characters specified in ASCII. National - use variations of ISO 646 [ISO-646] are NOT ASCII and their use in - Internet mail is explicitly discouraged. The omission of the ISO 646 - character set is deliberate in this regard. The character set name - of "US-ASCII" explicitly refers to ANSI X3.4-1986 [US-ASCII] only. - The character set name "ASCII" is reserved and must not be used for - any purpose. - - NOTE: RFC 821 explicitly specifies "ASCII", and references an - earlier version of the American Standard. Insofar as one of the - purposes of specifying a Content-Type and character set is to - permit the receiver to unambiguously determine how the sender - intended the coded message to be interpreted, assuming anything - other than "strict ASCII" as the default would risk unintentional - and incompatible changes to the semantics of messages now being - transmitted. This also implies that messages containing - characters coded according to national variations on ISO 646, or - using code-switching procedures (e.g., those of ISO 2022), as well - as 8-bit or multiple octet character encodings MUST use an - appropriate character set specification to be consistent with this - specification. - - The complete US-ASCII character set is listed in [US-ASCII]. Note - that the control characters including DEL (0-31, 127) have no defined - meaning apart from the combination CRLF (ASCII values 13 and 10) - indicating a new line. Two of the characters have de facto meanings - in wide use: FF (12) often means "start subsequent text on the - beginning of a new page"; and TAB or HT (9) often (though not always) - means "move the cursor to the next available column after the current - position where the column number is a multiple of 8 (counting the - first column as column 0)." Apart from this, any use of the control - characters or DEL in a body must be part of a private agreement - between the sender and recipient. Such private agreements are - discouraged and should be replaced by the other capabilities of this - document. - - NOTE: Beyond US-ASCII, an enormous proliferation of character sets - is possible. It is the opinion of the IETF working group that a - large number of character sets is NOT a good thing. We would - prefer to specify a single character set that can be used - universally for representing all of the world's languages in - electronic mail. Unfortunately, existing practice in several - communities seems to point to the continued use of multiple - character sets in the near future. For this reason, we define - - - -Borenstein & Freed [Page 26] - -RFC 1521 MIME September 1993 - - - names for a small number of character sets for which a strong - constituent base exists. - - The defined charset values are: - - US-ASCII -- as defined in [US-ASCII]. - - ISO-8859-X -- where "X" is to be replaced, as necessary, for the - parts of ISO-8859 [ISO-8859]. Note that the ISO 646 - character sets have deliberately been omitted in favor of - their 8859 replacements, which are the designated character - sets for Internet mail. As of the publication of this - document, the legitimate values for "X" are the digits 1 - through 9. - - The character sets specified above are the ones that were relatively - uncontroversial during the drafting of MIME. This document does not - endorse the use of any particular character set other than US-ASCII, - and recognizes that the future evolution of world character sets - remains unclear. It is expected that in the future, additional - character sets will be registered for use in MIME. - - Note that the character set used, if anything other than US-ASCII, - must always be explicitly specified in the Content-Type field. - - No other character set name may be used in Internet mail without the - publication of a formal specification and its registration with IANA, - or by private agreement, in which case the character set name must - begin with "X-". - - Implementors are discouraged from defining new character sets for - mail use unless absolutely necessary. - - The "charset" parameter has been defined primarily for the purpose of - textual data, and is described in this section for that reason. - However, it is conceivable that non-textual data might also wish to - specify a charset value for some purpose, in which case the same - syntax and values should be used. - - In general, mail-sending software must always use the "lowest common - denominator" character set possible. For example, if a body contains - only US-ASCII characters, it must be marked as being in the US-ASCII - character set, not ISO-8859-1, which, like all the ISO-8859 family of - character sets, is a superset of US-ASCII. More generally, if a - widely-used character set is a subset of another character set, and a - body contains only characters in the widely-used subset, it must be - labeled as being in that subset. This will increase the chances that - the recipient will be able to view the mail correctly. - - - -Borenstein & Freed [Page 27] - -RFC 1521 MIME September 1993 - - -7.1.2. The Text/plain subtype - - The primary subtype of text is "plain". This indicates plain - (unformatted) text. The default Content-Type for Internet mail, - "text/plain; charset=us-ascii", describes existing Internet practice. - That is, it is the type of body defined by RFC 822. - - No other text subtype is defined by this document. - - The formal grammar for the content-type header field for text is as - follows: - - text-type := "text" "/" text-subtype [";" "charset" "=" charset] - - text-subtype := "plain" / extension-token - - charset := "us-ascii"/ "iso-8859-1"/ "iso-8859-2"/ "iso-8859-3" - / "iso-8859-4"/ "iso-8859-5"/ "iso-8859-6"/ "iso-8859-7" - / "iso-8859-8" / "iso-8859-9" / extension-token - ; case insensitive - -7.2. The Multipart Content-Type - - In the case of multiple part entities, in which one or more different - sets of data are combined in a single body, a "multipart" Content- - Type field must appear in the entity's header. The body must then - contain one or more "body parts," each preceded by an encapsulation - boundary, and the last one followed by a closing boundary. Each part - starts with an encapsulation boundary, and then contains a body part - consisting of header area, a blank line, and a body area. Thus a - body part is similar to an RFC 822 message in syntax, but different - in meaning. - - A body part is NOT to be interpreted as actually being an RFC 822 - message. To begin with, NO header fields are actually required in - body parts. A body part that starts with a blank line, therefore, is - allowed and is a body part for which all default values are to be - assumed. In such a case, the absence of a Content-Type header field - implies that the corresponding body is plain US-ASCII text. The only - header fields that have defined meaning for body parts are those the - names of which begin with "Content-". All other header fields are - generally to be ignored in body parts. Although they should - generally be retained in mail processing, they may be discarded by - gateways if necessary. Such other fields are permitted to appear in - body parts but must not be depended on. "X-" fields may be created - for experimental or private purposes, with the recognition that the - information they contain may be lost at some gateways. - - - - -Borenstein & Freed [Page 28] - -RFC 1521 MIME September 1993 - - - NOTE: The distinction between an RFC 822 message and a body part - is subtle, but important. A gateway between Internet and X.400 - mail, for example, must be able to tell the difference between a - body part that contains an image and a body part that contains an - encapsulated message, the body of which is an image. In order to - represent the latter, the body part must have "Content-Type: - message", and its body (after the blank line) must be the - encapsulated message, with its own "Content-Type: image" header - field. The use of similar syntax facilitates the conversion of - messages to body parts, and vice versa, but the distinction - between the two must be understood by implementors. (For the - special case in which all parts actually are messages, a "digest" - subtype is also defined.) - - As stated previously, each body part is preceded by an encapsulation - boundary. The encapsulation boundary MUST NOT appear inside any of - the encapsulated parts. Thus, it is crucial that the composing agent - be able to choose and specify the unique boundary that will separate - the parts. - - All present and future subtypes of the "multipart" type must use an - identical syntax. Subtypes may differ in their semantics, and may - impose additional restrictions on syntax, but must conform to the - required syntax for the multipart type. This requirement ensures - that all conformant user agents will at least be able to recognize - and separate the parts of any multipart entity, even of an - unrecognized subtype. - - As stated in the definition of the Content-Transfer-Encoding field, - no encoding other than "7bit", "8bit", or "binary" is permitted for - entities of type "multipart". The multipart delimiters and header - fields are always represented as 7-bit ASCII in any case (though the - header fields may encode non-ASCII header text as per [RFC-1522]), - and data within the body parts can be encoded on a part-by-part - basis, with Content-Transfer-Encoding fields for each appropriate - body part. - - Mail gateways, relays, and other mail handling agents are commonly - known to alter the top-level header of an RFC 822 message. In - particular, they frequently add, remove, or reorder header fields. - Such alterations are explicitly forbidden for the body part headers - embedded in the bodies of messages of type "multipart." - -7.2.1. Multipart: The common syntax - - All subtypes of "multipart" share a common syntax, defined in this - section. A simple example of a multipart message also appears in - this section. An example of a more complex multipart message is - - - -Borenstein & Freed [Page 29] - -RFC 1521 MIME September 1993 - - - given in Appendix C. - - The Content-Type field for multipart entities requires one parameter, - "boundary", which is used to specify the encapsulation boundary. The - encapsulation boundary is defined as a line consisting entirely of - two hyphen characters ("-", decimal code 45) followed by the boundary - parameter value from the Content-Type header field. - - NOTE: The hyphens are for rough compatibility with the earlier RFC - 934 method of message encapsulation, and for ease of searching for - the boundaries in some implementations. However, it should be - noted that multipart messages are NOT completely compatible with - RFC 934 encapsulations; in particular, they do not obey RFC 934 - quoting conventions for embedded lines that begin with hyphens. - This mechanism was chosen over the RFC 934 mechanism because the - latter causes lines to grow with each level of quoting. The - combination of this growth with the fact that SMTP implementations - sometimes wrap long lines made the RFC 934 mechanism unsuitable - for use in the event that deeply-nested multipart structuring is - ever desired. - - WARNING TO IMPLEMENTORS: The grammar for parameters on the Content- - type field is such that it is often necessary to enclose the - boundaries in quotes on the Content-type line. This is not always - necessary, but never hurts. Implementors should be sure to study the - grammar carefully in order to avoid producing illegal Content-type - fields. Thus, a typical multipart Content-Type header field might - look like this: - - Content-Type: multipart/mixed; - boundary=gc0p4Jq0M2Yt08jU534c0p - - But the following is illegal: - - Content-Type: multipart/mixed; - boundary=gc0p4Jq0M:2Yt08jU534c0p - - (because of the colon) and must instead be represented as - - Content-Type: multipart/mixed; - boundary="gc0p4Jq0M:2Yt08jU534c0p" - - This indicates that the entity consists of several parts, each itself - with a structure that is syntactically identical to an RFC 822 - message, except that the header area might be completely empty, and - that the parts are each preceded by the line - - --gc0p4Jq0M:2Yt08jU534c0p - - - -Borenstein & Freed [Page 30] - -RFC 1521 MIME September 1993 - - - Note that the encapsulation boundary must occur at the beginning of a - line, i.e., following a CRLF, and that the initial CRLF is considered - to be attached to the encapsulation boundary rather than part of the - preceding part. The boundary must be followed immediately either by - another CRLF and the header fields for the next part, or by two - CRLFs, in which case there are no header fields for the next part - (and it is therefore assumed to be of Content-Type text/plain). - - NOTE: The CRLF preceding the encapsulation line is conceptually - attached to the boundary so that it is possible to have a part - that does not end with a CRLF (line break). Body parts that must - be considered to end with line breaks, therefore, must have two - CRLFs preceding the encapsulation line, the first of which is part - of the preceding body part, and the second of which is part of the - encapsulation boundary. - - Encapsulation boundaries must not appear within the encapsulations, - and must be no longer than 70 characters, not counting the two - leading hyphens. - - The encapsulation boundary following the last body part is a - distinguished delimiter that indicates that no further body parts - will follow. Such a delimiter is identical to the previous - delimiters, with the addition of two more hyphens at the end of the - line: - - --gc0p4Jq0M2Yt08jU534c0p-- - - There appears to be room for additional information prior to the - first encapsulation boundary and following the final boundary. These - areas should generally be left blank, and implementations must ignore - anything that appears before the first boundary or after the last - one. - - NOTE: These "preamble" and "epilogue" areas are generally not used - because of the lack of proper typing of these parts and the lack - of clear semantics for handling these areas at gateways, - particularly X.400 gateways. However, rather than leaving the - preamble area blank, many MIME implementations have found this to - be a convenient place to insert an explanatory note for recipients - who read the message with pre-MIME software, since such notes will - be ignored by MIME-compliant software. - - NOTE: Because encapsulation boundaries must not appear in the body - parts being encapsulated, a user agent must exercise care to - choose a unique boundary. The boundary in the example above could - have been the result of an algorithm designed to produce - boundaries with a very low probability of already existing in the - - - -Borenstein & Freed [Page 31] - -RFC 1521 MIME September 1993 - - - data to be encapsulated without having to prescan the data. - Alternate algorithms might result in more 'readable' boundaries - for a recipient with an old user agent, but would require more - attention to the possibility that the boundary might appear in the - encapsulated part. The simplest boundary possible is something - like "---", with a closing boundary of "-----". - - As a very simple example, the following multipart message has two - parts, both of them plain text, one of them explicitly typed and one - of them implicitly typed: - - From: Nathaniel Borenstein - To: Ned Freed - Subject: Sample message - MIME-Version: 1.0 - Content-type: multipart/mixed; boundary="simple - boundary" - - This is the preamble. It is to be ignored, though it - is a handy place for mail composers to include an - explanatory note to non-MIME conformant readers. - --simple boundary - - This is implicitly typed plain ASCII text. - It does NOT end with a linebreak. - --simple boundary - Content-type: text/plain; charset=us-ascii - - This is explicitly typed plain ASCII text. - It DOES end with a linebreak. - - --simple boundary-- - This is the epilogue. It is also to be ignored. - - The use of a Content-Type of multipart in a body part within another - multipart entity is explicitly allowed. In such cases, for obvious - reasons, care must be taken to ensure that each nested multipart - entity must use a different boundary delimiter. See Appendix C for an - example of nested multipart entities. - - The use of the multipart Content-Type with only a single body part - may be useful in certain contexts, and is explicitly permitted. - - The only mandatory parameter for the multipart Content-Type is the - boundary parameter, which consists of 1 to 70 characters from a set - of characters known to be very robust through email gateways, and NOT - ending with white space. (If a boundary appears to end with white - space, the white space must be presumed to have been added by a - - - -Borenstein & Freed [Page 32] - -RFC 1521 MIME September 1993 - - - gateway, and must be deleted.) It is formally specified by the - following BNF: - - boundary := 0*69 bcharsnospace - - bchars := bcharsnospace / " " - - bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / "+" /"_" - / "," / "-" / "." / "/" / ":" / "=" / "?" - - Overall, the body of a multipart entity may be specified as - follows: - - multipart-body := preamble 1*encapsulation - close-delimiter epilogue - - encapsulation := delimiter body-part CRLF - - delimiter := "--" boundary CRLF ; taken from Content-Type field. - ; There must be no space - ; between "--" and boundary. - - close-delimiter := "--" boundary "--" CRLF ; Again, no space - by "--", - - preamble := discard-text ; to be ignored upon receipt. - - epilogue := discard-text ; to be ignored upon receipt. - - discard-text := *(*text CRLF) - - body-part := <"message" as defined in RFC 822, - with all header fields optional, and with the - specified delimiter not occurring anywhere in - the message body, either on a line by itself - or as a substring anywhere. Note that the - semantics of a part differ from the semantics - of a message, as described in the text.> - - NOTE: In certain transport enclaves, RFC 822 restrictions such as - the one that limits bodies to printable ASCII characters may not - be in force. (That is, the transport domains may resemble - standard Internet mail transport as specified in RFC821 and - assumed by RFC822, but without certain restrictions.) The - relaxation of these restrictions should be construed as locally - extending the definition of bodies, for example to include octets - outside of the ASCII range, as long as these extensions are - supported by the transport and adequately documented in the - - - -Borenstein & Freed [Page 33] - -RFC 1521 MIME September 1993 - - - Content-Transfer-Encoding header field. However, in no event are - headers (either message headers or body-part headers) allowed to - contain anything other than ASCII characters. - - NOTE: Conspicuously missing from the multipart type is a notion of - structured, related body parts. In general, it seems premature to - try to standardize interpart structure yet. It is recommended - that those wishing to provide a more structured or integrated - multipart messaging facility should define a subtype of multipart - that is syntactically identical, but that always expects the - inclusion of a distinguished part that can be used to specify the - structure and integration of the other parts, probably referring - to them by their Content-ID field. If this approach is used, - other implementations will not recognize the new subtype, but will - treat it as the primary subtype (multipart/mixed) and will thus be - able to show the user the parts that are recognized. - -7.2.2. The Multipart/mixed (primary) subtype - - The primary subtype for multipart, "mixed", is intended for use when - the body parts are independent and need to be bundled in a particular - order. Any multipart subtypes that an implementation does not - recognize must be treated as being of subtype "mixed". - -7.2.3. The Multipart/alternative subtype - - The multipart/alternative type is syntactically identical to - multipart/mixed, but the semantics are different. In particular, - each of the parts is an "alternative" version of the same - information. - - Systems should recognize that the content of the various parts are - interchangeable. Systems should choose the "best" type based on the - local environment and preferences, in some cases even through user - interaction. As with multipart/mixed, the order of body parts is - significant. In this case, the alternatives appear in an order of - increasing faithfulness to the original content. In general, the best - choice is the LAST part of a type supported by the recipient system's - local environment. - - Multipart/alternative may be used, for example, to send mail in a - fancy text format in such a way that it can easily be displayed - anywhere: - - - - - - - - -Borenstein & Freed [Page 34] - -RFC 1521 MIME September 1993 - - - From: Nathaniel Borenstein - To: Ned Freed - Subject: Formatted text mail - MIME-Version: 1.0 - Content-Type: multipart/alternative; boundary=boundary42 - - --boundary42 - - Content-Type: text/plain; charset=us-ascii - - ...plain text version of message goes here.... - --boundary42 - Content-Type: text/richtext - - .... RFC 1341 richtext version of same message goes here ... - --boundary42 - Content-Type: text/x-whatever - - .... fanciest formatted version of same message goes here - ... - --boundary42-- - - In this example, users whose mail system understood the "text/x- - whatever" format would see only the fancy version, while other users - would see only the richtext or plain text version, depending on the - capabilities of their system. - - In general, user agents that compose multipart/alternative entities - must place the body parts in increasing order of preference, that is, - with the preferred format last. For fancy text, the sending user - agent should put the plainest format first and the richest format - last. Receiving user agents should pick and display the last format - they are capable of displaying. In the case where one of the - alternatives is itself of type "multipart" and contains unrecognized - sub-parts, the user agent may choose either to show that alternative, - an earlier alternative, or both. - - NOTE: From an implementor's perspective, it might seem more - sensible to reverse this ordering, and have the plainest - alternative last. However, placing the plainest alternative first - is the friendliest possible option when multipart/alternative - entities are viewed using a non-MIME-conformant mail reader. - While this approach does impose some burden on conformant mail - readers, interoperability with older mail readers was deemed to be - more important in this case. - - It may be the case that some user agents, if they can recognize more - than one of the formats, will prefer to offer the user the choice of - - - -Borenstein & Freed [Page 35] - -RFC 1521 MIME September 1993 - - - which format to view. This makes sense, for example, if mail - includes both a nicely-formatted image version and an easily-edited - text version. What is most critical, however, is that the user not - automatically be shown multiple versions of the same data. Either - the user should be shown the last recognized version or should be - given the choice. - - NOTE ON THE SEMANTICS OF CONTENT-ID IN MULTIPART/ALTERNATIVE: Each - part of a multipart/alternative entity represents the same data, but - the mappings between the two are not necessarily without information - loss. For example, information is lost when translating ODA to - PostScript or plain text. It is recommended that each part should - have a different Content-ID value in the case where the information - content of the two parts is not identical. However, where the - information content is identical -- for example, where several parts - of type "application/external- body" specify alternate ways to access - the identical data -- the same Content-ID field value should be used, - to optimize any cacheing mechanisms that might be present on the - recipient's end. However, it is recommended that the Content-ID - values used by the parts should not be the same Content-ID value that - describes the multipart/alternative as a whole, if there is any such - Content-ID field. That is, one Content-ID value will refer to the - multipart/alternative entity, while one or more other Content-ID - values will refer to the parts inside it. - -7.2.4. The Multipart/digest subtype - - This document defines a "digest" subtype of the multipart Content- - Type. This type is syntactically identical to multipart/mixed, but - the semantics are different. In particular, in a digest, the default - Content-Type value for a body part is changed from "text/plain" to - "message/rfc822". This is done to allow a more readable digest - format that is largely compatible (except for the quoting convention) - with RFC 934. - - - - - - - - - - - - - - - - - -Borenstein & Freed [Page 36] - -RFC 1521 MIME September 1993 - - - A digest in this format might, then, look something like this: - - From: Moderator-Address - To: Recipient-List - MIME-Version: 1.0 - Subject: Internet Digest, volume 42 - Content-Type: multipart/digest; - boundary="---- next message ----" - - ------ next message ---- - - From: someone-else - Subject: my opinion - - ...body goes here ... - - ------ next message ---- - - From: someone-else-again - Subject: my different opinion - - ... another body goes here... - - ------ next message ------ - -7.2.5. The Multipart/parallel subtype - - This document defines a "parallel" subtype of the multipart Content- - Type. This type is syntactically identical to multipart/mixed, but - the semantics are different. In particular, in a parallel entity, - the order of body parts is not significant. - - A common presentation of this type is to display all of the parts - simultaneously on hardware and software that are capable of doing so. - However, composing agents should be aware that many mail readers will - lack this capability and will show the parts serially in any event. - -7.2.6. Other Multipart subtypes - - Other multipart subtypes are expected in the future. MIME - implementations must in general treat unrecognized subtypes of - multipart as being equivalent to "multipart/mixed". - - The formal grammar for content-type header fields for multipart data - is given by: - - multipart-type := "multipart" "/" multipart-subtype - ";" "boundary" "=" boundary - - - -Borenstein & Freed [Page 37] - -RFC 1521 MIME September 1993 - - - multipart-subtype := "mixed" / "parallel" / "digest" - / "alternative" / extension-token - -7.3. The Message Content-Type - - It is frequently desirable, in sending mail, to encapsulate another - mail message. For this common operation, a special Content-Type, - "message", is defined. The primary subtype, message/rfc822, has no - required parameters in the Content-Type field. Additional subtypes, - "partial" and "External-body", do have required parameters. These - subtypes are explained below. - - NOTE: It has been suggested that subtypes of message might be - defined for forwarded or rejected messages. However, forwarded - and rejected messages can be handled as multipart messages in - which the first part contains any control or descriptive - information, and a second part, of type message/rfc822, is the - forwarded or rejected message. Composing rejection and forwarding - messages in this manner will preserve the type information on the - original message and allow it to be correctly presented to the - recipient, and hence is strongly encouraged. - - As stated in the definition of the Content-Transfer-Encoding field, - no encoding other than "7bit", "8bit", or "binary" is permitted for - messages or parts of type "message". Even stronger restrictions - apply to the subtypes "message/partial" and "message/external-body", - as specified below. The message header fields are always US-ASCII in - any case, and data within the body can still be encoded, in which - case the Content-Transfer-Encoding header field in the encapsulated - message will reflect this. Non-ASCII text in the headers of an - encapsulated message can be specified using the mechanisms described - in [RFC-1522]. - - Mail gateways, relays, and other mail handling agents are commonly - known to alter the top-level header of an RFC 822 message. In - particular, they frequently add, remove, or reorder header fields. - Such alterations are explicitly forbidden for the encapsulated - headers embedded in the bodies of messages of type "message." - -7.3.1. The Message/rfc822 (primary) subtype - - A Content-Type of "message/rfc822" indicates that the body contains - an encapsulated message, with the syntax of an RFC 822 message. - However, unlike top-level RFC 822 messages, it is not required that - each message/rfc822 body must include a "From", "Subject", and at - least one destination header. - - It should be noted that, despite the use of the numbers "822", a - - - -Borenstein & Freed [Page 38] - -RFC 1521 MIME September 1993 - - - message/rfc822 entity can include enhanced information as defined in - this document. In other words, a message/rfc822 message may be a - MIME message. - -7.3.2. The Message/Partial subtype - - A subtype of message, "partial", is defined in order to allow large - objects to be delivered as several separate pieces of mail and - automatically reassembled by the receiving user agent. (The concept - is similar to IP fragmentation/reassembly in the basic Internet - Protocols.) This mechanism can be used when intermediate transport - agents limit the size of individual messages that can be sent. - Content-Type "message/partial" thus indicates that the body contains - a fragment of a larger message. - - Three parameters must be specified in the Content-Type field of type - message/partial: The first, "id", is a unique identifier, as close to - a world-unique identifier as possible, to be used to match the parts - together. (In general, the identifier is essentially a message-id; - if placed in double quotes, it can be any message-id, in accordance - with the BNF for "parameter" given earlier in this specification.) - The second, "number", an integer, is the part number, which indicates - where this part fits into the sequence of fragments. The third, - "total", another integer, is the total number of parts. This third - subfield is required on the final part, and is optional (though - encouraged) on the earlier parts. Note also that these parameters - may be given in any order. - - Thus, part 2 of a 3-part message may have either of the following - header fields: - - Content-Type: Message/Partial; - number=2; total=3; - id="oc=jpbe0M2Yt4s@thumper.bellcore.com" - - Content-Type: Message/Partial; - id="oc=jpbe0M2Yt4s@thumper.bellcore.com"; - number=2 - - But part 3 MUST specify the total number of parts: - - Content-Type: Message/Partial; - number=3; total=3; - id="oc=jpbe0M2Yt4s@thumper.bellcore.com" - - Note that part numbering begins with 1, not 0. - - When the parts of a message broken up in this manner are put - - - -Borenstein & Freed [Page 39] - -RFC 1521 MIME September 1993 - - - together, the result is a complete MIME entity, which may have its - own Content-Type header field, and thus may contain any other data - type. - - Message fragmentation and reassembly: The semantics of a reassembled - partial message must be those of the "inner" message, rather than of - a message containing the inner message. This makes it possible, for - example, to send a large audio message as several partial messages, - and still have it appear to the recipient as a simple audio message - rather than as an encapsulated message containing an audio message. - That is, the encapsulation of the message is considered to be - "transparent". - - When generating and reassembling the parts of a message/partial - message, the headers of the encapsulated message must be merged with - the headers of the enclosing entities. In this process the following - rules must be observed: - - (1) All of the header fields from the initial enclosing entity - (part one), except those that start with "Content-" and the - specific header fields "Message-ID", "Encrypted", and "MIME- - Version", must be copied, in order, to the new message. - - (2) Only those header fields in the enclosed message which start - with "Content-" and "Message-ID", "Encrypted", and "MIME-Version" - must be appended, in order, to the header fields of the new - message. Any header fields in the enclosed message which do not - start with "Content-" (except for "Message-ID", "Encrypted", and - "MIME-Version") will be ignored. - - (3) All of the header fields from the second and any subsequent - messages will be ignored. - - For example, if an audio message is broken into two parts, the first - part might look something like this: - - X-Weird-Header-1: Foo - From: Bill@host.com - To: joe@otherhost.com - Subject: Audio mail - Message-ID: - MIME-Version: 1.0 - Content-type: message/partial; - id="ABC@host.com"; - number=1; total=2 - - X-Weird-Header-1: Bar - X-Weird-Header-2: Hello - - - -Borenstein & Freed [Page 40] - -RFC 1521 MIME September 1993 - - - Message-ID: - MIME-Version: 1.0 - Content-type: audio/basic - Content-transfer-encoding: base64 - - ... first half of encoded audio data goes here... - - and the second half might look something like this: - - From: Bill@host.com - To: joe@otherhost.com - Subject: Audio mail - MIME-Version: 1.0 - Message-ID: - Content-type: message/partial; - id="ABC@host.com"; number=2; total=2 - - ... second half of encoded audio data goes here... - - Then, when the fragmented message is reassembled, the resulting - message to be displayed to the user should look something like this: - - X-Weird-Header-1: Foo - From: Bill@host.com - To: joe@otherhost.com - Subject: Audio mail - Message-ID: - MIME-Version: 1.0 - Content-type: audio/basic - Content-transfer-encoding: base64 - - ... first half of encoded audio data goes here... - ... second half of encoded audio data goes here... - - Note on encoding of MIME entities encapsulated inside message/partial - entities: Because data of type "message" may never be encoded in - base64 or quoted-printable, a problem might arise if message/partial - entities are constructed in an environment that supports binary or - 8-bit transport. The problem is that the binary data would be split - into multiple message/partial objects, each of them requiring binary - transport. If such objects were encountered at a gateway into a 7- - bit transport environment, there would be no way to properly encode - them for the 7-bit world, aside from waiting for all of the parts, - reassembling the message, and then encoding the reassembled data in - base64 or quoted-printable. Since it is possible that different - parts might go through different gateways, even this is not an - acceptable solution. For this reason, it is specified that MIME - entities of type message/partial must always have a content- - - - -Borenstein & Freed [Page 41] - -RFC 1521 MIME September 1993 - - - transfer-encoding of 7-bit (the default). In particular, even in - environments that support binary or 8-bit transport, the use of a - content-transfer-encoding of "8bit" or "binary" is explicitly - prohibited for entities of type message/partial. - - It should be noted that, because some message transfer agents may - choose to automatically fragment large messages, and because such - agents may use different fragmentation thresholds, it is possible - that the pieces of a partial message, upon reassembly, may prove - themselves to comprise a partial message. This is explicitly - permitted. - - It should also be noted that the inclusion of a "References" field in - the headers of the second and subsequent pieces of a fragmented - message that references the Message-Id on the previous piece may be - of benefit to mail readers that understand and track references. - However, the generation of such "References" fields is entirely - optional. - - Finally, it should be noted that the "Encrypted" header field has - been made obsolete by Privacy Enhanced Messaging (PEM), but the rules - above are believed to describe the correct way to treat it if it is - encountered in the context of conversion to and from message/partial - fragments. - -7.3.3. The Message/External-Body subtype - - The external-body subtype indicates that the actual body data are not - included, but merely referenced. In this case, the parameters - describe a mechanism for accessing the external data. - - When an entity is of type "message/external-body", it consists of a - header, two consecutive CRLFs, and the message header for the - encapsulated message. If another pair of consecutive CRLFs appears, - this of course ends the message header for the encapsulated message. - However, since the encapsulated message's body is itself external, it - does NOT appear in the area that follows. For example, consider the - following message: - - Content-type: message/external-body; access- - type=local-file; - - name="/u/nsb/Me.gif" - - Content-type: image/gif - Content-ID: - Content-Transfer-Encoding: binary - - - - -Borenstein & Freed [Page 42] - -RFC 1521 MIME September 1993 - - - THIS IS NOT REALLY THE BODY! - - The area at the end, which might be called the "phantom body", is - ignored for most external-body messages. However, it may be used to - contain auxiliary information for some such messages, as indeed it is - when the access-type is "mail-server". Of the access-types defined - by this document, the phantom body is used only when the access-type - is "mail-server". In all other cases, the phantom body is ignored. - - The only always-mandatory parameter for message/external-body is - "access-type"; all of the other parameters may be mandatory or - optional depending on the value of access-type. - - ACCESS-TYPE -- A case-insensitive word, indicating the supported - access mechanism by which the file or data may be obtained. - Values include, but are not limited to, "FTP", "ANON-FTP", "TFTP", - "AFS", "LOCAL-FILE", and "MAIL-SERVER". Future values, except for - experimental values beginning with "X-" must be registered with - IANA, as described in Appendix E . - - In addition, the following three parameters are optional for ALL - access-types: - - EXPIRATION -- The date (in the RFC 822 "date-time" syntax, as - extended by RFC 1123 to permit 4 digits in the year field) after - which the existence of the external data is not guaranteed. - - SIZE -- The size (in octets) of the data. The intent of this - parameter is to help the recipient decide whether or not to expend - the necessary resources to retrieve the external data. Note that - this describes the size of the data in its canonical form, that - is, before any Content- Transfer-Encoding has been applied or - after the data have been decoded. - - PERMISSION -- A case-insensitive field that indicates whether or - not it is expected that clients might also attempt to overwrite - the data. By default, or if permission is "read", the assumption - is that they are not, and that if the data is retrieved once, it - is never needed again. If PERMISSION is "read-write", this - assumption is invalid, and any local copy must be considered no - more than a cache. "Read" and "Read-write" are the only defined - values of permission. - - The precise semantics of the access-types defined here are described - in the sections that follow. - - The encapsulated headers in ALL message/external-body entities MUST - include a Content-ID header field to give a unique identifier by - - - -Borenstein & Freed [Page 43] - -RFC 1521 MIME September 1993 - - - which to reference the data. This identifier may be used for - cacheing mechanisms, and for recognizing the receipt of the data when - the access-type is "mail-server". - - Note that, as specified here, the tokens that describe external-body - data, such as file names and mail server commands, are required to be - in the US-ASCII character set. If this proves problematic in - practice, a new mechanism may be required as a future extension to - MIME, either as newly defined access-types for message/external-body - or by some other mechanism. - - As with message/partial, it is specified that MIME entities of type - message/external-body must always have a content-transfer-encoding of - 7-bit (the default). In particular, even in environments that - support binary or 8-bit transport, the use of a content-transfer- - encoding of "8bit" or "binary" is explicitly prohibited for entities - of type message/external-body. - -7.3.3.1. The "ftp" and "tftp" access-types - - An access-type of FTP or TFTP indicates that the message body is - accessible as a file using the FTP [RFC-959] or TFTP [RFC-783] - protocols, respectively. For these access-types, the following - additional parameters are mandatory: - - NAME -- The name of the file that contains the actual body data. - - SITE -- A machine from which the file may be obtained, using the - given protocol. This must be a fully qualified domain name, not a - nickname. - - Before any data are retrieved, using FTP, the user will generally - need to be asked to provide a login id and a password for the machine - named by the site parameter. For security reasons, such an id and - password are not specified as content-type parameters, but must be - obtained from the user. - - In addition, the following parameters are optional: - - DIRECTORY -- A directory from which the data named by NAME should - be retrieved. - - MODE -- A case-insensitive string indicating the mode to be used - when retrieving the information. The legal values for access-type - "TFTP" are "NETASCII", "OCTET", and "MAIL", as specified by the - TFTP protocol [RFC-783]. The legal values for access-type "FTP" - are "ASCII", "EBCDIC", "IMAGE", and "LOCALn" where "n" is a - decimal integer, typically 8. These correspond to the - - - -Borenstein & Freed [Page 44] - -RFC 1521 MIME September 1993 - - - representation types "A" "E" "I" and "L n" as specified by the FTP - protocol [RFC-959]. Note that "BINARY" and "TENEX" are not valid - values for MODE, but that "OCTET" or "IMAGE" or "LOCAL8" should be - used instead. IF MODE is not specified, the default value is - "NETASCII" for TFTP and "ASCII" otherwise. - -7.3.3.2. The "anon-ftp" access-type - - The "anon-ftp" access-type is identical to the "ftp" access type, - except that the user need not be asked to provide a name and password - for the specified site. Instead, the ftp protocol will be used with - login "anonymous" and a password that corresponds to the user's email - address. - -7.3.3.3. The "local-file" and "afs" access-types - - An access-type of "local-file" indicates that the actual body is - accessible as a file on the local machine. An access-type of "afs" - indicates that the file is accessible via the global AFS file system. - In both cases, only a single parameter is required: - - NAME -- The name of the file that contains the actual body data. - - The following optional parameter may be used to describe the locality - of reference for the data, that is, the site or sites at which the - file is expected to be visible: - - SITE -- A domain specifier for a machine or set of machines that - are known to have access to the data file. Asterisks may be used - for wildcard matching to a part of a domain name, such as - "*.bellcore.com", to indicate a set of machines on which the data - should be directly visible, while a single asterisk may be used to - indicate a file that is expected to be universally available, - e.g., via a global file system. - -7.3.3.4. The "mail-server" access-type - - The "mail-server" access-type indicates that the actual body is - available from a mail server. The mandatory parameter for this - access-type is: - - SERVER -- The email address of the mail server from which the - actual body data can be obtained. - - Because mail servers accept a variety of syntaxes, some of which is - multiline, the full command to be sent to a mail server is not - included as a parameter on the content-type line. Instead, it is - provided as the "phantom body" when the content-type is - - - -Borenstein & Freed [Page 45] - -RFC 1521 MIME September 1993 - - - message/external-body and the access- type is mail-server. - - An optional parameter for this access-type is: - - SUBJECT -- The subject that is to be used in the mail that is sent - to obtain the data. Note that keying mail servers on Subject lines - is NOT recommended, but such mail servers are known to exist. - - Note that MIME does not define a mail server syntax. Rather, it - allows the inclusion of arbitrary mail server commands in the phantom - body. Implementations must include the phantom body in the body of - the message it sends to the mail server address to retrieve the - relevant data. - - It is worth noting that, unlike other access-types, mail-server - access is asynchronous and will happen at an unpredictable time in - the future. For this reason, it is important that there be a - mechanism by which the returned data can be matched up with the - original message/external-body entity. MIME mailservers must use the - same Content-ID field on the returned message that was used in the - original message/external-body entity, to facilitate such matching. - -7.3.3.5. Examples and Further Explanations - - With the emerging possibility of very wide-area file systems, it - becomes very hard to know in advance the set of machines where a file - will and will not be accessible directly from the file system. - Therefore it may make sense to provide both a file name, to be tried - directly, and the name of one or more sites from which the file is - known to be accessible. An implementation can try to retrieve remote - files using FTP or any other protocol, using anonymous file retrieval - or prompting the user for the necessary name and password. If an - external body is accessible via multiple mechanisms, the sender may - include multiple parts of type message/external-body within an entity - of type multipart/alternative. - - However, the external-body mechanism is not intended to be limited to - file retrieval, as shown by the mail-server access-type. Beyond - this, one can imagine, for example, using a video server for external - references to video clips. - - If an entity is of type "message/external-body", then the body of the - entity will contain the header fields of the encapsulated message. - The body itself is to be found in the external location. This means - that if the body of the "message/external-body" message contains two - consecutive CRLFs, everything after those pairs is NOT part of the - message itself. For most message/external-body messages, this - trailing area must simply be ignored. However, it is a convenient - - - -Borenstein & Freed [Page 46] - -RFC 1521 MIME September 1993 - - - place for additional data that cannot be included in the content-type - header field. In particular, if the "access-type" value is "mail- - server", then the trailing area must contain commands to be sent to - the mail server at the address given by the value of the SERVER - parameter. - - The embedded message header fields which appear in the body of the - message/external-body data must be used to declare the Content-type - of the external body if it is anything other than plain ASCII text, - since the external body does not have a header section to declare its - type. Similarly, any Content-transfer-encoding other than "7bit" - must also be declared here. Thus a complete message/external-body - message, referring to a document in PostScript format, might look - like this: - - From: Whomever - To: Someone - Subject: whatever - MIME-Version: 1.0 - Message-ID: - Content-Type: multipart/alternative; boundary=42 - Content-ID: - - --42 - Content-Type: message/external-body; - name="BodyFormats.ps"; - site="thumper.bellcore.com"; - access-type=ANON-FTP; - directory="pub"; - mode="image"; - expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" - - Content-type: application/postscript - Content-ID: - - --42 - Content-Type: message/external-body; - name="/u/nsb/writing/rfcs/RFC-MIME.ps"; - site="thumper.bellcore.com"; - access-type=AFS - expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" - - Content-type: application/postscript - Content-ID: - - --42 - Content-Type: message/external-body; - access-type=mail-server - - - -Borenstein & Freed [Page 47] - -RFC 1521 MIME September 1993 - - - server="listserv@bogus.bitnet"; - expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" - - Content-type: application/postscript - Content-ID: - - get RFC-MIME.DOC - - --42-- - - Note that in the above examples, the default Content-transfer- - encoding of "7bit" is assumed for the external postscript data. - - Like the message/partial type, the message/external-body type is - intended to be transparent, that is, to convey the data type in the - external body rather than to convey a message with a body of that - type. Thus the headers on the outer and inner parts must be merged - using the same rules as for message/partial. In particular, this - means that the Content-type header is overridden, but the From and - Subject headers are preserved. - - Note that since the external bodies are not transported as mail, they - need not conform to the 7-bit and line length requirements, but might - in fact be binary files. Thus a Content-Transfer-Encoding is not - generally necessary, though it is permitted. - - Note that the body of a message of type "message/external-body" is - governed by the basic syntax for an RFC 822 message. In particular, - anything before the first consecutive pair of CRLFs is header - information, while anything after it is body information, which is - ignored for most access-types. - - The formal grammar for content-type header fields for data of type - message is given by: - - message-type := "message" "/" message-subtype - - message-subtype := "rfc822" - / "partial" 2#3partial-param - / "external-body" 1*external-param - / extension-token - - partial-param := (";" "id" "=" value) - / (";" "number" "=" 1*DIGIT) - / (";" "total" "=" 1*DIGIT) - ; id & number required; total required for last part - - external-param := (";" "access-type" "=" atype) - - - -Borenstein & Freed [Page 48] - -RFC 1521 MIME September 1993 - - - / (";" "expiration" "=" date-time) - ; Note that date-time is quoted - / (";" "size" "=" 1*DIGIT) - / (";" "permission" "=" ("read" / "read-write")) - ; Permission is case-insensitive - / (";" "name" "=" value) - / (";" "site" "=" value) - / (";" "dir" "=" value) - / (";" "mode" "=" value) - / (";" "server" "=" value) - / (";" "subject" "=" value) - ; access-type required;others required based on access-type - - atype := "ftp" / "anon-ftp" / "tftp" / "local-file" - / "afs" / "mail-server" / extension-token - ; Case-insensitive - -7.4. The Application Content-Type - - The "application" Content-Type is to be used for data which do not - fit in any of the other categories, and particularly for data to be - processed by mail-based uses of application programs. This is - information which must be processed by an application before it is - viewable or usable to a user. Expected uses for Content-Type - application include mail-based file transfer, spreadsheets, data for - mail-based scheduling systems, and languages for "active" - (computational) email. (The latter, in particular, can pose security - problems which must be understood by implementors, and are considered - in detail in the discussion of the application/PostScript content- - type.) - - For example, a meeting scheduler might define a standard - representation for information about proposed meeting dates. An - intelligent user agent would use this information to conduct a dialog - with the user, and might then send further mail based on that dialog. - More generally, there have been several "active" messaging languages - developed in which programs in a suitably specialized language are - sent through the mail and automatically run in the recipient's - environment. - - Such applications may be defined as subtypes of the "application" - Content-Type. This document defines two subtypes: octet-stream, and - PostScript. - - In general, the subtype of application will often be the name of the - application for which the data are intended. This does not mean, - however, that any application program name may be used freely as a - subtype of application. Such usages (other than subtypes beginning - - - -Borenstein & Freed [Page 49] - -RFC 1521 MIME September 1993 - - - with "x-") must be registered with IANA, as described in Appendix E. - -7.4.1. The Application/Octet-Stream (primary) subtype - - The primary subtype of application, "octet-stream", may be used to - indicate that a body contains binary data. The set of possible - parameters includes, but is not limited to: - - TYPE -- the general type or category of binary data. This is - intended as information for the human recipient rather than for - any automatic processing. - - PADDING -- the number of bits of padding that were appended to the - bit-stream comprising the actual contents to produce the enclosed - byte-oriented data. This is useful for enclosing a bit-stream in - a body when the total number of bits is not a multiple of the byte - size. - - An additional parameter, "conversions", was defined in [RFC-1341] but - has been removed. - - RFC 1341 also defined the use of a "NAME" parameter which gave a - suggested file name to be used if the data were to be written to a - file. This has been deprecated in anticipation of a separate - Content-Disposition header field, to be defined in a subsequent RFC. - - The recommended action for an implementation that receives - application/octet-stream mail is to simply offer to put the data in a - file, with any Content-Transfer-Encoding undone, or perhaps to use it - as input to a user-specified process. - - To reduce the danger of transmitting rogue programs through the mail, - it is strongly recommended that implementations NOT implement a - path-search mechanism whereby an arbitrary program named in the - Content-Type parameter (e.g., an "interpreter=" parameter) is found - and executed using the mail body as input. - -7.4.2. The Application/PostScript subtype - - A Content-Type of "application/postscript" indicates a PostScript - program. Currently two variants of the PostScript language are - allowed; the original level 1 variant is described in [POSTSCRIPT] - and the more recent level 2 variant is described in [POSTSCRIPT2]. - - PostScript is a registered trademark of Adobe Systems, Inc. Use of - the MIME content-type "application/postscript" implies recognition of - that trademark and all the rights it entails. - - - - -Borenstein & Freed [Page 50] - -RFC 1521 MIME September 1993 - - - The PostScript language definition provides facilities for internal - labeling of the specific language features a given program uses. This - labeling, called the PostScript document structuring conventions, is - very general and provides substantially more information than just - the language level. - - The use of document structuring conventions, while not required, is - strongly recommended as an aid to interoperability. Documents which - lack proper structuring conventions cannot be tested to see whether - or not they will work in a given environment. As such, some systems - may assume the worst and refuse to process unstructured documents. - - The execution of general-purpose PostScript interpreters entails - serious security risks, and implementors are discouraged from simply - sending PostScript email bodies to "off-the-shelf" interpreters. - While it is usually safe to send PostScript to a printer, where the - potential for harm is greatly constrained, implementors should - consider all of the following before they add interactive display of - PostScript bodies to their mail readers. - - The remainder of this section outlines some, though probably not all, - of the possible problems with sending PostScript through the mail. - - Dangerous operations in the PostScript language include, but may not - be limited to, the PostScript operators deletefile, renamefile, - filenameforall, and file. File is only dangerous when applied to - something other than standard input or output. Implementations may - also define additional nonstandard file operators; these may also - pose a threat to security. Filenameforall, the wildcard file search - operator, may appear at first glance to be harmless. Note, however, - that this operator has the potential to reveal information about what - files the recipient has access to, and this information may itself be - sensitive. Message senders should avoid the use of potentially - dangerous file operators, since these operators are quite likely to - be unavailable in secure PostScript implementations. Message- - receiving and -displaying software should either completely disable - all potentially dangerous file operators or take special care not to - delegate any special authority to their operation. These operators - should be viewed as being done by an outside agency when interpreting - PostScript documents. Such disabling and/or checking should be done - completely outside of the reach of the PostScript language itself; - care should be taken to insure that no method exists for re-enabling - full-function versions of these operators. - - The PostScript language provides facilities for exiting the normal - interpreter, or server, loop. Changes made in this "outer" - environment are customarily retained across documents, and may in - some cases be retained semipermanently in nonvolatile memory. The - - - -Borenstein & Freed [Page 51] - -RFC 1521 MIME September 1993 - - - operators associated with exiting the interpreter loop have the - potential to interfere with subsequent document processing. As such, - their unrestrained use constitutes a threat of service denial. - PostScript operators that exit the interpreter loop include, but may - not be limited to, the exitserver and startjob operators. Message- - sending software should not generate PostScript that depends on - exiting the interpreter loop to operate. The ability to exit will - probably be unavailable in secure PostScript implementations. - Message-receiving and -displaying software should, if possible, - disable the ability to make retained changes to the PostScript - environment, and eliminate the startjob and exitserver commands. If - these commands cannot be eliminated, the password associated with - them should at least be set to a hard-to-guess value. - - PostScript provides operators for setting system-wide and device- - specific parameters. These parameter settings may be retained across - jobs and may potentially pose a threat to the correct operation of - the interpreter. The PostScript operators that set system and device - parameters include, but may not be limited to, the setsystemparams - and setdevparams operators. Message-sending software should not - generate PostScript that depends on the setting of system or device - parameters to operate correctly. The ability to set these parameters - will probably be unavailable in secure PostScript implementations. - Message-receiving and -displaying software should, if possible, - disable the ability to change system and device parameters. If these - operators cannot be disabled, the password associated with them - should at least be set to a hard-to-guess value. - - Some PostScript implementations provide nonstandard facilities for - the direct loading and execution of machine code. Such facilities - are quite obviously open to substantial abuse. Message-sending - software should not make use of such features. Besides being totally - hardware- specific, they are also likely to be unavailable in secure - implementations of PostScript. Message-receiving and -displaying - software should not allow such operators to be used if they exist. - - PostScript is an extensible language, and many, if not most, - implementations of it provide a number of their own extensions. This - document does not deal with such extensions explicitly since they - constitute an unknown factor. Message-sending software should not - make use of nonstandard extensions; they are likely to be missing - from some implementations. Message-receiving and -displaying software - should make sure that any nonstandard PostScript operators are secure - and don't present any kind of threat. - - It is possible to write PostScript that consumes huge amounts of - various system resources. It is also possible to write PostScript - programs that loop infinitely. Both types of programs have the - - - -Borenstein & Freed [Page 52] - -RFC 1521 MIME September 1993 - - - potential to cause damage if sent to unsuspecting recipients. - Message-sending software should avoid the construction and - dissemination of such programs, which is antisocial. Message- - receiving and -displaying software should provide appropriate - mechanisms to abort processing of a document after a reasonable - amount of time has elapsed. In addition, PostScript interpreters - should be limited to the consumption of only a reasonable amount of - any given system resource. - - Finally, bugs may exist in some PostScript interpreters which could - possibly be exploited to gain unauthorized access to a recipient's - system. Apart from noting this possibility, there is no specific - action to take to prevent this, apart from the timely correction of - such bugs if any are found. - -7.4.3. Other Application subtypes - - It is expected that many other subtypes of application will be - defined in the future. MIME implementations must generally treat any - unrecognized subtypes as being equivalent to application/octet- - stream. - - The formal grammar for content-type header fields for application - data is given by: - - application-type := "application" "/" application-subtype - - application-subtype := ("octet-stream" *stream-param) - / "postscript" / extension-token - - stream-param := (";" "type" "=" value) - / (";" "padding" "=" padding) - - padding := "0" / "1" / "2" / "3" / "4" / "5" / "6" / "7" - -7.5. The Image Content-Type - - A Content-Type of "image" indicates that the body contains an image. - The subtype names the specific image format. These names are case - insensitive. Two initial subtypes are "jpeg" for the JPEG format, - JFIF encoding, and "gif" for GIF format [GIF]. - - The list of image subtypes given here is neither exclusive nor - exhaustive, and is expected to grow as more types are registered with - IANA, as described in Appendix E. - - The formal grammar for the content-type header field for data of type - image is given by: - - - -Borenstein & Freed [Page 53] - -RFC 1521 MIME September 1993 - - - image-type := "image" "/" ("gif" / "jpeg" / extension-token) - -7.6. The Audio Content-Type - - A Content-Type of "audio" indicates that the body contains audio - data. Although there is not yet a consensus on an "ideal" audio - format for use with computers, there is a pressing need for a format - capable of providing interoperable behavior. - - The initial subtype of "basic" is specified to meet this requirement - by providing an absolutely minimal lowest common denominator audio - format. It is expected that richer formats for higher quality and/or - lower bandwidth audio will be defined by a later document. - - The content of the "audio/basic" subtype is audio encoded using 8-bit - ISDN mu-law [PCM]. When this subtype is present, a sample rate of - 8000 Hz and a single channel is assumed. - - The formal grammar for the content-type header field for data of type - audio is given by: - - audio-type := "audio" "/" ("basic" / extension-token) - -7.7. The Video Content-Type - - A Content-Type of "video" indicates that the body contains a time- - varying-picture image, possibly with color and coordinated sound. - The term "video" is used extremely generically, rather than with - reference to any particular technology or format, and is not meant to - preclude subtypes such as animated drawings encoded compactly. The - subtype "mpeg" refers to video coded according to the MPEG standard - [MPEG]. - - Note that although in general this document strongly discourages the - mixing of multiple media in a single body, it is recognized that many - so-called "video" formats include a representation for synchronized - audio, and this is explicitly permitted for subtypes of "video". - - The formal grammar for the content-type header field for data of type - video is given by: - - video-type := "video" "/" ("mpeg" / extension-token) - -7.8. Experimental Content-Type Values - - A Content-Type value beginning with the characters "X-" is a private - value, to be used by consenting mail systems by mutual agreement. - Any format without a rigorous and public definition must be named - - - -Borenstein & Freed [Page 54] - -RFC 1521 MIME September 1993 - - - with an "X-" prefix, and publicly specified values shall never begin - with "X-". (Older versions of the widely-used Andrew system use the - "X-BE2" name, so new systems should probably choose a different - name.) - - In general, the use of "X-" top-level types is strongly discouraged. - Implementors should invent subtypes of the existing types whenever - possible. The invention of new types is intended to be restricted - primarily to the development of new media types for email, such as - digital odors or holography, and not for new data formats in general. - In many cases, a subtype of application will be more appropriate than - a new top-level type. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Borenstein & Freed [Page 55] - -RFC 1521 MIME September 1993 - - -8. Summary - - Using the MIME-Version, Content-Type, and Content-Transfer-Encoding - header fields, it is possible to include, in a standardized way, - arbitrary types of data objects with RFC 822 conformant mail - messages. No restrictions imposed by either RFC 821 or RFC 822 are - violated, and care has been taken to avoid problems caused by - additional restrictions imposed by the characteristics of some - Internet mail transport mechanisms (see Appendix B). The "multipart" - and "message" Content-Types allow mixing and hierarchical structuring - of objects of different types in a single message. Further Content- - Types provide a standardized mechanism for tagging messages or body - parts as audio, image, or several other kinds of data. A - distinguished parameter syntax allows further specification of data - format details, particularly the specification of alternate character - sets. Additional optional header fields provide mechanisms for - certain extensions deemed desirable by many implementors. Finally, a - number of useful Content-Types are defined for general use by - consenting user agents, notably message/partial, and - message/external-body. - -9. Security Considerations - - Security issues are discussed in Section 7.4.2 and in Appendix F. - Implementors should pay special attention to the security - implications of any mail content-types that can cause the remote - execution of any actions in the recipient's environment. In such - cases, the discussion of the application/postscript content-type in - Section 7.4.2 may serve as a model for considering other content- - types with remote execution capabilities. - - - - - - - - - - - - - - - - - - - - - -Borenstein & Freed [Page 56] - -RFC 1521 MIME September 1993 - - -10. Authors' Addresses - - For more information, the authors of this document may be contacted - via Internet mail: - - Nathaniel S. Borenstein - MRE 2D-296, Bellcore - 445 South St. - Morristown, NJ 07962-1910 - - Phone: +1 201 829 4270 - Fax: +1 201 829 7019 - Email: nsb@bellcore.com - - - Ned Freed - Innosoft International, Inc. - 250 West First Street - Suite 240 - Claremont, CA 91711 - - Phone: +1 909 624 7907 - Fax: +1 909 621 5319 - Email: ned@innosoft.com - - MIME is a result of the work of the Internet Engineering Task Force - Working Group on Email Extensions. The chairman of that group, Greg - Vaudreuil, may be reached at: - - Gregory M. Vaudreuil - Tigon Corporation - 17060 Dallas Parkway - Dallas Texas, 75248 - - Phone: +1 214-733-2722 - EMail: gvaudre@cnri.reston.va.us - - - - - - - - - - - - - - - -Borenstein & Freed [Page 57] - -RFC 1521 MIME September 1993 - - -11. Acknowledgements - - This document is the result of the collective effort of a large - number of people, at several IETF meetings, on the IETF-SMTP and - IETF-822 mailing lists, and elsewhere. Although any enumeration - seems doomed to suffer from egregious omissions, the following are - among the many contributors to this effort: - - Harald Tveit Alvestrand Timo Lehtinen - Randall Atkinson John R. MacMillan - Philippe Brandon Rick McGowan - Kevin Carosso Leo Mclaughlin - Uhhyung Choi Goli Montaser-Kohsari - Cristian Constantinof Keith Moore - Mark Crispin Tom Moore - Dave Crocker Erik Naggum - Terry Crowley Mark Needleman - Walt Daniels John Noerenberg - Frank Dawson Mats Ohrman - Hitoshi Doi Julian Onions - Kevin Donnelly Michael Patton - Keith Edwards David J. Pepper - Chris Eich Blake C. Ramsdell - Johnny Eriksson Luc Rooijakkers - Craig Everhart Marshall T. Rose - Patrik Faeltstroem Jonathan Rosenberg - Erik E. Fair Jan Rynning - Roger Fajman Harri Salminen - Alain Fontaine Michael Sanderson - James M. Galvin Masahiro Sekiguchi - Philip Gladstone Mark Sherman - Thomas Gordon Keld Simonsen - Phill Gross Bob Smart - James Hamilton Peter Speck - Steve Hardcastle-Kille Henry Spencer - David Herron Einar Stefferud - Bruce Howard Michael Stein - Bill Janssen Klaus Steinberger - Olle Jaernefors Peter Svanberg - Risto Kankkunen James Thompson - Phil Karn Steve Uhler - Alan Katz Stuart Vance - Tim Kehres Erik van der Poel - Neil Katin Guido van Rossum - Kyuho Kim Peter Vanderbilt - Anders Klemets Greg Vaudreuil - John Klensin Ed Vielmetti - Valdis Kletniek Ryan Waldron - - - -Borenstein & Freed [Page 58] - -RFC 1521 MIME September 1993 - - - Jim Knowles Wally Wedel - Stev Knowles Sven-Ove Westberg - Bob Kummerfeld Brian Wideen - Pekka Kytolaakso John Wobus - Stellan Lagerstrom Glenn Wright - Vincent Lau Rayan Zachariassen - Donald Lindsay David Zimmerman - Marc Andreessen Bob Braden - Brian Capouch Peter Clitherow - Dave Collier-Brown John Coonrod - Stephen Crocker Jim Davis - Axel Deininger Dana S Emery - Martin Forssen Stephen Gildea - Terry Gray Mark Horton - Warner Losh Carlyn Lowery - Laurence Lundblade Charles Lynn - Larry Masinter Michael J. McInerny - Jon Postel Christer Romson - Yutaka Sato Markku Savela - Richard Alan Schafer Larry W. Virden - Rhys Weatherly Jay Weber - Dave Wecker - -The authors apologize for any omissions from this list, which are -certainly unintentional. - - - - - - - - - - - - - - - - - - - - - - - - - - -Borenstein & Freed [Page 59] - -RFC 1521 MIME September 1993 - - -Appendix A -- Minimal MIME-Conformance - - The mechanisms described in this document are open-ended. It is - definitely not expected that all implementations will support all of - the Content-Types described, nor that they will all share the same - extensions. In order to promote interoperability, however, it is - useful to define the concept of "MIME-conformance" to define a - certain level of implementation that allows the useful interworking - of messages with content that differs from US ASCII text. In this - section, we specify the requirements for such conformance. - - A mail user agent that is MIME-conformant MUST: - - 1. Always generate a "MIME-Version: 1.0" header field. - - 2. Recognize the Content-Transfer-Encoding header field, and - decode all received data encoded with either the quoted-printable - or base64 implementations. Encode any data sent that is not in - seven-bit mail-ready representation using one of these - transformations and include the appropriate Content-Transfer- - Encoding header field, unless the underlying transport mechanism - supports non-seven-bit data, as SMTP does not. - - 3. Recognize and interpret the Content-Type header field, and - avoid showing users raw data with a Content-Type field other than - text. Be able to send at least text/plain messages, with the - character set specified as a parameter if it is not US-ASCII. - - 4. Explicitly handle the following Content-Type values, to at - least the following extents: - - Text: - - -- Recognize and display "text" mail - with the character set "US-ASCII." - - -- Recognize other character sets at - least to the extent of being able - to inform the user about what - character set the message uses. - - -- Recognize the "ISO-8859-*" character - sets to the extent of being able to - display those characters that are - common to ISO-8859-* and US-ASCII, - namely all characters represented - by octet values 0-127. - - - - -Borenstein & Freed [Page 60] - -RFC 1521 MIME September 1993 - - - -- For unrecognized subtypes, show or - offer to show the user the "raw" - version of the data after - conversion of the content from - canonical form to local form. - - Message: - - -- Recognize and display at least the - primary (822) encapsulation. - - Multipart: - - -- Recognize the primary (mixed) - subtype. Display all relevant - information on the message level - and the body part header level and - then display or offer to display - each of the body parts individually. - - -- Recognize the "alternative" subtype, - and avoid showing the user - redundant parts of - multipart/alternative mail. - - -- Treat any unrecognized subtypes as if - they were "mixed". - - Application: - - -- Offer the ability to remove either of - the two types of Content-Transfer- - Encoding defined in this document - and put the resulting information - in a user file. - - 5. Upon encountering any unrecognized Content- Type, an - implementation must treat it as if it had a Content-Type of - "application/octet-stream" with no parameter sub-arguments. How - such data are handled is up to an implementation, but likely - options for handling such unrecognized data include offering the - user to write it into a file (decoded from its mail transport - format) or offering the user to name a program to which the - decoded data should be passed as input. Unrecognized predefined - types, which in a MIME-conformant mailer might still include - audio, image, or video, should also be treated in this way. - - A user agent that meets the above conditions is said to be MIME- - - - -Borenstein & Freed [Page 61] - -RFC 1521 MIME September 1993 - - - conformant. The meaning of this phrase is that it is assumed to be - "safe" to send virtually any kind of properly-marked data to users of - such mail systems, because such systems will at least be able to - treat the data as undifferentiated binary, and will not simply splash - it onto the screen of unsuspecting users. There is another sense in - which it is always "safe" to send data in a format that is MIME- - conformant, which is that such data will not break or be broken by - any known systems that are conformant with RFC 821 and RFC 822. User - agents that are MIME-conformant have the additional guarantee that - the user will not be shown data that were never intended to be viewed - as text. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Borenstein & Freed [Page 62] - -RFC 1521 MIME September 1993 - - -Appendix B -- General Guidelines For Sending Email Data - - Internet email is not a perfect, homogeneous system. Mail may become - corrupted at several stages in its travel to a final destination. - Specifically, email sent throughout the Internet may travel across - many networking technologies. Many networking and mail technologies - do not support the full functionality possible in the SMTP transport - environment. Mail traversing these systems is likely to be modified - in such a way that it can be transported. - - There exist many widely-deployed non-conformant MTAs in the Internet. - These MTAs, speaking the SMTP protocol, alter messages on the fly to - take advantage of the internal data structure of the hosts they are - implemented on, or are just plain broken. - - The following guidelines may be useful to anyone devising a data - format (Content-Type) that will survive the widest range of - networking technologies and known broken MTAs unscathed. Note that - anything encoded in the base64 encoding will satisfy these rules, but - that some well-known mechanisms, notably the UNIX uuencode facility, - will not. Note also that anything encoded in the Quoted-Printable - encoding will survive most gateways intact, but possibly not some - gateways to systems that use the EBCDIC character set. - - (1) Under some circumstances the encoding used for data may change - as part of normal gateway or user agent operation. In particular, - conversion from base64 to quoted-printable and vice versa may be - necessary. This may result in the confusion of CRLF sequences with - line breaks in text bodies. As such, the persistence of CRLF as - something other than a line break must not be relied on. - - (2) Many systems may elect to represent and store text data using - local newline conventions. Local newline conventions may not match - the RFC822 CRLF convention -- systems are known that use plain CR, - plain LF, CRLF, or counted records. The result is that isolated - CR and LF characters are not well tolerated in general; they may - be lost or converted to delimiters on some systems, and hence must - not be relied on. - - (3) TAB (HT) characters may be misinterpreted or may be - automatically converted to variable numbers of spaces. This is - unavoidable in some environments, notably those not based on the - ASCII character set. Such conversion is STRONGLY DISCOURAGED, but - it may occur, and mail formats must not rely on the persistence of - TAB (HT) characters. - - (4) Lines longer than 76 characters may be wrapped or truncated in - some environments. Line wrapping and line truncation are STRONGLY - - - -Borenstein & Freed [Page 63] - -RFC 1521 MIME September 1993 - - - DISCOURAGED, but unavoidable in some cases. Applications which - require long lines must somehow differentiate between soft and - hard line breaks. (A simple way to do this is to use the quoted- - printable encoding.) - - (5) Trailing "white space" characters (SPACE, TAB (HT)) on a line - may be discarded by some transport agents, while other transport - agents may pad lines with these characters so that all lines in a - mail file are of equal length. The persistence of trailing white - space, therefore, must not be relied on. - - (6) Many mail domains use variations on the ASCII character set, - or use character sets such as EBCDIC which contain most but not - all of the US-ASCII characters. The correct translation of - characters not in the "invariant" set cannot be depended on across - character converting gateways. For example, this situation is a - problem when sending uuencoded information across BITNET, an - EBCDIC system. Similar problems can occur without crossing a - gateway, since many Internet hosts use character sets other than - ASCII internally. The definition of Printable Strings in X.400 - adds further restrictions in certain special cases. In - particular, the only characters that are known to be consistent - across all gateways are the 73 characters that correspond to the - upper and lower case letters A-Z and a-z, the 10 digits 0-9, and - the following eleven special characters: - - "'" (ASCII code 39) - "(" (ASCII code 40) - ")" (ASCII code 41) - "+" (ASCII code 43) - "," (ASCII code 44) - "-" (ASCII code 45) - "." (ASCII code 46) - "/" (ASCII code 47) - ":" (ASCII code 58) - "=" (ASCII code 61) - "?" (ASCII code 63) - - A maximally portable mail representation, such as the base64 - encoding, will confine itself to relatively short lines of text in - which the only meaningful characters are taken from this set of 73 - characters. - - (7) Some mail transport agents will corrupt data that includes - certain literal strings. In particular, a period (".") alone on a - line is known to be corrupted by some (incorrect) SMTP - implementations, and a line that starts with the five characters - "From " (the fifth character is a SPACE) are commonly corrupted as - - - -Borenstein & Freed [Page 64] - -RFC 1521 MIME September 1993 - - - well. A careful composition agent can prevent these corruptions - by encoding the data (e.g., in the quoted-printable encoding, - "=46rom " in place of "From " at the start of a line, and "=2E" in - place of "." alone on a line. - - Please note that the above list is NOT a list of recommended - practices for MTAs. RFC 821 MTAs are prohibited from altering the - character of white space or wrapping long lines. These BAD and - illegal practices are known to occur on established networks, and - implementations should be robust in dealing with the bad effects they - can cause. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Borenstein & Freed [Page 65] - -RFC 1521 MIME September 1993 - - -Appendix C -- A Complex Multipart Example - - What follows is the outline of a complex multipart message. This - message has five parts to be displayed serially: two introductory - plain text parts, an embedded multipart message, a richtext part, and - a closing encapsulated text message in a non-ASCII character set. - The embedded multipart message has two parts to be displayed in - parallel, a picture and an audio fragment. - - MIME-Version: 1.0 - From: Nathaniel Borenstein - To: Ned Freed - Subject: A multipart example - Content-Type: multipart/mixed; - boundary=unique-boundary-1 - - This is the preamble area of a multipart message. - Mail readers that understand multipart format - should ignore this preamble. - If you are reading this text, you might want to - consider changing to a mail reader that understands - how to properly display multipart messages. - --unique-boundary-1 - - ...Some text appears here... - [Note that the preceding blank line means - no header fields were given and this is text, - with charset US ASCII. It could have been - done with explicit typing as in the next part.] - - --unique-boundary-1 - Content-type: text/plain; charset=US-ASCII - - This could have been part of the previous part, - but illustrates explicit versus implicit - typing of body parts. - - --unique-boundary-1 - Content-Type: multipart/parallel; - boundary=unique-boundary-2 - - - --unique-boundary-2 - Content-Type: audio/basic - Content-Transfer-Encoding: base64 - - ... base64-encoded 8000 Hz single-channel - mu-law-format audio data goes here.... - - - -Borenstein & Freed [Page 66] - -RFC 1521 MIME September 1993 - - - --unique-boundary-2 - Content-Type: image/gif - Content-Transfer-Encoding: base64 - - ... base64-encoded image data goes here.... - - --unique-boundary-2-- - - --unique-boundary-1 - Content-type: text/richtext - - This is richtext. - as defined in RFC 1341 - Isn't it - cool? - - --unique-boundary-1 - Content-Type: message/rfc822 - - From: (mailbox in US-ASCII) - To: (address in US-ASCII) - Subject: (subject in US-ASCII) - Content-Type: Text/plain; charset=ISO-8859-1 - Content-Transfer-Encoding: Quoted-printable - - ... Additional text in ISO-8859-1 goes here ... - - --unique-boundary-1-- - - - - - - - - - - - - - - - - - - - - - - - -Borenstein & Freed [Page 67] - -RFC 1521 MIME September 1993 - - -Appendix D -- Collected Grammar - - This appendix contains the complete BNF grammar for all the syntax - specified by this document. - - By itself, however, this grammar is incomplete. It refers to several - entities that are defined by RFC 822. Rather than reproduce those - definitions here, and risk unintentional differences between the two, - this document simply refers the reader to RFC 822 for the remaining - definitions. Wherever a term is undefined, it refers to the RFC 822 - definition. - - application-subtype := ("octet-stream" *stream-param) - / "postscript" / extension-token - - application-type := "application" "/" application-subtype - - attribute := token ; case-insensitive - - atype := "ftp" / "anon-ftp" / "tftp" / "local-file" - / "afs" / "mail-server" / extension-token - ; Case-insensitive - - audio-type := "audio" "/" ("basic" / extension-token) - - body-part := <"message" as defined in RFC 822, - with all header fields optional, and with the - specified delimiter not occurring anywhere in - the message body, either on a line by itself - or as a substring anywhere.> - - NOTE: In certain transport enclaves, RFC 822 restrictions such as - the one that limits bodies to printable ASCII characters may not - be in force. (That is, the transport domains may resemble - standard Internet mail transport as specified in RFC821 and - assumed by RFC822, but without certain restrictions.) The - relaxation of these restrictions should be construed as locally - extending the definition of bodies, for example to include octets - outside of the ASCII range, as long as these extensions are - supported by the transport and adequately documented in the - Content-Transfer-Encoding header field. However, in no event are - headers (either message headers or body-part headers) allowed to - contain anything other than ASCII characters. - - - - - - - - -Borenstein & Freed [Page 68] - -RFC 1521 MIME September 1993 - - - boundary := 0*69 bcharsnospace - - bchars := bcharsnospace / " " - - bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / "+" / "_" - / "," / "-" / "." / "/" / ":" / "=" / "?" - - charset := "us-ascii" / "iso-8859-1" / "iso-8859-2"/ "iso-8859-3" - / "iso-8859-4" / "iso-8859-5" / "iso-8859-6" / "iso-8859-7" - / "iso-8859-8" / "iso-8859-9" / extension-token - ; case insensitive - - close-delimiter := "--" boundary "--" CRLF;Again,no space by "--", - - content := "Content-Type" ":" type "/" subtype *(";" parameter) - ; case-insensitive matching of type and subtype - - delimiter := "--" boundary CRLF ;taken from Content-Type field. - ; There must be no space - ; between "--" and boundary. - - description := "Content-Description" ":" *text - - discard-text := *(*text CRLF) - - encapsulation := delimiter body-part CRLF - - encoding := "Content-Transfer-Encoding" ":" mechanism - - epilogue := discard-text ; to be ignored upon receipt. - - extension-token := x-token / iana-token - - external-param := (";" "access-type" "=" atype) - / (";" "expiration" "=" date-time) - - ; Note that date-time is quoted - / (";" "size" "=" 1*DIGIT) - / (";" "permission" "=" ("read" / "read-write")) - ; Permission is case-insensitive - / (";" "name" "=" value) - / (";" "site" "=" value) - / (";" "dir" "=" value) - / (";" "mode" "=" value) - / (";" "server" "=" value) - / (";" "subject" "=" value) - ;access-type required; others required based on access-type - - - - -Borenstein & Freed [Page 69] - -RFC 1521 MIME September 1993 - - - iana-token := - - id := "Content-ID" ":" msg-id - - image-type := "image" "/" ("gif" / "jpeg" / extension-token) - - mechanism := "7bit" ; case-insensitive - / "quoted-printable" - / "base64" - / "8bit" - / "binary" - / x-token - - message-subtype := "rfc822" - / "partial" 2#3partial-param - / "external-body" 1*external-param - / extension-token - - message-type := "message" "/" message-subtype - - multipart-body :=preamble 1*encapsulation close-delimiter epilogue - - multipart-subtype := "mixed" / "parallel" / "digest" - / "alternative" / extension-token - - multipart-type := "multipart" "/" multipart-subtype - ";" "boundary" "=" boundary - - octet := "=" 2(DIGIT / "A" / "B" / "C" / "D" / "E" / "F") - ; octet must be used for characters > 127, =, SPACE, or - TAB, - ; and is recommended for any characters not listed in - ; Appendix B as "mail-safe". - - padding := "0" / "1" / "2" / "3" / "4" / "5" / "6" / "7" - - parameter := attribute "=" value - - partial-param := (";" "id" "=" value) - / (";" "number" "=" 1*DIGIT) - / (";" "total" "=" 1*DIGIT) - ; id & number required;total required for last part - - preamble := discard-text ; to be ignored upon receipt. - - ptext := octet / " / "@" - / "," / ";" / ":" / "\" / <"> - / "/" / "[" / "]" / "?" / "=" - ; Must be in quoted-string, - ; to use within parameter values - - - type := "application" / "audio" ; case-insensitive - / "image" / "message" - / "multipart" / "text" - / "video" / extension-token - ; All values case-insensitive - - value := token / quoted-string - - version := "MIME-Version" ":" 1*DIGIT "." 1*DIGIT - - video-type := "video" "/" ("mpeg" / extension-token) - - x-token := - - - - - - - - - - - - - -Borenstein & Freed [Page 71] - -RFC 1521 MIME September 1993 - - -Appendix E -- IANA Registration Procedures - - MIME has been carefully designed to have extensible mechanisms, and - it is expected that the set of content-type/subtype pairs and their - associated parameters will grow significantly with time. Several - other MIME fields, notably character set names, access-type - parameters for the message/external-body type, and possibly even - Content-Transfer-Encoding values, are likely to have new values - defined over time. In order to ensure that the set of such values is - developed in an orderly, well-specified, and public manner, MIME - defines a registration process which uses the Internet Assigned - Numbers Authority (IANA) as a central registry for such values. - - In general, parameters in the content-type header field are used to - convey supplemental information for various content types, and their - use is defined when the content-type and subtype are defined. New - parameters should not be defined as a way to introduce new - functionality. - - In order to simplify and standardize the registration process, this - appendix gives templates for the registration of new values with - IANA. Each of these is given in the form of an email message - template, to be filled in by the registering party. - - E.1 Registration of New Content-type/subtype Values - - Note that MIME is generally expected to be extended by subtypes. If - a new fundamental top-level type is needed, its specification must be - published as an RFC or submitted in a form suitable to become an RFC, - and be subject to the Internet standards process. - - To: IANA@isi.edu - Subject: Registration of new MIME - content-type/subtype - - MIME type name: - - (If the above is not an existing top-level MIME type, - please explain why an existing type cannot be used.) - - MIME subtype name: - - Required parameters: - - Optional parameters: - - Encoding considerations: - - - - -Borenstein & Freed [Page 72] - -RFC 1521 MIME September 1993 - - - Security considerations: - - Published specification: - - (The published specification must be an Internet RFC or - RFC-to-be if a new top-level type is being defined, and - must be a publicly available specification in any - case.) - - Person & email address to contact for further information: - - E.2 Registration of New Access-type Values - for Message/external-body - - To: IANA@isi.edu - Subject: Registration of new MIME Access-type for - Message/external-body content-type - - MIME access-type name: - - Required parameters: - - Optional parameters: - - Published specification: - - (The published specification must be an Internet RFC or - RFC-to-be.) - - Person & email address to contact for further information: - - - - - - - - - - - - - - - - - - - - - -Borenstein & Freed [Page 73] - -RFC 1521 MIME September 1993 - - -Appendix F -- Summary of the Seven Content-types - - Content-type: text - - Subtypes defined by this document: plain - - Important Parameters: charset - - Encoding notes: quoted-printable generally preferred if an encoding - is needed and the character set is mostly an ASCII superset. - - Security considerations: Rich text formats such as TeX and Troff - often contain mechanisms for executing arbitrary commands or file - system operations, and should not be used automatically unless - these security problems have been addressed. Even plain text may - contain control characters that can be used to exploit the - capabilities of "intelligent" terminals and cause security - violations. User interfaces designed to run on such terminals - should be aware of and try to prevent such problems. - - ________________________________________________________ - Content-type: multipart - - Subtypes defined by this document: mixed, alternative, - digest, parallel. - - Important Parameters: boundary - - Encoding notes: No content-transfer-encoding is permitted. - - ________________________________________________________ - Content-type: message - - Subtypes defined by this document: rfc822, partial, external-body - - Important Parameters: id, number, total, access-type, expiration, - size, permission, name, site, directory, mode, server, subject - - Encoding notes: No content-transfer-encoding is permitted. - Specifically, only "7bit" is permitted for "message/partial" or - "message/external-body", and only "7bit", "8bit", or "binary" are - permitted for other subtypes of "message". - ______________________________________________________________ - Content-type: application - - Subtypes defined by this document: octet-stream, postscript - - Important Parameters: type, padding - - - -Borenstein & Freed [Page 74] - -RFC 1521 MIME September 1993 - - - Deprecated Parameters: name and conversions were - defined in RFC 1341. - - Encoding notes: base64 preferred for unreadable subtypes. - - Security considerations: This type is intended for the - transmission of data to be interpreted by locally-installed - programs. If used, for example, to transmit executable - binary programs or programs in general-purpose interpreted - languages, such as LISP programs or shell scripts, severe - security problems could result. Authors of mail-reading - agents are cautioned against giving their systems the power - to execute mail-based application data without carefully - considering the security implications. While it is - certainly possible to define safe application formats and - even safe interpreters for unsafe formats, each interpreter - should be evaluated separately for possible security - problems. - ________________________________________________________________ - Content-type: image - - Subtypes defined by this document: jpeg, gif - - Important Parameters: none - - Encoding notes: base64 generally preferred - ________________________________________________________________ - Content-type: audio - - Subtypes defined by this document: basic - - Important Parameters: none - - Encoding notes: base64 generally preferred - ________________________________________________________________ - Content-type: video - - Subtypes defined by this document: mpeg - - Important Parameters: none - - Encoding notes: base64 generally preferred - - - - - - - - - -Borenstein & Freed [Page 75] - -RFC 1521 MIME September 1993 - - -Appendix G -- Canonical Encoding Model - - There was some confusion, in earlier drafts of this memo, regarding - the model for when email data was to be converted to canonical form - and encoded, and in particular how this process would affect the - treatment of CRLFs, given that the representation of newlines varies - greatly from system to system. For this reason, a canonical model - for encoding is presented below. - - The process of composing a MIME entity can be modeled as being done - in a number of steps. Note that these steps are roughly similar to - those steps used in RFC 1421 and are performed for each 'innermost - level' body: - - Step 1. Creation of local form. - - The body to be transmitted is created in the system's native format. - The native character set is used, and where appropriate local end of - line conventions are used as well. The body may be a UNIX-style text - file, or a Sun raster image, or a VMS indexed file, or audio data in - a system-dependent format stored only in memory, or anything else - that corresponds to the local model for the representation of some - form of information. Fundamentally, the data is created in the - "native" form specified by the type/subtype information. - - Step 2. Conversion to canonical form. - - The entire body, including "out-of-band" information such as record - lengths and possibly file attribute information, is converted to a - universal canonical form. The specific content type of the body as - well as its associated attributes dictate the nature of the canonical - form that is used. Conversion to the proper canonical form may - involve character set conversion, transformation of audio data, - compression, or various other operations specific to the various - content types. If character set conversion is involved, however, - care must be taken to understand the semantics of the content-type, - which may have strong implications for any character set conversion, - e.g. with regard to syntactically meaningful characters in a text - subtype other than "plain". - - For example, in the case of text/plain data, the text must be - converted to a supported character set and lines must be delimited - with CRLF delimiters in accordance with RFC822. Note that the - restriction on line lengths implied by RFC822 is eliminated if the - next step employs either quoted-printable or base64 encoding. - - - - - - -Borenstein & Freed [Page 76] - -RFC 1521 MIME September 1993 - - - Step 3. Apply transfer encoding. - - A Content-Transfer-Encoding appropriate for this body is applied. - Note that there is no fixed relationship between the content type and - the transfer encoding. In particular, it may be appropriate to base - the choice of base64 or quoted-printable on character frequency - counts which are specific to a given instance of a body. - - Step 4. Insertion into entity. - - The encoded object is inserted into a MIME entity with appropriate - headers. The entity is then inserted into the body of a higher-level - entity (message or multipart) if needed. - - It is vital to note that these steps are only a model; they are - specifically NOT a blueprint for how an actual system would be built. - In particular, the model fails to account for two common designs: - - 1. In many cases the conversion to a canonical form prior to - encoding will be subsumed into the encoder itself, which - understands local formats directly. For example, the local - newline convention for text bodies might be carried through to the - encoder itself along with knowledge of what that format is. - - 2. The output of the encoders may have to pass through one or - more additional steps prior to being transmitted as a message. As - such, the output of the encoder may not be conformant with the - formats specified by RFC822. In particular, once again it may be - appropriate for the converter's output to be expressed using local - newline conventions rather than using the standard RFC822 CRLF - delimiters. - - Other implementation variations are conceivable as well. The vital - aspect of this discussion is that, in spite of any optimizations, - collapsings of required steps, or insertion of additional processing, - the resulting messages must be consistent with those produced by the - model described here. For example, a message with the following - header fields: - - Content-type: text/foo; charset=bar - Content-Transfer-Encoding: base64 - - must be first represented in the text/foo form, then (if necessary) - represented in the "bar" character set, and finally transformed via - the base64 algorithm into a mail-safe form. - - - - - - -Borenstein & Freed [Page 77] - -RFC 1521 MIME September 1993 - - -Appendix H -- Changes from RFC 1341 - - This document is a relatively minor revision of RFC 1341. For - the convenience of those familiar with RFC 1341, the technical - changes from that document are summarized in this appendix. - - 1. The definition of "tspecials" has been changed to no longer - include ".". - - 2. The Content-ID field is now mandatory for message/external-body - parts. - - 3. The text/richtext type (including the old Section 7.1.3 and - Appendix D) has been moved to a separate document. - - 4. The rules on header merging for message/partial data have been - changed to treat the Encrypted and MIME-Version headers as special - cases. - - 5. The definition of the external-body access-type parameter has - been changed so that it can only indicate a single access method - (which was all that made sense). - - 6. There is a new "Subject" parameter for message/external-body, - access-type mail-server, to permit MIME-based use of mail servers - that rely on Subject field information. - - 7. The "conversions" parameter for application/octet-stream has been - removed. - - 8. Section 7.4.1 now deprecates the use of the "name" parameter for - application/octet-stream, as this will be superseded in the future by - a Content-Disposition header. - - 9. The formal grammar for multipart bodies has been changed so that - a CRLF is no longer required before the first boundary line. - - 10. MIME entities of type "message/partial" and "message/external- - body" are now required to use only the "7bit" transfer-encoding. - (Specifically, "binary" and "8bit" are not permitted.) - - 11. The "application/oda" content-type has been removed. - - 12. A note has been added to the end of section 7.2.3, explaining - the semantics of Content-ID in a multipart/alternative MIME entity. - - 13. The formal syntax for the "MIME-Version" field has been - tightened, but in a way that is completely compatible with the only - - - -Borenstein & Freed [Page 78] - -RFC 1521 MIME September 1993 - - - version number defined in RFC 1341. - - 14. In Section 7.3.1, the definition of message/rfc822 has been - relaxed regarding mandatory fields. - - All other changes from RFC 1341 were editorial changes and do not - affect the technical content of MIME. Considerable formal grammar - has been added, but this reflects the prose specification that was - already in place. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Borenstein & Freed [Page 79] - -RFC 1521 MIME September 1993 - - -References - - [US-ASCII] Coded Character Set--7-Bit American Standard Code for - Information Interchange, ANSI X3.4-1986. - - [ATK] Borenstein, Nathaniel S., Multimedia Applications Development - with the Andrew Toolkit, Prentice-Hall, 1990. - - [GIF] Graphics Interchange Format (Version 89a), Compuserve, Inc., - Columbus, Ohio, 1990. - - [ISO-2022] International Standard--Information Processing--ISO 7-bit - and 8-bit coded character sets--Code extension techniques, ISO - 2022:1986. - - [ISO-8859] Information Processing -- 8-bit Single-Byte Coded Graphic - Character Sets -- Part 1: Latin Alphabet No. 1, ISO 8859-1:1987. Part - 2: Latin alphabet No. 2, ISO 8859-2, 1987. Part 3: Latin alphabet - No. 3, ISO 8859-3, 1988. Part 4: Latin alphabet No. 4, ISO 8859-4, - 1988. Part 5: Latin/Cyrillic alphabet, ISO 8859-5, 1988. Part 6: - Latin/Arabic alphabet, ISO 8859-6, 1987. Part 7: Latin/Greek - alphabet, ISO 8859-7, 1987. Part 8: Latin/Hebrew alphabet, ISO - 8859-8, 1988. Part 9: Latin alphabet No. 5, ISO 8859-9, 1990. - - [ISO-646] International Standard--Information Processing--ISO 7-bit - coded character set for information interchange, ISO 646:1983. - - [MPEG] Video Coding Draft Standard ISO 11172 CD, ISO IEC/TJC1/SC2/WG11 - (Motion Picture Experts Group), May, 1991. - - [PCM] CCITT, Fascicle III.4 - Recommendation G.711, Geneva, 1972, - "Pulse Code Modulation (PCM) of Voice Frequencies". - - [POSTSCRIPT] Adobe Systems, Inc., PostScript Language Reference - Manual, Addison-Wesley, 1985. - - [POSTSCRIPT2] Adobe Systems, Inc., PostScript Language Reference - Manual, Addison-Wesley, Second Edition, 1990. - - [X400] Schicker, Pietro, "Message Handling Systems, X.400", Message - Handling Systems and Distributed Applications, E. Stefferud, O-j. - Jacobsen, and P. Schicker, eds., North-Holland, 1989, pp. 3-41. - - [RFC-783] Sollins, K., "TFTP Protocol (revision 2)", RFC 783, MIT, - June 1981. - - [RFC-821] Postel, J., "Simple Mail Transfer Protocol", STD 10, RFC - 821, USC/Information Sciences Institute, August 1982. - - - -Borenstein & Freed [Page 80] - -RFC 1521 MIME September 1993 - - - [RFC-822] Crocker, D., "Standard for the Format of ARPA Internet Text - Messages", STD 11, RFC 822, UDEL, August 1982. - - [RFC-934] Rose, M., and E. Stefferud, "Proposed Standard for Message - Encapsulation", RFC 934, Delaware and NMA, January 1985. - - [RFC-959] Postel, J. and J. Reynolds, "File Transfer Protocol", - STD 9, RFC 959, USC/Information Sciences Institute, October 1985. - - [RFC-1049] Sirbu, M., "Content-Type Header Field for Internet - Messages", STD 11, RFC 1049, CMU, March 1988. - - [RFC-1421] Linn, J., "Privacy Enhancement for Internet Electronic Mail: - Part I - Message Encryption and Authentication Procedures", RFC - 1421, IAB IRTF PSRG, IETF PEM WG, February 1993. - - [RFC-1154] Robinson, D. and R. Ullmann, "Encoding Header Field for - Internet Messages", RFC 1154, Prime Computer, Inc., April 1990. - - [RFC-1341] Borenstein, N., and N. Freed, "MIME (Multipurpose Internet - Mail Extensions): Mechanisms for Specifying and Describing the Format - of Internet Message Bodies", RFC 1341, Bellcore, Innosoft, June 1992. - - [RFC-1342] Moore, K., "Representation of Non-Ascii Text in Internet - Message Headers", RFC 1342, University of Tennessee, June 1992. - - [RFC-1343] Borenstein, N., "A User Agent Configuration Mechanism - for Multimedia Mail Format Information", RFC 1343, Bellcore, June - 1992. - - [RFC-1344] Borenstein, N., "Implications of MIME for Internet - Mail Gateways", RFC 1344, Bellcore, June 1992. - - [RFC-1345] Simonsen, K., "Character Mnemonics & Character Sets", - RFC 1345, Rationel Almen Planlaegning, June 1992. - - [RFC-1426] Klensin, J., (WG Chair), Freed, N., (Editor), Rose, M., - Stefferud, E., and D. Crocker, "SMTP Service Extension for 8bit-MIME - transport", RFC 1426, United Nations Universit, Innosoft, Dover Beach - Consulting, Inc., Network Management Associates, Inc., The Branch - Office, February 1993. - - [RFC-1522] Moore, K., "Representation of Non-Ascii Text in Internet - Message Headers" RFC 1522, University of Tennessee, September 1993. - - [RFC-1340] Reynolds, J., and J. Postel, "Assigned Numbers", STD 2, RFC - 1340, USC/Information Sciences Institute, July 1992. - - - - -Borenstein & Freed [Page 81] - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc1854.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc1854.txt deleted file mode 100644 index 7b1a975..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc1854.txt +++ /dev/null @@ -1,395 +0,0 @@ - - - - - - -Network Working Group N. Freed -Request For Comments: 1854 Innosoft International, Inc. -Category: Standards Track A. Cargille, WG Chair - October 1995 - - - SMTP Service Extension - for Command Pipelining - -Status of this Memo - - This document specifies an Internet standards track protocol for the - Internet community, and requests discussion and suggestions for - improvements. Please refer to the current edition of the "Internet - Official Protocol Standards" (STD 1) for the standardization state - and status of this protocol. Distribution of this memo is unlimited. - -Abstract - - This memo defines an extension to the SMTP service whereby a server - can indicate the extent of its ability to accept multiple commands in - a single TCP send operation. Using a single TCP send operation for - multiple commands can improve SMTP performance significantly. - -Introduction - - Although SMTP is widely and robustly deployed, certain extensions may - nevertheless prove useful. In particular, many parts of the Internet - make use of high latency network links. - - SMTP's intrinsic one command-one response structure is significantly - penalized by high latency links, often to the point where the factors - contributing to overall connection time are dominated by the time - spent waiting for responses to individual commands (turnaround time). - - In the best of all worlds it would be possible to simply deploy SMTP - client software that makes use of command pipelining: batching up - multiple commands into single TCP send operations. Unfortunately, the - original SMTP specification [1] did not explicitly state that SMTP - servers must support this. As a result a non-trivial number of - Internet SMTP servers cannot adequately handle command pipelining. - Flaws known to exist in deployed servers include: - - (1) Connection handoff and buffer flushes in the middle of - the SMTP dialogue. Creation of server processes for - incoming SMTP connections is a useful, obvious, and - harmless implementation technique. However, some SMTP - servers defer process forking and connection handoff - - - -Freed & Cargille Standards Track [Page 1] - -RFC 1854 SMTP Pipelining October 1995 - - - until some intermediate point in the SMTP dialogue. - When this is done material read from the TCP connection - and kept in process buffers can be lost. - - (2) Flushing the TCP input buffer when an SMTP command - fails. SMTP commands often fail but there is no reason - to flush the TCP input buffer when this happens. - Nevertheless, some SMTP servers do this. - - (3) Improper processing and promulgation of SMTP command - failures. For example, some SMTP servers will refuse to - accept a DATA command if the last RCPT TO command - fails, paying no attention to the success or failure of - prior RCPT TO command results. Other servers will - accept a DATA command even when all previous RCPT TO - commands have failed. Although it is possible to - accommodate this sort of behavior in a client that - employs command pipelining, it does complicate the - construction of the client unnecessarily. - - This memo uses the mechanism described in [2] to define an extension - to the SMTP service whereby an SMTP server can declare that it is - capable of handling pipelined commands. The SMTP client can then - check for this declaration and use pipelining only when the server - declares itself capable of handling it. - -1. Framework for the Command Pipelining Extension - - The Command Pipelining extension is defined as follows: - - (1) the name of the SMTP service extension is Pipelining; - - (2) the EHLO keyword value associated with the extension is - PIPELINING; - - (3) no parameter is used with the PIPELINING EHLO keyword; - - (4) no additional parameters are added to either the MAIL - FROM or RCPT TO commands. - - (5) no additional SMTP verbs are defined by this extension; - and, - - (6) the next section specifies how support for the - extension affects the behavior of a server and client - SMTP. - - - - - -Freed & Cargille Standards Track [Page 2] - -RFC 1854 SMTP Pipelining October 1995 - - -2. The Pipelining Service Extension - - When a client SMTP wishes to employ command pipelining, it first - issues the EHLO command to the server SMTP. If the server SMTP - responds with code 250 to the EHLO command, and the response includes - the EHLO keyword value PIPELINING, then the server SMTP has indicated - that it can accommodate SMTP command pipelining. - -2.1. Client use of pipelining - - Once the client SMTP has confirmed that support exists for the - pipelining extension, the client SMTP may then elect to transmit - groups of SMTP commands in batches without waiting for a response to - each individual command. In particular, the commands RSET, MAIL FROM, - SEND FROM, SOML FROM, SAML FROM, and RCPT TO can all appear anywhere - in a pipelined command group. The EHLO, DATA, VRFY, EXPN, TURN, - QUIT, and NOOP commands can only appear as the last command in a - group since their success or failure produces a change of state which - the client SMTP must accommodate. (NOOP is included in this group so - it can be used as a synchronization point.) - - Additional commands added by other SMTP extensions may only appear as - the last command in a group unless otherwise specified by the - extensions that define the commands. - - The actual transfer of message content is explicitly allowed to be - the first "command" in a group. That is, the RSET/MAIL FROM sequence - necessary to initiate a new message transaction can be placed in the - same group as the final transfer of the headers and body of the - previous message. - - Client SMTP implementations that employ pipelining MUST check ALL - statuses associated with each command in a group. For example, if - none of the RCPT TO recipient addresses were accepted the client must - then check the response to the DATA command -- the client cannot - assume that the DATA command will be rejected just because none of - the RCPT TO commands worked. If the DATA command was properly - rejected the client SMTP can just issue RSET, but if the DATA command - was accepted the client SMTP should send a single dot. - - Command statuses MUST be coordinated with responses by counting each - separate response and correlating that count with the number of - commands known to have been issued. Multiline responses MUST be - supported. Matching on the basis of either the error code value or - associated text is expressly forbidden. - - Client SMTP implementations MAY elect to operate in a nonblocking - fashion, processing server responses immediately upon receipt, even - - - -Freed & Cargille Standards Track [Page 3] - -RFC 1854 SMTP Pipelining October 1995 - - - if there is still data pending transmission from the client's - previous TCP send operation. If nonblocking operation is not - supported, however, client SMTP implementations MUST also check the - TCP window size and make sure that each group of commands fits - entirely within the window. The window size is usually, but not - always, 4K octets. Failure to perform this check can lead to - deadlock conditions. - - Clients MUST NOT confuse responses to multiple commands with - multiline responses. Each command requires one or more lines of - response, the last line not containing a dash between the response - code and the response string. - -2.2. Server support of pipelining - - A server SMTP implementation that offers the pipelining extension: - - (1) MUST NOT flush or otherwise lose the contents of the - TCP input buffer under any circumstances whatsoever. - - (2) SHOULD issue a positive response to the DATA command if - and only if one or more valid RCPT TO addresses have - been previously received. - - (3) MUST NOT, after issuing a positive response to a DATA - command with no valid recipients and subsequently - receiving an empty message, send any message whatsoever - to anybody. - - (4) SHOULD elect to store responses to grouped RSET, MAIL - FROM, SEND FROM, SOML FROM, SAML FROM, and RCPT TO - commands in an internal buffer so they can sent as a - unit. - - (5) MUST NOT buffer responses to EHLO, DATA, VRFY, EXPN, - TURN, QUIT, and NOOP. - - (6) MUST NOT buffer responses to unrecognized commands. - - (7) MUST send all pending responses immediately whenever - the local TCP input buffer is emptied. - - (8) MUST NOT make assumptions about commands that are yet - to be received. - - (9) SHOULD issue response text that indicates, either - implicitly or explicitly, what command the response - matches. - - - -Freed & Cargille Standards Track [Page 4] - -RFC 1854 SMTP Pipelining October 1995 - - - The overriding intent of these server requirements is to make it as - easy as possible for servers to conform to these pipelining - extensions. - -3. Examples - - Consider the following SMTP dialogue that does not use pipelining: - - S: - C: - S: 220 innosoft.com SMTP service ready - C: HELO dbc.mtview.ca.us - S: 250 innosoft.com - C: MAIL FROM: - S: 250 sender OK - C: RCPT TO: - S: 250 recipient OK - C: RCPT TO: - S: 250 recipient OK - C: RCPT TO: - S: 250 recipient OK - C: DATA - S: 354 enter mail, end with line containing only "." - ... - C: . - S: 250 message sent - C: QUIT - S: 221 goodbye - - The client waits for a server response a total of 9 times in this - simple example. But if pipelining is employed the following dialogue - is possible: - - S: - C: - S: 220 innosoft.com SMTP service ready - C: EHLO dbc.mtview.ca.us - S: 250-innosoft.com - S: 250 PIPELINING - C: MAIL FROM: - C: RCPT TO: - C: RCPT TO: - C: RCPT TO: - C: DATA - S: 250 sender OK - S: 250 recipient OK - S: 250 recipient OK - S: 250 recipient OK - - - -Freed & Cargille Standards Track [Page 5] - -RFC 1854 SMTP Pipelining October 1995 - - - S: 354 enter mail, end with line containing only "." - ... - C: . - C: QUIT - S: 250 message sent - S: 221 goodbye - - The total number of turnarounds has been reduced from 9 to 4. - - The next example illustrates one possible form of behavior when - pipelining is used and all recipients are rejected: - - S: - C: - S: 220 innosoft.com SMTP service ready - C: EHLO dbc.mtview.ca.us - S: 250-innosoft.com - S: 250 PIPELINING - C: MAIL FROM: - C: RCPT TO: - C: RCPT TO: - C: DATA - S: 250 sender OK - S: 550 remote mail to not allowed - S: 550 remote mail to not allowed - S: 554 no valid recipients given - C: QUIT - S: 221 goodbye - - The client SMTP waits for the server 4 times here as well. If the - server SMTP does not check for at least one valid recipient prior to - accepting the DATA command, the following dialogue would result: - - S: - C: - S: 220 innosoft.com SMTP service ready - C: EHLO dbc.mtview.ca.us - S: 250-innosoft.com - S: 250 PIPELINING - C: MAIL FROM: - C: RCPT TO: - C: RCPT TO: - C: DATA - S: 250 sender OK - S: 550 remote mail to not allowed - S: 550 remote mail to not allowed - S: 354 enter mail, end with line containing only "." - C: . - - - -Freed & Cargille Standards Track [Page 6] - -RFC 1854 SMTP Pipelining October 1995 - - - C: QUIT - S: 554 no valid recipients - S: 221 goodbye - -4. Security Considerations - - This RFC does not discuss security issues and is not believed to - raise any security issues not endemic in electronic mail and present - in fully conforming implementations of [1]. - -5. Acknowledgements - - This document is based on the SMTP service extension model presented - in RFC 1425. Marshall Rose's description of SMTP command pipelining - in his book "The Internet Message" also served as a source of - inspiration for this extension. - -6. References - - [1] Postel, J., "Simple Mail Transfer Protocol", STD 10 - RFC 821, USC/Information Sciences Institute, August - 1982. - - [2] Klensin, J., Freed, N., Rose, M., Stefferud, E., - and D. Crocker, "SMTP Service Extensions", RFC 1651, - MCI, Innosoft, Dover Beach Consulting, Inc., - Network Management Associates, Inc., Silicon Graphics, - Inc., July 1994. - -7. Author's Address - - Ned Freed - Innosoft International, Inc. - 1050 East Garvey Avenue South - West Covina, CA 91790 - USA - - Phone: +1 818 919 3600 - Fax: +1 818 919 3614 - EMail: ned@innosoft.com - - - - - - - - - - - -Freed & Cargille Standards Track [Page 7] - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2045.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2045.txt deleted file mode 100644 index 9f286b1..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2045.txt +++ /dev/null @@ -1,1739 +0,0 @@ - - - - - - -Network Working Group N. Freed -Request for Comments: 2045 Innosoft -Obsoletes: 1521, 1522, 1590 N. Borenstein -Category: Standards Track First Virtual - November 1996 - - - Multipurpose Internet Mail Extensions - (MIME) Part One: - Format of Internet Message Bodies - -Status of this Memo - - This document specifies an Internet standards track protocol for the - Internet community, and requests discussion and suggestions for - improvements. Please refer to the current edition of the "Internet - Official Protocol Standards" (STD 1) for the standardization state - and status of this protocol. Distribution of this memo is unlimited. - -Abstract - - STD 11, RFC 822, defines a message representation protocol specifying - considerable detail about US-ASCII message headers, and leaves the - message content, or message body, as flat US-ASCII text. This set of - documents, collectively called the Multipurpose Internet Mail - Extensions, or MIME, redefines the format of messages to allow for - - (1) textual message bodies in character sets other than - US-ASCII, - - (2) an extensible set of different formats for non-textual - message bodies, - - (3) multi-part message bodies, and - - (4) textual header information in character sets other than - US-ASCII. - - These documents are based on earlier work documented in RFC 934, STD - 11, and RFC 1049, but extends and revises them. Because RFC 822 said - so little about message bodies, these documents are largely - orthogonal to (rather than a revision of) RFC 822. - - This initial document specifies the various headers used to describe - the structure of MIME messages. The second document, RFC 2046, - defines the general structure of the MIME media typing system and - defines an initial set of media types. The third document, RFC 2047, - describes extensions to RFC 822 to allow non-US-ASCII text data in - - - -Freed & Borenstein Standards Track [Page 1] - -RFC 2045 Internet Message Bodies November 1996 - - - Internet mail header fields. The fourth document, RFC 2048, specifies - various IANA registration procedures for MIME-related facilities. The - fifth and final document, RFC 2049, describes MIME conformance - criteria as well as providing some illustrative examples of MIME - message formats, acknowledgements, and the bibliography. - - These documents are revisions of RFCs 1521, 1522, and 1590, which - themselves were revisions of RFCs 1341 and 1342. An appendix in RFC - 2049 describes differences and changes from previous versions. - -Table of Contents - - 1. Introduction ......................................... 3 - 2. Definitions, Conventions, and Generic BNF Grammar .... 5 - 2.1 CRLF ................................................ 5 - 2.2 Character Set ....................................... 6 - 2.3 Message ............................................. 6 - 2.4 Entity .............................................. 6 - 2.5 Body Part ........................................... 7 - 2.6 Body ................................................ 7 - 2.7 7bit Data ........................................... 7 - 2.8 8bit Data ........................................... 7 - 2.9 Binary Data ......................................... 7 - 2.10 Lines .............................................. 7 - 3. MIME Header Fields ................................... 8 - 4. MIME-Version Header Field ............................ 8 - 5. Content-Type Header Field ............................ 10 - 5.1 Syntax of the Content-Type Header Field ............. 12 - 5.2 Content-Type Defaults ............................... 14 - 6. Content-Transfer-Encoding Header Field ............... 14 - 6.1 Content-Transfer-Encoding Syntax .................... 14 - 6.2 Content-Transfer-Encodings Semantics ................ 15 - 6.3 New Content-Transfer-Encodings ...................... 16 - 6.4 Interpretation and Use .............................. 16 - 6.5 Translating Encodings ............................... 18 - 6.6 Canonical Encoding Model ............................ 19 - 6.7 Quoted-Printable Content-Transfer-Encoding .......... 19 - 6.8 Base64 Content-Transfer-Encoding .................... 24 - 7. Content-ID Header Field .............................. 26 - 8. Content-Description Header Field ..................... 27 - 9. Additional MIME Header Fields ........................ 27 - 10. Summary ............................................. 27 - 11. Security Considerations ............................. 27 - 12. Authors' Addresses .................................. 28 - A. Collected Grammar .................................... 29 - - - - - - -Freed & Borenstein Standards Track [Page 2] - -RFC 2045 Internet Message Bodies November 1996 - - -1. Introduction - - Since its publication in 1982, RFC 822 has defined the standard - format of textual mail messages on the Internet. Its success has - been such that the RFC 822 format has been adopted, wholly or - partially, well beyond the confines of the Internet and the Internet - SMTP transport defined by RFC 821. As the format has seen wider use, - a number of limitations have proven increasingly restrictive for the - user community. - - RFC 822 was intended to specify a format for text messages. As such, - non-text messages, such as multimedia messages that might include - audio or images, are simply not mentioned. Even in the case of text, - however, RFC 822 is inadequate for the needs of mail users whose - languages require the use of character sets richer than US-ASCII. - Since RFC 822 does not specify mechanisms for mail containing audio, - video, Asian language text, or even text in most European languages, - additional specifications are needed. - - One of the notable limitations of RFC 821/822 based mail systems is - the fact that they limit the contents of electronic mail messages to - relatively short lines (e.g. 1000 characters or less [RFC-821]) of - 7bit US-ASCII. This forces users to convert any non-textual data - that they may wish to send into seven-bit bytes representable as - printable US-ASCII characters before invoking a local mail UA (User - Agent, a program with which human users send and receive mail). - Examples of such encodings currently used in the Internet include - pure hexadecimal, uuencode, the 3-in-4 base 64 scheme specified in - RFC 1421, the Andrew Toolkit Representation [ATK], and many others. - - The limitations of RFC 822 mail become even more apparent as gateways - are designed to allow for the exchange of mail messages between RFC - 822 hosts and X.400 hosts. X.400 [X400] specifies mechanisms for the - inclusion of non-textual material within electronic mail messages. - The current standards for the mapping of X.400 messages to RFC 822 - messages specify either that X.400 non-textual material must be - converted to (not encoded in) IA5Text format, or that they must be - discarded, notifying the RFC 822 user that discarding has occurred. - This is clearly undesirable, as information that a user may wish to - receive is lost. Even though a user agent may not have the - capability of dealing with the non-textual material, the user might - have some mechanism external to the UA that can extract useful - information from the material. Moreover, it does not allow for the - fact that the message may eventually be gatewayed back into an X.400 - message handling system (i.e., the X.400 message is "tunneled" - through Internet mail), where the non-textual information would - definitely become useful again. - - - - -Freed & Borenstein Standards Track [Page 3] - -RFC 2045 Internet Message Bodies November 1996 - - - This document describes several mechanisms that combine to solve most - of these problems without introducing any serious incompatibilities - with the existing world of RFC 822 mail. In particular, it - describes: - - (1) A MIME-Version header field, which uses a version - number to declare a message to be conformant with MIME - and allows mail processing agents to distinguish - between such messages and those generated by older or - non-conformant software, which are presumed to lack - such a field. - - (2) A Content-Type header field, generalized from RFC 1049, - which can be used to specify the media type and subtype - of data in the body of a message and to fully specify - the native representation (canonical form) of such - data. - - (3) A Content-Transfer-Encoding header field, which can be - used to specify both the encoding transformation that - was applied to the body and the domain of the result. - Encoding transformations other than the identity - transformation are usually applied to data in order to - allow it to pass through mail transport mechanisms - which may have data or character set limitations. - - (4) Two additional header fields that can be used to - further describe the data in a body, the Content-ID and - Content-Description header fields. - - All of the header fields defined in this document are subject to the - general syntactic rules for header fields specified in RFC 822. In - particular, all of these header fields except for Content-Disposition - can include RFC 822 comments, which have no semantic content and - should be ignored during MIME processing. - - Finally, to specify and promote interoperability, RFC 2049 provides a - basic applicability statement for a subset of the above mechanisms - that defines a minimal level of "conformance" with this document. - - HISTORICAL NOTE: Several of the mechanisms described in this set of - documents may seem somewhat strange or even baroque at first reading. - It is important to note that compatibility with existing standards - AND robustness across existing practice were two of the highest - priorities of the working group that developed this set of documents. - In particular, compatibility was always favored over elegance. - - - - - -Freed & Borenstein Standards Track [Page 4] - -RFC 2045 Internet Message Bodies November 1996 - - - Please refer to the current edition of the "Internet Official - Protocol Standards" for the standardization state and status of this - protocol. RFC 822 and STD 3, RFC 1123 also provide essential - background for MIME since no conforming implementation of MIME can - violate them. In addition, several other informational RFC documents - will be of interest to the MIME implementor, in particular RFC 1344, - RFC 1345, and RFC 1524. - -2. Definitions, Conventions, and Generic BNF Grammar - - Although the mechanisms specified in this set of documents are all - described in prose, most are also described formally in the augmented - BNF notation of RFC 822. Implementors will need to be familiar with - this notation in order to understand this set of documents, and are - referred to RFC 822 for a complete explanation of the augmented BNF - notation. - - Some of the augmented BNF in this set of documents makes named - references to syntax rules defined in RFC 822. A complete formal - grammar, then, is obtained by combining the collected grammar - appendices in each document in this set with the BNF of RFC 822 plus - the modifications to RFC 822 defined in RFC 1123 (which specifically - changes the syntax for `return', `date' and `mailbox'). - - All numeric and octet values are given in decimal notation in this - set of documents. All media type values, subtype values, and - parameter names as defined are case-insensitive. However, parameter - values are case-sensitive unless otherwise specified for the specific - parameter. - - FORMATTING NOTE: Notes, such at this one, provide additional - nonessential information which may be skipped by the reader without - missing anything essential. The primary purpose of these non- - essential notes is to convey information about the rationale of this - set of documents, or to place these documents in the proper - historical or evolutionary context. Such information may in - particular be skipped by those who are focused entirely on building a - conformant implementation, but may be of use to those who wish to - understand why certain design choices were made. - -2.1. CRLF - - The term CRLF, in this set of documents, refers to the sequence of - octets corresponding to the two US-ASCII characters CR (decimal value - 13) and LF (decimal value 10) which, taken together, in this order, - denote a line break in RFC 822 mail. - - - - - -Freed & Borenstein Standards Track [Page 5] - -RFC 2045 Internet Message Bodies November 1996 - - -2.2. Character Set - - The term "character set" is used in MIME to refer to a method of - converting a sequence of octets into a sequence of characters. Note - that unconditional and unambiguous conversion in the other direction - is not required, in that not all characters may be representable by a - given character set and a character set may provide more than one - sequence of octets to represent a particular sequence of characters. - - This definition is intended to allow various kinds of character - encodings, from simple single-table mappings such as US-ASCII to - complex table switching methods such as those that use ISO 2022's - techniques, to be used as character sets. However, the definition - associated with a MIME character set name must fully specify the - mapping to be performed. In particular, use of external profiling - information to determine the exact mapping is not permitted. - - NOTE: The term "character set" was originally to describe such - straightforward schemes as US-ASCII and ISO-8859-1 which have a - simple one-to-one mapping from single octets to single characters. - Multi-octet coded character sets and switching techniques make the - situation more complex. For example, some communities use the term - "character encoding" for what MIME calls a "character set", while - using the phrase "coded character set" to denote an abstract mapping - from integers (not octets) to characters. - -2.3. Message - - The term "message", when not further qualified, means either a - (complete or "top-level") RFC 822 message being transferred on a - network, or a message encapsulated in a body of type "message/rfc822" - or "message/partial". - -2.4. Entity - - The term "entity", refers specifically to the MIME-defined header - fields and contents of either a message or one of the parts in the - body of a multipart entity. The specification of such entities is - the essence of MIME. Since the contents of an entity are often - called the "body", it makes sense to speak about the body of an - entity. Any sort of field may be present in the header of an entity, - but only those fields whose names begin with "content-" actually have - any MIME-related meaning. Note that this does NOT imply thay they - have no meaning at all -- an entity that is also a message has non- - MIME header fields whose meanings are defined by RFC 822. - - - - - - -Freed & Borenstein Standards Track [Page 6] - -RFC 2045 Internet Message Bodies November 1996 - - -2.5. Body Part - - The term "body part" refers to an entity inside of a multipart - entity. - -2.6. Body - - The term "body", when not further qualified, means the body of an - entity, that is, the body of either a message or of a body part. - - NOTE: The previous four definitions are clearly circular. This is - unavoidable, since the overall structure of a MIME message is indeed - recursive. - -2.7. 7bit Data - - "7bit data" refers to data that is all represented as relatively - short lines with 998 octets or less between CRLF line separation - sequences [RFC-821]. No octets with decimal values greater than 127 - are allowed and neither are NULs (octets with decimal value 0). CR - (decimal value 13) and LF (decimal value 10) octets only occur as - part of CRLF line separation sequences. - -2.8. 8bit Data - - "8bit data" refers to data that is all represented as relatively - short lines with 998 octets or less between CRLF line separation - sequences [RFC-821]), but octets with decimal values greater than 127 - may be used. As with "7bit data" CR and LF octets only occur as part - of CRLF line separation sequences and no NULs are allowed. - -2.9. Binary Data - - "Binary data" refers to data where any sequence of octets whatsoever - is allowed. - -2.10. Lines - - "Lines" are defined as sequences of octets separated by a CRLF - sequences. This is consistent with both RFC 821 and RFC 822. - "Lines" only refers to a unit of data in a message, which may or may - not correspond to something that is actually displayed by a user - agent. - - - - - - - - -Freed & Borenstein Standards Track [Page 7] - -RFC 2045 Internet Message Bodies November 1996 - - -3. MIME Header Fields - - MIME defines a number of new RFC 822 header fields that are used to - describe the content of a MIME entity. These header fields occur in - at least two contexts: - - (1) As part of a regular RFC 822 message header. - - (2) In a MIME body part header within a multipart - construct. - - The formal definition of these header fields is as follows: - - entity-headers := [ content CRLF ] - [ encoding CRLF ] - [ id CRLF ] - [ description CRLF ] - *( MIME-extension-field CRLF ) - - MIME-message-headers := entity-headers - fields - version CRLF - ; The ordering of the header - ; fields implied by this BNF - ; definition should be ignored. - - MIME-part-headers := entity-headers - [ fields ] - ; Any field not beginning with - ; "content-" can have no defined - ; meaning and may be ignored. - ; The ordering of the header - ; fields implied by this BNF - ; definition should be ignored. - - The syntax of the various specific MIME header fields will be - described in the following sections. - -4. MIME-Version Header Field - - Since RFC 822 was published in 1982, there has really been only one - format standard for Internet messages, and there has been little - perceived need to declare the format standard in use. This document - is an independent specification that complements RFC 822. Although - the extensions in this document have been defined in such a way as to - be compatible with RFC 822, there are still circumstances in which it - might be desirable for a mail-processing agent to know whether a - message was composed with the new standard in mind. - - - -Freed & Borenstein Standards Track [Page 8] - -RFC 2045 Internet Message Bodies November 1996 - - - Therefore, this document defines a new header field, "MIME-Version", - which is to be used to declare the version of the Internet message - body format standard in use. - - Messages composed in accordance with this document MUST include such - a header field, with the following verbatim text: - - MIME-Version: 1.0 - - The presence of this header field is an assertion that the message - has been composed in compliance with this document. - - Since it is possible that a future document might extend the message - format standard again, a formal BNF is given for the content of the - MIME-Version field: - - version := "MIME-Version" ":" 1*DIGIT "." 1*DIGIT - - Thus, future format specifiers, which might replace or extend "1.0", - are constrained to be two integer fields, separated by a period. If - a message is received with a MIME-version value other than "1.0", it - cannot be assumed to conform with this document. - - Note that the MIME-Version header field is required at the top level - of a message. It is not required for each body part of a multipart - entity. It is required for the embedded headers of a body of type - "message/rfc822" or "message/partial" if and only if the embedded - message is itself claimed to be MIME-conformant. - - It is not possible to fully specify how a mail reader that conforms - with MIME as defined in this document should treat a message that - might arrive in the future with some value of MIME-Version other than - "1.0". - - It is also worth noting that version control for specific media types - is not accomplished using the MIME-Version mechanism. In particular, - some formats (such as application/postscript) have version numbering - conventions that are internal to the media format. Where such - conventions exist, MIME does nothing to supersede them. Where no - such conventions exist, a MIME media type might use a "version" - parameter in the content-type field if necessary. - - - - - - - - - - -Freed & Borenstein Standards Track [Page 9] - -RFC 2045 Internet Message Bodies November 1996 - - - NOTE TO IMPLEMENTORS: When checking MIME-Version values any RFC 822 - comment strings that are present must be ignored. In particular, the - following four MIME-Version fields are equivalent: - - MIME-Version: 1.0 - - MIME-Version: 1.0 (produced by MetaSend Vx.x) - - MIME-Version: (produced by MetaSend Vx.x) 1.0 - - MIME-Version: 1.(produced by MetaSend Vx.x)0 - - In the absence of a MIME-Version field, a receiving mail user agent - (whether conforming to MIME requirements or not) may optionally - choose to interpret the body of the message according to local - conventions. Many such conventions are currently in use and it - should be noted that in practice non-MIME messages can contain just - about anything. - - It is impossible to be certain that a non-MIME mail message is - actually plain text in the US-ASCII character set since it might well - be a message that, using some set of nonstandard local conventions - that predate MIME, includes text in another character set or non- - textual data presented in a manner that cannot be automatically - recognized (e.g., a uuencoded compressed UNIX tar file). - -5. Content-Type Header Field - - The purpose of the Content-Type field is to describe the data - contained in the body fully enough that the receiving user agent can - pick an appropriate agent or mechanism to present the data to the - user, or otherwise deal with the data in an appropriate manner. The - value in this field is called a media type. - - HISTORICAL NOTE: The Content-Type header field was first defined in - RFC 1049. RFC 1049 used a simpler and less powerful syntax, but one - that is largely compatible with the mechanism given here. - - The Content-Type header field specifies the nature of the data in the - body of an entity by giving media type and subtype identifiers, and - by providing auxiliary information that may be required for certain - media types. After the media type and subtype names, the remainder - of the header field is simply a set of parameters, specified in an - attribute=value notation. The ordering of parameters is not - significant. - - - - - - -Freed & Borenstein Standards Track [Page 10] - -RFC 2045 Internet Message Bodies November 1996 - - - In general, the top-level media type is used to declare the general - type of data, while the subtype specifies a specific format for that - type of data. Thus, a media type of "image/xyz" is enough to tell a - user agent that the data is an image, even if the user agent has no - knowledge of the specific image format "xyz". Such information can - be used, for example, to decide whether or not to show a user the raw - data from an unrecognized subtype -- such an action might be - reasonable for unrecognized subtypes of text, but not for - unrecognized subtypes of image or audio. For this reason, registered - subtypes of text, image, audio, and video should not contain embedded - information that is really of a different type. Such compound - formats should be represented using the "multipart" or "application" - types. - - Parameters are modifiers of the media subtype, and as such do not - fundamentally affect the nature of the content. The set of - meaningful parameters depends on the media type and subtype. Most - parameters are associated with a single specific subtype. However, a - given top-level media type may define parameters which are applicable - to any subtype of that type. Parameters may be required by their - defining content type or subtype or they may be optional. MIME - implementations must ignore any parameters whose names they do not - recognize. - - For example, the "charset" parameter is applicable to any subtype of - "text", while the "boundary" parameter is required for any subtype of - the "multipart" media type. - - There are NO globally-meaningful parameters that apply to all media - types. Truly global mechanisms are best addressed, in the MIME - model, by the definition of additional Content-* header fields. - - An initial set of seven top-level media types is defined in RFC 2046. - Five of these are discrete types whose content is essentially opaque - as far as MIME processing is concerned. The remaining two are - composite types whose contents require additional handling by MIME - processors. - - This set of top-level media types is intended to be substantially - complete. It is expected that additions to the larger set of - supported types can generally be accomplished by the creation of new - subtypes of these initial types. In the future, more top-level types - may be defined only by a standards-track extension to this standard. - If another top-level type is to be used for any reason, it must be - given a name starting with "X-" to indicate its non-standard status - and to avoid a potential conflict with a future official name. - - - - - -Freed & Borenstein Standards Track [Page 11] - -RFC 2045 Internet Message Bodies November 1996 - - -5.1. Syntax of the Content-Type Header Field - - In the Augmented BNF notation of RFC 822, a Content-Type header field - value is defined as follows: - - content := "Content-Type" ":" type "/" subtype - *(";" parameter) - ; Matching of media type and subtype - ; is ALWAYS case-insensitive. - - type := discrete-type / composite-type - - discrete-type := "text" / "image" / "audio" / "video" / - "application" / extension-token - - composite-type := "message" / "multipart" / extension-token - - extension-token := ietf-token / x-token - - ietf-token := - - x-token := - - subtype := extension-token / iana-token - - iana-token := - - parameter := attribute "=" value - - attribute := token - ; Matching of attributes - ; is ALWAYS case-insensitive. - - value := token / quoted-string - - token := 1* - - tspecials := "(" / ")" / "<" / ">" / "@" / - "," / ";" / ":" / "\" / <"> - "/" / "[" / "]" / "?" / "=" - ; Must be in quoted-string, - ; to use within parameter values - - - -Freed & Borenstein Standards Track [Page 12] - -RFC 2045 Internet Message Bodies November 1996 - - - Note that the definition of "tspecials" is the same as the RFC 822 - definition of "specials" with the addition of the three characters - "/", "?", and "=", and the removal of ".". - - Note also that a subtype specification is MANDATORY -- it may not be - omitted from a Content-Type header field. As such, there are no - default subtypes. - - The type, subtype, and parameter names are not case sensitive. For - example, TEXT, Text, and TeXt are all equivalent top-level media - types. Parameter values are normally case sensitive, but sometimes - are interpreted in a case-insensitive fashion, depending on the - intended use. (For example, multipart boundaries are case-sensitive, - but the "access-type" parameter for message/External-body is not - case-sensitive.) - - Note that the value of a quoted string parameter does not include the - quotes. That is, the quotation marks in a quoted-string are not a - part of the value of the parameter, but are merely used to delimit - that parameter value. In addition, comments are allowed in - accordance with RFC 822 rules for structured header fields. Thus the - following two forms - - Content-type: text/plain; charset=us-ascii (Plain text) - - Content-type: text/plain; charset="us-ascii" - - are completely equivalent. - - Beyond this syntax, the only syntactic constraint on the definition - of subtype names is the desire that their uses must not conflict. - That is, it would be undesirable to have two different communities - using "Content-Type: application/foobar" to mean two different - things. The process of defining new media subtypes, then, is not - intended to be a mechanism for imposing restrictions, but simply a - mechanism for publicizing their definition and usage. There are, - therefore, two acceptable mechanisms for defining new media subtypes: - - (1) Private values (starting with "X-") may be defined - bilaterally between two cooperating agents without - outside registration or standardization. Such values - cannot be registered or standardized. - - (2) New standard values should be registered with IANA as - described in RFC 2048. - - The second document in this set, RFC 2046, defines the initial set of - media types for MIME. - - - -Freed & Borenstein Standards Track [Page 13] - -RFC 2045 Internet Message Bodies November 1996 - - -5.2. Content-Type Defaults - - Default RFC 822 messages without a MIME Content-Type header are taken - by this protocol to be plain text in the US-ASCII character set, - which can be explicitly specified as: - - Content-type: text/plain; charset=us-ascii - - This default is assumed if no Content-Type header field is specified. - It is also recommend that this default be assumed when a - syntactically invalid Content-Type header field is encountered. In - the presence of a MIME-Version header field and the absence of any - Content-Type header field, a receiving User Agent can also assume - that plain US-ASCII text was the sender's intent. Plain US-ASCII - text may still be assumed in the absence of a MIME-Version or the - presence of an syntactically invalid Content-Type header field, but - the sender's intent might have been otherwise. - -6. Content-Transfer-Encoding Header Field - - Many media types which could be usefully transported via email are - represented, in their "natural" format, as 8bit character or binary - data. Such data cannot be transmitted over some transfer protocols. - For example, RFC 821 (SMTP) restricts mail messages to 7bit US-ASCII - data with lines no longer than 1000 characters including any trailing - CRLF line separator. - - It is necessary, therefore, to define a standard mechanism for - encoding such data into a 7bit short line format. Proper labelling - of unencoded material in less restrictive formats for direct use over - less restrictive transports is also desireable. This document - specifies that such encodings will be indicated by a new "Content- - Transfer-Encoding" header field. This field has not been defined by - any previous standard. - -6.1. Content-Transfer-Encoding Syntax - - The Content-Transfer-Encoding field's value is a single token - specifying the type of encoding, as enumerated below. Formally: - - encoding := "Content-Transfer-Encoding" ":" mechanism - - mechanism := "7bit" / "8bit" / "binary" / - "quoted-printable" / "base64" / - ietf-token / x-token - - These values are not case sensitive -- Base64 and BASE64 and bAsE64 - are all equivalent. An encoding type of 7BIT requires that the body - - - -Freed & Borenstein Standards Track [Page 14] - -RFC 2045 Internet Message Bodies November 1996 - - - is already in a 7bit mail-ready representation. This is the default - value -- that is, "Content-Transfer-Encoding: 7BIT" is assumed if the - Content-Transfer-Encoding header field is not present. - -6.2. Content-Transfer-Encodings Semantics - - This single Content-Transfer-Encoding token actually provides two - pieces of information. It specifies what sort of encoding - transformation the body was subjected to and hence what decoding - operation must be used to restore it to its original form, and it - specifies what the domain of the result is. - - The transformation part of any Content-Transfer-Encodings specifies, - either explicitly or implicitly, a single, well-defined decoding - algorithm, which for any sequence of encoded octets either transforms - it to the original sequence of octets which was encoded, or shows - that it is illegal as an encoded sequence. Content-Transfer- - Encodings transformations never depend on any additional external - profile information for proper operation. Note that while decoders - must produce a single, well-defined output for a valid encoding no - such restrictions exist for encoders: Encoding a given sequence of - octets to different, equivalent encoded sequences is perfectly legal. - - Three transformations are currently defined: identity, the "quoted- - printable" encoding, and the "base64" encoding. The domains are - "binary", "8bit" and "7bit". - - The Content-Transfer-Encoding values "7bit", "8bit", and "binary" all - mean that the identity (i.e. NO) encoding transformation has been - performed. As such, they serve simply as indicators of the domain of - the body data, and provide useful information about the sort of - encoding that might be needed for transmission in a given transport - system. The terms "7bit data", "8bit data", and "binary data" are - all defined in Section 2. - - The quoted-printable and base64 encodings transform their input from - an arbitrary domain into material in the "7bit" range, thus making it - safe to carry over restricted transports. The specific definition of - the transformations are given below. - - The proper Content-Transfer-Encoding label must always be used. - Labelling unencoded data containing 8bit characters as "7bit" is not - allowed, nor is labelling unencoded non-line-oriented data as - anything other than "binary" allowed. - - Unlike media subtypes, a proliferation of Content-Transfer-Encoding - values is both undesirable and unnecessary. However, establishing - only a single transformation into the "7bit" domain does not seem - - - -Freed & Borenstein Standards Track [Page 15] - -RFC 2045 Internet Message Bodies November 1996 - - - possible. There is a tradeoff between the desire for a compact and - efficient encoding of largely- binary data and the desire for a - somewhat readable encoding of data that is mostly, but not entirely, - 7bit. For this reason, at least two encoding mechanisms are - necessary: a more or less readable encoding (quoted-printable) and a - "dense" or "uniform" encoding (base64). - - Mail transport for unencoded 8bit data is defined in RFC 1652. As of - the initial publication of this document, there are no standardized - Internet mail transports for which it is legitimate to include - unencoded binary data in mail bodies. Thus there are no - circumstances in which the "binary" Content-Transfer-Encoding is - actually valid in Internet mail. However, in the event that binary - mail transport becomes a reality in Internet mail, or when MIME is - used in conjunction with any other binary-capable mail transport - mechanism, binary bodies must be labelled as such using this - mechanism. - - NOTE: The five values defined for the Content-Transfer-Encoding field - imply nothing about the media type other than the algorithm by which - it was encoded or the transport system requirements if unencoded. - -6.3. New Content-Transfer-Encodings - - Implementors may, if necessary, define private Content-Transfer- - Encoding values, but must use an x-token, which is a name prefixed by - "X-", to indicate its non-standard status, e.g., "Content-Transfer- - Encoding: x-my-new-encoding". Additional standardized Content- - Transfer-Encoding values must be specified by a standards-track RFC. - The requirements such specifications must meet are given in RFC 2048. - As such, all content-transfer-encoding namespace except that - beginning with "X-" is explicitly reserved to the IETF for future - use. - - Unlike media types and subtypes, the creation of new Content- - Transfer-Encoding values is STRONGLY discouraged, as it seems likely - to hinder interoperability with little potential benefit - -6.4. Interpretation and Use - - If a Content-Transfer-Encoding header field appears as part of a - message header, it applies to the entire body of that message. If a - Content-Transfer-Encoding header field appears as part of an entity's - headers, it applies only to the body of that entity. If an entity is - of type "multipart" the Content-Transfer-Encoding is not permitted to - have any value other than "7bit", "8bit" or "binary". Even more - severe restrictions apply to some subtypes of the "message" type. - - - - -Freed & Borenstein Standards Track [Page 16] - -RFC 2045 Internet Message Bodies November 1996 - - - It should be noted that most media types are defined in terms of - octets rather than bits, so that the mechanisms described here are - mechanisms for encoding arbitrary octet streams, not bit streams. If - a bit stream is to be encoded via one of these mechanisms, it must - first be converted to an 8bit byte stream using the network standard - bit order ("big-endian"), in which the earlier bits in a stream - become the higher-order bits in a 8bit byte. A bit stream not ending - at an 8bit boundary must be padded with zeroes. RFC 2046 provides a - mechanism for noting the addition of such padding in the case of the - application/octet-stream media type, which has a "padding" parameter. - - The encoding mechanisms defined here explicitly encode all data in - US-ASCII. Thus, for example, suppose an entity has header fields - such as: - - Content-Type: text/plain; charset=ISO-8859-1 - Content-transfer-encoding: base64 - - This must be interpreted to mean that the body is a base64 US-ASCII - encoding of data that was originally in ISO-8859-1, and will be in - that character set again after decoding. - - Certain Content-Transfer-Encoding values may only be used on certain - media types. In particular, it is EXPRESSLY FORBIDDEN to use any - encodings other than "7bit", "8bit", or "binary" with any composite - media type, i.e. one that recursively includes other Content-Type - fields. Currently the only composite media types are "multipart" and - "message". All encodings that are desired for bodies of type - multipart or message must be done at the innermost level, by encoding - the actual body that needs to be encoded. - - It should also be noted that, by definition, if a composite entity - has a transfer-encoding value such as "7bit", but one of the enclosed - entities has a less restrictive value such as "8bit", then either the - outer "7bit" labelling is in error, because 8bit data are included, - or the inner "8bit" labelling placed an unnecessarily high demand on - the transport system because the actual included data were actually - 7bit-safe. - - NOTE ON ENCODING RESTRICTIONS: Though the prohibition against using - content-transfer-encodings on composite body data may seem overly - restrictive, it is necessary to prevent nested encodings, in which - data are passed through an encoding algorithm multiple times, and - must be decoded multiple times in order to be properly viewed. - Nested encodings add considerable complexity to user agents: Aside - from the obvious efficiency problems with such multiple encodings, - they can obscure the basic structure of a message. In particular, - they can imply that several decoding operations are necessary simply - - - -Freed & Borenstein Standards Track [Page 17] - -RFC 2045 Internet Message Bodies November 1996 - - - to find out what types of bodies a message contains. Banning nested - encodings may complicate the job of certain mail gateways, but this - seems less of a problem than the effect of nested encodings on user - agents. - - Any entity with an unrecognized Content-Transfer-Encoding must be - treated as if it has a Content-Type of "application/octet-stream", - regardless of what the Content-Type header field actually says. - - NOTE ON THE RELATIONSHIP BETWEEN CONTENT-TYPE AND CONTENT-TRANSFER- - ENCODING: It may seem that the Content-Transfer-Encoding could be - inferred from the characteristics of the media that is to be encoded, - or, at the very least, that certain Content-Transfer-Encodings could - be mandated for use with specific media types. There are several - reasons why this is not the case. First, given the varying types of - transports used for mail, some encodings may be appropriate for some - combinations of media types and transports but not for others. (For - example, in an 8bit transport, no encoding would be required for text - in certain character sets, while such encodings are clearly required - for 7bit SMTP.) - - Second, certain media types may require different types of transfer - encoding under different circumstances. For example, many PostScript - bodies might consist entirely of short lines of 7bit data and hence - require no encoding at all. Other PostScript bodies (especially - those using Level 2 PostScript's binary encoding mechanism) may only - be reasonably represented using a binary transport encoding. - Finally, since the Content-Type field is intended to be an open-ended - specification mechanism, strict specification of an association - between media types and encodings effectively couples the - specification of an application protocol with a specific lower-level - transport. This is not desirable since the developers of a media - type should not have to be aware of all the transports in use and - what their limitations are. - -6.5. Translating Encodings - - The quoted-printable and base64 encodings are designed so that - conversion between them is possible. The only issue that arises in - such a conversion is the handling of hard line breaks in quoted- - printable encoding output. When converting from quoted-printable to - base64 a hard line break in the quoted-printable form represents a - CRLF sequence in the canonical form of the data. It must therefore be - converted to a corresponding encoded CRLF in the base64 form of the - data. Similarly, a CRLF sequence in the canonical form of the data - obtained after base64 decoding must be converted to a quoted- - printable hard line break, but ONLY when converting text data. - - - - -Freed & Borenstein Standards Track [Page 18] - -RFC 2045 Internet Message Bodies November 1996 - - -6.6. Canonical Encoding Model - - There was some confusion, in the previous versions of this RFC, - regarding the model for when email data was to be converted to - canonical form and encoded, and in particular how this process would - affect the treatment of CRLFs, given that the representation of - newlines varies greatly from system to system, and the relationship - between content-transfer-encodings and character sets. A canonical - model for encoding is presented in RFC 2049 for this reason. - -6.7. Quoted-Printable Content-Transfer-Encoding - - The Quoted-Printable encoding is intended to represent data that - largely consists of octets that correspond to printable characters in - the US-ASCII character set. It encodes the data in such a way that - the resulting octets are unlikely to be modified by mail transport. - If the data being encoded are mostly US-ASCII text, the encoded form - of the data remains largely recognizable by humans. A body which is - entirely US-ASCII may also be encoded in Quoted-Printable to ensure - the integrity of the data should the message pass through a - character-translating, and/or line-wrapping gateway. - - In this encoding, octets are to be represented as determined by the - following rules: - - (1) (General 8bit representation) Any octet, except a CR or - LF that is part of a CRLF line break of the canonical - (standard) form of the data being encoded, may be - represented by an "=" followed by a two digit - hexadecimal representation of the octet's value. The - digits of the hexadecimal alphabet, for this purpose, - are "0123456789ABCDEF". Uppercase letters must be - used; lowercase letters are not allowed. Thus, for - example, the decimal value 12 (US-ASCII form feed) can - be represented by "=0C", and the decimal value 61 (US- - ASCII EQUAL SIGN) can be represented by "=3D". This - rule must be followed except when the following rules - allow an alternative encoding. - - (2) (Literal representation) Octets with decimal values of - 33 through 60 inclusive, and 62 through 126, inclusive, - MAY be represented as the US-ASCII characters which - correspond to those octets (EXCLAMATION POINT through - LESS THAN, and GREATER THAN through TILDE, - respectively). - - (3) (White Space) Octets with values of 9 and 32 MAY be - represented as US-ASCII TAB (HT) and SPACE characters, - - - -Freed & Borenstein Standards Track [Page 19] - -RFC 2045 Internet Message Bodies November 1996 - - - respectively, but MUST NOT be so represented at the end - of an encoded line. Any TAB (HT) or SPACE characters - on an encoded line MUST thus be followed on that line - by a printable character. In particular, an "=" at the - end of an encoded line, indicating a soft line break - (see rule #5) may follow one or more TAB (HT) or SPACE - characters. It follows that an octet with decimal - value 9 or 32 appearing at the end of an encoded line - must be represented according to Rule #1. This rule is - necessary because some MTAs (Message Transport Agents, - programs which transport messages from one user to - another, or perform a portion of such transfers) are - known to pad lines of text with SPACEs, and others are - known to remove "white space" characters from the end - of a line. Therefore, when decoding a Quoted-Printable - body, any trailing white space on a line must be - deleted, as it will necessarily have been added by - intermediate transport agents. - - (4) (Line Breaks) A line break in a text body, represented - as a CRLF sequence in the text canonical form, must be - represented by a (RFC 822) line break, which is also a - CRLF sequence, in the Quoted-Printable encoding. Since - the canonical representation of media types other than - text do not generally include the representation of - line breaks as CRLF sequences, no hard line breaks - (i.e. line breaks that are intended to be meaningful - and to be displayed to the user) can occur in the - quoted-printable encoding of such types. Sequences - like "=0D", "=0A", "=0A=0D" and "=0D=0A" will routinely - appear in non-text data represented in quoted- - printable, of course. - - Note that many implementations may elect to encode the - local representation of various content types directly - rather than converting to canonical form first, - encoding, and then converting back to local - representation. In particular, this may apply to plain - text material on systems that use newline conventions - other than a CRLF terminator sequence. Such an - implementation optimization is permissible, but only - when the combined canonicalization-encoding step is - equivalent to performing the three steps separately. - - (5) (Soft Line Breaks) The Quoted-Printable encoding - REQUIRES that encoded lines be no more than 76 - characters long. If longer lines are to be encoded - with the Quoted-Printable encoding, "soft" line breaks - - - -Freed & Borenstein Standards Track [Page 20] - -RFC 2045 Internet Message Bodies November 1996 - - - must be used. An equal sign as the last character on a - encoded line indicates such a non-significant ("soft") - line break in the encoded text. - - Thus if the "raw" form of the line is a single unencoded line that - says: - - Now's the time for all folk to come to the aid of their country. - - This can be represented, in the Quoted-Printable encoding, as: - - Now's the time = - for all folk to come= - to the aid of their country. - - This provides a mechanism with which long lines are encoded in such a - way as to be restored by the user agent. The 76 character limit does - not count the trailing CRLF, but counts all other characters, - including any equal signs. - - Since the hyphen character ("-") may be represented as itself in the - Quoted-Printable encoding, care must be taken, when encapsulating a - quoted-printable encoded body inside one or more multipart entities, - to ensure that the boundary delimiter does not appear anywhere in the - encoded body. (A good strategy is to choose a boundary that includes - a character sequence such as "=_" which can never appear in a - quoted-printable body. See the definition of multipart messages in - RFC 2046.) - - NOTE: The quoted-printable encoding represents something of a - compromise between readability and reliability in transport. Bodies - encoded with the quoted-printable encoding will work reliably over - most mail gateways, but may not work perfectly over a few gateways, - notably those involving translation into EBCDIC. A higher level of - confidence is offered by the base64 Content-Transfer-Encoding. A way - to get reasonably reliable transport through EBCDIC gateways is to - also quote the US-ASCII characters - - !"#$@[\]^`{|}~ - - according to rule #1. - - Because quoted-printable data is generally assumed to be line- - oriented, it is to be expected that the representation of the breaks - between the lines of quoted-printable data may be altered in - transport, in the same manner that plain text mail has always been - altered in Internet mail when passing between systems with differing - newline conventions. If such alterations are likely to constitute a - - - -Freed & Borenstein Standards Track [Page 21] - -RFC 2045 Internet Message Bodies November 1996 - - - corruption of the data, it is probably more sensible to use the - base64 encoding rather than the quoted-printable encoding. - - NOTE: Several kinds of substrings cannot be generated according to - the encoding rules for the quoted-printable content-transfer- - encoding, and hence are formally illegal if they appear in the output - of a quoted-printable encoder. This note enumerates these cases and - suggests ways to handle such illegal substrings if any are - encountered in quoted-printable data that is to be decoded. - - (1) An "=" followed by two hexadecimal digits, one or both - of which are lowercase letters in "abcdef", is formally - illegal. A robust implementation might choose to - recognize them as the corresponding uppercase letters. - - (2) An "=" followed by a character that is neither a - hexadecimal digit (including "abcdef") nor the CR - character of a CRLF pair is illegal. This case can be - the result of US-ASCII text having been included in a - quoted-printable part of a message without itself - having been subjected to quoted-printable encoding. A - reasonable approach by a robust implementation might be - to include the "=" character and the following - character in the decoded data without any - transformation and, if possible, indicate to the user - that proper decoding was not possible at this point in - the data. - - (3) An "=" cannot be the ultimate or penultimate character - in an encoded object. This could be handled as in case - (2) above. - - (4) Control characters other than TAB, or CR and LF as - parts of CRLF pairs, must not appear. The same is true - for octets with decimal values greater than 126. If - found in incoming quoted-printable data by a decoder, a - robust implementation might exclude them from the - decoded data and warn the user that illegal characters - were discovered. - - (5) Encoded lines must not be longer than 76 characters, - not counting the trailing CRLF. If longer lines are - found in incoming, encoded data, a robust - implementation might nevertheless decode the lines, and - might report the erroneous encoding to the user. - - - - - - -Freed & Borenstein Standards Track [Page 22] - -RFC 2045 Internet Message Bodies November 1996 - - - WARNING TO IMPLEMENTORS: If binary data is encoded in quoted- - printable, care must be taken to encode CR and LF characters as "=0D" - and "=0A", respectively. In particular, a CRLF sequence in binary - data should be encoded as "=0D=0A". Otherwise, if CRLF were - represented as a hard line break, it might be incorrectly decoded on - platforms with different line break conventions. - - For formalists, the syntax of quoted-printable data is described by - the following grammar: - - quoted-printable := qp-line *(CRLF qp-line) - - qp-line := *(qp-segment transport-padding CRLF) - qp-part transport-padding - - qp-part := qp-section - ; Maximum length of 76 characters - - qp-segment := qp-section *(SPACE / TAB) "=" - ; Maximum length of 76 characters - - qp-section := [*(ptext / SPACE / TAB) ptext] - - ptext := hex-octet / safe-char - - safe-char := - ; Characters not listed as "mail-safe" in - ; RFC 2049 are also not recommended. - - hex-octet := "=" 2(DIGIT / "A" / "B" / "C" / "D" / "E" / "F") - ; Octet must be used for characters > 127, =, - ; SPACEs or TABs at the ends of lines, and is - ; recommended for any character not listed in - ; RFC 2049 as "mail-safe". - - transport-padding := *LWSP-char - ; Composers MUST NOT generate - ; non-zero length transport - ; padding, but receivers MUST - ; be able to handle padding - ; added by message transports. - - IMPORTANT: The addition of LWSP between the elements shown in this - BNF is NOT allowed since this BNF does not specify a structured - header field. - - - - - -Freed & Borenstein Standards Track [Page 23] - -RFC 2045 Internet Message Bodies November 1996 - - -6.8. Base64 Content-Transfer-Encoding - - The Base64 Content-Transfer-Encoding is designed to represent - arbitrary sequences of octets in a form that need not be humanly - readable. The encoding and decoding algorithms are simple, but the - encoded data are consistently only about 33 percent larger than the - unencoded data. This encoding is virtually identical to the one used - in Privacy Enhanced Mail (PEM) applications, as defined in RFC 1421. - - A 65-character subset of US-ASCII is used, enabling 6 bits to be - represented per printable character. (The extra 65th character, "=", - is used to signify a special processing function.) - - NOTE: This subset has the important property that it is represented - identically in all versions of ISO 646, including US-ASCII, and all - characters in the subset are also represented identically in all - versions of EBCDIC. Other popular encodings, such as the encoding - used by the uuencode utility, Macintosh binhex 4.0 [RFC-1741], and - the base85 encoding specified as part of Level 2 PostScript, do not - share these properties, and thus do not fulfill the portability - requirements a binary transport encoding for mail must meet. - - The encoding process represents 24-bit groups of input bits as output - strings of 4 encoded characters. Proceeding from left to right, a - 24-bit input group is formed by concatenating 3 8bit input groups. - These 24 bits are then treated as 4 concatenated 6-bit groups, each - of which is translated into a single digit in the base64 alphabet. - When encoding a bit stream via the base64 encoding, the bit stream - must be presumed to be ordered with the most-significant-bit first. - That is, the first bit in the stream will be the high-order bit in - the first 8bit byte, and the eighth bit will be the low-order bit in - the first 8bit byte, and so on. - - Each 6-bit group is used as an index into an array of 64 printable - characters. The character referenced by the index is placed in the - output string. These characters, identified in Table 1, below, are - selected so as to be universally representable, and the set excludes - characters with particular significance to SMTP (e.g., ".", CR, LF) - and to the multipart boundary delimiters defined in RFC 2046 (e.g., - "-"). - - - - - - - - - - - -Freed & Borenstein Standards Track [Page 24] - -RFC 2045 Internet Message Bodies November 1996 - - - Table 1: The Base64 Alphabet - - Value Encoding Value Encoding Value Encoding Value Encoding - 0 A 17 R 34 i 51 z - 1 B 18 S 35 j 52 0 - 2 C 19 T 36 k 53 1 - 3 D 20 U 37 l 54 2 - 4 E 21 V 38 m 55 3 - 5 F 22 W 39 n 56 4 - 6 G 23 X 40 o 57 5 - 7 H 24 Y 41 p 58 6 - 8 I 25 Z 42 q 59 7 - 9 J 26 a 43 r 60 8 - 10 K 27 b 44 s 61 9 - 11 L 28 c 45 t 62 + - 12 M 29 d 46 u 63 / - 13 N 30 e 47 v - 14 O 31 f 48 w (pad) = - 15 P 32 g 49 x - 16 Q 33 h 50 y - - The encoded output stream must be represented in lines of no more - than 76 characters each. All line breaks or other characters not - found in Table 1 must be ignored by decoding software. In base64 - data, characters other than those in Table 1, line breaks, and other - white space probably indicate a transmission error, about which a - warning message or even a message rejection might be appropriate - under some circumstances. - - Special processing is performed if fewer than 24 bits are available - at the end of the data being encoded. A full encoding quantum is - always completed at the end of a body. When fewer than 24 input bits - are available in an input group, zero bits are added (on the right) - to form an integral number of 6-bit groups. Padding at the end of - the data is performed using the "=" character. Since all base64 - input is an integral number of octets, only the following cases can - arise: (1) the final quantum of encoding input is an integral - multiple of 24 bits; here, the final unit of encoded output will be - an integral multiple of 4 characters with no "=" padding, (2) the - final quantum of encoding input is exactly 8 bits; here, the final - unit of encoded output will be two characters followed by two "=" - padding characters, or (3) the final quantum of encoding input is - exactly 16 bits; here, the final unit of encoded output will be three - characters followed by one "=" padding character. - - Because it is used only for padding at the end of the data, the - occurrence of any "=" characters may be taken as evidence that the - end of the data has been reached (without truncation in transit). No - - - -Freed & Borenstein Standards Track [Page 25] - -RFC 2045 Internet Message Bodies November 1996 - - - such assurance is possible, however, when the number of octets - transmitted was a multiple of three and no "=" characters are - present. - - Any characters outside of the base64 alphabet are to be ignored in - base64-encoded data. - - Care must be taken to use the proper octets for line breaks if base64 - encoding is applied directly to text material that has not been - converted to canonical form. In particular, text line breaks must be - converted into CRLF sequences prior to base64 encoding. The - important thing to note is that this may be done directly by the - encoder rather than in a prior canonicalization step in some - implementations. - - NOTE: There is no need to worry about quoting potential boundary - delimiters within base64-encoded bodies within multipart entities - because no hyphen characters are used in the base64 encoding. - -7. Content-ID Header Field - - In constructing a high-level user agent, it may be desirable to allow - one body to make reference to another. Accordingly, bodies may be - labelled using the "Content-ID" header field, which is syntactically - identical to the "Message-ID" header field: - - id := "Content-ID" ":" msg-id - - Like the Message-ID values, Content-ID values must be generated to be - world-unique. - - The Content-ID value may be used for uniquely identifying MIME - entities in several contexts, particularly for caching data - referenced by the message/external-body mechanism. Although the - Content-ID header is generally optional, its use is MANDATORY in - implementations which generate data of the optional MIME media type - "message/external-body". That is, each message/external-body entity - must have a Content-ID field to permit caching of such data. - - It is also worth noting that the Content-ID value has special - semantics in the case of the multipart/alternative media type. This - is explained in the section of RFC 2046 dealing with - multipart/alternative. - - - - - - - - -Freed & Borenstein Standards Track [Page 26] - -RFC 2045 Internet Message Bodies November 1996 - - -8. Content-Description Header Field - - The ability to associate some descriptive information with a given - body is often desirable. For example, it may be useful to mark an - "image" body as "a picture of the Space Shuttle Endeavor." Such text - may be placed in the Content-Description header field. This header - field is always optional. - - description := "Content-Description" ":" *text - - The description is presumed to be given in the US-ASCII character - set, although the mechanism specified in RFC 2047 may be used for - non-US-ASCII Content-Description values. - -9. Additional MIME Header Fields - - Future documents may elect to define additional MIME header fields - for various purposes. Any new header field that further describes - the content of a message should begin with the string "Content-" to - allow such fields which appear in a message header to be - distinguished from ordinary RFC 822 message header fields. - - MIME-extension-field := - -10. Summary - - Using the MIME-Version, Content-Type, and Content-Transfer-Encoding - header fields, it is possible to include, in a standardized way, - arbitrary types of data with RFC 822 conformant mail messages. No - restrictions imposed by either RFC 821 or RFC 822 are violated, and - care has been taken to avoid problems caused by additional - restrictions imposed by the characteristics of some Internet mail - transport mechanisms (see RFC 2049). - - The next document in this set, RFC 2046, specifies the initial set of - media types that can be labelled and transported using these headers. - -11. Security Considerations - - Security issues are discussed in the second document in this set, RFC - 2046. - - - - - - - - -Freed & Borenstein Standards Track [Page 27] - -RFC 2045 Internet Message Bodies November 1996 - - -12. Authors' Addresses - - For more information, the authors of this document are best contacted - via Internet mail: - - Ned Freed - Innosoft International, Inc. - 1050 East Garvey Avenue South - West Covina, CA 91790 - USA - - Phone: +1 818 919 3600 - Fax: +1 818 919 3614 - EMail: ned@innosoft.com - - - Nathaniel S. Borenstein - First Virtual Holdings - 25 Washington Avenue - Morristown, NJ 07960 - USA - - Phone: +1 201 540 8967 - Fax: +1 201 993 3032 - EMail: nsb@nsb.fv.com - - - MIME is a result of the work of the Internet Engineering Task Force - Working Group on RFC 822 Extensions. The chairman of that group, - Greg Vaudreuil, may be reached at: - - Gregory M. Vaudreuil - Octel Network Services - 17080 Dallas Parkway - Dallas, TX 75248-1905 - USA - - EMail: Greg.Vaudreuil@Octel.Com - - - - - - - - - - - - - -Freed & Borenstein Standards Track [Page 28] - -RFC 2045 Internet Message Bodies November 1996 - - -Appendix A -- Collected Grammar - - This appendix contains the complete BNF grammar for all the syntax - specified by this document. - - By itself, however, this grammar is incomplete. It refers by name to - several syntax rules that are defined by RFC 822. Rather than - reproduce those definitions here, and risk unintentional differences - between the two, this document simply refers the reader to RFC 822 - for the remaining definitions. Wherever a term is undefined, it - refers to the RFC 822 definition. - - attribute := token - ; Matching of attributes - ; is ALWAYS case-insensitive. - - composite-type := "message" / "multipart" / extension-token - - content := "Content-Type" ":" type "/" subtype - *(";" parameter) - ; Matching of media type and subtype - ; is ALWAYS case-insensitive. - - description := "Content-Description" ":" *text - - discrete-type := "text" / "image" / "audio" / "video" / - "application" / extension-token - - encoding := "Content-Transfer-Encoding" ":" mechanism - - entity-headers := [ content CRLF ] - [ encoding CRLF ] - [ id CRLF ] - [ description CRLF ] - *( MIME-extension-field CRLF ) - - extension-token := ietf-token / x-token - - hex-octet := "=" 2(DIGIT / "A" / "B" / "C" / "D" / "E" / "F") - ; Octet must be used for characters > 127, =, - ; SPACEs or TABs at the ends of lines, and is - ; recommended for any character not listed in - ; RFC 2049 as "mail-safe". - - iana-token := - - - - -Freed & Borenstein Standards Track [Page 29] - -RFC 2045 Internet Message Bodies November 1996 - - - ietf-token := - - id := "Content-ID" ":" msg-id - - mechanism := "7bit" / "8bit" / "binary" / - "quoted-printable" / "base64" / - ietf-token / x-token - - MIME-extension-field := - - MIME-message-headers := entity-headers - fields - version CRLF - ; The ordering of the header - ; fields implied by this BNF - ; definition should be ignored. - - MIME-part-headers := entity-headers - [fields] - ; Any field not beginning with - ; "content-" can have no defined - ; meaning and may be ignored. - ; The ordering of the header - ; fields implied by this BNF - ; definition should be ignored. - - parameter := attribute "=" value - - ptext := hex-octet / safe-char - - qp-line := *(qp-segment transport-padding CRLF) - qp-part transport-padding - - qp-part := qp-section - ; Maximum length of 76 characters - - qp-section := [*(ptext / SPACE / TAB) ptext] - - qp-segment := qp-section *(SPACE / TAB) "=" - ; Maximum length of 76 characters - - quoted-printable := qp-line *(CRLF qp-line) - - - - - -Freed & Borenstein Standards Track [Page 30] - -RFC 2045 Internet Message Bodies November 1996 - - - safe-char := - ; Characters not listed as "mail-safe" in - ; RFC 2049 are also not recommended. - - subtype := extension-token / iana-token - - token := 1* - - transport-padding := *LWSP-char - ; Composers MUST NOT generate - ; non-zero length transport - ; padding, but receivers MUST - ; be able to handle padding - ; added by message transports. - - tspecials := "(" / ")" / "<" / ">" / "@" / - "," / ";" / ":" / "\" / <"> - "/" / "[" / "]" / "?" / "=" - ; Must be in quoted-string, - ; to use within parameter values - - type := discrete-type / composite-type - - value := token / quoted-string - - version := "MIME-Version" ":" 1*DIGIT "." 1*DIGIT - - x-token := - - - - - - - - - - - - - - - - - - - - -Freed & Borenstein Standards Track [Page 31] - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2046.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2046.txt deleted file mode 100644 index 84d90c1..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2046.txt +++ /dev/null @@ -1,2467 +0,0 @@ - - - - - - -Network Working Group N. Freed -Request for Comments: 2046 Innosoft -Obsoletes: 1521, 1522, 1590 N. Borenstein -Category: Standards Track First Virtual - November 1996 - - - Multipurpose Internet Mail Extensions - (MIME) Part Two: - Media Types - -Status of this Memo - - This document specifies an Internet standards track protocol for the - Internet community, and requests discussion and suggestions for - improvements. Please refer to the current edition of the "Internet - Official Protocol Standards" (STD 1) for the standardization state - and status of this protocol. Distribution of this memo is unlimited. - -Abstract - - STD 11, RFC 822 defines a message representation protocol specifying - considerable detail about US-ASCII message headers, but which leaves - the message content, or message body, as flat US-ASCII text. This - set of documents, collectively called the Multipurpose Internet Mail - Extensions, or MIME, redefines the format of messages to allow for - - (1) textual message bodies in character sets other than - US-ASCII, - - (2) an extensible set of different formats for non-textual - message bodies, - - (3) multi-part message bodies, and - - (4) textual header information in character sets other than - US-ASCII. - - These documents are based on earlier work documented in RFC 934, STD - 11, and RFC 1049, but extends and revises them. Because RFC 822 said - so little about message bodies, these documents are largely - orthogonal to (rather than a revision of) RFC 822. - - The initial document in this set, RFC 2045, specifies the various - headers used to describe the structure of MIME messages. This second - document defines the general structure of the MIME media typing - system and defines an initial set of media types. The third document, - RFC 2047, describes extensions to RFC 822 to allow non-US-ASCII text - - - -Freed & Borenstein Standards Track [Page 1] - -RFC 2046 Media Types November 1996 - - - data in Internet mail header fields. The fourth document, RFC 2048, - specifies various IANA registration procedures for MIME-related - facilities. The fifth and final document, RFC 2049, describes MIME - conformance criteria as well as providing some illustrative examples - of MIME message formats, acknowledgements, and the bibliography. - - These documents are revisions of RFCs 1521 and 1522, which themselves - were revisions of RFCs 1341 and 1342. An appendix in RFC 2049 - describes differences and changes from previous versions. - -Table of Contents - - 1. Introduction ......................................... 3 - 2. Definition of a Top-Level Media Type ................. 4 - 3. Overview Of The Initial Top-Level Media Types ........ 4 - 4. Discrete Media Type Values ........................... 6 - 4.1 Text Media Type ..................................... 6 - 4.1.1 Representation of Line Breaks ..................... 7 - 4.1.2 Charset Parameter ................................. 7 - 4.1.3 Plain Subtype ..................................... 11 - 4.1.4 Unrecognized Subtypes ............................. 11 - 4.2 Image Media Type .................................... 11 - 4.3 Audio Media Type .................................... 11 - 4.4 Video Media Type .................................... 12 - 4.5 Application Media Type .............................. 12 - 4.5.1 Octet-Stream Subtype .............................. 13 - 4.5.2 PostScript Subtype ................................ 14 - 4.5.3 Other Application Subtypes ........................ 17 - 5. Composite Media Type Values .......................... 17 - 5.1 Multipart Media Type ................................ 17 - 5.1.1 Common Syntax ..................................... 19 - 5.1.2 Handling Nested Messages and Multiparts ........... 24 - 5.1.3 Mixed Subtype ..................................... 24 - 5.1.4 Alternative Subtype ............................... 24 - 5.1.5 Digest Subtype .................................... 26 - 5.1.6 Parallel Subtype .................................. 27 - 5.1.7 Other Multipart Subtypes .......................... 28 - 5.2 Message Media Type .................................. 28 - 5.2.1 RFC822 Subtype .................................... 28 - 5.2.2 Partial Subtype ................................... 29 - 5.2.2.1 Message Fragmentation and Reassembly ............ 30 - 5.2.2.2 Fragmentation and Reassembly Example ............ 31 - 5.2.3 External-Body Subtype ............................. 33 - 5.2.4 Other Message Subtypes ............................ 40 - 6. Experimental Media Type Values ....................... 40 - 7. Summary .............................................. 41 - 8. Security Considerations .............................. 41 - 9. Authors' Addresses ................................... 42 - - - -Freed & Borenstein Standards Track [Page 2] - -RFC 2046 Media Types November 1996 - - - A. Collected Grammar .................................... 43 - -1. Introduction - - The first document in this set, RFC 2045, defines a number of header - fields, including Content-Type. The Content-Type field is used to - specify the nature of the data in the body of a MIME entity, by - giving media type and subtype identifiers, and by providing auxiliary - information that may be required for certain media types. After the - type and subtype names, the remainder of the header field is simply a - set of parameters, specified in an attribute/value notation. The - ordering of parameters is not significant. - - In general, the top-level media type is used to declare the general - type of data, while the subtype specifies a specific format for that - type of data. Thus, a media type of "image/xyz" is enough to tell a - user agent that the data is an image, even if the user agent has no - knowledge of the specific image format "xyz". Such information can - be used, for example, to decide whether or not to show a user the raw - data from an unrecognized subtype -- such an action might be - reasonable for unrecognized subtypes of "text", but not for - unrecognized subtypes of "image" or "audio". For this reason, - registered subtypes of "text", "image", "audio", and "video" should - not contain embedded information that is really of a different type. - Such compound formats should be represented using the "multipart" or - "application" types. - - Parameters are modifiers of the media subtype, and as such do not - fundamentally affect the nature of the content. The set of - meaningful parameters depends on the media type and subtype. Most - parameters are associated with a single specific subtype. However, a - given top-level media type may define parameters which are applicable - to any subtype of that type. Parameters may be required by their - defining media type or subtype or they may be optional. MIME - implementations must also ignore any parameters whose names they do - not recognize. - - MIME's Content-Type header field and media type mechanism has been - carefully designed to be extensible, and it is expected that the set - of media type/subtype pairs and their associated parameters will grow - significantly over time. Several other MIME facilities, such as - transfer encodings and "message/external-body" access types, are - likely to have new values defined over time. In order to ensure that - the set of such values is developed in an orderly, well-specified, - and public manner, MIME sets up a registration process which uses the - Internet Assigned Numbers Authority (IANA) as a central registry for - MIME's various areas of extensibility. The registration process for - these areas is described in a companion document, RFC 2048. - - - -Freed & Borenstein Standards Track [Page 3] - -RFC 2046 Media Types November 1996 - - - The initial seven standard top-level media type are defined and - described in the remainder of this document. - -2. Definition of a Top-Level Media Type - - The definition of a top-level media type consists of: - - (1) a name and a description of the type, including - criteria for whether a particular type would qualify - under that type, - - (2) the names and definitions of parameters, if any, which - are defined for all subtypes of that type (including - whether such parameters are required or optional), - - (3) how a user agent and/or gateway should handle unknown - subtypes of this type, - - (4) general considerations on gatewaying entities of this - top-level type, if any, and - - (5) any restrictions on content-transfer-encodings for - entities of this top-level type. - -3. Overview Of The Initial Top-Level Media Types - - The five discrete top-level media types are: - - (1) text -- textual information. The subtype "plain" in - particular indicates plain text containing no - formatting commands or directives of any sort. Plain - text is intended to be displayed "as-is". No special - software is required to get the full meaning of the - text, aside from support for the indicated character - set. Other subtypes are to be used for enriched text in - forms where application software may enhance the - appearance of the text, but such software must not be - required in order to get the general idea of the - content. Possible subtypes of "text" thus include any - word processor format that can be read without - resorting to software that understands the format. In - particular, formats that employ embeddded binary - formatting information are not considered directly - readable. A very simple and portable subtype, - "richtext", was defined in RFC 1341, with a further - revision in RFC 1896 under the name "enriched". - - - - - -Freed & Borenstein Standards Track [Page 4] - -RFC 2046 Media Types November 1996 - - - (2) image -- image data. "Image" requires a display device - (such as a graphical display, a graphics printer, or a - FAX machine) to view the information. An initial - subtype is defined for the widely-used image format - JPEG. . subtypes are defined for two widely-used image - formats, jpeg and gif. - - (3) audio -- audio data. "Audio" requires an audio output - device (such as a speaker or a telephone) to "display" - the contents. An initial subtype "basic" is defined in - this document. - - (4) video -- video data. "Video" requires the capability - to display moving images, typically including - specialized hardware and software. An initial subtype - "mpeg" is defined in this document. - - (5) application -- some other kind of data, typically - either uninterpreted binary data or information to be - processed by an application. The subtype "octet- - stream" is to be used in the case of uninterpreted - binary data, in which case the simplest recommended - action is to offer to write the information into a file - for the user. The "PostScript" subtype is also defined - for the transport of PostScript material. Other - expected uses for "application" include spreadsheets, - data for mail-based scheduling systems, and languages - for "active" (computational) messaging, and word - processing formats that are not directly readable. - Note that security considerations may exist for some - types of application data, most notably - "application/PostScript" and any form of active - messaging. These issues are discussed later in this - document. - - The two composite top-level media types are: - - (1) multipart -- data consisting of multiple entities of - independent data types. Four subtypes are initially - defined, including the basic "mixed" subtype specifying - a generic mixed set of parts, "alternative" for - representing the same data in multiple formats, - "parallel" for parts intended to be viewed - simultaneously, and "digest" for multipart entities in - which each part has a default type of "message/rfc822". - - - - - - -Freed & Borenstein Standards Track [Page 5] - -RFC 2046 Media Types November 1996 - - - (2) message -- an encapsulated message. A body of media - type "message" is itself all or a portion of some kind - of message object. Such objects may or may not in turn - contain other entities. The "rfc822" subtype is used - when the encapsulated content is itself an RFC 822 - message. The "partial" subtype is defined for partial - RFC 822 messages, to permit the fragmented transmission - of bodies that are thought to be too large to be passed - through transport facilities in one piece. Another - subtype, "external-body", is defined for specifying - large bodies by reference to an external data source. - - It should be noted that the list of media type values given here may - be augmented in time, via the mechanisms described above, and that - the set of subtypes is expected to grow substantially. - -4. Discrete Media Type Values - - Five of the seven initial media type values refer to discrete bodies. - The content of these types must be handled by non-MIME mechanisms; - they are opaque to MIME processors. - -4.1. Text Media Type - - The "text" media type is intended for sending material which is - principally textual in form. A "charset" parameter may be used to - indicate the character set of the body text for "text" subtypes, - notably including the subtype "text/plain", which is a generic - subtype for plain text. Plain text does not provide for or allow - formatting commands, font attribute specifications, processing - instructions, interpretation directives, or content markup. Plain - text is seen simply as a linear sequence of characters, possibly - interrupted by line breaks or page breaks. Plain text may allow the - stacking of several characters in the same position in the text. - Plain text in scripts like Arabic and Hebrew may also include - facilitites that allow the arbitrary mixing of text segments with - opposite writing directions. - - Beyond plain text, there are many formats for representing what might - be known as "rich text". An interesting characteristic of many such - representations is that they are to some extent readable even without - the software that interprets them. It is useful, then, to - distinguish them, at the highest level, from such unreadable data as - images, audio, or text represented in an unreadable form. In the - absence of appropriate interpretation software, it is reasonable to - show subtypes of "text" to the user, while it is not reasonable to do - so with most nontextual data. Such formatted textual data should be - represented using subtypes of "text". - - - -Freed & Borenstein Standards Track [Page 6] - -RFC 2046 Media Types November 1996 - - -4.1.1. Representation of Line Breaks - - The canonical form of any MIME "text" subtype MUST always represent a - line break as a CRLF sequence. Similarly, any occurrence of CRLF in - MIME "text" MUST represent a line break. Use of CR and LF outside of - line break sequences is also forbidden. - - This rule applies regardless of format or character set or sets - involved. - - NOTE: The proper interpretation of line breaks when a body is - displayed depends on the media type. In particular, while it is - appropriate to treat a line break as a transition to a new line when - displaying a "text/plain" body, this treatment is actually incorrect - for other subtypes of "text" like "text/enriched" [RFC-1896]. - Similarly, whether or not line breaks should be added during display - operations is also a function of the media type. It should not be - necessary to add any line breaks to display "text/plain" correctly, - whereas proper display of "text/enriched" requires the appropriate - addition of line breaks. - - NOTE: Some protocols defines a maximum line length. E.g. SMTP [RFC- - 821] allows a maximum of 998 octets before the next CRLF sequence. - To be transported by such protocols, data which includes too long - segments without CRLF sequences must be encoded with a suitable - content-transfer-encoding. - -4.1.2. Charset Parameter - - A critical parameter that may be specified in the Content-Type field - for "text/plain" data is the character set. This is specified with a - "charset" parameter, as in: - - Content-type: text/plain; charset=iso-8859-1 - - Unlike some other parameter values, the values of the charset - parameter are NOT case sensitive. The default character set, which - must be assumed in the absence of a charset parameter, is US-ASCII. - - The specification for any future subtypes of "text" must specify - whether or not they will also utilize a "charset" parameter, and may - possibly restrict its values as well. For other subtypes of "text" - than "text/plain", the semantics of the "charset" parameter should be - defined to be identical to those specified here for "text/plain", - i.e., the body consists entirely of characters in the given charset. - In particular, definers of future "text" subtypes should pay close - attention to the implications of multioctet character sets for their - subtype definitions. - - - -Freed & Borenstein Standards Track [Page 7] - -RFC 2046 Media Types November 1996 - - - The charset parameter for subtypes of "text" gives a name of a - character set, as "character set" is defined in RFC 2045. The rules - regarding line breaks detailed in the previous section must also be - observed -- a character set whose definition does not conform to - these rules cannot be used in a MIME "text" subtype. - - An initial list of predefined character set names can be found at the - end of this section. Additional character sets may be registered - with IANA. - - Other media types than subtypes of "text" might choose to employ the - charset parameter as defined here, but with the CRLF/line break - restriction removed. Therefore, all character sets that conform to - the general definition of "character set" in RFC 2045 can be - registered for MIME use. - - Note that if the specified character set includes 8-bit characters - and such characters are used in the body, a Content-Transfer-Encoding - header field and a corresponding encoding on the data are required in - order to transmit the body via some mail transfer protocols, such as - SMTP [RFC-821]. - - The default character set, US-ASCII, has been the subject of some - confusion and ambiguity in the past. Not only were there some - ambiguities in the definition, there have been wide variations in - practice. In order to eliminate such ambiguity and variations in the - future, it is strongly recommended that new user agents explicitly - specify a character set as a media type parameter in the Content-Type - header field. "US-ASCII" does not indicate an arbitrary 7-bit - character set, but specifies that all octets in the body must be - interpreted as characters according to the US-ASCII character set. - National and application-oriented versions of ISO 646 [ISO-646] are - usually NOT identical to US-ASCII, and in that case their use in - Internet mail is explicitly discouraged. The omission of the ISO 646 - character set from this document is deliberate in this regard. The - character set name of "US-ASCII" explicitly refers to the character - set defined in ANSI X3.4-1986 [US- ASCII]. The new international - reference version (IRV) of the 1991 edition of ISO 646 is identical - to US-ASCII. The character set name "ASCII" is reserved and must not - be used for any purpose. - - NOTE: RFC 821 explicitly specifies "ASCII", and references an earlier - version of the American Standard. Insofar as one of the purposes of - specifying a media type and character set is to permit the receiver - to unambiguously determine how the sender intended the coded message - to be interpreted, assuming anything other than "strict ASCII" as the - default would risk unintentional and incompatible changes to the - semantics of messages now being transmitted. This also implies that - - - -Freed & Borenstein Standards Track [Page 8] - -RFC 2046 Media Types November 1996 - - - messages containing characters coded according to other versions of - ISO 646 than US-ASCII and the 1991 IRV, or using code-switching - procedures (e.g., those of ISO 2022), as well as 8bit or multiple - octet character encodings MUST use an appropriate character set - specification to be consistent with MIME. - - The complete US-ASCII character set is listed in ANSI X3.4- 1986. - Note that the control characters including DEL (0-31, 127) have no - defined meaning in apart from the combination CRLF (US-ASCII values - 13 and 10) indicating a new line. Two of the characters have de - facto meanings in wide use: FF (12) often means "start subsequent - text on the beginning of a new page"; and TAB or HT (9) often (though - not always) means "move the cursor to the next available column after - the current position where the column number is a multiple of 8 - (counting the first column as column 0)." Aside from these - conventions, any use of the control characters or DEL in a body must - either occur - - (1) because a subtype of text other than "plain" - specifically assigns some additional meaning, or - - (2) within the context of a private agreement between the - sender and recipient. Such private agreements are - discouraged and should be replaced by the other - capabilities of this document. - - NOTE: An enormous proliferation of character sets exist beyond US- - ASCII. A large number of partially or totally overlapping character - sets is NOT a good thing. A SINGLE character set that can be used - universally for representing all of the world's languages in Internet - mail would be preferrable. Unfortunately, existing practice in - several communities seems to point to the continued use of multiple - character sets in the near future. A small number of standard - character sets are, therefore, defined for Internet use in this - document. - - The defined charset values are: - - (1) US-ASCII -- as defined in ANSI X3.4-1986 [US-ASCII]. - - (2) ISO-8859-X -- where "X" is to be replaced, as - necessary, for the parts of ISO-8859 [ISO-8859]. Note - that the ISO 646 character sets have deliberately been - omitted in favor of their 8859 replacements, which are - the designated character sets for Internet mail. As of - the publication of this document, the legitimate values - for "X" are the digits 1 through 10. - - - - -Freed & Borenstein Standards Track [Page 9] - -RFC 2046 Media Types November 1996 - - - Characters in the range 128-159 has no assigned meaning in ISO-8859- - X. Characters with values below 128 in ISO-8859-X have the same - assigned meaning as they do in US-ASCII. - - Part 6 of ISO 8859 (Latin/Arabic alphabet) and part 8 (Latin/Hebrew - alphabet) includes both characters for which the normal writing - direction is right to left and characters for which it is left to - right, but do not define a canonical ordering method for representing - bi-directional text. The charset values "ISO-8859-6" and "ISO-8859- - 8", however, specify that the visual method is used [RFC-1556]. - - All of these character sets are used as pure 7bit or 8bit sets - without any shift or escape functions. The meaning of shift and - escape sequences in these character sets is not defined. - - The character sets specified above are the ones that were relatively - uncontroversial during the drafting of MIME. This document does not - endorse the use of any particular character set other than US-ASCII, - and recognizes that the future evolution of world character sets - remains unclear. - - Note that the character set used, if anything other than US- ASCII, - must always be explicitly specified in the Content-Type field. - - No character set name other than those defined above may be used in - Internet mail without the publication of a formal specification and - its registration with IANA, or by private agreement, in which case - the character set name must begin with "X-". - - Implementors are discouraged from defining new character sets unless - absolutely necessary. - - The "charset" parameter has been defined primarily for the purpose of - textual data, and is described in this section for that reason. - However, it is conceivable that non-textual data might also wish to - specify a charset value for some purpose, in which case the same - syntax and values should be used. - - In general, composition software should always use the "lowest common - denominator" character set possible. For example, if a body contains - only US-ASCII characters, it SHOULD be marked as being in the US- - ASCII character set, not ISO-8859-1, which, like all the ISO-8859 - family of character sets, is a superset of US-ASCII. More generally, - if a widely-used character set is a subset of another character set, - and a body contains only characters in the widely-used subset, it - should be labelled as being in that subset. This will increase the - chances that the recipient will be able to view the resulting entity - correctly. - - - -Freed & Borenstein Standards Track [Page 10] - -RFC 2046 Media Types November 1996 - - -4.1.3. Plain Subtype - - The simplest and most important subtype of "text" is "plain". This - indicates plain text that does not contain any formatting commands or - directives. Plain text is intended to be displayed "as-is", that is, - no interpretation of embedded formatting commands, font attribute - specifications, processing instructions, interpretation directives, - or content markup should be necessary for proper display. The - default media type of "text/plain; charset=us-ascii" for Internet - mail describes existing Internet practice. That is, it is the type - of body defined by RFC 822. - - No other "text" subtype is defined by this document. - -4.1.4. Unrecognized Subtypes - - Unrecognized subtypes of "text" should be treated as subtype "plain" - as long as the MIME implementation knows how to handle the charset. - Unrecognized subtypes which also specify an unrecognized charset - should be treated as "application/octet- stream". - -4.2. Image Media Type - - A media type of "image" indicates that the body contains an image. - The subtype names the specific image format. These names are not - case sensitive. An initial subtype is "jpeg" for the JPEG format - using JFIF encoding [JPEG]. - - The list of "image" subtypes given here is neither exclusive nor - exhaustive, and is expected to grow as more types are registered with - IANA, as described in RFC 2048. - - Unrecognized subtypes of "image" should at a miniumum be treated as - "application/octet-stream". Implementations may optionally elect to - pass subtypes of "image" that they do not specifically recognize to a - secure and robust general-purpose image viewing application, if such - an application is available. - - NOTE: Using of a generic-purpose image viewing application this way - inherits the security problems of the most dangerous type supported - by the application. - -4.3. Audio Media Type - - A media type of "audio" indicates that the body contains audio data. - Although there is not yet a consensus on an "ideal" audio format for - use with computers, there is a pressing need for a format capable of - providing interoperable behavior. - - - -Freed & Borenstein Standards Track [Page 11] - -RFC 2046 Media Types November 1996 - - - The initial subtype of "basic" is specified to meet this requirement - by providing an absolutely minimal lowest common denominator audio - format. It is expected that richer formats for higher quality and/or - lower bandwidth audio will be defined by a later document. - - The content of the "audio/basic" subtype is single channel audio - encoded using 8bit ISDN mu-law [PCM] at a sample rate of 8000 Hz. - - Unrecognized subtypes of "audio" should at a miniumum be treated as - "application/octet-stream". Implementations may optionally elect to - pass subtypes of "audio" that they do not specifically recognize to a - robust general-purpose audio playing application, if such an - application is available. - -4.4. Video Media Type - - A media type of "video" indicates that the body contains a time- - varying-picture image, possibly with color and coordinated sound. - The term 'video' is used in its most generic sense, rather than with - reference to any particular technology or format, and is not meant to - preclude subtypes such as animated drawings encoded compactly. The - subtype "mpeg" refers to video coded according to the MPEG standard - [MPEG]. - - Note that although in general this document strongly discourages the - mixing of multiple media in a single body, it is recognized that many - so-called video formats include a representation for synchronized - audio, and this is explicitly permitted for subtypes of "video". - - Unrecognized subtypes of "video" should at a minumum be treated as - "application/octet-stream". Implementations may optionally elect to - pass subtypes of "video" that they do not specifically recognize to a - robust general-purpose video display application, if such an - application is available. - -4.5. Application Media Type - - The "application" media type is to be used for discrete data which do - not fit in any of the other categories, and particularly for data to - be processed by some type of application program. This is - information which must be processed by an application before it is - viewable or usable by a user. Expected uses for the "application" - media type include file transfer, spreadsheets, data for mail-based - scheduling systems, and languages for "active" (computational) - material. (The latter, in particular, can pose security problems - which must be understood by implementors, and are considered in - detail in the discussion of the "application/PostScript" media type.) - - - - -Freed & Borenstein Standards Track [Page 12] - -RFC 2046 Media Types November 1996 - - - For example, a meeting scheduler might define a standard - representation for information about proposed meeting dates. An - intelligent user agent would use this information to conduct a dialog - with the user, and might then send additional material based on that - dialog. More generally, there have been several "active" messaging - languages developed in which programs in a suitably specialized - language are transported to a remote location and automatically run - in the recipient's environment. - - Such applications may be defined as subtypes of the "application" - media type. This document defines two subtypes: - - octet-stream, and PostScript. - - The subtype of "application" will often be either the name or include - part of the name of the application for which the data are intended. - This does not mean, however, that any application program name may be - used freely as a subtype of "application". - -4.5.1. Octet-Stream Subtype - - The "octet-stream" subtype is used to indicate that a body contains - arbitrary binary data. The set of currently defined parameters is: - - (1) TYPE -- the general type or category of binary data. - This is intended as information for the human recipient - rather than for any automatic processing. - - (2) PADDING -- the number of bits of padding that were - appended to the bit-stream comprising the actual - contents to produce the enclosed 8bit byte-oriented - data. This is useful for enclosing a bit-stream in a - body when the total number of bits is not a multiple of - 8. - - Both of these parameters are optional. - - An additional parameter, "CONVERSIONS", was defined in RFC 1341 but - has since been removed. RFC 1341 also defined the use of a "NAME" - parameter which gave a suggested file name to be used if the data - were to be written to a file. This has been deprecated in - anticipation of a separate Content-Disposition header field, to be - defined in a subsequent RFC. - - The recommended action for an implementation that receives an - "application/octet-stream" entity is to simply offer to put the data - in a file, with any Content-Transfer-Encoding undone, or perhaps to - use it as input to a user-specified process. - - - -Freed & Borenstein Standards Track [Page 13] - -RFC 2046 Media Types November 1996 - - - To reduce the danger of transmitting rogue programs, it is strongly - recommended that implementations NOT implement a path-search - mechanism whereby an arbitrary program named in the Content-Type - parameter (e.g., an "interpreter=" parameter) is found and executed - using the message body as input. - -4.5.2. PostScript Subtype - - A media type of "application/postscript" indicates a PostScript - program. Currently two variants of the PostScript language are - allowed; the original level 1 variant is described in [POSTSCRIPT] - and the more recent level 2 variant is described in [POSTSCRIPT2]. - - PostScript is a registered trademark of Adobe Systems, Inc. Use of - the MIME media type "application/postscript" implies recognition of - that trademark and all the rights it entails. - - The PostScript language definition provides facilities for internal - labelling of the specific language features a given program uses. - This labelling, called the PostScript document structuring - conventions, or DSC, is very general and provides substantially more - information than just the language level. The use of document - structuring conventions, while not required, is strongly recommended - as an aid to interoperability. Documents which lack proper - structuring conventions cannot be tested to see whether or not they - will work in a given environment. As such, some systems may assume - the worst and refuse to process unstructured documents. - - The execution of general-purpose PostScript interpreters entails - serious security risks, and implementors are discouraged from simply - sending PostScript bodies to "off- the-shelf" interpreters. While it - is usually safe to send PostScript to a printer, where the potential - for harm is greatly constrained by typical printer environments, - implementors should consider all of the following before they add - interactive display of PostScript bodies to their MIME readers. - - The remainder of this section outlines some, though probably not all, - of the possible problems with the transport of PostScript entities. - - (1) Dangerous operations in the PostScript language - include, but may not be limited to, the PostScript - operators "deletefile", "renamefile", "filenameforall", - and "file". "File" is only dangerous when applied to - something other than standard input or output. - Implementations may also define additional nonstandard - file operators; these may also pose a threat to - security. "Filenameforall", the wildcard file search - operator, may appear at first glance to be harmless. - - - -Freed & Borenstein Standards Track [Page 14] - -RFC 2046 Media Types November 1996 - - - Note, however, that this operator has the potential to - reveal information about what files the recipient has - access to, and this information may itself be - sensitive. Message senders should avoid the use of - potentially dangerous file operators, since these - operators are quite likely to be unavailable in secure - PostScript implementations. Message receiving and - displaying software should either completely disable - all potentially dangerous file operators or take - special care not to delegate any special authority to - their operation. These operators should be viewed as - being done by an outside agency when interpreting - PostScript documents. Such disabling and/or checking - should be done completely outside of the reach of the - PostScript language itself; care should be taken to - insure that no method exists for re-enabling full- - function versions of these operators. - - (2) The PostScript language provides facilities for exiting - the normal interpreter, or server, loop. Changes made - in this "outer" environment are customarily retained - across documents, and may in some cases be retained - semipermanently in nonvolatile memory. The operators - associated with exiting the interpreter loop have the - potential to interfere with subsequent document - processing. As such, their unrestrained use - constitutes a threat of service denial. PostScript - operators that exit the interpreter loop include, but - may not be limited to, the exitserver and startjob - operators. Message sending software should not - generate PostScript that depends on exiting the - interpreter loop to operate, since the ability to exit - will probably be unavailable in secure PostScript - implementations. Message receiving and displaying - software should completely disable the ability to make - retained changes to the PostScript environment by - eliminating or disabling the "startjob" and - "exitserver" operations. If these operations cannot be - eliminated or completely disabled the password - associated with them should at least be set to a hard- - to-guess value. - - (3) PostScript provides operators for setting system-wide - and device-specific parameters. These parameter - settings may be retained across jobs and may - potentially pose a threat to the correct operation of - the interpreter. The PostScript operators that set - system and device parameters include, but may not be - - - -Freed & Borenstein Standards Track [Page 15] - -RFC 2046 Media Types November 1996 - - - limited to, the "setsystemparams" and "setdevparams" - operators. Message sending software should not - generate PostScript that depends on the setting of - system or device parameters to operate correctly. The - ability to set these parameters will probably be - unavailable in secure PostScript implementations. - Message receiving and displaying software should - disable the ability to change system and device - parameters. If these operators cannot be completely - disabled the password associated with them should at - least be set to a hard-to-guess value. - - (4) Some PostScript implementations provide nonstandard - facilities for the direct loading and execution of - machine code. Such facilities are quite obviously open - to substantial abuse. Message sending software should - not make use of such features. Besides being totally - hardware-specific, they are also likely to be - unavailable in secure implementations of PostScript. - Message receiving and displaying software should not - allow such operators to be used if they exist. - - (5) PostScript is an extensible language, and many, if not - most, implementations of it provide a number of their - own extensions. This document does not deal with such - extensions explicitly since they constitute an unknown - factor. Message sending software should not make use - of nonstandard extensions; they are likely to be - missing from some implementations. Message receiving - and displaying software should make sure that any - nonstandard PostScript operators are secure and don't - present any kind of threat. - - (6) It is possible to write PostScript that consumes huge - amounts of various system resources. It is also - possible to write PostScript programs that loop - indefinitely. Both types of programs have the - potential to cause damage if sent to unsuspecting - recipients. Message-sending software should avoid the - construction and dissemination of such programs, which - is antisocial. Message receiving and displaying - software should provide appropriate mechanisms to abort - processing after a reasonable amount of time has - elapsed. In addition, PostScript interpreters should be - limited to the consumption of only a reasonable amount - of any given system resource. - - - - - -Freed & Borenstein Standards Track [Page 16] - -RFC 2046 Media Types November 1996 - - - (7) It is possible to include raw binary information inside - PostScript in various forms. This is not recommended - for use in Internet mail, both because it is not - supported by all PostScript interpreters and because it - significantly complicates the use of a MIME Content- - Transfer-Encoding. (Without such binary, PostScript - may typically be viewed as line-oriented data. The - treatment of CRLF sequences becomes extremely - problematic if binary and line-oriented data are mixed - in a single Postscript data stream.) - - (8) Finally, bugs may exist in some PostScript interpreters - which could possibly be exploited to gain unauthorized - access to a recipient's system. Apart from noting this - possibility, there is no specific action to take to - prevent this, apart from the timely correction of such - bugs if any are found. - -4.5.3. Other Application Subtypes - - It is expected that many other subtypes of "application" will be - defined in the future. MIME implementations must at a minimum treat - any unrecognized subtypes as being equivalent to "application/octet- - stream". - -5. Composite Media Type Values - - The remaining two of the seven initial Content-Type values refer to - composite entities. Composite entities are handled using MIME - mechanisms -- a MIME processor typically handles the body directly. - -5.1. Multipart Media Type - - In the case of multipart entities, in which one or more different - sets of data are combined in a single body, a "multipart" media type - field must appear in the entity's header. The body must then contain - one or more body parts, each preceded by a boundary delimiter line, - and the last one followed by a closing boundary delimiter line. - After its boundary delimiter line, each body part then consists of a - header area, a blank line, and a body area. Thus a body part is - similar to an RFC 822 message in syntax, but different in meaning. - - A body part is an entity and hence is NOT to be interpreted as - actually being an RFC 822 message. To begin with, NO header fields - are actually required in body parts. A body part that starts with a - blank line, therefore, is allowed and is a body part for which all - default values are to be assumed. In such a case, the absence of a - Content-Type header usually indicates that the corresponding body has - - - -Freed & Borenstein Standards Track [Page 17] - -RFC 2046 Media Types November 1996 - - - a content-type of "text/plain; charset=US-ASCII". - - The only header fields that have defined meaning for body parts are - those the names of which begin with "Content-". All other header - fields may be ignored in body parts. Although they should generally - be retained if at all possible, they may be discarded by gateways if - necessary. Such other fields are permitted to appear in body parts - but must not be depended on. "X-" fields may be created for - experimental or private purposes, with the recognition that the - information they contain may be lost at some gateways. - - NOTE: The distinction between an RFC 822 message and a body part is - subtle, but important. A gateway between Internet and X.400 mail, - for example, must be able to tell the difference between a body part - that contains an image and a body part that contains an encapsulated - message, the body of which is a JPEG image. In order to represent - the latter, the body part must have "Content-Type: message/rfc822", - and its body (after the blank line) must be the encapsulated message, - with its own "Content-Type: image/jpeg" header field. The use of - similar syntax facilitates the conversion of messages to body parts, - and vice versa, but the distinction between the two must be - understood by implementors. (For the special case in which parts - actually are messages, a "digest" subtype is also defined.) - - As stated previously, each body part is preceded by a boundary - delimiter line that contains the boundary delimiter. The boundary - delimiter MUST NOT appear inside any of the encapsulated parts, on a - line by itself or as the prefix of any line. This implies that it is - crucial that the composing agent be able to choose and specify a - unique boundary parameter value that does not contain the boundary - parameter value of an enclosing multipart as a prefix. - - All present and future subtypes of the "multipart" type must use an - identical syntax. Subtypes may differ in their semantics, and may - impose additional restrictions on syntax, but must conform to the - required syntax for the "multipart" type. This requirement ensures - that all conformant user agents will at least be able to recognize - and separate the parts of any multipart entity, even those of an - unrecognized subtype. - - As stated in the definition of the Content-Transfer-Encoding field - [RFC 2045], no encoding other than "7bit", "8bit", or "binary" is - permitted for entities of type "multipart". The "multipart" boundary - delimiters and header fields are always represented as 7bit US-ASCII - in any case (though the header fields may encode non-US-ASCII header - text as per RFC 2047) and data within the body parts can be encoded - on a part-by-part basis, with Content-Transfer-Encoding fields for - each appropriate body part. - - - -Freed & Borenstein Standards Track [Page 18] - -RFC 2046 Media Types November 1996 - - -5.1.1. Common Syntax - - This section defines a common syntax for subtypes of "multipart". - All subtypes of "multipart" must use this syntax. A simple example - of a multipart message also appears in this section. An example of a - more complex multipart message is given in RFC 2049. - - The Content-Type field for multipart entities requires one parameter, - "boundary". The boundary delimiter line is then defined as a line - consisting entirely of two hyphen characters ("-", decimal value 45) - followed by the boundary parameter value from the Content-Type header - field, optional linear whitespace, and a terminating CRLF. - - NOTE: The hyphens are for rough compatibility with the earlier RFC - 934 method of message encapsulation, and for ease of searching for - the boundaries in some implementations. However, it should be noted - that multipart messages are NOT completely compatible with RFC 934 - encapsulations; in particular, they do not obey RFC 934 quoting - conventions for embedded lines that begin with hyphens. This - mechanism was chosen over the RFC 934 mechanism because the latter - causes lines to grow with each level of quoting. The combination of - this growth with the fact that SMTP implementations sometimes wrap - long lines made the RFC 934 mechanism unsuitable for use in the event - that deeply-nested multipart structuring is ever desired. - - WARNING TO IMPLEMENTORS: The grammar for parameters on the Content- - type field is such that it is often necessary to enclose the boundary - parameter values in quotes on the Content-type line. This is not - always necessary, but never hurts. Implementors should be sure to - study the grammar carefully in order to avoid producing invalid - Content-type fields. Thus, a typical "multipart" Content-Type header - field might look like this: - - Content-Type: multipart/mixed; boundary=gc0p4Jq0M2Yt08j34c0p - - But the following is not valid: - - Content-Type: multipart/mixed; boundary=gc0pJq0M:08jU534c0p - - (because of the colon) and must instead be represented as - - Content-Type: multipart/mixed; boundary="gc0pJq0M:08jU534c0p" - - This Content-Type value indicates that the content consists of one or - more parts, each with a structure that is syntactically identical to - an RFC 822 message, except that the header area is allowed to be - completely empty, and that the parts are each preceded by the line - - - - -Freed & Borenstein Standards Track [Page 19] - -RFC 2046 Media Types November 1996 - - - --gc0pJq0M:08jU534c0p - - The boundary delimiter MUST occur at the beginning of a line, i.e., - following a CRLF, and the initial CRLF is considered to be attached - to the boundary delimiter line rather than part of the preceding - part. The boundary may be followed by zero or more characters of - linear whitespace. It is then terminated by either another CRLF and - the header fields for the next part, or by two CRLFs, in which case - there are no header fields for the next part. If no Content-Type - field is present it is assumed to be "message/rfc822" in a - "multipart/digest" and "text/plain" otherwise. - - NOTE: The CRLF preceding the boundary delimiter line is conceptually - attached to the boundary so that it is possible to have a part that - does not end with a CRLF (line break). Body parts that must be - considered to end with line breaks, therefore, must have two CRLFs - preceding the boundary delimiter line, the first of which is part of - the preceding body part, and the second of which is part of the - encapsulation boundary. - - Boundary delimiters must not appear within the encapsulated material, - and must be no longer than 70 characters, not counting the two - leading hyphens. - - The boundary delimiter line following the last body part is a - distinguished delimiter that indicates that no further body parts - will follow. Such a delimiter line is identical to the previous - delimiter lines, with the addition of two more hyphens after the - boundary parameter value. - - --gc0pJq0M:08jU534c0p-- - - NOTE TO IMPLEMENTORS: Boundary string comparisons must compare the - boundary value with the beginning of each candidate line. An exact - match of the entire candidate line is not required; it is sufficient - that the boundary appear in its entirety following the CRLF. - - There appears to be room for additional information prior to the - first boundary delimiter line and following the final boundary - delimiter line. These areas should generally be left blank, and - implementations must ignore anything that appears before the first - boundary delimiter line or after the last one. - - NOTE: These "preamble" and "epilogue" areas are generally not used - because of the lack of proper typing of these parts and the lack of - clear semantics for handling these areas at gateways, particularly - X.400 gateways. However, rather than leaving the preamble area - blank, many MIME implementations have found this to be a convenient - - - -Freed & Borenstein Standards Track [Page 20] - -RFC 2046 Media Types November 1996 - - - place to insert an explanatory note for recipients who read the - message with pre-MIME software, since such notes will be ignored by - MIME-compliant software. - - NOTE: Because boundary delimiters must not appear in the body parts - being encapsulated, a user agent must exercise care to choose a - unique boundary parameter value. The boundary parameter value in the - example above could have been the result of an algorithm designed to - produce boundary delimiters with a very low probability of already - existing in the data to be encapsulated without having to prescan the - data. Alternate algorithms might result in more "readable" boundary - delimiters for a recipient with an old user agent, but would require - more attention to the possibility that the boundary delimiter might - appear at the beginning of some line in the encapsulated part. The - simplest boundary delimiter line possible is something like "---", - with a closing boundary delimiter line of "-----". - - As a very simple example, the following multipart message has two - parts, both of them plain text, one of them explicitly typed and one - of them implicitly typed: - - From: Nathaniel Borenstein - To: Ned Freed - Date: Sun, 21 Mar 1993 23:56:48 -0800 (PST) - Subject: Sample message - MIME-Version: 1.0 - Content-type: multipart/mixed; boundary="simple boundary" - - This is the preamble. It is to be ignored, though it - is a handy place for composition agents to include an - explanatory note to non-MIME conformant readers. - - --simple boundary - - This is implicitly typed plain US-ASCII text. - It does NOT end with a linebreak. - --simple boundary - Content-type: text/plain; charset=us-ascii - - This is explicitly typed plain US-ASCII text. - It DOES end with a linebreak. - - --simple boundary-- - - This is the epilogue. It is also to be ignored. - - - - - - -Freed & Borenstein Standards Track [Page 21] - -RFC 2046 Media Types November 1996 - - - The use of a media type of "multipart" in a body part within another - "multipart" entity is explicitly allowed. In such cases, for obvious - reasons, care must be taken to ensure that each nested "multipart" - entity uses a different boundary delimiter. See RFC 2049 for an - example of nested "multipart" entities. - - The use of the "multipart" media type with only a single body part - may be useful in certain contexts, and is explicitly permitted. - - NOTE: Experience has shown that a "multipart" media type with a - single body part is useful for sending non-text media types. It has - the advantage of providing the preamble as a place to include - decoding instructions. In addition, a number of SMTP gateways move - or remove the MIME headers, and a clever MIME decoder can take a good - guess at multipart boundaries even in the absence of the Content-Type - header and thereby successfully decode the message. - - The only mandatory global parameter for the "multipart" media type is - the boundary parameter, which consists of 1 to 70 characters from a - set of characters known to be very robust through mail gateways, and - NOT ending with white space. (If a boundary delimiter line appears to - end with white space, the white space must be presumed to have been - added by a gateway, and must be deleted.) It is formally specified - by the following BNF: - - boundary := 0*69 bcharsnospace - - bchars := bcharsnospace / " " - - bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / - "+" / "_" / "," / "-" / "." / - "/" / ":" / "=" / "?" - - Overall, the body of a "multipart" entity may be specified as - follows: - - dash-boundary := "--" boundary - ; boundary taken from the value of - ; boundary parameter of the - ; Content-Type field. - - multipart-body := [preamble CRLF] - dash-boundary transport-padding CRLF - body-part *encapsulation - close-delimiter transport-padding - [CRLF epilogue] - - - - - -Freed & Borenstein Standards Track [Page 22] - -RFC 2046 Media Types November 1996 - - - transport-padding := *LWSP-char - ; Composers MUST NOT generate - ; non-zero length transport - ; padding, but receivers MUST - ; be able to handle padding - ; added by message transports. - - encapsulation := delimiter transport-padding - CRLF body-part - - delimiter := CRLF dash-boundary - - close-delimiter := delimiter "--" - - preamble := discard-text - - epilogue := discard-text - - discard-text := *(*text CRLF) *text - ; May be ignored or discarded. - - body-part := MIME-part-headers [CRLF *OCTET] - ; Lines in a body-part must not start - ; with the specified dash-boundary and - ; the delimiter must not appear anywhere - ; in the body part. Note that the - ; semantics of a body-part differ from - ; the semantics of a message, as - ; described in the text. - - OCTET := - - IMPORTANT: The free insertion of linear-white-space and RFC 822 - comments between the elements shown in this BNF is NOT allowed since - this BNF does not specify a structured header field. - - NOTE: In certain transport enclaves, RFC 822 restrictions such as - the one that limits bodies to printable US-ASCII characters may not - be in force. (That is, the transport domains may exist that resemble - standard Internet mail transport as specified in RFC 821 and assumed - by RFC 822, but without certain restrictions.) The relaxation of - these restrictions should be construed as locally extending the - definition of bodies, for example to include octets outside of the - US-ASCII range, as long as these extensions are supported by the - transport and adequately documented in the Content- Transfer-Encoding - header field. However, in no event are headers (either message - headers or body part headers) allowed to contain anything other than - US-ASCII characters. - - - -Freed & Borenstein Standards Track [Page 23] - -RFC 2046 Media Types November 1996 - - - NOTE: Conspicuously missing from the "multipart" type is a notion of - structured, related body parts. It is recommended that those wishing - to provide more structured or integrated multipart messaging - facilities should define subtypes of multipart that are syntactically - identical but define relationships between the various parts. For - example, subtypes of multipart could be defined that include a - distinguished part which in turn is used to specify the relationships - between the other parts, probably referring to them by their - Content-ID field. Old implementations will not recognize the new - subtype if this approach is used, but will treat it as - multipart/mixed and will thus be able to show the user the parts that - are recognized. - -5.1.2. Handling Nested Messages and Multiparts - - The "message/rfc822" subtype defined in a subsequent section of this - document has no terminating condition other than running out of data. - Similarly, an improperly truncated "multipart" entity may not have - any terminating boundary marker, and can turn up operationally due to - mail system malfunctions. - - It is essential that such entities be handled correctly when they are - themselves imbedded inside of another "multipart" structure. MIME - implementations are therefore required to recognize outer level - boundary markers at ANY level of inner nesting. It is not sufficient - to only check for the next expected marker or other terminating - condition. - -5.1.3. Mixed Subtype - - The "mixed" subtype of "multipart" is intended for use when the body - parts are independent and need to be bundled in a particular order. - Any "multipart" subtypes that an implementation does not recognize - must be treated as being of subtype "mixed". - -5.1.4. Alternative Subtype - - The "multipart/alternative" type is syntactically identical to - "multipart/mixed", but the semantics are different. In particular, - each of the body parts is an "alternative" version of the same - information. - - Systems should recognize that the content of the various parts are - interchangeable. Systems should choose the "best" type based on the - local environment and references, in some cases even through user - interaction. As with "multipart/mixed", the order of body parts is - significant. In this case, the alternatives appear in an order of - increasing faithfulness to the original content. In general, the - - - -Freed & Borenstein Standards Track [Page 24] - -RFC 2046 Media Types November 1996 - - - best choice is the LAST part of a type supported by the recipient - system's local environment. - - "Multipart/alternative" may be used, for example, to send a message - in a fancy text format in such a way that it can easily be displayed - anywhere: - - From: Nathaniel Borenstein - To: Ned Freed - Date: Mon, 22 Mar 1993 09:41:09 -0800 (PST) - Subject: Formatted text mail - MIME-Version: 1.0 - Content-Type: multipart/alternative; boundary=boundary42 - - --boundary42 - Content-Type: text/plain; charset=us-ascii - - ... plain text version of message goes here ... - - --boundary42 - Content-Type: text/enriched - - ... RFC 1896 text/enriched version of same message - goes here ... - - --boundary42 - Content-Type: application/x-whatever - - ... fanciest version of same message goes here ... - - --boundary42-- - - In this example, users whose mail systems understood the - "application/x-whatever" format would see only the fancy version, - while other users would see only the enriched or plain text version, - depending on the capabilities of their system. - - In general, user agents that compose "multipart/alternative" entities - must place the body parts in increasing order of preference, that is, - with the preferred format last. For fancy text, the sending user - agent should put the plainest format first and the richest format - last. Receiving user agents should pick and display the last format - they are capable of displaying. In the case where one of the - alternatives is itself of type "multipart" and contains unrecognized - sub-parts, the user agent may choose either to show that alternative, - an earlier alternative, or both. - - - - - -Freed & Borenstein Standards Track [Page 25] - -RFC 2046 Media Types November 1996 - - - NOTE: From an implementor's perspective, it might seem more sensible - to reverse this ordering, and have the plainest alternative last. - However, placing the plainest alternative first is the friendliest - possible option when "multipart/alternative" entities are viewed - using a non-MIME-conformant viewer. While this approach does impose - some burden on conformant MIME viewers, interoperability with older - mail readers was deemed to be more important in this case. - - It may be the case that some user agents, if they can recognize more - than one of the formats, will prefer to offer the user the choice of - which format to view. This makes sense, for example, if a message - includes both a nicely- formatted image version and an easily-edited - text version. What is most critical, however, is that the user not - automatically be shown multiple versions of the same data. Either - the user should be shown the last recognized version or should be - given the choice. - - THE SEMANTICS OF CONTENT-ID IN MULTIPART/ALTERNATIVE: Each part of a - "multipart/alternative" entity represents the same data, but the - mappings between the two are not necessarily without information - loss. For example, information is lost when translating ODA to - PostScript or plain text. It is recommended that each part should - have a different Content-ID value in the case where the information - content of the two parts is not identical. And when the information - content is identical -- for example, where several parts of type - "message/external-body" specify alternate ways to access the - identical data -- the same Content-ID field value should be used, to - optimize any caching mechanisms that might be present on the - recipient's end. However, the Content-ID values used by the parts - should NOT be the same Content-ID value that describes the - "multipart/alternative" as a whole, if there is any such Content-ID - field. That is, one Content-ID value will refer to the - "multipart/alternative" entity, while one or more other Content-ID - values will refer to the parts inside it. - -5.1.5. Digest Subtype - - This document defines a "digest" subtype of the "multipart" Content- - Type. This type is syntactically identical to "multipart/mixed", but - the semantics are different. In particular, in a digest, the default - Content-Type value for a body part is changed from "text/plain" to - "message/rfc822". This is done to allow a more readable digest - format that is largely compatible (except for the quoting convention) - with RFC 934. - - Note: Though it is possible to specify a Content-Type value for a - body part in a digest which is other than "message/rfc822", such as a - "text/plain" part containing a description of the material in the - - - -Freed & Borenstein Standards Track [Page 26] - -RFC 2046 Media Types November 1996 - - - digest, actually doing so is undesireble. The "multipart/digest" - Content-Type is intended to be used to send collections of messages. - If a "text/plain" part is needed, it should be included as a seperate - part of a "multipart/mixed" message. - - A digest in this format might, then, look something like this: - - From: Moderator-Address - To: Recipient-List - Date: Mon, 22 Mar 1994 13:34:51 +0000 - Subject: Internet Digest, volume 42 - MIME-Version: 1.0 - Content-Type: multipart/mixed; - boundary="---- main boundary ----" - - ------ main boundary ---- - - ...Introductory text or table of contents... - - ------ main boundary ---- - Content-Type: multipart/digest; - boundary="---- next message ----" - - ------ next message ---- - - From: someone-else - Date: Fri, 26 Mar 1993 11:13:32 +0200 - Subject: my opinion - - ...body goes here ... - - ------ next message ---- - - From: someone-else-again - Date: Fri, 26 Mar 1993 10:07:13 -0500 - Subject: my different opinion - - ... another body goes here ... - - ------ next message ------ - - ------ main boundary ------ - -5.1.6. Parallel Subtype - - This document defines a "parallel" subtype of the "multipart" - Content-Type. This type is syntactically identical to - "multipart/mixed", but the semantics are different. In particular, - - - -Freed & Borenstein Standards Track [Page 27] - -RFC 2046 Media Types November 1996 - - - in a parallel entity, the order of body parts is not significant. - - A common presentation of this type is to display all of the parts - simultaneously on hardware and software that are capable of doing so. - However, composing agents should be aware that many mail readers will - lack this capability and will show the parts serially in any event. - -5.1.7. Other Multipart Subtypes - - Other "multipart" subtypes are expected in the future. MIME - implementations must in general treat unrecognized subtypes of - "multipart" as being equivalent to "multipart/mixed". - -5.2. Message Media Type - - It is frequently desirable, in sending mail, to encapsulate another - mail message. A special media type, "message", is defined to - facilitate this. In particular, the "rfc822" subtype of "message" is - used to encapsulate RFC 822 messages. - - NOTE: It has been suggested that subtypes of "message" might be - defined for forwarded or rejected messages. However, forwarded and - rejected messages can be handled as multipart messages in which the - first part contains any control or descriptive information, and a - second part, of type "message/rfc822", is the forwarded or rejected - message. Composing rejection and forwarding messages in this manner - will preserve the type information on the original message and allow - it to be correctly presented to the recipient, and hence is strongly - encouraged. - - Subtypes of "message" often impose restrictions on what encodings are - allowed. These restrictions are described in conjunction with each - specific subtype. - - Mail gateways, relays, and other mail handling agents are commonly - known to alter the top-level header of an RFC 822 message. In - particular, they frequently add, remove, or reorder header fields. - These operations are explicitly forbidden for the encapsulated - headers embedded in the bodies of messages of type "message." - -5.2.1. RFC822 Subtype - - A media type of "message/rfc822" indicates that the body contains an - encapsulated message, with the syntax of an RFC 822 message. - However, unlike top-level RFC 822 messages, the restriction that each - "message/rfc822" body must include a "From", "Date", and at least one - destination header is removed and replaced with the requirement that - at least one of "From", "Subject", or "Date" must be present. - - - -Freed & Borenstein Standards Track [Page 28] - -RFC 2046 Media Types November 1996 - - - It should be noted that, despite the use of the numbers "822", a - "message/rfc822" entity isn't restricted to material in strict - conformance to RFC822, nor are the semantics of "message/rfc822" - objects restricted to the semantics defined in RFC822. More - specifically, a "message/rfc822" message could well be a News article - or a MIME message. - - No encoding other than "7bit", "8bit", or "binary" is permitted for - the body of a "message/rfc822" entity. The message header fields are - always US-ASCII in any case, and data within the body can still be - encoded, in which case the Content-Transfer-Encoding header field in - the encapsulated message will reflect this. Non-US-ASCII text in the - headers of an encapsulated message can be specified using the - mechanisms described in RFC 2047. - -5.2.2. Partial Subtype - - The "partial" subtype is defined to allow large entities to be - delivered as several separate pieces of mail and automatically - reassembled by a receiving user agent. (The concept is similar to IP - fragmentation and reassembly in the basic Internet Protocols.) This - mechanism can be used when intermediate transport agents limit the - size of individual messages that can be sent. The media type - "message/partial" thus indicates that the body contains a fragment of - a larger entity. - - Because data of type "message" may never be encoded in base64 or - quoted-printable, a problem might arise if "message/partial" entities - are constructed in an environment that supports binary or 8bit - transport. The problem is that the binary data would be split into - multiple "message/partial" messages, each of them requiring binary - transport. If such messages were encountered at a gateway into a - 7bit transport environment, there would be no way to properly encode - them for the 7bit world, aside from waiting for all of the fragments, - reassembling the inner message, and then encoding the reassembled - data in base64 or quoted-printable. Since it is possible that - different fragments might go through different gateways, even this is - not an acceptable solution. For this reason, it is specified that - entities of type "message/partial" must always have a content- - transfer-encoding of 7bit (the default). In particular, even in - environments that support binary or 8bit transport, the use of a - content- transfer-encoding of "8bit" or "binary" is explicitly - prohibited for MIME entities of type "message/partial". This in turn - implies that the inner message must not use "8bit" or "binary" - encoding. - - - - - - -Freed & Borenstein Standards Track [Page 29] - -RFC 2046 Media Types November 1996 - - - Because some message transfer agents may choose to automatically - fragment large messages, and because such agents may use very - different fragmentation thresholds, it is possible that the pieces of - a partial message, upon reassembly, may prove themselves to comprise - a partial message. This is explicitly permitted. - - Three parameters must be specified in the Content-Type field of type - "message/partial": The first, "id", is a unique identifier, as close - to a world-unique identifier as possible, to be used to match the - fragments together. (In general, the identifier is essentially a - message-id; if placed in double quotes, it can be ANY message-id, in - accordance with the BNF for "parameter" given in RFC 2045.) The - second, "number", an integer, is the fragment number, which indicates - where this fragment fits into the sequence of fragments. The third, - "total", another integer, is the total number of fragments. This - third subfield is required on the final fragment, and is optional - (though encouraged) on the earlier fragments. Note also that these - parameters may be given in any order. - - Thus, the second piece of a 3-piece message may have either of the - following header fields: - - Content-Type: Message/Partial; number=2; total=3; - id="oc=jpbe0M2Yt4s@thumper.bellcore.com" - - Content-Type: Message/Partial; - id="oc=jpbe0M2Yt4s@thumper.bellcore.com"; - number=2 - - But the third piece MUST specify the total number of fragments: - - Content-Type: Message/Partial; number=3; total=3; - id="oc=jpbe0M2Yt4s@thumper.bellcore.com" - - Note that fragment numbering begins with 1, not 0. - - When the fragments of an entity broken up in this manner are put - together, the result is always a complete MIME entity, which may have - its own Content-Type header field, and thus may contain any other - data type. - -5.2.2.1. Message Fragmentation and Reassembly - - The semantics of a reassembled partial message must be those of the - "inner" message, rather than of a message containing the inner - message. This makes it possible, for example, to send a large audio - message as several partial messages, and still have it appear to the - recipient as a simple audio message rather than as an encapsulated - - - -Freed & Borenstein Standards Track [Page 30] - -RFC 2046 Media Types November 1996 - - - message containing an audio message. That is, the encapsulation of - the message is considered to be "transparent". - - When generating and reassembling the pieces of a "message/partial" - message, the headers of the encapsulated message must be merged with - the headers of the enclosing entities. In this process the following - rules must be observed: - - (1) Fragmentation agents must split messages at line - boundaries only. This restriction is imposed because - splits at points other than the ends of lines in turn - depends on message transports being able to preserve - the semantics of messages that don't end with a CRLF - sequence. Many transports are incapable of preserving - such semantics. - - (2) All of the header fields from the initial enclosing - message, except those that start with "Content-" and - the specific header fields "Subject", "Message-ID", - "Encrypted", and "MIME-Version", must be copied, in - order, to the new message. - - (3) The header fields in the enclosed message which start - with "Content-", plus the "Subject", "Message-ID", - "Encrypted", and "MIME-Version" fields, must be - appended, in order, to the header fields of the new - message. Any header fields in the enclosed message - which do not start with "Content-" (except for the - "Subject", "Message-ID", "Encrypted", and "MIME- - Version" fields) will be ignored and dropped. - - (4) All of the header fields from the second and any - subsequent enclosing messages are discarded by the - reassembly process. - -5.2.2.2. Fragmentation and Reassembly Example - - If an audio message is broken into two pieces, the first piece might - look something like this: - - X-Weird-Header-1: Foo - From: Bill@host.com - To: joe@otherhost.com - Date: Fri, 26 Mar 1993 12:59:38 -0500 (EST) - Subject: Audio mail (part 1 of 2) - Message-ID: - MIME-Version: 1.0 - Content-type: message/partial; id="ABC@host.com"; - - - -Freed & Borenstein Standards Track [Page 31] - -RFC 2046 Media Types November 1996 - - - number=1; total=2 - - X-Weird-Header-1: Bar - X-Weird-Header-2: Hello - Message-ID: - Subject: Audio mail - MIME-Version: 1.0 - Content-type: audio/basic - Content-transfer-encoding: base64 - - ... first half of encoded audio data goes here ... - - and the second half might look something like this: - - From: Bill@host.com - To: joe@otherhost.com - Date: Fri, 26 Mar 1993 12:59:38 -0500 (EST) - Subject: Audio mail (part 2 of 2) - MIME-Version: 1.0 - Message-ID: - Content-type: message/partial; - id="ABC@host.com"; number=2; total=2 - - ... second half of encoded audio data goes here ... - - Then, when the fragmented message is reassembled, the resulting - message to be displayed to the user should look something like this: - - X-Weird-Header-1: Foo - From: Bill@host.com - To: joe@otherhost.com - Date: Fri, 26 Mar 1993 12:59:38 -0500 (EST) - Subject: Audio mail - Message-ID: - MIME-Version: 1.0 - Content-type: audio/basic - Content-transfer-encoding: base64 - - ... first half of encoded audio data goes here ... - ... second half of encoded audio data goes here ... - - The inclusion of a "References" field in the headers of the second - and subsequent pieces of a fragmented message that references the - Message-Id on the previous piece may be of benefit to mail readers - that understand and track references. However, the generation of - such "References" fields is entirely optional. - - - - - -Freed & Borenstein Standards Track [Page 32] - -RFC 2046 Media Types November 1996 - - - Finally, it should be noted that the "Encrypted" header field has - been made obsolete by Privacy Enhanced Messaging (PEM) [RFC-1421, - RFC-1422, RFC-1423, RFC-1424], but the rules above are nevertheless - believed to describe the correct way to treat it if it is encountered - in the context of conversion to and from "message/partial" fragments. - -5.2.3. External-Body Subtype - - The external-body subtype indicates that the actual body data are not - included, but merely referenced. In this case, the parameters - describe a mechanism for accessing the external data. - - When a MIME entity is of type "message/external-body", it consists of - a header, two consecutive CRLFs, and the message header for the - encapsulated message. If another pair of consecutive CRLFs appears, - this of course ends the message header for the encapsulated message. - However, since the encapsulated message's body is itself external, it - does NOT appear in the area that follows. For example, consider the - following message: - - Content-type: message/external-body; - access-type=local-file; - name="/u/nsb/Me.jpeg" - - Content-type: image/jpeg - Content-ID: - Content-Transfer-Encoding: binary - - THIS IS NOT REALLY THE BODY! - - The area at the end, which might be called the "phantom body", is - ignored for most external-body messages. However, it may be used to - contain auxiliary information for some such messages, as indeed it is - when the access-type is "mail- server". The only access-type defined - in this document that uses the phantom body is "mail-server", but - other access-types may be defined in the future in other - specifications that use this area. - - The encapsulated headers in ALL "message/external-body" entities MUST - include a Content-ID header field to give a unique identifier by - which to reference the data. This identifier may be used for caching - mechanisms, and for recognizing the receipt of the data when the - access-type is "mail-server". - - Note that, as specified here, the tokens that describe external-body - data, such as file names and mail server commands, are required to be - in the US-ASCII character set. - - - - -Freed & Borenstein Standards Track [Page 33] - -RFC 2046 Media Types November 1996 - - - If this proves problematic in practice, a new mechanism may be - required as a future extension to MIME, either as newly defined - access-types for "message/external-body" or by some other mechanism. - - As with "message/partial", MIME entities of type "message/external- - body" MUST have a content-transfer-encoding of 7bit (the default). - In particular, even in environments that support binary or 8bit - transport, the use of a content- transfer-encoding of "8bit" or - "binary" is explicitly prohibited for entities of type - "message/external-body". - -5.2.3.1. General External-Body Parameters - - The parameters that may be used with any "message/external- body" - are: - - (1) ACCESS-TYPE -- A word indicating the supported access - mechanism by which the file or data may be obtained. - This word is not case sensitive. Values include, but - are not limited to, "FTP", "ANON-FTP", "TFTP", "LOCAL- - FILE", and "MAIL-SERVER". Future values, except for - experimental values beginning with "X-", must be - registered with IANA, as described in RFC 2048. - This parameter is unconditionally mandatory and MUST be - present on EVERY "message/external-body". - - (2) EXPIRATION -- The date (in the RFC 822 "date-time" - syntax, as extended by RFC 1123 to permit 4 digits in - the year field) after which the existence of the - external data is not guaranteed. This parameter may be - used with ANY access-type and is ALWAYS optional. - - (3) SIZE -- The size (in octets) of the data. The intent - of this parameter is to help the recipient decide - whether or not to expend the necessary resources to - retrieve the external data. Note that this describes - the size of the data in its canonical form, that is, - before any Content-Transfer-Encoding has been applied - or after the data have been decoded. This parameter - may be used with ANY access-type and is ALWAYS - optional. - - (4) PERMISSION -- A case-insensitive field that indicates - whether or not it is expected that clients might also - attempt to overwrite the data. By default, or if - permission is "read", the assumption is that they are - not, and that if the data is retrieved once, it is - never needed again. If PERMISSION is "read-write", - - - -Freed & Borenstein Standards Track [Page 34] - -RFC 2046 Media Types November 1996 - - - this assumption is invalid, and any local copy must be - considered no more than a cache. "Read" and "Read- - write" are the only defined values of permission. This - parameter may be used with ANY access-type and is - ALWAYS optional. - - The precise semantics of the access-types defined here are described - in the sections that follow. - -5.2.3.2. The 'ftp' and 'tftp' Access-Types - - An access-type of FTP or TFTP indicates that the message body is - accessible as a file using the FTP [RFC-959] or TFTP [RFC- 783] - protocols, respectively. For these access-types, the following - additional parameters are mandatory: - - (1) NAME -- The name of the file that contains the actual - body data. - - (2) SITE -- A machine from which the file may be obtained, - using the given protocol. This must be a fully - qualified domain name, not a nickname. - - (3) Before any data are retrieved, using FTP, the user will - generally need to be asked to provide a login id and a - password for the machine named by the site parameter. - For security reasons, such an id and password are not - specified as content-type parameters, but must be - obtained from the user. - - In addition, the following parameters are optional: - - (1) DIRECTORY -- A directory from which the data named by - NAME should be retrieved. - - (2) MODE -- A case-insensitive string indicating the mode - to be used when retrieving the information. The valid - values for access-type "TFTP" are "NETASCII", "OCTET", - and "MAIL", as specified by the TFTP protocol [RFC- - 783]. The valid values for access-type "FTP" are - "ASCII", "EBCDIC", "IMAGE", and "LOCALn" where "n" is a - decimal integer, typically 8. These correspond to the - representation types "A" "E" "I" and "L n" as specified - by the FTP protocol [RFC-959]. Note that "BINARY" and - "TENEX" are not valid values for MODE and that "OCTET" - or "IMAGE" or "LOCAL8" should be used instead. IF MODE - is not specified, the default value is "NETASCII" for - TFTP and "ASCII" otherwise. - - - -Freed & Borenstein Standards Track [Page 35] - -RFC 2046 Media Types November 1996 - - -5.2.3.3. The 'anon-ftp' Access-Type - - The "anon-ftp" access-type is identical to the "ftp" access type, - except that the user need not be asked to provide a name and password - for the specified site. Instead, the ftp protocol will be used with - login "anonymous" and a password that corresponds to the user's mail - address. - -5.2.3.4. The 'local-file' Access-Type - - An access-type of "local-file" indicates that the actual body is - accessible as a file on the local machine. Two additional parameters - are defined for this access type: - - (1) NAME -- The name of the file that contains the actual - body data. This parameter is mandatory for the - "local-file" access-type. - - (2) SITE -- A domain specifier for a machine or set of - machines that are known to have access to the data - file. This optional parameter is used to describe the - locality of reference for the data, that is, the site - or sites at which the file is expected to be visible. - Asterisks may be used for wildcard matching to a part - of a domain name, such as "*.bellcore.com", to indicate - a set of machines on which the data should be directly - visible, while a single asterisk may be used to - indicate a file that is expected to be universally - available, e.g., via a global file system. - -5.2.3.5. The 'mail-server' Access-Type - - The "mail-server" access-type indicates that the actual body is - available from a mail server. Two additional parameters are defined - for this access-type: - - (1) SERVER -- The addr-spec of the mail server from which - the actual body data can be obtained. This parameter - is mandatory for the "mail-server" access-type. - - (2) SUBJECT -- The subject that is to be used in the mail - that is sent to obtain the data. Note that keying mail - servers on Subject lines is NOT recommended, but such - mail servers are known to exist. This is an optional - parameter. - - - - - - -Freed & Borenstein Standards Track [Page 36] - -RFC 2046 Media Types November 1996 - - - Because mail servers accept a variety of syntaxes, some of which is - multiline, the full command to be sent to a mail server is not - included as a parameter in the content-type header field. Instead, - it is provided as the "phantom body" when the media type is - "message/external-body" and the access-type is mail-server. - - Note that MIME does not define a mail server syntax. Rather, it - allows the inclusion of arbitrary mail server commands in the phantom - body. Implementations must include the phantom body in the body of - the message it sends to the mail server address to retrieve the - relevant data. - - Unlike other access-types, mail-server access is asynchronous and - will happen at an unpredictable time in the future. For this reason, - it is important that there be a mechanism by which the returned data - can be matched up with the original "message/external-body" entity. - MIME mail servers must use the same Content-ID field on the returned - message that was used in the original "message/external-body" - entities, to facilitate such matching. - -5.2.3.6. External-Body Security Issues - - "Message/external-body" entities give rise to two important security - issues: - - (1) Accessing data via a "message/external-body" reference - effectively results in the message recipient performing - an operation that was specified by the message - originator. It is therefore possible for the message - originator to trick a recipient into doing something - they would not have done otherwise. For example, an - originator could specify a action that attempts - retrieval of material that the recipient is not - authorized to obtain, causing the recipient to - unwittingly violate some security policy. For this - reason, user agents capable of resolving external - references must always take steps to describe the - action they are to take to the recipient and ask for - explicit permisssion prior to performing it. - - The 'mail-server' access-type is particularly - vulnerable, in that it causes the recipient to send a - new message whose contents are specified by the - original message's originator. Given the potential for - abuse, any such request messages that are constructed - should contain a clear indication that they were - generated automatically (e.g. in a Comments: header - field) in an attempt to resolve a MIME - - - -Freed & Borenstein Standards Track [Page 37] - -RFC 2046 Media Types November 1996 - - - "message/external-body" reference. - - (2) MIME will sometimes be used in environments that - provide some guarantee of message integrity and - authenticity. If present, such guarantees may apply - only to the actual direct content of messages -- they - may or may not apply to data accessed through MIME's - "message/external-body" mechanism. In particular, it - may be possible to subvert certain access mechanisms - even when the messaging system itself is secure. - - It should be noted that this problem exists either with - or without the availabilty of MIME mechanisms. A - casual reference to an FTP site containing a document - in the text of a secure message brings up similar - issues -- the only difference is that MIME provides for - automatic retrieval of such material, and users may - place unwarranted trust is such automatic retrieval - mechanisms. - -5.2.3.7. Examples and Further Explanations - - When the external-body mechanism is used in conjunction with the - "multipart/alternative" media type it extends the functionality of - "multipart/alternative" to include the case where the same entity is - provided in the same format but via different accces mechanisms. - When this is done the originator of the message must order the parts - first in terms of preferred formats and then by preferred access - mechanisms. The recipient's viewer should then evaluate the list - both in terms of format and access mechanisms. - - With the emerging possibility of very wide-area file systems, it - becomes very hard to know in advance the set of machines where a file - will and will not be accessible directly from the file system. - Therefore it may make sense to provide both a file name, to be tried - directly, and the name of one or more sites from which the file is - known to be accessible. An implementation can try to retrieve remote - files using FTP or any other protocol, using anonymous file retrieval - or prompting the user for the necessary name and password. If an - external body is accessible via multiple mechanisms, the sender may - include multiple entities of type "message/external-body" within the - body parts of an enclosing "multipart/alternative" entity. - - However, the external-body mechanism is not intended to be limited to - file retrieval, as shown by the mail-server access-type. Beyond - this, one can imagine, for example, using a video server for external - references to video clips. - - - - -Freed & Borenstein Standards Track [Page 38] - -RFC 2046 Media Types November 1996 - - - The embedded message header fields which appear in the body of the - "message/external-body" data must be used to declare the media type - of the external body if it is anything other than plain US-ASCII - text, since the external body does not have a header section to - declare its type. Similarly, any Content-transfer-encoding other - than "7bit" must also be declared here. Thus a complete - "message/external-body" message, referring to an object in PostScript - format, might look like this: - - From: Whomever - To: Someone - Date: Whenever - Subject: whatever - MIME-Version: 1.0 - Message-ID: - Content-Type: multipart/alternative; boundary=42 - Content-ID: - - --42 - Content-Type: message/external-body; name="BodyFormats.ps"; - site="thumper.bellcore.com"; mode="image"; - access-type=ANON-FTP; directory="pub"; - expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" - - Content-type: application/postscript - Content-ID: - - --42 - Content-Type: message/external-body; access-type=local-file; - name="/u/nsb/writing/rfcs/RFC-MIME.ps"; - site="thumper.bellcore.com"; - expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" - - Content-type: application/postscript - Content-ID: - - --42 - Content-Type: message/external-body; - access-type=mail-server - server="listserv@bogus.bitnet"; - expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" - - Content-type: application/postscript - Content-ID: - - get RFC-MIME.DOC - - --42-- - - - -Freed & Borenstein Standards Track [Page 39] - -RFC 2046 Media Types November 1996 - - - Note that in the above examples, the default Content-transfer- - encoding of "7bit" is assumed for the external postscript data. - - Like the "message/partial" type, the "message/external-body" media - type is intended to be transparent, that is, to convey the data type - in the external body rather than to convey a message with a body of - that type. Thus the headers on the outer and inner parts must be - merged using the same rules as for "message/partial". In particular, - this means that the Content-type and Subject fields are overridden, - but the From field is preserved. - - Note that since the external bodies are not transported along with - the external body reference, they need not conform to transport - limitations that apply to the reference itself. In particular, - Internet mail transports may impose 7bit and line length limits, but - these do not automatically apply to binary external body references. - Thus a Content-Transfer-Encoding is not generally necessary, though - it is permitted. - - Note that the body of a message of type "message/external-body" is - governed by the basic syntax for an RFC 822 message. In particular, - anything before the first consecutive pair of CRLFs is header - information, while anything after it is body information, which is - ignored for most access-types. - -5.2.4. Other Message Subtypes - - MIME implementations must in general treat unrecognized subtypes of - "message" as being equivalent to "application/octet-stream". - - Future subtypes of "message" intended for use with email should be - restricted to "7bit" encoding. A type other than "message" should be - used if restriction to "7bit" is not possible. - -6. Experimental Media Type Values - - A media type value beginning with the characters "X-" is a private - value, to be used by consenting systems by mutual agreement. Any - format without a rigorous and public definition must be named with an - "X-" prefix, and publicly specified values shall never begin with - "X-". (Older versions of the widely used Andrew system use the "X- - BE2" name, so new systems should probably choose a different name.) - - In general, the use of "X-" top-level types is strongly discouraged. - Implementors should invent subtypes of the existing types whenever - possible. In many cases, a subtype of "application" will be more - appropriate than a new top-level type. - - - - -Freed & Borenstein Standards Track [Page 40] - -RFC 2046 Media Types November 1996 - - -7. Summary - - The five discrete media types provide provide a standardized - mechanism for tagging entities as "audio", "image", or several other - kinds of data. The composite "multipart" and "message" media types - allow mixing and hierarchical structuring of entities of different - types in a single message. A distinguished parameter syntax allows - further specification of data format details, particularly the - specification of alternate character sets. Additional optional - header fields provide mechanisms for certain extensions deemed - desirable by many implementors. Finally, a number of useful media - types are defined for general use by consenting user agents, notably - "message/partial" and "message/external-body". - -9. Security Considerations - - Security issues are discussed in the context of the - "application/postscript" type, the "message/external-body" type, and - in RFC 2048. Implementors should pay special attention to the - security implications of any media types that can cause the remote - execution of any actions in the recipient's environment. In such - cases, the discussion of the "application/postscript" type may serve - as a model for considering other media types with remote execution - capabilities. - - - - - - - - - - - - - - - - - - - - - - - - - - - -Freed & Borenstein Standards Track [Page 41] - -RFC 2046 Media Types November 1996 - - -9. Authors' Addresses - - For more information, the authors of this document are best contacted - via Internet mail: - - Ned Freed - Innosoft International, Inc. - 1050 East Garvey Avenue South - West Covina, CA 91790 - USA - - Phone: +1 818 919 3600 - Fax: +1 818 919 3614 - EMail: ned@innosoft.com - - - Nathaniel S. Borenstein - First Virtual Holdings - 25 Washington Avenue - Morristown, NJ 07960 - USA - - Phone: +1 201 540 8967 - Fax: +1 201 993 3032 - EMail: nsb@nsb.fv.com - - - MIME is a result of the work of the Internet Engineering Task Force - Working Group on RFC 822 Extensions. The chairman of that group, - Greg Vaudreuil, may be reached at: - - Gregory M. Vaudreuil - Octel Network Services - 17080 Dallas Parkway - Dallas, TX 75248-1905 - USA - - EMail: Greg.Vaudreuil@Octel.Com - - - - - - - - - - - - - -Freed & Borenstein Standards Track [Page 42] - -RFC 2046 Media Types November 1996 - - -Appendix A -- Collected Grammar - - This appendix contains the complete BNF grammar for all the syntax - specified by this document. - - By itself, however, this grammar is incomplete. It refers by name to - several syntax rules that are defined by RFC 822. Rather than - reproduce those definitions here, and risk unintentional differences - between the two, this document simply refers the reader to RFC 822 - for the remaining definitions. Wherever a term is undefined, it - refers to the RFC 822 definition. - - boundary := 0*69 bcharsnospace - - bchars := bcharsnospace / " " - - bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / - "+" / "_" / "," / "-" / "." / - "/" / ":" / "=" / "?" - - body-part := <"message" as defined in RFC 822, with all - header fields optional, not starting with the - specified dash-boundary, and with the - delimiter not occurring anywhere in the - body part. Note that the semantics of a - part differ from the semantics of a message, - as described in the text.> - - close-delimiter := delimiter "--" - - dash-boundary := "--" boundary - ; boundary taken from the value of - ; boundary parameter of the - ; Content-Type field. - - delimiter := CRLF dash-boundary - - discard-text := *(*text CRLF) - ; May be ignored or discarded. - - encapsulation := delimiter transport-padding - CRLF body-part - - epilogue := discard-text - - multipart-body := [preamble CRLF] - dash-boundary transport-padding CRLF - body-part *encapsulation - - - -Freed & Borenstein Standards Track [Page 43] - -RFC 2046 Media Types November 1996 - - - close-delimiter transport-padding - [CRLF epilogue] - - preamble := discard-text - - transport-padding := *LWSP-char - ; Composers MUST NOT generate - ; non-zero length transport - ; padding, but receivers MUST - ; be able to handle padding - ; added by message transports. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Freed & Borenstein Standards Track [Page 44] - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2047.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2047.txt deleted file mode 100644 index ff9a744..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2047.txt +++ /dev/null @@ -1,843 +0,0 @@ - - - - - - -Network Working Group K. Moore -Request for Comments: 2047 University of Tennessee -Obsoletes: 1521, 1522, 1590 November 1996 -Category: Standards Track - - - MIME (Multipurpose Internet Mail Extensions) Part Three: - Message Header Extensions for Non-ASCII Text - -Status of this Memo - - This document specifies an Internet standards track protocol for the - Internet community, and requests discussion and suggestions for - improvements. Please refer to the current edition of the "Internet - Official Protocol Standards" (STD 1) for the standardization state - and status of this protocol. Distribution of this memo is unlimited. - -Abstract - - STD 11, RFC 822, defines a message representation protocol specifying - considerable detail about US-ASCII message headers, and leaves the - message content, or message body, as flat US-ASCII text. This set of - documents, collectively called the Multipurpose Internet Mail - Extensions, or MIME, redefines the format of messages to allow for - - (1) textual message bodies in character sets other than US-ASCII, - - (2) an extensible set of different formats for non-textual message - bodies, - - (3) multi-part message bodies, and - - (4) textual header information in character sets other than US-ASCII. - - These documents are based on earlier work documented in RFC 934, STD - 11, and RFC 1049, but extends and revises them. Because RFC 822 said - so little about message bodies, these documents are largely - orthogonal to (rather than a revision of) RFC 822. - - This particular document is the third document in the series. It - describes extensions to RFC 822 to allow non-US-ASCII text data in - Internet mail header fields. - - - - - - - - - -Moore Standards Track [Page 1] - -RFC 2047 Message Header Extensions November 1996 - - - Other documents in this series include: - - + RFC 2045, which specifies the various headers used to describe - the structure of MIME messages. - - + RFC 2046, which defines the general structure of the MIME media - typing system and defines an initial set of media types, - - + RFC 2048, which specifies various IANA registration procedures - for MIME-related facilities, and - - + RFC 2049, which describes MIME conformance criteria and - provides some illustrative examples of MIME message formats, - acknowledgements, and the bibliography. - - These documents are revisions of RFCs 1521, 1522, and 1590, which - themselves were revisions of RFCs 1341 and 1342. An appendix in RFC - 2049 describes differences and changes from previous versions. - -1. Introduction - - RFC 2045 describes a mechanism for denoting textual body parts which - are coded in various character sets, as well as methods for encoding - such body parts as sequences of printable US-ASCII characters. This - memo describes similar techniques to allow the encoding of non-ASCII - text in various portions of a RFC 822 [2] message header, in a manner - which is unlikely to confuse existing message handling software. - - Like the encoding techniques described in RFC 2045, the techniques - outlined here were designed to allow the use of non-ASCII characters - in message headers in a way which is unlikely to be disturbed by the - quirks of existing Internet mail handling programs. In particular, - some mail relaying programs are known to (a) delete some message - header fields while retaining others, (b) rearrange the order of - addresses in To or Cc fields, (c) rearrange the (vertical) order of - header fields, and/or (d) "wrap" message headers at different places - than those in the original message. In addition, some mail reading - programs are known to have difficulty correctly parsing message - headers which, while legal according to RFC 822, make use of - backslash-quoting to "hide" special characters such as "<", ",", or - ":", or which exploit other infrequently-used features of that - specification. - - While it is unfortunate that these programs do not correctly - interpret RFC 822 headers, to "break" these programs would cause - severe operational problems for the Internet mail system. The - extensions described in this memo therefore do not rely on little- - used features of RFC 822. - - - -Moore Standards Track [Page 2] - -RFC 2047 Message Header Extensions November 1996 - - - Instead, certain sequences of "ordinary" printable ASCII characters - (known as "encoded-words") are reserved for use as encoded data. The - syntax of encoded-words is such that they are unlikely to - "accidentally" appear as normal text in message headers. - Furthermore, the characters used in encoded-words are restricted to - those which do not have special meanings in the context in which the - encoded-word appears. - - Generally, an "encoded-word" is a sequence of printable ASCII - characters that begins with "=?", ends with "?=", and has two "?"s in - between. It specifies a character set and an encoding method, and - also includes the original text encoded as graphic ASCII characters, - according to the rules for that encoding method. - - A mail composer that implements this specification will provide a - means of inputting non-ASCII text in header fields, but will - translate these fields (or appropriate portions of these fields) into - encoded-words before inserting them into the message header. - - A mail reader that implements this specification will recognize - encoded-words when they appear in certain portions of the message - header. Instead of displaying the encoded-word "as is", it will - reverse the encoding and display the original text in the designated - character set. - -NOTES - - This memo relies heavily on notation and terms defined RFC 822 and - RFC 2045. In particular, the syntax for the ABNF used in this memo - is defined in RFC 822, as well as many of the terminal or nonterminal - symbols from RFC 822 are used in the grammar for the header - extensions defined here. Among the symbols defined in RFC 822 and - referenced in this memo are: 'addr-spec', 'atom', 'CHAR', 'comment', - 'CTLs', 'ctext', 'linear-white-space', 'phrase', 'quoted-pair'. - 'quoted-string', 'SPACE', and 'word'. Successful implementation of - this protocol extension requires careful attention to the RFC 822 - definitions of these terms. - - When the term "ASCII" appears in this memo, it refers to the "7-Bit - American Standard Code for Information Interchange", ANSI X3.4-1986. - The MIME charset name for this character set is "US-ASCII". When not - specifically referring to the MIME charset name, this document uses - the term "ASCII", both for brevity and for consistency with RFC 822. - However, implementors are warned that the character set name must be - spelled "US-ASCII" in MIME message and body part headers. - - - - - - -Moore Standards Track [Page 3] - -RFC 2047 Message Header Extensions November 1996 - - - This memo specifies a protocol for the representation of non-ASCII - text in message headers. It specifically DOES NOT define any - translation between "8-bit headers" and pure ASCII headers, nor is - any such translation assumed to be possible. - -2. Syntax of encoded-words - - An 'encoded-word' is defined by the following ABNF grammar. The - notation of RFC 822 is used, with the exception that white space - characters MUST NOT appear between components of an 'encoded-word'. - - encoded-word = "=?" charset "?" encoding "?" encoded-text "?=" - - charset = token ; see section 3 - - encoding = token ; see section 4 - - token = 1* - - especials = "(" / ")" / "<" / ">" / "@" / "," / ";" / ":" / " - <"> / "/" / "[" / "]" / "?" / "." / "=" - - encoded-text = 1* - ; (but see "Use of encoded-words in message - ; headers", section 5) - - Both 'encoding' and 'charset' names are case-independent. Thus the - charset name "ISO-8859-1" is equivalent to "iso-8859-1", and the - encoding named "Q" may be spelled either "Q" or "q". - - An 'encoded-word' may not be more than 75 characters long, including - 'charset', 'encoding', 'encoded-text', and delimiters. If it is - desirable to encode more text than will fit in an 'encoded-word' of - 75 characters, multiple 'encoded-word's (separated by CRLF SPACE) may - be used. - - While there is no limit to the length of a multiple-line header - field, each line of a header field that contains one or more - 'encoded-word's is limited to 76 characters. - - The length restrictions are included both to ease interoperability - through internetwork mail gateways, and to impose a limit on the - amount of lookahead a header parser must employ (while looking for a - final ?= delimiter) before it can decide whether a token is an - "encoded-word" or something else. - - - - - -Moore Standards Track [Page 4] - -RFC 2047 Message Header Extensions November 1996 - - - IMPORTANT: 'encoded-word's are designed to be recognized as 'atom's - by an RFC 822 parser. As a consequence, unencoded white space - characters (such as SPACE and HTAB) are FORBIDDEN within an - 'encoded-word'. For example, the character sequence - - =?iso-8859-1?q?this is some text?= - - would be parsed as four 'atom's, rather than as a single 'atom' (by - an RFC 822 parser) or 'encoded-word' (by a parser which understands - 'encoded-words'). The correct way to encode the string "this is some - text" is to encode the SPACE characters as well, e.g. - - =?iso-8859-1?q?this=20is=20some=20text?= - - The characters which may appear in 'encoded-text' are further - restricted by the rules in section 5. - -3. Character sets - - The 'charset' portion of an 'encoded-word' specifies the character - set associated with the unencoded text. A 'charset' can be any of - the character set names allowed in an MIME "charset" parameter of a - "text/plain" body part, or any character set name registered with - IANA for use with the MIME text/plain content-type. - - Some character sets use code-switching techniques to switch between - "ASCII mode" and other modes. If unencoded text in an 'encoded-word' - contains a sequence which causes the charset interpreter to switch - out of ASCII mode, it MUST contain additional control codes such that - ASCII mode is again selected at the end of the 'encoded-word'. (This - rule applies separately to each 'encoded-word', including adjacent - 'encoded-word's within a single header field.) - - When there is a possibility of using more than one character set to - represent the text in an 'encoded-word', and in the absence of - private agreements between sender and recipients of a message, it is - recommended that members of the ISO-8859-* series be used in - preference to other character sets. - -4. Encodings - - Initially, the legal values for "encoding" are "Q" and "B". These - encodings are described below. The "Q" encoding is recommended for - use when most of the characters to be encoded are in the ASCII - character set; otherwise, the "B" encoding should be used. - Nevertheless, a mail reader which claims to recognize 'encoded-word's - MUST be able to accept either encoding for any character set which it - supports. - - - -Moore Standards Track [Page 5] - -RFC 2047 Message Header Extensions November 1996 - - - Only a subset of the printable ASCII characters may be used in - 'encoded-text'. Space and tab characters are not allowed, so that - the beginning and end of an 'encoded-word' are obvious. The "?" - character is used within an 'encoded-word' to separate the various - portions of the 'encoded-word' from one another, and thus cannot - appear in the 'encoded-text' portion. Other characters are also - illegal in certain contexts. For example, an 'encoded-word' in a - 'phrase' preceding an address in a From header field may not contain - any of the "specials" defined in RFC 822. Finally, certain other - characters are disallowed in some contexts, to ensure reliability for - messages that pass through internetwork mail gateways. - - The "B" encoding automatically meets these requirements. The "Q" - encoding allows a wide range of printable characters to be used in - non-critical locations in the message header (e.g., Subject), with - fewer characters available for use in other locations. - -4.1. The "B" encoding - - The "B" encoding is identical to the "BASE64" encoding defined by RFC - 2045. - -4.2. The "Q" encoding - - The "Q" encoding is similar to the "Quoted-Printable" content- - transfer-encoding defined in RFC 2045. It is designed to allow text - containing mostly ASCII characters to be decipherable on an ASCII - terminal without decoding. - - (1) Any 8-bit value may be represented by a "=" followed by two - hexadecimal digits. For example, if the character set in use - were ISO-8859-1, the "=" character would thus be encoded as - "=3D", and a SPACE by "=20". (Upper case should be used for - hexadecimal digits "A" through "F".) - - (2) The 8-bit hexadecimal value 20 (e.g., ISO-8859-1 SPACE) may be - represented as "_" (underscore, ASCII 95.). (This character may - not pass through some internetwork mail gateways, but its use - will greatly enhance readability of "Q" encoded data with mail - readers that do not support this encoding.) Note that the "_" - always represents hexadecimal 20, even if the SPACE character - occupies a different code position in the character set in use. - - (3) 8-bit values which correspond to printable ASCII characters other - than "=", "?", and "_" (underscore), MAY be represented as those - characters. (But see section 5 for restrictions.) In - particular, SPACE and TAB MUST NOT be represented as themselves - within encoded words. - - - -Moore Standards Track [Page 6] - -RFC 2047 Message Header Extensions November 1996 - - -5. Use of encoded-words in message headers - - An 'encoded-word' may appear in a message header or body part header - according to the following rules: - -(1) An 'encoded-word' may replace a 'text' token (as defined by RFC 822) - in any Subject or Comments header field, any extension message - header field, or any MIME body part field for which the field body - is defined as '*text'. An 'encoded-word' may also appear in any - user-defined ("X-") message or body part header field. - - Ordinary ASCII text and 'encoded-word's may appear together in the - same header field. However, an 'encoded-word' that appears in a - header field defined as '*text' MUST be separated from any adjacent - 'encoded-word' or 'text' by 'linear-white-space'. - -(2) An 'encoded-word' may appear within a 'comment' delimited by "(" and - ")", i.e., wherever a 'ctext' is allowed. More precisely, the RFC - 822 ABNF definition for 'comment' is amended as follows: - - comment = "(" *(ctext / quoted-pair / comment / encoded-word) ")" - - A "Q"-encoded 'encoded-word' which appears in a 'comment' MUST NOT - contain the characters "(", ")" or " - 'encoded-word' that appears in a 'comment' MUST be separated from - any adjacent 'encoded-word' or 'ctext' by 'linear-white-space'. - - It is important to note that 'comment's are only recognized inside - "structured" field bodies. In fields whose bodies are defined as - '*text', "(" and ")" are treated as ordinary characters rather than - comment delimiters, and rule (1) of this section applies. (See RFC - 822, sections 3.1.2 and 3.1.3) - -(3) As a replacement for a 'word' entity within a 'phrase', for example, - one that precedes an address in a From, To, or Cc header. The ABNF - definition for 'phrase' from RFC 822 thus becomes: - - phrase = 1*( encoded-word / word ) - - In this case the set of characters that may be used in a "Q"-encoded - 'encoded-word' is restricted to: . An 'encoded-word' that appears within a - 'phrase' MUST be separated from any adjacent 'word', 'text' or - 'special' by 'linear-white-space'. - - - - - - -Moore Standards Track [Page 7] - -RFC 2047 Message Header Extensions November 1996 - - - These are the ONLY locations where an 'encoded-word' may appear. In - particular: - - + An 'encoded-word' MUST NOT appear in any portion of an 'addr-spec'. - - + An 'encoded-word' MUST NOT appear within a 'quoted-string'. - - + An 'encoded-word' MUST NOT be used in a Received header field. - - + An 'encoded-word' MUST NOT be used in parameter of a MIME - Content-Type or Content-Disposition field, or in any structured - field body except within a 'comment' or 'phrase'. - - The 'encoded-text' in an 'encoded-word' must be self-contained; - 'encoded-text' MUST NOT be continued from one 'encoded-word' to - another. This implies that the 'encoded-text' portion of a "B" - 'encoded-word' will be a multiple of 4 characters long; for a "Q" - 'encoded-word', any "=" character that appears in the 'encoded-text' - portion will be followed by two hexadecimal characters. - - Each 'encoded-word' MUST encode an integral number of octets. The - 'encoded-text' in each 'encoded-word' must be well-formed according - to the encoding specified; the 'encoded-text' may not be continued in - the next 'encoded-word'. (For example, "=?charset?Q?=?= - =?charset?Q?AB?=" would be illegal, because the two hex digits "AB" - must follow the "=" in the same 'encoded-word'.) - - Each 'encoded-word' MUST represent an integral number of characters. - A multi-octet character may not be split across adjacent 'encoded- - word's. - - Only printable and white space character data should be encoded using - this scheme. However, since these encoding schemes allow the - encoding of arbitrary octet values, mail readers that implement this - decoding should also ensure that display of the decoded data on the - recipient's terminal will not cause unwanted side-effects. - - Use of these methods to encode non-textual data (e.g., pictures or - sounds) is not defined by this memo. Use of 'encoded-word's to - represent strings of purely ASCII characters is allowed, but - discouraged. In rare cases it may be necessary to encode ordinary - text that looks like an 'encoded-word'. - - - - - - - - - -Moore Standards Track [Page 8] - -RFC 2047 Message Header Extensions November 1996 - - -6. Support of 'encoded-word's by mail readers - -6.1. Recognition of 'encoded-word's in message headers - - A mail reader must parse the message and body part headers according - to the rules in RFC 822 to correctly recognize 'encoded-word's. - - 'encoded-word's are to be recognized as follows: - - (1) Any message or body part header field defined as '*text', or any - user-defined header field, should be parsed as follows: Beginning - at the start of the field-body and immediately following each - occurrence of 'linear-white-space', each sequence of up to 75 - printable characters (not containing any 'linear-white-space') - should be examined to see if it is an 'encoded-word' according to - the syntax rules in section 2. Any other sequence of printable - characters should be treated as ordinary ASCII text. - - (2) Any header field not defined as '*text' should be parsed - according to the syntax rules for that header field. However, - any 'word' that appears within a 'phrase' should be treated as an - 'encoded-word' if it meets the syntax rules in section 2. - Otherwise it should be treated as an ordinary 'word'. - - (3) Within a 'comment', any sequence of up to 75 printable characters - (not containing 'linear-white-space'), that meets the syntax - rules in section 2, should be treated as an 'encoded-word'. - Otherwise it should be treated as normal comment text. - - (4) A MIME-Version header field is NOT required to be present for - 'encoded-word's to be interpreted according to this - specification. One reason for this is that the mail reader is - not expected to parse the entire message header before displaying - lines that may contain 'encoded-word's. - -6.2. Display of 'encoded-word's - - Any 'encoded-word's so recognized are decoded, and if possible, the - resulting unencoded text is displayed in the original character set. - - NOTE: Decoding and display of encoded-words occurs *after* a - structured field body is parsed into tokens. It is therefore - possible to hide 'special' characters in encoded-words which, when - displayed, will be indistinguishable from 'special' characters in the - surrounding text. For this and other reasons, it is NOT generally - possible to translate a message header containing 'encoded-word's to - an unencoded form which can be parsed by an RFC 822 mail reader. - - - - -Moore Standards Track [Page 9] - -RFC 2047 Message Header Extensions November 1996 - - - When displaying a particular header field that contains multiple - 'encoded-word's, any 'linear-white-space' that separates a pair of - adjacent 'encoded-word's is ignored. (This is to allow the use of - multiple 'encoded-word's to represent long strings of unencoded text, - without having to separate 'encoded-word's where spaces occur in the - unencoded text.) - - In the event other encodings are defined in the future, and the mail - reader does not support the encoding used, it may either (a) display - the 'encoded-word' as ordinary text, or (b) substitute an appropriate - message indicating that the text could not be decoded. - - If the mail reader does not support the character set used, it may - (a) display the 'encoded-word' as ordinary text (i.e., as it appears - in the header), (b) make a "best effort" to display using such - characters as are available, or (c) substitute an appropriate message - indicating that the decoded text could not be displayed. - - If the character set being used employs code-switching techniques, - display of the encoded text implicitly begins in "ASCII mode". In - addition, the mail reader must ensure that the output device is once - again in "ASCII mode" after the 'encoded-word' is displayed. - -6.3. Mail reader handling of incorrectly formed 'encoded-word's - - It is possible that an 'encoded-word' that is legal according to the - syntax defined in section 2, is incorrectly formed according to the - rules for the encoding being used. For example: - - (1) An 'encoded-word' which contains characters which are not legal - for a particular encoding (for example, a "-" in the "B" - encoding, or a SPACE or HTAB in either the "B" or "Q" encoding), - is incorrectly formed. - - (2) Any 'encoded-word' which encodes a non-integral number of - characters or octets is incorrectly formed. - - A mail reader need not attempt to display the text associated with an - 'encoded-word' that is incorrectly formed. However, a mail reader - MUST NOT prevent the display or handling of a message because an - 'encoded-word' is incorrectly formed. - -7. Conformance - - A mail composing program claiming compliance with this specification - MUST ensure that any string of non-white-space printable ASCII - characters within a '*text' or '*ctext' that begins with "=?" and - ends with "?=" be a valid 'encoded-word'. ("begins" means: at the - - - -Moore Standards Track [Page 10] - -RFC 2047 Message Header Extensions November 1996 - - - start of the field-body, immediately following 'linear-white-space', - or immediately following a "(" for an 'encoded-word' within '*ctext'; - "ends" means: at the end of the field-body, immediately preceding - 'linear-white-space', or immediately preceding a ")" for an - 'encoded-word' within '*ctext'.) In addition, any 'word' within a - 'phrase' that begins with "=?" and ends with "?=" must be a valid - 'encoded-word'. - - A mail reading program claiming compliance with this specification - must be able to distinguish 'encoded-word's from 'text', 'ctext', or - 'word's, according to the rules in section 6, anytime they appear in - appropriate places in message headers. It must support both the "B" - and "Q" encodings for any character set which it supports. The - program must be able to display the unencoded text if the character - set is "US-ASCII". For the ISO-8859-* character sets, the mail - reading program must at least be able to display the characters which - are also in the ASCII set. - -8. Examples - - The following are examples of message headers containing 'encoded- - word's: - - From: =?US-ASCII?Q?Keith_Moore?= - To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= - CC: =?ISO-8859-1?Q?Andr=E9?= Pirard - Subject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?= - =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?= - - Note: In the first 'encoded-word' of the Subject field above, the - last "=" at the end of the 'encoded-text' is necessary because each - 'encoded-word' must be self-contained (the "=" character completes a - group of 4 base64 characters representing 2 octets). An additional - octet could have been encoded in the first 'encoded-word' (so that - the encoded-word would contain an exact multiple of 3 encoded - octets), except that the second 'encoded-word' uses a different - 'charset' than the first one. - - From: =?ISO-8859-1?Q?Olle_J=E4rnefors?= - To: ietf-822@dimacs.rutgers.edu, ojarnef@admin.kth.se - Subject: Time for ISO 10646? - - To: Dave Crocker - Cc: ietf-822@dimacs.rutgers.edu, paf@comsol.se - From: =?ISO-8859-1?Q?Patrik_F=E4ltstr=F6m?= - Subject: Re: RFC-HDR care and feeding - - - - - -Moore Standards Track [Page 11] - -RFC 2047 Message Header Extensions November 1996 - - - From: Nathaniel Borenstein - (=?iso-8859-8?b?7eXs+SDv4SDp7Oj08A==?=) - To: Greg Vaudreuil , Ned Freed - , Keith Moore - Subject: Test of new header generator - MIME-Version: 1.0 - Content-type: text/plain; charset=ISO-8859-1 - - The following examples illustrate how text containing 'encoded-word's - which appear in a structured field body. The rules are slightly - different for fields defined as '*text' because "(" and ")" are not - recognized as 'comment' delimiters. [Section 5, paragraph (1)]. - - In each of the following examples, if the same sequence were to occur - in a '*text' field, the "displayed as" form would NOT be treated as - encoded words, but be identical to the "encoded form". This is - because each of the encoded-words in the following examples is - adjacent to a "(" or ")" character. - - encoded form displayed as - --------------------------------------------------------------------- - (=?ISO-8859-1?Q?a?=) (a) - - (=?ISO-8859-1?Q?a?= b) (a b) - - Within a 'comment', white space MUST appear between an - 'encoded-word' and surrounding text. [Section 5, - paragraph (2)]. However, white space is not needed between - the initial "(" that begins the 'comment', and the - 'encoded-word'. - - - (=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=) (ab) - - White space between adjacent 'encoded-word's is not - displayed. - - (=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=) (ab) - - Even multiple SPACEs between 'encoded-word's are ignored - for the purpose of display. - - (=?ISO-8859-1?Q?a?= (ab) - =?ISO-8859-1?Q?b?=) - - Any amount of linear-space-white between 'encoded-word's, - even if it includes a CRLF followed by one or more SPACEs, - is ignored for the purposes of display. - - - -Moore Standards Track [Page 12] - -RFC 2047 Message Header Extensions November 1996 - - - (=?ISO-8859-1?Q?a_b?=) (a b) - - In order to cause a SPACE to be displayed within a portion - of encoded text, the SPACE MUST be encoded as part of the - 'encoded-word'. - - (=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?=) (a b) - - In order to cause a SPACE to be displayed between two strings - of encoded text, the SPACE MAY be encoded as part of one of - the 'encoded-word's. - -9. References - - [RFC 822] Crocker, D., "Standard for the Format of ARPA Internet Text - Messages", STD 11, RFC 822, UDEL, August 1982. - - [RFC 2049] Borenstein, N., and N. Freed, "Multipurpose Internet Mail - Extensions (MIME) Part Five: Conformance Criteria and Examples", - RFC 2049, November 1996. - - [RFC 2045] Borenstein, N., and N. Freed, "Multipurpose Internet Mail - Extensions (MIME) Part One: Format of Internet Message Bodies", - RFC 2045, November 1996. - - [RFC 2046] Borenstein N., and N. Freed, "Multipurpose Internet Mail - Extensions (MIME) Part Two: Media Types", RFC 2046, - November 1996. - - [RFC 2048] Freed, N., Klensin, J., and J. Postel, "Multipurpose - Internet Mail Extensions (MIME) Part Four: Registration - Procedures", RFC 2048, November 1996. - - - - - - - - - - - - - - - - - - - -Moore Standards Track [Page 13] - -RFC 2047 Message Header Extensions November 1996 - - -10. Security Considerations - - Security issues are not discussed in this memo. - -11. Acknowledgements - - The author wishes to thank Nathaniel Borenstein, Issac Chan, Lutz - Donnerhacke, Paul Eggert, Ned Freed, Andreas M. Kirchwitz, Olle - Jarnefors, Mike Rosin, Yutaka Sato, Bart Schaefer, and Kazuhiko - Yamamoto, for their helpful advice, insightful comments, and - illuminating questions in response to earlier versions of this - specification. - -12. Author's Address - - Keith Moore - University of Tennessee - 107 Ayres Hall - Knoxville TN 37996-1301 - - EMail: moore@cs.utk.edu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Moore Standards Track [Page 14] - -RFC 2047 Message Header Extensions November 1996 - - -Appendix - changes since RFC 1522 (in no particular order) - - + explicitly state that the MIME-Version is not requried to use - 'encoded-word's. - - + add explicit note that SPACEs and TABs are not allowed within - 'encoded-word's, explaining that an 'encoded-word' must look like an - 'atom' to an RFC822 parser.values, to be precise). - - + add examples from Olle Jarnefors (thanks!) which illustrate how - encoded-words with adjacent linear-white-space are displayed. - - + explicitly list terms defined in RFC822 and referenced in this memo - - + fix transcription typos that caused one or two lines and a couple of - characters to disappear in the resulting text, due to nroff quirks. - - + clarify that encoded-words are allowed in '*text' fields in both - RFC822 headers and MIME body part headers, but NOT as parameter - values. - - + clarify the requirement to switch back to ASCII within the encoded - portion of an 'encoded-word', for any charset that uses code switching - sequences. - - + add a note about 'encoded-word's being delimited by "(" and ")" - within a comment, but not in a *text (how bizarre!). - - + fix the Andre Pirard example to get rid of the trailing "_" after - the =E9. (no longer needed post-1342). - - + clarification: an 'encoded-word' may appear immediately following - the initial "(" or immediately before the final ")" that delimits a - comment, not just adjacent to "(" and ")" *within* *ctext. - - + add a note to explain that a "B" 'encoded-word' will always have a - multiple of 4 characters in the 'encoded-text' portion. - - + add note about the "=" in the examples - - + note that processing of 'encoded-word's occurs *after* parsing, and - some of the implications thereof. - - + explicitly state that you can't expect to translate between - 1522 and either vanilla 822 or so-called "8-bit headers". - - + explicitly state that 'encoded-word's are not valid within a - 'quoted-string'. - - - -Moore Standards Track [Page 15] - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2048.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2048.txt deleted file mode 100644 index a3b18b3..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2048.txt +++ /dev/null @@ -1,1180 +0,0 @@ - - - - - - -Network Working Group N. Freed -Request for Comments: 2048 Innosoft -BCP: 13 J. Klensin -Obsoletes: 1521, 1522, 1590 MCI -Category: Best Current Practice J. Postel - ISI - November 1996 - - - Multipurpose Internet Mail Extensions - (MIME) Part Four: - Registration Procedures - -Status of this Memo - - This document specifies an Internet Best Current Practices for the - Internet Community, and requests discussion and suggestions for - improvements. Distribution of this memo is unlimited. - -Abstract - - STD 11, RFC 822, defines a message representation protocol specifying - considerable detail about US-ASCII message headers, and leaves the - message content, or message body, as flat US-ASCII text. This set of - documents, collectively called the Multipurpose Internet Mail - Extensions, or MIME, redefines the format of messages to allow for - - (1) textual message bodies in character sets other than - US-ASCII, - - (2) an extensible set of different formats for non-textual - message bodies, - - (3) multi-part message bodies, and - - (4) textual header information in character sets other than - US-ASCII. - - These documents are based on earlier work documented in RFC 934, STD - 11, and RFC 1049, but extends and revises them. Because RFC 822 said - so little about message bodies, these documents are largely - orthogonal to (rather than a revision of) RFC 822. - - - - - - - - - -Freed, et. al. Best Current Practice [Page 1] - -RFC 2048 MIME Registration Procedures November 1996 - - - This fourth document, RFC 2048, specifies various IANA registration - procedures for the following MIME facilities: - - (1) media types, - - (2) external body access types, - - (3) content-transfer-encodings. - - Registration of character sets for use in MIME is covered elsewhere - and is no longer addressed by this document. - - These documents are revisions of RFCs 1521 and 1522, which themselves - were revisions of RFCs 1341 and 1342. An appendix in RFC 2049 - describes differences and changes from previous versions. - -Table of Contents - - 1. Introduction ......................................... 3 - 2. Media Type Registration .............................. 4 - 2.1 Registration Trees and Subtype Names ................ 4 - 2.1.1 IETF Tree ......................................... 4 - 2.1.2 Vendor Tree ....................................... 4 - 2.1.3 Personal or Vanity Tree ........................... 5 - 2.1.4 Special `x.' Tree ................................. 5 - 2.1.5 Additional Registration Trees ..................... 6 - 2.2 Registration Requirements ........................... 6 - 2.2.1 Functionality Requirement ......................... 6 - 2.2.2 Naming Requirements ............................... 6 - 2.2.3 Parameter Requirements ............................ 7 - 2.2.4 Canonicalization and Format Requirements .......... 7 - 2.2.5 Interchange Recommendations ....................... 8 - 2.2.6 Security Requirements ............................. 8 - 2.2.7 Usage and Implementation Non-requirements ......... 9 - 2.2.8 Publication Requirements .......................... 10 - 2.2.9 Additional Information ............................ 10 - 2.3 Registration Procedure .............................. 11 - 2.3.1 Present the Media Type to the Community for Review 11 - 2.3.2 IESG Approval ..................................... 12 - 2.3.3 IANA Registration ................................. 12 - 2.4 Comments on Media Type Registrations ................ 12 - 2.5 Location of Registered Media Type List .............. 12 - 2.6 IANA Procedures for Registering Media Types ......... 12 - 2.7 Change Control ...................................... 13 - 2.8 Registration Template ............................... 14 - 3. External Body Access Types ........................... 14 - 3.1 Registration Requirements ........................... 15 - 3.1.1 Naming Requirements ............................... 15 - - - -Freed, et. al. Best Current Practice [Page 2] - -RFC 2048 MIME Registration Procedures November 1996 - - - 3.1.2 Mechanism Specification Requirements .............. 15 - 3.1.3 Publication Requirements .......................... 15 - 3.1.4 Security Requirements ............................. 15 - 3.2 Registration Procedure .............................. 15 - 3.2.1 Present the Access Type to the Community .......... 16 - 3.2.2 Access Type Reviewer .............................. 16 - 3.2.3 IANA Registration ................................. 16 - 3.3 Location of Registered Access Type List ............. 16 - 3.4 IANA Procedures for Registering Access Types ........ 16 - 4. Transfer Encodings ................................... 17 - 4.1 Transfer Encoding Requirements ...................... 17 - 4.1.1 Naming Requirements ............................... 17 - 4.1.2 Algorithm Specification Requirements .............. 18 - 4.1.3 Input Domain Requirements ......................... 18 - 4.1.4 Output Range Requirements ......................... 18 - 4.1.5 Data Integrity and Generality Requirements ........ 18 - 4.1.6 New Functionality Requirements .................... 18 - 4.2 Transfer Encoding Definition Procedure .............. 19 - 4.3 IANA Procedures for Transfer Encoding Registration... 19 - 4.4 Location of Registered Transfer Encodings List ...... 19 - 5. Authors' Addresses ................................... 20 - A. Grandfathered Media Types ............................ 21 - -1. Introduction - - Recent Internet protocols have been carefully designed to be easily - extensible in certain areas. In particular, MIME [RFC 2045] is an - open-ended framework and can accommodate additional object types, - character sets, and access methods without any changes to the basic - protocol. A registration process is needed, however, to ensure that - the set of such values is developed in an orderly, well-specified, - and public manner. - - This document defines registration procedures which use the Internet - Assigned Numbers Authority (IANA) as a central registry for such - values. - - Historical Note: The registration process for media types was - initially defined in the context of the asynchronous Internet mail - environment. In this mail environment there is a need to limit the - number of possible media types to increase the likelihood of - interoperability when the capabilities of the remote mail system are - not known. As media types are used in new environments, where the - proliferation of media types is not a hindrance to interoperability, - the original procedure was excessively restrictive and had to be - generalized. - - - - - -Freed, et. al. Best Current Practice [Page 3] - -RFC 2048 MIME Registration Procedures November 1996 - - -2. Media Type Registration - - Registration of a new media type or types starts with the - construction of a registration proposal. Registration may occur in - several different registration trees, which have different - requirements as discussed below. In general, the new registration - proposal is circulated and reviewed in a fashion appropriate to the - tree involved. The media type is then registered if the proposal is - acceptable. The following sections describe the requirements and - procedures used for each of the different registration trees. - -2.1. Registration Trees and Subtype Names - - In order to increase the efficiency and flexibility of the - registration process, different structures of subtype names may be - registered to accomodate the different natural requirements for, - e.g., a subtype that will be recommended for wide support and - implementation by the Internet Community or a subtype that is used to - move files associated with proprietary software. The following - subsections define registration "trees", distinguished by the use of - faceted names (e.g., names of the form "tree.subtree...type"). Note - that some media types defined prior to this document do not conform - to the naming conventions described below. See Appendix A for a - discussion of them. - -2.1.1. IETF Tree - - The IETF tree is intended for types of general interest to the - Internet Community. Registration in the IETF tree requires approval - by the IESG and publication of the media type registration as some - form of RFC. - - Media types in the IETF tree are normally denoted by names that are - not explicitly faceted, i.e., do not contain period (".", full stop) - characters. - - The "owner" of a media type registration in the IETF tree is assumed - to be the IETF itself. Modification or alteration of the - specification requires the same level of processing (e.g. standards - track) required for the initial registration. - -2.1.2. Vendor Tree - - The vendor tree is used for media types associated with commercially - available products. "Vendor" or "producer" are construed as - equivalent and very broadly in this context. - - - - - -Freed, et. al. Best Current Practice [Page 4] - -RFC 2048 MIME Registration Procedures November 1996 - - - A registration may be placed in the vendor tree by anyone who has - need to interchange files associated with the particular product. - However, the registration formally belongs to the vendor or - organization producing the software or file format. Changes to the - specification will be made at their request, as discussed in - subsequent sections. - - Registrations in the vendor tree will be distinguished by the leading - facet "vnd.". That may be followed, at the discretion of the - registration, by either a media type name from a well-known producer - (e.g., "vnd.mudpie") or by an IANA-approved designation of the - producer's name which is then followed by a media type or product - designation (e.g., vnd.bigcompany.funnypictures). - - While public exposure and review of media types to be registered in - the vendor tree is not required, using the ietf-types list for review - is strongly encouraged to improve the quality of those - specifications. Registrations in the vendor tree may be submitted - directly to the IANA. - -2.1.3. Personal or Vanity Tree - - Registrations for media types created experimentally or as part of - products that are not distributed commercially may be registered in - the personal or vanity tree. The registrations are distinguished by - the leading facet "prs.". - - The owner of "personal" registrations and associated specifications - is the person or entity making the registration, or one to whom - responsibility has been transferred as described below. - - While public exposure and review of media types to be registered in - the personal tree is not required, using the ietf-types list for - review is strongly encouraged to improve the quality of those - specifications. Registrations in the personl tree may be submitted - directly to the IANA. - -2.1.4. Special `x.' Tree - - For convenience and symmetry with this registration scheme, media - type names with "x." as the first facet may be used for the same - purposes for which names starting in "x-" are normally used. These - types are unregistered, experimental, and should be used only with - the active agreement of the parties exchanging them. - - - - - - - -Freed, et. al. Best Current Practice [Page 5] - -RFC 2048 MIME Registration Procedures November 1996 - - - However, with the simplified registration procedures described above - for vendor and personal trees, it should rarely, if ever, be - necessary to use unregistered experimental types, and as such use of - both "x-" and "x." forms is discouraged. - -2.1.5. Additional Registration Trees - - From time to time and as required by the community, the IANA may, - with the advice and consent of the IESG, create new top-level - registration trees. It is explicitly assumed that these trees may be - created for external registration and management by well-known - permanent bodies, such as scientific societies for media types - specific to the sciences they cover. In general, the quality of - review of specifications for one of these additional registration - trees is expected to be equivalent to that which IETF would give to - registrations in its own tree. Establishment of these new trees will - be announced through RFC publication approved by the IESG. - -2.2. Registration Requirements - - Media type registration proposals are all expected to conform to - various requirements laid out in the following sections. Note that - requirement specifics sometimes vary depending on the registration - tree, again as detailed in the following sections. - -2.2.1. Functionality Requirement - - Media types must function as an actual media format: Registration of - things that are better thought of as a transfer encoding, as a - character set, or as a collection of separate entities of another - type, is not allowed. For example, although applications exist to - decode the base64 transfer encoding [RFC 2045], base64 cannot be - registered as a media type. - - This requirement applies regardless of the registration tree - involved. - -2.2.2. Naming Requirements - - All registered media types must be assigned MIME type and subtype - names. The combination of these names then serves to uniquely - identify the media type and the format of the subtype name identifies - the registration tree. - - The choice of top-level type name must take the nature of media type - involved into account. For example, media normally used for - representing still images should be a subtype of the image content - type, whereas media capable of representing audio information belongs - - - -Freed, et. al. Best Current Practice [Page 6] - -RFC 2048 MIME Registration Procedures November 1996 - - - under the audio content type. See RFC 2046 for additional information - on the basic set of top-level types and their characteristics. - - New subtypes of top-level types must conform to the restrictions of - the top-level type, if any. For example, all subtypes of the - multipart content type must use the same encapsulation syntax. - - In some cases a new media type may not "fit" under any currently - defined top-level content type. Such cases are expected to be quite - rare. However, if such a case arises a new top-level type can be - defined to accommodate it. Such a definition must be done via - standards-track RFC; no other mechanism can be used to define - additional top-level content types. - - These requirements apply regardless of the registration tree - involved. - -2.2.3. Parameter Requirements - - Media types may elect to use one or more MIME content type - parameters, or some parameters may be automatically made available to - the media type by virtue of being a subtype of a content type that - defines a set of parameters applicable to any of its subtypes. In - either case, the names, values, and meanings of any parameters must - be fully specified when a media type is registered in the IETF tree, - and should be specified as completely as possible when media types - are registered in the vendor or personal trees. - - New parameters must not be defined as a way to introduce new - functionality in types registered in the IETF tree, although new - parameters may be added to convey additional information that does - not otherwise change existing functionality. An example of this - would be a "revision" parameter to indicate a revision level of an - external specification such as JPEG. Similar behavior is encouraged - for media types registered in the vendor or personal trees but is not - required. - -2.2.4. Canonicalization and Format Requirements - - All registered media types must employ a single, canonical data - format, regardless of registration tree. - - A precise and openly available specification of the format of each - media type is required for all types registered in the IETF tree and - must at a minimum be referenced by, if it isn't actually included in, - the media type registration proposal itself. - - - - - -Freed, et. al. Best Current Practice [Page 7] - -RFC 2048 MIME Registration Procedures November 1996 - - - The specifications of format and processing particulars may or may - not be publically available for media types registered in the vendor - tree, and such registration proposals are explicitly permitted to - include only a specification of which software and version produce or - process such media types. References to or inclusion of format - specifications in registration proposals is encouraged but not - required. - - Format specifications are still required for registration in the - personal tree, but may be either published as RFCs or otherwise - deposited with IANA. The deposited specifications will meet the same - criteria as those required to register a well-known TCP port and, in - particular, need not be made public. - - Some media types involve the use of patented technology. The - registration of media types involving patented technology is - specifically permitted. However, the restrictions set forth in RFC - 1602 on the use of patented technology in standards-track protocols - must be respected when the specification of a media type is part of a - standards-track protocol. - -2.2.5. Interchange Recommendations - - Media types should, whenever possible, interoperate across as many - systems and applications as possible. However, some media types will - inevitably have problems interoperating across different platforms. - Problems with different versions, byte ordering, and specifics of - gateway handling can and will arise. - - Universal interoperability of media types is not required, but known - interoperability issues should be identified whenever possible. - Publication of a media type does not require an exhaustive review of - interoperability, and the interoperability considerations section is - subject to continuing evaluation. - - These recommendations apply regardless of the registration tree - involved. - -2.2.6. Security Requirements - - An analysis of security issues is required for for all types - registered in the IETF Tree. (This is in accordance with the basic - requirements for all IETF protocols.) A similar analysis for media - types registered in the vendor or personal trees is encouraged but - not required. However, regardless of what security analysis has or - has not been done, all descriptions of security issues must be as - accurate as possible regardless of registration tree. In particular, - a statement that there are "no security issues associated with this - - - -Freed, et. al. Best Current Practice [Page 8] - -RFC 2048 MIME Registration Procedures November 1996 - - - type" must not be confused with "the security issues associates with - this type have not been assessed". - - There is absolutely no requirement that media types registered in any - tree be secure or completely free from risks. Nevertheless, all - known security risks must be identified in the registration of a - media type, again regardless of registration tree. - - The security considerations section of all registrations is subject - to continuing evaluation and modification, and in particular may be - extended by use of the "comments on media types" mechanism described - in subsequent sections. - - Some of the issues that should be looked at in a security analysis of - a media type are: - - (1) Complex media types may include provisions for - directives that institute actions on a recipient's - files or other resources. In many cases provision is - made for originators to specify arbitrary actions in an - unrestricted fashion which may then have devastating - effects. See the registration of the - application/postscript media type in RFC 2046 for - an example of such directives and how to handle them. - - (2) Complex media types may include provisions for - directives that institute actions which, while not - directly harmful to the recipient, may result in - disclosure of information that either facilitates a - subsequent attack or else violates a recipient's - privacy in some way. Again, the registration of the - application/postscript media type illustrates how such - directives can be handled. - - (3) A media type might be targeted for applications that - require some sort of security assurance but not provide - the necessary security mechanisms themselves. For - example, a media type could be defined for storage of - confidential medical information which in turn requires - an external confidentiality service. - -2.2.7. Usage and Implementation Non-requirements - - In the asynchronous mail environment, where information on the - capabilities of the remote mail agent is frequently not available to - the sender, maximum interoperability is attained by restricting the - number of media types used to those "common" formats expected to be - widely implemented. This was asserted in the past as a reason to - - - -Freed, et. al. Best Current Practice [Page 9] - -RFC 2048 MIME Registration Procedures November 1996 - - - limit the number of possible media types and resulted in a - registration process with a significant hurdle and delay for those - registering media types. - - However, the need for "common" media types does not require limiting - the registration of new media types. If a limited set of media types - is recommended for a particular application, that should be asserted - by a separate applicability statement specific for the application - and/or environment. - - As such, universal support and implementation of a media type is NOT - a requirement for registration. If, however, a media type is - explicitly intended for limited use, this should be noted in its - registration. - -2.2.8. Publication Requirements - - Proposals for media types registered in the IETF tree must be - published as RFCs. RFC publication of vendor and personal media type - proposals is encouraged but not required. In all cases IANA will - retain copies of all media type proposals and "publish" them as part - of the media types registration tree itself. - - Other than in the IETF tree, the registration of a data type does not - imply endorsement, approval, or recommendation by IANA or IETF or - even certification that the specification is adequate. To become - Internet Standards, protocol, data objects, or whatever must go - through the IETF standards process. This is too difficult and too - lengthy a process for the convenient registration of media types. - - The IETF tree exists for media types that do require require a - substantive review and approval process with the vendor and personal - trees exist for those that do not. It is expected that applicability - statements for particular applications will be published from time to - time that recommend implementation of, and support for, media types - that have proven particularly useful in those contexts. - - As discussed above, registration of a top-level type requires - standards-track processing and, hence, RFC publication. - -2.2.9. Additional Information - - Various sorts of optional information may be included in the - specification of a media type if it is available: - - (1) Magic number(s) (length, octet values). Magic numbers - are byte sequences that are always present and thus can - be used to identify entities as being of a given media - - - -Freed, et. al. Best Current Practice [Page 10] - -RFC 2048 MIME Registration Procedures November 1996 - - - type. - - (2) File extension(s) commonly used on one or more - platforms to indicate that some file containing a given - type of media. - - (3) Macintosh File Type code(s) (4 octets) used to label - files containing a given type of media. - - Such information is often quite useful to implementors and if - available should be provided. - -2.3. Registration Procedure - - The following procedure has been implemented by the IANA for review - and approval of new media types. This is not a formal standards - process, but rather an administrative procedure intended to allow - community comment and sanity checking without excessive time delay. - For registration in the IETF tree, the normal IETF processes should - be followed, treating posting of an internet-draft and announcement - on the ietf-types list (as described in the next subsection) as a - first step. For registrations in the vendor or personal tree, the - initial review step described below may be omitted and the type - registered directly by submitting the template and an explanation - directly to IANA (at iana@iana.org). However, authors of vendor or - personal media type specifications are encouraged to seek community - review and comment whenever that is feasible. - -2.3.1. Present the Media Type to the Community for Review - - Send a proposed media type registration to the "ietf-types@iana.org" - mailing list for a two week review period. This mailing list has - been established for the purpose of reviewing proposed media and - access types. Proposed media types are not formally registered and - must not be used; the "x-" prefix specified in RFC 2045 can be used - until registration is complete. - - The intent of the public posting is to solicit comments and feedback - on the choice of type/subtype name, the unambiguity of the references - with respect to versions and external profiling information, and a - review of any interoperability or security considerations. The - submitter may submit a revised registration, or withdraw the - registration completely, at any time. - - - - - - - - -Freed, et. al. Best Current Practice [Page 11] - -RFC 2048 MIME Registration Procedures November 1996 - - -2.3.2. IESG Approval - - Media types registered in the IETF tree must be submitted to the IESG - for approval. - -2.3.3. IANA Registration - - Provided that the media type meets the requirements for media types - and has obtained approval that is necessary, the author may submit - the registration request to the IANA, which will register the media - type and make the media type registration available to the community. - -2.4. Comments on Media Type Registrations - - Comments on registered media types may be submitted by members of the - community to IANA. These comments will be passed on to the "owner" - of the media type if possible. Submitters of comments may request - that their comment be attached to the media type registration itself, - and if IANA approves of this the comment will be made accessible in - conjunction with the type registration itself. - -2.5. Location of Registered Media Type List - - Media type registrations will be posted in the anonymous FTP - directory "ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/" - and all registered media types will be listed in the periodically - issued "Assigned Numbers" RFC [currently STD 2, RFC 1700]. The media - type description and other supporting material may also be published - as an Informational RFC by sending it to "rfc-editor@isi.edu" (please - follow the instructions to RFC authors [RFC-1543]). - -2.6. IANA Procedures for Registering Media Types - - The IANA will only register media types in the IETF tree in response - to a communication from the IESG stating that a given registration - has been approved. Vendor and personal types will be registered by - the IANA automatically and without any formal review as long as the - following minimal conditions are met: - - (1) Media types must function as an actual media format. - In particular, character sets and transfer encodings - may not be registered as media types. - - (2) All media types must have properly formed type and - subtype names. All type names must be defined by a - standards-track RFC. All subtype names must be unique, - must conform to the MIME grammar for such names, and - must contain the proper tree prefix. - - - -Freed, et. al. Best Current Practice [Page 12] - -RFC 2048 MIME Registration Procedures November 1996 - - - (3) Types registered in the personal tree must either - provide a format specification or a pointer to one. - - (4) Any security considerations given must not be obviously - bogus. (It is neither possible nor necessary for the - IANA to conduct a comprehensive security review of - media type registrations. Nevertheless, IANA has the - authority to identify obviously incompetent material - and exclude it.) - -2.7. Change Control - - Once a media type has been published by IANA, the author may request - a change to its definition. The descriptions of the different - registration trees above designate the "owners" of each type of - registration. The change request follows the same procedure as the - registration request: - - (1) Publish the revised template on the ietf-types list. - - (2) Leave at least two weeks for comments. - - (3) Publish using IANA after formal review if required. - - Changes should be requested only when there are serious omission or - errors in the published specification. When review is required, a - change request may be denied if it renders entities that were valid - under the previous definition invalid under the new definition. - - The owner of a content type may pass responsibility for the content - type to another person or agency by informing IANA and the ietf-types - list; this can be done without discussion or review. - - The IESG may reassign responsibility for a media type. The most - common case of this will be to enable changes to be made to types - where the author of the registration has died, moved out of contact - or is otherwise unable to make changes that are important to the - community. - - Media type registrations may not be deleted; media types which are no - longer believed appropriate for use can be declared OBSOLETE by a - change to their "intended use" field; such media types will be - clearly marked in the lists published by IANA. - - - - - - - - -Freed, et. al. Best Current Practice [Page 13] - -RFC 2048 MIME Registration Procedures November 1996 - - -2.8. Registration Template - - To: ietf-types@iana.org - Subject: Registration of MIME media type XXX/YYY - - MIME media type name: - - MIME subtype name: - - Required parameters: - - Optional parameters: - - Encoding considerations: - - Security considerations: - - Interoperability considerations: - - Published specification: - - Applications which use this media type: - - Additional information: - - Magic number(s): - File extension(s): - Macintosh File Type Code(s): - - Person & email address to contact for further information: - - Intended usage: - - (One of COMMON, LIMITED USE or OBSOLETE) - - Author/Change controller: - - (Any other information that the author deems interesting may be - added below this line.) - -3. External Body Access Types - - RFC 2046 defines the message/external-body media type, whereby a MIME - entity can act as pointer to the actual body data in lieu of - including the data directly in the entity body. Each - message/external-body reference specifies an access type, which - determines the mechanism used to retrieve the actual body data. RFC - 2046 defines an initial set of access types, but allows for the - - - -Freed, et. al. Best Current Practice [Page 14] - -RFC 2048 MIME Registration Procedures November 1996 - - - registration of additional access types to accommodate new retrieval - mechanisms. - -3.1. Registration Requirements - - New access type specifications must conform to a number of - requirements as described below. - -3.1.1. Naming Requirements - - Each access type must have a unique name. This name appears in the - access-type parameter in the message/external-body content-type - header field, and must conform to MIME content type parameter syntax. - -3.1.2. Mechanism Specification Requirements - - All of the protocols, transports, and procedures used by a given - access type must be described, either in the specification of the - access type itself or in some other publicly available specification, - in sufficient detail for the access type to be implemented by any - competent implementor. Use of secret and/or proprietary methods in - access types are expressly prohibited. The restrictions imposed by - RFC 1602 on the standardization of patented algorithms must be - respected as well. - -3.1.3. Publication Requirements - - All access types must be described by an RFC. The RFC may be - informational rather than standards-track, although standard-track - review and approval are encouraged for all access types. - -3.1.4. Security Requirements - - Any known security issues that arise from the use of the access type - must be completely and fully described. It is not required that the - access type be secure or that it be free from risks, but that the - known risks be identified. Publication of a new access type does not - require an exhaustive security review, and the security - considerations section is subject to continuing evaluation. - Additional security considerations should be addressed by publishing - revised versions of the access type specification. - -3.2. Registration Procedure - - Registration of a new access type starts with the construction of a - draft of an RFC. - - - - - -Freed, et. al. Best Current Practice [Page 15] - -RFC 2048 MIME Registration Procedures November 1996 - - -3.2.1. Present the Access Type to the Community - - Send a proposed access type specification to the "ietf- - types@iana.org" mailing list for a two week review period. This - mailing list has been established for the purpose of reviewing - proposed access and media types. Proposed access types are not - formally registered and must not be used. - - The intent of the public posting is to solicit comments and feedback - on the access type specification and a review of any security - considerations. - -3.2.2. Access Type Reviewer - - When the two week period has passed, the access type reviewer, who is - appointed by the IETF Applications Area Director, either forwards the - request to iana@isi.edu, or rejects it because of significant - objections raised on the list. - - Decisions made by the reviewer must be posted to the ietf-types - mailing list within 14 days. Decisions made by the reviewer may be - appealed to the IESG. - -3.2.3. IANA Registration - - Provided that the access type has either passed review or has been - successfully appealed to the IESG, the IANA will register the access - type and make the registration available to the community. The - specification of the access type must also be published as an RFC. - Informational RFCs are published by sending them to "rfc- - editor@isi.edu" (please follow the instructions to RFC authors [RFC- - 1543]). - -3.3. Location of Registered Access Type List - - Access type registrations will be posted in the anonymous FTP - directory "ftp://ftp.isi.edu/in-notes/iana/assignments/access-types/" - and all registered access types will be listed in the periodically - issued "Assigned Numbers" RFC [currently RFC-1700]. - -3.4. IANA Procedures for Registering Access Types - - The identity of the access type reviewer is communicated to the IANA - by the IESG. The IANA then only acts in response to access type - definitions that either are approved by the access type reviewer and - forwarded by the reviewer to the IANA for registration, or in - response to a communication from the IESG that an access type - definition appeal has overturned the access type reviewer's ruling. - - - -Freed, et. al. Best Current Practice [Page 16] - -RFC 2048 MIME Registration Procedures November 1996 - - -4. Transfer Encodings - - Transfer encodings are tranformations applied to MIME media types - after conversion to the media type's canonical form. Transfer - encodings are used for several purposes: - - (1) Many transports, especially message transports, can - only handle data consisting of relatively short lines - of text. There can also be severe restrictions on what - characters can be used in these lines of text -- some - transports are restricted to a small subset of US-ASCII - and others cannot handle certain character sequences. - Transfer encodings are used to transform binary data - into textual form that can survive such transports. - Examples of this sort of transfer encoding include the - base64 and quoted-printable transfer encodings defined - in RFC 2045. - - (2) Image, audio, video, and even application entities are - sometimes quite large. Compression algorithms are often - quite effective in reducing the size of large entities. - Transfer encodings can be used to apply general-purpose - non-lossy compression algorithms to MIME entities. - - (3) Transport encodings can be defined as a means of - representing existing encoding formats in a MIME - context. - - IMPORTANT: The standardization of a large numbers of different - transfer encodings is seen as a significant barrier to widespread - interoperability and is expressely discouraged. Nevertheless, the - following procedure has been defined to provide a means of defining - additional transfer encodings, should standardization actually be - justified. - -4.1. Transfer Encoding Requirements - - Transfer encoding specifications must conform to a number of - requirements as described below. - -4.1.1. Naming Requirements - - Each transfer encoding must have a unique name. This name appears in - the Content-Transfer-Encoding header field and must conform to the - syntax of that field. - - - - - - -Freed, et. al. Best Current Practice [Page 17] - -RFC 2048 MIME Registration Procedures November 1996 - - -4.1.2. Algorithm Specification Requirements - - All of the algorithms used in a transfer encoding (e.g. conversion - to printable form, compression) must be described in their entirety - in the transfer encoding specification. Use of secret and/or - proprietary algorithms in standardized transfer encodings are - expressly prohibited. The restrictions imposed by RFC 1602 on the - standardization of patented algorithms must be respected as well. - -4.1.3. Input Domain Requirements - - All transfer encodings must be applicable to an arbitrary sequence of - octets of any length. Dependence on particular input forms is not - allowed. - - It should be noted that the 7bit and 8bit encodings do not conform to - this requirement. Aside from the undesireability of having - specialized encodings, the intent here is to forbid the addition of - additional encodings along the lines of 7bit and 8bit. - -4.1.4. Output Range Requirements - - There is no requirement that a particular tranfer encoding produce a - particular form of encoded output. However, the output format for - each transfer encoding must be fully and completely documented. In - particular, each specification must clearly state whether the output - format always lies within the confines of 7bit data, 8bit data, or is - simply pure binary data. - -4.1.5. Data Integrity and Generality Requirements - - All transfer encodings must be fully invertible on any platform; it - must be possible for anyone to recover the original data by - performing the corresponding decoding operation. Note that this - requirement effectively excludes all forms of lossy compression as - well as all forms of encryption from use as a transfer encoding. - -4.1.6. New Functionality Requirements - - All transfer encodings must provide some sort of new functionality. - Some degree of functionality overlap with previously defined transfer - encodings is acceptable, but any new transfer encoding must also - offer something no other transfer encoding provides. - - - - - - - - -Freed, et. al. Best Current Practice [Page 18] - -RFC 2048 MIME Registration Procedures November 1996 - - -4.2. Transfer Encoding Definition Procedure - - Definition of a new transfer encoding starts with the construction of - a draft of a standards-track RFC. The RFC must define the transfer - encoding precisely and completely, and must also provide substantial - justification for defining and standardizing a new transfer encoding. - This specification must then be presented to the IESG for - consideration. The IESG can - - (1) reject the specification outright as being - inappropriate for standardization, - - (2) approve the formation of an IETF working group to work - on the specification in accordance with IETF - procedures, or, - - (3) accept the specification as-is and put it directly on - the standards track. - - Transfer encoding specifications on the standards track follow normal - IETF rules for standards track documents. A transfer encoding is - considered to be defined and available for use once it is on the - standards track. - -4.3. IANA Procedures for Transfer Encoding Registration - - There is no need for a special procedure for registering Transfer - Encodings with the IANA. All legitimate transfer encoding - registrations must appear as a standards-track RFC, so it is the - IESG's responsibility to notify the IANA when a new transfer encoding - has been approved. - -4.4. Location of Registered Transfer Encodings List - - Transfer encoding registrations will be posted in the anonymous FTP - directory "ftp://ftp.isi.edu/in-notes/iana/assignments/transfer- - encodings/" and all registered transfer encodings will be listed in - the periodically issued "Assigned Numbers" RFC [currently RFC-1700]. - - - - - - - - - - - - - -Freed, et. al. Best Current Practice [Page 19] - -RFC 2048 MIME Registration Procedures November 1996 - - -5. Authors' Addresses - - For more information, the authors of this document are best - contacted via Internet mail: - - Ned Freed - Innosoft International, Inc. - 1050 East Garvey Avenue South - West Covina, CA 91790 - USA - - Phone: +1 818 919 3600 - Fax: +1 818 919 3614 - EMail: ned@innosoft.com - - - John Klensin - MCI - 2100 Reston Parkway - Reston, VA 22091 - - Phone: +1 703 715-7361 - Fax: +1 703 715-7436 - EMail: klensin@mci.net - - - Jon Postel - USC/Information Sciences Institute - 4676 Admiralty Way - Marina del Rey, CA 90292 - USA - - - Phone: +1 310 822 1511 - Fax: +1 310 823 6714 - EMail: Postel@ISI.EDU - - - - - - - - - - - - - - - -Freed, et. al. Best Current Practice [Page 20] - -RFC 2048 MIME Registration Procedures November 1996 - - -Appendix A -- Grandfathered Media Types - - A number of media types, registered prior to 1996, would, if - registered under the guidelines in this document, be placed into - either the vendor or personal trees. Reregistration of those types - to reflect the appropriate trees is encouraged, but not required. - Ownership and change control principles outlined in this document - apply to those types as if they had been registered in the trees - described above. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Freed, et. al. Best Current Practice [Page 21] - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2049.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2049.txt deleted file mode 100644 index 99f174b..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2049.txt +++ /dev/null @@ -1,1347 +0,0 @@ - - - - - - -Network Working Group N. Freed -Request for Comments: 2049 Innosoft -Obsoletes: 1521, 1522, 1590 N. Borenstein -Category: Standards Track First Virtual - November 1996 - - - Multipurpose Internet Mail Extensions - (MIME) Part Five: - Conformance Criteria and Examples - -Status of this Memo - - This document specifies an Internet standards track protocol for the - Internet community, and requests discussion and suggestions for - improvements. Please refer to the current edition of the "Internet - Official Protocol Standards" (STD 1) for the standardization state - and status of this protocol. Distribution of this memo is unlimited. - -Abstract - - STD 11, RFC 822, defines a message representation protocol specifying - considerable detail about US-ASCII message headers, and leaves the - message content, or message body, as flat US-ASCII text. This set of - documents, collectively called the Multipurpose Internet Mail - Extensions, or MIME, redefines the format of messages to allow for - - (1) textual message bodies in character sets other than - US-ASCII, - - (2) an extensible set of different formats for non-textual - message bodies, - - (3) multi-part message bodies, and - - (4) textual header information in character sets other than - US-ASCII. - - These documents are based on earlier work documented in RFC 934, STD - 11, and RFC 1049, but extends and revises them. Because RFC 822 said - so little about message bodies, these documents are largely - orthogonal to (rather than a revision of) RFC 822. - - The initial document in this set, RFC 2045, specifies the various - headers used to describe the structure of MIME messages. The second - document defines the general structure of the MIME media typing - system and defines an initial set of media types. The third - document, RFC 2047, describes extensions to RFC 822 to allow non-US- - - - -Freed & Borenstein Standards Track [Page 1] - -RFC 2049 MIME Conformance November 1996 - - - ASCII text data in Internet mail header fields. The fourth document, - RFC 2048, specifies various IANA registration procedures for MIME- - related facilities. This fifth and final document describes MIME - conformance criteria as well as providing some illustrative examples - of MIME message formats, acknowledgements, and the bibliography. - - These documents are revisions of RFCs 1521, 1522, and 1590, which - themselves were revisions of RFCs 1341 and 1342. Appendix B of this - document describes differences and changes from previous versions. - -Table of Contents - - 1. Introduction .......................................... 2 - 2. MIME Conformance ...................................... 2 - 3. Guidelines for Sending Email Data ..................... 6 - 4. Canonical Encoding Model .............................. 9 - 5. Summary ............................................... 12 - 6. Security Considerations ............................... 12 - 7. Authors' Addresses .................................... 12 - 8. Acknowledgements ...................................... 13 - A. A Complex Multipart Example ........................... 15 - B. Changes from RFC 1521, 1522, and 1590 ................. 16 - C. References ............................................ 20 - -1. Introduction - - The first and second documents in this set define MIME header fields - and the initial set of MIME media types. The third document - describes extensions to RFC822 formats to allow for character sets - other than US-ASCII. This document describes what portions of MIME - must be supported by a conformant MIME implementation. It also - describes various pitfalls of contemporary messaging systems as well - as the canonical encoding model MIME is based on. - -2. MIME Conformance - - The mechanisms described in these documents are open-ended. It is - definitely not expected that all implementations will support all - available media types, nor that they will all share the same - extensions. In order to promote interoperability, however, it is - useful to define the concept of "MIME-conformance" to define a - certain level of implementation that allows the useful interworking - of messages with content that differs from US-ASCII text. In this - section, we specify the requirements for such conformance. - - - - - - - -Freed & Borenstein Standards Track [Page 2] - -RFC 2049 MIME Conformance November 1996 - - - A mail user agent that is MIME-conformant MUST: - - (1) Always generate a "MIME-Version: 1.0" header field in - any message it creates. - - (2) Recognize the Content-Transfer-Encoding header field - and decode all received data encoded by either quoted- - printable or base64 implementations. The identity - transformations 7bit, 8bit, and binary must also be - recognized. - - Any non-7bit data that is sent without encoding must be - properly labelled with a content-transfer-encoding of - 8bit or binary, as appropriate. If the underlying - transport does not support 8bit or binary (as SMTP - [RFC-821] does not), the sender is required to both - encode and label data using an appropriate Content- - Transfer-Encoding such as quoted-printable or base64. - - (3) Must treat any unrecognized Content-Transfer-Encoding - as if it had a Content-Type of "application/octet- - stream", regardless of whether or not the actual - Content-Type is recognized. - - (4) Recognize and interpret the Content-Type header field, - and avoid showing users raw data with a Content-Type - field other than text. Implementations must be able - to send at least text/plain messages, with the - character set specified with the charset parameter if - it is not US-ASCII. - - (5) Ignore any content type parameters whose names they do - not recognize. - - (6) Explicitly handle the following media type values, to - at least the following extents: - - Text: - - -- Recognize and display "text" mail with the - character set "US-ASCII." - - -- Recognize other character sets at least to the - extent of being able to inform the user about what - character set the message uses. - - - - - - -Freed & Borenstein Standards Track [Page 3] - -RFC 2049 MIME Conformance November 1996 - - - -- Recognize the "ISO-8859-*" character sets to the - extent of being able to display those characters that - are common to ISO-8859-* and US-ASCII, namely all - characters represented by octet values 1-127. - - -- For unrecognized subtypes in a known character - set, show or offer to show the user the "raw" version - of the data after conversion of the content from - canonical form to local form. - - -- Treat material in an unknown character set as if - it were "application/octet-stream". - - Image, audio, and video: - - -- At a minumum provide facilities to treat any - unrecognized subtypes as if they were - "application/octet-stream". - - Application: - - -- Offer the ability to remove either of the quoted- - printable or base64 encodings defined in this - document if they were used and put the resulting - information in a user file. - - Multipart: - - -- Recognize the mixed subtype. Display all relevant - information on the message level and the body part - header level and then display or offer to display - each of the body parts individually. - - -- Recognize the "alternative" subtype, and avoid - showing the user redundant parts of - multipart/alternative mail. - - -- Recognize the "multipart/digest" subtype, - specifically using "message/rfc822" rather than - "text/plain" as the default media type for body parts - inside "multipart/digest" entities. - - -- Treat any unrecognized subtypes as if they were - "mixed". - - - - - - - -Freed & Borenstein Standards Track [Page 4] - -RFC 2049 MIME Conformance November 1996 - - - Message: - - -- Recognize and display at least the RFC822 message - encapsulation (message/rfc822) in such a way as to - preserve any recursive structure, that is, displaying - or offering to display the encapsulated data in - accordance with its media type. - - -- Treat any unrecognized subtypes as if they were - "application/octet-stream". - - (7) Upon encountering any unrecognized Content-Type field, - an implementation must treat it as if it had a media - type of "application/octet-stream" with no parameter - sub-arguments. How such data are handled is up to an - implementation, but likely options for handling such - unrecognized data include offering the user to write it - into a file (decoded from its mail transport format) or - offering the user to name a program to which the - decoded data should be passed as input. - - (8) Conformant user agents are required, if they provide - non-standard support for non-MIME messages employing - character sets other than US-ASCII, to do so on - received messages only. Conforming user agents must not - send non-MIME messages containing anything other than - US-ASCII text. - - In particular, the use of non-US-ASCII text in mail - messages without a MIME-Version field is strongly - discouraged as it impedes interoperability when sending - messages between regions with different localization - conventions. Conforming user agents MUST include proper - MIME labelling when sending anything other than plain - text in the US-ASCII character set. - - In addition, non-MIME user agents should be upgraded if - at all possible to include appropriate MIME header - information in the messages they send even if nothing - else in MIME is supported. This upgrade will have - little, if any, effect on non-MIME recipients and will - aid MIME in correctly displaying such messages. It - also provides a smooth transition path to eventual - adoption of other MIME capabilities. - - (9) Conforming user agents must ensure that any string of - non-white-space printable US-ASCII characters within a - "*text" or "*ctext" that begins with "=?" and ends with - - - -Freed & Borenstein Standards Track [Page 5] - -RFC 2049 MIME Conformance November 1996 - - - "?=" be a valid encoded-word. ("begins" means: At the - start of the field-body or immediately following - linear-white-space; "ends" means: At the end of the - field-body or immediately preceding linear-white- - space.) In addition, any "word" within a "phrase" that - begins with "=?" and ends with "?=" must be a valid - encoded-word. - - (10) Conforming user agents must be able to distinguish - encoded-words from "text", "ctext", or "word"s, - according to the rules in section 4, anytime they - appear in appropriate places in message headers. It - must support both the "B" and "Q" encodings for any - character set which it supports. The program must be - able to display the unencoded text if the character set - is "US-ASCII". For the ISO-8859-* character sets, the - mail reading program must at least be able to display - the characters which are also in the US-ASCII set. - - A user agent that meets the above conditions is said to be MIME- - conformant. The meaning of this phrase is that it is assumed to be - "safe" to send virtually any kind of properly-marked data to users of - such mail systems, because such systems will at least be able to - treat the data as undifferentiated binary, and will not simply splash - it onto the screen of unsuspecting users. - - There is another sense in which it is always "safe" to send data in a - format that is MIME-conformant, which is that such data will not - break or be broken by any known systems that are conformant with RFC - 821 and RFC 822. User agents that are MIME-conformant have the - additional guarantee that the user will not be shown data that were - never intended to be viewed as text. - -3. Guidelines for Sending Email Data - - Internet email is not a perfect, homogeneous system. Mail may become - corrupted at several stages in its travel to a final destination. - Specifically, email sent throughout the Internet may travel across - many networking technologies. Many networking and mail technologies - do not support the full functionality possible in the SMTP transport - environment. Mail traversing these systems is likely to be modified - in order that it can be transported. - - There exist many widely-deployed non-conformant MTAs in the Internet. - These MTAs, speaking the SMTP protocol, alter messages on the fly to - take advantage of the internal data structure of the hosts they are - implemented on, or are just plain broken. - - - - -Freed & Borenstein Standards Track [Page 6] - -RFC 2049 MIME Conformance November 1996 - - - The following guidelines may be useful to anyone devising a data - format (media type) that is supposed to survive the widest range of - networking technologies and known broken MTAs unscathed. Note that - anything encoded in the base64 encoding will satisfy these rules, but - that some well-known mechanisms, notably the UNIX uuencode facility, - will not. Note also that anything encoded in the Quoted-Printable - encoding will survive most gateways intact, but possibly not some - gateways to systems that use the EBCDIC character set. - - (1) Under some circumstances the encoding used for data may - change as part of normal gateway or user agent - operation. In particular, conversion from base64 to - quoted-printable and vice versa may be necessary. This - may result in the confusion of CRLF sequences with line - breaks in text bodies. As such, the persistence of - CRLF as something other than a line break must not be - relied on. - - (2) Many systems may elect to represent and store text data - using local newline conventions. Local newline - conventions may not match the RFC822 CRLF convention -- - systems are known that use plain CR, plain LF, CRLF, or - counted records. The result is that isolated CR and LF - characters are not well tolerated in general; they may - be lost or converted to delimiters on some systems, and - hence must not be relied on. - - (3) The transmission of NULs (US-ASCII value 0) is - problematic in Internet mail. (This is largely the - result of NULs being used as a termination character by - many of the standard runtime library routines in the C - programming language.) The practice of using NULs as - termination characters is so entrenched now that - messages should not rely on them being preserved. - - (4) TAB (HT) characters may be misinterpreted or may be - automatically converted to variable numbers of spaces. - This is unavoidable in some environments, notably those - not based on the US-ASCII character set. Such - conversion is STRONGLY DISCOURAGED, but it may occur, - and mail formats must not rely on the persistence of - TAB (HT) characters. - - (5) Lines longer than 76 characters may be wrapped or - truncated in some environments. Line wrapping or line - truncation imposed by mail transports is STRONGLY - DISCOURAGED, but unavoidable in some cases. - Applications which require long lines must somehow - - - -Freed & Borenstein Standards Track [Page 7] - -RFC 2049 MIME Conformance November 1996 - - - differentiate between soft and hard line breaks. (A - simple way to do this is to use the quoted-printable - encoding.) - - (6) Trailing "white space" characters (SPACE, TAB (HT)) on - a line may be discarded by some transport agents, while - other transport agents may pad lines with these - characters so that all lines in a mail file are of - equal length. The persistence of trailing white space, - therefore, must not be relied on. - - (7) Many mail domains use variations on the US-ASCII - character set, or use character sets such as EBCDIC - which contain most but not all of the US-ASCII - characters. The correct translation of characters not - in the "invariant" set cannot be depended on across - character converting gateways. For example, this - situation is a problem when sending uuencoded - information across BITNET, an EBCDIC system. Similar - problems can occur without crossing a gateway, since - many Internet hosts use character sets other than US- - ASCII internally. The definition of Printable Strings - in X.400 adds further restrictions in certain special - cases. In particular, the only characters that are - known to be consistent across all gateways are the 73 - characters that correspond to the upper and lower case - letters A-Z and a-z, the 10 digits 0-9, and the - following eleven special characters: - - "'" (US-ASCII decimal value 39) - "(" (US-ASCII decimal value 40) - ")" (US-ASCII decimal value 41) - "+" (US-ASCII decimal value 43) - "," (US-ASCII decimal value 44) - "-" (US-ASCII decimal value 45) - "." (US-ASCII decimal value 46) - "/" (US-ASCII decimal value 47) - ":" (US-ASCII decimal value 58) - "=" (US-ASCII decimal value 61) - "?" (US-ASCII decimal value 63) - - A maximally portable mail representation will confine - itself to relatively short lines of text in which the - only meaningful characters are taken from this set of - 73 characters. The base64 encoding follows this rule. - - (8) Some mail transport agents will corrupt data that - includes certain literal strings. In particular, a - - - -Freed & Borenstein Standards Track [Page 8] - -RFC 2049 MIME Conformance November 1996 - - - period (".") alone on a line is known to be corrupted - by some (incorrect) SMTP implementations, and a line - that starts with the five characters "From " (the fifth - character is a SPACE) are commonly corrupted as well. - A careful composition agent can prevent these - corruptions by encoding the data (e.g., in the quoted- - printable encoding using "=46rom " in place of "From " - at the start of a line, and "=2E" in place of "." alone - on a line). - - Please note that the above list is NOT a list of recommended - practices for MTAs. RFC 821 MTAs are prohibited from altering the - character of white space or wrapping long lines. These BAD and - invalid practices are known to occur on established networks, and - implementations should be robust in dealing with the bad effects they - can cause. - -4. Canonical Encoding Model - - There was some confusion, in earlier versions of these documents, - regarding the model for when email data was to be converted to - canonical form and encoded, and in particular how this process would - affect the treatment of CRLFs, given that the representation of - newlines varies greatly from system to system. For this reason, a - canonical model for encoding is presented below. - - The process of composing a MIME entity can be modeled as being done - in a number of steps. Note that these steps are roughly similar to - those steps used in PEM [RFC-1421] and are performed for each - "innermost level" body: - - (1) Creation of local form. - - The body to be transmitted is created in the system's - native format. The native character set is used and, - where appropriate, local end of line conventions are - used as well. The body may be a UNIX-style text file, - or a Sun raster image, or a VMS indexed file, or audio - data in a system-dependent format stored only in - memory, or anything else that corresponds to the local - model for the representation of some form of - information. Fundamentally, the data is created in the - "native" form that corresponds to the type specified by - the media type. - - - - - - - -Freed & Borenstein Standards Track [Page 9] - -RFC 2049 MIME Conformance November 1996 - - - (2) Conversion to canonical form. - - The entire body, including "out-of-band" information - such as record lengths and possibly file attribute - information, is converted to a universal canonical - form. The specific media type of the body as well as - its associated attributes dictate the nature of the - canonical form that is used. Conversion to the proper - canonical form may involve character set conversion, - transformation of audio data, compression, or various - other operations specific to the various media types. - If character set conversion is involved, however, care - must be taken to understand the semantics of the media - type, which may have strong implications for any - character set conversion, e.g. with regard to - syntactically meaningful characters in a text subtype - other than "plain". - - For example, in the case of text/plain data, the text - must be converted to a supported character set and - lines must be delimited with CRLF delimiters in - accordance with RFC 822. Note that the restriction on - line lengths implied by RFC 822 is eliminated if the - next step employs either quoted-printable or base64 - encoding. - - (3) Apply transfer encoding. - - A Content-Transfer-Encoding appropriate for this body - is applied. Note that there is no fixed relationship - between the media type and the transfer encoding. In - particular, it may be appropriate to base the choice of - base64 or quoted-printable on character frequency - counts which are specific to a given instance of a - body. - - (4) Insertion into entity. - - The encoded body is inserted into a MIME entity with - appropriate headers. The entity is then inserted into - the body of a higher-level entity (message or - multipart) as needed. - - Conversion from entity form to local form is accomplished by - reversing these steps. Note that reversal of these steps may produce - differing results since there is no guarantee that the original and - final local forms are the same. - - - - -Freed & Borenstein Standards Track [Page 10] - -RFC 2049 MIME Conformance November 1996 - - - It is vital to note that these steps are only a model; they are - specifically NOT a blueprint for how an actual system would be built. - In particular, the model fails to account for two common designs: - - (1) In many cases the conversion to a canonical form prior - to encoding will be subsumed into the encoder itself, - which understands local formats directly. For example, - the local newline convention for text bodies might be - carried through to the encoder itself along with - knowledge of what that format is. - - (2) The output of the encoders may have to pass through one - or more additional steps prior to being transmitted as - a message. As such, the output of the encoder may not - be conformant with the formats specified by RFC 822. - In particular, once again it may be appropriate for the - converter's output to be expressed using local newline - conventions rather than using the standard RFC 822 CRLF - delimiters. - - Other implementation variations are conceivable as well. The vital - aspect of this discussion is that, in spite of any optimizations, - collapsings of required steps, or insertion of additional processing, - the resulting messages must be consistent with those produced by the - model described here. For example, a message with the following - header fields: - - Content-type: text/foo; charset=bar - Content-Transfer-Encoding: base64 - - must be first represented in the text/foo form, then (if necessary) - represented in the "bar" character set, and finally transformed via - the base64 algorithm into a mail-safe form. - - NOTE: Some confusion has been caused by systems that represent - messages in a format which uses local newline conventions which - differ from the RFC822 CRLF convention. It is important to note that - these formats are not canonical RFC822/MIME. These formats are - instead *encodings* of RFC822, where CRLF sequences in the canonical - representation of the message are encoded as the local newline - convention. Note that formats which encode CRLF sequences as, for - example, LF are not capable of representing MIME messages containing - binary data which contains LF octets not part of CRLF line separation - sequences. - - - - - - - -Freed & Borenstein Standards Track [Page 11] - -RFC 2049 MIME Conformance November 1996 - - -5. Summary - - This document defines what is meant by MIME Conformance. It also - details various problems known to exist in the Internet email system - and how to use MIME to overcome them. Finally, it describes MIME's - canonical encoding model. - -6. Security Considerations - - Security issues are discussed in the second document in this set, RFC - 2046. - -7. Authors' Addresses - - For more information, the authors of this document are best contacted - via Internet mail: - - Ned Freed - Innosoft International, Inc. - 1050 East Garvey Avenue South - West Covina, CA 91790 - USA - - Phone: +1 818 919 3600 - Fax: +1 818 919 3614 - EMail: ned@innosoft.com - - Nathaniel S. Borenstein - First Virtual Holdings - 25 Washington Avenue - Morristown, NJ 07960 - USA - - Phone: +1 201 540 8967 - Fax: +1 201 993 3032 - EMail: nsb@nsb.fv.com - - MIME is a result of the work of the Internet Engineering Task Force - Working Group on RFC 822 Extensions. The chairman of that group, - Greg Vaudreuil, may be reached at: - - Gregory M. Vaudreuil - Octel Network Services - 17080 Dallas Parkway - Dallas, TX 75248-1905 - USA - - EMail: Greg.Vaudreuil@Octel.Com - - - -Freed & Borenstein Standards Track [Page 12] - -RFC 2049 MIME Conformance November 1996 - - -8. Acknowledgements - - This document is the result of the collective effort of a large - number of people, at several IETF meetings, on the IETF-SMTP and - IETF-822 mailing lists, and elsewhere. Although any enumeration - seems doomed to suffer from egregious omissions, the following are - among the many contributors to this effort: - - Harald Tveit Alvestrand Marc Andreessen - Randall Atkinson Bob Braden - Philippe Brandon Brian Capouch - Kevin Carosso Uhhyung Choi - Peter Clitherow Dave Collier-Brown - Cristian Constantinof John Coonrod - Mark Crispin Dave Crocker - Stephen Crocker Terry Crowley - Walt Daniels Jim Davis - Frank Dawson Axel Deininger - Hitoshi Doi Kevin Donnelly - Steve Dorner Keith Edwards - Chris Eich Dana S. Emery - Johnny Eriksson Craig Everhart - Patrik Faltstrom Erik E. Fair - Roger Fajman Alain Fontaine - Martin Forssen James M. Galvin - Stephen Gildea Philip Gladstone - Thomas Gordon Keld Simonsen - Terry Gray Phill Gross - James Hamilton David Herron - Mark Horton Bruce Howard - Bill Janssen Olle Jarnefors - Risto Kankkunen Phil Karn - Alan Katz Tim Kehres - Neil Katin Steve Kille - Kyuho Kim Anders Klemets - John Klensin Valdis Kletniek - Jim Knowles Stev Knowles - Bob Kummerfeld Pekka Kytolaakso - Stellan Lagerstrom Vincent Lau - Timo Lehtinen Donald Lindsay - Warner Losh Carlyn Lowery - Laurence Lundblade Charles Lynn - John R. MacMillan Larry Masinter - Rick McGowan Michael J. McInerny - Leo Mclaughlin Goli Montaser-Kohsari - Tom Moore John Gardiner Myers - Erik Naggum Mark Needleman - Chris Newman John Noerenberg - - - -Freed & Borenstein Standards Track [Page 13] - -RFC 2049 MIME Conformance November 1996 - - - Mats Ohrman Julian Onions - Michael Patton David J. Pepper - Erik van der Poel Blake C. Ramsdell - Christer Romson Luc Rooijakkers - Marshall T. Rose Jonathan Rosenberg - Guido van Rossum Jan Rynning - Harri Salminen Michael Sanderson - Yutaka Sato Markku Savela - Richard Alan Schafer Masahiro Sekiguchi - Mark Sherman Bob Smart - Peter Speck Henry Spencer - Einar Stefferud Michael Stein - Klaus Steinberger Peter Svanberg - James Thompson Steve Uhler - Stuart Vance Peter Vanderbilt - Greg Vaudreuil Ed Vielmetti - Larry W. Virden Ryan Waldron - Rhys Weatherly Jay Weber - Dave Wecker Wally Wedel - Sven-Ove Westberg Brian Wideen - John Wobus Glenn Wright - Rayan Zachariassen David Zimmerman - - The authors apologize for any omissions from this list, which are - certainly unintentional. - - - - - - - - - - - - - - - - - - - - - - - - - - -Freed & Borenstein Standards Track [Page 14] - -RFC 2049 MIME Conformance November 1996 - - -Appendix A -- A Complex Multipart Example - - What follows is the outline of a complex multipart message. This - message contains five parts that are to be displayed serially: two - introductory plain text objects, an embedded multipart message, a - text/enriched object, and a closing encapsulated text message in a - non-ASCII character set. The embedded multipart message itself - contains two objects to be displayed in parallel, a picture and an - audio fragment. - - MIME-Version: 1.0 - From: Nathaniel Borenstein - To: Ned Freed - Date: Fri, 07 Oct 1994 16:15:05 -0700 (PDT) - Subject: A multipart example - Content-Type: multipart/mixed; - boundary=unique-boundary-1 - - This is the preamble area of a multipart message. - Mail readers that understand multipart format - should ignore this preamble. - - If you are reading this text, you might want to - consider changing to a mail reader that understands - how to properly display multipart messages. - - --unique-boundary-1 - - ... Some text appears here ... - - [Note that the blank between the boundary and the start - of the text in this part means no header fields were - given and this is text in the US-ASCII character set. - It could have been done with explicit typing as in the - next part.] - - --unique-boundary-1 - Content-type: text/plain; charset=US-ASCII - - This could have been part of the previous part, but - illustrates explicit versus implicit typing of body - parts. - - --unique-boundary-1 - Content-Type: multipart/parallel; boundary=unique-boundary-2 - - --unique-boundary-2 - Content-Type: audio/basic - - - -Freed & Borenstein Standards Track [Page 15] - -RFC 2049 MIME Conformance November 1996 - - - Content-Transfer-Encoding: base64 - - ... base64-encoded 8000 Hz single-channel - mu-law-format audio data goes here ... - - --unique-boundary-2 - Content-Type: image/jpeg - Content-Transfer-Encoding: base64 - - ... base64-encoded image data goes here ... - - --unique-boundary-2-- - - --unique-boundary-1 - Content-type: text/enriched - - This is enriched. - as defined in RFC 1896 - - Isn't it - cool? - - --unique-boundary-1 - Content-Type: message/rfc822 - - From: (mailbox in US-ASCII) - To: (address in US-ASCII) - Subject: (subject in US-ASCII) - Content-Type: Text/plain; charset=ISO-8859-1 - Content-Transfer-Encoding: Quoted-printable - - ... Additional text in ISO-8859-1 goes here ... - - --unique-boundary-1-- - -Appendix B -- Changes from RFC 1521, 1522, and 1590 - - These documents are a revision of RFC 1521, 1522, and 1590. For the - convenience of those familiar with the earlier documents, the changes - from those documents are summarized in this appendix. For further - history, note that Appendix H in RFC 1521 specified how that document - differed from its predecessor, RFC 1341. - - (1) This document has been completely reformatted and split - into multiple documents. This was done to improve the - quality of the plain text version of this document, - which is required to be the reference copy. - - - - -Freed & Borenstein Standards Track [Page 16] - -RFC 2049 MIME Conformance November 1996 - - - (2) BNF describing the overall structure of MIME object - headers has been added. This is a documentation change - only -- the underlying syntax has not changed in any - way. - - (3) The specific BNF for the seven media types in MIME has - been removed. This BNF was incorrect, incomplete, amd - inconsistent with the type-indendependent BNF. And - since the type-independent BNF already fully specifies - the syntax of the various MIME headers, the type- - specific BNF was, in the final analysis, completely - unnecessary and caused more problems than it solved. - - (4) The more specific "US-ASCII" character set name has - replaced the use of the informal term ASCII in many - parts of these documents. - - (5) The informal concept of a primary subtype has been - removed. - - (6) The term "object" was being used inconsistently. The - definition of this term has been clarified, along with - the related terms "body", "body part", and "entity", - and usage has been corrected where appropriate. - - (7) The BNF for the multipart media type has been - rearranged to make it clear that the CRLF preceeding - the boundary marker is actually part of the marker - itself rather than the preceeding body part. - - (8) The prose and BNF describing the multipart media type - have been changed to make it clear that the body parts - within a multipart object MUST NOT contain any lines - beginning with the boundary parameter string. - - (9) In the rules on reassembling "message/partial" MIME - entities, "Subject" is added to the list of headers to - take from the inner message, and the example is - modified to clarify this point. - - (10) "Message/partial" fragmenters are restricted to - splitting MIME objects only at line boundaries. - - (11) In the discussion of the application/postscript type, - an additional paragraph has been added warning about - possible interoperability problems caused by embedding - of binary data inside a PostScript MIME entity. - - - - -Freed & Borenstein Standards Track [Page 17] - -RFC 2049 MIME Conformance November 1996 - - - (12) Added a clarifying note to the basic syntax rules for - the Content-Type header field to make it clear that the - following two forms: - - Content-type: text/plain; charset=us-ascii (comment) - - Content-type: text/plain; charset="us-ascii" - - are completely equivalent. - - (13) The following sentence has been removed from the - discussion of the MIME-Version header: "However, - conformant software is encouraged to check the version - number and at least warn the user if an unrecognized - MIME-version is encountered." - - (14) A typo was fixed that said "application/external-body" - instead of "message/external-body". - - (15) The definition of a character set has been reorganized - to make the requirements clearer. - - (16) The definition of the "image/gif" media type has been - moved to a separate document. This change was made - because of potential conflicts with IETF rules - governing the standardization of patented technology. - - (17) The definitions of "7bit" and "8bit" have been - tightened so that use of bare CR, LF can only be used - as end-of-line sequences. The document also no longer - requires that NUL characters be preserved, which brings - MIME into alignment with real-world implementations. - - (18) The definition of canonical text in MIME has been - tightened so that line breaks must be represented by a - CRLF sequence. CR and LF characters are not allowed - outside of this usage. The definition of quoted- - printable encoding has been altered accordingly. - - (19) The definition of the quoted-printable encoding now - includes a number of suggestions for how quoted- - printable encoders might best handle improperly encoded - material. - - (20) Prose was added to clarify the use of the "7bit", - "8bit", and "binary" transfer-encodings on multipart or - message entities encapsulating "8bit" or "binary" data. - - - - -Freed & Borenstein Standards Track [Page 18] - -RFC 2049 MIME Conformance November 1996 - - - (21) In the section on MIME Conformance, "multipart/digest" - support was added to the list of requirements for - minimal MIME conformance. Also, the requirement for - "message/rfc822" support were strengthened to clarify - the importance of recognizing recursive structure. - - (22) The various restrictions on subtypes of "message" are - now specified entirely on a subtype by subtype basis. - - (23) The definition of "message/rfc822" was changed to - indicate that at least one of the "From", "Subject", or - "Date" headers must be present. - - (24) The required handling of unrecognized subtypes as - "application/octet-stream" has been made more explicit - in both the type definitions sections and the - conformance guidelines. - - (25) Examples using text/richtext were changed to - text/enriched. - - (26) The BNF definition of subtype has been changed to make - it clear that either an IANA registered subtype or a - nonstandard "X-" subtype must be used in a Content-Type - header field. - - (27) MIME media types that are simply registered for use and - those that are standardized by the IETF are now - distinguished in the MIME BNF. - - (28) All of the various MIME registration procedures have - been extensively revised. IANA registration procedures - for character sets have been moved to a separate - document that is no included in this set of documents. - - (29) The use of escape and shift mechanisms in the US-ASCII - and ISO-8859-X character sets these documents define - have been clarified: Such mechanisms should never be - used in conjunction with these character sets and their - effect if they are used is undefined. - - (30) The definition of the AFS access-type for - message/external-body has been removed. - - (31) The handling of the combination of - multipart/alternative and message/external-body is now - specifically addressed. - - - - -Freed & Borenstein Standards Track [Page 19] - -RFC 2049 MIME Conformance November 1996 - - - (32) Security issues specific to message/external-body are - now discussed in some detail. - -Appendix C -- References - - [ATK] - Borenstein, Nathaniel S., Multimedia Applications - Development with the Andrew Toolkit, Prentice-Hall, 1990. - - [ISO-2022] - International Standard -- Information Processing -- - Character Code Structure and Extension Techniques, - ISO/IEC 2022:1994, 4th ed. - - [ISO-8859] - International Standard -- Information Processing -- 8-bit - Single-Byte Coded Graphic Character Sets - - Part 1: Latin Alphabet No. 1, ISO 8859-1:1987, 1st ed. - - Part 2: Latin Alphabet No. 2, ISO 8859-2:1987, 1st ed. - - Part 3: Latin Alphabet No. 3, ISO 8859-3:1988, 1st ed. - - Part 4: Latin Alphabet No. 4, ISO 8859-4:1988, 1st ed. - - Part 5: Latin/Cyrillic Alphabet, ISO 8859-5:1988, 1st - ed. - - Part 6: Latin/Arabic Alphabet, ISO 8859-6:1987, 1st ed. - - Part 7: Latin/Greek Alphabet, ISO 8859-7:1987, 1st ed. - - Part 8: Latin/Hebrew Alphabet, ISO 8859-8:1988, 1st ed. - - Part 9: Latin Alphabet No. 5, ISO/IEC 8859-9:1989, 1st - ed. - International Standard -- Information Technology -- 8-bit - Single-Byte Coded Graphic Character Sets - - Part 10: Latin Alphabet No. 6, ISO/IEC 8859-10:1992, - 1st ed. - - [ISO-646] - International Standard -- Information Technology -- ISO - 7-bit Coded Character Set for Information Interchange, - ISO 646:1991, 3rd ed.. - - [JPEG] - JPEG Draft Standard ISO 10918-1 CD. - - [MPEG] - Video Coding Draft Standard ISO 11172 CD, ISO - IEC/JTC1/SC2/WG11 (Motion Picture Experts Group), May, - 1991. - - - - - - -Freed & Borenstein Standards Track [Page 20] - -RFC 2049 MIME Conformance November 1996 - - - [PCM] - CCITT, Fascicle III.4 - Recommendation G.711, "Pulse Code - Modulation (PCM) of Voice Frequencies", Geneva, 1972. - - [POSTSCRIPT] - Adobe Systems, Inc., PostScript Language Reference - Manual, Addison-Wesley, 1985. - - [POSTSCRIPT2] - Adobe Systems, Inc., PostScript Language Reference - Manual, Addison-Wesley, Second Ed., 1990. - - [RFC-783] - Sollins, K.R., "TFTP Protocol (revision 2)", RFC-783, - MIT, June 1981. - - [RFC-821] - Postel, J.B., "Simple Mail Transfer Protocol", STD 10, - RFC 821, USC/Information Sciences Institute, August 1982. - - [RFC-822] - Crocker, D., "Standard for the Format of ARPA Internet - Text Messages", STD 11, RFC 822, UDEL, August 1982. - - [RFC-934] - Rose, M. and E. Stefferud, "Proposed Standard for Message - Encapsulation", RFC 934, Delaware and NMA, January 1985. - - [RFC-959] - Postel, J. and J. Reynolds, "File Transfer Protocol", STD - 9, RFC 959, USC/Information Sciences Institute, October - 1985. - - [RFC-1049] - Sirbu, M., "Content-Type Header Field for Internet - Messages", RFC 1049, CMU, March 1988. - - [RFC-1154] - Robinson, D., and R. Ullmann, "Encoding Header Field for - Internet Messages", RFC 1154, Prime Computer, Inc., April - 1990. - - [RFC-1341] - Borenstein, N., and N. Freed, "MIME (Multipurpose - Internet Mail Extensions): Mechanisms for Specifying and - Describing the Format of Internet Message Bodies", RFC - 1341, Bellcore, Innosoft, June 1992. - - - - -Freed & Borenstein Standards Track [Page 21] - -RFC 2049 MIME Conformance November 1996 - - - [RFC-1342] - Moore, K., "Representation of Non-Ascii Text in Internet - Message Headers", RFC 1342, University of Tennessee, June - 1992. - - [RFC-1344] - Borenstein, N., "Implications of MIME for Internet Mail - Gateways", RFC 1344, Bellcore, June 1992. - - [RFC-1345] - Simonsen, K., "Character Mnemonics & Character Sets", RFC - 1345, Rationel Almen Planlaegning, June 1992. - - [RFC-1421] - Linn, J., "Privacy Enhancement for Internet Electronic - Mail: Part I -- Message Encryption and Authentication - Procedures", RFC 1421, IAB IRTF PSRG, IETF PEM WG, - February 1993. - - [RFC-1422] - Kent, S., "Privacy Enhancement for Internet Electronic - Mail: Part II -- Certificate-Based Key Management", RFC - 1422, IAB IRTF PSRG, IETF PEM WG, February 1993. - - [RFC-1423] - Balenson, D., "Privacy Enhancement for Internet - Electronic Mail: Part III -- Algorithms, Modes, and - Identifiers", IAB IRTF PSRG, IETF PEM WG, February 1993. - - [RFC-1424] - Kaliski, B., "Privacy Enhancement for Internet Electronic - Mail: Part IV -- Key Certification and Related - Services", IAB IRTF PSRG, IETF PEM WG, February 1993. - - [RFC-1521] - Borenstein, N., and Freed, N., "MIME (Multipurpose - Internet Mail Extensions): Mechanisms for Specifying and - Describing the Format of Internet Message Bodies", RFC - 1521, Bellcore, Innosoft, September, 1993. - - [RFC-1522] - Moore, K., "Representation of Non-ASCII Text in Internet - Message Headers", RFC 1522, University of Tennessee, - September 1993. - - - - - - - -Freed & Borenstein Standards Track [Page 22] - -RFC 2049 MIME Conformance November 1996 - - - [RFC-1524] - Borenstein, N., "A User Agent Configuration Mechanism for - Multimedia Mail Format Information", RFC 1524, Bellcore, - September 1993. - - [RFC-1543] - Postel, J., "Instructions to RFC Authors", RFC 1543, - USC/Information Sciences Institute, October 1993. - - [RFC-1556] - Nussbacher, H., "Handling of Bi-directional Texts in - MIME", RFC 1556, Israeli Inter-University Computer - Center, December 1993. - - [RFC-1590] - Postel, J., "Media Type Registration Procedure", RFC - 1590, USC/Information Sciences Institute, March 1994. - - [RFC-1602] - Internet Architecture Board, Internet Engineering - Steering Group, Huitema, C., Gross, P., "The Internet - Standards Process -- Revision 2", March 1994. - - [RFC-1652] - Klensin, J., (WG Chair), Freed, N., (Editor), Rose, M., - Stefferud, E., and Crocker, D., "SMTP Service Extension - for 8bit-MIME transport", RFC 1652, United Nations - University, Innosoft, Dover Beach Consulting, Inc., - Network Management Associates, Inc., The Branch Office, - March 1994. - - [RFC-1700] - Reynolds, J. and J. Postel, "Assigned Numbers", STD 2, - RFC 1700, USC/Information Sciences Institute, October - 1994. - - [RFC-1741] - Faltstrom, P., Crocker, D., and Fair, E., "MIME Content - Type for BinHex Encoded Files", December 1994. - - [RFC-1896] - Resnick, P., and A. Walker, "The text/enriched MIME - Content-type", RFC 1896, February, 1996. - - - - - - - - -Freed & Borenstein Standards Track [Page 23] - -RFC 2049 MIME Conformance November 1996 - - - [RFC-2045] - Freed, N., and and N. Borenstein, "Multipurpose Internet Mail - Extensions (MIME) Part One: Format of Internet Message - Bodies", RFC 2045, Innosoft, First Virtual Holdings, - November 1996. - - [RFC-2046] - Freed, N., and N. Borenstein, "Multipurpose Internet Mail - Extensions (MIME) Part Two: Media Types", RFC 2046, - Innosoft, First Virtual Holdings, November 1996. - - [RFC-2047] - Moore, K., "Multipurpose Internet Mail Extensions (MIME) - Part Three: Representation of Non-ASCII Text in Internet - Message Headers", RFC 2047, University of - Tennessee, November 1996. - - [RFC-2048] - Freed, N., Klensin, J., and J. Postel, "Multipurpose - Internet Mail Extensions (MIME) Part Four: MIME - Registration Procedures", RFC 2048, Innosoft, MCI, - ISI, November 1996. - - [RFC-2049] - Freed, N. and N. Borenstein, "Multipurpose Internet Mail - Extensions (MIME) Part Five: Conformance Criteria and - Examples", RFC 2049 (this document), Innosoft, First - Virtual Holdings, November 1996. - - [US-ASCII] - Coded Character Set -- 7-Bit American Standard Code for - Information Interchange, ANSI X3.4-1986. - - [X400] - Schicker, Pietro, "Message Handling Systems, X.400", - Message Handling Systems and Distributed Applications, E. - Stefferud, O-j. Jacobsen, and P. Schicker, eds., North- - Holland, 1989, pp. 3-41. - - - - - - - - - - - - - -Freed & Borenstein Standards Track [Page 24] - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2183.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2183.txt deleted file mode 100644 index f16f127..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2183.txt +++ /dev/null @@ -1,675 +0,0 @@ - - - - - - -Network Working Group R. Troost -Request for Comments: 2183 New Century Systems -Updates: 1806 S. Dorner -Category: Standards Track QUALCOMM Incorporated - K. Moore, Editor - University of Tennessee - August 1997 - - - Communicating Presentation Information in - Internet Messages: - The Content-Disposition Header Field - -Status of this Memo - - This document specifies an Internet standards track protocol for the - Internet community, and requests discussion and suggestions for - improvements. Please refer to the current edition of the "Internet - Official Protocol Standards" (STD 1) for the standardization state - and status of this protocol. Distribution of this memo is unlimited. - -Abstract - - This memo provides a mechanism whereby messages conforming to the - MIME specifications [RFC 2045, RFC 2046, RFC 2047, RFC 2048, RFC - 2049] can convey presentational information. It specifies the - "Content-Disposition" header field, which is optional and valid for - any MIME entity ("message" or "body part"). Two values for this - header field are described in this memo; one for the ordinary linear - presentation of the body part, and another to facilitate the use of - mail to transfer files. It is expected that more values will be - defined in the future, and procedures are defined for extending this - set of values. - - This document is intended as an extension to MIME. As such, the - reader is assumed to be familiar with the MIME specifications, and - [RFC 822]. The information presented herein supplements but does not - replace that found in those documents. - - This document is a revision to the Experimental protocol defined in - RFC 1806. As compared to RFC 1806, this document contains minor - editorial updates, adds new parameters needed to support the File - Transfer Body Part, and references a separate specification for the - handling of non-ASCII and/or very long parameter values. - - - - - - - -Troost, et. al. Standards Track [Page 1] - -RFC 2183 Content-Disposition August 1997 - - -1. Introduction - - MIME specifies a standard format for encapsulating multiple pieces of - data into a single Internet message. That document does not address - the issue of presentation styles; it provides a framework for the - interchange of message content, but leaves presentation issues solely - in the hands of mail user agent (MUA) implementors. - - Two common ways of presenting multipart electronic messages are as a - main document with a list of separate attachments, and as a single - document with the various parts expanded (displayed) inline. The - display of an attachment is generally construed to require positive - action on the part of the recipient, while inline message components - are displayed automatically when the message is viewed. A mechanism - is needed to allow the sender to transmit this sort of presentational - information to the recipient; the Content-Disposition header provides - this mechanism, allowing each component of a message to be tagged - with an indication of its desired presentation semantics. - - Tagging messages in this manner will often be sufficient for basic - message formatting. However, in many cases a more powerful and - flexible approach will be necessary. The definition of such - approaches is beyond the scope of this memo; however, such approaches - can benefit from additional Content-Disposition values and - parameters, to be defined at a later date. - - In addition to allowing the sender to specify the presentational - disposition of a message component, it is desirable to allow her to - indicate a default archival disposition; a filename. The optional - "filename" parameter provides for this. Further, the creation-date, - modification-date, and read-date parameters allow preservation of - those file attributes when the file is transmitted over MIME email. - - NB: The keywords MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, - SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL, when they appear in this - document, are to be interpreted as described in [RFC 2119]. - -2. The Content-Disposition Header Field - - Content-Disposition is an optional header field. In its absence, the - MUA may use whatever presentation method it deems suitable. - - It is desirable to keep the set of possible disposition types small - and well defined, to avoid needless complexity. Even so, evolving - usage will likely require the definition of additional disposition - types or parameters, so the set of disposition values is extensible; - see below. - - - - -Troost, et. al. Standards Track [Page 2] - -RFC 2183 Content-Disposition August 1997 - - - In the extended BNF notation of [RFC 822], the Content-Disposition - header field is defined as follows: - - disposition := "Content-Disposition" ":" - disposition-type - *(";" disposition-parm) - - disposition-type := "inline" - / "attachment" - / extension-token - ; values are not case-sensitive - - disposition-parm := filename-parm - / creation-date-parm - / modification-date-parm - / read-date-parm - / size-parm - / parameter - - filename-parm := "filename" "=" value - - creation-date-parm := "creation-date" "=" quoted-date-time - - modification-date-parm := "modification-date" "=" quoted-date-time - - read-date-parm := "read-date" "=" quoted-date-time - - size-parm := "size" "=" 1*DIGIT - - quoted-date-time := quoted-string - ; contents MUST be an RFC 822 `date-time' - ; numeric timezones (+HHMM or -HHMM) MUST be used - - - - NOTE ON PARAMETER VALUE LENGHTS: A short (length <= 78 characters) - parameter value containing only non-`tspecials' characters SHOULD be - represented as a single `token'. A short parameter value containing - only ASCII characters, but including `tspecials' characters, SHOULD - be represented as `quoted-string'. Parameter values longer than 78 - characters, or which contain non-ASCII characters, MUST be encoded as - specified in [RFC 2184]. - - `Extension-token', `parameter', `tspecials' and `value' are defined - according to [RFC 2045] (which references [RFC 822] in the definition - of some of these tokens). `quoted-string' and `DIGIT' are defined in - [RFC 822]. - - - - -Troost, et. al. Standards Track [Page 3] - -RFC 2183 Content-Disposition August 1997 - - -2.1 The Inline Disposition Type - - A bodypart should be marked `inline' if it is intended to be - displayed automatically upon display of the message. Inline - bodyparts should be presented in the order in which they occur, - subject to the normal semantics of multipart messages. - -2.2 The Attachment Disposition Type - - Bodyparts can be designated `attachment' to indicate that they are - separate from the main body of the mail message, and that their - display should not be automatic, but contingent upon some further - action of the user. The MUA might instead present the user of a - bitmap terminal with an iconic representation of the attachments, or, - on character terminals, with a list of attachments from which the - user could select for viewing or storage. - -2.3 The Filename Parameter - - The sender may want to suggest a filename to be used if the entity is - detached and stored in a separate file. If the receiving MUA writes - the entity to a file, the suggested filename should be used as a - basis for the actual filename, where possible. - - It is important that the receiving MUA not blindly use the suggested - filename. The suggested filename SHOULD be checked (and possibly - changed) to see that it conforms to local filesystem conventions, - does not overwrite an existing file, and does not present a security - problem (see Security Considerations below). - - The receiving MUA SHOULD NOT respect any directory path information - that may seem to be present in the filename parameter. The filename - should be treated as a terminal component only. Portable - specification of directory paths might possibly be done in the future - via a separate Content-Disposition parameter, but no provision is - made for it in this draft. - - Current [RFC 2045] grammar restricts parameter values (and hence - Content-Disposition filenames) to US-ASCII. We recognize the great - desirability of allowing arbitrary character sets in filenames, but - it is beyond the scope of this document to define the necessary - mechanisms. We expect that the basic [RFC 1521] `value' - specification will someday be amended to allow use of non-US-ASCII - characters, at which time the same mechanism should be used in the - Content-Disposition filename parameter. - - - - - - -Troost, et. al. Standards Track [Page 4] - -RFC 2183 Content-Disposition August 1997 - - - Beyond the limitation to US-ASCII, the sending MUA may wish to bear - in mind the limitations of common filesystems. Many have severe - length and character set restrictions. Short alphanumeric filenames - are least likely to require modification by the receiving system. - - The presence of the filename parameter does not force an - implementation to write the entity to a separate file. It is - perfectly acceptable for implementations to leave the entity as part - of the normal mail stream unless the user requests otherwise. As a - consequence, the parameter may be used on any MIME entity, even - `inline' ones. These will not normally be written to files, but the - parameter could be used to provide a filename if the receiving user - should choose to write the part to a file. - -2.4 The Creation-Date parameter - - The creation-date parameter MAY be used to indicate the date at which - the file was created. If this parameter is included, the paramter - value MUST be a quoted-string which contains a representation of the - creation date of the file in [RFC 822] `date-time' format. - - UNIX and POSIX implementors are cautioned that the `st_ctime' file - attribute of the `stat' structure is not the creation time of the - file; it is thus not appropriate as a source for the creation-date - parameter value. - -2.5 The Modification-Date parameter - - The modification-date parameter MAY be used to indicate the date at - which the file was last modified. If the modification-date parameter - is included, the paramter value MUST be a quoted-string which - contains a representation of the last modification date of the file - in [RFC 822] `date-time' format. - -2.6 The Read-Date parameter - - The read-date parameter MAY be used to indicate the date at which the - file was last read. If the read-date parameter is included, the - parameter value MUST be a quoted-string which contains a - representation of the last-read date of the file in [RFC 822] `date- - time' format. - -2.7 The Size parameter - - The size parameter indicates an approximate size of the file in - octets. It can be used, for example, to pre-allocate space before - attempting to store the file, or to determine whether enough space - exists. - - - -Troost, et. al. Standards Track [Page 5] - -RFC 2183 Content-Disposition August 1997 - - -2.8 Future Extensions and Unrecognized Disposition Types - - In the likely event that new parameters or disposition types are - needed, they should be registered with the Internet Assigned Numbers - Authority (IANA), in the manner specified in Section 9 of this memo. - - Once new disposition types and parameters are defined, there is of - course the likelihood that implementations will see disposition types - and parameters they do not understand. Furthermore, since x-tokens - are allowed, implementations may also see entirely unregistered - disposition types and parameters. - - Unrecognized parameters should be ignored. Unrecognized disposition - types should be treated as `attachment'. The choice of `attachment' - for unrecognized types is made because a sender who goes to the - trouble of producing a Content-Disposition header with a new - disposition type is more likely aiming for something more elaborate - than inline presentation. - - Unless noted otherwise in the definition of a parameter, Content- - Disposition parameters are valid for all dispositions. (In contrast - to MIME content-type parameters, which are defined on a per-content- - type basis.) Thus, for example, the `filename' parameter still means - the name of the file to which the part should be written, even if the - disposition itself is unrecognized. - -2.9 Content-Disposition and Multipart - - If a Content-Disposition header is used on a multipart body part, it - applies to the multipart as a whole, not the individual subparts. - The disposition types of the subparts do not need to be consulted - until the multipart itself is presented. When the multipart is - displayed, then the dispositions of the subparts should be respected. - - If the `inline' disposition is used, the multipart should be - displayed as normal; however, an `attachment' subpart should require - action from the user to display. - - If the `attachment' disposition is used, presentation of the - multipart should not proceed without explicit user action. Once the - user has chosen to display the multipart, the individual subpart - dispositions should be consulted to determine how to present the - subparts. - - - - - - - - -Troost, et. al. Standards Track [Page 6] - -RFC 2183 Content-Disposition August 1997 - - -2.10 Content-Disposition and the Main Message - - It is permissible to use Content-Disposition on the main body of an - [RFC 822] message. - -3. Examples - - Here is a an example of a body part containing a JPEG image that is - intended to be viewed by the user immediately: - - Content-Type: image/jpeg - Content-Disposition: inline - Content-Description: just a small picture of me - - - - The following body part contains a JPEG image that should be - displayed to the user only if the user requests it. If the JPEG is - written to a file, the file should be named "genome.jpg". The - recipient's user might also choose to set the last-modified date of - the stored file to date in the modification-date parameter: - - Content-Type: image/jpeg - Content-Disposition: attachment; filename=genome.jpeg; - modification-date="Wed, 12 Feb 1997 16:29:51 -0500"; - Content-Description: a complete map of the human genome - - - - The following is an example of the use of the `attachment' - disposition with a multipart body part. The user should see text- - part-1 immediately, then take some action to view multipart-2. After - taking action to view multipart-2, the user will see text-part-2 - right away, and be required to take action to view jpeg-1. Subparts - are indented for clarity; they would not be so indented in a real - message. - - - - - - - - - - - - - - - -Troost, et. al. Standards Track [Page 7] - -RFC 2183 Content-Disposition August 1997 - - - Content-Type: multipart/mixed; boundary=outer - Content-Description: multipart-1 - - --outer - Content-Type: text/plain - Content-Disposition: inline - Content-Description: text-part-1 - - Some text goes here - - --outer - Content-Type: multipart/mixed; boundary=inner - Content-Disposition: attachment - Content-Description: multipart-2 - - --inner - Content-Type: text/plain - Content-Disposition: inline - Content-Description: text-part-2 - - Some more text here. - - --inner - Content-Type: image/jpeg - Content-Disposition: attachment - Content-Description: jpeg-1 - - - --inner-- - --outer-- - -4. Summary - - Content-Disposition takes one of two values, `inline' and - `attachment'. `Inline' indicates that the entity should be - immediately displayed to the user, whereas `attachment' means that - the user should take additional action to view the entity. - - The `filename' parameter can be used to suggest a filename for - storing the bodypart, if the user wishes to store it in an external - file. - - - - - - - - - - -Troost, et. al. Standards Track [Page 8] - -RFC 2183 Content-Disposition August 1997 - - -5. Security Considerations - - There are security issues involved any time users exchange data. - While these are not to be minimized, neither does this memo change - the status quo in that regard, except in one instance. - - Since this memo provides a way for the sender to suggest a filename, - a receiving MUA must take care that the sender's suggested filename - does not represent a hazard. Using UNIX as an example, some hazards - would be: - - + Creating startup files (e.g., ".login"). - - + Creating or overwriting system files (e.g., "/etc/passwd"). - - + Overwriting any existing file. - - + Placing executable files into any command search path - (e.g., "~/bin/more"). - - + Sending the file to a pipe (e.g., "| sh"). - - In general, the receiving MUA should not name or place the file such - that it will get interpreted or executed without the user explicitly - initiating the action. - - It is very important to note that this is not an exhaustive list; it - is intended as a small set of examples only. Implementors must be - alert to the potential hazards on their target systems. - -6. References - - [RFC 2119] - Bradner, S., "Key words for use in RFCs to Indicate Requirement - Levels", RFC 2119, March 1997. - - [RFC 2184] - Freed, N. and K. Moore, "MIME Parameter value and Encoded Words: - Character Sets, Lanaguage, and Continuations", RFC 2184, August - 1997. - - [RFC 2045] - Freed, N. and N. Borenstein, "MIME (Multipurpose Internet Mail - Extensions) Part One: Format of Internet Message Bodies", RFC - 2045, December 1996. - - - - - - -Troost, et. al. Standards Track [Page 9] - -RFC 2183 Content-Disposition August 1997 - - - [RFC 2046] - Freed, N. and N. Borenstein, "MIME (Multipurpose Internet Mail - Extensions) Part Two: Media Types", RFC 2046, December 1996. - - [RFC 2047] - Moore, K., "MIME (Multipurpose Internet Mail Extensions) Part - Three: Message Header Extensions for non-ASCII Text", RFC 2047, - December 1996. - - [RFC 2048] - Freed, N., Klensin, J. and J. Postel, "MIME (Multipurpose - Internet Mail Extensions) Part Four: Registration Procedures", - RFC 2048, December 1996. - - [RFC 2049] - Freed, N. and N. Borenstein, "MIME (Multipurpose Internet Mail - Extensions) Part Five: Conformance Criteria and Examples", RFC - 2049, December 1996. - - [RFC 822] - Crocker, D., "Standard for the Format of ARPA Internet Text - Messages", STD 11, RFC 822, UDEL, August 1982. - -7. Acknowledgements - - We gratefully acknowledge the help these people provided during the - preparation of this draft: - - Nathaniel Borenstein - Ned Freed - Keith Moore - Dave Crocker - Dan Pritchett - - - - - - - - - - - - - - - - - - -Troost, et. al. Standards Track [Page 10] - -RFC 2183 Content-Disposition August 1997 - - -8. Authors' Addresses - - You should blame the editor of this version of the document for any - changes since RFC 1806: - - Keith Moore - Department of Computer Science - University of Tennessee, Knoxville - 107 Ayres Hall - Knoxville TN 37996-1301 - USA - - Phone: +1 (423) 974-5067 - Fax: +1 (423) 974-8296 - Email: moore@cs.utk.edu - - - The authors of RFC 1806 are: - - Rens Troost - New Century Systems - 324 East 41st Street #804 - New York, NY, 10017 USA - - Phone: +1 (212) 557-2050 - Fax: +1 (212) 557-2049 - EMail: rens@century.com - - - Steve Dorner - QUALCOMM Incorporated - 6455 Lusk Boulevard - San Diego, CA 92121 - USA - - EMail: sdorner@qualcomm.com - - -9. Registration of New Content-Disposition Values and Parameters - - New Content-Disposition values (besides "inline" and "attachment") - may be defined only by Internet standards-track documents, or in - Experimental documents approved by the Internet Engineering Steering - Group. - - - - - - - -Troost, et. al. Standards Track [Page 11] - -RFC 2183 Content-Disposition August 1997 - - - New content-disposition parameters may be registered by supplying the - information in the following template and sending it via electronic - mail to IANA@IANA.ORG: - - To: IANA@IANA.ORG - Subject: Registration of new Content-Disposition parameter - - Content-Disposition parameter name: - - Allowable values for this parameter: - (If the parameter can only assume a small number of values, - list each of those values. Otherwise, describe the values - that the parameter can assume.) - Description: - (What is the purpose of this parameter and how is it used?) - -10. Changes since RFC 1806 - - The following changes have been made since the earlier version of - this document, published in RFC 1806 as an Experimental protocol: - - + Updated references to MIME documents. In some cases this - involved substituting a reference to one of the current MIME - RFCs for a reference to RFC 1521; in other cases, a reference to - RFC 1521 was simply replaced with the word "MIME". - - + Added a section on registration procedures, since none of the - procedures in RFC 2048 seemed to be appropriate. - - + Added new parameter types: creation-date, modification-date, - read-date, and size. - - - + Incorporated a reference to draft-freed-pvcsc-* for encoding - long or non-ASCII parameter values. - - + Added reference to RFC 2119 to define MUST, SHOULD, etc. - keywords. - - - - - - - - - - - - - -Troost, et. al. Standards Track [Page 12] - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2222.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2222.txt deleted file mode 100644 index 2b0a2ab..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2222.txt +++ /dev/null @@ -1,899 +0,0 @@ - - - - - - -Network Working Group J. Myers -Request for Comments: 2222 Netscape Communications -Category: Standards Track October 1997 - - - Simple Authentication and Security Layer (SASL) - -Status of this Memo - - This document specifies an Internet standards track protocol for the - Internet community, and requests discussion and suggestions for - improvements. Please refer to the current edition of the "Internet - Official Protocol Standards" (STD 1) for the standardization state - and status of this protocol. Distribution of this memo is unlimited. - -Copyright Notice - - Copyright (C) The Internet Society (1997). All Rights Reserved. - -Table of Contents - - 1. Abstract .............................................. 2 - 2. Organization of this Document ......................... 2 - 2.1. How to Read This Document ............................. 2 - 2.2. Conventions Used in this Document ..................... 2 - 2.3. Examples .............................................. 3 - 3. Introduction and Overview ............................. 3 - 4. Profiling requirements ................................ 4 - 5. Specific issues ....................................... 5 - 5.1. Client sends data first ............................... 5 - 5.2. Server returns success with additional data ........... 5 - 5.3. Multiple authentications .............................. 5 - 6. Registration procedures ............................... 6 - 6.1. Comments on SASL mechanism registrations .............. 6 - 6.2. Location of Registered SASL Mechanism List ............ 6 - 6.3. Change Control ........................................ 7 - 6.4. Registration Template ................................. 7 - 7. Mechanism definitions ................................. 8 - 7.1. Kerberos version 4 mechanism .......................... 8 - 7.2. GSSAPI mechanism ...................................... 9 - 7.2.1 Client side of authentication protocol exchange ....... 9 - 7.2.2 Server side of authentication protocol exchange ....... 10 - 7.2.3 Security layer ........................................ 11 - 7.3. S/Key mechanism ....................................... 11 - 7.4. External mechanism .................................... 12 - 8. References ............................................ 13 - 9. Security Considerations ............................... 13 - 10. Author's Address ...................................... 14 - - - -Myers Standards Track [Page 1] - -RFC 2222 SASL October 1997 - - - Appendix A. Relation of SASL to Transport Security .......... 15 - Full Copyright Statement .................................... 16 - -1. Abstract - - This document describes a method for adding authentication support to - connection-based protocols. To use this specification, a protocol - includes a command for identifying and authenticating a user to a - server and for optionally negotiating protection of subsequent - protocol interactions. If its use is negotiated, a security layer is - inserted between the protocol and the connection. This document - describes how a protocol specifies such a command, defines several - mechanisms for use by the command, and defines the protocol used for - carrying a negotiated security layer over the connection. - -2. Organization of this Document - -2.1. How to Read This Document - - This document is written to serve two different audiences, protocol - designers using this specification to support authentication in their - protocol, and implementors of clients or servers for those protocols - using this specification. - - The sections "Introduction and Overview", "Profiling requirements", - and "Security Considerations" cover issues that protocol designers - need to understand and address in profiling this specification for - use in a specific protocol. - - Implementors of a protocol using this specification need the - protocol-specific profiling information in addition to the - information in this document. - -2.2. Conventions Used in this Document - - In examples, "C:" and "S:" indicate lines sent by the client and - server respectively. - - The key words "MUST", "MUST NOT", "SHOULD", "SHOULD NOT", and "MAY" - in this document are to be interpreted as defined in "Key words for - use in RFCs to Indicate Requirement Levels" [RFC 2119]. - - - - - - - - - - -Myers Standards Track [Page 2] - -RFC 2222 SASL October 1997 - - -2.3. Examples - - Examples in this document are for the IMAP profile [RFC 2060] of this - specification. The base64 encoding of challenges and responses, as - well as the "+ " preceding the responses are part of the IMAP4 - profile, not part of the SASL specification itself. - -3. Introduction and Overview - - The Simple Authentication and Security Layer (SASL) is a method for - adding authentication support to connection-based protocols. To use - this specification, a protocol includes a command for identifying and - authenticating a user to a server and for optionally negotiating a - security layer for subsequent protocol interactions. - - The command has a required argument identifying a SASL mechanism. - SASL mechanisms are named by strings, from 1 to 20 characters in - length, consisting of upper-case letters, digits, hyphens, and/or - underscores. SASL mechanism names must be registered with the IANA. - Procedures for registering new SASL mechanisms are given in the - section "Registration procedures" - - If a server supports the requested mechanism, it initiates an - authentication protocol exchange. This consists of a series of - server challenges and client responses that are specific to the - requested mechanism. The challenges and responses are defined by the - mechanisms as binary tokens of arbitrary length. The protocol's - profile then specifies how these binary tokens are then encoded for - transfer over the connection. - - After receiving the authentication command or any client response, a - server may issue a challenge, indicate failure, or indicate - completion. The protocol's profile specifies how the server - indicates which of the above it is doing. - - After receiving a challenge, a client may issue a response or abort - the exchange. The protocol's profile specifies how the client - indicates which of the above it is doing. - - During the authentication protocol exchange, the mechanism performs - authentication, transmits an authorization identity (frequently known - as a userid) from the client to server, and negotiates the use of a - mechanism-specific security layer. If the use of a security layer is - agreed upon, then the mechanism must also define or negotiate the - maximum cipher-text buffer size that each side is able to receive. - - - - - - -Myers Standards Track [Page 3] - -RFC 2222 SASL October 1997 - - - The transmitted authorization identity may be different than the - identity in the client's authentication credentials. This permits - agents such as proxy servers to authenticate using their own - credentials, yet request the access privileges of the identity for - which they are proxying. With any mechanism, transmitting an - authorization identity of the empty string directs the server to - derive an authorization identity from the client's authentication - credentials. - - If use of a security layer is negotiated, it is applied to all - subsequent data sent over the connection. The security layer takes - effect immediately following the last response of the authentication - exchange for data sent by the client and the completion indication - for data sent by the server. Once the security layer is in effect, - the protocol stream is processed by the security layer into buffers - of cipher-text. Each buffer is transferred over the connection as a - stream of octets prepended with a four octet field in network byte - order that represents the length of the following buffer. The length - of the cipher-text buffer must be no larger than the maximum size - that was defined or negotiated by the other side. - -4. Profiling requirements - - In order to use this specification, a protocol definition must supply - the following information: - - 1. A service name, to be selected from the IANA registry of "service" - elements for the GSSAPI host-based service name form [RFC 2078]. - - 2. A definition of the command to initiate the authentication - protocol exchange. This command must have as a parameter the - mechanism name being selected by the client. - - The command SHOULD have an optional parameter giving an initial - response. This optional parameter allows the client to avoid a - round trip when using a mechanism which is defined to have the - client send data first. When this initial response is sent by the - client and the selected mechanism is defined to have the server - start with an initial challenge, the command fails. See section - 5.1 of this document for further information. - - 3. A definition of the method by which the authentication protocol - exchange is carried out, including how the challenges and - responses are encoded, how the server indicates completion or - failure of the exchange, how the client aborts an exchange, and - how the exchange method interacts with any line length limits in - the protocol. - - - - -Myers Standards Track [Page 4] - -RFC 2222 SASL October 1997 - - - 4. Identification of the octet where any negotiated security layer - starts to take effect, in both directions. - - 5. A specification of how the authorization identity passed from the - client to the server is to be interpreted. - -5. Specific issues - -5.1. Client sends data first - - Some mechanisms specify that the first data sent in the - authentication protocol exchange is from the client to the server. - - If a protocol's profile permits the command which initiates an - authentication protocol exchange to contain an initial client - response, this parameter SHOULD be used with such mechanisms. - - If the initial client response parameter is not given, or if a - protocol's profile does not permit the command which initiates an - authentication protocol exchange to contain an initial client - response, then the server issues a challenge with no data. The - client's response to this challenge is then used as the initial - client response. (The server then proceeds to send the next - challenge, indicates completion, or indicates failure.) - -5.2. Server returns success with additional data - - Some mechanisms may specify that server challenge data be sent to the - client along with an indication of successful completion of the - exchange. This data would, for example, authenticate the server to - the client. - - If a protocol's profile does not permit this server challenge to be - returned with a success indication, then the server issues the server - challenge without an indication of successful completion. The client - then responds with no data. After receiving this empty response, the - server then indicates successful completion. - -5.3. Multiple authentications - - Unless otherwise stated by the protocol's profile, only one - successful SASL negotiation may occur in a protocol session. In this - case, once an authentication protocol exchange has successfully - completed, further attempts to initiate an authentication protocol - exchange fail. - - - - - - -Myers Standards Track [Page 5] - -RFC 2222 SASL October 1997 - - - In the case that a profile explicitly permits multiple successful - SASL negotiations to occur, then in no case may multiple security - layers be simultaneously in effect. If a security layer is in effect - and a subsequent SASL negotiation selects no security layer, the - original security layer remains in effect. If a security layer is in - effect and a subsequent SASL negotiation selects a second security - layer, then the second security layer replaces the first. - -6. Registration procedures - - Registration of a SASL mechanism is done by filling in the template - in section 6.4 and sending it in to iana@isi.edu. IANA has the right - to reject obviously bogus registrations, but will perform no review - of clams made in the registration form. - - There is no naming convention for SASL mechanisms; any name that - conforms to the syntax of a SASL mechanism name can be registered. - - While the registration procedures do not require it, authors of SASL - mechanisms are encouraged to seek community review and comment - whenever that is feasible. Authors may seek community review by - posting a specification of their proposed mechanism as an internet- - draft. SASL mechanisms intended for widespread use should be - standardized through the normal IETF process, when appropriate. - -6.1. Comments on SASL mechanism registrations - - Comments on registered SASL mechanisms should first be sent to the - "owner" of the mechanism. Submitters of comments may, after a - reasonable attempt to contact the owner, request IANA to attach their - comment to the SASL mechanism registration itself. If IANA approves - of this the comment will be made accessible in conjunction with the - SASL mechanism registration itself. - -6.2. Location of Registered SASL Mechanism List - - SASL mechanism registrations will be posted in the anonymous FTP - directory "ftp://ftp.isi.edu/in-notes/iana/assignments/sasl- - mechanisms/" and all registered SASL mechanisms will be listed in the - periodically issued "Assigned Numbers" RFC [currently STD 2, RFC - 1700]. The SASL mechanism description and other supporting material - may also be published as an Informational RFC by sending it to "rfc- - editor@isi.edu" (please follow the instructions to RFC authors [RFC - 2223]). - - - - - - - -Myers Standards Track [Page 6] - -RFC 2222 SASL October 1997 - - -6.3. Change Control - - Once a SASL mechanism registration has been published by IANA, the - author may request a change to its definition. The change request - follows the same procedure as the registration request. - - The owner of a SASL mechanism may pass responsibility for the SASL - mechanism to another person or agency by informing IANA; this can be - done without discussion or review. - - The IESG may reassign responsibility for a SASL mechanism. The most - common case of this will be to enable changes to be made to - mechanisms where the author of the registration has died, moved out - of contact or is otherwise unable to make changes that are important - to the community. - - SASL mechanism registrations may not be deleted; mechanisms which are - no longer believed appropriate for use can be declared OBSOLETE by a - change to their "intended use" field; such SASL mechanisms will be - clearly marked in the lists published by IANA. - - The IESG is considered to be the owner of all SASL mechanisms which - are on the IETF standards track. - -6.4. Registration Template - - To: iana@iana.org - Subject: Registration of SASL mechanism X - - SASL mechanism name: - - Security considerations: - - Published specification (optional, recommended): - - Person & email address to contact for further information: - - Intended usage: - - (One of COMMON, LIMITED USE or OBSOLETE) - - Author/Change controller: - - (Any other information that the author deems interesting may be - added below this line.) - - - - - - -Myers Standards Track [Page 7] - -RFC 2222 SASL October 1997 - - -7. Mechanism definitions - - The following mechanisms are hereby defined. - -7.1. Kerberos version 4 mechanism - - The mechanism name associated with Kerberos version 4 is - "KERBEROS_V4". - - The first challenge consists of a random 32-bit number in network - byte order. The client responds with a Kerberos ticket and an - authenticator for the principal "service.hostname@realm", where - "service" is the service name specified in the protocol's profile, - "hostname" is the first component of the host name of the server with - all letters in lower case, and where "realm" is the Kerberos realm of - the server. The encrypted checksum field included within the - Kerberos authenticator contains the server provided challenge in - network byte order. - - Upon decrypting and verifying the ticket and authenticator, the - server verifies that the contained checksum field equals the original - server provided random 32-bit number. Should the verification be - successful, the server must add one to the checksum and construct 8 - octets of data, with the first four octets containing the incremented - checksum in network byte order, the fifth octet containing a bit-mask - specifying the security layers supported by the server, and the sixth - through eighth octets containing, in network byte order, the maximum - cipher-text buffer size the server is able to receive. The server - must encrypt using DES ECB mode the 8 octets of data in the session - key and issue that encrypted data in a second challenge. The client - considers the server authenticated if the first four octets of the - un-encrypted data is equal to one plus the checksum it previously - sent. - - The client must construct data with the first four octets containing - the original server-issued checksum in network byte order, the fifth - octet containing the bit-mask specifying the selected security layer, - the sixth through eighth octets containing in network byte order the - maximum cipher-text buffer size the client is able to receive, and - the following octets containing the authorization identity. The - client must then append from one to eight zero-valued octets so that - the length of the data is a multiple of eight octets. The client must - then encrypt using DES PCBC mode the data with the session key and - respond with the encrypted data. The server decrypts the data and - verifies the contained checksum. The server must verify that the - principal identified in the Kerberos ticket is authorized to connect - as that authorization identity. After this verification, the - authentication process is complete. - - - -Myers Standards Track [Page 8] - -RFC 2222 SASL October 1997 - - - The security layers and their corresponding bit-masks are as follows: - - 1 No security layer - 2 Integrity (krb_mk_safe) protection - 4 Privacy (krb_mk_priv) protection - - Other bit-masks may be defined in the future; bits which are not - understood must be negotiated off. - - EXAMPLE: The following are two Kerberos version 4 login scenarios to - the IMAP4 protocol (note that the line breaks in the sample - authenticators are for editorial clarity and are not in real - authenticators) - - S: * OK IMAP4 Server - C: A001 AUTHENTICATE KERBEROS_V4 - S: + AmFYig== - C: BAcAQU5EUkVXLkNNVS5FRFUAOCAsho84kLN3/IJmrMG+25a4DT - +nZImJjnTNHJUtxAA+o0KPKfHEcAFs9a3CL5Oebe/ydHJUwYFd - WwuQ1MWiy6IesKvjL5rL9WjXUb9MwT9bpObYLGOKi1Qh - S: + or//EoAADZI= - C: DiAF5A4gA+oOIALuBkAAmw== - S: A001 OK Kerberos V4 authentication successful - - - S: * OK IMAP4 Server - C: A001 AUTHENTICATE KERBEROS_V4 - S: + gcfgCA== - C: BAcAQU5EUkVXLkNNVS5FRFUAOCAsho84kLN3/IJmrMG+25a4DT - +nZImJjnTNHJUtxAA+o0KPKfHEcAFs9a3CL5Oebe/ydHJUwYFd - WwuQ1MWiy6IesKvjL5rL9WjXUb9MwT9bpObYLGOKi1Qh - S: A001 NO Kerberos V4 authentication failed - -7.2. GSSAPI mechanism - - The mechanism name associated with all mechanisms employing the - GSSAPI [RFC 2078] is "GSSAPI". - -7.2.1 Client side of authentication protocol exchange - - The client calls GSS_Init_sec_context, passing in 0 for - input_context_handle (initially) and a targ_name equal to output_name - from GSS_Import_Name called with input_name_type of - GSS_C_NT_HOSTBASED_SERVICE and input_name_string of - "service@hostname" where "service" is the service name specified in - the protocol's profile, and "hostname" is the fully qualified host - name of the server. The client then responds with the resulting - output_token. If GSS_Init_sec_context returns GSS_S_CONTINUE_NEEDED, - - - -Myers Standards Track [Page 9] - -RFC 2222 SASL October 1997 - - - then the client should expect the server to issue a token in a - subsequent challenge. The client must pass the token to another call - to GSS_Init_sec_context, repeating the actions in this paragraph. - - When GSS_Init_sec_context returns GSS_S_COMPLETE, the client takes - the following actions: If the last call to GSS_Init_sec_context - returned an output_token, then the client responds with the - output_token, otherwise the client responds with no data. The client - should then expect the server to issue a token in a subsequent - challenge. The client passes this token to GSS_Unwrap and interprets - the first octet of resulting cleartext as a bit-mask specifying the - security layers supported by the server and the second through fourth - octets as the maximum size output_message to send to the server. The - client then constructs data, with the first octet containing the - bit-mask specifying the selected security layer, the second through - fourth octets containing in network byte order the maximum size - output_message the client is able to receive, and the remaining - octets containing the authorization identity. The client passes the - data to GSS_Wrap with conf_flag set to FALSE, and responds with the - generated output_message. The client can then consider the server - authenticated. - -7.2.2 Server side of authentication protocol exchange - - The server passes the initial client response to - GSS_Accept_sec_context as input_token, setting input_context_handle - to 0 (initially). If GSS_Accept_sec_context returns - GSS_S_CONTINUE_NEEDED, the server returns the generated output_token - to the client in challenge and passes the resulting response to - another call to GSS_Accept_sec_context, repeating the actions in this - paragraph. - - When GSS_Accept_sec_context returns GSS_S_COMPLETE, the client takes - the following actions: If the last call to GSS_Accept_sec_context - returned an output_token, the server returns it to the client in a - challenge and expects a reply from the client with no data. Whether - or not an output_token was returned (and after receipt of any - response from the client to such an output_token), the server then - constructs 4 octets of data, with the first octet containing a bit- - mask specifying the security layers supported by the server and the - second through fourth octets containing in network byte order the - maximum size output_token the server is able to receive. The server - must then pass the plaintext to GSS_Wrap with conf_flag set to FALSE - and issue the generated output_message to the client in a challenge. - The server must then pass the resulting response to GSS_Unwrap and - interpret the first octet of resulting cleartext as the bit-mask for - the selected security layer, the second through fourth octets as the - maximum size output_message to send to the client, and the remaining - - - -Myers Standards Track [Page 10] - -RFC 2222 SASL October 1997 - - - octets as the authorization identity. The server must verify that - the src_name is authorized to authenticate as the authorization - identity. After these verifications, the authentication process is - complete. - -7.2.3 Security layer - - The security layers and their corresponding bit-masks are as follows: - - 1 No security layer - 2 Integrity protection. - Sender calls GSS_Wrap with conf_flag set to FALSE - 4 Privacy protection. - Sender calls GSS_Wrap with conf_flag set to TRUE - - Other bit-masks may be defined in the future; bits which are not - understood must be negotiated off. - -7.3. S/Key mechanism - - The mechanism name associated with S/Key [RFC 1760] using the MD4 - digest algorithm is "SKEY". - - The client sends an initial response with the authorization identity. - - The server then issues a challenge which contains the decimal - sequence number followed by a single space and the seed string for - the indicated authorization identity. The client responds with the - one-time-password, as either a 64-bit value in network byte order or - encoded in the "six English words" format. - - The server must verify the one-time-password. After this - verification, the authentication process is complete. - - S/Key authentication does not provide for any security layers. - - EXAMPLE: The following are two S/Key login scenarios in the IMAP4 - protocol. - - S: * OK IMAP4 Server - C: A001 AUTHENTICATE SKEY - S: + - C: bW9yZ2Fu - S: + OTUgUWE1ODMwOA== - C: Rk9VUiBNQU5OIFNPT04gRklSIFZBUlkgTUFTSA== - S: A001 OK S/Key authentication successful - - - - - -Myers Standards Track [Page 11] - -RFC 2222 SASL October 1997 - - - S: * OK IMAP4 Server - C: A001 AUTHENTICATE SKEY - S: + - C: c21pdGg= - S: + OTUgUWE1ODMwOA== - C: BsAY3g4gBNo= - S: A001 NO S/Key authentication failed - - The following is an S/Key login scenario in an IMAP4-like protocol - which has an optional "initial response" argument to the AUTHENTICATE - command. - - S: * OK IMAP4-Like Server - C: A001 AUTHENTICATE SKEY bW9yZ2Fu - S: + OTUgUWE1ODMwOA== - C: Rk9VUiBNQU5OIFNPT04gRklSIFZBUlkgTUFTSA== - S: A001 OK S/Key authentication successful - -7.4. External mechanism - - The mechanism name associated with external authentication is - "EXTERNAL". - - The client sends an initial response with the authorization identity. - - The server uses information, external to SASL, to determine whether - the client is authorized to authenticate as the authorization - identity. If the client is so authorized, the server indicates - successful completion of the authentication exchange; otherwise the - server indicates failure. - - The system providing this external information may be, for example, - IPsec or TLS. - - If the client sends the empty string as the authorization identity - (thus requesting the authorization identity be derived from the - client's authentication credentials), the authorization identity is - to be derived from authentication credentials which exist in the - system which is providing the external authentication. - - - - - - - - - - - - -Myers Standards Track [Page 12] - -RFC 2222 SASL October 1997 - - -8. References - - [RFC 2060] Crispin, M., "Internet Message Access Protocol - Version - 4rev1", RFC 2060, December 1996. - - [RFC 2078] Linn, J., "Generic Security Service Application Program - Interface, Version 2", RFC 2078, January 1997. - - [RFC 2119] Bradner, S., "Key words for use in RFCs to Indicate - Requirement Levels", RFC 2119, March 1997. - - [RFC 2223] Postel, J., and J. Reynolds, "Instructions to RFC - Authors", RFC 2223, October 1997. - - [RFC 1760] Haller, N., "The S/Key One-Time Password System", RFC - 1760, February 1995. - - [RFC 1700] Reynolds, J., and J. Postel, "Assigned Numbers", STD 2, - RFC 1700, October 1994. - -9. Security Considerations - - Security issues are discussed throughout this memo. - - The mechanisms that support integrity protection are designed such - that the negotiation of the security layer and authorization identity - is integrity protected. When the client selects a security layer - with at least integrity protection, this protects against an active - attacker hijacking the connection and modifying the authentication - exchange to negotiate a plaintext connection. - - When a server or client supports multiple authentication mechanisms, - each of which has a different security strength, it is possible for - an active attacker to cause a party to use the least secure mechanism - supported. To protect against this sort of attack, a client or - server which supports mechanisms of different strengths should have a - configurable minimum strength that it will use. It is not sufficient - for this minimum strength check to only be on the server, since an - active attacker can change which mechanisms the client sees as being - supported, causing the client to send authentication credentials for - its weakest supported mechanism. - - - - - - - - - - -Myers Standards Track [Page 13] - -RFC 2222 SASL October 1997 - - - The client's selection of a SASL mechanism is done in the clear and - may be modified by an active attacker. It is important for any new - SASL mechanisms to be designed such that an active attacker cannot - obtain an authentication with weaker security properties by modifying - the SASL mechanism name and/or the challenges and responses. - - Any protocol interactions prior to authentication are performed in - the clear and may be modified by an active attacker. In the case - where a client selects integrity protection, it is important that any - security-sensitive protocol negotiations be performed after - authentication is complete. Protocols should be designed such that - negotiations performed prior to authentication should be either - ignored or revalidated once authentication is complete. - -10. Author's Address - - John G. Myers - Netscape Communications - 501 E. Middlefield Road - Mail Stop MV-029 - Mountain View, CA 94043-4042 - - EMail: jgmyers@netscape.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Myers Standards Track [Page 14] - -RFC 2222 SASL October 1997 - - -Appendix A. Relation of SASL to Transport Security - - Questions have been raised about the relationship between SASL and - various services (such as IPsec and TLS) which provide a secured - connection. - - Two of the key features of SASL are: - - 1. The separation of the authorization identity from the identity in - the client's credentials. This permits agents such as proxy - servers to authenticate using their own credentials, yet request - the access privileges of the identity for which they are proxying. - - 2. Upon successful completion of an authentication exchange, the - server knows the authorization identity the client wishes to use. - This allows servers to move to a "user is authenticated" state in - the protocol. - - These features are extremely important to some application protocols, - yet Transport Security services do not always provide them. To - define SASL mechanisms based on these services would be a very messy - task, as the framing of these services would be redundant with the - framing of SASL and some method of providing these important SASL - features would have to be devised. - - Sometimes it is desired to enable within an existing connection the - use of a security service which does not fit the SASL model. (TLS is - an example of such a service.) This can be done by adding a command, - for example "STARTTLS", to the protocol. Such a command is outside - the scope of SASL, and should be different from the command which - starts a SASL authentication protocol exchange. - - In certain situations, it is reasonable to use SASL underneath one of - these Transport Security services. The transport service would - secure the connection, either service would authenticate the client, - and SASL would negotiate the authorization identity. The SASL - negotiation would be what moves the protocol from "unauthenticated" - to "authenticated" state. The "EXTERNAL" SASL mechanism is - explicitly intended to handle the case where the transport service - secures the connection and authenticates the client and SASL - negotiates the authorization identity. - - When using SASL underneath a sufficiently strong Transport Security - service, a SASL security layer would most likely be redundant. The - client and server would thus probably want to negotiate off the use - of a SASL security layer. - - - - - -Myers Standards Track [Page 15] - -RFC 2222 SASL October 1997 - - -Full Copyright Statement - - Copyright (C) The Internet Society (1997). All Rights Reserved. - - This document and translations of it may be copied and furnished to - others, and derivative works that comment on or otherwise explain it - or assist in its implmentation may be prepared, copied, published - andand distributed, in whole or in part, without restriction of any - kind, provided that the above copyright notice and this paragraph are - included on all such copies and derivative works. However, this - document itself may not be modified in any way, such as by removing - the copyright notice or references to the Internet Society or other - Internet organizations, except as needed for the purpose of - developing Internet standards in which case the procedures for - copyrights defined in the Internet Standards process must be - followed, or as required to translate it into languages other than - English. - - The limited permissions granted above are perpetual and will not be - revoked by the Internet Society or its successors or assigns. - - This document and the information contained herein is provided on an - "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING - TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION - HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF - MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - - - - - - - - - - - - - - - - - - - - - - - - -Myers Standards Track [Page 16] - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2231.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2231.txt deleted file mode 100644 index 120f98f..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2231.txt +++ /dev/null @@ -1,563 +0,0 @@ - - - - - - -Network Working Group N. Freed -Request for Comments: 2231 Innosoft -Updates: 2045, 2047, 2183 K. Moore -Obsoletes: 2184 University of Tennessee -Category: Standards Track November 1997 - - - MIME Parameter Value and Encoded Word Extensions: - Character Sets, Languages, and Continuations - - -Status of this Memo - - This document specifies an Internet standards track protocol for the - Internet community, and requests discussion and suggestions for - improvements. Please refer to the current edition of the "Internet - Official Protocol Standards" (STD 1) for the standardization state - and status of this protocol. Distribution of this memo is unlimited. - -Copyright Notice - - Copyright (C) The Internet Society (1997). All Rights Reserved. - -1. Abstract - - This memo defines extensions to the RFC 2045 media type and RFC 2183 - disposition parameter value mechanisms to provide - - (1) a means to specify parameter values in character sets - other than US-ASCII, - - (2) to specify the language to be used should the value be - displayed, and - - (3) a continuation mechanism for long parameter values to - avoid problems with header line wrapping. - - This memo also defines an extension to the encoded words defined in - RFC 2047 to allow the specification of the language to be used for - display as well as the character set. - -2. Introduction - - The Multipurpose Internet Mail Extensions, or MIME [RFC-2045, RFC- - 2046, RFC-2047, RFC-2048, RFC-2049], define a message format that - allows for: - - - - - -Freed & Moore Standards Track [Page 1] - -RFC 2231 MIME Value and Encoded Word Extensions November 1997 - - - (1) textual message bodies in character sets other than - US-ASCII, - - (2) non-textual message bodies, - - (3) multi-part message bodies, and - - (4) textual header information in character sets other than - US-ASCII. - - MIME is now widely deployed and is used by a variety of Internet - protocols, including, of course, Internet email. However, MIME's - success has resulted in the need for additional mechanisms that were - not provided in the original protocol specification. - - In particular, existing MIME mechanisms provide for named media type - (content-type field) parameters as well as named disposition - (content-disposition field). A MIME media type may specify any - number of parameters associated with all of its subtypes, and any - specific subtype may specify additional parameters for its own use. A - MIME disposition value may specify any number of associated - parameters, the most important of which is probably the attachment - disposition's filename parameter. - - These parameter names and values end up appearing in the content-type - and content-disposition header fields in Internet email. This - inherently imposes three crucial limitations: - - (1) Lines in Internet email header fields are folded - according to RFC 822 folding rules. This makes long - parameter values problematic. - - (2) MIME headers, like the RFC 822 headers they often - appear in, are limited to 7bit US-ASCII, and the - encoded-word mechanisms of RFC 2047 are not available - to parameter values. This makes it impossible to have - parameter values in character sets other than US-ASCII - without specifying some sort of private per-parameter - encoding. - - (3) It has recently become clear that character set - information is not sufficient to properly display some - sorts of information -- language information is also - needed [RFC-2130]. For example, support for - handicapped users may require reading text string - - - - - - -Freed & Moore Standards Track [Page 2] - -RFC 2231 MIME Value and Encoded Word Extensions November 1997 - - - aloud. The language the text is written in is needed - for this to be done correctly. Some parameter values - may need to be displayed, hence there is a need to - allow for the inclusion of language information. - - The last problem on this list is also an issue for the encoded words - defined by RFC 2047, as encoded words are intended primarily for - display purposes. - - This document defines extensions that address all of these - limitations. All of these extensions are implemented in a fashion - that is completely compatible at a syntactic level with existing MIME - implementations. In addition, the extensions are designed to have as - little impact as possible on existing uses of MIME. - - IMPORTANT NOTE: These mechanisms end up being somewhat gibbous when - they actually are used. As such, these mechanisms should not be used - lightly; they should be reserved for situations where a real need for - them exists. - -2.1. Requirements notation - - This document occasionally uses terms that appear in capital letters. - When the terms "MUST", "SHOULD", "MUST NOT", "SHOULD NOT", and "MAY" - appear capitalized, they are being used to indicate particular - requirements of this specification. A discussion of the meanings of - these terms appears in [RFC- 2119]. - -3. Parameter Value Continuations - - Long MIME media type or disposition parameter values do not interact - well with header line wrapping conventions. In particular, proper - header line wrapping depends on there being places where linear - whitespace (LWSP) is allowed, which may or may not be present in a - parameter value, and even if present may not be recognizable as such - since specific knowledge of parameter value syntax may not be - available to the agent doing the line wrapping. The result is that - long parameter values may end up getting truncated or otherwise - damaged by incorrect line wrapping implementations. - - A mechanism is therefore needed to break up parameter values into - smaller units that are amenable to line wrapping. Any such mechanism - MUST be compatible with existing MIME processors. This means that - - (1) the mechanism MUST NOT change the syntax of MIME media - type and disposition lines, and - - - - - -Freed & Moore Standards Track [Page 3] - -RFC 2231 MIME Value and Encoded Word Extensions November 1997 - - - (2) the mechanism MUST NOT depend on parameter ordering - since MIME states that parameters are not order - sensitive. Note that while MIME does prohibit - modification of MIME headers during transport, it is - still possible that parameters will be reordered when - user agent level processing is done. - - The obvious solution, then, is to use multiple parameters to contain - a single parameter value and to use some kind of distinguished name - to indicate when this is being done. And this obvious solution is - exactly what is specified here: The asterisk character ("*") followed - by a decimal count is employed to indicate that multiple parameters - are being used to encapsulate a single parameter value. The count - starts at 0 and increments by 1 for each subsequent section of the - parameter value. Decimal values are used and neither leading zeroes - nor gaps in the sequence are allowed. - - The original parameter value is recovered by concatenating the - various sections of the parameter, in order. For example, the - content-type field - - Content-Type: message/external-body; access-type=URL; - URL*0="ftp://"; - URL*1="cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar" - - is semantically identical to - - Content-Type: message/external-body; access-type=URL; - URL="ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar" - - Note that quotes around parameter values are part of the value - syntax; they are NOT part of the value itself. Furthermore, it is - explicitly permitted to have a mixture of quoted and unquoted - continuation fields. - -4. Parameter Value Character Set and Language Information - - Some parameter values may need to be qualified with character set or - language information. It is clear that a distinguished parameter - name is needed to identify when this information is present along - with a specific syntax for the information in the value itself. In - addition, a lightweight encoding mechanism is needed to accommodate 8 - bit information in parameter values. - - - - - - - - -Freed & Moore Standards Track [Page 4] - -RFC 2231 MIME Value and Encoded Word Extensions November 1997 - - - Asterisks ("*") are reused to provide the indicator that language and - character set information is present and encoding is being used. A - single quote ("'") is used to delimit the character set and language - information at the beginning of the parameter value. Percent signs - ("%") are used as the encoding flag, which agrees with RFC 2047. - - Specifically, an asterisk at the end of a parameter name acts as an - indicator that character set and language information may appear at - the beginning of the parameter value. A single quote is used to - separate the character set, language, and actual value information in - the parameter value string, and an percent sign is used to flag - octets encoded in hexadecimal. For example: - - Content-Type: application/x-stuff; - title*=us-ascii'en-us'This%20is%20%2A%2A%2Afun%2A%2A%2A - - Note that it is perfectly permissible to leave either the character - set or language field blank. Note also that the single quote - delimiters MUST be present even when one of the field values is - omitted. This is done when either character set, language, or both - are not relevant to the parameter value at hand. This MUST NOT be - done in order to indicate a default character set or language -- - parameter field definitions MUST NOT assign a default character set - or language. - -4.1. Combining Character Set, Language, and Parameter Continuations - - Character set and language information may be combined with the - parameter continuation mechanism. For example: - - Content-Type: application/x-stuff - title*0*=us-ascii'en'This%20is%20even%20more%20 - title*1*=%2A%2A%2Afun%2A%2A%2A%20 - title*2="isn't it!" - - Note that: - - (1) Language and character set information only appear at - the beginning of a given parameter value. - - (2) Continuations do not provide a facility for using more - than one character set or language in the same - parameter value. - - (3) A value presented using multiple continuations may - contain a mixture of encoded and unencoded segments. - - - - - -Freed & Moore Standards Track [Page 5] - -RFC 2231 MIME Value and Encoded Word Extensions November 1997 - - - (4) The first segment of a continuation MUST be encoded if - language and character set information are given. - - (5) If the first segment of a continued parameter value is - encoded the language and character set field delimiters - MUST be present even when the fields are left blank. - -5. Language specification in Encoded Words - - RFC 2047 provides support for non-US-ASCII character sets in RFC 822 - message header comments, phrases, and any unstructured text field. - This is done by defining an encoded word construct which can appear - in any of these places. Given that these are fields intended for - display, it is sometimes necessary to associate language information - with encoded words as well as just the character set. This - specification extends the definition of an encoded word to allow the - inclusion of such information. This is simply done by suffixing the - character set specification with an asterisk followed by the language - tag. For example: - - From: =?US-ASCII*EN?Q?Keith_Moore?= - -6. IMAP4 Handling of Parameter Values - - IMAP4 [RFC-2060] servers SHOULD decode parameter value continuations - when generating the BODY and BODYSTRUCTURE fetch attributes. - -7. Modifications to MIME ABNF - - The ABNF for MIME parameter values given in RFC 2045 is: - - parameter := attribute "=" value - - attribute := token - ; Matching of attributes - ; is ALWAYS case-insensitive. - - This specification changes this ABNF to: - - parameter := regular-parameter / extended-parameter - - regular-parameter := regular-parameter-name "=" value - - regular-parameter-name := attribute [section] - - attribute := 1*attribute-char - - - - - -Freed & Moore Standards Track [Page 6] - -RFC 2231 MIME Value and Encoded Word Extensions November 1997 - - - attribute-char := - - section := initial-section / other-sections - - initial-section := "*0" - - other-sections := "*" ("1" / "2" / "3" / "4" / "5" / - "6" / "7" / "8" / "9") *DIGIT) - - extended-parameter := (extended-initial-name "=" - extended-value) / - (extended-other-names "=" - extended-other-values) - - extended-initial-name := attribute [initial-section] "*" - - extended-other-names := attribute other-sections "*" - - extended-initial-value := [charset] "'" [language] "'" - extended-other-values - - extended-other-values := *(ext-octet / attribute-char) - - ext-octet := "%" 2(DIGIT / "A" / "B" / "C" / "D" / "E" / "F") - - charset := - - language := - - The ABNF given in RFC 2047 for encoded-words is: - - encoded-word := "=?" charset "?" encoding "?" encoded-text "?=" - - This specification changes this ABNF to: - - encoded-word := "=?" charset ["*" language] "?" encoded-text "?=" - -8. Character sets which allow specification of language - - In the future it is likely that some character sets will provide - facilities for inline language labeling. Such facilities are - inherently more flexible than those defined here as they allow for - language switching in the middle of a string. - - - - - - - -Freed & Moore Standards Track [Page 7] - -RFC 2231 MIME Value and Encoded Word Extensions November 1997 - - - If and when such facilities are developed they SHOULD be used in - preference to the language labeling facilities specified here. Note - that all the mechanisms defined here allow for the omission of - language labels so as to be able to accommodate this possible future - usage. - -9. Security Considerations - - This RFC does not discuss security issues and is not believed to - raise any security issues not already endemic in electronic mail and - present in fully conforming implementations of MIME. - -10. References - - [RFC-822] - Crocker, D., "Standard for the Format of ARPA Internet - Text Messages", STD 11, RFC 822 August 1982. - - [RFC-1766] - Alvestrand, H., "Tags for the Identification of - Languages", RFC 1766, March 1995. - - [RFC-2045] - Freed, N., and N. Borenstein, "Multipurpose Internet Mail - Extensions (MIME) Part One: Format of Internet Message - Bodies", RFC 2045, December 1996. - - [RFC-2046] - Freed, N. and N. Borenstein, "Multipurpose Internet Mail - Extensions (MIME) Part Two: Media Types", RFC 2046, - December 1996. - - [RFC-2047] - Moore, K., "Multipurpose Internet Mail Extensions (MIME) - Part Three: Representation of Non-ASCII Text in Internet - Message Headers", RFC 2047, December 1996. - - [RFC-2048] - Freed, N., Klensin, J. and J. Postel, "Multipurpose - Internet Mail Extensions (MIME) Part Four: MIME - Registration Procedures", RFC 2048, December 1996. - - [RFC-2049] - Freed, N. and N. Borenstein, "Multipurpose Internet Mail - Extensions (MIME) Part Five: Conformance Criteria and - Examples", RFC 2049, December 1996. - - - - - -Freed & Moore Standards Track [Page 8] - -RFC 2231 MIME Value and Encoded Word Extensions November 1997 - - - [RFC-2060] - Crispin, M., "Internet Message Access Protocol - Version - 4rev1", RFC 2060, December 1996. - - [RFC-2119] - Bradner, S., "Key words for use in RFCs to Indicate - Requirement Levels", RFC 2119, March 1997. - - [RFC-2130] - Weider, C., Preston, C., Simonsen, K., Alvestrand, H., - Atkinson, R., Crispin, M., and P. Svanberg, "Report from the - IAB Character Set Workshop", RFC 2130, April 1997. - - [RFC-2183] - Troost, R., Dorner, S. and K. Moore, "Communicating - Presentation Information in Internet Messages: The - Content-Disposition Header", RFC 2183, August 1997. - -11. Authors' Addresses - - Ned Freed - Innosoft International, Inc. - 1050 Lakes Drive - West Covina, CA 91790 - USA - - Phone: +1 626 919 3600 - Fax: +1 626 919 3614 - EMail: ned.freed@innosoft.com - - - Keith Moore - Computer Science Dept. - University of Tennessee - 107 Ayres Hall - Knoxville, TN 37996-1301 - USA - - EMail: moore@cs.utk.edu - - - - - - - - - - - - -Freed & Moore Standards Track [Page 9] - -RFC 2231 MIME Value and Encoded Word Extensions November 1997 - - -12. Full Copyright Statement - - Copyright (C) The Internet Society (1997). All Rights Reserved. - - This document and translations of it may be copied and furnished to - others, and derivative works that comment on or otherwise explain it - or assist in its implementation may be prepared, copied, published - and distributed, in whole or in part, without restriction of any - kind, provided that the above copyright notice and this paragraph are - included on all such copies and derivative works. However, this - document itself may not be modified in any way, such as by removing - the copyright notice or references to the Internet Society or other - Internet organizations, except as needed for the purpose of - developing Internet standards in which case the procedures for - copyrights defined in the Internet Standards process must be - followed, or as required to translate it into languages other than - English. - - The limited permissions granted above are perpetual and will not be - revoked by the Internet Society or its successors or assigns. - - This document and the information contained herein is provided on an - "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING - TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION - HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF - MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - - - - - - - - - - - - - - - - - - - - - - - - -Freed & Moore Standards Track [Page 10] - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2234.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2234.txt deleted file mode 100644 index edea302..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2234.txt +++ /dev/null @@ -1,787 +0,0 @@ - - - - - - -Network Working Group D. Crocker, Ed. -Request for Comments: 2234 Internet Mail Consortium -Category: Standards Track P. Overell - Demon Internet Ltd. - November 1997 - - - Augmented BNF for Syntax Specifications: ABNF - - -Status of this Memo - - This document specifies an Internet standards track protocol for the - Internet community, and requests discussion and suggestions for - improvements. Please refer to the current edition of the "Internet - Official Protocol Standards" (STD 1) for the standardization state - and status of this protocol. Distribution of this memo is unlimited. - -Copyright Notice - - Copyright (C) The Internet Society (1997). All Rights Reserved. - -TABLE OF CONTENTS - - 1. INTRODUCTION .................................................. 2 - - 2. RULE DEFINITION ............................................... 2 - 2.1 RULE NAMING .................................................. 2 - 2.2 RULE FORM .................................................... 3 - 2.3 TERMINAL VALUES .............................................. 3 - 2.4 EXTERNAL ENCODINGS ........................................... 5 - - 3. OPERATORS ..................................................... 5 - 3.1 CONCATENATION RULE1 RULE2 ............................. 5 - 3.2 ALTERNATIVES RULE1 / RULE2 ................................... 6 - 3.3 INCREMENTAL ALTERNATIVES RULE1 =/ RULE2 .................... 6 - 3.4 VALUE RANGE ALTERNATIVES %C##-## ........................... 7 - 3.5 SEQUENCE GROUP (RULE1 RULE2) ................................. 7 - 3.6 VARIABLE REPETITION *RULE .................................... 8 - 3.7 SPECIFIC REPETITION NRULE .................................... 8 - 3.8 OPTIONAL SEQUENCE [RULE] ..................................... 8 - 3.9 ; COMMENT .................................................... 8 - 3.10 OPERATOR PRECEDENCE ......................................... 9 - - 4. ABNF DEFINITION OF ABNF ....................................... 9 - - 5. SECURITY CONSIDERATIONS ....................................... 10 - - - - -Crocker & Overell Standards Track [Page 1] - -RFC 2234 ABNF for Syntax Specifications November 1997 - - - 6. APPENDIX A - CORE ............................................. 11 - 6.1 CORE RULES ................................................... 11 - 6.2 COMMON ENCODING .............................................. 12 - - 7. ACKNOWLEDGMENTS ............................................... 12 - - 8. REFERENCES .................................................... 13 - - 9. CONTACT ....................................................... 13 - - 10. FULL COPYRIGHT STATEMENT ..................................... 14 - -1. INTRODUCTION - - Internet technical specifications often need to define a format - syntax and are free to employ whatever notation their authors deem - useful. Over the years, a modified version of Backus-Naur Form - (BNF), called Augmented BNF (ABNF), has been popular among many - Internet specifications. It balances compactness and simplicity, - with reasonable representational power. In the early days of the - Arpanet, each specification contained its own definition of ABNF. - This included the email specifications, RFC733 and then RFC822 which - have come to be the common citations for defining ABNF. The current - document separates out that definition, to permit selective - reference. Predictably, it also provides some modifications and - enhancements. - - The differences between standard BNF and ABNF involve naming rules, - repetition, alternatives, order-independence, and value ranges. - Appendix A (Core) supplies rule definitions and encoding for a core - lexical analyzer of the type common to several Internet - specifications. It is provided as a convenience and is otherwise - separate from the meta language defined in the body of this document, - and separate from its formal status. - -2. RULE DEFINITION - -2.1 Rule Naming - - The name of a rule is simply the name itself; that is, a sequence of - characters, beginning with an alphabetic character, and followed by - a combination of alphabetics, digits and hyphens (dashes). - - NOTE: Rule names are case-insensitive - - The names , , and all refer - to the same rule. - - - - -Crocker & Overell Standards Track [Page 2] - -RFC 2234 ABNF for Syntax Specifications November 1997 - - - Unlike original BNF, angle brackets ("<", ">") are not required. - However, angle brackets may be used around a rule name whenever their - presence will facilitate discerning the use of a rule name. This is - typically restricted to rule name references in free-form prose, or - to distinguish partial rules that combine into a string not separated - by white space, such as shown in the discussion about repetition, - below. - -2.2 Rule Form - - A rule is defined by the following sequence: - - name = elements crlf - - where is the name of the rule, is one or more rule - names or terminal specifications and is the end-of- line - indicator, carriage return followed by line feed. The equal sign - separates the name from the definition of the rule. The elements - form a sequence of one or more rule names and/or value definitions, - combined according to the various operators, defined in this - document, such as alternative and repetition. - - For visual ease, rule definitions are left aligned. When a rule - requires multiple lines, the continuation lines are indented. The - left alignment and indentation are relative to the first lines of the - ABNF rules and need not match the left margin of the document. - -2.3 Terminal Values - - Rules resolve into a string of terminal values, sometimes called - characters. In ABNF a character is merely a non-negative integer. - In certain contexts a specific mapping (encoding) of values into a - character set (such as ASCII) will be specified. - - Terminals are specified by one or more numeric characters with the - base interpretation of those characters indicated explicitly. The - following bases are currently defined: - - b = binary - - d = decimal - - x = hexadecimal - - - - - - - - -Crocker & Overell Standards Track [Page 3] - -RFC 2234 ABNF for Syntax Specifications November 1997 - - - Hence: - - CR = %d13 - - CR = %x0D - - respectively specify the decimal and hexadecimal representation of - [US-ASCII] for carriage return. - - A concatenated string of such values is specified compactly, using a - period (".") to indicate separation of characters within that value. - Hence: - - CRLF = %d13.10 - - ABNF permits specifying literal text string directly, enclosed in - quotation-marks. Hence: - - command = "command string" - - Literal text strings are interpreted as a concatenated set of - printable characters. - - NOTE: ABNF strings are case-insensitive and - the character set for these strings is us-ascii. - - Hence: - - rulename = "abc" - - and: - - rulename = "aBc" - - will match "abc", "Abc", "aBc", "abC", "ABc", "aBC", "AbC" and "ABC". - - To specify a rule which IS case SENSITIVE, - specify the characters individually. - - For example: - - rulename = %d97 %d98 %d99 - - or - - rulename = %d97.98.99 - - - - - -Crocker & Overell Standards Track [Page 4] - -RFC 2234 ABNF for Syntax Specifications November 1997 - - - will match only the string which comprises only lowercased - characters, abc. - -2.4 External Encodings - - External representations of terminal value characters will vary - according to constraints in the storage or transmission environment. - Hence, the same ABNF-based grammar may have multiple external - encodings, such as one for a 7-bit US-ASCII environment, another for - a binary octet environment and still a different one when 16-bit - Unicode is used. Encoding details are beyond the scope of ABNF, - although Appendix A (Core) provides definitions for a 7-bit US-ASCII - environment as has been common to much of the Internet. - - By separating external encoding from the syntax, it is intended that - alternate encoding environments can be used for the same syntax. - -3. OPERATORS - -3.1 Concatenation Rule1 Rule2 - - A rule can define a simple, ordered string of values -- i.e., a - concatenation of contiguous characters -- by listing a sequence of - rule names. For example: - - foo = %x61 ; a - - bar = %x62 ; b - - mumble = foo bar foo - - So that the rule matches the lowercase string "aba". - - LINEAR WHITE SPACE: Concatenation is at the core of the ABNF - parsing model. A string of contiguous characters (values) is - parsed according to the rules defined in ABNF. For Internet - specifications, there is some history of permitting linear white - space (space and horizontal tab) to be freelyPand - implicitlyPinterspersed around major constructs, such as - delimiting special characters or atomic strings. - - NOTE: This specification for ABNF does not - provide for implicit specification of linear white - space. - - Any grammar which wishes to permit linear white space around - delimiters or string segments must specify it explicitly. It is - often useful to provide for such white space in "core" rules that are - - - -Crocker & Overell Standards Track [Page 5] - -RFC 2234 ABNF for Syntax Specifications November 1997 - - - then used variously among higher-level rules. The "core" rules might - be formed into a lexical analyzer or simply be part of the main - ruleset. - -3.2 Alternatives Rule1 / Rule2 - - Elements separated by forward slash ("/") are alternatives. - Therefore, - - foo / bar - - will accept or . - - NOTE: A quoted string containing alphabetic - characters is special form for specifying alternative - characters and is interpreted as a non-terminal - representing the set of combinatorial strings with the - contained characters, in the specified order but with - any mixture of upper and lower case.. - -3.3 Incremental Alternatives Rule1 =/ Rule2 - - It is sometimes convenient to specify a list of alternatives in - fragments. That is, an initial rule may match one or more - alternatives, with later rule definitions adding to the set of - alternatives. This is particularly useful for otherwise- independent - specifications which derive from the same parent rule set, such as - often occurs with parameter lists. ABNF permits this incremental - definition through the construct: - - oldrule =/ additional-alternatives - - So that the rule set - - ruleset = alt1 / alt2 - - ruleset =/ alt3 - - ruleset =/ alt4 / alt5 - - is the same as specifying - - ruleset = alt1 / alt2 / alt3 / alt4 / alt5 - - - - - - - - -Crocker & Overell Standards Track [Page 6] - -RFC 2234 ABNF for Syntax Specifications November 1997 - - -3.4 Value Range Alternatives %c##-## - - A range of alternative numeric values can be specified compactly, - using dash ("-") to indicate the range of alternative values. Hence: - - DIGIT = %x30-39 - - is equivalent to: - - DIGIT = "0" / "1" / "2" / "3" / "4" / "5" / "6" / - - "7" / "8" / "9" - - Concatenated numeric values and numeric value ranges can not be - specified in the same string. A numeric value may use the dotted - notation for concatenation or it may use the dash notation to specify - one value range. Hence, to specify one printable character, between - end of line sequences, the specification could be: - - char-line = %x0D.0A %x20-7E %x0D.0A - -3.5 Sequence Group (Rule1 Rule2) - - Elements enclosed in parentheses are treated as a single element, - whose contents are STRICTLY ORDERED. Thus, - - elem (foo / bar) blat - - which matches (elem foo blat) or (elem bar blat). - - elem foo / bar blat - - matches (elem foo) or (bar blat). - - NOTE: It is strongly advised to use grouping - notation, rather than to rely on proper reading of - "bare" alternations, when alternatives consist of - multiple rule names or literals. - - Hence it is recommended that instead of the above form, the form: - - (elem foo) / (bar blat) - - be used. It will avoid misinterpretation by casual readers. - - The sequence group notation is also used within free text to set off - an element sequence from the prose. - - - - -Crocker & Overell Standards Track [Page 7] - -RFC 2234 ABNF for Syntax Specifications November 1997 - - -3.6 Variable Repetition *Rule - - The operator "*" preceding an element indicates repetition. The full - form is: - - *element - - where and are optional decimal values, indicating at least - and at most occurrences of element. - - Default values are 0 and infinity so that * allows any - number, including zero; 1* requires at least one; - 3*3 allows exactly 3 and 1*2 allows one or two. - -3.7 Specific Repetition nRule - - A rule of the form: - - element - - is equivalent to - - *element - - That is, exactly occurrences of . Thus 2DIGIT is a - 2-digit number, and 3ALPHA is a string of three alphabetic - characters. - -3.8 Optional Sequence [RULE] - - Square brackets enclose an optional element sequence: - - [foo bar] - - is equivalent to - - *1(foo bar). - -3.9 ; Comment - - A semi-colon starts a comment that continues to the end of line. - This is a simple way of including useful notes in parallel with the - specifications. - - - - - - - - -Crocker & Overell Standards Track [Page 8] - -RFC 2234 ABNF for Syntax Specifications November 1997 - - -3.10 Operator Precedence - - The various mechanisms described above have the following precedence, - from highest (binding tightest) at the top, to lowest and loosest at - the bottom: - - Strings, Names formation - Comment - Value range - Repetition - Grouping, Optional - Concatenation - Alternative - - Use of the alternative operator, freely mixed with concatenations can - be confusing. - - Again, it is recommended that the grouping operator be used to - make explicit concatenation groups. - -4. ABNF DEFINITION OF ABNF - - This syntax uses the rules provided in Appendix A (Core). - - rulelist = 1*( rule / (*c-wsp c-nl) ) - - rule = rulename defined-as elements c-nl - ; continues if next line starts - ; with white space - - rulename = ALPHA *(ALPHA / DIGIT / "-") - - defined-as = *c-wsp ("=" / "=/") *c-wsp - ; basic rules definition and - ; incremental alternatives - - elements = alternation *c-wsp - - c-wsp = WSP / (c-nl WSP) - - c-nl = comment / CRLF - ; comment or newline - - comment = ";" *(WSP / VCHAR) CRLF - - alternation = concatenation - *(*c-wsp "/" *c-wsp concatenation) - - - - -Crocker & Overell Standards Track [Page 9] - -RFC 2234 ABNF for Syntax Specifications November 1997 - - - concatenation = repetition *(1*c-wsp repetition) - - repetition = [repeat] element - - repeat = 1*DIGIT / (*DIGIT "*" *DIGIT) - - element = rulename / group / option / - char-val / num-val / prose-val - - group = "(" *c-wsp alternation *c-wsp ")" - - option = "[" *c-wsp alternation *c-wsp "]" - - char-val = DQUOTE *(%x20-21 / %x23-7E) DQUOTE - ; quoted string of SP and VCHAR - without DQUOTE - - num-val = "%" (bin-val / dec-val / hex-val) - - bin-val = "b" 1*BIT - [ 1*("." 1*BIT) / ("-" 1*BIT) ] - ; series of concatenated bit values - ; or single ONEOF range - - dec-val = "d" 1*DIGIT - [ 1*("." 1*DIGIT) / ("-" 1*DIGIT) ] - - hex-val = "x" 1*HEXDIG - [ 1*("." 1*HEXDIG) / ("-" 1*HEXDIG) ] - - prose-val = "<" *(%x20-3D / %x3F-7E) ">" - ; bracketed string of SP and VCHAR - without angles - ; prose description, to be used as - last resort - - -5. SECURITY CONSIDERATIONS - - Security is truly believed to be irrelevant to this document. - - - - - - - - - - - -Crocker & Overell Standards Track [Page 10] - -RFC 2234 ABNF for Syntax Specifications November 1997 - - -6. APPENDIX A - CORE - - This Appendix is provided as a convenient core for specific grammars. - The definitions may be used as a core set of rules. - -6.1 Core Rules - - Certain basic rules are in uppercase, such as SP, HTAB, CRLF, - DIGIT, ALPHA, etc. - - ALPHA = %x41-5A / %x61-7A ; A-Z / a-z - - BIT = "0" / "1" - - CHAR = %x01-7F - ; any 7-bit US-ASCII character, - excluding NUL - - CR = %x0D - ; carriage return - - CRLF = CR LF - ; Internet standard newline - - CTL = %x00-1F / %x7F - ; controls - - DIGIT = %x30-39 - ; 0-9 - - DQUOTE = %x22 - ; " (Double Quote) - - HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F" - - HTAB = %x09 - ; horizontal tab - - LF = %x0A - ; linefeed - - LWSP = *(WSP / CRLF WSP) - ; linear white space (past newline) - - OCTET = %x00-FF - ; 8 bits of data - - SP = %x20 - - - -Crocker & Overell Standards Track [Page 11] - -RFC 2234 ABNF for Syntax Specifications November 1997 - - - ; space - - VCHAR = %x21-7E - ; visible (printing) characters - - WSP = SP / HTAB - ; white space - -6.2 Common Encoding - - Externally, data are represented as "network virtual ASCII", namely - 7-bit US-ASCII in an 8-bit field, with the high (8th) bit set to - zero. A string of values is in "network byte order" with the - higher-valued bytes represented on the left-hand side and being sent - over the network first. - -7. ACKNOWLEDGMENTS - - The syntax for ABNF was originally specified in RFC 733. Ken L. - Harrenstien, of SRI International, was responsible for re-coding the - BNF into an augmented BNF that makes the representation smaller and - easier to understand. - - This recent project began as a simple effort to cull out the portion - of RFC 822 which has been repeatedly cited by non-email specification - writers, namely the description of augmented BNF. Rather than simply - and blindly converting the existing text into a separate document, - the working group chose to give careful consideration to the - deficiencies, as well as benefits, of the existing specification and - related specifications available over the last 15 years and therefore - to pursue enhancement. This turned the project into something rather - more ambitious than first intended. Interestingly the result is not - massively different from that original, although decisions such as - removing the list notation came as a surprise. - - The current round of specification was part of the DRUMS working - group, with significant contributions from Jerome Abela , Harald - Alvestrand, Robert Elz, Roger Fajman, Aviva Garrett, Tom Harsch, Dan - Kohn, Bill McQuillan, Keith Moore, Chris Newman , Pete Resnick and - Henning Schulzrinne. - - - - - - - - - - - -Crocker & Overell Standards Track [Page 12] - -RFC 2234 ABNF for Syntax Specifications November 1997 - - -8. REFERENCES - - [US-ASCII] Coded Character Set--7-Bit American Standard Code for - Information Interchange, ANSI X3.4-1986. - - [RFC733] Crocker, D., Vittal, J., Pogran, K., and D. Henderson, - "Standard for the Format of ARPA Network Text Message," RFC 733, - November 1977. - - [RFC822] Crocker, D., "Standard for the Format of ARPA Internet Text - Messages", STD 11, RFC 822, August 1982. - -9. CONTACT - - David H. Crocker Paul Overell - - Internet Mail Consortium Demon Internet Ltd - 675 Spruce Dr. Dorking Business Park - Sunnyvale, CA 94086 USA Dorking - Surrey, RH4 1HN - UK - - Phone: +1 408 246 8253 - Fax: +1 408 249 6205 - EMail: dcrocker@imc.org paulo@turnpike.com - - - - - - - - - - - - - - - - - - - - - - - - - - -Crocker & Overell Standards Track [Page 13] - -RFC 2234 ABNF for Syntax Specifications November 1997 - - -10. Full Copyright Statement - - Copyright (C) The Internet Society (1997). All Rights Reserved. - - This document and translations of it may be copied and furnished to - others, and derivative works that comment on or otherwise explain it - or assist in its implementation may be prepared, copied, published - and distributed, in whole or in part, without restriction of any - kind, provided that the above copyright notice and this paragraph are - included on all such copies and derivative works. However, this - document itself may not be modified in any way, such as by removing - the copyright notice or references to the Internet Society or other - Internet organizations, except as needed for the purpose of - developing Internet standards in which case the procedures for - copyrights defined in the Internet Standards process must be - followed, or as required to translate it into languages other than - English. - - The limited permissions granted above are perpetual and will not be - revoked by the Internet Society or its successors or assigns. - - This document and the information contained herein is provided on an - "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING - TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION - HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF - MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - - - - - - - - - - - - - - - - - - - - - - - - -Crocker & Overell Standards Track [Page 14] - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2487.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2487.txt deleted file mode 100644 index fb1305f..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2487.txt +++ /dev/null @@ -1,451 +0,0 @@ - - - - - - -Network Working Group P. Hoffman -Request for Comments: 2487 Internet Mail Consortium -Category: Standards Track January 1999 - - - SMTP Service Extension for Secure SMTP over TLS - -Status of this Memo - - This document specifies an Internet standards track protocol for the - Internet community, and requests discussion and suggestions for - improvements. Please refer to the current edition of the "Internet - Official Protocol Standards" (STD 1) for the standardization state - and status of this protocol. Distribution of this memo is unlimited. - -Copyright Notice - - Copyright (C) The Internet Society (1999). All Rights Reserved. - -1. Abstract - - This document describes an extension to the SMTP service that allows - an SMTP server and client to use transport-layer security to provide - private, authenticated communication over the Internet. This gives - SMTP agents the ability to protect some or all of their - communications from eavesdroppers and attackers. - -2. Introduction - - SMTP [RFC-821] servers and clients normally communicate in the clear - over the Internet. In many cases, this communication goes through one - or more router that is not controlled or trusted by either entity. - Such an untrusted router might allow a third party to monitor or - alter the communications between the server and client. - - Further, there is often a desire for two SMTP agents to be able to - authenticate each others' identities. For example, a secure SMTP - server might only allow communications from other SMTP agents it - knows, or it might act differently for messages received from an - agent it knows than from one it doesn't know. - - TLS [TLS], more commonly known as SSL, is a popular mechanism for - enhancing TCP communications with privacy and authentication. TLS is - in wide use with the HTTP protocol, and is also being used for adding - security to many other common protocols that run over TCP. - - - - - - -Hoffman Standards Track [Page 1] - -RFC 2487 SMTP Service Extension January 1999 - - -2.1 Terminology - - The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", - "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this - document are to be interpreted as described in [RFC-2119]. - -3. STARTTLS Extension - - The STARTTLS extension to SMTP is laid out as follows: - - (1) the name of the SMTP service defined here is STARTTLS; - - (2) the EHLO keyword value associated with the extension is STARTTLS; - - (3) the STARTTLS keyword has no parameters; - - (4) a new SMTP verb, "STARTTLS", is defined; - - (5) no additional parameters are added to any SMTP command. - -4. The STARTTLS Keyword - - The STARTTLS keyword is used to tell the SMTP client that the SMTP - server allows use of TLS. It takes no parameters. - -5. The STARTTLS Command - - The format for the STARTTLS command is: - - STARTTLS - - with no parameters. - - After the client gives the STARTTLS command, the server responds with - one of the following reply codes: - - 220 Ready to start TLS - 501 Syntax error (no parameters allowed) - 454 TLS not available due to temporary reason - - A publicly-referenced SMTP server MUST NOT require use of the - STARTTLS extension in order to deliver mail locally. This rule - prevents the STARTTLS extension from damaging the interoperability of - the Internet's SMTP infrastructure. A publicly-referenced SMTP server - is an SMTP server which runs on port 25 of an Internet host listed in - the MX record (or A record if an MX record is not present) for the - domain name on the right hand side of an Internet mail address. - - - - -Hoffman Standards Track [Page 2] - -RFC 2487 SMTP Service Extension January 1999 - - - Any SMTP server may refuse to accept messages for relay based on - authentication supplied during the TLS negotiation. An SMTP server - that is not publicly referenced may refuse to accept any messages for - relay or local delivery based on authentication supplied during the - TLS negotiation. - - A SMTP server that is not publicly referenced may choose to require - that the client perform a TLS negotiation before accepting any - commands. In this case, the server SHOULD return the reply code: - - 530 Must issue a STARTTLS command first - - to every command other than NOOP, EHLO, STARTTLS, or QUIT. If the - client and server are using the ENHANCEDSTATUSCODES ESMTP extension - [RFC-2034], the status code to be returned SHOULD be 5.7.0. - - After receiving a 220 response to a STARTTLS command, the client - SHOULD start the TLS negotiation before giving any other SMTP - commands. - - If the SMTP client is using pipelining as defined in RFC 1854, the - STARTTLS command must be the last command in a group. - -5.1 Processing After the STARTTLS Command - - After the TLS handshake has been completed, both parties MUST - immediately decide whether or not to continue based on the - authentication and privacy achieved. The SMTP client and server may - decide to move ahead even if the TLS negotiation ended with no - authentication and/or no privacy because most SMTP services are - performed with no authentication and no privacy, but some SMTP - clients or servers may want to continue only if a particular level of - authentication and/or privacy was achieved. - - If the SMTP client decides that the level of authentication or - privacy is not high enough for it to continue, it SHOULD issue an - SMTP QUIT command immediately after the TLS negotiation is complete. - If the SMTP server decides that the level of authentication or - privacy is not high enough for it to continue, it SHOULD reply to - every SMTP command from the client (other than a QUIT command) with - the 554 reply code (with a possible text string such as "Command - refused due to lack of security"). - - The decision of whether or not to believe the authenticity of the - other party in a TLS negotiation is a local matter. However, some - general rules for the decisions are: - - - - - -Hoffman Standards Track [Page 3] - -RFC 2487 SMTP Service Extension January 1999 - - - - A SMTP client would probably only want to authenticate an SMTP - server whose server certificate has a domain name that is the - domain name that the client thought it was connecting to. - - A publicly-referenced SMTP server would probably want to accept - any certificate from an SMTP client, and would possibly want to - put distinguishing information about the certificate in the - Received header of messages that were relayed or submitted from - the client. - -5.2 Result of the STARTTLS Command - - Upon completion of the TLS handshake, the SMTP protocol is reset to - the initial state (the state in SMTP after a server issues a 220 - service ready greeting). The server MUST discard any knowledge - obtained from the client, such as the argument to the EHLO command, - which was not obtained from the TLS negotiation itself. The client - MUST discard any knowledge obtained from the server, such as the list - of SMTP service extensions, which was not obtained from the TLS - negotiation itself. The client SHOULD send an EHLO command as the - first command after a successful TLS negotiation. - - The list of SMTP service extensions returned in response to an EHLO - command received after the TLS handshake MAY be different than the - list returned before the TLS handshake. For example, an SMTP server - might not want to advertise support for a particular SASL mechanism - [SASL] unless a client has sent an appropriate client certificate - during a TLS handshake. - - Both the client and the server MUST know if there is a TLS session - active. A client MUST NOT attempt to start a TLS session if a TLS - session is already active. A server MUST NOT return the TLS extension - in response to an EHLO command received after a TLS handshake has - completed. - -6. Usage Example - - The following dialog illustrates how a client and server can start a - TLS session: - - S: - C: - S: 220 mail.imc.org SMTP service ready - C: EHLO mail.ietf.org - S: 250-mail.imc.org offers a warm hug of welcome - S: 250 STARTTLS - C: STARTTLS - S: 220 Go ahead - C: - - - -Hoffman Standards Track [Page 4] - -RFC 2487 SMTP Service Extension January 1999 - - - C & S: - C & S: - C: - . . . - -7. Security Considerations - - It should be noted that SMTP is not an end-to-end mechanism. Thus, if - an SMTP client/server pair decide to add TLS privacy, they are not - securing the transport from the originating mail user agent to the - recipient. Further, because delivery of a single piece of mail may - go between more than two SMTP servers, adding TLS privacy to one pair - of servers does not mean that the entire SMTP chain has been made - private. Further, just because an SMTP server can authenticate an - SMTP client, it does not mean that the mail from the SMTP client was - authenticated by the SMTP client when the client received it. - - Both the STMP client and server must check the result of the TLS - negotiation to see whether acceptable authentication or privacy was - achieved. Ignoring this step completely invalidates using TLS for - security. The decision about whether acceptable authentication or - privacy was achieved is made locally, is implementation-dependant, - and is beyond the scope of this document. - - The SMTP client and server should note carefully the result of the - TLS negotiation. If the negotiation results in no privacy, or if it - results in privacy using algorithms or key lengths that are deemed - not strong enough, or if the authentication is not good enough for - either party, the client may choose to end the SMTP session with an - immediate QUIT command, or the server may choose to not accept any - more SMTP commands. - - A server announcing in an EHLO response that it uses a particular TLS - protocol should not pose any security issues, since any use of TLS - will be at least as secure as no use of TLS. - - A man-in-the-middle attack can be launched by deleting the "250 - STARTTLS" response from the server. This would cause the client not - to try to start a TLS session. An SMTP client can protect against - this attack by recording the fact that a particular SMTP server - offers TLS during one session and generating an alarm if it does not - appear in the EHLO response for a later session. The lack of TLS - during a session SHOULD NOT result in the bouncing of email, although - it could result in delayed processing. - - - - - - - -Hoffman Standards Track [Page 5] - -RFC 2487 SMTP Service Extension January 1999 - - - Before the TLS handshake has begun, any protocol interactions are - performed in the clear and may be modified by an active attacker. For - this reason, clients and servers MUST discard any knowledge obtained - prior to the start of the TLS handshake upon completion of the TLS - handshake. - - The STARTTLS extension is not suitable for authenticating the author - of an email message unless every hop in the delivery chain, including - the submission to the first SMTP server, is authenticated. Another - proposal [SMTP-AUTH] can be used to authenticate delivery and MIME - security multiparts [MIME-SEC] can be used to authenticate the author - of an email message. In addition, the [SMTP-AUTH] proposal offers - simpler and more flexible options to authenticate an SMTP client and - the SASL EXTERNAL mechanism [SASL] MAY be used in conjunction with - the STARTTLS command to provide an authorization identity. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Hoffman Standards Track [Page 6] - -RFC 2487 SMTP Service Extension January 1999 - - -A. References - - [RFC-821] Postel, J., "Simple Mail Transfer Protocol", RFC 821, - August 1982. - - [RFC-1869] Klensin, J., Freed, N, Rose, M, Stefferud, E. and D. - Crocker, "SMTP Service Extensions", STD 10, RFC 1869, - November 1995. - - [RFC-2034] Freed, N., "SMTP Service Extension for Returning Enhanced - Error Codes", RFC 2034, October 1996. - - [RFC-2119] Bradner, S., "Key words for use in RFCs to Indicate - Requirement Levels", BCP 14, RFC 2119, March 1997. - - [SASL] Myers, J., "Simple Authentication and Security Layer - (SASL)", RFC 2222, October 1997. - - [SMTP-AUTH] "SMTP Service Extension for Authentication", Work in - Progress. - - [TLS] Dierks, T. and C. Allen, "The TLS Protocol Version 1.0", - RFC 2246, January 1999. - -B. Author's Address - - Paul Hoffman - Internet Mail Consortium - 127 Segre Place - Santa Cruz, CA 95060 - - Phone: (831) 426-9827 - EMail: phoffman@imc.org - - - - - - - - - - - - - - - - - - -Hoffman Standards Track [Page 7] - -RFC 2487 SMTP Service Extension January 1999 - - -C. Full Copyright Statement - - Copyright (C) The Internet Society (1999). All Rights Reserved. - - This document and translations of it may be copied and furnished to - others, and derivative works that comment on or otherwise explain it - or assist in its implementation may be prepared, copied, published - and distributed, in whole or in part, without restriction of any - kind, provided that the above copyright notice and this paragraph are - included on all such copies and derivative works. However, this - document itself may not be modified in any way, such as by removing - the copyright notice or references to the Internet Society or other - Internet organizations, except as needed for the purpose of - developing Internet standards in which case the procedures for - copyrights defined in the Internet Standards process must be - followed, or as required to translate it into languages other than - English. - - The limited permissions granted above are perpetual and will not be - revoked by the Internet Society or its successors or assigns. - - This document and the information contained herein is provided on an - "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING - TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION - HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF - MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - - - - - - - - - - - - - - - - - - - - - - - - -Hoffman Standards Track [Page 8] - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2554.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2554.txt deleted file mode 100644 index 2922dea..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2554.txt +++ /dev/null @@ -1,619 +0,0 @@ - - - - - - -Network Working Group J. Myers -Request for Comments: 2554 Netscape Communications -Category: Standards Track March 1999 - - - SMTP Service Extension - for Authentication - -Status of this Memo - - This document specifies an Internet standards track protocol for the - Internet community, and requests discussion and suggestions for - improvements. Please refer to the current edition of the "Internet - Official Protocol Standards" (STD 1) for the standardization state - and status of this protocol. Distribution of this memo is unlimited. - -Copyright Notice - - Copyright (C) The Internet Society (1999). All Rights Reserved. - - -1. Introduction - - This document defines an SMTP service extension [ESMTP] whereby an - SMTP client may indicate an authentication mechanism to the server, - perform an authentication protocol exchange, and optionally negotiate - a security layer for subsequent protocol interactions. This - extension is a profile of the Simple Authentication and Security - Layer [SASL]. - - -2. Conventions Used in this Document - - In examples, "C:" and "S:" indicate lines sent by the client and - server respectively. - - The key words "MUST", "MUST NOT", "SHOULD", "SHOULD NOT", and "MAY" - in this document are to be interpreted as defined in "Key words for - use in RFCs to Indicate Requirement Levels" [KEYWORDS]. - - -3. The Authentication service extension - - - (1) the name of the SMTP service extension is "Authentication" - - (2) the EHLO keyword value associated with this extension is "AUTH" - - - - -Myers Standards Track [Page 1] - -RFC 2554 SMTP Authentication March 1999 - - - (3) The AUTH EHLO keyword contains as a parameter a space separated - list of the names of supported SASL mechanisms. - - (4) a new SMTP verb "AUTH" is defined - - (5) an optional parameter using the keyword "AUTH" is added to the - MAIL FROM command, and extends the maximum line length of the - MAIL FROM command by 500 characters. - - (6) this extension is appropriate for the submission protocol - [SUBMIT]. - - -4. The AUTH command - - AUTH mechanism [initial-response] - - Arguments: - a string identifying a SASL authentication mechanism. - an optional base64-encoded response - - Restrictions: - After an AUTH command has successfully completed, no more AUTH - commands may be issued in the same session. After a successful - AUTH command completes, a server MUST reject any further AUTH - commands with a 503 reply. - - The AUTH command is not permitted during a mail transaction. - - Discussion: - The AUTH command indicates an authentication mechanism to the - server. If the server supports the requested authentication - mechanism, it performs an authentication protocol exchange to - authenticate and identify the user. Optionally, it also - negotiates a security layer for subsequent protocol - interactions. If the requested authentication mechanism is not - supported, the server rejects the AUTH command with a 504 - reply. - - The authentication protocol exchange consists of a series of - server challenges and client answers that are specific to the - authentication mechanism. A server challenge, otherwise known - as a ready response, is a 334 reply with the text part - containing a BASE64 encoded string. The client answer consists - of a line containing a BASE64 encoded string. If the client - wishes to cancel an authentication exchange, it issues a line - with a single "*". If the server receives such an answer, it - MUST reject the AUTH command by sending a 501 reply. - - - -Myers Standards Track [Page 2] - -RFC 2554 SMTP Authentication March 1999 - - - The optional initial-response argument to the AUTH command is - used to save a round trip when using authentication mechanisms - that are defined to send no data in the initial challenge. - When the initial-response argument is used with such a - mechanism, the initial empty challenge is not sent to the - client and the server uses the data in the initial-response - argument as if it were sent in response to the empty challenge. - Unlike a zero-length client answer to a 334 reply, a zero- - length initial response is sent as a single equals sign ("="). - If the client uses an initial-response argument to the AUTH - command with a mechanism that sends data in the initial - challenge, the server rejects the AUTH command with a 535 - reply. - - If the server cannot BASE64 decode the argument, it rejects the - AUTH command with a 501 reply. If the server rejects the - authentication data, it SHOULD reject the AUTH command with a - 535 reply unless a more specific error code, such as one listed - in section 6, is appropriate. Should the client successfully - complete the authentication exchange, the SMTP server issues a - 235 reply. - - The service name specified by this protocol's profile of SASL - is "smtp". - - If a security layer is negotiated through the SASL - authentication exchange, it takes effect immediately following - the CRLF that concludes the authentication exchange for the - client, and the CRLF of the success reply for the server. Upon - a security layer's taking effect, the SMTP protocol is reset to - the initial state (the state in SMTP after a server issues a - 220 service ready greeting). The server MUST discard any - knowledge obtained from the client, such as the argument to the - EHLO command, which was not obtained from the SASL negotiation - itself. The client MUST discard any knowledge obtained from - the server, such as the list of SMTP service extensions, which - was not obtained from the SASL negotiation itself (with the - exception that a client MAY compare the list of advertised SASL - mechanisms before and after authentication in order to detect - an active down-negotiation attack). The client SHOULD send an - EHLO command as the first command after a successful SASL - negotiation which results in the enabling of a security layer. - - The server is not required to support any particular - authentication mechanism, nor are authentication mechanisms - required to support any security layers. If an AUTH command - fails, the client may try another authentication mechanism by - issuing another AUTH command. - - - -Myers Standards Track [Page 3] - -RFC 2554 SMTP Authentication March 1999 - - - If an AUTH command fails, the server MUST behave the same as if - the client had not issued the AUTH command. - - The BASE64 string may in general be arbitrarily long. Clients - and servers MUST be able to support challenges and responses - that are as long as are generated by the authentication - mechanisms they support, independent of any line length - limitations the client or server may have in other parts of its - protocol implementation. - - Examples: - S: 220 smtp.example.com ESMTP server ready - C: EHLO jgm.example.com - S: 250-smtp.example.com - S: 250 AUTH CRAM-MD5 DIGEST-MD5 - C: AUTH FOOBAR - S: 504 Unrecognized authentication type. - C: AUTH CRAM-MD5 - S: 334 - PENCeUxFREJoU0NnbmhNWitOMjNGNndAZWx3b29kLmlubm9zb2Z0LmNvbT4= - C: ZnJlZCA5ZTk1YWVlMDljNDBhZjJiODRhMGMyYjNiYmFlNzg2ZQ== - S: 235 Authentication successful. - - - -5. The AUTH parameter to the MAIL FROM command - - AUTH=addr-spec - - Arguments: - An addr-spec containing the identity which submitted the message - to the delivery system, or the two character sequence "<>" - indicating such an identity is unknown or insufficiently - authenticated. To comply with the restrictions imposed on ESMTP - parameters, the addr-spec is encoded inside an xtext. The syntax - of an xtext is described in section 5 of [ESMTP-DSN]. - - Discussion: - The optional AUTH parameter to the MAIL FROM command allows - cooperating agents in a trusted environment to communicate the - authentication of individual messages. - - If the server trusts the authenticated identity of the client to - assert that the message was originally submitted by the supplied - addr-spec, then the server SHOULD supply the same addr-spec in an - AUTH parameter when relaying the message to any server which - supports the AUTH extension. - - - - -Myers Standards Track [Page 4] - -RFC 2554 SMTP Authentication March 1999 - - - A MAIL FROM parameter of AUTH=<> indicates that the original - submitter of the message is not known. The server MUST NOT treat - the message as having been originally submitted by the client. - - If the AUTH parameter to the MAIL FROM is not supplied, the - client has authenticated, and the server believes the message is - an original submission by the client, the server MAY supply the - client's identity in the addr-spec in an AUTH parameter when - relaying the message to any server which supports the AUTH - extension. - - If the server does not sufficiently trust the authenticated - identity of the client, or if the client is not authenticated, - then the server MUST behave as if the AUTH=<> parameter was - supplied. The server MAY, however, write the value of the AUTH - parameter to a log file. - - If an AUTH=<> parameter was supplied, either explicitly or due to - the requirement in the previous paragraph, then the server MUST - supply the AUTH=<> parameter when relaying the message to any - server which it has authenticated to using the AUTH extension. - - A server MAY treat expansion of a mailing list as a new - submission, setting the AUTH parameter to the mailing list - address or mailing list administration address when relaying the - message to list subscribers. - - It is conforming for an implementation to be hard-coded to treat - all clients as being insufficiently trusted. In that case, the - implementation does nothing more than parse and discard - syntactically valid AUTH parameters to the MAIL FROM command and - supply AUTH=<> parameters to any servers to which it - authenticates using the AUTH extension. - - Examples: - C: MAIL FROM: AUTH=e+3Dmc2@example.com - S: 250 OK - - - - - - - - - - - - - - -Myers Standards Track [Page 5] - -RFC 2554 SMTP Authentication March 1999 - - -6. Error Codes - - The following error codes may be used to indicate various conditions - as described. - - 432 A password transition is needed - - This response to the AUTH command indicates that the user needs to - transition to the selected authentication mechanism. This typically - done by authenticating once using the PLAIN authentication mechanism. - - 534 Authentication mechanism is too weak - - This response to the AUTH command indicates that the selected - authentication mechanism is weaker than server policy permits for - that user. - - 538 Encryption required for requested authentication mechanism - - This response to the AUTH command indicates that the selected - authentication mechanism may only be used when the underlying SMTP - connection is encrypted. - - 454 Temporary authentication failure - - This response to the AUTH command indicates that the authentication - failed due to a temporary server failure. - - 530 Authentication required - - This response may be returned by any command other than AUTH, EHLO, - HELO, NOOP, RSET, or QUIT. It indicates that server policy requires - authentication in order to perform the requested action. - - - - - - - - - - - - - - - - - - -Myers Standards Track [Page 6] - -RFC 2554 SMTP Authentication March 1999 - - -7. Formal Syntax - - The following syntax specification uses the augmented Backus-Naur - Form (BNF) notation as specified in [ABNF]. - - Except as noted otherwise, all alphabetic characters are case- - insensitive. The use of upper or lower case characters to define - token strings is for editorial clarity only. Implementations MUST - accept these strings in a case-insensitive fashion. - - UPALPHA = %x41-5A ;; Uppercase: A-Z - - LOALPHA = %x61-7A ;; Lowercase: a-z - - ALPHA = UPALPHA / LOALPHA ;; case insensitive - - DIGIT = %x30-39 ;; Digits 0-9 - - HEXDIGIT = %x41-46 / DIGIT ;; hexidecimal digit (uppercase) - - hexchar = "+" HEXDIGIT HEXDIGIT - - xchar = %x21-2A / %x2C-3C / %x3E-7E - ;; US-ASCII except for "+", "=", SPACE and CTL - - xtext = *(xchar / hexchar) - - AUTH_CHAR = ALPHA / DIGIT / "-" / "_" - - auth_type = 1*20AUTH_CHAR - - auth_command = "AUTH" SPACE auth_type [SPACE (base64 / "=")] - *(CRLF [base64]) CRLF - - auth_param = "AUTH=" xtext - ;; The decoded form of the xtext MUST be either - ;; an addr-spec or the two characters "<>" - - base64 = base64_terminal / - ( 1*(4base64_CHAR) [base64_terminal] ) - - base64_char = UPALPHA / LOALPHA / DIGIT / "+" / "/" - ;; Case-sensitive - - base64_terminal = (2base64_char "==") / (3base64_char "=") - - continue_req = "334" SPACE [base64] CRLF - - - - -Myers Standards Track [Page 7] - -RFC 2554 SMTP Authentication March 1999 - - - CR = %x0C ;; ASCII CR, carriage return - - CRLF = CR LF - - CTL = %x00-1F / %x7F ;; any ASCII control character and DEL - - LF = %x0A ;; ASCII LF, line feed - - SPACE = %x20 ;; ASCII SP, space - - - - -8. References - - [ABNF] Crocker, D. and P. Overell, "Augmented BNF for Syntax - Specifications: ABNF", RFC 2234, November 1997. - - [CRAM-MD5] Klensin, J., Catoe, R. and P. Krumviede, "IMAP/POP - AUTHorize Extension for Simple Challenge/Response", RFC - 2195, September 1997. - - [ESMTP] Klensin, J., Freed, N., Rose, M., Stefferud, E. and D. - Crocker, "SMTP Service Extensions", RFC 1869, November - 1995. - - [ESMTP-DSN] Moore, K, "SMTP Service Extension for Delivery Status - Notifications", RFC 1891, January 1996. - - [KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate - Requirement Levels", BCP 14, RFC 2119, March 1997. - - [SASL] Myers, J., "Simple Authentication and Security Layer - (SASL)", RFC 2222, October 1997. - - [SUBMIT] Gellens, R. and J. Klensin, "Message Submission", RFC - 2476, December 1998. - - [RFC821] Postel, J., "Simple Mail Transfer Protocol", STD 10, RFC - 821, August 1982. - - [RFC822] Crocker, D., "Standard for the Format of ARPA Internet - Text Messages", STD 11, RFC 822, August 1982. - - - - - - - - -Myers Standards Track [Page 8] - -RFC 2554 SMTP Authentication March 1999 - - -9. Security Considerations - - Security issues are discussed throughout this memo. - - If a client uses this extension to get an encrypted tunnel through an - insecure network to a cooperating server, it needs to be configured - to never send mail to that server when the connection is not mutually - authenticated and encrypted. Otherwise, an attacker could steal the - client's mail by hijacking the SMTP connection and either pretending - the server does not support the Authentication extension or causing - all AUTH commands to fail. - - Before the SASL negotiation has begun, any protocol interactions are - performed in the clear and may be modified by an active attacker. - For this reason, clients and servers MUST discard any knowledge - obtained prior to the start of the SASL negotiation upon completion - of a SASL negotiation which results in a security layer. - - This mechanism does not protect the TCP port, so an active attacker - may redirect a relay connection attempt to the submission port - [SUBMIT]. The AUTH=<> parameter prevents such an attack from causing - an relayed message without an envelope authentication to pick up the - authentication of the relay client. - - A message submission client may require the user to authenticate - whenever a suitable SASL mechanism is advertised. Therefore, it may - not be desirable for a submission server [SUBMIT] to advertise a SASL - mechanism when use of that mechanism grants the client no benefits - over anonymous submission. - - This extension is not intended to replace or be used instead of end- - to-end message signature and encryption systems such as S/MIME or - PGP. This extension addresses a different problem than end-to-end - systems; it has the following key differences: - - (1) it is generally useful only within a trusted enclave - - (2) it protects the entire envelope of a message, not just the - message's body. - - (3) it authenticates the message submission, not authorship of the - message content - - (4) it can give the sender some assurance the message was - delivered to the next hop in the case where the sender - mutually authenticates with the next hop and negotiates an - appropriate security layer. - - - - -Myers Standards Track [Page 9] - -RFC 2554 SMTP Authentication March 1999 - - - Additional security considerations are mentioned in the SASL - specification [SASL]. - - - -10. Author's Address - - John Gardiner Myers - Netscape Communications - 501 East Middlefield Road - Mail Stop MV-029 - Mountain View, CA 94043 - - EMail: jgmyers@netscape.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Myers Standards Track [Page 10] - -RFC 2554 SMTP Authentication March 1999 - - -11. Full Copyright Statement - - Copyright (C) The Internet Society (1999). All Rights Reserved. - - This document and translations of it may be copied and furnished to - others, and derivative works that comment on or otherwise explain it - or assist in its implementation may be prepared, copied, published - and distributed, in whole or in part, without restriction of any - kind, provided that the above copyright notice and this paragraph are - included on all such copies and derivative works. However, this - document itself may not be modified in any way, such as by removing - the copyright notice or references to the Internet Society or other - Internet organizations, except as needed for the purpose of - developing Internet standards in which case the procedures for - copyrights defined in the Internet Standards process must be - followed, or as required to translate it into languages other than - English. - - The limited permissions granted above are perpetual and will not be - revoked by the Internet Society or its successors or assigns. - - This document and the information contained herein is provided on an - "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING - TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION - HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF - MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - - - - - - - - - - - - - - - - - - - - - - - - -Myers Standards Track [Page 11] - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2821.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2821.txt deleted file mode 100644 index 0eac911..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2821.txt +++ /dev/null @@ -1,4427 +0,0 @@ - - - - - - -Network Working Group J. Klensin, Editor -Request for Comments: 2821 AT&T Laboratories -Obsoletes: 821, 974, 1869 April 2001 -Updates: 1123 -Category: Standards Track - - - Simple Mail Transfer Protocol - -Status of this Memo - - This document specifies an Internet standards track protocol for the - Internet community, and requests discussion and suggestions for - improvements. Please refer to the current edition of the "Internet - Official Protocol Standards" (STD 1) for the standardization state - and status of this protocol. Distribution of this memo is unlimited. - -Copyright Notice - - Copyright (C) The Internet Society (2001). All Rights Reserved. - -Abstract - - This document is a self-contained specification of the basic protocol - for the Internet electronic mail transport. It consolidates, updates - and clarifies, but doesn't add new or change existing functionality - of the following: - - - the original SMTP (Simple Mail Transfer Protocol) specification of - RFC 821 [30], - - - domain name system requirements and implications for mail - transport from RFC 1035 [22] and RFC 974 [27], - - - the clarifications and applicability statements in RFC 1123 [2], - and - - - material drawn from the SMTP Extension mechanisms [19]. - - It obsoletes RFC 821, RFC 974, and updates RFC 1123 (replaces the - mail transport materials of RFC 1123). However, RFC 821 specifies - some features that were not in significant use in the Internet by the - mid-1990s and (in appendices) some additional transport models. - Those sections are omitted here in the interest of clarity and - brevity; readers needing them should refer to RFC 821. - - - - - - -Klensin Standards Track [Page 1] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - It also includes some additional material from RFC 1123 that required - amplification. This material has been identified in multiple ways, - mostly by tracking flaming on various lists and newsgroups and - problems of unusual readings or interpretations that have appeared as - the SMTP extensions have been deployed. Where this specification - moves beyond consolidation and actually differs from earlier - documents, it supersedes them technically as well as textually. - - Although SMTP was designed as a mail transport and delivery protocol, - this specification also contains information that is important to its - use as a 'mail submission' protocol, as recommended for POP [3, 26] - and IMAP [6]. Additional submission issues are discussed in RFC 2476 - [15]. - - Section 2.3 provides definitions of terms specific to this document. - Except when the historical terminology is necessary for clarity, this - document uses the current 'client' and 'server' terminology to - identify the sending and receiving SMTP processes, respectively. - - A companion document [32] discusses message headers, message bodies - and formats and structures for them, and their relationship. - -Table of Contents - - 1. Introduction .................................................. 4 - 2. The SMTP Model ................................................ 5 - 2.1 Basic Structure .............................................. 5 - 2.2 The Extension Model .......................................... 7 - 2.2.1 Background ................................................. 7 - 2.2.2 Definition and Registration of Extensions .................. 8 - 2.3 Terminology .................................................. 9 - 2.3.1 Mail Objects ............................................... 10 - 2.3.2 Senders and Receivers ...................................... 10 - 2.3.3 Mail Agents and Message Stores ............................. 10 - 2.3.4 Host ....................................................... 11 - 2.3.5 Domain ..................................................... 11 - 2.3.6 Buffer and State Table ..................................... 11 - 2.3.7 Lines ...................................................... 12 - 2.3.8 Originator, Delivery, Relay, and Gateway Systems ........... 12 - 2.3.9 Message Content and Mail Data .............................. 13 - 2.3.10 Mailbox and Address ....................................... 13 - 2.3.11 Reply ..................................................... 13 - 2.4 General Syntax Principles and Transaction Model .............. 13 - 3. The SMTP Procedures: An Overview .............................. 15 - 3.1 Session Initiation ........................................... 15 - 3.2 Client Initiation ............................................ 16 - 3.3 Mail Transactions ............................................ 16 - 3.4 Forwarding for Address Correction or Updating ................ 19 - - - -Klensin Standards Track [Page 2] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - 3.5 Commands for Debugging Addresses ............................. 20 - 3.5.1 Overview ................................................... 20 - 3.5.2 VRFY Normal Response ....................................... 22 - 3.5.3 Meaning of VRFY or EXPN Success Response ................... 22 - 3.5.4 Semantics and Applications of EXPN ......................... 23 - 3.6 Domains ...................................................... 23 - 3.7 Relaying ..................................................... 24 - 3.8 Mail Gatewaying .............................................. 25 - 3.8.1 Header Fields in Gatewaying ................................ 26 - 3.8.2 Received Lines in Gatewaying ............................... 26 - 3.8.3 Addresses in Gatewaying .................................... 26 - 3.8.4 Other Header Fields in Gatewaying .......................... 27 - 3.8.5 Envelopes in Gatewaying .................................... 27 - 3.9 Terminating Sessions and Connections ......................... 27 - 3.10 Mailing Lists and Aliases ................................... 28 - 3.10.1 Alias ..................................................... 28 - 3.10.2 List ...................................................... 28 - 4. The SMTP Specifications ....................................... 29 - 4.1 SMTP Commands ................................................ 29 - 4.1.1 Command Semantics and Syntax ............................... 29 - 4.1.1.1 Extended HELLO (EHLO) or HELLO (HELO) ................... 29 - 4.1.1.2 MAIL (MAIL) .............................................. 31 - 4.1.1.3 RECIPIENT (RCPT) ......................................... 31 - 4.1.1.4 DATA (DATA) .............................................. 33 - 4.1.1.5 RESET (RSET) ............................................. 34 - 4.1.1.6 VERIFY (VRFY) ............................................ 35 - 4.1.1.7 EXPAND (EXPN) ............................................ 35 - 4.1.1.8 HELP (HELP) .............................................. 35 - 4.1.1.9 NOOP (NOOP) .............................................. 35 - 4.1.1.10 QUIT (QUIT) ............................................. 36 - 4.1.2 Command Argument Syntax .................................... 36 - 4.1.3 Address Literals ........................................... 38 - 4.1.4 Order of Commands .......................................... 39 - 4.1.5 Private-use Commands ....................................... 40 - 4.2 SMTP Replies ................................................ 40 - 4.2.1 Reply Code Severities and Theory ........................... 42 - 4.2.2 Reply Codes by Function Groups ............................. 44 - 4.2.3 Reply Codes in Numeric Order .............................. 45 - 4.2.4 Reply Code 502 ............................................. 46 - 4.2.5 Reply Codes After DATA and the Subsequent . .... 46 - 4.3 Sequencing of Commands and Replies ........................... 47 - 4.3.1 Sequencing Overview ........................................ 47 - 4.3.2 Command-Reply Sequences .................................... 48 - 4.4 Trace Information ............................................ 49 - 4.5 Additional Implementation Issues ............................. 53 - 4.5.1 Minimum Implementation ..................................... 53 - 4.5.2 Transparency ............................................... 53 - 4.5.3 Sizes and Timeouts ......................................... 54 - - - -Klensin Standards Track [Page 3] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - 4.5.3.1 Size limits and minimums ................................. 54 - 4.5.3.2 Timeouts ................................................. 56 - 4.5.4 Retry Strategies ........................................... 57 - 4.5.4.1 Sending Strategy ......................................... 58 - 4.5.4.2 Receiving Strategy ....................................... 59 - 4.5.5 Messages with a null reverse-path .......................... 59 - 5. Address Resolution and Mail Handling .......................... 60 - 6. Problem Detection and Handling ................................ 62 - 6.1 Reliable Delivery and Replies by Email ....................... 62 - 6.2 Loop Detection ............................................... 63 - 6.3 Compensating for Irregularities .............................. 63 - 7. Security Considerations ....................................... 64 - 7.1 Mail Security and Spoofing ................................... 64 - 7.2 "Blind" Copies ............................................... 65 - 7.3 VRFY, EXPN, and Security ..................................... 65 - 7.4 Information Disclosure in Announcements ...................... 66 - 7.5 Information Disclosure in Trace Fields ....................... 66 - 7.6 Information Disclosure in Message Forwarding ................. 67 - 7.7 Scope of Operation of SMTP Servers ........................... 67 - 8. IANA Considerations ........................................... 67 - 9. References .................................................... 68 - 10. Editor's Address ............................................. 70 - 11. Acknowledgments .............................................. 70 - Appendices ....................................................... 71 - A. TCP Transport Service ......................................... 71 - B. Generating SMTP Commands from RFC 822 Headers ................. 71 - C. Source Routes ................................................. 72 - D. Scenarios ..................................................... 73 - E. Other Gateway Issues .......................................... 76 - F. Deprecated Features of RFC 821 ................................ 76 - Full Copyright Statement ......................................... 79 - -1. Introduction - - The objective of the Simple Mail Transfer Protocol (SMTP) is to - transfer mail reliably and efficiently. - - SMTP is independent of the particular transmission subsystem and - requires only a reliable ordered data stream channel. While this - document specifically discusses transport over TCP, other transports - are possible. Appendices to RFC 821 describe some of them. - - An important feature of SMTP is its capability to transport mail - across networks, usually referred to as "SMTP mail relaying" (see - section 3.8). A network consists of the mutually-TCP-accessible - hosts on the public Internet, the mutually-TCP-accessible hosts on a - firewall-isolated TCP/IP Intranet, or hosts in some other LAN or WAN - environment utilizing a non-TCP transport-level protocol. Using - - - -Klensin Standards Track [Page 4] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - SMTP, a process can transfer mail to another process on the same - network or to some other network via a relay or gateway process - accessible to both networks. - - In this way, a mail message may pass through a number of intermediate - relay or gateway hosts on its path from sender to ultimate recipient. - The Mail eXchanger mechanisms of the domain name system [22, 27] (and - section 5 of this document) are used to identify the appropriate - next-hop destination for a message being transported. - -2. The SMTP Model - -2.1 Basic Structure - - The SMTP design can be pictured as: - - +----------+ +----------+ - +------+ | | | | - | User |<-->| | SMTP | | - +------+ | Client- |Commands/Replies| Server- | - +------+ | SMTP |<-------------->| SMTP | +------+ - | File |<-->| | and Mail | |<-->| File | - |System| | | | | |System| - +------+ +----------+ +----------+ +------+ - SMTP client SMTP server - - When an SMTP client has a message to transmit, it establishes a two- - way transmission channel to an SMTP server. The responsibility of an - SMTP client is to transfer mail messages to one or more SMTP servers, - or report its failure to do so. - - The means by which a mail message is presented to an SMTP client, and - how that client determines the domain name(s) to which mail messages - are to be transferred is a local matter, and is not addressed by this - document. In some cases, the domain name(s) transferred to, or - determined by, an SMTP client will identify the final destination(s) - of the mail message. In other cases, common with SMTP clients - associated with implementations of the POP [3, 26] or IMAP [6] - protocols, or when the SMTP client is inside an isolated transport - service environment, the domain name determined will identify an - intermediate destination through which all mail messages are to be - relayed. SMTP clients that transfer all traffic, regardless of the - target domain names associated with the individual messages, or that - do not maintain queues for retrying message transmissions that - initially cannot be completed, may otherwise conform to this - specification but are not considered fully-capable. Fully-capable - SMTP implementations, including the relays used by these less capable - - - - -Klensin Standards Track [Page 5] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - ones, and their destinations, are expected to support all of the - queuing, retrying, and alternate address functions discussed in this - specification. - - The means by which an SMTP client, once it has determined a target - domain name, determines the identity of an SMTP server to which a - copy of a message is to be transferred, and then performs that - transfer, is covered by this document. To effect a mail transfer to - an SMTP server, an SMTP client establishes a two-way transmission - channel to that SMTP server. An SMTP client determines the address - of an appropriate host running an SMTP server by resolving a - destination domain name to either an intermediate Mail eXchanger host - or a final target host. - - An SMTP server may be either the ultimate destination or an - intermediate "relay" (that is, it may assume the role of an SMTP - client after receiving the message) or "gateway" (that is, it may - transport the message further using some protocol other than SMTP). - SMTP commands are generated by the SMTP client and sent to the SMTP - server. SMTP replies are sent from the SMTP server to the SMTP - client in response to the commands. - - In other words, message transfer can occur in a single connection - between the original SMTP-sender and the final SMTP-recipient, or can - occur in a series of hops through intermediary systems. In either - case, a formal handoff of responsibility for the message occurs: the - protocol requires that a server accept responsibility for either - delivering a message or properly reporting the failure to do so. - - Once the transmission channel is established and initial handshaking - completed, the SMTP client normally initiates a mail transaction. - Such a transaction consists of a series of commands to specify the - originator and destination of the mail and transmission of the - message content (including any headers or other structure) itself. - When the same message is sent to multiple recipients, this protocol - encourages the transmission of only one copy of the data for all - recipients at the same destination (or intermediate relay) host. - - The server responds to each command with a reply; replies may - indicate that the command was accepted, that additional commands are - expected, or that a temporary or permanent error condition exists. - Commands specifying the sender or recipients may include server- - permitted SMTP service extension requests as discussed in section - 2.2. The dialog is purposely lock-step, one-at-a-time, although this - can be modified by mutually-agreed extension requests such as command - pipelining [13]. - - - - - -Klensin Standards Track [Page 6] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - Once a given mail message has been transmitted, the client may either - request that the connection be shut down or may initiate other mail - transactions. In addition, an SMTP client may use a connection to an - SMTP server for ancillary services such as verification of email - addresses or retrieval of mailing list subscriber addresses. - - As suggested above, this protocol provides mechanisms for the - transmission of mail. This transmission normally occurs directly - from the sending user's host to the receiving user's host when the - two hosts are connected to the same transport service. When they are - not connected to the same transport service, transmission occurs via - one or more relay SMTP servers. An intermediate host that acts as - either an SMTP relay or as a gateway into some other transmission - environment is usually selected through the use of the domain name - service (DNS) Mail eXchanger mechanism. - - Usually, intermediate hosts are determined via the DNS MX record, not - by explicit "source" routing (see section 5 and appendices C and - F.2). - -2.2 The Extension Model - -2.2.1 Background - - In an effort that started in 1990, approximately a decade after RFC - 821 was completed, the protocol was modified with a "service - extensions" model that permits the client and server to agree to - utilize shared functionality beyond the original SMTP requirements. - The SMTP extension mechanism defines a means whereby an extended SMTP - client and server may recognize each other, and the server can inform - the client as to the service extensions that it supports. - - Contemporary SMTP implementations MUST support the basic extension - mechanisms. For instance, servers MUST support the EHLO command even - if they do not implement any specific extensions and clients SHOULD - preferentially utilize EHLO rather than HELO. (However, for - compatibility with older conforming implementations, SMTP clients and - servers MUST support the original HELO mechanisms as a fallback.) - Unless the different characteristics of HELO must be identified for - interoperability purposes, this document discusses only EHLO. - - SMTP is widely deployed and high-quality implementations have proven - to be very robust. However, the Internet community now considers - some services to be important that were not anticipated when the - protocol was first designed. If support for those services is to be - added, it must be done in a way that permits older implementations to - continue working acceptably. The extension framework consists of: - - - - -Klensin Standards Track [Page 7] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - - The SMTP command EHLO, superseding the earlier HELO, - - - a registry of SMTP service extensions, - - - additional parameters to the SMTP MAIL and RCPT commands, and - - - optional replacements for commands defined in this protocol, such - as for DATA in non-ASCII transmissions [33]. - - SMTP's strength comes primarily from its simplicity. Experience with - many protocols has shown that protocols with few options tend towards - ubiquity, whereas protocols with many options tend towards obscurity. - - Each and every extension, regardless of its benefits, must be - carefully scrutinized with respect to its implementation, deployment, - and interoperability costs. In many cases, the cost of extending the - SMTP service will likely outweigh the benefit. - -2.2.2 Definition and Registration of Extensions - - The IANA maintains a registry of SMTP service extensions. A - corresponding EHLO keyword value is associated with each extension. - Each service extension registered with the IANA must be defined in a - formal standards-track or IESG-approved experimental protocol - document. The definition must include: - - - the textual name of the SMTP service extension; - - - the EHLO keyword value associated with the extension; - - - the syntax and possible values of parameters associated with the - EHLO keyword value; - - - any additional SMTP verbs associated with the extension - (additional verbs will usually be, but are not required to be, the - same as the EHLO keyword value); - - - any new parameters the extension associates with the MAIL or RCPT - verbs; - - - a description of how support for the extension affects the - behavior of a server and client SMTP; and, - - - the increment by which the extension is increasing the maximum - length of the commands MAIL and/or RCPT, over that specified in - this standard. - - - - - -Klensin Standards Track [Page 8] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - In addition, any EHLO keyword value starting with an upper or lower - case "X" refers to a local SMTP service extension used exclusively - through bilateral agreement. Keywords beginning with "X" MUST NOT be - used in a registered service extension. Conversely, keyword values - presented in the EHLO response that do not begin with "X" MUST - correspond to a standard, standards-track, or IESG-approved - experimental SMTP service extension registered with IANA. A - conforming server MUST NOT offer non-"X"-prefixed keyword values that - are not described in a registered extension. - - Additional verbs and parameter names are bound by the same rules as - EHLO keywords; specifically, verbs beginning with "X" are local - extensions that may not be registered or standardized. Conversely, - verbs not beginning with "X" must always be registered. - -2.3 Terminology - - The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", - "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this - document are to be interpreted as described below. - - 1. MUST This word, or the terms "REQUIRED" or "SHALL", mean that - the definition is an absolute requirement of the specification. - - 2. MUST NOT This phrase, or the phrase "SHALL NOT", mean that the - definition is an absolute prohibition of the specification. - - 3. SHOULD This word, or the adjective "RECOMMENDED", mean that - there may exist valid reasons in particular circumstances to - ignore a particular item, but the full implications must be - understood and carefully weighed before choosing a different - course. - - 4. SHOULD NOT This phrase, or the phrase "NOT RECOMMENDED" mean - that there may exist valid reasons in particular circumstances - when the particular behavior is acceptable or even useful, but the - full implications should be understood and the case carefully - weighed before implementing any behavior described with this - label. - - 5. MAY This word, or the adjective "OPTIONAL", mean that an item is - truly optional. One vendor may choose to include the item because - a particular marketplace requires it or because the vendor feels - that it enhances the product while another vendor may omit the - same item. An implementation which does not include a particular - option MUST be prepared to interoperate with another - implementation which does include the option, though perhaps with - reduced functionality. In the same vein an implementation which - - - -Klensin Standards Track [Page 9] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - does include a particular option MUST be prepared to interoperate - with another implementation which does not include the option - (except, of course, for the feature the option provides.) - -2.3.1 Mail Objects - - SMTP transports a mail object. A mail object contains an envelope - and content. - - The SMTP envelope is sent as a series of SMTP protocol units - (described in section 3). It consists of an originator address (to - which error reports should be directed); one or more recipient - addresses; and optional protocol extension material. Historically, - variations on the recipient address specification command (RCPT TO) - could be used to specify alternate delivery modes, such as immediate - display; those variations have now been deprecated (see appendix F, - section F.6). - - The SMTP content is sent in the SMTP DATA protocol unit and has two - parts: the headers and the body. If the content conforms to other - contemporary standards, the headers form a collection of field/value - pairs structured as in the message format specification [32]; the - body, if structured, is defined according to MIME [12]. The content - is textual in nature, expressed using the US-ASCII repertoire [1]. - Although SMTP extensions (such as "8BITMIME" [20]) may relax this - restriction for the content body, the content headers are always - encoded using the US-ASCII repertoire. A MIME extension [23] defines - an algorithm for representing header values outside the US-ASCII - repertoire, while still encoding them using the US-ASCII repertoire. - -2.3.2 Senders and Receivers - - In RFC 821, the two hosts participating in an SMTP transaction were - described as the "SMTP-sender" and "SMTP-receiver". This document - has been changed to reflect current industry terminology and hence - refers to them as the "SMTP client" (or sometimes just "the client") - and "SMTP server" (or just "the server"), respectively. Since a - given host may act both as server and client in a relay situation, - "receiver" and "sender" terminology is still used where needed for - clarity. - -2.3.3 Mail Agents and Message Stores - - Additional mail system terminology became common after RFC 821 was - published and, where convenient, is used in this specification. In - particular, SMTP servers and clients provide a mail transport service - and therefore act as "Mail Transfer Agents" (MTAs). "Mail User - Agents" (MUAs or UAs) are normally thought of as the sources and - - - -Klensin Standards Track [Page 10] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - targets of mail. At the source, an MUA might collect mail to be - transmitted from a user and hand it off to an MTA; the final - ("delivery") MTA would be thought of as handing the mail off to an - MUA (or at least transferring responsibility to it, e.g., by - depositing the message in a "message store"). However, while these - terms are used with at least the appearance of great precision in - other environments, the implied boundaries between MUAs and MTAs - often do not accurately match common, and conforming, practices with - Internet mail. Hence, the reader should be cautious about inferring - the strong relationships and responsibilities that might be implied - if these terms were used elsewhere. - -2.3.4 Host - - For the purposes of this specification, a host is a computer system - attached to the Internet (or, in some cases, to a private TCP/IP - network) and supporting the SMTP protocol. Hosts are known by names - (see "domain"); identifying them by numerical address is discouraged. - -2.3.5 Domain - - A domain (or domain name) consists of one or more dot-separated - components. These components ("labels" in DNS terminology [22]) are - restricted for SMTP purposes to consist of a sequence of letters, - digits, and hyphens drawn from the ASCII character set [1]. Domain - names are used as names of hosts and of other entities in the domain - name hierarchy. For example, a domain may refer to an alias (label - of a CNAME RR) or the label of Mail eXchanger records to be used to - deliver mail instead of representing a host name. See [22] and - section 5 of this specification. - - The domain name, as described in this document and in [22], is the - entire, fully-qualified name (often referred to as an "FQDN"). A - domain name that is not in FQDN form is no more than a local alias. - Local aliases MUST NOT appear in any SMTP transaction. - -2.3.6 Buffer and State Table - - SMTP sessions are stateful, with both parties carefully maintaining a - common view of the current state. In this document we model this - state by a virtual "buffer" and a "state table" on the server which - may be used by the client to, for example, "clear the buffer" or - "reset the state table," causing the information in the buffer to be - discarded and the state to be returned to some previous state. - - - - - - - -Klensin Standards Track [Page 11] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - -2.3.7 Lines - - SMTP commands and, unless altered by a service extension, message - data, are transmitted in "lines". Lines consist of zero or more data - characters terminated by the sequence ASCII character "CR" (hex value - 0D) followed immediately by ASCII character "LF" (hex value 0A). - This termination sequence is denoted as in this document. - Conforming implementations MUST NOT recognize or generate any other - character or character sequence as a line terminator. Limits MAY be - imposed on line lengths by servers (see section 4.5.3). - - In addition, the appearance of "bare" "CR" or "LF" characters in text - (i.e., either without the other) has a long history of causing - problems in mail implementations and applications that use the mail - system as a tool. SMTP client implementations MUST NOT transmit - these characters except when they are intended as line terminators - and then MUST, as indicated above, transmit them only as a - sequence. - -2.3.8 Originator, Delivery, Relay, and Gateway Systems - - This specification makes a distinction among four types of SMTP - systems, based on the role those systems play in transmitting - electronic mail. An "originating" system (sometimes called an SMTP - originator) introduces mail into the Internet or, more generally, - into a transport service environment. A "delivery" SMTP system is - one that receives mail from a transport service environment and - passes it to a mail user agent or deposits it in a message store - which a mail user agent is expected to subsequently access. A - "relay" SMTP system (usually referred to just as a "relay") receives - mail from an SMTP client and transmits it, without modification to - the message data other than adding trace information, to another SMTP - server for further relaying or for delivery. - - A "gateway" SMTP system (usually referred to just as a "gateway") - receives mail from a client system in one transport environment and - transmits it to a server system in another transport environment. - Differences in protocols or message semantics between the transport - environments on either side of a gateway may require that the gateway - system perform transformations to the message that are not permitted - to SMTP relay systems. For the purposes of this specification, - firewalls that rewrite addresses should be considered as gateways, - even if SMTP is used on both sides of them (see [11]). - - - - - - - - -Klensin Standards Track [Page 12] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - -2.3.9 Message Content and Mail Data - - The terms "message content" and "mail data" are used interchangeably - in this document to describe the material transmitted after the DATA - command is accepted and before the end of data indication is - transmitted. Message content includes message headers and the - possibly-structured message body. The MIME specification [12] - provides the standard mechanisms for structured message bodies. - -2.3.10 Mailbox and Address - - As used in this specification, an "address" is a character string - that identifies a user to whom mail will be sent or a location into - which mail will be deposited. The term "mailbox" refers to that - depository. The two terms are typically used interchangeably unless - the distinction between the location in which mail is placed (the - mailbox) and a reference to it (the address) is important. An - address normally consists of user and domain specifications. The - standard mailbox naming convention is defined to be "local- - part@domain": contemporary usage permits a much broader set of - applications than simple "user names". Consequently, and due to a - long history of problems when intermediate hosts have attempted to - optimize transport by modifying them, the local-part MUST be - interpreted and assigned semantics only by the host specified in the - domain part of the address. - -2.3.11 Reply - - An SMTP reply is an acknowledgment (positive or negative) sent from - receiver to sender via the transmission channel in response to a - command. The general form of a reply is a numeric completion code - (indicating failure or success) usually followed by a text string. - The codes are for use by programs and the text is usually intended - for human users. Recent work [34] has specified further structuring - of the reply strings, including the use of supplemental and more - specific completion codes. - -2.4 General Syntax Principles and Transaction Model - - SMTP commands and replies have a rigid syntax. All commands begin - with a command verb. All Replies begin with a three digit numeric - code. In some commands and replies, arguments MUST follow the verb - or reply code. Some commands do not accept arguments (after the - verb), and some reply codes are followed, sometimes optionally, by - free form text. In both cases, where text appears, it is separated - from the verb or reply code by a space character. Complete - definitions of commands and replies appear in section 4. - - - - -Klensin Standards Track [Page 13] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - Verbs and argument values (e.g., "TO:" or "to:" in the RCPT command - and extension name keywords) are not case sensitive, with the sole - exception in this specification of a mailbox local-part (SMTP - Extensions may explicitly specify case-sensitive elements). That is, - a command verb, an argument value other than a mailbox local-part, - and free form text MAY be encoded in upper case, lower case, or any - mixture of upper and lower case with no impact on its meaning. This - is NOT true of a mailbox local-part. The local-part of a mailbox - MUST BE treated as case sensitive. Therefore, SMTP implementations - MUST take care to preserve the case of mailbox local-parts. Mailbox - domains are not case sensitive. In particular, for some hosts the - user "smith" is different from the user "Smith". However, exploiting - the case sensitivity of mailbox local-parts impedes interoperability - and is discouraged. - - A few SMTP servers, in violation of this specification (and RFC 821) - require that command verbs be encoded by clients in upper case. - Implementations MAY wish to employ this encoding to accommodate those - servers. - - The argument field consists of a variable length character string - ending with the end of the line, i.e., with the character sequence - . The receiver will take no action until this sequence is - received. - - The syntax for each command is shown with the discussion of that - command. Common elements and parameters are shown in section 4.1.2. - - Commands and replies are composed of characters from the ASCII - character set [1]. When the transport service provides an 8-bit byte - (octet) transmission channel, each 7-bit character is transmitted - right justified in an octet with the high order bit cleared to zero. - More specifically, the unextended SMTP service provides seven bit - transport only. An originating SMTP client which has not - successfully negotiated an appropriate extension with a particular - server MUST NOT transmit messages with information in the high-order - bit of octets. If such messages are transmitted in violation of this - rule, receiving SMTP servers MAY clear the high-order bit or reject - the message as invalid. In general, a relay SMTP SHOULD assume that - the message content it has received is valid and, assuming that the - envelope permits doing so, relay it without inspecting that content. - Of course, if the content is mislabeled and the data path cannot - accept the actual content, this may result in ultimate delivery of a - severely garbled message to the recipient. Delivery SMTP systems MAY - reject ("bounce") such messages rather than deliver them. No sending - SMTP system is permitted to send envelope commands in any character - - - - - -Klensin Standards Track [Page 14] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - set other than US-ASCII; receiving systems SHOULD reject such - commands, normally using "500 syntax error - invalid character" - replies. - - Eight-bit message content transmission MAY be requested of the server - by a client using extended SMTP facilities, notably the "8BITMIME" - extension [20]. 8BITMIME SHOULD be supported by SMTP servers. - However, it MUST not be construed as authorization to transmit - unrestricted eight bit material. 8BITMIME MUST NOT be requested by - senders for material with the high bit on that is not in MIME format - with an appropriate content-transfer encoding; servers MAY reject - such messages. - - The metalinguistic notation used in this document corresponds to the - "Augmented BNF" used in other Internet mail system documents. The - reader who is not familiar with that syntax should consult the ABNF - specification [8]. Metalanguage terms used in running text are - surrounded by pointed brackets (e.g., ) for clarity. - -3. The SMTP Procedures: An Overview - - This section contains descriptions of the procedures used in SMTP: - session initiation, the mail transaction, forwarding mail, verifying - mailbox names and expanding mailing lists, and the opening and - closing exchanges. Comments on relaying, a note on mail domains, and - a discussion of changing roles are included at the end of this - section. Several complete scenarios are presented in appendix D. - -3.1 Session Initiation - - An SMTP session is initiated when a client opens a connection to a - server and the server responds with an opening message. - - SMTP server implementations MAY include identification of their - software and version information in the connection greeting reply - after the 220 code, a practice that permits more efficient isolation - and repair of any problems. Implementations MAY make provision for - SMTP servers to disable the software and version announcement where - it causes security concerns. While some systems also identify their - contact point for mail problems, this is not a substitute for - maintaining the required "postmaster" address (see section 4.5.1). - - The SMTP protocol allows a server to formally reject a transaction - while still allowing the initial connection as follows: a 554 - response MAY be given in the initial connection opening message - instead of the 220. A server taking this approach MUST still wait - for the client to send a QUIT (see section 4.1.1.10) before closing - the connection and SHOULD respond to any intervening commands with - - - -Klensin Standards Track [Page 15] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - "503 bad sequence of commands". Since an attempt to make an SMTP - connection to such a system is probably in error, a server returning - a 554 response on connection opening SHOULD provide enough - information in the reply text to facilitate debugging of the sending - system. - -3.2 Client Initiation - - Once the server has sent the welcoming message and the client has - received it, the client normally sends the EHLO command to the - server, indicating the client's identity. In addition to opening the - session, use of EHLO indicates that the client is able to process - service extensions and requests that the server provide a list of the - extensions it supports. Older SMTP systems which are unable to - support service extensions and contemporary clients which do not - require service extensions in the mail session being initiated, MAY - use HELO instead of EHLO. Servers MUST NOT return the extended - EHLO-style response to a HELO command. For a particular connection - attempt, if the server returns a "command not recognized" response to - EHLO, the client SHOULD be able to fall back and send HELO. - - In the EHLO command the host sending the command identifies itself; - the command may be interpreted as saying "Hello, I am " (and, - in the case of EHLO, "and I support service extension requests"). - -3.3 Mail Transactions - - There are three steps to SMTP mail transactions. The transaction - starts with a MAIL command which gives the sender identification. - (In general, the MAIL command may be sent only when no mail - transaction is in progress; see section 4.1.4.) A series of one or - more RCPT commands follows giving the receiver information. Then a - DATA command initiates transfer of the mail data and is terminated by - the "end of mail" data indicator, which also confirms the - transaction. - - The first step in the procedure is the MAIL command. - - MAIL FROM: [SP ] - - This command tells the SMTP-receiver that a new mail transaction is - starting and to reset all its state tables and buffers, including any - recipients or mail data. The portion of the first or - only argument contains the source mailbox (between "<" and ">" - brackets), which can be used to report errors (see section 4.2 for a - discussion of error reporting). If accepted, the SMTP server returns - a 250 OK reply. If the mailbox specification is not acceptable for - some reason, the server MUST return a reply indicating whether the - - - -Klensin Standards Track [Page 16] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - failure is permanent (i.e., will occur again if the client tries to - send the same address again) or temporary (i.e., the address might be - accepted if the client tries again later). Despite the apparent - scope of this requirement, there are circumstances in which the - acceptability of the reverse-path may not be determined until one or - more forward-paths (in RCPT commands) can be examined. In those - cases, the server MAY reasonably accept the reverse-path (with a 250 - reply) and then report problems after the forward-paths are received - and examined. Normally, failures produce 550 or 553 replies. - - Historically, the can contain more than just a - mailbox, however, contemporary systems SHOULD NOT use source routing - (see appendix C). - - The optional are associated with negotiated SMTP - service extensions (see section 2.2). - - The second step in the procedure is the RCPT command. - - RCPT TO: [ SP ] - - The first or only argument to this command includes a forward-path - (normally a mailbox and domain, always surrounded by "<" and ">" - brackets) identifying one recipient. If accepted, the SMTP server - returns a 250 OK reply and stores the forward-path. If the recipient - is known not to be a deliverable address, the SMTP server returns a - 550 reply, typically with a string such as "no such user - " and the - mailbox name (other circumstances and reply codes are possible). - This step of the procedure can be repeated any number of times. - - The can contain more than just a mailbox. - Historically, the can be a source routing list of - hosts and the destination mailbox, however, contemporary SMTP clients - SHOULD NOT utilize source routes (see appendix C). Servers MUST be - prepared to encounter a list of source routes in the forward path, - but SHOULD ignore the routes or MAY decline to support the relaying - they imply. Similarly, servers MAY decline to accept mail that is - destined for other hosts or systems. These restrictions make a - server useless as a relay for clients that do not support full SMTP - functionality. Consequently, restricted-capability clients MUST NOT - assume that any SMTP server on the Internet can be used as their mail - processing (relaying) site. If a RCPT command appears without a - previous MAIL command, the server MUST return a 503 "Bad sequence of - commands" response. The optional are associated - with negotiated SMTP service extensions (see section 2.2). - - The third step in the procedure is the DATA command (or some - alternative specified in a service extension). - - - -Klensin Standards Track [Page 17] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - DATA - - If accepted, the SMTP server returns a 354 Intermediate reply and - considers all succeeding lines up to but not including the end of - mail data indicator to be the message text. When the end of text is - successfully received and stored the SMTP-receiver sends a 250 OK - reply. - - Since the mail data is sent on the transmission channel, the end of - mail data must be indicated so that the command and reply dialog can - be resumed. SMTP indicates the end of the mail data by sending a - line containing only a "." (period or full stop). A transparency - procedure is used to prevent this from interfering with the user's - text (see section 4.5.2). - - The end of mail data indicator also confirms the mail transaction and - tells the SMTP server to now process the stored recipients and mail - data. If accepted, the SMTP server returns a 250 OK reply. The DATA - command can fail at only two points in the protocol exchange: - - - If there was no MAIL, or no RCPT, command, or all such commands - were rejected, the server MAY return a "command out of sequence" - (503) or "no valid recipients" (554) reply in response to the DATA - command. If one of those replies (or any other 5yz reply) is - received, the client MUST NOT send the message data; more - generally, message data MUST NOT be sent unless a 354 reply is - received. - - - If the verb is initially accepted and the 354 reply issued, the - DATA command should fail only if the mail transaction was - incomplete (for example, no recipients), or if resources were - unavailable (including, of course, the server unexpectedly - becoming unavailable), or if the server determines that the - message should be rejected for policy or other reasons. - - However, in practice, some servers do not perform recipient - verification until after the message text is received. These servers - SHOULD treat a failure for one or more recipients as a "subsequent - failure" and return a mail message as discussed in section 6. Using - a "550 mailbox not found" (or equivalent) reply code after the data - are accepted makes it difficult or impossible for the client to - determine which recipients failed. - - When RFC 822 format [7, 32] is being used, the mail data include the - memo header items such as Date, Subject, To, Cc, From. Server SMTP - systems SHOULD NOT reject messages based on perceived defects in the - RFC 822 or MIME [12] message header or message body. In particular, - - - - -Klensin Standards Track [Page 18] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - they MUST NOT reject messages in which the numbers of Resent-fields - do not match or Resent-to appears without Resent-from and/or Resent- - date. - - Mail transaction commands MUST be used in the order discussed above. - -3.4 Forwarding for Address Correction or Updating - - Forwarding support is most often required to consolidate and simplify - addresses within, or relative to, some enterprise and less frequently - to establish addresses to link a person's prior address with current - one. Silent forwarding of messages (without server notification to - the sender), for security or non-disclosure purposes, is common in - the contemporary Internet. - - In both the enterprise and the "new address" cases, information - hiding (and sometimes security) considerations argue against exposure - of the "final" address through the SMTP protocol as a side-effect of - the forwarding activity. This may be especially important when the - final address may not even be reachable by the sender. Consequently, - the "forwarding" mechanisms described in section 3.2 of RFC 821, and - especially the 251 (corrected destination) and 551 reply codes from - RCPT must be evaluated carefully by implementers and, when they are - available, by those configuring systems. - - In particular: - - * Servers MAY forward messages when they are aware of an address - change. When they do so, they MAY either provide address-updating - information with a 251 code, or may forward "silently" and return - a 250 code. But, if a 251 code is used, they MUST NOT assume that - the client will actually update address information or even return - that information to the user. - - Alternately, - - * Servers MAY reject or bounce messages when they are not - deliverable when addressed. When they do so, they MAY either - provide address-updating information with a 551 code, or may - reject the message as undeliverable with a 550 code and no - address-specific information. But, if a 551 code is used, they - MUST NOT assume that the client will actually update address - information or even return that information to the user. - - SMTP server implementations that support the 251 and/or 551 reply - codes are strongly encouraged to provide configuration mechanisms so - that sites which conclude that they would undesirably disclose - information can disable or restrict their use. - - - -Klensin Standards Track [Page 19] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - -3.5 Commands for Debugging Addresses - -3.5.1 Overview - - SMTP provides commands to verify a user name or obtain the content of - a mailing list. This is done with the VRFY and EXPN commands, which - have character string arguments. Implementations SHOULD support VRFY - and EXPN (however, see section 3.5.2 and 7.3). - - For the VRFY command, the string is a user name or a user name and - domain (see below). If a normal (i.e., 250) response is returned, - the response MAY include the full name of the user and MUST include - the mailbox of the user. It MUST be in either of the following - forms: - - User Name - local-part@domain - - When a name that is the argument to VRFY could identify more than one - mailbox, the server MAY either note the ambiguity or identify the - alternatives. In other words, any of the following are legitimate - response to VRFY: - - 553 User ambiguous - - or - - 553- Ambiguous; Possibilities are - 553-Joe Smith - 553-Harry Smith - 553 Melvin Smith - - or - - 553-Ambiguous; Possibilities - 553- - 553- - 553 - - Under normal circumstances, a client receiving a 553 reply would be - expected to expose the result to the user. Use of exactly the forms - given, and the "user ambiguous" or "ambiguous" keywords, possibly - supplemented by extended reply codes such as those described in [34], - will facilitate automated translation into other languages as needed. - Of course, a client that was highly automated or that was operating - in another language than English, might choose to try to translate - the response, to return some other indication to the user than the - - - - -Klensin Standards Track [Page 20] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - literal text of the reply, or to take some automated action such as - consulting a directory service for additional information before - reporting to the user. - - For the EXPN command, the string identifies a mailing list, and the - successful (i.e., 250) multiline response MAY include the full name - of the users and MUST give the mailboxes on the mailing list. - - In some hosts the distinction between a mailing list and an alias for - a single mailbox is a bit fuzzy, since a common data structure may - hold both types of entries, and it is possible to have mailing lists - containing only one mailbox. If a request is made to apply VRFY to a - mailing list, a positive response MAY be given if a message so - addressed would be delivered to everyone on the list, otherwise an - error SHOULD be reported (e.g., "550 That is a mailing list, not a - user" or "252 Unable to verify members of mailing list"). If a - request is made to expand a user name, the server MAY return a - positive response consisting of a list containing one name, or an - error MAY be reported (e.g., "550 That is a user name, not a mailing - list"). - - In the case of a successful multiline reply (normal for EXPN) exactly - one mailbox is to be specified on each line of the reply. The case - of an ambiguous request is discussed above. - - "User name" is a fuzzy term and has been used deliberately. An - implementation of the VRFY or EXPN commands MUST include at least - recognition of local mailboxes as "user names". However, since - current Internet practice often results in a single host handling - mail for multiple domains, hosts, especially hosts that provide this - functionality, SHOULD accept the "local-part@domain" form as a "user - name"; hosts MAY also choose to recognize other strings as "user - names". - - The case of expanding a mailbox list requires a multiline reply, such - as: - - C: EXPN Example-People - S: 250-Jon Postel - S: 250-Fred Fonebone - S: 250 Sam Q. Smith - - or - - C: EXPN Executive-Washroom-List - S: 550 Access Denied to You. - - - - - -Klensin Standards Track [Page 21] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - The character string arguments of the VRFY and EXPN commands cannot - be further restricted due to the variety of implementations of the - user name and mailbox list concepts. On some systems it may be - appropriate for the argument of the EXPN command to be a file name - for a file containing a mailing list, but again there are a variety - of file naming conventions in the Internet. Similarly, historical - variations in what is returned by these commands are such that the - response SHOULD be interpreted very carefully, if at all, and SHOULD - generally only be used for diagnostic purposes. - -3.5.2 VRFY Normal Response - - When normal (2yz or 551) responses are returned from a VRFY or EXPN - request, the reply normally includes the mailbox name, i.e., - "", where "domain" is a fully qualified domain - name, MUST appear in the syntax. In circumstances exceptional enough - to justify violating the intent of this specification, free-form text - MAY be returned. In order to facilitate parsing by both computers - and people, addresses SHOULD appear in pointed brackets. When - addresses, rather than free-form debugging information, are returned, - EXPN and VRFY MUST return only valid domain addresses that are usable - in SMTP RCPT commands. Consequently, if an address implies delivery - to a program or other system, the mailbox name used to reach that - target MUST be given. Paths (explicit source routes) MUST NOT be - returned by VRFY or EXPN. - - Server implementations SHOULD support both VRFY and EXPN. For - security reasons, implementations MAY provide local installations a - way to disable either or both of these commands through configuration - options or the equivalent. When these commands are supported, they - are not required to work across relays when relaying is supported. - Since they were both optional in RFC 821, they MUST be listed as - service extensions in an EHLO response, if they are supported. - -3.5.3 Meaning of VRFY or EXPN Success Response - - A server MUST NOT return a 250 code in response to a VRFY or EXPN - command unless it has actually verified the address. In particular, - a server MUST NOT return 250 if all it has done is to verify that the - syntax given is valid. In that case, 502 (Command not implemented) - or 500 (Syntax error, command unrecognized) SHOULD be returned. As - stated elsewhere, implementation (in the sense of actually validating - addresses and returning information) of VRFY and EXPN are strongly - recommended. Hence, implementations that return 500 or 502 for VRFY - are not in full compliance with this specification. - - - - - - -Klensin Standards Track [Page 22] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - There may be circumstances where an address appears to be valid but - cannot reasonably be verified in real time, particularly when a - server is acting as a mail exchanger for another server or domain. - "Apparent validity" in this case would normally involve at least - syntax checking and might involve verification that any domains - specified were ones to which the host expected to be able to relay - mail. In these situations, reply code 252 SHOULD be returned. These - cases parallel the discussion of RCPT verification discussed in - section 2.1. Similarly, the discussion in section 3.4 applies to the - use of reply codes 251 and 551 with VRFY (and EXPN) to indicate - addresses that are recognized but that would be forwarded or bounced - were mail received for them. Implementations generally SHOULD be - more aggressive about address verification in the case of VRFY than - in the case of RCPT, even if it takes a little longer to do so. - -3.5.4 Semantics and Applications of EXPN - - EXPN is often very useful in debugging and understanding problems - with mailing lists and multiple-target-address aliases. Some systems - have attempted to use source expansion of mailing lists as a means of - eliminating duplicates. The propagation of aliasing systems with - mail on the Internet, for hosts (typically with MX and CNAME DNS - records), for mailboxes (various types of local host aliases), and in - various proxying arrangements, has made it nearly impossible for - these strategies to work consistently, and mail systems SHOULD NOT - attempt them. - -3.6 Domains - - Only resolvable, fully-qualified, domain names (FQDNs) are permitted - when domain names are used in SMTP. In other words, names that can - be resolved to MX RRs or A RRs (as discussed in section 5) are - permitted, as are CNAME RRs whose targets can be resolved, in turn, - to MX or A RRs. Local nicknames or unqualified names MUST NOT be - used. There are two exceptions to the rule requiring FQDNs: - - - The domain name given in the EHLO command MUST BE either a primary - host name (a domain name that resolves to an A RR) or, if the host - has no name, an address literal as described in section 4.1.1.1. - - - The reserved mailbox name "postmaster" may be used in a RCPT - command without domain qualification (see section 4.1.1.3) and - MUST be accepted if so used. - - - - - - - - -Klensin Standards Track [Page 23] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - -3.7 Relaying - - In general, the availability of Mail eXchanger records in the domain - name system [22, 27] makes the use of explicit source routes in the - Internet mail system unnecessary. Many historical problems with - their interpretation have made their use undesirable. SMTP clients - SHOULD NOT generate explicit source routes except under unusual - circumstances. SMTP servers MAY decline to act as mail relays or to - accept addresses that specify source routes. When route information - is encountered, SMTP servers are also permitted to ignore the route - information and simply send to the final destination specified as the - last element in the route and SHOULD do so. There has been an - invalid practice of using names that do not appear in the DNS as - destination names, with the senders counting on the intermediate - hosts specified in source routing to resolve any problems. If source - routes are stripped, this practice will cause failures. This is one - of several reasons why SMTP clients MUST NOT generate invalid source - routes or depend on serial resolution of names. - - When source routes are not used, the process described in RFC 821 for - constructing a reverse-path from the forward-path is not applicable - and the reverse-path at the time of delivery will simply be the - address that appeared in the MAIL command. - - A relay SMTP server is usually the target of a DNS MX record that - designates it, rather than the final delivery system. The relay - server may accept or reject the task of relaying the mail in the same - way it accepts or rejects mail for a local user. If it accepts the - task, it then becomes an SMTP client, establishes a transmission - channel to the next SMTP server specified in the DNS (according to - the rules in section 5), and sends it the mail. If it declines to - relay mail to a particular address for policy reasons, a 550 response - SHOULD be returned. - - Many mail-sending clients exist, especially in conjunction with - facilities that receive mail via POP3 or IMAP, that have limited - capability to support some of the requirements of this specification, - such as the ability to queue messages for subsequent delivery - attempts. For these clients, it is common practice to make private - arrangements to send all messages to a single server for processing - and subsequent distribution. SMTP, as specified here, is not ideally - suited for this role, and work is underway on standardized mail - submission protocols that might eventually supercede the current - practices. In any event, because these arrangements are private and - fall outside the scope of this specification, they are not described - here. - - - - - -Klensin Standards Track [Page 24] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - It is important to note that MX records can point to SMTP servers - which act as gateways into other environments, not just SMTP relays - and final delivery systems; see sections 3.8 and 5. - - If an SMTP server has accepted the task of relaying the mail and - later finds that the destination is incorrect or that the mail cannot - be delivered for some other reason, then it MUST construct an - "undeliverable mail" notification message and send it to the - originator of the undeliverable mail (as indicated by the reverse- - path). Formats specified for non-delivery reports by other standards - (see, for example, [24, 25]) SHOULD be used if possible. - - This notification message must be from the SMTP server at the relay - host or the host that first determines that delivery cannot be - accomplished. Of course, SMTP servers MUST NOT send notification - messages about problems transporting notification messages. One way - to prevent loops in error reporting is to specify a null reverse-path - in the MAIL command of a notification message. When such a message - is transmitted the reverse-path MUST be set to null (see section - 4.5.5 for additional discussion). A MAIL command with a null - reverse-path appears as follows: - - MAIL FROM:<> - - As discussed in section 2.4.1, a relay SMTP has no need to inspect or - act upon the headers or body of the message data and MUST NOT do so - except to add its own "Received:" header (section 4.4) and, - optionally, to attempt to detect looping in the mail system (see - section 6.2). - -3.8 Mail Gatewaying - - While the relay function discussed above operates within the Internet - SMTP transport service environment, MX records or various forms of - explicit routing may require that an intermediate SMTP server perform - a translation function between one transport service and another. As - discussed in section 2.3.8, when such a system is at the boundary - between two transport service environments, we refer to it as a - "gateway" or "gateway SMTP". - - Gatewaying mail between different mail environments, such as - different mail formats and protocols, is complex and does not easily - yield to standardization. However, some general requirements may be - given for a gateway between the Internet and another mail - environment. - - - - - - -Klensin Standards Track [Page 25] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - -3.8.1 Header Fields in Gatewaying - - Header fields MAY be rewritten when necessary as messages are - gatewayed across mail environment boundaries. This may involve - inspecting the message body or interpreting the local-part of the - destination address in spite of the prohibitions in section 2.4.1. - - Other mail systems gatewayed to the Internet often use a subset of - RFC 822 headers or provide similar functionality with a different - syntax, but some of these mail systems do not have an equivalent to - the SMTP envelope. Therefore, when a message leaves the Internet - environment, it may be necessary to fold the SMTP envelope - information into the message header. A possible solution would be to - create new header fields to carry the envelope information (e.g., - "X-SMTP-MAIL:" and "X-SMTP-RCPT:"); however, this would require - changes in mail programs in foreign environments and might risk - disclosure of private information (see section 7.2). - -3.8.2 Received Lines in Gatewaying - - When forwarding a message into or out of the Internet environment, a - gateway MUST prepend a Received: line, but it MUST NOT alter in any - way a Received: line that is already in the header. - - "Received:" fields of messages originating from other environments - may not conform exactly to this specification. However, the most - important use of Received: lines is for debugging mail faults, and - this debugging can be severely hampered by well-meaning gateways that - try to "fix" a Received: line. As another consequence of trace - fields arising in non-SMTP environments, receiving systems MUST NOT - reject mail based on the format of a trace field and SHOULD be - extremely robust in the light of unexpected information or formats in - those fields. - - The gateway SHOULD indicate the environment and protocol in the "via" - clauses of Received field(s) that it supplies. - -3.8.3 Addresses in Gatewaying - - From the Internet side, the gateway SHOULD accept all valid address - formats in SMTP commands and in RFC 822 headers, and all valid RFC - 822 messages. Addresses and headers generated by gateways MUST - conform to applicable Internet standards (including this one and RFC - 822). Gateways are, of course, subject to the same rules for - handling source routes as those described for other SMTP systems in - section 3.3. - - - - - -Klensin Standards Track [Page 26] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - -3.8.4 Other Header Fields in Gatewaying - - The gateway MUST ensure that all header fields of a message that it - forwards into the Internet mail environment meet the requirements for - Internet mail. In particular, all addresses in "From:", "To:", - "Cc:", etc., fields MUST be transformed (if necessary) to satisfy RFC - 822 syntax, MUST reference only fully-qualified domain names, and - MUST be effective and useful for sending replies. The translation - algorithm used to convert mail from the Internet protocols to another - environment's protocol SHOULD ensure that error messages from the - foreign mail environment are delivered to the return path from the - SMTP envelope, not to the sender listed in the "From:" field (or - other fields) of the RFC 822 message. - -3.8.5 Envelopes in Gatewaying - - Similarly, when forwarding a message from another environment into - the Internet, the gateway SHOULD set the envelope return path in - accordance with an error message return address, if supplied by the - foreign environment. If the foreign environment has no equivalent - concept, the gateway must select and use a best approximation, with - the message originator's address as the default of last resort. - -3.9 Terminating Sessions and Connections - - An SMTP connection is terminated when the client sends a QUIT - command. The server responds with a positive reply code, after which - it closes the connection. - - An SMTP server MUST NOT intentionally close the connection except: - - - After receiving a QUIT command and responding with a 221 reply. - - - After detecting the need to shut down the SMTP service and - returning a 421 response code. This response code can be issued - after the server receives any command or, if necessary, - asynchronously from command receipt (on the assumption that the - client will receive it after the next command is issued). - - In particular, a server that closes connections in response to - commands that are not understood is in violation of this - specification. Servers are expected to be tolerant of unknown - commands, issuing a 500 reply and awaiting further instructions from - the client. - - - - - - - -Klensin Standards Track [Page 27] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - An SMTP server which is forcibly shut down via external means SHOULD - attempt to send a line containing a 421 response code to the SMTP - client before exiting. The SMTP client will normally read the 421 - response code after sending its next command. - - SMTP clients that experience a connection close, reset, or other - communications failure due to circumstances not under their control - (in violation of the intent of this specification but sometimes - unavoidable) SHOULD, to maintain the robustness of the mail system, - treat the mail transaction as if a 451 response had been received and - act accordingly. - -3.10 Mailing Lists and Aliases - - An SMTP-capable host SHOULD support both the alias and the list - models of address expansion for multiple delivery. When a message is - delivered or forwarded to each address of an expanded list form, the - return address in the envelope ("MAIL FROM:") MUST be changed to be - the address of a person or other entity who administers the list. - However, in this case, the message header [32] MUST be left - unchanged; in particular, the "From" field of the message header is - unaffected. - - An important mail facility is a mechanism for multi-destination - delivery of a single message, by transforming (or "expanding" or - "exploding") a pseudo-mailbox address into a list of destination - mailbox addresses. When a message is sent to such a pseudo-mailbox - (sometimes called an "exploder"), copies are forwarded or - redistributed to each mailbox in the expanded list. Servers SHOULD - simply utilize the addresses on the list; application of heuristics - or other matching rules to eliminate some addresses, such as that of - the originator, is strongly discouraged. We classify such a pseudo- - mailbox as an "alias" or a "list", depending upon the expansion - rules. - -3.10.1 Alias - - To expand an alias, the recipient mailer simply replaces the pseudo- - mailbox address in the envelope with each of the expanded addresses - in turn; the rest of the envelope and the message body are left - unchanged. The message is then delivered or forwarded to each - expanded address. - -3.10.2 List - - A mailing list may be said to operate by "redistribution" rather than - by "forwarding". To expand a list, the recipient mailer replaces the - pseudo-mailbox address in the envelope with all of the expanded - - - -Klensin Standards Track [Page 28] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - addresses. The return address in the envelope is changed so that all - error messages generated by the final deliveries will be returned to - a list administrator, not to the message originator, who generally - has no control over the contents of the list and will typically find - error messages annoying. - -4. The SMTP Specifications - -4.1 SMTP Commands - -4.1.1 Command Semantics and Syntax - - The SMTP commands define the mail transfer or the mail system - function requested by the user. SMTP commands are character strings - terminated by . The commands themselves are alphabetic - characters terminated by if parameters follow and - otherwise. (In the interest of improved interoperability, SMTP - receivers are encouraged to tolerate trailing white space before the - terminating .) The syntax of the local part of a mailbox must - conform to receiver site conventions and the syntax specified in - section 4.1.2. The SMTP commands are discussed below. The SMTP - replies are discussed in section 4.2. - - A mail transaction involves several data objects which are - communicated as arguments to different commands. The reverse-path is - the argument of the MAIL command, the forward-path is the argument of - the RCPT command, and the mail data is the argument of the DATA - command. These arguments or data objects must be transmitted and - held pending the confirmation communicated by the end of mail data - indication which finalizes the transaction. The model for this is - that distinct buffers are provided to hold the types of data objects, - that is, there is a reverse-path buffer, a forward-path buffer, and a - mail data buffer. Specific commands cause information to be appended - to a specific buffer, or cause one or more buffers to be cleared. - - Several commands (RSET, DATA, QUIT) are specified as not permitting - parameters. In the absence of specific extensions offered by the - server and accepted by the client, clients MUST NOT send such - parameters and servers SHOULD reject commands containing them as - having invalid syntax. - -4.1.1.1 Extended HELLO (EHLO) or HELLO (HELO) - - These commands are used to identify the SMTP client to the SMTP - server. The argument field contains the fully-qualified domain name - of the SMTP client if one is available. In situations in which the - SMTP client system does not have a meaningful domain name (e.g., when - its address is dynamically allocated and no reverse mapping record is - - - -Klensin Standards Track [Page 29] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - available), the client SHOULD send an address literal (see section - 4.1.3), optionally followed by information that will help to identify - the client system. y The SMTP server identifies itself to the SMTP - client in the connection greeting reply and in the response to this - command. - - A client SMTP SHOULD start an SMTP session by issuing the EHLO - command. If the SMTP server supports the SMTP service extensions it - will give a successful response, a failure response, or an error - response. If the SMTP server, in violation of this specification, - does not support any SMTP service extensions it will generate an - error response. Older client SMTP systems MAY, as discussed above, - use HELO (as specified in RFC 821) instead of EHLO, and servers MUST - support the HELO command and reply properly to it. In any event, a - client MUST issue HELO or EHLO before starting a mail transaction. - - These commands, and a "250 OK" reply to one of them, confirm that - both the SMTP client and the SMTP server are in the initial state, - that is, there is no transaction in progress and all state tables and - buffers are cleared. - - Syntax: - - ehlo = "EHLO" SP Domain CRLF - helo = "HELO" SP Domain CRLF - - Normally, the response to EHLO will be a multiline reply. Each line - of the response contains a keyword and, optionally, one or more - parameters. Following the normal syntax for multiline replies, these - keyworks follow the code (250) and a hyphen for all but the last - line, and the code and a space for the last line. The syntax for a - positive response, using the ABNF notation and terminal symbols of - [8], is: - - ehlo-ok-rsp = ( "250" domain [ SP ehlo-greet ] CRLF ) - / ( "250-" domain [ SP ehlo-greet ] CRLF - *( "250-" ehlo-line CRLF ) - "250" SP ehlo-line CRLF ) - - ehlo-greet = 1*(%d0-9 / %d11-12 / %d14-127) - ; string of any characters other than CR or LF - - ehlo-line = ehlo-keyword *( SP ehlo-param ) - - ehlo-keyword = (ALPHA / DIGIT) *(ALPHA / DIGIT / "-") - ; additional syntax of ehlo-params depends on - ; ehlo-keyword - - - - -Klensin Standards Track [Page 30] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - ehlo-param = 1*(%d33-127) - ; any CHAR excluding and all - ; control characters (US-ASCII 0-31 inclusive) - - Although EHLO keywords may be specified in upper, lower, or mixed - case, they MUST always be recognized and processed in a case- - insensitive manner. This is simply an extension of practices - specified in RFC 821 and section 2.4.1. - -4.1.1.2 MAIL (MAIL) - - This command is used to initiate a mail transaction in which the mail - data is delivered to an SMTP server which may, in turn, deliver it to - one or more mailboxes or pass it on to another system (possibly using - SMTP). The argument field contains a reverse-path and may contain - optional parameters. In general, the MAIL command may be sent only - when no mail transaction is in progress, see section 4.1.4. - - The reverse-path consists of the sender mailbox. Historically, that - mailbox might optionally have been preceded by a list of hosts, but - that behavior is now deprecated (see appendix C). In some types of - reporting messages for which a reply is likely to cause a mail loop - (for example, mail delivery and nondelivery notifications), the - reverse-path may be null (see section 3.7). - - This command clears the reverse-path buffer, the forward-path buffer, - and the mail data buffer; and inserts the reverse-path information - from this command into the reverse-path buffer. - - If service extensions were negotiated, the MAIL command may also - carry parameters associated with a particular service extension. - - Syntax: - - "MAIL FROM:" ("<>" / Reverse-Path) - [SP Mail-parameters] CRLF - -4.1.1.3 RECIPIENT (RCPT) - - This command is used to identify an individual recipient of the mail - data; multiple recipients are specified by multiple use of this - command. The argument field contains a forward-path and may contain - optional parameters. - - The forward-path normally consists of the required destination - mailbox. Sending systems SHOULD not generate the optional list of - hosts known as a source route. Receiving systems MUST recognize - - - - -Klensin Standards Track [Page 31] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - source route syntax but SHOULD strip off the source route - specification and utilize the domain name associated with the mailbox - as if the source route had not been provided. - - Similarly, relay hosts SHOULD strip or ignore source routes, and - names MUST NOT be copied into the reverse-path. When mail reaches - its ultimate destination (the forward-path contains only a - destination mailbox), the SMTP server inserts it into the destination - mailbox in accordance with its host mail conventions. - - For example, mail received at relay host xyz.com with envelope - commands - - MAIL FROM: - RCPT TO:<@hosta.int,@jkl.org:userc@d.bar.org> - - will normally be sent directly on to host d.bar.org with envelope - commands - - MAIL FROM: - RCPT TO: - - As provided in appendix C, xyz.com MAY also choose to relay the - message to hosta.int, using the envelope commands - - MAIL FROM: - RCPT TO:<@hosta.int,@jkl.org:userc@d.bar.org> - - or to jkl.org, using the envelope commands - - MAIL FROM: - RCPT TO:<@jkl.org:userc@d.bar.org> - - Of course, since hosts are not required to relay mail at all, xyz.com - may also reject the message entirely when the RCPT command is - received, using a 550 code (since this is a "policy reason"). - - If service extensions were negotiated, the RCPT command may also - carry parameters associated with a particular service extension - offered by the server. The client MUST NOT transmit parameters other - than those associated with a service extension offered by the server - in its EHLO response. - -Syntax: - "RCPT TO:" ("" / "" / Forward-Path) - [SP Rcpt-parameters] CRLF - - - - - -Klensin Standards Track [Page 32] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - -4.1.1.4 DATA (DATA) - - The receiver normally sends a 354 response to DATA, and then treats - the lines (strings ending in sequences, as described in - section 2.3.7) following the command as mail data from the sender. - This command causes the mail data to be appended to the mail data - buffer. The mail data may contain any of the 128 ASCII character - codes, although experience has indicated that use of control - characters other than SP, HT, CR, and LF may cause problems and - SHOULD be avoided when possible. - - The mail data is terminated by a line containing only a period, that - is, the character sequence "." (see section 4.5.2). This - is the end of mail data indication. Note that the first of - this terminating sequence is also the that ends the final line - of the data (message text) or, if there was no data, ends the DATA - command itself. An extra MUST NOT be added, as that would - cause an empty line to be added to the message. The only exception - to this rule would arise if the message body were passed to the - originating SMTP-sender with a final "line" that did not end in - ; in that case, the originating SMTP system MUST either reject - the message as invalid or add in order to have the receiving - SMTP server recognize the "end of data" condition. - - The custom of accepting lines ending only in , as a concession to - non-conforming behavior on the part of some UNIX systems, has proven - to cause more interoperability problems than it solves, and SMTP - server systems MUST NOT do this, even in the name of improved - robustness. In particular, the sequence "." (bare line - feeds, without carriage returns) MUST NOT be treated as equivalent to - . as the end of mail data indication. - - Receipt of the end of mail data indication requires the server to - process the stored mail transaction information. This processing - consumes the information in the reverse-path buffer, the forward-path - buffer, and the mail data buffer, and on the completion of this - command these buffers are cleared. If the processing is successful, - the receiver MUST send an OK reply. If the processing fails the - receiver MUST send a failure reply. The SMTP model does not allow - for partial failures at this point: either the message is accepted by - the server for delivery and a positive response is returned or it is - not accepted and a failure reply is returned. In sending a positive - completion reply to the end of data indication, the receiver takes - full responsibility for the message (see section 6.1). Errors that - are diagnosed subsequently MUST be reported in a mail message, as - discussed in section 4.4. - - - - - -Klensin Standards Track [Page 33] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - When the SMTP server accepts a message either for relaying or for - final delivery, it inserts a trace record (also referred to - interchangeably as a "time stamp line" or "Received" line) at the top - of the mail data. This trace record indicates the identity of the - host that sent the message, the identity of the host that received - the message (and is inserting this time stamp), and the date and time - the message was received. Relayed messages will have multiple time - stamp lines. Details for formation of these lines, including their - syntax, is specified in section 4.4. - - Additional discussion about the operation of the DATA command appears - in section 3.3. - - Syntax: - "DATA" CRLF - -4.1.1.5 RESET (RSET) - - This command specifies that the current mail transaction will be - aborted. Any stored sender, recipients, and mail data MUST be - discarded, and all buffers and state tables cleared. The receiver - MUST send a "250 OK" reply to a RSET command with no arguments. A - reset command may be issued by the client at any time. It is - effectively equivalent to a NOOP (i.e., if has no effect) if issued - immediately after EHLO, before EHLO is issued in the session, after - an end-of-data indicator has been sent and acknowledged, or - immediately before a QUIT. An SMTP server MUST NOT close the - connection as the result of receiving a RSET; that action is reserved - for QUIT (see section 4.1.1.10). - - Since EHLO implies some additional processing and response by the - server, RSET will normally be more efficient than reissuing that - command, even though the formal semantics are the same. - - There are circumstances, contrary to the intent of this - specification, in which an SMTP server may receive an indication that - the underlying TCP connection has been closed or reset. To preserve - the robustness of the mail system, SMTP servers SHOULD be prepared - for this condition and SHOULD treat it as if a QUIT had been received - before the connection disappeared. - - Syntax: - "RSET" CRLF - - - - - - - - -Klensin Standards Track [Page 34] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - -4.1.1.6 VERIFY (VRFY) - - This command asks the receiver to confirm that the argument - identifies a user or mailbox. If it is a user name, information is - returned as specified in section 3.5. - - This command has no effect on the reverse-path buffer, the forward- - path buffer, or the mail data buffer. - - Syntax: - "VRFY" SP String CRLF - -4.1.1.7 EXPAND (EXPN) - - This command asks the receiver to confirm that the argument - identifies a mailing list, and if so, to return the membership of - that list. If the command is successful, a reply is returned - containing information as described in section 3.5. This reply will - have multiple lines except in the trivial case of a one-member list. - - This command has no effect on the reverse-path buffer, the forward- - path buffer, or the mail data buffer and may be issued at any time. - - Syntax: - "EXPN" SP String CRLF - -4.1.1.8 HELP (HELP) - - This command causes the server to send helpful information to the - client. The command MAY take an argument (e.g., any command name) - and return more specific information as a response. - - This command has no effect on the reverse-path buffer, the forward- - path buffer, or the mail data buffer and may be issued at any time. - - SMTP servers SHOULD support HELP without arguments and MAY support it - with arguments. - - Syntax: - "HELP" [ SP String ] CRLF - -4.1.1.9 NOOP (NOOP) - - This command does not affect any parameters or previously entered - commands. It specifies no action other than that the receiver send - an OK reply. - - - - - -Klensin Standards Track [Page 35] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - This command has no effect on the reverse-path buffer, the forward- - path buffer, or the mail data buffer and may be issued at any time. - If a parameter string is specified, servers SHOULD ignore it. - - Syntax: - "NOOP" [ SP String ] CRLF - -4.1.1.10 QUIT (QUIT) - - This command specifies that the receiver MUST send an OK reply, and - then close the transmission channel. - - The receiver MUST NOT intentionally close the transmission channel - until it receives and replies to a QUIT command (even if there was an - error). The sender MUST NOT intentionally close the transmission - channel until it sends a QUIT command and SHOULD wait until it - receives the reply (even if there was an error response to a previous - command). If the connection is closed prematurely due to violations - of the above or system or network failure, the server MUST cancel any - pending transaction, but not undo any previously completed - transaction, and generally MUST act as if the command or transaction - in progress had received a temporary error (i.e., a 4yz response). - - The QUIT command may be issued at any time. - - Syntax: - "QUIT" CRLF - -4.1.2 Command Argument Syntax - - The syntax of the argument fields of the above commands (using the - syntax specified in [8] where applicable) is given below. Some of - the productions given below are used only in conjunction with source - routes as described in appendix C. Terminals not defined in this - document, such as ALPHA, DIGIT, SP, CR, LF, CRLF, are as defined in - the "core" syntax [8 (section 6)] or in the message format syntax - [32]. - - Reverse-path = Path - Forward-path = Path - Path = "<" [ A-d-l ":" ] Mailbox ">" - A-d-l = At-domain *( "," A-d-l ) - ; Note that this form, the so-called "source route", - ; MUST BE accepted, SHOULD NOT be generated, and SHOULD be - ; ignored. - At-domain = "@" domain - Mail-parameters = esmtp-param *(SP esmtp-param) - Rcpt-parameters = esmtp-param *(SP esmtp-param) - - - -Klensin Standards Track [Page 36] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - esmtp-param = esmtp-keyword ["=" esmtp-value] - esmtp-keyword = (ALPHA / DIGIT) *(ALPHA / DIGIT / "-") - esmtp-value = 1*(%d33-60 / %d62-127) - ; any CHAR excluding "=", SP, and control characters - Keyword = Ldh-str - Argument = Atom - Domain = (sub-domain 1*("." sub-domain)) / address-literal - sub-domain = Let-dig [Ldh-str] - - address-literal = "[" IPv4-address-literal / - IPv6-address-literal / - General-address-literal "]" - ; See section 4.1.3 - - Mailbox = Local-part "@" Domain - - Local-part = Dot-string / Quoted-string - ; MAY be case-sensitive - - Dot-string = Atom *("." Atom) - - Atom = 1*atext - - Quoted-string = DQUOTE *qcontent DQUOTE - - String = Atom / Quoted-string - - While the above definition for Local-part is relatively permissive, - for maximum interoperability, a host that expects to receive mail - SHOULD avoid defining mailboxes where the Local-part requires (or - uses) the Quoted-string form or where the Local-part is case- - sensitive. For any purposes that require generating or comparing - Local-parts (e.g., to specific mailbox names), all quoted forms MUST - be treated as equivalent and the sending system SHOULD transmit the - form that uses the minimum quoting possible. - - Systems MUST NOT define mailboxes in such a way as to require the use - in SMTP of non-ASCII characters (octets with the high order bit set - to one) or ASCII "control characters" (decimal value 0-31 and 127). - These characters MUST NOT be used in MAIL or RCPT commands or other - commands that require mailbox names. - - Note that the backslash, "\", is a quote character, which is used to - indicate that the next character is to be used literally (instead of - its normal interpretation). For example, "Joe\,Smith" indicates a - single nine character user field with the comma being the fourth - character of the field. - - - - -Klensin Standards Track [Page 37] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - To promote interoperability and consistent with long-standing - guidance about conservative use of the DNS in naming and applications - (e.g., see section 2.3.1 of the base DNS document, RFC1035 [22]), - characters outside the set of alphas, digits, and hyphen MUST NOT - appear in domain name labels for SMTP clients or servers. In - particular, the underscore character is not permitted. SMTP servers - that receive a command in which invalid character codes have been - employed, and for which there are no other reasons for rejection, - MUST reject that command with a 501 response. - -4.1.3 Address Literals - - Sometimes a host is not known to the domain name system and - communication (and, in particular, communication to report and repair - the error) is blocked. To bypass this barrier a special literal form - of the address is allowed as an alternative to a domain name. For - IPv4 addresses, this form uses four small decimal integers separated - by dots and enclosed by brackets such as [123.255.37.2], which - indicates an (IPv4) Internet Address in sequence-of-octets form. For - IPv6 and other forms of addressing that might eventually be - standardized, the form consists of a standardized "tag" that - identifies the address syntax, a colon, and the address itself, in a - format specified as part of the IPv6 standards [17]. - - Specifically: - - IPv4-address-literal = Snum 3("." Snum) - IPv6-address-literal = "IPv6:" IPv6-addr - General-address-literal = Standardized-tag ":" 1*dcontent - Standardized-tag = Ldh-str - ; MUST be specified in a standards-track RFC - ; and registered with IANA - - Snum = 1*3DIGIT ; representing a decimal integer - ; value in the range 0 through 255 - Let-dig = ALPHA / DIGIT - Ldh-str = *( ALPHA / DIGIT / "-" ) Let-dig - - IPv6-addr = IPv6-full / IPv6-comp / IPv6v4-full / IPv6v4-comp - IPv6-hex = 1*4HEXDIG - IPv6-full = IPv6-hex 7(":" IPv6-hex) - IPv6-comp = [IPv6-hex *5(":" IPv6-hex)] "::" [IPv6-hex *5(":" - IPv6-hex)] - ; The "::" represents at least 2 16-bit groups of zeros - ; No more than 6 groups in addition to the "::" may be - ; present - IPv6v4-full = IPv6-hex 5(":" IPv6-hex) ":" IPv4-address-literal - IPv6v4-comp = [IPv6-hex *3(":" IPv6-hex)] "::" - - - -Klensin Standards Track [Page 38] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - [IPv6-hex *3(":" IPv6-hex) ":"] IPv4-address-literal - ; The "::" represents at least 2 16-bit groups of zeros - ; No more than 4 groups in addition to the "::" and - ; IPv4-address-literal may be present - -4.1.4 Order of Commands - - There are restrictions on the order in which these commands may be - used. - - A session that will contain mail transactions MUST first be - initialized by the use of the EHLO command. An SMTP server SHOULD - accept commands for non-mail transactions (e.g., VRFY or EXPN) - without this initialization. - - An EHLO command MAY be issued by a client later in the session. If - it is issued after the session begins, the SMTP server MUST clear all - buffers and reset the state exactly as if a RSET command had been - issued. In other words, the sequence of RSET followed immediately by - EHLO is redundant, but not harmful other than in the performance cost - of executing unnecessary commands. - - If the EHLO command is not acceptable to the SMTP server, 501, 500, - or 502 failure replies MUST be returned as appropriate. The SMTP - server MUST stay in the same state after transmitting these replies - that it was in before the EHLO was received. - - The SMTP client MUST, if possible, ensure that the domain parameter - to the EHLO command is a valid principal host name (not a CNAME or MX - name) for its host. If this is not possible (e.g., when the client's - address is dynamically assigned and the client does not have an - obvious name), an address literal SHOULD be substituted for the - domain name and supplemental information provided that will assist in - identifying the client. - - An SMTP server MAY verify that the domain name parameter in the EHLO - command actually corresponds to the IP address of the client. - However, the server MUST NOT refuse to accept a message for this - reason if the verification fails: the information about verification - failure is for logging and tracing only. - - The NOOP, HELP, EXPN, VRFY, and RSET commands can be used at any time - during a session, or without previously initializing a session. SMTP - servers SHOULD process these normally (that is, not return a 503 - code) even if no EHLO command has yet been received; clients SHOULD - open a session with EHLO before sending these commands. - - - - - -Klensin Standards Track [Page 39] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - If these rules are followed, the example in RFC 821 that shows "550 - access denied to you" in response to an EXPN command is incorrect - unless an EHLO command precedes the EXPN or the denial of access is - based on the client's IP address or other authentication or - authorization-determining mechanisms. - - The MAIL command (or the obsolete SEND, SOML, or SAML commands) - begins a mail transaction. Once started, a mail transaction consists - of a transaction beginning command, one or more RCPT commands, and a - DATA command, in that order. A mail transaction may be aborted by - the RSET (or a new EHLO) command. There may be zero or more - transactions in a session. MAIL (or SEND, SOML, or SAML) MUST NOT be - sent if a mail transaction is already open, i.e., it should be sent - only if no mail transaction had been started in the session, or it - the previous one successfully concluded with a successful DATA - command, or if the previous one was aborted with a RSET. - - If the transaction beginning command argument is not acceptable, a - 501 failure reply MUST be returned and the SMTP server MUST stay in - the same state. If the commands in a transaction are out of order to - the degree that they cannot be processed by the server, a 503 failure - reply MUST be returned and the SMTP server MUST stay in the same - state. - - The last command in a session MUST be the QUIT command. The QUIT - command cannot be used at any other time in a session, but SHOULD be - used by the client SMTP to request connection closure, even when no - session opening command was sent and accepted. - -4.1.5 Private-use Commands - - As specified in section 2.2.2, commands starting in "X" may be used - by bilateral agreement between the client (sending) and server - (receiving) SMTP agents. An SMTP server that does not recognize such - a command is expected to reply with "500 Command not recognized". An - extended SMTP server MAY list the feature names associated with these - private commands in the response to the EHLO command. - - Commands sent or accepted by SMTP systems that do not start with "X" - MUST conform to the requirements of section 2.2.2. - -4.2 SMTP Replies - - Replies to SMTP commands serve to ensure the synchronization of - requests and actions in the process of mail transfer and to guarantee - that the SMTP client always knows the state of the SMTP server. - Every command MUST generate exactly one reply. - - - - -Klensin Standards Track [Page 40] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - The details of the command-reply sequence are described in section - 4.3. - - An SMTP reply consists of a three digit number (transmitted as three - numeric characters) followed by some text unless specified otherwise - in this document. The number is for use by automata to determine - what state to enter next; the text is for the human user. The three - digits contain enough encoded information that the SMTP client need - not examine the text and may either discard it or pass it on to the - user, as appropriate. Exceptions are as noted elsewhere in this - document. In particular, the 220, 221, 251, 421, and 551 reply codes - are associated with message text that must be parsed and interpreted - by machines. In the general case, the text may be receiver dependent - and context dependent, so there are likely to be varying texts for - each reply code. A discussion of the theory of reply codes is given - in section 4.2.1. Formally, a reply is defined to be the sequence: a - three-digit code, , one line of text, and , or a multiline - reply (as defined in section 4.2.1). Since, in violation of this - specification, the text is sometimes not sent, clients which do not - receive it SHOULD be prepared to process the code alone (with or - without a trailing space character). Only the EHLO, EXPN, and HELP - commands are expected to result in multiline replies in normal - circumstances, however, multiline replies are allowed for any - command. - - In ABNF, server responses are: - - Greeting = "220 " Domain [ SP text ] CRLF - Reply-line = Reply-code [ SP text ] CRLF - - where "Greeting" appears only in the 220 response that announces that - the server is opening its part of the connection. - - An SMTP server SHOULD send only the reply codes listed in this - document. An SMTP server SHOULD use the text shown in the examples - whenever appropriate. - - An SMTP client MUST determine its actions only by the reply code, not - by the text (except for the "change of address" 251 and 551 and, if - necessary, 220, 221, and 421 replies); in the general case, any text, - including no text at all (although senders SHOULD NOT send bare - codes), MUST be acceptable. The space (blank) following the reply - code is considered part of the text. Whenever possible, a receiver- - SMTP SHOULD test the first digit (severity indication) of the reply - code. - - - - - - -Klensin Standards Track [Page 41] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - The list of codes that appears below MUST NOT be construed as - permanent. While the addition of new codes should be a rare and - significant activity, with supplemental information in the textual - part of the response being preferred, new codes may be added as the - result of new Standards or Standards-track specifications. - Consequently, a sender-SMTP MUST be prepared to handle codes not - specified in this document and MUST do so by interpreting the first - digit only. - -4.2.1 Reply Code Severities and Theory - - The three digits of the reply each have a special significance. The - first digit denotes whether the response is good, bad or incomplete. - An unsophisticated SMTP client, or one that receives an unexpected - code, will be able to determine its next action (proceed as planned, - redo, retrench, etc.) by examining this first digit. An SMTP client - that wants to know approximately what kind of error occurred (e.g., - mail system error, command syntax error) may examine the second - digit. The third digit and any supplemental information that may be - present is reserved for the finest gradation of information. - - There are five values for the first digit of the reply code: - - 1yz Positive Preliminary reply - The command has been accepted, but the requested action is being - held in abeyance, pending confirmation of the information in this - reply. The SMTP client should send another command specifying - whether to continue or abort the action. Note: unextended SMTP - does not have any commands that allow this type of reply, and so - does not have continue or abort commands. - - 2yz Positive Completion reply - The requested action has been successfully completed. A new - request may be initiated. - - 3yz Positive Intermediate reply - The command has been accepted, but the requested action is being - held in abeyance, pending receipt of further information. The - SMTP client should send another command specifying this - information. This reply is used in command sequence groups (i.e., - in DATA). - - 4yz Transient Negative Completion reply - The command was not accepted, and the requested action did not - occur. However, the error condition is temporary and the action - may be requested again. The sender should return to the beginning - of the command sequence (if any). It is difficult to assign a - meaning to "transient" when two different sites (receiver- and - - - -Klensin Standards Track [Page 42] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - sender-SMTP agents) must agree on the interpretation. Each reply - in this category might have a different time value, but the SMTP - client is encouraged to try again. A rule of thumb to determine - whether a reply fits into the 4yz or the 5yz category (see below) - is that replies are 4yz if they can be successful if repeated - without any change in command form or in properties of the sender - or receiver (that is, the command is repeated identically and the - receiver does not put up a new implementation.) - - 5yz Permanent Negative Completion reply - The command was not accepted and the requested action did not - occur. The SMTP client is discouraged from repeating the exact - request (in the same sequence). Even some "permanent" error - conditions can be corrected, so the human user may want to direct - the SMTP client to reinitiate the command sequence by direct - action at some point in the future (e.g., after the spelling has - been changed, or the user has altered the account status). - - The second digit encodes responses in specific categories: - - x0z Syntax: These replies refer to syntax errors, syntactically - correct commands that do not fit any functional category, and - unimplemented or superfluous commands. - - x1z Information: These are replies to requests for information, - such as status or help. - - x2z Connections: These are replies referring to the transmission - channel. - - x3z Unspecified. - - x4z Unspecified. - - x5z Mail system: These replies indicate the status of the receiver - mail system vis-a-vis the requested transfer or other mail system - action. - - The third digit gives a finer gradation of meaning in each category - specified by the second digit. The list of replies illustrates this. - Each reply text is recommended rather than mandatory, and may even - change according to the command with which it is associated. On the - other hand, the reply codes must strictly follow the specifications - in this section. Receiver implementations should not invent new - codes for slightly different situations from the ones described here, - but rather adapt codes already defined. - - - - - -Klensin Standards Track [Page 43] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - For example, a command such as NOOP, whose successful execution does - not offer the SMTP client any new information, will return a 250 - reply. The reply is 502 when the command requests an unimplemented - non-site-specific action. A refinement of that is the 504 reply for - a command that is implemented, but that requests an unimplemented - parameter. - - The reply text may be longer than a single line; in these cases the - complete text must be marked so the SMTP client knows when it can - stop reading the reply. This requires a special format to indicate a - multiple line reply. - - The format for multiline replies requires that every line, except the - last, begin with the reply code, followed immediately by a hyphen, - "-" (also known as minus), followed by text. The last line will - begin with the reply code, followed immediately by , optionally - some text, and . As noted above, servers SHOULD send the - if subsequent text is not sent, but clients MUST be prepared for it - to be omitted. - - For example: - - 123-First line - 123-Second line - 123-234 text beginning with numbers - 123 The last line - - In many cases the SMTP client then simply needs to search for a line - beginning with the reply code followed by or and ignore - all preceding lines. In a few cases, there is important data for the - client in the reply "text". The client will be able to identify - these cases from the current context. - -4.2.2 Reply Codes by Function Groups - - 500 Syntax error, command unrecognized - (This may include errors such as command line too long) - 501 Syntax error in parameters or arguments - 502 Command not implemented (see section 4.2.4) - 503 Bad sequence of commands - 504 Command parameter not implemented - - 211 System status, or system help reply - 214 Help message - (Information on how to use the receiver or the meaning of a - particular non-standard command; this reply is useful only - to the human user) - - - - -Klensin Standards Track [Page 44] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - 220 Service ready - 221 Service closing transmission channel - 421 Service not available, closing transmission channel - (This may be a reply to any command if the service knows it - must shut down) - - 250 Requested mail action okay, completed - 251 User not local; will forward to - (See section 3.4) - 252 Cannot VRFY user, but will accept message and attempt - delivery - (See section 3.5.3) - 450 Requested mail action not taken: mailbox unavailable - (e.g., mailbox busy) - 550 Requested action not taken: mailbox unavailable - (e.g., mailbox not found, no access, or command rejected - for policy reasons) - 451 Requested action aborted: error in processing - 551 User not local; please try - (See section 3.4) - 452 Requested action not taken: insufficient system storage - 552 Requested mail action aborted: exceeded storage allocation - 553 Requested action not taken: mailbox name not allowed - (e.g., mailbox syntax incorrect) - 354 Start mail input; end with . - 554 Transaction failed (Or, in the case of a connection-opening - response, "No SMTP service here") - -4.2.3 Reply Codes in Numeric Order - - 211 System status, or system help reply - 214 Help message - (Information on how to use the receiver or the meaning of a - particular non-standard command; this reply is useful only - to the human user) - 220 Service ready - 221 Service closing transmission channel - 250 Requested mail action okay, completed - 251 User not local; will forward to - (See section 3.4) - 252 Cannot VRFY user, but will accept message and attempt - delivery - (See section 3.5.3) - - 354 Start mail input; end with . - - - - - - -Klensin Standards Track [Page 45] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - 421 Service not available, closing transmission channel - (This may be a reply to any command if the service knows it - must shut down) - 450 Requested mail action not taken: mailbox unavailable - (e.g., mailbox busy) - 451 Requested action aborted: local error in processing - 452 Requested action not taken: insufficient system storage - 500 Syntax error, command unrecognized - (This may include errors such as command line too long) - 501 Syntax error in parameters or arguments - 502 Command not implemented (see section 4.2.4) - 503 Bad sequence of commands - 504 Command parameter not implemented - 550 Requested action not taken: mailbox unavailable - (e.g., mailbox not found, no access, or command rejected - for policy reasons) - 551 User not local; please try - (See section 3.4) - 552 Requested mail action aborted: exceeded storage allocation - 553 Requested action not taken: mailbox name not allowed - (e.g., mailbox syntax incorrect) - 554 Transaction failed (Or, in the case of a connection-opening - response, "No SMTP service here") - -4.2.4 Reply Code 502 - - Questions have been raised as to when reply code 502 (Command not - implemented) SHOULD be returned in preference to other codes. 502 - SHOULD be used when the command is actually recognized by the SMTP - server, but not implemented. If the command is not recognized, code - 500 SHOULD be returned. Extended SMTP systems MUST NOT list - capabilities in response to EHLO for which they will return 502 (or - 500) replies. - -4.2.5 Reply Codes After DATA and the Subsequent . - - When an SMTP server returns a positive completion status (2yz code) - after the DATA command is completed with ., it accepts - responsibility for: - - - delivering the message (if the recipient mailbox exists), or - - - if attempts to deliver the message fail due to transient - conditions, retrying delivery some reasonable number of times at - intervals as specified in section 4.5.4. - - - - - - -Klensin Standards Track [Page 46] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - - if attempts to deliver the message fail due to permanent - conditions, or if repeated attempts to deliver the message fail - due to transient conditions, returning appropriate notification to - the sender of the original message (using the address in the SMTP - MAIL command). - - When an SMTP server returns a permanent error status (5yz) code after - the DATA command is completed with ., it MUST NOT make - any subsequent attempt to deliver that message. The SMTP client - retains responsibility for delivery of that message and may either - return it to the user or requeue it for a subsequent attempt (see - section 4.5.4.1). - - The user who originated the message SHOULD be able to interpret the - return of a transient failure status (by mail message or otherwise) - as a non-delivery indication, just as a permanent failure would be - interpreted. I.e., if the client SMTP successfully handles these - conditions, the user will not receive such a reply. - - When an SMTP server returns a permanent error status (5yz) code after - the DATA command is completely with ., it MUST NOT make - any subsequent attempt to deliver the message. As with temporary - error status codes, the SMTP client retains responsibility for the - message, but SHOULD not again attempt delivery to the same server - without user review and intervention of the message. - -4.3 Sequencing of Commands and Replies - -4.3.1 Sequencing Overview - - The communication between the sender and receiver is an alternating - dialogue, controlled by the sender. As such, the sender issues a - command and the receiver responds with a reply. Unless other - arrangements are negotiated through service extensions, the sender - MUST wait for this response before sending further commands. - - One important reply is the connection greeting. Normally, a receiver - will send a 220 "Service ready" reply when the connection is - completed. The sender SHOULD wait for this greeting message before - sending any commands. - - Note: all the greeting-type replies have the official name (the - fully-qualified primary domain name) of the server host as the first - word following the reply code. Sometimes the host will have no - meaningful name. See 4.1.3 for a discussion of alternatives in these - situations. - - - - - -Klensin Standards Track [Page 47] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - For example, - - 220 ISIF.USC.EDU Service ready - or - 220 mail.foo.com SuperSMTP v 6.1.2 Service ready - or - 220 [10.0.0.1] Clueless host service ready - - The table below lists alternative success and failure replies for - each command. These SHOULD be strictly adhered to: a receiver may - substitute text in the replies, but the meaning and action implied by - the code numbers and by the specific command reply sequence cannot be - altered. - -4.3.2 Command-Reply Sequences - - Each command is listed with its usual possible replies. The prefixes - used before the possible replies are "I" for intermediate, "S" for - success, and "E" for error. Since some servers may generate other - replies under special circumstances, and to allow for future - extension, SMTP clients SHOULD, when possible, interpret only the - first digit of the reply and MUST be prepared to deal with - unrecognized reply codes by interpreting the first digit only. - Unless extended using the mechanisms described in section 2.2, SMTP - servers MUST NOT transmit reply codes to an SMTP client that are - other than three digits or that do not start in a digit between 2 and - 5 inclusive. - - These sequencing rules and, in principle, the codes themselves, can - be extended or modified by SMTP extensions offered by the server and - accepted (requested) by the client. - - In addition to the codes listed below, any SMTP command can return - any of the following codes if the corresponding unusual circumstances - are encountered: - - 500 For the "command line too long" case or if the command name was - not recognized. Note that producing a "command not recognized" - error in response to the required subset of these commands is a - violation of this specification. - - 501 Syntax error in command or arguments. In order to provide for - future extensions, commands that are specified in this document as - not accepting arguments (DATA, RSET, QUIT) SHOULD return a 501 - message if arguments are supplied in the absence of EHLO- - advertised extensions. - - 421 Service shutting down and closing transmission channel - - - -Klensin Standards Track [Page 48] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - Specific sequences are: - - CONNECTION ESTABLISHMENT - S: 220 - E: 554 - EHLO or HELO - S: 250 - E: 504, 550 - MAIL - S: 250 - E: 552, 451, 452, 550, 553, 503 - RCPT - S: 250, 251 (but see section 3.4 for discussion of 251 and 551) - E: 550, 551, 552, 553, 450, 451, 452, 503, 550 - DATA - I: 354 -> data -> S: 250 - E: 552, 554, 451, 452 - E: 451, 554, 503 - RSET - S: 250 - VRFY - S: 250, 251, 252 - E: 550, 551, 553, 502, 504 - EXPN - S: 250, 252 - E: 550, 500, 502, 504 - HELP - S: 211, 214 - E: 502, 504 - NOOP - S: 250 - QUIT - S: 221 - -4.4 Trace Information - - When an SMTP server receives a message for delivery or further - processing, it MUST insert trace ("time stamp" or "Received") - information at the beginning of the message content, as discussed in - section 4.1.1.4. - - This line MUST be structured as follows: - - - The FROM field, which MUST be supplied in an SMTP environment, - SHOULD contain both (1) the name of the source host as presented - in the EHLO command and (2) an address literal containing the IP - address of the source, determined from the TCP connection. - - - - -Klensin Standards Track [Page 49] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - - The ID field MAY contain an "@" as suggested in RFC 822, but this - is not required. - - - The FOR field MAY contain a list of entries when multiple - RCPT commands have been given. This may raise some security - issues and is usually not desirable; see section 7.2. - - An Internet mail program MUST NOT change a Received: line that was - previously added to the message header. SMTP servers MUST prepend - Received lines to messages; they MUST NOT change the order of - existing lines or insert Received lines in any other location. - - As the Internet grows, comparability of Received fields is important - for detecting problems, especially slow relays. SMTP servers that - create Received fields SHOULD use explicit offsets in the dates - (e.g., -0800), rather than time zone names of any type. Local time - (with an offset) is preferred to UT when feasible. This formulation - allows slightly more information about local circumstances to be - specified. If UT is needed, the receiver need merely do some simple - arithmetic to convert the values. Use of UT loses information about - the time zone-location of the server. If it is desired to supply a - time zone name, it SHOULD be included in a comment. - - When the delivery SMTP server makes the "final delivery" of a - message, it inserts a return-path line at the beginning of the mail - data. This use of return-path is required; mail systems MUST support - it. The return-path line preserves the information in the from the MAIL command. Here, final delivery means the message - has left the SMTP environment. Normally, this would mean it had been - delivered to the destination user or an associated mail drop, but in - some cases it may be further processed and transmitted by another - mail system. - - It is possible for the mailbox in the return path to be different - from the actual sender's mailbox, for example, if error responses are - to be delivered to a special error handling mailbox rather than to - the message sender. When mailing lists are involved, this - arrangement is common and useful as a means of directing errors to - the list maintainer rather than the message originator. - - The text above implies that the final mail data will begin with a - return path line, followed by one or more time stamp lines. These - lines will be followed by the mail data headers and body [32]. - - It is sometimes difficult for an SMTP server to determine whether or - not it is making final delivery since forwarding or other operations - may occur after the message is accepted for delivery. Consequently, - - - - -Klensin Standards Track [Page 50] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - any further (forwarding, gateway, or relay) systems MAY remove the - return path and rebuild the MAIL command as needed to ensure that - exactly one such line appears in a delivered message. - - A message-originating SMTP system SHOULD NOT send a message that - already contains a Return-path header. SMTP servers performing a - relay function MUST NOT inspect the message data, and especially not - to the extent needed to determine if Return-path headers are present. - SMTP servers making final delivery MAY remove Return-path headers - before adding their own. - - The primary purpose of the Return-path is to designate the address to - which messages indicating non-delivery or other mail system failures - are to be sent. For this to be unambiguous, exactly one return path - SHOULD be present when the message is delivered. Systems using RFC - 822 syntax with non-SMTP transports SHOULD designate an unambiguous - address, associated with the transport envelope, to which error - reports (e.g., non-delivery messages) should be sent. - - Historical note: Text in RFC 822 that appears to contradict the use - of the Return-path header (or the envelope reverse path address from - the MAIL command) as the destination for error messages is not - applicable on the Internet. The reverse path address (as copied into - the Return-path) MUST be used as the target of any mail containing - delivery error messages. - - In particular: - - - a gateway from SMTP->elsewhere SHOULD insert a return-path header, - unless it is known that the "elsewhere" transport also uses - Internet domain addresses and maintains the envelope sender - address separately. - - - a gateway from elsewhere->SMTP SHOULD delete any return-path - header present in the message, and either copy that information to - the SMTP envelope or combine it with information present in the - envelope of the other transport system to construct the reverse - path argument to the MAIL command in the SMTP envelope. - - The server must give special treatment to cases in which the - processing following the end of mail data indication is only - partially successful. This could happen if, after accepting several - recipients and the mail data, the SMTP server finds that the mail - data could be successfully delivered to some, but not all, of the - recipients. In such cases, the response to the DATA command MUST be - an OK reply. However, the SMTP server MUST compose and send an - "undeliverable mail" notification message to the originator of the - message. - - - -Klensin Standards Track [Page 51] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - A single notification listing all of the failed recipients or - separate notification messages MUST be sent for each failed - recipient. For economy of processing by the sender, the former is - preferred when possible. All undeliverable mail notification - messages are sent using the MAIL command (even if they result from - processing the obsolete SEND, SOML, or SAML commands) and use a null - return path as discussed in section 3.7. - - The time stamp line and the return path line are formally defined as - follows: - -Return-path-line = "Return-Path:" FWS Reverse-path - -Time-stamp-line = "Received:" FWS Stamp - -Stamp = From-domain By-domain Opt-info ";" FWS date-time - - ; where "date-time" is as defined in [32] - ; but the "obs-" forms, especially two-digit - ; years, are prohibited in SMTP and MUST NOT be used. - -From-domain = "FROM" FWS Extended-Domain CFWS - -By-domain = "BY" FWS Extended-Domain CFWS - -Extended-Domain = Domain / - ( Domain FWS "(" TCP-info ")" ) / - ( Address-literal FWS "(" TCP-info ")" ) - -TCP-info = Address-literal / ( Domain FWS Address-literal ) - ; Information derived by server from TCP connection - ; not client EHLO. - -Opt-info = [Via] [With] [ID] [For] - -Via = "VIA" FWS Link CFWS - -With = "WITH" FWS Protocol CFWS - -ID = "ID" FWS String / msg-id CFWS - -For = "FOR" FWS 1*( Path / Mailbox ) CFWS - -Link = "TCP" / Addtl-Link -Addtl-Link = Atom - ; Additional standard names for links are registered with the - ; Internet Assigned Numbers Authority (IANA). "Via" is - ; primarily of value with non-Internet transports. SMTP - - - -Klensin Standards Track [Page 52] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - ; servers SHOULD NOT use unregistered names. -Protocol = "ESMTP" / "SMTP" / Attdl-Protocol -Attdl-Protocol = Atom - ; Additional standard names for protocols are registered with the - ; Internet Assigned Numbers Authority (IANA). SMTP servers - ; SHOULD NOT use unregistered names. - -4.5 Additional Implementation Issues - -4.5.1 Minimum Implementation - - In order to make SMTP workable, the following minimum implementation - is required for all receivers. The following commands MUST be - supported to conform to this specification: - - EHLO - HELO - MAIL - RCPT - DATA - RSET - NOOP - QUIT - VRFY - - Any system that includes an SMTP server supporting mail relaying or - delivery MUST support the reserved mailbox "postmaster" as a case- - insensitive local name. This postmaster address is not strictly - necessary if the server always returns 554 on connection opening (as - described in section 3.1). The requirement to accept mail for - postmaster implies that RCPT commands which specify a mailbox for - postmaster at any of the domains for which the SMTP server provides - mail service, as well as the special case of "RCPT TO:" - (with no domain specification), MUST be supported. - - SMTP systems are expected to make every reasonable effort to accept - mail directed to Postmaster from any other system on the Internet. - In extreme cases --such as to contain a denial of service attack or - other breach of security-- an SMTP server may block mail directed to - Postmaster. However, such arrangements SHOULD be narrowly tailored - so as to avoid blocking messages which are not part of such attacks. - -4.5.2 Transparency - - Without some provision for data transparency, the character sequence - "." ends the mail text and cannot be sent by the user. - In general, users are not aware of such "forbidden" sequences. To - - - - -Klensin Standards Track [Page 53] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - allow all user composed text to be transmitted transparently, the - following procedures are used: - - - Before sending a line of mail text, the SMTP client checks the - first character of the line. If it is a period, one additional - period is inserted at the beginning of the line. - - - When a line of mail text is received by the SMTP server, it checks - the line. If the line is composed of a single period, it is - treated as the end of mail indicator. If the first character is a - period and there are other characters on the line, the first - character is deleted. - - The mail data may contain any of the 128 ASCII characters. All - characters are to be delivered to the recipient's mailbox, including - spaces, vertical and horizontal tabs, and other control characters. - If the transmission channel provides an 8-bit byte (octet) data - stream, the 7-bit ASCII codes are transmitted right justified in the - octets, with the high order bits cleared to zero. See 3.7 for - special treatment of these conditions in SMTP systems serving a relay - function. - - In some systems it may be necessary to transform the data as it is - received and stored. This may be necessary for hosts that use a - different character set than ASCII as their local character set, that - store data in records rather than strings, or which use special - character sequences as delimiters inside mailboxes. If such - transformations are necessary, they MUST be reversible, especially if - they are applied to mail being relayed. - -4.5.3 Sizes and Timeouts - -4.5.3.1 Size limits and minimums - - There are several objects that have required minimum/maximum sizes. - Every implementation MUST be able to receive objects of at least - these sizes. Objects larger than these sizes SHOULD be avoided when - possible. However, some Internet mail constructs such as encoded - X.400 addresses [16] will often require larger objects: clients MAY - attempt to transmit these, but MUST be prepared for a server to - reject them if they cannot be handled by it. To the maximum extent - possible, implementation techniques which impose no limits on the - length of these objects should be used. - - local-part - The maximum total length of a user name or other local-part is 64 - characters. - - - - -Klensin Standards Track [Page 54] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - domain - The maximum total length of a domain name or number is 255 - characters. - - path - The maximum total length of a reverse-path or forward-path is 256 - characters (including the punctuation and element separators). - - command line - The maximum total length of a command line including the command - word and the is 512 characters. SMTP extensions may be - used to increase this limit. - - reply line - The maximum total length of a reply line including the reply code - and the is 512 characters. More information may be - conveyed through multiple-line replies. - - text line - The maximum total length of a text line including the is - 1000 characters (not counting the leading dot duplicated for - transparency). This number may be increased by the use of SMTP - Service Extensions. - - message content - The maximum total length of a message content (including any - message headers as well as the message body) MUST BE at least 64K - octets. Since the introduction of Internet standards for - multimedia mail [12], message lengths on the Internet have grown - dramatically, and message size restrictions should be avoided if - at all possible. SMTP server systems that must impose - restrictions SHOULD implement the "SIZE" service extension [18], - and SMTP client systems that will send large messages SHOULD - utilize it when possible. - - recipients buffer - The minimum total number of recipients that must be buffered is - 100 recipients. Rejection of messages (for excessive recipients) - with fewer than 100 RCPT commands is a violation of this - specification. The general principle that relaying SMTP servers - MUST NOT, and delivery SMTP servers SHOULD NOT, perform validation - tests on message headers suggests that rejecting a message based - on the total number of recipients shown in header fields is to be - discouraged. A server which imposes a limit on the number of - recipients MUST behave in an orderly fashion, such as to reject - additional addresses over its limit rather than silently - discarding addresses previously accepted. A client that needs to - - - - -Klensin Standards Track [Page 55] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - deliver a message containing over 100 RCPT commands SHOULD be - prepared to transmit in 100-recipient "chunks" if the server - declines to accept more than 100 recipients in a single message. - - Errors due to exceeding these limits may be reported by using the - reply codes. Some examples of reply codes are: - - 500 Line too long. - or - 501 Path too long - or - 452 Too many recipients (see below) - or - 552 Too much mail data. - - RFC 821 [30] incorrectly listed the error where an SMTP server - exhausts its implementation limit on the number of RCPT commands - ("too many recipients") as having reply code 552. The correct reply - code for this condition is 452. Clients SHOULD treat a 552 code in - this case as a temporary, rather than permanent, failure so the logic - below works. - - When a conforming SMTP server encounters this condition, it has at - least 100 successful RCPT commands in its recipients buffer. If the - server is able to accept the message, then at least these 100 - addresses will be removed from the SMTP client's queue. When the - client attempts retransmission of those addresses which received 452 - responses, at least 100 of these will be able to fit in the SMTP - server's recipients buffer. Each retransmission attempt which is - able to deliver anything will be able to dispose of at least 100 of - these recipients. - - If an SMTP server has an implementation limit on the number of RCPT - commands and this limit is exhausted, it MUST use a response code of - 452 (but the client SHOULD also be prepared for a 552, as noted - above). If the server has a configured site-policy limitation on the - number of RCPT commands, it MAY instead use a 5XX response code. - This would be most appropriate if the policy limitation was intended - to apply if the total recipient count for a particular message body - were enforced even if that message body was sent in multiple mail - transactions. - -4.5.3.2 Timeouts - - An SMTP client MUST provide a timeout mechanism. It MUST use per- - command timeouts rather than somehow trying to time the entire mail - transaction. Timeouts SHOULD be easily reconfigurable, preferably - without recompiling the SMTP code. To implement this, a timer is set - - - -Klensin Standards Track [Page 56] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - for each SMTP command and for each buffer of the data transfer. The - latter means that the overall timeout is inherently proportional to - the size of the message. - - Based on extensive experience with busy mail-relay hosts, the minimum - per-command timeout values SHOULD be as follows: - - Initial 220 Message: 5 minutes - An SMTP client process needs to distinguish between a failed TCP - connection and a delay in receiving the initial 220 greeting - message. Many SMTP servers accept a TCP connection but delay - delivery of the 220 message until their system load permits more - mail to be processed. - - MAIL Command: 5 minutes - - RCPT Command: 5 minutes - A longer timeout is required if processing of mailing lists and - aliases is not deferred until after the message was accepted. - - DATA Initiation: 2 minutes - This is while awaiting the "354 Start Input" reply to a DATA - command. - - Data Block: 3 minutes - This is while awaiting the completion of each TCP SEND call - transmitting a chunk of data. - - DATA Termination: 10 minutes. - This is while awaiting the "250 OK" reply. When the receiver gets - the final period terminating the message data, it typically - performs processing to deliver the message to a user mailbox. A - spurious timeout at this point would be very wasteful and would - typically result in delivery of multiple copies of the message, - since it has been successfully sent and the server has accepted - responsibility for delivery. See section 6.1 for additional - discussion. - - An SMTP server SHOULD have a timeout of at least 5 minutes while it - is awaiting the next command from the sender. - -4.5.4 Retry Strategies - - The common structure of a host SMTP implementation includes user - mailboxes, one or more areas for queuing messages in transit, and one - or more daemon processes for sending and receiving mail. The exact - structure will vary depending on the needs of the users on the host - - - - -Klensin Standards Track [Page 57] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - and the number and size of mailing lists supported by the host. We - describe several optimizations that have proved helpful, particularly - for mailers supporting high traffic levels. - - Any queuing strategy MUST include timeouts on all activities on a - per-command basis. A queuing strategy MUST NOT send error messages - in response to error messages under any circumstances. - -4.5.4.1 Sending Strategy - - The general model for an SMTP client is one or more processes that - periodically attempt to transmit outgoing mail. In a typical system, - the program that composes a message has some method for requesting - immediate attention for a new piece of outgoing mail, while mail that - cannot be transmitted immediately MUST be queued and periodically - retried by the sender. A mail queue entry will include not only the - message itself but also the envelope information. - - The sender MUST delay retrying a particular destination after one - attempt has failed. In general, the retry interval SHOULD be at - least 30 minutes; however, more sophisticated and variable strategies - will be beneficial when the SMTP client can determine the reason for - non-delivery. - - Retries continue until the message is transmitted or the sender gives - up; the give-up time generally needs to be at least 4-5 days. The - parameters to the retry algorithm MUST be configurable. - - A client SHOULD keep a list of hosts it cannot reach and - corresponding connection timeouts, rather than just retrying queued - mail items. - - Experience suggests that failures are typically transient (the target - system or its connection has crashed), favoring a policy of two - connection attempts in the first hour the message is in the queue, - and then backing off to one every two or three hours. - - The SMTP client can shorten the queuing delay in cooperation with the - SMTP server. For example, if mail is received from a particular - address, it is likely that mail queued for that host can now be sent. - Application of this principle may, in many cases, eliminate the - requirement for an explicit "send queues now" function such as ETRN - [9]. - - The strategy may be further modified as a result of multiple - addresses per host (see below) to optimize delivery time vs. resource - usage. - - - - -Klensin Standards Track [Page 58] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - An SMTP client may have a large queue of messages for each - unavailable destination host. If all of these messages were retried - in every retry cycle, there would be excessive Internet overhead and - the sending system would be blocked for a long period. Note that an - SMTP client can generally determine that a delivery attempt has - failed only after a timeout of several minutes and even a one-minute - timeout per connection will result in a very large delay if retries - are repeated for dozens, or even hundreds, of queued messages to the - same host. - - At the same time, SMTP clients SHOULD use great care in caching - negative responses from servers. In an extreme case, if EHLO is - issued multiple times during the same SMTP connection, different - answers may be returned by the server. More significantly, 5yz - responses to the MAIL command MUST NOT be cached. - - When a mail message is to be delivered to multiple recipients, and - the SMTP server to which a copy of the message is to be sent is the - same for multiple recipients, then only one copy of the message - SHOULD be transmitted. That is, the SMTP client SHOULD use the - command sequence: MAIL, RCPT, RCPT,... RCPT, DATA instead of the - sequence: MAIL, RCPT, DATA, ..., MAIL, RCPT, DATA. However, if there - are very many addresses, a limit on the number of RCPT commands per - MAIL command MAY be imposed. Implementation of this efficiency - feature is strongly encouraged. - - Similarly, to achieve timely delivery, the SMTP client MAY support - multiple concurrent outgoing mail transactions. However, some limit - may be appropriate to protect the host from devoting all its - resources to mail. - -4.5.4.2 Receiving Strategy - - The SMTP server SHOULD attempt to keep a pending listen on the SMTP - port at all times. This requires the support of multiple incoming - TCP connections for SMTP. Some limit MAY be imposed but servers that - cannot handle more than one SMTP transaction at a time are not in - conformance with the intent of this specification. - - As discussed above, when the SMTP server receives mail from a - particular host address, it could activate its own SMTP queuing - mechanisms to retry any mail pending for that host address. - -4.5.5 Messages with a null reverse-path - - There are several types of notification messages which are required - by existing and proposed standards to be sent with a null reverse - path, namely non-delivery notifications as discussed in section 3.7, - - - -Klensin Standards Track [Page 59] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - other kinds of Delivery Status Notifications (DSNs) [24], and also - Message Disposition Notifications (MDNs) [10]. All of these kinds of - messages are notifications about a previous message, and they are - sent to the reverse-path of the previous mail message. (If the - delivery of such a notification message fails, that usually indicates - a problem with the mail system of the host to which the notification - message is addressed. For this reason, at some hosts the MTA is set - up to forward such failed notification messages to someone who is - able to fix problems with the mail system, e.g., via the postmaster - alias.) - - All other types of messages (i.e., any message which is not required - by a standards-track RFC to have a null reverse-path) SHOULD be sent - with with a valid, non-null reverse-path. - - Implementors of automated email processors should be careful to make - sure that the various kinds of messages with null reverse-path are - handled correctly, in particular such systems SHOULD NOT reply to - messages with null reverse-path. - -5. Address Resolution and Mail Handling - - Once an SMTP client lexically identifies a domain to which mail will - be delivered for processing (as described in sections 3.6 and 3.7), a - DNS lookup MUST be performed to resolve the domain name [22]. The - names are expected to be fully-qualified domain names (FQDNs): - mechanisms for inferring FQDNs from partial names or local aliases - are outside of this specification and, due to a history of problems, - are generally discouraged. The lookup first attempts to locate an MX - record associated with the name. If a CNAME record is found instead, - the resulting name is processed as if it were the initial name. If - no MX records are found, but an A RR is found, the A RR is treated as - if it was associated with an implicit MX RR, with a preference of 0, - pointing to that host. If one or more MX RRs are found for a given - name, SMTP systems MUST NOT utilize any A RRs associated with that - name unless they are located using the MX RRs; the "implicit MX" rule - above applies only if there are no MX records present. If MX records - are present, but none of them are usable, this situation MUST be - reported as an error. - - When the lookup succeeds, the mapping can result in a list of - alternative delivery addresses rather than a single address, because - of multiple MX records, multihoming, or both. To provide reliable - mail transmission, the SMTP client MUST be able to try (and retry) - each of the relevant addresses in this list in order, until a - delivery attempt succeeds. However, there MAY also be a configurable - limit on the number of alternate addresses that can be tried. In any - case, the SMTP client SHOULD try at least two addresses. - - - -Klensin Standards Track [Page 60] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - Two types of information is used to rank the host addresses: multiple - MX records, and multihomed hosts. - - Multiple MX records contain a preference indication that MUST be used - in sorting (see below). Lower numbers are more preferred than higher - ones. If there are multiple destinations with the same preference - and there is no clear reason to favor one (e.g., by recognition of an - easily-reached address), then the sender-SMTP MUST randomize them to - spread the load across multiple mail exchangers for a specific - organization. - - The destination host (perhaps taken from the preferred MX record) may - be multihomed, in which case the domain name resolver will return a - list of alternative IP addresses. It is the responsibility of the - domain name resolver interface to have ordered this list by - decreasing preference if necessary, and SMTP MUST try them in the - order presented. - - Although the capability to try multiple alternative addresses is - required, specific installations may want to limit or disable the use - of alternative addresses. The question of whether a sender should - attempt retries using the different addresses of a multihomed host - has been controversial. The main argument for using the multiple - addresses is that it maximizes the probability of timely delivery, - and indeed sometimes the probability of any delivery; the counter- - argument is that it may result in unnecessary resource use. Note - that resource use is also strongly determined by the sending strategy - discussed in section 4.5.4.1. - - If an SMTP server receives a message with a destination for which it - is a designated Mail eXchanger, it MAY relay the message (potentially - after having rewritten the MAIL FROM and/or RCPT TO addresses), make - final delivery of the message, or hand it off using some mechanism - outside the SMTP-provided transport environment. Of course, neither - of the latter require that the list of MX records be examined - further. - - If it determines that it should relay the message without rewriting - the address, it MUST sort the MX records to determine candidates for - delivery. The records are first ordered by preference, with the - lowest-numbered records being most preferred. The relay host MUST - then inspect the list for any of the names or addresses by which it - might be known in mail transactions. If a matching record is found, - all records at that preference level and higher-numbered ones MUST be - discarded from consideration. If there are no records left at that - point, it is an error condition, and the message MUST be returned as - undeliverable. If records do remain, they SHOULD be tried, best - preference first, as described above. - - - -Klensin Standards Track [Page 61] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - -6. Problem Detection and Handling - -6.1 Reliable Delivery and Replies by Email - - When the receiver-SMTP accepts a piece of mail (by sending a "250 OK" - message in response to DATA), it is accepting responsibility for - delivering or relaying the message. It must take this responsibility - seriously. It MUST NOT lose the message for frivolous reasons, such - as because the host later crashes or because of a predictable - resource shortage. - - If there is a delivery failure after acceptance of a message, the - receiver-SMTP MUST formulate and mail a notification message. This - notification MUST be sent using a null ("<>") reverse path in the - envelope. The recipient of this notification MUST be the address - from the envelope return path (or the Return-Path: line). However, - if this address is null ("<>"), the receiver-SMTP MUST NOT send a - notification. Obviously, nothing in this section can or should - prohibit local decisions (i.e., as part of the same system - environment as the receiver-SMTP) to log or otherwise transmit - information about null address events locally if that is desired. If - the address is an explicit source route, it MUST be stripped down to - its final hop. - - For example, suppose that an error notification must be sent for a - message that arrived with: - - MAIL FROM:<@a,@b:user@d> - - The notification message MUST be sent using: - - RCPT TO: - - Some delivery failures after the message is accepted by SMTP will be - unavoidable. For example, it may be impossible for the receiving - SMTP server to validate all the delivery addresses in RCPT command(s) - due to a "soft" domain system error, because the target is a mailing - list (see earlier discussion of RCPT), or because the server is - acting as a relay and has no immediate access to the delivering - system. - - To avoid receiving duplicate messages as the result of timeouts, a - receiver-SMTP MUST seek to minimize the time required to respond to - the final . end of data indicator. See RFC 1047 [28] for - a discussion of this problem. - - - - - - -Klensin Standards Track [Page 62] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - -6.2 Loop Detection - - Simple counting of the number of "Received:" headers in a message has - proven to be an effective, although rarely optimal, method of - detecting loops in mail systems. SMTP servers using this technique - SHOULD use a large rejection threshold, normally at least 100 - Received entries. Whatever mechanisms are used, servers MUST contain - provisions for detecting and stopping trivial loops. - -6.3 Compensating for Irregularities - - Unfortunately, variations, creative interpretations, and outright - violations of Internet mail protocols do occur; some would suggest - that they occur quite frequently. The debate as to whether a well- - behaved SMTP receiver or relay should reject a malformed message, - attempt to pass it on unchanged, or attempt to repair it to increase - the odds of successful delivery (or subsequent reply) began almost - with the dawn of structured network mail and shows no signs of - abating. Advocates of rejection claim that attempted repairs are - rarely completely adequate and that rejection of bad messages is the - only way to get the offending software repaired. Advocates of - "repair" or "deliver no matter what" argue that users prefer that - mail go through it if at all possible and that there are significant - market pressures in that direction. In practice, these market - pressures may be more important to particular vendors than strict - conformance to the standards, regardless of the preference of the - actual developers. - - The problems associated with ill-formed messages were exacerbated by - the introduction of the split-UA mail reading protocols [3, 26, 5, - 21]. These protocols have encouraged the use of SMTP as a posting - protocol, and SMTP servers as relay systems for these client hosts - (which are often only intermittently connected to the Internet). - Historically, many of those client machines lacked some of the - mechanisms and information assumed by SMTP (and indeed, by the mail - format protocol [7]). Some could not keep adequate track of time; - others had no concept of time zones; still others could not identify - their own names or addresses; and, of course, none could satisfy the - assumptions that underlay RFC 822's conception of authenticated - addresses. - - In response to these weak SMTP clients, many SMTP systems now - complete messages that are delivered to them in incomplete or - incorrect form. This strategy is generally considered appropriate - when the server can identify or authenticate the client, and there - are prior agreements between them. By contrast, there is at best - great concern about fixes applied by a relay or delivery SMTP server - that has little or no knowledge of the user or client machine. - - - -Klensin Standards Track [Page 63] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - The following changes to a message being processed MAY be applied - when necessary by an originating SMTP server, or one used as the - target of SMTP as an initial posting protocol: - - - Addition of a message-id field when none appears - - - Addition of a date, time or time zone when none appears - - - Correction of addresses to proper FQDN format - - The less information the server has about the client, the less likely - these changes are to be correct and the more caution and conservatism - should be applied when considering whether or not to perform fixes - and how. These changes MUST NOT be applied by an SMTP server that - provides an intermediate relay function. - - In all cases, properly-operating clients supplying correct - information are preferred to corrections by the SMTP server. In all - cases, documentation of actions performed by the servers (in trace - fields and/or header comments) is strongly encouraged. - -7. Security Considerations - -7.1 Mail Security and Spoofing - - SMTP mail is inherently insecure in that it is feasible for even - fairly casual users to negotiate directly with receiving and relaying - SMTP servers and create messages that will trick a naive recipient - into believing that they came from somewhere else. Constructing such - a message so that the "spoofed" behavior cannot be detected by an - expert is somewhat more difficult, but not sufficiently so as to be a - deterrent to someone who is determined and knowledgeable. - Consequently, as knowledge of Internet mail increases, so does the - knowledge that SMTP mail inherently cannot be authenticated, or - integrity checks provided, at the transport level. Real mail - security lies only in end-to-end methods involving the message - bodies, such as those which use digital signatures (see [14] and, - e.g., PGP [4] or S/MIME [31]). - - Various protocol extensions and configuration options that provide - authentication at the transport level (e.g., from an SMTP client to - an SMTP server) improve somewhat on the traditional situation - described above. However, unless they are accompanied by careful - handoffs of responsibility in a carefully-designed trust environment, - they remain inherently weaker than end-to-end mechanisms which use - digitally signed messages rather than depending on the integrity of - the transport system. - - - - -Klensin Standards Track [Page 64] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - Efforts to make it more difficult for users to set envelope return - path and header "From" fields to point to valid addresses other than - their own are largely misguided: they frustrate legitimate - applications in which mail is sent by one user on behalf of another - or in which error (or normal) replies should be directed to a special - address. (Systems that provide convenient ways for users to alter - these fields on a per-message basis should attempt to establish a - primary and permanent mailbox address for the user so that Sender - fields within the message data can be generated sensibly.) - - This specification does not further address the authentication issues - associated with SMTP other than to advocate that useful functionality - not be disabled in the hope of providing some small margin of - protection against an ignorant user who is trying to fake mail. - -7.2 "Blind" Copies - - Addresses that do not appear in the message headers may appear in the - RCPT commands to an SMTP server for a number of reasons. The two - most common involve the use of a mailing address as a "list exploder" - (a single address that resolves into multiple addresses) and the - appearance of "blind copies". Especially when more than one RCPT - command is present, and in order to avoid defeating some of the - purpose of these mechanisms, SMTP clients and servers SHOULD NOT copy - the full set of RCPT command arguments into the headers, either as - part of trace headers or as informational or private-extension - headers. Since this rule is often violated in practice, and cannot - be enforced, sending SMTP systems that are aware of "bcc" use MAY - find it helpful to send each blind copy as a separate message - transaction containing only a single RCPT command. - - There is no inherent relationship between either "reverse" (from - MAIL, SAML, etc., commands) or "forward" (RCPT) addresses in the SMTP - transaction ("envelope") and the addresses in the headers. Receiving - systems SHOULD NOT attempt to deduce such relationships and use them - to alter the headers of the message for delivery. The popular - "Apparently-to" header is a violation of this principle as well as a - common source of unintended information disclosure and SHOULD NOT be - used. - -7.3 VRFY, EXPN, and Security - - As discussed in section 3.5, individual sites may want to disable - either or both of VRFY or EXPN for security reasons. As a corollary - to the above, implementations that permit this MUST NOT appear to - have verified addresses that are not, in fact, verified. If a site - - - - - -Klensin Standards Track [Page 65] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - disables these commands for security reasons, the SMTP server MUST - return a 252 response, rather than a code that could be confused with - successful or unsuccessful verification. - - Returning a 250 reply code with the address listed in the VRFY - command after having checked it only for syntax violates this rule. - Of course, an implementation that "supports" VRFY by always returning - 550 whether or not the address is valid is equally not in - conformance. - - Within the last few years, the contents of mailing lists have become - popular as an address information source for so-called "spammers." - The use of EXPN to "harvest" addresses has increased as list - administrators have installed protections against inappropriate uses - of the lists themselves. Implementations SHOULD still provide - support for EXPN, but sites SHOULD carefully evaluate the tradeoffs. - As authentication mechanisms are introduced into SMTP, some sites may - choose to make EXPN available only to authenticated requestors. - -7.4 Information Disclosure in Announcements - - There has been an ongoing debate about the tradeoffs between the - debugging advantages of announcing server type and version (and, - sometimes, even server domain name) in the greeting response or in - response to the HELP command and the disadvantages of exposing - information that might be useful in a potential hostile attack. The - utility of the debugging information is beyond doubt. Those who - argue for making it available point out that it is far better to - actually secure an SMTP server rather than hope that trying to - conceal known vulnerabilities by hiding the server's precise identity - will provide more protection. Sites are encouraged to evaluate the - tradeoff with that issue in mind; implementations are strongly - encouraged to minimally provide for making type and version - information available in some way to other network hosts. - -7.5 Information Disclosure in Trace Fields - - In some circumstances, such as when mail originates from within a LAN - whose hosts are not directly on the public Internet, trace - ("Received") fields produced in conformance with this specification - may disclose host names and similar information that would not - normally be available. This ordinarily does not pose a problem, but - sites with special concerns about name disclosure should be aware of - it. Also, the optional FOR clause should be supplied with caution or - not at all when multiple recipients are involved lest it - inadvertently disclose the identities of "blind copy" recipients to - others. - - - - -Klensin Standards Track [Page 66] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - -7.6 Information Disclosure in Message Forwarding - - As discussed in section 3.4, use of the 251 or 551 reply codes to - identify the replacement address associated with a mailbox may - inadvertently disclose sensitive information. Sites that are - concerned about those issues should ensure that they select and - configure servers appropriately. - -7.7 Scope of Operation of SMTP Servers - - It is a well-established principle that an SMTP server may refuse to - accept mail for any operational or technical reason that makes sense - to the site providing the server. However, cooperation among sites - and installations makes the Internet possible. If sites take - excessive advantage of the right to reject traffic, the ubiquity of - email availability (one of the strengths of the Internet) will be - threatened; considerable care should be taken and balance maintained - if a site decides to be selective about the traffic it will accept - and process. - - In recent years, use of the relay function through arbitrary sites - has been used as part of hostile efforts to hide the actual origins - of mail. Some sites have decided to limit the use of the relay - function to known or identifiable sources, and implementations SHOULD - provide the capability to perform this type of filtering. When mail - is rejected for these or other policy reasons, a 550 code SHOULD be - used in response to EHLO, MAIL, or RCPT as appropriate. - -8. IANA Considerations - - IANA will maintain three registries in support of this specification. - The first consists of SMTP service extensions with the associated - keywords, and, as needed, parameters and verbs. As specified in - section 2.2.2, no entry may be made in this registry that starts in - an "X". Entries may be made only for service extensions (and - associated keywords, parameters, or verbs) that are defined in - standards-track or experimental RFCs specifically approved by the - IESG for this purpose. - - The second registry consists of "tags" that identify forms of domain - literals other than those for IPv4 addresses (specified in RFC 821 - and in this document) and IPv6 addresses (specified in this - document). Additional literal types require standardization before - being used; none are anticipated at this time. - - The third, established by RFC 821 and renewed by this specification, - is a registry of link and protocol identifiers to be used with the - "via" and "with" subclauses of the time stamp ("Received: header") - - - -Klensin Standards Track [Page 67] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - described in section 4.4. Link and protocol identifiers in addition - to those specified in this document may be registered only by - standardization or by way of an RFC-documented, IESG-approved, - Experimental protocol extension. - -9. References - - [1] American National Standards Institute (formerly United States of - America Standards Institute), X3.4, 1968, "USA Code for - Information Interchange". ANSI X3.4-1968 has been replaced by - newer versions with slight modifications, but the 1968 version - remains definitive for the Internet. - - [2] Braden, R., "Requirements for Internet hosts - application and - support", STD 3, RFC 1123, October 1989. - - [3] Butler, M., Chase, D., Goldberger, J., Postel, J. and J. - Reynolds, "Post Office Protocol - version 2", RFC 937, February - 1985. - - [4] Callas, J., Donnerhacke, L., Finney, H. and R. Thayer, "OpenPGP - Message Format", RFC 2440, November 1998. - - [5] Crispin, M., "Interactive Mail Access Protocol - Version 2", RFC - 1176, August 1990. - - [6] Crispin, M., "Internet Message Access Protocol - Version 4", RFC - 2060, December 1996. - - [7] Crocker, D., "Standard for the Format of ARPA Internet Text - Messages", RFC 822, August 1982. - - [8] Crocker, D. and P. Overell, Eds., "Augmented BNF for Syntax - Specifications: ABNF", RFC 2234, November 1997. - - [9] De Winter, J., "SMTP Service Extension for Remote Message Queue - Starting", RFC 1985, August 1996. - - [10] Fajman, R., "An Extensible Message Format for Message - Disposition Notifications", RFC 2298, March 1998. - - [11] Freed, N, "Behavior of and Requirements for Internet Firewalls", - RFC 2979, October 2000. - - [12] Freed, N. and N. Borenstein, "Multipurpose Internet Mail - Extensions (MIME) Part One: Format of Internet Message Bodies", - RFC 2045, December 1996. - - - - -Klensin Standards Track [Page 68] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - [13] Freed, N., "SMTP Service Extension for Command Pipelining", RFC - 2920, September 2000. - - [14] Galvin, J., Murphy, S., Crocker, S. and N. Freed, "Security - Multiparts for MIME: Multipart/Signed and Multipart/Encrypted", - RFC 1847, October 1995. - - [15] Gellens, R. and J. Klensin, "Message Submission", RFC 2476, - December 1998. - - [16] Kille, S., "Mapping between X.400 and RFC822/MIME", RFC 2156, - January 1998. - - [17] Hinden, R and S. Deering, Eds. "IP Version 6 Addressing - Architecture", RFC 2373, July 1998. - - [18] Klensin, J., Freed, N. and K. Moore, "SMTP Service Extension for - Message Size Declaration", STD 10, RFC 1870, November 1995. - - [19] Klensin, J., Freed, N., Rose, M., Stefferud, E. and D. Crocker, - "SMTP Service Extensions", STD 10, RFC 1869, November 1995. - - [20] Klensin, J., Freed, N., Rose, M., Stefferud, E. and D. Crocker, - "SMTP Service Extension for 8bit-MIMEtransport", RFC 1652, July - 1994. - - [21] Lambert, M., "PCMAIL: A distributed mail system for personal - computers", RFC 1056, July 1988. - - [22] Mockapetris, P., "Domain names - implementation and - specification", STD 13, RFC 1035, November 1987. - - Mockapetris, P., "Domain names - concepts and facilities", STD - 13, RFC 1034, November 1987. - - [23] Moore, K., "MIME (Multipurpose Internet Mail Extensions) Part - Three: Message Header Extensions for Non-ASCII Text", RFC 2047, - December 1996. - - [24] Moore, K., "SMTP Service Extension for Delivery Status - Notifications", RFC 1891, January 1996. - - [25] Moore, K., and G. Vaudreuil, "An Extensible Message Format for - Delivery Status Notifications", RFC 1894, January 1996. - - [26] Myers, J. and M. Rose, "Post Office Protocol - Version 3", STD - 53, RFC 1939, May 1996. - - - - -Klensin Standards Track [Page 69] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - [27] Partridge, C., "Mail routing and the domain system", RFC 974, - January 1986. - - [28] Partridge, C., "Duplicate messages and SMTP", RFC 1047, February - 1988. - - [29] Postel, J., ed., "Transmission Control Protocol - DARPA Internet - Program Protocol Specification", STD 7, RFC 793, September 1981. - - [30] Postel, J., "Simple Mail Transfer Protocol", RFC 821, August - 1982. - - [31] Ramsdell, B., Ed., "S/MIME Version 3 Message Specification", RFC - 2633, June 1999. - - [32] Resnick, P., Ed., "Internet Message Format", RFC 2822, April - 2001. - - [33] Vaudreuil, G., "SMTP Service Extensions for Transmission of - Large and Binary MIME Messages", RFC 1830, August 1995. - - [34] Vaudreuil, G., "Enhanced Mail System Status Codes", RFC 1893, - January 1996. - -10. Editor's Address - - John C. Klensin - AT&T Laboratories - 99 Bedford St - Boston, MA 02111 USA - - Phone: 617-574-3076 - EMail: klensin@research.att.com - -11. Acknowledgments - - Many people worked long and hard on the many iterations of this - document. There was wide-ranging debate in the IETF DRUMS Working - Group, both on its mailing list and in face to face discussions, - about many technical issues and the role of a revised standard for - Internet mail transport, and many contributors helped form the - wording in this specification. The hundreds of participants in the - many discussions since RFC 821 was produced are too numerous to - mention, but they all helped this document become what it is. - - - - - - - -Klensin Standards Track [Page 70] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - -APPENDICES - -A. TCP Transport Service - - The TCP connection supports the transmission of 8-bit bytes. The - SMTP data is 7-bit ASCII characters. Each character is transmitted - as an 8-bit byte with the high-order bit cleared to zero. Service - extensions may modify this rule to permit transmission of full 8-bit - data bytes as part of the message body, but not in SMTP commands or - responses. - -B. Generating SMTP Commands from RFC 822 Headers - - Some systems use RFC 822 headers (only) in a mail submission - protocol, or otherwise generate SMTP commands from RFC 822 headers - when such a message is handed to an MTA from a UA. While the MTA-UA - protocol is a private matter, not covered by any Internet Standard, - there are problems with this approach. For example, there have been - repeated problems with proper handling of "bcc" copies and - redistribution lists when information that conceptually belongs to a - mail envelopes is not separated early in processing from header - information (and kept separate). - - It is recommended that the UA provide its initial ("submission - client") MTA with an envelope separate from the message itself. - However, if the envelope is not supplied, SMTP commands SHOULD be - generated as follows: - - 1. Each recipient address from a TO, CC, or BCC header field SHOULD - be copied to a RCPT command (generating multiple message copies if - that is required for queuing or delivery). This includes any - addresses listed in a RFC 822 "group". Any BCC fields SHOULD then - be removed from the headers. Once this process is completed, the - remaining headers SHOULD be checked to verify that at least one - To:, Cc:, or Bcc: header remains. If none do, then a bcc: header - with no additional information SHOULD be inserted as specified in - [32]. - - 2. The return address in the MAIL command SHOULD, if possible, be - derived from the system's identity for the submitting (local) - user, and the "From:" header field otherwise. If there is a - system identity available, it SHOULD also be copied to the Sender - header field if it is different from the address in the From - header field. (Any Sender field that was already there SHOULD be - removed.) Systems may provide a way for submitters to override - the envelope return address, but may want to restrict its use to - privileged users. This will not prevent mail forgery, but may - lessen its incidence; see section 7.1. - - - -Klensin Standards Track [Page 71] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - When an MTA is being used in this way, it bears responsibility for - ensuring that the message being transmitted is valid. The mechanisms - for checking that validity, and for handling (or returning) messages - that are not valid at the time of arrival, are part of the MUA-MTA - interface and not covered by this specification. - - A submission protocol based on Standard RFC 822 information alone - MUST NOT be used to gateway a message from a foreign (non-SMTP) mail - system into an SMTP environment. Additional information to construct - an envelope must come from some source in the other environment, - whether supplemental headers or the foreign system's envelope. - - Attempts to gateway messages using only their header "to" and "cc" - fields have repeatedly caused mail loops and other behavior adverse - to the proper functioning of the Internet mail environment. These - problems have been especially common when the message originates from - an Internet mailing list and is distributed into the foreign - environment using envelope information. When these messages are then - processed by a header-only remailer, loops back to the Internet - environment (and the mailing list) are almost inevitable. - -C. Source Routes - - Historically, the was a reverse source routing list of - hosts and a source mailbox. The first host in the - SHOULD be the host sending the MAIL command. Similarly, the - may be a source routing lists of hosts and a - destination mailbox. However, in general, the SHOULD - contain only a mailbox and domain name, relying on the domain name - system to supply routing information if required. The use of source - routes is deprecated; while servers MUST be prepared to receive and - handle them as discussed in section 3.3 and F.2, clients SHOULD NOT - transmit them and this section was included only to provide context. - - For relay purposes, the forward-path may be a source route of the - form "@ONE,@TWO:JOE@THREE", where ONE, TWO, and THREE MUST BE fully- - qualified domain names. This form is used to emphasize the - distinction between an address and a route. The mailbox is an - absolute address, and the route is information about how to get - there. The two concepts should not be confused. - - If source routes are used, RFC 821 and the text below should be - consulted for the mechanisms for constructing and updating the - forward- and reverse-paths. - - - - - - - -Klensin Standards Track [Page 72] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - The SMTP server transforms the command arguments by moving its own - identifier (its domain name or that of any domain for which it is - acting as a mail exchanger), if it appears, from the forward-path to - the beginning of the reverse-path. - - Notice that the forward-path and reverse-path appear in the SMTP - commands and replies, but not necessarily in the message. That is, - there is no need for these paths and especially this syntax to appear - in the "To:" , "From:", "CC:", etc. fields of the message header. - Conversely, SMTP servers MUST NOT derive final message delivery - information from message header fields. - - When the list of hosts is present, it is a "reverse" source route and - indicates that the mail was relayed through each host on the list - (the first host in the list was the most recent relay). This list is - used as a source route to return non-delivery notices to the sender. - As each relay host adds itself to the beginning of the list, it MUST - use its name as known in the transport environment to which it is - relaying the mail rather than that of the transport environment from - which the mail came (if they are different). - -D. Scenarios - - This section presents complete scenarios of several types of SMTP - sessions. In the examples, "C:" indicates what is said by the SMTP - client, and "S:" indicates what is said by the SMTP server. - -D.1 A Typical SMTP Transaction Scenario - - This SMTP example shows mail sent by Smith at host bar.com, to Jones, - Green, and Brown at host foo.com. Here we assume that host bar.com - contacts host foo.com directly. The mail is accepted for Jones and - Brown. Green does not have a mailbox at host foo.com. - - S: 220 foo.com Simple Mail Transfer Service Ready - C: EHLO bar.com - S: 250-foo.com greets bar.com - S: 250-8BITMIME - S: 250-SIZE - S: 250-DSN - S: 250 HELP - C: MAIL FROM: - S: 250 OK - C: RCPT TO: - S: 250 OK - C: RCPT TO: - S: 550 No such user here - C: RCPT TO: - - - -Klensin Standards Track [Page 73] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - S: 250 OK - C: DATA - S: 354 Start mail input; end with . - C: Blah blah blah... - C: ...etc. etc. etc. - C: . - S: 250 OK - C: QUIT - S: 221 foo.com Service closing transmission channel - -D.2 Aborted SMTP Transaction Scenario - - S: 220 foo.com Simple Mail Transfer Service Ready - C: EHLO bar.com - S: 250-foo.com greets bar.com - S: 250-8BITMIME - S: 250-SIZE - S: 250-DSN - S: 250 HELP - C: MAIL FROM: - S: 250 OK - C: RCPT TO: - S: 250 OK - C: RCPT TO: - S: 550 No such user here - C: RSET - S: 250 OK - C: QUIT - S: 221 foo.com Service closing transmission channel - -D.3 Relayed Mail Scenario - - Step 1 -- Source Host to Relay Host - - S: 220 foo.com Simple Mail Transfer Service Ready - C: EHLO bar.com - S: 250-foo.com greets bar.com - S: 250-8BITMIME - S: 250-SIZE - S: 250-DSN - S: 250 HELP - C: MAIL FROM: - S: 250 OK - C: RCPT TO:<@foo.com:Jones@XYZ.COM> - S: 250 OK - C: DATA - S: 354 Start mail input; end with . - C: Date: Thu, 21 May 1998 05:33:29 -0700 - - - -Klensin Standards Track [Page 74] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - C: From: John Q. Public - C: Subject: The Next Meeting of the Board - C: To: Jones@xyz.com - C: - C: Bill: - C: The next meeting of the board of directors will be - C: on Tuesday. - C: John. - C: . - S: 250 OK - C: QUIT - S: 221 foo.com Service closing transmission channel - - Step 2 -- Relay Host to Destination Host - - S: 220 xyz.com Simple Mail Transfer Service Ready - C: EHLO foo.com - S: 250 xyz.com is on the air - C: MAIL FROM:<@foo.com:JQP@bar.com> - S: 250 OK - C: RCPT TO: - S: 250 OK - C: DATA - S: 354 Start mail input; end with . - C: Received: from bar.com by foo.com ; Thu, 21 May 1998 - C: 05:33:29 -0700 - C: Date: Thu, 21 May 1998 05:33:22 -0700 - C: From: John Q. Public - C: Subject: The Next Meeting of the Board - C: To: Jones@xyz.com - C: - C: Bill: - C: The next meeting of the board of directors will be - C: on Tuesday. - C: John. - C: . - S: 250 OK - C: QUIT - S: 221 foo.com Service closing transmission channel - -D.4 Verifying and Sending Scenario - - S: 220 foo.com Simple Mail Transfer Service Ready - C: EHLO bar.com - S: 250-foo.com greets bar.com - S: 250-8BITMIME - S: 250-SIZE - S: 250-DSN - - - -Klensin Standards Track [Page 75] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - - S: 250-VRFY - S: 250 HELP - C: VRFY Crispin - S: 250 Mark Crispin - C: SEND FROM: - S: 250 OK - C: RCPT TO: - S: 250 OK - C: DATA - S: 354 Start mail input; end with . - C: Blah blah blah... - C: ...etc. etc. etc. - C: . - S: 250 OK - C: QUIT - S: 221 foo.com Service closing transmission channel - -E. Other Gateway Issues - - In general, gateways between the Internet and other mail systems - SHOULD attempt to preserve any layering semantics across the - boundaries between the two mail systems involved. Gateway- - translation approaches that attempt to take shortcuts by mapping, - (such as envelope information from one system to the message headers - or body of another) have generally proven to be inadequate in - important ways. Systems translating between environments that do not - support both envelopes and headers and Internet mail must be written - with the understanding that some information loss is almost - inevitable. - -F. Deprecated Features of RFC 821 - - A few features of RFC 821 have proven to be problematic and SHOULD - NOT be used in Internet mail. - -F.1 TURN - - This command, described in RFC 821, raises important security issues - since, in the absence of strong authentication of the host requesting - that the client and server switch roles, it can easily be used to - divert mail from its correct destination. Its use is deprecated; - SMTP systems SHOULD NOT use it unless the server can authenticate the - client. - - - - - - - - -Klensin Standards Track [Page 76] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - -F.2 Source Routing - - RFC 821 utilized the concept of explicit source routing to get mail - from one host to another via a series of relays. The requirement to - utilize source routes in regular mail traffic was eliminated by the - introduction of the domain name system "MX" record and the last - significant justification for them was eliminated by the - introduction, in RFC 1123, of a clear requirement that addresses - following an "@" must all be fully-qualified domain names. - Consequently, the only remaining justifications for the use of source - routes are support for very old SMTP clients or MUAs and in mail - system debugging. They can, however, still be useful in the latter - circumstance and for routing mail around serious, but temporary, - problems such as problems with the relevant DNS records. - - SMTP servers MUST continue to accept source route syntax as specified - in the main body of this document and in RFC 1123. They MAY, if - necessary, ignore the routes and utilize only the target domain in - the address. If they do utilize the source route, the message MUST - be sent to the first domain shown in the address. In particular, a - server MUST NOT guess at shortcuts within the source route. - - Clients SHOULD NOT utilize explicit source routing except under - unusual circumstances, such as debugging or potentially relaying - around firewall or mail system configuration errors. - -F.3 HELO - - As discussed in sections 3.1 and 4.1.1, EHLO is strongly preferred to - HELO when the server will accept the former. Servers must continue - to accept and process HELO in order to support older clients. - -F.4 #-literals - - RFC 821 provided for specifying an Internet address as a decimal - integer host number prefixed by a pound sign, "#". In practice, that - form has been obsolete since the introduction of TCP/IP. It is - deprecated and MUST NOT be used. - -F.5 Dates and Years - - When dates are inserted into messages by SMTP clients or servers - (e.g., in trace fields), four-digit years MUST BE used. Two-digit - years are deprecated; three-digit years were never permitted in the - Internet mail system. - - - - - - -Klensin Standards Track [Page 77] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - -F.6 Sending versus Mailing - - In addition to specifying a mechanism for delivering messages to - user's mailboxes, RFC 821 provided additional, optional, commands to - deliver messages directly to the user's terminal screen. These - commands (SEND, SAML, SOML) were rarely implemented, and changes in - workstation technology and the introduction of other protocols may - have rendered them obsolete even where they are implemented. - - Clients SHOULD NOT provide SEND, SAML, or SOML as services. Servers - MAY implement them. If they are implemented by servers, the - implementation model specified in RFC 821 MUST be used and the - command names MUST be published in the response to the EHLO command. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Klensin Standards Track [Page 78] - -RFC 2821 Simple Mail Transfer Protocol April 2001 - - -Full Copyright Statement - - Copyright (C) The Internet Society (2001). All Rights Reserved. - - This document and translations of it may be copied and furnished to - others, and derivative works that comment on or otherwise explain it - or assist in its implementation may be prepared, copied, published - and distributed, in whole or in part, without restriction of any - kind, provided that the above copyright notice and this paragraph are - included on all such copies and derivative works. However, this - document itself may not be modified in any way, such as by removing - the copyright notice or references to the Internet Society or other - Internet organizations, except as needed for the purpose of - developing Internet standards in which case the procedures for - copyrights defined in the Internet Standards process must be - followed, or as required to translate it into languages other than - English. - - The limited permissions granted above are perpetual and will not be - revoked by the Internet Society or its successors or assigns. - - This document and the information contained herein is provided on an - "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING - TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION - HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF - MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - -Acknowledgement - - Funding for the RFC Editor function is currently provided by the - Internet Society. - - - - - - - - - - - - - - - - - - - -Klensin Standards Track [Page 79] - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2822.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2822.txt deleted file mode 100644 index 9f698f7..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc2822.txt +++ /dev/null @@ -1,2859 +0,0 @@ - - - - - - -Network Working Group P. Resnick, Editor -Request for Comments: 2822 QUALCOMM Incorporated -Obsoletes: 822 April 2001 -Category: Standards Track - - - Internet Message Format - -Status of this Memo - - This document specifies an Internet standards track protocol for the - Internet community, and requests discussion and suggestions for - improvements. Please refer to the current edition of the "Internet - Official Protocol Standards" (STD 1) for the standardization state - and status of this protocol. Distribution of this memo is unlimited. - -Copyright Notice - - Copyright (C) The Internet Society (2001). All Rights Reserved. - -Abstract - - This standard specifies a syntax for text messages that are sent - between computer users, within the framework of "electronic mail" - messages. This standard supersedes the one specified in Request For - Comments (RFC) 822, "Standard for the Format of ARPA Internet Text - Messages", updating it to reflect current practice and incorporating - incremental changes that were specified in other RFCs. - -Table of Contents - - 1. Introduction ............................................... 3 - 1.1. Scope .................................................... 3 - 1.2. Notational conventions ................................... 4 - 1.2.1. Requirements notation .................................. 4 - 1.2.2. Syntactic notation ..................................... 4 - 1.3. Structure of this document ............................... 4 - 2. Lexical Analysis of Messages ............................... 5 - 2.1. General Description ...................................... 5 - 2.1.1. Line Length Limits ..................................... 6 - 2.2. Header Fields ............................................ 7 - 2.2.1. Unstructured Header Field Bodies ....................... 7 - 2.2.2. Structured Header Field Bodies ......................... 7 - 2.2.3. Long Header Fields ..................................... 7 - 2.3. Body ..................................................... 8 - 3. Syntax ..................................................... 9 - 3.1. Introduction ............................................. 9 - 3.2. Lexical Tokens ........................................... 9 - - - -Resnick Standards Track [Page 1] - -RFC 2822 Internet Message Format April 2001 - - - 3.2.1. Primitive Tokens ....................................... 9 - 3.2.2. Quoted characters ......................................10 - 3.2.3. Folding white space and comments .......................11 - 3.2.4. Atom ...................................................12 - 3.2.5. Quoted strings .........................................13 - 3.2.6. Miscellaneous tokens ...................................13 - 3.3. Date and Time Specification ..............................14 - 3.4. Address Specification ....................................15 - 3.4.1. Addr-spec specification ................................16 - 3.5 Overall message syntax ....................................17 - 3.6. Field definitions ........................................18 - 3.6.1. The origination date field .............................20 - 3.6.2. Originator fields ......................................21 - 3.6.3. Destination address fields .............................22 - 3.6.4. Identification fields ..................................23 - 3.6.5. Informational fields ...................................26 - 3.6.6. Resent fields ..........................................26 - 3.6.7. Trace fields ...........................................28 - 3.6.8. Optional fields ........................................29 - 4. Obsolete Syntax ............................................29 - 4.1. Miscellaneous obsolete tokens ............................30 - 4.2. Obsolete folding white space .............................31 - 4.3. Obsolete Date and Time ...................................31 - 4.4. Obsolete Addressing ......................................33 - 4.5. Obsolete header fields ...................................33 - 4.5.1. Obsolete origination date field ........................34 - 4.5.2. Obsolete originator fields .............................34 - 4.5.3. Obsolete destination address fields ....................34 - 4.5.4. Obsolete identification fields .........................35 - 4.5.5. Obsolete informational fields ..........................35 - 4.5.6. Obsolete resent fields .................................35 - 4.5.7. Obsolete trace fields ..................................36 - 4.5.8. Obsolete optional fields ...............................36 - 5. Security Considerations ....................................36 - 6. Bibliography ...............................................37 - 7. Editor's Address ...........................................38 - 8. Acknowledgements ...........................................39 - Appendix A. Example messages ..................................41 - A.1. Addressing examples ......................................41 - A.1.1. A message from one person to another with simple - addressing .............................................41 - A.1.2. Different types of mailboxes ...........................42 - A.1.3. Group addresses ........................................43 - A.2. Reply messages ...........................................43 - A.3. Resent messages ..........................................44 - A.4. Messages with trace fields ...............................46 - A.5. White space, comments, and other oddities ................47 - A.6. Obsoleted forms ..........................................47 - - - -Resnick Standards Track [Page 2] - -RFC 2822 Internet Message Format April 2001 - - - A.6.1. Obsolete addressing ....................................48 - A.6.2. Obsolete dates .........................................48 - A.6.3. Obsolete white space and comments ......................48 - Appendix B. Differences from earlier standards ................49 - Appendix C. Notices ...........................................50 - Full Copyright Statement ......................................51 - -1. Introduction - -1.1. Scope - - This standard specifies a syntax for text messages that are sent - between computer users, within the framework of "electronic mail" - messages. This standard supersedes the one specified in Request For - Comments (RFC) 822, "Standard for the Format of ARPA Internet Text - Messages" [RFC822], updating it to reflect current practice and - incorporating incremental changes that were specified in other RFCs - [STD3]. - - This standard specifies a syntax only for text messages. In - particular, it makes no provision for the transmission of images, - audio, or other sorts of structured data in electronic mail messages. - There are several extensions published, such as the MIME document - series [RFC2045, RFC2046, RFC2049], which describe mechanisms for the - transmission of such data through electronic mail, either by - extending the syntax provided here or by structuring such messages to - conform to this syntax. Those mechanisms are outside of the scope of - this standard. - - In the context of electronic mail, messages are viewed as having an - envelope and contents. The envelope contains whatever information is - needed to accomplish transmission and delivery. (See [RFC2821] for a - discussion of the envelope.) The contents comprise the object to be - delivered to the recipient. This standard applies only to the format - and some of the semantics of message contents. It contains no - specification of the information in the envelope. - - However, some message systems may use information from the contents - to create the envelope. It is intended that this standard facilitate - the acquisition of such information by programs. - - This specification is intended as a definition of what message - content format is to be passed between systems. Though some message - systems locally store messages in this format (which eliminates the - need for translation between formats) and others use formats that - differ from the one specified in this standard, local storage is - outside of the scope of this standard. - - - - -Resnick Standards Track [Page 3] - -RFC 2822 Internet Message Format April 2001 - - - Note: This standard is not intended to dictate the internal formats - used by sites, the specific message system features that they are - expected to support, or any of the characteristics of user interface - programs that create or read messages. In addition, this standard - does not specify an encoding of the characters for either transport - or storage; that is, it does not specify the number of bits used or - how those bits are specifically transferred over the wire or stored - on disk. - -1.2. Notational conventions - -1.2.1. Requirements notation - - This document occasionally uses terms that appear in capital letters. - When the terms "MUST", "SHOULD", "RECOMMENDED", "MUST NOT", "SHOULD - NOT", and "MAY" appear capitalized, they are being used to indicate - particular requirements of this specification. A discussion of the - meanings of these terms appears in [RFC2119]. - -1.2.2. Syntactic notation - - This standard uses the Augmented Backus-Naur Form (ABNF) notation - specified in [RFC2234] for the formal definitions of the syntax of - messages. Characters will be specified either by a decimal value - (e.g., the value %d65 for uppercase A and %d97 for lowercase A) or by - a case-insensitive literal value enclosed in quotation marks (e.g., - "A" for either uppercase or lowercase A). See [RFC2234] for the full - description of the notation. - -1.3. Structure of this document - - This document is divided into several sections. - - This section, section 1, is a short introduction to the document. - - Section 2 lays out the general description of a message and its - constituent parts. This is an overview to help the reader understand - some of the general principles used in the later portions of this - document. Any examples in this section MUST NOT be taken as - specification of the formal syntax of any part of a message. - - Section 3 specifies formal ABNF rules for the structure of each part - of a message (the syntax) and describes the relationship between - those parts and their meaning in the context of a message (the - semantics). That is, it describes the actual rules for the structure - of each part of a message (the syntax) as well as a description of - the parts and instructions on how they ought to be interpreted (the - semantics). This includes analysis of the syntax and semantics of - - - -Resnick Standards Track [Page 4] - -RFC 2822 Internet Message Format April 2001 - - - subparts of messages that have specific structure. The syntax - included in section 3 represents messages as they MUST be created. - There are also notes in section 3 to indicate if any of the options - specified in the syntax SHOULD be used over any of the others. - - Both sections 2 and 3 describe messages that are legal to generate - for purposes of this standard. - - Section 4 of this document specifies an "obsolete" syntax. There are - references in section 3 to these obsolete syntactic elements. The - rules of the obsolete syntax are elements that have appeared in - earlier revisions of this standard or have previously been widely - used in Internet messages. As such, these elements MUST be - interpreted by parsers of messages in order to be conformant to this - standard. However, since items in this syntax have been determined - to be non-interoperable or to cause significant problems for - recipients of messages, they MUST NOT be generated by creators of - conformant messages. - - Section 5 details security considerations to take into account when - implementing this standard. - - Section 6 is a bibliography of references in this document. - - Section 7 contains the editor's address. - - Section 8 contains acknowledgements. - - Appendix A lists examples of different sorts of messages. These - examples are not exhaustive of the types of messages that appear on - the Internet, but give a broad overview of certain syntactic forms. - - Appendix B lists the differences between this standard and earlier - standards for Internet messages. - - Appendix C has copyright and intellectual property notices. - -2. Lexical Analysis of Messages - -2.1. General Description - - At the most basic level, a message is a series of characters. A - message that is conformant with this standard is comprised of - characters with values in the range 1 through 127 and interpreted as - US-ASCII characters [ASCII]. For brevity, this document sometimes - refers to this range of characters as simply "US-ASCII characters". - - - - - -Resnick Standards Track [Page 5] - -RFC 2822 Internet Message Format April 2001 - - - Note: This standard specifies that messages are made up of characters - in the US-ASCII range of 1 through 127. There are other documents, - specifically the MIME document series [RFC2045, RFC2046, RFC2047, - RFC2048, RFC2049], that extend this standard to allow for values - outside of that range. Discussion of those mechanisms is not within - the scope of this standard. - - Messages are divided into lines of characters. A line is a series of - characters that is delimited with the two characters carriage-return - and line-feed; that is, the carriage return (CR) character (ASCII - value 13) followed immediately by the line feed (LF) character (ASCII - value 10). (The carriage-return/line-feed pair is usually written in - this document as "CRLF".) - - A message consists of header fields (collectively called "the header - of the message") followed, optionally, by a body. The header is a - sequence of lines of characters with special syntax as defined in - this standard. The body is simply a sequence of characters that - follows the header and is separated from the header by an empty line - (i.e., a line with nothing preceding the CRLF). - -2.1.1. Line Length Limits - - There are two limits that this standard places on the number of - characters in a line. Each line of characters MUST be no more than - 998 characters, and SHOULD be no more than 78 characters, excluding - the CRLF. - - The 998 character limit is due to limitations in many implementations - which send, receive, or store Internet Message Format messages that - simply cannot handle more than 998 characters on a line. Receiving - implementations would do well to handle an arbitrarily large number - of characters in a line for robustness sake. However, there are so - many implementations which (in compliance with the transport - requirements of [RFC2821]) do not accept messages containing more - than 1000 character including the CR and LF per line, it is important - for implementations not to create such messages. - - The more conservative 78 character recommendation is to accommodate - the many implementations of user interfaces that display these - messages which may truncate, or disastrously wrap, the display of - more than 78 characters per line, in spite of the fact that such - implementations are non-conformant to the intent of this - specification (and that of [RFC2821] if they actually cause - information to be lost). Again, even though this limitation is put on - messages, it is encumbant upon implementations which display messages - - - - - -Resnick Standards Track [Page 6] - -RFC 2822 Internet Message Format April 2001 - - - to handle an arbitrarily large number of characters in a line - (certainly at least up to the 998 character limit) for the sake of - robustness. - -2.2. Header Fields - - Header fields are lines composed of a field name, followed by a colon - (":"), followed by a field body, and terminated by CRLF. A field - name MUST be composed of printable US-ASCII characters (i.e., - characters that have values between 33 and 126, inclusive), except - colon. A field body may be composed of any US-ASCII characters, - except for CR and LF. However, a field body may contain CRLF when - used in header "folding" and "unfolding" as described in section - 2.2.3. All field bodies MUST conform to the syntax described in - sections 3 and 4 of this standard. - -2.2.1. Unstructured Header Field Bodies - - Some field bodies in this standard are defined simply as - "unstructured" (which is specified below as any US-ASCII characters, - except for CR and LF) with no further restrictions. These are - referred to as unstructured field bodies. Semantically, unstructured - field bodies are simply to be treated as a single line of characters - with no further processing (except for header "folding" and - "unfolding" as described in section 2.2.3). - -2.2.2. Structured Header Field Bodies - - Some field bodies in this standard have specific syntactical - structure more restrictive than the unstructured field bodies - described above. These are referred to as "structured" field bodies. - Structured field bodies are sequences of specific lexical tokens as - described in sections 3 and 4 of this standard. Many of these tokens - are allowed (according to their syntax) to be introduced or end with - comments (as described in section 3.2.3) as well as the space (SP, - ASCII value 32) and horizontal tab (HTAB, ASCII value 9) characters - (together known as the white space characters, WSP), and those WSP - characters are subject to header "folding" and "unfolding" as - described in section 2.2.3. Semantic analysis of structured field - bodies is given along with their syntax. - -2.2.3. Long Header Fields - - Each header field is logically a single line of characters comprising - the field name, the colon, and the field body. For convenience - however, and to deal with the 998/78 character limitations per line, - the field body portion of a header field can be split into a multiple - line representation; this is called "folding". The general rule is - - - -Resnick Standards Track [Page 7] - -RFC 2822 Internet Message Format April 2001 - - - that wherever this standard allows for folding white space (not - simply WSP characters), a CRLF may be inserted before any WSP. For - example, the header field: - - Subject: This is a test - - can be represented as: - - Subject: This - is a test - - Note: Though structured field bodies are defined in such a way that - folding can take place between many of the lexical tokens (and even - within some of the lexical tokens), folding SHOULD be limited to - placing the CRLF at higher-level syntactic breaks. For instance, if - a field body is defined as comma-separated values, it is recommended - that folding occur after the comma separating the structured items in - preference to other places where the field could be folded, even if - it is allowed elsewhere. - - The process of moving from this folded multiple-line representation - of a header field to its single line representation is called - "unfolding". Unfolding is accomplished by simply removing any CRLF - that is immediately followed by WSP. Each header field should be - treated in its unfolded form for further syntactic and semantic - evaluation. - -2.3. Body - - The body of a message is simply lines of US-ASCII characters. The - only two limitations on the body are as follows: - - - CR and LF MUST only occur together as CRLF; they MUST NOT appear - independently in the body. - - - Lines of characters in the body MUST be limited to 998 characters, - and SHOULD be limited to 78 characters, excluding the CRLF. - - Note: As was stated earlier, there are other standards documents, - specifically the MIME documents [RFC2045, RFC2046, RFC2048, RFC2049] - that extend this standard to allow for different sorts of message - bodies. Again, these mechanisms are beyond the scope of this - document. - - - - - - - - -Resnick Standards Track [Page 8] - -RFC 2822 Internet Message Format April 2001 - - -3. Syntax - -3.1. Introduction - - The syntax as given in this section defines the legal syntax of - Internet messages. Messages that are conformant to this standard - MUST conform to the syntax in this section. If there are options in - this section where one option SHOULD be generated, that is indicated - either in the prose or in a comment next to the syntax. - - For the defined expressions, a short description of the syntax and - use is given, followed by the syntax in ABNF, followed by a semantic - analysis. Primitive tokens that are used but otherwise unspecified - come from [RFC2234]. - - In some of the definitions, there will be nonterminals whose names - start with "obs-". These "obs-" elements refer to tokens defined in - the obsolete syntax in section 4. In all cases, these productions - are to be ignored for the purposes of generating legal Internet - messages and MUST NOT be used as part of such a message. However, - when interpreting messages, these tokens MUST be honored as part of - the legal syntax. In this sense, section 3 defines a grammar for - generation of messages, with "obs-" elements that are to be ignored, - while section 4 adds grammar for interpretation of messages. - -3.2. Lexical Tokens - - The following rules are used to define an underlying lexical - analyzer, which feeds tokens to the higher-level parsers. This - section defines the tokens used in structured header field bodies. - - Note: Readers of this standard need to pay special attention to how - these lexical tokens are used in both the lower-level and - higher-level syntax later in the document. Particularly, the white - space tokens and the comment tokens defined in section 3.2.3 get used - in the lower-level tokens defined here, and those lower-level tokens - are in turn used as parts of the higher-level tokens defined later. - Therefore, the white space and comments may be allowed in the - higher-level tokens even though they may not explicitly appear in a - particular definition. - -3.2.1. Primitive Tokens - - The following are primitive tokens referred to elsewhere in this - standard, but not otherwise defined in [RFC2234]. Some of them will - not appear anywhere else in the syntax, but they are convenient to - refer to in other parts of this document. - - - - -Resnick Standards Track [Page 9] - -RFC 2822 Internet Message Format April 2001 - - - Note: The "specials" below are just such an example. Though the - specials token does not appear anywhere else in this standard, it is - useful for implementers who use tools that lexically analyze - messages. Each of the characters in specials can be used to indicate - a tokenization point in lexical analysis. - -NO-WS-CTL = %d1-8 / ; US-ASCII control characters - %d11 / ; that do not include the - %d12 / ; carriage return, line feed, - %d14-31 / ; and white space characters - %d127 - -text = %d1-9 / ; Characters excluding CR and LF - %d11 / - %d12 / - %d14-127 / - obs-text - -specials = "(" / ")" / ; Special characters used in - "<" / ">" / ; other parts of the syntax - "[" / "]" / - ":" / ";" / - "@" / "\" / - "," / "." / - DQUOTE - - No special semantics are attached to these tokens. They are simply - single characters. - -3.2.2. Quoted characters - - Some characters are reserved for special interpretation, such as - delimiting lexical tokens. To permit use of these characters as - uninterpreted data, a quoting mechanism is provided. - -quoted-pair = ("\" text) / obs-qp - - Where any quoted-pair appears, it is to be interpreted as the text - character alone. That is to say, the "\" character that appears as - part of a quoted-pair is semantically "invisible". - - Note: The "\" character may appear in a message where it is not part - of a quoted-pair. A "\" character that does not appear in a - quoted-pair is not semantically invisible. The only places in this - standard where quoted-pair currently appears are ccontent, qcontent, - dcontent, no-fold-quote, and no-fold-literal. - - - - - -Resnick Standards Track [Page 10] - -RFC 2822 Internet Message Format April 2001 - - -3.2.3. Folding white space and comments - - White space characters, including white space used in folding - (described in section 2.2.3), may appear between many elements in - header field bodies. Also, strings of characters that are treated as - comments may be included in structured field bodies as characters - enclosed in parentheses. The following defines the folding white - space (FWS) and comment constructs. - - Strings of characters enclosed in parentheses are considered comments - so long as they do not appear within a "quoted-string", as defined in - section 3.2.5. Comments may nest. - - There are several places in this standard where comments and FWS may - be freely inserted. To accommodate that syntax, an additional token - for "CFWS" is defined for places where comments and/or FWS can occur. - However, where CFWS occurs in this standard, it MUST NOT be inserted - in such a way that any line of a folded header field is made up - entirely of WSP characters and nothing else. - -FWS = ([*WSP CRLF] 1*WSP) / ; Folding white space - obs-FWS - -ctext = NO-WS-CTL / ; Non white space controls - - %d33-39 / ; The rest of the US-ASCII - %d42-91 / ; characters not including "(", - %d93-126 ; ")", or "\" - -ccontent = ctext / quoted-pair / comment - -comment = "(" *([FWS] ccontent) [FWS] ")" - -CFWS = *([FWS] comment) (([FWS] comment) / FWS) - - Throughout this standard, where FWS (the folding white space token) - appears, it indicates a place where header folding, as discussed in - section 2.2.3, may take place. Wherever header folding appears in a - message (that is, a header field body containing a CRLF followed by - any WSP), header unfolding (removal of the CRLF) is performed before - any further lexical analysis is performed on that header field - according to this standard. That is to say, any CRLF that appears in - FWS is semantically "invisible." - - A comment is normally used in a structured field body to provide some - human readable informational text. Since a comment is allowed to - contain FWS, folding is permitted within the comment. Also note that - since quoted-pair is allowed in a comment, the parentheses and - - - -Resnick Standards Track [Page 11] - -RFC 2822 Internet Message Format April 2001 - - - backslash characters may appear in a comment so long as they appear - as a quoted-pair. Semantically, the enclosing parentheses are not - part of the comment; the comment is what is contained between the two - parentheses. As stated earlier, the "\" in any quoted-pair and the - CRLF in any FWS that appears within the comment are semantically - "invisible" and therefore not part of the comment either. - - Runs of FWS, comment or CFWS that occur between lexical tokens in a - structured field header are semantically interpreted as a single - space character. - -3.2.4. Atom - - Several productions in structured header field bodies are simply - strings of certain basic characters. Such productions are called - atoms. - - Some of the structured header field bodies also allow the period - character (".", ASCII value 46) within runs of atext. An additional - "dot-atom" token is defined for those purposes. - -atext = ALPHA / DIGIT / ; Any character except controls, - "!" / "#" / ; SP, and specials. - "$" / "%" / ; Used for atoms - "&" / "'" / - "*" / "+" / - "-" / "/" / - "=" / "?" / - "^" / "_" / - "`" / "{" / - "|" / "}" / - "~" - -atom = [CFWS] 1*atext [CFWS] - -dot-atom = [CFWS] dot-atom-text [CFWS] - -dot-atom-text = 1*atext *("." 1*atext) - - Both atom and dot-atom are interpreted as a single unit, comprised of - the string of characters that make it up. Semantically, the optional - comments and FWS surrounding the rest of the characters are not part - of the atom; the atom is only the run of atext characters in an atom, - or the atext and "." characters in a dot-atom. - - - - - - - -Resnick Standards Track [Page 12] - -RFC 2822 Internet Message Format April 2001 - - -3.2.5. Quoted strings - - Strings of characters that include characters other than those - allowed in atoms may be represented in a quoted string format, where - the characters are surrounded by quote (DQUOTE, ASCII value 34) - characters. - -qtext = NO-WS-CTL / ; Non white space controls - - %d33 / ; The rest of the US-ASCII - %d35-91 / ; characters not including "\" - %d93-126 ; or the quote character - -qcontent = qtext / quoted-pair - -quoted-string = [CFWS] - DQUOTE *([FWS] qcontent) [FWS] DQUOTE - [CFWS] - - A quoted-string is treated as a unit. That is, quoted-string is - identical to atom, semantically. Since a quoted-string is allowed to - contain FWS, folding is permitted. Also note that since quoted-pair - is allowed in a quoted-string, the quote and backslash characters may - appear in a quoted-string so long as they appear as a quoted-pair. - - Semantically, neither the optional CFWS outside of the quote - characters nor the quote characters themselves are part of the - quoted-string; the quoted-string is what is contained between the two - quote characters. As stated earlier, the "\" in any quoted-pair and - the CRLF in any FWS/CFWS that appears within the quoted-string are - semantically "invisible" and therefore not part of the quoted-string - either. - -3.2.6. Miscellaneous tokens - - Three additional tokens are defined, word and phrase for combinations - of atoms and/or quoted-strings, and unstructured for use in - unstructured header fields and in some places within structured - header fields. - -word = atom / quoted-string - -phrase = 1*word / obs-phrase - - - - - - - - -Resnick Standards Track [Page 13] - -RFC 2822 Internet Message Format April 2001 - - -utext = NO-WS-CTL / ; Non white space controls - %d33-126 / ; The rest of US-ASCII - obs-utext - -unstructured = *([FWS] utext) [FWS] - -3.3. Date and Time Specification - - Date and time occur in several header fields. This section specifies - the syntax for a full date and time specification. Though folding - white space is permitted throughout the date-time specification, it - is RECOMMENDED that a single space be used in each place that FWS - appears (whether it is required or optional); some older - implementations may not interpret other occurrences of folding white - space correctly. - -date-time = [ day-of-week "," ] date FWS time [CFWS] - -day-of-week = ([FWS] day-name) / obs-day-of-week - -day-name = "Mon" / "Tue" / "Wed" / "Thu" / - "Fri" / "Sat" / "Sun" - -date = day month year - -year = 4*DIGIT / obs-year - -month = (FWS month-name FWS) / obs-month - -month-name = "Jan" / "Feb" / "Mar" / "Apr" / - "May" / "Jun" / "Jul" / "Aug" / - "Sep" / "Oct" / "Nov" / "Dec" - -day = ([FWS] 1*2DIGIT) / obs-day - -time = time-of-day FWS zone - -time-of-day = hour ":" minute [ ":" second ] - -hour = 2DIGIT / obs-hour - -minute = 2DIGIT / obs-minute - -second = 2DIGIT / obs-second - -zone = (( "+" / "-" ) 4DIGIT) / obs-zone - - - - - -Resnick Standards Track [Page 14] - -RFC 2822 Internet Message Format April 2001 - - - The day is the numeric day of the month. The year is any numeric - year 1900 or later. - - The time-of-day specifies the number of hours, minutes, and - optionally seconds since midnight of the date indicated. - - The date and time-of-day SHOULD express local time. - - The zone specifies the offset from Coordinated Universal Time (UTC, - formerly referred to as "Greenwich Mean Time") that the date and - time-of-day represent. The "+" or "-" indicates whether the - time-of-day is ahead of (i.e., east of) or behind (i.e., west of) - Universal Time. The first two digits indicate the number of hours - difference from Universal Time, and the last two digits indicate the - number of minutes difference from Universal Time. (Hence, +hhmm - means +(hh * 60 + mm) minutes, and -hhmm means -(hh * 60 + mm) - minutes). The form "+0000" SHOULD be used to indicate a time zone at - Universal Time. Though "-0000" also indicates Universal Time, it is - used to indicate that the time was generated on a system that may be - in a local time zone other than Universal Time and therefore - indicates that the date-time contains no information about the local - time zone. - - A date-time specification MUST be semantically valid. That is, the - day-of-the-week (if included) MUST be the day implied by the date, - the numeric day-of-month MUST be between 1 and the number of days - allowed for the specified month (in the specified year), the - time-of-day MUST be in the range 00:00:00 through 23:59:60 (the - number of seconds allowing for a leap second; see [STD12]), and the - zone MUST be within the range -9959 through +9959. - -3.4. Address Specification - - Addresses occur in several message header fields to indicate senders - and recipients of messages. An address may either be an individual - mailbox, or a group of mailboxes. - -address = mailbox / group - -mailbox = name-addr / addr-spec - -name-addr = [display-name] angle-addr - -angle-addr = [CFWS] "<" addr-spec ">" [CFWS] / obs-angle-addr - -group = display-name ":" [mailbox-list / CFWS] ";" - [CFWS] - - - - -Resnick Standards Track [Page 15] - -RFC 2822 Internet Message Format April 2001 - - -display-name = phrase - -mailbox-list = (mailbox *("," mailbox)) / obs-mbox-list - -address-list = (address *("," address)) / obs-addr-list - - A mailbox receives mail. It is a conceptual entity which does not - necessarily pertain to file storage. For example, some sites may - choose to print mail on a printer and deliver the output to the - addressee's desk. Normally, a mailbox is comprised of two parts: (1) - an optional display name that indicates the name of the recipient - (which could be a person or a system) that could be displayed to the - user of a mail application, and (2) an addr-spec address enclosed in - angle brackets ("<" and ">"). There is also an alternate simple form - of a mailbox where the addr-spec address appears alone, without the - recipient's name or the angle brackets. The Internet addr-spec - address is described in section 3.4.1. - - Note: Some legacy implementations used the simple form where the - addr-spec appears without the angle brackets, but included the name - of the recipient in parentheses as a comment following the addr-spec. - Since the meaning of the information in a comment is unspecified, - implementations SHOULD use the full name-addr form of the mailbox, - instead of the legacy form, to specify the display name associated - with a mailbox. Also, because some legacy implementations interpret - the comment, comments generally SHOULD NOT be used in address fields - to avoid confusing such implementations. - - When it is desirable to treat several mailboxes as a single unit - (i.e., in a distribution list), the group construct can be used. The - group construct allows the sender to indicate a named group of - recipients. This is done by giving a display name for the group, - followed by a colon, followed by a comma separated list of any number - of mailboxes (including zero and one), and ending with a semicolon. - Because the list of mailboxes can be empty, using the group construct - is also a simple way to communicate to recipients that the message - was sent to one or more named sets of recipients, without actually - providing the individual mailbox address for each of those - recipients. - -3.4.1. Addr-spec specification - - An addr-spec is a specific Internet identifier that contains a - locally interpreted string followed by the at-sign character ("@", - ASCII value 64) followed by an Internet domain. The locally - interpreted string is either a quoted-string or a dot-atom. If the - string can be represented as a dot-atom (that is, it contains no - characters other than atext characters or "." surrounded by atext - - - -Resnick Standards Track [Page 16] - -RFC 2822 Internet Message Format April 2001 - - - characters), then the dot-atom form SHOULD be used and the - quoted-string form SHOULD NOT be used. Comments and folding white - space SHOULD NOT be used around the "@" in the addr-spec. - -addr-spec = local-part "@" domain - -local-part = dot-atom / quoted-string / obs-local-part - -domain = dot-atom / domain-literal / obs-domain - -domain-literal = [CFWS] "[" *([FWS] dcontent) [FWS] "]" [CFWS] - -dcontent = dtext / quoted-pair - -dtext = NO-WS-CTL / ; Non white space controls - - %d33-90 / ; The rest of the US-ASCII - %d94-126 ; characters not including "[", - ; "]", or "\" - - The domain portion identifies the point to which the mail is - delivered. In the dot-atom form, this is interpreted as an Internet - domain name (either a host name or a mail exchanger name) as - described in [STD3, STD13, STD14]. In the domain-literal form, the - domain is interpreted as the literal Internet address of the - particular host. In both cases, how addressing is used and how - messages are transported to a particular host is covered in the mail - transport document [RFC2821]. These mechanisms are outside of the - scope of this document. - - The local-part portion is a domain dependent string. In addresses, - it is simply interpreted on the particular host as a name of a - particular mailbox. - -3.5 Overall message syntax - - A message consists of header fields, optionally followed by a message - body. Lines in a message MUST be a maximum of 998 characters - excluding the CRLF, but it is RECOMMENDED that lines be limited to 78 - characters excluding the CRLF. (See section 2.1.1 for explanation.) - In a message body, though all of the characters listed in the text - rule MAY be used, the use of US-ASCII control characters (values 1 - through 8, 11, 12, and 14 through 31) is discouraged since their - interpretation by receivers for display is not guaranteed. - - - - - - - -Resnick Standards Track [Page 17] - -RFC 2822 Internet Message Format April 2001 - - -message = (fields / obs-fields) - [CRLF body] - -body = *(*998text CRLF) *998text - - The header fields carry most of the semantic information and are - defined in section 3.6. The body is simply a series of lines of text - which are uninterpreted for the purposes of this standard. - -3.6. Field definitions - - The header fields of a message are defined here. All header fields - have the same general syntactic structure: A field name, followed by - a colon, followed by the field body. The specific syntax for each - header field is defined in the subsequent sections. - - Note: In the ABNF syntax for each field in subsequent sections, each - field name is followed by the required colon. However, for brevity - sometimes the colon is not referred to in the textual description of - the syntax. It is, nonetheless, required. - - It is important to note that the header fields are not guaranteed to - be in a particular order. They may appear in any order, and they - have been known to be reordered occasionally when transported over - the Internet. However, for the purposes of this standard, header - fields SHOULD NOT be reordered when a message is transported or - transformed. More importantly, the trace header fields and resent - header fields MUST NOT be reordered, and SHOULD be kept in blocks - prepended to the message. See sections 3.6.6 and 3.6.7 for more - information. - - The only required header fields are the origination date field and - the originator address field(s). All other header fields are - syntactically optional. More information is contained in the table - following this definition. - -fields = *(trace - *(resent-date / - resent-from / - resent-sender / - resent-to / - resent-cc / - resent-bcc / - resent-msg-id)) - *(orig-date / - from / - sender / - reply-to / - - - -Resnick Standards Track [Page 18] - -RFC 2822 Internet Message Format April 2001 - - - to / - cc / - bcc / - message-id / - in-reply-to / - references / - subject / - comments / - keywords / - optional-field) - - The following table indicates limits on the number of times each - field may occur in a message header as well as any special - limitations on the use of those fields. An asterisk next to a value - in the minimum or maximum column indicates that a special restriction - appears in the Notes column. - -Field Min number Max number Notes - -trace 0 unlimited Block prepended - see - 3.6.7 - -resent-date 0* unlimited* One per block, required - if other resent fields - present - see 3.6.6 - -resent-from 0 unlimited* One per block - see - 3.6.6 - -resent-sender 0* unlimited* One per block, MUST - occur with multi-address - resent-from - see 3.6.6 - -resent-to 0 unlimited* One per block - see - 3.6.6 - -resent-cc 0 unlimited* One per block - see - 3.6.6 - -resent-bcc 0 unlimited* One per block - see - 3.6.6 - -resent-msg-id 0 unlimited* One per block - see - 3.6.6 - -orig-date 1 1 - -from 1 1 See sender and 3.6.2 - - - -Resnick Standards Track [Page 19] - -RFC 2822 Internet Message Format April 2001 - - -sender 0* 1 MUST occur with multi- - address from - see 3.6.2 - -reply-to 0 1 - -to 0 1 - -cc 0 1 - -bcc 0 1 - -message-id 0* 1 SHOULD be present - see - 3.6.4 - -in-reply-to 0* 1 SHOULD occur in some - replies - see 3.6.4 - -references 0* 1 SHOULD occur in some - replies - see 3.6.4 - -subject 0 1 - -comments 0 unlimited - -keywords 0 unlimited - -optional-field 0 unlimited - - The exact interpretation of each field is described in subsequent - sections. - -3.6.1. The origination date field - - The origination date field consists of the field name "Date" followed - by a date-time specification. - -orig-date = "Date:" date-time CRLF - - The origination date specifies the date and time at which the creator - of the message indicated that the message was complete and ready to - enter the mail delivery system. For instance, this might be the time - that a user pushes the "send" or "submit" button in an application - program. In any case, it is specifically not intended to convey the - time that the message is actually transported, but rather the time at - which the human or other creator of the message has put the message - into its final form, ready for transport. (For example, a portable - computer user who is not connected to a network might queue a message - - - - -Resnick Standards Track [Page 20] - -RFC 2822 Internet Message Format April 2001 - - - for delivery. The origination date is intended to contain the date - and time that the user queued the message, not the time when the user - connected to the network to send the message.) - -3.6.2. Originator fields - - The originator fields of a message consist of the from field, the - sender field (when applicable), and optionally the reply-to field. - The from field consists of the field name "From" and a - comma-separated list of one or more mailbox specifications. If the - from field contains more than one mailbox specification in the - mailbox-list, then the sender field, containing the field name - "Sender" and a single mailbox specification, MUST appear in the - message. In either case, an optional reply-to field MAY also be - included, which contains the field name "Reply-To" and a - comma-separated list of one or more addresses. - -from = "From:" mailbox-list CRLF - -sender = "Sender:" mailbox CRLF - -reply-to = "Reply-To:" address-list CRLF - - The originator fields indicate the mailbox(es) of the source of the - message. The "From:" field specifies the author(s) of the message, - that is, the mailbox(es) of the person(s) or system(s) responsible - for the writing of the message. The "Sender:" field specifies the - mailbox of the agent responsible for the actual transmission of the - message. For example, if a secretary were to send a message for - another person, the mailbox of the secretary would appear in the - "Sender:" field and the mailbox of the actual author would appear in - the "From:" field. If the originator of the message can be indicated - by a single mailbox and the author and transmitter are identical, the - "Sender:" field SHOULD NOT be used. Otherwise, both fields SHOULD - appear. - - The originator fields also provide the information required when - replying to a message. When the "Reply-To:" field is present, it - indicates the mailbox(es) to which the author of the message suggests - that replies be sent. In the absence of the "Reply-To:" field, - replies SHOULD by default be sent to the mailbox(es) specified in the - "From:" field unless otherwise specified by the person composing the - reply. - - In all cases, the "From:" field SHOULD NOT contain any mailbox that - does not belong to the author(s) of the message. See also section - 3.6.3 for more information on forming the destination addresses for a - reply. - - - -Resnick Standards Track [Page 21] - -RFC 2822 Internet Message Format April 2001 - - -3.6.3. Destination address fields - - The destination fields of a message consist of three possible fields, - each of the same form: The field name, which is either "To", "Cc", or - "Bcc", followed by a comma-separated list of one or more addresses - (either mailbox or group syntax). - -to = "To:" address-list CRLF - -cc = "Cc:" address-list CRLF - -bcc = "Bcc:" (address-list / [CFWS]) CRLF - - The destination fields specify the recipients of the message. Each - destination field may have one or more addresses, and each of the - addresses indicate the intended recipients of the message. The only - difference between the three fields is how each is used. - - The "To:" field contains the address(es) of the primary recipient(s) - of the message. - - The "Cc:" field (where the "Cc" means "Carbon Copy" in the sense of - making a copy on a typewriter using carbon paper) contains the - addresses of others who are to receive the message, though the - content of the message may not be directed at them. - - The "Bcc:" field (where the "Bcc" means "Blind Carbon Copy") contains - addresses of recipients of the message whose addresses are not to be - revealed to other recipients of the message. There are three ways in - which the "Bcc:" field is used. In the first case, when a message - containing a "Bcc:" field is prepared to be sent, the "Bcc:" line is - removed even though all of the recipients (including those specified - in the "Bcc:" field) are sent a copy of the message. In the second - case, recipients specified in the "To:" and "Cc:" lines each are sent - a copy of the message with the "Bcc:" line removed as above, but the - recipients on the "Bcc:" line get a separate copy of the message - containing a "Bcc:" line. (When there are multiple recipient - addresses in the "Bcc:" field, some implementations actually send a - separate copy of the message to each recipient with a "Bcc:" - containing only the address of that particular recipient.) Finally, - since a "Bcc:" field may contain no addresses, a "Bcc:" field can be - sent without any addresses indicating to the recipients that blind - copies were sent to someone. Which method to use with "Bcc:" fields - is implementation dependent, but refer to the "Security - Considerations" section of this document for a discussion of each. - - - - - - -Resnick Standards Track [Page 22] - -RFC 2822 Internet Message Format April 2001 - - - When a message is a reply to another message, the mailboxes of the - authors of the original message (the mailboxes in the "From:" field) - or mailboxes specified in the "Reply-To:" field (if it exists) MAY - appear in the "To:" field of the reply since these would normally be - the primary recipients of the reply. If a reply is sent to a message - that has destination fields, it is often desirable to send a copy of - the reply to all of the recipients of the message, in addition to the - author. When such a reply is formed, addresses in the "To:" and - "Cc:" fields of the original message MAY appear in the "Cc:" field of - the reply, since these are normally secondary recipients of the - reply. If a "Bcc:" field is present in the original message, - addresses in that field MAY appear in the "Bcc:" field of the reply, - but SHOULD NOT appear in the "To:" or "Cc:" fields. - - Note: Some mail applications have automatic reply commands that - include the destination addresses of the original message in the - destination addresses of the reply. How those reply commands behave - is implementation dependent and is beyond the scope of this document. - In particular, whether or not to include the original destination - addresses when the original message had a "Reply-To:" field is not - addressed here. - -3.6.4. Identification fields - - Though optional, every message SHOULD have a "Message-ID:" field. - Furthermore, reply messages SHOULD have "In-Reply-To:" and - "References:" fields as appropriate, as described below. - - The "Message-ID:" field contains a single unique message identifier. - The "References:" and "In-Reply-To:" field each contain one or more - unique message identifiers, optionally separated by CFWS. - - The message identifier (msg-id) is similar in syntax to an angle-addr - construct without the internal CFWS. - -message-id = "Message-ID:" msg-id CRLF - -in-reply-to = "In-Reply-To:" 1*msg-id CRLF - -references = "References:" 1*msg-id CRLF - -msg-id = [CFWS] "<" id-left "@" id-right ">" [CFWS] - -id-left = dot-atom-text / no-fold-quote / obs-id-left - -id-right = dot-atom-text / no-fold-literal / obs-id-right - -no-fold-quote = DQUOTE *(qtext / quoted-pair) DQUOTE - - - -Resnick Standards Track [Page 23] - -RFC 2822 Internet Message Format April 2001 - - -no-fold-literal = "[" *(dtext / quoted-pair) "]" - - The "Message-ID:" field provides a unique message identifier that - refers to a particular version of a particular message. The - uniqueness of the message identifier is guaranteed by the host that - generates it (see below). This message identifier is intended to be - machine readable and not necessarily meaningful to humans. A message - identifier pertains to exactly one instantiation of a particular - message; subsequent revisions to the message each receive new message - identifiers. - - Note: There are many instances when messages are "changed", but those - changes do not constitute a new instantiation of that message, and - therefore the message would not get a new message identifier. For - example, when messages are introduced into the transport system, they - are often prepended with additional header fields such as trace - fields (described in section 3.6.7) and resent fields (described in - section 3.6.6). The addition of such header fields does not change - the identity of the message and therefore the original "Message-ID:" - field is retained. In all cases, it is the meaning that the sender - of the message wishes to convey (i.e., whether this is the same - message or a different message) that determines whether or not the - "Message-ID:" field changes, not any particular syntactic difference - that appears (or does not appear) in the message. - - The "In-Reply-To:" and "References:" fields are used when creating a - reply to a message. They hold the message identifier of the original - message and the message identifiers of other messages (for example, - in the case of a reply to a message which was itself a reply). The - "In-Reply-To:" field may be used to identify the message (or - messages) to which the new message is a reply, while the - "References:" field may be used to identify a "thread" of - conversation. - - When creating a reply to a message, the "In-Reply-To:" and - "References:" fields of the resultant message are constructed as - follows: - - The "In-Reply-To:" field will contain the contents of the "Message- - ID:" field of the message to which this one is a reply (the "parent - message"). If there is more than one parent message, then the "In- - Reply-To:" field will contain the contents of all of the parents' - "Message-ID:" fields. If there is no "Message-ID:" field in any of - the parent messages, then the new message will have no "In-Reply-To:" - field. - - - - - - -Resnick Standards Track [Page 24] - -RFC 2822 Internet Message Format April 2001 - - - The "References:" field will contain the contents of the parent's - "References:" field (if any) followed by the contents of the parent's - "Message-ID:" field (if any). If the parent message does not contain - a "References:" field but does have an "In-Reply-To:" field - containing a single message identifier, then the "References:" field - will contain the contents of the parent's "In-Reply-To:" field - followed by the contents of the parent's "Message-ID:" field (if - any). If the parent has none of the "References:", "In-Reply-To:", - or "Message-ID:" fields, then the new message will have no - "References:" field. - - Note: Some implementations parse the "References:" field to display - the "thread of the discussion". These implementations assume that - each new message is a reply to a single parent and hence that they - can walk backwards through the "References:" field to find the parent - of each message listed there. Therefore, trying to form a - "References:" field for a reply that has multiple parents is - discouraged and how to do so is not defined in this document. - - The message identifier (msg-id) itself MUST be a globally unique - identifier for a message. The generator of the message identifier - MUST guarantee that the msg-id is unique. There are several - algorithms that can be used to accomplish this. Since the msg-id has - a similar syntax to angle-addr (identical except that comments and - folding white space are not allowed), a good method is to put the - domain name (or a domain literal IP address) of the host on which the - message identifier was created on the right hand side of the "@", and - put a combination of the current absolute date and time along with - some other currently unique (perhaps sequential) identifier available - on the system (for example, a process id number) on the left hand - side. Using a date on the left hand side and a domain name or domain - literal on the right hand side makes it possible to guarantee - uniqueness since no two hosts use the same domain name or IP address - at the same time. Though other algorithms will work, it is - RECOMMENDED that the right hand side contain some domain identifier - (either of the host itself or otherwise) such that the generator of - the message identifier can guarantee the uniqueness of the left hand - side within the scope of that domain. - - Semantically, the angle bracket characters are not part of the - msg-id; the msg-id is what is contained between the two angle bracket - characters. - - - - - - - - - -Resnick Standards Track [Page 25] - -RFC 2822 Internet Message Format April 2001 - - -3.6.5. Informational fields - - The informational fields are all optional. The "Keywords:" field - contains a comma-separated list of one or more words or - quoted-strings. The "Subject:" and "Comments:" fields are - unstructured fields as defined in section 2.2.1, and therefore may - contain text or folding white space. - -subject = "Subject:" unstructured CRLF - -comments = "Comments:" unstructured CRLF - -keywords = "Keywords:" phrase *("," phrase) CRLF - - These three fields are intended to have only human-readable content - with information about the message. The "Subject:" field is the most - common and contains a short string identifying the topic of the - message. When used in a reply, the field body MAY start with the - string "Re: " (from the Latin "res", in the matter of) followed by - the contents of the "Subject:" field body of the original message. - If this is done, only one instance of the literal string "Re: " ought - to be used since use of other strings or more than one instance can - lead to undesirable consequences. The "Comments:" field contains any - additional comments on the text of the body of the message. The - "Keywords:" field contains a comma-separated list of important words - and phrases that might be useful for the recipient. - -3.6.6. Resent fields - - Resent fields SHOULD be added to any message that is reintroduced by - a user into the transport system. A separate set of resent fields - SHOULD be added each time this is done. All of the resent fields - corresponding to a particular resending of the message SHOULD be - together. Each new set of resent fields is prepended to the message; - that is, the most recent set of resent fields appear earlier in the - message. No other fields in the message are changed when resent - fields are added. - - Each of the resent fields corresponds to a particular field elsewhere - in the syntax. For instance, the "Resent-Date:" field corresponds to - the "Date:" field and the "Resent-To:" field corresponds to the "To:" - field. In each case, the syntax for the field body is identical to - the syntax given previously for the corresponding field. - - When resent fields are used, the "Resent-From:" and "Resent-Date:" - fields MUST be sent. The "Resent-Message-ID:" field SHOULD be sent. - "Resent-Sender:" SHOULD NOT be used if "Resent-Sender:" would be - identical to "Resent-From:". - - - -Resnick Standards Track [Page 26] - -RFC 2822 Internet Message Format April 2001 - - -resent-date = "Resent-Date:" date-time CRLF - -resent-from = "Resent-From:" mailbox-list CRLF - -resent-sender = "Resent-Sender:" mailbox CRLF - -resent-to = "Resent-To:" address-list CRLF - -resent-cc = "Resent-Cc:" address-list CRLF - -resent-bcc = "Resent-Bcc:" (address-list / [CFWS]) CRLF - -resent-msg-id = "Resent-Message-ID:" msg-id CRLF - - Resent fields are used to identify a message as having been - reintroduced into the transport system by a user. The purpose of - using resent fields is to have the message appear to the final - recipient as if it were sent directly by the original sender, with - all of the original fields remaining the same. Each set of resent - fields correspond to a particular resending event. That is, if a - message is resent multiple times, each set of resent fields gives - identifying information for each individual time. Resent fields are - strictly informational. They MUST NOT be used in the normal - processing of replies or other such automatic actions on messages. - - Note: Reintroducing a message into the transport system and using - resent fields is a different operation from "forwarding". - "Forwarding" has two meanings: One sense of forwarding is that a mail - reading program can be told by a user to forward a copy of a message - to another person, making the forwarded message the body of the new - message. A forwarded message in this sense does not appear to have - come from the original sender, but is an entirely new message from - the forwarder of the message. On the other hand, forwarding is also - used to mean when a mail transport program gets a message and - forwards it on to a different destination for final delivery. Resent - header fields are not intended for use with either type of - forwarding. - - The resent originator fields indicate the mailbox of the person(s) or - system(s) that resent the message. As with the regular originator - fields, there are two forms: a simple "Resent-From:" form which - contains the mailbox of the individual doing the resending, and the - more complex form, when one individual (identified in the - "Resent-Sender:" field) resends a message on behalf of one or more - others (identified in the "Resent-From:" field). - - Note: When replying to a resent message, replies behave just as they - would with any other message, using the original "From:", - - - -Resnick Standards Track [Page 27] - -RFC 2822 Internet Message Format April 2001 - - - "Reply-To:", "Message-ID:", and other fields. The resent fields are - only informational and MUST NOT be used in the normal processing of - replies. - - The "Resent-Date:" indicates the date and time at which the resent - message is dispatched by the resender of the message. Like the - "Date:" field, it is not the date and time that the message was - actually transported. - - The "Resent-To:", "Resent-Cc:", and "Resent-Bcc:" fields function - identically to the "To:", "Cc:", and "Bcc:" fields respectively, - except that they indicate the recipients of the resent message, not - the recipients of the original message. - - The "Resent-Message-ID:" field provides a unique identifier for the - resent message. - -3.6.7. Trace fields - - The trace fields are a group of header fields consisting of an - optional "Return-Path:" field, and one or more "Received:" fields. - The "Return-Path:" header field contains a pair of angle brackets - that enclose an optional addr-spec. The "Received:" field contains a - (possibly empty) list of name/value pairs followed by a semicolon and - a date-time specification. The first item of the name/value pair is - defined by item-name, and the second item is either an addr-spec, an - atom, a domain, or a msg-id. Further restrictions may be applied to - the syntax of the trace fields by standards that provide for their - use, such as [RFC2821]. - -trace = [return] - 1*received - -return = "Return-Path:" path CRLF - -path = ([CFWS] "<" ([CFWS] / addr-spec) ">" [CFWS]) / - obs-path - -received = "Received:" name-val-list ";" date-time CRLF - -name-val-list = [CFWS] [name-val-pair *(CFWS name-val-pair)] - -name-val-pair = item-name CFWS item-value - -item-name = ALPHA *(["-"] (ALPHA / DIGIT)) - -item-value = 1*angle-addr / addr-spec / - atom / domain / msg-id - - - -Resnick Standards Track [Page 28] - -RFC 2822 Internet Message Format April 2001 - - - A full discussion of the Internet mail use of trace fields is - contained in [RFC2821]. For the purposes of this standard, the trace - fields are strictly informational, and any formal interpretation of - them is outside of the scope of this document. - -3.6.8. Optional fields - - Fields may appear in messages that are otherwise unspecified in this - standard. They MUST conform to the syntax of an optional-field. - This is a field name, made up of the printable US-ASCII characters - except SP and colon, followed by a colon, followed by any text which - conforms to unstructured. - - The field names of any optional-field MUST NOT be identical to any - field name specified elsewhere in this standard. - -optional-field = field-name ":" unstructured CRLF - -field-name = 1*ftext - -ftext = %d33-57 / ; Any character except - %d59-126 ; controls, SP, and - ; ":". - - For the purposes of this standard, any optional field is - uninterpreted. - -4. Obsolete Syntax - - Earlier versions of this standard allowed for different (usually more - liberal) syntax than is allowed in this version. Also, there have - been syntactic elements used in messages on the Internet whose - interpretation have never been documented. Though some of these - syntactic forms MUST NOT be generated according to the grammar in - section 3, they MUST be accepted and parsed by a conformant receiver. - This section documents many of these syntactic elements. Taking the - grammar in section 3 and adding the definitions presented in this - section will result in the grammar to use for interpretation of - messages. - - Note: This section identifies syntactic forms that any implementation - MUST reasonably interpret. However, there are certainly Internet - messages which do not conform to even the additional syntax given in - this section. The fact that a particular form does not appear in any - section of this document is not justification for computer programs - to crash or for malformed data to be irretrievably lost by any - implementation. To repeat an example, though this document requires - lines in messages to be no longer than 998 characters, silently - - - -Resnick Standards Track [Page 29] - -RFC 2822 Internet Message Format April 2001 - - - discarding the 999th and subsequent characters in a line without - warning would still be bad behavior for an implementation. It is up - to the implementation to deal with messages robustly. - - One important difference between the obsolete (interpreting) and the - current (generating) syntax is that in structured header field bodies - (i.e., between the colon and the CRLF of any structured header - field), white space characters, including folding white space, and - comments can be freely inserted between any syntactic tokens. This - allows many complex forms that have proven difficult for some - implementations to parse. - - Another key difference between the obsolete and the current syntax is - that the rule in section 3.2.3 regarding lines composed entirely of - white space in comments and folding white space does not apply. See - the discussion of folding white space in section 4.2 below. - - Finally, certain characters that were formerly allowed in messages - appear in this section. The NUL character (ASCII value 0) was once - allowed, but is no longer for compatibility reasons. CR and LF were - allowed to appear in messages other than as CRLF; this use is also - shown here. - - Other differences in syntax and semantics are noted in the following - sections. - -4.1. Miscellaneous obsolete tokens - - These syntactic elements are used elsewhere in the obsolete syntax or - in the main syntax. The obs-char and obs-qp elements each add ASCII - value 0. Bare CR and bare LF are added to obs-text and obs-utext. - The period character is added to obs-phrase. The obs-phrase-list - provides for "empty" elements in a comma-separated list of phrases. - - Note: The "period" (or "full stop") character (".") in obs-phrase is - not a form that was allowed in earlier versions of this or any other - standard. Period (nor any other character from specials) was not - allowed in phrase because it introduced a parsing difficulty - distinguishing between phrases and portions of an addr-spec (see - section 4.4). It appears here because the period character is - currently used in many messages in the display-name portion of - addresses, especially for initials in names, and therefore must be - interpreted properly. In the future, period may appear in the - regular syntax of phrase. - -obs-qp = "\" (%d0-127) - -obs-text = *LF *CR *(obs-char *LF *CR) - - - -Resnick Standards Track [Page 30] - -RFC 2822 Internet Message Format April 2001 - - -obs-char = %d0-9 / %d11 / ; %d0-127 except CR and - %d12 / %d14-127 ; LF - -obs-utext = obs-text - -obs-phrase = word *(word / "." / CFWS) - -obs-phrase-list = phrase / 1*([phrase] [CFWS] "," [CFWS]) [phrase] - - Bare CR and bare LF appear in messages with two different meanings. - In many cases, bare CR or bare LF are used improperly instead of CRLF - to indicate line separators. In other cases, bare CR and bare LF are - used simply as ASCII control characters with their traditional ASCII - meanings. - -4.2. Obsolete folding white space - - In the obsolete syntax, any amount of folding white space MAY be - inserted where the obs-FWS rule is allowed. This creates the - possibility of having two consecutive "folds" in a line, and - therefore the possibility that a line which makes up a folded header - field could be composed entirely of white space. - - obs-FWS = 1*WSP *(CRLF 1*WSP) - -4.3. Obsolete Date and Time - - The syntax for the obsolete date format allows a 2 digit year in the - date field and allows for a list of alphabetic time zone - specifications that were used in earlier versions of this standard. - It also permits comments and folding white space between many of the - tokens. - -obs-day-of-week = [CFWS] day-name [CFWS] - -obs-year = [CFWS] 2*DIGIT [CFWS] - -obs-month = CFWS month-name CFWS - -obs-day = [CFWS] 1*2DIGIT [CFWS] - -obs-hour = [CFWS] 2DIGIT [CFWS] - -obs-minute = [CFWS] 2DIGIT [CFWS] - -obs-second = [CFWS] 2DIGIT [CFWS] - -obs-zone = "UT" / "GMT" / ; Universal Time - - - -Resnick Standards Track [Page 31] - -RFC 2822 Internet Message Format April 2001 - - - ; North American UT - ; offsets - "EST" / "EDT" / ; Eastern: - 5/ - 4 - "CST" / "CDT" / ; Central: - 6/ - 5 - "MST" / "MDT" / ; Mountain: - 7/ - 6 - "PST" / "PDT" / ; Pacific: - 8/ - 7 - - %d65-73 / ; Military zones - "A" - %d75-90 / ; through "I" and "K" - %d97-105 / ; through "Z", both - %d107-122 ; upper and lower case - - Where a two or three digit year occurs in a date, the year is to be - interpreted as follows: If a two digit year is encountered whose - value is between 00 and 49, the year is interpreted by adding 2000, - ending up with a value between 2000 and 2049. If a two digit year is - encountered with a value between 50 and 99, or any three digit year - is encountered, the year is interpreted by adding 1900. - - In the obsolete time zone, "UT" and "GMT" are indications of - "Universal Time" and "Greenwich Mean Time" respectively and are both - semantically identical to "+0000". - - The remaining three character zones are the US time zones. The first - letter, "E", "C", "M", or "P" stands for "Eastern", "Central", - "Mountain" and "Pacific". The second letter is either "S" for - "Standard" time, or "D" for "Daylight" (or summer) time. Their - interpretations are as follows: - - EDT is semantically equivalent to -0400 - EST is semantically equivalent to -0500 - CDT is semantically equivalent to -0500 - CST is semantically equivalent to -0600 - MDT is semantically equivalent to -0600 - MST is semantically equivalent to -0700 - PDT is semantically equivalent to -0700 - PST is semantically equivalent to -0800 - - The 1 character military time zones were defined in a non-standard - way in [RFC822] and are therefore unpredictable in their meaning. - The original definitions of the military zones "A" through "I" are - equivalent to "+0100" through "+0900" respectively; "K", "L", and "M" - are equivalent to "+1000", "+1100", and "+1200" respectively; "N" - through "Y" are equivalent to "-0100" through "-1200" respectively; - and "Z" is equivalent to "+0000". However, because of the error in - [RFC822], they SHOULD all be considered equivalent to "-0000" unless - there is out-of-band information confirming their meaning. - - - - -Resnick Standards Track [Page 32] - -RFC 2822 Internet Message Format April 2001 - - - Other multi-character (usually between 3 and 5) alphabetic time zones - have been used in Internet messages. Any such time zone whose - meaning is not known SHOULD be considered equivalent to "-0000" - unless there is out-of-band information confirming their meaning. - -4.4. Obsolete Addressing - - There are three primary differences in addressing. First, mailbox - addresses were allowed to have a route portion before the addr-spec - when enclosed in "<" and ">". The route is simply a comma-separated - list of domain names, each preceded by "@", and the list terminated - by a colon. Second, CFWS were allowed between the period-separated - elements of local-part and domain (i.e., dot-atom was not used). In - addition, local-part is allowed to contain quoted-string in addition - to just atom. Finally, mailbox-list and address-list were allowed to - have "null" members. That is, there could be two or more commas in - such a list with nothing in between them. - -obs-angle-addr = [CFWS] "<" [obs-route] addr-spec ">" [CFWS] - -obs-route = [CFWS] obs-domain-list ":" [CFWS] - -obs-domain-list = "@" domain *(*(CFWS / "," ) [CFWS] "@" domain) - -obs-local-part = word *("." word) - -obs-domain = atom *("." atom) - -obs-mbox-list = 1*([mailbox] [CFWS] "," [CFWS]) [mailbox] - -obs-addr-list = 1*([address] [CFWS] "," [CFWS]) [address] - - When interpreting addresses, the route portion SHOULD be ignored. - -4.5. Obsolete header fields - - Syntactically, the primary difference in the obsolete field syntax is - that it allows multiple occurrences of any of the fields and they may - occur in any order. Also, any amount of white space is allowed - before the ":" at the end of the field name. - -obs-fields = *(obs-return / - obs-received / - obs-orig-date / - obs-from / - obs-sender / - obs-reply-to / - obs-to / - - - -Resnick Standards Track [Page 33] - -RFC 2822 Internet Message Format April 2001 - - - obs-cc / - obs-bcc / - obs-message-id / - obs-in-reply-to / - obs-references / - obs-subject / - obs-comments / - obs-keywords / - obs-resent-date / - obs-resent-from / - obs-resent-send / - obs-resent-rply / - obs-resent-to / - obs-resent-cc / - obs-resent-bcc / - obs-resent-mid / - obs-optional) - - Except for destination address fields (described in section 4.5.3), - the interpretation of multiple occurrences of fields is unspecified. - Also, the interpretation of trace fields and resent fields which do - not occur in blocks prepended to the message is unspecified as well. - Unless otherwise noted in the following sections, interpretation of - other fields is identical to the interpretation of their non-obsolete - counterparts in section 3. - -4.5.1. Obsolete origination date field - -obs-orig-date = "Date" *WSP ":" date-time CRLF - -4.5.2. Obsolete originator fields - -obs-from = "From" *WSP ":" mailbox-list CRLF - -obs-sender = "Sender" *WSP ":" mailbox CRLF - -obs-reply-to = "Reply-To" *WSP ":" mailbox-list CRLF - -4.5.3. Obsolete destination address fields - -obs-to = "To" *WSP ":" address-list CRLF - -obs-cc = "Cc" *WSP ":" address-list CRLF - -obs-bcc = "Bcc" *WSP ":" (address-list / [CFWS]) CRLF - - - - - - -Resnick Standards Track [Page 34] - -RFC 2822 Internet Message Format April 2001 - - - When multiple occurrences of destination address fields occur in a - message, they SHOULD be treated as if the address-list in the first - occurrence of the field is combined with the address lists of the - subsequent occurrences by adding a comma and concatenating. - -4.5.4. Obsolete identification fields - - The obsolete "In-Reply-To:" and "References:" fields differ from the - current syntax in that they allow phrase (words or quoted strings) to - appear. The obsolete forms of the left and right sides of msg-id - allow interspersed CFWS, making them syntactically identical to - local-part and domain respectively. - -obs-message-id = "Message-ID" *WSP ":" msg-id CRLF - -obs-in-reply-to = "In-Reply-To" *WSP ":" *(phrase / msg-id) CRLF - -obs-references = "References" *WSP ":" *(phrase / msg-id) CRLF - -obs-id-left = local-part - -obs-id-right = domain - - For purposes of interpretation, the phrases in the "In-Reply-To:" and - "References:" fields are ignored. - - Semantically, none of the optional CFWS surrounding the local-part - and the domain are part of the obs-id-left and obs-id-right - respectively. - -4.5.5. Obsolete informational fields - -obs-subject = "Subject" *WSP ":" unstructured CRLF - -obs-comments = "Comments" *WSP ":" unstructured CRLF - -obs-keywords = "Keywords" *WSP ":" obs-phrase-list CRLF - -4.5.6. Obsolete resent fields - - The obsolete syntax adds a "Resent-Reply-To:" field, which consists - of the field name, the optional comments and folding white space, the - colon, and a comma separated list of addresses. - -obs-resent-from = "Resent-From" *WSP ":" mailbox-list CRLF - -obs-resent-send = "Resent-Sender" *WSP ":" mailbox CRLF - - - - -Resnick Standards Track [Page 35] - -RFC 2822 Internet Message Format April 2001 - - -obs-resent-date = "Resent-Date" *WSP ":" date-time CRLF - -obs-resent-to = "Resent-To" *WSP ":" address-list CRLF - -obs-resent-cc = "Resent-Cc" *WSP ":" address-list CRLF - -obs-resent-bcc = "Resent-Bcc" *WSP ":" - (address-list / [CFWS]) CRLF - -obs-resent-mid = "Resent-Message-ID" *WSP ":" msg-id CRLF - -obs-resent-rply = "Resent-Reply-To" *WSP ":" address-list CRLF - - As with other resent fields, the "Resent-Reply-To:" field is to be - treated as trace information only. - -4.5.7. Obsolete trace fields - - The obs-return and obs-received are again given here as template - definitions, just as return and received are in section 3. Their - full syntax is given in [RFC2821]. - -obs-return = "Return-Path" *WSP ":" path CRLF - -obs-received = "Received" *WSP ":" name-val-list CRLF - -obs-path = obs-angle-addr - -4.5.8. Obsolete optional fields - -obs-optional = field-name *WSP ":" unstructured CRLF - -5. Security Considerations - - Care needs to be taken when displaying messages on a terminal or - terminal emulator. Powerful terminals may act on escape sequences - and other combinations of ASCII control characters with a variety of - consequences. They can remap the keyboard or permit other - modifications to the terminal which could lead to denial of service - or even damaged data. They can trigger (sometimes programmable) - answerback messages which can allow a message to cause commands to be - issued on the recipient's behalf. They can also effect the operation - of terminal attached devices such as printers. Message viewers may - wish to strip potentially dangerous terminal escape sequences from - the message prior to display. However, other escape sequences appear - in messages for useful purposes (cf. [RFC2045, RFC2046, RFC2047, - RFC2048, RFC2049, ISO2022]) and therefore should not be stripped - indiscriminately. - - - -Resnick Standards Track [Page 36] - -RFC 2822 Internet Message Format April 2001 - - - Transmission of non-text objects in messages raises additional - security issues. These issues are discussed in [RFC2045, RFC2046, - RFC2047, RFC2048, RFC2049]. - - Many implementations use the "Bcc:" (blind carbon copy) field - described in section 3.6.3 to facilitate sending messages to - recipients without revealing the addresses of one or more of the - addressees to the other recipients. Mishandling this use of "Bcc:" - has implications for confidential information that might be revealed, - which could eventually lead to security problems through knowledge of - even the existence of a particular mail address. For example, if - using the first method described in section 3.6.3, where the "Bcc:" - line is removed from the message, blind recipients have no explicit - indication that they have been sent a blind copy, except insofar as - their address does not appear in the message header. Because of - this, one of the blind addressees could potentially send a reply to - all of the shown recipients and accidentally reveal that the message - went to the blind recipient. When the second method from section - 3.6.3 is used, the blind recipient's address appears in the "Bcc:" - field of a separate copy of the message. If the "Bcc:" field sent - contains all of the blind addressees, all of the "Bcc:" recipients - will be seen by each "Bcc:" recipient. Even if a separate message is - sent to each "Bcc:" recipient with only the individual's address, - implementations still need to be careful to process replies to the - message as per section 3.6.3 so as not to accidentally reveal the - blind recipient to other recipients. - -6. Bibliography - - [ASCII] American National Standards Institute (ANSI), Coded - Character Set - 7-Bit American National Standard Code for - Information Interchange, ANSI X3.4, 1986. - - [ISO2022] International Organization for Standardization (ISO), - Information processing - ISO 7-bit and 8-bit coded - character sets - Code extension techniques, Third edition - - 1986-05-01, ISO 2022, 1986. - - [RFC822] Crocker, D., "Standard for the Format of ARPA Internet - Text Messages", RFC 822, August 1982. - - [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail - Extensions (MIME) Part One: Format of Internet Message - Bodies", RFC 2045, November 1996. - - [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail - Extensions (MIME) Part Two: Media Types", RFC 2046, - November 1996. - - - -Resnick Standards Track [Page 37] - -RFC 2822 Internet Message Format April 2001 - - - [RFC2047] Moore, K., "Multipurpose Internet Mail Extensions (MIME) - Part Three: Message Header Extensions for Non-ASCII Text", - RFC 2047, November 1996. - - [RFC2048] Freed, N., Klensin, J. and J. Postel, "Multipurpose - Internet Mail Extensions (MIME) Part Four: Format of - Internet Message Bodies", RFC 2048, November 1996. - - [RFC2049] Freed, N. and N. Borenstein, "Multipurpose Internet Mail - Extensions (MIME) Part Five: Conformance Criteria and - Examples", RFC 2049, November 1996. - - [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate - Requirement Levels", BCP 14, RFC 2119, March 1997. - - [RFC2234] Crocker, D., Editor, and P. Overell, "Augmented BNF for - Syntax Specifications: ABNF", RFC 2234, November 1997. - - [RFC2821] Klensin, J., Editor, "Simple Mail Transfer Protocol", RFC - 2821, March 2001. - - [STD3] Braden, R., "Host Requirements", STD 3, RFC 1122 and RFC - 1123, October 1989. - - [STD12] Mills, D., "Network Time Protocol", STD 12, RFC 1119, - September 1989. - - [STD13] Mockapetris, P., "Domain Name System", STD 13, RFC 1034 - and RFC 1035, November 1987. - - [STD14] Partridge, C., "Mail Routing and the Domain System", STD - 14, RFC 974, January 1986. - -7. Editor's Address - - Peter W. Resnick - QUALCOMM Incorporated - 5775 Morehouse Drive - San Diego, CA 92121-1714 - USA - - Phone: +1 858 651 4478 - Fax: +1 858 651 1102 - EMail: presnick@qualcomm.com - - - - - - - -Resnick Standards Track [Page 38] - -RFC 2822 Internet Message Format April 2001 - - -8. Acknowledgements - - Many people contributed to this document. They included folks who - participated in the Detailed Revision and Update of Messaging - Standards (DRUMS) Working Group of the Internet Engineering Task - Force (IETF), the chair of DRUMS, the Area Directors of the IETF, and - people who simply sent their comments in via e-mail. The editor is - deeply indebted to them all and thanks them sincerely. The below - list includes everyone who sent e-mail concerning this document. - Hopefully, everyone who contributed is named here: - - Matti Aarnio Barry Finkel Larry Masinter - Tanaka Akira Erik Forsberg Denis McKeon - Russ Allbery Chuck Foster William P McQuillan - Eric Allman Paul Fox Alexey Melnikov - Harald Tveit Alvestrand Klaus M. Frank Perry E. Metzger - Ran Atkinson Ned Freed Steven Miller - Jos Backus Jochen Friedrich Keith Moore - Bruce Balden Randall C. Gellens John Gardiner Myers - Dave Barr Sukvinder Singh Gill Chris Newman - Alan Barrett Tim Goodwin John W. Noerenberg - John Beck Philip Guenther Eric Norman - J. Robert von Behren Tony Hansen Mike O'Dell - Jos den Bekker John Hawkinson Larry Osterman - D. J. Bernstein Philip Hazel Paul Overell - James Berriman Kai Henningsen Jacob Palme - Norbert Bollow Robert Herriot Michael A. Patton - Raj Bose Paul Hethmon Uzi Paz - Antony Bowesman Jim Hill Michael A. Quinlan - Scott Bradner Paul E. Hoffman Eric S. Raymond - Randy Bush Steve Hole Sam Roberts - Tom Byrer Kari Hurtta Hugh Sasse - Bruce Campbell Marco S. Hyman Bart Schaefer - Larry Campbell Ofer Inbar Tom Scola - W. J. Carpenter Olle Jarnefors Wolfgang Segmuller - Michael Chapman Kevin Johnson Nick Shelness - Richard Clayton Sudish Joseph John Stanley - Maurizio Codogno Maynard Kang Einar Stefferud - Jim Conklin Prabhat Keni Jeff Stephenson - R. Kelley Cook John C. Klensin Bernard Stern - Steve Coya Graham Klyne Peter Sylvester - Mark Crispin Brad Knowles Mark Symons - Dave Crocker Shuhei Kobayashi Eric Thomas - Matt Curtin Peter Koch Lee Thompson - Michael D'Errico Dan Kohn Karel De Vriendt - Cyrus Daboo Christian Kuhtz Matthew Wall - Jutta Degener Anand Kumria Rolf Weber - Mark Delany Steen Larsen Brent B. Welch - - - -Resnick Standards Track [Page 39] - -RFC 2822 Internet Message Format April 2001 - - - Steve Dorner Eliot Lear Dan Wing - Harold A. Driscoll Barry Leiba Jack De Winter - Michael Elkins Jay Levitt Gregory J. Woodhouse - Robert Elz Lars-Johan Liman Greg A. Woods - Johnny Eriksson Charles Lindsey Kazu Yamamoto - Erik E. Fair Pete Loshin Alain Zahm - Roger Fajman Simon Lyall Jamie Zawinski - Patrik Faltstrom Bill Manning Timothy S. Zurcher - Claus Andre Farber John Martin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Resnick Standards Track [Page 40] - -RFC 2822 Internet Message Format April 2001 - - -Appendix A. Example messages - - This section presents a selection of messages. These are intended to - assist in the implementation of this standard, but should not be - taken as normative; that is to say, although the examples in this - section were carefully reviewed, if there happens to be a conflict - between these examples and the syntax described in sections 3 and 4 - of this document, the syntax in those sections is to be taken as - correct. - - Messages are delimited in this section between lines of "----". The - "----" lines are not part of the message itself. - -A.1. Addressing examples - - The following are examples of messages that might be sent between two - individuals. - -A.1.1. A message from one person to another with simple addressing - - This could be called a canonical message. It has a single author, - John Doe, a single recipient, Mary Smith, a subject, the date, a - message identifier, and a textual message in the body. - ----- -From: John Doe -To: Mary Smith -Subject: Saying Hello -Date: Fri, 21 Nov 1997 09:55:06 -0600 -Message-ID: <1234@local.machine.example> - -This is a message just to say hello. -So, "Hello". ----- - - - - - - - - - - - - - - - - - -Resnick Standards Track [Page 41] - -RFC 2822 Internet Message Format April 2001 - - - If John's secretary Michael actually sent the message, though John - was the author and replies to this message should go back to him, the - sender field would be used: - ----- -From: John Doe -Sender: Michael Jones -To: Mary Smith -Subject: Saying Hello -Date: Fri, 21 Nov 1997 09:55:06 -0600 -Message-ID: <1234@local.machine.example> - -This is a message just to say hello. -So, "Hello". ----- - -A.1.2. Different types of mailboxes - - This message includes multiple addresses in the destination fields - and also uses several different forms of addresses. - ----- -From: "Joe Q. Public" -To: Mary Smith , jdoe@example.org, Who? -Cc: , "Giant; \"Big\" Box" -Date: Tue, 1 Jul 2003 10:52:37 +0200 -Message-ID: <5678.21-Nov-1997@example.com> - -Hi everyone. ----- - - Note that the display names for Joe Q. Public and Giant; "Big" Box - needed to be enclosed in double-quotes because the former contains - the period and the latter contains both semicolon and double-quote - characters (the double-quote characters appearing as quoted-pair - construct). Conversely, the display name for Who? could appear - without them because the question mark is legal in an atom. Notice - also that jdoe@example.org and boss@nil.test have no display names - associated with them at all, and jdoe@example.org uses the simpler - address form without the angle brackets. - - - - - - - - - - - -Resnick Standards Track [Page 42] - -RFC 2822 Internet Message Format April 2001 - - -A.1.3. Group addresses - ----- -From: Pete -To: A Group:Chris Jones ,joe@where.test,John ; -Cc: Undisclosed recipients:; -Date: Thu, 13 Feb 1969 23:32:54 -0330 -Message-ID: - -Testing. ----- - - In this message, the "To:" field has a single group recipient named A - Group which contains 3 addresses, and a "Cc:" field with an empty - group recipient named Undisclosed recipients. - -A.2. Reply messages - - The following is a series of three messages that make up a - conversation thread between John and Mary. John firsts sends a - message to Mary, Mary then replies to John's message, and then John - replies to Mary's reply message. - - Note especially the "Message-ID:", "References:", and "In-Reply-To:" - fields in each message. - ----- -From: John Doe -To: Mary Smith -Subject: Saying Hello -Date: Fri, 21 Nov 1997 09:55:06 -0600 -Message-ID: <1234@local.machine.example> - -This is a message just to say hello. -So, "Hello". ----- - - - - - - - - - - - - - - - -Resnick Standards Track [Page 43] - -RFC 2822 Internet Message Format April 2001 - - - When sending replies, the Subject field is often retained, though - prepended with "Re: " as described in section 3.6.5. - ----- -From: Mary Smith -To: John Doe -Reply-To: "Mary Smith: Personal Account" -Subject: Re: Saying Hello -Date: Fri, 21 Nov 1997 10:01:10 -0600 -Message-ID: <3456@example.net> -In-Reply-To: <1234@local.machine.example> -References: <1234@local.machine.example> - -This is a reply to your hello. ----- - - Note the "Reply-To:" field in the above message. When John replies - to Mary's message above, the reply should go to the address in the - "Reply-To:" field instead of the address in the "From:" field. - ----- -To: "Mary Smith: Personal Account" -From: John Doe -Subject: Re: Saying Hello -Date: Fri, 21 Nov 1997 11:00:00 -0600 -Message-ID: -In-Reply-To: <3456@example.net> -References: <1234@local.machine.example> <3456@example.net> - -This is a reply to your reply. ----- - -A.3. Resent messages - - Start with the message that has been used as an example several - times: - ----- -From: John Doe -To: Mary Smith -Subject: Saying Hello -Date: Fri, 21 Nov 1997 09:55:06 -0600 -Message-ID: <1234@local.machine.example> - -This is a message just to say hello. -So, "Hello". ----- - - - - -Resnick Standards Track [Page 44] - -RFC 2822 Internet Message Format April 2001 - - - Say that Mary, upon receiving this message, wishes to send a copy of - the message to Jane such that (a) the message would appear to have - come straight from John; (b) if Jane replies to the message, the - reply should go back to John; and (c) all of the original - information, like the date the message was originally sent to Mary, - the message identifier, and the original addressee, is preserved. In - this case, resent fields are prepended to the message: - ----- -Resent-From: Mary Smith -Resent-To: Jane Brown -Resent-Date: Mon, 24 Nov 1997 14:22:01 -0800 -Resent-Message-ID: <78910@example.net> -From: John Doe -To: Mary Smith -Subject: Saying Hello -Date: Fri, 21 Nov 1997 09:55:06 -0600 -Message-ID: <1234@local.machine.example> - -This is a message just to say hello. -So, "Hello". ----- - - If Jane, in turn, wished to resend this message to another person, - she would prepend her own set of resent header fields to the above - and send that. - - - - - - - - - - - - - - - - - - - - - - - - - -Resnick Standards Track [Page 45] - -RFC 2822 Internet Message Format April 2001 - - -A.4. Messages with trace fields - - As messages are sent through the transport system as described in - [RFC2821], trace fields are prepended to the message. The following - is an example of what those trace fields might look like. Note that - there is some folding white space in the first one since these lines - can be long. - ----- -Received: from x.y.test - by example.net - via TCP - with ESMTP - id ABC12345 - for ; 21 Nov 1997 10:05:43 -0600 -Received: from machine.example by x.y.test; 21 Nov 1997 10:01:22 -0600 -From: John Doe -To: Mary Smith -Subject: Saying Hello -Date: Fri, 21 Nov 1997 09:55:06 -0600 -Message-ID: <1234@local.machine.example> - -This is a message just to say hello. -So, "Hello". ----- - - - - - - - - - - - - - - - - - - - - - - - - - - -Resnick Standards Track [Page 46] - -RFC 2822 Internet Message Format April 2001 - - -A.5. White space, comments, and other oddities - - White space, including folding white space, and comments can be - inserted between many of the tokens of fields. Taking the example - from A.1.3, white space and comments can be inserted into all of the - fields. - ----- -From: Pete(A wonderful \) chap) -To:A Group(Some people) - :Chris Jones , - joe@example.org, - John (my dear friend); (the end of the group) -Cc:(Empty list)(start)Undisclosed recipients :(nobody(that I know)) ; -Date: Thu, - 13 - Feb - 1969 - 23:32 - -0330 (Newfoundland Time) -Message-ID: - -Testing. ----- - - The above example is aesthetically displeasing, but perfectly legal. - Note particularly (1) the comments in the "From:" field (including - one that has a ")" character appearing as part of a quoted-pair); (2) - the white space absent after the ":" in the "To:" field as well as - the comment and folding white space after the group name, the special - character (".") in the comment in Chris Jones's address, and the - folding white space before and after "joe@example.org,"; (3) the - multiple and nested comments in the "Cc:" field as well as the - comment immediately following the ":" after "Cc"; (4) the folding - white space (but no comments except at the end) and the missing - seconds in the time of the date field; and (5) the white space before - (but not within) the identifier in the "Message-ID:" field. - -A.6. Obsoleted forms - - The following are examples of obsolete (that is, the "MUST NOT - generate") syntactic elements described in section 4 of this - document. - - - - - - - - -Resnick Standards Track [Page 47] - -RFC 2822 Internet Message Format April 2001 - - -A.6.1. Obsolete addressing - - Note in the below example the lack of quotes around Joe Q. Public, - the route that appears in the address for Mary Smith, the two commas - that appear in the "To:" field, and the spaces that appear around the - "." in the jdoe address. - ----- -From: Joe Q. Public -To: Mary Smith <@machine.tld:mary@example.net>, , jdoe@test . example -Date: Tue, 1 Jul 2003 10:52:37 +0200 -Message-ID: <5678.21-Nov-1997@example.com> - -Hi everyone. ----- - -A.6.2. Obsolete dates - - The following message uses an obsolete date format, including a non- - numeric time zone and a two digit year. Note that although the - day-of-week is missing, that is not specific to the obsolete syntax; - it is optional in the current syntax as well. - ----- -From: John Doe -To: Mary Smith -Subject: Saying Hello -Date: 21 Nov 97 09:55:06 GMT -Message-ID: <1234@local.machine.example> - -This is a message just to say hello. -So, "Hello". ----- - -A.6.3. Obsolete white space and comments - - White space and comments can appear between many more elements than - in the current syntax. Also, folding lines that are made up entirely - of white space are legal. - - - - - - - - - - - - -Resnick Standards Track [Page 48] - -RFC 2822 Internet Message Format April 2001 - - ----- -From : John Doe -To : Mary Smith -__ - -Subject : Saying Hello -Date : Fri, 21 Nov 1997 09(comment): 55 : 06 -0600 -Message-ID : <1234 @ local(blah) .machine .example> - -This is a message just to say hello. -So, "Hello". ----- - - Note especially the second line of the "To:" field. It starts with - two space characters. (Note that "__" represent blank spaces.) - Therefore, it is considered part of the folding as described in - section 4.2. Also, the comments and white space throughout - addresses, dates, and message identifiers are all part of the - obsolete syntax. - -Appendix B. Differences from earlier standards - - This appendix contains a list of changes that have been made in the - Internet Message Format from earlier standards, specifically [RFC822] - and [STD3]. Items marked with an asterisk (*) below are items which - appear in section 4 of this document and therefore can no longer be - generated. - - 1. Period allowed in obsolete form of phrase. - 2. ABNF moved out of document to [RFC2234]. - 3. Four or more digits allowed for year. - 4. Header field ordering (and lack thereof) made explicit. - 5. Encrypted header field removed. - 6. Received syntax loosened to allow any token/value pair. - 7. Specifically allow and give meaning to "-0000" time zone. - 8. Folding white space is not allowed between every token. - 9. Requirement for destinations removed. - 10. Forwarding and resending redefined. - 11. Extension header fields no longer specifically called out. - 12. ASCII 0 (null) removed.* - 13. Folding continuation lines cannot contain only white space.* - 14. Free insertion of comments not allowed in date.* - 15. Non-numeric time zones not allowed.* - 16. Two digit years not allowed.* - 17. Three digit years interpreted, but not allowed for generation. - 18. Routes in addresses not allowed.* - 19. CFWS within local-parts and domains not allowed.* - 20. Empty members of address lists not allowed.* - - - -Resnick Standards Track [Page 49] - -RFC 2822 Internet Message Format April 2001 - - - 21. Folding white space between field name and colon not allowed.* - 22. Comments between field name and colon not allowed. - 23. Tightened syntax of in-reply-to and references.* - 24. CFWS within msg-id not allowed.* - 25. Tightened semantics of resent fields as informational only. - 26. Resent-Reply-To not allowed.* - 27. No multiple occurrences of fields (except resent and received).* - 28. Free CR and LF not allowed.* - 29. Routes in return path not allowed.* - 30. Line length limits specified. - 31. Bcc more clearly specified. - -Appendix C. Notices - - Intellectual Property - - The IETF takes no position regarding the validity or scope of any - intellectual property or other rights that might be claimed to - pertain to the implementation or use of the technology described in - this document or the extent to which any license under such rights - might or might not be available; neither does it represent that it - has made any effort to identify any such rights. Information on the - IETF's procedures with respect to rights in standards-track and - standards-related documentation can be found in BCP-11. Copies of - claims of rights made available for publication and any assurances of - licenses to be made available, or the result of an attempt made to - obtain a general license or permission for the use of such - proprietary rights by implementors or users of this specification can - be obtained from the IETF Secretariat. - - - - - - - - - - - - - - - - - - - - - - -Resnick Standards Track [Page 50] - -RFC 2822 Internet Message Format April 2001 - - -Full Copyright Statement - - Copyright (C) The Internet Society (2001). All Rights Reserved. - - This document and translations of it may be copied and furnished to - others, and derivative works that comment on or otherwise explain it - or assist in its implementation may be prepared, copied, published - and distributed, in whole or in part, without restriction of any - kind, provided that the above copyright notice and this paragraph are - included on all such copies and derivative works. However, this - document itself may not be modified in any way, such as by removing - the copyright notice or references to the Internet Society or other - Internet organizations, except as needed for the purpose of - developing Internet standards in which case the procedures for - copyrights defined in the Internet Standards process must be - followed, or as required to translate it into languages other than - English. - - The limited permissions granted above are perpetual and will not be - revoked by the Internet Society or its successors or assigns. - - This document and the information contained herein is provided on an - "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING - TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION - HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF - MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - -Acknowledgement - - Funding for the RFC Editor function is currently provided by the - Internet Society. - - - - - - - - - - - - - - - - - - - -Resnick Standards Track [Page 51] - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc3676.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc3676.txt deleted file mode 100644 index bc08fba..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc3676.txt +++ /dev/null @@ -1,1123 +0,0 @@ - - - - - - -Network Working Group R. Gellens -Request for Comments: 3676 Qualcomm -Obsoletes: 2646 February 2004 -Category: Standards Track - - - The Text/Plain Format and DelSp Parameters - -Status of this Memo - - This document specifies an Internet standards track protocol for the - Internet community, and requests discussion and suggestions for - improvements. Please refer to the current edition of the "Internet - Official Protocol Standards" (STD 1) for the standardization state - and status of this protocol. Distribution of this memo is unlimited. - -Copyright Notice - - Copyright (C) The Internet Society (2004). All Rights Reserved. - -Abstract - - This specification establishes two parameters (Format and DelSP) to - be used with the Text/Plain media type. In the presence of these - parameters, trailing whitespace is used to indicate flowed lines and - a canonical quote indicator is used to indicate quoted lines. This - results in an encoding which appears as normal Text/Plain in older - implementations, since it is in fact normal Text/Plain, yet provides - for superior wrapping/flowing, and quoting. - - This document supersedes the one specified in RFC 2646, "The - Text/Plain Format Parameter", and adds the DelSp parameter to - accommodate languages/coded character sets in which ASCII spaces are - not used or appear rarely. - -Table of Contents - - 1. Introduction. . . . . . . . . . . . . . . . . . . . . . . . . 2 - 2. Conventions Used in this Document . . . . . . . . . . . . . . 2 - 3. The Problem . . . . . . . . . . . . . . . . . . . . . . . . . 3 - 3.1. Paragraph Text. . . . . . . . . . . . . . . . . . . . . 3 - 3.2. Embarrassing Line Wrap . . . . . . . . . . . . . . . . 3 - 3.3. New Media Types . . . . . . . . . . . . . . . . . . . . 4 - 4. The Format and DelSp Parameters . . . . . . . . . . . . . . . 5 - 4.1. Interpreting Format=Flowed. . . . . . . . . . . . . . . 6 - 4.2. Generating Format=Flowed . . . . . . . . . . . . . . . 7 - 4.3. Usenet Signature Convention . . . . . . . . . . . . . . 9 - 4.4. Space-Stuffing . . . . . . . . . . . . . . . . . . . . 9 - - - -Gellens Standards Track [Page 1] - -RFC 3676 Text/Plain Format and DelSp Parameters February 2004 - - - 4.5. Quoting . . . . . . . . . . . . . . . . . . . . . . . . 9 - 4.6. Digital Signatures and Encryption . . . . . . . . . . . 11 - 4.7. Examples. . . . . . . . . . . . . . . . . . . . . . . . 12 - 5. Interoperability. . . . . . . . . . . . . . . . . . . . . . . 12 - 6. ABNF. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 - 7. Failure Modes . . . . . . . . . . . . . . . . . . . . . . . . 14 - 7.1. Trailing White Space Corruption . . . . . . . . . . . . 14 - 8. Security Considerations . . . . . . . . . . . . . . . . . . . 15 - 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15 - 10. Internationalization Considerations . . . . . . . . . . . . . 15 - 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 15 - 12. Normative References. . . . . . . . . . . . . . . . . . . . . 16 - 13. Informative References. . . . . . . . . . . . . . . . . . . . 16 - Appendix A: Changes from RFC 2646 . . . . . . . . . . . . . . . . 18 - Author's Address. . . . . . . . . . . . . . . . . . . . . . . . . 19 - Full Copyright Statement. . . . . . . . . . . . . . . . . . . . . 20 - -1. Introduction - - Interoperability problems have been observed with erroneous labelling - of paragraph text as Text/Plain, and with various forms of - "embarrassing line wrap". (See Section 3.) - - Attempts to deploy new media types, such as Text/Enriched [Rich] and - Text/HTML [HTML] have suffered from a lack of backwards compatibility - and an often hostile user reaction at the receiving end. - - What is required is a format which is in all significant ways - Text/Plain, and therefore is quite suitable for display as - Text/Plain, and yet allows the sender to express to the receiver - which lines are quoted and which lines are considered a logical - paragraph, and thus eligible to be flowed (wrapped and joined) as - appropriate. - -2. Conventions Used in this Document - - The key words "REQUIRED", "MUST", "MUST NOT", "SHOULD", "SHOULD NOT", - and "MAY" in this document are to be interpreted as described in "Key - words for use in RFCs to Indicate Requirement Levels" [KEYWORDS]. - - The term "paragraph" is used here to mean a series of lines which are - logically to be treated as a unit for display purposes and eligible - to be flowed (wrapped and joined) as appropriate to fit in the - display window and when creating text for replies, forwarding, etc. - - - - - - - -Gellens Standards Track [Page 2] - -RFC 3676 Text/Plain Format and DelSp Parameters February 2004 - - -3. The Problem - - The Text/Plain media type is the lowest common denominator of - Internet email, with lines of no more than 998 characters (by - convention usually no more than 78), and where the carriage-return - and line-feed (CRLF) sequence represents a line break (see [MIME-IMT] - and [MSG-FMT]). - - Text/Plain is usually displayed as preformatted text, often in a - fixed font. That is, the characters start at the left margin of the - display window, and advance to the right until a CRLF sequence is - seen, at which point a new line is started, again at the left margin. - When a line length exceeds the display window, some clients will wrap - the line, while others invoke a horizontal scroll bar. - - Text which meets this description is defined by this memo as "fixed". - - Some interoperability problems have been observed with this format: - -3.1. Paragraph Text - - Many modern programs use a proportional-spaced font, and use CRLF to - represent paragraph breaks. Line breaks are "soft", occurring as - needed on display. That is, characters are grouped into a paragraph - until a CRLF sequence is seen, at which point a new paragraph is - started. Each paragraph is displayed, starting at the left margin - (or paragraph indent), and continuing to the right until a word is - encountered which does not fit in the remaining display width. This - word is displayed at the left margin of the next line. This - continues until the paragraph ends (a CRLF is seen). Extra vertical - space is left between paragraphs. - - Text which meets this description is defined by this memo as - "flowed". - - Numerous software products erroneously label this format as - Text/Plain, resulting in much user discomfort. - -3.2. Embarrassing Line Wrap - - As Text/Plain messages are quoted in replies or forwarded messages, - each line gradually increases in length, eventually being arbitrarily - hard wrapped, resulting in "embarrassing line wrap". This produces - text which is, at best, hard to read, and often confuses - attributions. - - - - - - -Gellens Standards Track [Page 3] - -RFC 3676 Text/Plain Format and DelSp Parameters February 2004 - - - Example: - - >>>>>>This is a comment from the first message to show a - >quoting example. - >>>>>This is a comment from the second message to show a - >quoting example. - >>>>This is a comment from the third message. - >>>This is a comment from the fourth message. - - It can be confusing to assign attribution to lines 2 and 4 above. - - In addition, as devices with display widths smaller than 79 or 80 - characters become more popular, embarrassing line wrap has become - even more prevalent, even with unquoted text. - - Example: - - This is paragraph text that is - meant to be flowed across - several lines. - However, the sending mailer is - converting it to fixed text at - a width of 72 - characters, which causes it to - look like this when shown on a - PDA with only - 30 character lines. - -3.3. New Media Types - - Attempts to deploy new media types, such as Text/Enriched [Rich] and - Text/HTML [HTML] have suffered from a lack of backwards compatibility - and an often hostile user reaction at the receiving end. - - In particular, Text/Enriched requires that open angle brackets ("<") - and hard line breaks be doubled, with resulting user unhappiness when - viewed as Text/Plain. Text/HTML requires even more alteration of - text, with a corresponding increase in user complaints. - - A proposal to define a new media type to explicitly represent the - paragraph form suffered from a lack of interoperability with - currently deployed software. Some programs treat unknown subtypes of - TEXT as an attachment. - - - - - - - - -Gellens Standards Track [Page 4] - -RFC 3676 Text/Plain Format and DelSp Parameters February 2004 - - - What is desired is a format which is in all significant ways - Text/Plain, and therefore is quite suitable for display as - Text/Plain, and yet allows the sender to express to the receiver - which lines can be considered a logical paragraph, and thus flowed - (wrapped and joined) as appropriate. - -4. The Format and DelSp Parameters - - This specification defines two MIME parameters for use with - Text/Plain: - - Name: Format - Value: Fixed, Flowed - - Name: DelSp - Value: Yes, No - - (Neither the parameter names nor values are case sensitive.) - - If Format is not specified, or if the value is not recognized, a - value of Fixed is assumed. The semantics of the Fixed value are the - usual associated with Text/Plain [MIME-IMT]. - - A Format value of Flowed indicates that the definition of flowed text - (as specified in this memo) was used on generation, and MAY be used - on reception. - - Note that because Format is a parameter of the Text/Plain content- - type, any content-transfer-encoding used is irrelevant to the - processing of flowed text. - - If DelSp is not specified, or if its value is not recognized, a value - of No is assumed. The use of DelSp without a Format value of Flowed - is undefined. When creating messages, DelSp SHOULD NOT be specified - in Text content types other than Text/Plain with Format = Flowed. - When receiving messages, DelSp SHOULD be ignored if used in a Text - content type other than Text/Plain with Format = Flowed. - - This section discusses flowed text; section 6 provides a formal - definition. - - Section 5 discusses interoperability. - - Note that this memo describes an on-the-wire format. It does not - address formats for local file storage. - - - - - - -Gellens Standards Track [Page 5] - -RFC 3676 Text/Plain Format and DelSp Parameters February 2004 - - -4.1. Interpreting Format=Flowed - - If the first character of a line is a quote mark (">"), the line is - considered to be quoted (see Section 4.5). Logically, all quote - marks are counted and deleted, resulting in a line with a non-zero - quote depth, and content. (The agent is of course free to display - the content with quote marks or excerpt bars or anything else.) - Logically, this test for quoted lines is done before any other tests - (that is, before checking for space-stuffed and flowed). - - If the first character of a line is a space, the line has been - space-stuffed (see Section 4.4). Logically, this leading space is - deleted before examining the line further (that is, before checking - for flowed). - - If the line ends in a space, the line is flowed. Otherwise it is - fixed. The exception to this rule is a signature separator line, - described in Section 4.3. Such lines end in a space but are neither - flowed nor fixed. - - If the line is flowed and DelSp is "yes", the trailing space - immediately prior to the line's CRLF is logically deleted. If the - DelSp parameter is "no" (or not specified, or set to an unrecognized - value), the trailing space is not deleted. - - Any remaining trailing spaces are part of the line's content, but the - CRLF of a soft line break is not. - - A series of one or more flowed lines followed by one fixed line is - considered a paragraph, and MAY be flowed (wrapped and unwrapped) as - appropriate on display and in the construction of new messages (see - Section 4.5). - - An interpreting agent SHOULD allow for three exceptions to the rule - that paragraphs end with a fixed line. These exceptions are - improperly constructed messages: a flowed line SHOULD be considered - to end the paragraph if it is followed by a line of a different quote - depth (see 4.5) or by a signature separator (see 4.3); the end of the - body also ends the paragraph. - - A line consisting of one or more spaces (after deleting a space - acting as stuffing) is considered a flowed line. - - An empty line (just a CRLF) is a fixed line. - - Note that, for Unicode text, [Annex-14] provides guidance for - choosing at which characters to wrap a line. - - - - -Gellens Standards Track [Page 6] - -RFC 3676 Text/Plain Format and DelSp Parameters February 2004 - - -4.2. Generating Format=Flowed - - When generating Format=Flowed text, lines SHOULD be 78 characters or - shorter, including any trailing white space and also including any - space added as part of stuffing (see Section 4.4). As suggested - values, any paragraph longer than 78 characters in total length could - be wrapped using lines of 72 or fewer characters. While the specific - line length used is a matter of aesthetics and preference, longer - lines are more likely to require rewrapping and to encounter - difficulties with older mailers. (It has been suggested that 66 - character lines are the most readable.) - - The restriction to 78 or fewer characters between CRLFs on the wire - is to conform to [MSG-FMT]. - - (In addition to conformance to [MSG-FMT], there is a historical need - that all lines, even when displayed by a non-flowed-aware program, - will fit in a standard 79- or 80-column screen without having to be - wrapped. The limit is 78, not 79 or 80, because while 79 or 80 fit - on a line, the last column is often reserved for a line-wrap - indicator.) - - When creating flowed text, the generating agent wraps, that is, - inserts 'soft' line breaks as needed. Soft line breaks are added at - natural wrapping points, such as between words. A soft line break is - a SP CRLF sequence. - - There are two techniques for inserting soft line breaks. The older - technique, established by RFC 2646, creates a soft line break by - inserting a CRLF after the occurrence of a space. With this - technique, soft line breaks are only possible where spaces already - occur. When this technique is used, the DelSp parameter SHOULD be - used; if used it MUST be set to "no". - - The newer technique, suitable for use even with languages/coded - character sets in which the ASCII space character is rare or not - used, creates a soft line break by inserting a SP CRLF sequence. - When this technique is used, the DelSp parameter MUST be used and - MUST be set to "yes". Note that because of space-stuffing (see - Section 4.4), when this technique is used and a soft line break is - inserted at a point where a SP already exists (such as between - words), if the SP CRLF sequence is added immediately before the SP, - the pre-existing SP becomes leading and thus requires stuffing. It - is RECOMMENDED that agents avoid this by inserting the SP CRLF - sequence following the existing SP. - - Generating agents MAY use either method within each Text/Plain body - part. - - - -Gellens Standards Track [Page 7] - -RFC 3676 Text/Plain Format and DelSp Parameters February 2004 - - - Regardless of which technique is used, a generating agent SHOULD NOT - insert a space in an unnatural location, such as into a word (a - sequence of printable characters, not containing spaces, in a - language/coded character set in which spaces are common). If faced - with such a word which exceeds 78 characters (but less than 998 - characters, the [SMTP] limit on line length), the agent SHOULD send - the word as is and exceed the 78-character limit on line length. - - A generating agent SHOULD: - - o Ensure all lines (fixed and flowed) are 78 characters or fewer in - length, counting any trailing space as well as a space added as - stuffing, but not counting the CRLF, unless a word by itself - exceeds 78 characters. - - o Trim spaces before user-inserted hard line breaks. - - A generating agent MUST: - - o Space-stuff lines which start with a space, "From ", or ">". - - In order to create messages which do not require space-stuffing, and - are thus more aesthetically pleasing when viewed as Format=Fixed, a - generating agent MAY avoid wrapping immediately before ">", "From ", - or space. - - (See Sections 4.4 and 4.5 for more information on space-stuffing and - quoting, respectively.) - - A Format=Flowed message consists of zero or more paragraphs, each - containing one or more flowed lines followed by one fixed line. The - usual case is a series of flowed text lines with blank (empty) fixed - lines between them. - - Any number of fixed lines can appear between paragraphs. - - When placing soft line breaks in a paragraph, generating agents MUST - NOT place them in a way that causes any line of the paragraph to be a - signature separator line, because paragraphs cannot contain signature - separator lines (see Sections 4.3 and 6). - - [Quoted-Printable] encoding SHOULD NOT be used with Format=Flowed - unless absolutely necessary (for example, non-US-ASCII (8-bit) - characters over a strictly 7-bit transport such as unextended - [SMTP]). In particular, a message SHOULD NOT be encoded in Quoted- - Printable for the sole purpose of protecting the trailing space on - flowed lines unless the body part is cryptographically signed or - encrypted (see Section 4.6). - - - -Gellens Standards Track [Page 8] - -RFC 3676 Text/Plain Format and DelSp Parameters February 2004 - - - The intent of Format=Flowed is to allow user agents to generate - flowed text which is non-obnoxious when viewed as pure, raw - Text/Plain (without any decoding); use of Quoted-Printable hinders - this and may cause Format=Flowed to be rejected by end users. - -4.3. Usenet Signature Convention - - There is a long-standing convention in Usenet news which also - commonly appears in Internet mail of using "-- " as the separator - line between the body and the signature of a message. When - generating a Format=Flowed message containing a Usenet-style - separator before the signature, the separator line is sent as-is. - This is a special case; an (optionally quoted or quoted and stuffed) - line consisting of DASH DASH SP is neither fixed nor flowed. - - Generating agents MUST NOT end a paragraph with such a signature - line. - - A receiving agent needs to test for a signature line both before the - test for a quoted line (see Section 4.5) and also after logically - counting and deleting quote marks and stuffing (see Section 4.4) from - a quoted line. - -4.4. Space-Stuffing - - In order to allow for unquoted lines which start with ">", and to - protect against systems which "From-munge" in-transit messages - (modifying any line which starts with "From " to ">From "), - Format=Flowed provides for space-stuffing. - - Space-stuffing adds a single space to the start of any line which - needs protection when the message is generated. On reception, if the - first character of a line is a space, it is logically deleted. This - occurs after the test for a quoted line (which logically counts and - deletes any quote marks), and before the test for a flowed line. - - On generation, any unquoted lines which start with ">", and any lines - which start with a space or "From " MUST be space-stuffed. Other - lines MAY be space-stuffed as desired. - - (Note that space-stuffing is conceptually similar to dot-stuffing as - specified in [SMTP].) - -4.5. Quoting - - In Format=Flowed, the canonical quote indicator (or quote mark) is - one or more close angle bracket (">") characters. Lines which start - with the quote indicator are considered quoted. The number of ">" - - - -Gellens Standards Track [Page 9] - -RFC 3676 Text/Plain Format and DelSp Parameters February 2004 - - - characters at the start of the line specifies the quote depth. - Flowed lines which are also quoted may require special handling on - display and when copied to new messages. - - When creating quoted flowed lines, each such line starts with the - quote indicator. - - Note that because of space-stuffing, the lines - >> Exit, Stage Left - and - >>Exit, Stage Left - are semantically identical; both have a quote-depth of two, and a - content of "Exit, Stage Left". - - However, the line - > > Exit, Stage Left - is different. It has a quote-depth of one, and a content of - "> Exit, Stage Left". - - When generating quoted flowed lines, an agent needs to pay attention - to changes in quote depth. All lines of a paragraph MUST be - unquoted, or else they MUST all be quoted and have the same quote - depth. Therefore, whenever there is a change in quote depth, or a - change from quoted to unquoted, or change from unquoted to quoted, - the line immediately preceding the change MUST NOT be a flowed line. - - If a receiving agent wishes to reformat flowed quoted lines (joining - and/or wrapping them) on display or when generating new messages, the - lines SHOULD be de-quoted, reformatted, and then re-quoted. To de- - quote, the number of close angle brackets in the quote indicator at - the start of each line is counted. To re-quote after reformatting, a - quote indicator containing the same number of close angle brackets - originally present are prefixed to each line. - - On reception, if a change in quote depth occurs on a flowed line, - this is an improperly formatted message. The receiver SHOULD handle - this error by using the 'quote-depth-wins' rule, which is to consider - the paragraph to end with the flowed line immediately preceding the - change in quote depth. - - In other words, whenever two adjacent lines have different quote - depths, senders MUST ensure that the earlier line is not flowed (does - not end in a space), and receivers finding a flowed line there SHOULD - treat it as the last line of a paragraph. - - For example, consider the following sequence of lines (using '*' to - indicate a soft line break, i.e., SP CRLF, and '#' to indicate a hard - line break, i.e., CRLF): - - - -Gellens Standards Track [Page 10] - -RFC 3676 Text/Plain Format and DelSp Parameters February 2004 - - - > Thou villainous ill-breeding spongy dizzy-eyed* - > reeky elf-skinned pigeon-egg!* <--- problem ---< - >> Thou artless swag-bellied milk-livered* - >> dismal-dreaming idle-headed scut!# - >>> Thou errant folly-fallen spleeny reeling-ripe* - >>> unmuzzled ratsbane!# - >>>> Henceforth, the coding style is to be strictly* - >>>> enforced, including the use of only upper case.# - >>>>> I've noticed a lack of adherence to the coding* - >>>>> styles, of late.# - >>>>>> Any complaints?# - - The second line ends in a soft line break, even though it is the last - line of the one-deep quote block. The question then arises as to how - this line is to be interpreted, considering that the next line is the - first line of the two-deep quote block. - - The example text above, when processed according to quote-depth wins, - results in the first two lines being considered as one quoted, flowed - section, with a quote depth of 1; the third and fourth lines become a - quoted, flowed section, with a quote depth of 2. - - A generating agent MUST NOT create this situation; a receiving agent - SHOULD handle it by giving preference to the quote depth. - -4.6. Digital Signatures and Encryption - - If a message is digitally signed or encrypted it is important that - cryptographic processing use the same text for signature verification - and/or decryption as was used for signature generation and/or - encryption. Since the use of format=flowed allows text to be altered - (by adding or removing line breaks and trailing spaces) between - composition and transmission, and between reception and display, - interoperability problems or security vulnerabilities may arise if - originator and recipient do not both use the on-the-wire format for - cryptographic processing. - - The implications of the interaction between format=flowed and any - specific cryptographic process depend on the details of the - cryptographic processing and should be understood before using - format=flowed in conjunction with signed and/or encrypted messages. - - Note that [OpenPGP] specifies (in Section 7.1) that "any trailing - whitespace (spaces, and tabs, 0x09) at the end of any line is ignored - when the cleartext signature is calculated." - - - - - - -Gellens Standards Track [Page 11] - -RFC 3676 Text/Plain Format and DelSp Parameters February 2004 - - - Thus it would be possible to add, in transit, a format=flowed header - to a regular, format=fixed vanilla PGP (not [OpenPGP-MIME]) signed - message and add arbitrary trailing space characters without this - addition being detected. This would change the rendering of the - article by a client which supported format=flowed. - - Therefore, the use of [OpenPGP] with format=flowed messages is - strongly discouraged. [OpenPGP-MIME] is recommended instead. - -4.7. Examples - - The following example contains three paragraphs: - - `Take some more tea,' the March Hare said to Alice, very - earnestly. - - `I've had nothing yet,' Alice replied in an offended tone, `so I - can't take more.' - - `You mean you can't take LESS,' said the Hatter: `it's very easy - to take MORE than nothing.' - - This could be encoded as follows (using '*' to indicate a soft line - break, that is, SP CRLF sequence, and '#' to indicate a hard line - break, that is, CRLF): - - `Take some more tea,' the March Hare said to Alice, very* - earnestly.# - # - `I've had nothing yet,' Alice replied in an offended tone, `so* - I can't take more.'# - # - `You mean you can't take LESS,' said the Hatter: `it's very* - easy to take MORE than nothing.'# - - To show an example of quoting, here we have the same exchange, - presented as a series of direct quotes: - - >>>Take some more tea.# - >>I've had nothing yet, so I can't take more.# - >You mean you can't take LESS, it's very easy to take* - >MORE than nothing.# - -5. Interoperability - - Because flowed lines are all-but-indistinguishable from fixed lines, - software which does not recognize Format=Flowed treats flowed lines - as normal Text/Plain (which is what they are). Thus, Format=Flowed - - - -Gellens Standards Track [Page 12] - -RFC 3676 Text/Plain Format and DelSp Parameters February 2004 - - - interoperates with older clients, although flowed lines will have - trailing white space inserted. - - If a space-stuffed message is received by an agent which handles - Format=Flowed, the space-stuffing is reversed and thus the message - appears unchanged. An agent which is not aware of Format=Flowed will - of course not undo any space-stuffing; thus Format=Flowed messages - may appear with a leading space on some lines (those which start with - a space, ">" which is not a quote indicator, or "From "). Since - lines which require space-stuffing rarely occur, and the aesthetic - consequences of unreversed space-stuffing are minimal, this is not - expected to be a significant problem. - - If some lines begin with one or more spaces, the generating agent MAY - space-stuff all lines, to maintain the relative indentation of the - lines when viewed by clients which are not aware of Format=Flowed. - - Messages generated with DelSp=yes and received by clients which are - aware of Format=Flowed but are not aware of the DelSp parameter will - have an extra space remaining after removal of soft line breaks. - Thus, when generating text in languages/coded character sets in which - spaces are common, the generating agent MAY always use the DelSp=no - method. - - Hand-aligned text, such as ASCII tables or art, source code, etc., - SHOULD be sent as fixed, not flowed lines. - -6. ABNF - - The constructs used in Text/Plain; Format=Flowed body parts are - described using Augmented Backus-Naur Form [ABNF], including the core - rules defined in Appendix A. - - Note that the SP (space) and ">" characters are encoded according to - the charset parameter. - -flowed-body = *( paragraph / fixed-line / sig-sep ) -paragraph = 1*flowed-line fixed-line - ; all lines in paragraph MUST be unquoted or - ; have same quote depth -flowed-line = ( flowed-line-qt / flowed-line-unqt ) flow CRLF -flowed-line-qt = quote ( ( stuffing stuffed-flowed ) / - unstuffed-flowed ) -flowed-line-unqt = ( stuffing stuffed-flowed ) / unstuffed-flowed -stuffed-flowed = *text-char -unstuffed-flowed = non-sp-quote *text-char -fixed-line = fixed-line-qt / fixed-line-unqt -fixed-line-qt = quote ( ( stuffing stuffed-fixed ) / - - - -Gellens Standards Track [Page 13] - -RFC 3676 Text/Plain Format and DelSp Parameters February 2004 - - - unstuffed-fixed ) CRLF -fixed-line-unqt = ( stuffed-fixed / unstuffed-fixed ) CRLF -stuffed-fixed = *text-char non-sp -unstuffed-fixed = non-sp-quote [ *text-char non-sp ] -sig-sep = [ quote [stuffing] ] "--" SP CRLF -quote-mark = ">" -quote = 1*quote-mark -stuffing = SP ; space-stuffed, added on generation if - ; needed, deleted on reception -flow = SP ; space before CRLF indicates flowed line, - ; if DelSp=yes, space was added on generation - ; and is deleted on reception -non-sp-quote = < any character except NUL, CR, LF, SP, quote-mark > -non-sp = non-sp-quote / quote-mark -text-char = non-sp / SP - - That is, a Format=Flowed message body consists of any number of - paragraphs and/or fixed lines and/or signature separator lines; - paragraphs need at least one flowed line and are terminated by a - fixed line; the fixed line terminating the paragraph is part of the - paragraph. (There are some exceptions to this described in the - text.) - - Without at least one flowed line, there is a series of fixed lines, - each independent. There is no paragraph. - - With at least one flowed line, there is a paragraph, and the received - lines can be reformed and flowed to fit the display window size. - This can only be done if the lines are part of a logical grouping, - the paragraph. - - Note that the definitions of flowed-line and sig-sep are potentially - ambiguous: a signature separator line matches both, but is treated as - a signature separator line and not a flowed line. - -7. Failure Modes - -7.1. Trailing White Space Corruption - - There are systems in existence which alter trailing whitespace on - messages which pass through them. Such systems may strip, or in - rarer cases, add trailing whitespace, in violation of RFC 2821 [SMTP] - Section 4.5.2. - - Stripping trailing whitespace has the effect of converting flowed - lines to fixed lines, which results in a message no worse than if - Format=Flowed had not been used. - - - - -Gellens Standards Track [Page 14] - -RFC 3676 Text/Plain Format and DelSp Parameters February 2004 - - - Adding trailing whitespace to a Format=Flowed message may result in a - malformed display or reply. - - Since most systems which add trailing white space do so to create a - line which fills an internal record format, the result is almost - always a line which contains an even number of characters (counting - the added trailing white space). - - One possible avoidance, therefore, would be to define Format=Flowed - lines to use either one or two trailing space characters to indicate - a flowed line, such that the total line length is odd. However, - considering the scarcity of such systems today, it is not worth the - added complexity. - -8. Security Considerations - - Any security considerations which apply to Text/Plain also apply to - Text/Plain with Format=Flowed. - - Section 4.6 discusses the interaction between Format=Flowed and - digital signatures or encryption. - -9. IANA Considerations - - IANA has added a reference to this specification in the Text/Plain - Media Type registration. - -10. Internationalization Considerations - - The line wrap and quoting specifications of Format=Flowed may not be - suitable for certain charsets, such as for Arabic and Hebrew - characters that read from right to left. Care needs to be taken in - applying format=flowed in these cases, as format=fixed combined with - [quoted-printable] encoding may be more suitable. - - The DelSp parameter was added specifically to permit Format=Flowed to - be used with languages/coded character sets in which the ASCII space - character is rarely used, or not used at all. - -11. Acknowledgments - - The DelSp parameter was developed during a series of discussions - among a number of people, including Harald Alvestrand, Grant Baillie, - Ian Bell, Steve Dorner, Patrik Faltstrom, Eric Fischer, Ned Freed, - Alexey Melnikov, John Myers, and Pete Resnick. - - - - - - -Gellens Standards Track [Page 15] - -RFC 3676 Text/Plain Format and DelSp Parameters February 2004 - - - Corrections and clarifications to RFC 2646 and early versions of this - document were pointed out by several people, including Adam Costello, - Jutta Degener, Tony Hansen, Simon Josefsson, Dan Kohn, Ragho - Mahalingam, Keith Moore, Greg Troxel, and Dan Wing. - - I'm told that NeXT's mail application used a very similar mechanism - (without support for non-Western languages) in 1992. - -12. Normative References - - [ABNF] Crocker, D., Ed. and P. Overell, "Augmented BNF - for Syntax Specifications: ABNF", RFC 2234, - November 1997. - - [KEYWORDS] Bradner, S., "Key words for use in RFCs to - Indicate Requirement Levels", BCP 14, RFC 2119, - March 1997. - - [MIME-IMT] Freed, N. and N. Borenstein, "Multipurpose - Internet Mail Extensions (MIME) Part Two: Media - Types", RFC 2046, November 1996. - - [Quoted-Printable] Freed, N. and N. Borenstein, "Multipurpose - Internet Mail Extensions (MIME) Part One: Format - of Internet Message Bodies", RFC 2045, November - 1996. - -13. Informative References - - [Annex-14] Unicode Standard Annex #14, "Line Breaking - Properties" - - - [MSG-FMT] Resnick, P., Ed., "Internet Message Format", RFC - 2822, April 2001. - - [OpenPGP] Callas, J., Donnerhacke, L., Finney, H. and R. - Thayer, "OpenPGP Message Format", RFC 2440, - November 1998. - - [OpenPGP-MIME] Elkins, M., "MIME Security with Pretty Good - Privacy (PGP)", RFC 2015, October 1996. - - Elkins, M., Del Torto, D., Levien, R. and J. - Roessler, "MIME Security with OpenPGP", RFC 3156, - August 2001. - - - - - -Gellens Standards Track [Page 16] - -RFC 3676 Text/Plain Format and DelSp Parameters February 2004 - - - [Rich] Resnick, P. and A. Walker, "The text/enriched MIME - Content-type", RFC 1896, February 1996. - - [SMTP] Klensin, J., Ed., "Simple Mail Transfer Protocol", - RFC 2821, April 2001. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Gellens Standards Track [Page 17] - -RFC 3676 Text/Plain Format and DelSp Parameters February 2004 - - -Appendix A: Changes from RFC 2646 - - Substantive: - - o Added DelSp parameter to handle languages and coded character sets - in which space is less common or not used. - o Updated text on generating and interpreting to accommodate the - DelSp parameter. - o Changed the limits of 79 or 80 to be 78 in conformance with RFC - 2822. - o Added text on generating to clarify that the 78-character limit - includes trailing white space and stuffing. - o Changed sig-sep in ABNF to allow stuffing. - o Changed fixed-line to allow empty lines in ABNF. - o Added explanatory text following ABNF. - o Moved text from Abstract to new Introduction; rewrote Abstract. - o Moved interoperability text to new section, and updated. - o Clarified Security Considerations. - o Text on digital signatures now discusses that OpenPGP ignores - trailing white space. - o Mention Unicode Annex 14. - o Added mention of quoting to Abstract and Introduction. - o Deleted line analysis table. - o Added recommendations for OpenPGP and OpenPGP-MIME. - o Rewrote ABNF rules to remove most ambiguity and note remaining - case. - o Added note that c-t-e is irrelevant to flowed text processing. - o Added text indicating that end of data terminates a paragraph. - o Moved sig-sep out of fixed-line ABNF. - o Changed some SHOULDs to MUSTs (space-stuffing, quoted paragraphs). - o Added note to ABNF that space and ">" are encoded according to - charset. - o Mentioned exceptions in section on interpreting. - o Clarified and made consistent treatment of signature separator - lines. - - Editorial: - - o Added mention of NeXT's mail application to Acknowledgments. - o Updated Acknowledgments. - o Updated [SMTP] reference to 2821. - o Added Notices. - o Split References into Normative and Informative. - o Improved text wording in some areas. - o Standardize on "quote depth", not "quoting depth". - o Moved section on interpreting before section on generating. - o Reworded non-normative "should"s. - o Noted meaning of "paragraph". - - - -Gellens Standards Track [Page 18] - -RFC 3676 Text/Plain Format and DelSp Parameters February 2004 - - - The DelSp parameter was added specifically to permit Format=Flowed to - be used with languages/coded character sets in which the ASCII space - character is rarely used, or not used at all. The DelSp mechanism - was selected despite having been initially rejected as too much of a - kludge, because among the many different techniques proposed, it - allows for maximum interoperability among clients which support - neither this specification nor RFC 2646, those which do support RFC - 2646 but not this specification, and those that do support this - specification; this set is multiplied by those that handle - languages/coded character sets in which spaces are common, and in - which they are uncommon or not used. - -Author's Address - - Randall Gellens - QUALCOMM Incorporated - 5775 Morehouse Drive - San Diego, CA 92121 - USA - - Phone: +1 858 651 5115 - EMail: randy@qualcomm.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Gellens Standards Track [Page 19] - -RFC 3676 Text/Plain Format and DelSp Parameters February 2004 - - -Full Copyright Statement - - Copyright (C) The Internet Society (2004). This document is subject - to the rights, licenses and restrictions contained in BCP 78 and - except as set forth therein, the authors retain all their rights. - - This document and the information contained herein are provided on an - "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE - REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE - INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF - THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED - WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - -Intellectual Property - - The IETF takes no position regarding the validity or scope of any - Intellectual Property Rights or other rights that might be claimed - to pertain to the implementation or use of the technology - described in this document or the extent to which any license - under such rights might or might not be available; nor does it - represent that it has made any independent effort to identify any - such rights. Information on the procedures with respect to - rights in RFC documents can be found in BCP 78 and BCP 79. - - Copies of IPR disclosures made to the IETF Secretariat and any - assurances of licenses to be made available, or the result of an - attempt made to obtain a general license or permission for the use - of such proprietary rights by implementers or users of this - specification can be obtained from the IETF on-line IPR repository - at http://www.ietf.org/ipr. - - The IETF invites any interested party to bring to its attention - any copyrights, patents or patent applications, or other - proprietary rights that may cover technology that may be required - to implement this standard. Please address the information to the - IETF at ietf-ipr@ietf.org. - -Acknowledgement - - Funding for the RFC Editor function is currently provided by the - Internet Society. - - - - - - - - - -Gellens Standards Track [Page 20] - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc4505.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc4505.txt deleted file mode 100644 index 6b8a4a1..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc4505.txt +++ /dev/null @@ -1,507 +0,0 @@ - - - - - - -Network Working Group K. Zeilenga, Ed. -Request for Comments: 4505 OpenLDAP Foundation -Obsoletes: 2245 June 2006 -Category: Standards Track - - - Anonymous Simple Authentication and Security Layer (SASL) Mechanism - -Status of This Memo - - This document specifies an Internet standards track protocol for the - Internet community, and requests discussion and suggestions for - improvements. Please refer to the current edition of the "Internet - Official Protocol Standards" (STD 1) for the standardization state - and status of this protocol. Distribution of this memo is unlimited. - -Copyright Notice - - Copyright (C) The Internet Society (2006). - -Abstract - - On the Internet, it is common practice to permit anonymous access to - various services. Traditionally, this has been done with a plain- - text password mechanism using "anonymous" as the user name and using - optional trace information, such as an email address, as the - password. As plain-text login commands are not permitted in new IETF - protocols, a new way to provide anonymous login is needed within the - context of the Simple Authentication and Security Layer (SASL) - framework. - -1. Introduction - - This document defines an anonymous mechanism for the Simple - Authentication and Security Layer ([SASL]) framework. The name - associated with this mechanism is "ANONYMOUS". - - Unlike many other SASL mechanisms, whose purpose is to authenticate - and identify the user to a server, the purpose of this SASL mechanism - is to allow the user to gain access to services or resources without - requiring the user to establish or otherwise disclose their identity - to the server. That is, this mechanism provides an anonymous login - method. - - This mechanism does not provide a security layer. - - This document replaces RFC 2245. Changes since RFC 2245 are detailed - in Appendix A. - - - -Zeilenga Standards Track [Page 1] - -RFC 4505 Anonymous SASL Mechanism June 2006 - - -2. The Anonymous Mechanism - - The mechanism consists of a single message from the client to the - server. The client may include in this message trace information in - the form of a string of [UTF-8]-encoded [Unicode] characters prepared - in accordance with [StringPrep] and the "trace" stringprep profile - defined in Section 3 of this document. The trace information, which - has no semantical value, should take one of two forms: an Internet - email address, or an opaque string that does not contain the '@' - (U+0040) character and that can be interpreted by the system - administrator of the client's domain. For privacy reasons, an - Internet email address or other information identifying the user - should only be used with permission from the user. - - A server that permits anonymous access will announce support for the - ANONYMOUS mechanism and allow anyone to log in using that mechanism, - usually with restricted access. - - A formal grammar for the client message using Augmented BNF [ABNF] is - provided below as a tool for understanding this technical - specification. - - message = [ email / token ] - ;; to be prepared in accordance with Section 3 - - UTF1 = %x00-3F / %x41-7F ;; less '@' (U+0040) - UTF2 = %xC2-DF UTF0 - UTF3 = %xE0 %xA0-BF UTF0 / %xE1-EC 2(UTF0) / - %xED %x80-9F UTF0 / %xEE-EF 2(UTF0) - UTF4 = %xF0 %x90-BF 2(UTF0) / %xF1-F3 3(UTF0) / - %xF4 %x80-8F 2(UTF0) - UTF0 = %x80-BF - - TCHAR = UTF1 / UTF2 / UTF3 / UTF4 - ;; any UTF-8 encoded Unicode character - ;; except '@' (U+0040) - - email = addr-spec - ;; as defined in [IMAIL] - - token = 1*255TCHAR - - Note to implementors: - The production is restricted to 255 UTF-8-encoded Unicode - characters. As the encoding of a characters uses a sequence of 1 - to 4 octets, a token may be as long as 1020 octets. - - - - - -Zeilenga Standards Track [Page 2] - -RFC 4505 Anonymous SASL Mechanism June 2006 - - -3. The "trace" Profile of "Stringprep" - - This section defines the "trace" profile of [StringPrep]. This - profile is designed for use with the SASL ANONYMOUS Mechanism. - Specifically, the client is to prepare the production in - accordance with this profile. - - The character repertoire of this profile is Unicode 3.2 [Unicode]. - - No mapping is required by this profile. - - No Unicode normalization is required by this profile. - - The list of unassigned code points for this profile is that provided - in Appendix A of [StringPrep]. Unassigned code points are not - prohibited. - - Characters from the following tables of [StringPrep] are prohibited: - - - C.2.1 (ASCII control characters) - - C.2.2 (Non-ASCII control characters) - - C.3 (Private use characters) - - C.4 (Non-character code points) - - C.5 (Surrogate codes) - - C.6 (Inappropriate for plain text) - - C.8 (Change display properties are deprecated) - - C.9 (Tagging characters) - - No additional characters are prohibited. - - This profile requires bidirectional character checking per Section 6 - of [StringPrep]. - -4. Example - - Here is a sample ANONYMOUS login between an IMAP client and server. - In this example, "C:" and "S:" indicate lines sent by the client and - server, respectively. If such lines are wrapped without a new "C:" - or "S:" label, then the wrapping is for editorial clarity and is not - part of the command. - - Note that this example uses the IMAP profile [IMAP4] of SASL. The - base64 encoding of challenges and responses as well as the "+ " - preceding the responses are part of the IMAP4 profile, not part of - SASL itself. Additionally, protocols with SASL profiles permitting - an initial client response will be able to avoid the extra round trip - below (the server response with an empty "+ "). - - - - -Zeilenga Standards Track [Page 3] - -RFC 4505 Anonymous SASL Mechanism June 2006 - - - In this example, the trace information is "sirhc". - - S: * OK IMAP4 server ready - C: A001 CAPABILITY - S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=DIGEST-MD5 AUTH=ANONYMOUS - S: A001 OK done - C: A002 AUTHENTICATE ANONYMOUS - S: + - C: c2lyaGM= - S: A003 OK Welcome, trace information has been logged. - -5. Security Considerations - - The ANONYMOUS mechanism grants access to services and/or resources by - anyone. For this reason, it should be disabled by default so that - the administrator can make an explicit decision to enable it. - - If the anonymous user has any write privileges, a denial-of-service - attack is possible by filling up all available space. This can be - prevented by disabling all write access by anonymous users. - - If anonymous users have read and write access to the same area, the - server can be used as a communication mechanism to exchange - information anonymously. Servers that accept anonymous submissions - should implement the common "drop box" model, which forbids anonymous - read access to the area where anonymous submissions are accepted. - - If the anonymous user can run many expensive operations (e.g., an - IMAP SEARCH BODY command), this could enable a denial-of-service - attack. Servers are encouraged to reduce the priority of anonymous - users or limit their resource usage. - - While servers may impose a limit on the number of anonymous users, - note that such limits enable denial-of-service attacks and should be - used with caution. - - The trace information is not authenticated, so it can be falsified. - This can be used as an attempt to get someone else in trouble for - access to questionable information. Administrators investigating - abuse need to realize that this trace information may be falsified. - - A client that uses the user's correct email address as trace - information without explicit permission may violate that user's - privacy. Anyone who accesses an anonymous archive on a sensitive - subject (e.g., sexual abuse) likely has strong privacy needs. - Clients should not send the email address without the explicit - permission of the user and should offer the option of supplying no - trace information, thus only exposing the source IP address and time. - - - -Zeilenga Standards Track [Page 4] - -RFC 4505 Anonymous SASL Mechanism June 2006 - - - Anonymous proxy servers could enhance this privacy but would have to - consider the resulting potential denial-of-service attacks. - - Anonymous connections are susceptible to man-in-the-middle attacks - that view or alter the data transferred. Clients and servers are - encouraged to support external data security services. - - Protocols that fail to require an explicit anonymous login are more - susceptible to break-ins given certain common implementation - techniques. Specifically, Unix servers that offer user login may - initially start up as root and switch to the appropriate user id - after an explicit login command. Normally, such servers refuse all - data access commands prior to explicit login and may enter a - restricted security environment (e.g., the Unix chroot(2) function) - for anonymous users. If anonymous access is not explicitly - requested, the entire data access machinery is exposed to external - security attacks without the chance for explicit protective measures. - Protocols that offer restricted data access should not allow - anonymous data access without an explicit login step. - - General [SASL] security considerations apply to this mechanism. - - [StringPrep] security considerations and [Unicode] security - considerations discussed in [StringPrep] apply to this mechanism. - [UTF-8] security considerations also apply. - -6. IANA Considerations - - The SASL Mechanism registry [IANA-SASL] entry for the ANONYMOUS - mechanism has been updated by the IANA to reflect that this document - now provides its technical specification. - - To: iana@iana.org - Subject: Updated Registration of SASL mechanism ANONYMOUS - - SASL mechanism name: ANONYMOUS - Security considerations: See RFC 4505. - Published specification (optional, recommended): RFC 4505 - Person & email address to contact for further information: - Kurt Zeilenga - Chris Newman - Intended usage: COMMON - Author/Change controller: IESG - Note: Updates existing entry for ANONYMOUS - - - - - - - -Zeilenga Standards Track [Page 5] - -RFC 4505 Anonymous SASL Mechanism June 2006 - - - The [StringPrep] profile "trace", first defined in this RFC, has been - registered: - - To: iana@iana.org - Subject: Initial Registration of Stringprep "trace" profile - - Stringprep profile: trace - Published specification: RFC 4505 - Person & email address to contact for further information: - Kurt Zeilenga - -7. Acknowledgement - - This document is a revision of RFC 2245 by Chris Newman. Portions of - the grammar defined in Section 1 were borrowed from RFC 3629 by - Francois Yergeau. - - This document is a product of the IETF SASL WG. - -8. Normative References - - [ABNF] Crocker, D. and P. Overell, "Augmented BNF for Syntax - Specifications: ABNF", RFC 4234, October 2005. - - [IMAIL] Resnick, P., "Internet Message Format", RFC 2822, April - 2001. - - [SASL] Melnikov, A., Ed. and K. Zeilenga, Ed., "Simple - Authentication and Security Layer (SASL)", RFC 4422, - June 2006. - - [StringPrep] Hoffman, P. and M. Blanchet, "Preparation of - Internationalized Strings ('stringprep')", RFC 3454, - December 2002. - - [Unicode] The Unicode Consortium, "The Unicode Standard, Version - 3.2.0" is defined by "The Unicode Standard, Version 3.0" - (Reading, MA, Addison-Wesley, 2000. ISBN 0-201-61633-5), - as amended by the "Unicode Standard Annex #27: Unicode - 3.1" (http://www.unicode.org/reports/tr27/) and by the - "Unicode Standard Annex #28: Unicode 3.2" - (http://www.unicode.org/reports/tr28/). - - [UTF-8] Yergeau, F., "UTF-8, a transformation format of ISO - 10646", RFC 3629 (also STD 63), November 2003. - - - - - - -Zeilenga Standards Track [Page 6] - -RFC 4505 Anonymous SASL Mechanism June 2006 - - -9. Informative References - - [IMAP4] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION - 4rev1", RFC 3501, March 2003. - - [IANA-SASL] IANA, "SIMPLE AUTHENTICATION AND SECURITY LAYER (SASL) - MECHANISMS", . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Zeilenga Standards Track [Page 7] - -RFC 4505 Anonymous SASL Mechanism June 2006 - - -Appendix A. Changes since RFC 2245 - - This appendix is non-normative. - - RFC 2245 allows the client to include optional trace information in - the form of a human readable string. RFC 2245 restricted this string - to US-ASCII. As the Internet is international, this document uses a - string restricted to UTF-8 encoded Unicode characters. A - "stringprep" profile is defined to precisely define which Unicode - characters are allowed in this string. While the string remains - restricted to 255 characters, the encoded length of each character - may now range from 1 to 4 octets. - - Additionally, a number of editorial changes were made. - -Editor's Address - - Kurt D. Zeilenga - OpenLDAP Foundation - - EMail: Kurt@OpenLDAP.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Zeilenga Standards Track [Page 8] - -RFC 4505 Anonymous SASL Mechanism June 2006 - - -Full Copyright Statement - - Copyright (C) The Internet Society (2006). - - This document is subject to the rights, licenses and restrictions - contained in BCP 78, and except as set forth therein, the authors - retain all their rights. - - This document and the information contained herein are provided on an - "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS - OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET - ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, - INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE - INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED - WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - -Intellectual Property - - The IETF takes no position regarding the validity or scope of any - Intellectual Property Rights or other rights that might be claimed to - pertain to the implementation or use of the technology described in - this document or the extent to which any license under such rights - might or might not be available; nor does it represent that it has - made any independent effort to identify any such rights. Information - on the procedures with respect to rights in RFC documents can be - found in BCP 78 and BCP 79. - - Copies of IPR disclosures made to the IETF Secretariat and any - assurances of licenses to be made available, or the result of an - attempt made to obtain a general license or permission for the use of - such proprietary rights by implementers or users of this - specification can be obtained from the IETF on-line IPR repository at - http://www.ietf.org/ipr. - - The IETF invites any interested party to bring to its attention any - copyrights, patents or patent applications, or other proprietary - rights that may cover technology that may be required to implement - this standard. Please address the information to the IETF at - ietf-ipr@ietf.org. - -Acknowledgement - - Funding for the RFC Editor function is provided by the IETF - Administrative Support Activity (IASA). - - - - - - - -Zeilenga Standards Track [Page 9] - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc4616.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc4616.txt deleted file mode 100644 index 991189d..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc4616.txt +++ /dev/null @@ -1,619 +0,0 @@ - - - - - - -Network Working Group K. Zeilenga, Ed. -Request for Comments: 4616 OpenLDAP Foundation -Updates: 2595 August 2006 -Category: Standards Track - - - The PLAIN Simple Authentication and Security Layer (SASL) Mechanism - -Status of This Memo - - This document specifies an Internet standards track protocol for the - Internet community, and requests discussion and suggestions for - improvements. Please refer to the current edition of the "Internet - Official Protocol Standards" (STD 1) for the standardization state - and status of this protocol. Distribution of this memo is unlimited. - -Copyright Notice - - Copyright (C) The Internet Society (2006). - -Abstract - - This document defines a simple clear-text user/password Simple - Authentication and Security Layer (SASL) mechanism called the PLAIN - mechanism. The PLAIN mechanism is intended to be used, in - combination with data confidentiality services provided by a lower - layer, in protocols that lack a simple password authentication - command. - - - - - - - - - - - - - - - - - - - - - - - -Zeilenga Standards Track [Page 1] - -RFC 4616 The PLAIN SASL Mechanism August 2006 - - -1. Introduction - - Clear-text, multiple-use passwords are simple, interoperate with - almost all existing operating system authentication databases, and - are useful for a smooth transition to a more secure password-based - authentication mechanism. The drawback is that they are unacceptable - for use over network connections where data confidentiality is not - ensured. - - This document defines the PLAIN Simple Authentication and Security - Layer ([SASL]) mechanism for use in protocols with no clear-text - login command (e.g., [ACAP] or [SMTP-AUTH]). This document updates - RFC 2595, replacing Section 6. Changes since RFC 2595 are detailed - in Appendix A. - - The name associated with this mechanism is "PLAIN". - - The PLAIN SASL mechanism does not provide a security layer. - - The PLAIN mechanism should not be used without adequate data security - protection as this mechanism affords no integrity or confidentiality - protections itself. The mechanism is intended to be used with data - security protections provided by application-layer protocol, - generally through its use of Transport Layer Security ([TLS]) - services. - - By default, implementations SHOULD advertise and make use of the - PLAIN mechanism only when adequate data security services are in - place. Specifications for IETF protocols that indicate that this - mechanism is an applicable authentication mechanism MUST mandate that - implementations support an strong data security service, such as TLS. - - The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", - "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this - document are to be interpreted as described in [Keywords]. - -2. PLAIN SASL Mechanism - - The mechanism consists of a single message, a string of [UTF-8] - encoded [Unicode] characters, from the client to the server. The - client presents the authorization identity (identity to act as), - followed by a NUL (U+0000) character, followed by the authentication - identity (identity whose password will be used), followed by a NUL - (U+0000) character, followed by the clear-text password. As with - other SASL mechanisms, the client does not provide an authorization - identity when it wishes the server to derive an identity from the - credentials and use that as the authorization identity. - - - - -Zeilenga Standards Track [Page 2] - -RFC 4616 The PLAIN SASL Mechanism August 2006 - - - The formal grammar for the client message using Augmented BNF [ABNF] - follows. - - message = [authzid] UTF8NUL authcid UTF8NUL passwd - authcid = 1*SAFE ; MUST accept up to 255 octets - authzid = 1*SAFE ; MUST accept up to 255 octets - passwd = 1*SAFE ; MUST accept up to 255 octets - UTF8NUL = %x00 ; UTF-8 encoded NUL character - - SAFE = UTF1 / UTF2 / UTF3 / UTF4 - ;; any UTF-8 encoded Unicode character except NUL - - UTF1 = %x01-7F ;; except NUL - UTF2 = %xC2-DF UTF0 - UTF3 = %xE0 %xA0-BF UTF0 / %xE1-EC 2(UTF0) / - %xED %x80-9F UTF0 / %xEE-EF 2(UTF0) - UTF4 = %xF0 %x90-BF 2(UTF0) / %xF1-F3 3(UTF0) / - %xF4 %x80-8F 2(UTF0) - UTF0 = %x80-BF - - The authorization identity (authzid), authentication identity - (authcid), password (passwd), and NUL character deliminators SHALL be - transferred as [UTF-8] encoded strings of [Unicode] characters. As - the NUL (U+0000) character is used as a deliminator, the NUL (U+0000) - character MUST NOT appear in authzid, authcid, or passwd productions. - - The form of the authzid production is specific to the application- - level protocol's SASL profile [SASL]. The authcid and passwd - productions are form-free. Use of non-visible characters or - characters that a user may be unable to enter on some keyboards is - discouraged. - - Servers MUST be capable of accepting authzid, authcid, and passwd - productions up to and including 255 octets. It is noted that the - UTF-8 encoding of a Unicode character may be as long as 4 octets. - - Upon receipt of the message, the server will verify the presented (in - the message) authentication identity (authcid) and password (passwd) - with the system authentication database, and it will verify that the - authentication credentials permit the client to act as the (presented - or derived) authorization identity (authzid). If both steps succeed, - the user is authenticated. - - The presented authentication identity and password strings, as well - as the database authentication identity and password strings, are to - be prepared before being used in the verification process. The - [SASLPrep] profile of the [StringPrep] algorithm is the RECOMMENDED - preparation algorithm. The SASLprep preparation algorithm is - - - -Zeilenga Standards Track [Page 3] - -RFC 4616 The PLAIN SASL Mechanism August 2006 - - - recommended to improve the likelihood that comparisons behave in an - expected manner. The SASLprep preparation algorithm is not mandatory - so as to allow the server to employ other preparation algorithms - (including none) when appropriate. For instance, use of a different - preparation algorithm may be necessary for the server to interoperate - with an external system. - - When preparing the presented strings using [SASLPrep], the presented - strings are to be treated as "query" strings (Section 7 of - [StringPrep]) and hence unassigned code points are allowed to appear - in their prepared output. When preparing the database strings using - [SASLPrep], the database strings are to be treated as "stored" - strings (Section 7 of [StringPrep]) and hence unassigned code points - are prohibited from appearing in their prepared output. - - Regardless of the preparation algorithm used, if the output of a - non-invertible function (e.g., hash) of the expected string is - stored, the string MUST be prepared before input to that function. - - Regardless of the preparation algorithm used, if preparation fails or - results in an empty string, verification SHALL fail. - - When no authorization identity is provided, the server derives an - authorization identity from the prepared representation of the - provided authentication identity string. This ensures that the - derivation of different representations of the authentication - identity produces the same authorization identity. - - The server MAY use the credentials to initialize any new - authentication database, such as one suitable for [CRAM-MD5] or - [DIGEST-MD5]. - -3. Pseudo-Code - - This section provides pseudo-code illustrating the verification - process (using hashed passwords and the SASLprep preparation - function) discussed above. This section is not definitive. - - boolean Verify(string authzid, string authcid, string passwd) { - string pAuthcid = SASLprep(authcid, true); # prepare authcid - string pPasswd = SASLprep(passwd, true); # prepare passwd - if (pAuthcid == NULL || pPasswd == NULL) { - return false; # preparation failed - } - if (pAuthcid == "" || pPasswd == "") { - return false; # empty prepared string - } - - - - -Zeilenga Standards Track [Page 4] - -RFC 4616 The PLAIN SASL Mechanism August 2006 - - - storedHash = FetchPasswordHash(pAuthcid); - if (storedHash == NULL || storedHash == "") { - return false; # error or unknown authcid - } - - if (!Compare(storedHash, Hash(pPasswd))) { - return false; # incorrect password - } - - if (authzid == NULL ) { - authzid = DeriveAuthzid(pAuthcid); - if (authzid == NULL || authzid == "") { - return false; # could not derive authzid - } - } - - if (!Authorize(pAuthcid, authzid)) { - return false; # not authorized - } - - return true; - } - - The second parameter of the SASLprep function, when true, indicates - that unassigned code points are allowed in the input. When the - SASLprep function is called to prepare the password prior to - computing the stored hash, the second parameter would be false. - - The second parameter provided to the Authorize function is not - prepared by this code. The application-level SASL profile should be - consulted to determine what, if any, preparation is necessary. - - Note that the DeriveAuthzid and Authorize functions (whether - implemented as one function or two, whether designed in a manner in - which these functions or whether the mechanism implementation can be - reused elsewhere) require knowledge and understanding of mechanism - and the application-level protocol specification and/or - implementation details to implement. - - Note that the Authorize function outcome is clearly dependent on - details of the local authorization model and policy. Both functions - may be dependent on other factors as well. - - - - - - - - - -Zeilenga Standards Track [Page 5] - -RFC 4616 The PLAIN SASL Mechanism August 2006 - - -4. Examples - - This section provides examples of PLAIN authentication exchanges. - The examples are intended to help the readers understand the above - text. The examples are not definitive. - - "C:" and "S:" indicate lines sent by the client and server, - respectively. "" represents a single NUL (U+0000) character. - The Application Configuration Access Protocol ([ACAP]) is used in the - examples. - - The first example shows how the PLAIN mechanism might be used for - user authentication. - - S: * ACAP (SASL "CRAM-MD5") (STARTTLS) - C: a001 STARTTLS - S: a001 OK "Begin TLS negotiation now" - - S: * ACAP (SASL "CRAM-MD5" "PLAIN") - C: a002 AUTHENTICATE "PLAIN" - S: + "" - C: {21} - C: timtanstaaftanstaaf - S: a002 OK "Authenticated" - - The second example shows how the PLAIN mechanism might be used to - attempt to assume the identity of another user. In this example, the - server rejects the request. Also, this example makes use of the - protocol optional initial response capability to eliminate a round- - trip. - - S: * ACAP (SASL "CRAM-MD5") (STARTTLS) - C: a001 STARTTLS - S: a001 OK "Begin TLS negotiation now" - - S: * ACAP (SASL "CRAM-MD5" "PLAIN") - C: a002 AUTHENTICATE "PLAIN" {20+} - C: UrselKurtxipj3plmq - S: a002 NO "Not authorized to requested authorization identity" - -5. Security Considerations - - As the PLAIN mechanism itself provided no integrity or - confidentiality protections, it should not be used without adequate - external data security protection, such as TLS services provided by - many application-layer protocols. By default, implementations SHOULD - NOT advertise and SHOULD NOT make use of the PLAIN mechanism unless - adequate data security services are in place. - - - -Zeilenga Standards Track [Page 6] - -RFC 4616 The PLAIN SASL Mechanism August 2006 - - - When the PLAIN mechanism is used, the server gains the ability to - impersonate the user to all services with the same password - regardless of any encryption provided by TLS or other confidentiality - protection mechanisms. Whereas many other authentication mechanisms - have similar weaknesses, stronger SASL mechanisms address this issue. - Clients are encouraged to have an operational mode where all - mechanisms that are likely to reveal the user's password to the - server are disabled. - - General [SASL] security considerations apply to this mechanism. - - Unicode, [UTF-8], and [StringPrep] security considerations also - apply. - -6. IANA Considerations - - The SASL Mechanism registry [IANA-SASL] entry for the PLAIN mechanism - has been updated by the IANA to reflect that this document now - provides its technical specification. - - To: iana@iana.org - Subject: Updated Registration of SASL mechanism PLAIN - - SASL mechanism name: PLAIN - Security considerations: See RFC 4616. - Published specification (optional, recommended): RFC 4616 - Person & email address to contact for further information: - Kurt Zeilenga - IETF SASL WG - Intended usage: COMMON - Author/Change controller: IESG - Note: Updates existing entry for PLAIN - -7. Acknowledgements - - This document is a revision of RFC 2595 by Chris Newman. Portions of - the grammar defined in Section 2 were borrowed from [UTF-8] by - Francois Yergeau. - - This document is a product of the IETF Simple Authentication and - Security Layer (SASL) Working Group. - - - - - - - - - - -Zeilenga Standards Track [Page 7] - -RFC 4616 The PLAIN SASL Mechanism August 2006 - - -8. Normative References - - [ABNF] Crocker, D., Ed. and P. Overell, "Augmented BNF for - Syntax Specifications: ABNF", RFC 4234, October 2005. - - [Keywords] Bradner, S., "Key words for use in RFCs to Indicate - Requirement Levels", BCP 14, RFC 2119, March 1997. - - [SASL] Melnikov, A., Ed., and K. Zeilenga, Ed., "Simple - Authentication and Security Layer (SASL)", RFC 4422, - June 2006. - - [SASLPrep] Zeilenga, K., "SASLprep: Stringprep Profile for User - Names and Passwords", RFC 4013, February 2005. - - [StringPrep] Hoffman, P. and M. Blanchet, "Preparation of - Internationalized Strings ("stringprep")", RFC 3454, - December 2002. - - [Unicode] The Unicode Consortium, "The Unicode Standard, Version - 3.2.0" is defined by "The Unicode Standard, Version - 3.0" (Reading, MA, Addison-Wesley, 2000. ISBN 0-201- - 61633-5), as amended by the "Unicode Standard Annex - #27: Unicode 3.1" - (http://www.unicode.org/reports/tr27/) and by the - "Unicode Standard Annex #28: Unicode 3.2" - (http://www.unicode.org/reports/tr28/). - - [UTF-8] Yergeau, F., "UTF-8, a transformation format of ISO - 10646", STD 63, RFC 3629, November 2003. - - [TLS] Dierks, T. and E. Rescorla, "The Transport Layer - Security (TLS) Protocol Version 1.1", RFC 4346, April - 2006. - -9. Informative References - - [ACAP] Newman, C. and J. Myers, "ACAP -- Application - Configuration Access Protocol", RFC 2244, November - 1997. - - [CRAM-MD5] Nerenberg, L., Ed., "The CRAM-MD5 SASL Mechanism", Work - in Progress, June 2006. - - [DIGEST-MD5] Melnikov, A., Ed., "Using Digest Authentication as a - SASL Mechanism", Work in Progress, June 2006. - - - - - -Zeilenga Standards Track [Page 8] - -RFC 4616 The PLAIN SASL Mechanism August 2006 - - - [IANA-SASL] IANA, "SIMPLE AUTHENTICATION AND SECURITY LAYER (SASL) - MECHANISMS", - . - - [SMTP-AUTH] Myers, J., "SMTP Service Extension for Authentication", - RFC 2554, March 1999. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Zeilenga Standards Track [Page 9] - -RFC 4616 The PLAIN SASL Mechanism August 2006 - - -Appendix A. Changes since RFC 2595 - - This appendix is non-normative. - - This document replaces Section 6 of RFC 2595. - - The specification details how the server is to compare client- - provided character strings with stored character strings. - - The ABNF grammar was updated. In particular, the grammar now allows - LINE FEED (U+000A) and CARRIAGE RETURN (U+000D) characters in the - authzid, authcid, passwd productions. However, whether these control - characters may be used depends on the string preparation rules - applicable to the production. For passwd and authcid productions, - control characters are prohibited. For authzid, one must consult the - application-level SASL profile. This change allows PLAIN to carry - all possible authorization identity strings allowed in SASL. - - Pseudo-code was added. - - The example section was expanded to illustrate more features of the - PLAIN mechanism. - -Editor's Address - - Kurt D. Zeilenga - OpenLDAP Foundation - - EMail: Kurt@OpenLDAP.org - - - - - - - - - - - - - - - - - - - - - - -Zeilenga Standards Track [Page 10] - -RFC 4616 The PLAIN SASL Mechanism August 2006 - - -Full Copyright Statement - - Copyright (C) The Internet Society (2006). - - This document is subject to the rights, licenses and restrictions - contained in BCP 78, and except as set forth therein, the authors - retain all their rights. - - This document and the information contained herein are provided on an - "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS - OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET - ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, - INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE - INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED - WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - -Intellectual Property - - The IETF takes no position regarding the validity or scope of any - Intellectual Property Rights or other rights that might be claimed to - pertain to the implementation or use of the technology described in - this document or the extent to which any license under such rights - might or might not be available; nor does it represent that it has - made any independent effort to identify any such rights. Information - on the procedures with respect to rights in RFC documents can be - found in BCP 78 and BCP 79. - - Copies of IPR disclosures made to the IETF Secretariat and any - assurances of licenses to be made available, or the result of an - attempt made to obtain a general license or permission for the use of - such proprietary rights by implementers or users of this - specification can be obtained from the IETF on-line IPR repository at - http://www.ietf.org/ipr. - - The IETF invites any interested party to bring to its attention any - copyrights, patents or patent applications, or other proprietary - rights that may cover technology that may be required to implement - this standard. Please address the information to the IETF at - ietf-ipr@ietf.org. - -Acknowledgement - - Funding for the RFC Editor function is provided by the IETF - Administrative Support Activity (IASA). - - - - - - - -Zeilenga Standards Track [Page 11] - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc4954.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/rfc4954.txt deleted file mode 100644 index 668d738..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/rfc4954.txt +++ /dev/null @@ -1,1123 +0,0 @@ - - - - - - -Network Working Group R. Siemborski, Ed. -Request for Comments: 4954 Google, Inc. -Obsoletes: 2554 A. Melnikov, Ed. -Updates: 3463 Isode Limited -Category: Standards Track July 2007 - - - SMTP Service Extension for Authentication - -Status of This Memo - - This document specifies an Internet standards track protocol for the - Internet community, and requests discussion and suggestions for - improvements. Please refer to the current edition of the "Internet - Official Protocol Standards" (STD 1) for the standardization state - and status of this protocol. Distribution of this memo is unlimited. - -Copyright Notice - - Copyright (C) The IETF Trust (2007). - -Abstract - - This document defines a Simple Mail Transport Protocol (SMTP) - extension whereby an SMTP client may indicate an authentication - mechanism to the server, perform an authentication protocol exchange, - and optionally negotiate a security layer for subsequent protocol - interactions during this session. This extension includes a profile - of the Simple Authentication and Security Layer (SASL) for SMTP. - - This document obsoletes RFC 2554. - - - - - - - - - - - - - - - - - - - - -Siemborski & Melnikov Standards Track [Page 1] - -RFC 4954 SMTP Service Extension for Authentication July 2007 - - -Table of Contents - - 1. Introduction ....................................................2 - 2. How to Read This Document .......................................2 - 3. The Authentication Service Extension ............................3 - 4. The AUTH Command ................................................3 - 4.1. Examples ...................................................7 - 5. The AUTH Parameter to the MAIL FROM command .....................9 - 5.1. Examples ..................................................10 - 6. Status Codes ...................................................11 - 7. Additional requirements on servers .............................12 - 8. Formal Syntax ..................................................13 - 9. Security Considerations ........................................14 - 10. IANA Considerations ...........................................15 - 11. Normative References ..........................................15 - 12. Informative References ........................................16 - 13. Acknowledgments ...............................................17 - 14. Additional Requirements When Using SASL PLAIN over TLS ........17 - 15. Changes since RFC 2554 ........................................18 - -1. Introduction - - This document defines a Simple Mail Transport Protocol (SMTP) - extension whereby an SMTP client may indicate an authentication - mechanism to the server, perform an authentication protocol exchange, - optionally negotiate a security layer for subsequent protocol - interactions during this session and, during a mail transaction, - optionally specify a mailbox associated with the identity that - submitted the message to the mail delivery system. - - This extension includes a profile of the Simple Authentication and - Security Layer (SASL) for SMTP. - - When compared to RFC 2554, this document deprecates use of the 538 - response code, adds a new Enhanced Status Code, adds a requirement to - support SASLprep profile for preparing authorization identities, - recommends use of RFC 3848 transmission types in the Received trace - header field, and clarifies interaction with SMTP PIPELINING - [PIPELINING] extension. - -2. How to Read This Document - - The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", - "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this - document are to be interpreted as described in [KEYWORDS]. - - In examples, "C:" and "S:" indicate lines sent by the client and - server, respectively. - - - -Siemborski & Melnikov Standards Track [Page 2] - -RFC 4954 SMTP Service Extension for Authentication July 2007 - - -3. The Authentication Service Extension - - 1. The name of this [SMTP] service extension is "Authentication". - - 2. The EHLO keyword value associated with this extension is "AUTH". - - 3. The AUTH EHLO keyword contains as a parameter a space-separated - list of the names of available [SASL] mechanisms. The list of - available mechanisms MAY change after a successful STARTTLS - command [SMTP-TLS]. - - 4. A new [SMTP] verb "AUTH" is defined. - - 5. An optional parameter using the keyword "AUTH" is added to the - MAIL FROM command, and extends the maximum line length of the - MAIL FROM command by 500 characters. - - 6. This extension is appropriate for the submission protocol - [SUBMIT]. - -4. The AUTH Command - - AUTH mechanism [initial-response] - - Arguments: - mechanism: A string identifying a [SASL] authentication - mechanism. - - initial-response: An optional initial client response. If - present, this response MUST be encoded as described in Section - 4 of [BASE64] or contain a single character "=". - - Restrictions: - After an AUTH command has been successfully completed, no more - AUTH commands may be issued in the same session. After a - successful AUTH command completes, a server MUST reject any - further AUTH commands with a 503 reply. - - The AUTH command is not permitted during a mail transaction. - An AUTH command issued during a mail transaction MUST be - rejected with a 503 reply. - - Discussion: - The AUTH command initiates a [SASL] authentication exchange - between the client and the server. The client identifies the - SASL mechanism to use with the first parameter of the AUTH - command. If the server supports the requested authentication - mechanism, it performs the SASL exchange to authenticate the - - - -Siemborski & Melnikov Standards Track [Page 3] - -RFC 4954 SMTP Service Extension for Authentication July 2007 - - - user. Optionally, it also negotiates a security layer for - subsequent protocol interactions during this session. If the - requested authentication mechanism is invalid (e.g., is not - supported or requires an encryption layer), the server rejects - the AUTH command with a 504 reply. If the server supports the - [ESMTP-CODES] extension, it SHOULD return a 5.5.4 enhanced - response code. - - The SASL authentication exchange consists of a series of - server challenges and client responses that are specific to - the chosen [SASL] mechanism. - - A server challenge is sent as a 334 reply with the text part - containing the [BASE64] encoded string supplied by the SASL - mechanism. This challenge MUST NOT contain any text other - than the BASE64 encoded challenge. - - A client response consists of a line containing a [BASE64] - encoded string. If the client wishes to cancel the - authentication exchange, it issues a line with a single "*". - If the server receives such a response, it MUST reject the - AUTH command by sending a 501 reply. - - The optional initial response argument to the AUTH command is - used to save a round-trip when using authentication mechanisms - that support an initial client response. If the initial - response argument is omitted and the chosen mechanism requires - an initial client response, the server MUST proceed as defined - in Section 5.1 of [SASL]. In SMTP, a server challenge that - contains no data is defined as a 334 reply with no text part. - Note that there is still a space following the reply code, so - the complete response line is "334 ". - - Note that the AUTH command is still subject to the line length - limitations defined in [SMTP]. If use of the initial response - argument would cause the AUTH command to exceed this length, - the client MUST NOT use the initial response parameter (and - instead proceed as defined in Section 5.1 of [SASL]). - - If the client is transmitting an initial response of zero - length, it MUST instead transmit the response as a single - equals sign ("="). This indicates that the response is - present, but contains no data. - - If the client uses an initial-response argument to the AUTH - command with a SASL mechanism in which the client does not - begin the authentication exchange, the server MUST reject the - - - - -Siemborski & Melnikov Standards Track [Page 4] - -RFC 4954 SMTP Service Extension for Authentication July 2007 - - - AUTH command with a 501 reply. Servers using the enhanced - status codes extension [ESMTP-CODES] SHOULD return an enhanced - status code of 5.7.0 in this case. - - If the server cannot [BASE64] decode any client response, it - MUST reject the AUTH command with a 501 reply (and an enhanced - status code of 5.5.2). If the client cannot BASE64 decode any - of the server's challenges, it MUST cancel the authentication - using the "*" response. In particular, servers and clients - MUST reject (and not ignore) any character not explicitly - allowed by the BASE64 alphabet, and MUST reject any sequence - of BASE64 characters that contains the pad character ('=') - anywhere other than the end of the string (e.g., "=AAA" and - "AAA=BBB" are not allowed). - - Note that these [BASE64] strings can be much longer than - normal SMTP commands. Clients and servers MUST be able to - handle the maximum encoded size of challenges and responses - generated by their supported authentication mechanisms. This - requirement is independent of any line length limitations the - client or server may have in other parts of its protocol - implementation. (At the time of writing of this document, - 12288 octets is considered to be a sufficient line length - limit for handling of deployed authentication mechanisms.) - If, during an authentication exchange, the server receives a - line that is longer than the server's authentication buffer, - the server fails the AUTH command with the 500 reply. Servers - using the enhanced status codes extension [ESMTP-CODES] SHOULD - return an enhanced status code of 5.5.6 in this case. - - The authorization identity generated by this [SASL] exchange - is a "simple username" (in the sense defined in [SASLprep]), - and both client and server SHOULD (*) use the [SASLprep] - profile of the [StringPrep] algorithm to prepare these names - for transmission or comparison. If preparation of the - authorization identity fails or results in an empty string - (unless it was transmitted as the empty string), the server - MUST fail the authentication. - - (*) Note: Future revision of this specification may change this - requirement to MUST. Currently, the SHOULD is used in order to - avoid breaking the majority of existing implementations. - - If the server is unable to authenticate the client, it SHOULD reject - the AUTH command with a 535 reply unless a more specific error code - is appropriate. Should the client successfully complete the - exchange, the SMTP server issues a 235 reply. (Note that the SMTP - protocol doesn't support the SASL feature of returning additional - - - -Siemborski & Melnikov Standards Track [Page 5] - -RFC 4954 SMTP Service Extension for Authentication July 2007 - - - data with a successful outcome.) These status codes, along with - others defined by this extension, are discussed in Section 6 of this - document. - - If a security layer is negotiated during the SASL exchange, it takes - effect for the client on the octet immediately following the CRLF - that concludes the last response generated by the client. For the - server, it takes effect immediately following the CRLF of its success - reply. - - When a security layer takes effect, the SMTP protocol is reset to the - initial state (the state in SMTP after a server issues a 220 service - ready greeting). The server MUST discard any knowledge obtained from - the client, such as the EHLO argument, which was not obtained from - the SASL negotiation itself. Likewise, the client MUST discard any - knowledge obtained from the server, such as the list of SMTP service - extensions, which was not obtained from the SASL negotiation itself. - (Note that a client MAY compare the advertised SASL mechanisms before - and after authentication in order to detect an active down- - negotiation attack). - - The client SHOULD send an EHLO command as the first command after a - successful SASL negotiation that results in the enabling of a - security layer. - - When an entity (whether it is the client or the server end) is - sending data, and both [TLS] and SASL security layers are in effect, - the TLS encoding MUST be applied after the SASL encoding, regardless - of the order in which the layers were negotiated. - - The service name specified by this protocol's profile of SASL is - "smtp". This service name is also to be used for the [SUBMIT] - protocol. - - If an AUTH command fails, the client MAY proceed without - authentication. Alternatively, the client MAY try another - authentication mechanism or present different credentials by issuing - another AUTH - - Note: A server implementation MUST implement a configuration in which - it does NOT permit any plaintext password mechanisms, unless either - the STARTTLS [SMTP-TLS] command has been negotiated or some other - mechanism that protects the session from password snooping has been - provided. Server sites SHOULD NOT use any configuration which - permits a plaintext password mechanism without such a protection - mechanism against password snooping. - - - - - -Siemborski & Melnikov Standards Track [Page 6] - -RFC 4954 SMTP Service Extension for Authentication July 2007 - - - To ensure interoperability, client and server implementations of this - extension MUST implement the [PLAIN] SASL mechanism running over TLS - [TLS] [SMTP-TLS]. See also Section 15 for additional requirements on - implementations of [PLAIN] over [TLS]. - - Note that many existing client and server implementations implement - CRAM-MD5 [CRAM-MD5] SASL mechanism. In order to ensure - interoperability with deployed software, new implementations MAY - implement it; however, implementations should be aware that this SASL - mechanism doesn't provide any server authentication. Note that at - the time of writing of this document the SASL Working Group is - working on several replacement SASL mechanisms that provide server - authentication and other features. - - When the AUTH command is used together with the [PIPELINING] - extension, it MUST be the last command in a pipelined group of - commands. The only exception to this rule is when the AUTH command - contains an initial response for a SASL mechanism that allows the - client to send data first, the SASL mechanism is known to complete in - one round-trip, and a security layer is not negotiated by the client. - Two examples of such SASL mechanisms are PLAIN [PLAIN] and EXTERNAL - [SASL]. - -4.1. Examples - - Here is an example of a client attempting AUTH using the [PLAIN] SASL - mechanism under a TLS layer, and making use of the initial client - response: - - S: 220-smtp.example.com ESMTP Server - C: EHLO client.example.com - S: 250-smtp.example.com Hello client.example.com - S: 250-AUTH GSSAPI DIGEST-MD5 - S: 250-ENHANCEDSTATUSCODES - S: 250 STARTTLS - C: STARTTLS - S: 220 Ready to start TLS - ... TLS negotiation proceeds, further commands - protected by TLS layer ... - C: EHLO client.example.com - S: 250-smtp.example.com Hello client.example.com - S: 250 AUTH GSSAPI DIGEST-MD5 PLAIN - C: AUTH PLAIN dGVzdAB0ZXN0ADEyMzQ= - S: 235 2.7.0 Authentication successful - - Here is another client that is attempting AUTH PLAIN under a TLS - layer, this time without the initial response. Parts of the - negotiation before the TLS layer was established have been omitted: - - - -Siemborski & Melnikov Standards Track [Page 7] - -RFC 4954 SMTP Service Extension for Authentication July 2007 - - - ... TLS negotiation proceeds, further commands - protected by TLS layer ... - C: EHLO client.example.com - S: 250-smtp.example.com Hello client.example.com - S: 250 AUTH GSSAPI DIGEST-MD5 PLAIN - C: AUTH PLAIN - (note: there is a single space following the 334 - on the following line) - S: 334 - C: dGVzdAB0ZXN0ADEyMzQ= - S: 235 2.7.0 Authentication successful - - Here is an example using CRAM-MD5 [CRAM-MD5], a mechanism in which - the client does not begin the authentication exchange, and includes a - server challenge: - - S: 220-smtp.example.com ESMTP Server - C: EHLO client.example.com - S: 250-smtp.example.com Hello client.example.com - S: 250-AUTH DIGEST-MD5 CRAM-MD5 - S: 250-ENHANCEDSTATUSCODES - S: 250 STARTTLS - C: AUTH CRAM-MD5 - S: 334 PDQxOTI5NDIzNDEuMTI4Mjg0NzJAc291cmNlZm91ci5hbmRyZXcuY211LmVk - dT4= - C: cmpzMyBlYzNhNTlmZWQzOTVhYmExZWM2MzY3YzRmNGI0MWFjMA== - S: 235 2.7.0 Authentication successful - - Here is an example of a client attempting AUTH EXTERNAL under TLS, - using the derived authorization ID (and thus a zero-length initial - client response). - - S: 220-smtp.example.com ESMTP Server - C: EHLO client.example.com - S: 250-smtp.example.com Hello client.example.com - S: 250-AUTH GSSAPI DIGEST-MD5 - S: 250-ENHANCEDSTATUSCODES - S: 250 STARTTLS - C: STARTTLS - S: 220 Ready to start TLS - ... TLS negotiation proceeds, further commands - protected by TLS layer ... - C: EHLO client.example.com - S: 250-smtp.example.com Hello client.example.com - S: 250 AUTH EXTERNAL GSSAPI DIGEST-MD5 PLAIN - C: AUTH EXTERNAL = - S: 235 2.7.0 Authentication successful - - - - -Siemborski & Melnikov Standards Track [Page 8] - -RFC 4954 SMTP Service Extension for Authentication July 2007 - - -5. The AUTH Parameter to the MAIL FROM command - - AUTH=mailbox - - Arguments: - A (see Section 4.1.2 of [SMTP]) that is associated - with the identity that submitted the message to the delivery - system, or the two character sequence "<>" indicating such an - identity is unknown or insufficiently authenticated. To comply - with restrictions imposed on ESMTP parameters, the is - encoded inside an xtext. The syntax of an xtext is described in - Section 4 of [ESMTP-DSN]. - - Note: - For the purposes of this discussion, "authenticated identity" - refers to the identity (if any) derived from the authorization - identity of previous AUTH command, while the terms "authorized - identity" and "supplied " refer to the sender identity - that is being associated with a particular message. Note that - one authenticated identity may be able to identify messages as - being sent by any number of authorized identities within a - single session. For example, this may be the case when an SMTP - server (one authenticated identity) is processing its queue - (many messages with distinct authorized identities). - - Discussion: - The optional AUTH parameter to the MAIL FROM command allows - cooperating agents in a trusted environment to communicate the - authorization identity associated with individual messages. - - If the server trusts the authenticated identity of the client to - assert that the message was originally submitted by the supplied - , then the server SHOULD supply the same in - an AUTH parameter when relaying the message to any other server - which supports the AUTH extension. - - For this reason, servers that advertise support for this - extension MUST support the AUTH parameter to the MAIL FROM - command even when the client has not authenticated itself to the - server. - - A MAIL FROM parameter of AUTH=<> indicates that the original - submitter of the message is not known. The server MUST NOT - treat the message as having been originally submitted by the - authenticated identity that resulted from the AUTH command. - - - - - - -Siemborski & Melnikov Standards Track [Page 9] - -RFC 4954 SMTP Service Extension for Authentication July 2007 - - - If the AUTH parameter to the MAIL FROM command is not supplied, - the client has authenticated, and the server believes the - message is an original submission, the server MAY generate a - from the user's authenticated identity for use in an - AUTH parameter when relaying the message to any server which - supports the AUTH extension. The generated is - implementation specific, but it MUST conform to the syntax of - [SMTP]. If the implementation cannot generate a valid - , it MUST transmit AUTH=<> when relaying this message. - - If the server does not sufficiently trust the authenticated - identity of the client, or if the client is not authenticated, - then the server MUST behave as if the AUTH=<> parameter was - supplied. The server MAY, however, write the value of any - supplied AUTH parameter to a log file. - - If an AUTH=<> parameter was supplied, either explicitly or due - to the requirement in the previous paragraph, then the server - MUST supply the AUTH=<> parameter when relaying the message to - any server which it has authenticated to using the AUTH - extension. - - A server MAY treat expansion of a mailing list as a new - submission, setting the AUTH parameter to the mailing list - address or mailing list administration address when relaying the - message to list subscribers. - - Note that an implementation which is hard-coded to treat all - clients as being insufficiently trusted is compliant with this - specification. In that case, the implementation does nothing - more than parse and discard syntactically valid AUTH parameters - to the MAIL FROM command, and supply AUTH=<> parameters to any - servers that it authenticates to. - -5.1. Examples - - An example where the original identity of the sender is trusted and - known: - - C: MAIL FROM: AUTH=e+3Dmc2@example.com - S: 250 OK - - One example where the identity of the sender is not trusted or is - otherwise being suppressed by the client: - - C: MAIL FROM: AUTH=<> - S: 250 OK - - - - -Siemborski & Melnikov Standards Track [Page 10] - -RFC 4954 SMTP Service Extension for Authentication July 2007 - - -6. Status Codes - - The following error codes may be used to indicate various success or - failure conditions. Servers that return enhanced status codes - [ESMTP-CODES] SHOULD use the enhanced codes suggested here. - - 235 2.7.0 Authentication Succeeded - - This response to the AUTH command indicates that the authentication - was successful. - - 432 4.7.12 A password transition is needed - - This response to the AUTH command indicates that the user needs to - transition to the selected authentication mechanism. This is - typically done by authenticating once using the [PLAIN] - authentication mechanism. The selected mechanism SHOULD then work - for authentications in subsequent sessions. - - 454 4.7.0 Temporary authentication failure - - This response to the AUTH command indicates that the authentication - failed due to a temporary server failure. The client SHOULD NOT - prompt the user for another password in this case, and should instead - notify the user of server failure. - - 534 5.7.9 Authentication mechanism is too weak - - This response to the AUTH command indicates that the selected - authentication mechanism is weaker than server policy permits for - that user. The client SHOULD retry with a new authentication - mechanism. - - 535 5.7.8 Authentication credentials invalid - - This response to the AUTH command indicates that the authentication - failed due to invalid or insufficient authentication credentials. In - this case, the client SHOULD ask the user to supply new credentials - (such as by presenting a password dialog box). - - 500 5.5.6 Authentication Exchange line is too long - - This response to the AUTH command indicates that the authentication - failed due to the client sending a [BASE64] response that is longer - than the maximum buffer size available for the currently selected - SASL mechanism. - - - - - -Siemborski & Melnikov Standards Track [Page 11] - -RFC 4954 SMTP Service Extension for Authentication July 2007 - - - 530 5.7.0 Authentication required - - This response SHOULD be returned by any command other than AUTH, - EHLO, HELO, NOOP, RSET, or QUIT when server policy requires - authentication in order to perform the requested action and - authentication is not currently in force. - - 538 5.7.11 Encryption required for requested authentication - mechanism - - This response to the AUTH command indicates that the selected - authentication mechanism may only be used when the underlying SMTP - connection is encrypted. Note that this response code is documented - here for historical purposes only. Modern implementations SHOULD NOT - advertise mechanisms that are not permitted due to lack of - encryption, unless an encryption layer of sufficient strength is - currently being employed. - - This document adds several new enhanced status codes to the list - defined in [ENHANCED]: - - The following 3 Enhanced Status Codes were defined above: - - 5.7.8 Authentication credentials invalid - 5.7.9 Authentication mechanism is too weak - 5.7.11 Encryption required for requested authentication mechanism - - X.5.6 Authentication Exchange line is too long - - This enhanced status code SHOULD be returned when the server fails - the AUTH command due to the client sending a [BASE64] response which - is longer than the maximum buffer size available for the currently - selected SASL mechanism. This is useful for both permanent and - persistent transient errors. - -7. Additional Requirements on Servers - - As described in Section 4.4 of [SMTP], an SMTP server that receives a - message for delivery or further processing MUST insert the - "Received:" header field at the beginning of the message content. - This document places additional requirements on the content of a - generated "Received:" header field. Upon successful authentication, - a server SHOULD use the "ESMTPA" or the "ESMTPSA" [SMTP-TT] (when - appropriate) keyword in the "with" clause of the Received header - field. - - - - - - -Siemborski & Melnikov Standards Track [Page 12] - -RFC 4954 SMTP Service Extension for Authentication July 2007 - - -8. Formal Syntax - - The following syntax specification uses the Augmented Backus-Naur - Form notation as specified in [ABNF]. Non-terminals referenced but - not defined below are as defined by [ABNF] or [SASL]. The non- - terminal is defined in [SMTP]. - - Except as noted otherwise, all alphabetic characters are case- - insensitive. The use of upper or lower case characters to define - token strings is for editorial clarity only. Implementations MUST - accept these strings in a case-insensitive fashion. - - hexchar = "+" HEXDIG HEXDIG - - xchar = %x21-2A / %x2C-3C / %x3E-7E - ;; US-ASCII except for "+", "=", SP, and CTL - - xtext = *(xchar / hexchar) - ;; non-US-ASCII is only allowed as hexchar - - auth-command = "AUTH" SP sasl-mech [SP initial-response] - *(CRLF [base64]) [CRLF cancel-response] - CRLF - ;; is defined in [SASL] - - auth-param = "AUTH=" xtext - ;; Parameter to the MAIL FROM command. - ;; This non-terminal complies with - ;; syntax defined by esmtp-param [SMTP]. - ;; - ;; The decoded form of the xtext MUST be - ;; either a or the two - ;; characters "<>" - - base64 = base64-terminal / - ( 1*(4base64-char) [base64-terminal] ) - - base64-char = ALPHA / DIGIT / "+" / "/" - ;; Case-sensitive - - base64-terminal = (2base64-char "==") / (3base64-char "=") - - continue-req = "334" SP [base64] CRLF - ;; Intermediate response to the AUTH - ;; command. - ;; This non-terminal complies with - ;; syntax defined by Reply-line [SMTP]. - - - - -Siemborski & Melnikov Standards Track [Page 13] - -RFC 4954 SMTP Service Extension for Authentication July 2007 - - - initial-response= base64 / "=" - - cancel-response = "*" - -9. Security Considerations - - Security issues are discussed throughout this memo. - - If a client uses this extension to get an encrypted tunnel through an - insecure network to a cooperating server, it needs to be configured - to never send mail to that server when the connection is not mutually - authenticated and encrypted. Otherwise, an attacker could steal the - client's mail by hijacking the [SMTP] connection and either - pretending the server does not support the Authentication extension - or causing all AUTH commands to fail. - - Before the [SASL] negotiation has begun, any protocol interactions - are performed in the clear and may be modified by an active attacker. - For this reason, clients and servers MUST discard any knowledge - obtained prior to the start of the SASL negotiation upon the - establishment of a security layer. - - This mechanism does not protect the TCP port, so an active attacker - may redirect a relay connection attempt (i.e., a connection between - two Mail Transfer Agents (MTAs)) to the submission port [SUBMIT]. - The AUTH=<> parameter prevents such an attack from causing a relayed - message and, in the absence of other envelope authentication, from - picking up the authentication of the relay client. - - A message submission client may require the user to authenticate - whenever a suitable [SASL] mechanism is advertised. Therefore, it - may not be desirable for a submission server [SUBMIT] to advertise a - SASL mechanism when use of that mechanism grants the clients no - benefits over anonymous submission. - - Servers MAY implement a policy whereby the connection is dropped - after a number of failed authentication attempts. If they do so, - they SHOULD NOT drop the connection until at least 3 attempts to - authenticate have failed. - - If an implementation supports SASL mechanisms that are vulnerable to - passive eavesdropping attacks (such as [PLAIN]), then the - implementation MUST support at least one configuration where these - SASL mechanisms are not advertised or used without the presence of an - external security layer such as [TLS]. - - - - - - -Siemborski & Melnikov Standards Track [Page 14] - -RFC 4954 SMTP Service Extension for Authentication July 2007 - - - This extension is not intended to replace or be used instead of end- - to-end message signature and encryption systems such as [S/MIME] or - [PGP]. This extension addresses a different problem than end-to-end - systems; it has the following key differences: - - 1. It is generally useful only within a trusted enclave. - - 2. It protects the entire envelope of a message, not just the - message's body. - - 3. It authenticates the message submission, not authorship of the - message content. - - 4. When mutual authentication is used along with a security layer, - it can give the sender some assurance that the message was - successfully delivered to the next hop. - - Additional security considerations are mentioned in the [SASL] - specification. Additional security considerations specific to a - particular SASL mechanism are described in the relevant - specification. Additional security considerations for [PLAIN] over - [TLS] are mentioned in Section 15 of this document. - -10. IANA Considerations - - IANA updated the entry for the "smtp" SASL protocol name to point at - this document. - - IANA updated the registration of the Authentication SMTP service - extension as defined in Section 3 of this document. This registry is - currently located at . - -11. Normative References - - [ABNF] Crocker, D. and P. Overell, "Augmented BNF for Syntax - Specifications: ABNF", RFC 4234, October 2005. - - [BASE64] Josefsson, S., "The Base16, Base32, and Base64 Data - Encodings", RFC 4648, October 2006. - - [ESMTP-CODES] Freed, N., "SMTP Service Extension for Returning - Enhanced Error Codes", RFC 2034, October 1996. - - [ENHANCED] Vaudreuil, G., "Enhanced Mail System Status Codes", RFC - 3463, January 2003. - - - - - -Siemborski & Melnikov Standards Track [Page 15] - -RFC 4954 SMTP Service Extension for Authentication July 2007 - - - [ESMTP-DSN] Moore, K., "Simple Mail Transfer Protocol (SMTP) - Service Extension Delivery Status Notifications - (DSNs)", RFC 3461, January 2003. - - [KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate - Requirement Levels", BCP 14, RFC 2119, March 1997. - - [SASL] Melnikov, A. and K. Zeilenga, "Simple Authentication - and Security Layer (SASL)", RFC 4422, June 2006. - - [SASLprep] Zeilenga, K., "SASLprep: Stringprep Profile for User - Names and Passwords", RFC 4013, February 2005. - - [SMTP] Klensin, J., "Simple Mail Transfer Protocol", RFC 2821, - April 2001. - - [SMTP-TLS] Hoffman, P., "SMTP Service Extension for Secure SMTP - over Transport Layer Security", RFC 3207, February - 2002. - - [StringPrep] Hoffman, P. and M. Blanchet, "Preparation of - Internationalized Strings ("stringprep")", RFC 3454, - December 2002. - - [SUBMIT] Gellens, R. and J. Klensin, "Message Submission for - Mail", RFC 4409, April 2006. - - [SMTP-TT] Newman, C., "ESMTP and LMTP Transmission Types - Registration", RFC 3848, July 2004. - - [PLAIN] Zeilenga, K., Ed., "The PLAIN Simple Authentication and - Security Layer (SASL) Mechanism", RFC 4616, August - 2006. - - [X509] Housley, R., Polk, W., Ford, W., and D. Solo, "Internet - X.509 Public Key Infrastructure Certificate and - Certificate Revocation List (CRL) Profile", RFC 3280, - April 2002. - -12. Informative References - - [PGP] Elkins, M., "MIME Security with Pretty Good Privacy - (PGP)", RFC 2015, October 1996. - - [S/MIME] Ramsdell, B., Ed., "Secure/Multipurpose Internet Mail - Extensions (S/MIME) Version 3.1 Message Specification", - RFC 3851, July 2004. - - - - -Siemborski & Melnikov Standards Track [Page 16] - -RFC 4954 SMTP Service Extension for Authentication July 2007 - - - [TLS] Dierks, T. and E. Rescorla, "The Transport Layer - Security (TLS) Protocol Version 1.1", RFC 4346, April - 2006. - - [PIPELINING] Freed, N., "SMTP Service Extension for Command - Pipelining", STD 60, RFC 2920, September 2000. - - [CRAM-MD5] Klensin, J., Catoe, R., and P. Krumviede, "IMAP/POP - AUTHorize Extension for Simple Challenge/Response", RFC - 2195, September 1997. - -13. Acknowledgments - - The editors would like to acknowledge the contributions of John Myers - and other contributors to RFC 2554, on which this document draws from - heavily. - - The editors would also like to thank Ken Murchison, Mark Crispin, - Chris Newman, David Wilson, Dave Cridland, Frank Ellermann, Ned - Freed, John Klensin, Tony Finch, Abhijit Menon-Sen, Philip Guenther, - Sam Hartman, Russ Housley, Cullen Jennings, and Lisa Dusseault for - the time they devoted to reviewing of this document and/or for the - comments received. - -14. Additional Requirements When Using SASL PLAIN over TLS - - This section is normative for SMTP implementations that support SASL - [PLAIN] over [TLS]. - - If an SMTP client is willing to use SASL PLAIN over TLS to - authenticate to the SMTP server, the client verifies the server - certificate according to the rules of [X509]. If the server has not - provided any certificate, or if the certificate verification fails, - the client MUST NOT attempt to authenticate using the SASL PLAIN - mechanism. - - After a successful [TLS] negotiation, the client MUST check its - understanding of the server hostname against the server's identity as - presented in the server Certificate message, in order to prevent - man-in-the-middle attacks. If the match fails, the client MUST NOT - attempt to authenticate using the SASL PLAIN mechanism. Matching is - performed according to the following rules: - - The client MUST use the server hostname it used to open the - connection as the value to compare against the server name as - expressed in the server certificate. The client MUST NOT use - - - - - -Siemborski & Melnikov Standards Track [Page 17] - -RFC 4954 SMTP Service Extension for Authentication July 2007 - - - any form of the server hostname derived from an insecure remote - source (e.g., insecure DNS lookup). CNAME canonicalization is - not done. - - If a subjectAltName extension of type dNSName is present in the - certificate, it SHOULD be used as the source of the server's - identity. - - Matching is case-insensitive. - - A "*" wildcard character MAY be used as the leftmost name - component in the certificate. For example, *.example.com would - match a.example.com, foo.example.com, etc., but would not match - example.com. - - If the certificate contains multiple names (e.g., more than one - dNSName field), then a match with any one of the fields is - considered acceptable. - -15. Changes since RFC 2554 - - 1. Clarified that servers MUST support the use of the AUTH=mailbox - parameter to MAIL FROM, even when the client is not - authenticated. - - 2. Clarified the initial-client-send requirements, and give - additional examples. - - 3. Updated references to newer versions of various specifications. - - 4. Required SASL PLAIN (over TLS) as mandatory-to-implement. - - 5. Clarified that the mechanism list can change. - - 6. Deprecated the use of the 538 response code. - - 7. Added the use of the SASLprep profile for preparing authorization - identities. - - 8. Substantial cleanup of response codes and indicated suggested - enhanced response codes. Also indicated what response codes - should result in a client prompting the user for new credentials. - - 9. Updated ABNF section to use RFC 4234. - - 10. Clarified interaction with SMTP PIPELINING extension. - - 11. Added a reference to RFC 3848. - - - -Siemborski & Melnikov Standards Track [Page 18] - -RFC 4954 SMTP Service Extension for Authentication July 2007 - - - 12. Added a new Enhanced Status Code for "authentication line too - long" case. - - 13. Other general editorial clarifications. - -Editors' Addresses - - Robert Siemborski - Google, Inc. - 1600 Ampitheatre Parkway - Mountain View, CA 94043, USA - - Phone: +1 650 623 6925 - EMail: robsiemb@google.com - - - Alexey Melnikov - Isode Limited - 5 Castle Business Village, 36 Station Road, - Hampton, Middlesex, TW12 2BX, UK - - EMail: Alexey.Melnikov@isode.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Siemborski & Melnikov Standards Track [Page 19] - -RFC 4954 SMTP Service Extension for Authentication July 2007 - - -Full Copyright Statement - - Copyright (C) The IETF Trust (2007). - - This document is subject to the rights, licenses and restrictions - contained in BCP 78, and except as set forth therein, the authors - retain all their rights. - - This document and the information contained herein are provided on an - "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS - OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND - THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF - THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED - WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - -Intellectual Property - - The IETF takes no position regarding the validity or scope of any - Intellectual Property Rights or other rights that might be claimed to - pertain to the implementation or use of the technology described in - this document or the extent to which any license under such rights - might or might not be available; nor does it represent that it has - made any independent effort to identify any such rights. Information - on the procedures with respect to rights in RFC documents can be - found in BCP 78 and BCP 79. - - Copies of IPR disclosures made to the IETF Secretariat and any - assurances of licenses to be made available, or the result of an - attempt made to obtain a general license or permission for the use of - such proprietary rights by implementers or users of this - specification can be obtained from the IETF on-line IPR repository at - http://www.ietf.org/ipr. - - The IETF invites any interested party to bring to its attention any - copyrights, patents or patent applications, or other proprietary - rights that may cover technology that may be required to implement - this standard. Please address the information to the IETF at - ietf-ipr@ietf.org. - -Acknowledgement - - Funding for the RFC Editor function is currently provided by the - Internet Society. - - - - - - - -Siemborski & Melnikov Standards Track [Page 20] - diff --git a/vendor/swiftmailer/swiftmailer/notes/rfc/whats_where.txt b/vendor/swiftmailer/swiftmailer/notes/rfc/whats_where.txt deleted file mode 100644 index 1470874..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/rfc/whats_where.txt +++ /dev/null @@ -1,61 +0,0 @@ -RFC 1854: ---------- -PIPELINING extension - -RFC 2222: ---------- -SASL - -RFC 4505: ---------- -ANYNONYMOUS SASL - -RFC 4616: ---------- -PLAIN SASL - -RFC 2487: ---------- -STARTTLS extension - -RFC 2554 & 4954: ----------------- -AUTH extension - -RFC 2821: ---------- -SMTP protocol - -RFC 2822: ---------- -General message structure (focusing on important headers) - -RFC 2045: ---------- -Quoted Printable Encoding -Base 64 Encoding -Detailed message structure - -RFC 2046: ---------- -Media types (for subparts) - -RFC 2047: ---------- -Header Encoding - -RFC 2183: ---------- -The Content-Disposition header - -RFC 2231: ---------- -Encoded Text header/attribute extensions - -RFC 2234: ---------- -ABNF definitions - -RFC 3676: ---------- -Flowed formatting/delsp parameters diff --git a/vendor/swiftmailer/swiftmailer/notes/smtp.txt b/vendor/swiftmailer/swiftmailer/notes/smtp.txt deleted file mode 100644 index db73744..0000000 --- a/vendor/swiftmailer/swiftmailer/notes/smtp.txt +++ /dev/null @@ -1,48 +0,0 @@ -General Notes --------------- - * MX is NOT required, but an A record, or CNAME to a MX MUST be present at the least. - * EHLO should be tried, then fall back to HELO - * The 250 return code from RCPT TO is not actually clear-cut. A 251 may be - returned if the message was forwarded to another address. This could be a - useful indicator to end-users that an address should be updated. - * RCPT TO can accpet just "postmaster" without a domain name - * Server MUST not close connection before: - - QUIT and returning 221 response - - Forced requirement, and only after returning a 421 response - - Clients expriencing a forced connection closure, without prior warning should - just treat it like a 451 closure regardless - * ALWAYS use blocking sockets for the initial connection (this should prevent - Exim4's whining about sync). - -Response codes --------------- - * From RFC2821, 4.2. - - In particular, the 220, 221, 251, 421, and 551 reply codes - are associated with message text that must be parsed and interpreted - by machines. - -Error Codes ------------- - * Numeric 5yz = Error - - 550/RCPT TO = Relay denied - - 500 = Unknown command - * Numeric 2yz = Normal - * Numeric 4yz = Temporary failure?? - - - - Swift - pear.swiftmailer.org - Free Feature-rich PHP Mailer. - - Swift Mailer integrates into any web app written in PHP 5, offering a flexible and elegant object-oriented approach to sending emails with a multitude of features. - - - Fabien Potencier - fabpot - fabien.potencier@symfony-project.org - yes - - - Chris Corbyn - d11wtq - - no - - {{ date }} - - - {{ version }} - {{ api_version }} - - - {{ stability }} - {{ stability }} - - LGPL - - - - - - - - - - - - - - - - - - - - - - -{{ files }} - - - - - - - - - 5.2.4 - - - 1.4.0 - - - - - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/CHANGES b/vendor/swiftmailer/swiftmailer/test-suite/CHANGES deleted file mode 100644 index 6229a4c..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/CHANGES +++ /dev/null @@ -1,7 +0,0 @@ -Sweety SimpleTest Front-end, Version 0.1 - beta ------------------------------------------------ - -17th November 2007, 0.1b: - Finished initial draft, giving up on dealing with invalid XML for now since - $test->dump() should be used for output where needed. Will address this again - later. diff --git a/vendor/swiftmailer/swiftmailer/test-suite/LICENSE b/vendor/swiftmailer/swiftmailer/test-suite/LICENSE deleted file mode 100644 index fc8a5de..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/LICENSE +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/vendor/swiftmailer/swiftmailer/test-suite/README b/vendor/swiftmailer/swiftmailer/test-suite/README deleted file mode 100644 index 6348255..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/README +++ /dev/null @@ -1,159 +0,0 @@ -Sweety SimpleTest Suite ------------------------ - -Sweety is a wrapper around SimpleTest's XML reporting capabilities which -makes unit tests easier to manage and friendlier to run. - -Tests are run in a grouped fashion, but each individual test runs in its own -environment and own memory space either via forking new PHP processes, or by -making new HTTP requests. - -Sweety works with any vanilla version of SimpleTest since the XmlReporter was -added. - -Tests can be run on command line, in an AJAX equipped web browser*, or in a -web browser with javascript turned off. - - * Sweety has been tested with success in the following browsers: - - - Mozilla Firefox 2.0 - - Safari 3-beta - - Internet Explorer 7 - - Opera 9 - - -Configuring Sweety: --------------------- - -All Sweety configuration is contained inside the config.php file, defined as -constants for the mostpart. - -Make sure you at least indicate a path to a directory containing SimpleTest, -and also change the SWEETY_INCLUDE_PATH and SWEETY_TEST_PATH to fit your needs. - -Paths are provided using the directory separator for your OS. Use the PHP -constant PATH_SEPARATOR if you need to run in different environments. - -If you have test cases in directories /webdev/tests/unit and -/webdev/tests/integration your SWEETY_TEST_PATH should look like: - -define('SWEETY_TEST_PATH', '/webdev/tests/unit' . PATH_SEPARATOR . - '/webdev/tests/integration'); - -If you want to run Sweety on the command line you'll need to specify the path -to your PHP executable (typically /usr/bin/php). Sweety needs to be able to -fork new processes using this executable. - - -What to do if your naming scheme doesn't use PEAR conventions: --------------------------------------------------------------- - -By default Sweety looks for classes using PEAR naming conventions. If you use -some other naming convention you need to tell Sweety how to find your test cases. - -This is a two step process: - -1) Write a new Sweety_TestLocator -- don't worry, it's easy! - - Refer to the interface in lib/Sweety/TestLocator.php for guidance on what - your TestLocator needs to include (just two methods for searching and including). - -2) Add it to your config.php. - - Once you've written a new TestLocator which works for your naming scheme, - change the config value SWEETY_TEST_LOCATOR to the name of your new class, then - include the class file somewhere inside the config.php. If you use multiple class - naming conventions, list your TestLocators as a comma separated string. - - -Making tests appear in Sweety's interface: -------------------------------------------- - -No really, you just edit the configuration and they'll show up if a TestLocator -can find them ;) - - -Running sweety on the command line: ------------------------------------ - -Interacting with Sweety on the command line you'll get almost as much detail -as you do in a web browser, although the formatting obviously isn't so pretty! - -All operations are handled by the file named run.php in the sweety installation -directory. - - -bash$ php run.php #runs all tests - -bash$ php run.php Name_Of_TestClass #runs a single test case - -bash$ php run.php Name_Of_TestClass xml #runs a single test case in XML - - - -Runing Sweety with AJAX: -------------------------- - -Open up an AJAX equipped web browsers (preferably supporting DOM 3 XPath, but at -least support basic DOM). Navigate to the index.php file at the installation -directory of Sweety. You'll see the screen is divided into two sections, left -and right. On the left there's a list of test cases which you can click to run. -On the right you get all the verbose output from running the tests. - -Clicking the "Run Tests" button will run all tests you can currently see in -the list. As each test runs, a request is sent to the web server to get -SimpleTest to run your test case. If the test passes the test case will turn -green, if it fails it will turn red. Tests go yellow until a final conclusion -is drawn. - -If you need to stop the tests at any time just click the button again (it -should say "Stop Tests" whilst the tests run). - -Whilst the tests run, the large bar to the right of the screen will tally -up aggregated results and will eventually go either green or red indicating -a pass or failure. Failed assertion messages will appear in the page just like -they do with the HtmlReporter of SimpleTest. - -Clicking a single test case will run just that test in isolation. If you want -(or need?) to run the test with SimpleTest's HtmlReporter just click the -HTML Icon (little world image) next to the test case. Tests can also be run in -XML if needed. - -Above the list of tests there's a filter box which can be directly typed into. -Typing in here narrows down the list of testcases to show only the ones which -match the search query. - -Refreshing the page with your browser's refresh button will reset the test suite. - -When you change your code, you DO NOT need to refesh your browser window. Just -click the "Run Tests" button, or click the individual test to refresh the results. - -If you add a new test case you will need to refresh your browser window however. - - -Running Sweety without JavaScript: ----------------------------------- - -If your web browser has JavaScript disabled you can still use the HTML version -of the test suite. Open up the index.php file in your web browser. - -You'll see the screen is divided into two sections, left -and right. On the left there's a list of test cases with checkboxes next to them -which you can check to run. On the right you get all the verbose output from -running the tests. - -Clicking the "Run Tests" button will run all the currently selected test cases. -This could take a long time depending upon how many tests you have to run, -but once complete you'll see the page again where the tests you selected will -either be red or green indicating a pass or failure. The bar at the right of -the screen will contain aggregate results for all the tests and will be either -red or green to indicate an overall pass or failure. - -Assertion messages appear in the page just like with SimpleTest's HtmlReporter. - -If you want to run just a single test case, click the "Run" icon at the right -of the test (little running man image). - -You can run tests with SimpleTest's HtmlReporter by clicking the HTML icon -(little world image) next to the test case. Tests can be run in XML if needed -too. - -Enjoy! - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/config.php b/vendor/swiftmailer/swiftmailer/test-suite/config.php deleted file mode 100644 index c363b03..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/config.php +++ /dev/null @@ -1,68 +0,0 @@ -setReporter(new Sweety_Reporter_HtmlReporter()); - -$runner->setIgnoredClassRegex(SWEETY_IGNORED_CLASSES); - -$locators = preg_split('/\s*,\s*/', SWEETY_TEST_LOCATOR); -foreach ($locators as $locator) -{ - $runner->registerTestLocator(new $locator()); -} - -if (isset($_GET['test'])) -{ - $testName = $_GET['test']; - $format = isset($_GET['format']) ? $_GET['format'] : Sweety_Runner::REPORT_HTML; - - $runner->runTestCase($testName, $format); -} -else -{ - $runner->runAllTests(); -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Reporter.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Reporter.php deleted file mode 100644 index 345bdc0..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Reporter.php +++ /dev/null @@ -1,69 +0,0 @@ -_name = $name; - $this->_aggregates = array( - 'cases' => 0, - 'run' => 0, - 'passes' => 0, - 'fails' => 0, - 'exceptions' => 0 - ); - } - - /** - * Used so test case reporters can notify this reporter when they've completed. - * @param string $testCase - */ - public function notifyEnded($testCase) - { - $this->_aggregates['run']++; - } - - /** - * Get the reporter used to report on this specific test case. - * @param string $testCase - * @return Sweety_Reporter - */ - public function getReporterFor($testCase) - { - $this->_aggregates['cases']++; - - $reporter = new Sweety_Reporter_CliTestCaseReporter($testCase, $this); - return $reporter; - } - - /** - * Returns true if start() has been invoked. - * @return boolean - */ - public function isStarted() - { - return $this->_started; - } - - /** - * Start reporting. - */ - public function start() - { - $this->_started = true; - echo $this->_name . PHP_EOL; - } - - /** - * Report a skipped test case. - * @param string $message - * @param string $path - */ - public function reportSkip($message, $path) - { - echo " \033[34m\033[1m\033[4mSkip\033[0m:"; - $messageLines = explode(PHP_EOL, wordwrap($message, 74, PHP_EOL)); - foreach ($messageLines as $line) - { - echo ' ' . $line . PHP_EOL; - } - echo ' in: ' . $path . PHP_EOL; - } - - /** - * Report a passing assertion. - * @param string $message - * @param string $path - */ - public function reportPass($message, $path) - { - $this->_aggregates['passes']++; - } - - /** - * Report a failing assertion. - * @param string $message - * @param string $path - */ - public function reportFail($message, $path) - { - $this->_aggregates['fails']++; - - echo "\033[31m" . $this->_aggregates['fails'] . ') '; - echo $message . "\033[0m" . PHP_EOL; - echo ' in: ' . $path . PHP_EOL; - } - - /** - * Report an unexpected exception. - * @param string $message - * @param string $path - */ - public function reportException($message, $path) - { - $this->_aggregates['exceptions']++; - - echo "\033[31m\033[1mException" . $this->_aggregates['exceptions'] . "\033[0m!" . PHP_EOL; - echo "\033[1m" . $message . "\033[0m" . PHP_EOL; - echo ' in ' . $path . PHP_EOL; - } - - /** - * Report output from something like a dump(). - * @param string $output - * @param string $path - */ - public function reportOutput($output, $path) - { - if (preg_match('/^\{image @ (.*?)\}$/D', $output, $matches)) - { - echo " \033[33mSmoke Test\033[0m" . PHP_EOL; - echo ' Compare email sent with image @ ' . $matches[1] . PHP_EOL; - } - else - { - echo '--------------------' . PHP_EOL; - echo $output . PHP_EOL; - echo '--------------------' . PHP_EOL; - } - } - - /** - * End reporting. - */ - public function finish() - { - $this->_started = false; - - $incomplete = $this->_aggregates['cases'] - $this->_aggregates['run']; - - if ($incomplete) - { - echo '**********************' . PHP_EOL; - echo $incomplete . ' test case(s) did not complete.' . PHP_EOL . - 'This may be because invalid XML was output during the test run' . PHP_EOL . - 'and/or because an error occured.' . PHP_EOL . - 'Try running the tests separately for more detail.' . PHP_EOL; - echo '**********************' . PHP_EOL; - } - - $success = (!$this->_aggregates['fails'] && !$this->_aggregates['exceptions'] - && $this->_aggregates['cases'] == $this->_aggregates['run']); - - if ($success) - { - echo "\033[32m\033[1mOK\033[0m" . PHP_EOL; - } - else - { - echo "\033[31m\033[1mFAILURES!!!\033[0m" . PHP_EOL; - } - - echo 'Test cases run: '; - echo $this->_aggregates['run'] . '/' . $this->_aggregates['cases'] . ', '; - echo 'Passes: ' . $this->_aggregates['passes'] . ', '; - echo 'Failures: ' . $this->_aggregates['fails'] . ', '; - echo 'Exceptions: '. $this->_aggregates['exceptions'] . PHP_EOL; - - exit((int) !$success); - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Reporter/CliTestCaseReporter.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Reporter/CliTestCaseReporter.php deleted file mode 100644 index ba23834..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Reporter/CliTestCaseReporter.php +++ /dev/null @@ -1,160 +0,0 @@ -_parent = $parent; - $this->_testCase = $testCase; - $this->_aggregates = array( - 'passes' => 0, - 'fails' => 0, - 'exceptions' => 0 - ); - } - - /** - * Get the reporter used to report on this specific test case. - * This method is stubbed only to return itself. - * @param string $testCase - * @return Sweety_Reporter - */ - public function getReporterFor($testCase) - { - return $this; - } - - /** - * Returns true if start() has been invoked. - * @return boolean - */ - public function isStarted() - { - return $this->_started; - } - - /** - * Start reporting. - */ - public function start() - { - $this->_started = true; - } - - /** - * Report a skipped test case. - * @param string $message - * @param string $path - */ - public function reportSkip($message, $path) - { - $this->_parent->reportSkip($message, $path); - } - - /** - * Report a passing assertion. - * @param string $message - * @param string $path - */ - public function reportPass($message, $path) - { - $this->_aggregates['passes']++; - $this->_parent->reportPass($message, $path); - } - - /** - * Report a failing assertion. - * @param string $message - * @param string $path - */ - public function reportFail($message, $path) - { - $this->_aggregates['fails']++; - $this->_parent->reportFail($message, $path); - } - - /** - * Report an unexpected exception. - * @param string $message - * @param string $path - */ - public function reportException($message, $path) - { - $this->_aggregates['exceptions']++; - $this->_parent->reportException($message, $path); - } - - /** - * Report output from something like a dump(). - * @param string $output - * @param string $path - */ - public function reportOutput($output, $path) - { - $this->_parent->reportOutput($output, $path); - } - - /** - * End reporting. - */ - public function finish() - { - $this->_started = false; - - if (!$this->_aggregates['fails'] && !$this->_aggregates['exceptions']) - { - echo ' >> ' . $this->_testCase . ' '; - echo "\033[32mOK\033[0m" . PHP_EOL; - } - else - { - echo ' !! ' . $this->_testCase . ' '; - echo "\033[31mFAILED\033[0m" . PHP_EOL; - } - - $this->_parent->notifyEnded($this->_testCase); - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Reporter/HtmlReporter.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Reporter/HtmlReporter.php deleted file mode 100644 index 6a15339..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Reporter/HtmlReporter.php +++ /dev/null @@ -1,174 +0,0 @@ -_tplVars =& $vars; - } - - /** - * Used so test case reporters can notify this reporter when they've completed. - * @param string $testCase - */ - public function notifyEnded($testCase) - { - $this->_tplVars['runTests'][] = $testCase; - $this->_tplVars['runCount']++; - } - - /** - * Get the reporter used to report on this specific test case. - * @param string $testCase - * @return Sweety_Reporter - */ - public function getReporterFor($testCase) - { - $this->_tplVars['caseCount']++; - - $reporter = new Sweety_Reporter_HtmlTestCaseReporter($testCase, $this); - $reporter->setTemplateVars($this->_tplVars); - return $reporter; - } - - /** - * Returns true if start() has been invoked. - * @return boolean - */ - public function isStarted() - { - return $this->_started; - } - - /** - * Start reporting. - */ - public function start() - { - $this->_started = true; - } - - /** - * Report a skipped test case. - * @param string $message - * @param string $path - */ - public function reportSkip($message, $path) - { - $this->_tplVars['messages'][] = array( - 'type' => 'skip', - 'path' => $path, - 'text' => $message); - } - - /** - * Report a passing assertion. - * @param string $message - * @param string $path - */ - public function reportPass($message, $path) - { - $this->_tplVars['passCount']++; - } - - /** - * Report a failing assertion. - * @param string $message - * @param string $path - */ - public function reportFail($message, $path) - { - $this->_tplVars['failCount']++; - $this->_tplVars['messages'][] = array( - 'type' => 'fail', - 'path' => $path, - 'text' => $message); - } - - /** - * Report an unexpected exception. - * @param string $message - * @param string $path - */ - public function reportException($message, $path) - { - $this->_tplVars['exceptionCount']++; - $this->_tplVars['messages'][] = array( - 'type' => 'exception', - 'path' => $path, - 'text' => $message); - } - - /** - * Report output from something like a dump(). - * @param string $output - * @param string $path - */ - public function reportOutput($output, $path) - { - $this->_tplVars['messages'][] = array( - 'type' => 'output', - 'path' => $path, - 'text' => $output); - } - - /** - * End reporting. - */ - public function finish() - { - $this->_started = false; - - if (!$this->_tplVars['failCount'] && !$this->_tplVars['exceptionCount'] - && $this->_tplVars['caseCount'] == $this->_tplVars['runCount']) - { - $this->_tplVars['result'] = 'pass'; - } - else - { - $this->_tplVars['result'] = 'fail'; - } - - $incomplete = $this->_tplVars['caseCount'] - $this->_tplVars['runCount']; - - if (0 < $incomplete) - { - $this->_tplVars['messages'][] = array( - 'type' => 'internal', - 'path' => '', - 'text' => $incomplete . ' test case(s) did not complete.' . - ' This may be because invalid XML was output during the test run' . - ' and/or because an error occured.' . - ' Incomplete test cases are shown in yellow. Click the HTML link ' . - 'next to the test for more detail.' - ); - } - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Reporter/HtmlTestCaseReporter.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Reporter/HtmlTestCaseReporter.php deleted file mode 100644 index 8d4474d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Reporter/HtmlTestCaseReporter.php +++ /dev/null @@ -1,174 +0,0 @@ -_parent = $parent; - $this->_testCase = $testCase; - $this->_aggregates = array( - 'passes' => 0, - 'fails' => 0, - 'exceptions' => 0 - ); - } - - /** - * Set template data. - * @param mixed[] - */ - public function setTemplateVars(&$vars) - { - $this->_tplVars =& $vars; - } - - /** - * Get the reporter used to report on this specific test case. - * This method is stubbed only to return itself. - * @param string $testCase - * @return Sweety_Reporter - */ - public function getReporterFor($testCase) - { - return $this; - } - - /** - * Returns true if start() has been invoked. - * @return boolean - */ - public function isStarted() - { - return $this->_started; - } - - /** - * Start reporting. - */ - public function start() - { - $this->_started = true; - $this->_tplVars['runTests'][$this->_testCase] = 'running'; - } - - /** - * Report a skipped test case. - * @param string $message - * @param string $path - */ - public function reportSkip($message, $path) - { - $this->_parent->reportSkip($message, $path); - } - - /** - * Report a passing assertion. - * @param string $message - * @param string $path - */ - public function reportPass($message, $path) - { - $this->_aggregates['passes']++; - $this->_parent->reportPass($message, $path); - } - - /** - * Report a failing assertion. - * @param string $message - * @param string $path - */ - public function reportFail($message, $path) - { - $this->_aggregates['fails']++; - $this->_parent->reportFail($message, $path); - } - - /** - * Report an unexpected exception. - * @param string $message - * @param string $path - */ - public function reportException($message, $path) - { - $this->_aggregates['exceptions']++; - $this->_parent->reportException($message, $path); - } - - /** - * Report output from something like a dump(). - * @param string $output - * @param string $path - */ - public function reportOutput($output, $path) - { - $this->_parent->reportOutput($output, $path); - } - - /** - * End reporting. - */ - public function finish() - { - $this->_started = false; - - if (!$this->_aggregates['fails'] && !$this->_aggregates['exceptions']) - { - $this->_tplVars['runTests'][$this->_testCase] = 'pass'; - } - else - { - $this->_tplVars['runTests'][$this->_testCase] = 'fail'; - } - - $this->_parent->notifyEnded($this->_testCase); - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Runner.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Runner.php deleted file mode 100644 index b07ddb4..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Runner.php +++ /dev/null @@ -1,56 +0,0 @@ -_reporter = $reporter; - } - - /** - * Get the reporter used for showing results. - * @return Sweety_Reporter - */ - public function getReporter() - { - return $this->_reporter; - } - - /** - * Register a test locator instance. - * @param Sweety_TestLocator $locator - */ - public function registerTestLocator(Sweety_TestLocator $locator) - { - $this->_testLocators[] = $locator; - } - - /** - * Set the regular expression used to filter out certain class names. - * @param string $ignoredClassRegex - */ - public function setIgnoredClassRegex($ignoredClassRegex) - { - $this->_ignoredClassRegex = $ignoredClassRegex; - } - - /** - * Get the filtering regular expression for ignoring certain classes. - * @return string - */ - public function getIgnoredClassRegex() - { - return $this->_ignoredClassRegex; - } - - /** - * Run a single test case with the given name, using the provided output format. - * @param string $testName - * @param string $format (xml, text or html) - * @return int - */ - public function runTestCase($testName, $format = Sweety_Runner::REPORT_TEXT) - { - foreach ($this->_testLocators as $locator) - { - if ($locator->includeTest($testName)) - { - break; - } - } - - $testClass = new ReflectionClass($testName); - if ($testClass->getConstructor()) - { - //We don't want test output to be cached - if (!SimpleReporter::inCli()) - { - header("Cache-Control: no-cache, must-revalidate"); - header("Pragma: no-cache"); - header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); - } - - switch ($format) - { - case Sweety_Runner::REPORT_HTML: - $reporter = new HtmlReporter(); - break; - case Sweety_Runner::REPORT_XML: - if (!SimpleReporter::inCli()) - { - header("Content-Type: text/xml"); //Sigh! SimpleTest (skip() issues). - } - $reporter = new XmlReporter(); - break; - case Sweety_Runner::REPORT_TEXT: - default: - $reporter = new TextReporter(); - break; - } - $test = $testClass->newInstance(); - return $test->run($reporter) ? 0 : 1; - } - - return 1; - } - - /** - * Use strategies to find tests which are runnable. - * @param string[] $dirs - * @return string[] - */ - protected function findTests($dirs = array()) - { - $tests = array(); - foreach ($this->_testLocators as $locator) - { - $tests += $locator->getTests($dirs); - } - return $tests; - } - - /** - * Parse an XML response from a test case an report to the reporter. - * @param string $xml - * @param string $testCase - */ - protected function parseXml($xml, $testCase) - { - $reporter = $this->_reporter->getReporterFor($testCase); - if (!$reporter->isStarted()) - { - $reporter->start(); - } - - $xml = str_replace("\0", '?', trim($xml)); - $xml = preg_replace('/[^\x01-\x7F]/e', 'sprintf("&#%d;", ord("$0"));', $xml); //Do something better? - if (!empty($xml)) - { - $document = @simplexml_load_string($xml); - if ($document) - { - $this->_parseDocument($document, $testCase, $reporter); - $reporter->finish(); - return; - } - } - - $reporter->reportException( - 'Invalid XML response: ' . - trim(strip_tags( - preg_replace('/^\s*<\?xml.+<\/(?:name|pass|fail|exception)>/s', '', $xml) - )), - $testCase - ); - } - - /** - * Parse formatted test output. - * @param SimpleXMLElement The node containing the output - * @param string $path to this test method - * @access private - */ - private function _parseFormatted(SimpleXMLElement $formatted, $path = '', - Sweety_Reporter $reporter) - { - $reporter->reportOutput((string)$formatted, $path); - } - - /** - * Parse test output. - * @param SimpleXMLElement The node containing the output - * @param string $path to this test method - * @access private - */ - private function _parseMessage(SimpleXMLElement $message, $path = '', - Sweety_Reporter $reporter) - { - $reporter->reportOutput((string)$message, $path); - } - - /** - * Parse a test failure. - * @param SimpleXMLElement The node containing the fail - * @param string $path to this test method - * @access private - */ - private function _parseFailure(SimpleXMLElement $failure, $path = '', - Sweety_Reporter $reporter) - { - $reporter->reportFail((string)$failure, $path); - } - - /** - * Parse an exception. - * @param SimpleXMLElement The node containing the exception - * @param string $path to this test method - * @access private - */ - private function _parseException(SimpleXMLElement $exception, $path = '', - Sweety_Reporter $reporter) - { - $reporter->reportException((string)$exception, $path); - } - - /** - * Parse a pass. - * @param SimpleXMLElement The node containing this pass. - * @param string $path to this test method - * @access private - */ - private function _parsePass(SimpleXMLElement $pass, $path = '', - Sweety_Reporter $reporter) - { - $reporter->reportPass((string)$pass, $path); - } - - /** - * Parse a single test case. - * @param SimpleXMLElement The node containing the test case - * @param string $path to this test case - * @access private - */ - private function _parseTestCase(SimpleXMLElement $testCase, $path = '', - Sweety_Reporter $reporter) - { - foreach ($testCase->xpath('./test') as $testMethod) - { - $testMethodName = (string) $this->_firstNodeValue($testMethod->xpath('./name')); - - foreach ($testMethod->xpath('./formatted') as $formatted) - { - $this->_parseFormatted( - $formatted, $path . ' -> ' . $testMethodName, $reporter); - } - - foreach ($testMethod->xpath('./message') as $message) - { - $this->_parseMessage( - $message, $path . ' -> ' . $testMethodName, $reporter); - } - - foreach ($testMethod->xpath('./fail') as $failure) - { - $this->_parseFailure( - $failure, $path . ' -> ' . $testMethodName, $reporter); - } - - foreach ($testMethod->xpath('./exception') as $exception) - { - $this->_parseException( - $exception, $path . ' -> ' . $testMethodName, $reporter); - } - - foreach ($testMethod->xpath('./pass') as $pass) - { - $this->_parsePass($pass, $path . ' -> ' . $testMethodName, $reporter); - } - - $stdout = trim((string) $testMethod); - if ($stdout) - { - $reporter->reportOutput($stdout, $path . ' -> ' . $testMethodName); - } - } - } - - /** - * Parse the results of all tests. - * @param SimpleXMLElement The node containing the tests - * @param string $path to the tests - * @access private - */ - private function _parseResults(SimpleXMLElement $document, $path = '', - Sweety_Reporter $reporter) - { - $groups = $document->xpath('./group'); - if (!empty($groups)) - { - foreach ($groups as $group) - { - $groupName = (string) $this->_firstNodeValue($group->xpath('./name')); - $this->_parseResults($group, $path . ' -> ' . $groupName, $reporter); - } - } - else - { - foreach ($document->xpath('./case') as $testCase) - { - $this->_parseTestCase($testCase, $path, $reporter); - } - } - } - - /** - * Parse the entire SimpleTest XML document from a test case. - * @param SimpleXMLElement $document to parse - * @param string $path to the test - * @access private - */ - private function _parseDocument(SimpleXMLElement $document, $path = '', - Sweety_Reporter $reporter) - { - if ($everything = $this->_firstNodeValue($document->xpath('/run'))) - { - $this->_parseResults($everything, $path, $reporter); - } - elseif ($skip = $this->_firstNodeValue($document->xpath('/skip'))) - { - $reporter->reportSkip((string) $skip, $path); - } - } - - protected function _sort($a, $b) - { - $apkg = preg_replace('/_[^_]+$/D', '', $a); - $bpkg = preg_replace('/_[^_]+$/D', '', $b); - if ($apkg == $bpkg) - { - if ($a == $b) - { - return 0; - } - else - { - return ($a > $b) ? 1 : -1; - } - } - else - { - return ($apkg > $bpkg) ? 1 : -1; - } - } - - private function _firstNodeValue($nodeSet) - { - $first = array_shift($nodeSet); - return $first; - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Runner/CliRunner.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Runner/CliRunner.php deleted file mode 100644 index c3e4026..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Runner/CliRunner.php +++ /dev/null @@ -1,128 +0,0 @@ -_dirs = $dirs; - $this->_command = $command; - } - - /** - * Runs all test cases found under the given directories. - * @param string[] $directories to scan for test cases - * @param string To be prepended to class names - * @return int - */ - public function runAllTests($dirs = array()) - { - if (empty($dirs)) - { - $dirs = $this->_dirs; - } - - $reporter = $this->getReporter(); - - if (!$reporter->isStarted()) - { - $reporter->start(); - } - - $tests = $this->findTests($dirs); - usort($tests, array($this, '_sort')); - - global $argv; - - if (!empty($argv[1])) - { - if (substr($argv[1], 0, 1) == '!') - { - $argv[1] = substr($argv[1], 1); - foreach ($tests as $index => $name) - { - if (@preg_match($argv[1] . 'i', $name)) - { - unset($tests[$index]); - } - } - } - else - { - foreach ($tests as $index => $name) - { - if (!@preg_match($argv[1] . 'i', $name)) - { - unset($tests[$index]); - } - } - } - } - - $ret = $this->_runTestList($tests); - - $reporter->finish(); - - return $ret; - } - - /** - * Run all possible tests from the given list. - * @param string[] $tests - * @return int - */ - protected function _runTestList(array $tests) - { - foreach ($tests as $testCase) - { - if (preg_match($this->getIgnoredClassRegex(), $testCase)) - { - continue; - } - - $command = $this->_command; - $command .= ' ' . $testCase; - $command .= ' ' . Sweety_Runner::REPORT_XML; - - exec($command, $output, $status); - - $xml = implode(PHP_EOL, $output); - - $this->parseXml($xml, $testCase); - - unset($status); - unset($output); - } - - return 0; - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Runner/HtmlRunner.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Runner/HtmlRunner.php deleted file mode 100644 index e115692..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/Runner/HtmlRunner.php +++ /dev/null @@ -1,160 +0,0 @@ -_dirs = $dirs; - $this->_template = $template; - $this->_name = $name; - } - - /** - * Runs all test cases found under the given directories. - * @param string[] $directories to scan for test cases - * @param string To be prepended to class names - * @return int - */ - public function runAllTests($dirs = array()) - { - //We don't want test output to be cached - header("Cache-Control: no-cache, must-revalidate"); - header("Pragma: no-cache"); - header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); - - if (empty($dirs)) - { - $dirs = $this->_dirs; - } - - $testCases = $this->findTests($dirs); - foreach ($testCases as $k => $testCase) - { - if (preg_match($this->getIgnoredClassRegex(), $testCase)) - { - unset($testCases[$k]); - } - } - - usort($testCases, array($this, '_sort')); - - $vars = array( - //String - 'testCases' => $testCases, - //String - 'suiteName' => $this->_name, - // testCase => pass | fail | running - 'runTests' => array(), - //Integer - 'caseCount' => 0, - //Integer - 'runCount' => 0, - //Integer - 'passCount' => 0, - //Integer - 'failCount' => 0, - //Integer - 'exceptionCount' => 0, - // type => pass | fail | exception | output | internal, path => testCase, text => ... - 'messages' => array(), - // pass | fail - 'result' => 'idle' - ); - - if (isset($_REQUEST['runtests'])) - { - $reporter = $this->getReporter(); - $reporter->setTemplateVars($vars); - - if (!$reporter->isStarted()) - { - $reporter->start(); - } - - $this->_runTestList((array)$_REQUEST['runtests'], $reporter); - - $reporter->finish(); - } - else - { - foreach ($testCases as $testCase) - { - $vars['runTests'][$testCase] = 'idle'; //Show all checked by default - } - } - - $this->_render($vars); - } - - /** - * Run tests in the given array using the REST API (kind of). - * @param string[] $tests - * @param Sweety_Reporter $reporter - * @return int - */ - protected function _runTestList(array $tests, Sweety_Reporter $reporter) - { - $protocol = !empty($_SERVER['HTTPS']) ? 'https://' : 'http://'; - - //Most likely a HTTP/1.0 server not supporting HOST header - $server = !empty($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : '127.0.0.1'; - - $path = '/'; - if (!empty($_SERVER['REQUEST_URI'])) - { - $path = preg_replace('/\?.*$/sD', '', $_SERVER['REQUEST_URI']); - } - - $baseUrl = $protocol . $server . $path; - - foreach ($tests as $testCase) - { - $url = $baseUrl . '?test=' . $testCase . '&format=xml'; - $xml = file_get_contents($url); - $this->parseXml($xml, $testCase); - } - - return 0; - } - - /** - * Renders the view for the suite. - * @param string[] $templateVars - */ - protected function _render($vars = array()) - { - foreach ($vars as $k => $v) - { - $$k = $v; - } - - require_once $this->_template; - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/TestLocator.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/TestLocator.php deleted file mode 100644 index 96e4649..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/Sweety/TestLocator.php +++ /dev/null @@ -1,25 +0,0 @@ -_findTestCases($dirs); - } - - public function includeTest($testCase) - { - $file = str_replace('_', '/', $testCase) . '.php'; - foreach (explode(PATH_SEPARATOR, get_include_path()) as $dir) - { - if (is_file($dir . '/' . $file)) - { - require_once $dir . '/' . $file; - return true; - } - } - - return false; - } - - protected function _findTestCases($dirs = array(), $prepend = '') - { - $ret = array(); - - foreach ($dirs as $dir) - { - if (array_key_exists($dir, $this->_testCache)) - { - $ret += $this->_testCache[$dir]; - continue; - } - - $this->_testCache[$dir] = array(); - - $handle = opendir($dir); - while (false !== $file = readdir($handle)) - { - if (substr($file, 0, 1) != '.' && is_dir($dir . '/' . $file)) - { - foreach ($this->_findTestCases( - array($dir . '/' . $file), $prepend . $file . '_') as $add) - { - $this->_testCache[$dir][] = $add; - $ret[] = $add; - } - } - elseif (substr($file, -4) == '.php') - { - $className = $prepend . basename($file, '.php'); - $this->_testCache[$dir][] = $className; - $ret[] = $className; - } - } - closedir($handle); - } - - sort($ret); - - return $ret; - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/HELP_MY_TESTS_DONT_WORK_ANYMORE b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/HELP_MY_TESTS_DONT_WORK_ANYMORE deleted file mode 100644 index d99acd8..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/HELP_MY_TESTS_DONT_WORK_ANYMORE +++ /dev/null @@ -1,383 +0,0 @@ -Simple Test interface changes -============================= -Because the SimpleTest tool set is still evolving it is likely that tests -written with earlier versions will fail with the newest ones. The most -dramatic changes are in the alpha releases. Here is a list of possible -problems and their fixes... - -Fatal error: Call to undefined method Classname::classname() ------------------------------------------------------------- -SimpleTest renamed all of its constructors from -Classname to __construct; derived classes invoking -their parent constructors should replace parent::Classname() -with parent::__construct(). - -Custom CSS in HtmlReporter not being applied --------------------------------------------- -Batch rename of protected and private methods -means that _getCss() was renamed to getCss(); -replace your function definition accordingly. - -setReturnReference() throws errors in E_STRICT ----------------------------------------------- -Happens when an object is passed by reference. -This also happens with setReturnReferenceAt(). -If you want to return objects then replace these -with calls to returns() and returnsAt() with the -same arguments. This change was forced in the 1.1 -version for E_STRICT compatibility. - -assertReference() throws errors in E_STRICT -------------------------------------------- -Due to language restrictions you cannot compare -both variables and objects in E_STRICT mode. Use -assertSame() in this mode with objects. This change -was forced the 1.1 version. - -Cannot create GroupTest ------------------------ -The GroupTest has been renamed TestSuite (see below). -It was removed completely in 1.1 in favour of this -name. - -No method getRelativeUrls() or getAbsoluteUrls() ------------------------------------------------- -These methods were always a bit weird anyway, and -the new parsing of the base tag makes them more so. -They have been replaced with getUrls() instead. If -you want the old functionality then simply chop -off the current domain from getUrl(). - -Method setWildcard() removed in mocks -------------------------------------- -Even setWildcard() has been removed in 1.0.1beta now. -If you want to test explicitely for a '*' string, then -simply pass in new IdenticalExpectation('*') instead. - -No method _getTest() on mocks ------------------------------ -This has finally been removed. It was a pretty esoteric -flex point anyway. It was there to allow the mocks to -work with other test tools, but no one does this. - -No method assertError(), assertNoErrors(), swallowErrors() ----------------------------------------------------------- -These have been deprecated in 1.0.1beta in favour of -expectError() and expectException(). assertNoErrors() is -redundant if you use expectError() as failures are now reported -immediately. - -No method TestCase::signal() ----------------------------- -This has been deprecated in favour of triggering an error or -throwing an exception. Deprecated as of 1.0.1beta. - -No method TestCase::sendMessage() ---------------------------------- -This has been deprecated as of 1.0.1beta. - -Failure to connect now emits failures -------------------------------------- -It used to be that you would have to use the -getTransferError() call on the web tester to see if -there was a socket level error in a fetch. This check -is now always carried out by the WebTestCase unless -the fetch is prefaced with WebTestCase::ignoreErrors(). -The ignore directive only lasts for test case fetching -action such as get() and click(). - -No method SimpleTestOptions::ignore() -------------------------------------- -This is deprecated in version 1.0.1beta and has been moved -to SimpleTest::ignore() as that is more readable. In -addition, parent classes are also ignored automatically. -If you are using PHP5 you can skip this directive simply -by marking your test case as abstract. - -No method assertCopy() ----------------------- -This is deprecated in 1.0.1 in favour of assertClone(). -The assertClone() method is slightly different in that -the objects must be identical, but without being a -reference. It is thus not a strict inversion of -assertReference(). - -Constructor wildcard override has no effect in mocks ----------------------------------------------------- -As of 1.0.1beta this is now set with setWildcard() instead -of in the constructor. - -No methods setStubBaseClass()/getStubBaseClass() ------------------------------------------------- -As mocks are now used instead of stubs, these methods -stopped working and are now removed as of the 1.0.1beta -release. The mock objects may be freely used instead. - -No method addPartialMockCode() ------------------------------- -The ability to insert arbitrary partial mock code -has been removed. This was a low value feature -causing needless complications. It was removed -in the 1.0.1beta release. - -No method setMockBaseClass() ----------------------------- -The ability to change the mock base class has been -scheduled for removal and is deprecated since the -1.0.1beta version. This was a rarely used feature -except as a workaround for PHP5 limitations. As -these limitations are being resolved it's hoped -that the bundled mocks can be used directly. - -No class Stub -------------- -Server stubs are deprecated from 1.0.1 as the mocks now -have exactly the same interface. Just use mock objects -instead. - -No class SimpleTestOptions --------------------------- -This was replced by the shorter SimpleTest in 1.0.1beta1 -and is since deprecated. - -No file simple_test.php ------------------------ -This was renamed test_case.php in 1.0.1beta to more accurately -reflect it's purpose. This file should never be directly -included in test suites though, as it's part of the -underlying mechanics and has a tendency to be refactored. - -No class WantedPatternExpectation ---------------------------------- -This was deprecated in 1.0.1alpha in favour of the simpler -name PatternExpectation. - -No class NoUnwantedPatternExpectation -------------------------------------- -This was deprecated in 1.0.1alpha in favour of the simpler -name NoPatternExpectation. - -No method assertNoUnwantedPattern() ------------------------------------ -This has been renamed to assertNoPattern() in 1.0.1alpha and -the old form is deprecated. - -No method assertWantedPattern() -------------------------------- -This has been renamed to assertPattern() in 1.0.1alpha and -the old form is deprecated. - -No method assertExpectation() ------------------------------ -This was renamed as assert() in 1.0.1alpha and the old form -has been deprecated. - -No class WildcardExpectation ----------------------------- -This was a mostly internal class for the mock objects. It was -renamed AnythingExpectation to bring it closer to JMock and -NMock in version 1.0.1alpha. - -Missing UnitTestCase::assertErrorPattern() ------------------------------------------- -This method is deprecated for version 1.0.1 onwards. -This method has been subsumed by assertError() that can now -take an expectation. Simply pass a PatternExpectation -into assertError() to simulate the old behaviour. - -No HTML when matching page elements ------------------------------------ -This behaviour has been switched to using plain text as if it -were seen by the user of the browser. This means that HTML tags -are suppressed, entities are converted and whitespace is -normalised. This should make it easier to match items in forms. -Also images are replaced with their "alt" text so that they -can be matched as well. - -No method SimpleRunner::_getTestCase() --------------------------------------- -This was made public as getTestCase() in 1.0RC2. - -No method restartSession() --------------------------- -This was renamed to restart() in the WebTestCase, SimpleBrowser -and the underlying SimpleUserAgent in 1.0RC2. Because it was -undocumented anyway, no attempt was made at backward -compatibility. - -My custom test case ignored by tally() --------------------------------------- -The _assertTrue method has had it's signature changed due to a bug -in the PHP 5.0.1 release. You must now use getTest() from within -that method to get the test case. Mock compatibility with other -unit testers is now deprecated as of 1.0.1alpha as PEAR::PHPUnit2 -should soon have mock support of it's own. - -Broken code extending SimpleRunner ----------------------------------- -This was replaced with SimpleScorer so that I could use the runner -name in another class. This happened in RC1 development and there -is no easy backward compatibility fix. The solution is simply to -extend SimpleScorer instead. - -Missing method getBaseCookieValue() ------------------------------------ -This was renamed getCurrentCookieValue() in RC1. - -Missing files from the SimpleTest suite ---------------------------------------- -Versions of SimpleTest prior to Beta6 required a SIMPLE_TEST constant -to point at the SimpleTest folder location before any of the toolset -was loaded. This is no longer documented as it is now unnecessary -for later versions. If you are using an earlier version you may -need this constant. Consult the documentation that was bundled with -the release that you are using or upgrade to Beta6 or later. - -No method SimpleBrowser::getCurrentUrl() --------------------------------------- -This is replaced with the more versatile showRequest() for -debugging. It only existed in this context for version Beta5. -Later versions will have SimpleBrowser::getHistory() for tracking -paths through pages. It is renamed as getUrl() since 1.0RC1. - -No method Stub::setStubBaseClass() ----------------------------------- -This method has finally been removed in 1.0RC1. Use -SimpleTestOptions::setStubBaseClass() instead. - -No class CommandLineReporter ----------------------------- -This was renamed to TextReporter in Beta3 and the deprecated version -was removed in 1.0RC1. - -No method requireReturn() -------------------------- -This was deprecated in Beta3 and is now removed. - -No method expectCookie() ------------------------- -This method was abruptly removed in Beta4 so as to simplify the internals -until another mechanism can replace it. As a workaround it is necessary -to assert that the cookie has changed by setting it before the page -fetch and then assert the desired value. - -No method clickSubmitByFormId() -------------------------------- -This method had an incorrect name as no button was involved. It was -renamed to submitByFormId() in Beta4 and the old version deprecated. -Now removed. - -No method paintStart() or paintEnd() ------------------------------------- -You should only get this error if you have subclassed the lower level -reporting and test runner machinery. These methods have been broken -down into events for test methods, events for test cases and events -for group tests. The new methods are... - -paintStart() --> paintMethodStart(), paintCaseStart(), paintGroupStart() -paintEnd() --> paintMethodEnd(), paintCaseEnd(), paintGroupEnd() - -This change was made in Beta3, ironically to make it easier to subclass -the inner machinery. Simply duplicating the code you had in the previous -methods should provide a temporary fix. - -No class TestDisplay --------------------- -This has been folded into SimpleReporter in Beta3 and is now deprecated. -It was removed in RC1. - -No method WebTestCase::fetch() ------------------------------- -This was renamed get() in Alpha8. It is removed in Beta3. - -No method submit() ------------------- -This has been renamed clickSubmit() in Beta1. The old method was -removed in Beta2. - -No method clearHistory() ------------------------- -This method is deprecated in Beta2 and removed in RC1. - -No method getCallCount() ------------------------- -This method has been deprecated since Beta1 and has now been -removed. There are now more ways to set expectations on counts -and so this method should be unecessery. Removed in RC1. - -Cannot find file * ------------------- -The following public name changes have occoured... - -simple_html_test.php --> reporter.php -simple_mock.php --> mock_objects.php -simple_unit.php --> unit_tester.php -simple_web.php --> web_tester.php - -The old names were deprecated in Alpha8 and removed in Beta1. - -No method attachObserver() --------------------------- -Prior to the Alpha8 release the old internal observer pattern was -gutted and replaced with a visitor. This is to trade flexibility of -test case expansion against the ease of writing user interfaces. - -Code such as... - -$test = &new MyTestCase(); -$test->attachObserver(new TestHtmlDisplay()); -$test->run(); - -...should be rewritten as... - -$test = &new MyTestCase(); -$test->run(new HtmlReporter()); - -If you previously attached multiple observers then the workaround -is to run the tests twice, once with each, until they can be combined. -For one observer the old method is simulated in Alpha 8, but is -removed in Beta1. - -No class TestHtmlDisplay ------------------------- -This class has been renamed to HtmlReporter in Alpha8. It is supported, -but deprecated in Beta1 and removed in Beta2. If you have subclassed -the display for your own design, then you will have to extend this -class (HtmlReporter) instead. - -If you have accessed the event queue by overriding the notify() method -then I am afraid you are in big trouble :(. The reporter is now -carried around the test suite by the runner classes and the methods -called directly. In the unlikely event that this is a problem and -you don't want to upgrade the test tool then simplest is to write your -own runner class and invoke the tests with... - -$test->accept(new MyRunner(new MyReporter())); - -...rather than the run method. This should be easier to extend -anyway and gives much more control. Even this method is overhauled -in Beta3 where the runner class can be set within the test case. Really -the best thing to do is to upgrade to this version as whatever you were -trying to achieve before should now be very much easier. - -Missing set options method --------------------------- -All test suite options are now in one class called SimpleTestOptions. -This means that options are set differently... - -GroupTest::ignore() --> SimpleTestOptions::ignore() -Mock::setMockBaseClass() --> SimpleTestOptions::setMockBaseClass() - -These changed in Alpha8 and the old versions are now removed in RC1. - -No method setExpected*() ------------------------- -The mock expectations changed their names in Alpha4 and the old names -ceased to be supported in Alpha8. The changes are... - -setExpectedArguments() --> expectArguments() -setExpectedArgumentsSequence() --> expectArgumentsAt() -setExpectedCallCount() --> expectCallCount() -setMaximumCallCount() --> expectMaximumCallCount() - -The parameters remained the same. diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/LICENSE b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/LICENSE deleted file mode 100644 index 09f465a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/LICENSE +++ /dev/null @@ -1,502 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/README b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/README deleted file mode 100644 index f0912b2..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/README +++ /dev/null @@ -1,108 +0,0 @@ -SimpleTest -========== -You probably got this package from... -http://simpletest.sourceforge.net/projects/simpletest/ - -If there is no licence agreement with this package please download -a version from the location above. You must read and accept that -licence to use this software. The file is titled simply LICENSE. - -What is it? It's a framework for unit testing, web site testing and -mock objects for PHP 5.0.5+. - -If you have used JUnit, you will find this PHP unit testing version very -similar. Also included is a mock objects and server stubs generator. -The stubs can have return values set for different arguments, can have -sequences set also by arguments and can return items by reference. -The mocks inherit all of this functionality and can also have -expectations set, again in sequences and for different arguments. - -A web tester similar in concept to JWebUnit is also included. There is no -JavaScript or tables support, but forms, authentication, cookies and -frames are handled. - -You can see a release schedule at http://simpletest.org/en/overview.html -which is also copied to the documentation folder with this release. -A full PHPDocumenter API documentation exists at -http://simpletest.org/api/. - -The user interface is minimal -in the extreme, but a lot of information flows from the test suite. -After version 1.0 we will release a better web UI, but we are leaving XUL -and GTk versions to volunteers as everybody has their own opinion -on a good GUI, and we don't want to discourage development by shipping -one with the toolkit. You can download an Eclipse plug-in separately. - -You are looking at a second full release. The unit tests for SimpleTest -itself can be run here... - -simpletest/test/unit_tests.php - -And tests involving live network connections as well are here... - -simpletest/test/all_tests.php - -The full tests will typically overrun the 8Mb limit often allowed -to a PHP process. A workaround is to run the tests on the command -with a custom php.ini file if you do not have access to your server -version. - -You will have to edit the all_tests.php file if you are accesssing -the internet through a proxy server. See the comments in all_tests.php -for instructions. - -The full tests read some test data from the LastCraft site. If the site -is down or has been modified for a later version then you will get -spurious errors. A unit_tests.php failure on the other hand would be -very serious. As far as we know we haven't yet managed to check in any -unit test failures, so please correct us if you find one. - -Even if all of the tests run please verify that your existing test suites -also function as expected. If they don't see the file... - -HELP_MY_TESTS_DONT_WORK_ANYMORE - -This contains information on interface changes. It also points out -deprecated interfaces, so you should read this even if all of -your current tests appear to run. - -There is a documentation folder which contains the core reference information -in English and French, although this information is fairly basic. -You can find a tutorial on... - -http://simpletest.org/en/first_test_tutorial.html - -...to get you started and this material will eventually become included -with the project documentation. A French translation exists at... - -http://simpletest.org/fr/first_test_tutorial.html - -If you download and use, and possibly even extend this tool, please let us -know. Any feedback, even bad, is always welcome and we will work to get -your suggestions into the next release. Ideally please send your -comments to... - -simpletest-support@lists.sourceforge.net - -...so that others can read them too. We usually try to respond within 48 -hours. - -There is no change log except at Sourceforge. You can visit the -release notes to see the completed TODO list after each cycle and also the -status of any bugs, but if the bug is recent then it will be fixed in SVN only. -The SVN check-ins always have all the tests passing and so SVN snapshots should -be pretty usable, although the code may not look so good internally. - -Oh, yes. It is called "Simple" because it should be simple to -use. We intend to add a complete set of tools for a test first -and "test as you code" type of development. "Simple" does not -mean "Lite" in this context. - -Thanks to everyone who has sent comments and offered suggestions. They -really are invaluable, but sadly you are too many to mention in full. -Thanks to all on the advanced PHP forum on SitePoint, especially Harry -Fuecks. Early adopters are always an inspiration. - -Marcus Baker, Jason Sweat, Travis Swicegood, Perrick Penet and Edward Z. Yang. --- -marcus@lastcraft.com diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/TODO.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/TODO.xml deleted file mode 100644 index 3fa84e9..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/TODO.xml +++ /dev/null @@ -1,176 +0,0 @@ - - - TODO tasks for the current iteration - -
-

- The following is the approximate plan for the next full point release. -

-

- Before each release we hope to have the following done. - More may get done, depending on the interest of the volunteers, - but this is the current minimum. -

-

- The aim of this release cycle is to produce a functionally - identical version to the 1.0.1 release, but bug-fixed and - fully compatible with PHP 5.0.5+ under E_STRICT. - We are also hoping to flush out issues and use cases - caused by people hacking against unpublished flex points - in SimpleTest. - We want to break people's code now, not while we are developing - features down the line. -

-

- With the website move to a new server, and more developers, - we are able and need to improve the test automation and developer - cooperation. - This release is a deep drawing of breath before going forward. -

-
-
- - - Undefined property $_reporter + fatal error - - - - - - - - - The HELP_MY_TESTS_DONT_WORK_ANYMORE needs to be updated. - - README needs to be updated. - - Write XSLT code for this file so Perrick doesn't strangle me - - - - Ensure extensions are compatible with PHP5 constructor renaming in the current trunk. - - - Update PEAR package task to be compatible with latest PEAR installer. - PHP 5.3 compatible under E_STRICT - PHP 5.2.0-5 compatible under E_STRICT - PHP 5.1.0-6 compatible under E_STRICT - continuous integration - error_reporting(E_ALL|E_STRICT)gives lots of warning - Remove all deprecated methods - - Drop underscores from protected methods and - private variables. - Make all variables private and add protected - accessors where we use them internally. - - That way people will start complaining. - Upon each complaint we'll add an accessor and - capture the use case from them. - - We'll stick the use cases in the feature request tracker for now - - Move web site to new server - - - - - - - Deprecate all mentions of GroupTest without breaking - existing code. - - Need to swap the terminology for TestSuite - in method names, etc. - - - XmlReporter generating invalid XML - - - Remove reflection facade for PHP4 - - - - label not assigned to radio and checkbox - incorrect proxy requests - - - - Docblocks need to be cut back to a minimum - - - - PHP 5.0.5 compatible under E_STRICT - Move acceptance tests sample pages to new server - - - - - - - Remove reflection facade for PHP4 - - - - - - Throw away old tutorial - - - - PHP 6 compatible under E_STRICT - - Automated nightly test script that runs tests on all - targeted PHP versions. - - - -
-
- - -
Current iteration is 1.1beta. - - - Upcoming tasks for - Unit tester, - Reporter, - Mock objects, - Parser, - Browser, - Web tester, - Documentation, - Extensions and - Build. - - - - - Trackers for : - feature requests, - bugs and - patches. - - - - - software development, - computer programmer, - php programming, - programming php, - software development company, - software development uk, - php tutorial, - bespoke software development uk, - corporate web development, - architecture, - freelancer, - php resources, - wordtracker, - web marketing, - serach engines, - web positioning, - internet marketing - - - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/VERSION b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/VERSION deleted file mode 100644 index ab8bad0..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.1beta \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/authentication.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/authentication.php deleted file mode 100644 index 5af66ec..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/authentication.php +++ /dev/null @@ -1,237 +0,0 @@ -type = $type; - $this->root = $url->getBasePath(); - $this->username = false; - $this->password = false; - } - - /** - * Adds another location to the realm. - * @param SimpleUrl $url Somewhere in realm. - * @access public - */ - function stretch($url) { - $this->root = $this->getCommonPath($this->root, $url->getPath()); - } - - /** - * Finds the common starting path. - * @param string $first Path to compare. - * @param string $second Path to compare. - * @return string Common directories. - * @access private - */ - protected function getCommonPath($first, $second) { - $first = explode('/', $first); - $second = explode('/', $second); - for ($i = 0; $i < min(count($first), count($second)); $i++) { - if ($first[$i] != $second[$i]) { - return implode('/', array_slice($first, 0, $i)) . '/'; - } - } - return implode('/', $first) . '/'; - } - - /** - * Sets the identity to try within this realm. - * @param string $username Username in authentication dialog. - * @param string $username Password in authentication dialog. - * @access public - */ - function setIdentity($username, $password) { - $this->username = $username; - $this->password = $password; - } - - /** - * Accessor for current identity. - * @return string Last succesful username. - * @access public - */ - function getUsername() { - return $this->username; - } - - /** - * Accessor for current identity. - * @return string Last succesful password. - * @access public - */ - function getPassword() { - return $this->password; - } - - /** - * Test to see if the URL is within the directory - * tree of the realm. - * @param SimpleUrl $url URL to test. - * @return boolean True if subpath. - * @access public - */ - function isWithin($url) { - if ($this->isIn($this->root, $url->getBasePath())) { - return true; - } - if ($this->isIn($this->root, $url->getBasePath() . $url->getPage() . '/')) { - return true; - } - return false; - } - - /** - * Tests to see if one string is a substring of - * another. - * @param string $part Small bit. - * @param string $whole Big bit. - * @return boolean True if the small bit is - * in the big bit. - * @access private - */ - protected function isIn($part, $whole) { - return strpos($whole, $part) === 0; - } -} - -/** - * Manages security realms. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleAuthenticator { - private $realms; - - /** - * Clears the realms. - * @access public - */ - function SimpleAuthenticator() { - $this->restartSession(); - } - - /** - * Starts with no realms set up. - * @access public - */ - function restartSession() { - $this->realms = array(); - } - - /** - * Adds a new realm centered the current URL. - * Browsers privatey wildly on their behaviour in this - * regard. Mozilla ignores the realm and presents - * only when challenged, wasting bandwidth. IE - * just carries on presenting until a new challenge - * occours. SimpleTest tries to follow the spirit of - * the original standards committee and treats the - * base URL as the root of a file tree shaped realm. - * @param SimpleUrl $url Base of realm. - * @param string $type Authentication type for this - * realm. Only Basic authentication - * is currently supported. - * @param string $realm Name of realm. - * @access public - */ - function addRealm($url, $type, $realm) { - $this->realms[$url->getHost()][$realm] = new SimpleRealm($type, $url); - } - - /** - * Sets the current identity to be presented - * against that realm. - * @param string $host Server hosting realm. - * @param string $realm Name of realm. - * @param string $username Username for realm. - * @param string $password Password for realm. - * @access public - */ - function setIdentityForRealm($host, $realm, $username, $password) { - if (isset($this->realms[$host][$realm])) { - $this->realms[$host][$realm]->setIdentity($username, $password); - } - } - - /** - * Finds the name of the realm by comparing URLs. - * @param SimpleUrl $url URL to test. - * @return SimpleRealm Name of realm. - * @access private - */ - protected function findRealmFromUrl($url) { - if (! isset($this->realms[$url->getHost()])) { - return false; - } - foreach ($this->realms[$url->getHost()] as $name => $realm) { - if ($realm->isWithin($url)) { - return $realm; - } - } - return false; - } - - /** - * Presents the appropriate headers for this location. - * @param SimpleHttpRequest $request Request to modify. - * @param SimpleUrl $url Base of realm. - * @access public - */ - function addHeaders(&$request, $url) { - if ($url->getUsername() && $url->getPassword()) { - $username = $url->getUsername(); - $password = $url->getPassword(); - } elseif ($realm = $this->findRealmFromUrl($url)) { - $username = $realm->getUsername(); - $password = $realm->getPassword(); - } else { - return; - } - $this->addBasicHeaders($request, $username, $password); - } - - /** - * Presents the appropriate headers for this - * location for basic authentication. - * @param SimpleHttpRequest $request Request to modify. - * @param string $username Username for realm. - * @param string $password Password for realm. - * @access public - */ - static function addBasicHeaders(&$request, $username, $password) { - if ($username && $password) { - $request->addHeaderLine( - 'Authorization: Basic ' . base64_encode("$username:$password")); - } - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/autorun.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/autorun.php deleted file mode 100644 index 03729bf..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/autorun.php +++ /dev/null @@ -1,97 +0,0 @@ -createSuiteFromClasses( - basename(initial_file()), - $loader->selectRunnableTests($candidates)); - $result = $suite->run(new DefaultReporter()); - } catch (Exception $stack_frame_fix) { - print $stack_frame_fix->getMessage(); - $result = false; - } - if (SimpleReporter::inCli()) { - exit($result ? 0 : 1); - } -} - -/** - * Checks the current test context to see if a test has - * ever been run. - * @return boolean True if tests have run. - */ -function tests_have_run() { - if ($context = SimpleTest::getContext()) { - return (boolean)$context->getTest(); - } - return false; -} - -/** - * The first autorun file. - * @return string Filename of first autorun script. - */ -function initial_file() { - static $file = false; - if (! $file) { - if (isset($_SERVER, $_SERVER['SCRIPT_FILENAME'])) { - $file = $_SERVER['SCRIPT_FILENAME']; - } else { - $included_files = get_included_files(); - $file = reset($included_files); - } - } - return $file; -} - -/** - * Just the classes from the first autorun script. May - * get a few false positives, as it just does a regex based - * on following the word "class". - * @return array List of all possible classes in first - * autorun script. - */ -function classes_defined_in_initial_file() { - if (preg_match_all('/\bclass\s+(\w+)/i', file_get_contents(initial_file()), $matches)) { - return array_map('strtolower', $matches[1]); - } - return array(); -} - -/** - * Every class since the first autorun include. This - * is safe enough if require_once() is alwyas used. - * @return array Class names. - */ -function capture_new_classes() { - global $SIMPLETEST_AUTORUNNER_INITIAL_CLASSES; - return array_map('strtolower', array_diff(get_declared_classes(), - $SIMPLETEST_AUTORUNNER_INITIAL_CLASSES ? - $SIMPLETEST_AUTORUNNER_INITIAL_CLASSES : array())); -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/browser.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/browser.php deleted file mode 100644 index da0379d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/browser.php +++ /dev/null @@ -1,1094 +0,0 @@ -sequence = array(); - $this->position = -1; - } - - /** - * Test for no entries yet. - * @return boolean True if empty. - * @access private - */ - protected function isEmpty() { - return ($this->position == -1); - } - - /** - * Test for being at the beginning. - * @return boolean True if first. - * @access private - */ - protected function atBeginning() { - return ($this->position == 0) && ! $this->isEmpty(); - } - - /** - * Test for being at the last entry. - * @return boolean True if last. - * @access private - */ - protected function atEnd() { - return ($this->position + 1 >= count($this->sequence)) && ! $this->isEmpty(); - } - - /** - * Adds a successfully fetched page to the history. - * @param SimpleUrl $url URL of fetch. - * @param SimpleEncoding $parameters Any post data with the fetch. - * @access public - */ - function recordEntry($url, $parameters) { - $this->dropFuture(); - array_push( - $this->sequence, - array('url' => $url, 'parameters' => $parameters)); - $this->position++; - } - - /** - * Last fully qualified URL for current history - * position. - * @return SimpleUrl URL for this position. - * @access public - */ - function getUrl() { - if ($this->isEmpty()) { - return false; - } - return $this->sequence[$this->position]['url']; - } - - /** - * Parameters of last fetch from current history - * position. - * @return SimpleFormEncoding Post parameters. - * @access public - */ - function getParameters() { - if ($this->isEmpty()) { - return false; - } - return $this->sequence[$this->position]['parameters']; - } - - /** - * Step back one place in the history. Stops at - * the first page. - * @return boolean True if any previous entries. - * @access public - */ - function back() { - if ($this->isEmpty() || $this->atBeginning()) { - return false; - } - $this->position--; - return true; - } - - /** - * Step forward one place. If already at the - * latest entry then nothing will happen. - * @return boolean True if any future entries. - * @access public - */ - function forward() { - if ($this->isEmpty() || $this->atEnd()) { - return false; - } - $this->position++; - return true; - } - - /** - * Ditches all future entries beyond the current - * point. - * @access private - */ - protected function dropFuture() { - if ($this->isEmpty()) { - return; - } - while (! $this->atEnd()) { - array_pop($this->sequence); - } - } -} - -/** - * Simulated web browser. This is an aggregate of - * the user agent, the HTML parsing, request history - * and the last header set. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleBrowser { - private $user_agent; - private $page; - private $history; - private $ignore_frames; - private $maximum_nested_frames; - - /** - * Starts with a fresh browser with no - * cookie or any other state information. The - * exception is that a default proxy will be - * set up if specified in the options. - * @access public - */ - function __construct() { - $this->user_agent = $this->createUserAgent(); - $this->user_agent->useProxy( - SimpleTest::getDefaultProxy(), - SimpleTest::getDefaultProxyUsername(), - SimpleTest::getDefaultProxyPassword()); - $this->page = new SimplePage(); - $this->history = $this->createHistory(); - $this->ignore_frames = false; - $this->maximum_nested_frames = DEFAULT_MAX_NESTED_FRAMES; - } - - /** - * Creates the underlying user agent. - * @return SimpleFetcher Content fetcher. - * @access protected - */ - protected function createUserAgent() { - return new SimpleUserAgent(); - } - - /** - * Creates a new empty history list. - * @return SimpleBrowserHistory New list. - * @access protected - */ - protected function createHistory() { - return new SimpleBrowserHistory(); - } - - /** - * Disables frames support. Frames will not be fetched - * and the frameset page will be used instead. - * @access public - */ - function ignoreFrames() { - $this->ignore_frames = true; - } - - /** - * Enables frames support. Frames will be fetched from - * now on. - * @access public - */ - function useFrames() { - $this->ignore_frames = false; - } - - /** - * Switches off cookie sending and recieving. - * @access public - */ - function ignoreCookies() { - $this->user_agent->ignoreCookies(); - } - - /** - * Switches back on the cookie sending and recieving. - * @access public - */ - function useCookies() { - $this->user_agent->useCookies(); - } - - /** - * Parses the raw content into a page. Will load further - * frame pages unless frames are disabled. - * @param SimpleHttpResponse $response Response from fetch. - * @param integer $depth Nested frameset depth. - * @return SimplePage Parsed HTML. - * @access private - */ - protected function parse($response, $depth = 0) { - $page = $this->buildPage($response); - if ($this->ignore_frames || ! $page->hasFrames() || ($depth > $this->maximum_nested_frames)) { - return $page; - } - $frameset = new SimpleFrameset($page); - foreach ($page->getFrameset() as $key => $url) { - $frame = $this->fetch($url, new SimpleGetEncoding(), $depth + 1); - $frameset->addFrame($frame, $key); - } - return $frameset; - } - - /** - * Assembles the parsing machinery and actually parses - * a single page. Frees all of the builder memory and so - * unjams the PHP memory management. - * @param SimpleHttpResponse $response Response from fetch. - * @return SimplePage Parsed top level page. - * @access protected - */ - protected function buildPage($response) { - $builder = new SimplePageBuilder(); - $page = $builder->parse($response); - $builder->free(); - unset($builder); - return $page; - } - - /** - * Fetches a page. Jointly recursive with the parse() - * method as it descends a frameset. - * @param string/SimpleUrl $url Target to fetch. - * @param SimpleEncoding $encoding GET/POST parameters. - * @param integer $depth Nested frameset depth protection. - * @return SimplePage Parsed page. - * @access private - */ - protected function fetch($url, $encoding, $depth = 0) { - $response = $this->user_agent->fetchResponse($url, $encoding); - if ($response->isError()) { - return new SimplePage($response); - } - return $this->parse($response, $depth); - } - - /** - * Fetches a page or a single frame if that is the current - * focus. - * @param SimpleUrl $url Target to fetch. - * @param SimpleEncoding $parameters GET/POST parameters. - * @return string Raw content of page. - * @access private - */ - protected function load($url, $parameters) { - $frame = $url->getTarget(); - if (! $frame || ! $this->page->hasFrames() || (strtolower($frame) == '_top')) { - return $this->loadPage($url, $parameters); - } - return $this->loadFrame(array($frame), $url, $parameters); - } - - /** - * Fetches a page and makes it the current page/frame. - * @param string/SimpleUrl $url Target to fetch as string. - * @param SimplePostEncoding $parameters POST parameters. - * @return string Raw content of page. - * @access private - */ - protected function loadPage($url, $parameters) { - $this->page = $this->fetch($url, $parameters); - $this->history->recordEntry( - $this->page->getUrl(), - $this->page->getRequestData()); - return $this->page->getRaw(); - } - - /** - * Fetches a frame into the existing frameset replacing the - * original. - * @param array $frames List of names to drill down. - * @param string/SimpleUrl $url Target to fetch as string. - * @param SimpleFormEncoding $parameters POST parameters. - * @return string Raw content of page. - * @access private - */ - protected function loadFrame($frames, $url, $parameters) { - $page = $this->fetch($url, $parameters); - $this->page->setFrame($frames, $page); - return $page->getRaw(); - } - - /** - * Removes expired and temporary cookies as if - * the browser was closed and re-opened. - * @param string/integer $date Time when session restarted. - * If omitted then all persistent - * cookies are kept. - * @access public - */ - function restart($date = false) { - $this->user_agent->restart($date); - } - - /** - * Adds a header to every fetch. - * @param string $header Header line to add to every - * request until cleared. - * @access public - */ - function addHeader($header) { - $this->user_agent->addHeader($header); - } - - /** - * Ages the cookies by the specified time. - * @param integer $interval Amount in seconds. - * @access public - */ - function ageCookies($interval) { - $this->user_agent->ageCookies($interval); - } - - /** - * Sets an additional cookie. If a cookie has - * the same name and path it is replaced. - * @param string $name Cookie key. - * @param string $value Value of cookie. - * @param string $host Host upon which the cookie is valid. - * @param string $path Cookie path if not host wide. - * @param string $expiry Expiry date. - * @access public - */ - function setCookie($name, $value, $host = false, $path = '/', $expiry = false) { - $this->user_agent->setCookie($name, $value, $host, $path, $expiry); - } - - /** - * Reads the most specific cookie value from the - * browser cookies. - * @param string $host Host to search. - * @param string $path Applicable path. - * @param string $name Name of cookie to read. - * @return string False if not present, else the - * value as a string. - * @access public - */ - function getCookieValue($host, $path, $name) { - return $this->user_agent->getCookieValue($host, $path, $name); - } - - /** - * Reads the current cookies for the current URL. - * @param string $name Key of cookie to find. - * @return string Null if there is no current URL, false - * if the cookie is not set. - * @access public - */ - function getCurrentCookieValue($name) { - return $this->user_agent->getBaseCookieValue($name, $this->page->getUrl()); - } - - /** - * Sets the maximum number of redirects before - * a page will be loaded anyway. - * @param integer $max Most hops allowed. - * @access public - */ - function setMaximumRedirects($max) { - $this->user_agent->setMaximumRedirects($max); - } - - /** - * Sets the maximum number of nesting of framed pages - * within a framed page to prevent loops. - * @param integer $max Highest depth allowed. - * @access public - */ - function setMaximumNestedFrames($max) { - $this->maximum_nested_frames = $max; - } - - /** - * Sets the socket timeout for opening a connection. - * @param integer $timeout Maximum time in seconds. - * @access public - */ - function setConnectionTimeout($timeout) { - $this->user_agent->setConnectionTimeout($timeout); - } - - /** - * Sets proxy to use on all requests for when - * testing from behind a firewall. Set URL - * to false to disable. - * @param string $proxy Proxy URL. - * @param string $username Proxy username for authentication. - * @param string $password Proxy password for authentication. - * @access public - */ - function useProxy($proxy, $username = false, $password = false) { - $this->user_agent->useProxy($proxy, $username, $password); - } - - /** - * Fetches the page content with a HEAD request. - * Will affect cookies, but will not change the base URL. - * @param string/SimpleUrl $url Target to fetch as string. - * @param hash/SimpleHeadEncoding $parameters Additional parameters for - * HEAD request. - * @return boolean True if successful. - * @access public - */ - function head($url, $parameters = false) { - if (! is_object($url)) { - $url = new SimpleUrl($url); - } - if ($this->getUrl()) { - $url = $url->makeAbsolute($this->getUrl()); - } - $response = &$this->user_agent->fetchResponse($url, new SimpleHeadEncoding($parameters)); - return ! $response->isError(); - } - - /** - * Fetches the page content with a simple GET request. - * @param string/SimpleUrl $url Target to fetch. - * @param hash/SimpleFormEncoding $parameters Additional parameters for - * GET request. - * @return string Content of page or false. - * @access public - */ - function get($url, $parameters = false) { - if (! is_object($url)) { - $url = new SimpleUrl($url); - } - if ($this->getUrl()) { - $url = $url->makeAbsolute($this->getUrl()); - } - return $this->load($url, new SimpleGetEncoding($parameters)); - } - - /** - * Fetches the page content with a POST request. - * @param string/SimpleUrl $url Target to fetch as string. - * @param hash/SimpleFormEncoding $parameters POST parameters. - * @return string Content of page. - * @access public - */ - function post($url, $parameters = false) { - if (! is_object($url)) { - $url = new SimpleUrl($url); - } - if ($this->getUrl()) { - $url = $url->makeAbsolute($this->getUrl()); - } - return $this->load($url, new SimplePostEncoding($parameters)); - } - - /** - * Equivalent to hitting the retry button on the - * browser. Will attempt to repeat the page fetch. If - * there is no history to repeat it will give false. - * @return string/boolean Content if fetch succeeded - * else false. - * @access public - */ - function retry() { - $frames = $this->page->getFrameFocus(); - if (count($frames) > 0) { - $this->loadFrame( - $frames, - $this->page->getUrl(), - $this->page->getRequestData()); - return $this->page->getRaw(); - } - if ($url = $this->history->getUrl()) { - $this->page = $this->fetch($url, $this->history->getParameters()); - return $this->page->getRaw(); - } - return false; - } - - /** - * Equivalent to hitting the back button on the - * browser. The browser history is unchanged on - * failure. The page content is refetched as there - * is no concept of content caching in SimpleTest. - * @return boolean True if history entry and - * fetch succeeded - * @access public - */ - function back() { - if (! $this->history->back()) { - return false; - } - $content = $this->retry(); - if (! $content) { - $this->history->forward(); - } - return $content; - } - - /** - * Equivalent to hitting the forward button on the - * browser. The browser history is unchanged on - * failure. The page content is refetched as there - * is no concept of content caching in SimpleTest. - * @return boolean True if history entry and - * fetch succeeded - * @access public - */ - function forward() { - if (! $this->history->forward()) { - return false; - } - $content = $this->retry(); - if (! $content) { - $this->history->back(); - } - return $content; - } - - /** - * Retries a request after setting the authentication - * for the current realm. - * @param string $username Username for realm. - * @param string $password Password for realm. - * @return boolean True if successful fetch. Note - * that authentication may still have - * failed. - * @access public - */ - function authenticate($username, $password) { - if (! $this->page->getRealm()) { - return false; - } - $url = $this->page->getUrl(); - if (! $url) { - return false; - } - $this->user_agent->setIdentity( - $url->getHost(), - $this->page->getRealm(), - $username, - $password); - return $this->retry(); - } - - /** - * Accessor for a breakdown of the frameset. - * @return array Hash tree of frames by name - * or index if no name. - * @access public - */ - function getFrames() { - return $this->page->getFrames(); - } - - /** - * Accessor for current frame focus. Will be - * false if no frame has focus. - * @return integer/string/boolean Label if any, otherwise - * the position in the frameset - * or false if none. - * @access public - */ - function getFrameFocus() { - return $this->page->getFrameFocus(); - } - - /** - * Sets the focus by index. The integer index starts from 1. - * @param integer $choice Chosen frame. - * @return boolean True if frame exists. - * @access public - */ - function setFrameFocusByIndex($choice) { - return $this->page->setFrameFocusByIndex($choice); - } - - /** - * Sets the focus by name. - * @param string $name Chosen frame. - * @return boolean True if frame exists. - * @access public - */ - function setFrameFocus($name) { - return $this->page->setFrameFocus($name); - } - - /** - * Clears the frame focus. All frames will be searched - * for content. - * @access public - */ - function clearFrameFocus() { - return $this->page->clearFrameFocus(); - } - - /** - * Accessor for last error. - * @return string Error from last response. - * @access public - */ - function getTransportError() { - return $this->page->getTransportError(); - } - - /** - * Accessor for current MIME type. - * @return string MIME type as string; e.g. 'text/html' - * @access public - */ - function getMimeType() { - return $this->page->getMimeType(); - } - - /** - * Accessor for last response code. - * @return integer Last HTTP response code received. - * @access public - */ - function getResponseCode() { - return $this->page->getResponseCode(); - } - - /** - * Accessor for last Authentication type. Only valid - * straight after a challenge (401). - * @return string Description of challenge type. - * @access public - */ - function getAuthentication() { - return $this->page->getAuthentication(); - } - - /** - * Accessor for last Authentication realm. Only valid - * straight after a challenge (401). - * @return string Name of security realm. - * @access public - */ - function getRealm() { - return $this->page->getRealm(); - } - - /** - * Accessor for current URL of page or frame if - * focused. - * @return string Location of current page or frame as - * a string. - */ - function getUrl() { - $url = $this->page->getUrl(); - return $url ? $url->asString() : false; - } - - /** - * Accessor for base URL of page if set via BASE tag - * @return string base URL - */ - function getBaseUrl() { - $url = $this->page->getBaseUrl(); - return $url ? $url->asString() : false; - } - - /** - * Accessor for raw bytes sent down the wire. - * @return string Original text sent. - * @access public - */ - function getRequest() { - return $this->page->getRequest(); - } - - /** - * Accessor for raw header information. - * @return string Header block. - * @access public - */ - function getHeaders() { - return $this->page->getHeaders(); - } - - /** - * Accessor for raw page information. - * @return string Original text content of web page. - * @access public - */ - function getContent() { - return $this->page->getRaw(); - } - - /** - * Accessor for plain text version of the page. - * @return string Normalised text representation. - * @access public - */ - function getContentAsText() { - return $this->page->getText(); - } - - /** - * Accessor for parsed title. - * @return string Title or false if no title is present. - * @access public - */ - function getTitle() { - return $this->page->getTitle(); - } - - /** - * Accessor for a list of all links in current page. - * @return array List of urls with scheme of - * http or https and hostname. - * @access public - */ - function getUrls() { - return $this->page->getUrls(); - } - - /** - * Sets all form fields with that name. - * @param string $label Name or label of field in forms. - * @param string $value New value of field. - * @return boolean True if field exists, otherwise false. - * @access public - */ - function setField($label, $value, $position=false) { - return $this->page->setField(new SimpleByLabelOrName($label), $value, $position); - } - - /** - * Sets all form fields with that name. Will use label if - * one is available (not yet implemented). - * @param string $name Name of field in forms. - * @param string $value New value of field. - * @return boolean True if field exists, otherwise false. - * @access public - */ - function setFieldByName($name, $value, $position=false) { - return $this->page->setField(new SimpleByName($name), $value, $position); - } - - /** - * Sets all form fields with that id attribute. - * @param string/integer $id Id of field in forms. - * @param string $value New value of field. - * @return boolean True if field exists, otherwise false. - * @access public - */ - function setFieldById($id, $value) { - return $this->page->setField(new SimpleById($id), $value); - } - - /** - * Accessor for a form element value within the page. - * Finds the first match. - * @param string $label Field label. - * @return string/boolean A value if the field is - * present, false if unchecked - * and null if missing. - * @access public - */ - function getField($label) { - return $this->page->getField(new SimpleByLabelOrName($label)); - } - - /** - * Accessor for a form element value within the page. - * Finds the first match. - * @param string $name Field name. - * @return string/boolean A string if the field is - * present, false if unchecked - * and null if missing. - * @access public - */ - function getFieldByName($name) { - return $this->page->getField(new SimpleByName($name)); - } - - /** - * Accessor for a form element value within the page. - * @param string/integer $id Id of field in forms. - * @return string/boolean A string if the field is - * present, false if unchecked - * and null if missing. - * @access public - */ - function getFieldById($id) { - return $this->page->getField(new SimpleById($id)); - } - - /** - * Clicks the submit button by label. The owning - * form will be submitted by this. - * @param string $label Button label. An unlabeled - * button can be triggered by 'Submit'. - * @param hash $additional Additional form data. - * @return string/boolean Page on success. - * @access public - */ - function clickSubmit($label = 'Submit', $additional = false) { - if (! ($form = $this->page->getFormBySubmit(new SimpleByLabel($label)))) { - return false; - } - $success = $this->load( - $form->getAction(), - $form->submitButton(new SimpleByLabel($label), $additional)); - return ($success ? $this->getContent() : $success); - } - - /** - * Clicks the submit button by name attribute. The owning - * form will be submitted by this. - * @param string $name Button name. - * @param hash $additional Additional form data. - * @return string/boolean Page on success. - * @access public - */ - function clickSubmitByName($name, $additional = false) { - if (! ($form = $this->page->getFormBySubmit(new SimpleByName($name)))) { - return false; - } - $success = $this->load( - $form->getAction(), - $form->submitButton(new SimpleByName($name), $additional)); - return ($success ? $this->getContent() : $success); - } - - /** - * Clicks the submit button by ID attribute of the button - * itself. The owning form will be submitted by this. - * @param string $id Button ID. - * @param hash $additional Additional form data. - * @return string/boolean Page on success. - * @access public - */ - function clickSubmitById($id, $additional = false) { - if (! ($form = $this->page->getFormBySubmit(new SimpleById($id)))) { - return false; - } - $success = $this->load( - $form->getAction(), - $form->submitButton(new SimpleById($id), $additional)); - return ($success ? $this->getContent() : $success); - } - - /** - * Tests to see if a submit button exists with this - * label. - * @param string $label Button label. - * @return boolean True if present. - * @access public - */ - function isSubmit($label) { - return (boolean)$this->page->getFormBySubmit(new SimpleByLabel($label)); - } - - /** - * Clicks the submit image by some kind of label. Usually - * the alt tag or the nearest equivalent. The owning - * form will be submitted by this. Clicking outside of - * the boundary of the coordinates will result in - * a failure. - * @param string $label ID attribute of button. - * @param integer $x X-coordinate of imaginary click. - * @param integer $y Y-coordinate of imaginary click. - * @param hash $additional Additional form data. - * @return string/boolean Page on success. - * @access public - */ - function clickImage($label, $x = 1, $y = 1, $additional = false) { - if (! ($form = $this->page->getFormByImage(new SimpleByLabel($label)))) { - return false; - } - $success = $this->load( - $form->getAction(), - $form->submitImage(new SimpleByLabel($label), $x, $y, $additional)); - return ($success ? $this->getContent() : $success); - } - - /** - * Clicks the submit image by the name. Usually - * the alt tag or the nearest equivalent. The owning - * form will be submitted by this. Clicking outside of - * the boundary of the coordinates will result in - * a failure. - * @param string $name Name attribute of button. - * @param integer $x X-coordinate of imaginary click. - * @param integer $y Y-coordinate of imaginary click. - * @param hash $additional Additional form data. - * @return string/boolean Page on success. - * @access public - */ - function clickImageByName($name, $x = 1, $y = 1, $additional = false) { - if (! ($form = $this->page->getFormByImage(new SimpleByName($name)))) { - return false; - } - $success = $this->load( - $form->getAction(), - $form->submitImage(new SimpleByName($name), $x, $y, $additional)); - return ($success ? $this->getContent() : $success); - } - - /** - * Clicks the submit image by ID attribute. The owning - * form will be submitted by this. Clicking outside of - * the boundary of the coordinates will result in - * a failure. - * @param integer/string $id ID attribute of button. - * @param integer $x X-coordinate of imaginary click. - * @param integer $y Y-coordinate of imaginary click. - * @param hash $additional Additional form data. - * @return string/boolean Page on success. - * @access public - */ - function clickImageById($id, $x = 1, $y = 1, $additional = false) { - if (! ($form = $this->page->getFormByImage(new SimpleById($id)))) { - return false; - } - $success = $this->load( - $form->getAction(), - $form->submitImage(new SimpleById($id), $x, $y, $additional)); - return ($success ? $this->getContent() : $success); - } - - /** - * Tests to see if an image exists with this - * title or alt text. - * @param string $label Image text. - * @return boolean True if present. - * @access public - */ - function isImage($label) { - return (boolean)$this->page->getFormByImage(new SimpleByLabel($label)); - } - - /** - * Submits a form by the ID. - * @param string $id The form ID. No submit button value - * will be sent. - * @return string/boolean Page on success. - * @access public - */ - function submitFormById($id) { - if (! ($form = $this->page->getFormById($id))) { - return false; - } - $success = $this->load( - $form->getAction(), - $form->submit()); - return ($success ? $this->getContent() : $success); - } - - /** - * Finds a URL by label. Will find the first link - * found with this link text by default, or a later - * one if an index is given. The match ignores case and - * white space issues. - * @param string $label Text between the anchor tags. - * @param integer $index Link position counting from zero. - * @return string/boolean URL on success. - * @access public - */ - function getLink($label, $index = 0) { - $urls = $this->page->getUrlsByLabel($label); - if (count($urls) == 0) { - return false; - } - if (count($urls) < $index + 1) { - return false; - } - return $urls[$index]; - } - - /** - * Follows a link by label. Will click the first link - * found with this link text by default, or a later - * one if an index is given. The match ignores case and - * white space issues. - * @param string $label Text between the anchor tags. - * @param integer $index Link position counting from zero. - * @return string/boolean Page on success. - * @access public - */ - function clickLink($label, $index = 0) { - $url = $this->getLink($label, $index); - if ($url === false) { - return false; - } - $this->load($url, new SimpleGetEncoding()); - return $this->getContent(); - } - - /** - * Finds a link by id attribute. - * @param string $id ID attribute value. - * @return string/boolean URL on success. - * @access public - */ - function getLinkById($id) { - return $this->page->getUrlById($id); - } - - /** - * Follows a link by id attribute. - * @param string $id ID attribute value. - * @return string/boolean Page on success. - * @access public - */ - function clickLinkById($id) { - if (! ($url = $this->getLinkById($id))) { - return false; - } - $this->load($url, new SimpleGetEncoding()); - return $this->getContent(); - } - - /** - * Clicks a visible text item. Will first try buttons, - * then links and then images. - * @param string $label Visible text or alt text. - * @return string/boolean Raw page or false. - * @access public - */ - function click($label) { - $raw = $this->clickSubmit($label); - if (! $raw) { - $raw = $this->clickLink($label); - } - if (! $raw) { - $raw = $this->clickImage($label); - } - return $raw; - } - - /** - * Tests to see if a click target exists. - * @param string $label Visible text or alt text. - * @return boolean True if target present. - * @access public - */ - function isClickable($label) { - return $this->isSubmit($label) || ($this->getLink($label) !== false) || $this->isImage($label); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/collector.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/collector.php deleted file mode 100644 index 0f8e91f..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/collector.php +++ /dev/null @@ -1,122 +0,0 @@ - - * @package SimpleTest - * @subpackage UnitTester - * @version $Id: collector.php 1784 2008-04-26 13:07:14Z pp11 $ - */ - -/** - * The basic collector for {@link GroupTest} - * - * @see collect(), GroupTest::collect() - * @package SimpleTest - * @subpackage UnitTester - */ -class SimpleCollector { - - /** - * Strips off any kind of slash at the end so as to normalise the path. - * @param string $path Path to normalise. - * @return string Path without trailing slash. - */ - protected function removeTrailingSlash($path) { - if (substr($path, -1) == DIRECTORY_SEPARATOR) { - return substr($path, 0, -1); - } elseif (substr($path, -1) == '/') { - return substr($path, 0, -1); - } else { - return $path; - } - } - - /** - * Scans the directory and adds what it can. - * @param object $test Group test with {@link GroupTest::addTestFile()} method. - * @param string $path Directory to scan. - * @see _attemptToAdd() - */ - function collect(&$test, $path) { - $path = $this->removeTrailingSlash($path); - if ($handle = opendir($path)) { - while (($entry = readdir($handle)) !== false) { - if ($this->isHidden($entry)) { - continue; - } - $this->handle($test, $path . DIRECTORY_SEPARATOR . $entry); - } - closedir($handle); - } - } - - /** - * This method determines what should be done with a given file and adds - * it via {@link GroupTest::addTestFile()} if necessary. - * - * This method should be overriden to provide custom matching criteria, - * such as pattern matching, recursive matching, etc. For an example, see - * {@link SimplePatternCollector::_handle()}. - * - * @param object $test Group test with {@link GroupTest::addTestFile()} method. - * @param string $filename A filename as generated by {@link collect()} - * @see collect() - * @access protected - */ - protected function handle(&$test, $file) { - if (is_dir($file)) { - return; - } - $test->addFile($file); - } - - /** - * Tests for hidden files so as to skip them. Currently - * only tests for Unix hidden files. - * @param string $filename Plain filename. - * @return boolean True if hidden file. - * @access private - */ - protected function isHidden($filename) { - return strncmp($filename, '.', 1) == 0; - } -} - -/** - * An extension to {@link SimpleCollector} that only adds files matching a - * given pattern. - * - * @package SimpleTest - * @subpackage UnitTester - * @see SimpleCollector - */ -class SimplePatternCollector extends SimpleCollector { - private $pattern; - - /** - * - * @param string $pattern Perl compatible regex to test name against - * See {@link http://us4.php.net/manual/en/reference.pcre.pattern.syntax.php PHP's PCRE} - * for full documentation of valid pattern.s - */ - function __construct($pattern = '/php$/i') { - $this->pattern = $pattern; - } - - /** - * Attempts to add files that match a given pattern. - * - * @see SimpleCollector::_handle() - * @param object $test Group test with {@link GroupTest::addTestFile()} method. - * @param string $path Directory to scan. - * @access protected - */ - protected function handle(&$test, $filename) { - if (preg_match($this->pattern, $filename)) { - parent::handle($test, $filename); - } - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/compatibility.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/compatibility.php deleted file mode 100644 index 6e90fe4..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/compatibility.php +++ /dev/null @@ -1,166 +0,0 @@ -= 0) { - eval('$copy = clone $object;'); - return $copy; - } - return $object; - } - - /** - * Identity test. Drops back to equality + types for PHP5 - * objects as the === operator counts as the - * stronger reference constraint. - * @param mixed $first Test subject. - * @param mixed $second Comparison object. - * @return boolean True if identical. - * @access public - */ - static function isIdentical($first, $second) { - if (version_compare(phpversion(), '5') >= 0) { - return SimpleTestCompatibility::isIdenticalType($first, $second); - } - if ($first != $second) { - return false; - } - return ($first === $second); - } - - /** - * Recursive type test. - * @param mixed $first Test subject. - * @param mixed $second Comparison object. - * @return boolean True if same type. - * @access private - */ - protected static function isIdenticalType($first, $second) { - if (gettype($first) != gettype($second)) { - return false; - } - if (is_object($first) && is_object($second)) { - if (get_class($first) != get_class($second)) { - return false; - } - return SimpleTestCompatibility::isArrayOfIdenticalTypes( - get_object_vars($first), - get_object_vars($second)); - } - if (is_array($first) && is_array($second)) { - return SimpleTestCompatibility::isArrayOfIdenticalTypes($first, $second); - } - if ($first !== $second) { - return false; - } - return true; - } - - /** - * Recursive type test for each element of an array. - * @param mixed $first Test subject. - * @param mixed $second Comparison object. - * @return boolean True if identical. - * @access private - */ - protected static function isArrayOfIdenticalTypes($first, $second) { - if (array_keys($first) != array_keys($second)) { - return false; - } - foreach (array_keys($first) as $key) { - $is_identical = SimpleTestCompatibility::isIdenticalType( - $first[$key], - $second[$key]); - if (! $is_identical) { - return false; - } - } - return true; - } - - /** - * Test for two variables being aliases. - * @param mixed $first Test subject. - * @param mixed $second Comparison object. - * @return boolean True if same. - * @access public - */ - static function isReference(&$first, &$second) { - if (version_compare(phpversion(), '5', '>=') && is_object($first)) { - return ($first === $second); - } - if (is_object($first) && is_object($second)) { - $id = uniqid("test"); - $first->$id = true; - $is_ref = isset($second->$id); - unset($first->$id); - return $is_ref; - } - $temp = $first; - $first = uniqid("test"); - $is_ref = ($first === $second); - $first = $temp; - return $is_ref; - } - - /** - * Test to see if an object is a member of a - * class hiearchy. - * @param object $object Object to test. - * @param string $class Root name of hiearchy. - * @return boolean True if class in hiearchy. - * @access public - */ - static function isA($object, $class) { - if (version_compare(phpversion(), '5') >= 0) { - if (! class_exists($class, false)) { - if (function_exists('interface_exists')) { - if (! interface_exists($class, false)) { - return false; - } - } - } - eval("\$is_a = \$object instanceof $class;"); - return $is_a; - } - if (function_exists('is_a')) { - return is_a($object, $class); - } - return ((strtolower($class) == get_class($object)) - or (is_subclass_of($object, $class))); - } - - /** - * Sets a socket timeout for each chunk. - * @param resource $handle Socket handle. - * @param integer $timeout Limit in seconds. - * @access public - */ - static function setTimeout($handle, $timeout) { - if (function_exists('stream_set_timeout')) { - stream_set_timeout($handle, $timeout, 0); - } elseif (function_exists('socket_set_timeout')) { - socket_set_timeout($handle, $timeout, 0); - } elseif (function_exists('set_socket_timeout')) { - set_socket_timeout($handle, $timeout, 0); - } - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/cookies.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/cookies.php deleted file mode 100644 index 675bd20..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/cookies.php +++ /dev/null @@ -1,380 +0,0 @@ -host = false; - $this->name = $name; - $this->value = $value; - $this->path = ($path ? $this->fixPath($path) : "/"); - $this->expiry = false; - if (is_string($expiry)) { - $this->expiry = strtotime($expiry); - } elseif (is_integer($expiry)) { - $this->expiry = $expiry; - } - $this->is_secure = $is_secure; - } - - /** - * Sets the host. The cookie rules determine - * that the first two parts are taken for - * certain TLDs and three for others. If the - * new host does not match these rules then the - * call will fail. - * @param string $host New hostname. - * @return boolean True if hostname is valid. - * @access public - */ - function setHost($host) { - if ($host = $this->truncateHost($host)) { - $this->host = $host; - return true; - } - return false; - } - - /** - * Accessor for the truncated host to which this - * cookie applies. - * @return string Truncated hostname. - * @access public - */ - function getHost() { - return $this->host; - } - - /** - * Test for a cookie being valid for a host name. - * @param string $host Host to test against. - * @return boolean True if the cookie would be valid - * here. - */ - function isValidHost($host) { - return ($this->truncateHost($host) === $this->getHost()); - } - - /** - * Extracts just the domain part that determines a - * cookie's host validity. - * @param string $host Host name to truncate. - * @return string Domain or false on a bad host. - * @access private - */ - protected function truncateHost($host) { - $tlds = SimpleUrl::getAllTopLevelDomains(); - if (preg_match('/[a-z\-]+\.(' . $tlds . ')$/i', $host, $matches)) { - return $matches[0]; - } elseif (preg_match('/[a-z\-]+\.[a-z\-]+\.[a-z\-]+$/i', $host, $matches)) { - return $matches[0]; - } - return false; - } - - /** - * Accessor for name. - * @return string Cookie key. - * @access public - */ - function getName() { - return $this->name; - } - - /** - * Accessor for value. A deleted cookie will - * have an empty string for this. - * @return string Cookie value. - * @access public - */ - function getValue() { - return $this->value; - } - - /** - * Accessor for path. - * @return string Valid cookie path. - * @access public - */ - function getPath() { - return $this->path; - } - - /** - * Tests a path to see if the cookie applies - * there. The test path must be longer or - * equal to the cookie path. - * @param string $path Path to test against. - * @return boolean True if cookie valid here. - * @access public - */ - function isValidPath($path) { - return (strncmp( - $this->fixPath($path), - $this->getPath(), - strlen($this->getPath())) == 0); - } - - /** - * Accessor for expiry. - * @return string Expiry string. - * @access public - */ - function getExpiry() { - if (! $this->expiry) { - return false; - } - return gmdate("D, d M Y H:i:s", $this->expiry) . " GMT"; - } - - /** - * Test to see if cookie is expired against - * the cookie format time or timestamp. - * Will give true for a session cookie. - * @param integer/string $now Time to test against. Result - * will be false if this time - * is later than the cookie expiry. - * Can be either a timestamp integer - * or a cookie format date. - * @access public - */ - function isExpired($now) { - if (! $this->expiry) { - return true; - } - if (is_string($now)) { - $now = strtotime($now); - } - return ($this->expiry < $now); - } - - /** - * Ages the cookie by the specified number of - * seconds. - * @param integer $interval In seconds. - * @public - */ - function agePrematurely($interval) { - if ($this->expiry) { - $this->expiry -= $interval; - } - } - - /** - * Accessor for the secure flag. - * @return boolean True if cookie needs SSL. - * @access public - */ - function isSecure() { - return $this->is_secure; - } - - /** - * Adds a trailing and leading slash to the path - * if missing. - * @param string $path Path to fix. - * @access private - */ - protected function fixPath($path) { - if (substr($path, 0, 1) != '/') { - $path = '/' . $path; - } - if (substr($path, -1, 1) != '/') { - $path .= '/'; - } - return $path; - } -} - -/** - * Repository for cookies. This stuff is a - * tiny bit browser dependent. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleCookieJar { - private $cookies; - - /** - * Constructor. Jar starts empty. - * @access public - */ - function __construct() { - $this->cookies = array(); - } - - /** - * Removes expired and temporary cookies as if - * the browser was closed and re-opened. - * @param string/integer $now Time to test expiry against. - * @access public - */ - function restartSession($date = false) { - $surviving_cookies = array(); - for ($i = 0; $i < count($this->cookies); $i++) { - if (! $this->cookies[$i]->getValue()) { - continue; - } - if (! $this->cookies[$i]->getExpiry()) { - continue; - } - if ($date && $this->cookies[$i]->isExpired($date)) { - continue; - } - $surviving_cookies[] = $this->cookies[$i]; - } - $this->cookies = $surviving_cookies; - } - - /** - * Ages all cookies in the cookie jar. - * @param integer $interval The old session is moved - * into the past by this number - * of seconds. Cookies now over - * age will be removed. - * @access public - */ - function agePrematurely($interval) { - for ($i = 0; $i < count($this->cookies); $i++) { - $this->cookies[$i]->agePrematurely($interval); - } - } - - /** - * Sets an additional cookie. If a cookie has - * the same name and path it is replaced. - * @param string $name Cookie key. - * @param string $value Value of cookie. - * @param string $host Host upon which the cookie is valid. - * @param string $path Cookie path if not host wide. - * @param string $expiry Expiry date. - * @access public - */ - function setCookie($name, $value, $host = false, $path = '/', $expiry = false) { - $cookie = new SimpleCookie($name, $value, $path, $expiry); - if ($host) { - $cookie->setHost($host); - } - $this->cookies[$this->findFirstMatch($cookie)] = $cookie; - } - - /** - * Finds a matching cookie to write over or the - * first empty slot if none. - * @param SimpleCookie $cookie Cookie to write into jar. - * @return integer Available slot. - * @access private - */ - protected function findFirstMatch($cookie) { - for ($i = 0; $i < count($this->cookies); $i++) { - $is_match = $this->isMatch( - $cookie, - $this->cookies[$i]->getHost(), - $this->cookies[$i]->getPath(), - $this->cookies[$i]->getName()); - if ($is_match) { - return $i; - } - } - return count($this->cookies); - } - - /** - * Reads the most specific cookie value from the - * browser cookies. Looks for the longest path that - * matches. - * @param string $host Host to search. - * @param string $path Applicable path. - * @param string $name Name of cookie to read. - * @return string False if not present, else the - * value as a string. - * @access public - */ - function getCookieValue($host, $path, $name) { - $longest_path = ''; - foreach ($this->cookies as $cookie) { - if ($this->isMatch($cookie, $host, $path, $name)) { - if (strlen($cookie->getPath()) > strlen($longest_path)) { - $value = $cookie->getValue(); - $longest_path = $cookie->getPath(); - } - } - } - return (isset($value) ? $value : false); - } - - /** - * Tests cookie for matching against search - * criteria. - * @param SimpleTest $cookie Cookie to test. - * @param string $host Host must match. - * @param string $path Cookie path must be shorter than - * this path. - * @param string $name Name must match. - * @return boolean True if matched. - * @access private - */ - protected function isMatch($cookie, $host, $path, $name) { - if ($cookie->getName() != $name) { - return false; - } - if ($host && $cookie->getHost() && ! $cookie->isValidHost($host)) { - return false; - } - if (! $cookie->isValidPath($path)) { - return false; - } - return true; - } - - /** - * Uses a URL to sift relevant cookies by host and - * path. Results are list of strings of form "name=value". - * @param SimpleUrl $url Url to select by. - * @return array Valid name and value pairs. - * @access public - */ - function selectAsPairs($url) { - $pairs = array(); - foreach ($this->cookies as $cookie) { - if ($this->isMatch($cookie, $url->getHost(), $url->getPath(), $cookie->getName())) { - $pairs[] = $cookie->getName() . '=' . $cookie->getValue(); - } - } - return $pairs; - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/default_reporter.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/default_reporter.php deleted file mode 100644 index 9ec708d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/default_reporter.php +++ /dev/null @@ -1,163 +0,0 @@ - 'case', 'c' => 'case', - 'test' => 'test', 't' => 'test', - ); - private $case = ''; - private $test = ''; - private $xml = false; - private $help = false; - private $no_skips = false; - - /** - * Parses raw command line arguments into object properties. - * @param string $arguments Raw commend line arguments. - */ - function __construct($arguments) { - if (! is_array($arguments)) { - return; - } - foreach ($arguments as $i => $argument) { - if (preg_match('/^--?(test|case|t|c)=(.+)$/', $argument, $matches)) { - $property = $this->to_property[$matches[1]]; - $this->$property = $matches[2]; - } elseif (preg_match('/^--?(test|case|t|c)$/', $argument, $matches)) { - $property = $this->to_property[$matches[1]]; - if (isset($arguments[$i + 1])) { - $this->$property = $arguments[$i + 1]; - } - } elseif (preg_match('/^--?(xml|x)$/', $argument)) { - $this->xml = true; - } elseif (preg_match('/^--?(no-skip|no-skips|s)$/', $argument)) { - $this->no_skips = true; - } elseif (preg_match('/^--?(help|h)$/', $argument)) { - $this->help = true; - } - } - } - - /** - * Run only this test. - * @return string Test name to run. - */ - function getTest() { - return $this->test; - } - - /** - * Run only this test suite. - * @return string Test class name to run. - */ - function getTestCase() { - return $this->case; - } - - /** - * Output should be XML or not. - * @return boolean True if XML desired. - */ - function isXml() { - return $this->xml; - } - - /** - * Output should suppress skip messages. - * @return boolean True for no skips. - */ - function noSkips() { - return $this->no_skips; - } - - /** - * Output should be a help message. Disabled during XML mode. - * @return boolean True if help message desired. - */ - function help() { - return $this->help && !$this->xml; - } - - /** - * Returns plain-text help message for command line runner. - * @return string String help message - */ - function getHelpText() { - return << [args...] - - -c Run only the test-case - -t Run only the test method - -s Suppress skip messages - -x Return test results in XML - -h Display this help message - -HELP; - } - -} - -/** - * The default reporter used by SimpleTest's autorun - * feature. The actual reporters used are dependency - * injected and can be overridden. - * @package SimpleTest - * @subpackage UnitTester - */ -class DefaultReporter extends SimpleReporterDecorator { - - /** - * Assembles the appopriate reporter for the environment. - */ - function __construct() { - if (SimpleReporter::inCli()) { - $parser = new SimpleCommandLineParser($_SERVER['argv']); - $interfaces = $parser->isXml() ? array('XmlReporter') : array('TextReporter'); - if ($parser->help()) { - // I'm not sure if we should do the echo'ing here -- ezyang - echo $parser->getHelpText(); - exit(1); - } - $reporter = new SelectiveReporter( - SimpleTest::preferred($interfaces), - $parser->getTestCase(), - $parser->getTest()); - if ($parser->noSkips()) { - $reporter = new NoSkipsReporter($reporter); - } - } else { - $reporter = new SelectiveReporter( - SimpleTest::preferred('HtmlReporter'), - @$_GET['c'], - @$_GET['t']); - if (@$_GET['skips'] == 'no' || @$_GET['show-skips'] == 'no') { - $reporter = new NoSkipsReporter($reporter); - } - } - parent::__construct($reporter); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/detached.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/detached.php deleted file mode 100644 index a325e14..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/detached.php +++ /dev/null @@ -1,96 +0,0 @@ -command = $command; - $this->dry_command = $dry_command ? $dry_command : $command; - $this->size = false; - } - - /** - * Accessor for the test name for subclasses. - * @return string Name of the test. - * @access public - */ - function getLabel() { - return $this->command; - } - - /** - * Runs the top level test for this class. Currently - * reads the data as a single chunk. I'll fix this - * once I have added iteration to the browser. - * @param SimpleReporter $reporter Target of test results. - * @returns boolean True if no failures. - * @access public - */ - function run(&$reporter) { - $shell = &new SimpleShell(); - $shell->execute($this->command); - $parser = &$this->createParser($reporter); - if (! $parser->parse($shell->getOutput())) { - trigger_error('Cannot parse incoming XML from [' . $this->command . ']'); - return false; - } - return true; - } - - /** - * Accessor for the number of subtests. - * @return integer Number of test cases. - * @access public - */ - function getSize() { - if ($this->size === false) { - $shell = &new SimpleShell(); - $shell->execute($this->dry_command); - $reporter = &new SimpleReporter(); - $parser = &$this->createParser($reporter); - if (! $parser->parse($shell->getOutput())) { - trigger_error('Cannot parse incoming XML from [' . $this->dry_command . ']'); - return false; - } - $this->size = $reporter->getTestCaseCount(); - } - return $this->size; - } - - /** - * Creates the XML parser. - * @param SimpleReporter $reporter Target of test results. - * @return SimpleTestXmlListener XML reader. - * @access protected - */ - protected function &createParser(&$reporter) { - return new SimpleTestXmlParser($reporter); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/en/docs.css b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/en/docs.css deleted file mode 100644 index 18368a0..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/en/docs.css +++ /dev/null @@ -1,121 +0,0 @@ -body { - padding-left: 3%; - padding-right: 3%; -} -h1, h2, h3 { - font-family: sans-serif; -} -h1 { - text-align: center; -} -pre { - font-family: "courier new", courier, typewriter, monospace; - font-size: 90%; - border: 1px solid; - border-color: #999966; - background-color: #ffffcc; - padding: 5px; - margin-left: 20px; - margin-right: 40px; -} -.code, .new_code, pre.new_code { - font-family: "courier new", courier, typewriter, monospace; - font-weight: bold; -} -div.copyright { - font-size: 80%; - color: gray; -} -div.copyright a { - margin-top: 1em; - color: gray; -} -ul.api { - border: 2px outset; - border-color: gray; - background-color: white; - margin: 5px; - margin-left: 5%; - margin-right: 5%; -} -ul.api li { - margin-top: 0.2em; - margin-bottom: 0.2em; - list-style: none; - text-indent: -3em; - padding-left: 1em; -} -div.demo { - border: 4px ridge; - border-color: gray; - padding: 10px; - margin: 5px; - margin-left: 20px; - margin-right: 40px; - background-color: white; -} -div.demo span.fail { - color: red; -} -div.demo span.pass { - color: green; -} -div.demo h1 { - font-size: 12pt; - text-align: left; - font-weight: bold; -} -div.menu { - text-align: center; -} -table { - border: 2px outset; - border-color: gray; - background-color: white; - margin: 5px; - margin-left: 5%; - margin-right: 5%; -} -td { - font-size: 90%; -} -.shell { - color: white; -} -pre.shell { - border: 4px ridge; - border-color: gray; - padding: 10px; - margin: 5px; - margin-left: 20px; - margin-right: 40px; - background-color: #000100; - color: #99ff99; - font-size: 90%; -} -pre.file { - color: black; - border: 1px solid; - border-color: black; - padding: 10px; - margin: 5px; - margin-left: 20px; - margin-right: 40px; - background-color: white; - font-size: 90%; -} -form.demo { - background-color: lightgray; - border: 4px outset; - border-color: lightgray; - padding: 10px; - margin-right: 40%; -} -dl, dd { - margin: 10px; - margin-left: 30px; -} -em { - font-weight: bold; - font-family: "courier new", courier, typewriter, monospace; -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/fr/docs.css b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/fr/docs.css deleted file mode 100644 index 4917048..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/fr/docs.css +++ /dev/null @@ -1,84 +0,0 @@ -body { - padding-left: 3%; - padding-right: 3%; -} -pre { - font-family: "courier new", courier; - font-size: 80%; - border: 1px solid; - background-color: #cccccc; - padding: 5px; - margin-left: 5%; - margin-right: 8%; -} -.code, .new_code, pre.new_code { - font-weight: bold; -} -div.copyright { - font-size: 80%; - color: gray; -} -div.copyright a { - color: gray; -} -ul.api { - padding-left: 0em; - padding-right: 25%; -} -ul.api li { - margin-top: 0.2em; - margin-bottom: 0.2em; - list-style: none; - text-indent: -3em; - padding-left: 3em; -} -div.demo { - border: 4px ridge; - border-color: gray; - padding: 10px; - margin: 5px; - margin-left: 20px; - margin-right: 40px; - background-color: white; -} -div.demo span.fail { - color: red; -} -div.demo span.pass { - color: green; -} -div.demo h1 { - font-size: 12pt; - text-align: left; - font-weight: bold; -} -table { - border: 2px outset; - border-color: gray; - background-color: white; - margin: 5px; - margin-left: 5%; - margin-right: 5%; -} -td { - font-size: 80%; -} -.shell { - color: white; -} -pre.shell { - border: 4px ridge; - border-color: gray; - padding: 10px; - margin: 5px; - margin-left: 20px; - margin-right: 40px; - background-color: black; -} -form.demo { - background-color: lightgray; - border: 4px outset; - border-color: lightgray; - padding: 10px; - margin-right: 40%; -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/lastcraft/README b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/lastcraft/README deleted file mode 100644 index 488198a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/lastcraft/README +++ /dev/null @@ -1 +0,0 @@ -Output folder for Lastcraft site versions of documentation. \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/onpk/README b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/onpk/README deleted file mode 100644 index fc1dd62..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/onpk/README +++ /dev/null @@ -1 +0,0 @@ -Rpertoire utilis pour l'extraction de la documentation au format du site onpk.net \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/pkg/README b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/pkg/README deleted file mode 100644 index 821b4f6..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/pkg/README +++ /dev/null @@ -1 +0,0 @@ -Files here are generated from make_phpdoc_docs.sh \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/README b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/README deleted file mode 100644 index 4126955..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/README +++ /dev/null @@ -1 +0,0 @@ -Output folder for SimpleTest.org site versions of content, documentation & tutorial. \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/favicon.ico b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/favicon.ico deleted file mode 100644 index d4c1cc1225da193f0c2d7ad1ee6015761f2e2203..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1150 zcmZQzU<5(|0R|wcz>vYhz#zuJz@P!dKp~(AL>x#lFaYJy!TB1NKK^*8gscW1d*S)6$;LAo{vzYT9scM3{Qbj~#`|hnzhnex=!$0}u%l{S5ne(sd?3LGX>6;uMo6KYa zhk^fc-mn{9$a{J9C z$15*Sh6CLzyzbhpYGl1IcH{n}o&Ns+PQ&!VXaRwLKi<9jCku1mvP=DwV0w`0vR$Ev z#Ka)>!t}!EW5@ob!1UjLciqWy4*MTuy&(3sTT2Q}P5(WG>4DL#tpESsz5Cbd{IkQs zi!XG~-*snY?uHxlCO9n+`U=u#HHYKxq!Z=qfN70=)24rkEG+;3!1RLXjEuj>`;Qf` zgM}eTPux1wr_Vn`|DX3RKUHyfr0AHC-4j3$tJbey}*;}$-BFu5ZSx22%#1@T)Crf-6&!AAqrF+VV^ z-9|RUX@T(PhwpC@%mXlUzx@0py5M~0q~aa^hkA|{ta<$5jv-7Anf_7F!0^Ey2`e)& nyl`Y-XgJl#C2a3I>x?(LW)lprr(ZsTrwh85p2YDEX6T%+Daq z^bjcIUzY$Mj)L$&B>4Cw5DG8_1qNb+f%iQC=!2iQz<(FO ze+m!_8|T4Gd;&tE2ZQ>@04yLjHr9jx4*(C=z7P8V955~!Bd;VLxta;+nG*$HKwJ(! zlT>vlrTWAXGry^GAORuO6KWdT=Py`Zva-E;E$~KANLc!vjI5lzf})0|mbQ+r-bXX@ zPZpL|);2D#ZtidoPp_chkkGI%U&G@Q5|ffsQqvIMbMx{G3X6(MYHI818ycIMTe`Y? zdi#+51A~)O(=({qUvu*-t843jHa54mcQD5%r)TFEmsi*S;sOG&{{!nm{|DIr-~vBz zVLgNe2lOv4AQt>#VuNvT8F}%@B-KDBPUO${0`MuM;&Q4x37GiRk0?!@CkUySU#&dH z{0r^h$^Lg>f&VYE{{s7Ou6e*CY~Vxiu)zQcz!s%%@%o4M>9z1X{M)?XXfKT!E5Q*V zC)8)!uEdyAw{w^4fWH*wD%lvV`)(qxfdiz7yk^Lw&{i ztP-m!1LFa2ha#~$@{X$aMW34pb&q;(e|nq*>CGtTo7s@Cw%hugF;$`VxK`@SoG4rj zdTKa0)*Ki3K(n`O`i2hjO=b^I2@BOmMxxBs#Dd;h_Xws<#wZi<3XU)p)0l}8i zhO(O~4p6INxQ(WPH1j7~vfpq&{Xb)NXZuFhmm1ftoY4l$80>Ss#Y{swD z=(SN?dM3i|kbmPMK}w8*ptH z|E0=mmL?j}yh0;(T-1D4nW|U7esvGP{VO-m5rg#?xq1&6u3a9346RB~SsOtODa+QU z?bYXABs**AMFScl`?il=eo{q3+3YbUlnf|gN!4`g> ztZni%tg`NAD8lxe5WfR&$hvCU8|+BzGfMQWVDqFyJG~Fbj9Z&(KdQp=??hxx`|f~+ z!bfvD$pr=H8~3d>0!7K*?M<$ z|3T+bA697!pBLBWi&d*Mbz9FIj@Fc6sb**lDzz_fdO34eTi-T`{gql7S7EglydY{YAF8tFo9enxA^1;S&7MO|{!ty`DuKP{x2GahbKTGQ&dVhg_2!utn`R(2 zL~cbZaVqA$PP1((gw`D{*i=|IRo6y)qk6p28m4q&Kgsc^hq0f;n_Y_U#ID~HlR#mf zOom4&B-r6lAy}b1k?y)7Quwuy1x|Ml&=I=wk@1mPui7p-(&tCE<*}wwHmt?IgwS%^9^g-+pd}SI-0#~_v5bwZ<%fn;K1hn-<@`Um#gRHmw>Xe&& zeAkO6X@08a6PhI8VjaM62$Bk)x zDG%xMlpuMW>P@-u&stWe^JMt&|8V%hCgShhaJU}Wd)4`A&BPMlq>qMzBB zdY|t2y6D#Y(o+%{d0nQV#PkFnCtb@c#GEi7R9wCs2tDILLT^fNT{Kp#i%%54FWvZe z3g-938WT(O?4Cxji*cb>`a`C66f=E`>%t7eurKUQM7{oD4XnDH3gzx95K!DdqHDMvB;Hysq^A zdCakUozYiYeh;u}EBkWHY-C23O@&Vx&7UdHf+kPq0S1X2gr}CZe>{B#qceGmQYdK$Wx=w7N+F`vp zC(MkqE=q)8aIy_OZ@2PS#>fZpYrVbfu z8Zk7StPwkpmXSLLZ#OfvY!=P^o_5k&8PAD7)&G_}f5g$*;GDf4Fv|eA-MXIPTD{IN zLJF6vK5OCRm#X_QwH!N&Q5-zjd&@-FV^)Neyq-jFHKfq;jcwxp(d0m8Iv(T(Aq5$P zR%6OFjAJ<%bS?}w+@}(CBt5ew9fZ+$1sY606baNq7CKx4UDUht=Dy|C>MrTTkGC{4 zn?y7YJ9@v|9$#C^LKV+%i5IJ%TfXW-P_=ZgpcUd@<{-3EhDdZPq|F=c&N`q;Z+(QY z*4%cvWSu{FpUiF_j;PME!r6CTx6*IXYtY!d^(f%2$c;3ex)RKh5hYD^T1t^TdsFdh z#C{OGVS{;>{u1IHW9NEJC||e#X`!zr&u&K`>Eu_e7=Evv2VznwiVtH%iTFVDPH{75 z6SC}DDPG?i|6A=Vqr0BoXDQ*(F=&RL$7KRpr5m*Aj_%H&t08{FpTEJEu4i)S`Q#3` zbWqYczUH8#W0_Pj=!T`ok?G~MCRVG;bLY3G^g4PaHXr@MlP_p9zr()A-PVQ>r$={S zsS1`eBwtuFjFck9esuG;2uMQe^EvJTc%g)EO1YJlP5-WE+?*ZpVZO7O}=lDO{ z{6K|@<_PV&7boJ2v;%c7v=-=rp9Lw=HcAw4s8E=kcxz_p%Qfuuge|rnRF3>}Stp}J zm++ic;B~O3i7hk+h>f>|S-c_#*`yoxCtJM4MX$4LN9*M{H zfxqznUIs0O@m=gX**&1ep#?NG9W&ZIM(V+C5QJ>>8W}BNsY=T;d2F$?GdCYe3gCub zj8Xio-)TTa{An)ZBUFBIc#)byEAZpkA^B3|2<};-3Svt4nndQ?F4+qIX4uQu3yz6z z9$*l*Xp_4Uc-ct;bg&OhZ>Y+iXS!pjv7BMbPg&5pZd18vy&2>BJB$IO@=W8q+#1=& z7(2LJO_yeSM238tj@_rG&bWjo!7q}lLWO{G<(9ESP5PAo_?@dNE*JMSg@|kBUeH!R za%>y9e;fx)rp~;i*U;733hTf^cx9#f+E9+j^EdfgyW%$Q#N(Q-39iTbvVF6j_w7Zd zJ+EWarA$laNZ8>6d8K^F+6(_=WtpTD>r*t8bn(=DZHw4^`}!>M`is7I(VT@^(!v|r zJHnPTjZ7ZzxLG$p*6?n*$LTEfV`ytl*TwNMs!InI)PDJ1=FZNdiP^bz7ysUa!+nyEP8 zwwQGNR%Cu`{@h_RmU=(PJjvl|tK$HG9nI4NX^$ejou0v2%6PPqaiCgeB$wY`_3lKq z=>1LYpJa>WQ?+Z-u}H*3J;J#53K2ZfrvL=0=LUp|5m`=Qr@JU(tZ9ks5J5XtV{Er4 z3(9;n1oWFRcQ}4nH5EQ^SV@QWAc6fVwYa&Wo{BK}pD>d^{=x8lWu)w=UKby{x<0?W z7_kb^VAKLqMgW{u#VIQTJ8 zutDJdPwO(GA(4G4PHx@SqbXbUt(M?|14`4lQab=PR>BFuC7y&ANjY~Ztug_t`}QqL zeAH@XhG&&1mWbKorVuUiWw(PP-?(p|tfUN7h!vUv9$jkvJdgLA;o4Dzfm54!# zCuIbOoopgP-WK*>oW=F_h$236Ec@{MPF)IUA?5km|(z zGF8(uE6S7#O8y>*uWb!ympE5g9&#aRmhS;!>NX!k_e~D$_5(Nx6@Utb@0aP# z2<1CFH#3vAQ|4vU^0%qZg~dvwpU>&8hKUZ6at!-QttafqD2~?7#?Nauqc|!!3**Ha z&M~zuh9YrMmA7_|0FCIYHEO?#*ZM59Nobk7+Nbg>;ex|MH11u!vxz1+I5WD2g4!@E~c` zIpsHT#pxL2qep3{*Fp=KvSXN5eY7_35Ov>bYi)BhiL_I4|Mr;2MdNpkb7KB|Ynu7F ztf2u0Df7op3-Nd!Wn!csBR))*@73)R+spqEv<+!6Z!~t^1ELRpcxiEmH_l#bj>|kc zv^I@Pwv?Uc6I0Fi(2M5s(9Y#FKR*`psReO#eGl1ljWaMXy!<|SJlS_Vvh*ZOO)vYC zayD6{!j%$e8O9Q7-_-&K`=%D~p;c5XDNowM_OT1LsU9k-B<^}yIl&}NGpP2{tid+A zm5bg=VvioN`n*i7rOEeXTmyhJY-XNoT7-mNx@L(i(uj#*FFl8b#eR70^D3e%os^>Q z_4W2;mKudd$3sqqU}a{T`&w-gxzu1p;rrrQ;#vHI)%4SU@B2-e*y9+D10YgH}hApSjtOb%~?qXVx)OtsNw zJN{`lJ$+pN>x>F(0k3fw+b#5&mCAB?eKd_Kjy7aTOJDWfkQP1TU_^4J_k4M6e7jQ3 zfvkw54nd@kCT)IObYZTcs$;@v_{NI%Vwwe=_=;2>kKIcq9Jj(woNI$97=2Si zGHyeoVKZYGQNn&xR(7dluM5R!=-A`FPDWr&udn3JPiaGAT{qTVPTD&XONuYl7WR{KP!Gck z7@Kx*+Dei;v^k{{Dkb7YJN>QW;pweo{W!=;a%^?MP(a-?k>xZC&3F4rBu;i2q=tD# z`}1qgar@A-k#ikK!@=~ZUn`nkew620P9ByD&zr{tmEs3EU%^chpgTGz5^KsP>- z6>!22f(2ES=M55c8`CxjCs7Sb>mH}c)ToFr`}r;IVVaNMna>BY1hhhzSPF&i0gS~s z?=a;gD!k(X>E>v?$Na+Gp<$b& zu=li8Rkv%Pugua5Ip)&GIz^!3G0|mr$XQ|+0`%%G;egw&m2QRIXk^QxdWXU2CI{}v>-dsQ+T8^1S)ntS| zz5T=sBq7mCS$f9#E$!rQyYbE5G-hG6Vf||I)9AzrBq-sIor@?W{v|?{Q}3!v9P_(f z*a?-OF^!u?W%RL^Wu75P={?wkW;bYCxhdcMWgl$L-s<)6J>XR~ah zvfZaA>p_1}(9^$%#aGP&U>#M>H;l_ze@{w*vPqO$_UT}`840@5_$Y{6N{~3Hyj;!b zwSbEYK}mfWOB4!!TMN$&SEJ<|{YKat2M<0t>O$~^1d%GvHuzlaP$L^10b0MH%Eh+& zF8%(ko#K?VXR?omf!chmpr(O+qjfN~y}7!4pL~V(rXnWt8a9lrTOH_WE^bgQ6GU(6 z2e|TzEFdkq{mZi36tn5?c`b2nPyW}pvKay^UA%oW#ck2pGnKr!a# zeBM&VBRj&9NH73Q+-Kh3b3$hKsrr?hMS0?9Zwg_zL5+I+MQ*xpL z#IhUsCpAJDPgts$2}}EIHkw;+OfQ1&0Z=mkE!kq?xh>m$(?beBx7XIMAdoGKh*G93e6A6pca^vlOlCe+xu>N_I1n5z>4aiH{P234VE*ADX7)ze6i^s&=J!> zq)bTU3CmiaSq#HrP1w>$%?p7Kkmy%pka_L1{x>J`90a0)%MH(sT24SUf z;p2I~_seU}{JCbXIdkUE%zfX^-Yx?u)l{G=032KZ!0yffxBCF9=dW#D0suGwd;kEz zdPf}s?kn2CZ0rGcpY9l(+j&4FfRdDyl#G;;jEs_jf}Dck0WBpZ?E^N3f567d0K5YO zD=UbLn+wD$EG#ZAEUfTK}ADFM@>yfOLb>JT6%g~;3FWA83=qN0%E-bNQ7UA zo10sR|M6oHk;jh}6y*PRiQ7*ADk4BRAPNtM1At3~gGYsP+Xu+K>yH5EuFL-c4lW)( z0U^%6@&9>B04@$59xfgsE-^kX-d*%A9YBTukeWc0Mp2i;+Ea{{j_?^MJhcebJ7$9v z*Yk=nSm8X<=b{4O+{p+C3IC<~M+l(8eJH9+ji+cG&OvkJnOY>K*E{yi21$!rIo8L& zodb~J;oNnKM+J}vtdu$&f-6?#yK~z=eiJBI4-LScjyoJ*j47r(AZABvKpbMk4%!=7 zIAoRR=lrOHCC{c=vR_-QSILP<=tV;*f2P(GfuHLMd(Lt!G*SXsppPdoPBEFe1s(Xt zZzKt*t86gD>TyzmwW<~BE9Bqe%jidNVmszja?{9g^CgQpg&N#OJuL zimJ5Pb5aII@JdN#*JmcK>2vcr=N&QoZS$0rbhAgTvGV)deo)Ks-wKne6lA^Tg+5Nr3J-=L4(Lzd;-+Nqi^>s zEGI|73_>D{uQE5S&VFw`&_OwoIe_M#DF2f<^#P+TXI#Ry{pswx;k#mcNLgk|`c=@DPeUPHWm86tzN_p3_@%(2PZWtW$97GEBYG zKgb;!*EQ1>+WaHo4ikqeQ^|U}$>f(@j6pB7KZXK%;_Pk#pzG1!b<7_HcGA7P9in;7 zIDMiP^;8lm`B?H94C%Ye8%zJ4^YKeRhDm!6ibNn4_xjyd4f8l=t2+&jj&}?cB^+H2|X} zE=|OI(qdtt&vgDm5@&&==pRDPLs61-)34hrk(?-8gy#94d-P=R0LmNH;Q7akJ?nQ4 z_tRBSEzW|EaS~h#BtcJI zVLR4tE^Lt_78aK#qnKd{@#hWo%hlr`d~R5EZ=He`QKN4=K`bXZ<6cEKvO`Wwo&L$O zDJG&fnYk)AW=~!m#2{PO>H;Gx-uG$tPFM6%+3Y%mZ7Gjx<4q&@iiJXr)rh&@$EfiX zb0GfHx&Cr5$tTi=(EMimir_GnAGrB*y$26&OzPM5;xg7njEjH8cibGYb#?1BdVv+J zOSFRCsGb-6GSmNq)Ero~7x5b&krDc08uON=gXCw&M{Q%&p@FQ7x@MH=3B9yJgDc{)=!> zw&$YU>+idd`943jEL0A^F>CerS@#eX`YFr7{eW%$-VS!^G@CK(rOrEys-lbayKvz$ zRpEOB%5pzk$$ktRTZpiHO>lRg<)lB^D}%Cep(RVi5^DLSALaM^ZYMIQnAx->5C{@Wp;DgpB&UCEe<% zJu&6@Sq84}*95hJ1PpJ>CsLDC&mdrm*VuhAIYFe_!1k`ay?t!e!eW8e#;;Xj=ds>( zkA{Y52OBg{Dd*DjFxQ1WHA96^By#X*rztV`tyesU5JPIl<5bWCiw?A(!i(aIDMc3~ z?~_`_#`1IrKgdcnbkt2r`XK%QkUCw9{#NR}GCap=BX_8L(D@O{3N$-4PFR1Cj116` zytG2n+PjsJMa+k@8q{#0GCxCE?fhrIGk;_D;?OW+Qp^gpwR5=WS{ibdqc`Z`-iy2M zlSsn)N&E``Whoqnp;%B+12it? zjS950TGwJl31!Ek$gtmP?gm4#an24LT;QN1HRCT^+xsdOOxT_=cr>B{*ibdvM3|= z>C-fuCHY7fwZG!U3{F3IdURA3L#bwds@!mIJ#1)D$T*Za?3B!R^R!*%dqR`^%3yuu zx|OQQQUNlv0=|+%fr(1x1U`xT(GR&5N`aAc!sa^@i<<6&8rY^hSN*`WEsrwo%$H3) zHyV1}rX?m>t^K|!trfj)6}x9+;-36uU8Rnxi6!me{O+xHeBgH4ykCKSZ%JbFHzq*4kT+(&-cQ8**@pF zd4$A_QENu7N)zWQoJvfKr|(z*`M&;nVpy9!MX)AzihX6Qb|*zvOWUml32A%z=9l{1 zYPn~J1Nm5XT>DIwO-1D~Hrc6U@?HofZNX}2~EW+8#C9VZ`0@z7Rx_mKvdFswhw^7~Yvz9}|O zzO&c6$=F`%r~lXr{Kwl5r0pMhMY^Zfq*MgqA7BwiVYP#kE1-u7ic=}jsWeRSE`llQA8(qv5< zx`L%}c9o*~Z~nFD7Oo`No_MrKVwdrPC3ku1e7M6pU)Y|VbniK|^#6zr2qRr}P!;2G zoQhhbI6^IYuzVEoyPr|#5Yw03&m8+|``~hR!)$fppeHb?& zHq4icq&2s>-a)PfPodQX6mz*;xrS!@e}rGyx%U)zkq#~12+^vhEORdX@jRfRnnx#^ z#C{GvlZ9)1F1HYF#ym=9B}2zisgI@!m&%_M=epbizB#30XWB>pX5a^q)wI&7MIl7j z?Aez}53x0Au_>iN-WW5ChN59?T3vHv!Tse#;VfDU?KZf$K3+n~;qzyW3$}?_0Y;Xw5{~E~|Fz zmL~>vR5Ao_(KdKxKHl=zsO0G}k$Gmer`+SQXpb;`!K}P?-I2NOfHoQ!_WooS;DxP z<`3Tc2u4)zYIhedi?qE<5AdQ3N^tK?{$iZ$`YbAEd?8yNrE z60##Xhjmx;D%25O+2FSUj{uJi2>t|g_g>v-;+{N`xdO!D)hlgT7QZ^$U0J4jePy+;tEbc`EJJHQ65O;_wOV7oRnE zx5j2-X?|J3gCCm)Ur!tccFa5#>ey3<1^m4*<=E`Tzj9M5L z+L&}0#flF%?Oy$%ly}0g8m4pr!NW7r>)YMS%hGX~yB_6|5_p)BmeOnAr2HX@c{yz! z`)}w>R6+@6?ILs?S}85xB0}aY!YudufED~YE*I?ucP2op@DQEgs!iGuZXP^KB3{DI zTt~Ds%zx}7yEM_zW7k68(<3nM-H>)=Zs)d|7!HyZ?K!9_xqgp~VYI1^GB-g1=YJYM z-1Oi0!v8oSWBQApbF@%@%|_Q`N{VBWBdaYQotb<)8z{vhU)cbEjFy~0bJ%Oak&9FJ zSt;IeSMAd&J!Sz5(!BD@kZouY%78XgB+-y$1$ZedX>NHiE_jPf)D}fw5=NBx(wS2GuECk(8IOs~hbH<-*su@LnlZ2ZH+2_Eb=I`NbxdVE6s zGFohMEoKa4L^Ge8jl5VA8ASS;>}<2V!Aqq4>zM0u!I*XrH)Ypg8{umB3=DHHj`$8) zb?-QR&4fXZpDlgws0}e^NKGvIt~DOTYvYR~LiKc`E-9K&7&D7{SxgD!Jqda&53aR& zd}cJt`(a>SL;JkO6cH` zse)FkpU&D;r_uqPoAmF36y|FJU3-Af*>r+MzCcl_M}(tZ`R@Jb2CoYf&==DpN7qbP z7+msk`CDh{R)Nil+&C}l;AacZlI3jH-9%X^^t$o=jo=rb*@>je3fTAw!qU|k7+BdS zz}Ab=e+u`Uw|G?yQk;Z7OiV^u3;gJkEY-+fqgVNGRF?d3Y8WM;ZGKu+Zi0wP?2AmM zkf~})b9s;~6RE~2DrO!&k(Kc(Rvx!j^DT>H<;*;k*0TXud9eBnYx7oC_%ozx^8FKo zZL-92^VI?|0+_ZopYzvsJ&WeU*HtB{5Y&%L16(oA8qm`xINpfZXr=W)MBBRz^XCs+ zHZ1vSc=hJ)=RXENGVAqNUlE)mTsO)-r)f z?VMWxUtZfSz~1;(!!c8IHGx^*1}Gu08?>ggk%KbD?z{_^Hx#{(` zGH3_`K1YGUbY2F~4Y54fc(q26MVO#P8I$6OChPD-MGd(M4f9WDed6{aCDD_3gx1^B z^tY4}T~?IPkxr_IloAs}%?uJ2x~8(VEmDiZQDDY7?>naR?W7PPhWr6YWU7z&< z-#xX{Hp%17CknAAMrMq4ThpH`M+p}D$wXX81RSrFt1vh`O>g{f>YQG^AIZ~HJsrjH zAD*lnBu7Mvis~#rR0dlsR8`5r0H?(xCHFA_;msDOEL-Kb9kX4Kpp<1g{)x+YoS}P-u6*xVX2f4J zTh1R7(qr_}{GO$7wpaiosx zl&Zu&+xew6HH%m_YcjySiBS{V#fZ(8yAP4#%3=gh?0_ Dj{TPW diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/book-the-php-anthology-object-oriented-php-solutions.jpg b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/book-the-php-anthology-object-oriented-php-solutions.jpg deleted file mode 100644 index d0e502bb21a224ee5455c821bc25a2bfec6290ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43265 zcmeFabzD`?(>Q(!0g;f9knZkAN*XEY2H|q)?vPLvkd$tak_PD#Q0eY2X=&-a@H?Qs zlhy=lRQXUuVzm?Ck99?3~@b%-rF6;`%G-{u43-MP(!Kt?bGf8;G-Xn*3s0yu0SAO#Tsw*w6O zZ5|uQhX$B~;D5Hw0-giF4fJ?J^~dwEv8@q=^r@MxldYqftsSYD3aN&FAOv6AG8T{e$x9J@7MoMmfIkd+c6o4$%A08cR*;jC6KW% zKmq1@8uSW;f`o*07YXI=T@;La$oDWFprfFmKfuGndVqz6hkdhZ@8 z8tQ#CwENg-XlU3s2^#i~CK&${0@t5F7)T&<&^tI7au6&A3>*f`^(-)KUh+ik;=Faff^|H!hg3 zLCB#R3LEdcw!1cBAK84_uqcWdlhxZ0EIzIqXS)XVLb=J|rRzx!-dbTI@tbYr5Q$+6>5MZ*qJL52S-yG`T%L z)a0ubw7m0f*>quS*pRDw(7moLj=q4a&T-)?as;J#RCS6=ZO< z!ttPqRUfNLWGL6*8J*}?oI5t^~k7xd?&l*#oArF)AZ|sBel3O z4_BFPXANhbZ3wEHnR8>5;A*u%(@g*2BjG$qfs&(vuC+I7OJiN0p?UUfW}~xCiq&Ik?>$ z*P!=3Oe8+r2_kq0vQ|^Q-#Bokc zb3is(4unY6cR4B#waonByER2wdhE++*$@-1JS~`YVQE@x0rEh+pSn^P+3hpt{i^$p zkELZNro6SYui_v&SLL+sZm*)o7@=(O`^0ZuEREdq%w}+kj%g-i+a|k1R#(=KUg`za z1h~pm$ubll%JJZ=9HD3v@>$2J4_{fP)I#R3SR3CD$m)$u>_1ZNW&(yUZ)+in`A9sC zw1B92U}ii1SolO!!5_`0N;?)=j|7_OB@k-^F1_Wq&b>f(k5MXX2fg!7hal6CCo zEeXFqo~~?@6^cAS=8sdXs@m!-?6`l=Pw}i|s$7WNvE|cZNFZ*DIB(1IS=(3banTMa zWw08=_Y&IakF1+%1^Y)C=sUgDmM{~Ev@Es2Vrk|xgqwnLNwbiWh2Tux_R;4NuLpLz zv2`LzA|W+j1*gUEc(!Ne!Q8bLX@x1Mjj@;SK6}a*uvktZp*ag}ZxN?%T6!`Z38!9z z;ENoTB3AYi%Ony>PKtyByM#SDV1_8gwHD97a|)5typ!<>&Q(1+368{VQ$y`==R7-y z+u<`lIVSU`)tN4-bM(zhMQOu(#f=rsN);c4qq&WV=~NMO%NO8cw}#mBacKJXQ9Lw$_lxO9 zjK`6VMd+;0gQ|%w<`j8}#kTXcv+;Wb5o)nohYdUvJtZ24>fZk6P07_Hhse4lh%0tI z3ap)UQeeJo(3~C1st{YR$*XiaQPvn;L*luTp+#r(vCYk*G{bN5?>{D{=}D1yZx?q> z>)1OO=s81!@%s+VC%uj+`wL0*SXg)k`9mmdOWTsES!?)uY_scmM(59^#?M)xxZ2Iv zpyXNQI{J))gs`dC&uV=U1xDJ81}ltJmH3(ODCnyv)6%jodHeu`S zbf-E9>E>hRu^}-r8M}&^%V^quQ4@YD^(MV_>gvUWx74^SoKDJ^!EnN{>+&}Gp>`YF z(Nbx#sUpPMvZU%9O0AyfjFu9*sdS-ORL{S;uOmOLZ#698B3T)uYEFFY&didt2j&to-VKMebQoo zdsVXUN6Grc#20j$^9{#m^8&ARe?3hXZKVF@BHNjHNCbO!k|slJSSYPHhi6H zkkrQHrslMPiPSeJ`rtX22T5jwC$p6N=g;S*QNyM5haWauYD04Q+8(Y7)Y!T^r=?tU zccvYI@AeYM#Hxco@_I`?x{55iidZ>wkBC(csBv4O4I?ucTd-O@^AoLQBgpy zS5mI9P=Q#YSWyYpE5EWft_CsBqLs9SE8K}3#naMF{CF;tuPb2fZn5wjm-A%qnsU*x zxpps-WyZ_!JQCeH*L6h28vg|J7Ei0IVXd%h5HMO;jm$Wlr&RcDMk087VUbrS_Y~ar z!O`io@m=t3sy5jq3AMIkiiL9*9^o==U0etr3C!(Y#uWle;>HWp^4wQ(hnm-*zH88D z@8A*1Yfu_mvwd+7<6M%LHCJh2r(=Qv>g2K9RQ&PKyyDq=@ME#SwM8 zfW5oG*+s*wfGI6a#xj3~U8@P~#ebr9Ih%yPQSbn2v&ob`x?8-~;9nXAcAbC=4nDz+ zW8Yn4F1i>qSaQeId>I7aOQV)_pi&k}^9;-Z#J4rR^qCiU3Yyu$L=%g(E6-#$F{ z7#r&seed(C{4lg`x~RAw>T#^2ATEhJs-yF*oPWksd)_&L(LRoIVjNwXy-KyWF*L2u zSkH8w0ZPW{CgFva z=;&eJ(px}Po1nH-G06BqCU;`3GTdd%J8tq^@w8vEf3U>U3?@TJ*u#&T4Me+V@21h! zdDmV)M)7*+NR{xT31m?(*mR(yX!Oz7@0z>kS;mnni`Y>0X7I!5qS9TPut2kj^sQ^q zd3NbQV~G=wv(=M*HXScTcgrMj@>fXlWNm$wmtg+9YQf-!dkhRr^(0(Jy{FH&S~27W zNgJ-UpyHynuY|MnhwAvJ;e5L=0tdPMPtoC>;?^YzSrmkbIxpCHzl-31`kuJ-b}2lo zO~vz4A$0J2GSO?l(2#}Z{Ol0nHMVrU$T(+3hJ5f6Q5N6Mb_HtFT1>4#MBrj_LCePx zGP*?H@~_=_^9kX@`^=xSj8{ru4ax>u>R#bD^f4ZLUxRAhHMBd=uR*{b!9&Abzz8le zO*feW(B}q@cs=4&uo;+mB?c#llAww-L&B!5?GITdy!VVn}#7tvNey z?#N(QZnHMB>(Z|yJq|3A9H>?k`h$Af zwiYinZj*;&INZA4kq3j5M$e!5#XguaNNV^lyjtet<}>Jd4Jsh#$00e=^*;Gn#FcX7 zBqjC*V3#Di=s`huP;-cnvhbmEWA|jkN?^qtqB-e5vRu^)$1dw=gA07& za8>A2=p(Uu9x&1uH#nmxS2 zx$jwH0l%r*LxRbK5PO?hm}#48)N#SstCMrJh6EdZ7X@N#b>*&H=7?wK&ce327LI!7 zG&}kA^pKLve&9Qo?si&*`FZz!Y4aSOZvpml`Q94;bg?N)TkKIW*KZh)dDysnA{x zSI?;pWh$#WFPb#?=JUmew?Px>ep#LAQ)uREy)ck2OS6w+Aw8@ zZoV&p(IEj)n&K5I+Wpg4i{j~cZK6xSHb6t7h)eRVF;8D2_G>xydynw4_Y-Xjv#q^o zp=;lYZDtCiAa4!AbPn^(Nk3eJ7~EKVj+&A@CeN$Q>eCk*O00`eCdNN>%WBG738ozC z9Fm+rxq2O_=cEC#;d;u_l^*77_q81trtYJy(%k$|)Aa87J*k9OWk&66LRex$UILN^ zV^ETFGz5Gp9IKihUf<{d+?_y@S#z-NbP)t5a~s_%nDXLmwtB=d5!kl|)DP_L$RF(! zcWsyvq zA-i&&PWM;!n#2COj3E*uvjtb4~MAxZ#`KCjavk-FSFaaq>1a_O}_8|^FIzjjNp3ji0bg;?w zpev$e)4JJpzYfskK`)q0t+g#UcHNyME3fG5om*Keer9GqLsXkSrI6OiFyLKElmf@j zdl)Qr9B8_yi@JOjXzUUyT9{N-eE&&i z>+V_|j?Wn3SXH4=%&W`BOh+C9D};|vDkm=39fXC!4f7_Mhhsiu%n8F+kfehrx1uIilvQEDa*_g3Hh*qH(U#_8E9REoOz{q|)2iGh<}L*L1HuP1oo7>Yh~ zWiI>PxvyXdTI2e#z<%ajj;~mVq;YosyRFgm`FxN^wNgt{7W$MHdhR%ccRrg5#bv{R zWZmX)Vpr?PrrvZwb@J#@?$XrQ(VN!GU5PBdWgqIXot&%bqu7etIfI?I-96s}Q@(;* zH^Xy=5xE6QSltuAD_h;(WXvQ|M_GqZ#FA&u>H>`=VsyR)le%{aJ?aUzItpCZwvX`7 zwlo|L_9Qv>N_D4a?ShL|-g%qZuI|{b`ea_!Ehh}ypL3gc^XNFznp;OJ_l{|7_^B}T zH0p$hZ+NdAhF=sHjgPbTiIo<%bY-l@arMAd)!-;V53O1~y#$NrFM>%H@x?R9y6}@7 z36-(9ny-r4x;I@Ki8@w}AggR)v?Pj%Xq6?k%p`+Xo8wSr%iij=?+*P3zCO^S&0Nhi zwb|DucU%m0dlEbBtH$I!ikX>oe81u}*mXg6$k!!};jQCGbUR)joSdDl4wIl# zQzx3cr->Rl%($24PTkfmEgQ~nOxTu!DoF{&|9qAdB|cc&NrH^4|EP;nK$O5jK0D9f{G=E6>FKi~aHQ z6Q7c!0^XOhmW)N^)7Dm&0npk8Rm`|5=MD11sOG=}J3`nV(?sQ3bJ}h~!{&_zm!?+N zr!^*!!!IUD3>UJGg(bEa^Dcarw7{;{pjPIyQ@6LetDr}9z$)IveD6}@u*WYdZj_wf z+Q-Du70ofZ+iLn6gxxiH4YDb|>UqfQR(8zZ?hB%N*P^()3th2{3*>FbYuIT02vA!_ zd=xd!mF0FS?{TWV?IV}HW{B?NCsu5Cif~WZnP6MJ#ycnuYkGvdv^!w%WcsY>Ta5px zj^uz~BT-ZDIlTzXyFod4BYHNNKKAHJ>ZunEqMsl=IeOfjO^Q4^z@opF^~9{wcei#7 ztJ8b9eJ5yAh2YBQLnQap(Y{Xw!pJ?3k{9$!YkNr_iIQv&+pZRac{bF|$R-j{YKvfs zAb#L?UL>A8l{;76xJHqFJWRnn{REHn2CW<}SD!xw$4G9qgwfUt;uL(S6T~}{V{DAA z;cvLhx)$q?KLOpoQm$4v5e%E?hO@c`Nv;EbF4?Z$c6B!M6(i2U0(${_7;Hf*- zv{h^)!gQyYEV7%2W8R=Du5ljHbX3894dS66m(-UNKj0O=QsJGqp2ON$(K)%V55)}m{89v-7ISfDi297`yQi@rYF5fALlZecuQAyI`UJEN1dr8#-O>(P8!$@${3 zvoO6POhbtj%hI6lsuB1g9!u3pz6%jifM z(OvmD3Ytq@LaWuaL&o{CNuBCZwJn^=u<>u2+jC>yrUhzEdx1{ZpkT}W1B0Y-4yftW z;zfcOoNVVc=(WpO`2{xfHkHm1?t;(Q*F~51bDe-35<~;bUH$&6Xt6hMLSKjKGgDc= z50aePv<3N;3^}mNFpw8W;ppm01)Ub|**~Ara|8IGd`%fCLnlKS`9v8=ZU8xNeMV-A zBSwiv8;d*;+PQi!sP&;C%%gp6WpNx=OqIZUc=ud!rtQml_E7_ryze!HccR8+hNbL+ zSkKUIO0Y3_%XYA+>1$jTWr6He18>3T{$f5bql*MiL(EOx<-BKLo!VIhn%;r zH+68^Kk9y(9ASSwZ`)Dd)}h^|w~4SX=m$mA+u}`MZnv2Df0T)DsUF;x@7|_B0`sF4 z@@*L~Y~J9|+`la$-x@k^vaq);k8YvTAQlr7pvDSF0kb4xiNOafV6@1 z7Y^4ggy~PnEzMJ)3!!F{`_{qoR=o7%2TD ztPFNy14_42Pz7w)R<<^#K>7BPgP1t|wJhpnYyGqQ=>|dB)a+;dEo%slR_0)cqq>#c z?O^`a&z;*kpbaK)BiUhPvV{3@D=- zIy>1)L2MunhE5P;002^Tw}bpdM*e|(1G%Y@u{I?I9{=0phjVtYQkBqD1-kkv+#BKl z9U|{&3i%rZ!O+S{)zI{BFf=d(Xa{j~l5vz)m6tQJwY9n-i1Z8mH{`o!whkVTt;|h- zNecbP;H7_oftHBI5EDaZD<>d(*9GF>^l#ABe}Vswe$U8M%+|`*;V;6)_(5M(>W>Pb z2}r@#=0?_coowwCot+#Ze^nf0D?pL{0~E!`)(KFk{{X)SOtIO&qTjxov^O1rP=Fgo z`1@`C$2*E~n}_+ihTXVq{7`7j+g3ODAOcq)xe?+!;5G-cUqPT2;0Bx`@Bo*F-%b#K z!T+}t#BV2v-%b#}ogjWYLHu@t`0WJo+X>>g6U1*Ph~G{Sznvg{J3;(*g81zO@!JXF zw-dx~Cy3up5Wk%uemg<@c7pir1o7Jm;W-~hG0vG6R8mdurUkL?AABYkeV9{ z(r9qWv&!3vLCnmhJscn^9tx^p4@)qgF^#YgvVa@Eo3))a#L1A<&DzSwk>5>_=9V}= zkiP-5(2(AuI9UqPXv#k&bpkB6mgY{RfbRzrJ1--tiG!gv#MRcpl9Y{^n+720U~Iy# zEH3$z98eOZ`N_Adt1GiB2eYk%DGM7PA0G=VI}1BI6M(_w=x*a==*DE@NCEVA%Z9n; zAI<(YTyxFa(E=SIliqeE4sirKnAK2APv9(F!10hWKQ1E~MNe`@XqvCb^RfTL{@0qnH_`gD3ESVB z{G|qv1&&> zTL*U`0ha#=`@dn|$=u{WQM8+yzc77M}JAmRPgVE{H4M-(EqmMA6p#9 zf3?N^(Z!#{{%!Tvm<3`5xe=x#u+p*poM>Y(zlp7bwV{)cxwWAw zgvG)RVk*G$C-mR*`(x7s4jaI+gXNEd%#HZ|_pjfb{399v7T0fa{UZtdBjn%O^;=y3 zNCN)|`L}lc7S}(Lz&}F%tzEyx^^YX*kC1_fU|L?;#_j-2V~Y z_2=V9;a^i2L_|bX6jZ$X_woK;BEEitp@f40LZto~@s;Yj1=J02c@xz2hTWgnZA4c% z*c%{F^$U9Qg!>T-76|nU2L}rWhlq3s7||WzHXP`2f^lNhLfA@G!0i!BPDWTt@R;dbywf&zX{%ZZ^df-oj^cgNgG%@a3 z+iZ$YvNh=5EI`^6#t~P6P-RqlE7hEa0?eZ19w&$7qtD;Rd~v^&C{aaexU04wVkq?7 zF?b=&a(&^PzVYc=2u*)bd_xGi$CCuyRMr3<(#8Vt;V``y+p9D4&8ctU>B1>=dA(R` z)K5;caC>5*T)N%8Sc}a~Z-!Y?Q%wi&OQX2kG{)p4LQF-%2HccX)(qD2ajBJQElZy_ zrg9O8pQv|<+XNRsI1A$55?`=LkS2_b@8^fmfV&zKiy3+ugbrwE3aJi!%HkOno3Pj( ziD(R7oxhh@3rtDgWbX2&@X(FIRcv8rm_s$UA4!#$QObMYqsm>j%@~tgmutjj0I8ca zN^8LokjGR_)fgsEjUxYYoKDlLx*wt_!_R(xe3&uXs3U$H2`&Nq9Tep!pmQopFIi4V zH@<%I9)Tu5OEdymobLYZ<9hH$y5y$bbn;F$zCz-aVd=dPqNRG`S(vY#1d{XI;4qVbsmoVZNki%M+v$7*$fdHxwk z&f%4Ey?7nrs>ayQvDscOmeY$@wZ<4nOGn8VG%pfUXfr{z#v)%c7WZ*0j`O1{C~Fk9 z`WkDS63+D`WsuWAY;uH!Mt`VK8XabQtFy43(cYtQayNlk1G=!zdsutB7@S3A7NP-o zN|g6PgX>Uc&BZh^gd!&nd!{tar`^kP% zy_@WFKbRoTg)siEH*9U_GGyYbApWpS7rQhzG))%AxLv|ME-k0^;bu%XFl$OYA!~9l z$7tLNp~;^8Qbh0y{t!V~AObAml7{MQnQ{skgd>d8S0aS@%UK8sa{awRICC2zpVRt! zLex{8ktxVUX}VVKPYzpWtkmafDxZQ^EZ6Rb`+Pj0L*dP4ZxSfgln@cu9}#aN*gG5} zkjZ&cMTu^=E7%&=)e(x0TuxSIHY9_&)T0?D^PN7s6-h)!<%p|Bn}Iv!0R_MwnJMYF z6#GX}PMzU?9yYubSJdkV)Au=8O=JBLa$jYP6Qmd96nx&P4d}87m6zltN_g5H9K-IPhIov6z0R~ENnHxU1WT^ND|izL3sf#vUka$j1LGBnLq8Kep!`# zwq{5zbkF)yyJnG=0hQtz{h)r=lajpsy7DB`DL(2gRopWtiJC{?2sNsMgQlowgy-Sb8e-vU`@!kAcND|zRMPYV@ zjXpE#v9U?bayVU0xn=TaDPGzhxhxyw+>IayuwWO@T_ROV5Tp{rTv5itt%Y8g$ssDN zr=G1vx{n=KOV?3$*cXo`RmDM+El>2@G}z>m971o+y4kMhw{!H z%kA|MGdi!)#HbI+P0$iNq zBwW2}-{o+5%zMm=Z+ze8QP->-RM7slUI)&mes1Yq>Vhw~qe!^R8;Xe>8&ijzpK)T_ zR=TsTUT19OaBQNMvZOQ8=WDVp(Ni|fSk*1+J1puukz<6E9U&ByqDl)g!y=j}rCjHj zRo6ilKOT?G9Wbrbp&BnMiVjT+HrnwiX-W- zK_@=Lxvyh9GafD}$6u{He=gWb*Hm4uT-Dr@?^4hN6(YV&t{ArFMCGJKtqLTCjTOh1 zB`2q{RTIHO#Y#3|v==b$S98kxxe(`EgGTX_P0r>x9PscRj2AK)leN<$rJ}G^o%dz5 z2g0g8lbMM+DmhBEDh^U)STMe) z#huJWypoxuaF23&Ig4LSmx*llBsIrV8ppoEs>M;>Cz%z2F?dw3`rR;9PdoplG$z~w zXKXM*XhII%U8krJ0kYZgye4%2BJSSKc6$0S%?+J3OQih5@3y)RHbsjr3Rg9FSx$Pw-e}I9>f*>65`&fjsv^ z@!V(brmj)?621po-t|{OwQg^_Tbv6u)2@eaUqG9$UqpJBh}!zmjHN~%d|GIa{aPcK zo41IaN5`iU7)_7#sSl>gy+&ai7 zRSa9q^M3w+P-6e&Krqi%I`vB*_ zJ!@`2Cjwv6CSzb=R(GXK!UZbW$CtJw%cO3UP5jHbh^FeYQqoUInhb9zf;#;^mC{xn zxr?fe9fBGHBYe7woztFM@i?aeyPV5>x31zM5WUL5XT=S4DtgCgU-P{-BGi^cZuyhl4Pd}2NH<-*qSj87@ zOVyC4*vgc3#c4=q2<2AQ4ce8liTNs`9#~texoKH#RbDQ(Nzq^$#OrH8F+~E zeKdry*?z)Dd_alj=U#6yydvIIk&IKilj~m51&-q3?5wE4wm|G6VUfsTw3%!B(kAIE zkMb^ro_uLB3^R}BdHwj_{MEy{vA|3@@~Bp(`WmhcT*FGN#05Yi$2OPt@&* zS9BpPzebmLC7Lt3ucje5pmi0$OOz+cIq({U#F+nryD(FZlcL3$Iyz|3RkpQcDxb@! z8IGRL*FGGD`eRwi2jPtQ_o1x{GK8BrG}j}yIxF-oE;SfL_(kk)`P~s%^DjfR$n^Od z%4n^Rj|y;hvW<1kXRVS4*8^_A>T06k@RKQ5kb5 zlF;JOOcNS`qowrx2)?;Wj#(OR{WU0zI%ecdPD(S$lY|5v-|HDR5AI6CTb6aqi%}x^ z)2>>x{6T{tdBx$4-qiX^mlKt3nE>e=xun1jVWy?GXR>NEgjD1PF2rg@{W%-u!$vLT zrYk#d(vP^XbJQMy)H(-uIaAfI9H0L6Jb9}Cg4HYeocP`3Rqb5{9Ly{`MPeGyppr6T z)}CJ=`3HQP16eX@GGNE*Uxj>10J#Obwv5M3YNZi zx7F9K{l_kl#pOeH<=%SRkUY5tm1PyRynE74-}dHu^ky+<+0pR6UuLK3@JND8~MSm(Ff{$+uN;S z{hv-Ry~~2~$Dopt#)I6^i#)lxeudCU1XI&c+P4`QE?Q6 zr|g(URbh=xeu3o3+DguE16dv%Jt-=9JYdv(S0cZt1?729e04ywaV|N=EEUz)z(C~c z!Y7}iNzFg?1i>Q*hlPBB#2UAGF?YY)aR2nSDe~iDHm-a&WEZ7;EN@(D5@NI7%Rizl z19nmtDr}ULXbK?IX@ZJ1ojDJAmN@4g@9v&n~3zi}~qAeDkF{YL8T^cN$4w{m6kcS zcr6{%=9>TH%b#Dd=};vuCa3=Brzk2eqqTG&)BS%MfK+ zM%}JliWJF{K8jI4{e-Ow`ZU-)0)+4ELp2ENlBD2 zU&pP@;c6C{+X-Pm!%+&qTsD)dkSuMZ zeOc0q3r#I4@Ap&;%HFp~l~6i5X&edfecUBy8a1Y$$~wt$&!RVRuxgq)r1tWKomSY4 z$(ipbOdS77Ok&}d-3xwWoKZeaAMp?4`ewb!o1Vin)*X**iQto>_RPeK8=tp0CIz0vvjU|lbc`0p%yuU9ivX<0Cy%n7WN{m8>lb%JpN=SXQHkLb2&8!R`-GICC@~i1*5QS6Ym*#sOI1}1 zDWQ%G$n>=skz^`Z@LcKxGOgB?l+K^cQSJ^|A!(29a*iwP)Kgnvb4LgjLdQe+K#EVg~1iwdnr(?UnG&KCUL6$E)t2i`*N8d+&9&I zsC79blV1N8@70DdCgTTZKRApa(mUkZ_zs^*D=%pXb|NY-VW~IxgLP2YzmHuguh4}h zFuaJELx<4xepxN8RqcpU%(Ty{CX210_!{x)?%+bUQB*jnx@Tame*9^S9Eh|SQ$&ZD zoW_O6=jmSGa|M-$4w*F*a79=&L^V6nFGm(@kbscqW|XXGxIQXM$!-G7mg(7YdvNqb z{t^6Qn~WyC!#zuLuUeDXu*EeV-U&kI%awaE9!NTZR0iq7M>Linsc@@yclAJ38&vFmmRcht$N?4DeYX`A_pRMKF6b+fF~w z$U12U6HTI}y{PgHi3>|bqRnqusnnHz2ziG^tTpkdb~TficMSxIS{&z-NP5mj%CEqX z4?FOtI8=f56yjS1dCw6Aga#pZIWZGS>*w7nImD6(JD;?~|dCS5f@1aq;S=auoR*A}@K{sW4m*~gU6CIkeaG9!#Li<*te7@iA|2!)ks)}m zcz`bL%B9Mrb^4u9WaTvWNkv>RUe=x-_jEi*3Oj>46>m+J`2&;`uTCpj_r?1(ehWw1 z+&NeVG}7yqTB97QVBf{5?_FPm*v^{-jHWoM0R~EOgaK?~a<6Hu6hF%KMTDP;sHJ&(yiLj@bGQ!#ctxv-I1N=&2 zW++dgY<-8N;>&!d##DTVE_dKRcc6ed8#C9ISp@IiiXhwH9i?SzqkRdFV{Lx{_F#_bOJfkz43-Zsh*n zGB74lyx+qY0AjI4+7ksP9*dy?<43rIvi z{d!3owU7Cff1ONDSt{ls2V`Nzx1IP94E!4$)!;PN_T;OO4=c?ntm?5`+#=&iiu^;Al=ec})% zX?UsR_sP06n}}VC#6^Vj+>BV$k6$zHflRgDXfAX*>=gE~9Ul-1oQX4>(llncVfrCO zS>Hq6Zi`QEq@42vTB9XVDW1QyM_1wm&mILR29-RBPG*ZuG~wcS*;7wY8)Y(FyQ=R}UL#C#kD zt4I#P=ej&ZiR2oe%X!WaVPc%r!MbEJh!XoydEo0hr4#|q>|&Zt#wC$}J=|TIMdC+W z^F7!pHK&c9E|hUFuYx+cHwz1_EH#h_RMw{B_ptg5)H7M0iAZ);xu40^GPCc?vf!Ro zPbq4#yJ-z{daAv&5XtF#^4WXauxi^zlyY&);SFo6x1opp+cIyi?_n%Q4hilB9*R$@ zFOJ}})CeOV+XckRme%*18E>Du*ub|ke>Rb&HV}y{5*bN0M|eV{;76>aKDHsLRXTBPhK!q;OMR{Fi+s-lt^3F<=a32{rs~SUFh0@t74=e^*?>o#!;6_BT=nMDri4V zPJD{`aCsq&K#aZnHB1=Zx8%K9aw9q37pKAK-n55OWXlf`E1y3ad|xNRn8v(=|M@8l z>4-%4;8LdUGbgk5=Hqut3sBb3Qf_~CCoL>uPckHj(u{tMWE2lELuIy_GR?R1E&Ks{ zXjPPi5d)v=PY?<)T3Z}WYQL%|LD`yYAZ&PreH#!Oj_S289uH+XzBeiAp!K)h zi#NT`oYcIGbzIe;%z5v*i1OGvQGq+sV)oE;s@ZT1x8YYh2sZs z)jARzSEWUNwIEsaSj#Vbg6dDm9qz9?szFRRh@(^R?$S2E?@k*YqsM2wjSW&Ma_J7^ zuE4x+WN&if>`2_VVH}xto^z%eoI>-&bP~yY3MQ92gt_AFwOk%6td=yYQ9EFI(@s)J zA^O>B`hJG#Hw&~_uwiZ9IEA1(h8T9(TKB$frKVS{;6)0gAL1T}K;l*KO?pYY9&EBu zAZnu90LjS0jwW znd{oqGvV`pJK2Y1d)9Z$(C_^w@6lK~1EiNbT$_#YsM_s=58AP7!drQAlj} zCijy6+kL##_+$A)F8lEvi-ykw9)#|9>nkSBsW0jt#rRH7jU_BH&Jw9Xwc_jR7TSE9 zVzr>S-;UR&E*ibJ`yk}<5iubbw$=FP!DS@Y2VBZHt&e)+oMDS<8lF^qdTJLfYw~`L zZ7J5}!m#~Va>1~kB5a8oWbjfqGm&Z&t`EC%8p1U_F_u6lKKd-U;yieJqlbdUct>+w z&A&LvqxXK=NN~Z4C0J}^j7#`qhfm8LA*S#khI5Pav=jICQ)A)vOSbpod=arjc=j;| zyzs(ZZ*+oqI5(`=o9z9bmn*4HWeZjs@8)T>y?^`pfs#!yWNTqnA3JdSp39E3wh*yr zUYC0wQ)aC5omEbU5cfd!r;;N4^o!kn7j{K3)DhI@a=NN9U?{pmaVt^S(h5oyTg_xL#taTGHtM6>9_36 z;Ad<&ef$yc2h6UYI6tc%L(u45{KB^_l>K#Y;CKflC3dPb5+&E^}u&j_N5ZVZ;~gt9XC9kFQpjcu_^H=ED}bxRrZ46lwGc zkefNwjoJna>c7upU8qN>5F!e@LcEHjbLn0MZ+jK^&)l!(?1(>85PYDvB_L!`F(oO= zY{9TG{chPGe(55UbQPgVM_yhzUHM(=VW}#i>Dak^1a9_=UZbZ{7SeEUD-#({cRBFM z@;@@31c|?gi|3!--LMMFJAKi6-eBu5kcszjV!Co7a+N3e`J$-Vd<3cTcBb{m(vDXV zPAMr^#H%H6ufJMt7;xD)O1ZfpX=?3;&TMKlBOF_Q0dq}x>49-=e~vv^*3+33!R;@C1Ci;>`v<8ki8 z&~Ni~Tqd4?oFLDLz?lSTs=ru_w0ZZbJDsU;?_ehXQ9;jsx4U zQ?HAV4p?&;w}l6)`!(HtIW{|v{J)d<9?d>TKyaP$H_|y^^xjn<}E&H_*I$w zOW&p{!ugj-CqM3Ui<56=neYcs6@GqKo&3Hx z>v9eHz@W}0@lZPM6^%&bM}x=b6-)oI4K71;zzMeDe7=qDC9AG7$3U(WVZ#x4od zK}8~rQXY}O<5swb2`oPUG#9>0k1$8e32U6uTWefRbSC16)N8Tu6fxEE#r`_pd1V7h;-a*&?m-{@u%G1bDf@1W(>l|8J!Cbqd*#Q ztskqA+!Y#A1wXAE70V8JtMs^&>gm_Vug2*KT{5|#Nu*5S1GI0R#?r{WMWK;O zmYm|j{cuOd+qglq*Ow+yzu*n5cv4^)Y4oi2;{Ys?GgOU$2TPOr75Ak0aodeAhTTRT z8vnn#&cZ9ockBBoDj}kjl!$b9x6(b-4ALScF?6S*#Lzu7N;5DZLkx{{gD?y=bT`tC z55IHHyPkKQcfEhWz1F?1b?<%ey}zIDzBGTHTSj6jR|2IH^zIaHg{rH?b5iWeyPJ+1 zCosDFt!MnYTb~k20?wb$2Bnxa2Bj6kuulWiT<3MMl+=0k+82jyj`eFt>e!dNQ(v5-3XVWp;z5s?(V?M`-Ny|q zSVJU&|9F@(s2{0W087Hzuy~GsGDn^PP!(qmnx9l`?Ea4Wl8G@ai7V?_BjKH4Geh@YGNF zXo*gEUyPA~t@ivS6Og~I-kD4ykSUDvE;ZVcO96~SNu(nfKBwO=8&4__-^=%ErIKkP zuc25I@kI8KERu{)0Ri)2|AyPGG2-r__L>NBWSLYv^J4(phss+;e!@ZoKpQ2NAb4K$ zX(OfF#NyI@gnaVMvOd#gBsg z=Z>geoT%5x=b@4v{bG58(q-UjmybQevT?_jE8Kw4U{pNWL}Aio0dB$%Qb^F1jR%WI zqFc-2mSdUl?sK9gD7Trl@x8c|d;q;qVG~R(wc)}j@)7z&gzs2) zCEQtdOjkP$WV1OZIXhxxr13NIHV^U_>q$cdvb0S1on2O^%&BC3meLscNIsYJ^?m0$ z@@i_!0gdbgI7r_7WVi$3PXJH5=qfcbn%ZRcHL`f*fD#^Lei3GOvvGUniQr4hVj_f2 zz68xV#&+KDs|iYwY)|fZf=R|;vIM9{Pha(TOTs(Q0BSUvWUFn%y}wyDM`ohE=Z|{3 zd@r;IF!fC9K1s*~nCgy51Szu}-OD`x!CFIWT8Ny8McM{c)&rU z!OOEfy+uJ~dl0VZx@&LXhpQZ6-(G8Pixu{i@G?Z7Fntq|kSMd2q0dKc` z`u-1b%hvn%8Nc02o{t6JjHCMG;%WNc>OKjyiMPE1lk&Z zRC;m9>9uKnK5&pVnKmF%PAEW4lsdTb03{6RBc#mhj?7mXeNt`r_D`|~s1IBcg2QK# zA^62{rZGkQhvHz3NG|5nI{Dqu>eV})8tRTquYJLp{nmBczgVfQ7y%QX*;8d5rj;>m zR8_i}?S}q2{EDMt7W=|{-gd*ZK&C5uyD!UeJ@_A$pi7=nkFkO0vBGY?@`O#HiS*#M zam;-1amcc_!OJYO8^sf`Yc%_;_$IUBc+wW})6^Td`(R3Ys0%W>ZFR^Y8= z`JZCJMN36A!MAl8R<|zFpBPAyKHARW5xSXMSo8ia3xlUkJ*@H6(iX%L2=T32h8~MQ zy*}@qr=QT@aI_19W|icVJbHZAfGN1! zPz%+NH&__(76F@Z@aKz4M+-1n`nvox<#V69>b#$@nS#_KJ#Y$H9VzJ6h z*5u!4*}Ll%epYmV2Ws`M9Q;usX@7UO#G^v^37?L`v;JE2W zIc@vEA=?P#*DjH}^wN}F!Un{}4RJ&{m9HclNtseIM7<>oPLUo6%SDf4IIssTJxKVI zckqf7wBqqZa}O0Nbf0)%QUI!x{zbVld5mZ0?7>G;Vp%v>W;aKxzk@ObW7l zz{7y_%7g9S%kMfD1miikCRV`o!0V15akIgQvqqS4;b3O?;W2RRHEVR-v=C32ikH7o zylu;{m|e7Fv*}6bhIX=#d%@`ymE#&mhxaM4? z)vjvW>^WPs`hA81JhO#p4sKBLfwjg?7o?15GGxeJI~;jz5sxP@J_%bO4yj?IWBrc1 zO(SnsQvQ?6)@OB<;Q@a+ZQl%)wZ}q$_u%@u9_RWa2ZMo;tVKBsC`9F31$uY}lTz$h_x3<_%u-`nR?51}-2 z&r++_&{z%e#EdkwrmdtK^M1hX2*TP!SO3wDhIw4y{ZI3+Eb5}y!+)_}lZ7g(!;~uk>mS|b4ro{IuCIWKC#U^_qeqiVl)C+4%A z)Ej131M%l|mFY=$@o#=V&5!8K-aYxgZDxEM@!mK+WIQTTMeSTygrGS&xuq7L?8`73 zSMzvnDWis#X^${%Kgl_#%YvUdr_-Iv)sf|;*7)ZS{hmA-wDn(j!J5UZ>l%~RS%mS7_Cq>zQPGrIfz*m3k zSM`W?5_S`gbEQ+MdHh{0sH9MNt|pe{w9IkXa#2}y1QC3MZC$*~gnof0QbOES5S6J7 zhWGE2g@OKk>USg^C4y=rjG+ z?K1slsHx3%pM>`8MqAIJc~o=sgaCe#dlG)SFK1Gf0$oYM2KKwe_UeOYiKNN-2$&Jm zdGIeK_&-<>A95{9JLcG{yk?u(zgMV5m;^W`v&GFO2+15B{~QXY7?d34I!TrEMGZNA z%&>B55E>tcI}@_bcfi)pp@wcHvR^3puT{HsTpCoGT&WR`3!SpAHf_>njiMn&A8>*p z;>+jn+_~Z83}+soJ|0pO!Aw!<%$A1R%umd$A7V+`-jG=tc$-F zgop~yxac_mf!-DVjq|-Rx!bE~$zK}L_zzRBEW?VQg43X8m-soVxu8VfAnx1ghS`pb zhJdZi(vhNK*?69EXhE%_#F{?z`ndcrmdjr(_Lj+E)KGwIP*jl3ssTH^dhDMO|N2cR zg;VNvFv_+~z3;K;P3c>{q;5Y21$jNA`{bvp+Pz!8+`gRn7fXuu{(dbg&Ev?cudZck zk=ufvQ`qP&zbfvT?iz3iqep}EiM^LML%gCKL83+-)ch4vXyC#@YKfEwdTxg=QrL*~ zm0%8Bev)1jmrLlDTA^e_1^`e6cj+`DJB=3gAUz7C1uW&ZQTbR*nk%mf3Zxd_RIEDnt6Aw;G#wY zpdVU!fru{A{BhS;XOUqOH5q1aNvK3YlCtqK|E3e@l(T6qP0hOjzc%B@zb6cU5bKZJ z2I3>)lo$tM1;OHAs`nTsVn7mT!1TkwmtP|vK?Dz8Rdwl@;LEo(SaB>18$X5jWm_m* zm6Nr4C^loe>J8a7XX-C!+iv6gI4;yAw@|Xd%f@=wZJ1-ydgSCk=yzsCwDROupF_nU z#vax)6AP?Eq1DlhI7CbCR<-%1b4*6Cn*m?cCCe*0yxQYX3M+x#?@=rL@`nwODYmKX zK$#(6F=@6yI$H{MxK$Pf>HDtjA0`jy<#(6#QOm^rnbyuOB}D7g#Es?bZ=n2J9%OnA zW;3mx$j0RbGQ)@`#{5WYJ1;B$rwp&9qmFT>*)~@KzCFUvsx_Jm$}_wopqg45Ejebp z7T|A4F6UbVjL?|#7D-iN>ErhovqF&r>ws*;x#q(XmiVA0KCgJ`_XjE*6dC9F$$zod zf?+Jf#(05Xp(eXolqN|wd-%!YiB5fLCM$=P56Y?>GYw@hC8M~->CxeqhGHJ7duk)B2k zG+^(LnP@zXdy;0)s|`uRE(y>aa*Fz{oY1e>-8mlj0b(Xg9^Mz=h2Q6Ko4yH#htPEu z+Hrum1H;dM`YvQ*F06hjdzkdFZ$WrEcg;Ln5_Eph*Qf;Hv@))DN2bh3) zGoI$A`hnQ52Ksby-^7XEx#^F3Ldy@m>|aL1jVwRfT`J#d!*|!W`nL6p44`L$7A(>u zHPaBpdrI$bpG@B|&n|Kc!}3a`Oi!VRI_d!cTV0H$1lL)Shm|)+1#r?fa4_Kn#jTBq zeam#N)22)^xbmssG!!=D>$}3GtG-!s%(FRUQ_NMRL-r&+h#@eksuKHCM9V1qUBvD_ zVf9MxOfa4De=v-H$^@HdThEt7Oo5RG#A=~z>*VC`Zxu}4nrv6=TxMimR-b~=`cgFl zQ?!I-R%K#8L+FjAD3U9%h56y=H1Sc%-o@uzkIP3;PSGz-OK;kp17SrW9*ziq_?3=Z zTx#61*qd~hLoheIS{$M~+K#N*zWikLaLU6*L>8L5WT^e%sUkMl8hx50FC?-*F{Z3?j(JVh?Di~M);XFZ}7+iZ%J zrT3@Lh41^m`e!xnTwJ{`zo}?T;P&Z;rEeKg>4)e&dAcxgtl?p#KB$_qzkX?v_^g#_ z{3mfjh1;;c8F?;Z)L5_&@twQTr z_&M*+KfVdWi)2uLD$n7Un{{CC$!2>y(*qCCo@6kGZYS#2C^&SyveBNq)(1yH#L5!+ z@U&l0(vKg~yO?l2n>Ax8HOMF*%lr6?64Kw*M@*rukLt?a(93&hGLb~3L8gHT;ux0J+Pi%jdE`>^VSV%IkGE9c}fj%3)T9{G%X!! zviKIjYDqmC%o>;ejF_k!IXJ*>Ls47q#HG!Du~LHij`1`)WugEBM}ps}ztZ*gFcOi~ z-uOEdX9o(kM_86Ss%&u?$UPQUU()Vlx<%c$DB;}!lR@3$Co}^$Fh4U10RO_muuRnv z=Q|M*QN)u)$iv!V)~{2qfSgFPcn?rZ%}V;W7*1)*WW~{k4@M4^0{U7!Ycbt-bkJVG z4tabBp%StU_^NFyQN>9>fDlTn&~7Qw&@K7B?#yypX^9`o&*LHMno*ZBq-u$h)0|Y7 zn6ZK5fY>{kq|wh6b3j-@28Ksd0TOwSz3u)?q>`n;6-JUSU2EX^ZIHfq2+&Q4)rkvC zRl$3=P?02fRVf;Z9S-ApYI>vKO=dAsRiF=+Q;!hwu-&aR0Pjk}OX^eSBQCGIY7N5KF^50}wacGMe<$TkduyQc!wv-zxrxSO}rl4lsrE&TC58 z`|CcFIH9k(GjYaTWg8{l$T0g%Q>5&ZXs(@d8z*P0E1jYDMqc&69t80wRf)e#Zy^BH(Z_C|%L z5b4_OnnsQdoY(Oj{#3WDLu4OiKeOHA;AB)=KHJgbsqWAe z78a!Br+k$MYovZQpc8C4k`t!r>V=u+5cW?KbOpa1tdDxTcH_3~V?4A?`XXWvBKDW=~YR*Avz^i?FBv=kB zB#R4Pp^1K=ruVy7tu}P_p=TaLP7IImCcW;z;OaGda7VcHRLC&r!=T0i$&a}gt~{3QxO%S zNF!g4+RA!C2kp;2fML{#S5{qV;I<~U487v?5lB5DVKIU_xWN3OUh}9oJr7~~at$1= zEAdi_4XT)}&@aaDQq2xr)>Mb$ubW_MrRe;EBAqCH>`tO>dSNy$C8vW~n8@b^(E$_{ zOox-@B3ZeZIJgByCqzR-(Soegf?K99k?G}RZKGWbN4TgS{+QFQ^5?FWl~FO(QAc^U z>)7(Vt=q)R6^`W?Bd&S5M3EY(;IdbA!&rHLqlDUC)L$&ZLF@HTEj7z(GuePM zkbhgY#vBgD&mb^eUMo|ll!Gff({Y;k&%sI|d&3Ql4B--2Z-&Ga(0{RH`AmAxP9)3F z^JGYAYWpIfqJUkgHLM^4oqf9rXz=vcUn=h|5o;YjNk8oX5o@ABTFH4e=y1!{e? z28SM$dgwCo_57*u)iydP&1e-H7;bB479cGBQ^_Bzc#$lmz%&-y^z@bHrhUQpbsWF> zm+51(b;Z;DF~!!DEntI9i7Gek@6VV^*7Y#Hs&{6;qSyVdn$t*gni_IqnL&YaOn8j7 zu}U~TQD39U%|El_l31N7z0#ts5>!0>GLfY4mEsNZ(B*dgBQBn44 z_ZTCM%qap2Z(GA-@QSLs-n@QZr6u*KSSacB*tSShi{#i$tqOo3=2MkJsYsf}eThEq zbe5i3Ev}N#-9KBV+0g`$b5?8*6&P`j`x%L)y3T0Q~r0m*)wAW7Qy8*Jk2~!FEQO8 zEWQbXrpJ|cJ`2B{kPR>Ocw2WKkbbPO<#myMxuBn$)wh{ZJO2Ae{1YkW1BJ_gntBmk zUQGKV&{DOgzj_)>HMqo_hAR~ArQuKDK5>mgYjKG6#J{u^*%KLr@$Lvh<)>U%mZzfJ z-c6=EylZnH3!T*la3}K^RW)kQJC3_*Nb0^01y|VHuR{%;UcSZN@%%X*fteYm6JB-4 z4bOb_>6dYHviFbN?d9xp*k{MN$IeB=Wdb*TI@a?H52?xbETBsXxN&Wvzkxm>Gx@~~ zJ@@*Zk)iuhl;DtwYC)`^jx=KlL4#gIP5Rm!3_*Eu%0(v}D zqvqMatu@$BHuiHcj5nFbv{IvcVCA@S^u_uYrIdy0GR(Ux_m{EbRNKuwo(6_#n>!UX zVh37AA?&wc1H5(zuC>e<-483YoWArNiG#QlM6FJII$chcFyv%odvXK0Th*wEb-J1w zJCu+}+yo3ve8r;f@+XTNp;)CMdelWmrEsZDZlM35DZt#cm_y!&V`8TCOgFUpKqM%C z6Ey+zpV;2jy_E@Tq+Q?TB-9Sms5J`a`=YTGU0jWNn_Y$6H$pA&;GUO~cpU7k`eRcK zj2Sj8+-9hBfUFLlb=Yb>fcCq=vb83hE(4^g#v~v^ySIgihb%JA>MmNEs)nSN?@V7c zEAQ+-pMSz()xz_5%XsRWW^k7At;2=AAA}!CTd<8`V}wlZVe3oV%et^opWek7)qHzir)RjT16hv&J~^cYojQ~!9|i?B~h)R?kT-T398XS zV#Se8!ZPl(#b#b8aDvuZ4Rp`{h$=+{ubY2@c1!P&!Eb!+FBbCSN*boF`|tqCE*L4E zkgoT}J+@Q1 z-Uk?;wHQc?8s(`vTMuQ*E?lgJ&5P5qv-5ZDGqm>>nzB5f6yMmH5TYiL`s%U2TAfSe z*#Mplq~`C~x})4%7#lfR=D}@@kQk;tbIG#RZZ~U?94kv_%g#2P9dnZSV(+)%0iX6m zlhybW1^Q}^^!51pTRR`@zvQQ+ZSy>%ml#$Ar^YKO6O%}tx(u*AH629{Ywg5mki>)D zIY3E!YYTVYqKYmeP7OeLQid5u0c1NP)Un{UX+O6TA{T2bLis3TiUzb^h7!rLi9_VX z826`@`Lhz8)WUKcYtYzU`Ho@L9{WV`T*ZET%d4>hj9(-N(v9zEswX*3yN`@(iSP6? z>gVUCny(uDney9?dpgYm8r|$D+dYjw9M`=~gF2Cy%*cuqSj5{;Fy?7?pSQn58^nRw z#paT}XQS}#8s@REubMvUo~lOooOrI}BQj8Ljy_d;J+f5mNCm!wdN)8Fi;wFvg1m3uqbtY(^U6;W?!ojdXaidftq*yusTJCp%RPKKW{Iyw=~^}g@rzj%mDxOY z)!?QN_}eY)uZy0bdi#|(Bvp&w^d`b!;gObF3IHCb(0tPL_jb4quPPHMY1iu7*%Ll_ z-zxw>H5gC!q-tg86JtVwV#%?DHwjd?*)n|~5)OK)4|Zye3J)a|x64w{oep}{!FaF) z%uh#1cXh_8LGg$0wLeEMt*=pzk#3PM8p7v$q$BpSy$`C1c!2LDKuyi3#t;)AB*dvw)mwPc?a8|tBJ9?!5g$Sr0Kw0yXNhe zltw0gzW3h3H~lUqy3^=vmn@Fy-|LLiM6q0at&1{=&IP3^80(OM&jG8?g6!ahvIH;i zKb#6#*%5D$GmY4(xyNJ)YY5loFg2lVztA-%7ELK-__`4mili{^4A}n+W-Ep$g+|i* zwpJN(%=M@oT1snQFyHkAOz04WWsK4`-Lj>g&;L;$M2AJQP`4=>DLORfZ_&TcaUq!y zTBdJpCtUl$&dv>-zHHPTb>JN0OS?O*ZKPc)@>-cmOf>?K)q5^zL`YH`LZ*qQhE;3} zF$~shc$7^aA?1UDCL2-~*TA2o9WWQS^>kHeg_GgVOY1i6;!-}aT^8Unb~F<~BlBzD zKhLLx@{=EkdnHL7tgiNAynaYndBFN(e=Vn*n(DUTAd zHT8nAmU}89^BYDDN?4DrrkrqUgkSj(sKktiK6_=pNKWPKhx?41F+0g{?rYRhm`?uJ ze9dG72R4#_5f#(vzdHN*bC+#BNE((s$C#MVy#lpo!+nuW(qdD8GF&8cEdgZB4794Z z31t%N?KzX;GOE9yd*j{h8Qi=U%duCHQk7a1Dc`{SaecvioWf}Qox$z%JA^JN@#{w) z6&KtGnx-GY5tmY@Z#fHz1{*auuYzM<_PY9*^b>LFYoGbobLR1k%$J>(-yHjeyp!eibhdu^Gn!Q^tZ)JC zLCg=so1-k$V^U5KPiF`|*UIRamT{`rX?75cbBzlT`}Vk+m7h9j_J(H?aVZDqvK#1Z zwkYH)O1AW2#O%xJxJn~$KQVv3{ehSe@)HMoj*AQ(s5jbQodoWs1)6zT%eu}H#Tdqt zi)NUP+n&e*6!Q^(u~e(kw-V~Re5PmB3z#by>`+hZc203=zmKr9QxkI`+hZC3c+|g_ zfcx!t<%mewtmr~*Z3b+*Sf_W&B6Tx8>(Cb})YRESkY^{Q*;`LZdUKtjMnB(!T9%L9Mc4DhtRmuN3E^!6xH*)lQ*?ULjsq-Q_Atnw3J z1%>)1Wi2)o-Z2!RJoDb4i1DkOSg@B*8`x=m7JoPq!!FC1UZ1y8mQ>dt;(S(^u;GS} zR5PxHtqrMhV|06%TcmM|9-~vWT;7NB8#ziFaUkOoaS}YvsTH-=-XBvu`hCvXL{5h) z!W^J=R$tqZ#S@SKKQg3%l|r%TFPWNc?ExqRx_+DL{>>Nf;! z>T-Go7nYANPf@prmFjfT^Ze?8>bc+$>te!EdL8+W{js?@VUtKqPc9N?F@6(-S}KsMD~+QH$R=>vcBPe6s><5 z_L+c}Nj>!(g*Sf`w7-Z!2-$reYfUxWRdu}A--(tf9?lp8%FdflDw^$ z$WHa+zgPz7Ck29QKN0T0{RIS4u_b#5y!*=c`0uOUB1l8Z{md}A>6D9@4lgQ}z zc9l@9N5*koLE%d|eF1DI&tQXAHlQi1RxI2r;u4a%|5}FR>`Gw4r7Zp|z}bZ3REM6e zPS}dxt*u@hND3U47evf)T3D$z+Y#j&>QPMXQ|Wol1q#-`nDtN(2R=S~k;x^W`*I&v z0k=y6J^CPzWZ}ztpOI~Mvrd`W3#kz2+mc=^!6&hr(PX#X_f{V-y1Lesq zATlNuR1vn-S(Ob&nvplM|0oQsH*N>Yr2W?S41KLDANp%}tdPSUD6F9r5zr3TJf_Oq z$;!#2@Y$DmO()=CTa-H>akN35HGUCepue=D;(BL~{Kvap#i_K%BC=i7-WyZJbGH7c z%fvq8V#J{RA$#4dZWtDk=tYt-BVf`y@c`&JY&R94#&B{g!{TMLlFKyPmx{kJXhzVabNyW9-Sf}Q0ms{(Qq;>>t^hp|4Dg8Q<54G z^lkOz!S%0RwjgzTr^e8dtBow*zOd}CP?qq4@>-JEf6DrQ`|~|l+B!!*6qy$WZEf&7 zq#16rtIP>rzXkD?(qOaUq*xlx3gMS(d&aG&hPiVN4h9cmt*9H=<_(>Lq@TN5iVe zt6sqxbw9aZe{7$*2GBxy$t|m?)*2ljT}KvA4lDtG%UIff|Di_zMKZ{DAp^FjoA-NP zMfo%Sdu<}gzV^cOt+W5zd;DMKd`->HnC;m%Ar^C%hkz_LBF?Dy4ODmvi<+#MHR8?00XpPf+^V-uU(S5e`_^r^gcC^SZ7)G4DEB zPYrH1lXf~1-|+J<78cJ{WMU7Ei~tIKdrnC2P5;($>ulDg-E3}D|KQ0a_GapQY(Yqs zh~bY5pw(N9qv&GoR7ss(FczB!&=fZuGE@4Vq?GXiBty60ep6OqPtS6W`~_MeUU&f` z*$^J2<&L~c{%thY`x!vHAhH0dx1p9`n>DMcVXBctxBst_AJsCg7tXcF zrT+?u%Hk@9k)hEv)_HE{fymHu5sgG;t&jz;&^F(ENvSAdQ3<_@UL@L8KkF$>eL;PHRJzs(VqMcXPtnP?EWf zvv>px7m>T*ePQs!MeS;z$GfF>VrFJscSRB`c^=@j(Ilp?6Tazj&%j#0M?=Lf{ts&P z|6Kq_3Q_jR`H|q}#^`8L{q^EYOnn{Z&2hLkiIHkJWQg$)67-^F&b}Nj@M@sY)9CBC zY(#`mtvH!@7IgOpK|3a00N&4N?_cpElwcHt5G$D4)*5MG{ierC5Z_S@E6!ZXn=a-m zg};%*P6s2`w@RBRUnlAwCHoGI?Q@)2niU!?VAr0nU=n!;p=qOZ7T-QN%&xb9>gnpH zz901sw;$>WpC;4tWpEud!e$L41pB|1W=Ko0&4IS8G8+=>sTUd#`z}}$GF3hd5PhWn zguwkwMD~J;#c95|45)f4+0$i(Df~Tc7y{GR7Z9*0DJr|PY8;ITRcY6Vt@mPozKkWl zWZ@9fN3Wpa2+J)J)cwV<$b&SPs14DyMv0mH#oDGb(4dl_5zh+j_YAc4n&@`sxCbTF=yWd5@*3fWdJfYFEKJN zFg9??i?jd$03UQkSaefwW^{L9a%BKbVPkS{ZDnL>VIW3na%FdKa%*!SIJIcfcmMza z!bwCyR9J=Wm*1zuFcg5#ZYE?JO4*1#jIp=<|9{KM2qUAE5jG1)@59KNb~jDWT)VEG zrzY)}FOgrTv!-d_6Y=#C>j<%PuBxiBtw*SN3U7=#pU(gwgpg7uTI19#KF8Ktt+jLR zQRJNO_xnL*3Kbi%@3N0P&k>O^_CEDmjEKkM(OTMiPApQpPdp#C55ba+80000r{oHS~iIFbz`OD`)AP}>@9^4cJqJaYU zZj21T8RASa11|JlFnx1IU_4_);eq)%4?Sxy5a6kf zqCxi@A9-Tk&?sj|AsuH=v@h24iIMPOrO2p?MXqwqAR;$})%av=8!N>4M$rf`0W< zzvW$IRbnH1NZ=-iMY>97HFQXb`@5I^hYeGK~_53?p z7t_=(-zQ#&Kv^CHN`osNnqTh%2~p=RmrrL}l-+?q!Q^mPSI4TgDSe4|wu>*LMA&$< zWi(T#NFpT*DWj3L93?6D;5~T;36uigDz9Gf?5N5Y=f?KsetQ`G31Ur@ zdn|zJ+hqT03@zCf`&;Ngwyz2A$?;DhKdUL~3-;vmzek&l-z)S_D4tZbbi3V_JK2iY zQ?E_#8UG&2q6SJOgth(U@;kAbRIO75Q6+7OWoJjmbE9WtkDcH|@wdzqAGr^ve})ns zGPLe;&BZ*Vx3O`tKe|H-{v$Oos%~cqHko$t<~;Z@4vNuk>6bR7y}@_9>I!K6xP$Vao@~;lj2(Xx>fFpl|()!)Y;v?&sTE3{=Rsvx)>% zGScphW?%AJ*HxE1Yv5`-Q{CwlED>-Josn@1H!MA6P3$TAzCc;VhFmDCpaa?b>X*_$ z5HPq^|GH15Kf;4({*k8qR5`{sX@83bWHUm3@6TVu$XkBJU@v^Cp58uUY6W*2%YDRPGdD|K--9#k9uCtP zXVU@^OO5jy3J2c%rAX^Yy;ZCFV9!4=jbCg;) z*ZDZChAM>8Pq1C;oM^)QFP}e<32u!K+Xty20}R1~dMmMMeA8IH&tY@&xBPHm)Pd4% zNV3ahv$r!xUS7bs)>j)x{=PO>X3<7x-AeGd2UUkye0q+2+HllEUonLL?10Q|5bs(o zdRk5*dRvv@1_`fbGP@&f7w>HwKl29bmd7~+d%SeiK|z|RHj={BxpauIWzuIE$DJeX z?tT%-pEt@RAi*1URF(x#uc24Qg{IBpILX^g}2nM7*Rmep<)Ax_6vyWa|x-RPzk8Y*bB$ z*9$3Ns`_Z*B{oJ}_EL&|>}$x2vMI^(FoO4V3Qf`I9&qpqK6eG%mt%EMeg#ZW>1@QB zi?2)F4ag6EEyK$dTfBQdf42M#ep1%o2R3G59{*ZZhPcH2ud1oCVQ;|aCS^TqRh}ZV zLld0zc1y$onpabsG*?`Fb9+}zaDwn}ckW@Oz4-j$m#$TA{|vTkP-vxaSsdvz0EUE| z9X{o04z9#ZTYcDWSZDra_c)PsMgBq+%IDla4goirueAQ9KDd~D_ER3oQl1j>-LVp~ z#B17=j?PDah$bD#pQ|#(D~uMTOpz8hV;Lb_0~-;|PUeB3dYeVc!{n=wFDM%R1FSK@zd5RdAmP;v2(uvBk`(5xZyxI<6)$%T1Vf|B~yZ= z=J!Wl?K7BBB1K~`lEo|X4$|OU*C-^ZRHBUQI}Iqy=vH&4J3Tqft&Ny6g{XV)r%YzO zq84GV%1pSYwx?AumSFdua>_+##(FabKa(AqX59sdlK+yFQ4{^7vM9o=sx98mvE|O* zyMP9*JREC=TEs;riOcqlFo8rBGkl@;^@<9RcyN^116o)`RutJZ5Xx~gCaERIah4I% z`kr4v+N`$M1dVkrPtb+Fg(=@qHOSxn{mZ9Obi+(icioT2<4Qz*wQuiY*ix;leN#>J z$o=jMYJnnE=t+JBp!^=}sCbpU=5M(bLs~Gu-Mp0H!7OwQ?s9R)N;2#VC7QopJ!G!N zHU3=!Pok@xfX}g9a#G0bD2zvQ|GOxDslUWhb=t8WSH$!xGdvf*j#IS+dqy^I{+w{E zgfSWF$LX6%l9u|DpxfE6nSKStgNu(6UqzpD@Z#X%x2UL8FY2(dccF+>DMen`emL_h zhc5JCAr>O8Q+IMb_3m7mlI1uRv2~VxS&|6y_aa)A2@KjQcsQuKmkezM1;LP^#?eE+$re64&w-&`Z zHwr8_C-ZFPN5)^bp{39HM}2Xul(ct8RsN0M0#c!?eJORSU#G5u6X4TMvr(~o`487s zL~T&R2LWMAh(b#rPJ{bag8uZ|Y zC6~K({LT}U-sTW?fNoXG7byJldH+dDXKUgv)s&{$a%8SG`C?41oxR^%DyQ7QVy zQS02EaD5`7IjGN~rq7jImg>|J8(UQV+;00F`$BKeK#PC)D0tje11bdQ%Od=nd!?qw zkx;o__T%QvmZa?LZ_&lQ>qTqR(FZ!Lwk6D}Ptk1e5REnFs`9+7DnatJgu#)$BNSj( z3$qPn{nDZ)8R3xpCa}rY1u5Sggy2%Rma=@;Xa1Zx0V(Xy@5|9fO%YL3j_DQ;z_qY4 zATn=~kWx@mCbQ04$*bcu_pyOl_pyXnz3RkMU`HwBy)WV?GQCq$Nmb;7WeJZFa#Anf z_)lIvXB167(suPJOJKVu{=@=I=<+nc@IDb8`~0D~)zsI?RJA3;oVdoBALcHob~1DY zBXEt?I&E6+%ch$m{lCJWHGkv?ziL2eOzk|TWL-nv5=QSKem&!)iwul<-&i;ws{ayQTbbY=e;8&;qrwP0J7{%`2d3>s{CQFs{^l z5))qf&^+NuV02-3Q@G)l0uuAo086wJamUdqb0I)OT)Vc)981a;>-WhQOIEB@2=5h1 zfPP(Buz!w;M^9C&&U>~*j|5gPOQ^3sV-TDDD1JK@F2ne!7=F9?>)|WciWEd4IEVOK zDysD^6FEzK{6+xwk}vvGVV2PwK*_1PgN46&wF~I_aP0cb`PNcpSbz250X-`EW)=m4h^m2*PqL*UUUuIx%~HNs%@LFKv8 zh&P3CMybxi*ZsAxDFvln`ZVP}2KdWvpQYUR*;zPpd z0p|e>1DDAPOp^*Ra?%m?EkD%fFSpmQM)9N}x6!JKiY7LDx#-_w>XTiz*fl$m#Zo)T zfRD?smd!6VP7G4bH__JzUyui#tQuQp+#*wYIkF2{4G1z^2z=0nG}Y#N=_K8~?HfZe z?PxDW+{dv^>RqIVL`;1u92LL>g+NvRua%6~)PWcD3W-2QA0@CQuE~+`q&*(g{}0w; zd2+fPFdl|4dYT=4{@Kb+P^jgd;4&{aJl8CuUychzlwwQSR5Kcmf1{;&C1 zCShRBN(BPpjTfZ*r8KwCeRfLTPCY9{dwF?r0HEf50ohw%6ttbY71X@P{$+$_bCPbt zwOj0noz3~3iQiu_0$r8$++utf!k)$`0~B|KhPox)*35%S5m1+@dlR(B_Mz$g2?g8D z8hB*BQ4fQk6fZLWG-`qlekjUjcs;K>FH7@N$?#`2PSv CdO2+X diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/simpletest-download.png b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/simpletest-download.png deleted file mode 100644 index 22990ce493c3a76d8b0fe9f12e1f2f689f6339fb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4946 zcmb7|hd*228^@zXqgLz^BUY(dqh?DHdzKV6Yj09}hQ=PHw02R|)?STG1+_|AqgL$E zQl&wy7~vP+|KN9DuXFD`=YH-z&vVXmp8GoQL?Z)D>YHpg0RRBCwieVF03eYh-g^Pb ziDw?Szb3>Bsh_Gg3`jh}fsP5pIt5(oi5~z!Nq<#H#upIh#6~WEb#s3cA7}p{J6|V& zzMX@wkC&69n;k^M&DSZ&$JfITBG>3T9!!)nUrE(`o$UPGe7qqrH!mlE7f`&D(jUj%OW^zFpOJ6gW}}w>Q*0Ho;xt=F{%Vx3U-;?x zayEov7u>{aN5Kx>C2(76&AOOXW@k36ALoXU^AV1Y&kJ3G&}U(V5rNhDZ{EBiRRP7s zPWz0c=Js^ZE?FNuUm(^9ai zfb!!1KY1zSg3_+#dW}>VH&v0!)B8ZX7T&c?Z`*pZR3=MFTsB#A5T(Vbf#U};BxIu7 z*y4IgCu!C=f1M~6sOzSW*`ecRh*PXPEU}H=@fr?&NwnNoPXHzwAyBt<;0@0duJil# zicTe;3~;gcXg>0Hc~xT0-SFGOhk&=9DG+B!xDOboe870VRs#4KgITDj?HpUIBIBlV zLbME3X~x<~sDMtM`!ulNQX{SeYilUBhlX|H!q}oMjLqa01jrMl=P@k;kk4iD3n&wp z#Fj-v66PhUt>rBdE4Z1`KcgdKM{L*DR3^_ENYj;n`g7#I2r65hmYt>CD3^V_rw@W& zq?>T>(*!wMVTe}LafT*+l0dd34xS7lf(Ddkl+Ob+!cPV?yZ;jIboe)CK)i*Z!e@Tn zH9y){xVU2XaRPSZVB>$>dQL%mJkBz(9%Bn$3yN(nTI3Glb(SlrmkJ^tLj`nkCVKiN zNSUHC*QBE$GMw?dN&CwELuU+p+!RGeeGlCAxaQ>oB2+YKe*!nSs(^$v#CrSs`Whe4 zF0Cu1-m1_MdTQImYASUDRh;1_MbIm&bnr=udZOboijjx1n)48Cp9yf6W%sK6z@(@G z!aDg5m!8~l9E;&%e8I$DK9K5p4?KqPGOX;xYjOdRgFe#Sjym-9$M?j9^~5j6YHi9sip$0CU;rdQng{w6{H%j24^ zBazQiFCYmAqa82*TD6M);s+5=Z2ABaHWnUg-6_ET#8(kw}PS z^v75cFpq=fr$>hhK%^F}K4oqmc1HU4XA%$LtV$bN6;OG}6K<(Z>L>Z=RiQ@o{aA>z zWFFI}+3~(7mBa7Fzgk$6s_>;b$BN{e>tz2_AVoqPA>1Z_>Ro|^^SBs2l7kAaD+h%g zvFBl#*mIK*qTCQ4;n>EmNfK3=5aE+^cRn4iB|sI#M`$aAEuYQ)dzS`8K9xGO@7pf= zKs2N&kJ_~i3%R4wIi|F|>Gpj8Ab6Wwrl&R zK`7H=ZJ($Jth2OegkZS~-vcF1%QW;YURR9>itzkP!$ucTlCG&wy#JV;vabG%0SP_ZX@A^iv^*yd|k4$H-a`gs}5=#gnuc?zc5K*M<)ygRwBT)7&?X1PVv z(!P`&F7rqCDcVnpJxlY|zc0tl-4|bzcT@eH6`)86%<5O`B`Nz$agWoOwylGVBmrXpsV;7-rym0J%QsPrD(d24J7A}!`z zN!bnxDqro0Anfp|^Su%YpU#78wFV-#hv_1^Z4P2iC#jMl2_kn-#3OTu24NO4>C|-B zdl(3v!~ayLeAD+lKROpl^8Pt+pQ`(XSSLO0WIVKXUOK zx61x?`cdxui<$aTBUMxM+49mS&SYk|*wPSYA|TQ{H`;ZgFK~d|)Alss_t`1!MTEx9 zpqj7w)A;xLoekXXUX*n4Ff^w3BEw@#&(kOMktpxJ_4h>%l}qSdbe8^46A_DL=Re{F zxOI1*EF)3gt=4hcOXy2^febf%F~dnf=5VQbLzmvRc&p5}-lO$fkK?lnDMjmYC#@N` zC=a{AzlUn0d5i4FuF0B2j*S{K!K|@63eC0w+gUqKuq4seF3* z%qgJmadjG&<#{3mUmO@5n${J7Bam|1pDkL!==QG1oY?~Xk?7!Sg`K=BA=9M2$122r z4VT7t>$zpIhLrVE26#ID5ur(;vU{d#WyGkO+dBcz5K9HVNz^=k{g?8q^9AtlB)Vib zi#Sqvb(;36zgXC{e$xH8_O_)s0<3Bmcqrx^5fBgNCiTAm+gq%n3(NJH!{LWtE7!Uj zZGydB<4AlI(wbP)d}!;}?edzj?N1sEUDjM!RRj-O@de<C@R!+moO8gRvC3lj z_>nxZIe9kMbIGuIWud*0I58YjHBcV%L3S>oLJwIlm7mnaH9lN}+UYv{g*ZypC*dBY z*b*?TWUlplV)CbZvzPF7p^5!lz`vebhF_X-(Q9*Q(D2~XJ}e!G(^q}k$+9lh&Bd}# ztpB^c6{cbTpn0)QmyT!-`w}8&teGCHwS8m6dPIOR1s{5{gQiEcI=|+cCI*JV3f@o5 zi~i)3sChO_j|ZkS?LCBa~=GUaH4KSHEdjDu$xy$l=m7lCjvy>yhJ&$ z8gFOtl7JUL!V8vYOLzXlHQxDFy@~nVGQt&Af;#DEQFwczXqZeLkdXMu9auV1u}RoDqhKWv$xAm;Y-gs80aG7&!TGo6X< zG@t}}k9T!D;g_0)^y`x~ovkP_7C@KOVCT5yx=5V%Qj-4uuN@`JjoLUut+-U*tl})$ z(#*piB^oR0#O?dh)fs9Q>Srl-sK6Sz{zBpF@7hl2NT`<_6T;j$P=@-k{LAZ8-8@XS zJ$U06x{1m>A-)%*!6P$(`On)8oDUbRK8HI*NYvx|9peUW+8azR6?U6?=CKHyTa}Yd zJ$fd?+`@*ee=GN|)%_^kJY}-%UV`CjUES?e%a)1q@FKx)N{pxb)|(7i9RrizNv}d{ znvH_A{`R#OX@BtGQ)bz?zgi$o`~Yds-v?k5F7S zPdnyx-^!6zd>X+UD7en?H*SAk@m)T!%2Nb>kCc0+!2T@5wd8eiFRAy(KSvV}^79fT z=3ch8lsT3`XydXhx?#5zpLq$rd}3ApR@vlm1H2U<)BtXbQ~z{f9dSm&vD_NWNXJClmE=C!aKQ`?Q!#W76LnQd@6&K&&_=9Cp8dgEOqui z(6gjJ@s+_AHESJ^$u`pz7CT53W#U1|1-BChr1iU;VDw9)!TT&}v8eRq0Y)IU{%7j* zV9RnZC)BNzzn{CkC$f5*>Zj^}A63;-@LI=~a$g$0J1l)|j5z8LY|mttJdxpJ$X-?A z&aiiP)plwFc8fV{Vuf&IveVao_b?35v{nYe((`)F{)me>)+<>@NXlx0m`RqVS3U?8 z7Mq^j^8r%wqLdjM3}xDlTsTT>mICLJUGhh z7E89-YR`K1_lqhXF0vMimoH*%K1lu6H8yh|ko9ue+X;WS2OqFjSZCb+nE zlaA8ht(N|pl5A#|&vU$j(NX$NOD?lGRt56QLnGgThaJ`Le{b4*MmP}6lP%JpoE_Vw zouh4L$QQ-Cr2JD@{nYv%xR!y4D}!xO9QubzmA(gsmoTTA+_k0d3HOj^8*&QoZ+y;g zth0Iz@`r&(%1DFREXK&Jhw3)>GbN4(xYzS7H)u2@EAgwWSvC)FtV+x-VS3|Pv|5f1 zz8iVQb8=v%<;-Vn?Jqo*0ipdfESXTb(D_FJpQbm6nQzShEUkWF9wKi4NaE{>i5@5W znp8~`&O$PIzvoi$z7Xs0Ucx4u9PqfS`2Bpa+Cp6rT8P!*;N0RokT@*%UQRI>sq22)CVK8cFp$|U`M^D#wdk<4*={7kUuJUVvx2T9ktLk=N;0IK@>(Xl|DaNPYS6sL{`QTHjQ0B59mh|~u;%63T$DvI7X T--yZ~LM?!{x&gFC^(pdyhHP^` diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/simpletest-external-bottom.png b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/simpletest-external-bottom.png deleted file mode 100644 index d976212cab3167984050aff7e3dd80e23e2a6cfb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 533 zcmeAS@N?(olHy`uVBq!ia0y~yU^D`#-gORDep`pHkSyH`96wnD-o-U3d6?5L+Ihb|GL8SHJ zU^_vq6J4~O6 zxqCCbE8N2JKn}>rEBwoJV80_w#h)zB18bvJ&ssKd=1ecm;`7W5_oo$KE7}>-VYmsX z=8^$Vm*J^f+pa$T7;vug-AslDskQgDmoB-QwKO5^R*sp~{PVZ+wilmgW6-yp>v!2c zdbY~jGV7T$cdfhpw=R5b=`}{i2Q!1Z^0v?BYj1Yq2>zMX*8enOZRqvaq0>*hYO2nh zdB(^0vJXGQpQ(lU_U}G;YhL!t*&DYyH+tsY`wFw0-fW(;ImqkP?>NinFI!Da8S0-F zcXBCe99to=SgiZ#_4jt%MhqWXX8&clqYU(_`vk^2BR0prCw-YeY$Kep*R+Vo@rCZ(?#$er{??W}<>yW>IQ+eo=O@g2mR1 zOBFz+Vj!i?MX8A;nfZANA(^?U3`VBWdJfYFEKGMFg9X;Bw7Ff z1CmKZK~#90?cGgJ@=O?p;cJHJw3x8a9lFr}|D)V!;zAP_1o}DCcR@-JS_CaVZu+fUSy2X-QArQi-n9a|M2z!px(#OY# zj4^tAe3UU}8)R>9Zwevk;o*S*1Mt5WW7O;GtDJMXzrUAjnnvsOT2D_;gcyLUiZQCL zYc)-y7^7m0yJNH2Z1iPLuF-Ez~W+U&toa?Ro1Hi9^5L6V!$%(@d zf)fBDbI6RYkTYYtaJr1s;;nq4V%qIeVxacssu2qQz2%p-R%_G|153m zU6N#s*?m5oC}`VORaGfX(=XR0$N-Gy)ZXm*e125p`cAhTV_#X8^4@=0mcgSXfYH=- zJ$P)a;(yz=N54am0T|79opLS>v!Ux9j?@S;0HZl)O=_O!zitgikO8=wbAs&LEs@`C zXWB=xAHbjaNx}adjK~1|iAzK5lE+Vi48Ul*^ii1n=@ z>kwoBuBI=@>bmaTRu0f##eWtce|+ z``eoYfbVq6GQ9Vy>w5Px-u(rzUF&P-oRTCtT4HeuK?dN@7-Q&u0RVjnG60iDkO7!H zf(*dq5o7=+k01juc?21N$s@=BOddf7VDbnu0F(D0Wr3-q4SHih00000NkvXXu0mjf DrHuP^ diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/simpletest-internal-bottom.png b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/simpletest-internal-bottom.png deleted file mode 100644 index eec1b2acbebdc9ff90d8e5d68244be7770a28d95..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 516 zcmeAS@N?(olHy`uVBq!ia0y~yU^D`Bhlnx-Dv%n*= zn1O*?2!t6g-L3lr6qGM?IxvyY~FgUb;!q*NMx0=cTzyyASL67#=<(vGG6qyBHaB`)z?UmYuvCo1dT0 z)G+PLXPxr!m}(A&KiW=g3o2W996obMHartFVmPau!Z6GI1cOQc1jdYMyR};uNF-00 zxppr*!#>^TYxcbt4ffJnx(38uJ7v+7Nslc0qNcf8KHqB2cwoA%9KY`AMTrt|^QZm( z8~52}{a$W{eL1t#Wc%Gcg9^&mZ+%r`w|dH=!w(lEN^H5A6E=^Nq2Ac|?)&msJ@K!# z>o31lc^Q5}W#zS1x8E*%{dLux&AZlB|8?mORAf2C_P~AT?yR*%;nz#OG&PrgdFg$1xgvAJ lv;qY&>>ia;3=*WdJfYFEKGMFg9X;Bw7Ff z1KUYNK~#90?cK|AqdF9Y;Uz8x%D7V*CZoLnTV;|#GH_A`8xTTga0;K;!M6naG~NF< zB(fosRa+ZLHr{(L0GP1g|9$`f_$h)6z~m8R049$h12B068Gy+n$N)@UG<4B9r}cWR zrfJl5o!Yj&^>YD$!Z1`21Tw~GHk&C;Q^j%oW!z4XEtgBZzP_reDn(JGD2il^kum0G z4-No5@BKD^+O}2GG>W1~kB^VKzrWv(Gv0gOwymC@pXHoWnx;yUgzy6JTdM0?o6SaX z9P8=nNyeCedt`5KZ|b^EcXxM6)07Yc@Y_m~M0a<0vexS5hs;UOZ1VNy>t`%8pcis#Dz*y$R%Cb!J`TWauV~o14Q-{GA55;{XCUVMCf z9Q=-R7SrxmY4pedjONsy$=*-%X8)iIdSn1bbE_XJ+P@DyG617FH^_dPH*MSQXb_|iFITECXXNkFnKil0ZbNqEdl&7X!Zk`JSs8(lSf4cV6y0u0r+G5 Y1DX<?ONm)~HCBw+HER^DSu0g)*Dk(BQL}2(3XL>H zHPmj*8hxL>zxSUvpR8xx_vbw4KIb~ub?#&nqkHr;oHS%)Wb|-7Z8I{mE5^Y8Xb=_f z?c1lh3H(r?wBY6-;1vOKNdk_k{qzthGBR4Gf1fL}_^5N>ByXUORp0|(x4;m`09P_Y zN9O=vq^pakBcHBkfNO|vfH#UyvDIT14cyB5@7B8ku8x78zCL{Bo=8_RX*mfgDG5n= zr)aP>85t)Gt_?Fs7i|}-_~CvQBoel^gz2Sza+F`;+Ltv!sk(s_{O|rZD({jmy_mSv zuis?Cv1l$)#m3UXTsTeNF*G_zZBqwV=bEZyzLmBPk-*71xdY_=fs z?>YpTG7cN?{$0M)m9yT>YrBNr=wngjHdZL=qVdCI;hPR-_4YphZ(E7#(<2tT)iRt zz+qi+q?Ar4+gVu@uqZlL1k-+(E91*m+i&bm+`bM~-?=svbDeKcz)qSzdz=w9c!q?E z$fl*uRsWXX#O(vKbz2pnG3yfv?Y~+SBfcbAJg1K3b8BMW@4od_F}koQ;pBj*>og(+ ziY3bhV@ykbkxKHz_#cYF7%80ZtSm}*CO7Q!C&+%J?sz=J~2ieO$CbWMgGKlaffL}M{q74jB?lt7m;O?swG|j>V`3>7%a;WDpAVl5X7Pde z$*WV{9m5q`TlFKP{&y2}p6>Kd*uko9W`u*;iJq0mXd`pm9O5ZoQrGDDO0}nEEoH=C zHNS9`Go=Lby&u$#z1Lk@oUd=Yp!Jlb_GwBk?7TAXGinFK6WSc?$uoE}qU^i(SdEUB zDve`$&nZo^tBDme7sblsHz{6#mj_Ab+$SfiFTN;AKpHF#hbD_=lpU&%$l; z2h)uiDQ+y$osLP|!yV|1y2ZST;zVv->F$s+IcaM<@rQgwDcMHN2WhJMXi6>Aa&(EgyrCC%X>jdn z1M6;YK7OUdLVWK@=@td-&69TYEs6H*cHBK)+B^G*lYx|C=1Fhd z;98p07le9OPE2;V-o||(EZy4BJ!mO?8U2*UtS5)qCfN!C6)S^-+)ppTJp76ux;JIu zthK2wY|Lc8f1Rr0?pg;o2IR{9t%1L5XyU@1k-|SDUkn4cE`CNreXnh(h`PY_^`GJx zfK|qbtnePyJN&8_xwCPc!Z{-OAugnsBjJwad}0ooq#} zY}B5_XT8o>Hac+I8W99Jp<|ihVw;$Ju%IyPDZeBZ>=34mC{F}=Db2_h%SVQ{(D;AgF70<#_?g|Gyt?j(Eqdld&l=>W&=^9Jog7js2h~-8OTu08!$>V4*WMo z*7uEkpKtHEs6A>~mLlPqx_6Aly-C3ytLMmTQ-t83HE_b1!O5R2cW3@TK8l(>cJQ}t zx5%tBVCrfy@o&l&@>WFYqgShh^?SoK5Z;9SCK| zck%*p8dZ1s{9_Y!tW|VrDv=uiJ@i|iK_|hei%}WwZ@d%X(F)v}W^39JudK`Sy&k3T zB^~x_eC4_7PXm$kx{H<8rB~TOx=v?iFQBAYOof)gp#D5KQ{IPsmnJ>}mf6KGbJQdkD_aB@( z{W{)Fy!wugrB3vV%*$;2N@HGLW3SEazd|rZRMty$)HzZtho;1#R)fL^3*q7uox0b;aAy)BhG!-)%Yg4iVSGtd4Z1-Wa>xWM2Nh z`-kkFUW#fStp$qQ=qL2P>&yjHss5N=L5^+*bAYuB^zsEPYDpBgvQ1mz|F6ib_hbmPPIN_D{11 zHC1EzxUF1E*b=twiZp5}(YoKjLKwjw&>e`;1SBPOik>v%D9#FC_Zb}2b!{86VW4H~+)JWlk8?=9;0=o$_&9=&bGY*Dj zR-x4wSec}n%8QbmO^+gMv4`5RGO>LB+~j zzgWKSD=Yn|u}PAu%c9LRb?gF^iOrboL|0iCv&zOZFSMrJeg1B_%ML3$p-{?`z_(2C z#8&*?3Y;+{$$ao8S-K8~+0N}FIoF+?-(}xTzJ%0HPRokzDdpcEPR4Xm&d3_BcQRO5 z6u&Ez?9Z2PLk>vl+SMwi$MMB`uWUu#deVVHlsU0eJr2(%jgijv->?|2sE>r!S92w^ z#XOnv*wi2Lz52H>e3}@6;m-!@N$UkM%*>~!dp-2OZYjUBvsWGX#p_D$=95C11!(dz z(0RibUVz7F%@oG)7XU%qYx80G!fXAq(8vF!j!+h`GDW9rAJ+naca^z_i3Lkd4d8yT zxa4(S^@GSFK~jtD7euskwYgT^!#LseXr+Y-&AE5^8`iOWnwenp+Ak*2mGzs7ii&#? z-B!@j#mD`!hO&hd`I~Oi9D11)h}=A(H_+pD+;&)$+d?aKVZ6lJpr-%qI5uXbI$o0L z+=D{|s8lDHoeHG=V!G>hAS-)O$lLy1ZHDiji33;At8=jdkb$zj7m{A;J+Ra2>SsJh zEA26q6QBK&g=Jmy)4Gn~Y>RbtZv=l^b4;S;kM;}9fk>qXt!GH z0P%;!dB}3E2Y1CZT)BKVEXwltdI!*f>hCUk(WVp2?2Y0Di z?)U+=sk*DO3lM^0tK3UXwfiPqEzq>YT|F_t*<8b3j61Ir!5Eo zvr3YFn-?r!GyHqJkWq#8HZ^Nig)ENlIm;x?^4&3jjM4}oa_>gZs1!5YpNn^7N1aAp zi;EFJ!^nSK6NQ2dfb2u!s$HZO+S0<_^K3-^3RIpBid?f*d^TX2rsp)@@<%wrChnnU zVzX8Q@@BXOTm6i~SL4u~=yxtNa&d$JuUyBu?ipa`4I{_ZcP@9iZ5rni3l08bw- z-^aewT%-VE;542YCa08zhDg6!S3872#}SfFXV$om*L!hemi5COWcD2dRDWmSm?Z z@wDc@xN5a0BL3$>-Q2?NAu0RF3KP@w*^6&XfV@-v2-sO*d70PM;H zzs45s8n!`cb6pJ)LTdpWIr?ixG}SdV)qnAw^$>oHV|GM|qz10-stiMVM#f0INv>;E%`dK#W~iu?ffAJHdvQ@@9RE9;1)yh|X0C+o<5S$E zIU>m9)og=CsCNy9YO<HUua$-!FK%Mu8Hu^XDUlAZPA`dQV)Z3JPnbSAv&t3Dy>$|r*URyEU;9Yj$ zeCS$0hvsWI{}Z;r@qk4Yi^*N7M_|ktzp(UKf|siR=t16&3Wi1 zJEG+6_-q56FOPEZo3Edd?j5FqIFauFv=#HJdw93*A&N7)aoIQS!y_M<9NpCl&w3XWty2N`ysB37 zEA`LtP-+#9sQTF{M7Lxo0NV2Wzk2ppHWKA7$s~W0oY$V!)FkSonxUzKS^uGcBDqT9 zWxGDu(;)@;B_=Y|vN(;7eS((OO_q~BTfe-I2zg<4m$7!z-o9U9w#iom-xv{%H+bBG zuzrp0UmOx=Kgyt3nC{3f6Q?`Y zxR5$j>O1*sXhJZkonW6-a@S9aO#B(Oe7wKv;kH>h8d4oCnC9M2EYNtaSe z{;%6@L{%YpW`qIs>_XiIkytAHpzG$G?94{sun$!&eLqxxI?NLrEEMnrm4U{Wk@4eBOW=J^>l z>se3>etcR+*qyTD-E|fGt-5;_1^7=j>U`m}w+rLI7~h9IK8yV42xo;ah*vj)Np>t( z@M8vONAzxX6qglxNv#jCrR9CkErtrO6~YqxYl^@CuF1}Rjf+z{6^?Hl_Z7U;5aYjV z6FGbo5P7|CrMS6Tkk>_vQu{~|Rbc`Aoc28 z2CjrX`2pjm2VL(W3lC>NjWljV3*&b_Is z)uGzlDX2BD%kE=y_klk*AW9l8SqT&8K;HCgcs&Rr!TLE8is>}wAO*yL7gQSJacMV< z5xF;8X)-c0u+k!3;wNj^lv4H@^oQ#@ru=8-?k~pH9beYF$IHTH8VXl7G-kkO7qbZw*`%BJQ|N`eX+n&hX*{QI2|oh#%h`c!uG#dP zg(?q~IJvVNSB`=T7&ge(&W=(yIu!F%IORFmvwD?f{+9f4_2Of#xp&pff zNCiZ(y**8FMu&uXql7uod8%CYHz^HImeBg7HrQi=>B=JlxDsTj1MtoPp-(&}DNtg1<>~WOts7N?-lhNtax|8KWlY(92_d%iqBlL$qub$nh+AaO22=ZA@~B z0cm^beNOe@L@%lJ7Psh3VAjQR628EfJj6^jd0qR4aqNP&{Nz6&^nwbEp@1>o-~+ld zu}Ngf5E!F2g`O(V_~O?DST@Ctn6&$ukj%JMMds8GNy{SlX5Gec zu>_}_gn6!OWxoGH8>+>g_h+bSI&V&icOL7`X4bqM=#zkW-q<9%c$9RYe6L}IS3P3A z!>Gw>aAxMk?nElo*lG2VLvCs+twU{a^J%jqJ3AfKgDk4d0>n^HcdeEAv`_o3WhiT^ zK|W5dV_@U>44|QsbXT{7Roa3mVC>%P&g_W-ZQH@PIU2!z@O-XLU31ub^`mH^&K!L~ z3jG4#O~ub^MbR-S=& z4xc_7Y6RLHALMmN(OvDVACR3`nEKGRZ8G9UWMt{Zl#{v@9H+3?VT?ud&r{D0VU5FD zu+8Ud@VCs5MQ!RHzOJd6dyz~GmE}y6;{6PD$i-z0MYzLo$BnXuhVO7lVv%${omcDE z?3}6^5ze$>D}_7q{pAm94Nnh++IL$bFgsWPP~CD^Qg!}K@mhxNYGq~R6d3#%CS+Lab@kSOwI3eS?lFOnlb~G zi<>_7xFTNbIxwf|j6@59$Ww-#ptlJ5Nn`?!?hj~RK9`g=92gy?rizQ1`_W-8qBMhg zr0o3K3Yz%ok>9ISKG0;^8^W$JvW`WEgM+p?C_~+91=V7t zu*yv+D-)QSnT0?gfGnCk)kPkA{FB9$k}3<%1r;r#et#(pk;RnZ#uwk%npKl?29ZG= zi7@~ee0W4=hmGuw7}s}-WqLZ~iEBfN-~aE4DPb14=+?4vLRiT2nYHx5wFzL})~eln z5*pd=Bie}fS>4*AyNDtn2Jpns`0+0LhBE9XB@ZEz9)IZ|pTa?AWNch~{QCdu;*uGU z@d)1~Y`^5Q=?%*)td4~RVDWt+nU>eB;oT>yRW-_OY9YtyLsD%fnn^VI?Cu!!V^r_; z0ZB7o^NAj-@!5hP`_B5i%sTh@@-?2TX-tOR+dXFsXP1*A3)!_r&Fg>&=)t(YXZp|<|@zsP1%w>W4X`gQj| zfV)%Md=7#{j%JmrC0pido2dJC*z%~jV~DrmX5T}z&`jETXv{G;#YZTQDYL)7{}l@h z$ASt{`SxMhbP!&__c=SHF0igj;Gv#svbNtf88_tG%hhO%=4kWFXM5Lfr>vNNdjv>W zR|Fu(_pbzOML_0~>g(&Bly-jn#}x8srg;oL7hk%q&99gF!^-*Iy?c{v`IHVXU)_P< zMwmm{Gr_mBM*Etf!YM1-=Z14YJA;>29+2`nro-`L7rqT&w-g=w)!6BZNDnN6mP^S^ znTt33%+em?f-7DP=PWjg1E~epEt~NZ(Q-?6>992dpOE&J?*b&JsJM7}YYUpIYOG`G z7Z@ljQ|gUi1^9;mIM;Q8PV4@kEvv?4yTboI$ttA}w75_C1qUbEHxMb3S&I=<{@lL~ zm5q#yrZ)nMKB}l3&CJYbjW{TL{0(M`n}FxJE;eb&yt|WK)kPj;!JniOTjBYyO(T@Gf8PVre>WEbd(5}v#eEd*cDu3| z(p3#SIU`qMmnfqFw|nwR{{6(+a;I2eBSD^#^)RH8CBbvgApYsUG0wClAV#r_}P9BoAa diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/simpletest-start-testing.png b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/simpletest-start-testing.png deleted file mode 100644 index f36a58ed30db9b8399acb53e6bf347c62965e8cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5952 zcmW+)1zZ$w6F%jDqokA&gd?OI1f)5-Q%aB)jyyt;t|O#Fy5UcG2$Ir`AR*n|-7WR4 z-~E1jyZi3!yz|aH^US{UMO{@65BnuH2n51YkeAj3fu8UH*Y*$$;GY(Lpaq=3E-(dc z2=McUScC!hSO|H27Z3=C=-=^Vbiwxy7^HTU(R0;u{OIa#>TC&8F*SE~w70Z?n?hyb z&X(?u&bBU4!5Zt)&wwb&KT#=XOH)_4qXSeMZf^FYBCy6&t^$6!O}v{Q9yt_qBFzw4nEu$T z9uB{tgA}S+|Md|hkV!^Sv3GVMbDC#Zw9Mbq%$)sm6C5prBovlK2-fKPii}04qhXtC zrsBwMgbGto+72J;(Ix1DC9Q+=aP+x|Iub>fWc=FbBARu)c&XeSV!KHs31)M)QAz!7 z<;f~tpq&1(Aoiez${9LH-Z}HP*iUuBI8>_GBa=Thbe!lRdDYBm|E92`QZL)8c6gNS zwj%~>7(7?$J=M<~Ku;d}F7Frv4I9n3hD~nlyc3DBXIYmdkUn7!kG;SYIS%m-->T~0 z(-grEgodkWAnjs|Gii*uh%{xmumYJlWC$yli=AD}Q*lFMN|Hz=3A!bZb5Ar5`R?Yi zGS*dBa7nwj!g|woLMzlPYm%b^wz>NLC~LEe2SV37L89kOL0Qb5Hv`hzyj$i(E>xUG zX|c_u_rmidt+WI<`QasP$z*hq10GCPeITyNw?&)z;EcW-LNER`} zB_gv8ygj1r%lz@H&)Za0d{9xH#@)j?&2}o!04FMVkn4pdcC^rA@mx{Lf%3;heWzgG z5F0>EE?Z}X8iMKXlW6ICJv&4WZbO|xeLi(tuX5L_GbRT|dSP+c6N%;$9gW)(zEleB z{s<^!qhj~l$>3?7|AFus6-dH8oT6K91jI4*h+2J`l;az2l)^_Qz;X@G#m)0ab)mMMRacrOArTV)#t8fdYXslj3S~5&*{4&i0llj~*rz_1=PIc#6QflwVtC z1lfB_t`2yr(tAG0DrF8m5;yE>AcF*R_AmeDbKj!Aw!H6U==PsjM?(^fvZ(CN&Z8*| zM}8Un=xYJne_}7@d2SV^LLhC*b*qN&L@78hh59+?D-zP_Ye%*Hi=$kL4_B@Ecl6}! z$LiViF>tB)a=VSL*B|a%6fWE3WX&1VfFqLp9B z2&l6-=9)k7dx0gHA~u5uC{9g{mKbIZ8oV9!yW@bE4>!erpKDd9nCi2q+Ad6a1m`~C zW4Bn0RT~j_{V%o1y$!f;!IHf}g~7^raXT+}HU6aww$vD`@Rt{BP#nSKH9kugz9hj- zzCMlCS!N=~(vx?mG!R;GK30oRG&${lRx&Kqzx1j9Cy?;are0wLh0x;ATM*^EdH`$8 z#>Oi6!|n;B;s00QlgK}rXYc_mxvu)Vi>^PCLPxw?>@c=$(PHSWp_*9n$*xc!^t8wt zMiPk}e)AmPmx)1^e=>0IyNWf+mT>E=1YixaZ=okxvao59 z;V5>rg}0(~_2ZjeQfEi<#MKFLTy}HmFT5s+!diFWi9TP-r&hVvUlAJ(=0@~K;$aDr%+Vh|yKudDz0%y9@vaXa_KC2F}CQR-J@=|I@@`_=2aBYfOU;v;cE z(mq64?hKb0Q0}mbI8t{K(6UY8(!|-DXW~Zs&sbNC>6aLAkMcwV`cWyWHd7Nw~A>O~C@%)o) zb+fZTMsk$nEXGoYYU%iXm*w3pnqJ`({xQD!+^A%bU!xTO*k*tOpf0}FDt%wi#^oPx zyu+w9c?>Q)3AxL2%vZ$wmTIpQD6rlM2-e*l{&$p!LATp;=lI<|={&`t<$$F&iq?TQ zgH3J%%+Gn!S4*~fT3_LT5H=JOP?hZ{<|A9PtQCl9jG`mFE$<&oFBL$IP{wTOP6b|~ zWu_S;HC(A@05m#wew&}x!-=kKVrpD4`alX0S)tGGZh4Wqmhnw6h%0lHp-Vt;@;}kw zVd`U(9hAFbpVszYFh@3p?xkUgxQfa^uHFRU6T$E93y+jjXE%aDRqMmw%oAmrPw4@mE3r>UT;vRn|O18m?E)i2<*0 zN|~~U+I!_^JGV6fAD_sc>1dNj_8v@%raLy5VBl|5;KS34-1k+sgL~!fFliosc>6x| zGg|FTec$uq+KXc9ayNWsE>&Pw!wUVrA6%o)viFz&bpMlwr*m23{zKyKlWkX%Hh&Ga z2$i$MIr_TVGW0Eq$jZNSZ^l`tZA>D@_1hAp~(nasih&~y>+uzCAkvH02R(A>}M<0l*vx&yL>91<5Clb6`9 z>%DHY;H(t@z_03rD*z*_RNlaSn_AX&w*g+**lG1%A7|(>@v?ilZ6ymW zX7#ZC=j$;Hpl(p?zNoJ6+4}Q??gL}gCPwKi9Q?(VLusJ;EeRbZ4f@gO%qHjjp7;NB zE3lH;M!0x0m3+t2eO7fTH2)s`;6U$O;#48pgdTZRci0}WC<=!IbtX@o>uUyDe7=zY zV08Nk0m-FrjFnXq5S77JGzsrY@e84fmwlze6|O)k0rm8se$j`Zx}N)D6QSfI(8qL} zct7d~?K**^n^y!j#59kJgwH@h74MW(C27$7=d2cy4{D;HVTIOY0C(=|xwg`ZMSNF0 zIH3k%%AG1XS{AKvZ!LhX@fNM&1Q!E+X(QHeZ|95D$pKfG7x*~M-T)yJ|JFzjd@eU} zE+VEmcYam8ELyqPtjZg)P7Pu~V{LrAvn_1zQzbUicwY6hr-w8f@Lk=X$rK$SoMfZl=qd{$Oxoy?rN?ClpYML%XzA(m`ZAo_(k3z}p=G^4mvEM6 z7SNf*g;YPXmt_~+FIYSHC%)1ii#Qr|oi(XTGn{*V>0~vEbPy zEd~lYPc^1AuN-qPTAffOR3F9mAN@M`B!CuMZd4UFbgYG4rMz?CmO04GWT9!tpGGk{ z>!XuoPg}rgZl!QYrzPccof&H&-lcQy)Aw*hjWXGRZ$GXKb(&_e9xy zA|5R?MX_gN)3a%*k~k*%V)$47s7V+8oqQ3b(aU_ND zJ@-(OUN_E$mk3eEgy>QaUC_`vn;8hZ@BMykr|d3`+xzu+KMn+QZK9*@iL*SrJI4jx zzLc+Tcy1EIb7%UdDMrd@S_T8?YwHT*2$I{HYc6lxTklXV%2RVF0u0okDrGnAmyy=h z1MM5k#$q+z-hb0>kI&FzR+58S6TAn-9%<^l9Slvs+@>G&GiXO&_;e7jXe!jC+AhL+ zO@sWtbHOgxi7K_{oU2jeO*}(baj73{8ep>wWLOFg;x%t*sEIU5vgy{$!kkC)1bKWk z-#C=%(|fj%`I7fDt}fn)cU^s44D)%Ay5@4l^*g103c?MIUU7WtA^ZzoQR+KrCiR4 zJxZF=C{?5?Et>V3N^KjgG+kd7R&~IB1$4%|LV<@~XGu~HxzQZ3$kuws890>e{8u}u zJl0KydzYAexF@V@9(+#$@;}JZ1>0k7ybq`MENbYY*67+M6ONXXJ-!#c%5&;r-#$6q z$c(WhheakcIBCgOB$Hv#M|VEKUp%KKQD*J_z;Tcf@u-Pkkvq2HFUNH+P-?tY;4|h& z)=KG}lw8}>NLtnC*rAn`{K9^!SUwG3ss|y$6R%Z&rovd`W0l51s4PHqgWF2w{R}u% zk1@5`mNZ31Lz9*XHWZD0CYFK1Na1O_ym9SyO$~=XkUU^=%(xkiZk|O9Iei-+RLZ}PNIP;cR4quQ_-6HE>FDr>i^r!b5`oqpJ3xye{Um#IL4Bs24L}}_V;Wv zJ{0@eQYGh0C066cr%t(^m%Y@|V=m+y1bcAH$;@$A&ABVvO(8>bV1=Q#(msPBBz!dH z*5p!OA97s~q07le*!Fl!A;FpPACC@i?$m{Lq7b!|$ z_<9#!>k_=A(f6n{jy@PyKq+pc7f^%8Dovpi*~rm|2i&$-xhH<2I&9eIAK9z>>e<>S zq^7yZ%V5lOTA(y2d~5MzoR0Ldfa-mDi&8c2opYDEZDp?eOy?RzP6%c7Atu@3vtEVU zo2rRv&kHpfpS}#O1g~he{(i8dWZs- z;gd^!O65`q>o^r>y?dYM#A82lRxSE*6`{Kn4R&>6{#-jS4{EwQw6*J;dwA01e#gX_ ztu1WkLUHr|K$@miyj0_8Ar+2k3YlthJn3V$7!sQa5peLtodYJN4q58BeY#Vr~%XcFbZPM4@i+5X3nZ+^fO%3pliTSOY2>3dMQM15vKT%QD?=pV7)`3Wk z#HfEqDKE(B{7qj95AGBRx=J0rcxNie$!=_u?aDJppZ%9vwvi<03Qg`LXv#MlvHskK zaqh>k5Wa-r{4+`~-Q%?SO{F&)q~xe1Zk1AX0&pCK)Dunzj~fRhUD2u^^_AInoxt9k zkLGWZ#`)kd;?HxO)jzC|P{a0(75hLs6$6`~b&Ds2NBx`1Z`2o{Xz?Q9qo`l}IG8<@4 zcAV52$HoFGxxxHhqr>q~h<#j`ucRnXAe2uj@+XZBTH|M|K&YldI$eY&QV$rFmyKa7 z{KB~KZ#4JqKRLC(-(Jf}DFJ&|xz#AmaXLB(tO|lW`TxUebeXW%5ZIYCVbC+&^NnG; zzL9^E91w1prF1F#x5SsUN&k|FVFE08%fPcyY{nqz$d1BrNo$8oxBD~K8UxnGFSq65 zZd`{uV4q`bYn1<7`94Oqn+Uu?-j~yPcWMAKPqBy%yx(N*q&GR0x&j2_F`X(uNC1V8T2zvTn!;J0DX1cp)qA`AuTPGNL+j*?M=gfxPHbc~R0egcBTBt&9_ zfOPkB^ZxN(&;QS^YumYZot=9-=TqNrw1&D8ISC612m~TmQC4^Z0^x}PV+RNrc)e%4 zr3t(dy2+_%L4b!p#4-xFCU#cVa|3}$X>Ol*V{?I*z=s^}in{KaPS);TX0BEsH8TrW zCkHD_TQklVwysuQPOeBdP8jChm^Uz$;dZLLtCg9%t&=0CmaT&oNK9NZJayK%FPGlfln817z=eqY3N+Mkp&HA|C@zRkqE4*f|jWoQCs&h=AaJ zCuq&`=h}tNv&H47JA530ZENtI3-;{pMdx5DIee!1U*w#qgl&>z4+6vjiR83@=4(Bb+u_kX>!u5_|GZGMR6>g&6XEti*lY!c-jkGkjVPWY@^vxorzbY zQY{ZorP=uf+wTqDmwQ_k|lRp0CzVVaaP*gX|wd{J1>lC+l@ZM9#BHLlE&^jKr_vqfTUp%N&j+{Hw*qV{O zeIrEhh($YbK$oAn`OVKM{ra4v8Q|-ad|`jcm3fF6=6Me6ol9Y^F?5>(+sw|Nql*;!U2262t@_t zC$QhHAq^wD;_|h4H)MK95sydNBGHc_u0aU-$DRb96WUaMl;@|x9T($KMfO9bVH4{y zbBiG7IpaZnxK|muLSaGNYE^4Y`>tz9B}8xA--#d0w4MpHtzBG+R7bTl-3* zDX6&Y5iZ>VNyTu#W53{OW97UN)vi1Y`P*)o=Ms0411p_JSN}2v_9*k!9w+KFVkWoq z;@M8`_5NpXr{4z`5xznzC!;+0kulCSj$t-JFBdL(I3~DDpTz{w@K$sM+z_#ce$1smJZm=$1V8Cygl=X@#I)d?$fJq;t#L?(ld;&PLWQwFMW2);WE*I^l66`MZn(|cH3~h zq5A3is;z>`!2RO(9F-MmdPpzw5#ECLKJ-RCL2Px9&bNlCG7yCN$VL&zq6jD^CVq9AS1P)ek*U&X zCh}-vm?;HBKbpzDmiQNY23 z6cxiBHpSipw$QOp?dCtnkXkVwq1 zB&Y!oF3(l%x5ToMMNI?3UY%02I-lyq4}Ihf8U6eu$_6R1xHaCqyWS&yDnGxhp2d~M zfrkcz4!l?Hn#5)17eigg-!r19u%e65B#DxUppg!75Em7L$NaeZs}x_!~QJ7 zMGrbi7z~sli*GuJ(z8WPd!r3oWPC-D<3js=t&k)P%k(F;vI#Dfv%o@_{dDwE8b4cn z@S^6C*B?R^dxoY1mhMeS6 zQ}|jug$4?lh7H+UXt-RFY;VKS;|IUlr#TeCRi^HCTDb@ zjA2G2gjl;YyV+L?)O74hcVkxGE5%>|rNGtR8k4<@K~%ZbMV|QjC>M;ZE5RAH8)oKE z)vaaoqD2E;GPbAtA&sPDph+j02kBeLsw10HDS&EJ67C`G&763Es_Ndnb;5y%b0OqK zUUK{&7DnW4%p=@G$7u)7`@qGqEX&D`-3eKbM8pH7v9ZQ8JfmZl{FmjY1gx!PTi6Q5 z3IMuhCqiW z02Tyu94DNDymS^Mt6U~0JKXZG@uAtQ5~R%i*iJ34*vb0U>=}y4?vN&Vp4!_pm8raw zjxFex&v_P`9=6?meKQa)y{%5TCoOfwnMfGazC&;S=92yv(|Vs;QgR-$$=s!YB@|8% z=o?VpZR;24-N6N{@M8gQZNz=NHNLdQ8$M~#f7E~=<8_4+8h!oD0;4$lZoiy$R##}l zz!%j)^#1LX$2Ao;*?yDE0L{ZW6z2Gs+@`L-&o!Kp|?}q6`UWYPjGMK)7 zd1CT!&-BKx%BsuGlGPv**o5FOj92VwEqKV6^-JM95*;()B1q@Qw;b_49Cb?*dON17 z3?b&sB%01BloAoi7f!kVrAGT8B+v_2Vpdy~%iFwC3m5}M$)8(iW@`45E%GcA!D^WU z!f?I0t9q*H%JN5N^dUDi1T}t(hL+3jo5fgBRlUkq_tPBbroIX5-5`Y#=;+WTL=#7! zcG*jVo@)kesy5{PcAZ|oz#M6_mcgRaiFB5J7{%vyx!#!{nfh+GKqJ=@HondXXk8xF zU}8__Y>P#Ae${TA?Nq)15V|J!eUhI?0XAhxhEN1F@$8#inRI&0Kmr6J@B6%i64)>L z$>UAHU2kC{lTpWx>*dmO;)3=_!N_a;jiA~*!z*RifK=^%lHl;|TX<|H@shJ=si(gR zwkHbepvF-;1hNZnsL~n{H>o(YSaS2QY3<=)r5t=w&kc1SzkFpSWOLo{0xl%yXqhp&%aZ*5A|H_@m>3b4rGy#RM=MH5n1eV zjWlS-zCszFwiUUE?OfMXZHs(#(k$O`l0hyFfy#8*j!j?@y=s{UYcgM`Qmk(gWX)?Hjglk1DD^YKPlJ7$^r(3 z-^w!ck`2g151(oNzp$H|JRpjY=v{BN3j@=VaCn_dYi7p@`pn9{GycO{gad@3xM&%3 zHZ-^3fh~5omuaTV@CfG>6>sI`Hs+0Zb5AKndTxc*s9YryZGp^^$w?Kt^Rk-tY2oba zT%86(w>M>EEDd94`fc;WYykw%D^PQN%p!jX+(E1-DDoy5Rv zD}(3lbBED|Ps2w7yFkhS{;LNQ2%tR_i2V)EoGOwYd8Q8r5e8QnArE$-MeZ3&1XmT; z97!ED+x_ti!C|waHBDmlGOefN{F_5%zv{(jsuw4OhCWueo9F`D%}kWyM`sRl9=7h3 z_DIojESwb(U6&*i1*KK~coAZ}^}4n7{9XeT{Me|})kN|T-MKQdR#NN8WIpV%T3TDJ z*D&(g6YohIc9mVM=?H)xi3`b#6LtIAASQ!0-e(bGU)^-YGUqUf0QG$~%G3jjno^hk zdze}YP`+Qk94QeqIB%Q6Q#m}NgBa4WY52Y2p#+@B2H)MQbFb%(-IR+&T&Qk7GAFbT z14rgujC^}wzy7cQ=B=)a7$btxj}Fj5qz9hq!E}I--+kZ$fCFz2pF@g-k89})B>*Ew zzt=`TW&DREz`&7z(<*JwFn<%3Xo?IYH*8y#;M0x(5)n8it|c@e3CmTz<}mlwtFWFV zsa-b|kGi$`eHgrZrhT|1-E*~GB5c*SFIZ5GT`Xec*e6On{)tLB4IufJ&FgrZ%sBE? zS3I@$T0tMl{5$uSGiM@zjVrR4nfGkIt8-A`px6h{0j(rUCrrnM)RHWaBX(7H2+J0g z4A=cJwIX7`oN5saWWQy!?Wbu3qS=YvI9=@z=AVU<5ufHo zFE$w$g9&of-2<2Uz+Q;vi5KL_&sC{_m}ReR?J^ee!|p0qmM>9$gvs#FlC7EzoJHP_ zjqGJK>zIS4VH~5K+P4&{U*DLU?clldX0!Yr><#5-UI5dKz@|z!RSKl2$8nyt`!m^B z9Q==}Ma)>f_+#j%KebR0B^#Z!TpFN%Up*k)JB5|a44gl-dgKL9Ioq%&n~|Y!X?eY{ z5*rFYWwoSMmwA4@0*g?^YrK*d_uIWOgsQucfE$kV!`o(dTL&$Ym+I#|bOwzOjTj(8 zt)Iv@BoXfJ8zgK0$7psEhOEN;BmIrB5&CnsZZXBO?U2A&LRJj{D!eDOp(@y%S zJ42gxYoxL)p^bw*2gx=ab4(%--%wrsd4P%~JxJMB4*%E2JeM^48qq$RReyHQkbNp# zDXgUxrRls~4ZjUw7;9RFpl0wD*ZD&Iz;z>+J_&n#V z&rH$P3|l<+?fdJQZx1k#QMT{cp`w|HlRcne&a~y(Txe28sHj4$(nnB zwk0;(NU>FlXSJFQANM!<&HQ36&tb>^;npH)PzpzYmy#@K4gbWIlCu;Q8dS6+a3%$t zEs|3lyq|1N9t4Ta;tJu}Go`|I>9DUhWLd_F3*V(ZvZC~rY z8wvk98PrS}Ti8F}F@|%hnzT$#b7!gx*dUKTaL0dlFk2)!7I;4BUNW{K?lV^Jo!4l9 zcp>$5HjwEy|ECSpf=2WAGKh}`^ldrJ%jub8URw%oJOA8o@w5oI1`0ghkc3HN#6@n( z`};=hn?o!sEmo9wFU?v$coW^x698E6)R=^lN*6l5`mXHGu5|Dbz4))bcM`LLHo~rZ zrG5EN%dug9y#gSv4Q)|$P#!0eTQxiGmCu?V(PqE&W?eti=mgiPM*8%k*Jr{m$C3Ev zpBzY_l~NO6RC4EW`Iz(MY&1huZg$O2oQP^t3Cw7fn_fjj#Dy(7QNyCV)tA}lfI}=)*?rc*e&y$OeP`p?{h>!o z{f{@oe{jY$4AV*RXLH6sl3?L5b|IwVDmi2srk9F61!{uBSK|wAI(<%tTc1ckafe@? zI$GZ)aIhLLuhyE_1AS{|GdG|NZg6zcsciDd0I@XO`=_s2bBAJ7Q#HQosQ&@I3d~3H zm!LkUxj66CJKHdNIWpw7GFY1)$XaEAm ziw{Lp(d_d6Uxp*Nz0tq#4n3qG(1P&|Hgd?)Ugr)qYXmG*ko8z1(Oc-b@=rzED zG29$y-;7XHOVv6-Q)r;JC0Q^*Jj`L0Bo!yer1>~=AE$DJPxqbHg#dG2e#Efc@fFuH zu?9)AGw{430PV6;L=u4PHa4Aseiq4Ke3$c;*CAP~Lgnr|1!4urB9T1Z7y$*$-%g@V{dy4hVA&8bK+BX zHvt#;wS_TmXObHzSD~WA$9qPYCyU<`@glFi>IqPI-P7lEmBd;lP|GQE=A~bu5`s?< Z{C%NmUXBl^fxak6MNwU$Le4bwe*gm1fiD06 diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/test-in-cli.png b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/test-in-cli.png deleted file mode 100644 index abb6159dd92bbf69a1c2f67860cd83084bbd78a6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 46023 zcmb@t2UwF$wk#DS>*jY~s?K>ln2PFxlee#tad7T#rdvkNvuhuFlJm7i4JF3v)`J?l9GfFK zPscg@UHcimZ)AhSf9HY-((eS^trhKah(yvV6QIOvf8a(Z;n}rQ@tNn>09TZd*we}R zfHo_-NDAGOaeOSz7omCq_iu4oX5TBvtVJ@|#H#fBB!^kwRlj|H-=Wx|^XR}lUaC&I z&K&9L!b@Ts9N9ip>E`3rb8!hNe&{0uHt8096MTmM*wQ<9<864QOh5feS5&($n1 z`iQg=Y`8nU`S6FUI%~UvAxN&W=h?D_`?gO=!s|gdq3pq!v%Ug7S(PTyfxY!DuTT5r zPM4Rl60^M#k3&i*;w(z_xX-fvZ}62Apvj&KK2gNec{(5`?#rF|w8si@s3ykE7LT`< zad9$)T)BsHLOv=B*n(E(Ch>9Kcl7{CX=7}XFBP^}?hiv`&WC;(!yyG>v-JvI^E$~@YPOpEE z*A311ukyPd*r?boqH~8Mg&FR(``h6HK06SLh454e5ohPvEi`MNdz6OE$ySu%=6GgU z-AX3fx@byq^poKqSd|FWuCTd%@9rP<-#j{(G|q@L?s>1aT$yymzMjshDmm-A-Ddr) z43w)1cbaqE*JEQ~$iJ@p+cRix+iT(_iDBv_=!f&}#K^Q8Up)ivQoSsuNisi5M$ic3 zjCwFXyPwE2jIVv}JhnvLg3pJ0`u?tj#kCDT$o2VDFQWC%~xw29u^>Pu#oDLLpoDt$3|Y-DY$Xv@4Y=1tEys=h`21#e2WeK*`~nB zIRW*|U7+UI60<}U%;BK%8fQ$$>a*Zn7bt;#!9i*l8!{_@VbWCyz08KA3h$v_7$3=> z&!dhX-O86$Ns9kK$Mi&e*zDd{PX_VFT7$3j$HjxHzN*}q-nn{(uz0U*t48$dmK}r3 z=PcLq5cW|f_ECjMmPjE_XZe}t4}gNE@Z#?AE9f54uj}dd;tkGFt*%X%3k85ul0h+Y zU~_G}t|cLHG~aRtsGWBh&070zNjNe&q6IIeR9Z`3`$LkAO~}Vc*c`tX=dM&t`N|w^ z%A6ha<$e6e0?gakw>hD6H=;Y;Et|`vvgu(ig56u!vhcpKb|%Hj%d?MN%$!Cyud(L6 zED&?{znl=keV3K$aYDzPHVB`+pv6ZJzt75=C3``-e&9WpDdtztqjh&xzO>O7m07x3 z?-h+XcQ0nMM*Zl0=gXog6vew&F1P;7F}r1S+JO-mwQ*yPd|J+$f3=*h0>H+ zi@=20)E&HrE{{9=J{`8nI2KSc?E?s1FP$@L}H%kk9qeQ#${G?a4YX@KR?t?jxRdf(k_cd ziBA0H=s1h3RmR>WPtKMP_~45TGLixZ=y~crrdD1?S(9Gp;xJ{AJH@7qt}zE;#elc2 zpjDq6IrOaB#-%|HCz|pmeOGXwFR6KWWd&W$ue7G!rNM6giI$7_$@OrH}K|B_7eL{b{{V($_{=}SN zyCNZku$w)KQ+80yMB}w~Q}+=!?kOj|z=wxb6brk|Ur+9gW%b3{E~4gQc(~*5e6V^N zCr<^(0A`#YZz;0Xh)(Csq4S?b$oPXyEvS{|D;z~PnWJ&P#E1*Mv^CSZhaYZnG-#}L ztP^9!f2>{(WN4>H-(uxKGc0-0_4WjrqbmS5#P5GP%HLJpq{)y7jpJ;)_bR@ipGj11 zrE53RaYb$y@o+gc=^5ifxKSRfdFLHzpT>hF&E;F(GZit^JIDtE*Mc_8FkvlpMOvyD zJ?FKiIf&n@Hw;lV{mYLAB`%aiOw8mAkJ^)1WIYfi!KcbB(kNBmEQm}Cy(+??p5OrJX48fKq!$>!TF_j@Fr z>>?Fysi@3*DJ}4+GEK?WW#-v0wnhYdqlkPwjje^Q{;u2v?dg}4i(*})poEpj?%ytD z&z*F$ha0dsMc-J_h)!N*`Yp!#Sozw-nC8~0GG?+A7xKzNBf94CLyP{bR}z6qwp}A7 zJ=!T7@itqZ)!FzW4NIMUn^hH*=hr!~;^^Pi-(&3=t7%+*Pup={tKq!O9bftVwP@TC zK4P!p1JlRt2Qk}fDV|fbYTg$+VzHm)giicTJ|gI^vp)h^gC*B%q=yVc14E+c zQowf?k1dM)Zs7y6^*-L|dd%~|p5cjKT&Qa9dUG4g!27|`bkd8vt;nBkik$0QY35>H zM^$>FI**tx`O1oT7hPdM7=DG;_e}!a92Sms}j0x`je@Sim&|FbUZUS$l*UR0_CL}8aV(bjhwZH)IOgTkj+!qeo-zZQH?zMU zQ}syczO?SU^^IFx-)pVZoKH3Ht;|HK!eB?1SEbe0SJ!t-!Y58HMc&zPQlk^sTzYz? zWatIMs=8Q7>b2miG1)kiTQd5lyeWYSy~^c;NORkl3%BSOE}al_%t~F|wbC<0j}-h=Hrn&q&sWz~`@Op~nU;O==8C`#E863iEQ*~Zj&^9* z>215XSwKO@Np;8Nhc?W~TXln%i^H?70>U+d9e3<^z1}Ywl4@%&{W2&)3#CH{eJfBW{ui`-Az?~eJ(mB z!(@})AHJG`cZ)#<5^6aMNnS^djx`E9%knpS+=pfAKe=ugY5r+gG0W01i_Dg5e57@W zr}7iG+>Vdj;)O0P%l^#fRAJsn7Ec;9O_UF(UO$oiTv}UdA7_lRtCjoxDZJW_YUB3x zN#i@L(&@HuXd?H5s(B=xUqG{3SO-7lycTybx(^Y!MmvA3C(!opy3Ihz*uuXtji_+`CMyz2QM^J^QCo`;u2bZ@=)HNXEe#nO|m`ysbI z>ucL7Z8?Ly)Col|jN%7U=A*wt_#ZNf;1NeU7u94Ia`*G%Fqiv7Et4-RUf(4#e(8)& zD~fpd+3a$KmBcUiH89ont{|hfVC_#=M25rO|E|0eew46PTZ3!|`G4Q>qPg%(hq}qf zUhCb9-yGxgGzzy0VLzU;4>9P!XNb!0dX1bdj@iS^`Kv)-+kvJ&A9`wUpDdb0o%veF zL)En6rrArTzqqCLf4$hFJ@egolv6mIy62M^(qRp7mFZj6>LKqn_FVa0WAEhd9X=UZ zMVf;cbM#8sueOOE#4rCDej|T;w#v_IdOb+!hXAiCZ741vJ~i`(;n_s&6Yh(0Y;KxW zi~OMxrk?VNR&Ue4KVM&S6lpR|Ux@45mCiJ0Og>z85ivWmN?khERrzU`=*OuMJ?7pS;(ou7h8)dTVXK<(Ipf z#a2~jWAIS$;dr*k`gj=Jk#~R^{OdL$N&htSwsAsinUQ)~d~LJ+>(G?CO=?E2I1-GP zFsNSEQ8-mvXsBYw@yhHw3 zd_17q7L1-Lp|%Q;S^P#7$nqS}F?GkOX2h9u`K|0q8E^@1Y*_Q7rOq)f?z!A}lHAX) z`!e*pQ*7@i3r?QMe$kAB)jOX`UrjA?WpR5^>wr(HGo3#Gy4D!xk?K9G`GP5G2Buf@ zGjB$|KsIu=7sbkE?1-zN-EaZ*Nb_P$9v6w-EO^wa93Ek)6vXMHj20NAeTPmzS`{~(y zKl}3bo1Z(vkvOjk=(_)q!_pa3Fbm7H|#qi`;Vm^OR~7PcK-x|;igxW}(03d8-M1zvW9a}hC7FcUKXgyGXx}=q-*{!Xfe0-mWfsFD?3~&^)!8xb z^<~h<E|>N0mG9Kksgev%lG!!#w0hS ze?h39mjj;5R8s@5mv-n(%vd5E-(E0)zC*1A5z{d4J1N}A(YYLrT^hwxes?|erc+9R zGJZ;$ji%F&)l5sqiLDaPInrUwH98J>%B%XINDIChb_bbO{K*S}e~q&I%gLll3^eYx zA@l+^o|w7+EbNbU4)k+R5j)fS39ve=s8LN#=RK9ghC&|esOj9)Su{`KJ9SnG*`vtu zH^MjsB))(7o)gQsseAhCa$~;dVHdMX#R<|C)|3QQXcbq|Efl0D?6RE0eVZl?d1=Dc zmutrDowu7ic~LZm1a2pu&?jL?$v)PZo+6OgK3%HsZkh`Daxg<3@K^f)96*Kb_U=>u zZryN&ps{@kFb*D^v^srLZnv%qD%s8p-!KaFnF`8(HE{YfpUu{zGeSkCg$UqT1L2dWGX-I8moeC){5VOu)WY`YUz zQ8P1F`FAe82f{6q5?97wS=lI)R^~8W@pmuEK6S77_bkYqgeQ%0Wi?H6rHyz7?|^iu zvCqj-6W()e-|)O~4B*ce9}u##H8nd~21l0tU6ar`Wk|N_nHofGx8y>NtAcu#upisX zh;4Cg#!NR&JmHQ)Io%X^_StUomv&zt-CZD%{Q1Fi%*z5DhCF;`v^JiK1rx-;&sN7P0K zKxz~=)Z`z9mYX^Dr8%k)QY~ycSgO4MId<{%K3q@>CqsPPU^g2;aFQ-E$PCUw0!MGFDQ>_wG)LNdpQ+08w*QFIoF~ z{X;I6yHBjO>SlQGafJZ|^>NZh9@$2w-suj_&V#jAjO`>Y;W2~N+G!RED1dg|ZN5sQ zLyMlNyT+8N#yMR)BNkj{-F@Z}RXNnYyd%CcTcK*?58uw{nn9+@Q$9W;yhc?+a&PcA zZn4=vF7(O_)53eo(V7fKdVCI^{>xf^&1xYAcE9pf6ua$CB=O;7iHl7}xrT)ZxMNNF zdn-WEL$ie=uU2DgZ6ZrsNO9yq^q!MitJb^N!)UYKJThtZ`g2d@Mf=%&(nO>+TcYp` zo5toc{dP!6;g|@=WJEXevCB$Y))T9afEToqc!!3Ru&N??IEIptLExqE$Y z^h7o$ZgFxZpkp?Zmd~WhNIVNaF6rDEJr>;vq16f0Mn}o7OP+;_*ARs5hwiAzL&!srzW8yZk`gu$w&Ppg8O?_ETHzmZ`^KrQTfrU93ECB6TvS?cV}nWmVtB{C|h;b1CDUc33(Cy zKS8YWCT{YC^J6KL@L<@_FQryO5=?78`rT6 z3Q$D!53)NkmvO->5q#og%R9@!nX(v`eXI?C2tz>!Stkp==tUo$94oYeS)qNQ_*qjN zSb?PNq5}pn;kF78Ns6SwFC{=oEF@n0IB4QVGTfkUzv;rqkf88yuOGq}LEWQjOR9-Y zr8ikz(PgSr6=^=Xb7kO;m+i-^T+dV+}n7_ zSoN=EVY7Qehjp|?T4IcP?UiF_t@iSa`M8%nk88BA)Py`tfmXL>*(Gh4%G)%(3~G$@ zRWoM2n<#zx%ge$viwmz5^QFPF=&#zhUb6XL;&#@2XdP3Nr^#6ZA57^$U{1B(<##f( z=`!7Lo3*hpo>}E@cq=Lrp{?^sj(lCOWzFO|Og`7kCStKpV(=cXo%}SFaZGR#gGXiB z9&NbF&=a~#;sv&&tu6^0IwCxbsuD4Y-p@l$*XoHYNjG^v>8cxiTKQ$!@*oGDb}K)OjsVwDEQZ&icW(1N!z3MrS@p3rr-fOxGgDh?!NWMW zLQpBwUv>hX(tj5HoF$;y{9Q>d-e-XI@YzGo8@H4Ctg6&ysMWj7-#`dYPRo5bGwc$q zU(&B?5Ij`;|MO26N3=B4%ut{2Ch=>IR4<6 z;G@^8xw(-bq|Zc-LZ+`PurN$ZFPkJUELPBaTZLt2q6d8;qIX|&gfY_!>P+n5pNIL zl9+3F!{%`jW|0Pni|8eEvUpy0D7bvb$fcjYV(DWNS%!e2s;_N!TFy*oNQ1T^hWmZNeddV9y@q+uhS z))Eak|bVlBnmPXTB`O}OMQK6X>__x zGaz2NRPv>sL9{)>_HbW66>+v^O6Q{HG-OT}n_*X#{<=R1WKi~?M_`o8=lL3RaNxvD zNaEhU-dqt%sx0e_v9tR~I_Q1udV{#JoW%S(I{A@5^yQJXMT5tLo}x zoPWC_riHBAk-GImOiNKSGCRV*Jp9ae|3ttDIz5^D%rOfbTS6}(A zlznOJifx{6j=%utZzx(UgL|$aSIzKd_G=H`TnAh38BvF{sSoP|r6DbH7G^5Kg#sM) zuR_>IU_x#Z&sy#d?&;LcuT5r^w-?2$WdwcLk3BPFI~J^sA6trhvvVjA=KbSHeF-b^ zXq-w~-1!Ogr5OIKK|4byL8Zt1OCKhm@nLqLBrPIsdYT-3>vs}^;sgVsaA&yKK}&W~ z*Eh)pgjz()bNx}f^XOsi`E^3u>6rJ0AeP!*6ZfFfO|E#JC*iE|JiWCOZW9mMIL~#t z9=dxI9qK!wot{LhA?Ilig^tzMc2Mh9r%0m0;`(|%h2DY@wmfh35n^UALPmd-n`y`_$!*7z3 z4Vx2=IdKXWy)oSL!JQ0N24M0ei4gp@s~WDrS@r!hYTy6#*V&IGSfj3IO%hG(f)42( zbqn(GYsM-cSrTBO0jb#geK?M!p#H857+K=sb#iFKfIK~%hyW|>GB6xGY>A={_$2Y; zLEtxJX`#X9mU_(BVBZ(JT$oK??f}*yS4!uKd!&?1A8I>N|LbXSL+=Qa=pE0id(d>$j+{Pul7s3z_uuO=z^Wp zUuk-%*W45h_z4XUj{&0$`rYTaQ_h#wbxC>lY>>tiR;<@PSEMHg`Y&1SM48%$v3Czo z)C=9C747Gy{j=+(^&I^C3m9k*cJnuwZNu#G&#OFwuY)}#!zX^shRb??tuLB6Rc)8P z5Y6KLfpr-U4~rayqf@B9iFG7m(42@H*P3^49#BksoghgZpcvkzlt%M}Dv{|a- z9yp17v`7S6{~%7MJS>8p8(=%m4YlV+RZHzbh7ZqfEEItM@I+qj;QkVGy@Iv$X6u70 zx>zPVv_lQWbFeGQFS~ze#L+&Rd5B*kUnk)mtGp{u^O3>olbNyi{0R|_-}uU&%Tx+S z$*WzR9~V=r?acpV9;I%&;1T}gFK(YNUVq(vwz*6veD<4WdO58emPKc7m%URx&XS#c zxk(^G#cu#+c$?%QCmGm?8taIy;_H85#qgc zw7M>)re^&9FZd99Kn+lq(D45;nYV0i52F6Bdj8L0XM>mcUKH1P_fv77`*m#n2f0gv z|9OS~S?M{sbLtw8Oz&JCC9ki%Vfw%yfati!B%u!KMK0qLsj*gB`P!JOg2J`XtJ%S&D&mjFwPYB?=Jiso6NR*qKoBQ6>gsY=i zFw)Y}9v&RzQ&JyePv%L$urM}ydU|D)Fexb^q31jV5hx*Ao6vy?B$7)^OzbYn3Ch92 zp=WH&R8dh;1%+~DW@ai=l9H0}!g|$|hGR+*-1u2&}~VQQl=;`FE1i5Z<&i~y6kI>TCldTh+kh{k7GGl2s#YE55bXiDO2Fe%1UQ1 zFJTbPn%O2AEwD7`XXET#dd83irT8Tb!Qrs+@wYyCSy|608p%WtEFB(lv?f5gNHPw= zP$(n&Bjo;m^<(Ho+~S^_t1HI(193hZ45e{(bF%{g7Ky?y6~@}g8p+mqINY`SP7w-h zzT`|E=s19^Geg+RqpbJA9U~M_VY0_1#l^Xl#{)dg2q4{2LAIi(=v$HF^L2!Vd612P z3fts@O2yC$$~K&kO^N8GtetReL0ejKgpZgMDF2lY$$!qQkr2#v!#S~8#|K8m=guS{ z|6+QeRL_52<9}9q&h%enJ$9bmxMZous{VlYQ9@zzom7>#pA;p|?Bv|lW~=PazS3Uv zPhP1SRC-v4G4V#zx@Zf`y!qpCSGH3_%2to04Si=L9}$H#sYJRa{C zF&I$7X*ext*bWQ{k)E;J!9Xf76as-D{3f70RIz~KLVzz*vK15*BIc<4s67fQ`QrmS z0zOWqoZTI1GyNJcBvn(3uL;m*8CNVc)>Rk~dE-|YXY67`K@n3()&Uv^%3PFKc;hEw z-`pWwLFXsym9I`3>Bg3bDp2;YvMJ}0o%_JCfO#?4AlH;lt;L}IygP>a92{kLclRLi z6Ck)43)AEVyv(`ZI=+&7s!9YIaSTefW~NwS0Saj@FqK|#v`K$>sP zexXfvpTG99uP*_V%-K2!WSoaMEJ!g)sS zR@t2HpmQ*7;gZY=cX0||Ns6#!jA6#(LD{nXTS?z5h)KeS9;bC6ZJ_Yxs(NDGEY|T@ zZ#s$?8rF9xH(@`tC9!3n?TM4!gvJ(ca(eDDb_Rs@_2-`l6JbD87BSYS5VE9)_Ix1?48(vq!Y*KulVM-AF(piZJPWZ z#xM*^vawYGXGwSHW2|~++g_0KQ(S$fC+ALmmgQqDH;i* zGwrM>4G*vnZiKM}4Al+P8WztUv(7e9ZokYOBc)JO9TZdnWW^o|3-FYj9JrF(#*%m@ zM(H=X9pT!B&&>?Ga29G%f_d4XV+B7N_%)_*8(X93mlu*W5MEh-07RO1ovY3d} z0Kt<(UO*J|)1X|v;h9K_6Lb9%C%&s(l`ocP55?nv@;|bUS?D!Q(Lin(d<$ zh=PxW`XbDyc>$`(k!IVZF%#tlO$Z7>nk966_3q5rPPdtiYAPg1qK?KSnc-NJO32Bx zxfjUKnrycfk3s28*g6eom$n!3?HK64Z^(b_N=q%-oBzLu6xlVdn9M|1$zsbV=T4pa z{~?47WB+I3=0C?i7edp2T%z9HiPod_xk>ADgURQ{-CTIu#;^8_XexwtYFWs z0o!Bz_p9yF0W~&(6~hGiI^dKfl$@|0QN6fw@gm_A2H-!u&s6$9cw2mqgZ;Qrr-a{}@bQrLN~edPFb+vh$* zcdXP6+LhPreO6oB3Wydb^%rnB*#zS1>eS+L^RcW*#GmY} zqu^j*_=*hnCu+s7sGQ2-4BJ7`+rq_>#lk6M()vV+&OgAS;kcu9BwVN+Ksc4%|0U^g z5kpW_nIzPL(m^^W&yJ*SUW>qv;>9pG#rr_<0 zDhu5~bFI4}1Da~R!Z^P&hFtndhJ-krBoe@iKr%LLQ*fMgcDRad3yy9s6{deJ)5f_a z_L>ZOa`dUSiOHeNN{tC|60)7|!Y!<$%7F1y_F_iu4Qld=e56o6G z$3NLbMhcs`2pm50>X2{zi(g9cSRBwZ59+jA?=CWd+xxr^vo$1d&)x-3`(!0`{urs; zY+Ui!e^Az2U*^O&^7Dwx&?2;fXpXB@eYrj@f7_~r-#6fp7*@BVX|z5?B-5b`ixhb& zMhX?C8tGO0EAubD6b{mHHi6gH+6MXVF z3+R8>bRIuA9w2w`8r(~-nJ_J)sZ;cIJaQsa1~|XoCK%^t`b`hC8L`iL;wDe{z(%uN zdnP#U^*i#EA(g%b67VMtyet)%$#4FRwQN}h6VVfLNv+I6Gc)2J10K;Ck12?EX2d)P zE!II3SwN=-v?Zs|yW3vNtY3m4;rfnDm4tJ>X}VD~M2%8*?hyJn2?`4V*?Rk1gPK&clf(B|=H z7974>E%`$%y^NuWfe-3Tq6I;9440~^vqmg+H7cGazal&UZ zyOhlVxR^akw!ciq>6LWf+q{H6%zn74aYTCN9wLaPOtfrA_Q)|*?jw`UkWo@1e4GsGS*baahve1#Wtcs6!Vw}S54z7rNjJwxSnm>=<|ty8h9v93 zJ@h_1<|oB%$&v!u09sNI)&JJ^k}D-LQBWcJ57<9^>x@6sFsM;(+`tVp zB9zUEvB>u=OmFvGXVY0G>`y5eqLZ?2N7%)18z>eW@>lMFLQeO?TJ><90!ac^c|Ix} z!X`b0K&fV-=^swF{~*KwyM2u-7j$%SKy=cz2+zl>&W5y0s^SbKsI#ZmgpYon;l=<1 zrzgQy=bA~HfXXiEV?7La_gB|gMI*ye8K#bZHI81cV}QcV4-j5843c^^^48fJKCr(w z7TzKz_JGkN!`DL6P&(dY8~HS>XDrVMl7ECqv*!TOgLwx3{W@hv^t?waVif&1S8SM|vq7 zgaU48paW6y&t_oLh_vdLR0P z8X4LGC|p^7^m^#y>5oVs9Iuky;gl(LopR6EZlO2V7zxhh zx)V2fiWc~+X1-NJtsrQ~q0gMW$1VAgaE;@mv%sD*2V(5J1u4t7FD_4bHn5mXB=K`9Ri#~)=iATj zFAL9tsvf-I&}mc}Sf??z#AVzKP81QU$=p{@|2qJ2L zd?va+$sy}v@B|#hha3sQ$24T8$y}bi+*|^KIUy?Q)AY$Y-&Se;hR{o{NsHUf`;W~M z%pxs%4zneE!HsivS3N!;xt-skMANeD z*8a%!hka_VmsUxrUwg9hs&Bv5DCSaa1)?EU_oij#u=g+_9~$m^-Aj6;y(hwks{JG{ zgDleBGg`e%4GI7k$koE`%RMP0Lbt^<%0g}{{b*zsX2OYQ6tMfkcwOY{$b7=#BZ*eY zmVy(&{H3^zJ#O0OTFtOuK%M;MTMk<5j09Q^-CwSV`(vf-%%J z?FG&D(*i4r;K3aQ#R-i-_`1x?dh#(qS*D?H#JbFroj+`h96;%kM?;RG+Y7$=H91(H z;k5Rl8cPKQ%AoxifSJGTj0j(64cBb_c(Ss5^6Zq-B0?np{ffHx(Vf%~=MdR|sl+8Z z$$YFtG#}Q-<$>NABd`KugF355yR%c3fy!kR|v*97qqI~ z-H2Y^)his`f^r~+pyE~`Qj(a@5Fnj#6$Io7{26c%^vI|xwcL|6Z7lH5(bH<*>gG;L zW99S2ebFCnpY&yo8$SaP zV40&}wu9zNavA9G7xj$ub~WAbw#vIPB{(Dea>z>WUD_7Ab0PL(J|j_|GiX@q6)k)E zkxymU9>tPSz$BlvB}$8NPkJ@sAYlY>IK?)70#%e9y(K+unAz$Y{If)7L`FIcoSGT1 zf7|&>e38JlZv(XdUg020yOc`e_dGN`g>L}QUY%q%CtUy=`21C=PXr<;G%aKXzlJ3KLKH8h>s&;Wi{EJl0B|u zCU1iAF?1xzaozuPzfl<)1jixGVQmQ6DD1~7$~$+(e@e}N9&&%{69?EoH^ate37C|Q zh})F%)3zGeIMU_jJ1@=CkiQfHynb{cT`YWJ(Hh6$0Lqnps&PhwB&c6MFhF`(6}x-* z0}X-Nb+&V#&Tc6*2*6#v4l0gAgDaq?vz#+%zmeWC%@g{KMS z6sZ|V#`+f6)eEH9GRIc!23#6^jXy&otG=BAJzAqlq#)W!1xyzMn!7R|@MC`P9^#}y zS*9GVGyhFTR*q6m@yjEIWajLBn*`)g&*ikc#R4Mm@q1NM;dNT6(fd47EJ_AU^UHCUp7+O=95mBNeBL#%endzV4rtNl-(g$c1Kd}x#@9mYvI?q5-=q~Pubd4 z+l7!Vv0u|rv7{4=hr7muLra$H$K?ZLqK<64D9?*_^y-TUe^s^-qD*rc@h2*5eKFwu z0C`)I+C${?-OX%0OQf!G9+we{O_ZQtnYbQm2`>r-kNa`uky85S5n`h~mVu~yDSJN` z7K4MvL6}9ExlDz*kht?z|8~gu>5=PqMSnxw`KPM?4;>v6@qe%2Qc?YziaRfLO-29z zbq}lNnVb`JyhpFrZwld<4;BMWZO0T|x%HhY8ISX0j<)$%3|4OkQpofBup}-DM+=W( zVp!&%S=_;&E-&cc`r=RQT)Pv=So-I+F2eg(_{!-)2Dz!FK5@#62Uw|Ud_7Ddf;clh z^@hAhaR=ftTL`2VvYkXcS|0@Bzn?PIL5_I&gh$qyQ7PIai^@58)tnbDEiljA#msuD z$_D;sB#$gCg9DO@IE2KB4n?r(%e7=_QCmfn0lDu^HiGQVgmD{rtk`gS?!r3TDSFLX z^ymz-xdsL)NT-WrFt+ zbM*qGA(MV&DAgt*9TdZgU{Mx+{A?kK2PW3zsToSCM=0-GPq$DYKmTYGf7T%)`V zSRwn>a#;?W74G}T{- z63Vfc@V@EMBA(M?+pSsRq%!!g!OdM)TKM_5AbAHFr|m5n*yB7ReC9AIJURq~4QTHc zYD*_lqRGeiEXbG|8+cc7qSg~q(AInx)0*2BcOE<$|44Df5=Wzj@+yqCNFw#M3(O1e zBIk-Sj~cjE^yXg-AR{EW{1kZsu_FRa_u1Ur(WqPu{fv{zeQtE%C6pejmND(rsexne z8uk?^``*zWdN$i?02zQOU436kp$TwqTWjuOX*5 zr#l!^%haWs9pH=lEgB(o8E^IlfDuf^)seto(Y9t+PaL1ou_N=X=V;2_kMxGch+=r2eL75$+-wz7da4ZuAylD z5>TWlND4aLU9X$;7@JBV0pwKs?AA5@N{5O7KDCwvtRDt%XofBob8;GzyPjS9JL=k* zqjQLI3Q#8t`O`=iJ1AE@;IKxk{WE>rU0@fn>)fn1u}xf_rrTtI{e@cijS+lhwR7xd z?W8z#ln+r+%q^%XyH819LTaMnQJEHQ2jd0 zpR^Fcga}JHLg78FN&xTc_surW7@I?0gLX2H;pm3r=bN9lC@7PDU=hVQ@BmX(qQk+) zyZew(W%q1^eK62;Ic=tg{u%{kcC;TJvD{?+SQvguU<3p7wul_;ZweXtbq*08?cb6W z4vuD;{xjltLbTqx+#sz;;V9D`T7W!XY_ZriZ(9usUz)wZ+=V*nPLRr*gfE_fov79b z=WZocnqg~-|CpC&*HFyX%Wh)rzfsW&wW+IT7r<=u3%yKdp=+#V{bv`fqwHs+5Y>VOzkODm+rq4&29s{rRd&`wNhG5N8Su{t0+NommK0(42|G6PcO;#;Q{1R0 zpbddK`ubPdK7ESn0CFd>>hf1acc_2z%|@$0Cm@NPxz{u4ondd-Ga?mK;S-*l5Cd%4@aiVGzF*-bc(zP zD6bseIm)e!0NJ4bxnjS*ng`TEbNCM=&-4R*%DeW_8`Bl1AtN7AS2@}gmp-HblK{;1 z-_~n57-JbfCxxgVstZO+)=9p3@D3Rg_U9ah}cc?!oQBIu;t*v_-u@iJS5qgj_xg-GGfHWk=aTEsJZazXdZ`;kVsmj#~568AoAHZzCLWRTP;BE^zVS z#B6~TwR^q`V~;25Ijc0J<_8nV7zU4Mu#mkouNX-7Ow8PEIYp&PI1Kp~A;(D2V?$g0 zh(KHkxxlIkYj{mZQs?PbxGXW^?Zsj-^5I;aRgix?$x7B z&X@%coJ#|JvNQz|VV`JIhRQ-6?M=rl^dmj)sC||=MSJ`A;8rzwEygXZ08Wbmsh!vD5AV*>sFj)g___NR3#JS*UsnbI6UE;7}8^YGO#zaIv zY}gCq^4@4#!HG%-MM`{OpAsGwVh4u`2JXrb_(?EI!Ev=#*phK3Cn<^W#7y-NyMPq89AGMsNlm zE^9aB#JtW!N%9GqqRQC#17#*c9Aq(PQiFivh%L%u_{WB7{;rgzkJ@BuV8Qa@Z$Nt3 zt6mVd|7FNl79w~rdG&uW_tjBteczr~aVBz?zFFt)vjRp ze3A*{nS-=?evouNBvgcVo=e2cwW_co3u~`bDlWxHcI1s}g;wk;th3WEZB){Zuza(5 zsyP?h4gBKM*Xdf^&R6BGRjc&Cu0I1e_YGQU{Xjl3ZG}~r<32C&ES?Pc%5;{jUAJC; zUlad(>U9=Y{yS(;G_``R)p- zvncEpwEu(UIRDY?MH#RGoK45<^S3{gxSmG$F@INjN%J-m5ytAb@ z*$;Tn&6=w@0Z_cBc`F~eicI1#tA&G`+zqpr*Cx}9WgYl9U~*(v$ulG*oU``J?57Go zYRn=xDV7>?V z$@DWk&g#_KaHYfm!iW5-Zmax8I-o14xhgO)#DIglP|zYYT8L}@p{c*CJH(MVhYrhA zJ@4+URMf@r?k`+|hlYd)&<1O4QtK0Ynv5oD%0Xm65v~Yqy^uog0hcv;1n`*0bvYOz{`ID=olF}qk z)eWd0DE?7!=oPo@PqpE11l0Co)OhxpYF%xP!J-Q!FbKx$63^gI{r+!DBNktYPoI$m zXO`1787XX{>?7nykMs9hWR<5sNe&``Npjwjl^?xTGdzTEbPKNLK|Ww zl#+PaWry&;F*tfMh0vZ*C8CCM+ys?8ccIJ)Ow~}`!=Zaw3*Bti!L$$ULVdc2?|3lYm(XK=vEHgO@JZ>gbYaaG>|I7f)jekV|kp1|x|N9zFSupKUTT zO#R<;N$fNw2W%)@5o_8RO*y|Z&@h{ZqeltBsdb;~b&gAHQk4NnOZA*>(Sj6ms9?N8 z!kfXB3_>3iE>aZ@&cmO0edWlQ6b5k7?nryZZ}%1o2<5ly)b5PyQj|ee|g- z{KE*W+5IV~@M(08VOSk5@&0gbJf}Ez01lRWCA9+SHk~Frz4H6YQ|M3K)y%MgQv7B< zg3$*Ar!wfFbl*}pmcdB;LtkP1nFVf?_si@O`Dt+D8VPAm0lBW}7cf2Jap}=CskFlw z=+Vuo#u2qPe!v(kIuUl}E2}t}lcy<3G2moPx?>+Ee|TGAC5|sq3csT?`wNres^2Qe z$+R0dvybGJ%{6dgzu9`(Nr%=FIhgl-`F6|&Ety}yKJ_BE z_l=TM>|>m>TkeOBph>}si|!4i(gv;Pujq@zqsUYcf%QfSCE*DeY<5hY91(4xPxV|( zN@7q|`a_}U6$TumV(aB!S0f7ae6#>brEp3@d#ou0|G)@!%XansL2Zjir)HugFa(_o zPk3MuyMDbDetZaVC+d?**e>9|YdBk55i36%B24Kb?zix1vP{WPnCQA;SCKEnsJvkwfhO0rOF?R29Y9lU3l+LmA7rg$9i3`=zUcU|=2z8XQOnV=E zfN(%uU$UtYnMGLk6)5sIzlw`!V=3nV?6*z6e1h)IK)a5IX(A{|UVEZPJ1DEg^2VOo zRZ-*3l+{xNGsL>G8@Ffk)%>qFlZpKF!iQ5kV?!dds-o%7gD1Z||HegAvA<*T+DTj~ zr2Apu9i{BR?+Chi3y03YyNT1^5Tem+gV1;$ce7lZruP(7?{MGla`|G;@GVh!1k;H9 zuvZ!Q3z_J~&L2Oa9ZJU~*)5DwK-s9<<7+tB*ptGPgt=gYJiGKhocNud-Zb&9FJVDyL5Z=aj~$~nO}n= z>h6!hhVh)x_WaV-wkhMA3`^Fho3AAsUiEd2SnK_e=rsNjy3lB9B9vXaKICsp*EDwY zgnuDlDk$tN<8zG`(g#;0SQv+5GQN%gK1U4WQgiRHYgI^>l&${;GbJcJ39d_)E4jSI z`V#-?2M4;=K>|oxrGFiJrYbB38BK@LI9TFnF7cLJK`BwowWgM~w^^Z`es}v0s!QAQ zC2l9a_D0>YLQw|3O4@im6Cl>``bEbmxhG+t^^*lLI_Z&eEv0mB%*(~IZ#6aBw+)zgUWTfE0}@Ke?%z9~na`B~_D3JKdx*oYwS5j}Lnm7XNyF>>7_Z?xi^ zNUgT3!|G}$uNd6jleEaoA{KI5PIWtPt$vVoZ7$>J4KDl!=iy z*mQk5st>19XcNduKkQ<}+uxwXy{cbt?tLc^8;s4AQs)XFb=XP6Nw|@zx*?9rrPM=> z1h|ViYSEXmE8-w)^w)is6kWqOy?Dtu)O;UrA)B62de?9IS(8gZ`(4ZhdZc)gZ0{rB z6Lg^>=Z*W+ey!<_Q8X$%fnm*{=b=4J2+-gol6zbBtZHLndQ3*LH0KV|_FFG~l+fQ7 z>-t>GI+}*1rvm6~+x%A7F8FS+?Y%$W{K6N0av662`;xDu)_nb#WweyTwoGC96+zvsnuzWGLwt{1bs{5dNGuwe*qIQx(HLB2} zTuJGVJXwX=!=BLIe-f9)$p7KM=&Nw#4UWgI3oeLJ&4i9#5^(uzSQCD}na{hm5BbiP zsn&9BK9|x2X zUs}*zZvUCw+;7LM3kDG->dx;AI0T03-6A~I9^pV%`HPWG=vxNJh734l$ek-Lw zwz7W}h{cqcDuBu?*PcvEZ3~&lmKyl}6H|}&w9#hQiL~Ys1DX+1)1rKV&?W zpj!Dwd1TlV7-(}gN6@s>7pe@W1f>$fk%a0ojbcM5BL+}MA_+wTt77t7Xy!;+lpCxBt!t-8AX|x=h)%?9XK@x=`8Y0U*t_LKhW1))nN=6} zuL^YVYA&yugiZF*PUu}aThz~y({Z7~gUDCiy^3Re^Ye|40jK%Kc2!O%Gwpx1;k<-$ zzUVQ7Cn~xT{P3)yPocMAs^Z2^wh+b?fw~qo?eRhAX6P^WzhWvXJ@I7Tgb?w4yRugU zE5kpA0Jx$SA#S0Prz`Ohx&cCRvZOjf%dKb$3hPv*hNt`~j(!46Mxw~g)=Kco2LY#p zXA9(lAO5h0#I8735C z!4r%CTz((fw|xnI{vF6Cf^{WLkpZJp-hQs^W}UUm(;;U0fG0umQwYt(SC=JY4&4>E z0@oo$lOf)YI`6>|L5e5UKjrpc%v>MyJw1H-19$nUJy>%d9?SpbgDuSp*B~p-VRur_q@4SGbuV?6XNFCkuVF(gFQrj8g$KS#zON zDp?V9xMAKihB`Et`kRd5<8mvB!RPE{6K?cUc(eg<9cx?lNMMU2d=`=y;odM@-n#sfi}Z>=|(T zeZXZh?X`ED`R!bE%jtINHp>@P&boW)R(+-fJVfJURiNF*j9$`e1qJo@{68}<=>dY@ zlJgv~Jq|sij2I(d#Y@LSSHs1K1#Cr@Lz~j_TRl9Fsrb9ZAMhu>s~7Rf@VLcvVs)fH z!KWD@o78$O*o9JQqsL!XSnXJ_^yuG;wY=2FWjCv|+>>6HV)Mn%d4?SZRw1pZuB%wa zpgM|d_|-0?pD^7e;%`bbAhgPiu^X$4&bMw7MB@8|jg;tA;mt2->on*QQ1hT`jB!aI zBL?8ZEx-|97_;S3rq1~+%XWi92>Yt;^pxTGB$k5qWk}mF;SKgc(P7Qm*qWxFq`j?h zdKZ=IZgrQJuI9Z9%<${kc;bXQ53+%~|90u38UH#?jlXeRNm=WB*x{RU3Uj6_9m!=9 zeYCO83RazMa2ubO$36Xa9)Ybi4n|4EH2=BPQwAY~nt#d~f6zoI3 zegq&l$YU*!?dgnq^mi=6C|2$8IF+}q$ydG6yj(cWl;zP)A2F$hR z5;!GL97};uo6Adabx(3T+dpN7%Zo?&3#S-xQ_$AS&&!=q$zc45Ty|TBxWWZ+t$R)mP#CtSOx$x)% zK|4h)*}scWYOIDEEj45mg1ro$7NC1MP#;W+*T-5W&pM@oBd(n%l*{+yEbj@GUi@4O zW0!xZ4zEV>4Kra!yAN(7et!NU>j(AexgdwoQzf3;n=!p{zQ`uV-O*A;mG~>9eu} zkF_DcV!71%%=R(43JeR=_R~e)k?^ndf^@w--V!^ZSB9c`7>%n)i_J&y)J_2360Z<5 z_z%-O=qmR}^w82lj4g%mkxz-aTS7^#0fW_upigk}79`XlI>6`IbACu6i;d80?_yDg^Qy2jdq1UwDhZv0(p%h<6KV{pSTw{qb1t3MV4iTNiPQ6N3#2{SE>!p8raJeJEn_g;UsW)$%u&7YGv0Q8oW#y>UHQ zdb|+ajwaO&lW&@j!d~F+;R~DY@N<}TsG-=3Rn=M>lyN1nSwl2qcZTm|Jq}cdf6EZT zDjYAOnQ!J|bu)Nz7O{UDCCDi1?EX`A$tM->Mj7kP^s?u-B2P-uy%ii;OK)MN$j|8= z^9!s$O-M?svzg>B3mwp@ZB&REk-P%Yzk!WD+E9$*0Dpw*V%?hk)cG;`;=`DEmAe?a zbqgEM6fC5Rm~OkRPMQf}^r|^@#g_#v+4rHyebAIY6{y2#XElp zdSBpV@UfEsb8e0PQLqU^(561w8)*@L^08C#dgbxc^J|uBtyvm5xdDKOrS~B1b;O;D zY3x9-NXgC7fu)W6$1MPfs!#wIA%;nIMj|6aieZTTVg=UPU5BD%&jbx;t*)Hb~Js zmZ3%uf#S|l5F=DI@WfA>!KO>pY5%*HZVH`TfWduv3{|czj{1a$TxKdCiw^%j&g+av zG4Xa*6Y5CCXUoeWe^|4W{G(T=HoEr(LsY&;BP9feL(eV^&7b^yM3qzoS*kq1$XeC! zv(W1h?H!58%*AD^^f+FwJf`vmBAGv<3mt8c+wh(I+gRl$++4?^EXVBbf%Ujvx0vj9 z)J7b+#LA)!SlioZd|U=7aDI~|wAY30$?PfrTk1Gk4`$pw)9g}H!9YdfGOTim;>Q#cd?`5}*`R@yK zlc5QY^P^4IPyqvgbCV|G&w60#B3lk%R>uML$} z){W=~lV4BSGSp=xWrH5+V?$R%Tz1an5aXrXGB#k67!~`@TPJ{n||DY{n## zl@0%cJ+D)7bV0RzllMO85lE0^$fK0FGBzwvxao;G;Yy;PVz?Bm$hn(buS)`Imy)*Ro_JREz1!J@pS#eK;mm)MH)d49!aP!l{`PBq)q17Ykg3|Q{EtE=rjpOx(LZ_)I9PSx{4mdu z36N1l8UKUe+lJHdcFFiL3@hI!j-=5%``gmyVK((&G324 zx59>F3+0ws+TUr0B@J5@FiNanxA7i)r^8$>L|Y+N*T7787!+i83)5duC->I;PO48S zg6=86d#ZG4Ubo$Njixmnu3{LgV z!BMfN#7q)IKxK=2N!e2>t7x+48D0n0bJ9O9uT;=;XT1J&P|r-^t4hNR=+uNh z>3PC^Bd;6%B6L_#*XbE;MtA-#MyB{$K*MbLD_wO!d*EBv`_%>7(3 zwh=coiqzr?c6EKY$&d;}e)$ue6`U}2mG)jD!9M$hxTk?AYO!eBxIi21ona8Ok5fDE zP8?LJC{NY2N!hi{9)ZRgoyz>Ku(?jjX+A>6By-bHp@u;JzJ2letC=yHm>+#JfHkCm zX+2g&g;zG1-o$TFIG>jGX)`JF^(t?<-U;?am2{$YKw5FbFcQ+Q@y@Q=acJqQ*qP=K zJzZ2M*4fOOn_5S;f!Ek|w(rL4+uz>=X>nsL00njoxyW7Wq>3c#Y~lL)RDiO{^b3vb zX*MoKcYSu}k3|084|@|0-@H29Px|p_8}{SaC$#&n|7ye#&qA4p3U9PTPjR+&DFG1? z_jKBq)q^EKgXsuWfZBkQCXCDC*Fv zDxTum8}_sPVHH*;4T9y;#c*3o{uYAp2xh8B&h(3Z88_IqHBxQ}^XAIA#gqibz#;XN3r*>t=dUzG0o9r_?*? z2gS}Pp!h*^J+OKQp4?#}B%&8N&=qKj&bj=)C?GmBj zj`5X?NGp?bz6J_9SeDEFJ`@rFE$8FAUR7ZEzOJVm8tg(*s*p8T%eTw6Q55JERS{V@c8=WC{Dr{X7YTW&6ISh6KFggqEOn}mNXb_a z(m`TShF@#)YqGm>pXQIIM^?9E^jEb}Ig_yq)4WLU{b|@%Ad#v$E|EJLCHR@fJMY$r z!G%cituCmAPB&HTYbQgDw0S@}5(Mu28Y-rad-I!L+PZ@wv}ZMr9Wy}Q%HoLuE&0AP>o2OmEnl_>>b4A=0Y!=&mg=wHQv;TyiUB%-E)3P~lX-v~q2)~>(*c2*FRw| zo$~(NU&`3~+`S0^H=H{+<&vk_-?H6Dnu3r&>{;c zT7Aliz~DzNb85D^{Tj8%354XVbMx)|^(-$J{!Qs1vZZw^Fl9hBhCa0K5nnG^>rZsC zz?Kjv6DTP_I?yxHuExS6TWlvSkN79youg@=m23v3uNc{gs!2{C?tO#O89;_fo6y%j4a z+pCh9N1$$P9)xmLJ5J>~G))bj_^H<=VzpQdIaM1aV>WOm`z`xbLfY2mCJ5BXn1cC} zgC(lg20x#K9Q$}5a52f@@1>j9a_1f5I#|zxcf0S{h{I;O4H?0?6O$*~M>d{Zq!Vq8 zO&MNqcqp&e`In3DTP{x2YEHIv*)uJOLgW8#Ip3&~$)A6BA9-G2*2n^5;q|j1>K^Jk ze^u`(uOlamPF}1ZBy%vXFVxDl0D?Sv!wJ~+Uq$||Ux0W8O?Pd6Q!>Z4{b>I79wG4( zI`G<}t8EY0$sSslWC8^zB%ha0K|5Le4prQcZXkS~Q;a1ZpQUW+9B-q0fN7VK`R_V>rdE^2BXe(QIFY1@5#dMnAOEt|x&`Se1(RKK-Im+-RjWAbSki zv~a`i9se2pP2%B4Og=rhGmst;EfBC2PMvdNTTnA0UJbi+aFNkJ|MTjH?yNqgxJQ*H zAdLJs6iP>&bLEqMX3xhtQ0FPsLuXL_Yixc$f^bv*Cf!1yb0BN!YHIbhWmvK-3sb-v z(n@O3-OSN8zZrR`$Zuf`q2Egt@f5vkt52rcYKmG9nf!F%6B#KhZcV_fm+(b$UcQ7t za%77(q+8(o$v4*g_#bOv{|-5L;tYRlA2h?pXdw`W$keg1!?x9aultEO@jEl0jGzKN z&`kgv{L~M&xpE}4lX~D_m+RH^@qA)4Wz|DSg6@n*tvin~&hWA5=Biw)*kkaKIL*wT zaNtYn*tk^mNA3(AXVg|G@7UzY>NdT$y&*qHVg6? zPnd4fQ-PFFe~HI9Sx&6H{i+_3s4tSBH{ySA>vZu1X&oeayd4g&;=PhncA<1mbwuwU__4arw>VpjGosC2f61%YSU;l#n1=7{e{9>T+hJ&)r&s?9WD8skz)6t0NJV zZHxEu>R$<5wHg=;$-R`&75E=lgV!aU;UICCX`uZNtw~HTx%J7D+9c1OpWDyv^X=ZH zk^4VJyH5U!pM8cEqWqa_l3-)r!`R4EGcD z471jKBnL~+744uMV+Vsba|J!Br_wLBVm)R<8p6I}$^$!Kp~SuuoVAN%vc!EYhK;!u zu(sa0ig4)SkA~$^D2<$7OQ0 z|NsA|6hTOw)r{xqUK~H6XlS^E|Gq>ti1ME}e*f1W)Dls{Q8fxx(%V-)IL6(T1M=jS zp-#FlT;-U}rC&yUi+U=66&He?5Ek^UU@JVW>5H~w#25hRW#ns3Y}0b6{2G$g@$nN> z*l1Oof5Y&Jy}kV@0{-aa={XmGfGxuBuLfUQaMUz5LiQjKNeBv(>lC#a>huwM#+t6& z4G+a3SwZcDk~mXTR6IQbSD%ii@|>QZPrbB2UupH4bVpu6CKEkLz(Ma3m#}+x=*6}o z)Qui78`w70hhW1~28UTxXsHf-8ZP*7MI&lHC1 zp<{KJG`sbKWoX_XAAFn0+CBJN!gV^CBY9M1)VlZi^XHX`iFnX+#&f!nJmMu4HMLrw z!;py;D=#l_HB$FD(%T0C^AQ#kJEWwdTHV|G>4yR)8Ey-_JMT`Fq5Biuz+=+!a@(EC zBZIa%IvUUG{?bZVQt~7vHFdRIr+Q_%(OG>5m5&a>!=FEY`Wx&ghN=A3y&#w^2({_`gv_z41ZP9fhAZ$&y87$|ETva*pB0xdX~0-h*9i z4|b>%i>b!1+}$-9=<8qFe*ps510Jr2*Eyfvtak)lS-H%I2;S}tldrSkWWNaeMsm)D zdzx!zY(~_bC0m7?gNo%aLApnIXzD2Am+(*S9wf;pMqL6!nnQhH@JA>RYmX|2M&>yD zN;s?0ed?D?=^dIq?$+UIs~5Z__-)$YWtQwI+U;lWcr@2~?}%B?Y*r*z4w0nq_0agl z#DhQ6j^>8LlOw{dH!IqxH`3^Oi5`p@HMwHU6OXY;utfxrUzRjFuiv^i*VJqr<;A_c z^>|k@3<$o`zQ`h-m|;9WMjOfFw#jb(V7J1)#_;7WrRTen==a=j1q3V$3<-VBU`G)b z)ieX0PSi+v48P69AE!b*MCN53)%MAgrtPjJ86zggMI35mN#ufe%;lktQ9D!E9nW&* zA-+-S%xzN60<{)ct}J(VJ?ktD^yA{^W&8o*TyWnVvL+mFA5p%LH8Li$SuU0FLDcGEO6>#PLx&8O>$ai?@Z>&Ib%*Hv)m@y z=5|dEL6$0Mxic49LgsK@lco!R&Y$|~KToPUJqN5%EVCkrkdgm`@0RY(&QsApYQ&rr zjyX4OVu~-2@Zwf*-re9O^^62tIO~S`>gqu0SY*=8-}0NugF(IJUt)2{JAUG- zDr$3A!Py8JWHU_T!hisow!SM`um^e#Stw0;KjH4VY~iO?&oJMS%e32xXZq*^kU7-p zjK>V!MQ-sTh?;xvz(m_7!m+^Bgbrjn#+P`tvexli$D`;2JG+k3N29|t;Ne>C&6aWP zKdImMtHtLvfOtp_(a*1)dw(0u^-t#>l9WjFI~@yK@uv)`{HCdufx~U~6AN>Xa^ z=u%>oFK|X7f@V5z>C03OFk#wTTv${rc>4j7%MeO7QQ@+W42?U$dagv#RsS zi#Kz*Eqqza!Z?WHubCUUG?B#;TK<2`gssMYJ@P~j{@nvSv;Re{da!x->_uXcpP9$9kz{4zKUxGe?HMd#U~$LU`OP5^1>t34Vr%d-P}AU2mEs zKs8rg7??;Lc@VLR`tAZf{#7FXFe&RiOr2#IQ?KIT17>Ui8i1NGx4kO- zQKScs=PmiR2~W+@z<;l5VvQ|I{z}cKU#&9ULz3?gx$Cv~1nh*$0f~3kEyw zB*EWEcX;%DaI*G;`Pbh8zfA6UIwH+2OC{#%|H|EKrUHKfe(;$Eei&32rNg_n~^=ysqbiLE$69R?B#a&MBcd_-(8>LLW;Scq3q0qDS$aX*I19d4r z(op%c$)4Ex>8dylX6x6Jr%1dEP$h@7AQd;m00iNhHmAKwDVT=7lK%rL{%r=rkl z&(_*G5r2gafJ?0Zr9(s6`TEopV@z*ZPbVo(83i(2gc0#qp?<4V!_VVnsh)XM7Dk2R zvW$X-txCQ`@?3W+r*`toi(R7pd+S>pJD=5C)P6D~-yrY;3Ea8J9rU4`n*pLmnGepU z*P7cpjntuOqa;riFT1RN+L<$W#qS`9C4o9wCn?!)$?!uE`w| ze-SI>54+>@f4qGIySwOpkabgo4U*ge{BA2QK+e7V`k*s$$9vyoUe=3Gb;rq%GDJmK`RIkVDOV-gPH+-awthVr`A@ja~Wu@p|X_ zpP&a~PxL>*_nW`8ODc%_bQviV$fJ;VzbyuduY6!Mxz1m{{H{0lE}2K!q`NLBOM;^~ z_rjtWEz&vcsA4i`aNs*_pZ7an;Jfl_>h!%So5MI;ZMAXDWohFl=DlD52sy8<{CvEV z5>r2+%IyqzY?$-OmGChaM322^vS_?FUAd&}r1BkL?KQEin1-0e2fo@Fxs+#8ET*aH#jFe(x~L_36J z66uGEI)u5Wrw$}uctn0c#-IZcV86f%THbckeRM?=#&`)DH4|K44DZ}?6G@pq;7$7q}=%sxTozz`}&oNQXK|@Y80VP+BaZnbt zgY-H)pXWG1rE z$a9b=a@IQw$+eN25sYf5O^9B>6>?-90)!wZ(S3CHI9ppi?A-zcdLwXVhW~!i; z>UDx1YH7?N9N(KmtADyY&I1YZYHz#_fpj5;&H|gM!UBw=h{i~$X;#>#s!af+$bKL! zFMfGy%G4cgK1dIl-;ldX611@4hmpWZOfR8(gA57s6VpXn7=gjSMei)6Sq!w{8r55uj?ME{YLFL{B$nfazMl0#-K`rEvHjdLo zg$86pVfUNM@1q#!=urGJPFHCqBPs zQ3ZLZzBA$K0tj|!A>ewT`zwe6_r|}a-N68(fO}~Ri^6+kUo?3oaaQU-L~-s-J|l-Q zGcz)J#?twh?`*h8G1DGnkmgL{$VlKJ{Cqqk;YwYSI$HzAL!X75xo5b~L80y;d2WCx zd58!DqKe^P@*)q3Ga2Zf%M*a~-XmGlJ1QB(beB85F(+E^!>CmoYso`Z20Kco{7c9j zCLob$q0(=y-gerckY%wG|7E$&?EYU5=b#AugIc3%f2i_o@bS%!dz69eCl^guCcP*P zeCCj6&z>1#y?$0p8YV6MtpD4$j6uT>XSYrhiB#)$s&B~!hug1^-TBtmZy}b5ZBYy1 zd=w-qsfytv{83oN^zr713ibQ&5YlZLlHnY`z^!z0^QCP`A*bAwY@tm3mwbpF{9S2a z*LN$4zf=RKhZ?j-U3XP^2jm{e**y%G0H>DTy* zp|_uIn}t3VAh`Ojg7iY){#-ARkocmV-C&*DFn@Es8ejRPznyNT?z#QXg`bPVcUmJA zWVf^gcKVY)d?bHS@%z>9L@f6Qb4D3$me_(?tex7SJqK1fTF)`P2+Joqfl166}W4d z`B1HPU0qz!zzTl8`m%AMWh{|gY%N}|8< zCA2=}_uMk7hI&3g?t2-FGdw4-4vMZCSMu*6u4DU^4vi%zOF6Hs5I*|`WuC1(I;e2R zN`)yqW8cRb;ss^U{$8*8+SXRqwPPQ=y@3qK080>OM-^(76|D${54}>=$)i>#iA5N5 z6xF`sB`w8{RdNr_xxxqX+Sw0uibp#!Zf~95&#m%P>`YJUeo8NLSjs6u+@5Bk6TE%S zH}#53TgT?cbjmZ3oT4=n=Da(vZt zU}Q!>RcE1NW%;ySU4Hu4mBx7=7ZW7s$e6^s?Zk7|Px%+8h!bzEA0`{B zZC*GPf?ujAv%boJ2{V4leLR8jXr67SAuC&^#D4^yLHl5a+y~n{0eP@FTQNbHb^lxG!2o(^*892Gz%j(cs zfe4AMlRAsD>hP0jUC$~wn#8Y0$jtLQz$c+)I_s#Vn!n)JOO=yvekxxW9;Lp@QFb+a z;dfAH0(07K%Zc9gXDp$8MY z?YYo*>Wz{|_4AEWOi?Dnx>tX6jsvB1;di^t^RQhil1V9ddjh{VA^u3+tC44dTir}A9M=&W8MCi=SUK&5A3WzAH4}Y2^0i1el|P;bLRXFTob9*Qy1=( zxTqQM`GOE3+YzT>+oH5t*}@y?yrlh4^3er{UW5o{APxK-j4;Q9_hUcA5M5Kz?DGgs znKh%lev9@DtQKkaH+(VZr%s*K*|_%t-tHlin+cUvFg~l_97eWX z)vZhxBI}R*?Y-Bjb_7Y(JJ%mmC!jw}=l| zOw1RhWH>L$?fUPG{TEJjE&=B${Z&9=4q`Mk9Gicsr<>sa!qflDTTtpL^FOGkS4~Yb z;T}v+I1IlrhJ=I=^tK2=VY|hzMUGLji(UzI$2T z)?9dS_+x6`(Hv^9Adhn%45sqve?Vy}EE%2Gi}#S%*Uc{-3ugRp(oaRXx5}T_+fkIw z*~K5;hzX_%fs;SP4b*{lPVUlX)NQKf?ky@mzTR=0)k+;+^xLAXy_yuRL>87frM9TR z19R!id`2MUv(~wfUwvBDmw-n*CpAAkQh8?f`(w?xvdiuzJUv-t{CIdHvDyjClXz~2 z@k<-I5-a{&Wp5o7_4kF14vk1ENJxp4ba#h{)E5B(K@gOd?naRi3fB{BC zK*k|u&Kl|)`{JroE4kr^<#k%MuG{5C@ zYh=seX((Hw!3p7RAnMbMZ}l%JqRsv1$V#)2_V-Eig2vF{qH*uJ2Stu|begj(2A{Q8 zWxZuFEv31~EHihS*1Oki_*Ub!!V=vX`cTl{xjoyYx{~s@B=&29Mkh zZq0%XbNc_q!18=Iep6V5`tUqF+87UaHm!C4eXSq={2fJBkvx+aToya7o8gJ=HOf5L zP&}KOQRvkV2{TH>XJ=wrHk31kZ_Kw)d=9D^4wd$NE6sA}`lw_7w%}XW`I(zUF~3*e z)!EKW#&k!S`fr|Al^ypyua2ye=JJ>DJAb_4Y}00#GZ8g#c;7cX%p$Ph*mKj3Iv0jr z@i7STpQ&{I<2quIGm1ukB=v_wd6W@4E;FKvC&)j7k|p5*yg$b}Qw%*lJrDFEeW0_M ze-G_K?_Q)yEs3eloGo?kXQh{v`1L^(X%f<}3bV{Oz4b|_L}X(Q5jPFm#0@rX?3-?F z=mbx3j~#1ca4o~y!$J*2(<0C3AqF2W*#Nw(;&1Vkq`5#h@Zc3f` zt=^pRSH=~dAajdKwj*wee#{$em$Qr*dEhRuGMnw>7@g@m|A7r@vgo;uS8c-3!GnyvJ{Zo`>3;r}O=YT+6-1pfH#Gc(x{C)B=ZU2h2 z4~Ui?5!R`XxTu6<2Pt^gPm~q#=7?1vKBQsU;{lFMBAmem$LYcDUU*~{9)mmzxIki7 zi>zb}{hJ2xahUf|49;E@fAe(s*NI0&TM0DXEzy0T#FJ2BPQDkml4F!W^VxGy4Ruxd zV_cH}h$sRFxeQZYQYnRxYVZ6bQt*d=F#MF!gQP}svh)|iTjO}Nu zf#ffjbwdVUao)=WR13l5n*XVr_(c?o_dsF&WD$Dg7Fqe#dnq>$W;+_Onj@RI%jlB+ z`&5(;j}ymkALgIgeD3$8%=P&IilaxU&Ke2RL_1}Ft<7)Yp6r6(u!$r~jj1yKtn}Ov z(bBXil6=IiwpT}1zps`JoNbL2~`+{hm1S@5frzQ|5Bv1->JAiSKgY9T(PJ8qNAPHIC^E{j9KX7I1d< zAU-tj@&y!1t893NU<9V=z3o}PxK>Zc$#(1Uep2Dl>u2EWMPGr%JTnKX%NuKBpGOuO zSZX$^juro3P5&r;d3i5OEiOam|9koW+w&%g#SmE|nbnzyjnD*j%;;jDNp2s0GJa|P zZRniK?$h75@PG`H9HaA@C& zTlX#A6m2fo#I1&QkEvWiyoR3r4%EsEX(&k1exBF~j&8Y)*VR%t1!i(CIEi&Uhi}J|J=N^-c>1FU zSN+lXJoz!R3hG4c#5b6RG6{IaD48ZYXM}>{n7?llHxhnlBBYU|5D)5N>ZX34NcD9y zM*UmVE4nx`#pmL8$#vg8djXwz(L&;R7{bNHwKw$b8{{3U{L2(Rqr$SXD_0ps zSY>U+qWz7GXt0~p(Ii)IaDqxXV^Yt$ye}_*%}JibePzU%UNK-(Ei_c|k(HIsDs!ye z!NI{3z|~o__}%e)Y=oDjj3&s6kN@fPl2eVAIKJ@H1% zZIC5nHwk@QT3xLJHZ`1f*S&Z_00b$`{JJSO8Pkp4ARolkSGhGSY}Db zCr4XzQ?0?0#OmL8(yfzWoa4#7sh{TKU=!`HipU8d^x7{7pU7npLw+oM%d^EJLD8CT zNT1Ito!$5|1xM>hNt6-Qjf{t)6VM2HJ#(c5(L6S6aoCs3Rtyz*uHJ2}$8c{j_$ClO zVKPy{ryuW~mlbKFkZYn^1?-sF; zJuLUWdJ195fKk^{lE$t08+mljU6Xm|?GEB5W%PtESb0YMKTBcigT?zkwq7TK+<~a+ zC_!)0_l6(dO1-a6LF^Thx_<9V{TM3e{-h&ZIbb5W!h1E@B#$hh?TxD6U9UOqr^v}? zlyi_7M$xXyI*o6Z=}Uq}ZSRQY_!hWl*ym44#g^QTXI9wAiJDHg+Y>SP9nJGes7k$X z&PJaMU9&^?%IRsy&+_sak+7Wwb^SaQwh#A+3;DlWtJLv8%LTY~HQe2W2NlpltV%(& z={6xQ<0ZN)>H2TJ4NG&IF=(LPtkG5CPXt=U1Fjr&hq8C?H5)*p+A*Swt8gptPWiT= z^L5!M^uvXoK8DugH3j{4tOP6aE2-xZL~i@8(s>ohvDX|?5LOvt5v9m+&Wkd-N?2AD zgyqQXmZymz)9X<|T;2uWqBuYtE<3kZnLp`*Ark7)T58)p+Y>6U{kIR_+*oTB{JNNB z+cizamG3%CMU+|0g*>WyQcl_>=C!!sSc&Utm?DN$^?4oTM83rqk3i-d){!-*(*{ok z>w)kiVpcFkFUmZJws-b>ChaN@nhr0_LVMgFwa*LGVaJAT^WL<-wPYo>PX3oxA(OLC)g>e|-BSDy?wb zSjx9Hy1H*Ei=4(DDP0^~`Qv@0+~jF2neWE5HJ#{h1SNnr-4xtvp{oj={QH7|X5pv- zX5W>dSVO6}vy9Sw8tlBLO>;MSX04~@Fb}tzBDdSD_;oSY(_VdOHpl^O5v14kB2CZ> zsVTU-gA26pn1}85VspptZgJ=cKRpPDE z51-5}VlTVs(;Thq%S^jS&-eFy zBr>$PKBy_Nb6_Z8y0Ay1pZ8L@>0a`yCp&x!6_~Fh^Q0hzZhVT)x65}iBqRRIc93m4 zB7TQb_r5xr=q{Ml>fCm>fg*F5!WV#oe2-__R|x`+n&g@2Ra z`r)G@tqgbkONcHDx+y$h)y`DjhRmV{!+R&xa$SOBRusW0E^J097EJBOXcNh5=33@O-lJ2-D{i_gjlu<`e??+f~umWdOu;9qFyWhsbBcD=%VV> zat#*`%~?})-$a=aY~i&m$)7MhqqvK8;T=jU)@V-hQpFmQP+|g1c%Hr1bIoY--!S1G znu|sn8rH)8fR+( zyXG$h4CbHKHa9aD@@p8=6Gy8P6B67@Ce~$9=98wptvr)(66ou@|LR_f!1$Wo+3C>3 zMSsXQ%6>J)4SLC!T~SzS{h@u9?{A5=wi zggvAW)J!Pg^XD{5yQ3UY%ot}5tGk3zYJwN1p|IOEdv}yZPp*kA=^byusypSWUYyV7 z@SN&0&ZCtQX3lR$Kl5QSVU(UFMiZO|448Z?^jx@F*DX4RzyvGR5FBG~tE%g0UOU4# z5vYctnE%`??Maz@oBKSwVOg;02L3fwXjGyHf`pB#M4$?a5&gP1uRC?T=N1&CNj!zA+lJdv(nJMvn z^|3c5!45}~PSrG2nI3ABQl+kxv$p3>mBTP$& z{dW8uE0F^R_ znby^`guI~A%)|V^pY`zVuATbsELover?iR4bV_ANY_s|?|2*Ow9Rb^|ufcm@&IxX$S5BnNFPE&fG@L)@N?Vq)j z+Qyu^*8qmGudxVO*mX5Z5is#Wt$I;K`B&t24&KJa-;LXuE>M<}SSW-UtA;-~eU=|3 zQKk#IXTKAq`ffAqs?jzHmi>fDQ+{t(kNjKR&4@TnoMt>W@b5s6Ey*C9a;!5djcKms zLrTvGemXA59TN&!WJ*A*mD5;avD>B$XXH7DiwlyTwS?8zFMz}D*0#0`k*yA-YESCFl$Q$t)boyA zIYBpt*AARIu*9BKJ|R_h&V7flz#}YAdKeUl2&L_?ReF=BQp=-!h^9FgoZ;Wc#Zu&n8Oz#i;1+l1tU`#mY4LR4tYB3Lz>ca4C+aT|&VfW!8k>PAjq@6$`ur z%{+2z-T8696|yjcXeQW?IJ_3&gI7>GFIth?`C}5)t?!0%XmUCUrf!_=$(=ihmt_QTp5~#dlwJejAxDGWafb$u8x2*id$@byTwlQ}26Nyl_+GCHV9TgfbO( zerX#0b*dihII2dgg*mITTb@*yTxrBJu!n8B>Wd!9Q+y!#3)Wk(Z3R!CM5Fs`EP(U? zQ0Zq#kN{gvOH2TcZkF?2Bqk*#&F81MA!PZ6lHd$Q1@-1l*Ju zB@w`{pkd&^XYjYMu&}d-N5G++X~Sn-;87XAiRHNLegMb z!DGP1Rp{gG$E>uPz`XtEpi;~%nU{{v_zpu@Ts%idHE@KuxCD5D2QsBsM2Ns)r_)IU z3yR1S!{$D9;H$~AszziR3DVNhnJJLEfk#nvr}u&XQily>=a!wDSMwqx{y34MDR{{V zw;lPoGM{X<9ofvDyjR-$*)&vM9&)|1jY8l$kDUA*HGHLiwexD(bp%>m5%*wq_3+%f z&#AAWJp(#vN2k-<4bs9VGSmsb zxsZLjGijMWwt^Y`C8XJYFy{q-oY5zLG7EhZ^SpX)@8Ra)js2Xzv+n6BK8~X473YS< ztG$yVd7GF47)`dwwv=tf0j7AR50>26=PGYffV>U&^GPjXK_CnflL52KtJ|*aewD?| z@+!VHv$kCzX-**noq8Mjd|F+hPIcBhuVH-f>)CE#OIW+4J}liJYAmv}bxOq71`77x zk4dgtuBJZnkeP!~mrMtG#N ziN52IMHYqi6l8^z)^Asjw`#m>HJfSfT`5-C7v7GY^`Fa4VytZoaA~%js0cI25Jqis zx|b}TR)SIn&p3j*P*&6@jgv0nO}Irx<*Oo6;fNDUcG!#GdMo8l)$j5&j2=P|c(28ArJeifIpFxWSgpIWVis<(D3Yc6(LHCe+tirDtQSHrGkT1P6**~mJ0!I7BW zG(lY0VQx-DyN{D-UJios2A`$%tB?T~_E%I5cFtNC9_eCx|+*75eeOZBXVW1z`4 z*_9R;McCPh3;W5ak3`!ioXtIDMd6|>r5x0@l&WZB1#Q=+4xhtrIaCmHhUUeD?YI7E zwC_z}uB=^!&xus09i2_>-L|dhsoVQIwZPE7-hmpY@ogRrtgv3mC_U`Qp{wo-Mt(^x zu`X|B7ib)s5gl)><5#V=`jKj1=#g%9-5*}gc9bXy$P(?U$h#z$OWx-g;~AM~DiBj# z%=^P${PTl5;gzC@ed}5%bwJd9yCLW4?4p;_t zdTs6$T}m37+bnN2=(YJ1UOo}~L_OvBm7STH`7xq@g^!CXbB9~^C4a&ap)YV+fyxzA zQhKAt2{ESEIV*8sPUcppCBB!u+&a`UMK(D1XWW`<=usLvSc{9R+z|D}U7dCmA2q`1 zVM9nm8cj|bz5cDrh2>=jCuE+=5U9p$8SmR%GGjYBI=p3bnY+vW>PhCU1RSWiRS=NW zN*-yTo{&ttz?t8CN%E`geR`AxAJ;rGWKZDZDwNc5=^7TFIs$^ZX`o*(toYx-FuZ&aA|2TD5Ibx`7ymqlZHwc~nPT3>(?K0Q10 zKHjm@;-Uku1wVh*X17!3>hpfk=cRk!Qxkp`VC~gG0-ic}T8WXsTD8Obe5t5y`}a28 zc)7S#;|t@BR8EKinE>n{d0gkZn!8H5gUzl1_cbPV_U;1BIIoM7RidxXmhkYzlobED z`Y>F`*=wMH&TVqz<9Sug%#2M;QX-W4T5I~x`4YIm%tFznWo7DetlfZo1hYH*`}cCY zgZoi2LkX_wA#NyOJ?Id7T{I0g>p|+w#noF}?yB%#Uu`x!r0cn57C!6keP8anXA)Pw z6*?#zBSkI=MCw?(H&=(Jh211Avff&PuT2Hatn&^tqC6GL?_VJGy&ad-4NW0HGK5`y z*G3NhD`XaSGp4^qPH1YzCOgU;Elo%FVW_|0?!ao*fSNnCtShOzv6A%HwWfyw%@jat z{CLH!1~P=vn~{!RWjuRjRDGX&ft7IWCo6?wU5xvMdxXqt*1oCP09$3<_JjyFW1}Cv zWm9Z*kHtorV{641Wr!|LQmRAlJa``RFt|xL(JZ5NFeSb;dHIyBpK|_N*^Q=VrG+QN zlA?staj1Ipa`RxvND+UW?|~ebLW%@Q)#{R(Jw15%(;HrD7BiUBi;dZ@JbCbLBnI&FJYkaWQAxECosX#S8Kr;$; ze=<9*TH86IQ4eVlTse9qV9V#=^I&kZ79|)xMmJx%*Vrp)+kS%08(Yyc2Dhh*Z2L|$ z-`%J^y>*yu){a6(EW0r_wf0UXDhQ&cx9#@=;kmQdTOa&Zr890Q&(wjPZ*BKaRu86S zE80-;cb@VUO6CalZE?&A^zi)L)N6iNB_sOCH)E`=7d9n$Eha$I^nRpA!C6-|&QQzL zy?4HLaO>(oE@@LFJdI5ixnV{LcNam8Hkh4M?KKGIjrnCSqd#YVsf^?*yzemWDJg@-lJ&_Lx!s58gP=I=Rd8){Q$|^4~UtIZo3?;H$zs?3`;h54^8#|V1t_nB6m4WL6H+2b*0?c+OaKaWa_XQdJh zDw0~O_R2q>9u?-gECQGqYo~UpPI6UveZtd)^6F&F7YNMQJ#=30yPC?2Mn}pY8`DHU zO|G;mtyla|DE%lA9PVQ<4ph)T9WOTHn&tp}eDL8_g|s(XE}YY%>b!6v33KCBEo{O{gX zrAhCUoZP&_G&eTUX_7lI1YdxEid*P@IAhLdPjf@K(x%r>lw^t>)36lPYb`<$d-(P2 z+G{N?wy%K9H@3BX51gA@AVxvobs)YjV6l4j!SvYNJ0BD;PNR1T+dpAlGVIQO&_9h) zh{(%1dyKbfkZY|ZgLC*+I3(Z*8WrZxp)l+98!55Bg!HhlD<6lWW}()Rv$(C@X>AIM!@U1=#v3-~EoT3UAg z#&Os?JCkEDm`g5EjLDCq64U-hZJp+BMVMe!w#_d5PfX)R)dpUFS~OxGJ}*!;DA=HM zy(+iN&+l>1@GxyiXsEH3Ric;NoB#MfUZ~PjsHZsySvS!pbK8Loi**S5YpsM(KS6jk z`Bwz%8n)I5x*}Q9JTQswOMB>0Z`H_}-rm|jsf!D3vuzbX*dG43;a6TWpKX15xF1-= z^rhS>a|(=>tt|)O-$CQQ{}lrtFmn9#_sLM1nJm_RBif*EU0@i+#Ka)q7CpQKr^#HQ zeYqK9b*s(Im9DAn<4D8ar{;s!m8XuF-h~)zf{`tWLa>l`;TLmTjDjoWahnnr7=TCX zQkDkJpUbv=!U*uPaUM|xH8;++W^V?-DR4P8<&hODzV6XuD>%cr@)Tf1?-l`fsr!4( zRl3(&z(W#~kdO$0!GubzCKC$ti;9R4Cj*{ha&n*WVD;i;4b%N4s*?`ptREg02|aZ9 zIhnp9wXGqlJv$KSqwzN&6f?2wg9tM7jF^a?3pr`mdDvrA;G&qZDwAWsF#yfI@0~4& zV-x(GeS%`B6EYA&U2z4mvq6=!=W8w024g$BJsh`b$vK%Qi}3)lfK9-3HbH+$08oI4 zSWTGPbk)n9-0leBr$@gn4QhdcOP|ctyMQ=cGIxg<<-KI7EoQg<2SEk~Q~+^3D5LKo zRW;d(3!q0Ah^0R8OnpFIsPVcmUX3%U{Q-~ewP%*G+`1t415lLl$Ai7{a*fHu5&ymi z_Q0G;zF|&!VRB>}Ur4S_+fA~iA8WU~U01x}HD(~Yl6`T$Ka}3Yt)=x$oA#BTmkcFQ zA%Ahn>P@Stj+U3r>w^8%{SOI%=IZTft;}K09>~v8W@Dn7$UU?)pQ)=@LHQ|WEBPuI zZ@h|M(|4Muqt2$7K_O%9K5x?wS?7jNs0d*1GQpiRUdNXzWW11-eBy-H`|@CYWnkr> zS(UW%e^_*AK}G)8FBtA8(U&9|F8jyB9Oc9pIh$IOgpuAAvEVA)D0X21GAG4i0Q+oa z7E|m3v<7%Z`ma_~j|=x{r=01QK2`y-P^p4VhioCwbVKM+K&_5&FASRHleu4c_hWCW zIW+C-EXKhtGv3*rj+g*wo4knAJH`4LgvRtA?tcNm*3?W}B7-$BE(p9vwcFuL#jRRr z#HUwe%F$?uy4A4PP8yMv<}Thz?TB)d&P*P^LICtQ<34XK*d?Fe*mwh+-J`sw%So#y zk@1Q@Vc4GyEI1H51n7#Km=Gec5t&o*EsRB`J@ z&d$#F5dE5ID}MPhR%2kJyEce(nV6WYs5rSZn|q&_IBh4X9CwV%kIUlL=eV~8XPn{ zz+&ysuowVH@AA`s2Ru$q*on`jc3Fq{cG=hTV(PG0qd9=Rk3M`cRDyT{SU?~|3q`Msj7SPt7(HXXnjK&2<3OFjKuId@i_)j0qO$YyqOBFW zeYsLe2wxn`{Z-3dtt<=K!8`&GNp!#4&X^uFDTy7T4a|}1!hvAN|7N?K2ndZ;qE}gKO`dJT?%O1&bQdTa2UOV24?wRIgv6QR6EPjhUgLp}T{M+n1CN zu-x=rV>ai@(`T1J;HM3gFZtrQNA0U9|n zQWcnrsececWIB8pNHY)@Hd%KtRq;Jb@<_s8m;RY4VTO7T$iim=J{V)=(yp9>qM{L; zcyRUdUH5-dPBB`05s0+zXq1*Gw70h(JmK$nk_3(;0br_A6%dVFbwsyP$ zxJj$u8v*l}O8{~K9H)YUTYw1GP5%0%gD`A2(UuiP{ciy8bMKR|ftmz5;Pfn6>L4IC zh1!X7m&ngp{?mKc40`Pj5=Lt=kC|j1Jz9zw!%*~%|K0ZwK&g1l1h3}Ap-_%Yu`hrZ z+@GT;%hp;)B=f(iTW)E^#fXLxyyRT?epQrp@^sJ|@J^tIJZaOe9>DN`{Q)mQg#+)- zq)fbi>p!^nO2TR&*6s=Ln8he>hnFbPH%<1_C0>?mycCu&;H{~n*+7ul-QE4UkPg6UG@tOw{75#)bQTdf}o0Tmj8Fb$Jl zv+l54*Ir-lGx;a#<@7+z4ahcHS`@IC?@4{ou7U^ft;!zca;n~I5<^eW;pJmBxRxowwh`z{r5jzNYNS#|4P?qs|Ies799ahX``aybzg;>lty1Z$rTn{+ZYv`+3MPz;M##3k dwe%3L3OnvDDM&0gxZDS&t8J(S)p+vq{{g#nGaLW_ diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/test-with-1-fail.png b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/test-with-1-fail.png deleted file mode 100644 index 74834deae0b6a7d40217101304f1d9be0b23de9a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 25562 zcmb@uhdY<=-v_L%Nohz*11Z^~gh(NjjIs*Jp4lU_QYoQ~kdT!mJA{m~Lb4LF$=-YO zyw30MK91-410Kiyz3;o?cQquWM7L9tWn%4G!#igiQy{|zWN zr$6x;WZ|JK#Ex-8=_8LY)stQGI+S=(t@ z>QY?O(zd*3s;gtDbyUL8QrGUDrLon~bLj@P_7oJN6jGNj-mrf=9O@u?v;Ob6tGQdD zP!%ONCHJHCUH&J2?R>B2r)Q|DdNwCmPw&yCnBLzV%5l2SV+1z67r4&yD3Y7yI3)|u z4Rv)Cz(S@b|xv-=<09d=-%Xf_(jS_WtxqSBHF!TIuMr{qK9jPp}#vBwxWx^s1^AKgd^0-;Z*&|NZm@ zNu@vB|9#B~q^7=pMZU7C{@;(3J*%5gZ?tBu<;ryLWMyTgYu1k7d|7dE@xTllyT&w|3jM>`Mk-!U+-ud;4;n%cRA>d55?x$#;V4lc`oKibtxXGfX^ z?8lE@xNzY^z0u&{V6{>DWpQyX-SWNV6&1l3oX^kB&YHA**{!YJogeSe%EG~+U*^kn zLrJM?aIjpG!Ff8~bTbPJOGo9|_UNpv;I>@Hx<7wPMw&C%jgODN`}FBWYAW~f6DJ(j zR_4}Ho#uwD@P{c8YKsGE2};qivD>lq>nKHwN=n*7um0=lv5`u1n9_?-h|7*y64uev z+jjWy;obZ9Gh;75k65Q$O8x*jML^MR!SiU9x6GZm#;*iIPL>slC0u zBlGfB&(@KTr05#SY~Qb{s@fHxtno_6%hQu4kX?OGUS8h!!oqHjirL-9{`~p*`FT#mTE_d+{p$)EG+kS-m5sIMhwnZiLGezGg_iRU#pcbMU5&n* zkG2T7Q-8_H>F((%j+XMXU+4*J%5^-;;4*)#?)|kT#U5MVSFgSeH>DXG7|d5%FU^j0 zx7xMm#_sF%*~7q4HI$Sud+S!SCVRYJncvAYqx#c%YpafiCclmN>SC{-WMjJ~-PhG6 zRuv|^&c*K5XEiofrB4Ob)i1}#%_*j*r&W^gth+8Wv5}9DkK)B)!Pk7of5!3gojpA> zndu`M{ey#DLqpr$va%NPZx<^mD^E3Q`%KhGGIVx#Kf;%FRb{1Dp7TKm15Gwy^G<(RSAjB>(;FkeJYan zFDI-m$kJD$B!ScuBnN5 z|NaS&{;xYaI_^)OZn3qs-Me=$r$yIgUb>x3Oia-+F}ta$-NG~)-mgv9T^CxJuA{&n z*4EcQd1{;6_55fKjt z>SCkhSfVY0a5C{z_V)JXtIG~?rlAuX-oJnU`_CWCfm){Fk&&(2wq^G{s;;dSyLN47 zLPEmV`7TeV<%v?2Temih&oDcK&z(C*%8ZoZ-{$6=>9cP6`66k0m65r*hlPcO|Ni}Z&S8>~ zjg9TaL7w-X!NMm_Jo@zM41NnrVd1Y|-edV|VUM>Th)hble)sNiEiEnk`}f-vB}j43 z_tf;-e9y#0r{u*!6%`fy#-=Y8QPv#%{I9WR$+a7YvIay+`s|^ly>jIWC62g&80E*0 zAA>lx9!C3*{hJ=Bdwbqyo7>yB^cUtkHf-CzUBGUX9u@FQc6O?M)e(1Ulg8u+9UXV@ z3kp%<+yes-pw^RpG(2pAGo5ALxqe|`L1?^SgGt-hU~FhPIXQ}grZj#04;5BhUB}?w zy*|{V+L^{i6;$r^)+{Mfe#|KbHOGyNjA+kWvq<_J+0^l`%x`+EJ$$Gk$uA&4d~J1Q z0hQ~@wQDh{sS1NWD@${B^7Nsf)Y6|96o`KR{{6?VU+?4Mo}E&BPrYZ)_vU-~UP|#y z%*;>p!yKNxe!c%sqPk~%JnOe_-)<-?lMl4C2}^ zdw(tDNm$sCh9u3{>){vZ&zZYb1ak10cZf<$OH-)i*s}QuO;X;xd6Qnq{$+KwTxwdH zfK~5~YOM!8pnV|;H zoAF9pkGYS}%^h%S{A^g4w78+Xyxd(OZm%2m>C43Y)y1Lp)RNxxyTvHEOd2`0^z@kD zym?df^4KMOlYedAT$^K8&R8Ce7-i?be~c8nX=tY6ZS-_?rSf{_=k3w0a47e=1@RjC zQb!j0v<#%R=ey=pxIcUL?2FCNYg~kCn%-8?pFv!gPG?3$TtxAp6ulaH{^s8O`=8IX zyJ}J#KX*>$b7p3{V%UopJ30pjPR(!~{hFIw{9wbDXx>sEh68TZ4GjlSchnbu6c>x% z&b@#0c8={eT3T94(XZ3BGLgy2azDdGG$|tS&}yx!gR8!MyXgP=^|oW~fRWU0Dp{5> zxC|f?N>Q{wk3WBuYHDkb3keH9Mr~%KIU43PS!OmeV8U}0Pc)}RG44jK)yEnGcWSZz zfq`dF8C+C&`T4hr?l{DMReEi{+sAWx*$GGUnAb&l`I;o}1cL3_%aRg56}u+f)o_{+ ze^>Y~+jY%FK~XU!Gqbd)Xk&nMJzKc9_bx2erVf0dXpDlz^1Q|3?8s95g;H6+gfE3Y zA8HKbP6trP5!^z8gIYyx-^PVOUSE=JzZt3qhMMEPa zU!9c%w(BT9Xs-K3KgNFfLhFVOB&Vz_X=HSohWTp0?{$1}U$V;>_!W=?;BjLO`>MYt z>Z#60Q$xdr`VouO)zzZn;t5i1}mL^DFOnU7cS^T3rk^Dxs(-Meh9> z->dy6B)y|ieS8nGt5>g{b6(_Ce1EmG ztJrh6F=d0kejmF{i)jSG$_sWAAx|Se+&GO&MvJOJq3N=~6vA(Mckp*yzG^>uqq({H zyTn9q)8>pjLgiwK|wzrQC;})d>^a1ot=K?_s1*&(m2~eLJr)dY8a(wdp=xH7Ft`L zqM$!-?STsY@ZrP$x>zdIlTRACbhmEZIu$fLx;igxecE4Echz`B9)-!wj2&N2Kwob~ zTs5{0*BPZd%{J*%s4tI(T9?w9v+2m+96JsW zf^GoIQSOWXt=`zbuyuOX6AGiZ#dFcj-(GNjQ&e=B{_x?gTel9pUi}pq1gLTS!U7|@ zNnh?dvFCv)e7y9w-nl#j!Mfm( z5C97UV`J^#ALNB5ifGhp0n$99qZu!(&THF_{4E9zQO&YsLLCk)pI5f=KFG7#&d$!P zHM@9uVM@StRfx{(iNF8eKMA)aot%~#d>5(|jvv z<>=!zb#*5M1rHr_k8TW*W)h=3<-9{0#zf)_i+%3W` zi;Ii-=WX#_t;Z+Etgrv;?Oo4l-CxZR@Jqd z&Q47g0^kKm7oTl+I-&04>8Xuv;j}mqD>Pkw>8+rhHAjYVuuO*HPkhy$TIw0|LA(Cid{gtjOvFRn70;j29OB zPYnFcFm1jpBjb5PR#en2NWkhn3o9!PAPibZrdcRjM`z(vnTygK`OB$$X>Cq|lzgwL zk*By@;I{7Ww}+b|v$9m_MO$3Dv&+nBKzD4f5l)ArS2J@xC?ukWHj+^u}Wx1JhxeNX1S_Wb}>UBUWcugbIS zCnBjMyG4C}8H3{;@MFHV$MXQkexr0X${LFx8C%;74-b!*wFxRIV%zQx=`^M4)~=9S zAz`i-Me?U{_DRjo|&GmrK?+PoRs?{EsZBEEbIj>*ZN}{ZES1^4S)#qHZ&Cd`FlZu z8$=e_(DTJDSym84vTx{vm+jxbpHQm#rKL3^hQ`K5FvcRFc`j~lu?V?4rlyt945CF7 zz(mn`JYKxeseX46Z3w6v# zq|Wm56ZZ5eAt9zOtswo(BL2~w+`jl*Qs6D?vKST;-UdSm^e6m(v2JT z(9^$o{CJawh6cDfwo1_1du>T?hKV}2%5LpG@94_bIoVTz5;qBHA?5yzk%TwBRQLtw z)nBKxkF9Rd=UqEFxNK)>=lI)bCj7#y(Ye$+-_~DP_(y}=U=|N)zXwFS7U6c0Py*L2 z`E++?^@D{S`61EV9r>Hi%g2YaxM-(bmOd8M@K6!mNI^{clY zHmsgbjfCQt#W3I8?rqik^BCG0a1^I@$%{1$>1(}Xo#g?nzQMVsm8hzUBWvZ4v;sbfu5c zpEUhfuLd6e|1VVjf3(l+l`y`?kCUxV-ndav8Dc(h+}^P;RNtB597RbIyblX?^_+)%L$_ZL-qR+W^j7=SweQzdVhKIsxUfHXYa@ z@pjh3%*;&dgp7>WU%v`r1)ll%oaEx#O+`fo-ks&Nz>No=AD-q_2}8NtrWq* z!2p=6qssvS0hc8uA?eHox~!b$;h|AiSAXH<U@@2Uvb=$UW zjet!K4i2}ot)Jmr6mH#;fvn}Kyn5;Bu2&%;GT>83jvT=@gPbEJB?U0iJvMe7G6;Sp z4%w=q04pnN6Zk90y^gM~mZ9OZxVV9E_UjT7y-9V>x~2vY6Lv{6ZQSz6dzS%k^`F_b z+WC36fPHVzZ&Fn?_vtRi0WACVORqV@)YtdSnKRLOc}M!^Q>Y*+uC%wcwK2K&z3K_g zFS;Qw|E;GYu%@Qw)uc`B@87?BteOv}W~8Tgj*W4g3I~^`c>etPIr9z*3aAMb|N8o9 z4jd@m!r(+Gw4tdfld$k%6xOd_zy2sI>jVp@FyN&d6;dLIJ{$!Q${5sK2rns6Q|jsz zrJGg5)e=UJ+r^qZdGZ8etMtg=)wQI-dr&C=uCUzeU;6rriHWVpvZyak{t{A4c#W#Z z&BL<})U=?W;N2|-<8-xwwO=WNXU2Y|0Q{=gw#DyAS8ElY&6%<;x5@nUl#1a!)FHRt z-d^^(=D&ZxECnr1Pg`TJ%!QbWfSrTPk1-qTFL7w*{Y1OX?ir)^%OQ8e$~qJ_2Z6!D z(lRnK^5Oq*B6voYKF%~BdI6pvAVLw4>vfP42ppd?GA2t7-2?LyaGK{t1q8m_i^>AZ zl$5vlar%snrM|1Ji^%zA>ptNGCC`Y6W16ljd}5S%D1a4uf%>!g+Qayjr#LwB^+n2m zEZ>V>x~|>Sh?Z`Ue)xG~=@v_?&hmW*W=~?n9tt~l48%q#b0nwU?e;!AZEK;`UmZc= z@9$5}!UifKQ8Tl|=ud^;zxUV2AAqFx@87@b#>O8WyHA|MZ9~B51s3l?Gljt2+1YvV z^5u=2Hf<7`{BZ)`+0oVY9nT=;^JmCmUeI9_Zrmt>`Xa}&_XWLx@4ft${epsmbcYTZ z8XFh3wuUY)-Y3e1S<9Di=m97w^9u{)L-Fvi^{k+@HvqNAfX9yoAdd3iZGJ)KEJB)qHZF1R#U zFsi?zg2H#`8=QQ6#nsi+ID}}`2ZitR!ow&A;D$mE#as#}4Oe&q%%boq70tneQnIq3 zs%Ti`*MM!ueEj%)a?+BXo_>BXKFQq5s<5zd1NJI9t2mC}uV23y85yY|SbuexVmW;} z5+M1A@cm@HN;(NIy2t71d_ZLoTm8bruY)U~`0BJ~+XTIN18o%c$~ggn&f(z~O7X?D zwR^B${HA}4pdrnJRUPEkxe{1^S6qA(lxVld* zfHHt1u=l_L9(WC8jlgU4^z`TjZC}L51S;U%0Nu0CQzMkXlNxc#a2qnj_Qa@ zXH=5iAQ9HUJptUhihC5kKYa)6RXy(l4lSXNL=?q?;6^tdXoJp7F%JvL+|u&+nKLhv zlQ|PLa?2s{;~96w1Zs3G&J3Zl+_`tJ3hmRO^YH->AD_O02OH3UNGF{rKA?Gpb@0s_ zx-iF40o01!VjX>blHeO4kvp zhUZ{>Fwo_I7Xb4=$;>=UR75E5t^?vHPfV=|wkrQoGcA?Q{y@pD`Q%pSd8MY+)t5n( z0RiSq{5O;zC9?CL+CEHKd%GoEwKav#33Dih>Pol($RsYdppnRAb|I;Fkug?!n^Yc>-lq~=G^99P1-p`>YSnM0O|Q zHa-1MB19)76gM^oEll;%9693c<+T&n&kT@?&y`nHEQG}vENI8hZ3iG%1Mp{c29v^3sX7$XEI0q8P5nlna>DAX@-ihs{ehIPzObmR2b*4BP6WpMq8 zY86v|_tK>e*gnMhu^YV|=FoevtE&ql@P0^u>i=pDcxwmK^76varPgoQaEg@`%>EH7 zF@X}$zMpw`yn~{R54BxbfS|3ecI(#GUAy!;3LdDasrjOMK}bUN`iI}Qu>ii*;1aeW zOaa1H2Wq0W;M8}-hP!;Ps=A(fys4>)lr`#yKnrP33zo#|g)t1^&=2!P+iq#r^vSNn zw;^!K3 zHmk9^Iw$wT4=nS2B3i#$SlAwCXYUe8S7=IER62bzf}-HhUpgKho;Z(|mfL6%@C@Fk zq{wHpyT40Gc?AuXR$E)U&1K0HR0nlk8#RlVO1RzHH2v#NPEJARERLfCFbN18q|n#b z$4Rj;H$TeB`4Vywu|u%YHJxYn0Ych4IB1!gdO?f_BZ5x29vcxj5glsdd8Ko3l~6V< zL8aemKh)CKmsD3jEFI&Eexq$*@Z&YxEpr>2VwhFj4Ny+H1_sJt3e%o7qeq$Vgj+(a zlE}#8EiElU!2e}sWlmV~#=n2b#*T?$LI;8;2{J?lkcoDDnev!(Mp{}_YU&=`yrrcj zwC}!@(j(mv*P=2q_Pdb{j)MfQd{D$ii1d=7KMB}@?_y)0rlfEIRDvGXH8x&xbQFYU zjzNo}8S7Ku+v(NK2?m=(RD*Ng4pQ9iyYrk*UD< zZ``~o<;Q{DCh>yyTei&*Zg!+sU-@)^y`y7yZ?A-l%LSm@Gn#pCVOMJz7-^uIn=GvLUv2b{9xKVV9Y6D)foOpn^eNX^g{vAEN zC-5|hdki07vfD>QnthAtV(4fN7oPv#dpB?H)7918!EoViQvT{2l%}cbOH>nojg#UZwNLIJ)T3G1lpg4K` zp{Go#baTzC#!1UJ#>T+2UH>D{z(dah0`_5P!9L*WAVxtDguDAj*oko;J`^-H1v9uV z?*>$ji#r7`t@Ou_D{7$vf`WcQL090!;$imy{+7ZTMf(hMSu`ZL2_X;EQk;oY$2l|R z>tR1fTXRslA|MBRQcZiprCnk^-7h~mH3ePb_}R08v$M9?+X4_Pf$v>b7Uh+cN(SrW z3DL(w5i1h4pN4_q`kgyRCnhFv8UZ(Uf#}2k!am}3nm3nyd+vd!=XP|MPWY(MOdf*Q zVYv@*XcYbV^BQ8-Zd%$OXz8>#6W~FG6&0R%M*k-~beDK_dvfI6K?5Fc&h!D%0Wbi? zfo$J3GE#}o=eFxHHs#NbZ;#+dizg^q!QO^)LrF!2r|}pb@$m5QJd8$0V@d2CB4hwp z5}8F&5k=)4d?zG4XweE2HS@iJ8uOPYw_|(X2JZOxPls#=k+p^EsNBRa)GqaAVqx(( zENIJV`j;2dNsf>Lt_CL5NrYes6w7RP+3tqkgVjJu_l1X#z6oi#ySFlggb#*?ud1pZ z#OWs42&loeId=EDy1Vg6MH7@1)zvE@2Ne0AQmn2U8myPPc8%%e$t^f$kXNb2s{j0v zfIAO!8?KU~l9B{;C6FhuF$E0`S==4AA8c<_RWT$PfI?9=o}gKy$$N%|9^SWa-_agn3<{)v4X_~sKV?l2};Kl19JNq2N(LW zuWoT$TNr*s8=4i8G7#$g!@{AK-JcmO26YQQd+!LevD;aekI5?O{e*MVSdgq$h#(UI zBUj&^dxh}IVK~I-lC*qAdygGE2A_x*U2wkQcNG1yLE>5zZ_h2-0g&|$M^V+TR#Mzwj(%<sKm;L+y?B037MJVWvtO-uoz@7%Cro~N7q!Lcg%n+Ov6B7e5Yy!sK9TSrmAOSd5BnGAPgZgJ>_sR5)+xZx%U8EfPZsxavtU9-;aNR+9Y9Mz_MY>u4t5T^mO!@@!8q;P`Ut(>aZ`+ z_n>ed6%u-jQ>CD(c^wNw;tr*yPoEySPl*Rv)@}mL0rk=-{S68LP#Nj=E-o(9Bh3f4 zZ{N;*HOLMBiqf{@Ah&x-i3AP#K6#N|T(NT!4HIQDObwpdOHP3raWDh54h{h*%M_04P_}`D6gZV2!w*48$nv5NAeu5g)IeND zTyTGD&RH}nP+;u*i#KlU&B(|=Rm3`jA#?&H1Iq@3e?ql4G&3Vh4Q9G|C!PC)2kX%7 z0ZS36c!+9x>B){`z=ODM0Bp1a-G4t`fe<2(DU_CAN=%wHObbuwQPF(i}?dc6{!wWy=$LYT%UspVP~j9Zh+Pd$pGn-$9PnaN@7 zB>U|z1+c9OA8y+2GB+#cB~gfK7CCj9;_cfn z@Q`8m!lU(j|DG8Q=mSKOf4)&h=5{PV)XHS=2lbQ6=4zRTHjkpSb*Ke2Og#HOU| z9+KVudn~%{rnTMCHrFjM$DyNl3=f}C=i%eig$aR--HK5jyd6+sreML$TQK5kTUxGy zfdcxpPWJTnMk0M#^m$njv^ffK1Z+UFwy)@2JOBLo<2rBhL_``;6Y}|YB!i&2$;$46 zrQST3j7E%wKnUQ9l+?H4;!O!k6_EL$V-XbT@9*yCSI5A;gu^V;(|R~(!jW3c9Pw8u zeE4d~w%NX6!y|Tm#brUcxEl}MT6+{9w}64fX|UhSgVk}d3s-Qaq${AZsIWV0q}oQ%sa&ZI^bmL zfqLRE)+J*Xvwu4a0D2zeb}>+QZ9mv;Z$f4p_5|6KkEZ&n)?y}aoDN_d%OxeY`1w8@ z+%)3`_O|;&Z11#v#vs|85nn|mQ&3heg$Tox&tc6Hj6&)L&mTt;$d#F$eN?mjCOmPP z>q5w@>?Vq&rprPPgHa&$!vh-j4}5)n&0Lytq^?{cY#5SmZ&mnpe4`j8M2wi+x%^`I z(hj}B`XK%h+1YRK!!Z>r0ClHNpJriW(;aQeQs8W3xELYV(cL{2A{}41rhztNYRZN> zv{LWflP>}G4T!cBp=R>+*Z}zg7V`^z;aM&#_XF?9Lrw+~ zBuj-pOftGW_pGgXxwyDoQ<+@f!r@DCUb0nFQzOnQ$ibzv;;n!F*j8OwOv7_YbzO6T zw!t)VnLsV162@NhLr#IZbXnmt#jOmJi1hRTBp=MtKpevaCvHIuB@s_-?3^qb7Y+nM z�!lL+=E(3qEf%DE#O|MR|F4sPTmUZn2l3B|t^6HJKq-06G5Y7RIc``R`47hGe%run}3f0wvx|FkZ&&Vr3TRaU#0ilTACc8_2yAsi*mIhyJWF5_z%DWR!SOCB zD$)R0d>#M3{fv6{Ui5ERmB@zb!JMO@N9==$X%J`9fU)xy2U$__zc?@PL+m5@0pIWu zC~2_0;1+>5L_kG^HsmkOgl$Y<_q7myF0+<%KY#xGQB{S+9xZeaD5X&KoGwCQfOmwS zwVWT<+Dvuig;>N<0fFF$57&cJ+ry`g5$-~hAd(2cVI7V?L?bk5r|B9=XqR$Oppi}z za9KVFJCcwyq>@R_wD)K5iD38U=H_62Q#u?($nc=p`yrp$|9d6*1#V8fQo>zS_}T|t zp%Qzb48LYqmrl~iJ%^7nH8llum*}0LTAbM+Ar*9Q`=Yo-e_oI5{;O!ez@~~6jb7s z!dnC==z-1>4K<4V1~(k*RD_EGN=xDtW8q$xK>k8r#B$^>ABfGj#uRNl4=SJ&z!e{0 z5IhnBbRnfe{G>tmMH`30Q-Di`&Hzooh z_-l)i)nKN&&pCb~XTESDEVJ#t%>AaY^ES_+B?1om07M|{9+{rL59kA2 za)-6{km#2t4Ky$Wjs!ovea6@>$7wrIPtHihag2vc1A{Cemt6ma)F0qDs=JmNUa zMK~6uf4DySkO$GXKqn+|Bnat((}5NZm?egdhd%qezCJ=Jo``tpgAh8%&W4MRM$!qD z?&Yi&;`$IRK&X!&Jxbx~>PoVsu=9F)daed>KESi!H*2|q+Jv5o4Lptvj<%s;8I~l= zW@tZ=LxH-X6Di)jS^R&NI|36WVBIJI2pvjM04_N61Slf_)s5dsasHS87ps~&2Z|~v zX}}S%iIElk0n7toQEy?g=XSnJC>*l9rBOjt-^Ns3!ZLA_z$tFfpMfQhg6eT_a6mAl z7E4B*gpPF(!QUL)5n^&7$fAhOjuJ*CJWY+WL>MX%JrEWId_0B#AjvCZba)uhWNI23 z2;PG|37A!5l#bp&ii}?6n_@(CE1_bNC%RFKW+-&J^QwYKH5(4p~|B7hO$_K%}*@!Tz<)WBNi)VDid%M3^d;6eu>Ndn@c zK;O!PPcl2)bV*5RKQ4i2ZXicEOWDIo{5(8`AS3~-%19$iqh}lc`E-nx)stjVhKC!| zjSoPjLtF>S;bjy#fDm%}@EqWe0j_jI2(9frf{u^-lA4(wZ4JRs0x?_I*aXOKk-2iE z1Ct|6JUo6Vh3_t@YGzw+#bzSK7twPABO`=2$h-wE1}&DrPk_IH0$(Tx0Hq|;VUG;` zsWWGE=0;md0Wxbn51ru`>^c;JyQSWThg-7z@GJ3zRq~t!kmE6F&EAJ!0sR9Iz6;_3 zJQ;JCao$IS%c0ibSt3SEvu~d`j29H!#-^qe(`J5mYH$~68+eJGBO_jrgrL{Fd`X>g zuN_{y^a0H%_$6p9#0EvAuLIHvFo%@1^j&~U@PK4Mb@Unogyey7NK|kitI|tga*#ma z>P~1rWTpr849y$Ks>5I+zJ_PeA~tQ`PkrD35mu|Ynude|hF}=MgxAI~9qB=;o9XCL zQQvxK)7$~0jVX`by*mmi;~Y#f-20^jr8F!E$%TCQa1>%Ifj>Cr0K|kqLL9{@B6o*} zh5Lp&M~EEwriFzC%6l?83F3^ni{t3%SaOI+%w@HI{yb4jART~&)JS6_8V6v*71qNE zN-{vDTXxak!AKGihvh_aMiZ_ zy;3|P5D-Eh!9pen8Z-i-vC`I7_0wxWJSVZ!QIjwr@&myACl-fs`w&bQY2*jc1mV5- z;0Ld;?*@Xw6CyzjxOx6G@MJtST|#NEeE{U3RoAGHRDLWQBwRcr@I{BwtUjcjjzB2T!|{15?6@EG75OO(uzL}a ze3@0iT3{=ZV#d8-8t$%%$yI3aa2*WN)gXIw!ia{cf+z@ZRylGYDapyiSHZD_?F7-6 zXa-xhJZ0DW2QG!fg;rexiwu6vfSflPKXw~#Y-0gLS^%<1=wHMGh9(1(;azTSC>j## zi2Y2xG8vJ<%^byO2>y};1u&3=xW{8LvT5J}c0mKtgRxDTNMGN{g~hy;*;{2}CdS4x zsMKJtB!Y&(Fm61{dSDMk#ZT%vui=g&AzF?GX0eb|*ACqs6iyEjM@+p)D?G=}BqKhs z9mSh+a&m}_E*9}Jqs$tVfP{rWxFAyF!yjNq2hA-O{wBn=RIS3zymVfBy}n}H4Y3xe z=P|IVu$)3dLPRN==qj!aYeGb`7S<|i2toi+Q0;J<2Py_I4TnW0`9(~FA;bhi4&APx zynLIaWGOpOI}Bkwq?C+|5-4}TaWI8R{#T5W$npgJU_)TqfJl?NKng_tgE$7GD>^|r zv`=fOzyHpiJ8mcgIOrrgXl91AD+Q6p(IfE}<5)@J&`V)nvegcWcMl*@kbVNXQ7TC< zuAPWNln!vHgPFGt|S9z}%`eltiIu_Qol zCja?eudS|r_j&}vC z;3ojFfNA(bLMzUzs;NoezkeR&nVra`m_`Fa8qHfWtA8tu#0NSY-!N+8`=X4MSxW z6;Y@M=;d1cAp}%I+>NTC^kCeB%ptL#pqxPc`jD9T9!4Tg^;KpX{tz!5w%%W%6#(cY zH)6m`{N^L}9qaHcxM+6(-4LLH`ja*AKExj3c?TR)NQ`7U6YAfvt>ETI>(ZKjqUS*> zyZ}=M#wXD1N9IlIQeNMJC4_Ob0>mU#@?C^sD;d!z$~+=J|MBCt*t)XAb}b}gguhT? z+d)J&qx8F(%}85H%J1Dpf9_qPaA06y{KE>StC*T16#=6D$6_)zgJ1qu_9Pe)659%@ zs#5TEvB$24UpO3J|Iutm3Th&T@Z6N*V<3>ChNHE^Rf~Q1&JDK?9B5!*@b2r^+v&^{ zWHe@Qc##Mt8efAz=|HZ2Kn^Phb!tLy2Rt|lB?o34;dvVO2bg~9@c@7jwNhQ(tH}gl zD4Yb8IcbR|uzmlTcYt1xzKJ4P(fgeq?+-X3PTmCo4M=OCHYTW2540LJq38}L&T-rY zWz0~))KmbQmXzFbKlccr0m)&2QE~-erS*~k;{thq4`*In{zh6Z>q%z>Ntpef0iAuQ z3N6!7(ENm9lJ2Qz7lkPu3Qb*1AxTdoZ`9TneG|6@V#8r`8SJSUEx12u=j* z87vOuF^d2g$+p1S1Zv!Wh8q7uBI=D{mF}P?qTEP%eE$3y?i~>kuE@xA!v`bH8&daG zX1_t5AYb1|wOrz{(|M6d3*0p#u^`a}?$?DxdKCQG!HT~#!%!c&;Hl0y?A)~rMu#ut zQ$l1ueY%mZ*uc{O5Cr)4UzmPznv5pn5hJ@obXhz?xYnfMTv(Y_w7D88ONJp}Esz|i zf`ac~TdWyoUK_tyoap-%N_;eODH#0ZJ0%Uo_wNaW%I?^_0fZ3LgP>i^tRV|@HB4yX&4}G88^{If%bRY`DJ3;vKHKHm zv7W_nm}z>LfieoxMG}x|%eknU#uKs2A@}miP-HN*9g8e8Du>OrmcNIM|Itd|J8i`CoP(fc&g-J9X+cvp*1o{Lg*!Zt-5g+7Spu?~-`w4B0=xqUmLzchYj(W9e1wI| zeVNW(EFD@(UB0Vpy-Cp9w?C1Btsbz(%)lG`5a1UloflvSm&>v}mIH$uCor7>*8{3= zFt_eDh(kRf$q-UEyE39;U1PXMELtp4{dp-le z3CJ7?E?{Jq1pHD{xj}4hm^K)t1DO&%7iwOyQMxa<2R7>OVGDSW^1|YR=g%jrCE!Y+ zrFf%ZB8(hc7xzB%D+a}(okhd;#wOmpgSG%Q71S&OSQA;#xQDP84~5E>g3b`#5lWC; z;7%2adahrUmDkj_I74h85qazh)bvys7g#^U6?NvvI~h-&)Xr?a>D7Q|43!C&3A33Q z5eaw|R+ImvYU}Edpgtxn9E#h-iK%ZHKyI332O)@)Fg%VRoX0zWUIgo5v9atZSYVWp z9IipCM2zn)AOX%)XI~$t8#@zoMo~`TITj+&@H@Q|Pz3FhjB;WPKU(PkUE$t{dyA## z>jDv>PEd;P?QR&bCWA#Qnq$qGNpILpp#}orNgZB7mGyn|rW_JHCS(|Ksc60AJq!cZ zP(JZ41&{pv{L?}R&!26zrpauzJp`82jrNYvfxH(p(Uf8G5;0yw!&@WiBnt~AiXIg1 z1{2R6>NCU&^s{0 zFCJBcf`Dg0kK`_@YrFsj1)pKn&a*9|=*+OX5yC*0K@8=S)BxF78gcplh9m~Pv|w;b z9EXFv2GoFd_&_+}Sqr@(r`Xv`@IDvRaKJ}M#72~QK!MLAIT2MRT>umTZ1^N(N6%t0 za4uM87_xqeQCghA8ys^e65|LA~w=wdi>=i_x}=Q~`yZ{k7gh z5suBSqm3pRLv&Pu9FK4zu)08F)#q~Kp*kXvv~I&@lHX`Gi^Z6}*TQF&GwrOp?<+1f zr$0^qH$*lDfTKbB-?64b^*xk(Nk3_N!m7NRK_E%q8 z*EnK}1wj^dwQU43O#}(MjVt8#J_e}ZyVO>-E#?rUmvYF7pWX^ND9G;>2YyyWYCVA* zUId!t_KM4sKYqn)2wFLE*-iLECc#u)l8i~f8}a^+6)9}DGFV{n=>%${Zo_a z7B5JWf-;dk%KzHmp9L1I(kG?(yJ=1S*zcz>3?PR}6h%H8CSQ5}N^`!tox`4Im%AcM zdE3(sS3o&Znn#Q@2BFi{pLzBA_4`CAgs!x>gTG)mojQG5pRHy-N^i4-P4$7-udt& z7v^+{hy!qd9e{EU>-{n+4ju@Ml~*rcilPRd5A{YjCio0N#M7srf=5DfdH`|<5w}HCCdwH4 z&YvXB>pD7&cC9uCpdEv(LOpzzl$4a6IQCo|ZGm)lOmG6-J@fWf^4kmNBL3LzQ2j4T z@d4Np1n6O}BZmsn{N?M{CFqm&UR>a|4{&IZo-Nf&BTf;tf2j(QxNSNfP&bw)ZV~h&+sOo_t(Q^ zA%eg%*9B@uBl#dDhIlCPZXRvkxgPng+v#udRs_K+rq?Ve0o73N(Zqj8lGk zUw%7HZzt{xBHA`|b`oueMFF-4C$KF7lb@&>_{N`bOC@ltK&fJ}b)DwtAR#fqNyKYH zfB`B=o&s~Bz^}rNv*YlW2t#c07U68Xyp25<`gi7?+CN1<+AkSUgxK;TjMj zSEoeQ{NT=LV2~gEwMcO6D?yXUMDpUu5d9CZ#|rxm*+C+*LUh)JO@OppAfOkZ0Icmk zOgI$ir4bL6Pj3cx1f)-7sAVz8Jvak4RDrhQurkvyF*QZT*&$>{;Eh0dK^Bq6p+FxUqZmA-P?akg!BH5;zbwg$cfB=@G{lFhRx}@>loeYP9Q) zq(cUE9L?H-O+#2Jh8-|>bdG)($Q=!6r2 zfa08z%x$G!H}oN~sG9L1%{3AZB>7IWoDqJTCViMusPtjvH9&yHN(pM>_V(uv@tYiF zViLcmHw9h9u8B)pelHMu1>Ty0FfaT=47tRa9UGLUo4hpjPKMDpoT2^8JIl`Ro5-Lq z`qXYZt#mcui9R3K&8>dUlfJ^zcr( z-9Wqq9%*X&!0gBN!dtsPDaZD(&N-%FW_whvPMRy(Seae4Mpd~yO;{F zO)%l1gZW;PoXpio8Wj*m{e`aM86M7nDB9(u2E3Co+*vx@3sQ(^rsx60f5acKXg`P>v1?cFE6F3rFs@D_DVT`> zftSS701hO;7~kUe=8ZJWSBON&up#E`&>!*i_f-YY{cLyfS_^C};uD`UKZSQ1o z5n9VR`0yArMwz>jt_B#C`qWAqXdP!zeKG9qTN3^v)7kJ*E+sV}|DB}K{kOA1R~XYR z+8_v!ps#q1965OkvabAN*-0i-ap6)e(b)91s?$3m57qB+}YCD_~A*!^6Ff^KAssNzhKxP zzaGz?eKX5=IHP{c>#EmBWXZCO3{OAGjGLGgm6fZ%+Tdn@<+z0CS z)mFoL0+q%2EY{(Uo5;ld6XhI2&1)RV|Hba_Kt#koBd_H`Qi)vce$P!ImG4V-KstXF z9Q+Ip)i1#@GML#H=C~`WhP+P%SXtGlu;f#gQcY8 z(>H6a1J;;K^nxspm>Z19c&$ z!%)^xVh(Y+5DV6afI$Wy;8WwxV9@=v;Nd`Mg8V?_Qb;|+!zM7|e<66W(<9jj0{%xj zL&W65oo5e%Vv}qc)K%`dIRQGqL@Ob|)*K7Yhg{BY`^Zjmeu`Zk_gIEoS{ zunaI6Q8@%{hsl(v8|R!iOoCfxS&z}cQ?2@BA@SnPnUw~7+9f;M9LI#oZ9)}j%(h|0 zdzVO70?zsBbgW36qxzQ3n?L^T#|2_o>|JD}*tG%54}Rh3%f!=`lF|aGYuJ%%&Xj~v z3tc>Hf`f_gHj~kg_t=qqq>12 z9d31=s9IFzEc=P$B<_pX3-zAOU-0@nhb6ON7{lGlBU%Q)53QmXC4cyDx+fkj74|*U zQ3#lWms22(Ksx3DlVjg%AZqdjf)28c#f62Ju9bI|{{m;{2Eop@|D~j)^wIA*>V$@U z=O!}m3kZd5mfWT<*jP@=_lr~;{`^VB#1+Z+@Lhc7iInJG@qs;EIw>mICQ?n%E(&AX zdd$1;%Nz32?PtIJ1G&r^ruS9p>8gESlQj>t)z{QmTuZx)#CYJye)WUJx8Fp^3n|n3 zM6v)26TFO@Hp|3&Ib$*w)SRsYa0KwE2gi`GB$Hl1zpj-T>7PG;(4I4$$r;@AJA1@d z5ctjL2^WMBqs7DwTWf0!cqO`wI(fzCjcN}rCPL*!r^O7-6$lR}W#7tWGNgkgFfqLf z2&j)~2j2vYCiB+#XGkI;YKbzCg(R;`r>Wthk0R8lOU&cL*=_pDwLuXt<|*!89-{ zPcT$-v|VW}eb7cAFDun1Yju>~u{pQxSA#Xfqft}H;{VWR$k;r^;4b+@|gA&t7lK+oAyX?NPgT4=6L+ov}JViYy8c#=)eYlp6v@U1mQ8ONeR-XXq26uV zRyjf#$xl6t=5cM7`yqav=Sxe;b@Iu+41s3B`+DB|-|u-lMDvGk=VkGWvDcVAUhFL` zEbOEUp<8D3@HrsTet?66R%Ep_O=)^)3#@ISFyHmsCDy{PgD6*)3SSPjf&7>V9TgSr*BG`n$03;NxQ?lvm4%X6-t?G#~Q<`rxmqq{ircSK3r35%Rl zS$3k4mpAuHpmE&CqgNn2H!akb)Sj8yT1V4ne~A)rn{v+|@ttuk8ObbsMpJFLU4g=vKLzkFVOHl*wze%bH{7huOh+PSZElXG9i}m)7bK#T@Ga zP4}6hVhd`T2VB|(4F_yT_lhy|0tasre-Onarj@GJ^g@)WqY6HdC?^_rO#yju&?q=ZlYq!Yzg7(Z5;WOGUo3CKbFoA;zMSw_|Cpu&a2y%~7o1>)?hoy>C%I-(zGr4fiWBXe7nQ^a1ZwB_P`b9eV>r#)K=4r4E04qtl^Vz%B>{G8J5 zFBCU#zI=6zSu%wG*=ki7+hY6Q|EIDu|7LSr)b!!{P@0W zul>Axt^Iu8&wAFgzxzmVut2Pdlp_#U$N8Nz4}f|_%8=2rU(_puTPyya^%ueGDH8EZ zmTO0Kby7O|8`^+<{Go?+zSrBG?bL^M&W5u3F{&x2xi}?6`}R6%s_2v(IK9+~^h;%h zlJK*T5_;#()U|enPHvYSIHvL{cwq5%!OtEVXYrCSQzewXwI8_ZX3yIj3bUzD2@xN1 zi;GHZfi5=jO^J&FPHv&0#oU;;dk~h+iv4;8{)_EKShoT%Hp9+$Md2gE!B1I-0<#U& z{?XH(+34RKgTcvZ7#uESGF9^nRPn70&@v0uSE4eueNPHCrFtLRnl7uj^y8~B+yZDB zc73MQBeyQJ^HDbmkQ-nEm2a$bRfF|SAigIxIE+L-f_J%?IX}KSZ5H($dYj>p73%GS zZt3homz?2?=7QihGXneFurNVug$W+vS^^`)Ov+fF*$MHH1aWpj_&tGuIC_Vt#p5a) zvsu2cB_ZcdK6?bLMp*naU7T@3VZ@mVz`$E-99cNqDP@i?LI!*ijn;9J0-CSjL<3Aa zuR_(C=Q?Ze8|rg3oa)sOCZ%6V+a5+=Ds&mQIb}Q zF4jC|XyM3k$FYQ5%8De2l-`us1dVL^q*dQd*NXovzovCQ${u&6D!x8Ng68t*QHOpB zxC7YgCZO$Ylo=I?xJxGg&Qg^-p%i9>Q0bgYgAlERGujrr^4jceU>SW4qxMPD)45M& zM3ctESpUhPZYR4mC|xe2z-DlmJQI6X33g;@b>;!-U4&Vt)z=tQ;8msgZ(ioLFRNf< zqCfLcCxHe)J?RVxC3Ye)0#a>jGgxlmr|;p)gbHAk`SLFKj_`}&`KP^ta}g1=guSoV z{6-p`oH)x{IlLVn|8n0s=_f95YFwW$ucGo}P+ zeDZ#rNKyFKgFPq=v@h-)-;$bdYpI7oY?-*X67cNGt80Q~egN(fl@~(F-4Lm$x!9z{ z7p{DSJGXdwb#5D3T`dmq&?fRH;$)_QpbpiWWi~9SE_6pQI5X!#cl9ciS|1~*MSwWS3IG|geP%wj8`deU;f$2F<0_12ac@V_zTM5qiH zx|_U-`E{6j%B|o&!cU>oz}!7M*|WgR8oBv!OXHZKi7btFZ6PxUwzRT1U&_l|PfFr^ z*0(+mxYTahJCGObQ0#)U8mk)vD0RYS@OBg}FE%D~ok6$fOCM$JoC74Qd2^?HGki>^ z&*>sGRSct?_Q&Wt^Wkvp4?v;xc7q4l)*->E`p=*uUXUW;4|e9-2#$Tj^ry?tWFUJs z(=#ZJU9Y1B(fl`p@A>-Z!lduyP&$JI6A$}f72>;Ov8er@WgAok)V98jnqFuOZwq-A zi|>*}&ex{4!?nHY)eQ5&*Jaz0}_FlTW zSlNc(ZR%+Zy9%VfZb!??k;*;};x2qAz|)}KAtJ)O3P?~Z5;4=!1z&46dID)W7FY`& zSntlqItOCehs#)=1$oM7@JT2PoMyW*`y&DWzRS+}QnrJ;gL5{nx>t|b*sZgJ@iEp5 zlFLwSPyYu#$u3Qm;lZ@mR97d>l^b+ks*PrSj6di!y(~_cD1iUUBCA~@UHij diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/test-with-1-pass.png b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/images/test-with-1-pass.png deleted file mode 100644 index dbbce1a2eec1e99b028ea9736c1f6733a41c8a46..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10213 zcmeHt^;c9~`0t>A3R0qUycl#NT?*1jNl1663_}l6(jg__(B0iB-Q7cjbT^WB^Ii8J zxOd$jFKYqkoH=LjeV+Y%;&~uYK~4e-g9HNtfnZ5Veo}%!Pdm`|9w;*2KX{-`*JVS>Mp!*4o&} zT>n3Db9-YaTYF3Be>|0Dqs|Zrjh57>kIK#od-E>N$`kW{jt;EUsi>&<-x|F!dGkzP zg6rdlU`$Qzj~dEaB?h`NX_-NluWJ+viz~(46@x43Qx1a|AC*06CHRF}{!!BN?N9hn zztP~e1Uq*WBq)f__WD{N9H%D{IwZI;w{tt7z8@+_mx(L#l*)H(^nMQQ;i#QEN{`7G zSA>W6+2q3qQU5omwZYz%118rC@wY$Wdn6ip!o}a^X&}h0ue=+|* zQf`~S&G*;M&v070RaJ2_Gg?eS<_4=o z6bwvEmz6*oGc&WL-|X1w@&|KCQknr4;Nzm~2q(z#Q*-?ib#Jv3_X zSTdtEYV9*87sSNGkmskT4xHcb-1jbSZrqJoiC(5GIIo5>4Bofl2rGLco4+?JNz(;) zq!F;_6hJE7|Ji3oEA31bPxbypAlzW|j>Jq%Oxw+OJIyasyuH1ZKYt$J&XSjxSMzk; z&dpYKbgcR<=vJjVNzU(>Xr@vfd`QFp|12Zr%kcyR6;hK?=F=TvPS+!6@3{2rMjC;M(5$v)Sqqd2x+_@MO zeM;373?hPJVQKjc6LWQ{`Hpi)_+EgN%j!Q4jwoMW)D)P|$?iY-cicY^x&0 z;pXz&sjDEmkC&ex`s+7u=olE%^YSooaBx;uR`|&B^YVhU>m5-Pw6tVDf5ysJElkVF zd5Rbix3XeH_dzM2ku@=)wz09PsjGWIOf03Sh}Y54@tlYik|-x(Z2WGv+O}(cJ~1HR z>CNpe9V4UBN_*f}MuNda{;r5O5|WaVf6R8jp2-W}M%N!Sk$R>}gs&VN6r*8yg7gXs z3L;`RdJ5PJc^(=0Vsv!$@c8&O2!W?3B#c6^_is;>qI5)Z^3c(0S73O!M6vC?jS&~3 zXK=97h<#*qRAj11dt~P_;zJi3zC@qa>Xb{-1+hHzb&dkhwNl3W5vLd3OfD0&LtjQgVj0e}r$?4(6 z0TuyV{U@{Dy?gg?+xB)I+60I(-piNmDIa|*?9~~6$^5FWt&L~WtkNr=saf_T1<8Yo zj()u4gJWT?p`pQ7!TrJAUEpHDjRoL{C{(;al|i%GCKD_I1jC8QWT?OYEk8ekLeO>T z;2^xYS(wuO5ancjpv{Oq;@2%l+fYoRm@YDF2jxw)dm;H9U_jDxG-1HU<~=4$ZF zuneMTdle55{fLwZ5Af(D>zIUm`=ik*%F-QZG!=)DYtF3G!BO?V>)vU@cWThoP zDt3LWj%#3h`zOGK5^{3bXJ==!iF`4C{~9H^Zqr$DktV~>i7)1$IH94TjOt~+!@~-Z zk&!t$Isbux-d@VufTIS>_DlwPy?18Xf`pv3-@&8BSSjZE0nt+|<;Bp&%2>tRhW!wic^v0sR>+a2((Yf)t&c zoUBo968f9X(C?A5i%YE%P$wO?&y9eGrRg$PR##u8EO=b+^$k9Wj*g~PQ&U6B5p+8@ zo23M_jg}Ki%1xgcO~Ppry^XBQ&nqrgdm|pAP*hZ;fiz8W5pTTSuLq-e`}n*{5xU+j z@1x-0=hsANE;PDTgNb;d>$D#}Ckd$2P4ICk$-Y0@%a!#VptCS_%12&?<0 zozUgdW0Rqz0e}u*Z8Yv;NtMv}#yjqyqN0xvn(u{%>qea~_UFGAssf#xDL2Id^7EdX zJL>oE-tCEe7cgYaUe#<)F)$lfpTh+@+S~2gu(%;+UA%7Rj1Ztm*>!clLqeWY%f=1s z3#X6dV2RG|{GEnQZ8;#1y22^thmr&NWFcAdV z?RPu(7zkyV(}9j$l7JL&eQp=~#5h1YHgLg{e{l#z-&Y{bP^{3(?OAR5Q8f5OM3OKV=R*ixTwFpZh41(Y47PT- z+$I~({zKEY@m2ZE9MvCp1i%xH=h@Cwxyb;@)#;WfkXAYtmW>!SotB{?c}>~LTEQY; z!IWvAe{0C}v@~zvBY}5n0V8yP46pbB2TIg@v&I4;U!ULGT`Qw(GblCdD*dirT5N77 z;IVO=0t+M8XeQIiYoL)&Le-e!vzjjP0v@cyY~(d?Ruc!~LfLYOk2IQpS|ck0fuTr( zpR4P5{4;KCZLN@~2QI4PkJn=tpx=D%AMr#2l1JYW#(muRJhKq&y5#j_y2_f=+}s=$ z4J{%e!Cld{3lSF^OX#%VLQ~v$PBJ8L^1S(KqPXa)SHFv}gf^2%z?l`?-f-B8`Ctkk zs)>Im8z;i|C&C(@wWFkkf{Ea9V43nKdZ$YbYgfbg`7(mT!b}bp8XGQGg57V9xl$b_H8r&#FfZYW{7we%NqTyEKGJ2PIfB8Xm5{GrOGwid`fqG) zNm*Mn0c<1F^1;3GGH!pn@g8&ycnnD?spa%=p_O2kCdhv@G}&##_3)gzJNvM~x%v6p zouYck=6pT3kdP3P_7m_)fP2Z2s2V=LjZAzOUokN;zd@m6-WD5GV>@TD?g{w-VD9HL zreyq%1#OPkxHrS8qLsJ&v8gBjIO1hv1)W?Q@6uu}!^ZIc{rd+AA>%D;JKDWR`j1&! zSbS}AudQ0_3?&7*eekn*^=!O$@Y}a`C$(%k??$OM=p z0pKq*W_HiYW~`iDU6nL6Tzfj~M4o4xTZ3f?SjCo7cbHZ zRP%ulfpYgOSocOm^UwdJ3D5{ww0@n)Snuc=9gNvlR-_WbVpAiuLyoGBSp1)R`zSrsLvGi3mEeCXNP zm2UT)n!f-OYyrF-hQfms#3)Gvw@dfo9Su!BkWvTdKq=Gs_;~5;vD}G#HQ*2kg~7AA zYC0}rGGlXd1?vNd?1}q6mS$yXx`#5;x@9cUX(9K45Fb=A6TxZuD-Q%JT<9vNib+uL zHjO=j4|sr@G9SF4owIcpE@Mnzk@(C;~MT4N2c z^h%)0l$AO88zr9yeDE1!@kSh_cVa@tExvm-T(}4_0X*;-=qlu@>B3b|==u0G5{19( zaB^|w0Y4_uw*y#2I(L#Va=Q9+vXJ(JNf<~L){P%9$yDCy)3Ud>ANNFgT;UK*z%)uw zIwN?0bAsFeJd#}psCk_7?(hlhaOvYjrVL@F{hG82aH^n`#xiD)9|r}BioSko)es*AhK1!^6R$A=917LZGqs%dKdS9zTADjZMwY9;uivjz>-&suTpm zn?AKeEacA9=7%+w^a>jXXX-dFH<#-5>lM@4-f5t9&9c)3xf;kpl+(E;b~}SP>=?ln4{BEBOsRry3I+zBph$1hd=t6 zkRS_`8i21qj?D+nMu)YrqGBkVx@DM`E9R{8%`L-&amYxn`Qp2^O zt*qP*w&%eGgWCxOZMC(vKZCMuwKLQZ1Qs-qJb|X*5)=278TWxYn*j!cWn^b_*e!kV z!y*-rW!AQXLesOd{Pf%WA|fM2K74@u`0>N{#}78EY1TT}&O>hp$dJL(AFt;W0z~N} zk|H9H5M0);fsBIS*zHwLm4Wq$hmv%RX3793u?&d&@87?y4x0*o*yKT=bpnu`w_xs8x>@myE0*q`Aiol^d0BjfR7?_I&d%yUk&$9sK2W$wYg+GH zfoiR3%=;si?*BUS>zoiYH@}PY-F7njWZsH&eNBD*nlu@AQivVr7n^`o@Z!o~rvZN-q=H|PLBkA++eOjQIw)m$IO6~-j=!Q}J* z;6Ab=PC0u>bdS7evAgf-qXskGm|6yRZQlBE8;Y3vhY}<99#}aR@E%ozuCwvcK3?U6vT&UkX6lkNcJSep_LrBtse~B z2<(kLdS89J^VLJlGLaE`*1>vKqlORGq)b7eF}sp|Not!|tO7RU`~Iv?<)ickNu{B; zbJ}y7w%!;9H-@a6SnX(CBaJc_VJNvjY;hD+6R!O%e7u$)6BBWj80z^jFw{TtS@>Y_ zm7Z#WO4#~OmBJSS^22!}tTYIm{|Ye5dRg?CJ` zQ2%)Y(fBj)w{tUKWYgO9&Uv14i*T;^cHPEDvRSef-Ztwtf4*QWbKNXOC3Wd~S@k4@ zpn{Z{3+d*14(Gc!-HP7GY+~eDHy+ZgjOi*RG~YU{CpPodPi>3)&H9Rj{MgbfgF@=E z=Gvhkxv^_|*rvL3P8ta}&p^*~eC{!T-BlVpRGJV5E4#N^v|-6M)Z{7qNLbC>0PW*P zb;2_FSJ=0;g3RR9=8z3c7Riu*`|9i!d6@Q?mZ&lO-D+AV8KfThO38UcTy^vqRTl=HEpK}Ht{F@z4IP1 z!U!<(FiLW(>JuL|j-IT<5%$#m?9kk@{btx7it3DB;&88&cAK^}QAmiUg2qT(?b}Rw z!%s=8NF8H0FyK_M@*;A;Y z^Z-kwK_p;{qHSw?jEn~kaTspPesU{%g};wK=;puhhK)92Vcu=b%6xsbKiuUI`NX{B zJ?{9sfJV~`_S6g11>RF^AJHePtLvf$A6^f^&&aw4Dckf|mliq_rQpYwz@QTdG3-Jwo2PbFnQsuoRzH z$=N9*UlvolVP zl(TX+h6XF28nhe#o$km>J(tWVN&8uVsgCN3KKdr-3CPP7J@};Su&Auwb2=}&8X~Pr zfeWa~^CYhhlhjx>76L0>&t!kf+eg=U3rq>39sU(En|I^abOm%qrXzAfzpwCEtiF4h zKsjufZ9;;`I({aJI$saZh6ED%DB5PEm3oInKBp&PAfn((*xVm+cit6spL35R;*Ut* z2v^cj>kVzR%|K{!hsBc7RI`J|Tw{N_u7LDnN)s9X_mGH@H-Xy}VsNOSW!co>bV*lE z`8eJZ-k;!E-M7@Vezc3UL3zQ`-(7{{iuUidfG@4o8cC=u8bdXSb0R{UKqEXTe2kb8 zw-ICBG99ZG+;Z$C?Ip%#_tal*i<__|aCzmDKr8rB$C$$0bQE&vaA9Q9D?7PSl%10m z@FDzz#Xw~ZVy>3?hObjR?A?NJk~P|F+@uo;dZL%Yfr7Y1*m~3Wb&gFQbu}a5sU9oQ z!;tmCj!`O+9n+hob42hrlo{|pzH!e&f+-{{B8;MTCV`k--_e(pzhOOyn< zP-|29_0z-WdKNdzaw>@iO1p21!W)vFHPVz+>REOz>yVxv@BdK3;PxQ}A|X=e3sIO? z_zYqP-f1<>Y1w_=#o*RJ3QPK3KSM}O3QqwS!`UxaY8pA}e*Ta~({pbWg{9T)2e3Wg zW(x?g!F!ATHc~etyu(D_>hIV6JvWxw;HoGX6=r(Vo?8l@cRjkHd1=bn)*-9Qa7Q6# zoW9b{TQKXAiGv|n8rNT&rNMUo(u%LNv~+sso-;-|-G7(jeV%Xg21tF2>Mrg#1@9qJ z=l63d`46Ig!N}_LtAH%UE`ND=dZq+1u}~z!(8ffzok(?8y(ME>DrB28=x>VAdE$&e zNat@KzxD6(NAW?mcPb5QBJc5m%x-)Gyq;zC)mjzwR%^V9>x&7<3b`yTJ?#Nnj~tFN zs%>qtUsCFIW^+vcY7X7Yu0Dw+y%S+M(0Q-^+pLO96cg124R0S`PE`BxJ>sbO<-|+< zanf(xwPO>N49R47zHAYO4=M5t<(W~eDaZA9)AIctSOH&Y&_=PF4yncY@!{)9mS1Il z>`elv?-NPq z%BU9K`jJG`X4J4m;m&?})3SUsLf6EkBptyc*o854&}9Ga)F$tD9*>4y1w0yswK`5Q z=R66fsY#$rXqUE&swrnp)yo}(4t=~(v=Dbnjs1#p#b`}xq2>r{a4OMMewjjt;+lQx zhps<1xn)?9{$MAs)xdmEu|LaDh%>rcqUE&#yWq7tZuoHq1dR#IeiRI;)9ZNhH|F(+)>@q6)~*Ouq3ZF zzBy3TP?gq)QI+16(q>9x%VwqJdM8RarYShryPo_z8gelk5Ph#f+Ed)Wp}b5Nv=bC~ z7??7G45;mqRs4)M<~Bp6 z0*$~Ubr+cp*5%8n0aP4;9Ikh>1>rSgtJZr@T$^>xiRyw5lRPl6qZ;PGO&{!@hwoFr z*9~M{z^PYjh0G>%9%(o;55+4{nXi!aKCeCKHSD; zK8JJaI6qpKEoB4Zt_44YU38>y&yA>MUeJKCx?cgE}yC6V|+cme=W-(7o_Qtu`S&ZyOPqB=WhTaykVuci@ zW3$a0ZthPe(n)K=2FFV-N`lmQdWM~uttOx5p8oV0du7IYDDve`-xecJlbYtm z+f$q^oDa6i3!kpUU;HKh6k_{)l7Jy}Qha~Y>B$iaC<(V`_*(URUP-7e?d;1~D9|Sx zd3a~GJmTZ|wv6g@QH!8T6@9w(qBYK!tw5kOQn68dggcGp2j>q)vc{jKxrVt##aZ%t zlttl9Nq`Tndc{2@AXBGJ=;agrO&r(2d59{1cnLy7MkgpDIfX0ICd#%Qx=V)?1@;8^ z9NZbENMJw=txJ!kkqpnDl7A?XXEikFtQd*~{v4m}e=6ryKh7D;ZrWb6T8 zlJ`5mn|WycWNv5+f7<^h$UW>A#hUCbF>CA5=xQ`)jG}GshV7F(KNVB7H)QlezRB5? zciOizDm9qjalTi*vP!QhB8qBh4@zeUI1kM#tBo9(LC_U2ysb2)CpKkQaP5FCPeo`a z4fx$){nhRk%^uUQsyr`nBG`YM{?v^HSn=2*ZnM{ePOp8^uN~hN5$foDRn%o6bq0ZyMkivk!(R?>7HW)VWG~R@Kd^we?b5a^)V>P?JQ>-?3a+ z)5>agfouD)hecR_VbUdm2cA}$h#)^7;lHue^(us#mH(o^shu(@LM{S6nwypVVCs~dS|cq)8mJ{R`bpD^Yt-SxL#T=Q(9rMBW=5gLK=$vEi4~f1)(&`vPH=ZO3 ze-^r#wV4LQ5p$AG(l}yAvwHTVY-6m}f9_v{t`zt)dh4@p88H+Gy{h<`nCAR5^n1g~ zpr$jI^}-p=S+{C6wu5^j*KWE2s%)NYPS!r%0DO@fM3mm%X7;8!Y`--4K%z*Cs{Q-V zU>ldpb&Z^R-k{eH?E-&GMAhz%B2?U5=W09}!Ug#Ul~|0o)B_b9^dn(#^{v<&bsc@QZvxlctR HdfxvF-at|1 diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/index.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/index.html deleted file mode 100644 index 4a7d4b5..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/index.html +++ /dev/null @@ -1,192 +0,0 @@ - - - -SimpleTest - Unit Testing for PHP - - - - - - - - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/js/jquery-1.2.1.pack.js b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/js/jquery-1.2.1.pack.js deleted file mode 100644 index d646859..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/js/jquery-1.2.1.pack.js +++ /dev/null @@ -1,11 +0,0 @@ -/* - * jQuery 1.2.1 - New Wave Javascript - * - * Copyright (c) 2007 John Resig (jquery.com) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $ - * $Rev: 3353 $ - */ -eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(G(){9(1m E!="W")H w=E;H E=18.15=G(a,b){I 6 7u E?6.5N(a,b):1u E(a,b)};9(1m $!="W")H D=$;18.$=E;H u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;E.1b=E.3A={5N:G(c,a){c=c||U;9(1m c=="1M"){H m=u.2S(c);9(m&&(m[1]||!a)){9(m[1])c=E.4D([m[1]],a);J{H b=U.3S(m[3]);9(b)9(b.22!=m[3])I E().1Y(c);J{6[0]=b;6.K=1;I 6}J c=[]}}J I 1u E(a).1Y(c)}J 9(E.1n(c))I 1u E(U)[E.1b.2d?"2d":"39"](c);I 6.6v(c.1c==1B&&c||(c.4c||c.K&&c!=18&&!c.1y&&c[0]!=W&&c[0].1y)&&E.2h(c)||[c])},4c:"1.2.1",7Y:G(){I 6.K},K:0,21:G(a){I a==W?E.2h(6):6[a]},2o:G(a){H b=E(a);b.4Y=6;I b},6v:G(a){6.K=0;1B.3A.1a.16(6,a);I 6},N:G(a,b){I E.N(6,a,b)},4I:G(a){H b=-1;6.N(G(i){9(6==a)b=i});I b},1x:G(f,d,e){H c=f;9(f.1c==3X)9(d==W)I 6.K&&E[e||"1x"](6[0],f)||W;J{c={};c[f]=d}I 6.N(G(a){L(H b 1i c)E.1x(e?6.R:6,b,E.1e(6,c[b],e,a,b))})},17:G(b,a){I 6.1x(b,a,"3C")},2g:G(e){9(1m e!="5i"&&e!=S)I 6.4n().3g(U.6F(e));H t="";E.N(e||6,G(){E.N(6.3j,G(){9(6.1y!=8)t+=6.1y!=1?6.6x:E.1b.2g([6])})});I t},5m:G(b){9(6[0])E(b,6[0].3H).6u().3d(6[0]).1X(G(){H a=6;1W(a.1w)a=a.1w;I a}).3g(6);I 6},8m:G(a){I 6.N(G(){E(6).6q().5m(a)})},8d:G(a){I 6.N(G(){E(6).5m(a)})},3g:G(){I 6.3z(1q,Q,1,G(a){6.58(a)})},6j:G(){I 6.3z(1q,Q,-1,G(a){6.3d(a,6.1w)})},6g:G(){I 6.3z(1q,P,1,G(a){6.12.3d(a,6)})},50:G(){I 6.3z(1q,P,-1,G(a){6.12.3d(a,6.2q)})},2D:G(){I 6.4Y||E([])},1Y:G(t){H b=E.1X(6,G(a){I E.1Y(t,a)});I 6.2o(/[^+>] [^+>]/.14(t)||t.1g("..")>-1?E.4V(b):b)},6u:G(e){H f=6.1X(G(){I 6.67?E(6.67)[0]:6.4R(Q)});H d=f.1Y("*").4O().N(G(){9(6[F]!=W)6[F]=S});9(e===Q)6.1Y("*").4O().N(G(i){H c=E.M(6,"2P");L(H a 1i c)L(H b 1i c[a])E.1j.1f(d[i],a,c[a][b],c[a][b].M)});I f},1E:G(t){I 6.2o(E.1n(t)&&E.2W(6,G(b,a){I t.16(b,[a])})||E.3m(t,6))},5V:G(t){I 6.2o(t.1c==3X&&E.3m(t,6,Q)||E.2W(6,G(a){I(t.1c==1B||t.4c)?E.2A(a,t)<0:a!=t}))},1f:G(t){I 6.2o(E.1R(6.21(),t.1c==3X?E(t).21():t.K!=W&&(!t.11||E.11(t,"2Y"))?t:[t]))},3t:G(a){I a?E.3m(a,6).K>0:P},7c:G(a){I 6.3t("."+a)},3i:G(b){9(b==W){9(6.K){H c=6[0];9(E.11(c,"24")){H e=c.4Z,a=[],Y=c.Y,2G=c.O=="24-2G";9(e<0)I S;L(H i=2G?e:0,33=2G?e+1:Y.K;i<33;i++){H d=Y[i];9(d.26){H b=E.V.1h&&!d.9V["1Q"].9L?d.2g:d.1Q;9(2G)I b;a.1a(b)}}I a}J I 6[0].1Q.1p(/\\r/g,"")}}J I 6.N(G(){9(b.1c==1B&&/4k|5j/.14(6.O))6.2Q=(E.2A(6.1Q,b)>=0||E.2A(6.2H,b)>=0);J 9(E.11(6,"24")){H a=b.1c==1B?b:[b];E("9h",6).N(G(){6.26=(E.2A(6.1Q,a)>=0||E.2A(6.2g,a)>=0)});9(!a.K)6.4Z=-1}J 6.1Q=b})},4o:G(a){I a==W?(6.K?6[0].3O:S):6.4n().3g(a)},6H:G(a){I 6.50(a).28()},6E:G(i){I 6.2J(i,i+1)},2J:G(){I 6.2o(1B.3A.2J.16(6,1q))},1X:G(b){I 6.2o(E.1X(6,G(a,i){I b.2O(a,i,a)}))},4O:G(){I 6.1f(6.4Y)},3z:G(f,d,g,e){H c=6.K>1,a;I 6.N(G(){9(!a){a=E.4D(f,6.3H);9(g<0)a.8U()}H b=6;9(d&&E.11(6,"1I")&&E.11(a[0],"4m"))b=6.4l("1K")[0]||6.58(U.5B("1K"));E.N(a,G(){H a=c?6.4R(Q):6;9(!5A(0,a))e.2O(b,a)})})}};G 5A(i,b){H a=E.11(b,"1J");9(a){9(b.3k)E.3G({1d:b.3k,3e:P,1V:"1J"});J E.5f(b.2g||b.6s||b.3O||"");9(b.12)b.12.3b(b)}J 9(b.1y==1)E("1J",b).N(5A);I a}E.1k=E.1b.1k=G(){H c=1q[0]||{},a=1,2c=1q.K,5e=P;9(c.1c==8o){5e=c;c=1q[1]||{}}9(2c==1){c=6;a=0}H b;L(;a<2c;a++)9((b=1q[a])!=S)L(H i 1i b){9(c==b[i])6r;9(5e&&1m b[i]==\'5i\'&&c[i])E.1k(c[i],b[i]);J 9(b[i]!=W)c[i]=b[i]}I c};H F="15"+(1u 3D()).3B(),6p=0,5c={};E.1k({8a:G(a){18.$=D;9(a)18.15=w;I E},1n:G(a){I!!a&&1m a!="1M"&&!a.11&&a.1c!=1B&&/G/i.14(a+"")},4a:G(a){I a.2V&&!a.1G||a.37&&a.3H&&!a.3H.1G},5f:G(a){a=E.36(a);9(a){9(18.6l)18.6l(a);J 9(E.V.1N)18.56(a,0);J 3w.2O(18,a)}},11:G(b,a){I b.11&&b.11.27()==a.27()},1L:{},M:G(c,d,b){c=c==18?5c:c;H a=c[F];9(!a)a=c[F]=++6p;9(d&&!E.1L[a])E.1L[a]={};9(b!=W)E.1L[a][d]=b;I d?E.1L[a][d]:a},30:G(c,b){c=c==18?5c:c;H a=c[F];9(b){9(E.1L[a]){2E E.1L[a][b];b="";L(b 1i E.1L[a])1T;9(!b)E.30(c)}}J{2a{2E c[F]}29(e){9(c.53)c.53(F)}2E E.1L[a]}},N:G(a,b,c){9(c){9(a.K==W)L(H i 1i a)b.16(a[i],c);J L(H i=0,48=a.K;i<48;i++)9(b.16(a[i],c)===P)1T}J{9(a.K==W)L(H i 1i a)b.2O(a[i],i,a[i]);J L(H i=0,48=a.K,3i=a[0];i<48&&b.2O(3i,i,3i)!==P;3i=a[++i]){}}I a},1e:G(c,b,d,e,a){9(E.1n(b))b=b.2O(c,[e]);H f=/z-?4I|7T-?7Q|1r|69|7P-?1H/i;I b&&b.1c==4W&&d=="3C"&&!f.14(a)?b+"2T":b},1o:{1f:G(b,c){E.N((c||"").2l(/\\s+/),G(i,a){9(!E.1o.3K(b.1o,a))b.1o+=(b.1o?" ":"")+a})},28:G(b,c){b.1o=c!=W?E.2W(b.1o.2l(/\\s+/),G(a){I!E.1o.3K(c,a)}).66(" "):""},3K:G(t,c){I E.2A(c,(t.1o||t).3s().2l(/\\s+/))>-1}},2k:G(e,o,f){L(H i 1i o){e.R["3r"+i]=e.R[i];e.R[i]=o[i]}f.16(e,[]);L(H i 1i o)e.R[i]=e.R["3r"+i]},17:G(e,p){9(p=="1H"||p=="2N"){H b={},42,41,d=["7J","7I","7G","7F"];E.N(d,G(){b["7C"+6]=0;b["7B"+6+"5Z"]=0});E.2k(e,b,G(){9(E(e).3t(\':3R\')){42=e.7A;41=e.7w}J{e=E(e.4R(Q)).1Y(":4k").5W("2Q").2D().17({4C:"1P",2X:"4F",19:"2Z",7o:"0",1S:"0"}).5R(e.12)[0];H a=E.17(e.12,"2X")||"3V";9(a=="3V")e.12.R.2X="7g";42=e.7e;41=e.7b;9(a=="3V")e.12.R.2X="3V";e.12.3b(e)}});I p=="1H"?42:41}I E.3C(e,p)},3C:G(h,j,i){H g,2w=[],2k=[];G 3n(a){9(!E.V.1N)I P;H b=U.3o.3Z(a,S);I!b||b.4y("3n")==""}9(j=="1r"&&E.V.1h){g=E.1x(h.R,"1r");I g==""?"1":g}9(j.1t(/4u/i))j=y;9(!i&&h.R[j])g=h.R[j];J 9(U.3o&&U.3o.3Z){9(j.1t(/4u/i))j="4u";j=j.1p(/([A-Z])/g,"-$1").2p();H d=U.3o.3Z(h,S);9(d&&!3n(h))g=d.4y(j);J{L(H a=h;a&&3n(a);a=a.12)2w.4w(a);L(a=0;a<2w.K;a++)9(3n(2w[a])){2k[a]=2w[a].R.19;2w[a].R.19="2Z"}g=j=="19"&&2k[2w.K-1]!=S?"2s":U.3o.3Z(h,S).4y(j)||"";L(a=0;a<2k.K;a++)9(2k[a]!=S)2w[a].R.19=2k[a]}9(j=="1r"&&g=="")g="1"}J 9(h.3Q){H f=j.1p(/\\-(\\w)/g,G(m,c){I c.27()});g=h.3Q[j]||h.3Q[f];9(!/^\\d+(2T)?$/i.14(g)&&/^\\d/.14(g)){H k=h.R.1S;H e=h.4v.1S;h.4v.1S=h.3Q.1S;h.R.1S=g||0;g=h.R.71+"2T";h.R.1S=k;h.4v.1S=e}}I g},4D:G(a,e){H r=[];e=e||U;E.N(a,G(i,d){9(!d)I;9(d.1c==4W)d=d.3s();9(1m d=="1M"){d=d.1p(/(<(\\w+)[^>]*?)\\/>/g,G(m,a,b){I b.1t(/^(70|6Z|6Y|9Q|4t|9N|9K|3a|9G|9E)$/i)?m:a+">"});H s=E.36(d).2p(),1s=e.5B("1s"),2x=[];H c=!s.1g("<9y")&&[1,"<24>",""]||!s.1g("<9w")&&[1,"<6T>",""]||s.1t(/^<(9u|1K|9t|9r|9p)/)&&[1,"<1I>",""]||!s.1g("<4m")&&[2,"<1I><1K>",""]||(!s.1g("<9m")||!s.1g("<9k"))&&[3,"<1I><1K><4m>",""]||!s.1g("<6Y")&&[2,"<1I><1K><6L>",""]||E.V.1h&&[1,"1s<1s>",""]||[0,"",""];1s.3O=c[1]+d+c[2];1W(c[0]--)1s=1s.5p;9(E.V.1h){9(!s.1g("<1I")&&s.1g("<1K")<0)2x=1s.1w&&1s.1w.3j;J 9(c[1]=="<1I>"&&s.1g("<1K")<0)2x=1s.3j;L(H n=2x.K-1;n>=0;--n)9(E.11(2x[n],"1K")&&!2x[n].3j.K)2x[n].12.3b(2x[n]);9(/^\\s/.14(d))1s.3d(e.6F(d.1t(/^\\s*/)[0]),1s.1w)}d=E.2h(1s.3j)}9(0===d.K&&(!E.11(d,"2Y")&&!E.11(d,"24")))I;9(d[0]==W||E.11(d,"2Y")||d.Y)r.1a(d);J r=E.1R(r,d)});I r},1x:G(c,d,a){H e=E.4a(c)?{}:E.5o;9(d=="26"&&E.V.1N)c.12.4Z;9(e[d]){9(a!=W)c[e[d]]=a;I c[e[d]]}J 9(E.V.1h&&d=="R")I E.1x(c.R,"9e",a);J 9(a==W&&E.V.1h&&E.11(c,"2Y")&&(d=="9d"||d=="9a"))I c.97(d).6x;J 9(c.37){9(a!=W){9(d=="O"&&E.11(c,"4t")&&c.12)6G"O 94 93\'t 92 91";c.90(d,a)}9(E.V.1h&&/6C|3k/.14(d)&&!E.4a(c))I c.4p(d,2);I c.4p(d)}J{9(d=="1r"&&E.V.1h){9(a!=W){c.69=1;c.1E=(c.1E||"").1p(/6O\\([^)]*\\)/,"")+(3I(a).3s()=="8S"?"":"6O(1r="+a*6A+")")}I c.1E?(3I(c.1E.1t(/1r=([^)]*)/)[1])/6A).3s():""}d=d.1p(/-([a-z])/8Q,G(z,b){I b.27()});9(a!=W)c[d]=a;I c[d]}},36:G(t){I(t||"").1p(/^\\s+|\\s+$/g,"")},2h:G(a){H r=[];9(1m a!="8P")L(H i=0,2c=a.K;i<2c;i++)r.1a(a[i]);J r=a.2J(0);I r},2A:G(b,a){L(H i=0,2c=a.K;i<2c;i++)9(a[i]==b)I i;I-1},1R:G(a,b){9(E.V.1h){L(H i=0;b[i];i++)9(b[i].1y!=8)a.1a(b[i])}J L(H i=0;b[i];i++)a.1a(b[i]);I a},4V:G(b){H r=[],2f={};2a{L(H i=0,6y=b.K;i<6y;i++){H a=E.M(b[i]);9(!2f[a]){2f[a]=Q;r.1a(b[i])}}}29(e){r=b}I r},2W:G(b,a,c){9(1m a=="1M")a=3w("P||G(a,i){I "+a+"}");H d=[];L(H i=0,4g=b.K;i<4g;i++)9(!c&&a(b[i],i)||c&&!a(b[i],i))d.1a(b[i]);I d},1X:G(c,b){9(1m b=="1M")b=3w("P||G(a){I "+b+"}");H d=[];L(H i=0,4g=c.K;i<4g;i++){H a=b(c[i],i);9(a!==S&&a!=W){9(a.1c!=1B)a=[a];d=d.8M(a)}}I d}});H v=8K.8I.2p();E.V={4s:(v.1t(/.+(?:8F|8E|8C|8B)[\\/: ]([\\d.]+)/)||[])[1],1N:/6w/.14(v),34:/34/.14(v),1h:/1h/.14(v)&&!/34/.14(v),35:/35/.14(v)&&!/(8z|6w)/.14(v)};H y=E.V.1h?"4h":"5h";E.1k({5g:!E.V.1h||U.8y=="8x",4h:E.V.1h?"4h":"5h",5o:{"L":"8w","8v":"1o","4u":y,5h:y,4h:y,3O:"3O",1o:"1o",1Q:"1Q",3c:"3c",2Q:"2Q",8u:"8t",26:"26",8s:"8r"}});E.N({1D:"a.12",8q:"15.4e(a,\'12\')",8p:"15.2I(a,2,\'2q\')",8n:"15.2I(a,2,\'4d\')",8l:"15.4e(a,\'2q\')",8k:"15.4e(a,\'4d\')",8j:"15.5d(a.12.1w,a)",8i:"15.5d(a.1w)",6q:"15.11(a,\'8h\')?a.8f||a.8e.U:15.2h(a.3j)"},G(i,n){E.1b[i]=G(a){H b=E.1X(6,n);9(a&&1m a=="1M")b=E.3m(a,b);I 6.2o(E.4V(b))}});E.N({5R:"3g",8c:"6j",3d:"6g",8b:"50",89:"6H"},G(i,n){E.1b[i]=G(){H a=1q;I 6.N(G(){L(H j=0,2c=a.K;j<2c;j++)E(a[j])[n](6)})}});E.N({5W:G(a){E.1x(6,a,"");6.53(a)},88:G(c){E.1o.1f(6,c)},87:G(c){E.1o.28(6,c)},86:G(c){E.1o[E.1o.3K(6,c)?"28":"1f"](6,c)},28:G(a){9(!a||E.1E(a,[6]).r.K){E.30(6);6.12.3b(6)}},4n:G(){E("*",6).N(G(){E.30(6)});1W(6.1w)6.3b(6.1w)}},G(i,n){E.1b[i]=G(){I 6.N(n,1q)}});E.N(["85","5Z"],G(i,a){H n=a.2p();E.1b[n]=G(h){I 6[0]==18?E.V.1N&&3y["84"+a]||E.5g&&38.33(U.2V["5a"+a],U.1G["5a"+a])||U.1G["5a"+a]:6[0]==U?38.33(U.1G["6n"+a],U.1G["6m"+a]):h==W?(6.K?E.17(6[0],n):S):6.17(n,h.1c==3X?h:h+"2T")}});H C=E.V.1N&&3x(E.V.4s)<83?"(?:[\\\\w*57-]|\\\\\\\\.)":"(?:[\\\\w\\82-\\81*57-]|\\\\\\\\.)",6k=1u 47("^>\\\\s*("+C+"+)"),6i=1u 47("^("+C+"+)(#)("+C+"+)"),6h=1u 47("^([#.]?)("+C+"*)");E.1k({55:{"":"m[2]==\'*\'||15.11(a,m[2])","#":"a.4p(\'22\')==m[2]",":":{80:"im[3]-0",2I:"m[3]-0==i",6E:"m[3]-0==i",3v:"i==0",3u:"i==r.K-1",6f:"i%2==0",6e:"i%2","3v-46":"a.12.4l(\'*\')[0]==a","3u-46":"15.2I(a.12.5p,1,\'4d\')==a","7X-46":"!15.2I(a.12.5p,2,\'4d\')",1D:"a.1w",4n:"!a.1w",7W:"(a.6s||a.7V||15(a).2g()||\'\').1g(m[3])>=0",3R:\'"1P"!=a.O&&15.17(a,"19")!="2s"&&15.17(a,"4C")!="1P"\',1P:\'"1P"==a.O||15.17(a,"19")=="2s"||15.17(a,"4C")=="1P"\',7U:"!a.3c",3c:"a.3c",2Q:"a.2Q",26:"a.26||15.1x(a,\'26\')",2g:"\'2g\'==a.O",4k:"\'4k\'==a.O",5j:"\'5j\'==a.O",54:"\'54\'==a.O",52:"\'52\'==a.O",51:"\'51\'==a.O",6d:"\'6d\'==a.O",6c:"\'6c\'==a.O",2r:\'"2r"==a.O||15.11(a,"2r")\',4t:"/4t|24|6b|2r/i.14(a.11)",3K:"15.1Y(m[3],a).K",7S:"/h\\\\d/i.14(a.11)",7R:"15.2W(15.32,G(1b){I a==1b.T;}).K"}},6a:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1u 47("^([:.#]*)("+C+"+)")],3m:G(a,c,b){H d,2b=[];1W(a&&a!=d){d=a;H f=E.1E(a,c,b);a=f.t.1p(/^\\s*,\\s*/,"");2b=b?c=f.r:E.1R(2b,f.r)}I 2b},1Y:G(t,o){9(1m t!="1M")I[t];9(o&&!o.1y)o=S;o=o||U;H d=[o],2f=[],3u;1W(t&&3u!=t){H r=[];3u=t;t=E.36(t);H l=P;H g=6k;H m=g.2S(t);9(m){H p=m[1].27();L(H i=0;d[i];i++)L(H c=d[i].1w;c;c=c.2q)9(c.1y==1&&(p=="*"||c.11.27()==p.27()))r.1a(c);d=r;t=t.1p(g,"");9(t.1g(" ")==0)6r;l=Q}J{g=/^([>+~])\\s*(\\w*)/i;9((m=g.2S(t))!=S){r=[];H p=m[2],1R={};m=m[1];L(H j=0,31=d.K;j<31;j++){H n=m=="~"||m=="+"?d[j].2q:d[j].1w;L(;n;n=n.2q)9(n.1y==1){H h=E.M(n);9(m=="~"&&1R[h])1T;9(!p||n.11.27()==p.27()){9(m=="~")1R[h]=Q;r.1a(n)}9(m=="+")1T}}d=r;t=E.36(t.1p(g,""));l=Q}}9(t&&!l){9(!t.1g(",")){9(o==d[0])d.44();2f=E.1R(2f,d);r=d=[o];t=" "+t.68(1,t.K)}J{H k=6i;H m=k.2S(t);9(m){m=[0,m[2],m[3],m[1]]}J{k=6h;m=k.2S(t)}m[2]=m[2].1p(/\\\\/g,"");H f=d[d.K-1];9(m[1]=="#"&&f&&f.3S&&!E.4a(f)){H q=f.3S(m[2]);9((E.V.1h||E.V.34)&&q&&1m q.22=="1M"&&q.22!=m[2])q=E(\'[@22="\'+m[2]+\'"]\',f)[0];d=r=q&&(!m[3]||E.11(q,m[3]))?[q]:[]}J{L(H i=0;d[i];i++){H a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];9(a=="*"&&d[i].11.2p()=="5i")a="3a";r=E.1R(r,d[i].4l(a))}9(m[1]==".")r=E.4X(r,m[2]);9(m[1]=="#"){H e=[];L(H i=0;r[i];i++)9(r[i].4p("22")==m[2]){e=[r[i]];1T}r=e}d=r}t=t.1p(k,"")}}9(t){H b=E.1E(t,r);d=r=b.r;t=E.36(b.t)}}9(t)d=[];9(d&&o==d[0])d.44();2f=E.1R(2f,d);I 2f},4X:G(r,m,a){m=" "+m+" ";H c=[];L(H i=0;r[i];i++){H b=(" "+r[i].1o+" ").1g(m)>=0;9(!a&&b||a&&!b)c.1a(r[i])}I c},1E:G(t,r,h){H d;1W(t&&t!=d){d=t;H p=E.6a,m;L(H i=0;p[i];i++){m=p[i].2S(t);9(m){t=t.7O(m[0].K);m[2]=m[2].1p(/\\\\/g,"");1T}}9(!m)1T;9(m[1]==":"&&m[2]=="5V")r=E.1E(m[3],r,Q).r;J 9(m[1]==".")r=E.4X(r,m[2],h);J 9(m[1]=="["){H g=[],O=m[3];L(H i=0,31=r.K;i<31;i++){H a=r[i],z=a[E.5o[m[2]]||m[2]];9(z==S||/6C|3k|26/.14(m[2]))z=E.1x(a,m[2])||\'\';9((O==""&&!!z||O=="="&&z==m[5]||O=="!="&&z!=m[5]||O=="^="&&z&&!z.1g(m[5])||O=="$="&&z.68(z.K-m[5].K)==m[5]||(O=="*="||O=="~=")&&z.1g(m[5])>=0)^h)g.1a(a)}r=g}J 9(m[1]==":"&&m[2]=="2I-46"){H e={},g=[],14=/(\\d*)n\\+?(\\d*)/.2S(m[3]=="6f"&&"2n"||m[3]=="6e"&&"2n+1"||!/\\D/.14(m[3])&&"n+"+m[3]||m[3]),3v=(14[1]||1)-0,d=14[2]-0;L(H i=0,31=r.K;i<31;i++){H j=r[i],12=j.12,22=E.M(12);9(!e[22]){H c=1;L(H n=12.1w;n;n=n.2q)9(n.1y==1)n.4U=c++;e[22]=Q}H b=P;9(3v==1){9(d==0||j.4U==d)b=Q}J 9((j.4U+d)%3v==0)b=Q;9(b^h)g.1a(j)}r=g}J{H f=E.55[m[1]];9(1m f!="1M")f=E.55[m[1]][m[2]];f=3w("P||G(a,i){I "+f+"}");r=E.2W(r,f,h)}}I{r:r,t:t}},4e:G(b,c){H d=[];H a=b[c];1W(a&&a!=U){9(a.1y==1)d.1a(a);a=a[c]}I d},2I:G(a,e,c,b){e=e||1;H d=0;L(;a;a=a[c])9(a.1y==1&&++d==e)1T;I a},5d:G(n,a){H r=[];L(;n;n=n.2q){9(n.1y==1&&(!a||n!=a))r.1a(n)}I r}});E.1j={1f:G(g,e,c,h){9(E.V.1h&&g.4j!=W)g=18;9(!c.2u)c.2u=6.2u++;9(h!=W){H d=c;c=G(){I d.16(6,1q)};c.M=h;c.2u=d.2u}H i=e.2l(".");e=i[0];c.O=i[1];H b=E.M(g,"2P")||E.M(g,"2P",{});H f=E.M(g,"2t",G(){H a;9(1m E=="W"||E.1j.4T)I a;a=E.1j.2t.16(g,1q);I a});H j=b[e];9(!j){j=b[e]={};9(g.4S)g.4S(e,f,P);J g.7N("43"+e,f)}j[c.2u]=c;6.1Z[e]=Q},2u:1,1Z:{},28:G(d,c,b){H e=E.M(d,"2P"),2L,4I;9(1m c=="1M"){H a=c.2l(".");c=a[0]}9(e){9(c&&c.O){b=c.4Q;c=c.O}9(!c){L(c 1i e)6.28(d,c)}J 9(e[c]){9(b)2E e[c][b.2u];J L(b 1i e[c])9(!a[1]||e[c][b].O==a[1])2E e[c][b];L(2L 1i e[c])1T;9(!2L){9(d.4P)d.4P(c,E.M(d,"2t"),P);J d.7M("43"+c,E.M(d,"2t"));2L=S;2E e[c]}}L(2L 1i e)1T;9(!2L){E.30(d,"2P");E.30(d,"2t")}}},1F:G(d,b,e,c,f){b=E.2h(b||[]);9(!e){9(6.1Z[d])E("*").1f([18,U]).1F(d,b)}J{H a,2L,1b=E.1n(e[d]||S),4N=!b[0]||!b[0].2M;9(4N)b.4w(6.4M({O:d,2m:e}));b[0].O=d;9(E.1n(E.M(e,"2t")))a=E.M(e,"2t").16(e,b);9(!1b&&e["43"+d]&&e["43"+d].16(e,b)===P)a=P;9(4N)b.44();9(f&&f.16(e,b)===P)a=P;9(1b&&c!==P&&a!==P&&!(E.11(e,\'a\')&&d=="4L")){6.4T=Q;e[d]()}6.4T=P}I a},2t:G(d){H a;d=E.1j.4M(d||18.1j||{});H b=d.O.2l(".");d.O=b[0];H c=E.M(6,"2P")&&E.M(6,"2P")[d.O],3q=1B.3A.2J.2O(1q,1);3q.4w(d);L(H j 1i c){3q[0].4Q=c[j];3q[0].M=c[j].M;9(!b[1]||c[j].O==b[1]){H e=c[j].16(6,3q);9(a!==P)a=e;9(e===P){d.2M();d.3p()}}}9(E.V.1h)d.2m=d.2M=d.3p=d.4Q=d.M=S;I a},4M:G(c){H a=c;c=E.1k({},a);c.2M=G(){9(a.2M)a.2M();a.7L=P};c.3p=G(){9(a.3p)a.3p();a.7K=Q};9(!c.2m&&c.65)c.2m=c.65;9(E.V.1N&&c.2m.1y==3)c.2m=a.2m.12;9(!c.4K&&c.4J)c.4K=c.4J==c.2m?c.7H:c.4J;9(c.64==S&&c.63!=S){H e=U.2V,b=U.1G;c.64=c.63+(e&&e.2R||b.2R||0);c.7E=c.7D+(e&&e.2B||b.2B||0)}9(!c.3Y&&(c.61||c.60))c.3Y=c.61||c.60;9(!c.5F&&c.5D)c.5F=c.5D;9(!c.3Y&&c.2r)c.3Y=(c.2r&1?1:(c.2r&2?3:(c.2r&4?2:0)));I c}};E.1b.1k({3W:G(c,a,b){I c=="5Y"?6.2G(c,a,b):6.N(G(){E.1j.1f(6,c,b||a,b&&a)})},2G:G(d,b,c){I 6.N(G(){E.1j.1f(6,d,G(a){E(6).5X(a);I(c||b).16(6,1q)},c&&b)})},5X:G(a,b){I 6.N(G(){E.1j.28(6,a,b)})},1F:G(c,a,b){I 6.N(G(){E.1j.1F(c,a,6,Q,b)})},7x:G(c,a,b){9(6[0])I E.1j.1F(c,a,6[0],P,b)},25:G(){H a=1q;I 6.4L(G(e){6.4H=0==6.4H?1:0;e.2M();I a[6.4H].16(6,[e])||P})},7v:G(f,g){G 4G(e){H p=e.4K;1W(p&&p!=6)2a{p=p.12}29(e){p=6};9(p==6)I P;I(e.O=="4x"?f:g).16(6,[e])}I 6.4x(4G).5U(4G)},2d:G(f){5T();9(E.3T)f.16(U,[E]);J E.3l.1a(G(){I f.16(6,[E])});I 6}});E.1k({3T:P,3l:[],2d:G(){9(!E.3T){E.3T=Q;9(E.3l){E.N(E.3l,G(){6.16(U)});E.3l=S}9(E.V.35||E.V.34)U.4P("5S",E.2d,P);9(!18.7t.K)E(18).39(G(){E("#4E").28()})}}});E.N(("7s,7r,39,7q,6n,5Y,4L,7p,"+"7n,7m,7l,4x,5U,7k,24,"+"51,7j,7i,7h,3U").2l(","),G(i,o){E.1b[o]=G(f){I f?6.3W(o,f):6.1F(o)}});H x=P;G 5T(){9(x)I;x=Q;9(E.V.35||E.V.34)U.4S("5S",E.2d,P);J 9(E.V.1h){U.7f("<7d"+"7y 22=4E 7z=Q "+"3k=//:><\\/1J>");H a=U.3S("4E");9(a)a.62=G(){9(6.2C!="1l")I;E.2d()};a=S}J 9(E.V.1N)E.4B=4j(G(){9(U.2C=="5Q"||U.2C=="1l"){4A(E.4B);E.4B=S;E.2d()}},10);E.1j.1f(18,"39",E.2d)}E.1b.1k({39:G(g,d,c){9(E.1n(g))I 6.3W("39",g);H e=g.1g(" ");9(e>=0){H i=g.2J(e,g.K);g=g.2J(0,e)}c=c||G(){};H f="4z";9(d)9(E.1n(d)){c=d;d=S}J{d=E.3a(d);f="5P"}H h=6;E.3G({1d:g,O:f,M:d,1l:G(a,b){9(b=="1C"||b=="5O")h.4o(i?E("<1s/>").3g(a.40.1p(/<1J(.|\\s)*?\\/1J>/g,"")).1Y(i):a.40);56(G(){h.N(c,[a.40,b,a])},13)}});I 6},7a:G(){I E.3a(6.5M())},5M:G(){I 6.1X(G(){I E.11(6,"2Y")?E.2h(6.79):6}).1E(G(){I 6.2H&&!6.3c&&(6.2Q||/24|6b/i.14(6.11)||/2g|1P|52/i.14(6.O))}).1X(G(i,c){H b=E(6).3i();I b==S?S:b.1c==1B?E.1X(b,G(a,i){I{2H:c.2H,1Q:a}}):{2H:c.2H,1Q:b}}).21()}});E.N("5L,5K,6t,5J,5I,5H".2l(","),G(i,o){E.1b[o]=G(f){I 6.3W(o,f)}});H B=(1u 3D).3B();E.1k({21:G(d,b,a,c){9(E.1n(b)){a=b;b=S}I E.3G({O:"4z",1d:d,M:b,1C:a,1V:c})},78:G(b,a){I E.21(b,S,a,"1J")},77:G(c,b,a){I E.21(c,b,a,"45")},76:G(d,b,a,c){9(E.1n(b)){a=b;b={}}I E.3G({O:"5P",1d:d,M:b,1C:a,1V:c})},75:G(a){E.1k(E.59,a)},59:{1Z:Q,O:"4z",2z:0,5G:"74/x-73-2Y-72",6o:Q,3e:Q,M:S},49:{},3G:G(s){H f,2y=/=(\\?|%3F)/g,1v,M;s=E.1k(Q,s,E.1k(Q,{},E.59,s));9(s.M&&s.6o&&1m s.M!="1M")s.M=E.3a(s.M);9(s.1V=="4b"){9(s.O.2p()=="21"){9(!s.1d.1t(2y))s.1d+=(s.1d.1t(/\\?/)?"&":"?")+(s.4b||"5E")+"=?"}J 9(!s.M||!s.M.1t(2y))s.M=(s.M?s.M+"&":"")+(s.4b||"5E")+"=?";s.1V="45"}9(s.1V=="45"&&(s.M&&s.M.1t(2y)||s.1d.1t(2y))){f="4b"+B++;9(s.M)s.M=s.M.1p(2y,"="+f);s.1d=s.1d.1p(2y,"="+f);s.1V="1J";18[f]=G(a){M=a;1C();1l();18[f]=W;2a{2E 18[f]}29(e){}}}9(s.1V=="1J"&&s.1L==S)s.1L=P;9(s.1L===P&&s.O.2p()=="21")s.1d+=(s.1d.1t(/\\?/)?"&":"?")+"57="+(1u 3D()).3B();9(s.M&&s.O.2p()=="21"){s.1d+=(s.1d.1t(/\\?/)?"&":"?")+s.M;s.M=S}9(s.1Z&&!E.5b++)E.1j.1F("5L");9(!s.1d.1g("8g")&&s.1V=="1J"){H h=U.4l("9U")[0];H g=U.5B("1J");g.3k=s.1d;9(!f&&(s.1C||s.1l)){H j=P;g.9R=g.62=G(){9(!j&&(!6.2C||6.2C=="5Q"||6.2C=="1l")){j=Q;1C();1l();h.3b(g)}}}h.58(g);I}H k=P;H i=18.6X?1u 6X("9P.9O"):1u 6W();i.9M(s.O,s.1d,s.3e);9(s.M)i.5C("9J-9I",s.5G);9(s.5y)i.5C("9H-5x-9F",E.49[s.1d]||"9D, 9C 9B 9A 5v:5v:5v 9z");i.5C("X-9x-9v","6W");9(s.6U)s.6U(i);9(s.1Z)E.1j.1F("5H",[i,s]);H c=G(a){9(!k&&i&&(i.2C==4||a=="2z")){k=Q;9(d){4A(d);d=S}1v=a=="2z"&&"2z"||!E.6S(i)&&"3U"||s.5y&&E.6R(i,s.1d)&&"5O"||"1C";9(1v=="1C"){2a{M=E.6Q(i,s.1V)}29(e){1v="5k"}}9(1v=="1C"){H b;2a{b=i.5s("6P-5x")}29(e){}9(s.5y&&b)E.49[s.1d]=b;9(!f)1C()}J E.5r(s,i,1v);1l();9(s.3e)i=S}};9(s.3e){H d=4j(c,13);9(s.2z>0)56(G(){9(i){i.9q();9(!k)c("2z")}},s.2z)}2a{i.9o(s.M)}29(e){E.5r(s,i,S,e)}9(!s.3e)c();I i;G 1C(){9(s.1C)s.1C(M,1v);9(s.1Z)E.1j.1F("5I",[i,s])}G 1l(){9(s.1l)s.1l(i,1v);9(s.1Z)E.1j.1F("6t",[i,s]);9(s.1Z&&!--E.5b)E.1j.1F("5K")}},5r:G(s,a,b,e){9(s.3U)s.3U(a,b,e);9(s.1Z)E.1j.1F("5J",[a,s,e])},5b:0,6S:G(r){2a{I!r.1v&&9n.9l=="54:"||(r.1v>=6N&&r.1v<9j)||r.1v==6M||E.V.1N&&r.1v==W}29(e){}I P},6R:G(a,c){2a{H b=a.5s("6P-5x");I a.1v==6M||b==E.49[c]||E.V.1N&&a.1v==W}29(e){}I P},6Q:G(r,b){H c=r.5s("9i-O");H d=b=="6K"||!b&&c&&c.1g("6K")>=0;H a=d?r.9g:r.40;9(d&&a.2V.37=="5k")6G"5k";9(b=="1J")E.5f(a);9(b=="45")a=3w("("+a+")");I a},3a:G(a){H s=[];9(a.1c==1B||a.4c)E.N(a,G(){s.1a(3f(6.2H)+"="+3f(6.1Q))});J L(H j 1i a)9(a[j]&&a[j].1c==1B)E.N(a[j],G(){s.1a(3f(j)+"="+3f(6))});J s.1a(3f(j)+"="+3f(a[j]));I s.66("&").1p(/%20/g,"+")}});E.1b.1k({1A:G(b,a){I b?6.1U({1H:"1A",2N:"1A",1r:"1A"},b,a):6.1E(":1P").N(G(){6.R.19=6.3h?6.3h:"";9(E.17(6,"19")=="2s")6.R.19="2Z"}).2D()},1z:G(b,a){I b?6.1U({1H:"1z",2N:"1z",1r:"1z"},b,a):6.1E(":3R").N(G(){6.3h=6.3h||E.17(6,"19");9(6.3h=="2s")6.3h="2Z";6.R.19="2s"}).2D()},6J:E.1b.25,25:G(a,b){I E.1n(a)&&E.1n(b)?6.6J(a,b):a?6.1U({1H:"25",2N:"25",1r:"25"},a,b):6.N(G(){E(6)[E(6).3t(":1P")?"1A":"1z"]()})},9c:G(b,a){I 6.1U({1H:"1A"},b,a)},9b:G(b,a){I 6.1U({1H:"1z"},b,a)},99:G(b,a){I 6.1U({1H:"25"},b,a)},98:G(b,a){I 6.1U({1r:"1A"},b,a)},96:G(b,a){I 6.1U({1r:"1z"},b,a)},95:G(c,a,b){I 6.1U({1r:a},c,b)},1U:G(k,i,h,g){H j=E.6D(i,h,g);I 6[j.3L===P?"N":"3L"](G(){j=E.1k({},j);H f=E(6).3t(":1P"),3y=6;L(H p 1i k){9(k[p]=="1z"&&f||k[p]=="1A"&&!f)I E.1n(j.1l)&&j.1l.16(6);9(p=="1H"||p=="2N"){j.19=E.17(6,"19");j.2U=6.R.2U}}9(j.2U!=S)6.R.2U="1P";j.3M=E.1k({},k);E.N(k,G(c,a){H e=1u E.2j(3y,j,c);9(/25|1A|1z/.14(a))e[a=="25"?f?"1A":"1z":a](k);J{H b=a.3s().1t(/^([+-]=)?([\\d+-.]+)(.*)$/),1O=e.2b(Q)||0;9(b){H d=3I(b[2]),2i=b[3]||"2T";9(2i!="2T"){3y.R[c]=(d||1)+2i;1O=((d||1)/e.2b(Q))*1O;3y.R[c]=1O+2i}9(b[1])d=((b[1]=="-="?-1:1)*d)+1O;e.3N(1O,d,2i)}J e.3N(1O,a,"")}});I Q})},3L:G(a,b){9(E.1n(a)){b=a;a="2j"}9(!a||(1m a=="1M"&&!b))I A(6[0],a);I 6.N(G(){9(b.1c==1B)A(6,a,b);J{A(6,a).1a(b);9(A(6,a).K==1)b.16(6)}})},9f:G(){H a=E.32;I 6.N(G(){L(H i=0;i-8O?r:3I(E.17(6.T,6.1e))||0},3N:G(c,b,e){6.5u=(1u 3D()).3B();6.1O=c;6.2D=b;6.2i=e||6.2i||"2T";6.2v=6.1O;6.4q=6.4i=0;6.4r();H f=6;G t(){I f.2F()}t.T=6.T;E.32.1a(t);9(E.32.K==1){H d=4j(G(){H a=E.32;L(H i=0;i6.Y.2e+6.5u){6.2v=6.2D;6.4q=6.4i=1;6.4r();6.Y.3M[6.1e]=Q;H a=Q;L(H i 1i 6.Y.3M)9(6.Y.3M[i]!==Q)a=P;9(a){9(6.Y.19!=S){6.T.R.2U=6.Y.2U;6.T.R.19=6.Y.19;9(E.17(6.T,"19")=="2s")6.T.R.19="2Z"}9(6.Y.1z)6.T.R.19="2s";9(6.Y.1z||6.Y.1A)L(H p 1i 6.Y.3M)E.1x(6.T.R,p,6.Y.3P[p])}9(a&&E.1n(6.Y.1l))6.Y.1l.16(6.T);I P}J{H n=t-6.5u;6.4i=n/6.Y.2e;6.4q=E.3J[6.Y.3J||(E.3J.5q?"5q":"6B")](6.4i,n,0,1,6.Y.2e);6.2v=6.1O+((6.2D-6.1O)*6.4q);6.4r()}I Q}};E.2j.2F={2R:G(a){a.T.2R=a.2v},2B:G(a){a.T.2B=a.2v},1r:G(a){E.1x(a.T.R,"1r",a.2v)},6z:G(a){a.T.R[a.1e]=a.2v+a.2i}};E.1b.6m=G(){H c=0,3E=0,T=6[0],5t;9(T)8L(E.V){H b=E.17(T,"2X")=="4F",1D=T.12,23=T.23,2K=T.3H,4f=1N&&3x(4s)<8J;9(T.6V){5w=T.6V();1f(5w.1S+38.33(2K.2V.2R,2K.1G.2R),5w.3E+38.33(2K.2V.2B,2K.1G.2B));9(1h){H d=E("4o").17("8H");d=(d=="8G"||E.5g&&3x(4s)>=7)&&2||d;1f(-d,-d)}}J{1f(T.5l,T.5z);1W(23){1f(23.5l,23.5z);9(35&&/^t[d|h]$/i.14(1D.37)||!4f)d(23);9(4f&&!b&&E.17(23,"2X")=="4F")b=Q;23=23.23}1W(1D.37&&!/^1G|4o$/i.14(1D.37)){9(!/^8D|1I-9S.*$/i.14(E.17(1D,"19")))1f(-1D.2R,-1D.2B);9(35&&E.17(1D,"2U")!="3R")d(1D);1D=1D.12}9(4f&&b)1f(-2K.1G.5l,-2K.1G.5z)}5t={3E:3E,1S:c}}I 5t;G d(a){1f(E.17(a,"9T"),E.17(a,"8A"))}G 1f(l,t){c+=3x(l)||0;3E+=3x(t)||0}}})();',62,616,'||||||this|||if|||||||||||||||||||||||||||||||||function|var|return|else|length|for|data|each|type|false|true|style|null|elem|document|browser|undefined||options|||nodeName|parentNode||test|jQuery|apply|css|window|display|push|fn|constructor|url|prop|add|indexOf|msie|in|event|extend|complete|typeof|isFunction|className|replace|arguments|opacity|div|match|new|status|firstChild|attr|nodeType|hide|show|Array|success|parent|filter|trigger|body|height|table|script|tbody|cache|string|safari|start|hidden|value|merge|left|break|animate|dataType|while|map|find|global||get|id|offsetParent|select|toggle|selected|toUpperCase|remove|catch|try|cur|al|ready|duration|done|text|makeArray|unit|fx|swap|split|target||pushStack|toLowerCase|nextSibling|button|none|handle|guid|now|stack|tb|jsre|timeout|inArray|scrollTop|readyState|end|delete|step|one|name|nth|slice|doc|ret|preventDefault|width|call|events|checked|scrollLeft|exec|px|overflow|documentElement|grep|position|form|block|removeData|rl|timers|max|opera|mozilla|trim|tagName|Math|load|param|removeChild|disabled|insertBefore|async|encodeURIComponent|append|oldblock|val|childNodes|src|readyList|multiFilter|color|defaultView|stopPropagation|args|old|toString|is|last|first|eval|parseInt|self|domManip|prototype|getTime|curCSS|Date|top||ajax|ownerDocument|parseFloat|easing|has|queue|curAnim|custom|innerHTML|orig|currentStyle|visible|getElementById|isReady|error|static|bind|String|which|getComputedStyle|responseText|oWidth|oHeight|on|shift|json|child|RegExp|ol|lastModified|isXMLDoc|jsonp|jquery|previousSibling|dir|safari2|el|styleFloat|state|setInterval|radio|getElementsByTagName|tr|empty|html|getAttribute|pos|update|version|input|float|runtimeStyle|unshift|mouseover|getPropertyValue|GET|clearInterval|safariTimer|visibility|clean|__ie_init|absolute|handleHover|lastToggle|index|fromElement|relatedTarget|click|fix|evt|andSelf|removeEventListener|handler|cloneNode|addEventListener|triggered|nodeIndex|unique|Number|classFilter|prevObject|selectedIndex|after|submit|password|removeAttribute|file|expr|setTimeout|_|appendChild|ajaxSettings|client|active|win|sibling|deep|globalEval|boxModel|cssFloat|object|checkbox|parsererror|offsetLeft|wrapAll|dequeue|props|lastChild|swing|handleError|getResponseHeader|results|startTime|00|box|Modified|ifModified|offsetTop|evalScript|createElement|setRequestHeader|ctrlKey|callback|metaKey|contentType|ajaxSend|ajaxSuccess|ajaxError|ajaxStop|ajaxStart|serializeArray|init|notmodified|POST|loaded|appendTo|DOMContentLoaded|bindReady|mouseout|not|removeAttr|unbind|unload|Width|keyCode|charCode|onreadystatechange|clientX|pageX|srcElement|join|outerHTML|substr|zoom|parse|textarea|reset|image|odd|even|before|quickClass|quickID|prepend|quickChild|execScript|offset|scroll|processData|uuid|contents|continue|textContent|ajaxComplete|clone|setArray|webkit|nodeValue|fl|_default|100|linear|href|speed|eq|createTextNode|throw|replaceWith|splice|_toggle|xml|colgroup|304|200|alpha|Last|httpData|httpNotModified|httpSuccess|fieldset|beforeSend|getBoundingClientRect|XMLHttpRequest|ActiveXObject|col|br|abbr|pixelLeft|urlencoded|www|application|ajaxSetup|post|getJSON|getScript|elements|serialize|clientWidth|hasClass|scr|clientHeight|write|relative|keyup|keypress|keydown|change|mousemove|mouseup|mousedown|right|dblclick|resize|focus|blur|frames|instanceof|hover|offsetWidth|triggerHandler|ipt|defer|offsetHeight|border|padding|clientY|pageY|Left|Right|toElement|Bottom|Top|cancelBubble|returnValue|detachEvent|attachEvent|substring|line|weight|animated|header|font|enabled|innerText|contains|only|size|gt|lt|uFFFF|u0128|417|inner|Height|toggleClass|removeClass|addClass|replaceAll|noConflict|insertAfter|prependTo|wrap|contentWindow|contentDocument|http|iframe|children|siblings|prevAll|nextAll|wrapInner|prev|Boolean|next|parents|maxLength|maxlength|readOnly|readonly|class|htmlFor|CSS1Compat|compatMode|compatible|borderTopWidth|ie|ra|inline|it|rv|medium|borderWidth|userAgent|522|navigator|with|concat|1px|10000|array|ig|PI|NaN|400|reverse|fast|600|slow|Function|Object|setAttribute|changed|be|can|property|fadeTo|fadeOut|getAttributeNode|fadeIn|slideToggle|method|slideUp|slideDown|action|cssText|stop|responseXML|option|content|300|th|protocol|td|location|send|cap|abort|colg|cos|tfoot|thead|With|leg|Requested|opt|GMT|1970|Jan|01|Thu|area|Since|hr|If|Type|Content|meta|specified|open|link|XMLHTTP|Microsoft|img|onload|row|borderLeftWidth|head|attributes'.split('|'),0,{})) \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/js/jquery-speakers_coaches_consultants.js b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/js/jquery-speakers_coaches_consultants.js deleted file mode 100644 index 6cf741a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/js/jquery-speakers_coaches_consultants.js +++ /dev/null @@ -1,30 +0,0 @@ -jQuery(function($) { - var themap = $('
').css({ - 'width': '90%', - 'height': '500px' - }).insertBefore('ul.people'); - - var mapstraction = new Mapstraction('themap','google'); - mapstraction.addControls({ - zoom: 'large', - map_type: true - }); - - mapstraction.setCenterAndZoom( - new LatLonPoint(30, -0.126236), - 2 // Zoom level appropriate for Brighton city centre - ); - - $('.vcard').each(function() { - var hcard = $(this); - - var latitude = hcard.find('.geo .latitude').text(); - var longitude = hcard.find('.geo .longitude').text(); - - var marker = new Marker(new LatLonPoint(latitude, longitude)); - marker.setInfoBubble( - '
' + hcard.html() + '
' - ); - mapstraction.addMarker(marker); - }); -}); \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/js/jquery.heartbeat.js b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/js/jquery.heartbeat.js deleted file mode 100644 index 0011793..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/js/jquery.heartbeat.js +++ /dev/null @@ -1,9 +0,0 @@ -$(document).ready(function() { - $('#tests-results').load('../views/heartbeat.php?tests-results'); - $('#commits').load('../views/heartbeat.php', '', function() { - $(this).find(".sparkline").each(function() { - sparklinequery($(this)); - }); - }); - $('#last-commits').load('../views/heartbeat.php?last-commits'); -}); diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/js/jquery.sparkline.js b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/js/jquery.sparkline.js deleted file mode 100644 index 28c55d7..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/js/jquery.sparkline.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Javascript Sparklines Library - * Based on a work by John Resig - * http://ejohn.org/projects/jspark/ - * - * This work is licensed under a Creative Commons Attribution 2.5 License - * More Info: http://creativecommons.org/licenses/by/2.5/ - * - * To use, place your data points within your HTML, like so: - * 10,8,20,5... - * - * in your CSS you might want to have the rule: - * .sparkline { display: none } - * so that non-compatible browsers don't see a huge pile of numbers. - * - */ - -function sparklinequery(o) { - var p = o.text().split(','); - o.empty(); - - var nw = "auto"; - var nh = "auto"; - - var f = 2; - var w = ( nw == "auto" || nw == 0 ? p.length * f : nw - 0 ); - var h = ( nh == "auto" || nh == 0 ? "1em" : nh ); - - var co = document.createElement("canvas"); - - if ( co.getContext ) { - o.css({ display: "inline" }); - } else { - return false; - } - - - co.style.height = h; - co.style.width = w; - co.width = w; - o.append( co ); - - var h = co.offsetHeight; - co.height = h; - - var min = 9999; - var max = -1; - - for ( var i = 0; i < p.length; i++ ) { - p[i] = p[i] - 0; - if ( p[i] < min ) min = p[i]; - if ( p[i] > max ) max = p[i]; - } - - if ( co.getContext ) { - var c = co.getContext("2d"); - c.strokeStyle = o.css("color"); - c.lineWidth = 1.0; - c.beginPath(); - - for ( var i = 0; i < p.length; i++ ) { - x = (w / p.length) * i; - if (max != min) { - y = h - (((p[i] - min) / (max - min)) * h) ; - } else { - y = 0; - } - y = 3 * i; - c.lineTo(x, y); - } - - c.stroke(); -alert(c); - o.css({ display:"inline" }); - } -} \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/simpletest.css b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/simpletest.css deleted file mode 100644 index 13fa388..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/simpletest.css +++ /dev/null @@ -1,43 +0,0 @@ -/* SimpleTest - Unit Testing for PHP */ -body { font-family : georgia, serif; } -img { border : 0; } -h1 { color : #009933; } -h3 { width : 100%; border-bottom : 1px solid #cccccc; } -blockquote { background: transparent url('images/quote.png') left top no-repeat; font-style : italic; padding-left : 40px; margin-left : 10px; } -td { vertical-align : top; } - -#logo { margin-bottom : 20px; } -#credits { margin-top : 40px; } -#actions { position : absolute; top : 20px; left : 40px; width : 335px; } -#actions div { width : 305px; } -#content { position : absolute; top : 20px; left : 400px; padding-bottom : 50px; width : 491px; } -#news { border : 2px solid #009933; padding : 20px; font-weight : bold; font-size : 18pt; width : 451px; } -#news a { color : #009933; } -#internal { background: url('images/simpletest-internal-middle.png') repeat-y; margin-top : 2em; width : 306px; } -#external { background: url('images/simpletest-external-middle.png') repeat-y; width : 306px; } -#internal > div , #external > div { padding : 0 0.5em 0 0.5em; } - -div.console { background-color: black; border: 4px ridge; border-color: gray; color : white; margin: 5px 40px 20px 20px; padding: 10px; } -div.demo { background-color: white; border: 4px ridge; border-color: gray; margin: 5px; margin-left: 20px; margin-right: 40px; padding: 10px; } -div.demo span.fail { color: red; } -div.demo span.pass { color: green; } -div.demo h1 { color: black; font-size: 12pt; font-weight: bold; text-align: left; } -pre { font-family: monospaced; border-left: 1px solid #999999; background-color: white; padding: 5px; margin-left: 5px; font-size : 10pt; } - -.screenshot { border : 1px solid #cccccc;} -.experimental { background-color : yellow; border : 4px dashed black; padding : 10px; } -.experimental pre { border-left : none; background-color : yellow; } -.bubble, .bubble h3 { font-size: 9pt; } -.people { margin : 0; list-style : none; padding : 0; } -.geo { color : #777777; } -.photo { margin-bottom : 2em; } -.photo span { display : block; } -.photo span.title { font-weight : bold; margin-top : 1em; } -.photo img { border : 1px solid #777777; padding : 1em; margin : 1em; } - -dd { font-size : 10.5pt; } -.done, .done span, .done + dd { color : #AAAAAA; text-decoration : line-through; } -.postponed, .postponed span, .postponed + dd { color : #AAAAAA; } - -dt div.fail { background-color : red; color : white; padding : 0.2em; } -dt div.pass { background-color : green; color : white; padding : 0.2em; } \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/views/heartbeat.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/views/heartbeat.php deleted file mode 100644 index 9b48f1c..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/views/heartbeat.php +++ /dev/null @@ -1,174 +0,0 @@ -view($_SERVER['QUERY_STRING']); - -class SimpleHeartBeat { - public $log_directory; - public $tests_directory; - - function __construct($log_directory) { - $this->log_directory = $log_directory; - } - - function view($querystring) { - switch ($querystring) { - case "last-commits": - return $this->displayLastCommits(); - case "tests-results": - return $this->displayTestsResults(); - case "commits": - default: - return $this->displaySparkline("commits last week"); - } - } - - function displayTestsResults() { - foreach(new DirectoryIterator($this->log_directory) as $node) { - if (preg_match("/simpletest\..*\.log/", $node->getFilename())) { - $log = new SimpleHeartBeatLog($node); - if (!isset($html)) { - $html = "
"; - } - $html .= "
".$log->details()."
"; - $html .= "
".$log->info()."
"; - } - } - if (isset($html)) { - $html .= "
"; - } else { - $html = $this->dataUnavailable(); - } - - return $html; - } - - function displayLastCommits($number=5) { - $entries = array(); - $xml = simplexml_load_file($this->log_directory."/svn.xml"); - foreach ($xml->logentry as $logentry) { - $dt = $logentry->msg; - $dd = $logentry['revision']." - ".$logentry->author. " - ".$logentry->date; - $entries[] = array('dt' => $dt, 'dd' => $dd); - } - - if (count($entries) > 0) { - $html = "
"; - krsort($entries); - $i = 0; - foreach($entries as $entry) { - if ($i < $number) { - $i++; - $html .= "
".$entry['dt']."
"; - $html .= "
".$entry['dd']."
"; - } else { - break; - } - } - - $html .= "
"; - } else { - $html = $this->dataUnavailable(); - } - - return $html; - } - - function displaySparkline($name="commits last week") { - $method = $this->findMethod($name); - $data = $this->$method(); - - if (is_array($data)) { - $html = "
"; - $html .= ""; - $html .= join(",", $data); - $html .= ""; - $html .= " ".array_pop($data)." ".$name; - $html .= "
"; - } else { - $html = $this->dataUnavailable(); - } - - return $html; - } - - function dataUnavailable() { - return "
data unavailable
"; - } - function findMethod($name) { - switch ($name) { - default: - return "commitsPerWeek"; - } - } - - function commitsPerWeek() { - $data = array(); - $xml = simplexml_load_file($this->log_directory."/svn.xml"); - foreach ($xml->logentry as $logentry) { - $timestamp = strtotime($logentry->date); - $weekly = strtotime("last monday", $timestamp); - if (!isset($data[$weekly])) { - $data[$weekly] = 0; - } - $data[$weekly]++; - } - - $data = $this->normalizeData($data, "week"); - - return $data; - } - - function normalizeData($data, $period="week") { - $min = min(array_keys($data)); - $max = max(array_keys($data)); - - $normalized = array(); - $current = $min; - while ($current <= $max) { - $normalized[$current] = 0; - $current = strtotime("+1 ".$period, $current); - } - - foreach ($data as $timestamp => $value) { - $normalized[$timestamp] = $value; - } - - return $normalized; - } -} - -class SimpleHeartBeatLog { - public $node; - public $content = ""; - - function __construct($node) { - $this->node = $node; - $this->content = file_get_contents($this->node->getPathname()); - } - - function result() { - if (preg_match("/OK/", $this->content)) { - return "pass"; - } else { - return "fail"; - } - } - - function info() { - return nl2br($this->content); - } - - function details() { - $details = substr($this->node->getFilename(), 11); - $details = $this->result(). " with ".substr($details, 0, -4); - $details .= " - ".date("c", $this->node->getCTime()); - - return "
result()."\">".$details."
"; - } -} - -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/views/photos_stream.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/views/photos_stream.php deleted file mode 100644 index c85bcf5..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/simpletest.org/views/photos_stream.php +++ /dev/null @@ -1,37 +0,0 @@ -showLastPhotos(); - -class SimpleFlickrStreamXMLElement extends SimpleXMLElement { - function showLastPhotos() { - $html = ""; - foreach ($this->entry as $entry) { - $html .= "
"; - $html .= "".$entry->title.""; - $html .= "".$this->extractFirstImage($entry).""; - $html .= "".$this->extractAuthor($entry).""; - $html .= "
"; - } - return $html; - } - - function extractAuthor($entry) { - return "author->uri."\">".$entry->author->name.""; - } - - function extractFirstImage($entry) { - $content = $entry->content; - $content = substr($content, strpos($content, "") + 3); - - return "link[0]['href']."\">".$image.""; - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/about.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/about.xml deleted file mode 100644 index 294a197..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/about.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - About Last Craft - -
-

- - At the moment this site is maintained by myself, - Marcus Baker - and I am an Object Oriented web developer - and father of two. - I am currently a freelancer working as a senior developer for - Wordtracker - and as a consultant to various smaller companies. - Wordtracker is an internet statistics company with a huge database - of search engine keyword popularity. - The company software development is eXtreme Programming based. -

-

- My wife Aviva Racher is a - microbiologist and Mother of the same two. -

-
-
-

- Read the interview - Who's really being protected? on the - O'Reilly network if you have an interest in software patents. -

-
-
-

- Besides working for Wordtracker, I also act as an independent - consultant. - Usually in relation to bringing agile development practices into an - organisation. - Clients include Waterscape and Amnesty International. -

-

- I did a quick site for a graphic designer and illustrator friend of mine, - Dylan Beck. - He has a very unique style. -

-

- The Ambassadors of Om are a Jazz-Funk - fusion (?) band with an internet presence going back over five - years. Site includes samples, videos and links. The band is - managed by guitarist and lead singer Paul Grimes who is a friend of ours. -

-

- - Mark Eichner is Aviva's uncle and run's the - - Leisure Pursuits - off-road driving school. Lots of wheels and mud! -

-
-
- - - Last Craft people - Myself and friends and relations. - - - Issues that I care about. - - - Associated companies - and people. - - - - - - Extreme Tuesday - Club is an informal meeting in London to promote - Extreme programming. - - - PHPLondon - is a user group that meets the first thursday of every month. - - - Wordtracker - crunches internet search data for web marketing. - - - - - software development, - computer programmer, - php programming, - programming php, - software development company, - software development uk, - php tutorial, - bespoke software development uk, - corporate web development, - architecture, - freelancer, - php resources, - wordtracker, - web marketing, - serach engines, - web positioning, - internet marketing - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/authentication_documentation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/authentication_documentation.xml deleted file mode 100644 index 7fc01fc..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/authentication_documentation.xml +++ /dev/null @@ -1,337 +0,0 @@ - - - - SimpleTest documentation for testing log-in and authentication - - -

- One of the trickiest, and yet most important, areas - of testing web sites is the security. - Testing these schemes is one of the core goals of - the SimpleTest web tester. -

-
-
-

- If you fetch a page protected by basic authentication then - rather than receiving content, you will instead get a 401 - header. - We can illustrate this with this test... - - function test401Header() { - $this->get('http://www.lastcraft.com/protected/'); - $this->showHeaders(); - } -} -]]> - This allows us to see the challenge header... -

-

File test

-
-
1/1 test cases complete. - 0 passes, 0 fails and 0 exceptions.
-
- We are trying to get away from visual inspection though, and so SimpleTest - allows to make automated assertions against the challenge. - Here is a thorough test of our header... -get('http://www.lastcraft.com/protected/'); - $this->assertAuthentication('Basic'); - $this->assertResponse(401); - $this->assertRealm('SimpleTest basic authentication'); - } -} -]]> - Any one of these tests would normally do on it's own depending - on the amount of detail you want to see. -

-

- One theme that runs through SimpleTest is the ability to use - SimpleExpectation objects wherever a simple - match is not enough. - If you want only an approximate match to the realm for - example, you can do this... -get('http://www.lastcraft.com/protected/'); - $this->assertRealm(new PatternExpectation('/simpletest/i')); - } -} -]]> - This type of test, testing HTTP responses, is not typical. -

-

- Most of the time we are not interested in testing the - authentication itself, but want to get past it to test - the pages underneath. - As soon as the challenge has been issued we can reply with - an authentication response... -get('http://www.lastcraft.com/protected/'); - $this->authenticate('Me', 'Secret'); - $this->assertTitle(...); - } -} -]]> - The username and password will now be sent with every - subsequent request to that directory and subdirectories. - You will have to authenticate again if you step outside - the authenticated directory, but SimpleTest is smart enough - to merge subdirectories into a common realm. -

-

- If you want, you can shortcut this step further by encoding - the log in details straight into the URL... -get('http://Me:Secret@www.lastcraft.com/protected/'); - $this->assertTitle(...); - } -} -]]> - If your username or password has special characters, then you - will have to URL encode them or the request will not be parsed - correctly. - I'm afraid we leave this up to you. -

-

- A problem with encoding the login details directly in the URL is - the authentication header will not be sent on subsequent requests. - If you navigate with relative URLs though, the authentication - information will be preserved along with the domain name. -

-

- Normally though, you use the authenticate() call. - SimpleTest will then remember your login information on each request. -

-

- Only testing with basic authentication is currently supported, and - this is only really secure in tandem with HTTPS connections. - This is usually good enough to protect test server from prying eyes, - however. - Digest authentication and NTLM authentication may be added - in the future if enough people request this feature. -

-
-
-

- Basic authentication doesn't give enough control over the - user interface for web developers. - More likely this functionality will be coded directly into - the web architecture using cookies with complicated timeouts. - We need to be able to test this too. -

-

- Starting with a simple log-in form... -


-    Username:
-    
- Password: -
- - -]]>
- Which looks like... -

-

-

- Username: -
- Password: -
- -
-

-

- Let's suppose that in fetching this page a cookie has been - set with a session ID. - We are not going to fill the form in yet, just test that - we are tracking the user. - Here is the test... -get('http://www.my-site.com/login.php'); - $this->assertCookie('SID'); - } -} -]]> - All we are doing is confirming that the cookie is set. - As the value is likely to be rather cryptic it's not - really worth testing this with... -get('http://www.my-site.com/login.php'); - $this->assertCookie('SID', new PatternExpectation('/[a-f0-9]{32}/i')); - } -} -]]> - If you are using PHP to handle sessions for you then - this test is even more useless, as we are just testing PHP itself. -

-

- The simplest test of logging in is to visually inspect the - next page to see if you are really logged in. - Just test the next page with WebTestCase::assertText(). -

-

- The test is similar to any other form test, - but we might want to confirm that we still have the same - cookie after log-in as before we entered. - We wouldn't want to lose track of this after all. - Here is a possible test for this... -get('http://www.my-site.com/login.php'); - $session = $this->getCookie('SID'); - $this->setField('u', 'Me'); - $this->setField('p', 'Secret'); - $this->click('Log in'); - $this->assertText('Welcome Me'); - $this->assertCookie('SID', $session); - } -} -]]> - This confirms that the session identifier is maintained - afer log-in and we haven't accidently reset it. -

-

- We could even attempt to hack our own system by setting - arbitrary cookies to gain access... -get('http://www.my-site.com/login.php'); - $this->setCookie('SID', 'Some other session'); - $this->get('http://www.my-site.com/restricted.php'); - $this->assertText('Access denied'); - } -} -]]> - Is your site protected from this attack? -

-
-
-

- If you are testing an authentication system a critical piece - of behaviour is what happens when a user logs back in. - We would like to simulate closing and reopening a browser... -get('http://www.my-site.com/login.php'); - $this->setField('u', 'Me'); - $this->setField('p', 'Secret'); - $this->click('Log in'); - $this->assertText('Welcome Me'); - - $this->restart(); - $this->get('http://www.my-site.com/restricted.php'); - $this->assertText('Access denied'); - } -} -]]> - The WebTestCase::restart() method will - preserve cookies that have unexpired timeouts, but throw away - those that are temporary or expired. - You can optionally specify the time and date that the restart - happened. -

-

- Expiring cookies can be a problem. - After all, if you have a cookie that expires after an hour, - you don't want to stall the test for an hour while waiting - for the cookie to pass it's timeout. -

-

- To push the cookies over the hour limit you can age them - before you restart the session... -get('http://www.my-site.com/login.php'); - $this->setField('u', 'Me'); - $this->setField('p', 'Secret'); - $this->click('Log in'); - $this->assertText('Welcome Me'); - - $this->ageCookies(3600); - $this->restart(); - $this->get('http://www.my-site.com/restricted.php'); - $this->assertText('Access denied'); - } -} -]]> - After the restart it will appear that cookies are an - hour older, and any that pass their expiry will have - disappeared. -

-
-
- - - Getting through Basic HTTP authentication - - - Testing cookie based authentication - - - Managing browser sessions and timeouts - - - - - SimpleTest project page on SourceForge. - - - SimpleTest download page on LastCraft. - - - The developer's API for SimpleTest - gives full detail on the classes and assertions available. - - - - - software development, - php programming for clients, - customer focused php, - software development tools, - acceptance testing framework, - free php scripts, - log in boxes, - unit testing authentication systems, - php resources, - HTMLUnit, - JWebUnit, - php testing, - unit test resource, - web testing, - HTTP authentication, - testing log in, - authentication testing, - security tests - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/books_website.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/books_website.xml deleted file mode 100644 index 0877eff..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/books_website.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - Books in and around SimpleTest - -
-

- From time to time a book is recommanded on the mailing-list, you can find it here - with the original comments ! -

-

- Domain-Driven Design: Tackling Complexity in the Heart of Software -

-
- TDD is a lot about the mechanics of coding, but it says you are done - when there is no duplication. DDD considers the code in constant churn, - always renaming as the domain becomes clear and also feeding terms back - into the domain as the code evolves.
-
- Anyways, it's a great book :) [source] -
-
-
-

- Two of SimpleTest contributors have written books about PHP. Both have a lot - of examples with the SimpleTest Unit testing framework. -

-

- PHP|Architect's Guide to PHP Design Patterns -
- PHP|Architect's Guide to PHP Design Patterns
- by Jason E. Sweat
- (get it from : PHP|Architect | - Amazon ) -

-

- The PHP Anthology: Object Oriented PHP Solutions -
- The PHP Anthology: Object Oriented PHP Solutions
- by Harry Fuecks
- (get it from : SitePoint | - Amazon | - review on Slashdot ) -

-
-
-

- One way to help the team of contributors is to buy books from this page through - Amazon (with the simpletest-21 tag). We all love reading stuff that's - both interesting and challenging. -

-
-
- - - Latest recommandation - - - Books by contributors - - - Buying books - - - - - - - - - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/boundary_classes_tutorial.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/boundary_classes_tutorial.xml deleted file mode 100644 index eb2acbf..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/boundary_classes_tutorial.xml +++ /dev/null @@ -1,405 +0,0 @@ - - - - - PHP unit testing tutorial - Organising unit tests and "setup tests" - - - -

- You are probably thinking that we have well and truly exhausted - the Log class by now and that there is - really nothing more to add. - Things are never that simple with object oriented programming, though. - You think you understand a problem and then something comes a long - that challenges your perspective and leads to an even deeper appreciation. - I thought I understood the logging class and that only the first page - of the tutorial would use it. - After that I would move on to something more complicated. - No one is more surprised than me that I still haven't got to - the bottom of it. - In fact I think I have only just figured out what a logger does. -

-
-
-

- Supposing that we do not want to log to a file at all. - Perhaps we want to print to the screen, write the messages to a - socket or send them to the Unix(tm) syslog daemon for - dispatching across the network. - How do we incorporate this variation? -

-

- Simplest is to subclass the Log - overriding the message() method - with new versions. - This will work in the short term, but there is actually something - subtle, but deeply wrong with this. - Suppose we do subclass and have loggers that write to files, - the screen and the network. - Three classes , but that is OK. - Now suppose that we want a new logging class that adds message - filtering by priority, letting only certain types of messages - through according to some configuration file. -

-

- We are stuck. If we subclass again, we have to do it for all - three classes, giving us six classes. - The amount of duplication is horrible. -

-

- So are you now wishing that PHP had multiple inheritence? - Well, here that would reduce the short term workload, but - complicate what should be a very simple class. - Multiple inheritance, even when supported, should be used - extremely carefully as all sorts of complicated entanglements - can result. - Treat it as a loaded gun. - In fact, our sudden need for it is telling us something else - perhaps - that we have gone wrong on the conceptual level. -

-

- What does a logger do? - Does it send messages to a file? - Does it send messages to a network? - Does it send messages to a screen? - Nope. - It just sends messages (full stop). - The target of those messages can be chosen when setting - up the log, but after that the - logger should be left to combine and format the message - elements as that is its real job. - We restricted ourselves by assuming that target was a filename. -

-
-
-

- The solution to this plight is a real classic. - First we encapsulate the variation in a class as this will - add a level of indirection. - Instead of passing in the file name as a string we - will pass the "thing that we will write to" - which we will call a Writer. - Back to the tests... - -require_once('../classes/writer.php'); -Mock::generate('Clock'); - -class TestOfLogging extends UnitTestCase { - function setUp() { - @unlink('../temp/test.log'); - } - function tearDown() { - @unlink('../temp/test.log'); - } - - function testCreatingNewFile() { - $log = new Log(new FileWriter('../temp/test.log')); - $this->assertFalse(file_exists('../temp/test.log'), 'Created before message'); - $log->message('Should write this to a file'); - $this->assertTrue(file_exists('../temp/test.log'), 'File created'); - } - - function testAppendingToFile() { - $log = new Log(new FileWriter('../temp/test.log')); - $log->message('Test line 1'); - $this->assertWantedPattern( - '/Test line 1/', - $this->getFileLine('../temp/test.log', 0)); - $log->message('Test line 2'); - $this->assertWantedPattern( - '/Test line 2/', - $this->getFileLine('../temp/test.log', 1)); - } - - function testTimestamps() { - $clock = new MockClock($this); - $clock->setReturnValue('now', 'Timestamp'); - $log = new Log(new FileWriter('../temp/test.log')); - $log->message('Test line', $clock); - $this->assertWantedPattern( - '/Timestamp/', - $this->getFileLine('../temp/test.log', 0), - 'Found timestamp'); - } - - function getFileLine($filename, $index) { - $messages = file($filename); - return $messages[$index]; - } -} -?> -]]> - I am going to do this one step at a time so as not to get - confused. - I have replaced the file names with an imaginary - FileWriter class from - an imaginary file classes/writer.php. - This will cause the tests to crash as we have not written - the writer yet. - Should we do that now? -

-

- We could, but we don't have to. - We do need to create the interface, though, or we won't be - able to mock it. - This makes classes/writer.php looks like... - -]]> - We need to modify the Log class - as well... - -require_once('../classes/writer.php'); - -class Log { - private $writer; - - function Log($writer) { - $this->writer = $writer; - } - - function message($message, $clock = false) { - if (! is_object($clock)) { - $clock = new Clock(); - } - $this->writer->write("[" . $clock->now() . "] $message"); - } -} -?> -]]> - There is not much that hasn't changed in our now even smaller - class. - The tests run, but fail at this point unless we add code to - the writer. - What do we do now? -

-

- We could start writing tests and code the - FileWriter class alongside, but - while we were doing this our Log - tests would be failing and disturbing our focus. - In fact we do not have to. -

-

- Part of our plan is to free the logging class from the file - system and there is a way to do this. - First we add a tests/writer_test.php so that - we have somewhere to place our test code from log_test.php - that we are going to shuffle around. - I won't yet add it to the all_tests.php file, - as it is the logging aspect we are tackling right now. -

-

- Now I have done that (honest!) we remove any - tests from log_test.php that are not strictly logging - related and move them to writer_test.php for later. - We will also mock the writer so that it does not write - out to real files... - -Mock::generate('FileWriter'); - -class TestOfLogging extends UnitTestCase { - - function testWriting() { - $clock = new MockClock(); - $clock->setReturnValue('now', 'Timestamp'); - $writer = new MockFileWriter($this); - $writer->expectOnce('write', array('[Timestamp] Test line')); - $log = new Log(\$writer); - $log->message('Test line', $clock); - } -} -?> -]]> - Yes that really is the whole test case and it really is that short. - A lot has happened here... -

    -
  1. - The requirement to create the file only when needed has - moved to the FileWriter. -
  2. -
  3. - As we are dealing with mocks, no files are actually - created and so I moved the - setUp() and - tearDown() off into the - FileWriter tests. -
  4. -
  5. - The test now consists of sending a sample message and - testing the format. -
  6. -
- Hang on a minute, where are the assertions? -

-

- The mock objects do much more than simply behave like other - objects, they also run tests. - The expectOnce() - call told the mock to expect a single parameter of - the string "[Timestamp] Test line" when - the mock write() method is - called. - When that method is called the expected parameters are - compared with this and either a pass or a fail is sent - to the unit test as a result. -

-

- The other expectation is that write() - will be called and called only once. - If the method is not called before the end of the test, - a failure is generated. - We can see all this in action by running the tests... -

-

All tests

- Pass: log_test.php->Log class test->testwriting->Arguments for [write] were [String: [Timestamp] Test line]
- Pass: log_test.php->Log class test->testwriting->Expected call count for [write] was [1], but got [1]
- - Pass: clock_test.php->Clock class test->testclockadvance->Advancement
- Pass: clock_test.php->Clock class test->testclocktellstime->Now is the right time
-
3/3 test cases complete. - 4 passes and 0 fails.
-
-

-
-
-

- Something very nice has happened to the logger besides merely - getting smaller. -

-

- The only things it depends on now are classes that we have written - ourselves, and - in the tests these are mocked and so there are no dependencies - on anything other than our own PHP code. - No writing to files or waiting for clocks to tick over. - This means that the log_test.php test case will - run as fast as the processor will carry it. - By contrast the FileWriter - and Clock classes are very - close to the system. - This makes them harder to test as real data must be moved - around and painstakingly confirmed, often by ad hoc tricks. -

-

- Our last refactoring has helped a bit. - The hard to test classes on the boundary of the application - and the system are now smaller, as the I/O code has - been further separated from the domain logic. - They are direct mappings to PHP operations: - FileWriter::write() maps - to PHP fwrite() with the - file opened for appending and - Clock::now() maps to - PHP time(). - This makes debugging easier. - It also means that these classes will change less often. -

-

- If they don't change a lot then there is no reason to - keep running the tests for them. - This means that tests for the boundary classes can be moved - off into there own test suite leaving the other unit tests - to run at full speed. - In fact this is what I tend to do and the test cases - in SimpleTest itself are - divided this way. -

-

- That may not sound like much with one unit test and two - boundary tests, but typical applications can have - twenty boundary classes and two hundred application - classes. - To keep the unit tests running at full speed you will want - to keep them separate. -

-

- Another benefit of this separation is that you are left - with the smaller test suite for all your dependencies. - Suppose you want to set up a server for your application - and you want to make sure that all underlying components, - directories and configuration are correct. - You no longer need to run the entire test suite to find out, - just run the tests for your boundary classes. - For this reason, this test suite is often called the - "setup tests". - Hand them to your system administrator, and they can set up - your server for you. -

-

- Besides, separating off decisions of which system components - to use is good development. - Being able to change the underlying dependencies easily is a - good thing. - Perhaps all this mocking is - improving our design? -

-
-
- - - Handling variation in our logger. - - - Abstracting further with a mock Writer class. - - - Separating outsetup tests cleans things up. - - - - - This tutorial follows the Mock objects introduction. - - - Next is test driven design. - - - You will need the SimpleTest testing framework - to try these examples. - - - - - software development, - php programming, - programming php, - software development tools, - php tutorial, - free php scripts, - organizing unit tests, - testing tips, - development tricks, - software architecture for testing, - php example code, - mock objects, - junit port, - test case examples, - php testing, - unit test tool, - php test suite - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/browser_documentation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/browser_documentation.xml deleted file mode 100644 index fb1ba68..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/browser_documentation.xml +++ /dev/null @@ -1,281 +0,0 @@ - - - - SimpleTest documentation for the scriptable web browser component - - -

- SimpleTest's web browser component can be used not just - outside of the WebTestCase class, but also - independently of the SimpleTest framework itself. -

-
-
-

- You can use the web browser in PHP scripts to confirm - services are up and running, or to extract information - from them at a regular basis. - For example, here is a small script to extract the current number of - open PHP 5 bugs from the PHP web site... -get('http://php.net/'); -$browser->click('reporting bugs'); -$browser->click('statistics'); -$page = $browser->click('PHP 5 bugs only'); -preg_match('/status=Open.*?by=Any.*?(\d+)<\/a>/', $page, $matches); -print $matches[1]; -?> -]]> - There are simpler methods to do this particular example in PHP - of course. - For example you can just use the PHP file() - command against what here is a pretty fixed page. - However, using the web browser for scripts allows authentication, - correct handling of cookies, automatic loading of frames, redirects, - form submission and the ability to examine the page headers. -

-

- Methods such as periodic scraping are fragile against a site that is constantly - evolving and you would want a more direct way of accessing - data in a permanent set up, but for simple tasks this can provide - a very rapid solution. -

-

- All of the navigation methods used in the - WebTestCase - are present in the SimpleBrowser class, but - the assertions are replaced with simpler accessors. - Here is a full list of the page navigation methods... - - - - - - - - - - - - - - - - - - - - - - -
addHeader($header)Adds a header to every fetch
useProxy($proxy, $username, $password)Use this proxy from now on
head($url, $parameters)Perform a HEAD request
get($url, $parameters)Fetch a page with GET
post($url, $parameters)Fetch a page with POST
click($label)Clicks visible link or button text
clickLink($label)Follows a link by label
clickLinkById($id)Follows a link by attribute
getUrl()Current URL of page or frame
getTitle()Page title
getContent()Raw page or frame
getContentAsText()HTML removed except for alt text
retry()Repeat the last request
back()Use the browser back button
forward()Use the browser forward button
authenticate($username, $password)Retry page or frame after a 401 response
restart($date)Restarts the browser for a new session
ageCookies($interval)Ages the cookies by the specified time
setCookie($name, $value)Sets an additional cookie
getCookieValue($host, $path, $name)Reads the most specific cookie
getCurrentCookieValue($name)Reads cookie for the current context
- The methods SimpleBrowser::useProxy() and - SimpleBrowser::addHeader() are special. - Once called they continue to apply to all subsequent fetches. -

-

- Navigating forms is similar to the - WebTestCase form navigation... - - - - - - - - - - - - - - -
setField($label, $value)Sets all form fields with that label or name
setFieldByName($name, $value)Sets all form fields with that name
setFieldById($id, $value)Sets all form fields with that id
getField($label)Accessor for a form element value by label tag and then name
getFieldByName($name)Accessor for a form element value using name attribute
getFieldById($id)Accessor for a form element value
clickSubmit($label)Submits form by button label
clickSubmitByName($name)Submits form by button attribute
clickSubmitById($id)Submits form by button attribute
clickImage($label, $x, $y)Clicks an input tag of type image by title or alt text
clickImageByName($name, $x, $y)Clicks an input tag of type image by name
clickImageById($id, $x, $y)Clicks an input tag of type image by ID attribute
submitFormById($id)Submits by the form tag attribute
- At the moment there aren't many methods to list available links and fields. - - - - - - - -
isClickable($label)Test to see if a click target exists by label or name
isSubmit($label)Test for the existence of a button with that label or name
isImage($label)Test for the existence of an image button with that label or name
getLink($label)Finds a URL from it's label
getLinkById($label)Finds a URL from it's ID attribute
getUrls()Lists available links in the current page
- This will be expanded in later versions of SimpleTest. -

-

- Frames are a rather esoteric feature these days, but SimpleTest has - retained support for them. -

-

- Within a page, individual frames can be selected. - If no selection is made then all the frames are merged together - in one large conceptual page. - The content of the current page will be a concatenation of all of the - frames in the order that they were specified in the "frameset" - tags. - - - - - - -
getFrames()A dump of the current frame structure
getFrameFocus()Current frame label or index
setFrameFocusByIndex($choice)Select a frame numbered from 1
setFrameFocus($name)Select frame by label
clearFrameFocus()Treat all the frames as a single page
- When focused on a single frame, the content will come from - that frame only. - This includes links to click and forms to submit. -

-
-
-

- All of this functionality is great when we actually manage to fetch pages, - but that doesn't always happen. - To help figure out what went wrong, the browser has some methods to - aid in debugging... - - - - - - - - - - - - - - - - - -
setConnectionTimeout($timeout)Close the socket on overrun
getUrl()Url of most recent page fetched
getRequest()Raw request header of page or frame
getHeaders()Raw response header of page or frame
getTransportError()Any socket level errors in the last fetch
getResponseCode()HTTP response of page or frame
getMimeType()Mime type of page or frame
getAuthentication()Authentication type in 401 challenge header
getRealm()Authentication realm in 401 challenge header
getBaseUrl()Base url only of most recent page fetched
setMaximumRedirects($max)Number of redirects before page is loaded anyway
setMaximumNestedFrames($max)Protection against recursive framesets
ignoreFrames()Disables frames support
useFrames()Enables frames support
ignoreCookies()Disables sending and receiving of cookies
useCookies()Enables cookie support
- The methods SimpleBrowser::setConnectionTimeout() - SimpleBrowser::setMaximumRedirects(), - SimpleBrowser::setMaximumNestedFrames(), - SimpleBrowser::ignoreFrames(), - SimpleBrowser::useFrames(), - SimpleBrowser::ignoreCookies() and - SimpleBrowser::useCokies() continue to apply - to every subsequent request. - The other methods are frames aware. - This means that if you have an individual frame that is not - loading, navigate to it using SimpleBrowser::setFrameFocus() - and you can then use SimpleBrowser::getRequest(), etc to - see what happened. -

-
-
-

- Anything that could be done in a - WebTestCase can - now be done in a UnitTestCase. - This means that we could freely mix domain object testing with the - web interface... -class TestOfRegistration extends UnitTestCase { - function testNewUserAddedToAuthenticator() { - $browser = new SimpleBrowser(); - $browser->get('http://my-site.com/register.php'); - $browser->setField('email', 'me@here'); - $browser->setField('password', 'Secret'); - $browser->click('Register'); - - $authenticator = new Authenticator(); - $member = $authenticator->findByEmail('me@here'); - $this->assertEqual($member->getPassword(), 'Secret'); - } -} -]]> - While this may be a useful temporary expediency, I am not a fan - of this type of testing. - The testing has cut across application layers, make it twice as - likely it will need refactoring when the code changes. -

-

- A more useful case of where using the browser directly can be helpful - is where the WebTestCase cannot cope. - An example is where two browsers are needed at the same time. -

-

- For example, say we want to disallow multiple simultaneous - usage of a site with the same username. - This test case will do the job... - - $first_attempt = new SimpleBrowser(); - $first_attempt->get('http://my-site.com/login.php'); - $first_attempt->setField('name', 'Me'); - $first_attempt->setField('password', 'Secret'); - $first_attempt->click('Enter'); - $this->assertEqual($first_attempt->getTitle(), 'Welcome'); - - $second_attempt = new SimpleBrowser(); - $second_attempt->get('http://my-site.com/login.php'); - $second_attempt->setField('name', 'Me'); - $second_attempt->setField('password', 'Secret'); - $second_attempt->click('Enter'); - $this->assertEqual($second_attempt->getTitle(), 'Access Denied'); - } -} -]]> - You can also use the SimpleBrowser class - directly when you want to write test cases using a different - test tool than SimpleTest, such as PHPUnit. -

-
-
- - - Using the bundled web browser in scripts - - - Debugging failed pages - - - Complex tests with multiple web browsers - - - - - SimpleTest project page on SourceForge. - - - SimpleTest download page on LastCraft. - - - The developer's API for SimpleTest - gives full detail on the classes and assertions available. - - - - - user agent, - web browser php, - fetching pages, - spider scripts, - software development, - php programming for clients, - customer focused php, - software development tools, - acceptance testing framework, - free php scripts, - log in boxes, - unit testing authentication systems, - php resources, - HTMLUnit, - JWebUnit, - php testing, - unit test resource, - web testing, - HTTP authentication, - testing log in, - authentication testing, - security tests - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/changelog.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/changelog.xml deleted file mode 100644 index ab3a6fd..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/changelog.xml +++ /dev/null @@ -1,188 +0,0 @@ - - - - SimpleTest's Changelog - -
- - - Whitespace clean up - - - Some in line documentation fixes - - - Adding the JUnitReporter as an extension to SimpleTest (work by Patrice Neff) - - - New support page for Screencasts - - - - - Synchronizing the french translation. - - - Unit tests working for PHP 5.3 - - - Fix segfault with Zend Optimizer v3.2.2 (probably) - - - Adding some tags to help synchronise the docs - - - Add support for E_DEPRECATED - - - SimpleFileLoader::load: fix for $test_file already included, by daniel hahler - blueyed - - - New tests for UTF8 inside the browser. - - - "Update FormTesting tutorial page for hidden fields" submitted by David Heath - dgheath - - - Moving around the extensions : /ui is now deprecated, /extensions is holding all extensions, - /test/extensions is holding all extensions' test suites - - - Fixing one of the incompatible interface errors - - - Let choose which field of the same name to set - - - Clearing fatal error when throwing in a tearDown - - - Avoid a fatal error in assertLink - (when the link with a label does not exists in a page) submitted by German Rumm - german.rumm AT gmail.com - - - CssSelector chokes on single-quotes - - - clickImageByID not working : just updating the documentation - - - html special chars in links - - - decodeHtml does not decode some entities - (based on patch provided by Quandary - ai2097) - - - Radio buttons not working when set as integer - - - Missing return value - - - Inner links inside documentation for "simpletest.org" now work with *.html - - - Hostname extracted incorrectly from URIs containing @ sign - - - assertWantedText matches javascript source code - - - SimpleUrl doesn't appear to handle path after filename - - - remove call-time reference - its declared in the constructor, so that's enough - - - Adding error throwing to mocks - - - Added PHP4 patches for new mock code - - - Added filter that rewrites paths to included files in tests... - now just need to clean up all the hardcoded path references - in the existing tests and we should be able to make a start on building an extension layout - that's compatible with PEAR installer *and* manual tar/zip extraction - - - Add in default wrap to catch all 'verify' methods and wrap them in assertTrue - - - Recursive forms fails - - - SimpleFileLoader::selectRunnableTests(..) not only marks abstract classes as ignored - but filters them as well - - - renaming SimpleReflection::_isAbstractMethodInParent() into _isAbstractMethodInParents() - and making it check upwards if method was declared somewhere abstract not just in the immediate parent, - this allows to avoid ugly 'must be compatible' error in PHP5 - - - switch to Subversion (SVN) - - - - - autorun - - - browser base tag support - - - - - expectException() - - - proper skip facility - - - greater formatting control in the reporters - - - various mock object compatibility fixes - - -
-
- - - Changelog for version 1.0.1 - - - - - SimpleTest project page on SourceForge. - - - The developer's API for SimpleTest - gives full detail on the classes and assertions available. - - - - - software development, - php programming for clients, - customer focused php, - software development tools, - acceptance testing framework, - free php scripts, - log in boxes, - unit testing authentication systems, - php resources, - HTMLUnit, - JWebUnit, - php testing, - unit test resource, - web testing, - HTTP authentication, - testing log in, - authentication testing, - security tests - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/coding_standards.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/coding_standards.xml deleted file mode 100644 index f08b774..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/coding_standards.xml +++ /dev/null @@ -1,135 +0,0 @@ - - - - Coding Standards within SimpleTest - -
-

- Here's the list we try to follow : -

    -
  1. - Short method bodies, hopefully five lines or less. -
  2. -
  3. - No final methods. - People hack their test tools in wierd and wonderful ways. -
  4. -
  5. - No type hinting. - So much of SimpeTest is unit tested, that type hints don't - currently pay their way. -
  6. -
  7. - All object variables are private. - Those currently in the code base that aren't, should be. - Exceptions are fluent interfaces. -
  8. -
  9. - ClassLikeThis, methodLikeThis(), $variables_like_this. -
  10. -
  11. - No abbreviations in names, - so $parameter rather than $param. - Acronyms are allowed if they are industry standard. - We tend to camel case them, e.g. parseXml(). -
  12. -
  13. - We prefer "get"/"set" prefix for accessors, - e.g. getMyAttribute(). - The exception is for fluent interfaces. - This preference is mainly historical though, and could be dropped. - Ruby coding standards are superceding Java ones these days, and - "get" isn't used in that environment. -
  14. -
  15. - Accessors even when a subclass calls a superclass. -
  16. -
  17. - Don't be afraid of long class and method names. - The exception is the use of $i as a loop variable. - A lot of people viewing the code are casual passers by and won't know - any secret conventions. -
  18. -
  19. - "Simple" as a class name prefix - unless it really pollutes the visible domain language. - No other namespace prefixing unless there is known library - clash in the wild. -
  20. -
  21. - Eric Evans domain driven design style - rather than pure XP/TDD. That is, slight over design - in order to make concepts clear. -
  22. -
-

-

- Obviously these reflect Marcus Bakers' average coding style - over several projects and programming languages. -

-

- Is should also be obvious that - the code is riddled with exceptions to these rules :). -

-
-
-

- Please no dangling brace style. - No blank lines in methods. - So not... - - It wastes vertical space and is a hangover from long declarations in C++. - Rather this... - - White space to me should separate something, - such as a method or class. - If you feel the need to add space within a method body, just break - the code up into separate methods. - The exception is test code, which can contain a lot of mock set up. - It's still discouraged though. -

-

- By popular demand, all functions and methods are docblocked. - Private variables are not (the extra clutter is not worth it). - The only docblock attributes we require are @return - and @param as some IDE's use them. - Please take the time to write a human friendly comment. - Imagine you are chatting to a fellow SimpleTest user and they - ask the most obvious question about that variable. -

-
-
- - - Coding standards - - - And other Code formatting stuff. - - - - - - - - - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/display_subclass_tutorial.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/display_subclass_tutorial.xml deleted file mode 100644 index 0e5243b..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/display_subclass_tutorial.xml +++ /dev/null @@ -1,267 +0,0 @@ - - - - PHP unit testing tutorial - Subclassing the test display - - -

- SimpleTest ships with the simplest possible interface by default. - Mostly you just want to know if your test passed, or your test failed. - If it failed, you want the reason. - Nothing more. -

-

- Sometimes you want a more sophisticated output for stakeholders - and for acceptance testing. - If a minimal display is not enough, here - is how to roll your own. -

-
-
-

- Do you really need to see the passes? - Oh all right then, here's how. -

-

- We have to subclass the attached display, which in our case - is currently HtmlReporter. - The HtmlReporter class is in - the file simpletest/reporter.php and currently has - the following interface... - - Here is what the relevant methods mean. - You can see the - whole list here - if you are interested. -

    -
  • - __construct()
    - is the constructor. - Note that the unit test sets up the link to the display - rather than the other way around. - The display is a passive receiver of test events. - This allows easy adaption of the display for other test - systems beside unit tests, such as monitoring servers. - It also means that the unit test can write to more than - one display at a time. -
  • -
  • - void paintFail(string $message)
    - paints a failure. - See below. -
  • -
  • - void paintPass(string $message)
    - by default does nothing. - This is the method we will modify. -
  • -
  • - string getCss()
    - returns the CSS styles as a string for the page header - method. - Additional styles have to be appended here. -
  • -
  • - array getTestList()
    - is a convenience method for subclasses. - Lists the current nesting of the tests as a list - of test names. - The first, most deeply nested test, is first in the - list and the current test method will be last. -
  • -
-

-

- To show the passes we just need the - paintPass() method to behave - just like paintFail(). - Of course we won't modify the original, we'll subclass. -

-
-
-

- Firstly we'll create a tests/show_passes.php file - in our logging project and then place in it this empty class... - -]]> - A quick peruse of the - SimpleTest code base - shows the paintFail() implementation - at the time of writing to look like this... -Fail: "; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - print implode("->", $breadcrumb); - print "->$message
\n"; -} -]]>
- Essentially it chains to the parent's version, which we - have to do also to preserve house keeping, and then - prints a breadcrumbs trail calculated from the current test - list. - It drops the top level tests name, though. - As it is the same on every test that would be a little bit too - much information. - Transposing this to our new class... - - function paintPass($message) { - parent::paintPass($message); - print "Pass: "; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - print implode("->", $breadcrumb); - print "->$message
\n"; - } -} -]]>
- So far so good. - Now to make use of our new class we have to modify our - tests/all_tests.php file. - -require_once('show_passes.php'); -require_once('simpletest/simpletest.php'); -SimpleTest::prefer('ShowPasses'); -require_once('simpletest/autorun.php'); - -class AllTests { - function __construct() { - parent::__construct('All tests'); - $this->addTestFile('log_test.php'); - $this->addTestFile('clock_test.php'); - } -} -?> -]]> - We can run this to see the results of our handywork... -

-

All tests

- Pass: log_test.php->Log class test->testappendingtofile->Expecting [/Test line 1/] in [Test line 1]
- Pass: log_test.php->Log class test->testappendingtofile->Expecting [/Test line 2/] in [Test line 2]
- Pass: log_test.php->Log class test->testcreatingnewfile->Created before message
- Pass: log_test.php->Log class test->testcreatingnewfile->File created
- Pass: clock_test.php->Clock class test->testclockadvance->Advancement
- Pass: clock_test.php->Clock class test->testclocktellstime->Now is the right time
-
3/3 test cases complete. - 6 passes and 0 fails.
-
- Nice, but no gold star. - We have lost a little formatting here. - The display does not have a CSS style for - span.pass, but we can add this - easily by overriding one more method... -Pass: "; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - print implode("->", $breadcrumb); - print "->$message
\n"; - } - - protected function getCss() { - return parent::getCss() . ' .pass { color: green; }'; - } -} -]]>
- If you are adding the code as you go, you will see the style - appended when you do view source on the test results page in your browser. - To the eye the display itself should now look like this... -
-

All tests

- Pass: log_test.php->Log class test->testappendingtofile->Expecting [/Test line 1/] in [Test line 1]
- Pass: log_test.php->Log class test->testappendingtofile->Expecting [/Test line 2/] in [Test line 2]
- Pass: log_test.php->Log class test->testcreatingnewfile->Created before message
- Pass: log_test.php->Log class test->testcreatingnewfile->File created
- Pass: clock_test.php->Clock class test->testclockadvance->Advancement
- Pass: clock_test.php->Clock class test->testclocktellstime->Now is the right time
-
3/3 test cases complete. - 6 passes and 0 fails.
-
- Some people definitely prefer to see the passes being added - as they are working on code; the feeling that you are getting - work done is nice after all. - Once you have to scroll up and down the page to find failures - though, you soon come to realise its dark side. -

-

- Try it both ways and see which you prefer. - We'll leave it in for a bit anyhow when looking at the - mock objects coming up. - This is the first test tool that generates additional tests - and it will be useful to see what is happening behind the scenes. -

-
-
- - - How to Change the display to show test passes. - - - Subclassing the HtmlReporter class. - - - - - The previous tutorial section was - subclassing the test case. - - - This section is very specific to - SimpleTest. - If you use another tool you will want to skip this. - - - - - software development test first, - php general programming advice, - programming php, - software development tools, - php tutorial, - free php sample code, - architecture, - sample test cases, - php simple test framework, - php resources, - php test case examples, - phpunit, - simpletest, - unit test, - php testing - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/download_website.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/download_website.xml deleted file mode 100644 index 542c057..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/download_website.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - Downloading SimpleTest - -
-

- The current release is : - - SimpleTest v1.0.1. -

-

- You can download this version from - - SourceForget.net - and your local mirror. You may also want to look at - the current changelog. -

- -
-
-

- If eclipse is your IDE / editor of choice, you might consider - the - Eclipse plugin. -

-

- For automatic "find and install", the URL is : -

http://simpletest.org/eclipse/
-

-
-
-

- SimpleTest has been packaged by the community to different flavours. -

- -

- Note : careful, some versions are not always up-to-date. -

-
-
-

- The source code is hosted on Sourceforge as well : you can browse the - SVN repository - there. -

-
-
- -
-
- - - Current release - - - Eclipse release - - - Packages - - - Source - - - Older stable releases - - - - - - - - - SimpleTest, - download, - source code, - stable release, - eclipse release, - eclipse plugin, - debian package, - drupal module, - pear channel, - pearified package - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/expectation_documentation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/expectation_documentation.xml deleted file mode 100644 index 74a0f02..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/expectation_documentation.xml +++ /dev/null @@ -1,383 +0,0 @@ - - - - - Extending the SimpleTest unit tester with additional expectation classes - - -
-

- The default behaviour of the - mock objects - in - SimpleTest - is either an identical match on the argument or to allow any argument at all. - For almost all tests this is sufficient. - Sometimes, though, you want to weaken a test case. -

-

- One place where a test can be too tightly coupled is with - text matching. - Suppose we have a component that outputs a helpful error - message when something goes wrong. - You want to test that the correct error was sent, but the actual - text may be rather long. - If you test for the text exactly, then every time the exact wording - of the message changes, you will have to go back and edit the test suite. -

-

- For example, suppose we have a news service that has failed - to connect to its remote source. -class NewsService { - ... - function publish($writer) { - if (! $this->isConnected()) { - $writer->write('Cannot connect to news service "' . - $this->_name . '" at this time. ' . - 'Please try again later.'); - } - ... - } -} -]]> - Here it is sending its content to a - Writer class. - We could test this behaviour with a - MockWriter like so... - - $writer = new MockWriter(); - $writer->expectOnce('write', array( - 'Cannot connect to news service ' . - '"BBC News" at this time. ' . - 'Please try again later.')); - - $service = new NewsService('BBC News'); - $service->publish($writer); - } -} -]]> - This is a good example of a brittle test. - If we decide to add additional instructions, such as - suggesting an alternative news source, we will break - our tests even though no underlying functionality - has been altered. -

-

- To get around this, we would like to do a regular expression - test rather than an exact match. - We can actually do this with... - - $writer->expectOnce( - 'write', - array(new PatternExpectation('/cannot connect/i'))); - - $service = new NewsService('BBC News'); - $service->publish($writer); - } -} -]]> - Instead of passing in the expected parameter to the - MockWriter we pass an - expectation class called - PatternExpectation. - The mock object is smart enough to recognise this as special - and to treat it differently. - Rather than simply comparing the incoming argument to this - object, it uses the expectation object itself to - perform the test. -

-

- The PatternExpectation takes - the regular expression to match in its constructor. - Whenever a comparison is made by the MockWriter - against this expectation class, it will do a - preg_match() with this pattern. - With our test case above, as long as "cannot connect" - appears in the text of the string, the mock will issue a pass - to the unit tester. - The rest of the text does not matter. -

-

- The possible expectation classes are... - - - - - - - - - - - - - - - -
AnythingExpectationWill always match
EqualExpectationAn equality, rather than the stronger identity comparison
NotEqualExpectationAn inequality comparison
IndenticalExpectationThe default mock object check which must match exactly
NotIndenticalExpectationInverts the mock object logic
WithinMarginExpectationCompares a value to within a margin
OutsideMarginExpectationChecks that a value is out side the margin
PatternExpectationUses a Perl Regex to match a string
NoPatternExpectationPasses only if failing a Perl Regex
IsAExpectationChecks the type or class name only
NotAExpectationOpposite of the IsAExpectation
MethodExistsExpectationChecks a method is available on an object
TrueExpectationAccepts any PHP variable that evaluates to true
FalseExpectationAccepts any PHP variable that evaluates to false
- Most take the expected value in the constructor. - The exceptions are the pattern matchers, which take a regular expression, - and the IsAExpectation and NotAExpectation which takes a type - or class name as a string. -

-

- Some examples... -

-

-expectOnce('method', array(new IdenticalExpectation(14))); -]]> - This is the same as $mock->expectOnce('method', array(14)). -expectOnce('method', array(new EqualExpectation(14))); -]]> - This is different from the previous version in that the string - "14" as a parameter will also pass. - Sometimes the additional type checks of SimpleTest are too restrictive. -expectOnce('method', array(new AnythingExpectation(14))); -]]> - This is the same as $mock->expectOnce('method', array('*')). -expectOnce('method', array(new IdenticalExpectation('*'))); -]]> - This is handy if you want to assert a literal "*". - - This matches on anything other than integer 14. - Even the string "14" would pass. - - This will accept any value from 13.999 to 14.001 inclusive. -

-
-
-

- The expectation classes can be used not just for sending assertions - from mock objects, but also for selecting behaviour for the - mock objects. - Anywhere a list of arguments is given, a list of expectation objects - can be inserted instead. -

-

- Suppose we want a mock authorisation server to simulate a successful login, - but only if it receives a valid session object. - We can do this as follows... - -$authorisation = new MockAuthorisation(); -$authorisation->setReturnValue( - 'isAllowed', - true, - array(new IsAExpectation('Session', 'Must be a session'))); -$authorisation->setReturnValue('isAllowed', false); -]]> - We have set the default mock behaviour to return false when - isAllowed is called. - When we call the method with a single parameter that - is a Session object, it will return true. - We have also added a second parameter as a message. - This will be displayed as part of the mock object - failure message if this expectation is the cause of - a failure. -

-

- This kind of sophistication is rarely useful, but is included for - completeness. -

-
-
-

- The expectation classes have a very simple structure. - So simple that it is easy to create your own versions for - commonly used test logic. -

-

- As an example here is the creation of a class to test for - valid IP addresses. - In order to work correctly with the stubs and mocks the new - expectation class should extend - SimpleExpectation or forther extend a subclass... -class ValidIp extends SimpleExpectation { - - function test($ip) { - return (ip2long($ip) != -1); - } - - function testMessage($ip) { - return "Address [$ip] should be a valid IP address"; - } -} -]]> - There are only two methods to implement. - The test() method should - evaluate to true if the expectation is to pass, and - false otherwise. - The testMessage() method - should simply return some helpful text explaining the test - that was carried out. -

-

- This class can now be used in place of the earlier expectation - classes. -

-

- Here is a more typical example, matching part of a hash... -class JustField extends EqualExpectation { - private $key; - - function __construct($key, $expected) { - parent::__construct($expected); - $this->key = $key; - } - - function test($compare) { - if (! isset($compare[$this->key])) { - return false; - } - return parent::test($compare[$this->key]); - } - - function testMessage($compare) { - if (! isset($compare[$this->key])) { - return 'Key [' . $this->key . '] does not exist'; - } - return 'Key [' . $this->key . '] -> ' . - parent::testMessage($compare[$this->key]); - } -} -]]> - We tend to seperate message clauses with - " ]]>". - This allows derivative tools to reformat the output. -

-

- Suppose some authenticator is expecting to be given - a database row corresponding to the user, and we - only need to confirm the username is correct. - We can assert just their username with... -expectOnce('authenticate', - array(new JustKey('username', 'marcus'))); -]]> -

-
-
-

- The SimpleTest unit testing framework - also uses the expectation classes internally for the - UnitTestCase class. - We can also take advantage of these mechanisms to reuse our - homebrew expectation classes within the test suites directly. -

-

- The most crude way of doing this is to use the generic - SimpleTest::assert() method to - test against it directly... -class TestOfNetworking extends UnitTestCase { - ... - function testGetValidIp() { - $server = &new Server(); - $this->assert( - new ValidIp(), - $server->getIp(), - 'Server IP address->%s'); - } -} -]]> - assert() will test any expectation class directly. -

-

- This is a little untidy compared with our usual - assert...() syntax. -

-

- For such a simple case we would normally create a - separate assertion method on our test case rather - than bother using the expectation class. - If we pretend that our expectation is a little more - complicated for a moment, so that we want to reuse it, - we get... - - function assertValidIp($ip, $message = '%s') { - $this->assert(new ValidIp(), $ip, $message); - } - - function testGetValidIp() { - $server = &new Server(); - $this->assertValidIp( - $server->getIp(), - 'Server IP address->%s'); - } -} -]]> - It is rare to need the expectations for more than pattern - matching, but these facilities do allow testers to build - some sort of domain language for testing their application. - Also, complex expectation classes could make the tests - harder to read and debug. - In effect extending the test framework to create their own tool set. -

-
-
- - - Using expectations for - more precise testing with mock objects - - - Changing mock object behaviour with expectations - - - Extending the expectations - - - Underneath SimpleTest uses expectation classes - - - - - SimpleTest project page on SourceForge. - - - SimpleTest download page on LastCraft. - - - The expectations mimic the constraints in JMock. - - - Full API for SimpleTest - from the PHPDoc. - - - - - mock objects, - test driven development, - inheritance of expectations, - mock object constraints, - advanced PHP unit testing, - test first, - test framework architecture - expectations in simpletest - test cases - server stubs - - -
diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/experimental_dom_tester.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/experimental_dom_tester.xml deleted file mode 100644 index fda46a0..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/experimental_dom_tester.xml +++ /dev/null @@ -1,231 +0,0 @@ - - - - [experimental] Testing elements by CSS selector - - -
- Careful : this documentation refers to un-released code. It's only available in SVN. -
-

- Before SimpleTest2 gets a new browser (PHP5 only and DOM based), a new - extension made its way to the SimpleTest trunk. -

-

- Note : it's already PHP5 only. -

-
-
-

- 1998 seems a long time ago now : it's the year - the the Web Standards Project (WaSP) - started fighting for standards. -

-

- Nearly ten years later, every web developper is now familiar with CSS : - id & class are the new tools of the trade. - The tricks you've learned while styling, you can re-use them when testing your web site. -

-

- I was about to start with the Flickr home page - but then again, this is what the HTML source looks like : - -

-
- - - - - - - -{% endspaceless %} -{% endblock form_row %} - -{% block hidden_row %} -{% spaceless %} - - - -{% endspaceless %} -{% endblock hidden_row %} - -{% block form_widget_compound %} -{% spaceless %} -
-[...] -]]> - Who said too many tables ? So I picked something else... - the SimpleTest home page ! - -
-
- -
-
- -[...] -]]> -

- -
-

- As usual we start with the necessary require_once - -]]> - The DomTestCase extends the WebTestCase, - we can just use it the same way. -

-

-assertTrue($this->get($url)); - $this->assertEqual($this->getUrl(), $url); - $this->assertElementsBySelector( - 'h2', - array('Screenshots', 'Documentation', 'Contributing') - ); - } -} -?> -]]> -

-

- I was expecting to get a nice green bar straight away : - I did wrote the HTML template after all. - Unfortunately it didn't happen, PHP gave me some nice exceptions : -

- home: /$ php dom_tester_doc_test.php
- dom_tester_doc_test.php
- Exception 1!
- Unexpected PHP error [DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: ID simpletestlogo already defined in Entity, line: 12] severity [E_WARNING] in [/Users/perrick/Sites/simpletest/extensions/dom_tester.php line 103]
- in testGet
- in TestOfLiveCssSelectors
- Exception 2!
- Unexpected PHP error [DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: ID simpletestdownload already defined in Entity, line: 16] severity [E_WARNING] in [/Users/perrick/Sites/simpletest/extensions/dom_tester.php line 103]
- in testGet
- in TestOfLiveCssSelectors
- Exception 3!
- Unexpected PHP error [DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: ID simpleteststarttesting already defined in Entity, line: 24] severity [E_WARNING] in [/Users/perrick/Sites/simpletest/extensions/dom_tester.php line 103]
- in testGet
- in TestOfLiveCssSelectors
- Exception 4!
- Unexpected PHP error [DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: ID simpletestsupport already defined in Entity, line: 38] severity [E_WARNING] in [/Users/perrick/Sites/simpletest/extensions/dom_tester.php line 103]
- in testGet
- in TestOfLiveCssSelectors
- FAILURES!!!
- Test cases run: 1/1, Passes: 3, Failures: 0, Exceptions: 4
-
- That's what validation is all about I guess. -

-

- Back to the drawing board... A simple fix later, everything is fine. -

- home: /$ php dom_tester_doc_test.php
- dom_tester_doc_test.php
- OK
- Test cases run: 1/1, Passes: 3, Failures: 0, Exceptions: 0
-
-

-
-
-

- If you thought it was easy, we can make things a little bit more difficult - - or precise - with attribute selectors : -assertTrue($this->get($url)); - $this->assertEqual($this->getUrl(), $url); - $this->assertElementsBySelector( - 'h2', - array('Screenshots', 'Documentation', 'Contributing') - ); - $this->assertElementsBySelector( - 'a[href="http://simpletest.org/api/"]', - array('the complete API', 'documented API') - ); - } -} -[...] -]]> -

- home: /$ php dom_tester_doc_test.php
- dom_tester_doc_test.php
- OK
- Test cases run: 1/1, Passes: 4, Failures: 0, Exceptions: 0
-
-

-

- Oh and by the way, combinators do work as well : -assertTrue($this->get($url)); - $this->assertEqual($this->getUrl(), $url); - $this->assertElementsBySelector( - 'h2', - array('Screenshots', 'Documentation', 'Contributing') - ); - $this->assertElementsBySelector( - 'a[href="http://simpletest.org/api/"]', - array('the complete API', 'documented API') - ); - $this->assertElementsBySelector( - 'div#content > p > strong', - array('SimpleTest PHP unit tester') - ); - } -} -[...] -]]> -

- home: /$ php dom_tester_doc_test.php
- dom_tester_doc_test.php
- OK
- Test cases run: 1/1, Passes: 5, Failures: 0, Exceptions: 0
-
-

-
- - - A Recorder for non-developpers. - Exploring the Recorder results. - - - - The JUnit FAQ - has plenty of useful testing advice. - - - Next is grouping test - cases together. - - - You will need the SimpleTest testing framework - for these examples. - - - - - software development, - php programming, - programming php, - software development tools, - php tutorial, - free php scripts, - architecture, - php resources, - mock objects, - junit, - php testing, - unit test, - automated php testing, - test cases tutorial, - explain unit test case, - unit test example, - unit test - - - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/experimental_intro.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/experimental_intro.xml deleted file mode 100644 index 430e250..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/experimental_intro.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - Experimental stuff, found in SVN only - -
-

- If a bug is found in SimpleTest, chances are it'll get corrected - inside the Subversion (SVN) tree with the corresponding test case : just to make - sure the bug doesn't make a come back later on. -

-

- Also the SimpleTest SVN trunk is usually full of little known - experiments with code : new ideas are usually tried out there - before a general release. Before it happens, the documentation needs - to be completed : that's where this section comes into place. You'll - find here new features the dev team is happy with : we're looking - for comments... -

-

- The mailing-list is usually the best place to give feedback. Other options - includes submitting a bug or a patch directly on the Sourceforge trackers... -

-

- Note : some of these features may never make it to a release or not for - a long time! -

-
-
- - - SimpleTest mailing-lists' page on SourceForge. - - - SimpleTest trackers' page on Sourceforge as well. - - - - - php unit testing, - test integration, - documentation, - marcus baker, - simple test, - simpletest documentation, - phpunit, - pear, - experimental, - cvs, - code experiment, - feedback - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/experimental_recorder.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/experimental_recorder.xml deleted file mode 100644 index e4991cc..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/experimental_recorder.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - [experimental] Using the test results for other tools with the Recorder - - -
- Careful : this documentation refers to un-released code. It's only available in SVN. -
-

- What the developer wants from his tests is immediate feedback. The TextReporter - and the HtmlReporter are there to show this feedback. As quickly as possible - and as close to your working tools as possible : the console, the browser. -

-
-
-

- But often developers don't work alone : you may have a team contributing to - the same code base next door, a manager a little bit further away and even - a team of testers or power users on the other side of the planet. -

-

- For them as well tests' results are valuable pieces of information ! They just need - to be formatted and archived somewhere. The Recorder allows you to grab all - output to a simple PHP array. - -require_once('simpletest/ui/recorder.php'); - -$group = new TestSuite(); -$group->addTestFile('test_of_module_ship.php'); -$group->addTestFile('test_of_module_pay.php'); - -$recorder = new Recorder(); -$group->run($recorder); -?> -]]> -

-

- Within this $recorder object lies the test suite information. - Let's dump the $recorder->results variable and check what's - in it : - - array(4) { - ["time"]=> - int(1173951256) - ["status"]=> - string(6) "Passed" - ["test"]=> - string(129) "examples/test_of_module_ship.php->TestUsingParcelForce->testParcelForceIsFine" - ["message"]=> - string(97) " at [examples/test_of_module_ship.php line 7]" - } - [1]=> - array(4) { - ["time"]=> - int(1173951256) - ["status"]=> - string(6) "Passed" - ["test"]=> - string(154) "examples/test_of_module_ship.php->TestUsingMyOwnAirplane->testUsingMyOwnAirplaneOnlyWorksForSmallGifts" - ["message"]=> - string(134) "Expected false, got [Boolean: false] at [examples/test_of_module_ship.php line 13]" - } - [2]=> - array(4) { - ["time"]=> - int(1173951256) - ["status"]=> - string(6) "Passed" - ["test"]=> - string(135) "examples/test_of_module_pay.php->TestPayForParcelForce->testPayForParcelForceIsFine" - ["message"]=> - string(96) " at [examples/test_of_module_pay.php line 7]" - } - [3]=> - array(4) { - ["time"]=> - int(1173951256) - ["status"]=> - string(6) "Passed" - ["test"]=> - string(155) "examples/test_of_module_pay.php->TestPayForMyOwnAirplane->testPayForMyOwnAirplaneOnlyWorksForSmallGifts" - ["message"]=> - string(133) "Expected false, got [Boolean: false] at [examples/test_of_module_pay.php line 13]" - } -} -?> -]]> -

-
-
-

- Each element of the $recoder->results array contains one assertion's - information : -

    -
  • time : when the assertion was executed, in a timestamp format.
  • -
  • status : either Passed or Failed
  • -
  • test : the name of the test
  • -
  • message : the actual message, useful for understanding what went wrong
  • -
-

-

- Now iterating throught the results becomes really easy... -addTestFile('test_of_module_ship.php'); -$group->addTestFile('test_of_module_pay.php'); -$recorder = new Recorder(); -$group->run($recorder); - -foreach (recorder->results as $result) { - if ($result->status == "Failed") { - do_something_while_it_is_time(result); - } -} - -?> -]]> -

-
-
- - A Recorder for non-developers. - Exploring the Recorder results. - - - - The JUnit FAQ - has plenty of useful testing advice. - - - Next is grouping test - cases together. - - - You will need the SimpleTest testing framework - for these examples. - - - - - software development, - php programming, - programming php, - software development tools, - php tutorial, - free php scripts, - architecture, - php resources, - mock objects, - junit, - php testing, - unit test, - automated php testing, - test cases tutorial, - explain unit test case, - unit test example, - unit test - - -
diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/extension_eclipse.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/extension_eclipse.xml deleted file mode 100644 index b86278b..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/extension_eclipse.xml +++ /dev/null @@ -1,279 +0,0 @@ - - - - Simpletest Eclipse Plugin Documentation - -
-
    -
  • - Operating System.
    - This plugin should work on any platform on which Eclipse works. Specifically - the plugin has been tested to work on Linux, OS X, and Windows. If the - plugin does not appear to work on one of these platforms a new incompatibility - may have emerged, but this is relatively unlikely. -
  • -
  • - Eclipse
    - The plugin has been designed to work with Eclipse versions 3.1.X+ and 3.2.X+. - Eclipse in general requires a JVM version of 1.4.x; there are no additional requirements for the plugin. -
  • -
  • - PHP
    - The plugin has been tested to work with PHP 4.3.x+ (including PHP 5.1.x.). -
  • -
  • - Xdebug
    - The plugin can be configured to work with Xdebug (version 2.0.0RC1 or later). - The php.ini file which is used by the plugin (see below for specifying the php.ini file) must load the Xdebug extension. - This is usually accomplished by adding a zend_extension_ts="Some Windows Path" or zend_extension="Some Linux Path" to your php.ini file. - Specific instructions can be found at: http://xdebug.org/install.php - Do not worry about specifying any other parameters, the plugin will handle setting the necessary parameters, as needed. -
  • -
  • - Simpletest
    - The plugin has been designed to work with a specific version of Simpletest - and in fact includes the associated version of Simpletest in the plugin for compatibility. - A plugin with a version number of 1.0.0_0.0.4 would indicate that the plugin was compatible - with Simpletest version 1.0.0 and was version 0.0.4 of the plugin. - Some slight modifications to the Simpletest code are required to make the plugin - work with Simpletest; these modifications may or may not be in the released version of Simpletest. -
  • -
  • - PHPUnit2
    - Starting with plugin version 0.1.6 experimental support for the CVS version of PHPUnit2 - is available. To use PHPUnit2 select a path to PHPUnit2 and select PHPUnit2 test instead of - SimpleTest. Note: this is the path to the folder that contains the PHPUnit2 - folder. PHPUnit3 is not currently supported but will be supported in the near future. -
  • -
-
-
-
    -
  1. Download and Install Eclipse (www.eclipse.org) – if you are not sure what to download, download the Eclipse 3.1.0 SDK.
  2. -
  3. Download the latest Simpletest Eclipse plug-in zip file (Simpletest Sourceforge)
  4. -
  5. Extract the zip file to a temporary location {this will be referred to later in this documentation as $unzip}
  6. -
  7. Start Eclipse
  8. -
  9. Open the Install Wizard by clicking "Help" > "Software Updates" > "Find and Install" from the menu bar.
  10. -
  11. Select the second button, "Search for new features to install" and click "Next".
  12. -
  13. Click the button on the right hand side, "New Local Site".
  14. -
  15. Select the folder $unzip {the folder extracted previously}.
  16. -
  17. Click the "OK" button.
  18. -
  19. In the "Edit Local Site" window, Click the "OK" button
  20. -
  21. Click the "Finish" button
  22. -
  23. In the "Search Results" window, drill down and select "Simpletest plug-in 0.0.x"
  24. -
  25. Click the "Next" button.
  26. -
  27. Read the license and accept the license by clicking the "I accept the terms in the license agreement" radio button and then clicking the "Next" button
  28. -
  29. In the "Installation" window you can choose to change the location -- most users should just click the "Finish" button
  30. -
  31. In the "Feature Verification" window, click the "Install" button.
  32. -
  33. When prompted, restart Eclipse
  34. -
  35. -

    After starting Eclipse for the first time after installation - you will need to perform a quick configuration of the Simpletest Plug-in. - To perform this configuration: -

    -
      -
    1. - Select "Window" > "Preferences" from the menu bar -
    2. -
    3. - Select "Simpletest" from the categories on the left hand side of the popup box. -
    4. -
    5. - Enter or Browse for the location of a PHP executable to use. -
    6. -
    7. - Leave the include file blank -
    8. -
    9. - Enter .php as the Test File Suffix. - Alternately if you name your test PHP files with a sufficiently different suffix - (e.g sometest.tst.php) you could enter in a more differentiating suffix (e.g. .tst.php). - This helps when the plug-in is looking for tests to execute. -
    10. -
    11. - Hit the "Ok" button to close the preferences window. -
    12. -
    -
  36. -
-
-
- Note: this will only work if you have previously installed the plugin using the - Eclipse installation wizard. If you previously copied directories for installation, - it is recommended that you shutdown Eclipse, delete the previous version directories, and - follow the Installation instructions above (you should not have to perform the initial configuration - portion). -
    -
  1. Select "Help" > "Software Updates" > "Manage Configuration" from the menu
  2. -
  3. Drill down to find the Simpletest plugin and select it
  4. -
  5. In the right hand pane click the link for "Scan for Updates"
  6. -
  7. IF no updates are found, navigate to Window > Preferences > Install/Update > Valid Updates in the Eclipse preferences and select 'Compatible', not 'equivalent'. Then repeat the steps above.
  8. -
  9. Select the feature versions that you wish to upgrade, and click "Next".
  10. -
  11. Review the license agreements for the upgraded features. If the terms of all these licenses are acceptable, check "I accept the terms in the license agreements." Do not proceed to download the features if the license terms are not acceptable.
  12. -
  13. Click "Install" to allow the downloading and installing to proceed.
  14. -
  15. Once all the features and plug-ins have been downloaded successfully and their files installed into the product on the local computer, a new configuration that incorporates these features and plug-ins will be formulated. Click Yes when asked to exit and restart the Workbench for the changes to take effect.
  16. -
-
-
-

- Note: this will only work if the plugin was installed via the Feature Update method. If installed via alternate methods, then the plugin can be uninstalled by deleting the directories which were previously added. -

-
    -
  1. Select "Help" > "Software Updates" > "Manage Configuration"
  2. -
  3. Drill down to find the Simpletest plugin
  4. -
  5. Right-click on the Simpletest plugin and select the option "Disable"
  6. -
  7. when prompted, restart Eclipse
  8. -
  9. After Eclipse has restarted, select "Help" > "Software Updates" > "Manage Configuration" from the menu bar
  10. -
  11. Select the option from the toolbar "Show Disabled Features"
  12. -
  13. Drill down to find the Simpletest plugin
  14. -
  15. Right-click on the Simpletest plugin and select the option "Uninstall"
  16. -
  17. When prompted, restart Eclipse
  18. -
-
-
-

- The following details some sample usages of the plugin. -

-
    -
  1. Create a new test project (a holding place for related files) -
      -
    1. Select "File" > "New" > "Project.." from the menu
    2. -
    3. Expand the folder "General" and select "Project"
    4. -
    5. Click the "Next" button
    6. -
    7. On the next tab enter a project name: "Test"
    8. -
    9. Use the default Project Contents
    10. -
    11. Click the "Finish" button
    12. -
    -
  2. -
  3. Create a Single Passing Test -
      -
    1. In the Package Explorer View right-click on the "Test" project and select "New" > "File".
    2. -
    3. For the filename enter: test1.php and click "Finish"
    4. -
    5. Double-click on the test1.php entry in the Package Explorer which should open a new view to edit the file.
    6. -
    7. Enter the following for the contents of the file: -assertEqual(3,$total, "This should pass"); - } -} -?> -]]> -
    8. -
    9. Select "File" > "Save" from the menu.
    10. -
    11. Right click on the test1.php entry and select "Run" > "Run Simpletest".
    12. -
    13. The "Result View" should populate with information about the test run and the Simpletest console should fill with some information as well.
    14. -
    -
  4. -
  5. Single Test class multiple tests -
      -
    1. In the Package Explorer View right-click on the "Test" project and select "New" > "File".
    2. -
    3. For the filename enter: test2.php and click "Finish".
    4. -
    5. Double-click on the test2.php entry in the Package Explorer which should open a new view to edit the file.
    6. -
    7. Enter the following for the contents of the file: -assertEqual(3,$total, "This should pass"); - } - function test_fail(){ - $x = 1; - $y = 2; - $total = $x + $y; - $this->assertEqual(4,$total,"This should fail"); - } -} -?> -]]> -
    8. -
    9. Select "File" > "save" from the menu bar.
    10. -
    11. Right click on the test2.php entry and select "Run" > "Run Simpletest".
    12. -
    13. The Result View should populate with information about the test run and the Simpletest console should fill with some information as well
    14. -
    -
  6. -
  7. Group Tests (test multiple files at once) -
      -
    1. In the Package Explorer View right-click on the "Test" project and select "New" > "File"
    2. -
    3. For the filename enter: grouptest.php and click "Finish".
    4. -
    5. Double-click on the grouptest.php entry in the Package Explorer which should open a new view to edit the file.
    6. -
    7. Enter the following for the contents of the file: -addTestFile(dirname(__FILE__).'/test1.php'); - $this->addTestFile(dirname(__FILE__).'/test2.php'); - } -} -?> -]]> -
    8. -
    9. Select "File" > "save" from the menu
    10. -
    11. Right click on the grouptest.php entry and select "Run" > "Run Simpletest"
    12. -
    13. The Result View should populate with information about the test run and the Simpletest console should fill with some information as well
    14. -
    -
  8. -
-
-
-
    -
  • - Make sure that if a constructor is used in the test case - that the last line of the constructor calls the parent - constructor (e.g. parent::UnitTestCase) -
  • -
  • - Do not put any assertions into the test class constructor -
  • -
  • - If you get an error indicating that a class could not load; then restart Eclipse. Once - Eclipse restarts, open the Result View manually by selecting "Window"->"Show View"->"Other..." - Then select the SimpleTest Category and select "Result View" and click "OK". -
  • -
-
-
-

These are features that should eventually make it into this plugin

-
    -
  • - Allow different "include" file on each runner (override the "master" include) -
  • -
  • - Handle fatal errors better -
  • -
-
-
- - - - software development, - eclipse plugin, - php programming, - programming php, - software development tools, - php tutorial, - free php scripts, - architecture, - php resources, - mock objects, - junit, - php testing, - unit test, - automated php testing, - test cases tutorial, - explain unit test case, - unit test example, - unit test - - -
diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/first_test_tutorial.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/first_test_tutorial.xml deleted file mode 100644 index 962ec80..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/first_test_tutorial.xml +++ /dev/null @@ -1,436 +0,0 @@ - - - - PHP unit testing tutorial - Creating an example test case in PHP - - -

- If you are new to unit testing it is recommended that you - actually try the code out as we go. - There is actually not very much to type and you will get - a feel for the rhythm of test first programming. -

-

- To run the examples as is, you need an empty directory with the folders - classes, tests and temp. - Unpack the SimpleTest framework - into the tests folder and make sure your web server - can reach these locations. -

-
-
-

- The quick introductory example - featured the unit testing of a simple log class. - In this tutorial on SimpleTest I am going to try to - tell the whole story of developing this class. - This PHP class is small and simple and in the course of - this introduction will receive far more attention than - it probably would in production. - Yet even this tiny class contains some surprisingly difficult - design decisions. -

-

- Maybe they are too difficult? - Rather than trying to design the whole thing up front - I'll start with a known requirement, namely - we want to write messages to a file. - These messages must be appended to the file if it exists. - Later we will want priorities and filters and things, but - for now we will place the file writing requirement in - the forefront of our thoughts. - We will think of nothing else for fear of getting confused. - OK, let's make a test... - -]]> - Piece by piece here is what it all means. -

-

- The dirname(__FILE__) construct just ensures - that the path is taken relative current file. -

-

- What is this autorun.php file? - This file does the expected work of pulling in the definitions - of UnitTestCase. - It collects all test classes in the current file and runs - them automagically. - It does this by setting up an exit handler. - More on this later when we look at modifying the output. -

-

- The tests themselves are gathered in test case classes. - This one, the TestOfLoggingclass , is typical in extending - UnitTestCase. - When the test case is invoked by the autorunner it will - search for any method within that starts with the name "test". - Each of these methods will be executed in the order they are - defined in the class. -

-

- Our only test method at present is called - testFirstLogMessagesCreatesFileIfNonexistent(). - There is nothing in it yet. -

-

- Now the empty method definition on its own does not do anything. - We need to actually place some code inside it. - The UnitTestCase class - will typically generate test events when run and these events are - sent to an observing reporter using methods inherited from - UnitTestCase. -

-

- Now to add test code... - - -class TestOfLogging extends UnitTestCase { - function testFirstLogMessagesCreatesFileIfNonexistent() { - @unlink(dirname(__FILE__) . '/../temp/test.log'); - $log = new Log(dirname(__FILE__) . '/../temp/test.log'); - $log->message('Should write this to a file'); - $this->assertTrue(file_exists(dirname(__FILE__) . '../temp/test.log')); - } -} -?> -]]> -

-

- You are probably thinking that that is a lot of test code for - just one test and I would agree. - Don't worry. - This is a fixed cost and from now on we can add tests - pretty much as one liners. - Even less when using some of the test artifacts that we - will use later. -

-

- You might also have been thinking that - testFirstLogMessagesCreatesFileIfNonexistent - is an awfully long method name. - Normally that would be true, but here it's a good thing. - We will never type this name again, and we save ourselves having - to write comments or specifications. -

-

- Now comes the first of our decisions. - Our test file is called log_test.php (any name - is fine) and is in a folder called tests (anywhere is fine). - We have called our code file log.php and this is - the code we are going to test. - I have placed it into a folder called classes, so that means - we are building a class, yes? -

-

- For this example I am, but the unit tester is not restricted - to testing classes. - It is just that object oriented code is easier to break - down and redesign for testing. - It is no accident that the fine grain testing style of unit - tests has arisen from the object community. -

-

- The test itself is minimal. - It first deletes any previous test file that may have - been left lying around. - Design decisions now come in thick and fast. - Our class is called Log - and takes the file path in the constructor. - We create a log and immediately send a message to - it using a method named - message(). - Sadly, original naming is not a desirable characteristic - of a software developer. -

-

- The smallest unit of a...er...unit test is the assertion. - Here we want to assert that the log file we just sent - a message to was indeed created. - UnitTestCase::assertTrue() - will send a pass event if the condition evaluates to - true and a fail event otherwise. - We can have a variety of different assertions and even more - if we extend our base test cases. -

-

- Here is the base list... - - - - - - - - - - - - - - - - - - - - - -
assertTrue($x)Fail unless $x evaluates true
assertFalse($x)Fail unless $x evaluates false
assertNull($x)Fail unless $x is not set
assertNotNull($x)Fail unless $x is set to something
assertIsA($x, $t)Fail unless $x is the class or type $t
assertNotA($x, $t)Fail unless $x is not the class or type $t
assertEqual($x, $y)Fail unless $x == $y is true
assertNotEqual($x, $y)Fail unless $x == $y is false
assertWithinMargin($x, $y, $margin)Fail unless $x and $y are separated less than $margin
assertOutsideMargin($x, $y, $margin)Fail unless $x and $y are sufficiently different
assertIdentical($x, $y)Fail unless $x === $y for variables, $x == $y for objects of the same type
assertNotIdentical($x, $y)Fail unless $x === $y is false, or two objects are unequal or different types
assertReference($x, $y)Fail unless $x and $y are the same variable
assertCopy($x, $y)Fail unless $x and $y are the different in any way
assertSame($x, $y)Fail unless $x and $y are the same objects
assertClone($x, $y)Fail unless $x and $y are identical, but separate objects
assertPattern($p, $x)Fail unless the regex $p matches $x
assertNoPattern($p, $x)Fail if the regex $p matches $x
expectError($e)Triggers a fail if this error does not happen before the end of the test
expectException($e)Triggers a fail if this exception is not thrown before the end of the test
-

-

- We are now ready to execute our test script by pointing the - browser at it. - What happens? - It should crash... -

- Fatal error: Failed opening required '../classes/log.php' (include_path='') in /home/marcus/projects/lastcraft/tutorial_tests/Log/tests/log_test.php on line 7 -
- The reason is that we have not yet created log.php. -

-

- Hang on, that's silly! - You aren't going to build a test without creating any of the - code you are testing, surely...? -

-
-
-

- Co-inventor of - Extreme Programming, - Kent Beck, has come up with another manifesto. - The book is called - Test driven development - or TDD and raises unit testing to a senior position in design. - In a nutshell you write a small test first and - then only get this passing by writing code. - Any code. - Just get it working. -

-

- You write another test and get that passing. - What you will now have is some duplication and generally lousy - code. - You re-arrange, or "refactor", that code while the tests are passing. - This stops you breaking anything. - Once the code is as clean as possible you are ready to add more - functionality, which you don't do. - Instead you add another test for your feature and start the - cycle again. - Your functionality gets created by trying to pass the tests that - define it. -

-

- Think of it as an executable specification that you create just in time. -

-

- This is a radical approach and one that I feel is incomplete, - but it makes for a great way to explain a unit tester! - We happen to have a failing, not to say crashing, test right now so - let's write some code into log.php... - -]]> - This is the minimum to avoid a PHP fatal error. - We now get the response... -

-

TestOfLogging

- Fail: testFirstLogMessagesCreatesFileIfNonexistent->True assertion failed.
-
1/1 test cases complete. - 0 passes, 1 fails and 0 exceptions.
-
- And "TestOfLogging" has failed. - SimpleTest uses class names by default to describe the tests, but - we can replace the name with our own... -function __construct() { - parent::__construct('Log test'); - } - - function testFirstLogMessagesCreatesFileIfNonexistent() { - @unlink(dirname(__FILE__) . '/../temp/test.log'); - $log = new Log(dirname(__FILE__) . '/../temp/test.log'); - $log->message('Should write this to a file'); - $this->assertTrue(file_exists(dirname(__FILE__) . '/../temp/test.log')); - } -} -]]> - Giving... -
-

Log test

- Fail: testFirstLogMessagesCreatesFileIfNonexistent->File created.
-
1/1 test cases complete. - 0 passes, 1 fails and 0 exceptions.
-
- If you want to change the test name, then you'd have to do it by - changing the reporter output, which we look at later. -

-

- To get the test passing we could just create the file in the - Log constructor. - This "faking it" technique is very useful for checking - that your tests work when the going gets tough. - This is especially so if you have had a run of test failures - and just want to confirm that you haven't just missed something - stupid. - We are not going that slow, so... - - var $path; - - function __construct($path) { - $this->path = $path; - } - - function message($message) { - $file = fopen($this->path, 'a'); - fwrite($file, $message . "\n"); - fclose($file); - } -} -?> -]]> - It took me no less than four failures to get to the next step. - I had not created the temporary directory, I had not made it - publicly writeable, I had one typo and I did not check in the - new directory to CVS (I found out later). - Any one of these could have kept me busy for several hours if - they had come to light later, but then that is what testing is for. -

-

- With the necessary fixes we get... -

-

Log test

-
1/1 test cases complete. - 1 passes, 0 fails and 0 exceptions.
-
- Success! -

-

- You may not like the rather minimal style of the display. - Passes are not shown by default because generally you do - not need more information when you actually understand what is - going on. - If you do not know what is going on then you should write another test. -

-

- OK, this is a little strict. - If you want to see the passes as well then you - can subclass the - HtmlReporter class - and attach that to the test instead. - Even I like the comfort factor sometimes. -

-
-
-

- There is a subtlety here. - We don't want the file created until we actually send - a message. - Rather than think about this too deeply we will just - assert it... - - $this->assertFalse(file_exists(dirname(__FILE__) . '/../temp/test.log')); - $log->message('Should write this to a file'); - $this->assertTrue(file_exists(dirname(__FILE__) . '/../temp/test.log')); - - } -} -]]> - ...and find it already works... -

-

TestOfLogging

-
1/1 test cases complete. - 2 passes, 0 fails and 0 exceptions.
-
- Actually I knew it would. - I am putting this test in to confirm this partly for peace of mind, but - also to document the behaviour. - That little extra test line says more in this context than - a dozen lines of use case or a whole UML activity diagram. - That the test suite acts as a source of documentation is a pleasant - side effect of all these tests. -

-

- Should we clean up the temporary file at the end of the test? - I usually do this once I am finished with a test method - and it is working. - I don't want to check in code that leaves remnants of - test files lying around after a test. - I don't do it while I am writing the code, though. - I probably should, but sometimes I need to see what is - going on and there is that comfort thing again. -

-

- In a real life project we usually have more than one test case, - so we next have to look at - grouping tests into test suites. -

-
-
- - Creating a new test case. - Test driven development in PHP. - Tests as documentation is one of many side effects. - - - - The JUnit FAQ - has plenty of useful testing advice. - - - Next is grouping test - cases together. - - - You will need the SimpleTest testing framework - for these examples. - - - - - software development, - php programming, - programming php, - software development tools, - php tutorial, - free php scripts, - architecture, - php resources, - mock objects, - junit, - php testing, - unit test, - automated php testing, - test cases tutorial, - explain unit test case, - unit test example, - unit test - - -
diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/form_testing_documentation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/form_testing_documentation.xml deleted file mode 100644 index d7ccceb..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/form_testing_documentation.xml +++ /dev/null @@ -1,304 +0,0 @@ - - - - SimpleTest documentation for testing HTML forms - -
-

- When a page is fetched by the WebTestCase - using get() or - post() the page content is - automatically parsed. - This results in any form controls that are inside <form> tags - being available from within the test case. - For example, if we have this snippet of HTML... -


-    
-    
-
-]]>
- Which looks like this... -

-

-

- - -
-

-

- We can navigate to this code, via the - LastCraft - site, with the following test... - - function testDefaultValue() { - $this->get('http://www.lastcraft.com/form_testing_documentation.php'); - $this->assertField('a', 'A default'); - } -} -]]> - Immediately after loading the page all of the HTML controls are set at - their default values just as they would appear in the web browser. - The assertion tests that a HTML widget exists in the page with the - name "a" and that it is currently set to the value - "A default". - As usual, we could use a pattern expectation instead of a fixed - string. -get('http://www.lastcraft.com/form_testing_documentation.php'); - $this->assertField('a', new PatternExpectation('/default/')); - } -} -]]> - We could submit the form straight away, but first we'll change - the value of the text field and only then submit it... -get('http://www.my-site.com/'); - $this->assertField('a', 'A default'); - $this->setField('a', 'New value'); - $this->click('Go'); - } -} -]]> - Because we didn't specify a method attribute on the form tag, and - didn't specify an action either, the test case will follow - the usual browser behaviour of submitting the form data as a GET - request back to the same location. - In general SimpleTest tries to emulate typical browser behaviour as much as possible, - rather than attempting to catch any form of HTML omission. - This is because the target of the testing framework is the PHP application - logic, not syntax or other errors in the HTML code. - For HTML errors, other tools such as - HTMLTidy should be used, - or any of the HTML and CSS validators already out there. -

-

- If a field is not present in any form, or if an option is unavailable, - then WebTestCase::setField() will return - false. - For example, suppose we wish to verify that a "Superuser" - option is not present in this form... -

Select type of user to add:
-
-]]>
- Which looks like... -

-

-

- Select type of user to add: - -
-

-

- The following test will confirm it... - - $this->get('http://www.lastcraft.com/form_testing_documentation.php'); - $this->assertFalse($this->setField('type', 'Superuser')); - } -} -]]> - The current selection will not be changed if the new value is not an option. -

-

- Here is the full list of widgets currently supported... -

    -
  • Text fields, including hidden and password fields.
  • -
  • Submit buttons including the button tag, although not yet reset buttons
  • -
  • Text area. This includes text wrapping behaviour.
  • -
  • Checkboxes, including multiple checkboxes in the same form.
  • -
  • Drop down selections, including multiple selects.
  • -
  • Radio buttons.
  • -
  • Images.
  • -
-

-

- The browser emulation offered by SimpleTest mimics - the actions which can be perform by a user on a - standard HTML page. Javascript is not supported, and - it's unlikely that support will be added any time - soon. -

-

- Of particular note is that the Javascript idiom of - passing form results by setting a hidden field cannot - be performed using the normal SimpleTest - commands. See below for a way to test such forms. -

-
-
-

- SimpleTest can cope with two types of multivalue controls: Multiple - selection drop downs, and multiple checkboxes with the same name - within a form. - The multivalue nature of these means that setting and testing - are slightly different. - Using checkboxes as an example... -


-    Create privileges allowed:
-    
- Retrieve privileges allowed: -
- Update privileges allowed: -
- Destroy privileges allowed: -
- - -]]>
- Which renders as... -

-

-

- Create privileges allowed: -
- Retrieve privileges allowed: -
- Update privileges allowed: -
- Destroy privileges allowed: -
- -
-

-

- If we wish to disable all but the retrieval privileges and - submit this information we can do it like this... - - function testDisableNastyPrivileges() { - $this->get('http://www.lastcraft.com/form_testing_documentation.php'); - $this->assertField('crud', array('c', 'r', 'u', 'd')); - $this->setField('crud', array('r')); - $this->click('Enable Privileges'); - } -} -]]> - Instead of setting the field to a single value, we give it a list - of values. - We do the same when testing expected values. - We can then write other test code to confirm the effect of this, perhaps - by logging in as that user and attempting an update. -

-
-
-

- If you want to test a form which relies on javascript to set a hidden - field, you can't just call setField(). - The following code will not work: -// This does *not* work - $this->setField('a_hidden_field', '123'); - $this->clickSubmit('OK'); - } -} -]]> - Instead, you need to pass the additional form parameters to the - clickSubmit() method: -$this->clickSubmit('OK', array('a_hidden_field'=>'123')); - } - -} -]]> - Bear in mind that in doing this you're effectively stubbing out a - part of your software (the javascript code in the form), and - perhaps you might be better off using something like - Selenium to ensure a complete - test. -

-
-
-

- If you want to test a form handler, but have not yet written - or do not have access to the form itself, you can create a - form submission by hand. - - function testAttemptedHack() { - $this->post( - 'http://www.my-site.com/add_user.php', - array('type' => 'superuser')); - $this->assertNoText('user created'); - } -} -]]> - By adding data to the WebTestCase::post() - method, we are emulating a form submission. - You would normally only do this as a temporary expedient, or where - you are expecting a 3rd party to submit to a form. - The exception is when you want tests to protect you from - attempts to spoof your pages. -

-
-
- - - Changing form values and successfully - Submitting a simple form - - - Handling widgets with multiple values - by setting lists. - - - Bypassing javascript to set a hidden field. - - - Raw posting when you don't have a button - to click. - - - - - SimpleTest project page on SourceForge. - - - SimpleTest download page on LastCraft. - - - The developer's API for SimpleTest - gives full detail on the classes and assertions available. - - - - - software development, - php programming for clients, - customer focused php, - software development tools, - acceptance testing framework, - free php scripts, - architecture, - php resources, - HTMLUnit, - JWebUnit, - php testing, - unit test resource, - web testing - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/gain_control_tutorial.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/gain_control_tutorial.xml deleted file mode 100644 index f0bbc2c..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/gain_control_tutorial.xml +++ /dev/null @@ -1,290 +0,0 @@ - - - - PHP unit testing tutorial - Isolating variables when testing - - -

- In order to test a code module you need very tight control - of its environment. - If anything can vary behind the scenes, for example a - configuration file, then this could cause the tests - to fail unexpectedly. - This would not be a fair test of the code and could - cause you to spend fruitless hours examining code that - is actually working, rather than dealing with the configuration issue - that actually failed the test. - At the very least your test cases get more complicated in - taking account the possible variations. -

-
-
-

- There are often a lot of obvious variables that could affect - a unit test case, especially in the web development - environment in which PHP usually operates. - These include database set up, file permissions, network - resources and configuration amongst others. - The failure or misinstall of one of these components will - break the test suite. -

-

- Do we add tests to confirm these components are installed? - This is a good idea, but if you place them into code module - tests you will start to clutter you test code with detail - that is irrelavent to the immediate task. - They should be placed in their own test suite. -

-

- Another problem, though, is that our development machines - must have every system component installed to be able - to run the test suite. - Your tests run slower too. -

-

- When faced with this while coding we will often create wrapper - versions of classes that deal with these resources. - Ugly details of these resources are then coded once only. - I like to call these classes "gateway classes", - as they exist at the edges of the application, - the interface of your application with the rest of the - system. - These gateway classes are best simulated during testing - by fake versions. - These run faster and are often called - "Server Stubs", or in more generic form - "Mock Objects". - It is a great time saver to wrap and stub out such resources. -

-

- One often neglected external resource is time. -

-

- For example, to test a session time-out coders will often - temporarily set the session time limit to a small value, say two seconds, - and then do a sleep(3) - and assert that the session is now invalid. - That adds three seconds to your test suite and is usually - a lot of extra code making your session classes that maleable. - Far simpler is to have a way to suddenly advance the clock. - To control time. -

-
-
-

- We will again design our clock wrapper by first writing tests. - We add a clock test case to our tests/all_tests.php - test suite... -addTest(new TestOfLogging()); - $this->addTest(new TestOfClock()); - } -} -?> -]]> - Then we create the test case in the new file - tests/clock_test.php... - -class TestOfClock extends UnitTestCase { - function testClockTellsTime() { - $clock = new Clock(); - $this->assertEqual($clock->now(), time()); - } -} -?> -]]> - Our only test at the moment is that our new - Clock class acts - as a simple PHP time() - function substitute. - We will write the time shift functionality once we are green. - At the moment we are obviously not green... -

-
- Fatal error: Failed opening required '../classes/clock.php' (include_path='') in - /home/marcus/projects/lastcraft/tutorial_tests/tests/clock_test.php on line 2 -
-
- We create a classes/clock.php file... - -]]> - This regains our flow ready for coding. -
-

AllTests

- Fail: TestOfClock -> testClockTellsTime -> [NULL: ] should be equal to [integer: 1050257362]
-
3/3 test cases complete. - 4 passes, 1 fails and 0 exceptions.
-
- This is now easy to fix... - - return time(); - } -} -]]> - And we are green... -
-

AllTests

-
3/3 test cases complete. - 5 passes, 0 fails and 0 exceptions.
-
- There is still a problem. -

-

- The clock could roll over during the assertion causing the - result to be out by one second. - The chances are small, but if there were a lot of timing tests - you would end up with a test suite that is erratic, severely - limiting its usefulness. - We will tackle this shortly and for now just jot it onto our - "to do" list. -

-

- The advancement test looks like this... -assertEqual($clock->now(), time()); - } - - function testClockAdvance() { - $clock = new Clock(); - $clock->advance(10); - $this->assertEqual($clock->now(), time() + 10); - } -} -]]> - The code to get to green is straight forward and just involves adding - a time offset. - - private $offset = 0; - - function now() { - return time() + $this->offset; - } - - function advance($offset) { - $this->offset += $offset; - } -} -]]> -

-
-
-

- Our all_tests.php file has some repetition we could - do without. - We have to manually add our test cases from each included - file. - It is possible to remove it, but use of the following requires care. - The TestSuite class has a - convenience method called addFile() - that takes a PHP file as a parameter. - This mechanism makes a note of all the classes, requires in the - file and then has a look at any newly created classes. - If they are descendents of SimpleTestCase - they are added as a new TestSuite. -

-

- Here is our refactored test suite using this method... - -require_once(dirname(__FILE__) . '/simpletest/autorun.php'); - -class AllTests extends TestSuite { - function AllTests() { - parent::__construct(); - $this->addFile('log_test.php'); - $this->addFile('clock_test.php'); - } -} -?> -]]> - The pitfalls of this are... -

    -
  1. - If the test file has already been included, - no new classes will be added to this group -
  2. -
  3. - If the test file has other classes that are - related to SimpleTestCase - then these will be added to the group test as well. -
  4. -
- In practice neither of these turn out to be problems. - Test suites are usually a tree structure. - It's rare to need a test case in two places. - As for extra classes being included, they have to be - descendents of SimpleTestCase. - These are likely to be superclasses of helper code - for several other tests. - Simply marking them as abstract is - enough to stop them being run. -

-

- We should really fix the glitch with the possible - clock rollover so we'll - do this next. -

-
-
- - Time is an often neglected variable in tests. - A clock class allows us to alter time. - Tidying the group test. - - - - The previous section is - grouping unit tests. - - - The next section is - subclassing test cases. - - - You will need - the SimpleTest unit tester - for the examples. - - - - - software development, - php programming, - programming php, - software development tools, - php tutorial, - free php scripts, - architecture, - php resources, - mock objects, - junit, - php testing, - unit test, - php testing - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/group_test_documentation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/group_test_documentation.xml deleted file mode 100644 index 96c140a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/group_test_documentation.xml +++ /dev/null @@ -1,332 +0,0 @@ - - - - SimpleTest for PHP test suites - -
-

- To run test cases as part of a group, the test cases should really - be placed in files without the runner code... - -]]> - As many cases as needed can appear in a single file. - They should include any code they need, such as the library - being tested, but none of the simple test libraries. -

-

- If you have extended any test cases, you can include them - as well. In PHP 4... - - class MyFileTestCase extends UnitTestCase { - ... - } - SimpleTest::ignore('MyFileTestCase'); - - class FileTester extends MyFileTestCase { ... } - - class SocketTester extends UnitTestCase { ... } -?> -]]> - The FileTester class does - not contain any actual tests, but is a base class for other - test cases. - For this reason we use the - SimpleTestOptions::ignore() directive - to tell the upcoming group test to ignore it. - This directive can appear anywhere in the file and works - when a whole file of test cases is loaded (see below). -

-

- If you are using PHP 5, you do not need this special directive at all. - Simply mark any test cases that should not be run as abstract... -abstract class MyFileTestCase extends UnitTestCase { - ... -} - -class FileTester extends MyFileTestCase { ... } - -class SocketTester extends UnitTestCase { ... } -]]> -

-

- We will call this sample file_test.php. - Next we create a group test file, called say my_group_test.php. - You will think of a better name I am sure. -

-

- We will add the test file using a safe method... - - require_once('file_test.php'); - - $test = &new TestSuite('All file tests'); - $test->addTestCase(new FileTestCase()); - $test->run(new HtmlReporter()); -?> -]]> - This instantiates the test case before the test suite is - run. - This could get a little expensive with a large number of test - cases, and can be surprising behaviour. -

-

- The main problem is that for every test case - that we add we will have - to require_once() the test code - file and manually instantiate each and every test case. -

-

- We can save a lot of typing with... - - $test->addTestFile('file_test.php'); - $test->run(new HtmlReporter()); -?> -]]> - What happens here is that the TestSuite - class has done the require_once() - for us. - It then checks to see if any new test case classes - have been created by the new file and automatically adds - them to the group test. - Now all we have to do is add each new file. -

-

- No only that, but you can guarantee that the constructor is run - just before the first test method and, in PHP 5, the destructor - is run just after the last test method. -

-

- There are two things that could go wrong and which require care... -

    -
  1. - The file could already have been parsed by PHP, and so no - new classes will have been added. You should make - sure that the test cases are only included in this file - and no others (Note : with the new autorun - functionnality, this problem has now been solved). -
  2. -
  3. - New test case extension classes that get included will be - placed in the group test and run also. - You will need to add a SimpleTestOptions::ignore() - directive for these classes, or make sure that they are included - before the TestSuite::addTestFile() - line, or make sure that they are abstract classes. -
  4. -
-

-
-
-

- The above method places all of the test cases into one large group. - For larger projects though this may not be flexible enough; you - may want to group the tests in all sorts of ways. -

-

- To get a more flexible group test we can subclass - TestSuite and then instantiate it as needed... - - class FileTestSuite extends TestSuite { - function FileTestSuite() { - $this->TestSuite('All file tests'); - $this->addTestFile('file_test.php'); - } - } -?> -]]> - This effectively names the test in the constructor and then - adds our test cases and a single group below. - Of course we can add more than one group at this point. - We can now invoke the tests from a separate runner file... - - $test = &new FileTestSuite(); - $test->run(new HtmlReporter()); -?> -]]> - ...or we can group them into even larger group tests. - We can even mix groups and test cases freely as long as - we are careful about double includes... - - $test = &new BigTestSuite('Big group'); - $test->addTestFile('file_test_suite.php'); - $test->addTestFile('some_test_case.php'); - $test->run(new HtmlReporter()); -?> -]]> - In the event of a double include, ony the first instance - of the test case will be run. -

-

- If we still wish to run the original group test, and we - don't want all of these little runner files, we can - put the test runner code around guard bars when we create - each group. -TestSuite('All file tests'); - $test->addTestFile('file_test.php'); - } - } - - if (! defined('RUNNER')) { - define('RUNNER', true); - $test = &new FileTestSuite(); - $test->run(new HtmlReporter()); - } -?> -]]> - This approach requires the guard to be set when including - the group test file, but this is still less hassle than - lots of separate runner files. - You include the same guard on the top level tests to make sure - that run() will run once only - from the top level script that has been invoked. - - define('RUNNER', true); - require_once('file_test_suite.php'); - - $test = &new BigTestSuite('Big group'); - $test->addTestCase(new FileTestSuite()); - $test->addTestCase(...); - $test->run(new HtmlReporter()); -?> -]]> - As with the normal test cases, a TestSuite can - be loaded with the TestSuite::addTestFile() method. - - $test->addTestFile('file_test_suite.php'); - $test->addTestFile(...); - $test->run(new HtmlReporter()); -?> -]]> -

-
-
-

- If you already have unit tests for your code or are extending external - classes that have tests, it is unlikely that all of the test cases - are in SimpleTest format. - Fortunately it is possible to incorporate test cases from other - unit testers directly into SimpleTest group tests. -

-

- Say we have the following - PhpUnit - test case in the file config_test.php... -class ConfigFileTest extends TestCase { - function ConfigFileTest() { - $this->TestCase('Config file test'); - } - - function testContents() { - $config = new ConfigFile('test.conf'); - $this->assertRegexp('/me/', $config->getValue('username')); - } -} -]]> - The group test can recognise this as long as we include - the appropriate adapter class before we add the test - file... - - require_once('simpletest/adapters/phpunit_test_case.php'); - - $test = &new TestSuite('All file tests'); - $test->addTestFile('config_test.php'); - $test->run(new HtmlReporter()); -?> -]]> - There are only two adapters, the other is for the - PEAR - 1.0 unit tester... - - require_once('simpletest/adapters/pear_test_case.php'); - - $test = &new TestSuite('All file tests'); - $test->addTestFile('some_pear_test_cases.php'); - $test->run(new HtmlReporter()); -?> -]]> - The PEAR test cases can be freely mixed with SimpleTest - ones even in the same test file, - but you cannot use SimpleTest assertions in the legacy - test case versions. - This is done as a check that you are not accidently making - your test cases completely dependent on SimpleTest. - You may want to do a PEAR release of your library for example, - which would mean shipping it with valid PEAR::PhpUnit test - cases. -

-
-
- - - Different ways to group tests together. - - - Combining group tests into larger groups. - - - Integrating legacy test cases from other - types of PHPUnit. - - - - - SimpleTest project page on SourceForge. - - - SimpleTest download page on LastCraft. - - - - - php unit testing, test integration, documentation, marcus baker, simple test, - simpletest documentation, phpunit, pear - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/group_test_tutorial.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/group_test_tutorial.xml deleted file mode 100644 index 3dfd8ef..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/group_test_tutorial.xml +++ /dev/null @@ -1,239 +0,0 @@ - - - - - PHP unit testing tutorial - Grouping together unit - tests and examples of writing test cases - - - -

- Next up we will fill in some blanks and create a test suite. -

-
-
-

- Adding another test can be as simple as adding another method - to a test case... -UnitTestCase('Log class test'); - } - function testCreatingNewFile() { - @unlink('../temp/test.log'); - $log = new Log('../temp/test.log'); - $this->assertFalse(file_exists('../temp/test.log'), 'Created before message'); - $log->message('Should write this to a file'); - $this->assertTrue(file_exists('../temp/test.log'), 'File created'); - @unlink('../temp/test.log'); - } - function testAppendingToFile() { - @unlink('../temp/test.log'); - $log = new Log('../temp/test.log'); - $log->message('Test line 1'); - $messages = file('../temp/test.log'); - $this->assertWantedPattern('/Test line 1/', $messages[0]); - $log->message('Test line 2'); - $messages = file('../temp/test.log'); - $this->assertWantedPattern('/Test line 2/', $messages[1]); - @unlink('../temp/test.log'); - } -} -]]> - The assertWantedPattern() - test case method uses Perl style regular expressions for - matching. -

-

- All we are doing in this new test method is writing a line to a file and - reading it back twice over. - We simply want to confirm that the logger appends the - text rather than writing over the old file. - A little pedantic, but hey, it's a tutorial! -

-

- In fact this unit test actually passes straight away... -

-

Log class test

-
1/1 test cases complete. - 4 passes and 0 fails.
-
- The trouble is there is already a lot of repetition here, - we have to delete the test file before and after every test. - With outrageous plagarism from JUnit, - SimpleTest has setUp() and - tearDown() methods - which are run before and after every test respectively. - File deletion is common to all the test methods so we - should move that operation there. -

-

- Our tests are green so we can refactor... -UnitTestCase('Log class test'); - } - function setUp() { - @unlink('../temp/test.log'); - } - function tearDown() { - @unlink('../temp/test.log'); - } - function testCreatingNewFile() { - $log = new Log('../temp/test.log'); - $this->assertFalse(file_exists('../temp/test.log'), 'Created before message'); - $log->message('Should write this to a file'); - $this->assertTrue(file_exists('../temp/test.log'), 'File created'); - } - function testAppendingToFile() { - $log = new Log('../temp/test.log'); - $log->message('Test line 1'); - $messages = file('../temp/test.log'); - $this->assertWantedPattern('/Test line 1/', $messages[0]); - $log->message('Test line 2'); - $messages = file('../temp/test.log'); - $this->assertWantedPattern('/Test line 2/', $messages[1]); - } -} -]]> - The test stays green. - We can add non-test methods to the test case as long as the method - name does not start with the string "test". - Only the methods that start "test" are run. - This allows further optional refactoring... -UnitTestCase('Log class test'); - } - function setUp() { - @unlink('../temp/test.log'); - } - function tearDown() { - @unlink('../temp/test.log'); - } - function getFileLine($filename, $index) { - $messages = file($filename); - return $messages[$index]; - } - function testCreatingNewFile() { - $log = new Log('../temp/test.log'); - $this->assertFalse(file_exists('../temp/test.log'), 'Created before message'); - $log->message('Should write this to a file'); - $this->assertTrue(file_exists('../temp/test.log'), 'File created'); - } - function testAppendingToFile() { - $log = new Log('../temp/test.log'); - $log->message('Test line 1'); - $this->assertWantedPattern('/Test line 1/', $this->getFileLine('../temp/test.log', 0)); - $log->message('Test line 2'); - $this->assertWantedPattern('/Test line 2/', $this->getFileLine('../temp/test.log', 1)); - } -} -]]> - It is a matter of taste whether you prefer this version - to the previous one. There is a little more code, but - the logic of the test is clearer. -

-
-
-

- A test case does not function alone for very long. - When coding for real we usually want to run as many tests as - quickly and as often as we can. - This means grouping them together into test suites that - could easily include every test in the application. -

-

- Firstly we have to clean out the test running code from - our existing test case... - -require_once('../classes/log.php'); - -class TestOfLogging extends UnitTestCase { - ... -} -?> -]]> - We no longer need the SIMPLE_TEST - constant. - Next we create a group test called all_tests.php - in the tests folder... -addTestCase(new TestOfLogging()); -$test->run(new HtmlReporter()); -?> -]]> - We hardly notice the difference when things work... -

-

All tests

-
1/1 test cases complete. - 4 passes and 0 fails.
-
- Group tests add to the test case count. - Adding new test cases is very straight forward. - Simply include the test cases file and add any contained test - cases individually. - You can also nest group tests within other group tests - (although you should avoid loops). -

-

- In the next page - we will add these more quickly. -

-
-
- - - Adding another test to the test case - and refactoring. - - - The crude way to group unit tests. - - - - - Next is controlling - how the class under test interacts with the rest - of the system. - - - Previous is the creation - of a first test. - - - You need SimpleTest to run these examples. - - - - - software development, - php programming, - programming in php, - test first, - software development tools, - php tutorial, - free php scripts, - architecture, - php resources, - mock objects, - junit, - php testing, - unit test, - phpunit, - PHP unit testing - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/heartbeat.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/heartbeat.xml deleted file mode 100644 index fc702c6..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/heartbeat.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - Heartbeat : how is SimpleTest doing ? - - - - - -

- Want to know check how healthy SimpleTest's codebase is? - Well, do enjoy the tests results, commit history and last commits... -

-
-
-

-
-
-

-
-
-

-
-
- - - Current tests results - - - Commits per week - - - Last commits - - - - - software development, - computer programmer, - php programming, - programming php, - software development company, - software development uk, - php tutorial, - bespoke software development uk, - corporate web development, - architecture, - freelancer, - php resources, - wordtracker, - web marketing, - serach engines, - web positioning, - internet marketing - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/ideas.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/ideas.xml deleted file mode 100644 index 2eabee2..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/ideas.xml +++ /dev/null @@ -1,188 +0,0 @@ - - - - Ideas for Google Summer of Code Projects - - -

- Most of the stuff on the SimpleTest2 road map is incremental. - Ideas for Google Summer of Code projects are of another kind. - There're here to unleash and promote new crazy ideas to the project - and to PHP's testing universe! -

-

- Of course this list is not exhaustive: - if you have another itch to scratch, feel free - to add your wishes on the mailing-list. -

-
- Careful though : currently the SimpleTest project is taking part under the - PHP umbrella. - So handle with care! -
-
-
-
-
- Enable JavaScript inside SimpleTest browser. -
-
- This would be a MASSIVE feature to have. - We're probably talking about integrating - a C-based or Java-based JavaScript engine. - The Java folks have - HttpUnit - already : some stuff could be derived from there. - Demonstrating the feasibility alone would be a real - step forward. The hard work is the DOM emulation. -
-
- Add layer testing. -
-
- When using an MVC framework is to support - bypassing the webserver, and interacting with the framework at - the level of Request and Response objects. - It would be nice to see if we could develop an interface standard for - the HTTP layer which would allow SimpleTest to work cleanly with - different frameworks. On the other hand, maybe there already is enough - of an interface in the standard PHP superglobals. - Symfony with its lime test framework works in exactly this manner. -
-
- Make parsers switchable and change the HTML Parser. -
-
- Replace the html parser with - tidylib. - It's super-fast compared to parsing in PHP. - If there are worries about adding a dependency, - then maybe make it an optional plug-in instead. -
-
- Web Form Fuzzer. -
-
- Fuzz testing is a software testing technique that provides random data - ("fuzz") to the inputs of a program. If the program fails (for - example, by crashing, or by failing built-in code assertions), the - defects can be noted. -
- A Web Form Fuzzer would be built on top of the basic WebTestCase api, - enabling developers to point a test case at a target URL and have it - introspect form inputs and post actions. The fuzzer would generate - random data strings, populate the input fields, and repeatedly post - the forms, looking for errors, validation responses, and HTTP status - codes that reflect how the site handled a combination of well-formed - and malformed input. This would have the potential to completely wreck - some websites, but would be great for testing the robustness and edge - case behavior of CMS's and other online administration tools. -
-
-
-
-
-
- Mutation test coverage. -
-
-
-
-
-
- Standalone notifying tool -
-
- Based on rules, this notifying tool detects a file change - within a particular directory (maybe with - php-inotifytools : - such a monitor could learn how your code works by observing it being tested. - For example, call graphing via static analysis might work, as would - running Xdebug code coverage while running the tests and monitoring - the code executed after each test method, as would some sort of - DBG-derived client that received notifications from Xdebug while - the code was being executed like a debugging client. - We'd have "rings" of functionality. The first - ring is the tests that exercises the particular method/function - you're working with by a direct call. - Then start working rings out based on how far away the test method - is when that code is called. - These rings would then be executed on a save, starting with the inner - most. Any failure would stop further tests cause a system alert to - something like Growl or Snarl or any Reporter that you drop in. -
-
- PDT (Eclipse) : implement PHPUnit hooks -
-
- There are somme hooks inside PDT implemented for PHPUnit. - But it seems there're unused since PHPUnit changed too much - recently. SimpleTest could use them as well : - the SimpleTest Eclipse plugin could then become - the PDT Test plugin while fixing those hooks. -
-
- PDT (Eclipse) : debug while unit testing -
-
- The GUI for Eclipse recently caught up with PDT : debugging while - running a SimpleTest test case is finally doable. -
-
- Creative IDE integration -
-
- For example, running a subset of tests after each edit. -
-
- Firefox plugin to create SimpleTest file on the fly. -
-
- The same way Selenium IDE currently works. -
-
- Komodo integration. -
-
- Integration with monitoring tools such as Nagios. -
-
-
-
- - - Browser-based - - - ... and Unit testing-related ideas for GSOC2008. - - - Also of interest, - integration with third-party tools. - - - - - Google Summer of Code 2008. - - - - - software development, - computer programmer, - php programming, - programming php, - software development company, - software development uk, - php tutorial, - bespoke software development uk, - corporate web development, - architecture, - integration, - ide integration, - google summer of code, - mutation test coverage, - javascript - - -
diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/improving_design_tutorial.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/improving_design_tutorial.xml deleted file mode 100644 index fc59981..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/improving_design_tutorial.xml +++ /dev/null @@ -1,195 +0,0 @@ - - - - - PHP unit testing tutorial - Top down design - test first with mock objects - - -
-

- I lied. -

-

- I haven't created a writer test at all, only the - FileWriter interface that I showed - earlier. - In fact I'll go one step further away from a finished article and assume - only an abstract writer in classes/writer.php... -Writer { - - function Writer() { - } - - function write($message) { - } -} -?> -]]> - The corresponding test changes are... - -Mock::generate('Writer'); - -class TestOfLogging extends UnitTestCase { - function TestOfLogging() { - $this->UnitTestCase('Log class test'); - } - function testWriting() { - $clock = &new MockClock($this); - $clock->setReturnValue('now', 'Timestamp'); - $writer = &new MockWriter($this); - $writer->expectOnce('write', array('[Timestamp] Test line')); - $log = &new Log($writer); - $log->message('Test line', &$clock); - $writer->tally(); - } -} -?> -]]> - In order to use the logging class we would need to code a file - writer or other sort of writer, but at the moment we are only - testing and so we do not yet need it. - So, in other words, using mocks we can defer the creation of - lower level objects until we feel like it. - Not only can we design top down, but we can test top down too. -

-
-
-

- Imagine for the moment that we had started the logging class - from another direction. - Pretend that we had coded just enough of the Log - to realise we needed a Writer somehow. - How would we have included it? -

-

- Well, inheriting from the writer would not have allowed us to mock it - from the testing point of view. - From the design point of view we would have been restricted to - just one writer without multiple inheritence. -

-

- Creating the writer internally, rather than passing it in the constructor, - by choosing a class name is possible, but we would have less control - of the mock object set up. - From the design point of view it would have been nearly impossible - to pass parameters to the writer in all the different formats ever needed. - You would have to have the writer restricted to say a hash or complicated - string describing the target details. - Needlessly complicated at best. -

-

- Using a factory method to create the writer internally would be - possible, but would mean subclassing it for testing so that the factory - method could be replaced with one returning a mock. - More work from the test point of view, although still possible. - From the design point of view it would mean a new logger subclass - for every type of writer that we want to use. - This is called a parallel class hiearchy and obviously involves - duplication. - Yuk. -

-

- At the other extreme, passing or creating the writer on every - message would have been repetitive and reduced the - Log class code to a single - method, a sure sign that the whole class has become redundant. -

-

- This tension between ease of testing and avoiding repetition - has allowed us to find a flexible and clean design. - Remember our brief yearning for multiple inheritence? - We have replaced it with polymorphism (lots of writers) and separated the - logging hierachy from the writing hierarchy. - We connect the two through this simpler Log - by aggregation. - This trick is actually a design pattern called a "Bridge". -

-

- So we have been pushed by test code (we haven't written much else yet) - into a design pattern. - Think about this for a second. - Tests improve code quality, certainly in my case, but this is - something far more profound and far more powerful. -

-

- Testing has improved the design. -

-
-
-

- Creating a mock object is as easy as creating the interface in text - form. - If you have UML or other tools that create these interfaces for you, - then you have an even more flexible route to quickly generate - test objects. - Even if you do not, you can switch from white board drawing, to - writing a test case, to writing a mock, to generating an interface - which takes us back to the whiteboard drawing again, fairly easily. - Like refactoring, design, code and test become unified. -

-

- Because mock objects work top down they can be bought into the design - more quickly than normal refactoring, which requires at least - partially working code before it kicks in. - This means that the testing code interacts with the design faster - and this means that the design quality goes up sooner. -

-

- A unit tester is a coding tool. - A unit tester with mock objects is a design tool. -

-
-
- - - Mock now, code later. - - - We derive the bridge pattern. - - - Designing and testing hand in hand. - - - - - This tutorial follows Boundary classes. - - - You will need the SimpleTest testing framework - to try these examples. - - - For more mock object discussion see the - Extreme Tuesday Wiki - or the - C2 Wiki - - - - - software development, - php programming tutorial, - programming php test cases, - software development tools, - php tutorial, - free php code, - architecture, - php examples, - mock object examples, - junit style testing, - php testing frameworks, - unit test, - mock objects in PHP, - php testing - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/index.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/index.xml deleted file mode 100644 index 730cafb..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/index.xml +++ /dev/null @@ -1,220 +0,0 @@ - - - - - The Last Craft? Web developer tutorials on PHP, Extreme programming - and Object Oriented development - - - -

- This site focuses mostly on developing with lightweight web technologies such as - PHP, - especially when applied with agile methodologies such as - XP. - No guarantee of quality is given or even intended. - It is hoped only that what you find gives you ideas and enthusiasm - from a fellow computer programmer. -

-

- I've been a little busy of late with children (two versions). - They take quite a chunk of your professional life and 100% of - what's left! - Hopefully the projects below should start to get back on track. -

-
-
-

- My latest project is Cgreen. - It's a C unit tester. - There are a couple of C unit testing tools out there already of course. - What makes Cgreen different is that it is pure C99, includes - a tutorial right here and has facilities for creating mock functions. - Mock functions should lead to more decoupled C code if Mock objects are - anything to go by. - It's alpha status right now until I get feedback from other users. - So if you want to be influential, try it out right now. - The project has been mostly funded by Wordtracker, - for which I am very grateful. -

-

- Along with Jon Ramsey, I am a founder of - PHP London, a PHP user - group not surprisingly based in London. - It's going well. - The networking meetings take place on the first Thursday of every month - at a pub. -

-

- In addition the group organises other events that include the 2nd - London UK PHP Conference. - This is a one day event on Friday the 23rd of February 2007 and costs only - fifty quid. -

-

- The SimpleTest PHP unit tester - is available for download from your nearest - SourceForge. - It is a PHP unit test and web test framework. - Users of JUnit will be - familiar with most of the interface. - The JWebUnit - style functionality is more complete now. - It has support for SSL, forms, frames, proxies and basic authentication. - The current CVS code should become the 1.0.1 release real soon now and - includes file upload and many small improvements. - The idea is that common but fiddly PHP tasks, such as logging into a site, - can be tested easily. -

-

- My most neglected project right now is a requirents testing - and sign-off tool called - Arbiter. - It's actually best described in this - Sitepoint thread, - but basically think of it as a document driven FIT for small - web projects only. - The project is currently stalled due the birth of children and - writing projects. -

-

- Also on the subject of open source, Wordtracker - have kindly agreed to publish some of their in house tools. - A Wordtracker spin off is fakeMail. - Testing applications that send e-mails can be a right royal pain because - of all of the infrastructure involved. - You will likely need an SMPT gateway that talks to a POP client that - you can read the queue from. - That's a lot of set up. - Fakemail acts as an SMTP gateway on any port - you define. - When you send it a mail it simply copies that mail to the local file - system in whatever directory you want. - You then just have to look at the local file. - It means that you must be able to configure your application to use - a port other than 25, but that's not usualy difficult. -

-
-
-

- A craft is defined as... -

- Art or skill; dexterity in particular manual employment; - hence, the occupation or employment itself; manual art; a - trade. -
-

-

- If you lose a screw or clasp from a hand made jewellery box it is hopeless to - try to find a replacement. Nothing else is quite the same and the mechanism will - fail to work. It may even cause more damage when applied. You need to find the original maker - or someone of the same skill to make you another. - Sound like software? - Yet mechanical parts today are interchangeable. -

-

- Writing software has resisted mass production. - As soon as a part of it becomes - routine it can be automated. - Once it is you don't need a programmer any more. - Routine programming jobs no longer exist. - All that is left is the unsolved problems that require - a higher level of skill in constructing their solutions. -

-

- This dependency on the ability of the artisan, combined with nothing quite fitting - together properly, is what gives software the pre-industrial feel. -

-
-
-

- The panel at the top is supposed to resemble a standard office index card. - The way it is marked out is called a - CRC card. - It stands for Classes, Responsibilities and - Collaborations and is the cheapest software development tool you - can find. - You really do buy a pack of cards. -

-

- The role is written at the top and would often be just a class - name. - The left side is the object's responsibilities and on the - right collaborations (within the page I have treated these as - internal links and external links repectively). - A group of developers can point at, discuss and discard cards - in the heat of design session. - It makes it especially difficult for only one person to take charge - of a discussion in the way you can with a UML tool or notepad. - Try scribbling out five cards before someone gets a look in. -

-

- Now nothing beats a whiteboard for collaboration, but if the level - of detail is getting too high and you want a temporary record, - give the CRC cards a try. -

-
-
- - - Projects under development. - All free and open source software. - - - Why Last Craft? - Odd name isn't it? - - - Why this index card at the top? - - - - - SimpleTest is a PHP unit test framework. - - - My article on TDD - - - My article on the - Registry Pattern. - - - Site E-mail is - SpamCop - filtered which I cannot recommend enough. - - - - - software development, - computer programmer, - php programming, - programming php, - software development tools, - software development company, - php tutorial, - free php scripts, - bespoke software development uk, - corporate web development, - architecture, - php resources, - wordtracker, - xslt, - java, - bug tracker, - bug reporting, - unit test, - php testing, - test cases tutorial, - explain unit test case, - unit test example, - xml - - - A web site of software development tutorials and examples with an - emphasis on web programming, testing, agile methodology and PHP - development - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/intro.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/intro.xml deleted file mode 100644 index 87882c4..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/intro.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - Summary of SimpleTest including it's Java tool roots. - - - -

- The SimpleTest PHP unit tester is in - the 1.0.1 release cycle and is available for download from your nearest SourceForge. -

-

- It is a PHP unit test, mock objects and web test framework. - Users of JUnit will be - familiar with most of the interface. - For web testing a small web browser is included, similar to - JWebUnit. - It has support for SSL, frames, proxies, basic authentication, redirects, - and the standard HTML form controls. - The idea is that common but fiddly PHP tasks, such as logging into a site, - can be tested easily as calling click(). -

-

- There is currently no support for JavaScript in the web tester. - For testing these elements we recommend - Selenium. -

-
-
- - - software development, - computer programmer, - php programming, - programming php, - software development tools, - software development company, - php tutorial, - free php scripts, - bespoke software development uk, - corporate web development, - architecture, - php resources, - unit test, - php testing, - test cases tutorial, - explain unit test case, - unit test example, - xml - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/mock_objects_documentation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/mock_objects_documentation.xml deleted file mode 100644 index 96f39a5..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/mock_objects_documentation.xml +++ /dev/null @@ -1,708 +0,0 @@ - - - - SimpleTest for PHP mock objects documentation - -
-

- Mock objects have two roles during a test case: actor and critic. -

-

- The actor behaviour is to simulate objects that are difficult to - set up or time consuming to set up for a test. - The classic example is a database connection. - Setting up a test database at the start of each test would slow - testing to a crawl and would require the installation of the - database engine and test data on the test machine. - If we can simulate the connection and return data of our - choosing we not only win on the pragmatics of testing, but can - also feed our code spurious data to see how it responds. - We can simulate databases being down or other extremes - without having to create a broken database for real. - In other words, we get greater control of the test environment. -

-

- If mock objects only behaved as actors they would simply be - known as server stubs. - This was originally a pattern named by Robert Binder (Testing - object-oriented systems: models, patterns, and tools, - Addison-Wesley) in 1999. -

-

- A server stub is a simulation of an object or component. - It should exactly replace a component in a system for test - or prototyping purposes, but remain lightweight. - This allows tests to run more quickly, or if the simulated - class has not been written, to run at all. -

-

- However, the mock objects not only play a part (by supplying chosen - return values on demand) they are also sensitive to the - messages sent to them (via expectations). - By setting expected parameters for a method call they act - as a guard that the calls upon them are made correctly. - If expectations are not met they save us the effort of - writing a failed test assertion by performing that duty on our - behalf. -

-

- In the case of an imaginary database connection they can - test that the query, say SQL, was correctly formed by - the object that is using the connection. - Set them up with fairly tight expectations and you will - hardly need manual assertions at all. -

-
-
-

- In the same way that we create server stubs, all we need is an - existing class, say a database connection that looks like this... -class DatabaseConnection { - function DatabaseConnection() { - } - - function query() { - } - - function selectQuery() { - } -} -]]> - The class does not need to have been implemented yet. - To create a mock version of the class we need to include the - mock object library and run the generator... -require_once('simpletest/unit_tester.php'); -require_once('simpletest/mock_objects.php'); -require_once('database_connection.php'); - -Mock::generate('DatabaseConnection'); -]]> - This generates a clone class called - MockDatabaseConnection. - We can now create instances of the new class within - our test case... - -class MyTestCase extends UnitTestCase { - - function testSomething() { - $connection = &new MockDatabaseConnection(); - } -} -]]> - Unlike the generated stubs the mock constructor needs a reference - to the test case so that it can dispatch passes and failures while - checking its expectations. - This means that mock objects can only be used within test cases. - Despite this their extra power means that stubs are hardly ever used - if mocks are available. -

-

-

Mocks as actors

-

-

- The mock version of a class has all the methods of the original, - so that operations like - query()]]> are still - legal. - The return value will be null, - but we can change that with... -$connection->setReturnValue('query', 37) -]]> - Now every time we call - query()]]> we get - the result of 37. - We can set the return value to anything, say a hash of - imaginary database results or a list of persistent objects. - Parameters are irrelevant here, we always get the same - values back each time once they have been set up this way. - That may not sound like a convincing replica of a - database connection, but for the half a dozen lines of - a test method it is usually all you need. -

-

- We can also add extra methods to the mock when generating it - and choose our own class name... -Mock::generate('DatabaseConnection', 'MyMockDatabaseConnection', array('setOptions')); -]]> - Here the mock will behave as if the setOptions() - existed in the original class. - This is handy if a class has used the PHP overload() - mechanism to add dynamic methods. - You can create a special mock to simulate this situation. -

-

- Things aren't always that simple though. - One common problem is iterators, where constantly returning - the same value could cause an endless loop in the object - being tested. - For these we need to set up sequences of values. - Let's say we have a simple iterator that looks like this... - - This is about the simplest iterator you could have. - Assuming that this iterator only returns text until it - reaches the end, when it returns false, we can simulate it - with... - - $iterator = &new MockIterator(); - $iterator->setReturnValue('next', false); - $iterator->setReturnValueAt(0, 'next', 'First string'); - $iterator->setReturnValueAt(1, 'next', 'Second string'); - ... - } -} -]]> - When next() is called on the - mock iterator it will first return "First string", - on the second call "Second string" will be returned - and on any other call false will - be returned. - The sequenced return values take precedence over the constant - return value. - The constant one is a kind of default if you like. -

-

- Another tricky situation is an overloaded - get() operation. - An example of this is an information holder with name/value pairs. - Say we have a configuration class like... - - This is a classic situation for using mock objects as - actual configuration will vary from machine to machine, - hardly helping the reliability of our tests if we use it - directly. - The problem though is that all the data comes through the - getValue() method and yet - we want different results for different keys. - Luckily the mocks have a filter system... -$config = &new MockConfiguration(); -$config->setReturnValue('getValue', 'primary', array('db_host')); -$config->setReturnValue('getValue', 'admin', array('db_user')); -$config->setReturnValue('getValue', 'secret', array('db_password')); -]]> - The extra parameter is a list of arguments to attempt - to match. - In this case we are trying to match only one argument which - is the look up key. - Now when the mock object has the - getValue() method invoked - like this... -getValue('db_user') -]]> - ...it will return "admin". - It finds this by attempting to match the calling arguments - to its list of returns one after another until - a complete match is found. -

-

- You can set a default argument argument like so... - -$config->setReturnValue('getValue', false, array('*')); -]]> - This is not the same as setting the return value without - any argument requirements like this... - -$config->setReturnValue('getValue', false); -]]> - In the first case it will accept any single argument, - but exactly one is required. - In the second case any number of arguments will do and - it acts as a catchall after all other matches. - Note that if we add further single parameter options after - the wildcard in the first case, they will be ignored as the wildcard - will match first. - With complex parameter lists the ordering could be important - or else desired matches could be masked by earlier wildcard - ones. - Declare the most specific matches first if you are not sure. -

-

- There are times when you want a specific object to be - dished out by the mock rather than a copy. - The PHP4 copy semantics force us to use a different method - for this. - You might be simulating a container for example... - - In this case you can set a reference into the mock's - return list... - -$vector = &new MockVector(); -$vector->setReturnReference('get', $thing, array(12)); -]]> - With this arrangement you know that every time - get(12)]]> is - called it will return the same - $thing each time. - This is compatible with PHP5 as well. -

-

- These three factors, timing, parameters and whether to copy, - can be combined orthogonally. - For example... - -$complex->setReturnReferenceAt(3, 'get', $stuff, array('*', 1)); -]]> - This will return the $stuff only on the third - call and only if two parameters were set the second of - which must be the integer 1. - That should cover most simple prototyping situations. -

-

- A final tricky case is one object creating another, known - as a factory pattern. - Suppose that on a successful query to our imaginary - database, a result set is returned as an iterator with - each call to next() giving - one row until false. - This sounds like a simulation nightmare, but in fact it can all - be mocked using the mechanics above. -

-

- Here's how... - - $result = &new MockResultIterator(); - $result->setReturnValue('next', false); - $result->setReturnValueAt(0, 'next', array(1, 'tom')); - $result->setReturnValueAt(1, 'next', array(3, 'dick')); - $result->setReturnValueAt(2, 'next', array(6, 'harry')); - - $connection = &new MockDatabaseConnection(); - $connection->setReturnValue('query', false); - $connection->setReturnReference( - 'query', - $result, - array('select id, name from users')); - - $finder = &new UserFinder($connection); - $this->assertIdentical( - $finder->findNames(), - array('tom', 'dick', 'harry')); - } -} -]]> - Now only if our - $connection is called with the correct - query() will the - $result be returned that is - itself exhausted after the third call to next(). - This should be enough - information for our UserFinder class, - the class actually - being tested here, to come up with goods. - A very precise test and not a real database in sight. -

-
-
-

- Although the server stubs approach insulates your tests from - real world disruption, it is only half the benefit. - You can have the class under test receiving the required - messages, but is your new class sending correct ones? - Testing this can get messy without a mock objects library. -

-

- By way of example, suppose we have a - SessionPool class that we - want to add logging to. - Rather than grow the original class into something more - complicated, we want to add this behaviour with a decorator (GOF). - The SessionPool code currently looks - like this... -class SessionPool { - function SessionPool() { - ... - } - - function &findSession($cookie) { - ... - } - ... -} - -class Session { - ... -} -]]> - While our logging code looks like this... - -class Log { - function Log() { - ... - } - - function message() { - ... - } -} - -class LoggingSessionPool { - function LoggingSessionPool(&$session_pool, &$log) { - ... - } - - function &findSession($cookie) { - ... - } - ... -} -]]> - Out of all of this, the only class we want to test here - is the LoggingSessionPool. - In particular we would like to check that the - findSession() method is - called with the correct session ID in the cookie and that - it sent the message "Starting session $cookie" - to the logger. -

-

- Despite the fact that we are testing only a few lines of - production code, here is what we would have to do in a - conventional test case: -

    -
  1. Create a log object.
  2. -
  3. Set a directory to place the log file.
  4. -
  5. Set the directory permissions so we can write the log.
  6. -
  7. Create a SessionPool object.
  8. -
  9. Hand start a session, which probably does lot's of things.
  10. -
  11. Invoke findSession().
  12. -
  13. Read the new Session ID (hope there is an accessor!).
  14. -
  15. Raise a test assertion to confirm that the ID matches the cookie.
  16. -
  17. Read the last line of the log file.
  18. -
  19. Pattern match out the extra logging timestamps, etc.
  20. -
  21. Assert that the session message is contained in the text.
  22. -
- It is hardly surprising that developers hate writing tests - when they are this much drudgery. - To make things worse, every time the logging format changes or - the method of creating new sessions changes, we have to rewrite - parts of this test even though this test does not officially - test those parts of the system. - We are creating headaches for the writers of these other classes. -

-

- Instead, here is the complete test method using mock object magic... - - $session = &new MockSession(); - $pool = &new MockSessionPool(); - $pool->setReturnReference('findSession', $session); - $pool->expectOnce('findSession', array('abc')); - - $log = &new MockLog(); - $log->expectOnce('message', array('Starting session abc')); - - $logging_pool = &new LoggingSessionPool($pool, $log); - $this->assertReference($logging_pool->findSession('abc'), $session); - } -} -]]> - We start by creating a dummy session. - We don't have to be too fussy about this as the check - for which session we want is done elsewhere. - We only need to check that it was the same one that came - from the session pool. -

-

- findSession() is a factory - method the simulation of which is described above. - The point of departure comes with the first - expectOnce() call. - This line states that whenever - findSession() is invoked on the - mock, it will test the incoming arguments. - If it receives the single argument of a string "abc" - then a test pass is sent to the unit tester, otherwise a fail is - generated. - This was the part where we checked that the right session was asked for. - The argument list follows the same format as the one for setting - return values. - You can have wildcards and sequences and the order of - evaluation is the same. -

-

- We use the same pattern to set up the mock logger. - We tell it that it should have - message() invoked - once only with the argument "Starting session abc". - By testing the calling arguments, rather than the logger output, - we insulate the test from any display changes in the logger. -

-

- We start to run our tests when we create the new - LoggingSessionPool and feed - it our preset mock objects. - Everything is now under our control. -

-

- This is still quite a bit of test code, but the code is very - strict. - If it still seems rather daunting there is a lot less of it - than if we tried this without mocks and this particular test, - interactions rather than output, is always more work to set - up. - More often you will be testing more complex situations without - needing this level or precision. - Also some of this can be refactored into a test case - setUp() method. -

-

- Here is the full list of expectations you can set on a mock object - in SimpleTest... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ExpectationNeeds tally()
expect($method, $args)No
expectAt($timing, $method, $args)No
expectCallCount($method, $count)Yes
expectMaximumCallCount($method, $count)No
expectMinimumCallCount($method, $count)Yes
expectNever($method)No
expectOnce($method, $args)Yes
expectAtLeastOnce($method, $args)Yes
- Where the parameters are... -

-
$method
-
The method name, as a string, to apply the condition to.
-
$args
-
- The arguments as a list. Wildcards can be included in the same - manner as for setReturn(). - This argument is optional for expectOnce() - and expectAtLeastOnce(). -
-
$timing
-
- The only point in time to test the condition. - The first call starts at zero. -
-
$count
-
The number of calls expected.
-
- The method expectMaximumCallCount() - is slightly different in that it will only ever generate a failure. - It is silent if the limit is never reached. -

-

- Also if you have juste one call in your test, make sure you're using - expectOnce.
- Using $mocked->expectAt(0, 'method', 'args); - on its own will not be catched : - checking the arguments and the overall call count - are currently independant. -

-

- Like the assertions within test cases, all of the expectations - can take a message override as an extra parameter. - Also the original failure message can be embedded in the output - as "%s". -

-
-
-

- There are three approaches to creating mocks including the one - that SimpleTest employs. - Coding them by hand using a base class, generating them to - a file and dynamically generating them on the fly. -

-

- Mock objects generated with SimpleTest - are dynamic. - They are created at run time in memory, using - eval(), rather than written - out to a file. - This makes the mocks easy to create, a one liner, - especially compared with hand - crafting them in a parallel class hierarchy. - The problem is that the behaviour is usually set up in the tests - themselves. - If the original objects change the mock versions - that the tests rely on can get out of sync. - This can happen with the parallel hierarchy approach as well, - but is far more quickly detected. -

-

- The solution, of course, is to add some real integration - tests. - You don't need very many and the convenience gained - from the mocks more than outweighs the small amount of - extra testing. - You cannot trust code that was only tested with mocks. -

-

- If you are still determined to build static libraries of mocks - because you want to simulate very specific behaviour, you can - achieve the same effect using the SimpleTest class generator. - In your library file, say mocks/connection.php for a - database connection, create a mock and inherit to override - special methods or add presets... - - Mock::generate('Connection', 'BasicMockConnection'); - class MockConnection extends BasicMockConnection { - function MockConnection() { - $this->BasicMockConnection(); - $this->setReturn('query', false); - } - } -?> -]]> - The generate call tells the class generator to create - a class called BasicMockConnection - rather than the usual MockConnection. - We then inherit from this to get our version of - MockConnection. - By intercepting in this way we can add behaviour, here setting - the default value of query() to be false. - By using the default name we make sure that the mock class - generator will not recreate a different one when invoked elsewhere in the - tests. - It never creates a class if it already exists. - As long as the above file is included first then all tests - that generated MockConnection should - now be using our one instead. - If we don't get the order right and the mock library - creates one first then the class creation will simply fail. -

-

- Use this trick if you find you have a lot of common mock behaviour - or you are getting frequent integration problems at later - stages of testing. -

-
-
- - - What are mock objects? - - - Creating mock objects. - - - Mocks as actors or stubs. - - - Mocks as critics with expectations. - - - Other approaches including mock libraries. - - - - - The original - Mock objects paper. - - - SimpleTest project page on SourceForge. - - - SimpleTest home page on LastCraft. - - - - - software development, - php programming, - programming php, - software development tools, - php tutorial, - free php scripts, - architecture, - php resources, - mock objects, - junit, - php testing, - unit test, - php testing, - jmock, - nmock - - -
diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/mock_objects_tutorial.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/mock_objects_tutorial.xml deleted file mode 100644 index 875adfd..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/mock_objects_tutorial.xml +++ /dev/null @@ -1,359 +0,0 @@ - - - - PHP unit testing tutorial - Using mock objects in PHP - -
-

- Before more functionality is added there is some refactoring - to do. - We are going to do some timing tests and so the - TimeTestCase class definitely needs - its own file. - Let's say tests/time_test_case.php... -UnitTestCase($test_name); - } - function assertSameTime($time1, $time2, $message = '') { - if (! $message) { - $message = "Time [$time1] should match time [$time2]"; - } - $this->assertTrue( - ($time1 == $time2) || ($time1 + 1 == $time2), - $message); - } -} -?> -]]> - We can then require() this file into - the all_tests.php script. -

-
-
-

- I don't know quite what the format of the log message should - be for the test, so to check for a timestamp we could do the - simplest possible thing, which is to look for a sequence of digits. - -require_once('../classes/clock.php'); - -class TestOfLogging extends TimeTestCase { - function TestOfLogging() { - $this->TimeTestCase('Log class test'); - } - function setUp() { - @unlink('../temp/test.log'); - } - function tearDown() { - @unlink('../temp/test.log'); - } - function getFileLine($filename, $index) { - $messages = file($filename); - return $messages[$index]; - } - function testCreatingNewFile() { - ... - } - function testAppendingToFile() { - ... - } - function testTimestamps() { - $log = new Log('../temp/test.log'); - $log->message('Test line'); - $this->assertTrue( - preg_match('/(\d+)/', $this->getFileLine('../temp/test.log', 0), $matches), - 'Found timestamp'); - $clock = new clock(); - $this->assertSameTime((integer)$matches[1], $clock->now(), 'Correct time'); - } -} -?> -]]> - The test case creates a new Log - object and writes a message. - We look for a digit sequence and then test it against the current - time using our Clock object. - Of course it doesn't work until we write the code. -

-

All tests

- Pass: log_test.php->Log class test->testappendingtofile->Expecting [/Test line 1/] in [Test line 1]
- Pass: log_test.php->Log class test->testappendingtofile->Expecting [/Test line 2/] in [Test line 2]
- Pass: log_test.php->Log class test->testcreatingnewfile->Created before message
- Pass: log_test.php->Log class test->testcreatingnewfile->File created
- Fail: log_test.php->Log class test->testtimestamps->Found timestamp
-
- Notice: Undefined offset: 1 in /home/marcus/projects/lastcraft/tutorial_tests/tests/log_test.php on line 44
- Fail: log_test.php->Log class test->testtimestamps->Correct time
- Pass: clock_test.php->Clock class test->testclockadvance->Advancement
- Pass: clock_test.php->Clock class test->testclocktellstime->Now is the right time
-
3/3 test cases complete. - 6 passes and 2 fails.
-
- The test suite is still showing the passes from our earlier - modification. -

-

- We can get the tests to pass simply by adding a timestamp - when writing out to the file. - Yes, of course all of this is trivial and - I would not normally test this fanatically, but it is going - to illustrate a more general problem. - The log.php file becomes... - -require_once('../classes/clock.php'); - -class Log { - var $_file_path; - - function Log($file_path) { - $this->_file_path = $file_path; - } - - function message($message) { - $clock = new Clock(); - $file = fopen($this->_file_path, 'a'); - fwrite($file, "[" . $clock->now() . "] $message\n"); - fclose($file); - } -} -?> -]]> - The tests should now pass. -

-

- Our new test is full of problems, though. - What if our time format changes to something else? - Things are going to be a lot more complicated to test if this - happens. - It also means that any changes to the clock class time - format will cause our logging tests to fail also. - This means that our log tests are tangled up with the clock tests - and extremely fragile. - It lacks cohesion, which is the same as saying it is not - tightly focused, testing facets of the clock as well as the log. - Our problems are caused in part because the clock output - is unpredictable when - all we really want to test is that the logging message - contains the output of - Clock::now(). - We don't - really care about the contents of that method call. -

-

- Can we make that call predictable? - We could if we could get the log to use a dummy version - of the clock for the duration of the test. - The dummy clock class would have to behave the same way - as the Clock class - except for the fixed output from the - now() method. - Hey, that would even free us from using the - TimeTestCase class! -

-

- We could write such a class pretty easily although it is - rather tedious work. - We just create another clock class with same interface - except that the now() method - returns a value that we can change with some other setter method. - That is quite a lot of work for a pretty minor test. -

-

- Except that it is really no work at all. -

-
-
-

- To reach instant testing clock nirvana we need - only three extra lines of code... - - This includes the mock generator code. - It is simplest to place this in the all_tests.php - script as it gets used rather a lot. - - This is the line that does the work. - The code generator scans the class for all of its - methods, creates code to generate an identically - interfaced class, but with the name "Mock" added, - and then eval()s the new code to - create the new class. - - This line can be added to any test method we are interested in. - It creates the dummy clock ready to receive our instructions. -

-

- Our test case is on the first steps of a radical clean up... - -Mock::generate('Clock'); - -class TestOfLogging extends UnitTestCase { - function TestOfLogging() { - $this->UnitTestCase('Log class test'); - } - function setUp() { - @unlink('../temp/test.log'); - } - function tearDown() { - @unlink('../temp/test.log'); - } - function getFileLine($filename, $index) { - $messages = file($filename); - return $messages[$index]; - } - function testCreatingNewFile() { - ... - } - function testAppendingToFile() { - ... - } - function testTimestamps() { - $clock = &new MockClock($this); - $clock->setReturnValue('now', 'Timestamp'); - $log = new Log('../temp/test.log'); - $log->message('Test line', &$clock); - $this->assertWantedPattern( - '/Timestamp/', - $this->getFileLine('../temp/test.log', 0), - 'Found timestamp'); - } -} -?> -]]> - This test method creates a MockClock - object and then sets the return value of the - now() method to be the string - "Timestamp". - Every time we call $clock->now() - it will return this string. - This should be easy to spot. -

-

- Next we create our log and send a message. - We pass into the message() - call the clock we would like to use. - This means that we will have to add an optional parameter to - the logging class to make testing possible... -_file_path = $file_path; - } - - function message($message, $clock = false) { - if (!is_object($clock)) { - $clock = new Clock(); - } - $file = fopen($this->_file_path, 'a'); - fwrite($file, "[" . $clock->now() . "] $message\n"); - fclose($file); - } -} -]]> - All of the tests now pass and they test only the logging code. - We can breathe easy again. -

-

- Does that extra parameter in the Log - class bother you? - We have changed the interface just to facilitate testing after - all. - Are not interfaces the most important thing? - Have we sullied our class with test code? -

-

- Possibly, but consider this. - Next chance you get, look at a circuit board, perhaps the motherboard - of the computer you are looking at right now. - On most boards you will find the odd empty hole, or solder - joint with nothing attached or perhaps a pin or socket - that has no obvious function. - Chances are that some of these are for expansion and - variations, but most of the remainder will be for testing. -

-

- Think about that. - The factories making the boards many times over wasting material - on parts that do not add to the final function. - If hardware engineers can make this sacrifice of elegance I am - sure we can too. - Our sacrifice wastes no materials after all. -

-

- Still bother you? - Actually it bothers me too, but not so much here. - The number one priority is code that works, not prizes - for minimalism. - If it really bothers you, then move the creation of the clock - into another protected factory method. - Then subclass the clock for testing and override the - factory method with one that returns the mock. - Your tests are clumsier, but your interface is intact. -

-

- Again I leave the decision to you. -

-
-
- - - Refactoring the tests so we can reuse - our new time test. - - Adding Log timestamps. - Mocking the clock to make the test cohesive. - - - - This follows the unit test tutorial. - - - Next is distilling boundary classes. - - - You will need the SimpleTest - tool to run the examples. - - - Mock objects papers. - - - - - software development, - php programming, - programming php, - software development tools, - php tutorial, - free php scripts, - architecture, - php resources, - mock objects, - junit, - php testing, - unit test, - php testing - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/overview.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/overview.xml deleted file mode 100644 index f01b3cb..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/overview.xml +++ /dev/null @@ -1,460 +0,0 @@ - - - - - Overview and feature list for the SimpleTest PHP unit tester and web tester - - -
-

- The heart of SimpleTest is a testing framework built around - test case classes. - These are written as extensions of base test case classes, - each extended with methods that actually contain test code. - Top level test scripts then invoke the run() - methods on every one of these test cases in order. - Each test method is written to invoke various assertions that - the developer expects to be true such as - assertEqual(). - If the expectation is correct, then a successful result is dispatched to the - observing test reporter, but any failure triggers an alert - and a description of the mismatch. -

-

- A test case looks like this... -MyTestCase extends UnitTestCase { - - function testCreatedLogFile() { - $log = &new Log('my.log'); - $log->message('Hello'); - $this->assertTrue(file_exists('my.log')); - } -} -?> -]]> -

-

- These tools are designed for the developer. - Tests are written in the PHP language itself more or less - as the application itself is built. - The advantage of using PHP itself as the testing language is that - there are no new languages to learn, testing can start straight away, - and the developer can test any part of the code. - Basically, all parts that can be accessed by the application code can also be - accessed by the test code, if they are in the same programming language. -

-

- The simplest type of test case is the - UnitTestCase. - This class of test case includes standard tests for equality, - references and pattern matching. - All these test the typical expectations of what you would - expect the result of a function or method to be. - This is by far the most common type of test in the daily - routine of development, making up about 95% of test cases. -

-

- The top level task of a web application though is not to - produce correct output from its methods and objects, but - to generate web pages. - The WebTestCase class tests web - pages. - It simulates a web browser requesting a page, complete with - cookies, proxies, secure connections, authentication, forms, frames and most - navigation elements. - With this type of test case, the developer can assert that - information is present in the page and that forms and - sessions are handled correctly. -

-

- A WebTestCase looks like this... -MySiteTest extends WebTestCase { - - function testHomePage() { - $this->get('http://www.my-site.com/index.php'); - $this->assertTitle('My Home Page'); - $this->clickLink('Contact'); - $this->assertTitle('Contact me'); - $this->assertPattern('/Email me at/'); - } -} -?> -]]> -

-
-
-

- The following is a very rough outline of past and future features - and their expected point of release. - I am afraid it is liable to change without warning, as meeting the - milestones rather depends on time available. - Green stuff has been coded, but not necessarily released yet. - If you have a pressing need for a green but unreleased feature - then you should check-out the code from Sourceforge SVN directly. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureDescriptionRelease
Unit test caseCore test case class and assertions1.0
Html displaySimplest possible display1.0
Autoloading of test cases - Reading a file with test cases and loading them into a - group test automatically - 1.0
Mock objects - Objects capable of simulating other objects removing - test dependencies - 1.0
Web test caseAllows link following and title tag matching1.0
Partial mocks - Mocking parts of a class for testing less than a class - or for complex simulations - 1.0
Web cookie handlingCorrect handling of cookies when fetching pages1.0
Following redirectsPage fetching automatically follows 300 redirects1.0
Form parsingAbility to submit simple forms and read default form values1.0
Command line interfaceTest display without the need of a web browser1.0
Exposure of expectation classesCan create precise tests with mocks as well as test cases1.0
XML output and parsing - Allows multi host testing and the integration of acceptance - testing extensions - 1.0
Browser component - Exposure of lower level web browser interface for more - detailed test cases - 1.0
HTTP authentication - Fetching protected web pages with basic authentication - only - 1.0
SSL supportCan connect to https: pages1.0
Proxy supportCan connect via. common proxies1.0
Frames supportHandling of frames in web test cases1.0
File upload testingCan simulate the input type file tag1.0.1
Mocking interfaces - Can generate mock objects to interfaces as well as classes - and class interfaces are carried for type hints - 1.0.1
Testing exceptionsSimilar to testing PHP errors1.0.1
HTML label supportCan access all controls using the visual label1.0.1
Base tag supportRespects page base tag when clicking1.0.1
PHP 5 E_STRICT compliantPHP 5 only version that works with the E_STRICT error level1.1
BDD style fixturesCan import fixtures using a mixin like given() method1.5
Reporting machinery enhancementsImproved message passing for better cooperation with IDEs1.5
Fluent mock interfaceMore flexible and concise mock objects1.6
LocalisationMessages abstracted and code generated1.6
CSS selectorsHTML content can be examined using CSS selectors1.7
HTML table assertionsCan match HTML or table elements to expectations1.7
Unified acceptance testing modelContent searchable through selectors combined with expectations1.7
DatabaseTestCaseSQL selectors and DB drivers1.7
IFrame supportReads IFrame content that can be refreshed1.8
Alternate HTML parsersCan detect compiled parsers for performance improvements1.8
Integrated Selenium supportEasy to use built in Selenium driver and tutorial1.9
Code coverageReports using the bundled tool when using XDebug1.9
Deprecation of old methodsSimpler interface for SimpleTest22.0
Javascript suportUse of PECL module to add Javascript to the native browser3.0
- PHP5 migraton will start straight after the version 1.0.1 series, - whereupon only PHP 5.1+ will be supported. - SimpleTest is currently compatible with PHP 5, but will not - make use of all of the new features until version 1.1. -

-
-
-

- Process is at least as important as tools. - The type of process that makes the heaviest use of a developer's - testing tool is of course - Extreme Programming. - This is one of the - Agile Methodologies - which combine various practices to "flatten the cost curve" of software development. - More extreme still is Test Driven Development, - where you very strictly adhere to the rule of no coding until you have a test. - If you're more of a planner, or believe that experience trumps evolution, - you may prefer the - RUP approach. - I haven't tried it, but even I can see that you will need test tools (see figure 9). -

-

- Most unit testers clone JUnit to some degree, - as far as the interface at least. There is a wealth of information on the - JUnit site including the - FAQ - which contains plenty of general advice on testing. - Once you get bitten by the bug you will certainly appreciate the phrase - test infected - coined by Eric Gamma. - If you are still reviewing which unit tester to use you can find pretty complete - lists from - Wikipedia, - Software testing FAQ, - and Open source testing. -

-

- There is still very little material on using mock objects, which is a shame - as unit testing without them is a lot more work. - The original mock objects paper - is very Java focused, but still worth a read. - The most authoritive sources are probably - the original mock objects site and - JMock. - Java centric, but tucked away in PDFs they contain some deep knowledge on using mocks from the - extended experience of the concept inventors. - As a new technology there are plenty of discussions and debate on how to use mocks, - often on Wikis such as - Extreme Tuesday - or www.mockobjects.com - or the original C2 Wiki. - Injecting mocks into a class is the main area of debate for which this - paper on IBM - makes a good starting point. -

-

- There are plenty of web testing tools, but the scriptable ones - are mostly are written in Java and - tutorials and advice are rather thin on the ground. - The only hope is to look at the documentation for - HTTPUnit, - HTMLUnit - or JWebUnit and hope for clues. - There are some XML driven test frameworks, but again most - require Java to run. -

-

- Most significant is a new generation of tools that run directly in the web browser - are now available. - These include - Selenium and - Watir. - They are non-trivial to set up and slow to run, but can essentially test anything. - As SimpleTest does not support JavaScript you would probably - have to look at these tools anyway if you have highly dynamic - pages. -

-
-
- - - Quick summary - of the SimpleTest tool for PHP. - - - List of features, - both current ones and those planned. - - - There are plenty of unit testing resources - on the web. - - - - - Documentation for SimpleTest. - - - How to write PHP test cases - is a fairly advanced tutorial. - - - SimpleTest API from phpdoc. - - - - - software development tools, - php programming, - programming php, - software development tools, - Tools for extreme programming, - free php scripts, - links of testing tools, - php testing resources, - mock objects, - junit, - jwebunit, - htmlunit, - itc, - php testing links, - unit test advice and documentation, - extreme programming in php - - - - - - Marcus Baker - - Primary Developer{@link mailto:marcus@lastcraft.com marcus@lastcraft.com} - - - - Perrick Pennet - - General manager{@link mailto:perrick@noparking.net perrick@noparking.net} - - - - Jason Sweat - - Documentation{@link mailto:jsweat_php@yahoo.com jsweat_php@yahoo.com} - - - - -
diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/partial_mocks_documentation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/partial_mocks_documentation.xml deleted file mode 100644 index ffc013d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/partial_mocks_documentation.xml +++ /dev/null @@ -1,402 +0,0 @@ - - - - SimpleTest for PHP partial mocks documentation - - -

- A partial mock is simply a pattern to alleviate a specific problem - in testing with mock objects, - that of getting mock objects into tight corners. - It's quite a limited tool and possibly not even a good idea. - It is included with SimpleTest because I have found it useful - on more than one occasion and has saved a lot of work at that point. -

-
-
-

- When one object uses another it is very simple to just pass a mock - version in already set up with its expectations. - Things are rather tricker if one object creates another and the - creator is the one you want to test. - This means that the created object should be mocked, but we can - hardly tell our class under test to create a mock instead. - The tested class doesn't even know it is running inside a test - after all. -

-

- For example, suppose we are building a telnet client and it - needs to create a network socket to pass its messages. - The connection method might look something like... -read( ... ); - ... - } -} -?> -]]> - We would really like to have a mock object version of the socket - here, what can we do? -

-

- The first solution is to pass the socket in as a parameter, - forcing the creation up a level. - Having the client handle this is actually a very good approach - if you can manage it and should lead to factoring the creation from - the doing. - In fact, this is one way in which testing with mock objects actually - forces you to code more tightly focused solutions. - They improve your programming. -

-

- Here this would be... -function &connect(&$socket, $username, $password) { - $socket->read( ... ); - ... - } -} -?> -]]> - This means that the test code is typical for a test involving - mock objects. - - $socket = &new MockSocket($this); - ... - $telnet = &new Telnet(); - $telnet->connect($socket, 'Me', 'Secret'); - ... - } -} -]]> - It is pretty obvious though that one level is all you can go. - You would hardly want your top level application creating - every low level file, socket and database connection ever - needed. - It wouldn't know the constructor parameters anyway. -

-

- The next simplest compromise is to have the created object passed - in as an optional parameter... - - function &connect($ip, $port, $username, $password, $socket = false) { - if (!$socket) { - $socket = &new Socket($ip, $port); - } - $socket->read( ... ); - ... - return $socket; - } -} -?> -]]> - For a quick solution this is usually good enough. - The test now looks almost the same as if the parameter - was formally passed... - - $socket = &new MockSocket($this); - ... - $telnet = &new Telnet(); - $telnet->connect('127.0.0.1', 21, 'Me', 'Secret', &$socket); - ... - } -} -]]> - The problem with this approach is its untidiness. - There is test code in the main class and parameters passed - in the test case that are never used. - This is a quick and dirty approach, but nevertheless effective - in most situations. -

-

- The next method is to pass in a factory object to do the creation... - - function Telnet(&$network) { - $this->_network = &$network; - } - ... - function &connect($ip, $port, $username, $password) { - $socket = &$this->_network->createSocket($ip, $port); - $socket->read( ... ); - ... - return $socket; - } -} -?> -]]> - This is probably the most highly factored answer as creation - is now moved into a small specialist class. - The networking factory can now be tested separately, but mocked - easily when we are testing the telnet class... - - $socket = &new MockSocket($this); - ... - $network = &new MockNetwork($this); - $network->setReturnReference('createSocket', $socket); - $telnet = &new Telnet($network); - $telnet->connect('127.0.0.1', 21, 'Me', 'Secret'); - ... - } -} -]]> - The downside is that we are adding a lot more classes to the - library. - Also we are passing a lot of factories around which will - make the code a little less intuitive. - The most flexible solution, but the most complex. -

-

- Is there a middle ground? -

-
-
-

- There is a way we can circumvent the problem without creating - any new application classes, but it involves creating a subclass - when we do the actual testing. - Firstly we move the socket creation into its own method... - - $socket = &$this->_createSocket($ip, $port); - $socket->read( ... ); - ... - } - - function &_createSocket($ip, $port) { - return new Socket($ip, $port); - } -} -?> -]]> - This is the only change we make to the application code. -

-

- For the test case we have to create a subclass so that - we can intercept the socket creation... -class TelnetTestVersion extends Telnet { - var $_mock; - - function TelnetTestVersion(&$mock) { - $this->_mock = &$mock; - $this->Telnet(); - } - - function &_createSocket() { - return $this->_mock; - } -} -]]> - Here I have passed the mock in the constructor, but a - setter would have done just as well. - Note that the mock was set into the object variable - before the constructor was chained. - This is necessary in case the constructor calls - connect(). - Otherwise it could get a null value from - _createSocket(). -

-

- After the completion of all of this extra work the - actual test case is fairly easy. - We just test our new class instead... - - $socket = &new MockSocket($this); - ... - $telnet = &new TelnetTestVersion($socket); - $telnet->connect('127.0.0.1', 21, 'Me', 'Secret'); - ... - } -} -]]> - The new class is very simple of course. - It just sets up a return value, rather like a mock. - It would be nice if it also checked the incoming parameters - as well. - Just like a mock. - It seems we are likely to do this often, can - we automate the subclass creation? -

-
-
-

- Of course the answer is "yes" or I would have stopped writing - this by now! - The previous test case was a lot of work, but we can - generate the subclass using a similar approach to the mock objects. -

-

- Here is the partial mock version of the test... -Mock::generatePartial( - 'Telnet', - 'TelnetTestVersion', - array('_createSocket')); - -class TelnetTest extends UnitTestCase { - ... - function testConnection() { - $socket = &new MockSocket($this); - ... - $telnet = &new TelnetTestVersion($this); - $telnet->setReturnReference('_createSocket', $socket); - $telnet->Telnet(); - $telnet->connect('127.0.0.1', 21, 'Me', 'Secret'); - ... - } -} -]]> - The partial mock is a subclass of the original with - selected methods "knocked out" with test - versions. - The generatePartial() call - takes three parameters: the class to be subclassed, - the new test class name and a list of methods to mock. -

-

- Instantiating the resulting objects is slightly tricky. - The only constructor parameter of a partial mock is - the unit tester reference. - As with the normal mock objects this is needed for sending - test results in response to checked expectations. -

-

- The original constructor is not run yet. - This is necessary in case the constructor is going to - make use of the as yet unset mocked methods. - We set any return values at this point and then run the - constructor with its normal parameters. - This three step construction of "new", followed - by setting up the methods, followed by running the constructor - proper is what distinguishes the partial mock code. -

-

- Apart from construction, all of the mocked methods have - the same features as mock objects and all of the unmocked - methods behave as before. - We can set expectations very easily... -setReturnReference('_createSocket', $socket); - $telnet->expectOnce('_createSocket', array('127.0.0.1', 21)); - $telnet->Telnet(); - $telnet->connect('127.0.0.1', 21, 'Me', 'Secret'); - ... - $telnet->tally(); - } -} -]]> -

-
-
-

- The mocked out methods don't have to be factory methods, - they could be any sort of method. - In this way partial mocks allow us to take control of any part of - a class except the constructor. - We could even go as far as to mock every method - except one we actually want to test. -

-

- This last situation is all rather hypothetical, as I haven't - tried it. - I am open to the possibility, but a little worried that - forcing object granularity may be better for the code quality. - I personally use partial mocks as a way of overriding creation - or for occasional testing of the TemplateMethod pattern. -

-

- It's all going to come down to the coding standards of your - project to decide which mechanism you use. -

-
-
- - - The mock injection problem. - - - Moving creation to a protected factory method. - - - Partial mocks generate subclasses. - - - Partial mocks test less than a class. - - - - - SimpleTest project page on SourceForge. - - - Full API for SimpleTest - from the PHPDoc. - - - The protected factory is described in - this paper from IBM. - This is the only formal comment I have seen on this problem. - - - - - php software development, - php test case development, - database programming php, - software development tools, - php advanced tutorial, - phpunit style scripts, - architecture, - php resources, - mock objects, - junit, - php test framework, - unit test, - php testing - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/photos_stream.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/photos_stream.xml deleted file mode 100644 index ed90b7d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/photos_stream.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - Photos & pictures tagged SimpleTest - - -

- A set of photos and pictures tagged with SimpleTest. -

-
-
- - - -
-
- - - - Pictures tagged - SimpleTest on Flickr - - - - - - software development, - computer programmer, - php programming, - programming php, - software development company, - software development uk, - php tutorial, - bespoke software development uk, - corporate web development, - architecture, - freelancer, - php resources, - wordtracker, - web marketing, - serach engines, - web positioning, - internet marketing - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/reporter_documentation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/reporter_documentation.xml deleted file mode 100644 index efc4ce2..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/reporter_documentation.xml +++ /dev/null @@ -1,471 +0,0 @@ - - - - SimpleTest for PHP test runner and display documentation - - -

- SimpleTest pretty much follows the MVC pattern - (Model-View-Controller). - The reporter classes are the view and the model is your - test cases and their hiearchy. - The controller is mostly hidden from the user of - SimpleTest unless you want to change how the test cases - are actually run, in which case it is possible to - override the runner objects from within the test case. - As usual with MVC, the controller is mostly undefined - and there are other places to control the test run. -

-
-
-

- The default test display is minimal in the extreme. - It reports success and failure with the conventional red and - green bars and shows a breadcrumb trail of test groups - for every failed assertion. - Here's a fail... -

-

File test

- Fail: createnewfile->True assertion failed.
-
1/1 test cases complete. - 0 passes, 1 fails and 0 exceptions.
-
- And here all tests passed... -
-

File test

-
1/1 test cases complete. - 1 passes, 0 fails and 0 exceptions.
-
- The good news is that there are several points in the display - hiearchy for subclassing. -

-

- For web page based displays there is the - HtmlReporter class with the following - signature... - - Here is what some of these methods mean. First the display methods - that you will probably want to override... -

    -
  • - HtmlReporter(string $encoding)
    - is the constructor. - Note that the unit test sets up the link to the display - rather than the other way around. - The display is a mostly passive receiver of test events. - This allows easy adaption of the display for other test - systems beside unit tests, such as monitoring servers. - The encoding is the character encoding you wish to - display the test output in. - In order to correctly render debug output when - using the web tester, this should match the encoding - of the site you are trying to test. - The available character set strings are described in - the PHP html_entities() - function. -
  • -
  • - void paintHeader(string $test_name)
    - is called once at the very start of the test when the first - start event arrives. - The first start event is usually delivered by the top level group - test and so this is where $test_name - comes from. - It paints the page titles, CSS, body tag, etc. - It returns nothing (void). -
  • -
  • - void paintFooter(string $test_name)
    - Called at the very end of the test to close any tags opened - by the page header. - By default it also displays the red/green bar and the final - count of results. - Actually the end of the test happens when a test end event - comes in with the same name as the one that started it all - at the same level. - The tests nest you see. - Closing the last test finishes the display. -
  • -
  • - void paintMethodStart(string $test_name)
    - is called at the start of each test method. - The name normally comes from method name. - The other test start events behave the same way except - that the group test one tells the reporter how large - it is in number of held test cases. - This is so that the reporter can display a progress bar - as the runner churns through the test cases. -
  • -
  • - void paintMethodEnd(string $test_name)
    - backs out of the test started with the same name. -
  • -
  • - void paintFail(string $message)
    - paints a failure. - By default it just displays the word fail, a breadcrumbs trail - showing the current test nesting and the message issued by - the assertion. -
  • -
  • - void paintPass(string $message)
    - by default does nothing. -
  • -
  • - string getCss()
    - Returns the CSS styles as a string for the page header - method. - Additional styles have to be appended here if you are - not overriding the page header. - You will want to use this method in an overriden page header - if you want to include the original CSS. -
  • -
- There are also some accessors to get information on the current - state of the test suite. - Use these to enrich the display... -
    -
  • - array getTestList()
    - is the first convenience method for subclasses. - Lists the current nesting of the tests as a list - of test names. - The first, most deeply nested test, is first in the - list and the current test method will be last. -
  • -
  • - integer getPassCount()
    - returns the number of passes chalked up so far. - Needed for the display at the end. -
  • -
  • - integer getFailCount()
    - is likewise the number of fails so far. -
  • -
  • - integer getExceptionCount()
    - is likewise the number of errors so far. -
  • -
  • - integer getTestCaseCount()
    - is the total number of test cases in the test run. - This includes the grouping tests themselves. -
  • -
  • - integer getTestCaseProgress()
    - is the number of test cases completed so far. -
  • -
- One simple modification is to get the HtmlReporter to display - the passes as well as the failures and errors... -class ShowPasses extends HtmlReporter { - - function paintPass($message) { - parent::paintPass($message); - print "&Pass: "; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - print implode("->", $breadcrumb); - print "->$message
\n"; - } - - protected function getCss() { - return parent::getCss() . ' .pass { color: green; }'; - } -} -]]>
-

-

- One method that was glossed over was the makeDry() - method. - If you run this method, with no parameters, on the reporter - before the test suite is run no actual test methods - will be called. - You will still get the events of entering and leaving the - test methods and test cases, but no passes or failures etc, - because the test code will not actually be executed. -

-

- The reason for this is to allow for more sophistcated - GUI displays that allow the selection of individual test - cases. - In order to build a list of possible tests they need a - report on the test structure for drawing, say a tree view - of the test suite. - With a reporter set to dry run that just sends drawing events - this is easily accomplished. -

-
-
-

- Rather than simply modifying the existing display, you might want to - produce a whole new HTML look, or even generate text or XML. - Rather than override every method in - HtmlReporter we can take one - step up the class hiearchy to SimpleReporter - in the simple_test.php source file. -

-

- A do nothing display, a blank canvas for your own creation, would - be... -require_once('simpletest/simple_test.php'); - -class MyDisplay extends SimpleReporter { - - function paintHeader($test_name) { - } - - function paintFooter($test_name) { - } - - function paintStart($test_name, $size) { - parent::paintStart($test_name, $size); - } - - function paintEnd($test_name, $size) { - parent::paintEnd($test_name, $size); - } - - function paintPass($message) { - parent::paintPass($message); - } - - function paintFail($message) { - parent::paintFail($message); - } -} -]]> - No output would come from this class until you add it. -

-
-
-

- SimpleTest also ships with a minimal command line reporter. - The interface mimics JUnit to some extent, but paints the - failure messages as they arrive. - To use the command line reporter simply substitute it - for the HTML version... -addTestFile('tests/file_test.php'); -$test->run(new TextReporter()); -?> -]]> - Then invoke the test suite from the command line... -

-php file_test.php
-
- You will need the command line version of PHP installed - of course. - A passing test suite looks like this... -
-File test
-OK
-Test cases run: 1/1, Failures: 0, Exceptions: 0
-
- A failure triggers a display like this... -
-File test
-1) True assertion failed.
-    in createnewfile
-FAILURES!!!
-Test cases run: 1/1, Failures: 1, Exceptions: 0
-
-

-

- One of the main reasons for using a command line driven - test suite is of using the tester as part of some automated - process. - To function properly in shell scripts the test script should - return a non-zero exit code on failure. - If a test suite fails the value false - is returned from the SimpleTest::run() - method. - We can use that result to exit the script with the desired return - code... -addTestFile('tests/file_test.php'); -exit ($test->run(new TextReporter()) ? 0 : 1); -?> -]]> - Of course we don't really want to create two test scripts, - a command line one and a web browser one, for each test suite. - The command line reporter includes a method to sniff out the - run time environment... -addTestFile('tests/file_test.php'); -if (TextReporter::inCli()) { - exit ($test->run(new TextReporter()) ? 0 : 1); -} -$test->run(new HtmlReporter()); -?> -]]> - This is the form used within SimpleTest itself. -

-
-
-

- SimpleTest ships with an XmlReporter class - used for internal communication. - When run the output looks like... -


-
-  
-    Remote tests
-    
-      Visual test with 48 passes, 48 fails and 4 exceptions
-      
-        testofunittestcaseoutput
-        
-          testofresults
-          This assertion passed
-          This assertion failed
-        
-        
-          ...
-        
-      
-    
-  
-
-]]>
- You can make use of this format with the parser - supplied as part of SimpleTest itself. - This is called SimpleTestXmlParser and - resides in xml.php within the SimpleTest package... -parse($test_output); -?> -]]> - The $test_output should be the XML format - from the XML reporter, and could come from say a command - line run of a test case. - The parser sends events to the reporter just like any - other test run. - There are some odd occasions where this is actually useful. -

-

- A problem with large test suites is thet they can exhaust - the default 8Mb memory limit on a PHP process. - By having the test groups output in XML and run in - separate processes, the output can be reparsed to - aggregate the results into a much smaller footprint top level - test. -

-

- Because the XML output can come from anywhere, this opens - up the possibility of aggregating test runs from remote - servers. - A test case already exists to do this within the SimpleTest - framework, but it is currently experimental... -require_once('../remote.php'); -require_once('../reporter.php'); - -$test_url = ...; -$dry_url = ...; - -$test = &new TestSuite('Remote tests'); -$test->addTestCase(new RemoteTestCase($test_url, $dry_url)); -$test->run(new HtmlReporter()); -?> -]]> - The RemoteTestCase takes the actual location - of the test runner, basically a web page in XML format. - It also takes the URL of a reporter set to do a dry run. - This is so that progress can be reported upward correctly. - The RemoteTestCase can be added to test suites - just like any other group test. -

-
-
- - - Displaying results in HTML - - - Displaying and reporting results - in other formats - - - Using SimpleTest from the command line - - - Using Using XML for remote testing - - - - - SimpleTest project page on SourceForge. - - - SimpleTest download page on LastCraft. - - - The developer's API for SimpleTest - gives full detail on the classes and assertions available. - - - - - php unit testing, - documentation, - marcus baker, - simple test, - simpletest, - remote testing, - xml tests, - automated testing - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/screencasts.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/screencasts.xml deleted file mode 100644 index b003e0a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/screencasts.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - Screencasts : Basic and Advanced TDD using SimpleTest - -
-

- Want to see a basic TDD session in PHP ? - Here's a screencast from a session presented at - the PHP Everywhere Conference - by Andre John Cruz - (Application Developer, Barclays Singapore). -

-

- Basic TDD in PHP Demo, 1 of 3
- -
-
- Basic TDD in PHP Demo, 2 of 3
- -
-
- Basic TDD in PHP Demo, 3 of 3
- -

-

- Advanced TDD in PHP Demo, 1 of 4
- -
-
- Advanced TDD in PHP Demo, 2 of 4
- -
-
- Advanced TDD in PHP Demo, 3 of 4
- -
-
- Advanced TDD in PHP Demo, 4 of 4
- -

-
-
- - - A screencast - covering "Basic and Advanced TDD in PHP". - - - - - The PHP User Group - Philippines organized the event. - - - - - software development, - test case example, - programming php, - software development tools, - php tutorial, - creating subclass, - free php scripts, - architecture, - php resources, - junit, - phpunit style testing, - unit test, - php testing, - screencast, - basic TDD, - advanced TDD - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/simple_test.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/simple_test.xml deleted file mode 100644 index 10aa862..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/simple_test.xml +++ /dev/null @@ -1,524 +0,0 @@ - - - - - Download the Simple Test testing framework - - Unit tests and mock objects for PHP - - - - 1.0.1 release cycle started. - Features include include file upload, better PHP5 support for - mock objects, and HTML label support. - There is also a big clean up of method names and some internals - refactoring. - - -

- The following assumes that you are familiar with the concept - of unit testing as well as the PHP web development language. - It is a guide for the impatient new user of - SimpleTest. - For fuller documentation, especially if you are new - to unit testing see the ongoing - documentation, and for - example test cases see the - unit testing tutorial. -

-
-
-

- Amongst software testing tools, a unit tester is the one - closest to the developer. - In the context of agile development the test code sits right - next to the source code as both are written simultaneously. - In this context SimpleTest aims to be a complete PHP developer - test solution and is called "Simple" because it - should be easy to use and extend. - It wasn't a good choice of name really. - It includes all of the typical functions you would expect from - JUnit and the - PHPUnit - ports, and includes - mock objects. -

-

- What makes this tool immediately useful to the PHP developer is the internal - web browser. - This allows tests that navigate web sites, fill in forms and test pages. - Being able to write these test in PHP means that it is easy to write - integrated tests. - An example might be confirming that a user was written to a database - after a signing up through the web site. -

-

- The quickest way to demonstrate SimpleTest is with an example. -

-

- Let us suppose we are testing a simple file logging class called - Log in classes/log.php. - We start by creating a test script which we will call - tests/log_test.php and populate it as follows... -require_once('simpletest/autorun.php'); -require_once('../classes/log.php'); - -class TestOfLogging extends UnitTestCase { -} -?> -]]> - Here the simpletest folder is either local or in the path. - You would have to edit these locations depending on where you - unpacked the toolset. - The "autorun.php" file does more than just include the - SimpleTest files, it also runs our test for us. -

-

- The TestOfLogging is our first test case and it's - currently empty. - Each test case is a class that extends one of the SimpleTet base classes - and we can have as many of these in the file as we want. -

-

- With three lines of scaffolding, and our Log class - include, we have a test suite. - No tests though. -

-

- For our first test, we'll assume that the Log class - takes the file name to write to in the constructor, and we have - a temporary folder in which to place this file... -testLogCreatesNewFileOnFirstMessage() { - @unlink('/temp/test.log'); - $log = new Log('/temp/test.log'); - $this->assertFalse(file_exists('/temp/test.log')); - $log->message('Should write this to a file'); - $this->assertTrue(file_exists('/temp/test.log')); - } -} -?> -]]> - When a test case runs, it will search for any method that - starts with the string "test" - and execute that method. - If the method starts "test", it's a test. - Note the very long name testLogCreatesNewFileOnFirstMessage(). - This is considered good style and makes the test output more readable. -

-

- We would normally have more than one test method in a test case, - but that's for later. -

-

- Assertions within the test methods trigger messages to the - test framework which displays the result immediately. - This immediate response is important, not just in the event - of the code causing a crash, but also so that - print statements can display - their debugging content right next to the assertion concerned. -

-

- To see these results we have to actually run the tests. - No other code is necessary - we can just open the page - with our browser. -

-

- On failure the display looks like this... -

-

TestOfLogging

- Fail: testLogCreatesNewFileOnFirstMessage->True assertion failed.
-
1/1 test cases complete. - 1 passes and 1 fails.
-
- ...and if it passes like this... -
-

TestOfLogging

-
1/1 test cases complete. - 2 passes and 0 fails.
-
- And if you get this... -
- Fatal error: Failed opening required '../classes/log.php' (include_path='') in /home/marcus/projects/lastcraft/tutorial_tests/Log/tests/log_test.php on line 7 -
- it means you're missing the classes/Log.php file that could look like... - -class Log { - function Log($file_path) { - } - - function message() { - } -} -?> -]]> - It's fun to write the code after the test. - More than fun even - - this system is called "Test Driven Development". -

-

- For more information about UnitTestCase, see - the unit test documentation. -

-
-
-

- It is unlikely in a real application that we will only ever run - one test case. - This means that we need a way of grouping cases into a test - script that can, if need be, run every test for the application. -

-

- Our first step is to create a new file called tests/all_tests.php - and insert the following code... -require_once('simpletest/autorun.php'); - -class AllTests extends TestSuite { - function AllTests() { - $this->TestSuite('All tests'); - $this->addFile('log_test.php'); - } -} -?> -]]> - The "autorun" include allows our upcoming test suite - to be run just by invoking this script. -

-

- The TestSuite subclass must chain it's constructor. - This limitation will be removed in future versions. -

-

- The method TestSuite::addFile() - will include the test case file and read any new classes - that are descended from SimpleTestCase. - UnitTestCase is just one example of a class derived from - SimpleTestCase, and you can create your own. - TestSuite::addFile() can include other test suites. -

-

- The class will not be instantiated yet. - When the test suite runs it will construct each instance once - it reaches that test, then destroy it straight after. - This means that the constructor is run just before each run - of that test case, and the destructor is run before the next test case starts. -

-

- It is common to group test case code into superclasses which are not - supposed to run, but become the base classes of other tests. - For "autorun" to work properly the test case file should not blindly run - any other test case extensions that do not actually run tests. - This could result in extra test cases being counted during the test - run. - Hardly a major problem, but to avoid this inconvenience simply mark your - base class as abstract. - SimpleTest won't run abstract classes. - If you are still using PHP4, then - a SimpleTestOptions::ignore() directive - somewhere in the test case file will have the same effect. -

-

- Also, the test case file should not have been included - elsewhere or no cases will be added to this group test. - This would be a more serious error as if the test case classes are - already loaded by PHP the TestSuite::addFile() - method will not detect them. -

-

- To display the results it is necessary only to invoke - tests/all_tests.php from the web server or the command line. -

-

- For more information about building test suites, - see the test suite documentation. -

-
-
-

- Let's move further into the future and do something really complicated. -

-

- Assume that our logging class is tested and completed. - Assume also that we are testing another class that is - required to write log messages, say a - SessionPool. - We want to test a method that will probably end up looking - like this... - -class SessionPool { - ... - function logIn($username) { - ... - $this->_log->message("User $username logged in."); - ... - } - ... -} - -]]> - In the spirit of reuse, we are using our - Log class. - A conventional test case might look like this... -require_once('../classes/session_pool.php'); - -class TestOfSessionLogging extends UnitTestCase { - - function setUp() { - @unlink('/temp/test.log'); - } - - function tearDown() { - @unlink('/temp/test.log'); - } - - function testLoggingInIsLogged() { - $log = new Log('/temp/test.log'); - $session_pool = &new SessionPool($log); - $session_pool->logIn('fred'); - $messages = file('/temp/test.log'); - $this->assertEqual($messages[0], "User fred logged in.\n"); - } -} -?> -]]> - We'll explain the setUp() and tearDown() - methods later. -

-

- This test case design is not all bad, but it could be improved. - We are spending time fiddling with log files which are - not part of our test. - We have created close ties with the Log class and - this test. - What if we don't use files any more, but use ths - syslog library instead? - It means that our TestOfSessionLogging test will - fail, even thouh it's not testing Logging. -

-

- It's fragile in smaller ways too. - Did you notice the extra carriage return in the message? - Was that added by the logger? - What if it also added a time stamp or other data? -

-

- The only part that we really want to test is that a particular - message was sent to the logger. - We can reduce coupling if we pass in a fake logging class - that simply records the message calls for testing, but - takes no action. - It would have to look exactly like our original though. -

-

- If the fake object doesn't write to a file then we save on deleting - the file before and after each test. We could save even more - test code if the fake object would kindly run the assertion for us. -

-

- Too good to be true? - We can create such an object easily... -Mock::generate('Log'); - -class TestOfSessionLogging extends UnitTestCase { - - function testLoggingInIsLogged() { - $log = &new MockLog(); - $log->expectOnce('message', array('User fred logged in.')); - $session_pool = &new SessionPool($log); - $session_pool->logIn('fred'); - } -} -?> -]]> - The Mock::generate() call code generated a new class - called MockLog. - This looks like an identical clone, except that we can wire test code - to it. - That's what expectOnce() does. - It says that if message() is ever called on me, it had - better be with the parameter "User fred logged in.". -

-

- The test will be triggered when the call to - message() is invoked on the - MockLog object by SessionPool::logIn() code. - The mock call will trigger a parameter comparison and then send the - resulting pass or fail event to the test display. - Wildcards can be included here too, so you don't have to test every parameter of - a call when you only want to test one. -

-

- If the mock reaches the end of the test case without the - method being called, the expectOnce() - expectation will trigger a test failure. - In other words the mocks can detect the absence of - behaviour as well as the presence. -

-

- The mock objects in the SimpleTest suite can have arbitrary - return values set, sequences of returns, return values - selected according to the incoming arguments, sequences of - parameter expectations and limits on the number of times - a method is to be invoked. -

-

- For more information about mocking and stubbing, see the - mock objects documentation. -

-
-
-

- One of the requirements of web sites is that they produce web - pages. - If you are building a project top-down and you want to fully - integrate testing along the way then you will want a way of - automatically navigating a site and examining output for - correctness. - This is the job of a web tester. -

-

- The web testing in SimpleTest is fairly primitive, as there is - no JavaScript. - Most other browser operations are simulated. -

-

- To give an idea here is a trivial example where a home - page is fetched, from which we navigate to an "about" - page and then test some client determined content. -require_once('simpletest/web_tester.php'); - -class TestOfAbout extends WebTestCase { - function testOurAboutPageGivesFreeReignToOurEgo() { - $this->get('http://test-server/index.php'); - $this->click('About'); - $this->assertTitle('About why we are so great'); - $this->assertText('We are really great'); - } -} -?> -]]> - With this code as an acceptance test, you can ensure that - the content always meets the specifications of both the - developers, and the other project stakeholders. -

-

- You can navigate forms too... -get('http://google.com/'); - $this->setField('q', 'simpletest'); - $this->click("I'm Feeling Lucky"); - $this->assertTitle('SimpleTest - Unit Testing for PHP'); - } -} -?> -]]> - ...although this could violate Google's(tm) terms and conditions. -

-

- For more information about web testing, see the - scriptable - browser documentation and the - WebTestCase. -

-

- SourceForge.net Logo -

-
-
- - - Using unit tester - with an example. - - - Grouping tests - for testing with one click. - - - Using mock objects - to ease testing and gain tighter control. - - - Testing web pages - at the browser level. - - - - - Download PHP Simple Test - from SourceForge. - - - The developer's API for SimpleTest - gives full detail on the classes and assertions available. - - - - - software development, - php programming, - programming php, - software development tools, - php tutorial, - free php scripts, - architecture, - php resources, - mock objects, - junit, - php testing, - php unit, - methodology, - test first, - sourceforge, - open source, - unit test, - web tester, - web testing, - html testing tools, - testing web pages, - php mock objects, - navigating websites automatically, - automated testing, - web scripting, - wget, - curl testing, - jmock for php, - jwebunit, - phpunit, - php unit testing, - php web testing, - jason sweat, - marcus baker, - topstyle plug in, - phpedit plug in - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/softwares_using_simpletest.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/softwares_using_simpletest.xml deleted file mode 100644 index 368a501..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/softwares_using_simpletest.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - - Softwares using SimpleTest - -
-

- Some projects are able to extend SimpleTest's functionnality : -

-
-
- - Limb Unit - -
-
- limb_unit is an advanced SimpleTest based tests runner - utility for PHP5. In a nutshell, limb_unit finds and executes tests within - the file system. It's similar to phpunit utility from PHPUnit, - yet more powerful. -
-
- - SimpleTestXUL - -
-
- A XUL interface to SimpleTest framework. -
-
- - Stagehand_TestRunner - -
-
- Automated test runners for PHPUnit and SimpleTest. -
-
- - Suite Tester - -
-
- Suite Tester is an AJAX-driven add-on for the - PHP SimpleTest unit-testing tool. The main benefits are conveniently testing - an entire application or a single unit in one place, and quickly viewing - a suite's results one unit at a time. -
- -
-
-
-

- Others are using SimpleTest to build stuff : -

-
-
- - CakePHP - -
-
- CakePHP is a rapid development framework for PHP - which uses commonly known design patterns like ActiveRecord, - Association Data Mapping, Front Controller and MVC. -
-
- - Web Application Component Toolkit - -
-
- The Web Application Component Toolkit is - a framework for creating web applications. - WACT facilitates a modular approach where individual, - independent or reusable components may be integrated into a larger web - application. WACT assists in implementing the Model View Controller - pattern and the related Domain Model, Template View, Front Controller - and Application Controller patterns. -
-
- - Limb3 - -
-
- Limb is an OpenSource(LGPL) PHP framework aimed for - rapid web application development. - It is a committed proponents of the beautiful and - easy-to-maintain code that simply works. - That is why the Limb code is developed and constantly refactored in a - test driven manner using the best agile development practices. -
-
- - Drupal | SimpleTest - -
-
- A framework for running automated unit tests in Drupal. - This module comes with a set of core tests. These can be helpful when - making patches for the drupal core or when building your own set of - modules. -
-
- - WideImage - -
-
- WideImage is an object-oriented PHP image library, written - in/for PHP5. Uses GD2 and is unit-tested with Simpletest. Promotes ease of - use and extensibility. -
-
- - Aperiplus - -
-
- Aperiplus is a general purpose, unit-tested, OOP library - for PHP5. It contains extensions for SimpleTest. -
-
- - Flux CMS - -
-
- Flux CMS is a XML/XSLT CMS based on PHP 5 and Popoon. - It's easy to use for the enduser and has WYSIWYG editing capabilites, - but it's also very extensible and powerful for implementors to suit - your needs. -
-
- - Moodle - -
-
- Moodle is a course management system (CMS) - - a free, Open Source software package designed using sound pedagogical - principles, to help educators create effective online learning communities. -
-
-
-
- - - Projects extending SimpleTest - - - And some using SimpleTest - - - - - - - - - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/speakers_coaches_consultancy.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/speakers_coaches_consultancy.xml deleted file mode 100644 index ed0a67e..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/speakers_coaches_consultancy.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - Speakers, coaches and consultants - -
-

- Providing a tool -- SimpleTest -- to enable developpers - get started with Unit Testing and TDD is sometimes not enough. -

-

- You need the "whole solution" : enjoying the knowledge of an - experienced coach or consultant can boost your strategy. - The team developping SimpleTest can offer in-depth expertise - to you projects. -

-
-
- - - - - - -
-
- - - - Providing the whole solution - - - Speakers, coaches and consultants close to you - - - - - - software development, - computer programmer, - php programming, - programming php, - software development company, - software development uk, - php tutorial, - bespoke software development uk, - corporate web development, - architecture, - freelancer, - php resources, - wordtracker, - web marketing, - serach engines, - web positioning, - internet marketing - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/subclass_tutorial.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/subclass_tutorial.xml deleted file mode 100644 index 17c5ce9..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/subclass_tutorial.xml +++ /dev/null @@ -1,255 +0,0 @@ - - - - PHP unit testing tutorial - Subclassing a test case - -
-

- We left our clock test with a hole. - If the PHP time() - function rolled over during this comparison... -assertEqual($clock->now(), time(), 'Now is the right time'); -} -]]> - ...our test would be out by one second and would cause - a false failure. - Erratic behaviour of our test suite is not what we want when - we could be running it a hundred times a day. -

-

- We could rewrite the test as... - - $time1 = $clock->now(); - $time2 = time(); - $this->assertTrue($time1 == $time2) || ($time1 + 1 == $time2), 'Now is the right time'); -} -]]> - This is hardly a clear design though and we will have to repeat - this for every timing test that we do. - Repetition is public enemy number one and so we'll - use this as incentive to factor out the new test code. -UnitTestCase('Clock class test'); - } - function assertSameTime($time1, $time2, $message) { - $this->assertTrue( - ($time1 == $time2) || ($time1 + 1 == $time2), - $message); - } - function testClockTellsTime() { - $clock = new Clock(); - $this->assertSameTime($clock->now(), time(), 'Now is the right time'); - } - function testClockAdvance() { - $clock = new Clock(); - $clock->advance(10); - $this->assertSameTime($clock->now(), time() + 10, 'Advancement'); - } -} -]]> - Of course each time I make one of these changes I rerun the - tests to make sure we are still OK. - Refactor on green. - It's a lot safer. -

-
-
-

- It may be that we want more than one test case that is - timing sensitive. - Perhaps we are reading timestamps from database rows - or other places that could allow an extra second to - tick over. - For these new test classes to take advantage of our new assertion - we need to place it into a superclass. -

-

- Here is the complete clock_test.php file after - promoting our assertSameTime() - method to its own superclass... - -class TimeTestCase extends UnitTestCase { - function TimeTestCase($test_name) { - $this->UnitTestCase($test_name); - } - function assertSameTime($time1, $time2, $message) { - $this->assertTrue( - ($time1 == $time2) || ($time1 + 1 == $time2), - $message); - } -} - -class TestOfClock extends TimeTestCase { - function TestOfClock() { - $this->TimeTestCase('Clock class test'); - } - function testClockTellsTime() { - $clock = new Clock(); - $this->assertSameTime($clock->now(), time(), 'Now is the right time'); - } - function testClockAdvance() { - $clock = new Clock(); - $clock->advance(10); - $this->assertSameTime($clock->now(), time() + 10, 'Advancement'); - } -} -?> -]]> - Now we get the benefit of our new assertion every - time we inherit from our own - TimeTestCase class - rather than the default - UnitTestCase. - This is very much how the JUnit tool was designed - to be used and SimpleTest is a port of that interface. - It is a testing framework from which your own test - system can be grown. -

-

- If we run the tests now we get a slight niggle... -

- Warning: Missing argument 1 for timetestcase() - in /home/marcus/projects/lastcraft/tutorial_tests/tests/clock_test.php on line 5
-

All tests

-
3/3 test cases complete. - 6 passes and 0 fails.
-
- The reasons for this are quite tricky. -

-

- Our subclass requires a constructor parameter that has - not been supplied and yet it appears that we did - supply it. - When we inherited our new class we passed it in our own - constructor. - It's right here... -TimeTestCase('Clock class test'); -} -]]> - In fact we are right, that is not the problem. -

-

- Remember when we built our all_tests.php - group test by using the - addTestFile() method. - This method looks for test case classes, instantiates - them if they are new and then runs all of their tests. - What's happened is that it has found our - test case extension as well. - This is harmless as there are no test methods within it, - that is, method names that start with the string - "test". - No extra tests are run. -

-

- The trouble is that it instantiates the class and does this without - the $test_name parameter - which is what causes our warning. - This parameter is not normally required of a test - case and not normally of its assertions either. - To make our extended test case match the - UnitTestCase interface - we must make these optional... -$test_name = false) { - $this->UnitTestCase($test_name); - } - function assertSameTime($time1, $time2, $message = false) { - if (! $message) { - $message = "Time [$time1] should match time [$time2]"; - } - $this->assertTrue( - ($time1 == $time2) || ($time1 + 1 == $time2), - $message); - } -} -]]> - Of course it should still bother you that this class is - instantiated by the test suite unnecessarily. - Here is a modification to prevent it running... -SimpleTestOptions::ignore('TimeTestCase'); -class TimeTestCase extends UnitTestCase { - function TimeTestCase($test_name = false) { - $this->UnitTestCase($test_name); - } - function assertSameTime($time1, $time2, $message = '') { - if (!$message) { - $message = "Time [$time1] should match time [$time2]"; - } - $this->assertTrue( - ($time1 == $time2) || ($time1 + 1 == $time2), - $message); - } -} -]]> - This just tells SimpleTest to always ignore this class when - building test suites. - It can be included anywhere in the test case file. -

-

- Six passes looks good, but does not tell the casual - observer what has been tested. - For that you have to look at the code. - If that sounds like drudge to you and you would like this - information displayed before you then we should go on - to show the passes next. -

-
-
- - - A timing insensitive assertion - that allows a one second gain. - - - Subclassing the test case - so as to reuse the test method. - - - - - The previous section was - controlling test variables. - - - The next tutorial section was - changing the test display. - - - You will need the - SimpleTest test tool to run the - sample code. - - - - - software development, - test case example, - programming php, - software development tools, - php tutorial, - creating subclass, - free php scripts, - architecture, - php resources, - junit, - phpunit style testing, - unit test, - php testing - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/support_website.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/support_website.xml deleted file mode 100644 index 15b179d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/support_website.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - Support mailing list - - -

- The simpletest-support mailing-list is probably - the most active area around SimpleTest : - help, advice, bugs and workarounds tend to happen most of the time. -

-
-
-

- It's really - - easy to subscribe - and it's - - fully searchable too. -

-

- At the last count, there were about 114 subscribers and 1908 message sent. - That's anything between 1 and 4 messages per day on average. -

-
-
- - - To subscribe. - - - - - Subscribing to the - - Support mailing list. - - - Reading the - - archive. - - - - - SimpleTest, - download, - source code, - stable release, - eclipse release, - eclipse plugin, - debian package, - drupal module, - pear channel, - pearified package - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/unit_test_documentation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/unit_test_documentation.xml deleted file mode 100644 index adc9236..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/unit_test_documentation.xml +++ /dev/null @@ -1,313 +0,0 @@ - - - - SimpleTest for PHP regression test documentation - -
-

- The core system is a regression testing framework built around - test cases. - A sample test case looks like this... -class FileTestCase extends UnitTestCase { -} -]]> - Actual tests are added as methods in the test case whose names - by default start with the string "test" and - when the test case is invoked all such methods are run in - the order that PHP introspection finds them. - As many test methods can be added as needed. -

-

- For example... -UnitTestCase('File test'); - } - - function setUp() { - @unlink('../temp/test.txt'); - } - - function tearDown() { - @unlink('../temp/test.txt'); - } - - function testCreation() { - $writer = &new FileWriter('../temp/test.txt'); - $writer->write('Hello'); - $this->assertTrue(file_exists('../temp/test.txt'), 'File created'); - } -} -]]> - The constructor is optional and usually omitted. - Without a name, the class name is taken as the name of the test case. -

-

- Our only test method at the moment is testCreation() - where we check that a file has been created by our - Writer object. - We could have put the unlink() - code into this method as well, but by placing it in - setUp() and - tearDown() we can use it with - other test methods that we add. -

-

- The setUp() method is run - just before each and every test method. - tearDown() is run just after - each and every test method. -

-

- You can place some test case set up into the constructor to - be run once for all the methods in the test case, but - you risk test inteference that way. - This way is slightly slower, but it is safer. - Note that if you come from a JUnit background this will not - be the behaviour you are used to. - JUnit surprisingly reinstantiates the test case for each test - method to prevent such interference. - SimpleTest requires the end user to use setUp(), but - supplies additional hooks for library writers. -

-

- The means of reporting test results (see below) are by a - visiting display class - that is notified by various assert...() - methods. - Here is the full list for the UnitTestCase - class, the default for SimpleTest... - - - - - - - - - - - - - - - - - - - -
assertTrue($x)Fail if $x is false
assertFalse($x)Fail if $x is true
assertNull($x)Fail if $x is set
assertNotNull($x)Fail if $x not set
assertIsA($x, $t)Fail if $x is not the class or type $t
assertNotA($x, $t)Fail if $x is of the class or type $t
assertEqual($x, $y)Fail if $x == $y is false
assertNotEqual($x, $y)Fail if $x == $y is true
assertWithinMargin($x, $y, $m)Fail if abs($x - $y) < $m is false
assertOutsideMargin($x, $y, $m)Fail if abs($x - $y) < $m is true
assertIdentical($x, $y)Fail if $x == $y is false or a type mismatch
assertNotIdentical($x, $y)Fail if $x == $y is true and types match
assertReference($x, $y)Fail unless $x and $y are the same variable
assertClone($x, $y)Fail unless $x and $y are identical copies
assertPattern($p, $x)Fail unless the regex $p matches $x
assertNoPattern($p, $x)Fail if the regex $p matches $x
expectError($x)Swallows any upcoming matching error
assert($e)Fail on failed expectation object $e
- All assertion methods can take an optional description as a - last parameter. - This is to label the displayed result with. - If omitted a default message is sent instead, which is usually - sufficient. - This default message can still be embedded in your own message - if you include "%s" within the string. - All the assertions return true on a pass or false on failure. -

-

- Some examples... -$this->assertNull($variable, 'Should be cleared'); -]]> - ...will pass and normally show no message. - If you have - set up the tester to display passes - as well then the message will be displayed as is. -$this->assertIdentical(0, false, 'Zero is not false [%s]'); -]]> - This will fail as it performs a type - check, as well as a comparison, between the two values. - The "%s" part is replaced by the default - error message that would have been shown if we had not - supplied our own. -$this->assertReference($a, $b); -]]> - Will fail as the variable $a is a copy of $b. -$this->assertPattern('/hello/i', 'Hello world'); -]]> - This will pass as using a case insensitive match the string - hello is contained in Hello world. -$this->expectError(); -trigger_error('Catastrophe'); -]]> - Here the check catches the "Catastrophe" - message without checking the text and passes. - This removes the error from the queue. -$this->expectError('Catastrophe'); -trigger_error('Catastrophe'); -]]> - The next error check tests not only the existence of the error, - but also the text which, here matches so another pass. - If any unchecked errors are left at the end of a test method then - an exception will be reported in the test. -

-

- Note that SimpleTest cannot catch compile time PHP errors. -

-

- The test cases also have some convenience methods for debugging - code or extending the suite... - - - - - - - - -
setUp()Runs this before each test method
tearDown()Runs this after each test method
pass()Sends a test pass
fail()Sends a test failure
error()Sends an exception event
signal($type, $payload)Sends a user defined message to the test reporter
dump($var)Does a formatted print_r() for quick and dirty debugging
-

-
-
-

- Of course additional test methods can be added to create - specific types of test case, so as to extend framework... - -class FileTester extends UnitTestCase { - function FileTester($name = false) { - $this->UnitTestCase($name); - } - - function assertFileExists($filename, $message = '%s') { - $this->assertTrue( - file_exists($filename), - sprintf($message, 'File [$filename] existence check')); - } -} -]]> - Here the SimpleTest library is held in a folder called - simpletest that is local. - Substitute your own path for this. -

-

- To prevent this test case being run accidently, it is - advisable to mark it as abstract. -

-

- Alternatively you could add a - SimpleTestOptions::ignore('FileTester'); - directive in your code. -

-

- This new case can be now be inherited just like - a normal test case... -FileTester { - - function setUp() { - @unlink('../temp/test.txt'); - } - - function tearDown() { - @unlink('../temp/test.txt'); - } - - function testCreation() { - $writer = &new FileWriter('../temp/test.txt'); - $writer->write('Hello'); - $this->assertFileExists('../temp/test.txt'); - } -} -]]> -

-

- If you want a test case that does not have all of the - UnitTestCase assertions, - only your own and a few basics, - you need to extend the SimpleTestCase - class instead. - It is found in simple_test.php rather than - unit_tester.php. - See later if you - want to incorporate other unit tester's - test cases in your test suites. -

-
-
-

- You won't often run single test cases except when bashing - away at a module that is having difficulty, and you don't - want to upset the main test suite. - With autorun no particular scaffolding is needed, - just launch your particular test file and you're ready to go. -

-

- You can even decide which reporter (for example, - TextReporter or HtmlReporter) - you prefer for a specific file when launched on its own... - -SimpleTest :: prefer(new TextReporter()); -require_once('../classes/writer.php'); - -class FileTestCase extends UnitTestCase { - ... -} -?> -]]> - This script will run as is, but of course will output zero passes - and zero failures until test methods are added. -

-
-
- - - Unit test cases and basic assertions. - - - Extending test cases to - customise them for your own project. - - - Running a single case as - a single script. - - - - - SimpleTest project page on SourceForge. - - - SimpleTest download page on LastCraft. - - - Full API for SimpleTest - from the PHPDoc. - - - - - php unit testing, - test integration, - documentation, - marcus baker, - simple test, - simpletest documentation, - phpunit, - junit, - xunit, - agile web development, - eXtreme Programming, - Test Driven, - TDD - - -
diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/web_tester_documentation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/web_tester_documentation.xml deleted file mode 100644 index e2c9699..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/web_tester_documentation.xml +++ /dev/null @@ -1,379 +0,0 @@ - - - - Simple Test for PHP web script testing documentation - -
-

- Testing classes is all very well, but PHP is predominately - a language for creating functionality within web pages. - How do we test the front end presentation role of our PHP - applications? - Well the web pages are just text, so we should be able to - examine them just like any other test data. -

-

- This leads to a tricky issue. - If we test at too low a level, testing for matching tags - in the page with pattern matching for example, our tests will - be brittle. - The slightest change in layout could break a large number of - tests. - If we test at too high a level, say using mock versions of a - template engine, then we lose the ability to automate some classes - of test. - For example, the interaction of forms and navigation will - have to be tested manually. - These types of test are extremely repetitive and error prone. -

-

- SimpleTest includes a special form of test case for the testing - of web page actions. - The WebTestCase includes facilities - for navigation, content and cookie checks and form handling. - Usage of these test cases is similar to the - UnitTestCase... -class TestOfLastcraft extends WebTestCase { -} -]]> - Here we are about to test the - Last Craft site itself. - If this test case is in a file called lastcraft_test.php - then it can be loaded in a runner script just like unit tests... - -require_once('simpletest/web_tester.php'); -SimpleTest::prefer(new TextReporter()); - -class WebTests extends TestSuite { - function WebTests() { - $this->TestSuite('Web site tests'); - $this->addFile('lastcraft_test.php'); - } -} -?> -]]> - I am using the text reporter here to more clearly - distinguish the web content from the test output. -

-

- Nothing is being tested yet. - We can fetch the home page by using the - get() method... - - function testHomepage() { - $this->assertTrue($this->get('http://www.lastcraft.com/')); - } -} -]]> - The get() method will - return true only if page content was successfully - loaded. - It is a simple, but crude way to check that a web page - was actually delivered by the web server. - However that content may be a 404 response and yet - our get() method will still return true. -

-

- Assuming that the web server for the Last Craft site is up - (sadly not always the case), we should see... -

-Web site tests
-OK
-Test cases run: 1/1, Failures: 0, Exceptions: 0
-
- All we have really checked is that any kind of page was - returned. - We don't yet know if it was the right one. -

-
-
-

- To confirm that the page we think we are on is actually the - page we are on, we need to verify the page content. - - $this->get('http://www.lastcraft.com/'); - $this->assertText('Why the last craft'); - } -} -]]> - The page from the last fetch is held in a buffer in - the test case, so there is no need to refer to it directly. - The pattern match is always made against the buffer. -

-

- Here is the list of possible content assertions... - - - - - - - - - - - - - - - - - - - - - -
assertTitle($title)Pass if title is an exact match
assertText($text)Pass if matches visible and "alt" text
assertNoText($text)Pass if doesn't match visible and "alt" text
assertPattern($pattern)A Perl pattern match against the page content
assertNoPattern($pattern)A Perl pattern match to not find content
assertLink($label)Pass if a link with this text is present
assertNoLink($label)Pass if no link with this text is present
assertLinkById($id)Pass if a link with this id attribute is present
assertNoLinkById($id)Pass if no link with this id attribute is present
assertField($name, $value)Pass if an input tag with this name has this value
assertFieldById($id, $value)Pass if an input tag with this id has this value
assertResponse($codes)Pass if HTTP response matches this list
assertMime($types)Pass if MIME type is in this list
assertAuthentication($protocol)Pass if the current challenge is this protocol
assertNoAuthentication()Pass if there is no current challenge
assertRealm($name)Pass if the current challenge realm matches
assertHeader($header, $content)Pass if a header was fetched matching this value
assertNoHeader($header)Pass if a header was not fetched
assertCookie($name, $value)Pass if there is currently a matching cookie
assertNoCookie($name)Pass if there is currently no cookie of this name
- As usual with the SimpleTest assertions, they all return - false on failure and true on pass. - They also allow an optional test message and you can embed - the original test message inside using "%s" inside - your custom message. -

-

- So now we could instead test against the title tag with... -$this->assertTitle('The Last Craft? Web developer tutorials on PHP, Extreme programming and Object Oriented development'); -]]> - ...or, if that is too long and fragile... -$this->assertTitle(new PatternExpectation('/The Last Craft/')); -]]> - As well as the simple HTML content checks we can check - that the MIME type is in a list of allowed types with... -$this->assertMime(array('text/plain', 'text/html')); -]]> - More interesting is checking the HTTP response code. - Like the MIME type, we can assert that the response code - is in a list of allowed values... -get('http://www.lastcraft.com/test/redirect.php'); - $this->assertResponse(200); - } -} -]]> - Here we are checking that the fetch is successful by - allowing only a 200 HTTP response. - This test will pass, but it is not actually correct to do so. - There is no page, instead the server issues a redirect. - The WebTestCase will - automatically follow up to three such redirects. - The tests are more robust this way and we are usually - interested in the interaction with the pages rather - than their delivery. - If the redirects are of interest then this ability must - be disabled... - - $this->setMaximumRedirects(0); - $this->get('http://www.lastcraft.com/test/redirect.php'); - $this->assertResponse(200); - } -} -]]> - The assertion now fails as expected... -

-Web site tests
-1) Expecting response in [200] got [302]
-    in testhomepage
-    in testoflastcraft
-    in lastcraft_test.php
-FAILURES!!!
-Test cases run: 1/1, Failures: 1, Exceptions: 0
-
- We can modify the test to correctly assert redirects with... -setMaximumRedirects(0); - $this->get('http://www.lastcraft.com/test/redirect.php'); - $this->assertResponse(array(301, 302, 303, 307)); - } -} -]]> - This now passes. -

-
-
-

- Users don't often navigate sites by typing in URLs, but by - clicking links and buttons. - Here we confirm that the contact details can be reached - from the home page... -get('http://www.lastcraft.com/'); - $this->clickLink('About'); - $this->assertTitle(new PatternExpectation('/About Last Craft/')); - } -} -]]> - The parameter is the text of the link. -

-

- If the target is a button rather than an anchor tag, then - clickSubmit() can be used - with the button title... -$this->clickSubmit('Go!'); -]]> - If you are not sure or don't care, the usual case, then just - use the click() method... -$this->click('Go!'); -]]> -

-

- The list of navigation methods is... - - - - - - - - - - - - - - - - - - - - - - - - - -
getUrl()The current location
get($url, $parameters)Send a GET request with these parameters
post($url, $parameters)Send a POST request with these parameters
head($url, $parameters)Send a HEAD request without replacing the page content
retry()Reload the last request
back()Like the browser back button
forward()Like the browser forward button
authenticate($name, $password)Retry after a challenge
restart()Restarts the browser as if a new session
getCookie($name)Gets the cookie value for the current context
ageCookies($interval)Ages current cookies prior to a restart
clearFrameFocus()Go back to treating all frames as one page
clickSubmit($label)Click the first button with this label
clickSubmitByName($name)Click the button with this name attribute
clickSubmitById($id)Click the button with this ID attribute
clickImage($label, $x, $y)Click an input tag of type image by title or alt text
clickImageByName($name, $x, $y)Click an input tag of type image by name
clickImageById($id, $x, $y)Click an input tag of type image by ID attribute
submitFormById($id)Submit a form without the submit value
clickLink($label, $index)Click an anchor by the visible label text
clickLinkById($id)Click an anchor by the ID attribute
getFrameFocus()The name of the currently selected frame
setFrameFocusByIndex($choice)Focus on a frame counting from 1
setFrameFocus($name)Focus on a frame by name
-

-

- The parameters in the get(), post() or - head() methods are optional. - The HTTP HEAD fetch does not change the browser context, only loads - cookies. - This can be useful for when an image or stylesheet sets a cookie - for crafty robot blocking. -

-

- The retry(), back() and - forward() commands work as they would on - your web browser. - They use the history to retry pages. - This can be handy for checking the effect of hitting the - back button on your forms. -

-

- The frame methods need a little explanation. - By default a framed page is treated just like any other. - Content will be searced for throughout the entire frameset, - so clicking a link will work no matter which frame - the anchor tag is in. - You can override this behaviour by focusing on a single - frame. - If you do that, all searches and actions will apply to that - frame alone, such as authentication and retries. - If a link or button is not in a focused frame then it cannot - be clicked. -

-

- Testing navigation on fixed pages only tells you when you - have broken an entire script. - For highly dynamic pages, such as for bulletin boards, this can - be crucial for verifying the correctness of the application. - For most applications though, the really tricky logic is usually in - the handling of forms and sessions. - Fortunately SimpleTest includes - tools for testing web forms - as well. -

-
-
-

- Although SimpleTest does not have the goal of testing networking - problems, it does include some methods to modify and debug - the requests it makes. - Here is another method list... - - - - - - - - - - - -
getTransportError()The last socket error
showRequest()Dump the outgoing request
showHeaders()Dump the incoming headers
showSource()Dump the raw HTML page content
ignoreFrames()Do not load framesets
setCookie($name, $value)Set a cookie from now on
addHeader($header)Always add this header to the request
setMaximumRedirects($max)Stop after this many redirects
setConnectionTimeout($timeout)Kill the connection after this time between bytes
useProxy($proxy, $name, $password)Make requests via this proxy URL
- These methods are principally for debugging. -

-
-
- - - Successfully fetching a web page - - - Testing the page content - - - Navigating a web site - while testing - - - Raw request modifications and debugging methods - - - - - SimpleTest project page on SourceForge. - - - SimpleTest download page on LastCraft. - - - The developer's API for SimpleTest - gives full detail on the classes and assertions available. - - - - - software development, - php programming for clients, - customer focused php, - software development tools, - acceptance testing framework, - free php scripts, - architecture, - php resources, - HTMLUnit, - JWebUnit, - php testing, - unit test resource, - web testing - - -
diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/writing_extensions.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/writing_extensions.xml deleted file mode 100644 index 6e34afc..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/en/writing_extensions.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - Writing an extension for SimpleTest - - -

- SimpleTest is coded to be flexible and extensible. - It means you can add your own assertions. - You can also add your own reporter or any other tool worth your fancy. - In fact there's a special directory inside SimpleTest SVN trunk devoted - to such kind of experimentations. -

-
-
-

- There's a growing list of available extensions: -

-
-
colortext_reporter
-
- provides an ANSI-colored {@link TextReporter} for viewing test results. -
-
dom_tester
-
- create a CSS Selector expectation. -
-
pear_test_case
-
- provides an adapter for PEAR PHPUnit test case to allow - legacy PEAR test cases to be used with SimpleTest. -
-
phpunit_test_case
-
- provides an adapter for sourceforge PHPUnit test case to allow - legacy test cases to be used with SimpleTest. -
-
recorder
-
- returns an array with timestamp, status, test name - and message for each pass and failure. -
-
selenese_tester
-
- integrates selenese html test suite support - (can be generated by selenium-IDE). -
-
selenium
-
- provides a bridge to a Selenium server. -
-
testdox
-
- ... -
-
treemap_reporter
-
- constructs and renders a treemap visualization of a test run. -
-
webunit_reporter
-
- ... -
-
-
-
-

- If you want to have your own extension accepted inside the SVN trunk, - juste make sure you follow these simple rules: -

    -
  1. - Main code goes into a file located at
    - /extensions/my_new_extension.php -
  2. -
  3. - If you need extra stuff (classes, sub-routines, js or css files), - make sure everything is located your own
    - /extensions/my_new_extension/* -
  4. -
  5. - And since your package is unit-tested, - your tests go into
    - /extensions/my_new_extension/test/*
    - or
    - /extensions/my_new_extension/* -
  6. -
  7. - Bonus : you can get your own test suite caught directly - from SimpleTest. There's dedicated test scanning recursively - the extensions' directories and running the test file matching - /test.php$/. - An easy way for us to check if everyone's extension carries - on working with the current code base... -
  8. -
- Also for general coding practices, you can have a look at the - coding standards and formatting. -

-
-
- - Existing extensions - Committing a new extension - - - - - - software development, - php programming, - programming php, - software development tools, - php tutorial, - free php scripts, - architecture, - php resources, - mock objects, - plugins, - extensions, - extension, - selenium, - selenese, - testdox, - treemap, - reporter - - -
diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/authentication_documentation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/authentication_documentation.xml deleted file mode 100644 index b3ef8d1..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/authentication_documentation.xml +++ /dev/null @@ -1,307 +0,0 @@ - - - - - Documentation Simple Test : tester l'authentification - - -

- Un des secteurs la fois dlicat et important lors d'un test - de site web reste la scurit. Tester ces schmas est au coeur - des objectifs du testeur web de SimpleTest. -

-
-
-

- Si vous allez chercher une page web protge - par une authentification basique, vous hriterez d'une entte 401. - Nous pouvons reprsenter ceci par ce test... - - function test401Header() { - $this->get('http://www.lastcraft.com/protected/'); - $this->showHeaders(); - } -} -]]> - Ce qui nous permet de voir les enttes reues... -

-

File test

-
-
1/1 test cases complete. - 0 passes, 0 fails and 0 exceptions.
-
- Sauf que nous voulons viter l'inspection visuelle, - on souhaite que SimpleTest puisse nous dire si oui ou non - la page est protge. Voici un test en profondeur sur nos enttes... -get('http://www.lastcraft.com/protected/'); - $this->assertAuthentication('Basic'); - $this->assertResponse(401); - $this->assertRealm('SimpleTest basic authentication'); - } -} -]]> - N'importe laquelle de ces assertions suffirait, - tout dpend de la masse de dtails que vous souhaitez voir. -

-

- La plupart du temps, nous ne souhaitons pas tester - l'authentification en elle-mme, mais plutt - les pages protges par cette authentification. - Ds que la tentative d'authentification est reue, - nous pouvons y rpondre l'aide d'une rponse d'authentification : -get('http://www.lastcraft.com/protected/'); - $this->authenticate('Me', 'Secret'); - $this->assertTitle(...); - } -} -]]> - Le nom d'utilisateur et le mot de passe seront dsormais - envoys chaque requte vers ce rpertoire - et ses sous-rpertoires. - En revanche vous devrez vous authentifier nouveau - si vous sortez de ce rpertoire mais SimpleTest est assez - intelligent pour fusionner les sous-rpertoires dans un mme domaine. -

-

- Vous pouvez gagner une ligne en dfinissant - l'authentification au niveau de l'URL... -get('http://Me:Secret@www.lastcraft.com/protected/'); - $this->assertTitle(...); - } -} -]]> - Si votre nom d'utilisateur ou mot de passe comporte - des caractres spciaux, alors n'oubliez pas de les encoder, - sinon la requte ne sera pas analyse correctement. - De plus cette entte ne sera pas envoye aux - sous requtes si vous la dfinissez avec une URL absolue. - Par contre si vous naviguez avec des URL relatives, - l'information d'authentification sera prserve. -

-

- Pour l'instant, seule l'authentification de base est implmente - et elle n'est rellement fiable qu'en tandem avec une connexion HTTPS. - C'est gnralement suffisant pour protger - le serveur test des regards malveillants. - Les authentifications Digest et NTLM pourraient tre ajoutes prochainement. -

-
-
-

- L'authentification de base ne donne pas assez de contrle - au dveloppeur Web sur l'interface utilisateur. - Il y a de forte chance pour que cette fonctionnalit - soit code directement dans l'architecture web - grand renfort de cookies et de timeouts compliqus. -

-

- Commenons par un simple formulaire de connexion... -


-    Username:
-    
- Password: -
- - -]]>
- Lequel doit ressembler ... -

-

-

- Username: -
- Password: -
- -
-

-

- Supposons que, durant le chargement de la page, - un cookie ait t inscrit avec un numro d'identifiant de session. - Nous n'allons pas encore remplir le formulaire, - juste tester que nous pistons bien l'utilisateur. - Voici le test... -get('http://www.my-site.com/login.php'); - $this->assertCookie('SID'); - } -} -]]> - Nous nous contentons ici de vrifier que le cookie a bien t dfini. - Etant donn que sa valeur est plutt nigmatique, - elle ne vaut pas la peine d'tre teste. -

-

- Le reste du test est le mme que dans n'importe quel autre formulaire, - mais nous pourrions souhaiter nous assurer - que le cookie n'a pas t modifi depuis la phase de connexion. - Voici comment cela pourrait tre test : -get('http://www.my-site.com/login.php'); - $session = $this->getCookie('SID'); - $this->setField('u', 'Me'); - $this->setField('p', 'Secret'); - $this->clickSubmit('Log in'); - $this->assertWantedPattern('/Welcome Me/'); - $this->assertCookie('SID', $session); - } -} -]]> - Ceci confirme que l'identifiant de session - est identique avant et aprs la connexion. -

-

- Nous pouvons mme essayer de duper notre propre systme - en crant un cookie arbitraire pour se connecter... -get('http://www.my-site.com/login.php'); - $this->setCookie('SID', 'Some other session'); - $this->get('http://www.my-site.com/restricted.php'); - $this->assertWantedPattern('/Access denied/'); - } -} -]]> - Votre site est-il protg contre ce type d'attaque ? -

-
-
-

- Si vous testez un systme d'authentification, - la reconnexion par un utilisateur est un point sensible. - Essayons de simuler ce qui se passe dans ce cas : -get('http://www.my-site.com/login.php'); - $this->setField('u', 'Me'); - $this->setField('p', 'Secret'); - $this->clickSubmit('Log in'); - $this->assertWantedPattern('/Welcome Me/'); - - $this->restart(); - $this->get('http://www.my-site.com/restricted.php'); - $this->assertWantedPattern('/Access denied/'); - } -} -]]> - La mthode WebTestCase::restart() prserve les cookies - dont le timeout a expir, mais conserve les cookies temporaires ou expirs. - Vous pouvez spcifier l'heure et la date de leur ractivation. -

-

- L'expiration des cookies peut tre un problme. - Si vous avez un cookie qui doit expirer au bout d'une heure, - nous n'allons pas mettre le test en veille en attendant - que le cookie expire... -

-

- Afin de provoquer leur expiration, - vous pouvez dater manuellement les cookies, - avant le dbut de la session. -get('http://www.my-site.com/login.php'); - $this->setField('u', 'Me'); - $this->setField('p', 'Secret'); - $this->clickSubmit('Log in'); - $this->assertWantedPattern('/Welcome Me/'); - - $this->ageCookies(3600); - $this->restart(); - $this->get('http://www.my-site.com/restricted.php'); - $this->assertWantedPattern('/Access denied/'); - } -} -]]> - Aprs le redmarrage, les cookies seront plus vieux - d'une heure et que tous ceux dont la date d'expiration - sera passe auront disparus. -

-
-
- - - Passer au travers d'une authentification HTTP basique - - - Tester l'authentification base sur des cookies - - - Grer les sessions du navigateur et les timeouts - - - - - La page du projet SimpleTest sur SourceForge. - - - La page de tlchargement de SimpleTest sur LastCraft. - - - L'API du dveloppeur pour SimpleTest donne tous les dtails sur les classes et les assertions disponibles. - - - - - dveloppement logiciel, - programmation php, - php orient client, - outils de dveloppement logiciel, - tutorial php, - scripts php gratuits, - architecture, - ressources php, - objets fantaise, - php testing, - php unit, - mthodologie, - dveloppement pilot par les tests, - outils tests html, - tester des web pages, - php objets fantaise, - naviguer automatiquement sur des sites web, - test automatis, - scripting web, - HTMLUnit, - JWebUnit, - phpunit, - php unit testing, - php web testing, - test unitaire de systme d'authentification, - authentification HTTP, - test de connexion, - test d'authentification, - test de scurit - - -
- diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/books_website.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/books_website.xml deleted file mode 100644 index 5e198fd..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/books_website.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - Livres avec / propos / pas loin de SimpleTest - -
-

- De temps en temsp, un livre est recommand sur la mailing-list, - vous le trouverez ci-dessous avec les commentaires originaux ! -

-

- Domain-Driven Design: Tackling Complexity in the Heart of Software -

-
- Le Dveloppement Pilot par les Tests est principalement intress par - les mcanismes pour coder, mais il dit que c'est fini quand il n'y plus - de duplication. Le Dveloppement Pilot par la Conception (DDD) considre - que le code est constamment in churn, changeant de terminologie au - fur et mesure que le domaine devient plus clair, et aussi nourrisant le domaine - avec des nouveaux termes quand le code volue..
-
- Et puis, c'est un super bouquin :) - [source] -
-
-
-

- Deux contributeurs de Simpletest ont crit des livres sur PHP. - Tous les deux ont de nombreux exemples avec le framework SimpleTest. -

-

- PHP|Architect's Guide to PHP Design Patterns -
- PHP|Architect's Guide to PHP Design Patterns
- par Jason E. Sweat
- (l'obtenir depuis : PHP|Architect | - Amazon ) -

-

- The PHP Anthology: Object Oriented PHP Solutions -
- The PHP Anthology: Object Oriented PHP Solutions
- par Harry Fuecks
- (l'obtenir depuis : SitePoint | - Amazon | - critique sur Slashdot ) -

-
-
-

- Une manire d'aider l'quipe de contributeurs, c'est d'acheter des livres via - cete page avec Amazon (avec le mot-cl simpletest-21). - Nous adorons tous lire des trucs la fois intressants et stimulants. -

-
-
- - - Latest recommandation - - - Books by contributors - - - Buying books - - - - - - - - - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/boundary_classes_tutorial.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/boundary_classes_tutorial.xml deleted file mode 100644 index bf26c71..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/boundary_classes_tutorial.xml +++ /dev/null @@ -1,410 +0,0 @@ - - - - - - Tutorial de tests unitaires PHP - Organiser les tests unitaires et les scnarios de test de classe frontire - - - -

- Vous pensez probablement que nous avons dsormais puis - les modifications sur la classe Log - et qu'il n'y a plus rien ajouter. - Sauf que les choses ne sont jamais simples avec la Programmation Orient Objet. - Vous pensez comprendre un problme et un nouveau cas arrive : - il dfie votre point de vue et vous conduit - vers une analyse encore plus profonde. - Je pensais comprendre la classe de log et - que seule la premire page du tutorial l'utiliserait. - Aprs a, je serais pass quelque chose de plus compliqu. - Personne n'est plus surpris que moi de ne pas l'avoir boucle. - En fait je pense que je viens peine - de me rendre compte de ce qu'un loggueur fait. -

-
-
-

- Supposons que nous ne voulons plus seulement enregistrer - les logs vers un fichier. Nous pourrions vouloir les afficher l'cran, - les envoyer au daemon syslog d'Unix(tm) via un socket. - Comment s'accommoder de tels changements ? -

-

- Le plus simple est de crer des sous-classes de Log - qui crasent la mthode message() avec les nouvelles versions. - Ce systme fonctionne bien court terme, sauf qu'il a quelque chose - de subtilement mais foncirement erron. Supposons que nous crions - ces sous-classes et que nous ayons des loggueurs crivant vers un fichier, - sur l'cran et via le rseau. Trois classes en tout : a fonctionne. - Maintenant supposons que nous voulons ajouter une nouvelle classe de log - qui ajoute un filtrage par priorit des messages, ne laissant passer - que les messages d'un certain type, le tout suivant un fichier de configuration. -

-

- Nous sommes coincs. Si nous crons de nouvelles sous-classes, - nous devons le faire pour l'ensemble des trois classes, - ce qui nous donnerait six classes. L'envergure de la duplication est horrible. -

-

- Alors, est-ce que vous tes en train de souhaiter que PHP ait - l'hritage multiple ? Effectivement, cela rduirait l'ampleur - de la tche court terme, mais aussi compliquerait quelque - chose qui devrait tre une classe trs simple. L'hritage multiple, - mme support, devrait tre utilis avec le plus grand soin car - toutes sortes d'enchevtrements peuvent en dcouler. - En fait ce soudain besoin nous dit quelque chose d'autre - - peut-tre que notre erreur si situe au niveau de la conception. -

-

- Qu'est-ce que doit faire un loggueur ? Est-ce qu'il envoie - un message vers un fichier ? A l'cran ? Via le rseau ? Non. - Il envoie un message, point final. La cible de ses messages - peut tre slectionne l'initialisation du log, - mais aprs a pas touche : le loggueur doit pouvoir combiner - et formater les lments du message puisque tel est son vritable boulot. - Prsumer que la cible fut un nom de fichier tait une belle paire d'oeillres. -

-
-
-

- La solution de cette mauvaise passe est un classique. - Tout d'abord nous encapsulons la variation de la classe : - cela ajoute un niveau d'indirection. Au lieu d'introduire - le nom du fichier comme une chane, nous l'introduisons comme - "cette chose vers laquelle on crit" et que - nous appelons un Writer. Retour aux tests... - - require_once('../classes/writer.php'); - Mock::generate('Clock'); - - class TestOfLogging extends UnitTestCase { - function TestOfLogging() { - $this->UnitTestCase('Log class test'); - } - function setUp() { - @unlink('../temp/test.log'); - } - function tearDown() { - @unlink('../temp/test.log'); - } - function getFileLine($filename, $index) { - $messages = file($filename); - return $messages[$index]; - } - function testCreatingNewFile() { - $log = new Log(new FileWriter('../temp/test.log')); - $this->assertFalse(file_exists('../temp/test.log'), 'Created before message'); - $log->message('Should write this to a file'); - $this->assertTrue(file_exists('../temp/test.log'), 'File created'); - } - function testAppendingToFile() { - $log = new Log(new FileWriter('../temp/test.log')); - $log->message('Test line 1'); - $this->assertWantedPattern( - '/Test line 1/', - $this->getFileLine('../temp/test.log', 0)); - $log->message('Test line 2'); - $this->assertWantedPattern( - '/Test line 2/', - $this->getFileLine('../temp/test.log', 1)); - } - function testTimestamps() { - $clock = &new MockClock($this); - $clock->setReturnValue('now', 'Timestamp'); - $log = new Log(new FileWriter('../temp/test.log')); - $log->message('Test line', &$clock); - $this->assertWantedPattern( - '/Timestamp/', - $this->getFileLine('../temp/test.log', 0), - 'Found timestamp'); - } - } -?> -]]> - Je vais parcourir ces tests pas pas pour ne pas ajouter - trop de confusion. J'ai remplac les noms de fichier par - une classe imaginaire FileWriter en provenance - d'un fichier classes/writer.php. - Par consquent les tests devraient planter - puisque nous n'avons pas encore crit ce scripteur. - Doit-on le faire maintenant ? -

-

- Nous pourrions, mais ce n'est pas oblig. - Par contre nous avons besoin de crer l'interface, - ou alors il ne sera pas possible de la simuler. - Au final classes/writer.php ressemble ... - -]]> - Nous avons aussi besoin de modifier la classe Log... - - require_once('../classes/writer.php'); - - class Log { - var $_writer; - - function Log(&$writer) { - $this->_writer = &$writer; - } - - function message($message, $clock = false) { - if (! is_object($clock)) { - $clock = new Clock(); - } - $this->_writer->write("[" . $clock->now() . "] $message"); - } - } -?> -]]> - Il n'y a pas grand chose qui n'ait pas chang y compris - dans la plus petite de nos classes. Dsormais les tests - s'excutent mais ne passent pas, moins que nous ajoutions - du code dans le scripteur. Alors que faisons nous ? -

-

- Nous pourrions commencer par crire des tests et - dvelopper la classe FileWriter paralllement, - mais lors de cette tape nos tests de Log - continueraient d'chouer et de nous distraire. - En fait nous n'en avons pas besoin. -

-

- Une partie de notre objectif est de librer la classe - du loggueur de l'emprise du systme de fichiers - et il existe un moyen d'y arriver. - Tout d'abord nous crons le fichier tests/writer_test.php - de manire avoir un endroit pour placer - notre code test en provenance de log_test.php - et que nous allons brasser. Sauf que je ne vais pas l'ajouter - dans le fichier all_tests.php pour l'instant - puisque qu'il s'agit de la partie de log que nous sommes en train d'aborder. -

-

- Nous enlevons tous les test de log_test.php - qui ne sont pas strictement en lien avec le journal - et nous les gardons bien prcieusement dans - writer_test.php pour plus tard. - Nous allons aussi simuler le scripteur pour qu'il n'crive pas - rellement dans un fichier... - - Mock::generate('FileWriter'); - - class TestOfLogging extends UnitTestCase { - function TestOfLogging() { - $this->UnitTestCase('Log class test'); - } - function testWriting() { - $clock = &new MockClock($this); - $clock->setReturnValue('now', 'Timestamp'); - $writer = &new MockFileWriter($this); - $writer->expectArguments('write', array('[Timestamp] Test line')); - $writer->expectCallCount('write', 1); - $log = &new Log($writer); - $log->message('Test line', &$clock); - $writer->tally(); - } - } -?> -]]> - Eh oui c'est tout : il s'agit bien de l'ensemble du scnario de test - et c'est normal qu'il soit aussi court. Pas mal de choses se sont passes... -

    -
  1. - La ncessit de crer le fichier uniquement - si ncessaire a t dplace vers le FileWriter. -
  2. -
  3. - tant donn que nous travaillons avec des objets fantaisie, - aucun fichier n'a t cr et donc setUp() - et tearDown() passent dans les tests du scripteur. -
  4. -
  5. - Dsormais le test consiste simplement dans l'envoi - d'un message type et du test de son format. -
  6. -
- Attendez un instant, o sont les assertions ? -

-

- Les objets fantaisie font beaucoup plus que se comporter - comme des objets, ils excutent aussi des test. - L'appel expectArguments() dit l'objet fantaisie - d'attendre un seul paramtre de la chane "[Timestamp] Test" - quand la mthode fantaise write() est appele. - Lorsque cette mthode est appele les paramtres attendus - sont compars avec ceci et un succs ou un chec est renvoy - comme rsultat au test unitaire. - C'est pourquoi un nouvel objet fantaisie a une rfrence - vers $this dans son constructeur, - il a besoin de ce $this pour l'envoi de son propre rsultat. -

-

- L'autre attente, c'est que le write ne soit appel - qu'une seule et unique fois. Juste l'initialiser ne serait pas suffisant. - L'objet fantaisie attendrait une ternit - si la mthode n'tait jamais appele - et par consquent n'enverrait jamais - le message d'erreur la fin du test. - Pour y faire face, l'appel tally() lui dit de vrifier - le nombre d'appel ce moment l. - Nous pouvons voir tout a en lanant les tests... -

-

All tests

- Pass: log_test.php->Log class test->testwriting->Arguments for [write] were [String: [Timestamp] Test line]
- Pass: log_test.php->Log class test->testwriting->Expected call count for [write] was [1], but got [1]
- - Pass: clock_test.php->Clock class test->testclockadvance->Advancement
- Pass: clock_test.php->Clock class test->testclocktellstime->Now is the right time
-
3/3 test cases complete. - 4 passes and 0 fails.
-
-

-

- En fait nous pouvons encore raccourcir nos tests. - L'attente de l'objet fantaisie expectOnce() - peut combiner les deux attentes spares. -setReturnValue('now', 'Timestamp'); - $writer = &new MockFileWriter($this); - $writer->expectOnce('write', array('[Timestamp] Test line')); - $log = &new Log($writer); - $log->message('Test line', &$clock); - $writer->tally(); -} -]]> - Cela peut tre une abrviation utile. -

-
-
-

- Quelque chose de trs agrable est arrive au loggueur - en plus de devenir purement et simplement plus court. -

-

- Les seules choses dont il dpend sont maintenant - des classes que nous avons crites nous-mme - et qui dans les tests sont simules : - donc aucune dpendance hormis notre propre code PHP. - Pas de fichier crire ni de dclenchement - via une horloge attendre. Cela veut dire que le scnario - de test log_test.php va s'excuter aussi vite - que le processeur le permet. - Par contraste les classes FileWriter et Clock - sont trs proches du systme. - Plus difficile tester puisque de vraies donnes - doivent tre dplaces et valides avec soin, - souvent par des astuces ad hoc. -

-

- Notre dernire factorisation a beaucoup aid. - Les classes aux frontires de l'application et du systme, - celles qui sont difficiles tester, sont dsormais plus courtes - tant donn que le code d'I/O a t loign - encore plus de la logique applicative. - Il existe des liens directs vers des oprations PHP : - FileWriter::write() s'apparente l'quivalent - PHP fwrite() avec le fichier ouvert pour l'ajout - et Clock::now() s'apparente lui aussi - un quivalent PHP time(). - Primo le dbogage devient plus simple. - Secundo ces classes devraient bouger moins souvent. -

-

- Si elles ne changent pas beaucoup alors il n'y a aucune raison - pour continuer en excuter les tests. - Cela veut dire que les tests pour les classes frontires - peuvent tre dplaces vers leur propre suite de tests, - laissant les autres tourner plein rgime. - En fait c'est comme a que j'ai tendance travailler - et les scnarios de test de SimpleTest - lui-mme sont diviss de cette manire. -

-

- Peut-tre que a ne vous parat pas beaucoup - avec un test unitaire et deux tests aux frontires, - mais une application typique peut contenir - vingt classes de frontire et deux cent classes d'application. - Pour continuer leur excution toute vitesse, - vous voudrez les tenir spares. -

-

- De plus, un bon dveloppement passe par des dcisions - de tri entre les composants utiliser. - Peut-tre, qui sait, tous ces simulacres pourront - amliorer votre conception. -

-
-
- - - - Variations sur un log - - - Abstraire un niveau supplmentaire via une classe - fantaisie d'un scripteur - - - Sparer les tests des classes frontires - pour un petit nettoyage - - - - - Ce tutorial suit l'introduction aux - objets fantaisies. - - - Ensuite vient la - conception pilote par les tests. - - - Vous aurez besoin du - framework de test SimpleTest pour essayer ces exemples. - - - - - dveloppement logiciel, - programmation php, - outils de dveloppement logiciel, - tutorial php, - scripts php gratuits, - organisation de tests unitaires, - conseil de test, - astuce de dveloppement, - architecture logicielle pour des tests, - exemple de code php, - objets fantaisie, - port de junit, - exemples de scnarios de test, - test php, - outil de test unitaire, - suite de test php - - -
- diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/browser_documentation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/browser_documentation.xml deleted file mode 100644 index db373eb..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/browser_documentation.xml +++ /dev/null @@ -1,259 +0,0 @@ - - - - - Documentation SimpleTest : le composant de navigation web scriptable - - -

- Le composant de navigation web de SimpleTest peut tre utilis - non seulement l'extrieur de la classe WebTestCase, - mais aussi indpendamment du framework SimpleTest lui-mme. -

-
-
-

- Vous pouvez utiliser le navigateur web dans des scripts PHP - pour confirmer que des services marchent bien comme il faut - ou pour extraire des informations partir de ceux-ci de faon rgulire. - Par exemple, voici un petit script pour extraire - le nombre de bogues ouverts dans PHP 5 partir - du site web PHP... -get('http://php.net/'); - $browser->clickLink('reporting bugs'); - $browser->clickLink('statistics'); - $browser->clickLink('PHP 5 bugs only'); - $page = $browser->getContent(); - preg_match('/status=Open.*?by=Any.*?(\d+)<\/a>/', $page, $matches); - print $matches[1]; -?> -]]> - Bien sr Il y a des mthodes plus simple pour raliser - cet exemple en PHP. Par exemple, vous pourriez juste - utiliser la commande PHP file() sur ce qui est - ici une page fixe. Cependant, en utilisant des scripts - avec le navigateur web vous vous autorisez l'authentification, - la gestion des cookies, le chargement automatique des fentres, - les redirections, la transmission de formulaires et la capacit - d'examiner les enttes. De telles mthodes sont fragiles dans - un site en constante volution et vous voudrez employer une mthode - plus directe pour accder aux donnes de faon permanente, - mais pour des tches simples cette technique peut s'avrer - une solution trs rapide. -

-

- Toutes les mthode de navigation utilises dans WebTestCase sont prsente dans la classe SimpleBrowser, mais les assertions sont remplaces par de simples accesseurs. Voici une liste complte des mthodes de navigation de page page... - - - - - - - - - - - - - - - - - - - - - - - -
addHeader($header)Ajouter une entte chaque tlchargement
useProxy($proxy, $username, $password)Utilise ce proxy partir de maintenant
head($url, $parameters)Effectue une requte HEAD
get($url, $parameters)Tlcharge une page avec un GET
post($url, $parameters)Tlcharge une page avec un POST
clickLink($label)Suit un lien par son tiquette
isLink($label)Vrifie l'existance d'un lien par son tiquette
clickLinkById($id)Suit un lien par son attribut d'identification
isLinkById($id)Vrifie l'existance d'un lien par son attribut d'identification
getUrl()La page ou la fentre URL en cours
getTitle()Le titre de la page
getContent()Le page ou la fentre brute
getContentAsText()Sans code HTML l'exception du text "alt"
retry()Rpte la dernire requte
back()Utilise le bouton "prcdent" du navigateur
forward()Utilise le bouton "suivant" du navigateur
authenticate($username, $password)Retente la page ou la fentre aprs une rponse 401
restart($date)Relance le navigateur pour une nouvelle session
ageCookies($interval)Change la date des cookies
setCookie($name, $value)Lance un nouveau cookie
getCookieValue($host, $path, $name)Lit le cookie le plus spcifique
getCurrentCookieValue($name)Lit le contenue du cookie en cours
- Les mthode SimpleBrowser::useProxy() et - SimpleBrowser::addHeader() sont spciales. - Une fois appeles, elles continuent s'appliquer sur les tlchargements suivants. -

-

- Naviguer dans les formulaires est similaire la navigation des formulaires via WebTestCase... - - - - - - - - - - - - -
setField($name, $value)Modifie tous les champs avec ce nom
setFieldById($id, $value)Modifie tous les champs avec cet identifiant
getField($name)Accesseur de la valeur d'un lment de formulaire
getFieldById($id)Accesseur de la valeur de l'lment de formulaire avec cet identifiant
clickSubmit($label)Transmet le formulaire avec l'tiquette de son bouton
clickSubmitByName($name)Transmet le formulaire avec l'attribut de son bouton
clickSubmitById($id)Transmet le formulaire avec l'identifiant de son bouton
clickImage($label, $x, $y)Clique sur une balise input de type image par son titre (title="*") our son texte alternatif (alt="*")
clickImageByName($name, $x, $y)Clique sur une balise input de type image par son attribut (name="*")
clickImageById($id, $x, $y)Clique sur une balise input de type image par son identifiant (id="*")
submitFormById($id)Transmet le formulaire par son identifiant propre
- Au jourd d'aujourd'hui il n'existe aucune mthode pour lister - les formulaires et les champs disponibles : ce sera probablement - ajout dans des versions successives de SimpleTest. -

-

- A l'intrieur d'une page, les fentres individuelles peuvent tre - slectionnes. Si aucune slection n'est ralise alors - toutes les fentres sont fusionnes ensemble dans - une unique et grande page. - Le contenu de la page en cours sera une concatnation des - toutes les fentres dans l'ordre spcifi par les balises "frameset". - - - - - - -
getFrames()Un dchargement de la structure de la fentre courante
getFrameFocus()L'index ou l'tiquette de la fentre en courante
setFrameFocusByIndex($choice)Slectionne la fentre numrote partir de 1
setFrameFocus($name)Slectionne une fentre par son tiquette
clearFrameFocus()Traite toutes les fentres comme une seule page
- Lorsqu'on est focalis sur une fentre unique, - le contenu viendra de celle-ci uniquement. - Cela comprend les liens cliquer et les formulaires transmettre. -

-
-
-

- Toute cette masse de fonctionnalits est gniale - lorsqu'on arrive bien tlcharger les pages, - mais ce n'est pas toujours vident. - Pour aider dcouvrir les erreurs, le navigateur a aussi - des mthodes pour aider au dbogage. - - - - - - - - - - - - - -
setConnectionTimeout($timeout)Ferme la socket avec un dlai trop long
getRequest()L'entte de la requte brute de la page ou de la fentre
getHeaders()L'entte de rponse de la page ou de la fentre
getTransportError()N'importe quel erreur au niveau de la socket dans le dernier tlchargement
getResponseCode()La rponse HTTP de la page ou de la fentre
getMimeType()Le type Mime de la page our de la fentre
getAuthentication()Le type d'authentification dans l'entte d'une provocation 401
getRealm()Le realm d'authentification dans l'entte d'une provocation 401
setMaximumRedirects($max)Nombre de redirections avant que la page ne soit charge automatiquement
setMaximumNestedFrames($max)Protection contre des framesets rcursifs
ignoreFrames()Neutralise le support des fentres
useFrames()Autorise le support des fentres
- Les mthodes SimpleBrowser::setConnectionTimeout(), - SimpleBrowser::setMaximumRedirects(), - SimpleBrowser::setMaximumNestedFrames(), - SimpleBrowser::ignoreFrames() - et SimpleBrowser::useFrames() continuent s'appliquer - sur toutes les requtes suivantes. - Les autres mthodes tiennent compte des fentres. - Cela veut dire que si une fentre individuelle ne se charge pas, - il suffit de se diriger vers elle avec - SimpleBrowser::setFrameFocus() : ensuite on utilisera - SimpleBrowser::getRequest(), etc. pour voir ce qui se passe. -

-
-
-

- Tout ce qui peut tre fait dans - WebTestCase peut maintenant - tre fait dans un UnitTestCase. - Ce qui revient dire que nous pouvons librement mlanger - des tests sur des objets de domaine avec l'interface web... - -class TestOfRegistration extends UnitTestCase { - function testNewUserAddedToAuthenticator() { - $browser = &new SimpleBrowser(); - $browser->get('http://my-site.com/register.php'); - $browser->setField('email', 'me@here'); - $browser->setField('password', 'Secret'); - $browser->clickSubmit('Register'); - - $authenticator = &new Authenticator(); - $member = &$authenticator->findByEmail('me@here'); - $this->assertEqual($member->getPassword(), 'Secret'); - } -} -]]> - Bien que a puisse tre utile par convenance temporaire, - je ne suis pas fan de ce genre de test. Ce test s'applique - plusieurs couches de l'application, a implique qu'il est - plus que probable qu'il faudra le remanier lorsque le code changera. -

-

- Un cas plus utile d'utilisation directe du navigateur est - le moment o le WebTestCase ne peut plus suivre. - Un exemple ? Quand deux navigateurs doivent tre utiliss en mme temps. -

-

- Par exemple, supposons que nous voulions interdire - des usages simultans d'un site avec le mme login d'identification. - Ce scnario de test le vrifie... -get('http://my-site.com/login.php'); - $first->setField('name', 'Me'); - $first->setField('password', 'Secret'); - $first->clickSubmit('Enter'); - $this->assertEqual($first->getTitle(), 'Welcome'); - - $second = &new SimpleBrowser(); - $second->get('http://my-site.com/login.php'); - $second->setField('name', 'Me'); - $second->setField('password', 'Secret'); - $second->clickSubmit('Enter'); - $this->assertEqual($second->getTitle(), 'Access Denied'); - } -} -]]> - Vous pouvez aussi utiliser la classe SimpleBrowser - quand vous souhaitez crire des scnarios de test en utilisant - un autre outil que SimpleTest. -

-
-
- - - Utiliser le navigateur web dans des scripts - - - Dboguer les erreurs sur les pages - - - Tests complexes avec des navigateurs web multiples - - - - - La page du projet SimpleTest sur - SourceForge. - - - La page de tlchargement de SimpleTest sur - LastCraft. - - - L'API de dveloppeur pour SimpleTest - donne tous les dtails sur les classes et les assertions disponibles. - - - - - dveloppement logiciel, - programmation php pour des clients, - php centr autour du client, - outils de dveloppement logiciel, - framework de test de recette, - scripts php gratuits, - test unitaire de systmes d'authentification, - ressources php, - HTMLUnit, - JWebUnit, - test php, - ressource de test unitaire, - test web, - authentification HTTP, - tester la connection, - tester l'authentification, - tests de scurit - - -
- diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/display_subclass_tutorial.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/display_subclass_tutorial.xml deleted file mode 100644 index 7157637..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/display_subclass_tutorial.xml +++ /dev/null @@ -1,282 +0,0 @@ - - - - - Tutorial de test unitaire en PHP - Sous-classer l'affichage du test - - -

- Le composant affichage de SimpleTest est en fait - la dernire partie dvelopper. - Des morceaux de la section suivante changeront prochainement - et -- avec optimisme -- des composants d'affichage - plus sophistiqus seront crits, mais pour l'instant - si un affichage minime n'est pas suffisant, - voici comment raliser le votre. -

-
-
-

- Bon d'accord, voici comment. -

-

- Nous devons crer une sous-classe de l'affichage utilise, - dans notre cas il s'agit de HtmlReporter. - La classe HtmlReporter est situ dans le fichier - simpletest/reporter.php : - pour l'instant elle a l'interface suivante... - - Voici ce que les mthodes pertinentes veulent dire. - Vous pouvez consulter la - liste complte ici - si cela vous intresse. -

    -
  • - HtmlReporter()
    - est le constructeur. Notez qu'un test unitaire initie - le lien vers l'affichage plutt que l'inverse. - L'affichage est un rceptacle passif des vnements de test. - Cela permet une adaptation facile de l'affichage - pour d'autres systmes de test en dehors - des tests unitaires comme la surveillance - de serveurs par exemple. - Autre avantage, un test unitaire peut crire - vers plus d'un affichage la fois. -
  • -
  • - void paintFail(string $message)
    - peint un chec. Voir ci-dessous. -
  • -
  • - void paintPass(string \$message)
    - ne fait rien par dfaut. C'est cette mthode - que nous allons modifier. -
  • -
  • - string getCss()
    - renvoie le style CSS - via une chane - pour - la mthode d'entte de la page. - Des styles complmentaires peuvent tre ajouts ici. -
  • -
  • - array getTestList()
    - est une mthode commode pour des sous-classes. - Elle liste l'embotement courant des tests - via une liste de noms de test. - Le premier, le test embot le plus profondment, - est le premier dans la liste et la mthode - du test courant sera la dernire. -
  • -
-

-

- Pour afficher les succs nous avons juste - besoin que la mthode paintPass() - se comporte comme paintFail(). - Bien sr nous n'allons pas modifier l'original. - Nous allons juste crer une sous-classe. -

-
-
-

- Premirement nous allons crer un fichier - tests/show_passes.php dans notre projet de log - et y placer cette classe vide... -HtmlReporter(); - } - } -?> -]]> - Une rapide mais attentive lecture du - code de SimpleTest - indique que l'implmentation de paintFail() ressemble ... -Fail: "; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - print implode("->", $breadcrumb); - print "->$message
\n"; -} -]]>
- Essentiellement elle s'enchane la version du parent, - que nous devons aussi raliser pour garantir le mnage, - et ensuite imprime une trace calcule partir de la liste - des tests courants. Par contre elle perd au passage - le nom du test du premier niveau. - Etant donn qu'il est identique pour chaque test, - ce serait un peu trop d'informations. - En la transposant dans notre nouvelle classe... -HtmlReporter(); - } - - function paintPass($message) { - parent::paintPass($message); - print "Pass: "; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - print implode("->", $breadcrumb); - print "->$message
\n"; - }
-} -]]>
- Pour l'instant tout roule. - Maintenant pour utiliser notre nouvelle classe, - nous allons modifier notre fichier tests/all_tests.php... - - require_once('show_passes.php'); - - $test = &new GroupTest('All tests'); - $test->addTestFile('log_test.php'); - $test->addTestFile('clock_test.php'); - $test->run(new ShowPasses()); -?> -]]> - Nous pouvons le lancer pour voir le rsultat de notre bricolage... -

-

All tests

- Pass: log_test.php->Log class test->testappendingtofile->Expecting [/Test line 1/] in [Test line 1]
- Pass: log_test.php->Log class test->testappendingtofile->Expecting [/Test line 2/] in [Test line 2]
- Pass: log_test.php->Log class test->testcreatingnewfile->Created before message
- Pass: log_test.php->Log class test->testcreatingnewfile->File created
- Pass: clock_test.php->Clock class test->testclockadvance->Advancement
- Pass: clock_test.php->Clock class test->testclocktellstime->Now is the right time
-
3/3 test cases complete. - 6 passes and 0 fails.
-
- Joli, mais pas encore digne d'une mdaille d'or. - Nous avons perdu un peu d'information au passage. - L'affichage du span.pass n'est pas styl en CSS, - mais nous pouvons l'ajouter en modifiant une autre mthode... -HtmlReporter(); - } - - function paintPass($message) { - parent::paintPass($message); - print "Pass: "; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - print implode("->", $breadcrumb); - print "->$message
\n"; - } - - protected function getCss() { - return parent::getCss() . ' .pass { color: green; }'; - } -} -]]>
- Si vous ajoutez le code au fur et mesure, - vous verrez l'ajout du style dans le code source - du rsultat via le navigateur. A l'oeil, - l'affichage devrait ressembler ... -
-

All tests

- Pass: log_test.php->Log class test->testappendingtofile->Expecting [/Test line 1/] in [Test line 1]
- Pass: log_test.php->Log class test->testappendingtofile->Expecting [/Test line 2/] in [Test line 2]
- Pass: log_test.php->Log class test->testcreatingnewfile->Created before message
- Pass: log_test.php->Log class test->testcreatingnewfile->File created
- Pass: clock_test.php->Clock class test->testclockadvance->Advancement
- Pass: clock_test.php->Clock class test->testclocktellstime->Now is the right time
-
3/3 test cases complete. - 6 passes and 0 fails.
-
- Certains prfrent voir les succs quand ils travaillent sur le code; - le sentiment de travail achev est sympathique aprs tout. - Une fois que vous commencez naviguer - de haut en bas pour trouver les erreurs, assez vite - vous en comprendrez le ct obscur. -

-

- Essayez les deux mthodes pour dterminer votre prfrence. - Nous allons le laisser tel que pour l'tape qui approche : - les objets fantaisie. - Il s'agit du premier outil de test qui ajoute des tests additionnels : - il sera utile de voir ce qui se passe dans les coulisses. -

-
-
- - - Comment changer l'affichage pour afficher - les passages avec succs. - - - Sous classer - la classe HtmlReporter. - - - - - La section prcdente : - sous-classer les scnarios de test - - - Cette section est trs spcifique - SimpleTest. - Si vous utilisez un autre outil, - n'hsitez pas sauter pardessus. - - - - - dveloppement logiciel pilot par les tests, - conseil pour programmer en php, - programmation php, - outils de dveloppement logiciel, - tutorial php, - scripts php gratuits, - architecture, - exemple de scnario de test, - framework de tests unitaires, - ressources php, - exemple de code php, - junit, - phpunit, - simpletest, - test php, - outil de test unitaire, - suite de test php - - -
- diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/download_website.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/download_website.xml deleted file mode 100644 index b64af48..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/download_website.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - Télécharger SimpleTest - -
-

- La version courante est : - - SimpleTest v1.0.1. -

-

- Vous pouvez télécharger cette version depuis - - SourceForget.net - et votre miroir le plus proche. Vous pouvez aussi jeter un oeil du côté - du changelog actuel. -

-

- Au fait, ne soyez pas effrayé par le mot beta : - pas mal d'utilisateurs vont même jusqu'à utiliser la version SVN. -

-
-
-

- Si Eclipse est votre IDE / éditeur de prédilection, vous aurez - peut-être envie d'utiliser le - - plugin Eclipse. -

-

- Pour utilser les procédures automatiques, l'URL est : -

http://simpletest.org/eclipse/
-

-
-
-

- SimpleTest a été packagé par la communauté avec d'autres parfums encore. -

- -

- Attention : certains paquets ne sont pas toujours très à jour. -

-
-
-

- Le code source est hébergé par SourceForge : vous pouvez l'étudier / le butiner - via le - dépôt SVN. -

-
-
- -
-
- - - Version courante - - - Paquet Eclipse - - - Autres paquets - - - Source - - - Autres versions stables - - - - - - - - - SimpleTest, - download, - source code, - stable release, - eclipse release, - eclipse plugin, - debian package, - drupal module, - pear channel, - pearified package - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/expectation_documentation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/expectation_documentation.xml deleted file mode 100644 index c9acdc6..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/expectation_documentation.xml +++ /dev/null @@ -1,308 +0,0 @@ - - - - - Documentation SimpleTest : tendre le testeur unitaire avec des classes d'attentes supplmentaires - -
-

- Le comportement par dfaut des - objets fantaisie dans - SimpleTest - est soit une correspondance identique sur l'argument, - soit l'acceptation de n'importe quel argument. - Pour la plupart des tests, c'est suffisant. - Cependant il est parfois ncessaire de ramollir un scnario de test. -

-

- Un des endroits o un test peut tre trop serr - est la reconnaissance textuelle. Prenons l'exemple - d'un composant qui produirait un message d'erreur - utile lorsque quelque chose plante. Il serait utile de tester - que l'erreur correcte est renvoye, - mais le texte proprement dit risque d'tre plutt long. - Si vous testez le texte dans son ensemble alors - chaque modification de ce mme message - -- mme un point ou une virgule -- vous aurez - revenir sur la suite de test pour la modifier. -

-

- Voici un cas concret, nous avons un service d'actualits - qui a chou dans sa tentative de connexion sa source distante. -class NewsService { - ... - function publish(&$writer) { - if (! $this->isConnected()) { - $writer->write('Cannot connect to news service "' . - $this->_name . '" at this time. ' . - 'Please try again later.'); - } - ... - } -} -]]> - L il envoie son contenu vers un classe Writer. - Nous pourrions tester ce comportement avec un MockWriter... - - $writer = &new MockWriter($this); - $writer->expectOnce('write', array( - 'Cannot connect to news service ' . - '"BBC News" at this time. ' . - 'Please try again later.')); - - $service = &new NewsService('BBC News'); - $service->publish($writer); - - $writer->tally(); - } -} -]]> - C'est un bon exemple d'un test fragile. - Si nous dcidons d'ajouter des instructions complmentaires, - par exemple proposer une source d'actualits alternative, - nous casserons nos tests par la mme occasion sans pourtant - avoir modifi une seule fonctionnalit. -

-

- Pour contourner ce problme, nous voudrions utiliser - un test avec une expression rationnelle plutt - qu'une correspondance exacte. Nous pouvons y parvenir avec... - - $writer->expectOnce( - 'write', - array(new WantedPatternExpectation('/cannot connect/i'))); - - $service = &new NewsService('BBC News'); - $service->publish($writer); - - $writer->tally(); - } -} -]]> - Plutt que de transmettre le paramtre attendu au MockWriter, - nous envoyons une classe d'attente appele WantedPatternExpectation. - L'objet fantaisie est suffisamment lgant pour reconnatre - qu'il s'agit d'un truc spcial et pour le traiter diffremment. - Plutt que de comparer l'argument entrant cet objet, - il utilise l'objet attente lui-mme pour excuter le test. -

-

- WantedPatternExpectation utilise - l'expression rationnelle pour la comparaison avec son constructeur. - A chaque fois qu'une comparaison est fait travers - MockWriter par rapport cette classe attente, - elle fera un preg_match() avec ce motif. - Dans notre scnario de test ci-dessus, aussi longtemps - que la chane "cannot connect" apparat dans le texte, - la fantaisie transmettra un succs au testeur unitaire. - Peu importe le reste du texte. -

-

- Les classes attente possibles sont... - - - - - - - - - - -
EqualExpectationUne galit, plutt que la plus forte comparaison l'identique
NotEqualExpectationUne comparaison sur la non-galit
IndenticalExpectationLa vrification par dfaut de l'objet fantaisie qui doit correspondre exactement
NotIndenticalExpectationInverse la logique de l'objet fantaisie
WantedPatternExpectationUtilise une expression rationnelle Perl pour comparer une chane
NoUnwantedPatternExpectationPasse seulement si l'expression rationnelle Perl choue
IsAExpectationVrifie le type ou le nom de la classe uniquement
NotAExpectationL'oppos de IsAExpectation
MethodExistsExpectationVrifie si la mthode est disponible sur un objet
- La plupart utilisent la valeur attendue dans le constructeur. - Les exceptions sont les vrifications sur motif, - qui utilisent une expression rationnelle, ainsi que - IsAExpectation et NotAExpectation, - qui prennent un type ou un nom de classe comme chane. -

-
-
-

- Les classes attente peuvent servir autre chose - que l'envoi d'assertions depuis les objets fantaisie, - afin de choisir le comportement d'un - objet fantaisie - ou celui d'un bouchon serveur. - A chaque fois qu'une liste d'arguments est donne, - une liste d'objets d'attente peut tre insre la place. -

-

- Mettons que nous voulons qu'un bouchon serveur - d'autorisation simule une connexion russie seulement - si il reoit un objet de session valide. - Nous pouvons y arriver avec ce qui suit... - -$authorisation = new StubAuthorisation(); -$authorisation->setReturnValue( - 'isAllowed', - true, - array(new IsAExpectation('Session', 'Must be a session'))); -$authorisation->setReturnValue('isAllowed', false); -]]> - Le comportement par dfaut du bouchon serveur - est dfini pour renvoyer false - quand isAllowed est appel. - Lorsque nous appelons cette mthode avec un unique paramtre - qui est un objet Session, il renverra true. - Nous avons aussi ajout un deuxime paramtre comme message. - Il sera affich dans le message d'erreur de l'objet fantaisie - si l'attente est la cause de l'chec. -

-

- Ce niveau de sophistication est rarement utile : - il n'est inclut que pour tre complet. -

-
-
-

- Les classes d'attentes ont une structure trs simple. - Tellement simple qu'il devient trs simple de crer - vos propres version de logique pour des tests utiliss couramment. -

-

- Par exemple voici la cration d'une classe pour tester - la validit d'adresses IP. Pour fonctionner correctement - avec les bouchons serveurs et les objets fantaisie, - cette nouvelle classe d'attente devrait tendre - SimpleExpectation... -class ValidIp extends SimpleExpectation { - - function test($ip) { - return (ip2long($ip) != -1); - } - - function testMessage($ip) { - return "Address [$ip] should be a valid IP address"; - } -} -]]> - Il n'y a vritablement que deux mthodes mettre en place. - La mthode test() devrait renvoyer un true - si l'attente doit passer, et une erreur false - dans le cas contraire. La mthode testMessage() - ne devrait renvoyer que du texte utile la comprhension du test en lui-mme. -

-

- Cette classe peut dsormais tre employe la place - des classes d'attente prcdentes. -

-
-
-

- Le framework - de test unitaire SimpleTest utilise aussi dans son coeur - des classes d'attente pour - la classe UnitTestCase. - Nous pouvons aussi tirer parti de ces mcanismes pour rutiliser - nos propres classes attente l'intrieur mme des suites de test. -

-

- La mthode la plus directe est d'utiliser la mthode - SimpleTest::assertExpectation() pour effectuer le test... -class TestOfNetworking extends UnitTestCase { - ... - function testGetValidIp() { - $server = &new Server(); - $this->assertExpectation( - new ValidIp(), - $server->getIp(), - 'Server IP address->%s'); - } -} -]]> - C'est plutt sale par rapport notre syntaxe habituelle - du type assert...(). -

-

- Pour un cas aussi simple, nous crons d'ordinaire une mthode - d'assertion distincte en utilisant la classe d'attente. - Supposons un instant que notre attente soit un peu plus - complique et que par consquent nous souhaitions la rutiliser, - nous obtenons... - - function assertValidIp($ip, $message = '%s') { - $this->assertExpectation(new ValidIp(), $ip, $message); - } - - function testGetValidIp() { - $server = &new Server(); - $this->assertValidIp( - $server->getIp(), - 'Server IP address->%s'); - } -} -]]> - Il est peu probable que nous ayons besoin - de ce niveau de contrle sur la machinerie de test. - Il est assez rare que le besoin d'une attente dpasse - le stade de la reconnaissance d'un motif. - De plus, les classes d'attente complexes peuvent rendre - les tests difficiles lire et dboguer. - Ces mcanismes sont vritablement l pour les auteurs - de systme qui tendront le framework de test - pour leurs propres outils de test. -

-
-
- - - Utiliser les attentes pour des tests - plus prcis avec des objets fantaisie - - - Changer le comportement d'un objet fantaisie - avec des attentes - - - Crer des attentes - - - Par dessous SimpleTest utilise des classes d'attente - - - - - La page du projet SimpleTest sur - SourceForge. - - - La page de tlchargement de SimpleTest sur - LastCraft. - - - Les attentes imitent les contraintes dans - JMock. - - - L'API complte pour SimpleTest - ralis avec PHPDoc. - - - - - objets fantaisie, - dveloppement pilot par les tests, - hritage des attentes, - contraintes d'objet fantaisie, - test unitaire avanc en PHP, - test en premier, - architecture de framework de test - - -
- diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/extension_eclipse.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/extension_eclipse.xml deleted file mode 100644 index ab9a5d0..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/extension_eclipse.xml +++ /dev/null @@ -1,292 +0,0 @@ - - - - - Documentation du plugin Eclipse pour Simpletest - -
-
    -
  • - Système d'exploitation - OS
    - Ce plugin devrait fonctionner sur toutes les plateformes qui font tourner Eclipse. - Il a été testé spécifiquement sur Linux, OS X et Windows. - Si le plugin ne marche pas sur l'une des ces plateformes, c'est qu'une nouvelle - incompatiblité est apparue : chose rare à priori. -
  • -
  • - Eclipse
    - Le plugin a été pensé et développé pour fonctionner avec les versions 3.1.X+ and 3.2.X+ d'Eclipse. - Eclipse en général nécessite une version 1.4.x ou supérieur de la JVM : - il n'y a pas d'autres pré-requis pour le plugin. -
  • -
  • - PHP
    - Le plugin a été testé pour fonctionner avec PHP 4.3.x+ (y compris PHP 5.1.x.). -
  • -
  • - Xdebug
    - Le plugin peut-être configuré pour fonctionnver avec Xdebug (version 2.0.0RC1 ou suivante). - Le fichier php.ini utilisé par le plugin (voir ci-dessous pour définir ce fichier) doit charger l'extension Xdebug. - Généralement on y arrive en ajoutant zend_extension_ts="Some Windows Path" ou zend_extension="Some Linux Path" - au fichier php.ini. - Des instructions spécifiques peuvent être trouvées à l'adresse : - http://xdebug.org/install.php - Pas la peine de se tracasser à propos des autres paramètres, le plugin se chargera d'initialiser - les paramètres nécessaires au besoin. -
  • -
  • - Simpletest
    - Le plugin est prévu pour tourner avec une version spécifique de SimpleTest. - Et même plus : il inclut la version associée de SimpleTest compatible. - Un plugin avec comme numéro de version 1.0.0_0.0.4 indiquerait que les plugin est compatible - avec la version 1.0.0 de SimpleTest and qu'il s'agit de la version 0.0.4 du plugin. - De légères modifications sont nécessaires sur le code de SimpleTest même pour - que le plugin fonctionne bien; ces modifications peuvent (ou pas) être comprise dans - la version de SimpleTest sans plugin. -
  • -
  • - PHPUnit2
    - A partir du plugin version 0.1.6 un support expérimental de la version CVS de PHPUnit2 - est disponible. Pour utiliser PHPUnit2, Choisisser un chemin vers PHPUnit2 et sélectionnez - les tests PHPUnit2 en lieu et place de SimpleTest. - Note: il s'agit du chemin vers le dossier qui contient le dosser PHPUnit2. PHPUnit 3 - n'est pas supporté mais devrait l'être plus tard. -
  • -
-
-
-
    -
  1. Télécharger et installer Eclipse (www.eclipse.org) – si vous n'êtes pas sûr quoi télécharger, prenez le SDK 3.1.0 d'Eclipse.
  2. -
  3. Télécharger le dernier fichier ZIP du plugin Eclipse pour SimpleTest (Simpletest Sourceforge)
  4. -
  5. Extgraire le contenu du fichier ZIP vers un répertoire temporaire {cette documentation y fera référence par $unzip}
  6. -
  7. Lancer Eclipse
  8. -
  9. Ouvrir "Install Wizard" en cliquant sur "Help > Software Updates > Find and Install" depuis la barre du menu.
  10. -
  11. Choisisser le deuxième bouton, "Search for new features to install" et cliquer sur "Next".
  12. -
  13. Cliquer sur le bouton du côté droit, "New Local Site".
  14. -
  15. Sélectionner le répertoire $unzip {le répertoire qui a servi pour l'extraction}.
  16. -
  17. Cliquer sur le bouton "OK".
  18. -
  19. Dans la fenêtre "Edit Local Site", cliquer sulick the "OK" button
  20. -
  21. Cliquer sur le bouton "Finish"
  22. -
  23. Dans la fenêtre "Search Results", chercher puis sélectionner "Simpletest plug-in 0.0.x"
  24. -
  25. Cliquer sur le bouton "Next"
  26. -
  27. Lire la licence et l'accepter en cliquant le bouton radio "I accept the terms in the license agreement" puis cliquer sur le bouton "Next"
  28. -
  29. Dans la fenêtre "Installation", vous pouvez changer le lieu d'installation -- la plupart des utilisateurs appuyeront juste sur le bouton "Finish"
  30. -
  31. Dans la fenêtre "Feature Verification", cliquer sur le bouton "Install"
  32. -
  33. Relancer Eclipse comme demandé
  34. -
  35. -

    Après avoir lancé Eclipse pour la première fois après l'installation, - vous aurez besoin de configurer le plugin SimpleTest. Pour y arriver : -

    -
      -
    1. - Sélectionner "Window > Preferences" dans la barre de menu -
    2. -
    3. - Sélectionner "Simpletest" dans les catégories sur la gauche de la boîte de dialogue. -
    4. -
    5. - Remplir ou choisir le répertoire contenant l'éxécutable PHP à utliser. -
    6. -
    7. - Laisser vierge le champ avec le fichier à inclure. -
    8. -
    9. - Remplir .php comme "Test File Suffix". - Bien sûr si vous utilisez ue autre extension pour vos fichiers de tests en PHP - (par exemple mon-test.tst.php) n'hésitez pas à remplir le champ avec ce qui va bien (dans notre exemple .tst.php). - Le plugin s'en sert pour trouver des tests à éxécuter. -
    10. -
    11. - Appuer sur le bouton "Ok" pour fermer la fenêtre des préférences. -
    12. -
    -
  36. -
-
-
- Note: cette procédure ne fonctionnera que si vous avez installé le plugin via - le "installation wizard". Si vous n'aviez fait que copier des répertoires pour l'installation, - il est recommandé de fermer Eclipse, de supprimer les anciennes version et de suivre les instructions - d'installation ci-dessus (vous ne devriez pas avoir à refaire la configuration initiale). -
    -
  1. Sélectionner "Help > Software Updates > Manage Configuration" dans le menu
  2. -
  3. Trouver le plugin Simpletest dans la liste et le choisir
  4. -
  5. Dans la section de droite, cliquer sur le lien "Scan for Updates"
  6. -
  7. Si aucune mise à jour n'est détectée, naviguer vers "Window > Preferences > Install/Update > Valid Updates" dans les préférences d'Eclipse - et sélectionner "compatible", en lieu et place de "equivalent". Puis recommencer les étapes ci-dessus.
  8. -
  9. Sélectionner les versions à mettre à jour et cliquer sur "Next".
  10. -
  11. Relire les licences pour ces mises à jour : si elles sont acceptables, cocher "I accept the terms in the license agreements." - Si les termes de la licence ne vous paraissent pas acceptables, il est encore temps d'arrêter le téléchargement.
  12. -
  13. Cliquer sur "Install" pour permettre le téléchargement est l'installation.
  14. -
  15. Une fois que toutes les fonctionnalités et plugins ont été téléchargés avec succès - et que leurs fihciers ont été installés sur l'ordinateur local, - une nouvelle configuration qui incorpore les nouvelles fonctionnalités et nouveaux plugins sera créée. - Cliquer sur "Yes" quand on vous demander de quitter et relancher le "Workbench" pour les changements prennent effet.
  16. -
-
-
- Note: ceci ne fonctionnera que si le plugin a été installé via la méthode "Feature Update". - Si l'installation a été effectué par une autre méthode alors le plugin peut être supprimé en effaçant - les répertoires qui avaient été ajoutés. -
    -
  1. Sélectionner "Help > Software Updates > Manage Configuration"
  2. -
  3. Choisir le plugin Simpletest dans la liste
  4. -
  5. Cliquer-droit sur le plugin Simpletest et sélectionner l'option "Disable"
  6. -
  7. Accepter le redémarrage d'Eclipse
  8. -
  9. Une fois Eclipse redémarré, sélectionner "Help > Software Updates > Manage Configuration" depuis le menu
  10. -
  11. Sélectionner l'option "Show Disabled Features" dans la barre d'outils
  12. -
  13. Choisir le plugin SimpleTest dans la liste
  14. -
  15. Cliquer-droit sur le plugin SimpleTest et sélectionner l'option "Uninstall"
  16. -
  17. Accepter le redémarrage d'Eclipse
  18. -
-
-
-

- La suite présente quelques exemples d'utilsation du plugin. -

-
    -
  1. Créer une nouveau projet de test (un lieu pour grouper des fichiers similaires) -
      -
    1. Sélectionner "File > New > Project.." dans le menu
    2. -
    3. Agrandir le répertoire "General" et choisir "Project"
    4. -
    5. Cliquer sur le bouton "Next"
    6. -
    7. Sur le tab suivant, ajouter un nom de projet : "Test"
    8. -
    9. Utiliser le contenu de projet par défaut
    10. -
    11. Cliquer sur le bouton "Finish"
    12. -
    -
  2. -
  3. Créer un test unique avec un seul succès -
      -
    1. Dans l'explorateur de paquet cliquer-droit sur le projet "Test" et sélectionner "New > File".
    2. -
    3. Comme nom de fichier remplir : test1.php et cliquer sur "Finish"
    4. -
    5. Double-cliquer sur l'entrée test1.php dans l'explorateur de paquet : cela devrait ouvrir une nouvelle vue pour modifier ce fichier.
    6. -
    7. Remplir le fichier avec ces lignes : -assertEqual(3,$total, "This should pass"); - } -} -?> -]]> -
    8. -
    9. Sélectionner "File > Save" depuis le menu.
    10. -
    11. Cliquer-droit sur test1.php et sélectionner "Run > Run Simpletest".
    12. -
    13. La "Result View" devrait se remplir avec les informations sur le résultat du test - et la console SimpleTest devrait se remplir avec d'autres informations aussi.
    14. -
    -
  4. -
  5. Une seule classe de test, plusieurs tests -
      -
    1. dans l'explorateur de paquet, cliquer droit sur le projet "Test" et sélectionner "New > File".
    2. -
    3. En tant que nom de fichier, utiliser : test2.php et cliquer sur "Finish".
    4. -
    5. Double-cliquer sur l'entrée test2.php dans l'explorateur de paquet : une nouvelle vue s'ouvre, prête pour l'édition.
    6. -
    7. Remplir le contenu avec : -assertEqual(3,$total, "This should pass"); - } - function test_fail(){ - $x = 1; - $y = 2; - $total = $x + $y; - $this->assertEqual(4,$total,"This should fail"); - } -} -?> -]]> -
    8. -
    9. Sélectionner "File > save" dans la barre de menu.
    10. -
    11. Cliquer-droit sur grouptest.php et sélectionner "Run > Run Simpletest".
    12. -
    13. La "Result View" devrait se remplir avec les informations issus du test lancé, - idem pour pour la console SimpleTest.
    14. -
    -
  6. -
  7. Tests groupés (plusieurs fichiers de test en même temps) -
      -
    1. dans l'explorateur de paquet, cliquer droit sur le projet "Test" et sélectionner "New > File".
    2. -
    3. En tant que nom de fichier, utiliser : test2.php et cliquer sur "Finish".
    4. -
    5. Double-cliquer sur l'entrée test2.php dans l'explorateur de paquet : une nouvelle vue s'ouvre, prête pour l'édition.
    6. -
    7. Remplir le contenu avec : -addTestFile(dirname(__FILE__).'/test1.php'); - $this->addTestFile(dirname(__FILE__).'/test2.php'); - } -} -?> -]]> -
    8. -
    9. Sélectionner "File > Save" depuis le menu.
    10. -
    11. Cliquer-droit sur test1.php et sélectionner "Run > Run Simpletest".
    12. -
    13. La "Result View" devrait se remplir avec les informations sur le résultat du test - et la console SimpleTest devrait se remplir avec d'autres informations aussi.
    14. -
    -
  8. -
-
-
-
    -
  • - Si un constructeur est utilisé dans le scénario de test, - bien faire attention à ce que la dernière ligne de ce constructeur appelle - le constructeur parent (par exemple parent::UnitTestCase) -
  • -
  • - Ne pas mettre d'assertions dans le constructeur de la classe de test -
  • -
  • - Si vous obtenez une erreur indiquant qu'une classe ne pouvait pas être chargé, alors il faut - relancer Eclipse. Une fois qu'Eclipse a redémarré, ouvrir la "Result View" manuellement - en sélectionnant "Window > Show View > Other..." - Puis sélectionner la catégorie SimpleTest, puis la "Result View" et enfin cliquer sur "OK". -
  • -
-
-
-

Ci-dessous des fonctionnalités qui devrait arriver à un moment ou un autre dans ce plugin

-
    -
  • - Permettre différents fichiers d'inclustion pour chaque lanceur - (écraser l'include "master") -
  • -
  • - Mieux gérer les erreurs fatales -
  • -
-
-
- - - - dévloppement logiciel, - plugin eclipse, - programmation en binôme, - programmation php, - outils de développement logiciel, - tutorial php, - scripts php gratuits, - architecture, - ressources php, - objets fantaisie, - junit, - php testing, - test unitaire, - test php automatisé, - explication test unitaire, - exemple test unitaire - - -
diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/first_test_tutorial.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/first_test_tutorial.xml deleted file mode 100644 index fc94905..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/first_test_tutorial.xml +++ /dev/null @@ -1,462 +0,0 @@ - - - - - Tutorial sur les tests unitaires en PHP - Crer un exemple de scnario de test en PHP - - -

- Si vous dbutez avec les tests unitaires, - il est recommand d'essayer le code au fur et mesure. - Il n'y pas grand chose taper et vous sentirez - le rythme de la programmation pilote par les tests. -

-

- Pour excuter les exemples tels quels, - vous aurez besoin de crer un nouveau rpertoire - et d'y installer trois dossiers : - classes, tests et temp. - Dzippez le framework SimpleTest - dans le dossier tests - et assurez vous que votre serveur web puisse atteindre ces endroits. -

-
-
-

- L'exemple dans l'introduction rapide - comprenait les tests unitaires d'une simple classe de log. - Dans ce tutorial propos de Simple Test, je vais essayer - de raconter toute l'histoire du dveloppement de cette classe. - Cette classe PHP est courte et simple : - au cours de cette introduction, elle recevra beaucoup - plus d'attention que dans le cadre d'un dveloppement de production. - Nous verrons que derrire son apparente simplicit - se cachent des choix de conception tonnamment difficiles. -

-

- Peut-tre que ces choix sont trop difficiles ? - Plutt que d'essayer de penser tout en amont, - je vais commencer par poser une exigence : - nous voulons crire des messages dans un fichier. - Ces messages doivent tre ajouts en fin de fichier s'il existe. - Plus tard nous aurons besoin de priorits, - de filtres et d'autres choses encore, - mais nous plaons l'criture dans un fichier - au coeur de nos proccupations. - Nous ne penserons rien d'autres par peur de confusion. - OK, commenons par crire un test... -run(new HtmlReporter()); -?> -]]> - Pas pas, voici ce qu'il veut dire. -

-

- La constante SIMPLE_TEST contient - le chemin vers les classes de Simple Test partir de ce fichier. - Les classes pourraient tre places dans le path - du fichier php.ini mais si vous tes sur un serveur mutualis, - vous n'y aurez probablement pas accs. - Pour que tout le monde soit content, - le chemin est dclar explicitement dans le script de test. - Plus tard nous verrons comment tout finira au mme endroit. -

-

- Qu'est-ce donc que ce fichier autorun.php ? - Les bibliothques de SimpleTest sont une bote outil - pour crer votre propre suite de tests standardiss. - Elles peuvent tre utilises "telles que" sans problme, - mais sont constitues par des composants qui doivent tre assembls. - autorun.php est un composant spcial : - il fournit les parties "testeur unitaire" et "affichage". - Il attrape les classes de test et les lance automagiquement. -

-

- Il est probable que vous en viendrez crire votre propre affichage - et ajouter cette version par dfaut est optionnel. - SimpleTest inclut une classe d'affichage utilisable - et basique - - appele HtmlReporter. - Sur des tests, elle peut enregistrer dbuts, fins, erreurs, succs et chec. - Elle affiche ces informations au plus vite, au cas o le code - du test fait planter le script et masque la source d'chec. -

-

- Les tests eux-mmes sont rassembls dans une classe de scnario de test. - Cette dernire est typiquement une extension de - la classe UnitTestCase. - Quand le test est excut, elle cherche les mthodes - commenant par "test" et les lancent. - Notre seule mthode de test pour l'instant est appelle - testCreatingNewFile() mais elle est encore vide. -

-

- Une mthode vide ne fait rien. Nous avons besoin d'y placer du code. - La classe UnitTestCase gnre des vnements - de test son excution : - ces vnements sont envoys vers un observateur. -

-

- Et pour ajouter du code de test... - - - class TestOfLogging extends UnitTestCase { - function testCreatingNewFile() { - @unlink('../temp/test.log'); - $log = new Log('../temp/test.log'); - $log->message('Should write this to a file'); - $this->assertTrue(file_exists('../temp/test.log')); - } - } - - $test = &new TestOfLogging(); - $test->run(new HtmlReporter()); -?> -]]> -

-

- Vous pensez probablement que a reprsente beaucoup - de code pour un unique test et je suis d'accord avec vous. - Ne vous inquitez pas. Il s'agit d'un cot fixe et partir - de maintenant nous pouvons ajouter des tests : - une ligne ou presque chaque fois. - Parfois moins en utilisant des artefacts - de test que nous dcouvrirons plus tard. -

-

- Nous devons maintenant prendre nos premires dcisions. - Notre fichier de test s'appelle log_test.php - (n'importe quel nom ferait l'affaire) : - nous le plaons dans un dossier appel tests - (partout ailleurs serait aussi bien). - Notre fichier de code s'appelle log.php : - c'est son contenu que nous allons tester. - Je l'ai plac dans notre dossier classes : - cela veut-il dire que nous construisons une classe ? -

-

- Pour cet exemple, la rponse est oui, - mais le testeur unitaire n'est pas restreint aux tests de classe. - C'est juste que le code orient objet est plus facile - dpecer et remodeler. Ce n'est pas par hasard - si la conduite de tests fins via les tests unitaires - est apparue au sein de la communaut OO. -

-

- Le test en lui-mme est minimal. Tout d'abord il limine - tout autre fichier de test qui serait encore prsent. - Les dcisions de conception arrivent ensuite en rafale. - Notre classe s'appelle Log : - elle passe le chemin du fichier au constructeur. - Nous crons le log et nous lui envoyons aussitt - un message en utilisant la mthode message(). - L'originalit dans le nommage n'est pas - une caractristique dsirable chez un dveloppeur informatique : - c'est triste mais c'est comme a. -

-

- La plus petite unit d'un test mmm... heu... unitaire est l'assertion. - Ici nous voulons nous assurer que le fichier log - auquel nous venons d'envoyer un message a bel et bien t cr. - UnitTestCase::assertTrue() enverra - un vnement russite si la condition value est vraie - ou un chec dans le cas contraire. - Nous pouvons avoir un ensemble d'assertions diffrentes - et encore plus si nous tendons - nos scnarios de test classique. Voici la liste... - - - - - - - - - - - - - - - - -
assertTrue($x)Echoue si $x est faux
assertFalse($x)Echoue si $x est vrai
assertNull($x)Echoue si $x est initialis
assertNotNull($x)Echoue si $x n'est pas initialis
assertIsA($x, $t)Echoue si $x n'est pas de la classe ou du type $t
assertEqual($x, $y)Echoue si $x == $y est faux
assertNotEqual($x, $y)Echoue si $x == $y est vrai
assertIdentical($x, $y)Echoue si $x === $y est faux
assertNotIdentical($x, $y)Echoue si $x === $y est vrai
assertReference($x, $y)Echoue sauf si $x et $y sont la mme variable
assertCopy($x, $y)Echoue si $x et $y sont la mme variable
assertWantedPattern($p, $x)Echoue sauf si l'expression rationnelle $p capture $x
assertNoUnwantedPattern($p, $x)Echoue si l'expression rationnelle $p capture $x
assertNoErrors()Echoue si une erreur PHP arrive
assertError($x)Echoue si aucune erreur ou message incorrect de PHP n'arrive
-

-

- Nous sommes dsormais prt lancer notre script de test - en le passant dans le navigateur. - Qu'est-ce qui devrait arriver ? - Il devrait planter... -

- Fatal error: Failed opening required '../classes/log.php' (include_path='') in /home/marcus/projects/lastcraft/tutorial_tests/Log/tests/log_test.php on line 7 -
- La raison ? Nous n'avons pas encore cr log.php. -

-

- Mais attendez une minute, c'est idiot ! - Ne me dites pas qu'il faut crer - un test sans crire le code tester auparavant... -

-
-
-

- Co-inventeur de - l'Extreme Programming, - Kent Beck a lanc un autre manifeste. - Le livre est appel - Test Driven Development - (Dveloppement Pilot par les Tests) - ou TDD et lve les tests unitaires une position leve de la conception. - En quelques mots, vous crivez d'abord un petit test - et seulement ensuite le code qui passe ce test. - N'importe quel bout de code. Juste pour qu'il passe. -

-

- Vous crivez un autre test et puis de nouveau du code qui passe. - Vous aurez alors un peu de duplication et gnralement - du code pas trs propre. Vous remaniez (factorisez) - ce code-l en vous assurant que les tests continuent passer : - vous ne pouvez rien casser. - Une fois que le code est le plus propre possible - vous tes prt ajouter des nouvelles fonctionnalits. - Il suffit juste de rajouter des nouveaux tests et de recommencer - le cycle une nouvelle fois. - -

-

- Il s'agit d'une approche assez radicale et - j'ai parfois l'impression qu'elle est incomplte. - Mais il s'agit d'un moyen efficace pour expliquer - un testeur unitaire ! - Il se trouve que nous avons un test qui choue, - pour ne pas dire qu'il plante : - l'heure est venue d'crire du code dans log.php... - -]]> - Il s'agit l du minimum que nous puissions - faire pour viter une erreur fatale de PHP. - Et maintenant la rponse devient... -

-

testoflogging

- Fail: testcreatingnewfile->True assertion failed.
-
1/1 test cases complete. - 0 passes and 1 fails.
-
- "testoflogging" a chou. - Parmi les dfauts de PHP on trouve cette fcheuse tendance - transformer intrieurement les noms de classes - et de mthodes en minuscules. - SimpleTest utilise ces noms par dfaut pour dcrire - les tests mais nous pouvons les remplacer par nos propres noms. -function TestOfLogging() { - $this->UnitTestCase('Log class test'); - } - function testCreatingNewFile() { - @unlink('../temp/test.log'); - $log = new Log('../temp/test.log'); - $log->message('Should write this to a file'); - $this->assertTrue(file_exists('../temp/test.log'), 'File created'); - } -} -]]> - Ce qui donne... -
-

Log class test

- Fail: testcreatingnewfile->File created.
-
1/1 test cases complete. - 0 passes and 1 fails.
-
- Par contre pour le nom des mthodes il n'y a rien faire, dsol. -

-

- Les messages d'un test comme ceux-ci ressemblent - bien des gards des commentaires de code. - Certains ne jurent que par eux, d'autres au contraire - les bannissent purement et simplement en les considrant - aussi encombrants qu'inutiles. - Pour ma part, je me situe quelque part au milieu. -

-

- Pour que le test passe, nous pourrions nous contenter - de crer le fichier dans le constructeur de Log. - Cette technique "en faisant semblant" est trs utile - pour vrifier que le test fonctionne pendant les passages difficiles. - Elle le devient encore plus si vous sortez d'un passage - avec des tests ayant chous et que vous voulez juste vrifier - de ne pas avoir oubli un truc bte. - Nous n'allons pas aussi lentement donc... - - var $_file_path; - - function Log($file_path) { - $this->_file_path = $file_path; - } - - function message($message) { - $file = fopen($this->_file_path, 'a'); - fwrite($file, $message . "\n"); - fclose($file); - } - } -?> -]]> - Au total, pas moins de 4 checs ont t ncessaire - pour passer l'tape suivante. Je n'avais pas cr - le rpertoire temporaire, je ne lui avais pas donn - les droits d'criture, j'avais une coquille et - je n'avais pas non plus ajout ce nouveau rpertoire dans CVS. - N'importe laquelle de ces erreurs aurait pu m'occuper - pendant plusieurs heures si elle tait apparue plus tard - mais c'est bien pour ces cas l qu'on teste. - Avec les corrections adquates, a donne... -

-

Log class test

-
1/1 test cases complete. - 1 passes and 0 fails.
-
- a marche! -

-

- Peut-tre n'aimez-vous pas le style plutt minimal de l'affichage. - Les succs ne sont pas montrs par dfaut puisque - gnralement vous n'avez pas besoin de plus d'information - quand vous comprenez effectivement ce qui se passe. - Dans le cas contraire, pensez crire d'autres tests. -

-

- D'accord, c'est assez strict. Si vous voulez aussi voir - les succs alors vous pouvez - crer une sous-classe - de HtmlReporter et l'utiliser pour les tests. - Mme moi j'aime bien ce confort parfois. -

-
-
-

- Il y a une nuance ici. Nous ne voulons pas crer de fichier - avant d'avoir effectivement envoy de message. - Plutt que d'y rflchir trop longtemps, - nous allons juste ajouter un test pour a. -UnitTestCase('Log class test'); - } - function testCreatingNewFile() { - @unlink('../temp/test.log'); - $log = new Log('../temp/test.log'); - $this->assertFalse(file_exists('../temp/test.log'), 'No file created before first message'); - $log->message('Should write this to a file'); - $this->assertTrue(file_exists('../temp/test.log'), 'File created'); - } -} -]]> - ...et dcouvrir que a marche dj... -

-

Log class test

-
1/1 test cases complete. - 2 passes and 0 fails.
-
- En fait je savais que a allait tre le cas. - J'ajoute ce test de confirmation tout d'abord pour - garder l'esprit tranquille, mais aussi pour documenter ce comportement. - Ce petit test supplmentaire dans son contexte - en dit plus long qu'un scnario utilisateur - d'une douzaine de lignes ou qu'un diagramme UML complet. - Que la suite de tests devienne une source de documentation - est un effet secondaire assez agrable. -

-

- Devrions-nous supprimer le fichier temporaire la fin du test ? - Par habitude, je le fais une fois que j'en ai termin - avec la mthode de test et qu'elle marche. - Je n'ai pas envie de valider du code qui laisse - des restes de fichiers de test traner aprs un test. - Mais je ne le fais pas non plus pendant que j'cris le code. - Peut-tre devrais-je, mais parfois j'ai besoin de voir ce qui se passe : - on retrouve cet aspect confort voqu plus haut. -

-

- Dans un vritable projet, - nous avons habituellement plus qu'un unique scnario de test : - c'est pourquoi nous allons regarder comment - grouper des tests dans des suites de tests. -

-
-
- - - Crer un nouveau scnario de test. - - - Le Dveloppement Pilot par les Tests en PHP. - - - Les tests comme documentation - est un des nombreux effets secondaires. - - - - - La FAQ de JUnit contient plein de conseils judicieux sur les tests. - - - Ensuite vient "comment grouper des scnarios de tests ensemble". - - - Vous aurez besoin du framework de test SimpleTest pour ces exemples. - - - - - dveloppement logiciel, - programmation php, - outils de dveloppement logiciel, - tutorial php, - scripts php gratuits, - architecture, - ressouces php, - objets fantaisie, - junit, - test php, - test unitaire, - test php automatis, - tutorial de scnarios de test, - explication d'un scnario de test unitaire, - exemple de test unitaire - - -
- diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/form_testing_documentation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/form_testing_documentation.xml deleted file mode 100644 index 89e4933..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/form_testing_documentation.xml +++ /dev/null @@ -1,308 +0,0 @@ - - - - - Documentation SimpleTest : tester des formulaires HTML - -
-

- Lorsqu'une page est tlcharge par WebTestCase - en utilisant get() ou post() - le contenu de la page est automatiquement analys. - De cette analyse dcoule le fait que toutes les commandes - l'intrieur de la balise <form> sont disponibles - depuis l'intrieur du scnario de test. - Prenons par exemple cet extrait de code HTML... -


-    
-    
-
-]]>
- Il ressemble ... -

-

-

- - -
-

-

- Nous pouvons naviguer vers ce code, via le site - LastCraft, - avec le test suivant... - - function testDefaultValue() { - $this->get('http://www.lastcraft.com/form_testing_documentation.php'); - $this->assertField('a', 'A default'); - } -} -]]> - Directement aprs le chargement de la page toutes les commandes HTML - sont inities avec leur valeur par dfaut, comme elles apparatraient - dans un navigateur web. L'assertion teste qu'un objet HTML - avec le nom "a" existe dans la page - et qu'il contient la valeur "A default". -

-

- Nous pourrions retourner le formulaire tout de suite, - mais d'abord nous allons changer la valeur du champ texte. - Ce n'est qu'aprs que nous le transmettrons... -get('http://www.my-site.com/'); - $this->assertField('a', 'A default'); - $this->setField('a', 'New value'); - $this->clickSubmit('Go'); - } -} -]]> - Parce que nous n'avons spcifi ni attribut "method" - sur la balise form, ni attribut "action", - le scnario de test suivra le comportement classique d'un navigateur : - transmission des donnes avec une requte GET - vers la mme page. SimpleTest essaie d'muler - le comportement typique d'un navigateur autant que possible, - plutt que d'essayer d'attraper des attributs manquants sur les balises. - La raison est simple : la cible d'un framework de test est - la logique d'une application PHP, pas les erreurs - -- de syntaxe ou autres -- du code HTML. - Pour les erreurs HTML, d'autres outils tel - HTMLTidy - devraient tre employs. -

-

- Si un champ manque dans n'importe quel formulaire ou si - une option est indisponible alors WebTestCase::setField() - renverra false. Par exemple, supposons que - nous souhaitons vrifier qu'une option "Superuser" - n'est pas prsente dans ce formulaire... -

Select type of user to add:
-
-]]>
- Qui ressemble ... -

-

-

- Select type of user to add: - -
-

-

- Le test suivant le confirmera... - - $this->get('http://www.lastcraft.com/form_testing_documentation.php'); - $this->assertFalse($this->setField('type', 'Superuser')); - } -} -]]> - La slection ne sera pas change suite un chec d'initialisation - d'une valeur sur un objet. -

-

- Voici la liste complte des objets supports aujourd'hui... -

    -
  • Champs texte, y compris les champs masqus (hidden) ou crypts (password).
  • -
  • Boutons submit, en incluant aussi la balise button, mais pas encore les boutons reset
  • -
  • Aires texte (textarea) avec leur gestion des retours la ligne (wrap).
  • -
  • Cases cocher, y compris les cases cocher multiples dans un mme formulaire.
  • -
  • Listes menu droulant, y compris celles slections multiples.
  • -
  • Boutons radio.
  • -
  • Images.
  • -
-

-

- Le navigateur propos par SimpleTest mule les actions - qui peuvent tre ralises par un utilisateur sur - une page HTML standard. Javascript n'est pas support et - il y a peu de chance pour qu'il le soit prochainement. -

-

- Une attention particulire doit tre port aux techniques Javascript - qui changent la valeur d'un champ cach : elles ne peuvent pas tre - ralises avec les commandes classiques de SimpleTest. - Une mthode alternative est propose plus loin. -

-
-
-

- SimpleTest peut grer deux types de commandes valeur multiple : - les menus droulants slection multiple et les cases cocher - avec le mme nom l'intrieur mme d'un formulaire. - La nature de ceux-ci implique que leur initialisation - et leur test sont lgrement diffrents. - Voici un exemple avec des cases cocher... -


-    Create privileges allowed:
-    
- Retrieve privileges allowed: -
- Update privileges allowed: -
- Destroy privileges allowed: -
- - -]]>
- Qui se traduit par... -

-

-

- Create privileges allowed: -
- Retrieve privileges allowed: -
- Update privileges allowed: -
- Destroy privileges allowed: -
- -
-

-

- Si nous souhaitons dsactiver tous les privilges sauf - ceux de tlchargement (Retrieve) et transmettre cette information, - nous pouvons y arriver par... - - function testDisableNastyPrivileges() { - $this->get('http://www.lastcraft.com/form_testing_documentation.php'); - $this->assertField('crud', array('c', 'r', 'u', 'd')); - $this->setField('crud', array('r')); - $this->clickSubmit('Enable Privileges'); - } -} -]]> - Plutt que d'initier le champ une valeur unique, - nous lui donnons une liste de valeurs. - Nous faisons la mme chose pour tester les valeurs attendues. - Nous pouvons crire d'autres bouts de code de test - pour confirmer cet effet, peut-tre en nous connectant - comme utilisateur et en essayant d'effectuer une mise jour. -

-
-
-

- Si vous souhaitez tester un formulaire dpendant de Javascript - pour la modification d'un champ cach, vous ne pouvez pas - simplement utiliser setField(). - Le code suivant ne fonctionnera pas : -// Ne fonctionne *pas* - $this->setField('un_champ_cach', '123'); - $this->clickSubmit('OK'); - } -} -]]> - A la place, vous aurez besoin d'ajouter le paramtre supplmentaire - du formulaire la mthode clickSubmit() : -$this->clickSubmit('OK', array('un_champ_cach'=>'123')); - } - -} -]]> -

-

- N'oubliez pas que de la sorte, vous tes effectivement en train - de court-circuitez une partie de votre application (le code Javascript - dans le formulaire) et que peut-tre serait-il plus prudent - d'utiliser un outil comme - Selenium pour mettre sur pied - un test de recette complet. -

-
-
-

- Si vous souhaitez tester un gestionnaire de formulaire - mais que vous ne l'avez pas crit ou que vous n'y avez - pas encore accs, vous pouvez crer un envoi de formulaire la main. - - function testAttemptedHack() { - $this->post( - 'http://www.my-site.com/add_user.php', - array('type' => 'superuser')); - $this->assertNoUnwantedPattern('/user created/i'); - } -} -]]> - En ajoutant des donnes la mthode WebTestCase::post(), - nous essayons de tlcharger la page via la transmission d'un formulaire. -

-
-
- - - Modifier les valeurs d'un formulaire et - russir transmettre un simple formulaire - - - Grer des objets valeurs multiples - en initialisant des listes. - - - Le cas des formulaires utilisant Javascript pour - modifier un champ cach - - - Envoi brut quand il n'existe pas de bouton cliquer. - - - - - La page du projet SimpleTest sur - SourceForge. - - - La page de tlchargement de SimpleTest sur - LastCraft. - - - L'API du dveloppeur pour SimpleTest - donne tous les dtails sur les classes et les assertions disponibles. - - - - - dveloppement logiciel, - programmation php pour des clients, - php centr sur le client, - outils de dveloppement logiciel, - frameword de test de recette, - scripts php gratuits, - architecture, - ressources php, - HTMLUnit, - JWebUnit, - test php, - ressources de test unitaire, - test web - - -
- diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/gain_control_tutorial.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/gain_control_tutorial.xml deleted file mode 100644 index 5f13ea0..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/gain_control_tutorial.xml +++ /dev/null @@ -1,324 +0,0 @@ - - - - - Tutorial de test unitaire en PHP - Isoler les variables pendant le test - - -

- Pour tester un module de code vous avez besoin - d'avoir un contrle trs prcis sur son environnement. - Si quelque chose change dans les coulisses, - par exemple dans un fichier de configuration, - alors les tests peuvent chouer de faon inattendue. - Il ne s'agirait plus d'un test de code sans quivoque - et pourrait vous faire perdre des heures prcieuses - la recherche d'erreurs dans un code qui fonctionne. - Alors qu'il s'agit d'un problme de configuration - qui plante le test en question. - Au mieux vos scnarios de test deviennent de plus en plus - compliqus afin de prendre en compte toutes les variations possibles. -

-
-
-

- Il y a souvent beaucoup de variables videntes qui peuvent affecter - un scnario de test unitaire, d'autant plus dans un environnement - de dveloppement web dans lequel PHP a ses aises. - Parmi celles-ci, on trouve les paramtres de connexion - la base de donnes et ceux de configuration, - les droits de fichier et les ressources rseau, etc. - L'chec ou la mauvaise installation de l'un ou l'autre - de ces composants cassera la suite de test. - Est-ce que nous devons ajouter des tests pour valider - l'installation de ces composants ? - C'est une bonne ide mais si vous les placez - dans les tests du module de code vous aller commencer - encombrer votre code de test avec des dtails - hors de propos avec la tche en cours. - Ils doivent tre placs dans leur propre groupe de tests. -

-

- Par contre un autre problme reste : - nos machines de dveloppement doivent aussi avoir - tous les composants systme d'installs avant l'excution - de la suite de test. Et vos tests s'excuteront plus lentement. -

-

- Devant un tel dilemme, nous crerons souvent - des versions enveloppantes des classes qui grent ces ressources. - Les vilains dtails de ces ressources sont ensuite cods une seule fois. - J'aime bien appeler ces classes des "classes frontire" - tant donn qu'elles existent en bordure de l'application, - l'interface entre votre application et le reste du systme. - Ces classes frontire sont - dans le meilleur des cas - simules - pendant les tests par des versions de simulacre. - Elles s'excutent plus rapidement et sont souvent appeles - "bouchon serveur [Ndt : Server Stubs]" - ou dans leur forme plus gnrique "objet fantaisie - [Ndt : Mock Objects]". - Envelopper et bouchonner chacune de ces ressources - permet d'conomiser pas mal de temps. -

-

- Un des facteurs souvent ngligs reste le temps. - Par exemple, pour tester l'expiration d'une session des codeurs - vont souvent temporairement en caler la dure - une valeur trs courte, disons 2 secondes, - et ensuite effectuer un sleep(3) : - ils estiment alors que la session a expire. - Sauf que cette opration ajoute 3 secondes la suite de test : - il s'agit souvent de beaucoup de code en plus - pour rendre la classe de session aussi mallable. - Plus simple serait d'avoir un moyen d'avancer l'horloge arbitrairement. - De contrler le temps. -

-
-
-

- Une nouvelle fois, nous allons effectuer notre conception - d'une enveloppe d'horloge via l'criture de tests. - Premirement nous ajoutons un scnario de test d'horloge - dans notre suite de test tests/all_tests.php... - -require_once('clock_test.php'); - -$test = &new TestSuite('All tests'); -$test->addTestCase(new TestOfLogging()); -$test->addTestCase(new TestOfClock()); -$test->run(new HtmlReporter()); -?> -]]> - Ensuite nous crons le scnario de test - dans un nouveau fichier tests/clock_test.php... -UnitTestCase('Clock class test'); - } - function testClockTellsTime() { - $clock = new Clock(); - $this->assertEqual($clock->now(), time(), 'Now is the right time'); - } - function testClockAdvance() { - } - } -?> -]]> - Notre unique test pour le moment, c'est que - notre nouvelle class Clock se comporte - comme un simple substitut de la fonction time() en PHP. - L'autre mthode tient lieu d'emploi. - C'est notre chose faire en quelque sorte. - Nous ne lui avons pas donne de test parce que a casserait notre rythme. - Nous crirons cette fonctionnalit de dcalage - dans le temps une fois que nous serons au vert. - Pour le moment nous ne sommes videmment pas dans le vert... -

-
- Fatal error: Failed opening required '../classes/clock.php' (include_path='') in - /home/marcus/projects/lastcraft/tutorial_tests/tests/clock_test.php on line 2 -
-
- Nous crons un fichier classes/clock.php comme ceci... - -]]> - De la sorte nous reprenons le cours du code. -
-

All tests

- Fail: Clock class test->testclocktellstime->[NULL: ] should be equal to [integer: 1050257362]
-
3/3 test cases complete. - 4 passes and 1 fails.
-
- Facile corriger... - - return time(); - } -} -]]> - Et nous revoici dans le vert... -
-

All tests

-
3/3 test cases complete. - 5 passes and 0 fails.
-
- Il y a juste un petit problme. - L'horloge pourrait basculer pendant l'assertion - et crer un cart d'une seconde. - Les probabilits sont assez faibles mais s'il devait - y avoir beaucoup de tests de chronomtrage - nous finirions avec une suite de test qui serait erratique - et forcment presque inutile. - Nous nous y attaquerons bientt - et pour l'instant nous l'ajoutons dans la liste des "choses faire". -

-

- Le test d'avancement ressemble ... -UnitTestCase('Clock class test'); - } - function testClockTellsTime() { - $clock = new Clock(); - $this->assertEqual($clock->now(), time(), 'Now is the right time'); - } - function testClockAdvance() { - $clock = new Clock(); - $clock->advance(10); - $this->assertEqual($clock->now(), time() + 10, 'Advancement'); - } -} -]]> - Le code pour arriver au vert est direct : - il suffit d'ajouter un dcalage de temps. - - var $_offset; - - function Clock() { - $this->_offset = 0; - } - - function now() { - return time() + $this->_offset; - } - - function advance($offset) { - $this->_offset += $offset; - } -} -]]> -

-
-
-

- Notre fichier all_tests.php contient des rptitions - dont nous pourrions nous dbarrasser. - Nous devons ajouter manuellement tous nos scnarios de test - depuis chaque fichier inclus. - C'est possible de les enlever mais avec les prcautions suivantes. - La classe GroupTest inclue une mthode bien pratique - appele addTestFile() qui prend un fichier PHP comme paramtre. - Ce mcanisme prend note de toutes les classes : - elle inclut le fichier et ensuite regarde toutes les classes - nouvellement cres. S'il y a des filles de TestCase - elles sont ajoutes au nouveau test de groupe. -

-

- En outre, la bibliothque autorun lancera tous les scnarios - de test collects automagiquement aprs les avoir chargs. -

-

- Voici notre suite de test remanie en appliquant cette mthode... - -require_once(SIMPLE_TEST . 'autorun.php'); - -class AllTests extends TestSuite { - function AllTests() { - $this->TestSuite('All tests'); - $this->addFile('log_test.php'); - $this->addFile('clock_test.php'); - } -} -?> -]]> - Les inconvniants sont les suivants... -

    -
  1. - Si le fichier de test a dj t inclus, - aucune nouvelle classe ne sera ajoute au groupe. -
  2. -
  3. - Si le fichier de test contient d'autres classes - relies TestCase alors celles-ci - aussi seront ajout au test de groupe. -
  4. -
- Dans nos test nous n'avons que des scnarios dans les - fichiers de test et en plus nous avons supprim - leur inclusion du script all_tests.php : - nous sommes donc en rgle. C'est la situation la plus commune. -

-

- Nous devrions corriger au plus vite le petit problme - de dcalage possible sur l'horloge : - c'est ce que nous faisons ensuite. -

-
-
- - - Le temps est souvent une variable nglige dans les tests. - - - Une classe horloge - nous permet de modifier le temps. - - - Nettoyer le test de groupe. - - - - - La section prcdente : - grouper des tests unitaires. - - - La section suivante : - sous classer les scnarios de test. - - - Vous aurez besoin du - testeur unitaire SimpleTest pour les exemples. - - - - - dveloppement logiciel, - programmation php, - outils de dveloppement logiciel, - tutorial php, - scripts php gratuits, - organisation de tests unitaires, - conseil de test, - astuce de dveloppement, - architecture logicielle pour des tests, - exemple de code php, - objets fantaisie, - junit, - test php, - outil de test unitaire, - suite de test php - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/group_test_documentation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/group_test_documentation.xml deleted file mode 100644 index 80d9178..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/group_test_documentation.xml +++ /dev/null @@ -1,353 +0,0 @@ - - - - - Documentation SimpleTest : Grouper des tests - -
-

- Pour lancer les scnarios de tests en tant que groupe, - ils devraient tre placs dans des fichiers sans le code du lanceur... - -]]> - Autant de scnarios que ncessaires peuvent tre - mis dans un fichier unique. Ils doivent contenir - tout le code ncessaire, entre autres la bibliothque teste, - mais aucune des bibliothques de SimpleTest. -

-

- Si vous avez tendu l'un ou l'autre des scnarios de test, - vous pouvez aussi les inclure. - - class MyFileTestCase extends UnitTestCase { - ... - } - SimpleTestOptions::ignore('MyFileTestCase'); - - class FileTester extends MyFileTestCase { - ... - } - - class SocketTester extends UnitTestCase { - ... - } -?> -]]> - La classe FileTester ne contient aucun test vritable, - il s'agit d'une classe de base pour d'autres scnarios de test. - Pour cette raison nous utilisons la directive - SimpleTestOptions::ignore() pour indiquer - au prochain groupe de tests de l'ignorer. - Cette directive peut se placer n'importe o dans le fichier - et fonctionne quand un fichier complet des scnarios de test - est charg (cf. ci-dessous). - Nous l'appelons file_test.php. -

-

- Ensuite nous crons un fichier de groupe de tests, - disons group_test.php. - Vous penserez un nom plus convaincant, j'en suis sr. - Nous lui ajoutons le fichier de test avec une mthode sans risque... - - require_once('file_test.php'); - - $test = &new GroupTest('All file tests'); - $test->addTestCase(new FileTestCase()); - $test->run(new HtmlReporter()); -?> -]]> - Ceci instancie le scnario de test avant que - la suite de test ne soit lance. - a pourrait devenir assez onreux avec - un grand nombre de scnarios de test : - il existe donc une autre mthode qui instancie - la classe uniquement quand elle devient ncessaire... - - $test->addTestClass('FileTestCase'); - $test->run(new HtmlReporter()); -?> -]]> - Le problme de cette technique est que pour - chaque scnario de test supplmentaire nous aurons importer - (via require_once()) le fichier de code de test - et instancier manuellement chaque scnario de test. - Nous pouvons nous pargner beaucoup de dactylographie avec... - - $test->addTestFile('file_test.php'); - $test->run(new HtmlReporter()); -?> -]]> - Voici ce qui vient de se passer : - la classe GroupTest a ralis le - require_once() pour nous. - Ensuite elle vrifie si de nouvelles classes de scnario - de test ont t cres par ce nouveau fichier - et les ajoute automatiquement au groupe de tests. - Dsormais tout ce qu'il nous reste faire, - c'est d'ajouter chaque nouveau fichier. -

-

- Il y a deux choses qui peuvent planter - et qui demandent un minimum d'attention... -

    -
  1. - Le fichier peut dj avoir t analys par PHP - et dans ce cas aucune classe ne sera ajoute. - Pensez bien vrifier que les scnarios de test - ne sont inclus que dans ce fichier et dans aucun autre - (Note : avec la nouvelle fonctionnalit autorun, - ce problme a maintenant t rsolu). -
  2. -
  3. - Les nouvelles classes d'extension de scnario - de test qui sont incluses seront places - dans le groupe de tests et excutes par la mme occasion. - Vous aurez ajouter une directive - SimpleTestOptions::ignore() pour ces classes - ou alors pensez les ajouter avant la ligne - GroupTest::addTestFile(). -
  4. -
-

-
-
-

- La technique ci-dessus place tous les scnarios de test - dans un unique et grand groupe. - Sauf que pour des projets plus consquents, - ce n'est probablement pas assez souple; - vous voudriez peut-tre grouper les tests tout fait diffremment. -

-

- Pour obtenir un groupe de tests plus souple - nous pouvons sous classer GroupTest - et ensuite l'instancier au cas par cas... - - class FileGroupTest extends GroupTest { - function FileGroupTest() { - $this->GroupTest('All file tests'); - $this->addTestFile('file_test.php'); - } - } -?> -]]> - Ceci nomme le test dans le constructeur - et ensuite ajoute la fois nos scnarios - de test et un unique groupe en dessous. - Bien sr nous pouvons ajouter plus d'un groupe cet instant. - Nous pouvons maintenant invoquer les tests - partir d'un autre fichier d'excution... - - $test = &new FileGroupTest(); - $test->run(new HtmlReporter()); -?> -]]> - ...ou alors nous pouvons les grouper - dans un groupe de tests encore plus grand... - - $test = &new BigGroupTest('Big group'); - $test->addTestCase(new FileGroupTest()); - $test->addTestCase(...); - $test->run(new HtmlReporter()); -?> -]]> - Si nous souhaitons lancer le groupe de tests original - sans utiliser ses petits fichiers d'excution, - nous pouvons mettre le code du lanceur de test - derrire des barreaux quand nous crons chaque groupe. -GroupTest('All file tests'); - $test->addTestFile('file_test.php'); - } - } - - if (! defined('RUNNER')) { - define('RUNNER', true); - $test = &new FileGroupTest(); - $test->run(new HtmlReporter()); - } -?> -]]> - Cette approche exige aux barrires d'tre actives - l'inclusion du fichier de groupe de tests, - mais c'est quand mme moins de tracas que beaucoup - de fichiers de lancement parpills. - Reste inclure des barreaux identiques - au niveau suprieur afin de s'assurer que - le run() ne sera lanc qu'une seule fois - partir du script de haut niveau qui l'a invoqu. -addTestCase(new FileGroupTest()); - $test->addTestCase(...); - $test->run(new HtmlReporter()); -?> -]]> - Comme les scnarios de test normaux, - un GroupTest peut tre charg avec la mthode - GroupTest::addTestFile(). - - $test->addTestFile('file_group_test.php'); - $test->addTestFile(...); - $test->run(new HtmlReporter()); -?> -]]> -

-
-
-

- Si vous avez dj des tests unitaires pour votre code - ou alors si vous tendez des classes externes - qui ont dj leurs propres tests, il y a peu de chances - pour que ceux-ci soient dj au format SimpleTest. - Heureusement il est possible d'incorporer ces scnarios - de test en provenance d'autres testeurs unitaires - directement dans des groupes de test SimpleTest. -

-

- Par exemple, supposons que nous ayons - ce scnario de test prvu pour - PhpUnit - dans le fichier config_test.php... -class ConfigFileTest extends TestCase { - function ConfigFileTest() { - $this->TestCase('Config file test'); - } - - function testContents() { - $config = new ConfigFile('test.conf'); - $this->assertRegexp('/me/', $config->getValue('username')); - } -} -]]> - Le groupe de tests peut le reconnatre partir - du moment o nous mettons l'adaptateur appropri - avant d'ajouter le fichier de test... - - require_once('simpletest/adapters/phpunit_test_case.php'); - - $test = &new GroupTest('All file tests'); - $test->addTestFile('config_test.php'); - $test->run(new HtmlReporter()); -?> -]]> - Il n'y a que deux adaptateurs, - l'autre est pour le paquet testeur unitaire de - PEAR... - - require_once('simpletest/adapters/pear_test_case.php'); - - $test = &new GroupTest('All file tests'); - $test->addTestFile('some_pear_test_cases.php'); - $test->run(new HtmlReporter()); -?> -]]> - Les scnarios de test de PEAR peuvent tre - librement mlangs avec ceux de SimpleTest - mais vous ne pouvez pas utiliser les assertions - de SimpleTest au sein des versions hrites - des scnarios de test. La raison ? - Une simple vrification que vous ne rendez pas - par accident vos scnarios de test compltement - dpendants de SimpleTest. - Peut-tre que vous souhaitez publier - votre bibliothque sur PEAR par exemple : - a voudrait dire la livrer avec des scnarios de - test compatibles avec PEAR::PhpUnit. -

-
-
- - - Plusieurs approches pour grouper des tests ensemble. - - - Combiner des groupes des tests dans des - groupes plus grands. - - - Intgrer des scnarios de test hrits - d'un autre type de PHPUnit. - - - - - La page du projet SimpleTest sur - SourceForge. - - - La page de tlchargement de SimpleTest sur - LastCraft. - - - - - test unitaire en php, - intgration de test, - documentation, - marcus baker, - perrick penet, - test simple, - documentation simpletest, - phpunit, - pear - - -
- diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/group_test_tutorial.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/group_test_tutorial.xml deleted file mode 100644 index 84f7016..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/group_test_tutorial.xml +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - Tutorial de test unitaire PHP - Grouper des tests unitaires et exemples d'criture de scnarios de tests - - - -

- Pour enchaner nous allons remplir des blancs et crer une suite de tests. -

-
-
-

- Ajouter un autre test peut tre aussi simple - qu'ajouter une nouvelle mthode un scnario de test... -UnitTestCase('Log class test'); - } - function testCreatingNewFile() { - @unlink('../temp/test.log'); - $log = new Log('../temp/test.log'); - $this->assertFalse(file_exists('../temp/test.log'), 'Created before message'); - $log->message('Should write this to a file'); - $this->assertTrue(file_exists('../temp/test.log'), 'File created'); - @unlink('../temp/test.log'); - } - function testAppendingToFile() { - @unlink('../temp/test.log'); - $log = new Log('../temp/test.log'); - $log->message('Test line 1'); - $messages = file('../temp/test.log'); - $this->assertWantedPattern('/Test line 1/', $messages[0]); - $log->message('Test line 2'); - $messages = file('../temp/test.log'); - $this->assertWantedPattern('/Test line 2/', $messages[1]); - @unlink('../temp/test.log'); - } -} -]]> - La mthode du scnario de test assertWantedPattern() - utilise les expressions rationnelles Perl pour vrifier - qu'une chane respecte un certain motif. -

-

- Tout ce que nous faisons dans ce nouveau test, - c'est crire une ligne dans un fichier, puis la lire, - le tout deux fois de suite. - Nous souhaitons simplement vrifier que le loggueur - ajoute le texte la fin plutt qu'craser - les donnes dj existantes. Quelque peu pdant, - mais aprs tout il s'agit d'un tutorial ! -

-

- De toute faon ce test passe directement... -

-

Log class test

-
1/1 test cases complete. - 4 passes and 0 fails.
-
- Notre code contient actuellement beaucoup de rptitions, - nous devons effacer le fichier de test avant et aprs chaque test. - De mme que JUnit, - SimpleTest utilise les mthodes - setUp() et tearDown() - qui sont excutes respectivement avant et aprs chaque test. - La suppression du fichier est commune tous les tests : - nous devrions donc y mettre cette opration. -

-

- Nos tests sont verts donc nous pouvons faire un peu de remaniement... -UnitTestCase('Log class test'); - } - function setUp() { - @unlink('../temp/test.log'); - } - function tearDown() { - @unlink('../temp/test.log'); - } - function testCreatingNewFile() { - $log = new Log('../temp/test.log'); - $this->assertFalse(file_exists('../temp/test.log'), 'Created before message'); - $log->message('Should write this to a file'); - $this->assertTrue(file_exists('../temp/test.log'), 'File created'); - } - function testAppendingToFile() { - $log = new Log('../temp/test.log'); - $log->message('Test line 1'); - $messages = file('../temp/test.log'); - $this->assertWantedPattern('/Test line 1/', $messages[0]); - $log->message('Test line 2'); - $messages = file('../temp/test.log'); - $this->assertWantedPattern('/Test line 2/', $messages[1]); - } -} -]]> - Le test reste vert. Nous pouvons continuer - ajouter des mthodes sans test au scnario, - il suffit que leur nom ne commence pas par - la chane "test". - Seules les mthodes commenant par "test" sont excutes. - Nous pouvons donc continuer le remaniement... -UnitTestCase('Log class test'); - } - function setUp() { - @unlink('../temp/test.log'); - } - function tearDown() { - @unlink('../temp/test.log'); - } - function getFileLine($filename, $index) { - $messages = file($filename); - return $messages[$index]; - } - function testCreatingNewFile() { - $log = new Log('../temp/test.log'); - $this->assertFalse(file_exists('../temp/test.log'), 'Created before message'); - $log->message('Should write this to a file'); - $this->assertTrue(file_exists('../temp/test.log'), 'File created'); - } - function testAppendingToFile() { - $log = new Log('../temp/test.log'); - $log->message('Test line 1'); - $this->assertWantedPattern('/Test line 1/', $this->getFileLine('../temp/test.log', 0)); - $log->message('Test line 2'); - $this->assertWantedPattern('/Test line 2/', $this->getFileLine('../temp/test.log', 1)); - } -} -]]> - Que vous prfriez cette version ou la prcdente ne dpend - que de votre got personnel. - Il y a un peu plus de code dans cette dernire - mais la logique du test est plus claire. -

-
-
-

- Un scnario de test ne fonctionne pas tout seul - pendant trs longtemps. - Quand on code pour de vrai nous souhaitons excuter - un maximum de tests aussi souvent - et aussi rapidement que possible. - a veut dire les grouper dans des suites de tests - qui incluent l'ensemble des tests de l'application. -

-

- Premirement nous devons supprimer le code d'excution - des tests se trouvant dans notre scnario de test. - -require_once('../classes/log.php'); - -class TestOfLogging extends UnitTestCase { - ... -} -?> -]]> - Nous n'avons plus besoin de la constante - SIMPLE_TEST. - Ensuite nous crons un groupe de tests appel - all_tests.php dans le rpertoire tests... -addTestCase(new TestOfLogging()); - $test->run(new HtmlReporter()); -?> -]]> - Il n'y a presque de pas de diffrence tant que les choses marchent... -

-

All tests

-
1/1 test cases complete. - 4 passes and 0 fails.
-
- Les tests du groupe s'ajoutent au compteur - des scnarios de test. Ajouter des nouveaux scnarios - de test est trs simple. - Il suffit d'inclure le fichier d'un scnario - et d'ajouter individuellement tous les scnarios autonomes. - Vous pouvez aussi emboter les groupes de test - les uns dans les autres (tout en faisant bien attention d'viter les boucles). -

-

- Dans la page suivante - nous les ajouterons encore plus rapidement. -

-
-
- - - Ajouter un autres test au scnario existant et remanier. - - - La technique brute pour grouper des tests unitaires. - - - - - Ensuite - vient le contrle de comment la classe sous le test interagit - avec le reste du systme. - - - Avant - il y a la cration du premier test. - - - Vous aurez besoin de SimpleTest - pour excuter ces exemples. - - - - - dveloppement logiciel, - programmation php, - outils de dveloppement logiciel, - tutorial php, - scripts php gratuits, - pilotage par les tests, - architecture, - ressouces php, - objets fantaisie, - junit, - test php, - test unitaire, - phpunit, - test unitaire php - - -
- diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/improving_design_tutorial.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/improving_design_tutorial.xml deleted file mode 100644 index b2e3686..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/improving_design_tutorial.xml +++ /dev/null @@ -1,218 +0,0 @@ - - - - - - tutoriel de test unitaire en PHP - Conception du haut vers le bas, tester d'abord avec des objets fantaisie - - -
-

- J'ai menti. -

-

- Je n'ai pas cr de test pour le scripteur, - uniquement l'interface FileWriter - que j'ai affich plus tt. - En fait je vais encore m'loigner d'un article fini - et prsumer l'existence un scripteur abstrait - dans classes/writer.php... -Writer { - - function Writer() { - } - - function write($message) { - } -} -?> -]]> - Les changements correspondant au niveau du test sont... - -Mock::generate('Writer'); - -class TestOfLogging extends UnitTestCase { - function TestOfLogging() { - $this->UnitTestCase('Log class test'); - } - function testWriting() { - $clock = &new MockClock($this); - $clock->setReturnValue('now', 'Timestamp'); - $writer = &new MockWriter($this); - $writer->expectOnce('write', array('[Timestamp] Test line')); - $log = &new Log($writer); - $log->message('Test line', &$clock); - $writer->tally(); - } -} -?> -]]> - Afin d'utiliser la classe de log, nous aurions besoin - de coder un scripteur de fichier - ou un autre type de scripteur - - mais pour le moment nous ne faisons que des tests - et nous n'en avons pas encore besoin. - En d'autres termes, en utilisant des objets fantaisie - nous pouvons dcaler la cration d'un objet - de niveau plus bas jusqu'au moment opportun. - Non seulement nous pouvons faire la conception du haut vers le bas, - mais en plus nous pouvons aussi tester du haut vers le bas. -

-
-
-

- Imaginez pour un moment que nous ayons commenc la classe de log - partir d'une autre direction. - Simulez avoir crit juste assez du Log - pour avoir raliser le besoin d'un Writer. - Comme l'aurions-nous inclus ? -

-

- Bon, l'hritage du scripteur ne nous aurait pas - permis de le simuler du point de vue des tests. - De celui de la conception nous aurions t restreint - un unique scripteur sans hritage multiple. -

-

- Crer un scripteur interne, plutt qu'en le passant - au constructeur, en choisissant un nom de classe, - est possible, mais nous aurions moins de contrle - sur l'initialisation de l'objet fantaisie. - Du point de vue de la conception il aurait t - presque impossible de passer des paramtres - au scripteur dans tous les formats possibles - et envisageables. Vous auriez d restreindre - le scripteur un hash ou une chane complique - dcrivant tous les dtails de la cible. - Au mieux compliqu sans raison. -

-

- Utiliser une mthode fabrique pour crer le scripteur - intrieurement serait possible, mais a voudrait - dire le sous classer pour les tests de manire - remplacer la mthode fabrique par une autre mthode - renvoyant un leurre. Plus de boulot du point de vue des tests, - quoique toujours possible. Du point de vue de la conception, - a voudrait dire crer une nouvelle sous-classe de - log pour chaque type de scripteur. - Cela s'appelle une hirarchie de classe parallle - et fait bien entendu de la duplication. - Beurk. -

-

- A l'autre extrme, passer ou crer le scripteur - chaque message aurait t rptitif - et aurait rduit le code de la classe Log - une unique mthode, un signe certain - que toute la classe est devenue redondante. -

-

- Cette tension entre la facilit du test - et le refus de la rptition nous a permis - de trouver une conception la fois flexible et propre. - Vous vous souvenez de notre bref envie de l'hritage multiple ? - Nous l'avons remplac par du polymorphisme - (plein de scripteurs) et spar la hirarchie du journal - de celle de l'criture. - Nous relions les deux par agrgation travers - le plus simple Log. - Cette astuce est en fait un design pattern - (modle de conception) appel "Pont" ou "Bridge". -

-

- Donc nous avons t pouss par le code de test - (nous n'avons presque rien crit d'autre) vers un design pattern. - Pensez-y une seconde. Les tests amliorent - la qualit du code, coup sr dans mon cas, - mais il y a quelque chose de bien plus profond et plus puissant. -

-

- Les tests ont amlior la conception. -

-
-
-

- Crer un objet fantaisie est aussi simple - que de crer l'interface l'crit. - Si vous utilisez de l'UML ou d'autres outils - pour gnrer ces interfaces alors vous avez un chemin encore - plus flexible pour gnrer rapidement vos objets de test. - Mme sans, vous pouvez passer du dessin sur tableau blanc, - l'criture de l'objet fantaisie, - puis la gnration de l'interface qui nous renvoie - de nouveau au tableau blanc, le tout trs simplement. - Comme le remaniement, la conception, le code et les tests s'unifient. -

-

- Parce que les objets fantaisie travaillent du haut vers le bas, - ils peuvent tre amens dans la conception plus rapidement - qu'un remaniement classique qui demande - quant lui du code fonctionnel avant de pourvoir s'installer. - a veut dire que le code de test interagit plus vite - avec la conception : par consquent la qualit - de la conception augmente elle aussi plus vite. -

-

- Un testeur unitaire est un outil de code. - Un testeur unitaire avec objet fantaisie est un outil de conception. -

-
-
- - - Simuler maintenant, coder plus tard. - - - Nous drivons vers le design pattern bridge. - - - Conception et test main dans la main. - - - - - Ce tutorial suit - les classes frontire. - - - Vous aurez besoin du - framework de test SimpleTest - pour essayer ces exemples. - - - Pour des discussions plus fournis sur - les objets fantaisie, voyez le - - Wiki des Extreme Tuesday - ou le Wiki C2 - (en anglais tous les deux). - - - - - dveloppement logiciel, - tutoriel de programmation php, - scnarios de test en php, - outils de dveloppement logiciel, - tutorial php, - scripts php gratuits, - architecture, - exemple php, - exemple d'objet fantaisie, - test style junit, - architecture logicielle pour des tests, - framework de test en php, - test unitaire, - objet fantaisie en php - test php, - suite de test php - - -
- diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/index.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/index.xml deleted file mode 100644 index 501897e..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/index.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - Les articles de :: onpk :: sur php / simpletest : traductions en franais des articles publis sur Lastcraft.com - - - -

- Cette section rassemble l'ensemble des articles et documentations pour SimpleTest traduits en franais. -

-
-
-

- J'ai commenc par dcouvrir l'Extreme Programming via le web. Ensuite j'ai gagn un livre en franais sur XP. Et dcouvrant la confiance supplmentaire gagne via les tests unitaires et de recette, je suis devenu "test-infected". -

-

- Aprs avoir got aux joies de SimpleTest, j'ai contact Marcus Baker -- responsable du projet -- pour lui proposer de traduire en franais la page d'introduction, puis les tutoriaux et finalement toute la documentation. Un travail qui n'aurait pas t possible sans l'aide de quelques relecteurs bienveillants : Jrmie C., David B., Emmanuel G., Olivier L. et Cdric G. (dans le dsordre). -

-

- Si vous lisez attentivement ces quelques pages et que vous y trouvez encore des fautes d'orthographe, pensez me les renvoyer : comme a le prochain ne pourra pas se dire la mme chose. -

-
-
-

- J'ai un blog -- :: onpk ::, une entreprise -- No Parking dont le produit phare est openTIME. Dans la communaut je me ballade du ct de l'AFUP, des apros PHP et des praticiens XP. -

-
-
-

-

-
-
- - - Comment en arrive-t-on au dveloppement pilot par les tests ? - - - Et en dehors des tests ? - - - Tous les articles - - - - - SimpleTest -- l'original en anglais. - - - - - dveloppement logiciel, - programmation php, - outils de dveloppement logiciel, - tutorial php, - scripts php gratuits, - conseil de test, - architecture logicielle pour des tests, - exemple de code php, - junit, - test php, - outil de test unitaire, - suite de test php - - - Des articles (documentations et tutoriels) pour dcouvrir le dveloppement agile en PHP avec le framework de tests unitaires SimpleTest. - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/intro.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/intro.xml deleted file mode 100644 index ceacc63..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/intro.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Les articles de :: onpk :: sur php / simpletest : traductions en franais des articles publis sur Lastcraft.com - - - -

- Le testeur unitaire SimpleTest PHP a enfin atteint la dlicate version 1.0 : il est disponible au tlchargement chez votre SourceForge le plus proche. -

-

- Il s'agit d'un testeur unitaire PHP et aussi d'un testeur web. Il est construit pour tre extensible de plusieurs manires. Les utilisateurs de JUnit seront familiers avec la plupart des interfaces. L'affichage des tests est largement modifiable tout comme le scnario de test de base. Par ailleurs les objets fantaisie peuvent tre utiliss avec d'autres testeurs unitaires. -

-

- Les fonctionnalits -la-JWebUnit sont plus compltes aussi. Il y a le support pour SSL, les fentres, les proxies, l'authentification simple et un large choix de contrles HTML. L'ide est que les tches fastidieuses en PHP, se connecter un site par exemple, puissent tre testes facilement. -

-
-
- - - dveloppement logiciel, - programmation php, - outils de dveloppement logiciel, - tutorial php, - scripts php gratuits, - conseil de test, - architecture logicielle pour des tests, - exemple de code php, - junit, - test php, - outil de test unitaire, - suite de test php - - - Des articles (documentations et tutoriels) pour dcouvrir le dveloppement agile en PHP avec le framework de tests unitaires SimpleTest. - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/logiciels_utilisant_simpletest.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/logiciels_utilisant_simpletest.xml deleted file mode 100644 index de0f9c1..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/logiciels_utilisant_simpletest.xml +++ /dev/null @@ -1,121 +0,0 @@ - - - - Logiciels utilisant SimpleTest - -
-

- Il y a un certain nombre de projets qui étendent les fonctionnalités - de SimpleTest : -

-
-
- - SimpleTestXUL - -
-
- - Limb Unit - -
-
- - Stagehand_TestRunner - -
-
- - Suite Tester - -
- -
-
-
-

- D'autres se servent de SimpleTest pour construire leurs projets : -

-
-
- - Jelix - framework PHP5 - -
-
- Jelix est un framework pour PHP5 qui permet de développer tout type - d'application. Performant, il est conçu pour les sites à forte charge; - entièrement objet, il est fortement modulaire et extensible. - En outre ils basé sur des modèles de conception connus dont MVC, DAO.. - et prend en charge de nombreux formats de sortie : - XHTML, XUL, RSS, ATOM, RDF, ZIP, XML, PDF, etc. -
-
- - Copix, Framework PHP - -
-
- Copix est un framework pour PHP qui existe depuis maintenant plus de 6 ans. - Copix est un projet libre (LGPL) mature utilisé sur de très nombreux sites. -
-
- - CakePHP - -
-
- - Web Application Component Toolkit - -
-
- - Limb3 - -
-
- - Drupal | SimpleTest - -
-
- - WideImage - -
-
- - Aperiplus - -
-
- - Flux CMS - -
-
- - Moodle - -
-
-
-
- - - Projects extending SimpleTest - - - "Projects using SimpleTest - - - - - - - - - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/mock_objects_documentation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/mock_objects_documentation.xml deleted file mode 100644 index d4c5ee9..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/mock_objects_documentation.xml +++ /dev/null @@ -1,729 +0,0 @@ - - - - - Documentation SimpleTest : les objets fantaise - -
-

- Les objets fantaisie - ou "mock objects" en anglais - - ont deux rles pendant un scnario de test : acteur et critique. -

-

- Le comportement d'acteur est celui de simuler - des objets difficiles initialiser ou trop consommateurs - en temps pendant un test. - Le cas classique est celui de la connexion une base de donnes. - Mettre sur pied une base de donnes de test au lancement - de chaque test ralentirait considrablement les tests - et en plus exigerait l'installation d'un moteur - de base de donnes ainsi que des donnes sur la machine de test. - Si nous pouvons simuler la connexion - et renvoyer des donnes notre guise - alors non seulement nous gagnons en pragmatisme - sur les tests mais en sus nous pouvons nourrir - notre base avec des donnes falsifies - et voir comment il rpond. Nous pouvons - simuler une base de donnes en suspens ou - d'autres cas extrmes sans avoir crer - une vritable panne de base de donnes. - En d'autres termes nous pouvons gagner - en contrle sur l'environnement de test. -

-

- Si les objets fantaisie ne se comportaient que comme - des acteurs alors on les connatrait sous le nom de - bouchons serveur. -

-

- Cependant non seulement les objets fantaisie jouent - un rle (en fournissant la demande les valeurs requises) - mais en plus ils sont aussi sensibles aux messages qui - leur sont envoys (par le biais d'attentes). - En posant les paramtres attendus d'une mthode - ils agissent comme des gardiens : - un appel sur eux doit tre ralis correctement. - Si les attentes ne sont pas atteintes ils nous pargnent - l'effort de l'criture d'une assertion de test avec - chec en ralisant cette tche notre place. - Dans le cas d'une connexion une base de donnes - imaginaire ils peuvent tester si la requte, disons SQL, - a bien t form par l'objet qui utilise cette connexion. - Mettez-les sur pied avec des attentes assez prcises - et vous verrez que vous n'aurez presque plus d'assertion crire manuellement. -

-
-
-

- Comme pour la cration des bouchons serveur, tout ce dont - nous avons besoin c'est d'un classe existante. - La fameuse connexion une base de donnes qui ressemblerait ... -class DatabaseConnection { - function DatabaseConnection() { - } - - function query() { - } - - function selectQuery() { - } -} -]]> - Cette classe n'a pas encore besoin d'tre implmente. - Pour en crer sa version fantaisie nous devons juste - inclure la librairie d'objet fantaisie puis lancer le gnrateur... -require_once('simpletest/unit_tester.php'); -require_once('simpletest/mock_objects.php'); -require_once('database_connection.php'); - -Mock::generate('DatabaseConnection'); -]]> - Ceci gnre une classe clone appele MockDatabaseConnection. - Nous pouvons dsormais crer des instances de - cette nouvelle classe l'intrieur mme de notre scnario de test... - -class MyTestCase extends UnitTestCase { - - function testSomething() { - $connection = &new MockDatabaseConnection($this); - } -} -]]> - Contrairement aux bouchons, le constructeur - d'une classe fantaisie a besoin d'une rfrence au scnario - de test pour pouvoir transmettre les succs - et les checs pendant qu'il vrifie les attentes. - Concrtement a veut dire que les objets fantaisie - ne peuvent tre utiliss qu'au sein d'un scnario de test. - Malgr tout, cette puissance supplmentaire implique - que les bouchons ne sont que rarement utiliss - si des objets fantaisie sont disponibles. -

-
-
-

- La version fantaisie d'une classe contient - toutes les mthodes de l'originale. - De la sorte une opration comme - query()]]> - est encore possible. - Tout comme avec les bouchons, nous pouvons remplacer - la valeur nulle renvoye par dfaut... -$connection->setReturnValue('query', 37); -]]> - Dsormais chaque appel de - query()]]> - nous recevons comme rsultat 37. - Tout comme avec les bouchons nous pouvons utiliser - des jokers et surcharger le paramtre joker. - Nous pouvons aussi ajouter des mthodes supplmentaires - l'objet fantaisie lors de sa gnration - et lui choisir un nom de classe qui lui soit propre... -Mock::generate('DatabaseConnection', 'MyMockDatabaseConnection', array('setOptions')); -]]> - Ici l'objet fantaisie se comportera comme - si setOptions() existait dans la classe originale. - C'est pratique si une classe a utilis le mcanisme - overload() de PHP pour ajouter des mthodes dynamiques. - Vous pouvez crer des fantaisies spciales pour simuler cette situation. -

-

- Tous les modles disponibles avec les bouchons serveur - le sont galement avec les objets fantaisie... - - Une nouvelle fois, supposons que cet itrateur - ne retourne que du texte jusqu'au moment o il atteint - son terme, quand il renvoie false. - Nous pouvons le simuler avec... - - $iterator = &new MockIterator($this); - $iterator->setReturnValue('next', false); - $iterator->setReturnValueAt(0, 'next', 'First string'); - $iterator->setReturnValueAt(1, 'next', 'Second string'); - ... - } -} -]]> - Au moment du premier appel next() - sur l'itrateur fantaisie il renverra tout d'abord - "First string", puis ce sera au tour de - "Second string" au deuxime appel - et ensuite pour tout appel suivant false - sera renvoy. - Ces valeurs renvoyes successivement sont prioritaires - sur la valeur constante retourne. - Cette dernire est un genre de valeur par dfaut si vous voulez. -

-

- Reprenons aussi le conteneur d'information bouchonn - avec des pairs clef / valeur... - - Il s'agit l d'une situation classique - d'utilisation d'objets fantaisie tant donn - que la configuration peut varier grandement de machine machine : - a contraint fortement la fiabilit de nos tests - si nous l'utilisons directement. - Le problme est que toutes les donnes nous parviennent - travers la mthode getValue() - et que nous voulons des rsultats diffrents pour des clefs diffrentes. - Heureusement les objets fantaisie ont un systme de filtrage... -$config = &new MockConfiguration($this); -$config->setReturnValue('getValue', 'primary', array('db_host')); -$config->setReturnValue('getValue', 'admin', array('db_user')); -$config->setReturnValue('getValue', 'secret', array('db_password')); -]]> - Le paramtre en plus est une liste d'arguments - faire correspondre. Dans ce cas nous essayons - de faire correspondre un unique argument : - en l'occurrence la clef recherche. - Maintenant que la mthode getValue() - est invoque sur l'objet fantaisie... -getValue('db_user') -]]> - ...elle renverra "admin". - Elle le trouve en essayant de faire correspondre - les arguments entrants dans sa liste - d'arguments sortants les uns aprs les autres - jusqu'au moment o une correspondance exacte est atteinte. -

-

- Il y a des fois o vous souhaitez - qu'un objet spcifique soit servi par la fantaisie - plutt qu'une copie. - De nouveau c'est identique au mcanisme des bouchons serveur... - - Dans ce cas vous pouvez placer une rfrence - dans la liste renvoye par l'objet fantaisie... - -$vector = &new MockVector($this); -$vector->setReturnReference('get', $thing, array(12)); -]]> - Avec cet arrangement vous savez qu' chaque appel - de get(12)]]> - le mme $thing sera renvoy. -

-
-
-

- Mme si les bouchons serveur vous isolent - du dsordre du monde rel, il ne s'agit l que - de la moiti du bnfice potentiel. - Vous pouvez avoir une classe de test recevant - les messages ad hoc, mais est-ce que votre nouvelle classe - renvoie bien les bons ? - Le tester peut devenir cafouillis sans une librairie d'objets fantaisie. -

-

- Pour l'exemple, prenons une classe SessionPool - laquelle nous allons ajouter une fonction de log. - Plutt que de complexifier la classe originale, - nous souhaitons ajouter ce comportement avec un dcorateur (GOF). - Pour l'instant le code de SessionPool ressemble ... -class SessionPool { - function SessionPool() { - ... - } - - function &findSession($cookie) { - ... - } - ... -} - -class Session { - ... -} -]]> - - Alors que pour notre code de log, nous avons... - -class Log { - function Log() { - ... - } - - function message() { - ... - } -} - -class LoggingSessionPool { - function LoggingSessionPool(&$session_pool, &$log) { - ... - } - - function &findSession($cookie) { - ... - } - ... -} -]]> - Dans tout ceci, la seule classe tester est - LoggingSessionPool. En particulier, - nous voulons vrifier que la mthode findSession() - est appele avec le bon identifiant de session au sein du cookie - et qu'elle renvoie bien le message "Starting session $cookie" - au loggueur. -

-

- Bien que nous ne testions que quelques lignes - de code de production, voici la liste des choses - faire dans un scnario de test conventionnel : -

    -
  1. Crer un objet de log.
  2. -
  3. Indiquer le rpertoire d'criture du fichier de log.
  4. -
  5. Modifier les droits sur le rpertoire pour pouvoir y crire le fichier.
  6. -
  7. Crer un objet SessionPool.
  8. -
  9. Lancer une session, ce qui demande probablement pas mal de choses.
  10. -
  11. Invoquer findSession().
  12. -
  13. Lire le nouvel identifiant de session (en esprant qu'il existe un accesseur !).
  14. -
  15. Lever une assertion de test pour vrifier que cet identifiant correspond bien au cookie.
  16. -
  17. Lire la dernire ligne du fichier de log.
  18. -
  19. Supprimer avec une (ou plusieurs) expression rationnelle les timestamps de log en trop, etc.
  20. -
  21. Vrifier que le message de session est bien dans le texte.
  22. -
- Pas tonnant que les dveloppeurs dtestent - crire des tests quand ils sont aussi ingrats. - Pour rendre les choses encore pire, chaque fois que - le format de log change ou bien que la mthode de cration - des sessions change, nous devons rcrire une partie - des tests alors mme qu'ils ne testent pas ces parties - du systme. Nous sommes en train de prparer - le cauchemar pour les dveloppeurs de ces autres classes. -

-

- A la place, voici la mthode complte pour le test - avec un peu de magie via les objets fantaisie... - - $session = &new MockSession($this); - $pool = &new MockSessionPool($this); - $pool->setReturnReference('findSession', $session); - $pool->expectOnce('findSession', array('abc')); - - $log = &new MockLog($this); - $log->expectOnce('message', array('Starting session abc')); - - $logging_pool = &new LoggingSessionPool($pool, $log); - $this->assertReference($logging_pool->findSession('abc'), $session); - $pool->tally(); - $log->tally(); - } -} -]]> - Commenons par crire une session simulacre. - Pas la peine d'tre trop pointilleux avec - celle-ci puisque la vrification de la session - dsire est effectue ailleurs. Nous avons - juste besoin de vrifier qu'il s'agit de - la mme que celle qui vient du groupe commun des sessions. -

-

- findSession() est un mthode fabrique - dont la simulation est dcrite plus haut. - Le point de dpart vient avec le premier appel - expectOnce(). Cette ligne indique - qu' chaque fois que findSession() - est invoqu sur l'objet fantaisie, il vrifiera - les arguments entrant. S'il ne reoit - que la chane "abc" en tant qu'argument - alors un succs est envoy au testeur unitaire, - sinon c'est un chec qui est gnr. - Il s'agit l de la partie qui teste si nous avons bien - la bonne session. La liste des arguments suit - une format identique celui qui prcise les valeurs renvoyes. - Vous pouvez avoir des jokers et des squences - et l'ordre de l'valuation restera le mme. -

-

- Si l'appel n'est jamais effectu alors n'est gnr - ni le succs, ni l'chec. Pour contourner cette limitation, - nous devons dire l'objet fantaisie que le test est termin : - il pourra alors dcider si les attentes ont t rpondues. - L'assertion du testeur unitaire de ceci est dclenche - par l'appel tally() la fin du test. -

-

- Nous utilisons le mme modle pour mettre sur pied - le loggueur fantaisie. Nous lui indiquons que message() - devrait tre invoqu une fois et une fois seulement - avec l'argument "Starting session abc". - En testant les arguments d'appel, plutt que ceux de sortie du loggueur, - nous isolons le test de tout modification dans le loggueur. -

-

- Nous commenons le lancement nos tests la cration - du nouveau LoggingSessionPool - et nous l'alimentons avec nos objets fantaisie juste crs. - Dsormais tout est sous contrle. Au final nous confirmons - que le $session donn au dcorateur est bien - celui reu et prions les objets fantaisie de lancer leurs - tests de comptage d'appel interne avec les appels tally(). -

-

- Il y a encore pas mal de code de test, mais ce code est trs strict. - S'il vous semble encore terrifiant il l'est bien moins - que si nous avions essay sans les objets fantaisie - et ce test en particulier, interactions plutt que rsultat, - est toujours plus difficile mettre en place. - Le plus souvent vous aurez besoin de tester des situations - plus complexes sans ce niveau ni cette prcision. - En outre une partie peut tre remanie avec la mthode - de scnario de test setUp(). -

-

- Voici la liste complte des attentes que vous pouvez - placer sur un objet fantaisie avec - SimpleTest... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttenteNcessite tally()
expectArguments($method, $args)Non
expectArgumentsAt($timing, $method, $args)Non
expectCallCount($method, $count)Oui
expectMaximumCallCount($method, $count)Non
expectMinimumCallCount($method, $count)Oui
expectNever($method)Non
expectOnce($method, $args)Oui
expectAtLeastOnce($method, $args)Oui
- O les paramtres sont... -

-
$method
-
Le nom de la mthode, sous la forme d'une chane, - laquelle la condition doit tre applique.
-
$args
-
- Les arguments sous la forme d'une liste. - Les jokers peuvent tre inclus de la mme manire - qu'avec setReturn(). - Cet argument est optionnel pour expectOnce() - et expectAtLeastOnce(). -
-
$timing
-
- Le seul point dans le temps pour tester - la condition. Le premier appel commence zro. -
-
$count
-
Le nombre d'appels attendu.
-
- La mthode expectMaximumCallCount() - est lgrement diffrente dans le sens o elle ne pourra - gnrer qu'un chec. Elle reste silencieuse - si la limite n'est jamais atteinte. -

-

- Par ailleurs si vous avez just un appel dans votre test, - vrifiez bien que vous utiliser - expectOnce.
- Utiliser $mocked->expectAt(0, 'method', 'args); - tout seul ne sera pas pris en compte : - la vrification des arguments et le comptage total - sont pour l'instant encore indpendant. -

-

- Comme avec les assertions dans les scnarios de test, - toutes ces attentes peuvent accepter une surcharge de - message sous la forme d'un paramtre supplmentaire. - Par ailleurs le message d'chec original peut tre inclus - dans le rsultat avec "%s". -

-
-
-

- Il existe trois approches pour crer des objets - fantaisie en comprenant celle utilise par SimpleTest. - Les coder la main en utilisant une classe de base, - les gnrer dans un fichier ou les gnrer dynamiquement la vole. -

-

- Les objets fantaisie gnrs avec - SimpleTest sont dynamiques. - Ils sont crs l'excution dans la mmoire, - grce eval(), plutt qu'crits dans un fichier. - Cette opration les rend facile crer, - en une seule ligne, surtout par rapport leur cration - la main dans une hirarchie de classe parallle. - Le problme avec ce comportement tient gnralement - dans la mise en place des tests proprement dits. - Si les objets originaux changent les versions fantaisie - sur lesquels reposent les tests, une dsynchronisation peut subvenir. - Cela peut aussi arriver avec l'approche en hirarchie parallle, - mais c'est dtect beaucoup plus vite. -

-

- Bien sr, la solution est d'ajouter de vritables tests d'intgration. - Vous n'en avez pas besoin de beaucoup - et le ct pratique des objets fantaisie fait plus - que compenser la petite dose de test supplmentaire. - Vous ne pouvez pas avoir confiance dans du code qui - ne serait test que par des objets fantaisie. -

-

- Si vous restez dtermin de construire des librairies - statiques d'objets fantaisie parce que vous souhaitez - muler un comportement trs spcifique, - vous pouvez y parvenir grce au gnrateur de classe de SimpleTest. - Dans votre fichier librairie, par exemple - mocks/connection.php pour une connexion une base de donnes, - crer un objet fantaisie et provoquer l'hritage - pour hriter pour surcharger des mthodes spciales - ou ajouter des prrglages... - - Mock::generate('Connection', 'BasicMockConnection'); - class MockConnection extends BasicMockConnection { - function MockConnection(&$test, $wildcard = '*') { - $this->BasicMockConnection($test, $wildcard); - $this->setReturn('query', false); - } - } -?> -]]> - L'appel generate dit au gnrateur de classe - d'en crer une appele BasicMockConnection - plutt que la plus courante MockConnection. - Ensuite nous hritons partir de celle-ci pour obtenir - notre version de MockConnection. - En interceptant de cette manire nous pouvons ajouter - un comportement, ici transformer la valeur par dfaut de - query() en "false". - En utilisant le nom par dfaut nous garantissons - que le gnrateur de classe fantaisie n'en recrera - pas une autre diffrente si il est invoqu ailleurs - dans les tests. Il ne crera jamais de classe - si elle existe dj. Aussi longtemps que le fichier - ci-dessus est inclus avant alors tous les tests qui - gnraient MockConnection devraient - utiliser notre version prsent. Par contre si - nous avons une erreur dans l'ordre et que la librairie - de fantaisie en cre une d'abord alors la cration - de la classe chouera tout simplement. -

-

- Utiliser cette astuce si vous vous trouvez avec beaucoup - de comportement en commun sur les objets fantaisie - ou si vous avez de frquents problmes d'intgration - plus tard dans les tapes de test. -

-
-
-

- Mais au moment d'crire ces lignes c'est le seul - grer les objets fantaisie, donc vous tes bloqu avec lui ? -

-

- Non, pas du tout. - SimpleTest est une bote outils - et parmi ceux-ci on trouve les objets fantaisie - qui peuvent tre utiliss indpendamment. - Supposons que vous avez votre propre testeur unitaire favori - et que tous vos tests actuels l'utilisent. - Prtendez que vous avez appel votre tester unitaire PHPUnit - (c'est ce que tout le monde a fait) et que la classe principale - de test ressemble ... - - La seule chose que la mthode assertion() ralise, - c'est de prparer une sortie embellie alors le paramtre boolien - de l'assertion sert dterminer s'il s'agit d'une erreur ou d'un succs. - Supposons qu'elle est utilise de la manire suivante... -assertion('I hope this file exists', file_exists('my_file')); -]]> - Comment utiliser les objets fantaisie avec ceci ? -

-

- Il y a une mthode protge sur la classe de base - des objets fantaisie : elle s'appelle _assertTrue(). - En surchargeant cette mthode nous pouvons utiliser - notre propre format d'assertion. - Nous commenons avec une sous-classe, dans my_mock.php... -SimpleMock($test, $wildcard); - } - - function _assertTrue($assertion, $message) { - $test = &$this->getTest(); - $test->assertion($message, $assertion); - } - } -?> -]]> - Maintenant une instance de MyMock - crera un objet qui parle le mme langage que votre testeur. - Bien sr le truc c'est que nous crons jamais un tel objet : - le gnrateur s'en chargera. Nous avons juste besoin - d'une ligne de code supplmentaire pour dire au gnrateur - d'utiliser vos nouveaux objets fantaisie... -SimpleMock(&$test, $wildcard); - } - - function _assertTrue($assertion, $message , &$test) { - $test->assertion($message, $assertion); - } - } - SimpleTestOptions::setMockBaseClass('MyMock'); -?> -]]> - A partir de maintenant vous avez juste inclure - my_mock.php la place de la version par dfaut - simple_mock.php et vous pouvez introduire - des objets fantaisie dans votre suite de tests existants. -

-
-
- - - Que sont les objets fantaisie ? - - - Crer des objets fantaisie. - - - L'objet fantaisie - acteur ou bouchon. - - - L'objet fantaisie - critique avec des attentes. - - - D'autres approches - y compris des librairies d'objets fantaisie. - - - Utiliser les objets fantaisie avec - d'autres testeurs unitaires. - - - - - L'article originel sur - les objets fantaisie. - - - La page du projet SimpleTest sur - SourceForge. - - - La page d'accueil de SimpleTest sur - LastCraft. - - - - - dveloppement logiciel, - programmation en php, - outils de dveloppement logiciel, - tutoriel php, - scripts php gratuits, - architecture, - ressources php, - mock objects, - objets fantaisie, - junit, - test php, - test unitaire, - tester en php - - -
- diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/mock_objects_tutorial.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/mock_objects_tutorial.xml deleted file mode 100644 index b168d41..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/mock_objects_tutorial.xml +++ /dev/null @@ -1,374 +0,0 @@ - - - - - tutorial sur les tests unitaires en PHP - Utiliser les objets fantaisie en PHP - -
-

- Avant d'ajouter de nouvelles fonctionnalits - il y a du remaniement faire. - Nous allons effectuer des tests chronomtrs - et la classe TimeTestCase a dfinitivement - besoin d'un fichier propre. - Appelons le tests/time_test_case.php... -UnitTestCase($test_name); - } - function assertSameTime($time1, $time2, $message = '') { - if (! $message) { - $message = "Time [$time1] should match time [$time2]"; - } - $this->assertTrue( - ($time1 == $time2) || ($time1 + 1 == $time2), - $message); - } -} -?> -]]> - Nous pouvons lors utiliser require() - pour incorporer ce fichier dans le script all_tests.php. -

-
-
-

- Je ne sais pas trop quel devrait tre - le format du message de log pour le test alors - pour vrifier le timestamp nous pourrions juste - faire la plus simple des choses possibles, - c'est dire rechercher une suite de chiffres. - -require_once('../classes/clock.php'); - -class TestOfLogging extends TimeTestCase { - function TestOfLogging() { - $this->TimeTestCase('Log class test'); - } - function setUp() { - @unlink('../temp/test.log'); - } - function tearDown() { - @unlink('../temp/test.log'); - } - function getFileLine($filename, $index) { - $messages = file($filename); - return $messages[$index]; - } - function testCreatingNewFile() { - ... - } - function testAppendingToFile() { - ... - } - function testTimestamps() { - $log = new Log('../temp/test.log'); - $log->message('Test line'); - $this->assertTrue( - preg_match('/(\d+)/', $this->getFileLine('../temp/test.log', 0), $matches), - 'Found timestamp'); - $clock = new clock(); - $this->assertSameTime((integer)$matches[1], $clock->now(), 'Correct time'); - } -} -?> -]]> - Ce scnario de test cre un nouvel objet Log - et crit un message. Nous recherchons une suite de chiffres - et nous la comparons l'horloge prsente en utilisant - notre objet Clock. Bien sr a ne marche pas - avant d'avoir crit le code. -

-

All tests

- Pass: log_test.php->Log class test->testappendingtofile->Expecting [/Test line 1/] in [Test line 1]
- Pass: log_test.php->Log class test->testappendingtofile->Expecting [/Test line 2/] in [Test line 2]
- Pass: log_test.php->Log class test->testcreatingnewfile->Created before message
- Pass: log_test.php->Log class test->testcreatingnewfile->File created
- Fail: log_test.php->Log class test->testtimestamps->Found timestamp
-
- Notice: Undefined offset: 1 in /home/marcus/projects/lastcraft/tutorial_tests/tests/log_test.php on line 44
- Fail: log_test.php->Log class test->testtimestamps->Correct time
- Pass: clock_test.php->Clock class test->testclockadvance->Advancement
- Pass: clock_test.php->Clock class test->testclocktellstime->Now is the right time
-
3/3 test cases complete. - 6 passes and 2 fails.
-
- Cette suite de tests montre encore les succs - de notre modification prcdente. -

-

- Nous pouvons faire passer les tests en ajoutant - simplement un timestamp l'criture dans le fichier. - Oui, bien sr, tout ceci est assez trivial et d'habitude - je ne le testerais pas aussi fanatiquement, - mais a va illustrer un problme plus gnral... - Le fichier log.php devient... - -require_once('../classes/clock.php'); - -class Log { - var $_file_path; - - function Log($file_path) { - $this->_file_path = $file_path; - } - - function message($message) { - $clock = new Clock(); - $file = fopen($this->_file_path, 'a'); - fwrite($file, "[" . $clock->now() . "] $message\n"); - fclose($file); - } -} -?> -]]> - Les tests devraient passer. -

-

- Par contre notre nouveau test est plein de problmes. - Qu'est-ce qui se passe si notre format de temps change ? - Les choses vont devenir largement plus compliques - si a venait se produire. - Cela veut aussi dire que n'importe quel changement - du format de notre classe horloge causera aussi - un chec dans les tests de log. - Bilan : nos tests de log sont tout mlangs - avec les test d'horloge et par la mme trs fragiles. - Tester la fois des facettes de l'horloge - et d'autres du log manque de cohsion, - ou de focalisation tanche si vous prfrez. - Nos problmes sont causs en partie parce que - le rsultat de l'horloge est imprvisible alors que - l'unique chose tester est la prsence - du rsultat de Clock::now(). - Peu importe le contenu de l'appel de cette mthode. -

-

- Pouvons-nous rendre cet appel prvisible ? - Oui si nous pouvons forcer le loggueur utiliser - une version factice de l'horloge lors du test. - Cette classe d'horloge factice devrait se comporter - exactement comme la classe Clock - part une sortie fixe dans la mthode now(). - Et au passage, a nous affranchirait mme - de la classe TimeTestCase ! -

-

- Nous pourrions crire une telle classe assez - facilement mme s'il s'agit d'un boulot plutt fastidieux. - Nous devons juste crer une autre classe - d'horloge avec la mme interface sauf que - la mthode now() retourne une valeur modifiable - via une autre mthode d'initialisation. - C'est plutt pas mal de travail pour un test plutt mineur. -

-

- Sauf que a se fait sans aucun effort. -

-
-
-

- Pour atteindre le nirvana de l'horloge instantan - pour test nous n'avons besoin que de trois lignes de code supplmentaires... - - Cette instruction inclut le code de gnrateur - d'objet fantaisie. Le plus simple reste de le mettre - dans le script all_tests.php tant donn - qu'il est utilis assez frquemment. - - C'est la ligne qui fait le travail. - Le gnrateur de code scanne la classe, - en extrait toutes ses mthodes, cre le code - pour gnrer une classe avec une interface identique, - mais en ajoutant le nom "Mock" - et ensuite eval() le nouveau code pour crer la nouvelle classe. - - Cette ligne peut tre ajoute dans n'importe - quelle mthode de test qui nous intresserait. - Elle cre l'horloge fantaisie prte recevoir nos instructions. -

-

- Notre scnario de test en est ses premiers pas - vers un nettoyage radical... - -Mock::generate('Clock'); - -class TestOfLogging extends UnitTestCase { - function TestOfLogging() { - $this->UnitTestCase('Log class test'); - } - function setUp() { - @unlink('../temp/test.log'); - } - function tearDown() { - @unlink('../temp/test.log'); - } - function getFileLine($filename, $index) { - $messages = file($filename); - return $messages[$index]; - } - function testCreatingNewFile() { - ... - } - function testAppendingToFile() { - ... - } - function testTimestamps() { - $clock = &new MockClock($this); - $clock->setReturnValue('now', 'Timestamp'); - $log = new Log('../temp/test.log'); - $log->message('Test line', &$clock); - $this->assertWantedPattern( - '/Timestamp/', - $this->getFileLine('../temp/test.log', 0), - 'Found timestamp'); - } -} -?> -]]> - Cette mthode de test cre un objet MockClock - puis dfinit la valeur retourn par la mthode - now() par la chane "Timestamp". - A chaque fois que nous appelons $clock->now(), - elle retournera cette mme chane. - a devrait tre quelque chose de facilement reprable. -

-

- Ensuite nous crons notre loggueur et envoyons un message. - Nous incluons dans l'appel message() - l'horloge que nous souhaitons utiliser. - a veut dire que nous aurons ajouter un paramtre - optionnel la classe de log pour rendre ce test possible... -_file_path = $file_path; - } - - function message($message, $clock = false) { - if (!is_object($clock)) { - $clock = new Clock(); - } - $file = fopen($this->_file_path, 'a'); - fwrite($file, "[" . $clock->now() . "] $message\n"); - fclose($file); - } -} -]]> - Maintenant tous les tests passent et ils ne testent - que le code du loggueur. Nous pouvons nouveau respirer. -

-

- Est-ce que ce paramtre supplmentaire dans la classe Log - vous gne ? Nous n'avons chang l'interface que - pour faciliter les tests aprs tout. - Les interfaces ne sont-elles pas la chose la plus importante ? - Avons nous souill notre classe avec du code de test ? -

-

- Peut-tre, mais rflchissez ce qui suit. - A la prochaine occasion, - regardez une carte avec des circuits imprims, - peut-tre la carte mre de l'ordinateur que - ous regardez actuellement. Sur la plupart d'entre elles - vous trouverez un trou bizarre et vide - ou alors un point de soudure sans rien de fix - ou mme une pingle ou une prise sans aucune fonction vidente. - Peut-tre certains sont l en prvision d'une expansion - ou d'une variation future, mais la plupart n'y sont que pour les tests. -

-

- Pensez-y. Les usines qui fabriquent ces cartes imprimes - par centaine de milliers gaspillent des matires premires - sur des pices qui n'ajoutent rien la fonction finale. - Si les ingnieurs matriel peuvent faire quelques sacrifices - l'lgance, je suis sr que nous pouvons aussi le faire. - Notre sacrifice ne gaspille pas de matriel aprs tout. -

-

- a vous gne encore ? En fait moi aussi, mais pas tellement ici. - La priorit numro 1 reste du code qui marche, - pas un prix pour minimalisme. - Si a vous gne vraiment alors dplacez la cration - de l'horloge dans une autre mthode mre protge. - Ensuite sous classez l'horloge pour le test - et crasez la mthode mre avec une qui renvoie le leurre. - Vos tests sont bancals mais votre interface est intacte. -

-

- Une nouvelle fois je vous laisse la dcision finale. -

-
-
- - - Remanier les tests - dans le but de rutiliser notre nouveau test de temps. - - - Ajouter des timestamps de Log. - - - Crer une horloge fantaisie - pour rendre les tests cohsifs. - - - - - La section prcdente : - tutorial de test unitaire. - - - La section suivante : - les frontires de l'application. - - - Vous aurez besoin du - framework de test SimpleTest - pour essayer ces exemples. - - - Documents sur les objets fantaisie. - - - - - dveloppement logiciel, - programmation php, - outils de dveloppement logiciel, - tutoriel php, - scripts php gratuits, - architecture, - ressources php, - objet fantaisie, - junit, - phpunit, - simpletest, - test php, - outil de test unitaire, - suite de test php - - -
- diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/overview.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/overview.xml deleted file mode 100644 index 52b4b20..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/overview.xml +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - Aperu et liste des fonctionnalits des testeurs unitaires PHP et web de SimpleTest PHP - - -
-

- Le coeur de SimpleTest est un framework de test construit autour de classes de scnarios de test. Celles-ci sont crites comme des extensions des classes premires de scnarios de test, chacune largie avec des mthodes qui contiennent le code de test effectif. Les scripts de test de haut niveau invoque la mthode run() chaque scnario de test successivement. Chaque mthode de test est crite pour appeler des assertions diverses que le dveloppeur suppose tre vraies, assertEqual() par exemple. Si l'assertion est correcte, alors un succs est expdi au rapporteur observant le test, mais toute erreur dclenche une alerte et une description de la dissension. -

-

- Un scnario de test ressemble ... -MyTestCase extends UnitTestCase { - - function testLog() { - $log = &new Log('my.log'); - $log->message('Hello'); - $this->assertTrue(file_exists('my.log')); - } -} -]]> -

-

- Ces outils sont conus pour le dveloppeur. Les tests sont crits en PHP directement, plus ou moins simultanment avec la construction de l'application elle-mme. L'avantage d'utiliser PHP lui-mme comme langage de test est qu'il n'y a pas de nouveau langage apprendre, les tests peuvent commencer directement et le dveloppeur peut tester n'importe quelle partie du code. Plus simplement, toutes les parties qui peuvent tre accdes par le code de l'application peuvent aussi tre accdes par le code de test si ils sont tous les deux dans le mme langage. -

-

- Le type de scnario de test le plus simple est le UnitTestCase. Cette classe de scnario de test inclut les tests standards pour l'galit, les rfrences et l'appariement de motifs (via les expressions rationnelles). Ceux-ci testent ce que vous seriez en droit d'attendre du rsultat d'une fonction ou d'une mthode. Il s'agit du type de test le plus commun pendant le quotidien du dveloppeur, peut-tre 95% des scnarios de test. -

-

- La tche ultime d'une application web n'est cependant pas de produire une sortie correcte partir de mthodes ou d'objets, mais plutt de produire des pages web. La classe WebTestCase teste des pages web. Elle simule un navigateur web demandant une page, de faon exhaustive : cookies, proxies, connexions scurises, authentification, formulaires, cadres et la plupart des lments de navigation. Avec ce type de scnario de test, le dveloppeur peut garantir que telle ou telle information est prsente dans la page et que les formulaires ainsi que les sessions sont grs comme il faut. -

-

- Un scnario de test web ressemble ... -MySiteTest extends WebTestCase { - - function testHomePage() { - $this->get('http://www.my-site.com/index.php'); - $this->assertTitle('My Home Page'); - $this->clickLink('Contact'); - $this->assertTitle('Contact me'); - $this->assertWantedPattern('/Email me at/'); - } -} -]]> -

-
-
-

- Ci-dessous vous trouverez un canevas assez brut des fonctionnalits aujourd'hui et pour demain, sans oublier leur date approximative de publication. J'ai bien peur qu'il soit modifiable sans pr-avis tant donn que les jalons dpendent beaucoup sur le temps disponible. Les trucs en vert ont t cods, mais pas forcment dj rendus public. Si vous avez une besoin pressant pour une fonctionnalit verte mais pas encore publique alors vous devriez retirer le code directement sur le CVS chez SourceFourge. Une fonctionnalite publie est indiqu par "Fini". - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FonctionnalitDescriptionPublication
Scnariot de test unitaireLes classes de test et assertions de baseFini
Affichage HTMLL'affichage le plus simple possibleFini
Autochargement des scnarios de testLire un fichier avec des scnarios de test et les charger dans un groupe de tests automatiquementFini
Gnrateur de code d'objets fantaisieDes objets capable de simuler d'autres objets, supprimant les dpendances dans les testsFini
Bouchons serveurDes objets fantaisie sans rsultat attendu utiliser l'extrieur des scnarios de test, pour le prototypage par exemple.Fini
Intgration d'autres testeurs unitaires - La capacit de lire et simuler d'autres scnarios de test en provenance de PHPUnit et de PEAR::Phpunit.Fini
Scnario de test webAppariement basique de motifs dans une page tlcharge.Fini
Analyse de page HTMLPermet de suivre les liens et de trouver la balise de titreFini
Simulacre partielSimuler des parties d'une classe pour tester moins qu'une classe ou dans des cas complexes.Fini
Gestion des cookies WebGestion correcte des cookies au tlchargement d'une page.Fini
Suivi des redirectionsLe tlchargement d'une page suit automatiquement une redirection 300.Fini
Analyse d'un formulaireLa capacit de valider un formulaire simple et d'en lire les valeurs par dfaut.Fini
Interface en ligne de commandeAffiche le rsultat des tests sans navigateur web.Fini
Mise nu des attentes d'une classePeut crer des tests prcis avec des simulacres ainsi que des scnarios de test.Fini
Sortie et analyse XMLPermet de tester sur plusieurs htes et d'intgrer des extensions d'acceptation de test.Fini
Scnario de test en ligne de commandePermet de tester des outils ou scripts en ligne de commande et de manier des fichiers.Fini
Compatibilit avec PHP DocumentorGnration automatique et complte de la documentation au niveau des classes.Fini
Interface navigateurMise nu des niveaux bas de l'interface du navigateur web pour des scnarios de test plus prcis.Fini
Authentification HTTPTlchargement des pages web protges avec une authentification basique seulement.Fini
Boutons de navigation d'un navigateurArrire, avant et recommencerFini
Support de SSLPeut se connecter des pages de type https.Fini
Support de proxyPeut se connecter via des proxys communsFini
Support des cadresGre les cadres dans les scnarios de test web.Fini
Test de l'upload de fichierPeut simuler la balise input de type file1.0.1
Amlioration sur la machinerie des rapportsRetouche sur la transmission des messages pour une meilleur coopration avec les IDEs1.1
Amlioration de l'affichage des testsUne meilleure interface graphique web, avec un arbre des scnarios de test.1.1
LocalisationAbstraction des messages et gnration du code partir de fichiers XML.1.1
Simulation d'interfacePeut gnrer des objets fantaisie tant vers des interfaces que vers des classes.2.0
Test sur es exceptionsDans le mme esprit que sur les tests des erreurs PHP.2.0
Rercherche d'lments avec XPathPeut utiliser Tidy HTML pour un appariement plus rapide et plus souple.2.0
- La migration vers PHP5 commencera juste aprs la srie des 1.0, partir de l PHP4 ne sera plus support. SimpleTest est actuellement compatible avec PHP5 mais n'utilisera aucune des nouvelles fonctionnalits avant la version 2. -

-
-
-

- Le processus est au moins aussi important que les outils. Le type de procdure que fait un usage le plus intensif des outils de test pour dveloppeur est bien sr l'Extreme Programming. Il s'agit l d'une des mthodes agiles qui combinent plusieurs pratiques pour "lisser la courbe de cot" du dveloppement logiciel. La plus extrme reste le dveloppement pilot par les tests, o vous devez adhrer la rgle du pas de code avant d'avoir un test. Si vous tes plutt du genre planninficateur ou que vous estimez que l'exprience compte plus que l'volution, vous prfrerez peut-tre l'approche RUP. Je ne l'ai pas test mais je peux voir o vous aurez besoin d'outils de test (cf. illustration 9). -

-

- La plupart des testeurs unitaires sont dans une certaine mesure un clone de JUnit, au moins dans l'interface. Il y a normment d'information sur le site de JUnit, commencer par la FAQ quie contient pas mal de conseils gnraux sur les tests. Une fois mordu par le bogue vous apprcierez srement la phrase infect par les tests trouve par Eric Gamma. Si vous tes encore en train de tergiverser sur un testeur unitaire, sachez que les choix principaux sont PHPUnit et Pear PHP::PHPUnit. De nombreuses fonctionnalits de SimpleTest leurs font dfaut, mais la version PEAR a d'ores et dj t mise jour pour PHP5. Elle est aussi recommande si vous portez des scnarios de test existant depuis JUnit. -

-

- Les dveloppeurs de bibliothque n'ont pas l'air de livrer trs souvent des tests avec leur code : c'est bien dommage. Le code d'une bibliothque qui inclut des tests peut tre remani avec plus de scurit et le code de test sert de documentation additionnelle dans un format assez standard. Ceci peut pargner la pche aux indices dans le code source lorsque qu'un problme survient, en particulier lors de la mise jour d'une telle bibliothque. Parmi les bibliothques utilisant SimpleTest comme testeur unitaire on retrouve WACT et PEAR::XML_HTMLSax. -

-

- Au jour d'aujourd'hui il manque tristement beaucoup de matire sur les objets fantaisie : dommage, surtout que tester unitairement sans eux reprsente pas mal de travail en plus. L'article original sur les objets fantaisie est trs orient Java, mais reste intressant lire. Etant donn qu'il s'agit d'une nouvelle technologie il y a beaucoup de discussions et de dbats sur comment les utiliser, souvent sur des wikis comme Extreme Tuesday ou www.mockobjects.comou the original C2 Wiki. Injecter des objets fantaisie dans une classe est un des champs principaux du dbat : cet article chez IBM en est un bon point de dpart. -

-

- Il y a normement d'outils de test web mais la plupart sont crits en Java. De plus les tutoriels et autres conseils sont plutt rares. Votre seul espoir est de regarder directement la documentation pour HTTPUnit, HTMLUnit ou JWebUnit et d'esprer y trouver pour des indices. Il y a aussi des frameworks bass sur XML, mais de nouveau la plupart ont besoin de Java pour tourner. -

-
-
- - - Rsum rapide de l'outil SimpleTest pour PHP. - - - La liste des fonctionnalites, la fois prsentes et venir. - - - Il y a beaucoup de ressources sur les tests unitaires sur le web. - - - - - Documentation pour SimpleTest. - - - Comment crire des scnarios de test en PHP est un tutoriel plutt avanc. - - - L'API de SimpleTest par phpdoc. - - - - - outils de dveloppement logiciel, - programmation php, - outils pour l'extreme programming, - liens pour des outils de test, - ressources pour test en php, - objets fantaise, - junit, - jwebunit, - htmlunit, - itc, - liens pour tests en php, - conseil et documentation pour test unitaire, - extreme programming en php - - - - - - Marcus Baker - - Dveloppeur principal{@link mailto:marcus@lastcraft.com marcus@lastcraft.com} - - - - Harry Fuecks - - Packageur{@link mailto:harryf@users.sourceforge.net harryf@users.sourceforge.net} - - - - Jason Sweat - - Documentation{@link mailto:jsweat_php@yahoo.com jsweat_php@yahoo.com} - - - - Perrick Penet - - Traduction{@link mailto:perrick@onpk.net perrick@onpk.net} - - - - -
- diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/partial_mocks_documentation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/partial_mocks_documentation.xml deleted file mode 100644 index 7d15486..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/partial_mocks_documentation.xml +++ /dev/null @@ -1,419 +0,0 @@ - - - - - Documentation SimpleTest : les objets fantaisie partiels - - -

- Un objet fantaisie partiel n'est ni plus ni moins - qu'un modle de conception pour soulager un problme spcifique - du test avec des objets fantaisie, celui de placer - des objets fantaisie dans des coins serrs. - Il s'agit d'un outil assez limit et peut-tre mme - une ide pas si bonne que a. Elle est incluse dans SimpleTest - pour la simple raison que je l'ai trouve utile - plus d'une occasion et qu'elle m'a pargne - pas mal de travail dans ces moments-l. -

-
-
-

- Quand un objet en utilise un autre il est trs simple - d'y faire circuler une version fantaisie dj prte - avec ses attentes. Les choses deviennent un peu plus dlicates - si un objet en cre un autre et que le crateur est celui - que l'on souhaite tester. Cela revient dire que l'objet - cr devrait tre une fantaisie, mais nous pouvons - difficilement dire notre classe sous test de crer - un objet fantaisie plutt qu'un "vrai" objet. - La classe teste ne sait mme pas qu'elle travaille dans un environnement de test. -

-

- Par exemple, supposons que nous sommes en train - de construire un client telnet et qu'il a besoin - de crer une socket rseau pour envoyer ses messages. - La mthode de connexion pourrait ressemble quelque chose comme... -read( ... ); - ... - } -} -?> -]]> - Nous voudrions vraiment avoir une version fantaisie - de l'objet socket, que pouvons nous faire ? -

-

- La premire solution est de passer la socket en - tant que paramtre, ce qui force la cration - au niveau infrieur. Charger le client de cette tche - est effectivement une bonne approche si c'est possible - et devrait conduire un remaniement -- de la cration - partir de l'action. En fait, c'est l une des manires - avec lesquels tester en s'appuyant sur des objets fantaisie - vous force coder des solutions plus resserres sur leur objectif. - Ils amliorent votre programmation. -

-

- Voici ce que a devrait tre... -function &connect(&$socket, $username, $password) { - $socket->read( ... ); - ... - } -} -?> -]]> - Sous-entendu, votre code de test est typique d'un cas - de test avec un objet fantaisie. - - $socket = &new MockSocket($this); - ... - $telnet = &new Telnet(); - $telnet->connect($socket, 'Me', 'Secret'); - ... - } -} -]]> - C'est assez vident que vous ne pouvez descendre que d'un niveau. - Vous ne voudriez pas que votre application de haut niveau - cre tous les fichiers de bas niveau, sockets et autres connexions - la base de donnes dont elle aurait besoin. - Elle ne connatrait pas les paramtres du constructeur de toute faon. -

-

- La solution suivante est de passer l'objet cr sous la forme - d'un paramtre optionnel... - - function &connect($ip, $port, $username, $password, $socket = false) { - if (!$socket) { - $socket = &new Socket($ip, $port); - } - $socket->read( ... ); - ... - return $socket; - } -} -?> -]]> - Pour une solution rapide, c'est gnralement suffisant. - Ensuite le test est trs similaire : comme si le paramtre - tait transmis formellement... - - $socket = &new MockSocket($this); - ... - $telnet = &new Telnet(); - $telnet->connect('127.0.0.1', 21, 'Me', 'Secret', &$socket); - ... - } -} -]]> - Le problme de cette approche tient dans son manque de nettet. - Il y a du code de test dans la classe principale et aussi - des paramtres transmis dans le scnario de test - qui ne sont jamais utiliss. Il s'agit l d'une approche - rapide et sale, mais qui ne reste pas moins efficace - dans la plupart des situations. -

-

- Une autre solution encore est de laisser un objet fabrique - s'occuper de la cration... - - function Telnet(&$network) { - $this->_network = &$network; - } - ... - function &connect($ip, $port, $username, $password) { - $socket = &$this->_network->createSocket($ip, $port); - $socket->read( ... ); - ... - return $socket; - } -} -?> -]]> - Il s'agit l probablement de la rponse la plus travaille - tant donn que la cration est maintenant situe - dans une petite classe spcialise. La fabrique rseau - peut tre teste sparment et utilise en tant que fantaisie - quand nous testons la classe telnet... - - $socket = &new MockSocket($this); - ... - $network = &new MockNetwork($this); - $network->setReturnReference('createSocket', $socket); - $telnet = &new Telnet($network); - $telnet->connect('127.0.0.1', 21, 'Me', 'Secret'); - ... - } -} -]]> - Le problme reste que nous ajoutons beaucoup de classes - la bibliothque. Et aussi que nous utilisons beaucoup - de fabriques ce qui rend notre code un peu moins intuitif. - La solution la plus flexible, mais aussi la plus complexe. -

-

- Peut-on trouver un juste milieu ? -

-
-
-

- Il existe une technique pour palier ce problme - sans crer de nouvelle classe dans l'application; - par contre elle induit la cration d'une sous-classe au moment du test. - Premirement nous dplaons la cration de la socket dans sa propre mthode... - - $socket = &$this->_createSocket($ip, $port); - $socket->read( ... ); - ... - } - - function &_createSocket($ip, $port) { - return new Socket($ip, $port); - } -} -?> -]]> - Il s'agit l de la seule modification dans le code de l'application. -

-

- Pour le scnario de test, nous devons crer - une sous-classe de manire intercepter la cration de la socket... -class TelnetTestVersion extends Telnet { - var $_mock; - - function TelnetTestVersion(&$mock) { - $this->_mock = &$mock; - $this->Telnet(); - } - - function &_createSocket() { - return $this->_mock; - } -} -]]> - Ici j'ai dplac la fantaisie dans le constructeur, - mais un setter aurait fonctionn tout aussi bien. - Notez bien que la fantaisie est place dans une variable - d'objet avant que le constructeur ne soit attach. - C'est ncessaire dans le cas o le constructeur appelle - connect(). - Autrement il pourrait donner un valeur nulle partir de - _createSocket(). -

-

- Aprs la ralisation de tout ce travail supplmentaire - le scnario de test est assez simple. - Nous avons juste besoin de tester notre nouvelle classe la place... - - $socket = &new MockSocket($this); - ... - $telnet = &new TelnetTestVersion($socket); - $telnet->connect('127.0.0.1', 21, 'Me', 'Secret'); - ... - } -} -]]> - Cette nouvelle classe est trs simple bien sr. - Elle ne fait qu'initier une valeur renvoye, la manire - d'une fantaisie. Ce serait pas mal non plus si elle pouvait - vrifier les paramtres entrants. - Exactement comme un objet fantaisie. - Il se pourrait bien que nous ayons raliser cette astuce rgulirement : - serait-il possible d'automatiser la cration de cette sous-classe ? -

-
-
-

- Bien sr la rponse est "oui" - ou alors j'aurais arrt d'crire depuis quelques temps dj ! - Le test prcdent a reprsent beaucoup de travail, - mais nous pouvons gnrer la sous-classe en utilisant - une approche celle des objets fantaisie. -

-

- Voici donc une version avec objet fantaisie partiel du test... -Mock::generatePartial( - 'Telnet', - 'TelnetTestVersion', - array('_createSocket')); - -class TelnetTest extends UnitTestCase { - ... - function testConnection() { - $socket = &new MockSocket($this); - ... - $telnet = &new TelnetTestVersion($this); - $telnet->setReturnReference('_createSocket', $socket); - $telnet->Telnet(); - $telnet->connect('127.0.0.1', 21, 'Me', 'Secret'); - ... - } -} -]]> - La fantaisie partielle est une sous-classe de l'original - dont on aurait "remplac" les mthodes slectionnes - avec des versions de test. L'appel generatePartial() - ncessite trois paramtres : la classe sous classer, - le nom de la nouvelle classe et une liste des mthodes simuler. -

-

- Instancier les objets qui en rsultent est plutt dlicat. - L'unique paramtre du constructeur d'un objet fantaisie partiel - est la rfrence du testeur unitaire. - Comme avec les objets fantaisie classiques c'est ncessaire - pour l'envoi des rsultats de test en rponse la vrification des attentes. -

-

- Une nouvelle fois le constructeur original n'est pas lanc. - Indispensable dans le cas o le constructeur aurait besoin - des mthodes fantaisie : elles n'ont pas encore t inities ! - Nous initions les valeurs retournes cet instant et - ensuite lanons le constructeur avec ses paramtres normaux. - Cette construction en trois tapes de "new", - suivie par la mise en place des mthodes et ensuite - par la lancement du constructeur proprement dit est - ce qui distingue le code d'un objet fantaisie partiel. -

-

- A part pour leur construction, toutes ces mthodes - fantaisie ont les mmes fonctionnalits que dans - le cas des objets fantaisie et toutes les mthodes - non fantaisie se comportent comme avant. - Nous pouvons mettre en place des attentes trs facilement... -setReturnReference('_createSocket', $socket); - $telnet->expectOnce('_createSocket', array('127.0.0.1', 21)); - $telnet->Telnet(); - $telnet->connect('127.0.0.1', 21, 'Me', 'Secret'); - ... - $telnet->tally(); - } -} -]]> -

-
-
-

- Les mthodes issues d'un objet fantaisie n'ont pas - besoin d'tre des mthodes fabrique, Il peut s'agir - de n'importe quelle sorte de mthode. - Ainsi les objets fantaisie partiels nous permettent - de prendre le contrle de n'importe quelle partie d'une classe, - le constructeur except. Nous pourrions mme aller jusqu' - crer des fantaisies sur toutes les mthodes part celle - que nous voulons effectivement tester. -

-

- Cette situation est assez hypothtique, tant donn - que je ne l'ai jamais essaye. Je suis ouvert cette possibilit, - mais je crains qu'en forant la granularit d'un objet - on n'obtienne pas forcment un code de meilleur qualit. - Personnellement j'utilise les objets fantaisie partiels - comme moyen de passer outre la cration ou alors - de temps en temps pour tester le modle de conception TemplateMethod. -

-

- Pour choisir le mcanisme utiliser, on en revient - toujours aux standards de code de votre projet. -

-
-
- - - Le problme de l'injection d'un objet fantaisie. - - - Dplacer la cration vers une mthode fabrique protge. - - - L'objet fantaisie partiel gnre une sous-classe. - - - Les objets fantaisie partiels testent moins qu'une classe. - - - - - La page du projet SimpleTest sur - SourceForge. - - - L'API complte pour SimpleTest - partir de PHPDoc. - - - La mthode fabrique protge est dcrite dans - - cet article d'IBM. Il s'agit de l'unique papier - formel que j'ai vu sur ce problme. - - - - - dveloppement logiciel en php, - dvelopement d'un scnario de test en php, - programmation php avec base de donnes, - outils de dveloppement logiciel, - tutoriel avanc en php, - scripts la manire de phpunit, - architecture, - ressources php, - objets fantaisie, - junit, - framework de test en php, - test unitaire, - test en php - - -
- diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/reporter_documentation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/reporter_documentation.xml deleted file mode 100644 index e91adf1..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/reporter_documentation.xml +++ /dev/null @@ -1,488 +0,0 @@ - - - - - Documentation SimpleTest : le rapporteur de test - - -

- SimpleTest suit plutt plus que moins le modle MVC (Modle-Vue-Contrleur). - Les classes "reporter" sont les vues et les modles - sont vos scnarios de test et leur hirarchie. - Le contrleur est le plus souvent masqu l'utilisateur - de SimpleTest moins de vouloir changer la faon - dont les tests sont effectivement excuts, - auquel cas il est possible de surcharger les objets - "runner" (ceux de l'excuteur) depuis l'intrieur - d'un scnario de test. Comme d'habitude avec MVC, - le contrleur est plutt indfini et il existe d'autres endroits - pour contrler l'excution des tests. -

-
-
-

- L'affichage par dfaut est minimal l'extrme. - Il renvoie le succs ou l'chec avec les barres conventionnelles - - rouge et verte - et affichent une trace d'arborescence - des groupes de test pour chaque assertion errone. Voici un tel chec... -

-

File test

- Fail: createnewfile->True assertion failed.
-
1/1 test cases complete. - 0 passes, 1 fails and 0 exceptions.
-
- Alors qu'ici tous les tests passent... -
-

File test

-
1/1 test cases complete. - 1 passes, 0 fails and 0 exceptions.
-
- La bonne nouvelle, c'est qu'il existe pas mal de points - dans la hirarchie de l'affichage pour crer des sous-classes. -

-

- Pour l'affichage bas sur des pages web, - il y a la classe HtmlReporter avec la signature suivante... - - Voici ce que certaines de ces mthodes veulent dire. - Premirement les mthodes d'affichage que vous voudrez probablement surcharger... -

    -
  • - HtmlReporter(string $encoding)
    - est le constructeur. Notez que le test unitaire initie - le lien l'affichage plutt que l'oppos. - L'affichage est principalement un receveur passif - des vnements de tests. Cela permet d'adapter - facilement l'affichage pour d'autres systmes - en dehors des tests unitaires, tel le suivi - de la charge de serveurs. - L'"encoding" est le type d'encodage - que vous souhaitez utiliser pour l'affichage du test. - Pour pouvoir effectuer un rendu correct de la sortie - de dbogage quand on utilise le testeur web, - il doit correspondre l'encodage du site test. - Les chanes de caractres disponibles - sont indiques dans la fonction PHP - html_entities(). -
  • -
  • - void paintHeader(string $test_name)
    - est appel une fois, au dbut du test quand l'vnement - de dmarrage survient. Le premier vnement de dmarrage - est souvent dlivr par le groupe de tests du niveau - le plus haut et donc c'est de l que le - $test_name arrive. - Il peint les titres de la page, CSS, la balise "body", etc. - Il ne renvoie rien du tout (void). -
  • -
  • - void paintFooter(string $test_name)
    - est appel la toute fin du test pour fermer - les balises ouvertes par l'entte de la page. - Par dfaut il affiche aussi la barre rouge ou verte - et le dcompte final des rsultats. - En fait la fin des tests arrive quand l'vnement - de fin de test arrive avec le mme nom - que celui qui l'a initi au mme niveau. - Le nid des tests en quelque sorte. - Fermer le dernier test finit l'affichage. -
  • -
  • - void paintMethodStart(string $test_name)
    - est appel au dbut de chaque mthode de test. - Normalement le nom vient de celui de la mthode. - Les autres vnements de dpart de test - se comportent de la mme manire sauf que - celui du groupe de tests indique au rapporteur - le nombre de scnarios de test qu'il contient. - De la sorte le rapporteur peut afficher une barre - de progrs au fur et mesure que l'excuteur - passe en revue les scnarios de test. -
  • -
  • - void paintMethodEnd(string $test_name)
    - clt le test lanc avec le mme nom. -
  • -
  • - void paintFail(string $message)
    - peint un chec. Par dfaut il ne fait qu'afficher - le mot "fail", une trace d'arborescence - affichant la position du test en cours - et le message transmis par l'assertion. -
  • -
  • - void paintPass(string $message)
    - ne fait rien, par dfaut. -
  • -
  • - string getCss()
    - renvoie les styles CSS sous la forme d'une chane - l'attention de la mthode d'enttes d'une page. - Des styles additionnels peuvent tre ajouts ici - si vous ne surchargez pas les enttes de la page. - Vous ne voudrez pas utiliser cette mthode dans - des enttes d'une page surcharge si vous souhaitez - inclure le feuille de style CSS d'origine. -
  • -
- Il y a aussi des accesseurs pour aller chercher l'information - sur l'tat courant de la suite de test. Vous les utiliserez - pour enrichir l'affichage... -
    -
  • - array getTestList()
    - est la premire mthode trs commode pour les sous-classes. - Elle liste l'arborescence courante des tests - sous la forme d'une liste de noms de tests. - Le premier test -- celui le plus proche du coeur -- - sera le premier dans la liste et la mthode de test - en cours sera la dernire. -
  • -
  • - integer getPassCount()
    - renvoie le nombre de succs atteint. Il est ncessaire - pour l'affichage la fin. -
  • -
  • - integer getFailCount()
    - renvoie de la mme manire le nombre d'checs. -
  • -
  • - integer getExceptionCount()
    - renvoie quant lui le nombre d'erreurs. -
  • -
  • - integer getTestCaseCount()
    - est le nombre total de scnarios lors de l'excution des tests. - Il comprend aussi les tests groups. -
  • -
  • - integer getTestCaseProgress()
    - est le nombre de scnarios raliss jusqu' prsent. -
  • -
- Une modification simple : demander l'HtmlReporter d'afficher - aussi bien les succs que les checs et les erreurs... - -class ShowPasses extends HtmlReporter { - - function paintPass($message) { - parent::paintPass($message); - print "&Pass: "; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - print implode("->", $breadcrumb); - print "->$message
\n"; - } - - protected function getCss() { - return parent::getCss() . ' .pass { color: green; }'; - } -} -]]>
-

-

- Une mthode qui a beaucoup fait jaser reste la mthode makeDry(). - Si vous lancez cette mthode, sans paramtre, - sur le rapporteur avant que la suite de test - ne soit excute alors aucune mthode de test - ne sera appele. Vous continuerez avoir - les vnements entrants et sortants des mthodes - et scnarios de test, mais aucun succs ni chec ou erreur, - parce que le code de test ne sera pas excut. -

-

- La raison ? Pour permettre un affichage complexe - d'une IHM (ou GUI) qui permettrait la slection - de scnarios de test individuels. - Afin de construire une liste de tests possibles, - ils ont besoin d'un rapport sur la structure du test - pour l'affichage, par exemple, d'une vue en arbre - de la suite de test. Avec un rapporteur lanc - sur une excution sche qui ne renverrait - que les vnements d'affichage, cela devient - facilement ralisable. -

-
-
-

- Plutt que de modifier l'affichage existant, - vous voudrez peut-tre produire une prsentation HTML - compltement diffrente, ou mme gnrer une version texte ou XML. - Plutt que de surcharger chaque mthode dans - HtmlReporter nous pouvons nous rendre - une tape plus haut dans la hirarchie de classe vers - SimpleReporter dans le fichier source simple_test.php. -

-

- Un affichage sans rien, un canevas vierge - pour votre propre cration, serait... - -require_once('simpletest/simple_test.php'); - -class MyDisplay extends SimpleReporter { - - function paintHeader($test_name) { - } - - function paintFooter($test_name) { - } - - function paintStart($test_name, $size) { - parent::paintStart($test_name, $size); - } - - function paintEnd($test_name, $size) { - parent::paintEnd($test_name, $size); - } - - function paintPass($message) { - parent::paintPass($message); - } - - function paintFail($message) { - parent::paintFail($message); - } -} -]]> - Aucune sortie ne viendrait de cette classe jusqu' un ajout de votre part. -

-
-
-

- SimpleTest est aussi livr avec un rapporteur - en ligne de commande, minime lui aussi. - L'interface imite celle de JUnit, - sauf qu'elle envoie les messages d'erreur au fur - et mesure de leur arrive. - Pour utiliser le rapporteur en ligne de commande, - il suffit de l'intervertir avec celui de la version HTML... -addTestFile('tests/file_test.php'); -$test->run(new TextReporter()); -?> -]]> - Et ensuite d'invoquer la suite de test partir d'une ligne de commande... -

-php file_test.php
-
- Bien sr vous aurez besoin d'installer PHP - en ligne de commande. Une suite de test qui - passerait toutes ses assertions ressemble ... -
-File test
-OK
-Test cases run: 1/1, Failures: 0, Exceptions: 0
-
- Un chec dclenche un affichage comme... -
-File test
-1) True assertion failed.
-    in createnewfile
-FAILURES!!!
-Test cases run: 1/1, Failures: 1, Exceptions: 0
-
-

-

- Une des principales raisons pour utiliser - une suite de test en ligne de commande tient - dans l'utilisation possible du testeur avec - un processus automatis. Pour fonctionner comme - il faut dans des scripts shell le script de test - devrait renvoyer un code de sortie non-nul suite un chec. - Si une suite de test choue la valeur false - est renvoye par la mthode SimpleTest::run(). - Nous pouvons utiliser ce rsultat pour terminer le script - avec la bonne valeur renvoye... -addTestFile('tests/file_test.php'); -exit ($test->run(new TextReporter()) ? 0 : 1); -?> -]]> - Bien sr l'objectif n'est pas de crer deux scripts de test, - l'un en ligne de commande et l'autre pour un navigateur web, - pour chaque suite de test. - Le rapporteur en ligne de commande inclut - une mthode pour dterminer l'environnement d'excution... -addTestFile('tests/file_test.php'); -if (TextReporter::inCli()) { - exit ($test->run(new TextReporter()) ? 0 : 1); -} -$test->run(new HtmlReporter()); -?> -]]> - Il s'agit l de la forme utilise par SimpleTest lui-mme. -

-
-
-

- SimpleTest est livr avec une classe XmlReporter - utilise pour de la communication interne. - Lors de son excution, le rsultat ressemble ... -


-
-  
-    Remote tests
-    
-      Visual test with 48 passes, 48 fails and 4 exceptions
-      
-        testofunittestcaseoutput
-        
-          testofresults
-          This assertion passed
-          This assertion failed
-        
-        
-          ...
-        
-      
-    
-  
-
-]]>
- Vous pouvez utiliser ce format avec le parseur - fourni dans SimpleTest lui-mme. - Il s'agit de SimpleTestXmlParser - et se trouve xml.php l'intrieur du paquet SimpleTest... -parse($test_output); -?> -]]> - $test_output devrait tre au format XML, - partir du rapporteur XML, et pourrait venir - d'une excution en ligne de commande d'un scnario de test. - Le parseur envoie des vnements au rapporteur exactement - comme tout autre excution de test. - Il y a des occasions bizarres dans lesquelles c'est en fait trs utile. -

-

- Un problme des trs grandes suites de test, - c'est qu'elles peuvent venir bout de la limite de mmoire - par dfaut d'un process PHP - 8Mb. - En plaant la sortie des groupes de test dans du XML - et leur excution dans des process diffrents, - le rsultat peut tre pars nouveau pour agrger - les rsultats avec moins d'impact sur le test au premier niveau. -

-

- Parce que la sortie XML peut venir de n'importe o, - a ouvre des possibilits d'agrgation d'excutions de test - depuis des serveur distants. - Un scnario de test pour le raliser existe dj - l'intrieur du framework SimpleTest, mais il est encore exprimental... - -require_once('../remote.php'); -require_once('../reporter.php'); - -$test_url = ...; -$dry_url = ...; - -$test = &new GroupTest('Remote tests'); -$test->addTestCase(new RemoteTestCase($test_url, $dry_url)); -$test->run(new HtmlReporter()); -?> -]]> - RemoteTestCase prend la localisation relle - du lanceur de test, tout simplement un page web au format XML. - Il prend aussi l'URL d'un rapporteur initi - pour effectuer une excution sche. - Cette technique est employe pour que les progrs - soient correctement rapports vers le haut. - RemoteTestCase peut tre ajout - une suite de test comme n'importe quel autre groupe de tests. -

-
-
- - - Afficher les rsultats en HTML - - - Afficher et rapporter les rsultats - dans d'autres formats - - - Utilis SimpleTest depuis la ligne de commande - - - Utiliser XML pour des tests distants - - - - - La page du projet SimpleTest sur - SourceForge. - - - La page de tlchargement de SimpleTest sur - LastCraft. - - - L'API pour dveloppeur de SimpleTest - donne tous les dtails sur les classes et les assertions disponibles. - - - - - test unitaire en php, - documentation, - marcus baker, - perrick penet - test simple, - simpletest, - test distant, - tests xml, - test automatis - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/simple_test.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/simple_test.xml deleted file mode 100644 index 68d5629..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/simple_test.xml +++ /dev/null @@ -1,556 +0,0 @@ - - - - - - Prise en main rapide de SimpleTest pour PHP - - Tests unitaire et objets fantaisie pour PHP - - - -

- Le prsent article prsuppose que vous soyez familier avec - le concept de tests unitaires ainsi que celui de dveloppement - web avec le langage PHP. Il s'agit d'un guide pour le nouvel - et impatient utilisateur de - SimpleTest. - Pour une documentation plus complte, particulirement si - vous dcouvrez les tests unitaires, consultez la - documentation - en cours, et pour des exemples de scnarios de test, - consultez le - tutorial - sur les tests unitaires. -

-
-
-

- Parmi les outils de test pour logiciel, le testeur unitaire - est le plus proche du dveloppeur. Dans un contexte de - dveloppement agile, le code de test se place juste ct - du code source tant donn que tous les deux sont crits - simultanment. Dans ce contexte, SimpleTest aspire tre - une solution complte de test pour un dveloppeur PHP et - s'appelle "Simple" parce qu'elle devrait tre simple - utiliser et tendre. Ce nom n'tait pas vraiment un bon - choix. Non seulement cette solution inclut toutes les - fonctions classiques qu'on est en droit d'attendre de la - part des portages de JUnit et des PHPUnit, - mais elle inclut aussi les objets fantaisie ou - "mock objects". -

-

- Ce qui rend cet outil immdiatement utile pour un dveloppeur PHP, - c'est son navigateur web interne. - Il permet des tests qui parcourent des sites web, remplissent - des formulaires et testent le contenu des pages. - Etre capable d'crire ces tests en PHP veut dire qu'il devient - facile d'crire des tests de recette (ou d'intgration). - Un exemple serait de confirmer qu'un utilisateur a bien t ajout - dans une base de donnes aprs s'tre enregistr sur une site web. -

-

- La dmonstration la plus rapide : l'exemple -

-

- Supposons que nous sommes en train de tester une simple - classe de log dans un fichier : elle s'appelle - Log dans classes/Log.php. Commenons - par crer un script de test, appel - tests/log_test.php. Son contenu est le suivant... -require_once('simpletest/autorun.php'); -require_once('../classes/log.php'); - -class TestOfLogging extends UnitTestCase { -} -?> -]]> - Ici le rpertoire simpletest est soit dans le - dossier courant, soit dans les dossiers pour fichiers - inclus. Vous auriez diter ces arborescences suivant - l'endroit o vous avez install SimpleTest. - Le fichier "autorun.php" fait plus que juste inclure - les lments de SimpleTest : il lance aussi les tests pour nous. -

-

- TestOfLogging est notre premier scnario de test - et il est pour l'instant vide. - Chaque scnario de test est une classe qui tend une des classes - de base de SimpleTest. Nous pouvons avoir autant de classes de ce type - que nous voulons. -

-

- Avec ces trois lignes d'chafaudage - l'inclusion de notre classe Log, nous avons une suite - de tests. Mais pas encore de test ! -

-

- Pour notre premier test, supposons que la classe Log - prenne le nom du fichier crire au sein du constructeur, - et que nous avons un rpertoire temporaire dans lequel placer - ce fichier. -testLogCreatesNewFileOnFirstMessage() { - @unlink('/temp/test.log'); - $log = new Log('/temp/test.log'); - $this->assertFalse(file_exists('/temp/test.log')); - $log->message('Should write this to a file'); - $this->assertTrue(file_exists('/temp/test.log')); - } -} -?> -]]> - Au lancement du scnario de test, toutes les mthodes qui - commencent avec la chane test sont - identifies puis excutes. - Si la mthode commence par test, c'est un test. - Remarquez bien le nom trs long de notre exemple : - testLogCreatesNewFileOnFirstMessage(). - C'est bel et bien dlibr : ce style est considr dsirable - et il rend la sortie du test plus lisible. -

-

- D'ordinaire nous avons bien plusieurs mthodes de tests. - Mais ce sera pour plus tard. -

-

- Les assertions dans les - mthodes de test envoient des messages vers le framework de - test qui affiche immdiatement le rsultat. Cette rponse - immdiate est importante, non seulement lors d'un crash - caus par le code, mais aussi de manire rapprocher - l'affichage de l'erreur au plus prs du scnario de test - concern via un appel printcode>. -

-

- Pour voir ces rsultats lanons effectivement les tests. - Aucun autre code n'est ncessaire, il suffit d'ouvrir - la page dans un navigateur. -

-

- En cas chec, l'affichage ressemble ... -

-

TestOfLogging

- Fail: testcreatingnewfile->True assertion failed.
-
1/1 test cases complete. - 1 passes and 1 fails.
-
- ...et si a passe, on obtient... -
-

TestOfLogging

-
1/1 test cases complete. - 2 passes and 0 fails.
-
- Et si vous obtenez a... -
- Fatal error: Failed opening required '../classes/log.php' (include_path='') in /home/marcus/projects/lastcraft/tutorial_tests/Log/tests/log_test.php on line 7 -
- c'est qu'il vous manque le fichier classes/Log.php - qui pourrait ressembler : - -class Log { - function Log($file_path) { - } - - function message() { - } -} -?> -]]> - C'est largement plus sympathique d'crire le code aprs le test. - Plus que sympatique mme - cette technique s'appelle - "Dveloppement Pilot par les Tests" ou - "Test Driven Development" en anglais. -

-

- Pour plus de renseignements sur le testeur, voyez la - documentation pour les tests de rgression. -

-
-
-

- Il est peu probable que dans une vritable application on - ait uniquement besoin de passer un seul scnario de test. - Cela veut dire que nous avons besoin de grouper les - scnarios dans un script de test qui peut, si ncessaire, - lancer tous les tests de l'application. -

-

- Notre premire tape est de crer un nouveau fichier appel - tests/all_tests.php et d'y inclure le code suivant... -require_once('simpletest/autorun.php'); - -class AllTests extends TestSuite { - function AllTests() { - $this->TestSuite('All tests'); - $this->addFile('log_test.php'); - } -} -?> -]]> - L'inclusion de "autorun" permettra notre future suite - de tests d'tre lance juste en invoquant ce script. -

-

- La sous-classe TestSuite doit chaner - son constructeur. Cette limitation sera supprime dans - les versions venir. -

-

- The method TestSuite::addFile() - will include the test case file and read any new classes - that are descended from SimpleTestCase. - - Cette mthode TestSuite::addTestFile() va - inclure le fichier de scnarios de test et lire parmi - toutes les nouvelles classes cres celles qui sont issues - de SimpleTestCase. - UnitTestCase est juste un exemple de classe drive - depuis SimpleTestCase et vous pouvez crer les vtres. - TestSuite::addFile() peut aussi inclure d'autres suites. -

-

- La classe ne sera pas encore instancie. - Quand la suite de tests est lance, elle construira chaque instance - une fois le test atteint, et le dtuira juste ensuite. - Cela veut dire que le constructeur n'est lanc qu'une fois avant - chaque initialisation de ce scnario de test et que le destructeur - est lui aussi lanc avant que le test suivant ne commence. -

-

- Il est commun de grouper des scnarios de test dans des super-classes - qui ne sont pas senses tre lances, mais qui deviennent une classe de base - pour d'autres tests. - Pour que "autorun" fonctionne proprement les fichiers - des scnarios de test ne devraient pas lancer aveuglement - d'autres extensions de scnarios de test qui ne lanceraient pas - effectivement des tests. - Cela pourrait aboutir un mauvais comptages des scnarios de test - pendant la procdure. - Pas vraiement un problme majeure, mais pour viter cet inconvnient - il suffit de marquer vos classes de base comme abstract. - SimpleTest ne lance pas les classes abstraites. Et si vous utilisez encore - PHP4 alors une directive SimpleTestOptions::ignore() - dans votre fichier de scnario de test aura le mme effet. -

-

- Par ailleurs, le fichier avec le scnario de test ne devrait pas - avoir t inclus ailleurs. Sinon aucun scnario de test - ne sera inclus ce groupe. - Ceci pourrait se transformer en un problme plus grave : - si des fichiers ont dj t inclus par PHP alors la mthode - TestSuite::addFile() ne les dtectera pas. -

-

- Pour afficher les rsultats, il est seulement ncessaire - d'invoquer tests/all_tests.php partir du serveur - web. -

-

- Pour plus de renseignements des groupes de tests, voyez le - documentation sur le groupement des tests. -

-
-
-

- Avanons un peu plus dans le futur. -

-

- Supposons que notre class logging soit teste et termine. - Supposons aussi que nous testons une autre classe qui ait - besoin d'crire des messages de log, disons - SessionPool. Nous voulons tester une mthode - qui ressemblera probablement quelque chose comme... - -class SessionPool { - ... - function logIn($username) { - ... - $this->_log->message('User $username logged in.'); - ... - } - ... -} - -]]> - Avec le concept de "rutilisation de code" comme fil - conducteur, nous utilisons notre class Log. Un - scnario de test classique ressemblera peut-tre ... -require_once('../classes/session_pool.php'); - -class TestOfSessionLogging extends UnitTestCase { - - function setUp() { - @unlink('/temp/test.log'); - } - - function tearDown() { - @unlink('/temp/test.log'); - } - - function testLoggingInIsLogged() { - $log = new Log('/temp/test.log'); - $session_pool = &new SessionPool($log); - $session_pool->logIn('fred'); - $messages = file('/temp/test.log'); - $this->assertEqual($messages[0], "User fred logged in.\n"); - } -} -?> -]]> - Nous expliquerons les mthodes setUp() - et tearDown() plus tard. -

-

- Le design de ce scnario de test n'est pas compltement - mauvais, mais on peut l'amliorer. Nous passons du temps - tripoter les fichiers de log qui ne font pas partie de - notre test. - Pire, nous avons cr des liens de proximit - entre la classe Log et ce test. Que se - passerait-il si nous n'utilisions plus de fichiers, mais la - bibliothque syslog la place ? - - Cela veut dire que notre test TestOfSessionLogging - enverra un chec alors mme qu'il ne teste pas Logging. -

-

- Il est aussi fragile sur des petites retouches. Avez-vous - remarqu le retour chariot supplmentaire la fin du - message ? A-t-il t ajout par le loggueur ? Et si il - ajoutait aussi un timestamp ou d'autres donnes ? -

-

- L'unique partie tester rellement est l'envoi d'un - message prcis au loggueur. - Nous pouvons rduire le couplage en - crant une fausse classe de logging : elle ne fait - qu'enregistrer le message pour le test, mais ne produit - aucun rsultat. Sauf qu'elle doit ressembler exactement - l'original. -

-

- Si l'objet fantaisie n'crit pas dans un fichier alors nous - nous pargnons la suppression du fichier avant et aprs le - test. Nous pourrions mme nous pargner quelques lignes de - code supplmentaires si l'objet fantaisie pouvait excuter - l'assertion. -

-

- Trop beau pour tre vrai ? Pas vraiement on peut crer un tel - objet trs facilement... -Mock::generate('Log'); - -class TestOfSessionLogging extends UnitTestCase { - - function testLoggingInIsLogged() { - $log = &new MockLog(); - $log->expectOnce('message', array('User fred logged in.')); - $session_pool = &new SessionPool($log); - $session_pool->logIn('fred'); - } -} -?> -]]> - L'appel Mock::generate() a gnr - une nouvelle classe appel MockLog. - Cela ressemble un clone identique, sauf que nous pouvons - y adjoindre du code de test. - C'est ce que fait expectOnce(). - Cela dit que si message() m'est appel, - il a intrt l'tre avec le paramtre - "User fred logged in.". -

-

- L'appel tally() est ncessaire pour annoncer - l'objet fantaisie qu'il n'y aura plus d'appels ultrieurs. - Sans a l'objet fantaisie pourrait attendre pendant une - ternit l'appel de la mthode sans jamais prvenir le - scnario de test. Les autres tests sont dclenchs - automatiquement quand l'appel message() est - invoqu sur l'objet MockLog par le code - SessionPool::logIn(). - L'appel mock va dclencher une comparaison des - paramtres et ensuite envoyer le message "pass" ou "fail" - au test pour l'affichage. Des jokers peuvent tre inclus - pour ne pas avoir tester tous les paramtres d'un appel - alors que vous ne souhaitez qu'en tester un. -

-

- Les objets fantaisie dans la suite SimpleTest peuvent avoir - un ensemble de valeurs de sortie arbitraires, des squences - de sorties, des valeurs de sortie slectionnes partir - des arguments d'entre, des squences de paramtres - attendus et des limites sur le nombre de fois qu'une - mthode peut tre invoque. -

-

- Pour que ce test fonctionne la librairie avec les objets - fantaisie doit tre incluse dans la suite de tests, par - exemple dans all_tests.php. -

-

- Pour plus de renseignements sur les objets fantaisie, voyez le - documentation sur les objets fantaisie. -

-
-
-

- Une des exigences des sites web, c'est qu'ils produisent - des pages web. Si vous construisez un projet de A Z et - que vous voulez intgrer des tests au fur et mesure alors - vous voulez un outil qui puisse effectuer une navigation - automatique et en examiner le rsultat. C'est le boulot - d'un testeur web. -

-

- Effectuer un test web via SimpleTest reste assez primitif : - il n'y a pas de javascript par exemple. - La plupart des autres oprations d'un navigateur sont simules. -

-

- Pour vous donner une ide, voici un exemple assez trivial : - aller chercher une page web, - partir de l naviguer vers la page "about" - et finalement tester un contenu dtermin par le client. -require_once('simpletest/web_tester.php'); - -class TestOfAbout extends WebTestCase { - function testOurAboutPageGivesFreeReignToOurEgo() { - $this->get('http://test-server/index.php'); - $this->click('About'); - $this->assertTitle('About why we are so great'); - $this->assertText('We are really great'); - } -} -?> -]]> - Avec ce code comme test de recette, vous pouvez vous - assurer que le contenu corresponde toujours aux - spcifications la fois des dveloppeurs et des autres - parties prenantes au projet. -

-

- Vous pouvez aussi naviguer travers des formulaires... -get('http://google.com/'); - $this->setField('q', 'simpletest'); - $this->click("I'm Feeling Lucky"); - $this->assertTitle('SimpleTest - Unit Testing for PHP'); - } -} -?> -]]> - ...mme si cela pourrait constituer une violation - des documents juridiques de Google(tm). -

-

- Pour plus de renseignements sur comment tester une page web, voyez la - documentation sur tester des scripts web. -

-

- SourceForge.net Logo -

-
-
- - - Utiliser le testeur rapidement - avec un exemple. - - - Groupes de tests - pour tester en un seul clic. - - - Utiliser les objets fantaisie - pour faciliter les tests et gagner en contrle. - - - Tester des pages web - au niveau de l'HTML. - - - - - Tlcharger PHP Simple Test - depuis SourceForge. - - - L'API de SimpleTest pour dveloppeur - donne tous les dtails sur les classes et assertions existantes. - - - - - dveloppement logiciel, - programmation php, - outils de dveloppement logiciel, - tutorial php, - scripts php gratuits, - architecture, - ressources php, - objets fantaise, - junit, - php testing, - php unit, - mthodologie, - dveloppement pilot par les tests, - sourceforge, - open source, - unit test, - web tester, - web testing, - outils tests html, - tester des web pages, - php objets fantaise, - naviguer automatiquement sur des sites web, - test automatis, - scripting web, - wget, - test curl, - jmock pour php, - jwebunit, - phpunit, - php unit testing, - php web testing, - jason sweat, - marcus baker, - perrick penet, - topstyle plug in, - phpedit plug in - - -
diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/subclass_tutorial.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/subclass_tutorial.xml deleted file mode 100644 index d730c8c..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/subclass_tutorial.xml +++ /dev/null @@ -1,261 +0,0 @@ - - - - - Tutorial de test unitaire en PHP - Sous classer un scnario de test - -
-

- Nous avions laiss notre test d'horloge avec un trou. - Si la fonction time() de PHP avanait pendant cette comparaison... -assertEqual($clock->now(), time(), 'Now is the right time'); -} -]]> - ...notre test aurait un cart d'une seconde - et entranerait un faux chec. - Un comportement erratique de notre suite de test - n'est vraiment pas ce que nous souhaitons : - nous pourrions la lancer une centaine de fois par jour. -

-

- Nous pourrions r-crire notre test... - - $time1 = $clock->now(); - $time2 = time(); - $this->assertTrue(($time1 == $time2) || ($time1 + 1 == $time2), 'Now is the right time'); -} -]]> - Sauf que la conception n'est pas plus claire - et que nous devrons le rpter pour chaque test de chronomtrage. - Les rptitions sont un ennemi public n1 - et donc un trs bon stimulant pour le remaniement de notre code de test. -UnitTestCase('Clock class test'); - } - function assertSameTime($time1, $time2, $message) { - $this->assertTrue( - ($time1 == $time2) || ($time1 + 1 == $time2), - $message); - } - function testClockTellsTime() { - $clock = new Clock(); - $this->assertSameTime($clock->now(), time(), 'Now is the right time'); - } - function testClockAdvance() { - $clock = new Clock(); - $clock->advance(10); - $this->assertSameTime($clock->now(), time() + 10, 'Advancement'); - } -} -]]> - Bien entendu chaque modification je relance - les tests pour bien vrifier que nous sommes dans les clous. - Remaniement au vert. C'est beaucoup plus sr. -

-
-
-

- Peut-tre voulons nous ajouter d'autres tests - sensibles au temps. Peut-tre lisons nous des timestamps - - en provenance d'une entre dans une base de donnes ou d'ailleurs - - qui tiendraient compte d'une simple seconde pour basculer. - Pour que ces nouvelles classes de test profitent - de notre nouvelle assertion nous avons besoin - de la placer dans une "super classe". -

-

- Voici notre fichier clock_test.php - au complet aprs la promotion de notre mthode - assertSameTime() dans sa propre "super classe"... - - class TimeTestCase extends UnitTestCase { - function TimeTestCase($test_name) { - $this->UnitTestCase($test_name); - } - function assertSameTime($time1, $time2, $message) { - $this->assertTrue( - ($time1 == $time2) || ($time1 + 1 == $time2), - $message); - } - } - - class TestOfClock extends TimeTestCase { - function TestOfClock() { - $this->TimeTestCase('Clock class test'); - } - function testClockTellsTime() { - $clock = new Clock(); - $this->assertSameTime($clock->now(), time(), 'Now is the right time'); - } - function testClockAdvance() { - $clock = new Clock(); - $clock->advance(10); - $this->assertSameTime($clock->now(), time() + 10, 'Advancement'); - } - } -?> -]]> - Dsormais nous bnficions de notre nouvelle assertion - chaque fois que nous hritons de notre propre classe - TimeTestCase plutt que de la classe - par dfaut UnitTestCase. - Nous retrouvons la conception de l'outil JUnit - et SimpleTest est un portage en PHP de cette interface. - Il s'agit d'un framework de test partir duquel - votre propre systme de test peut s'agrandir. -

-

- Si nous lanons les tests maintenant - une lgre broutille survient... -

- Warning: Missing argument 1 for timetestcase() - in /home/marcus/projects/lastcraft/tutorial_tests/tests/clock_test.php on line 5
-

All tests

-
3/3 test cases complete. - 6 passes and 0 fails.
-
- La raison est assez dlicate. -

-

- Notre sous-classe exige un paramtre - dans le constructeur qui n'a pas t fourni - et pourtant il semblerait que nous l'ayons - bel et bien fourni. Quand nous avons hrit - de notre nouvelle casse nous lui avons pass - notre propre constructeur. C'est juste l... -TimeTestCase('Clock class test'); -} -]]> - En fait nous avons raison, - l n'est pas le problme. -

-

- Vous vous souvenez de quand nous avons construit - le test de groupe all_tests.php - en utilisant la mthode addTestFile(). - Cette mthode recherche les classes de scnario de test, - les instancie si elles sont nouvelles puis excute - tous nos tests. Ce qui s'est pass ? - Elle a aussi trouv notre extension de scnario de test. - C'est sans consquence puisque qu'il n'y a pas - de mthode de test l'intrieur - comprendre pas - de mthode commenant par "test". - Aucun test supplmentaire n'est excut. -

-

- Le problme vient du fait qu'il instancie la classe - et le fait sans le paramtre $test_name - qui dclenche l'avertissement. - Ce paramtre n'est gnralement ncessaire - ni pour un scnario de test, ni pour son assertion. - Pour que notre scnario de test tendu corresponde - l'interface de UnitTestCase, - nous avons besoin de le rendre optionnel... -$test_name = false) { - $this->UnitTestCase($test_name); - } - function assertSameTime($time1, $time2, $message = false) { - if (! $message) { - $message = "Time [$time1] should match time [$time2]"; - } - $this->assertTrue( - ($time1 == $time2) || ($time1 + 1 == $time2), - $message); - } -} -]]> - Bien sr, que cette classe soit instancie - sans raison par la suite de test devrait - continuer vous ennuyer. - Voici une modification pour l'empcher de s'excuter... -SimpleTestOptions::ignore('TimeTestCase'); -class TimeTestCase extends UnitTestCase { - function TimeTestCase($test_name = false) { - $this->UnitTestCase($test_name); - } - function assertSameTime($time1, $time2, $message = '') { - if (!$message) { - $message = "Time [$time1] should match time [$time2]"; - } - $this->assertTrue( - ($time1 == $time2) || ($time1 + 1 == $time2), - $message); - } -} -]]> - Cette ligne ne fait que demander SimpleTest - d'ignorer cette classe lors de la construction - des suites de test. Elle peut tre ajoute n'importe - o dans le fichier de scnario de test. -

-

- Les six succs ont l'air bien mais ne disent - pas un observateur peu attentif ce qui a t test. - Pour cela il faut regarder dans le code. - Si cela vous parat trop de boulot et que vous - prfreriez lire ces informations directement - alors vous devriez aller lire comment - afficher les succs. -

-
-
- - - Une assertion insensible au chronomtre - qui permet de gagner une seconde. - - - Sous classer un scnario de test - afin de rutiliser la mthode de test. - - - - - Section prcdente : - contrler les variables de test. - - - Section suivante : - changer l'affichage des tests. - - - Vous aurez besoin du - testeur unitaire SimpleTest - pour les exemples. - - - - - dveloppement logiciel, - programmation php, - outils de dveloppement logiciel, - tutorial php, - scripts php gratuits, - organisation de tests unitaires, - cration de sous-classe, - conseil de test, - astuce de dveloppement, - exemple de code php, - objets fantaisie, - junit, - test php, - outil de test unitaire, - suite de test php - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/support_website.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/support_website.xml deleted file mode 100644 index 0494f65..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/support_website.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - Mailing-list de support - - -

- La mailing-list simpletest-support est probablement l'endroit - le plus actif autour de SimpleTest : aide, conseil, bugs et détours, c'est là - que tout se passe la plupart du temps. Attention tout de même : les échanges - ont lieu en anglais. -

-
-
-

- C'est vraiment - - simple de s'y abonner et en plus, on peut aussi - - l'utiliser pour ses recherches. -

-

- Au dernier pointage, il y avait 114 abonnés et 1908 messages envoyés. - Cela fait de 1 à 4 messages par jour en moyenne. -

-
-
- - - Pour s'abonner. - - - - - S'inscrire à la - - mailing list "Support". - - - Lire les - - archives. - - - - - SimpleTest, - download, - source code, - stable release, - eclipse release, - eclipse plugin, - debian package, - drupal module, - pear channel, - pearified package - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/unit_test_documentation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/unit_test_documentation.xml deleted file mode 100644 index 2ee95ef..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/unit_test_documentation.xml +++ /dev/null @@ -1,330 +0,0 @@ - - - - - Documentation SimpleTest pour les tests de rgression en PHP - -
-

- Le coeur du systme est un framework de tests de rgression - construit autour des scnarios de test. - Un exemple de scnario de test ressemble ... -class FileTestCase extends UnitTestCase { -} -]]> - Si aucun nom de test n'est fourni au moment - de la liaison avec le constructeur alors - le nom de la classe sera utilis. - Il s'agit du nom qui sera affich dans les rsultats du test. -

-

- Les vritables tests sont ajouts en tant que mthode - dans le scnario de test dont le nom par dfaut - commence par la chane "test" - et quand le scnario de test est appel toutes les mthodes - de ce type sont excutes dans l'ordre utilis - par l'introspection de PHP pour les trouver. - Peuvent tre ajoutes autant de mthodes de test que ncessaires. - Par exemple... -UnitTestCase('File test'); - } - - function setUp() { - @unlink('../temp/test.txt'); - } - - function tearDown() { - @unlink('../temp/test.txt'); - } - - function testCreation() { - $writer = &new FileWriter('../temp/test.txt'); - $writer->write('Hello'); - $this->assertTrue(file_exists('../temp/test.txt'), 'File created'); - } -} -]]> - Le constructeur est optionnel et souvent omis. Sans nom, - le nom de la classe est utilis comme nom pour le scnario de test. -

-

- Notre unique mthode de test pour le moment est - testCreation() o nous vrifions - qu'un fichier a bien t cr par notre objet - Writer. Nous pourrions avoir mis - le code unlink() dans cette mthode, - mais en la plaant dans setUp() - et tearDown() nous pouvons l'utiliser - pour nos autres mthodes de test que nous ajouterons. -

-

- La mthode setUp() est lanc - juste avant chaque mthode de test. - tearDown() est lanc aprs chaque mthode de test. -

-

- Vous pouvez placer une initialisation de - scnario de test dans le constructeur afin qu'elle soit lance - pour toutes les mthodes dans le scnario de test - mais dans un tel cas vous vous exposeriez des interfrences. - Cette faon de faire est lgrement moins rapide, - mais elle est plus sre. - Notez que si vous arrivez avec des notions de JUnit, - il ne s'agit pas du comportement auquel vous tes habitus. - Bizarrement JUnit re-instancie le scnario de test - pour chaque mthode de test pour se prvenir - d'une telle interfrence. - SimpleTest demande l'utilisateur final d'utiliser - setUp(), mais fournit aux codeurs de bibliothque d'autres crochets. -

-

- Pour rapporter les rsultats de test, - le passage par une classe d'affichage - notifie par - les diffrentes mthodes de type assert...() - - est utilise. En voici la liste complte pour - la classe UnitTestCase, - celle par dfaut dans SimpleTest... - - - - - - - - - - - - - - - - -
assertTrue($x)Echoue si $x est faux
assertFalse($x)Echoue si $x est vrai
assertNull($x)Echoue si $x est initialis
assertNotNull($x)Echoue si $x n'est pas initialis
assertIsA($x, $t)Echoue si $x n'est pas de la classe ou du type $t
assertEqual($x, $y)Echoue si $x == $y est faux
assertNotEqual($x, $y)Echoue si $x == $y est vrai
assertIdentical($x, $y)Echoue si $x === $y est faux
assertNotIdentical($x, $y)Echoue si $x === $y est vrai
assertReference($x, $y)Echoue sauf si $x et $y sont la mme variable
assertCopy($x, $y)Echoue si $x et $y sont la mme variable
assertWantedPattern($p, $x)Echoue sauf si l'expression rationnelle $p capture $x
assertNoUnwantedPattern($p, $x)Echoue si l'expression rationnelle $p capture $x
assertNoErrors()Echoue si une erreur PHP arrive
assertError($x)Echoue si aucune erreur ou message incorrect de PHP n'arrive
- Toutes les mthodes d'assertion peuvent recevoir - une description optionnelle : - cette description sert pour tiqueter le rsultat. - Sans elle, une message par dfaut est envoye la place : - il est gnralement suffisant. - Ce message par dfaut peut encore tre encadr - dans votre propre message si vous incluez "%s" - dans la chane. - Toutes les assertions renvoient vrai / true en cas de succs - et faux / false en cas d'chec. -

-

- D'autres exemples... -$variable = null; -$this->assertNull($variable, 'Should be cleared'); -]]> - ...passera et normalement n'affichera aucun message. - Si vous avez - configur le testeur pour afficher aussi les succs - alors le message sera affich comme tel. -$this->assertIdentical(0, false, 'Zero is not false [%s]'); -]]> - Ceci chouera tant donn qu'il effectue une vrification - sur le type en plus d'une comparaison sur les deux valeurs. - La partie "%s" est remplace par le message d'erreur - par dfaut qui aurait t affich si nous n'avions pas fourni le ntre. - Cela nous permet d'emboter les messages de test. -$a = 1; -$b = $a; -$this->assertReference($a, $b); -]]> - chouera tant donn que la variable $b - est une copie de $a. -$this->assertWantedPattern('/hello/i', 'Hello world'); -]]> - L, a passe puisque la recherche est insensible - la casse et que donc hello - est bien reprable dans Hello world. -trigger_error('Disaster'); -trigger_error('Catastrophe'); -$this->assertError(); -$this->assertError('Catastrophe'); -$this->assertNoErrors(); -]]> - Ici, il y a besoin d'une petite explication : - toutes passent ! -

-

- Les erreurs PHP dans SimpleTest sont piges et - places dans une queue. Ici la premire vrification - d'erreur attrape le message "Disaster" - sans vrifier le texte et passe. Rsultat : - l'erreur est supprime de la queue. - La vrification suivante teste non seulement l'existence - de l'erreur mais aussi le texte qui correspond : - un autre succs. Dsormais la queue est vide - et le dernier test passe aussi. - Si une autre erreur non vrifie est encore - dans la queue la fin de notre mthode de test - alors une exception sera rapporte dans le test. - Notez que SimpleTest ne peut pas attraper les erreurs PHP la compilation. -

-

- Les scnarios de test peuvent utiliser des mthodes - bien pratiques pour dboguer le code ou pour tendre la suite... - - - - - - - - - - -
setUp()Est lance avant chaque mthode de test
tearDown()Est lance aprs chaque mthode de test
pass()Envoie un succs
fail()Envoie un chec
error()Envoi un vnement exception
sendMessage()Envoie un message d'tat aux systmes d'affichage qui le supporte
signal($type, $payload)Envoie un message dfini par l'utilisateur au rapporteur du test
dump($var)Effectue un print_r() format pour du dboguage rapide et grossier
swallowErrors()Vide les erreurs de la queue
-

-
-
-

- Bien sr des mthodes supplmentaires de test - peuvent tre ajoutes pour crer d'autres types - de scnario de test afin d'tendre le framework... - -class FileTester extends UnitTestCase { - function FileTester($name = false) { - $this->UnitTestCase($name); - } - - function assertFileExists($filename, $message = '%s') { - $this->assertTrue( - file_exists($filename), - sprintf($message, 'File [$filename] existence check')); - } -} -]]> - Ici la bibliothque SimpleTest est localise - dans un rpertoire local appel simpletest. - Pensez le modifier pour votre propre environnement. -

-

- Alternativement vous pourriez utiliser dans votre code - un directive SimpleTestOptions::ignore('FileTester');. -

-

- Ce nouveau scnario peut tre hrit exactement - comme un scnario de test classique... -FileTester { - - function setUp() { - @unlink('../temp/test.txt'); - } - - function tearDown() { - @unlink('../temp/test.txt'); - } - - function testCreation() { - $writer = &new FileWriter('../temp/test.txt'); - $writer->write('Hello'); - $this->assertFileExists('../temp/test.txt'); - } -} -]]> -

-

- Si vous souhaitez un scnario de test sans - toutes les assertions de UnitTestCase - mais uniquement avec les vtres propres, - vous aurez besoin d'tendre la classe - SimpleTestCase la place. - Elle se trouve dans simple_test.php - en lieu et place de unit_tester.php. - A consulter plus tard - si vous souhaitez incorporer les scnarios - d'autres testeurs unitaires dans votre suite de test. -

-
-
-

- Ce n'est pas souvent qu'il faille lancer des scnarios - avec un unique test. Sauf lorsqu'il s'agit de s'arracher - les cheveux sur un module problme sans pour - autant dsorganiser la suite de test principale. - Avec autorun aucun chafaudage particulier - n'est ncessaire, il suffit de lancer votre test et - vous y tes. -

-

- Vous pouvez mme dcider quel rapporteur - (par exemple, TextReporter ou HtmlReporter) - vous prfrez pour un fichier spcifique quand il est lanc - tout seul... - -SimpleTest :: prefer(new TextReporter()); -require_once('../classes/writer.php'); - -class FileTestCase extends UnitTestCase { - ... -} -?> -]]> - Ce script sera lanc tel que mais il n'y aura - aucun succs ou chec avant que des mthodes de test soient ajoutes. -

-
-
- - - Scnarios de test unitaire - et oprations basiques. - - - tendre des scnarios de test - pour les personnaliser votre propre projet. - - - Lancer un scnario seul - comme un script unique. - - - - - La page de SimpleTest sur - SourceForge. - - - La page de tlchargement de SimpleTest sur - LastCraft. - - - L'API complte de SimpleTest - partir de PHPDoc. - - - - - test unitaire php, - test d'intgration, - documentation, - marcus baker, - perrick penet - simple test, - documentation simpletest, - phpunit, - junit, - xunit - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/web_tester_documentation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/web_tester_documentation.xml deleted file mode 100644 index 289ce5c..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/docs/source/fr/web_tester_documentation.xml +++ /dev/null @@ -1,377 +0,0 @@ - - - - - Documentation SimpleTest : tester des scripts web - -
-

- Tester des classes c'est trs bien. - Reste que PHP est avant tout un langage - pour crer des fonctionnalits l'intrieur de pages web. - Comment pouvons tester la partie de devant - -- celle de l'interface -- dans nos applications en PHP ? - Etant donn qu'une page web n'est constitue que de texte, - nous devrions pouvoir les examiner exactement - comme n'importe quelle autre donne de test. -

-

- Cela nous amne une situation dlicate. - Si nous testons dans un niveau trop bas, - vrifier des balises avec un motif ad hoc par exemple, - nos tests seront trop fragiles. Le moindre changement - dans la prsentation pourrait casser un grand nombre de test. - Si nos tests sont situs trop haut, en utilisant - une version fantaisie du moteur de template pour - donner un cas prcis, alors nous perdons compltement - la capacit automatiser certaines classes de test. - Par exemple, l'interaction entre des formulaires - et la navigation devra tre test manuellement. - Ces types de test sont extrmement fastidieux - et plutt sensibles aux erreurs. -

-

- SimpleTest comprend une forme spciale de scnario - de test pour tester les actions d'une page web. - WebTestCase inclut des facilits pour la navigation, - des vrifications sur le contenu - et les cookies ainsi que la gestion des formulaires. - Utiliser ces scnarios de test ressemble - fortement UnitTestCase... -class TestOfLastcraft extends WebTestCase { -} -]]> - Ici nous sommes sur le point de tester - le site de Last Craft. - Si ce scnario de test est situ dans un fichier appel - lastcraft_test.php alors il peut tre charg - dans un script de lancement tout comme des tests unitaires... - -require_once('simpletest/web_tester.php'); -SimpleTest::prefer(new TextReporter()); - -class WebTests extends TestSuite { - function WebTests() { - $this->TestSuite('Web site tests'); - $this->addFile('lastcraft_test.php'); - } -} -?> -]]> - J'utilise ici le rapporteur en mode texte - pour mieux distinguer le contenu au format HTML - du rsultat du test proprement dit. -

-

- Rien n'est encore test. Nous pouvons tlcharger - la page d'accueil en utilisant la mthode get()... - - function testHomepage() { - $this->assertTrue($this->get('http://www.lastcraft.com/')); - } -} -]]> - La mthode get() renverra "true" - uniquement si le contenu de la page a bien t tlcharg. - C'est un moyen simple, mais efficace pour vrifier - qu'une page web a bien t dlivr par le serveur web. - Cependant le contenu peut rvler tre une erreur 404 - et dans ce cas notre mthode get() renverrait encore un succs. -

-

- En supposant que le serveur web pour le site Last Craft - soit oprationnel (malheureusement ce n'est pas toujours le cas), - nous devrions voir... -

-Web site tests
-OK
-Test cases run: 1/1, Failures: 0, Exceptions: 0
-
- Nous avons vrifi qu'une page, de n'importe quel type, - a bien t renvoye. Nous ne savons pas encore - s'il s'agit de celle que nous souhaitions. -

-
-
-

- Pour obtenir la confirmation que la page tlcharge - est bien celle que nous attendions, - nous devons vrifier son contenu. - - $this->get('http://www.lastcraft.com/'); - $this->assertWantedPattern('/why the last craft/i'); - } -} -]]> - La page obtenue par le dernier tlchargement est - place dans un buffer au sein mme du scnario de test. - Il n'est donc pas ncessaire de s'y rfrer directement. - La correspondance du motif est toujours effectue - par rapport ce buffer. -

-

- Voici une liste possible d'assertions sur le contenu... - - - - - - - - - - - - - - - - - - - -
assertWantedPattern($pattern)Vrifier une correspondance sur le contenu via une expression rationnelle Perl
assertNoUnwantedPattern($pattern)Une expression rationnelle Perl pour vrifier une absence
assertTitle($title)Passe si le titre de la page correspond exactement
assertLink($label)Passe si un lien avec ce texte est prsent
assertNoLink($label)Passe si aucun lien avec ce texte est prsent
assertLinkById($id)Passe si un lien avec cet attribut d'identification est prsent
assertField($name, $value)Passe si une balise input avec ce nom contient cette valeur
assertFieldById($id, $value)Passe si une balise input avec cet identifiant contient cette valeur
assertResponse($codes)Passe si la rponse HTTP trouve une correspondance dans la liste
assertMime($types)Passe si le type MIME se retrouve dans cette liste
assertAuthentication($protocol)Passe si l'authentification provoque est de ce type de protocole
assertNoAuthentication()Passe s'il n'y pas d'authentification provoque en cours
assertRealm($name)Passe si le domaine provoqu correspond
assertHeader($header, $content)Passe si une entte tlcharge correspond cette valeur
assertNoUnwantedHeader($header)Passe si une entte n'a pas t tlcharg
assertHeaderPattern($header, $pattern)Passe si une entte tlcharge correspond cette expression rationnelle Perl
assertCookie($name, $value)Passe s'il existe un cookie correspondant
assertNoCookie($name)Passe s'il n'y a pas de cookie avec un tel nom
- Comme d'habitude avec les assertions de SimpleTest, - elles renvoient toutes "false" en cas d'chec - et "true" si c'est un succs. - Elles renvoient aussi un message de test optionnel : - vous pouvez l'ajouter dans votre propre message en utilisant "%s". -

-

- A prsent nous pourrions effectu le test sur le titre uniquement... -$this->assertTitle('The Last Craft?'); -]]> - En plus d'une simple vrification sur le contenu HTML, - nous pouvons aussi vrifier que le type MIME est bien d'un type acceptable... -$this->assertMime(array('text/plain', 'text/html')); -]]> - Plus intressant encore est la vrification sur - le code de la rponse HTTP. Pareillement au type MIME, - nous pouvons nous assurer que le code renvoy se trouve - bien dans un liste de valeurs possibles... -get('http://simpletest.sourceforge.net/'); - $this->assertResponse(200); - } -} -]]> - Ici nous vrifions que le tlchargement s'est - bien termin en ne permettant qu'une rponse HTTP 200. - Ce test passera, mais ce n'est pas la meilleure faon de procder. - Il n'existe aucune page sur http://simpletest.sourceforge.net/, - la place le serveur renverra une redirection vers - http://www.lastcraft.com/simple_test.php. - WebTestCase suit automatiquement trois - de ces redirections. Les tests sont quelque peu plus - robustes de la sorte. Surtout qu'on est souvent plus intress - par l'interaction entre les pages que de leur simple livraison. - Si les redirections se rvlent tre digne d'intrt, - il reste possible de les supprimer... - - $this->setMaximumRedirects(0); - $this->get('http://simpletest.sourceforge.net/'); - $this->assertResponse(200); - } -} -]]> - Alors l'assertion choue comme prvue... -

-Web site tests
-1) Expecting response in [200] got [302]
-    in testhomepage
-    in testoflastcraft
-    in lastcraft_test.php
-FAILURES!!!
-Test cases run: 1/1, Failures: 1, Exceptions: 0
-
- Nous pouvons modifier le test pour accepter les redirections... -setMaximumRedirects(0); - $this->get('http://simpletest.sourceforge.net/'); - $this->assertResponse(array(301, 302, 303, 307)); - } -} -]]> - Maitenant a passe. -

-
-
-

- Les utilisateurs ne naviguent pas souvent en tapant les URLs, - mais surtout en cliquant sur des liens et des boutons. - Ici nous confirmons que les informations sur le contact - peuvent tre atteintes depuis la page d'accueil... -get('http://www.lastcraft.com/'); - $this->clickLink('About'); - $this->assertTitle('About Last Craft'); - } -} -]]> - Le paramtre est le texte du lien. -

-

- Il l'objectif est un bouton plutt qu'une balise ancre, - alors clickSubmit() doit tre utilis avec - le titre du bouton... -$this->clickSubmit('Go!'); -]]> -

-

- La liste des mthodes de navigation est... - - - - - - - - - - - - - - - - - - - - - -
get($url, $parameters)Envoie une requte GET avec ces paramtres
post($url, $parameters)Envoie une requte POST avec ces paramtres
head($url, $parameters)Envoie une requte HEAD sans remplacer le contenu de la page
retry()Relance la dernire requte
back()Identique au bouton "Prcdent" du navigateur
forward()Identique au bouton "Suivant" du navigateur
authenticate($name, $password)Re-essaye avec une tentative d'authentification
getFrameFocus()Le nom de la fentre en cours d'utilisation
setFrameFocusByIndex($choice)Change le focus d'une fentre en commenant par 1
setFrameFocus($name)Change le focus d'une fentre en utilisant son nom
clearFrameFocus()Revient un traitement de toutes les fentres comme une seule
clickSubmit($label)Clique sur le premier bouton avec cette tiquette
clickSubmitByName($name)Clique sur le bouton avec cet attribut de nom
clickSubmitById($id)Clique sur le bouton avec cet attribut d'identification
clickImage($label, $x, $y)Clique sur une balise input de type image par son titre (title="*") our son texte alternatif (alt="*")
clickImageByName($name, $x, $y)Clique sur une balise input de type image par son attribut (name="*")
clickImageById($id, $x, $y)Clique sur une balise input de type image par son identifiant (id="*")
submitFormById($id)Soumet un formulaire sans valeur de soumission
clickLink($label, $index)Clique sur une ancre avec ce texte d'tiquette visible
clickLinkById($id)Clique sur une ancre avec cet attribut d'identification
-

-

- Les paramtres dans les mthodes get(), - post() et head() sont optionnels. - Le tlchargement via HTTP HEAD ne modifie pas - le contexte du navigateur, il se limite au chargement des cookies. - Cela peut tre utilise lorsqu'une image ou une feuille de style - initie un cookie pour bloquer un robot trop entreprenant. -

-

- Les commandes retry(), back() - et forward() fonctionnent exactement comme - dans un navigateur. Elles utilisent l'historique pour - relancer les pages. Une technique bien pratique pour - vrifier les effets d'un bouton retour sur vos formulaires. -

-

- Les mthodes sur les fentres mritent une petite explication. - Par dfaut, une page avec des fentres est traite comme toutes - les autres. Le contenu sera vrifi travers l'ensemble de - la "frameset", par consquent un lien fonctionnera, - peu importe la fentre qui contient la balise ancre. - Vous pouvez outrepass ce comportement en exigeant - le focus sur une unique fentre. Si vous ralisez cela, - toutes les recherches et toutes les actions se limiteront - cette unique fentre, y compris les demandes d'authentification. - Si un lien ou un bouton n'est pas dans la fentre en focus alors - il ne peut pas tre cliqu. -

-

- Tester la navigation sur des pages fixes ne vous alerte que - quand vous avez cass un script entier. - Pour des pages fortement dynamiques, - un forum de discussion par exemple, - a peut tre crucial pour vrifier l'tat de l'application. - Pour la plupart des applications cependant, - la logique vraiment dlicate se situe dans la gestion - des formulaires et des sessions. - Heureusement SimpleTest aussi inclut - - des outils pour tester des formulaires web. -

-
-
-

- Bien que SimpleTest n'ait pas comme objectif - de contrler des erreurs rseau, il contient quand mme - des mthodes pour modifier et dboguer les requtes qu'il lance. - Voici une autre liste de mthode... - - - - - - - - - - - - -
getTransportError()La dernire erreur de socket
getUrl()La localisation courante
showRequest()Dverse la requte sortante
showHeaders()Dverse les enttes d'entre
showSource()Dverse le contenu brut de la page HTML
ignoreFrames()Ne recharge pas les framesets
setCookie($name, $value)Initie un cookie partir de maintenant
addHeader($header)Ajoute toujours cette entte la requte
setMaximumRedirects($max)S'arrte aprs autant de redirections
setConnectionTimeout($timeout)Termine la connexion aprs autant de temps entre les bytes
useProxy($proxy, $name, $password)Effectue les requtes travers ce proxy d'URL
-

-
-
- - - Russir tlcharger une page web - - - Tester le contenu de la page - - - Naviguer sur un site web pendant le test - - - Mthodes pour modifier une requte et pour dboguer - - - - - La page du projet SimpleTest sur - SourceForge. - - - La page de tlchargement de SimpleTest sur - LastCraft. - - - L'API du dveloppeur pour SimpleTest - donne tous les dtails sur les classes et les assertions disponibles. - - - - - dveloppement logiciel, - programmation php pour des clients, - php orient client, - outils de dveloppement logiciel, - framework de test de recette, - scripts php gratuits, - architecture, - ressources php, - HTMLUnit, - JWebUnit, - test php, - ressource de test unitaire, - test web - - -
\ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/dumper.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/dumper.php deleted file mode 100644 index ef2662d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/dumper.php +++ /dev/null @@ -1,359 +0,0 @@ -getType($value); - switch($type) { - case "Null": - return "NULL"; - case "Boolean": - return "Boolean: " . ($value ? "true" : "false"); - case "Array": - return "Array: " . count($value) . " items"; - case "Object": - return "Object: of " . get_class($value); - case "String": - return "String: " . $this->clipString($value, 200); - default: - return "$type: $value"; - } - return "Unknown"; - } - - /** - * Gets the string representation of a type. - * @param mixed $value Variable to check against. - * @return string Type. - * @access public - */ - function getType($value) { - if (! isset($value)) { - return "Null"; - } elseif (is_bool($value)) { - return "Boolean"; - } elseif (is_string($value)) { - return "String"; - } elseif (is_integer($value)) { - return "Integer"; - } elseif (is_float($value)) { - return "Float"; - } elseif (is_array($value)) { - return "Array"; - } elseif (is_resource($value)) { - return "Resource"; - } elseif (is_object($value)) { - return "Object"; - } - return "Unknown"; - } - - /** - * Creates a human readable description of the - * difference between two variables. Uses a - * dynamic call. - * @param mixed $first First variable. - * @param mixed $second Value to compare with. - * @param boolean $identical If true then type anomolies count. - * @return string Description of difference. - * @access public - */ - function describeDifference($first, $second, $identical = false) { - if ($identical) { - if (! $this->isTypeMatch($first, $second)) { - return "with type mismatch as [" . $this->describeValue($first) . - "] does not match [" . $this->describeValue($second) . "]"; - } - } - $type = $this->getType($first); - if ($type == "Unknown") { - return "with unknown type"; - } - $method = 'describe' . $type . 'Difference'; - return $this->$method($first, $second, $identical); - } - - /** - * Tests to see if types match. - * @param mixed $first First variable. - * @param mixed $second Value to compare with. - * @return boolean True if matches. - * @access private - */ - protected function isTypeMatch($first, $second) { - return ($this->getType($first) == $this->getType($second)); - } - - /** - * Clips a string to a maximum length. - * @param string $value String to truncate. - * @param integer $size Minimum string size to show. - * @param integer $position Centre of string section. - * @return string Shortened version. - * @access public - */ - function clipString($value, $size, $position = 0) { - $length = strlen($value); - if ($length <= $size) { - return $value; - } - $position = min($position, $length); - $start = ($size/2 > $position ? 0 : $position - $size/2); - if ($start + $size > $length) { - $start = $length - $size; - } - $value = substr($value, $start, $size); - return ($start > 0 ? "..." : "") . $value . ($start + $size < $length ? "..." : ""); - } - - /** - * Creates a human readable description of the - * difference between two variables. The minimal - * version. - * @param null $first First value. - * @param mixed $second Value to compare with. - * @return string Human readable description. - * @access private - */ - protected function describeGenericDifference($first, $second) { - return "as [" . $this->describeValue($first) . - "] does not match [" . - $this->describeValue($second) . "]"; - } - - /** - * Creates a human readable description of the - * difference between a null and another variable. - * @param null $first First null. - * @param mixed $second Null to compare with. - * @param boolean $identical If true then type anomolies count. - * @return string Human readable description. - * @access private - */ - protected function describeNullDifference($first, $second, $identical) { - return $this->describeGenericDifference($first, $second); - } - - /** - * Creates a human readable description of the - * difference between a boolean and another variable. - * @param boolean $first First boolean. - * @param mixed $second Boolean to compare with. - * @param boolean $identical If true then type anomolies count. - * @return string Human readable description. - * @access private - */ - protected function describeBooleanDifference($first, $second, $identical) { - return $this->describeGenericDifference($first, $second); - } - - /** - * Creates a human readable description of the - * difference between a string and another variable. - * @param string $first First string. - * @param mixed $second String to compare with. - * @param boolean $identical If true then type anomolies count. - * @return string Human readable description. - * @access private - */ - protected function describeStringDifference($first, $second, $identical) { - if (is_object($second) || is_array($second)) { - return $this->describeGenericDifference($first, $second); - } - $position = $this->stringDiffersAt($first, $second); - $message = "at character $position"; - $message .= " with [" . - $this->clipString($first, 200, $position) . "] and [" . - $this->clipString($second, 200, $position) . "]"; - return $message; - } - - /** - * Creates a human readable description of the - * difference between an integer and another variable. - * @param integer $first First number. - * @param mixed $second Number to compare with. - * @param boolean $identical If true then type anomolies count. - * @return string Human readable description. - * @access private - */ - protected function describeIntegerDifference($first, $second, $identical) { - if (is_object($second) || is_array($second)) { - return $this->describeGenericDifference($first, $second); - } - return "because [" . $this->describeValue($first) . - "] differs from [" . - $this->describeValue($second) . "] by " . - abs($first - $second); - } - - /** - * Creates a human readable description of the - * difference between two floating point numbers. - * @param float $first First float. - * @param mixed $second Float to compare with. - * @param boolean $identical If true then type anomolies count. - * @return string Human readable description. - * @access private - */ - protected function describeFloatDifference($first, $second, $identical) { - if (is_object($second) || is_array($second)) { - return $this->describeGenericDifference($first, $second); - } - return "because [" . $this->describeValue($first) . - "] differs from [" . - $this->describeValue($second) . "] by " . - abs($first - $second); - } - - /** - * Creates a human readable description of the - * difference between two arrays. - * @param array $first First array. - * @param mixed $second Array to compare with. - * @param boolean $identical If true then type anomolies count. - * @return string Human readable description. - * @access private - */ - protected function describeArrayDifference($first, $second, $identical) { - if (! is_array($second)) { - return $this->describeGenericDifference($first, $second); - } - if (! $this->isMatchingKeys($first, $second, $identical)) { - return "as key list [" . - implode(", ", array_keys($first)) . "] does not match key list [" . - implode(", ", array_keys($second)) . "]"; - } - foreach (array_keys($first) as $key) { - if ($identical && ($first[$key] === $second[$key])) { - continue; - } - if (! $identical && ($first[$key] == $second[$key])) { - continue; - } - return "with member [$key] " . $this->describeDifference( - $first[$key], - $second[$key], - $identical); - } - return ""; - } - - /** - * Compares two arrays to see if their key lists match. - * For an identical match, the ordering and types of the keys - * is significant. - * @param array $first First array. - * @param array $second Array to compare with. - * @param boolean $identical If true then type anomolies count. - * @return boolean True if matching. - * @access private - */ - protected function isMatchingKeys($first, $second, $identical) { - $first_keys = array_keys($first); - $second_keys = array_keys($second); - if ($identical) { - return ($first_keys === $second_keys); - } - sort($first_keys); - sort($second_keys); - return ($first_keys == $second_keys); - } - - /** - * Creates a human readable description of the - * difference between a resource and another variable. - * @param resource $first First resource. - * @param mixed $second Resource to compare with. - * @param boolean $identical If true then type anomolies count. - * @return string Human readable description. - * @access private - */ - protected function describeResourceDifference($first, $second, $identical) { - return $this->describeGenericDifference($first, $second); - } - - /** - * Creates a human readable description of the - * difference between two objects. - * @param object $first First object. - * @param mixed $second Object to compare with. - * @param boolean $identical If true then type anomolies count. - * @return string Human readable description. - * @access private - */ - protected function describeObjectDifference($first, $second, $identical) { - if (! is_object($second)) { - return $this->describeGenericDifference($first, $second); - } - return $this->describeArrayDifference( - get_object_vars($first), - get_object_vars($second), - $identical); - } - - /** - * Find the first character position that differs - * in two strings by binary chop. - * @param string $first First string. - * @param string $second String to compare with. - * @return integer Position of first differing - * character. - * @access private - */ - protected function stringDiffersAt($first, $second) { - if (! $first || ! $second) { - return 0; - } - if (strlen($first) < strlen($second)) { - list($first, $second) = array($second, $first); - } - $position = 0; - $step = strlen($first); - while ($step > 1) { - $step = (integer)(($step + 1) / 2); - if (strncmp($first, $second, $position + $step) == 0) { - $position += $step; - } - } - return $position; - } - - /** - * Sends a formatted dump of a variable to a string. - * @param mixed $variable Variable to display. - * @return string Output from print_r(). - * @access public - */ - function dump($variable) { - ob_start(); - print_r($variable); - $formatted = ob_get_contents(); - ob_end_clean(); - return $formatted; - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/eclipse.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/eclipse.php deleted file mode 100644 index bd0349a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/eclipse.php +++ /dev/null @@ -1,307 +0,0 @@ -listener = &$listener; - $this->SimpleScorer(); - $this->case = ""; - $this->group = ""; - $this->method = ""; - $this->cc = $cc; - $this->error = false; - $this->fail = false; - } - - /** - * Means to display human readable object comparisons. - * @return SimpleDumper Visual comparer. - */ - function getDumper() { - return new SimpleDumper(); - } - - /** - * Localhost connection from Eclipse. - * @param integer $port Port to connect to Eclipse. - * @param string $host Normally localhost. - * @return SimpleSocket Connection to Eclipse. - */ - function &createListener($port, $host="127.0.0.1"){ - $tmplistener = &new SimpleSocket($host, $port, 5); - return $tmplistener; - } - - /** - * Wraps the test in an output buffer. - * @param SimpleInvoker $invoker Current test runner. - * @return EclipseInvoker Decorator with output buffering. - * @access public - */ - function &createInvoker(&$invoker){ - $eclinvoker = &new EclipseInvoker($invoker, $this->listener); - return $eclinvoker; - } - - /** - * C style escaping. - * @param string $raw String with backslashes, quotes and whitespace. - * @return string Replaced with C backslashed tokens. - */ - function escapeVal($raw){ - $needle = array("\\","\"","/","\b","\f","\n","\r","\t"); - $replace = array('\\\\','\"','\/','\b','\f','\n','\r','\t'); - return str_replace($needle, $replace, $raw); - } - - /** - * Stash the first passing item. Clicking the test - * item goes to first pass. - * @param string $message Test message, but we only wnat the first. - * @access public - */ - function paintPass($message){ - if (! $this->pass){ - $this->message = $this->escapeVal($message); - } - $this->pass = true; - } - - /** - * Stash the first failing item. Clicking the test - * item goes to first fail. - * @param string $message Test message, but we only wnat the first. - * @access public - */ - function paintFail($message){ - //only get the first failure or error - if (! $this->fail && ! $this->error){ - $this->fail = true; - $this->message = $this->escapeVal($message); - $this->listener->write('{status:"fail",message:"'.$this->message.'",group:"'.$this->group.'",case:"'.$this->case.'",method:"'.$this->method.'"}'); - } - } - - /** - * Stash the first error. Clicking the test - * item goes to first error. - * @param string $message Test message, but we only wnat the first. - * @access public - */ - function paintError($message){ - if (! $this->fail && ! $this->error){ - $this->error = true; - $this->message = $this->escapeVal($message); - $this->listener->write('{status:"error",message:"'.$this->message.'",group:"'.$this->group.'",case:"'.$this->case.'",method:"'.$this->method.'"}'); - } - } - - - /** - * Stash the first exception. Clicking the test - * item goes to first message. - * @param string $message Test message, but we only wnat the first. - * @access public - */ - function paintException($exception){ - if (! $this->fail && ! $this->error){ - $this->error = true; - $message = 'Unexpected exception of type[' . get_class($exception) . - '] with message [' . $exception->getMessage() . '] in [' . - $exception->getFile() .' line '. $exception->getLine() . ']'; - $this->message = $this->escapeVal($message); - $this->listener->write( - '{status:"error",message:"' . $this->message . '",group:"' . - $this->group . '",case:"' . $this->case . '",method:"' . $this->method - . '"}'); - } - } - - - /** - * We don't display any special header. - * @param string $test_name First test top level - * to start. - * @access public - */ - function paintHeader($test_name) { - } - - /** - * We don't display any special footer. - * @param string $test_name The top level test. - * @access public - */ - function paintFooter($test_name) { - } - - /** - * Paints nothing at the start of a test method, but stash - * the method name for later. - * @param string $test_name Name of test that is starting. - * @access public - */ - function paintMethodStart($method) { - $this->pass = false; - $this->fail = false; - $this->error = false; - $this->method = $this->escapeVal($method); - } - - /** - * Only send one message if the test passes, after that - * suppress the message. - * @param string $test_name Name of test that is ending. - * @access public - */ - function paintMethodEnd($method){ - if ($this->fail || $this->error || ! $this->pass){ - } else { - $this->listener->write( - '{status:"pass",message:"' . $this->message . '",group:"' . - $this->group . '",case:"' . $this->case . '",method:"' . - $this->method . '"}'); - } - } - - /** - * Stashes the test case name for the later failure message. - * @param string $test_name Name of test or other label. - * @access public - */ - function paintCaseStart($case){ - $this->case = $this->escapeVal($case); - } - - /** - * Drops the name. - * @param string $test_name Name of test or other label. - * @access public - */ - function paintCaseEnd($case){ - $this->case = ""; - } - - /** - * Stashes the name of the test suite. Starts test coverage - * if enabled. - * @param string $group Name of test or other label. - * @param integer $size Number of test cases starting. - * @access public - */ - function paintGroupStart($group, $size){ - $this->group = $this->escapeVal($group); - if ($this->cc){ - if (extension_loaded('xdebug')){ - xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); - } - } - } - - /** - * Paints coverage report if enabled. - * @param string $group Name of test or other label. - * @access public - */ - function paintGroupEnd($group){ - $this->group = ""; - $cc = ""; - if ($this->cc){ - if (extension_loaded('xdebug')){ - $arrfiles = xdebug_get_code_coverage(); - xdebug_stop_code_coverage(); - $thisdir = dirname(__FILE__); - $thisdirlen = strlen($thisdir); - foreach ($arrfiles as $index=>$file){ - if (substr($index, 0, $thisdirlen)===$thisdir){ - continue; - } - $lcnt = 0; - $ccnt = 0; - foreach ($file as $line){ - if ($line == -2){ - continue; - } - $lcnt++; - if ($line==1){ - $ccnt++; - } - } - if ($lcnt > 0){ - $cc .= round(($ccnt/$lcnt) * 100, 2) . '%'; - }else{ - $cc .= "0.00%"; - } - $cc.= "\t". $index . "\n"; - } - } - } - $this->listener->write('{status:"coverage",message:"' . - EclipseReporter::escapeVal($cc) . '"}'); - } -} - -/** - * Invoker decorator for Eclipse. Captures output until - * the end of the test. - * @package SimpleTest - * @subpackage Eclipse - */ -class EclipseInvoker extends SimpleInvokerDecorator{ - function __construct(&$invoker, &$listener) { - $this->listener = &$listener; - $this->SimpleInvokerDecorator($invoker); - } - - /** - * Starts output buffering. - * @param string $method Test method to call. - * @access public - */ - function before($method){ - ob_start(); - $this->invoker->before($method); - } - - /** - * Stops output buffering and send the captured output - * to the listener. - * @param string $method Test method to call. - * @access public - */ - function after($method) { - $this->invoker->after($method); - $output = ob_get_contents(); - ob_end_clean(); - if ($output !== ""){ - $result = $this->listener->write('{status:"info",message:"' . - EclipseReporter::escapeVal($output) . '"}'); - } - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/encoding.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/encoding.php deleted file mode 100644 index e44964d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/encoding.php +++ /dev/null @@ -1,552 +0,0 @@ -key = $key; - $this->value = $value; - } - - /** - * The pair as a single string. - * @return string Encoded pair. - * @access public - */ - function asRequest() { - return urlencode($this->key) . '=' . urlencode($this->value); - } - - /** - * The MIME part as a string. - * @return string MIME part encoding. - * @access public - */ - function asMime() { - $part = 'Content-Disposition: form-data; '; - $part .= "name=\"" . $this->key . "\"\r\n"; - $part .= "\r\n" . $this->value; - return $part; - } - - /** - * Is this the value we are looking for? - * @param string $key Identifier. - * @return boolean True if matched. - * @access public - */ - function isKey($key) { - return $key == $this->key; - } - - /** - * Is this the value we are looking for? - * @return string Identifier. - * @access public - */ - function getKey() { - return $this->key; - } - - /** - * Is this the value we are looking for? - * @return string Content. - * @access public - */ - function getValue() { - return $this->value; - } -} - -/** - * Single post parameter. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleAttachment { - private $key; - private $content; - private $filename; - - /** - * Stashes the data for rendering later. - * @param string $key Key to add value to. - * @param string $content Raw data. - * @param hash $filename Original filename. - */ - function __construct($key, $content, $filename) { - $this->key = $key; - $this->content = $content; - $this->filename = $filename; - } - - /** - * The pair as a single string. - * @return string Encoded pair. - * @access public - */ - function asRequest() { - return ''; - } - - /** - * The MIME part as a string. - * @return string MIME part encoding. - * @access public - */ - function asMime() { - $part = 'Content-Disposition: form-data; '; - $part .= 'name="' . $this->key . '"; '; - $part .= 'filename="' . $this->filename . '"'; - $part .= "\r\nContent-Type: " . $this->deduceMimeType(); - $part .= "\r\n\r\n" . $this->content; - return $part; - } - - /** - * Attempts to figure out the MIME type from the - * file extension and the content. - * @return string MIME type. - * @access private - */ - protected function deduceMimeType() { - if ($this->isOnlyAscii($this->content)) { - return 'text/plain'; - } - return 'application/octet-stream'; - } - - /** - * Tests each character is in the range 0-127. - * @param string $ascii String to test. - * @access private - */ - protected function isOnlyAscii($ascii) { - for ($i = 0, $length = strlen($ascii); $i < $length; $i++) { - if (ord($ascii[$i]) > 127) { - return false; - } - } - return true; - } - - /** - * Is this the value we are looking for? - * @param string $key Identifier. - * @return boolean True if matched. - * @access public - */ - function isKey($key) { - return $key == $this->key; - } - - /** - * Is this the value we are looking for? - * @return string Identifier. - * @access public - */ - function getKey() { - return $this->key; - } - - /** - * Is this the value we are looking for? - * @return string Content. - * @access public - */ - function getValue() { - return $this->filename; - } -} - -/** - * Bundle of GET/POST parameters. Can include - * repeated parameters. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleEncoding { - private $request; - - /** - * Starts empty. - * @param array $query Hash of parameters. - * Multiple values are - * as lists on a single key. - * @access public - */ - function __construct($query = false) { - if (! $query) { - $query = array(); - } - $this->clear(); - $this->merge($query); - } - - /** - * Empties the request of parameters. - * @access public - */ - function clear() { - $this->request = array(); - } - - /** - * Adds a parameter to the query. - * @param string $key Key to add value to. - * @param string/array $value New data. - * @access public - */ - function add($key, $value) { - if ($value === false) { - return; - } - if (is_array($value)) { - foreach ($value as $item) { - $this->addPair($key, $item); - } - } else { - $this->addPair($key, $value); - } - } - - /** - * Adds a new value into the request. - * @param string $key Key to add value to. - * @param string/array $value New data. - * @access private - */ - protected function addPair($key, $value) { - $this->request[] = new SimpleEncodedPair($key, $value); - } - - /** - * Adds a MIME part to the query. Does nothing for a - * form encoded packet. - * @param string $key Key to add value to. - * @param string $content Raw data. - * @param hash $filename Original filename. - * @access public - */ - function attach($key, $content, $filename) { - $this->request[] = new SimpleAttachment($key, $content, $filename); - } - - /** - * Adds a set of parameters to this query. - * @param array/SimpleQueryString $query Multiple values are - * as lists on a single key. - * @access public - */ - function merge($query) { - if (is_object($query)) { - $this->request = array_merge($this->request, $query->getAll()); - } elseif (is_array($query)) { - foreach ($query as $key => $value) { - $this->add($key, $value); - } - } - } - - /** - * Accessor for single value. - * @return string/array False if missing, string - * if present and array if - * multiple entries. - * @access public - */ - function getValue($key) { - $values = array(); - foreach ($this->request as $pair) { - if ($pair->isKey($key)) { - $values[] = $pair->getValue(); - } - } - if (count($values) == 0) { - return false; - } elseif (count($values) == 1) { - return $values[0]; - } else { - return $values; - } - } - - /** - * Accessor for listing of pairs. - * @return array All pair objects. - * @access public - */ - function getAll() { - return $this->request; - } - - /** - * Renders the query string as a URL encoded - * request part. - * @return string Part of URL. - * @access protected - */ - protected function encode() { - $statements = array(); - foreach ($this->request as $pair) { - if ($statement = $pair->asRequest()) { - $statements[] = $statement; - } - } - return implode('&', $statements); - } -} - -/** - * Bundle of GET parameters. Can include - * repeated parameters. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleGetEncoding extends SimpleEncoding { - - /** - * Starts empty. - * @param array $query Hash of parameters. - * Multiple values are - * as lists on a single key. - * @access public - */ - function __construct($query = false) { - parent::__construct($query); - } - - /** - * HTTP request method. - * @return string Always GET. - * @access public - */ - function getMethod() { - return 'GET'; - } - - /** - * Writes no extra headers. - * @param SimpleSocket $socket Socket to write to. - * @access public - */ - function writeHeadersTo(&$socket) { - } - - /** - * No data is sent to the socket as the data is encoded into - * the URL. - * @param SimpleSocket $socket Socket to write to. - * @access public - */ - function writeTo(&$socket) { - } - - /** - * Renders the query string as a URL encoded - * request part for attaching to a URL. - * @return string Part of URL. - * @access public - */ - function asUrlRequest() { - return $this->encode(); - } -} - -/** - * Bundle of URL parameters for a HEAD request. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleHeadEncoding extends SimpleGetEncoding { - - /** - * Starts empty. - * @param array $query Hash of parameters. - * Multiple values are - * as lists on a single key. - * @access public - */ - function SimpleHeadEncoding($query = false) { - $this->SimpleGetEncoding($query); - } - - /** - * HTTP request method. - * @return string Always HEAD. - * @access public - */ - function getMethod() { - return 'HEAD'; - } -} - -/** - * Bundle of POST parameters. Can include - * repeated parameters. - * @package SimpleTest - * @subpackage WebTester - */ -class SimplePostEncoding extends SimpleEncoding { - - /** - * Starts empty. - * @param array $query Hash of parameters. - * Multiple values are - * as lists on a single key. - * @access public - */ - function __construct($query = false) { - if (is_array($query) and $this->hasMoreThanOneLevel($query)) { - $query = $this->rewriteArrayWithMultipleLevels($query); - } - parent::__construct($query); - } - - function hasMoreThanOneLevel($query) { - foreach ($query as $key => $value) { - if (is_array($value)) { - return true; - } - } - return false; - } - - function rewriteArrayWithMultipleLevels($query) { - $query_ = array(); - foreach ($query as $key => $value) { - if (is_array($value)) { - foreach ($value as $sub_key => $sub_value) { - $query_[$key."[".$sub_key."]"] = $sub_value; - } - } else { - $query_[$key] = $value; - } - } - if ($this->hasMoreThanOneLevel($query_)) { - $query_ = $this->rewriteArrayWithMultipleLevels($query_); - } - - return $query_; - } - - - /** - * HTTP request method. - * @return string Always POST. - * @access public - */ - function getMethod() { - return 'POST'; - } - - /** - * Dispatches the form headers down the socket. - * @param SimpleSocket $socket Socket to write to. - * @access public - */ - function writeHeadersTo(&$socket) { - $socket->write("Content-Length: " . (integer)strlen($this->encode()) . "\r\n"); - $socket->write("Content-Type: application/x-www-form-urlencoded\r\n"); - } - - /** - * Dispatches the form data down the socket. - * @param SimpleSocket $socket Socket to write to. - * @access public - */ - function writeTo(&$socket) { - $socket->write($this->encode()); - } - - /** - * Renders the query string as a URL encoded - * request part for attaching to a URL. - * @return string Part of URL. - * @access public - */ - function asUrlRequest() { - return ''; - } -} - -/** - * Bundle of POST parameters in the multipart - * format. Can include file uploads. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleMultipartEncoding extends SimplePostEncoding { - private $boundary; - - /** - * Starts empty. - * @param array $query Hash of parameters. - * Multiple values are - * as lists on a single key. - * @access public - */ - function __construct($query = false, $boundary = false) { - parent::__construct($query); - $this->boundary = ($boundary === false ? uniqid('st') : $boundary); - } - - /** - * Dispatches the form headers down the socket. - * @param SimpleSocket $socket Socket to write to. - * @access public - */ - function writeHeadersTo(&$socket) { - $socket->write("Content-Length: " . (integer)strlen($this->encode()) . "\r\n"); - $socket->write("Content-Type: multipart/form-data, boundary=" . $this->boundary . "\r\n"); - } - - /** - * Dispatches the form data down the socket. - * @param SimpleSocket $socket Socket to write to. - * @access public - */ - function writeTo(&$socket) { - $socket->write($this->encode()); - } - - /** - * Renders the query string as a URL encoded - * request part. - * @return string Part of URL. - * @access public - */ - function encode() { - $stream = ''; - foreach ($this->getAll() as $pair) { - $stream .= "--" . $this->boundary . "\r\n"; - $stream .= $pair->asMime() . "\r\n"; - } - $stream .= "--" . $this->boundary . "--\r\n"; - return $stream; - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/errors.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/errors.php deleted file mode 100644 index 52385ee..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/errors.php +++ /dev/null @@ -1,257 +0,0 @@ -createErrorQueue(); - set_error_handler('SimpleTestErrorHandler'); - parent::invoke($method); - restore_error_handler(); - $queue->tally(); - } - - /** - * Wires up the error queue for a single test. - * @return SimpleErrorQueue Queue connected to the test. - * @access private - */ - protected function createErrorQueue() { - $context = SimpleTest::getContext(); - $test = $this->getTestCase(); - $queue = $context->get('SimpleErrorQueue'); - $queue->setTestCase($test); - return $queue; - } -} - -/** - * Error queue used to record trapped - * errors. - * @package SimpleTest - * @subpackage UnitTester - */ -class SimpleErrorQueue { - private $queue; - private $expectation_queue; - private $test; - private $using_expect_style = false; - - /** - * Starts with an empty queue. - */ - function __construct() { - $this->clear(); - } - - /** - * Discards the contents of the error queue. - * @access public - */ - function clear() { - $this->queue = array(); - $this->expectation_queue = array(); - } - - /** - * Sets the currently running test case. - * @param SimpleTestCase $test Test case to send messages to. - * @access public - */ - function setTestCase($test) { - $this->test = $test; - } - - /** - * Sets up an expectation of an error. If this is - * not fulfilled at the end of the test, a failure - * will occour. If the error does happen, then this - * will cancel it out and send a pass message. - * @param SimpleExpectation $expected Expected error match. - * @param string $message Message to display. - * @access public - */ - function expectError($expected, $message) { - array_push($this->expectation_queue, array($expected, $message)); - } - - /** - * Adds an error to the front of the queue. - * @param integer $severity PHP error code. - * @param string $content Text of error. - * @param string $filename File error occoured in. - * @param integer $line Line number of error. - * @access public - */ - function add($severity, $content, $filename, $line) { - $content = str_replace('%', '%%', $content); - $this->testLatestError($severity, $content, $filename, $line); - } - - /** - * Any errors still in the queue are sent to the test - * case. Any unfulfilled expectations trigger failures. - * @access public - */ - function tally() { - while (list($severity, $message, $file, $line) = $this->extract()) { - $severity = $this->getSeverityAsString($severity); - $this->test->error($severity, $message, $file, $line); - } - while (list($expected, $message) = $this->extractExpectation()) { - $this->test->assert($expected, false, "%s -> Expected error not caught"); - } - } - - /** - * Tests the error against the most recent expected - * error. - * @param integer $severity PHP error code. - * @param string $content Text of error. - * @param string $filename File error occoured in. - * @param integer $line Line number of error. - * @access private - */ - protected function testLatestError($severity, $content, $filename, $line) { - if ($expectation = $this->extractExpectation()) { - list($expected, $message) = $expectation; - $this->test->assert($expected, $content, sprintf( - $message, - "%s -> PHP error [$content] severity [" . - $this->getSeverityAsString($severity) . - "] in [$filename] line [$line]")); - } else { - $this->test->error($severity, $content, $filename, $line); - } - } - - /** - * Pulls the earliest error from the queue. - * @return mixed False if none, or a list of error - * information. Elements are: severity - * as the PHP error code, the error message, - * the file with the error, the line number - * and a list of PHP super global arrays. - * @access public - */ - function extract() { - if (count($this->queue)) { - return array_shift($this->queue); - } - return false; - } - - /** - * Pulls the earliest expectation from the queue. - * @return SimpleExpectation False if none. - * @access private - */ - protected function extractExpectation() { - if (count($this->expectation_queue)) { - return array_shift($this->expectation_queue); - } - return false; - } - - /** - * Converts an error code into it's string - * representation. - * @param $severity PHP integer error code. - * @return String version of error code. - * @access public - */ - static function getSeverityAsString($severity) { - static $map = array( - E_STRICT => 'E_STRICT', - E_ERROR => 'E_ERROR', - E_WARNING => 'E_WARNING', - E_PARSE => 'E_PARSE', - E_NOTICE => 'E_NOTICE', - E_CORE_ERROR => 'E_CORE_ERROR', - E_CORE_WARNING => 'E_CORE_WARNING', - E_COMPILE_ERROR => 'E_COMPILE_ERROR', - E_COMPILE_WARNING => 'E_COMPILE_WARNING', - E_USER_ERROR => 'E_USER_ERROR', - E_USER_WARNING => 'E_USER_WARNING', - E_USER_NOTICE => 'E_USER_NOTICE'); - if (defined('E_RECOVERABLE_ERROR')) { - $map[E_RECOVERABLE_ERROR] = 'E_RECOVERABLE_ERROR'; - } - if (defined('E_DEPRECATED')) { - $map[E_DEPRECATED] = 'E_DEPRECATED'; - } - return $map[$severity]; - } -} - -/** - * Error handler that simply stashes any errors into the global - * error queue. Simulates the existing behaviour with respect to - * logging errors, but this feature may be removed in future. - * @param $severity PHP error code. - * @param $message Text of error. - * @param $filename File error occoured in. - * @param $line Line number of error. - * @param $super_globals Hash of PHP super global arrays. - * @access public - */ -function SimpleTestErrorHandler($severity, $message, $filename = null, $line = null, $super_globals = null, $mask = null) { - $severity = $severity & error_reporting(); - if ($severity) { - restore_error_handler(); - if (IsNotCausedBySimpleTest($message)) { - if (ini_get('log_errors')) { - $label = SimpleErrorQueue::getSeverityAsString($severity); - error_log("$label: $message in $filename on line $line"); - } - $queue = SimpleTest::getContext()->get('SimpleErrorQueue'); - $queue->add($severity, $message, $filename, $line); - } - set_error_handler('SimpleTestErrorHandler'); - } - return true; -} - -/** - * Certain messages can be caused by the unit tester itself. - * These have to be filtered. - * @param string $message Message to filter. - * @return boolean True if genuine failure. - */ -function IsNotCausedBySimpleTest($message) { - return ! preg_match('/returned by reference/', $message); -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/exceptions.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/exceptions.php deleted file mode 100644 index 984015d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/exceptions.php +++ /dev/null @@ -1,198 +0,0 @@ -get('SimpleExceptionTrap'); - $trap->clear(); - try { - $has_thrown = false; - parent::invoke($method); - } catch (Exception $exception) { - $has_thrown = true; - if (! $trap->isExpected($this->getTestCase(), $exception)) { - $this->getTestCase()->exception($exception); - } - $trap->clear(); - } - if ($message = $trap->getOutstanding()) { - $this->getTestCase()->fail($message); - } - if ($has_thrown) { - try { - parent::getTestCase()->tearDown(); - } catch (Exception $e) { } - } - } -} - -/** - * Tests exceptions either by type or the exact - * exception. This could be improved to accept - * a pattern expectation to test the error - * message, but that will have to come later. - * @package SimpleTest - * @subpackage UnitTester - */ -class ExceptionExpectation extends SimpleExpectation { - private $expected; - - /** - * Sets up the conditions to test against. - * If the expected value is a string, then - * it will act as a test of the class name. - * An exception as the comparison will - * trigger an identical match. Writing this - * down now makes it look doubly dumb. I hope - * come up with a better scheme later. - * @param mixed $expected A class name or an actual - * exception to compare with. - * @param string $message Message to display. - */ - function __construct($expected, $message = '%s') { - $this->expected = $expected; - parent::__construct($message); - } - - /** - * Carry out the test. - * @param Exception $compare Value to check. - * @return boolean True if matched. - */ - function test($compare) { - if (is_string($this->expected)) { - return ($compare instanceof $this->expected); - } - if (get_class($compare) != get_class($this->expected)) { - return false; - } - return $compare->getMessage() == $this->expected->getMessage(); - } - - /** - * Create the message to display describing the test. - * @param Exception $compare Exception to match. - * @return string Final message. - */ - function testMessage($compare) { - if (is_string($this->expected)) { - return "Exception [" . $this->describeException($compare) . - "] should be type [" . $this->expected . "]"; - } - return "Exception [" . $this->describeException($compare) . - "] should match [" . - $this->describeException($this->expected) . "]"; - } - - /** - * Summary of an Exception object. - * @param Exception $compare Exception to describe. - * @return string Text description. - */ - protected function describeException($exception) { - return get_class($exception) . ": " . $exception->getMessage(); - } -} - -/** - * Stores expected exceptions for when they - * get thrown. Saves the irritating try...catch - * block. - * @package SimpleTest - * @subpackage UnitTester - */ -class SimpleExceptionTrap { - private $expected; - private $message; - - /** - * Clears down the queue ready for action. - */ - function __construct() { - $this->clear(); - } - - /** - * Sets up an expectation of an exception. - * This has the effect of intercepting an - * exception that matches. - * @param SimpleExpectation $expected Expected exception to match. - * @param string $message Message to display. - * @access public - */ - function expectException($expected = false, $message = '%s') { - if ($expected === false) { - $expected = new AnythingExpectation(); - } - if (! SimpleExpectation::isExpectation($expected)) { - $expected = new ExceptionExpectation($expected); - } - $this->expected = $expected; - $this->message = $message; - } - - /** - * Compares the expected exception with any - * in the queue. Issues a pass or fail and - * returns the state of the test. - * @param SimpleTestCase $test Test case to send messages to. - * @param Exception $exception Exception to compare. - * @return boolean False on no match. - */ - function isExpected($test, $exception) { - if ($this->expected) { - return $test->assert($this->expected, $exception, $this->message); - } - return false; - } - - /** - * Tests for any left over exception. - * @return string/false The failure message or false if none. - */ - function getOutstanding() { - return sprintf($this->message, 'Failed to trap exception'); - } - - /** - * Discards the contents of the error queue. - */ - function clear() { - $this->expected = false; - $this->message = false; - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/expectation.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/expectation.php deleted file mode 100644 index 97daa97..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/expectation.php +++ /dev/null @@ -1,901 +0,0 @@ -message = $message; - } - - /** - * Tests the expectation. True if correct. - * @param mixed $compare Comparison value. - * @return boolean True if correct. - * @access public - * @abstract - */ - function test($compare) { - } - - /** - * Returns a human readable test message. - * @param mixed $compare Comparison value. - * @return string Description of success - * or failure. - * @access public - * @abstract - */ - function testMessage($compare) { - } - - /** - * Overlays the generated message onto the stored user - * message. An additional message can be interjected. - * @param mixed $compare Comparison value. - * @param SimpleDumper $dumper For formatting the results. - * @return string Description of success - * or failure. - * @access public - */ - function overlayMessage($compare, $dumper) { - $this->dumper = $dumper; - return sprintf($this->message, $this->testMessage($compare)); - } - - /** - * Accessor for the dumper. - * @return SimpleDumper Current value dumper. - * @access protected - */ - protected function getDumper() { - if (! $this->dumper) { - $dumper = new SimpleDumper(); - return $dumper; - } - return $this->dumper; - } - - /** - * Test to see if a value is an expectation object. - * A useful utility method. - * @param mixed $expectation Hopefully an Expectation - * class. - * @return boolean True if descended from - * this class. - * @access public - */ - static function isExpectation($expectation) { - return is_object($expectation) && - SimpleTestCompatibility::isA($expectation, 'SimpleExpectation'); - } -} - -/** - * A wildcard expectation always matches. - * @package SimpleTest - * @subpackage MockObjects - */ -class AnythingExpectation extends SimpleExpectation { - - /** - * Tests the expectation. Always true. - * @param mixed $compare Ignored. - * @return boolean True. - * @access public - */ - function test($compare) { - return true; - } - - /** - * Returns a human readable test message. - * @param mixed $compare Comparison value. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - $dumper = $this->getDumper(); - return 'Anything always matches [' . $dumper->describeValue($compare) . ']'; - } -} - -/** - * An expectation that never matches. - * @package SimpleTest - * @subpackage MockObjects - */ -class FailedExpectation extends SimpleExpectation { - - /** - * Tests the expectation. Always false. - * @param mixed $compare Ignored. - * @return boolean True. - * @access public - */ - function test($compare) { - return false; - } - - /** - * Returns a human readable test message. - * @param mixed $compare Comparison value. - * @return string Description of failure. - * @access public - */ - function testMessage($compare) { - $dumper = $this->getDumper(); - return 'Failed expectation never matches [' . $dumper->describeValue($compare) . ']'; - } -} - -/** - * An expectation that passes on boolean true. - * @package SimpleTest - * @subpackage MockObjects - */ -class TrueExpectation extends SimpleExpectation { - - /** - * Tests the expectation. - * @param mixed $compare Should be true. - * @return boolean True on match. - * @access public - */ - function test($compare) { - return (boolean)$compare; - } - - /** - * Returns a human readable test message. - * @param mixed $compare Comparison value. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - $dumper = $this->getDumper(); - return 'Expected true, got [' . $dumper->describeValue($compare) . ']'; - } -} - -/** - * An expectation that passes on boolean false. - * @package SimpleTest - * @subpackage MockObjects - */ -class FalseExpectation extends SimpleExpectation { - - /** - * Tests the expectation. - * @param mixed $compare Should be false. - * @return boolean True on match. - * @access public - */ - function test($compare) { - return ! (boolean)$compare; - } - - /** - * Returns a human readable test message. - * @param mixed $compare Comparison value. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - $dumper = $this->getDumper(); - return 'Expected false, got [' . $dumper->describeValue($compare) . ']'; - } -} - -/** - * Test for equality. - * @package SimpleTest - * @subpackage UnitTester - */ -class EqualExpectation extends SimpleExpectation { - private $value; - - /** - * Sets the value to compare against. - * @param mixed $value Test value to match. - * @param string $message Customised message on failure. - * @access public - */ - function __construct($value, $message = '%s') { - parent::__construct($message); - $this->value = $value; - } - - /** - * Tests the expectation. True if it matches the - * held value. - * @param mixed $compare Comparison value. - * @return boolean True if correct. - * @access public - */ - function test($compare) { - return (($this->value == $compare) && ($compare == $this->value)); - } - - /** - * Returns a human readable test message. - * @param mixed $compare Comparison value. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - if ($this->test($compare)) { - return "Equal expectation [" . $this->dumper->describeValue($this->value) . "]"; - } else { - return "Equal expectation fails " . - $this->dumper->describeDifference($this->value, $compare); - } - } - - /** - * Accessor for comparison value. - * @return mixed Held value to compare with. - * @access protected - */ - protected function getValue() { - return $this->value; - } -} - -/** - * Test for inequality. - * @package SimpleTest - * @subpackage UnitTester - */ -class NotEqualExpectation extends EqualExpectation { - - /** - * Sets the value to compare against. - * @param mixed $value Test value to match. - * @param string $message Customised message on failure. - * @access public - */ - function __construct($value, $message = '%s') { - parent::__construct($value, $message); - } - - /** - * Tests the expectation. True if it differs from the - * held value. - * @param mixed $compare Comparison value. - * @return boolean True if correct. - * @access public - */ - function test($compare) { - return ! parent::test($compare); - } - - /** - * Returns a human readable test message. - * @param mixed $compare Comparison value. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - $dumper = $this->getDumper(); - if ($this->test($compare)) { - return "Not equal expectation passes " . - $dumper->describeDifference($this->getValue(), $compare); - } else { - return "Not equal expectation fails [" . - $dumper->describeValue($this->getValue()) . - "] matches"; - } - } -} - -/** - * Test for being within a range. - * @package SimpleTest - * @subpackage UnitTester - */ -class WithinMarginExpectation extends SimpleExpectation { - private $upper; - private $lower; - - /** - * Sets the value to compare against and the fuzziness of - * the match. Used for comparing floating point values. - * @param mixed $value Test value to match. - * @param mixed $margin Fuzziness of match. - * @param string $message Customised message on failure. - * @access public - */ - function __construct($value, $margin, $message = '%s') { - parent::__construct($message); - $this->upper = $value + $margin; - $this->lower = $value - $margin; - } - - /** - * Tests the expectation. True if it matches the - * held value. - * @param mixed $compare Comparison value. - * @return boolean True if correct. - * @access public - */ - function test($compare) { - return (($compare <= $this->upper) && ($compare >= $this->lower)); - } - - /** - * Returns a human readable test message. - * @param mixed $compare Comparison value. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - if ($this->test($compare)) { - return $this->withinMessage($compare); - } else { - return $this->outsideMessage($compare); - } - } - - /** - * Creates a the message for being within the range. - * @param mixed $compare Value being tested. - * @access private - */ - protected function withinMessage($compare) { - return "Within expectation [" . $this->dumper->describeValue($this->lower) . "] and [" . - $this->dumper->describeValue($this->upper) . "]"; - } - - /** - * Creates a the message for being within the range. - * @param mixed $compare Value being tested. - * @access private - */ - protected function outsideMessage($compare) { - if ($compare > $this->upper) { - return "Outside expectation " . - $this->dumper->describeDifference($compare, $this->upper); - } else { - return "Outside expectation " . - $this->dumper->describeDifference($compare, $this->lower); - } - } -} - -/** - * Test for being outside of a range. - * @package SimpleTest - * @subpackage UnitTester - */ -class OutsideMarginExpectation extends WithinMarginExpectation { - - /** - * Sets the value to compare against and the fuzziness of - * the match. Used for comparing floating point values. - * @param mixed $value Test value to not match. - * @param mixed $margin Fuzziness of match. - * @param string $message Customised message on failure. - * @access public - */ - function __construct($value, $margin, $message = '%s') { - parent::__construct($value, $margin, $message); - } - - /** - * Tests the expectation. True if it matches the - * held value. - * @param mixed $compare Comparison value. - * @return boolean True if correct. - * @access public - */ - function test($compare) { - return ! parent::test($compare); - } - - /** - * Returns a human readable test message. - * @param mixed $compare Comparison value. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - if (! $this->test($compare)) { - return $this->withinMessage($compare); - } else { - return $this->outsideMessage($compare); - } - } -} - -/** - * Test for reference. - * @package SimpleTest - * @subpackage UnitTester - */ -class ReferenceExpectation { - private $value; - - /** - * Sets the reference value to compare against. - * @param mixed $value Test reference to match. - * @param string $message Customised message on failure. - * @access public - */ - function __construct(&$value, $message = '%s') { - $this->message = $message; - $this->value = &$value; - } - - /** - * Tests the expectation. True if it exactly - * references the held value. - * @param mixed $compare Comparison reference. - * @return boolean True if correct. - * @access public - */ - function test(&$compare) { - return SimpleTestCompatibility::isReference($this->value, $compare); - } - - /** - * Returns a human readable test message. - * @param mixed $compare Comparison value. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - if ($this->test($compare)) { - return "Reference expectation [" . $this->dumper->describeValue($this->value) . "]"; - } else { - return "Reference expectation fails " . - $this->dumper->describeDifference($this->value, $compare); - } - } - - /** - * Overlays the generated message onto the stored user - * message. An additional message can be interjected. - * @param mixed $compare Comparison value. - * @param SimpleDumper $dumper For formatting the results. - * @return string Description of success - * or failure. - * @access public - */ - function overlayMessage($compare, $dumper) { - $this->dumper = $dumper; - return sprintf($this->message, $this->testMessage($compare)); - } - - /** - * Accessor for the dumper. - * @return SimpleDumper Current value dumper. - * @access protected - */ - protected function getDumper() { - if (! $this->dumper) { - $dumper = new SimpleDumper(); - return $dumper; - } - return $this->dumper; - } -} - -/** - * Test for identity. - * @package SimpleTest - * @subpackage UnitTester - */ -class IdenticalExpectation extends EqualExpectation { - - /** - * Sets the value to compare against. - * @param mixed $value Test value to match. - * @param string $message Customised message on failure. - * @access public - */ - function __construct($value, $message = '%s') { - parent::__construct($value, $message); - } - - /** - * Tests the expectation. True if it exactly - * matches the held value. - * @param mixed $compare Comparison value. - * @return boolean True if correct. - * @access public - */ - function test($compare) { - return SimpleTestCompatibility::isIdentical($this->getValue(), $compare); - } - - /** - * Returns a human readable test message. - * @param mixed $compare Comparison value. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - $dumper = $this->getDumper(); - if ($this->test($compare)) { - return "Identical expectation [" . $dumper->describeValue($this->getValue()) . "]"; - } else { - return "Identical expectation [" . $dumper->describeValue($this->getValue()) . - "] fails with [" . - $dumper->describeValue($compare) . "] " . - $dumper->describeDifference($this->getValue(), $compare, TYPE_MATTERS); - } - } -} - -/** - * Test for non-identity. - * @package SimpleTest - * @subpackage UnitTester - */ -class NotIdenticalExpectation extends IdenticalExpectation { - - /** - * Sets the value to compare against. - * @param mixed $value Test value to match. - * @param string $message Customised message on failure. - * @access public - */ - function __construct($value, $message = '%s') { - parent::__construct($value, $message); - } - - /** - * Tests the expectation. True if it differs from the - * held value. - * @param mixed $compare Comparison value. - * @return boolean True if correct. - * @access public - */ - function test($compare) { - return ! parent::test($compare); - } - - /** - * Returns a human readable test message. - * @param mixed $compare Comparison value. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - $dumper = $this->getDumper(); - if ($this->test($compare)) { - return "Not identical expectation passes " . - $dumper->describeDifference($this->getValue(), $compare, TYPE_MATTERS); - } else { - return "Not identical expectation [" . $dumper->describeValue($this->getValue()) . "] matches"; - } - } -} - -/** - * Test for a pattern using Perl regex rules. - * @package SimpleTest - * @subpackage UnitTester - */ -class PatternExpectation extends SimpleExpectation { - private $pattern; - - /** - * Sets the value to compare against. - * @param string $pattern Pattern to search for. - * @param string $message Customised message on failure. - * @access public - */ - function __construct($pattern, $message = '%s') { - parent::__construct($message); - $this->pattern = $pattern; - } - - /** - * Accessor for the pattern. - * @return string Perl regex as string. - * @access protected - */ - protected function getPattern() { - return $this->pattern; - } - - /** - * Tests the expectation. True if the Perl regex - * matches the comparison value. - * @param string $compare Comparison value. - * @return boolean True if correct. - * @access public - */ - function test($compare) { - return (boolean)preg_match($this->getPattern(), $compare); - } - - /** - * Returns a human readable test message. - * @param mixed $compare Comparison value. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - if ($this->test($compare)) { - return $this->describePatternMatch($this->getPattern(), $compare); - } else { - $dumper = $this->getDumper(); - return "Pattern [" . $this->getPattern() . - "] not detected in [" . - $dumper->describeValue($compare) . "]"; - } - } - - /** - * Describes a pattern match including the string - * found and it's position. - * @param string $pattern Regex to match against. - * @param string $subject Subject to search. - * @access protected - */ - protected function describePatternMatch($pattern, $subject) { - preg_match($pattern, $subject, $matches); - $position = strpos($subject, $matches[0]); - $dumper = $this->getDumper(); - return "Pattern [$pattern] detected at character [$position] in [" . - $dumper->describeValue($subject) . "] as [" . - $matches[0] . "] in region [" . - $dumper->clipString($subject, 100, $position) . "]"; - } -} - -/** - * Fail if a pattern is detected within the - * comparison. - * @package SimpleTest - * @subpackage UnitTester - */ -class NoPatternExpectation extends PatternExpectation { - - /** - * Sets the reject pattern - * @param string $pattern Pattern to search for. - * @param string $message Customised message on failure. - * @access public - */ - function __construct($pattern, $message = '%s') { - parent::__construct($pattern, $message); - } - - /** - * Tests the expectation. False if the Perl regex - * matches the comparison value. - * @param string $compare Comparison value. - * @return boolean True if correct. - * @access public - */ - function test($compare) { - return ! parent::test($compare); - } - - /** - * Returns a human readable test message. - * @param string $compare Comparison value. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - if ($this->test($compare)) { - $dumper = $this->getDumper(); - return "Pattern [" . $this->getPattern() . - "] not detected in [" . - $dumper->describeValue($compare) . "]"; - } else { - return $this->describePatternMatch($this->getPattern(), $compare); - } - } -} - -/** - * Tests either type or class name if it's an object. - * @package SimpleTest - * @subpackage UnitTester - */ -class IsAExpectation extends SimpleExpectation { - private $type; - - /** - * Sets the type to compare with. - * @param string $type Type or class name. - * @param string $message Customised message on failure. - * @access public - */ - function __construct($type, $message = '%s') { - parent::__construct($message); - $this->type = $type; - } - - /** - * Accessor for type to check against. - * @return string Type or class name. - * @access protected - */ - protected function getType() { - return $this->type; - } - - /** - * Tests the expectation. True if the type or - * class matches the string value. - * @param string $compare Comparison value. - * @return boolean True if correct. - * @access public - */ - function test($compare) { - if (is_object($compare)) { - return SimpleTestCompatibility::isA($compare, $this->type); - } else { - return (strtolower(gettype($compare)) == $this->canonicalType($this->type)); - } - } - - /** - * Coerces type name into a gettype() match. - * @param string $type User type. - * @return string Simpler type. - * @access private - */ - protected function canonicalType($type) { - $type = strtolower($type); - $map = array( - 'bool' => 'boolean', - 'float' => 'double', - 'real' => 'double', - 'int' => 'integer'); - if (isset($map[$type])) { - $type = $map[$type]; - } - return $type; - } - - /** - * Returns a human readable test message. - * @param mixed $compare Comparison value. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - $dumper = $this->getDumper(); - return "Value [" . $dumper->describeValue($compare) . - "] should be type [" . $this->type . "]"; - } -} - -/** - * Tests either type or class name if it's an object. - * Will succeed if the type does not match. - * @package SimpleTest - * @subpackage UnitTester - */ -class NotAExpectation extends IsAExpectation { - private $type; - - /** - * Sets the type to compare with. - * @param string $type Type or class name. - * @param string $message Customised message on failure. - * @access public - */ - function __construct($type, $message = '%s') { - parent::__construct($type, $message); - } - - /** - * Tests the expectation. False if the type or - * class matches the string value. - * @param string $compare Comparison value. - * @return boolean True if different. - * @access public - */ - function test($compare) { - return ! parent::test($compare); - } - - /** - * Returns a human readable test message. - * @param mixed $compare Comparison value. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - $dumper = $this->getDumper(); - return "Value [" . $dumper->describeValue($compare) . - "] should not be type [" . $this->getType() . "]"; - } -} - -/** - * Tests for existance of a method in an object - * @package SimpleTest - * @subpackage UnitTester - */ -class MethodExistsExpectation extends SimpleExpectation { - private $method; - - /** - * Sets the value to compare against. - * @param string $method Method to check. - * @param string $message Customised message on failure. - * @access public - * @return void - */ - function __construct($method, $message = '%s') { - parent::__construct($message); - $this->method = &$method; - } - - /** - * Tests the expectation. True if the method exists in the test object. - * @param string $compare Comparison method name. - * @return boolean True if correct. - * @access public - */ - function test($compare) { - return (boolean)(is_object($compare) && method_exists($compare, $this->method)); - } - - /** - * Returns a human readable test message. - * @param mixed $compare Comparison value. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - $dumper = $this->getDumper(); - if (! is_object($compare)) { - return 'No method on non-object [' . $dumper->describeValue($compare) . ']'; - } - $method = $this->method; - return "Object [" . $dumper->describeValue($compare) . - "] should contain method [$method]"; - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/colortext_reporter.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/colortext_reporter.php deleted file mode 100644 index a265226..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/colortext_reporter.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @package SimpleTest - * @subpackage Extensions - */ -class ColorTextReporter extends TextReporter { - var $_failColor = 41; - var $_passColor = 42; - - /** - * Handle initialization - * - * @param {@link TextReporter} - */ - function __construct() { - parent::__construct(); - } - - /** - * Capture the attempt to display the final test results and insert the - * ANSI-color codes in place. - * - * @param string - * @see TextReporter - * @access public - */ - function paintFooter($test_name) { - ob_start(); - parent::paintFooter($test_name); - $output = trim(ob_get_clean()); - if ($output) { - if (($this->getFailCount() + $this->getExceptionCount()) == 0) { - $color = $this->_passColor; - } else { - $color = $this->_failColor; - } - - $this->_setColor($color); - echo $output; - $this->_resetColor(); - } - } - - - /** - * Sets the terminal to an ANSI-standard $color - * - * @param int - * @access protected - */ - function _setColor($color) { - printf("%s[%sm\n", chr(27), $color); - } - - - /** - * Resets the color back to normal. - * - * @access protected - */ - function _resetColor() { - $this->_setColor(0); - } -} - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/css/webunit.css b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/css/webunit.css deleted file mode 100644 index 49da468..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/css/webunit.css +++ /dev/null @@ -1,78 +0,0 @@ -html { - font-face: Verdana, Arial, Helvetica, sans-serif; - font-weight: bold; - color: black; - } - -.pass { color: green; } -.fail { color: red; } -.activetab { - position: relative; - background: white; - border-color: black; - border-style: solid; - border-weight: 1; - border-top-color: white; - border-style: solid; - border-weight: 1; -} -.inactivetab{ - position: relative; - background: silver; - border-color: black; - border-style: solid; - border-weight: 1; -} -span.inactivetab a:link , -span.activetab a:link { - text-decoration: none; - color: black; -} -pre { background-color: lightgray; } -#wait { - background: #B7B8DD; - position: absolute; - visibility: hidden; - text-align: center; - border-color: blue; - border-style: solid; - border-weight: 2; - } -#webunit { - position: absolute; - visibility: hidden; - background: silver; - border-color: black; - border-style: solid; - border-weight: 2; - } -#visible_tab { - position: relative; - visibility: hidden; - overflow: auto; - background: white; - width: 100%; - height: 100%; - border-color: black; - border-style: solid; - border-weight: 1; - } -#visible_tab a:link { - text-decoration: none; - color: inherit; -} -#msg { - position: absolute; - visibility: hidden; - overflow: auto; - background: white; - border-color: black; - border-style: solid; - border-weight: 1; - } -#fail, -#tree { - position: absolute; - visibility: hidden; -} - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester.php deleted file mode 100644 index 72b6a51..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester.php +++ /dev/null @@ -1,117 +0,0 @@ - - * @version $Id: dom_tester.php 1804 2008-09-08 13:16:44Z pp11 $ - */ - -/**#@+ - * include SimpleTest files - */ -require_once dirname(__FILE__).'/../web_tester.php'; -require_once dirname(__FILE__).'/dom_tester/css_selector.php'; -/**#@-*/ - -/** - * CssSelectorExpectation - * - * Create a CSS Selector expectactation - * - * @param DomDocument $_dom - * @param string $_selector - * @param array $_value - * - */ -class CssSelectorExpectation extends SimpleExpectation { - var $_dom; - var $_selector; - var $_value; - - /** - * Sets the dom tree and the css selector to compare against - * @param mixed $dom Dom tree to search into. - * @param mixed $selector Css selector to match element. - * @param string $message Customised message on failure. - * @access public - */ - function CssSelectorExpectation($dom, $selector, $message = '%s') { - $this->SimpleExpectation($message); - $this->_dom = $dom; - $this->_selector = $selector; - - $css_selector = new CssSelector($this->_dom); - $this->_value = $css_selector->getTexts($this->_selector); - } - - /** - * Tests the expectation. True if it matches the - * held value. - * @param mixed $compare Comparison value. - * @return boolean True if correct. - * @access public - */ - function test($compare) { - return (($this->_value == $compare) && ($compare == $this->_value)); - } - - /** - * Returns a human readable test message. - * @param mixed $compare Comparison value. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - $dumper = &$this->_getDumper(); - if (is_array($compare)) { - sort($compare); - } - if ($this->test($compare)) { - return "CSS selector expectation [" . $dumper->describeValue($this->_value) . "]". - " using [" . $dumper->describeValue($this->_selector) . "]"; - } else { - return "CSS selector expectation [" . $dumper->describeValue($this->_value) . "]". - " using [" . $dumper->describeValue($this->_selector) . "]". - " fails with [" . - $dumper->describeValue($compare) . "] " . - $dumper->describeDifference($this->_value, $compare); - } - } -} - -/** - * DomTestCase - * - * Extend Web test case with DOM related assertions, - * CSS selectors in particular - * - * @param DomDocument $dom - * - */ -class DomTestCase extends WebTestCase { - var $dom; - - function assertElementsBySelector($selector, $elements, $message = '%s') { - $this->dom = new DomDocument('1.0', 'utf-8'); - $this->dom->validateOnParse = true; - $this->dom->loadHTML($this->_browser->getContent()); - - return $this->assert( - new CssSelectorExpectation($this->dom, $selector), - $elements, - $message); - } - - function getElementsBySelector($selector) { - $this->dom = new DomDocument('1.0', 'utf-8'); - $this->dom->validateOnParse = true; - $this->dom->loadHTML($this->_browser->getContent()); - - $css_selector = new CssSelectorExpectation($this->dom, $selector); - return $css_selector->_value; - } -} - -?> diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester/css_selector.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester/css_selector.php deleted file mode 100644 index 1e9e244..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester/css_selector.php +++ /dev/null @@ -1,539 +0,0 @@ - - * @version $Id: css_selector.php 1802 2008-09-08 10:43:58Z maetl_ $ - */ - -/** - * CssSelector - * - * Allow to navigate a DOM with CSS selector. - * - * based on getElementsBySelector version 0.4 - Simon Willison, 2003-03-25 - * http://simon.incutio.com/archive/2003/03/25/getElementsBySelector - * - * derived from sfDomCssSelector Id 3053 - Fabien Potencier, 2006-12-16 - * http://www.symfony-project.com/api/symfony/util/sfDomCssSelector.html - * - * @package SimpleTest - * @subpackage Extensions - * @param DomDocument $dom - */ -class CssSelector -{ - public $nodes = array(); - - public function __construct($nodes) - { - if (!is_array($nodes)) - { - $nodes = array($nodes); - } - - $this->nodes = $nodes; - } - - public function getNodes() - { - return $this->nodes; - } - - public function getNode() - { - return $this->nodes ? $this->nodes[0] : null; - } - - public function getValue() - { - return $this->nodes[0]->nodeValue; - } - - public function getValues() - { - $values = array(); - foreach ($this->nodes as $node) - { - $values[] = $node->nodeValue; - } - - return $values; - } - - public function matchSingle($selector) - { - $nodes = $this->getElements($selector); - - return $nodes ? new CssSelector($nodes[0]) : new CssSelector(array()); - } - - public function matchAll($selector) - { - $nodes = $this->getElements($selector); - - return $nodes ? new CssSelector($nodes) : new CssSelector(array()); - } - - /* DEPRECATED */ - public function getTexts($selector) - { - $texts = array(); - foreach ($this->getElements($selector) as $element) - { - $texts[] = $element->nodeValue; - } - - return $texts; - } - - /* DEPRECATED */ - public function getElements($selector) - { - $nodes = array(); - foreach ($this->nodes as $node) - { - $result_nodes = $this->getElementsForNode($selector, $node); - if ($result_nodes) - { - $nodes = array_merge($nodes, $result_nodes); - } - } - - foreach ($nodes as $node) - { - $node->removeAttribute('sf_matched'); - } - - return $nodes; - } - - protected function getElementsForNode($selector, $root_node) - { - $all_nodes = array(); - foreach ($this->tokenize_selectors($selector) as $selector) - { - $nodes = array($root_node); - foreach ($this->tokenize($selector) as $token) - { - $combinator = $token['combinator']; - $selector = $token['selector']; - - $token = trim($token['name']); - - $pos = strpos($token, '#'); - if (false !== $pos && preg_match('/^[A-Za-z0-9]*$/', substr($token, 0, $pos))) - { - // Token is an ID selector - $tagName = substr($token, 0, $pos); - $id = substr($token, $pos + 1); - $xpath = new DomXPath($root_node); - $element = $xpath->query(sprintf("//*[@id = '%s']", $id))->item(0); - if (!$element || ($tagName && strtolower($element->nodeName) != $tagName)) - { - // tag with that ID not found - return array(); - } - - // Set nodes to contain just this element - $nodes = array($element); - $nodes = $this->matchCustomSelector($nodes, $selector); - - continue; // Skip to next token - } - - $pos = strpos($token, '.'); - if (false !== $pos && preg_match('/^[A-Za-z0-9\*]*$/', substr($token, 0, $pos))) - { - // Token contains a class selector - $tagName = substr($token, 0, $pos); - if (!$tagName) - { - $tagName = '*'; - } - $className = substr($token, $pos + 1); - - // Get elements matching tag, filter them for class selector - $founds = $this->getElementsByTagName($nodes, $tagName, $combinator); - $nodes = array(); - foreach ($founds as $found) - { - if (preg_match('/\b'.$className.'\b/', $found->getAttribute('class'))) - { - $nodes[] = $found; - } - } - - $nodes = $this->matchCustomSelector($nodes, $selector); - - continue; // Skip to next token - } - - // Code to deal with attribute selectors - if (preg_match('/^(\w+|\*)(\[.+\])$/', $token, $matches)) - { - $tagName = $matches[1] ? $matches[1] : '*'; - preg_match_all('/ - \[ - (\w+) # attribute - ([=~\|\^\$\*]?) # modifier (optional) - =? # equal (optional) - ( - "([^"]*)" # quoted value (optional) - | - ([^\]]*) # non quoted value (optional) - ) - \] - /x', $matches[2], $matches, PREG_SET_ORDER); - - // Grab all of the tagName elements within current node - $founds = $this->getElementsByTagName($nodes, $tagName, $combinator); - $nodes = array(); - foreach ($founds as $found) - { - $ok = false; - foreach ($matches as $match) - { - $attrName = $match[1]; - $attrOperator = $match[2]; - $attrValue = $match[4]; - - switch ($attrOperator) - { - case '=': // Equality - $ok = $found->getAttribute($attrName) == $attrValue; - break; - case '~': // Match one of space seperated words - $ok = preg_match('/\b'.preg_quote($attrValue, '/').'\b/', $found->getAttribute($attrName)); - break; - case '|': // Match start with value followed by optional hyphen - $ok = preg_match('/^'.preg_quote($attrValue, '/').'-?/', $found->getAttribute($attrName)); - break; - case '^': // Match starts with value - $ok = 0 === strpos($found->getAttribute($attrName), $attrValue); - break; - case '$': // Match ends with value - $ok = $attrValue == substr($found->getAttribute($attrName), -strlen($attrValue)); - break; - case '*': // Match ends with value - $ok = false !== strpos($found->getAttribute($attrName), $attrValue); - break; - default : - // Just test for existence of attribute - $ok = $found->hasAttribute($attrName); - } - - if (false == $ok) - { - break; - } - } - - if ($ok) - { - $nodes[] = $found; - } - } - - continue; // Skip to next token - } - - // If we get here, token is JUST an element (not a class or ID selector) - $nodes = $this->getElementsByTagName($nodes, $token, $combinator); - - $nodes = $this->matchCustomSelector($nodes, $selector); - } - - foreach ($nodes as $node) - { - if (!$node->getAttribute('sf_matched')) - { - $node->setAttribute('sf_matched', true); - $all_nodes[] = $node; - } - } - } - - return $all_nodes; - } - - protected function getElementsByTagName($nodes, $tagName, $combinator = ' ') - { - $founds = array(); - foreach ($nodes as $node) - { - switch ($combinator) - { - case ' ': - // Descendant selector - foreach ($node->getElementsByTagName($tagName) as $element) - { - $founds[] = $element; - } - break; - case '>': - // Child selector - foreach ($node->childNodes as $element) - { - if ($tagName == $element->nodeName) - { - $founds[] = $element; - } - } - break; - case '+': - // Adjacent selector - $element = $node->nextSibling; - if ($element && '#text' == $element->nodeName) - { - $element = $element->nextSibling; - } - - if ($element && $tagName == $element->nodeName) - { - $founds[] = $element; - } - break; - default: - throw new Exception(sprintf('Unrecognized combinator "%s".', $combinator)); - } - } - - return $founds; - } - - protected function tokenize_selectors($selector) - { - // split tokens by , except in an attribute selector - $tokens = array(); - $quoted = false; - $token = ''; - for ($i = 0, $max = strlen($selector); $i < $max; $i++) - { - if (',' == $selector[$i] && !$quoted) - { - $tokens[] = trim($token); - $token = ''; - } - else if ('"' == $selector[$i]) - { - $token .= $selector[$i]; - $quoted = $quoted ? false : true; - } - else - { - $token .= $selector[$i]; - } - } - if ($token) - { - $tokens[] = trim($token); - } - - return $tokens; - } - - protected function tokenize($selector) - { - // split tokens by space except if space is in an attribute selector - $tokens = array(); - $combinators = array(' ', '>', '+'); - $quoted = false; - $token = array('combinator' => ' ', 'name' => ''); - for ($i = 0, $max = strlen($selector); $i < $max; $i++) - { - if (in_array($selector[$i], $combinators) && !$quoted) - { - // remove all whitespaces around the combinator - $combinator = $selector[$i]; - while (in_array($selector[$i + 1], $combinators)) - { - if (' ' != $selector[++$i]) - { - $combinator = $selector[$i]; - } - } - - $tokens[] = $token; - $token = array('combinator' => $combinator, 'name' => ''); - } - else if ('"' == $selector[$i]) - { - $token['name'] .= $selector[$i]; - $quoted = $quoted ? false : true; - } - else - { - $token['name'] .= $selector[$i]; - } - } - if ($token['name']) - { - $tokens[] = $token; - } - - foreach ($tokens as &$token) - { - list($token['name'], $token['selector']) = $this->tokenize_selector_name($token['name']); - } - - return $tokens; - } - - protected function tokenize_selector_name($token_name) - { - // split custom selector - $quoted = false; - $name = ''; - $selector = ''; - $in_selector = false; - for ($i = 0, $max = strlen($token_name); $i < $max; $i++) - { - if ('"' == $token_name[$i]) - { - $quoted = $quoted ? false : true; - } - - if (!$quoted && ':' == $token_name[$i]) - { - $in_selector = true; - } - - if ($in_selector) - { - $selector .= $token_name[$i]; - } - else - { - $name .= $token_name[$i]; - } - } - - return array($name, $selector); - } - - protected function matchCustomSelector($nodes, $selector) - { - if (!$selector) - { - return $nodes; - } - - $selector = $this->tokenize_custom_selector($selector); - $matchingNodes = array(); - for ($i = 0, $max = count($nodes); $i < $max; $i++) - { - switch ($selector['selector']) - { - case 'contains': - if (false !== strpos($nodes[$i]->textContent, $selector['parameter'])) - { - $matchingNodes[] = $nodes[$i]; - } - break; - case 'nth-child': - if ($nodes[$i] === $this->nth($nodes[$i]->parentNode->firstChild, (integer) $selector['parameter'])) - { - $matchingNodes[] = $nodes[$i]; - } - break; - case 'first-child': - if ($nodes[$i] === $this->nth($nodes[$i]->parentNode->firstChild)) - { - $matchingNodes[] = $nodes[$i]; - } - break; - case 'last-child': - if ($nodes[$i] === $this->nth($nodes[$i]->parentNode->lastChild, 1, 'previousSibling')) - { - $matchingNodes[] = $nodes[$i]; - } - break; - case 'lt': - if ($i < (integer) $selector['parameter']) - { - $matchingNodes[] = $nodes[$i]; - } - break; - case 'gt': - if ($i > (integer) $selector['parameter']) - { - $matchingNodes[] = $nodes[$i]; - } - break; - case 'odd': - if ($i % 2) - { - $matchingNodes[] = $nodes[$i]; - } - break; - case 'even': - if (0 == $i % 2) - { - $matchingNodes[] = $nodes[$i]; - } - break; - case 'nth': - case 'eq': - if ($i == (integer) $selector['parameter']) - { - $matchingNodes[] = $nodes[$i]; - } - break; - case 'first': - if ($i == 0) - { - $matchingNodes[] = $nodes[$i]; - } - break; - case 'last': - if ($i == $max - 1) - { - $matchingNodes[] = $nodes[$i]; - } - break; - default: - throw new Exception(sprintf('Unrecognized selector "%s".', $selector['selector'])); - } - } - - return $matchingNodes; - } - - protected function tokenize_custom_selector($selector) - { - if (!preg_match('/ - ([a-zA-Z0-9\-]+) - (?: - \( - (?: - ("|\')(.*)?\2 - | - (.*?) - ) - \) - )? - /x', substr($selector, 1), $matches)) - { - throw new Exception(sprintf('Unable to parse custom selector "%s".', $selector)); - } - return array('selector' => $matches[1], 'parameter' => isset($matches[3]) ? ($matches[3] ? $matches[3] : $matches[4]) : ''); - } - - protected function nth($cur, $result = 1, $dir = 'nextSibling') - { - $num = 0; - for (; $cur; $cur = $cur->$dir) - { - if (1 == $cur->nodeType) - { - ++$num; - } - - if ($num == $result) - { - return $cur; - } - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester/test/dom_tester_doc_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester/test/dom_tester_doc_test.php deleted file mode 100644 index da624bb..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester/test/dom_tester_doc_test.php +++ /dev/null @@ -1,24 +0,0 @@ -addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - } - - function testGet() { - $url = 'http://simpletest.org/'; - $this->assertTrue($this->get($url)); - $this->assertEqual($this->getUrl(), $url); - $this->assertElementsBySelector('h2', array('Screenshots', 'Documentation', 'Contributing')); - $this->assertElementsBySelector('a[href="http://simpletest.org/api/"]', array('the complete API', 'documented API')); - $this->assertElementsBySelector('div#content > p > strong', array('SimpleTest PHP unit tester')); - } -} - -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester/test/dom_tester_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester/test/dom_tester_test.php deleted file mode 100644 index 38f5efd..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester/test/dom_tester_test.php +++ /dev/null @@ -1,223 +0,0 @@ -addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - } - - function testGet() { - $url = 'file://'.dirname(__FILE__).'/support/dom_tester.html'; - $this->assertTrue($this->get($url)); - $this->assertElementsBySelector('h1', array('Test page')); - $this->assertElementsBySelector('ul#list li a[href]', array('link')); - $this->assertElementsBySelector('body h1', array('Test page')); - $this->assertElementsBySelector('#mybar', array('myfoo bis')); - } -} - -class TestOfCssSelectors extends UnitTestCase { - - function TestOfCssSelectors() { - $html = file_get_contents(dirname(__FILE__) . '/support/dom_tester.html'); - $this->dom = new DomDocument('1.0', 'utf-8'); - $this->dom->validateOnParse = true; - $this->dom->loadHTML($html); - } - - function testBasicSelector() { - $expectation = new CssSelectorExpectation($this->dom, 'h1'); - $this->assertTrue($expectation->test(array('Test page'))); - - $expectation = new CssSelectorExpectation($this->dom, 'h2'); - $this->assertTrue($expectation->test(array('Title 1', 'Title 2'))); - - $expectation = new CssSelectorExpectation($this->dom, '#footer'); - $this->assertTrue($expectation->test(array('footer'))); - - $expectation = new CssSelectorExpectation($this->dom, 'div#footer'); - $this->assertTrue($expectation->test(array('footer'))); - - $expectation = new CssSelectorExpectation($this->dom, '.header'); - $this->assertTrue($expectation->test(array('header'))); - - $expectation = new CssSelectorExpectation($this->dom, 'p.header'); - $this->assertTrue($expectation->test(array('header'))); - - $expectation = new CssSelectorExpectation($this->dom, 'div.header'); - $this->assertTrue($expectation->test(array())); - - $expectation = new CssSelectorExpectation($this->dom, 'ul#mylist ul li'); - $this->assertTrue($expectation->test(array('element 3', 'element 4'))); - - $expectation = new CssSelectorExpectation($this->dom, '#nonexistant'); - $this->assertTrue($expectation->test(array())); - } - - function testAttributeSelectors() { - $expectation = new CssSelectorExpectation($this->dom, 'ul#list li a[href]'); - $this->assertTrue($expectation->test(array('link'))); - - $expectation = new CssSelectorExpectation($this->dom, 'ul#list li a[class~="foo1"]'); - $this->assertTrue($expectation->test(array('link'))); - - $expectation = new CssSelectorExpectation($this->dom, 'ul#list li a[class~="bar1"]'); - $this->assertTrue($expectation->test(array('link'))); - - $expectation = new CssSelectorExpectation($this->dom, 'ul#list li a[class~="foobar1"]'); - $this->assertTrue($expectation->test(array('link'))); - - $expectation = new CssSelectorExpectation($this->dom, 'ul#list li a[class^="foo1"]'); - $this->assertTrue($expectation->test(array('link'))); - - $expectation = new CssSelectorExpectation($this->dom, 'ul#list li a[class$="foobar1"]'); - $this->assertTrue($expectation->test(array('link'))); - - $expectation = new CssSelectorExpectation($this->dom, 'ul#list li a[class*="oba"]'); - $this->assertTrue($expectation->test(array('link'))); - - $expectation = new CssSelectorExpectation($this->dom, 'ul#list li a[href="http://www.google.com/"]'); - $this->assertTrue($expectation->test(array('link'))); - - $expectation = new CssSelectorExpectation($this->dom, 'ul#anotherlist li a[class|="bar1"]'); - $this->assertTrue($expectation->test(array('another link'))); - - $expectation = new CssSelectorExpectation($this->dom, 'ul#list li a[class*="oba"][class*="ba"]'); - $this->assertTrue($expectation->test(array('link'))); - - $expectation = new CssSelectorExpectation($this->dom, 'p[class="myfoo"][id="mybar"]'); - $this->assertTrue($expectation->test(array('myfoo bis'))); - - $expectation = new CssSelectorExpectation($this->dom, 'p[onclick*="a . and a #"]'); - $this->assertTrue($expectation->test(array('works great'))); - } - - function testCombinators() { - $expectation = new CssSelectorExpectation($this->dom, 'body h1'); - $this->assertTrue($expectation->test(array('Test page'))); - - $expectation = new CssSelectorExpectation($this->dom, 'div#combinators > ul > li'); - $this->assertTrue($expectation->test(array('test 1', 'test 2'))); - - $expectation = new CssSelectorExpectation($this->dom, 'div#combinators>ul>li'); - $this->assertTrue($expectation->test(array('test 1', 'test 2'))); - - $expectation = new CssSelectorExpectation($this->dom, 'div#combinators li + li'); - $this->assertTrue($expectation->test(array('test 2', 'test 4'))); - - $expectation = new CssSelectorExpectation($this->dom, 'div#combinators li+li'); - $this->assertTrue($expectation->test(array('test 2', 'test 4'))); - - $expectation = new CssSelectorExpectation($this->dom, 'h1, h2'); - $this->assertTrue($expectation->test(array('Test page', 'Title 1', 'Title 2'))); - - $expectation = new CssSelectorExpectation($this->dom, 'h1,h2'); - $this->assertTrue($expectation->test(array('Test page', 'Title 1', 'Title 2'))); - - $expectation = new CssSelectorExpectation($this->dom, 'h1 , h2'); - $this->assertTrue($expectation->test(array('Test page', 'Title 1', 'Title 2'))); - - $expectation = new CssSelectorExpectation($this->dom, 'h1, h1,h1'); - $this->assertTrue($expectation->test(array('Test page'))); - - $expectation = new CssSelectorExpectation($this->dom, 'h1,h2,h1'); - $this->assertTrue($expectation->test(array('Test page', 'Title 1', 'Title 2'))); - - $expectation = new CssSelectorExpectation($this->dom, 'p[onclick*="a . and a #"], div#combinators > ul li + li'); - $this->assertTrue($expectation->test(array('works great', 'test 2', 'test 4'))); - } - - function testChildSelectors() { - $expectation = new CssSelectorExpectation($this->dom, '.myfoo:contains("bis")'); - $this->assertTrue($expectation->test(array('myfoo bis'))); - - $expectation = new CssSelectorExpectation($this->dom, '.myfoo:eq(1)'); - $this->assertTrue($expectation->test(array('myfoo bis'))); - - $expectation = new CssSelectorExpectation($this->dom, '.myfoo:last'); - $this->assertTrue($expectation->test(array('myfoo bis'))); - - $expectation = new CssSelectorExpectation($this->dom, '.myfoo:first'); - $this->assertTrue($expectation->test(array('myfoo'))); - - $expectation = new CssSelectorExpectation($this->dom, 'h2:first'); - $this->assertTrue($expectation->test(array('Title 1'))); - - $expectation = new CssSelectorExpectation($this->dom, 'h2:first'); - $this->assertTrue($expectation->test(array('Title 1'))); - - $expectation = new CssSelectorExpectation($this->dom, 'p.myfoo:first'); - $this->assertTrue($expectation->test(array('myfoo'))); - - $expectation = new CssSelectorExpectation($this->dom, 'p:lt(2)'); - $this->assertTrue($expectation->test(array('header', 'multi-classes'))); - - $expectation = new CssSelectorExpectation($this->dom, 'p:gt(2)'); - $this->assertTrue($expectation->test(array('myfoo bis', 'works great', 'First paragraph', 'Second paragraph', 'Third paragraph'))); - - $expectation = new CssSelectorExpectation($this->dom, 'p:odd'); - $this->assertTrue($expectation->test(array('multi-classes', 'myfoo bis', 'First paragraph', 'Third paragraph'))); - - $expectation = new CssSelectorExpectation($this->dom, 'p:even'); - $this->assertTrue($expectation->test(array('header', 'myfoo', 'works great', 'Second paragraph'))); - - $expectation = new CssSelectorExpectation($this->dom, '#simplelist li:first-child'); - $this->assertTrue($expectation->test(array('First', 'First'))); - - $expectation = new CssSelectorExpectation($this->dom, '#simplelist li:nth-child(1)'); - $this->assertTrue($expectation->test(array('First', 'First'))); - - $expectation = new CssSelectorExpectation($this->dom, '#simplelist li:nth-child(2)'); - $this->assertTrue($expectation->test(array('Second with a link', 'Second'))); - - $expectation = new CssSelectorExpectation($this->dom, '#simplelist li:nth-child(3)'); - $this->assertTrue($expectation->test(array('Third with another link'))); - - $expectation = new CssSelectorExpectation($this->dom, '#simplelist li:last-child'); - $this->assertTrue($expectation->test(array('Second with a link', 'Third with another link'))); - } -} - -class TestsOfChildAndAdjacentSelectors extends DomTestCase { - function TestsOfChildAndAdjacentSelectors() { - $html = file_get_contents(dirname(__FILE__) . '/support/child_adjacent.html'); - $this->dom = new DomDocument('1.0', 'utf-8'); - $this->dom->validateOnParse = true; - $this->dom->loadHTML($html); - } - - function testFirstChild() { - $expectation = new CssSelectorExpectation($this->dom, 'p:first-child'); - $this->assertTrue($expectation->test(array('First paragraph'))); - - $expectation = new CssSelectorExpectation($this->dom, 'body > p:first-child'); - $this->assertTrue($expectation->test(array('First paragraph'))); - - $expectation = new CssSelectorExpectation($this->dom, 'body > p > a:first-child'); - $this->assertTrue($expectation->test(array('paragraph'))); - } - - function testChildren() { - $expectation = new CssSelectorExpectation($this->dom, 'body > p'); - $this->assertTrue($expectation->test(array('First paragraph', 'Second paragraph', 'Third paragraph'))); - - $expectation = new CssSelectorExpectation($this->dom, 'body > p > a'); - $this->assertTrue($expectation->test(array('paragraph'))); - } - - function testAdjacents() { - $expectation = new CssSelectorExpectation($this->dom, 'p + p'); - $this->assertTrue($expectation->test(array('Second paragraph', 'Third paragraph'))); - - $expectation = new CssSelectorExpectation($this->dom, 'body > p + p'); - $this->assertTrue($expectation->test(array('Second paragraph', 'Third paragraph'))); - - $expectation = new CssSelectorExpectation($this->dom, 'body > p + p > a'); - $this->assertTrue($expectation->test(array('paragraph'))); - } -} - -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester/test/support/child_adjacent.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester/test/support/child_adjacent.html deleted file mode 100644 index 51bf72f..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester/test/support/child_adjacent.html +++ /dev/null @@ -1,24 +0,0 @@ - - - Foo! - - - -

First paragraph

-

Second paragraph

-

Third paragraph

- - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester/test/support/dom_tester.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester/test/support/dom_tester.html deleted file mode 100644 index 666126e..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/dom_tester/test/support/dom_tester.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - -

Test page

- -

Title 1

-

header

-

multi-classes

-

myfoo

-

myfoo bis

- -

works great

- -
-
    -
  • First
  • -
  • Second with a link
  • -
- - -
- -

Title 2

-
    -
  • element 1
  • -
  • element 2
  • -
  • -
      -
    • element 3
    • -
    • element 4
    • -
    -
  • -
- -
-
    -
  • test 1
  • -
  • test 2
  • -
      -
    • test 3
    • -
    • test 4
    • -
    -
-
- -
-

First paragraph

-

Second paragraph

-

Third paragraph

-
- - - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/img/wait.gif b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/img/wait.gif deleted file mode 100644 index 3ec7cec3f08e799bef2d237a62db22ac19f58220..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1426 zcmZ?wbhEHbJi#Esa8-^$*1lfOu1?XmR>7`L*|tX2wpz`mO2xKD$EsZ4vP{paOw+nj z%eq3trpnqh-^wiC)+E=|yvW?V(9FEZ*rM3Lvc$-u#KfZ5!mJ=#J2p}$E?z4-Rx8F| zKZSvT!NDZQ)hN@;FwNH>)x#(wNG~ZsKP6N*Awe@r+P*=?zJbA^fyKR-&8>&uxt-Is zo5QV}+qIL+wTs84gU_Wyz`0Gxsa4FeS=6yb#HmHnp;5x2Ny?#df}C5MqWAy*|AAI0 z{^#~{4GDI33~)8lGhk)}3H@YY|HP7_lQ~xNFRUo> zS{t?g#+tI(v1=pNOxI?cd@^mV*xInecXP~Q^V+=_nHn1#3N$2mxVU+EI5@aCMMcF# zw0iscCrq3)dCJsj(`U?_HG8_NcFcl>ixw~O(wet)<*LDF_Zp}@%8#?B|>(C}fQQU||+ zMdqCo8y6q<`QX$g<5}b_faG||jv2A~L=pTktB&o3MX`rKz}2?xmMFGWtj4ci*D z{swng-}&oBLTBq%O?85Ym*?;@y_g(be738{07{-x0|Q zX$EEnaRxr16%ueOkOMa&TL2LgMx-eABt>xoDT>QUQQSw0;-#c0-UC$32@W~|)Sx@2 zfCw@cBonbEUX<_!MTQ>OL?v7){q)n*WcWCq9A>X|P*84CR8(q{RaNOy>rs>Hmz0!|kycli17+$tbLY(mWokL? zCCgWUGWFWEb{jSVGqv5abvt$fGxg%F`?qf2d-%xFWAhK3+-P(B?78zhPMxy7aP`{t zxtC7fxO4aXtpoQSJ>K(R|C1LlS3TSM>fQSjZ#IAU^7Yf_uRmXX-}LL>lRrs+rElme P=rnPxmHZ;e!e9*mEx8gm diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/js/tests/TestOfWebunit.js.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/js/tests/TestOfWebunit.js.html deleted file mode 100644 index 08f6249..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/js/tests/TestOfWebunit.js.html +++ /dev/null @@ -1,34 +0,0 @@ - - - -JsUnit Tests of webunit.js - - - - - - - - -

JsUnit Tests of webunit.js

- -

This page contains tests for the webunit.js file functions.

-
-
- - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/js/webunit.js b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/js/webunit.js deleted file mode 100644 index 1c6acbb..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/js/webunit.js +++ /dev/null @@ -1,194 +0,0 @@ -// jsreporter.js -// Script to support JsReporter class -// Relies heavily on the X library in x.js -// X v3.14.1, Cross-Browser DHTML Library from Cross-Browser.com -// Copyright (c) 2004 Jason E. Sweat (jsweat_php@yahoo.com) -// -// SimpleTest - http://simpletest.sf.net/ -// Copyright (c) 2003,2004 Marcus Baker (marcus@lastcraft.com) -// $Id: webunit.js 506 2004-02-14 18:24:13Z jsweat $ - - -// Variables: -min_x=500; -min_y=400; -groups = new Array(); -cases = new Array(); -methods = new Array(); -current_group=0; -current_case=0; -current_method=0; - -Hash = { - Set : function(foo,bar) {this[foo] = bar;}, - Get : function(foo) {return this[foo];} -} - -// Functions: -function wait_start() { - var wait_x; - var wait_y; - - wait_x = xWidth('wait'); - wait_y = xHeight('wait'); - xMoveTo('wait', (xClientWidth()-wait_x)/2, (xClientHeight()-wait_y)/2); - xShow('wait'); -} - -function layout() { - xResizeTo('webunit', max(xClientWidth()-30,min_x), max(xClientHeight()-20,min_y)); - xMoveTo('webunit', 5, 5); - xResizeTo('tabs', xWidth('webunit')-10, xHeight('webunit')/3); - xLeft('tabs', 5); - xShow('webunit'); - xShow('tabs'); - activate_tab('fail'); - xShow('visible_tab'); - xZIndex('visible_tab', 2) - xResizeTo('msg', xWidth('webunit')-17, xHeight('webunit')/3-20); - xLeft('msg', 2); - xTop('msg',2*xHeight('webunit')/3); - xShow('msg'); -} - -function set_div_content(div, content) { - xGetElementById(div).innerHTML = content; -} - -function copy_div_content(divsrc, divtrgt) { - xGetElementById(divtrgt).innerHTML = xGetElementById(divsrc).innerHTML; -} - -function activate_tab(tab) { - if (tab == 'fail') { - copy_div_content('fail', 'visible_tab'); - xGetElementById('failtab').className = 'activetab'; - xZIndex('failtab', 3) - xGetElementById('treetab').className = 'inactivetab'; - xZIndex('treetab', 1) - } - if (tab == 'tree') { - copy_div_content('tree', 'visible_tab'); - xGetElementById('failtab').className = 'inactivetab'; - xZIndex('failtab', 1) - xGetElementById('treetab').className = 'activetab'; - xZIndex('treetab', 3) - } -} - -function add_group(group_name) { - var add; - - add = { - Set : function(foo,bar) {this[foo] = bar;}, - Get : function(foo) {return this[foo];} - } - add.Set('desc', group_name); - add.Set('pass', true); - groups[groups.length] = add; - current_group = groups.length - 1; - cases[current_group] = new Array(); - methods[current_group] = new Array(); -} - -function add_case(case_name) { - var curgroup; - var add; - - add = { - Set : function(foo,bar) {this[foo] = bar;}, - Get : function(foo) {return this[foo];} - } - add.Set('desc', case_name); - add.Set('pass', true); - curgroup = cases[current_group]; - cases[current_group][curgroup.length] = add; - current_case = curgroup.length - 1; - methods[current_group][current_case] = new Array(); -} - -function add_method(method_name) { - var curcase; - var add; - - add = { - Set : function(foo,bar) {this[foo] = bar;}, - Get : function(foo) {return this[foo];} - } - add.Set('desc', method_name); - add.Set('pass', true); - add.Set('msg',''); - curcase = methods[current_group][current_case]; - methods[current_group][current_case][curcase.length] = add; - current_method = curcase.length - 1; -} - -function add_fail(msg) { - var oldmsg; - add_log(msg); - groups[current_group].Set('pass', false); - cases[current_group][current_case].Set('pass', false); - methods[current_group][current_case][current_method].Set('pass', false); - oldmsg = methods[current_group][current_case][current_method].Get('msg'); - methods[current_group][current_case][current_method].Set('msg', oldmsg+msg); -} - -function add_log(msg) { - var faildiv; - faildiv = xGetElementById('fail'); - faildiv.innerHTML = faildiv.innerHTML + msg; -} - -function set_msg(gid, cid, mid) { - var passfail; - var msg=methods[gid][cid][mid].Get('msg'); - if ('' == msg) { - passfail = (methods[gid][cid][mid].Get('pass')) ? 'pass' : 'fail'; - msg = 'No output for ' - + groups[gid].Get('desc') + '->' - + cases[gid][cid].Get('desc') + '->' - + methods[gid][cid][mid].Get('desc') + '
'; - } - xGetElementById('msg').innerHTML = msg; -} - -function make_tree() { - var content; - var passfail; - content = '
    '; - for (x in groups) { - passfail = (groups[x].Get('pass')) ? 'pass' : 'fail'; - content += '
  • '+groups[x].Get('desc')+'
      '; - for (y in cases[x]) { - passfail = (cases[x][y].Get('pass')) ? 'pass' : 'fail'; - content += '
    • '+cases[x][y].Get('desc')+'
        '; - for (z in methods[x][y]) { - passfail = (methods[x][y][z].Get('pass')) ? 'pass' : 'fail'; - content += '
      • '+methods[x][y][z].Get('desc')+'
      • '; - } - content += '
    • '; - } - content += '
  • '; - } - content += '
'; - xGetElementById('tree').innerHTML = content; - if (xGetElementById('treetab').className == 'activetab') { - activate_tab('tree'); - } else { - activate_tab('fail'); - } -} - -function make_output(data) { -} - -function make_fail_msg(id, msg) { -} - -function max(n1, n2) { - if (n1 > n2) { - return n1; - } else { - return n2; - } -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/js/x.js b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/js/x.js deleted file mode 100644 index 78edb02..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/js/x.js +++ /dev/null @@ -1,423 +0,0 @@ -// x.js -// X v3.14.1, Cross-Browser DHTML Library from Cross-Browser.com -// Copyright (c) 2002,2003 Michael Foster (mike@cross-browser.com) -// This library is distributed under the terms of the LGPL (gnu.org) - -// Variables: -var xVersion='3.14.1',xOp7=false,xOp5or6=false,xIE4Up=false,xNN4=false,xUA=navigator.userAgent.toLowerCase(); -if(window.opera){ - xOp7=(xUA.indexOf('opera 7')!=-1 || xUA.indexOf('opera/7')!=-1); - if (!xOp7) xOp5or6=(xUA.indexOf('opera 5')!=-1 || xUA.indexOf('opera/5')!=-1 || xUA.indexOf('opera 6')!=-1 || xUA.indexOf('opera/6')!=-1); -} -else if(document.layers) {xNN4=true;} -else {xIE4Up=document.all && xUA.indexOf('msie')!=-1 && parseInt(navigator.appVersion)>=4;} -// Object: -function xGetElementById(e) { - if(typeof(e)!='string') return e; - if(document.getElementById) e=document.getElementById(e); - else if(document.all) e=document.all[e]; - else if(document.layers) e=xLayer(e); - else e=null; - return e; -} -function xParent(e,bNode){ - if (!(e=xGetElementById(e))) return null; - var p=null; - if (!bNode && xDef(e.offsetParent)) p=e.offsetParent; - else if (xDef(e.parentNode)) p=e.parentNode; - else if (xDef(e.parentElement)) p=e.parentElement; - else if (xDef(e.parentLayer)){if (e.parentLayer!=window) p=e.parentLayer;} - return p; -} -function xDef() { - for(var i=0; iwindow.innerHeight) w-=16; - } - return w; -} -function xClientHeight() { - var h=0; - if(xOp5or6) h=window.innerHeight; - else if(!window.opera && document.documentElement && document.documentElement.clientHeight) // v3.12 - h=document.documentElement.clientHeight; - else if(document.body && document.body.clientHeight) - h=document.body.clientHeight; - else if(xDef(window.innerWidth,window.innerHeight,document.width)) { - h=window.innerHeight; - if(document.width>window.innerWidth) h-=16; - } - return h; -} -// Animation: -function xSlideTo(e,x,y,uTime) { - if (!(e=xGetElementById(e))) return; - if (!e.timeout) e.timeout = 25; - e.xTarget = x; e.yTarget = y; e.slideTime = uTime; e.stop = false; - e.yA = e.yTarget - xTop(e); e.xA = e.xTarget - xLeft(e); // A = distance - e.B = Math.PI / (2 * e.slideTime); // B = period - e.yD = xTop(e); e.xD = xLeft(e); // D = initial position - var d = new Date(); e.C = d.getTime(); - if (!e.moving) xSlide(e); -} -function xSlide(e) { - if (!(e=xGetElementById(e))) return; - var now, s, t, newY, newX; - now = new Date(); - t = now.getTime() - e.C; - if (e.stop) { e.moving = false; } - else if (t < e.slideTime) { - setTimeout("xSlide('"+e.id+"')", e.timeout); - s = Math.sin(e.B * t); - newX = Math.round(e.xA * s + e.xD); - newY = Math.round(e.yA * s + e.yD); - xMoveTo(e, newX, newY); - e.moving = true; - } - else { - xMoveTo(e, e.xTarget, e.yTarget); - e.moving = false; - } -} -// Event: -function xAddEventListener(e,eventType,eventListener,useCapture) { - if(!(e=xGetElementById(e))) return; - eventType=eventType.toLowerCase(); - if((!xIE4Up && !xOp7) && e==window) { - if(eventType=='resize') { window.xPCW=xClientWidth(); window.xPCH=xClientHeight(); window.xREL=eventListener; xResizeEvent(); return; } - if(eventType=='scroll') { window.xPSL=xScrollLeft(); window.xPST=xScrollTop(); window.xSEL=eventListener; xScrollEvent(); return; } - } - var eh='e.on'+eventType+'=eventListener'; - if(e.addEventListener) e.addEventListener(eventType,eventListener,useCapture); - else if(e.attachEvent) e.attachEvent('on'+eventType,eventListener); - else if(e.captureEvents) { - if(useCapture||(eventType.indexOf('mousemove')!=-1)) { e.captureEvents(eval('Event.'+eventType.toUpperCase())); } - eval(eh); - } - else eval(eh); -} -function xRemoveEventListener(e,eventType,eventListener,useCapture) { - if(!(e=xGetElementById(e))) return; - eventType=eventType.toLowerCase(); - if((!xIE4Up && !xOp7) && e==window) { - if(eventType=='resize') { window.xREL=null; return; } - if(eventType=='scroll') { window.xSEL=null; return; } - } - var eh='e.on'+eventType+'=null'; - if(e.removeEventListener) e.removeEventListener(eventType,eventListener,useCapture); - else if(e.detachEvent) e.detachEvent('on'+eventType,eventListener); - else if(e.releaseEvents) { - if(useCapture||(eventType.indexOf('mousemove')!=-1)) { e.releaseEvents(eval('Event.'+eventType.toUpperCase())); } - eval(eh); - } - else eval(eh); -} -function xEvent(evt) { // cross-browser event object prototype - this.type = ''; - this.target = null; - this.pageX = 0; - this.pageY = 0; - this.offsetX = 0; - this.offsetY = 0; - this.keyCode = 0; - var e = evt ? evt : window.event; - if(!e) return; - if(e.type) this.type = e.type; - if(e.target) this.target = e.target; - else if(e.srcElement) this.target = e.srcElement; - else if(xNN4) this.target = xLayerFromPoint(e.pageX, e.pageY); - if(xOp5or6) { this.pageX = e.clientX; this.pageY = e.clientY; } - else if(xDef(e.pageX,e.pageY)) { this.pageX = e.pageX; this.pageY = e.pageY; } // v3.14 - else if(xDef(e.clientX,e.clientY)) { this.pageX = e.clientX + xScrollLeft(); this.pageY = e.clientY + xScrollTop(); } - if(xDef(e.offsetX,e.offsetY)) { this.offsetX = e.offsetX; this.offsetY = e.offsetY; } - else if(xDef(e.layerX,e.layerY)) { this.offsetX = e.layerX; this.offsetY = e.layerY; } - else { this.offsetX = this.pageX - xPageX(this.target); this.offsetY = this.pageY - xPageY(this.target); } - if (e.keyCode) { this.keyCode = e.keyCode; } // for moz/fb, if keyCode==0 use which - else if (xDef(e.which)) { this.keyCode = e.which; } -} -function xResizeEvent() { // window resize event simulation - if (window.xREL) setTimeout('xResizeEvent()', 250); - var cw = xClientWidth(), ch = xClientHeight(); - if (window.xPCW != cw || window.xPCH != ch) { window.xPCW = cw; window.xPCH = ch; if (window.xREL) window.xREL(); } -} -function xScrollEvent() { // window scroll event simulation - if (window.xSEL) setTimeout('xScrollEvent()', 250); - var sl = xScrollLeft(), st = xScrollTop(); - if (window.xPSL != sl || window.xPST != st) { window.xPSL = sl; window.xPST = st; if (window.xSEL) window.xSEL(); } -} -// end x.js diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/junit_xml_reporter.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/junit_xml_reporter.php deleted file mode 100644 index 3bb3892..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/junit_xml_reporter.php +++ /dev/null @@ -1,118 +0,0 @@ -SimpleReporter(); - - $this->doc = new DOMDocument(); - $this->doc->loadXML(''); - $this->root = $this->doc->documentElement; - } - - function paintHeader($test_name) { - $this->testsStart = microtime(true); - - $this->root->setAttribute('name', $test_name); - $this->root->setAttribute('timestamp', date('c')); - $this->root->setAttribute('hostname', 'localhost'); - - echo "\n"; - echo "\n"; - - $duration = microtime(true) - $this->testsStart; - - $this->root->setAttribute('tests', $this->getPassCount() + $this->getFailCount() + $this->getExceptionCount()); - $this->root->setAttribute('failures', $this->getFailCount()); - $this->root->setAttribute('errors', $this->getExceptionCount()); - $this->root->setAttribute('time', $duration); - - $this->doc->formatOutput = true; - $xml = $this->doc->saveXML(); - // Cut out XML declaration - echo preg_replace('/<\?[^>]*\?>/', "", $xml); - echo "\n"; - } - - function paintCaseStart($case) { - echo "- case start $case\n"; - $this->currentCaseName = $case; - } - - function paintCaseEnd($case) { - // No output here - } - - function paintMethodStart($test) { - echo " - test start: $test\n"; - - $this->methodStart = microtime(true); - $this->currCase = $this->doc->createElement('testcase'); - } - - function paintMethodEnd($test) { - $duration = microtime(true) - $this->methodStart; - - $this->currCase->setAttribute('name', $test); - $this->currCase->setAttribute('classname', $this->currentCaseName); - $this->currCase->setAttribute('time', $duration); - $this->root->appendChild($this->currCase); - } - - function paintFail($message) { - parent::paintFail($message); - - error_log("Failure: " . $message); - $this->terminateAbnormally($message); - } - - function paintException($exception) { - parent::paintException($exception); - - error_log("Exception: " . $exception); - $this->terminateAbnormally($exception); - } - - function terminateAbnormally($message) { - if (!$this->currCase) { - error_log("!! currCase was not set."); - return; - } - - $ch = $this->doc->createElement('failure'); - $breadcrumb = $this->getTestList(); - $ch->setAttribute('message', $breadcrumb[count($breadcrumb)-1]); - $ch->setAttribute('type', $breadcrumb[count($breadcrumb)-1]); - - $message = implode(' -> ', $breadcrumb) . "\n\n\n" . $message; - $content = $this->doc->createTextNode($message); - $ch->appendChild($content); - - $this->currCase->appendChild($ch); - } -} -?> - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/pear_test_case.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/pear_test_case.php deleted file mode 100644 index 4fc34f5..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/pear_test_case.php +++ /dev/null @@ -1,196 +0,0 @@ -_loosely_typed = false; - } - - /** - * Will test straight equality if set to loose - * typing, or identity if not. - * @param $first First value. - * @param $second Comparison value. - * @param $message Message to display. - * @public - */ - function assertEquals($first, $second, $message = "%s", $delta = 0) { - if ($this->_loosely_typed) { - $expectation = new EqualExpectation($first); - } else { - $expectation = new IdenticalExpectation($first); - } - $this->assert($expectation, $second, $message); - } - - /** - * Passes if the value tested is not null. - * @param $value Value to test against. - * @param $message Message to display. - * @public - */ - function assertNotNull($value, $message = "%s") { - parent::assert(new TrueExpectation(), isset($value), $message); - } - - /** - * Passes if the value tested is null. - * @param $value Value to test against. - * @param $message Message to display. - * @public - */ - function assertNull($value, $message = "%s") { - parent::assert(new TrueExpectation(), !isset($value), $message); - } - - /** - * Identity test tests for the same object. - * @param $first First object handle. - * @param $second Hopefully the same handle. - * @param $message Message to display. - * @public - */ - function assertSame($first, $second, $message = "%s") { - $dumper = new SimpleDumper(); - $message = sprintf( - $message, - "[" . $dumper->describeValue($first) . - "] and [" . $dumper->describeValue($second) . - "] should reference the same object"); - return $this->assert( - new TrueExpectation(), - SimpleTestCompatibility::isReference($first, $second), - $message); - } - - /** - * Inverted identity test. - * @param $first First object handle. - * @param $second Hopefully a different handle. - * @param $message Message to display. - * @public - */ - function assertNotSame($first, $second, $message = "%s") { - $dumper = new SimpleDumper(); - $message = sprintf( - $message, - "[" . $dumper->describeValue($first) . - "] and [" . $dumper->describeValue($second) . - "] should not be the same object"); - return $this->assert( - new falseExpectation(), - SimpleTestCompatibility::isReference($first, $second), - $message); - } - - /** - * Sends pass if the test condition resolves true, - * a fail otherwise. - * @param $condition Condition to test true. - * @param $message Message to display. - * @public - */ - function assertTrue($condition, $message = "%s") { - parent::assert(new TrueExpectation(), $condition, $message); - } - - /** - * Sends pass if the test condition resolves false, - * a fail otherwise. - * @param $condition Condition to test false. - * @param $message Message to display. - * @public - */ - function assertFalse($condition, $message = "%s") { - parent::assert(new FalseExpectation(), $condition, $message); - } - - /** - * Tests a regex match. Needs refactoring. - * @param $pattern Regex to match. - * @param $subject String to search in. - * @param $message Message to display. - * @public - */ - function assertRegExp($pattern, $subject, $message = "%s") { - $this->assert(new PatternExpectation($pattern), $subject, $message); - } - - /** - * Tests the type of a value. - * @param $value Value to take type of. - * @param $type Hoped for type. - * @param $message Message to display. - * @public - */ - function assertType($value, $type, $message = "%s") { - parent::assert(new TrueExpectation(), gettype($value) == strtolower($type), $message); - } - - /** - * Sets equality operation to act as a simple equal - * comparison only, allowing a broader range of - * matches. - * @param $loosely_typed True for broader comparison. - * @public - */ - function setLooselyTyped($loosely_typed) { - $this->_loosely_typed = $loosely_typed; - } - - /** - * For progress indication during - * a test amongst other things. - * @return Usually one. - * @public - */ - function countTestCases() { - return $this->getSize(); - } - - /** - * Accessor for name, normally just the class - * name. - * @public - */ - function getName() { - return $this->getLabel(); - } - - /** - * Does nothing. For compatibility only. - * @param $name Dummy - * @public - */ - function setName($name) { - } - } -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/recorder.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/recorder.php deleted file mode 100644 index 80ea861..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/recorder.php +++ /dev/null @@ -1,62 +0,0 @@ -SimpleReporter(); - $this->results = array(); - } - - function paintPass($message) { - parent::paintPass($message); - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - $test = implode("->", $breadcrumb); - - $result["time"] = time(); - $result["status"] = "Passed"; - $result["test"] = $test; - $result["message"] = $message; - $this->results[] = $result; - } - - function paintFail($message) { - parent::paintFail($message); - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - $test = implode("->", $breadcrumb); - - $result["time"] = time(); - $result["status"] = "Failed"; - $result["test"] = $test; - $result["message"] = $message; - $this->results[] = $result; - } -} - -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/recorder/test/sample.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/recorder/test/sample.php deleted file mode 100644 index 4848c48..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/recorder/test/sample.php +++ /dev/null @@ -1,14 +0,0 @@ -assertTrue(true); - } - - function testFalseIsTrue() { - $this->assertFalse(true); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/recorder/test/test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/recorder/test/test.php deleted file mode 100644 index ec72cdb..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/recorder/test/test.php +++ /dev/null @@ -1,28 +0,0 @@ -addTestFile(dirname(__FILE__) . '/sample.php'); - $recorder = new Recorder(); - $test->run($recorder); - $this->assertEqual(count($recorder->results), 2); - - $this->assertEqual(count($recorder->results[0]), 4); - $this->assertPattern("/".substr(time(), 9)."/", $recorder->results[0]['time']); - $this->assertEqual($recorder->results[0]['status'], "Passed"); - $this->assertPattern("/sample\.php->SampleTestForRecorder->testTrueIsTrue/i", $recorder->results[0]['test']); - $this->assertPattern("/ at \[.*recorder\/test\/sample\.php line 7\]/", $recorder->results[0]['message']); - - $this->assertEqual(count($recorder->results[1]), 4); - $this->assertPattern("/".substr(time(), 9)."/", $recorder->results[1]['time']); - $this->assertEqual($recorder->results[1]['status'], "Failed"); - $this->assertPattern("/sample\.php->SampleTestForRecorder->testFalseIsTrue/i", $recorder->results[1]['test']); - $this->assertPattern("/Expected false, got \[Boolean: true\] at \[.*recorder\/test\/sample\.php line 11\]/", $recorder->results[1]['message']); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/selenese_tester.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/selenese_tester.php deleted file mode 100644 index 9ae2d9c..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/selenese_tester.php +++ /dev/null @@ -1,393 +0,0 @@ - - * @param simpleSelenium $selenium - * @param string $html - * @param string $testFile - * @param array $parsed_table - * @param string $logMessages - * @param array $_commandMap - * - */ -class SeleneseTestCase extends UnitTestCase { - var $selenium; - var $html; - var $testFile; - var $parsed_table; - var $logMessages; - var $_commandMap = array("verify", - "verifyErrorOnNext", - "verifyNotErrorOnNext", - "verifyFailureOnNext", - "verifyNotFailureOnNext", - "verifySelected", - "verifyNotSelected", - "verifyAlert", - "verifyNotAlert", - "verifyAllButtons", - "verifyNotAllButtons", - "verifyAllFields", - "verifyNotAllFields", - "verifyAllLinks", - "verifyNotAllLinks", - "verifyAllWindowIds", - "verifyNotAllWindowIds", - "verifyAllWindowNames", - "verifyNotAllWindowNames", - "verifyAllWindowTitles", - "verifyNotAllWindowTitles", - "verifyAttribute", - "verifyNotAttribute", - "verifyAttributeFromAllWindows", - "verifyNotAttributeFromAllWindows", - "verifyBodyText", - "verifyNotBodyText", - "verifyConfirmation", - "verifyNotConfirmation", - "verifyCookie", - "verifyNotCookie", - "verifyCursorPosition", - "verifyNotCursorPosition", - "verifyElementHeight", - "verifyNotElementHeight", - "verifyElementIndex", - "verifyNotElementIndex", - "verifyElementPositionLeft", - "verifyNotElementPositionLeft", - "verifyElementPositionTop", - "verifyNotElementPositionTop", - "verifyElementWidth", - "verifyNotElementWidth", - "verifyEval", - "verifyNotEval", - "verifyExpression", - "verifyNotExpression", - "verifyHtmlSource", - "verifyNotHtmlSource", - "verifyLocation", - "verifyNotLocation", - "verifyLogMessages", - "verifyNotLogMessages", - "verifyMouseSpeed", - "verifyNotMouseSpeed", - "verifyPrompt", - "verifyNotPrompt", - "verifySelectedId", - "verifyNotSelectedId", - "verifySelectedIds", - "verifyNotSelectedIds", - "verifySelectedIndex", - "verifyNotSelectedIndex", - "verifySelectedIndexes", - "verifyNotSelectedIndexes", - "verifySelectedLabel", - "verifyNotSelectedLabel", - "verifySelectedLabels", - "verifyNotSelectedLabels", - "verifySelectedValue", - "verifyNotSelectedValue", - "verifySelectedValues", - "verifyNotSelectedValues", - "verifySelectOptions", - "verifyNotSelectOptions", - "verifyTable", - "verifyNotTable", - "verifyText", - "verifyNotText", - "verifyTitle", - "verifyNotTitle", - "verifyValue", - "verifyNotValue", - "verifyWhetherThisFrameMatchFrameExpression", - "verifyNotWhetherThisFrameMatchFrameExpression", - "verifyWhetherThisWindowMatchWindowExpression", - "verifyNotWhetherThisWindowMatchWindowExpression", - "verifyAlertPresent", - "verifyAlertNotPresent", - "verifyChecked", - "verifyNotChecked", - "verifyConfirmationPresent", - "verifyConfirmationNotPresent", - "verifyEditable", - "verifyNotEditable", - "verifyElementPresent", - "verifyElementNotPresent", - "verifyOrdered", - "verifyNotOrdered", - "verifyPromptPresent", - "verifyPromptNotPresent", - "verifySomethingSelected", - "verifyNotSomethingSelected", - "verifyTextPresent", - "verifyTextNotPresent", - "verifyVisible", - "verifyNotVisible", - "assert", - "assertErrorOnNext", - "assertNotErrorOnNext", - "assertFailureOnNext", - "assertNotFailureOnNext", - "assertSelected", - "assertNotSelected", - "assertAlert", - "assertNotAlert", - "assertAllButtons", - "assertNotAllButtons", - "assertAllFields", - "assertNotAllFields", - "assertAllLinks", - "assertNotAllLinks", - "assertAllWindowIds", - "assertNotAllWindowIds", - "assertAllWindowNames", - "assertNotAllWindowNames", - "assertAllWindowTitles", - "assertNotAllWindowTitles", - "assertAttribute", - "assertNotAttribute", - "assertAttributeFromAllWindows", - "assertNotAttributeFromAllWindows", - "assertBodyText", - "assertNotBodyText", - "assertConfirmation", - "assertNotConfirmation", - "assertCookie", - "assertNotCookie", - "assertCursorPosition", - "assertNotCursorPosition", - "assertElementHeight", - "assertNotElementHeight", - "assertElementIndex", - "assertNotElementIndex", - "assertElementPositionLeft", - "assertNotElementPositionLeft", - "assertElementPositionTop", - "assertNotElementPositionTop", - "assertElementWidth", - "assertNotElementWidth", - "assertEval", - "assertNotEval", - "assertExpression", - "assertNotExpression", - "assertHtmlSource", - "assertNotHtmlSource", - "assertLocation", - "assertNotLocation", - "assertLogMessages", - "assertNotLogMessages", - "assertMouseSpeed", - "assertNotMouseSpeed", - "assertPrompt", - "assertNotPrompt", - "assertSelectedId", - "assertNotSelectedId", - "assertSelectedIds", - "assertNotSelectedIds", - "assertSelectedIndex", - "assertNotSelectedIndex", - "assertSelectedIndexes", - "assertNotSelectedIndexes", - "assertSelectedLabel", - "assertNotSelectedLabel", - "assertSelectedLabels", - "assertNotSelectedLabels", - "assertSelectedValue", - "assertNotSelectedValue", - "assertSelectedValues", - "assertNotSelectedValues", - "assertSelectOptions", - "assertNotSelectOptions", - "assertTable", - "assertNotTable", - "assertText", - "assertNotText", - "assertTitle", - "assertNotTitle", - "assertValue", - "assertNotValue", - "assertWhetherThisFrameMatchFrameExpression", - "assertNotWhetherThisFrameMatchFrameExpression", - "assertWhetherThisWindowMatchWindowExpression", - "assertNotWhetherThisWindowMatchWindowExpression", - "assertAlertPresent", - "assertAlertNotPresent", - "assertChecked", - "assertNotChecked", - "assertConfirmationPresent", - "assertConfirmationNotPresent", - "assertEditable", - "assertNotEditable", - "assertElementPresent", - "assertElementNotPresent", - "assertOrdered", - "assertNotOrdered", - "assertPromptPresent", - "assertPromptNotPresent", - "assertSomethingSelected", - "assertNotSomethingSelected", - "assertTextPresent", - "assertTextNotPresent", - "assertVisible", - "assertNotVisible"); - - /** - * constructor - * - * Construct the object with the specified browser and url - * - * @param string $browser - * @param string $url - */ - function __construct($browser, $url) { - $this->selenium = new SimpleSeleniumRemoteControl($browser, $url); - $this->parsed_table = array(); - } - - /** - * tidy - * - * Reformat the selenium-IDE html test suites - */ - function tidy() { - $tmp = $this->html; - preg_match('//', $tmp, $matche); - $matche[0] = str_replace("/>", ">", $matche[0]); - $matche[0] = str_replace(">", "/>", $matche[0]); - $tmp = preg_replace('//', $matche[0], $tmp); - $this->html = $tmp; - } - - /** - * parse - * - * Extract the called selenium fonction from the html suite - */ - function parse() { - $parsedTab = array(); - $key1 = 0; - - $contenthtml = new DOMDocument; - @$contenthtml->loadHtml($this->html); - $content = simplexml_import_dom($contenthtml); - foreach ($content->body->table->tbody->tr as $tr){ - $key2 = 0; - foreach ($tr->td as $td){ - $parsedTab[$key1][$key2] = $td; - $key2++; - } - $key1++; - } - - $this->parsed_table = $parsedTab; - } - - /** - * assertFunction - * - * Integrate selenium fonctions in simpletest - * - * @param string $function - * @param string $param1 - * @param string $param2 - * - */ - function assertFunction($function, $param1, $param2) { - $_verifyMap = array('verify', 'verifyTextPresent', 'verifyTextNotPresent', 'verifyValue'); - - $reponse = $this->selenium->__call($function, array($param1, $param2)); - - $message = $reponse; - $message .= " using command '".$function ."' with target '".$param1."'"; - if (!empty($param2)) { - $message .= " and value '".$param2."'"; - } - $message .= " in file '".$this->testFile."'"; - - if (!in_array($function, $_verifyMap)) { - $reponse = substr($reponse, 0, 2) == 'OK' ? true : false; - } - - $this->assertTrue($reponse, $message); - } - - /** - * launch - * - * Launch the html test suite from a PHP variable on the url declared wihle - * constructing the object. The filename is used to localize the error. - * - * @param string $testFile - * @param string $filename - * - */ - function launch($html="") { - $this->html = $html; - $this->tidy(); - $this->parse(); - - $this->selenium->start(); - foreach ($this->parsed_table as $test) { - if (in_array($test[0], $this->_commandMap)) { - $this->assertFunction($test[0], $test[1], $test[2]); - } else { - $this->selenium->__call($test[0], array($test[1], $test[2])); - } - } - $this->selenium->stop(); - } - - /** - * launchPhpFile - * - * Parse the PHP file then launch the computed test suite - * - * @param string $file - * - */ - function launchPhpFile($file) { - ob_start(); - require($file); - $data = ob_get_contents(); - ob_end_clean(); - - $this->testFile = $file; - $this->html = $data; - $this->launch($this->html); - } - - /** - * launchFile - * - * Launch the html test suite file on the url declared wihle constructing the object - * - * @param string $testFile - * - */ - function launchFile($testFile) { - $this->testFile = $testFile; - $this->html = file_get_contents($testFile); - $this->launch($this->html); - } -} - -?> diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/selenium.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/selenium.php deleted file mode 100644 index 2efaeb4..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/selenium.php +++ /dev/null @@ -1,136 +0,0 @@ -browser)) { - trigger_error('browser property must be set in ' . get_class($this)); - exit; - } - - if (empty($this->browserUrl)) { - trigger_error('browserUrl property must be set in ' . get_class($this)); - exit; - } - } - - public function setUp() { - parent::setUp(); - - if (is_null($this->selenium)) { - $this->selenium = new SimpleSeleniumRemoteControl( - $this->browser, - $this->browserUrl, - $this->host, - $this->port, - $this->timeout - ); - $this->selenium->start(); - } - } - - public function tearDown() { - parent::tearDown(); - - if ($this->newInstanceEachTest) { - $this->selenium->stop(); - $this->selenium = null; - } - } - - public function __call($method, $arguments) { - if (substr($method, 0, 6) == 'verify') { - return $this->assertTrue( - call_user_func_array( - array($this->selenium, $method), - $arguments - ), - sprintf('%s failed', $method) - ); - } - - return call_user_func_array( - array($this->selenium, $method), - $arguments - ); - } - - public function verifyText($text) { - return $this->assertTrue( - $this->selenium->verifyText($text), - sprintf( - 'verifyText failed when on [%s]', - $text - ) - ); - } - - public function verifyTextPresent($text) { - return $this->assertTrue( - $this->selenium->verifyTextPresent($text), - sprintf( - 'verifyTextPresent failed when on [%s]', - $text - ) - ); - } - - public function verifyTextNotPresent($text) { - return $this->assertTrue( - $this->selenium->verifyTextNotPresent($text), - sprintf( - 'verifyTextNotPresent failed on [%s]', - $text - ) - ); - } - - public function verifyValue($selector, $value) { - return $this->assertTrue( - $this->selenium->verifyValue($selector, $value), - sprintf( - 'verifyValue failed on [%s] == [%s]', - $selector, - $value - ) - ); - } - - public function verifyTitle($pattern) { - return $this->assertTrue( - $this->selenium->verifyTitle($pattern), - sprintf( - 'verifyTitle failed on [%s]', - $pattern - ) - ); - } -} - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/selenium/remote-control.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/selenium/remote-control.php deleted file mode 100644 index 3227715..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/selenium/remote-control.php +++ /dev/null @@ -1,128 +0,0 @@ - - * - */ -class SimpleSeleniumRemoteControl -{ - private $_browser = ''; - private $_browserUrl = ''; - private $_host = 'localhost'; - private $_port = 4444; - private $_timeout = 30000; - private $_sessionId = null; - - private $_commandMap = array( - 'bool' => array( - 'verify', - 'verifyTextPresent', - 'verifyTextNotPresent', - 'verifyValue' - ), - 'string' => array( - 'getNewBrowserSession', - ), - ); - - public function __construct($browser, $browserUrl, $host = 'localhost', $port = 4444, $timeout = 30000) { - $this->_browser = $browser; - $this->_browserUrl = $browserUrl; - $this->_host = $host; - $this->_port = $port; - $this->_timeout = $timeout; - } - - public function sessionIdParser($response) { - return substr($response, 3); - } - - public function start() { - $response = $this->cmd('getNewBrowserSession', array($this->_browser, $this->_browserUrl)); - $this->_sessionId = $this->sessionIdParser($response); - } - - public function stop() { - $this->cmd('testComplete'); - $this->_sessionId = null; - } - - public function __call($method, $arguments) { - $response = $this->cmd($method, $arguments); - - foreach ($this->_commandMap as $type => $commands) { - if (!in_array($method, $commands)) { - continue; - $type = null; - } - break; - } - - switch ($type) { - case 'bool' : - return substr($response, 0, 2) == 'OK' ? true : false; - break; - - case 'string' : - default: - return $response; - } - } - - private function _server() { - return "http://{$this->_host}:{$this->_port}/selenium-server/driver/"; - } - - public function buildUrlCmd($method, $arguments = array()) { - $params = array( - 'cmd=' . urlencode($method), - ); - $i = 1; - foreach ($arguments as $param) { - $params[] = $i++ . '=' . urlencode(trim($param)); - } - if (isset($this->_sessionId)) { - $params[] = 'sessionId=' . $this->_sessionId; - } - - return $this->_server()."?".implode('&', $params); - } - - public function cmd($method, $arguments = array()) { - $url = $this->buildUrlCmd($method, $arguments); - $response = $this->_sendRequest($url); - return $response; - } - - public function isUp() { - return (bool)@fsockopen($this->_host, $this->_port, $errno, $errstr, 30); - } - - private function _initCurl($url) { - if (!function_exists('curl_init')) { - throw new Exception('this code currently requires the curl extension'); - } - if (!$ch = curl_init($url)) { - throw new Exception('Unable to setup curl'); - } - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_TIMEOUT, floor($this->_timeout)); - return $ch; - } - - private function _sendRequest($url) { - $ch = $this->_initCurl($url); - $result = curl_exec($ch); - if (($errno = curl_errno($ch)) != 0) { - throw new Exception('Curl returned non-null errno ' . $errno . ':' . curl_error($ch)); - } - curl_close($ch); - return $result; - } -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/selenium/test/remote-control_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/selenium/test/remote-control_test.php deleted file mode 100644 index b705b6a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/selenium/test/remote-control_test.php +++ /dev/null @@ -1,36 +0,0 @@ -assertEqual($remote_control->sessionIdParser('OK,123456789123456789'), '123456789123456789'); - } - - function testIsUpReturnsFalseWhenDirectedToLocalhostDown() { - $remote_control = new SimpleSeleniumRemoteControl("tester", "http://simpletest.org/", "localhost-down");; - $this->assertFalse($remote_control->isUp()); - } - - function testIsUpReturnsTrueWhenDirectedToLocalhostOnPort80() { - $remote_control = new SimpleSeleniumRemoteControl("tester", "http://simpletest.org/", "localhost", "80"); - $this->assertTrue($remote_control->isUp()); - } -} - -class TestOfSimpleSeleniumRemoteControlWhenItIsUp extends UnitTestCase { - function skip() { - $remote_control = new SimpleSeleniumRemoteControl("*custom opera -nosession", "http://simpletest.org/"); - $this->skipUnless($remote_control->isUp(), 'Remote control tests desperatly need a working Selenium Server.'); - } - - function testOfCommandCreation() { - $remote_control = new SimpleSeleniumRemoteControl("tester", "http://simpletest.org/"); - $this->assertEqual($remote_control->buildUrlCmd("test"), 'http://localhost:4444/selenium-server/driver/?cmd=test'); - $this->assertEqual($remote_control->buildUrlCmd("test", array("next")), 'http://localhost:4444/selenium-server/driver/?cmd=test&1=next'); - $this->assertEqual($remote_control->buildUrlCmd("test", array("t")), 'http://localhost:4444/selenium-server/driver/?cmd=test&1=%C3%A9t%C3%A9'); - $this->assertEqual($remote_control->buildUrlCmd("test", array("next", "then")), 'http://localhost:4444/selenium-server/driver/?cmd=test&1=next&2=then'); - } -} \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/testdox.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/testdox.php deleted file mode 100644 index dd9c61d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/testdox.php +++ /dev/null @@ -1,55 +0,0 @@ -_test_case_pattern = empty($test_case_pattern) ? '/^(.*)$/' : $test_case_pattern; - } - - function paintCaseStart($test_name) { - preg_match($this->_test_case_pattern, $test_name, $matches); - if (!empty($matches[1])) { - echo $matches[1] . "\n"; - } else { - echo $test_name . "\n"; - } - } - - function paintCaseEnd($test_name) { - echo "\n"; - } - - function paintMethodStart($test_name) { - if (!preg_match('/^test(.*)$/i', $test_name, $matches)) { - return; - } - $test_name = $matches[1]; - - $test_name = preg_replace('/([A-Z])([A-Z])/', '$1 $2', $test_name); - echo '- ' . strtolower(preg_replace('/([a-zA-Z])([A-Z0-9])/', '$1 $2', $test_name)); - } - - function paintMethodEnd($test_name) { - echo "\n"; - } - - function paintFail($message) { - echo " [FAILED]"; - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/testdox/test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/testdox/test.php deleted file mode 100644 index b03abe5..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/testdox/test.php +++ /dev/null @@ -1,107 +0,0 @@ -assertIsA($dox, 'SimpleScorer'); - $this->assertIsA($dox, 'SimpleReporter'); - } - - function testOutputsNameOfTestCase() { - $dox = new TestDoxReporter(); - ob_start(); - $dox->paintCaseStart('TestOfTestDoxReporter'); - $buffer = ob_get_clean(); - $this->assertPattern('/^TestDoxReporter/', $buffer); - } - - function testOutputOfTestCaseNameFilteredByConstructParameter() { - $dox = new TestDoxReporter('/^(.*)Test$/'); - ob_start(); - $dox->paintCaseStart('SomeGreatWidgetTest'); - $buffer = ob_get_clean(); - $this->assertPattern('/^SomeGreatWidget/', $buffer); - } - - function testIfTest_case_patternIsEmptyAssumeEverythingMatches() { - $dox = new TestDoxReporter(''); - ob_start(); - $dox->paintCaseStart('TestOfTestDoxReporter'); - $buffer = ob_get_clean(); - $this->assertPattern('/^TestOfTestDoxReporter/', $buffer); - } - - function testEmptyLineInsertedWhenCaseEnds() { - $dox = new TestDoxReporter(); - ob_start(); - $dox->paintCaseEnd('TestOfTestDoxReporter'); - $buffer = ob_get_clean(); - $this->assertEqual("\n", $buffer); - } - - function testPaintsTestMethodInTestDoxFormat() { - $dox = new TestDoxReporter(); - ob_start(); - $dox->paintMethodStart('testSomeGreatTestCase'); - $buffer = ob_get_clean(); - $this->assertEqual("- some great test case", $buffer); - unset($buffer); - - $random = rand(100, 200); - ob_start(); - $dox->paintMethodStart("testRandomNumberIs{$random}"); - $buffer = ob_get_clean(); - $this->assertEqual("- random number is {$random}", $buffer); - } - - function testDoesNotOutputAnythingOnNoneTestMethods() { - $dox = new TestDoxReporter(); - ob_start(); - $dox->paintMethodStart('nonMatchingMethod'); - $buffer = ob_get_clean(); - $this->assertEqual('', $buffer); - } - - function testPaintMethodAddLineBreak() { - $dox = new TestDoxReporter(); - ob_start(); - $dox->paintMethodEnd('someMethod'); - $buffer = ob_get_clean(); - $this->assertEqual("\n", $buffer); - } - - function testProperlySpacesSingleLettersInMethodName() { - $dox = new TestDoxReporter(); - ob_start(); - $dox->paintMethodStart('testAVerySimpleAgainAVerySimpleMethod'); - $buffer = ob_get_clean(); - $this->assertEqual('- a very simple again a very simple method', $buffer); - } - - function testOnFailureThisPrintsFailureNotice() { - $dox = new TestDoxReporter(); - ob_start(); - $dox->paintFail(''); - $buffer = ob_get_clean(); - $this->assertEqual(' [FAILED]', $buffer); - } - - function testWhenMatchingMethodNamesTestPrefixIsCaseInsensitive() { - $dox = new TestDoxReporter(); - ob_start(); - $dox->paintMethodStart('TESTSupportsAllUppercaseTestPrefixEvenThoughIDoNotKnowWhyYouWouldDoThat'); - $buffer = ob_get_clean(); - $this->assertEqual( - '- supports all uppercase test prefix even though i do not know why you would do that', - $buffer - ); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/treemap_reporter.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/treemap_reporter.php deleted file mode 100644 index 0dfacb4..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/treemap_reporter.php +++ /dev/null @@ -1,126 +0,0 @@ -SimpleReporterDecorator(new TreemapRecorder()); - } - - /** - * basic CSS for floating nested divs - * @todo checkout some weird border bugs - */ - function _getCss() { - $css = ".pass{background-color:green;}.fail{background-color:red;}"; - $css .= "body {background-color:white;margin:0;padding:1em;}"; - $css .= "div{float:right;margin:0;color:black;}"; - $css .= "div{border-left:1px solid white;border-bottom:1px solid white;}"; - $css .= "h1 {font:normal 1.8em Arial;color:black;margin:0 0 0.3em 0.1em;}"; - $css .= ".clear { clear:both; }"; - return $css; - } - - /** - * paints the HTML header and sets up results - */ - function paintResultsHeader() { - $title = $this->_reporter->getTitle(); - echo ""; - echo "{$title}"; - echo ""; - echo ""; - echo "

{$title}

"; - } - - /** - * places a clearing break below the end of the test nodes - */ - function paintResultsFooter() { - echo "
"; - echo ""; - } - - /** - * paints start tag for div representing a test node - */ - function paintRectangleStart($node, $horiz, $vert) { - $name = $node->getName(); - $description = $node->getDescription(); - $status = $node->getStatus(); - echo "
"; - } - - /** - * paints end tag for test node div - */ - function paintRectangleEnd() { - echo "
"; - } - - /** - * paints wrapping treemap divs - * @todo how to configure aspect and other parameters? - */ - function paintFooter($group) { - $aspect = 1; - $this->paintResultsHeader(); - $this->paintRectangleStart($this->_reporter->getGraph(), 100, 100); - $this->divideMapNodes($this->_reporter->getGraph(), $aspect); - $this->paintRectangleEnd(); - $this->paintResultsFooter(); - } - - /** - * divides the test results based on a slice and dice algorithm - * - * @param TreemapNode $map sorted - * @param boolean $aspect flips the aspect between horizontal and vertical - * @private - */ - function divideMapNodes($map, $aspect) { - $aspect = !$aspect; - $divisions = $map->getSize(); - $total = $map->getTotalSize(); - foreach($map->getChildren() as $node) { - if (!$node->isLeaf()) { - $dist = $node->getTotalSize() / $total * 100; - } else { - $dist = 1 / $total * 100; - } - if ($aspect) { - $horiz = $dist; - $vert = 100; - } else { - $horiz = 100; - $vert = $dist; - } - $this->paintRectangleStart($node, $horiz, $vert); - $this->divideMapNodes($node, $aspect); - $this->paintRectangleEnd(); - } - } - - function paintGroupEnd($group) { - $this->_reporter->paintGroupEnd($group); - if ($this->_reporter->isComplete()) { - $this->paintFooter($group); - } - } - -} - -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/treemap_reporter/jquery.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/treemap_reporter/jquery.php deleted file mode 100644 index 7de0e1e..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/treemap_reporter/jquery.php +++ /dev/null @@ -1,75 +0,0 @@ - representing treemap of test report, - * and attaches jQuery Treemap to render results. - * - * @package SimpleTest - * @subpackage Extensions - */ -class JqueryTreemapReporter extends TreemapReporter { - - function _getCss() { - $css = ".treemapView { color:white; } - .treemapCell {background-color:green;font-size:10px;font-family:Arial;} - .treemapHead {cursor:pointer;background-color:#B34700} - .treemapCell.selected, .treemapCell.selected .treemapCell.selected {background-color:#FFCC80} - .treemapCell.selected .treemapCell {background-color:#FF9900} - .treemapCell.selected .treemapHead {background-color:#B36B00} - .transfer {border:1px solid black}"; - return $css; - } - - function paintResultsHeader() { - $title = $this->_reporter->getTitle(); - echo ""; - echo "{$title}"; - echo ""; - echo ""; - echo ""; - echo ""; - echo "
    "; - } - - function paintRectangleStart($node) { - echo "
  • ". basename($node->getDescription()) . ""; - echo "" . $node->getTotalSize() . ""; - } - - function paintRectangleEnd() {} - - function paintResultsFooter() { - echo "
"; - echo ""; - } - - function divideMapNodes($map) { - foreach($map->getChildren() as $node) { - if (!$node->isLeaf()) { - $this->paintRectangleStart($node); - $this->divideMapNodes($node); - } - } - } - -} - -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/treemap_reporter/test/treemap_node_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/treemap_reporter/test/treemap_node_test.php deleted file mode 100644 index f3c6a23..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/treemap_reporter/test/treemap_node_test.php +++ /dev/null @@ -1,69 +0,0 @@ -assertEqual($node->getSize(), 0); - $this->assertEqual($node->getTotalSize(), 0); - } - - function testChildNodeDepth() { - $root = new TreemapNode("root", "test"); - $root->putChild(new TreemapNode("child", "test")); - $childOne = new TreemapNode("child1", "test"); - $childTwo = new TreemapNode("child2", "test"); - $childTwo->putChild(new TreemapNode("child3", "test")); - $childOne->putChild($childTwo); - $root->putChild($childOne); - $this->assertEqual($root->getSize(), 2); - $this->assertEqual($root->getTotalSize(), 4); - } - - function testGraphDepthSpread() { - $root = new TreemapNode("root", "test"); - $root->putChild(new TreemapNode("child", "test")); - $childOne = new TreemapNode("child1", "test"); - $childTwo = new TreemapNode("child2", "test"); - $childThree = new TreemapNode("child3", "test"); - $childFour = new TreemapNode("child4", "test"); - $childFive = new TreemapNode("child5", "test"); - $childSix = new TreemapNode("child6", "test"); - $childFour->putChild($childFive); - $childFour->putChild($childSix); - $this->assertEqual($childFour->getSize(), 2); - $this->assertEqual($childFour->getTotalSize(), 2); - $childThree->putChild($childFour); - $this->assertEqual($childThree->getSize(), 1); - $this->assertEqual($childThree->getTotalSize(), 3); - $childTwo->putChild($childThree); - $this->assertEqual($childTwo->getSize(), 1); - $this->assertEqual($childTwo->getTotalSize(), 4); - $childOne->putChild($childTwo); - $root->putChild($childOne); - $this->assertEqual($root->getSize(), 2); - $this->assertEqual($root->getTotalSize(), 7); - } - - function testMutableStack() { - $stack = new TreemapStack(); - $this->assertEqual($stack->size(), 0); - $stack->push(new TreemapNode("a", "one")); - $this->assertEqual($stack->size(), 1); - $stack->push(new TreemapNode("b", "one")); - $this->assertIdentical($stack->peek(), new TreemapNode("b", "one")); - $stack->push(new TreemapNode("c", "three")); - $stack->push(new TreemapNode("d", "four")); - $this->assertEqual($stack->size(), 4); - $this->assertIdentical($stack->pop(), new TreemapNode("d", "four")); - $this->assertEqual($stack->size(), 3); - $this->assertIdentical($stack->pop(), new TreemapNode("c", "three")); - $this->assertEqual($stack->size(), 2); - } - -} - -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/treemap_reporter/treemap_recorder.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/treemap_reporter/treemap_recorder.php deleted file mode 100644 index 0136e49..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/treemap_reporter/treemap_recorder.php +++ /dev/null @@ -1,310 +0,0 @@ -SimpleReporter(); - $this->_stack = new TreemapStack(); - $this->_graph = null; - } - - /** - * returns a reference to the root node of the - * collected treemap graph - */ - function getGraph() { - return $this->_graph; - } - - /** - * is this test run finished? - */ - function isComplete() { - return ($this->_graph != null); - } - - /** - * returns the title of the test - */ - function getTitle() { - return $this->_title; - } - - /** - * stashes the title of the test - */ - function paintHeader($title) { - $this->_title = $title; - } - - function paintFormattedMessage() { - } - - /** - * acceptor for start of test group node - */ - function paintGroupStart($message, $size) { - parent::paintGroupStart($message, $size); - $node = new TreemapNode("Group", $message); - $this->_stack->push($node); - } - - /** - * acceptor for start of test case node - */ - function paintCaseStart($message) { - parent::paintCaseStart($message); - $node = new TreemapNode("TestCase", $message); - $this->_stack->push($node); - } - - /** - * acceptor for start of test method node - */ - function paintMethodStart($message) { - parent::paintMethodStart($message); - $node = new TreemapNode("Method", $message); - $this->_stack->push($node); - } - - /** - * acceptor for passing assertion node - */ - function paintPass($message) { - parent::paintPass($message); - $node = new TreemapNode("Assertion", $message, true); - $current = $this->_stack->peek(); - if ($current) { - $current->putChild($node); - } else { - echo "no current node"; - } - } - - - /** - * acceptor for failing assertion node - */ - - function paintFail($message) { - parent::paintFail($message); - $node = new TreemapNode("Assertion", $message, false); - $current = $this->_stack->peek(); - $current->putChild($node); - $current->fail(); - } - - /** - * acceptor for end of method node - */ - function paintMethodEnd($message) { - parent::paintCaseEnd($message); - $node = $this->_stack->pop(); - $current = $this->_stack->peek(); - if ($node->isFailed()) $current->fail(); - $current->putChild($node); - } - - /** - * acceptor for end of test case - */ - function paintCaseEnd($message) { - parent::paintCaseEnd($message); - $node = $this->_stack->pop(); - $current = $this->_stack->peek(); - if ($node->isFailed()) $current->fail(); - $current->putChild($node); - } - - /** - * acceptor for end of test group. final group - * pops the collected treemap nodes and assigns - * it to the internal graph property. - */ - function paintGroupEnd($message) { - $node = $this->_stack->pop(); - $current = $this->_stack->peek(); - if ($current) { - if ($node->isFailed()) $current->fail(); - $current->putChild($node); - } else { - $this->_graph = $node; - } - parent::paintGroupEnd($message); - } - -} - -/** - * Creates a treemap graph, representing - * each node in a test visualization. - * - * @package SimpleTest - * @subpackage Extensions - */ -class TreemapNode { - var $_name; - var $_description; - var $_status; - var $_parent; - var $_size; - - function TreemapNode($name, $description, $status=true) { - $this->_name = $name; - $this->_description = $description; - $this->_status = $status; - $this->_children = array(); - } - - /** - * @return string label of this node - */ - function getName() { - return $this->_name; - } - - /** - * @return string description of this node - */ - function getDescription() { - return $this->_description; - } - - /** - * @return string status class string - */ - function getStatus() { - return ($this->_status) ? "pass" : "fail"; - } - - /** - * Return list of child nodes from direct edges. - */ - function getChildren() { - uksort($this->_children, array($this, 'compareChildren')); - return $this->_children; - } - - /** - * Comparator method to rank child nodes by total weight. - */ - function compareChildren($a, $b) { - if ($this->_children[$a]->getTotalSize() > $this->_children[$b]->getTotalSize()) { - $node_a = $this->_children[$a]; - $node_b = $this->_children[$b]; - $this->_children[$a] = $node_b; - $this->_children[$b] = $node_a; - } - } - - /** - * Gets the number of immediate child edges from this node. - */ - function getSize() { - return count($this->_children); - } - - /** - * depth first search to get the total number of nodes - * that are descendants of this node. - */ - function getTotalSize() { - if (!isset($this->_size)) { - $size = $this->getSize(); - if (!$this->isLeaf()) { - foreach($this->getChildren() as $child) { - $size += $child->getTotalSize(); - } - } - $this->_size = $size; - } - return $this->_size; - } - - /** - * Fail this node. - * @return void - */ - function fail() { - $this->_status = false; - } - - /** Is this node failed? */ - function isFailed() { - return ($this->_status == false); - } - - /** Add an edge to a child node */ - function putChild($node) { - $this->_children[] = $node; - } - - /** Is this node a leaf node? */ - function isLeaf() { - return (count($this->_children) == 0); - } - -} - -/** - * provides LIFO stack semantics - * - * @package SimpleTest - * @subpackage Extensions - */ -class TreemapStack { - var $_list; - - function TreemapStack() { - $this->_list = array(); - } - - /** - * Push an element onto the stack. - */ - function push($node) { - $this->_list[] = $node; - } - - /** - * Number of elements in the stack. - */ - function size() { - return count($this->_list); - } - - /** - * Take a peek at the top element on the - * stack. - */ - function peek() { - return end($this->_list); - } - - /** - * Pops an element off the stack. - */ - function pop() { - return array_pop($this->_list); - } - -} - -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/webunit_reporter.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/webunit_reporter.php deleted file mode 100644 index 52d25eb..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/extensions/webunit_reporter.php +++ /dev/null @@ -1,285 +0,0 @@ - - -%s - - - - - - -
-

 Running %s 

- Please wait...
-
  -
- -
-

-
-
visible tab content
-     Fail   -   Tree   -
-
Click on a failed test case method in the tree tab to view output here.
-
-
-
- -'.$this->outputScript("xHide('wait');"); - $colour = ($this->getFailCount() + $this->getExceptionCount() > 0 ? "red" : "green"); - $content = "

$test_name

\n"; - $content .= "
"; - $content .= $this->getTestCaseProgress() . "/" . $this->getTestCaseCount(); - $content .= " test cases complete:\n"; - $content .= "" . $this->getPassCount() . " passes, "; - $content .= "" . $this->getFailCount() . " fails and "; - $content .= "" . $this->getExceptionCount() . " exceptions."; - $content .= "
\n"; - - echo $this->outputScript('foo = "'.$this->toJsString($content).'";'."\nset_div_content('run', foo);"); - echo "\n\n\n"; - } - - - /** - * Paints formatted text such as dumped variables. - * @param string $message Text to show. - * @access public - */ - function paintFormattedMessage($message) { - echo "add_log(\"".$this->toJsString("
$message
", true)."\");\n"; - } - - /** - * Paints the start of a group test. Will also paint - * the page header and footer if this is the - * first test. Will stash the size if the first - * start. - * @param string $test_name Name of test that is starting. - * @param integer $size Number of test cases starting. - * @access public - */ - function paintGroupStart($test_name, $size) { - Parent::paintGroupStart($test_name, $size); - echo "add_group('$test_name');\n"; - } - - /** - * Paints the start of a test case. Will also paint - * the page header and footer if this is the - * first test. Will stash the size if the first - * start. - * @param string $test_name Name of test that is starting. - * @access public - */ - function paintCaseStart($test_name) { - Parent::paintCaseStart($test_name); - echo "add_case('$test_name');\n"; - } - - - /** - * Paints the start of a test method. - * @param string $test_name Name of test that is starting. - * @access public - */ - function paintMethodStart($test_name) { - Parent::paintMethodStart($test_name); - echo "add_method('$test_name');\n"; - } - - /** - * Paints the end of a test method. - * @param string $test_name Name of test that is ending. - * @access public - */ - function paintMethodEnd($test_name) { - Parent::paintMethodEnd($test_name); - } - - /** - * Paints the test failure with a breadcrumbs - * trail of the nesting test suites below the - * top level test. - * @param string $message Failure message displayed in - * the context of the other tests. - * @access public - */ - function paintFail($message) { - parent::paintFail($message); - $msg = "Fail: "; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - $msg .= implode("->", $breadcrumb); - $msg .= "->" . htmlentities($message) . "
"; - echo "add_fail('$msg');\n"; - } - - /** - * Paints a PHP error or exception. - * @param string $message Message is ignored. - * @access public - * @abstract - */ - function paintException($message) { - parent::paintException($message); - $msg = "Exception: "; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - $msg .= implode("->", $breadcrumb); - $msg .= "->" . htmlentities($message) . "
"; - echo "add_fail('$msg');\n"; - } - - /** - * Returns the script passed in wrapped in script tags. - * - * @param string $script the script to output - * @return string the script wrapped with script tags - */ - function outputScript($script) - { - return "\n"; - } - - - /** - * Transform a string into a format acceptable to JavaScript - * @param string $str the string to transform - * @return string - */ - function toJsString($str, $preserveCr=false) { - $cr = ($preserveCr) ? '\\n' : ''; - return str_replace( - array('"' - ,"\n") - ,array('\"' - ,"$cr\"\n\t+\"") - ,$str - ); - } - } - -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/form.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/form.php deleted file mode 100644 index d14f0f7..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/form.php +++ /dev/null @@ -1,355 +0,0 @@ -method = $tag->getAttribute('method'); - $this->action = $this->createAction($tag->getAttribute('action'), $page); - $this->encoding = $this->setEncodingClass($tag); - $this->default_target = false; - $this->id = $tag->getAttribute('id'); - $this->buttons = array(); - $this->images = array(); - $this->widgets = array(); - $this->radios = array(); - $this->checkboxes = array(); - } - - /** - * Creates the request packet to be sent by the form. - * @param SimpleTag $tag Form tag to read. - * @return string Packet class. - * @access private - */ - protected function setEncodingClass($tag) { - if (strtolower($tag->getAttribute('method')) == 'post') { - if (strtolower($tag->getAttribute('enctype')) == 'multipart/form-data') { - return 'SimpleMultipartEncoding'; - } - return 'SimplePostEncoding'; - } - return 'SimpleGetEncoding'; - } - - /** - * Sets the frame target within a frameset. - * @param string $frame Name of frame. - * @access public - */ - function setDefaultTarget($frame) { - $this->default_target = $frame; - } - - /** - * Accessor for method of form submission. - * @return string Either get or post. - * @access public - */ - function getMethod() { - return ($this->method ? strtolower($this->method) : 'get'); - } - - /** - * Combined action attribute with current location - * to get an absolute form target. - * @param string $action Action attribute from form tag. - * @param SimpleUrl $base Page location. - * @return SimpleUrl Absolute form target. - */ - protected function createAction($action, $page) { - if (($action === '') || ($action === false)) { - return $page->expandUrl($page->getUrl()); - } - return $page->expandUrl(new SimpleUrl($action));; - } - - /** - * Absolute URL of the target. - * @return SimpleUrl URL target. - * @access public - */ - function getAction() { - $url = $this->action; - if ($this->default_target && ! $url->getTarget()) { - $url->setTarget($this->default_target); - } - return $url; - } - - /** - * Creates the encoding for the current values in the - * form. - * @return SimpleFormEncoding Request to submit. - * @access private - */ - protected function encode() { - $class = $this->encoding; - $encoding = new $class(); - for ($i = 0, $count = count($this->widgets); $i < $count; $i++) { - $this->widgets[$i]->write($encoding); - } - return $encoding; - } - - /** - * ID field of form for unique identification. - * @return string Unique tag ID. - * @access public - */ - function getId() { - return $this->id; - } - - /** - * Adds a tag contents to the form. - * @param SimpleWidget $tag Input tag to add. - * @access public - */ - function addWidget($tag) { - if (strtolower($tag->getAttribute('type')) == 'submit') { - $this->buttons[] = $tag; - } elseif (strtolower($tag->getAttribute('type')) == 'image') { - $this->images[] = $tag; - } elseif ($tag->getName()) { - $this->setWidget($tag); - } - } - - /** - * Sets the widget into the form, grouping radio - * buttons if any. - * @param SimpleWidget $tag Incoming form control. - * @access private - */ - protected function setWidget($tag) { - if (strtolower($tag->getAttribute('type')) == 'radio') { - $this->addRadioButton($tag); - } elseif (strtolower($tag->getAttribute('type')) == 'checkbox') { - $this->addCheckbox($tag); - } else { - $this->widgets[] = &$tag; - } - } - - /** - * Adds a radio button, building a group if necessary. - * @param SimpleRadioButtonTag $tag Incoming form control. - * @access private - */ - protected function addRadioButton($tag) { - if (! isset($this->radios[$tag->getName()])) { - $this->widgets[] = new SimpleRadioGroup(); - $this->radios[$tag->getName()] = count($this->widgets) - 1; - } - $this->widgets[$this->radios[$tag->getName()]]->addWidget($tag); - } - - /** - * Adds a checkbox, making it a group on a repeated name. - * @param SimpleCheckboxTag $tag Incoming form control. - * @access private - */ - protected function addCheckbox($tag) { - if (! isset($this->checkboxes[$tag->getName()])) { - $this->widgets[] = $tag; - $this->checkboxes[$tag->getName()] = count($this->widgets) - 1; - } else { - $index = $this->checkboxes[$tag->getName()]; - if (! SimpleTestCompatibility::isA($this->widgets[$index], 'SimpleCheckboxGroup')) { - $previous = $this->widgets[$index]; - $this->widgets[$index] = new SimpleCheckboxGroup(); - $this->widgets[$index]->addWidget($previous); - } - $this->widgets[$index]->addWidget($tag); - } - } - - /** - * Extracts current value from form. - * @param SimpleSelector $selector Criteria to apply. - * @return string/array Value(s) as string or null - * if not set. - * @access public - */ - function getValue($selector) { - for ($i = 0, $count = count($this->widgets); $i < $count; $i++) { - if ($selector->isMatch($this->widgets[$i])) { - return $this->widgets[$i]->getValue(); - } - } - foreach ($this->buttons as $button) { - if ($selector->isMatch($button)) { - return $button->getValue(); - } - } - return null; - } - - /** - * Sets a widget value within the form. - * @param SimpleSelector $selector Criteria to apply. - * @param string $value Value to input into the widget. - * @return boolean True if value is legal, false - * otherwise. If the field is not - * present, nothing will be set. - * @access public - */ - function setField($selector, $value, $position=false) { - $success = false; - $_position = 0; - for ($i = 0, $count = count($this->widgets); $i < $count; $i++) { - if ($selector->isMatch($this->widgets[$i])) { - $_position++; - if ($position === false or $_position === (int)$position) { - if ($this->widgets[$i]->setValue($value)) { - $success = true; - } - } - } - } - return $success; - } - - /** - * Used by the page object to set widgets labels to - * external label tags. - * @param SimpleSelector $selector Criteria to apply. - * @access public - */ - function attachLabelBySelector($selector, $label) { - for ($i = 0, $count = count($this->widgets); $i < $count; $i++) { - if ($selector->isMatch($this->widgets[$i])) { - if (method_exists($this->widgets[$i], 'setLabel')) { - $this->widgets[$i]->setLabel($label); - return; - } - } - } - } - - /** - * Test to see if a form has a submit button. - * @param SimpleSelector $selector Criteria to apply. - * @return boolean True if present. - * @access public - */ - function hasSubmit($selector) { - foreach ($this->buttons as $button) { - if ($selector->isMatch($button)) { - return true; - } - } - return false; - } - - /** - * Test to see if a form has an image control. - * @param SimpleSelector $selector Criteria to apply. - * @return boolean True if present. - * @access public - */ - function hasImage($selector) { - foreach ($this->images as $image) { - if ($selector->isMatch($image)) { - return true; - } - } - return false; - } - - /** - * Gets the submit values for a selected button. - * @param SimpleSelector $selector Criteria to apply. - * @param hash $additional Additional data for the form. - * @return SimpleEncoding Submitted values or false - * if there is no such button - * in the form. - * @access public - */ - function submitButton($selector, $additional = false) { - $additional = $additional ? $additional : array(); - foreach ($this->buttons as $button) { - if ($selector->isMatch($button)) { - $encoding = $this->encode(); - $button->write($encoding); - if ($additional) { - $encoding->merge($additional); - } - return $encoding; - } - } - return false; - } - - /** - * Gets the submit values for an image. - * @param SimpleSelector $selector Criteria to apply. - * @param integer $x X-coordinate of click. - * @param integer $y Y-coordinate of click. - * @param hash $additional Additional data for the form. - * @return SimpleEncoding Submitted values or false - * if there is no such button in the - * form. - * @access public - */ - function submitImage($selector, $x, $y, $additional = false) { - $additional = $additional ? $additional : array(); - foreach ($this->images as $image) { - if ($selector->isMatch($image)) { - $encoding = $this->encode(); - $image->write($encoding, $x, $y); - if ($additional) { - $encoding->merge($additional); - } - return $encoding; - } - } - return false; - } - - /** - * Simply submits the form without the submit button - * value. Used when there is only one button or it - * is unimportant. - * @return hash Submitted values. - * @access public - */ - function submit() { - return $this->encode(); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/frames.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/frames.php deleted file mode 100644 index d6d8e96..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/frames.php +++ /dev/null @@ -1,592 +0,0 @@ -frameset = $page; - $this->frames = array(); - $this->focus = false; - $this->names = array(); - } - - /** - * Adds a parsed page to the frameset. - * @param SimplePage $page Frame page. - * @param string $name Name of frame in frameset. - * @access public - */ - function addFrame($page, $name = false) { - $this->frames[] = $page; - if ($name) { - $this->names[$name] = count($this->frames) - 1; - } - } - - /** - * Replaces existing frame with another. If the - * frame is nested, then the call is passed down - * one level. - * @param array $path Path of frame in frameset. - * @param SimplePage $page Frame source. - * @access public - */ - function setFrame($path, $page) { - $name = array_shift($path); - if (isset($this->names[$name])) { - $index = $this->names[$name]; - } else { - $index = $name - 1; - } - if (count($path) == 0) { - $this->frames[$index] = &$page; - return; - } - $this->frames[$index]->setFrame($path, $page); - } - - /** - * Accessor for current frame focus. Will be - * false if no frame has focus. Will have the nested - * frame focus if any. - * @return array Labels or indexes of nested frames. - * @access public - */ - function getFrameFocus() { - if ($this->focus === false) { - return array(); - } - return array_merge( - array($this->getPublicNameFromIndex($this->focus)), - $this->frames[$this->focus]->getFrameFocus()); - } - - /** - * Turns an internal array index into the frames list - * into a public name, or if none, then a one offset - * index. - * @param integer $subject Internal index. - * @return integer/string Public name. - * @access private - */ - protected function getPublicNameFromIndex($subject) { - foreach ($this->names as $name => $index) { - if ($subject == $index) { - return $name; - } - } - return $subject + 1; - } - - /** - * Sets the focus by index. The integer index starts from 1. - * If already focused and the target frame also has frames, - * then the nested frame will be focused. - * @param integer $choice Chosen frame. - * @return boolean True if frame exists. - * @access public - */ - function setFrameFocusByIndex($choice) { - if (is_integer($this->focus)) { - if ($this->frames[$this->focus]->hasFrames()) { - return $this->frames[$this->focus]->setFrameFocusByIndex($choice); - } - } - if (($choice < 1) || ($choice > count($this->frames))) { - return false; - } - $this->focus = $choice - 1; - return true; - } - - /** - * Sets the focus by name. If already focused and the - * target frame also has frames, then the nested frame - * will be focused. - * @param string $name Chosen frame. - * @return boolean True if frame exists. - * @access public - */ - function setFrameFocus($name) { - if (is_integer($this->focus)) { - if ($this->frames[$this->focus]->hasFrames()) { - return $this->frames[$this->focus]->setFrameFocus($name); - } - } - if (in_array($name, array_keys($this->names))) { - $this->focus = $this->names[$name]; - return true; - } - return false; - } - - /** - * Clears the frame focus. - * @access public - */ - function clearFrameFocus() { - $this->focus = false; - $this->clearNestedFramesFocus(); - } - - /** - * Clears the frame focus for any nested frames. - * @access private - */ - protected function clearNestedFramesFocus() { - for ($i = 0; $i < count($this->frames); $i++) { - $this->frames[$i]->clearFrameFocus(); - } - } - - /** - * Test for the presence of a frameset. - * @return boolean Always true. - * @access public - */ - function hasFrames() { - return true; - } - - /** - * Accessor for frames information. - * @return array/string Recursive hash of frame URL strings. - * The key is either a numerical - * index or the name attribute. - * @access public - */ - function getFrames() { - $report = array(); - for ($i = 0; $i < count($this->frames); $i++) { - $report[$this->getPublicNameFromIndex($i)] = - $this->frames[$i]->getFrames(); - } - return $report; - } - - /** - * Accessor for raw text of either all the pages or - * the frame in focus. - * @return string Raw unparsed content. - * @access public - */ - function getRaw() { - if (is_integer($this->focus)) { - return $this->frames[$this->focus]->getRaw(); - } - $raw = ''; - for ($i = 0; $i < count($this->frames); $i++) { - $raw .= $this->frames[$i]->getRaw(); - } - return $raw; - } - - /** - * Accessor for plain text of either all the pages or - * the frame in focus. - * @return string Plain text content. - * @access public - */ - function getText() { - if (is_integer($this->focus)) { - return $this->frames[$this->focus]->getText(); - } - $raw = ''; - for ($i = 0; $i < count($this->frames); $i++) { - $raw .= ' ' . $this->frames[$i]->getText(); - } - return trim($raw); - } - - /** - * Accessor for last error. - * @return string Error from last response. - * @access public - */ - function getTransportError() { - if (is_integer($this->focus)) { - return $this->frames[$this->focus]->getTransportError(); - } - return $this->frameset->getTransportError(); - } - - /** - * Request method used to fetch this frame. - * @return string GET, POST or HEAD. - * @access public - */ - function getMethod() { - if (is_integer($this->focus)) { - return $this->frames[$this->focus]->getMethod(); - } - return $this->frameset->getMethod(); - } - - /** - * Original resource name. - * @return SimpleUrl Current url. - * @access public - */ - function getUrl() { - if (is_integer($this->focus)) { - $url = $this->frames[$this->focus]->getUrl(); - $url->setTarget($this->getPublicNameFromIndex($this->focus)); - } else { - $url = $this->frameset->getUrl(); - } - return $url; - } - - /** - * Page base URL. - * @return SimpleUrl Current url. - * @access public - */ - function getBaseUrl() { - if (is_integer($this->focus)) { - $url = $this->frames[$this->focus]->getBaseUrl(); - } else { - $url = $this->frameset->getBaseUrl(); - } - return $url; - } - - /** - * Expands expandomatic URLs into fully qualified - * URLs for the frameset page. - * @param SimpleUrl $url Relative URL. - * @return SimpleUrl Absolute URL. - * @access public - */ - function expandUrl($url) { - return $this->frameset->expandUrl($url); - } - - /** - * Original request data. - * @return mixed Sent content. - * @access public - */ - function getRequestData() { - if (is_integer($this->focus)) { - return $this->frames[$this->focus]->getRequestData(); - } - return $this->frameset->getRequestData(); - } - - /** - * Accessor for current MIME type. - * @return string MIME type as string; e.g. 'text/html' - * @access public - */ - function getMimeType() { - if (is_integer($this->focus)) { - return $this->frames[$this->focus]->getMimeType(); - } - return $this->frameset->getMimeType(); - } - - /** - * Accessor for last response code. - * @return integer Last HTTP response code received. - * @access public - */ - function getResponseCode() { - if (is_integer($this->focus)) { - return $this->frames[$this->focus]->getResponseCode(); - } - return $this->frameset->getResponseCode(); - } - - /** - * Accessor for last Authentication type. Only valid - * straight after a challenge (401). - * @return string Description of challenge type. - * @access public - */ - function getAuthentication() { - if (is_integer($this->focus)) { - return $this->frames[$this->focus]->getAuthentication(); - } - return $this->frameset->getAuthentication(); - } - - /** - * Accessor for last Authentication realm. Only valid - * straight after a challenge (401). - * @return string Name of security realm. - * @access public - */ - function getRealm() { - if (is_integer($this->focus)) { - return $this->frames[$this->focus]->getRealm(); - } - return $this->frameset->getRealm(); - } - - /** - * Accessor for outgoing header information. - * @return string Header block. - * @access public - */ - function getRequest() { - if (is_integer($this->focus)) { - return $this->frames[$this->focus]->getRequest(); - } - return $this->frameset->getRequest(); - } - - /** - * Accessor for raw header information. - * @return string Header block. - * @access public - */ - function getHeaders() { - if (is_integer($this->focus)) { - return $this->frames[$this->focus]->getHeaders(); - } - return $this->frameset->getHeaders(); - } - - /** - * Accessor for parsed title. - * @return string Title or false if no title is present. - * @access public - */ - function getTitle() { - return $this->frameset->getTitle(); - } - - /** - * Accessor for a list of all fixed links. - * @return array List of urls as strings. - * @access public - */ - function getUrls() { - if (is_integer($this->focus)) { - return $this->frames[$this->focus]->getUrls(); - } - $urls = array(); - foreach ($this->frames as $frame) { - $urls = array_merge($urls, $frame->getUrls()); - } - return array_values(array_unique($urls)); - } - - /** - * Accessor for URLs by the link label. Label will match - * regardess of whitespace issues and case. - * @param string $label Text of link. - * @return array List of links with that label. - * @access public - */ - function getUrlsByLabel($label) { - if (is_integer($this->focus)) { - return $this->tagUrlsWithFrame( - $this->frames[$this->focus]->getUrlsByLabel($label), - $this->focus); - } - $urls = array(); - foreach ($this->frames as $index => $frame) { - $urls = array_merge( - $urls, - $this->tagUrlsWithFrame( - $frame->getUrlsByLabel($label), - $index)); - } - return $urls; - } - - /** - * Accessor for a URL by the id attribute. If in a frameset - * then the first link found with that ID attribute is - * returned only. Focus on a frame if you want one from - * a specific part of the frameset. - * @param string $id Id attribute of link. - * @return string URL with that id. - * @access public - */ - function getUrlById($id) { - foreach ($this->frames as $index => $frame) { - if ($url = $frame->getUrlById($id)) { - if (! $url->gettarget()) { - $url->setTarget($this->getPublicNameFromIndex($index)); - } - return $url; - } - } - return false; - } - - /** - * Attaches the intended frame index to a list of URLs. - * @param array $urls List of SimpleUrls. - * @param string $frame Name of frame or index. - * @return array List of tagged URLs. - * @access private - */ - protected function tagUrlsWithFrame($urls, $frame) { - $tagged = array(); - foreach ($urls as $url) { - if (! $url->getTarget()) { - $url->setTarget($this->getPublicNameFromIndex($frame)); - } - $tagged[] = $url; - } - return $tagged; - } - - /** - * Finds a held form by button label. Will only - * search correctly built forms. - * @param SimpleSelector $selector Button finder. - * @return SimpleForm Form object containing - * the button. - * @access public - */ - function getFormBySubmit($selector) { - return $this->findForm('getFormBySubmit', $selector); - } - - /** - * Finds a held form by image using a selector. - * Will only search correctly built forms. The first - * form found either within the focused frame, or - * across frames, will be the one returned. - * @param SimpleSelector $selector Image finder. - * @return SimpleForm Form object containing - * the image. - * @access public - */ - function getFormByImage($selector) { - return $this->findForm('getFormByImage', $selector); - } - - /** - * Finds a held form by the form ID. A way of - * identifying a specific form when we have control - * of the HTML code. The first form found - * either within the focused frame, or across frames, - * will be the one returned. - * @param string $id Form label. - * @return SimpleForm Form object containing the matching ID. - * @access public - */ - function getFormById($id) { - return $this->findForm('getFormById', $id); - } - - /** - * General form finder. Will search all the frames or - * just the one in focus. - * @param string $method Method to use to find in a page. - * @param string $attribute Label, name or ID. - * @return SimpleForm Form object containing the matching ID. - * @access private - */ - protected function findForm($method, $attribute) { - if (is_integer($this->focus)) { - return $this->findFormInFrame( - $this->frames[$this->focus], - $this->focus, - $method, - $attribute); - } - for ($i = 0; $i < count($this->frames); $i++) { - $form = $this->findFormInFrame( - $this->frames[$i], - $i, - $method, - $attribute); - if ($form) { - return $form; - } - } - $null = null; - return $null; - } - - /** - * Finds a form in a page using a form finding method. Will - * also tag the form with the frame name it belongs in. - * @param SimplePage $page Page content of frame. - * @param integer $index Internal frame representation. - * @param string $method Method to use to find in a page. - * @param string $attribute Label, name or ID. - * @return SimpleForm Form object containing the matching ID. - * @access private - */ - protected function findFormInFrame($page, $index, $method, $attribute) { - $form = $this->frames[$index]->$method($attribute); - if (isset($form)) { - $form->setDefaultTarget($this->getPublicNameFromIndex($index)); - } - return $form; - } - - /** - * Sets a field on each form in which the field is - * available. - * @param SimpleSelector $selector Field finder. - * @param string $value Value to set field to. - * @return boolean True if value is valid. - * @access public - */ - function setField($selector, $value) { - if (is_integer($this->focus)) { - $this->frames[$this->focus]->setField($selector, $value); - } else { - for ($i = 0; $i < count($this->frames); $i++) { - $this->frames[$i]->setField($selector, $value); - } - } - } - - /** - * Accessor for a form element value within a page. - * @param SimpleSelector $selector Field finder. - * @return string/boolean A string if the field is - * present, false if unchecked - * and null if missing. - * @access public - */ - function getField($selector) { - for ($i = 0; $i < count($this->frames); $i++) { - $value = $this->frames[$i]->getField($selector); - if (isset($value)) { - return $value; - } - } - return null; - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/http.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/http.php deleted file mode 100644 index 15b555c..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/http.php +++ /dev/null @@ -1,628 +0,0 @@ -url = $url; - } - - /** - * Resource name. - * @return SimpleUrl Current url. - * @access protected - */ - function getUrl() { - return $this->url; - } - - /** - * Creates the first line which is the actual request. - * @param string $method HTTP request method, usually GET. - * @return string Request line content. - * @access protected - */ - protected function getRequestLine($method) { - return $method . ' ' . $this->url->getPath() . - $this->url->getEncodedRequest() . ' HTTP/1.0'; - } - - /** - * Creates the host part of the request. - * @return string Host line content. - * @access protected - */ - protected function getHostLine() { - $line = 'Host: ' . $this->url->getHost(); - if ($this->url->getPort()) { - $line .= ':' . $this->url->getPort(); - } - return $line; - } - - /** - * Opens a socket to the route. - * @param string $method HTTP request method, usually GET. - * @param integer $timeout Connection timeout. - * @return SimpleSocket New socket. - * @access public - */ - function createConnection($method, $timeout) { - $default_port = ('https' == $this->url->getScheme()) ? 443 : 80; - $socket = $this->createSocket( - $this->url->getScheme() ? $this->url->getScheme() : 'http', - $this->url->getHost(), - $this->url->getPort() ? $this->url->getPort() : $default_port, - $timeout); - if (! $socket->isError()) { - $socket->write($this->getRequestLine($method) . "\r\n"); - $socket->write($this->getHostLine() . "\r\n"); - $socket->write("Connection: close\r\n"); - } - return $socket; - } - - /** - * Factory for socket. - * @param string $scheme Protocol to use. - * @param string $host Hostname to connect to. - * @param integer $port Remote port. - * @param integer $timeout Connection timeout. - * @return SimpleSocket/SimpleSecureSocket New socket. - * @access protected - */ - protected function createSocket($scheme, $host, $port, $timeout) { - if (in_array($scheme, array('file'))) { - return new SimpleFileSocket($this->url); - } elseif (in_array($scheme, array('https'))) { - return new SimpleSecureSocket($host, $port, $timeout); - } else { - return new SimpleSocket($host, $port, $timeout); - } - } -} - -/** - * Creates HTTP headers for the end point of - * a HTTP request via a proxy server. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleProxyRoute extends SimpleRoute { - private $proxy; - private $username; - private $password; - - /** - * Stashes the proxy address. - * @param SimpleUrl $url URL as object. - * @param string $proxy Proxy URL. - * @param string $username Username for autentication. - * @param string $password Password for autentication. - * @access public - */ - function __construct($url, $proxy, $username = false, $password = false) { - parent::__construct($url); - $this->proxy = $proxy; - $this->username = $username; - $this->password = $password; - } - - /** - * Creates the first line which is the actual request. - * @param string $method HTTP request method, usually GET. - * @param SimpleUrl $url URL as object. - * @return string Request line content. - * @access protected - */ - function getRequestLine($method) { - $url = $this->getUrl(); - $scheme = $url->getScheme() ? $url->getScheme() : 'http'; - $port = $url->getPort() ? ':' . $url->getPort() : ''; - return $method . ' ' . $scheme . '://' . $url->getHost() . $port . - $url->getPath() . $url->getEncodedRequest() . ' HTTP/1.0'; - } - - /** - * Creates the host part of the request. - * @param SimpleUrl $url URL as object. - * @return string Host line content. - * @access protected - */ - function getHostLine() { - $host = 'Host: ' . $this->proxy->getHost(); - $port = $this->proxy->getPort() ? $this->proxy->getPort() : 8080; - return "$host:$port"; - } - - /** - * Opens a socket to the route. - * @param string $method HTTP request method, usually GET. - * @param integer $timeout Connection timeout. - * @return SimpleSocket New socket. - * @access public - */ - function createConnection($method, $timeout) { - $socket = $this->createSocket( - $this->proxy->getScheme() ? $this->proxy->getScheme() : 'http', - $this->proxy->getHost(), - $this->proxy->getPort() ? $this->proxy->getPort() : 8080, - $timeout); - if ($socket->isError()) { - return $socket; - } - $socket->write($this->getRequestLine($method) . "\r\n"); - $socket->write($this->getHostLine() . "\r\n"); - if ($this->username && $this->password) { - $socket->write('Proxy-Authorization: Basic ' . - base64_encode($this->username . ':' . $this->password) . - "\r\n"); - } - $socket->write("Connection: close\r\n"); - return $socket; - } -} - -/** - * HTTP request for a web page. Factory for - * HttpResponse object. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleHttpRequest { - private $route; - private $encoding; - private $headers; - private $cookies; - - /** - * Builds the socket request from the different pieces. - * These include proxy information, URL, cookies, headers, - * request method and choice of encoding. - * @param SimpleRoute $route Request route. - * @param SimpleFormEncoding $encoding Content to send with - * request. - * @access public - */ - function __construct($route, $encoding) { - $this->route = $route; - $this->encoding = $encoding; - $this->headers = array(); - $this->cookies = array(); - } - - /** - * Dispatches the content to the route's socket. - * @param integer $timeout Connection timeout. - * @return SimpleHttpResponse A response which may only have - * an error, but hopefully has a - * complete web page. - * @access public - */ - function fetch($timeout) { - $socket = $this->route->createConnection($this->encoding->getMethod(), $timeout); - if (! $socket->isError()) { - $this->dispatchRequest($socket, $this->encoding); - } - return $this->createResponse($socket); - } - - /** - * Sends the headers. - * @param SimpleSocket $socket Open socket. - * @param string $method HTTP request method, - * usually GET. - * @param SimpleFormEncoding $encoding Content to send with request. - * @access private - */ - protected function dispatchRequest($socket, $encoding) { - foreach ($this->headers as $header_line) { - $socket->write($header_line . "\r\n"); - } - if (count($this->cookies) > 0) { - $socket->write("Cookie: " . implode(";", $this->cookies) . "\r\n"); - } - $encoding->writeHeadersTo($socket); - $socket->write("\r\n"); - $encoding->writeTo($socket); - } - - /** - * Adds a header line to the request. - * @param string $header_line Text of full header line. - * @access public - */ - function addHeaderLine($header_line) { - $this->headers[] = $header_line; - } - - /** - * Reads all the relevant cookies from the - * cookie jar. - * @param SimpleCookieJar $jar Jar to read - * @param SimpleUrl $url Url to use for scope. - * @access public - */ - function readCookiesFromJar($jar, $url) { - $this->cookies = $jar->selectAsPairs($url); - } - - /** - * Wraps the socket in a response parser. - * @param SimpleSocket $socket Responding socket. - * @return SimpleHttpResponse Parsed response object. - * @access protected - */ - protected function createResponse($socket) { - $response = new SimpleHttpResponse( - $socket, - $this->route->getUrl(), - $this->encoding); - $socket->close(); - return $response; - } -} - -/** - * Collection of header lines in the response. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleHttpHeaders { - private $raw_headers; - private $response_code; - private $http_version; - private $mime_type; - private $location; - private $cookies; - private $authentication; - private $realm; - - /** - * Parses the incoming header block. - * @param string $headers Header block. - * @access public - */ - function __construct($headers) { - $this->raw_headers = $headers; - $this->response_code = false; - $this->http_version = false; - $this->mime_type = ''; - $this->location = false; - $this->cookies = array(); - $this->authentication = false; - $this->realm = false; - foreach (split("\r\n", $headers) as $header_line) { - $this->parseHeaderLine($header_line); - } - } - - /** - * Accessor for parsed HTTP protocol version. - * @return integer HTTP error code. - * @access public - */ - function getHttpVersion() { - return $this->http_version; - } - - /** - * Accessor for raw header block. - * @return string All headers as raw string. - * @access public - */ - function getRaw() { - return $this->raw_headers; - } - - /** - * Accessor for parsed HTTP error code. - * @return integer HTTP error code. - * @access public - */ - function getResponseCode() { - return (integer)$this->response_code; - } - - /** - * Returns the redirected URL or false if - * no redirection. - * @return string URL or false for none. - * @access public - */ - function getLocation() { - return $this->location; - } - - /** - * Test to see if the response is a valid redirect. - * @return boolean True if valid redirect. - * @access public - */ - function isRedirect() { - return in_array($this->response_code, array(301, 302, 303, 307)) && - (boolean)$this->getLocation(); - } - - /** - * Test to see if the response is an authentication - * challenge. - * @return boolean True if challenge. - * @access public - */ - function isChallenge() { - return ($this->response_code == 401) && - (boolean)$this->authentication && - (boolean)$this->realm; - } - - /** - * Accessor for MIME type header information. - * @return string MIME type. - * @access public - */ - function getMimeType() { - return $this->mime_type; - } - - /** - * Accessor for authentication type. - * @return string Type. - * @access public - */ - function getAuthentication() { - return $this->authentication; - } - - /** - * Accessor for security realm. - * @return string Realm. - * @access public - */ - function getRealm() { - return $this->realm; - } - - /** - * Writes new cookies to the cookie jar. - * @param SimpleCookieJar $jar Jar to write to. - * @param SimpleUrl $url Host and path to write under. - * @access public - */ - function writeCookiesToJar($jar, $url) { - foreach ($this->cookies as $cookie) { - $jar->setCookie( - $cookie->getName(), - $cookie->getValue(), - $url->getHost(), - $cookie->getPath(), - $cookie->getExpiry()); - } - } - - /** - * Called on each header line to accumulate the held - * data within the class. - * @param string $header_line One line of header. - * @access protected - */ - protected function parseHeaderLine($header_line) { - if (preg_match('/HTTP\/(\d+\.\d+)\s+(\d+)/i', $header_line, $matches)) { - $this->http_version = $matches[1]; - $this->response_code = $matches[2]; - } - if (preg_match('/Content-type:\s*(.*)/i', $header_line, $matches)) { - $this->mime_type = trim($matches[1]); - } - if (preg_match('/Location:\s*(.*)/i', $header_line, $matches)) { - $this->location = trim($matches[1]); - } - if (preg_match('/Set-cookie:(.*)/i', $header_line, $matches)) { - $this->cookies[] = $this->parseCookie($matches[1]); - } - if (preg_match('/WWW-Authenticate:\s+(\S+)\s+realm=\"(.*?)\"/i', $header_line, $matches)) { - $this->authentication = $matches[1]; - $this->realm = trim($matches[2]); - } - } - - /** - * Parse the Set-cookie content. - * @param string $cookie_line Text after "Set-cookie:" - * @return SimpleCookie New cookie object. - * @access private - */ - protected function parseCookie($cookie_line) { - $parts = split(";", $cookie_line); - $cookie = array(); - preg_match('/\s*(.*?)\s*=(.*)/', array_shift($parts), $cookie); - foreach ($parts as $part) { - if (preg_match('/\s*(.*?)\s*=(.*)/', $part, $matches)) { - $cookie[$matches[1]] = trim($matches[2]); - } - } - return new SimpleCookie( - $cookie[1], - trim($cookie[2]), - isset($cookie["path"]) ? $cookie["path"] : "", - isset($cookie["expires"]) ? $cookie["expires"] : false); - } -} - -/** - * Basic HTTP response. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleHttpResponse extends SimpleStickyError { - private $url; - private $encoding; - private $sent; - private $content; - private $headers; - - /** - * Constructor. Reads and parses the incoming - * content and headers. - * @param SimpleSocket $socket Network connection to fetch - * response text from. - * @param SimpleUrl $url Resource name. - * @param mixed $encoding Record of content sent. - * @access public - */ - function __construct($socket, $url, $encoding) { - parent::__construct(); - $this->url = $url; - $this->encoding = $encoding; - $this->sent = $socket->getSent(); - $this->content = false; - $raw = $this->readAll($socket); - if ($socket->isError()) { - $this->setError('Error reading socket [' . $socket->getError() . ']'); - return; - } - $this->parse($raw); - } - - /** - * Splits up the headers and the rest of the content. - * @param string $raw Content to parse. - * @access private - */ - protected function parse($raw) { - if (! $raw) { - $this->setError('Nothing fetched'); - $this->headers = new SimpleHttpHeaders(''); - } elseif ('file' == $this->url->getScheme()) { - $this->headers = new SimpleHttpHeaders(''); - $this->content = $raw; - } elseif (! strstr($raw, "\r\n\r\n")) { - $this->setError('Could not split headers from content'); - $this->headers = new SimpleHttpHeaders($raw); - } else { - list($headers, $this->content) = split("\r\n\r\n", $raw, 2); - $this->headers = new SimpleHttpHeaders($headers); - } - } - - /** - * Original request method. - * @return string GET, POST or HEAD. - * @access public - */ - function getMethod() { - return $this->encoding->getMethod(); - } - - /** - * Resource name. - * @return SimpleUrl Current url. - * @access public - */ - function getUrl() { - return $this->url; - } - - /** - * Original request data. - * @return mixed Sent content. - * @access public - */ - function getRequestData() { - return $this->encoding; - } - - /** - * Raw request that was sent down the wire. - * @return string Bytes actually sent. - * @access public - */ - function getSent() { - return $this->sent; - } - - /** - * Accessor for the content after the last - * header line. - * @return string All content. - * @access public - */ - function getContent() { - return $this->content; - } - - /** - * Accessor for header block. The response is the - * combination of this and the content. - * @return SimpleHeaders Wrapped header block. - * @access public - */ - function getHeaders() { - return $this->headers; - } - - /** - * Accessor for any new cookies. - * @return array List of new cookies. - * @access public - */ - function getNewCookies() { - return $this->headers->getNewCookies(); - } - - /** - * Reads the whole of the socket output into a - * single string. - * @param SimpleSocket $socket Unread socket. - * @return string Raw output if successful - * else false. - * @access private - */ - protected function readAll($socket) { - $all = ''; - while (! $this->isLastPacket($next = $socket->read())) { - $all .= $next; - } - return $all; - } - - /** - * Test to see if the packet from the socket is the - * last one. - * @param string $packet Chunk to interpret. - * @return boolean True if empty or EOF. - * @access private - */ - protected function isLastPacket($packet) { - if (is_string($packet)) { - return $packet === ''; - } - return ! $packet; - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/invoker.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/invoker.php deleted file mode 100644 index ee31034..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/invoker.php +++ /dev/null @@ -1,139 +0,0 @@ -test_case = $test_case; - } - - /** - * Accessor for test case being run. - * @return SimpleTestCase Test case. - * @access public - */ - function getTestCase() { - return $this->test_case; - } - - /** - * Runs test level set up. Used for changing - * the mechanics of base test cases. - * @param string $method Test method to call. - * @access public - */ - function before($method) { - $this->test_case->before($method); - } - - /** - * Invokes a test method and buffered with setUp() - * and tearDown() calls. - * @param string $method Test method to call. - * @access public - */ - function invoke($method) { - $this->test_case->setUp(); - $this->test_case->$method(); - $this->test_case->tearDown(); - } - - /** - * Runs test level clean up. Used for changing - * the mechanics of base test cases. - * @param string $method Test method to call. - * @access public - */ - function after($method) { - $this->test_case->after($method); - } -} - -/** - * Do nothing decorator. Just passes the invocation - * straight through. - * @package SimpleTest - * @subpackage UnitTester - */ -class SimpleInvokerDecorator { - private $invoker; - - /** - * Stores the invoker to wrap. - * @param SimpleInvoker $invoker Test method runner. - */ - function __construct($invoker) { - $this->invoker = $invoker; - } - - /** - * Accessor for test case being run. - * @return SimpleTestCase Test case. - * @access public - */ - function getTestCase() { - return $this->invoker->getTestCase(); - } - - /** - * Runs test level set up. Used for changing - * the mechanics of base test cases. - * @param string $method Test method to call. - * @access public - */ - function before($method) { - $this->invoker->before($method); - } - - /** - * Invokes a test method and buffered with setUp() - * and tearDown() calls. - * @param string $method Test method to call. - * @access public - */ - function invoke($method) { - $this->invoker->invoke($method); - } - - /** - * Runs test level clean up. Used for changing - * the mechanics of base test cases. - * @param string $method Test method to call. - * @access public - */ - function after($method) { - $this->invoker->after($method); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/mock_objects.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/mock_objects.php deleted file mode 100644 index c3ed38b..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/mock_objects.php +++ /dev/null @@ -1,1630 +0,0 @@ -expected = $expected; - } - - /** - * Tests the assertion. True if correct. - * @param array $parameters Comparison values. - * @return boolean True if correct. - * @access public - */ - function test($parameters) { - if (! is_array($this->expected)) { - return true; - } - if (count($this->expected) != count($parameters)) { - return false; - } - for ($i = 0; $i < count($this->expected); $i++) { - if (! $this->testParameter($parameters[$i], $this->expected[$i])) { - return false; - } - } - return true; - } - - /** - * Tests an individual parameter. - * @param mixed $parameter Value to test. - * @param mixed $expected Comparison value. - * @return boolean True if expectation - * fulfilled. - * @access private - */ - protected function testParameter($parameter, $expected) { - $comparison = $this->coerceToExpectation($expected); - return $comparison->test($parameter); - } - - /** - * Returns a human readable test message. - * @param array $comparison Incoming parameter list. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($parameters) { - if ($this->test($parameters)) { - return "Expectation of " . count($this->expected) . - " arguments of [" . $this->renderArguments($this->expected) . - "] is correct"; - } else { - return $this->describeDifference($this->expected, $parameters); - } - } - - /** - * Message to display if expectation differs from - * the parameters actually received. - * @param array $expected Expected parameters as list. - * @param array $parameters Actual parameters received. - * @return string Description of difference. - * @access private - */ - protected function describeDifference($expected, $parameters) { - if (count($expected) != count($parameters)) { - return "Expected " . count($expected) . - " arguments of [" . $this->renderArguments($expected) . - "] but got " . count($parameters) . - " arguments of [" . $this->renderArguments($parameters) . "]"; - } - $messages = array(); - for ($i = 0; $i < count($expected); $i++) { - $comparison = $this->coerceToExpectation($expected[$i]); - if (! $comparison->test($parameters[$i])) { - $messages[] = "parameter " . ($i + 1) . " with [" . - $comparison->overlayMessage($parameters[$i], $this->getDumper()) . "]"; - } - } - return "Parameter expectation differs at " . implode(" and ", $messages); - } - - /** - * Creates an identical expectation if the - * object/value is not already some type - * of expectation. - * @param mixed $expected Expected value. - * @return SimpleExpectation Expectation object. - * @access private - */ - protected function coerceToExpectation($expected) { - if (SimpleExpectation::isExpectation($expected)) { - return $expected; - } - return new IdenticalExpectation($expected); - } - - /** - * Renders the argument list as a string for - * messages. - * @param array $args Incoming arguments. - * @return string Simple description of type and value. - * @access private - */ - protected function renderArguments($args) { - $descriptions = array(); - if (is_array($args)) { - foreach ($args as $arg) { - $dumper = new SimpleDumper(); - $descriptions[] = $dumper->describeValue($arg); - } - } - return implode(', ', $descriptions); - } -} - -/** - * Confirms that the number of calls on a method is as expected. - * @package SimpleTest - * @subpackage MockObjects - */ -class CallCountExpectation extends SimpleExpectation { - private $method; - private $count; - - /** - * Stashes the method and expected count for later - * reporting. - * @param string $method Name of method to confirm against. - * @param integer $count Expected number of calls. - * @param string $message Custom error message. - */ - function __construct($method, $count, $message = '%s') { - $this->method = $method; - $this->count = $count; - parent::__construct($message); - } - - /** - * Tests the assertion. True if correct. - * @param integer $compare Measured call count. - * @return boolean True if expected. - * @access public - */ - function test($compare) { - return ($this->count == $compare); - } - - /** - * Reports the comparison. - * @param integer $compare Measured call count. - * @return string Message to show. - * @access public - */ - function testMessage($compare) { - return 'Expected call count for [' . $this->method . - '] was [' . $this->count . - '] got [' . $compare . ']'; - } -} - -/** - * Confirms that the number of calls on a method is as expected. - * @package SimpleTest - * @subpackage MockObjects - */ -class MinimumCallCountExpectation extends SimpleExpectation { - private $method; - private $count; - - /** - * Stashes the method and expected count for later - * reporting. - * @param string $method Name of method to confirm against. - * @param integer $count Minimum number of calls. - * @param string $message Custom error message. - */ - function __construct($method, $count, $message = '%s') { - $this->method = $method; - $this->count = $count; - parent::__construct($message); - } - - /** - * Tests the assertion. True if correct. - * @param integer $compare Measured call count. - * @return boolean True if enough. - * @access public - */ - function test($compare) { - return ($this->count <= $compare); - } - - /** - * Reports the comparison. - * @param integer $compare Measured call count. - * @return string Message to show. - * @access public - */ - function testMessage($compare) { - return 'Minimum call count for [' . $this->method . - '] was [' . $this->count . - '] got [' . $compare . ']'; - } -} - -/** - * Confirms that the number of calls on a method is as expected. - * @package SimpleTest - * @subpackage MockObjects - */ -class MaximumCallCountExpectation extends SimpleExpectation { - private $method; - private $count; - - /** - * Stashes the method and expected count for later - * reporting. - * @param string $method Name of method to confirm against. - * @param integer $count Minimum number of calls. - * @param string $message Custom error message. - */ - function __construct($method, $count, $message = '%s') { - $this->method = $method; - $this->count = $count; - parent::__construct($message); - } - - /** - * Tests the assertion. True if correct. - * @param integer $compare Measured call count. - * @return boolean True if not over. - * @access public - */ - function test($compare) { - return ($this->count >= $compare); - } - - /** - * Reports the comparison. - * @param integer $compare Measured call count. - * @return string Message to show. - * @access public - */ - function testMessage($compare) { - return 'Maximum call count for [' . $this->method . - '] was [' . $this->count . - '] got [' . $compare . ']'; - } -} - -/** - * Retrieves method actions by searching the - * parameter lists until an expected match is found. - * @package SimpleTest - * @subpackage MockObjects - */ -class SimpleSignatureMap { - private $map; - - /** - * Creates an empty call map. - * @access public - */ - function __construct() { - $this->map = array(); - } - - /** - * Stashes a reference against a method call. - * @param array $parameters Array of arguments (including wildcards). - * @param mixed $action Reference placed in the map. - * @access public - */ - function add($parameters, $action) { - $place = count($this->map); - $this->map[$place] = array(); - $this->map[$place]['params'] = new ParametersExpectation($parameters); - $this->map[$place]['content'] = $action; - } - - /** - * Searches the call list for a matching parameter - * set. Returned by reference. - * @param array $parameters Parameters to search by - * without wildcards. - * @return object Object held in the first matching - * slot, otherwise null. - * @access public - */ - function &findFirstAction($parameters) { - $slot = $this->findFirstSlot($parameters); - if (isset($slot) && isset($slot['content'])) { - return $slot['content']; - } - $null = null; - return $null; - } - - /** - * Searches the call list for a matching parameter - * set. True if successful. - * @param array $parameters Parameters to search by - * without wildcards. - * @return boolean True if a match is present. - * @access public - */ - function isMatch($parameters) { - return ($this->findFirstSlot($parameters) != null); - } - - /** - * Compares the incoming parameters with the - * internal expectation. Uses the incoming $test - * to dispatch the test message. - * @param SimpleTestCase $test Test to dispatch to. - * @param array $parameters The actual calling arguments. - * @param string $message The message to overlay. - * @access public - */ - function test($test, $parameters, $message) { - } - - /** - * Searches the map for a matching item. - * @param array $parameters Parameters to search by - * without wildcards. - * @return array Reference to slot or null. - * @access private - */ - function &findFirstSlot($parameters) { - $count = count($this->map); - for ($i = 0; $i < $count; $i++) { - if ($this->map[$i]["params"]->test($parameters)) { - return $this->map[$i]; - } - } - $null = null; - return $null; - } -} - -/** - * Allows setting of actions against call signatures either - * at a specific time, or always. Specific time settings - * trump lasting ones, otherwise the most recently added - * will mask an earlier match. - * @package SimpleTest - * @subpackage MockObjects - */ -class SimpleCallSchedule { - private $wildcard = MOCK_ANYTHING; - private $always; - private $at; - - /** - * Sets up an empty response schedule. - * Creates an empty call map. - */ - function __construct() { - $this->always = array(); - $this->at = array(); - } - - /** - * Stores an action against a signature that - * will always fire unless masked by a time - * specific one. - * @param string $method Method name. - * @param array $args Calling parameters. - * @param SimpleAction $action Actually simpleByValue, etc. - * @access public - */ - function register($method, $args, $action) { - $args = $this->replaceWildcards($args); - $method = strtolower($method); - if (! isset($this->always[$method])) { - $this->always[$method] = new SimpleSignatureMap(); - } - $this->always[$method]->add($args, $action); - } - - /** - * Stores an action against a signature that - * will fire at a specific time in the future. - * @param integer $step delay of calls to this method, - * 0 is next. - * @param string $method Method name. - * @param array $args Calling parameters. - * @param SimpleAction $action Actually SimpleByValue, etc. - * @access public - */ - function registerAt($step, $method, $args, $action) { - $args = $this->replaceWildcards($args); - $method = strtolower($method); - if (! isset($this->at[$method])) { - $this->at[$method] = array(); - } - if (! isset($this->at[$method][$step])) { - $this->at[$method][$step] = new SimpleSignatureMap(); - } - $this->at[$method][$step]->add($args, $action); - } - - /** - * Sets up an expectation on the argument list. - * @param string $method Method to test. - * @param array $args Bare arguments or list of - * expectation objects. - * @param string $message Failure message. - */ - function expectArguments($method, $args, $message) { - $args = $this->replaceWildcards($args); - $message .= Mock::getExpectationLine(); - $this->expected_args[strtolower($method)] = - new ParametersExpectation($args, $message); - - } - - /** - * Actually carry out the action stored previously, - * if the parameters match. - * @param integer $step Time of call. - * @param string $method Method name. - * @param array $args The parameters making up the - * rest of the call. - * @return mixed The result of the action. - * @access public. - */ - function &respond($step, $method, $args) { - $method = strtolower($method); - if (isset($this->at[$method][$step])) { - if ($this->at[$method][$step]->isMatch($args)) { - $action = $this->at[$method][$step]->findFirstAction($args); - if (isset($action)) { - return $action->act(); - } - } - } - if (isset($this->always[$method])) { - $action = $this->always[$method]->findFirstAction($args); - if (isset($action)) { - return $action->act(); - } - } - $null = null; - return $null; - } - - /** - * Replaces wildcard matches with wildcard - * expectations in the argument list. - * @param array $args Raw argument list. - * @return array Argument list with - * expectations. - * @access private - */ - protected function replaceWildcards($args) { - if ($args === false) { - return false; - } - for ($i = 0; $i < count($args); $i++) { - if ($args[$i] === $this->wildcard) { - $args[$i] = new AnythingExpectation(); - } - } - return $args; - } -} - -/** - * A type of SimpleMethodAction. - * Stashes a value for returning later. Follows usual - * PHP5 semantics of objects being returned by reference. - * @package SimpleTest - * @subpackage MockObjects - */ -class SimpleReturn { - private $value; - - /** - * Stashes it for later. - * @param mixed $value You need to clone objects - * if you want copy semantics - * for these. - * @access public - */ - function __construct($value) { - $this->value = $value; - } - - /** - * Returns the value stored earlier. - * @return mixed Whatever was stashed. - * @access public - */ - function act() { - return $this->value; - } -} - -/** - * A type of SimpleMethodAction. - * Stashes a reference for returning later. - * @package SimpleTest - * @subpackage MockObjects - */ -class SimpleByReference { - private $reference; - - /** - * Stashes it for later. - * @param mixed $reference Actual PHP4 style reference. - * @access public - */ - function __construct(&$reference) { - $this->reference = &$reference; - } - - /** - * Returns the reference stored earlier. - * @return mixed Whatever was stashed. - * @access public - */ - function &act() { - return $this->reference; - } -} - -/** - * A type of SimpleMethodAction. - * Stashes a value for returning later. - * @package SimpleTest - * @subpackage MockObjects - */ -class SimpleByValue { - private $value; - - /** - * Stashes it for later. - * @param mixed $value You need to clone objects - * if you want copy semantics - * for these. - * @access public - */ - function __construct($value) { - $this->value = $value; - } - - /** - * Returns the value stored earlier. - * @return mixed Whatever was stashed. - * @access public - */ - function &act() { - $dummy = $this->value; - return $dummy; - } -} - -/** - * A type of SimpleMethodAction. - * Stashes an exception for throwing later. - * @package SimpleTest - * @subpackage MockObjects - */ -class SimpleThrower { - private $exception; - - /** - * Stashes it for later. - * @param Exception $exception The exception object to throw. - * @access public - */ - function __construct($exception) { - $this->exception = $exception; - } - - /** - * Throws the exceptins stashed earlier. - * @access public - */ - function act() { - throw $this->exception; - } -} - -/** - * A type of SimpleMethodAction. - * Stashes an error for emitting later. - * @package SimpleTest - * @subpackage MockObjects - */ -class SimpleErrorThrower { - private $error; - private $severity; - - /** - * Stashes an error to throw later. - * @param string $error Error message. - * @param integer $severity PHP error constant, e.g E_USER_ERROR. - * @access public - */ - function __construct($error, $severity) { - $this->error = $error; - $this->severity = $severity; - } - - /** - * Triggers the stashed error. - * @access public - */ - function &act() { - trigger_error($this->error, $this->severity); - $null = null; - return $null; - } -} - -/** - * A base class or delegate that extends an - * empty collection of methods that can have their - * return values set and expectations made of the - * calls upon them. The mock will assert the - * expectations against it's attached test case in - * addition to the server stub behaviour or returning - * preprogrammed responses. - * @package SimpleTest - * @subpackage MockObjects - */ -class SimpleMock { - private $actions; - private $expectations; - private $wildcard = MOCK_ANYTHING; - private $is_strict = true; - private $call_counts; - private $expected_counts; - private $max_counts; - private $expected_args; - private $expected_args_at; - - /** - * Creates an empty action list and expectation list. - * All call counts are set to zero. - * @access public - */ - function SimpleMock() { - $this->actions = new SimpleCallSchedule(); - $this->expectations = new SimpleCallSchedule(); - $this->call_counts = array(); - $this->expected_counts = array(); - $this->max_counts = array(); - $this->expected_args = array(); - $this->expected_args_at = array(); - $this->getCurrentTestCase()->tell($this); - } - - /** - * Disables a name check when setting expectations. - * This hack is needed for the partial mocks. - * @access public - */ - function disableExpectationNameChecks() { - $this->is_strict = false; - } - - /** - * Finds currently running test. - * @return SimpeTestCase Current test case. - * @access protected - */ - protected function getCurrentTestCase() { - return SimpleTest::getContext()->getTest(); - } - - /** - * Die if bad arguments array is passed. - * @param mixed $args The arguments value to be checked. - * @param string $task Description of task attempt. - * @return boolean Valid arguments - * @access private - */ - protected function checkArgumentsIsArray($args, $task) { - if (! is_array($args)) { - trigger_error( - "Cannot $task as \$args parameter is not an array", - E_USER_ERROR); - } - } - - /** - * Triggers a PHP error if the method is not part - * of this object. - * @param string $method Name of method. - * @param string $task Description of task attempt. - * @access protected - */ - protected function dieOnNoMethod($method, $task) { - if ($this->is_strict && ! method_exists($this, $method)) { - trigger_error( - "Cannot $task as no ${method}() in class " . get_class($this), - E_USER_ERROR); - } - } - - /** - * Replaces wildcard matches with wildcard - * expectations in the argument list. - * @param array $args Raw argument list. - * @return array Argument list with - * expectations. - * @access private - */ - function replaceWildcards($args) { - if ($args === false) { - return false; - } - for ($i = 0; $i < count($args); $i++) { - if ($args[$i] === $this->wildcard) { - $args[$i] = new AnythingExpectation(); - } - } - return $args; - } - - /** - * Adds one to the call count of a method. - * @param string $method Method called. - * @param array $args Arguments as an array. - * @access protected - */ - protected function addCall($method, $args) { - if (! isset($this->call_counts[$method])) { - $this->call_counts[$method] = 0; - } - $this->call_counts[$method]++; - } - - /** - * Fetches the call count of a method so far. - * @param string $method Method name called. - * @return integer Number of calls so far. - * @access public - */ - function getCallCount($method) { - $this->dieOnNoMethod($method, "get call count"); - $method = strtolower($method); - if (! isset($this->call_counts[$method])) { - return 0; - } - return $this->call_counts[$method]; - } - - /** - * Sets a return for a parameter list that will - * be passed on by all calls to this method that match. - * @param string $method Method name. - * @param mixed $value Result of call by value/handle. - * @param array $args List of parameters to match - * including wildcards. - * @access public - */ - function returns($method, $value, $args = false) { - $this->dieOnNoMethod($method, "set return"); - $this->actions->register($method, $args, new SimpleReturn($value)); - } - - /** - * Sets a return for a parameter list that will - * be passed only when the required call count - * is reached. - * @param integer $timing Number of calls in the future - * to which the result applies. If - * not set then all calls will return - * the value. - * @param string $method Method name. - * @param mixed $value Result of call passed. - * @param array $args List of parameters to match - * including wildcards. - * @access public - */ - function returnsAt($timing, $method, $value, $args = false) { - $this->dieOnNoMethod($method, "set return value sequence"); - $this->actions->registerAt($timing, $method, $args, new SimpleReturn($value)); - } - - /** - * Sets a return for a parameter list that will - * be passed by value for all calls to this method. - * @param string $method Method name. - * @param mixed $value Result of call passed by value. - * @param array $args List of parameters to match - * including wildcards. - * @access public - */ - function setReturnValue($method, $value, $args = false) { - $this->dieOnNoMethod($method, "set return value"); - $this->actions->register($method, $args, new SimpleByValue($value)); - } - - /** - * Sets a return for a parameter list that will - * be passed by value only when the required call count - * is reached. - * @param integer $timing Number of calls in the future - * to which the result applies. If - * not set then all calls will return - * the value. - * @param string $method Method name. - * @param mixed $value Result of call passed by value. - * @param array $args List of parameters to match - * including wildcards. - * @access public - */ - function setReturnValueAt($timing, $method, $value, $args = false) { - $this->dieOnNoMethod($method, "set return value sequence"); - $this->actions->registerAt($timing, $method, $args, new SimpleByValue($value)); - } - - /** - * Sets a return for a parameter list that will - * be passed by reference for all calls. - * @param string $method Method name. - * @param mixed $reference Result of the call will be this object. - * @param array $args List of parameters to match - * including wildcards. - * @access public - */ - function setReturnReference($method, &$reference, $args = false) { - $this->dieOnNoMethod($method, "set return reference"); - $this->actions->register($method, $args, new SimpleByReference($reference)); - } - - /** - * Sets a return for a parameter list that will - * be passed by value only when the required call count - * is reached. - * @param integer $timing Number of calls in the future - * to which the result applies. If - * not set then all calls will return - * the value. - * @param string $method Method name. - * @param mixed $reference Result of the call will be this object. - * @param array $args List of parameters to match - * including wildcards. - * @access public - */ - function setReturnReferenceAt($timing, $method, &$reference, $args = false) { - $this->dieOnNoMethod($method, "set return reference sequence"); - $this->actions->registerAt($timing, $method, $args, new SimpleByReference($reference)); - } - - /** - * Sets up an expected call with a set of - * expected parameters in that call. All - * calls will be compared to these expectations - * regardless of when the call is made. - * @param string $method Method call to test. - * @param array $args Expected parameters for the call - * including wildcards. - * @param string $message Overridden message. - * @access public - */ - function expect($method, $args, $message = '%s') { - $this->dieOnNoMethod($method, 'set expected arguments'); - $this->checkArgumentsIsArray($args, 'set expected arguments'); - $this->expectations->expectArguments($method, $args, $message); - $args = $this->replaceWildcards($args); - $message .= Mock::getExpectationLine(); - $this->expected_args[strtolower($method)] = - new ParametersExpectation($args, $message); - } - - /** - * Sets up an expected call with a set of - * expected parameters in that call. The - * expected call count will be adjusted if it - * is set too low to reach this call. - * @param integer $timing Number of calls in the future at - * which to test. Next call is 0. - * @param string $method Method call to test. - * @param array $args Expected parameters for the call - * including wildcards. - * @param string $message Overridden message. - * @access public - */ - function expectAt($timing, $method, $args, $message = '%s') { - $this->dieOnNoMethod($method, 'set expected arguments at time'); - $this->checkArgumentsIsArray($args, 'set expected arguments at time'); - $args = $this->replaceWildcards($args); - if (! isset($this->expected_args_at[$timing])) { - $this->expected_args_at[$timing] = array(); - } - $method = strtolower($method); - $message .= Mock::getExpectationLine(); - $this->expected_args_at[$timing][$method] = - new ParametersExpectation($args, $message); - } - - /** - * Sets an expectation for the number of times - * a method will be called. The tally method - * is used to check this. - * @param string $method Method call to test. - * @param integer $count Number of times it should - * have been called at tally. - * @param string $message Overridden message. - * @access public - */ - function expectCallCount($method, $count, $message = '%s') { - $this->dieOnNoMethod($method, 'set expected call count'); - $message .= Mock::getExpectationLine(); - $this->expected_counts[strtolower($method)] = - new CallCountExpectation($method, $count, $message); - } - - /** - * Sets the number of times a method may be called - * before a test failure is triggered. - * @param string $method Method call to test. - * @param integer $count Most number of times it should - * have been called. - * @param string $message Overridden message. - * @access public - */ - function expectMaximumCallCount($method, $count, $message = '%s') { - $this->dieOnNoMethod($method, 'set maximum call count'); - $message .= Mock::getExpectationLine(); - $this->max_counts[strtolower($method)] = - new MaximumCallCountExpectation($method, $count, $message); - } - - /** - * Sets the number of times to call a method to prevent - * a failure on the tally. - * @param string $method Method call to test. - * @param integer $count Least number of times it should - * have been called. - * @param string $message Overridden message. - * @access public - */ - function expectMinimumCallCount($method, $count, $message = '%s') { - $this->dieOnNoMethod($method, 'set minimum call count'); - $message .= Mock::getExpectationLine(); - $this->expected_counts[strtolower($method)] = - new MinimumCallCountExpectation($method, $count, $message); - } - - /** - * Convenience method for barring a method - * call. - * @param string $method Method call to ban. - * @param string $message Overridden message. - * @access public - */ - function expectNever($method, $message = '%s') { - $this->expectMaximumCallCount($method, 0, $message); - } - - /** - * Convenience method for a single method - * call. - * @param string $method Method call to track. - * @param array $args Expected argument list or - * false for any arguments. - * @param string $message Overridden message. - * @access public - */ - function expectOnce($method, $args = false, $message = '%s') { - $this->expectCallCount($method, 1, $message); - if ($args !== false) { - $this->expect($method, $args, $message); - } - } - - /** - * Convenience method for requiring a method - * call. - * @param string $method Method call to track. - * @param array $args Expected argument list or - * false for any arguments. - * @param string $message Overridden message. - * @access public - */ - function expectAtLeastOnce($method, $args = false, $message = '%s') { - $this->expectMinimumCallCount($method, 1, $message); - if ($args !== false) { - $this->expect($method, $args, $message); - } - } - - /** - * Sets up a trigger to throw an exception upon the - * method call. - * @param string $method Method name to throw on. - */ - function throwOn($method, $exception = false, $args = false) { - $this->dieOnNoMethod($method, "throw on"); - $this->actions->register($method, $args, - new SimpleThrower($exception ? $exception : new Exception())); - } - - /** - * Sets up a trigger to throw an exception upon the - * method call. - */ - function throwAt($timing, $method, $exception = false, $args = false) { - $this->dieOnNoMethod($method, "throw at"); - $this->actions->registerAt($timing, $method, $args, - new SimpleThrower($exception ? $exception : new Exception())); - } - - /** - * Sets up a trigger to throw an error upon the - * method call. - */ - function errorOn($method, $error = 'A mock error', $args = false, $severity = E_USER_ERROR) { - $this->dieOnNoMethod($method, "error on"); - $this->actions->register($method, $args, new SimpleErrorThrower($error, $severity)); - } - - /** - * Sets up a trigger to throw an error upon the - * method call. - */ - function errorAt($timing, $method, $error = 'A mock error', $args = false, $severity = E_USER_ERROR) { - $this->dieOnNoMethod($method, "error at"); - $this->actions->registerAt($timing, $method, $args, new SimpleErrorThrower($error, $severity)); - } - - /** - * Receives event from unit test that the current - * test method has finished. Totals up the call - * counts and triggers a test assertion if a test - * is present for expected call counts. - * @param string $test_method Current method name. - * @param SimpleTestCase $test Test to send message to. - * @access public - */ - function atTestEnd($test_method, &$test) { - foreach ($this->expected_counts as $method => $expectation) { - $test->assert($expectation, $this->getCallCount($method)); - } - foreach ($this->max_counts as $method => $expectation) { - if ($expectation->test($this->getCallCount($method))) { - $test->assert($expectation, $this->getCallCount($method)); - } - } - } - - /** - * Returns the expected value for the method name - * and checks expectations. Will generate any - * test assertions as a result of expectations - * if there is a test present. - * @param string $method Name of method to simulate. - * @param array $args Arguments as an array. - * @return mixed Stored return. - * @access private - */ - function &invoke($method, $args) { - $method = strtolower($method); - $step = $this->getCallCount($method); - $this->addCall($method, $args); - $this->checkExpectations($method, $args, $step); - $was = $this->disableEStrict(); - try { - $result = &$this->emulateCall($method, $args, $step); - } catch (Exception $e) { - $this->restoreEStrict($was); - throw $e; - } - $this->restoreEStrict($was); - return $result; - } - - /** - * Finds the return value matching the incoming - * arguments. If there is no matching value found - * then an error is triggered. - * @param string $method Method name. - * @param array $args Calling arguments. - * @param integer $step Current position in the - * call history. - * @return mixed Stored return or other action. - * @access protected - */ - protected function &emulateCall($method, $args, $step) { - return $this->actions->respond($step, $method, $args); - } - - /** - * Tests the arguments against expectations. - * @param string $method Method to check. - * @param array $args Argument list to match. - * @param integer $timing The position of this call - * in the call history. - * @access private - */ - protected function checkExpectations($method, $args, $timing) { - $test = $this->getCurrentTestCase(); - if (isset($this->max_counts[$method])) { - if (! $this->max_counts[$method]->test($timing + 1)) { - $test->assert($this->max_counts[$method], $timing + 1); - } - } - if (isset($this->expected_args_at[$timing][$method])) { - $test->assert( - $this->expected_args_at[$timing][$method], - $args, - "Mock method [$method] at [$timing] -> %s"); - } elseif (isset($this->expected_args[$method])) { - $test->assert( - $this->expected_args[$method], - $args, - "Mock method [$method] -> %s"); - } - } - - private function disableEStrict() { - $was = error_reporting(); - error_reporting($was & ~E_STRICT); - return $was; - } - - private function restoreEStrict($was) { - error_reporting($was); - } -} - -/** - * Static methods only service class for code generation of - * mock objects. - * @package SimpleTest - * @subpackage MockObjects - */ -class Mock { - - /** - * Factory for mock object classes. - * @access public - */ - function __construct() { - trigger_error('Mock factory methods are static.'); - } - - /** - * Clones a class' interface and creates a mock version - * that can have return values and expectations set. - * @param string $class Class to clone. - * @param string $mock_class New class name. Default is - * the old name with "Mock" - * prepended. - * @param array $methods Additional methods to add beyond - * those in the cloned class. Use this - * to emulate the dynamic addition of - * methods in the cloned class or when - * the class hasn't been written yet.sta - * @access public - */ - static function generate($class, $mock_class = false, $methods = false) { - $generator = new MockGenerator($class, $mock_class); - return @$generator->generateSubclass($methods); - } - - /** - * Generates a version of a class with selected - * methods mocked only. Inherits the old class - * and chains the mock methods of an aggregated - * mock object. - * @param string $class Class to clone. - * @param string $mock_class New class name. - * @param array $methods Methods to be overridden - * with mock versions. - * @access public - */ - static function generatePartial($class, $mock_class, $methods) { - $generator = new MockGenerator($class, $mock_class); - return @$generator->generatePartial($methods); - } - - /** - * Uses a stack trace to find the line of an assertion. - * @access public - */ - static function getExpectationLine() { - $trace = new SimpleStackTrace(array('expect')); - return $trace->traceMethod(); - } -} - -/** - * Service class for code generation of mock objects. - * @package SimpleTest - * @subpackage MockObjects - */ -class MockGenerator { - private $class; - private $mock_class; - private $mock_base; - private $reflection; - - /** - * Builds initial reflection object. - * @param string $class Class to be mocked. - * @param string $mock_class New class with identical interface, - * but no behaviour. - */ - function __construct($class, $mock_class) { - $this->class = $class; - $this->mock_class = $mock_class; - if (! $this->mock_class) { - $this->mock_class = 'Mock' . $this->class; - } - $this->mock_base = SimpleTest::getMockBaseClass(); - $this->reflection = new SimpleReflection($this->class); - } - - /** - * Clones a class' interface and creates a mock version - * that can have return values and expectations set. - * @param array $methods Additional methods to add beyond - * those in th cloned class. Use this - * to emulate the dynamic addition of - * methods in the cloned class or when - * the class hasn't been written yet. - * @access public - */ - function generate($methods) { - if (! $this->reflection->classOrInterfaceExists()) { - return false; - } - $mock_reflection = new SimpleReflection($this->mock_class); - if ($mock_reflection->classExistsSansAutoload()) { - return false; - } - $code = $this->createClassCode($methods ? $methods : array()); - return eval("$code return \$code;"); - } - - /** - * Subclasses a class and overrides every method with a mock one - * that can have return values and expectations set. Chains - * to an aggregated SimpleMock. - * @param array $methods Additional methods to add beyond - * those in the cloned class. Use this - * to emulate the dynamic addition of - * methods in the cloned class or when - * the class hasn't been written yet. - * @access public - */ - function generateSubclass($methods) { - if (! $this->reflection->classOrInterfaceExists()) { - return false; - } - $mock_reflection = new SimpleReflection($this->mock_class); - if ($mock_reflection->classExistsSansAutoload()) { - return false; - } - if ($this->reflection->isInterface() || $this->reflection->hasFinal()) { - $code = $this->createClassCode($methods ? $methods : array()); - return eval("$code return \$code;"); - } else { - $code = $this->createSubclassCode($methods ? $methods : array()); - return eval("$code return \$code;"); - } - } - - /** - * Generates a version of a class with selected - * methods mocked only. Inherits the old class - * and chains the mock methods of an aggregated - * mock object. - * @param array $methods Methods to be overridden - * with mock versions. - * @access public - */ - function generatePartial($methods) { - if (! $this->reflection->classExists($this->class)) { - return false; - } - $mock_reflection = new SimpleReflection($this->mock_class); - if ($mock_reflection->classExistsSansAutoload()) { - trigger_error('Partial mock class [' . $this->mock_class . '] already exists'); - return false; - } - $code = $this->extendClassCode($methods); - return eval("$code return \$code;"); - } - - /** - * The new mock class code as a string. - * @param array $methods Additional methods. - * @return string Code for new mock class. - * @access private - */ - protected function createClassCode($methods) { - $implements = ''; - $interfaces = $this->reflection->getInterfaces(); - if (function_exists('spl_classes')) { - $interfaces = array_diff($interfaces, array('Traversable')); - } - if (count($interfaces) > 0) { - $implements = 'implements ' . implode(', ', $interfaces); - } - $code = "class " . $this->mock_class . " extends " . $this->mock_base . " $implements {\n"; - $code .= " function " . $this->mock_class . "() {\n"; - $code .= " \$this->" . $this->mock_base . "();\n"; - $code .= " }\n"; - if (in_array('__construct', $this->reflection->getMethods())) { - $code .= " function __construct() {\n"; - $code .= " \$this->" . $this->mock_base . "();\n"; - $code .= " }\n"; - } - $code .= $this->createHandlerCode($methods); - $code .= "}\n"; - return $code; - } - - /** - * The new mock class code as a string. The mock will - * be a subclass of the original mocked class. - * @param array $methods Additional methods. - * @return string Code for new mock class. - * @access private - */ - protected function createSubclassCode($methods) { - $code = "class " . $this->mock_class . " extends " . $this->class . " {\n"; - $code .= " public \$mock;\n"; - $code .= $this->addMethodList(array_merge($methods, $this->reflection->getMethods())); - $code .= "\n"; - $code .= " function " . $this->mock_class . "() {\n"; - $code .= " \$this->mock = new " . $this->mock_base . "();\n"; - $code .= " \$this->mock->disableExpectationNameChecks();\n"; - $code .= " }\n"; - $code .= $this->chainMockReturns(); - $code .= $this->chainMockExpectations(); - $code .= $this->chainThrowMethods(); - $code .= $this->overrideMethods($this->reflection->getMethods()); - $code .= $this->createNewMethodCode($methods); - $code .= "}\n"; - return $code; - } - - /** - * The extension class code as a string. The class - * composites a mock object and chains mocked methods - * to it. - * @param array $methods Mocked methods. - * @return string Code for a new class. - * @access private - */ - protected function extendClassCode($methods) { - $code = "class " . $this->mock_class . " extends " . $this->class . " {\n"; - $code .= " protected \$mock;\n"; - $code .= $this->addMethodList($methods); - $code .= "\n"; - $code .= " function " . $this->mock_class . "() {\n"; - $code .= " \$this->mock = new " . $this->mock_base . "();\n"; - $code .= " \$this->mock->disableExpectationNameChecks();\n"; - $code .= " }\n"; - $code .= $this->chainMockReturns(); - $code .= $this->chainMockExpectations(); - $code .= $this->chainThrowMethods(); - $code .= $this->overrideMethods($methods); - $code .= "}\n"; - return $code; - } - - /** - * Creates code within a class to generate replaced - * methods. All methods call the invoke() handler - * with the method name and the arguments in an - * array. - * @param array $methods Additional methods. - * @access private - */ - protected function createHandlerCode($methods) { - $code = ''; - $methods = array_merge($methods, $this->reflection->getMethods()); - foreach ($methods as $method) { - if ($this->isConstructor($method)) { - continue; - } - $mock_reflection = new SimpleReflection($this->mock_base); - if (in_array($method, $mock_reflection->getMethods())) { - continue; - } - $code .= " " . $this->reflection->getSignature($method) . " {\n"; - $code .= " \$args = func_get_args();\n"; - $code .= " \$result = &\$this->invoke(\"$method\", \$args);\n"; - $code .= " return \$result;\n"; - $code .= " }\n"; - } - return $code; - } - - /** - * Creates code within a class to generate a new - * methods. All methods call the invoke() handler - * on the internal mock with the method name and - * the arguments in an array. - * @param array $methods Additional methods. - * @access private - */ - protected function createNewMethodCode($methods) { - $code = ''; - foreach ($methods as $method) { - if ($this->isConstructor($method)) { - continue; - } - $mock_reflection = new SimpleReflection($this->mock_base); - if (in_array($method, $mock_reflection->getMethods())) { - continue; - } - $code .= " " . $this->reflection->getSignature($method) . " {\n"; - $code .= " \$args = func_get_args();\n"; - $code .= " \$result = &\$this->mock->invoke(\"$method\", \$args);\n"; - $code .= " return \$result;\n"; - $code .= " }\n"; - } - return $code; - } - - /** - * Tests to see if a special PHP method is about to - * be stubbed by mistake. - * @param string $method Method name. - * @return boolean True if special. - * @access private - */ - protected function isConstructor($method) { - return in_array( - strtolower($method), - array('__construct', '__destruct')); - } - - /** - * Creates a list of mocked methods for error checking. - * @param array $methods Mocked methods. - * @return string Code for a method list. - * @access private - */ - protected function addMethodList($methods) { - return " protected \$mocked_methods = array('" . - implode("', '", array_map('strtolower', $methods)) . - "');\n"; - } - - /** - * Creates code to abandon the expectation if not mocked. - * @param string $alias Parameter name of method name. - * @return string Code for bail out. - * @access private - */ - protected function bailOutIfNotMocked($alias) { - $code = " if (! in_array(strtolower($alias), \$this->mocked_methods)) {\n"; - $code .= " trigger_error(\"Method [$alias] is not mocked\");\n"; - $code .= " \$null = null;\n"; - $code .= " return \$null;\n"; - $code .= " }\n"; - return $code; - } - - /** - * Creates source code for chaining to the composited - * mock object. - * @return string Code for mock set up. - * @access private - */ - protected function chainMockReturns() { - $code = " function returns(\$method, \$value, \$args = false) {\n"; - $code .= $this->bailOutIfNotMocked("\$method"); - $code .= " \$this->mock->returns(\$method, \$value, \$args);\n"; - $code .= " }\n"; - $code .= " function returnsAt(\$timing, \$method, \$value, \$args = false) {\n"; - $code .= $this->bailOutIfNotMocked("\$method"); - $code .= " \$this->mock->returnsAt(\$timing, \$method, \$value, \$args);\n"; - $code .= " }\n"; - $code .= " function setReturnValue(\$method, \$value, \$args = false) {\n"; - $code .= $this->bailOutIfNotMocked("\$method"); - $code .= " \$this->mock->setReturnValue(\$method, \$value, \$args);\n"; - $code .= " }\n"; - $code .= " function setReturnValueAt(\$timing, \$method, \$value, \$args = false) {\n"; - $code .= $this->bailOutIfNotMocked("\$method"); - $code .= " \$this->mock->setReturnValueAt(\$timing, \$method, \$value, \$args);\n"; - $code .= " }\n"; - $code .= " function setReturnReference(\$method, &\$ref, \$args = false) {\n"; - $code .= $this->bailOutIfNotMocked("\$method"); - $code .= " \$this->mock->setReturnReference(\$method, \$ref, \$args);\n"; - $code .= " }\n"; - $code .= " function setReturnReferenceAt(\$timing, \$method, &\$ref, \$args = false) {\n"; - $code .= $this->bailOutIfNotMocked("\$method"); - $code .= " \$this->mock->setReturnReferenceAt(\$timing, \$method, \$ref, \$args);\n"; - $code .= " }\n"; - return $code; - } - - /** - * Creates source code for chaining to an aggregated - * mock object. - * @return string Code for expectations. - * @access private - */ - protected function chainMockExpectations() { - $code = " function expect(\$method, \$args = false, \$msg = '%s') {\n"; - $code .= $this->bailOutIfNotMocked("\$method"); - $code .= " \$this->mock->expect(\$method, \$args, \$msg);\n"; - $code .= " }\n"; - $code .= " function expectAt(\$timing, \$method, \$args = false, \$msg = '%s') {\n"; - $code .= $this->bailOutIfNotMocked("\$method"); - $code .= " \$this->mock->expectAt(\$timing, \$method, \$args, \$msg);\n"; - $code .= " }\n"; - $code .= " function expectCallCount(\$method, \$count) {\n"; - $code .= $this->bailOutIfNotMocked("\$method"); - $code .= " \$this->mock->expectCallCount(\$method, \$count, \$msg = '%s');\n"; - $code .= " }\n"; - $code .= " function expectMaximumCallCount(\$method, \$count, \$msg = '%s') {\n"; - $code .= $this->bailOutIfNotMocked("\$method"); - $code .= " \$this->mock->expectMaximumCallCount(\$method, \$count, \$msg = '%s');\n"; - $code .= " }\n"; - $code .= " function expectMinimumCallCount(\$method, \$count, \$msg = '%s') {\n"; - $code .= $this->bailOutIfNotMocked("\$method"); - $code .= " \$this->mock->expectMinimumCallCount(\$method, \$count, \$msg = '%s');\n"; - $code .= " }\n"; - $code .= " function expectNever(\$method) {\n"; - $code .= $this->bailOutIfNotMocked("\$method"); - $code .= " \$this->mock->expectNever(\$method);\n"; - $code .= " }\n"; - $code .= " function expectOnce(\$method, \$args = false, \$msg = '%s') {\n"; - $code .= $this->bailOutIfNotMocked("\$method"); - $code .= " \$this->mock->expectOnce(\$method, \$args, \$msg);\n"; - $code .= " }\n"; - $code .= " function expectAtLeastOnce(\$method, \$args = false, \$msg = '%s') {\n"; - $code .= $this->bailOutIfNotMocked("\$method"); - $code .= " \$this->mock->expectAtLeastOnce(\$method, \$args, \$msg);\n"; - $code .= " }\n"; - return $code; - } - - /** - * Adds code for chaining the throw methods. - * @return string Code for chains. - * @access private - */ - protected function chainThrowMethods() { - $code = " function throwOn(\$method, \$exception = false, \$args = false) {\n"; - $code .= $this->bailOutIfNotMocked("\$method"); - $code .= " \$this->mock->throwOn(\$method, \$exception, \$args);\n"; - $code .= " }\n"; - $code .= " function throwAt(\$timing, \$method, \$exception = false, \$args = false) {\n"; - $code .= $this->bailOutIfNotMocked("\$method"); - $code .= " \$this->mock->throwAt(\$timing, \$method, \$exception, \$args);\n"; - $code .= " }\n"; - $code .= " function errorOn(\$method, \$error = 'A mock error', \$args = false, \$severity = E_USER_ERROR) {\n"; - $code .= $this->bailOutIfNotMocked("\$method"); - $code .= " \$this->mock->errorOn(\$method, \$error, \$args, \$severity);\n"; - $code .= " }\n"; - $code .= " function errorAt(\$timing, \$method, \$error = 'A mock error', \$args = false, \$severity = E_USER_ERROR) {\n"; - $code .= $this->bailOutIfNotMocked("\$method"); - $code .= " \$this->mock->errorAt(\$timing, \$method, \$error, \$args, \$severity);\n"; - $code .= " }\n"; - return $code; - } - - /** - * Creates source code to override a list of methods - * with mock versions. - * @param array $methods Methods to be overridden - * with mock versions. - * @return string Code for overridden chains. - * @access private - */ - protected function overrideMethods($methods) { - $code = ""; - foreach ($methods as $method) { - if ($this->isConstructor($method)) { - continue; - } - $code .= " " . $this->reflection->getSignature($method) . " {\n"; - $code .= " \$args = func_get_args();\n"; - $code .= " \$result = &\$this->mock->invoke(\"$method\", \$args);\n"; - $code .= " return \$result;\n"; - $code .= " }\n"; - } - return $code; - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/README b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/README deleted file mode 100644 index 3cf668e..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/README +++ /dev/null @@ -1,26 +0,0 @@ -HOW TO MAKE A PACKAGE - -1. First make sure PEAR_PackageFileManager is installed; -(version 1.2.0 was used) - -$ pear install PEAR_PackageFileManager - -2. Edit the simpletest/packages/pear_package_create.php file (see comments for what -needs changing). - -3. Run the simpletest/packages/pear_package_create.php script, piping the output -to the file you want to create e.g.; - -$ ./pear_package_create.php > package.xml - -4. Copy the package.xml to the root of Simpletest. - -5. From the root of Simpletest type; - -$ pear package package.xml - -This creates the package zip - -6. Install with; - -$ pear install SimpleTest-x.x.x.tgz \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/build_tarball.sh b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/build_tarball.sh deleted file mode 100644 index 943a347..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/build_tarball.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/sh - -# Builds project release. -# -cd ../.. - -NAME=simpletest_`cat simpletest/VERSION`.tar.gz -FILES=(simpletest/README \ - simpletest/VERSION \ - simpletest/LICENSE \ - simpletest/HELP_MY_TESTS_DONT_WORK_ANYMORE \ - simpletest/authentication.php \ - simpletest/autorun.php \ - simpletest/browser.php \ - simpletest/collector.php \ - simpletest/compatibility.php \ - simpletest/cookies.php \ - simpletest/default_reporter.php \ - simpletest/detached.php \ - simpletest/dumper.php \ - simpletest/eclipse.php \ - simpletest/encoding.php \ - simpletest/errors.php \ - simpletest/exceptions.php \ - simpletest/expectation.php \ - simpletest/form.php \ - simpletest/frames.php \ - simpletest/http.php \ - simpletest/invoker.php \ - simpletest/mock_objects.php \ - simpletest/page.php \ - simpletest/parser.php \ - simpletest/reflection_php4.php \ - simpletest/reflection_php5.php \ - simpletest/remote.php \ - simpletest/reporter.php \ - simpletest/scorer.php \ - simpletest/selector.php \ - simpletest/shell_tester.php \ - simpletest/simpletest.php \ - simpletest/socket.php \ - simpletest/tag.php \ - simpletest/test_case.php \ - simpletest/unit_tester.php \ - simpletest/url.php \ - simpletest/user_agent.php \ - simpletest/web_tester.php \ - simpletest/xml.php \ - simpletest/extensions/pear_test_case.php \ - simpletest/extensions/phpunit_test_case.php \ - simpletest/extensions/testdox.php \ - simpletest/extensions/testdox/test.php \ - simpletest/test/acceptance_test.php \ - simpletest/test/adapter_test.php \ - simpletest/test/all_tests.php \ - simpletest/test/authentication_test.php \ - simpletest/test/bad_test_suite.php \ - simpletest/test/browser_test.php \ - simpletest/test/collector_test.php \ - simpletest/test/command_line_test.php \ - simpletest/test/compatibility_test.php \ - simpletest/test/cookies_test.php \ - simpletest/test/detached_test.php \ - simpletest/test/dumper_test.php \ - simpletest/test/eclipse_test.php \ - simpletest/test/encoding_test.php \ - simpletest/test/errors_test.php \ - simpletest/test/exceptions_test.php \ - simpletest/test/expectation_test.php \ - simpletest/test/form_test.php \ - simpletest/test/frames_test.php \ - simpletest/test/http_test.php \ - simpletest/test/interfaces_test.php \ - simpletest/test/live_test.php \ - simpletest/test/mock_objects_test.php \ - simpletest/test/page_test.php \ - simpletest/test/parse_error_test.php \ - simpletest/test/parser_test.php \ - simpletest/test/reflection_php4_test.php \ - simpletest/test/reflection_php5_test.php \ - simpletest/test/remote_test.php \ - simpletest/test/shell_test.php \ - simpletest/test/shell_tester_test.php \ - simpletest/test/simpletest_test.php \ - simpletest/test/socket_test.php \ - simpletest/test/tag_test.php \ - simpletest/test/test_with_parse_error.php \ - simpletest/test/unit_tests.php \ - simpletest/test/unit_tester_test.php \ - simpletest/test/autorun_test.php \ - simpletest/test/url_test.php \ - simpletest/test/user_agent_test.php \ - simpletest/test/visual_test.php \ - simpletest/test/web_tester_test.php \ - simpletest/test/xml_test.php \ - simpletest/test/support/collector/collectable.1 \ - simpletest/test/support/collector/collectable.2 \ - simpletest/test/support/upload_sample.txt \ - simpletest/test/support/supplementary_upload_sample.txt \ - simpletest/test/support/latin1_sample \ - simpletest/test/support/spl_examples.php \ - simpletest/test/support/empty_test_file.php \ - simpletest/test/support/test1.php \ - simpletest/docs/en/docs.css \ - simpletest/docs/en/index.html \ - simpletest/docs/en/overview.html \ - simpletest/docs/en/unit_test_documentation.html \ - simpletest/docs/en/group_test_documentation.html \ - simpletest/docs/en/mock_objects_documentation.html \ - simpletest/docs/en/partial_mocks_documentation.html \ - simpletest/docs/en/reporter_documentation.html \ - simpletest/docs/en/expectation_documentation.html \ - simpletest/docs/en/web_tester_documentation.html \ - simpletest/docs/en/form_testing_documentation.html \ - simpletest/docs/en/authentication_documentation.html \ - simpletest/docs/en/browser_documentation.html \ - simpletest/docs/fr/docs.css \ - simpletest/docs/fr/index.html \ - simpletest/docs/fr/overview.html \ - simpletest/docs/fr/unit_test_documentation.html \ - simpletest/docs/fr/group_test_documentation.html \ - simpletest/docs/fr/server_stubs_documentation.html \ - simpletest/docs/fr/mock_objects_documentation.html \ - simpletest/docs/fr/partial_mocks_documentation.html \ - simpletest/docs/fr/reporter_documentation.html \ - simpletest/docs/fr/expectation_documentation.html \ - simpletest/docs/fr/web_tester_documentation.html \ - simpletest/docs/fr/form_testing_documentation.html \ - simpletest/docs/fr/authentication_documentation.html \ - simpletest/docs/fr/browser_documentation.html) - -tar -zcf $NAME ${FILES[*]} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/bundled_docs.xslt b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/bundled_docs.xslt deleted file mode 100644 index c194611..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/bundled_docs.xslt +++ /dev/null @@ -1,246 +0,0 @@ - - - - - - - - - - - - - - - - - <xsl:value-of select="//long_title"/> - - - - - - - - - -
- -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
( pages) -
-
-
- - -

-
- - - This page... -
    - -
-
- - - References and related information... -
    - -
-
- - - - - - -
-            
-                
-            
-        
-
- - - - - - - - -
-            
-                
-            
-        
-
- - -
-            
-                
-            
-        
-
- - -
-            
-        
-
- - -

- - - - -

- -
- - - - - - - - - - - - - - - - .html - - - - - - - - - - - - - - - - -
  • -
    - - - - - - - - - - - - - - - - -
    \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/bundled_map.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/bundled_map.xml deleted file mode 100644 index b5b950f..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/bundled_map.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/extension.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/extension.xml deleted file mode 100644 index a897ab1..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/extension.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - Name of the extension to build - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/generate_package.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/generate_package.php deleted file mode 100644 index dd433db..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/generate_package.php +++ /dev/null @@ -1,54 +0,0 @@ - 'svn', - 'simpleoutput' => true, - 'baseinstalldir' => 'simpletest', - 'packagedirectory' => dirname(__FILE__) . '/../', - 'clearcontents' => true, - 'ignore' => array('TODO.xml', 'VERSION', 'docs/', 'tutorials/', 'packages/', '.svn'), - 'dir_roles' => array( - 'test' => 'test' - ) -); - -$packagexml = PEAR_PackageFileManager2::importOptions($packagefile, $options); -$packagexml->setPackageType('php'); -$packagexml->setPackage('simpletest'); -$packagexml->setSummary('PHP Unit Tester'); -$packagexml->setDescription("Unit testing, mock objects and web testing framework for PHP"); - -// update this! do we have a default channel server? -$packagexml->setChannel('pear.php.net'); -$packagexml->setUri('http://os.coretxt.net.nz/simpletest-1.1'); - -$notes = file_get_contents(dirname(__FILE__).'/../README'); -$packagexml->setNotes($notes); - -$packagexml->setPhpDep('5.0.5'); -$packagexml->setPearinstallerDep('1.4.0'); -$packagexml->addPackageDepWithChannel('required', 'PEAR', 'pear.php.net', '1.4.0'); -$packagexml->addMaintainer('lead', 'lastcraft', 'Marcus Baker', 'marcus@lastcraft.com'); -$packagexml->setLicense('LGPL', 'http://www.gnu.org/licenses/lgpl-2.1.html'); - -preg_match("/([0-9\.]+)([a-z]+)/", file_get_contents(dirname(__FILE__).'/../VERSION'), $version); -$packagexml->setAPIVersion($version[1]); -$packagexml->setReleaseVersion($version[1]); -$packagexml->setReleaseStability($version[2]); -$packagexml->setAPIStability($version[2]); - -$packagexml->addRelease(); -$packagexml->generateContents(); - - -if (isset($_GET['make']) || (isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make')) { - $packagexml->writePackageFile(); -} else { - $packagexml->debugPackageFile(); -} - -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/lastcraft.xslt b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/lastcraft.xslt deleted file mode 100644 index e655b7d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/lastcraft.xslt +++ /dev/null @@ -1,302 +0,0 @@ - - - - - - - - - - - - - - - - - <xsl:value-of select="//long_title"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - -
    - - -
    - - LastCraft Home Page - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - -
    • - - - - -
    • -
      -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    ( pages) -
    -
    -
    - - -
    -
    -

    -
    - -
    -
    - -
    -
    -
    -
    - - - This page... -
      - -
    -
    - - - Related... -
      - -
    -
    - - - - - - -
    -            
    -                
    -            
    -        
    -
    - - - - - - - - -
    -            
    -                
    -            
    -        
    -
    - - -
    -            
    -        
    -
    - - -

    - - -

    - -

    - -
    - - - - - - -

    - News: - -

    -
    - - - - - - - - - .php - - - - - - - - - - - - - - - - -
  • -
    - - - - - - - - - - - - - - - - -
    \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/make_bundled_docs.sh b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/make_bundled_docs.sh deleted file mode 100644 index 6245ff4..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/make_bundled_docs.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -xsltproc bundled_docs.xslt ../docs/source/en/simple_test.xml > ../docs/en/index.html -xsltproc bundled_docs.xslt ../docs/source/en/overview.xml > ../docs/en/overview.html -xsltproc bundled_docs.xslt ../docs/source/en/unit_test_documentation.xml > ../docs/en/unit_test_documentation.html -xsltproc bundled_docs.xslt ../docs/source/en/group_test_documentation.xml > ../docs/en/group_test_documentation.html -xsltproc bundled_docs.xslt ../docs/source/en/mock_objects_documentation.xml > ../docs/en/mock_objects_documentation.html -xsltproc bundled_docs.xslt ../docs/source/en/partial_mocks_documentation.xml > ../docs/en/partial_mocks_documentation.html -xsltproc bundled_docs.xslt ../docs/source/en/reporter_documentation.xml > ../docs/en/reporter_documentation.html -xsltproc bundled_docs.xslt ../docs/source/en/expectation_documentation.xml > ../docs/en/expectation_documentation.html -xsltproc bundled_docs.xslt ../docs/source/en/web_tester_documentation.xml > ../docs/en/web_tester_documentation.html -xsltproc bundled_docs.xslt ../docs/source/en/form_testing_documentation.xml > ../docs/en/form_testing_documentation.html -xsltproc bundled_docs.xslt ../docs/source/en/authentication_documentation.xml > ../docs/en/authentication_documentation.html -xsltproc bundled_docs.xslt ../docs/source/en/browser_documentation.xml > ../docs/en/browser_documentation.html -xsltproc bundled_docs.xslt ../docs/source/fr/simple_test.xml > ../docs/fr/index.html -xsltproc bundled_docs.xslt ../docs/source/fr/overview.xml > ../docs/fr/overview.html -xsltproc bundled_docs.xslt ../docs/source/fr/unit_test_documentation.xml > ../docs/fr/unit_test_documentation.html -xsltproc bundled_docs.xslt ../docs/source/fr/group_test_documentation.xml > ../docs/fr/group_test_documentation.html -xsltproc bundled_docs.xslt ../docs/source/fr/mock_objects_documentation.xml > ../docs/fr/mock_objects_documentation.html -xsltproc bundled_docs.xslt ../docs/source/fr/partial_mocks_documentation.xml > ../docs/fr/partial_mocks_documentation.html -xsltproc bundled_docs.xslt ../docs/source/fr/reporter_documentation.xml > ../docs/fr/reporter_documentation.html -xsltproc bundled_docs.xslt ../docs/source/fr/expectation_documentation.xml > ../docs/fr/expectation_documentation.html -xsltproc bundled_docs.xslt ../docs/source/fr/web_tester_documentation.xml > ../docs/fr/web_tester_documentation.html -xsltproc bundled_docs.xslt ../docs/source/fr/form_testing_documentation.xml > ../docs/fr/form_testing_documentation.html -xsltproc bundled_docs.xslt ../docs/source/fr/authentication_documentation.xml > ../docs/fr/authentication_documentation.html -xsltproc bundled_docs.xslt ../docs/source/fr/browser_documentation.xml > ../docs/fr/browser_documentation.html diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/make_bundled_docs_with_xalan.sh b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/make_bundled_docs_with_xalan.sh deleted file mode 100644 index cfc6de3..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/make_bundled_docs_with_xalan.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -Xalan -o ../docs/en/index.html ../docs/source/en/simple_test.xml bundled_docs.xslt -Xalan -o ../docs/en/overview.html ../docs/source/en/overview.xml bundled_docs.xslt -Xalan -o ../docs/en/unit_test_documentation.html ../docs/source/en/unit_test_documentation.xml bundled_docs.xslt -Xalan -o ../docs/en/group_test_documentation.html ../docs/source/en/group_test_documentation.xml bundled_docs.xslt -Xalan -o ../docs/en/mock_objects_documentation.html ../docs/source/en/mock_objects_documentation.xml bundled_docs.xslt -Xalan -o ../docs/en/partial_mocks_documentation.html ../docs/source/en/partial_mocks_documentation.xml bundled_docs.xslt -Xalan -o ../docs/en/reporter_documentation.html ../docs/source/en/reporter_documentation.xml bundled_docs.xslt -Xalan -o ../docs/en/expectation_documentation.html ../docs/source/en/expectation_documentation.xml bundled_docs.xslt -Xalan -o ../docs/en/web_tester_documentation.html ../docs/source/en/web_tester_documentation.xml bundled_docs.xslt -Xalan -o ../docs/en/form_testing_documentation.html ../docs/source/en/form_testing_documentation.xml bundled_docs.xslt -Xalan -o ../docs/en/authentication_documentation.html ../docs/source/en/authentication_documentation.xml bundled_docs.xslt -Xalan -o ../docs/en/browser_documentation.html ../docs/source/en/browser_documentation.xml bundled_docs.xslt -Xalan -o ../docs/fr/index.html ../docs/source/fr/simple_test.xml bundled_docs.xslt -Xalan -o ../docs/fr/overview.html ../docs/source/fr/overview.xml bundled_docs.xslt -Xalan -o ../docs/fr/unit_test_documentation.html ../docs/source/fr/unit_test_documentation.xml bundled_docs.xslt -Xalan -o ../docs/fr/group_test_documentation.html ../docs/source/fr/group_test_documentation.xml bundled_docs.xslt -Xalan -o ../docs/fr/server_stubs_documentation.html ../docs/source/fr/server_stubs_documentation.xml bundled_docs.xslt -Xalan -o ../docs/fr/mock_objects_documentation.html ../docs/source/fr/mock_objects_documentation.xml bundled_docs.xslt -Xalan -o ../docs/fr/partial_mocks_documentation.html ../docs/source/fr/partial_mocks_documentation.xml bundled_docs.xslt -Xalan -o ../docs/fr/reporter_documentation.html ../docs/source/fr/reporter_documentation.xml bundled_docs.xslt -Xalan -o ../docs/fr/expectation_documentation.html ../docs/source/fr/expectation_documentation.xml bundled_docs.xslt -Xalan -o ../docs/fr/web_tester_documentation.html ../docs/source/fr/web_tester_documentation.xml bundled_docs.xslt -Xalan -o ../docs/fr/form_testing_documentation.html ../docs/source/fr/form_testing_documentation.xml bundled_docs.xslt -Xalan -o ../docs/fr/authentication_documentation.html ../docs/source/fr/authentication_documentation.xml bundled_docs.xslt -Xalan -o ../docs/fr/browser_documentation.html ../docs/source/fr/browser_documentation.xml bundled_docs.xslt diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/make_lastcraft_docs.sh b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/make_lastcraft_docs.sh deleted file mode 100644 index 0eaf742..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/make_lastcraft_docs.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -php transform_all_lastcraft.php lastcraft.xslt ../docs/source/en/ ../docs/lastcraft/ diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/make_phpdoc_docs.sh b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/make_phpdoc_docs.sh deleted file mode 100644 index fd56f33..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/make_phpdoc_docs.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -#DEST_DIR=../docs/pkg -if [ ! -d ../tutorials ] -then - mkdir ../tutorials -fi -if [ ! -d ../tutorials/SimpleTest ] -then - mkdir ../tutorials/SimpleTest -fi -DEST_DIR=../tutorials/SimpleTest - -rm ${DEST_DIR}/*.pkg -cp ../docs/pkg/SimpleTest.pkg.ini ${DEST_DIR} - -#Xalan -o ${DEST_DIR}/QuickStart.pkg ../docs/source/en/simple_test.xml phpdoc_docs.xslt -Xalan -o ${DEST_DIR}/SimpleTest.pkg ../docs/source/en/overview.xml phpdoc_docs.xslt -Xalan -o ${DEST_DIR}/UnitTestCase.pkg ../docs/source/en/unit_test_documentation.xml phpdoc_docs.xslt -Xalan -o ${DEST_DIR}/GroupTests.pkg ../docs/source/en/group_test_documentation.xml phpdoc_docs.xslt -Xalan -o ${DEST_DIR}/MockObjects.pkg ../docs/source/en/mock_objects_documentation.xml phpdoc_docs.xslt -Xalan -o ${DEST_DIR}/PartialMock.pkg ../docs/source/en/partial_mocks_documentation.xml phpdoc_docs.xslt -Xalan -o ${DEST_DIR}/Reporting.pkg ../docs/source/en/reporter_documentation.xml phpdoc_docs.xslt -Xalan -o ${DEST_DIR}/Expectations.pkg ../docs/source/en/expectation_documentation.xml phpdoc_docs.xslt -Xalan -o ${DEST_DIR}/WebTester.pkg ../docs/source/en/web_tester_documentation.xml phpdoc_docs.xslt -Xalan -o ${DEST_DIR}/FormTesting.pkg ../docs/source/en/form_testing_documentation.xml phpdoc_docs.xslt -Xalan -o ${DEST_DIR}/Authentication.pkg ../docs/source/en/authentication_documentation.xml phpdoc_docs.xslt -Xalan -o ${DEST_DIR}/Browser.pkg ../docs/source/en/browser_documentation.xml phpdoc_docs.xslt - -# some cleanup work -cd $DEST_DIR - -# remove XML declaration -for f in $(ls *.pkg --color=none) -do - grep -v -e '^ tmp.pkg - mv tmp.pkg $f -done - -# fix overview title -cat SimpleTest.pkg | sed -e 's/Overview/Simple Test PHP Unit Test Framework/g;s/<\([A-Za-z0-9]*\)\/>/<\1><\/\1>/g' > tmp.pkg -mv tmp.pkg SimpleTest.pkg diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/onpk/map_onpk.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/onpk/map_onpk.xml deleted file mode 100644 index b4f6b41..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/onpk/map_onpk.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/onpk/onpk.xslt b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/onpk/onpk.xslt deleted file mode 100644 index 2053066..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/onpk/onpk.xslt +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - - - - - - - - - - - - - - <xsl:value-of select="//long_title"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - - - -
    - - - - - - - - - - - - - - - - - - - - - -
      - -
    • - - - -
    • -
      -
    -
    -
    - - - - - - - - - - - - -
    - -

    -
    - -
    -
    -
    - - - Cette page... -
      - -
    -
    - - - Pour aller plus loin... -
      - -
    -
    - - -
    - -
    -
    - - - - - - - - - - - - - - -
    -			
    -				
    -			
    -		
    -
    - - - - - - - - -

    - - -

    - -

    - -
    - - - - - - - - - - - - - .php - - - - - - - - - - - - - - - - -
  • -
    - - - - - - - - - - - - - - - - -
    \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/onpk/transform_all_onpk.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/onpk/transform_all_onpk.php deleted file mode 100644 index c80350a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/onpk/transform_all_onpk.php +++ /dev/null @@ -1,32 +0,0 @@ -"; - } else { - echo "erreur pour ".$destination." : ".xslt_error($xh)."
    "; - } - - xslt_free($xsltProcessor); -} -closedir($dir); -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/package.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/package.xml deleted file mode 100644 index f82c599..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/package.xml +++ /dev/null @@ -1,710 +0,0 @@ - - - - SimpleTest - Unit testing, mock objects and web testing framework for PHP. - The heart of SimpleTest is a testing framework built around test case classes. -These are written as extensions of base test case classes, each extended with -methods that actually contain test code. Top level test scripts then invoke -the run() methods on every one of these test cases in order. Each test -method is written to invoke various assertions that the developer expects to -be true such as assertEqual(). If the expectation is correct, then a -successful result is dispatched to the observing test reporter, but any -failure triggers an alert and a description of the mismatch. - -These tools are designed for the developer. Tests are written in the PHP -language itself more or less as the application itself is built. The advantage -of using PHP itself as the testing language is that there are no new languages -to learn, testing can start straight away, and the developer can test any part -of the code. Basically, all parts that can be accessed by the application code -can also be accessed by the test code if they are in the same language. - - - lastcraft - Marcus Baker - marcus@lastcraft.com - lead - - - jsweat - Jason Sweat - jsweat_php@yahoo.com - helper - - - hfuecks - Harry Fuecks - hfuecks@phppatterns.com - helper - - - - 0.9.4 - 2004-02-20 - The Open Group Test Suite License - beta - This is the final version of the PHP unit and web testing tool before the -stable release 1.0 version. It features many improvements to the HTML form -parsing and exposure of the underlying web browser. There are also numerous -minor improvements and bug fixes. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.9.4 - 2004-02-20 - The Open Group Test Suite License - beta - This is the final version of the PHP unit and web testing tool before the -stable release 1.0 version. It features many improvements to the HTML form -parsing and exposure of the underlying web browser. There are also numerous -minor improvements and bug fixes. - - - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/pear_package_create.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/pear_package_create.php deleted file mode 100644 index 2b5b7ff..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/pear_package_create.php +++ /dev/null @@ -1,170 +0,0 @@ -#!/usr/bin/env php -q -'lastcraft','role'=>'lead','name'=>'Marcus Baker', 'email'=>'marcus@lastcraft.com'), - array ('handle'=>'jsweat','role'=>'helper','name'=>'Jason Sweat', 'email'=>'jsweat_php@yahoo.com'), - array ('handle'=>'hfuecks','role'=>'helper','name'=>'Harry Fuecks', 'email'=>'hfuecks@phppatterns.com'), -); -/*---------------------------------------------------------------------------*/ - -/** -* Code starts here -*/ -require_once('PEAR/PackageFileManager.php'); -$PPFM = new PEAR_PackageFileManager; - -if (version_compare(phpversion(), '4.3.0', '<') || - php_sapi_name() == 'cgi') { - define('STDOUT', fopen('php://stdout', 'w')); - define('STDERR', fopen('php://stderr', 'w')); - register_shutdown_function( - create_function('', 'fclose(STDOUT); fclose(STDERR); return true;')); -} - -/** -* A giant array to configure the PackageFileManager. For the "roles" see -* http://pear.php.net/manual/en/developers.packagedef.php -*/ -$options = array( - 'baseinstalldir' => 'simpletest', - 'version' => $version, - 'packagedirectory' => $packagedir, - 'outputdirectory' => $packagedir, - 'pathtopackagefile' => $packagedir, - 'state' => $state, - 'summary' => $shortDesc, - 'description' => $longDesc, - 'filelistgenerator' => 'file', - 'notes' => $releaseNotes, - 'package' => 'SimpleTest', - 'license' => 'The Open Group Test Suite License', - - 'dir_roles' => array( - 'docs' => 'doc', - 'test' => 'test', - 'extensions' => 'php', - //'tutorials' => 'doc', - //'tutorials/SimpleTest' => 'doc', - //'ui' => 'php', - //'ui/css' => 'data', - //'ui/img' => 'data', - //'ui/js' => 'data', - //'ui/js/tests' => 'test', - ), - 'exceptions' => - array( - 'HELP_MY_TESTS_DONT_WORK_ANYMORE' => 'doc', - 'LICENSE' => 'doc', - 'README' => 'doc', - 'TODO' => 'doc', - 'VERSION' => 'doc', - ), - 'ignore' => - array( - "$packagedir/packages", - "$packagedir/ui", - ), - ); - -$status = $PPFM->setOptions($options); - -if (PEAR::isError($status)) { - fwrite (STDERR,$status->getMessage()); - exit; -} - -foreach ( $maintainers as $maintainer ) { - $PPFM->addMaintainer( - $maintainer['handle'], - $maintainer['role'], - $maintainer['name'], - $maintainer['email'] ); -} - -// Adds a dependency of PHP 4.2.3+ -$status = $PPFM->addDependency('php', '4.2.3', 'ge', 'php'); -if (PEAR::isError($status)) { - fwrite (STDERR,$status->getMessage()); - exit; -} - -// hack (apparently) -$PPFM->addRole('tpl', 'php'); -$PPFM->addRole('png', 'php'); -$PPFM->addRole('gif', 'php'); -$PPFM->addRole('jpg', 'php'); -$PPFM->addRole('css', 'php'); -$PPFM->addRole('js', 'php'); -$PPFM->addRole('ini', 'php'); -$PPFM->addRole('inc', 'php'); -$PPFM->addRole('afm', 'php'); -$PPFM->addRole('pkg', 'doc'); -$PPFM->addRole('cls', 'doc'); -$PPFM->addRole('proc', 'doc'); -$PPFM->addRole('sh', 'script'); - -ob_start(); -$status = $PPFM->writePackageFile(false); -$output = ob_get_contents(); -ob_end_clean(); - -// Hacks to handle PPFM output -$start = strpos ($output,"getMessage()); -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/phpdoc_docs.xslt b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/phpdoc_docs.xslt deleted file mode 100644 index 6d09150..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/phpdoc_docs.xslt +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - <![CDATA[ - - - - ]]> - - - - - - - - - - - {@id } - <xsl:value-of select="@title"/> - - - - - - - - - - - - <xsl:value-of select="h2"/> - - - - - - - - - .html - - - - } - - - - - - - - - - - - - - - - - - - - - - - - -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.ini b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.ini deleted file mode 100644 index 8767680..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.ini +++ /dev/null @@ -1,92 +0,0 @@ -;; phpDocumentor parse configuration file -;; -;; This file is designed to cut down on repetitive typing on the command-line or web interface -;; You can copy this file to create a number of configuration files that can be used with the -;; command-line switch -c, as in phpdoc -c default.ini or phpdoc -c myini.ini. The web -;; interface will automatically generate a list of .ini files that can be used. -;; -;; default.ini is used to generate the online manual at http://www.phpdoc.org/docs -;; -;; ALL .ini files must be in the user subdirectory of phpDocumentor with an extension of .ini -;; -;; Copyright 2002, Greg Beaver -;; -;; WARNING: do not change the name of any command-line parameters, phpDocumentor will ignore them - -[Parse Data] -;; title of all the documentation -;; legal values: any string -title = SimpleTest API Documentation - -;; parse files that start with a . like .bash_profile -;; legal values: true, false -hidden = false - -;; show elements marked @access private in documentation by setting this to on -;; legal values: on, off -parseprivate = off - -;; parse with javadoc-like description (first sentence is always the short description) -;; legal values: on, off -javadocdesc = off - -;; add any custom @tags separated by commas here -;; legal values: any legal tagname separated by commas. -;customtags = mytag1,mytag2 - -;; This is only used by the XML:DocBook/peardoc2 converter -defaultcategoryname = Documentation - -;; what is the main package? -;; legal values: alphanumeric string plus - and _ -defaultpackagename = SimpleTest - -;; output any parsing information? set to on for cron jobs -;; legal values: on -;quiet = on - -;; parse a PEAR-style repository. Do not turn this on if your project does -;; not have a parent directory named "pear" -;; legal values: on/off -;pear = on - -;; where should the documentation be written? -;; legal values: a legal path -target = /home/groups/s/si/simpletest/htdocs/api - -;; limit output to the specified packages, even if others are parsed -;; legal values: package names separated by commas -;packageoutput = package1,package2 - -;; comma-separated list of files to parse -;; legal values: paths separated by commas -;filename = /path/to/file1,/path/to/file2,fileincurrentdirectory - -;; comma-separated list of directories to parse -;; legal values: directory paths separated by commas -;directory = /path1,/path2,.,..,subdirectory -;directory = /home/jeichorn/cvs/pear -directory = /home/groups/s/si/simpletest/simpletest_doc_target - -;; template base directory (the equivalent directory of /phpDocumentor) -;templatebase = /path/to/my/templates - -;; comma-separated list of files, directories or wildcards ? and * (any wildcard) to ignore -;; legal values: any wildcard strings separated by commas -;ignore = /path/to/ignore*,*list.php,myfile.php,subdirectory/ -;ignore = templates_c/,*HTML/default/*,spec/ -ignore = docs/,packages/,test/ - -;; comma-separated list of Converters to use in outputformat:Convertername:templatedirectory format -;; legal values: HTML:frames:default,HTML:frames:l0l33t,HTML:frames:phpdoc.de,HTML:frames:phphtmllib, -;; HTML:frames:earthli, -;; HTML:frames:DOM/default,HTML:frames:DOM/l0l33t,HTML:frames:DOM/phpdoc.de, -;; HTML:frames:DOM/phphtmllib,HTML:frames:DOM/earthli -;; HTML:Smarty:default,HTML:Smarty:PHP,HTML:Smarty:HandS -;; PDF:default:default,CHM:default:default,XML:DocBook/peardoc2:default -;output=HTML:frames:earthli,HTML:frames:default,HTML:frames:l0l33t,HTML:frames:phpdoc.de,HTML:frames:phphtmllib,HTML:frames:DOM/default,HTML:frames:DOM/l0l33t,HTML:frames:DOM/phpdoc.de,HTML:frames:DOM/earthli,HTML:frames:DOM/phphtmllib,HTML:frames:phpedit,HTML:Smarty:default,HTML:Smarty:PHP,HTML:Smarty:HandS,CHM:default:default,PDF:default:default -output=HTML:frames:DOM/earthlisf - -;; turn this option on if you want highlighted source code for every file -;; legal values: on/off -sourcecode = off diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/index.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/index.php deleted file mode 100644 index 9c8a6e6..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/index.php +++ /dev/null @@ -1,54 +0,0 @@ -destination(dirname(__FILE__).'/map.xml'); - - if (!empty($destination)) { - $page = file_get_contents(dirname(__FILE__).'/template.html'); - - $page = str_replace('KEYWORDS', $source->keywords(), $page); - $page = str_replace('TITLE', $source->title(), $page); - $page = str_replace('CONTENT', $source->content(), $page); - $page = str_replace('INTERNAL', $source->internal(), $page); - $page = str_replace('EXTERNAL', $source->external(), $page); - - $links = $source->links(dirname(__FILE__).'/map.xml'); - foreach ($links as $category => $link) { - $page = str_replace("LINKS_".strtoupper($category), $link, $page); - } - - $destination_dir = dirname($destination_path.$destination); - if (!is_dir($destination_dir)) { - mkdir($destination_dir); - } - - $ok = file_put_contents($destination_path.$destination, $page); - touch($destination_path.$destination, filemtime($source_path.$language.$file)); - - if ($ok) { - $result = "OK"; - } else { - $result = "KO"; - } - - $synchronisation = new PackagingSynchronisation($source_path.$language.$file); - $result .= " ".$synchronisation->result(); - - echo $destination_path.$destination." : ".$result."\n"; - } - } - } - closedir($dir); -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/integration.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/integration.php deleted file mode 100644 index e4c5881..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/integration.php +++ /dev/null @@ -1,41 +0,0 @@ -updateTestLogs($cli_directory, $test); - -$working_copy = dirname(__FILE__)."/working-copies/simpletest"; -$binary = "svn"; -$integration->updateSvnLog($working_copy, $binary); - -class SimpleIntegration { - public $target_directory; - - function __construct($target_directory="") { - $this->target_directory = $target_directory; - } - - function updateTestLogs($cli_directory, $test_file) { - foreach(new DirectoryIterator($cli_directory) as $node) { - if ($node->isDir() and !$node->isDot()) { - $bin = $node->getPathname()."/bin/php"; - $result = shell_exec($bin." ".$test_file); - - $result_file = $this->target_directory."/simpletest.".$node->getFilename().".log"; - file_put_contents($result_file, $result); - } - } - } - - function updateSvnLog($working_copy, $binary="svn") { - $start = date("Y-m-d", strtotime('-1year')); - $command = $binary." log --xml --revision {".$start."}:HEAD ".$working_copy." > ".$this->target_directory."/svn.xml"; - return exec($command); - } -} - -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/map.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/map.xml deleted file mode 100644 index 78cb933..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/map.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/package.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/package.php deleted file mode 100644 index f266625..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/package.php +++ /dev/null @@ -1,440 +0,0 @@ -xpath('//page'); - return $titles[0]->attributes()->title; - } - - function transform_code($code) { - $code = str_replace('', '', $code); - $code = str_replace('<strong>', '', $code); - $code = str_replace('</strong>', '', $code); - $code = str_replace('&', '&', $code); - - return $code; - } - - function content() { - $content = $this->introduction(); - $sections = $this->xpath('//section'); - if (count($sections) > 0) { - $content .= $this->content_with_sections(); - } else { - $content .= $this->content_without_sections(); - } - $content = preg_replace("/href=\"([a-z_]*)\.php\"/", "href=\"\\1.html\"", $content); - - return $content; - } - - function introduction() { - $content = ""; - - $introductions = $this->xpath('//introduction'); - foreach ($introductions as $introduction) { - foreach ($introduction as $element) { - $content .= $this->deal_with_php_code($element->asXML()); - } - } - - return $content; - } - - function content_without_sections() { - $content_without_sections = ""; - $contents = $this->xpath('//content'); - foreach ($contents as $content) { - $content_without_sections .= $this->deal_with_php_code($content->asXML()); - } - - return $content_without_sections; - } - - function deal_with_php_code($content) { - $elements_divided = preg_split('/|<\/php>/', $content); - $content_element = ''; - - if (count($elements_divided) > 1) { - foreach ($elements_divided as $element_divided) { - if (strpos($element_divided, '
    '.$this->transform_code($element_divided).'

    '; - } - $content_element .= $element_divided; - } - } else { - $content_element .= $content; - } - - return $content_element; - } - - function as_title($name) { - return ucfirst(str_replace("-", " ", $name)); - } - - function as_tracker_link($number) { - return "".$number.""; - } - - function content_with_sections() { - $content = ""; - $sections = $this->xpath('//section'); - $anchors = array(); - foreach ($sections as $section) { - if (!isset($anchors[(string)$section->attributes()->name])) { - $content .= "attributes()->name."\">"; - $anchors[(string)$section->attributes()->name] = true; - } - $content .= "

    ".(string)$section->attributes()->title."

    "; - foreach ($section->p as $paragraph) { - $content .= $this->deal_with_php_code($paragraph->asXML()); - } - $content .= $this->deal_with_milestones($section); - $content .= $this->deal_with_changelogs($section); - } - - return $content; - } - - function deal_with_changelogs($section) { - $content = ""; - - foreach ($section->changelog as $changelog) { - $content .= "

    Version ".(string)$changelog->attributes()->version."

    "; - $content .= "
      "; - foreach ($changelog->change as $change) { - $content .= "
    • "; - $content .= trim((string)$change); - $content .= "
    • "; - } - foreach ($changelog->bug as $bug) { - $content .= "
    • "; - $number = ""; - if (isset($bug->attributes()->tracker)) { - $number = " ".$this->as_tracker_link($bug->attributes()->tracker); - } - $content .= "[bug".$number."] ".trim((string)$bug); - $content .= "
    • "; - } - foreach ($changelog->patch as $patch) { - $content .= "
    • "; - $number = ""; - if (isset($patch->attributes()->tracker)) { - $number = " ".$this->as_tracker_link($patch->attributes()->tracker); - } - $content .= "[patch".$number."] ".trim((string)$patch); - $content .= "
    • "; - } - $content .= "
    "; - } - return $content; - } - - function deal_with_milestones($section) { - $content = ""; - - foreach ($section->milestone as $milestone) { - $content .= "

    ".(string)$milestone->attributes()->version."

    "; - foreach ($milestone->concern as $concern) { - if (!isset($anchors[(string)$concern->attributes()->name])) { - $content .= "attributes()->name."\">"; - $anchors[(string)$concern->attributes()->name] = true; - } - $content .= "

    ".$this->as_title($concern->attributes()->name)."

    "; - if (sizeof($concern) > 0) { - $content .= "
    "; - foreach ($concern as $type => $element) { - $status = ""; - if (isset($element->attributes()->status)) { - $status = " class=\"".$element->attributes()->status."\""; - } - $content .= "[".$type."] ".trim($element).""; - foreach ($element->attributes() as $name => $value) { - if ($name == "tracker" and $type == "bug") { - $value = $this->as_tracker_link($value); - } - $content .= "
    ".$name." : ".$value."
    "; - } - foreach ($element->note as $note) { - $content .= "
    ".trim((string)$note)."
    "; - } - } - $content .= "
    "; - } - } - } - - return $content; - } - - function internal() { - $internal = ""; - - if (isset($this->internal->link)) { - foreach ($this->internal->link as $link) { - $internal .= "
    ".$link->asXML()."
    "; - } - } - - return $internal; - } - - function external() { - $external = ""; - - if (isset($this->external->link)) { - foreach ($this->external->link as $link) { - $external .= "
    ".$link->asXML()."
    "; - } - } - - return $external; - } - - function keywords() { - return trim(preg_replace('/(\s+)/', ' ', $this->meta->keywords)); - } - - function here() { - $here = $this->xpath('@here'); - return (string)$here[0]; - } - - function parent($map) { - $here = $this->here(); - $pages = $map->xpath('//page[normalize-space(@here)="'.$here.'"]/parent::*'); - return $pages[0]->attributes()->here; - } - - function destination($path_to_map) { - $destination = ''; - $here = $this->here(); - - $map = simplexml_load_file($path_to_map); - $pages = $map->xpath('//page'); - $i = 0; - foreach ($pages as $page) { - $i++; - if ((string)$page->attributes()->here == $here) { - $destination = (string)$page->attributes()->file; - break; - } - } - return $destination; - } - - function url($file) { - $segments = explode("/", $file); - - return array_pop($segments); - } - - function links_from_xpath($xpath, $map) { - $link = ""; - - $here = $this->here(); - $pages = $map->xpath($xpath); - foreach ($pages as $page) { - $link .= '
  • '; - $link .= $page->attributes()->title.'
  • '; - } - - return $link; - } - - function links_parent_siblings_after($map) { - $here = $this->parent($map); - $query = '//page[normalize-space(@here)="'.$here.'"]/following-sibling::*'; - - return $this->links_from_xpath($query, $map); - } - - function links_parent($map) { - $here = $this->parent($map); - $query = '//page[normalize-space(@here)="'.$here.'"]'; - - return $this->links_from_xpath($query, $map); - } - - function links_parent_siblings_before($map) { - $here = $this->parent($map); - $query = '//page[normalize-space(@here)="'.$here.'"]/preceding-sibling::*'; - - return $this->links_from_xpath($query, $map); - } - - function links_parent_ancestors($map) { - $here = $this->parent($map); - return $this->links_ancestors_from($here, $map); - } - - function links_self_ancestors($map) { - $here = $this->here(); - return $this->links_ancestors_from($here, $map); - } - - function links_ancestors_from($here, $map) { - $link = ""; - - $pages = $map->xpath('//page[normalize-space(@here)="'.$here.'"]/ancestor::*'); - foreach ($pages as $page) { - $here = (string)$page->attributes()->here; - if ($this->level_from_root($here, $map) >= 2) { - $link .= '
  • '; - $link .= $page->attributes()->title.'
  • '; - } - } - - return $link; - } - function links_siblings_before($map) { - $here = $this->here(); - $query = '//page[normalize-space(@here)="'.$here.'"]/preceding-sibling::*'; - - return $this->links_from_xpath($query, $map); - } - - function links_self($map) { - $here = $this->here(); - $query = '//page[normalize-space(@here)="'.$here.'"]'; - - return $this->links_from_xpath($query, $map); - } - - function links_siblings_after($map) { - $here = $this->here(); - $query = '//page[normalize-space(@here)="'.$here.'"]/following-sibling::*'; - - return $this->links_from_xpath($query, $map); - } - - function links_children($map) { - $here = $this->here(); - $query = '//page[normalize-space(@here)="'.$here.'"]/child::*'; - - return $this->links_from_xpath($query, $map); - } - - function links($path_to_map) { - $links['download'] = ""; - $links['start_testing'] = ""; - $links['support'] = ""; - $links['contribute'] = ""; - - $map = simplexml_load_file($path_to_map); - - $link = '
      '; - $here = $this->here(); - $level = $this->level_from_root($here, $map); - if ($level == 2) { - $link .= $this->links_self($map); - $link .= $this->links_children($map); - } - if ($level == 3) { - $link .= $this->links_self_ancestors($map); - $link .= $this->links_siblings_before($map); - $link .= $this->links_self($map); - $chilren = $this->links_children($map); - if ($chilren) { - $link = preg_replace('/(<\/li>)$/', '', $link).'
        '.$chilren.'
      '; - } - $link .= $this->links_siblings_after($map); - } - if ($level == 4) { - $link .= $this->links_parent_ancestors($map); - $link .= $this->links_parent_siblings_before($map); - $link .= $this->links_parent($map); - $link = preg_replace('/(<\/li>)$/', '', $link).'
        '; - $link .= $this->links_siblings_before($map); - $link .= $this->links_self($map); - $chilren = $this->links_children($map); - if ($chilren) { - $link = preg_replace('/(<\/li>)$/', '', $link).'
          '.$chilren.'
        '; - } - $link .= $this->links_siblings_after($map); - $link .= '
      '; - $link .= $this->links_parent_siblings_after($map); - } - $link .= '
    '; - - if (strpos($link, 'download.html') !== false) { - $links['download'] = $link; - } elseif (strpos($link, 'start-testing.html') !== false) { - $links['start_testing'] = $link; - } elseif (strpos($link, 'support.html') !== false) { - $links['support'] = $link; - } elseif (strpos($link, 'todo.html') !== false) { - $links['contribute'] = $link; - } - - return $links; - } - - function level_from_root($here, $map) { - $ancestors = $map->xpath('//page[normalize-space(@here)="'.$here.'"]/ancestor::*'); - - return count($ancestors); - } -} - -class PackagingSynchronisation { - public $file; - public $lang; - public $content; - - function __construct($file, $lang="fr") { - $this->file = $file; - $this->lang = $lang; - $this->content = ""; - if (file_exists($this->file)) { - $this->content = file_get_contents($this->file); - } - } - - function isSynchronisable() { - return (bool)strpos($this->content, "isSynchronisable()) { - return "source"; - } elseif (!$this->sourceRevision()) { - return "missing id"; - } elseif ($this->sourceRevision() > $this->lastSynchroRevision()) { - return "late"; - } else { - return "synchro"; - } - } - - function revision() { - $matches = array(); - preg_match("/Id: [a-z_-]*\.[a-z]* ([0-9]*)/", $this->content, $matches); - return $matches[1]; - } - - function sourceLang() { - $matches = array(); - preg_match("/synchronisation.*lang=\"([a-z]*)\"/", $this->content, $matches); - return $matches[1]; - } - - function sourceRevision() { - $source_lang = $this->sourceLang(); - $source_file = str_replace("/".$this->lang."/", "/".$source_lang."/", $this->file); - if (file_exists($source_file)) { - $source = new PackagingSynchronisation($source_file, $source_lang); - return $source->revision(); - } - return false; - } - - function lastSynchroRevision() { - $matches = array(); - preg_match("/synchronisation.*version=\"([0-9]*)\"/", $this->content, $matches); - return $matches[1]; - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/template.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/template.html deleted file mode 100644 index e785398..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/template.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - -TITLE - - - - -
    -
    - -
    -
    - - LINKS_DOWNLOAD -
    -
    - - LINKS_START_TESTING -
    -
    - - LINKS_SUPPORT -
    -
    - - LINKS_CONTRIBUTE -
    -
    - - SourceForge.net Logo - -
    -
    -
    -
    -

    TITLE

    - - CONTENT - -
    - -
    INTERNAL
    - -
    -
    - -
    EXTERNAL
    - -
    -
    -
    - - - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/content_without_section.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/content_without_section.xml deleted file mode 100644 index d3b1308..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/content_without_section.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - Overview and feature list for the SimpleTest PHP unit tester and web tester - - -

    - A test case looks like this... -MyTestCase extends UnitTestCase { - - function testLogWroteMessage() { - $log = &new Log('my.log'); - $log->message('Hello'); - $this->assertTrue(file_exists('my.log')); - } -} -?> -]]> -

    -
    - - - Quick summary - of the SimpleTest tool for PHP. - - - List of features, - both current ones and those planned. - - - There are plenty of unit testing resources - on the web. - - - - - Documentation for SimpleTest. - - - How to write PHP test cases - is a fairly advanced tutorial. - - - SimpleTest API from phpdoc. - - - - - software development tools, - php programming, - programming php, - software development tools, - Tools for extreme programming, - free php scripts, - links of testing tools, - php testing resources, - mock objects, - junit, - jwebunit, - htmlunit, - itc, - php testing links, - unit test advice and documentation, - extreme programming in php - - - - - - Marcus Baker - - Primary Developer{@link mailto:marcus@lastcraft.com marcus@lastcraft.com} - - - - Harry Fuecks - - Packager{@link mailto:harryf@users.sourceforge.net harryf@users.sourceforge.net} - - - - Jason Sweat - - Documentation{@link mailto:jsweat_php@yahoo.com jsweat_php@yahoo.com} - - - - -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/en/synchronisation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/en/synchronisation.xml deleted file mode 100644 index f95a8ad..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/en/synchronisation.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - Overview and feature list for the SimpleTest PHP unit tester and web tester - - -

    - A test case looks like this... -MyTestCase extends UnitTestCase { - - function testLogWroteMessage() { - $log = &new Log('my.log'); - $log->message('Hello'); - $this->assertTrue(file_exists('my.log')); - } -} -?> -]]> -

    -
    - - - Quick summary - of the SimpleTest tool for PHP. - - - List of features, - both current ones and those planned. - - - There are plenty of unit testing resources - on the web. - - - - - Documentation for SimpleTest. - - - How to write PHP test cases - is a fairly advanced tutorial. - - - SimpleTest API from phpdoc. - - - - - software development tools, - php programming, - programming php, - software development tools, - Tools for extreme programming, - free php scripts, - links of testing tools, - php testing resources, - mock objects, - junit, - jwebunit, - htmlunit, - itc, - php testing links, - unit test advice and documentation, - extreme programming in php - - - - - - Marcus Baker - - Primary Developer{@link mailto:marcus@lastcraft.com marcus@lastcraft.com} - - - - Harry Fuecks - - Packager{@link mailto:harryf@users.sourceforge.net harryf@users.sourceforge.net} - - - - Jason Sweat - - Documentation{@link mailto:jsweat_php@yahoo.com jsweat_php@yahoo.com} - - - - -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/fr/no-synchronisation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/fr/no-synchronisation.xml deleted file mode 100644 index d3b1308..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/fr/no-synchronisation.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - Overview and feature list for the SimpleTest PHP unit tester and web tester - - -

    - A test case looks like this... -MyTestCase extends UnitTestCase { - - function testLogWroteMessage() { - $log = &new Log('my.log'); - $log->message('Hello'); - $this->assertTrue(file_exists('my.log')); - } -} -?> -]]> -

    -
    - - - Quick summary - of the SimpleTest tool for PHP. - - - List of features, - both current ones and those planned. - - - There are plenty of unit testing resources - on the web. - - - - - Documentation for SimpleTest. - - - How to write PHP test cases - is a fairly advanced tutorial. - - - SimpleTest API from phpdoc. - - - - - software development tools, - php programming, - programming php, - software development tools, - Tools for extreme programming, - free php scripts, - links of testing tools, - php testing resources, - mock objects, - junit, - jwebunit, - htmlunit, - itc, - php testing links, - unit test advice and documentation, - extreme programming in php - - - - - - Marcus Baker - - Primary Developer{@link mailto:marcus@lastcraft.com marcus@lastcraft.com} - - - - Harry Fuecks - - Packager{@link mailto:harryf@users.sourceforge.net harryf@users.sourceforge.net} - - - - Jason Sweat - - Documentation{@link mailto:jsweat_php@yahoo.com jsweat_php@yahoo.com} - - - - -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/fr/synchronisation.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/fr/synchronisation.xml deleted file mode 100644 index 7fd400c..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/fr/synchronisation.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - Le texte en français - - -

    - A test case looks like this... -MyTestCase extends UnitTestCase { - - function testLogWroteMessage() { - $log = &new Log('my.log'); - $log->message('Hello'); - $this->assertTrue(file_exists('my.log')); - } -} -?> -]]> -

    -
    - - - Quick summary - of the SimpleTest tool for PHP. - - - List of features, - both current ones and those planned. - - - There are plenty of unit testing resources - on the web. - - - - - Documentation for SimpleTest. - - - How to write PHP test cases - is a fairly advanced tutorial. - - - SimpleTest API from phpdoc. - - - - - software development tools, - php programming, - programming php, - software development tools, - Tools for extreme programming, - free php scripts, - links of testing tools, - php testing resources, - mock objects, - junit, - jwebunit, - htmlunit, - itc, - php testing links, - unit test advice and documentation, - extreme programming in php - - - - - - Marcus Baker - - Primary Developer{@link mailto:marcus@lastcraft.com marcus@lastcraft.com} - - - - Harry Fuecks - - Packager{@link mailto:harryf@users.sourceforge.net harryf@users.sourceforge.net} - - - - Jason Sweat - - Documentation{@link mailto:jsweat_php@yahoo.com jsweat_php@yahoo.com} - - - - -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_download.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_download.xml deleted file mode 100644 index 4179725..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_download.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - Overview and feature list for the SimpleTest PHP unit tester and web tester - - -

    - A test case looks like this... -MyTestCase extends UnitTestCase { - - function testLogWroteMessage() { - $log = &new Log('my.log'); - $log->message('Hello'); - $this->assertTrue(file_exists('my.log')); - } -} -?> -]]> -

    -
    - - - Quick summary - of the SimpleTest tool for PHP. - - - List of features, - both current ones and those planned. - - - There are plenty of unit testing resources - on the web. - - - - - Documentation for SimpleTest. - - - How to write PHP test cases - is a fairly advanced tutorial. - - - SimpleTest API from phpdoc. - - - - - software development tools, - php programming, - programming php, - software development tools, - Tools for extreme programming, - free php scripts, - links of testing tools, - php testing resources, - mock objects, - junit, - jwebunit, - htmlunit, - itc, - php testing links, - unit test advice and documentation, - extreme programming in php - - - - - - Marcus Baker - - Primary Developer{@link mailto:marcus@lastcraft.com marcus@lastcraft.com} - - - - Harry Fuecks - - Packager{@link mailto:harryf@users.sourceforge.net harryf@users.sourceforge.net} - - - - Jason Sweat - - Documentation{@link mailto:jsweat_php@yahoo.com jsweat_php@yahoo.com} - - - - -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_overview.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_overview.xml deleted file mode 100644 index d3b1308..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_overview.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - Overview and feature list for the SimpleTest PHP unit tester and web tester - - -

    - A test case looks like this... -MyTestCase extends UnitTestCase { - - function testLogWroteMessage() { - $log = &new Log('my.log'); - $log->message('Hello'); - $this->assertTrue(file_exists('my.log')); - } -} -?> -]]> -

    -
    - - - Quick summary - of the SimpleTest tool for PHP. - - - List of features, - both current ones and those planned. - - - There are plenty of unit testing resources - on the web. - - - - - Documentation for SimpleTest. - - - How to write PHP test cases - is a fairly advanced tutorial. - - - SimpleTest API from phpdoc. - - - - - software development tools, - php programming, - programming php, - software development tools, - Tools for extreme programming, - free php scripts, - links of testing tools, - php testing resources, - mock objects, - junit, - jwebunit, - htmlunit, - itc, - php testing links, - unit test advice and documentation, - extreme programming in php - - - - - - Marcus Baker - - Primary Developer{@link mailto:marcus@lastcraft.com marcus@lastcraft.com} - - - - Harry Fuecks - - Packager{@link mailto:harryf@users.sourceforge.net harryf@users.sourceforge.net} - - - - Jason Sweat - - Documentation{@link mailto:jsweat_php@yahoo.com jsweat_php@yahoo.com} - - - - -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_simpletest.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_simpletest.xml deleted file mode 100644 index 428b3c7..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_simpletest.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - Overview and feature list for the SimpleTest PHP unit tester and web tester - - -

    - A test case looks like this... -MyTestCase extends UnitTestCase { - - function testLogWroteMessage() { - $log = &new Log('my.log'); - $log->message('Hello'); - $this->assertTrue(file_exists('my.log')); - } -} -?> -]]> -

    -
    - - - Quick summary - of the SimpleTest tool for PHP. - - - List of features, - both current ones and those planned. - - - There are plenty of unit testing resources - on the web. - - - - - Documentation for SimpleTest. - - - How to write PHP test cases - is a fairly advanced tutorial. - - - SimpleTest API from phpdoc. - - - - - software development tools, - php programming, - programming php, - software development tools, - Tools for extreme programming, - free php scripts, - links of testing tools, - php testing resources, - mock objects, - junit, - jwebunit, - htmlunit, - itc, - php testing links, - unit test advice and documentation, - extreme programming in php - - - - - - Marcus Baker - - Primary Developer{@link mailto:marcus@lastcraft.com marcus@lastcraft.com} - - - - Harry Fuecks - - Packager{@link mailto:harryf@users.sourceforge.net harryf@users.sourceforge.net} - - - - Jason Sweat - - Documentation{@link mailto:jsweat_php@yahoo.com jsweat_php@yahoo.com} - - - - -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_start_testing.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_start_testing.xml deleted file mode 100644 index d3b1308..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_start_testing.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - Overview and feature list for the SimpleTest PHP unit tester and web tester - - -

    - A test case looks like this... -MyTestCase extends UnitTestCase { - - function testLogWroteMessage() { - $log = &new Log('my.log'); - $log->message('Hello'); - $this->assertTrue(file_exists('my.log')); - } -} -?> -]]> -

    -
    - - - Quick summary - of the SimpleTest tool for PHP. - - - List of features, - both current ones and those planned. - - - There are plenty of unit testing resources - on the web. - - - - - Documentation for SimpleTest. - - - How to write PHP test cases - is a fairly advanced tutorial. - - - SimpleTest API from phpdoc. - - - - - software development tools, - php programming, - programming php, - software development tools, - Tools for extreme programming, - free php scripts, - links of testing tools, - php testing resources, - mock objects, - junit, - jwebunit, - htmlunit, - itc, - php testing links, - unit test advice and documentation, - extreme programming in php - - - - - - Marcus Baker - - Primary Developer{@link mailto:marcus@lastcraft.com marcus@lastcraft.com} - - - - Harry Fuecks - - Packager{@link mailto:harryf@users.sourceforge.net harryf@users.sourceforge.net} - - - - Jason Sweat - - Documentation{@link mailto:jsweat_php@yahoo.com jsweat_php@yahoo.com} - - - - -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_support.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_support.xml deleted file mode 100644 index 4d43dc4..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_support.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - Overview and feature list for the SimpleTest PHP unit tester and web tester - - -

    - A test case looks like this... -MyTestCase extends UnitTestCase { - - function testLogWroteMessage() { - $log = &new Log('my.log'); - $log->message('Hello'); - $this->assertTrue(file_exists('my.log')); - } -} -?> -]]> -

    -
    - - - Quick summary - of the SimpleTest tool for PHP. - - - List of features, - both current ones and those planned. - - - There are plenty of unit testing resources - on the web. - - - - - Documentation for SimpleTest. - - - How to write PHP test cases - is a fairly advanced tutorial. - - - SimpleTest API from phpdoc. - - - - - software development tools, - php programming, - programming php, - software development tools, - Tools for extreme programming, - free php scripts, - links of testing tools, - php testing resources, - mock objects, - junit, - jwebunit, - htmlunit, - itc, - php testing links, - unit test advice and documentation, - extreme programming in php - - - - - - Marcus Baker - - Primary Developer{@link mailto:marcus@lastcraft.com marcus@lastcraft.com} - - - - Harry Fuecks - - Packager{@link mailto:harryf@users.sourceforge.net harryf@users.sourceforge.net} - - - - Jason Sweat - - Documentation{@link mailto:jsweat_php@yahoo.com jsweat_php@yahoo.com} - - - - -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_unit-tester.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_unit-tester.xml deleted file mode 100644 index 7e32910..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/here_unit-tester.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - Overview and feature list for the SimpleTest PHP unit tester and web tester - - -

    - A test case looks like this... -MyTestCase extends UnitTestCase { - - function testLogWroteMessage() { - $log = &new Log('my.log'); - $log->message('Hello'); - $this->assertTrue(file_exists('my.log')); - } -} -?> -]]> -

    -
    - - - Quick summary - of the SimpleTest tool for PHP. - - - List of features, - both current ones and those planned. - - - There are plenty of unit testing resources - on the web. - - - - - Documentation for SimpleTest. - - - How to write PHP test cases - is a fairly advanced tutorial. - - - SimpleTest API from phpdoc. - - - - - software development tools, - php programming, - programming php, - software development tools, - Tools for extreme programming, - free php scripts, - links of testing tools, - php testing resources, - mock objects, - junit, - jwebunit, - htmlunit, - itc, - php testing links, - unit test advice and documentation, - extreme programming in php - - - - - - Marcus Baker - - Primary Developer{@link mailto:marcus@lastcraft.com marcus@lastcraft.com} - - - - Harry Fuecks - - Packager{@link mailto:harryf@users.sourceforge.net harryf@users.sourceforge.net} - - - - Jason Sweat - - Documentation{@link mailto:jsweat_php@yahoo.com jsweat_php@yahoo.com} - - - - -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/map.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/map.xml deleted file mode 100644 index ec25596..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/map.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/one_section_changelogged.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/one_section_changelogged.xml deleted file mode 100644 index 22b1d90..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/one_section_changelogged.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - SimpleTest's Changelog - -
    - - - Patches and whitespace clean up - - - Some in line documentation fixes - - - SimpleFileLoader::load: fix for $test_file already included, by daniel hahler - blueyed - - - New tests for UTF8 inside the browser. - - - Fixing one of the incompatible interface errors - - - expectException() - - -
    -
    - - - Changelog for version 1.0.1 - - - - - SimpleTest project page on SourceForge. - - - The developer's API for SimpleTest - gives full detail on the classes and assertions available. - - - - - software development, - php programming for clients, - customer focused php, - software development tools, - acceptance testing framework, - free php scripts, - log in boxes, - unit testing authentication systems, - php resources, - HTMLUnit, - JWebUnit, - php testing, - unit test resource, - web testing, - HTTP authentication, - testing log in, - authentication testing, - security tests - - -
    \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/one_section_milestoned.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/one_section_milestoned.xml deleted file mode 100644 index f495772..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/one_section_milestoned.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - Overview and feature list for the SimpleTest PHP unit tester and web tester - - -
    - - - Undefined property $_reporter + fatal error - - - - The HELP_MY_TESTS_DONT_WORK_ANYMORE needs to be updated. - - - - - PHP 5.3 compatible under E_STRICT - PHP 5.2.0-5 compatible under E_STRICT - PHP 5.1.0-6 compatible under E_STRICT - continuous integration - - error_reporting(E_ALL|E_STRICT)gives lots of warning - - We've know this for years, this is the time. - - - - Drop underscores from protected methods and - private variables. - Make all variables private and add protected - accessors where we use them internally. - - That way people will start complaining. - Upon each complaint we'll add an accessor and - capture the use case from them. - - - We'll stick the use cases in the feature request - tracker for now - - - Move web site to new server - - -
    -
    - - - Quick summary - of the SimpleTest tool for PHP. - - - List of features, - both current ones and those planned. - - - There are plenty of unit testing resources - on the web. - - - - - Documentation for SimpleTest. - - - How to write PHP test cases - is a fairly advanced tutorial. - - - SimpleTest API from phpdoc. - - - - - software development tools, - php programming, - programming php, - software development tools, - Tools for extreme programming, - free php scripts, - links of testing tools, - php testing resources, - mock objects, - junit, - jwebunit, - htmlunit, - itc, - php testing links, - unit test advice and documentation, - extreme programming in php - - -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/one_section_with_autorum_php.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/one_section_with_autorum_php.xml deleted file mode 100644 index 8e6ee88..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/one_section_with_autorum_php.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - Overview and feature list for the SimpleTest PHP unit tester and web tester - - -
    -

    - Use the &quote;autorun.php&quote; with no link. -

    -

    - Use the "autodive.php" with no link. -

    -

    - Use the autowalk. -

    -
    -
    - - - Quick summary - of the SimpleTest tool for PHP. - - - List of features, - both current ones and those planned. - - - There are plenty of unit testing resources - on the web. - - - - - Documentation for SimpleTest. - - - How to write PHP test cases - is a fairly advanced tutorial. - - - SimpleTest API from phpdoc. - - - - - software development tools, - php programming, - programming php, - software development tools, - Tools for extreme programming, - free php scripts, - links of testing tools, - php testing resources, - mock objects, - junit, - jwebunit, - htmlunit, - itc, - php testing links, - unit test advice and documentation, - extreme programming in php - - - - - - Marcus Baker - - Primary Developer{@link mailto:marcus@lastcraft.com marcus@lastcraft.com} - - - - Harry Fuecks - - Packager{@link mailto:harryf@users.sourceforge.net harryf@users.sourceforge.net} - - - - Jason Sweat - - Documentation{@link mailto:jsweat_php@yahoo.com jsweat_php@yahoo.com} - - - - -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/one_section_with_php_code.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/one_section_with_php_code.xml deleted file mode 100644 index 552647d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package/one_section_with_php_code.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - Overview and feature list for the SimpleTest PHP unit tester and web tester - - -
    -

    - A test case looks like this... -MyTestCase extends UnitTestCase { - - function testLogWroteMessage() { - $log = &new Log('my.log'); - $log->message('Hello'); - $this->assertTrue(file_exists('my.log')); - } -} -?> -]]> -

    -
    -
    - - - Quick summary - of the SimpleTest tool for PHP. - - - List of features, - both current ones and those planned. - - - There are plenty of unit testing resources - on the web. - - - - - Documentation for SimpleTest. - - - How to write PHP test cases - is a fairly advanced tutorial. - - - SimpleTest API from phpdoc. - - - - - software development tools, - php programming, - programming php, - software development tools, - Tools for extreme programming, - free php scripts, - links of testing tools, - php testing resources, - mock objects, - junit, - jwebunit, - htmlunit, - itc, - php testing links, - unit test advice and documentation, - extreme programming in php - - - - - - Marcus Baker - - Primary Developer{@link mailto:marcus@lastcraft.com marcus@lastcraft.com} - - - - Harry Fuecks - - Packager{@link mailto:harryf@users.sourceforge.net harryf@users.sourceforge.net} - - - - Jason Sweat - - Documentation{@link mailto:jsweat_php@yahoo.com jsweat_php@yahoo.com} - - - - -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package_test.php deleted file mode 100644 index cb2b955..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/simpletest.org/test/package_test.php +++ /dev/null @@ -1,150 +0,0 @@ -assertEqual($synchro->result(), "source"); - - $source = dirname(__FILE__)."/package/en/synchronisation.xml"; - $synchro = new PackagingSynchronisation($source); - $this->assertEqual($synchro->result(), "source"); - } - - function testOfSynchronisationNecessary() { - $source = dirname(__FILE__)."/package/fr/synchronisation.xml"; - $synchro = new PackagingSynchronisation($source); - $this->assertEqual($synchro->revision(), "1672"); - $this->assertEqual($synchro->sourceRevision(), "1671"); - $this->assertEqual($synchro->sourceLang(), "en"); - $this->assertEqual($synchro->lastSynchroRevision(), "1475"); - $this->assertEqual($synchro->result(), "late"); - } -} - -class TestOfContentTransformationFromXMLToHTML extends UnitTestCase { - function testOfNonLinksFileWithPHPExtension() { - $file = dirname(__FILE__).'/package/one_section_with_autorum_php.xml'; - $source = simplexml_load_file($file, "SimpleTestXMLElement"); - $content = $source->content(); - $this->assertPattern('/autorun\.php/', $content); - $this->assertNoPattern('/autorun\.html/', $content); - $this->assertPattern('/autodive\.php/', $content); - $this->assertNoPattern('/autodive\.html/', $content); - $this->assertNoPattern('/autowalk\.php/', $content); - $this->assertPattern('/autowalk\.html/', $content); - } - - function testOfPHPTags() { - $file = dirname(__FILE__).'/package/one_section_with_php_code.xml'; - $source = simplexml_load_file($file, "SimpleTestXMLElement"); - $content = $source->content(); - $this->assertPattern('/
    /', $content);
    -		$this->assertNoPattern('/<\!\[CDATA\[/', $content);
    -		$this->assertPattern('/

    /', $content); - $this->assertPattern('/\$log = &new Log\(\'my.log\'\);/', $content); - $this->assertPattern('/log->message/', $content); - } - - function testOfContentWithoutSections() { - $file = dirname(__FILE__).'/package/content_without_section.xml'; - $source = simplexml_load_file($file, "SimpleTestXMLElement"); - $content = $source->content(); - $this->assertPattern('/

    /', $content); - } - - function testOfContentFromChangeLogSection() { - $file = dirname(__FILE__).'/package/one_section_changelogged.xml'; - $source = simplexml_load_file($file, "SimpleTestXMLElement"); - $content = $source->content(); - $this->assertPattern('/

    Version 1.0.1<\/h3>/', $content); - $this->assertPattern('/
  • \[bug\] Patches and whitespace clean up<\/li>/', $content); - $this->assertPattern('/
  • Some in line documentation fixes<\/li>/', $content); - $this->assertPattern('/
  • \[bug 1853765<\/a>\] Fixing one of the incompatible interface errors<\/li>/', $content); - } - - function testOfContentFromMilestoneSection() { - $file = dirname(__FILE__).'/package/one_section_milestoned.xml'; - $source = simplexml_load_file($file, "SimpleTestXMLElement"); - $content = $source->content(); - $this->assertPattern('/

    1\.1beta<\/h3>/', $content); - $this->assertPattern('/<\/a>/', $content); - $this->assertPattern('/

    Unit tester<\/h4>/', $content); - $this->assertPattern('/

    Documentation<\/h4>/', $content); - $this->assertPattern('/

    Extensions<\/h4>/', $content); - $this->assertPattern('/

    Build<\/h4>/', $content); - $this->assertPattern('/
    \[bug\] Undefined property \$_reporter \+ fatal error<\/dt>/', $content); - $this->assertPattern('/
    tracker : 1896582<\/a><\/dd>/', $content); - $this->assertPattern('/
    \[task\] The HELP_MY_TESTS_DONT_WORK_ANYMORE needs to be updated\.<\/dt>/', $content); - $this->assertPattern('/
    \[task\] PHP 5.3 compatible under E_STRICT<\/dt>/', $content); - $this->assertPattern('/
    \[bug\] continuous integration<\/dt>/', $content); - $this->assertPattern('/
    \[bug\] error_reporting\(E_ALL|E_STRICT\)gives lots of warning<\/dt>/', $content); - $this->assertPattern('/
    We\'ve know this for years, this is the time\.<\/dd>/', $content); - } - - function testOfSingleLink() { - $file = dirname(__FILE__).'/package/here_download.xml'; - $source = simplexml_load_file($file, "SimpleTestXMLElement"); - $map = dirname(__FILE__).'/package/map.xml'; - $links = $source->links($map); - $this->assertEqual(count($links), 4); - $links_download = ''; - $this->assertEqual($links['download'], $links_download); - } - - function testOfMultipleLinks() { - $file = dirname(__FILE__).'/package/here_support.xml'; - $source = simplexml_load_file($file, "SimpleTestXMLElement"); - $map = dirname(__FILE__).'/package/map.xml'; - $links = $source->links($map); - $this->assertEqual(count($links), 4); - $links_support = ''; - $this->assertEqual($links['support'], $links_support); - } - - function testOfHierarchicalLinks() { - $file = dirname(__FILE__).'/package/here_overview.xml'; - $source = simplexml_load_file($file, "SimpleTestXMLElement"); - $map = dirname(__FILE__).'/package/map.xml'; - $links = $source->links($map); - $this->assertEqual(count($links), 4); - $links_start_testing = ''; - $this->assertEqual($links['start_testing'], $links_start_testing); - } - - function testOfRootLinksWithHierarchy() { - $file = dirname(__FILE__).'/package/here_simpletest.xml'; - $source = simplexml_load_file($file, "SimpleTestXMLElement"); - $map = dirname(__FILE__).'/package/map.xml'; - $links = $source->links($map); - $this->assertEqual(count($links), 4); - $links_start_testing = ''; - $this->assertEqual($links['start_testing'], $links_start_testing); - } - - function testOfLinksWithNonRootParent() { - $file = dirname(__FILE__).'/package/here_unit-tester.xml'; - $source = simplexml_load_file($file, "SimpleTestXMLElement"); - $map = dirname(__FILE__).'/package/map.xml'; - $links = $source->links($map); - $this->assertEqual(count($links), 4); - $links_start_testing = ''; - $this->assertEqual($links['start_testing'], $links_start_testing); - } -} - -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/site_map.xml b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/site_map.xml deleted file mode 100644 index 10e5663..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/site_map.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/transform_all_lastcraft.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/transform_all_lastcraft.php deleted file mode 100644 index 9b317df..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/packages/transform_all_lastcraft.php +++ /dev/null @@ -1,17 +0,0 @@ - $destination\n"; - `$command`; - } - closedir($dir); -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/page.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/page.php deleted file mode 100644 index cfaa255..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/page.php +++ /dev/null @@ -1,979 +0,0 @@ - 'SimpleAnchorTag', - 'title' => 'SimpleTitleTag', - 'base' => 'SimpleBaseTag', - 'button' => 'SimpleButtonTag', - 'textarea' => 'SimpleTextAreaTag', - 'option' => 'SimpleOptionTag', - 'label' => 'SimpleLabelTag', - 'form' => 'SimpleFormTag', - 'frame' => 'SimpleFrameTag'); - $attributes = $this->keysToLowerCase($attributes); - if (array_key_exists($name, $map)) { - $tag_class = $map[$name]; - return new $tag_class($attributes); - } elseif ($name == 'select') { - return $this->createSelectionTag($attributes); - } elseif ($name == 'input') { - return $this->createInputTag($attributes); - } - return new SimpleTag($name, $attributes); - } - - /** - * Factory for selection fields. - * @param hash $attributes Element attributes. - * @return SimpleTag Tag object. - * @access protected - */ - protected function createSelectionTag($attributes) { - if (isset($attributes['multiple'])) { - return new MultipleSelectionTag($attributes); - } - return new SimpleSelectionTag($attributes); - } - - /** - * Factory for input tags. - * @param hash $attributes Element attributes. - * @return SimpleTag Tag object. - * @access protected - */ - protected function createInputTag($attributes) { - if (! isset($attributes['type'])) { - return new SimpleTextTag($attributes); - } - $type = strtolower(trim($attributes['type'])); - $map = array( - 'submit' => 'SimpleSubmitTag', - 'image' => 'SimpleImageSubmitTag', - 'checkbox' => 'SimpleCheckboxTag', - 'radio' => 'SimpleRadioButtonTag', - 'text' => 'SimpleTextTag', - 'hidden' => 'SimpleTextTag', - 'password' => 'SimpleTextTag', - 'file' => 'SimpleUploadTag'); - if (array_key_exists($type, $map)) { - $tag_class = $map[$type]; - return new $tag_class($attributes); - } - return false; - } - - /** - * Make the keys lower case for case insensitive look-ups. - * @param hash $map Hash to convert. - * @return hash Unchanged values, but keys lower case. - * @access private - */ - protected function keysToLowerCase($map) { - $lower = array(); - foreach ($map as $key => $value) { - $lower[strtolower($key)] = $value; - } - return $lower; - } -} - -/** - * SAX event handler. Maintains a list of - * open tags and dispatches them as they close. - * @package SimpleTest - * @subpackage WebTester - */ -class SimplePageBuilder extends SimpleSaxListener { - private $tags; - private $page; - private $private_content_tag; - - /** - * Sets the builder up empty. - * @access public - */ - function __construct() { - parent::__construct(); - } - - /** - * Frees up any references so as to allow the PHP garbage - * collection from unset() to work. - * @access public - */ - function free() { - unset($this->tags); - unset($this->page); - unset($this->private_content_tags); - } - - /** - * Reads the raw content and send events - * into the page to be built. - * @param $response SimpleHttpResponse Fetched response. - * @return SimplePage Newly parsed page. - * @access public - */ - function parse($response) { - $this->tags = array(); - $this->page = $this->createPage($response); - $parser = $this->createParser($this); - $parser->parse($response->getContent()); - $this->page->acceptPageEnd(); - return $this->page; - } - - /** - * Creates an empty page. - * @return SimplePage New unparsed page. - * @access protected - */ - protected function createPage($response) { - return new SimplePage($response); - } - - /** - * Creates the parser used with the builder. - * @param $listener SimpleSaxListener Target of parser. - * @return SimpleSaxParser Parser to generate - * events for the builder. - * @access protected - */ - protected function createParser(&$listener) { - return new SimpleHtmlSaxParser($listener); - } - - /** - * Start of element event. Opens a new tag. - * @param string $name Element name. - * @param hash $attributes Attributes without content - * are marked as true. - * @return boolean False on parse error. - * @access public - */ - function startElement($name, $attributes) { - $factory = new SimpleTagBuilder(); - $tag = $factory->createTag($name, $attributes); - if (! $tag) { - return true; - } - if ($tag->getTagName() == 'label') { - $this->page->acceptLabelStart($tag); - $this->openTag($tag); - return true; - } - if ($tag->getTagName() == 'form') { - $this->page->acceptFormStart($tag); - return true; - } - if ($tag->getTagName() == 'frameset') { - $this->page->acceptFramesetStart($tag); - return true; - } - if ($tag->getTagName() == 'frame') { - $this->page->acceptFrame($tag); - return true; - } - if ($tag->isPrivateContent() && ! isset($this->private_content_tag)) { - $this->private_content_tag = &$tag; - } - if ($tag->expectEndTag()) { - $this->openTag($tag); - return true; - } - $this->page->acceptTag($tag); - return true; - } - - /** - * End of element event. - * @param string $name Element name. - * @return boolean False on parse error. - * @access public - */ - function endElement($name) { - if ($name == 'label') { - $this->page->acceptLabelEnd(); - return true; - } - if ($name == 'form') { - $this->page->acceptFormEnd(); - return true; - } - if ($name == 'frameset') { - $this->page->acceptFramesetEnd(); - return true; - } - if ($this->hasNamedTagOnOpenTagStack($name)) { - $tag = array_pop($this->tags[$name]); - if ($tag->isPrivateContent() && $this->private_content_tag->getTagName() == $name) { - unset($this->private_content_tag); - } - $this->addContentTagToOpenTags($tag); - $this->page->acceptTag($tag); - return true; - } - return true; - } - - /** - * Test to see if there are any open tags awaiting - * closure that match the tag name. - * @param string $name Element name. - * @return boolean True if any are still open. - * @access private - */ - protected function hasNamedTagOnOpenTagStack($name) { - return isset($this->tags[$name]) && (count($this->tags[$name]) > 0); - } - - /** - * Unparsed, but relevant data. The data is added - * to every open tag. - * @param string $text May include unparsed tags. - * @return boolean False on parse error. - * @access public - */ - function addContent($text) { - if (isset($this->private_content_tag)) { - $this->private_content_tag->addContent($text); - } else { - $this->addContentToAllOpenTags($text); - } - return true; - } - - /** - * Any content fills all currently open tags unless it - * is part of an option tag. - * @param string $text May include unparsed tags. - * @access private - */ - protected function addContentToAllOpenTags($text) { - foreach (array_keys($this->tags) as $name) { - for ($i = 0, $count = count($this->tags[$name]); $i < $count; $i++) { - $this->tags[$name][$i]->addContent($text); - } - } - } - - /** - * Parsed data in tag form. The parsed tag is added - * to every open tag. Used for adding options to select - * fields only. - * @param SimpleTag $tag Option tags only. - * @access private - */ - protected function addContentTagToOpenTags(&$tag) { - if ($tag->getTagName() != 'option') { - return; - } - foreach (array_keys($this->tags) as $name) { - for ($i = 0, $count = count($this->tags[$name]); $i < $count; $i++) { - $this->tags[$name][$i]->addTag($tag); - } - } - } - - /** - * Opens a tag for receiving content. Multiple tags - * will be receiving input at the same time. - * @param SimpleTag $tag New content tag. - * @access private - */ - protected function openTag($tag) { - $name = $tag->getTagName(); - if (! in_array($name, array_keys($this->tags))) { - $this->tags[$name] = array(); - } - $this->tags[$name][] = $tag; - } -} - -/** - * A wrapper for a web page. - * @package SimpleTest - * @subpackage WebTester - */ -class SimplePage { - private $links; - private $title; - private $last_widget; - private $label; - private $left_over_labels; - private $open_forms; - private $complete_forms; - private $frameset; - private $frames; - private $frameset_nesting_level; - private $transport_error; - private $raw; - private $text; - private $sent; - private $headers; - private $method; - private $url; - private $base = false; - private $request_data; - - /** - * Parses a page ready to access it's contents. - * @param SimpleHttpResponse $response Result of HTTP fetch. - * @access public - */ - function __construct($response = false) { - $this->links = array(); - $this->title = false; - $this->left_over_labels = array(); - $this->open_forms = array(); - $this->complete_forms = array(); - $this->frameset = false; - $this->frames = array(); - $this->frameset_nesting_level = 0; - $this->text = false; - if ($response) { - $this->extractResponse($response); - } else { - $this->noResponse(); - } - } - - /** - * Extracts all of the response information. - * @param SimpleHttpResponse $response Response being parsed. - * @access private - */ - protected function extractResponse($response) { - $this->transport_error = $response->getError(); - $this->raw = $response->getContent(); - $this->sent = $response->getSent(); - $this->headers = $response->getHeaders(); - $this->method = $response->getMethod(); - $this->url = $response->getUrl(); - $this->request_data = $response->getRequestData(); - } - - /** - * Sets up a missing response. - * @access private - */ - protected function noResponse() { - $this->transport_error = 'No page fetched yet'; - $this->raw = false; - $this->sent = false; - $this->headers = false; - $this->method = 'GET'; - $this->url = false; - $this->request_data = false; - } - - /** - * Original request as bytes sent down the wire. - * @return mixed Sent content. - * @access public - */ - function getRequest() { - return $this->sent; - } - - /** - * Accessor for raw text of page. - * @return string Raw unparsed content. - * @access public - */ - function getRaw() { - return $this->raw; - } - - /** - * Accessor for plain text of page as a text browser - * would see it. - * @return string Plain text of page. - * @access public - */ - function getText() { - if (! $this->text) { - $this->text = SimpleHtmlSaxParser::normalise($this->raw); - } - return $this->text; - } - - /** - * Accessor for raw headers of page. - * @return string Header block as text. - * @access public - */ - function getHeaders() { - if ($this->headers) { - return $this->headers->getRaw(); - } - return false; - } - - /** - * Original request method. - * @return string GET, POST or HEAD. - * @access public - */ - function getMethod() { - return $this->method; - } - - /** - * Original resource name. - * @return SimpleUrl Current url. - * @access public - */ - function getUrl() { - return $this->url; - } - - /** - * Base URL if set via BASE tag page url otherwise - * @return SimpleUrl Base url. - * @access public - */ - function getBaseUrl() { - return $this->base; - } - - /** - * Original request data. - * @return mixed Sent content. - * @access public - */ - function getRequestData() { - return $this->request_data; - } - - /** - * Accessor for last error. - * @return string Error from last response. - * @access public - */ - function getTransportError() { - return $this->transport_error; - } - - /** - * Accessor for current MIME type. - * @return string MIME type as string; e.g. 'text/html' - * @access public - */ - function getMimeType() { - if ($this->headers) { - return $this->headers->getMimeType(); - } - return false; - } - - /** - * Accessor for HTTP response code. - * @return integer HTTP response code received. - * @access public - */ - function getResponseCode() { - if ($this->headers) { - return $this->headers->getResponseCode(); - } - return false; - } - - /** - * Accessor for last Authentication type. Only valid - * straight after a challenge (401). - * @return string Description of challenge type. - * @access public - */ - function getAuthentication() { - if ($this->headers) { - return $this->headers->getAuthentication(); - } - return false; - } - - /** - * Accessor for last Authentication realm. Only valid - * straight after a challenge (401). - * @return string Name of security realm. - * @access public - */ - function getRealm() { - if ($this->headers) { - return $this->headers->getRealm(); - } - return false; - } - - /** - * Accessor for current frame focus. Will be - * false as no frames. - * @return array Always empty. - * @access public - */ - function getFrameFocus() { - return array(); - } - - /** - * Sets the focus by index. The integer index starts from 1. - * @param integer $choice Chosen frame. - * @return boolean Always false. - * @access public - */ - function setFrameFocusByIndex($choice) { - return false; - } - - /** - * Sets the focus by name. Always fails for a leaf page. - * @param string $name Chosen frame. - * @return boolean False as no frames. - * @access public - */ - function setFrameFocus($name) { - return false; - } - - /** - * Clears the frame focus. Does nothing for a leaf page. - * @access public - */ - function clearFrameFocus() { - } - - /** - * Adds a tag to the page. - * @param SimpleTag $tag Tag to accept. - * @access public - */ - function acceptTag($tag) { - if ($tag->getTagName() == "a") { - $this->addLink($tag); - } elseif ($tag->getTagName() == "base") { - $this->setBase($tag); - } elseif ($tag->getTagName() == "title") { - $this->setTitle($tag); - } elseif ($this->isFormElement($tag->getTagName())) { - for ($i = 0; $i < count($this->open_forms); $i++) { - $this->open_forms[$i]->addWidget($tag); - } - $this->last_widget = &$tag; - } - } - - /** - * Opens a label for a described widget. - * @param SimpleFormTag $tag Tag to accept. - * @access public - */ - function acceptLabelStart($tag) { - $this->label = $tag; - unset($this->last_widget); - } - - /** - * Closes the most recently opened label. - * @access public - */ - function acceptLabelEnd() { - if (isset($this->label)) { - if (isset($this->last_widget)) { - $this->last_widget->setLabel($this->label->getText()); - unset($this->last_widget); - } else { - $this->left_over_labels[] = SimpleTestCompatibility::copy($this->label); - } - unset($this->label); - } - } - - /** - * Tests to see if a tag is a possible form - * element. - * @param string $name HTML element name. - * @return boolean True if form element. - * @access private - */ - protected function isFormElement($name) { - return in_array($name, array('input', 'button', 'textarea', 'select')); - } - - /** - * Opens a form. New widgets go here. - * @param SimpleFormTag $tag Tag to accept. - * @access public - */ - function acceptFormStart($tag) { - $this->open_forms[] = new SimpleForm($tag, $this); - } - - /** - * Closes the most recently opened form. - * @access public - */ - function acceptFormEnd() { - if (count($this->open_forms)) { - $this->complete_forms[] = array_pop($this->open_forms); - } - } - - /** - * Opens a frameset. A frameset may contain nested - * frameset tags. - * @param SimpleFramesetTag $tag Tag to accept. - * @access public - */ - function acceptFramesetStart($tag) { - if (! $this->isLoadingFrames()) { - $this->frameset = $tag; - } - $this->frameset_nesting_level++; - } - - /** - * Closes the most recently opened frameset. - * @access public - */ - function acceptFramesetEnd() { - if ($this->isLoadingFrames()) { - $this->frameset_nesting_level--; - } - } - - /** - * Takes a single frame tag and stashes it in - * the current frame set. - * @param SimpleFrameTag $tag Tag to accept. - * @access public - */ - function acceptFrame($tag) { - if ($this->isLoadingFrames()) { - if ($tag->getAttribute('src')) { - $this->frames[] = $tag; - } - } - } - - /** - * Test to see if in the middle of reading - * a frameset. - * @return boolean True if inframeset. - * @access private - */ - protected function isLoadingFrames() { - if (! $this->frameset) { - return false; - } - return ($this->frameset_nesting_level > 0); - } - - /** - * Test to see if link is an absolute one. - * @param string $url Url to test. - * @return boolean True if absolute. - * @access protected - */ - protected function linkIsAbsolute($url) { - $parsed = new SimpleUrl($url); - return (boolean)($parsed->getScheme() && $parsed->getHost()); - } - - /** - * Adds a link to the page. - * @param SimpleAnchorTag $tag Link to accept. - * @access protected - */ - protected function addLink($tag) { - $this->links[] = $tag; - } - - /** - * Marker for end of complete page. Any work in - * progress can now be closed. - * @access public - */ - function acceptPageEnd() { - while (count($this->open_forms)) { - $this->complete_forms[] = array_pop($this->open_forms); - } - foreach ($this->left_over_labels as $label) { - for ($i = 0, $count = count($this->complete_forms); $i < $count; $i++) { - $this->complete_forms[$i]->attachLabelBySelector( - new SimpleById($label->getFor()), - $label->getText()); - } - } - } - - /** - * Test for the presence of a frameset. - * @return boolean True if frameset. - * @access public - */ - function hasFrames() { - return (boolean)$this->frameset; - } - - /** - * Accessor for frame name and source URL for every frame that - * will need to be loaded. Immediate children only. - * @return boolean/array False if no frameset or - * otherwise a hash of frame URLs. - * The key is either a numerical - * base one index or the name attribute. - * @access public - */ - function getFrameset() { - if (! $this->frameset) { - return false; - } - $urls = array(); - for ($i = 0; $i < count($this->frames); $i++) { - $name = $this->frames[$i]->getAttribute('name'); - $url = new SimpleUrl($this->frames[$i]->getAttribute('src')); - $urls[$name ? $name : $i + 1] = $this->expandUrl($url); - } - return $urls; - } - - /** - * Fetches a list of loaded frames. - * @return array/string Just the URL for a single page. - * @access public - */ - function getFrames() { - $url = $this->expandUrl($this->getUrl()); - return $url->asString(); - } - - /** - * Accessor for a list of all links. - * @return array List of urls with scheme of - * http or https and hostname. - * @access public - */ - function getUrls() { - $all = array(); - foreach ($this->links as $link) { - $url = $this->getUrlFromLink($link); - $all[] = $url->asString(); - } - return $all; - } - - /** - * Accessor for URLs by the link label. Label will match - * regardess of whitespace issues and case. - * @param string $label Text of link. - * @return array List of links with that label. - * @access public - */ - function getUrlsByLabel($label) { - $matches = array(); - foreach ($this->links as $link) { - if ($link->getText() == $label) { - $matches[] = $this->getUrlFromLink($link); - } - } - return $matches; - } - - /** - * Accessor for a URL by the id attribute. - * @param string $id Id attribute of link. - * @return SimpleUrl URL with that id of false if none. - * @access public - */ - function getUrlById($id) { - foreach ($this->links as $link) { - if ($link->getAttribute('id') === (string)$id) { - return $this->getUrlFromLink($link); - } - } - return false; - } - - /** - * Converts a link tag into a target URL. - * @param SimpleAnchor $link Parsed link. - * @return SimpleUrl URL with frame target if any. - * @access private - */ - protected function getUrlFromLink($link) { - $url = $this->expandUrl($link->getHref()); - if ($link->getAttribute('target')) { - $url->setTarget($link->getAttribute('target')); - } - return $url; - } - - /** - * Expands expandomatic URLs into fully qualified - * URLs. - * @param SimpleUrl $url Relative URL. - * @return SimpleUrl Absolute URL. - * @access public - */ - function expandUrl($url) { - if (! is_object($url)) { - $url = new SimpleUrl($url); - } - $location = $this->getBaseUrl() ? $this->getBaseUrl() : new SimpleUrl(); - return $url->makeAbsolute($location->makeAbsolute($this->getUrl())); - } - - /** - * Sets the base url for the page. - * @param SimpleTag $tag Base URL for page. - * @access protected - */ - protected function setBase($tag) { - $url = $tag->getAttribute('href'); - $this->base = new SimpleUrl($url); - } - - /** - * Sets the title tag contents. - * @param SimpleTitleTag $tag Title of page. - * @access protected - */ - protected function setTitle($tag) { - $this->title = $tag; - } - - /** - * Accessor for parsed title. - * @return string Title or false if no title is present. - * @access public - */ - function getTitle() { - if ($this->title) { - return $this->title->getText(); - } - return false; - } - - /** - * Finds a held form by button label. Will only - * search correctly built forms. - * @param SimpleSelector $selector Button finder. - * @return SimpleForm Form object containing - * the button. - * @access public - */ - function &getFormBySubmit($selector) { - for ($i = 0; $i < count($this->complete_forms); $i++) { - if ($this->complete_forms[$i]->hasSubmit($selector)) { - return $this->complete_forms[$i]; - } - } - $null = null; - return $null; - } - - /** - * Finds a held form by image using a selector. - * Will only search correctly built forms. - * @param SimpleSelector $selector Image finder. - * @return SimpleForm Form object containing - * the image. - * @access public - */ - function getFormByImage($selector) { - for ($i = 0; $i < count($this->complete_forms); $i++) { - if ($this->complete_forms[$i]->hasImage($selector)) { - return $this->complete_forms[$i]; - } - } - return null; - } - - /** - * Finds a held form by the form ID. A way of - * identifying a specific form when we have control - * of the HTML code. - * @param string $id Form label. - * @return SimpleForm Form object containing the matching ID. - * @access public - */ - function getFormById($id) { - for ($i = 0; $i < count($this->complete_forms); $i++) { - if ($this->complete_forms[$i]->getId() == $id) { - return $this->complete_forms[$i]; - } - } - return null; - } - - /** - * Sets a field on each form in which the field is - * available. - * @param SimpleSelector $selector Field finder. - * @param string $value Value to set field to. - * @return boolean True if value is valid. - * @access public - */ - function setField($selector, $value, $position=false) { - $is_set = false; - for ($i = 0; $i < count($this->complete_forms); $i++) { - if ($this->complete_forms[$i]->setField($selector, $value, $position)) { - $is_set = true; - } - } - return $is_set; - } - - /** - * Accessor for a form element value within a page. - * @param SimpleSelector $selector Field finder. - * @return string/boolean A string if the field is - * present, false if unchecked - * and null if missing. - * @access public - */ - function getField($selector) { - for ($i = 0; $i < count($this->complete_forms); $i++) { - $value = $this->complete_forms[$i]->getValue($selector); - if (isset($value)) { - return $value; - } - } - return null; - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/parser.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/parser.php deleted file mode 100644 index e95df81..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/parser.php +++ /dev/null @@ -1,760 +0,0 @@ - $constant) { - if (! defined($constant)) { - define($constant, $i + 1); - } -} -/**#@-*/ - -/** - * Compounded regular expression. Any of - * the contained patterns could match and - * when one does, it's label is returned. - * @package SimpleTest - * @subpackage WebTester - */ -class ParallelRegex { - private $patterns; - private $labels; - private $regex; - private $case; - - /** - * Constructor. Starts with no patterns. - * @param boolean $case True for case sensitive, false - * for insensitive. - * @access public - */ - function __construct($case) { - $this->case = $case; - $this->patterns = array(); - $this->labels = array(); - $this->regex = null; - } - - /** - * Adds a pattern with an optional label. - * @param string $pattern Perl style regex, but ( and ) - * lose the usual meaning. - * @param string $label Label of regex to be returned - * on a match. - * @access public - */ - function addPattern($pattern, $label = true) { - $count = count($this->patterns); - $this->patterns[$count] = $pattern; - $this->labels[$count] = $label; - $this->regex = null; - } - - /** - * Attempts to match all patterns at once against - * a string. - * @param string $subject String to match against. - * @param string $match First matched portion of - * subject. - * @return boolean True on success. - * @access public - */ - function match($subject, &$match) { - if (count($this->patterns) == 0) { - return false; - } - if (! preg_match($this->getCompoundedRegex(), $subject, $matches)) { - $match = ''; - return false; - } - $match = $matches[0]; - for ($i = 1; $i < count($matches); $i++) { - if ($matches[$i]) { - return $this->labels[$i - 1]; - } - } - return true; - } - - /** - * Compounds the patterns into a single - * regular expression separated with the - * "or" operator. Caches the regex. - * Will automatically escape (, ) and / tokens. - * @param array $patterns List of patterns in order. - * @access private - */ - protected function getCompoundedRegex() { - if ($this->regex == null) { - for ($i = 0, $count = count($this->patterns); $i < $count; $i++) { - $this->patterns[$i] = '(' . str_replace( - array('/', '(', ')'), - array('\/', '\(', '\)'), - $this->patterns[$i]) . ')'; - } - $this->regex = "/" . implode("|", $this->patterns) . "/" . $this->getPerlMatchingFlags(); - } - return $this->regex; - } - - /** - * Accessor for perl regex mode flags to use. - * @return string Perl regex flags. - * @access private - */ - protected function getPerlMatchingFlags() { - return ($this->case ? "msS" : "msSi"); - } -} - -/** - * States for a stack machine. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleStateStack { - private $stack; - - /** - * Constructor. Starts in named state. - * @param string $start Starting state name. - * @access public - */ - function __construct($start) { - $this->stack = array($start); - } - - /** - * Accessor for current state. - * @return string State. - * @access public - */ - function getCurrent() { - return $this->stack[count($this->stack) - 1]; - } - - /** - * Adds a state to the stack and sets it - * to be the current state. - * @param string $state New state. - * @access public - */ - function enter($state) { - array_push($this->stack, $state); - } - - /** - * Leaves the current state and reverts - * to the previous one. - * @return boolean False if we drop off - * the bottom of the list. - * @access public - */ - function leave() { - if (count($this->stack) == 1) { - return false; - } - array_pop($this->stack); - return true; - } -} - -/** - * Accepts text and breaks it into tokens. - * Some optimisation to make the sure the - * content is only scanned by the PHP regex - * parser once. Lexer modes must not start - * with leading underscores. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleLexer { - private $regexes; - private $parser; - private $mode; - private $mode_handlers; - private $case; - - /** - * Sets up the lexer in case insensitive matching - * by default. - * @param SimpleSaxParser $parser Handling strategy by - * reference. - * @param string $start Starting handler. - * @param boolean $case True for case sensitive. - * @access public - */ - function __construct($parser, $start = "accept", $case = false) { - $this->case = $case; - $this->regexes = array(); - $this->parser = $parser; - $this->mode = new SimpleStateStack($start); - $this->mode_handlers = array($start => $start); - } - - /** - * Adds a token search pattern for a particular - * parsing mode. The pattern does not change the - * current mode. - * @param string $pattern Perl style regex, but ( and ) - * lose the usual meaning. - * @param string $mode Should only apply this - * pattern when dealing with - * this type of input. - * @access public - */ - function addPattern($pattern, $mode = "accept") { - if (! isset($this->regexes[$mode])) { - $this->regexes[$mode] = new ParallelRegex($this->case); - } - $this->regexes[$mode]->addPattern($pattern); - if (! isset($this->mode_handlers[$mode])) { - $this->mode_handlers[$mode] = $mode; - } - } - - /** - * Adds a pattern that will enter a new parsing - * mode. Useful for entering parenthesis, strings, - * tags, etc. - * @param string $pattern Perl style regex, but ( and ) - * lose the usual meaning. - * @param string $mode Should only apply this - * pattern when dealing with - * this type of input. - * @param string $new_mode Change parsing to this new - * nested mode. - * @access public - */ - function addEntryPattern($pattern, $mode, $new_mode) { - if (! isset($this->regexes[$mode])) { - $this->regexes[$mode] = new ParallelRegex($this->case); - } - $this->regexes[$mode]->addPattern($pattern, $new_mode); - if (! isset($this->mode_handlers[$new_mode])) { - $this->mode_handlers[$new_mode] = $new_mode; - } - } - - /** - * Adds a pattern that will exit the current mode - * and re-enter the previous one. - * @param string $pattern Perl style regex, but ( and ) - * lose the usual meaning. - * @param string $mode Mode to leave. - * @access public - */ - function addExitPattern($pattern, $mode) { - if (! isset($this->regexes[$mode])) { - $this->regexes[$mode] = new ParallelRegex($this->case); - } - $this->regexes[$mode]->addPattern($pattern, "__exit"); - if (! isset($this->mode_handlers[$mode])) { - $this->mode_handlers[$mode] = $mode; - } - } - - /** - * Adds a pattern that has a special mode. Acts as an entry - * and exit pattern in one go, effectively calling a special - * parser handler for this token only. - * @param string $pattern Perl style regex, but ( and ) - * lose the usual meaning. - * @param string $mode Should only apply this - * pattern when dealing with - * this type of input. - * @param string $special Use this mode for this one token. - * @access public - */ - function addSpecialPattern($pattern, $mode, $special) { - if (! isset($this->regexes[$mode])) { - $this->regexes[$mode] = new ParallelRegex($this->case); - } - $this->regexes[$mode]->addPattern($pattern, "_$special"); - if (! isset($this->mode_handlers[$special])) { - $this->mode_handlers[$special] = $special; - } - } - - /** - * Adds a mapping from a mode to another handler. - * @param string $mode Mode to be remapped. - * @param string $handler New target handler. - * @access public - */ - function mapHandler($mode, $handler) { - $this->mode_handlers[$mode] = $handler; - } - - /** - * Splits the page text into tokens. Will fail - * if the handlers report an error or if no - * content is consumed. If successful then each - * unparsed and parsed token invokes a call to the - * held listener. - * @param string $raw Raw HTML text. - * @return boolean True on success, else false. - * @access public - */ - function parse($raw) { - if (! isset($this->parser)) { - return false; - } - $length = strlen($raw); - while (is_array($parsed = $this->reduce($raw))) { - list($raw, $unmatched, $matched, $mode) = $parsed; - if (! $this->dispatchTokens($unmatched, $matched, $mode)) { - return false; - } - if ($raw === '') { - return true; - } - if (strlen($raw) == $length) { - return false; - } - $length = strlen($raw); - } - if (! $parsed) { - return false; - } - return $this->invokeParser($raw, LEXER_UNMATCHED); - } - - /** - * Sends the matched token and any leading unmatched - * text to the parser changing the lexer to a new - * mode if one is listed. - * @param string $unmatched Unmatched leading portion. - * @param string $matched Actual token match. - * @param string $mode Mode after match. A boolean - * false mode causes no change. - * @return boolean False if there was any error - * from the parser. - * @access private - */ - protected function dispatchTokens($unmatched, $matched, $mode = false) { - if (! $this->invokeParser($unmatched, LEXER_UNMATCHED)) { - return false; - } - if (is_bool($mode)) { - return $this->invokeParser($matched, LEXER_MATCHED); - } - if ($this->isModeEnd($mode)) { - if (! $this->invokeParser($matched, LEXER_EXIT)) { - return false; - } - return $this->mode->leave(); - } - if ($this->isSpecialMode($mode)) { - $this->mode->enter($this->decodeSpecial($mode)); - if (! $this->invokeParser($matched, LEXER_SPECIAL)) { - return false; - } - return $this->mode->leave(); - } - $this->mode->enter($mode); - return $this->invokeParser($matched, LEXER_ENTER); - } - - /** - * Tests to see if the new mode is actually to leave - * the current mode and pop an item from the matching - * mode stack. - * @param string $mode Mode to test. - * @return boolean True if this is the exit mode. - * @access private - */ - protected function isModeEnd($mode) { - return ($mode === "__exit"); - } - - /** - * Test to see if the mode is one where this mode - * is entered for this token only and automatically - * leaves immediately afterwoods. - * @param string $mode Mode to test. - * @return boolean True if this is the exit mode. - * @access private - */ - protected function isSpecialMode($mode) { - return (strncmp($mode, "_", 1) == 0); - } - - /** - * Strips the magic underscore marking single token - * modes. - * @param string $mode Mode to decode. - * @return string Underlying mode name. - * @access private - */ - protected function decodeSpecial($mode) { - return substr($mode, 1); - } - - /** - * Calls the parser method named after the current - * mode. Empty content will be ignored. The lexer - * has a parser handler for each mode in the lexer. - * @param string $content Text parsed. - * @param boolean $is_match Token is recognised rather - * than unparsed data. - * @access private - */ - protected function invokeParser($content, $is_match) { - if (($content === '') || ($content === false)) { - return true; - } - $handler = $this->mode_handlers[$this->mode->getCurrent()]; - return $this->parser->$handler($content, $is_match); - } - - /** - * Tries to match a chunk of text and if successful - * removes the recognised chunk and any leading - * unparsed data. Empty strings will not be matched. - * @param string $raw The subject to parse. This is the - * content that will be eaten. - * @return array/boolean Three item list of unparsed - * content followed by the - * recognised token and finally the - * action the parser is to take. - * True if no match, false if there - * is a parsing error. - * @access private - */ - protected function reduce($raw) { - if ($action = $this->regexes[$this->mode->getCurrent()]->match($raw, $match)) { - $unparsed_character_count = strpos($raw, $match); - $unparsed = substr($raw, 0, $unparsed_character_count); - $raw = substr($raw, $unparsed_character_count + strlen($match)); - return array($raw, $unparsed, $match, $action); - } - return true; - } -} - -/** - * Breaks HTML into SAX events. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleHtmlLexer extends SimpleLexer { - - /** - * Sets up the lexer with case insensitive matching - * and adds the HTML handlers. - * @param SimpleSaxParser $parser Handling strategy by - * reference. - * @access public - */ - function __construct($parser) { - parent::__construct($parser, 'text'); - $this->mapHandler('text', 'acceptTextToken'); - $this->addSkipping(); - foreach ($this->getParsedTags() as $tag) { - $this->addTag($tag); - } - $this->addInTagTokens(); - } - - /** - * List of parsed tags. Others are ignored. - * @return array List of searched for tags. - * @access private - */ - protected function getParsedTags() { - return array('a', 'base', 'title', 'form', 'input', 'button', 'textarea', 'select', - 'option', 'frameset', 'frame', 'label'); - } - - /** - * The lexer has to skip certain sections such - * as server code, client code and styles. - * @access private - */ - protected function addSkipping() { - $this->mapHandler('css', 'ignore'); - $this->addEntryPattern('addExitPattern('', 'css'); - $this->mapHandler('js', 'ignore'); - $this->addEntryPattern('addExitPattern('', 'js'); - $this->mapHandler('comment', 'ignore'); - $this->addEntryPattern('', 'comment'); - } - - /** - * Pattern matches to start and end a tag. - * @param string $tag Name of tag to scan for. - * @access private - */ - protected function addTag($tag) { - $this->addSpecialPattern("", 'text', 'acceptEndToken'); - $this->addEntryPattern("<$tag", 'text', 'tag'); - } - - /** - * Pattern matches to parse the inside of a tag - * including the attributes and their quoting. - * @access private - */ - protected function addInTagTokens() { - $this->mapHandler('tag', 'acceptStartToken'); - $this->addSpecialPattern('\s+', 'tag', 'ignore'); - $this->addAttributeTokens(); - $this->addExitPattern('/>', 'tag'); - $this->addExitPattern('>', 'tag'); - } - - /** - * Matches attributes that are either single quoted, - * double quoted or unquoted. - * @access private - */ - protected function addAttributeTokens() { - $this->mapHandler('dq_attribute', 'acceptAttributeToken'); - $this->addEntryPattern('=\s*"', 'tag', 'dq_attribute'); - $this->addPattern("\\\\\"", 'dq_attribute'); - $this->addExitPattern('"', 'dq_attribute'); - $this->mapHandler('sq_attribute', 'acceptAttributeToken'); - $this->addEntryPattern("=\s*'", 'tag', 'sq_attribute'); - $this->addPattern("\\\\'", 'sq_attribute'); - $this->addExitPattern("'", 'sq_attribute'); - $this->mapHandler('uq_attribute', 'acceptAttributeToken'); - $this->addSpecialPattern('=\s*[^>\s]*', 'tag', 'uq_attribute'); - } -} - -/** - * Converts HTML tokens into selected SAX events. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleHtmlSaxParser { - private $lexer; - private $listener; - private $tag; - private $attributes; - private $current_attribute; - - /** - * Sets the listener. - * @param SimpleSaxListener $listener SAX event handler. - * @access public - */ - function __construct($listener) { - $this->listener = $listener; - $this->lexer = $this->createLexer($this); - $this->tag = ''; - $this->attributes = array(); - $this->current_attribute = ''; - } - - /** - * Runs the content through the lexer which - * should call back to the acceptors. - * @param string $raw Page text to parse. - * @return boolean False if parse error. - * @access public - */ - function parse($raw) { - return $this->lexer->parse($raw); - } - - /** - * Sets up the matching lexer. Starts in 'text' mode. - * @param SimpleSaxParser $parser Event generator, usually $self. - * @return SimpleLexer Lexer suitable for this parser. - * @access public - */ - static function createLexer(&$parser) { - return new SimpleHtmlLexer($parser); - } - - /** - * Accepts a token from the tag mode. If the - * starting element completes then the element - * is dispatched and the current attributes - * set back to empty. The element or attribute - * name is converted to lower case. - * @param string $token Incoming characters. - * @param integer $event Lexer event type. - * @return boolean False if parse error. - * @access public - */ - function acceptStartToken($token, $event) { - if ($event == LEXER_ENTER) { - $this->tag = strtolower(substr($token, 1)); - return true; - } - if ($event == LEXER_EXIT) { - $success = $this->listener->startElement( - $this->tag, - $this->attributes); - $this->tag = ''; - $this->attributes = array(); - return $success; - } - if ($token != '=') { - $this->current_attribute = strtolower(SimpleHtmlSaxParser::decodeHtml($token)); - $this->attributes[$this->current_attribute] = ''; - } - return true; - } - - /** - * Accepts a token from the end tag mode. - * The element name is converted to lower case. - * @param string $token Incoming characters. - * @param integer $event Lexer event type. - * @return boolean False if parse error. - * @access public - */ - function acceptEndToken($token, $event) { - if (! preg_match('/<\/(.*)>/', $token, $matches)) { - return false; - } - return $this->listener->endElement(strtolower($matches[1])); - } - - /** - * Part of the tag data. - * @param string $token Incoming characters. - * @param integer $event Lexer event type. - * @return boolean False if parse error. - * @access public - */ - function acceptAttributeToken($token, $event) { - if ($this->current_attribute) { - if ($event == LEXER_UNMATCHED) { - $this->attributes[$this->current_attribute] .= - SimpleHtmlSaxParser::decodeHtml($token); - } - if ($event == LEXER_SPECIAL) { - $this->attributes[$this->current_attribute] .= - preg_replace('/^=\s*/' , '', SimpleHtmlSaxParser::decodeHtml($token)); - } - } - return true; - } - - /** - * A character entity. - * @param string $token Incoming characters. - * @param integer $event Lexer event type. - * @return boolean False if parse error. - * @access public - */ - function acceptEntityToken($token, $event) { - } - - /** - * Character data between tags regarded as - * important. - * @param string $token Incoming characters. - * @param integer $event Lexer event type. - * @return boolean False if parse error. - * @access public - */ - function acceptTextToken($token, $event) { - return $this->listener->addContent($token); - } - - /** - * Incoming data to be ignored. - * @param string $token Incoming characters. - * @param integer $event Lexer event type. - * @return boolean False if parse error. - * @access public - */ - function ignore($token, $event) { - return true; - } - - /** - * Decodes any HTML entities. - * @param string $html Incoming HTML. - * @return string Outgoing plain text. - * @access public - */ - static function decodeHtml($html) { - return html_entity_decode($html, ENT_QUOTES); - } - - /** - * Turns HTML into text browser visible text. Images - * are converted to their alt text and tags are supressed. - * Entities are converted to their visible representation. - * @param string $html HTML to convert. - * @return string Plain text. - * @access public - */ - static function normalise($html) { - $text = preg_replace('||', '', $html); - $text = preg_replace('|]*>.*?|', '', $text); - $text = preg_replace('|]*alt\s*=\s*"([^"]*)"[^>]*>|', ' \1 ', $text); - $text = preg_replace('|]*alt\s*=\s*\'([^\']*)\'[^>]*>|', ' \1 ', $text); - $text = preg_replace('|]*alt\s*=\s*([a-zA-Z_]+)[^>]*>|', ' \1 ', $text); - $text = preg_replace('|<[^>]*>|', '', $text); - $text = SimpleHtmlSaxParser::decodeHtml($text); - $text = preg_replace('|\s+|', ' ', $text); - return trim(trim($text), "\xA0"); // TODO: The \xAO is a  . Add a test for this. - } -} - -/** - * SAX event handler. - * @package SimpleTest - * @subpackage WebTester - * @abstract - */ -class SimpleSaxListener { - - /** - * Sets the document to write to. - * @access public - */ - function __construct() { - } - - /** - * Start of element event. - * @param string $name Element name. - * @param hash $attributes Name value pairs. - * Attributes without content - * are marked as true. - * @return boolean False on parse error. - * @access public - */ - function startElement($name, $attributes) { - } - - /** - * End of element event. - * @param string $name Element name. - * @return boolean False on parse error. - * @access public - */ - function endElement($name) { - } - - /** - * Unparsed, but relevant data. - * @param string $text May include unparsed tags. - * @return boolean False on parse error. - * @access public - */ - function addContent($text) { - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/reflection_php4.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/reflection_php4.php deleted file mode 100644 index 6c93915..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/reflection_php4.php +++ /dev/null @@ -1,136 +0,0 @@ -_interface = $interface; - } - - /** - * Checks that a class has been declared. - * @return boolean True if defined. - * @access public - */ - function classExists() { - return class_exists($this->_interface); - } - - /** - * Needed to kill the autoload feature in PHP5 - * for classes created dynamically. - * @return boolean True if defined. - * @access public - */ - function classExistsSansAutoload() { - return class_exists($this->_interface); - } - - /** - * Checks that a class or interface has been - * declared. - * @return boolean True if defined. - * @access public - */ - function classOrInterfaceExists() { - return class_exists($this->_interface); - } - - /** - * Needed to kill the autoload feature in PHP5 - * for classes created dynamically. - * @return boolean True if defined. - * @access public - */ - function classOrInterfaceExistsSansAutoload() { - return class_exists($this->_interface); - } - - /** - * Gets the list of methods on a class or - * interface. - * @returns array List of method names. - * @access public - */ - function getMethods() { - return get_class_methods($this->_interface); - } - - /** - * Gets the list of interfaces from a class. If the - * class name is actually an interface then just that - * interface is returned. - * @returns array List of interfaces. - * @access public - */ - function getInterfaces() { - return array(); - } - - /** - * Finds the parent class name. - * @returns string Parent class name. - * @access public - */ - function getParent() { - return strtolower(get_parent_class($this->_interface)); - } - - /** - * Determines if the class is abstract, which for PHP 4 - * will never be the case. - * @returns boolean True if abstract. - * @access public - */ - function isAbstract() { - return false; - } - - /** - * Determines if the the entity is an interface, which for PHP 4 - * will never be the case. - * @returns boolean True if interface. - * @access public - */ - function isInterface() { - return false; - } - - /** - * Scans for final methods, but as it's PHP 4 there - * aren't any. - * @returns boolean True if the class has a final method. - * @access public - */ - function hasFinal() { - return false; - } - - /** - * Gets the source code matching the declaration - * of a method. - * @param string $method Method name. - * @access public - */ - function getSignature($method) { - return "function &$method()"; - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/reflection_php5.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/reflection_php5.php deleted file mode 100644 index 02cceb5..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/reflection_php5.php +++ /dev/null @@ -1,386 +0,0 @@ -interface = $interface; - } - - /** - * Checks that a class has been declared. Versions - * before PHP5.0.2 need a check that it's not really - * an interface. - * @return boolean True if defined. - * @access public - */ - function classExists() { - if (! class_exists($this->interface)) { - return false; - } - $reflection = new ReflectionClass($this->interface); - return ! $reflection->isInterface(); - } - - /** - * Needed to kill the autoload feature in PHP5 - * for classes created dynamically. - * @return boolean True if defined. - * @access public - */ - function classExistsSansAutoload() { - return class_exists($this->interface, false); - } - - /** - * Checks that a class or interface has been - * declared. - * @return boolean True if defined. - * @access public - */ - function classOrInterfaceExists() { - return $this->classOrInterfaceExistsWithAutoload($this->interface, true); - } - - /** - * Needed to kill the autoload feature in PHP5 - * for classes created dynamically. - * @return boolean True if defined. - * @access public - */ - function classOrInterfaceExistsSansAutoload() { - return $this->classOrInterfaceExistsWithAutoload($this->interface, false); - } - - /** - * Needed to select the autoload feature in PHP5 - * for classes created dynamically. - * @param string $interface Class or interface name. - * @param boolean $autoload True totriggerautoload. - * @return boolean True if interface defined. - * @access private - */ - protected function classOrInterfaceExistsWithAutoload($interface, $autoload) { - if (function_exists('interface_exists')) { - if (interface_exists($this->interface, $autoload)) { - return true; - } - } - return class_exists($this->interface, $autoload); - } - - /** - * Gets the list of methods on a class or - * interface. - * @returns array List of method names. - * @access public - */ - function getMethods() { - return array_unique(get_class_methods($this->interface)); - } - - /** - * Gets the list of interfaces from a class. If the - * class name is actually an interface then just that - * interface is returned. - * @returns array List of interfaces. - * @access public - */ - function getInterfaces() { - $reflection = new ReflectionClass($this->interface); - if ($reflection->isInterface()) { - return array($this->interface); - } - return $this->onlyParents($reflection->getInterfaces()); - } - - /** - * Gets the list of methods for the implemented - * interfaces only. - * @returns array List of enforced method signatures. - * @access public - */ - function getInterfaceMethods() { - $methods = array(); - foreach ($this->getInterfaces() as $interface) { - $methods = array_merge($methods, get_class_methods($interface)); - } - return array_unique($methods); - } - - /** - * Checks to see if the method signature has to be tightly - * specified. - * @param string $method Method name. - * @returns boolean True if enforced. - * @access private - */ - protected function isInterfaceMethod($method) { - return in_array($method, $this->getInterfaceMethods()); - } - - /** - * Finds the parent class name. - * @returns string Parent class name. - * @access public - */ - function getParent() { - $reflection = new ReflectionClass($this->interface); - $parent = $reflection->getParentClass(); - if ($parent) { - return $parent->getName(); - } - return false; - } - - /** - * Trivially determines if the class is abstract. - * @returns boolean True if abstract. - * @access public - */ - function isAbstract() { - $reflection = new ReflectionClass($this->interface); - return $reflection->isAbstract(); - } - - /** - * Trivially determines if the class is an interface. - * @returns boolean True if interface. - * @access public - */ - function isInterface() { - $reflection = new ReflectionClass($this->interface); - return $reflection->isInterface(); - } - - /** - * Scans for final methods, as they screw up inherited - * mocks by not allowing you to override them. - * @returns boolean True if the class has a final method. - * @access public - */ - function hasFinal() { - $reflection = new ReflectionClass($this->interface); - foreach ($reflection->getMethods() as $method) { - if ($method->isFinal()) { - return true; - } - } - return false; - } - - /** - * Whittles a list of interfaces down to only the - * necessary top level parents. - * @param array $interfaces Reflection API interfaces - * to reduce. - * @returns array List of parent interface names. - * @access private - */ - protected function onlyParents($interfaces) { - $parents = array(); - $blacklist = array(); - foreach ($interfaces as $interface) { - foreach($interfaces as $possible_parent) { - if ($interface->getName() == $possible_parent->getName()) { - continue; - } - if ($interface->isSubClassOf($possible_parent)) { - $blacklist[$possible_parent->getName()] = true; - } - } - if (!isset($blacklist[$interface->getName()])) { - $parents[] = $interface->getName(); - } - } - return $parents; - } - - /** - * Checks whether a method is abstract or not. - * @param string $name Method name. - * @return bool true if method is abstract, else false - * @access private - */ - protected function isAbstractMethod($name) { - $interface = new ReflectionClass($this->interface); - if (! $interface->hasMethod($name)) { - return false; - } - return $interface->getMethod($name)->isAbstract(); - } - - /** - * Checks whether a method is the constructor. - * @param string $name Method name. - * @return bool true if method is the constructor - * @access private - */ - protected function isConstructor($name) { - return ($name == '__construct') || ($name == $this->interface); - } - - /** - * Checks whether a method is abstract in all parents or not. - * @param string $name Method name. - * @return bool true if method is abstract in parent, else false - * @access private - */ - protected function isAbstractMethodInParents($name) { - $interface = new ReflectionClass($this->interface); - $parent = $interface->getParentClass(); - while($parent) { - if (! $parent->hasMethod($name)) { - return false; - } - if ($parent->getMethod($name)->isAbstract()) { - return true; - } - $parent = $parent->getParentClass(); - } - return false; - } - - /** - * Checks whether a method is static or not. - * @param string $name Method name - * @return bool true if method is static, else false - * @access private - */ - protected function isStaticMethod($name) { - $interface = new ReflectionClass($this->interface); - if (! $interface->hasMethod($name)) { - return false; - } - return $interface->getMethod($name)->isStatic(); - } - - /** - * Writes the source code matching the declaration - * of a method. - * @param string $name Method name. - * @return string Method signature up to last - * bracket. - * @access public - */ - function getSignature($name) { - if ($name == '__set') { - return 'function __set($key, $value)'; - } - if ($name == '__call') { - return 'function __call($method, $arguments)'; - } - if (version_compare(phpversion(), '5.1.0', '>=')) { - if (in_array($name, array('__get', '__isset', $name == '__unset'))) { - return "function {$name}(\$key)"; - } - } - if ($name == '__toString') { - return "function $name()"; - } - - // This wonky try-catch is a work around for a faulty method_exists() - // in early versions of PHP 5 which would return false for static - // methods. The Reflection classes work fine, but hasMethod() - // doesn't exist prior to PHP 5.1.0, so we need to use a more crude - // detection method. - try { - $interface = new ReflectionClass($this->interface); - $interface->getMethod($name); - } catch (ReflectionException $e) { - return "function $name()"; - } - return $this->getFullSignature($name); - } - - /** - * For a signature specified in an interface, full - * details must be replicated to be a valid implementation. - * @param string $name Method name. - * @return string Method signature up to last - * bracket. - * @access private - */ - protected function getFullSignature($name) { - $interface = new ReflectionClass($this->interface); - $method = $interface->getMethod($name); - $reference = $method->returnsReference() ? '&' : ''; - $static = $method->isStatic() ? 'static ' : ''; - return "{$static}function $reference$name(" . - implode(', ', $this->getParameterSignatures($method)) . - ")"; - } - - /** - * Gets the source code for each parameter. - * @param ReflectionMethod $method Method object from - * reflection API - * @return array List of strings, each - * a snippet of code. - * @access private - */ - protected function getParameterSignatures($method) { - $signatures = array(); - foreach ($method->getParameters() as $parameter) { - $signature = ''; - $type = $parameter->getClass(); - if (is_null($type) && version_compare(phpversion(), '5.1.0', '>=') && $parameter->isArray()) { - $signature .= 'array '; - } elseif (!is_null($type)) { - $signature .= $type->getName() . ' '; - } - if ($parameter->isPassedByReference()) { - $signature .= '&'; - } - $signature .= '$' . $this->suppressSpurious($parameter->getName()); - if ($this->isOptional($parameter)) { - $signature .= ' = null'; - } - $signatures[] = $signature; - } - return $signatures; - } - - /** - * The SPL library has problems with the - * Reflection library. In particular, you can - * get extra characters in parameter names :(. - * @param string $name Parameter name. - * @return string Cleaner name. - * @access private - */ - protected function suppressSpurious($name) { - return str_replace(array('[', ']', ' '), '', $name); - } - - /** - * Test of a reflection parameter being optional - * that works with early versions of PHP5. - * @param reflectionParameter $parameter Is this optional. - * @return boolean True if optional. - * @access private - */ - protected function isOptional($parameter) { - if (method_exists($parameter, 'isOptional')) { - return $parameter->isOptional(); - } - return false; - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/remote.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/remote.php deleted file mode 100644 index 43cc40f..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/remote.php +++ /dev/null @@ -1,115 +0,0 @@ -url = $url; - $this->dry_url = $dry_url ? $dry_url : $url; - $this->size = false; - } - - /** - * Accessor for the test name for subclasses. - * @return string Name of the test. - * @access public - */ - function getLabel() { - return $this->url; - } - - /** - * Runs the top level test for this class. Currently - * reads the data as a single chunk. I'll fix this - * once I have added iteration to the browser. - * @param SimpleReporter $reporter Target of test results. - * @returns boolean True if no failures. - * @access public - */ - function run($reporter) { - $browser = $this->createBrowser(); - $xml = $browser->get($this->url); - if (! $xml) { - trigger_error('Cannot read remote test URL [' . $this->url . ']'); - return false; - } - $parser = $this->createParser($reporter); - if (! $parser->parse($xml)) { - trigger_error('Cannot parse incoming XML from [' . $this->url . ']'); - return false; - } - return true; - } - - /** - * Creates a new web browser object for fetching - * the XML report. - * @return SimpleBrowser New browser. - * @access protected - */ - protected function createBrowser() { - return new SimpleBrowser(); - } - - /** - * Creates the XML parser. - * @param SimpleReporter $reporter Target of test results. - * @return SimpleTestXmlListener XML reader. - * @access protected - */ - protected function createParser($reporter) { - return new SimpleTestXmlParser($reporter); - } - - /** - * Accessor for the number of subtests. - * @return integer Number of test cases. - * @access public - */ - function getSize() { - if ($this->size === false) { - $browser = $this->createBrowser(); - $xml = $browser->get($this->dry_url); - if (! $xml) { - trigger_error('Cannot read remote test URL [' . $this->dry_url . ']'); - return false; - } - $reporter = new SimpleReporter(); - $parser = $this->createParser($reporter); - if (! $parser->parse($xml)) { - trigger_error('Cannot parse incoming XML from [' . $this->dry_url . ']'); - return false; - } - $this->size = $reporter->getTestCaseCount(); - } - return $this->size; - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/reporter.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/reporter.php deleted file mode 100644 index aaed016..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/reporter.php +++ /dev/null @@ -1,446 +0,0 @@ -character_set = $character_set; - } - - /** - * Paints the top of the web page setting the - * title to the name of the starting test. - * @param string $test_name Name class of test. - * @access public - */ - function paintHeader($test_name) { - $this->sendNoCacheHeaders(); - print ""; - print "\n\n$test_name\n"; - print "\n"; - print "\n"; - print "\n\n"; - print "

    $test_name

    \n"; - flush(); - } - - /** - * Send the headers necessary to ensure the page is - * reloaded on every request. Otherwise you could be - * scratching your head over out of date test data. - * @access public - */ - static function sendNoCacheHeaders() { - if (! headers_sent()) { - header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - header("Cache-Control: no-store, no-cache, must-revalidate"); - header("Cache-Control: post-check=0, pre-check=0", false); - header("Pragma: no-cache"); - } - } - - /** - * Paints the CSS. Add additional styles here. - * @return string CSS code as text. - * @access protected - */ - protected function getCss() { - return ".fail { background-color: inherit; color: red; }" . - ".pass { background-color: inherit; color: green; }" . - " pre { background-color: lightgray; color: inherit; }"; - } - - /** - * Paints the end of the test with a summary of - * the passes and failures. - * @param string $test_name Name class of test. - * @access public - */ - function paintFooter($test_name) { - $colour = ($this->getFailCount() + $this->getExceptionCount() > 0 ? "red" : "green"); - print "
    "; - print $this->getTestCaseProgress() . "/" . $this->getTestCaseCount(); - print " test cases complete:\n"; - print "" . $this->getPassCount() . " passes, "; - print "" . $this->getFailCount() . " fails and "; - print "" . $this->getExceptionCount() . " exceptions."; - print "
    \n"; - print "\n\n"; - } - - /** - * Paints the test failure with a breadcrumbs - * trail of the nesting test suites below the - * top level test. - * @param string $message Failure message displayed in - * the context of the other tests. - * @access public - */ - function paintFail($message) { - parent::paintFail($message); - print "Fail: "; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - print implode(" -> ", $breadcrumb); - print " -> " . $this->htmlEntities($message) . "
    \n"; - } - - /** - * Paints a PHP error. - * @param string $message Message is ignored. - * @access public - */ - function paintError($message) { - parent::paintError($message); - print "Exception: "; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - print implode(" -> ", $breadcrumb); - print " -> " . $this->htmlEntities($message) . "
    \n"; - } - - /** - * Paints a PHP exception. - * @param Exception $exception Exception to display. - * @access public - */ - function paintException($exception) { - parent::paintException($exception); - print "Exception: "; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - print implode(" -> ", $breadcrumb); - $message = 'Unexpected exception of type [' . get_class($exception) . - '] with message ['. $exception->getMessage() . - '] in ['. $exception->getFile() . - ' line ' . $exception->getLine() . ']'; - print " -> " . $this->htmlEntities($message) . "
    \n"; - } - - /** - * Prints the message for skipping tests. - * @param string $message Text of skip condition. - * @access public - */ - function paintSkip($message) { - parent::paintSkip($message); - print "Skipped: "; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - print implode(" -> ", $breadcrumb); - print " -> " . $this->htmlEntities($message) . "
    \n"; - } - - /** - * Paints formatted text such as dumped privateiables. - * @param string $message Text to show. - * @access public - */ - function paintFormattedMessage($message) { - print '
    ' . $this->htmlEntities($message) . '
    '; - } - - /** - * Character set adjusted entity conversion. - * @param string $message Plain text or Unicode message. - * @return string Browser readable message. - * @access protected - */ - protected function htmlEntities($message) { - return htmlentities($message, ENT_COMPAT, $this->character_set); - } -} - -/** - * Sample minimal test displayer. Generates only - * failure messages and a pass count. For command - * line use. I've tried to make it look like JUnit, - * but I wanted to output the errors as they arrived - * which meant dropping the dots. - * @package SimpleTest - * @subpackage UnitTester - */ -class TextReporter extends SimpleReporter { - - /** - * Does nothing yet. The first output will - * be sent on the first test start. - * @access public - */ - function __construct() { - parent::__construct(); - } - - /** - * Paints the title only. - * @param string $test_name Name class of test. - * @access public - */ - function paintHeader($test_name) { - if (! SimpleReporter::inCli()) { - header('Content-type: text/plain'); - } - print "$test_name\n"; - flush(); - } - - /** - * Paints the end of the test with a summary of - * the passes and failures. - * @param string $test_name Name class of test. - * @access public - */ - function paintFooter($test_name) { - if ($this->getFailCount() + $this->getExceptionCount() == 0) { - print "OK\n"; - } else { - print "FAILURES!!!\n"; - } - print "Test cases run: " . $this->getTestCaseProgress() . - "/" . $this->getTestCaseCount() . - ", Passes: " . $this->getPassCount() . - ", Failures: " . $this->getFailCount() . - ", Exceptions: " . $this->getExceptionCount() . "\n"; - } - - /** - * Paints the test failure as a stack trace. - * @param string $message Failure message displayed in - * the context of the other tests. - * @access public - */ - function paintFail($message) { - parent::paintFail($message); - print $this->getFailCount() . ") $message\n"; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - print "\tin " . implode("\n\tin ", array_reverse($breadcrumb)); - print "\n"; - } - - /** - * Paints a PHP error or exception. - * @param string $message Message to be shown. - * @access public - * @abstract - */ - function paintError($message) { - parent::paintError($message); - print "Exception " . $this->getExceptionCount() . "!\n$message\n"; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - print "\tin " . implode("\n\tin ", array_reverse($breadcrumb)); - print "\n"; - } - - /** - * Paints a PHP error or exception. - * @param Exception $exception Exception to describe. - * @access public - * @abstract - */ - function paintException($exception) { - parent::paintException($exception); - $message = 'Unexpected exception of type [' . get_class($exception) . - '] with message ['. $exception->getMessage() . - '] in ['. $exception->getFile() . - ' line ' . $exception->getLine() . ']'; - print "Exception " . $this->getExceptionCount() . "!\n$message\n"; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - print "\tin " . implode("\n\tin ", array_reverse($breadcrumb)); - print "\n"; - } - - /** - * Prints the message for skipping tests. - * @param string $message Text of skip condition. - * @access public - */ - function paintSkip($message) { - parent::paintSkip($message); - print "Skip: $message\n"; - } - - /** - * Paints formatted text such as dumped privateiables. - * @param string $message Text to show. - * @access public - */ - function paintFormattedMessage($message) { - print "$message\n"; - flush(); - } -} - -/** - * Runs just a single test group, a single case or - * even a single test within that case. - * @package SimpleTest - * @subpackage UnitTester - */ -class SelectiveReporter extends SimpleReporterDecorator { - private $just_this_case = false; - private $just_this_test = false; - private $on; - - /** - * Selects the test case or group to be run, - * and optionally a specific test. - * @param SimpleScorer $reporter Reporter to receive events. - * @param string $just_this_case Only this case or group will run. - * @param string $just_this_test Only this test method will run. - */ - function __construct($reporter, $just_this_case = false, $just_this_test = false) { - if (isset($just_this_case) && $just_this_case) { - $this->just_this_case = strtolower($just_this_case); - $this->off(); - } else { - $this->on(); - } - if (isset($just_this_test) && $just_this_test) { - $this->just_this_test = strtolower($just_this_test); - } - parent::__construct($reporter); - } - - /** - * Compares criteria to actual the case/group name. - * @param string $test_case The incoming test. - * @return boolean True if matched. - * @access protected - */ - protected function matchesTestCase($test_case) { - return $this->just_this_case == strtolower($test_case); - } - - /** - * Compares criteria to actual the test name. If no - * name was specified at the beginning, then all tests - * can run. - * @param string $method The incoming test method. - * @return boolean True if matched. - * @access protected - */ - protected function shouldRunTest($test_case, $method) { - if ($this->isOn() || $this->matchesTestCase($test_case)) { - if ($this->just_this_test) { - return $this->just_this_test == strtolower($method); - } else { - return true; - } - } - return false; - } - - /** - * Switch on testing for the group or subgroup. - * @access private - */ - protected function on() { - $this->on = true; - } - - /** - * Switch off testing for the group or subgroup. - * @access private - */ - protected function off() { - $this->on = false; - } - - /** - * Is this group actually being tested? - * @return boolean True if the current test group is active. - * @access private - */ - protected function isOn() { - return $this->on; - } - - /** - * Veto everything that doesn't match the method wanted. - * @param string $test_case Name of test case. - * @param string $method Name of test method. - * @return boolean True if test should be run. - * @access public - */ - function shouldInvoke($test_case, $method) { - if ($this->shouldRunTest($test_case, $method)) { - return $this->reporter->shouldInvoke($test_case, $method); - } - return false; - } - - /** - * Paints the start of a group test. - * @param string $test_case Name of test or other label. - * @param integer $size Number of test cases starting. - * @access public - */ - function paintGroupStart($test_case, $size) { - if ($this->just_this_case && $this->matchesTestCase($test_case)) { - $this->on(); - } - $this->reporter->paintGroupStart($test_case, $size); - } - - /** - * Paints the end of a group test. - * @param string $test_case Name of test or other label. - * @access public - */ - function paintGroupEnd($test_case) { - $this->reporter->paintGroupEnd($test_case); - if ($this->just_this_case && $this->matchesTestCase($test_case)) { - $this->off(); - } - } -} - -/** - * Suppresses skip messages. - * @package SimpleTest - * @subpackage UnitTester - */ -class NoSkipsReporter extends SimpleReporterDecorator { - - /** - * Does nothing. - * @param string $message Text of skip condition. - * @access public - */ - function paintSkip($message) { } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/scorer.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/scorer.php deleted file mode 100644 index fa7c543..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/scorer.php +++ /dev/null @@ -1,862 +0,0 @@ -passes = 0; - $this->fails = 0; - $this->exceptions = 0; - $this->is_dry_run = false; - } - - /** - * Signals that the next evaluation will be a dry - * run. That is, the structure events will be - * recorded, but no tests will be run. - * @param boolean $is_dry Dry run if true. - * @access public - */ - function makeDry($is_dry = true) { - $this->is_dry_run = $is_dry; - } - - /** - * The reporter has a veto on what should be run. - * @param string $test_case_name name of test case. - * @param string $method Name of test method. - * @access public - */ - function shouldInvoke($test_case_name, $method) { - return ! $this->is_dry_run; - } - - /** - * Can wrap the invoker in preperation for running - * a test. - * @param SimpleInvoker $invoker Individual test runner. - * @return SimpleInvoker Wrapped test runner. - * @access public - */ - function createInvoker($invoker) { - return $invoker; - } - - /** - * Accessor for current status. Will be false - * if there have been any failures or exceptions. - * Used for command line tools. - * @return boolean True if no failures. - * @access public - */ - function getStatus() { - if ($this->exceptions + $this->fails > 0) { - return false; - } - return true; - } - - /** - * Paints the start of a group test. - * @param string $test_name Name of test or other label. - * @param integer $size Number of test cases starting. - * @access public - */ - function paintGroupStart($test_name, $size) { - } - - /** - * Paints the end of a group test. - * @param string $test_name Name of test or other label. - * @access public - */ - function paintGroupEnd($test_name) { - } - - /** - * Paints the start of a test case. - * @param string $test_name Name of test or other label. - * @access public - */ - function paintCaseStart($test_name) { - } - - /** - * Paints the end of a test case. - * @param string $test_name Name of test or other label. - * @access public - */ - function paintCaseEnd($test_name) { - } - - /** - * Paints the start of a test method. - * @param string $test_name Name of test or other label. - * @access public - */ - function paintMethodStart($test_name) { - } - - /** - * Paints the end of a test method. - * @param string $test_name Name of test or other label. - * @access public - */ - function paintMethodEnd($test_name) { - } - - /** - * Increments the pass count. - * @param string $message Message is ignored. - * @access public - */ - function paintPass($message) { - $this->passes++; - } - - /** - * Increments the fail count. - * @param string $message Message is ignored. - * @access public - */ - function paintFail($message) { - $this->fails++; - } - - /** - * Deals with PHP 4 throwing an error. - * @param string $message Text of error formatted by - * the test case. - * @access public - */ - function paintError($message) { - $this->exceptions++; - } - - /** - * Deals with PHP 5 throwing an exception. - * @param Exception $exception The actual exception thrown. - * @access public - */ - function paintException($exception) { - $this->exceptions++; - } - - /** - * Prints the message for skipping tests. - * @param string $message Text of skip condition. - * @access public - */ - function paintSkip($message) { - } - - /** - * Accessor for the number of passes so far. - * @return integer Number of passes. - * @access public - */ - function getPassCount() { - return $this->passes; - } - - /** - * Accessor for the number of fails so far. - * @return integer Number of fails. - * @access public - */ - function getFailCount() { - return $this->fails; - } - - /** - * Accessor for the number of untrapped errors - * so far. - * @return integer Number of exceptions. - * @access public - */ - function getExceptionCount() { - return $this->exceptions; - } - - /** - * Paints a simple supplementary message. - * @param string $message Text to display. - * @access public - */ - function paintMessage($message) { - } - - /** - * Paints a formatted ASCII message such as a - * privateiable dump. - * @param string $message Text to display. - * @access public - */ - function paintFormattedMessage($message) { - } - - /** - * By default just ignores user generated events. - * @param string $type Event type as text. - * @param mixed $payload Message or object. - * @access public - */ - function paintSignal($type, $payload) { - } -} - -/** - * Recipient of generated test messages that can display - * page footers and headers. Also keeps track of the - * test nesting. This is the main base class on which - * to build the finished test (page based) displays. - * @package SimpleTest - * @subpackage UnitTester - */ -class SimpleReporter extends SimpleScorer { - private $test_stack; - private $size; - private $progress; - - /** - * Starts the display with no results in. - * @access public - */ - function __construct() { - parent::__construct(); - $this->test_stack = array(); - $this->size = null; - $this->progress = 0; - } - - /** - * Gets the formatter for privateiables and other small - * generic data items. - * @return SimpleDumper Formatter. - * @access public - */ - function getDumper() { - return new SimpleDumper(); - } - - /** - * Paints the start of a group test. Will also paint - * the page header and footer if this is the - * first test. Will stash the size if the first - * start. - * @param string $test_name Name of test that is starting. - * @param integer $size Number of test cases starting. - * @access public - */ - function paintGroupStart($test_name, $size) { - if (! isset($this->size)) { - $this->size = $size; - } - if (count($this->test_stack) == 0) { - $this->paintHeader($test_name); - } - $this->test_stack[] = $test_name; - } - - /** - * Paints the end of a group test. Will paint the page - * footer if the stack of tests has unwound. - * @param string $test_name Name of test that is ending. - * @param integer $progress Number of test cases ending. - * @access public - */ - function paintGroupEnd($test_name) { - array_pop($this->test_stack); - if (count($this->test_stack) == 0) { - $this->paintFooter($test_name); - } - } - - /** - * Paints the start of a test case. Will also paint - * the page header and footer if this is the - * first test. Will stash the size if the first - * start. - * @param string $test_name Name of test that is starting. - * @access public - */ - function paintCaseStart($test_name) { - if (! isset($this->size)) { - $this->size = 1; - } - if (count($this->test_stack) == 0) { - $this->paintHeader($test_name); - } - $this->test_stack[] = $test_name; - } - - /** - * Paints the end of a test case. Will paint the page - * footer if the stack of tests has unwound. - * @param string $test_name Name of test that is ending. - * @access public - */ - function paintCaseEnd($test_name) { - $this->progress++; - array_pop($this->test_stack); - if (count($this->test_stack) == 0) { - $this->paintFooter($test_name); - } - } - - /** - * Paints the start of a test method. - * @param string $test_name Name of test that is starting. - * @access public - */ - function paintMethodStart($test_name) { - $this->test_stack[] = $test_name; - } - - /** - * Paints the end of a test method. Will paint the page - * footer if the stack of tests has unwound. - * @param string $test_name Name of test that is ending. - * @access public - */ - function paintMethodEnd($test_name) { - array_pop($this->test_stack); - } - - /** - * Paints the test document header. - * @param string $test_name First test top level - * to start. - * @access public - * @abstract - */ - function paintHeader($test_name) { - } - - /** - * Paints the test document footer. - * @param string $test_name The top level test. - * @access public - * @abstract - */ - function paintFooter($test_name) { - } - - /** - * Accessor for internal test stack. For - * subclasses that need to see the whole test - * history for display purposes. - * @return array List of methods in nesting order. - * @access public - */ - function getTestList() { - return $this->test_stack; - } - - /** - * Accessor for total test size in number - * of test cases. Null until the first - * test is started. - * @return integer Total number of cases at start. - * @access public - */ - function getTestCaseCount() { - return $this->size; - } - - /** - * Accessor for the number of test cases - * completed so far. - * @return integer Number of ended cases. - * @access public - */ - function getTestCaseProgress() { - return $this->progress; - } - - /** - * Static check for running in the comand line. - * @return boolean True if CLI. - * @access public - */ - static function inCli() { - return php_sapi_name() == 'cli'; - } -} - -/** - * For modifying the behaviour of the visual reporters. - * @package SimpleTest - * @subpackage UnitTester - */ -class SimpleReporterDecorator { - protected $reporter; - - /** - * Mediates between the reporter and the test case. - * @param SimpleScorer $reporter Reporter to receive events. - */ - function __construct($reporter) { - $this->reporter = $reporter; - } - - /** - * Signals that the next evaluation will be a dry - * run. That is, the structure events will be - * recorded, but no tests will be run. - * @param boolean $is_dry Dry run if true. - * @access public - */ - function makeDry($is_dry = true) { - $this->reporter->makeDry($is_dry); - } - - /** - * Accessor for current status. Will be false - * if there have been any failures or exceptions. - * Used for command line tools. - * @return boolean True if no failures. - * @access public - */ - function getStatus() { - return $this->reporter->getStatus(); - } - - /** - * The reporter has a veto on what should be run. - * @param string $test_case_name name of test case. - * @param string $method Name of test method. - * @return boolean True if test should be run. - * @access public - */ - function shouldInvoke($test_case_name, $method) { - return $this->reporter->shouldInvoke($test_case_name, $method); - } - - /** - * Can wrap the invoker in preperation for running - * a test. - * @param SimpleInvoker $invoker Individual test runner. - * @return SimpleInvoker Wrapped test runner. - * @access public - */ - function createInvoker($invoker) { - return $this->reporter->createInvoker($invoker); - } - - /** - * Gets the formatter for privateiables and other small - * generic data items. - * @return SimpleDumper Formatter. - * @access public - */ - function getDumper() { - return $this->reporter->getDumper(); - } - - /** - * Paints the start of a group test. - * @param string $test_name Name of test or other label. - * @param integer $size Number of test cases starting. - * @access public - */ - function paintGroupStart($test_name, $size) { - $this->reporter->paintGroupStart($test_name, $size); - } - - /** - * Paints the end of a group test. - * @param string $test_name Name of test or other label. - * @access public - */ - function paintGroupEnd($test_name) { - $this->reporter->paintGroupEnd($test_name); - } - - /** - * Paints the start of a test case. - * @param string $test_name Name of test or other label. - * @access public - */ - function paintCaseStart($test_name) { - $this->reporter->paintCaseStart($test_name); - } - - /** - * Paints the end of a test case. - * @param string $test_name Name of test or other label. - * @access public - */ - function paintCaseEnd($test_name) { - $this->reporter->paintCaseEnd($test_name); - } - - /** - * Paints the start of a test method. - * @param string $test_name Name of test or other label. - * @access public - */ - function paintMethodStart($test_name) { - $this->reporter->paintMethodStart($test_name); - } - - /** - * Paints the end of a test method. - * @param string $test_name Name of test or other label. - * @access public - */ - function paintMethodEnd($test_name) { - $this->reporter->paintMethodEnd($test_name); - } - - /** - * Chains to the wrapped reporter. - * @param string $message Message is ignored. - * @access public - */ - function paintPass($message) { - $this->reporter->paintPass($message); - } - - /** - * Chains to the wrapped reporter. - * @param string $message Message is ignored. - * @access public - */ - function paintFail($message) { - $this->reporter->paintFail($message); - } - - /** - * Chains to the wrapped reporter. - * @param string $message Text of error formatted by - * the test case. - * @access public - */ - function paintError($message) { - $this->reporter->paintError($message); - } - - /** - * Chains to the wrapped reporter. - * @param Exception $exception Exception to show. - * @access public - */ - function paintException($exception) { - $this->reporter->paintException($exception); - } - - /** - * Prints the message for skipping tests. - * @param string $message Text of skip condition. - * @access public - */ - function paintSkip($message) { - $this->reporter->paintSkip($message); - } - - /** - * Chains to the wrapped reporter. - * @param string $message Text to display. - * @access public - */ - function paintMessage($message) { - $this->reporter->paintMessage($message); - } - - /** - * Chains to the wrapped reporter. - * @param string $message Text to display. - * @access public - */ - function paintFormattedMessage($message) { - $this->reporter->paintFormattedMessage($message); - } - - /** - * Chains to the wrapped reporter. - * @param string $type Event type as text. - * @param mixed $payload Message or object. - * @return boolean Should return false if this - * type of signal should fail the - * test suite. - * @access public - */ - function paintSignal($type, $payload) { - $this->reporter->paintSignal($type, $payload); - } -} - -/** - * For sending messages to multiple reporters at - * the same time. - * @package SimpleTest - * @subpackage UnitTester - */ -class MultipleReporter { - private $reporters = array(); - - /** - * Adds a reporter to the subscriber list. - * @param SimpleScorer $reporter Reporter to receive events. - * @access public - */ - function attachReporter($reporter) { - $this->reporters[] = $reporter; - } - - /** - * Signals that the next evaluation will be a dry - * run. That is, the structure events will be - * recorded, but no tests will be run. - * @param boolean $is_dry Dry run if true. - * @access public - */ - function makeDry($is_dry = true) { - for ($i = 0; $i < count($this->reporters); $i++) { - $this->reporters[$i]->makeDry($is_dry); - } - } - - /** - * Accessor for current status. Will be false - * if there have been any failures or exceptions. - * If any reporter reports a failure, the whole - * suite fails. - * @return boolean True if no failures. - * @access public - */ - function getStatus() { - for ($i = 0; $i < count($this->reporters); $i++) { - if (! $this->reporters[$i]->getStatus()) { - return false; - } - } - return true; - } - - /** - * The reporter has a veto on what should be run. - * It requires all reporters to want to run the method. - * @param string $test_case_name name of test case. - * @param string $method Name of test method. - * @access public - */ - function shouldInvoke($test_case_name, $method) { - for ($i = 0; $i < count($this->reporters); $i++) { - if (! $this->reporters[$i]->shouldInvoke($test_case_name, $method)) { - return false; - } - } - return true; - } - - /** - * Every reporter gets a chance to wrap the invoker. - * @param SimpleInvoker $invoker Individual test runner. - * @return SimpleInvoker Wrapped test runner. - * @access public - */ - function createInvoker($invoker) { - for ($i = 0; $i < count($this->reporters); $i++) { - $invoker = $this->reporters[$i]->createInvoker($invoker); - } - return $invoker; - } - - /** - * Gets the formatter for privateiables and other small - * generic data items. - * @return SimpleDumper Formatter. - * @access public - */ - function getDumper() { - return new SimpleDumper(); - } - - /** - * Paints the start of a group test. - * @param string $test_name Name of test or other label. - * @param integer $size Number of test cases starting. - * @access public - */ - function paintGroupStart($test_name, $size) { - for ($i = 0; $i < count($this->reporters); $i++) { - $this->reporters[$i]->paintGroupStart($test_name, $size); - } - } - - /** - * Paints the end of a group test. - * @param string $test_name Name of test or other label. - * @access public - */ - function paintGroupEnd($test_name) { - for ($i = 0; $i < count($this->reporters); $i++) { - $this->reporters[$i]->paintGroupEnd($test_name); - } - } - - /** - * Paints the start of a test case. - * @param string $test_name Name of test or other label. - * @access public - */ - function paintCaseStart($test_name) { - for ($i = 0; $i < count($this->reporters); $i++) { - $this->reporters[$i]->paintCaseStart($test_name); - } - } - - /** - * Paints the end of a test case. - * @param string $test_name Name of test or other label. - * @access public - */ - function paintCaseEnd($test_name) { - for ($i = 0; $i < count($this->reporters); $i++) { - $this->reporters[$i]->paintCaseEnd($test_name); - } - } - - /** - * Paints the start of a test method. - * @param string $test_name Name of test or other label. - * @access public - */ - function paintMethodStart($test_name) { - for ($i = 0; $i < count($this->reporters); $i++) { - $this->reporters[$i]->paintMethodStart($test_name); - } - } - - /** - * Paints the end of a test method. - * @param string $test_name Name of test or other label. - * @access public - */ - function paintMethodEnd($test_name) { - for ($i = 0; $i < count($this->reporters); $i++) { - $this->reporters[$i]->paintMethodEnd($test_name); - } - } - - /** - * Chains to the wrapped reporter. - * @param string $message Message is ignored. - * @access public - */ - function paintPass($message) { - for ($i = 0; $i < count($this->reporters); $i++) { - $this->reporters[$i]->paintPass($message); - } - } - - /** - * Chains to the wrapped reporter. - * @param string $message Message is ignored. - * @access public - */ - function paintFail($message) { - for ($i = 0; $i < count($this->reporters); $i++) { - $this->reporters[$i]->paintFail($message); - } - } - - /** - * Chains to the wrapped reporter. - * @param string $message Text of error formatted by - * the test case. - * @access public - */ - function paintError($message) { - for ($i = 0; $i < count($this->reporters); $i++) { - $this->reporters[$i]->paintError($message); - } - } - - /** - * Chains to the wrapped reporter. - * @param Exception $exception Exception to display. - * @access public - */ - function paintException($exception) { - for ($i = 0; $i < count($this->reporters); $i++) { - $this->reporters[$i]->paintException($exception); - } - } - - /** - * Prints the message for skipping tests. - * @param string $message Text of skip condition. - * @access public - */ - function paintSkip($message) { - for ($i = 0; $i < count($this->reporters); $i++) { - $this->reporters[$i]->paintSkip($message); - } - } - - /** - * Chains to the wrapped reporter. - * @param string $message Text to display. - * @access public - */ - function paintMessage($message) { - for ($i = 0; $i < count($this->reporters); $i++) { - $this->reporters[$i]->paintMessage($message); - } - } - - /** - * Chains to the wrapped reporter. - * @param string $message Text to display. - * @access public - */ - function paintFormattedMessage($message) { - for ($i = 0; $i < count($this->reporters); $i++) { - $this->reporters[$i]->paintFormattedMessage($message); - } - } - - /** - * Chains to the wrapped reporter. - * @param string $type Event type as text. - * @param mixed $payload Message or object. - * @return boolean Should return false if this - * type of signal should fail the - * test suite. - * @access public - */ - function paintSignal($type, $payload) { - for ($i = 0; $i < count($this->reporters); $i++) { - $this->reporters[$i]->paintSignal($type, $payload); - } - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/selector.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/selector.php deleted file mode 100644 index ba2fed3..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/selector.php +++ /dev/null @@ -1,141 +0,0 @@ -name = $name; - } - - /** - * Accessor for name. - * @returns string $name Name to match. - */ - function getName() { - return $this->name; - } - - /** - * Compares with name attribute of widget. - * @param SimpleWidget $widget Control to compare. - * @access public - */ - function isMatch($widget) { - return ($widget->getName() == $this->name); - } -} - -/** - * Used to extract form elements for testing against. - * Searches by visible label or alt text. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleByLabel { - private $label; - - /** - * Stashes the name for later comparison. - * @param string $label Visible text to match. - */ - function __construct($label) { - $this->label = $label; - } - - /** - * Comparison. Compares visible text of widget or - * related label. - * @param SimpleWidget $widget Control to compare. - * @access public - */ - function isMatch($widget) { - if (! method_exists($widget, 'isLabel')) { - return false; - } - return $widget->isLabel($this->label); - } -} - -/** - * Used to extract form elements for testing against. - * Searches dy id attribute. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleById { - private $id; - - /** - * Stashes the name for later comparison. - * @param string $id ID atribute to match. - */ - function __construct($id) { - $this->id = $id; - } - - /** - * Comparison. Compares id attribute of widget. - * @param SimpleWidget $widget Control to compare. - * @access public - */ - function isMatch($widget) { - return $widget->isId($this->id); - } -} - -/** - * Used to extract form elements for testing against. - * Searches by visible label, name or alt text. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleByLabelOrName { - private $label; - - /** - * Stashes the name/label for later comparison. - * @param string $label Visible text to match. - */ - function __construct($label) { - $this->label = $label; - } - - /** - * Comparison. Compares visible text of widget or - * related label or name. - * @param SimpleWidget $widget Control to compare. - * @access public - */ - function isMatch($widget) { - if (method_exists($widget, 'isLabel')) { - if ($widget->isLabel($this->label)) { - return true; - } - } - return ($widget->getName() == $this->label); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/shell_tester.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/shell_tester.php deleted file mode 100644 index b9d3762..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/shell_tester.php +++ /dev/null @@ -1,330 +0,0 @@ -output = false; - } - - /** - * Actually runs the command. Does not trap the - * error stream output as this need PHP 4.3+. - * @param string $command The actual command line - * to run. - * @return integer Exit code. - * @access public - */ - function execute($command) { - $this->output = false; - exec($command, $this->output, $ret); - return $ret; - } - - /** - * Accessor for the last output. - * @return string Output as text. - * @access public - */ - function getOutput() { - return implode("\n", $this->output); - } - - /** - * Accessor for the last output. - * @return array Output as array of lines. - * @access public - */ - function getOutputAsList() { - return $this->output; - } -} - -/** - * Test case for testing of command line scripts and - * utilities. Usually scripts that are external to the - * PHP code, but support it in some way. - * @package SimpleTest - * @subpackage UnitTester - */ -class ShellTestCase extends SimpleTestCase { - private $current_shell; - private $last_status; - private $last_command; - - /** - * Creates an empty test case. Should be subclassed - * with test methods for a functional test case. - * @param string $label Name of test case. Will use - * the class name if none specified. - * @access public - */ - function __construct($label = false) { - parent::__construct($label); - $this->current_shell = $this->createShell(); - $this->last_status = false; - $this->last_command = ''; - } - - /** - * Executes a command and buffers the results. - * @param string $command Command to run. - * @return boolean True if zero exit code. - * @access public - */ - function execute($command) { - $shell = $this->getShell(); - $this->last_status = $shell->execute($command); - $this->last_command = $command; - return ($this->last_status === 0); - } - - /** - * Dumps the output of the last command. - * @access public - */ - function dumpOutput() { - $this->dump($this->getOutput()); - } - - /** - * Accessor for the last output. - * @return string Output as text. - * @access public - */ - function getOutput() { - $shell = $this->getShell(); - return $shell->getOutput(); - } - - /** - * Accessor for the last output. - * @return array Output as array of lines. - * @access public - */ - function getOutputAsList() { - $shell = $this->getShell(); - return $shell->getOutputAsList(); - } - - /** - * Called from within the test methods to register - * passes and failures. - * @param boolean $result Pass on true. - * @param string $message Message to display describing - * the test state. - * @return boolean True on pass - * @access public - */ - function assertTrue($result, $message = false) { - return $this->assert(new TrueExpectation(), $result, $message); - } - - /** - * Will be true on false and vice versa. False - * is the PHP definition of false, so that null, - * empty strings, zero and an empty array all count - * as false. - * @param boolean $result Pass on false. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assertFalse($result, $message = '%s') { - return $this->assert(new FalseExpectation(), $result, $message); - } - - /** - * Will trigger a pass if the two parameters have - * the same value only. Otherwise a fail. This - * is for testing hand extracted text, etc. - * @param mixed $first Value to compare. - * @param mixed $second Value to compare. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assertEqual($first, $second, $message = "%s") { - return $this->assert( - new EqualExpectation($first), - $second, - $message); - } - - /** - * Will trigger a pass if the two parameters have - * a different value. Otherwise a fail. This - * is for testing hand extracted text, etc. - * @param mixed $first Value to compare. - * @param mixed $second Value to compare. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assertNotEqual($first, $second, $message = "%s") { - return $this->assert( - new NotEqualExpectation($first), - $second, - $message); - } - - /** - * Tests the last status code from the shell. - * @param integer $status Expected status of last - * command. - * @param string $message Message to display. - * @return boolean True if pass. - * @access public - */ - function assertExitCode($status, $message = "%s") { - $message = sprintf($message, "Expected status code of [$status] from [" . - $this->last_command . "], but got [" . - $this->last_status . "]"); - return $this->assertTrue($status === $this->last_status, $message); - } - - /** - * Attempt to exactly match the combined STDERR and - * STDOUT output. - * @param string $expected Expected output. - * @param string $message Message to display. - * @return boolean True if pass. - * @access public - */ - function assertOutput($expected, $message = "%s") { - $shell = $this->getShell(); - return $this->assert( - new EqualExpectation($expected), - $shell->getOutput(), - $message); - } - - /** - * Scans the output for a Perl regex. If found - * anywhere it passes, else it fails. - * @param string $pattern Regex to search for. - * @param string $message Message to display. - * @return boolean True if pass. - * @access public - */ - function assertOutputPattern($pattern, $message = "%s") { - $shell = $this->getShell(); - return $this->assert( - new PatternExpectation($pattern), - $shell->getOutput(), - $message); - } - - /** - * If a Perl regex is found anywhere in the current - * output then a failure is generated, else a pass. - * @param string $pattern Regex to search for. - * @param $message Message to display. - * @return boolean True if pass. - * @access public - */ - function assertNoOutputPattern($pattern, $message = "%s") { - $shell = $this->getShell(); - return $this->assert( - new NoPatternExpectation($pattern), - $shell->getOutput(), - $message); - } - - /** - * File existence check. - * @param string $path Full filename and path. - * @param string $message Message to display. - * @return boolean True if pass. - * @access public - */ - function assertFileExists($path, $message = "%s") { - $message = sprintf($message, "File [$path] should exist"); - return $this->assertTrue(file_exists($path), $message); - } - - /** - * File non-existence check. - * @param string $path Full filename and path. - * @param string $message Message to display. - * @return boolean True if pass. - * @access public - */ - function assertFileNotExists($path, $message = "%s") { - $message = sprintf($message, "File [$path] should not exist"); - return $this->assertFalse(file_exists($path), $message); - } - - /** - * Scans a file for a Perl regex. If found - * anywhere it passes, else it fails. - * @param string $pattern Regex to search for. - * @param string $path Full filename and path. - * @param string $message Message to display. - * @return boolean True if pass. - * @access public - */ - function assertFilePattern($pattern, $path, $message = "%s") { - return $this->assert( - new PatternExpectation($pattern), - implode('', file($path)), - $message); - } - - /** - * If a Perl regex is found anywhere in the named - * file then a failure is generated, else a pass. - * @param string $pattern Regex to search for. - * @param string $path Full filename and path. - * @param string $message Message to display. - * @return boolean True if pass. - * @access public - */ - function assertNoFilePattern($pattern, $path, $message = "%s") { - return $this->assert( - new NoPatternExpectation($pattern), - implode('', file($path)), - $message); - } - - /** - * Accessor for current shell. Used for testing the - * the tester itself. - * @return Shell Current shell. - * @access protected - */ - protected function getShell() { - return $this->current_shell; - } - - /** - * Factory for the shell to run the command on. - * @return Shell New shell object. - * @access protected - */ - protected function createShell() { - return new SimpleShell(); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/simpletest.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/simpletest.php deleted file mode 100644 index cfdadf2..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/simpletest.php +++ /dev/null @@ -1,396 +0,0 @@ -= 0) { - require_once(dirname(__FILE__) . '/reflection_php5.php'); -} else { - require_once(dirname(__FILE__) . '/reflection_php4.php'); -} -require_once(dirname(__FILE__) . '/default_reporter.php'); -require_once(dirname(__FILE__) . '/compatibility.php'); -/**#@-*/ - -/** - * Registry and test context. Includes a few - * global options that I'm slowly getting rid of. - * @package SimpleTest - * @subpackage UnitTester - */ -class SimpleTest { - - /** - * Reads the SimpleTest version from the release file. - * @return string Version string. - * @access public - */ - static function getVersion() { - $content = file(dirname(__FILE__) . '/VERSION'); - return trim($content[0]); - } - - /** - * Sets the name of a test case to ignore, usually - * because the class is an abstract case that should - * not be run. Once PHP4 is dropped this will disappear - * as a public method and "abstract" will rule. - * @param string $class Add a class to ignore. - * @access public - */ - static function ignore($class) { - $registry = &SimpleTest::getRegistry(); - $registry['IgnoreList'][strtolower($class)] = true; - } - - /** - * Scans the now complete ignore list, and adds - * all parent classes to the list. If a class - * is not a runnable test case, then it's parents - * wouldn't be either. This is syntactic sugar - * to cut down on ommissions of ignore()'s or - * missing abstract declarations. This cannot - * be done whilst loading classes wiithout forcing - * a particular order on the class declarations and - * the ignore() calls. It's just nice to have the ignore() - * calls at the top of the file before the actual declarations. - * @param array $classes Class names of interest. - * @access public - */ - static function ignoreParentsIfIgnored($classes) { - $registry = &SimpleTest::getRegistry(); - foreach ($classes as $class) { - if (SimpleTest::isIgnored($class)) { - $reflection = new SimpleReflection($class); - if ($parent = $reflection->getParent()) { - SimpleTest::ignore($parent); - } - } - } - } - - /** - * Puts the object to the global pool of 'preferred' objects - * which can be retrieved with SimpleTest :: preferred() method. - * Instances of the same class are overwritten. - * @param object $object Preferred object - * @access public - * @see preferred() - */ - static function prefer($object) { - $registry = &SimpleTest::getRegistry(); - $registry['Preferred'][] = $object; - } - - /** - * Retrieves 'preferred' objects from global pool. Class filter - * can be applied in order to retrieve the object of the specific - * class - * @param array|string $classes Allowed classes or interfaces. - * @access public - * @return array|object|null - * @see prefer() - */ - static function preferred($classes) { - if (! is_array($classes)) { - $classes = array($classes); - } - $registry = &SimpleTest::getRegistry(); - for ($i = count($registry['Preferred']) - 1; $i >= 0; $i--) { - foreach ($classes as $class) { - if (SimpleTestCompatibility::isA($registry['Preferred'][$i], $class)) { - return $registry['Preferred'][$i]; - } - } - } - return null; - } - - /** - * Test to see if a test case is in the ignore - * list. Quite obviously the ignore list should - * be a separate object and will be one day. - * This method is internal to SimpleTest. Don't - * use it. - * @param string $class Class name to test. - * @return boolean True if should not be run. - * @access public - */ - static function isIgnored($class) { - $registry = &SimpleTest::getRegistry(); - return isset($registry['IgnoreList'][strtolower($class)]); - } - - /** - * Sets proxy to use on all requests for when - * testing from behind a firewall. Set host - * to false to disable. This will take effect - * if there are no other proxy settings. - * @param string $proxy Proxy host as URL. - * @param string $username Proxy username for authentication. - * @param string $password Proxy password for authentication. - * @access public - */ - static function useProxy($proxy, $username = false, $password = false) { - $registry = &SimpleTest::getRegistry(); - $registry['DefaultProxy'] = $proxy; - $registry['DefaultProxyUsername'] = $username; - $registry['DefaultProxyPassword'] = $password; - } - - /** - * Accessor for default proxy host. - * @return string Proxy URL. - * @access public - */ - static function getDefaultProxy() { - $registry = &SimpleTest::getRegistry(); - return $registry['DefaultProxy']; - } - - /** - * Accessor for default proxy username. - * @return string Proxy username for authentication. - * @access public - */ - static function getDefaultProxyUsername() { - $registry = &SimpleTest::getRegistry(); - return $registry['DefaultProxyUsername']; - } - - /** - * Accessor for default proxy password. - * @return string Proxy password for authentication. - * @access public - */ - static function getDefaultProxyPassword() { - $registry = &SimpleTest::getRegistry(); - return $registry['DefaultProxyPassword']; - } - - /** - * Accessor for global registry of options. - * @return hash All stored values. - * @access private - */ - protected static function &getRegistry() { - static $registry = false; - if (! $registry) { - $registry = SimpleTest::getDefaults(); - } - return $registry; - } - - /** - * Accessor for the context of the current - * test run. - * @return SimpleTestContext Current test run. - * @access public - */ - static function getContext() { - static $context = false; - if (! $context) { - $context = new SimpleTestContext(); - } - return $context; - } - - /** - * Constant default values. - * @return hash All registry defaults. - * @access private - */ - protected static function getDefaults() { - return array( - 'MockBaseClass' => 'SimpleMock', - 'IgnoreList' => array(), - 'DefaultProxy' => false, - 'DefaultProxyUsername' => false, - 'DefaultProxyPassword' => false, - 'Preferred' => array(new HtmlReporter(), new TextReporter(), new XmlReporter())); - } - - /** - * @deprecated - */ - static function setMockBaseClass($mock_base) { - $registry = &SimpleTest::getRegistry(); - $registry['MockBaseClass'] = $mock_base; - } - - /** - * @deprecated - */ - static function getMockBaseClass() { - $registry = &SimpleTest::getRegistry(); - return $registry['MockBaseClass']; - } -} - -/** - * Container for all components for a specific - * test run. Makes things like error queues - * available to PHP event handlers, and also - * gets around some nasty reference issues in - * the mocks. - * @package SimpleTest - */ -class SimpleTestContext { - private $test; - private $reporter; - private $resources; - - /** - * Clears down the current context. - * @access public - */ - function clear() { - $this->resources = array(); - } - - /** - * Sets the current test case instance. This - * global instance can be used by the mock objects - * to send message to the test cases. - * @param SimpleTestCase $test Test case to register. - * @access public - */ - function setTest($test) { - $this->clear(); - $this->test = $test; - } - - /** - * Accessor for currently running test case. - * @return SimpleTestCase Current test. - * @access public - */ - function getTest() { - return $this->test; - } - - /** - * Sets the current reporter. This - * global instance can be used by the mock objects - * to send messages. - * @param SimpleReporter $reporter Reporter to register. - * @access public - */ - function setReporter($reporter) { - $this->clear(); - $this->reporter = $reporter; - } - - /** - * Accessor for current reporter. - * @return SimpleReporter Current reporter. - * @access public - */ - function getReporter() { - return $this->reporter; - } - - /** - * Accessor for the Singleton resource. - * @return object Global resource. - * @access public - */ - function get($resource) { - if (! isset($this->resources[$resource])) { - $this->resources[$resource] = new $resource(); - } - return $this->resources[$resource]; - } -} - -/** - * Interrogates the stack trace to recover the - * failure point. - * @package SimpleTest - * @subpackage UnitTester - */ -class SimpleStackTrace { - private $prefixes; - - /** - * Stashes the list of target prefixes. - * @param array $prefixes List of method prefixes - * to search for. - */ - function __construct($prefixes) { - $this->prefixes = $prefixes; - } - - /** - * Extracts the last method name that was not within - * Simpletest itself. Captures a stack trace if none given. - * @param array $stack List of stack frames. - * @return string Snippet of test report with line - * number and file. - * @access public - */ - function traceMethod($stack = false) { - $stack = $stack ? $stack : $this->captureTrace(); - foreach ($stack as $frame) { - if ($this->frameLiesWithinSimpleTestFolder($frame)) { - continue; - } - if ($this->frameMatchesPrefix($frame)) { - return ' at [' . $frame['file'] . ' line ' . $frame['line'] . ']'; - } - } - return ''; - } - - /** - * Test to see if error is generated by SimpleTest itself. - * @param array $frame PHP stack frame. - * @return boolean True if a SimpleTest file. - * @access private - */ - protected function frameLiesWithinSimpleTestFolder($frame) { - if (isset($frame['file'])) { - $path = substr(SIMPLE_TEST, 0, -1); - if (strpos($frame['file'], $path) === 0) { - if (dirname($frame['file']) == $path) { - return true; - } - } - } - return false; - } - - /** - * Tries to determine if the method call is an assert, etc. - * @param array $frame PHP stack frame. - * @return boolean True if matches a target. - * @access private - */ - protected function frameMatchesPrefix($frame) { - foreach ($this->prefixes as $prefix) { - if (strncmp($frame['function'], $prefix, strlen($prefix)) == 0) { - return true; - } - } - return false; - } - - /** - * Grabs a current stack trace. - * @return array Fulle trace. - * @access private - */ - protected function captureTrace() { - if (function_exists('debug_backtrace')) { - return array_reverse(debug_backtrace()); - } - return array(); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/socket.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/socket.php deleted file mode 100644 index c30c877..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/socket.php +++ /dev/null @@ -1,308 +0,0 @@ -clearError(); - } - - /** - * Test for an outstanding error. - * @return boolean True if there is an error. - * @access public - */ - function isError() { - return ($this->error != ''); - } - - /** - * Accessor for an outstanding error. - * @return string Empty string if no error otherwise - * the error message. - * @access public - */ - function getError() { - return $this->error; - } - - /** - * Sets the internal error. - * @param string Error message to stash. - * @access protected - */ - function setError($error) { - $this->error = $error; - } - - /** - * Resets the error state to no error. - * @access protected - */ - function clearError() { - $this->setError(''); - } -} - -class SimpleFileSocket extends SimpleStickyError { - private $handle; - private $is_open = false; - private $sent = ''; - private $block_size; - - /** - * Opens a socket for reading and writing. - * @param SimpleUrl $file Target URI to fetch. - * @param integer $block_size Size of chunk to read. - * @access public - */ - function __construct($file, $block_size = 1024) { - parent::__construct(); - if (! ($this->handle = $this->openFile($file, $error))) { - $file_string = $file->asString(); - $this->setError("Cannot open [$file_string] with [$error]"); - return; - } - $this->is_open = true; - $this->block_size = $block_size; - } - - /** - * Writes some data to the socket and saves alocal copy. - * @param string $message String to send to socket. - * @return boolean True if successful. - * @access public - */ - function write($message) { - return true; - } - - /** - * Reads data from the socket. The error suppresion - * is a workaround for PHP4 always throwing a warning - * with a secure socket. - * @return integer/boolean Incoming bytes. False - * on error. - * @access public - */ - function read() { - $raw = @fread($this->handle, $this->block_size); - if ($raw === false) { - $this->setError('Cannot read from socket'); - $this->close(); - } - return $raw; - } - - /** - * Accessor for socket open state. - * @return boolean True if open. - * @access public - */ - function isOpen() { - return $this->is_open; - } - - /** - * Closes the socket preventing further reads. - * Cannot be reopened once closed. - * @return boolean True if successful. - * @access public - */ - function close() { - if (!$this->is_open) return false; - $this->is_open = false; - return fclose($this->handle); - } - - /** - * Accessor for content so far. - * @return string Bytes sent only. - * @access public - */ - function getSent() { - return $this->sent; - } - - /** - * Actually opens the low level socket. - * @param SimpleUrl $file SimpleUrl file target. - * @param string $error Recipient of error message. - * @param integer $timeout Maximum time to wait for connection. - * @access protected - */ - protected function openFile($file, &$error) { - return @fopen($file->asString(), 'r'); - } -} - -/** - * Wrapper for TCP/IP socket. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleSocket extends SimpleStickyError { - private $handle; - private $is_open = false; - private $sent = ''; - private $lock_size; - - /** - * Opens a socket for reading and writing. - * @param string $host Hostname to send request to. - * @param integer $port Port on remote machine to open. - * @param integer $timeout Connection timeout in seconds. - * @param integer $block_size Size of chunk to read. - * @access public - */ - function __construct($host, $port, $timeout, $block_size = 255) { - parent::__construct(); - if (! ($this->handle = $this->openSocket($host, $port, $error_number, $error, $timeout))) { - $this->setError("Cannot open [$host:$port] with [$error] within [$timeout] seconds"); - return; - } - $this->is_open = true; - $this->block_size = $block_size; - SimpleTestCompatibility::setTimeout($this->handle, $timeout); - } - - /** - * Writes some data to the socket and saves alocal copy. - * @param string $message String to send to socket. - * @return boolean True if successful. - * @access public - */ - function write($message) { - if ($this->isError() || ! $this->isOpen()) { - return false; - } - $count = fwrite($this->handle, $message); - if (! $count) { - if ($count === false) { - $this->setError('Cannot write to socket'); - $this->close(); - } - return false; - } - fflush($this->handle); - $this->sent .= $message; - return true; - } - - /** - * Reads data from the socket. The error suppresion - * is a workaround for PHP4 always throwing a warning - * with a secure socket. - * @return integer/boolean Incoming bytes. False - * on error. - * @access public - */ - function read() { - if ($this->isError() || ! $this->isOpen()) { - return false; - } - $raw = @fread($this->handle, $this->block_size); - if ($raw === false) { - $this->setError('Cannot read from socket'); - $this->close(); - } - return $raw; - } - - /** - * Accessor for socket open state. - * @return boolean True if open. - * @access public - */ - function isOpen() { - return $this->is_open; - } - - /** - * Closes the socket preventing further reads. - * Cannot be reopened once closed. - * @return boolean True if successful. - * @access public - */ - function close() { - $this->is_open = false; - return fclose($this->handle); - } - - /** - * Accessor for content so far. - * @return string Bytes sent only. - * @access public - */ - function getSent() { - return $this->sent; - } - - /** - * Actually opens the low level socket. - * @param string $host Host to connect to. - * @param integer $port Port on host. - * @param integer $error_number Recipient of error code. - * @param string $error Recipoent of error message. - * @param integer $timeout Maximum time to wait for connection. - * @access protected - */ - protected function openSocket($host, $port, &$error_number, &$error, $timeout) { - return @fsockopen($host, $port, $error_number, $error, $timeout); - } -} - -/** - * Wrapper for TCP/IP socket over TLS. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleSecureSocket extends SimpleSocket { - - /** - * Opens a secure socket for reading and writing. - * @param string $host Hostname to send request to. - * @param integer $port Port on remote machine to open. - * @param integer $timeout Connection timeout in seconds. - * @access public - */ - function __construct($host, $port, $timeout) { - parent::__construct($host, $port, $timeout); - } - - /** - * Actually opens the low level socket. - * @param string $host Host to connect to. - * @param integer $port Port on host. - * @param integer $error_number Recipient of error code. - * @param string $error Recipient of error message. - * @param integer $timeout Maximum time to wait for connection. - * @access protected - */ - function openSocket($host, $port, &$error_number, &$error, $timeout) { - return parent::openSocket("tls://$host", $port, $error_number, $error, $timeout); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tag.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tag.php deleted file mode 100644 index c30417d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tag.php +++ /dev/null @@ -1,1418 +0,0 @@ -name = strtolower(trim($name)); - $this->attributes = $attributes; - $this->content = ''; - } - - /** - * Check to see if the tag can have both start and - * end tags with content in between. - * @return boolean True if content allowed. - * @access public - */ - function expectEndTag() { - return true; - } - - /** - * The current tag should not swallow all content for - * itself as it's searchable page content. Private - * content tags are usually widgets that contain default - * values. - * @return boolean False as content is available - * to other tags by default. - * @access public - */ - function isPrivateContent() { - return false; - } - - /** - * Appends string content to the current content. - * @param string $content Additional text. - * @access public - */ - function addContent($content) { - $this->content .= (string)$content; - } - - /** - * Adds an enclosed tag to the content. - * @param SimpleTag $tag New tag. - * @access public - */ - function addTag($tag) { - } - - /** - * Accessor for tag name. - * @return string Name of tag. - * @access public - */ - function getTagName() { - return $this->name; - } - - /** - * List of legal child elements. - * @return array List of element names. - * @access public - */ - function getChildElements() { - return array(); - } - - /** - * Accessor for an attribute. - * @param string $label Attribute name. - * @return string Attribute value. - * @access public - */ - function getAttribute($label) { - $label = strtolower($label); - if (! isset($this->attributes[$label])) { - return false; - } - return (string)$this->attributes[$label]; - } - - /** - * Sets an attribute. - * @param string $label Attribute name. - * @return string $value New attribute value. - * @access protected - */ - protected function setAttribute($label, $value) { - $this->attributes[strtolower($label)] = $value; - } - - /** - * Accessor for the whole content so far. - * @return string Content as big raw string. - * @access public - */ - function getContent() { - return $this->content; - } - - /** - * Accessor for content reduced to visible text. Acts - * like a text mode browser, normalising space and - * reducing images to their alt text. - * @return string Content as plain text. - * @access public - */ - function getText() { - return SimpleHtmlSaxParser::normalise($this->content); - } - - /** - * Test to see if id attribute matches. - * @param string $id ID to test against. - * @return boolean True on match. - * @access public - */ - function isId($id) { - return ($this->getAttribute('id') == $id); - } -} - -/** - * Base url. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleBaseTag extends SimpleTag { - - /** - * Starts with a named tag with attributes only. - * @param hash $attributes Attribute names and - * string values. - */ - function __construct($attributes) { - parent::__construct('base', $attributes); - } - - /** - * Base tag is not a block tag. - * @return boolean false - * @access public - */ - function expectEndTag() { - return false; - } -} - -/** - * Page title. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleTitleTag extends SimpleTag { - - /** - * Starts with a named tag with attributes only. - * @param hash $attributes Attribute names and - * string values. - */ - function __construct($attributes) { - parent::__construct('title', $attributes); - } -} - -/** - * Link. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleAnchorTag extends SimpleTag { - - /** - * Starts with a named tag with attributes only. - * @param hash $attributes Attribute names and - * string values. - */ - function __construct($attributes) { - parent::__construct('a', $attributes); - } - - /** - * Accessor for URL as string. - * @return string Coerced as string. - * @access public - */ - function getHref() { - $url = $this->getAttribute('href'); - if (is_bool($url)) { - $url = ''; - } - return $url; - } -} - -/** - * Form element. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleWidget extends SimpleTag { - private $value; - private $label; - private $is_set; - - /** - * Starts with a named tag with attributes only. - * @param string $name Tag name. - * @param hash $attributes Attribute names and - * string values. - */ - function __construct($name, $attributes) { - parent::__construct($name, $attributes); - $this->value = false; - $this->label = false; - $this->is_set = false; - } - - /** - * Accessor for name submitted as the key in - * GET/POST privateiables hash. - * @return string Parsed value. - * @access public - */ - function getName() { - return $this->getAttribute('name'); - } - - /** - * Accessor for default value parsed with the tag. - * @return string Parsed value. - * @access public - */ - function getDefault() { - return $this->getAttribute('value'); - } - - /** - * Accessor for currently set value or default if - * none. - * @return string Value set by form or default - * if none. - * @access public - */ - function getValue() { - if (! $this->is_set) { - return $this->getDefault(); - } - return $this->value; - } - - /** - * Sets the current form element value. - * @param string $value New value. - * @return boolean True if allowed. - * @access public - */ - function setValue($value) { - $this->value = $value; - $this->is_set = true; - return true; - } - - /** - * Resets the form element value back to the - * default. - * @access public - */ - function resetValue() { - $this->is_set = false; - } - - /** - * Allows setting of a label externally, say by a - * label tag. - * @param string $label Label to attach. - * @access public - */ - function setLabel($label) { - $this->label = trim($label); - } - - /** - * Reads external or internal label. - * @param string $label Label to test. - * @return boolean True is match. - * @access public - */ - function isLabel($label) { - return $this->label == trim($label); - } - - /** - * Dispatches the value into the form encoded packet. - * @param SimpleEncoding $encoding Form packet. - * @access public - */ - function write($encoding) { - if ($this->getName()) { - $encoding->add($this->getName(), $this->getValue()); - } - } -} - -/** - * Text, password and hidden field. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleTextTag extends SimpleWidget { - - /** - * Starts with a named tag with attributes only. - * @param hash $attributes Attribute names and - * string values. - */ - function __construct($attributes) { - parent::__construct('input', $attributes); - if ($this->getAttribute('value') === false) { - $this->setAttribute('value', ''); - } - } - - /** - * Tag contains no content. - * @return boolean False. - * @access public - */ - function expectEndTag() { - return false; - } - - /** - * Sets the current form element value. Cannot - * change the value of a hidden field. - * @param string $value New value. - * @return boolean True if allowed. - * @access public - */ - function setValue($value) { - if ($this->getAttribute('type') == 'hidden') { - return false; - } - return parent::setValue($value); - } -} - -/** - * Submit button as input tag. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleSubmitTag extends SimpleWidget { - - /** - * Starts with a named tag with attributes only. - * @param hash $attributes Attribute names and - * string values. - */ - function __construct($attributes) { - parent::__construct('input', $attributes); - if ($this->getAttribute('value') === false) { - $this->setAttribute('value', 'Submit'); - } - } - - /** - * Tag contains no end element. - * @return boolean False. - * @access public - */ - function expectEndTag() { - return false; - } - - /** - * Disables the setting of the button value. - * @param string $value Ignored. - * @return boolean True if allowed. - * @access public - */ - function setValue($value) { - return false; - } - - /** - * Value of browser visible text. - * @return string Visible label. - * @access public - */ - function getLabel() { - return $this->getValue(); - } - - /** - * Test for a label match when searching. - * @param string $label Label to test. - * @return boolean True on match. - * @access public - */ - function isLabel($label) { - return trim($label) == trim($this->getLabel()); - } -} - -/** - * Image button as input tag. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleImageSubmitTag extends SimpleWidget { - - /** - * Starts with a named tag with attributes only. - * @param hash $attributes Attribute names and - * string values. - */ - function __construct($attributes) { - parent::__construct('input', $attributes); - } - - /** - * Tag contains no end element. - * @return boolean False. - * @access public - */ - function expectEndTag() { - return false; - } - - /** - * Disables the setting of the button value. - * @param string $value Ignored. - * @return boolean True if allowed. - * @access public - */ - function setValue($value) { - return false; - } - - /** - * Value of browser visible text. - * @return string Visible label. - * @access public - */ - function getLabel() { - if ($this->getAttribute('title')) { - return $this->getAttribute('title'); - } - return $this->getAttribute('alt'); - } - - /** - * Test for a label match when searching. - * @param string $label Label to test. - * @return boolean True on match. - * @access public - */ - function isLabel($label) { - return trim($label) == trim($this->getLabel()); - } - - /** - * Dispatches the value into the form encoded packet. - * @param SimpleEncoding $encoding Form packet. - * @param integer $x X coordinate of click. - * @param integer $y Y coordinate of click. - * @access public - */ - function write($encoding, $x = 1, $y = 1) { - if ($this->getName()) { - $encoding->add($this->getName() . '.x', $x); - $encoding->add($this->getName() . '.y', $y); - } else { - $encoding->add('x', $x); - $encoding->add('y', $y); - } - } -} - -/** - * Submit button as button tag. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleButtonTag extends SimpleWidget { - - /** - * Starts with a named tag with attributes only. - * Defaults are very browser dependent. - * @param hash $attributes Attribute names and - * string values. - */ - function __construct($attributes) { - parent::__construct('button', $attributes); - } - - /** - * Check to see if the tag can have both start and - * end tags with content in between. - * @return boolean True if content allowed. - * @access public - */ - function expectEndTag() { - return true; - } - - /** - * Disables the setting of the button value. - * @param string $value Ignored. - * @return boolean True if allowed. - * @access public - */ - function setValue($value) { - return false; - } - - /** - * Value of browser visible text. - * @return string Visible label. - * @access public - */ - function getLabel() { - return $this->getContent(); - } - - /** - * Test for a label match when searching. - * @param string $label Label to test. - * @return boolean True on match. - * @access public - */ - function isLabel($label) { - return trim($label) == trim($this->getLabel()); - } -} - -/** - * Content tag for text area. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleTextAreaTag extends SimpleWidget { - - /** - * Starts with a named tag with attributes only. - * @param hash $attributes Attribute names and - * string values. - */ - function __construct($attributes) { - parent::__construct('textarea', $attributes); - } - - /** - * Accessor for starting value. - * @return string Parsed value. - * @access public - */ - function getDefault() { - return $this->wrap(SimpleHtmlSaxParser::decodeHtml($this->getContent())); - } - - /** - * Applies word wrapping if needed. - * @param string $value New value. - * @return boolean True if allowed. - * @access public - */ - function setValue($value) { - return parent::setValue($this->wrap($value)); - } - - /** - * Test to see if text should be wrapped. - * @return boolean True if wrapping on. - * @access private - */ - function wrapIsEnabled() { - if ($this->getAttribute('cols')) { - $wrap = $this->getAttribute('wrap'); - if (($wrap == 'physical') || ($wrap == 'hard')) { - return true; - } - } - return false; - } - - /** - * Performs the formatting that is peculiar to - * this tag. There is strange behaviour in this - * one, including stripping a leading new line. - * Go figure. I am using Firefox as a guide. - * @param string $text Text to wrap. - * @return string Text wrapped with carriage - * returns and line feeds - * @access private - */ - protected function wrap($text) { - $text = str_replace("\r\r\n", "\r\n", str_replace("\n", "\r\n", $text)); - $text = str_replace("\r\n\n", "\r\n", str_replace("\r", "\r\n", $text)); - if (strncmp($text, "\r\n", strlen("\r\n")) == 0) { - $text = substr($text, strlen("\r\n")); - } - if ($this->wrapIsEnabled()) { - return wordwrap( - $text, - (integer)$this->getAttribute('cols'), - "\r\n"); - } - return $text; - } - - /** - * The content of textarea is not part of the page. - * @return boolean True. - * @access public - */ - function isPrivateContent() { - return true; - } -} - -/** - * File upload widget. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleUploadTag extends SimpleWidget { - - /** - * Starts with attributes only. - * @param hash $attributes Attribute names and - * string values. - */ - function __construct($attributes) { - parent::__construct('input', $attributes); - } - - /** - * Tag contains no content. - * @return boolean False. - * @access public - */ - function expectEndTag() { - return false; - } - - /** - * Dispatches the value into the form encoded packet. - * @param SimpleEncoding $encoding Form packet. - * @access public - */ - function write($encoding) { - if (! file_exists($this->getValue())) { - return; - } - $encoding->attach( - $this->getName(), - implode('', file($this->getValue())), - basename($this->getValue())); - } -} - -/** - * Drop down widget. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleSelectionTag extends SimpleWidget { - private $options; - private $choice; - - /** - * Starts with attributes only. - * @param hash $attributes Attribute names and - * string values. - */ - function __construct($attributes) { - parent::__construct('select', $attributes); - $this->options = array(); - $this->choice = false; - } - - /** - * Adds an option tag to a selection field. - * @param SimpleOptionTag $tag New option. - * @access public - */ - function addTag($tag) { - if ($tag->getTagName() == 'option') { - $this->options[] = $tag; - } - } - - /** - * Text within the selection element is ignored. - * @param string $content Ignored. - * @access public - */ - function addContent($content) { - } - - /** - * Scans options for defaults. If none, then - * the first option is selected. - * @return string Selected field. - * @access public - */ - function getDefault() { - for ($i = 0, $count = count($this->options); $i < $count; $i++) { - if ($this->options[$i]->getAttribute('selected') !== false) { - return $this->options[$i]->getDefault(); - } - } - if ($count > 0) { - return $this->options[0]->getDefault(); - } - return ''; - } - - /** - * Can only set allowed values. - * @param string $value New choice. - * @return boolean True if allowed. - * @access public - */ - function setValue($value) { - for ($i = 0, $count = count($this->options); $i < $count; $i++) { - if ($this->options[$i]->isValue($value)) { - $this->choice = $i; - return true; - } - } - return false; - } - - /** - * Accessor for current selection value. - * @return string Value attribute or - * content of opton. - * @access public - */ - function getValue() { - if ($this->choice === false) { - return $this->getDefault(); - } - return $this->options[$this->choice]->getValue(); - } -} - -/** - * Drop down widget. - * @package SimpleTest - * @subpackage WebTester - */ -class MultipleSelectionTag extends SimpleWidget { - private $options; - private $values; - - /** - * Starts with attributes only. - * @param hash $attributes Attribute names and - * string values. - */ - function __construct($attributes) { - parent::__construct('select', $attributes); - $this->options = array(); - $this->values = false; - } - - /** - * Adds an option tag to a selection field. - * @param SimpleOptionTag $tag New option. - * @access public - */ - function addTag($tag) { - if ($tag->getTagName() == 'option') { - $this->options[] = &$tag; - } - } - - /** - * Text within the selection element is ignored. - * @param string $content Ignored. - * @access public - */ - function addContent($content) { - } - - /** - * Scans options for defaults to populate the - * value array(). - * @return array Selected fields. - * @access public - */ - function getDefault() { - $default = array(); - for ($i = 0, $count = count($this->options); $i < $count; $i++) { - if ($this->options[$i]->getAttribute('selected') !== false) { - $default[] = $this->options[$i]->getDefault(); - } - } - return $default; - } - - /** - * Can only set allowed values. Any illegal value - * will result in a failure, but all correct values - * will be set. - * @param array $desired New choices. - * @return boolean True if all allowed. - * @access public - */ - function setValue($desired) { - $achieved = array(); - foreach ($desired as $value) { - $success = false; - for ($i = 0, $count = count($this->options); $i < $count; $i++) { - if ($this->options[$i]->isValue($value)) { - $achieved[] = $this->options[$i]->getValue(); - $success = true; - break; - } - } - if (! $success) { - return false; - } - } - $this->values = $achieved; - return true; - } - - /** - * Accessor for current selection value. - * @return array List of currently set options. - * @access public - */ - function getValue() { - if ($this->values === false) { - return $this->getDefault(); - } - return $this->values; - } -} - -/** - * Option for selection field. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleOptionTag extends SimpleWidget { - - /** - * Stashes the attributes. - */ - function __construct($attributes) { - parent::__construct('option', $attributes); - } - - /** - * Does nothing. - * @param string $value Ignored. - * @return boolean Not allowed. - * @access public - */ - function setValue($value) { - return false; - } - - /** - * Test to see if a value matches the option. - * @param string $compare Value to compare with. - * @return boolean True if possible match. - * @access public - */ - function isValue($compare) { - $compare = trim($compare); - if (trim($this->getValue()) == $compare) { - return true; - } - return trim($this->getContent()) == $compare; - } - - /** - * Accessor for starting value. Will be set to - * the option label if no value exists. - * @return string Parsed value. - * @access public - */ - function getDefault() { - if ($this->getAttribute('value') === false) { - return $this->getContent(); - } - return $this->getAttribute('value'); - } - - /** - * The content of options is not part of the page. - * @return boolean True. - * @access public - */ - function isPrivateContent() { - return true; - } -} - -/** - * Radio button. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleRadioButtonTag extends SimpleWidget { - - /** - * Stashes the attributes. - * @param array $attributes Hash of attributes. - */ - function __construct($attributes) { - parent::__construct('input', $attributes); - if ($this->getAttribute('value') === false) { - $this->setAttribute('value', 'on'); - } - } - - /** - * Tag contains no content. - * @return boolean False. - * @access public - */ - function expectEndTag() { - return false; - } - - /** - * The only allowed value sn the one in the - * "value" attribute. - * @param string $value New value. - * @return boolean True if allowed. - * @access public - */ - function setValue($value) { - if ($value === false) { - return parent::setValue($value); - } - if ($value != $this->getAttribute('value')) { - return false; - } - return parent::setValue($value); - } - - /** - * Accessor for starting value. - * @return string Parsed value. - * @access public - */ - function getDefault() { - if ($this->getAttribute('checked') !== false) { - return $this->getAttribute('value'); - } - return false; - } -} - -/** - * Checkbox widget. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleCheckboxTag extends SimpleWidget { - - /** - * Starts with attributes only. - * @param hash $attributes Attribute names and - * string values. - */ - function __construct($attributes) { - parent::__construct('input', $attributes); - if ($this->getAttribute('value') === false) { - $this->setAttribute('value', 'on'); - } - } - - /** - * Tag contains no content. - * @return boolean False. - * @access public - */ - function expectEndTag() { - return false; - } - - /** - * The only allowed value in the one in the - * "value" attribute. The default for this - * attribute is "on". If this widget is set to - * true, then the usual value will be taken. - * @param string $value New value. - * @return boolean True if allowed. - * @access public - */ - function setValue($value) { - if ($value === false) { - return parent::setValue($value); - } - if ($value === true) { - return parent::setValue($this->getAttribute('value')); - } - if ($value != $this->getAttribute('value')) { - return false; - } - return parent::setValue($value); - } - - /** - * Accessor for starting value. The default - * value is "on". - * @return string Parsed value. - * @access public - */ - function getDefault() { - if ($this->getAttribute('checked') !== false) { - return $this->getAttribute('value'); - } - return false; - } -} - -/** - * A group of multiple widgets with some shared behaviour. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleTagGroup { - private $widgets = array(); - - /** - * Adds a tag to the group. - * @param SimpleWidget $widget - * @access public - */ - function addWidget($widget) { - $this->widgets[] = $widget; - } - - /** - * Accessor to widget set. - * @return array All widgets. - * @access protected - */ - protected function &getWidgets() { - return $this->widgets; - } - - /** - * Accessor for an attribute. - * @param string $label Attribute name. - * @return boolean Always false. - * @access public - */ - function getAttribute($label) { - return false; - } - - /** - * Fetches the name for the widget from the first - * member. - * @return string Name of widget. - * @access public - */ - function getName() { - if (count($this->widgets) > 0) { - return $this->widgets[0]->getName(); - } - } - - /** - * Scans the widgets for one with the appropriate - * ID field. - * @param string $id ID value to try. - * @return boolean True if matched. - * @access public - */ - function isId($id) { - for ($i = 0, $count = count($this->widgets); $i < $count; $i++) { - if ($this->widgets[$i]->isId($id)) { - return true; - } - } - return false; - } - - /** - * Scans the widgets for one with the appropriate - * attached label. - * @param string $label Attached label to try. - * @return boolean True if matched. - * @access public - */ - function isLabel($label) { - for ($i = 0, $count = count($this->widgets); $i < $count; $i++) { - if ($this->widgets[$i]->isLabel($label)) { - return true; - } - } - return false; - } - - /** - * Dispatches the value into the form encoded packet. - * @param SimpleEncoding $encoding Form packet. - * @access public - */ - function write($encoding) { - $encoding->add($this->getName(), $this->getValue()); - } -} - -/** - * A group of tags with the same name within a form. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleCheckboxGroup extends SimpleTagGroup { - - /** - * Accessor for current selected widget or false - * if none. - * @return string/array Widget values or false if none. - * @access public - */ - function getValue() { - $values = array(); - $widgets = $this->getWidgets(); - for ($i = 0, $count = count($widgets); $i < $count; $i++) { - if ($widgets[$i]->getValue() !== false) { - $values[] = $widgets[$i]->getValue(); - } - } - return $this->coerceValues($values); - } - - /** - * Accessor for starting value that is active. - * @return string/array Widget values or false if none. - * @access public - */ - function getDefault() { - $values = array(); - $widgets = $this->getWidgets(); - for ($i = 0, $count = count($widgets); $i < $count; $i++) { - if ($widgets[$i]->getDefault() !== false) { - $values[] = $widgets[$i]->getDefault(); - } - } - return $this->coerceValues($values); - } - - /** - * Accessor for current set values. - * @param string/array/boolean $values Either a single string, a - * hash or false for nothing set. - * @return boolean True if all values can be set. - * @access public - */ - function setValue($values) { - $values = $this->makeArray($values); - if (! $this->valuesArePossible($values)) { - return false; - } - $widgets = $this->getWidgets(); - for ($i = 0, $count = count($widgets); $i < $count; $i++) { - $possible = $widgets[$i]->getAttribute('value'); - if (in_array($widgets[$i]->getAttribute('value'), $values)) { - $widgets[$i]->setValue($possible); - } else { - $widgets[$i]->setValue(false); - } - } - return true; - } - - /** - * Tests to see if a possible value set is legal. - * @param string/array/boolean $values Either a single string, a - * hash or false for nothing set. - * @return boolean False if trying to set a - * missing value. - * @access private - */ - protected function valuesArePossible($values) { - $matches = array(); - $widgets = &$this->getWidgets(); - for ($i = 0, $count = count($widgets); $i < $count; $i++) { - $possible = $widgets[$i]->getAttribute('value'); - if (in_array($possible, $values)) { - $matches[] = $possible; - } - } - return ($values == $matches); - } - - /** - * Converts the output to an appropriate format. This means - * that no values is false, a single value is just that - * value and only two or more are contained in an array. - * @param array $values List of values of widgets. - * @return string/array/boolean Expected format for a tag. - * @access private - */ - protected function coerceValues($values) { - if (count($values) == 0) { - return false; - } elseif (count($values) == 1) { - return $values[0]; - } else { - return $values; - } - } - - /** - * Converts false or string into array. The opposite of - * the coercian method. - * @param string/array/boolean $value A single item is converted - * to a one item list. False - * gives an empty list. - * @return array List of values, possibly empty. - * @access private - */ - protected function makeArray($value) { - if ($value === false) { - return array(); - } - if (is_string($value)) { - return array($value); - } - return $value; - } -} - -/** - * A group of tags with the same name within a form. - * Used for radio buttons. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleRadioGroup extends SimpleTagGroup { - - /** - * Each tag is tried in turn until one is - * successfully set. The others will be - * unchecked if successful. - * @param string $value New value. - * @return boolean True if any allowed. - * @access public - */ - function setValue($value) { - if (! $this->valueIsPossible($value)) { - return false; - } - $index = false; - $widgets = $this->getWidgets(); - for ($i = 0, $count = count($widgets); $i < $count; $i++) { - if (! $widgets[$i]->setValue($value)) { - $widgets[$i]->setValue(false); - } - } - return true; - } - - /** - * Tests to see if a value is allowed. - * @param string Attempted value. - * @return boolean True if a valid value. - * @access private - */ - protected function valueIsPossible($value) { - $widgets = $this->getWidgets(); - for ($i = 0, $count = count($widgets); $i < $count; $i++) { - if ($widgets[$i]->getAttribute('value') == $value) { - return true; - } - } - return false; - } - - /** - * Accessor for current selected widget or false - * if none. - * @return string/boolean Value attribute or - * content of opton. - * @access public - */ - function getValue() { - $widgets = $this->getWidgets(); - for ($i = 0, $count = count($widgets); $i < $count; $i++) { - if ($widgets[$i]->getValue() !== false) { - return $widgets[$i]->getValue(); - } - } - return false; - } - - /** - * Accessor for starting value that is active. - * @return string/boolean Value of first checked - * widget or false if none. - * @access public - */ - function getDefault() { - $widgets = $this->getWidgets(); - for ($i = 0, $count = count($widgets); $i < $count; $i++) { - if ($widgets[$i]->getDefault() !== false) { - return $widgets[$i]->getDefault(); - } - } - return false; - } -} - -/** - * Tag to keep track of labels. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleLabelTag extends SimpleTag { - - /** - * Starts with a named tag with attributes only. - * @param hash $attributes Attribute names and - * string values. - */ - function __construct($attributes) { - parent::__construct('label', $attributes); - } - - /** - * Access for the ID to attach the label to. - * @return string For attribute. - * @access public - */ - function getFor() { - return $this->getAttribute('for'); - } -} - -/** - * Tag to aid parsing the form. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleFormTag extends SimpleTag { - - /** - * Starts with a named tag with attributes only. - * @param hash $attributes Attribute names and - * string values. - */ - function __construct($attributes) { - parent::__construct('form', $attributes); - } -} - -/** - * Tag to aid parsing the frames in a page. - * @package SimpleTest - * @subpackage WebTester - */ -class SimpleFrameTag extends SimpleTag { - - /** - * Starts with a named tag with attributes only. - * @param hash $attributes Attribute names and - * string values. - */ - function __construct($attributes) { - parent::__construct('frame', $attributes); - } - - /** - * Tag contains no content. - * @return boolean False. - * @access public - */ - function expectEndTag() { - return false; - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/acceptance_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/acceptance_test.php deleted file mode 100644 index aada433..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/acceptance_test.php +++ /dev/null @@ -1,1653 +0,0 @@ -addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - $this->assertTrue($browser->get($this->samples() . 'network_confirm.php')); - $this->assertPattern('/target for the SimpleTest/', $browser->getContent()); - $this->assertPattern('/Request method.*?
    GET<\/dd>/', $browser->getContent()); - $this->assertEqual($browser->getTitle(), 'Simple test target file'); - $this->assertEqual($browser->getResponseCode(), 200); - $this->assertEqual($browser->getMimeType(), 'text/html'); - } - - function testPost() { - $browser = new SimpleBrowser(); - $browser->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - $this->assertTrue($browser->post($this->samples() . 'network_confirm.php')); - $this->assertPattern('/target for the SimpleTest/', $browser->getContent()); - $this->assertPattern('/Request method.*?
    POST<\/dd>/', $browser->getContent()); - } - - function testAbsoluteLinkFollowing() { - $browser = new SimpleBrowser(); - $browser->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - $browser->get($this->samples() . 'link_confirm.php'); - $this->assertTrue($browser->clickLink('Absolute')); - $this->assertPattern('/target for the SimpleTest/', $browser->getContent()); - } - - function testRelativeEncodedeLinkFollowing() { - $browser = new SimpleBrowser(); - $browser->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - $browser->get($this->samples() . 'link_confirm.php'); - $this->assertTrue($browser->clickLink("m�rc�l kiek'eboe")); - $this->assertPattern('/target for the SimpleTest/', $browser->getContent()); - } - - function testRelativeLinkFollowing() { - $browser = new SimpleBrowser(); - $browser->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - $browser->get($this->samples() . 'link_confirm.php'); - $this->assertTrue($browser->clickLink('Relative')); - $this->assertPattern('/target for the SimpleTest/', $browser->getContent()); - } - - function testUnifiedClickLinkClicking() { - $browser = new SimpleBrowser(); - $browser->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - $browser->get($this->samples() . 'link_confirm.php'); - $this->assertTrue($browser->click('Relative')); - $this->assertPattern('/target for the SimpleTest/', $browser->getContent()); - } - - function testIdLinkFollowing() { - $browser = new SimpleBrowser(); - $browser->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - $browser->get($this->samples() . 'link_confirm.php'); - $this->assertTrue($browser->clickLinkById(1)); - $this->assertPattern('/target for the SimpleTest/', $browser->getContent()); - } - - function testCookieReading() { - $browser = new SimpleBrowser(); - $browser->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - $browser->get($this->samples() . 'set_cookies.php'); - $this->assertEqual($browser->getCurrentCookieValue('session_cookie'), 'A'); - $this->assertEqual($browser->getCurrentCookieValue('short_cookie'), 'B'); - $this->assertEqual($browser->getCurrentCookieValue('day_cookie'), 'C'); - } - - function testSimpleSubmit() { - $browser = new SimpleBrowser(); - $browser->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - $browser->get($this->samples() . 'form.html'); - $this->assertTrue($browser->clickSubmit('Go!')); - $this->assertPattern('/Request method.*?
    POST<\/dd>/', $browser->getContent()); - $this->assertPattern('/go=\[Go!\]/', $browser->getContent()); - } - - function testUnifiedClickCanSubmit() { - $browser = new SimpleBrowser(); - $browser->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - $browser->get($this->samples() . 'form.html'); - $this->assertTrue($browser->click('Go!')); - $this->assertPattern('/go=\[Go!\]/', $browser->getContent()); - } -} - -class TestOfLocalFileBrowser extends UnitTestCase { - function samples() { - return 'file://'.dirname(__FILE__).'/site/'; - } - - function testGet() { - $browser = new SimpleBrowser(); - $browser->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - $this->assertTrue($browser->get($this->samples() . 'file.html')); - $this->assertPattern('/Link to SimpleTest/', $browser->getContent()); - $this->assertEqual($browser->getTitle(), 'Link to SimpleTest'); - $this->assertFalse($browser->getResponseCode()); - $this->assertEqual($browser->getMimeType(), ''); - } -} - -class TestRadioFields extends SimpleTestAcceptanceTest { - function testSetFieldAsInteger() { - $this->get($this->samples() . 'form_with_radio_buttons.html'); - $this->assertTrue($this->setField('tested_field', 2)); - $this->clickSubmitByName('send'); - $this->assertEqual($this->getUrl(), $this->samples() . 'form_with_radio_buttons.html?tested_field=2&send=click+me'); - } - - function testSetFieldAsString() { - $this->get($this->samples() . 'form_with_radio_buttons.html'); - $this->assertTrue($this->setField('tested_field', '2')); - $this->clickSubmitByName('send'); - $this->assertEqual($this->getUrl(), $this->samples() . 'form_with_radio_buttons.html?tested_field=2&send=click+me'); - } -} - -class TestOfLiveFetching extends SimpleTestAcceptanceTest { - function setUp() { - $this->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - } - - function testFormWithArrayBasedInputs() { - $this->get($this->samples() . 'form_with_array_based_inputs.php'); - $this->setField('value[]', '3', '1'); - $this->setField('value[]', '4', '2'); - $this->clickSubmit('Go'); - $this->assertPattern('/QUERY_STRING : value%5B%5D=3&value%5B%5D=4&submit=Go/'); - } - - function testFormWithQuotedValues() { - $this->get($this->samples() . 'form_with_quoted_values.php'); - $this->assertField('a', 'default'); - $this->assertFieldById('text_field', 'default'); - $this->clickSubmit('Go'); - $this->assertPattern('/a=default&submit=Go/'); - } - - function testGet() { - $this->assertTrue($this->get($this->samples() . 'network_confirm.php')); - $this->assertEqual($this->getUrl(), $this->samples() . 'network_confirm.php'); - $this->assertText('target for the SimpleTest'); - $this->assertPattern('/Request method.*?
    GET<\/dd>/'); - $this->assertTitle('Simple test target file'); - $this->assertTitle(new PatternExpectation('/target file/')); - $this->assertResponse(200); - $this->assertMime('text/html'); - $this->assertHeader('connection', 'close'); - $this->assertHeader('connection', new PatternExpectation('/los/')); - } - - function testSlowGet() { - $this->assertTrue($this->get($this->samples() . 'slow_page.php')); - } - - function testTimedOutGet() { - $this->setConnectionTimeout(1); - $this->ignoreErrors(); - $this->assertFalse($this->get($this->samples() . 'slow_page.php')); - } - - function testPost() { - $this->assertTrue($this->post($this->samples() . 'network_confirm.php')); - $this->assertText('target for the SimpleTest'); - $this->assertPattern('/Request method.*?
    POST<\/dd>/'); - } - - function testGetWithData() { - $this->get($this->samples() . 'network_confirm.php', array("a" => "aaa")); - $this->assertPattern('/Request method.*?
    GET<\/dd>/'); - $this->assertText('a=[aaa]'); - } - - function testPostWithData() { - $this->post($this->samples() . 'network_confirm.php', array("a" => "aaa")); - $this->assertPattern('/Request method.*?
    POST<\/dd>/'); - $this->assertText('a=[aaa]'); - } - - function testPostWithRecursiveData() { - $this->post($this->samples() . 'network_confirm.php', array("a" => "aaa")); - $this->assertPattern('/Request method.*?
    POST<\/dd>/'); - $this->assertText('a=[aaa]'); - - $this->post($this->samples() . 'network_confirm.php', array("a[aa]" => "aaa")); - $this->assertPattern('/Request method.*?
    POST<\/dd>/'); - $this->assertText('a=[aa=[aaa]]'); - - $this->post($this->samples() . 'network_confirm.php', array("a[aa][aaa]" => "aaaa")); - $this->assertPattern('/Request method.*?
    POST<\/dd>/'); - $this->assertText('a=[aa=[aaa=[aaaa]]]'); - - $this->post($this->samples() . 'network_confirm.php', array("a" => array("aa" => "aaa"))); - $this->assertPattern('/Request method.*?
    POST<\/dd>/'); - $this->assertText('a=[aa=[aaa]]'); - - $this->post($this->samples() . 'network_confirm.php', array("a" => array("aa" => array("aaa" => "aaaa")))); - $this->assertPattern('/Request method.*?
    POST<\/dd>/'); - $this->assertText('a=[aa=[aaa=[aaaa]]]'); - } - - function testRelativeGet() { - $this->get($this->samples() . 'link_confirm.php'); - $this->assertTrue($this->get('network_confirm.php')); - $this->assertText('target for the SimpleTest'); - } - - function testRelativePost() { - $this->post($this->samples() . 'link_confirm.php'); - $this->assertTrue($this->post('network_confirm.php')); - $this->assertText('target for the SimpleTest'); - } -} - -class TestOfLinkFollowing extends SimpleTestAcceptanceTest { - function setUp() { - $this->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - } - - function testLinkAssertions() { - $this->get($this->samples() . 'link_confirm.php'); - $this->assertLink('Absolute', $this->samples() . 'network_confirm.php'); - $this->assertLink('Absolute', new PatternExpectation('/confirm/')); - $this->assertClickable('Absolute'); - } - - function testAbsoluteLinkFollowing() { - $this->get($this->samples() . 'link_confirm.php'); - $this->assertTrue($this->clickLink('Absolute')); - $this->assertText('target for the SimpleTest'); - } - - function testRelativeLinkFollowing() { - $this->get($this->samples() . 'link_confirm.php'); - $this->assertTrue($this->clickLink('Relative')); - $this->assertText('target for the SimpleTest'); - } - - function testLinkIdFollowing() { - $this->get($this->samples() . 'link_confirm.php'); - $this->assertLinkById(1); - $this->assertTrue($this->clickLinkById(1)); - $this->assertText('target for the SimpleTest'); - } - - function testAbsoluteUrlBehavesAbsolutely() { - $this->get($this->samples() . 'link_confirm.php'); - $this->get('http://www.lastcraft.com'); - $this->assertText('No guarantee of quality is given or even intended'); - } - - function testRelativeUrlRespectsBaseTag() { - $this->get($this->samples() . 'base_tag/base_link.html'); - $this->click('Back to test pages'); - $this->assertTitle('Simple test target file'); - } -} - -class TestOfLivePageLinkingWithMinimalLinks extends SimpleTestAcceptanceTest { - function setUp() { - $this->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - } - - function testClickToExplicitelyNamedSelfReturns() { - $this->get($this->samples() . 'front_controller_style/a_page.php'); - $this->assertEqual($this->getUrl(), $this->samples() . 'front_controller_style/a_page.php'); - $this->assertTitle('Simple test page with links'); - $this->assertLink('Self'); - $this->clickLink('Self'); - $this->assertTitle('Simple test page with links'); - } - - function testClickToMissingPageReturnsToSamePage() { - $this->get($this->samples() . 'front_controller_style/a_page.php'); - $this->clickLink('No page'); - $this->assertTitle('Simple test page with links'); - $this->assertText('[action=no_page]'); - } - - function testClickToBareActionReturnsToSamePage() { - $this->get($this->samples() . 'front_controller_style/a_page.php'); - $this->clickLink('Bare action'); - $this->assertTitle('Simple test page with links'); - $this->assertText('[action=]'); - } - - function testClickToSingleQuestionMarkReturnsToSamePage() { - $this->get($this->samples() . 'front_controller_style/a_page.php'); - $this->clickLink('Empty query'); - $this->assertTitle('Simple test page with links'); - } - - function testClickToEmptyStringReturnsToSamePage() { - $this->get($this->samples() . 'front_controller_style/a_page.php'); - $this->clickLink('Empty link'); - $this->assertTitle('Simple test page with links'); - } - - function testClickToSingleDotGoesToCurrentDirectory() { - $this->get($this->samples() . 'front_controller_style/a_page.php'); - $this->clickLink('Current directory'); - $this->assertTitle( - 'Simple test front controller', - '%s -> index.php needs to be set as a default web server home page'); - } - - function testClickBackADirectoryLevel() { - $this->get($this->samples() . 'front_controller_style/'); - $this->clickLink('Down one'); - $this->assertPattern('|Index of .*?/test|i'); - } -} - -class TestOfLiveFrontControllerEmulation extends SimpleTestAcceptanceTest { - function setUp() { - $this->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - } - - function testJumpToNamedPage() { - $this->get($this->samples() . 'front_controller_style/'); - $this->assertText('Simple test front controller'); - $this->clickLink('Index'); - $this->assertResponse(200); - $this->assertText('[action=index]'); - } - - function testJumpToUnnamedPage() { - $this->get($this->samples() . 'front_controller_style/'); - $this->clickLink('No page'); - $this->assertResponse(200); - $this->assertText('Simple test front controller'); - $this->assertText('[action=no_page]'); - } - - function testJumpToUnnamedPageWithBareParameter() { - $this->get($this->samples() . 'front_controller_style/'); - $this->clickLink('Bare action'); - $this->assertResponse(200); - $this->assertText('Simple test front controller'); - $this->assertText('[action=]'); - } - - function testJumpToUnnamedPageWithEmptyQuery() { - $this->get($this->samples() . 'front_controller_style/'); - $this->clickLink('Empty query'); - $this->assertResponse(200); - $this->assertPattern('/Simple test front controller/'); - $this->assertPattern('/raw get data.*?\[\].*?get data/si'); - } - - function testJumpToUnnamedPageWithEmptyLink() { - $this->get($this->samples() . 'front_controller_style/'); - $this->clickLink('Empty link'); - $this->assertResponse(200); - $this->assertPattern('/Simple test front controller/'); - $this->assertPattern('/raw get data.*?\[\].*?get data/si'); - } - - function testJumpBackADirectoryLevel() { - $this->get($this->samples() . 'front_controller_style/'); - $this->clickLink('Down one'); - $this->assertPattern('|Index of .*?/test|'); - } - - function testSubmitToNamedPage() { - $this->get($this->samples() . 'front_controller_style/'); - $this->assertText('Simple test front controller'); - $this->clickSubmit('Index'); - $this->assertResponse(200); - $this->assertText('[action=Index]'); - } - - function testSubmitToSameDirectory() { - $this->get($this->samples() . 'front_controller_style/index.php'); - $this->clickSubmit('Same directory'); - $this->assertResponse(200); - $this->assertText('[action=Same+directory]'); - } - - function testSubmitToEmptyAction() { - $this->get($this->samples() . 'front_controller_style/index.php'); - $this->clickSubmit('Empty action'); - $this->assertResponse(200); - $this->assertText('[action=Empty+action]'); - } - - function testSubmitToNoAction() { - $this->get($this->samples() . 'front_controller_style/index.php'); - $this->clickSubmit('No action'); - $this->assertResponse(200); - $this->assertText('[action=No+action]'); - } - - function testSubmitBackADirectoryLevel() { - $this->get($this->samples() . 'front_controller_style/'); - $this->clickSubmit('Down one'); - $this->assertPattern('|Index of .*?/test|'); - } - - function testSubmitToNamedPageWithMixedPostAndGet() { - $this->get($this->samples() . 'front_controller_style/?a=A'); - $this->assertText('Simple test front controller'); - $this->clickSubmit('Index post'); - $this->assertText('action=[Index post]'); - $this->assertNoText('[a=A]'); - } - - function testSubmitToSameDirectoryMixedPostAndGet() { - $this->get($this->samples() . 'front_controller_style/index.php?a=A'); - $this->clickSubmit('Same directory post'); - $this->assertText('action=[Same directory post]'); - $this->assertNoText('[a=A]'); - } - - function testSubmitToEmptyActionMixedPostAndGet() { - $this->get($this->samples() . 'front_controller_style/index.php?a=A'); - $this->clickSubmit('Empty action post'); - $this->assertText('action=[Empty action post]'); - $this->assertText('[a=A]'); - } - - function testSubmitToNoActionMixedPostAndGet() { - $this->get($this->samples() . 'front_controller_style/index.php?a=A'); - $this->clickSubmit('No action post'); - $this->assertText('action=[No action post]'); - $this->assertText('[a=A]'); - } -} - -class TestOfLiveHeaders extends SimpleTestAcceptanceTest { - function setUp() { - $this->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - } - - function testConfirmingHeaderExistence() { - $this->get('http://www.lastcraft.com/'); - $this->assertHeader('content-type'); - $this->assertHeader('content-type', 'text/html'); - $this->assertHeader('content-type', new PatternExpectation('/HTML/i')); - $this->assertNoHeader('WWW-Authenticate'); - } -} - -class TestOfLiveRedirects extends SimpleTestAcceptanceTest { - function setUp() { - $this->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - } - - function testNoRedirects() { - $this->setMaximumRedirects(0); - $this->get($this->samples() . 'redirect.php'); - $this->assertTitle('Redirection test'); - } - - function testRedirects() { - $this->setMaximumRedirects(1); - $this->get($this->samples() . 'redirect.php'); - $this->assertTitle('Simple test target file'); - } - - function testRedirectLosesGetData() { - $this->get($this->samples() . 'redirect.php', array('a' => 'aaa')); - $this->assertNoText('a=[aaa]'); - } - - function testRedirectKeepsExtraRequestDataOfItsOwn() { - $this->get($this->samples() . 'redirect.php'); - $this->assertText('r=[rrr]'); - } - - function testRedirectLosesPostData() { - $this->post($this->samples() . 'redirect.php', array('a' => 'aaa')); - $this->assertTitle('Simple test target file'); - $this->assertNoText('a=[aaa]'); - } - - function testRedirectWithBaseUrlChange() { - $this->get($this->samples() . 'base_change_redirect.php'); - $this->assertTitle('Simple test target file in folder'); - $this->get($this->samples() . 'path/base_change_redirect.php'); - $this->assertTitle('Simple test target file'); - } - - function testRedirectWithDoubleBaseUrlChange() { - $this->get($this->samples() . 'double_base_change_redirect.php'); - $this->assertTitle('Simple test target file'); - } -} - -class TestOfLiveCookies extends SimpleTestAcceptanceTest { - function setUp() { - $this->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - } - - function here() { - return new SimpleUrl($this->samples()); - } - - function thisHost() { - $here = $this->here(); - return $here->getHost(); - } - - function thisPath() { - $here = $this->here(); - return $here->getPath(); - } - - function testCookieSettingAndAssertions() { - $this->setCookie('a', 'Test cookie a'); - $this->setCookie('b', 'Test cookie b', $this->thisHost()); - $this->setCookie('c', 'Test cookie c', $this->thisHost(), $this->thisPath()); - $this->get($this->samples() . 'network_confirm.php'); - $this->assertText('Test cookie a'); - $this->assertText('Test cookie b'); - $this->assertText('Test cookie c'); - $this->assertCookie('a'); - $this->assertCookie('b', 'Test cookie b'); - $this->assertTrue($this->getCookie('c') == 'Test cookie c'); - } - - function testNoCookieSetWhenCookiesDisabled() { - $this->setCookie('a', 'Test cookie a'); - $this->ignoreCookies(); - $this->get($this->samples() . 'network_confirm.php'); - $this->assertNoText('Test cookie a'); - } - - function testCookieReading() { - $this->get($this->samples() . 'set_cookies.php'); - $this->assertCookie('session_cookie', 'A'); - $this->assertCookie('short_cookie', 'B'); - $this->assertCookie('day_cookie', 'C'); - } - - function testNoCookie() { - $this->assertNoCookie('aRandomCookie'); - } - - function testNoCookieReadingWhenCookiesDisabled() { - $this->ignoreCookies(); - $this->get($this->samples() . 'set_cookies.php'); - $this->assertNoCookie('session_cookie'); - $this->assertNoCookie('short_cookie'); - $this->assertNoCookie('day_cookie'); - } - - function testCookiePatternAssertions() { - $this->get($this->samples() . 'set_cookies.php'); - $this->assertCookie('session_cookie', new PatternExpectation('/a/i')); - } - - function testTemporaryCookieExpiry() { - $this->get($this->samples() . 'set_cookies.php'); - $this->restart(); - $this->assertNoCookie('session_cookie'); - $this->assertCookie('day_cookie', 'C'); - } - - function testTimedCookieExpiryWith100SecondMargin() { - $this->get($this->samples() . 'set_cookies.php'); - $this->ageCookies(3600); - $this->restart(time() + 100); - $this->assertNoCookie('session_cookie'); - $this->assertNoCookie('hour_cookie'); - $this->assertCookie('day_cookie', 'C'); - } - - function testNoClockOverDriftBy100Seconds() { - $this->get($this->samples() . 'set_cookies.php'); - $this->restart(time() + 200); - $this->assertNoCookie( - 'short_cookie', - '%s -> Please check your computer clock setting if you are not using NTP'); - } - - function testNoClockUnderDriftBy100Seconds() { - $this->get($this->samples() . 'set_cookies.php'); - $this->restart(time() + 0); - $this->assertCookie( - 'short_cookie', - 'B', - '%s -> Please check your computer clock setting if you are not using NTP'); - } - - function testCookiePath() { - $this->get($this->samples() . 'set_cookies.php'); - $this->assertNoCookie('path_cookie', 'D'); - $this->get('./path/show_cookies.php'); - $this->assertPattern('/path_cookie/'); - $this->assertCookie('path_cookie', 'D'); - } -} - -class LiveTestOfForms extends SimpleTestAcceptanceTest { - function setUp() { - $this->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - } - - function testSimpleSubmit() { - $this->get($this->samples() . 'form.html'); - $this->assertTrue($this->clickSubmit('Go!')); - $this->assertPattern('/Request method.*?
    POST<\/dd>/'); - $this->assertText('go=[Go!]'); - } - - function testDefaultFormValues() { - $this->get($this->samples() . 'form.html'); - $this->assertFieldByName('a', ''); - $this->assertFieldByName('b', 'Default text'); - $this->assertFieldByName('c', ''); - $this->assertFieldByName('d', 'd1'); - $this->assertFieldByName('e', false); - $this->assertFieldByName('f', 'on'); - $this->assertFieldByName('g', 'g3'); - $this->assertFieldByName('h', 2); - $this->assertFieldByName('go', 'Go!'); - $this->assertClickable('Go!'); - $this->assertSubmit('Go!'); - $this->assertTrue($this->clickSubmit('Go!')); - $this->assertText('go=[Go!]'); - $this->assertText('a=[]'); - $this->assertText('b=[Default text]'); - $this->assertText('c=[]'); - $this->assertText('d=[d1]'); - $this->assertNoText('e=['); - $this->assertText('f=[on]'); - $this->assertText('g=[g3]'); - } - - function testFormSubmissionByButtonLabel() { - $this->get($this->samples() . 'form.html'); - $this->setFieldByName('a', 'aaa'); - $this->setFieldByName('b', 'bbb'); - $this->setFieldByName('c', 'ccc'); - $this->setFieldByName('d', 'D2'); - $this->setFieldByName('e', 'on'); - $this->setFieldByName('f', false); - $this->setFieldByName('g', 'g2'); - $this->setFieldByName('h', 1); - $this->assertTrue($this->clickSubmit('Go!')); - $this->assertText('a=[aaa]'); - $this->assertText('b=[bbb]'); - $this->assertText('c=[ccc]'); - $this->assertText('d=[d2]'); - $this->assertText('e=[on]'); - $this->assertNoText('f=['); - $this->assertText('g=[g2]'); - } - - function testAdditionalFormValues() { - $this->get($this->samples() . 'form.html'); - $this->assertTrue($this->clickSubmit('Go!', array('add' => 'A'))); - $this->assertText('go=[Go!]'); - $this->assertText('add=[A]'); - } - - function testFormSubmissionByName() { - $this->get($this->samples() . 'form.html'); - $this->setFieldByName('a', 'A'); - $this->assertTrue($this->clickSubmitByName('go')); - $this->assertText('a=[A]'); - } - - function testFormSubmissionByNameAndAdditionalParameters() { - $this->get($this->samples() . 'form.html'); - $this->assertTrue($this->clickSubmitByName('go', array('add' => 'A'))); - $this->assertText('go=[Go!]'); - $this->assertText('add=[A]'); - } - - function testFormSubmissionBySubmitButtonLabeledSubmit() { - $this->get($this->samples() . 'form.html'); - $this->assertTrue($this->clickSubmitByName('test')); - $this->assertText('test=[Submit]'); - } - - function testFormSubmissionWithIds() { - $this->get($this->samples() . 'form.html'); - $this->assertFieldById(1, ''); - $this->assertFieldById(2, 'Default text'); - $this->assertFieldById(3, ''); - $this->assertFieldById(4, 'd1'); - $this->assertFieldById(5, false); - $this->assertFieldById(6, 'on'); - $this->assertFieldById(8, 'g3'); - $this->assertFieldById(11, 2); - $this->setFieldById(1, 'aaa'); - $this->setFieldById(2, 'bbb'); - $this->setFieldById(3, 'ccc'); - $this->setFieldById(4, 'D2'); - $this->setFieldById(5, 'on'); - $this->setFieldById(6, false); - $this->setFieldById(8, 'g2'); - $this->setFieldById(11, 'H1'); - $this->assertTrue($this->clickSubmitById(99)); - $this->assertText('a=[aaa]'); - $this->assertText('b=[bbb]'); - $this->assertText('c=[ccc]'); - $this->assertText('d=[d2]'); - $this->assertText('e=[on]'); - $this->assertNoText('f=['); - $this->assertText('g=[g2]'); - $this->assertText('h=[1]'); - $this->assertText('go=[Go!]'); - } - - function testFormSubmissionWithLabels() { - $this->get($this->samples() . 'form.html'); - $this->assertField('Text A', ''); - $this->assertField('Text B', 'Default text'); - $this->assertField('Text area C', ''); - $this->assertField('Selection D', 'd1'); - $this->assertField('Checkbox E', false); - $this->assertField('Checkbox F', 'on'); - $this->assertField('3', 'g3'); - $this->assertField('Selection H', 2); - $this->setField('Text A', 'aaa'); - $this->setField('Text B', 'bbb'); - $this->setField('Text area C', 'ccc'); - $this->setField('Selection D', 'D2'); - $this->setField('Checkbox E', 'on'); - $this->setField('Checkbox F', false); - $this->setField('2', 'g2'); - $this->setField('Selection H', 'H1'); - $this->clickSubmit('Go!'); - $this->assertText('a=[aaa]'); - $this->assertText('b=[bbb]'); - $this->assertText('c=[ccc]'); - $this->assertText('d=[d2]'); - $this->assertText('e=[on]'); - $this->assertNoText('f=['); - $this->assertText('g=[g2]'); - $this->assertText('h=[1]'); - $this->assertText('go=[Go!]'); - } - - function testSettingCheckboxWithBooleanTrueSetsUnderlyingValue() { - $this->get($this->samples() . 'form.html'); - $this->setField('Checkbox E', true); - $this->assertField('Checkbox E', 'on'); - $this->clickSubmit('Go!'); - $this->assertText('e=[on]'); - } - - function testFormSubmissionWithMixedPostAndGet() { - $this->get($this->samples() . 'form_with_mixed_post_and_get.html'); - $this->setField('Text A', 'Hello'); - $this->assertTrue($this->clickSubmit('Go!')); - $this->assertText('a=[Hello]'); - $this->assertText('x=[X]'); - $this->assertText('y=[Y]'); - } - - function testFormSubmissionWithMixedPostAndEncodedGet() { - $this->get($this->samples() . 'form_with_mixed_post_and_get.html'); - $this->setField('Text B', 'Hello'); - $this->assertTrue($this->clickSubmit('Go encoded!')); - $this->assertText('b=[Hello]'); - $this->assertText('x=[X]'); - $this->assertText('y=[Y]'); - } - - function testFormSubmissionWithoutAction() { - $this->get($this->samples() . 'form_without_action.php?test=test'); - $this->assertText('_GET : [test]'); - $this->assertTrue($this->clickSubmit('Submit Post With Empty Action')); - $this->assertText('_GET : [test]'); - $this->assertText('_POST : [test]'); - } - - function testImageSubmissionByLabel() { - $this->get($this->samples() . 'form.html'); - $this->assertImage('Image go!'); - $this->assertTrue($this->clickImage('Image go!', 10, 12)); - $this->assertText('go_x=[10]'); - $this->assertText('go_y=[12]'); - } - - function testImageSubmissionByLabelWithAdditionalParameters() { - $this->get($this->samples() . 'form.html'); - $this->assertTrue($this->clickImage('Image go!', 10, 12, array('add' => 'A'))); - $this->assertText('add=[A]'); - } - - function testImageSubmissionByName() { - $this->get($this->samples() . 'form.html'); - $this->assertTrue($this->clickImageByName('go', 10, 12)); - $this->assertText('go_x=[10]'); - $this->assertText('go_y=[12]'); - } - - function testImageSubmissionById() { - $this->get($this->samples() . 'form.html'); - $this->assertTrue($this->clickImageById(97, 10, 12)); - $this->assertText('go_x=[10]'); - $this->assertText('go_y=[12]'); - } - - function testButtonSubmissionByLabel() { - $this->get($this->samples() . 'form.html'); - $this->assertTrue($this->clickSubmit('Button go!', 10, 12)); - $this->assertPattern('/go=\[ButtonGo\]/s'); - } - - function testNamelessSubmitSendsNoValue() { - $this->get($this->samples() . 'form_with_unnamed_submit.html'); - $this->click('Go!'); - $this->assertNoText('Go!'); - $this->assertNoText('submit'); - } - - function testNamelessImageSendsXAndYValues() { - $this->get($this->samples() . 'form_with_unnamed_submit.html'); - $this->clickImage('Image go!', 4, 5); - $this->assertNoText('ImageGo'); - $this->assertText('x=[4]'); - $this->assertText('y=[5]'); - } - - function testNamelessButtonSendsNoValue() { - $this->get($this->samples() . 'form_with_unnamed_submit.html'); - $this->click('Button Go!'); - $this->assertNoText('ButtonGo'); - } - - function testSelfSubmit() { - $this->get($this->samples() . 'self_form.php'); - $this->assertNoText('[Submitted]'); - $this->assertNoText('[Wrong form]'); - $this->assertTrue($this->clickSubmit()); - $this->assertText('[Submitted]'); - $this->assertNoText('[Wrong form]'); - $this->assertTitle('Test of form self submission'); - } - - function testSelfSubmitWithParameters() { - $this->get($this->samples() . 'self_form.php'); - $this->setFieldByName('visible', 'Resent'); - $this->assertTrue($this->clickSubmit()); - $this->assertText('[Resent]'); - } - - function testSettingOfBlankOption() { - $this->get($this->samples() . 'form.html'); - $this->assertTrue($this->setFieldByName('d', '')); - $this->clickSubmit('Go!'); - $this->assertText('d=[]'); - } - - function testAssertingFieldValueWithPattern() { - $this->get($this->samples() . 'form.html'); - $this->setField('c', 'A very long string'); - $this->assertField('c', new PatternExpectation('/very long/')); - } - - function testSendingMultipartFormDataEncodedForm() { - $this->get($this->samples() . 'form_data_encoded_form.html'); - $this->assertField('Text A', ''); - $this->assertField('Text B', 'Default text'); - $this->assertField('Text area C', ''); - $this->assertField('Selection D', 'd1'); - $this->assertField('Checkbox E', false); - $this->assertField('Checkbox F', 'on'); - $this->assertField('3', 'g3'); - $this->assertField('Selection H', 2); - $this->setField('Text A', 'aaa'); - $this->setField('Text B', 'bbb'); - $this->setField('Text area C', 'ccc'); - $this->setField('Selection D', 'D2'); - $this->setField('Checkbox E', 'on'); - $this->setField('Checkbox F', false); - $this->setField('2', 'g2'); - $this->setField('Selection H', 'H1'); - $this->assertTrue($this->clickSubmit('Go!')); - $this->assertText('a=[aaa]'); - $this->assertText('b=[bbb]'); - $this->assertText('c=[ccc]'); - $this->assertText('d=[d2]'); - $this->assertText('e=[on]'); - $this->assertNoText('f=['); - $this->assertText('g=[g2]'); - $this->assertText('h=[1]'); - $this->assertText('go=[Go!]'); - } - - function testSettingVariousBlanksInFields() { - $this->get($this->samples() . 'form_with_false_defaults.html'); - $this->assertField('Text A', ''); - $this->setField('Text A', '0'); - $this->assertField('Text A', '0'); - $this->assertField('Text area B', ''); - $this->setField('Text area B', '0'); - $this->assertField('Text area B', '0'); - $this->assertField('Text area C', " "); - $this->assertField('Selection D', ''); - $this->setField('Selection D', 'D2'); - $this->assertField('Selection D', 'D2'); - $this->setField('Selection D', 'D3'); - $this->assertField('Selection D', '0'); - $this->setField('Selection D', 'D4'); - $this->assertField('Selection D', '?'); - $this->assertField('Checkbox E', ''); - $this->assertField('Checkbox F', 'on'); - $this->assertField('Checkbox G', '0'); - $this->assertField('Checkbox H', '?'); - $this->assertFieldByName('i', 'on'); - $this->setFieldByName('i', ''); - $this->assertFieldByName('i', ''); - $this->setFieldByName('i', '0'); - $this->assertFieldByName('i', '0'); - $this->setFieldByName('i', '?'); - $this->assertFieldByName('i', '?'); - } - - function testSubmissionOfBlankFields() { - $this->get($this->samples() . 'form_with_false_defaults.html'); - $this->setField('Text A', ''); - $this->setField('Text area B', ''); - $this->setFieldByName('i', ''); - $this->click('Go!'); - $this->assertText('a=[]'); - $this->assertText('b=[]'); - $this->assertPattern('/c=\[ \]/'); - $this->assertText('d=[]'); - $this->assertText('e=[]'); - $this->assertText('i=[]'); - } - - function testSubmissionOfEmptyValues() { - $this->get($this->samples() . 'form_with_false_defaults.html'); - $this->setField('Selection D', 'D2'); - $this->click('Go!'); - $this->assertText('a=[]'); - $this->assertText('b=[]'); - $this->assertText('d=[D2]'); - $this->assertText('f=[on]'); - $this->assertText('i=[on]'); - } - - function testSubmissionOfZeroes() { - $this->get($this->samples() . 'form_with_false_defaults.html'); - $this->setField('Text A', '0'); - $this->setField('Text area B', '0'); - $this->setField('Selection D', 'D3'); - $this->setFieldByName('i', '0'); - $this->click('Go!'); - $this->assertText('a=[0]'); - $this->assertText('b=[0]'); - $this->assertText('d=[0]'); - $this->assertText('g=[0]'); - $this->assertText('i=[0]'); - } - - function testSubmissionOfQuestionMarks() { - $this->get($this->samples() . 'form_with_false_defaults.html'); - $this->setField('Text A', '?'); - $this->setField('Text area B', '?'); - $this->setField('Selection D', 'D4'); - $this->setFieldByName('i', '?'); - $this->click('Go!'); - $this->assertText('a=[?]'); - $this->assertText('b=[?]'); - $this->assertText('d=[?]'); - $this->assertText('h=[?]'); - $this->assertText('i=[?]'); - } - - function testSubmissionOfHtmlEncodedValues() { - $this->get($this->samples() . 'form_with_tricky_defaults.html'); - $this->assertField('Text A', '&\'"<>'); - $this->assertField('Text B', '"'); - $this->assertField('Text area C', '&\'"<>'); - $this->assertField('Selection D', "'"); - $this->assertField('Checkbox E', '&\'"<>'); - $this->assertField('Checkbox F', false); - $this->assertFieldByname('i', "'"); - $this->click('Go!'); - $this->assertText('a=[&\'"<>, "]'); - $this->assertText('c=[&\'"<>]'); - $this->assertText("d=[']"); - $this->assertText('e=[&\'"<>]'); - $this->assertText("i=[']"); - } - - function testFormActionRespectsBaseTag() { - $this->get($this->samples() . 'base_tag/form.html'); - $this->assertTrue($this->clickSubmit('Go!')); - $this->assertText('go=[Go!]'); - $this->assertText('a=[]'); - } -} - -class TestOfLiveMultiValueWidgets extends SimpleTestAcceptanceTest { - function setUp() { - $this->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - } - - function testDefaultFormValueSubmission() { - $this->get($this->samples() . 'multiple_widget_form.html'); - $this->assertFieldByName('a', array('a2', 'a3')); - $this->assertFieldByName('b', array('b2', 'b3')); - $this->assertFieldByName('c[]', array('c2', 'c3')); - $this->assertFieldByName('d', array('2', '3')); - $this->assertFieldByName('e', array('2', '3')); - $this->assertTrue($this->clickSubmit('Go!')); - $this->assertText('a=[a2, a3]'); - $this->assertText('b=[b2, b3]'); - $this->assertText('c=[c2, c3]'); - $this->assertText('d=[2, 3]'); - $this->assertText('e=[2, 3]'); - } - - function testSubmittingMultipleValues() { - $this->get($this->samples() . 'multiple_widget_form.html'); - $this->setFieldByName('a', array('a1', 'a4')); - $this->assertFieldByName('a', array('a1', 'a4')); - $this->assertFieldByName('a', array('a4', 'a1')); - $this->setFieldByName('b', array('b1', 'b4')); - $this->assertFieldByName('b', array('b1', 'b4')); - $this->setFieldByName('c[]', array('c1', 'c4')); - $this->assertField('c[]', array('c1', 'c4')); - $this->setFieldByName('d', array('1', '4')); - $this->assertField('d', array('1', '4')); - $this->setFieldByName('e', array('e1', 'e4')); - $this->assertField('e', array('1', '4')); - $this->assertTrue($this->clickSubmit('Go!')); - $this->assertText('a=[a1, a4]'); - $this->assertText('b=[b1, b4]'); - $this->assertText('c=[c1, c4]'); - $this->assertText('d=[1, 4]'); - $this->assertText('e=[1, 4]'); - } - - function testSettingByOptionValue() { - $this->get($this->samples() . 'multiple_widget_form.html'); - $this->setFieldByName('d', array('1', '4')); - $this->assertField('d', array('1', '4')); - $this->assertTrue($this->clickSubmit('Go!')); - $this->assertText('d=[1, 4]'); - } - - function testSubmittingMultipleValuesByLabel() { - $this->get($this->samples() . 'multiple_widget_form.html'); - $this->setField('Multiple selection A', array('a1', 'a4')); - $this->assertField('Multiple selection A', array('a1', 'a4')); - $this->assertField('Multiple selection A', array('a4', 'a1')); - $this->setField('multiple selection C', array('c1', 'c4')); - $this->assertField('multiple selection C', array('c1', 'c4')); - $this->assertTrue($this->clickSubmit('Go!')); - $this->assertText('a=[a1, a4]'); - $this->assertText('c=[c1, c4]'); - } - - function testSavantStyleHiddenFieldDefaults() { - $this->get($this->samples() . 'savant_style_form.html'); - $this->assertFieldByName('a', array('a0')); - $this->assertFieldByName('b', array('b0')); - $this->assertTrue($this->clickSubmit('Go!')); - $this->assertText('a=[a0]'); - $this->assertText('b=[b0]'); - } - - function testSavantStyleHiddenDefaultsAreOverridden() { - $this->get($this->samples() . 'savant_style_form.html'); - $this->assertTrue($this->setFieldByName('a', array('a1'))); - $this->assertTrue($this->setFieldByName('b', 'b1')); - $this->assertTrue($this->clickSubmit('Go!')); - $this->assertText('a=[a1]'); - $this->assertText('b=[b1]'); - } - - function testSavantStyleFormSettingById() { - $this->get($this->samples() . 'savant_style_form.html'); - $this->assertFieldById(1, array('a0')); - $this->assertFieldById(4, array('b0')); - $this->assertTrue($this->setFieldById(2, 'a1')); - $this->assertTrue($this->setFieldById(5, 'b1')); - $this->assertTrue($this->clickSubmitById(99)); - $this->assertText('a=[a1]'); - $this->assertText('b=[b1]'); - } -} - -class TestOfFileUploads extends SimpleTestAcceptanceTest { - function setUp() { - $this->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - } - - function testSingleFileUpload() { - $this->get($this->samples() . 'upload_form.html'); - $this->assertTrue($this->setField('Content:', - dirname(__FILE__) . '/support/upload_sample.txt')); - $this->assertField('Content:', dirname(__FILE__) . '/support/upload_sample.txt'); - $this->click('Go!'); - $this->assertText('Sample for testing file upload'); - } - - function testMultipleFileUpload() { - $this->get($this->samples() . 'upload_form.html'); - $this->assertTrue($this->setField('Content:', - dirname(__FILE__) . '/support/upload_sample.txt')); - $this->assertTrue($this->setField('Supplemental:', - dirname(__FILE__) . '/support/supplementary_upload_sample.txt')); - $this->assertField('Supplemental:', - dirname(__FILE__) . '/support/supplementary_upload_sample.txt'); - $this->click('Go!'); - $this->assertText('Sample for testing file upload'); - $this->assertText('Some more text content'); - } - - function testBinaryFileUpload() { - $this->get($this->samples() . 'upload_form.html'); - $this->assertTrue($this->setField('Content:', - dirname(__FILE__) . '/support/latin1_sample')); - $this->click('Go!'); - $this->assertText( - implode('', file(dirname(__FILE__) . '/support/latin1_sample'))); - } -} - -class TestOfLiveHistoryNavigation extends SimpleTestAcceptanceTest { - function setUp() { - $this->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - } - - function testRetry() { - $this->get($this->samples() . 'cookie_based_counter.php'); - $this->assertPattern('/count: 1/i'); - $this->retry(); - $this->assertPattern('/count: 2/i'); - $this->retry(); - $this->assertPattern('/count: 3/i'); - } - - function testOfBackButton() { - $this->get($this->samples() . '1.html'); - $this->clickLink('2'); - $this->assertTitle('2'); - $this->assertTrue($this->back()); - $this->assertTitle('1'); - $this->assertTrue($this->forward()); - $this->assertTitle('2'); - $this->assertFalse($this->forward()); - } - - function testGetRetryResubmitsData() { - $this->assertTrue($this->get( - $this->samples() . 'network_confirm.php?a=aaa')); - $this->assertPattern('/Request method.*?
    GET<\/dd>/'); - $this->assertText('a=[aaa]'); - $this->retry(); - $this->assertPattern('/Request method.*?
    GET<\/dd>/'); - $this->assertText('a=[aaa]'); - } - - function testGetRetryResubmitsExtraData() { - $this->assertTrue($this->get( - $this->samples() . 'network_confirm.php', - array('a' => 'aaa'))); - $this->assertPattern('/Request method.*?
    GET<\/dd>/'); - $this->assertText('a=[aaa]'); - $this->retry(); - $this->assertPattern('/Request method.*?
    GET<\/dd>/'); - $this->assertText('a=[aaa]'); - } - - function testPostRetryResubmitsData() { - $this->assertTrue($this->post( - $this->samples() . 'network_confirm.php', - array('a' => 'aaa'))); - $this->assertPattern('/Request method.*?
    POST<\/dd>/'); - $this->assertText('a=[aaa]'); - $this->retry(); - $this->assertPattern('/Request method.*?
    POST<\/dd>/'); - $this->assertText('a=[aaa]'); - } - - function testGetRetryResubmitsRepeatedData() { - $this->assertTrue($this->get( - $this->samples() . 'network_confirm.php?a=1&a=2')); - $this->assertPattern('/Request method.*?
    GET<\/dd>/'); - $this->assertText('a=[1, 2]'); - $this->retry(); - $this->assertPattern('/Request method.*?
    GET<\/dd>/'); - $this->assertText('a=[1, 2]'); - } -} - -class TestOfLiveAuthentication extends SimpleTestAcceptanceTest { - function setUp() { - $this->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - } - - function testChallengeFromProtectedPage() { - $this->get($this->samples() . 'protected/'); - $this->assertResponse(401); - $this->assertAuthentication('Basic'); - $this->assertRealm('SimpleTest basic authentication'); - $this->assertRealm(new PatternExpectation('/simpletest/i')); - $this->authenticate('test', 'secret'); - $this->assertResponse(200); - $this->retry(); - $this->assertResponse(200); - } - - function testTrailingSlashImpliedWithinRealm() { - $this->get($this->samples() . 'protected/'); - $this->authenticate('test', 'secret'); - $this->assertResponse(200); - $this->get($this->samples() . 'protected'); - $this->assertResponse(200); - } - - function testTrailingSlashImpliedSettingRealm() { - $this->get($this->samples() . 'protected'); - $this->authenticate('test', 'secret'); - $this->assertResponse(200); - $this->get($this->samples() . 'protected/'); - $this->assertResponse(200); - } - - function testEncodedAuthenticationFetchesPage() { - $this->get('http://test:secret@www.lastcraft.com/test/protected/'); - $this->assertResponse(200); - } - - function testEncodedAuthenticationFetchesPageAfterTrailingSlashRedirect() { - $this->get('http://test:secret@www.lastcraft.com/test/protected'); - $this->assertResponse(200); - } - - function testRealmExtendsToWholeDirectory() { - $this->get($this->samples() . 'protected/1.html'); - $this->authenticate('test', 'secret'); - $this->clickLink('2'); - $this->assertResponse(200); - $this->clickLink('3'); - $this->assertResponse(200); - } - - function testRedirectKeepsAuthentication() { - $this->get($this->samples() . 'protected/local_redirect.php'); - $this->authenticate('test', 'secret'); - $this->assertTitle('Simple test target file'); - } - - function testRedirectKeepsEncodedAuthentication() { - $this->get('http://test:secret@www.lastcraft.com/test/protected/local_redirect.php'); - $this->assertResponse(200); - $this->assertTitle('Simple test target file'); - } - - function testSessionRestartLosesAuthentication() { - $this->get($this->samples() . 'protected/'); - $this->authenticate('test', 'secret'); - $this->assertResponse(200); - $this->restart(); - $this->get($this->samples() . 'protected/'); - $this->assertResponse(401); - } -} - -class TestOfLoadingFrames extends SimpleTestAcceptanceTest { - function setUp() { - $this->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - } - - function testNoFramesContentWhenFramesDisabled() { - $this->ignoreFrames(); - $this->get($this->samples() . 'one_page_frameset.html'); - $this->assertTitle('Frameset for testing of SimpleTest'); - $this->assertText('This content is for no frames only'); - } - - function testPatternMatchCanReadTheOnlyFrame() { - $this->get($this->samples() . 'one_page_frameset.html'); - $this->assertText('A target for the SimpleTest test suite'); - $this->assertNoText('This content is for no frames only'); - } - - function testMessyFramesetResponsesByName() { - $this->assertTrue($this->get( - $this->samples() . 'messy_frameset.html')); - $this->assertTitle('Frameset for testing of SimpleTest'); - - $this->assertTrue($this->setFrameFocus('Front controller')); - $this->assertResponse(200); - $this->assertText('Simple test front controller'); - - $this->assertTrue($this->setFrameFocus('One')); - $this->assertResponse(200); - $this->assertLink('2'); - - $this->assertTrue($this->setFrameFocus('Frame links')); - $this->assertResponse(200); - $this->assertLink('Set one to 2'); - - $this->assertTrue($this->setFrameFocus('Counter')); - $this->assertResponse(200); - $this->assertText('Count: 1'); - - $this->assertTrue($this->setFrameFocus('Redirected')); - $this->assertResponse(200); - $this->assertText('r=rrr'); - - $this->assertTrue($this->setFrameFocus('Protected')); - $this->assertResponse(401); - - $this->assertTrue($this->setFrameFocus('Protected redirect')); - $this->assertResponse(401); - - $this->assertTrue($this->setFrameFocusByIndex(1)); - $this->assertResponse(200); - $this->assertText('Simple test front controller'); - - $this->assertTrue($this->setFrameFocusByIndex(2)); - $this->assertResponse(200); - $this->assertLink('2'); - - $this->assertTrue($this->setFrameFocusByIndex(3)); - $this->assertResponse(200); - $this->assertLink('Set one to 2'); - - $this->assertTrue($this->setFrameFocusByIndex(4)); - $this->assertResponse(200); - $this->assertText('Count: 1'); - - $this->assertTrue($this->setFrameFocusByIndex(5)); - $this->assertResponse(200); - $this->assertText('r=rrr'); - - $this->assertTrue($this->setFrameFocusByIndex(6)); - $this->assertResponse(401); - - $this->assertTrue($this->setFrameFocusByIndex(7)); - } - - function testReloadingFramesetPage() { - $this->get($this->samples() . 'messy_frameset.html'); - $this->assertText('Count: 1'); - $this->retry(); - $this->assertText('Count: 2'); - $this->retry(); - $this->assertText('Count: 3'); - } - - function testReloadingSingleFrameWithCookieCounter() { - $this->get($this->samples() . 'counting_frameset.html'); - $this->setFrameFocus('a'); - $this->assertText('Count: 1'); - $this->setFrameFocus('b'); - $this->assertText('Count: 2'); - - $this->setFrameFocus('a'); - $this->retry(); - $this->assertText('Count: 3'); - $this->retry(); - $this->assertText('Count: 4'); - $this->setFrameFocus('b'); - $this->assertText('Count: 2'); - } - - function testReloadingFrameWhenUnfocusedReloadsWholeFrameset() { - $this->get($this->samples() . 'counting_frameset.html'); - $this->setFrameFocus('a'); - $this->assertText('Count: 1'); - $this->setFrameFocus('b'); - $this->assertText('Count: 2'); - - $this->clearFrameFocus('a'); - $this->retry(); - - $this->assertTitle('Frameset for testing of SimpleTest'); - $this->setFrameFocus('a'); - $this->assertText('Count: 3'); - $this->setFrameFocus('b'); - $this->assertText('Count: 4'); - } - - function testClickingNormalLinkReplacesJustThatFrame() { - $this->get($this->samples() . 'messy_frameset.html'); - $this->clickLink('2'); - $this->assertLink('3'); - $this->assertText('Simple test front controller'); - } - - function testJumpToNamedPageReplacesJustThatFrame() { - $this->get($this->samples() . 'messy_frameset.html'); - $this->assertPattern('/Simple test front controller/'); - $this->clickLink('Index'); - $this->assertResponse(200); - $this->assertText('[action=index]'); - $this->assertText('Count: 1'); - } - - function testJumpToUnnamedPageReplacesJustThatFrame() { - $this->get($this->samples() . 'messy_frameset.html'); - $this->clickLink('No page'); - $this->assertResponse(200); - $this->assertText('Simple test front controller'); - $this->assertText('[action=no_page]'); - $this->assertText('Count: 1'); - } - - function testJumpToUnnamedPageWithBareParameterReplacesJustThatFrame() { - $this->get($this->samples() . 'messy_frameset.html'); - $this->clickLink('Bare action'); - $this->assertResponse(200); - $this->assertText('Simple test front controller'); - $this->assertText('[action=]'); - $this->assertText('Count: 1'); - } - - function testJumpToUnnamedPageWithEmptyQueryReplacesJustThatFrame() { - $this->get($this->samples() . 'messy_frameset.html'); - $this->clickLink('Empty query'); - $this->assertResponse(200); - $this->assertPattern('/Simple test front controller/'); - $this->assertPattern('/raw get data.*?\[\].*?get data/si'); - $this->assertPattern('/Count: 1/'); - } - - function testJumpToUnnamedPageWithEmptyLinkReplacesJustThatFrame() { - $this->get($this->samples() . 'messy_frameset.html'); - $this->clickLink('Empty link'); - $this->assertResponse(200); - $this->assertPattern('/Simple test front controller/'); - $this->assertPattern('/raw get data.*?\[\].*?get data/si'); - $this->assertPattern('/Count: 1/'); - } - - function testJumpBackADirectoryLevelReplacesJustThatFrame() { - $this->get($this->samples() . 'messy_frameset.html'); - $this->clickLink('Down one'); - $this->assertPattern('/index of .*\/test/i'); - $this->assertPattern('/Count: 1/'); - } - - function testSubmitToNamedPageReplacesJustThatFrame() { - $this->get($this->samples() . 'messy_frameset.html'); - $this->assertPattern('/Simple test front controller/'); - $this->clickSubmit('Index'); - $this->assertResponse(200); - $this->assertText('[action=Index]'); - $this->assertText('Count: 1'); - } - - function testSubmitToSameDirectoryReplacesJustThatFrame() { - $this->get($this->samples() . 'messy_frameset.html'); - $this->clickSubmit('Same directory'); - $this->assertResponse(200); - $this->assertText('[action=Same+directory]'); - $this->assertText('Count: 1'); - } - - function testSubmitToEmptyActionReplacesJustThatFrame() { - $this->get($this->samples() . 'messy_frameset.html'); - $this->clickSubmit('Empty action'); - $this->assertResponse(200); - $this->assertText('[action=Empty+action]'); - $this->assertText('Count: 1'); - } - - function testSubmitToNoActionReplacesJustThatFrame() { - $this->get($this->samples() . 'messy_frameset.html'); - $this->clickSubmit('No action'); - $this->assertResponse(200); - $this->assertText('[action=No+action]'); - $this->assertText('Count: 1'); - } - - function testSubmitBackADirectoryLevelReplacesJustThatFrame() { - $this->get($this->samples() . 'messy_frameset.html'); - $this->clickSubmit('Down one'); - $this->assertPattern('/index of .*\/test/i'); - $this->assertPattern('/Count: 1/'); - } - - function testTopLinkExitsFrameset() { - $this->get($this->samples() . 'messy_frameset.html'); - $this->clickLink('Exit the frameset'); - $this->assertTitle('Simple test target file'); - } - - function testLinkInOnePageCanLoadAnother() { - $this->get($this->samples() . 'messy_frameset.html'); - $this->assertNoLink('3'); - $this->clickLink('Set one to 2'); - $this->assertLink('3'); - $this->assertNoLink('2'); - $this->assertTitle('Frameset for testing of SimpleTest'); - } - - function testFrameWithRelativeLinksRespectsBaseTagForThatPage() { - $this->get($this->samples() . 'base_tag/frameset.html'); - $this->click('Back to test pages'); - $this->assertTitle('Frameset for testing of SimpleTest'); - $this->assertText('A target for the SimpleTest test suite'); - } - - function testRelativeLinkInFrameIsNotAffectedByFramesetBaseTag() { - $this->get($this->samples() . 'base_tag/frameset_with_base_tag.html'); - $this->assertText('This is page 1'); - $this->click('To page 2'); - $this->assertTitle('Frameset for testing of SimpleTest'); - $this->assertText('This is page 2'); - } -} - -class TestOfFrameAuthentication extends SimpleTestAcceptanceTest { - function setUp() { - $this->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - } - - function testUnauthenticatedFrameSendsChallenge() { - $this->get($this->samples() . 'protected/'); - $this->setFrameFocus('Protected'); - $this->assertAuthentication('Basic'); - $this->assertRealm('SimpleTest basic authentication'); - $this->assertResponse(401); - } - - function testCanReadFrameFromAlreadyAuthenticatedRealm() { - $this->get($this->samples() . 'protected/'); - $this->authenticate('test', 'secret'); - $this->get($this->samples() . 'messy_frameset.html'); - $this->setFrameFocus('Protected'); - $this->assertResponse(200); - $this->assertText('A target for the SimpleTest test suite'); - } - - function testCanAuthenticateFrame() { - $this->get($this->samples() . 'messy_frameset.html'); - $this->setFrameFocus('Protected'); - $this->authenticate('test', 'secret'); - $this->assertResponse(200); - $this->assertText('A target for the SimpleTest test suite'); - $this->clearFrameFocus(); - $this->assertText('Count: 1'); - } - - function testCanAuthenticateRedirectedFrame() { - $this->get($this->samples() . 'messy_frameset.html'); - $this->setFrameFocus('Protected redirect'); - $this->assertResponse(401); - $this->authenticate('test', 'secret'); - $this->assertResponse(200); - $this->assertText('A target for the SimpleTest test suite'); - $this->clearFrameFocus(); - $this->assertText('Count: 1'); - } -} - -class TestOfNestedFrames extends SimpleTestAcceptanceTest { - function setUp() { - $this->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); - } - - function testCanNavigateToSpecificContent() { - $this->get($this->samples() . 'nested_frameset.html'); - $this->assertTitle('Nested frameset for testing of SimpleTest'); - - $this->assertPattern('/This is frame A/'); - $this->assertPattern('/This is frame B/'); - $this->assertPattern('/Simple test front controller/'); - $this->assertLink('2'); - $this->assertLink('Set one to 2'); - $this->assertPattern('/Count: 1/'); - $this->assertPattern('/r=rrr/'); - - $this->setFrameFocus('pair'); - $this->assertPattern('/This is frame A/'); - $this->assertPattern('/This is frame B/'); - $this->assertNoPattern('/Simple test front controller/'); - $this->assertNoLink('2'); - - $this->setFrameFocus('aaa'); - $this->assertPattern('/This is frame A/'); - $this->assertNoPattern('/This is frame B/'); - - $this->clearFrameFocus(); - $this->assertResponse(200); - $this->setFrameFocus('messy'); - $this->assertResponse(200); - $this->setFrameFocus('Front controller'); - $this->assertResponse(200); - $this->assertPattern('/Simple test front controller/'); - $this->assertNoLink('2'); - } - - function testReloadingFramesetPage() { - $this->get($this->samples() . 'nested_frameset.html'); - $this->assertPattern('/Count: 1/'); - $this->retry(); - $this->assertPattern('/Count: 2/'); - $this->retry(); - $this->assertPattern('/Count: 3/'); - } - - function testRetryingNestedPageOnlyRetriesThatSet() { - $this->get($this->samples() . 'nested_frameset.html'); - $this->assertPattern('/Count: 1/'); - $this->setFrameFocus('messy'); - $this->retry(); - $this->assertPattern('/Count: 2/'); - $this->setFrameFocus('Counter'); - $this->retry(); - $this->assertPattern('/Count: 3/'); - - $this->clearFrameFocus(); - $this->setFrameFocus('messy'); - $this->setFrameFocus('Front controller'); - $this->retry(); - - $this->clearFrameFocus(); - $this->assertPattern('/Count: 3/'); - } - - function testAuthenticatingNestedPage() { - $this->get($this->samples() . 'nested_frameset.html'); - $this->setFrameFocus('messy'); - $this->setFrameFocus('Protected'); - $this->assertAuthentication('Basic'); - $this->assertRealm('SimpleTest basic authentication'); - $this->assertResponse(401); - - $this->authenticate('test', 'secret'); - $this->assertResponse(200); - $this->assertPattern('/A target for the SimpleTest test suite/'); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/adapter_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/adapter_test.php deleted file mode 100644 index c1a06a2..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/adapter_test.php +++ /dev/null @@ -1,50 +0,0 @@ -assertTrue(true, "PEAR true"); - $this->assertFalse(false, "PEAR false"); - } - - function testName() { - $this->assertTrue($this->getName() == get_class($this)); - } - - function testPass() { - $this->pass("PEAR pass"); - } - - function testNulls() { - $value = null; - $this->assertNull($value, "PEAR null"); - $value = 0; - $this->assertNotNull($value, "PEAR not null"); - } - - function testType() { - $this->assertType("Hello", "string", "PEAR type"); - } - - function testEquals() { - $this->assertEquals(12, 12, "PEAR identity"); - $this->setLooselyTyped(true); - $this->assertEquals("12", 12, "PEAR equality"); - } - - function testSame() { - $same = new SameTestClass(); - $this->assertSame($same, $same, "PEAR same"); - } - - function testRegExp() { - $this->assertRegExp('/hello/', "A big hello from me", "PEAR regex"); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/all_tests.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/all_tests.php deleted file mode 100644 index 99ce945..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/all_tests.php +++ /dev/null @@ -1,13 +0,0 @@ -TestSuite('All tests for SimpleTest ' . SimpleTest::getVersion()); - $this->addFile(dirname(__FILE__) . '/unit_tests.php'); - $this->addFile(dirname(__FILE__) . '/shell_test.php'); - $this->addFile(dirname(__FILE__) . '/live_test.php'); - $this->addFile(dirname(__FILE__) . '/acceptance_test.php'); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/authentication_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/authentication_test.php deleted file mode 100644 index 081cccd..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/authentication_test.php +++ /dev/null @@ -1,145 +0,0 @@ -assertTrue($realm->isWithin( - new SimpleUrl('http://www.here.com/path/hello.html'))); - } - - function testInsideWithLongerUrl() { - $realm = new SimpleRealm( - 'Basic', - new SimpleUrl('http://www.here.com/path/')); - $this->assertTrue($realm->isWithin( - new SimpleUrl('http://www.here.com/path/hello.html'))); - } - - function testBelowRootIsOutside() { - $realm = new SimpleRealm( - 'Basic', - new SimpleUrl('http://www.here.com/path/')); - $this->assertTrue($realm->isWithin( - new SimpleUrl('http://www.here.com/path/more/hello.html'))); - } - - function testOldNetscapeDefinitionIsOutside() { - $realm = new SimpleRealm( - 'Basic', - new SimpleUrl('http://www.here.com/path/')); - $this->assertFalse($realm->isWithin( - new SimpleUrl('http://www.here.com/pathmore/hello.html'))); - } - - function testInsideWithMissingTrailingSlash() { - $realm = new SimpleRealm( - 'Basic', - new SimpleUrl('http://www.here.com/path/')); - $this->assertTrue($realm->isWithin( - new SimpleUrl('http://www.here.com/path'))); - } - - function testDifferentPageNameStillInside() { - $realm = new SimpleRealm( - 'Basic', - new SimpleUrl('http://www.here.com/path/hello.html')); - $this->assertTrue($realm->isWithin( - new SimpleUrl('http://www.here.com/path/goodbye.html'))); - } - - function testNewUrlInSameDirectoryDoesNotChangeRealm() { - $realm = new SimpleRealm( - 'Basic', - new SimpleUrl('http://www.here.com/path/hello.html')); - $realm->stretch(new SimpleUrl('http://www.here.com/path/goodbye.html')); - $this->assertTrue($realm->isWithin( - new SimpleUrl('http://www.here.com/path/index.html'))); - $this->assertFalse($realm->isWithin( - new SimpleUrl('http://www.here.com/index.html'))); - } - - function testNewUrlMakesRealmTheCommonPath() { - $realm = new SimpleRealm( - 'Basic', - new SimpleUrl('http://www.here.com/path/here/hello.html')); - $realm->stretch(new SimpleUrl('http://www.here.com/path/there/goodbye.html')); - $this->assertTrue($realm->isWithin( - new SimpleUrl('http://www.here.com/path/here/index.html'))); - $this->assertTrue($realm->isWithin( - new SimpleUrl('http://www.here.com/path/there/index.html'))); - $this->assertTrue($realm->isWithin( - new SimpleUrl('http://www.here.com/path/index.html'))); - $this->assertFalse($realm->isWithin( - new SimpleUrl('http://www.here.com/index.html'))); - $this->assertFalse($realm->isWithin( - new SimpleUrl('http://www.here.com/paths/index.html'))); - $this->assertFalse($realm->isWithin( - new SimpleUrl('http://www.here.com/pathindex.html'))); - } -} - -class TestOfAuthenticator extends UnitTestCase { - - function testNoRealms() { - $request = new MockSimpleHttpRequest(); - $request->expectNever('addHeaderLine'); - $authenticator = new SimpleAuthenticator(); - $authenticator->addHeaders($request, new SimpleUrl('http://here.com/')); - } - - function &createSingleRealm() { - $authenticator = new SimpleAuthenticator(); - $authenticator->addRealm( - new SimpleUrl('http://www.here.com/path/hello.html'), - 'Basic', - 'Sanctuary'); - $authenticator->setIdentityForRealm('www.here.com', 'Sanctuary', 'test', 'secret'); - return $authenticator; - } - - function testOutsideRealm() { - $request = new MockSimpleHttpRequest(); - $request->expectNever('addHeaderLine'); - $authenticator = &$this->createSingleRealm(); - $authenticator->addHeaders( - $request, - new SimpleUrl('http://www.here.com/hello.html')); - } - - function testWithinRealm() { - $request = new MockSimpleHttpRequest(); - $request->expectOnce('addHeaderLine'); - $authenticator = &$this->createSingleRealm(); - $authenticator->addHeaders( - $request, - new SimpleUrl('http://www.here.com/path/more/hello.html')); - } - - function testRestartingClearsRealm() { - $request = new MockSimpleHttpRequest(); - $request->expectNever('addHeaderLine'); - $authenticator = &$this->createSingleRealm(); - $authenticator->restartSession(); - $authenticator->addHeaders( - $request, - new SimpleUrl('http://www.here.com/hello.html')); - } - - function testDifferentHostIsOutsideRealm() { - $request = new MockSimpleHttpRequest(); - $request->expectNever('addHeaderLine'); - $authenticator = &$this->createSingleRealm(); - $authenticator->addHeaders( - $request, - new SimpleUrl('http://here.com/path/hello.html')); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/autorun_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/autorun_test.php deleted file mode 100644 index 8f7ff81..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/autorun_test.php +++ /dev/null @@ -1,13 +0,0 @@ -addFile(dirname(__FILE__) . '/support/test1.php'); - $this->assertEqual($tests->getSize(), 1); - } -} - -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/bad_test_suite.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/bad_test_suite.php deleted file mode 100644 index b426013..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/bad_test_suite.php +++ /dev/null @@ -1,10 +0,0 @@ -TestSuite('Two bad test cases'); - $this->addFile(dirname(__FILE__) . '/support/empty_test_file.php'); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/browser_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/browser_test.php deleted file mode 100644 index eabe091..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/browser_test.php +++ /dev/null @@ -1,774 +0,0 @@ -assertIdentical($history->getUrl(), false); - $this->assertIdentical($history->getParameters(), false); - } - - function testCannotMoveInEmptyHistory() { - $history = new SimpleBrowserHistory(); - $this->assertFalse($history->back()); - $this->assertFalse($history->forward()); - } - - function testCurrentTargetAccessors() { - $history = new SimpleBrowserHistory(); - $history->recordEntry( - new SimpleUrl('http://www.here.com/'), - new SimpleGetEncoding()); - $this->assertIdentical($history->getUrl(), new SimpleUrl('http://www.here.com/')); - $this->assertIdentical($history->getParameters(), new SimpleGetEncoding()); - } - - function testSecondEntryAccessors() { - $history = new SimpleBrowserHistory(); - $history->recordEntry( - new SimpleUrl('http://www.first.com/'), - new SimpleGetEncoding()); - $history->recordEntry( - new SimpleUrl('http://www.second.com/'), - new SimplePostEncoding(array('a' => 1))); - $this->assertIdentical($history->getUrl(), new SimpleUrl('http://www.second.com/')); - $this->assertIdentical( - $history->getParameters(), - new SimplePostEncoding(array('a' => 1))); - } - - function testGoingBackwards() { - $history = new SimpleBrowserHistory(); - $history->recordEntry( - new SimpleUrl('http://www.first.com/'), - new SimpleGetEncoding()); - $history->recordEntry( - new SimpleUrl('http://www.second.com/'), - new SimplePostEncoding(array('a' => 1))); - $this->assertTrue($history->back()); - $this->assertIdentical($history->getUrl(), new SimpleUrl('http://www.first.com/')); - $this->assertIdentical($history->getParameters(), new SimpleGetEncoding()); - } - - function testGoingBackwardsOffBeginning() { - $history = new SimpleBrowserHistory(); - $history->recordEntry( - new SimpleUrl('http://www.first.com/'), - new SimpleGetEncoding()); - $this->assertFalse($history->back()); - $this->assertIdentical($history->getUrl(), new SimpleUrl('http://www.first.com/')); - $this->assertIdentical($history->getParameters(), new SimpleGetEncoding()); - } - - function testGoingForwardsOffEnd() { - $history = new SimpleBrowserHistory(); - $history->recordEntry( - new SimpleUrl('http://www.first.com/'), - new SimpleGetEncoding()); - $this->assertFalse($history->forward()); - $this->assertIdentical($history->getUrl(), new SimpleUrl('http://www.first.com/')); - $this->assertIdentical($history->getParameters(), new SimpleGetEncoding()); - } - - function testGoingBackwardsAndForwards() { - $history = new SimpleBrowserHistory(); - $history->recordEntry( - new SimpleUrl('http://www.first.com/'), - new SimpleGetEncoding()); - $history->recordEntry( - new SimpleUrl('http://www.second.com/'), - new SimplePostEncoding(array('a' => 1))); - $this->assertTrue($history->back()); - $this->assertTrue($history->forward()); - $this->assertIdentical($history->getUrl(), new SimpleUrl('http://www.second.com/')); - $this->assertIdentical( - $history->getParameters(), - new SimplePostEncoding(array('a' => 1))); - } - - function testNewEntryReplacesNextOne() { - $history = new SimpleBrowserHistory(); - $history->recordEntry( - new SimpleUrl('http://www.first.com/'), - new SimpleGetEncoding()); - $history->recordEntry( - new SimpleUrl('http://www.second.com/'), - new SimplePostEncoding(array('a' => 1))); - $history->back(); - $history->recordEntry( - new SimpleUrl('http://www.third.com/'), - new SimpleGetEncoding()); - $this->assertIdentical($history->getUrl(), new SimpleUrl('http://www.third.com/')); - $this->assertIdentical($history->getParameters(), new SimpleGetEncoding()); - } - - function testNewEntryDropsFutureEntries() { - $history = new SimpleBrowserHistory(); - $history->recordEntry( - new SimpleUrl('http://www.first.com/'), - new SimpleGetEncoding()); - $history->recordEntry( - new SimpleUrl('http://www.second.com/'), - new SimpleGetEncoding()); - $history->recordEntry( - new SimpleUrl('http://www.third.com/'), - new SimpleGetEncoding()); - $history->back(); - $history->back(); - $history->recordEntry( - new SimpleUrl('http://www.fourth.com/'), - new SimpleGetEncoding()); - $this->assertIdentical($history->getUrl(), new SimpleUrl('http://www.fourth.com/')); - $this->assertFalse($history->forward()); - $history->back(); - $this->assertIdentical($history->getUrl(), new SimpleUrl('http://www.first.com/')); - $this->assertFalse($history->back()); - } -} - -class TestOfParsedPageAccess extends UnitTestCase { - - function loadPage(&$page) { - $response = new MockSimpleHttpResponse($this); - $agent = new MockSimpleUserAgent($this); - $agent->returns('fetchResponse', $response); - - $browser = new MockParseSimpleBrowser($this); - $browser->returns('createUserAgent', $agent); - $browser->returns('parse', $page); - $browser->__construct(); - - $browser->get('http://this.com/page.html'); - return $browser; - } - - function testAccessorsWhenNoPage() { - $agent = new MockSimpleUserAgent($this); - $browser = new MockParseSimpleBrowser($this); - $browser->returns('createUserAgent', $agent); - $browser->__construct(); - $this->assertEqual($browser->getContent(), ''); - } - - function testParse() { - $page = new MockSimplePage(); - $page->setReturnValue('getRequest', "GET here.html\r\n\r\n"); - $page->setReturnValue('getRaw', 'Raw HTML'); - $page->setReturnValue('getTitle', 'Here'); - $page->setReturnValue('getFrameFocus', 'Frame'); - $page->setReturnValue('getMimeType', 'text/html'); - $page->setReturnValue('getResponseCode', 200); - $page->setReturnValue('getAuthentication', 'Basic'); - $page->setReturnValue('getRealm', 'Somewhere'); - $page->setReturnValue('getTransportError', 'Ouch!'); - - $browser = $this->loadPage($page); - $this->assertEqual($browser->getRequest(), "GET here.html\r\n\r\n"); - $this->assertEqual($browser->getContent(), 'Raw HTML'); - $this->assertEqual($browser->getTitle(), 'Here'); - $this->assertEqual($browser->getFrameFocus(), 'Frame'); - $this->assertIdentical($browser->getResponseCode(), 200); - $this->assertEqual($browser->getMimeType(), 'text/html'); - $this->assertEqual($browser->getAuthentication(), 'Basic'); - $this->assertEqual($browser->getRealm(), 'Somewhere'); - $this->assertEqual($browser->getTransportError(), 'Ouch!'); - } - - function testLinkAffirmationWhenPresent() { - $page = new MockSimplePage(); - $page->setReturnValue('getUrlsByLabel', array('http://www.nowhere.com')); - $page->expectOnce('getUrlsByLabel', array('a link label')); - $browser = $this->loadPage($page); - $this->assertIdentical($browser->getLink('a link label'), 'http://www.nowhere.com'); - } - - function testLinkAffirmationByIdWhenPresent() { - $page = new MockSimplePage(); - $page->setReturnValue('getUrlById', 'a_page.com', array(99)); - $page->setReturnValue('getUrlById', false, array('*')); - $browser = $this->loadPage($page); - $this->assertIdentical($browser->getLinkById(99), 'a_page.com'); - $this->assertFalse($browser->getLinkById(98)); - } - - function testSettingFieldIsPassedToPage() { - $page = new MockSimplePage(); - $page->expectOnce('setField', array(new SimpleByLabelOrName('key'), 'Value', false)); - $page->setReturnValue('getField', 'Value'); - $browser = $this->loadPage($page); - $this->assertEqual($browser->getField('key'), 'Value'); - $browser->setField('key', 'Value'); - } -} - -class TestOfBrowserNavigation extends UnitTestCase { - function createBrowser($agent, $page) { - $browser = new MockParseSimpleBrowser(); - $browser->returns('createUserAgent', $agent); - $browser->returns('parse', $page); - $browser->__construct(); - return $browser; - } - - function testClickLinkRequestsPage() { - $agent = new MockSimpleUserAgent(); - $agent->returns('fetchResponse', new MockSimpleHttpResponse()); - $agent->expectAt( - 0, - 'fetchResponse', - array(new SimpleUrl('http://this.com/page.html'), new SimpleGetEncoding())); - $agent->expectAt( - 1, - 'fetchResponse', - array(new SimpleUrl('http://this.com/new.html'), new SimpleGetEncoding())); - $agent->expectCallCount('fetchResponse', 2); - - $page = new MockSimplePage(); - $page->setReturnValue('getUrlsByLabel', array(new SimpleUrl('http://this.com/new.html'))); - $page->expectOnce('getUrlsByLabel', array('New')); - $page->setReturnValue('getRaw', 'A page'); - - $browser = $this->createBrowser($agent, $page); - $browser->get('http://this.com/page.html'); - $this->assertTrue($browser->clickLink('New')); - } - - function testClickLinkWithUnknownFrameStillRequestsWholePage() { - $agent = new MockSimpleUserAgent(); - $agent->returns('fetchResponse', new MockSimpleHttpResponse()); - $agent->expectAt( - 0, - 'fetchResponse', - array(new SimpleUrl('http://this.com/page.html'), new SimpleGetEncoding())); - $target = new SimpleUrl('http://this.com/new.html'); - $target->setTarget('missing'); - $agent->expectAt( - 1, - 'fetchResponse', - array($target, new SimpleGetEncoding())); - $agent->expectCallCount('fetchResponse', 2); - - $parsed_url = new SimpleUrl('http://this.com/new.html'); - $parsed_url->setTarget('missing'); - - $page = new MockSimplePage(); - $page->setReturnValue('getUrlsByLabel', array($parsed_url)); - $page->setReturnValue('hasFrames', false); - $page->expectOnce('getUrlsByLabel', array('New')); - $page->setReturnValue('getRaw', 'A page'); - - $browser = $this->createBrowser($agent, $page); - $browser->get('http://this.com/page.html'); - $this->assertTrue($browser->clickLink('New')); - } - - function testClickingMissingLinkFails() { - $agent = new MockSimpleUserAgent($this); - $agent->returns('fetchResponse', new MockSimpleHttpResponse()); - - $page = new MockSimplePage(); - $page->setReturnValue('getUrlsByLabel', array()); - $page->setReturnValue('getRaw', 'stuff'); - - $browser = $this->createBrowser($agent, $page); - $this->assertTrue($browser->get('http://this.com/page.html')); - $this->assertFalse($browser->clickLink('New')); - } - - function testClickIndexedLink() { - $agent = new MockSimpleUserAgent(); - $agent->returns('fetchResponse', new MockSimpleHttpResponse()); - $agent->expectAt( - 1, - 'fetchResponse', - array(new SimpleUrl('1.html'), new SimpleGetEncoding())); - $agent->expectCallCount('fetchResponse', 2); - - $page = new MockSimplePage(); - $page->setReturnValue( - 'getUrlsByLabel', - array(new SimpleUrl('0.html'), new SimpleUrl('1.html'))); - $page->setReturnValue('getRaw', 'A page'); - - $browser = $this->createBrowser($agent, $page); - $browser->get('http://this.com/page.html'); - $this->assertTrue($browser->clickLink('New', 1)); - } - - function testClinkLinkById() { - $agent = new MockSimpleUserAgent(); - $agent->returns('fetchResponse', new MockSimpleHttpResponse()); - $agent->expectAt(1, 'fetchResponse', array( - new SimpleUrl('http://this.com/link.html'), - new SimpleGetEncoding())); - $agent->expectCallCount('fetchResponse', 2); - - $page = new MockSimplePage(); - $page->setReturnValue('getUrlById', new SimpleUrl('http://this.com/link.html')); - $page->expectOnce('getUrlById', array(2)); - $page->setReturnValue('getRaw', 'A page'); - - $browser = $this->createBrowser($agent, $page); - $browser->get('http://this.com/page.html'); - $this->assertTrue($browser->clickLinkById(2)); - } - - function testClickingMissingLinkIdFails() { - $agent = new MockSimpleUserAgent(); - $agent->returns('fetchResponse', new MockSimpleHttpResponse()); - - $page = new MockSimplePage(); - $page->setReturnValue('getUrlById', false); - - $browser = $this->createBrowser($agent, $page); - $browser->get('http://this.com/page.html'); - $this->assertFalse($browser->clickLink(0)); - } - - function testSubmitFormByLabel() { - $agent = new MockSimpleUserAgent(); - $agent->returns('fetchResponse', new MockSimpleHttpResponse()); - $agent->expectAt(1, 'fetchResponse', array( - new SimpleUrl('http://this.com/handler.html'), - new SimplePostEncoding(array('a' => 'A')))); - $agent->expectCallCount('fetchResponse', 2); - - $form = new MockSimpleForm(); - $form->setReturnValue('getAction', new SimpleUrl('http://this.com/handler.html')); - $form->setReturnValue('getMethod', 'post'); - $form->setReturnValue('submitButton', new SimplePostEncoding(array('a' => 'A'))); - $form->expectOnce('submitButton', array(new SimpleByLabel('Go'), false)); - - $page = new MockSimplePage(); - $page->returns('getFormBySubmit', $form); - $page->expectOnce('getFormBySubmit', array(new SimpleByLabel('Go'))); - $page->setReturnValue('getRaw', 'stuff'); - - $browser = $this->createBrowser($agent, $page); - $browser->get('http://this.com/page.html'); - $this->assertTrue($browser->clickSubmit('Go')); - } - - function testDefaultSubmitFormByLabel() { - $agent = new MockSimpleUserAgent(); - $agent->returns('fetchResponse', new MockSimpleHttpResponse()); - $agent->expectAt(1, 'fetchResponse', array( - new SimpleUrl('http://this.com/page.html'), - new SimpleGetEncoding(array('a' => 'A')))); - $agent->expectCallCount('fetchResponse', 2); - - $form = new MockSimpleForm(); - $form->setReturnValue('getAction', new SimpleUrl('http://this.com/page.html')); - $form->setReturnValue('getMethod', 'get'); - $form->setReturnValue('submitButton', new SimpleGetEncoding(array('a' => 'A'))); - - $page = new MockSimplePage(); - $page->returns('getFormBySubmit', $form); - $page->expectOnce('getFormBySubmit', array(new SimpleByLabel('Submit'))); - $page->setReturnValue('getRaw', 'stuff'); - $page->setReturnValue('getUrl', new SimpleUrl('http://this.com/page.html')); - - $browser = $this->createBrowser($agent, $page); - $browser->get('http://this.com/page.html'); - $this->assertTrue($browser->clickSubmit()); - } - - function testSubmitFormByName() { - $agent = new MockSimpleUserAgent(); - $agent->returns('fetchResponse', new MockSimpleHttpResponse()); - - $form = new MockSimpleForm(); - $form->setReturnValue('getAction', new SimpleUrl('http://this.com/handler.html')); - $form->setReturnValue('getMethod', 'post'); - $form->setReturnValue('submitButton', new SimplePostEncoding(array('a' => 'A'))); - - $page = new MockSimplePage(); - $page->returns('getFormBySubmit', $form); - $page->expectOnce('getFormBySubmit', array(new SimpleByName('me'))); - $page->setReturnValue('getRaw', 'stuff'); - - $browser = $this->createBrowser($agent, $page); - $browser->get('http://this.com/page.html'); - $this->assertTrue($browser->clickSubmitByName('me')); - } - - function testSubmitFormById() { - $agent = new MockSimpleUserAgent(); - $agent->returns('fetchResponse', new MockSimpleHttpResponse()); - - $form = new MockSimpleForm(); - $form->setReturnValue('getAction', new SimpleUrl('http://this.com/handler.html')); - $form->setReturnValue('getMethod', 'post'); - $form->setReturnValue('submitButton', new SimplePostEncoding(array('a' => 'A'))); - $form->expectOnce('submitButton', array(new SimpleById(99), false)); - - $page = new MockSimplePage(); - $page->returns('getFormBySubmit', $form); - $page->expectOnce('getFormBySubmit', array(new SimpleById(99))); - $page->setReturnValue('getRaw', 'stuff'); - - $browser = $this->createBrowser($agent, $page); - $browser->get('http://this.com/page.html'); - $this->assertTrue($browser->clickSubmitById(99)); - } - - function testSubmitFormByImageLabel() { - $agent = new MockSimpleUserAgent(); - $agent->returns('fetchResponse', new MockSimpleHttpResponse()); - - $form = new MockSimpleForm(); - $form->setReturnValue('getAction', new SimpleUrl('http://this.com/handler.html')); - $form->setReturnValue('getMethod', 'post'); - $form->setReturnValue('submitImage', new SimplePostEncoding(array('a' => 'A'))); - $form->expectOnce('submitImage', array(new SimpleByLabel('Go!'), 10, 11, false)); - - $page = new MockSimplePage(); - $page->returns('getFormByImage', $form); - $page->expectOnce('getFormByImage', array(new SimpleByLabel('Go!'))); - $page->setReturnValue('getRaw', 'stuff'); - - $browser = $this->createBrowser($agent, $page); - $browser->get('http://this.com/page.html'); - $this->assertTrue($browser->clickImage('Go!', 10, 11)); - } - - function testSubmitFormByImageName() { - $agent = new MockSimpleUserAgent(); - $agent->returns('fetchResponse', new MockSimpleHttpResponse()); - - $form = new MockSimpleForm(); - $form->setReturnValue('getAction', new SimpleUrl('http://this.com/handler.html')); - $form->setReturnValue('getMethod', 'post'); - $form->setReturnValue('submitImage', new SimplePostEncoding(array('a' => 'A'))); - $form->expectOnce('submitImage', array(new SimpleByName('a'), 10, 11, false)); - - $page = new MockSimplePage(); - $page->returns('getFormByImage', $form); - $page->expectOnce('getFormByImage', array(new SimpleByName('a'))); - $page->setReturnValue('getRaw', 'stuff'); - - $browser = $this->createBrowser($agent, $page); - $browser->get('http://this.com/page.html'); - $this->assertTrue($browser->clickImageByName('a', 10, 11)); - } - - function testSubmitFormByImageId() { - $agent = new MockSimpleUserAgent(); - $agent->returns('fetchResponse', new MockSimpleHttpResponse()); - - $form = new MockSimpleForm(); - $form->setReturnValue('getAction', new SimpleUrl('http://this.com/handler.html')); - $form->setReturnValue('getMethod', 'post'); - $form->setReturnValue('submitImage', new SimplePostEncoding(array('a' => 'A'))); - $form->expectOnce('submitImage', array(new SimpleById(99), 10, 11, false)); - - $page = new MockSimplePage(); - $page->returns('getFormByImage', $form); - $page->expectOnce('getFormByImage', array(new SimpleById(99))); - $page->setReturnValue('getRaw', 'stuff'); - - $browser = $this->createBrowser($agent, $page); - $browser->get('http://this.com/page.html'); - $this->assertTrue($browser->clickImageById(99, 10, 11)); - } - - function testSubmitFormByFormId() { - $agent = new MockSimpleUserAgent(); - $agent->returns('fetchResponse', new MockSimpleHttpResponse()); - $agent->expectAt(1, 'fetchResponse', array( - new SimpleUrl('http://this.com/handler.html'), - new SimplePostEncoding(array('a' => 'A')))); - $agent->expectCallCount('fetchResponse', 2); - - $form = new MockSimpleForm(); - $form->setReturnValue('getAction', new SimpleUrl('http://this.com/handler.html')); - $form->setReturnValue('getMethod', 'post'); - $form->setReturnValue('submit', new SimplePostEncoding(array('a' => 'A'))); - - $page = new MockSimplePage(); - $page->returns('getFormById', $form); - $page->expectOnce('getFormById', array(33)); - $page->setReturnValue('getRaw', 'stuff'); - - $browser = $this->createBrowser($agent, $page); - $browser->get('http://this.com/page.html'); - $this->assertTrue($browser->submitFormById(33)); - } -} - -class TestOfBrowserFrames extends UnitTestCase { - - function createBrowser($agent) { - $browser = new MockUserAgentSimpleBrowser(); - $browser->returns('createUserAgent', $agent); - $browser->__construct(); - return $browser; - } - - function createUserAgent($pages) { - $agent = new MockSimpleUserAgent(); - foreach ($pages as $url => $raw) { - $url = new SimpleUrl($url); - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getUrl', $url); - $response->setReturnValue('getContent', $raw); - $agent->returns('fetchResponse', $response, array($url, '*')); - } - return $agent; - } - - function testSimplePageHasNoFrames() { - $browser = $this->createBrowser($this->createUserAgent( - array('http://site.with.no.frames/' => 'A non-framed page'))); - $this->assertEqual( - $browser->get('http://site.with.no.frames/'), - 'A non-framed page'); - $this->assertIdentical($browser->getFrames(), 'http://site.with.no.frames/'); - } - - function testFramesetWithNoFrames() { - $browser = $this->createBrowser($this->createUserAgent( - array('http://site.with.no.frames/' => ''))); - $this->assertEqual($browser->get('http://site.with.no.frames/'), ''); - $this->assertIdentical($browser->getFrames(), array()); - } - - function testFramesetWithSingleFrame() { - $frameset = ''; - $browser = $this->createBrowser($this->createUserAgent(array( - 'http://site.with.one.frame/' => $frameset, - 'http://site.with.one.frame/frame.html' => 'A frame'))); - $this->assertEqual($browser->get('http://site.with.one.frame/'), 'A frame'); - $this->assertIdentical( - $browser->getFrames(), - array('a' => 'http://site.with.one.frame/frame.html')); - } - - function testTitleTakenFromFramesetPage() { - $frameset = 'Frameset title' . - ''; - $browser = $this->createBrowser($this->createUserAgent(array( - 'http://site.with.one.frame/' => $frameset, - 'http://site.with.one.frame/frame.html' => 'Page title'))); - $browser->get('http://site.with.one.frame/'); - $this->assertEqual($browser->getTitle(), 'Frameset title'); - } - - function testFramesetWithSingleUnnamedFrame() { - $frameset = ''; - $browser = $this->createBrowser($this->createUserAgent(array( - 'http://site.with.one.frame/' => $frameset, - 'http://site.with.one.frame/frame.html' => 'One frame'))); - $this->assertEqual( - $browser->get('http://site.with.one.frame/'), - 'One frame'); - $this->assertIdentical( - $browser->getFrames(), - array(1 => 'http://site.with.one.frame/frame.html')); - } - - function testFramesetWithMultipleFrames() { - $frameset = '' . - '' . - '' . - '' . - ''; - $browser = $this->createBrowser($this->createUserAgent(array( - 'http://site.with.frames/' => $frameset, - 'http://site.with.frames/frame_a.html' => 'A frame', - 'http://site.with.frames/frame_b.html' => 'B frame', - 'http://site.with.frames/frame_c.html' => 'C frame'))); - $this->assertEqual( - $browser->get('http://site.with.frames/'), - 'A frameB frameC frame'); - $this->assertIdentical($browser->getFrames(), array( - 'a' => 'http://site.with.frames/frame_a.html', - 'b' => 'http://site.with.frames/frame_b.html', - 'c' => 'http://site.with.frames/frame_c.html')); - } - - function testFrameFocusByName() { - $frameset = '' . - '' . - '' . - '' . - ''; - $browser = $this->createBrowser($this->createUserAgent(array( - 'http://site.with.frames/' => $frameset, - 'http://site.with.frames/frame_a.html' => 'A frame', - 'http://site.with.frames/frame_b.html' => 'B frame', - 'http://site.with.frames/frame_c.html' => 'C frame'))); - $browser->get('http://site.with.frames/'); - $browser->setFrameFocus('a'); - $this->assertEqual($browser->getContent(), 'A frame'); - $browser->setFrameFocus('b'); - $this->assertEqual($browser->getContent(), 'B frame'); - $browser->setFrameFocus('c'); - $this->assertEqual($browser->getContent(), 'C frame'); - } - - function testFramesetWithSomeNamedFrames() { - $frameset = '' . - '' . - '' . - '' . - '' . - ''; - $browser = $this->createBrowser($this->createUserAgent(array( - 'http://site.with.frames/' => $frameset, - 'http://site.with.frames/frame_a.html' => 'A frame', - 'http://site.with.frames/frame_b.html' => 'B frame', - 'http://site.with.frames/frame_c.html' => 'C frame', - 'http://site.with.frames/frame_d.html' => 'D frame'))); - $this->assertEqual( - $browser->get('http://site.with.frames/'), - 'A frameB frameC frameD frame'); - $this->assertIdentical($browser->getFrames(), array( - 'a' => 'http://site.with.frames/frame_a.html', - 2 => 'http://site.with.frames/frame_b.html', - 'c' => 'http://site.with.frames/frame_c.html', - 4 => 'http://site.with.frames/frame_d.html')); - } - - function testFrameFocusWithMixedNamesAndIndexes() { - $frameset = '' . - '' . - '' . - '' . - '' . - ''; - $browser = $this->createBrowser($this->createUserAgent(array( - 'http://site.with.frames/' => $frameset, - 'http://site.with.frames/frame_a.html' => 'A frame', - 'http://site.with.frames/frame_b.html' => 'B frame', - 'http://site.with.frames/frame_c.html' => 'C frame', - 'http://site.with.frames/frame_d.html' => 'D frame'))); - $browser->get('http://site.with.frames/'); - $browser->setFrameFocus('a'); - $this->assertEqual($browser->getContent(), 'A frame'); - $browser->setFrameFocus(2); - $this->assertEqual($browser->getContent(), 'B frame'); - $browser->setFrameFocus('c'); - $this->assertEqual($browser->getContent(), 'C frame'); - $browser->setFrameFocus(4); - $this->assertEqual($browser->getContent(), 'D frame'); - $browser->clearFrameFocus(); - $this->assertEqual($browser->getContent(), 'A frameB frameC frameD frame'); - } - - function testNestedFrameset() { - $inner = '' . - '' . - ''; - $outer = '' . - '' . - ''; - $browser = $this->createBrowser($this->createUserAgent(array( - 'http://site.with.nested.frame/' => $outer, - 'http://site.with.nested.frame/inner.html' => $inner, - 'http://site.with.nested.frame/page.html' => 'The page'))); - $this->assertEqual( - $browser->get('http://site.with.nested.frame/'), - 'The page'); - $this->assertIdentical($browser->getFrames(), array( - 'inner' => array( - 'page' => 'http://site.with.nested.frame/page.html'))); - } - - function testCanNavigateToNestedFrame() { - $inner = '' . - '' . - '' . - ''; - $outer = '' . - '' . - '' . - ''; - $browser = $this->createBrowser($this->createUserAgent(array( - 'http://site.with.nested.frames/' => $outer, - 'http://site.with.nested.frames/inner.html' => $inner, - 'http://site.with.nested.frames/one.html' => 'Page one', - 'http://site.with.nested.frames/two.html' => 'Page two', - 'http://site.with.nested.frames/three.html' => 'Page three'))); - - $browser->get('http://site.with.nested.frames/'); - $this->assertEqual($browser->getContent(), 'Page onePage twoPage three'); - - $this->assertTrue($browser->setFrameFocus('inner')); - $this->assertEqual($browser->getFrameFocus(), array('inner')); - $this->assertTrue($browser->setFrameFocus('one')); - $this->assertEqual($browser->getFrameFocus(), array('inner', 'one')); - $this->assertEqual($browser->getContent(), 'Page one'); - - $this->assertTrue($browser->setFrameFocus('two')); - $this->assertEqual($browser->getFrameFocus(), array('inner', 'two')); - $this->assertEqual($browser->getContent(), 'Page two'); - - $browser->clearFrameFocus(); - $this->assertTrue($browser->setFrameFocus('three')); - $this->assertEqual($browser->getFrameFocus(), array('three')); - $this->assertEqual($browser->getContent(), 'Page three'); - - $this->assertTrue($browser->setFrameFocus('inner')); - $this->assertEqual($browser->getContent(), 'Page onePage two'); - } - - function testCanNavigateToNestedFrameByIndex() { - $inner = '' . - '' . - '' . - ''; - $outer = '' . - '' . - '' . - ''; - $browser = $this->createBrowser($this->createUserAgent(array( - 'http://site.with.nested.frames/' => $outer, - 'http://site.with.nested.frames/inner.html' => $inner, - 'http://site.with.nested.frames/one.html' => 'Page one', - 'http://site.with.nested.frames/two.html' => 'Page two', - 'http://site.with.nested.frames/three.html' => 'Page three'))); - - $browser->get('http://site.with.nested.frames/'); - $this->assertEqual($browser->getContent(), 'Page onePage twoPage three'); - - $this->assertTrue($browser->setFrameFocusByIndex(1)); - $this->assertEqual($browser->getFrameFocus(), array(1)); - $this->assertTrue($browser->setFrameFocusByIndex(1)); - $this->assertEqual($browser->getFrameFocus(), array(1, 1)); - $this->assertEqual($browser->getContent(), 'Page one'); - - $this->assertTrue($browser->setFrameFocusByIndex(2)); - $this->assertEqual($browser->getFrameFocus(), array(1, 2)); - $this->assertEqual($browser->getContent(), 'Page two'); - - $browser->clearFrameFocus(); - $this->assertTrue($browser->setFrameFocusByIndex(2)); - $this->assertEqual($browser->getFrameFocus(), array(2)); - $this->assertEqual($browser->getContent(), 'Page three'); - - $this->assertTrue($browser->setFrameFocusByIndex(1)); - $this->assertEqual($browser->getContent(), 'Page onePage two'); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/collector_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/collector_test.php deleted file mode 100644 index efdbf37..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/collector_test.php +++ /dev/null @@ -1,50 +0,0 @@ -expectMinimumCallCount('addFile', 2); - $suite->expect( - 'addFile', - array(new PatternExpectation('/collectable\\.(1|2)$/'))); - $collector = new SimpleCollector(); - $collector->collect($suite, dirname(__FILE__) . '/support/collector/'); - } -} - -class TestOfPatternCollector extends UnitTestCase { - - function testAddingEverythingToGroup() { - $suite = new MockTestSuite(); - $suite->expectCallCount('addFile', 2); - $suite->expect( - 'addFile', - array(new PatternExpectation('/collectable\\.(1|2)$/'))); - $collector = new SimplePatternCollector('/.*/'); - $collector->collect($suite, dirname(__FILE__) . '/support/collector/'); - } - - function testOnlyMatchedFilesAreAddedToGroup() { - $suite = new MockTestSuite(); - $suite->expectOnce('addFile', array(new PathEqualExpectation( - dirname(__FILE__) . '/support/collector/collectable.1'))); - $collector = new SimplePatternCollector('/1$/'); - $collector->collect($suite, dirname(__FILE__) . '/support/collector/'); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/command_line_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/command_line_test.php deleted file mode 100644 index 5baabff..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/command_line_test.php +++ /dev/null @@ -1,40 +0,0 @@ -assertIdentical($parser->getTest(), ''); - $this->assertIdentical($parser->getTestCase(), ''); - } - - function testNotXmlByDefault() { - $parser = new SimpleCommandLineParser(array()); - $this->assertFalse($parser->isXml()); - } - - function testCanDetectRequestForXml() { - $parser = new SimpleCommandLineParser(array('--xml')); - $this->assertTrue($parser->isXml()); - } - - function testCanReadAssignmentSyntax() { - $parser = new SimpleCommandLineParser(array('--test=myTest')); - $this->assertEqual($parser->getTest(), 'myTest'); - } - - function testCanReadFollowOnSyntax() { - $parser = new SimpleCommandLineParser(array('--test', 'myTest')); - $this->assertEqual($parser->getTest(), 'myTest'); - } - - function testCanReadShortForms() { - $parser = new SimpleCommandLineParser(array('-t', 'myTest', '-c', 'MyClass', '-x')); - $this->assertEqual($parser->getTest(), 'myTest'); - $this->assertEqual($parser->getTestCase(), 'MyClass'); - $this->assertTrue($parser->isXml()); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/compatibility_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/compatibility_test.php deleted file mode 100644 index b8635e5..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/compatibility_test.php +++ /dev/null @@ -1,87 +0,0 @@ -assertTrue(SimpleTestCompatibility::isA( - new ComparisonClass(), - 'ComparisonClass')); - $this->assertFalse(SimpleTestCompatibility::isA( - new ComparisonClass(), - 'ComparisonSubclass')); - $this->assertTrue(SimpleTestCompatibility::isA( - new ComparisonSubclass(), - 'ComparisonClass')); - } - - function testIdentityOfNumericStrings() { - $numericString1 = "123"; - $numericString2 = "00123"; - $this->assertNotIdentical($numericString1, $numericString2); - } - - function testIdentityOfObjects() { - $object1 = new ComparisonClass(); - $object2 = new ComparisonClass(); - $this->assertIdentical($object1, $object2); - } - - function testReferences () { - $thing = "Hello"; - $thing_reference = &$thing; - $thing_copy = $thing; - $this->assertTrue(SimpleTestCompatibility::isReference( - $thing, - $thing)); - $this->assertTrue(SimpleTestCompatibility::isReference( - $thing, - $thing_reference)); - $this->assertFalse(SimpleTestCompatibility::isReference( - $thing, - $thing_copy)); - } - - function testObjectReferences () { - $object = new ComparisonClass(); - $object_reference = $object; - $object_copy = new ComparisonClass(); - $object_assignment = $object; - $this->assertTrue(SimpleTestCompatibility::isReference( - $object, - $object)); - $this->assertTrue(SimpleTestCompatibility::isReference( - $object, - $object_reference)); - $this->assertFalse(SimpleTestCompatibility::isReference( - $object, - $object_copy)); - if (version_compare(phpversion(), '5', '>=')) { - $this->assertTrue(SimpleTestCompatibility::isReference( - $object, - $object_assignment)); - } else { - $this->assertFalse(SimpleTestCompatibility::isReference( - $object, - $object_assignment)); - } - } - - function testInteraceComparison() { - $object = new ComparisonClassWithInterface(); - $this->assertFalse(SimpleTestCompatibility::isA( - new ComparisonClass(), - 'ComparisonInterface')); - $this->assertTrue(SimpleTestCompatibility::isA( - new ComparisonClassWithInterface(), - 'ComparisonInterface')); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/cookies_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/cookies_test.php deleted file mode 100644 index 0b49e43..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/cookies_test.php +++ /dev/null @@ -1,227 +0,0 @@ -assertFalse($cookie->getValue()); - $this->assertEqual($cookie->getPath(), "/"); - $this->assertIdentical($cookie->getHost(), false); - $this->assertFalse($cookie->getExpiry()); - $this->assertFalse($cookie->isSecure()); - } - - function testCookieAccessors() { - $cookie = new SimpleCookie( - "name", - "value", - "/path", - "Mon, 18 Nov 2002 15:50:29 GMT", - true); - $this->assertEqual($cookie->getName(), "name"); - $this->assertEqual($cookie->getValue(), "value"); - $this->assertEqual($cookie->getPath(), "/path/"); - $this->assertEqual($cookie->getExpiry(), "Mon, 18 Nov 2002 15:50:29 GMT"); - $this->assertTrue($cookie->isSecure()); - } - - function testFullHostname() { - $cookie = new SimpleCookie("name"); - $this->assertTrue($cookie->setHost("host.name.here")); - $this->assertEqual($cookie->getHost(), "host.name.here"); - $this->assertTrue($cookie->setHost("host.com")); - $this->assertEqual($cookie->getHost(), "host.com"); - } - - function testHostTruncation() { - $cookie = new SimpleCookie("name"); - $cookie->setHost("this.host.name.here"); - $this->assertEqual($cookie->getHost(), "host.name.here"); - $cookie->setHost("this.host.com"); - $this->assertEqual($cookie->getHost(), "host.com"); - $this->assertTrue($cookie->setHost("dashes.in-host.com")); - $this->assertEqual($cookie->getHost(), "in-host.com"); - } - - function testBadHosts() { - $cookie = new SimpleCookie("name"); - $this->assertFalse($cookie->setHost("gibberish")); - $this->assertFalse($cookie->setHost("host.here")); - $this->assertFalse($cookie->setHost("host..com")); - $this->assertFalse($cookie->setHost("...")); - $this->assertFalse($cookie->setHost("host.com.")); - } - - function testHostValidity() { - $cookie = new SimpleCookie("name"); - $cookie->setHost("this.host.name.here"); - $this->assertTrue($cookie->isValidHost("host.name.here")); - $this->assertTrue($cookie->isValidHost("that.host.name.here")); - $this->assertFalse($cookie->isValidHost("bad.host")); - $this->assertFalse($cookie->isValidHost("nearly.name.here")); - } - - function testPathValidity() { - $cookie = new SimpleCookie("name", "value", "/path"); - $this->assertFalse($cookie->isValidPath("/")); - $this->assertTrue($cookie->isValidPath("/path/")); - $this->assertTrue($cookie->isValidPath("/path/more")); - } - - function testSessionExpiring() { - $cookie = new SimpleCookie("name", "value", "/path"); - $this->assertTrue($cookie->isExpired(0)); - } - - function testTimestampExpiry() { - $cookie = new SimpleCookie("name", "value", "/path", 456); - $this->assertFalse($cookie->isExpired(0)); - $this->assertTrue($cookie->isExpired(457)); - $this->assertFalse($cookie->isExpired(455)); - } - - function testDateExpiry() { - $cookie = new SimpleCookie( - "name", - "value", - "/path", - "Mon, 18 Nov 2002 15:50:29 GMT"); - $this->assertTrue($cookie->isExpired("Mon, 18 Nov 2002 15:50:30 GMT")); - $this->assertFalse($cookie->isExpired("Mon, 18 Nov 2002 15:50:28 GMT")); - } - - function testAging() { - $cookie = new SimpleCookie("name", "value", "/path", 200); - $cookie->agePrematurely(199); - $this->assertFalse($cookie->isExpired(0)); - $cookie->agePrematurely(2); - $this->assertTrue($cookie->isExpired(0)); - } -} - -class TestOfCookieJar extends UnitTestCase { - - function testAddCookie() { - $jar = new SimpleCookieJar(); - $jar->setCookie("a", "A"); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/')), array('a=A')); - } - - function testHostFilter() { - $jar = new SimpleCookieJar(); - $jar->setCookie('a', 'A', 'my-host.com'); - $jar->setCookie('b', 'B', 'another-host.com'); - $jar->setCookie('c', 'C'); - $this->assertEqual( - $jar->selectAsPairs(new SimpleUrl('my-host.com')), - array('a=A', 'c=C')); - $this->assertEqual( - $jar->selectAsPairs(new SimpleUrl('another-host.com')), - array('b=B', 'c=C')); - $this->assertEqual( - $jar->selectAsPairs(new SimpleUrl('www.another-host.com')), - array('b=B', 'c=C')); - $this->assertEqual( - $jar->selectAsPairs(new SimpleUrl('new-host.org')), - array('c=C')); - $this->assertEqual( - $jar->selectAsPairs(new SimpleUrl('/')), - array('a=A', 'b=B', 'c=C')); - } - - function testPathFilter() { - $jar = new SimpleCookieJar(); - $jar->setCookie('a', 'A', false, '/path/'); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/')), array()); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/elsewhere')), array()); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/path/')), array('a=A')); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/path')), array('a=A')); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/pa')), array()); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/path/here')), array('a=A')); - } - - function testPathFilterDeeply() { - $jar = new SimpleCookieJar(); - $jar->setCookie('a', 'A', false, '/path/more_path/'); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/path/')), array()); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/path')), array()); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/pa')), array()); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/path/more_path/')), array('a=A')); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/path/more_path/and_more')), array('a=A')); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/path/not_here/')), array()); - } - - function testMultipleCookieWithDifferentPathsButSameName() { - $jar = new SimpleCookieJar(); - $jar->setCookie('a', 'abc', false, '/'); - $jar->setCookie('a', '123', false, '/path/here/'); - $this->assertEqual( - $jar->selectAsPairs(new SimpleUrl('/')), - array('a=abc')); - $this->assertEqual( - $jar->selectAsPairs(new SimpleUrl('my-host.com/')), - array('a=abc')); - $this->assertEqual( - $jar->selectAsPairs(new SimpleUrl('my-host.com/path/')), - array('a=abc')); - $this->assertEqual( - $jar->selectAsPairs(new SimpleUrl('my-host.com/path/here')), - array('a=abc', 'a=123')); - $this->assertEqual( - $jar->selectAsPairs(new SimpleUrl('my-host.com/path/here/there')), - array('a=abc', 'a=123')); - } - - function testOverwrite() { - $jar = new SimpleCookieJar(); - $jar->setCookie('a', 'abc', false, '/'); - $jar->setCookie('a', 'cde', false, '/'); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/')), array('a=cde')); - } - - function testClearSessionCookies() { - $jar = new SimpleCookieJar(); - $jar->setCookie('a', 'A', false, '/'); - $jar->restartSession(); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/')), array()); - } - - function testExpiryFilterByDate() { - $jar = new SimpleCookieJar(); - $jar->setCookie('a', 'A', false, '/', 'Wed, 25-Dec-02 04:24:20 GMT'); - $jar->restartSession("Wed, 25-Dec-02 04:24:19 GMT"); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/')), array('a=A')); - $jar->restartSession("Wed, 25-Dec-02 04:24:21 GMT"); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/')), array()); - } - - function testExpiryFilterByAgeing() { - $jar = new SimpleCookieJar(); - $jar->setCookie('a', 'A', false, '/', 'Wed, 25-Dec-02 04:24:20 GMT'); - $jar->restartSession("Wed, 25-Dec-02 04:24:19 GMT"); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/')), array('a=A')); - $jar->agePrematurely(2); - $jar->restartSession("Wed, 25-Dec-02 04:24:19 GMT"); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/')), array()); - } - - function testCookieClearing() { - $jar = new SimpleCookieJar(); - $jar->setCookie('a', 'abc', false, '/'); - $jar->setCookie('a', '', false, '/'); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/')), array('a=')); - } - - function testCookieClearByLoweringDate() { - $jar = new SimpleCookieJar(); - $jar->setCookie('a', 'abc', false, '/', 'Wed, 25-Dec-02 04:24:21 GMT'); - $jar->setCookie('a', 'def', false, '/', 'Wed, 25-Dec-02 04:24:19 GMT'); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/')), array('a=def')); - $jar->restartSession('Wed, 25-Dec-02 04:24:20 GMT'); - $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/')), array()); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/detached_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/detached_test.php deleted file mode 100644 index 06db828..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/detached_test.php +++ /dev/null @@ -1,15 +0,0 @@ -addTestCase(new DetachedTestCase($command)); -if (SimpleReporter::inCli()) { - exit ($test->run(new TextReporter()) ? 0 : 1); -} -$test->run(new HtmlReporter()); -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/dumper_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/dumper_test.php deleted file mode 100644 index 789047d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/dumper_test.php +++ /dev/null @@ -1,88 +0,0 @@ -assertEqual( - $dumper->clipString("Hello", 6), - "Hello", - "Hello, 6->%s"); - $this->assertEqual( - $dumper->clipString("Hello", 5), - "Hello", - "Hello, 5->%s"); - $this->assertEqual( - $dumper->clipString("Hello world", 3), - "Hel...", - "Hello world, 3->%s"); - $this->assertEqual( - $dumper->clipString("Hello world", 6, 3), - "Hello ...", - "Hello world, 6, 3->%s"); - $this->assertEqual( - $dumper->clipString("Hello world", 3, 6), - "...o w...", - "Hello world, 3, 6->%s"); - $this->assertEqual( - $dumper->clipString("Hello world", 4, 11), - "...orld", - "Hello world, 4, 11->%s"); - $this->assertEqual( - $dumper->clipString("Hello world", 4, 12), - "...orld", - "Hello world, 4, 12->%s"); - } - - function testDescribeNull() { - $dumper = new SimpleDumper(); - $this->assertPattern('/null/i', $dumper->describeValue(null)); - } - - function testDescribeBoolean() { - $dumper = new SimpleDumper(); - $this->assertPattern('/boolean/i', $dumper->describeValue(true)); - $this->assertPattern('/true/i', $dumper->describeValue(true)); - $this->assertPattern('/false/i', $dumper->describeValue(false)); - } - - function testDescribeString() { - $dumper = new SimpleDumper(); - $this->assertPattern('/string/i', $dumper->describeValue('Hello')); - $this->assertPattern('/Hello/', $dumper->describeValue('Hello')); - } - - function testDescribeInteger() { - $dumper = new SimpleDumper(); - $this->assertPattern('/integer/i', $dumper->describeValue(35)); - $this->assertPattern('/35/', $dumper->describeValue(35)); - } - - function testDescribeFloat() { - $dumper = new SimpleDumper(); - $this->assertPattern('/float/i', $dumper->describeValue(0.99)); - $this->assertPattern('/0\.99/', $dumper->describeValue(0.99)); - } - - function testDescribeArray() { - $dumper = new SimpleDumper(); - $this->assertPattern('/array/i', $dumper->describeValue(array(1, 4))); - $this->assertPattern('/2/i', $dumper->describeValue(array(1, 4))); - } - - function testDescribeObject() { - $dumper = new SimpleDumper(); - $this->assertPattern( - '/object/i', - $dumper->describeValue(new DumperDummy())); - $this->assertPattern( - '/DumperDummy/i', - $dumper->describeValue(new DumperDummy())); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/eclipse_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/eclipse_test.php deleted file mode 100644 index c90cbc9..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/eclipse_test.php +++ /dev/null @@ -1,32 +0,0 @@ -expectOnce('write',array($expected)); - $listener->setReturnValue('write',-1); - - $pathparts = pathinfo($fullpath); - $filename = $pathparts['basename']; - $test= &new TestSuite($filename); - $test->addTestFile($fullpath); - $test->run(new EclipseReporter($listener)); - $this->assertEqual($expected,$listener->output); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/encoding_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/encoding_test.php deleted file mode 100644 index 91d80db..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/encoding_test.php +++ /dev/null @@ -1,213 +0,0 @@ -assertEqual($pair->asRequest(), 'a=A'); - } - - function testMimeEncodedAsHeadersAndContent() { - $pair = new SimpleEncodedPair('a', 'A'); - $this->assertEqual( - $pair->asMime(), - "Content-Disposition: form-data; name=\"a\"\r\n\r\nA"); - } - - function testAttachmentEncodedAsHeadersWithDispositionAndContent() { - $part = new SimpleAttachment('a', 'A', 'aaa.txt'); - $this->assertEqual( - $part->asMime(), - "Content-Disposition: form-data; name=\"a\"; filename=\"aaa.txt\"\r\n" . - "Content-Type: text/plain\r\n\r\nA"); - } -} - -class TestOfEncoding extends UnitTestCase { - private $content_so_far; - - function write($content) { - $this->content_so_far .= $content; - } - - function clear() { - $this->content_so_far = ''; - } - - function assertWritten($encoding, $content, $message = '%s') { - $this->clear(); - $encoding->writeTo($this); - $this->assertIdentical($this->content_so_far, $content, $message); - } - - function testGetEmpty() { - $encoding = new SimpleGetEncoding(); - $this->assertIdentical($encoding->getValue('a'), false); - $this->assertIdentical($encoding->asUrlRequest(), ''); - } - - function testPostEmpty() { - $encoding = new SimplePostEncoding(); - $this->assertIdentical($encoding->getValue('a'), false); - $this->assertWritten($encoding, ''); - } - - function testPrefilled() { - $encoding = new SimplePostEncoding(array('a' => 'aaa')); - $this->assertIdentical($encoding->getValue('a'), 'aaa'); - $this->assertWritten($encoding, 'a=aaa'); - } - - function testPrefilledWithTwoLevels() { - $query = array('a' => array('aa' => 'aaa')); - $encoding = new SimplePostEncoding($query); - $this->assertTrue($encoding->hasMoreThanOneLevel($query)); - $this->assertEqual($encoding->rewriteArrayWithMultipleLevels($query), array('a[aa]' => 'aaa')); - $this->assertIdentical($encoding->getValue('a[aa]'), 'aaa'); - $this->assertWritten($encoding, 'a%5Baa%5D=aaa'); - } - - function testPrefilledWithThreeLevels() { - $query = array('a' => array('aa' => array('aaa' => 'aaaa'))); - $encoding = new SimplePostEncoding($query); - $this->assertTrue($encoding->hasMoreThanOneLevel($query)); - $this->assertEqual($encoding->rewriteArrayWithMultipleLevels($query), array('a[aa][aaa]' => 'aaaa')); - $this->assertIdentical($encoding->getValue('a[aa][aaa]'), 'aaaa'); - $this->assertWritten($encoding, 'a%5Baa%5D%5Baaa%5D=aaaa'); - } - - function testPrefilledWithObject() { - $encoding = new SimplePostEncoding(new SimpleEncoding(array('a' => 'aaa'))); - $this->assertIdentical($encoding->getValue('a'), 'aaa'); - $this->assertWritten($encoding, 'a=aaa'); - } - - function testMultiplePrefilled() { - $query = array('a' => array('a1', 'a2')); - $encoding = new SimplePostEncoding($query); - $this->assertTrue($encoding->hasMoreThanOneLevel($query)); - $this->assertEqual($encoding->rewriteArrayWithMultipleLevels($query), array('a[0]' => 'a1', 'a[1]' => 'a2')); - $this->assertIdentical($encoding->getValue('a[0]'), 'a1'); - $this->assertIdentical($encoding->getValue('a[1]'), 'a2'); - $this->assertWritten($encoding, 'a%5B0%5D=a1&a%5B1%5D=a2'); - } - - function testSingleParameter() { - $encoding = new SimplePostEncoding(); - $encoding->add('a', 'Hello'); - $this->assertEqual($encoding->getValue('a'), 'Hello'); - $this->assertWritten($encoding, 'a=Hello'); - } - - function testFalseParameter() { - $encoding = new SimplePostEncoding(); - $encoding->add('a', false); - $this->assertEqual($encoding->getValue('a'), false); - $this->assertWritten($encoding, ''); - } - - function testUrlEncoding() { - $encoding = new SimplePostEncoding(); - $encoding->add('a', 'Hello there!'); - $this->assertWritten($encoding, 'a=Hello+there%21'); - } - - function testUrlEncodingOfKey() { - $encoding = new SimplePostEncoding(); - $encoding->add('a!', 'Hello'); - $this->assertWritten($encoding, 'a%21=Hello'); - } - - function testMultipleParameter() { - $encoding = new SimplePostEncoding(); - $encoding->add('a', 'Hello'); - $encoding->add('b', 'Goodbye'); - $this->assertWritten($encoding, 'a=Hello&b=Goodbye'); - } - - function testEmptyParameters() { - $encoding = new SimplePostEncoding(); - $encoding->add('a', ''); - $encoding->add('b', ''); - $this->assertWritten($encoding, 'a=&b='); - } - - function testRepeatedParameter() { - $encoding = new SimplePostEncoding(); - $encoding->add('a', 'Hello'); - $encoding->add('a', 'Goodbye'); - $this->assertIdentical($encoding->getValue('a'), array('Hello', 'Goodbye')); - $this->assertWritten($encoding, 'a=Hello&a=Goodbye'); - } - - function testAddingLists() { - $encoding = new SimplePostEncoding(); - $encoding->add('a', array('Hello', 'Goodbye')); - $this->assertIdentical($encoding->getValue('a'), array('Hello', 'Goodbye')); - $this->assertWritten($encoding, 'a=Hello&a=Goodbye'); - } - - function testMergeInHash() { - $encoding = new SimpleGetEncoding(array('a' => 'A1', 'b' => 'B')); - $encoding->merge(array('a' => 'A2')); - $this->assertIdentical($encoding->getValue('a'), array('A1', 'A2')); - $this->assertIdentical($encoding->getValue('b'), 'B'); - } - - function testMergeInObject() { - $encoding = new SimpleGetEncoding(array('a' => 'A1', 'b' => 'B')); - $encoding->merge(new SimpleEncoding(array('a' => 'A2'))); - $this->assertIdentical($encoding->getValue('a'), array('A1', 'A2')); - $this->assertIdentical($encoding->getValue('b'), 'B'); - } - - function testPrefilledMultipart() { - $encoding = new SimpleMultipartEncoding(array('a' => 'aaa'), 'boundary'); - $this->assertIdentical($encoding->getValue('a'), 'aaa'); - $this->assertwritten($encoding, - "--boundary\r\n" . - "Content-Disposition: form-data; name=\"a\"\r\n" . - "\r\n" . - "aaa\r\n" . - "--boundary--\r\n"); - } - - function testAttachment() { - $encoding = new SimpleMultipartEncoding(array(), 'boundary'); - $encoding->attach('a', 'aaa', 'aaa.txt'); - $this->assertIdentical($encoding->getValue('a'), 'aaa.txt'); - $this->assertwritten($encoding, - "--boundary\r\n" . - "Content-Disposition: form-data; name=\"a\"; filename=\"aaa.txt\"\r\n" . - "Content-Type: text/plain\r\n" . - "\r\n" . - "aaa\r\n" . - "--boundary--\r\n"); - } -} - -class TestOfFormHeaders extends UnitTestCase { - - function testEmptyEncodingWritesZeroContentLength() { - $socket = new MockSimpleSocket(); - $socket->expectAt(0, 'write', array("Content-Length: 0\r\n")); - $socket->expectAt(1, 'write', array("Content-Type: application/x-www-form-urlencoded\r\n")); - $encoding = new SimplePostEncoding(); - $encoding->writeHeadersTo($socket); - } - - function testEmptyMultipartEncodingWritesEndBoundaryContentLength() { - $socket = new MockSimpleSocket(); - $socket->expectAt(0, 'write', array("Content-Length: 14\r\n")); - $socket->expectAt(1, 'write', array("Content-Type: multipart/form-data, boundary=boundary\r\n")); - $encoding = new SimpleMultipartEncoding(array(), 'boundary'); - $encoding->writeHeadersTo($socket); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/errors_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/errors_test.php deleted file mode 100644 index ebb9e05..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/errors_test.php +++ /dev/null @@ -1,229 +0,0 @@ -get('SimpleErrorQueue'); - $queue->clear(); - } - - function tearDown() { - $context = SimpleTest::getContext(); - $queue = $context->get('SimpleErrorQueue'); - $queue->clear(); - } - - function testExpectationMatchCancelsIncomingError() { - $test = new MockSimpleTestCase(); - $test->expectOnce('assert', array( - new IdenticalExpectation(new AnythingExpectation()), - 'B', - 'a message')); - $test->setReturnValue('assert', true); - $test->expectNever('error'); - $queue = new SimpleErrorQueue(); - $queue->setTestCase($test); - $queue->expectError(new AnythingExpectation(), 'a message'); - $queue->add(1024, 'B', 'b.php', 100); - } -} - -class TestOfErrorTrap extends UnitTestCase { - private $old; - - function setUp() { - $this->old = error_reporting(E_ALL); - set_error_handler('SimpleTestErrorHandler'); - } - - function tearDown() { - restore_error_handler(); - error_reporting($this->old); - } - - function testQueueStartsEmpty() { - $context = SimpleTest::getContext(); - $queue = $context->get('SimpleErrorQueue'); - $this->assertFalse($queue->extract()); - } - - function testErrorsAreSwallowedByMatchingExpectation() { - $this->expectError('Ouch!'); - trigger_error('Ouch!'); - } - - function testErrorsAreSwallowedInOrder() { - $this->expectError('a'); - $this->expectError('b'); - trigger_error('a'); - trigger_error('b'); - } - - function testAnyErrorCanBeSwallowed() { - $this->expectError(); - trigger_error('Ouch!'); - } - - function testErrorCanBeSwallowedByPatternMatching() { - $this->expectError(new PatternExpectation('/ouch/i')); - trigger_error('Ouch!'); - } - - function testErrorWithPercentsPassesWithNoSprintfError() { - $this->expectError("%"); - trigger_error('%'); - } -} - -class TestOfErrors extends UnitTestCase { - private $old; - - function setUp() { - $this->old = error_reporting(E_ALL); - } - - function tearDown() { - error_reporting($this->old); - } - - function testDefaultWhenAllReported() { - error_reporting(E_ALL); - $this->expectError('Ouch!'); - trigger_error('Ouch!'); - } - - function testNoticeWhenReported() { - error_reporting(E_ALL); - $this->expectError('Ouch!'); - trigger_error('Ouch!', E_USER_NOTICE); - } - - function testWarningWhenReported() { - error_reporting(E_ALL); - $this->expectError('Ouch!'); - trigger_error('Ouch!', E_USER_WARNING); - } - - function testErrorWhenReported() { - error_reporting(E_ALL); - $this->expectError('Ouch!'); - trigger_error('Ouch!', E_USER_ERROR); - } - - function testNoNoticeWhenNotReported() { - error_reporting(0); - trigger_error('Ouch!', E_USER_NOTICE); - } - - function testNoWarningWhenNotReported() { - error_reporting(0); - trigger_error('Ouch!', E_USER_WARNING); - } - - function testNoticeSuppressedWhenReported() { - error_reporting(E_ALL); - @trigger_error('Ouch!', E_USER_NOTICE); - } - - function testWarningSuppressedWhenReported() { - error_reporting(E_ALL); - @trigger_error('Ouch!', E_USER_WARNING); - } - - function testErrorWithPercentsReportedWithNoSprintfError() { - $this->expectError('%'); - trigger_error('%'); - } -} - -class TestOfPHP52RecoverableErrors extends UnitTestCase { - function skip() { - $this->skipIf( - version_compare(phpversion(), '5.2', '<'), - 'E_RECOVERABLE_ERROR not tested for PHP below 5.2'); - } - - function testError() { - eval(' - class RecoverableErrorTestingStub { - function ouch(RecoverableErrorTestingStub $obj) { - } - } - '); - - $stub = new RecoverableErrorTestingStub(); - $this->expectError(new PatternExpectation('/must be an instance of RecoverableErrorTestingStub/i')); - $stub->ouch(new stdClass()); - } -} - -class TestOfErrorsExcludingPHP52AndAbove extends UnitTestCase { - function skip() { - $this->skipIf( - version_compare(phpversion(), '5.2', '>='), - 'E_USER_ERROR not tested for PHP 5.2 and above'); - } - - function testNoErrorWhenNotReported() { - error_reporting(0); - trigger_error('Ouch!', E_USER_ERROR); - } - - function testErrorSuppressedWhenReported() { - error_reporting(E_ALL); - @trigger_error('Ouch!', E_USER_ERROR); - } -} - -SimpleTest::ignore('TestOfNotEnoughErrors'); -/** - * This test is ignored as it is used by {@link TestRunnerForLeftOverAndNotEnoughErrors} - * to verify that it fails as expected. - * - * @ignore - */ -class TestOfNotEnoughErrors extends UnitTestCase { - function testExpectTwoErrorsThrowOne() { - $this->expectError('Error 1'); - trigger_error('Error 1'); - $this->expectError('Error 2'); - } -} - -SimpleTest::ignore('TestOfLeftOverErrors'); -/** - * This test is ignored as it is used by {@link TestRunnerForLeftOverAndNotEnoughErrors} - * to verify that it fails as expected. - * - * @ignore - */ -class TestOfLeftOverErrors extends UnitTestCase { - function testExpectOneErrorGetTwo() { - $this->expectError('Error 1'); - trigger_error('Error 1'); - trigger_error('Error 2'); - } -} - -class TestRunnerForLeftOverAndNotEnoughErrors extends UnitTestCase { - function testRunLeftOverErrorsTestCase() { - $test = new TestOfLeftOverErrors(); - $this->assertFalse($test->run(new SimpleReporter())); - } - - function testRunNotEnoughErrors() { - $test = new TestOfNotEnoughErrors(); - $this->assertFalse($test->run(new SimpleReporter())); - } -} - -// TODO: Add stacked error handler test -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/exceptions_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/exceptions_test.php deleted file mode 100644 index 9cc35c5..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/exceptions_test.php +++ /dev/null @@ -1,153 +0,0 @@ -assertTrue($expectation->test(new MyTestException())); - $this->assertTrue($expectation->test(new HigherTestException())); - $this->assertFalse($expectation->test(new OtherTestException())); - } - - function testMatchesClassAndMessageWhenExceptionExpected() { - $expectation = new ExceptionExpectation(new MyTestException('Hello')); - $this->assertTrue($expectation->test(new MyTestException('Hello'))); - $this->assertFalse($expectation->test(new HigherTestException('Hello'))); - $this->assertFalse($expectation->test(new OtherTestException('Hello'))); - $this->assertFalse($expectation->test(new MyTestException('Goodbye'))); - $this->assertFalse($expectation->test(new MyTestException())); - } - - function testMessagelessExceptionMatchesOnlyOnClass() { - $expectation = new ExceptionExpectation(new MyTestException()); - $this->assertTrue($expectation->test(new MyTestException())); - $this->assertFalse($expectation->test(new HigherTestException())); - } -} - -class TestOfExceptionTrap extends UnitTestCase { - - function testNoExceptionsInQueueMeansNoTestMessages() { - $test = new MockSimpleTestCase(); - $test->expectNever('assert'); - $queue = new SimpleExceptionTrap(); - $this->assertFalse($queue->isExpected($test, new Exception())); - } - - function testMatchingExceptionGivesTrue() { - $expectation = new MockSimpleExpectation(); - $expectation->setReturnValue('test', true); - $test = new MockSimpleTestCase(); - $test->setReturnValue('assert', true); - $queue = new SimpleExceptionTrap(); - $queue->expectException($expectation, 'message'); - $this->assertTrue($queue->isExpected($test, new Exception())); - } - - function testMatchingExceptionTriggersAssertion() { - $test = new MockSimpleTestCase(); - $test->expectOnce('assert', array( - '*', - new ExceptionExpectation(new Exception()), - 'message')); - $queue = new SimpleExceptionTrap(); - $queue->expectException(new ExceptionExpectation(new Exception()), 'message'); - $queue->isExpected($test, new Exception()); - } -} - -class TestOfCatchingExceptions extends UnitTestCase { - - function testCanCatchAnyExpectedException() { - $this->expectException(); - throw new Exception(); - } - - function testCanMatchExceptionByClass() { - $this->expectException('MyTestException'); - throw new HigherTestException(); - } - - function testCanMatchExceptionExactly() { - $this->expectException(new Exception('Ouch')); - throw new Exception('Ouch'); - } - - function testLastListedExceptionIsTheOneThatCounts() { - $this->expectException('OtherTestException'); - $this->expectException('MyTestException'); - throw new HigherTestException(); - } -} - -class TestOfCallingTearDownAfterExceptions extends UnitTestCase { - private $debri = 0; - - function tearDown() { - $this->debri--; - } - - function testLeaveSomeDebri() { - $this->debri++; - $this->expectException(); - throw new Exception(__FUNCTION__); - } - - function testDebriWasRemovedOnce() { - $this->assertEqual($this->debri, 0); - } -} - -class TestOfExceptionThrownInSetUpDoesNotRunTestBody extends UnitTestCase { - - function setUp() { - $this->expectException(); - throw new Exception(); - } - - function testShouldNotBeRun() { - $this->fail('This test body should not be run'); - } - - function testShouldNotBeRunEither() { - $this->fail('This test body should not be run either'); - } -} - -class TestOfExpectExceptionWithSetUp extends UnitTestCase { - - function setUp() { - $this->expectException(); - } - - function testThisExceptionShouldBeCaught() { - throw new Exception(); - } - - function testJustThrowingMyTestException() { - throw new MyTestException(); - } -} - -class TestOfThrowingExceptionsInTearDown extends UnitTestCase { - - function tearDown() { - throw new Exception(); - } - - function testDoesntFatal() { - $this->expectException(); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/expectation_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/expectation_test.php deleted file mode 100644 index 2283c19..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/expectation_test.php +++ /dev/null @@ -1,223 +0,0 @@ -assertTrue($is_true->test(true)); - $this->assertFalse($is_true->test(false)); - } - - function testStringMatch() { - $hello = new EqualExpectation("Hello"); - $this->assertTrue($hello->test("Hello")); - $this->assertFalse($hello->test("Goodbye")); - } - - function testInteger() { - $fifteen = new EqualExpectation(15); - $this->assertTrue($fifteen->test(15)); - $this->assertFalse($fifteen->test(14)); - } - - function testFloat() { - $pi = new EqualExpectation(3.14); - $this->assertTrue($pi->test(3.14)); - $this->assertFalse($pi->test(3.15)); - } - - function testArray() { - $colours = new EqualExpectation(array("r", "g", "b")); - $this->assertTrue($colours->test(array("r", "g", "b"))); - $this->assertFalse($colours->test(array("g", "b", "r"))); - } - - function testHash() { - $is_blue = new EqualExpectation(array("r" => 0, "g" => 0, "b" => 255)); - $this->assertTrue($is_blue->test(array("r" => 0, "g" => 0, "b" => 255))); - $this->assertFalse($is_blue->test(array("r" => 0, "g" => 255, "b" => 0))); - } - - function testHashWithOutOfOrderKeysShouldStillMatch() { - $any_order = new EqualExpectation(array('a' => 1, 'b' => 2)); - $this->assertTrue($any_order->test(array('b' => 2, 'a' => 1))); - } -} - -class TestOfWithin extends UnitTestCase { - - function testWithinFloatingPointMargin() { - $within = new WithinMarginExpectation(1.0, 0.2); - $this->assertFalse($within->test(0.7)); - $this->assertTrue($within->test(0.8)); - $this->assertTrue($within->test(0.9)); - $this->assertTrue($within->test(1.1)); - $this->assertTrue($within->test(1.2)); - $this->assertFalse($within->test(1.3)); - } - - function testOutsideFloatingPointMargin() { - $within = new OutsideMarginExpectation(1.0, 0.2); - $this->assertTrue($within->test(0.7)); - $this->assertFalse($within->test(0.8)); - $this->assertFalse($within->test(1.2)); - $this->assertTrue($within->test(1.3)); - } -} - -class TestOfInequality extends UnitTestCase { - - function testStringMismatch() { - $not_hello = new NotEqualExpectation("Hello"); - $this->assertTrue($not_hello->test("Goodbye")); - $this->assertFalse($not_hello->test("Hello")); - } -} - -class RecursiveNasty { - private $me; - - function RecursiveNasty() { - $this->me = $this; - } -} - -class TestOfIdentity extends UnitTestCase { - - function testType() { - $string = new IdenticalExpectation("37"); - $this->assertTrue($string->test("37")); - $this->assertFalse($string->test(37)); - $this->assertFalse($string->test("38")); - } - - function _testNastyPhp5Bug() { - $this->assertFalse(new RecursiveNasty() != new RecursiveNasty()); - } - - function _testReallyHorribleRecursiveStructure() { - $hopeful = new IdenticalExpectation(new RecursiveNasty()); - $this->assertTrue($hopeful->test(new RecursiveNasty())); - } -} - -class DummyReferencedObject{} - -class TestOfReference extends UnitTestCase { - - function testReference() { - $foo = "foo"; - $ref = &$foo; - $not_ref = $foo; - $bar = "bar"; - - $expect = new ReferenceExpectation($foo); - $this->assertTrue($expect->test($ref)); - $this->assertFalse($expect->test($not_ref)); - $this->assertFalse($expect->test($bar)); - } -} - -class TestOfNonIdentity extends UnitTestCase { - - function testType() { - $string = new NotIdenticalExpectation("37"); - $this->assertTrue($string->test("38")); - $this->assertTrue($string->test(37)); - $this->assertFalse($string->test("37")); - } -} - -class TestOfPatterns extends UnitTestCase { - - function testWanted() { - $pattern = new PatternExpectation('/hello/i'); - $this->assertTrue($pattern->test("Hello world")); - $this->assertFalse($pattern->test("Goodbye world")); - } - - function testUnwanted() { - $pattern = new NoPatternExpectation('/hello/i'); - $this->assertFalse($pattern->test("Hello world")); - $this->assertTrue($pattern->test("Goodbye world")); - } -} - -class ExpectedMethodTarget { - function hasThisMethod() {} -} - -class TestOfMethodExistence extends UnitTestCase { - - function testHasMethod() { - $instance = new ExpectedMethodTarget(); - $expectation = new MethodExistsExpectation('hasThisMethod'); - $this->assertTrue($expectation->test($instance)); - $expectation = new MethodExistsExpectation('doesNotHaveThisMethod'); - $this->assertFalse($expectation->test($instance)); - } -} - -class TestOfIsA extends UnitTestCase { - - function testString() { - $expectation = new IsAExpectation('string'); - $this->assertTrue($expectation->test('Hello')); - $this->assertFalse($expectation->test(5)); - } - - function testBoolean() { - $expectation = new IsAExpectation('boolean'); - $this->assertTrue($expectation->test(true)); - $this->assertFalse($expectation->test(1)); - } - - function testBool() { - $expectation = new IsAExpectation('bool'); - $this->assertTrue($expectation->test(true)); - $this->assertFalse($expectation->test(1)); - } - - function testDouble() { - $expectation = new IsAExpectation('double'); - $this->assertTrue($expectation->test(5.0)); - $this->assertFalse($expectation->test(5)); - } - - function testFloat() { - $expectation = new IsAExpectation('float'); - $this->assertTrue($expectation->test(5.0)); - $this->assertFalse($expectation->test(5)); - } - - function testReal() { - $expectation = new IsAExpectation('real'); - $this->assertTrue($expectation->test(5.0)); - $this->assertFalse($expectation->test(5)); - } - - function testInteger() { - $expectation = new IsAExpectation('integer'); - $this->assertTrue($expectation->test(5)); - $this->assertFalse($expectation->test(5.0)); - } - - function testInt() { - $expectation = new IsAExpectation('int'); - $this->assertTrue($expectation->test(5)); - $this->assertFalse($expectation->test(5.0)); - } -} - -class TestOfNotA extends UnitTestCase { - - function testString() { - $expectation = new NotAExpectation('string'); - $this->assertFalse($expectation->test('Hello')); - $this->assertTrue($expectation->test(5)); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/extensions_tests.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/extensions_tests.php deleted file mode 100644 index b32fa8e..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/extensions_tests.php +++ /dev/null @@ -1,23 +0,0 @@ -skipIf(version_compare(phpversion(), '5', '<'), - 'Many extensions only work with PHP5 and above'); - } - - function ExtensionsTests() { - $this->TestSuite('Extension tests for SimpleTest ' . SimpleTest::getVersion()); - - $nodes = new RecursiveDirectoryIterator(dirname(__FILE__).'/../extensions/'); - foreach(new RecursiveIteratorIterator($nodes) as $node) { - if (preg_match('/test\.php$/', $node->getFilename())) { - $this->addFile($node->getPathname()); - } - } - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/form_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/form_test.php deleted file mode 100644 index de04537..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/form_test.php +++ /dev/null @@ -1,324 +0,0 @@ -returns('getUrl', new SimpleUrl($url)); - $page->returns('expandUrl', new SimpleUrl($url)); - return $page; - } - - function testFormAttributes() { - $tag = new SimpleFormTag(array('method' => 'GET', 'action' => 'here.php', 'id' => '33')); - $form = new SimpleForm($tag, $this->page('http://host/a/index.html')); - $this->assertEqual($form->getMethod(), 'get'); - $this->assertIdentical($form->getId(), '33'); - $this->assertNull($form->getValue(new SimpleByName('a'))); - } - - function testAction() { - $page = new MockSimplePage(); - $page->expectOnce('expandUrl', array(new SimpleUrl('here.php'))); - $page->setReturnValue('expandUrl', new SimpleUrl('http://host/here.php')); - $tag = new SimpleFormTag(array('method' => 'GET', 'action' => 'here.php')); - $form = new SimpleForm($tag, $page); - $this->assertEqual($form->getAction(), new SimpleUrl('http://host/here.php')); - } - - function testEmptyAction() { - $tag = new SimpleFormTag(array('method' => 'GET', 'action' => '', 'id' => '33')); - $form = new SimpleForm($tag, $this->page('http://host/a/index.html')); - $this->assertEqual( - $form->getAction(), - new SimpleUrl('http://host/a/index.html')); - } - - function testMissingAction() { - $tag = new SimpleFormTag(array('method' => 'GET')); - $form = new SimpleForm($tag, $this->page('http://host/a/index.html')); - $this->assertEqual( - $form->getAction(), - new SimpleUrl('http://host/a/index.html')); - } - - function testRootAction() { - $page = new MockSimplePage(); - $page->expectOnce('expandUrl', array(new SimpleUrl('/'))); - $page->setReturnValue('expandUrl', new SimpleUrl('http://host/')); - $tag = new SimpleFormTag(array('method' => 'GET', 'action' => '/')); - $form = new SimpleForm($tag, $page); - $this->assertEqual( - $form->getAction(), - new SimpleUrl('http://host/')); - } - - function testDefaultFrameTargetOnForm() { - $page = new MockSimplePage(); - $page->expectOnce('expandUrl', array(new SimpleUrl('here.php'))); - $page->setReturnValue('expandUrl', new SimpleUrl('http://host/here.php')); - $tag = new SimpleFormTag(array('method' => 'GET', 'action' => 'here.php')); - $form = new SimpleForm($tag, $page); - $form->setDefaultTarget('frame'); - $expected = new SimpleUrl('http://host/here.php'); - $expected->setTarget('frame'); - $this->assertEqual($form->getAction(), $expected); - } - - function testTextWidget() { - $form = new SimpleForm(new SimpleFormTag(array()), $this->page('htp://host')); - $form->addWidget(new SimpleTextTag( - array('name' => 'me', 'type' => 'text', 'value' => 'Myself'))); - $this->assertIdentical($form->getValue(new SimpleByName('me')), 'Myself'); - $this->assertTrue($form->setField(new SimpleByName('me'), 'Not me')); - $this->assertFalse($form->setField(new SimpleByName('not_present'), 'Not me')); - $this->assertIdentical($form->getValue(new SimpleByName('me')), 'Not me'); - $this->assertNull($form->getValue(new SimpleByName('not_present'))); - } - - function testTextWidgetById() { - $form = new SimpleForm(new SimpleFormTag(array()), $this->page('htp://host')); - $form->addWidget(new SimpleTextTag( - array('name' => 'me', 'type' => 'text', 'value' => 'Myself', 'id' => 50))); - $this->assertIdentical($form->getValue(new SimpleById(50)), 'Myself'); - $this->assertTrue($form->setField(new SimpleById(50), 'Not me')); - $this->assertIdentical($form->getValue(new SimpleById(50)), 'Not me'); - } - - function testTextWidgetByLabel() { - $form = new SimpleForm(new SimpleFormTag(array()), $this->page('htp://host')); - $widget = new SimpleTextTag(array('name' => 'me', 'type' => 'text', 'value' => 'a')); - $form->addWidget($widget); - $widget->setLabel('thing'); - $this->assertIdentical($form->getValue(new SimpleByLabel('thing')), 'a'); - $this->assertTrue($form->setField(new SimpleByLabel('thing'), 'b')); - $this->assertIdentical($form->getValue(new SimpleByLabel('thing')), 'b'); - } - - function testSubmitEmpty() { - $form = new SimpleForm(new SimpleFormTag(array()), $this->page('htp://host')); - $this->assertIdentical($form->submit(), new SimpleGetEncoding()); - } - - function testSubmitButton() { - $form = new SimpleForm(new SimpleFormTag(array()), $this->page('http://host')); - $form->addWidget(new SimpleSubmitTag( - array('type' => 'submit', 'name' => 'go', 'value' => 'Go!', 'id' => '9'))); - $this->assertTrue($form->hasSubmit(new SimpleByName('go'))); - $this->assertEqual($form->getValue(new SimpleByName('go')), 'Go!'); - $this->assertEqual($form->getValue(new SimpleById(9)), 'Go!'); - $this->assertEqual( - $form->submitButton(new SimpleByName('go')), - new SimpleGetEncoding(array('go' => 'Go!'))); - $this->assertEqual( - $form->submitButton(new SimpleByLabel('Go!')), - new SimpleGetEncoding(array('go' => 'Go!'))); - $this->assertEqual( - $form->submitButton(new SimpleById(9)), - new SimpleGetEncoding(array('go' => 'Go!'))); - } - - function testSubmitWithAdditionalParameters() { - $form = new SimpleForm(new SimpleFormTag(array()), $this->page('http://host')); - $form->addWidget(new SimpleSubmitTag( - array('type' => 'submit', 'name' => 'go', 'value' => 'Go!'))); - $this->assertEqual( - $form->submitButton(new SimpleByLabel('Go!'), array('a' => 'A')), - new SimpleGetEncoding(array('go' => 'Go!', 'a' => 'A'))); - } - - function testSubmitButtonWithLabelOfSubmit() { - $form = new SimpleForm(new SimpleFormTag(array()), $this->page('http://host')); - $form->addWidget(new SimpleSubmitTag( - array('type' => 'submit', 'name' => 'test', 'value' => 'Submit'))); - $this->assertEqual( - $form->submitButton(new SimpleByName('test')), - new SimpleGetEncoding(array('test' => 'Submit'))); - $this->assertEqual( - $form->submitButton(new SimpleByLabel('Submit')), - new SimpleGetEncoding(array('test' => 'Submit'))); - } - - function testSubmitButtonWithWhitespacePaddedLabelOfSubmit() { - $form = new SimpleForm(new SimpleFormTag(array()), $this->page('http://host')); - $form->addWidget(new SimpleSubmitTag( - array('type' => 'submit', 'name' => 'test', 'value' => ' Submit '))); - $this->assertEqual( - $form->submitButton(new SimpleByLabel('Submit')), - new SimpleGetEncoding(array('test' => ' Submit '))); - } - - function testImageSubmitButton() { - $form = new SimpleForm(new SimpleFormTag(array()), $this->page('htp://host')); - $form->addWidget(new SimpleImageSubmitTag(array( - 'type' => 'image', - 'src' => 'source.jpg', - 'name' => 'go', - 'alt' => 'Go!', - 'id' => '9'))); - $this->assertTrue($form->hasImage(new SimpleByLabel('Go!'))); - $this->assertEqual( - $form->submitImage(new SimpleByLabel('Go!'), 100, 101), - new SimpleGetEncoding(array('go.x' => 100, 'go.y' => 101))); - $this->assertTrue($form->hasImage(new SimpleByName('go'))); - $this->assertEqual( - $form->submitImage(new SimpleByName('go'), 100, 101), - new SimpleGetEncoding(array('go.x' => 100, 'go.y' => 101))); - $this->assertTrue($form->hasImage(new SimpleById(9))); - $this->assertEqual( - $form->submitImage(new SimpleById(9), 100, 101), - new SimpleGetEncoding(array('go.x' => 100, 'go.y' => 101))); - } - - function testImageSubmitButtonWithAdditionalData() { - $form = new SimpleForm(new SimpleFormTag(array()), $this->page('htp://host')); - $form->addWidget(new SimpleImageSubmitTag(array( - 'type' => 'image', - 'src' => 'source.jpg', - 'name' => 'go', - 'alt' => 'Go!'))); - $this->assertEqual( - $form->submitImage(new SimpleByLabel('Go!'), 100, 101, array('a' => 'A')), - new SimpleGetEncoding(array('go.x' => 100, 'go.y' => 101, 'a' => 'A'))); - } - - function testButtonTag() { - $form = new SimpleForm(new SimpleFormTag(array()), $this->page('http://host')); - $widget = new SimpleButtonTag( - array('type' => 'submit', 'name' => 'go', 'value' => 'Go', 'id' => '9')); - $widget->addContent('Go!'); - $form->addWidget($widget); - $this->assertTrue($form->hasSubmit(new SimpleByName('go'))); - $this->assertTrue($form->hasSubmit(new SimpleByLabel('Go!'))); - $this->assertEqual( - $form->submitButton(new SimpleByName('go')), - new SimpleGetEncoding(array('go' => 'Go'))); - $this->assertEqual( - $form->submitButton(new SimpleByLabel('Go!')), - new SimpleGetEncoding(array('go' => 'Go'))); - $this->assertEqual( - $form->submitButton(new SimpleById(9)), - new SimpleGetEncoding(array('go' => 'Go'))); - } - - function testMultipleFieldsWithSameNameSubmitted() { - $form = new SimpleForm(new SimpleFormTag(array()), $this->page('htp://host')); - $input = new SimpleTextTag(array('name' => 'elements[]', 'value' => '1')); - $form->addWidget($input); - $input = new SimpleTextTag(array('name' => 'elements[]', 'value' => '2')); - $form->addWidget($input); - $form->setField(new SimpleByLabelOrName('elements[]'), '3', 1); - $form->setField(new SimpleByLabelOrName('elements[]'), '4', 2); - $submit = $form->submit(); - $requests = $submit->getAll(); - $this->assertEqual(count($requests), 2); - $this->assertIdentical($requests[0], new SimpleEncodedPair('elements[]', '3')); - $this->assertIdentical($requests[1], new SimpleEncodedPair('elements[]', '4')); - } - - function testSingleSelectFieldSubmitted() { - $form = new SimpleForm(new SimpleFormTag(array()), $this->page('htp://host')); - $select = new SimpleSelectionTag(array('name' => 'a')); - $select->addTag(new SimpleOptionTag( - array('value' => 'aaa', 'selected' => ''))); - $form->addWidget($select); - $this->assertIdentical( - $form->submit(), - new SimpleGetEncoding(array('a' => 'aaa'))); - } - - function testSingleSelectFieldSubmittedWithPost() { - $form = new SimpleForm(new SimpleFormTag(array('method' => 'post')), $this->page('htp://host')); - $select = new SimpleSelectionTag(array('name' => 'a')); - $select->addTag(new SimpleOptionTag( - array('value' => 'aaa', 'selected' => ''))); - $form->addWidget($select); - $this->assertIdentical( - $form->submit(), - new SimplePostEncoding(array('a' => 'aaa'))); - } - - function testUnchecked() { - $form = new SimpleForm(new SimpleFormTag(array()), $this->page('htp://host')); - $form->addWidget(new SimpleCheckboxTag( - array('name' => 'me', 'type' => 'checkbox'))); - $this->assertIdentical($form->getValue(new SimpleByName('me')), false); - $this->assertTrue($form->setField(new SimpleByName('me'), 'on')); - $this->assertEqual($form->getValue(new SimpleByName('me')), 'on'); - $this->assertFalse($form->setField(new SimpleByName('me'), 'other')); - $this->assertEqual($form->getValue(new SimpleByName('me')), 'on'); - } - - function testChecked() { - $form = new SimpleForm(new SimpleFormTag(array()), $this->page('htp://host')); - $form->addWidget(new SimpleCheckboxTag( - array('name' => 'me', 'value' => 'a', 'type' => 'checkbox', 'checked' => ''))); - $this->assertIdentical($form->getValue(new SimpleByName('me')), 'a'); - $this->assertTrue($form->setField(new SimpleByName('me'), 'a')); - $this->assertEqual($form->getValue(new SimpleByName('me')), 'a'); - $this->assertTrue($form->setField(new SimpleByName('me'), false)); - $this->assertEqual($form->getValue(new SimpleByName('me')), false); - } - - function testSingleUncheckedRadioButton() { - $form = new SimpleForm(new SimpleFormTag(array()), $this->page('htp://host')); - $form->addWidget(new SimpleRadioButtonTag( - array('name' => 'me', 'value' => 'a', 'type' => 'radio'))); - $this->assertIdentical($form->getValue(new SimpleByName('me')), false); - $this->assertTrue($form->setField(new SimpleByName('me'), 'a')); - $this->assertEqual($form->getValue(new SimpleByName('me')), 'a'); - } - - function testSingleCheckedRadioButton() { - $form = new SimpleForm(new SimpleFormTag(array()), $this->page('htp://host')); - $form->addWidget(new SimpleRadioButtonTag( - array('name' => 'me', 'value' => 'a', 'type' => 'radio', 'checked' => ''))); - $this->assertIdentical($form->getValue(new SimpleByName('me')), 'a'); - $this->assertFalse($form->setField(new SimpleByName('me'), 'other')); - } - - function testUncheckedRadioButtons() { - $form = new SimpleForm(new SimpleFormTag(array()), $this->page('htp://host')); - $form->addWidget(new SimpleRadioButtonTag( - array('name' => 'me', 'value' => 'a', 'type' => 'radio'))); - $form->addWidget(new SimpleRadioButtonTag( - array('name' => 'me', 'value' => 'b', 'type' => 'radio'))); - $this->assertIdentical($form->getValue(new SimpleByName('me')), false); - $this->assertTrue($form->setField(new SimpleByName('me'), 'a')); - $this->assertIdentical($form->getValue(new SimpleByName('me')), 'a'); - $this->assertTrue($form->setField(new SimpleByName('me'), 'b')); - $this->assertIdentical($form->getValue(new SimpleByName('me')), 'b'); - $this->assertFalse($form->setField(new SimpleByName('me'), 'c')); - $this->assertIdentical($form->getValue(new SimpleByName('me')), 'b'); - } - - function testCheckedRadioButtons() { - $form = new SimpleForm(new SimpleFormTag(array()), $this->page('htp://host')); - $form->addWidget(new SimpleRadioButtonTag( - array('name' => 'me', 'value' => 'a', 'type' => 'radio'))); - $form->addWidget(new SimpleRadioButtonTag( - array('name' => 'me', 'value' => 'b', 'type' => 'radio', 'checked' => ''))); - $this->assertIdentical($form->getValue(new SimpleByName('me')), 'b'); - $this->assertTrue($form->setField(new SimpleByName('me'), 'a')); - $this->assertIdentical($form->getValue(new SimpleByName('me')), 'a'); - } - - function testMultipleFieldsWithSameKey() { - $form = new SimpleForm(new SimpleFormTag(array()), $this->page('htp://host')); - $form->addWidget(new SimpleCheckboxTag( - array('name' => 'a', 'type' => 'checkbox', 'value' => 'me'))); - $form->addWidget(new SimpleCheckboxTag( - array('name' => 'a', 'type' => 'checkbox', 'value' => 'you'))); - $this->assertIdentical($form->getValue(new SimpleByName('a')), false); - $this->assertTrue($form->setField(new SimpleByName('a'), 'me')); - $this->assertIdentical($form->getValue(new SimpleByName('a')), 'me'); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/frames_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/frames_test.php deleted file mode 100644 index e3ab719..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/frames_test.php +++ /dev/null @@ -1,549 +0,0 @@ -setReturnValue('getTitle', 'This page'); - $frameset = new SimpleFrameset($page); - $this->assertEqual($frameset->getTitle(), 'This page'); - } - - function TestHeadersReadFromFramesetByDefault() { - $page = new MockSimplePage(); - $page->setReturnValue('getHeaders', 'Header: content'); - $page->setReturnValue('getMimeType', 'text/xml'); - $page->setReturnValue('getResponseCode', 401); - $page->setReturnValue('getTransportError', 'Could not parse headers'); - $page->setReturnValue('getAuthentication', 'Basic'); - $page->setReturnValue('getRealm', 'Safe place'); - - $frameset = new SimpleFrameset($page); - - $this->assertIdentical($frameset->getHeaders(), 'Header: content'); - $this->assertIdentical($frameset->getMimeType(), 'text/xml'); - $this->assertIdentical($frameset->getResponseCode(), 401); - $this->assertIdentical($frameset->getTransportError(), 'Could not parse headers'); - $this->assertIdentical($frameset->getAuthentication(), 'Basic'); - $this->assertIdentical($frameset->getRealm(), 'Safe place'); - } - - function testEmptyFramesetHasNoContent() { - $page = new MockSimplePage(); - $page->setReturnValue('getRaw', 'This content'); - $frameset = new SimpleFrameset($page); - $this->assertEqual($frameset->getRaw(), ''); - } - - function testRawContentIsFromOnlyFrame() { - $page = new MockSimplePage(); - $page->expectNever('getRaw'); - - $frame = new MockSimplePage(); - $frame->setReturnValue('getRaw', 'Stuff'); - - $frameset = new SimpleFrameset($page); - $frameset->addFrame($frame); - $this->assertEqual($frameset->getRaw(), 'Stuff'); - } - - function testRawContentIsFromAllFrames() { - $page = new MockSimplePage(); - $page->expectNever('getRaw'); - - $frame1 = new MockSimplePage(); - $frame1->setReturnValue('getRaw', 'Stuff1'); - - $frame2 = new MockSimplePage(); - $frame2->setReturnValue('getRaw', 'Stuff2'); - - $frameset = new SimpleFrameset($page); - $frameset->addFrame($frame1); - $frameset->addFrame($frame2); - $this->assertEqual($frameset->getRaw(), 'Stuff1Stuff2'); - } - - function testTextContentIsFromOnlyFrame() { - $page = new MockSimplePage(); - $page->expectNever('getText'); - - $frame = new MockSimplePage(); - $frame->setReturnValue('getText', 'Stuff'); - - $frameset = new SimpleFrameset($page); - $frameset->addFrame($frame); - $this->assertEqual($frameset->getText(), 'Stuff'); - } - - function testTextContentIsFromAllFrames() { - $page = new MockSimplePage(); - $page->expectNever('getText'); - - $frame1 = new MockSimplePage(); - $frame1->setReturnValue('getText', 'Stuff1'); - - $frame2 = new MockSimplePage(); - $frame2->setReturnValue('getText', 'Stuff2'); - - $frameset = new SimpleFrameset($page); - $frameset->addFrame($frame1); - $frameset->addFrame($frame2); - $this->assertEqual($frameset->getText(), 'Stuff1 Stuff2'); - } - - function testFieldFoundIsFirstInFramelist() { - $frame1 = new MockSimplePage(); - $frame1->setReturnValue('getField', null); - $frame1->expectOnce('getField', array(new SimpleByName('a'))); - - $frame2 = new MockSimplePage(); - $frame2->setReturnValue('getField', 'A'); - $frame2->expectOnce('getField', array(new SimpleByName('a'))); - - $frame3 = new MockSimplePage(); - $frame3->expectNever('getField'); - - $page = new MockSimplePage(); - $frameset = new SimpleFrameset($page); - $frameset->addFrame($frame1); - $frameset->addFrame($frame2); - $frameset->addFrame($frame3); - $this->assertIdentical($frameset->getField(new SimpleByName('a')), 'A'); - } - - function testFrameReplacementByIndex() { - $page = new MockSimplePage(); - $page->expectNever('getRaw'); - - $frame1 = new MockSimplePage(); - $frame1->setReturnValue('getRaw', 'Stuff1'); - - $frame2 = new MockSimplePage(); - $frame2->setReturnValue('getRaw', 'Stuff2'); - - $frameset = new SimpleFrameset($page); - $frameset->addFrame($frame1); - $frameset->setFrame(array(1), $frame2); - $this->assertEqual($frameset->getRaw(), 'Stuff2'); - } - - function testFrameReplacementByName() { - $page = new MockSimplePage(); - $page->expectNever('getRaw'); - - $frame1 = new MockSimplePage(); - $frame1->setReturnValue('getRaw', 'Stuff1'); - - $frame2 = new MockSimplePage(); - $frame2->setReturnValue('getRaw', 'Stuff2'); - - $frameset = new SimpleFrameset($page); - $frameset->addFrame($frame1, 'a'); - $frameset->setFrame(array('a'), $frame2); - $this->assertEqual($frameset->getRaw(), 'Stuff2'); - } -} - -class TestOfFrameNavigation extends UnitTestCase { - - function testStartsWithoutFrameFocus() { - $page = new MockSimplePage(); - $frameset = new SimpleFrameset($page); - $frameset->addFrame(new MockSimplePage()); - $this->assertFalse($frameset->getFrameFocus()); - } - - function testCanFocusOnSingleFrame() { - $page = new MockSimplePage(); - $page->expectNever('getRaw'); - - $frame = new MockSimplePage(); - $frame->setReturnValue('getFrameFocus', array()); - $frame->setReturnValue('getRaw', 'Stuff'); - - $frameset = new SimpleFrameset($page); - $frameset->addFrame($frame); - - $this->assertFalse($frameset->setFrameFocusByIndex(0)); - $this->assertTrue($frameset->setFrameFocusByIndex(1)); - $this->assertEqual($frameset->getRaw(), 'Stuff'); - $this->assertFalse($frameset->setFrameFocusByIndex(2)); - $this->assertIdentical($frameset->getFrameFocus(), array(1)); - } - - function testContentComesFromFrameInFocus() { - $page = new MockSimplePage(); - - $frame1 = new MockSimplePage(); - $frame1->setReturnValue('getRaw', 'Stuff1'); - $frame1->setReturnValue('getFrameFocus', array()); - - $frame2 = new MockSimplePage(); - $frame2->setReturnValue('getRaw', 'Stuff2'); - $frame2->setReturnValue('getFrameFocus', array()); - - $frameset = new SimpleFrameset($page); - $frameset->addFrame($frame1); - $frameset->addFrame($frame2); - - $this->assertTrue($frameset->setFrameFocusByIndex(1)); - $this->assertEqual($frameset->getFrameFocus(), array(1)); - $this->assertEqual($frameset->getRaw(), 'Stuff1'); - - $this->assertTrue($frameset->setFrameFocusByIndex(2)); - $this->assertEqual($frameset->getFrameFocus(), array(2)); - $this->assertEqual($frameset->getRaw(), 'Stuff2'); - - $this->assertFalse($frameset->setFrameFocusByIndex(3)); - $this->assertEqual($frameset->getFrameFocus(), array(2)); - - $frameset->clearFrameFocus(); - $this->assertEqual($frameset->getRaw(), 'Stuff1Stuff2'); - } - - function testCanFocusByName() { - $page = new MockSimplePage(); - - $frame1 = new MockSimplePage(); - $frame1->setReturnValue('getRaw', 'Stuff1'); - $frame1->setReturnValue('getFrameFocus', array()); - - $frame2 = new MockSimplePage(); - $frame2->setReturnValue('getRaw', 'Stuff2'); - $frame2->setReturnValue('getFrameFocus', array()); - - $frameset = new SimpleFrameset($page); - $frameset->addFrame($frame1, 'A'); - $frameset->addFrame($frame2, 'B'); - - $this->assertTrue($frameset->setFrameFocus('A')); - $this->assertEqual($frameset->getFrameFocus(), array('A')); - $this->assertEqual($frameset->getRaw(), 'Stuff1'); - - $this->assertTrue($frameset->setFrameFocusByIndex(2)); - $this->assertEqual($frameset->getFrameFocus(), array('B')); - $this->assertEqual($frameset->getRaw(), 'Stuff2'); - - $this->assertFalse($frameset->setFrameFocus('z')); - - $frameset->clearFrameFocus(); - $this->assertEqual($frameset->getRaw(), 'Stuff1Stuff2'); - } -} - -class TestOfFramesetPageInterface extends UnitTestCase { - private $page_interface; - private $frameset_interface; - - function __construct() { - parent::__construct(); - $this->page_interface = $this->getPageMethods(); - $this->frameset_interface = $this->getFramesetMethods(); - } - - function assertListInAnyOrder($list, $expected) { - sort($list); - sort($expected); - $this->assertEqual($list, $expected); - } - - private function getPageMethods() { - $methods = array(); - foreach (get_class_methods('SimplePage') as $method) { - if (strtolower($method) == strtolower('SimplePage')) { - continue; - } - if (strtolower($method) == strtolower('getFrameset')) { - continue; - } - if (strncmp($method, '_', 1) == 0) { - continue; - } - if (strncmp($method, 'accept', 6) == 0) { - continue; - } - $methods[] = $method; - } - return $methods; - } - - private function getFramesetMethods() { - $methods = array(); - foreach (get_class_methods('SimpleFrameset') as $method) { - if (strtolower($method) == strtolower('SimpleFrameset')) { - continue; - } - if (strncmp($method, '_', 1) == 0) { - continue; - } - if (strncmp($method, 'add', 3) == 0) { - continue; - } - $methods[] = $method; - } - return $methods; - } - - function testFramsetHasPageInterface() { - $difference = array(); - foreach ($this->page_interface as $method) { - if (! in_array($method, $this->frameset_interface)) { - $this->fail("No [$method] in Frameset class"); - return; - } - } - $this->pass('Frameset covers Page interface'); - } - - function testHeadersReadFromFrameIfInFocus() { - $frame = new MockSimplePage(); - $frame->setReturnValue('getUrl', new SimpleUrl('http://localhost/stuff')); - - $frame->setReturnValue('getRequest', 'POST stuff'); - $frame->setReturnValue('getMethod', 'POST'); - $frame->setReturnValue('getRequestData', array('a' => 'A')); - $frame->setReturnValue('getHeaders', 'Header: content'); - $frame->setReturnValue('getMimeType', 'text/xml'); - $frame->setReturnValue('getResponseCode', 401); - $frame->setReturnValue('getTransportError', 'Could not parse headers'); - $frame->setReturnValue('getAuthentication', 'Basic'); - $frame->setReturnValue('getRealm', 'Safe place'); - - $frameset = new SimpleFrameset(new MockSimplePage()); - $frameset->addFrame($frame); - $frameset->setFrameFocusByIndex(1); - - $url = new SimpleUrl('http://localhost/stuff'); - $url->setTarget(1); - $this->assertIdentical($frameset->getUrl(), $url); - - $this->assertIdentical($frameset->getRequest(), 'POST stuff'); - $this->assertIdentical($frameset->getMethod(), 'POST'); - $this->assertIdentical($frameset->getRequestData(), array('a' => 'A')); - $this->assertIdentical($frameset->getHeaders(), 'Header: content'); - $this->assertIdentical($frameset->getMimeType(), 'text/xml'); - $this->assertIdentical($frameset->getResponseCode(), 401); - $this->assertIdentical($frameset->getTransportError(), 'Could not parse headers'); - $this->assertIdentical($frameset->getAuthentication(), 'Basic'); - $this->assertIdentical($frameset->getRealm(), 'Safe place'); - } - - function testUrlsComeFromBothFrames() { - $page = new MockSimplePage(); - $page->expectNever('getUrls'); - - $frame1 = new MockSimplePage(); - $frame1->setReturnValue( - 'getUrls', - array('http://www.lastcraft.com/', 'http://myserver/')); - - $frame2 = new MockSimplePage(); - $frame2->setReturnValue( - 'getUrls', - array('http://www.lastcraft.com/', 'http://test/')); - - $frameset = new SimpleFrameset($page); - $frameset->addFrame($frame1); - $frameset->addFrame($frame2); - $this->assertListInAnyOrder( - $frameset->getUrls(), - array('http://www.lastcraft.com/', 'http://myserver/', 'http://test/')); - } - - function testLabelledUrlsComeFromBothFrames() { - $frame1 = new MockSimplePage(); - $frame1->setReturnValue( - 'getUrlsByLabel', - array(new SimpleUrl('goodbye.php')), - array('a')); - - $frame2 = new MockSimplePage(); - $frame2->setReturnValue( - 'getUrlsByLabel', - array(new SimpleUrl('hello.php')), - array('a')); - - $frameset = new SimpleFrameset(new MockSimplePage()); - $frameset->addFrame($frame1); - $frameset->addFrame($frame2, 'Two'); - - $expected1 = new SimpleUrl('goodbye.php'); - $expected1->setTarget(1); - $expected2 = new SimpleUrl('hello.php'); - $expected2->setTarget('Two'); - $this->assertEqual( - $frameset->getUrlsByLabel('a'), - array($expected1, $expected2)); - } - - function testUrlByIdComesFromFirstFrameToRespond() { - $frame1 = new MockSimplePage(); - $frame1->setReturnValue('getUrlById', new SimpleUrl('four.php'), array(4)); - $frame1->setReturnValue('getUrlById', false, array(5)); - - $frame2 = new MockSimplePage(); - $frame2->setReturnValue('getUrlById', false, array(4)); - $frame2->setReturnValue('getUrlById', new SimpleUrl('five.php'), array(5)); - - $frameset = new SimpleFrameset(new MockSimplePage()); - $frameset->addFrame($frame1); - $frameset->addFrame($frame2); - - $four = new SimpleUrl('four.php'); - $four->setTarget(1); - $this->assertEqual($frameset->getUrlById(4), $four); - $five = new SimpleUrl('five.php'); - $five->setTarget(2); - $this->assertEqual($frameset->getUrlById(5), $five); - } - - function testReadUrlsFromFrameInFocus() { - $frame1 = new MockSimplePage(); - $frame1->setReturnValue('getUrls', array('a')); - $frame1->setReturnValue('getUrlsByLabel', array(new SimpleUrl('l'))); - $frame1->setReturnValue('getUrlById', new SimpleUrl('i')); - - $frame2 = new MockSimplePage(); - $frame2->expectNever('getUrls'); - $frame2->expectNever('getUrlsByLabel'); - $frame2->expectNever('getUrlById'); - - $frameset = new SimpleFrameset(new MockSimplePage()); - $frameset->addFrame($frame1, 'A'); - $frameset->addFrame($frame2, 'B'); - $frameset->setFrameFocus('A'); - - $this->assertIdentical($frameset->getUrls(), array('a')); - $expected = new SimpleUrl('l'); - $expected->setTarget('A'); - $this->assertIdentical($frameset->getUrlsByLabel('label'), array($expected)); - $expected = new SimpleUrl('i'); - $expected->setTarget('A'); - $this->assertIdentical($frameset->getUrlById(99), $expected); - } - - function testReadFrameTaggedUrlsFromFrameInFocus() { - $frame = new MockSimplePage(); - - $by_label = new SimpleUrl('l'); - $by_label->setTarget('L'); - $frame->setReturnValue('getUrlsByLabel', array($by_label)); - - $by_id = new SimpleUrl('i'); - $by_id->setTarget('I'); - $frame->setReturnValue('getUrlById', $by_id); - - $frameset = new SimpleFrameset(new MockSimplePage()); - $frameset->addFrame($frame, 'A'); - $frameset->setFrameFocus('A'); - - $this->assertIdentical($frameset->getUrlsByLabel('label'), array($by_label)); - $this->assertIdentical($frameset->getUrlById(99), $by_id); - } - - function testFindingFormsById() { - $frame = new MockSimplePage(); - $form = new MockSimpleForm(); - $frame->returns('getFormById', $form, array('a')); - - $frameset = new SimpleFrameset(new MockSimplePage()); - $frameset->addFrame(new MockSimplePage(), 'A'); - $frameset->addFrame($frame, 'B'); - $this->assertSame($frameset->getFormById('a'), $form); - - $frameset->setFrameFocus('A'); - $this->assertNull($frameset->getFormById('a')); - - $frameset->setFrameFocus('B'); - $this->assertSame($frameset->getFormById('a'), $form); - } - - function testFindingFormsBySubmit() { - $frame = new MockSimplePage(); - $form = new MockSimpleForm(); - $frame->returns( - 'getFormBySubmit', - $form, - array(new SimpleByLabel('a'))); - - $frameset = new SimpleFrameset(new MockSimplePage()); - $frameset->addFrame(new MockSimplePage(), 'A'); - $frameset->addFrame($frame, 'B'); - $this->assertSame($frameset->getFormBySubmit(new SimpleByLabel('a')), $form); - - $frameset->setFrameFocus('A'); - $this->assertNull($frameset->getFormBySubmit(new SimpleByLabel('a'))); - - $frameset->setFrameFocus('B'); - $this->assertSame($frameset->getFormBySubmit(new SimpleByLabel('a')), $form); - } - - function testFindingFormsByImage() { - $frame = new MockSimplePage(); - $form = new MockSimpleForm(); - $frame->returns( - 'getFormByImage', - $form, - array(new SimpleByLabel('a'))); - - $frameset = new SimpleFrameset(new MockSimplePage()); - $frameset->addFrame(new MockSimplePage(), 'A'); - $frameset->addFrame($frame, 'B'); - $this->assertSame($frameset->getFormByImage(new SimpleByLabel('a')), $form); - - $frameset->setFrameFocus('A'); - $this->assertNull($frameset->getFormByImage(new SimpleByLabel('a'))); - - $frameset->setFrameFocus('B'); - $this->assertSame($frameset->getFormByImage(new SimpleByLabel('a')), $form); - } - - function testSettingAllFrameFieldsWhenNoFrameFocus() { - $frame1 = new MockSimplePage(); - $frame1->expectOnce('setField', array(new SimpleById(22), 'A')); - - $frame2 = new MockSimplePage(); - $frame2->expectOnce('setField', array(new SimpleById(22), 'A')); - - $frameset = new SimpleFrameset(new MockSimplePage()); - $frameset->addFrame($frame1, 'A'); - $frameset->addFrame($frame2, 'B'); - $frameset->setField(new SimpleById(22), 'A'); - } - - function testOnlySettingFieldFromFocusedFrame() { - $frame1 = new MockSimplePage(); - $frame1->expectOnce('setField', array(new SimpleByLabelOrName('a'), 'A')); - - $frame2 = new MockSimplePage(); - $frame2->expectNever('setField'); - - $frameset = new SimpleFrameset(new MockSimplePage()); - $frameset->addFrame($frame1, 'A'); - $frameset->addFrame($frame2, 'B'); - $frameset->setFrameFocus('A'); - $frameset->setField(new SimpleByLabelOrName('a'), 'A'); - } - - function testOnlyGettingFieldFromFocusedFrame() { - $frame1 = new MockSimplePage(); - $frame1->setReturnValue('getField', 'f', array(new SimpleByName('a'))); - - $frame2 = new MockSimplePage(); - $frame2->expectNever('getField'); - - $frameset = new SimpleFrameset(new MockSimplePage()); - $frameset->addFrame($frame1, 'A'); - $frameset->addFrame($frame2, 'B'); - $frameset->setFrameFocus('A'); - $this->assertIdentical($frameset->getField(new SimpleByName('a')), 'f'); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/http_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/http_test.php deleted file mode 100644 index 3cf3d16..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/http_test.php +++ /dev/null @@ -1,424 +0,0 @@ -expectAt(0, 'write', array("GET /here.html HTTP/1.0\r\n")); - $socket->expectAt(1, 'write', array("Host: a.valid.host\r\n")); - $socket->expectAt(2, 'write', array("Connection: close\r\n")); - $socket->expectCallCount('write', 3); - $route = new PartialSimpleRoute(); - $route->setReturnReference('createSocket', $socket); - $route->__construct(new SimpleUrl('http://a.valid.host/here.html')); - $this->assertSame($route->createConnection('GET', 15), $socket); - } - - function testDefaultPostRequest() { - $socket = new MockSimpleSocket(); - $socket->expectAt(0, 'write', array("POST /here.html HTTP/1.0\r\n")); - $socket->expectAt(1, 'write', array("Host: a.valid.host\r\n")); - $socket->expectAt(2, 'write', array("Connection: close\r\n")); - $socket->expectCallCount('write', 3); - - $route = new PartialSimpleRoute(); - $route->setReturnReference('createSocket', $socket); - $route->__construct(new SimpleUrl('http://a.valid.host/here.html')); - - $route->createConnection('POST', 15); - } - - function testGetWithPort() { - $socket = new MockSimpleSocket(); - $socket->expectAt(0, 'write', array("GET /here.html HTTP/1.0\r\n")); - $socket->expectAt(1, 'write', array("Host: a.valid.host:81\r\n")); - $socket->expectAt(2, 'write', array("Connection: close\r\n")); - $socket->expectCallCount('write', 3); - - $route = new PartialSimpleRoute(); - $route->setReturnReference('createSocket', $socket); - $route->__construct(new SimpleUrl('http://a.valid.host:81/here.html')); - - $route->createConnection('GET', 15); - } - - function testGetWithParameters() { - $socket = new MockSimpleSocket(); - $socket->expectAt(0, 'write', array("GET /here.html?a=1&b=2 HTTP/1.0\r\n")); - $socket->expectAt(1, 'write', array("Host: a.valid.host\r\n")); - $socket->expectAt(2, 'write', array("Connection: close\r\n")); - $socket->expectCallCount('write', 3); - - $route = new PartialSimpleRoute(); - $route->setReturnReference('createSocket', $socket); - $route->__construct(new SimpleUrl('http://a.valid.host/here.html?a=1&b=2')); - - $route->createConnection('GET', 15); - } -} - -class TestOfProxyRoute extends UnitTestCase { - - function testDefaultGet() { - $socket = new MockSimpleSocket(); - $socket->expectAt(0, 'write', array("GET http://a.valid.host/here.html HTTP/1.0\r\n")); - $socket->expectAt(1, 'write', array("Host: my-proxy:8080\r\n")); - $socket->expectAt(2, 'write', array("Connection: close\r\n")); - $socket->expectCallCount('write', 3); - - $route = new PartialSimpleProxyRoute(); - $route->setReturnReference('createSocket', $socket); - $route->__construct( - new SimpleUrl('http://a.valid.host/here.html'), - new SimpleUrl('http://my-proxy')); - $route->createConnection('GET', 15); - } - - function testDefaultPost() { - $socket = new MockSimpleSocket(); - $socket->expectAt(0, 'write', array("POST http://a.valid.host/here.html HTTP/1.0\r\n")); - $socket->expectAt(1, 'write', array("Host: my-proxy:8080\r\n")); - $socket->expectAt(2, 'write', array("Connection: close\r\n")); - $socket->expectCallCount('write', 3); - - $route = new PartialSimpleProxyRoute(); - $route->setReturnReference('createSocket', $socket); - $route->__construct( - new SimpleUrl('http://a.valid.host/here.html'), - new SimpleUrl('http://my-proxy')); - $route->createConnection('POST', 15); - } - - function testGetWithPort() { - $socket = new MockSimpleSocket(); - $socket->expectAt(0, 'write', array("GET http://a.valid.host:81/here.html HTTP/1.0\r\n")); - $socket->expectAt(1, 'write', array("Host: my-proxy:8081\r\n")); - $socket->expectAt(2, 'write', array("Connection: close\r\n")); - $socket->expectCallCount('write', 3); - - $route = new PartialSimpleProxyRoute(); - $route->setReturnReference('createSocket', $socket); - $route->__construct( - new SimpleUrl('http://a.valid.host:81/here.html'), - new SimpleUrl('http://my-proxy:8081')); - $route->createConnection('GET', 15); - } - - function testGetWithParameters() { - $socket = new MockSimpleSocket(); - $socket->expectAt(0, 'write', array("GET http://a.valid.host/here.html?a=1&b=2 HTTP/1.0\r\n")); - $socket->expectAt(1, 'write', array("Host: my-proxy:8080\r\n")); - $socket->expectAt(2, 'write', array("Connection: close\r\n")); - $socket->expectCallCount('write', 3); - - $route = new PartialSimpleProxyRoute(); - $route->setReturnReference('createSocket', $socket); - $route->__construct( - new SimpleUrl('http://a.valid.host/here.html?a=1&b=2'), - new SimpleUrl('http://my-proxy')); - $route->createConnection('GET', 15); - } - - function testGetWithAuthentication() { - $encoded = base64_encode('Me:Secret'); - - $socket = new MockSimpleSocket(); - $socket->expectAt(0, 'write', array("GET http://a.valid.host/here.html HTTP/1.0\r\n")); - $socket->expectAt(1, 'write', array("Host: my-proxy:8080\r\n")); - $socket->expectAt(2, 'write', array("Proxy-Authorization: Basic $encoded\r\n")); - $socket->expectAt(3, 'write', array("Connection: close\r\n")); - $socket->expectCallCount('write', 4); - - $route = new PartialSimpleProxyRoute(); - $route->setReturnReference('createSocket', $socket); - $route->__construct( - new SimpleUrl('http://a.valid.host/here.html'), - new SimpleUrl('http://my-proxy'), - 'Me', - 'Secret'); - $route->createConnection('GET', 15); - } -} - -class TestOfHttpRequest extends UnitTestCase { - - function testReadingBadConnection() { - $socket = new MockSimpleSocket(); - $route = new MockSimpleRoute(); - $route->setReturnReference('createConnection', $socket); - $request = new SimpleHttpRequest($route, new SimpleGetEncoding()); - $reponse = $request->fetch(15); - $this->assertTrue($reponse->isError()); - } - - function testReadingGoodConnection() { - $socket = new MockSimpleSocket(); - $socket->expectOnce('write', array("\r\n")); - - $route = new MockSimpleRoute(); - $route->setReturnReference('createConnection', $socket); - $route->expect('createConnection', array('GET', 15)); - - $request = new SimpleHttpRequest($route, new SimpleGetEncoding()); - $this->assertIsA($request->fetch(15), 'SimpleHttpResponse'); - } - - function testWritingAdditionalHeaders() { - $socket = new MockSimpleSocket(); - $socket->expectAt(0, 'write', array("My: stuff\r\n")); - $socket->expectAt(1, 'write', array("\r\n")); - $socket->expectCallCount('write', 2); - - $route = new MockSimpleRoute(); - $route->setReturnReference('createConnection', $socket); - - $request = new SimpleHttpRequest($route, new SimpleGetEncoding()); - $request->addHeaderLine('My: stuff'); - $request->fetch(15); - } - - function testCookieWriting() { - $socket = new MockSimpleSocket(); - $socket->expectAt(0, 'write', array("Cookie: a=A\r\n")); - $socket->expectAt(1, 'write', array("\r\n")); - $socket->expectCallCount('write', 2); - - $route = new MockSimpleRoute(); - $route->setReturnReference('createConnection', $socket); - - $jar = new SimpleCookieJar(); - $jar->setCookie('a', 'A'); - - $request = new SimpleHttpRequest($route, new SimpleGetEncoding()); - $request->readCookiesFromJar($jar, new SimpleUrl('/')); - $this->assertIsA($request->fetch(15), 'SimpleHttpResponse'); - } - - function testMultipleCookieWriting() { - $socket = new MockSimpleSocket(); - $socket->expectAt(0, 'write', array("Cookie: a=A;b=B\r\n")); - - $route = new MockSimpleRoute(); - $route->setReturnReference('createConnection', $socket); - - $jar = new SimpleCookieJar(); - $jar->setCookie('a', 'A'); - $jar->setCookie('b', 'B'); - - $request = new SimpleHttpRequest($route, new SimpleGetEncoding()); - $request->readCookiesFromJar($jar, new SimpleUrl('/')); - $request->fetch(15); - } -} - -class TestOfHttpPostRequest extends UnitTestCase { - - function testReadingBadConnectionCausesErrorBecauseOfDeadSocket() { - $socket = new MockSimpleSocket(); - $route = new MockSimpleRoute(); - $route->setReturnReference('createConnection', $socket); - $request = new SimpleHttpRequest($route, new SimplePostEncoding()); - $reponse = $request->fetch(15); - $this->assertTrue($reponse->isError()); - } - - function testReadingGoodConnection() { - $socket = new MockSimpleSocket(); - $socket->expectAt(0, 'write', array("Content-Length: 0\r\n")); - $socket->expectAt(1, 'write', array("Content-Type: application/x-www-form-urlencoded\r\n")); - $socket->expectAt(2, 'write', array("\r\n")); - $socket->expectAt(3, 'write', array("")); - - $route = new MockSimpleRoute(); - $route->setReturnReference('createConnection', $socket); - $route->expect('createConnection', array('POST', 15)); - - $request = new SimpleHttpRequest($route, new SimplePostEncoding()); - $this->assertIsA($request->fetch(15), 'SimpleHttpResponse'); - } - - function testContentHeadersCalculated() { - $socket = new MockSimpleSocket(); - $socket->expectAt(0, 'write', array("Content-Length: 3\r\n")); - $socket->expectAt(1, 'write', array("Content-Type: application/x-www-form-urlencoded\r\n")); - $socket->expectAt(2, 'write', array("\r\n")); - $socket->expectAt(3, 'write', array("a=A")); - - $route = new MockSimpleRoute(); - $route->setReturnReference('createConnection', $socket); - $route->expect('createConnection', array('POST', 15)); - - $request = new SimpleHttpRequest( - $route, - new SimplePostEncoding(array('a' => 'A'))); - $this->assertIsA($request->fetch(15), 'SimpleHttpResponse'); - } -} - -class TestOfHttpHeaders extends UnitTestCase { - - function testParseBasicHeaders() { - $headers = new SimpleHttpHeaders( - "HTTP/1.1 200 OK\r\n" . - "Date: Mon, 18 Nov 2002 15:50:29 GMT\r\n" . - "Content-Type: text/plain\r\n" . - "Server: Apache/1.3.24 (Win32) PHP/4.2.3\r\n" . - "Connection: close"); - $this->assertIdentical($headers->getHttpVersion(), "1.1"); - $this->assertIdentical($headers->getResponseCode(), 200); - $this->assertEqual($headers->getMimeType(), "text/plain"); - } - - function testNonStandardResponseHeader() { - $headers = new SimpleHttpHeaders( - "HTTP/1.1 302 (HTTP-Version SP Status-Code CRLF)\r\n" . - "Connection: close"); - $this->assertIdentical($headers->getResponseCode(), 302); - } - - function testCanParseMultipleCookies() { - $jar = new MockSimpleCookieJar(); - $jar->expectAt(0, 'setCookie', array('a', 'aaa', 'host', '/here/', 'Wed, 25 Dec 2002 04:24:20 GMT')); - $jar->expectAt(1, 'setCookie', array('b', 'bbb', 'host', '/', false)); - - $headers = new SimpleHttpHeaders( - "HTTP/1.1 200 OK\r\n" . - "Date: Mon, 18 Nov 2002 15:50:29 GMT\r\n" . - "Content-Type: text/plain\r\n" . - "Server: Apache/1.3.24 (Win32) PHP/4.2.3\r\n" . - "Set-Cookie: a=aaa; expires=Wed, 25-Dec-02 04:24:20 GMT; path=/here/\r\n" . - "Set-Cookie: b=bbb\r\n" . - "Connection: close"); - $headers->writeCookiesToJar($jar, new SimpleUrl('http://host')); - } - - function testCanRecogniseRedirect() { - $headers = new SimpleHttpHeaders("HTTP/1.1 301 OK\r\n" . - "Content-Type: text/plain\r\n" . - "Content-Length: 0\r\n" . - "Location: http://www.somewhere-else.com/\r\n" . - "Connection: close"); - $this->assertIdentical($headers->getResponseCode(), 301); - $this->assertEqual($headers->getLocation(), "http://www.somewhere-else.com/"); - $this->assertTrue($headers->isRedirect()); - } - - function testCanParseChallenge() { - $headers = new SimpleHttpHeaders("HTTP/1.1 401 Authorization required\r\n" . - "Content-Type: text/plain\r\n" . - "Connection: close\r\n" . - "WWW-Authenticate: Basic realm=\"Somewhere\""); - $this->assertEqual($headers->getAuthentication(), 'Basic'); - $this->assertEqual($headers->getRealm(), 'Somewhere'); - $this->assertTrue($headers->isChallenge()); - } -} - -class TestOfHttpResponse extends UnitTestCase { - - function testBadRequest() { - $socket = new MockSimpleSocket(); - $socket->setReturnValue('getSent', ''); - - $response = new SimpleHttpResponse($socket, new SimpleUrl('here'), new SimpleGetEncoding()); - $this->assertTrue($response->isError()); - $this->assertPattern('/Nothing fetched/', $response->getError()); - $this->assertIdentical($response->getContent(), false); - $this->assertIdentical($response->getSent(), ''); - } - - function testBadSocketDuringResponse() { - $socket = new MockSimpleSocket(); - $socket->setReturnValueAt(0, "read", "HTTP/1.1 200 OK\r\n"); - $socket->setReturnValueAt(1, "read", "Date: Mon, 18 Nov 2002 15:50:29 GMT\r\n"); - $socket->setReturnValue("read", ""); - $socket->setReturnValue('getSent', 'HTTP/1.1 ...'); - - $response = new SimpleHttpResponse($socket, new SimpleUrl('here'), new SimpleGetEncoding()); - $this->assertTrue($response->isError()); - $this->assertEqual($response->getContent(), ''); - $this->assertEqual($response->getSent(), 'HTTP/1.1 ...'); - } - - function testIncompleteHeader() { - $socket = new MockSimpleSocket(); - $socket->setReturnValueAt(0, "read", "HTTP/1.1 200 OK\r\n"); - $socket->setReturnValueAt(1, "read", "Date: Mon, 18 Nov 2002 15:50:29 GMT\r\n"); - $socket->setReturnValueAt(2, "read", "Content-Type: text/plain\r\n"); - $socket->setReturnValue("read", ""); - - $response = new SimpleHttpResponse($socket, new SimpleUrl('here'), new SimpleGetEncoding()); - $this->assertTrue($response->isError()); - $this->assertEqual($response->getContent(), ""); - } - - function testParseOfResponseHeadersWhenChunked() { - $socket = new MockSimpleSocket(); - $socket->setReturnValueAt(0, "read", "HTTP/1.1 200 OK\r\nDate: Mon, 18 Nov 2002 15:50:29 GMT\r\n"); - $socket->setReturnValueAt(1, "read", "Content-Type: text/plain\r\n"); - $socket->setReturnValueAt(2, "read", "Server: Apache/1.3.24 (Win32) PHP/4.2.3\r\nConne"); - $socket->setReturnValueAt(3, "read", "ction: close\r\n\r\nthis is a test file\n"); - $socket->setReturnValueAt(4, "read", "with two lines in it\n"); - $socket->setReturnValue("read", ""); - - $response = new SimpleHttpResponse($socket, new SimpleUrl('here'), new SimpleGetEncoding()); - $this->assertFalse($response->isError()); - $this->assertEqual( - $response->getContent(), - "this is a test file\nwith two lines in it\n"); - $headers = $response->getHeaders(); - $this->assertIdentical($headers->getHttpVersion(), "1.1"); - $this->assertIdentical($headers->getResponseCode(), 200); - $this->assertEqual($headers->getMimeType(), "text/plain"); - $this->assertFalse($headers->isRedirect()); - $this->assertFalse($headers->getLocation()); - } - - function testRedirect() { - $socket = new MockSimpleSocket(); - $socket->setReturnValueAt(0, "read", "HTTP/1.1 301 OK\r\n"); - $socket->setReturnValueAt(1, "read", "Content-Type: text/plain\r\n"); - $socket->setReturnValueAt(2, "read", "Location: http://www.somewhere-else.com/\r\n"); - $socket->setReturnValueAt(3, "read", "Connection: close\r\n"); - $socket->setReturnValueAt(4, "read", "\r\n"); - $socket->setReturnValue("read", ""); - - $response = new SimpleHttpResponse($socket, new SimpleUrl('here'), new SimpleGetEncoding()); - $headers = $response->getHeaders(); - $this->assertTrue($headers->isRedirect()); - $this->assertEqual($headers->getLocation(), "http://www.somewhere-else.com/"); - } - - function testRedirectWithPort() { - $socket = new MockSimpleSocket(); - $socket->setReturnValueAt(0, "read", "HTTP/1.1 301 OK\r\n"); - $socket->setReturnValueAt(1, "read", "Content-Type: text/plain\r\n"); - $socket->setReturnValueAt(2, "read", "Location: http://www.somewhere-else.com:80/\r\n"); - $socket->setReturnValueAt(3, "read", "Connection: close\r\n"); - $socket->setReturnValueAt(4, "read", "\r\n"); - $socket->setReturnValue("read", ""); - - $response = new SimpleHttpResponse($socket, new SimpleUrl('here'), new SimpleGetEncoding()); - $headers = $response->getHeaders(); - $this->assertTrue($headers->isRedirect()); - $this->assertEqual($headers->getLocation(), "http://www.somewhere-else.com:80/"); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/interfaces_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/interfaces_test.php deleted file mode 100644 index 83c24d4..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/interfaces_test.php +++ /dev/null @@ -1,137 +0,0 @@ -=')) { - include(dirname(__FILE__) . '/interfaces_test_php5_1.php'); -} - -interface DummyInterface { - function aMethod(); - function anotherMethod($a); - function &referenceMethod(&$a); -} - -Mock::generate('DummyInterface'); -Mock::generatePartial('DummyInterface', 'PartialDummyInterface', array()); - -class TestOfMockInterfaces extends UnitTestCase { - - function testCanMockAnInterface() { - $mock = new MockDummyInterface(); - $this->assertIsA($mock, 'SimpleMock'); - $this->assertIsA($mock, 'MockDummyInterface'); - $this->assertTrue(method_exists($mock, 'aMethod')); - $this->assertTrue(method_exists($mock, 'anotherMethod')); - $this->assertNull($mock->aMethod()); - } - - function testMockedInterfaceExpectsParameters() { - $mock = new MockDummyInterface(); - $this->expectError(); - $mock->anotherMethod(); - } - - function testCannotPartiallyMockAnInterface() { - $this->assertFalse(class_exists('PartialDummyInterface')); - } -} - -class TestOfSpl extends UnitTestCase { - - function skip() { - $this->skipUnless(function_exists('spl_classes'), 'No SPL module loaded'); - } - - function testCanMockAllSplClasses() { - if (! function_exists('spl_classes')) { - return; - } - foreach(spl_classes() as $class) { - if ($class == 'SplHeap') { - continue; - } - if (version_compare(PHP_VERSION, '5.1', '<') && - $class == 'CachingIterator' || - $class == 'CachingRecursiveIterator' || - $class == 'FilterIterator' || - $class == 'LimitIterator' || - $class == 'ParentIterator') { - // These iterators require an iterator be passed to them during - // construction in PHP 5.0; there is no way for SimpleTest - // to supply such an iterator, however, so support for it is - // disabled. - continue; - } - $mock_class = "Mock$class"; - Mock::generate($class); - $this->assertIsA(new $mock_class(), $mock_class); - } - } - - function testExtensionOfCommonSplClasses() { - Mock::generate('IteratorImplementation'); - $this->assertIsA( - new IteratorImplementation(), - 'IteratorImplementation'); - Mock::generate('IteratorAggregateImplementation'); - $this->assertIsA( - new IteratorAggregateImplementation(), - 'IteratorAggregateImplementation'); - } -} - -class WithHint { - function hinted(DummyInterface $object) { } -} - -class ImplementsDummy implements DummyInterface { - function aMethod() { } - function anotherMethod($a) { } - function &referenceMethod(&$a) { } - function extraMethod($a = false) { } -} -Mock::generate('ImplementsDummy'); - -class TestOfImplementations extends UnitTestCase { - - function testMockedInterfaceCanPassThroughTypeHint() { - $mock = new MockDummyInterface(); - $hinter = new WithHint(); - $hinter->hinted($mock); - } - - function testImplementedInterfacesAreCarried() { - $mock = new MockImplementsDummy(); - $hinter = new WithHint(); - $hinter->hinted($mock); - } - - function testNoSpuriousWarningsWhenSkippingDefaultedParameter() { - $mock = new MockImplementsDummy(); - $mock->extraMethod(); - } -} - -interface SampleInterfaceWithConstruct { - function __construct($something); -} - -class TestOfInterfaceMocksWithConstruct extends UnitTestCase { - function TODO_testBasicConstructOfAnInterface() { // Fails in PHP 5.3dev - Mock::generate('SampleInterfaceWithConstruct'); - } -} - -interface SampleInterfaceWithClone { - function __clone(); -} - -class TestOfSampleInterfaceWithClone extends UnitTestCase { - function testCanMockWithoutErrors() { - Mock::generate('SampleInterfaceWithClone'); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/interfaces_test_php5_1.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/interfaces_test_php5_1.php deleted file mode 100644 index 3d154f9..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/interfaces_test_php5_1.php +++ /dev/null @@ -1,14 +0,0 @@ -assertIsA($mock, 'SampleInterfaceWithHintInSignature'); - } -} - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/live_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/live_test.php deleted file mode 100644 index 3fbb544..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/live_test.php +++ /dev/null @@ -1,47 +0,0 @@ -assertTrue($socket->isError()); - $this->assertPattern( - '/Cannot open \\[bad_url:111\\] with \\[/', - $socket->getError()); - $this->assertFalse($socket->isOpen()); - $this->assertFalse($socket->write('A message')); - } - - function testSocketClosure() { - $socket = new SimpleSocket('www.lastcraft.com', 80, 15, 8); - $this->assertTrue($socket->isOpen()); - $this->assertTrue($socket->write("GET /test/network_confirm.php HTTP/1.0\r\n")); - $socket->write("Host: www.lastcraft.com\r\n"); - $socket->write("Connection: close\r\n\r\n"); - $this->assertEqual($socket->read(), "HTTP/1.1"); - $socket->close(); - $this->assertIdentical($socket->read(), false); - } - - function testRecordOfSentCharacters() { - $socket = new SimpleSocket('www.lastcraft.com', 80, 15); - $this->assertTrue($socket->write("GET /test/network_confirm.php HTTP/1.0\r\n")); - $socket->write("Host: www.lastcraft.com\r\n"); - $socket->write("Connection: close\r\n\r\n"); - $socket->close(); - $this->assertEqual($socket->getSent(), - "GET /test/network_confirm.php HTTP/1.0\r\n" . - "Host: www.lastcraft.com\r\n" . - "Connection: close\r\n\r\n"); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/mock_objects_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/mock_objects_test.php deleted file mode 100644 index aac2396..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/mock_objects_test.php +++ /dev/null @@ -1,1012 +0,0 @@ -assertTrue($expectation->test(33)); - $this->assertTrue($expectation->test(false)); - $this->assertTrue($expectation->test(null)); - } -} - -class TestOfParametersExpectation extends UnitTestCase { - - function testEmptyMatch() { - $expectation = new ParametersExpectation(array()); - $this->assertTrue($expectation->test(array())); - $this->assertFalse($expectation->test(array(33))); - } - - function testSingleMatch() { - $expectation = new ParametersExpectation(array(0)); - $this->assertFalse($expectation->test(array(1))); - $this->assertTrue($expectation->test(array(0))); - } - - function testAnyMatch() { - $expectation = new ParametersExpectation(false); - $this->assertTrue($expectation->test(array())); - $this->assertTrue($expectation->test(array(1, 2))); - } - - function testMissingParameter() { - $expectation = new ParametersExpectation(array(0)); - $this->assertFalse($expectation->test(array())); - } - - function testNullParameter() { - $expectation = new ParametersExpectation(array(null)); - $this->assertTrue($expectation->test(array(null))); - $this->assertFalse($expectation->test(array())); - } - - function testAnythingExpectations() { - $expectation = new ParametersExpectation(array(new AnythingExpectation())); - $this->assertFalse($expectation->test(array())); - $this->assertIdentical($expectation->test(array(null)), true); - $this->assertIdentical($expectation->test(array(13)), true); - } - - function testOtherExpectations() { - $expectation = new ParametersExpectation( - array(new PatternExpectation('/hello/i'))); - $this->assertFalse($expectation->test(array('Goodbye'))); - $this->assertTrue($expectation->test(array('hello'))); - $this->assertTrue($expectation->test(array('Hello'))); - } - - function testIdentityOnly() { - $expectation = new ParametersExpectation(array("0")); - $this->assertFalse($expectation->test(array(0))); - $this->assertTrue($expectation->test(array("0"))); - } - - function testLongList() { - $expectation = new ParametersExpectation( - array("0", 0, new AnythingExpectation(), false)); - $this->assertTrue($expectation->test(array("0", 0, 37, false))); - $this->assertFalse($expectation->test(array("0", 0, 37, true))); - $this->assertFalse($expectation->test(array("0", 0, 37))); - } -} - -class TestOfSimpleSignatureMap extends UnitTestCase { - - function testEmpty() { - $map = new SimpleSignatureMap(); - $this->assertFalse($map->isMatch("any", array())); - $this->assertNull($map->findFirstAction("any", array())); - } - - function testDifferentCallSignaturesCanHaveDifferentReferences() { - $map = new SimpleSignatureMap(); - $fred = 'Fred'; - $jim = 'jim'; - $map->add(array(0), $fred); - $map->add(array('0'), $jim); - $this->assertSame($fred, $map->findFirstAction(array(0))); - $this->assertSame($jim, $map->findFirstAction(array('0'))); - } - - function testWildcard() { - $fred = 'Fred'; - $map = new SimpleSignatureMap(); - $map->add(array(new AnythingExpectation(), 1, 3), $fred); - $this->assertTrue($map->isMatch(array(2, 1, 3))); - $this->assertSame($map->findFirstAction(array(2, 1, 3)), $fred); - } - - function testAllWildcard() { - $fred = 'Fred'; - $map = new SimpleSignatureMap(); - $this->assertFalse($map->isMatch(array(2, 1, 3))); - $map->add('', $fred); - $this->assertTrue($map->isMatch(array(2, 1, 3))); - $this->assertSame($map->findFirstAction(array(2, 1, 3)), $fred); - } - - function testOrdering() { - $map = new SimpleSignatureMap(); - $map->add(array(1, 2), new SimpleByValue("1, 2")); - $map->add(array(1, 3), new SimpleByValue("1, 3")); - $map->add(array(1), new SimpleByValue("1")); - $map->add(array(1, 4), new SimpleByValue("1, 4")); - $map->add(array(new AnythingExpectation()), new SimpleByValue("Any")); - $map->add(array(2), new SimpleByValue("2")); - $map->add("", new SimpleByValue("Default")); - $map->add(array(), new SimpleByValue("None")); - $this->assertEqual($map->findFirstAction(array(1, 2)), new SimpleByValue("1, 2")); - $this->assertEqual($map->findFirstAction(array(1, 3)), new SimpleByValue("1, 3")); - $this->assertEqual($map->findFirstAction(array(1, 4)), new SimpleByValue("1, 4")); - $this->assertEqual($map->findFirstAction(array(1)), new SimpleByValue("1")); - $this->assertEqual($map->findFirstAction(array(2)), new SimpleByValue("Any")); - $this->assertEqual($map->findFirstAction(array(3)), new SimpleByValue("Any")); - $this->assertEqual($map->findFirstAction(array()), new SimpleByValue("Default")); - } -} - -class TestOfCallSchedule extends UnitTestCase { - function testCanBeSetToAlwaysReturnTheSameReference() { - $a = 5; - $schedule = new SimpleCallSchedule(); - $schedule->register('aMethod', false, new SimpleByReference($a)); - $this->assertReference($schedule->respond(0, 'aMethod', array()), $a); - $this->assertReference($schedule->respond(1, 'aMethod', array()), $a); - } - - function testSpecificSignaturesOverrideTheAlwaysCase() { - $any = 'any'; - $one = 'two'; - $schedule = new SimpleCallSchedule(); - $schedule->register('aMethod', array(1), new SimpleByReference($one)); - $schedule->register('aMethod', false, new SimpleByReference($any)); - $this->assertReference($schedule->respond(0, 'aMethod', array(2)), $any); - $this->assertReference($schedule->respond(0, 'aMethod', array(1)), $one); - } - - function testReturnsCanBeSetOverTime() { - $one = 'one'; - $two = 'two'; - $schedule = new SimpleCallSchedule(); - $schedule->registerAt(0, 'aMethod', false, new SimpleByReference($one)); - $schedule->registerAt(1, 'aMethod', false, new SimpleByReference($two)); - $this->assertReference($schedule->respond(0, 'aMethod', array()), $one); - $this->assertReference($schedule->respond(1, 'aMethod', array()), $two); - } - - function testReturnsOverTimecanBeAlteredByTheArguments() { - $one = '1'; - $two = '2'; - $two_a = '2a'; - $schedule = new SimpleCallSchedule(); - $schedule->registerAt(0, 'aMethod', false, new SimpleByReference($one)); - $schedule->registerAt(1, 'aMethod', array('a'), new SimpleByReference($two_a)); - $schedule->registerAt(1, 'aMethod', false, new SimpleByReference($two)); - $this->assertReference($schedule->respond(0, 'aMethod', array()), $one); - $this->assertReference($schedule->respond(1, 'aMethod', array()), $two); - $this->assertReference($schedule->respond(1, 'aMethod', array('a')), $two_a); - } - - function testCanReturnByValue() { - $a = 5; - $schedule = new SimpleCallSchedule(); - $schedule->register('aMethod', false, new SimpleByValue($a)); - $this->assertCopy($schedule->respond(0, 'aMethod', array()), $a); - } - - function testCanThrowException() { - if (version_compare(phpversion(), '5', '>=')) { - $schedule = new SimpleCallSchedule(); - $schedule->register('aMethod', false, new SimpleThrower(new Exception('Ouch'))); - $this->expectException(new Exception('Ouch')); - $schedule->respond(0, 'aMethod', array()); - } - } - - function testCanEmitError() { - $schedule = new SimpleCallSchedule(); - $schedule->register('aMethod', false, new SimpleErrorThrower('Ouch', E_USER_WARNING)); - $this->expectError('Ouch'); - $schedule->respond(0, 'aMethod', array()); - } -} - -class Dummy { - function Dummy() { - } - - function aMethod() { - return true; - } - - function &aReferenceMethod() { - return true; - } - - function anotherMethod() { - return true; - } -} -Mock::generate('Dummy'); -Mock::generate('Dummy', 'AnotherMockDummy'); -Mock::generate('Dummy', 'MockDummyWithExtraMethods', array('extraMethod')); - -class TestOfMockGeneration extends UnitTestCase { - - function testCloning() { - $mock = new MockDummy(); - $this->assertTrue(method_exists($mock, "aMethod")); - $this->assertNull($mock->aMethod()); - } - - function testCloningWithExtraMethod() { - $mock = new MockDummyWithExtraMethods(); - $this->assertTrue(method_exists($mock, "extraMethod")); - } - - function testCloningWithChosenClassName() { - $mock = new AnotherMockDummy(); - $this->assertTrue(method_exists($mock, "aMethod")); - } -} - -class TestOfMockReturns extends UnitTestCase { - - function testDefaultReturn() { - $mock = new MockDummy(); - $mock->setReturnValue("aMethod", "aaa"); - $this->assertIdentical($mock->aMethod(), "aaa"); - $this->assertIdentical($mock->aMethod(), "aaa"); - } - - function testParameteredReturn() { - $mock = new MockDummy(); - $mock->setReturnValue('aMethod', 'aaa', array(1, 2, 3)); - $this->assertNull($mock->aMethod()); - $this->assertIdentical($mock->aMethod(1, 2, 3), 'aaa'); - } - - function testSetReturnGivesObjectReference() { - $mock = new MockDummy(); - $object = new Dummy(); - $mock->returns('aMethod', $object, array(1, 2, 3)); - $this->assertSame($mock->aMethod(1, 2, 3), $object); - } - - function testSetReturnReferenceGivesOriginalReference() { - $mock = new MockDummy(); - $object = 1; - $mock->setReturnReference('aReferenceMethod', $object, array(1, 2, 3)); - $this->assertReference($mock->aReferenceMethod(1, 2, 3), $object); - } - - function testPatternMatchReturn() { - $mock = new MockDummy(); - $mock->setReturnValue( - "aMethod", - "aaa", - array(new PatternExpectation('/hello/i'))); - $this->assertIdentical($mock->aMethod('Hello'), "aaa"); - $this->assertNull($mock->aMethod('Goodbye')); - } - - function testMultipleMethods() { - $mock = new MockDummy(); - $mock->setReturnValue("aMethod", 100, array(1)); - $mock->setReturnValue("aMethod", 200, array(2)); - $mock->setReturnValue("anotherMethod", 10, array(1)); - $mock->setReturnValue("anotherMethod", 20, array(2)); - $this->assertIdentical($mock->aMethod(1), 100); - $this->assertIdentical($mock->anotherMethod(1), 10); - $this->assertIdentical($mock->aMethod(2), 200); - $this->assertIdentical($mock->anotherMethod(2), 20); - } - - function testReturnSequence() { - $mock = new MockDummy(); - $mock->setReturnValueAt(0, "aMethod", "aaa"); - $mock->setReturnValueAt(1, "aMethod", "bbb"); - $mock->setReturnValueAt(3, "aMethod", "ddd"); - $this->assertIdentical($mock->aMethod(), "aaa"); - $this->assertIdentical($mock->aMethod(), "bbb"); - $this->assertNull($mock->aMethod()); - $this->assertIdentical($mock->aMethod(), "ddd"); - } - - function testSetReturnReferenceAtGivesOriginal() { - $mock = new MockDummy(); - $object = 100; - $mock->setReturnReferenceAt(1, "aReferenceMethod", $object); - $this->assertNull($mock->aReferenceMethod()); - $this->assertReference($mock->aReferenceMethod(), $object); - $this->assertNull($mock->aReferenceMethod()); - } - - function testReturnsAtGivesOriginalObjectHandle() { - $mock = new MockDummy(); - $object = new Dummy(); - $mock->returnsAt(1, "aMethod", $object); - $this->assertNull($mock->aMethod()); - $this->assertSame($mock->aMethod(), $object); - $this->assertNull($mock->aMethod()); - } - - function testComplicatedReturnSequence() { - $mock = new MockDummy(); - $object = new Dummy(); - $mock->returnsAt(1, "aMethod", "aaa", array("a")); - $mock->returnsAt(1, "aMethod", "bbb"); - $mock->returnsAt(2, "aMethod", $object, array('*', 2)); - $mock->returnsAt(2, "aMethod", "value", array('*', 3)); - $mock->returns("aMethod", 3, array(3)); - $this->assertNull($mock->aMethod()); - $this->assertEqual($mock->aMethod("a"), "aaa"); - $this->assertSame($mock->aMethod(1, 2), $object); - $this->assertEqual($mock->aMethod(3), 3); - $this->assertNull($mock->aMethod()); - } - - function testMultipleMethodSequences() { - $mock = new MockDummy(); - $mock->setReturnValueAt(0, "aMethod", "aaa"); - $mock->setReturnValueAt(1, "aMethod", "bbb"); - $mock->setReturnValueAt(0, "anotherMethod", "ccc"); - $mock->setReturnValueAt(1, "anotherMethod", "ddd"); - $this->assertIdentical($mock->aMethod(), "aaa"); - $this->assertIdentical($mock->anotherMethod(), "ccc"); - $this->assertIdentical($mock->aMethod(), "bbb"); - $this->assertIdentical($mock->anotherMethod(), "ddd"); - } - - function testSequenceFallback() { - $mock = new MockDummy(); - $mock->setReturnValueAt(0, "aMethod", "aaa", array('a')); - $mock->setReturnValueAt(1, "aMethod", "bbb", array('a')); - $mock->setReturnValue("aMethod", "AAA"); - $this->assertIdentical($mock->aMethod('a'), "aaa"); - $this->assertIdentical($mock->aMethod('b'), "AAA"); - } - - function testMethodInterference() { - $mock = new MockDummy(); - $mock->setReturnValueAt(0, "anotherMethod", "aaa"); - $mock->setReturnValue("aMethod", "AAA"); - $this->assertIdentical($mock->aMethod(), "AAA"); - $this->assertIdentical($mock->anotherMethod(), "aaa"); - } -} - -class TestOfMockExpectationsThatPass extends UnitTestCase { - - function testAnyArgument() { - $mock = new MockDummy(); - $mock->expect('aMethod', array('*')); - $mock->aMethod(1); - $mock->aMethod('hello'); - } - - function testAnyTwoArguments() { - $mock = new MockDummy(); - $mock->expect('aMethod', array('*', '*')); - $mock->aMethod(1, 2); - } - - function testSpecificArgument() { - $mock = new MockDummy(); - $mock->expect('aMethod', array(1)); - $mock->aMethod(1); - } - - function testExpectation() { - $mock = new MockDummy(); - $mock->expect('aMethod', array(new IsAExpectation('Dummy'))); - $mock->aMethod(new Dummy()); - } - - function testArgumentsInSequence() { - $mock = new MockDummy(); - $mock->expectAt(0, 'aMethod', array(1, 2)); - $mock->expectAt(1, 'aMethod', array(3, 4)); - $mock->aMethod(1, 2); - $mock->aMethod(3, 4); - } - - function testAtLeastOnceSatisfiedByOneCall() { - $mock = new MockDummy(); - $mock->expectAtLeastOnce('aMethod'); - $mock->aMethod(); - } - - function testAtLeastOnceSatisfiedByTwoCalls() { - $mock = new MockDummy(); - $mock->expectAtLeastOnce('aMethod'); - $mock->aMethod(); - $mock->aMethod(); - } - - function testOnceSatisfiedByOneCall() { - $mock = new MockDummy(); - $mock->expectOnce('aMethod'); - $mock->aMethod(); - } - - function testMinimumCallsSatisfiedByEnoughCalls() { - $mock = new MockDummy(); - $mock->expectMinimumCallCount('aMethod', 1); - $mock->aMethod(); - } - - function testMinimumCallsSatisfiedByTooManyCalls() { - $mock = new MockDummy(); - $mock->expectMinimumCallCount('aMethod', 3); - $mock->aMethod(); - $mock->aMethod(); - $mock->aMethod(); - $mock->aMethod(); - } - - function testMaximumCallsSatisfiedByEnoughCalls() { - $mock = new MockDummy(); - $mock->expectMaximumCallCount('aMethod', 1); - $mock->aMethod(); - } - - function testMaximumCallsSatisfiedByNoCalls() { - $mock = new MockDummy(); - $mock->expectMaximumCallCount('aMethod', 1); - } -} - -class MockWithInjectedTestCase extends SimpleMock { - protected function getCurrentTestCase() { - return SimpleTest::getContext()->getTest()->getMockedTest(); - } -} -SimpleTest::setMockBaseClass('MockWithInjectedTestCase'); -Mock::generate('Dummy', 'MockDummyWithInjectedTestCase'); -SimpleTest::setMockBaseClass('SimpleMock'); -Mock::generate('SimpleTestCase'); - -class LikeExpectation extends IdenticalExpectation { - function __construct($expectation) { - $expectation->message = ''; - parent::__construct($expectation); - } - - function test($compare) { - $compare->message = ''; - return parent::test($compare); - } - - function testMessage($compare) { - $compare->message = ''; - return parent::testMessage($compare); - } -} - -class TestOfMockExpectations extends UnitTestCase { - private $test; - - function setUp() { - $this->test = new MockSimpleTestCase(); - } - - function getMockedTest() { - return $this->test; - } - - function testSettingExpectationOnNonMethodThrowsError() { - $mock = new MockDummyWithInjectedTestCase(); - $this->expectError(); - $mock->expectMaximumCallCount('aMissingMethod', 2); - } - - function testMaxCallsDetectsOverrun() { - $this->test->expectOnce('assert', array( - new LikeExpectation(new MaximumCallCountExpectation('aMethod', 2)), - 3)); - $mock = new MockDummyWithInjectedTestCase(); - $mock->expectMaximumCallCount('aMethod', 2); - $mock->aMethod(); - $mock->aMethod(); - $mock->aMethod(); - $mock->mock->atTestEnd('testSomething', $this->test); - } - - function testTallyOnMaxCallsSendsPassOnUnderrun() { - $this->test->expectOnce('assert', array( - new LikeExpectation(new MaximumCallCountExpectation('aMethod', 2)), - 2)); - $mock = new MockDummyWithInjectedTestCase(); - $mock->expectMaximumCallCount("aMethod", 2); - $mock->aMethod(); - $mock->aMethod(); - $mock->mock->atTestEnd('testSomething', $this->test); - } - - function testExpectNeverDetectsOverrun() { - $this->test->expectOnce('assert', array( - new LikeExpectation(new MaximumCallCountExpectation('aMethod', 0)), - 1)); - $mock = new MockDummyWithInjectedTestCase(); - $mock->expectNever('aMethod'); - $mock->aMethod(); - $mock->mock->atTestEnd('testSomething', $this->test); - } - - function testTallyOnExpectNeverStillSendsPassOnUnderrun() { - $this->test->expectOnce('assert', array( - new LikeExpectation(new MaximumCallCountExpectation('aMethod', 0)), - 0)); - $mock = new MockDummyWithInjectedTestCase(); - $mock->expectNever('aMethod'); - $mock->mock->atTestEnd('testSomething', $this->test); - } - - function testMinCalls() { - $this->test->expectOnce('assert', array( - new LikeExpectation(new MinimumCallCountExpectation('aMethod', 2)), - 2)); - $mock = new MockDummyWithInjectedTestCase(); - $mock->expectMinimumCallCount('aMethod', 2); - $mock->aMethod(); - $mock->aMethod(); - $mock->mock->atTestEnd('testSomething', $this->test); - } - - function testFailedNever() { - $this->test->expectOnce('assert', array( - new LikeExpectation(new MaximumCallCountExpectation('aMethod', 0)), - 1)); - $mock = new MockDummyWithInjectedTestCase(); - $mock->expectNever('aMethod'); - $mock->aMethod(); - $mock->mock->atTestEnd('testSomething', $this->test); - } - - function testUnderOnce() { - $this->test->expectOnce('assert', array( - new LikeExpectation(new CallCountExpectation('aMethod', 1)), - 0)); - $mock = new MockDummyWithInjectedTestCase(); - $mock->expectOnce('aMethod'); - $mock->mock->atTestEnd('testSomething', $this->test); - } - - function testOverOnce() { - $this->test->expectOnce('assert', array( - new LikeExpectation(new CallCountExpectation('aMethod', 1)), - 2)); - $mock = new MockDummyWithInjectedTestCase(); - $mock->expectOnce('aMethod'); - $mock->aMethod(); - $mock->aMethod(); - $mock->mock->atTestEnd('testSomething', $this->test); - } - - function testUnderAtLeastOnce() { - $this->test->expectOnce('assert', array( - new LikeExpectation(new MinimumCallCountExpectation('aMethod', 1)), - 0)); - $mock = new MockDummyWithInjectedTestCase(); - $mock->expectAtLeastOnce("aMethod"); - $mock->mock->atTestEnd('testSomething', $this->test); - } - - function testZeroArguments() { - $this->test->expectOnce('assert', array( - new LikeExpectation(new ParametersExpectation(array())), - array(), - '*')); - $mock = new MockDummyWithInjectedTestCase(); - $mock->expect("aMethod", array()); - $mock->aMethod(); - $mock->mock->atTestEnd('testSomething', $this->test); - } - - function testExpectedArguments() { - $this->test->expectOnce('assert', array( - new LikeExpectation(new ParametersExpectation(array(1, 2, 3))), - array(1, 2, 3), - '*')); - $mock = new MockDummyWithInjectedTestCase(); - $mock->expect('aMethod', array(1, 2, 3)); - $mock->aMethod(1, 2, 3); - $mock->mock->atTestEnd('testSomething', $this->test); - } - - function testFailedArguments() { - $this->test->expectOnce('assert', array( - new LikeExpectation(new ParametersExpectation(array('this'))), - array('that'), - '*')); - $mock = new MockDummyWithInjectedTestCase(); - $mock->expect('aMethod', array('this')); - $mock->aMethod('that'); - $mock->mock->atTestEnd('testSomething', $this->test); - } - - function testWildcardsAreTranslatedToAnythingExpectations() { - $this->test->expectOnce('assert', array( - new LikeExpectation(new ParametersExpectation(array( - new AnythingExpectation(), 123, new AnythingExpectation()))), - array(100, 123, 101), - '*')); - $mock = new MockDummyWithInjectedTestCase($this); - $mock->expect("aMethod", array('*', 123, '*')); - $mock->aMethod(100, 123, 101); - $mock->mock->atTestEnd('testSomething', $this->test); - } - - function testSpecificPassingSequence() { - $this->test->expectAt(0, 'assert', array( - new LikeExpectation(new ParametersExpectation(array(1, 2, 3))), - array(1, 2, 3), - '*')); - $this->test->expectAt(1, 'assert', array( - new LikeExpectation(new ParametersExpectation(array('Hello'))), - array('Hello'), - '*')); - $mock = new MockDummyWithInjectedTestCase(); - $mock->expectAt(1, 'aMethod', array(1, 2, 3)); - $mock->expectAt(2, 'aMethod', array('Hello')); - $mock->aMethod(); - $mock->aMethod(1, 2, 3); - $mock->aMethod('Hello'); - $mock->aMethod(); - $mock->mock->atTestEnd('testSomething', $this->test); - } - - function testNonArrayForExpectedParametersGivesError() { - $mock = new MockDummyWithInjectedTestCase(); - $this->expectError(new PatternExpectation('/\$args.*not an array/i')); - $mock->expect("aMethod", "foo"); - $mock->aMethod(); - $mock->mock->atTestEnd('testSomething', $this->test); - } -} - -class TestOfMockComparisons extends UnitTestCase { - - function testEqualComparisonOfMocksDoesNotCrash() { - $expectation = new EqualExpectation(new MockDummy()); - $this->assertTrue($expectation->test(new MockDummy(), true)); - } - - function testIdenticalComparisonOfMocksDoesNotCrash() { - $expectation = new IdenticalExpectation(new MockDummy()); - $this->assertTrue($expectation->test(new MockDummy())); - } -} - -class ClassWithSpecialMethods { - function __get($name) { } - function __set($name, $value) { } - function __isset($name) { } - function __unset($name) { } - function __call($method, $arguments) { } - function __toString() { } -} -Mock::generate('ClassWithSpecialMethods'); - -class TestOfSpecialMethodsAfterPHP51 extends UnitTestCase { - - function skip() { - $this->skipIf(version_compare(phpversion(), '5.1', '<'), '__isset and __unset overloading not tested unless PHP 5.1+'); - } - - function testCanEmulateIsset() { - $mock = new MockClassWithSpecialMethods(); - $mock->setReturnValue('__isset', true); - $this->assertIdentical(isset($mock->a), true); - } - - function testCanExpectUnset() { - $mock = new MockClassWithSpecialMethods(); - $mock->expectOnce('__unset', array('a')); - unset($mock->a); - } - -} - -class TestOfSpecialMethods extends UnitTestCase { - function skip() { - $this->skipIf(version_compare(phpversion(), '5', '<'), 'Overloading not tested unless PHP 5+'); - } - - function testCanMockTheThingAtAll() { - $mock = new MockClassWithSpecialMethods(); - } - - function testReturnFromSpecialAccessor() { - $mock = new MockClassWithSpecialMethods(); - $mock->setReturnValue('__get', '1st Return', array('first')); - $mock->setReturnValue('__get', '2nd Return', array('second')); - $this->assertEqual($mock->first, '1st Return'); - $this->assertEqual($mock->second, '2nd Return'); - } - - function testcanExpectTheSettingOfValue() { - $mock = new MockClassWithSpecialMethods(); - $mock->expectOnce('__set', array('a', 'A')); - $mock->a = 'A'; - } - - function testCanSimulateAnOverloadmethod() { - $mock = new MockClassWithSpecialMethods(); - $mock->expectOnce('__call', array('amOverloaded', array('A'))); - $mock->setReturnValue('__call', 'aaa'); - $this->assertIdentical($mock->amOverloaded('A'), 'aaa'); - } - - function testToStringMagic() { - $mock = new MockClassWithSpecialMethods(); - $mock->expectOnce('__toString'); - $mock->setReturnValue('__toString', 'AAA'); - ob_start(); - print $mock; - $output = ob_get_contents(); - ob_end_clean(); - $this->assertEqual($output, 'AAA'); - } -} - -class WithStaticMethod { - static function aStaticMethod() { } -} -Mock::generate('WithStaticMethod'); - -class TestOfMockingClassesWithStaticMethods extends UnitTestCase { - - function testStaticMethodIsMockedAsStatic() { - $mock = new WithStaticMethod(); - $reflection = new ReflectionClass($mock); - $method = $reflection->getMethod('aStaticMethod'); - $this->assertTrue($method->isStatic()); - } -} - -class MockTestException extends Exception { } - -class TestOfThrowingExceptionsFromMocks extends UnitTestCase { - - function testCanThrowOnMethodCall() { - $mock = new MockDummy(); - $mock->throwOn('aMethod'); - $this->expectException(); - $mock->aMethod(); - } - - function testCanThrowSpecificExceptionOnMethodCall() { - $mock = new MockDummy(); - $mock->throwOn('aMethod', new MockTestException()); - $this->expectException(); - $mock->aMethod(); - } - - function testThrowsOnlyWhenCallSignatureMatches() { - $mock = new MockDummy(); - $mock->throwOn('aMethod', new MockTestException(), array(3)); - $mock->aMethod(1); - $mock->aMethod(2); - $this->expectException(); - $mock->aMethod(3); - } - - function testCanThrowOnParticularInvocation() { - $mock = new MockDummy(); - $mock->throwAt(2, 'aMethod', new MockTestException()); - $mock->aMethod(); - $mock->aMethod(); - $this->expectException(); - $mock->aMethod(); - } -} - -class TestOfThrowingErrorsFromMocks extends UnitTestCase { - - function testCanGenerateErrorFromMethodCall() { - $mock = new MockDummy(); - $mock->errorOn('aMethod', 'Ouch!'); - $this->expectError('Ouch!'); - $mock->aMethod(); - } - - function testGeneratesErrorOnlyWhenCallSignatureMatches() { - $mock = new MockDummy(); - $mock->errorOn('aMethod', 'Ouch!', array(3)); - $mock->aMethod(1); - $mock->aMethod(2); - $this->expectError(); - $mock->aMethod(3); - } - - function testCanGenerateErrorOnParticularInvocation() { - $mock = new MockDummy(); - $mock->errorAt(2, 'aMethod', 'Ouch!'); - $mock->aMethod(); - $mock->aMethod(); - $this->expectError(); - $mock->aMethod(); - } -} - -Mock::generatePartial('Dummy', 'TestDummy', array('anotherMethod', 'aReferenceMethod')); - -class TestOfPartialMocks extends UnitTestCase { - - function testMethodReplacementWithNoBehaviourReturnsNull() { - $mock = new TestDummy(); - $this->assertEqual($mock->aMethod(99), 99); - $this->assertNull($mock->anotherMethod()); - } - - function testSettingReturns() { - $mock = new TestDummy(); - $mock->setReturnValue('anotherMethod', 33, array(3)); - $mock->setReturnValue('anotherMethod', 22); - $mock->setReturnValueAt(2, 'anotherMethod', 44, array(3)); - $this->assertEqual($mock->anotherMethod(), 22); - $this->assertEqual($mock->anotherMethod(3), 33); - $this->assertEqual($mock->anotherMethod(3), 44); - } - - function testSetReturnReferenceGivesOriginal() { - $mock = new TestDummy(); - $object = 99; - $mock->setReturnReferenceAt(0, 'aReferenceMethod', $object, array(3)); - $this->assertReference($mock->aReferenceMethod(3), $object); - } - - function testReturnsAtGivesOriginalObjectHandle() { - $mock = new TestDummy(); - $object = new Dummy(); - $mock->returnsAt(0, 'anotherMethod', $object, array(3)); - $this->assertSame($mock->anotherMethod(3), $object); - } - - function testExpectations() { - $mock = new TestDummy(); - $mock->expectCallCount('anotherMethod', 2); - $mock->expect('anotherMethod', array(77)); - $mock->expectAt(1, 'anotherMethod', array(66)); - $mock->anotherMethod(77); - $mock->anotherMethod(66); - } - - function testSettingExpectationOnMissingMethodThrowsError() { - $mock = new TestDummy(); - $this->expectError(); - $mock->expectCallCount('aMissingMethod', 2); - } -} - -class ConstructorSuperClass { - function ConstructorSuperClass() { } -} - -class ConstructorSubClass extends ConstructorSuperClass { } - -class TestOfPHP4StyleSuperClassConstruct extends UnitTestCase { - function testBasicConstruct() { - Mock::generate('ConstructorSubClass'); - $mock = new MockConstructorSubClass(); - $this->assertIsA($mock, 'ConstructorSubClass'); - $this->assertTrue(method_exists($mock, 'ConstructorSuperClass')); - } -} - -class TestOfPHP5StaticMethodMocking extends UnitTestCase { - function testCanCreateAMockObjectWithStaticMethodsWithoutError() { - eval(' - class SimpleObjectContainingStaticMethod { - static function someStatic() { } - } - '); - Mock::generate('SimpleObjectContainingStaticMethod'); - } -} - -class TestOfPHP5AbstractMethodMocking extends UnitTestCase { - function testCanCreateAMockObjectFromAnAbstractWithProperFunctionDeclarations() { - eval(' - abstract class SimpleAbstractClassContainingAbstractMethods { - abstract function anAbstract(); - abstract function anAbstractWithParameter($foo); - abstract function anAbstractWithMultipleParameters($foo, $bar); - } - '); - Mock::generate('SimpleAbstractClassContainingAbstractMethods'); - $this->assertTrue( - method_exists( - // Testing with class name alone does not work in PHP 5.0 - new MockSimpleAbstractClassContainingAbstractMethods, - 'anAbstract' - ) - ); - $this->assertTrue( - method_exists( - new MockSimpleAbstractClassContainingAbstractMethods, - 'anAbstractWithParameter' - ) - ); - $this->assertTrue( - method_exists( - new MockSimpleAbstractClassContainingAbstractMethods, - 'anAbstractWithMultipleParameters' - ) - ); - } - - function testMethodsDefinedAsAbstractInParentShouldHaveFullSignature() { - eval(' - abstract class SimpleParentAbstractClassContainingAbstractMethods { - abstract function anAbstract(); - abstract function anAbstractWithParameter($foo); - abstract function anAbstractWithMultipleParameters($foo, $bar); - } - - class SimpleChildAbstractClassContainingAbstractMethods extends SimpleParentAbstractClassContainingAbstractMethods { - function anAbstract(){} - function anAbstractWithParameter($foo){} - function anAbstractWithMultipleParameters($foo, $bar){} - } - - class EvenDeeperEmptyChildClass extends SimpleChildAbstractClassContainingAbstractMethods {} - '); - Mock::generate('SimpleChildAbstractClassContainingAbstractMethods'); - $this->assertTrue( - method_exists( - new MockSimpleChildAbstractClassContainingAbstractMethods, - 'anAbstract' - ) - ); - $this->assertTrue( - method_exists( - new MockSimpleChildAbstractClassContainingAbstractMethods, - 'anAbstractWithParameter' - ) - ); - $this->assertTrue( - method_exists( - new MockSimpleChildAbstractClassContainingAbstractMethods, - 'anAbstractWithMultipleParameters' - ) - ); - Mock::generate('EvenDeeperEmptyChildClass'); - $this->assertTrue( - method_exists( - new MockEvenDeeperEmptyChildClass, - 'anAbstract' - ) - ); - $this->assertTrue( - method_exists( - new MockEvenDeeperEmptyChildClass, - 'anAbstractWithParameter' - ) - ); - $this->assertTrue( - method_exists( - new MockEvenDeeperEmptyChildClass, - 'anAbstractWithMultipleParameters' - ) - ); - } -} - -class DummyWithProtected -{ - public function aMethodCallsProtected() { return $this->aProtectedMethod(); } - protected function aProtectedMethod() { return true; } -} - -Mock::generatePartial('DummyWithProtected', 'TestDummyWithProtected', array('aProtectedMethod')); -class TestOfProtectedMethodPartialMocks extends UnitTestCase -{ - function testProtectedMethodExists() { - $this->assertTrue( - method_exists( - new TestDummyWithProtected, - 'aProtectedMethod' - ) - ); - } - - function testProtectedMethodIsCalled() { - $object = new DummyWithProtected(); - $this->assertTrue($object->aMethodCallsProtected(), 'ensure original was called'); - } - - function testMockedMethodIsCalled() { - $object = new TestDummyWithProtected(); - $object->setReturnValue('aProtectedMethod', false); - $this->assertFalse($object->aMethodCallsProtected()); - } -} - -?> diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/page_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/page_test.php deleted file mode 100644 index eb61c4f..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/page_test.php +++ /dev/null @@ -1,898 +0,0 @@ - 'http://somewhere')); - $tag->addContent('Label'); - - $page = new MockSimplePage(); - $page->expect('acceptTag', array($tag)); - $page->expectCallCount('acceptTag', 1); - - $builder = new PartialSimplePageBuilder(); - $builder->returns('createPage', $page); - $builder->returns('createParser', new MockSimpleHtmlSaxParser()); - $builder->__construct(); - - $builder->parse(new MockSimpleHttpResponse()); - $this->assertTrue($builder->startElement( - 'a', - array('href' => 'http://somewhere'))); - $this->assertTrue($builder->addContent('Label')); - $this->assertTrue($builder->endElement('a')); - } - - function testLinkWithId() { - $tag = new SimpleAnchorTag(array("href" => "http://somewhere", "id" => "44")); - $tag->addContent("Label"); - - $page = new MockSimplePage(); - $page->expect("acceptTag", array($tag)); - $page->expectCallCount("acceptTag", 1); - - $builder = new PartialSimplePageBuilder(); - $builder->returns('createPage', $page); - $builder->returns('createParser', new MockSimpleHtmlSaxParser()); - $builder->__construct(); - - $builder->parse(new MockSimpleHttpResponse()); - $this->assertTrue($builder->startElement( - "a", - array("href" => "http://somewhere", "id" => "44"))); - $this->assertTrue($builder->addContent("Label")); - $this->assertTrue($builder->endElement("a")); - } - - function testLinkExtraction() { - $tag = new SimpleAnchorTag(array("href" => "http://somewhere")); - $tag->addContent("Label"); - - $page = new MockSimplePage(); - $page->expect("acceptTag", array($tag)); - $page->expectCallCount("acceptTag", 1); - - $builder = new PartialSimplePageBuilder(); - $builder->returns('createPage', $page); - $builder->returns('createParser', new MockSimpleHtmlSaxParser()); - $builder->__construct(); - - $builder->parse(new MockSimpleHttpResponse()); - $this->assertTrue($builder->addContent("Starting stuff")); - $this->assertTrue($builder->startElement( - "a", - array("href" => "http://somewhere"))); - $this->assertTrue($builder->addContent("Label")); - $this->assertTrue($builder->endElement("a")); - $this->assertTrue($builder->addContent("Trailing stuff")); - } - - function testMultipleLinks() { - $a1 = new SimpleAnchorTag(array("href" => "http://somewhere")); - $a1->addContent("1"); - - $a2 = new SimpleAnchorTag(array("href" => "http://elsewhere")); - $a2->addContent("2"); - - $page = new MockSimplePage(); - $page->expectAt(0, "acceptTag", array($a1)); - $page->expectAt(1, "acceptTag", array($a2)); - $page->expectCallCount("acceptTag", 2); - - $builder = new PartialSimplePageBuilder(); - $builder->returns('createPage', $page); - $builder->returns('createParser', new MockSimpleHtmlSaxParser()); - $builder->__construct(); - - $builder->parse(new MockSimpleHttpResponse()); - $builder->startElement("a", array("href" => "http://somewhere")); - $builder->addContent("1"); - $builder->endElement("a"); - $builder->addContent("Padding"); - $builder->startElement("a", array("href" => "http://elsewhere")); - $builder->addContent("2"); - $builder->endElement("a"); - } - - function testTitle() { - $tag = new SimpleTitleTag(array()); - $tag->addContent("HereThere"); - - $page = new MockSimplePage(); - $page->expect("acceptTag", array($tag)); - $page->expectCallCount("acceptTag", 1); - - $builder = new PartialSimplePageBuilder(); - $builder->returns('createPage', $page); - $builder->returns('createParser', new MockSimpleHtmlSaxParser()); - $builder->__construct(); - - $builder->parse(new MockSimpleHttpResponse()); - $builder->startElement("title", array()); - $builder->addContent("Here"); - $builder->addContent("There"); - $builder->endElement("title"); - } - - function testForm() { - $page = new MockSimplePage(); - $page->expectOnce("acceptFormStart", array(new SimpleFormTag(array()))); - $page->expectOnce("acceptFormEnd", array()); - - $builder = new PartialSimplePageBuilder(); - $builder->returns('createPage', $page); - $builder->returns('createParser', new MockSimpleHtmlSaxParser()); - $builder->__construct(); - - $builder->parse(new MockSimpleHttpResponse()); - $builder->startElement("form", array()); - $builder->addContent("Stuff"); - $builder->endElement("form"); - } -} - -class TestOfPageParsing extends UnitTestCase { - - function testParseMechanics() { - $parser = new MockSimpleHtmlSaxParser(); - $parser->expectOnce('parse', array('stuff')); - - $page = new MockSimplePage(); - $page->expectOnce('acceptPageEnd'); - - $builder = new PartialSimplePageBuilder(); - $builder->returns('createPage', $page); - $builder->returns('createParser', $parser); - $builder->__construct(); - - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', 'stuff'); - $builder->parse($response); - } -} - -class TestOfPageInterface extends UnitTestCase { - - function testInterfaceOnEmptyPage() { - $page = new SimplePage(); - $this->assertEqual($page->getTransportError(), 'No page fetched yet'); - $this->assertIdentical($page->getRaw(), false); - $this->assertIdentical($page->getHeaders(), false); - $this->assertIdentical($page->getMimeType(), false); - $this->assertIdentical($page->getResponseCode(), false); - $this->assertIdentical($page->getAuthentication(), false); - $this->assertIdentical($page->getRealm(), false); - $this->assertFalse($page->hasFrames()); - $this->assertIdentical($page->getUrls(), array()); - $this->assertIdentical($page->getTitle(), false); - } -} - -class TestOfPageHeaders extends UnitTestCase { - - function testUrlAccessor() { - $headers = new MockSimpleHttpHeaders(); - - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getHeaders', $headers); - $response->setReturnValue('getMethod', 'POST'); - $response->setReturnValue('getUrl', new SimpleUrl('here')); - $response->setReturnValue('getRequestData', array('a' => 'A')); - - $page = new SimplePage($response); - $this->assertEqual($page->getMethod(), 'POST'); - $this->assertEqual($page->getUrl(), new SimpleUrl('here')); - $this->assertEqual($page->getRequestData(), array('a' => 'A')); - } - - function testTransportError() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getError', 'Ouch'); - - $page = new SimplePage($response); - $this->assertEqual($page->getTransportError(), 'Ouch'); - } - - function testHeadersAccessor() { - $headers = new MockSimpleHttpHeaders(); - $headers->setReturnValue('getRaw', 'My: Headers'); - - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getHeaders', $headers); - - $page = new SimplePage($response); - $this->assertEqual($page->getHeaders(), 'My: Headers'); - } - - function testMimeAccessor() { - $headers = new MockSimpleHttpHeaders(); - $headers->setReturnValue('getMimeType', 'text/html'); - - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getHeaders', $headers); - - $page = new SimplePage($response); - $this->assertEqual($page->getMimeType(), 'text/html'); - } - - function testResponseAccessor() { - $headers = new MockSimpleHttpHeaders(); - $headers->setReturnValue('getResponseCode', 301); - - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getHeaders', $headers); - - $page = new SimplePage($response); - $this->assertIdentical($page->getResponseCode(), 301); - } - - function testAuthenticationAccessors() { - $headers = new MockSimpleHttpHeaders(); - $headers->setReturnValue('getAuthentication', 'Basic'); - $headers->setReturnValue('getRealm', 'Secret stuff'); - - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getHeaders', $headers); - - $page = new SimplePage($response); - $this->assertEqual($page->getAuthentication(), 'Basic'); - $this->assertEqual($page->getRealm(), 'Secret stuff'); - } -} - -class TestOfHtmlPage extends UnitTestCase { - - function testRawAccessor() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', 'Raw HTML'); - - $page = new SimplePage($response); - $this->assertEqual($page->getRaw(), 'Raw HTML'); - } - - function testTextAccessor() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', 'Some "messy" HTML'); - - $page = new SimplePage($response); - $this->assertEqual($page->getText(), 'Some "messy" HTML'); - } - - function testNoLinks() { - $page = new SimplePage(new MockSimpleHttpResponse()); - $this->assertIdentical($page->getUrls(), array()); - $this->assertIdentical($page->getUrlsByLabel('Label'), array()); - } - - function testAddAbsoluteLink() { - $link = new SimpleAnchorTag(array('href' => 'http://somewhere.com')); - $link->addContent('Label'); - $page = new SimplePage(new MockSimpleHttpResponse()); - $page->AcceptTag($link); - $this->assertEqual( - $page->getUrlsByLabel('Label'), - array(new SimpleUrl('http://somewhere.com'))); - } - - function testAddStrictRelativeLink() { - $link = new SimpleAnchorTag(array('href' => './somewhere.php')); - $link->addContent('Label'); - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getUrl', new SimpleUrl('http://host/')); - $page = new SimplePage($response); - $page->AcceptTag($link); - $this->assertEqual( - $page->getUrlsByLabel('Label'), - array(new SimpleUrl('http://host/somewhere.php'))); - } - - function testAddBareRelativeLink() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getUrl', new SimpleUrl('http://host/')); - $page = new SimplePage($response); - $page->AcceptTag(new SimpleAnchorTag(array('href' => 'somewhere.php'))); - $this->assertIdentical($page->getUrls(), array('http://host/somewhere.php')); - } - - function testAddRelativeLinkWithBaseTag() { - $link = new SimpleAnchorTag(array('href' => 'somewhere.php')); - $link->addContent('Label'); - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getUrl', new SimpleUrl('http://host/')); - $page = new SimplePage($response); - $page->AcceptTag($link); - $base = new SimpleBaseTag(array('href' => 'www.lastcraft.com/stuff/')); - $page->AcceptTag($base); - $this->assertEqual( - $page->getUrlsByLabel('Label'), - array(new SimpleUrl('www.lastcraft.com/stuff/somewhere.php'))); - } - - function testAddAbsoluteLinkWithBaseTag() { - $link = new SimpleAnchorTag(array('href' => 'http://here.com/somewhere.php')); - $link->addContent('Label'); - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getUrl', new SimpleUrl('http://host/')); - $page = new SimplePage($response); - $page->AcceptTag($link); - $base = new SimpleBaseTag(array('href' => 'www.lastcraft.com/stuff/')); - $page->AcceptTag($base); - $this->assertEqual( - $page->getUrlsByLabel('Label'), - array(new SimpleUrl('http://here.com/somewhere.php'))); - } - - function testLinkIds() { - $link = new SimpleAnchorTag(array('href' => './somewhere.php', 'id' => 33)); - $link->addContent('Label'); - - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getUrl', new SimpleUrl('http://host/')); - - $page = new SimplePage($response); - $page->AcceptTag($link); - - $this->assertEqual( - $page->getUrlsByLabel('Label'), - array(new SimpleUrl('http://host/somewhere.php'))); - $this->assertFalse($page->getUrlById(0)); - $this->assertEqual( - $page->getUrlById(33), - new SimpleUrl('http://host/somewhere.php')); - } - - function testFindLinkWithNormalisation() { - $link = new SimpleAnchorTag(array('href' => './somewhere.php', 'id' => 33)); - $link->addContent(' Long & thin '); - - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getUrl', new SimpleUrl('http://host/')); - - $page = new SimplePage($response); - $page->AcceptTag($link); - - $this->assertEqual( - $page->getUrlsByLabel('Long & thin'), - array(new SimpleUrl('http://host/somewhere.php'))); - } - - function testFindLinkWithImage() { - $link = new SimpleAnchorTag(array('href' => './somewhere.php', 'id' => 33)); - $link->addContent('<A picture>'); - - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getUrl', new SimpleUrl('http://host/')); - - $page = new SimplePage($response); - $page->AcceptTag($link); - - $this->assertEqual( - $page->getUrlsByLabel(''), - array(new SimpleUrl('http://host/somewhere.php'))); - } - - function testTitleSetting() { - $title = new SimpleTitleTag(array()); - $title->addContent('Title'); - $page = new SimplePage(new MockSimpleHttpResponse()); - $page->AcceptTag($title); - $this->assertEqual($page->getTitle(), 'Title'); - } - - function testFramesetAbsence() { - $url = new SimpleUrl('here'); - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getUrl', $url); - $page = new SimplePage($response); - $this->assertFalse($page->hasFrames()); - $this->assertIdentical($page->getFrameset(), false); - } - - function testHasEmptyFrameset() { - $page = new SimplePage(new MockSimpleHttpResponse()); - $page->acceptFramesetStart(new SimpleTag('frameset', array())); - $page->acceptFramesetEnd(); - $this->assertTrue($page->hasFrames()); - $this->assertIdentical($page->getFrameset(), array()); - } - - function testFramesInPage() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getUrl', new SimpleUrl('http://here')); - - $page = new SimplePage($response); - $page->acceptFrame(new SimpleFrameTag(array('src' => '1.html'))); - $page->acceptFramesetStart(new SimpleTag('frameset', array())); - $page->acceptFrame(new SimpleFrameTag(array('src' => '2.html'))); - $page->acceptFrame(new SimpleFrameTag(array('src' => '3.html'))); - $page->acceptFramesetEnd(); - $page->acceptFrame(new SimpleFrameTag(array('src' => '4.html'))); - - $this->assertTrue($page->hasFrames()); - $this->assertIdentical($page->getFrameset(), array( - 1 => new SimpleUrl('http://here/2.html'), - 2 => new SimpleUrl('http://here/3.html'))); - } - - function testNamedFramesInPage() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getUrl', new SimpleUrl('http://here')); - - $page = new SimplePage($response); - $page->acceptFramesetStart(new SimpleTag('frameset', array())); - $page->acceptFrame(new SimpleFrameTag(array('src' => '1.html'))); - $page->acceptFrame(new SimpleFrameTag(array('src' => '2.html', 'name' => 'A'))); - $page->acceptFrame(new SimpleFrameTag(array('src' => '3.html', 'name' => 'B'))); - $page->acceptFrame(new SimpleFrameTag(array('src' => '4.html'))); - $page->acceptFramesetEnd(); - - $this->assertTrue($page->hasFrames()); - $this->assertIdentical($page->getFrameset(), array( - 1 => new SimpleUrl('http://here/1.html'), - 'A' => new SimpleUrl('http://here/2.html'), - 'B' => new SimpleUrl('http://here/3.html'), - 4 => new SimpleUrl('http://here/4.html'))); - } - - function testRelativeFramesRespectBaseTag() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getUrl', new SimpleUrl('http://here.com/')); - $page = new SimplePage($response); - - $base = new SimpleBaseTag(array('href' => 'https://there.com/stuff/')); - $page->AcceptTag($base); - - $page->acceptFramesetStart(new SimpleTag('frameset', array())); - $page->acceptFrame(new SimpleFrameTag(array('src' => '1.html'))); - $page->acceptFramesetEnd(); - $this->assertIdentical( - $page->getFrameset(), - array(1 => new SimpleUrl('https://there.com/stuff/1.html'))); - } -} - -class TestOfFormsCreatedFromEventStream extends UnitTestCase { - - function testFormCanBeSubmitted() { - $page = new SimplePage(new MockSimpleHttpResponse()); - $page->acceptFormStart( - new SimpleFormTag(array('method' => 'GET', 'action' => 'here.php'))); - $page->AcceptTag( - new SimpleSubmitTag(array('type' => 'submit', 'name' => 's'))); - $page->acceptFormEnd(); - $form = &$page->getFormBySubmit(new SimpleByLabel('Submit')); - $this->assertEqual( - $form->submitButton(new SimpleByLabel('Submit')), - new SimpleGetEncoding(array('s' => 'Submit'))); - } - - function testInputFieldCanBeReadBack() { - $page = new SimplePage(new MockSimpleHttpResponse()); - $page->acceptFormStart( - new SimpleFormTag(array("method" => "GET", "action" => "here.php"))); - $page->AcceptTag( - new SimpleTextTag(array("type" => "text", "name" => "a", "value" => "A"))); - $page->AcceptTag( - new SimpleSubmitTag(array("type" => "submit", "name" => "s"))); - $page->acceptFormEnd(); - $this->assertEqual($page->getField(new SimpleByName('a')), 'A'); - } - - function testInputFieldCanBeReadBackByLabel() { - $label = new SimpleLabelTag(array()); - $page = new SimplePage(new MockSimpleHttpResponse()); - $page->acceptFormStart( - new SimpleFormTag(array("method" => "GET", "action" => "here.php"))); - $page->acceptLabelStart($label); - $label->addContent('l'); - $page->AcceptTag( - new SimpleTextTag(array("type" => "text", "name" => "a", "value" => "A"))); - $page->acceptLabelEnd(); - $page->AcceptTag( - new SimpleSubmitTag(array("type" => "submit", "name" => "s"))); - $page->acceptFormEnd(); - $this->assertEqual($page->getField(new SimpleByLabel('l')), 'A'); - } -} - -class TestOfPageScraping extends UnitTestCase { - - function parse($response) { - $builder = new SimplePageBuilder(); - $page = $builder->parse($response); - return $page; - } - - function testEmptyPage() { - $page = new SimplePage(new MockSimpleHttpResponse()); - $this->assertIdentical($page->getUrls(), array()); - $this->assertIdentical($page->getTitle(), false); - } - - function testUninterestingPage() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', '

    Stuff

    '); - $page = $this->parse($response); - $this->assertIdentical($page->getUrls(), array()); - } - - function testLinksPage() { - $raw = ''; - $raw .= '
    There'; - $raw .= 'That page'; - $raw .= ''; - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', $raw); - $response->setReturnValue('getUrl', new SimpleUrl('http://www.here.com/a/index.html')); - $page = $this->parse($response); - $this->assertIdentical( - $page->getUrls(), - array('http://www.here.com/a/there.html', 'http://there.com/that.html')); - $this->assertIdentical( - $page->getUrlsByLabel('There'), - array(new SimpleUrl('http://www.here.com/a/there.html'))); - $this->assertEqual( - $page->getUrlById('0'), - new SimpleUrl('http://there.com/that.html')); - } - - function testTitle() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', 'Me'); - $page = $this->parse($response); - $this->assertEqual($page->getTitle(), 'Me'); - } - - function testNastyTitle() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue( - 'getContent', - ' <b>Me&Me '); - $page = $this->parse($response); - $this->assertEqual($page->getTitle(), "Me&Me"); - } - - function testCompleteForm() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', - '
    ' . - '' . - '
    '); - $page = $this->parse($response); - $this->assertEqual($page->getField(new SimpleByName('here')), "Hello"); - } - - function testUnclosedForm() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', - '
    ' . - '' . - ''); - $page = $this->parse($response); - $this->assertEqual($page->getField(new SimpleByName('here')), "Hello"); - } - - function testEmptyFrameset() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue( - 'getContent', - ''); - $page = $this->parse($response); - $this->assertTrue($page->hasFrames()); - $this->assertIdentical($page->getFrameset(), array()); - } - - function testSingleFrame() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue( - 'getContent', - ''); - $response->setReturnValue('getUrl', new SimpleUrl('http://host/')); - $page = $this->parse($response); - $this->assertTrue($page->hasFrames()); - $this->assertIdentical( - $page->getFrameset(), - array(1 => new SimpleUrl('http://host/a.html'))); - } - - function testSingleFrameInNestedFrameset() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', - '' . - '' . - ''); - $response->setReturnValue('getUrl', new SimpleUrl('http://host/')); - $page = $this->parse($response); - $this->assertTrue($page->hasFrames()); - $this->assertIdentical( - $page->getFrameset(), - array(1 => new SimpleUrl('http://host/a.html'))); - } - - function testFrameWithNoSource() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue( - 'getContent', - ''); - $page = $this->parse($response); - $this->assertTrue($page->hasFrames()); - $this->assertIdentical($page->getFrameset(), array()); - } - - function testFramesCollectedWithNestedFramesetTags() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', - '' . - '' . - '' . - '' . - ''); - $response->setReturnValue('getUrl', new SimpleUrl('http://host/')); - $page = $this->parse($response); - $this->assertTrue($page->hasFrames()); - $this->assertIdentical($page->getFrameset(), array( - 1 => new SimpleUrl('http://host/a.html'), - 2 => new SimpleUrl('http://host/b.html'), - 3 => new SimpleUrl('http://host/c.html'))); - } - - function testNamedFrames() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', - '' . - '' . - '' . - '' . - '' . - ''); - $response->setReturnValue('getUrl', new SimpleUrl('http://host/')); - $page = $this->parse($response); - $this->assertTrue($page->hasFrames()); - $this->assertIdentical($page->getFrameset(), array( - 1 => new SimpleUrl('http://host/a.html'), - '_one' => new SimpleUrl('http://host/b.html'), - 3 => new SimpleUrl('http://host/c.html'), - '_two' => new SimpleUrl('http://host/d.html'))); - } - - function testFindFormByLabel() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue( - 'getContent', - '
    '); - $page = $this->parse($response); - $this->assertNull($page->getFormBySubmit(new SimpleByLabel('submit'))); - $this->assertNull($page->getFormBySubmit(new SimpleByName('submit'))); - $this->assertIsA( - $page->getFormBySubmit(new SimpleByLabel('Submit')), - 'SimpleForm'); - } - - function testConfirmSubmitAttributesAreCaseSensitive() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue( - 'getContent', - '
    '); - $page = $this->parse($response); - $this->assertIsA( - $page->getFormBySubmit(new SimpleByName('S')), - 'SimpleForm'); - $this->assertIsA( - $page->getFormBySubmit(new SimpleByLabel('S')), - 'SimpleForm'); - } - - function testFindFormByImage() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', - '
    ' . - '' . - '
    '); - $page = $this->parse($response); - $this->assertIsA( - $page->getFormByImage(new SimpleByLabel('Label')), - 'SimpleForm'); - $this->assertIsA( - $page->getFormByImage(new SimpleByName('me')), - 'SimpleForm'); - $this->assertIsA( - $page->getFormByImage(new SimpleById(100)), - 'SimpleForm'); - } - - function testFindFormByButtonTag() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', - '
    ' . - '' . - '
    '); - $page = $this->parse($response); - $this->assertNull($page->getFormBySubmit(new SimpleByLabel('b'))); - $this->assertNull($page->getFormBySubmit(new SimpleByLabel('B'))); - $this->assertIsA( - $page->getFormBySubmit(new SimpleByName('b')), - 'SimpleForm'); - $this->assertIsA( - $page->getFormBySubmit(new SimpleByLabel('BBB')), - 'SimpleForm'); - } - - function testFindFormById() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue( - 'getContent', - '
    '); - $page = $this->parse($response); - $this->assertNull($page->getFormById(54)); - $this->assertIsA($page->getFormById(55), 'SimpleForm'); - } - - function testReadingTextField() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', - '
    ' . - '' . - '' . - '
    '); - $page = $this->parse($response); - $this->assertNull($page->getField(new SimpleByName('missing'))); - $this->assertIdentical($page->getField(new SimpleByName('a')), ''); - $this->assertIdentical($page->getField(new SimpleByName('b')), 'bbb'); - } - - function testReadingTextFieldIsCaseInsensitive() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', - '
    ' . - '' . - '' . - '
    '); - $page = $this->parse($response); - $this->assertNull($page->getField(new SimpleByName('missing'))); - $this->assertIdentical($page->getField(new SimpleByName('a')), ''); - $this->assertIdentical($page->getField(new SimpleByName('b')), 'bbb'); - } - - function testSettingTextField() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', - '
    ' . - '' . - '' . - '' . - '
    '); - $page = $this->parse($response); - $this->assertTrue($page->setField(new SimpleByName('a'), 'aaa')); - $this->assertEqual($page->getField(new SimpleByName('a')), 'aaa'); - $this->assertTrue($page->setField(new SimpleById(3), 'bbb')); - $this->assertEqual($page->getField(new SimpleBYId(3)), 'bbb'); - $this->assertFalse($page->setField(new SimpleByName('z'), 'zzz')); - $this->assertNull($page->getField(new SimpleByName('z'))); - } - - function testSettingTextFieldByEnclosingLabel() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', - '
    ' . - '' . - '
    '); - $page = $this->parse($response); - $this->assertEqual($page->getField(new SimpleByName('a')), 'A'); - $this->assertEqual($page->getField(new SimpleByLabel('Stuff')), 'A'); - $this->assertTrue($page->setField(new SimpleByLabel('Stuff'), 'aaa')); - $this->assertEqual($page->getField(new SimpleByLabel('Stuff')), 'aaa'); - } - - function testGettingTextFieldByEnclosingLabelWithConflictingOtherFields() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', - '
    ' . - '' . - '' . - '
    '); - $page = $this->parse($response); - $this->assertEqual($page->getField(new SimpleByName('a')), 'A'); - $this->assertEqual($page->getField(new SimpleByName('b')), 'B'); - $this->assertEqual($page->getField(new SimpleByLabel('Stuff')), 'A'); - } - - function testSettingTextFieldByExternalLabel() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', - '
    ' . - '' . - '' . - '
    '); - $page = $this->parse($response); - $this->assertEqual($page->getField(new SimpleByLabel('Stuff')), 'A'); - $this->assertTrue($page->setField(new SimpleByLabel('Stuff'), 'aaa')); - $this->assertEqual($page->getField(new SimpleByLabel('Stuff')), 'aaa'); - } - - function testReadingTextArea() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', - '
    ' . - '' . - '' . - '
    '); - $page = $this->parse($response); - $this->assertEqual($page->getField(new SimpleByName('a')), 'aaa'); - } - - function testSettingTextArea() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', - '
    ' . - '' . - '' . - '
    '); - $page = $this->parse($response); - $this->assertTrue($page->setField(new SimpleByName('a'), 'AAA')); - $this->assertEqual($page->getField(new SimpleByName('a')), 'AAA'); - } - - function testSettingSelectionField() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', - '
    ' . - '' . - '' . - '
    '); - $page = $this->parse($response); - $this->assertEqual($page->getField(new SimpleByName('a')), 'bbb'); - $this->assertFalse($page->setField(new SimpleByName('a'), 'ccc')); - $this->assertTrue($page->setField(new SimpleByName('a'), 'aaa')); - $this->assertEqual($page->getField(new SimpleByName('a')), 'aaa'); - } - - function testSettingSelectionFieldByEnclosingLabel() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', - '
    ' . - '' . - '
    '); - $page = $this->parse($response); - $this->assertEqual($page->getField(new SimpleByLabel('Stuff')), 'A'); - $this->assertTrue($page->setField(new SimpleByLabel('Stuff'), 'B')); - $this->assertEqual($page->getField(new SimpleByLabel('Stuff')), 'B'); - } - - function testSettingRadioButtonByEnclosingLabel() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', - '
    ' . - '' . - '' . - '
    '); - $page = $this->parse($response); - $this->assertEqual($page->getField(new SimpleByLabel('A')), 'a'); - $this->assertTrue($page->setField(new SimpleBylabel('B'), 'b')); - $this->assertEqual($page->getField(new SimpleByLabel('B')), 'b'); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/parse_error_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/parse_error_test.php deleted file mode 100644 index c3ffb3d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/parse_error_test.php +++ /dev/null @@ -1,9 +0,0 @@ -addFile('test_with_parse_error.php'); -$test->run(new HtmlReporter()); -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/parser_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/parser_test.php deleted file mode 100644 index fd01d57..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/parser_test.php +++ /dev/null @@ -1,551 +0,0 @@ -assertFalse($regex->match("Hello", $match)); - $this->assertEqual($match, ""); - } - - function testNoSubject() { - $regex = new ParallelRegex(false); - $regex->addPattern(".*"); - $this->assertTrue($regex->match("", $match)); - $this->assertEqual($match, ""); - } - - function testMatchAll() { - $regex = new ParallelRegex(false); - $regex->addPattern(".*"); - $this->assertTrue($regex->match("Hello", $match)); - $this->assertEqual($match, "Hello"); - } - - function testCaseSensitive() { - $regex = new ParallelRegex(true); - $regex->addPattern("abc"); - $this->assertTrue($regex->match("abcdef", $match)); - $this->assertEqual($match, "abc"); - $this->assertTrue($regex->match("AAABCabcdef", $match)); - $this->assertEqual($match, "abc"); - } - - function testCaseInsensitive() { - $regex = new ParallelRegex(false); - $regex->addPattern("abc"); - $this->assertTrue($regex->match("abcdef", $match)); - $this->assertEqual($match, "abc"); - $this->assertTrue($regex->match("AAABCabcdef", $match)); - $this->assertEqual($match, "ABC"); - } - - function testMatchMultiple() { - $regex = new ParallelRegex(true); - $regex->addPattern("abc"); - $regex->addPattern("ABC"); - $this->assertTrue($regex->match("abcdef", $match)); - $this->assertEqual($match, "abc"); - $this->assertTrue($regex->match("AAABCabcdef", $match)); - $this->assertEqual($match, "ABC"); - $this->assertFalse($regex->match("Hello", $match)); - } - - function testPatternLabels() { - $regex = new ParallelRegex(false); - $regex->addPattern("abc", "letter"); - $regex->addPattern("123", "number"); - $this->assertIdentical($regex->match("abcdef", $match), "letter"); - $this->assertEqual($match, "abc"); - $this->assertIdentical($regex->match("0123456789", $match), "number"); - $this->assertEqual($match, "123"); - } -} - -class TestOfStateStack extends UnitTestCase { - - function testStartState() { - $stack = new SimpleStateStack("one"); - $this->assertEqual($stack->getCurrent(), "one"); - } - - function testExhaustion() { - $stack = new SimpleStateStack("one"); - $this->assertFalse($stack->leave()); - } - - function testStateMoves() { - $stack = new SimpleStateStack("one"); - $stack->enter("two"); - $this->assertEqual($stack->getCurrent(), "two"); - $stack->enter("three"); - $this->assertEqual($stack->getCurrent(), "three"); - $this->assertTrue($stack->leave()); - $this->assertEqual($stack->getCurrent(), "two"); - $stack->enter("third"); - $this->assertEqual($stack->getCurrent(), "third"); - $this->assertTrue($stack->leave()); - $this->assertTrue($stack->leave()); - $this->assertEqual($stack->getCurrent(), "one"); - } -} - -class TestParser { - - function accept() { - } - - function a() { - } - - function b() { - } -} -Mock::generate('TestParser'); - -class TestOfLexer extends UnitTestCase { - - function testEmptyPage() { - $handler = new MockTestParser(); - $handler->expectNever("accept"); - $handler->setReturnValue("accept", true); - $handler->expectNever("accept"); - $handler->setReturnValue("accept", true); - $lexer = new SimpleLexer($handler); - $lexer->addPattern("a+"); - $this->assertTrue($lexer->parse("")); - } - - function testSinglePattern() { - $handler = new MockTestParser(); - $handler->expectAt(0, "accept", array("aaa", LEXER_MATCHED)); - $handler->expectAt(1, "accept", array("x", LEXER_UNMATCHED)); - $handler->expectAt(2, "accept", array("a", LEXER_MATCHED)); - $handler->expectAt(3, "accept", array("yyy", LEXER_UNMATCHED)); - $handler->expectAt(4, "accept", array("a", LEXER_MATCHED)); - $handler->expectAt(5, "accept", array("x", LEXER_UNMATCHED)); - $handler->expectAt(6, "accept", array("aaa", LEXER_MATCHED)); - $handler->expectAt(7, "accept", array("z", LEXER_UNMATCHED)); - $handler->expectCallCount("accept", 8); - $handler->setReturnValue("accept", true); - $lexer = new SimpleLexer($handler); - $lexer->addPattern("a+"); - $this->assertTrue($lexer->parse("aaaxayyyaxaaaz")); - } - - function testMultiplePattern() { - $handler = new MockTestParser(); - $target = array("a", "b", "a", "bb", "x", "b", "a", "xxxxxx", "a", "x"); - for ($i = 0; $i < count($target); $i++) { - $handler->expectAt($i, "accept", array($target[$i], '*')); - } - $handler->expectCallCount("accept", count($target)); - $handler->setReturnValue("accept", true); - $lexer = new SimpleLexer($handler); - $lexer->addPattern("a+"); - $lexer->addPattern("b+"); - $this->assertTrue($lexer->parse("ababbxbaxxxxxxax")); - } -} - -class TestOfLexerModes extends UnitTestCase { - - function testIsolatedPattern() { - $handler = new MockTestParser(); - $handler->expectAt(0, "a", array("a", LEXER_MATCHED)); - $handler->expectAt(1, "a", array("b", LEXER_UNMATCHED)); - $handler->expectAt(2, "a", array("aa", LEXER_MATCHED)); - $handler->expectAt(3, "a", array("bxb", LEXER_UNMATCHED)); - $handler->expectAt(4, "a", array("aaa", LEXER_MATCHED)); - $handler->expectAt(5, "a", array("x", LEXER_UNMATCHED)); - $handler->expectAt(6, "a", array("aaaa", LEXER_MATCHED)); - $handler->expectAt(7, "a", array("x", LEXER_UNMATCHED)); - $handler->expectCallCount("a", 8); - $handler->setReturnValue("a", true); - $lexer = new SimpleLexer($handler, "a"); - $lexer->addPattern("a+", "a"); - $lexer->addPattern("b+", "b"); - $this->assertTrue($lexer->parse("abaabxbaaaxaaaax")); - } - - function testModeChange() { - $handler = new MockTestParser(); - $handler->expectAt(0, "a", array("a", LEXER_MATCHED)); - $handler->expectAt(1, "a", array("b", LEXER_UNMATCHED)); - $handler->expectAt(2, "a", array("aa", LEXER_MATCHED)); - $handler->expectAt(3, "a", array("b", LEXER_UNMATCHED)); - $handler->expectAt(4, "a", array("aaa", LEXER_MATCHED)); - $handler->expectAt(0, "b", array(":", LEXER_ENTER)); - $handler->expectAt(1, "b", array("a", LEXER_UNMATCHED)); - $handler->expectAt(2, "b", array("b", LEXER_MATCHED)); - $handler->expectAt(3, "b", array("a", LEXER_UNMATCHED)); - $handler->expectAt(4, "b", array("bb", LEXER_MATCHED)); - $handler->expectAt(5, "b", array("a", LEXER_UNMATCHED)); - $handler->expectAt(6, "b", array("bbb", LEXER_MATCHED)); - $handler->expectAt(7, "b", array("a", LEXER_UNMATCHED)); - $handler->expectCallCount("a", 5); - $handler->expectCallCount("b", 8); - $handler->setReturnValue("a", true); - $handler->setReturnValue("b", true); - $lexer = new SimpleLexer($handler, "a"); - $lexer->addPattern("a+", "a"); - $lexer->addEntryPattern(":", "a", "b"); - $lexer->addPattern("b+", "b"); - $this->assertTrue($lexer->parse("abaabaaa:ababbabbba")); - } - - function testNesting() { - $handler = new MockTestParser(); - $handler->setReturnValue("a", true); - $handler->setReturnValue("b", true); - $handler->expectAt(0, "a", array("aa", LEXER_MATCHED)); - $handler->expectAt(1, "a", array("b", LEXER_UNMATCHED)); - $handler->expectAt(2, "a", array("aa", LEXER_MATCHED)); - $handler->expectAt(3, "a", array("b", LEXER_UNMATCHED)); - $handler->expectAt(0, "b", array("(", LEXER_ENTER)); - $handler->expectAt(1, "b", array("bb", LEXER_MATCHED)); - $handler->expectAt(2, "b", array("a", LEXER_UNMATCHED)); - $handler->expectAt(3, "b", array("bb", LEXER_MATCHED)); - $handler->expectAt(4, "b", array(")", LEXER_EXIT)); - $handler->expectAt(4, "a", array("aa", LEXER_MATCHED)); - $handler->expectAt(5, "a", array("b", LEXER_UNMATCHED)); - $handler->expectCallCount("a", 6); - $handler->expectCallCount("b", 5); - $lexer = new SimpleLexer($handler, "a"); - $lexer->addPattern("a+", "a"); - $lexer->addEntryPattern("(", "a", "b"); - $lexer->addPattern("b+", "b"); - $lexer->addExitPattern(")", "b"); - $this->assertTrue($lexer->parse("aabaab(bbabb)aab")); - } - - function testSingular() { - $handler = new MockTestParser(); - $handler->setReturnValue("a", true); - $handler->setReturnValue("b", true); - $handler->expectAt(0, "a", array("aa", LEXER_MATCHED)); - $handler->expectAt(1, "a", array("aa", LEXER_MATCHED)); - $handler->expectAt(2, "a", array("xx", LEXER_UNMATCHED)); - $handler->expectAt(3, "a", array("xx", LEXER_UNMATCHED)); - $handler->expectAt(0, "b", array("b", LEXER_SPECIAL)); - $handler->expectAt(1, "b", array("bbb", LEXER_SPECIAL)); - $handler->expectCallCount("a", 4); - $handler->expectCallCount("b", 2); - $lexer = new SimpleLexer($handler, "a"); - $lexer->addPattern("a+", "a"); - $lexer->addSpecialPattern("b+", "a", "b"); - $this->assertTrue($lexer->parse("aabaaxxbbbxx")); - } - - function testUnwindTooFar() { - $handler = new MockTestParser(); - $handler->setReturnValue("a", true); - $handler->expectAt(0, "a", array("aa", LEXER_MATCHED)); - $handler->expectAt(1, "a", array(")", LEXER_EXIT)); - $handler->expectCallCount("a", 2); - $lexer = new SimpleLexer($handler, "a"); - $lexer->addPattern("a+", "a"); - $lexer->addExitPattern(")", "a"); - $this->assertFalse($lexer->parse("aa)aa")); - } -} - -class TestOfLexerHandlers extends UnitTestCase { - - function testModeMapping() { - $handler = new MockTestParser(); - $handler->setReturnValue("a", true); - $handler->expectAt(0, "a", array("aa", LEXER_MATCHED)); - $handler->expectAt(1, "a", array("(", LEXER_ENTER)); - $handler->expectAt(2, "a", array("bb", LEXER_MATCHED)); - $handler->expectAt(3, "a", array("a", LEXER_UNMATCHED)); - $handler->expectAt(4, "a", array("bb", LEXER_MATCHED)); - $handler->expectAt(5, "a", array(")", LEXER_EXIT)); - $handler->expectAt(6, "a", array("b", LEXER_UNMATCHED)); - $handler->expectCallCount("a", 7); - $lexer = new SimpleLexer($handler, "mode_a"); - $lexer->addPattern("a+", "mode_a"); - $lexer->addEntryPattern("(", "mode_a", "mode_b"); - $lexer->addPattern("b+", "mode_b"); - $lexer->addExitPattern(")", "mode_b"); - $lexer->mapHandler("mode_a", "a"); - $lexer->mapHandler("mode_b", "a"); - $this->assertTrue($lexer->parse("aa(bbabb)b")); - } -} - -class TestOfSimpleHtmlLexer extends UnitTestCase { - - function &createParser() { - $parser = new MockSimpleHtmlSaxParser(); - $parser->setReturnValue('acceptStartToken', true); - $parser->setReturnValue('acceptEndToken', true); - $parser->setReturnValue('acceptAttributeToken', true); - $parser->setReturnValue('acceptEntityToken', true); - $parser->setReturnValue('acceptTextToken', true); - $parser->setReturnValue('ignore', true); - return $parser; - } - - function testNoContent() { - $parser = &$this->createParser(); - $parser->expectNever('acceptStartToken'); - $parser->expectNever('acceptEndToken'); - $parser->expectNever('acceptAttributeToken'); - $parser->expectNever('acceptEntityToken'); - $parser->expectNever('acceptTextToken'); - $lexer = new SimpleHtmlLexer($parser); - $this->assertTrue($lexer->parse('')); - } - - function testUninteresting() { - $parser = &$this->createParser(); - $parser->expectOnce('acceptTextToken', array('', '*')); - $lexer = new SimpleHtmlLexer($parser); - $this->assertTrue($lexer->parse('')); - } - - function testSkipCss() { - $parser = &$this->createParser(); - $parser->expectNever('acceptTextToken'); - $parser->expectAtLeastOnce('ignore'); - $lexer = new SimpleHtmlLexer($parser); - $this->assertTrue($lexer->parse("")); - } - - function testSkipJavaScript() { - $parser = &$this->createParser(); - $parser->expectNever('acceptTextToken'); - $parser->expectAtLeastOnce('ignore'); - $lexer = new SimpleHtmlLexer($parser); - $this->assertTrue($lexer->parse("")); - } - - function testSkipHtmlComments() { - $parser = &$this->createParser(); - $parser->expectNever('acceptTextToken'); - $parser->expectAtLeastOnce('ignore'); - $lexer = new SimpleHtmlLexer($parser); - $this->assertTrue($lexer->parse("")); - } - - function testTagWithNoAttributes() { - $parser = &$this->createParser(); - $parser->expectAt(0, 'acceptStartToken', array('expectAt(1, 'acceptStartToken', array('>', '*')); - $parser->expectCallCount('acceptStartToken', 2); - $parser->expectOnce('acceptTextToken', array('Hello', '*')); - $parser->expectOnce('acceptEndToken', array('', '*')); - $lexer = new SimpleHtmlLexer($parser); - $this->assertTrue($lexer->parse('Hello')); - } - - function testTagWithAttributes() { - $parser = &$this->createParser(); - $parser->expectOnce('acceptTextToken', array('label', '*')); - $parser->expectAt(0, 'acceptStartToken', array('expectAt(1, 'acceptStartToken', array('href', '*')); - $parser->expectAt(2, 'acceptStartToken', array('>', '*')); - $parser->expectCallCount('acceptStartToken', 3); - $parser->expectAt(0, 'acceptAttributeToken', array('= "', '*')); - $parser->expectAt(1, 'acceptAttributeToken', array('here.html', '*')); - $parser->expectAt(2, 'acceptAttributeToken', array('"', '*')); - $parser->expectCallCount('acceptAttributeToken', 3); - $parser->expectOnce('acceptEndToken', array('', '*')); - $lexer = new SimpleHtmlLexer($parser); - $this->assertTrue($lexer->parse('label')); - } -} - -class TestOfHtmlSaxParser extends UnitTestCase { - - function &createListener() { - $listener = new MockSimpleSaxListener(); - $listener->setReturnValue('startElement', true); - $listener->setReturnValue('addContent', true); - $listener->setReturnValue('endElement', true); - return $listener; - } - - function testFramesetTag() { - $listener = &$this->createListener(); - $listener->expectOnce('startElement', array('frameset', array())); - $listener->expectOnce('addContent', array('Frames')); - $listener->expectOnce('endElement', array('frameset')); - $parser = new SimpleHtmlSaxParser($listener); - $this->assertTrue($parser->parse('Frames')); - } - - function testTagWithUnquotedAttributes() { - $listener = &$this->createListener(); - $listener->expectOnce( - 'startElement', - array('input', array('name' => 'a.b.c', 'value' => 'd'))); - $parser = new SimpleHtmlSaxParser($listener); - $this->assertTrue($parser->parse('')); - } - - function testTagInsideContent() { - $listener = &$this->createListener(); - $listener->expectOnce('startElement', array('a', array())); - $listener->expectAt(0, 'addContent', array('')); - $listener->expectAt(1, 'addContent', array('')); - $parser = new SimpleHtmlSaxParser($listener); - $this->assertTrue($parser->parse('')); - } - - function testTagWithInternalContent() { - $listener = &$this->createListener(); - $listener->expectOnce('startElement', array('a', array())); - $listener->expectOnce('addContent', array('label')); - $listener->expectOnce('endElement', array('a')); - $parser = new SimpleHtmlSaxParser($listener); - $this->assertTrue($parser->parse('label')); - } - - function testLinkAddress() { - $listener = &$this->createListener(); - $listener->expectOnce('startElement', array('a', array('href' => 'here.html'))); - $listener->expectOnce('addContent', array('label')); - $listener->expectOnce('endElement', array('a')); - $parser = new SimpleHtmlSaxParser($listener); - $this->assertTrue($parser->parse("label")); - } - - function testEncodedAttribute() { - $listener = &$this->createListener(); - $listener->expectOnce('startElement', array('a', array('href' => 'here&there.html'))); - $listener->expectOnce('addContent', array('label')); - $listener->expectOnce('endElement', array('a')); - $parser = new SimpleHtmlSaxParser($listener); - $this->assertTrue($parser->parse("label")); - } - - function testTagWithId() { - $listener = &$this->createListener(); - $listener->expectOnce('startElement', array('a', array('id' => '0'))); - $listener->expectOnce('addContent', array('label')); - $listener->expectOnce('endElement', array('a')); - $parser = new SimpleHtmlSaxParser($listener); - $this->assertTrue($parser->parse('label')); - } - - function testTagWithEmptyAttributes() { - $listener = &$this->createListener(); - $listener->expectOnce( - 'startElement', - array('option', array('value' => '', 'selected' => ''))); - $listener->expectOnce('addContent', array('label')); - $listener->expectOnce('endElement', array('option')); - $parser = new SimpleHtmlSaxParser($listener); - $this->assertTrue($parser->parse('')); - } - - function testComplexTagWithLotsOfCaseVariations() { - $listener = &$this->createListener(); - $listener->expectOnce( - 'startElement', - array('a', array('href' => 'here.html', 'style' => "'cool'"))); - $listener->expectOnce('addContent', array('label')); - $listener->expectOnce('endElement', array('a')); - $parser = new SimpleHtmlSaxParser($listener); - $this->assertTrue($parser->parse('label')); - } - - function testXhtmlSelfClosingTag() { - $listener = &$this->createListener(); - $listener->expectOnce( - 'startElement', - array('input', array('type' => 'submit', 'name' => 'N', 'value' => 'V'))); - $parser = new SimpleHtmlSaxParser($listener); - $this->assertTrue($parser->parse('')); - } - - function testNestedFrameInFrameset() { - $listener = &$this->createListener(); - $listener->expectAt(0, 'startElement', array('frameset', array())); - $listener->expectAt(1, 'startElement', array('frame', array('src' => 'frame.html'))); - $listener->expectCallCount('startElement', 2); - $listener->expectOnce('addContent', array('Hello')); - $listener->expectOnce('endElement', array('frameset')); - $parser = new SimpleHtmlSaxParser($listener); - $this->assertTrue($parser->parse( - 'Hello')); - } -} - -class TestOfTextExtraction extends UnitTestCase { - - function testImageSuppressionWhileKeepingParagraphsAndAltText() { - $this->assertEqual( - SimpleHtmlSaxParser::normalise('

    some text

    bar'), - 'some text bar'); - - } - - function testSpaceNormalisation() { - $this->assertEqual( - SimpleHtmlSaxParser::normalise("\nOne\tTwo \nThree\t"), - 'One Two Three'); - } - - function testMultilinesCommentSuppression() { - $this->assertEqual( - SimpleHtmlSaxParser::normalise(''), - ''); - } - - function testCommentSuppression() { - $this->assertEqual( - SimpleHtmlSaxParser::normalise(''), - ''); - } - - function testJavascriptSuppression() { - $this->assertEqual( - SimpleHtmlSaxParser::normalise(''), - ''); - $this->assertEqual( - SimpleHtmlSaxParser::normalise(''), - ''); - $this->assertEqual( - SimpleHtmlSaxParser::normalise(''), - ''); - } - - function testTagSuppression() { - $this->assertEqual( - SimpleHtmlSaxParser::normalise('Hello'), - 'Hello'); - } - - function testAdjoiningTagSuppression() { - $this->assertEqual( - SimpleHtmlSaxParser::normalise('HelloGoodbye'), - 'HelloGoodbye'); - } - - function testExtractImageAltTextWithDifferentQuotes() { - $this->assertEqual( - SimpleHtmlSaxParser::normalise('One\'Two\'Three'), - 'One Two Three'); - } - - function testExtractImageAltTextMultipleTimes() { - $this->assertEqual( - SimpleHtmlSaxParser::normalise('OneTwoThree'), - 'One Two Three'); - } - - function testHtmlEntityTranslation() { - $this->assertEqual( - SimpleHtmlSaxParser::normalise('<>"&''), - '<>"&\''); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/reflection_php4_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/reflection_php4_test.php deleted file mode 100644 index 8ee211b..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/reflection_php4_test.php +++ /dev/null @@ -1,61 +0,0 @@ -assertTrue($reflection->classOrInterfaceExists()); - $this->assertTrue($reflection->classOrInterfaceExistsSansAutoload()); - } - - function testClassNonExistence() { - $reflection = new SimpleReflection('UnknownThing'); - $this->assertFalse($reflection->classOrInterfaceExists()); - $this->assertFalse($reflection->classOrInterfaceExistsSansAutoload()); - } - - function testDetectionOfInterfacesAlwaysFalse() { - $reflection = new SimpleReflection('AnyOldThing'); - $this->assertFalse($reflection->isAbstract()); - $this->assertFalse($reflection->isInterface()); - } - - function testFindingParentClass() { - $reflection = new SimpleReflection('AnyOldChildThing'); - $this->assertEqual(strtolower($reflection->getParent()), 'anyoldthing'); - } - - function testMethodsListFromClass() { - $reflection = new SimpleReflection('AnyOldThing'); - $methods = $reflection->getMethods(); - $this->assertEqualIgnoringCase($methods[0], 'aMethod'); - } - - function testNoInterfacesForPHP4() { - $reflection = new SimpleReflection('AnyOldThing'); - $this->assertEqual( - $reflection->getInterfaces(), - array()); - } - - function testMostGeneralPossibleSignature() { - $reflection = new SimpleReflection('AnyOldThing'); - $this->assertEqualIgnoringCase( - $reflection->getSignature('aMethod'), - 'function &aMethod()'); - } - - function assertEqualIgnoringCase($a, $b) { - return $this->assertEqual(strtolower($a), strtolower($b)); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/reflection_php5_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/reflection_php5_test.php deleted file mode 100644 index d9f46e6..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/reflection_php5_test.php +++ /dev/null @@ -1,263 +0,0 @@ -assertTrue($reflection->classOrInterfaceExists()); - $this->assertTrue($reflection->classOrInterfaceExistsSansAutoload()); - $this->assertFalse($reflection->isAbstract()); - $this->assertFalse($reflection->isInterface()); - } - - function testClassNonExistence() { - $reflection = new SimpleReflection('UnknownThing'); - $this->assertFalse($reflection->classOrInterfaceExists()); - $this->assertFalse($reflection->classOrInterfaceExistsSansAutoload()); - } - - function testDetectionOfAbstractClass() { - $reflection = new SimpleReflection('AnyOldClass'); - $this->assertTrue($reflection->isAbstract()); - } - - function testDetectionOfFinalMethods() { - $reflection = new SimpleReflection('AnyOldClass'); - $this->assertFalse($reflection->hasFinal()); - $reflection = new SimpleReflection('AnyOldLeafClassWithAFinal'); - $this->assertTrue($reflection->hasFinal()); - } - - function testFindingParentClass() { - $reflection = new SimpleReflection('AnyOldSubclass'); - $this->assertEqual($reflection->getParent(), 'AnyOldImplementation'); - } - - function testInterfaceExistence() { - $reflection = new SimpleReflection('AnyOldInterface'); - $this->assertTrue($reflection->classOrInterfaceExists()); - $this->assertTrue($reflection->classOrInterfaceExistsSansAutoload()); - $this->assertTrue($reflection->isInterface()); - } - - function testMethodsListFromClass() { - $reflection = new SimpleReflection('AnyOldClass'); - $this->assertIdentical($reflection->getMethods(), array('aMethod')); - } - - function testMethodsListFromInterface() { - $reflection = new SimpleReflection('AnyOldInterface'); - $this->assertIdentical($reflection->getMethods(), array('aMethod')); - $this->assertIdentical($reflection->getInterfaceMethods(), array('aMethod')); - } - - function testMethodsComeFromDescendentInterfacesASWell() { - $reflection = new SimpleReflection('AnyDescendentInterface'); - $this->assertIdentical($reflection->getMethods(), array('aMethod')); - } - - function testCanSeparateInterfaceMethodsFromOthers() { - $reflection = new SimpleReflection('AnyOldImplementation'); - $this->assertIdentical($reflection->getMethods(), array('aMethod', 'extraMethod')); - $this->assertIdentical($reflection->getInterfaceMethods(), array('aMethod')); - } - - function testMethodsComeFromDescendentInterfacesInAbstractClass() { - $reflection = new SimpleReflection('AnyAbstractImplementation'); - $this->assertIdentical($reflection->getMethods(), array('aMethod')); - } - - function testInterfaceHasOnlyItselfToImplement() { - $reflection = new SimpleReflection('AnyOldInterface'); - $this->assertEqual( - $reflection->getInterfaces(), - array('AnyOldInterface')); - } - - function testInterfacesListedForClass() { - $reflection = new SimpleReflection('AnyOldImplementation'); - $this->assertEqual( - $reflection->getInterfaces(), - array('AnyOldInterface')); - } - - function testInterfacesListedForSubclass() { - $reflection = new SimpleReflection('AnyOldSubclass'); - $this->assertEqual( - $reflection->getInterfaces(), - array('AnyOldInterface')); - } - - function testNoParameterCreationWhenNoInterface() { - $reflection = new SimpleReflection('AnyOldArgumentClass'); - $function = $reflection->getSignature('aMethod'); - if (version_compare(phpversion(), '5.0.2', '<=')) { - $this->assertEqual('function amethod($argument)', strtolower($function)); - } else { - $this->assertEqual('function aMethod($argument)', $function); - } - } - - function testParameterCreationWithoutTypeHinting() { - $reflection = new SimpleReflection('AnyOldArgumentImplementation'); - $function = $reflection->getSignature('aMethod'); - if (version_compare(phpversion(), '5.0.2', '<=')) { - $this->assertEqual('function amethod(AnyOldInterface $argument)', $function); - } else { - $this->assertEqual('function aMethod(AnyOldInterface $argument)', $function); - } - } - - function testParameterCreationForTypeHinting() { - $reflection = new SimpleReflection('AnyOldTypeHintedClass'); - $function = $reflection->getSignature('aMethod'); - if (version_compare(phpversion(), '5.0.2', '<=')) { - $this->assertEqual('function amethod(AnyOldInterface $argument)', $function); - } else { - $this->assertEqual('function aMethod(AnyOldInterface $argument)', $function); - } - } - - function testIssetFunctionSignature() { - $reflection = new SimpleReflection('AnyOldOverloadedClass'); - $function = $reflection->getSignature('__isset'); - $this->assertEqual('function __isset($key)', $function); - } - - function testUnsetFunctionSignature() { - $reflection = new SimpleReflection('AnyOldOverloadedClass'); - $function = $reflection->getSignature('__unset'); - $this->assertEqual('function __unset($key)', $function); - } - - function testProperlyReflectsTheFinalInterfaceWhenObjectImplementsAnExtendedInterface() { - $reflection = new SimpleReflection('AnyDescendentImplementation'); - $interfaces = $reflection->getInterfaces(); - $this->assertEqual(1, count($interfaces)); - $this->assertEqual('AnyDescendentInterface', array_shift($interfaces)); - } - - function testCreatingSignatureForAbstractMethod() { - $reflection = new SimpleReflection('AnotherOldAbstractClass'); - $this->assertEqual($reflection->getSignature('aMethod'), 'function aMethod(AnyOldInterface $argument)'); - } - - function testCanProperlyGenerateStaticMethodSignatures() { - $reflection = new SimpleReflection('AnyOldClassWithStaticMethods'); - $this->assertEqual('static function aStatic()', $reflection->getSignature('aStatic')); - $this->assertEqual( - 'static function aStaticWithParameters($arg1, $arg2)', - $reflection->getSignature('aStaticWithParameters') - ); - } -} - -class TestOfReflectionWithTypeHints extends UnitTestCase { - function skip() { - $this->skipIf(version_compare(phpversion(), '5.1.0', '<'), 'Reflection with type hints only tested for PHP 5.1.0 and above'); - } - - function testParameterCreationForTypeHintingWithArray() { - eval('interface AnyOldArrayTypeHintedInterface { - function amethod(array $argument); - } - class AnyOldArrayTypeHintedClass implements AnyOldArrayTypeHintedInterface { - function amethod(array $argument) {} - }'); - $reflection = new SimpleReflection('AnyOldArrayTypeHintedClass'); - $function = $reflection->getSignature('amethod'); - $this->assertEqual('function amethod(array $argument)', $function); - } -} - -class TestOfAbstractsWithAbstractMethods extends UnitTestCase { - function testCanProperlyGenerateAbstractMethods() { - $reflection = new SimpleReflection('AnyOldAbstractClassWithAbstractMethods'); - $this->assertEqual( - 'function anAbstract()', - $reflection->getSignature('anAbstract') - ); - $this->assertEqual( - 'function anAbstractWithParameter($foo)', - $reflection->getSignature('anAbstractWithParameter') - ); - $this->assertEqual( - 'function anAbstractWithMultipleParameters($foo, $bar)', - $reflection->getSignature('anAbstractWithMultipleParameters') - ); - } -} - -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/remote_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/remote_test.php deleted file mode 100644 index 5f3f96a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/remote_test.php +++ /dev/null @@ -1,19 +0,0 @@ -add(new RemoteTestCase($test_url . '?xml=yes', $test_url . '?xml=yes&dry=yes')); -if (SimpleReporter::inCli()) { - exit ($test->run(new TextReporter()) ? 0 : 1); -} -$test->run(new HtmlReporter()); diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/shell_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/shell_test.php deleted file mode 100644 index d1d769a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/shell_test.php +++ /dev/null @@ -1,38 +0,0 @@ -assertIdentical($shell->execute('echo Hello'), 0); - $this->assertPattern('/Hello/', $shell->getOutput()); - } - - function testBadCommand() { - $shell = new SimpleShell(); - $this->assertNotEqual($ret = $shell->execute('blurgh! 2>&1'), 0); - } -} - -class TestOfShellTesterAndShell extends ShellTestCase { - - function testEcho() { - $this->assertTrue($this->execute('echo Hello')); - $this->assertExitCode(0); - $this->assertoutput('Hello'); - } - - function testFileExistence() { - $this->assertFileExists(dirname(__FILE__) . '/all_tests.php'); - $this->assertFileNotExists('wibble'); - } - - function testFilePatterns() { - $this->assertFilePattern('/all[_ ]tests/i', dirname(__FILE__) . '/all_tests.php'); - $this->assertNoFilePattern('/sputnik/i', dirname(__FILE__) . '/all_tests.php'); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/shell_tester_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/shell_tester_test.php deleted file mode 100644 index b12c602..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/shell_tester_test.php +++ /dev/null @@ -1,42 +0,0 @@ -mock_shell; - } - - function testGenericEquality() { - $this->assertEqual('a', 'a'); - $this->assertNotEqual('a', 'A'); - } - - function testExitCode() { - $this->mock_shell = new MockSimpleShell(); - $this->mock_shell->setReturnValue('execute', 0); - $this->mock_shell->expectOnce('execute', array('ls')); - $this->assertTrue($this->execute('ls')); - $this->assertExitCode(0); - } - - function testOutput() { - $this->mock_shell = new MockSimpleShell(); - $this->mock_shell->setReturnValue('execute', 0); - $this->mock_shell->setReturnValue('getOutput', "Line 1\nLine 2\n"); - $this->assertOutput("Line 1\nLine 2\n"); - } - - function testOutputPatterns() { - $this->mock_shell = new MockSimpleShell(); - $this->mock_shell->setReturnValue('execute', 0); - $this->mock_shell->setReturnValue('getOutput', "Line 1\nLine 2\n"); - $this->assertOutputPattern('/line/i'); - $this->assertNoOutputPattern('/line 2/'); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/simpletest_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/simpletest_test.php deleted file mode 100644 index daa65c6..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/simpletest_test.php +++ /dev/null @@ -1,58 +0,0 @@ -fail('Should be ignored'); - } -} - -class ShouldNeverBeRunEither extends ShouldNeverBeRun { } - -class TestOfStackTrace extends UnitTestCase { - - function testCanFindAssertInTrace() { - $trace = new SimpleStackTrace(array('assert')); - $this->assertEqual( - $trace->traceMethod(array(array( - 'file' => '/my_test.php', - 'line' => 24, - 'function' => 'assertSomething'))), - ' at [/my_test.php line 24]'); - } -} - -class DummyResource { } - -class TestOfContext extends UnitTestCase { - - function testCurrentContextIsUnique() { - $this->assertSame( - SimpleTest::getContext(), - SimpleTest::getContext()); - } - - function testContextHoldsCurrentTestCase() { - $context = SimpleTest::getContext(); - $this->assertSame($this, $context->getTest()); - } - - function testResourceIsSingleInstanceWithContext() { - $context = new SimpleTestContext(); - $this->assertSame( - $context->get('DummyResource'), - $context->get('DummyResource')); - } - - function testClearingContextResetsResources() { - $context = new SimpleTestContext(); - $resource = $context->get('DummyResource'); - $context->clear(); - $this->assertClone($resource, $context->get('DummyResource')); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/.htaccess b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/.htaccess deleted file mode 100644 index fb3bc55..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/.htaccess +++ /dev/null @@ -1,2 +0,0 @@ -DirectoryIndex index.php -Options Indexes diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/1.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/1.html deleted file mode 100644 index cdc3e0b..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/1.html +++ /dev/null @@ -1,6 +0,0 @@ - - 1 - - 2 - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/2.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/2.html deleted file mode 100644 index fea1449..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/2.html +++ /dev/null @@ -1,6 +0,0 @@ - - 2 - - 3 - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/3.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/3.html deleted file mode 100644 index fdd1380..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/3.html +++ /dev/null @@ -1,6 +0,0 @@ - - 3 - - 1 - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_change_redirect.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_change_redirect.php deleted file mode 100644 index 096c45d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_change_redirect.php +++ /dev/null @@ -1,6 +0,0 @@ - - Redirection test - This is a test page for the SimpleTest PHP unit tester - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/base_link.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/base_link.html deleted file mode 100644 index fc4266b..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/base_link.html +++ /dev/null @@ -1,9 +0,0 @@ - - - Links and base tag - - - - Back to test pages - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/form.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/form.html deleted file mode 100644 index dacb1bb..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/form.html +++ /dev/null @@ -1,50 +0,0 @@ - - - Test of form submission - - - -
    - -
    - -
    - -
    - -
    - -
    - -
    - Radio G - - - - -
    - -
    - -
    - -
    - -
    - -
    - -
    - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/frameset.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/frameset.html deleted file mode 100644 index 8ff7b75..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/frameset.html +++ /dev/null @@ -1,9 +0,0 @@ - - Frameset for testing of SimpleTest - - - - This content is for no frames only. - - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/frameset_with_base_tag.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/frameset_with_base_tag.html deleted file mode 100644 index fb284e1..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/frameset_with_base_tag.html +++ /dev/null @@ -1,12 +0,0 @@ - - - Frameset for testing of SimpleTest - - - - - - This content is for no frames only. - - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/page_1.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/page_1.html deleted file mode 100644 index bb53264..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/page_1.html +++ /dev/null @@ -1,7 +0,0 @@ - - Page 1 - - This is page 1. - To page 2 - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/page_2.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/page_2.html deleted file mode 100644 index 715aaf4..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/page_2.html +++ /dev/null @@ -1,7 +0,0 @@ - - Page 2 - - This is page 2. - To page 1 - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/relative_link.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/relative_link.html deleted file mode 100644 index ac1edbe..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/base_tag/relative_link.html +++ /dev/null @@ -1,8 +0,0 @@ - - - Links without base tag - - - Back to test pages - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/cookie_based_counter.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/cookie_based_counter.php deleted file mode 100644 index 239b9c8..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/cookie_based_counter.php +++ /dev/null @@ -1,10 +0,0 @@ - - Cookie Counter - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/counting_frameset.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/counting_frameset.html deleted file mode 100644 index eec24c4..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/counting_frameset.html +++ /dev/null @@ -1,10 +0,0 @@ - - Frameset for testing of SimpleTest - - - - - <body>This content is for no frames only.</body> - - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/double_base_change_redirect.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/double_base_change_redirect.php deleted file mode 100644 index a76172f..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/double_base_change_redirect.php +++ /dev/null @@ -1,6 +0,0 @@ - - Redirection test - This is a test page for the SimpleTest PHP unit tester - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/file.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/file.html deleted file mode 100644 index cc41aee..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/file.html +++ /dev/null @@ -1,6 +0,0 @@ - - Link to SimpleTest - - Link to SimpleTest - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form.html deleted file mode 100644 index cc1138e..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form.html +++ /dev/null @@ -1,47 +0,0 @@ - - Test of form submission - -
    - -
    - -
    - -
    - -
    - -
    - -
    - Radio G - - - - -
    - -
    - -
    - -
    - -
    - -
    - -
    - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_data_encoded_form.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_data_encoded_form.html deleted file mode 100644 index a0f6b01..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_data_encoded_form.html +++ /dev/null @@ -1,47 +0,0 @@ - - Test of form submission - -
    - -
    - -
    - -
    - -
    - -
    - -
    - Radio G - - - - -
    - -
    - -
    - -
    - -
    - -
    - -
    - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_array_based_inputs.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_array_based_inputs.php deleted file mode 100644 index e4d6f82..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_array_based_inputs.php +++ /dev/null @@ -1,15 +0,0 @@ - - - Form with quoted values - - -

    - QUERY_STRING : -

    -
    - - - -
    - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_false_defaults.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_false_defaults.html deleted file mode 100644 index 9f3fb38..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_false_defaults.html +++ /dev/null @@ -1,40 +0,0 @@ - - Test of form submission - -
    - -
    - -
    - -
    - -
    - -
    - -
    - -
    - -
    - Radio I - - - - -
    - -
    - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_mixed_post_and_get.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_mixed_post_and_get.html deleted file mode 100644 index cf8e551..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_mixed_post_and_get.html +++ /dev/null @@ -1,15 +0,0 @@ - - Test of form submission - -
    - -
    - -
    -
    - -
    - -
    - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_quoted_values.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_quoted_values.php deleted file mode 100644 index 2d552d7..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_quoted_values.php +++ /dev/null @@ -1,14 +0,0 @@ - - - Form with quoted values - - -

    - QUERY_STRING : -

    -
    - - -
    - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_radio_buttons.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_radio_buttons.html deleted file mode 100644 index ba99969..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_radio_buttons.html +++ /dev/null @@ -1,10 +0,0 @@ - - -
    - 1 - 2 - 3 - -
    - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_tricky_defaults.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_tricky_defaults.html deleted file mode 100644 index e028ceb..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_tricky_defaults.html +++ /dev/null @@ -1,35 +0,0 @@ - - Test of form submission - -
    - -
    - -
    - -
    - -
    - -
    - -
    - Radio I - - - - - -
    - -
    - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_unnamed_submit.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_unnamed_submit.html deleted file mode 100644 index 08801f1..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_with_unnamed_submit.html +++ /dev/null @@ -1,12 +0,0 @@ - - Test of form submission - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_without_action.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_without_action.php deleted file mode 100644 index e17bcf5..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/form_without_action.php +++ /dev/null @@ -1,11 +0,0 @@ - - Test of form submission - -

    _GET : []

    -

    _POST : []

    -
    - - -
    - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/frame_a.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/frame_a.html deleted file mode 100644 index 6eeb802..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/frame_a.html +++ /dev/null @@ -1,6 +0,0 @@ - - A - - This is frame A
    - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/frame_b.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/frame_b.html deleted file mode 100644 index 1957614..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/frame_b.html +++ /dev/null @@ -1,6 +0,0 @@ - - B - - This is frame B
    - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/frame_links.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/frame_links.html deleted file mode 100644 index 864960a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/frame_links.html +++ /dev/null @@ -1,7 +0,0 @@ - - 1 - - Set one to 2 - Exit the frameset - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/frameset.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/frameset.html deleted file mode 100644 index fb9217a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/frameset.html +++ /dev/null @@ -1,10 +0,0 @@ - - Frameset for testing of SimpleTest - - - - - <body>This content is for no frames only.</body> - - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/front_controller_style/a_page.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/front_controller_style/a_page.php deleted file mode 100644 index 5f28c24..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/front_controller_style/a_page.php +++ /dev/null @@ -1,37 +0,0 @@ - 0) { - $_COOKIE = $HTTP_COOKIE_VARS; - } - if (count($HTTP_GET_VARS) > 0) { - $_GET = $HTTP_GET_VARS; - } - if (count($HTTP_POST_VARS) > 0) { - $_POST = $HTTP_POST_VARS; - } - if (! isset($_SERVER)) { - $_SERVER = $HTTP_SERVER_VARS; - } - global $HTTP_RAW_POST_DATA; - - require_once('../page_request.php'); -?> - Simple test page with links - - Simple test page with links -

    Links

    - Self - No page - Bare action - Empty query - Empty link - Current directory - Down one -

    Forms

    -
    -
    -
    -
    -
    - - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/front_controller_style/index.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/front_controller_style/index.php deleted file mode 100644 index 3f2dd08..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/front_controller_style/index.php +++ /dev/null @@ -1,44 +0,0 @@ - 0) { - $_COOKIE = $HTTP_COOKIE_VARS; - } - if (count($HTTP_GET_VARS) > 0) { - $_GET = $HTTP_GET_VARS; - } - if (count($HTTP_POST_VARS) > 0) { - $_POST = $HTTP_POST_VARS; - } - if (! isset($_SERVER)) { - $_SERVER = $HTTP_SERVER_VARS; - } - global $HTTP_RAW_POST_DATA; - - require_once('../page_request.php'); -?> - Simple test front controller - - Simple test front controller -

    Links

    - Index - No page - Bare action - Empty query - Empty link - Down one - -

    Forms

    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - - - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/front_controller_style/show_request.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/front_controller_style/show_request.php deleted file mode 100644 index f38473a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/front_controller_style/show_request.php +++ /dev/null @@ -1,49 +0,0 @@ -

    Request

    -
    -
    Protocol version
    -
    Request method
    -
    Accept header
    -
    -

    Cookies

    - 0) { - foreach ($_COOKIE as $key => $value) { - print "$key=[$value]
    \n"; - } - } - ?> -

    Raw GET data

    - -

    GET data

    - 0) { - foreach ($get as $key => $value) { - if (is_array($value)) { - $value = implode(', ', $value); - } - print "$key=[$value]
    \n"; - } - } - ?> -

    Raw POST data

    - -
    -

    POST data

    - 0) { - foreach ($_POST as $key => $value) { - print $key . "=["; - if (is_array($value)) { - print implode(', ', $value); - } else { - print $value; - } - print "]
    \n"; - } - } - ?> diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/link_confirm.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/link_confirm.php deleted file mode 100644 index 373ba35..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/link_confirm.php +++ /dev/null @@ -1,18 +0,0 @@ - - SimpleTest testing links - -

    - A target for the - SimpleTest - test suite. -

    - - - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/local_redirect.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/local_redirect.php deleted file mode 100644 index 8535711..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/local_redirect.php +++ /dev/null @@ -1,6 +0,0 @@ - - Redirection test - This is a test page for the SimpleTest PHP unit tester - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/messy_frameset.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/messy_frameset.html deleted file mode 100644 index 8364977..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/messy_frameset.html +++ /dev/null @@ -1,16 +0,0 @@ - - Frameset for testing of SimpleTest - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/multiple_widget_form.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/multiple_widget_form.html deleted file mode 100644 index ec26b11..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/multiple_widget_form.html +++ /dev/null @@ -1,59 +0,0 @@ - - Test of form submission - -
    - - -
    - Multiple checkboxes B - - - - -
    - PHP compatible - -
    - - -
    - - -
    - -
    - - -
    - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/nested_frameset.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/nested_frameset.html deleted file mode 100644 index 0227e5c..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/nested_frameset.html +++ /dev/null @@ -1,10 +0,0 @@ - - Nested frameset for testing of SimpleTest - - - - - <body>This content is for no frames only.</body> - - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/network_confirm.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/network_confirm.php deleted file mode 100644 index 034ac3f..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/network_confirm.php +++ /dev/null @@ -1,84 +0,0 @@ - 0) { - $_COOKIE = $HTTP_COOKIE_VARS; - } - if (count($HTTP_GET_VARS) > 0) { - $_GET = $HTTP_GET_VARS; - } - if (count($HTTP_POST_VARS) > 0) { - $_POST = $HTTP_POST_VARS; - } - if (! isset($_SERVER)) { - $_SERVER = $HTTP_SERVER_VARS; - } - global $HTTP_RAW_POST_DATA; - - require_once('page_request.php'); -?> - Simple test target file - - A target for the SimpleTest test suite. -

    Request

    -
    -
    Protocol version
    -
    Request method
    -
    Accept header
    -
    -

    Cookies

    - 0) { - foreach ($_COOKIE as $key => $value) { - print htmlentities($key) . "=[" . htmlentities($value) . "]
    \n"; - } - } - ?> -

    Raw GET data

    - -

    GET data

    - 0) { - foreach ($get as $key => $value) { - if (is_array($value)) { - $value = implode(', ', $value); - } - print htmlentities($key) . "=[" . htmlentities($value) . "]
    \n"; - } - } - ?> -

    Dump of $_GET data

    - '; - print_r($_GET); - print '

  • '; - ?> -

    Raw POST data

    - -
    -

    POST data

    - $value) { - $html .= htmlentities($key) . "=["; - if (is_array($value)) { - $html .= show_array_value($value); - } else { - $html .= htmlentities($value); - } - $html .= "]"; - } - - return $html; - } - - if (count($_POST) > 0) { - echo show_array_value($_POST)."
    \n"; - } - ?> - - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/one_page_frameset.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/one_page_frameset.html deleted file mode 100644 index c3e0ac7..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/one_page_frameset.html +++ /dev/null @@ -1,9 +0,0 @@ - - Frameset for testing of SimpleTest - - - - <body>This content is for no frames only.</body> - - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/page_request.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/page_request.php deleted file mode 100644 index 19ae978..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/page_request.php +++ /dev/null @@ -1,60 +0,0 @@ -parsed = array(); - foreach ($statements as $statement) { - if (strpos($statement, '=') === false) { - continue; - } - $this->parseStatement($statement); - } - } - - private function parseStatement($statement) { - list($key, $value) = explode('=', $statement); - $key = urldecode($key); - if (preg_match('/(.*)\[\]$/', $key, $matches)) { - $key = $matches[1]; - if (! isset($this->parsed[$key])) { - $this->parsed[$key] = array(); - } - $this->addValue($key, $value); - } elseif (isset($this->parsed[$key])) { - $this->addValue($key, $value); - } else { - $this->setValue($key, $value); - } - } - - private function addValue($key, $value) { - if (! is_array($this->parsed[$key])) { - $this->parsed[$key] = array($this->parsed[$key]); - } - $this->parsed[$key][] = urldecode($value); - } - - private function setValue($key, $value) { - $this->parsed[$key] = urldecode($value); - } - - function getAll() { - return $this->parsed; - } - - function get() { - $request = &new PageRequest($_SERVER['QUERY_STRING']); - return $request->getAll(); - } - - function post() { - global $HTTP_RAW_POST_DATA; - $request = &new PageRequest($HTTP_RAW_POST_DATA); - return $request->getAll(); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/path/base_change_redirect.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/path/base_change_redirect.php deleted file mode 100644 index 08636a9..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/path/base_change_redirect.php +++ /dev/null @@ -1,6 +0,0 @@ - - Redirection test - This is a test page for the SimpleTest PHP unit tester - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/path/network_confirm.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/path/network_confirm.php deleted file mode 100644 index a9fb318..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/path/network_confirm.php +++ /dev/null @@ -1,71 +0,0 @@ - 0) { - $_COOKIE = $HTTP_COOKIE_VARS; - } - if (count($HTTP_GET_VARS) > 0) { - $_GET = $HTTP_GET_VARS; - } - if (count($HTTP_POST_VARS) > 0) { - $_POST = $HTTP_POST_VARS; - } - if (!isset($_SERVER)) { - $_SERVER = $HTTP_SERVER_VARS; - } - global $HTTP_RAW_POST_DATA; - - require_once('../page_request.php'); -?> - Simple test target file in folder - - A target for the SimpleTest test suite. -

    Request

    -
    -
    Protocol version
    -
    Request method
    -
    Accept header
    -
    -

    Cookies

    - 0) { - foreach ($_COOKIE as $key => $value) { - print $key . "=[" . $value . "]
    \n"; - } - } - ?> -

    Raw GET data

    - -

    GET data

    - 0) { - foreach ($get as $key => $value) { - if (is_array($value)) { - $value = implode(', ', $value); - } - print $key . "=[" . $value . "]
    \n"; - } - } - ?> -

    Raw POST data

    - -
    -

    POST data

    - 0) { - foreach ($_POST as $key => $value) { - print $key . "=["; - if (is_array($value)) { - print implode(', ', $value); - } else { - print $value; - } - print "]
    \n"; - } - } - ?> - - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/path/show_cookies.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/path/show_cookies.php deleted file mode 100644 index 1135b04..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/path/show_cookies.php +++ /dev/null @@ -1,18 +0,0 @@ - 0) { - $_COOKIE = $HTTP_COOKIE_VARS; - } -?> - Simple test target file - - A target for the SimpleTest test suite that displays cookies. -

    Cookies

    - 0) { - foreach ($_COOKIE as $key => $value) { - print $key . "=" . $value . ";"; - } - } - ?> - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/.htaccess b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/.htaccess deleted file mode 100644 index 7e89c37..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/.htaccess +++ /dev/null @@ -1,5 +0,0 @@ -AuthName "Test of basic authentication" -AuthType Basic -AuthUserFile /home/marcus/projects/lastcraft/www/test/protected/.htpasswd -require valid-user - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/.htpasswd b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/.htpasswd deleted file mode 100644 index f40e1f2..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/.htpasswd +++ /dev/null @@ -1 +0,0 @@ -test:wOGY3sAo.zsek diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/1.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/1.html deleted file mode 100644 index cdc3e0b..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/1.html +++ /dev/null @@ -1,6 +0,0 @@ - - 1 - - 2 - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/2.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/2.html deleted file mode 100644 index fea1449..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/2.html +++ /dev/null @@ -1,6 +0,0 @@ - - 2 - - 3 - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/3.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/3.html deleted file mode 100644 index fdd1380..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/3.html +++ /dev/null @@ -1,6 +0,0 @@ - - 3 - - 1 - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/htaccess b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/htaccess deleted file mode 100644 index 866def1..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/htaccess +++ /dev/null @@ -1,4 +0,0 @@ -AuthName "SimpleTest basic authentication" -AuthType Basic -AuthUserFile /web/guide/lastcraft/public_html/test/protected/.htpasswd -require valid-user diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/local_redirect.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/local_redirect.php deleted file mode 100644 index 8535711..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/local_redirect.php +++ /dev/null @@ -1,6 +0,0 @@ - - Redirection test - This is a test page for the SimpleTest PHP unit tester - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/network_confirm.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/network_confirm.php deleted file mode 100644 index e0f8a6e..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/protected/network_confirm.php +++ /dev/null @@ -1,71 +0,0 @@ - 0) { - $_COOKIE = $HTTP_COOKIE_VARS; - } - if (count($HTTP_GET_VARS) > 0) { - $_GET = $HTTP_GET_VARS; - } - if (count($HTTP_POST_VARS) > 0) { - $_POST = $HTTP_POST_VARS; - } - if (!isset($_SERVER)) { - $_SERVER = $HTTP_SERVER_VARS; - } - global $HTTP_RAW_POST_DATA; - - require_once('../page_request.php'); -?> - Simple test target file - - A target for the SimpleTest test suite. -

    Request

    -
    -
    Protocol version
    -
    Request method
    -
    Accept header
    -
    -

    Cookies

    - 0) { - foreach ($_COOKIE as $key => $value) { - print $key . "=[" . $value . "]
    \n"; - } - } - ?> -

    Raw GET data

    - -

    GET data

    - 0) { - foreach ($get as $key => $value) { - if (is_array($value)) { - $value = implode(', ', $value); - } - print $key . "=[" . $value . "]
    \n"; - } - } - ?> -

    Raw POST data

    - -
    -

    POST data

    - 0) { - foreach ($_POST as $key => $value) { - print $key . "=["; - if (is_array($value)) { - print implode(', ', $value); - } else { - print $value; - } - print "]
    \n"; - } - } - ?> - - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/redirect.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/redirect.php deleted file mode 100644 index 14c23fa..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/redirect.php +++ /dev/null @@ -1,6 +0,0 @@ - - Redirection test - This is a test page for the SimpleTest PHP unit tester - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/savant_style_form.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/savant_style_form.html deleted file mode 100644 index f510555..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/savant_style_form.html +++ /dev/null @@ -1,20 +0,0 @@ - - Test of form submission with Savant style controls - -
    - Checkbox A - - - -
    - Radio B - - - - - -
    - -
    - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/search.png b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/search.png deleted file mode 100644 index 342d1d3b0a10634bc212fd28cada640388100966..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1259 zcmVUy%R+00(qQO+^RP1{x0v5pJA0hX4Qsc}YY; zRCt`#SWieJR~Y}zkWCg;$P1RPLJmejH9BQ>%PmWoZ70bvuCn3Zq;j|EfIOp%=;hdA_ zdFtg5XSivaq( zT$+@UeBY#Ob#`g9$0AO!#50+(tF$Tjh zkVqupI1UWMh=j)6+#CR)TrQ*0XhdkaTuy!0Gz$Cs`;jpE;>)j~>pFh;{yVi-E|*mZ z1Hi?_g_0?iN&tXtHrr{w;z@K--V%$&A`TA^@uPWwS1;GFzP=veSy@?8-z$|0YPA{w zz_KhDhJoALTR4u>b#})D2LQ;hGyp^#=@;Rs7VB6D*LCsB&p+YS%QdwZ1ObkYj=B;X zcua1?FmP~ifX&TK0Nsvgn${(E<9Y~!0G#vpb}sIMLYo0V?;J)s=Qut&1?L=$F?{{a zw~AJ&RG{lR^7*{F8O}L`5Ro&^&dva!YrmI4fBx}10AOotOYI3Ez&Y>fSlk5xPcMef z1Pl|t9ky-9R>d%hFE1OB?jOp8Xti2uk|83JQpOGiVUY-B+pA)G6%1|Y94@4kWLXw@ zo=2LLk~+gm2!ZM8X#mka6XIRHs-0G^*HzD|R4TZ-x>9{CF64UY6+%R0IOoV_v#3_9 zks@T8Cg$em9$&h>2MY2MLXc^is*mZjvoqM)+3C8yK?3I-tE;O>vkYFm_#DY(5_&S3 z!rIzer0)z8IOoXc^8kR!+ysV)N1*FEv>*uR?(Pnbn>h zU~Fs*j4|YLIn2(^U~Ft0x~?OkX&OdGMldxs1pr91jQYQ$*MR(~fH8(N%OJzjn4O)$ z=;&wA^~YgKqqmJE2m(AjG~v1~UcdeeuIu8)_4-!&zJCU#S*EY^!)aw=VgjS1qZk?* zLL%`rZz#ur$L8t#KJM@D@#f9neJKQhhlhVYi2wQXR9||Ahez=2SpvyqD&iCX{0j;} VqtuINB%uHR002ovPDHLkV1mi4QoaBH diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/self.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/self.php deleted file mode 100644 index 2759f64..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/self.php +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/self_form.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/self_form.php deleted file mode 100644 index 7428d2b..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/self_form.php +++ /dev/null @@ -1,21 +0,0 @@ - 0) { - $_GET = $HTTP_GET_VARS; - } -?> - Test of form self submission - -
    - -
    -

    []

    -

    []

    -

    []

    -
    - - - -
    - - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/set_cookies.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/set_cookies.php deleted file mode 100644 index a4a8a26..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/set_cookies.php +++ /dev/null @@ -1,20 +0,0 @@ - - SimpleTest testing links - -

    - A target for the - SimpleTest - test suite. - All it does is set some cookies which you can see - here. -

    - - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/slow_page.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/slow_page.php deleted file mode 100644 index c1aef31..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/slow_page.php +++ /dev/null @@ -1,6 +0,0 @@ - - Slow page - This page takes at least two seconds - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/temp/.stop_cvs_removing_temp b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/temp/.stop_cvs_removing_temp deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/timestamp.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/timestamp.php deleted file mode 100644 index 3117c48..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/timestamp.php +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/upload_form.html b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/upload_form.html deleted file mode 100644 index 23d3a87..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/upload_form.html +++ /dev/null @@ -1,11 +0,0 @@ - - Test of file upload - -
    - -
    -
    - -
    - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/upload_handler.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/upload_handler.php deleted file mode 100644 index 7680b88..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/site/upload_handler.php +++ /dev/null @@ -1,18 +0,0 @@ - - Test of file upload - -

    -

    - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/socket_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/socket_test.php deleted file mode 100644 index 729adda..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/socket_test.php +++ /dev/null @@ -1,25 +0,0 @@ -assertFalse($error->isError()); - $error->setError('Ouch'); - $this->assertTrue($error->isError()); - $this->assertEqual($error->getError(), 'Ouch'); - } - - function testClearingError() { - $error = new SimpleStickyError(); - $error->setError('Ouch'); - $this->assertTrue($error->isError()); - $error->clearError(); - $this->assertFalse($error->isError()); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/collector/collectable.1 b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/collector/collectable.1 deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/collector/collectable.2 b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/collector/collectable.2 deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/empty_test_file.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/empty_test_file.php deleted file mode 100644 index 31e3f7b..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/empty_test_file.php +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/latin1_sample b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/latin1_sample deleted file mode 100644 index 1903525..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/latin1_sample +++ /dev/null @@ -1 +0,0 @@ -@櫻 \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/spl_examples.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/spl_examples.php deleted file mode 100644 index 45add35..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/spl_examples.php +++ /dev/null @@ -1,15 +0,0 @@ - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/supplementary_upload_sample.txt b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/supplementary_upload_sample.txt deleted file mode 100644 index d8aa9e8..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/supplementary_upload_sample.txt +++ /dev/null @@ -1 +0,0 @@ -Some more text content \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/test1.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/test1.php deleted file mode 100644 index b414586..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/test1.php +++ /dev/null @@ -1,7 +0,0 @@ -assertEqual(3,1+2, "pass1"); - } -} -?> diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/upload_sample.txt b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/upload_sample.txt deleted file mode 100644 index ec98d7c..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/support/upload_sample.txt +++ /dev/null @@ -1 +0,0 @@ -Sample for testing file upload \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/tag_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/tag_test.php deleted file mode 100644 index 5e8a377..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/tag_test.php +++ /dev/null @@ -1,554 +0,0 @@ - '1', 'b' => '')); - $this->assertEqual($tag->getTagName(), 'title'); - $this->assertIdentical($tag->getAttribute('a'), '1'); - $this->assertIdentical($tag->getAttribute('b'), ''); - $this->assertIdentical($tag->getAttribute('c'), false); - $this->assertIdentical($tag->getContent(), ''); - } - - function testTitleContent() { - $tag = new SimpleTitleTag(array()); - $this->assertTrue($tag->expectEndTag()); - $tag->addContent('Hello'); - $tag->addContent('World'); - $this->assertEqual($tag->getText(), 'HelloWorld'); - } - - function testMessyTitleContent() { - $tag = new SimpleTitleTag(array()); - $this->assertTrue($tag->expectEndTag()); - $tag->addContent('Hello'); - $tag->addContent('World'); - $this->assertEqual($tag->getText(), 'HelloWorld'); - } - - function testTagWithNoEnd() { - $tag = new SimpleTextTag(array()); - $this->assertFalse($tag->expectEndTag()); - } - - function testAnchorHref() { - $tag = new SimpleAnchorTag(array('href' => 'http://here/')); - $this->assertEqual($tag->getHref(), 'http://here/'); - - $tag = new SimpleAnchorTag(array('href' => '')); - $this->assertIdentical($tag->getAttribute('href'), ''); - $this->assertIdentical($tag->getHref(), ''); - - $tag = new SimpleAnchorTag(array()); - $this->assertIdentical($tag->getAttribute('href'), false); - $this->assertIdentical($tag->getHref(), ''); - } - - function testIsIdMatchesIdAttribute() { - $tag = new SimpleAnchorTag(array('href' => 'http://here/', 'id' => 7)); - $this->assertIdentical($tag->getAttribute('id'), '7'); - $this->assertTrue($tag->isId(7)); - } -} - -class TestOfWidget extends UnitTestCase { - - function testTextEmptyDefault() { - $tag = new SimpleTextTag(array('type' => 'text')); - $this->assertIdentical($tag->getDefault(), ''); - $this->assertIdentical($tag->getValue(), ''); - } - - function testSettingOfExternalLabel() { - $tag = new SimpleTextTag(array('type' => 'text')); - $tag->setLabel('it'); - $this->assertTrue($tag->isLabel('it')); - } - - function testTextDefault() { - $tag = new SimpleTextTag(array('value' => 'aaa')); - $this->assertEqual($tag->getDefault(), 'aaa'); - $this->assertEqual($tag->getValue(), 'aaa'); - } - - function testSettingTextValue() { - $tag = new SimpleTextTag(array('value' => 'aaa')); - $tag->setValue('bbb'); - $this->assertEqual($tag->getValue(), 'bbb'); - $tag->resetValue(); - $this->assertEqual($tag->getValue(), 'aaa'); - } - - function testFailToSetHiddenValue() { - $tag = new SimpleTextTag(array('value' => 'aaa', 'type' => 'hidden')); - $this->assertFalse($tag->setValue('bbb')); - $this->assertEqual($tag->getValue(), 'aaa'); - } - - function testSubmitDefaults() { - $tag = new SimpleSubmitTag(array('type' => 'submit')); - $this->assertIdentical($tag->getName(), false); - $this->assertEqual($tag->getValue(), 'Submit'); - $this->assertFalse($tag->setValue('Cannot set this')); - $this->assertEqual($tag->getValue(), 'Submit'); - $this->assertEqual($tag->getLabel(), 'Submit'); - - $encoding = new MockSimpleMultipartEncoding(); - $encoding->expectNever('add'); - $tag->write($encoding); - } - - function testPopulatedSubmit() { - $tag = new SimpleSubmitTag( - array('type' => 'submit', 'name' => 's', 'value' => 'Ok!')); - $this->assertEqual($tag->getName(), 's'); - $this->assertEqual($tag->getValue(), 'Ok!'); - $this->assertEqual($tag->getLabel(), 'Ok!'); - - $encoding = new MockSimpleMultipartEncoding(); - $encoding->expectOnce('add', array('s', 'Ok!')); - $tag->write($encoding); - } - - function testImageSubmit() { - $tag = new SimpleImageSubmitTag( - array('type' => 'image', 'name' => 's', 'alt' => 'Label')); - $this->assertEqual($tag->getName(), 's'); - $this->assertEqual($tag->getLabel(), 'Label'); - - $encoding = new MockSimpleMultipartEncoding(); - $encoding->expectAt(0, 'add', array('s.x', 20)); - $encoding->expectAt(1, 'add', array('s.y', 30)); - $tag->write($encoding, 20, 30); - } - - function testImageSubmitTitlePreferredOverAltForLabel() { - $tag = new SimpleImageSubmitTag( - array('type' => 'image', 'name' => 's', 'alt' => 'Label', 'title' => 'Title')); - $this->assertEqual($tag->getLabel(), 'Title'); - } - - function testButton() { - $tag = new SimpleButtonTag( - array('type' => 'submit', 'name' => 's', 'value' => 'do')); - $tag->addContent('I am a button'); - $this->assertEqual($tag->getName(), 's'); - $this->assertEqual($tag->getValue(), 'do'); - $this->assertEqual($tag->getLabel(), 'I am a button'); - - $encoding = new MockSimpleMultipartEncoding(); - $encoding->expectOnce('add', array('s', 'do')); - $tag->write($encoding); - } -} - -class TestOfTextArea extends UnitTestCase { - - function testDefault() { - $tag = new SimpleTextAreaTag(array('name' => 'a')); - $tag->addContent('Some text'); - $this->assertEqual($tag->getName(), 'a'); - $this->assertEqual($tag->getDefault(), 'Some text'); - } - - function testWrapping() { - $tag = new SimpleTextAreaTag(array('cols' => '10', 'wrap' => 'physical')); - $tag->addContent("Lot's of text that should be wrapped"); - $this->assertEqual( - $tag->getDefault(), - "Lot's of\r\ntext that\r\nshould be\r\nwrapped"); - $tag->setValue("New long text\r\nwith two lines"); - $this->assertEqual( - $tag->getValue(), - "New long\r\ntext\r\nwith two\r\nlines"); - } - - function testWrappingRemovesLeadingcariageReturn() { - $tag = new SimpleTextAreaTag(array('cols' => '20', 'wrap' => 'physical')); - $tag->addContent("\rStuff"); - $this->assertEqual($tag->getDefault(), 'Stuff'); - $tag->setValue("\nNew stuff\n"); - $this->assertEqual($tag->getValue(), "New stuff\r\n"); - } - - function testBreaksAreNewlineAndCarriageReturn() { - $tag = new SimpleTextAreaTag(array('cols' => '10')); - $tag->addContent("Some\nText\rwith\r\nbreaks"); - $this->assertEqual($tag->getValue(), "Some\r\nText\r\nwith\r\nbreaks"); - } -} - -class TestOfCheckbox extends UnitTestCase { - - function testCanSetCheckboxToNamedValueWithBooleanTrue() { - $tag = new SimpleCheckboxTag(array('name' => 'a', 'value' => 'A')); - $this->assertEqual($tag->getValue(), false); - $tag->setValue(true); - $this->assertIdentical($tag->getValue(), 'A'); - } -} - -class TestOfSelection extends UnitTestCase { - - function testEmpty() { - $tag = new SimpleSelectionTag(array('name' => 'a')); - $this->assertIdentical($tag->getValue(), ''); - } - - function testSingle() { - $tag = new SimpleSelectionTag(array('name' => 'a')); - $option = new SimpleOptionTag(array()); - $option->addContent('AAA'); - $tag->addTag($option); - $this->assertEqual($tag->getValue(), 'AAA'); - } - - function testSingleDefault() { - $tag = new SimpleSelectionTag(array('name' => 'a')); - $option = new SimpleOptionTag(array('selected' => '')); - $option->addContent('AAA'); - $tag->addTag($option); - $this->assertEqual($tag->getValue(), 'AAA'); - } - - function testSingleMappedDefault() { - $tag = new SimpleSelectionTag(array('name' => 'a')); - $option = new SimpleOptionTag(array('selected' => '', 'value' => 'aaa')); - $option->addContent('AAA'); - $tag->addTag($option); - $this->assertEqual($tag->getValue(), 'aaa'); - } - - function testStartsWithDefault() { - $tag = new SimpleSelectionTag(array('name' => 'a')); - $a = new SimpleOptionTag(array()); - $a->addContent('AAA'); - $tag->addTag($a); - $b = new SimpleOptionTag(array('selected' => '')); - $b->addContent('BBB'); - $tag->addTag($b); - $c = new SimpleOptionTag(array()); - $c->addContent('CCC'); - $tag->addTag($c); - $this->assertEqual($tag->getValue(), 'BBB'); - } - - function testSettingOption() { - $tag = new SimpleSelectionTag(array('name' => 'a')); - $a = new SimpleOptionTag(array()); - $a->addContent('AAA'); - $tag->addTag($a); - $b = new SimpleOptionTag(array('selected' => '')); - $b->addContent('BBB'); - $tag->addTag($b); - $c = new SimpleOptionTag(array()); - $c->addContent('CCC'); - $tag->setValue('AAA'); - $this->assertEqual($tag->getValue(), 'AAA'); - } - - function testSettingMappedOption() { - $tag = new SimpleSelectionTag(array('name' => 'a')); - $a = new SimpleOptionTag(array('value' => 'aaa')); - $a->addContent('AAA'); - $tag->addTag($a); - $b = new SimpleOptionTag(array('value' => 'bbb', 'selected' => '')); - $b->addContent('BBB'); - $tag->addTag($b); - $c = new SimpleOptionTag(array('value' => 'ccc')); - $c->addContent('CCC'); - $tag->addTag($c); - $tag->setValue('AAA'); - $this->assertEqual($tag->getValue(), 'aaa'); - $tag->setValue('ccc'); - $this->assertEqual($tag->getValue(), 'ccc'); - } - - function testSelectionDespiteSpuriousWhitespace() { - $tag = new SimpleSelectionTag(array('name' => 'a')); - $a = new SimpleOptionTag(array()); - $a->addContent(' AAA '); - $tag->addTag($a); - $b = new SimpleOptionTag(array('selected' => '')); - $b->addContent(' BBB '); - $tag->addTag($b); - $c = new SimpleOptionTag(array()); - $c->addContent(' CCC '); - $tag->addTag($c); - $this->assertEqual($tag->getValue(), ' BBB '); - $tag->setValue('AAA'); - $this->assertEqual($tag->getValue(), ' AAA '); - } - - function testFailToSetIllegalOption() { - $tag = new SimpleSelectionTag(array('name' => 'a')); - $a = new SimpleOptionTag(array()); - $a->addContent('AAA'); - $tag->addTag($a); - $b = new SimpleOptionTag(array('selected' => '')); - $b->addContent('BBB'); - $tag->addTag($b); - $c = new SimpleOptionTag(array()); - $c->addContent('CCC'); - $tag->addTag($c); - $this->assertFalse($tag->setValue('Not present')); - $this->assertEqual($tag->getValue(), 'BBB'); - } - - function testNastyOptionValuesThatLookLikeFalse() { - $tag = new SimpleSelectionTag(array('name' => 'a')); - $a = new SimpleOptionTag(array('value' => '1')); - $a->addContent('One'); - $tag->addTag($a); - $b = new SimpleOptionTag(array('value' => '0')); - $b->addContent('Zero'); - $tag->addTag($b); - $this->assertIdentical($tag->getValue(), '1'); - $tag->setValue('Zero'); - $this->assertIdentical($tag->getValue(), '0'); - } - - function testBlankOption() { - $tag = new SimpleSelectionTag(array('name' => 'A')); - $a = new SimpleOptionTag(array()); - $tag->addTag($a); - $b = new SimpleOptionTag(array()); - $b->addContent('b'); - $tag->addTag($b); - $this->assertIdentical($tag->getValue(), ''); - $tag->setValue('b'); - $this->assertIdentical($tag->getValue(), 'b'); - $tag->setValue(''); - $this->assertIdentical($tag->getValue(), ''); - } - - function testMultipleDefaultWithNoSelections() { - $tag = new MultipleSelectionTag(array('name' => 'a', 'multiple' => '')); - $a = new SimpleOptionTag(array()); - $a->addContent('AAA'); - $tag->addTag($a); - $b = new SimpleOptionTag(array()); - $b->addContent('BBB'); - $tag->addTag($b); - $this->assertIdentical($tag->getDefault(), array()); - $this->assertIdentical($tag->getValue(), array()); - } - - function testMultipleDefaultWithSelections() { - $tag = new MultipleSelectionTag(array('name' => 'a', 'multiple' => '')); - $a = new SimpleOptionTag(array('selected' => '')); - $a->addContent('AAA'); - $tag->addTag($a); - $b = new SimpleOptionTag(array('selected' => '')); - $b->addContent('BBB'); - $tag->addTag($b); - $this->assertIdentical($tag->getDefault(), array('AAA', 'BBB')); - $this->assertIdentical($tag->getValue(), array('AAA', 'BBB')); - } - - function testSettingMultiple() { - $tag = new MultipleSelectionTag(array('name' => 'a', 'multiple' => '')); - $a = new SimpleOptionTag(array('selected' => '')); - $a->addContent('AAA'); - $tag->addTag($a); - $b = new SimpleOptionTag(array()); - $b->addContent('BBB'); - $tag->addTag($b); - $c = new SimpleOptionTag(array('selected' => '', 'value' => 'ccc')); - $c->addContent('CCC'); - $tag->addTag($c); - $this->assertIdentical($tag->getDefault(), array('AAA', 'ccc')); - $this->assertTrue($tag->setValue(array('BBB', 'ccc'))); - $this->assertIdentical($tag->getValue(), array('BBB', 'ccc')); - $this->assertTrue($tag->setValue(array())); - $this->assertIdentical($tag->getValue(), array()); - } - - function testFailToSetIllegalOptionsInMultiple() { - $tag = new MultipleSelectionTag(array('name' => 'a', 'multiple' => '')); - $a = new SimpleOptionTag(array('selected' => '')); - $a->addContent('AAA'); - $tag->addTag($a); - $b = new SimpleOptionTag(array()); - $b->addContent('BBB'); - $tag->addTag($b); - $this->assertFalse($tag->setValue(array('CCC'))); - $this->assertTrue($tag->setValue(array('AAA', 'BBB'))); - $this->assertFalse($tag->setValue(array('AAA', 'CCC'))); - } -} - -class TestOfRadioGroup extends UnitTestCase { - - function testEmptyGroup() { - $group = new SimpleRadioGroup(); - $this->assertIdentical($group->getDefault(), false); - $this->assertIdentical($group->getValue(), false); - $this->assertFalse($group->setValue('a')); - } - - function testReadingSingleButtonGroup() { - $group = new SimpleRadioGroup(); - $group->addWidget(new SimpleRadioButtonTag( - array('value' => 'A', 'checked' => ''))); - $this->assertIdentical($group->getDefault(), 'A'); - $this->assertIdentical($group->getValue(), 'A'); - } - - function testReadingMultipleButtonGroup() { - $group = new SimpleRadioGroup(); - $group->addWidget(new SimpleRadioButtonTag( - array('value' => 'A'))); - $group->addWidget(new SimpleRadioButtonTag( - array('value' => 'B', 'checked' => ''))); - $this->assertIdentical($group->getDefault(), 'B'); - $this->assertIdentical($group->getValue(), 'B'); - } - - function testFailToSetUnlistedValue() { - $group = new SimpleRadioGroup(); - $group->addWidget(new SimpleRadioButtonTag(array('value' => 'z'))); - $this->assertFalse($group->setValue('a')); - $this->assertIdentical($group->getValue(), false); - } - - function testSettingNewValueClearsTheOldOne() { - $group = new SimpleRadioGroup(); - $group->addWidget(new SimpleRadioButtonTag( - array('value' => 'A'))); - $group->addWidget(new SimpleRadioButtonTag( - array('value' => 'B', 'checked' => ''))); - $this->assertTrue($group->setValue('A')); - $this->assertIdentical($group->getValue(), 'A'); - } - - function testIsIdMatchesAnyWidgetInSet() { - $group = new SimpleRadioGroup(); - $group->addWidget(new SimpleRadioButtonTag( - array('value' => 'A', 'id' => 'i1'))); - $group->addWidget(new SimpleRadioButtonTag( - array('value' => 'B', 'id' => 'i2'))); - $this->assertFalse($group->isId('i0')); - $this->assertTrue($group->isId('i1')); - $this->assertTrue($group->isId('i2')); - } - - function testIsLabelMatchesAnyWidgetInSet() { - $group = new SimpleRadioGroup(); - $button1 = new SimpleRadioButtonTag(array('value' => 'A')); - $button1->setLabel('one'); - $group->addWidget($button1); - $button2 = new SimpleRadioButtonTag(array('value' => 'B')); - $button2->setLabel('two'); - $group->addWidget($button2); - $this->assertFalse($group->isLabel('three')); - $this->assertTrue($group->isLabel('one')); - $this->assertTrue($group->isLabel('two')); - } -} - -class TestOfTagGroup extends UnitTestCase { - - function testReadingMultipleCheckboxGroup() { - $group = new SimpleCheckboxGroup(); - $group->addWidget(new SimpleCheckboxTag(array('value' => 'A'))); - $group->addWidget(new SimpleCheckboxTag( - array('value' => 'B', 'checked' => ''))); - $this->assertIdentical($group->getDefault(), 'B'); - $this->assertIdentical($group->getValue(), 'B'); - } - - function testReadingMultipleUncheckedItems() { - $group = new SimpleCheckboxGroup(); - $group->addWidget(new SimpleCheckboxTag(array('value' => 'A'))); - $group->addWidget(new SimpleCheckboxTag(array('value' => 'B'))); - $this->assertIdentical($group->getDefault(), false); - $this->assertIdentical($group->getValue(), false); - } - - function testReadingMultipleCheckedItems() { - $group = new SimpleCheckboxGroup(); - $group->addWidget(new SimpleCheckboxTag( - array('value' => 'A', 'checked' => ''))); - $group->addWidget(new SimpleCheckboxTag( - array('value' => 'B', 'checked' => ''))); - $this->assertIdentical($group->getDefault(), array('A', 'B')); - $this->assertIdentical($group->getValue(), array('A', 'B')); - } - - function testSettingSingleValue() { - $group = new SimpleCheckboxGroup(); - $group->addWidget(new SimpleCheckboxTag(array('value' => 'A'))); - $group->addWidget(new SimpleCheckboxTag(array('value' => 'B'))); - $this->assertTrue($group->setValue('A')); - $this->assertIdentical($group->getValue(), 'A'); - $this->assertTrue($group->setValue('B')); - $this->assertIdentical($group->getValue(), 'B'); - } - - function testSettingMultipleValues() { - $group = new SimpleCheckboxGroup(); - $group->addWidget(new SimpleCheckboxTag(array('value' => 'A'))); - $group->addWidget(new SimpleCheckboxTag(array('value' => 'B'))); - $this->assertTrue($group->setValue(array('A', 'B'))); - $this->assertIdentical($group->getValue(), array('A', 'B')); - } - - function testSettingNoValue() { - $group = new SimpleCheckboxGroup(); - $group->addWidget(new SimpleCheckboxTag(array('value' => 'A'))); - $group->addWidget(new SimpleCheckboxTag(array('value' => 'B'))); - $this->assertTrue($group->setValue(false)); - $this->assertIdentical($group->getValue(), false); - } - - function testIsIdMatchesAnyIdInSet() { - $group = new SimpleCheckboxGroup(); - $group->addWidget(new SimpleCheckboxTag(array('id' => 1, 'value' => 'A'))); - $group->addWidget(new SimpleCheckboxTag(array('id' => 2, 'value' => 'B'))); - $this->assertFalse($group->isId(0)); - $this->assertTrue($group->isId(1)); - $this->assertTrue($group->isId(2)); - } -} - -class TestOfUploadWidget extends UnitTestCase { - - function testValueIsFilePath() { - $upload = new SimpleUploadTag(array('name' => 'a')); - $upload->setValue(dirname(__FILE__) . '/support/upload_sample.txt'); - $this->assertEqual($upload->getValue(), dirname(__FILE__) . '/support/upload_sample.txt'); - } - - function testSubmitsFileContents() { - $encoding = new MockSimpleMultipartEncoding(); - $encoding->expectOnce('attach', array( - 'a', - 'Sample for testing file upload', - 'upload_sample.txt')); - $upload = new SimpleUploadTag(array('name' => 'a')); - $upload->setValue(dirname(__FILE__) . '/support/upload_sample.txt'); - $upload->write($encoding); - } -} - -class TestOfLabelTag extends UnitTestCase { - - function testLabelShouldHaveAnEndTag() { - $label = new SimpleLabelTag(array()); - $this->assertTrue($label->expectEndTag()); - } - - function testContentIsTextOnly() { - $label = new SimpleLabelTag(array()); - $label->addContent('Here are words'); - $this->assertEqual($label->getText(), 'Here are words'); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/unit_tester_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/unit_tester_test.php deleted file mode 100644 index ce9850f..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/unit_tester_test.php +++ /dev/null @@ -1,61 +0,0 @@ -assertTrue($this->assertTrue(true)); - } - - function testAssertFalseReturnsAssertionAsBoolean() { - $this->assertTrue($this->assertFalse(false)); - } - - function testAssertEqualReturnsAssertionAsBoolean() { - $this->assertTrue($this->assertEqual(5, 5)); - } - - function testAssertIdenticalReturnsAssertionAsBoolean() { - $this->assertTrue($this->assertIdentical(5, 5)); - } - - function testCoreAssertionsDoNotThrowErrors() { - $this->assertIsA($this, 'UnitTestCase'); - $this->assertNotA($this, 'WebTestCase'); - } - - function testReferenceAssertionOnObjects() { - $a = new ReferenceForTesting(); - $b = $a; - $this->assertSame($a, $b); - } - - function testReferenceAssertionOnScalars() { - $a = 25; - $b = &$a; - $this->assertReference($a, $b); - } - - function testCloneOnObjects() { - $a = new ReferenceForTesting(); - $b = new ReferenceForTesting(); - $this->assertClone($a, $b); - } - - function TODO_testCloneOnScalars() { - $a = 25; - $b = 25; - $this->assertClone($a, $b); - } - - function testCopyOnScalars() { - $a = 25; - $b = 25; - $this->assertCopy($a, $b); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/unit_tests.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/unit_tests.php deleted file mode 100644 index 43c36a3..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/unit_tests.php +++ /dev/null @@ -1,46 +0,0 @@ -TestSuite('Unit tests'); - $path = dirname(__FILE__); - $this->addFile($path . '/errors_test.php'); - $this->addFile($path . '/exceptions_test.php'); - $this->addFile($path . '/autorun_test.php'); - $this->addFile($path . '/compatibility_test.php'); - $this->addFile($path . '/simpletest_test.php'); - $this->addFile($path . '/dumper_test.php'); - $this->addFile($path . '/expectation_test.php'); - $this->addFile($path . '/unit_tester_test.php'); - $this->addFile($path . '/reflection_php5_test.php'); - $this->addFile($path . '/mock_objects_test.php'); - $this->addFile($path . '/interfaces_test.php'); - $this->addFile($path . '/collector_test.php'); - $this->addFile($path . '/adapter_test.php'); - $this->addFile($path . '/socket_test.php'); - $this->addFile($path . '/encoding_test.php'); - $this->addFile($path . '/url_test.php'); - $this->addFile($path . '/cookies_test.php'); - $this->addFile($path . '/http_test.php'); - $this->addFile($path . '/authentication_test.php'); - $this->addFile($path . '/user_agent_test.php'); - $this->addFile($path . '/parser_test.php'); - $this->addFile($path . '/tag_test.php'); - $this->addFile($path . '/form_test.php'); - $this->addFile($path . '/page_test.php'); - $this->addFile($path . '/frames_test.php'); - $this->addFile($path . '/browser_test.php'); - $this->addFile($path . '/web_tester_test.php'); - $this->addFile($path . '/shell_tester_test.php'); - $this->addFile($path . '/xml_test.php'); - $this->addFile($path . '/../extensions/testdox/test.php'); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/url_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/url_test.php deleted file mode 100644 index 666ab1e..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/url_test.php +++ /dev/null @@ -1,496 +0,0 @@ -assertEqual($url->getScheme(), ''); - $this->assertEqual($url->getHost(), ''); - $this->assertEqual($url->getScheme('http'), 'http'); - $this->assertEqual($url->getHost('localhost'), 'localhost'); - $this->assertEqual($url->getPath(), ''); - } - - function testBasicParsing() { - $url = new SimpleUrl('https://www.lastcraft.com/test/'); - $this->assertEqual($url->getScheme(), 'https'); - $this->assertEqual($url->getHost(), 'www.lastcraft.com'); - $this->assertEqual($url->getPath(), '/test/'); - } - - function testRelativeUrls() { - $url = new SimpleUrl('../somewhere.php'); - $this->assertEqual($url->getScheme(), false); - $this->assertEqual($url->getHost(), false); - $this->assertEqual($url->getPath(), '../somewhere.php'); - } - - function testParseBareParameter() { - $url = new SimpleUrl('?a'); - $this->assertEqual($url->getPath(), ''); - $this->assertEqual($url->getEncodedRequest(), '?a'); - $url->addRequestParameter('x', 'X'); - $this->assertEqual($url->getEncodedRequest(), '?a=&x=X'); - } - - function testParseEmptyParameter() { - $url = new SimpleUrl('?a='); - $this->assertEqual($url->getPath(), ''); - $this->assertEqual($url->getEncodedRequest(), '?a='); - $url->addRequestParameter('x', 'X'); - $this->assertEqual($url->getEncodedRequest(), '?a=&x=X'); - } - - function testParseParameterPair() { - $url = new SimpleUrl('?a=A'); - $this->assertEqual($url->getPath(), ''); - $this->assertEqual($url->getEncodedRequest(), '?a=A'); - $url->addRequestParameter('x', 'X'); - $this->assertEqual($url->getEncodedRequest(), '?a=A&x=X'); - } - - function testParseMultipleParameters() { - $url = new SimpleUrl('?a=A&b=B'); - $this->assertEqual($url->getEncodedRequest(), '?a=A&b=B'); - $url->addRequestParameter('x', 'X'); - $this->assertEqual($url->getEncodedRequest(), '?a=A&b=B&x=X'); - } - - function testParsingParameterMixture() { - $url = new SimpleUrl('?a=A&b=&c'); - $this->assertEqual($url->getEncodedRequest(), '?a=A&b=&c'); - $url->addRequestParameter('x', 'X'); - $this->assertEqual($url->getEncodedRequest(), '?a=A&b=&c=&x=X'); - } - - function testAddParametersFromScratch() { - $url = new SimpleUrl(''); - $url->addRequestParameter('a', 'A'); - $this->assertEqual($url->getEncodedRequest(), '?a=A'); - $url->addRequestParameter('b', 'B'); - $this->assertEqual($url->getEncodedRequest(), '?a=A&b=B'); - $url->addRequestParameter('a', 'aaa'); - $this->assertEqual($url->getEncodedRequest(), '?a=A&b=B&a=aaa'); - } - - function testClearingParameters() { - $url = new SimpleUrl(''); - $url->addRequestParameter('a', 'A'); - $url->clearRequest(); - $this->assertIdentical($url->getEncodedRequest(), ''); - } - - function testEncodingParameters() { - $url = new SimpleUrl(''); - $url->addRequestParameter('a', '?!"\'#~@[]{}:;<>,./|$%^&*()_+-='); - $this->assertIdentical( - $request = $url->getEncodedRequest(), - '?a=%3F%21%22%27%23%7E%40%5B%5D%7B%7D%3A%3B%3C%3E%2C.%2F%7C%A3%24%25%5E%26%2A%28%29_%2B-%3D'); - } - - function testDecodingParameters() { - $url = new SimpleUrl('?a=%3F%21%22%27%23%7E%40%5B%5D%7B%7D%3A%3B%3C%3E%2C.%2F%7C%A3%24%25%5E%26%2A%28%29_%2B-%3D'); - $this->assertEqual( - $url->getEncodedRequest(), - '?a=' . urlencode('?!"\'#~@[]{}:;<>,./|$%^&*()_+-=')); - } - - function testUrlInQueryDoesNotConfuseParsing() { - $url = new SimpleUrl('wibble/login.php?url=http://www.google.com/moo/'); - $this->assertFalse($url->getScheme()); - $this->assertFalse($url->getHost()); - $this->assertEqual($url->getPath(), 'wibble/login.php'); - $this->assertEqual($url->getEncodedRequest(), '?url=http://www.google.com/moo/'); - } - - function testSettingCordinates() { - $url = new SimpleUrl(''); - $url->setCoordinates('32', '45'); - $this->assertIdentical($url->getX(), 32); - $this->assertIdentical($url->getY(), 45); - $this->assertEqual($url->getEncodedRequest(), ''); - } - - function testParseCordinates() { - $url = new SimpleUrl('?32,45'); - $this->assertIdentical($url->getX(), 32); - $this->assertIdentical($url->getY(), 45); - } - - function testClearingCordinates() { - $url = new SimpleUrl('?32,45'); - $url->setCoordinates(); - $this->assertIdentical($url->getX(), false); - $this->assertIdentical($url->getY(), false); - } - - function testParsingParameterCordinateMixture() { - $url = new SimpleUrl('?a=A&b=&c?32,45'); - $this->assertIdentical($url->getX(), 32); - $this->assertIdentical($url->getY(), 45); - $this->assertEqual($url->getEncodedRequest(), '?a=A&b=&c'); - } - - function testParsingParameterWithBadCordinates() { - $url = new SimpleUrl('?a=A&b=&c?32'); - $this->assertIdentical($url->getX(), false); - $this->assertIdentical($url->getY(), false); - $this->assertEqual($url->getEncodedRequest(), '?a=A&b=&c?32'); - } - - function testPageSplitting() { - $url = new SimpleUrl('./here/../there/somewhere.php'); - $this->assertEqual($url->getPath(), './here/../there/somewhere.php'); - $this->assertEqual($url->getPage(), 'somewhere.php'); - $this->assertEqual($url->getBasePath(), './here/../there/'); - } - - function testAbsolutePathPageSplitting() { - $url = new SimpleUrl("http://host.com/here/there/somewhere.php"); - $this->assertEqual($url->getPath(), "/here/there/somewhere.php"); - $this->assertEqual($url->getPage(), "somewhere.php"); - $this->assertEqual($url->getBasePath(), "/here/there/"); - } - - function testSplittingUrlWithNoPageGivesEmptyPage() { - $url = new SimpleUrl('/here/there/'); - $this->assertEqual($url->getPath(), '/here/there/'); - $this->assertEqual($url->getPage(), ''); - $this->assertEqual($url->getBasePath(), '/here/there/'); - } - - function testPathNormalisation() { - $url = new SimpleUrl(); - $this->assertEqual( - $url->normalisePath('https://host.com/I/am/here/../there/somewhere.php'), - 'https://host.com/I/am/there/somewhere.php'); - } - - // regression test for #1535407 - function testPathNormalisationWithSinglePeriod() { - $url = new SimpleUrl(); - $this->assertEqual( - $url->normalisePath('https://host.com/I/am/here/./../there/somewhere.php'), - 'https://host.com/I/am/there/somewhere.php'); - } - - // regression test for #1852413 - function testHostnameExtractedFromUContainingAtSign() { - $url = new SimpleUrl("http://localhost/name@example.com"); - $this->assertEqual($url->getScheme(), "http"); - $this->assertEqual($url->getUsername(), ""); - $this->assertEqual($url->getPassword(), ""); - $this->assertEqual($url->getHost(), "localhost"); - $this->assertEqual($url->getPath(), "/name@example.com"); - } - - function testHostnameInLocalhost() { - $url = new SimpleUrl("http://localhost/name/example.com"); - $this->assertEqual($url->getScheme(), "http"); - $this->assertEqual($url->getUsername(), ""); - $this->assertEqual($url->getPassword(), ""); - $this->assertEqual($url->getHost(), "localhost"); - $this->assertEqual($url->getPath(), "/name/example.com"); - } - - function testUsernameAndPasswordAreUrlDecoded() { - $url = new SimpleUrl('http://' . urlencode('test@test') . - ':' . urlencode('$!@*&%') . '@www.lastcraft.com'); - $this->assertEqual($url->getUsername(), 'test@test'); - $this->assertEqual($url->getPassword(), '$!@*&%'); - } - - function testBlitz() { - $this->assertUrl( - "https://username:password@www.somewhere.com:243/this/that/here.php?a=1&b=2#anchor", - array("https", "username", "password", "www.somewhere.com", 243, "/this/that/here.php", "com", "?a=1&b=2", "anchor"), - array("a" => "1", "b" => "2")); - $this->assertUrl( - "username:password@www.somewhere.com/this/that/here.php?a=1", - array(false, "username", "password", "www.somewhere.com", false, "/this/that/here.php", "com", "?a=1", false), - array("a" => "1")); - $this->assertUrl( - "username:password@somewhere.com:243?1,2", - array(false, "username", "password", "somewhere.com", 243, "/", "com", "", false), - array(), - array(1, 2)); - $this->assertUrl( - "https://www.somewhere.com", - array("https", false, false, "www.somewhere.com", false, "/", "com", "", false)); - $this->assertUrl( - "username@www.somewhere.com:243#anchor", - array(false, "username", false, "www.somewhere.com", 243, "/", "com", "", "anchor")); - $this->assertUrl( - "/this/that/here.php?a=1&b=2?3,4", - array(false, false, false, false, false, "/this/that/here.php", false, "?a=1&b=2", false), - array("a" => "1", "b" => "2"), - array(3, 4)); - $this->assertUrl( - "username@/here.php?a=1&b=2", - array(false, "username", false, false, false, "/here.php", false, "?a=1&b=2", false), - array("a" => "1", "b" => "2")); - } - - function testAmbiguousHosts() { - $this->assertUrl( - "tigger", - array(false, false, false, false, false, "tigger", false, "", false)); - $this->assertUrl( - "/tigger", - array(false, false, false, false, false, "/tigger", false, "", false)); - $this->assertUrl( - "//tigger", - array(false, false, false, "tigger", false, "/", false, "", false)); - $this->assertUrl( - "//tigger/", - array(false, false, false, "tigger", false, "/", false, "", false)); - $this->assertUrl( - "tigger.com", - array(false, false, false, "tigger.com", false, "/", "com", "", false)); - $this->assertUrl( - "me.net/tigger", - array(false, false, false, "me.net", false, "/tigger", "net", "", false)); - } - - function testAsString() { - $this->assertPreserved('https://www.here.com'); - $this->assertPreserved('http://me:secret@www.here.com'); - $this->assertPreserved('http://here/there'); - $this->assertPreserved('http://here/there?a=A&b=B'); - $this->assertPreserved('http://here/there?a=1&a=2'); - $this->assertPreserved('http://here/there?a=1&a=2?9,8'); - $this->assertPreserved('http://host?a=1&a=2'); - $this->assertPreserved('http://host#stuff'); - $this->assertPreserved('http://me:secret@www.here.com/a/b/c/here.html?a=A?7,6'); - $this->assertPreserved('http://www.here.com/?a=A__b=B'); - $this->assertPreserved('http://www.example.com:8080/'); - } - - function assertUrl($raw, $parts, $params = false, $coords = false) { - if (! is_array($params)) { - $params = array(); - } - $url = new SimpleUrl($raw); - $this->assertIdentical($url->getScheme(), $parts[0], "[$raw] scheme -> %s"); - $this->assertIdentical($url->getUsername(), $parts[1], "[$raw] username -> %s"); - $this->assertIdentical($url->getPassword(), $parts[2], "[$raw] password -> %s"); - $this->assertIdentical($url->getHost(), $parts[3], "[$raw] host -> %s"); - $this->assertIdentical($url->getPort(), $parts[4], "[$raw] port -> %s"); - $this->assertIdentical($url->getPath(), $parts[5], "[$raw] path -> %s"); - $this->assertIdentical($url->getTld(), $parts[6], "[$raw] tld -> %s"); - $this->assertIdentical($url->getEncodedRequest(), $parts[7], "[$raw] encoded -> %s"); - $this->assertIdentical($url->getFragment(), $parts[8], "[$raw] fragment -> %s"); - if ($coords) { - $this->assertIdentical($url->getX(), $coords[0], "[$raw] x -> %s"); - $this->assertIdentical($url->getY(), $coords[1], "[$raw] y -> %s"); - } - } - - function testUrlWithTwoSlashesInPath() { - $url = new SimpleUrl('/article/categoryedit/insert//'); - $this->assertEqual($url->getPath(), '/article/categoryedit/insert//'); - } - - function assertPreserved($string) { - $url = new SimpleUrl($string); - $this->assertEqual($url->asString(), $string); - } -} - -class TestOfAbsoluteUrls extends UnitTestCase { - - function testDirectoriesAfterFilename() { - $string = '../../index.php/foo/bar'; - $url = new SimpleUrl($string); - $this->assertEqual($url->asString(), $string); - - $absolute = $url->makeAbsolute('http://www.domain.com/some/path/'); - $this->assertEqual($absolute->asString(), 'http://www.domain.com/index.php/foo/bar'); - } - - function testMakingAbsolute() { - $url = new SimpleUrl('../there/somewhere.php'); - $this->assertEqual($url->getPath(), '../there/somewhere.php'); - $absolute = $url->makeAbsolute('https://host.com:1234/I/am/here/'); - $this->assertEqual($absolute->getScheme(), 'https'); - $this->assertEqual($absolute->getHost(), 'host.com'); - $this->assertEqual($absolute->getPort(), 1234); - $this->assertEqual($absolute->getPath(), '/I/am/there/somewhere.php'); - } - - function testMakingAnEmptyUrlAbsolute() { - $url = new SimpleUrl(''); - $this->assertEqual($url->getPath(), ''); - $absolute = $url->makeAbsolute('http://host.com/I/am/here/page.html'); - $this->assertEqual($absolute->getScheme(), 'http'); - $this->assertEqual($absolute->getHost(), 'host.com'); - $this->assertEqual($absolute->getPath(), '/I/am/here/page.html'); - } - - function testMakingAnEmptyUrlAbsoluteWithMissingPageName() { - $url = new SimpleUrl(''); - $this->assertEqual($url->getPath(), ''); - $absolute = $url->makeAbsolute('http://host.com/I/am/here/'); - $this->assertEqual($absolute->getScheme(), 'http'); - $this->assertEqual($absolute->getHost(), 'host.com'); - $this->assertEqual($absolute->getPath(), '/I/am/here/'); - } - - function testMakingAShortQueryUrlAbsolute() { - $url = new SimpleUrl('?a#b'); - $this->assertEqual($url->getPath(), ''); - $absolute = $url->makeAbsolute('http://host.com/I/am/here/'); - $this->assertEqual($absolute->getScheme(), 'http'); - $this->assertEqual($absolute->getHost(), 'host.com'); - $this->assertEqual($absolute->getPath(), '/I/am/here/'); - $this->assertEqual($absolute->getEncodedRequest(), '?a'); - $this->assertEqual($absolute->getFragment(), 'b'); - } - - function testMakingADirectoryUrlAbsolute() { - $url = new SimpleUrl('hello/'); - $this->assertEqual($url->getPath(), 'hello/'); - $this->assertEqual($url->getBasePath(), 'hello/'); - $this->assertEqual($url->getPage(), ''); - $absolute = $url->makeAbsolute('http://host.com/I/am/here/page.html'); - $this->assertEqual($absolute->getPath(), '/I/am/here/hello/'); - } - - function testMakingARootUrlAbsolute() { - $url = new SimpleUrl('/'); - $this->assertEqual($url->getPath(), '/'); - $absolute = $url->makeAbsolute('http://host.com/I/am/here/page.html'); - $this->assertEqual($absolute->getPath(), '/'); - } - - function testMakingARootPageUrlAbsolute() { - $url = new SimpleUrl('/here.html'); - $absolute = $url->makeAbsolute('http://host.com/I/am/here/page.html'); - $this->assertEqual($absolute->getPath(), '/here.html'); - } - - function testCarryAuthenticationFromRootPage() { - $url = new SimpleUrl('here.html'); - $absolute = $url->makeAbsolute('http://test:secret@host.com/'); - $this->assertEqual($absolute->getPath(), '/here.html'); - $this->assertEqual($absolute->getUsername(), 'test'); - $this->assertEqual($absolute->getPassword(), 'secret'); - } - - function testMakingCoordinateUrlAbsolute() { - $url = new SimpleUrl('?1,2'); - $this->assertEqual($url->getPath(), ''); - $absolute = $url->makeAbsolute('http://host.com/I/am/here/'); - $this->assertEqual($absolute->getScheme(), 'http'); - $this->assertEqual($absolute->getHost(), 'host.com'); - $this->assertEqual($absolute->getPath(), '/I/am/here/'); - $this->assertEqual($absolute->getX(), 1); - $this->assertEqual($absolute->getY(), 2); - } - - function testMakingAbsoluteAppendedPath() { - $url = new SimpleUrl('./there/somewhere.php'); - $absolute = $url->makeAbsolute('https://host.com/here/'); - $this->assertEqual($absolute->getPath(), '/here/there/somewhere.php'); - } - - function testMakingAbsoluteBadlyFormedAppendedPath() { - $url = new SimpleUrl('there/somewhere.php'); - $absolute = $url->makeAbsolute('https://host.com/here/'); - $this->assertEqual($absolute->getPath(), '/here/there/somewhere.php'); - } - - function testMakingAbsoluteHasNoEffectWhenAlreadyAbsolute() { - $url = new SimpleUrl('https://test:secret@www.lastcraft.com:321/stuff/?a=1#f'); - $absolute = $url->makeAbsolute('http://host.com/here/'); - $this->assertEqual($absolute->getScheme(), 'https'); - $this->assertEqual($absolute->getUsername(), 'test'); - $this->assertEqual($absolute->getPassword(), 'secret'); - $this->assertEqual($absolute->getHost(), 'www.lastcraft.com'); - $this->assertEqual($absolute->getPort(), 321); - $this->assertEqual($absolute->getPath(), '/stuff/'); - $this->assertEqual($absolute->getEncodedRequest(), '?a=1'); - $this->assertEqual($absolute->getFragment(), 'f'); - } - - function testMakingAbsoluteCarriesAuthenticationWhenAlreadyAbsolute() { - $url = new SimpleUrl('https://www.lastcraft.com'); - $absolute = $url->makeAbsolute('http://test:secret@host.com/here/'); - $this->assertEqual($absolute->getHost(), 'www.lastcraft.com'); - $this->assertEqual($absolute->getUsername(), 'test'); - $this->assertEqual($absolute->getPassword(), 'secret'); - } - - function testMakingHostOnlyAbsoluteDoesNotCarryAnyOtherInformation() { - $url = new SimpleUrl('http://www.lastcraft.com'); - $absolute = $url->makeAbsolute('https://host.com:81/here/'); - $this->assertEqual($absolute->getScheme(), 'http'); - $this->assertEqual($absolute->getHost(), 'www.lastcraft.com'); - $this->assertIdentical($absolute->getPort(), false); - $this->assertEqual($absolute->getPath(), '/'); - } -} - -class TestOfFrameUrl extends UnitTestCase { - - function testTargetAttachment() { - $url = new SimpleUrl('http://www.site.com/home.html'); - $this->assertIdentical($url->getTarget(), false); - $url->setTarget('A frame'); - $this->assertIdentical($url->getTarget(), 'A frame'); - } -} - -/** - * @note Based off of http://www.mozilla.org/quality/networking/testing/filetests.html - */ -class TestOfFileUrl extends UnitTestCase { - - function testMinimalUrl() { - $url = new SimpleUrl('file:///'); - $this->assertEqual($url->getScheme(), 'file'); - $this->assertIdentical($url->getHost(), false); - $this->assertEqual($url->getPath(), '/'); - } - - function testUnixUrl() { - $url = new SimpleUrl('file:///fileInRoot'); - $this->assertEqual($url->getScheme(), 'file'); - $this->assertIdentical($url->getHost(), false); - $this->assertEqual($url->getPath(), '/fileInRoot'); - } - - function testDOSVolumeUrl() { - $url = new SimpleUrl('file:///C:/config.sys'); - $this->assertEqual($url->getScheme(), 'file'); - $this->assertIdentical($url->getHost(), false); - $this->assertEqual($url->getPath(), '/C:/config.sys'); - } - - function testDOSVolumePromotion() { - $url = new SimpleUrl('file://C:/config.sys'); - $this->assertEqual($url->getScheme(), 'file'); - $this->assertIdentical($url->getHost(), false); - $this->assertEqual($url->getPath(), '/C:/config.sys'); - } - - function testDOSBackslashes() { - $url = new SimpleUrl('file:///C:\config.sys'); - $this->assertEqual($url->getScheme(), 'file'); - $this->assertIdentical($url->getHost(), false); - $this->assertEqual($url->getPath(), '/C:/config.sys'); - } - - function testDOSDirnameAfterFile() { - $url = new SimpleUrl('file://C:\config.sys'); - $this->assertEqual($url->getScheme(), 'file'); - $this->assertIdentical($url->getHost(), false); - $this->assertEqual($url->getPath(), '/C:/config.sys'); - } - -} - -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/user_agent_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/user_agent_test.php deleted file mode 100644 index 030abeb..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/user_agent_test.php +++ /dev/null @@ -1,348 +0,0 @@ -headers = new MockSimpleHttpHeaders(); - $this->response = new MockSimpleHttpResponse(); - $this->response->setReturnValue('isError', false); - $this->response->returns('getHeaders', new MockSimpleHttpHeaders()); - $this->request = new MockSimpleHttpRequest(); - $this->request->returns('fetch', $this->response); - } - - function testGetRequestWithoutIncidentGivesNoErrors() { - $url = new SimpleUrl('http://test:secret@this.com/page.html'); - $url->addRequestParameters(array('a' => 'A', 'b' => 'B')); - - $agent = new MockRequestUserAgent(); - $agent->returns('createHttpRequest', $this->request); - $agent->__construct(); - - $response = $agent->fetchResponse( - new SimpleUrl('http://test:secret@this.com/page.html'), - new SimpleGetEncoding(array('a' => 'A', 'b' => 'B'))); - $this->assertFalse($response->isError()); - } -} - -class TestOfAdditionalHeaders extends UnitTestCase { - - function testAdditionalHeaderAddedToRequest() { - $response = new MockSimpleHttpResponse(); - $response->setReturnReference('getHeaders', new MockSimpleHttpHeaders()); - - $request = new MockSimpleHttpRequest(); - $request->setReturnReference('fetch', $response); - $request->expectOnce( - 'addHeaderLine', - array('User-Agent: SimpleTest')); - - $agent = new MockRequestUserAgent(); - $agent->setReturnReference('createHttpRequest', $request); - $agent->__construct(); - $agent->addHeader('User-Agent: SimpleTest'); - $response = $agent->fetchResponse(new SimpleUrl('http://this.host/'), new SimpleGetEncoding()); - } -} - -class TestOfBrowserCookies extends UnitTestCase { - - private function createStandardResponse() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue("isError", false); - $response->setReturnValue("getContent", "stuff"); - $response->setReturnReference("getHeaders", new MockSimpleHttpHeaders()); - return $response; - } - - private function createCookieSite($header_lines) { - $headers = new SimpleHttpHeaders($header_lines); - $response = new MockSimpleHttpResponse(); - $response->setReturnValue("isError", false); - $response->setReturnReference("getHeaders", $headers); - $response->setReturnValue("getContent", "stuff"); - $request = new MockSimpleHttpRequest(); - $request->setReturnReference("fetch", $response); - return $request; - } - - private function createMockedRequestUserAgent(&$request) { - $agent = new MockRequestUserAgent(); - $agent->setReturnReference('createHttpRequest', $request); - $agent->__construct(); - return $agent; - } - - function testCookieJarIsSentToRequest() { - $jar = new SimpleCookieJar(); - $jar->setCookie('a', 'A'); - - $request = new MockSimpleHttpRequest(); - $request->returns('fetch', $this->createStandardResponse()); - $request->expectOnce('readCookiesFromJar', array($jar, '*')); - - $agent = $this->createMockedRequestUserAgent($request); - $agent->setCookie('a', 'A'); - $agent->fetchResponse( - new SimpleUrl('http://this.com/this/path/page.html'), - new SimpleGetEncoding()); - } - - function testNoCookieJarIsSentToRequestWhenCookiesAreDisabled() { - $request = new MockSimpleHttpRequest(); - $request->returns('fetch', $this->createStandardResponse()); - $request->expectNever('readCookiesFromJar'); - - $agent = $this->createMockedRequestUserAgent($request); - $agent->setCookie('a', 'A'); - $agent->ignoreCookies(); - $agent->fetchResponse( - new SimpleUrl('http://this.com/this/path/page.html'), - new SimpleGetEncoding()); - } - - function testReadingNewCookie() { - $request = $this->createCookieSite('Set-cookie: a=AAAA'); - $agent = $this->createMockedRequestUserAgent($request); - $agent->fetchResponse( - new SimpleUrl('http://this.com/this/path/page.html'), - new SimpleGetEncoding()); - $this->assertEqual($agent->getCookieValue("this.com", "this/path/", "a"), "AAAA"); - } - - function testIgnoringNewCookieWhenCookiesDisabled() { - $request = $this->createCookieSite('Set-cookie: a=AAAA'); - $agent = $this->createMockedRequestUserAgent($request); - $agent->ignoreCookies(); - $agent->fetchResponse( - new SimpleUrl('http://this.com/this/path/page.html'), - new SimpleGetEncoding()); - $this->assertIdentical($agent->getCookieValue("this.com", "this/path/", "a"), false); - } - - function testOverwriteCookieThatAlreadyExists() { - $request = $this->createCookieSite('Set-cookie: a=AAAA'); - $agent = $this->createMockedRequestUserAgent($request); - $agent->setCookie('a', 'A'); - $agent->fetchResponse( - new SimpleUrl('http://this.com/this/path/page.html'), - new SimpleGetEncoding()); - $this->assertEqual($agent->getCookieValue("this.com", "this/path/", "a"), "AAAA"); - } - - function testClearCookieBySettingExpiry() { - $request = $this->createCookieSite('Set-cookie: a=b'); - $agent = $this->createMockedRequestUserAgent($request); - - $agent->setCookie("a", "A", "this/path/", "Wed, 25-Dec-02 04:24:21 GMT"); - $agent->fetchResponse( - new SimpleUrl('http://this.com/this/path/page.html'), - new SimpleGetEncoding()); - $this->assertIdentical( - $agent->getCookieValue("this.com", "this/path/", "a"), - "b"); - $agent->restart("Wed, 25-Dec-02 04:24:20 GMT"); - $this->assertIdentical( - $agent->getCookieValue("this.com", "this/path/", "a"), - false); - } - - function testAgeingAndClearing() { - $request = $this->createCookieSite('Set-cookie: a=A; expires=Wed, 25-Dec-02 04:24:21 GMT; path=/this/path'); - $agent = $this->createMockedRequestUserAgent($request); - - $agent->fetchResponse( - new SimpleUrl('http://this.com/this/path/page.html'), - new SimpleGetEncoding()); - $agent->restart("Wed, 25-Dec-02 04:24:20 GMT"); - $this->assertIdentical( - $agent->getCookieValue("this.com", "this/path/", "a"), - "A"); - $agent->ageCookies(2); - $agent->restart("Wed, 25-Dec-02 04:24:20 GMT"); - $this->assertIdentical( - $agent->getCookieValue("this.com", "this/path/", "a"), - false); - } - - function testReadingIncomingAndSettingNewCookies() { - $request = $this->createCookieSite('Set-cookie: a=AAA'); - $agent = $this->createMockedRequestUserAgent($request); - - $this->assertNull($agent->getBaseCookieValue("a", false)); - $agent->fetchResponse( - new SimpleUrl('http://this.com/this/path/page.html'), - new SimpleGetEncoding()); - $agent->setCookie("b", "BBB", "this.com", "this/path/"); - $this->assertEqual( - $agent->getBaseCookieValue("a", new SimpleUrl('http://this.com/this/path/page.html')), - "AAA"); - $this->assertEqual( - $agent->getBaseCookieValue("b", new SimpleUrl('http://this.com/this/path/page.html')), - "BBB"); - } -} - -class TestOfHttpRedirects extends UnitTestCase { - - function createRedirect($content, $redirect) { - $headers = new MockSimpleHttpHeaders(); - $headers->setReturnValue('isRedirect', (boolean)$redirect); - $headers->setReturnValue('getLocation', $redirect); - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('getContent', $content); - $response->setReturnReference('getHeaders', $headers); - $request = new MockSimpleHttpRequest(); - $request->setReturnReference('fetch', $response); - return $request; - } - - function testDisabledRedirects() { - $agent = new MockRequestUserAgent(); - $agent->returns( - 'createHttpRequest', - $this->createRedirect('stuff', 'there.html')); - $agent->expectOnce('createHttpRequest'); - $agent->__construct(); - $agent->setMaximumRedirects(0); - $response = $agent->fetchResponse(new SimpleUrl('here.html'), new SimpleGetEncoding()); - $this->assertEqual($response->getContent(), 'stuff'); - } - - function testSingleRedirect() { - $agent = new MockRequestUserAgent(); - $agent->returnsAt( - 0, - 'createHttpRequest', - $this->createRedirect('first', 'two.html')); - $agent->returnsAt( - 1, - 'createHttpRequest', - $this->createRedirect('second', 'three.html')); - $agent->expectCallCount('createHttpRequest', 2); - $agent->__construct(); - - $agent->setMaximumRedirects(1); - $response = $agent->fetchResponse(new SimpleUrl('one.html'), new SimpleGetEncoding()); - $this->assertEqual($response->getContent(), 'second'); - } - - function testDoubleRedirect() { - $agent = new MockRequestUserAgent(); - $agent->returnsAt( - 0, - 'createHttpRequest', - $this->createRedirect('first', 'two.html')); - $agent->returnsAt( - 1, - 'createHttpRequest', - $this->createRedirect('second', 'three.html')); - $agent->returnsAt( - 2, - 'createHttpRequest', - $this->createRedirect('third', 'four.html')); - $agent->expectCallCount('createHttpRequest', 3); - $agent->__construct(); - - $agent->setMaximumRedirects(2); - $response = $agent->fetchResponse(new SimpleUrl('one.html'), new SimpleGetEncoding()); - $this->assertEqual($response->getContent(), 'third'); - } - - function testSuccessAfterRedirect() { - $agent = new MockRequestUserAgent(); - $agent->returnsAt( - 0, - 'createHttpRequest', - $this->createRedirect('first', 'two.html')); - $agent->returnsAt( - 1, - 'createHttpRequest', - $this->createRedirect('second', false)); - $agent->returnsAt( - 2, - 'createHttpRequest', - $this->createRedirect('third', 'four.html')); - $agent->expectCallCount('createHttpRequest', 2); - $agent->__construct(); - - $agent->setMaximumRedirects(2); - $response = $agent->fetchResponse(new SimpleUrl('one.html'), new SimpleGetEncoding()); - $this->assertEqual($response->getContent(), 'second'); - } - - function testRedirectChangesPostToGet() { - $agent = new MockRequestUserAgent(); - $agent->returnsAt( - 0, - 'createHttpRequest', - $this->createRedirect('first', 'two.html')); - $agent->expectAt(0, 'createHttpRequest', array('*', new IsAExpectation('SimplePostEncoding'))); - $agent->returnsAt( - 1, - 'createHttpRequest', - $this->createRedirect('second', 'three.html')); - $agent->expectAt(1, 'createHttpRequest', array('*', new IsAExpectation('SimpleGetEncoding'))); - $agent->expectCallCount('createHttpRequest', 2); - $agent->__construct(); - $agent->setMaximumRedirects(1); - $response = $agent->fetchResponse(new SimpleUrl('one.html'), new SimplePostEncoding()); - } -} - -class TestOfBadHosts extends UnitTestCase { - - private function createSimulatedBadHost() { - $response = new MockSimpleHttpResponse(); - $response->setReturnValue('isError', true); - $response->setReturnValue('getError', 'Bad socket'); - $response->setReturnValue('getContent', false); - $request = new MockSimpleHttpRequest(); - $request->setReturnReference('fetch', $response); - return $request; - } - - function testUntestedHost() { - $request = $this->createSimulatedBadHost(); - $agent = new MockRequestUserAgent(); - $agent->setReturnReference('createHttpRequest', $request); - $agent->__construct(); - $response = $agent->fetchResponse( - new SimpleUrl('http://this.host/this/path/page.html'), - new SimpleGetEncoding()); - $this->assertTrue($response->isError()); - } -} - -class TestOfAuthorisation extends UnitTestCase { - - function testAuthenticateHeaderAdded() { - $response = new MockSimpleHttpResponse(); - $response->setReturnReference('getHeaders', new MockSimpleHttpHeaders()); - - $request = new MockSimpleHttpRequest(); - $request->returns('fetch', $response); - $request->expectOnce( - 'addHeaderLine', - array('Authorization: Basic ' . base64_encode('test:secret'))); - - $agent = new MockRequestUserAgent(); - $agent->returns('createHttpRequest', $request); - $agent->__construct(); - $response = $agent->fetchResponse( - new SimpleUrl('http://test:secret@this.host'), - new SimpleGetEncoding()); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/utf8_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/utf8_test.php deleted file mode 100644 index 8dc8f81..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/utf8_test.php +++ /dev/null @@ -1,78 +0,0 @@ -addPattern("eé"); - $this->assertTrue($regex->match("eéêè", $match)); - $this->assertEqual($match, "eé"); - } - - function testWithTextInLatin1() { - $regex = &new ParallelRegex(false); - $regex->addPattern(utf8_decode("eé")); - $this->assertTrue($regex->match(utf8_decode("eéêè"), $match)); - $this->assertEqual($match, utf8_decode("eé")); - } - - function &createParser() { - $parser = &new MockSimpleHtmlSaxParser(); - $parser->setReturnValue('acceptStartToken', true); - $parser->setReturnValue('acceptEndToken', true); - $parser->setReturnValue('acceptAttributeToken', true); - $parser->setReturnValue('acceptEntityToken', true); - $parser->setReturnValue('acceptTextToken', true); - $parser->setReturnValue('ignore', true); - return $parser; - } - - function testTagWithAttributesInUTF8() { - $parser = &$this->createParser(); - $parser->expectOnce('acceptTextToken', array('label', '*')); - $parser->expectAt(0, 'acceptStartToken', array('expectAt(1, 'acceptStartToken', array('href', '*')); - $parser->expectAt(2, 'acceptStartToken', array('>', '*')); - $parser->expectCallCount('acceptStartToken', 3); - $parser->expectAt(0, 'acceptAttributeToken', array('= "', '*')); - $parser->expectAt(1, 'acceptAttributeToken', array('hère.html', '*')); - $parser->expectAt(2, 'acceptAttributeToken', array('"', '*')); - $parser->expectCallCount('acceptAttributeToken', 3); - $parser->expectOnce('acceptEndToken', array('', '*')); - $lexer = &new SimpleHtmlLexer($parser); - $this->assertTrue($lexer->parse('label')); - } - - function testTagWithAttributesInLatin1() { - $parser = &$this->createParser(); - $parser->expectOnce('acceptTextToken', array('label', '*')); - $parser->expectAt(0, 'acceptStartToken', array('expectAt(1, 'acceptStartToken', array('href', '*')); - $parser->expectAt(2, 'acceptStartToken', array('>', '*')); - $parser->expectCallCount('acceptStartToken', 3); - $parser->expectAt(0, 'acceptAttributeToken', array('= "', '*')); - $parser->expectAt(1, 'acceptAttributeToken', array(utf8_decode('hère.html'), '*')); - $parser->expectAt(2, 'acceptAttributeToken', array('"', '*')); - $parser->expectCallCount('acceptAttributeToken', 3); - $parser->expectOnce('acceptEndToken', array('', '*')); - $lexer = &new SimpleHtmlLexer($parser); - $this->assertTrue($lexer->parse(utf8_decode('label'))); - } -} - -class TestOfUrlithDifferentCharset extends UnitTestCase { - function testUsernameAndPasswordInUTF8() { - $url = new SimpleUrl('http://pÈrick:penËt@www.lastcraft.com'); - $this->assertEqual($url->getUsername(), 'pÈrick'); - $this->assertEqual($url->getPassword(), 'penËt'); - } -} - -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/visual/visual_errors.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/visual/visual_errors.php deleted file mode 100644 index 15c0ebf..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/visual/visual_errors.php +++ /dev/null @@ -1,65 +0,0 @@ -dump('Four exceptions...'); - trigger_error('Default'); - trigger_error('Error', E_USER_ERROR); - trigger_error('Warning', E_USER_WARNING); - trigger_error('Notice', E_USER_NOTICE); - } - - function testErrorTrap() { - $this->dump('Pass...'); - $this->expectError(); - trigger_error('Error'); - } - - function testUnusedErrorExpectationsCauseFailures() { - $this->dump('Two failures...'); - $this->expectError('Some error'); - $this->expectError(); - } - - function testErrorTextIsSentImmediately() { - $this->dump('One failure...'); - $this->expectError('Error'); - trigger_error('Error almost'); - $this->dump('This should lie between the two errors'); - trigger_error('Error after'); - } -} - -class VisualTestOfExceptions extends UnitTestCase { - function skip() { - $this->skipUnless(version_compare(phpversion(), '5') >= 0); - } - - function testExceptionTrap() { - $this->dump('One exception...'); - $this->ouch(); - $this->fail('Should not be here'); - } - - function testExceptionExpectationShowsErrorWhenNoException() { - $this->dump('One failure...'); - $this->expectException('SomeException'); - $this->expectException('LaterException'); - } - - function testExceptionExpectationShowsPassWhenException() { - $this->dump('Pass...'); - $this->expectException(); - $this->ouch(); - } - - function ouch() { - eval('throw new Exception("Ouch!");'); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/visual_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/visual_test.php deleted file mode 100644 index 5bde610..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/visual_test.php +++ /dev/null @@ -1,495 +0,0 @@ -a = $a; - } - } - - class PassingUnitTestCaseOutput extends UnitTestCase { - - function testOfResults() { - $this->pass('Pass'); - } - - function testTrue() { - $this->assertTrue(true); - } - - function testFalse() { - $this->assertFalse(false); - } - - function testExpectation() { - $expectation = &new EqualExpectation(25, 'My expectation message: %s'); - $this->assert($expectation, 25, 'My assert message : %s'); - } - - function testNull() { - $this->assertNull(null, "%s -> Pass"); - $this->assertNotNull(false, "%s -> Pass"); - } - - function testType() { - $this->assertIsA("hello", "string", "%s -> Pass"); - $this->assertIsA($this, "PassingUnitTestCaseOutput", "%s -> Pass"); - $this->assertIsA($this, "UnitTestCase", "%s -> Pass"); - } - - function testTypeEquality() { - $this->assertEqual("0", 0, "%s -> Pass"); - } - - function testNullEquality() { - $this->assertNotEqual(null, 1, "%s -> Pass"); - $this->assertNotEqual(1, null, "%s -> Pass"); - } - - function testIntegerEquality() { - $this->assertNotEqual(1, 2, "%s -> Pass"); - } - - function testStringEquality() { - $this->assertEqual("a", "a", "%s -> Pass"); - $this->assertNotEqual("aa", "ab", "%s -> Pass"); - } - - function testHashEquality() { - $this->assertEqual(array("a" => "A", "b" => "B"), array("b" => "B", "a" => "A"), "%s -> Pass"); - } - - function testWithin() { - $this->assertWithinMargin(5, 5.4, 0.5, "%s -> Pass"); - } - - function testOutside() { - $this->assertOutsideMargin(5, 5.6, 0.5, "%s -> Pass"); - } - - function testStringIdentity() { - $a = "fred"; - $b = $a; - $this->assertIdentical($a, $b, "%s -> Pass"); - } - - function testTypeIdentity() { - $a = "0"; - $b = 0; - $this->assertNotIdentical($a, $b, "%s -> Pass"); - } - - function testNullIdentity() { - $this->assertNotIdentical(null, 1, "%s -> Pass"); - $this->assertNotIdentical(1, null, "%s -> Pass"); - } - - function testHashIdentity() { - } - - function testObjectEquality() { - $this->assertEqual(new TestDisplayClass(4), new TestDisplayClass(4), "%s -> Pass"); - $this->assertNotEqual(new TestDisplayClass(4), new TestDisplayClass(5), "%s -> Pass"); - } - - function testObjectIndentity() { - $this->assertIdentical(new TestDisplayClass(false), new TestDisplayClass(false), "%s -> Pass"); - $this->assertNotIdentical(new TestDisplayClass(false), new TestDisplayClass(0), "%s -> Pass"); - } - - function testReference() { - $a = "fred"; - $b = &$a; - $this->assertReference($a, $b, "%s -> Pass"); - } - - function testCloneOnDifferentObjects() { - $a = "fred"; - $b = $a; - $c = "Hello"; - $this->assertClone($a, $b, "%s -> Pass"); - } - - function testPatterns() { - $this->assertPattern('/hello/i', "Hello there", "%s -> Pass"); - $this->assertNoPattern('/hello/', "Hello there", "%s -> Pass"); - } - - function testLongStrings() { - $text = ""; - for ($i = 0; $i < 10; $i++) { - $text .= "0123456789"; - } - $this->assertEqual($text, $text); - } - } - - class FailingUnitTestCaseOutput extends UnitTestCase { - - function testOfResults() { - $this->fail('Fail'); // Fail. - } - - function testTrue() { - $this->assertTrue(false); // Fail. - } - - function testFalse() { - $this->assertFalse(true); // Fail. - } - - function testExpectation() { - $expectation = &new EqualExpectation(25, 'My expectation message: %s'); - $this->assert($expectation, 24, 'My assert message : %s'); // Fail. - } - - function testNull() { - $this->assertNull(false, "%s -> Fail"); // Fail. - $this->assertNotNull(null, "%s -> Fail"); // Fail. - } - - function testType() { - $this->assertIsA(14, "string", "%s -> Fail"); // Fail. - $this->assertIsA(14, "TestOfUnitTestCaseOutput", "%s -> Fail"); // Fail. - $this->assertIsA($this, "TestReporter", "%s -> Fail"); // Fail. - } - - function testTypeEquality() { - $this->assertNotEqual("0", 0, "%s -> Fail"); // Fail. - } - - function testNullEquality() { - $this->assertEqual(null, 1, "%s -> Fail"); // Fail. - $this->assertEqual(1, null, "%s -> Fail"); // Fail. - } - - function testIntegerEquality() { - $this->assertEqual(1, 2, "%s -> Fail"); // Fail. - } - - function testStringEquality() { - $this->assertNotEqual("a", "a", "%s -> Fail"); // Fail. - $this->assertEqual("aa", "ab", "%s -> Fail"); // Fail. - } - - function testHashEquality() { - $this->assertEqual(array("a" => "A", "b" => "B"), array("b" => "B", "a" => "Z"), "%s -> Fail"); - } - - function testWithin() { - $this->assertWithinMargin(5, 5.6, 0.5, "%s -> Fail"); // Fail. - } - - function testOutside() { - $this->assertOutsideMargin(5, 5.4, 0.5, "%s -> Fail"); // Fail. - } - - function testStringIdentity() { - $a = "fred"; - $b = $a; - $this->assertNotIdentical($a, $b, "%s -> Fail"); // Fail. - } - - function testTypeIdentity() { - $a = "0"; - $b = 0; - $this->assertIdentical($a, $b, "%s -> Fail"); // Fail. - } - - function testNullIdentity() { - $this->assertIdentical(null, 1, "%s -> Fail"); // Fail. - $this->assertIdentical(1, null, "%s -> Fail"); // Fail. - } - - function testHashIdentity() { - $this->assertIdentical(array("a" => "A", "b" => "B"), array("b" => "B", "a" => "A"), "%s -> fail"); // Fail. - } - - function testObjectEquality() { - $this->assertNotEqual(new TestDisplayClass(4), new TestDisplayClass(4), "%s -> Fail"); // Fail. - $this->assertEqual(new TestDisplayClass(4), new TestDisplayClass(5), "%s -> Fail"); // Fail. - } - - function testObjectIndentity() { - $this->assertNotIdentical(new TestDisplayClass(false), new TestDisplayClass(false), "%s -> Fail"); // Fail. - $this->assertIdentical(new TestDisplayClass(false), new TestDisplayClass(0), "%s -> Fail"); // Fail. - } - - function testReference() { - $a = "fred"; - $b = &$a; - $this->assertClone($a, $b, "%s -> Fail"); // Fail. - } - - function testCloneOnDifferentObjects() { - $a = "fred"; - $b = $a; - $c = "Hello"; - $this->assertClone($a, $c, "%s -> Fail"); // Fail. - } - - function testPatterns() { - $this->assertPattern('/hello/', "Hello there", "%s -> Fail"); // Fail. - $this->assertNoPattern('/hello/i', "Hello there", "%s -> Fail"); // Fail. - } - - function testLongStrings() { - $text = ""; - for ($i = 0; $i < 10; $i++) { - $text .= "0123456789"; - } - $this->assertEqual($text . $text, $text . "a" . $text); // Fail. - } -} - - class Dummy { - function Dummy() { - } - - function a() { - } - } - Mock::generate('Dummy'); - - class TestOfMockObjectsOutput extends UnitTestCase { - - function testCallCounts() { - $dummy = &new MockDummy(); - $dummy->expectCallCount('a', 1, 'My message: %s'); - $dummy->a(); - $dummy->a(); - } - - function testMinimumCallCounts() { - $dummy = &new MockDummy(); - $dummy->expectMinimumCallCount('a', 2, 'My message: %s'); - $dummy->a(); - $dummy->a(); - } - - function testEmptyMatching() { - $dummy = &new MockDummy(); - $dummy->expect('a', array()); - $dummy->a(); - $dummy->a(null); // Fail. - } - - function testEmptyMatchingWithCustomMessage() { - $dummy = &new MockDummy(); - $dummy->expect('a', array(), 'My expectation message: %s'); - $dummy->a(); - $dummy->a(null); // Fail. - } - - function testNullMatching() { - $dummy = &new MockDummy(); - $dummy->expect('a', array(null)); - $dummy->a(null); - $dummy->a(); // Fail. - } - - function testBooleanMatching() { - $dummy = &new MockDummy(); - $dummy->expect('a', array(true, false)); - $dummy->a(true, false); - $dummy->a(true, true); // Fail. - } - - function testIntegerMatching() { - $dummy = &new MockDummy(); - $dummy->expect('a', array(32, 33)); - $dummy->a(32, 33); - $dummy->a(32, 34); // Fail. - } - - function testFloatMatching() { - $dummy = &new MockDummy(); - $dummy->expect('a', array(3.2, 3.3)); - $dummy->a(3.2, 3.3); - $dummy->a(3.2, 3.4); // Fail. - } - - function testStringMatching() { - $dummy = &new MockDummy(); - $dummy->expect('a', array('32', '33')); - $dummy->a('32', '33'); - $dummy->a('32', '34'); // Fail. - } - - function testEmptyMatchingWithCustomExpectationMessage() { - $dummy = &new MockDummy(); - $dummy->expect( - 'a', - array(new EqualExpectation('A', 'My part expectation message: %s')), - 'My expectation message: %s'); - $dummy->a('A'); - $dummy->a('B'); // Fail. - } - - function testArrayMatching() { - $dummy = &new MockDummy(); - $dummy->expect('a', array(array(32), array(33))); - $dummy->a(array(32), array(33)); - $dummy->a(array(32), array('33')); // Fail. - } - - function testObjectMatching() { - $a = new Dummy(); - $a->a = 'a'; - $b = new Dummy(); - $b->b = 'b'; - $dummy = &new MockDummy(); - $dummy->expect('a', array($a, $b)); - $dummy->a($a, $b); - $dummy->a($a, $a); // Fail. - } - - function testBigList() { - $dummy = &new MockDummy(); - $dummy->expect('a', array(false, 0, 1, 1.0)); - $dummy->a(false, 0, 1, 1.0); - $dummy->a(true, false, 2, 2.0); // Fail. - } - } - - class TestOfPastBugs extends UnitTestCase { - - function testMixedTypes() { - $this->assertEqual(array(), null, "%s -> Pass"); - $this->assertIdentical(array(), null, "%s -> Fail"); // Fail. - } - - function testMockWildcards() { - $dummy = &new MockDummy(); - $dummy->expect('a', array('*', array(33))); - $dummy->a(array(32), array(33)); - $dummy->a(array(32), array('33')); // Fail. - } - } - - class TestOfVisualShell extends ShellTestCase { - - function testDump() { - $this->execute('ls'); - $this->dumpOutput(); - $this->execute('dir'); - $this->dumpOutput(); - } - - function testDumpOfList() { - $this->execute('ls'); - $this->dump($this->getOutputAsList()); - } - } - - class PassesAsWellReporter extends HtmlReporter { - - protected function getCss() { - return parent::getCss() . ' .pass { color: darkgreen; }'; - } - - function paintPass($message) { - parent::paintPass($message); - print "Pass: "; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - print implode(" -> ", $breadcrumb); - print " -> " . htmlentities($message) . "
    \n"; - } - - function paintSignal($type, &$payload) { - print "$type: "; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - print implode(" -> ", $breadcrumb); - print " -> " . htmlentities(serialize($payload)) . "
    \n"; - } - } - - class TestOfSkippingNoMatterWhat extends UnitTestCase { - function skip() { - $this->skipIf(true, 'Always skipped -> %s'); - } - - function testFail() { - $this->fail('This really shouldn\'t have happened'); - } - } - - class TestOfSkippingOrElse extends UnitTestCase { - function skip() { - $this->skipUnless(false, 'Always skipped -> %s'); - } - - function testFail() { - $this->fail('This really shouldn\'t have happened'); - } - } - - class TestOfSkippingTwiceOver extends UnitTestCase { - function skip() { - $this->skipIf(true, 'First reason -> %s'); - $this->skipIf(true, 'Second reason -> %s'); - } - - function testFail() { - $this->fail('This really shouldn\'t have happened'); - } - } - - class TestThatShouldNotBeSkipped extends UnitTestCase { - function skip() { - $this->skipIf(false); - $this->skipUnless(true); - } - - function testFail() { - $this->fail('We should see this message'); - } - - function testPass() { - $this->pass('We should see this message'); - } - } - - $test = &new TestSuite('Visual test with 46 passes, 47 fails and 0 exceptions'); - $test->add(new PassingUnitTestCaseOutput()); - $test->add(new FailingUnitTestCaseOutput()); - $test->add(new TestOfMockObjectsOutput()); - $test->add(new TestOfPastBugs()); - $test->add(new TestOfVisualShell()); - $test->add(new TestOfSkippingNoMatterWhat()); - $test->add(new TestOfSkippingOrElse()); - $test->add(new TestOfSkippingTwiceOver()); - $test->add(new TestThatShouldNotBeSkipped()); - - if (isset($_GET['xml']) || in_array('xml', (isset($argv) ? $argv : array()))) { - $reporter = new XmlReporter(); - } elseif (TextReporter::inCli()) { - $reporter = new TextReporter(); - } else { - $reporter = new PassesAsWellReporter(); - } - if (isset($_GET['dry']) || in_array('dry', (isset($argv) ? $argv : array()))) { - $reporter->makeDry(); - } - exit ($test->run($reporter) ? 0 : 1); -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/web_tester_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/web_tester_test.php deleted file mode 100644 index 8c3bf1a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/web_tester_test.php +++ /dev/null @@ -1,155 +0,0 @@ -assertTrue($expectation->test('a')); - $this->assertTrue($expectation->test(array('a'))); - $this->assertFalse($expectation->test('A')); - } - - function testMatchesInteger() { - $expectation = new FieldExpectation('1'); - $this->assertTrue($expectation->test('1')); - $this->assertTrue($expectation->test(1)); - $this->assertTrue($expectation->test(array('1'))); - $this->assertTrue($expectation->test(array(1))); - } - - function testNonStringFailsExpectation() { - $expectation = new FieldExpectation('a'); - $this->assertFalse($expectation->test(null)); - } - - function testUnsetFieldCanBeTestedFor() { - $expectation = new FieldExpectation(false); - $this->assertTrue($expectation->test(false)); - } - - function testMultipleValuesCanBeInAnyOrder() { - $expectation = new FieldExpectation(array('a', 'b')); - $this->assertTrue($expectation->test(array('a', 'b'))); - $this->assertTrue($expectation->test(array('b', 'a'))); - $this->assertFalse($expectation->test(array('a', 'a'))); - $this->assertFalse($expectation->test('a')); - } - - function testSingleItemCanBeArrayOrString() { - $expectation = new FieldExpectation(array('a')); - $this->assertTrue($expectation->test(array('a'))); - $this->assertTrue($expectation->test('a')); - } -} - -class TestOfHeaderExpectations extends UnitTestCase { - - function testExpectingOnlyTheHeaderName() { - $expectation = new HttpHeaderExpectation('a'); - $this->assertIdentical($expectation->test(false), false); - $this->assertIdentical($expectation->test('a: A'), true); - $this->assertIdentical($expectation->test('A: A'), true); - $this->assertIdentical($expectation->test('a: B'), true); - $this->assertIdentical($expectation->test(' a : A '), true); - } - - function testHeaderValueAsWell() { - $expectation = new HttpHeaderExpectation('a', 'A'); - $this->assertIdentical($expectation->test(false), false); - $this->assertIdentical($expectation->test('a: A'), true); - $this->assertIdentical($expectation->test('A: A'), true); - $this->assertIdentical($expectation->test('A: a'), false); - $this->assertIdentical($expectation->test('a: B'), false); - $this->assertIdentical($expectation->test(' a : A '), true); - $this->assertIdentical($expectation->test(' a : AB '), false); - } - - function testHeaderValueWithColons() { - $expectation = new HttpHeaderExpectation('a', 'A:B:C'); - $this->assertIdentical($expectation->test('a: A'), false); - $this->assertIdentical($expectation->test('a: A:B'), false); - $this->assertIdentical($expectation->test('a: A:B:C'), true); - $this->assertIdentical($expectation->test('a: A:B:C:D'), false); - } - - function testMultilineSearch() { - $expectation = new HttpHeaderExpectation('a', 'A'); - $this->assertIdentical($expectation->test("aa: A\r\nb: B\r\nc: C"), false); - $this->assertIdentical($expectation->test("aa: A\r\na: A\r\nb: B"), true); - } - - function testMultilineSearchWithPadding() { - $expectation = new HttpHeaderExpectation('a', ' A '); - $this->assertIdentical($expectation->test("aa:A\r\nb:B\r\nc:C"), false); - $this->assertIdentical($expectation->test("aa:A\r\na:A\r\nb:B"), true); - } - - function testPatternMatching() { - $expectation = new HttpHeaderExpectation('a', new PatternExpectation('/A/')); - $this->assertIdentical($expectation->test('a: A'), true); - $this->assertIdentical($expectation->test('A: A'), true); - $this->assertIdentical($expectation->test('A: a'), false); - $this->assertIdentical($expectation->test('a: B'), false); - $this->assertIdentical($expectation->test(' a : A '), true); - $this->assertIdentical($expectation->test(' a : AB '), true); - } - - function testCaseInsensitivePatternMatching() { - $expectation = new HttpHeaderExpectation('a', new PatternExpectation('/A/i')); - $this->assertIdentical($expectation->test('a: a'), true); - $this->assertIdentical($expectation->test('a: B'), false); - $this->assertIdentical($expectation->test(' a : A '), true); - $this->assertIdentical($expectation->test(' a : BAB '), true); - $this->assertIdentical($expectation->test(' a : bab '), true); - } - - function testUnwantedHeader() { - $expectation = new NoHttpHeaderExpectation('a'); - $this->assertIdentical($expectation->test(''), true); - $this->assertIdentical($expectation->test('stuff'), true); - $this->assertIdentical($expectation->test('b: B'), true); - $this->assertIdentical($expectation->test('a: A'), false); - $this->assertIdentical($expectation->test('A: A'), false); - } - - function testMultilineUnwantedSearch() { - $expectation = new NoHttpHeaderExpectation('a'); - $this->assertIdentical($expectation->test("aa:A\r\nb:B\r\nc:C"), true); - $this->assertIdentical($expectation->test("aa:A\r\na:A\r\nb:B"), false); - } - - function testLocationHeaderSplitsCorrectly() { - $expectation = new HttpHeaderExpectation('Location', 'http://here/'); - $this->assertIdentical($expectation->test('Location: http://here/'), true); - } -} - -class TestOfTextExpectations extends UnitTestCase { - - function testMatchingSubString() { - $expectation = new TextExpectation('wanted'); - $this->assertIdentical($expectation->test(''), false); - $this->assertIdentical($expectation->test('Wanted'), false); - $this->assertIdentical($expectation->test('wanted'), true); - $this->assertIdentical($expectation->test('the wanted text is here'), true); - } - - function testNotMatchingSubString() { - $expectation = new NoTextExpectation('wanted'); - $this->assertIdentical($expectation->test(''), true); - $this->assertIdentical($expectation->test('Wanted'), true); - $this->assertIdentical($expectation->test('wanted'), false); - $this->assertIdentical($expectation->test('the wanted text is here'), false); - } -} - -class TestOfGenericAssertionsInWebTester extends WebTestCase { - function testEquality() { - $this->assertEqual('a', 'a'); - $this->assertNotEqual('a', 'A'); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/xml_test.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/xml_test.php deleted file mode 100644 index f99e0dc..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test/xml_test.php +++ /dev/null @@ -1,187 +0,0 @@ - 2)); - $this->assertEqual($nesting->getSize(), 2); - } -} - -class TestOfXmlStructureParsing extends UnitTestCase { - function testValidXml() { - $listener = new MockSimpleScorer(); - $listener->expectNever('paintGroupStart'); - $listener->expectNever('paintGroupEnd'); - $listener->expectNever('paintCaseStart'); - $listener->expectNever('paintCaseEnd'); - $parser = new SimpleTestXmlParser($listener); - $this->assertTrue($parser->parse("\n")); - $this->assertTrue($parser->parse("\n")); - $this->assertTrue($parser->parse("\n")); - } - - function testEmptyGroup() { - $listener = new MockSimpleScorer(); - $listener->expectOnce('paintGroupStart', array('a_group', 7)); - $listener->expectOnce('paintGroupEnd', array('a_group')); - $parser = new SimpleTestXmlParser($listener); - $parser->parse("\n"); - $parser->parse("\n"); - $this->assertTrue($parser->parse("\n")); - $this->assertTrue($parser->parse("a_group\n")); - $this->assertTrue($parser->parse("\n")); - $parser->parse("\n"); - } - - function testEmptyCase() { - $listener = new MockSimpleScorer(); - $listener->expectOnce('paintCaseStart', array('a_case')); - $listener->expectOnce('paintCaseEnd', array('a_case')); - $parser = new SimpleTestXmlParser($listener); - $parser->parse("\n"); - $parser->parse("\n"); - $this->assertTrue($parser->parse("\n")); - $this->assertTrue($parser->parse("a_case\n")); - $this->assertTrue($parser->parse("\n")); - $parser->parse("\n"); - } - - function testEmptyMethod() { - $listener = new MockSimpleScorer(); - $listener->expectOnce('paintCaseStart', array('a_case')); - $listener->expectOnce('paintCaseEnd', array('a_case')); - $listener->expectOnce('paintMethodStart', array('a_method')); - $listener->expectOnce('paintMethodEnd', array('a_method')); - $parser = new SimpleTestXmlParser($listener); - $parser->parse("\n"); - $parser->parse("\n"); - $parser->parse("\n"); - $parser->parse("a_case\n"); - $this->assertTrue($parser->parse("\n")); - $this->assertTrue($parser->parse("a_method\n")); - $this->assertTrue($parser->parse("\n")); - $parser->parse("\n"); - $parser->parse("\n"); - } - - function testNestedGroup() { - $listener = new MockSimpleScorer(); - $listener->expectAt(0, 'paintGroupStart', array('a_group', 7)); - $listener->expectAt(1, 'paintGroupStart', array('b_group', 3)); - $listener->expectCallCount('paintGroupStart', 2); - $listener->expectAt(0, 'paintGroupEnd', array('b_group')); - $listener->expectAt(1, 'paintGroupEnd', array('a_group')); - $listener->expectCallCount('paintGroupEnd', 2); - - $parser = new SimpleTestXmlParser($listener); - $parser->parse("\n"); - $parser->parse("\n"); - - $this->assertTrue($parser->parse("\n")); - $this->assertTrue($parser->parse("a_group\n")); - $this->assertTrue($parser->parse("\n")); - $this->assertTrue($parser->parse("b_group\n")); - $this->assertTrue($parser->parse("\n")); - $this->assertTrue($parser->parse("\n")); - $parser->parse("\n"); - } -} - -class AnyOldSignal { - public $stuff = true; -} - -class TestOfXmlResultsParsing extends UnitTestCase { - - function sendValidStart(&$parser) { - $parser->parse("\n"); - $parser->parse("\n"); - $parser->parse("\n"); - $parser->parse("a_case\n"); - $parser->parse("\n"); - $parser->parse("a_method\n"); - } - - function sendValidEnd(&$parser) { - $parser->parse("\n"); - $parser->parse("\n"); - $parser->parse("\n"); - } - - function testPass() { - $listener = new MockSimpleScorer(); - $listener->expectOnce('paintPass', array('a_message')); - $parser = new SimpleTestXmlParser($listener); - $this->sendValidStart($parser); - $this->assertTrue($parser->parse("a_message\n")); - $this->sendValidEnd($parser); - } - - function testFail() { - $listener = new MockSimpleScorer(); - $listener->expectOnce('paintFail', array('a_message')); - $parser = new SimpleTestXmlParser($listener); - $this->sendValidStart($parser); - $this->assertTrue($parser->parse("a_message\n")); - $this->sendValidEnd($parser); - } - - function testException() { - $listener = new MockSimpleScorer(); - $listener->expectOnce('paintError', array('a_message')); - $parser = new SimpleTestXmlParser($listener); - $this->sendValidStart($parser); - $this->assertTrue($parser->parse("a_message\n")); - $this->sendValidEnd($parser); - } - - function testSkip() { - $listener = new MockSimpleScorer(); - $listener->expectOnce('paintSkip', array('a_message')); - $parser = new SimpleTestXmlParser($listener); - $this->sendValidStart($parser); - $this->assertTrue($parser->parse("a_message\n")); - $this->sendValidEnd($parser); - } - - function testSignal() { - $signal = new AnyOldSignal(); - $signal->stuff = "Hello"; - $listener = new MockSimpleScorer(); - $listener->expectOnce('paintSignal', array('a_signal', $signal)); - $parser = new SimpleTestXmlParser($listener); - $this->sendValidStart($parser); - $this->assertTrue($parser->parse( - "\n")); - $this->sendValidEnd($parser); - } - - function testMessage() { - $listener = new MockSimpleScorer(); - $listener->expectOnce('paintMessage', array('a_message')); - $parser = new SimpleTestXmlParser($listener); - $this->sendValidStart($parser); - $this->assertTrue($parser->parse("a_message\n")); - $this->sendValidEnd($parser); - } - - function testFormattedMessage() { - $listener = new MockSimpleScorer(); - $listener->expectOnce('paintFormattedMessage', array("\na\tmessage\n")); - $parser = new SimpleTestXmlParser($listener); - $this->sendValidStart($parser); - $this->assertTrue($parser->parse("\n")); - $this->sendValidEnd($parser); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test_case.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test_case.php deleted file mode 100644 index 1666548..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/test_case.php +++ /dev/null @@ -1,655 +0,0 @@ -label = $label; - } - } - - /** - * Accessor for the test name for subclasses. - * @return string Name of the test. - * @access public - */ - function getLabel() { - return $this->label ? $this->label : get_class($this); - } - - /** - * This is a placeholder for skipping tests. In this - * method you place skipIf() and skipUnless() calls to - * set the skipping state. - * @access public - */ - function skip() { - } - - /** - * Will issue a message to the reporter and tell the test - * case to skip if the incoming flag is true. - * @param string $should_skip Condition causing the tests to be skipped. - * @param string $message Text of skip condition. - * @access public - */ - function skipIf($should_skip, $message = '%s') { - if ($should_skip && ! $this->should_skip) { - $this->should_skip = true; - $message = sprintf($message, 'Skipping [' . get_class($this) . ']'); - $this->reporter->paintSkip($message . $this->getAssertionLine()); - } - } - - /** - * Accessor for the private variable $_shoud_skip - * @access public - */ - function shouldSkip() { - return $this->should_skip; - } - - /** - * Will issue a message to the reporter and tell the test - * case to skip if the incoming flag is false. - * @param string $shouldnt_skip Condition causing the tests to be run. - * @param string $message Text of skip condition. - * @access public - */ - function skipUnless($shouldnt_skip, $message = false) { - $this->skipIf(! $shouldnt_skip, $message); - } - - /** - * Used to invoke the single tests. - * @return SimpleInvoker Individual test runner. - * @access public - */ - function createInvoker() { - return new SimpleExceptionTrappingInvoker( - new SimpleErrorTrappingInvoker(new SimpleInvoker($this))); - } - - /** - * Uses reflection to run every method within itself - * starting with the string "test" unless a method - * is specified. - * @param SimpleReporter $reporter Current test reporter. - * @return boolean True if all tests passed. - * @access public - */ - function run($reporter) { - $context = SimpleTest::getContext(); - $context->setTest($this); - $context->setReporter($reporter); - $this->reporter = $reporter; - $started = false; - foreach ($this->getTests() as $method) { - if ($reporter->shouldInvoke($this->getLabel(), $method)) { - $this->skip(); - if ($this->should_skip) { - break; - } - if (! $started) { - $reporter->paintCaseStart($this->getLabel()); - $started = true; - } - $invoker = $this->reporter->createInvoker($this->createInvoker()); - $invoker->before($method); - $invoker->invoke($method); - $invoker->after($method); - } - } - if ($started) { - $reporter->paintCaseEnd($this->getLabel()); - } - unset($this->reporter); - return $reporter->getStatus(); - } - - /** - * Gets a list of test names. Normally that will - * be all internal methods that start with the - * name "test". This method should be overridden - * if you want a different rule. - * @return array List of test names. - * @access public - */ - function getTests() { - $methods = array(); - foreach (get_class_methods(get_class($this)) as $method) { - if ($this->isTest($method)) { - $methods[] = $method; - } - } - return $methods; - } - - /** - * Tests to see if the method is a test that should - * be run. Currently any method that starts with 'test' - * is a candidate unless it is the constructor. - * @param string $method Method name to try. - * @return boolean True if test method. - * @access protected - */ - protected function isTest($method) { - if (strtolower(substr($method, 0, 4)) == 'test') { - return ! SimpleTestCompatibility::isA($this, strtolower($method)); - } - return false; - } - - /** - * Announces the start of the test. - * @param string $method Test method just started. - * @access public - */ - function before($method) { - $this->reporter->paintMethodStart($method); - $this->observers = array(); - } - - /** - * Sets up unit test wide variables at the start - * of each test method. To be overridden in - * actual user test cases. - * @access public - */ - function setUp() { - } - - /** - * Clears the data set in the setUp() method call. - * To be overridden by the user in actual user test cases. - * @access public - */ - function tearDown() { - } - - /** - * Announces the end of the test. Includes private clean up. - * @param string $method Test method just finished. - * @access public - */ - function after($method) { - for ($i = 0; $i < count($this->observers); $i++) { - $this->observers[$i]->atTestEnd($method, $this); - } - $this->reporter->paintMethodEnd($method); - } - - /** - * Sets up an observer for the test end. - * @param object $observer Must have atTestEnd() - * method. - * @access public - */ - function tell($observer) { - $this->observers[] = &$observer; - } - - /** - * @deprecated - */ - function pass($message = "Pass") { - if (! isset($this->reporter)) { - trigger_error('Can only make assertions within test methods'); - } - $this->reporter->paintPass( - $message . $this->getAssertionLine()); - return true; - } - - /** - * Sends a fail event with a message. - * @param string $message Message to send. - * @access public - */ - function fail($message = "Fail") { - if (! isset($this->reporter)) { - trigger_error('Can only make assertions within test methods'); - } - $this->reporter->paintFail( - $message . $this->getAssertionLine()); - return false; - } - - /** - * Formats a PHP error and dispatches it to the - * reporter. - * @param integer $severity PHP error code. - * @param string $message Text of error. - * @param string $file File error occoured in. - * @param integer $line Line number of error. - * @access public - */ - function error($severity, $message, $file, $line) { - if (! isset($this->reporter)) { - trigger_error('Can only make assertions within test methods'); - } - $this->reporter->paintError( - "Unexpected PHP error [$message] severity [$severity] in [$file line $line]"); - } - - /** - * Formats an exception and dispatches it to the - * reporter. - * @param Exception $exception Object thrown. - * @access public - */ - function exception($exception) { - $this->reporter->paintException($exception); - } - - /** - * For user defined expansion of the available messages. - * @param string $type Tag for sorting the signals. - * @param mixed $payload Extra user specific information. - */ - function signal($type, $payload) { - if (! isset($this->reporter)) { - trigger_error('Can only make assertions within test methods'); - } - $this->reporter->paintSignal($type, $payload); - } - - /** - * Runs an expectation directly, for extending the - * tests with new expectation classes. - * @param SimpleExpectation $expectation Expectation subclass. - * @param mixed $compare Value to compare. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assert($expectation, $compare, $message = '%s') { - if ($expectation->test($compare)) { - return $this->pass(sprintf( - $message, - $expectation->overlayMessage($compare, $this->reporter->getDumper()))); - } else { - return $this->fail(sprintf( - $message, - $expectation->overlayMessage($compare, $this->reporter->getDumper()))); - } - } - - /** - * Uses a stack trace to find the line of an assertion. - * @return string Line number of first assert* - * method embedded in format string. - * @access public - */ - function getAssertionLine() { - $trace = new SimpleStackTrace(array('assert', 'expect', 'pass', 'fail', 'skip')); - return $trace->traceMethod(); - } - - /** - * Sends a formatted dump of a variable to the - * test suite for those emergency debugging - * situations. - * @param mixed $variable Variable to display. - * @param string $message Message to display. - * @return mixed The original variable. - * @access public - */ - function dump($variable, $message = false) { - $dumper = $this->reporter->getDumper(); - $formatted = $dumper->dump($variable); - if ($message) { - $formatted = $message . "\n" . $formatted; - } - $this->reporter->paintFormattedMessage($formatted); - return $variable; - } - - /** - * Accessor for the number of subtests including myelf. - * @return integer Number of test cases. - * @access public - */ - function getSize() { - return 1; - } -} - -/** - * Helps to extract test cases automatically from a file. - */ -class SimpleFileLoader { - - /** - * Builds a test suite from a library of test cases. - * The new suite is composed into this one. - * @param string $test_file File name of library with - * test case classes. - * @return TestSuite The new test suite. - * @access public - */ - function load($test_file) { - $existing_classes = get_declared_classes(); - $existing_globals = get_defined_vars(); - include_once($test_file); - $new_globals = get_defined_vars(); - $this->makeFileVariablesGlobal($existing_globals, $new_globals); - $new_classes = array_diff(get_declared_classes(), $existing_classes); - if (empty($new_classes)) { - $new_classes = $this->scrapeClassesFromFile($test_file); - } - $classes = $this->selectRunnableTests($new_classes); - return $this->createSuiteFromClasses($test_file, $classes); - } - - /** - * Imports new variables into the global namespace. - * @param hash $existing Variables before the file was loaded. - * @param hash $new Variables after the file was loaded. - * @access private - */ - protected function makeFileVariablesGlobal($existing, $new) { - $globals = array_diff(array_keys($new), array_keys($existing)); - foreach ($globals as $global) { - $_GLOBALS[$global] = $new[$global]; - } - } - - /** - * Lookup classnames from file contents, in case the - * file may have been included before. - * Note: This is probably too clever by half. Figuring this - * out after a failed test case is going to be tricky for us, - * never mind the user. A test case should not be included - * twice anyway. - * @param string $test_file File name with classes. - * @access private - */ - protected function scrapeClassesFromFile($test_file) { - preg_match_all('~^\s*class\s+(\w+)(\s+(extends|implements)\s+\w+)*\s*\{~mi', - file_get_contents($test_file), - $matches ); - return $matches[1]; - } - - /** - * Calculates the incoming test cases. Skips abstract - * and ignored classes. - * @param array $candidates Candidate classes. - * @return array New classes which are test - * cases that shouldn't be ignored. - * @access public - */ - function selectRunnableTests($candidates) { - $classes = array(); - foreach ($candidates as $class) { - if (TestSuite::getBaseTestCase($class)) { - $reflection = new SimpleReflection($class); - if ($reflection->isAbstract()) { - SimpleTest::ignore($class); - } else { - $classes[] = $class; - } - } - } - return $classes; - } - - /** - * Builds a test suite from a class list. - * @param string $title Title of new group. - * @param array $classes Test classes. - * @return TestSuite Group loaded with the new - * test cases. - * @access public - */ - function createSuiteFromClasses($title, $classes) { - if (count($classes) == 0) { - $suite = new BadTestSuite($title, "No runnable test cases in [$title]"); - return $suite; - } - SimpleTest::ignoreParentsIfIgnored($classes); - $suite = new TestSuite($title); - foreach ($classes as $class) { - if (! SimpleTest::isIgnored($class)) { - $suite->add($class); - } - } - return $suite; - } -} - -/** - * This is a composite test class for combining - * test cases and other RunnableTest classes into - * a group test. - * @package SimpleTest - * @subpackage UnitTester - */ -class TestSuite { - private $label; - private $test_cases; - - /** - * Sets the name of the test suite. - * @param string $label Name sent at the start and end - * of the test. - * @access public - */ - function TestSuite($label = false) { - $this->label = $label; - $this->test_cases = array(); - } - - /** - * Accessor for the test name for subclasses. If the suite - * wraps a single test case the label defaults to the name of that test. - * @return string Name of the test. - * @access public - */ - function getLabel() { - if (! $this->label) { - return ($this->getSize() == 1) ? - get_class($this->test_cases[0]) : get_class($this); - } else { - return $this->label; - } - } - - /** - * Adds a test into the suite by instance or class. The class will - * be instantiated if it's a test suite. - * @param SimpleTestCase $test_case Suite or individual test - * case implementing the - * runnable test interface. - * @access public - */ - function add($test_case) { - if (! is_string($test_case)) { - $this->test_cases[] = $test_case; - } elseif (TestSuite::getBaseTestCase($test_case) == 'testsuite') { - $this->test_cases[] = new $test_case(); - } else { - $this->test_cases[] = $test_case; - } - } - - /** - * Builds a test suite from a library of test cases. - * The new suite is composed into this one. - * @param string $test_file File name of library with - * test case classes. - * @access public - */ - function addFile($test_file) { - $extractor = new SimpleFileLoader(); - $this->add($extractor->load($test_file)); - } - - /** - * Delegates to a visiting collector to add test - * files. - * @param string $path Path to scan from. - * @param SimpleCollector $collector Directory scanner. - * @access public - */ - function collect($path, $collector) { - $collector->collect($this, $path); - } - - /** - * Invokes run() on all of the held test cases, instantiating - * them if necessary. - * @param SimpleReporter $reporter Current test reporter. - * @access public - */ - function run($reporter) { - $reporter->paintGroupStart($this->getLabel(), $this->getSize()); - for ($i = 0, $count = count($this->test_cases); $i < $count; $i++) { - if (is_string($this->test_cases[$i])) { - $class = $this->test_cases[$i]; - $test = new $class(); - $test->run($reporter); - unset($test); - } else { - $this->test_cases[$i]->run($reporter); - } - } - $reporter->paintGroupEnd($this->getLabel()); - return $reporter->getStatus(); - } - - /** - * Number of contained test cases. - * @return integer Total count of cases in the group. - * @access public - */ - function getSize() { - $count = 0; - foreach ($this->test_cases as $case) { - if (is_string($case)) { - if (! SimpleTest::isIgnored($case)) { - $count++; - } - } else { - $count += $case->getSize(); - } - } - return $count; - } - - /** - * Test to see if a class is derived from the - * SimpleTestCase class. - * @param string $class Class name. - * @access public - */ - static function getBaseTestCase($class) { - while ($class = get_parent_class($class)) { - $class = strtolower($class); - if ($class == 'simpletestcase' || $class == 'testsuite') { - return $class; - } - } - return false; - } -} - -/** - * This is a failing group test for when a test suite hasn't - * loaded properly. - * @package SimpleTest - * @subpackage UnitTester - */ -class BadTestSuite { - private $label; - private $error; - - /** - * Sets the name of the test suite and error message. - * @param string $label Name sent at the start and end - * of the test. - * @access public - */ - function BadTestSuite($label, $error) { - $this->label = $label; - $this->error = $error; - } - - /** - * Accessor for the test name for subclasses. - * @return string Name of the test. - * @access public - */ - function getLabel() { - return $this->label; - } - - /** - * Sends a single error to the reporter. - * @param SimpleReporter $reporter Current test reporter. - * @access public - */ - function run($reporter) { - $reporter->paintGroupStart($this->getLabel(), $this->getSize()); - $reporter->paintFail('Bad TestSuite [' . $this->getLabel() . - '] with error [' . $this->error . ']'); - $reporter->paintGroupEnd($this->getLabel()); - return $reporter->getStatus(); - } - - /** - * Number of contained test cases. Always zero. - * @return integer Total count of cases in the group. - * @access public - */ - function getSize() { - return 0; - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/Expectations.pkg b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/Expectations.pkg deleted file mode 100644 index 3ea6ec4..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/Expectations.pkg +++ /dev/null @@ -1,319 +0,0 @@ - - - -Expectations - - - {@toc} - - -More control over mock objects - - The default behaviour of the - {@link mock objects.html mock objects} - in - {@link http://sourceforge.net/projects/simpletest/ SimpleTest} - is either an identical match on the argument or to allow any argument at all. - For almost all tests this is sufficient. - Sometimes, though, you want to weaken a test case. - - - One place where a test can be too tightly coupled is with - text matching. - Suppose we have a component that outputs a helpful error - message when something goes wrong. - You want to test that the correct error was sent, but the actual - text may be rather long. - If you test for the text exactly, then every time the exact wording - of the message changes, you will have to go back and edit the test suite. - - - For example, suppose we have a news service that has failed - to connect to its remote source. - -class NewsService { - ... - function publish(&$writer) { - if (! $this->isConnected()) { - $writer->write('Cannot connect to news service "' . - $this->_name . '" at this time. ' . - 'Please try again later.'); - } - ... - } -} - - Here it is sending its content to a - Writer class. - We could test this behaviour with a - MockWriter like so... - -class TestOfNewsService extends UnitTestCase { - ... - function testConnectionFailure() { - $writer = &new MockWriter($this); - $writer->expectOnce('write', array( - 'Cannot connect to news service ' . - '"BBC News" at this time. ' . - 'Please try again later.')); - - $service = &new NewsService('BBC News'); - $service->publish($writer); - - $writer->tally(); - } -} - - This is a good example of a brittle test. - If we decide to add additional instructions, such as - suggesting an alternative news source, we will break - our tests even though no underlying functionality - has been altered. - - - To get around this, we would like to do a regular expression - test rather than an exact match. - We can actually do this with... - -class TestOfNewsService extends UnitTestCase { - ... - function testConnectionFailure() { - $writer = &new MockWriter($this); - $writer->expectOnce( - 'write', - array(new WantedPatternExpectation('/cannot connect/i'))); - - $service = &new NewsService('BBC News'); - $service->publish($writer); - - $writer->tally(); - } -} - - Instead of passing in the expected parameter to the - MockWriter we pass an - expectation class called - WantedPatternExpectation. - The mock object is smart enough to recognise this as special - and to treat it differently. - Rather than simply comparing the incoming argument to this - object, it uses the expectation object itself to - perform the test. - - - The WantedPatternExpectation takes - the regular expression to match in its constructor. - Whenever a comparison is made by the MockWriter - against this expectation class, it will do a - preg_match() with this pattern. - With our test case above, as long as "cannot connect" - appears in the text of the string, the mock will issue a pass - to the unit tester. - The rest of the text does not matter. - - - The possible expectation classes are... - - - - -EqualExpectation - -An equality, rather than the stronger identity comparison - - - -NotEqualExpectation - -An inequality comparison - - - -IndenticalExpectation - -The default mock object check which must match exactly - - - -NotIndenticalExpectation - -Inverts the mock object logic - - - -WantedPatternExpectation - -Uses a Perl Regex to match a string - - - -NoUnwantedPatternExpectation - -Passes only if failing a Perl Regex - - - -IsAExpectation - -Checks the type or class name only - - - -NotAExpectation - -Opposite of the IsAExpectation - - - - -MethodExistsExpectation - -Checks a method is available on an object - - -
    - Most take the expected value in the constructor. - The exceptions are the pattern matchers, which take a regular expression, - and the IsAExpectation and NotAExpectation which takes a type - or class name as a string. -
    -
    - -Using expectations to control stubs - - The expectation classes can be used not just for sending assertions - from mock objects, but also for selecting behaviour for either - the - {@link mock objects.html mock objects} - or the - {@link server stubs.html server stubs}. - Anywhere a list of arguments is given, a list of expectation objects - can be inserted instead. - - - Suppose we want an authorisation server stub to simulate a successful login - only if it receives a valid session object. - We can do this as follows... - -Stub::generate('Authorisation'); - -$authorisation = new StubAuthorisation(); -$authorisation->setReturnValue( - 'isAllowed', - true, - array(new IsAExpectation('Session', 'Must be a session'))); -$authorisation->setReturnValue('isAllowed', false); - - We have set the default stub behaviour to return false when - isAllowed is called. - When we call the method with a single parameter that - is a Session object, it will return true. - We have also added a second parameter as a message. - This will be displayed as part of the mock object - failure message if this expectation is the cause of - a failure. - - - This kind of sophistication is rarely useful, but is included for - completeness. - - - -Creating your own expectations - - The expectation classes have a very simple structure. - So simple that it is easy to create your own versions for - commonly used test logic. - - - As an example here is the creation of a class to test for - valid IP addresses. - In order to work correctly with the stubs and mocks the new - expectation class should extend - SimpleExpectation... - -class ValidIp extends SimpleExpectation { - - function test($ip) { - return (ip2long($ip) != -1); - } - - function testMessage($ip) { - return "Address [$ip] should be a valid IP address"; - } -} - - There are only two methods to implement. - The test() method should - evaluate to true if the expectation is to pass, and - false otherwise. - The testMessage() method - should simply return some helpful text explaining the test - that was carried out. - - - This class can now be used in place of the earlier expectation - classes. - - - -Under the bonnet of the unit tester - - The {@link http://sourceforge.net/projects/simpletest/ SimpleTest unit testing framework} - also uses the expectation classes internally for the - {@link UnitTestCase class.html UnitTestCase class}. - We can also take advantage of these mechanisms to reuse our - homebrew expectation classes within the test suites directly. - - - The most crude way of doing this is to use the - SimpleTest::assertExpectation() method to - test against it directly... - -class TestOfNetworking extends UnitTestCase { - ... - function testGetValidIp() { - $server = &new Server(); - $this->assertExpectation( - new ValidIp(), - $server->getIp(), - 'Server IP address->%s'); - } -} - - This is a little untidy compared with our usual - assert...() syntax. - - - For such a simple case we would normally create a - separate assertion method on our test case rather - than bother using the expectation class. - If we pretend that our expectation is a little more - complicated for a moment, so that we want to reuse it, - we get... - -class TestOfNetworking extends UnitTestCase { - ... - function assertValidIp($ip, $message = '%s') { - $this->assertExpectation(new ValidIp(), $ip, $message); - } - - function testGetValidIp() { - $server = &new Server(); - $this->assertValidIp( - $server->getIp(), - 'Server IP address->%s'); - } -} - - It is unlikely we would ever need this degree of control - over the testing machinery. - It is rare to need the expectations for more than pattern - matching. - Also, complex expectation classes could make the tests - harder to read and debug. - These mechanisms are really of most use to authors of systems - that will extend the test framework to create their own tool set. - - -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/FormTesting.pkg b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/FormTesting.pkg deleted file mode 100644 index e9a4330..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/FormTesting.pkg +++ /dev/null @@ -1,218 +0,0 @@ - - - -Testing forms - - - {@toc} - - -Submitting a simple form - - When a page is fetched by the WebTestCase - using get() or - post() the page content is - automatically parsed. - This results in any form controls that are inside <form> tags - being available from within the test case. - For example, if we have this snippet of HTML... -
    -<form>
    -    <input type="text" name="a" value="A default" />
    -    <input type="submit" value="Go" />
    -</form>
    -
    - Which looks like this... -
    - -
    - - -
    -
    - - We can navigate to this code, via the - {@link http://www.lastcraft.com/form_testing_documentation.php LastCraft} - site, with the following test... - -class SimpleFormTests extends WebTestCase { - - function testDefaultValue() { - $this->get('http://www.lastcraft.com/form_testing_documentation.php'); - $this->assertField('a', 'A default'); - } -} - - Immediately after loading the page all of the HTML controls are set at - their default values just as they would appear in the web browser. - The assertion tests that a HTML widget exists in the page with the - name "a" and that it is currently set to the value - "A default" - - - We could submit the form straight away, but first we'll change - the value of the text field and only then submit it... - -class SimpleFormTests extends WebTestCase { - - function testDefaultValue() { - $this->get('http://www.my-site.com/'); - $this->assertField('a', 'A default'); - $this->setField('a', 'New value'); - $this->clickSubmit('Go'); - } -} - - Because we didn't specify a method attribute on the form tag, and - didn't specify an action either, the test case will follow - the usual browser behaviour of submitting the form data as a GET - request back to the same location. - SimpleTest tries to emulate typical browser behaviour as much as possible, - rather than attempting to catch missing attributes on tags. - This is because the target of the testing framework is the PHP application - logic, not syntax or other errors in the HTML code. - For HTML errors, other tools such as - {@link http://www.w3.org/People/Raggett/tidy/ HTMLTidy} should be used. - - - If a field is not present in any form, or if an option is unavailable, - then WebTestCase::setField() will return - false. - For example, suppose we wish to verify that a "Superuser" - option is not present in this form... -
    -<strong>Select type of user to add:</strong>
    -<select name="type">
    -    <option>Subscriber</option>
    -    <option>Author</option>
    -    <option>Administrator</option>
    -</select>
    -
    - Which looks like... -
    - -
    - Select type of user to add: - -
    -
    - - The following test will confirm it... - -class SimpleFormTests extends WebTestCase { - ... - function testNoSuperuserChoiceAvailable() { - $this->get('http://www.lastcraft.com/form_testing_documentation.php'); - $this->assertFalse($this->setField('type', 'Superuser')); - } -} - - The selection will not be changed on a failure to set - a widget value. - - - Here is the full list of widgets currently supported... -
      -
    • Text fields, including hidden and password fields.
    • -
    • Submit buttons including the button tag, although not yet reset buttons
    • -
    • Text area. This includes text wrapping behaviour.
    • -
    • Checkboxes, including multiple checkboxes in the same form.
    • -
    • Drop down selections, including multiple selects.
    • -
    • Radio buttons.
    • -
    • Images.
    • -
    -
    - - Although most standard HTML widgets are catered for by SimpleTest's - built in parser, it is unlikely that JavaScript will be implemented - anytime soon. - -
    - -Fields with multiple values - - SimpleTest can cope with two types of multivalue controls: Multiple - selection drop downs, and multiple checkboxes with the same name - within a form. - The multivalue nature of these means that setting and testing - are slightly different. - Using checkboxes as an example... -
    -<form class="demo">
    -    <strong>Create privileges allowed:</strong>
    -    <input type="checkbox" name="crud" value="c" checked><br>
    -    <strong>Retrieve privileges allowed:</strong>
    -    <input type="checkbox" name="crud" value="r" checked><br>
    -    <strong>Update privileges allowed:</strong>
    -    <input type="checkbox" name="crud" value="u" checked><br>
    -    <strong>Destroy privileges allowed:</strong>
    -    <input type="checkbox" name="crud" value="d" checked><br>
    -    <input type="submit" value="Enable Privileges">
    -</form>
    -
    - Which renders as... -
    - -
    - Create privileges allowed: - -
    - Retrieve privileges allowed: - -
    - Update privileges allowed: - -
    - Destroy privileges allowed: - -
    - -
    -
    - - If we wish to disable all but the retrieval privileges and - submit this information we can do it like this... - -class SimpleFormTests extends WebTestCase { - ... - function testDisableNastyPrivileges() { - $this->get('http://www.lastcraft.com/form_testing_documentation.php'); - $this->assertField('crud', array('c', 'r', 'u', 'd')); - $this->setField('crud', array('r')); - $this->clickSubmit('Enable Privileges'); - } -} - - Instead of setting the field to a single value, we give it a list - of values. - We do the same when testing expected values. - We can then write other test code to confirm the effect of this, perhaps - by logging in as that user and attempting an update. - - - Raw posting - - - If you want to test a form handler, but have not yet written - or do not have access to the form itself, you can create a - form submission by hand. - -class SimpleFormTests extends WebTestCase { - ... - function testAttemptedHack() { - $this->post( - 'http://www.my-site.com/add_user.php', - array('type' => 'superuser')); - $this->assertNoUnwantedPattern('/user created/i'); - } -} - - By adding data to the WebTestCase::post() - method, we are attempting to fetch the page as a form submission. - -
    -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/GroupTests.pkg b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/GroupTests.pkg deleted file mode 100644 index a695f5d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/GroupTests.pkg +++ /dev/null @@ -1,297 +0,0 @@ - - - -Group tests - - - {@toc} - - -Grouping tests - - To run test cases as part of a group the test cases should really - be placed in files without the runner code... - -<?php - require_once('../classes/io.php'); - - class FileTester extends UnitTestCase { - ... - } - - class SocketTester extends UnitTestCase { - ... - } -?> - - As many cases as needed can appear in a single file. - They should include any code they need, such as the library - being tested, but none of the simple test libraries. - - - If you have extended any test cases, you can include them - as well. - -<?php - require_once('../classes/io.php'); - - class MyFileTestCase extends UnitTestCase { - ... - } - SimpleTestOptions::ignore('MyFileTestCase'); - - class FileTester extends MyFileTestCase { - ... - } - - class SocketTester extends UnitTestCase { - ... - } -?> - - The FileTester class does - not contain any actual tests, but is a base class for other - test cases. - For this reason we use the - SimpleTestOptions::ignore() directive - to tell the upcoming group test to ignore it. - This directive can appear anywhere in the file and works - when a whole file of test cases is loaded (see below). - We will call this sample file_test.php. - - - Next we create a group test file, called say group_test.php. - You will think of a better name I am sure. - We will add the test file using a safe method... - -<?php - require_once('simpletest/unit_tester.php'); - require_once('simpletest/reporter.php'); - require_once('file_test.php'); - - $test = &new GroupTest('All file tests'); - $test->addTestCase(new FileTestCase()); - $test->run(new HtmlReporter()); -?> - - This instantiates the test case before the test suite is - run. - This could get a little expensive with a large number of test - cases, so another method is provided that will only - instantiate the class when it is needed... - -<?php - require_once('simpletest/unit_tester.php'); - require_once('simpletest/reporter.php'); - require_once('file_test.php'); - - $test = &new GroupTest('All file tests'); - $test->addTestClass('FileTestCase'); - $test->run(new HtmlReporter()); -?> - - The problem with this method is that for every test case - that we add we will have - to require_once() the test code - file and manually instantiate each and every test case. - We can save a lot of typing with... - -<?php - require_once('simpletest/unit_tester.php'); - require_once('simpletest/reporter.php'); - - $test = &new GroupTest('All file tests'); - $test->addTestFile('file_test.php'); - $test->run(new HtmlReporter()); -?&gt; - - What happens here is that the GroupTest - class has done the require_once() - for us. - It then checks to see if any new test case classes - have been created by the new file and automatically adds - them to the group test. - Now all we have to do is add each new file. - - - There are two things that could go wrong and which require care... -
      -
    1. - The file could already have been parsed by PHP and so no - new classes will have been added. You should make - sure that the test cases are only included in this file - and no others. -
    2. -
    3. - New test case extension classes that get included will be - placed in the group test and run also. - You will need to add a SimpleTestOptions::ignore() - directive for these classes or make sure that they are included - before the GroupTest::addTestFile() - line. -
    4. -
    -
    -
    - -Higher groupings - - The above method places all of the test cases into one large group. - For larger projects though this may not be flexible enough; you - may want to group the tests in all sorts of ways. - - - To get a more flexible group test we can subclass - GroupTest and then instantiate it as needed... - -<?php - require_once('simpletest/unit_tester.php'); - require_once('simpletest/reporter.php'); - - class FileGroupTest extends GroupTest { - function FileGroupTest() { - $this->GroupTest('All file tests'); - $this->addTestFile('file_test.php'); - } - } -?> - - This effectively names the test in the constructor and then - adds our test cases and a single group below. - Of course we can add more than one group at this point. - We can now invoke the tests from a separate runner file... - -<?php - require_once('file_group_test.php'); - - $test = &new FileGroupTest(); - $test->run(new HtmlReporter()); -?> - - ...or we can group them into even larger group tests... - -<?php - require_once('file_group_test.php'); - - $test = &new BigGroupTest('Big group'); - $test->addTestCase(new FileGroupTest()); - $test->addTestCase(...); - $test->run(new HtmlReporter()); -?> - - If we still wish to run the original group test and we - don't want all of these little runner files, we can - put the test runner code around guard bars when we create - each group. - -<?php - class FileGroupTest extends GroupTest { - function FileGroupTest() { - $this->GroupTest('All file tests'); - $test->addTestFile('file_test.php'); - } - } - - if (! defined('RUNNER')) { - define('RUNNER', true); - $test = &new FileGroupTest(); - $test->run(new HtmlReporter()); - } -?> - - This approach requires the guard to be set when including - the group test file, but this is still less hassle than - lots of separate runner files. - You include the same guard on the top level tests to make sure - that run() will run once only - from the top level script that has been invoked. - -<?php - define('RUNNER', true); - require_once('file_group_test.php'); - - $test = &new BigGroupTest('Big group'); - $test->addTestCase(new FileGroupTest()); - $test->addTestCase(...); - $test->run(new HtmlReporter()); -?> - - As with the normal test cases, a GroupTest can - be loaded with the GroupTest::addTestFile() method. - -<?php - define('RUNNER', true); - - $test = &new BigGroupTest('Big group'); - $test->addTestFile('file_group_test.php'); - $test->addTestFile(...); - $test->run(new HtmlReporter()); -?> - - - - -Integrating legacy test cases - - If you already have unit tests for your code or are extending external - classes that have tests, it is unlikely that all of the test cases - are in SimpleTest format. - Fortunately it is possible to incorporate test cases from other - unit testers directly into SimpleTest group tests. - - - Say we have the following - {@link http://sourceforge.net/projects/phpunit PhpUnit} - test case in the file config_test.php... - -class ConfigFileTest extends TestCase { - function ConfigFileTest() { - $this->TestCase('Config file test'); - } - - function testContents() { - $config = new ConfigFile('test.conf'); - $this->assertRegexp('/me/', $config->getValue('username')); - } -} - - The group test can recognise this as long as we include - the appropriate adapter class before we add the test - file... - -<?php - require_once('simpletest/unit_tester.php'); - require_once('simpletest/reporter.php'); - require_once('simpletest/adapters/phpunit_test_case.php'); - - $test = &new GroupTest('All file tests'); - $test->addTestFile('config_test.php'); - $test->run(new HtmlReporter()); -?> - - There are only two adapters, the other is for the - {@link http://pear.php.net/manual/en/package.php.phpunit.php PEAR} - 1.0 unit tester... - -<?php - require_once('simpletest/unit_tester.php'); - require_once('simpletest/reporter.php'); - require_once('simpletest/adapters/pear_test_case.php'); - - $test = &new GroupTest('All file tests'); - $test->addTestFile('some_pear_test_cases.php'); - $test->run(new HtmlReporter()); -?> - - The PEAR test cases can be freely mixed with SimpleTest - ones even in the same test file, - but you cannot use SimpleTest assertions in the legacy - test case versions. - This is done as a check that you are not accidently making - your test cases completely dependent on SimpleTest. - You may want to do a PEAR release of your library for example - which would mean shipping it with valid PEAR::PhpUnit test - cases. - - -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/MockObjects.pkg b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/MockObjects.pkg deleted file mode 100644 index b22413a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/MockObjects.pkg +++ /dev/null @@ -1,663 +0,0 @@ - - - -Mock objects - - - {@toc} - - -What are mock objects? - - Mock objects have two roles during a test case: actor and critic. - - - The actor behaviour is to simulate objects that are difficult to - set up or time consuming to set up for a test. - The classic example is a database connection. - Setting up a test database at the start of each test would slow - testing to a crawl and would require the installation of the - database engine and test data on the test machine. - If we can simulate the connection and return data of our - choosing we not only win on the pragmatics of testing, but can - also feed our code spurious data to see how it responds. - We can simulate databases being down or other extremes - without having to create a broken database for real. - In other words, we get greater control of the test environment. - - - If mock objects only behaved as actors they would simply be - known as {@link server stubs.html server stubs}. - - - However, the mock objects not only play a part (by supplying chosen - return values on demand) they are also sensitive to the - messages sent to them (via expectations). - By setting expected parameters for a method call they act - as a guard that the calls upon them are made correctly. - If expectations are not met they save us the effort of - writing a failed test assertion by performing that duty on our - behalf. - In the case of an imaginary database connection they can - test that the query, say SQL, was correctly formed by - the object that is using the connection. - Set them up with fairly tight expectations and you will - hardly need manual assertions at all. - - - -Creating mock objects - - In the same way that we create server stubs, all we need is an - existing class, say a database connection that looks like this... - -class DatabaseConnection { - function DatabaseConnection() { - } - - function query() { - } - - function selectQuery() { - } -} - - The class does not need to have been implemented yet. - To create a mock version of the class we need to include the - mock object library and run the generator... - -require_once('simpletest/unit_tester.php'); -require_once('simpletest/mock_objects.php'); -require_once('database_connection.php'); - -Mock::generate('DatabaseConnection'); - - This generates a clone class called - MockDatabaseConnection. - We can now create instances of the new class within - our test case... - -require_once('simpletest/unit_tester.php'); -require_once('simpletest/mock_objects.php'); -require_once('database_connection.php'); - -Mock::generate('DatabaseConnection'); - -class MyTestCase extends UnitTestCase { - - function testSomething() { - $connection = &new MockDatabaseConnection($this); - } -} - - Unlike the generated stubs the mock constructor needs a reference - to the test case so that it can dispatch passes and failures while - checking its expectations. - This means that mock objects can only be used within test cases. - Despite this their extra power means that stubs are hardly ever used - if mocks are available. - - - Mocks as actors - - - The mock version of a class has all the methods of the original - so that operations like - $connection->query() are still - legal. - As with stubs we can replace the default null return values... - -$connection->setReturnValue('query', 37); - - Now every time we call - $connection->query() we get - the result of 37. - As with the stubs we can set wildcards and we can overload the - wildcard parameter. - We can also add extra methods to the mock when generating it - and choose our own class name... - -Mock::generate('DatabaseConnection', 'MyMockDatabaseConnection', array('setOptions')); - - Here the mock will behave as if the setOptions() - existed in the original class. - This is handy if a class has used the PHP overload() - mechanism to add dynamic methods. - You can create a special mock to simulate this situation. - - - All of the patterns available with server stubs are available - to mock objects... - -class Iterator { - function Iterator() { - } - - function next() { - } -} - - Again, assuming that this iterator only returns text until it - reaches the end, when it returns false, we can simulate it - with... - -Mock::generate('Iterator'); - -class IteratorTest extends UnitTestCase() { - - function testASequence() { - $iterator = &new MockIterator($this); - $iterator->setReturnValue('next', false); - $iterator->setReturnValueAt(0, 'next', 'First string'); - $iterator->setReturnValueAt(1, 'next', 'Second string'); - ... - } -} - - When next() is called on the - mock iterator it will first return "First string", - on the second call "Second string" will be returned - and on any other call false will - be returned. - The sequenced return values take precedence over the constant - return value. - The constant one is a kind of default if you like. - - - A repeat of the stubbed information holder with name/value pairs... - -class Configuration { - function Configuration() { - } - - function getValue($key) { - } -} - - This is a classic situation for using mock objects as - actual configuration will vary from machine to machine, - hardly helping the reliability of our tests if we use it - directly. - The problem though is that all the data comes through the - getValue() method and yet - we want different results for different keys. - Luckily the mocks have a filter system... - -$config = &new MockConfiguration($this); -$config->setReturnValue('getValue', 'primary', array('db_host')); -$config->setReturnValue('getValue', 'admin', array('db_user')); -$config->setReturnValue('getValue', 'secret', array('db_password')); - - The extra parameter is a list of arguments to attempt - to match. - In this case we are trying to match only one argument which - is the look up key. - Now when the mock object has the - getValue() method invoked - like this... - -$config->getValue('db_user') - - ...it will return "admin". - It finds this by attempting to match the calling arguments - to its list of returns one after another until - a complete match is found. - - - There are times when you want a specific object to be - dished out by the mock rather than a copy. - Again this is identical to the server stubs mechanism... - -class Thing { -} - -class Vector { - function Vector() { - } - - function get($index) { - } -} - - In this case you can set a reference into the mock's - return list... - -$thing = new Thing(); -$vector = &new MockVector($this); -$vector->setReturnReference('get', $thing, array(12)); - - With this arrangement you know that every time - $vector->get(12) is - called it will return the same - $thing each time. - - - -Mocks as critics - - Although the server stubs approach insulates your tests from - real world disruption, it is only half the benefit. - You can have the class under test receiving the required - messages, but is your new class sending correct ones? - Testing this can get messy without a mock objects library. - - - By way of example, suppose we have a - SessionPool class that we - want to add logging to. - Rather than grow the original class into something more - complicated, we want to add this behaviour with a decorator (GOF). - The SessionPool code currently looks - like this... - -class SessionPool { - function SessionPool() { - ... - } - - function &findSession($cookie) { - ... - } - ... -} - -class Session { - ... -} -</php> - While our logging code looks like this... -<php> -class Log { - function Log() { - ... - } - - function message() { - ... - } -} - -class LoggingSessionPool { - function LoggingSessionPool(&$session_pool, &$log) { - ... - } - - function &findSession(\$cookie) { - ... - } - ... -} - - Out of all of this, the only class we want to test here - is the LoggingSessionPool. - In particular we would like to check that the - findSession() method is - called with the correct session ID in the cookie and that - it sent the message "Starting session $cookie" - to the logger. - - - Despite the fact that we are testing only a few lines of - production code, here is what we would have to do in a - conventional test case: -
      -
    1. Create a log object.
    2. -
    3. Set a directory to place the log file.
    4. -
    5. Set the directory permissions so we can write the log.
    6. -
    7. Create a SessionPool object.
    8. -
    9. Hand start a session, which probably does lot's of things.
    10. -
    11. Invoke findSession().
    12. -
    13. Read the new Session ID (hope there is an accessor!).
    14. -
    15. Raise a test assertion to confirm that the ID matches the cookie.
    16. -
    17. Read the last line of the log file.
    18. -
    19. Pattern match out the extra logging timestamps, etc.
    20. -
    21. Assert that the session message is contained in the text.
    22. -
    - It is hardly surprising that developers hate writing tests - when they are this much drudgery. - To make things worse, every time the logging format changes or - the method of creating new sessions changes, we have to rewrite - parts of this test even though this test does not officially - test those parts of the system. - We are creating headaches for the writers of these other classes. -
    - - Instead, here is the complete test method using mock object magic... - -Mock::generate('Session'); -Mock::generate('SessionPool'); -Mock::generate('Log'); - -class LoggingSessionPoolTest extends UnitTestCase { - ... - function testFindSessionLogging() { - $session = &new MockSession($this); - $pool = &new MockSessionPool($this); - $pool->setReturnReference('findSession', $session); - $pool->expectOnce('findSession', array('abc')); - - $log = &new MockLog($this); - $log->expectOnce('message', array('Starting session abc')); - - $logging_pool = &new LoggingSessionPool($pool, $log); - $this->assertReference($logging_pool->findSession('abc'), $session); - $pool->tally(); - $log->tally(); - } -} - - We start by creating a dummy session. - We don't have to be too fussy about this as the check - for which session we want is done elsewhere. - We only need to check that it was the same one that came - from the session pool. - - - findSession() is a factory - method the simulation of which is described {@link #stub above}. - The point of departure comes with the first - expectOnce() call. - This line states that whenever - findSession() is invoked on the - mock, it will test the incoming arguments. - If it receives the single argument of a string "abc" - then a test pass is sent to the unit tester, otherwise a fail is - generated. - This was the part where we checked that the right session was asked for. - The argument list follows the same format as the one for setting - return values. - You can have wildcards and sequences and the order of - evaluation is the same. - - - If the call is never made then neither a pass nor a failure will - generated. - To get around this we must tell the mock when the test is over - so that the object can decide if the expectation has been met. - The unit tester assertion for this is triggered by the - tally() call at the end of - the test. - - - We use the same pattern to set up the mock logger. - We tell it that it should have - message() invoked - once only with the argument "Starting session abc". - By testing the calling arguments, rather than the logger output, - we insulate the test from any display changes in the logger. - - - We start to run our tests when we create the new - LoggingSessionPool and feed - it our preset mock objects. - Everything is now under our control. - Finally we confirm that the - $session we gave our decorator - is the one that we get back and tell the mocks to run their - internal call count tests with the - tally() calls. - - - This is still quite a bit of test code, but the code is very - strict. - If it still seems rather daunting there is a lot less of it - than if we tried this without mocks and this particular test, - interactions rather than output, is always more work to set - up. - More often you will be testing more complex situations without - needing this level or precision. - Also some of this can be refactored into a test case - setUp() method. - - - Here is the full list of expectations you can set on a mock object - in {@link http://www.lastcraft.com/simple_test.php SimpleTest}... - - - - - - - - - - -expectArguments($method, $args) - - No - - - -expectArgumentsAt($timing, $method, $args) - - No - - - -expectCallCount($method, $count) - - Yes - - - -expectMaximumCallCount($method, $count) - - No - - - -expectMinimumCallCount($method, $count) - - Yes - - - -expectNever($method) - - No - - - -expectOnce($method, $args) - - Yes - - - -expectAtLeastOnce($method, $args) - - Yes - - -
    ExpectationNeeds tally() -
    - Where the parameters are... -
    -
    $method
    -
    The method name, as a string, to apply the condition to.
    -
    $args
    -
    - The arguments as a list. Wildcards can be included in the same - manner as for setReturn(). - This argument is optional for expectOnce() - and expectAtLeastOnce(). -
    -
    $timing
    -
    - The only point in time to test the condition. - The first call starts at zero. -
    -
    $count
    -
    The number of calls expected.
    -
    - The method expectMaximumCallCount() - is slightly different in that it will only ever generate a failure. - It is silent if the limit is never reached. -
    - - Like the assertions within test cases, all of the expectations - can take a message override as an extra parameter. - Also the original failure message can be embedded in the output - as "%s". - -
    - -Other approaches - - There are three approaches to creating mocks including the one - that SimpleTest employs. - Coding them by hand using a base class, generating them to - a file and dynamically generating them on the fly. - - - Mock objects generated with {@link SimpleTest.html SimpleTest} - are dynamic. - They are created at run time in memory, using - eval(), rather than written - out to a file. - This makes the mocks easy to create, a one liner, - especially compared with hand - crafting them in a parallel class hierarchy. - The problem is that the behaviour is usually set up in the tests - themselves. - If the original objects change the mock versions - that the tests rely on can get out of sync. - This can happen with the parallel hierarchy approach as well, - but is far more quickly detected. - - - The solution, of course, is to add some real integration - tests. - You don't need very many and the convenience gained - from the mocks more than outweighs the small amount of - extra testing. - You cannot trust code that was only tested with mocks. - - - If you are still determined to build static libraries of mocks - because you want to simulate very specific behaviour, you can - achieve the same effect using the SimpleTest class generator. - In your library file, say mocks/connection.php for a - database connection, create a mock and inherit to override - special methods or add presets... - -<?php - require_once('simpletest/mock_objects.php'); - require_once('../classes/connection.php'); - - Mock::generate('Connection', 'BasicMockConnection'); - class MockConnection extends BasicMockConnection { - function MockConnection(&$test, $wildcard = '*') { - $this->BasicMockConnection($test, $wildcard); - $this->setReturn('query', false); - } - } -?> - - The generate call tells the class generator to create - a class called BasicMockConnection - rather than the usual MockConnection. - We then inherit from this to get our version of - MockConnection. - By intercepting in this way we can add behaviour, here setting - the default value of query() to be false. - By using the default name we make sure that the mock class - generator will not recreate a different one when invoked elsewhere in the - tests. - It never creates a class if it already exists. - As long as the above file is included first then all tests - that generated MockConnection should - now be using our one instead. - If we don't get the order right and the mock library - creates one first then the class creation will simply fail. - - - Use this trick if you find you have a lot of common mock behaviour - or you are getting frequent integration problems at later - stages of testing. - - - -I think SimpleTest stinks! - - But at the time of writing it is the only one with mock objects, - so are you stuck with it? - - - No, not at all. - {@link SimpleTest.html SimpleTest} is a toolkit and one of those - tools is the mock objects which can be employed independently. - Suppose you have your own favourite unit tester and all your current - test cases are written using it. - Pretend that you have called your unit tester PHPUnit (everyone else has) - and the core test class looks like this... - -class PHPUnit { - function PHPUnit() { - } - - function assertion($message, $assertion) { - } - ... -} - - All the assertion() method does - is print some fancy output and the boolean assertion parameter determines - whether to print a pass or a failure. - Let's say that it is used like this... - -$unit_test = new PHPUnit(); -$unit_test>assertion('I hope this file exists', file_exists('my_file')); - - How do you use mocks with this? - - - There is a protected method on the base mock class - SimpleMock called - _assertTrue() and - by overriding this method we can use our own assertion format. - We start with a subclass, in say my_mock.php... - -<?php - require_once('simpletest/mock_objects.php'); - - class MyMock extends SimpleMock() { - function MyMock(&$test, $wildcard) { - $this->SimpleMock($test, $wildcard); - } - - function _assertTrue($assertion, $message) { - $test = &$this->getTest(); - $test->assertion($message, $assertion); - } - } -?> - - Now instantiating MyMock will create - an object that speaks the same language as your tester. - The catch is of course that we never create such an object, the - code generator does. - We need just one more line of code to tell the generator to use - your mock instead... - -<?php - require_once('simpletst/mock_objects.php'); - - class MyMock extends SimpleMock() { - function MyMock($test, $wildcard) { - $this->SimpleMock(&$test, $wildcard); - } - - function _assertTrue($assertion, $message , &$test) { - $test->assertion($message, $assertion); - } - } - SimpleTestOptions::setMockBaseClass('MyMock'); -?> - - From now on you just include my_mock.php instead of the - default mock_objects.php version and you can introduce - mock objects into your existing test suite. - - -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/PartialMock.pkg b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/PartialMock.pkg deleted file mode 100644 index 1ee147c..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/PartialMock.pkg +++ /dev/null @@ -1,361 +0,0 @@ - - - -Partial mocks - - A partial mock is simply a pattern to alleviate a specific problem - in testing with mock objects, - that of getting mock objects into tight corners. - It's quite a limited tool and possibly not even a good idea. - It is included with SimpleTest because I have found it useful - on more than one occasion and has saved a lot of work at that point. - - - {@toc} - - - -The mock injection problem - - When one object uses another it is very simple to just pass a mock - version in already set up with its expectations. - Things are rather tricker if one object creates another and the - creator is the one you want to test. - This means that the created object should be mocked, but we can - hardly tell our class under test to create a mock instead. - The tested class doesn't even know it is running inside a test - after all. - - - For example, suppose we are building a telnet client and it - needs to create a network socket to pass its messages. - The connection method might look something like... - -<?php - require_once('socket.php'); - - class Telnet { - ... - function &connect($ip, $port, $username, $password) { - $socket = &new Socket($ip, $port); - $socket->read( ... ); - ... - } - } -?> - - We would really like to have a mock object version of the socket - here, what can we do? - - - The first solution is to pass the socket in as a parameter, - forcing the creation up a level. - Having the client handle this is actually a very good approach - if you can manage it and should lead to factoring the creation from - the doing. - In fact, this is one way in which testing with mock objects actually - forces you to code more tightly focused solutions. - They improve your programming. - - - Here this would be... - -<?php - require_once('socket.php'); - - class Telnet { - ... - function &connect(&$socket, $username, $password) { - $socket->read( ... ); - ... - } - } -?> - - This means that the test code is typical for a test involving - mock objects. - -class TelnetTest extends UnitTestCase { - ... - function testConnection() { - $socket = &new MockSocket($this); - ... - $telnet = &new Telnet(); - $telnet->connect($socket, 'Me', 'Secret'); - ... - } -} - - It is pretty obvious though that one level is all you can go. - You would hardly want your top level application creating - every low level file, socket and database connection ever - needed. - It wouldn't know the constructor parameters anyway. - - - The next simplest compromise is to have the created object passed - in as an optional parameter... - -<?php - require_once('socket.php'); - - class Telnet { - ... - function &connect($ip, $port, $username, $password, $socket = false) { - if (!$socket) { - $socket = &new Socket($ip, $port); - } - $socket->read( ... ); - ... - return $socket; - } - } -?> - - For a quick solution this is usually good enough. - The test now looks almost the same as if the parameter - was formally passed... - -class TelnetTest extends UnitTestCase { - ... - function testConnection() { - $socket = &new MockSocket($this); - ... - $telnet = &new Telnet(); - $telnet->connect('127.0.0.1', 21, 'Me', 'Secret', &$socket); - ... - } -} - - The problem with this approach is its untidiness. - There is test code in the main class and parameters passed - in the test case that are never used. - This is a quick and dirty approach, but nevertheless effective - in most situations. - - - The next method is to pass in a factory object to do the creation... - -<?php - require_once('socket.php'); - - class Telnet { - function Telnet(&$network) { - $this->_network = &$network; - } - ... - function &connect($ip, $port, $username, $password) { - $socket = &$this->_network->createSocket($ip, $port); - $socket->read( ... ); - ... - return $socket; - } - } -?> - - This is probably the most highly factored answer as creation - is now moved into a small specialist class. - The networking factory can now be tested separately, but mocked - easily when we are testing the telnet class... - -class TelnetTest extends UnitTestCase { - ... - function testConnection() { - $socket = &new MockSocket($this); - ... - $network = &new MockNetwork($this); - $network->setReturnReference('createSocket', $socket); - $telnet = &new Telnet($network); - $telnet->connect('127.0.0.1', 21, 'Me', 'Secret'); - ... - } -} - - The downside is that we are adding a lot more classes to the - library. - Also we are passing a lot of factories around which will - make the code a little less intuitive. - The most flexible solution, but the most complex. - - - Is there a middle ground? - - - -Protected factory method - - There is a way we can circumvent the problem without creating - any new application classes, but it involves creating a subclass - when we do the actual testing. - Firstly we move the socket creation into its own method... - -<?php - require_once('socket.php'); - - class Telnet { - ... - function &connect($ip, $port, $username, $password) { - $socket = &$this->_createSocket($ip, $port); - $socket->read( ... ); - ... - } - - function &_createSocket($ip, $port) { - return new Socket($ip, $port); - } - } -?> - - This is the only change we make to the application code. - - - For the test case we have to create a subclass so that - we can intercept the socket creation... - -class TelnetTestVersion extends Telnet { - var $_mock; - - function TelnetTestVersion(&$mock) { - $this->_mock = &$mock; - $this->Telnet(); - } - - function &_createSocket() { - return $this->_mock; - } -} - - Here I have passed the mock in the constructor, but a - setter would have done just as well. - Note that the mock was set into the object variable - before the constructor was chained. - This is necessary in case the constructor calls - connect(). - Otherwise it could get a null value from - _createSocket(). - - - After the completion of all of this extra work the - actual test case is fairly easy. - We just test our new class instead... - -class TelnetTest extends UnitTestCase { - ... - function testConnection() { - $socket = &new MockSocket($this); - ... - $telnet = &new TelnetTestVersion($socket); - $telnet->connect('127.0.0.1', 21, 'Me', 'Secret'); - ... - } -} - - The new class is very simple of course. - It just sets up a return value, rather like a mock. - It would be nice if it also checked the incoming parameters - as well. - Just like a mock. - It seems we are likely to do this often, can - we automate the subclass creation? - - - -A partial mock - - Of course the answer is "yes" or I would have stopped writing - this by now! - The previous test case was a lot of work, but we can - generate the subclass using a similar approach to the mock objects. - - - Here is the partial mock version of the test... - -Mock::generatePartial( - 'Telnet', - 'TelnetTestVersion', - array('_createSocket')); - -class TelnetTest extends UnitTestCase { - ... - function testConnection() { - $socket = &new MockSocket($this); - ... - $telnet = &new TelnetTestVersion($this); - $telnet->setReturnReference('_createSocket', $socket); - $telnet->Telnet(); - $telnet->connect('127.0.0.1', 21, 'Me', 'Secret'); - ... - } -} - - The partial mock is a subclass of the original with - selected methods "knocked out" with test - versions. - The generatePartial() call - takes three parameters: the class to be subclassed, - the new test class name and a list of methods to mock. - - - Instantiating the resulting objects is slightly tricky. - The only constructor parameter of a partial mock is - the unit tester reference. - As with the normal mock objects this is needed for sending - test results in response to checked expectations. - - - The original constructor is not run yet. - This is necessary in case the constructor is going to - make use of the as yet unset mocked methods. - We set any return values at this point and then run the - constructor with its normal parameters. - This three step construction of "new", followed - by setting up the methods, followed by running the constructor - proper is what distinguishes the partial mock code. - - - Apart from construction, all of the mocked methods have - the same features as mock objects and all of the unmocked - methods behave as before. - We can set expectations very easily... - -class TelnetTest extends UnitTestCase { - ... - function testConnection() { - $socket = &new MockSocket($this); - ... - $telnet = &new TelnetTestVersion($this); - $telnet->setReturnReference('_createSocket', $socket); - $telnet->expectOnce('_createSocket', array('127.0.0.1', 21)); - $telnet->Telnet(); - $telnet->connect('127.0.0.1', 21, 'Me', 'Secret'); - ... - $telnet->tally(); - } -} - - - - -Testing less than a class - - The mocked out methods don't have to be factory methods, - they could be any sort of method. - In this way partial mocks allow us to take control of any part of - a class except the constructor. - We could even go as far as to mock every method - except one we actually want to test. - - - This last situation is all rather hypothetical, as I haven't - tried it. - I am open to the possibility, but a little worried that - forcing object granularity may be better for the code quality. - I personally use partial mocks as a way of overriding creation - or for occasional testing of the TemplateMethod pattern. - - - It's all going to come down to the coding standards of your - project to decide which mechanism you use. - - - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/Reporting.pkg b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/Reporting.pkg deleted file mode 100644 index c60531e..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/Reporting.pkg +++ /dev/null @@ -1,450 +0,0 @@ - - - -Reporting - - SimpleTest pretty much follows the MVC pattern - (Model-View-Controller). - The reporter classes are the view and the model is your - test cases and their hiearchy. - The controller is mostly hidden from the user of - SimpleTest unless you want to change how the test cases - are actually run, in which case it is possible to - override the runner objects from within the test case. - As usual with MVC, the controller is mostly undefined - and there are other places to control the test run. - - - {@toc} - - - -Reporting results in HTML - - The default test display is minimal in the extreme. - It reports success and failure with the conventional red and - green bars and shows a breadcrumb trail of test groups - for every failed assertion. - Here's a fail... -
    -

    File test

    - Fail: createnewfile->True assertion failed.
    -
    1/1 test cases complete. - 0 passes, 1 fails and 0 exceptions.
    -
    - And here all tests passed... -
    -

    File test

    -
    1/1 test cases complete. - 1 passes, 0 fails and 0 exceptions.
    -
    - The good news is that there are several points in the display - hiearchy for subclassing. -
    - - For web page based displays there is the - HtmlReporter class with the following - signature... - -class HtmlReporter extends SimpleReporter { - public HtmlReporter($encoding) { ... } - public makeDry(boolean $is_dry) { ... } - public void paintHeader(string $test_name) { ... } - public void sendNoCacheHeaders() { ... } - public void paintFooter(string $test_name) { ... } - public void paintGroupStart(string $test_name, integer $size) { ... } - public void paintGroupEnd(string $test_name) { ... } - public void paintCaseStart(string $test_name) { ... } - public void paintCaseEnd(string $test_name) { ... } - public void paintMethodStart(string $test_name) { ... } - public void paintMethodEnd(string $test_name) { ... } - public void paintFail(string $message) { ... } - public void paintPass(string $message) { ... } - public void paintError(string $message) { ... } - public void paintException(string $message) { ... } - public void paintMessage(string $message) { ... } - public void paintFormattedMessage(string $message) { ... } - protected string _getCss() { ... } - public array getTestList() { ... } - public integer getPassCount() { ... } - public integer getFailCount() { ... } - public integer getExceptionCount() { ... } - public integer getTestCaseCount() { ... } - public integer getTestCaseProgress() { ... } -} - - Here is what some of these methods mean. First the display methods - that you will probably want to override... -
      -
    • - HtmlReporter(string $encoding) -
      - is the constructor. - Note that the unit test sets up the link to the display - rather than the other way around. - The display is a mostly passive receiver of test events. - This allows easy adaption of the display for other test - systems beside unit tests, such as monitoring servers. - The encoding is the character encoding you wish to - display the test output in. - In order to correctly render debug output when - using the web tester, this should match the encoding - of the site you are trying to test. - The available character set strings are described in - the PHP {@link http://www.php.net/manual/en/function.htmlentities.php html_entities()} - function. -
    • -
    • - void paintHeader(string $test_name) -
      - is called once at the very start of the test when the first - start event arrives. - The first start event is usually delivered by the top level group - test and so this is where $test_name - comes from. - It paints the page titles, CSS, body tag, etc. - It returns nothing (void). -
    • -
    • - void paintFooter(string $test_name) -
      - Called at the very end of the test to close any tags opened - by the page header. - By default it also displays the red/green bar and the final - count of results. - Actually the end of the test happens when a test end event - comes in with the same name as the one that started it all - at the same level. - The tests nest you see. - Closing the last test finishes the display. -
    • -
    • - void paintMethodStart(string $test_name) -
      - is called at the start of each test method. - The name normally comes from method name. - The other test start events behave the same way except - that the group test one tells the reporter how large - it is in number of held test cases. - This is so that the reporter can display a progress bar - as the runner churns through the test cases. -
    • -
    • - void paintMethodEnd(string $test_name) -
      - backs out of the test started with the same name. -
    • -
    • - void paintFail(string $message) -
      - paints a failure. - By default it just displays the word fail, a breadcrumbs trail - showing the current test nesting and the message issued by - the assertion. -
    • -
    • - void paintPass(string $message) -
      - by default does nothing. -
    • -
    • - string _getCss() -
      - Returns the CSS styles as a string for the page header - method. - Additional styles have to be appended here if you are - not overriding the page header. - You will want to use this method in an overriden page header - if you want to include the original CSS. -
    • -
    - There are also some accessors to get information on the current - state of the test suite. - Use these to enrich the display... -
      -
    • - array getTestList() -
      - is the first convenience method for subclasses. - Lists the current nesting of the tests as a list - of test names. - The first, most deeply nested test, is first in the - list and the current test method will be last. -
    • -
    • - integer getPassCount() -
      - returns the number of passes chalked up so far. - Needed for the display at the end. -
    • -
    • - integer getFailCount() -
      - is likewise the number of fails so far. -
    • -
    • - integer getExceptionCount() -
      - is likewise the number of errors so far. -
    • -
    • - integer getTestCaseCount() -
      - is the total number of test cases in the test run. - This includes the grouping tests themselves. -
    • -
    • - integer getTestCaseProgress() -
      - is the number of test cases completed so far. -
    • -
    - One simple modification is to get the HtmlReporter to display - the passes as well as the failures and errors... - -class ShowPasses extends HtmlReporter { - - function paintPass($message) { - parent::paintPass($message); - print "&<span class=\"pass\">Pass</span>: "; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - print implode("-&gt;", $breadcrumb); - print "-&gt;$message<br />\n"; - } - - function _getCss() { - return parent::_getCss() . ' .pass { color: green; }'; - } -} - -
    - - One method that was glossed over was the makeDry() - method. - If you run this method, with no parameters, on the reporter - before the test suite is run no actual test methods - will be called. - You will still get the events of entering and leaving the - test methods and test cases, but no passes or failures etc, - because the test code will not actually be executed. - - - The reason for this is to allow for more sophistcated - GUI displays that allow the selection of individual test - cases. - In order to build a list of possible tests they need a - report on the test structure for drawing, say a tree view - of the test suite. - With a reporter set to dry run that just sends drawing events - this is easily accomplished. - -
    - -Extending the reporter - - Rather than simply modifying the existing display, you might want to - produce a whole new HTML look, or even generate text or XML. - Rather than override every method in - HtmlReporter we can take one - step up the class hiearchy to SimpleReporter - in the simple_test.php source file. - - - A do nothing display, a blank canvas for your own creation, would - be... - -require_once('simpletest/simple_test.php'); - -class MyDisplay extends SimpleReporter { - - function paintHeader($test_name) { - } - - function paintFooter($test_name) { - } - - function paintStart($test_name, $size) { - parent::paintStart($test_name, $size); - } - - function paintEnd($test_name, $size) { - parent::paintEnd($test_name, $size); - } - - function paintPass($message) { - parent::paintPass($message); - } - - function paintFail($message) { - parent::paintFail($message); - } -} - - No output would come from this class until you add it. - - - -The command line reporter - - SimpleTest also ships with a minimal command line reporter. - The interface mimics JUnit to some extent, but paints the - failure messages as they arrive. - To use the command line reporter simply substitute it - for the HTML version... - -<?php - require_once('simpletest/unit_tester.php'); - require_once('simpletest/reporter.php'); - - $test = &new GroupTest('File test'); - $test->addTestFile('tests/file_test.php'); - $test->run(new TextReporter()); -?> - - Then invoke the test suite from the command line... -
    -php file_test.php
    -
    - You will need the command line version of PHP installed - of course. - A passing test suite looks like this... -
    -File test
    -OK
    -Test cases run: 1/1, Failures: 0, Exceptions: 0
    -
    - A failure triggers a display like this... -
    -File test
    -1) True assertion failed.
    -	in createnewfile
    -FAILURES!!!
    -Test cases run: 1/1, Failures: 1, Exceptions: 0
    -
    -
    - - One of the main reasons for using a command line driven - test suite is of using the tester as part of some automated - process. - To function properly in shell scripts the test script should - return a non-zero exit code on failure. - If a test suite fails the value false - is returned from the SimpleTest::run() - method. - We can use that result to exit the script with the desired return - code... - -<?php - require_once('simpletest/unit_tester.php'); - require_once('simpletest/reporter.php'); - - $test = &new GroupTest('File test'); - $test->addTestFile('tests/file_test.php'); - exit ($test->run(new TextReporter()) ? 0 : 1); -?> - - Of course we don't really want to create two test scripts, - a command line one and a web browser one, for each test suite. - The command line reporter includes a method to sniff out the - run time environment... - -<?php - require_once('simpletest/unit_tester.php'); - require_once('simpletest/reporter.php'); - - $test = &new GroupTest('File test'); - $test->addTestFile('tests/file_test.php'); - if (TextReporter::inCli()) { - exit ($test->run(new TextReporter()) ? 0 : 1); - } - $test->run(new HtmlReporter()); -?> - - This is the form used within SimpleTest itself. - -
    - -Remote testing - - SimpleTest ships with an XmlReporter class - used for internal communication. - When run the output looks like... -
    -<?xml version="1.0"?>
    -<run>
    -  <group size="4">
    -    <name>Remote tests</name>
    -    <group size="4">
    -      <name>Visual test with 48 passes, 48 fails and 4 exceptions</name>
    -      <case>
    -        <name>testofunittestcaseoutput</name>
    -        <test>
    -          <name>testofresults</name>
    -          <pass>This assertion passed</pass>
    -          <fail>This assertion failed</fail>
    -        </test>
    -        <test>
    -          ...
    -        </test>
    -      </case>
    -    </group>
    -  </group>
    -</run>
    -
    - You can make use of this format with the parser - supplied as part of SimpleTest itself. - This is called SimpleTestXmlParser and - resides in xml.php within the SimpleTest package... - -<?php - require_once('simpletest/xml.php'); - - ... - $parser = &new SimpleTestXmlParser(new HtmlReporter()); - $parser->parse($test_output); -?> - - The $test_output should be the XML format - from the XML reporter, and could come from say a command - line run of a test case. - The parser sends events to the reporter just like any - other test run. - There are some odd occasions where this is actually useful. -
    - - A problem with large test suites is thet they can exhaust - the default 8Mb memory limit on a PHP process. - By having the test groups output in XML and run in - separate processes, the output can be reparsed to - aggregate the results into a much smaller footprint top level - test. - - - Because the XML output can come from anywhere, this opens - up the possibility of aggregating test runs from remote - servers. - A test case already exists to do this within the SimpleTest - framework, but it is currently experimental... - -<?php - require_once('../remote.php'); - require_once('../reporter.php'); - - $test_url = ...; - $dry_url = ...; - - $test = &new GroupTest('Remote tests'); - $test->addTestCase(new RemoteTestCase($test_url, $dry_url)); - $test->run(new HtmlReporter()); -?> - - The RemoteTestCase takes the actual location - of the test runner, basically a web page in XML format. - It also takes the URL of a reporter set to do a dry run. - This is so that progress can be reported upward correctly. - The RemoteTestCase can be added to test suites - just like any other group test. - -
    -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/ServerStubs.pkg b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/ServerStubs.pkg deleted file mode 100644 index 96073b5..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/ServerStubs.pkg +++ /dev/null @@ -1,323 +0,0 @@ - - - -Server stubs - - - {@toc} - - -What are server stubs? - - This was originally a pattern named by Robert Binder (Testing - object-oriented systems: models, patterns, and tools, - Addison-Wesley) in 1999. - A server stub is a simulation of an object or component. - It should exactly replace a component in a system for test - or prototyping purposes, but remain lightweight. - This allows tests to run more quickly, or if the simulated - class has not been written, to run at all. - - - -Creating server stubs - - All we need is an existing class, say a database connection - that looks like this... - -class DatabaseConnection { - function DatabaseConnection() { - } - - function query() { - } - - function selectQuery() { - } -} - - The class does not need to have been implemented yet. - To create a stub version of the class we need to include the - server stub library and run the generator... - -require_once('simpletest/mock_objects.php'); -require_once('database_connection.php'); -Stub::generate('DatabaseConnection'); - - This generates a clone class called - StubDatabaseConnection. - We can now create instances of the new class within - our prototype script... - -require_once('simpletest/mock_objects.php'); -require_once('database_connection.php'); -Stub::generate('DatabaseConnection'); - -$connection = new StubDatabaseConnection(); - - - The stub version of a class has all the methods of the original - so that operations like - $connection->query() are still - legal. - The return value will be null, - but we can change that with... - -$connection->setReturnValue('query', 37) - - Now every time we call - $connection->query() we get - the result of 37. - We can set the return value to anything, say a hash of - imaginary database results or a list of persistent objects. - Parameters are irrelevant here, we always get the same - values back each time once they have been set up this way. - That may not sound like a convincing replica of a - database connection, but for the half a dozen lines of - a test method it is usually all you need. - - - -Simulation patterns - - Things aren't always that simple though. - One common problem is iterators, where constantly returning - the same value could cause an endless loop in the object - being tested. - For these we need to set up sequences of values. - Let's say we have a simple iterator that looks like this... - -class Iterator { - function Iterator() { - } - - function next() { - } -} - - This is about the simplest iterator you could have. - Assuming that this iterator only returns text until it - reaches the end, when it returns false, we can simulate it - with... - -Stub::generate('Iterator'); - -$iterator = new StubIterator(); -$iterator->setReturnValue('next', false); -$iterator->setReturnValueAt(0, 'next', 'First string'); -$iterator->setReturnValueAt(1, 'next', 'Second string'); - - When next() is called on the - stub iterator it will first return "First string", - on the second call "Second string" will be returned - and on any other call false will - be returned. - The sequenced return values take precedence over the constant - return value. - The constant one is a kind of default if you like. - - - Another tricky situation is an overloaded - get() operation. - An example of this is an information holder with name/value pairs. - Say we have a configuration class like... - -class Configuration { - function Configuration() { - } - - function getValue($key) { - } -} - - This is a classic situation for using stub objects as - actual configuration will vary from machine to machine, - hardly helping the reliability of our tests if we use it - directly. - The problem though is that all the data comes through the - getValue() method and yet - we want different results for different keys. - Luckily the stubs have a filter system... - -Stub::generate('Configuration'); - -$config = &new StubConfiguration(); -$config->setReturnValue('getValue', 'primary', array('db_host')); -$config->setReturnValue('getValue', 'admin', array('db_user')); -$config->setReturnValue('getValue', 'secret', array('db_password')); - - The extra parameter is a list of arguments to attempt - to match. - In this case we are trying to match only one argument which - is the look up key. - Now when the server stub has the - getValue() method invoked - like this... - -$config->getValue('db_user'); - - ...it will return "admin". - It finds this by attempting to match the calling arguments - to its list of returns one after another until - a complete match is found. - - - You can set a default argument argument like so... - -$config->setReturnValue('getValue', false, array('*')); - - This is not the same as setting the return value without - any argument requirements like this... - -$config->setReturnValue('getValue', false); - - In the first case it will accept any single argument, - but exactly one is required. - In the second case any number of arguments will do and - it acts as a catchall after all other matches. - Note that if we add further single parameter options after - the wildcard in the first case, they will be ignored as the wildcard - will match first. - With complex parameter lists the ordering could be important - or else desired matches could be masked by earlier wildcard - ones. - Declare the most specific matches first if you are not sure. - - - There are times when you want a specific object to be - dished out by the stub rather than just a copy. - The PHP copy semantics force us to use a different method - for this. - You might be simulating a container for example... - -class Thing { -} - -class Vector { - function Vector() { - } - - function get($index) { - } -} - - In this case you can set a reference into the stub's - return list... - -Stub::generate('Vector'); - -$thing = new Thing(); -$vector = &new StubVector(); -$vector->setReturnReference('get', $thing, array(12)); - - With this arrangement you know that every time - $vector->get(12) is - called it will return the same - $thing each time. - - - These three factors, timing, parameters and whether to copy, - can be combined orthogonally. - For example... - -$complex = &new StubComplexThing(); -$stuff = new Stuff(); -$complex->setReturnReferenceAt(3, 'get', $stuff, array('*', 1)); - - This will return the $stuff only on the third - call and only if two parameters were set the second of - which must be the integer 1. - That should cover most simple prototyping situations. - - - A final tricky case is one object creating another, known - as a factory pattern. - Suppose that on a successful query to our imaginary - database, a result set is returned as an iterator with - each call to next() giving - one row until false. - This sounds like a simulation nightmare, but in fact it can all - be stubbed using the mechanics above. - - - Here's how... - -Stub::generate('DatabaseConnection'); -Stub::generate('ResultIterator'); - -class DatabaseTest extends UnitTestCase { - - function testUserFinder() { - $result = &new StubResultIterator(); - $result->setReturnValue('next', false); - $result->setReturnValueAt(0, 'next', array(1, 'tom')); - $result->setReturnValueAt(1, 'next', array(3, 'dick')); - $result->setReturnValueAt(2, 'next', array(6, 'harry')); - - $connection = &new StubDatabaseConnection(); - $connection->setReturnValue('query', false); - $connection->setReturnReference( - 'query', - $result, - array('select id, name from users')); - - $finder = &new UserFinder($connection); - $this->assertIdentical( - $finder->findNames(), - array('tom', 'dick', 'harry')); - } -} - - Now only if our - $connection is called with the correct - query() will the - $result be returned that is - itself exhausted after the third call to next(). - This should be enough - information for our UserFinder class, - the class actually - being tested here, to come up with goods. - A very precise test and not a real database in sight. - - - -Stub creation options - - There are some additional options when creating stubs. - At the generation stage we can change the class name... - -Stub::generate('Iterator', 'MyStubIterator'); -$iterator = &new MyStubIterator(); - - - This is not very useful in itself as there would be no difference - in this class and the default except for the name. - However we can also add additional methods not found in the - original interface... - -class Iterator { -} -Stub::generate('Iterator', 'PrototypeIterator', array('next', 'isError')); -$iterator = &new PrototypeIterator(); -$iterator->setReturnValue('next', 0); - - - The next() and - isError() methods can now have - return values set just as if they existed in the original class. - - - One other esoteric way of customising the stubs is to change - the default wildcard used for parameter matching. - -Stub::generate('Connection'); -$iterator = &new StubConnection('wild'); -$iterator->setReturnValue('query', array('id' => 33), array('wild')); - - - The only reason to do this is if you genuinely wanted to test - against the literal string "*" and didn't want it - interpreted as "any". - - - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/SimpleTest.pkg b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/SimpleTest.pkg deleted file mode 100644 index 7def579..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/SimpleTest.pkg +++ /dev/null @@ -1,387 +0,0 @@ - - - -Overview - - - - - - Marcus Baker - - Primary Developer -{@link mailto:marcus@lastcraft.com marcus@lastcraft.com} - - - - Harry Fuecks - - Packager -{@link mailto:harryf@users.sourceforge.net harryf@users.sourceforge.net} - - - - Jason Sweat - - Documentation -{@link mailto:jsweat_php@yahoo.com jsweat_php@yahoo.com} - - - - - {@toc} - - -What is SimpleTest? - - The heart of SimpleTest is a testing framework built around - test case classes. - These are written as extensions of base test case classes, - each extended with methods that actually contain test code. - Top level test scripts then invoke the run() - methods on every one of these test cases in order. - Each test method is written to invoke various assertions that - the developer expects to be true such as - assertEqual(). - If the expectation is correct, then a successful result is dispatched to the - observing test reporter, but any failure triggers an alert - and a description of the mismatch. - - - A {@link test case.html test case} looks like this... - -<?php -class MyTestCase extends UnitTestCase { - - function testLog() { - $log = &new Log('my.log'); - $log->message('Hello'); - $this->assertTrue(file_exists('my.log')); - } -} -?> - - - - These tools are designed for the developer. - Tests are written in the PHP language itself more or less - as the application itself is built. - The advantage of using PHP itself as the testing language is that - there are no new languages to learn, testing can start straight away, - and the developer can test any part of the code. - Basically, all parts that can be accessed by the application code can also be - accessed by the test code if they are in the same language. - - - The simplest type of test case is the - {@link UnitTestCase.html UnitTestCase}. - This class of test case includes standard tests for equality, - references and pattern matching. - All these test the typical expectations of what you would - expect the result of a function or method to be. - This is by far the most common type of test in the daily - routine of development, making up about 95% of test cases. - - - The top level task of a web application though is not to - produce correct output from its methods and objects, but - to generate web pages. - The {@link WebTestCase.html WebTestCase} class tests web - pages. - It simulates a web browser requesting a page, complete with - cookies, proxies, secure connections, authentication, forms, frames and most - navigation elements. - With this type of test case, the developer can assert that - information is present in the page and that forms and - sessions are handled correctly. - - - A {@link WebTestCase.html WebTestCase} looks like this... - -<?php -class MySiteTest extends WebTestCase { - - function testHomePage() { - $this->get('http://www.my-site.com/index.php'); - $this->assertTitle('My Home Page'); - $this->clickLink('Contact'); - $this->assertTitle('Contact me'); - $this->assertWantedPattern('/Email me at/'); - } -} -?> - - - - -Feature list - - The following is a very rough outline of past and future features - and their expected point of release. - I am afraid it is liable to change without warning as meeting the - milestones rather depends on time available. - Green stuff has been coded, but not necessarily released yet. - If you have a pressing need for a green but unreleased feature - then you should check-out the code from sourceforge CVS directly. - A released feature is marked as "Done". - - - - - - - - - - - Unit test case - Core test case class and assertions - Done - - - Html display - Simplest possible display - Done - - - Autoloading of test cases - - Reading a file with test cases and loading them into a - group test automatically - - Done - - - Mock objects code generator - - Objects capable of simulating other objects removing - test dependencies - - Done - - - Server stubs - - Mocks without expectations to be used outside of test cases, - e.g. for prototyping - - Done - - - Integration of other unit testers - - The ability to read and simulate test cases from PHPUnit - and PEAR::PhpUnit - - Done - - - Web test case - Basic pattern matching of fetched pages - Done - - - HTML parsing of pages - Allows link following and title tag matching - Done - - - Partial mocks - - Mocking parts of a class for testing less than a class - or for complex simulations - - Done - - - Web cookie handling - Correct handling of cookies when fetching pages - Done - - - Following redirects - Page fetching automatically follows 300 redirects - Done - - - Form parsing - Ability to submit simple forms and read default form values - Done - - - Command line interface - Test display without the need of a web browser - Done - - - Exposure of expectation classes - Can create precise tests with mocks as well as test cases - Done - - - XML output and parsing - - Allows multi host testing and the integration of acceptance - testing extensions - - Done - - - Command line test case - Allows testing of utilities and file handling - Done - - - PHP Documentor compatibility - Fully generated class level documentation - Done - - - Browser interface - - Exposure of lower level web browser interface for more - detailed test cases - - Done - - - HTTP authentication - - Fetching protected web pages with basic authentication - only - - Done - - - Browser navigation buttons - Back, forward and retry - Done - - - SSL support - Can connect to https: pages - Done - - - Proxy support - Can connect via. common proxies - Done - - - Frames support - Handling of frames in web test cases - Done - - - Improved display - Better web GUI with tree display of test cases - 1.1 - - - Localisation - Messages abstracted and code generated from XML - 1.1 - - - File upload testing - Can simulate the input type file tag - 1.1 - - - Mocking interfaces - Can generate mock objects to interfaces as well as classes - 2.0 - - - Testing exceptions - Similar to testing PHP errors - 2.0 - - - XPath searching of elements - Can make use of HTML tidy for faster and more flexible content matching - 2.0 - - -
    FeatureDescriptionRelease
    - PHP5 migraton will start straight after the version 1.1 series, - whereupon PHP4 will no longer be supported. - SimpleTest is currently compatible with PHP5, but will not - make use of all of the new features until version 2. -
    -
    - -Web resources for testing - - Process is at least as important as tools. - The type of process that makes the heaviest use of a developer's - testing tool is of course - {@link http://www.extremeprogramming.org/ Extreme Programming}. - This is one of the - {@link http://www.agilealliance.com/articles/index Agile Methodologies} - which combine various practices to "flatten the cost curve" of software development. - More extreme still is {@link http://www.testdriven.com/modules/news/ Test Driven Development}, - where you very strictly adhere to the rule of no coding until you have a test. - If you're more of a planner or believe that experience trumps evolution, - you may prefer the - {@link http://www.therationaledge.com/content/dec_01/f_spiritOfTheRUP_pk.html RUP} approach. - I haven't tried it, but even I can see that you will need test tools (see figure 9). - - - Most unit testers clone {@link http://www.junit.org/ JUnit} to some degree, - as far as the interface at least. There is a wealth of information on the - JUnit site including the - {@link http://junit.sourceforge.net/doc/faq/faq.htm FAQ} - which contains plenty of general advice on testing. - Once you get bitten by the bug you will certainly appreciate the phrase - {@link http://junit.sourceforge.net/doc/testinfected/testing.htm test infected} - coined by Eric Gamma. - If you are still reviewing which unit tester to use the main choices - are {@link http://phpunit.sourceforge.net/ PHPUnit} - and {@link http://pear.php.net/manual/en/package.php.phpunit.php Pear PHP::PHPUnit}. - They currently lack a lot of features found in - {@link http://www.lastcraft.com/simple_test.php SimpleTest}, but the PEAR - version at least has been upgraded for PHP5 and is recommended if you are porting - existing {@link http://www.junit.org/ JUnit} test cases. - - - Library writers don't seem to ship tests with their code very often - which is a shame. - Library code that includes tests can be more safely refactored and - the test code can act as additional documentation in a fairly standard - form. - This can save trawling the source code for clues when problems occour, - especially when upgrading such a library. - Libraries using SimpleTest for their unit testing include - {@link http://wact.sourceforge.net/ WACT} and - {@link http://sourceforge.net/projects/htmlsax PEAR::XML_HTMLSax}. - - - There is currently a sad lack of material on mock objects, which is a shame - as unit testing without them is a lot more work. - The {@link http://www.sidewize.com/company/mockobjects.pdf original mock objects paper} - is very Java focused, but still worth a read. - As a new technology there are plenty of discussions and debate on how to use mocks, - often on Wikis such as - {@link http://xpdeveloper.com/cgi-bin/oldwiki.cgi?MockObjects Extreme Tuesday} - or {@link http://www.mockobjects.com/wiki/MocksObjectsPaper www.mockobjects.com} - or {@link http://c2.com/cgi/wiki?MockObject the original C2 Wiki}. - Injecting mocks into a class is the main area of debate for which this - {@link http://www-106.ibm.com/developerworks/java/library/j-mocktest.html paper on IBM} - makes a good starting point. - - - There are plenty of web testing tools, but most are written in Java and - tutorials and advice are rather thin on the ground. - The only hope is to look at the documentation for - {@link http://httpunit.sourceforge.net/ HTTPUnit}, - {@link http://htmlunit.sourceforge.net/ HTMLUnit} - or {@link http://jwebunit.sourceforge.net/ JWebUnit} and hope for clues. - There are some XML driven test frameworks, but again most - require Java to run. - As SimpleTest does not support JavaScript you would probably - have to look at these tools anyway if you have highly dynamic - pages. - - -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/SimpleTest.pkg.ini b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/SimpleTest.pkg.ini deleted file mode 100644 index 695548d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/SimpleTest.pkg.ini +++ /dev/null @@ -1,10 +0,0 @@ -[Linked Tutorials] -UnitTestCase -GroupTests -ServerStubs -MockObjects -PartialMock -Reporting -Expectations -WebTester -FormTesting \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/UnitTestCase.pkg b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/UnitTestCase.pkg deleted file mode 100644 index 3f48c5f..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/UnitTestCase.pkg +++ /dev/null @@ -1,405 +0,0 @@ - - - -Unit tester - - - {@toc} - - -Unit test cases - - The core system is a regression testing framework built around - test cases. - A sample test case looks like this... - -class FileTestCase extends UnitTestCase { -} - - If no test name is supplied when chaining the constructor then - the class name will be taken instead. - This will be the name displayed in the test results. - - - Actual tests are added as methods in the test case whose names - by default start with the string "test" and - when the test case is invoked all such methods are run in - the order that PHP introspection finds them. - As many test methods can be added as needed. - For example... - -require_once('../classes/writer.php'); - -class FileTestCase extends UnitTestCase { - function FileTestCase() { - $this->UnitTestCase('File test'); - } - - function setUp() { - @unlink('../temp/test.txt'); - } - - function tearDown() { - @unlink('../temp/test.txt'); - } - - function testCreation() { - $writer = &new FileWriter('../temp/test.txt'); - $writer->write('Hello'); - $this->assertTrue(file_exists('../temp/test.txt'), 'File created'); - } -} - - The constructor is optional and usually omitted. - Without a name, the class name is taken as the name of the test case. - - - Our only test method at the moment is testCreation() - where we check that a file has been created by our - Writer object. - We could have put the unlink() - code into this method as well, but by placing it in - setUp() and - tearDown() we can use it with - other test methods that we add. - - - The setUp() method is run - just before each and every test method. - tearDown() is run just after - each and every test method. - - - You can place some test case set up into the constructor to - be run once for all the methods in the test case, but - you risk test inteference that way. - This way is slightly slower, but it is safer. - Note that if you come from a JUnit background this will not - be the behaviour you are used to. - JUnit surprisingly reinstantiates the test case for each test - method to prevent such interference. - SimpleTest requires the end user to use setUp(), but - supplies additional hooks for library writers. - - - The means of reporting test results (see below) are by a - visiting display class - that is notified by various assert...() - methods. - Here is the full list for the UnitTestCase - class, the default for SimpleTest... - - - - -assertTrue($x) - -Fail if $x is false - - - -assertFalse($x) - -Fail if $x is true - - - -assertNull($x) - -Fail if $x is set - - - -assertNotNull($x) - -Fail if $x not set - - - -assertIsA($x, $t) - -Fail if $x is not the class or type $t - - - -assertNotA($x, $t) - -Fail if $x is of the class or type $t - - - -assertEqual($x, $y) - -Fail if $x == $y is false - - - -assertNotEqual($x, $y) - -Fail if $x == $y is true - - - -assertIdentical($x, $y) - -Fail if $x == $y is false or a type mismatch - - - -assertNotIdentical($x, $y) - -Fail if $x == $y is true and types match - - - -assertReference($x, $y) - -Fail unless $x and $y are the same variable - - - -assertCopy($x, $y) - -Fail if $x and $y are the same variable - - - -assertWantedPattern($p, $x) - -Fail unless the regex $p matches $x - - - -assertNoUnwantedPattern($p, $x) - -Fail if the regex $p matches $x - - - -assertNoErrors() - -Fail if any PHP error occoured - - - -assertError($x) - -Fail if no PHP error or incorrect message - - - -assertErrorPattern($p) - -Fail unless the error matches the regex $p - - -
    - All assertion methods can take an optional description to - label the displayed result with. - If omitted a default message is sent instead which is usually - sufficient. - This default message can still be embedded in your own message - if you include "%s" within the string. - All the assertions return true on a pass or false on failure. -
    - - Some examples... - -$variable = null; -$this->assertNull($variable, 'Should be cleared'); - - ...will pass and normally show no message. - If you have - {@link http://www.lastcraft.com/display_subclass_tutorial.php set up the tester to display passes} - as well then the message will be displayed as is. - -$this->assertIdentical(0, false, 'Zero is not false [%s]'); - - This will fail as it performs a type - check as well as a comparison between the two values. - The "%s" part is replaced by the default - error message that would have been shown if we had not - supplied our own. - This also allows us to nest test messages. - -$a = 1; -$b = $a; -$this->assertReference($a, $b); - - Will fail as the variable $a is a copy of $b. - -$this->assertWantedPattern('/hello/i', 'Hello world'); - - This will pass as using a case insensitive match the string - hello is contained in Hello world. - -trigger_error('Disaster'); -trigger_error('Catastrophe'); -$this->assertError(); -$this->assertError('Catastrophe'); -$this->assertNoErrors(); - - This one takes some explanation as in fact they all pass! - - - PHP errors in SimpleTest are trapped and placed in a queue. - Here the first error check catches the "Disaster" - message without checking the text and passes. - This removes the error from the queue. - The next error check tests not only the existence of the error, - but also the text which here matches so another pass. - With the queue now empty the last test will pass as well. - If any unchecked errors are left at the end of a test method then - an exception will be reported in the test. - Note that SimpleTest cannot catch compile time PHP errors. - - - The test cases also have some convenience methods for debugging - code or extending the suite... - - - - -setUp() - -Runs this before each test method - - - -tearDown() - -Runs this after each test method - - - -pass() - -Sends a test pass - - - -fail() - -Sends a test failure - - - -error() - -Sends an exception event - - - -sendMessage() - -Sends a status message to those displays that support it - - - -signal($type, $payload) - -Sends a user defined message to the test reporter - - - -dump($var) - -Does a formatted print_r() for quick and dirty debugging - - - -swallowErrors() - -Clears the error queue - - -
    -
    -
    - -Extending test cases - - Of course additional test methods can be added to create - specific types of test case too so as to extend framework... - -require_once('simpletest/unit_tester.php'); - -class FileTester extends UnitTestCase { - function FileTester($name = false) { - $this->UnitTestCase($name); - } - - function assertFileExists($filename, $message = '%s') { - $this->assertTrue( - file_exists($filename), - sprintf($message, 'File [$filename] existence check')); - } -} - - Here the SimpleTest library is held in a folder called - simpletest that is local. - Substitute your own path for this. - - - This new case can be now be inherited just like - a normal test case... - -class FileTestCase extends FileTester { - - function setUp() { - @unlink('../temp/test.txt'); - } - - function tearDown() { - @unlink('../temp/test.txt'); - } - - function testCreation() { - $writer = &new FileWriter('../temp/test.txt'); - $writer->write('Hello'); - $this->assertFileExists('../temp/test.txt'); - } -} - - - - If you want a test case that does not have all of the - UnitTestCase assertions, - only your own and assertTrue(), - you need to extend the SimpleTestCase - class instead. - It is found in simple_test.php rather than - unit_tester.php. - See {@link later.html later} if you - want to incorporate other unit tester's - test cases in your test suites. - - - -Running a single test case - - You won't often run single test cases except when bashing - away at a module that is having difficulty and you don't - want to upset the main test suite. - Here is the scaffolding needed to run the a lone test case... - -<?php - require_once('simpletest/unit_tester.php'); - require_once('simpletest/reporter.php'); - require_once('../classes/writer.php'); - - class FileTestCase extends UnitTestCase { - function FileTestCase() { - $this->UnitTestCase('File test'); - } - } - - $test = &new FileTestCase(); - $test->run(new HtmlReporter()); -?> - - This script will run as is, but will output zero passes - and zero failures until test methods are added. - - -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/WebTester.pkg b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/WebTester.pkg deleted file mode 100644 index 1ceb5cc..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/tutorials/SimpleTest/WebTester.pkg +++ /dev/null @@ -1,610 +0,0 @@ - - - -Web tester - - - {@toc} - - -Fetching a page - - Testing classes is all very well, but PHP is predominately - a language for creating functionality within web pages. - How do we test the front end presentation role of our PHP - applications? - Well the web pages are just text, so we should be able to - examine them just like any other test data. - - - This leads to a tricky issue. - If we test at too low a level, testing for matching tags - in the page with pattern matching for example, our tests will - be brittle. - The slightest change in layout could break a large number of - tests. - If we test at too high a level, say using mock versions of a - template engine, then we lose the ability to automate some classes - of test. - For example, the interaction of forms and navigation will - have to be tested manually. - These types of test are extremely repetitive and error prone. - - - SimpleTest includes a special form of test case for the testing - of web page actions. - The WebTestCase includes facilities - for navigation, content and cookie checks and form handling. - Usage of these test cases is similar to the - {@link UnitTestCase.html UnitTestCase}... - -class TestOfLastcraft extends WebTestCase { -} - - Here we are about to test the - {@link http://www/lastcraft.com/ Last Craft} site itself. - If this test case is in a file called lastcraft_test.php - then it can be loaded in a runner script just like unit tests... - -<?php - require_once('simpletest/web_tester.php'); - require_once('simpletest/reporter.php'); - - $test = &new GroupTest('Web site tests'); - $test->addTestFile('lastcraft_test.php'); - exit ($test->run(new TextReporter()) ? 0 : 1); -?> - - I am using the text reporter here to more clearly - distinguish the web content from the test output. - - - Nothing is being tested yet. - We can fetch the home page by using the - get() method... - -class TestOfLastcraft extends WebTestCase { - - function testHomepage() { - $this->assertTrue($this->get('http://www.lastcraft.com/')); - } -} - - The get() method will - return true only if page content was successfully - loaded. - It is a simple, but crude way to check that a web page - was actually delivered by the web server. - However that content may be a 404 response and yet - our get() method will still return true. - - - Assuming that the web server for the Last Craft site is up - (sadly not always the case), we should see... -
    -Web site tests
    -OK
    -Test cases run: 1/1, Failures: 0, Exceptions: 0
    -
    - All we have really checked is that any kind of page was - returned. - We don't yet know if it was the right one. -
    -
    - -Testing page content - - To confirm that the page we think we are on is actually the - page we are on, we need to verify the page content. - -class TestOfLastcraft extends WebTestCase { - - function testHomepage() { - $this->get('http://www.lastcraft.com/'); - $this->assertWantedPattern('/why the last craft/i'); - } -} - - The page from the last fetch is held in a buffer in - the test case, so there is no need to refer to it directly. - The pattern match is always made against the buffer. - - - Here is the list of possible content assertions... - - - - -assertTitle($title) - -Pass if title is an exact match - - - -assertWantedPattern($pattern) - -A Perl pattern match against the page content - - - -assertNoUnwantedPattern($pattern) - -A Perl pattern match to not find content - - - -assertWantedText($text) - -Pass if matches visible and "alt" text - - - -assertNoUnwantedText($text) - -Pass if doesn't match visible and "alt" text - - - -assertLink($label) - -Pass if a link with this text is present - - - -assertNoLink($label) - -Pass if no link with this text is present - - - -assertLinkById($id) - -Pass if a link with this id attribute is present - - - -assertNoLinkById($id) - -Pass if no link with this id attribute is present - - - -assertField($name, $value) - -Pass if an input tag with this name has this value - - - -assertFieldById($id, $value) - -Pass if an input tag with this id has this value - - - -assertResponse($codes) - -Pass if HTTP response matches this list - - - -assertMime($types) - -Pass if MIME type is in this list - - - -assertAuthentication($protocol) - -Pass if the current challenge is this protocol - - - -assertNoAuthentication() - -Pass if there is no current challenge - - - -assertRealm($name) - -Pass if the current challenge realm matches - - - -assertHeader($header, $content) - -Pass if a header was fetched matching this value - - - -assertNoUnwantedHeader($header) - -Pass if a header was not fetched - - - -assertHeaderPattern($header, $pattern) - -Pass if a header was fetched matching this Perl regex - - - -assertCookie($name, $value) - -Pass if there is currently a matching cookie - - - -assertNoCookie($name) - -Pass if there is currently no cookie of this name - - -
    - As usual with the SimpleTest assertions, they all return - false on failure and true on pass. - They also allow an optional test message and you can embed - the original test message inside using "%s" inside - your custom message. -
    - - So now we could instead test against the title tag with... - -$this->assertTitle('The Last Craft? Web developer tutorials on PHP, Extreme programming and Object Oriented development'); - - As well as the simple HTML content checks we can check - that the MIME type is in a list of allowed types with... - -$this->assertMime(array('text/plain', 'text/html')); - - More interesting is checking the HTTP response code. - Like the MIME type, we can assert that the response code - is in a list of allowed values... - -class TestOfLastcraft extends WebTestCase { - - function testRedirects() { - $this->get('http://www.lastcraft.com/test/redirect.php'); - $this->assertResponse(200);</strong> - } -} - - Here we are checking that the fetch is successful by - allowing only a 200 HTTP response. - This test will pass, but it is not actually correct to do so. - There is no page, instead the server issues a redirect. - The WebTestCase will - automatically follow up to three such redirects. - The tests are more robust this way and we are usually - interested in the interaction with the pages rather - than their delivery. - If the redirects are of interest then this ability must - be disabled... - -class TestOfLastcraft extends WebTestCase { - - function testHomepage() { - $this->setMaximumRedirects(0); - $this->get('http://www.lastcraft.com/test/redirect.php'); - $this->assertResponse(200); - } -} - - The assertion now fails as expected... -
    -Web site tests
    -1) Expecting response in [200] got [302]
    -	in testhomepage
    -	in testoflastcraft
    -	in lastcraft_test.php
    -FAILURES!!!
    -Test cases run: 1/1, Failures: 1, Exceptions: 0
    -
    - We can modify the test to correctly assert redirects with... - -class TestOfLastcraft extends WebTestCase { - - function testHomepage() { - $this->setMaximumRedirects(0); - $this->get('http://www.lastcraft.com/test/redirect.php'); - $this->assertResponse(array(301, 302, 303, 307)); - } -} - - This now passes. -
    -
    - -Navigating a web site - - Users don't often navigate sites by typing in URLs, but by - clicking links and buttons. - Here we confirm that the contact details can be reached - from the home page... - -class TestOfLastcraft extends WebTestCase { - ... - function testContact() { - $this->get('http://www.lastcraft.com/'); - $this->clickLink('About'); - $this->assertTitle('About Last Craft'); - } -} - - The parameter is the text of the link. - - - If the target is a button rather than an anchor tag, then - clickSubmit() should be used - with the button title... - -$this->clickSubmit('Go!'); - - - - The list of navigation methods is... - - - - -getUrl() - -The current location - - - -get($url, $parameters) - -Send a GET request with these parameters - - - -post($url, $parameters) - -Send a POST request with these parameters - - - -head($url, $parameters) - -Send a HEAD request without replacing the page content - - - -retry() - -Reload the last request - - - -back() - -Like the browser back button - - - -forward() - -Like the browser forward button - - - -authenticate($name, $password) - -Retry after a challenge - - - -restart() - -Restarts the browser as if a new session - - - -getCookie($name) - -Gets the cookie value for the current context - - - -ageCookies($interval) - -Ages current cookies prior to a restart - - - -clearFrameFocus() - -Go back to treating all frames as one page - - - -clickSubmit($label) - -Click the first button with this label - - - -clickSubmitByName($name) - -Click the button with this name attribute - - - -clickSubmitById($id) - -Click the button with this ID attribute - - - -clickImage($label, $x, $y) - -Click an input tag of type image by title or alt text - - - -clickImageByName($name, $x, $y) - -Click an input tag of type image by name - - - -clickImageById($id, $x, $y) - -Click an input tag of type image by ID attribute - - - -submitFormById($id) - -Submit a form without the submit value - - - -clickLink($label, $index) - -Click an anchor by the visible label text - - - -clickLinkById($id) - -Click an anchor by the ID attribute - - - -getFrameFocus() - -The name of the currently selected frame - - - -setFrameFocusByIndex($choice) - -Focus on a frame counting from 1 - - - -setFrameFocus($name) - -Focus on a frame by name - - -
    -
    - - The parameters in the get(), post() or - head() methods are optional. - The HTTP HEAD fetch does not change the browser context, only loads - cookies. - This can be useful for when an image or stylesheet sets a cookie - for crafty robot blocking. - - - The retry(), back() and - forward() commands work as they would on - your web browser. - They use the history to retry pages. - This can be handy for checking the effect of hitting the - back button on your forms. - - - The frame methods need a little explanation. - By default a framed page is treated just like any other. - Content will be searced for throughout the entire frameset, - so clicking a link will work no matter which frame - the anchor tag is in. - You can override this behaviour by focusing on a single - frame. - If you do that, all searches and actions will apply to that - frame alone, such as authentication and retries. - If a link or button is not in a focused frame then it cannot - be clicked. - - - Testing navigation on fixed pages only tells you when you - have broken an entire script. - For highly dynamic pages, such as for bulletin boards, this can - be crucial for verifying the correctness of the application. - For most applications though, the really tricky logic is usually in - the handling of forms and sessions. - Fortunately SimpleTest includes - {@link tools for testing web forms.html tools for testing web forms} - as well. - -
    - -Modifying the request - - Although SimpleTest does not have the goal of testing networking - problems, it does include some methods to modify and debug - the requests it makes. - Here is another method list... - - - - -getTransportError() - -The last socket error - - - -showRequest() - -Dump the outgoing request - - - -showHeaders() - -Dump the incoming headers - - - -showSource() - -Dump the raw HTML page content - - - -ignoreFrames() - -Do not load framesets - - - -setCookie($name, $value) - -Set a cookie from now on - - - -addHeader($header) - -Always add this header to the request - - - -setMaximumRedirects($max) - -Stop after this many redirects - - - -setConnectionTimeout($timeout) - -Kill the connection after this time between bytes - - - -useProxy($proxy, $name, $password) - -Make requests via this proxy URL - - -
    - These methods are principally for debugging. -
    -
    -
    diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/unit_tester.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/unit_tester.php deleted file mode 100644 index 513f09a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/unit_tester.php +++ /dev/null @@ -1,402 +0,0 @@ -assert(new TrueExpectation(), $result, $message); - } - - /** - * Will be true on false and vice versa. False - * is the PHP definition of false, so that null, - * empty strings, zero and an empty array all count - * as false. - * @param boolean $result Pass on false. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assertFalse($result, $message = '%s') { - return $this->assert(new FalseExpectation(), $result, $message); - } - - /** - * Will be true if the value is null. - * @param null $value Supposedly null value. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assertNull($value, $message = '%s') { - $dumper = new SimpleDumper(); - $message = sprintf( - $message, - '[' . $dumper->describeValue($value) . '] should be null'); - return $this->assertTrue(! isset($value), $message); - } - - /** - * Will be true if the value is set. - * @param mixed $value Supposedly set value. - * @param string $message Message to display. - * @return boolean True on pass. - * @access public - */ - function assertNotNull($value, $message = '%s') { - $dumper = new SimpleDumper(); - $message = sprintf( - $message, - '[' . $dumper->describeValue($value) . '] should not be null'); - return $this->assertTrue(isset($value), $message); - } - - /** - * Type and class test. Will pass if class - * matches the type name or is a subclass or - * if not an object, but the type is correct. - * @param mixed $object Object to test. - * @param string $type Type name as string. - * @param string $message Message to display. - * @return boolean True on pass. - * @access public - */ - function assertIsA($object, $type, $message = '%s') { - return $this->assert( - new IsAExpectation($type), - $object, - $message); - } - - /** - * Type and class mismatch test. Will pass if class - * name or underling type does not match the one - * specified. - * @param mixed $object Object to test. - * @param string $type Type name as string. - * @param string $message Message to display. - * @return boolean True on pass. - * @access public - */ - function assertNotA($object, $type, $message = '%s') { - return $this->assert( - new NotAExpectation($type), - $object, - $message); - } - - /** - * Will trigger a pass if the two parameters have - * the same value only. Otherwise a fail. - * @param mixed $first Value to compare. - * @param mixed $second Value to compare. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assertEqual($first, $second, $message = '%s') { - return $this->assert( - new EqualExpectation($first), - $second, - $message); - } - - /** - * Will trigger a pass if the two parameters have - * a different value. Otherwise a fail. - * @param mixed $first Value to compare. - * @param mixed $second Value to compare. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assertNotEqual($first, $second, $message = '%s') { - return $this->assert( - new NotEqualExpectation($first), - $second, - $message); - } - - /** - * Will trigger a pass if the if the first parameter - * is near enough to the second by the margin. - * @param mixed $first Value to compare. - * @param mixed $second Value to compare. - * @param mixed $margin Fuzziness of match. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assertWithinMargin($first, $second, $margin, $message = '%s') { - return $this->assert( - new WithinMarginExpectation($first, $margin), - $second, - $message); - } - - /** - * Will trigger a pass if the two parameters differ - * by more than the margin. - * @param mixed $first Value to compare. - * @param mixed $second Value to compare. - * @param mixed $margin Fuzziness of match. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assertOutsideMargin($first, $second, $margin, $message = '%s') { - return $this->assert( - new OutsideMarginExpectation($first, $margin), - $second, - $message); - } - - /** - * Will trigger a pass if the two parameters have - * the same value and same type. Otherwise a fail. - * @param mixed $first Value to compare. - * @param mixed $second Value to compare. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assertIdentical($first, $second, $message = '%s') { - return $this->assert( - new IdenticalExpectation($first), - $second, - $message); - } - - /** - * Will trigger a pass if the two parameters have - * the different value or different type. - * @param mixed $first Value to compare. - * @param mixed $second Value to compare. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assertNotIdentical($first, $second, $message = '%s') { - return $this->assert( - new NotIdenticalExpectation($first), - $second, - $message); - } - - /** - * Will trigger a pass if both parameters refer - * to the same object or value. Fail otherwise. - * This will cause problems testing objects under - * E_STRICT. - * TODO: Replace with expectation. - * @param mixed $first Reference to check. - * @param mixed $second Hopefully the same variable. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assertReference(&$first, &$second, $message = '%s') { - $dumper = new SimpleDumper(); - $message = sprintf( - $message, - '[' . $dumper->describeValue($first) . - '] and [' . $dumper->describeValue($second) . - '] should reference the same object'); - return $this->assertTrue( - SimpleTestCompatibility::isReference($first, $second), - $message); - } - - /** - * Will trigger a pass if both parameters refer - * to the same object. Fail otherwise. This has - * the same semantics at the PHPUnit assertSame. - * That is, if values are passed in it has roughly - * the same affect as assertIdentical. - * TODO: Replace with expectation. - * @param mixed $first Object reference to check. - * @param mixed $second Hopefully the same object. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assertSame($first, $second, $message = '%s') { - $dumper = new SimpleDumper(); - $message = sprintf( - $message, - '[' . $dumper->describeValue($first) . - '] and [' . $dumper->describeValue($second) . - '] should reference the same object'); - return $this->assertTrue($first === $second, $message); - } - - /** - * Will trigger a pass if both parameters refer - * to different objects. Fail otherwise. The objects - * have to be identical though. - * @param mixed $first Object reference to check. - * @param mixed $second Hopefully not the same object. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assertClone($first, $second, $message = '%s') { - $dumper = new SimpleDumper(); - $message = sprintf( - $message, - '[' . $dumper->describeValue($first) . - '] and [' . $dumper->describeValue($second) . - '] should not be the same object'); - $identical = new IdenticalExpectation($first); - return $this->assertTrue( - $identical->test($second) && ! ($first === $second), - $message); - } - - /** - * Will trigger a pass if both parameters refer - * to different variables. Fail otherwise. The objects - * have to be identical references though. - * This will fail under E_STRICT with objects. Use - * assertClone() for this. - * @param mixed $first Object reference to check. - * @param mixed $second Hopefully not the same object. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assertCopy(&$first, &$second, $message = "%s") { - $dumper = new SimpleDumper(); - $message = sprintf( - $message, - "[" . $dumper->describeValue($first) . - "] and [" . $dumper->describeValue($second) . - "] should not be the same object"); - return $this->assertFalse( - SimpleTestCompatibility::isReference($first, $second), - $message); - } - - /** - * Will trigger a pass if the Perl regex pattern - * is found in the subject. Fail otherwise. - * @param string $pattern Perl regex to look for including - * the regex delimiters. - * @param string $subject String to search in. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assertPattern($pattern, $subject, $message = '%s') { - return $this->assert( - new PatternExpectation($pattern), - $subject, - $message); - } - - /** - * Will trigger a pass if the perl regex pattern - * is not present in subject. Fail if found. - * @param string $pattern Perl regex to look for including - * the regex delimiters. - * @param string $subject String to search in. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assertNoPattern($pattern, $subject, $message = '%s') { - return $this->assert( - new NoPatternExpectation($pattern), - $subject, - $message); - } - - /** - * Prepares for an error. If the error mismatches it - * passes through, otherwise it is swallowed. Any - * left over errors trigger failures. - * @param SimpleExpectation/string $expected The error to match. - * @param string $message Message on failure. - * @access public - */ - function expectError($expected = false, $message = '%s') { - $queue = SimpleTest::getContext()->get('SimpleErrorQueue'); - $queue->expectError($this->coerceExpectation($expected), $message); - } - - /** - * Prepares for an exception. If the error mismatches it - * passes through, otherwise it is swallowed. Any - * left over errors trigger failures. - * @param SimpleExpectation/Exception $expected The error to match. - * @param string $message Message on failure. - * @access public - */ - function expectException($expected = false, $message = '%s') { - $queue = SimpleTest::getContext()->get('SimpleExceptionTrap'); - $line = $this->getAssertionLine(); - $queue->expectException($expected, $message . $line); - } - - /** - * Creates an equality expectation if the - * object/value is not already some type - * of expectation. - * @param mixed $expected Expected value. - * @return SimpleExpectation Expectation object. - * @access private - */ - protected function coerceExpectation($expected) { - if ($expected == false) { - return new TrueExpectation(); - } - if (SimpleTestCompatibility::isA($expected, 'SimpleExpectation')) { - return $expected; - } - return new EqualExpectation( - is_string($expected) ? str_replace('%', '%%', $expected) : $expected); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/url.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/url.php deleted file mode 100644 index 00b0bca..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/url.php +++ /dev/null @@ -1,550 +0,0 @@ -chompCoordinates($url); - $this->setCoordinates($x, $y); - $this->scheme = $this->chompScheme($url); - if ($this->scheme === 'file') { - // Unescaped backslashes not used in directory separator context - // will get caught by this, but they should have been urlencoded - // anyway so we don't care. If this ends up being a problem, the - // host regexp must be modified to match for backslashes when - // the scheme is file. - $url = str_replace('\\', '/', $url); - } - list($this->username, $this->password) = $this->chompLogin($url); - $this->host = $this->chompHost($url); - $this->port = false; - if (preg_match('/(.*?):(.*)/', $this->host, $host_parts)) { - if ($this->scheme === 'file' && strlen($this->host) === 2) { - // DOS drive was placed in authority; promote it to path. - $url = '/' . $this->host . $url; - $this->host = false; - } else { - $this->host = $host_parts[1]; - $this->port = (integer)$host_parts[2]; - } - } - $this->path = $this->chompPath($url); - $this->request = $this->parseRequest($this->chompRequest($url)); - $this->fragment = (strncmp($url, "#", 1) == 0 ? substr($url, 1) : false); - $this->target = false; - } - - /** - * Extracts the X, Y coordinate pair from an image map. - * @param string $url URL so far. The coordinates will be - * removed. - * @return array X, Y as a pair of integers. - * @access private - */ - protected function chompCoordinates(&$url) { - if (preg_match('/(.*)\?(\d+),(\d+)$/', $url, $matches)) { - $url = $matches[1]; - return array((integer)$matches[2], (integer)$matches[3]); - } - return array(false, false); - } - - /** - * Extracts the scheme part of an incoming URL. - * @param string $url URL so far. The scheme will be - * removed. - * @return string Scheme part or false. - * @access private - */ - protected function chompScheme(&$url) { - if (preg_match('#^([^/:]*):(//)(.*)#', $url, $matches)) { - $url = $matches[2] . $matches[3]; - return $matches[1]; - } - return false; - } - - /** - * Extracts the username and password from the - * incoming URL. The // prefix will be reattached - * to the URL after the doublet is extracted. - * @param string $url URL so far. The username and - * password are removed. - * @return array Two item list of username and - * password. Will urldecode() them. - * @access private - */ - protected function chompLogin(&$url) { - $prefix = ''; - if (preg_match('#^(//)(.*)#', $url, $matches)) { - $prefix = $matches[1]; - $url = $matches[2]; - } - if (preg_match('#^([^/]*)@(.*)#', $url, $matches)) { - $url = $prefix . $matches[2]; - $parts = split(":", $matches[1]); - return array( - urldecode($parts[0]), - isset($parts[1]) ? urldecode($parts[1]) : false); - } - $url = $prefix . $url; - return array(false, false); - } - - /** - * Extracts the host part of an incoming URL. - * Includes the port number part. Will extract - * the host if it starts with // or it has - * a top level domain or it has at least two - * dots. - * @param string $url URL so far. The host will be - * removed. - * @return string Host part guess or false. - * @access private - */ - protected function chompHost(&$url) { - if (preg_match('!^(//)(.*?)(/.*|\?.*|#.*|$)!', $url, $matches)) { - $url = $matches[3]; - return $matches[2]; - } - if (preg_match('!(.*?)(\.\./|\./|/|\?|#|$)(.*)!', $url, $matches)) { - $tlds = SimpleUrl::getAllTopLevelDomains(); - if (preg_match('/[a-z0-9\-]+\.(' . $tlds . ')/i', $matches[1])) { - $url = $matches[2] . $matches[3]; - return $matches[1]; - } elseif (preg_match('/[a-z0-9\-]+\.[a-z0-9\-]+\.[a-z0-9\-]+/i', $matches[1])) { - $url = $matches[2] . $matches[3]; - return $matches[1]; - } - } - return false; - } - - /** - * Extracts the path information from the incoming - * URL. Strips this path from the URL. - * @param string $url URL so far. The host will be - * removed. - * @return string Path part or '/'. - * @access private - */ - protected function chompPath(&$url) { - if (preg_match('/(.*?)(\?|#|$)(.*)/', $url, $matches)) { - $url = $matches[2] . $matches[3]; - return ($matches[1] ? $matches[1] : ''); - } - return ''; - } - - /** - * Strips off the request data. - * @param string $url URL so far. The request will be - * removed. - * @return string Raw request part. - * @access private - */ - protected function chompRequest(&$url) { - if (preg_match('/\?(.*?)(#|$)(.*)/', $url, $matches)) { - $url = $matches[2] . $matches[3]; - return $matches[1]; - } - return ''; - } - - /** - * Breaks the request down into an object. - * @param string $raw Raw request. - * @return SimpleFormEncoding Parsed data. - * @access private - */ - protected function parseRequest($raw) { - $this->raw = $raw; - $request = new SimpleGetEncoding(); - foreach (split("&", $raw) as $pair) { - if (preg_match('/(.*?)=(.*)/', $pair, $matches)) { - $request->add($matches[1], urldecode($matches[2])); - } elseif ($pair) { - $request->add($pair, ''); - } - } - return $request; - } - - /** - * Accessor for protocol part. - * @param string $default Value to use if not present. - * @return string Scheme name, e.g "http". - * @access public - */ - function getScheme($default = false) { - return $this->scheme ? $this->scheme : $default; - } - - /** - * Accessor for user name. - * @return string Username preceding host. - * @access public - */ - function getUsername() { - return $this->username; - } - - /** - * Accessor for password. - * @return string Password preceding host. - * @access public - */ - function getPassword() { - return $this->password; - } - - /** - * Accessor for hostname and port. - * @param string $default Value to use if not present. - * @return string Hostname only. - * @access public - */ - function getHost($default = false) { - return $this->host ? $this->host : $default; - } - - /** - * Accessor for top level domain. - * @return string Last part of host. - * @access public - */ - function getTld() { - $path_parts = pathinfo($this->getHost()); - return (isset($path_parts['extension']) ? $path_parts['extension'] : false); - } - - /** - * Accessor for port number. - * @return integer TCP/IP port number. - * @access public - */ - function getPort() { - return $this->port; - } - - /** - * Accessor for path. - * @return string Full path including leading slash if implied. - * @access public - */ - function getPath() { - if (! $this->path && $this->host) { - return '/'; - } - return $this->path; - } - - /** - * Accessor for page if any. This may be a - * directory name if ambiguious. - * @return Page name. - * @access public - */ - function getPage() { - if (! preg_match('/([^\/]*?)$/', $this->getPath(), $matches)) { - return false; - } - return $matches[1]; - } - - /** - * Gets the path to the page. - * @return string Path less the page. - * @access public - */ - function getBasePath() { - if (! preg_match('/(.*\/)[^\/]*?$/', $this->getPath(), $matches)) { - return false; - } - return $matches[1]; - } - - /** - * Accessor for fragment at end of URL after the "#". - * @return string Part after "#". - * @access public - */ - function getFragment() { - return $this->fragment; - } - - /** - * Sets image coordinates. Set to false to clear - * them. - * @param integer $x Horizontal position. - * @param integer $y Vertical position. - * @access public - */ - function setCoordinates($x = false, $y = false) { - if (($x === false) || ($y === false)) { - $this->x = $this->y = false; - return; - } - $this->x = (integer)$x; - $this->y = (integer)$y; - } - - /** - * Accessor for horizontal image coordinate. - * @return integer X value. - * @access public - */ - function getX() { - return $this->x; - } - - /** - * Accessor for vertical image coordinate. - * @return integer Y value. - * @access public - */ - function getY() { - return $this->y; - } - - /** - * Accessor for current request parameters - * in URL string form. Will return teh original request - * if at all possible even if it doesn't make much - * sense. - * @return string Form is string "?a=1&b=2", etc. - * @access public - */ - function getEncodedRequest() { - if ($this->raw) { - $encoded = $this->raw; - } else { - $encoded = $this->request->asUrlRequest(); - } - if ($encoded) { - return '?' . preg_replace('/^\?/', '', $encoded); - } - return ''; - } - - /** - * Adds an additional parameter to the request. - * @param string $key Name of parameter. - * @param string $value Value as string. - * @access public - */ - function addRequestParameter($key, $value) { - $this->raw = false; - $this->request->add($key, $value); - } - - /** - * Adds additional parameters to the request. - * @param hash/SimpleFormEncoding $parameters Additional - * parameters. - * @access public - */ - function addRequestParameters($parameters) { - $this->raw = false; - $this->request->merge($parameters); - } - - /** - * Clears down all parameters. - * @access public - */ - function clearRequest() { - $this->raw = false; - $this->request = new SimpleGetEncoding(); - } - - /** - * Gets the frame target if present. Although - * not strictly part of the URL specification it - * acts as similarily to the browser. - * @return boolean/string Frame name or false if none. - * @access public - */ - function getTarget() { - return $this->target; - } - - /** - * Attaches a frame target. - * @param string $frame Name of frame. - * @access public - */ - function setTarget($frame) { - $this->raw = false; - $this->target = $frame; - } - - /** - * Renders the URL back into a string. - * @return string URL in canonical form. - * @access public - */ - function asString() { - $path = $this->path; - $scheme = $identity = $host = $port = $encoded = $fragment = ''; - if ($this->username && $this->password) { - $identity = $this->username . ':' . $this->password . '@'; - } - if ($this->getHost()) { - $scheme = $this->getScheme() ? $this->getScheme() : 'http'; - $scheme .= '://'; - $host = $this->getHost(); - } elseif ($this->getScheme() === 'file') { - // Safest way; otherwise, file URLs on Windows have an extra - // leading slash. It might be possible to convert file:// - // URIs to local file paths, but that requires more research. - $scheme = 'file://'; - } - if ($this->getPort() && $this->getPort() != 80 ) { - $port = ':'.$this->getPort(); - } - - if (substr($this->path, 0, 1) == '/') { - $path = $this->normalisePath($this->path); - } - $encoded = $this->getEncodedRequest(); - $fragment = $this->getFragment() ? '#'. $this->getFragment() : ''; - $coords = $this->getX() === false ? '' : '?' . $this->getX() . ',' . $this->getY(); - return "$scheme$identity$host$port$path$encoded$fragment$coords"; - } - - /** - * Replaces unknown sections to turn a relative - * URL into an absolute one. The base URL can - * be either a string or a SimpleUrl object. - * @param string/SimpleUrl $base Base URL. - * @access public - */ - function makeAbsolute($base) { - if (! is_object($base)) { - $base = new SimpleUrl($base); - } - if ($this->getHost()) { - $scheme = $this->getScheme(); - $host = $this->getHost(); - $port = $this->getPort() ? ':' . $this->getPort() : ''; - $identity = $this->getIdentity() ? $this->getIdentity() . '@' : ''; - if (! $identity) { - $identity = $base->getIdentity() ? $base->getIdentity() . '@' : ''; - } - } else { - $scheme = $base->getScheme(); - $host = $base->getHost(); - $port = $base->getPort() ? ':' . $base->getPort() : ''; - $identity = $base->getIdentity() ? $base->getIdentity() . '@' : ''; - } - $path = $this->normalisePath($this->extractAbsolutePath($base)); - $encoded = $this->getEncodedRequest(); - $fragment = $this->getFragment() ? '#'. $this->getFragment() : ''; - $coords = $this->getX() === false ? '' : '?' . $this->getX() . ',' . $this->getY(); - return new SimpleUrl("$scheme://$identity$host$port$path$encoded$fragment$coords"); - } - - /** - * Replaces unknown sections of the path with base parts - * to return a complete absolute one. - * @param string/SimpleUrl $base Base URL. - * @param string Absolute path. - * @access private - */ - protected function extractAbsolutePath($base) { - if ($this->getHost()) { - return $this->path; - } - if (! $this->isRelativePath($this->path)) { - return $this->path; - } - if ($this->path) { - return $base->getBasePath() . $this->path; - } - return $base->getPath(); - } - - /** - * Simple test to see if a path part is relative. - * @param string $path Path to test. - * @return boolean True if starts with a "/". - * @access private - */ - protected function isRelativePath($path) { - return (substr($path, 0, 1) != '/'); - } - - /** - * Extracts the username and password for use in rendering - * a URL. - * @return string/boolean Form of username:password or false. - * @access public - */ - function getIdentity() { - if ($this->username && $this->password) { - return $this->username . ':' . $this->password; - } - return false; - } - - /** - * Replaces . and .. sections of the path. - * @param string $path Unoptimised path. - * @return string Path with dots removed if possible. - * @access public - */ - function normalisePath($path) { - $path = preg_replace('|/\./|', '/', $path); - return preg_replace('|/[^/]+/\.\./|', '/', $path); - } - - /** - * A pipe seperated list of all TLDs that result in two part - * domain names. - * @return string Pipe separated list. - * @access public - */ - static function getAllTopLevelDomains() { - return 'com|edu|net|org|gov|mil|int|biz|info|name|pro|aero|coop|museum'; - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/user_agent.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/user_agent.php deleted file mode 100644 index c7f6536..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/user_agent.php +++ /dev/null @@ -1,328 +0,0 @@ -cookie_jar = new SimpleCookieJar(); - $this->authenticator = new SimpleAuthenticator(); - } - - /** - * Removes expired and temporary cookies as if - * the browser was closed and re-opened. Authorisation - * has to be obtained again as well. - * @param string/integer $date Time when session restarted. - * If omitted then all persistent - * cookies are kept. - * @access public - */ - function restart($date = false) { - $this->cookie_jar->restartSession($date); - $this->authenticator->restartSession(); - } - - /** - * Adds a header to every fetch. - * @param string $header Header line to add to every - * request until cleared. - * @access public - */ - function addHeader($header) { - $this->additional_headers[] = $header; - } - - /** - * Ages the cookies by the specified time. - * @param integer $interval Amount in seconds. - * @access public - */ - function ageCookies($interval) { - $this->cookie_jar->agePrematurely($interval); - } - - /** - * Sets an additional cookie. If a cookie has - * the same name and path it is replaced. - * @param string $name Cookie key. - * @param string $value Value of cookie. - * @param string $host Host upon which the cookie is valid. - * @param string $path Cookie path if not host wide. - * @param string $expiry Expiry date. - * @access public - */ - function setCookie($name, $value, $host = false, $path = '/', $expiry = false) { - $this->cookie_jar->setCookie($name, $value, $host, $path, $expiry); - } - - /** - * Reads the most specific cookie value from the - * browser cookies. - * @param string $host Host to search. - * @param string $path Applicable path. - * @param string $name Name of cookie to read. - * @return string False if not present, else the - * value as a string. - * @access public - */ - function getCookieValue($host, $path, $name) { - return $this->cookie_jar->getCookieValue($host, $path, $name); - } - - /** - * Reads the current cookies within the base URL. - * @param string $name Key of cookie to find. - * @param SimpleUrl $base Base URL to search from. - * @return string/boolean Null if there is no base URL, false - * if the cookie is not set. - * @access public - */ - function getBaseCookieValue($name, $base) { - if (! $base) { - return null; - } - return $this->getCookieValue($base->getHost(), $base->getPath(), $name); - } - - /** - * Switches off cookie sending and recieving. - * @access public - */ - function ignoreCookies() { - $this->cookies_enabled = false; - } - - /** - * Switches back on the cookie sending and recieving. - * @access public - */ - function useCookies() { - $this->cookies_enabled = true; - } - - /** - * Sets the socket timeout for opening a connection. - * @param integer $timeout Maximum time in seconds. - * @access public - */ - function setConnectionTimeout($timeout) { - $this->connection_timeout = $timeout; - } - - /** - * Sets the maximum number of redirects before - * a page will be loaded anyway. - * @param integer $max Most hops allowed. - * @access public - */ - function setMaximumRedirects($max) { - $this->max_redirects = $max; - } - - /** - * Sets proxy to use on all requests for when - * testing from behind a firewall. Set URL - * to false to disable. - * @param string $proxy Proxy URL. - * @param string $username Proxy username for authentication. - * @param string $password Proxy password for authentication. - * @access public - */ - function useProxy($proxy, $username, $password) { - if (! $proxy) { - $this->proxy = false; - return; - } - if ((strncmp($proxy, 'http://', 7) != 0) && (strncmp($proxy, 'https://', 8) != 0)) { - $proxy = 'http://'. $proxy; - } - $this->proxy = new SimpleUrl($proxy); - $this->proxy_username = $username; - $this->proxy_password = $password; - } - - /** - * Test to see if the redirect limit is passed. - * @param integer $redirects Count so far. - * @return boolean True if over. - * @access private - */ - protected function isTooManyRedirects($redirects) { - return ($redirects > $this->max_redirects); - } - - /** - * Sets the identity for the current realm. - * @param string $host Host to which realm applies. - * @param string $realm Full name of realm. - * @param string $username Username for realm. - * @param string $password Password for realm. - * @access public - */ - function setIdentity($host, $realm, $username, $password) { - $this->authenticator->setIdentityForRealm($host, $realm, $username, $password); - } - - /** - * Fetches a URL as a response object. Will keep trying if redirected. - * It will also collect authentication realm information. - * @param string/SimpleUrl $url Target to fetch. - * @param SimpleEncoding $encoding Additional parameters for request. - * @return SimpleHttpResponse Hopefully the target page. - * @access public - */ - function fetchResponse($url, $encoding) { - if ($encoding->getMethod() != 'POST') { - $url->addRequestParameters($encoding); - $encoding->clear(); - } - $response = $this->fetchWhileRedirected($url, $encoding); - if ($headers = $response->getHeaders()) { - if ($headers->isChallenge()) { - $this->authenticator->addRealm( - $url, - $headers->getAuthentication(), - $headers->getRealm()); - } - } - return $response; - } - - /** - * Fetches the page until no longer redirected or - * until the redirect limit runs out. - * @param SimpleUrl $url Target to fetch. - * @param SimpelFormEncoding $encoding Additional parameters for request. - * @return SimpleHttpResponse Hopefully the target page. - * @access private - */ - protected function fetchWhileRedirected($url, $encoding) { - $redirects = 0; - do { - $response = $this->fetch($url, $encoding); - if ($response->isError()) { - return $response; - } - $headers = $response->getHeaders(); - $location = new SimpleUrl($headers->getLocation()); - $url = $location->makeAbsolute($url); - if ($this->cookies_enabled) { - $headers->writeCookiesToJar($this->cookie_jar, $url); - } - if (! $headers->isRedirect()) { - break; - } - $encoding = new SimpleGetEncoding(); - } while (! $this->isTooManyRedirects(++$redirects)); - return $response; - } - - /** - * Actually make the web request. - * @param SimpleUrl $url Target to fetch. - * @param SimpleFormEncoding $encoding Additional parameters for request. - * @return SimpleHttpResponse Headers and hopefully content. - * @access protected - */ - protected function fetch($url, $encoding) { - $request = $this->createRequest($url, $encoding); - return $request->fetch($this->connection_timeout); - } - - /** - * Creates a full page request. - * @param SimpleUrl $url Target to fetch as url object. - * @param SimpleFormEncoding $encoding POST/GET parameters. - * @return SimpleHttpRequest New request. - * @access private - */ - protected function createRequest($url, $encoding) { - $request = $this->createHttpRequest($url, $encoding); - $this->addAdditionalHeaders($request); - if ($this->cookies_enabled) { - $request->readCookiesFromJar($this->cookie_jar, $url); - } - $this->authenticator->addHeaders($request, $url); - return $request; - } - - /** - * Builds the appropriate HTTP request object. - * @param SimpleUrl $url Target to fetch as url object. - * @param SimpleFormEncoding $parameters POST/GET parameters. - * @return SimpleHttpRequest New request object. - * @access protected - */ - protected function createHttpRequest($url, $encoding) { - return new SimpleHttpRequest($this->createRoute($url), $encoding); - } - - /** - * Sets up either a direct route or via a proxy. - * @param SimpleUrl $url Target to fetch as url object. - * @return SimpleRoute Route to take to fetch URL. - * @access protected - */ - protected function createRoute($url) { - if ($this->proxy) { - return new SimpleProxyRoute( - $url, - $this->proxy, - $this->proxy_username, - $this->proxy_password); - } - return new SimpleRoute($url); - } - - /** - * Adds additional manual headers. - * @param SimpleHttpRequest $request Outgoing request. - * @access private - */ - protected function addAdditionalHeaders(&$request) { - foreach ($this->additional_headers as $header) { - $request->addHeaderLine($header); - } - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/web_tester.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/web_tester.php deleted file mode 100644 index 9c3cb06..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/web_tester.php +++ /dev/null @@ -1,1495 +0,0 @@ -value = $value; - } - - /** - * Tests the expectation. True if it matches - * a string value or an array value in any order. - * @param mixed $compare Comparison value. False for - * an unset field. - * @return boolean True if correct. - * @access public - */ - function test($compare) { - if ($this->value === false) { - return ($compare === false); - } - if ($this->isSingle($this->value)) { - return $this->testSingle($compare); - } - if (is_array($this->value)) { - return $this->testMultiple($compare); - } - return false; - } - - /** - * Tests for valid field comparisons with a single option. - * @param mixed $value Value to type check. - * @return boolean True if integer, string or float. - * @access private - */ - protected function isSingle($value) { - return is_string($value) || is_integer($value) || is_float($value); - } - - /** - * String comparison for simple field with a single option. - * @param mixed $compare String to test against. - * @returns boolean True if matching. - * @access private - */ - protected function testSingle($compare) { - if (is_array($compare) && count($compare) == 1) { - $compare = $compare[0]; - } - if (! $this->isSingle($compare)) { - return false; - } - return ($this->value == $compare); - } - - /** - * List comparison for multivalue field. - * @param mixed $compare List in any order to test against. - * @returns boolean True if matching. - * @access private - */ - protected function testMultiple($compare) { - if (is_string($compare)) { - $compare = array($compare); - } - if (! is_array($compare)) { - return false; - } - sort($compare); - return ($this->value === $compare); - } - - /** - * Returns a human readable test message. - * @param mixed $compare Comparison value. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - $dumper = $this->getDumper(); - if (is_array($compare)) { - sort($compare); - } - if ($this->test($compare)) { - return "Field expectation [" . $dumper->describeValue($this->value) . "]"; - } else { - return "Field expectation [" . $dumper->describeValue($this->value) . - "] fails with [" . - $dumper->describeValue($compare) . "] " . - $dumper->describeDifference($this->value, $compare); - } - } -} - -/** - * Test for a specific HTTP header within a header block. - * @package SimpleTest - * @subpackage WebTester - */ -class HttpHeaderExpectation extends SimpleExpectation { - private $expected_header; - private $expected_value; - - /** - * Sets the field and value to compare against. - * @param string $header Case insenstive trimmed header name. - * @param mixed $value Optional value to compare. If not - * given then any value will match. If - * an expectation object then that will - * be used instead. - * @param string $message Optiona message override. Can use %s as - * a placeholder for the original message. - */ - function __construct($header, $value = false, $message = '%s') { - parent::__construct($message); - $this->expected_header = $this->normaliseHeader($header); - $this->expected_value = $value; - } - - /** - * Accessor for aggregated object. - * @return mixed Expectation set in constructor. - * @access protected - */ - protected function getExpectation() { - return $this->expected_value; - } - - /** - * Removes whitespace at ends and case variations. - * @param string $header Name of header. - * @param string Trimmed and lowecased header - * name. - * @access private - */ - protected function normaliseHeader($header) { - return strtolower(trim($header)); - } - - /** - * Tests the expectation. True if it matches - * a string value or an array value in any order. - * @param mixed $compare Raw header block to search. - * @return boolean True if header present. - * @access public - */ - function test($compare) { - return is_string($this->findHeader($compare)); - } - - /** - * Searches the incoming result. Will extract the matching - * line as text. - * @param mixed $compare Raw header block to search. - * @return string Matching header line. - * @access protected - */ - protected function findHeader($compare) { - $lines = split("\r\n", $compare); - foreach ($lines as $line) { - if ($this->testHeaderLine($line)) { - return $line; - } - } - return false; - } - - /** - * Compares a single header line against the expectation. - * @param string $line A single line to compare. - * @return boolean True if matched. - * @access private - */ - protected function testHeaderLine($line) { - if (count($parsed = split(':', $line, 2)) < 2) { - return false; - } - list($header, $value) = $parsed; - if ($this->normaliseHeader($header) != $this->expected_header) { - return false; - } - return $this->testHeaderValue($value, $this->expected_value); - } - - /** - * Tests the value part of the header. - * @param string $value Value to test. - * @param mixed $expected Value to test against. - * @return boolean True if matched. - * @access protected - */ - protected function testHeaderValue($value, $expected) { - if ($expected === false) { - return true; - } - if (SimpleExpectation::isExpectation($expected)) { - return $expected->test(trim($value)); - } - return (trim($value) == trim($expected)); - } - - /** - * Returns a human readable test message. - * @param mixed $compare Raw header block to search. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - if (SimpleExpectation::isExpectation($this->expected_value)) { - $message = $this->expected_value->overlayMessage($compare, $this->getDumper()); - } else { - $message = $this->expected_header . - ($this->expected_value ? ': ' . $this->expected_value : ''); - } - if (is_string($line = $this->findHeader($compare))) { - return "Searching for header [$message] found [$line]"; - } else { - return "Failed to find header [$message]"; - } - } -} - -/** - * Test for a specific HTTP header within a header block that - * should not be found. - * @package SimpleTest - * @subpackage WebTester - */ -class NoHttpHeaderExpectation extends HttpHeaderExpectation { - private $expected_header; - private $expected_value; - - /** - * Sets the field and value to compare against. - * @param string $unwanted Case insenstive trimmed header name. - * @param string $message Optiona message override. Can use %s as - * a placeholder for the original message. - */ - function __construct($unwanted, $message = '%s') { - parent::__construct($unwanted, false, $message); - } - - /** - * Tests that the unwanted header is not found. - * @param mixed $compare Raw header block to search. - * @return boolean True if header present. - * @access public - */ - function test($compare) { - return ($this->findHeader($compare) === false); - } - - /** - * Returns a human readable test message. - * @param mixed $compare Raw header block to search. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - $expectation = $this->getExpectation(); - if (is_string($line = $this->findHeader($compare))) { - return "Found unwanted header [$expectation] with [$line]"; - } else { - return "Did not find unwanted header [$expectation]"; - } - } -} - -/** - * Test for a text substring. - * @package SimpleTest - * @subpackage UnitTester - */ -class TextExpectation extends SimpleExpectation { - private $substring; - - /** - * Sets the value to compare against. - * @param string $substring Text to search for. - * @param string $message Customised message on failure. - * @access public - */ - function __construct($substring, $message = '%s') { - parent::__construct($message); - $this->substring = $substring; - } - - /** - * Accessor for the substring. - * @return string Text to match. - * @access protected - */ - protected function getSubstring() { - return $this->substring; - } - - /** - * Tests the expectation. True if the text contains the - * substring. - * @param string $compare Comparison value. - * @return boolean True if correct. - * @access public - */ - function test($compare) { - return (strpos($compare, $this->substring) !== false); - } - - /** - * Returns a human readable test message. - * @param mixed $compare Comparison value. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - if ($this->test($compare)) { - return $this->describeTextMatch($this->getSubstring(), $compare); - } else { - $dumper = $this->getDumper(); - return "Text [" . $this->getSubstring() . - "] not detected in [" . - $dumper->describeValue($compare) . "]"; - } - } - - /** - * Describes a pattern match including the string - * found and it's position. - * @param string $substring Text to search for. - * @param string $subject Subject to search. - * @access protected - */ - protected function describeTextMatch($substring, $subject) { - $position = strpos($subject, $substring); - $dumper = $this->getDumper(); - return "Text [$substring] detected at character [$position] in [" . - $dumper->describeValue($subject) . "] in region [" . - $dumper->clipString($subject, 100, $position) . "]"; - } -} - -/** - * Fail if a substring is detected within the - * comparison text. - * @package SimpleTest - * @subpackage UnitTester - */ -class NoTextExpectation extends TextExpectation { - - /** - * Sets the reject pattern - * @param string $substring Text to search for. - * @param string $message Customised message on failure. - * @access public - */ - function __construct($substring, $message = '%s') { - parent::__construct($substring, $message); - } - - /** - * Tests the expectation. False if the substring appears - * in the text. - * @param string $compare Comparison value. - * @return boolean True if correct. - * @access public - */ - function test($compare) { - return ! parent::test($compare); - } - - /** - * Returns a human readable test message. - * @param string $compare Comparison value. - * @return string Description of success - * or failure. - * @access public - */ - function testMessage($compare) { - if ($this->test($compare)) { - $dumper = $this->getDumper(); - return "Text [" . $this->getSubstring() . - "] not detected in [" . - $dumper->describeValue($compare) . "]"; - } else { - return $this->describeTextMatch($this->getSubstring(), $compare); - } - } -} - -/** - * Test case for testing of web pages. Allows - * fetching of pages, parsing of HTML and - * submitting forms. - * @package SimpleTest - * @subpackage WebTester - */ -class WebTestCase extends SimpleTestCase { - private $browser; - private $ignore_errors = false; - - /** - * Creates an empty test case. Should be subclassed - * with test methods for a functional test case. - * @param string $label Name of test case. Will use - * the class name if none specified. - * @access public - */ - function __construct($label = false) { - parent::__construct($label); - } - - /** - * Announces the start of the test. - * @param string $method Test method just started. - * @access public - */ - function before($method) { - parent::before($method); - $this->setBrowser($this->createBrowser()); - } - - /** - * Announces the end of the test. Includes private clean up. - * @param string $method Test method just finished. - * @access public - */ - function after($method) { - $this->unsetBrowser(); - parent::after($method); - } - - /** - * Gets a current browser reference for setting - * special expectations or for detailed - * examination of page fetches. - * @return SimpleBrowser Current test browser object. - * @access public - */ - function getBrowser() { - return $this->browser; - } - - /** - * Gets a current browser reference for setting - * special expectations or for detailed - * examination of page fetches. - * @param SimpleBrowser $browser New test browser object. - * @access public - */ - function setBrowser($browser) { - return $this->browser = $browser; - } - - /** - * Clears the current browser reference to help the - * PHP garbage collector. - * @access public - */ - function unsetBrowser() { - unset($this->browser); - } - - /** - * Creates a new default web browser object. - * Will be cleared at the end of the test method. - * @return TestBrowser New browser. - * @access public - */ - function createBrowser() { - return new SimpleBrowser(); - } - - /** - * Gets the last response error. - * @return string Last low level HTTP error. - * @access public - */ - function getTransportError() { - return $this->browser->getTransportError(); - } - - /** - * Accessor for the currently selected URL. - * @return string Current location or false if - * no page yet fetched. - * @access public - */ - function getUrl() { - return $this->browser->getUrl(); - } - - /** - * Dumps the current request for debugging. - * @access public - */ - function showRequest() { - $this->dump($this->browser->getRequest()); - } - - /** - * Dumps the current HTTP headers for debugging. - * @access public - */ - function showHeaders() { - $this->dump($this->browser->getHeaders()); - } - - /** - * Dumps the current HTML source for debugging. - * @access public - */ - function showSource() { - $this->dump($this->browser->getContent()); - } - - /** - * Dumps the visible text only for debugging. - * @access public - */ - function showText() { - $this->dump(wordwrap($this->browser->getContentAsText(), 80)); - } - - /** - * Simulates the closing and reopening of the browser. - * Temporary cookies will be discarded and timed - * cookies will be expired if later than the - * specified time. - * @param string/integer $date Time when session restarted. - * If ommitted then all persistent - * cookies are kept. Time is either - * Cookie format string or timestamp. - * @access public - */ - function restart($date = false) { - if ($date === false) { - $date = time(); - } - $this->browser->restart($date); - } - - /** - * Moves cookie expiry times back into the past. - * Useful for testing timeouts and expiries. - * @param integer $interval Amount to age in seconds. - * @access public - */ - function ageCookies($interval) { - $this->browser->ageCookies($interval); - } - - /** - * Disables frames support. Frames will not be fetched - * and the frameset page will be used instead. - * @access public - */ - function ignoreFrames() { - $this->browser->ignoreFrames(); - } - - /** - * Switches off cookie sending and recieving. - * @access public - */ - function ignoreCookies() { - $this->browser->ignoreCookies(); - } - - /** - * Skips errors for the next request only. You might - * want to confirm that a page is unreachable for - * example. - * @access public - */ - function ignoreErrors() { - $this->ignore_errors = true; - } - - /** - * Issues a fail if there is a transport error anywhere - * in the current frameset. Only one such error is - * reported. - * @param string/boolean $result HTML or failure. - * @return string/boolean $result Passes through result. - * @access private - */ - protected function failOnError($result) { - if (! $this->ignore_errors) { - if ($error = $this->browser->getTransportError()) { - $this->fail($error); - } - } - $this->ignore_errors = false; - return $result; - } - - /** - * Adds a header to every fetch. - * @param string $header Header line to add to every - * request until cleared. - * @access public - */ - function addHeader($header) { - $this->browser->addHeader($header); - } - - /** - * Sets the maximum number of redirects before - * the web page is loaded regardless. - * @param integer $max Maximum hops. - * @access public - */ - function setMaximumRedirects($max) { - if (! $this->browser) { - trigger_error( - 'Can only set maximum redirects in a test method, setUp() or tearDown()'); - } - $this->browser->setMaximumRedirects($max); - } - - /** - * Sets the socket timeout for opening a connection and - * receiving at least one byte of information. - * @param integer $timeout Maximum time in seconds. - * @access public - */ - function setConnectionTimeout($timeout) { - $this->browser->setConnectionTimeout($timeout); - } - - /** - * Sets proxy to use on all requests for when - * testing from behind a firewall. Set URL - * to false to disable. - * @param string $proxy Proxy URL. - * @param string $username Proxy username for authentication. - * @param string $password Proxy password for authentication. - * @access public - */ - function useProxy($proxy, $username = false, $password = false) { - $this->browser->useProxy($proxy, $username, $password); - } - - /** - * Fetches a page into the page buffer. If - * there is no base for the URL then the - * current base URL is used. After the fetch - * the base URL reflects the new location. - * @param string $url URL to fetch. - * @param hash $parameters Optional additional GET data. - * @return boolean/string Raw page on success. - * @access public - */ - function get($url, $parameters = false) { - return $this->failOnError($this->browser->get($url, $parameters)); - } - - /** - * Fetches a page by POST into the page buffer. - * If there is no base for the URL then the - * current base URL is used. After the fetch - * the base URL reflects the new location. - * @param string $url URL to fetch. - * @param hash $parameters Optional additional GET data. - * @return boolean/string Raw page on success. - * @access public - */ - function post($url, $parameters = false) { - return $this->failOnError($this->browser->post($url, $parameters)); - } - - /** - * Does a HTTP HEAD fetch, fetching only the page - * headers. The current base URL is unchanged by this. - * @param string $url URL to fetch. - * @param hash $parameters Optional additional GET data. - * @return boolean True on success. - * @access public - */ - function head($url, $parameters = false) { - return $this->failOnError($this->browser->head($url, $parameters)); - } - - /** - * Equivalent to hitting the retry button on the - * browser. Will attempt to repeat the page fetch. - * @return boolean True if fetch succeeded. - * @access public - */ - function retry() { - return $this->failOnError($this->browser->retry()); - } - - /** - * Equivalent to hitting the back button on the - * browser. - * @return boolean True if history entry and - * fetch succeeded. - * @access public - */ - function back() { - return $this->failOnError($this->browser->back()); - } - - /** - * Equivalent to hitting the forward button on the - * browser. - * @return boolean True if history entry and - * fetch succeeded. - * @access public - */ - function forward() { - return $this->failOnError($this->browser->forward()); - } - - /** - * Retries a request after setting the authentication - * for the current realm. - * @param string $username Username for realm. - * @param string $password Password for realm. - * @return boolean/string HTML on successful fetch. Note - * that authentication may still have - * failed. - * @access public - */ - function authenticate($username, $password) { - return $this->failOnError( - $this->browser->authenticate($username, $password)); - } - - /** - * Gets the cookie value for the current browser context. - * @param string $name Name of cookie. - * @return string Value of cookie or false if unset. - * @access public - */ - function getCookie($name) { - return $this->browser->getCurrentCookieValue($name); - } - - /** - * Sets a cookie in the current browser. - * @param string $name Name of cookie. - * @param string $value Cookie value. - * @param string $host Host upon which the cookie is valid. - * @param string $path Cookie path if not host wide. - * @param string $expiry Expiry date. - * @access public - */ - function setCookie($name, $value, $host = false, $path = '/', $expiry = false) { - $this->browser->setCookie($name, $value, $host, $path, $expiry); - } - - /** - * Accessor for current frame focus. Will be - * false if no frame has focus. - * @return integer/string/boolean Label if any, otherwise - * the position in the frameset - * or false if none. - * @access public - */ - function getFrameFocus() { - return $this->browser->getFrameFocus(); - } - - /** - * Sets the focus by index. The integer index starts from 1. - * @param integer $choice Chosen frame. - * @return boolean True if frame exists. - * @access public - */ - function setFrameFocusByIndex($choice) { - return $this->browser->setFrameFocusByIndex($choice); - } - - /** - * Sets the focus by name. - * @param string $name Chosen frame. - * @return boolean True if frame exists. - * @access public - */ - function setFrameFocus($name) { - return $this->browser->setFrameFocus($name); - } - - /** - * Clears the frame focus. All frames will be searched - * for content. - * @access public - */ - function clearFrameFocus() { - return $this->browser->clearFrameFocus(); - } - - /** - * Clicks a visible text item. Will first try buttons, - * then links and then images. - * @param string $label Visible text or alt text. - * @return string/boolean Raw page or false. - * @access public - */ - function click($label) { - return $this->failOnError($this->browser->click($label)); - } - - /** - * Checks for a click target. - * @param string $label Visible text or alt text. - * @return boolean True if click target. - * @access public - */ - function assertClickable($label, $message = '%s') { - return $this->assertTrue( - $this->browser->isClickable($label), - sprintf($message, "Click target [$label] should exist")); - } - - /** - * Clicks the submit button by label. The owning - * form will be submitted by this. - * @param string $label Button label. An unlabeled - * button can be triggered by 'Submit'. - * @param hash $additional Additional form values. - * @return boolean/string Page on success, else false. - * @access public - */ - function clickSubmit($label = 'Submit', $additional = false) { - return $this->failOnError( - $this->browser->clickSubmit($label, $additional)); - } - - /** - * Clicks the submit button by name attribute. The owning - * form will be submitted by this. - * @param string $name Name attribute of button. - * @param hash $additional Additional form values. - * @return boolean/string Page on success. - * @access public - */ - function clickSubmitByName($name, $additional = false) { - return $this->failOnError( - $this->browser->clickSubmitByName($name, $additional)); - } - - /** - * Clicks the submit button by ID attribute. The owning - * form will be submitted by this. - * @param string $id ID attribute of button. - * @param hash $additional Additional form values. - * @return boolean/string Page on success. - * @access public - */ - function clickSubmitById($id, $additional = false) { - return $this->failOnError( - $this->browser->clickSubmitById($id, $additional)); - } - - /** - * Checks for a valid button label. - * @param string $label Visible text. - * @return boolean True if click target. - * @access public - */ - function assertSubmit($label, $message = '%s') { - return $this->assertTrue( - $this->browser->isSubmit($label), - sprintf($message, "Submit button [$label] should exist")); - } - - /** - * Clicks the submit image by some kind of label. Usually - * the alt tag or the nearest equivalent. The owning - * form will be submitted by this. Clicking outside of - * the boundary of the coordinates will result in - * a failure. - * @param string $label Alt attribute of button. - * @param integer $x X-coordinate of imaginary click. - * @param integer $y Y-coordinate of imaginary click. - * @param hash $additional Additional form values. - * @return boolean/string Page on success. - * @access public - */ - function clickImage($label, $x = 1, $y = 1, $additional = false) { - return $this->failOnError( - $this->browser->clickImage($label, $x, $y, $additional)); - } - - /** - * Clicks the submit image by the name. Usually - * the alt tag or the nearest equivalent. The owning - * form will be submitted by this. Clicking outside of - * the boundary of the coordinates will result in - * a failure. - * @param string $name Name attribute of button. - * @param integer $x X-coordinate of imaginary click. - * @param integer $y Y-coordinate of imaginary click. - * @param hash $additional Additional form values. - * @return boolean/string Page on success. - * @access public - */ - function clickImageByName($name, $x = 1, $y = 1, $additional = false) { - return $this->failOnError( - $this->browser->clickImageByName($name, $x, $y, $additional)); - } - - /** - * Clicks the submit image by ID attribute. The owning - * form will be submitted by this. Clicking outside of - * the boundary of the coordinates will result in - * a failure. - * @param integer/string $id ID attribute of button. - * @param integer $x X-coordinate of imaginary click. - * @param integer $y Y-coordinate of imaginary click. - * @param hash $additional Additional form values. - * @return boolean/string Page on success. - * @access public - */ - function clickImageById($id, $x = 1, $y = 1, $additional = false) { - return $this->failOnError( - $this->browser->clickImageById($id, $x, $y, $additional)); - } - - /** - * Checks for a valid image with atht alt text or title. - * @param string $label Visible text. - * @return boolean True if click target. - * @access public - */ - function assertImage($label, $message = '%s') { - return $this->assertTrue( - $this->browser->isImage($label), - sprintf($message, "Image with text [$label] should exist")); - } - - /** - * Submits a form by the ID. - * @param string $id Form ID. No button information - * is submitted this way. - * @return boolean/string Page on success. - * @access public - */ - function submitFormById($id) { - return $this->failOnError($this->browser->submitFormById($id)); - } - - /** - * Follows a link by name. Will click the first link - * found with this link text by default, or a later - * one if an index is given. Match is case insensitive - * with normalised space. - * @param string $label Text between the anchor tags. - * @param integer $index Link position counting from zero. - * @return boolean/string Page on success. - * @access public - */ - function clickLink($label, $index = 0) { - return $this->failOnError($this->browser->clickLink($label, $index)); - } - - /** - * Follows a link by id attribute. - * @param string $id ID attribute value. - * @return boolean/string Page on success. - * @access public - */ - function clickLinkById($id) { - return $this->failOnError($this->browser->clickLinkById($id)); - } - - /** - * Tests for the presence of a link label. Match is - * case insensitive with normalised space. - * @param string $label Text between the anchor tags. - * @param mixed $expected Expected URL or expectation object. - * @param string $message Message to display. Default - * can be embedded with %s. - * @return boolean True if link present. - * @access public - */ - function assertLink($label, $expected = true, $message = '%s') { - $url = $this->browser->getLink($label); - if ($expected === true || ($expected !== true && $url === false)) { - return $this->assertTrue($url !== false, sprintf($message, "Link [$label] should exist")); - } - if (! SimpleExpectation::isExpectation($expected)) { - $expected = new IdenticalExpectation($expected); - } - return $this->assert($expected, $url->asString(), sprintf($message, "Link [$label] should match")); - } - - /** - * Tests for the non-presence of a link label. Match is - * case insensitive with normalised space. - * @param string/integer $label Text between the anchor tags - * or ID attribute. - * @param string $message Message to display. Default - * can be embedded with %s. - * @return boolean True if link missing. - * @access public - */ - function assertNoLink($label, $message = '%s') { - return $this->assertTrue( - $this->browser->getLink($label) === false, - sprintf($message, "Link [$label] should not exist")); - } - - /** - * Tests for the presence of a link id attribute. - * @param string $id Id attribute value. - * @param mixed $expected Expected URL or expectation object. - * @param string $message Message to display. Default - * can be embedded with %s. - * @return boolean True if link present. - * @access public - */ - function assertLinkById($id, $expected = true, $message = '%s') { - $url = $this->browser->getLinkById($id); - if ($expected === true) { - return $this->assertTrue($url !== false, sprintf($message, "Link ID [$id] should exist")); - } - if (! SimpleExpectation::isExpectation($expected)) { - $expected = new IdenticalExpectation($expected); - } - return $this->assert($expected, $url->asString(), sprintf($message, "Link ID [$id] should match")); - } - - /** - * Tests for the non-presence of a link label. Match is - * case insensitive with normalised space. - * @param string $id Id attribute value. - * @param string $message Message to display. Default - * can be embedded with %s. - * @return boolean True if link missing. - * @access public - */ - function assertNoLinkById($id, $message = '%s') { - return $this->assertTrue( - $this->browser->getLinkById($id) === false, - sprintf($message, "Link ID [$id] should not exist")); - } - - /** - * Sets all form fields with that label, or name if there - * is no label attached. - * @param string $name Name of field in forms. - * @param string $value New value of field. - * @return boolean True if field exists, otherwise false. - * @access public - */ - function setField($label, $value, $position=false) { - return $this->browser->setField($label, $value, $position); - } - - /** - * Sets all form fields with that name. - * @param string $name Name of field in forms. - * @param string $value New value of field. - * @return boolean True if field exists, otherwise false. - * @access public - */ - function setFieldByName($name, $value, $position=false) { - return $this->browser->setFieldByName($name, $value, $position); - } - - /** - * Sets all form fields with that id. - * @param string/integer $id Id of field in forms. - * @param string $value New value of field. - * @return boolean True if field exists, otherwise false. - * @access public - */ - function setFieldById($id, $value) { - return $this->browser->setFieldById($id, $value); - } - - /** - * Confirms that the form element is currently set - * to the expected value. A missing form will always - * fail. If no value is given then only the existence - * of the field is checked. - * @param string $name Name of field in forms. - * @param mixed $expected Expected string/array value or - * false for unset fields. - * @param string $message Message to display. Default - * can be embedded with %s. - * @return boolean True if pass. - * @access public - */ - function assertField($label, $expected = true, $message = '%s') { - $value = $this->browser->getField($label); - return $this->assertFieldValue($label, $value, $expected, $message); - } - - /** - * Confirms that the form element is currently set - * to the expected value. A missing form element will always - * fail. If no value is given then only the existence - * of the field is checked. - * @param string $name Name of field in forms. - * @param mixed $expected Expected string/array value or - * false for unset fields. - * @param string $message Message to display. Default - * can be embedded with %s. - * @return boolean True if pass. - * @access public - */ - function assertFieldByName($name, $expected = true, $message = '%s') { - $value = $this->browser->getFieldByName($name); - return $this->assertFieldValue($name, $value, $expected, $message); - } - - /** - * Confirms that the form element is currently set - * to the expected value. A missing form will always - * fail. If no ID is given then only the existence - * of the field is checked. - * @param string/integer $id Name of field in forms. - * @param mixed $expected Expected string/array value or - * false for unset fields. - * @param string $message Message to display. Default - * can be embedded with %s. - * @return boolean True if pass. - * @access public - */ - function assertFieldById($id, $expected = true, $message = '%s') { - $value = $this->browser->getFieldById($id); - return $this->assertFieldValue($id, $value, $expected, $message); - } - - /** - * Tests the field value against the expectation. - * @param string $identifier Name, ID or label. - * @param mixed $value Current field value. - * @param mixed $expected Expected value to match. - * @param string $message Failure message. - * @return boolean True if pass - * @access protected - */ - protected function assertFieldValue($identifier, $value, $expected, $message) { - if ($expected === true) { - return $this->assertTrue( - isset($value), - sprintf($message, "Field [$identifier] should exist")); - } - if (! SimpleExpectation::isExpectation($expected)) { - $identifier = str_replace('%', '%%', $identifier); - $expected = new FieldExpectation( - $expected, - "Field [$identifier] should match with [%s]"); - } - return $this->assert($expected, $value, $message); - } - - /** - * Checks the response code against a list - * of possible values. - * @param array $responses Possible responses for a pass. - * @param string $message Message to display. Default - * can be embedded with %s. - * @return boolean True if pass. - * @access public - */ - function assertResponse($responses, $message = '%s') { - $responses = (is_array($responses) ? $responses : array($responses)); - $code = $this->browser->getResponseCode(); - $message = sprintf($message, "Expecting response in [" . - implode(", ", $responses) . "] got [$code]"); - return $this->assertTrue(in_array($code, $responses), $message); - } - - /** - * Checks the mime type against a list - * of possible values. - * @param array $types Possible mime types for a pass. - * @param string $message Message to display. - * @return boolean True if pass. - * @access public - */ - function assertMime($types, $message = '%s') { - $types = (is_array($types) ? $types : array($types)); - $type = $this->browser->getMimeType(); - $message = sprintf($message, "Expecting mime type in [" . - implode(", ", $types) . "] got [$type]"); - return $this->assertTrue(in_array($type, $types), $message); - } - - /** - * Attempt to match the authentication type within - * the security realm we are currently matching. - * @param string $authentication Usually basic. - * @param string $message Message to display. - * @return boolean True if pass. - * @access public - */ - function assertAuthentication($authentication = false, $message = '%s') { - if (! $authentication) { - $message = sprintf($message, "Expected any authentication type, got [" . - $this->browser->getAuthentication() . "]"); - return $this->assertTrue( - $this->browser->getAuthentication(), - $message); - } else { - $message = sprintf($message, "Expected authentication [$authentication] got [" . - $this->browser->getAuthentication() . "]"); - return $this->assertTrue( - strtolower($this->browser->getAuthentication()) == strtolower($authentication), - $message); - } - } - - /** - * Checks that no authentication is necessary to view - * the desired page. - * @param string $message Message to display. - * @return boolean True if pass. - * @access public - */ - function assertNoAuthentication($message = '%s') { - $message = sprintf($message, "Expected no authentication type, got [" . - $this->browser->getAuthentication() . "]"); - return $this->assertFalse($this->browser->getAuthentication(), $message); - } - - /** - * Attempts to match the current security realm. - * @param string $realm Name of security realm. - * @param string $message Message to display. - * @return boolean True if pass. - * @access public - */ - function assertRealm($realm, $message = '%s') { - if (! SimpleExpectation::isExpectation($realm)) { - $realm = new EqualExpectation($realm); - } - return $this->assert( - $realm, - $this->browser->getRealm(), - "Expected realm -> $message"); - } - - /** - * Checks each header line for the required value. If no - * value is given then only an existence check is made. - * @param string $header Case insensitive header name. - * @param mixed $value Case sensitive trimmed string to - * match against. An expectation object - * can be used for pattern matching. - * @return boolean True if pass. - * @access public - */ - function assertHeader($header, $value = false, $message = '%s') { - return $this->assert( - new HttpHeaderExpectation($header, $value), - $this->browser->getHeaders(), - $message); - } - - /** - * Confirms that the header type has not been received. - * Only the landing page is checked. If you want to check - * redirect pages, then you should limit redirects so - * as to capture the page you want. - * @param string $header Case insensitive header name. - * @return boolean True if pass. - * @access public - */ - function assertNoHeader($header, $message = '%s') { - return $this->assert( - new NoHttpHeaderExpectation($header), - $this->browser->getHeaders(), - $message); - } - - /** - * Tests the text between the title tags. - * @param string/SimpleExpectation $title Expected title. - * @param string $message Message to display. - * @return boolean True if pass. - * @access public - */ - function assertTitle($title = false, $message = '%s') { - if (! SimpleExpectation::isExpectation($title)) { - $title = new EqualExpectation($title); - } - return $this->assert($title, $this->browser->getTitle(), $message); - } - - /** - * Will trigger a pass if the text is found in the plain - * text form of the page. - * @param string $text Text to look for. - * @param string $message Message to display. - * @return boolean True if pass. - * @access public - */ - function assertText($text, $message = '%s') { - return $this->assert( - new TextExpectation($text), - $this->browser->getContentAsText(), - $message); - } - - /** - * Will trigger a pass if the text is not found in the plain - * text form of the page. - * @param string $text Text to look for. - * @param string $message Message to display. - * @return boolean True if pass. - * @access public - */ - function assertNoText($text, $message = '%s') { - return $this->assert( - new NoTextExpectation($text), - $this->browser->getContentAsText(), - $message); - } - - /** - * Will trigger a pass if the Perl regex pattern - * is found in the raw content. - * @param string $pattern Perl regex to look for including - * the regex delimiters. - * @param string $message Message to display. - * @return boolean True if pass. - * @access public - */ - function assertPattern($pattern, $message = '%s') { - return $this->assert( - new PatternExpectation($pattern), - $this->browser->getContent(), - $message); - } - - /** - * Will trigger a pass if the perl regex pattern - * is not present in raw content. - * @param string $pattern Perl regex to look for including - * the regex delimiters. - * @param string $message Message to display. - * @return boolean True if pass. - * @access public - */ - function assertNoPattern($pattern, $message = '%s') { - return $this->assert( - new NoPatternExpectation($pattern), - $this->browser->getContent(), - $message); - } - - /** - * Checks that a cookie is set for the current page - * and optionally checks the value. - * @param string $name Name of cookie to test. - * @param string $expected Expected value as a string or - * false if any value will do. - * @param string $message Message to display. - * @return boolean True if pass. - * @access public - */ - function assertCookie($name, $expected = false, $message = '%s') { - $value = $this->getCookie($name); - if (! $expected) { - return $this->assertTrue( - $value, - sprintf($message, "Expecting cookie [$name]")); - } - if (! SimpleExpectation::isExpectation($expected)) { - $expected = new EqualExpectation($expected); - } - return $this->assert($expected, $value, "Expecting cookie [$name] -> $message"); - } - - /** - * Checks that no cookie is present or that it has - * been successfully cleared. - * @param string $name Name of cookie to test. - * @param string $message Message to display. - * @return boolean True if pass. - * @access public - */ - function assertNoCookie($name, $message = '%s') { - return $this->assertTrue( - $this->getCookie($name) === null or $this->getCookie($name) === false, - sprintf($message, "Not expecting cookie [$name]")); - } - - /** - * Called from within the test methods to register - * passes and failures. - * @param boolean $result Pass on true. - * @param string $message Message to display describing - * the test state. - * @return boolean True on pass - * @access public - */ - function assertTrue($result, $message = false) { - return $this->assert(new TrueExpectation(), $result, $message); - } - - /** - * Will be true on false and vice versa. False - * is the PHP definition of false, so that null, - * empty strings, zero and an empty array all count - * as false. - * @param boolean $result Pass on false. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assertFalse($result, $message = '%s') { - return $this->assert(new FalseExpectation(), $result, $message); - } - - /** - * Will trigger a pass if the two parameters have - * the same value only. Otherwise a fail. This - * is for testing hand extracted text, etc. - * @param mixed $first Value to compare. - * @param mixed $second Value to compare. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assertEqual($first, $second, $message = '%s') { - return $this->assert( - new EqualExpectation($first), - $second, - $message); - } - - /** - * Will trigger a pass if the two parameters have - * a different value. Otherwise a fail. This - * is for testing hand extracted text, etc. - * @param mixed $first Value to compare. - * @param mixed $second Value to compare. - * @param string $message Message to display. - * @return boolean True on pass - * @access public - */ - function assertNotEqual($first, $second, $message = '%s') { - return $this->assert( - new NotEqualExpectation($first), - $second, - $message); - } - - /** - * Uses a stack trace to find the line of an assertion. - * @return string Line number of first assert* - * method embedded in format string. - * @access public - */ - function getAssertionLine() { - $trace = new SimpleStackTrace(array('assert', 'click', 'pass', 'fail')); - return $trace->traceMethod(); - } -} -?> \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/xml.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/xml.php deleted file mode 100644 index 54fb6f5..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/simpletest/xml.php +++ /dev/null @@ -1,647 +0,0 @@ -namespace = ($namespace ? $namespace . ':' : ''); - $this->indent = $indent; - } - - /** - * Calculates the pretty printing indent level - * from the current level of nesting. - * @param integer $offset Extra indenting level. - * @return string Leading space. - * @access protected - */ - protected function getIndent($offset = 0) { - return str_repeat( - $this->indent, - count($this->getTestList()) + $offset); - } - - /** - * Converts character string to parsed XML - * entities string. - * @param string text Unparsed character data. - * @return string Parsed character data. - * @access public - */ - function toParsedXml($text) { - return str_replace( - array('&', '<', '>', '"', '\''), - array('&', '<', '>', '"', '''), - $text); - } - - /** - * Paints the start of a group test. - * @param string $test_name Name of test that is starting. - * @param integer $size Number of test cases starting. - * @access public - */ - function paintGroupStart($test_name, $size) { - parent::paintGroupStart($test_name, $size); - print $this->getIndent(); - print "<" . $this->namespace . "group size=\"$size\">\n"; - print $this->getIndent(1); - print "<" . $this->namespace . "name>" . - $this->toParsedXml($test_name) . - "namespace . "name>\n"; - } - - /** - * Paints the end of a group test. - * @param string $test_name Name of test that is ending. - * @access public - */ - function paintGroupEnd($test_name) { - print $this->getIndent(); - print "namespace . "group>\n"; - parent::paintGroupEnd($test_name); - } - - /** - * Paints the start of a test case. - * @param string $test_name Name of test that is starting. - * @access public - */ - function paintCaseStart($test_name) { - parent::paintCaseStart($test_name); - print $this->getIndent(); - print "<" . $this->namespace . "case>\n"; - print $this->getIndent(1); - print "<" . $this->namespace . "name>" . - $this->toParsedXml($test_name) . - "namespace . "name>\n"; - } - - /** - * Paints the end of a test case. - * @param string $test_name Name of test that is ending. - * @access public - */ - function paintCaseEnd($test_name) { - print $this->getIndent(); - print "namespace . "case>\n"; - parent::paintCaseEnd($test_name); - } - - /** - * Paints the start of a test method. - * @param string $test_name Name of test that is starting. - * @access public - */ - function paintMethodStart($test_name) { - parent::paintMethodStart($test_name); - print $this->getIndent(); - print "<" . $this->namespace . "test>\n"; - print $this->getIndent(1); - print "<" . $this->namespace . "name>" . - $this->toParsedXml($test_name) . - "namespace . "name>\n"; - } - - /** - * Paints the end of a test method. - * @param string $test_name Name of test that is ending. - * @param integer $progress Number of test cases ending. - * @access public - */ - function paintMethodEnd($test_name) { - print $this->getIndent(); - print "namespace . "test>\n"; - parent::paintMethodEnd($test_name); - } - - /** - * Paints pass as XML. - * @param string $message Message to encode. - * @access public - */ - function paintPass($message) { - parent::paintPass($message); - print $this->getIndent(1); - print "<" . $this->namespace . "pass>"; - print $this->toParsedXml($message); - print "namespace . "pass>\n"; - } - - /** - * Paints failure as XML. - * @param string $message Message to encode. - * @access public - */ - function paintFail($message) { - parent::paintFail($message); - print $this->getIndent(1); - print "<" . $this->namespace . "fail>"; - print $this->toParsedXml($message); - print "namespace . "fail>\n"; - } - - /** - * Paints error as XML. - * @param string $message Message to encode. - * @access public - */ - function paintError($message) { - parent::paintError($message); - print $this->getIndent(1); - print "<" . $this->namespace . "exception>"; - print $this->toParsedXml($message); - print "namespace . "exception>\n"; - } - - /** - * Paints exception as XML. - * @param Exception $exception Exception to encode. - * @access public - */ - function paintException($exception) { - parent::paintException($exception); - print $this->getIndent(1); - print "<" . $this->namespace . "exception>"; - $message = 'Unexpected exception of type [' . get_class($exception) . - '] with message ['. $exception->getMessage() . - '] in ['. $exception->getFile() . - ' line ' . $exception->getLine() . ']'; - print $this->toParsedXml($message); - print "namespace . "exception>\n"; - } - - /** - * Paints the skipping message and tag. - * @param string $message Text to display in skip tag. - * @access public - */ - function paintSkip($message) { - parent::paintSkip($message); - print $this->getIndent(1); - print "<" . $this->namespace . "skip>"; - print $this->toParsedXml($message); - print "namespace . "skip>\n"; - } - - /** - * Paints a simple supplementary message. - * @param string $message Text to display. - * @access public - */ - function paintMessage($message) { - parent::paintMessage($message); - print $this->getIndent(1); - print "<" . $this->namespace . "message>"; - print $this->toParsedXml($message); - print "namespace . "message>\n"; - } - - /** - * Paints a formatted ASCII message such as a - * privateiable dump. - * @param string $message Text to display. - * @access public - */ - function paintFormattedMessage($message) { - parent::paintFormattedMessage($message); - print $this->getIndent(1); - print "<" . $this->namespace . "formatted>"; - print ""; - print "namespace . "formatted>\n"; - } - - /** - * Serialises the event object. - * @param string $type Event type as text. - * @param mixed $payload Message or object. - * @access public - */ - function paintSignal($type, $payload) { - parent::paintSignal($type, $payload); - print $this->getIndent(1); - print "<" . $this->namespace . "signal type=\"$type\">"; - print ""; - print "namespace . "signal>\n"; - } - - /** - * Paints the test document header. - * @param string $test_name First test top level - * to start. - * @access public - * @abstract - */ - function paintHeader($test_name) { - if (! SimpleReporter::inCli()) { - header('Content-type: text/xml'); - } - print "namespace) { - print " xmlns:" . $this->namespace . - "=\"www.lastcraft.com/SimpleTest/Beta3/Report\""; - } - print "?>\n"; - print "<" . $this->namespace . "run>\n"; - } - - /** - * Paints the test document footer. - * @param string $test_name The top level test. - * @access public - * @abstract - */ - function paintFooter($test_name) { - print "namespace . "run>\n"; - } -} - -/** - * Accumulator for incoming tag. Holds the - * incoming test structure information for - * later dispatch to the reporter. - * @package SimpleTest - * @subpackage UnitTester - */ -class NestingXmlTag { - private $name; - private $attributes; - - /** - * Sets the basic test information except - * the name. - * @param hash $attributes Name value pairs. - * @access public - */ - function NestingXmlTag($attributes) { - $this->name = false; - $this->attributes = $attributes; - } - - /** - * Sets the test case/method name. - * @param string $name Name of test. - * @access public - */ - function setName($name) { - $this->name = $name; - } - - /** - * Accessor for name. - * @return string Name of test. - * @access public - */ - function getName() { - return $this->name; - } - - /** - * Accessor for attributes. - * @return hash All attributes. - * @access protected - */ - protected function getAttributes() { - return $this->attributes; - } -} - -/** - * Accumulator for incoming method tag. Holds the - * incoming test structure information for - * later dispatch to the reporter. - * @package SimpleTest - * @subpackage UnitTester - */ -class NestingMethodTag extends NestingXmlTag { - - /** - * Sets the basic test information except - * the name. - * @param hash $attributes Name value pairs. - * @access public - */ - function NestingMethodTag($attributes) { - $this->NestingXmlTag($attributes); - } - - /** - * Signals the appropriate start event on the - * listener. - * @param SimpleReporter $listener Target for events. - * @access public - */ - function paintStart(&$listener) { - $listener->paintMethodStart($this->getName()); - } - - /** - * Signals the appropriate end event on the - * listener. - * @param SimpleReporter $listener Target for events. - * @access public - */ - function paintEnd(&$listener) { - $listener->paintMethodEnd($this->getName()); - } -} - -/** - * Accumulator for incoming case tag. Holds the - * incoming test structure information for - * later dispatch to the reporter. - * @package SimpleTest - * @subpackage UnitTester - */ -class NestingCaseTag extends NestingXmlTag { - - /** - * Sets the basic test information except - * the name. - * @param hash $attributes Name value pairs. - * @access public - */ - function NestingCaseTag($attributes) { - $this->NestingXmlTag($attributes); - } - - /** - * Signals the appropriate start event on the - * listener. - * @param SimpleReporter $listener Target for events. - * @access public - */ - function paintStart(&$listener) { - $listener->paintCaseStart($this->getName()); - } - - /** - * Signals the appropriate end event on the - * listener. - * @param SimpleReporter $listener Target for events. - * @access public - */ - function paintEnd(&$listener) { - $listener->paintCaseEnd($this->getName()); - } -} - -/** - * Accumulator for incoming group tag. Holds the - * incoming test structure information for - * later dispatch to the reporter. - * @package SimpleTest - * @subpackage UnitTester - */ -class NestingGroupTag extends NestingXmlTag { - - /** - * Sets the basic test information except - * the name. - * @param hash $attributes Name value pairs. - * @access public - */ - function NestingGroupTag($attributes) { - $this->NestingXmlTag($attributes); - } - - /** - * Signals the appropriate start event on the - * listener. - * @param SimpleReporter $listener Target for events. - * @access public - */ - function paintStart(&$listener) { - $listener->paintGroupStart($this->getName(), $this->getSize()); - } - - /** - * Signals the appropriate end event on the - * listener. - * @param SimpleReporter $listener Target for events. - * @access public - */ - function paintEnd(&$listener) { - $listener->paintGroupEnd($this->getName()); - } - - /** - * The size in the attributes. - * @return integer Value of size attribute or zero. - * @access public - */ - function getSize() { - $attributes = $this->getAttributes(); - if (isset($attributes['SIZE'])) { - return (integer)$attributes['SIZE']; - } - return 0; - } -} - -/** - * Parser for importing the output of the XmlReporter. - * Dispatches that output to another reporter. - * @package SimpleTest - * @subpackage UnitTester - */ -class SimpleTestXmlParser { - private $listener; - private $expat; - private $tag_stack; - private $in_content_tag; - private $content; - private $attributes; - - /** - * Loads a listener with the SimpleReporter - * interface. - * @param SimpleReporter $listener Listener of tag events. - * @access public - */ - function SimpleTestXmlParser(&$listener) { - $this->listener = &$listener; - $this->expat = &$this->createParser(); - $this->tag_stack = array(); - $this->in_content_tag = false; - $this->content = ''; - $this->attributes = array(); - } - - /** - * Parses a block of XML sending the results to - * the listener. - * @param string $chunk Block of text to read. - * @return boolean True if valid XML. - * @access public - */ - function parse($chunk) { - if (! xml_parse($this->expat, $chunk)) { - trigger_error('XML parse error with ' . - xml_error_string(xml_get_error_code($this->expat))); - return false; - } - return true; - } - - /** - * Sets up expat as the XML parser. - * @return resource Expat handle. - * @access protected - */ - protected function &createParser() { - $expat = xml_parser_create(); - xml_set_object($expat, $this); - xml_set_element_handler($expat, 'startElement', 'endElement'); - xml_set_character_data_handler($expat, 'addContent'); - xml_set_default_handler($expat, 'defaultContent'); - return $expat; - } - - /** - * Opens a new test nesting level. - * @return NestedXmlTag The group, case or method tag - * to start. - * @access private - */ - protected function pushNestingTag($nested) { - array_unshift($this->tag_stack, $nested); - } - - /** - * Accessor for current test structure tag. - * @return NestedXmlTag The group, case or method tag - * being parsed. - * @access private - */ - protected function &getCurrentNestingTag() { - return $this->tag_stack[0]; - } - - /** - * Ends a nesting tag. - * @return NestedXmlTag The group, case or method tag - * just finished. - * @access private - */ - protected function popNestingTag() { - return array_shift($this->tag_stack); - } - - /** - * Test if tag is a leaf node with only text content. - * @param string $tag XML tag name. - * @return @boolean True if leaf, false if nesting. - * @private - */ - protected function isLeaf($tag) { - return in_array($tag, array( - 'NAME', 'PASS', 'FAIL', 'EXCEPTION', 'SKIP', 'MESSAGE', 'FORMATTED', 'SIGNAL')); - } - - /** - * Handler for start of event element. - * @param resource $expat Parser handle. - * @param string $tag Element name. - * @param hash $attributes Name value pairs. - * Attributes without content - * are marked as true. - * @access protected - */ - protected function startElement($expat, $tag, $attributes) { - $this->attributes = $attributes; - if ($tag == 'GROUP') { - $this->pushNestingTag(new NestingGroupTag($attributes)); - } elseif ($tag == 'CASE') { - $this->pushNestingTag(new NestingCaseTag($attributes)); - } elseif ($tag == 'TEST') { - $this->pushNestingTag(new NestingMethodTag($attributes)); - } elseif ($this->isLeaf($tag)) { - $this->in_content_tag = true; - $this->content = ''; - } - } - - /** - * End of element event. - * @param resource $expat Parser handle. - * @param string $tag Element name. - * @access protected - */ - protected function endElement($expat, $tag) { - $this->in_content_tag = false; - if (in_array($tag, array('GROUP', 'CASE', 'TEST'))) { - $nesting_tag = $this->popNestingTag(); - $nesting_tag->paintEnd($this->listener); - } elseif ($tag == 'NAME') { - $nesting_tag = &$this->getCurrentNestingTag(); - $nesting_tag->setName($this->content); - $nesting_tag->paintStart($this->listener); - } elseif ($tag == 'PASS') { - $this->listener->paintPass($this->content); - } elseif ($tag == 'FAIL') { - $this->listener->paintFail($this->content); - } elseif ($tag == 'EXCEPTION') { - $this->listener->paintError($this->content); - } elseif ($tag == 'SKIP') { - $this->listener->paintSkip($this->content); - } elseif ($tag == 'SIGNAL') { - $this->listener->paintSignal( - $this->attributes['TYPE'], - unserialize($this->content)); - } elseif ($tag == 'MESSAGE') { - $this->listener->paintMessage($this->content); - } elseif ($tag == 'FORMATTED') { - $this->listener->paintFormattedMessage($this->content); - } - } - - /** - * Content between start and end elements. - * @param resource $expat Parser handle. - * @param string $text Usually output messages. - * @access protected - */ - protected function addContent($expat, $text) { - if ($this->in_content_tag) { - $this->content .= $text; - } - return true; - } - - /** - * XML and Doctype handler. Discards all such content. - * @param resource $expat Parser handle. - * @param string $default Text of default content. - * @access protected - */ - protected function defaultContent($expat, $default) { - } -} -?> diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay.php deleted file mode 100644 index b167915..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay.php +++ /dev/null @@ -1,261 +0,0 @@ -. - - */ - -//require 'Yay/Expectations.php'; -//require 'Yay/Matchers/OptionalMatcher.php'; -//require 'Yay/Matchers/AnyMatcher.php'; -//require 'Yay/Matchers/IdenticalMatcher.php'; -//require 'Yay/Matchers/EqualMatcher.php'; -//require 'Yay/Matchers/PatternMatcher.php'; -//require 'Yay/Matchers/ReferenceMatcher.php'; -//require 'Yay/Matchers/BoundsMatcher.php'; -//require 'Yay/Actions/ReturnValueAction.php'; -//require 'Yay/Actions/ReturnReferenceAction.php'; -//require 'Yay/Actions/ThrowAction.php'; -//require 'Yay/Actions/CallbackAction.php'; - -/** - * A convenience factory class. - * @author Chris Corbyn - * @package Yay - */ -class Yay -{ - - /** - * The classpath used for autoloading. - * @var string - * @access private - */ - private static $CLASSPATH = '.'; - - // -- Expectations - - /** - * Create a new Expectations builder instance. - * @return Yay_Expectations - */ - public static function expectations() - { - return new Yay_Expectations(); - } - - // -- Matchers - - /** - * Create a new Optional matcher, optionally wrapping $value. - * @param string $value, optional - * @return Yay_Matchers_OptionalMatcher - */ - public static function optional($value = null) - { - return new Yay_Matchers_OptionalMatcher($value); - } - - /** - * Create a new Any matcher, optionally constrained to $type. - * @param string $type, optional - * @return Yay_Matchers_AnyMatcher - */ - public static function any($type = null) - { - return new Yay_Matchers_AnyMatcher($type, true); - } - - /** - * Create a negated Any matcher, optionally constrained to $type. - * @param string $type, optional - * @return Yay_Matchers_AnyMatcher - */ - public static function none($type = null) - { - return new Yay_Matchers_AnyMatcher($type, false); - } - - /** - * Create a new Identical matcher for $value. - * @param mixed $value - * @return Yay_Matchers_IdenticalMatcher - */ - public static function identical($value) - { - return new Yay_Matchers_IdenticalMatcher($value, true); - } - - /** - * Create a negated Identical matcher for $value. - * @param mixed $value - * @return Yay_Matchers_IdenticalMatcher - */ - public static function notIdentical($value) - { - return new Yay_Matchers_IdenticalMatcher($value, false); - } - - /** - * Create a new Equal matcher for $value. - * @param mixed $value - * @return Yay_Matchers_EqualMatcher - */ - public static function equal($value) - { - return new Yay_Matchers_EqualMatcher($value, true); - } - - /** - * Create a negated Equal matcher for $value. - * @param mixed $value - * @return Yay_Matchers_EqualMatcher - */ - public static function notEqual($value) - { - return new Yay_Matchers_EqualMatcher($value, false); - } - - /** - * Create a new Pattern matcher for $pattern. - * @param string $pattern - * @return Yay_Matchers_IsAMatcher - */ - public static function pattern($pattern) - { - return new Yay_Matchers_PatternMatcher($pattern, true); - } - - /** - * Create a negated Pattern matcher for $pattern. - * @param string $pattern - * @return Yay_Matchers_IsAMatcher - */ - public static function noPattern($pattern) - { - return new Yay_Matchers_PatternMatcher($pattern, false); - } - - /** - * Create a new Reference matcher for $ref. - * @param mixed $ref - * @return Yay_Matchers_ReferenceMatcher - */ - public static function reference(&$ref) - { - return new Yay_Matchers_ReferenceMatcher($ref, true); - } - - /** - * Create a negated Reference matcher for $ref. - * @param mixed $ref - * @return Yay_Matchers_ReferenceMatcher - */ - public static function noReference(&$ref) - { - return new Yay_Matchers_ReferenceMatcher($ref, false); - } - - /** - * Create a new Bounds matcher for boundaries between $lower and $upper. - * @param mixed $lower - * @param mixed $upper - * @return Yay_Matchers_BoundsMatcher - */ - public static function bounds($lower, $upper) - { - return new Yay_Matchers_BoundsMatcher($lower, $upper, true); - } - - /** - * Create a negated Bounds matcher for boundaries outside $lower and $upper. - * @param mixed $lower - * @param mixed $upper - * @return Yay_Matchers_BoundsMatcher - */ - public static function outside($lower, $upper) - { - return new Yay_Matchers_BoundsMatcher($lower, $upper, false); - } - - // -- Actions - - /** - * Create a new ReturnValueAction with $value. - * @param mixed $value - * @return Yay_Actions_ReturnValueAction - */ - public static function returnValue($value) - { - return new Yay_Actions_ReturnValueAction($value); - } - - /** - * Create a new ReturnReferenceAction with &$ref. - * @param mixed $ref - * @return Yay_Actions_ReturnReferenceAction - */ - public static function returnReference(&$ref) - { - return new Yay_Actions_ReturnReferenceAction($ref); - } - - /** - * Create a new ThrowAction with $e. - * @param Exception $ref - * @return Yay_Actions_ThrowAction - */ - public static function throwException(Exception $e) - { - return new Yay_Actions_ThrowAction($e); - } - - /** - * Create a new CallbackAction with $callback. - * @param callback $callback - * @return Yay_Actions_CallbackAction - */ - public static function call($callback) - { - return new Yay_Actions_CallbackAction($callback); - } - - /** - * Set the classpath for autoloading. - * @param string $path - */ - public static function setClassPath($path) - { - self::$CLASSPATH = $path; - } - - /** - * Static autoloader registered in bootstrap file. - * @param string $class - */ - public static function autoload($class) - { - if (substr($class, 0, 3) != 'Yay') - { - return; - } - $file = str_replace('_', '/', $class) . '.php'; - $path = self::$CLASSPATH . '/' . $file; - if (is_file($path)) - { - require_once $path; - } - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Action.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Action.php deleted file mode 100644 index d7b3a01..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Action.php +++ /dev/null @@ -1,37 +0,0 @@ -. - - */ - -//require 'Yay/Invocation.php'; -//require 'Yay/SelfDescribing.php'; - -/** - * An Action performed when an expected Invocation occurs. - * @author Chris Corbyn - * @package Yay - */ -interface Yay_Action extends Yay_SelfDescribing -{ - - /** - * Mimmick the method Invocation and return a value. - * @param Yay_Invocation $invocation - * @return mixed - */ - public function &invoke(Yay_Invocation $invocation); - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Actions/CallbackAction.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Actions/CallbackAction.php deleted file mode 100644 index 8611441..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Actions/CallbackAction.php +++ /dev/null @@ -1,66 +0,0 @@ -. - - */ - -//require 'Yay/Action.php'; -//require 'Yay/Description.php'; - -/** - * An Action which delegates to a callback. - * @author Chris Corbyn - * @package Yay - */ -class Yay_Actions_CallbackAction implements Yay_Action -{ - - /** - * The callback to invoke. - * @var callback - * @access private - */ - private $_callback; - - /** - * Create a new CallbackAction for $callback. - * @param callback $callback - */ - public function __construct($callback) - { - $this->_callback = $callback; - } - - /** - * Mimmick the method Invocation and return a value. - * @param Yay_Invocation $invocation - * @return mixed - */ - public function &invoke(Yay_Invocation $invocation) - { - $ret = call_user_func($this->_callback, $invocation); - return $ret; - } - - /** - * Describe this Expectation to $description. - * @param Yay_Description $description - */ - public function describeTo(Yay_Description $description) - { - $description->appendText(' Runs a callback;'); - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Actions/ReturnReferenceAction.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Actions/ReturnReferenceAction.php deleted file mode 100644 index e96394d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Actions/ReturnReferenceAction.php +++ /dev/null @@ -1,64 +0,0 @@ -. - - */ - -//require 'Yay/Action.php'; - -/** - * An Action which returns a reference. - * @author Chris Corbyn - * @package Yay - */ -class Yay_Actions_ReturnReferenceAction implements Yay_Action -{ - - /** - * The reference to return. - * @var mixed - * @access private - */ - private $_ref; - - /** - * Create a new ReturnReferenceAction for &$ref. - * @param mixed $ref - */ - public function __construct(&$ref) - { - $this->_ref =& $ref; - } - - /** - * Mimmick the method Invocation and return the reference. - * @param Yay_Invocation $invocation - * @return mixed - */ - public function &invoke(Yay_Invocation $invocation) - { - return $this->_ref; - } - - /** - * Describe this Expectation to $description. - * @param Yay_Description $description - */ - public function describeTo(Yay_Description $description) - { - $description->appendText(' Returns a reference;'); - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Actions/ReturnValueAction.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Actions/ReturnValueAction.php deleted file mode 100644 index c749a1d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Actions/ReturnValueAction.php +++ /dev/null @@ -1,100 +0,0 @@ -. - - */ - -//require 'Yay/Action.php'; - -/** - * An Action which returns a specified value. - * @author Chris Corbyn - * @package Yay - */ -class Yay_Actions_ReturnValueAction implements Yay_Action -{ - - /** - * The value to return. - * @var mixed - * @access private - */ - private $_value; - - /** - * Create a new ReturnValueAction for $value. - * @param mixed $value - */ - public function __construct($value) - { - $this->_value = $value; - } - - /** - * Mimmick the method Invocation and return a value. - * @param Yay_Invocation $invocation - * @return mixed - */ - public function &invoke(Yay_Invocation $invocation) - { - $value = $this->_value; - return $value; - } - - /** - * Describe this Expectation to $description. - * @param Yay_Description $description - */ - public function describeTo(Yay_Description $description) - { - $description->appendText(sprintf(' Returns %s;', $this->_describeValue('%s [%s]'))); - } - - private function _describeValue($format) - { - $description = ''; - $value = $this->_value; - if (is_int($value)) - { - $description = sprintf($format, 'int', $value); - } - elseif (is_float($value)) - { - $description = sprintf($format, 'float', preg_replace('/^(.{8}).+/', '$1..', $value)); - } - elseif (is_numeric($value)) - { - $description = sprintf($format, 'number', preg_replace('/^(.{8}).+/', '$1..', $value)); - } - elseif (is_string($value)) - { - $description = sprintf($format, 'string', preg_replace('/^(.{8}).+/', '$1..', $value)); - } - elseif (is_object($value)) - { - $description = sprintf($format, 'object', get_class($value)); - } - elseif (is_array($value)) - { - $description = sprintf($format, 'array', count($value) . ' items'); - } - else - { - $description = sprintf($format, gettype($value), preg_replace('/^(.{8}).+/', '$1..', (string) $value)); - } - return $description; - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Actions/ThrowAction.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Actions/ThrowAction.php deleted file mode 100644 index bdec7c8..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Actions/ThrowAction.php +++ /dev/null @@ -1,66 +0,0 @@ -. - - */ - -//require 'Yay/Action.php'; - -/** - * An Action which throws an Exception. - * @author Chris Corbyn - * @package Yay - */ -class Yay_Actions_ThrowAction implements Yay_Action -{ - - /** - * The Exception to throw. - * @var Exception - * @access private - */ - private $_e; - - /** - * Create a new ThrowAction for $e. - * @param Exception $e - */ - public function __construct(Exception $e) - { - $this->_e = $e; - } - - /** - * Mimmick the method Invocation and throw an Exception. - * @param Yay_Invocation $invocation - * @throws Exception - */ - public function &invoke(Yay_Invocation $invocation) - { - throw $this->_e; - } - - /** - * Describe this Expectation to $description. - * @param Yay_Description $description - */ - public function describeTo(Yay_Description $description) - { - $description->appendText( - sprintf(' Throws %s;', get_class($this->_e)) - ); - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Description.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Description.php deleted file mode 100644 index 561e2a2..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Description.php +++ /dev/null @@ -1,45 +0,0 @@ -. - - */ - -/** - * A Description container for error messages. - * @author Chris Corbyn - * @package Yay - */ -interface Yay_Description -{ - - /** - * Append an existing Description to this Description. - * @param Yay_Description - */ - public function appendDescription(Yay_Description $description); - - /** - * Append text content to this Description. - * @param string $text - */ - public function appendText($text); - - /** - * Get this description back as a formatted string. - * @return string - */ - public function toString(); - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectation.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectation.php deleted file mode 100644 index de155f9..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectation.php +++ /dev/null @@ -1,88 +0,0 @@ -. - - */ - -//require 'Yay/MockObject.php'; -//require 'Yay/Invocation.php'; -//require 'Yay/Action.php'; -//require 'Yay/SelfDescribing.php'; -//require 'Yay/State.php'; -//require 'Yay/StatePredicate.php'; -//require 'Yay/Sequence.php'; - -/** - * An Invocation expectation. - * @author Chris Corbyn - * @package Yay - */ -interface Yay_Expectation extends Yay_SelfDescribing -{ - - /** - * Specify the MockObject which the Invocation will occur. - * This method should return the mock object in record mode. - * @param Yay_MockObject $mock - * @return Yay_MockObject - */ - public function of(Yay_MockObject $mock); - - /** - * Notify the Expectation of an Invocation and check if it matches. - * @param Yay_Invocation $invocation - * @return boolean - */ - public function isExpected(Yay_Invocation $invocation); - - /** - * Specify the Action to run if a match occurs. - * @param Yay_Action $action - */ - public function will(Yay_Action $action); - - /** - * Only be expected when in the given State predicate. - * @param Yay_StatePredicate $predicate - */ - public function when(Yay_StatePredicate $predicate); - - /** - * Activate the given $state if a match occurs. - * @param Yay_State $state - */ - public function then(Yay_State $state); - - /** - * Constrain this expectation to be valid only if invoked in the given sequence. - * @param Yay_Sequence $sequence - */ - public function inSequence(Yay_Sequence $sequence); - - /** - * Test if all conditions of the Invocation are satisfied. - * @return boolean - */ - public function isSatisfied(); - - /** - * Get the Action for the given Invocation. - * This may have been specified by a will() clause. - * @param Yay_Invocation $invocation - * @return Yay_Action - */ - public function getAction(Yay_Invocation $invocation); - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/ExpectationProvider.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/ExpectationProvider.php deleted file mode 100644 index 8b90202..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/ExpectationProvider.php +++ /dev/null @@ -1,33 +0,0 @@ -. - - */ - -/** - * An Invocation expectation provider. - * @author Chris Corbyn - * @package Yay - */ -interface Yay_ExpectationProvider -{ - - /** - * Returns the Expectations. - * @return array of Yay_Expectation - */ - public function getExpectations(); - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations.php deleted file mode 100644 index 9759a7a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations.php +++ /dev/null @@ -1,306 +0,0 @@ -. - - */ - -//require 'Yay/Expectation.php'; -//require 'Yay/InvocationRecorder.php'; -//require 'Yay/InvocationProxy.php'; -//require 'Yay/Invocation.php'; -//require 'Yay/State.php'; -//require 'Yay/StatePredicate.php'; -//require 'Yay/Sequence.php'; -//require 'Yay/Expectations/ExactlyExpectation.php'; -//require 'Yay/Expectations/AtLeastExpectation.php'; -//require 'Yay/Expectations/AtMostExpectation.php'; -//require 'Yay/Expectations/BetweenExpectation.php'; -//require 'Yay/Action.php'; -//require 'Yay/Actions/ReturnValueAction.php'; -//require 'Yay/Actions/ReturnReferenceAction.php'; -//require 'Yay/Actions/ThrowAction.php'; -//require 'Yay/Actions/CallbackAction.php'; - -/** - * A group of expectations which can be specified in a fluid manner. - * Generally speaking this is where all expectations should be made for the sake - * of abstraction. - * @author Chris Corbyn - * @package Yay - */ -class Yay_Expectations implements Yay_InvocationRecorder -{ - - /** - * The Expectation stack. - * @var array - * @access private - */ - private $_expectations = array(); - - /** - * The current Expectation to proxy any recording to. - * @var Yay_Expectation - * @access private - */ - private $_currentEndpoint; - - /** - * Create a new instance of Expectations. - * @return Yay_Expectations - */ - final public static function create() - { - return new self(); - } - - /** - * Expect one Invocation on the $mock object. - * Returns the mock object in record mode. - * @param Yay_MockObject $mock - * @return Yay_Expectations - */ - public function one(Yay_MockObject $mock) - { - return $this->exactly(1)->of($mock); - } - - /** - * Expect exactly $n Invocations on a mock object specified with a following - * of() clause. - * Example: Expectations::create()->exactly(2)->of($mock); - * @param int $n - * @return Yay_Expectations - */ - public function exactly($n) - { - return $this->_setEndpoint(new Yay_Expectations_ExactlyExpectation($n)); - } - - /** - * Expect at least $n Invocations on a mock object specified with a following - * of() clause. - * Example: Expectations::create()->atLeast(2)->of($mock); - * @param int $n - * @return Yay_Expectations - */ - public function atLeast($n) - { - return $this->_setEndpoint(new Yay_Expectations_AtLeastExpectation($n)); - } - - /** - * Expect at most $n Invocations on a mock object specified with a following - * of() clause. - * Example: Expectations::create()->atMost(2)->of($mock); - * @param int $n - * @return Yay_Expectations - */ - public function atMost($n) - { - return $this->_setEndpoint(new Yay_Expectations_AtMostExpectation($n)); - } - - /** - * Expect at between $min and $max Invocations on a mock object specified - * with a following of() clause. - * Example: Expectations::create()->atLeast(2)->of($mock); - * @param int $n - * @return Yay_Expectations - */ - public function between($min, $max) - { - return $this->_setEndpoint(new Yay_Expectations_BetweenExpectation($min, $max)); - } - - /** - * Ignore Invocations on the $mock object specified. - * @param Yay_MockObject $mock - * @return Yay_Expectations - */ - public function ignoring(Yay_MockObject $mock) - { - return $this->atLeast(0)->of($mock); - } - - /** - * Allow Invocations on the $mock object specified. - * This does exactly the same thing as ignoring() but it allows a semantically - * different meaning in the test case. - * @param Yay_MockObject $mock - * @return Yay_Expectations - */ - public function allowing(Yay_MockObject $mock) - { - return $this->ignoring($mock); - } - - /** - * Deny Invocations on the $mock object specified. - * @param Yay_MockObject $mock - * @return Yay_Expectations - */ - public function never(Yay_MockObject $mock) - { - return $this->exactly(0)->of($mock); - } - - /** - * Specify the MockObject which the Invocation will occur. - * This method returns the mock object in record mode. - * @param Yay_MockObject $mock - * @return Yay_InvocationProxy - */ - public function of(Yay_MockObject $mock) - { - $this->_getEndpoint()->of($mock); - return new Yay_InvocationProxy($this, $mock); - } - - /** - * Specify the Action to run if a match occurs. - * @param Yay_Action $action - */ - public function will(Yay_Action $action) - { - $this->_getEndpoint()->will($action); - return $this; - } - - /** - * Only be expected when in the given State predicate. - * @param Yay_StatePredicate $predicate - */ - public function when(Yay_StatePredicate $predicate) - { - $this->_getEndpoint()->when($predicate); - return $this; - } - - /** - * Activate the given $state if a match occurs. - * @param Yay_State $state - */ - public function then(Yay_State $state) - { - $this->_getEndpoint()->then($state); - return $this; - } - - /** - * Constrain the current expectation to occur in the given sequence. - * @param Yay_Sequence $seq - */ - public function inSequence(Yay_Sequence $seq) - { - $this->_getEndpoint()->inSequence($seq); - return $this; - } - - /** - * A wrapper for will(Yay::returnValue($value)). - * @param mixed $value - */ - public function returns($value) - { - $this->_getEndpoint()->will(new Yay_Actions_ReturnValueAction($value)); - return $this; - } - - /** - * A wrapper for will(Yay::returnReference($ref)). - * @param mixed $ref - */ - public function returnsReference(&$ref) - { - $this->_getEndpoint()->will(new Yay_Actions_ReturnReferenceAction($ref)); - return $this; - } - - /** - * A wrapper for will(Yay::throwException($e)). - * @param Exception $e - */ - public function throws(Exception $e) - { - $this->_getEndpoint()->will(new Yay_Actions_ThrowAction($e)); - return $this; - } - - /** - * A wrapper for will(Yay::call($callback)). - * @param callback $callback - */ - public function calls($callback) - { - $this->_getEndpoint()->will(new Yay_Actions_CallbackAction($callback)); - return $this; - } - - /** - * Record any Invocations on the MockObject whilst it's in record mode. - * @param Yay_Invocation $invocation - */ - public function recordInvocation(Yay_Invocation $invocation) - { - $this->_getEndpoint()->recordInvocation($invocation); - } - - /** - * Returns the Expectation stack. - * @return Yay_Expectation - */ - public function getExpectations() - { - return $this->_expectations; - } - - // -- Private methods - - /** - * Apply a new Expectation to the stack and tag it as the endpoint for recording. - * @param Yay_Expectation $expectation - * @return Yay_Expectations - * @access private - */ - private function _setEndpoint(Yay_Expectation $expectation) - { - $this->_expectations[] = $expectation; - $this->_currentEndpoint = $expectation; - return $this; - } - - /** - * Gets the current endpoint (current expectation). - * @return Yay_Expectation - * @access private - */ - private function _getEndpoint() - { - if (!isset($this->_currentEndpoint)) - { - throw new BadMethodCallException( - 'No cardinality clause has yet been made. First call one(), atLeast(), ' . - 'atMost(), exactly(), between(), ignoring(), allowing() or never() ' . - 'before performing this operation.' - ); - } - else - { - return $this->_currentEndpoint; - } - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations/AbstractExpectation.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations/AbstractExpectation.php deleted file mode 100644 index b32a29a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations/AbstractExpectation.php +++ /dev/null @@ -1,345 +0,0 @@ -. - - */ - -//require 'Yay/Mockery.php'; -//require 'Yay/Expectation.php'; -//require 'Yay/ExpectationProvider.php'; -//require 'Yay/Invocation.php'; -//require 'Yay/InvocationRecorder.php'; -//require 'Yay/InvocationProxy.php'; -//require 'Yay/Action.php'; -//require 'Yay/Matcher.php'; -//require 'Yay/Matchers/IdenticalMatcher.php'; -//require 'Yay/State.php'; -//require 'Yay/StatePredicate.php'; -//require 'Yay/Sequence.php'; -//require 'Yay/Description.php'; -//require 'Yay/MockGenerator.php'; - -/** - * A base Expectation which other Expectations extend. - * @author Chris Corbyn - * @package Yay - */ -abstract class Yay_Expectations_AbstractExpectation - implements Yay_Expectation, Yay_InvocationRecorder -{ - - /** - * The object to expect Invocations from. - * @var Yay_MockObject - * @access private - */ - private $_object; - - /** - * The method name to expect Invocations on. - * @var string - * @access private - */ - private $_method; - - /** - * The argument Matchers. - * @var array - * @access private - */ - private $_matchers = array(); - - /** - * The Action to use if matched. - * @var Yay_Action - * @access private - */ - private $_action; - - /** - * A state predicate to check for. - * @var Yay_StatePredicate - * @access private - */ - private $_statePredicate; - - /** - * A state to effect if matched. - * @var Yay_State - * @access private - */ - private $_state; - - /** - * The ID wanted to be valid in the Sequence. - * @var int - * @access private - */ - private $_wantedSequenceId; - - /** - * The Sequence to check for validity (if any). - * @var Yay_Sequence - * @access private - */ - private $_sequence; - - /** - * Invoked when the expectation matches so any counters can be incremented - * for example. - * @param Yay_Invocation $invocation - */ - abstract public function notifyMatchedInvocation(Yay_Invocation $invocation); - - /** - * Describe the boundaries of how many invocations can occur. - * @param Yay_Description $description - */ - abstract public function describeBounds(Yay_Description $description); - - /** - * Describe the current status of this expectation. - * @param Yay_Description $description - */ - abstract public function describeSatisfaction(Yay_Description $description); - - /** - * Specify the MockObject which the Invocation will occur. - * This method returns the mock object in record mode. - * @param Yay_MockObject $mock - * @return Yay_InvocationProxy - */ - public function of(Yay_MockObject $mock) - { - $this->_object = $mock; - return new Yay_InvocationProxy($this, $mock); - } - - /** - * Notify the Expectation of an Invocation and check if it matches. - * @param Yay_Invocation $invocation - * @return boolean - */ - public function isExpected(Yay_Invocation $invocation) - { - $matches = true; - $object = $invocation->getObject(); - if ($object === $this->_object) - { - if (isset($this->_statePredicate)) - { - $matches = $this->_statePredicate->isActive(); - } - - if ($matches && isset($this->_method)) - { - if ($this->_method == $invocation->getMethod()) - { - $args =& $invocation->getArguments(); - foreach ($this->_matchers as $i => $m) - { - if (!array_key_exists($i, $args)) - { - if ($m->isOptional()) - { - break; - } - else - { - $matches = false; - break; - } - } - else - { - if (!$m->matches($args[$i])) - { - $matches = false; - break; - } - } - } - } - else - { - $matches = false; - } - } - - if ($matches && isset($this->_sequence)) - { - $matches = $this->_sequence->isInSequence($this->_wantedSequenceId); - } - } - else - { - $matches = false; - } - - if ($matches) - { - $this->notifyMatchedInvocation($invocation); - } - - return $matches; - } - - /** - * Specify the Action to run if a match occurs. - * @param Yay_Action $action - */ - public function will(Yay_Action $action) - { - $this->_action = $action; - return $this; - } - - /** - * Only be expected when in the given State predicate. - * @param Yay_StatePredicate $predicate - */ - public function when(Yay_StatePredicate $predicate) - { - $this->_statePredicate = $predicate; - return $this; - } - - /** - * Activate the given $state if a match occurs. - * @param Yay_State $state - */ - public function then(Yay_State $state) - { - $this->_state = $state; - return $this; - } - - /** - * Constrain this expectation to be valid only if invoked in the given sequence. - * @param Yay_Sequence $sequence - */ - public function inSequence(Yay_Sequence $sequence) - { - $this->_wantedSequenceId = $sequence->requestSequenceId(); - $this->_sequence = $sequence; - return $this; - } - - /** - * Get the Action for the given Invocation. - * This may have been specified by a will() clause. - * @param Yay_Invocation $invocation - * @return Yay_Action - */ - public function getAction(Yay_Invocation $invocation) - { - if (isset($this->_state)) - { - $this->_state->activate(); - } - return $this->_action; - } - - /** - * Record any Invocations on the MockObject whilst it's in record mode. - * @param Yay_Invocation $invocation - */ - public function recordInvocation(Yay_Invocation $invocation) - { - $this->_method = $invocation->getMethod(); - $matchers =& $invocation->getArguments(); - foreach ($matchers as $matcher) - { - if ($matcher instanceof Yay_Matcher) - { - $this->_matchers[] = $matcher; - } - else - { - $this->_matchers[] = new Yay_Matchers_IdenticalMatcher($matcher); - } - } - } - - /** - * Returns the Expectations. - * @return array of Yay_Expectation - */ - public function getExpectations() - { - return array($this); - } - - /** - * Describe this Expectation to $description. - * @param Yay_Description $description - */ - public function describeTo(Yay_Description $description) - { - $this->describeBounds($description); - - $description->appendText(sprintf(' of %s;', $this->_getInvocationSignature())); - - if (isset($this->_sequence)) - { - $description->appendText(' in'); - $this->_sequence->describeTo($description); - } - - if (isset($this->_statePredicate)) - { - $description->appendText(' when'); - $this->_statePredicate->describeTo($description); - } - - if (isset($this->_action)) - { - $this->_action->describeTo($description); - } - - $this->describeSatisfaction($description); - } - - // -- Private methods - - private function _getInvocationSignature() - { - $class = Yay_MockGenerator::getInstance() - ->reverseNamingScheme(get_class($this->_object)); - if (isset($this->_method)) - { - $method = $this->_method; - } - else - { - $method = ''; - } - if (!empty($this->_matchers)) - { - $args = array(); - foreach ($this->_matchers as $matcher) - { - $args[] = $matcher->describeMatch('%s [%s]'); - } - $params = implode(', ', $args); - } - else - { - $params = ''; - } - return sprintf('%s::%s(%s)', $class, $method, $params); - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations/AtLeastExpectation.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations/AtLeastExpectation.php deleted file mode 100644 index eb167be..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations/AtLeastExpectation.php +++ /dev/null @@ -1,101 +0,0 @@ -. - - */ - -//require 'Yay/Expectations/AbstractExpectation.php'; -//require 'Yay/Invocation.php'; - -/** - * An Expectation which wants at least a set number of matching Invocations. - * @author Chris Corbyn - * @package Yay - */ -class Yay_Expectations_AtLeastExpectation - extends Yay_Expectations_AbstractExpectation -{ - - /** - * The expected Invocation count. - * @var int - * @access private - */ - private $_count = 0; - - /** - * The number of matched Invocations. - * @var int - * @access private - */ - private $_matched = 0; - - /** - * Create a new AtLeastExpectation expecting at least $n Invocations. - * @param int $n - */ - public function __construct($n) - { - $this->_count = $n; - } - - /** - * Test if all conditions of the Invocation are satisfied. - * @return boolean - */ - public function isSatisfied() - { - return ($this->_matched >= $this->_count); - } - - /** - * Increment the match counter by 1. - * @param Yay_Invocation $invocation - */ - public function notifyMatchedInvocation(Yay_Invocation $invocation) - { - $this->_matched++; - } - - /** - * Describe the boundaries of how many invocations can occur. - * @param Yay_Description $description - */ - public function describeBounds(Yay_Description $description) - { - if ($this->_count > 0) - { - $description->appendText(sprintf('At least %d', $this->_count)); - } - else - { - $description->appendText('Any number'); - } - } - - /** - * Describe the current status of this expectation. - * @param Yay_Description $description - */ - public function describeSatisfaction(Yay_Description $description) - { - if ($this->_matched >= $this->_count) - { - $description->appendText(' already'); - } - $description->appendText(sprintf(' occurred %d times', $this->_matched)); - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations/AtMostExpectation.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations/AtMostExpectation.php deleted file mode 100644 index 61d22fc..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations/AtMostExpectation.php +++ /dev/null @@ -1,117 +0,0 @@ -. - - */ - -//require 'Yay/Expectations/AbstractExpectation.php'; -//require 'Yay/Invocation.php'; - -/** - * An Expectation which wants up to a set number of matching Invocations. - * @author Chris Corbyn - * @package Yay - */ -class Yay_Expectations_AtMostExpectation - extends Yay_Expectations_AbstractExpectation -{ - - /** - * The expected Invocation count. - * @var int - * @access private - */ - private $_count = 0; - - /** - * The number of matched Invocations. - * @var int - * @access private - */ - private $_matched = 0; - - /** - * Create a new AtMostExpectation expecting at most $n Invocations. - * @param int $n - */ - public function __construct($n) - { - $this->_count = $n; - } - - /** - * Test if this Invocation is one that was expected by this Expectation. - * @param Yay_Invocation $invocation - * @return boolean - */ - public function isExpected(Yay_Invocation $invocation) - { - return parent::isExpected($invocation) && ($this->_matched <= $this->_count); - } - - /** - * Test if all conditions of the Invocation are satisfied. - * @return boolean - */ - public function isSatisfied() - { - return true; - } - - /** - * Increment the match counter by 1. - * @param Yay_Invocation $invocation - */ - public function notifyMatchedInvocation(Yay_Invocation $invocation) - { - $this->_matched++; - } - - /** - * Describe the boundaries of how many invocations can occur. - * @param Yay_Description $description - */ - public function describeBounds(Yay_Description $description) - { - if ($this->_count > 0) - { - $description->appendText(sprintf('At most %d', $this->_count)); - } - else - { - $description->appendText('No invocations'); - } - } - - /** - * Describe the current status of this expectation. - * @param Yay_Description $description - */ - public function describeSatisfaction(Yay_Description $description) - { - if ($this->_matched >= $this->_count) - { - $description->appendText(' already'); - } - $description->appendText( - sprintf( - ' occurred %d times', - (($this->_matched < $this->_count) - ? $this->_matched - : $this->_count) - )); - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations/BetweenExpectation.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations/BetweenExpectation.php deleted file mode 100644 index 0368746..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations/BetweenExpectation.php +++ /dev/null @@ -1,118 +0,0 @@ -. - - */ - -//require 'Yay/Expectations/AbstractExpectation.php'; -//require 'Yay/Invocation.php'; - -/** - * An Expectation which allows a boundary for a number of matching Invocations. - * @author Chris Corbyn - * @package Yay - */ -class Yay_Expectations_BetweenExpectation - extends Yay_Expectations_AbstractExpectation -{ - - /** - * The minimum Invocation count. - * @var int - * @access private - */ - private $_min = 0; - - /** - * The maximum Invocation count. - * @var int - * @access private - */ - private $_max = 0; - - /** - * The number of matched Invocations. - * @var int - * @access private - */ - private $_matched = 0; - - /** - * Create a new BetweenExpectation expecting between $min and $max Invocations. - * @param int $n - */ - public function __construct($min, $max) - { - $this->_min = $min; - $this->_max = $max; - } - - /** - * Test if this Invocation is one that was expected by this Expectation. - * @param Yay_Invocation $invocation - * @return boolean - */ - public function isExpected(Yay_Invocation $invocation) - { - return parent::isExpected($invocation) && ($this->_matched <= $this->_max); - } - - /** - * Test if all conditions of the Invocation are satisfied. - * @return boolean - */ - public function isSatisfied() - { - return ($this->_matched >= $this->_min); - } - - /** - * Increment the match counter by 1. - * @param Yay_Invocation $invocation - */ - public function notifyMatchedInvocation(Yay_Invocation $invocation) - { - $this->_matched++; - } - - /** - * Describe the boundaries of how many invocations can occur. - * @param Yay_Description $description - */ - public function describeBounds(Yay_Description $description) - { - $description->appendText(sprintf('Between %d and %d', $this->_min, $this->_max)); - } - - /** - * Describe the current status of this expectation. - * @param Yay_Description $description - */ - public function describeSatisfaction(Yay_Description $description) - { - if ($this->_matched >= $this->_min) - { - $description->appendText(' already'); - } - $description->appendText( - sprintf( - ' occurred %d times', - (($this->_matched < $this->_max) - ? $this->_matched - : $this->_max) - )); - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations/ExactlyExpectation.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations/ExactlyExpectation.php deleted file mode 100644 index 243fe46..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Expectations/ExactlyExpectation.php +++ /dev/null @@ -1,117 +0,0 @@ -. - - */ - -//require 'Yay/Expectations/AbstractExpectation.php'; -//require 'Yay/Invocation.php'; - -/** - * An Expectation which wants an exact number of matching Invocations. - * @author Chris Corbyn - * @package Yay - */ -class Yay_Expectations_ExactlyExpectation - extends Yay_Expectations_AbstractExpectation -{ - - /** - * The expected Invocation count. - * @var int - * @access private - */ - private $_count = 0; - - /** - * The number of matched Invocations. - * @var int - * @access private - */ - private $_matched = 0; - - /** - * Create a new ExactlyExpectation expecting $n Invocations. - * @param int $n - */ - public function __construct($n) - { - $this->_count = $n; - } - - /** - * Test if this Invocation is one that was expected by this Expectation. - * @param Yay_Invocation $invocation - * @return boolean - */ - public function isExpected(Yay_Invocation $invocation) - { - return parent::isExpected($invocation) && ($this->_matched <= $this->_count); - } - - /** - * Test if all conditions of the Invocation are satisfied. - * @return boolean - */ - public function isSatisfied() - { - return ($this->_matched >= $this->_count); - } - - /** - * Increment the match counter by 1. - * @param Yay_Invocation $invocation - */ - public function notifyMatchedInvocation(Yay_Invocation $invocation) - { - $this->_matched++; - } - - /** - * Describe the boundaries of how many invocations can occur. - * @param Yay_Description $description - */ - public function describeBounds(Yay_Description $description) - { - if ($this->_count > 0) - { - $description->appendText(sprintf('Exactly %d', $this->_count)); - } - else - { - $description->appendText('No invocations'); - } - } - - /** - * Describe the current status of this expectation. - * @param Yay_Description $description - */ - public function describeSatisfaction(Yay_Description $description) - { - if ($this->_matched >= $this->_count) - { - $description->appendText(' already'); - } - $description->appendText( - sprintf( - ' occurred %d times', - (($this->_matched < $this->_count) - ? $this->_matched - : $this->_count) - )); - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Invocation.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Invocation.php deleted file mode 100644 index d382157..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Invocation.php +++ /dev/null @@ -1,49 +0,0 @@ -. - - */ - -//require 'Yay/SelfDescribing.php'; - -/** - * A representation of a Method invocation. - * This is a container for the object the method was invoked on, the method- - * name and the arguments in the invocation. - * @author Chris Corbyn - * @package Yay - */ -interface Yay_Invocation extends Yay_SelfDescribing -{ - - /** - * Get the object which this Invocation occured on. - * @return object - */ - public function getObject(); - - /** - * Get the method name of the invoked method. - * @return string - */ - public function getMethod(); - - /** - * Get the argument list in the Invocation. - * @return array - */ - public function &getArguments(); - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/InvocationHandler.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/InvocationHandler.php deleted file mode 100644 index a669fe5..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/InvocationHandler.php +++ /dev/null @@ -1,36 +0,0 @@ -. - - */ - -//require 'Yay/Invocation.php'; - -/** - * Listens for Invocations and returns a suitable value. - * @author Chris Corbyn - * @package Yay - */ -interface Yay_InvocationHandler -{ - - /** - * Handle the given $invocation and return a value for it. - * @param Yay_Invocation $invocation - * @return mixed - */ - public function &handleInvocation(Yay_Invocation $invocation); - -} \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/InvocationProxy.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/InvocationProxy.php deleted file mode 100644 index e8d0aa9..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/InvocationProxy.php +++ /dev/null @@ -1,90 +0,0 @@ -. - - */ - -//require 'Yay/ExpectationProvider.php'; -//require 'Yay/InvocationRecorder.php'; -//require 'Yay/MockObject.php'; -//require 'Yay/SimpleInvocation.php'; - -/** - * Proxies Invocations on a Mock object to the recorder. - * @author Chris Corbyn - * @package Yay - */ -class Yay_InvocationProxy implements Yay_ExpectationProvider -{ - - /** - * The InvocationRecorder which is using this InvocationProxy. - * @var Yay_InvocationRecorder - * @access private - */ - private $_recorder; - - /** - * The Mock object where Invocations are recorded from. - * @var Yay_MockObject - * @access private - */ - private $_mock; - - /** - * Create a new InvocationProxy for $recorder and $mock. - * @param Yay_InvocationRecorder $recorder - * @param Yay_MockObject $mock - */ - public function __construct(Yay_InvocationRecorder $recorder, Yay_MockObject $mock) - { - $this->_recorder = $recorder; - $this->_mock = $mock; - } - - /** - * Direct all invocations to the recorder. - * @param string $method - * @param array $args - * @return Yay_InvocationRecorder - */ - public function __call($method, $args) - { - if (is_callable(array($this->_mock, $method))) - { - $invocation = new Yay_SimpleInvocation($this->_mock, $method, $args); - $this->_recorder->recordInvocation($invocation); - return $this->_recorder; - } - elseif (is_callable(array($this->_recorder, $method))) - { - return call_user_func_array(array($this->_recorder, $method), $args); - } - else - { - throw new BadMethodCallException('Mock method ' . $method . ' does not exist'); - } - } - - /** - * Returns the Expectation list. - * @return array of Yay_Expectation - */ - public function getExpectations() - { - return $this->__call(__FUNCTION__, array()); - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/InvocationRecorder.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/InvocationRecorder.php deleted file mode 100644 index f3abed3..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/InvocationRecorder.php +++ /dev/null @@ -1,36 +0,0 @@ -. - - */ - -//require 'Yay/Invocation.php'; -//require 'Yay/ExpectationProvider.php'; - -/** - * Listens for Invocations and provides expectations based on them. - * @author Chris Corbyn - * @package Yay - */ -interface Yay_InvocationRecorder extends Yay_ExpectationProvider -{ - - /** - * Record the given $invocation. - * @param Yay_Invocation $invocation - */ - public function recordInvocation(Yay_Invocation $invocation); - -} \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matcher.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matcher.php deleted file mode 100644 index 5dc3e74..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matcher.php +++ /dev/null @@ -1,48 +0,0 @@ -. - - */ - -/** - * The Matcher interface for comparing arguments. - * @author Chris Corbyn - * @package Yay - */ -interface Yay_Matcher -{ - - /** - * Compare the $argument with whatever is expected to match it. - * @param mixed $argument - * @return boolean - */ - public function matches(&$argument); - - /** - * Returns true if the argument doesn't need to be present. - * @return boolean - */ - public function isOptional(); - - /** - * Writes the match description as a string following $format. - * $format is a sprintf() string with %s, $s as $matcherName, $value respectively. - * @param string $format - * @return string - */ - public function describeMatch($format); - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/AnyMatcher.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/AnyMatcher.php deleted file mode 100644 index 8592ba3..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/AnyMatcher.php +++ /dev/null @@ -1,85 +0,0 @@ -. - - */ - -//require 'Yay/Matcher.php'; - -/** - * Allows anything to match. - * @author Chris Corbyn - * @package Yay - */ -class Yay_Matchers_AnyMatcher implements Yay_Matcher -{ - - /** - * A type to compare with. - * @var string - * @access private - */ - private $_type; - - /** - * The desired result. - * @var boolean - * @access private - */ - private $_result; - - /** - * Create a new AnyMatcher, optionally constrained only to objects of $type. - * @param string $type, optional - * @param boolean $result - */ - public function __construct($type = null, $result = true) - { - $this->_type = $type; - $this->_result = $result; - } - - /** - * Always returns true where no type is given, and where the type matches otherwise. - * @param mixed $value - * @return boolean - */ - public function matches(&$value) - { - $return = (is_null($this->_type) || ($value instanceof $this->_type)); - return (($this->_result && $return) || (!$this->_result && !$return)); - } - - /** - * Returns true if the argument doesn't need to be present. - * @return boolean - */ - public function isOptional() - { - return false; - } - - /** - * Writes the match description as a string following $format. - * $format is a sprintf() string with %s, $s as $matcherName, $value respectively. - * @param string $format - * @return string - */ - public function describeMatch($format) - { - return 'ANYTHING'; - } - -} \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/BoundsMatcher.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/BoundsMatcher.php deleted file mode 100644 index 57aef64..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/BoundsMatcher.php +++ /dev/null @@ -1,94 +0,0 @@ -. - - */ - -//require 'Yay/Matcher.php'; - -/** - * Compares values to test if they are within given boundaries. - * @author Chris Corbyn - * @package Yay - */ -class Yay_Matchers_BoundsMatcher implements Yay_Matcher -{ - - /** - * The upper bound. - * @var mixed - * @access private - */ - private $_upper; - - /** - * The lower bound. - * @var mixed - * @access private - */ - private $_lower; - - /** - * The desired result. - * @var boolean - * @access private - */ - private $_result; - - /** - * Create a new BoundsMatcher between $lower and $upper. - * @param mixed $lower - * @param mixed $upper - * @param boolean $result which is wanted - */ - public function __construct($lower, $upper, $result = true) - { - $this->_upper = $upper; - $this->_lower = $lower; - $this->_result = $result; - } - - /** - * Compare $value with the boundaries and return true if it is within them. - * @param mixed $value - * @return boolean - */ - public function matches(&$value) - { - $return = ($value <= $this->_upper && $value >= $this->_lower); - return (($this->_result && $return) || (!$this->_result && !$return)); - } - - /** - * Returns true if the argument doesn't need to be present. - * @return boolean - */ - public function isOptional() - { - return false; - } - - /** - * Writes the match description as a string following $format. - * $format is a sprintf() string with %s, $s as $matcherName, $value respectively. - * @param string $format - * @return string - */ - public function describeMatch($format) - { - return sprintf($format, 'between', $this->_min . ' and ' . $this->_max); - } - -} \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/EqualMatcher.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/EqualMatcher.php deleted file mode 100644 index 1d4f25d..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/EqualMatcher.php +++ /dev/null @@ -1,50 +0,0 @@ -. - - */ - -//require 'Yay/Matchers/IdenticalMatcher.php'; - -/** - * Compares values for equality. - * @author Chris Corbyn - * @package Yay - */ -class Yay_Matchers_EqualMatcher extends Yay_Matchers_IdenticalMatcher -{ - - /** - * Create a new EqualMatcher expecting $expected. - * @param mixed $expected - * @param boolean $result to be expected - */ - public function __construct($expected, $result = true) - { - parent::__construct($expected, $result); - } - - /** - * Compare $value with the expected value and return true if it is equal. - * @param mixed $value - * @return boolean - */ - public function matches(&$value) - { - $return = (($this->_expected == $value) && ($value == $this->_expected)); - return (($this->_result && $return) || (!$this->_result && !$return)); - } - -} \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/IdenticalMatcher.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/IdenticalMatcher.php deleted file mode 100644 index c227b67..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/IdenticalMatcher.php +++ /dev/null @@ -1,116 +0,0 @@ -. - - */ - -//require 'Yay/Matcher.php'; - -/** - * Compares values for value and type. - * @author Chris Corbyn - * @package Yay - */ -class Yay_Matchers_IdenticalMatcher implements Yay_Matcher -{ - - /** - * The expected value. - * @var mixed - * @access protected - */ - protected $_expected; - - /** - * The expected return value. - * @var boolean - * @access protected - */ - protected $_result; - - /** - * Create a new IdenticalMatcher expecting $expected. - * @param mixed $expected - * @param boolean $result to be expected - */ - public function __construct($expected, $result = true) - { - $this->_expected = $expected; - $this->_result = $result; - } - - /** - * Compare $value with the expected value and return true if it matches in - * type and in value. - * @param mixed $value - * @return boolean - */ - public function matches(&$value) - { - $return = (($this->_expected === $value) && ($value === $this->_expected)); - return (($this->_result && $return) || (!$this->_result && !$return)); - } - - /** - * Returns true if the argument doesn't need to be present. - * @return boolean - */ - public function isOptional() - { - return false; - } - - /** - * Writes the match description as a string following $format. - * $format is a sprintf() string with %s, $s as $matcherName, $value respectively. - * @param string $format - * @return string - */ - public function describeMatch($format) - { - $description = ''; - $value = $this->_expected; - if (is_int($value)) - { - $description = sprintf($format, 'int', $value); - } - elseif (is_float($value)) - { - $description = sprintf($format, 'float', preg_replace('/^(.{8}).+/', '$1..', $value)); - } - elseif (is_numeric($value)) - { - $description = sprintf($format, 'number', preg_replace('/^(.{8}).+/', '$1..', $value)); - } - elseif (is_string($value)) - { - $description = sprintf($format, 'string', preg_replace('/^(.{8}).+/', '$1..', $value)); - } - elseif (is_object($value)) - { - $description = sprintf($format, 'object', get_class($value)); - } - elseif (is_array($value)) - { - $description = sprintf($format, 'array', count($value) . ' items'); - } - else - { - $description = sprintf($format, gettype($value), preg_replace('/^(.{8}).+/', '$1..', (string) $value)); - } - return $description; - } - -} \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/OptionalMatcher.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/OptionalMatcher.php deleted file mode 100644 index a348d57..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/OptionalMatcher.php +++ /dev/null @@ -1,103 +0,0 @@ -. - - */ - -//require 'Yay/Matcher.php'; -//require 'Yay/Matchers/IdenticalMatcher.php'; - -/** - * Wraps Matchers and makes them Optional. - * @author Chris Corbyn - * @package Yay - */ -class Yay_Matchers_OptionalMatcher implements Yay_Matcher -{ - - /** - * A matcher to delegate to. - * @var Yay_Matcher - * @access private - */ - private $_matcher; - - /** - * Create a new OptionalMatcher, optionally wrapping $value. - * @param mixed $value, optional - */ - public function __construct($value = null) - { - if (isset($value)) - { - if ($value instanceof Yay_Matcher) - { - $this->_matcher = $value; - } - else - { - $this->_matcher = new Yay_Matchers_IdenticalMatcher($value); - } - } - } - - /** - * Returns true if no matcher set, otherwise it delegates to the given Matcher. - * @param mixed $value - * @return boolean - */ - public function matches(&$value) - { - if (isset($this->_matcher)) - { - $matches = $this->_matcher->matches($value); - } - else - { - $matches = true; - } - return $matches; - } - - /** - * Returns true if the argument doesn't need to be present. - * @return boolean - */ - public function isOptional() - { - return true; - } - - /** - * Writes the match description as a string following $format. - * $format is a sprintf() string with %s, $s as $matcherName, $value respectively. - * @param string $format - * @return string - */ - public function describeMatch($format) - { - $name = 'optional'; - if (isset($this->_matcher)) - { - $value = $this->_matcher->describeMatch($format); - } - else - { - $value = '*'; - } - return sprintf($format, $name, $value); - } - -} \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/PatternMatcher.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/PatternMatcher.php deleted file mode 100644 index 4f4043f..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/PatternMatcher.php +++ /dev/null @@ -1,88 +0,0 @@ -. - - */ - -//require 'Yay/Matcher.php'; - -/** - * Compares values against a PCRE pattern. - * @author Chris Corbyn - * @package Yay - */ -class Yay_Matchers_PatternMatcher implements Yay_Matcher -{ - - /** - * The expected pattern. - * @var string - * @access private - */ - private $_pattern; - - /** - * The desired return value. - * @var boolean - * @access private - */ - private $_result; - - /** - * Create a new PatternMatcher expecting $pattern. - * @param string $pattern - * @param boolean $result to be expected - */ - public function __construct($pattern, $result = true) - { - $this->_pattern = $pattern; - $this->_result = $result; - } - - /** - * Compare $value with the expected pattern and return true if it matches. - * @param string $value - * @return boolean - */ - public function matches(&$value) - { - $return = ( - (is_string($value) || is_numeric($value)) - && preg_match($this->_pattern, $value) - ); - return (($this->_result && $return) || (!$this->_result && !$return)); - } - - /** - * Returns true if the argument doesn't need to be present. - * @return boolean - */ - public function isOptional() - { - return false; - } - - /** - * Writes the match description as a string following $format. - * $format is a sprintf() string with %s, $s as $matcherName, $value respectively. - * @param string $format - * @return string - */ - public function describeMatch($format) - { - return sprintf($format, 'pattern', $this->_pattern); - } - -} \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/ReferenceMatcher.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/ReferenceMatcher.php deleted file mode 100644 index cae6a08..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Matchers/ReferenceMatcher.php +++ /dev/null @@ -1,104 +0,0 @@ -. - - */ - -//require 'Yay/Matcher.php'; - -/** - * Compares values to see if they reference one another. - * @author Chris Corbyn - * @package Yay - */ -class Yay_Matchers_ReferenceMatcher implements Yay_Matcher -{ - - /** - * The expected reference. - * @var mixed - * @access private - */ - private $_ref; - - /** - * The desired return value. - * @var boolean - * @access private - */ - private $_result; - - /** - * Create a new IdenticalMatcher expecting $expected. - * @param mixed $expected - * @param boolean $result to be expected - */ - public function __construct(&$ref, $result = true) - { - $this->_ref =& $ref; - $this->_result = $result; - } - - /** - * Compare $ref with the expected reference and return true if it is the same reference. - * @param mixed $ref - * @return boolean - */ - public function matches(&$ref) - { - if (is_object($ref)) - { - $isRef = ($this->_ref === $ref); - } - else - { - if ($this->_ref === $ref) - { - $copy = $ref; - $randomString = uniqid('yay'); - $ref = $randomString; - $isRef = ($this->_ref === $ref); - $ref = $copy; - } - else - { - $isRef = false; - } - } - - return (($this->_result && $isRef) || (!$this->_result && !$isRef)); - } - - /** - * Returns true if the argument doesn't need to be present. - * @return boolean - */ - public function isOptional() - { - return false; - } - - /** - * Writes the match description as a string following $format. - * $format is a sprintf() string with %s, $s as $matcherName, $value respectively. - * @param string $format - * @return string - */ - public function describeMatch($format) - { - return '[reference]'; - } - -} \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/MockGenerator.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/MockGenerator.php deleted file mode 100644 index b3a9c78..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/MockGenerator.php +++ /dev/null @@ -1,323 +0,0 @@ -. - - */ - -/** - * Generates the code for a Mock object. - * This lives as a singleton for a few reasons. - * @author Chris Corbyn - * @package Yay - */ -class Yay_MockGenerator -{ - - /** The name of the Mock object interface */ - const MOCK_INTERFACE = 'Yay_MockObject'; - - /** Prefixed to types to create a Mock name */ - const MOCK_PREFIX = 'Yay_MockObjects_'; - - /** Singleton instance */ - private static $_instance = null; - - /** - * The path a template which draws a Mock. - * @var string - * @access private - */ - private $_template; - - /** - * A map of mocked type hints to their concrete class names. - * @var array - * @access private - */ - private $_mocked = array(); - - /** - * Constructor cannot be used. - */ - private function __construct() - { - } - - /** - * Get a singleton instance of this MockGenerator. - * @return Yay_MockGenerator - */ - public static function getInstance() - { - if (is_null(self::$_instance)) - { - self::$_instance = new self(); - } - return self::$_instance; - } - - /** - * Set the path to a template which can draw a mock class. - * @param string $path - */ - public function setMockTemplate($path) - { - $this->_template = $path; - } - - /** - * Produce class code for a MockObject of $typeHint and return its concrete name. - * @param string $typeHint - * @return string - */ - public function generateMock($typeHint) - { - if (!$className = $this->_getConcreteMockName($typeHint)) - { - $className = $this->_materializeMockCode($typeHint); - } - return $className; - } - - /** - * Use a fixed naming scheme to make a mock class name from $typeHint. - * @param string $typeHint - * @return string - */ - public function applyNamingScheme($typeHint) - { - return self::MOCK_PREFIX . $typeHint; - } - - /** - * Remove any adjustments that were made to an original type hint. - * @param string $typeHint - * @return string - */ - public function reverseNamingScheme($typeHint) - { - $len = strlen(self::MOCK_PREFIX); - if (substr($typeHint, 0, $len) == self::MOCK_PREFIX) - { - $typeHint = substr($typeHint, $len); - } - return $typeHint; - } - - // -- Private methods - - /** - * Try to lookup a mocked concrete class name for $typeHint. - * @param string $typeHint - * @return string - * @access private - */ - private function _getConcreteMockName($typeHint) - { - if (array_key_exists($typeHint, $this->_mocked)) - { - return $this->_mocked[$typeHint]; - } - } - - /** - * Produce the mock object code and return its name. - * @param string $typeHint - * @return string - * @access private - */ - private function _materializeMockCode($typeHint) - { - $reflector = new ReflectionClass($typeHint); - $mockData = array( - 'className' => $this->applyNamingScheme($typeHint), - 'extends' => $this->_getSuperclass($reflector), - 'interfaces' => $this->_getInterfaces($reflector), - 'methods' => $this->_getMethods($reflector) - ); - - extract($mockData); - $code = include($this->_template); - eval($code); - - $this->_mocked[$typeHint] = $mockData['className']; - return $mockData['className']; - } - - /** - * Get all known interfaces for $reflector. - * @param ReflectionClass $reflector - * @return array - * @access private - */ - private function _getInterfaces(ReflectionClass $reflector) - { - $interfaces = array(); - if ($reflector->isInterface()) - { - if ($reflector->getName() != self::MOCK_INTERFACE) - { - $interfaces[] = $reflector->getName(); - } - } - else - { - foreach ($reflector->getInterfaces() as $interfaceReflector) - { - if ($interfaceReflector->getName() != self::MOCK_INTERFACE) - { - $interfaces[] = $interfaceReflector->getName(); - } - } - } - return $interfaces; - } - - /** - * Get the superclass this mock object needs to extend. - * @param ReflectionClass $reflector - * @return string - * @access private - */ - private function _getSuperclass(ReflectionClass $reflector) - { - if ($this->_canExtend($reflector)) - { - $superclass = $reflector->getName(); - } - else - { - $superclass = ''; - } - return $superclass; - } - - /** - * Get all methods from $reflector. - * @param ReflectionClass $reflector - * @return array - * @access private - */ - private function _getMethods(ReflectionClass $reflector) - { - $methods = array(); - foreach ($reflector->getMethods() as $reflectionMethod) - { - if ($reflectionMethod->isConstructor() - || $reflectionMethod->getName() == '__clone') - { - continue; - } - if ($reflectionMethod->isPublic() || $reflectionMethod->isProtected()) - { - $methods[] = array( - 'name' => $reflectionMethod->getName(), - 'access' => $reflectionMethod->isPublic() ? 'public' : 'protected', - 'modifiers' => $reflectionMethod->isStatic() ? 'static' : '', - 'returnReference' => $reflectionMethod->returnsReference(), - 'parameters' => $this->_getParameters($reflectionMethod) - ); - } - } - return $methods; - } - - /** - * Get all parameters for $method. - * @param ReflectionMethod $method - * @return array - * @access private - */ - private function _getParameters(ReflectionMethod $method) - { - $parameters = array(); - foreach ($method->getParameters() as $reflectionParameter) - { - $hint = ''; - if ($reflectionParameter->isArray()) - { - $hint = 'array'; - } - elseif ($c = $reflectionParameter->getClass()) - { - $hint = $c->getName(); - } - $parameters[] = array( - 'hint' => $hint, - 'byReference' => $reflectionParameter->isPassedByReference(), - 'optional' => $reflectionParameter->isOptional() - ); - } - return $parameters; - } - - /** - * Determine if the reflector for the given class is safe to extend. - * @param ReflectionClass $reflector - * @return boolean - * @access private - */ - private function _canExtend(ReflectionClass $reflector) - { - $canExtend = true; - $warning = false; - if ($reflector->isInterface()) - { - $canExtend = false; - } - else - { - if ($constructor = $reflector->getConstructor()) - { - if ($constructor->isPrivate() || $constructor->isFinal()) - { - $canExtend = false; - $warning = 'has a private or final constructor'; - } - } - elseif ($reflector->isFinal()) - { - $canExtend = false; - $warning = 'is declared final'; - } - else - { - foreach ($reflector->getMethods() as $method) - { - if (($method->isPublic() || $method->isProtected()) && $method->isFinal()) - { - $canExtend = false; - $warning = 'contains final methods'; - } - } - } - } - if ($warning) - { - trigger_error( - sprintf('The type [%s] to be mocked %s.' . - ' Mocking classes which cannot be fully overridden results' . - ' in a loss of class type. It is safe to supress this warning if you' . - ' are aware of the conflict.', - $reflector->getName(), - $warning - ), - E_USER_WARNING - ); - } - return $canExtend; - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/MockObject.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/MockObject.php deleted file mode 100644 index 3c65de0..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/MockObject.php +++ /dev/null @@ -1,25 +0,0 @@ -. - - */ - -/** - * A tag placed on any MockObjects generated in the context of YayMock. - * @author Chris Corbyn - * @package Yay - */ -interface Yay_MockObject { -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Mockery.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Mockery.php deleted file mode 100644 index 38d2410..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Mockery.php +++ /dev/null @@ -1,183 +0,0 @@ -. - - */ - -//require 'Yay/MockGenerator.php'; -//require 'Yay/SimpleInvocation.php'; -//require 'Yay/SimpleDescription.php'; -//require 'Yay/InvocationHandler.php'; -//require 'Yay/MockObject.php'; -//require 'Yay/ExpectationProvider.php'; -//require 'Yay/NotSatisfiedException.php'; -//require 'Yay/StateMachine.php'; -//require 'Yay/SimpleSequence.php'; - -/** - * The main Yay context. - * Handles the generation of MockObjects and the Invocation of methods. - * @author Chris Corbyn - * @package Yay - */ -class Yay_Mockery implements Yay_InvocationHandler -{ - - /** - * The Expectation stack which is being checked. - * @var array - * @access private - */ - private $_expectations = array(); - - /** - * Invocations which are not expected by any Expectations get caught here. - * @var array - * @access private - */ - private $_unexpectedInvocations = array(); - - /** - * A mock class generator. - * @var Yay_MockGenerator - * @access private - */ - private $_generator; - - /** - * Create a new Mockery. - */ - public function __construct() - { - $this->_generator = Yay_MockGenerator::getInstance(); - } - - /** - * Create a MockObject matching $typeHint. - * If the $typeHint is an interface the Mock will implement the interface - * and maintain the method signatures from that interface. - * If the $typeHint is a class name the Mock will extend the class overriding - * all public methods (HOWEVER, if the class contains final methods it is not - * possible to override all methods and hence, the mock will have no specific - * type. - * @param string $typeHint - * @return Yay_MockObject - */ - public function mock($typeHint) - { - $className = $this->_generator->generateMock($typeHint); - $reflector = new ReflectionClass($className); - return $reflector->newInstance($this); - } - - /** - * Specify an Expectation (or Expectations) to check. - * @param Yay_ExpectationProvider $provider - */ - public function checking(Yay_ExpectationProvider $provider) - { - foreach ($provider->getExpectations() as $expectation) - { - $this->_expectations[] = $expectation; - } - } - - /** - * Get a state machine named $name. - * @param string $name - * @return Yay_States - */ - public function states($name) - { - return new Yay_StateMachine($name); - } - - /** - * Create a new Sequence named $name. - * @param string $name - * @return Yay_Sequence - */ - public function sequence($name) - { - return new Yay_SimpleSequence($name); - } - - /** - * Used by YayMock internally (ignore this method!). - */ - public function &handleInvocation(Yay_Invocation $invocation) - { - $ret = null; - $expected = false; - foreach ($this->_expectations as $expectation) - { - if ($expectation->isExpected($invocation)) - { - $expected = true; - if ($action = $expectation->getAction($invocation)) - { - $ret =& $action->invoke($invocation); - } - break; - } - } - if (!$expected) - { - $this->_unexpectedInvocations[] = $invocation; - } - return $ret; - } - - /** - * Assert that all Expectations are satisfied. - * Throws an Exception of type Yay_NotSatisfiedException if any Expecations - * are not satisfied. - * @throws Yay_NotSatisfiedException - */ - public function assertIsSatisfied() - { - $description = new Yay_SimpleDescription(); - $satisfied = true; - foreach ($this->_unexpectedInvocations as $invocation) - { - $description->appendText('Unexpected invocation'); - $invocation->describeTo($description); - $description->appendText(PHP_EOL); - $satisfied = false; - } - if (!$satisfied) - { - $description->appendText(PHP_EOL); - } - foreach ($this->_expectations as $expectation) - { - if (!$expectation->isSatisfied()) - { - $description->appendText('* '); - $satisfied = false; - } - $expectation->describeTo($description); - $description->appendText(PHP_EOL); - } - if (!$satisfied) - { - throw new Yay_NotSatisfiedException( - 'Not all expectations were satisfied or a method was invoked unexpectedly.' . - PHP_EOL . PHP_EOL . $description->toString() . PHP_EOL - ); - } - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/NotSatisfiedException.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/NotSatisfiedException.php deleted file mode 100644 index 8a76daa..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/NotSatisfiedException.php +++ /dev/null @@ -1,36 +0,0 @@ -. - - */ - -/** - * The Exception thrown by Context::assertIsSatisfied() if assertion fails. - * @author Chris Corbyn - * @package Yay - */ -class Yay_NotSatisfiedException extends Exception -{ - - /** - * Create a new NotSatisfiedException with $message. - * @param string $message - */ - public function __construct($message) - { - parent::__construct($message); - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SelfDescribing.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SelfDescribing.php deleted file mode 100644 index 186249a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SelfDescribing.php +++ /dev/null @@ -1,35 +0,0 @@ -. - - */ - -//require 'Yay/Description.php'; - -/** - * Components implementing this can describe what they do to a Description instance. - * @author Chris Corbyn - * @package Yay - */ -interface Yay_SelfDescribing -{ - - /** - * Write a description of this self describing object to Description. - * @param Yay_Description $description - */ - public function describeTo(Yay_Description $description); - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Sequence.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Sequence.php deleted file mode 100644 index 225b2a5..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/Sequence.php +++ /dev/null @@ -1,43 +0,0 @@ -. - - */ - -//require 'Yay/SelfDescribing.php'; - -/** - * Provides a means for Expectations to verify they are called in the correct order. - * This allows Invocations to be forced in a particular order. - * @author Chris Corbyn - * @package Yay - */ -interface Yay_Sequence extends Yay_SelfDescribing -{ - - /** - * Ask for a new Sequence Id and register the new sequence. - * @return int $id - */ - public function requestSequenceId(); - - /** - * Check if the sequence has progressed far enough for this sequence ID to be used. - * @param int $id - * @return boolean - */ - public function isInSequence($sequenceId); - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SimpleDescription.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SimpleDescription.php deleted file mode 100644 index f86b4b7..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SimpleDescription.php +++ /dev/null @@ -1,63 +0,0 @@ -. - - */ - -//require 'Yay/Description.php'; - -/** - * A basic Description container for error messages. - * @author Chris Corbyn - * @package Yay - */ -class Yay_SimpleDescription implements Yay_Description -{ - - /** - * An internal text buffer. - * @var string - * @access private - */ - private $_text = ''; - - /** - * Append an existing Description to this Description. - * @param Yay_Description - */ - public function appendDescription(Yay_Description $description) - { - $this->_text .= $description->toString(); - } - - /** - * Append text content to this Description. - * @param string $text - */ - public function appendText($text) - { - $this->_text .= $text; - } - - /** - * Get this description back as a formatted string. - * @return string - */ - public function toString() - { - return $this->_text; - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SimpleInvocation.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SimpleInvocation.php deleted file mode 100644 index 012b568..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SimpleInvocation.php +++ /dev/null @@ -1,163 +0,0 @@ -. - - */ - -//require 'Yay/Invocation.php'; -//require 'Yay/MockGenerator.php'; - -/** - * The standard implementation of the Invocation interface. - * @author Chris Corbyn - * @package Yay - */ -class Yay_SimpleInvocation implements Yay_Invocation -{ - - /** - * The Object on which the Inovation occurred. - * @var object - * @access private - */ - private $_object; - - /** - * The method name invoked. - * @var string - * @access private - */ - private $_method; - - /** - * The arguments in the Invocation. - * @var array - * @access private - */ - private $_arguments; - - /** - * Create a new SimpleInvocation with the given details. - * @param object $object - * @param string $method - * @param array &$arguments - */ - public function __construct($object, $method, array &$arguments) - { - $this->_object = $object; - //Massage __call() overloading so the interface is tested correctly - if ($method == '__call') - { - $method = array_shift($arguments); - $args =& array_shift($arguments); - $arguments =& $args; - } - $this->_method = $method; - $this->_arguments =& $arguments; - } - - /** - * Get the object which this Invocation occured on. - * @return object - */ - public function getObject() - { - return $this->_object; - } - - /** - * Get the method name of the invoked method. - * @return string - */ - public function getMethod() - { - return $this->_method; - } - - /** - * Get the argument list in the Invocation. - * @return array - */ - public function &getArguments() - { - return $this->_arguments; - } - - /** - * Describe this Invocation to $description. - * @param Yay_Description $description - */ - public function describeTo(Yay_Description $description) - { - $description->appendText(sprintf(' of %s;', $this->_getInvocationSignature())); - } - - // -- Private methods - - private function _getInvocationSignature() - { - $class = Yay_MockGenerator::getInstance() - ->reverseNamingScheme(get_class($this->_object)); - if (!empty($this->_arguments)) - { - $args = array(); - foreach ($this->_arguments as $arg) - { - $args[] = $this->_describeArgument($arg, '%s [%s]'); - } - $params = implode(', ', $args); - } - else - { - $params = ''; - } - return sprintf('%s::%s(%s)', $class, $this->_method, $params); - } - - private function _describeArgument($arg, $format) - { - $description = ''; - if (is_int($arg)) - { - $description = sprintf($format, 'int', $arg); - } - elseif (is_float($arg)) - { - $description = sprintf($format, 'float', preg_replace('/^(.{8}).+/', '$1..', $arg)); - } - elseif (is_numeric($arg)) - { - $description = sprintf($format, 'number', preg_replace('/^(.{8}).+/', '$1..', $arg)); - } - elseif (is_string($arg)) - { - $description = sprintf($format, 'string', preg_replace('/^(.{8}).+/', '$1..', $arg)); - } - elseif (is_object($arg)) - { - $description = sprintf($format, 'object', get_class($arg)); - } - elseif (is_array($arg)) - { - $description = sprintf($format, 'array', count($arg) . ' items'); - } - else - { - $description = sprintf($format, gettype($arg), preg_replace('/^(.{8}).+/', '$1..', (string) $arg)); - } - return $description; - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SimpleSequence.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SimpleSequence.php deleted file mode 100644 index 016c30a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SimpleSequence.php +++ /dev/null @@ -1,108 +0,0 @@ -. - - */ - -/** - * Provides a means for Expectations to verify they are called in the correct order. - * This allows Invocations to be forced in a particular order. - * @author Chris Corbyn - * @package Yay - */ -class Yay_SimpleSequence implements Yay_Sequence -{ - - /** - * The name of this sequence. - * @var string - * @access private - */ - private $_name; - - /** - * The list of sequence IDs expected. - * @var array - * @access private - */ - private $_sequenceIds = array(); - - /** - * An internal sequence counter. - * @var int - * @access private - */ - private $_counter = 0; - - /** - * The current position in the sequence. - * @var int - * @access private - */ - private $_currentId = null; - - /** - * Create a new Sequence with $name. - * @param string $name - */ - public function __construct($name) - { - $this->_name = $name; - } - - /** - * Ask for a new Sequence Id and register the new sequence. - * @return int $id - */ - public function requestSequenceId() - { - $id = $this->_counter++; - $this->_sequenceIds[] = $id; - return $id; - } - - /** - * Check if the sequence has progressed far enough for this sequence ID to be used. - * @param int $id - * @return boolean - */ - public function isInSequence($sequenceId) - { - if ($this->_currentId === $sequenceId) - { - $inSequence = true; - } - elseif (current($this->_sequenceIds) === $sequenceId) - { - $this->_currentId = array_shift($this->_sequenceIds); - $inSequence = true; - } - else - { - $inSequence = false; - } - return $inSequence; - } - - /** - * Write a description of this self describing object to Description. - * @param Yay_Description $description - */ - public function describeTo(Yay_Description $description) - { - $description->appendText(sprintf(' sequence %s;', $this->_name)); - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SimpleState.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SimpleState.php deleted file mode 100644 index 18c7621..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SimpleState.php +++ /dev/null @@ -1,49 +0,0 @@ -. - - */ - -//require 'Yay/State.php'; -//require 'Yay/States.php'; -//require 'Yay/SimpleStatePredicate.php'; - -/** - * A State from a State machine. - * @author Chris Corbyn - * @package Yay - */ -class Yay_SimpleState extends Yay_SimpleStatePredicate implements Yay_State -{ - - /** - * Create a new State for $stateMachine to be $stateName. - * @param Yay_States $stateMachine - * @param string $stateName - */ - public function __construct(Yay_States $stateMachine, $stateName) - { - parent::__construct($stateMachine, $stateName, true); - } - - /** - * Make this State active. - */ - public function activate() - { - $this->_stateMachine->become($this->_stateName); - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SimpleStatePredicate.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SimpleStatePredicate.php deleted file mode 100644 index 6c9458c..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/SimpleStatePredicate.php +++ /dev/null @@ -1,88 +0,0 @@ -. - - */ - -//require 'Yay/StatePredicate.php'; -//require 'Yay/States.php'; - -/** - * An expectation about what State a state machine is in. - * @author Chris Corbyn - * @package Yay - */ -class Yay_SimpleStatePredicate implements Yay_StatePredicate -{ - - /** - * The state machine which this predicate checks. - * @var Yay_States - * @access private - */ - protected $_stateMachine; - - /** - * The state name to check for in the state machine. - * @var string - * @access private - */ - protected $_stateName; - - /** - * True if the state is wanted, false otherwise. - * @var boolean - * @access private - */ - private $_is = true; - - /** - * Create a new StatePredicate. - * @param Yay_States $stateMachine - * @param string $stateName to expect - * @param boolean $is (negation point) - */ - public function __construct(Yay_States $stateMachine, $stateName, $is = true) - { - $this->_stateMachine = $stateMachine; - $this->_stateName = $stateName; - $this->_is = $is; - } - - /** - * Return true if the state machine is in this state. - * @return boolean - */ - public function isActive() - { - return (($this->_is && $this->_stateMachine->getCurrentState() == $this->_stateName) - || (!$this->_is && $this->_stateMachine->getCurrentState() != $this->_stateName)); - } - - /** - * Write a description of this self describing object to Description. - * @param Yay_Description $description - */ - public function describeTo(Yay_Description $description) - { - $this->_stateMachine->describeTo($description); - $description->appendText(sprintf( - ' %s %s;', - ($this->_is ? 'is' : 'is not'), - $this->_stateName - )); - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/State.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/State.php deleted file mode 100644 index 045e8bb..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/State.php +++ /dev/null @@ -1,34 +0,0 @@ -. - - */ - -//require 'Yay/StatePredicate.php'; - -/** - * A State from a State machine. - * @author Chris Corbyn - * @package Yay - */ -interface Yay_State extends Yay_StatePredicate -{ - - /** - * Make this State active. - */ - public function activate(); - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/StateMachine.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/StateMachine.php deleted file mode 100644 index 2a9128a..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/StateMachine.php +++ /dev/null @@ -1,113 +0,0 @@ -. - - */ - -//require 'Yay/State.php'; -//require 'Yay/SimpleState.php'; -//require 'Yay/StatePredicate.php'; -//require 'Yay/SimpleStatePredicate.php'; - -/** - * A basic state machine. - * @author Chris Corbyn - * @package Yay - */ -class Yay_StateMachine implements Yay_States -{ - - /** - * The name of this state machine. - * @var string - * @access private - */ - private $_name; - - /** - * The current state. - * @var string - * @access private - */ - private $_state; - - /** - * Create a new State machine with $name. - * @param string $name - */ - public function __construct($name) - { - $this->_name = $name; - } - - /** - * Set the initial state of this state machine. - * @param string $stateName - * @return Yay_States - */ - public function startsAs($stateName) - { - $this->become($stateName); - return $this; - } - - /** - * Get the state which puts the state machine into the named state. - * @param string $stateName - * @return Yay_State - */ - public function is($stateName) - { - return new Yay_SimpleState($this, $stateName); - } - - /** - * Get the predicate which indicates the state machine is NOT in the named state. - * @param string $stateName - * @return Yay_StatePredicate - */ - public function isNot($stateName) - { - return new Yay_SimpleStatePredicate($this, $stateName, false); - } - - /** - * Become the named state. - * @param string $stateName - */ - public function become($stateName) - { - $this->_state = $stateName; - } - - /** - * Get the name of the current state. - * @return string - */ - public function getCurrentState() - { - return $this->_state; - } - - /** - * Write a description of this self describing object to Description. - * @param Yay_Description $description - */ - public function describeTo(Yay_Description $description) - { - $description->appendText(sprintf(' %s', $this->_name)); - } - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/StatePredicate.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/StatePredicate.php deleted file mode 100644 index 5941d76..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/StatePredicate.php +++ /dev/null @@ -1,35 +0,0 @@ -. - - */ - -//require 'Yay/SelfDescribing.php'; - -/** - * An expectation about what State a state machine is in. - * @author Chris Corbyn - * @package Yay - */ -interface Yay_StatePredicate extends Yay_SelfDescribing -{ - - /** - * Return true if the state machine is in this state. - * @return boolean - */ - public function isActive(); - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/States.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/States.php deleted file mode 100644 index c021c4f..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/classes/Yay/States.php +++ /dev/null @@ -1,62 +0,0 @@ -. - - */ - -//require 'Yay/SelfDescribing.php'; - -/** - * A basic state machine. - * @author Chris Corbyn - * @package Yay - */ -interface Yay_States extends Yay_SelfDescribing -{ - - /** - * Set the initial state of this state machine. - * @param string $stateName - * @return Yay_States - */ - public function startsAs($stateName); - - /** - * Get the state which puts the state machine into the named state. - * @param string $stateName - * @return Yay_State - */ - public function is($stateName); - - /** - * Get the predicate which indicates the state machine is NOT in the named state. - * @param string $stateName - * @return Yay_StatePredicate - */ - public function isNot($stateName); - - /** - * Become the named state. - * @param string $stateName - */ - public function become($stateName); - - /** - * Get the name of the current state. - * @return string - */ - public function getCurrentState(); - -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/mock.tpl.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/mock.tpl.php deleted file mode 100644 index 937699e..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/mock.tpl.php +++ /dev/null @@ -1,69 +0,0 @@ -. - - */ - -?> - -class - - implements - - Yay_MockObject -{ - - private $_yayInvocationHandler; - - public function __construct(Yay_InvocationHandler $invocationHandler) - { - $this->_yayInvocationHandler = $invocationHandler; - } - - - function ( $param): ?> - 0) echo ','; ?> - - $arg_ - - ) - { - $value = null; - if (isset($this->_yayInvocationHandler)) - { - $args = array(); - for ($i = 0; $i < func_num_args(); ++$i) - { - $argName = 'arg_' . $i; - $args[] =& ${$argName}; - } - $invocation = new Yay_SimpleInvocation($this, __FUNCTION__, $args); - $value =& $this->_yayInvocationHandler->handleInvocation($invocation); - } - return $value; - } - - - public function __clone() - { - $this->_yayInvocationHandler = null; - } - -} - - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/yay_convenience.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/yay_convenience.php deleted file mode 100644 index c145103..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/yay_convenience.php +++ /dev/null @@ -1,176 +0,0 @@ -. - - */ - -/** - * Provides non-namespaced classes and functions for brevity. - * Including this script is entirely optional. - * @author Chris Corbyn - * @package Yay - */ - -// Classes - -/** - * Allow occurences of Yay_Expectations::create() to be replaced with Expectations::create(). - */ -class Expectations extends Yay_Expectations { } - -/** - * Allows occurences of new Yay_Mockery() to be replaced with new Mockery(). - */ -class Mockery extends Yay_Mockery { } - -//Argument matchers - -/** - * Allows Yay::optional() to be called as optional(). - */ -function optional($value = null) -{ - return Yay::optional($value); -} - -/** - * Allows Yay::any() to be called as any(). - */ -function any($type = null) -{ - return Yay::any($type); -} - -/** - * Allows Yay::none() to be called as none(). - */ -function none($type = null) -{ - return Yay::none($type); -} - -/** - * Allows Yay::identical() to be called as identical(). - */ -function identical($value) -{ - return Yay::identical($value); -} - -/** - * Allows Yay::notIdentical() to be called as notIdentical(). - */ -function notIdentical($value) -{ - return Yay::notIdentical($value); -} - -/** - * Allows Yay::equal() to be called as equal(). - */ -function equal($value) -{ - return Yay::equal($value); -} - -/** - * Allows Yay::notEqual() to be called as notEqual(). - */ -function notEqual($value) -{ - return Yay::notEqual($value); -} - -/** - * Allows Yay::pattern() to be called as pattern(). - */ -function pattern($pattern) -{ - return Yay::pattern($pattern); -} - -/** - * Allows Yay::noPattern() to be called as noPattern(). - */ -function noPattern($pattern) -{ - return Yay::noPattern($pattern); -} - -/** - * Allows Yay::bounds() to be called as bounds(). - */ -function bounds($a, $b) -{ - return Yay::bounds($a, $b); -} - -/** - * Allows Yay::outside() to be called as outside(). - */ -function outside($a, $b) -{ - return Yay::outside($a, $b); -} - -/** - * Allows Yay::reference() to be called as reference(). - */ -function reference(&$ref) -{ - return Yay::reference($ref); -} - -/** - * Allows Yay::noReference() to be called as noReference(). - */ -function noReference(&$ref) -{ - return Yay::noReference($ref); -} - -//Actions - -/** - * Allows Yay::returnValue() to be called as returnValue(). - */ -function returnValue($value) -{ - return Yay::returnValue($value); -} - -/** - * Allows Yay::returnReference() to be called as returnReference(). - */ -function returnReference(&$ref) -{ - return Yay::returnReference($ref); -} - -/** - * Allows Yay::throwException() to be called as throwException(). - */ -function throwException(Exception $e) -{ - return Yay::throwException($e); -} - -/** - * Allows Yay::call() to be called as call(). - */ -function call($callback) -{ - return Yay::call($callback); -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/yay_mock.php b/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/yay_mock.php deleted file mode 100644 index 7c76922..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/lib/yaymock/yay_mock.php +++ /dev/null @@ -1,29 +0,0 @@ -. - - */ - -/** - * YayMock include and bootstrap file. - * @author Chris Corbyn - */ - -require_once dirname(__FILE__) . '/classes/Yay.php'; -Yay::setClassPath(dirname(__FILE__) . '/classes'); -spl_autoload_register(array('Yay', 'autoload')); -Yay_MockGenerator::getInstance()->setMockTemplate(dirname(__FILE__) . '/mock.tpl.php'); - -//EOF diff --git a/vendor/swiftmailer/swiftmailer/test-suite/run.php b/vendor/swiftmailer/swiftmailer/test-suite/run.php deleted file mode 100644 index fa67634..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/run.php +++ /dev/null @@ -1,56 +0,0 @@ -get('//./root/cimv2:Win32_Process.Handle="' . getmypid() . '"') - ->executablePath; - } -} - -$runner = new Sweety_Runner_CliRunner( - explode(PATH_SEPARATOR, SWEETY_TEST_PATH), - $exe . ' ' . $argv[0] - ); - -$name = !empty($argv[1]) ? $argv[1] : 'All Tests'; -$runner->setReporter(new Sweety_Reporter_CliReporter(sprintf('%s - %s', SWEETY_SUITE_NAME, $name))); - -$runner->setIgnoredClassRegex(SWEETY_IGNORED_CLASSES); - -$locators = preg_split('/\s*,\s*/', SWEETY_TEST_LOCATOR); -foreach ($locators as $locator) -{ - $runner->registerTestLocator(new $locator()); -} - -if (!empty($argv[1]) && !preg_match('~!?/.*?/~', $argv[1])) -{ - $testName = $argv[1]; - $format = !empty($argv[2]) ? $argv[2] : Sweety_Runner::REPORT_TEXT; - - $runner->runTestCase($testName, $format); -} -else -{ - $runner->runAllTests(); -} - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/sweety.js b/vendor/swiftmailer/swiftmailer/test-suite/sweety.js deleted file mode 100644 index 663ff94..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/sweety.js +++ /dev/null @@ -1,471 +0,0 @@ -/* - JavaScript wrapper around REST API in Sweety. - */ - -/** - * A convenience class for using XPath. - * @author Chris Corbyn - * @constructor - */ -function SweetyXpath() { - - /** - * Get the first node matching the given expression. - * @param {String} expr - * @param {Element} node - * @returns Element - */ - this.getFirstNode = function getFirstNode(expr, node) { - var firstNode = _getRootNode(node).evaluate( - expr, node, _getNsResolver(node), XPathResult.FIRST_ORDERED_NODE_TYPE, null); - return firstNode.singleNodeValue; - }, - - /** - * Get all nodes matching the given expression. - * The returned result is a Node Snapshot. - * @param {String} expr - * @param {Element} node - * @returns Element[] - */ - this.getNodes = function getNodes(expr, node) { - var nodes = _getRootNode(node).evaluate( - expr, node, _getNsResolver(node), XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); - - var nodeSet = new Array(); - for (var i = 0, len = nodes.snapshotLength; i < len; i++) { - nodeSet.push(nodes.snapshotItem(i)); - } - return nodeSet; - }, - - /** - * Get the string value of the node matching the given expression. - * @param {String} expr - * @param {Element} node - * @returns String - */ - this.getValue = function getValue(expr, node) { - return _getRootNode(node).evaluate( - expr, node, _getNsResolver(node), XPathResult.STRING_TYPE, null).stringValue; - } - - /** - * Get the root node from which run evaluate. - * @param {Element} node - * @returns Element - */ - var _getRootNode = function _getRootNode(node) { - if (node.ownerDocument && node.ownerDocument.evaluate) { - return node.ownerDocument; - } else { - if (node.evaluate) { - return node; - } else { - return document; - } - } - } - - /** - * Get the NS Resolver used when searching. - * @param {Element} node - * @returns Element - */ - var _getNsResolver = function _getNsResolver(node) { - if (!document.createNSResolver) { - return null; - } - - if (node.ownerDocument) { - return document.createNSResolver(node.ownerDocument.documentElement); - } else { - return document.createNSResolver(node.documentElement); - } - } - -} - -/** - * The reporter interface so Sweety can tell the UI what's happening. - * @author Chris Corbyn - * @constructor - */ -function SweetyReporter() { //Interface/Base Class - - var _this = this; - - /** - * Create a sub-reporter for an individual test case. - * @param {String} testCaseName - * @returns SweetyReporter - */ - this.getReporterFor = function getReporterFor(testCaseName) { - return _this; - } - - /** - * Start reporting. - */ - this.start = function start() { - } - - /** - * Handle a skipped test case. - * @param {String} message - * @param {String} path - */ - this.reportSkip = function reportSkip(message, path) { - } - - /** - * Handle a passing assertion. - * @param {String} message - * @param {String} path - */ - this.reportPass = function reportPass(message, path) { - } - - /** - * Handle a failing assertion. - * @param {String} message - * @param {String} path - */ - this.reportFail = function reportFail(message, path) { - } - - /** - * Handle an unexpected exception. - * @param {String} message - * @param {String} path - */ - this.reportException = function reportException(message, path) { - } - - /** - * Handle miscellaneous test output. - * @param {String} output - * @param {String} path - */ - this.reportOutput = function reportOutput(output, path) { - } - - /** - * Finish reporting. - */ - this.finish = function finish() { - } - -} - - -/** - * Represents a single test case being run. - * @author Chris Corbyn - * @constructor - */ -function SweetyTestCaseRun(testClass, reporter) { - - var _this = this; - - /** The XMLHttpRequest used in testing */ - var _req; - - /** XPath handler */ - var _xpath = new SweetyXpath(); - - /** Callback function for completion event */ - this.oncompletion = function oncompletion() { - } - - /** - * Run this test. - */ - this.run = function run() { - if (!reporter.isStarted()) { - reporter.start(); - } - _req = _createHttpRequest(); - - if (!_req) { - return; - } - - _req.open("GET", "?test=" + testClass + "&format=xml", true); - _req.onreadystatechange = _handleXml; - _req.send(null); - } - - /** - * Get an XmlHttpRequest instance, cross browser compatible. - * @return Object - */ - var _createHttpRequest = function _createHttpRequest() { - var req = false; - - if (window.XMLHttpRequest && !(window.ActiveXObject)) { - try { - req = new XMLHttpRequest(); - } catch(e) { - req = false; - } - } else if (window.ActiveXObject) { - try { - req = new ActiveXObject("Msxml2.XMLHTTP"); - } catch(e) { - try { - req = new ActiveXObject("Microsoft.XMLHTTP"); - } catch(e) { - req = false; - } - } - } - - return req; - } - - /** - * Handle the XML response from the test. - */ - var _handleXml = function _handleXml() { - if (_req.readyState == 4) { - try { - - var xml = _req.responseXML; - var txt = _req.responseText.replace(/[\r\n]+/g, ""). - replace(/^(.+)<\?xml.*$/, "$1"); - - //Test case was skipped - var skipElements = xml.getElementsByTagName('skip'); - if (!skipElements || 1 != skipElements.length) - { - var runElements = xml.getElementsByTagName('run'); - //Invalid document, an error probably occured - if (!runElements || 1 != runElements.length) { - reporter.reportException( - "Invalid XML response: " + - _stripTags(txt.replace(/^\s*<\?xml.+<\/(?:name|pass|fail|exception)>/g, "")), testClass); - } else { - var everything = runElements.item(0); - _parseResults(everything, testClass); - reporter.finish(); - } - } - else - { - reporter.reportSkip(_textValueOf(skipElements.item(0)), testClass); - reporter.finish(); - } - } catch (ex) { - //Invalid document or an error occurred. - reporter.reportException( - "Invalid XML response: " + - _stripTags(txt.replace(/^\s*<\?xml.+<\/(?:name|pass|fail|exception)>/g, "")), testClass); - } - - //Invoke the callback - _this.oncompletion(); - } - } - - /** - * Cross browser method for reading the value of a node in XML. - * @param {Element} node - * @returns String - */ - var _textValueOf = function _textValueOf(node) { - if (!node.textContent && node.text) { - return node.text; - } else { - return node.textContent; - } - } - - var _stripTags = function _stripTags(txt) { - txt = txt.replace(/[\r\n]+/g, ""); - return txt.replace( - /<\/?(?:a|b|br|p|strong|u|i|em|span|div|ul|ol|li|table|thead|tbody|th|td|tr)\b.*?\/?>/g, - ""); - } - - /** - * Parse an arbitrary message output. - * @param {Element} node - * @param {String} path - */ - var _parseMessage = function _parseMessage(node, path) { - reporter.reportOutput(_textValueOf(node), path); - } - - /** - * Parse formatted text output (such as a dump()). - * @param {Element} node - * @param {String} path - */ - var _parseFormatted = function _parseFormatted(node, path) { - reporter.reportOutput(_textValueOf(node), path); - } - - /** - * Parse failing test assertion. - * @param {Element} node - * @param {String} path - */ - var _parseFail = function _parseFail(node, path) { - reporter.reportFail(_textValueOf(node), path); - } - - /** - * Parse an Exception. - * @param {Element} node - * @param {String} path - */ - var _parseException = function _parseException(node, path) { - reporter.reportException(_textValueOf(node), path); - } - - /** - * Parse passing test assertion. - * @param {Element} node - * @param {String} path - */ - var _parsePass = function _parsePass(node, path) { - reporter.reportPass(_textValueOf(node), path); - } - - /** - * Parse an entire test case - * @param {Element} node - * @param {String} path - */ - var _parseTestCase = function _parseTestCase(node, path) { - var testMethodNodes = _xpath.getNodes("./test", node); - - for (var x in testMethodNodes) { - var testMethodNode = testMethodNodes[x]; - var testMethodName = _xpath.getValue("./name", testMethodNode); - - var formattedNodes = _xpath.getNodes("./formatted", testMethodNode); - for (var i in formattedNodes) { - var formattedNode = formattedNodes[i]; - _parseFormatted(formattedNode, path + " -> " + testMethodName); - } - - var messageNodes = _xpath.getNodes("./message", testMethodNode); - for (var i in messageNodes) { - var messageNode = messageNodes[i]; - _parseMessage(messageNode, path + " -> " + testMethodName); - } - - var failNodes = _xpath.getNodes("./fail", testMethodNode); - for (var i in failNodes) { - var failNode = failNodes[i]; - _parseFail(failNode, path + " -> " + testMethodName); - } - - var exceptionNodes = _xpath.getNodes("./exception", testMethodNode); - for (var i in exceptionNodes) { - var exceptionNode = exceptionNodes[i]; - _parseException(exceptionNode, path + " -> " + testMethodName); - } - - var passNodes = _xpath.getNodes("./pass", testMethodNode); - for (var i in passNodes) { - var passNode = passNodes[i]; - _parsePass(passNode, path + " -> " + testMethodName); - } - } - } - - /** - * Parse an entire grouped or single test case. - * @param {Element} node - * @param {String} path - */ - var _parseResults = function _parseResults(node, path) { - var groupNodes = _xpath.getNodes("./group", node); - - if (0 != groupNodes.length) { - for (var i in groupNodes) { - var groupNode = groupNodes[i]; - var groupName = _xpath.getValue("./name", groupNode); - _parseResults(groupNode, path + " -> " + groupName); - } - } else { - var caseNodes = _xpath.getNodes("./case", node); - for (var i in caseNodes) { - var caseNode = caseNodes[i]; - _parseTestCase(caseNode, path); - } - } - } - -} - -/** - * Runs a list of test cases. - * @author Chris Corbyn - * @constructor - */ -function SweetyTestRunner() { - - var _this = this; - - SweetyTestRunner._currentInstance = _this; - - /** True if the test runner has been stopped */ - var _cancelled = false; - - /** - * Invoked to cause the test runner to stop execution at the next available - * opportunity. If XML is being parsed in another thread, or an AJAX request - * is in progress the test runner will wait until the next test. - * @param {Boolean} cancel - */ - this.cancelTesting = function cancelTesting(cancel) { - _cancelled = cancel; - } - - /** - * Run the given list of test cases. - * @param {String[]} tests - * @param {SweetyReporter} reporter - */ - this.runTests = function runTests(tests, reporter) { - if (!reporter.isStarted()) { - reporter.start(); - } - - if (_cancelled || !tests || !tests.length) { - _cancelled = false; - reporter.finish(); - return; - } - - var testCase = tests.shift(); - - var caseReporter = reporter.getReporterFor(testCase); - - var testRun = new SweetyTestCaseRun(testCase, caseReporter); - - //Repeat until no tests remaining in list - // Ok, I know, I know I'll try to eradicate this lazy use of recursion - testRun.oncompletion = function() { - _this.runTests(tests, reporter); - }; - - testRun.run(); - } - -} - -/** Active instance */ -SweetyTestRunner._currentInstance = null; - -/** - * Fetches the currently running instance of the TestRunner. - * @returns SweetyTestRunner - */ -SweetyTestRunner.getCurrentInstance = function getCurrentInstance() { - return this._currentInstance; -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/css/main.css b/vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/css/main.css deleted file mode 100644 index 3f6e630..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/css/main.css +++ /dev/null @@ -1,203 +0,0 @@ -/** Page structure **/ -/*------------------*/ - -ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,body,html,p,blockquote,fieldset,input { - margin: 0; padding: 0; -} - -body { - font-size: 0.8em; - font-family: arial,sans-serif; - background: #fff; - padding: 8px; -} - -img { - border: 0; -} - -input { - margin-bottom: 8px; - padding: 4px; - font-size: 16px; - width: 100px; -} - -input.sweety-text { - border: 2px solid #000; - width: 268px; - background-color: #fff; -} - -input.sweety-disabled { - background: #eee; - border: 2px solid #888; -} - -input.sweety-waiting { - background-image: url(../images/loading.gif); - background-position: 98% 50%; - background-repeat: no-repeat; -} - -input.sweety-check { - width: 12px !important; - height: 12px !important; - margin: 1px !important; - padding: 1px !important; -} - -h1 { - margin-bottom: 1em; -} - -div#sweety-page { - width: 100%; -} - -div#sweety-testlist { - float: left; - width: 400px; - background: #aaa; -} - -div#sweety-output { - margin-left: 400px; -} - -div#sweety-results { - padding: 8px; - font-size: 1.4em; -} - -div#sweety-messages { - margin-top: 8px; - padding-top: 8px; - border-top: 1px solid #777; -} - -div#sweety-smoke-images { - margin-top: 8px; - padding-top: 8px; -} - -div#sweety-smoke-images img { - width: 150px; - height: 120px; - margin-right: 8px; -} - -div.sweety-clear { - width: 100%; - clear: both; -} - -/** Look and feel **/ -/*-----------------*/ - -input#sweety-filter { - visibility: hidden; -} - -div#sweety-communication { - float: right; - display: none; -} - -pre.sweety-raw-output { - display: block; - background: #ddd; - padding: 4px; - margin: 4px; -} - -div.sweety-pad { - padding: 8px; -} - -div.sweety-message { - padding: 4px; - margin: 4px; -} - -div.sweety-test-path { - padding-left: 2em; - font-style: italic; - color: #777; -} - -div.sweety-test { - font-size: 12px; - margin-bottom: 2px; - margin-left: 12px; - padding: 2px; -} - -div.sweety-test img { - float: right; - margin-right: 4px; -} - -div.sweety-package-header { - font-size: 12px; - margin-bottom: 2px; - border-bottom: 2px solid #444; - padding: 2px; -} - -div.sweety-package-header span.sweety-test-package { - font-weight: normal; -} - -div.sweety-package-header img { - margin: 0 2px; -} - -span.sweety-pkg-count { - display: block; - float: right; - padding-right: 2px; -} - -img.sweety-group-icon { - float: right; - margin: 4px !important; -} - -.sweety-pkg-idle { - background: #cacaca; -} - -span.sweety-test-package { - display: block; - font-size: 10px; - padding-left: 1em; -} - -.sweety-idle { - background: #eee; -} - -.sweety-running { - background: #ffff33 !important; -} - -.sweety-pass { - background: #00aa00 !important; - color: #fff; -} - -.sweety-fail { - background: #ee0000 !important; - color: #fff; -} - -.sweety-fail-text { - color: #ee0000; -} - -.sweety-skip-text { - color: #4444dd; - font-weight: bold; - text-decoration: underline; -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/images/darr.gif b/vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/images/darr.gif deleted file mode 100644 index d4349a76a1ccb4f175f9ecb44661b44f2a7398d1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 57 zcmZ?wbhEHbf|1&T!DE?#tk_-$wAOa-Mz@$BecV%U*z#^8s qn<9Es3d{R+XBxHLV`-XjVv@x4rI%l=Qj3{n?8lkD{3R4!*R!3S%~lfaCLLKl zRY}l^si!74*W1RJn`>9bM%_I1!R?_PMa!6nIW4hizx)2)_qzAL@4wzj$%)|+nQUOg zHUP%hVzEH$#=`m*RQ(lZm{<2Ko0c$qwIv?LVBUo4r2}Ia`Y~L8$}E~~zq0`iYoM8i zQ^!F!ZysNVibXh)-S*4k!}V=u;~I2YpnSnR@edfyP`?W1HR#=il)bj9T=mGN(;yZP z?K*0YSij5g=o;bujG+(1w>$9GE07wl?p;w_-v)KMh)nnVtN7YT*C4xmBx@-|rx3gu z53xvA(a-9C7B`6xU2Au%k#MV>Qm@ry|Gsm43J3O%*lCWyQ3QvPL*6CHFb*HbG2a_G zwdlpZyvF%OD44FA$2s?~y!9-z^dV#*h(`_u^(nWWJwLf6XyEfrNZg6??`m#t;KCW4 zerwYP6m>04v@c`r3_d!xNXxN-HxQ)Qoc{6e zQa750pRiea6Vy0Ec*e$vD?BK}n*>P6l^ zFcJnb_$>@)Jx?(>%^JjDx?}on{leX=Vc)&>&eW9PO9rP2G4+U77wa*ES$$8M=^bF@|=vocZIwg-wgU=^){ECDyMkMozRw6S9^lN^_(y(G=lxIh@jX zz?=ADKjGC7Mo5j%N$W!i&(HT!E`>;lx?nL;s}R=&?I8?-gh(Gi2&?x}s{B1J`cW$7 z?!*O|8&Tm)2+Dl~W!?n8)QeIgbtTSwx)7g9Ty$a{QM`xX7KsSwPle9sJP3}~ol@w= zCO#3ch>!WKv#w6W85hE_fJZPjT#DM6kQIVZ@Y}b$OAW#z5QODEmZy0q8{{wh)8$pok;M)% zk;U@r)&$z4QTvyM$3@Ya$1Ahkp$Ry5vaTcEkT~YP|GoPUwA`czE&;E0XV2b#1Puz+ zK#7}IaH-zs1!H&w_>}R4nUxtFrC%~jd{Ar6*;lOOgd|nbi#w(EH21J<1PDx3^bUS8dxi3>l==`ribkOMoOz@?4k0 zVxOe9bc*;`$naXaJs0au7}Asn9CWA1R@utUsn1;h`Om3k`&uxr)`OkD!Dq&WKPG1$ zPM`ib`Np@CzjT@#A3l}&2Y+td-}p2asN9<%@2%0Jb0ZLBbJPCZyy8~uh$ixeMWqcoCWujOy1r%7t9URLkq$6C%R&Z;VP0k!Oo(FvFLYzq)9tGm4VPxh z=31pIki(|u{ID3a=JET^1N)FGCV{<=>4wfJe9M9H9f2B8iMvfSJ%=1e=;TtOur-=kHX4VxrS(W1_v@|vEEC_PRpd)P% z)Sfx51OqgncW6rKtn=f7sGUFG@GhDMSz#vZaepIzTP=-XQDU=55_){;sQRPAZ9bVU)-yJK-U|N$*S&qr_}IhH7pyNe%XTx#5lGD z)Sj0!S2XEXd%QX*-{?}60}lMB<~8V$vfwz)3U^G&-c?L{R_rmarGc(j@X&E1xj_-| zM)!BW-*oZ|fis+*`sCf_p$Y*o6XjQ!0$EEllm%g-FRPL-?o^fMMoFV~(c;Bm*8p)` zibR?Gt=`fnstKMutOqegQ3mn1JL{TG6U0a&TPqNYLpTbBLO)xrp3*n@%U^!K7?(*` U^6aw9y&x)uG?OcIBPV=5rvpnyXn23|qNsQ{9(jJc5P4PhiHqJ#qoui1MHW9$t| ztWOLgdCS@RL{a1dD)nRX`A?FE-@3i^)Pw!+gZt0hYIi^J?0egv+Wpm~uRr|w-CE(J#Y24V=CRym z(xY!SuN_Xl{pQ7IrIF;&xx~@Wdv^{k+Hx{yjeP3N=hBhW-g{q6eV^hQ4>h-(eeUpQ zTNCf3oBThIE0xt)ziMS|b)dd%o;QOcZmvHV4GkbDO^2jq0@?`#_;92n+8K*v^u&7; zRb74EENeDbR6Lce*vT5}`}-^17WaO4(tPlcbKY=Yk<)Z*e*Ud@9M4~Pa^d_VFUE?h z8(cJ9zQpb*e5df5qEm9T^7d<~^P}b2**Ra}4?8PoXN}q}m6sG3UtemuS&1%Qy`Hvl z2HVml*RL!oExBgTh-Ifo+snCXyg`gcy0({8>=nv{fTR48ZKI>r`>0HFc45Oacee!k z7p$uRKMk981Cd4ZD!%#YhzDd;JpAq1E-~}Hr*EVN?`{zfevolP_m!>eF&sWHo>RA# zUAu8*P1egB&K)Yh?xVxt%gc4aV0&ZxvL?gmgJ2}fKM@?i>k(hgX3s3DvhMNV>ADNA zx8*VuC%HQfi(4Dw$VElR&k432C7XVsn7pC8_I*}5)_}DZ-=`-AmgM$kTdJDc+#5Rk zxZnKE{_2yjwEKvwO!}rlsC?y1(i;pXD#za|ZYegj(Z@Z3FiKFJBU4F56!Q ztJ>_q_CS}cTi5H5OZ*Jw2fn5aEoGmq_EfJ~pkwIu-Zz*NFZ|k0HCp1;^IO%>#^)s&HZy<9h~cJpBf@2Jw%zn3TSeGb{2xH8Me>NmkwA!201{Rg;-l2 z4IO#*|F-K9geKmgH>k~ef=rPEv>Ax`7p&tdtRB&jqdFMMt};)BWs)!*GQe;Is$;c; zk_KcEV-bQz4*<{rS=eEQi5)_p;MON7$_h0*b`1?B2Gm@ps??J>1A@-^Fuf{HwS&4= zg6JR%X1Z#hY?Bt)Nn#BF$U#u!V0o%jV}U&uO(*5#EqXPS78DT2bO8kj^3WJ|hGQ|K zfiBe3;lh}Wqmp)gd{9;K40bL8z^#V>LMzb3paxjGc;Mt!zL~%|-Bi8m`z*pw3$jVl za+1_&;(5|q9)M_^XP~_&KF}K-RI4Ao(!JSwvZ6ixF}3pWeQA?&n---5}zDhww(0(+q*(O1alSz!|N z*?1-q=Mr`vQdAP^yX^6V06Qc#J2P-k<2zM(wSb$}$7HeSfdR(!r0tFv8EvzrZ_0I2 zO5?O^E|Jorf%7RM4~*yM$I@CF)moZKwanEO(2!wdjF3?eYZ^;8ITi&(It|}J3bA$o z1}2;d$R@f0r1?lx#Z%2+t=|lgBi)}c2N~D}9o?XdhF0j=K}W(S6--(M9bpEvxyWn; zkq!tWozO(vqZHfSnWs^YZq8)O(i_eopw4L{270nM9fD-N|24%{V*F?MAwwzxAWz*H a+oaG_sP?M^QkcF_(t*<#irGR~-|{y@REX37 diff --git a/vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/images/rarr.gif b/vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/images/rarr.gif deleted file mode 100644 index b2d4d95dfd6709375c7dbbd437ff6c52c186f361..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 59 zcmZ?wbhEHb " + _pkgs[unescape(nvp[0])]); - } - } - - var _pkgFor = function _pkgFor(testName) { - return testName.replace(/_?[^_]+$/, ""); - } - -} - -//Create an instance of the UI Manager for usage -var sweetyUI = new SweetyUIManager(); - - -/** - * A filter to hide/show test cases in the list. - * @author Chris Corbyn - * @consructor - */ -function SweetyFilter() { - - var _this = this; - - /** Asynchronous page timer (so nothing happens whilst typing) */ - var _timer; - - /** The sweety-filter element, lazy loaded */ - var _filter = null; - - /** - * Update the display once the search is complete. - */ - this.repaintUI = function repaintUI() { - sweetyUI.initialize(); - sweetyUI.paintSearchComplete(); - } - - /** - * Search for matching test cases. - */ - this.search = function search() { - sweetyUI.paintSearching(); - - var query = _getFilterInput().value.toLowerCase(); - var queryBits = query.split(/[^\!a-zA-Z0-9_]+/g); - - //Cancel searching if still typing - try { - window.clearTimeout(_timer); - } catch (e) { } - - for (var testCase in sweetyTestCases) { - for (var i in queryBits) { - var testFor = queryBits[i]; - var isNegated = ("!" == testFor.charAt(0)); - if (isNegated) { - testFor = testFor.substring(1); - } - - if (!isNegated && 0 > testCase.toLowerCase().indexOf(testFor)) { - sweetyTestCases[testCase] = false; - break; - } else if (isNegated && 0 < testCase.toLowerCase().indexOf(testFor)) { - sweetyTestCases[testCase] = false; - break; - } else { - sweetyTestCases[testCase] = true; - } - } - } - - //Only apply the search in 500ms, since user may be typing - _timer = window.setTimeout(_this.repaintUI, 500); - } - - /** - * Get a lazy loaded reference to the input element. - * @return HTMLInputElement - */ - var _getFilterInput = function _getFilterInput() { - if (!_filter) { - _filter = document.getElementById("sweety-filter"); - } - return _filter; - } - -} - -//Create a new instance of the filter -var sweetyFilter = new SweetyFilter(); - -/** - * The reporter which gathers aggregate results and displays a summary. - * @author Chris Corbyn - * @constructor - * @param {Boolean} reportPkgs if package status should be reported - */ -function SweetyTemplateAggregateReporter(testCaseList, reportPkgs) { - - var _this = this; - - /** True if this reporter instance is running now */ - var _started = false; - - /** Aggregate totals */ - var _aggregates = { cases : 0, run: 0, passes : 0, fails : 0, exceptions : 0 }; - - /** Aggregates per-package */ - var _pkgs = { }; - - /** Currently running package */ - var _currentPkg; - - /** - * Creates a reporter for the given testCase. - * @param {String} testCase - * @returns SweetyReporter - */ - this.getReporterFor = function getReporterFor(testCase) { - _aggregates.cases++; - - if (reportPkgs) { - var pkg = _getPkgName(testCase); - sweetyUI.paintPkgRunning(pkg); - - _pkgs[pkg].cases++; - - if (_currentPkg && _currentPkg != pkg) { - _updatePkgStatus(_currentPkg); - } - - _currentPkg = pkg; - } - - sweetyUI.paintNumCases(_aggregates.cases); - - var reporter = new SweetyTemplateCaseReporter(testCase, _this); - return reporter; - } - - /** - * Updates the UI with the new aggregate totals. - */ - this.notifyEnded = function notifyEnded(testCase) { - _aggregates.run++; - - if (reportPkgs) { - var pkg = _getPkgName(testCase); - _pkgs[pkg].run++; - } - - //Update the UI with new totals - sweetyUI.paintNumRun(_aggregates.run); - sweetyUI.paintNumPasses(_aggregates.passes); - sweetyUI.paintNumFails(_aggregates.fails); - sweetyUI.paintNumExceptions(_aggregates.exceptions); - } - - /** - * Returns true if this reporter instance is running. - * @returns Boolean - */ - this.isStarted = function isStarted() { - return _started; - } - - /** - * Start reporting. - */ - this.start = function start() { - _started = true; - - if (reportPkgs) - { - for (var i = 0, len = testCaseList.length; i < len; i++) { - var testCase = testCaseList[i]; - var pkg = _getPkgName(testCase); - if (typeof _pkgs[pkg] == "undefined") { - _pkgs[pkg] = { cases : 0, run : 0, passes : 0, fails : 0, exceptions : 0 }; - } - } - } - - sweetyUI.allowInteractivity(false); - sweetyUI.paintNetworking(true); - sweetyUI.paintAllRunning(); - } - - /** - * Report a skipped test case. - * @param {String} message - * @param {String} path - */ - this.reportSkip = function reportSkip(message, path) { - sweetyUI.paintSkip(message, path); - } - - /** - * Report a passing assertion. - * @param {String} message - * @param {String} path - */ - this.reportPass = function reportPass(message, path) { - _aggregates.passes++; - - if (reportPkgs) { - _pkgs[_currentPkg].passes++; - } - } - - /** - * Report a failing assertion. - * @param {String} message - * @param {String} path - */ - this.reportFail = function reportFail(message, path) { - _aggregates.fails++; - - if (reportPkgs) { - _pkgs[_currentPkg].fails++; - } - - sweetyUI.paintFail(message, path); - } - - /** - * Report an unexpected exception. - * @param {String} message - * @param {String} path - */ - this.reportException = function reportException(message, path) { - _aggregates.exceptions++; - - if (reportPkgs) { - _pkgs[_currentPkg].exceptions++; - } - - sweetyUI.paintException(message, path); - } - - /** - * Handle test case output from something like a dump(). - * @param {String} output - * @param {String} path - */ - this.reportOutput = function reportOutput(output, path) { - sweetyUI.paintOutput(output, path); - } - - /** - * End reporting. - * This method is used to come to a conclusion about the test results in the UI. - */ - this.finish = function finish() { - _started = false; - - if (reportPkgs) { - _updatePkgStatus(_currentPkg); - } - - sweetyUI.allowInteractivity(true); - - sweetyUI.paintNetworking(false); - - if ((!_aggregates.fails && !_aggregates.exceptions) - && (_aggregates.cases == _aggregates.run)) { - sweetyUI.paintConclusionPassed(); - } else { - sweetyUI.paintConclusionFailed(); - } - - var incompleteCount = _aggregates.cases - _aggregates.run; - - //Check if all tests actually got fully parsed (i.e. finished) - if (0 < incompleteCount) { - sweetyUI.paintMessage( - incompleteCount + " test case(s) did not complete." + - " This may be because invalid XML was output during the test run" + - " and/or because an error occured." + - " Incomplete test cases are shown in yellow. Click the HTML link " + - "next to the test for more detail."); - } - } - - var _getPkgName = function _getPkgName(testCase) { - return testCase.replace(/_?[^_]+$/, ""); - } - - var _updatePkgStatus = function _updatePkgStatus(pkg) { - if ((!_pkgs[pkg].fails && !_pkgs[pkg].exceptions) - && (_pkgs[pkg].cases == _pkgs[pkg].run)) { - sweetyUI.paintPkgPassed(pkg); - } else if (_pkgs[pkg].cases == _pkgs[pkg].run) { - sweetyUI.paintPkgFailed(pkg); - } - } - -} -SweetyTemplateAggregateReporter.prototype = new SweetyReporter(); - -/** - * The reporter class per-test case. - * @author Chris Corbyn - * @consructor - */ -function SweetyTemplateCaseReporter(testCase, reporter) { - - var _this = this; - - /** Aggregate totals */ - var _aggregates = { passes : 0, fails : 0, exceptions : 0 }; - - /** The DIV element showing this test case */ - var _testCaseDiv = document.getElementById(testCase); - - /** True only if this reporter is running */ - var _started = false; - - /** - * Stubbed only to return itself. - * @returns SweetyReporter - */ - this.getReporterFor = function getReporterFor(testCase) { - return _this; - } - - /** - * Returns true when the reporter is started. - * @returns Boolean - */ - this.isStarted = function isStarted() { - return _started; - } - - /** - * Start reporting. - */ - this.start = function start() { - _started = true; - sweetyUI.paintTestCaseRunning(testCase); - } - - /** - * Report a skipped test case. - * @param {String} message - * @param {String} path - */ - this.reportSkip = function reportSkip(message, path) { - reporter.reportSkip(message, path); - } - - /** - * Report a passing assertion. - * @param {String} message - * @param {String} path - */ - this.reportPass = function reportPass(message, path) { - _aggregates.passes++; - reporter.reportPass(message, path); - } - - /** - * Report a failing assertion. - * @param {String} message - * @param {String} path - */ - this.reportFail = function reportFail(message, path) { - _aggregates.fails++; - reporter.reportFail(message, path); - } - - /** - * Report an unexpected exception. - * @param {String} message - * @param {String} path - */ - this.reportException = function reportException(message, path) { - _aggregates.exceptions++; - reporter.reportException(message, path); - } - - /** - * Handle output from a test case in the form of something like a dump(). - * @param {String} output - * @param {string} path - */ - this.reportOutput = function reportOutput(output, path) { - reporter.reportOutput(output, path); - } - - /** - * End reporting. - */ - this.finish = function finish() { - _started = false; - - if (!_aggregates.fails && !_aggregates.exceptions) { - sweetyUI.paintTestCasePassed(testCase); - } else { - sweetyUI.paintTestCaseFailed(testCase); - } - - reporter.notifyEnded(testCase); - } - -} -SweetyTemplateCaseReporter.prototype = new SweetyReporter(); - -/** - * Wraps the invokation of SweetyTestRunner. - * @author Chris Corbyn - * @constructor - */ -function SweetyTestWrapper() { - - var _this = this; - - /** - * Run a single test case. - * @param {String} testClass - */ - this.runTestCase = function runTestCase(testClass) { - var testCaseList = new Array(); - testCaseList.push(testClass); - - var reporter = new SweetyTemplateAggregateReporter(testCaseList); - - var runner = new SweetyTestRunner(); - runner.runTests(testCaseList, reporter); - } - - /** - * Run all selected test cases. - */ - this.runAll = function runAll(pkg) { - var pkgRegex; - if (pkg) { - pkgRegex = new RegExp("^" + pkg + "_[^_]+$"); - } - - var testCaseList = new Array(); - - for (var testCase in sweetyTestCases) { - if (!sweetyTestCases[testCase] || (pkg && !testCase.match(pkgRegex))) { - continue; - } - testCaseList.push(testCase); - } - - var reporter = new SweetyTemplateAggregateReporter(testCaseList, true); - - var runner = new SweetyTestRunner(); - runner.runTests(testCaseList, reporter); - } - -} - -//Create an instance of the test runner for usage -var sweetyRunner = new SweetyTestWrapper(); - -if (typeof document.onreadystatechange != "undefined") { //IE 6/7 - document.onreadystatechange = function() { - if (document.readyState == "complete") { - sweetyUI.restore(); sweetyUI.initialize(); - } - }; -} else { //Fallback - window.onload = function() { - sweetyUI.restore(); sweetyUI.initialize(); - }; - - try { //FF - document.addEventListener("DOMContentLoaded", window.onload, false); - } catch (e) { - } -} diff --git a/vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/suite-ui-noajax.tpl.php b/vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/suite-ui-noajax.tpl.php deleted file mode 100644 index b9d3ef1..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/suite-ui-noajax.tpl.php +++ /dev/null @@ -1,155 +0,0 @@ - - - - <?php echo $suiteName; ?> - No AJAX - - - -
    - -
    - -
    - -
    - -
    - - -
    - - -
    - - - - - -
    - Not available - Tests - - - -
    - - -
    - -
    - - As XML - As HTML - Run - - - checked="checked" - /> - - - - - - - -
    - -
    - - - -
    - -
    - -
    - -
    - -
    - -
    - -

    - No AJAX

    - -
    - / - test cases complete: - passes, - fails and - exceptions. -
    - -
    - -
    - Skip: - -
    - in -
    -
    - -
    - Fail: -
    - in -
    -
    - -
    - Exception: - -
    - in -
    -
    - -
    - -
    - -
    - -
    - -
    - -
    - -
    - -
    - - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/suite-ui.tpl.php b/vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/suite-ui.tpl.php deleted file mode 100644 index 90aa84c..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/templates/sweety/suite-ui.tpl.php +++ /dev/null @@ -1,132 +0,0 @@ - - - - - <?php echo $suiteName; ?> - - - - - - - - -
    - -
    - -
    - -
    - -
    - - -
    - - -
    - - - - - -
    - - Toggle Display - Tests - - - -
    - - -
    - -
    - - As XML - As HTML - Run - - - checked="checked" - /> - - - - - - - -
    - -
    - - - -
    - -
    - -
    - -
    - -
    - -
    - -
    - Communicating -
    - -

    - -
    - 0/0 - test cases complete: - 0 passes, - 0 fails and - 0 exceptions. -
    - -
    -
    - -
    -
    - -
    - -
    - -
    - -
    - - diff --git a/vendor/swiftmailer/swiftmailer/test-suite/xpath-legacy.js b/vendor/swiftmailer/swiftmailer/test-suite/xpath-legacy.js deleted file mode 100644 index 38c3627..0000000 --- a/vendor/swiftmailer/swiftmailer/test-suite/xpath-legacy.js +++ /dev/null @@ -1,2764 +0,0 @@ -/* JavaScript-XPath 0.1.5 - * (c) 2007 Cybozu Labs, Inc. - * - * JavaScript-XPath is freely distributable under the terms of an MIT-style license. - * For details, see the JavaScript-XPath web site: http://coderepos.org/share/wiki/JavaScript-XPath - * -/*--------------------------------------------------------------------------*/ - -if (!document.implementation - || !document.implementation.hasFeature - || !document.implementation.hasFeature("XPath", null)) (function() { - -var undefined = void(0); - - -var defaultConfig = { - targetFrame: undefined -}; - -var config; - -if (window.jsxpath) { - config = window.jsxpath; -} -else { - var scriptElms = document.getElementsByTagName('script'); - var scriptElm = scriptElms[scriptElms.length - 1]; - var scriptSrc = scriptElm.src; - config = {}; - var scriptSrcMatchResult = scriptSrc.match(/\?(.*)$/); - if (scriptSrcMatchResult) { - var configStrings = scriptSrcMatchResult[1].split('&'); - for (var i = 0, l = configStrings.length; i < l; i ++) { - var configString = configStrings[i]; - var configStringSplited = configString.split('='); - config[configStringSplited[0]] = configStringSplited[1] || true; - } - } -} - -for (var n in defaultConfig) { - if (!(n in config)) config[n] = defaultConfig[n] -} - - -var BinaryExpr; -var FilterExpr; -var FunctionCall; -var Literal; -var NameTest; -var NodeSet; -var NodeType; -var NodeUtil; -var Number; -var PathExpr; -var Step; -var UnaryExpr; -var UnionExpr; -var VariableReference; - -/* - * object: user agent identifier - */ -var uai = new function() { - - var ua = navigator.userAgent; - - if (RegExp == undefined) { - if (ua.indexOf("Opera") >= 0) { - this.opera = true; - } else if (ua.indexOf("Netscape") >= 0) { - this.netscape = true; - } else if (ua.indexOf("Mozilla/") == 0) { - this.mozilla = true; - } else { - this.unknown = slide - } - - if (ua.indexOf("Gecko/") >= 0) { - this.gecko = true; - } - - if (ua.indexOf("Win") >= 0) { - this.windows = true; - } else if (ua.indexOf("Mac") >= 0) { - this.mac = true; - } else if (ua.indexOf("Linux") >= 0) { - this.linux = true; - } else if (ua.indexOf("BSD") >= 0) { - this.bsd = true; - } else if (ua.indexOf("SunOS") >= 0) { - this.sunos = true; - } - } - else { - - /* for Trident/Tasman */ - /*@cc_on - @if (@_jscript) - function jscriptVersion() { - switch (@_jscript_version) { - case 3.0: return "4.0"; - case 5.0: return "5.0"; - case 5.1: return "5.01"; - case 5.5: return "5.5"; - case 5.6: - if ("XMLHttpRequest" in window) return "7.0"; - return "6.0"; - case 5.7: - return "7.0"; - default: return true; - } - } - if (@_win16 || @_win32 || @_win64) { - this.windows = true; - this.trident = jscriptVersion(); - } else if (@_mac || navigator.platform.indexOf("Mac") >= 0) { - // '@_mac' may be 'NaN' even if the platform is Mac, - // so we check 'navigator.platform', too. - this.mac = true; - this.tasman = jscriptVersion(); - } - if (match = ua.match("MSIE ?(\\d+\\.\\d+)b?;")) { - this.ie = match[1]; - this['ie' + match[1].charAt(0)] = true; - } - @else @*/ - - /* for AppleWebKit */ - if (match = ua.match("AppleWebKit/(\\d+(\\.\\d+)*)")) { - this.applewebkit = match[1]; - this['applewebkit' + match[1].charAt(0)] = true; - } - - /* for Gecko */ - else if (typeof(Components) == "object") { - if (match = ua.match("Gecko/(\\d{8})")) { - this.gecko = match[1]; - } else if (navigator.product == "Gecko" - && (match = navigator.productSub.match("^(\\d{8})$"))) { - this.gecko = match[1]; - } - } - - /*@end @*/ - - if (typeof(opera) == "object" && typeof(opera.version) == "function") { - this.opera = opera.version(); - this['opera' + this.opera[0] + this.opera[2]] = true; - - } else if (typeof(opera) == "object" - && (match = ua.match("Opera[/ ](\\d+\\.\\d+)"))) { - this.opera = match[1]; - } else if (this.ie) { - } else if (match = ua.match("Safari/(\\d+(\\.\\d+)*)")) { - this.safari = match[1]; - } else if (match = ua.match("Konqueror/(\\d+(\\.\\d+)*)")) { - this.konqueror = match[1]; - } else if (ua.indexOf("(compatible;") < 0 - && (match = ua.match("^Mozilla/(\\d+\\.\\d+)"))) { - this.mozilla = match[1]; - if (match = ua.match("\\([^(]*rv:(\\d+(\\.\\d+)*).*?\\)")) - this.mozillarv = match[1]; - if (match = ua.match("Firefox/(\\d+(\\.\\d+)*)")) { - this.firefox = match[1]; - } else if (match = ua.match("Netscape\\d?/(\\d+(\\.\\d+)*)")) { - this.netscape = match[1]; - } - } else { - this.unknown = true; - } - - if (ua.indexOf("Win 9x 4.90") >= 0) { - this.windows = "ME"; - } else if (match = ua.match("Win(dows)? ?(NT ?(\\d+\\.\\d+)?|\\d+|XP|ME|Vista)")) { - this.windows = match[2]; - if (match[3]) { - this.winnt = match[3]; - } else switch (match[2]) { - case "2000": this.winnt = "5.0"; break; - case "XP": this.winnt = "5.1"; break; - case "Vista": this.winnt = "6.0"; break; - } - } else if (ua.indexOf("Mac") >= 0) { - this.mac = true; - } else if (ua.indexOf("Linux") >= 0) { - this.linux = true; - } else if (match = ua.match("\\w*BSD")) { - this.bsd = match[0]; - } else if (ua.indexOf("SunOS") >= 0) { - this.sunos = true; - } - } -}; - - -/** - * pseudo class: Lexer - */ -var Lexer = function(source) { - var proto = Lexer.prototype; - var tokens = source.match(proto.regs.token); - for (var i = 0, l = tokens.length; i < l; i ++) { - if (proto.regs.strip.test(tokens[i])) { - tokens.splice(i, 1); - } - } - for (var n in proto) tokens[n] = proto[n]; - tokens.index = 0; - return tokens; -}; - -Lexer.prototype.regs = { - token: /\$?(?:(?![0-9-])[\w-]+:)?(?![0-9-])[\w-]+|\/\/|\.\.|::|\d+(?:\.\d*)?|\.\d+|"[^"]*"|'[^']*'|[!<>]=|(?![0-9-])[\w-]+:\*|\s+|./g, - strip: /^\s/ -}; - -Lexer.prototype.peek = function(i) { - return this[this.index + (i||0)]; -}; -Lexer.prototype.next = function() { - return this[this.index++]; -}; -Lexer.prototype.back = function() { - this.index--; -}; -Lexer.prototype.empty = function() { - return this.length <= this.index; -}; - - -/** - * class: Ctx - */ -var Ctx = function(node, position, last) { - this.node = node; - this.position = position || 1; - this.last = last || 1; -}; - - -/** - * abstract class: BaseExpr - */ -var BaseExpr = function() {}; - -BaseExpr.prototype.number = function(ctx) { - var exrs = this.evaluate(ctx); - if (exrs.isNodeSet) return exrs.number(); - return + exrs; -}; - -BaseExpr.prototype.string = function(ctx) { - var exrs = this.evaluate(ctx); - if (exrs.isNodeSet) return exrs.string(); - return '' + exrs; -}; - -BaseExpr.prototype.bool = function(ctx) { - var exrs = this.evaluate(ctx); - if (exrs.isNodeSet) return exrs.bool(); - return !! exrs; -}; - - -/** - * abstract class: BaseExprHasPredicates - */ -var BaseExprHasPredicates = function() {}; - -BaseExprHasPredicates.parsePredicates = function(lexer, expr) { - while (lexer.peek() == '[') { - lexer.next(); - if (lexer.empty()) { - throw Error('missing predicate expr'); - } - var predicate = BinaryExpr.parse(lexer); - expr.predicate(predicate); - if (lexer.empty()) { - throw Error('unclosed predicate expr'); - } - if (lexer.next() != ']') { - lexer.back(); - throw Error('bad token: ' + lexer.next()); - } - } -}; - -BaseExprHasPredicates.prototyps = new BaseExpr(); - -BaseExprHasPredicates.prototype.evaluatePredicates = function(nodeset, start) { - var predicates, predicate, nodes, node, nodeset, position, reverse; - - reverse = this.reverse; - predicates = this.predicates; - - nodeset.sort(); - - for (var i = start || 0, l0 = predicates.length; i < l0; i ++) { - predicate = predicates[i]; - - var deleteIndexes = []; - var nodes = nodeset.list(); - - for (var j = 0, l1 = nodes.length; j < l1; j ++) { - - position = reverse ? (l1 - j) : (j + 1); - exrs = predicate.evaluate(new Ctx(nodes[j], position, l1)); - - switch (typeof exrs) { - case 'number': - exrs = (position == exrs); - break; - case 'string': - exrs = !!exrs; - break; - case 'object': - exrs = exrs.bool(); - break; - } - - if (!exrs) { - deleteIndexes.push(j); - } - } - - for (var j = deleteIndexes.length - 1, l1 = 0; j >= l1; j --) { - nodeset.del(deleteIndexes[j]); - } - - } - - return nodeset; -}; - - -/** - * class: BinaryExpr - */ -if (!window.BinaryExpr && window.defaultConfig) - window.BinaryExpr = null; - -BinaryExpr = function(op, left, right, datatype) { - this.op = op; - this.left = left; - this.right = right; - - this.datatype = BinaryExpr.ops[op][2]; - - this.needContextPosition = left.needContextPosition || right.needContextPosition; - this.needContextNode = left.needContextNode || right.needContextNode; - - // Optimize [@id="foo"] and [@name="bar"] - if (this.op == '=') { - if (!right.needContextNode && !right.needContextPosition && - right.datatype != 'nodeset' && right.datatype != 'void' && left.quickAttr) { - this.quickAttr = true; - this.attrName = left.attrName; - this.attrValueExpr = right; - } - else if (!left.needContextNode && !left.needContextPosition && - left.datatype != 'nodeset' && left.datatype != 'void' && right.quickAttr) { - this.quickAttr = true; - this.attrName = right.attrName; - this.attrValueExpr = left; - } - } -}; - -BinaryExpr.compare = function(op, comp, left, right, ctx) { - var type, lnodes, rnodes, nodes, nodeset, primitive; - - left = left.evaluate(ctx); - right = right.evaluate(ctx); - - if (left.isNodeSet && right.isNodeSet) { - lnodes = left.list(); - rnodes = right.list(); - for (var i = 0, l0 = lnodes.length; i < l0; i ++) - for (var j = 0, l1 = rnodes.length; j < l1; j ++) - if (comp(NodeUtil.to('string', lnodes[i]), NodeUtil.to('string', rnodes[j]))) - return true; - return false; - } - - if (left.isNodeSet || right.isNodeSet) { - if (left.isNodeSet) - nodeset = left, primitive = right; - else - nodeset = right, primitive = left; - - nodes = nodeset.list(); - type = typeof primitive; - for (var i = 0, l = nodes.length; i < l; i ++) { - if (comp(NodeUtil.to(type, nodes[i]), primitive)) - return true; - } - return false; - } - - if (op == '=' || op == '!=') { - if (typeof left == 'boolean' || typeof right == 'boolean') { - return comp(!!left, !!right); - } - if (typeof left == 'number' || typeof right == 'number') { - return comp(+left, +right); - } - return comp(left, right); - } - - return comp(+left, +right); -}; - - -BinaryExpr.ops = { - 'div': [6, function(left, right, ctx) { - return left.number(ctx) / right.number(ctx); - }, 'number'], - 'mod': [6, function(left, right, ctx) { - return left.number(ctx) % right.number(ctx); - }, 'number'], - '*': [6, function(left, right, ctx) { - return left.number(ctx) * right.number(ctx); - }, 'number'], - '+': [5, function(left, right, ctx) { - return left.number(ctx) + right.number(ctx); - }, 'number'], - '-': [5, function(left, right, ctx) { - return left.number(ctx) - right.number(ctx); - }, 'number'], - '<': [4, function(left, right, ctx) { - return BinaryExpr.compare('<', - function(a, b) { return a < b }, left, right, ctx); - }, 'boolean'], - '>': [4, function(left, right, ctx) { - return BinaryExpr.compare('>', - function(a, b) { return a > b }, left, right, ctx); - }, 'boolean'], - '<=': [4, function(left, right, ctx) { - return BinaryExpr.compare('<=', - function(a, b) { return a <= b }, left, right, ctx); - }, 'boolean'], - '>=': [4, function(left, right, ctx) { - return BinaryExpr.compare('>=', - function(a, b) { return a >= b }, left, right, ctx); - }, 'boolean'], - '=': [3, function(left, right, ctx) { - return BinaryExpr.compare('=', - function(a, b) { return a == b }, left, right, ctx); - }, 'boolean'], - '!=': [3, function(left, right, ctx) { - return BinaryExpr.compare('!=', - function(a, b) { return a != b }, left, right, ctx); - }, 'boolean'], - 'and': [2, function(left, right, ctx) { - return left.bool(ctx) && right.bool(ctx); - }, 'boolean'], - 'or': [1, function(left, right, ctx) { - return left.bool(ctx) || right.bool(ctx); - }, 'boolean'] -}; - - -BinaryExpr.parse = function(lexer) { - var op, precedence, info, expr, stack = [], index = lexer.index; - - while (true) { - - if (lexer.empty()) { - throw Error('missing right expression'); - } - expr = UnaryExpr.parse(lexer); - - op = lexer.next(); - if (!op) { - break; - } - - info = this.ops[op]; - precedence = info && info[0]; - if (!precedence) { - lexer.back(); - break; - } - - while (stack.length && precedence <= this.ops[stack[stack.length-1]][0]) { - expr = new BinaryExpr(stack.pop(), stack.pop(), expr); - } - - stack.push(expr, op); - } - - while (stack.length) { - expr = new BinaryExpr(stack.pop(), stack.pop(), expr); - } - - return expr; -}; - -BinaryExpr.prototype = new BaseExpr(); - -BinaryExpr.prototype.evaluate = function(ctx) { - return BinaryExpr.ops[this.op][1](this.left, this.right, ctx); -}; - -BinaryExpr.prototype.show = function(indent) { - indent = indent || ''; - var t = ''; - t += indent + 'binary: ' + this.op + '\n'; - indent += ' '; - t += this.left.show(indent); - t += this.right.show(indent); - return t; -}; - - -/** - * class: UnaryExpr - */ -if (!window.UnaryExpr && window.defaultConfig) - window.UnaryExpr = null; - -UnaryExpr = function(op, expr) { - this.op = op; - this.expr = expr; - - this.needContextPosition = expr.needContextPosition; - this.needContextNode = expr.needContextNode; -}; - -UnaryExpr.ops = { '-': 1 }; - -UnaryExpr.parse = function(lexer) { - var token; - if (this.ops[lexer.peek()]) - return new UnaryExpr(lexer.next(), UnaryExpr.parse(lexer)); - else - return UnionExpr.parse(lexer); -}; - -UnaryExpr.prototype = new BaseExpr(); - -UnaryExpr.prototype.datatype = 'number'; - -UnaryExpr.prototype.evaluate = function(ctx) { - return - this.expr.number(ctx); -}; - -UnaryExpr.prototype.show = function(indent) { - indent = indent || ''; - var t = ''; - t += indent + 'unary: ' + this.op + '\n'; - indent += ' '; - t += this.expr.show(indent); - return t; -}; - - -/** - * class: UnionExpr - */ -if (!window.UnionExpr && window.defaultConfig) - window.UnionExpr = null; - -UnionExpr = function() { - this.paths = []; -}; - -UnionExpr.ops = { '|': 1 }; - - -UnionExpr.parse = function(lexer) { - var union, expr; - - expr = PathExpr.parse(lexer); - if (!this.ops[lexer.peek()]) - return expr; - - union = new UnionExpr(); - union.path(expr); - - while (true) { - if (!this.ops[lexer.next()]) break; - if (lexer.empty()) { - throw Error('missing next union location path'); - } - union.path(PathExpr.parse(lexer)); - } - - - - lexer.back(); - return union; -}; - -UnionExpr.prototype = new BaseExpr(); - -UnionExpr.prototype.datatype = 'nodeset'; - -UnionExpr.prototype.evaluate = function(ctx) { - var paths = this.paths; - var nodeset = new NodeSet(); - for (var i = 0, l = paths.length; i < l; i ++) { - var exrs = paths[i].evaluate(ctx); - if (!exrs.isNodeSet) throw Error('PathExpr must be nodeset'); - nodeset.merge(exrs); - } - return nodeset; -}; - -UnionExpr.prototype.path = function(path) { - this.paths.push(path); - - if (path.needContextPosition) { - this.needContextPosition = true; - } - if (path.needContextNode) { - this.needContextNode = true; - } -} -UnionExpr.prototype.show = function(indent) { - indent = indent || ''; - var t = ''; - t += indent + 'union:' + '\n'; - indent += ' '; - for (var i = 0; i < this.paths.length; i ++) { - t += this.paths[i].show(indent); - } - return t; -}; - - -/** - * class: PathExpr - */ -if (!window.PathExpr && window.defaultConfig) - window.PathExpr = null; - -PathExpr = function(filter) { - this.filter = filter; - this.steps = []; - - this.datatype = filter.datatype; - - this.needContextPosition = filter.needContextPosition; - this.needContextNode = filter.needContextNode; -}; - -PathExpr.ops = { '//': 1, '/': 1 }; - -PathExpr.parse = function(lexer) { - var op, expr, path, token; - - if (this.ops[lexer.peek()]) { - op = lexer.next(); - token = lexer.peek(); - - if (op == '/' && (lexer.empty() || - (token != '.' && token != '..' && token != '@' && token != '*' && - !token.match(/(?![0-9])[\w]/)))) { - return FilterExpr.root(); - } - - path = new PathExpr(FilterExpr.root()); // RootExpr - - if (lexer.empty()) { - throw Error('missing next location step'); - } - expr = Step.parse(lexer); - path.step(op, expr); - } - else { - expr = FilterExpr.parse(lexer); - if (!expr) { - expr = Step.parse(lexer); - path = new PathExpr(FilterExpr.context()); - path.step('/', expr); - } - else if (!this.ops[lexer.peek()]) - return expr; - else - path = new PathExpr(expr); - } - - while (true) { - if (!this.ops[lexer.peek()]) break; - op = lexer.next(); - if (lexer.empty()) { - throw Error('missing next location step'); - } - path.step(op, Step.parse(lexer)); - } - - return path; -}; - -PathExpr.prototype = new BaseExpr(); - -PathExpr.prototype.evaluate = function(ctx) { - var nodeset = this.filter.evaluate(ctx); - if (!nodeset.isNodeSet) throw Exception('Filter nodeset must be nodeset type'); - - var steps = this.steps; - - for (var i = 0, l0 = steps.length; i < l0 && nodeset.length; i ++) { - var step = steps[i][1]; - var reverse = step.reverse; - var iter = nodeset.iterator(reverse); - var prevNodeset = nodeset; - nodeset = null; - var node, next; - if (!step.needContextPosition && step.axis == 'following') { - for (node = iter(); next = iter(); node = next) { - - // Safari 2 node.contains problem - if (uai.applewebkit4) { - var contains = false; - var ancestor = next; - do { - if (ancestor == node) { - contains = true; - break; - } - } while (ancestor = ancestor.parentNode); - if (!contains) break; - } - else { - try { if (!node.contains(next)) break } - catch(e) { if (!(next.compareDocumentPosition(node) & 8)) break } - } - } - nodeset = step.evaluate(new Ctx(node)); - } - else if (!step.needContextPosition && step.axis == 'preceding') { - node = iter(); - nodeset = step.evaluate(new Ctx(node)); - } - else { - node = iter(); - var j = 0; - nodeset = step.evaluate(new Ctx(node), false, prevNodeset, j); - while (node = iter()) { - j ++; - nodeset.merge(step.evaluate(new Ctx(node), false, prevNodeset, j)); - } - } - } - - return nodeset; -}; - -PathExpr.prototype.step = function(op, step) { - step.op = op; - this.steps.push([op, step]); - - this.quickAttr = false; - - if (this.steps.length == 1) { - if (op == '/' && step.axis == 'attribute') { - var test = step.test; - if (!test.notOnlyElement && test.name != '*') { - this.quickAttr = true; - this.attrName = test.name; - } - } - } -}; - -PathExpr.prototype.show = function(indent) { - indent = indent || ''; - var t = ''; - t += indent + 'path:' + '\n'; - indent += ' '; - t += indent + 'filter:' + '\n'; - t += this.filter.show(indent + ' '); - if (this.steps.length) { - t += indent + 'steps:' + '\n'; - indent += ' '; - for (var i = 0; i < this.steps.length; i ++) { - var step = this.steps[i]; - t += indent + 'operator: ' + step[0] + '\n'; - t += step[1].show(indent); - } - } - return t; -}; - - -/** - * class: FilterExpr - */ -if (!window.FilterExpr && window.defaultConfig) - window.FilterExpr = null; - -FilterExpr = function(primary) { - this.primary = primary; - this.predicates = []; - - this.datatype = primary.datatype; - - this.needContextPosition = primary.needContextPosition; - - this.needContextNode = primary.needContextNode; -}; - -FilterExpr.parse = function(lexer) { - var expr, filter, token, ch; - - token = lexer.peek(); - ch = token.charAt(0); - - switch (ch) { - case '$': - expr = VariableReference.parse(lexer); - break; - - case '(': - lexer.next(); - expr = BinaryExpr.parse(lexer); - if (lexer.empty()) { - throw Error('unclosed "("'); - } - if (lexer.next() != ')') { - lexer.back(); - throw Error('bad token: ' + lexer.next()); - } - break; - - case '"': - case "'": - expr = Literal.parse(lexer); - break; - - default: - if (!isNaN(+token)) { - expr = Number.parse(lexer); - } - - else if (NodeType.types[token]) { - return null; - } - - else if (ch.match(/(?![0-9])[\w]/) && lexer.peek(1) == '(') { - expr = FunctionCall.parse(lexer); - } - else { - return null; - } - break; - } - - if (lexer.peek() != '[') return expr; - - filter = new FilterExpr(expr); - - BaseExprHasPredicates.parsePredicates(lexer, filter); - - return filter; -}; - -FilterExpr.root = function() { - return new FunctionCall('root-node'); -}; -FilterExpr.context = function() { - return new FunctionCall('context-node'); -}; - -FilterExpr.prototype = new BaseExprHasPredicates(); - -FilterExpr.prototype.evaluate = function(ctx) { - var nodeset = this.primary.evaluate(ctx); - if(!nodeset.isNodeSet) { - if (this.predicates.length) - throw Error( - 'Primary result must be nodeset type ' + - 'if filter have predicate expression'); - return nodeset; - } - - return this.evaluatePredicates(nodeset); -}; - -FilterExpr.prototype.predicate = function(predicate) { - this.predicates.push(predicate); -}; - -FilterExpr.prototype.show = function(indent) { - indent = indent || ''; - var t = ''; - t += indent + 'filter: ' + '\n'; - indent += ' '; - t += this.primary.show(indent); - if (this.predicates.length) { - t += indent + 'predicates: ' + '\n'; - indent += ' '; - for (var i = 0; i < this.predicates.length; i ++) { - t += this.predicates[i].show(indent); - } - } - return t; -}; - - -if (!window.NodeUtil && window.defaultConfig) - window.NodeUtil = null; - -NodeUtil = { - to: function(valueType, node) { - var type = node.nodeType; -/*@cc_on - if (type == 1 && node.nodeName.toLowerCase() == 'title') { - t = node.text; - } - else -@*/ - if (type == 9 || type == 1) { - if (type == 9) { - node = node.documentElement; - } - else { - node = node.firstChild; - } - for (var t = '', stack = [], i = 0; node;) { - do { - if (node.nodeType != 1) { - t += node.nodeValue; - } -/*@cc_on - else if (node.nodeName.toLowerCase() == 'title') { - t += node.text; - } -@*/ - stack[i++] = node; // push - } while (node = node.firstChild); - while (i && !(node = stack[--i].nextSibling)) {} - } - } - else { - var t = node.nodeValue; - } - switch (valueType) { - case 'number': - return + t; - case 'boolean': - return !! t; - default: - return t; - } - }, - attrPropMap: { - name: 'name', - 'class': 'className', - dir: 'dir', - id: 'id', - name: 'name', - title: 'title' - }, - attrMatch: function(node, attrName, attrValue) { -/*@cc_on @if (@_jscript) - var propName = NodeUtil.attrPropMap[attrName]; - if (!attrName || - attrValue == null && ( - propName && node[propName] || - !propName && node.getAttribute && node.getAttribute(attrName) - ) || - attrValue != null && ( - propName && node[propName] == attrValue || - !propName && node.getAttribute && node.getAttribute(attrName) == attrValue - )) { -@else @*/ - if (!attrName || - attrValue == null && node.hasAttribute && node.hasAttribute(attrName) || - attrValue != null && node.getAttribute && node.getAttribute(attrName) == attrValue) { -/*@end @*/ - return true; - } - else { - return false; - } - }, - getDescendantNodes: function(test, node, nodeset, attrName, attrValue, prevNodeset, prevIndex) { - if (prevNodeset) { - prevNodeset.delDescendant(node, prevIndex); - } -/*@cc_on - if (!test.notOnlyElement || test.type == 8 || (attrName && test.type == 0)) { - - var all = node.all; - if (!all) { - return nodeset; - } - - var name = test.name; - if (test.type == 8) name = '!'; - else if (test.type == 0) name = '*'; - - if (name != '*') { - all = all.tags(name); - if (!all) { - return nodeset; - } - } - - if (attrName) { - var result = [] - var i = 0; - if (attrValue != null && (attrName == 'id' || attrName == 'name')) { - all = all[attrValue]; - if (!all) { - return nodeset; - } - if (!all.length) { - all = [all]; - } - } - - while (node = all[i++]) { - if (NodeUtil.attrMatch(node, attrName, attrValue)) result.push(node); - } - - all = result; - } - - var i = 0; - while (node = all[i++]) { - if (name != '*' || node.tagName != '!') { - nodeset.push(node); - } - } - - return nodeset; - } - - (function (parent) { - var g = arguments.callee; - var node = parent.firstChild; - if (node) { - for (; node; node = node.nextSibling) { - if (NodeUtil.attrMatch(node, attrName, attrValue)) { - if (test.match(node)) nodeset.push(node); - } - g(node); - } - } - })(node); - - return nodeset; -@*/ - if (attrValue && attrName == 'id' && node.getElementById) { - node = node.getElementById(attrValue); - if (node && test.match(node)) { - nodeset.push(node); - } - } - else if (attrValue && attrName == 'name' && node.getElementsByName) { - var nodes = node.getElementsByName(attrValue); - for (var i = 0, l = nodes.length; i < l; i ++) { - node = nodes[i]; - if (uai.opera ? (node.name == attrValue && test.match(node)) : test.match(node)) { - nodeset.push(node); - } - } - } - else if (attrValue && attrName == 'class' && node.getElementsByClassName) { - var nodes = node.getElementsByClassName(attrValue); - for (var i = 0, l = nodes.length; i < l; i ++) { - node = nodes[i]; - if (node.className == attrValue && test.match(node)) { - nodeset.push(node); - } - } - } - else if (test.notOnlyElement) { - (function (parent) { - var f = arguments.callee; - for (var node = parent.firstChild; node; node = node.nextSibling) { - if (NodeUtil.attrMatch(node, attrName, attrValue)) { - if (test.match(node.nodeType)) nodeset.push(node); - } - f(node); - } - })(node); - } - else { - var name = test.name; - if (node.getElementsByTagName) { - var nodes = node.getElementsByTagName(name); - if (nodes) { - var i = 0; - while (node = nodes[i++]) { - if (NodeUtil.attrMatch(node, attrName, attrValue)) nodeset.push(node); - } - } - } - } - return nodeset; - }, - - getChildNodes: function(test, node, nodeset, attrName, attrValue) { - -/*@cc_on - var children; - - if ((!test.notOnlyElement || test.type == 8 || (attrName && test.type == 0)) && (children = node.children)) { - var name, elm; - - name = test.name; - if (test.type == 8) name = '!'; - else if (test.type == 0) name = '*'; - - if (name != '*') { - children = children.tags(name); - if (!children) { - return nodeset; - } - } - - if (attrName) { - var result = [] - var i = 0; - if (attrName == 'id' || attrName == 'name') { - children = children[attrValue]; - - if (!children) { - return nodeset; - } - - if (!children.length) { - children = [children]; - } - } - - while (node = children[i++]) { - if (NodeUtil.attrMatch(node, attrName, attrValue)) result.push(node); - } - children = result; - } - - var i = 0; - while (node = children[i++]) { - if (name != '*' || node.tagName != '!') { - nodeset.push(node); - } - } - - return nodeset; - } - - for (var i = 0, node = node.firstChild; node; i++, node = node.nextSibling) { - if (NodeUtil.attrMatch(node, attrName, attrValue)) { - if (test.match(node)) nodeset.push(node); - } - } - - return nodeset; -@*/ - for (var node = node.firstChild; node; node = node.nextSibling) { - if (NodeUtil.attrMatch(node, attrName, attrValue)) { - if (test.match(node)) nodeset.push(node); - } - } - return nodeset; - } -}; - -/*@cc_on -var AttributeWrapper = function(node, parent, sourceIndex) { - this.node = node; - this.nodeType = 2; - this.nodeValue = node.nodeValue; - this.nodeName = node.nodeName; - this.parentNode = parent; - this.ownerElement = parent; - this.parentSourceIndex = sourceIndex; -}; - -@*/ - - -/** - * class: Step - */ -if (!window.Step && window.defaultConfig) - window.Step = null; - -Step = function(axis, test) { - // TODO check arguments and throw axis error - this.axis = axis; - this.reverse = Step.axises[axis][0]; - this.func = Step.axises[axis][1]; - this.test = test; - this.predicates = []; - this._quickAttr = Step.axises[axis][2] -}; - -Step.axises = { - - ancestor: [true, function(test, node, nodeset, _, __, prevNodeset, prevIndex) { - while (node = node.parentNode) { - if (prevNodeset && node.nodeType == 1) { - prevNodeset.reserveDelByNode(node, prevIndex, true); - } - if (test.match(node)) nodeset.unshift(node); - } - return nodeset; - }], - - 'ancestor-or-self': [true, function(test, node, nodeset, _, __, prevNodeset, prevIndex) { - do { - if (prevNodeset && node.nodeType == 1) { - prevNodeset.reserveDelByNode(node, prevIndex, true); - } - if (test.match(node)) nodeset.unshift(node); - } while (node = node.parentNode) - return nodeset; - }], - - attribute: [false, function(test, node, nodeset) { - var attrs = node.attributes; - if (attrs) { -/*@cc_on - var sourceIndex = node.sourceIndex; -@*/ - if ((test.notOnlyElement && test.type == 0) || test.name == '*') { - for (var i = 0, l = attrs.length; i < l; i ++) { - var attr = attrs[i]; -/*@cc_on @if (@_jscript) - if (attr.nodeValue) { - nodeset.push(new AttributeWrapper(attr, node, sourceIndex)); - } -@else @*/ - nodeset.push(attr); -/*@end @*/ - } - } - else { - var attr = attrs.getNamedItem(test.name) - -/*@cc_on @if (@_jscript) - if (attr && attr.nodeValue) { - attr = new AttributeWrapper(attr, node, sourceIndex);; -@else @*/ - if (attr) { -/*@end @*/ - nodeset.push(attr); - } - } - } - return nodeset; - }], - - child: [false, NodeUtil.getChildNodes, true], - - descendant: [false, NodeUtil.getDescendantNodes, true], - - 'descendant-or-self': [false, function(test, node, nodeset, attrName, attrValue, prevNodeset, prevIndex) { - if (NodeUtil.attrMatch(node, attrName, attrValue)) { - if (test.match(node)) nodeset.push(node); - } - return NodeUtil.getDescendantNodes(test, node, nodeset, attrName, attrValue, prevNodeset, prevIndex); - }, true], - - following: [false, function(test, node, nodeset, attrName, attrValue) { - do { - var child = node; - while (child = child.nextSibling) { - if (NodeUtil.attrMatch(child, attrName, attrValue)) { - if (test.match(child)) nodeset.push(child); - } - nodeset = NodeUtil.getDescendantNodes(test, child, nodeset, attrName, attrValue); - } - } while (node = node.parentNode); - return nodeset; - }, true], - - 'following-sibling': [false, function(test, node, nodeset, _, __, prevNodeset, prevIndex) { - while (node = node.nextSibling) { - - if (prevNodeset && node.nodeType == 1) { - prevNodeset.reserveDelByNode(node, prevIndex); - } - - if (test.match(node)) { - nodeset.push(node); - } - } - return nodeset; - }], - - namespace: [false, function(test, node, nodeset) { - // not implemented - return nodeset; - }], - - parent: [false, function(test, node, nodeset) { - if (node.nodeType == 9) { - return nodeset; - } - if (node.nodeType == 2) { - nodeset.push(node.ownerElement); - return nodeset; - } - var node = node.parentNode; - if (test.match(node)) nodeset.push(node); - return nodeset; - }], - - preceding: [true, function(test, node, nodeset, attrName, attrValue) { - var parents = []; - do { - parents.unshift(node); - } while (node = node.parentNode); - - for (var i = 1, l0 = parents.length; i < l0; i ++) { - var siblings = []; - node = parents[i]; - while (node = node.previousSibling) { - siblings.unshift(node); - } - - for (var j = 0, l1 = siblings.length; j < l1; j ++) { - node = siblings[j]; - if (NodeUtil.attrMatch(node, attrName, attrValue)) { - if (test.match(node)) nodeset.push(node); - } - nodeset = NodeUtil.getDescendantNodes(test, node, nodeset, attrName, attrValue); - } - } - return nodeset; - }, true], - - 'preceding-sibling': [true, function(test, node, nodeset, _, __, prevNodeset, prevIndex) { - while (node = node.previousSibling) { - - if (prevNodeset && node.nodeType == 1) { - prevNodeset.reserveDelByNode(node, prevIndex, true); - } - - if (test.match(node)) { - nodeset.unshift(node) - } - } - return nodeset; - }], - - self: [false, function(test, node, nodeset) { - if (test.match(node)) nodeset.push(node); - return nodeset; - }] -}; - -Step.parse = function(lexer) { - var axis, test, step, token; - - if (lexer.peek() == '.') { - step = this.self(); - lexer.next(); - } - else if (lexer.peek() == '..') { - step = this.parent(); - lexer.next(); - } - else { - if (lexer.peek() == '@') { - axis = 'attribute'; - lexer.next(); - if (lexer.empty()) { - throw Error('missing attribute name'); - } - } - else { - if (lexer.peek(1) == '::') { - - if (!lexer.peek().charAt(0).match(/(?![0-9])[\w]/)) { - throw Error('bad token: ' + lexer.next()); - } - - axis = lexer.next(); - lexer.next(); - - if (!this.axises[axis]) { - throw Error('invalid axis: ' + axis); - } - if (lexer.empty()) { - throw Error('missing node name'); - } - } - else { - axis = 'child'; - } - } - - token = lexer.peek(); - if (!token.charAt(0).match(/(?![0-9])[\w]/)) { - if (token == '*') { - test = NameTest.parse(lexer) - } - else { - throw Error('bad token: ' + lexer.next()); - } - } - else { - if (lexer.peek(1) == '(') { - if (!NodeType.types[token]) { - throw Error('invalid node type: ' + token); - } - test = NodeType.parse(lexer) - } - else { - test = NameTest.parse(lexer); - } - } - step = new Step(axis, test); - } - - BaseExprHasPredicates.parsePredicates(lexer, step); - - return step; -}; - -Step.self = function() { - return new Step('self', new NodeType('node')); -}; - -Step.parent = function() { - return new Step('parent', new NodeType('node')); -}; - -Step.prototype = new BaseExprHasPredicates(); - -Step.prototype.evaluate = function(ctx, special, prevNodeset, prevIndex) { - var node = ctx.node; - var reverse = false; - - if (!special && this.op == '//') { - - if (!this.needContextPosition && this.axis == 'child') { - if (this.quickAttr) { - var attrValue = this.attrValueExpr ? this.attrValueExpr.string(ctx) : null; - var nodeset = NodeUtil.getDescendantNodes(this.test, node, new NodeSet(), this.attrName, attrValue, prevNodeset, prevIndex); - nodeset = this.evaluatePredicates(nodeset, 1); - } - else { - var nodeset = NodeUtil.getDescendantNodes(this.test, node, new NodeSet(), null, null, prevNodeset, prevIndex); - nodeset = this.evaluatePredicates(nodeset); - } - } - else { - var step = new Step('descendant-or-self', new NodeType('node')); - var nodes = step.evaluate(ctx, false, prevNodeset, prevIndex).list(); - var nodeset = null; - step.op = '/'; - for (var i = 0, l = nodes.length; i < l; i ++) { - if (!nodeset) { - nodeset = this.evaluate(new Ctx(nodes[i]), true); - } - else { - nodeset.merge(this.evaluate(new Ctx(nodes[i]), true)); - } - } - nodeset = nodeset || new NodeSet(); - } - } - else { - - if (this.needContextPosition) { - prevNodeset = null; - prevIndex = null; - } - - if (this.quickAttr) { - var attrValue = this.attrValueExpr ? this.attrValueExpr.string(ctx) : null; - var nodeset = this.func(this.test, node, new NodeSet(), this.attrName, attrValue, prevNodeset, prevIndex); - nodeset = this.evaluatePredicates(nodeset, 1); - } - else { - var nodeset = this.func(this.test, node, new NodeSet(), null, null, prevNodeset, prevIndex); - nodeset = this.evaluatePredicates(nodeset); - } - if (prevNodeset) { - prevNodeset.doDel(); - } - } - return nodeset; -}; - -Step.prototype.predicate = function(predicate) { - this.predicates.push(predicate); - - if (predicate.needContextPosition || - predicate.datatype == 'number'|| - predicate.datatype == 'void') { - this.needContextPosition = true; - } - - if (this._quickAttr && this.predicates.length == 1 && predicate.quickAttr) { - var attrName = predicate.attrName; -/*@cc_on @if (@_jscript) - this.attrName = attrName.toLowerCase(); -@else @*/ - this.attrName = attrName; -/*@end @*/ - this.attrValueExpr = predicate.attrValueExpr; - this.quickAttr = true; - } -}; - -Step.prototype.show = function(indent) { - indent = indent || ''; - var t = ''; - t += indent + 'step: ' + '\n'; - indent += ' '; - if (this.axis) t += indent + 'axis: ' + this.axis + '\n'; - t += this.test.show(indent); - if (this.predicates.length) { - t += indent + 'predicates: ' + '\n'; - indent += ' '; - for (var i = 0; i < this.predicates.length; i ++) { - t += this.predicates[i].show(indent); - } - } - return t; -}; - - - -/** - * NodeType - */ -if (!window.NodeType && window.defaultConfig) - window.NodeType = null; - -NodeType = function(name, literal) { - this.name = name; - this.literal = literal; - - switch (name) { - case 'comment': - this.type = 8; - break; - case 'text': - this.type = 3; - break; - case 'processing-instruction': - this.type = 7; - break; - case 'node': - this.type = 0; - break; - } -}; - -NodeType.types = { - 'comment':1, 'text':1, 'processing-instruction':1, 'node':1 -}; - -NodeType.parse = function(lexer) { - var type, literal, ch; - type = lexer.next(); - lexer.next(); - if (lexer.empty()) { - throw Error('bad nodetype'); - } - ch = lexer.peek().charAt(0); - if (ch == '"' || ch == "'") { - literal = Literal.parse(lexer); - } - if (lexer.empty()) { - throw Error('bad nodetype'); - } - if (lexer.next() != ')') { - lexer.back(); - throw Error('bad token ' + lexer.next()); - } - return new NodeType(type, literal); -}; - -NodeType.prototype = new BaseExpr(); - -NodeType.prototype.notOnlyElement = true; - -NodeType.prototype.match = function(node) { - return !this.type || this.type == node.nodeType; -}; - -NodeType.prototype.show = function(indent) { - indent = indent || ''; - var t = ''; - t += indent + 'nodetype: ' + this.type + '\n'; - if (this.literal) { - indent += ' '; - t += this.literal.show(indent); - } - return t; -}; - - -/** - * NodeType - */ -if (!window.NameTest && window.defaultConfig) - window.NameTest = null; - -NameTest = function(name) { - this.name = name.toLowerCase(); -}; - -NameTest.parse = function(lexer) { - if (lexer.peek() != '*' && lexer.peek(1) == ':' && lexer.peek(2) == '*') { - return new NameTest(lexer.next() + lexer.next() + lexer.next()); - } - return new NameTest(lexer.next()); -}; - -NameTest.prototype = new BaseExpr(); - -NameTest.prototype.match = function(node) { - var type = node.nodeType; - - if (type == 1 || type == 2) { - if (this.name == '*' || this.name == node.nodeName.toLowerCase()) { - return true; - } - } - return false; -}; - -NameTest.prototype.show = function(indent) { - indent = indent || ''; - var t = ''; - t += indent + 'nametest: ' + this.name + '\n'; - return t; -}; - - -/** - * class: VariableRefernce - */ -if (!window.VariableReference && window.defaultConfig) - window.VariableReference = null; - -VariableReference = function(name) { - this.name = name.substring(1); -}; - - -VariableReference.parse = function(lexer) { - var token = lexer.next(); - if (token.length < 2) { - throw Error('unnamed variable reference'); - } - return new VariableReference(token) -}; - -VariableReference.prototype = new BaseExpr(); - -VariableReference.prototype.datatype = 'void'; - -VariableReference.prototype.show = function(indent) { - indent = indent || ''; - var t = ''; - t += indent + 'variable: ' + this.name + '\n'; - return t; -}; - - -/** - * class: Literal - */ -if (!window.Literal && window.defaultConfig) - window.Literal = null; - -Literal = function(text) { - this.text = text.substring(1, text.length - 1); -}; - -Literal.parse = function(lexer) { - var token = lexer.next(); - if (token.length < 2) { - throw Error('unclosed literal string'); - } - return new Literal(token) -}; - -Literal.prototype = new BaseExpr(); - -Literal.prototype.datatype = 'string'; - -Literal.prototype.evaluate = function(ctx) { - return this.text; -}; - -Literal.prototype.show = function(indent) { - indent = indent || ''; - var t = ''; - t += indent + 'literal: ' + this.text + '\n'; - return t; -}; - - -/** - * class: Number - */ -if (!window.Number && window.defaultConfig) - window.Number = null; - -Number = function(digit) { - this.digit = +digit; -}; - - -Number.parse = function(lexer) { - return new Number(lexer.next()); -}; - -Number.prototype = new BaseExpr(); - -Number.prototype.datatype = 'number'; - -Number.prototype.evaluate = function(ctx) { - return this.digit; -}; - -Number.prototype.show = function(indent) { - indent = indent || ''; - var t = ''; - t += indent + 'number: ' + this.digit + '\n'; - return t; -}; - - -/** - * class: FunctionCall - */ -if (!window.FunctionCall && window.defaultConfig) - window.FunctionCall = null; - -FunctionCall = function(name) { - var info = FunctionCall.funcs[name]; - this.name = name; - this.func = info[0]; - this.args = []; - - this.datatype = info[1]; - - if (info[2]) { - this.needContextPosition = true; - } - - this.needContextNodeInfo = info[3]; - this.needContextNode = this.needContextNodeInfo[0] -}; - -FunctionCall.funcs = { - - // Original Function - 'context-node': [function() { - if (arguments.length != 0) { - throw Error('Function context-node expects ()'); - } - var ns; - ns = new NodeSet(); - ns.push(this.node); - return ns; - }, 'nodeset', false, [true]], - - // Original Function - 'root-node': [function() { - if (arguments.length != 0) { - throw Error('Function root-node expects ()'); - } - var ns, ctxn; - ns = new NodeSet(); - ctxn = this.node; - if (ctxn.nodeType == 9) - ns.push(ctxn); - else - ns.push(ctxn.ownerDocument); - return ns; - }, 'nodeset', false, []], - - last: [function() { - if (arguments.length != 0) { - throw Error('Function last expects ()'); - } - return this.last; - }, 'number', true, []], - - position: [function() { - if (arguments.length != 0) { - throw Error('Function position expects ()'); - } - return this.position; - }, 'number', true, []], - - count: [function(ns) { - if (arguments.length != 1 || !(ns = ns.evaluate(this)).isNodeSet) { - throw Error('Function count expects (nodeset)'); - } - return ns.length; - }, 'number', false, []], - - id: [function(s) { - var ids, ns, i, id, elm, ctxn, doc; - if (arguments.length != 1) { - throw Error('Function id expects (object)'); - } - ctxn = this.node; - if (ctxn.nodeType == 9) - doc = ctxn; - else - doc = ctxn.ownerDocument; -/*@cc_on - all = doc.all; -@*/ - s = s.string(this); - ids = s.split(/\s+/); - ns = new NodeSet(); - for (i = 0, l = ids.length; i < l; i ++) { - id = ids[i]; - -/*@cc_on @if (@_jscript) - elm = all[id]; - if (elm) { - if (elm.length) { - var elms = elm; - for (var j = 0, l0 = elms.length; j < l0; j ++) { - var elem = elms[j]; - if (id == elem.id) { - ns.push(elem); - break; - } - } - } - else if (id == elm.id) { - ns.push(elm) - } - } -@else @*/ - elm = doc.getElementById(id); - if (uai.opera && elm.id != id) { - var elms = doc.getElementsByName(id); - for (var j = 0, l0 = elms.length; j < l0; j ++) { - elm = elms[j]; - if (elm.id == id) { - ns.push(elm); - } - } - } - else { - if (elm) ns.push(elm) - } -/*@end @*/ - - } - ns.isSorted = false; - return ns; - }, 'nodeset', false, []], - - 'local-name': [function(ns) { - var nd; - switch (arguments.length) { - case 0: - nd = this.node; - break; - case 1: - if ((ns = ns.evaluate(this)).isNodeSet) { - nd = ns.first(); - break; - } - default: - throw Error('Function local-name expects (nodeset?)'); - break; - } - return '' + nd.nodeName.toLowerCase(); - }, 'string', false, [true, false]], - - name: [function(ns) { - // not implemented - return FunctionCall.funcs['local-name'][0].apply(this, arguments); - }, 'string', false, [true, false]], - - 'namespace-uri': [function(ns) { - // not implemented - return ''; - }, 'string', false, [true, false]], - - string: [function(s) { - switch (arguments.length) { - case 0: - s = NodeUtil.to('string', this.node); - break; - case 1: - s = s.string(this); - break; - default: - throw Error('Function string expects (object?)'); - break; - } - return s; - }, 'string', false, [true, false]], - - concat: [function(s1, s2) { - if (arguments.length < 2) { - throw Error('Function concat expects (string, string[, ...])'); - } - for (var t = '', i = 0, l = arguments.length; i < l; i ++) { - t += arguments[i].string(this); - } - return t; - }, 'string', false, []], - - 'starts-with': [function(s1, s2) { - if (arguments.length != 2) { - throw Error('Function starts-with expects (string, string)'); - } - s1 = s1.string(this); - s2 = s2.string(this); - return s1.indexOf(s2) == 0; - }, 'boolean', false, []], - - contains: [function(s1, s2) { - if (arguments.length != 2) { - throw Error('Function contains expects (string, string)'); - } - s1 = s1.string(this); - s2 = s2.string(this); - return s1.indexOf(s2) != -1; - }, 'boolean', false, []], - - substring: [function(s, n1, n2) { - var a1, a2; - s = s.string(this); - n1 = n1.number(this); - switch (arguments.length) { - case 2: - n2 = s.length - n1 + 1; - break; - case 3: - n2 = n2.number(this); - break; - default: - throw Error('Function substring expects (string, string)'); - break; - } - n1 = Math.round(n1); - n2 = Math.round(n2); - a1 = n1 - 1; - a2 = n1 + n2 - 1; - if (a2 == Infinity) { - return s.substring(a1 < 0 ? 0 : a1); - } - else { - return s.substring(a1 < 0 ? 0 : a1, a2) - } - }, 'string', false, []], - - 'substring-before': [function(s1, s2) { - var n; - if (arguments.length != 2) { - throw Error('Function substring-before expects (string, string)'); - } - s1 = s1.string(this); - s2 = s2.string(this); - n = s1.indexOf(s2); - if (n == -1) return ''; - return s1.substring(0, n); - }, 'string', false, []], - - 'substring-after': [function(s1, s2) { - if (arguments.length != 2) { - throw Error('Function substring-after expects (string, string)'); - } - s1 = s1.string(this); - s2 = s2.string(this); - var n = s1.indexOf(s2); - if (n == -1) return ''; - return s1.substring(n + s2.length); - }, 'string', false, []], - - 'string-length': [function(s) { - switch (arguments.length) { - case 0: - s = NodeUtil.to('string', this.node); - break; - case 1: - s = s.string(this); - break; - default: - throw Error('Function string-length expects (string?)'); - break; - } - return s.length; - }, 'number', false, [true, false]], - - 'normalize-space': [function(s) { - switch (arguments.length) { - case 0: - s = NodeUtil.to('string', this.node); - break; - case 1: - s = s.string(this); - break; - default: - throw Error('Function normalize-space expects (string?)'); - break; - } - return s.replace(/\s+/g, ' ').replace(/^ /, '').replace(/ $/, ''); - }, 'string', false, [true, false]], - - translate: [function(s1, s2, s3) { - if (arguments.length != 3) { - throw Error('Function translate expects (string, string, string)'); - } - s1 = s1.string(this); - s2 = s2.string(this); - s3 = s3.string(this); - - var map = []; - for (var i = 0, l = s2.length; i < l; i ++) { - var ch = s2.charAt(i); - if (!map[ch]) map[ch] = s3.charAt(i) || ''; - } - for (var t = '', i = 0, l = s1.length; i < l; i ++) { - var ch = s1.charAt(i); - var replace = map[ch] - t += (replace != undefined) ? replace : ch; - } - return t; - }, 'string', false, []], - - 'boolean': [function(b) { - if (arguments.length != 1) { - throw Error('Function boolean expects (object)'); - } - return b.bool(this) - }, 'boolean', false, []], - - not: [function(b) { - if (arguments.length != 1) { - throw Error('Function not expects (object)'); - } - return !b.bool(this) - }, 'boolean', false, []], - - 'true': [function() { - if (arguments.length != 0) { - throw Error('Function true expects ()'); - } - return true; - }, 'boolean', false, []], - - 'false': [function() { - if (arguments.length != 0) { - throw Error('Function false expects ()'); - } - return false; - }, 'boolean', false, []], - - lang: [function(s) { - // not implemented - return false; - }, 'boolean', false, []], - - number: [function(n) { - switch (arguments.length) { - case 0: - n = NodeUtil.to('number', this.node); - break; - case 1: - n = n.number(this); - break; - default: - throw Error('Function number expects (object?)'); - break; - } - return n; - }, 'number', false, [true, false]], - - sum: [function(ns) { - var nodes, n, i, l; - if (arguments.length != 1 || !(ns = ns.evaluate(this)).isNodeSet) { - throw Error('Function sum expects (nodeset)'); - } - nodes = ns.list(); - n = 0; - for (i = 0, l = nodes.length; i < l; i ++) { - n += NodeUtil.to('number', nodes[i]); - } - return n; - }, 'number', false, []], - - floor: [function(n) { - if (arguments.length != 1) { - throw Error('Function floor expects (number)'); - } - n = n.number(this); - return Math.floor(n); - }, 'number', false, []], - - ceiling: [function(n) { - if (arguments.length != 1) { - throw Error('Function ceiling expects (number)'); - } - n = n.number(this); - return Math.ceil(n); - }, 'number', false, []], - - round: [function(n) { - if (arguments.length != 1) { - throw Error('Function round expects (number)'); - } - n = n.number(this); - return Math.round(n); - }, 'number', false, []] -}; - -FunctionCall.parse = function(lexer) { - var expr, func = new FunctionCall(lexer.next()); - lexer.next(); - while (lexer.peek() != ')') { - if (lexer.empty()) { - throw Error('missing function argument list'); - } - expr = BinaryExpr.parse(lexer); - func.arg(expr); - if (lexer.peek() != ',') break; - lexer.next(); - } - if (lexer.empty()) { - throw Error('unclosed function argument list'); - } - if (lexer.next() != ')') { - lexer.back(); - throw Error('bad token: ' + lexer.next()); - } - return func -}; - -FunctionCall.prototype = new BaseExpr(); - -FunctionCall.prototype.evaluate = function (ctx) { - return this.func.apply(ctx, this.args); -}; - -FunctionCall.prototype.arg = function(arg) { - this.args.push(arg); - - if (arg.needContextPosition) { - this.needContextPosition = true; - } - - var args = this.args; - if (arg.needContextNode) { - args.needContexNode = true; - } - this.needContextNode = args.needContextNode || - this.needContextNodeInfo[args.length]; -}; - -FunctionCall.prototype.show = function(indent) { - indent = indent || ''; - var t = ''; - t += indent + 'function: ' + this.name + '\n'; - indent += ' '; - - if (this.args.length) { - t += indent + 'arguments: ' + '\n'; - indent += ' '; - for (var i = 0; i < this.args.length; i ++) { - t += this.args[i].show(indent); - } - } - - return t; -}; - - -/*@cc_on @if (@_jscript) -var NodeWrapper = function(node, sourceIndex, subIndex, attributeName) { - this.node = node; - this.nodeType = node.nodeType; - this.sourceIndex = sourceIndex; - this.subIndex = subIndex; - this.attributeName = attributeName || ''; - this.order = String.fromCharCode(sourceIndex) + String.fromCharCode(subIndex) + attributeName; -}; - -NodeWrapper.prototype.toString = function() { - return this.order; -}; -@else @*/ -var NodeID = { - uuid: 1, - get: function(node) { - return node.__jsxpath_id__ || (node.__jsxpath_id__ = this.uuid++); - } -}; -/*@end @*/ - -if (!window.NodeSet && window.defaultConfig) - window.NodeSet = null; - -NodeSet = function() { - this.length = 0; - this.nodes = []; - this.seen = {}; - this.idIndexMap = null; - this.reserveDels = []; -}; - -NodeSet.prototype.isNodeSet = true; -NodeSet.prototype.isSorted = true; - -/*@_cc_on -NodeSet.prototype.shortcut = true; -@*/ - -NodeSet.prototype.merge = function(nodeset) { - this.isSorted = false; - if (nodeset.only) { - return this.push(nodeset.only); - } - - if (this.only){ - var only = this.only; - delete this.only; - this.push(only); - this.length --; - } - - var nodes = nodeset.nodes; - for (var i = 0, l = nodes.length; i < l; i ++) { - this._add(nodes[i]); - } -}; - -NodeSet.prototype.sort = function() { - if (this.only) return; - if (this.sortOff) return; - - if (!this.isSorted) { - this.isSorted = true; - this.idIndexMap = null; - -/*@cc_on - if (this.shortcut) { - this.nodes.sort(); - } - else { - this.nodes.sort(function(a, b) { - var result; - result = a.sourceIndex - b.sourceIndex; - if (result == 0) - return a.subIndex - a.subIndex; - else - return result; - }); - } - return; -@*/ - var nodes = this.nodes; - nodes.sort(function(a, b) { - if (a == b) return 0; - - if (a.compareDocumentPosition) { - var result = a.compareDocumentPosition(b); - if (result & 2) return 1; - if (result & 4) return -1; - return 0; - } - else { - var node1 = a, node2 = b, ancestor1 = a, ancestor2 = b, deep1 = 0, deep2 = 0; - - while(ancestor1 = ancestor1.parentNode) deep1 ++; - while(ancestor2 = ancestor2.parentNode) deep2 ++; - - // same deep - if (deep1 > deep2) { - while (deep1-- != deep2) node1 = node1.parentNode; - if (node1 == node2) return 1; - } - else if (deep2 > deep1) { - while (deep2-- != deep1) node2 = node2.parentNode; - if (node1 == node2) return -1; - } - - while ((ancestor1 = node1.parentNode) != (ancestor2 = node2.parentNode)) { - node1 = ancestor1; - node2 = ancestor2; - } - - // node1 is node2's sibling - while (node1 = node1.nextSibling) if (node1 == node2) return -1; - - return 1; - } - }); - } -}; - - -/*@cc_on @if (@_jscript) -NodeSet.prototype.sourceOffset = 1; -NodeSet.prototype.subOffset = 2; -NodeSet.prototype.createWrapper = function(node) { - var parent, child, attributes, attributesLength, sourceIndex, subIndex, attributeName; - - sourceIndex = node.sourceIndex; - - if (typeof sourceIndex != 'number') { - type = node.nodeType; - switch (type) { - case 2: - parent = node.parentNode; - sourceIndex = node.parentSourceIndex; - subIndex = -1; - attributeName = node.nodeName; - break; - case 9: - subIndex = -2; - sourceIndex = -1; - break; - default: - child = node; - subIndex = 0; - do { - subIndex ++; - sourceIndex = child.sourceIndex; - if (sourceIndex) { - parent = child; - child = child.lastChild; - if (!child) { - child = parent; - break; - } - subIndex ++; - } - } while (child = child.previousSibling); - if (!sourceIndex) { - sourceIndex = node.parentNode.sourceIndex; - } - break; - } - } - else { - subIndex = -2; - } - - sourceIndex += this.sourceOffset; - subIndex += this.subOffset; - - return new NodeWrapper(node, sourceIndex, subIndex, attributeName); -}; - -NodeSet.prototype.reserveDelBySourceIndexAndSubIndex = function(sourceIndex, subIndex, offset, reverse) { - var map = this.createIdIndexMap(); - var index; - if ((map = map[sourceIndex]) && (index = map[subIndex])) { - if (reverse && (this.length - offset - 1) > index || !reverse && offset < index) { - var obj = { - value: index, - order: String.fromCharCode(index), - toString: function() { return this.order }, - valueOf: function() { return this.value } - }; - this.reserveDels.push(obj); - } - } -}; -@else @*/ -NodeSet.prototype.reserveDelByNodeID = function(id, offset, reverse) { - var map = this.createIdIndexMap(); - var index; - if (index = map[id]) { - if (reverse && (this.length - offset - 1) > index || !reverse && offset < index) { - var obj = { - value: index, - order: String.fromCharCode(index), - toString: function() { return this.order }, - valueOf: function() { return this.value } - }; - this.reserveDels.push(obj); - } - } -}; -/*@end @*/ - -NodeSet.prototype.reserveDelByNode = function(node, offset, reverse) { -/*@cc_on @if (@_jscript) - node = this.createWrapper(node); - this.reserveDelBySourceIndexAndSubIndex(node.sourceIndex, node.subIndex, offset, reverse); -@else @*/ - this.reserveDelByNodeID(NodeID.get(node), offset, reverse); -/*@end @*/ -}; - -NodeSet.prototype.doDel = function() { - if (!this.reserveDels.length) return; - - if (this.length < 0x10000) { - var dels = this.reserveDels.sort(function(a, b) { return b - a }); - } - else { - var dels = this.reserveDels.sort(function(a, b) { return b - a }); - } - for (var i = 0, l = dels.length; i < l; i ++) { - this.del(dels[i]); - } - this.reserveDels = []; - this.idIndexMap = null; -}; - -NodeSet.prototype.createIdIndexMap = function() { - if (this.idIndexMap) { - return this.idIndexMap; - } - else { - var map = this.idIndexMap = {}; - var nodes = this.nodes; - for (var i = 0, l = nodes.length; i < l; i ++) { - var node = nodes[i]; -/*@cc_on @if (@_jscript) - var sourceIndex = node.sourceIndex; - var subIndex = node.subIndex; - if (!map[sourceIndex]) map[sourceIndex] = {}; - map[sourceIndex][subIndex] = i; -@else @*/ - var id = NodeID.get(node); - map[id] = i; -/*@end @*/ - } - return map; - } -}; - -NodeSet.prototype.del = function(index) { - this.length --; - if (this.only) { - delete this.only; - } - else { - var node = this.nodes.splice(index, 1)[0]; - - if (this._first == node) { - delete this._first; - delete this._firstSourceIndex; - delete this._firstSubIndex; - } - -/*@cc_on @if (@_jscript) - delete this.seen[node.sourceIndex][node.subIndex]; -@else @*/ - delete this.seen[NodeID.get(node)]; -/*@end @*/ - } -}; - - -NodeSet.prototype.delDescendant = function(elm, offset) { - if (this.only) return; - var nodeType = elm.nodeType; - if (nodeType != 1 && nodeType != 9) return; - if (uai.applewebkit4) return; - - // element || document - if (!elm.contains) { - if (nodeType == 1) { - var _elm = elm; - elm = { - contains: function(node) { - return node.compareDocumentPosition(_elm) & 8; - } - }; - } - else { - // document - elm = { - contains: function() { - return true; - } - }; - } - } - - var nodes = this.nodes; - for (var i = offset + 1; i < nodes.length; i ++) { - -/*@cc_on @if (@_jscript) - if (nodes[i].node.nodeType == 1 && elm.contains(nodes[i].node)) { -@else @*/ - if (elm.contains(nodes[i])) { -/*@end @*/ - this.del(i); - i --; - } - } -}; - -NodeSet.prototype._add = function(node, reverse) { - -/*@cc_on @if (@_jscript) - - var first, firstSourceIndex, firstSubIndex, sourceIndex, subIndex, attributeName; - - sourceIndex = node.sourceIndex; - subIndex = node.subIndex; - attributeName = node.attributeName; - seen = this.seen; - - seen = seen[sourceIndex] || (seen[sourceIndex] = {}); - - if (node.nodeType == 2) { - seen = seen[subIndex] || (seen[subIndex] = {}); - if (seen[attributeName]) { - return true; - } - seen[attributeName] = true; - } - else { - if (seen[subIndex]) { - return true; - } - seen[subIndex] = true; - } - - if (sourceIndex >= 0x10000 || subIndex >= 0x10000) { - this.shortcut = false; - } - - // if this._first is undefined and this.nodes is not empty - // then first node shortcut is disabled. - if (this._first || this.nodes.length == 0) { - first = this._first; - firstSourceIndex = this._firstSourceIndex; - firstSubIndex = this._firstSubIndex; - if (!first || firstSourceIndex > sourceIndex || (firstSourceIndex == sourceIndex && firstSubIndex > subIndex)) { - this._first = node; - this._firstSourceIndex = sourceIndex; - this._firstSubIndex = subIndex - } - } - -@else @*/ - - var seen = this.seen; - var id = NodeID.get(node); - if (seen[id]) return true; - seen[id] = true; - -/*@end @*/ - - this.length++; - if (reverse) - this.nodes.unshift(node); - else - this.nodes.push(node); -}; - - -NodeSet.prototype.unshift = function(node) { - if (!this.length) { - this.length ++; - this.only = node; - return - } - if (this.only){ - var only = this.only; - delete this.only; - this.unshift(only); - this.length --; - } -/*@cc_on - node = this.createWrapper(node); -@*/ - return this._add(node, true); -}; - - -NodeSet.prototype.push = function(node) { - if (!this.length) { - this.length ++; - this.only = node; - return; - } - if (this.only) { - var only = this.only; - delete this.only; - this.push(only); - this.length --; - } -/*@cc_on - node = this.createWrapper(node); -@*/ - return this._add(node); -}; - -NodeSet.prototype.first = function() { - if (this.only) return this.only; -/*@cc_on - if (this._first) return this._first.node; - if (this.nodes.length > 1) this.sort(); - var node = this.nodes[0]; - return node ? node.node : undefined; -@*/ - if (this.nodes.length > 1) this.sort(); - return this.nodes[0]; -}; - -NodeSet.prototype.list = function() { - if (this.only) return [this.only]; - this.sort(); -/*@cc_on - var i, l, nodes, results; - nodes = this.nodes; - results = []; - for (i = 0, l = nodes.length; i < l; i ++) { - results.push(nodes[i].node); - } - return results; -@*/ - return this.nodes; -}; - -NodeSet.prototype.string = function() { - var node = this.only || this.first(); - return node ? NodeUtil.to('string', node) : ''; -}; - -NodeSet.prototype.bool = function() { - return !! (this.length || this.only); -}; - -NodeSet.prototype.number = function() { - return + this.string(); -}; - -NodeSet.prototype.iterator = function(reverse) { - this.sort(); - var nodeset = this; - - if (!reverse) { - var count = 0; - return function() { - if (nodeset.only && count++ == 0) return nodeset.only; -/*@cc_on @if(@_jscript) - var wrapper = nodeset.nodes[count++]; - if (wrapper) return wrapper.node; - return undefined; -@else @*/ - return nodeset.nodes[count++]; -/*@end @*/ - }; - } - else { - var count = 0; - return function() { - var index = nodeset.length - (count++) - 1; - if (nodeset.only && index == 0) return nodeset.only; -/*@cc_on @if(@_jscript) - var wrapper = nodeset.nodes[index]; - if (wrapper) return wrapper.node; - return undefined; -@else @*/ - return nodeset.nodes[index]; -/*@end @*/ - }; - } -}; - - -var install = function(win) { - - win = win || this; - - win.XPathExpression = function(expr) { - if (!expr.length) { - throw Error('no expression'); - } - var lexer = this.lexer = Lexer(expr); - if (lexer.empty()) { - throw Error('no expression'); - } - this.expr = BinaryExpr.parse(lexer); - if (!lexer.empty()) { - throw Error('bad token: ' + lexer.next()); - } - }; - - win.XPathExpression.prototype.evaluate = function(node, type) { - return new XPathResult(this.expr.evaluate(new Ctx(node)), type); - }; - - win.XPathResult = function (value, type) { - if (type == 0) { - switch (typeof value) { - case 'object': type ++; // 4 - case 'boolean': type ++; // 3 - case 'string': type ++; // 2 - case 'number': type ++; // 1 - } - } - - this.resultType = type; - - switch (type) { - case 1: - this.numberValue = value.isNodeSet ? value.number() : +value; - return; - case 2: - this.stringValue = value.isNodeSet ? value.string() : '' + value; - return; - case 3: - this.booleanValue = value.isNodeSet ? value.bool() : !! value; - return; - case 4: case 5: case 6: case 7: - this.nodes = value.list(); - this.snapshotLength = value.length; - this.index = 0; - this.invalidIteratorState = false; - break; - case 8: case 9: - this.singleNodeValue = value.first(); - return; - } - }; - - win.XPathResult.prototype.iterateNext = function() { return this.nodes[this.index++] }; - win.XPathResult.prototype.snapshotItem = function(i) { return this.nodes[i] }; - - win.XPathResult.ANY_TYPE = 0; - win.XPathResult.NUMBER_TYPE = 1; - win.XPathResult.STRING_TYPE = 2; - win.XPathResult.BOOLEAN_TYPE = 3; - win.XPathResult.UNORDERED_NODE_ITERATOR_TYPE = 4; - win.XPathResult.ORDERED_NODE_ITERATOR_TYPE = 5; - win.XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE = 6; - win.XPathResult.ORDERED_NODE_SNAPSHOT_TYPE = 7; - win.XPathResult.ANY_UNORDERED_NODE_TYPE = 8; - win.XPathResult.FIRST_ORDERED_NODE_TYPE = 9; - - - win.document.createExpression = function(expr) { - return new XPathExpression(expr, null); - }; - - win.document.evaluate = function(expr, context, _, type) { - return document.createExpression(expr, null).evaluate(context, type); - }; -}; - -var win; - -if (config.targetFrame) { - var frame = document.getElementById(config.targetFrame); - if (frame) win = frame.contentWindow; -} - -install(win || window); - -})(); - -// Thanks for reading this source code. We love JavaScript. - diff --git a/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/iso-2022-jp/one.txt b/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/iso-2022-jp/one.txt deleted file mode 100644 index c2923de..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/iso-2022-jp/one.txt +++ /dev/null @@ -1,11 +0,0 @@ -ISO-2022-JPは、インターネット上(特に電子メール)などで使われる日本の文字用の文字符号化方式。ISO/IEC 2022のエスケープシーケンスを利用して文字集合を切り替える7ビットのコードであることを特徴とする (アナウンス機能のエスケープシーケンスは省略される)。俗に「JISコード」と呼ばれることもある。 - -概要 -日本語表記への利用が想定されている文字コードであり、日本語の利用されるネットワークにおいて、日本の規格を応用したものである。また文字集合としては、日本語で用いられる漢字、ひらがな、カタカナはもちろん、ラテン文字、ギリシア文字、キリル文字なども含んでおり、学術や産業の分野での利用も考慮たものとなっている。規格名に、ISOの日本語の言語コードであるjaではなく、国・地域名コードのJPが示されているゆえんである。 -文字集合としてJIS X 0201のC0集合(制御文字)、JIS X 0201のラテン文字集合、ISO 646の国際基準版図形文字、JIS X 0208の1978年版(JIS C 6226-1978)と1983年および1990年版が利用できる。JIS X 0201の片仮名文字集合は利用できない。1986年以降、日本の電子メールで用いられてきたJUNETコードを、村井純・Mark Crispin・Erik van der Poelが1993年にRFC化したもの(RFC 1468)。後にJIS X 0208:1997の附属書2としてJISに規定された。MIMEにおける文字符号化方式の識別用の名前として IANA に登録されている。 -なお、符号化の仕様についてはISO/IEC 2022#ISO-2022-JPも参照。 - -ISO-2022-JPと非標準的拡張使用 -「JISコード」(または「ISO-2022-JP」)というコード名の規定下では、その仕様通りの使用が求められる。しかし、Windows OS上では、実際にはCP932コード (MicrosoftによるShift JISを拡張した亜種。ISO-2022-JP規定外文字が追加されている。)による独自拡張(の文字)を断りなく使うアプリケーションが多い。この例としてInternet ExplorerやOutlook Expressがある。また、EmEditor、秀丸エディタやThunderbirdのようなMicrosoft社以外のWindowsアプリケーションでも同様の場合がある。この場合、ISO-2022-JPの範囲外の文字を使ってしまうと、異なる製品間では未定義不明文字として認識されるか、もしくは文字化けを起こす原因となる。そのため、Windows用の電子メールクライアントであっても独自拡張の文字を使用すると警告を出したり、あえて使えないように制限しているものも存在する。さらにはISO-2022-JPの範囲内であってもCP932は非標準文字(FULLWIDTH TILDE等)を持つので文字化けの原因になり得る。 -また、符号化方式名をISO-2022-JPとしているのに、文字集合としてはJIS X 0212 (いわゆる補助漢字) やJIS X 0201の片仮名文字集合 (いわゆる半角カナ) をも符号化している例があるが、ISO-2022-JPではこれらの文字を許容していない。これらの符号化は独自拡張の実装であり、中にはISO/IEC 2022の仕様に準拠すらしていないものもある[2]。従って受信側の電子メールクライアントがこれらの独自拡張に対応していない場合、その文字あるいはその文字を含む行、時にはテキスト全体が文字化けすることがある。 - diff --git a/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/iso-8859-1/one.txt b/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/iso-8859-1/one.txt deleted file mode 100644 index 3101178..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/iso-8859-1/one.txt +++ /dev/null @@ -1,19 +0,0 @@ -Op mat eraus hinnen beschte, rou zënne schaddreg ké. Ké sin Eisen Kaffi prächteg, den haut esou Fielse wa, Well zielen d'Welt am dir. Aus grousse rëschten d'Stroos do, as dat Kléder gewëss d'Kàchen. Schied gehéiert d'Vioule net hu, rou ke zënter Säiten d'Hierz. Ze eise Fletschen mat, gei as gréng d'Lëtzebuerger. Wäit räich no mat. - -Säiten d'Liewen aus en. Un gëtt bléit lossen wee, da wéi alle weisen Kolrettchen. Et deser d'Pan d'Kirmes vun, en wuel Benn rëschten méi. En get drem ménger beschte, da wär Stad welle. Nun Dach d'Pied do, mä gét ruffen gehéiert. Ze onser ugedon fir, d'Liewen Plett'len ech no, si Räis wielen bereet wat. Iwer spilt fir jo. - -An hin däischter Margréitchen, eng ke Frot brommt, vu den Räis néierens. Da hir Hunn Frot nozegon, rout Fläiß Himmel zum si, net gutt Kaffi Gesträich fu. Vill lait Gaart sou wa, Land Mamm Schuebersonndeg rei do. Gei geet Minutt en, gei d'Leit beschte Kolrettchen et, Mamm fergiess un hun. - -Et gutt Heck kommen oft, Lann rëscht rei um, Hunn rëscht schéinste ke der. En lait zielen schnéiwäiss hir, fu rou botze éiweg Minutt, rem fest gudden schaddreg en. Noper bereet Margréitchen mat op, dem denkt d'Leit d'Vioule no, oft ké Himmel Hämmel. En denkt blénken Fréijor net, Gart Schiet d'Natur no wou. No hin Ierd Frot d'Kirmes. Hire aremt un rou, ké den éiweg wielen Milliounen. - -Mir si Hunn Blénkeg. Ké get ston derfir d'Kàchen. Haut d'Pan fu ons, dé frou löschteg d'Meereische rei. Sou op wuel Léift. Stret schlon grousse gin hu. Mä denkt d'Leit hinnen net, ké gét haut fort rëscht. - -Koum d'Pan hannendrun ass ké, ké den brét Kaffi geplot. Schéi Hären d'Pied fu gét, do d'Mier néierens bei. Rëm päift Hämmel am, wee Engel beschéngt mä. Brommt klinzecht der ke, wa rout jeitzt dén. Get Zalot d'Vioule däischter da, jo fir Bänk päift duerch, bei d'Beem schéinen Plett'len jo. Den haut Faarwen ze, eng en Biereg Kirmesdag, um sin alles Faarwen d'Vioule. - -Eng Hunn Schied et, wat wa Frot fest gebotzt. Bei jo bleiwe ruffen Klarinett. Un Feld klinzecht gét, rifft Margréitchen rem ke. Mir dé Noper duurch gewëss, ston sech kille sin en. Gei Stret d'Wise um, Haus Gart wee as. Monn ménger an blo, wat da Gart gefällt Hämmelsbrot. - -Brommt geplot och ze, dat wa Räis Well Kaffi. Do get spilt prächteg, as wär kille bleiwe gewalteg. Onser frësch Margréitchen rem ke, blo en huet ugedon. Onser Hemecht wär de, hu eraus d'Sonn dat, eise deser hannendrun da och. - -As durch Himmel hun, no fest iw'rem schéinste mir, Hunn séngt Hierz ke zum. Séngt iw'rem d'Natur zum an. Ke wär gutt Grénge. Kënnt gudden prächteg mä rei. Dé dir Blénkeg Klarinett Kolrettchen, da fort muerges d'Kanner wou, main Feld ruffen vu wéi. Da gin esou Zalot gewalteg, gét vill Hemecht blénken dé. - -Haut gréng nun et, nei vu Bass gréng d'Gaassen. Fest d'Beem uechter si gin. Oft vu sinn wellen kréien. Et ass lait Zalot schéinen. \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/one.txt b/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/one.txt deleted file mode 100644 index 26c94d5..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/one.txt +++ /dev/null @@ -1,22 +0,0 @@ -Код одно гринспана руководишь на. Его вы знания движение. Ты две начать -одиночку, сказать основатель удовольствием но миф. Бы какие система тем. -Полностью использует три мы, человек клоунов те нас, бы давать творческую -эзотерическая шеф. - -Мог не помнить никакого сэкономленного, две либо какие пишите бы. Должен -компанию кто те, этот заключалась проектировщик не ты. Глупые периоды ты -для. Вам который хороший он. Те любых кремния концентрируются мог, -собирать принадлежите без вы. - -Джоэла меньше хорошего вы миф, за тем году разработки. Даже управляющим -руководители был не. Три коде выпускать заботиться ну. То его система -удовольствием безостановочно, или ты главной процессорах. Мы без джоэл -знания получат, статьи остальные мы ещё. - -Них русском касается поскольку по, образование должником -систематизированный ну мои. Прийти кандидата университет но нас, для бы -должны никакого, биг многие причин интервьюирования за. - -Тем до плиту почему. Вот учёт такие одного бы, об биг разным внешних -промежуток. Вас до какому возможностей безответственный, были погодите бы -его, по них глупые долгий количества. diff --git a/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/three.txt b/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/three.txt deleted file mode 100644 index c81ccd5..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/three.txt +++ /dev/null @@ -1,45 +0,0 @@ -Αν ήδη διάβασε γλιτώσει μεταγλωτίσει, αυτήν θυμάμαι μου μα. Την κατάσταση χρησιμοποίησέ να! Τα διαφορά φαινόμενο διολισθήσεις πες, υψηλότερη προκαλείς περισσότερες όχι κι. Με ελέγχου γίνεται σας, μικρής δημιουργούν τη του. Τις τα γράψει εικόνες απαράδεκτη? - -Να ότι πρώτοι απαραίτητο. Άμεση πετάνε κακόκεφος τον ώς, να χώρου πιθανότητες του. Το μέχρι ορίστε λιγότερους σας. Πω ναί φυσικά εικόνες. - -Μου οι κώδικα αποκλειστικούς, λες το μάλλον συνεχώς. Νέου σημεία απίστευτα σας μα. Χρόνου μεταγλωτιστής σε νέα, τη τις πιάνει μπορούσες προγραμματιστές. Των κάνε βγαίνει εντυπωσιακό τα? Κρατάει τεσσαρών δυστυχώς της κι, ήδη υψηλότερη εξακολουθεί τα? - -Ώρα πετάνε μπορούσε λιγότερους αν, τα απαράδεκτη συγχωνευτεί ροή. Τη έγραψες συνηθίζουν σαν. Όλα με υλικό στήλες χειρότερα. Ανώδυνη δουλέψει επί ως, αν διαδίκτυο εσωτερικών παράγοντες από. Κεντρικό επιτυχία πες το. - -Πω ναι λέει τελειώσει, έξι ως έργων τελειώσει. Με αρχεία βουτήξουν ανταγωνιστής ώρα, πολύ γραφικά σελίδων τα στη. Όρο οέλεγχος δημιουργούν δε, ας θέλεις ελέγχου συντακτικό όρο! Της θυμάμαι επιδιόρθωση τα. Για μπορούσε περισσότερο αν, μέγιστη σημαίνει αποφάσισε τα του, άτομο αποτελέσει τι στα. - -Τι στην αφήσεις διοίκηση στη. Τα εσφαλμένη δημιουργια επιχείριση έξι! Βήμα μαγικά εκτελέσει ανά τη. Όλη αφήσεις συνεχώς εμπορικά αν, το λες κόλπα επιτυχία. Ότι οι ζώνη κειμένων. Όρο κι ρωτάει γραμμής πελάτες, τελειώσει διολισθήσεις καθυστερούσε αν εγώ? Τι πετούν διοίκηση προβλήματα ήδη. - -Τη γλιτώσει αποθηκευτικού μια. Πω έξι δημιουργια πιθανότητες, ως πέντε ελέγχους εκτελείται λες. Πως ερωτήσεις διοικητικό συγκεντρωμένοι οι, ας συνεχώς διοικητικό αποστηθίσει σαν. Δε πρώτες συνεχώς διολισθήσεις έχω, από τι κανένας βουτήξουν, γειτονιάς προσεκτικά ανταγωνιστής κι σαν. - -Δημιουργια συνηθίζουν κλπ τι? Όχι ποσοστό διακοπής κι. Κλπ φακέλους δεδομένη εξοργιστικά θα? Υποψήφιο καθορίζουν με όλη, στα πήρε προσοχή εταιρείες πω, ώς τον συνάδελφος διοικητικό δημιουργήσεις! Δούλευε επιτίθενται σας θα, με ένας παραγωγικής ένα, να ναι σημεία μέγιστη απαράδεκτη? - -Σας τεσσαρών συνεντεύξης τη, αρπάζεις σίγουρος μη για', επί τοπικές εντολές ακούσει θα? Ως δυστυχής μεταγλωτιστής όλη, να την είχαν σφάλμα απαραίτητο! Μην ώς άτομο διορθώσει χρησιμοποιούνταν. Δεν τα κόλπα πετάξαμε, μη που άγχος υόρκη άμεση, αφού δυστυχώς διακόψουμε όρο αν! Όλη μαγικά πετάνε επιδιορθώσεις δε, ροή φυσικά αποτελέσει πω. - -Άπειρα παραπάνω φαινόμενο πω ώρα, σαν πόρτες κρατήσουν συνηθίζουν ως. Κι ώρα τρέξει είχαμε εφαρμογή. Απλό σχεδιαστής μεταγλωτιστής ας επί, τις τα όταν έγραψες γραμμής? Όλα κάνεις συνάδελφος εργαζόμενοι θα, χαρτιού χαμηλός τα ροή. Ως ναι όροφο έρθει, μην πελάτες αποφάσισε μεταφραστής με, να βιαστικά εκδόσεις αναζήτησης λες. Των φταίει εκθέσεις προσπαθήσεις οι, σπίτι αποστηθίσει ας λες? - -Ώς που υπηρεσία απαραίτητο δημιουργείς. Μη άρα χαρά καθώς νύχτας, πω ματ μπουν είχαν. Άμεση δημιουργείς ώς ροή, γράψει γραμμής σίγουρος στα τι! Αν αφού πρώτοι εργαζόμενων ναί. - -Άμεση διορθώσεις με δύο? Έχουν παράδειγμα των θα, μου έρθει θυμάμαι περισσότερο το. Ότι θα αφού χρειάζονται περισσότερες. Σαν συνεχώς περίπου οι. - -Ώς πρώτης πετάξαμε λες, όρο κι πρώτες ζητήσεις δυστυχής. Ανά χρόνου διακοπή επιχειρηματίες ας, ώς μόλις άτομο χειρότερα όρο, κρατάει σχεδιαστής προσπαθήσεις νέο το. Πουλάς προσθέσει όλη πω, τύπου χαρακτηριστικό εγώ σε, πω πιο δούλευε αναζήτησης? Αναφορά δίνοντας σαν μη, μάθε δεδομένη εσωτερικών με ναι, αναφέρονται περιβάλλοντος ώρα αν. Και λέει απόλαυσε τα, που το όροφο προσπαθούν? - -Πάντα χρόνου χρήματα ναι το, σαν σωστά θυμάμαι σκεφτείς τα. Μα αποτελέσει ανεπιθύμητη την, πιο το τέτοιο ατόμου, τη των τρόπο εργαλείων επιδιόρθωσης. Περιβάλλον παραγωγικής σου κι, κλπ οι τύπου κακόκεφους αποστηθίσει, δε των πλέον τρόποι. Πιθανότητες χαρακτηριστικών σας κι, γραφικά δημιουργήσεις μια οι, πω πολλοί εξαρτάται προσεκτικά εδώ. Σταματάς παράγοντες για' ώς, στις ρωτάει το ναι! Καρέκλα ζητήσεις συνδυασμούς τη ήδη! - -Για μαγικά συνεχώς ακούσει το. Σταματάς προϊόντα βουτήξουν ώς ροή. Είχαν πρώτες οι ναι, μα λες αποστηθίσει ανακαλύπτεις. Όροφο άλγεβρα παραπάνω εδώ τη, πρόσληψη λαμβάνουν καταλάθος ήδη ας? Ως και εισαγωγή κρατήσουν, ένας κακόκεφους κι μας, όχι κώδικάς παίξουν πω. Πω νέα κρατάει εκφράσουν, τότε τελικών τη όχι, ας της τρέξει αλλάζοντας αποκλειστικούς. - -Ένας βιβλίο σε άρα, ναι ως γράψει ταξινομεί διορθώσεις! Εδώ να γεγονός συγγραφείς, ώς ήδη διακόψουμε επιχειρηματίες? Ότι πακέτων εσφαλμένη κι, θα όρο κόλπα παραγωγικής? Αν έχω κεντρικό υψηλότερη, κι δεν ίδιο πετάνε παρατηρούμενη! Που λοιπόν σημαντικό μα, προκαλείς χειροκροτήματα ως όλα, μα επί κόλπα άγχος γραμμές! Δε σου κάνεις βουτήξουν, μη έργων επενδυτής χρησιμοποίησέ στα, ως του πρώτες διάσημα σημαντικό. - -Βιβλίο τεράστιο προκύπτουν σαν το, σαν τρόπο επιδιόρθωση ας. Είχαν προσοχή προσπάθεια κι ματ, εδώ ως έτσι σελίδων συζήτηση. Και στην βγαίνει εσφαλμένη με, δυστυχής παράδειγμα δε μας, από σε υόρκη επιδιόρθωσης. Νέα πω νέου πιθανό, στήλες συγγραφείς μπαίνοντας μα για', το ρωτήσει κακόκεφους της? Μου σε αρέσει συγγραφής συγχωνευτεί, μη μου υόρκη ξέχασε διακοπής! Ώς επί αποφάσισε αποκλειστικούς χρησιμοποιώντας, χρήματα σελίδων ταξινομεί ναι με. - -Μη ανά γραμμή απόλαυσε, πω ναι μάτσο διασφαλίζεται. Τη έξι μόλις εργάστηκε δημιουργούν, έκδοση αναφορά δυσκολότερο οι νέο. Σας ως μπορούσε παράδειγμα, αν ότι δούλευε μπορούσε αποκλειστικούς, πιο λέει βουτήξουν διορθώσει ως. Έχω τελευταία κακόκεφους ας, όσο εργαζόμενων δημιουργήσεις τα. - -Του αν δουλέψει μπορούσε, πετούν χαμηλός εδώ ας? Κύκλο τύπους με που, δεν σε έχουν συνεχώς χειρότερα, τις τι απαράδεκτη συνηθίζουν? Θα μην τους αυτήν, τη ένα πήρε πακέτων, κι προκύπτουν περιβάλλον πως. Μα για δουλέψει απόλαυσε εφαμοργής, ώς εδώ σημαίνει μπορούσες, άμεση ακούσει προσοχή τη εδώ? - -Στα δώσε αθόρυβες λιγότερους οι, δε αναγκάζονται αποκλειστικούς όλα! Ας μπουν διοικητικό μια, πάντα ελέγχου διορθώσεις ώς τον. Ότι πήρε κανόνα μα. Που άτομα κάνεις δημιουργίες τα, οι μας αφού κόλπα προγραμματιστής, αφού ωραίο προκύπτουν στα ως. Θέμα χρησιμοποιήσει αν όλα, του τα άλγεβρα σελίδων. Τα ότι ανώδυνη δυστυχώς συνδυασμούς, μας οι πάντα γνωρίζουμε ανταγωνιστής, όχι τα δοκιμάσεις σχεδιαστής! Στην συνεντεύξης επιδιόρθωση πιο τα, μα από πουλάς περιβάλλον παραγωγικής. - -Έχουν μεταγλωτίσει σε σας, σε πάντα πρώτης μειώσει των, γράψει ρουτίνα δυσκολότερο ήδη μα? Ταξινομεί διορθώσεις να μας. Θα της προσπαθούν περιεχόμενα, δε έχω τοπικές στέλνοντάς. Ανά δε αλφα άμεση, κάποιο ρωτάει γνωρίζουμε πω στη, φράση μαγικά συνέχεια δε δύο! Αν είχαμε μειώσει ροή, μας μετράει καθυστερούσε επιδιορθώσεις μη. Χάος υόρκη κεντρικό έχω σε, ανά περίπου αναγκάζονται πω. - -Όσο επιστρέφουν χρονοδιαγράμματα μη. Πως ωραίο κακόκεφος διαχειριστής ως, τις να διακοπής αναζήτησης. Κάποιο ποσοστό ταξινομεί επί τη? Μάθε άμεση αλλάζοντας δύο με, μου νέου πάντα να. - -Πω του δυστυχώς πιθανότητες. Κι ρωτάει υψηλότερη δημιουργια ότι, πω εισαγωγή τελευταία απομόνωση ναι. Των ζητήσεις γνωρίζουμε ώς? Για' μη παραδοτέου αναφέρονται! Ύψος παραγωγικά ροή ως, φυσικά διάβασε εικόνες όσο σε? Δεν υόρκη διορθώσεις επεξεργασία θα, ως μέση σύστημα χρησιμοποιήσει τις. \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/two.txt b/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/two.txt deleted file mode 100644 index 2443fc4..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/two.txt +++ /dev/null @@ -1,3 +0,0 @@ -रखति आवश्यकत प्रेरना मुख्यतह हिंदी किएलोग असक्षम कार्यलय करते विवरण किके मानसिक दिनांक पुर्व संसाध एवम् कुशलता अमितकुमार प्रोत्साहित जनित देखने उदेशीत विकसित बलवान ब्रौशर किएलोग विश्लेषण लोगो कैसे जागरुक प्रव्रुति प्रोत्साहित सदस्य आवश्यकत प्रसारन उपलब्धता अथवा हिंदी जनित दर्शाता यन्त्रालय बलवान अतित सहयोग शुरुआत सभीकुछ माहितीवानीज्य लिये खरिदे है।अभी एकत्रित सम्पर्क रिती मुश्किल प्राथमिक भेदनक्षमता विश्व उन्हे गटको द्वारा तकरीबन - -विश्व द्वारा व्याख्या सके। आजपर वातावरण व्याख्यान पहोच। हमारी कीसे प्राथमिक विचारशिलता पुर्व करती कम्प्युटर भेदनक्षमता लिये बलवान और्४५० यायेका वार्तालाप सुचना भारत शुरुआत लाभान्वित पढाए संस्था वर्णित मार्गदर्शन चुनने \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/tests/_samples/files/data.txt b/vendor/swiftmailer/swiftmailer/tests/_samples/files/data.txt deleted file mode 100644 index 3f35021..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/_samples/files/data.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/tests/_samples/files/textfile.zip b/vendor/swiftmailer/swiftmailer/tests/_samples/files/textfile.zip deleted file mode 100644 index 5a580ecbf81ff98445bc5c6d0fce7a9a301f0e39..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 202 zcmWIWW@h1HU}9ikII%0tqR&rhgC39#!aNM33?-=*C25&Csd^<9C7~gl49w;G_PK*_ zXax(ySH`c5AsLy)3P4nlSX82rpQezg5L}*_R-)jW2-H=iP-db~oSUDWs!)skipUnless( - SWIFT_TMP_DIR, 'Cannot run test without a writable directory to use (' . - 'define SWIFT_TMP_DIR in tests/config.php if you wish to run this test)' - ); - } - - public function setUp() - { - $this->_tmpDir = SWIFT_TMP_DIR; - $this->_testFile = $this->_tmpDir . '/swift-test-file' . __CLASS__; - file_put_contents($this->_testFile, 'abcdefghijklm'); - } - - public function tearDown() - { - unlink($this->_testFile); - } - - public function testFileDataCanBeRead() - { - $file = $this->_createFileStream($this->_testFile); - $str = ''; - while (false !== $bytes = $file->read(8192)) { - $str .= $bytes; - } - $this->assertEqual('abcdefghijklm', $str); - } - - public function testFileDataCanBeReadSequentially() - { - $file = $this->_createFileStream($this->_testFile); - $this->assertEqual('abcde', $file->read(5)); - $this->assertEqual('fghijklm', $file->read(8)); - $this->assertFalse($file->read(1)); - } - - public function testFilenameIsReturned() - { - $file = $this->_createFileStream($this->_testFile); - $this->assertEqual($this->_testFile, $file->getPath()); - } - - public function testFileCanBeWrittenTo() - { - $file = $this->_createFileStream( - $this->_testFile, true - ); - $file->write('foobar'); - $this->assertEqual('foobar', $file->read(8192)); - } - - public function testReadingFromThenWritingToFile() - { - $file = $this->_createFileStream( - $this->_testFile, true - ); - $file->write('foobar'); - $this->assertEqual('foobar', $file->read(8192)); - $file->write('zipbutton'); - $this->assertEqual('zipbutton', $file->read(8192)); - } - - public function testWritingToFileWithCanonicalization() - { - $file = $this->_createFileStream( - $this->_testFile, true - ); - $file->addFilter($this->_createFilter(array("\r\n", "\r"), "\n"), 'allToLF'); - $file->write("foo\r\nbar\r"); - $file->write("\nzip\r\ntest\r"); - $file->flushBuffers(); - $this->assertEqual("foo\nbar\nzip\ntest\n", file_get_contents($this->_testFile)); - } - - public function testBindingOtherStreamsMirrorsWriteOperations() - { - $file = $this->_createFileStream( - $this->_testFile, true - ); - $is1 = $this->_createMockInputStream(); - $is2 = $this->_createMockInputStream(); - - $this->_checking(Expectations::create() - -> one($is1)->write('x') - -> one($is2)->write('x') - -> one($is1)->write('y') - -> one($is2)->write('y') - ); - - $file->bind($is1); - $file->bind($is2); - - $file->write('x'); - $file->write('y'); - } - - public function testBindingOtherStreamsMirrorsFlushOperations() - { - $file = $this->_createFileStream( - $this->_testFile, true - ); - $is1 = $this->_createMockInputStream(); - $is2 = $this->_createMockInputStream(); - - $this->_checking(Expectations::create() - -> one($is1)->flushBuffers() - -> one($is2)->flushBuffers() - ); - - $file->bind($is1); - $file->bind($is2); - - $file->flushBuffers(); - } - - public function testUnbindingStreamPreventsFurtherWrites() - { - $file = $this->_createFileStream( - $this->_testFile, true - ); - $is1 = $this->_createMockInputStream(); - $is2 = $this->_createMockInputStream(); - - $this->_checking(Expectations::create() - -> one($is1)->write('x') - -> one($is2)->write('x') - -> one($is1)->write('y') - ); - - $file->bind($is1); - $file->bind($is2); - - $file->write('x'); - - $file->unbind($is2); - - $file->write('y'); - } - - // -- Creation methods - - private function _createFilter($search, $replace) - { - return new Swift_StreamFilters_StringReplacementFilter($search, $replace); - } - - private function _createMockInputStream() - { - return $this->_mock('Swift_InputByteStream'); - } - - private function _createFileStream($file, $writable = false) - { - return new Swift_ByteStream_FileByteStream($file, $writable); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/CharacterReaderFactory/SimpleCharacterReaderFactoryAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/CharacterReaderFactory/SimpleCharacterReaderFactoryAcceptanceTest.php deleted file mode 100644 index c638337..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/CharacterReaderFactory/SimpleCharacterReaderFactoryAcceptanceTest.php +++ /dev/null @@ -1,183 +0,0 @@ -_factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - } - - public function testCreatingUtf8Reader() - { - foreach (array('utf8', 'utf-8', 'UTF-8', 'UTF8') as $utf8) { - $reader = $this->_factory->getReaderFor($utf8); - $this->assertIsA($reader, $this->_prefix . 'Utf8Reader'); - } - } - - public function testCreatingIso8859XReaders() - { - $charsets = array(); - foreach (range(1, 16) as $number) { - foreach (array('iso', 'iec') as $body) { - $charsets[] = $body . '-8859-' . $number; - $charsets[] = $body . '8859-' . $number; - $charsets[] = strtoupper($body) . '-8859-' . $number; - $charsets[] = strtoupper($body) . '8859-' . $number; - } - } - - foreach ($charsets as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertIsA($reader, $this->_prefix . 'GenericFixedWidthReader'); - $this->assertEqual(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingWindows125XReaders() - { - $charsets = array(); - foreach (range(0, 8) as $number) { - $charsets[] = 'windows-125' . $number; - $charsets[] = 'windows125' . $number; - $charsets[] = 'WINDOWS-125' . $number; - $charsets[] = 'WINDOWS125' . $number; - } - - foreach ($charsets as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertIsA($reader, $this->_prefix . 'GenericFixedWidthReader'); - $this->assertEqual(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingCodePageReaders() - { - $charsets = array(); - foreach (range(0, 8) as $number) { - $charsets[] = 'cp-125' . $number; - $charsets[] = 'cp125' . $number; - $charsets[] = 'CP-125' . $number; - $charsets[] = 'CP125' . $number; - } - - foreach (array(437, 737, 850, 855, 857, 858, 860, - 861, 863, 865, 866, 869) as $number) - { - $charsets[] = 'cp-' . $number; - $charsets[] = 'cp' . $number; - $charsets[] = 'CP-' . $number; - $charsets[] = 'CP' . $number; - } - - foreach ($charsets as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertIsA($reader, $this->_prefix . 'GenericFixedWidthReader'); - $this->assertEqual(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingAnsiReader() - { - foreach (array('ansi', 'ANSI') as $ansi) { - $reader = $this->_factory->getReaderFor($ansi); - $this->assertIsA($reader, $this->_prefix . 'GenericFixedWidthReader'); - $this->assertEqual(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingMacintoshReader() - { - foreach (array('macintosh', 'MACINTOSH') as $mac) { - $reader = $this->_factory->getReaderFor($mac); - $this->assertIsA($reader, $this->_prefix . 'GenericFixedWidthReader'); - $this->assertEqual(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingKOIReaders() - { - $charsets = array(); - foreach (array('7', '8-r', '8-u', '8u', '8r') as $end) { - $charsets[] = 'koi-' . $end; - $charsets[] = 'koi' . $end; - $charsets[] = 'KOI-' . $end; - $charsets[] = 'KOI' . $end; - } - - foreach ($charsets as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertIsA($reader, $this->_prefix . 'GenericFixedWidthReader'); - $this->assertEqual(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingIsciiReaders() - { - foreach (array('iscii', 'ISCII', 'viscii', 'VISCII') as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertIsA($reader, $this->_prefix . 'GenericFixedWidthReader'); - $this->assertEqual(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingMIKReader() - { - foreach (array('mik', 'MIK') as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertIsA($reader, $this->_prefix . 'GenericFixedWidthReader'); - $this->assertEqual(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingCorkReader() - { - foreach (array('cork', 'CORK', 't1', 'T1') as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertIsA($reader, $this->_prefix . 'GenericFixedWidthReader'); - $this->assertEqual(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingUcs2Reader() - { - foreach (array('ucs-2', 'UCS-2', 'ucs2', 'UCS2') as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertIsA($reader, $this->_prefix . 'GenericFixedWidthReader'); - $this->assertEqual(2, $reader->getInitialByteSize()); - } - } - - public function testCreatingUtf16Reader() - { - foreach (array('utf-16', 'UTF-16', 'utf16', 'UTF16') as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertIsA($reader, $this->_prefix . 'GenericFixedWidthReader'); - $this->assertEqual(2, $reader->getInitialByteSize()); - } - } - - public function testCreatingUcs4Reader() - { - foreach (array('ucs-4', 'UCS-4', 'ucs4', 'UCS4') as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertIsA($reader, $this->_prefix . 'GenericFixedWidthReader'); - $this->assertEqual(4, $reader->getInitialByteSize()); - } - } - - public function testCreatingUtf32Reader() - { - foreach (array('utf-32', 'UTF-32', 'utf32', 'UTF32') as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertIsA($reader, $this->_prefix . 'GenericFixedWidthReader'); - $this->assertEqual(4, $reader->getInitialByteSize()); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/DependencyContainerAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/DependencyContainerAcceptanceTest.php deleted file mode 100644 index 8efa4fd..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/DependencyContainerAcceptanceTest.php +++ /dev/null @@ -1,22 +0,0 @@ -listItems() as $itemName) { - try { - $di->lookup($itemName); - } catch (Swift_DependencyException $e) { - $this->fail($e->getMessage()); - } - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EmbeddedFileAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EmbeddedFileAcceptanceTest.php deleted file mode 100644 index 44a8e48..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EmbeddedFileAcceptanceTest.php +++ /dev/null @@ -1,13 +0,0 @@ -_samplesDir = realpath(dirname(__FILE__) . '/../../../_samples/charsets'); - $this->_encoder = new Swift_Encoder_Base64Encoder(); - } - - public function testEncodingAndDecodingSamples() - { - $sampleFp = opendir($this->_samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if (substr($encodingDir, 0, 1) == '.') { - continue; - } - - $sampleDir = $this->_samplesDir . '/' . $encodingDir; - - if (is_dir($sampleDir)) { - - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if (substr($sampleFile, 0, 1) == '.') { - continue; - } - - $text = file_get_contents($sampleDir . '/' . $sampleFile); - $encodedText = $this->_encoder->encodeString($text); - - $this->assertEqual( - base64_decode($encodedText), $text, - '%s: Encoded string should decode back to original string for sample ' . - $sampleDir . '/' . $sampleFile - ); - } - closedir($fileFp); - } - - } - closedir($sampleFp); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/QpEncoderAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/QpEncoderAcceptanceTest.php deleted file mode 100644 index 4406e1d..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/QpEncoderAcceptanceTest.php +++ /dev/null @@ -1,58 +0,0 @@ -_samplesDir = realpath(dirname(__FILE__) . '/../../../_samples/charsets'); - $this->_factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - } - - public function testEncodingAndDecodingSamples() - { - $sampleFp = opendir($this->_samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if (substr($encodingDir, 0, 1) == '.') { - continue; - } - - $encoding = $encodingDir; - $charStream = new Swift_CharacterStream_ArrayCharacterStream( - $this->_factory, $encoding); - $encoder = new Swift_Encoder_QpEncoder($charStream); - - $sampleDir = $this->_samplesDir . '/' . $encodingDir; - - if (is_dir($sampleDir)) { - - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if (substr($sampleFile, 0, 1) == '.') { - continue; - } - - $text = file_get_contents($sampleDir . '/' . $sampleFile); - $encodedText = $encoder->encodeString($text); - - $this->assertEqual( - quoted_printable_decode($encodedText), $text, - '%s: Encoded string should decode back to original string for sample ' . - $sampleDir . '/' . $sampleFile - ); - } - closedir($fileFp); - } - - } - closedir($sampleFp); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/Rfc2231EncoderAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/Rfc2231EncoderAcceptanceTest.php deleted file mode 100644 index 8c472b1..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/Rfc2231EncoderAcceptanceTest.php +++ /dev/null @@ -1,56 +0,0 @@ -_samplesDir = realpath(dirname(__FILE__) . '/../../../_samples/charsets'); - $this->_factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - } - - public function testEncodingAndDecodingSamples() - { - $sampleFp = opendir($this->_samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if (substr($encodingDir, 0, 1) == '.') { - continue; - } - - $encoding = $encodingDir; - $charStream = new Swift_CharacterStream_ArrayCharacterStream( - $this->_factory, $encoding); - $encoder = new Swift_Encoder_Rfc2231Encoder($charStream); - - $sampleDir = $this->_samplesDir . '/' . $encodingDir; - - if (is_dir($sampleDir)) { - - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if (substr($sampleFile, 0, 1) == '.') { - continue; - } - - $text = file_get_contents($sampleDir . '/' . $sampleFile); - $encodedText = $encoder->encodeString($text); - - $this->assertEqual( - urldecode(implode('', explode("\r\n", $encodedText))), $text, - '%s: Encoded string should decode back to original string for sample ' . - $sampleDir . '/' . $sampleFile - ); - } - closedir($fileFp); - } - - } - closedir($sampleFp); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EncodingAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EncodingAcceptanceTest.php deleted file mode 100644 index 9fa461a..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EncodingAcceptanceTest.php +++ /dev/null @@ -1,31 +0,0 @@ -assertEqual('7bit', $encoder->getName()); - } - - public function testGet8BitEncodingReturns8BitEncoder() - { - $encoder = Swift_Encoding::get8BitEncoding(); - $this->assertEqual('8bit', $encoder->getName()); - } - - public function testGetQpEncodingReturnsQpEncoder() - { - $encoder = Swift_Encoding::getQpEncoding(); - $this->assertEqual('quoted-printable', $encoder->getName()); - } - - public function testGetBase64EncodingReturnsBase64Encoder() - { - $encoder = Swift_Encoding::getBase64Encoding(); - $this->assertEqual('base64', $encoder->getName()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/ArrayKeyCacheAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/ArrayKeyCacheAcceptanceTest.php deleted file mode 100644 index da051f4..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/ArrayKeyCacheAcceptanceTest.php +++ /dev/null @@ -1,179 +0,0 @@ -_cache = new Swift_KeyCache_ArrayKeyCache( - new Swift_KeyCache_SimpleKeyCacheInputStream() - ); - } - - public function testStringDataCanBeSetAndFetched() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertEqual('test', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testStringDataCanBeOverwritten() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->_cache->setString( - $this->_key1, 'foo', 'whatever', Swift_KeyCache::MODE_WRITE - ); - $this->assertEqual('whatever', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testStringDataCanBeAppended() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->_cache->setString( - $this->_key1, 'foo', 'ing', Swift_KeyCache::MODE_APPEND - ); - $this->assertEqual('testing', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testHasKeyReturnValue() - { - $this->assertFalse($this->_cache->hasKey($this->_key1, 'foo')); - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($this->_cache->hasKey($this->_key1, 'foo')); - } - - public function testNsKeyIsWellPartitioned() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->_cache->setString( - $this->_key2, 'foo', 'ing', Swift_KeyCache::MODE_WRITE - ); - $this->assertEqual('test', $this->_cache->getString($this->_key1, 'foo')); - $this->assertEqual('ing', $this->_cache->getString($this->_key2, 'foo')); - } - - public function testItemKeyIsWellPartitioned() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->_cache->setString( - $this->_key1, 'bar', 'ing', Swift_KeyCache::MODE_WRITE - ); - $this->assertEqual('test', $this->_cache->getString($this->_key1, 'foo')); - $this->assertEqual('ing', $this->_cache->getString($this->_key1, 'bar')); - } - - public function testByteStreamCanBeImported() - { - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write('abcdef'); - - $this->_cache->importFromByteStream( - $this->_key1, 'foo', $os, Swift_KeyCache::MODE_WRITE - ); - $this->assertEqual('abcdef', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testByteStreamCanBeAppended() - { - $os1 = new Swift_ByteStream_ArrayByteStream(); - $os1->write('abcdef'); - - $os2 = new Swift_ByteStream_ArrayByteStream(); - $os2->write('xyzuvw'); - - $this->_cache->importFromByteStream( - $this->_key1, 'foo', $os1, Swift_KeyCache::MODE_APPEND - ); - $this->_cache->importFromByteStream( - $this->_key1, 'foo', $os2, Swift_KeyCache::MODE_APPEND - ); - - $this->assertEqual('abcdefxyzuvw', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testByteStreamAndStringCanBeAppended() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_APPEND - ); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write('abcdef'); - - $this->_cache->importFromByteStream( - $this->_key1, 'foo', $os, Swift_KeyCache::MODE_APPEND - ); - $this->assertEqual('testabcdef', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testDataCanBeExportedToByteStream() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - - $is = new Swift_ByteStream_ArrayByteStream(); - - $this->_cache->exportToByteStream($this->_key1, 'foo', $is); - - $string = ''; - while (false !== $bytes = $is->read(8192)) { - $string .= $bytes; - } - - $this->assertEqual('test', $string); - } - - public function testKeyCanBeCleared() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($this->_cache->hasKey($this->_key1, 'foo')); - $this->_cache->clearKey($this->_key1, 'foo'); - $this->assertFalse($this->_cache->hasKey($this->_key1, 'foo')); - } - - public function testNsKeyCanBeCleared() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->_cache->setString( - $this->_key1, 'bar', 'xyz', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($this->_cache->hasKey($this->_key1, 'foo')); - $this->assertTrue($this->_cache->hasKey($this->_key1, 'bar')); - $this->_cache->clearAll($this->_key1); - $this->assertFalse($this->_cache->hasKey($this->_key1, 'foo')); - $this->assertFalse($this->_cache->hasKey($this->_key1, 'bar')); - } - - public function testKeyCacheInputStream() - { - $is = $this->_cache->getInputByteStream($this->_key1, 'foo'); - $is->write('abc'); - $is->write('xyz'); - $this->assertEqual('abcxyz', $this->_cache->getString($this->_key1, 'foo')); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/DiskKeyCacheAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/DiskKeyCacheAcceptanceTest.php deleted file mode 100644 index a3a37c1..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/DiskKeyCacheAcceptanceTest.php +++ /dev/null @@ -1,189 +0,0 @@ -skipUnless( - SWIFT_TMP_DIR, 'Cannot run test without a writable directory to use (' . - 'define SWIFT_TMP_DIR in tests/config.php if you wish to run this test)' - ); - } - - public function setUp() - { - $this->_key1 = uniqid(microtime(true), true); - $this->_key2 = uniqid(microtime(true), true); - $this->_cache = new Swift_KeyCache_DiskKeyCache( - new Swift_KeyCache_SimpleKeyCacheInputStream(), - SWIFT_TMP_DIR - ); - } - - public function testStringDataCanBeSetAndFetched() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertEqual('test', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testStringDataCanBeOverwritten() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->_cache->setString( - $this->_key1, 'foo', 'whatever', Swift_KeyCache::MODE_WRITE - ); - $this->assertEqual('whatever', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testStringDataCanBeAppended() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->_cache->setString( - $this->_key1, 'foo', 'ing', Swift_KeyCache::MODE_APPEND - ); - $this->assertEqual('testing', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testHasKeyReturnValue() - { - $this->assertFalse($this->_cache->hasKey($this->_key1, 'foo')); - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($this->_cache->hasKey($this->_key1, 'foo')); - } - - public function testNsKeyIsWellPartitioned() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->_cache->setString( - $this->_key2, 'foo', 'ing', Swift_KeyCache::MODE_WRITE - ); - $this->assertEqual('test', $this->_cache->getString($this->_key1, 'foo')); - $this->assertEqual('ing', $this->_cache->getString($this->_key2, 'foo')); - } - - public function testItemKeyIsWellPartitioned() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->_cache->setString( - $this->_key1, 'bar', 'ing', Swift_KeyCache::MODE_WRITE - ); - $this->assertEqual('test', $this->_cache->getString($this->_key1, 'foo')); - $this->assertEqual('ing', $this->_cache->getString($this->_key1, 'bar')); - } - - public function testByteStreamCanBeImported() - { - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write('abcdef'); - - $this->_cache->importFromByteStream( - $this->_key1, 'foo', $os, Swift_KeyCache::MODE_WRITE - ); - $this->assertEqual('abcdef', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testByteStreamCanBeAppended() - { - $os1 = new Swift_ByteStream_ArrayByteStream(); - $os1->write('abcdef'); - - $os2 = new Swift_ByteStream_ArrayByteStream(); - $os2->write('xyzuvw'); - - $this->_cache->importFromByteStream( - $this->_key1, 'foo', $os1, Swift_KeyCache::MODE_APPEND - ); - $this->_cache->importFromByteStream( - $this->_key1, 'foo', $os2, Swift_KeyCache::MODE_APPEND - ); - - $this->assertEqual('abcdefxyzuvw', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testByteStreamAndStringCanBeAppended() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_APPEND - ); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write('abcdef'); - - $this->_cache->importFromByteStream( - $this->_key1, 'foo', $os, Swift_KeyCache::MODE_APPEND - ); - $this->assertEqual('testabcdef', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testDataCanBeExportedToByteStream() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - - $is = new Swift_ByteStream_ArrayByteStream(); - - $this->_cache->exportToByteStream($this->_key1, 'foo', $is); - - $string = ''; - while (false !== $bytes = $is->read(8192)) { - $string .= $bytes; - } - - $this->assertEqual('test', $string); - } - - public function testKeyCanBeCleared() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($this->_cache->hasKey($this->_key1, 'foo')); - $this->_cache->clearKey($this->_key1, 'foo'); - $this->assertFalse($this->_cache->hasKey($this->_key1, 'foo')); - } - - public function testNsKeyCanBeCleared() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->_cache->setString( - $this->_key1, 'bar', 'xyz', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($this->_cache->hasKey($this->_key1, 'foo')); - $this->assertTrue($this->_cache->hasKey($this->_key1, 'bar')); - $this->_cache->clearAll($this->_key1); - $this->assertFalse($this->_cache->hasKey($this->_key1, 'foo')); - $this->assertFalse($this->_cache->hasKey($this->_key1, 'bar')); - } - - public function testKeyCacheInputStream() - { - $is = $this->_cache->getInputByteStream($this->_key1, 'foo'); - $is->write('abc'); - $is->write('xyz'); - $this->assertEqual('abcxyz', $this->_cache->getString($this->_key1, 'foo')); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MessageAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MessageAcceptanceTest.php deleted file mode 100644 index 25f451c..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MessageAcceptanceTest.php +++ /dev/null @@ -1,57 +0,0 @@ -_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn')); - - $id = $message->getId(); - $date = $message->getDate(); - $boundary = $message->getBoundary(); - - $message->addPart('foo', 'text/plain', 'iso-8859-1'); - $message->addPart('test foo', 'text/html', 'iso-8859-1'); - - $this->assertEqual( - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris Corbyn ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: multipart/alternative;' . "\r\n" . - ' boundary="' . $boundary . '"' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: text/plain; charset=iso-8859-1' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'foo' . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: text/html; charset=iso-8859-1' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'test foo' . - "\r\n\r\n" . - '--' . $boundary . '--' . "\r\n", - $message->toString() - ); - } - - // -- Private helpers - - protected function _createMessage() - { - Swift_DependencyContainer::getInstance() - ->register('properties.charset')->asValue(null); - return Swift_Message::newInstance(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/AttachmentAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/AttachmentAcceptanceTest.php deleted file mode 100644 index d4e0500..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/AttachmentAcceptanceTest.php +++ /dev/null @@ -1,136 +0,0 @@ -_cache = new Swift_KeyCache_ArrayKeyCache( - new Swift_KeyCache_SimpleKeyCacheInputStream() - ); - $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - $this->_contentEncoder = new Swift_Mime_ContentEncoder_Base64ContentEncoder(); - - $headerEncoder = new Swift_Mime_HeaderEncoder_QpHeaderEncoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') - ); - $paramEncoder = new Swift_Encoder_Rfc2231Encoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') - ); - $this->_grammar = new Swift_Mime_Grammar(); - $this->_headers = new Swift_Mime_SimpleHeaderSet( - new Swift_Mime_SimpleHeaderFactory($headerEncoder, $paramEncoder, $this->_grammar) - ); - } - - public function testDispositionIsSetInHeader() - { - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setDisposition('inline'); - $this->assertEqual( - 'Content-Type: application/pdf' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: inline' . "\r\n", - $attachment->toString() - ); - } - - public function testDispositionIsAttachmentByDefault() - { - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $this->assertEqual( - 'Content-Type: application/pdf' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: attachment' . "\r\n", - $attachment->toString() - ); - } - - public function testFilenameIsSetInHeader() - { - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $this->assertEqual( - 'Content-Type: application/pdf; name=foo.pdf' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: attachment; filename=foo.pdf' . "\r\n", - $attachment->toString() - ); - } - - public function testSizeIsSetInHeader() - { - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setSize(12340); - $this->assertEqual( - 'Content-Type: application/pdf' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: attachment; size=12340' . "\r\n", - $attachment->toString() - ); - } - - public function testMultipleParametersInHeader() - { - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setSize(12340); - $this->assertEqual( - 'Content-Type: application/pdf; name=foo.pdf' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: attachment; filename=foo.pdf; size=12340' . "\r\n", - $attachment->toString() - ); - } - - public function testEndToEnd() - { - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setSize(12340); - $attachment->setBody('abcd'); - $this->assertEqual( - 'Content-Type: application/pdf; name=foo.pdf' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: attachment; filename=foo.pdf; size=12340' . "\r\n" . - "\r\n" . - base64_encode('abcd'), - $attachment->toString() - ); - } - - // -- Private helpers - - protected function _createAttachment() - { - $entity = new Swift_Mime_Attachment( - $this->_headers, - $this->_contentEncoder, - $this->_cache, - $this->_grammar - ); - return $entity; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/Base64ContentEncoderAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/Base64ContentEncoderAcceptanceTest.php deleted file mode 100644 index 03ad0f7..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/Base64ContentEncoderAcceptanceTest.php +++ /dev/null @@ -1,62 +0,0 @@ -_samplesDir = realpath(dirname(__FILE__) . '/../../../../_samples/charsets'); - $this->_encoder = new Swift_Mime_ContentEncoder_Base64ContentEncoder(); - } - - public function testEncodingAndDecodingSamples() - { - $sampleFp = opendir($this->_samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if (substr($encodingDir, 0, 1) == '.') { - continue; - } - - $sampleDir = $this->_samplesDir . '/' . $encodingDir; - - if (is_dir($sampleDir)) { - - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if (substr($sampleFile, 0, 1) == '.') { - continue; - } - - $text = file_get_contents($sampleDir . '/' . $sampleFile); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write($text); - - $is = new Swift_ByteStream_ArrayByteStream(); - - $this->_encoder->encodeByteStream($os, $is); - - $encoded = ''; - while (false !== $bytes = $is->read(8192)) { - $encoded .= $bytes; - } - - $this->assertEqual( - base64_decode($encoded), $text, - '%s: Encoded string should decode back to original string for sample ' . - $sampleDir . '/' . $sampleFile - ); - } - closedir($fileFp); - } - - } - closedir($sampleFp); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/NativeQpContentEncoderAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/NativeQpContentEncoderAcceptanceTest.php deleted file mode 100644 index 9ec4300..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/NativeQpContentEncoderAcceptanceTest.php +++ /dev/null @@ -1,94 +0,0 @@ -_samplesDir = realpath(dirname(__FILE__) . '/../../../../_samples/charsets'); - $this->_encoder = new Swift_Mime_ContentEncoder_NativeQpContentEncoder(); - } - - public function testEncodingAndDecodingSamples() - { - $sampleFp = opendir($this->_samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if (substr($encodingDir, 0, 1) == '.') { - continue; - } - - $sampleDir = $this->_samplesDir . '/' . $encodingDir; - - if (is_dir($sampleDir)) { - - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if (substr($sampleFile, 0, 1) == '.') { - continue; - } - - $text = file_get_contents($sampleDir . '/' . $sampleFile); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write($text); - - $is = new Swift_ByteStream_ArrayByteStream(); - $this->_encoder->encodeByteStream($os, $is); - - $encoded = ''; - while (false !== $bytes = $is->read(8192)) { - $encoded .= $bytes; - } - - $this->assertEqual( - quoted_printable_decode($encoded), $text, - '%s: Encoded string should decode back to original string for sample ' . - $sampleDir . '/' . $sampleFile - ); - } - closedir($fileFp); - } - - } - closedir($sampleFp); - - } - - public function testEncodingAndDecodingSamplesFromDiConfiguredInstance() - { - $encoder = $this->_createEncoderFromContainer(); - $this->assertSame('=C3=A4=C3=B6=C3=BC=C3=9F', $encoder->encodeString('äöüß')); - } - - public function testCharsetChangeNotImplemented() - { - $this->_encoder->charsetChanged('utf-8'); - $this->expectException(new RuntimeException('Charset "charset" not supported. NativeQpContentEncoder only supports "utf-8"')); - $this->_encoder->charsetChanged('charset'); - } - - public function testGetName() - { - $this->assertSame('quoted-printable', $this->_encoder->getName()); - } - - // -- Private Methods - - private function _createEncoderFromContainer() - { - return Swift_DependencyContainer::getInstance() - ->lookup('mime.nativeqpcontentencoder') - ; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/PlainContentEncoderAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/PlainContentEncoderAcceptanceTest.php deleted file mode 100644 index 103bbf4..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/PlainContentEncoderAcceptanceTest.php +++ /dev/null @@ -1,96 +0,0 @@ -_samplesDir = realpath(dirname(__FILE__) . '/../../../../_samples/charsets'); - $this->_encoder = new Swift_Mime_ContentEncoder_PlainContentEncoder('8bit'); - } - - public function testEncodingAndDecodingSamplesString() - { - $sampleFp = opendir($this->_samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if (substr($encodingDir, 0, 1) == '.') { - continue; - } - - $sampleDir = $this->_samplesDir . '/' . $encodingDir; - - if (is_dir($sampleDir)) { - - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if (substr($sampleFile, 0, 1) == '.') { - continue; - } - - $text = file_get_contents($sampleDir . '/' . $sampleFile); - $encodedText = $this->_encoder->encodeString($text); - - $this->assertEqual( - $encodedText, $text, - '%s: Encoded string should be identical to original string for sample ' . - $sampleDir . '/' . $sampleFile - ); - } - closedir($fileFp); - } - - } - closedir($sampleFp); - } - - public function testEncodingAndDecodingSamplesByteStream() - { - $sampleFp = opendir($this->_samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if (substr($encodingDir, 0, 1) == '.') { - continue; - } - - $sampleDir = $this->_samplesDir . '/' . $encodingDir; - - if (is_dir($sampleDir)) { - - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if (substr($sampleFile, 0, 1) == '.') { - continue; - } - - $text = file_get_contents($sampleDir . '/' . $sampleFile); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write($text); - - $is = new Swift_ByteStream_ArrayByteStream(); - - $this->_encoder->encodeByteStream($os, $is); - - $encoded = ''; - while (false !== $bytes = $is->read(8192)) { - $encoded .= $bytes; - } - - $this->assertEqual( - $encoded, $text, - '%s: Encoded string should be identical to original string for sample ' . - $sampleDir . '/' . $sampleFile - ); - } - closedir($fileFp); - } - - } - closedir($sampleFp); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/QpContentEncoderAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/QpContentEncoderAcceptanceTest.php deleted file mode 100644 index 1373fd3..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/QpContentEncoderAcceptanceTest.php +++ /dev/null @@ -1,170 +0,0 @@ -_samplesDir = realpath(dirname(__FILE__) . '/../../../../_samples/charsets'); - $this->_factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - } - - public function testEncodingAndDecodingSamples() - { - $sampleFp = opendir($this->_samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if (substr($encodingDir, 0, 1) == '.') { - continue; - } - - $encoding = $encodingDir; - $charStream = new Swift_CharacterStream_NgCharacterStream( - $this->_factory, $encoding); - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - - $sampleDir = $this->_samplesDir . '/' . $encodingDir; - - if (is_dir($sampleDir)) { - - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if (substr($sampleFile, 0, 1) == '.') { - continue; - } - - $text = file_get_contents($sampleDir . '/' . $sampleFile); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write($text); - - $is = new Swift_ByteStream_ArrayByteStream(); - $encoder->encodeByteStream($os, $is); - - $encoded = ''; - while (false !== $bytes = $is->read(8192)) { - $encoded .= $bytes; - } - - $this->assertEqual( - quoted_printable_decode($encoded), $text, - '%s: Encoded string should decode back to original string for sample ' . - $sampleDir . '/' . $sampleFile - ); - } - closedir($fileFp); - } - - } - closedir($sampleFp); - } - - public function testEncodingAndDecodingSamplesFromDiConfiguredInstance() - { - $sampleFp = opendir($this->_samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if (substr($encodingDir, 0, 1) == '.') { - continue; - } - - $encoding = $encodingDir; - $encoder = $this->_createEncoderFromContainer(); - - $sampleDir = $this->_samplesDir . '/' . $encodingDir; - - if (is_dir($sampleDir)) { - - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if (substr($sampleFile, 0, 1) == '.') { - continue; - } - - $text = file_get_contents($sampleDir . '/' . $sampleFile); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write($text); - - $is = new Swift_ByteStream_ArrayByteStream(); - $encoder->encodeByteStream($os, $is); - - $encoded = ''; - while (false !== $bytes = $is->read(8192)) { - $encoded .= $bytes; - } - - $this->assertEqual( - str_replace("\r\n", "\n", quoted_printable_decode($encoded)), str_replace("\r\n", "\n", $text), - '%s: Encoded string should decode back to original string for sample ' . - $sampleDir . '/' . $sampleFile - ); - } - closedir($fileFp); - } - - } - closedir($sampleFp); - } - - public function testEncodingLFTextWithDiConfiguredInstance() - { - $encoder = $this->_createEncoderFromContainer(); - $this->assertEqual("a\r\nb\r\nc", $encoder->encodeString("a\nb\nc")); - } - - public function testEncodingCRTextWithDiConfiguredInstance() - { - $encoder = $this->_createEncoderFromContainer(); - $this->assertEqual("a\r\nb\r\nc", $encoder->encodeString("a\rb\rc")); - } - - public function testEncodingLFCRTextWithDiConfiguredInstance() - { - $encoder = $this->_createEncoderFromContainer(); - $this->assertEqual("a\r\n\r\nb\r\n\r\nc", $encoder->encodeString("a\n\rb\n\rc")); - } - - public function testEncodingCRLFTextWithDiConfiguredInstance() - { - $encoder = $this->_createEncoderFromContainer(); - $this->assertEqual("a\r\nb\r\nc", $encoder->encodeString("a\r\nb\r\nc")); - } - - public function testEncodingDotStuffingWithDiConfiguredInstance() - { - // Enable DotEscaping - Swift_Preferences::getInstance()->setQPDotEscape(true); - $encoder = $this->_createEncoderFromContainer(); - $this->assertEqual("a=2E\r\n=2E\r\n=2Eb\r\nc", $encoder->encodeString("a.\r\n.\r\n.b\r\nc")); - // Return to default - Swift_Preferences::getInstance()->setQPDotEscape(false); - $encoder = $this->_createEncoderFromContainer(); - $this->assertEqual("a.\r\n.\r\n.b\r\nc", $encoder->encodeString("a.\r\n.\r\n.b\r\nc")); - } - - public function testDotStuffingEncodingAndDecodingSamplesFromDiConfiguredInstance() - { - // Enable DotEscaping - Swift_Preferences::getInstance()->setQPDotEscape(true); - $this->testEncodingAndDecodingSamplesFromDiConfiguredInstance(); - // Disable DotStuffing to continue - Swift_Preferences::getInstance()->setQPDotEscape(false); - } - - // -- Private Methods - - private function _createEncoderFromContainer() - { - return Swift_DependencyContainer::getInstance() - ->lookup('mime.qpcontentencoder') - ; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/EmbeddedFileAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/EmbeddedFileAcceptanceTest.php deleted file mode 100644 index 7aaf48f..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/EmbeddedFileAcceptanceTest.php +++ /dev/null @@ -1,149 +0,0 @@ -_cache = new Swift_KeyCache_ArrayKeyCache( - new Swift_KeyCache_SimpleKeyCacheInputStream() - ); - $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - $this->_contentEncoder = new Swift_Mime_ContentEncoder_Base64ContentEncoder(); - - $headerEncoder = new Swift_Mime_HeaderEncoder_QpHeaderEncoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') - ); - $paramEncoder = new Swift_Encoder_Rfc2231Encoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') - ); - $this->_grammar = new Swift_Mime_Grammar(); - $this->_headers = new Swift_Mime_SimpleHeaderSet( - new Swift_Mime_SimpleHeaderFactory($headerEncoder, $paramEncoder, $this->_grammar) - ); - } - - public function testContentIdIsSetInHeader() - { - $file = $this->_createEmbeddedFile(); - $file->setContentType('application/pdf'); - $file->setId('foo@bar'); - $this->assertEqual( - 'Content-Type: application/pdf' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: inline' . "\r\n" . - 'Content-ID: ' . "\r\n", - $file->toString() - ); - } - - public function testDispositionIsSetInHeader() - { - $file = $this->_createEmbeddedFile(); - $id = $file->getId(); - $file->setContentType('application/pdf'); - $file->setDisposition('attachment'); - $this->assertEqual( - 'Content-Type: application/pdf' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: attachment' . "\r\n" . - 'Content-ID: <'. $id . '>' . "\r\n", - $file->toString() - ); - } - - public function testFilenameIsSetInHeader() - { - $file = $this->_createEmbeddedFile(); - $id = $file->getId(); - $file->setContentType('application/pdf'); - $file->setFilename('foo.pdf'); - $this->assertEqual( - 'Content-Type: application/pdf; name=foo.pdf' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: inline; filename=foo.pdf' . "\r\n" . - 'Content-ID: <'. $id . '>' . "\r\n", - $file->toString() - ); - } - - public function testSizeIsSetInHeader() - { - $file = $this->_createEmbeddedFile(); - $id = $file->getId(); - $file->setContentType('application/pdf'); - $file->setSize(12340); - $this->assertEqual( - 'Content-Type: application/pdf' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: inline; size=12340' . "\r\n" . - 'Content-ID: <'. $id . '>' . "\r\n", - $file->toString() - ); - } - - public function testMultipleParametersInHeader() - { - $file = $this->_createEmbeddedFile(); - $id = $file->getId(); - $file->setContentType('application/pdf'); - $file->setFilename('foo.pdf'); - $file->setSize(12340); - $this->assertEqual( - 'Content-Type: application/pdf; name=foo.pdf' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: inline; filename=foo.pdf; size=12340' . "\r\n" . - 'Content-ID: <'. $id . '>' . "\r\n", - $file->toString() - ); - } - - public function testEndToEnd() - { - $file = $this->_createEmbeddedFile(); - $id = $file->getId(); - $file->setContentType('application/pdf'); - $file->setFilename('foo.pdf'); - $file->setSize(12340); - $file->setBody('abcd'); - $this->assertEqual( - 'Content-Type: application/pdf; name=foo.pdf' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: inline; filename=foo.pdf; size=12340' . "\r\n" . - 'Content-ID: <'. $id . '>' . "\r\n" . - "\r\n" . - base64_encode('abcd'), - $file->toString() - ); - } - - // -- Private helpers - - protected function _createEmbeddedFile() - { - $entity = new Swift_Mime_EmbeddedFile( - $this->_headers, - $this->_contentEncoder, - $this->_cache, - $this->_grammar - ); - return $entity; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/HeaderEncoder/Base64HeaderEncoderAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/HeaderEncoder/Base64HeaderEncoderAcceptanceTest.php deleted file mode 100644 index 4f3411c..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/HeaderEncoder/Base64HeaderEncoderAcceptanceTest.php +++ /dev/null @@ -1,37 +0,0 @@ -_encoder = new Swift_Mime_HeaderEncoder_Base64HeaderEncoder(); - } - - public function testEncodingJIS() - { - if (function_exists('mb_convert_encoding')) { - // base64_encode and split cannot handle long JIS text to fold - $subject = "長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い件名"; - - $encodedWrapperLength = strlen('=?iso-2022-jp?' . $this->_encoder->getName() . '??='); - - $old = mb_internal_encoding(); - mb_internal_encoding('utf-8'); - $newstring = mb_encode_mimeheader($subject, 'iso-2022-jp', 'B', "\r\n"); - mb_internal_encoding($old); - - $encoded = $this->_encoder->encodeString($subject, 0, 75 - $encodedWrapperLength, 'iso-2022-jp'); - $this->assertEqual( - $encoded, $newstring, - 'Encoded string should decode back to original string for sample ' - ); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/MimePartAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/MimePartAcceptanceTest.php deleted file mode 100644 index fa679d2..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/MimePartAcceptanceTest.php +++ /dev/null @@ -1,142 +0,0 @@ -_cache = new Swift_KeyCache_ArrayKeyCache( - new Swift_KeyCache_SimpleKeyCacheInputStream() - ); - $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - $this->_contentEncoder = new Swift_Mime_ContentEncoder_QpContentEncoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'), - new Swift_StreamFilters_ByteArrayReplacementFilter( - array(array(0x0D, 0x0A), array(0x0D), array(0x0A)), - array(array(0x0A), array(0x0A), array(0x0D, 0x0A)) - ) - ); - - $headerEncoder = new Swift_Mime_HeaderEncoder_QpHeaderEncoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') - ); - $paramEncoder = new Swift_Encoder_Rfc2231Encoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') - ); - $this->_grammar = new Swift_Mime_Grammar(); - $this->_headers = new Swift_Mime_SimpleHeaderSet( - new Swift_Mime_SimpleHeaderFactory($headerEncoder, $paramEncoder, $this->_grammar) - ); - } - - public function testCharsetIsSetInHeader() - { - $part = $this->_createMimePart(); - $part->setContentType('text/plain'); - $part->setCharset('utf-8'); - $part->setBody('foobar'); - $this->assertEqual( - 'Content-Type: text/plain; charset=utf-8' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'foobar', - $part->toString() - ); - } - - public function testFormatIsSetInHeaders() - { - $part = $this->_createMimePart(); - $part->setContentType('text/plain'); - $part->setFormat('flowed'); - $part->setBody('> foobar'); - $this->assertEqual( - 'Content-Type: text/plain; format=flowed' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - '> foobar', - $part->toString() - ); - } - - public function testDelSpIsSetInHeaders() - { - $part = $this->_createMimePart(); - $part->setContentType('text/plain'); - $part->setDelSp(true); - $part->setBody('foobar'); - $this->assertEqual( - 'Content-Type: text/plain; delsp=yes' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'foobar', - $part->toString() - ); - } - - public function testAll3ParamsInHeaders() - { - $part = $this->_createMimePart(); - $part->setContentType('text/plain'); - $part->setCharset('utf-8'); - $part->setFormat('fixed'); - $part->setDelSp(true); - $part->setBody('foobar'); - $this->assertEqual( - 'Content-Type: text/plain; charset=utf-8; format=fixed; delsp=yes' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'foobar', - $part->toString() - ); - } - - public function testBodyIsCanonicalized() - { - $part = $this->_createMimePart(); - $part->setContentType('text/plain'); - $part->setCharset('utf-8'); - $part->setBody("foobar\r\rtest\ning\r"); - $this->assertEqual( - 'Content-Type: text/plain; charset=utf-8' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - "foobar\r\n" . - "\r\n" . - "test\r\n" . - "ing\r\n", - $part->toString() - ); - } - - // -- Private helpers - - protected function _createMimePart() - { - $entity = new Swift_Mime_MimePart( - $this->_headers, - $this->_contentEncoder, - $this->_cache, - $this->_grammar - ); - return $entity; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/SimpleMessageAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/SimpleMessageAcceptanceTest.php deleted file mode 100644 index 87e4db8..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/SimpleMessageAcceptanceTest.php +++ /dev/null @@ -1,1254 +0,0 @@ -setCharset(null); //TODO: Test with the charset defined - } - - public function testBasicHeaders() - { - /* -- RFC 2822, 3.6. - */ - - $message = $this->_createMessage(); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'From: ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString(), - '%s: Only required headers, and non-empty headers should be displayed' - ); - } - - public function testSubjectIsDisplayedIfSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testDateCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $id = $message->getId(); - $message->setDate(1234); - $this->assertEqual( - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', 1234) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testMessageIdCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setId('foo@bar'); - $date = $message->getDate(); - $this->assertEqual( - 'Message-ID: ' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testContentTypeCanBeChanged() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setContentType('text/html'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/html' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testCharsetCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setContentType('text/html'); - $message->setCharset('iso-8859-1'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/html; charset=iso-8859-1' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testFormatCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFormat('flowed'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain; format=flowed' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testEncoderCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setContentType('text/html'); - $message->setEncoder( - new Swift_Mime_ContentEncoder_PlainContentEncoder('7bit') - ); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/html' . "\r\n" . - 'Content-Transfer-Encoding: 7bit' . "\r\n", - $message->toString() - ); - } - - public function testFromAddressCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom('chris.corbyn@swiftmailer.org'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: chris.corbyn@swiftmailer.org' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testFromAddressCanBeSetWithName() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array('chris.corbyn@swiftmailer.org' => 'Chris Corbyn')); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris Corbyn ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testMultipleFromAddressesCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' - )); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris Corbyn , mark@swiftmailer.org' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testReturnPathAddressCanBeSet() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn')); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Return-Path: ' . "\r\n" . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris Corbyn ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testEmptyReturnPathHeaderCanBeUsed() - { - $message = $this->_createMessage(); - $message->setReturnPath(''); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn')); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Return-Path: <>' . "\r\n" . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris Corbyn ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testSenderCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setSender('chris.corbyn@swiftmailer.org'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Sender: chris.corbyn@swiftmailer.org' . "\r\n" . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testSenderCanBeSetWithName() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setSender(array('chris.corbyn@swiftmailer.org'=>'Chris')); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Sender: Chris ' . "\r\n" . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testReplyToCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array('chris.corbyn@swiftmailer.org'=>'Chris')); - $message->setReplyTo(array('chris@w3style.co.uk'=>'Myself')); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris ' . "\r\n" . - 'Reply-To: Myself ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testMultipleReplyAddressCanBeUsed() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array('chris.corbyn@swiftmailer.org'=>'Chris')); - $message->setReplyTo(array( - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me' - )); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris ' . "\r\n" . - 'Reply-To: Myself , Me ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testToAddressCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array('chris.corbyn@swiftmailer.org'=>'Chris')); - $message->setReplyTo(array( - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me' - )); - $message->setTo('mark@swiftmailer.org'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris ' . "\r\n" . - 'Reply-To: Myself , Me ' . "\r\n" . - 'To: mark@swiftmailer.org' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testMultipleToAddressesCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array('chris.corbyn@swiftmailer.org'=>'Chris')); - $message->setReplyTo(array( - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me' - )); - $message->setTo(array( - 'mark@swiftmailer.org', 'chris@swiftmailer.org' => 'Chris Corbyn' - )); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris ' . "\r\n" . - 'Reply-To: Myself , Me ' . "\r\n" . - 'To: mark@swiftmailer.org, Chris Corbyn ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testCcAddressCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array('chris.corbyn@swiftmailer.org'=>'Chris')); - $message->setReplyTo(array( - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me' - )); - $message->setTo(array( - 'mark@swiftmailer.org', 'chris@swiftmailer.org' => 'Chris Corbyn' - )); - $message->setCc('john@some-site.com'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris ' . "\r\n" . - 'Reply-To: Myself , Me ' . "\r\n" . - 'To: mark@swiftmailer.org, Chris Corbyn ' . "\r\n" . - 'Cc: john@some-site.com' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testMultipleCcAddressesCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array('chris.corbyn@swiftmailer.org'=>'Chris')); - $message->setReplyTo(array( - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me' - )); - $message->setTo(array( - 'mark@swiftmailer.org', 'chris@swiftmailer.org' => 'Chris Corbyn' - )); - $message->setCc(array( - 'john@some-site.com' => 'John West', - 'fred@another-site.co.uk' => 'Big Fred' - )); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris ' . "\r\n" . - 'Reply-To: Myself , Me ' . "\r\n" . - 'To: mark@swiftmailer.org, Chris Corbyn ' . "\r\n" . - 'Cc: John West , Big Fred ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testBccAddressCanBeSet() - { - //Obviously Transports need to setBcc(array()) and send to each Bcc recipient - // separately in accordance with RFC 2822/2821 - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array('chris.corbyn@swiftmailer.org'=>'Chris')); - $message->setReplyTo(array( - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me' - )); - $message->setTo(array( - 'mark@swiftmailer.org', 'chris@swiftmailer.org' => 'Chris Corbyn' - )); - $message->setCc(array( - 'john@some-site.com' => 'John West', - 'fred@another-site.co.uk' => 'Big Fred' - )); - $message->setBcc('x@alphabet.tld'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris ' . "\r\n" . - 'Reply-To: Myself , Me ' . "\r\n" . - 'To: mark@swiftmailer.org, Chris Corbyn ' . "\r\n" . - 'Cc: John West , Big Fred ' . "\r\n" . - 'Bcc: x@alphabet.tld' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testMultipleBccAddressesCanBeSet() - { - //Obviously Transports need to setBcc(array()) and send to each Bcc recipient - // separately in accordance with RFC 2822/2821 - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array('chris.corbyn@swiftmailer.org'=>'Chris')); - $message->setReplyTo(array( - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me' - )); - $message->setTo(array( - 'mark@swiftmailer.org', 'chris@swiftmailer.org' => 'Chris Corbyn' - )); - $message->setCc(array( - 'john@some-site.com' => 'John West', - 'fred@another-site.co.uk' => 'Big Fred' - )); - $message->setBcc(array('x@alphabet.tld', 'a@alphabet.tld' => 'A')); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris ' . "\r\n" . - 'Reply-To: Myself , Me ' . "\r\n" . - 'To: mark@swiftmailer.org, Chris Corbyn ' . "\r\n" . - 'Cc: John West , Big Fred ' . "\r\n" . - 'Bcc: x@alphabet.tld, A ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString() - ); - } - - public function testStringBodyIsAppended() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn')); - $message->setBody( - 'just a test body' . "\r\n" . - 'with a new line' - ); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Return-Path: ' . "\r\n" . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris Corbyn ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'just a test body' . "\r\n" . - 'with a new line', - $message->toString() - ); - } - - public function testStringBodyIsEncoded() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn')); - $message->setBody( - 'Just s' . pack('C*', 0xC2, 0x01, 0x01) . 'me multi-' . "\r\n" . - 'line message!' - ); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Return-Path: ' . "\r\n" . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris Corbyn ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'Just s=C2=01=01me multi-' . "\r\n" . - 'line message!', - $message->toString() - ); - } - - public function testChildrenCanBeAttached() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn')); - - $id = $message->getId(); - $date = $message->getDate(); - $boundary = $message->getBoundary(); - - $part1 = $this->_createMimePart(); - $part1->setContentType('text/plain'); - $part1->setCharset('iso-8859-1'); - $part1->setBody('foo'); - - $message->attach($part1); - - $part2 = $this->_createMimePart(); - $part2->setContentType('text/html'); - $part2->setCharset('iso-8859-1'); - $part2->setBody('test foo'); - - $message->attach($part2); - - $this->assertEqual( - 'Return-Path: ' . "\r\n" . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris Corbyn ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: multipart/alternative;' . "\r\n" . - ' boundary="' . $boundary . '"' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: text/plain; charset=iso-8859-1' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'foo' . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: text/html; charset=iso-8859-1' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'test foo' . - "\r\n\r\n" . - '--' . $boundary . '--' . "\r\n", - $message->toString() - ); - } - - public function testAttachmentsBeingAttached() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn')); - - $id = $message->getId(); - $date = preg_quote(date('r', $message->getDate()), '~'); - $boundary = $message->getBoundary(); - - $part = $this->_createMimePart(); - $part->setContentType('text/plain'); - $part->setCharset('iso-8859-1'); - $part->setBody('foo'); - - $message->attach($part); - - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setBody(''); - - $message->attach($attachment); - - $this->assertPattern( - '~^' . - 'Return-Path: ' . "\r\n" . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . $date . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris Corbyn ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: multipart/mixed;' . "\r\n" . - ' boundary="' . $boundary . '"' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: multipart/alternative;' . "\r\n" . - ' boundary="(.*?)"' . "\r\n" . - "\r\n\r\n" . - '--\\1' . "\r\n" . - 'Content-Type: text/plain; charset=iso-8859-1' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'foo' . - "\r\n\r\n" . - '--\\1--' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: application/pdf; name=foo.pdf' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: attachment; filename=foo.pdf' . "\r\n" . - "\r\n" . - preg_quote(base64_encode(''), '~') . - "\r\n\r\n" . - '--' . $boundary . '--' . "\r\n" . - '$~D', - $message->toString() - ); - } - - public function testAttachmentsAndEmbeddedFilesBeingAttached() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn')); - - $id = $message->getId(); - $date = preg_quote(date('r', $message->getDate()), '~'); - $boundary = $message->getBoundary(); - - $part = $this->_createMimePart(); - $part->setContentType('text/plain'); - $part->setCharset('iso-8859-1'); - $part->setBody('foo'); - - $message->attach($part); - - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setBody(''); - - $message->attach($attachment); - - $file = $this->_createEmbeddedFile(); - $file->setContentType('image/jpeg'); - $file->setFilename('myimage.jpg'); - $file->setBody(''); - - $message->attach($file); - - $cid = $file->getId(); - - $this->assertPattern( - '~^' . - 'Return-Path: ' . "\r\n" . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . $date . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris Corbyn ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: multipart/mixed;' . "\r\n" . - ' boundary="' . $boundary . '"' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: multipart/alternative;' . "\r\n" . - ' boundary="(.*?)"' . "\r\n" . - "\r\n\r\n" . - '--\\1' . "\r\n" . - 'Content-Type: text/plain; charset=iso-8859-1' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'foo' . - - "\r\n\r\n" . - '--\\1' . "\r\n" . - 'Content-Type: multipart/related;' . "\r\n" . - ' boundary="(.*?)"' . "\r\n" . - "\r\n\r\n" . - '--\\2' . "\r\n" . - 'Content-Type: image/jpeg; name=myimage.jpg' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: inline; filename=myimage.jpg' . "\r\n" . - 'Content-ID: <' . $cid . '>' . "\r\n" . - "\r\n" . - preg_quote(base64_encode(''), '~') . - "\r\n\r\n" . - '--\\2--' . "\r\n" . - "\r\n\r\n" . - '--\\1--' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: application/pdf; name=foo.pdf' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: attachment; filename=foo.pdf' . "\r\n" . - "\r\n" . - preg_quote(base64_encode(''), '~') . - "\r\n\r\n" . - '--' . $boundary . '--' . "\r\n" . - '$~D', - $message->toString() - ); - } - - public function testComplexEmbeddingOfContent() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn')); - - $id = $message->getId(); - $date = preg_quote(date('r', $message->getDate()), '~'); - $boundary = $message->getBoundary(); - - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setBody(''); - - $message->attach($attachment); - - $file = $this->_createEmbeddedFile(); - $file->setContentType('image/jpeg'); - $file->setFilename('myimage.jpg'); - $file->setBody(''); - - $part = $this->_createMimePart(); - $part->setContentType('text/html'); - $part->setCharset('iso-8859-1'); - $part->setBody('foo '); - - $message->attach($part); - - $cid = $file->getId(); - - $this->assertPattern( - '~^' . - 'Return-Path: ' . "\r\n" . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . $date . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris Corbyn ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: multipart/mixed;' . "\r\n" . - ' boundary="' . $boundary . '"' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: multipart/related;' . "\r\n" . - ' boundary="(.*?)"' . "\r\n" . - "\r\n\r\n" . - '--\\1' . "\r\n" . - 'Content-Type: text/html; charset=iso-8859-1' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'foo ' . //=3D is just = in QP - "\r\n\r\n" . - '--\\1' . "\r\n" . - 'Content-Type: image/jpeg; name=myimage.jpg' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: inline; filename=myimage.jpg' . "\r\n" . - 'Content-ID: <' . $cid . '>' . "\r\n" . - "\r\n" . - preg_quote(base64_encode(''), '~') . - "\r\n\r\n" . - '--\\1--' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: application/pdf; name=foo.pdf' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: attachment; filename=foo.pdf' . "\r\n" . - "\r\n" . - preg_quote(base64_encode(''), '~') . - "\r\n\r\n" . - '--' . $boundary . '--' . "\r\n" . - '$~D', - $message->toString() - ); - } - - public function testAttachingAndDetachingContent() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn')); - - $id = $message->getId(); - $date = preg_quote(date('r', $message->getDate()), '~'); - $boundary = $message->getBoundary(); - - $part = $this->_createMimePart(); - $part->setContentType('text/plain'); - $part->setCharset('iso-8859-1'); - $part->setBody('foo'); - - $message->attach($part); - - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setBody(''); - - $message->attach($attachment); - - $file = $this->_createEmbeddedFile(); - $file->setContentType('image/jpeg'); - $file->setFilename('myimage.jpg'); - $file->setBody(''); - - $message->attach($file); - - $cid = $file->getId(); - - $message->detach($attachment); - - $this->assertPattern( - '~^' . - 'Return-Path: ' . "\r\n" . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . $date . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris Corbyn ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: multipart/alternative;' . "\r\n" . - ' boundary="' . $boundary . '"' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: text/plain; charset=iso-8859-1' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'foo' . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: multipart/related;' . "\r\n" . - ' boundary="(.*?)"' . "\r\n" . - "\r\n\r\n" . - '--\\1' . "\r\n" . - 'Content-Type: image/jpeg; name=myimage.jpg' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: inline; filename=myimage.jpg' . "\r\n" . - 'Content-ID: <' . $cid . '>' . "\r\n" . - "\r\n" . - preg_quote(base64_encode(''), '~') . - "\r\n\r\n" . - '--\\1--' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . '--' . "\r\n" . - '$~D', - $message->toString(), - '%s: Attachment should have been detached' - ); - } - - public function testBoundaryDoesNotAppearAfterAllPartsAreDetached() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn')); - - $id = $message->getId(); - $date = $message->getDate(); - $boundary = $message->getBoundary(); - - $part1 = $this->_createMimePart(); - $part1->setContentType('text/plain'); - $part1->setCharset('iso-8859-1'); - $part1->setBody('foo'); - - $message->attach($part1); - - $part2 = $this->_createMimePart(); - $part2->setContentType('text/html'); - $part2->setCharset('iso-8859-1'); - $part2->setBody('test foo'); - - $message->attach($part2); - - $message->detach($part1); - $message->detach($part2); - - $this->assertEqual( - 'Return-Path: ' . "\r\n" . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris Corbyn ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n", - $message->toString(), - '%s: Message should be restored to orignal state after parts are detached' - ); - } - - public function testCharsetFormatOrDelSpAreNotShownWhenBoundaryIsSet() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn')); - $message->setCharset('utf-8'); - $message->setFormat('flowed'); - $message->setDelSp(true); - - $id = $message->getId(); - $date = $message->getDate(); - $boundary = $message->getBoundary(); - - $part1 = $this->_createMimePart(); - $part1->setContentType('text/plain'); - $part1->setCharset('iso-8859-1'); - $part1->setBody('foo'); - - $message->attach($part1); - - $part2 = $this->_createMimePart(); - $part2->setContentType('text/html'); - $part2->setCharset('iso-8859-1'); - $part2->setBody('test foo'); - - $message->attach($part2); - - $this->assertEqual( - 'Return-Path: ' . "\r\n" . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris Corbyn ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: multipart/alternative;' . "\r\n" . - ' boundary="' . $boundary . '"' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: text/plain; charset=iso-8859-1' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'foo' . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: text/html; charset=iso-8859-1' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'test foo' . - "\r\n\r\n" . - '--' . $boundary . '--' . "\r\n", - $message->toString() - ); - } - - public function testBodyCanBeSetWithAttachments() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn')); - $message->setContentType('text/html'); - $message->setCharset('iso-8859-1'); - $message->setBody('foo'); - - $id = $message->getId(); - $date = date('r', $message->getDate()); - $boundary = $message->getBoundary(); - - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setBody(''); - - $message->attach($attachment); - - $this->assertEqual( - 'Return-Path: ' . "\r\n" . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . $date . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris Corbyn ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: multipart/mixed;' . "\r\n" . - ' boundary="' . $boundary . '"' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: text/html; charset=iso-8859-1' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'foo' . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: application/pdf; name=foo.pdf' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: attachment; filename=foo.pdf' . "\r\n" . - "\r\n" . - base64_encode('') . - "\r\n\r\n" . - '--' . $boundary . '--' . "\r\n", - $message->toString() - ); - } - - public function testHtmlPartAlwaysAppearsLast() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn')); - - $id = $message->getId(); - $date = date('r', $message->getDate()); - $boundary = $message->getBoundary(); - - $part1 = $this->_createMimePart(); - $part1->setContentType('text/html'); - $part1->setBody('foo'); - - $part2 = $this->_createMimePart(); - $part2->setContentType('text/plain'); - $part2->setBody('bar'); - - $message->attach($part1); - $message->attach($part2); - - $this->assertEqual( - 'Return-Path: ' . "\r\n" . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . $date . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris Corbyn ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: multipart/alternative;' . "\r\n" . - ' boundary="' . $boundary . '"' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'bar' . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: text/html' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'foo' . - "\r\n\r\n" . - '--' . $boundary . '--' . "\r\n", - $message->toString() - ); - } - - public function testBodyBecomesPartIfOtherPartsAttached() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn')); - $message->setContentType('text/html'); - $message->setBody('foo'); - - $id = $message->getId(); - $date = date('r', $message->getDate()); - $boundary = $message->getBoundary(); - - $part2 = $this->_createMimePart(); - $part2->setContentType('text/plain'); - $part2->setBody('bar'); - - $message->attach($part2); - - $this->assertEqual( - 'Return-Path: ' . "\r\n" . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . $date . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris Corbyn ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: multipart/alternative;' . "\r\n" . - ' boundary="' . $boundary . '"' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'bar' . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: text/html' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'foo' . - "\r\n\r\n" . - '--' . $boundary . '--' . "\r\n", - $message->toString() - ); - } - - public function testBodyIsCanonicalized() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn')); - $message->setBody( - 'just a test body' . "\n" . - 'with a new line' - ); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEqual( - 'Return-Path: ' . "\r\n" . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . date('r', $date) . "\r\n" . - 'Subject: just a test subject' . "\r\n" . - 'From: Chris Corbyn ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: text/plain' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'just a test body' . "\r\n" . - 'with a new line', - $message->toString() - ); - } - - // -- Private helpers - - protected function _createMessage() - { - return new Swift_Message(); - } - - protected function _createMimePart() - { - return new Swift_MimePart(); - } - - protected function _createAttachment() - { - return new Swift_Attachment(); - } - - protected function _createEmbeddedFile() - { - return new Swift_EmbeddedFile(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MimePartAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MimePartAcceptanceTest.php deleted file mode 100644 index 3e10791..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MimePartAcceptanceTest.php +++ /dev/null @@ -1,14 +0,0 @@ -register('properties.charset')->asValue(null); - return Swift_MimePart::newInstance(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/AbstractStreamBufferAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/AbstractStreamBufferAcceptanceTest.php deleted file mode 100644 index 7b6c726..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/AbstractStreamBufferAcceptanceTest.php +++ /dev/null @@ -1,122 +0,0 @@ -_buffer = new Swift_Transport_StreamBuffer( - $this->_stub('Swift_ReplacementFilterFactory') - ); - } - - public function testReadLine() - { - $this->_initializeBuffer(); - - $line = $this->_buffer->readLine(0); - $this->assertPattern('/^[0-9]{3}.*?\r\n$/D', $line); - $seq = $this->_buffer->write("QUIT\r\n"); - $this->assertTrue($seq); - $line = $this->_buffer->readLine($seq); - $this->assertPattern('/^[0-9]{3}.*?\r\n$/D', $line); - $this->_buffer->terminate(); - } - - public function testWrite() - { - $this->_initializeBuffer(); - - $line = $this->_buffer->readLine(0); - $this->assertPattern('/^[0-9]{3}.*?\r\n$/D', $line); - - $seq = $this->_buffer->write("HELO foo\r\n"); - $this->assertTrue($seq); - $line = $this->_buffer->readLine($seq); - $this->assertPattern('/^[0-9]{3}.*?\r\n$/D', $line); - - $seq = $this->_buffer->write("QUIT\r\n"); - $this->assertTrue($seq); - $line = $this->_buffer->readLine($seq); - $this->assertPattern('/^[0-9]{3}.*?\r\n$/D', $line); - $this->_buffer->terminate(); - } - - public function testBindingOtherStreamsMirrorsWriteOperations() - { - $this->_initializeBuffer(); - - $is1 = $this->_createMockInputStream(); - $is2 = $this->_createMockInputStream(); - - $this->_checking(Expectations::create() - -> one($is1)->write('x') - -> one($is2)->write('x') - -> one($is1)->write('y') - -> one($is2)->write('y') - ); - - $this->_buffer->bind($is1); - $this->_buffer->bind($is2); - - $this->_buffer->write('x'); - $this->_buffer->write('y'); - } - - public function testBindingOtherStreamsMirrorsFlushOperations() - { - $this->_initializeBuffer(); - - $is1 = $this->_createMockInputStream(); - $is2 = $this->_createMockInputStream(); - - $this->_checking(Expectations::create() - -> one($is1)->flushBuffers() - -> one($is2)->flushBuffers() - ); - - $this->_buffer->bind($is1); - $this->_buffer->bind($is2); - - $this->_buffer->flushBuffers(); - } - - public function testUnbindingStreamPreventsFurtherWrites() - { - $this->_initializeBuffer(); - - $is1 = $this->_createMockInputStream(); - $is2 = $this->_createMockInputStream(); - - $this->_checking(Expectations::create() - -> one($is1)->write('x') - -> one($is2)->write('x') - -> one($is1)->write('y') - ); - - $this->_buffer->bind($is1); - $this->_buffer->bind($is2); - - $this->_buffer->write('x'); - - $this->_buffer->unbind($is2); - - $this->_buffer->write('y'); - } - - // -- Creation Methods - - private function _createMockInputStream() - { - return $this->_mock('Swift_InputByteStream'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/BasicSocketAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/BasicSocketAcceptanceTest.php deleted file mode 100644 index 364e353..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/BasicSocketAcceptanceTest.php +++ /dev/null @@ -1,31 +0,0 @@ -skipUnless(SWIFT_SMTP_HOST, - 'Cannot run test without an SMTP host to connect to (define ' . - 'SWIFT_SMTP_HOST in tests/acceptance.conf.php if you wish to run this test)' - ); - } - - protected function _initializeBuffer() - { - $parts = explode(':', SWIFT_SMTP_HOST); - $host = $parts[0]; - $port = isset($parts[1]) ? $parts[1] : 25; - - $this->_buffer->initialize(array( - 'type' => Swift_Transport_IoBuffer::TYPE_SOCKET, - 'host' => $host, - 'port' => $port, - 'protocol' => 'tcp', - 'blocking' => 1, - 'timeout' => 15 - )); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php deleted file mode 100644 index a108ba2..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php +++ /dev/null @@ -1,23 +0,0 @@ -skipIf(!SWIFT_SENDMAIL_PATH, - 'Cannot run test without a path to sendmail (define ' . - 'SWIFT_SENDMAIL_PATH in tests/acceptance.conf.php if you wish to run this test)' - ); - } - - protected function _initializeBuffer() - { - $this->_buffer->initialize(array( - 'type' => Swift_Transport_IoBuffer::TYPE_PROCESS, - 'command' => SWIFT_SENDMAIL_PATH . ' -bs' - )); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SocketTimeoutTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SocketTimeoutTest.php deleted file mode 100644 index 93fb74a..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SocketTimeoutTest.php +++ /dev/null @@ -1,72 +0,0 @@ -_buffer = new Swift_Transport_StreamBuffer( - $this->_stub('Swift_ReplacementFilterFactory') - ); - } - - public function skip() - { - $serverStarted=false; - for ($i=0; $i<5; ++$i) { - $this->_randomHighPort=rand(50000,65000); - $this->_server = stream_socket_server('tcp://127.0.0.1:' . $this->_randomHighPort); - if ($this->_server) { - $serverStarted=true; - } - } - $this->skipUnless(SWIFT_SMTP_HOST, - 'Cannot run test without an SMTP host to connect to (define ' . - 'SWIFT_SMTP_HOST in tests/acceptance.conf.php if you wish to run this test)' - ); - } - - protected function _initializeBuffer() - { - $host = '127.0.0.1'; - $port = $this->_randomHighPort; - - $this->_buffer->initialize(array( - 'type' => Swift_Transport_IoBuffer::TYPE_SOCKET, - 'host' => $host, - 'port' => $port, - 'protocol' => 'tcp', - 'blocking' => 1, - 'timeout' => 1 - )); - } - - public function testTimeoutException() - { - $this->_initializeBuffer(); - $e=null; - try { - $line = $this->_buffer->readLine(0); - } catch (Exception $e) { - } - $this->assertIsA($e, 'Swift_IoException', 'IO Exception Not Thrown On Connection Timeout'); - $this->assertPattern('/Connection to .* Timed Out/', $e->getMessage()); - } - - public function tearDown() - { - if ($this->_server) { - stream_socket_shutdown($this->_server, STREAM_SHUT_RDWR); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SslSocketAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SslSocketAcceptanceTest.php deleted file mode 100644 index 4dea91c..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SslSocketAcceptanceTest.php +++ /dev/null @@ -1,35 +0,0 @@ -skipIf(!in_array('ssl', $streams), - 'SSL is not configured for your system. It is not possible to run this test' - ); - $this->skipIf(!SWIFT_SSL_HOST, - 'Cannot run test without an SSL enabled SMTP host to connect to (define ' . - 'SWIFT_SSL_HOST in tests/acceptance.conf.php if you wish to run this test)' - ); - } - - protected function _initializeBuffer() - { - $parts = explode(':', SWIFT_SSL_HOST); - $host = $parts[0]; - $port = isset($parts[1]) ? $parts[1] : 25; - - $this->_buffer->initialize(array( - 'type' => Swift_Transport_IoBuffer::TYPE_SOCKET, - 'host' => $host, - 'port' => $port, - 'protocol' => 'ssl', - 'blocking' => 1, - 'timeout' => 15 - )); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/TlsSocketAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/TlsSocketAcceptanceTest.php deleted file mode 100644 index b1e38d7..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/TlsSocketAcceptanceTest.php +++ /dev/null @@ -1,35 +0,0 @@ -skipIf(!in_array('tls', $streams), - 'TLS is not configured for your system. It is not possible to run this test' - ); - $this->skipIf(!SWIFT_TLS_HOST, - 'Cannot run test without a TLS enabled SMTP host to connect to (define ' . - 'SWIFT_TLS_HOST in tests/acceptance.conf.php if you wish to run this test)' - ); - } - - protected function _initializeBuffer() - { - $parts = explode(':', SWIFT_TLS_HOST); - $host = $parts[0]; - $port = isset($parts[1]) ? $parts[1] : 25; - - $this->_buffer->initialize(array( - 'type' => Swift_Transport_IoBuffer::TYPE_SOCKET, - 'host' => $host, - 'port' => $port, - 'protocol' => 'tls', - 'blocking' => 1, - 'timeout' => 15 - )); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug111Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug111Test.php deleted file mode 100644 index 1afb64c..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug111Test.php +++ /dev/null @@ -1,44 +0,0 @@ - array( - 'email1@example.com', - 'email2@example.com', - 'email3@example.com', - 'email4@example.com', - 'email5@example.com', - ), - 'sub' => array( - '-name-' => array( - 'email1', - '"email2"', - 'email3\\', - 'email4', - 'email5', - ), - '-url-' => array( - 'http://google.com', - 'http://yahoo.com', - 'http://hotmail.com', - 'http://aol.com', - 'http://facebook.com', - ), - ) - ); - $json = json_encode($complicated_header); - - $message = new Swift_Message(); - $headers = $message->getHeaders(); - $headers->addTextHeader('X-SMTPAPI', $json); - $header = $headers->get('X-SMTPAPI'); - - $this->assertEqual('Swift_Mime_Headers_UnstructuredHeader', get_class($header)); - $this->assertEqual($json, $header->getFieldBody()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug118Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug118Test.php deleted file mode 100644 index 0800a00..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug118Test.php +++ /dev/null @@ -1,22 +0,0 @@ -_message = new Swift_Message(); - } - - public function testCallingGenerateIdChangesTheMessageId() - { - $currentId = $this->_message->getId(); - $this->_message->generateId(); - $newId = $this->_message->getId(); - - $this->assertNotEqual($currentId, $newId); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug206Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug206Test.php deleted file mode 100644 index 8833eb2..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug206Test.php +++ /dev/null @@ -1,40 +0,0 @@ -_factory = new Swift_Mime_SimpleHeaderFactory($headerEncoder, $paramEncoder, $grammar); - } - - public function testMailboxHeaderEncoding() - { - $this->_testHeaderIsFullyEncoded('email@example.org', 'Family Name, Name', ' "Family Name, Name" '); - $this->_testHeaderIsFullyEncoded('email@example.org', 'Family Namé, Name', ' Family =?utf-8?Q?Nam=C3=A9=2C?= Name'); - $this->_testHeaderIsFullyEncoded('email@example.org', 'Family Namé , Name', ' Family =?utf-8?Q?Nam=C3=A9_=2C?= Name'); - $this->_testHeaderIsFullyEncoded('email@example.org', 'Family Namé ;Name', ' Family =?utf-8?Q?Nam=C3=A9_=3BName?= '); - } - - private function _testHeaderIsFullyEncoded($email, $name, $expected) - { - $mailboxHeader = $this->_factory->createMailboxHeader('To', array( - $email => $name - )); - - $headerBody = substr($mailboxHeader->toString(), 3, strlen($expected)); - - $this->assertEqual($expected, $headerBody); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug34Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug34Test.php deleted file mode 100644 index c87bd78..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug34Test.php +++ /dev/null @@ -1,77 +0,0 @@ -setCharset('utf-8'); - } - - public function testEmbeddedFilesWithMultipartDataCreateMultipartRelatedContentAsAnAlternative() - { - $message = Swift_Message::newInstance(); - $message->setCharset('utf-8'); - $message->setSubject('test subject'); - $message->addPart('plain part', 'text/plain'); - - $image = Swift_Image::newInstance('', 'image.gif', 'image/gif'); - $cid = $message->embed($image); - - $message->setBody('', 'text/html'); - - $message->setTo(array('user@domain.tld' => 'User')); - - $message->setFrom(array('other@domain.tld' => 'Other')); - $message->setSender(array('other@domain.tld' => 'Other')); - - $id = $message->getId(); - $date = preg_quote(date('r', $message->getDate()), '~'); - $boundary = $message->getBoundary(); - $cidVal = $image->getId(); - - $this->assertPattern( - '~^' . - 'Sender: Other ' . "\r\n" . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . $date . "\r\n" . - 'Subject: test subject' . "\r\n" . - 'From: Other ' . "\r\n" . - 'To: User ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: multipart/alternative;' . "\r\n" . - ' boundary="' . $boundary . '"' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: text/plain; charset=utf-8' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'plain part' . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: multipart/related;' . "\r\n" . - ' boundary="(.*?)"' . "\r\n" . - "\r\n\r\n" . - '--\\1' . "\r\n" . - 'Content-Type: text/html; charset=utf-8' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - '' . - "\r\n\r\n" . - '--\\1' . "\r\n" . - 'Content-Type: image/gif; name=image.gif' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: inline; filename=image.gif' . "\r\n" . - 'Content-ID: <' . $cidVal . '>' . "\r\n" . - "\r\n" . - preg_quote(base64_encode(''), '~') . - "\r\n\r\n" . - '--\\1--' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . '--' . "\r\n" . - '$~D', - $message->toString() - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug35Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug35Test.php deleted file mode 100644 index 5138790..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug35Test.php +++ /dev/null @@ -1,75 +0,0 @@ -setCharset('utf-8'); - } - - public function testHTMLPartAppearsLastEvenWhenAttachmentsAdded() - { - $message = Swift_Message::newInstance(); - $message->setCharset('utf-8'); - $message->setSubject('test subject'); - $message->addPart('plain part', 'text/plain'); - - $attachment = Swift_Attachment::newInstance('', 'image.gif', 'image/gif'); - $message->attach($attachment); - - $message->setBody('HTML part', 'text/html'); - - $message->setTo(array('user@domain.tld' => 'User')); - - $message->setFrom(array('other@domain.tld' => 'Other')); - $message->setSender(array('other@domain.tld' => 'Other')); - - $id = $message->getId(); - $date = preg_quote(date('r', $message->getDate()), '~'); - $boundary = $message->getBoundary(); - - $this->assertPattern( - '~^' . - 'Sender: Other ' . "\r\n" . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . $date . "\r\n" . - 'Subject: test subject' . "\r\n" . - 'From: Other ' . "\r\n" . - 'To: User ' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: multipart/mixed;' . "\r\n" . - ' boundary="' . $boundary . '"' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: multipart/alternative;' . "\r\n" . - ' boundary="(.*?)"' . "\r\n" . - "\r\n\r\n" . - '--\\1' . "\r\n" . - 'Content-Type: text/plain; charset=utf-8' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'plain part' . - "\r\n\r\n" . - '--\\1' . "\r\n" . - 'Content-Type: text/html; charset=utf-8' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'HTML part' . - "\r\n\r\n" . - '--\\1--' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: image/gif; name=image.gif' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: attachment; filename=image.gif' . "\r\n" . - "\r\n" . - preg_quote(base64_encode(''), '~') . - "\r\n\r\n" . - '--' . $boundary . '--' . "\r\n" . - '$~D', - $message->toString() - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug38Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug38Test.php deleted file mode 100644 index d28b8eb..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug38Test.php +++ /dev/null @@ -1,196 +0,0 @@ -_attFileName = 'data.txt'; - $this->_attFileType = 'text/plain'; - $this->_attFile = dirname(__FILE__) . '/../../_samples/files/data.txt'; - Swift_Preferences::getInstance()->setCharset('utf-8'); - } - - public function testWritingMessageToByteStreamProducesCorrectStructure() - { - $message = new Swift_Message(); - $message->setSubject('test subject'); - $message->setTo('user@domain.tld'); - $message->setCc('other@domain.tld'); - $message->setFrom('user@domain.tld'); - - $image = new Swift_Image('', 'image.gif', 'image/gif'); - - $cid = $message->embed($image); - $message->setBody('HTML part', 'text/html'); - - $id = $message->getId(); - $date = preg_quote(date('r', $message->getDate()), '~'); - $boundary = $message->getBoundary(); - $imgId = $image->getId(); - - $stream = new Swift_ByteStream_ArrayByteStream(); - - $message->toByteStream($stream); - - $this->assertPatternInStream( - '~^' . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . $date . "\r\n" . - 'Subject: test subject' . "\r\n" . - 'From: user@domain.tld' . "\r\n" . - 'To: user@domain.tld' . "\r\n" . - 'Cc: other@domain.tld' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: multipart/related;' . "\r\n" . - ' boundary="' . $boundary . '"' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: text/html; charset=utf-8' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'HTML part' . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: image/gif; name=image.gif' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: inline; filename=image.gif' . "\r\n" . - 'Content-ID: <' . preg_quote($imgId, '~') . '>' . "\r\n" . - "\r\n" . - preg_quote(base64_encode(''), '~') . - "\r\n\r\n" . - '--' . $boundary . '--' . "\r\n" . - '$~D', - $stream - ); - } - - public function testWritingMessageToByteStreamTwiceProducesCorrectStructure() - { - $message = new Swift_Message(); - $message->setSubject('test subject'); - $message->setTo('user@domain.tld'); - $message->setCc('other@domain.tld'); - $message->setFrom('user@domain.tld'); - - $image = new Swift_Image('', 'image.gif', 'image/gif'); - - $cid = $message->embed($image); - $message->setBody('HTML part', 'text/html'); - - $id = $message->getId(); - $date = preg_quote(date('r', $message->getDate()), '~'); - $boundary = $message->getBoundary(); - $imgId = $image->getId(); - - $pattern = '~^' . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . $date . "\r\n" . - 'Subject: test subject' . "\r\n" . - 'From: user@domain.tld' . "\r\n" . - 'To: user@domain.tld' . "\r\n" . - 'Cc: other@domain.tld' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: multipart/related;' . "\r\n" . - ' boundary="' . $boundary . '"' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: text/html; charset=utf-8' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'HTML part' . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: image/gif; name=image.gif' . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: inline; filename=image.gif' . "\r\n" . - 'Content-ID: <' . preg_quote($imgId, '~') . '>' . "\r\n" . - "\r\n" . - preg_quote(base64_encode(''), '~') . - "\r\n\r\n" . - '--' . $boundary . '--' . "\r\n" . - '$~D' - ; - - $streamA = new Swift_ByteStream_ArrayByteStream(); - $streamB = new Swift_ByteStream_ArrayByteStream(); - - $message->toByteStream($streamA); - $message->toByteStream($streamB); - - $this->assertPatternInStream($pattern, $streamA); - $this->assertPatternInStream($pattern, $streamB); - } - - public function testWritingMessageToByteStreamTwiceUsingAFileAttachment() - { - $message = new Swift_Message(); - $message->setSubject('test subject'); - $message->setTo('user@domain.tld'); - $message->setCc('other@domain.tld'); - $message->setFrom('user@domain.tld'); - - $attachment = Swift_Attachment::fromPath($this->_attFile); - - $message->attach($attachment); - - $message->setBody('HTML part', 'text/html'); - - $id = $message->getId(); - $date = preg_quote(date('r', $message->getDate()), '~'); - $boundary = $message->getBoundary(); - - $streamA = new Swift_ByteStream_ArrayByteStream(); - $streamB = new Swift_ByteStream_ArrayByteStream(); - - $pattern = '~^' . - 'Message-ID: <' . $id . '>' . "\r\n" . - 'Date: ' . $date . "\r\n" . - 'Subject: test subject' . "\r\n" . - 'From: user@domain.tld' . "\r\n" . - 'To: user@domain.tld' . "\r\n" . - 'Cc: other@domain.tld' . "\r\n" . - 'MIME-Version: 1.0' . "\r\n" . - 'Content-Type: multipart/mixed;' . "\r\n" . - ' boundary="' . $boundary . '"' . "\r\n" . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: text/html; charset=utf-8' . "\r\n" . - 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . - "\r\n" . - 'HTML part' . - "\r\n\r\n" . - '--' . $boundary . "\r\n" . - 'Content-Type: ' . $this->_attFileType . '; name=' . $this->_attFileName . "\r\n" . - 'Content-Transfer-Encoding: base64' . "\r\n" . - 'Content-Disposition: attachment; filename=' . $this->_attFileName . "\r\n" . - "\r\n" . - preg_quote(base64_encode(file_get_contents($this->_attFile)), '~') . - "\r\n\r\n" . - '--' . $boundary . '--' . "\r\n" . - '$~D' - ; - - $message->toByteStream($streamA); - $message->toByteStream($streamB); - - $this->assertPatternInStream($pattern, $streamA); - $this->assertPatternInStream($pattern, $streamB); - } - - // -- Helpers - - public function assertPatternInStream($pattern, $stream, $message = '%s') - { - $string = ''; - while (false !== $bytes = $stream->read(8192)) { - $string .= $bytes; - } - $this->assertPattern($pattern, $string, $message); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug51Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug51Test.php deleted file mode 100644 index 51d69b9..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug51Test.php +++ /dev/null @@ -1,125 +0,0 @@ -skipUnless( - is_writable(SWIFT_TMP_DIR), - '%s: This test requires tests/acceptance.conf.php to specify a ' . - 'writable SWIFT_TMP_DIR' - ); - } - - public function setUp() - { - $this->_attachmentFile = SWIFT_TMP_DIR . '/attach.rand.bin'; - file_put_contents($this->_attachmentFile, ''); - - $this->_outputFile = SWIFT_TMP_DIR . '/attach.out.bin'; - file_put_contents($this->_outputFile, ''); - } - - public function tearDown() - { - unlink($this->_attachmentFile); - unlink($this->_outputFile); - } - - public function testAttachmentsDoNotGetTruncatedUsingToByteStream() - { - //Run 100 times with 10KB attachments - for ($i = 0; $i < 10; ++$i) { - $message = $this->_createMessageWithRandomAttachment( - 10000, $this->_attachmentFile - ); - - file_put_contents($this->_outputFile, ''); - $message->toByteStream( - new Swift_ByteStream_FileByteStream($this->_outputFile, true) - ); - - $emailSource = file_get_contents($this->_outputFile); - - $this->assertAttachmentFromSourceMatches( - file_get_contents($this->_attachmentFile), - $emailSource - ); - } - } - - public function testAttachmentsDoNotGetTruncatedUsingToString() - { - //Run 100 times with 10KB attachments - for ($i = 0; $i < 10; ++$i) { - $message = $this->_createMessageWithRandomAttachment( - 10000, $this->_attachmentFile - ); - - $emailSource = $message->toString(); - - $this->assertAttachmentFromSourceMatches( - file_get_contents($this->_attachmentFile), - $emailSource - ); - } - } - - // -- Custom Assertions - - public function assertAttachmentFromSourceMatches($attachmentData, $source) - { - $encHeader = 'Content-Transfer-Encoding: base64'; - $base64declaration = strpos($source, $encHeader); - - $attachmentDataStart = strpos($source, "\r\n\r\n", $base64declaration); - $attachmentDataEnd = strpos($source, "\r\n--", $attachmentDataStart); - - if (false === $attachmentDataEnd) { - $attachmentBase64 = trim(substr($source, $attachmentDataStart)); - } else { - $attachmentBase64 = trim(substr( - $source, $attachmentDataStart, - $attachmentDataEnd - $attachmentDataStart - )); - } - - $this->assertIdenticalBinary($attachmentData, base64_decode($attachmentBase64)); - } - - // -- Creation Methods - - private function _fillFileWithRandomBytes($byteCount, $file) - { - // I was going to use dd with if=/dev/random but this way seems more - // cross platform even if a hella expensive!! - - file_put_contents($file, ''); - $fp = fopen($file, 'wb'); - for ($i = 0; $i < $byteCount; ++$i) { - $byteVal = rand(0, 255); - fwrite($fp, pack('i', $byteVal)); - } - fclose($fp); - } - - private function _createMessageWithRandomAttachment($size, $attachmentPath) - { - $this->_fillFileWithRandomBytes($size, $attachmentPath); - - $message = Swift_Message::newInstance() - ->setSubject('test') - ->setBody('test') - ->setFrom('a@b.c') - ->setTo('d@e.f') - ->attach(Swift_Attachment::fromPath($attachmentPath)) - ; - - return $message; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug71Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug71Test.php deleted file mode 100644 index d00ebaf..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug71Test.php +++ /dev/null @@ -1,22 +0,0 @@ -_message = new Swift_Message('test'); - } - - public function testCallingToStringAfterSettingNewBodyReflectsChanges() - { - $this->_message->setBody('BODY1'); - $this->assertPattern('/BODY1/', $this->_message->toString()); - - $this->_message->setBody('BODY2'); - $this->assertPattern('/BODY2/', $this->_message->toString()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug76Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug76Test.php deleted file mode 100644 index ce8714b..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug76Test.php +++ /dev/null @@ -1,86 +0,0 @@ -skipUnless( - is_writable(SWIFT_TMP_DIR), - '%s: This test requires tests/acceptance.conf.php to specify a ' . - 'writable SWIFT_TMP_DIR' - ); - } - - public function setUp() - { - $this->_inputFile = SWIFT_TMP_DIR . '/in.bin'; - file_put_contents($this->_inputFile, ''); - - $this->_outputFile = SWIFT_TMP_DIR . '/out.bin'; - file_put_contents($this->_outputFile, ''); - - $this->_encoder = $this->_createEncoder(); - } - - public function tearDown() - { - unlink($this->_inputFile); - unlink($this->_outputFile); - } - - public function testBase64EncodedLineLengthNeverExceeds76CharactersEvenIfArgsDo() - { - $this->_fillFileWithRandomBytes(1000, $this->_inputFile); - - $os = $this->_createStream($this->_inputFile); - $is = $this->_createStream($this->_outputFile); - - $this->_encoder->encodeByteStream($os, $is, 0, 80); //Exceeds 76 - - $this->assertMaxLineLength(76, $this->_outputFile, - '%s: Line length should not exceed 76 characters' - ); - } - - // -- Custom Assertions - - public function assertMaxLineLength($length, $filePath, $message = '%s') - { - $lines = file($filePath); - foreach ($lines as $line) { - $this->assertTrue((strlen(trim($line)) <= 76), $message); - } - } - - // -- Creation Methods - - private function _fillFileWithRandomBytes($byteCount, $file) - { - // I was going to use dd with if=/dev/random but this way seems more - // cross platform even if a hella expensive!! - - file_put_contents($file, ''); - $fp = fopen($file, 'wb'); - for ($i = 0; $i < $byteCount; ++$i) { - $byteVal = rand(0, 255); - fwrite($fp, pack('i', $byteVal)); - } - fclose($fp); - } - - private function _createEncoder() - { - return new Swift_Mime_ContentEncoder_Base64ContentEncoder(); - } - - private function _createStream($file) - { - return new Swift_ByteStream_FileByteStream($file, true); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/helpers/Swift/Tests/IdenticalBinaryExpectation.php b/vendor/swiftmailer/swiftmailer/tests/helpers/Swift/Tests/IdenticalBinaryExpectation.php deleted file mode 100644 index 4d5a97b..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/helpers/Swift/Tests/IdenticalBinaryExpectation.php +++ /dev/null @@ -1,78 +0,0 @@ -_left = $left; - } - - /** - * Get the given string of bytes as a stirng of Hexadecimal sequences. - * @param string $binary - * @return string - */ - public function asHexString($binary) - { - $hex = ''; - - $bytes = unpack('H*', $binary); - - foreach ($bytes as &$byte) { - $byte = strtoupper($byte); - } - - return implode('', $bytes); - } - - /** - * Test that the passed subject ($right) is identical to $left. - * @param string $right, subject - * @return boolean - */ - public function test($right) - { - $aHex = $this->asHexString($this->_left); - $bHex = $this->asHexString($right); - - return $aHex === $bHex; - } - - /** - * Get the message depending upon whether this expectation is satisfied. - * @param $right subject to compare against - * @return string - */ - public function testMessage($right) - { - if ($this->test($right)) { - return 'Identical binary expectation [' . $this->asHexString($right) . ']'; - } else { - $this->_dumper=new SimpleDumper(); - return 'Identical binary expectation fails ' . - $this->_dumper->describeDifference( - $this->asHexString($this->_left), - $this->asHexString($right) - ); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/helpers/Swift/Tests/SwiftSmokeTestCase.php b/vendor/swiftmailer/swiftmailer/tests/helpers/Swift/Tests/SwiftSmokeTestCase.php deleted file mode 100644 index 79e776d..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/helpers/Swift/Tests/SwiftSmokeTestCase.php +++ /dev/null @@ -1,53 +0,0 @@ -skipUnless(SWIFT_SMOKE_TRANSPORT_TYPE, - '%s: Smoke tests are skipped if tests/smoke.conf.php is not editted' - ); - } - - protected function _getMailer() - { - switch (SWIFT_SMOKE_TRANSPORT_TYPE) - { - case 'smtp': - $transport = Swift_DependencyContainer::getInstance()->lookup('transport.smtp') - ->setHost(SWIFT_SMOKE_SMTP_HOST) - ->setPort(SWIFT_SMOKE_SMTP_PORT) - ->setUsername(SWIFT_SMOKE_SMTP_USER) - ->setPassword(SWIFT_SMOKE_SMTP_PASS) - ->setEncryption(SWIFT_SMOKE_SMTP_ENCRYPTION) - ; - break; - case 'sendmail': - $transport = Swift_DependencyContainer::getInstance()->lookup('transport.sendmail') - ->setCommand(SWIFT_SMOKE_SENDMAIL_COMMAND) - ; - break; - case 'mail': - case 'nativemail': - $transport = Swift_DependencyContainer::getInstance()->lookup('transport.mail'); - break; - default: - throw new Exception('Undefined transport [' . SWIFT_SMOKE_TRANSPORT_TYPE . ']'); - } - return new Swift_Mailer($transport); - } - - protected function _visualCheck($url) - { - $this->dump('{image @ ' . $url . '}'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/helpers/Swift/Tests/SwiftUnitTestCase.php b/vendor/swiftmailer/swiftmailer/tests/helpers/Swift/Tests/SwiftUnitTestCase.php deleted file mode 100644 index a382b8d..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/helpers/Swift/Tests/SwiftUnitTestCase.php +++ /dev/null @@ -1,97 +0,0 @@ -_mockery()->assertIsSatisfied(); - } catch (Yay_NotSatisfiedException $e) { - $this->fail($e->getMessage()); - } - $this->_mockery = null; - return parent::after($method); - } - - /** - * Assert two binary strings are an exact match. - * @param string $a - * @param string $b - * @param string $s formatted message - */ - public function assertIdenticalBinary($a, $b, $s = '%s') - { - return $this->assert(new Swift_Tests_IdenticalBinaryExpectation($a), $b, $s); - } - - // -- Protected methods - - /** - * Returns a singleton-per-test method for Yay_Mockery. - * @return Yay_Mockery - */ - protected function _mockery() - { - if (!isset($this->_mockery)) { - $this->_mockery = new Yay_Mockery(); - } - return $this->_mockery; - } - - /** - * Create a mock object. - * @param string $class - * @return Yay_Mock - */ - protected function _mock($class) - { - return $this->_mockery()->mock($class); - } - - /** - * Add mock expectations. - * @param Yay_Expectations $expectations - */ - protected function _checking($expectations) - { - return $this->_mockery()->checking($expectations); - } - - /** - * Create a mock object which does nothing. - * @param string $class - * @return Yay_Mock - */ - protected function _stub($class) - { - $stub = $this->_mockery()->mock($class); - $this->_mockery()->checking(Yay_Expectations::create() - -> ignoring($stub) - ); - return $stub; - } - - protected function _states($machineName) - { - return $this->_mockery()->states($machineName); - } - - protected function _sequence($sequenceName) - { - return $this->_mockery()->sequence($sequenceName); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/smoke.conf.php.default b/vendor/swiftmailer/swiftmailer/tests/smoke.conf.php.default deleted file mode 100644 index 2a75b7d..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/smoke.conf.php.default +++ /dev/null @@ -1,63 +0,0 @@ -_attFile = dirname(__FILE__) . '/../../../_samples/files/textfile.zip'; - } - - public function testAttachmentSending() - { - $mailer = $this->_getMailer(); - $message = Swift_Message::newInstance() - ->setSubject('[Swift Mailer] AttachmentSmokeTest') - ->setFrom(array(SWIFT_SMOKE_EMAIL_ADDRESS => 'Swift Mailer')) - ->setTo(SWIFT_SMOKE_EMAIL_ADDRESS) - ->setBody('This message should contain an attached ZIP file (named "textfile.zip").' . PHP_EOL . - 'When unzipped, the archive should produce a text file which reads:' . PHP_EOL . - '"This is part of a Swift Mailer v4 smoke test."' - ) - ->attach(Swift_Attachment::fromPath($this->_attFile)) - ; - $this->assertEqual(1, $mailer->send($message), - '%s: The smoke test should send a single message' - ); - $this->_visualCheck('http://swiftmailer.org/smoke/4.0.0/attachment.jpg'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/BasicSmokeTest.php b/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/BasicSmokeTest.php deleted file mode 100644 index 1436a22..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/BasicSmokeTest.php +++ /dev/null @@ -1,24 +0,0 @@ -_getMailer(); - $message = Swift_Message::newInstance() - ->setSubject('[Swift Mailer] BasicSmokeTest') - ->setFrom(array(SWIFT_SMOKE_EMAIL_ADDRESS => 'Swift Mailer')) - ->setTo(SWIFT_SMOKE_EMAIL_ADDRESS) - ->setBody('One, two, three, four, five...' . PHP_EOL . - 'six, seven, eight...' - ) - ; - $this->assertEqual(1, $mailer->send($message), - '%s: The smoke test should send a single message' - ); - $this->_visualCheck('http://swiftmailer.org/smoke/4.0.0/basic.jpg'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/HtmlWithAttachmentSmokeTest.php b/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/HtmlWithAttachmentSmokeTest.php deleted file mode 100644 index e6fa4a8..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/HtmlWithAttachmentSmokeTest.php +++ /dev/null @@ -1,30 +0,0 @@ -_attFile = dirname(__FILE__) . '/../../../_samples/files/textfile.zip'; - } - - public function testAttachmentSending() - { - $mailer = $this->_getMailer(); - $message = Swift_Message::newInstance('[Swift Mailer] HtmlWithAttachmentSmokeTest') - ->setFrom(array(SWIFT_SMOKE_EMAIL_ADDRESS => 'Swift Mailer')) - ->setTo(SWIFT_SMOKE_EMAIL_ADDRESS) - ->attach(Swift_Attachment::fromPath($this->_attFile)) - ->setBody('

    This HTML-formatted message should contain an attached ZIP file (named "textfile.zip").' . PHP_EOL . - 'When unzipped, the archive should produce a text file which reads:

    ' . PHP_EOL . - '

    This is part of a Swift Mailer v4 smoke test.

    ', 'text/html' - ) - ; - $this->assertEqual(1, $mailer->send($message), - '%s: The smoke test should send a single message' - ); - $this->_visualCheck('http://swiftmailer.org/smoke/4.0.0/attachment.jpg'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/InternationalSmokeTest.php b/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/InternationalSmokeTest.php deleted file mode 100644 index e3131c8..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/InternationalSmokeTest.php +++ /dev/null @@ -1,37 +0,0 @@ -_attFile = dirname(__FILE__) . '/../../../_samples/files/textfile.zip'; - } - - public function testAttachmentSending() - { - $mailer = $this->_getMailer(); - $message = Swift_Message::newInstance() - ->setCharset('utf-8') - ->setSubject('[Swift Mailer] InternationalSmokeTest (διεθνής)') - ->setFrom(array(SWIFT_SMOKE_EMAIL_ADDRESS => 'Χριστοφορου (Swift Mailer)')) - ->setTo(SWIFT_SMOKE_EMAIL_ADDRESS) - ->setBody('This message should contain an attached ZIP file (named "κείμενο, εδάφιο, θέμα.zip").' . PHP_EOL . - 'When unzipped, the archive should produce a text file which reads:' . PHP_EOL . - '"This is part of a Swift Mailer v4 smoke test."' . PHP_EOL . - PHP_EOL . - 'Following is some arbitrary Greek text:' . PHP_EOL . - 'Δεν βρέθηκαν λέξεις.' - ) - ->attach(Swift_Attachment::fromPath($this->_attFile) - ->setContentType('application/zip') - ->setFilename('κείμενο, εδάφιο, θέμα.zip') - ) - ; - $this->assertEqual(1, $mailer->send($message), - '%s: The smoke test should send a single message' - ); - $this->_visualCheck('http://swiftmailer.org/smoke/4.0.0/international.jpg'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/ByteStream/ArrayByteStreamTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/ByteStream/ArrayByteStreamTest.php deleted file mode 100644 index 80ca0c3..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/ByteStream/ArrayByteStreamTest.php +++ /dev/null @@ -1,204 +0,0 @@ -_createArrayStream($input); - $output = array(); - while (false !== $bytes = $bs->read(1)) { - $output[] = $bytes; - } - $this->assertEqual($input, $output, - '%s: Bytes read from stream should be the same as bytes in constructor' - ); - } - - public function testReadingMultipleBytesFromBaseInput() - { - $input = array('a', 'b', 'c', 'd'); - $bs = $this->_createArrayStream($input); - $output = array(); - while (false !== $bytes = $bs->read(2)) { - $output[] = $bytes; - } - $this->assertEqual(array('ab', 'cd'), $output, - '%s: Bytes read from stream should be in pairs' - ); - } - - public function testReadingOddOffsetOnLastByte() - { - $input = array('a', 'b', 'c', 'd', 'e'); - $bs = $this->_createArrayStream($input); - $output = array(); - while (false !== $bytes = $bs->read(2)) { - $output[] = $bytes; - } - $this->assertEqual(array('ab', 'cd', 'e'), $output, - '%s: Bytes read from stream should be in pairs except final read' - ); - } - - public function testSettingPointerPartway() - { - $input = array('a', 'b', 'c'); - $bs = $this->_createArrayStream($input); - $bs->setReadPointer(1); - $this->assertEqual('b', $bs->read(1), - '%s: Byte should be second byte since pointer as at offset 1' - ); - } - - public function testResettingPointerAfterExhaustion() - { - $input = array('a', 'b', 'c'); - $bs = $this->_createArrayStream($input); - - while (false !== $bs->read(1)); - - $bs->setReadPointer(0); - $this->assertEqual('a', $bs->read(1), - '%s: Byte should be first byte since pointer as at offset 0' - ); - } - - public function testPointerNeverSetsBelowZero() - { - $input = array('a', 'b', 'c'); - $bs = $this->_createArrayStream($input); - - $bs->setReadPointer(-1); - $this->assertEqual('a', $bs->read(1), - '%s: Byte should be first byte since pointer should be at offset 0' - ); - } - - public function testPointerNeverSetsAboveStackSize() - { - $input = array('a', 'b', 'c'); - $bs = $this->_createArrayStream($input); - - $bs->setReadPointer(3); - $this->assertIdentical(false, $bs->read(1), - '%s: Stream should be at end and thus return false' - ); - } - - public function testBytesCanBeWrittenToStream() - { - $input = array('a', 'b', 'c'); - $bs = $this->_createArrayStream($input); - - $bs->write('de'); - - $output = array(); - while (false !== $bytes = $bs->read(1)) { - $output[] = $bytes; - } - $this->assertEqual(array('a', 'b', 'c', 'd', 'e'), $output, - '%s: Bytes read from stream should be from initial stack + written' - ); - } - - public function testContentsCanBeFlushed() - { - $input = array('a', 'b', 'c'); - $bs = $this->_createArrayStream($input); - - $bs->flushBuffers(); - - $this->assertIdentical(false, $bs->read(1), - '%s: Contents have been flushed so read() should return false' - ); - } - - public function testConstructorCanTakeStringArgument() - { - $bs = $this->_createArrayStream('abc'); - $output = array(); - while (false !== $bytes = $bs->read(1)) { - $output[] = $bytes; - } - $this->assertEqual(array('a', 'b', 'c'), $output, - '%s: Bytes read from stream should be the same as bytes in constructor' - ); - } - - public function testBindingOtherStreamsMirrorsWriteOperations() - { - $bs = $this->_createArrayStream(''); - $is1 = $this->_createMockInputStream(); - $is2 = $this->_createMockInputStream(); - - $this->_checking(Expectations::create() - -> one($is1)->write('x') - -> one($is2)->write('x') - -> one($is1)->write('y') - -> one($is2)->write('y') - ); - - $bs->bind($is1); - $bs->bind($is2); - - $bs->write('x'); - $bs->write('y'); - } - - public function testBindingOtherStreamsMirrorsFlushOperations() - { - $bs = $this->_createArrayStream(''); - $is1 = $this->_createMockInputStream(); - $is2 = $this->_createMockInputStream(); - - $this->_checking(Expectations::create() - -> one($is1)->flushBuffers() - -> one($is2)->flushBuffers() - ); - - $bs->bind($is1); - $bs->bind($is2); - - $bs->flushBuffers(); - } - - public function testUnbindingStreamPreventsFurtherWrites() - { - $bs = $this->_createArrayStream(''); - $is1 = $this->_createMockInputStream(); - $is2 = $this->_createMockInputStream(); - - $this->_checking(Expectations::create() - -> one($is1)->write('x') - -> one($is2)->write('x') - -> one($is1)->write('y') - ); - - $bs->bind($is1); - $bs->bind($is2); - - $bs->write('x'); - - $bs->unbind($is2); - - $bs->write('y'); - } - - // -- Creation Methods - - private function _createArrayStream($input) - { - return new Swift_ByteStream_ArrayByteStream($input); - } - - private function _createMockInputStream() - { - return $this->_mock('Swift_InputByteStream'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/GenericFixedWidthReaderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/GenericFixedWidthReaderTest.php deleted file mode 100644 index 130c47f..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/GenericFixedWidthReaderTest.php +++ /dev/null @@ -1,46 +0,0 @@ -assertIdentical(1, $reader->getInitialByteSize()); - - $reader = new Swift_CharacterReader_GenericFixedWidthReader(4); - $this->assertIdentical(4, $reader->getInitialByteSize()); - } - - public function testValidationValueIsBasedOnOctetCount() - { - $reader = new Swift_CharacterReader_GenericFixedWidthReader(4); - - $this->assertIdentical( - 1, $reader->validateByteSequence(array(0x01, 0x02, 0x03), 3) - ); //3 octets - - $this->assertIdentical( - 2, $reader->validateByteSequence(array(0x01, 0x0A), 2) - ); //2 octets - - $this->assertIdentical( - 3, $reader->validateByteSequence(array(0xFE), 1) - ); //1 octet - - $this->assertIdentical( - 0, $reader->validateByteSequence(array(0xFE, 0x03, 0x67, 0x9A), 4) - ); //All 4 octets - } - - public function testValidationFailsIfTooManyOctets() - { - $reader = new Swift_CharacterReader_GenericFixedWidthReader(6); - - $this->assertIdentical(-1, $reader->validateByteSequence( - array(0xFE, 0x03, 0x67, 0x9A, 0x10, 0x09, 0x85), 7 - )); //7 octets - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/UsAsciiReaderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/UsAsciiReaderTest.php deleted file mode 100644 index 7611262..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/UsAsciiReaderTest.php +++ /dev/null @@ -1,55 +0,0 @@ -read($size); ) { - $c .= $bytes; - $size = $v->validateCharacter($c); - if (-1 == $size) { - throw new Exception( ... invalid char .. ); - } elseif (0 == $size) { - return $c; //next character in $os - } - } - - */ - - private $_reader; - - public function setUp() - { - $this->_reader = new Swift_CharacterReader_UsAsciiReader(); - } - - public function testAllValidAsciiCharactersReturnZero() - { - for ($ordinal = 0x00; $ordinal <= 0x7F; ++$ordinal) { - $this->assertIdentical( - 0, $this->_reader->validateByteSequence(array($ordinal), 1) - ); - } - } - - public function testMultipleBytesAreInvalid() - { - for ($ordinal = 0x00; $ordinal <= 0x7F; $ordinal += 2) { - $this->assertIdentical( - -1, $this->_reader->validateByteSequence(array($ordinal, $ordinal + 1), 2) - ); - } - } - - public function testBytesAboveAsciiRangeAreInvalid() - { - for ($ordinal = 0x80; $ordinal <= 0xFF; ++$ordinal) { - $this->assertIdentical( - -1, $this->_reader->validateByteSequence(array($ordinal), 1) - ); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/Utf8ReaderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/Utf8ReaderTest.php deleted file mode 100644 index 02e21b1..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/Utf8ReaderTest.php +++ /dev/null @@ -1,68 +0,0 @@ -_reader = new Swift_CharacterReader_Utf8Reader(); - } - - public function testLeading7BitOctetCausesReturnZero() - { - for ($ordinal = 0x00; $ordinal <= 0x7F; ++$ordinal) { - $this->assertIdentical( - 0, $this->_reader->validateByteSequence(array($ordinal), 1) - ); - } - } - - public function testLeadingByteOf2OctetCharCausesReturn1() - { - for ($octet = 0xC0; $octet <= 0xDF; ++$octet) { - $this->assertIdentical( - 1, $this->_reader->validateByteSequence(array($octet), 1) - ); - } - } - - public function testLeadingByteOf3OctetCharCausesReturn2() - { - for ($octet = 0xE0; $octet <= 0xEF; ++$octet) { - $this->assertIdentical( - 2, $this->_reader->validateByteSequence(array($octet), 1) - ); - } - } - - public function testLeadingByteOf4OctetCharCausesReturn3() - { - for ($octet = 0xF0; $octet <= 0xF7; ++$octet) { - $this->assertIdentical( - 3, $this->_reader->validateByteSequence(array($octet), 1) - ); - } - } - - public function testLeadingByteOf5OctetCharCausesReturn4() - { - for ($octet = 0xF8; $octet <= 0xFB; ++$octet) { - $this->assertIdentical( - 4, $this->_reader->validateByteSequence(array($octet),1) - ); - } - } - - public function testLeadingByteOf6OctetCharCausesReturn5() - { - for ($octet = 0xFC; $octet <= 0xFD; ++$octet) { - $this->assertIdentical( - 5, $this->_reader->validateByteSequence(array($octet),1) - ); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterStream/ArrayCharacterStreamTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterStream/ArrayCharacterStreamTest.php deleted file mode 100644 index 3944622..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterStream/ArrayCharacterStreamTest.php +++ /dev/null @@ -1,374 +0,0 @@ -_getReader(); - $factory = $this->_getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $seq = $this->_mockery()->sequence('read-sequence'); - $this->_checking(Expectations::create() - -> ignoring($reader)->getInitialByteSize() -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD1), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - ); - - $stream->importString(pack('C*', - 0xD0, 0x94, - 0xD0, 0xB6, - 0xD0, 0xBE, - 0xD1, 0x8D, - 0xD0, 0xBB, - 0xD0, 0xB0 - ) - ); - } - - public function testCharactersWrittenUseValidator() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $seq = $this->_mockery()->sequence('read-sequence'); - $this->_checking(Expectations::create() - -> ignoring($reader)->getInitialByteSize() -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD1), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD1), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD1), 1) -> inSequence($seq) -> returns(1) - ); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $stream->write(pack('C*', - 0xD0, 0xBB, - 0xD1, 0x8E, - 0xD0, 0xB1, - 0xD1, 0x8B, - 0xD1, 0x85 - ) - ); - } - - public function testReadCharactersAreInTact() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $seq = $this->_mockery()->sequence('read-sequence'); - $this->_checking(Expectations::create() - -> ignoring($reader)->getInitialByteSize() -> returns(1) - //String - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - //Stream - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD1), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD1), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD1), 1) -> inSequence($seq) -> returns(1) - ); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $stream->write(pack('C*', - 0xD0, 0xBB, - 0xD1, 0x8E, - 0xD0, 0xB1, - 0xD1, 0x8B, - 0xD1, 0x85 - ) - ); - - $this->assertIdenticalBinary(pack('C*', 0xD0, 0x94), $stream->read(1)); - $this->assertIdenticalBinary( - pack('C*', 0xD0, 0xB6, 0xD0, 0xBE), $stream->read(2) - ); - $this->assertIdenticalBinary(pack('C*', 0xD0, 0xBB), $stream->read(1)); - $this->assertIdenticalBinary( - pack('C*', 0xD1, 0x8E, 0xD0, 0xB1, 0xD1, 0x8B), $stream->read(3) - ); - $this->assertIdenticalBinary(pack('C*', 0xD1, 0x85), $stream->read(1)); - - $this->assertIdentical(false, $stream->read(1)); - } - - public function testCharactersCanBeReadAsByteArrays() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $seq = $this->_mockery()->sequence('read-sequence'); - $this->_checking(Expectations::create() - -> ignoring($reader)->getInitialByteSize() -> returns(1) - //String - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - //Stream - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD1), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD1), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD1), 1) -> inSequence($seq) -> returns(1) - ); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $stream->write(pack('C*', - 0xD0, 0xBB, - 0xD1, 0x8E, - 0xD0, 0xB1, - 0xD1, 0x8B, - 0xD1, 0x85 - ) - ); - - $this->assertEqual(array(0xD0, 0x94), $stream->readBytes(1)); - $this->assertEqual(array(0xD0, 0xB6, 0xD0, 0xBE), $stream->readBytes(2)); - $this->assertEqual(array(0xD0, 0xBB), $stream->readBytes(1)); - $this->assertEqual( - array(0xD1, 0x8E, 0xD0, 0xB1, 0xD1, 0x8B), $stream->readBytes(3) - ); - $this->assertEqual(array(0xD1, 0x85), $stream->readBytes(1)); - - $this->assertIdentical(false, $stream->readBytes(1)); - } - - public function testRequestingLargeCharCountPastEndOfStream() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $seq = $this->_mockery()->sequence('read-sequence'); - $this->_checking(Expectations::create() - -> ignoring($reader)->getInitialByteSize() -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - ); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $this->assertIdenticalBinary(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE), - $stream->read(100) - ); - - $this->assertIdentical(false, $stream->read(1)); - } - - public function testRequestingByteArrayCountPastEndOfStream() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $seq = $this->_mockery()->sequence('read-sequence'); - $this->_checking(Expectations::create() - -> ignoring($reader)->getInitialByteSize() -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - ); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $this->assertEqual(array(0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE), - $stream->readBytes(100) - ); - - $this->assertIdentical(false, $stream->readBytes(1)); - } - - public function testPointerOffsetCanBeSet() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $seq = $this->_mockery()->sequence('read-sequence'); - $this->_checking(Expectations::create() - -> ignoring($reader)->getInitialByteSize() -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - ); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $this->assertIdenticalBinary(pack('C*', 0xD0, 0x94), $stream->read(1)); - - $stream->setPointer(0); - - $this->assertIdenticalBinary(pack('C*', 0xD0, 0x94), $stream->read(1)); - - $stream->setPointer(2); - - $this->assertIdenticalBinary(pack('C*', 0xD0, 0xBE), $stream->read(1)); - } - - public function testContentsCanBeFlushed() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $seq = $this->_mockery()->sequence('read-sequence'); - $this->_checking(Expectations::create() - -> ignoring($reader)->getInitialByteSize() -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - ); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $stream->flushContents(); - - $this->assertIdentical(false, $stream->read(1)); - } - - public function testByteStreamCanBeImportingUsesValidator() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - $os = $this->_getByteStream(); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $seq = $this->_mockery()->sequence('read-stream'); - $this->_checking(Expectations::create() - -> between(0,1)->of($os)->setReadPointer(0) - -> one($os)->read(any()) -> inSequence($seq) -> returns(pack('C*', 0xD0)) - -> one($os)->read(any()) -> inSequence($seq) -> returns(pack('C*', 0x94)) - -> one($os)->read(any()) -> inSequence($seq) -> returns(pack('C*', 0xD0)) - -> one($os)->read(any()) -> inSequence($seq) -> returns(pack('C*', 0xB6)) - -> one($os)->read(any()) -> inSequence($seq) -> returns(pack('C*', 0xD0)) - -> one($os)->read(any()) -> inSequence($seq) -> returns(pack('C*', 0xBE)) - -> ignoring($os)->read(any()) -> returns(false) - ); - - $seq = $this->_mockery()->sequence('read-chars'); - $this->_checking(Expectations::create() - -> ignoring($reader)->getInitialByteSize() -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - ); - - $stream->importByteStream($os); - } - - public function testImportingStreamProducesCorrectCharArray() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - $os = $this->_getByteStream(); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $seq = $this->_mockery()->sequence('read-stream'); - $this->_checking(Expectations::create() - -> between(0,1)->of($os)->setReadPointer(0) - -> one($os)->read(any()) -> inSequence($seq) -> returns(pack('C*', 0xD0)) - -> one($os)->read(any()) -> inSequence($seq) -> returns(pack('C*', 0x94)) - -> one($os)->read(any()) -> inSequence($seq) -> returns(pack('C*', 0xD0)) - -> one($os)->read(any()) -> inSequence($seq) -> returns(pack('C*', 0xB6)) - -> one($os)->read(any()) -> inSequence($seq) -> returns(pack('C*', 0xD0)) - -> one($os)->read(any()) -> inSequence($seq) -> returns(pack('C*', 0xBE)) - -> ignoring($os)->read(any()) -> returns(false) - ); - - $seq = $this->_mockery()->sequence('read-chars'); - $this->_checking(Expectations::create() - -> ignoring($reader)->getInitialByteSize() -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - -> one($reader)->validateByteSequence(array(0xD0), 1) -> inSequence($seq) -> returns(1) - ); - - $stream->importByteStream($os); - - $this->assertIdenticalBinary(pack('C*', 0xD0, 0x94), $stream->read(1)); - $this->assertIdenticalBinary(pack('C*', 0xD0, 0xB6), $stream->read(1)); - $this->assertIdenticalBinary(pack('C*', 0xD0, 0xBE), $stream->read(1)); - - $this->assertIdentical(false, $stream->read(1)); - } - - public function testAlgorithmWithFixedWidthCharsets() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - - $seq = $this->_mockery()->sequence('read-chars'); - $this->_checking(Expectations::create() - -> ignoring($reader)->getInitialByteSize() -> returns(2) - -> one($reader)->validateByteSequence(array(0xD1, 0x8D), 2) -> inSequence($seq) - -> one($reader)->validateByteSequence(array(0xD0, 0xBB), 2) -> inSequence($seq) - -> one($reader)->validateByteSequence(array(0xD0, 0xB0), 2) -> inSequence($seq) - ); - - $stream = new Swift_CharacterStream_ArrayCharacterStream( - $factory, 'utf-8' - ); - $stream->importString(pack('C*', 0xD1, 0x8D, 0xD0, 0xBB, 0xD0, 0xB0)); - - $this->assertIdenticalBinary(pack('C*', 0xD1, 0x8D), $stream->read(1)); - $this->assertIdenticalBinary(pack('C*', 0xD0, 0xBB), $stream->read(1)); - $this->assertIdenticalBinary(pack('C*', 0xD0, 0xB0), $stream->read(1)); - - $this->assertIdentical(false, $stream->read(1)); - } - - // -- Creation methods - - private function _getReader() - { - return $this->_mock('Swift_CharacterReader'); - } - - private function _getFactory($reader) - { - $factory = $this->_mock('Swift_CharacterReaderFactory'); - $this->_checking(Expectations::create() - -> allowing($factory)->getReaderFor('utf-8') -> returns($reader) - ); - return $factory; - } - - private function _getByteStream() - { - return $this->_mock('Swift_OutputByteStream'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/DependencyContainerTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/DependencyContainerTest.php deleted file mode 100644 index 9aac193..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/DependencyContainerTest.php +++ /dev/null @@ -1,175 +0,0 @@ -arg1 = $arg1; - $this->arg2 = $arg2; - } -} - -class Swift_DependencyContainerTest extends Swift_Tests_SwiftUnitTestCase -{ - private $_container; - - public function setUp() - { - $this->_container = new Swift_DependencyContainer(); - } - - public function testRegisterAndLookupValue() - { - $this->_container->register('foo')->asValue('bar'); - $this->assertIdentical('bar', $this->_container->lookup('foo')); - } - - public function testHasReturnsTrueForRegisteredValue() - { - $this->_container->register('foo')->asValue('bar'); - $this->assertTrue($this->_container->has('foo')); - } - - public function testHasReturnsFalseForUnregisteredValue() - { - $this->assertFalse($this->_container->has('foo')); - } - - public function testRegisterAndLookupNewInstance() - { - $this->_container->register('one')->asNewInstanceOf('One'); - $this->assertIsA($this->_container->lookup('one'), 'One'); - } - - public function testHasReturnsTrueForRegisteredInstance() - { - $this->_container->register('one')->asNewInstanceOf('One'); - $this->assertTrue($this->_container->has('one')); - } - - public function testNewInstanceIsAlwaysNew() - { - $this->_container->register('one')->asNewInstanceOf('One'); - $a = $this->_container->lookup('one'); - $b = $this->_container->lookup('one'); - $this->assertClone($a, $b); - } - - public function testRegisterAndLookupSharedInstance() - { - $this->_container->register('one')->asSharedInstanceOf('One'); - $this->assertIsA($this->_container->lookup('one'), 'One'); - } - - public function testHasReturnsTrueForSharedInstance() - { - $this->_container->register('one')->asSharedInstanceOf('One'); - $this->assertTrue($this->_container->has('one')); - } - - public function testMultipleSharedInstancesAreSameInstance() - { - $this->_container->register('one')->asSharedInstanceOf('One'); - $a = $this->_container->lookup('one'); - $b = $this->_container->lookup('one'); - $this->assertSame($a, $b); - } - - public function testNewInstanceWithDependencies() - { - $this->_container->register('foo')->asValue('FOO'); - $this->_container->register('one')->asNewInstanceOf('One') - ->withDependencies(array('foo')); - $obj = $this->_container->lookup('one'); - $this->assertIdentical('FOO', $obj->arg1); - } - - public function testNewInstanceWithMultipleDependencies() - { - $this->_container->register('foo')->asValue('FOO'); - $this->_container->register('bar')->asValue(42); - $this->_container->register('one')->asNewInstanceOf('One') - ->withDependencies(array('foo', 'bar')); - $obj = $this->_container->lookup('one'); - $this->assertIdentical('FOO', $obj->arg1); - $this->assertIdentical(42, $obj->arg2); - } - - public function testNewInstanceWithInjectedObjects() - { - $this->_container->register('foo')->asValue('FOO'); - $this->_container->register('one')->asNewInstanceOf('One'); - $this->_container->register('two')->asNewInstanceOf('One') - ->withDependencies(array('one', 'foo')); - $obj = $this->_container->lookup('two'); - $this->assertClone($this->_container->lookup('one'), $obj->arg1); - $this->assertIdentical('FOO', $obj->arg2); - } - - public function testNewInstanceWithAddConstructorValue() - { - $this->_container->register('one')->asNewInstanceOf('One') - ->addConstructorValue('x') - ->addConstructorValue(99); - $obj = $this->_container->lookup('one'); - $this->assertIdentical('x', $obj->arg1); - $this->assertIdentical(99, $obj->arg2); - } - - public function testNewInstanceWithAddConstructorLookup() - { - $this->_container->register('foo')->asValue('FOO'); - $this->_container->register('bar')->asValue(42); - $this->_container->register('one')->asNewInstanceOf('One') - ->addConstructorLookup('foo') - ->addConstructorLookup('bar'); - - $obj = $this->_container->lookup('one'); - $this->assertIdentical('FOO', $obj->arg1); - $this->assertIdentical(42, $obj->arg2); - } - - public function testResolvedDependenciesCanBeLookedUp() - { - $this->_container->register('foo')->asValue('FOO'); - $this->_container->register('one')->asNewInstanceOf('One'); - $this->_container->register('two')->asNewInstanceOf('One') - ->withDependencies(array('one', 'foo')); - $deps = $this->_container->createDependenciesFor('two'); - $this->assertEqual( - array($this->_container->lookup('one'), 'FOO'), $deps - ); - } - - public function testArrayOfDependenciesCanBeSpecified() - { - $this->_container->register('foo')->asValue('FOO'); - $this->_container->register('one')->asNewInstanceOf('One'); - $this->_container->register('two')->asNewInstanceOf('One') - ->withDependencies(array(array('one', 'foo'), 'foo')); - - $obj = $this->_container->lookup('two'); - $this->assertEqual(array($this->_container->lookup('one'), 'FOO'), $obj->arg1); - $this->assertIdentical('FOO', $obj->arg2); - } - - public function testAliasCanBeSet() - { - $this->_container->register('foo')->asValue('FOO'); - $this->_container->register('bar')->asAliasOf('foo'); - - $this->assertIdentical('FOO', $this->_container->lookup('bar')); - } - - public function testAliasOfAliasCanBeSet() - { - $this->_container->register('foo')->asValue('FOO'); - $this->_container->register('bar')->asAliasOf('foo'); - $this->_container->register('zip')->asAliasOf('bar'); - $this->_container->register('button')->asAliasOf('zip'); - - $this->assertIdentical('FOO', $this->_container->lookup('button')); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Base64EncoderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Base64EncoderTest.php deleted file mode 100644 index 1a271ac..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Base64EncoderTest.php +++ /dev/null @@ -1,175 +0,0 @@ -_encoder = new Swift_Encoder_Base64Encoder(); - } - - /* - There's really no point in testing the entire base64 encoding to the - level QP encoding has been tested. base64_encode() has been in PHP for - years. - */ - - public function testInputOutputRatioIs3to4Bytes() - { - /* - RFC 2045, 6.8 - - The encoding process represents 24-bit groups of input bits as output - strings of 4 encoded characters. Proceeding from left to right, a - 24-bit input group is formed by concatenating 3 8bit input groups. - These 24 bits are then treated as 4 concatenated 6-bit groups, each - of which is translated into a single digit in the base64 alphabet. - */ - - $this->assertEqual( - 'MTIz', $this->_encoder->encodeString('123'), - '%s: 3 bytes of input should yield 4 bytes of output' - ); - $this->assertEqual( - 'MTIzNDU2', $this->_encoder->encodeString('123456'), - '%s: 6 bytes in input should yield 8 bytes of output' - ); - $this->assertEqual( - 'MTIzNDU2Nzg5', $this->_encoder->encodeString('123456789'), - '%s: 9 bytes in input should yield 12 bytes of output' - ); - } - - public function testPadLength() - { - /* - RFC 2045, 6.8 - - Special processing is performed if fewer than 24 bits are available - at the end of the data being encoded. A full encoding quantum is - always completed at the end of a body. When fewer than 24 input bits - are available in an input group, zero bits are added (on the right) - to form an integral number of 6-bit groups. Padding at the end of - the data is performed using the "=" character. Since all base64 - input is an integral number of octets, only the following cases can - arise: (1) the final quantum of encoding input is an integral - multiple of 24 bits; here, the final unit of encoded output will be - an integral multiple of 4 characters with no "=" padding, (2) the - final quantum of encoding input is exactly 8 bits; here, the final - unit of encoded output will be two characters followed by two "=" - padding characters, or (3) the final quantum of encoding input is - exactly 16 bits; here, the final unit of encoded output will be three - characters followed by one "=" padding character. - */ - - for ($i = 0; $i < 30; ++$i) { - $input = pack('C', rand(0, 255)); - $this->assertPattern( - '~^[a-zA-Z0-9/\+]{2}==$~', $this->_encoder->encodeString($input), - '%s: A single byte should have 2 bytes of padding' - ); - } - - for ($i = 0; $i < 30; ++$i) { - $input = pack('C*', rand(0, 255), rand(0, 255)); - $this->assertPattern( - '~^[a-zA-Z0-9/\+]{3}=$~', $this->_encoder->encodeString($input), - '%s: Two bytes should have 1 byte of padding' - ); - } - - for ($i = 0; $i < 30; ++$i) { - $input = pack('C*', rand(0, 255), rand(0, 255), rand(0, 255)); - $this->assertPattern( - '~^[a-zA-Z0-9/\+]{4}$~', $this->_encoder->encodeString($input), - '%s: Three bytes should have no padding' - ); - } - } - - public function testMaximumLineLengthIs76Characters() - { - /* - The encoded output stream must be represented in lines of no more - than 76 characters each. All line breaks or other characters not - found in Table 1 must be ignored by decoding software. - */ - - $input = - 'abcdefghijklmnopqrstuvwxyz' . - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' . - '1234567890' . - 'abcdefghijklmnopqrstuvwxyz' . - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' . - '1234567890' . - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; - - $output = - 'YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQk' . //38 - 'NERUZHSElKS0xNTk9QUVJTVFVWV1hZWjEyMzQ1' . "\r\n" . //76 * - 'Njc4OTBhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3' . //38 - 'h5ekFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFla' . "\r\n" . //76 * - 'MTIzNDU2Nzg5MEFCQ0RFRkdISUpLTE1OT1BRUl' . //38 - 'NUVVZXWFla'; //48 - - $this->assertEqual( - $output, $this->_encoder->encodeString($input), - '%s: Lines should be no more than 76 characters' - ); - } - - public function testMaximumLineLengthCanBeSpecified() - { - $input = - 'abcdefghijklmnopqrstuvwxyz' . - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' . - '1234567890' . - 'abcdefghijklmnopqrstuvwxyz' . - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' . - '1234567890' . - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; - - $output = - 'YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQk' . //38 - 'NERUZHSElKS0' . "\r\n" . //50 * - 'xNTk9QUVJTVFVWV1hZWjEyMzQ1Njc4OTBhYmNk' . //38 - 'ZWZnaGlqa2xt' . "\r\n" . //50 * - 'bm9wcXJzdHV2d3h5ekFCQ0RFRkdISUpLTE1OT1' . //38 - 'BRUlNUVVZXWF' . "\r\n" . //50 * - 'laMTIzNDU2Nzg5MEFCQ0RFRkdISUpLTE1OT1BR' . //38 - 'UlNUVVZXWFla'; //50 * - - $this->assertEqual( - $output, $this->_encoder->encodeString($input, 0, 50), - '%s: Lines should be no more than 100 characters' - ); - } - - public function testFirstLineLengthCanBeDifferent() - { - $input = - 'abcdefghijklmnopqrstuvwxyz' . - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' . - '1234567890' . - 'abcdefghijklmnopqrstuvwxyz' . - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' . - '1234567890' . - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; - - $output = - 'YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQk' . //38 - 'NERUZHSElKS0xNTk9QU' . "\r\n" . //57 * - 'VJTVFVWV1hZWjEyMzQ1Njc4OTBhYmNkZWZnaGl' . //38 - 'qa2xtbm9wcXJzdHV2d3h5ekFCQ0RFRkdISUpLT' . "\r\n" . //76 * - 'E1OT1BRUlNUVVZXWFlaMTIzNDU2Nzg5MEFCQ0R' . //38 - 'FRkdISUpLTE1OT1BRUlNUVVZXWFla'; //67 - - $this->assertEqual( - $output, $this->_encoder->encodeString($input, 19), - '%s: First line offset is 19 so first line should be 57 chars long' - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/QpEncoderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/QpEncoderTest.php deleted file mode 100644 index e87b26d..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/QpEncoderTest.php +++ /dev/null @@ -1,361 +0,0 @@ -_createCharStream(); - $this->_checking(Expectations::create() - -> one($charStream)->flushContents() - -> one($charStream)->importString($char) - -> one($charStream)->readBytes(optional()) -> returns(array($ordinal)) - -> atLeast(1)->of($charStream)->readBytes(optional()) -> returns(false) - ); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - - $this->assertIdenticalBinary($char, $encoder->encodeString($char)); - } - } - - public function testWhiteSpaceAtLineEndingIsEncoded() - { - /* -- RFC 2045, 6.7 -- - (3) (White Space) Octets with values of 9 and 32 MAY be - represented as US-ASCII TAB (HT) and SPACE characters, - respectively, but MUST NOT be so represented at the end - of an encoded line. Any TAB (HT) or SPACE characters - on an encoded line MUST thus be followed on that line - by a printable character. In particular, an "=" at the - end of an encoded line, indicating a soft line break - (see rule #5) may follow one or more TAB (HT) or SPACE - characters. It follows that an octet with decimal - value 9 or 32 appearing at the end of an encoded line - must be represented according to Rule #1. This rule is - necessary because some MTAs (Message Transport Agents, - programs which transport messages from one user to - another, or perform a portion of such transfers) are - known to pad lines of text with SPACEs, and others are - known to remove "white space" characters from the end - of a line. Therefore, when decoding a Quoted-Printable - body, any trailing white space on a line must be - deleted, as it will necessarily have been added by - intermediate transport agents. - */ - - $HT = chr(0x09); //9 - $SPACE = chr(0x20); //32 - - //HT - $string = 'a' . $HT . $HT . "\r\n" . 'b'; - - $seq = $this->_mockery()->sequence('byte-sequence'); - $charStream = $this->_createCharStream(); - $this->_checking(Expectations::create() - -> one($charStream)->flushContents() - -> one($charStream)->importString($string) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(ord('a'))) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(0x09)) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(0x09)) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(0x0D)) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(0x0A)) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(ord('b'))) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(false) - ); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - $this->assertEqual( - 'a' . $HT . '=09' . "\r\n" . 'b', - $encoder->encodeString($string) - ); - - //SPACE - $string = 'a' . $SPACE . $SPACE . "\r\n" . 'b'; - - $seq = $this->_mockery()->sequence('byte-sequence'); - $charStream = $this->_createCharStream(); - $this->_checking(Expectations::create() - -> one($charStream)->flushContents() - -> one($charStream)->importString($string) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(ord('a'))) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(0x20)) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(0x20)) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(0x0D)) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(0x0A)) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(ord('b'))) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(false) - ); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - $this->assertEqual( - 'a' . $SPACE . '=20' . "\r\n" . 'b', - $encoder->encodeString($string) - ); - } - - public function testCRLFIsLeftAlone() - { - /* - (4) (Line Breaks) A line break in a text body, represented - as a CRLF sequence in the text canonical form, must be - represented by a (RFC 822) line break, which is also a - CRLF sequence, in the Quoted-Printable encoding. Since - the canonical representation of media types other than - text do not generally include the representation of - line breaks as CRLF sequences, no hard line breaks - (i.e. line breaks that are intended to be meaningful - and to be displayed to the user) can occur in the - quoted-printable encoding of such types. Sequences - like "=0D", "=0A", "=0A=0D" and "=0D=0A" will routinely - appear in non-text data represented in quoted- - printable, of course. - - Note that many implementations may elect to encode the - local representation of various content types directly - rather than converting to canonical form first, - encoding, and then converting back to local - representation. In particular, this may apply to plain - text material on systems that use newline conventions - other than a CRLF terminator sequence. Such an - implementation optimization is permissible, but only - when the combined canonicalization-encoding step is - equivalent to performing the three steps separately. - */ - - $string = 'a' . "\r\n" . 'b' . "\r\n" . 'c' . "\r\n"; - - $seq = $this->_mockery()->sequence('byte-sequence'); - $charStream = $this->_createCharStream(); - $this->_checking(Expectations::create() - -> one($charStream)->flushContents() - -> one($charStream)->importString($string) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(ord('a'))) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(0x0D)) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(0x0A)) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(ord('b'))) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(0x0D)) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(0x0A)) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(ord('c'))) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(0x0D)) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(0x0A)) - -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(false) - ); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - $this->assertEqual($string, $encoder->encodeString($string)); - } - - public function testLinesLongerThan76CharactersAreSoftBroken() - { - /* - (5) (Soft Line Breaks) The Quoted-Printable encoding - REQUIRES that encoded lines be no more than 76 - characters long. If longer lines are to be encoded - with the Quoted-Printable encoding, "soft" line breaks - must be used. An equal sign as the last character on a - encoded line indicates such a non-significant ("soft") - line break in the encoded text. - */ - - $input = str_repeat('a', 140); - - $charStream = $this->_createCharStream(); - $seq = $this->_mockery()->sequence('byte-sequence'); - - $exps = Expectations::create(); - - $exps -> one($charStream)->flushContents() - -> one($charStream)->importString($input) - ; - - $output = ''; - for ($i = 0; $i < 140; ++$i) { - $exps -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(ord('a'))); - - if (75 == $i) { - $output .= "=\r\n"; - } - $output .= 'a'; - } - - $exps -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(false); - - $this->_checking($exps); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - $this->assertEqual($output, $encoder->encodeString($input)); - } - - public function testMaxLineLengthCanBeSpecified() - { - $input = str_repeat('a', 100); - - $charStream = $this->_createCharStream(); - $seq = $this->_mockery()->sequence('byte-sequence'); - - $exps = Expectations::create(); - - $exps -> one($charStream)->flushContents() - -> one($charStream)->importString($input) - ; - - $output = ''; - for ($i = 0; $i < 100; ++$i) { - $exps -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(ord('a'))); - - if (53 == $i) { - $output .= "=\r\n"; - } - $output .= 'a'; - } - $exps -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(false); - - $this->_checking($exps); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - $this->assertEqual($output, $encoder->encodeString($input, 0, 54)); - } - - public function testBytesBelowPermittedRangeAreEncoded() - { - /* - According to Rule (1 & 2) - */ - - foreach (range(0, 32) as $ordinal) { - $char = chr($ordinal); - - $charStream = $this->_createCharStream(); - $this->_checking(Expectations::create() - -> one($charStream)->flushContents() - -> one($charStream)->importString($char) - -> one($charStream)->readBytes(optional()) -> returns(array($ordinal)) - -> atLeast(1)->of($charStream)->readBytes(optional()) -> returns(false) - ); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - - $this->assertEqual( - sprintf('=%02X', $ordinal), $encoder->encodeString($char) - ); - } - } - - public function testDecimalByte61IsEncoded() - { - /* - According to Rule (1 & 2) - */ - - $char = '='; - - $charStream = $this->_createCharStream(); - $this->_checking(Expectations::create() - -> one($charStream)->flushContents() - -> one($charStream)->importString($char) - -> one($charStream)->readBytes(optional()) -> returns(array(61)) - -> atLeast(1)->of($charStream)->readBytes(optional()) -> returns(false) - ); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - - $this->assertEqual('=3D', $encoder->encodeString('=')); - } - - public function testBytesAbovePermittedRangeAreEncoded() - { - /* - According to Rule (1 & 2) - */ - - foreach (range(127, 255) as $ordinal) { - $char = chr($ordinal); - - $charStream = $this->_createCharStream(); - $this->_checking(Expectations::create() - -> one($charStream)->flushContents() - -> one($charStream)->importString($char) - -> one($charStream)->readBytes(optional()) -> returns(array($ordinal)) - -> atLeast(1)->of($charStream)->readBytes(optional()) -> returns(false) - ); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - - $this->assertEqual( - sprintf('=%02X', $ordinal), $encoder->encodeString($char) - ); - } - } - - public function testFirstLineLengthCanBeDifferent() - { - $input = str_repeat('a', 140); - - $charStream = $this->_createCharStream(); - $seq = $this->_mockery()->sequence('byte-sequence'); - - $exps = Expectations::create(); - - $exps -> one($charStream)->flushContents(); - $exps -> one($charStream)->importString($input); - - $output = ''; - for ($i = 0; $i < 140; ++$i) { - $exps -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(array(ord('a'))); - - if (53 == $i || 53 + 75 == $i) { - $output .= "=\r\n"; - } - $output .= 'a'; - } - - $exps -> one($charStream)->readBytes(optional()) -> inSequence($seq) -> returns(false); - - $this->_checking($exps); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - $this->assertEqual( - $output, $encoder->encodeString($input, 22), - '%s: First line should start at offset 22 so can only have max length 54' - ); - } - - // -- Creation methods - - private function _createCharStream() - { - return $this->_mock('Swift_CharacterStream'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Rfc2231EncoderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Rfc2231EncoderTest.php deleted file mode 100644 index 62abb50..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Rfc2231EncoderTest.php +++ /dev/null @@ -1,144 +0,0 @@ -_mock('Swift_CharacterStream'); - $seq = $this->_sequence('byte-sequence'); - - $string = ''; - foreach (range(0x00, 0x7F) as $octet) { - $char = pack('C', $octet); - $string .= $char; - $this->_checking(Expectations::create() - -> one($charStream)->read(optional()) -> inSequence($seq) -> returns($char) - ); - } - $this->_checking(Expectations::create() - -> atLeast(1)->of($charStream)->read(optional()) -> inSequence($seq) -> returns(false) - -> one($charStream)->importString($string) - -> ignoring($charStream)->flushContents() - ); - - $encoder = new Swift_Encoder_Rfc2231Encoder($charStream); - $encoded = $encoder->encodeString($string); - - foreach (explode("\r\n", $encoded) as $line) { - $this->assertPattern($this->_rfc2045Token, $line, - '%s: Encoder should always return a valid RFC 2045 token.'); - } - - - } - - public function testEncodingNonAsciiCharactersProducesValidToken() - { - $charStream = $this->_mock('Swift_CharacterStream'); - $seq = $this->_sequence('byte-sequence'); - - $string = ''; - foreach (range(0x80, 0xFF) as $octet) { - $char = pack('C', $octet); - $string .= $char; - $this->_checking(Expectations::create() - -> one($charStream)->read(optional()) -> inSequence($seq) -> returns($char) - ); - } - $this->_checking(Expectations::create() - -> atLeast(1)->of($charStream)->read(optional()) -> inSequence($seq) -> returns(false) - -> one($charStream)->importString($string) - -> ignoring($charStream)->flushContents() - ); - $encoder = new Swift_Encoder_Rfc2231Encoder($charStream); - - $encoded = $encoder->encodeString($string); - - foreach (explode("\r\n", $encoded) as $line) { - $this->assertPattern($this->_rfc2045Token, $line, - '%s: Encoder should always return a valid RFC 2045 token.'); - } - - - } - - public function testMaximumLineLengthCanBeSet() - { - $charStream = $this->_mock('Swift_CharacterStream'); - $seq = $this->_sequence('byte-sequence'); - - $string = ''; - for ($x = 0; $x < 200; ++$x) { - $char = 'a'; - $string .= $char; - $this->_checking(Expectations::create() - -> one($charStream)->read(optional()) -> inSequence($seq) -> returns($char) - ); - } - $this->_checking(Expectations::create() - -> atLeast(1)->of($charStream)->read(optional()) -> inSequence($seq) -> returns(false) - -> one($charStream)->importString($string) - -> ignoring($charStream)->flushContents() - ); - $encoder = new Swift_Encoder_Rfc2231Encoder($charStream); - - $encoded = $encoder->encodeString($string, 0, 75); - - $this->assertEqual( - str_repeat('a', 75) . "\r\n" . - str_repeat('a', 75) . "\r\n" . - str_repeat('a', 50), - $encoded, - '%s: Lines should be wrapped at each 75 characters' - ); - - - } - - public function testFirstLineCanHaveShorterLength() - { - $charStream = $this->_mock('Swift_CharacterStream'); - $seq = $this->_sequence('byte-sequence'); - - $string = ''; - for ($x = 0; $x < 200; ++$x) { - $char = 'a'; - $string .= $char; - $this->_checking(Expectations::create() - -> one($charStream)->read(optional()) -> inSequence($seq) -> returns($char) - ); - } - $this->_checking(Expectations::create() - -> atLeast(1)->of($charStream)->read(optional()) -> inSequence($seq) -> returns(false) - -> one($charStream)->importString($string) - -> ignoring($charStream)->flushContents() - ); - $encoder = new Swift_Encoder_Rfc2231Encoder($charStream); - $encoded = $encoder->encodeString($string, 25, 75); - - $this->assertEqual( - str_repeat('a', 50) . "\r\n" . - str_repeat('a', 75) . "\r\n" . - str_repeat('a', 75), - $encoded, - '%s: First line should be 25 bytes shorter than the others.' - ); - - - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/CommandEventTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/CommandEventTest.php deleted file mode 100644 index dee6613..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/CommandEventTest.php +++ /dev/null @@ -1,41 +0,0 @@ -_createEvent($this->_createTransport(), "FOO\r\n"); - $this->assertEqual("FOO\r\n", $evt->getCommand()); - } - - public function testSuccessCodesCanBeFetchedViaGetter() - { - $evt = $this->_createEvent($this->_createTransport(), "FOO\r\n", array(250)); - $this->assertEqual(array(250), $evt->getSuccessCodes()); - } - - public function testSourceIsBuffer() - { - $transport = $this->_createTransport(); - $evt = $this->_createEvent($transport, "FOO\r\n"); - $ref = $evt->getSource(); - $this->assertReference($transport, $ref); - } - - // -- Creation Methods - - private function _createEvent(Swift_Transport $source, $command, - $successCodes = array()) - { - return new Swift_Events_CommandEvent($source, $command, $successCodes); - } - - private function _createTransport() - { - return $this->_stub('Swift_Transport'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/EventObjectTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/EventObjectTest.php deleted file mode 100644 index f6fab7f..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/EventObjectTest.php +++ /dev/null @@ -1,37 +0,0 @@ -_createEvent($source); - $ref = $evt->getSource(); - $this->assertReference($source, $ref); - } - - public function testEventDoesNotHaveCancelledBubbleWhenNew() - { - $source = new stdClass(); - $evt = $this->_createEvent($source); - $this->assertFalse($evt->bubbleCancelled()); - } - - public function testBubbleCanBeCancelledInEvent() - { - $source = new stdClass(); - $evt = $this->_createEvent($source); - $evt->cancelBubble(); - $this->assertTrue($evt->bubbleCancelled()); - } - - // -- Creation Methods - - private function _createEvent($source) - { - return new Swift_Events_EventObject($source); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/ResponseEventTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/ResponseEventTest.php deleted file mode 100644 index adb4700..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/ResponseEventTest.php +++ /dev/null @@ -1,44 +0,0 @@ -_createEvent($this->_createTransport(), "250 Ok\r\n", true); - $this->assertEqual("250 Ok\r\n", $evt->getResponse(), - '%s: Response should be available via getResponse()' - ); - } - - public function testResultCanBeFetchedViaGetter() - { - $evt = $this->_createEvent($this->_createTransport(), "250 Ok\r\n", false); - $this->assertFalse($evt->isValid(), - '%s: Result should be checkable via isValid()' - ); - } - - public function testSourceIsBuffer() - { - $transport = $this->_createTransport(); - $evt = $this->_createEvent($transport, "250 Ok\r\n", true); - $ref = $evt->getSource(); - $this->assertReference($transport, $ref); - } - - // -- Creation Methods - - private function _createEvent(Swift_Transport $source, $response, $result) - { - return new Swift_Events_ResponseEvent($source, $response, $result); - } - - private function _createTransport() - { - return $this->_stub('Swift_Transport'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SendEventTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SendEventTest.php deleted file mode 100644 index 446a6e2..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SendEventTest.php +++ /dev/null @@ -1,103 +0,0 @@ -_createMessage(); - $transport = $this->_createTransport(); - - $evt = $this->_createEvent($transport, $message); - - $ref = $evt->getMessage(); - $this->assertReference($message, $ref, - '%s: Message should be returned from getMessage()' - ); - } - - public function testTransportCanBeFetchViaGetter() - { - $message = $this->_createMessage(); - $transport = $this->_createTransport(); - - $evt = $this->_createEvent($transport, $message); - - $ref = $evt->getTransport(); - $this->assertReference($transport, $ref, - '%s: Transport should be returned from getTransport()' - ); - } - - public function testTransportCanBeFetchViaGetSource() - { - $message = $this->_createMessage(); - $transport = $this->_createTransport(); - - $evt = $this->_createEvent($transport, $message); - - $ref = $evt->getSource(); - $this->assertReference($transport, $ref, - '%s: Transport should be returned from getSource()' - ); - } - - public function testResultCanBeSetAndGet() - { - $message = $this->_createMessage(); - $transport = $this->_createTransport(); - - $evt = $this->_createEvent($transport, $message); - - $evt->setResult( - Swift_Events_SendEvent::RESULT_SUCCESS | Swift_Events_SendEvent::RESULT_TENTATIVE - ); - - $this->assertTrue($evt->getResult() & Swift_Events_SendEvent::RESULT_SUCCESS); - $this->assertTrue($evt->getResult() & Swift_Events_SendEvent::RESULT_TENTATIVE); - } - - public function testFailedRecipientsCanBeSetAndGet() - { - $message = $this->_createMessage(); - $transport = $this->_createTransport(); - - $evt = $this->_createEvent($transport, $message); - - $evt->setFailedRecipients(array('foo@bar', 'zip@button')); - - $this->assertEqual(array('foo@bar', 'zip@button'), $evt->getFailedRecipients(), - '%s: FailedRecipients should be returned from getter' - ); - } - - public function testFailedRecipientsGetsPickedUpCorrectly() { - $message = $this->_createMessage(); - $transport = $this->_createTransport(); - - $evt = $this->_createEvent($transport, $message); - $this->assertEqual(array(), $evt->getFailedRecipients()); - } - - // -- Creation Methods - - private function _createEvent(Swift_Transport $source, - Swift_Mime_Message $message) - { - return new Swift_Events_SendEvent($source, $message); - } - - private function _createTransport() - { - return $this->_stub('Swift_Transport'); - } - - private function _createMessage() - { - return $this->_stub('Swift_Mime_Message'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SimpleEventDispatcherTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SimpleEventDispatcherTest.php deleted file mode 100644 index e4449fa..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SimpleEventDispatcherTest.php +++ /dev/null @@ -1,166 +0,0 @@ -_dispatcher = new Swift_Events_SimpleEventDispatcher(); - } - - public function testSendEventCanBeCreated() - { - $transport = $this->_stub('Swift_Transport'); - $message = $this->_stub('Swift_Mime_Message'); - $evt = $this->_dispatcher->createSendEvent($transport, $message); - $this->assertIsA($evt, 'Swift_Events_SendEvent'); - $this->assertSame($message, $evt->getMessage()); - $this->assertSame($transport, $evt->getTransport()); - } - - public function testCommandEventCanBeCreated() - { - $buf = $this->_stub('Swift_Transport'); - $evt = $this->_dispatcher->createCommandEvent($buf, "FOO\r\n", array(250)); - $this->assertIsA($evt, 'Swift_Events_CommandEvent'); - $this->assertSame($buf, $evt->getSource()); - $this->assertEqual("FOO\r\n", $evt->getCommand()); - $this->assertEqual(array(250), $evt->getSuccessCodes()); - } - - public function testResponseEventCanBeCreated() - { - $buf = $this->_stub('Swift_Transport'); - $evt = $this->_dispatcher->createResponseEvent($buf, "250 Ok\r\n", true); - $this->assertIsA($evt, 'Swift_Events_ResponseEvent'); - $this->assertSame($buf, $evt->getSource()); - $this->assertEqual("250 Ok\r\n", $evt->getResponse()); - $this->assertTrue($evt->isValid()); - } - - public function testTransportChangeEventCanBeCreated() - { - $transport = $this->_stub('Swift_Transport'); - $evt = $this->_dispatcher->createTransportChangeEvent($transport); - $this->assertIsA($evt, 'Swift_Events_TransportChangeEvent'); - $this->assertSame($transport, $evt->getSource()); - } - - public function testTransportExceptionEventCanBeCreated() - { - $transport = $this->_stub('Swift_Transport'); - $ex = new Swift_TransportException(''); - $evt = $this->_dispatcher->createTransportExceptionEvent($transport, $ex); - $this->assertIsA($evt, 'Swift_Events_TransportExceptionEvent'); - $this->assertSame($transport, $evt->getSource()); - $this->assertSame($ex, $evt->getException()); - } - - public function testListenersAreNotifiedOfDispatchedEvent() - { - $transport = $this->_stub('Swift_Transport'); - - $evt = $this->_dispatcher->createTransportChangeEvent($transport); - - $listenerA = $this->_mock('Swift_Events_TransportChangeListener'); - $listenerB = $this->_mock('Swift_Events_TransportChangeListener'); - - $this->_dispatcher->bindEventListener($listenerA); - $this->_dispatcher->bindEventListener($listenerB); - - $this->_checking(Expectations::create() - -> one($listenerA)->transportStarted($evt) - -> one($listenerB)->transportStarted($evt) - ); - - $this->_dispatcher->dispatchEvent($evt, 'transportStarted'); - } - - public function testListenersAreOnlyCalledIfImplementingCorrectInterface() - { - $transport = $this->_stub('Swift_Transport'); - $message = $this->_stub('Swift_Mime_Message'); - - $evt = $this->_dispatcher->createSendEvent($transport, $message); - - $targetListener = $this->_mock('Swift_Events_SendListener'); - $otherListener = $this->_mock('Swift_Events_TransportChangeListener'); - - $this->_dispatcher->bindEventListener($targetListener); - $this->_dispatcher->bindEventListener($otherListener); - - $this->_checking(Expectations::create() - -> one($targetListener)->sendPerformed($evt) - -> never($otherListener) - ); - - $this->_dispatcher->dispatchEvent($evt, 'sendPerformed'); - } - - public function testListenersCanCancelBubblingOfEvent() - { - $transport = $this->_stub('Swift_Transport'); - $message = $this->_stub('Swift_Mime_Message'); - - $evt = $this->_dispatcher->createSendEvent($transport, $message); - - $listenerA = $this->_mock('Swift_Events_SendListener'); - $listenerB = $this->_mock('Swift_Events_SendListener'); - - $this->_dispatcher->bindEventListener($listenerA); - $this->_dispatcher->bindEventListener($listenerB); - - $this->_checking(Expectations::create() - -> one($listenerA)->sendPerformed($evt) -> calls(array($this, '_cancelBubble')) - -> never($listenerB) - ); - - $this->_dispatcher->dispatchEvent($evt, 'sendPerformed'); - - $this->assertTrue($evt->bubbleCancelled()); - } - - public function testAddingListenerTwiceDoesNotReceiveEventTwice() - { - $transport = $this->_stub('Swift_Transport'); - - $evt = $this->_dispatcher->createTransportChangeEvent($transport); - - $listener = $this->_mock('Swift_Events_TransportChangeListener'); - - $this->_dispatcher->bindEventListener($listener); - $this->_dispatcher->bindEventListener($listener); - - $this->_checking(Expectations::create() - -> one($listener)->transportStarted($evt) - -> never($listener)->transportStarted($evt) - ); - - $this->_dispatcher->dispatchEvent($evt, 'transportStarted'); - } - - // -- Mock callbacks - - public function _cancelBubble(Yay_Invocation $inv) - { - $args = $inv->getArguments(); - $args[0]->cancelBubble(true); - } - - // -- Private methods - - private function _createDispatcher(array $map) - { - $dispatcher = new Swift_Events_SimpleEventDispatcher($map); - return $dispatcher; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportChangeEventTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportChangeEventTest.php deleted file mode 100644 index b78e315..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportChangeEventTest.php +++ /dev/null @@ -1,36 +0,0 @@ -_createTransport(); - $evt = $this->_createEvent($transport); - $ref = $evt->getTransport(); - $this->assertReference($transport, $ref); - } - - public function testSourceIsTransport() - { - $transport = $this->_createTransport(); - $evt = $this->_createEvent($transport); - $ref = $evt->getSource(); - $this->assertReference($transport, $ref); - } - - // -- Creation Methods - - private function _createEvent(Swift_Transport $source) - { - return new Swift_Events_TransportChangeEvent($source); - } - - private function _createTransport() - { - return $this->_stub('Swift_Transport'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportExceptionEventTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportExceptionEventTest.php deleted file mode 100644 index 430117a..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportExceptionEventTest.php +++ /dev/null @@ -1,49 +0,0 @@ -_createException(); - $transport = $this->_createTransport(); - $evt = $this->_createEvent($transport, $ex); - $ref = $evt->getException(); - $this->assertReference($ex, $ref, - '%s: Exception should be available via getException()' - ); - } - - public function testSourceIsTransport() - { - $ex = $this->_createException(); - $transport = $this->_createTransport(); - $evt = $this->_createEvent($transport, $ex); - $ref = $evt->getSource(); - $this->assertReference($transport, $ref, - '%s: Transport should be available via getSource()' - ); - } - - // -- Creation Methods - - private function _createEvent(Swift_Transport $transport, - Swift_TransportException $ex) - { - return new Swift_Events_TransportExceptionEvent($transport, $ex); - } - - private function _createTransport() - { - return $this->_stub('Swift_Transport'); - } - - private function _createException() - { - return new Swift_TransportException(''); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/ArrayKeyCacheTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/ArrayKeyCacheTest.php deleted file mode 100644 index 68ea3d1..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/ArrayKeyCacheTest.php +++ /dev/null @@ -1,242 +0,0 @@ -_createKeyCacheInputStream(true); - $cache = $this->_createCache($is); - $cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertEqual('test', $cache->getString($this->_key1, 'foo')); - } - - public function testStringDataCanBeOverwritten() - { - $is = $this->_createKeyCacheInputStream(true); - $cache = $this->_createCache($is); - $cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $cache->setString( - $this->_key1, 'foo', 'whatever', Swift_KeyCache::MODE_WRITE - ); - - $this->assertEqual('whatever', $cache->getString($this->_key1, 'foo')); - } - - public function testStringDataCanBeAppended() - { - $is = $this->_createKeyCacheInputStream(true); - $cache = $this->_createCache($is); - $cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $cache->setString( - $this->_key1, 'foo', 'ing', Swift_KeyCache::MODE_APPEND - ); - - $this->assertEqual('testing', $cache->getString($this->_key1, 'foo')); - } - - public function testHasKeyReturnValue() - { - $is = $this->_createKeyCacheInputStream(true); - $cache = $this->_createCache($is); - $cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - - $this->assertTrue($cache->hasKey($this->_key1, 'foo')); - } - - public function testNsKeyIsWellPartitioned() - { - $is = $this->_createKeyCacheInputStream(true); - $cache = $this->_createCache($is); - $cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $cache->setString( - $this->_key2, 'foo', 'ing', Swift_KeyCache::MODE_WRITE - ); - - $this->assertEqual('test', $cache->getString($this->_key1, 'foo')); - $this->assertEqual('ing', $cache->getString($this->_key2, 'foo')); - } - - public function testItemKeyIsWellPartitioned() - { - $is = $this->_createKeyCacheInputStream(true); - $cache = $this->_createCache($is); - $cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $cache->setString( - $this->_key1, 'bar', 'ing', Swift_KeyCache::MODE_WRITE - ); - - $this->assertEqual('test', $cache->getString($this->_key1, 'foo')); - $this->assertEqual('ing', $cache->getString($this->_key1, 'bar')); - } - - public function testByteStreamCanBeImported() - { - $os = $this->_createOutputStream(); - $this->_checking(Expectations::create() - -> one($os)->read(optional()) -> returns('abc') - -> one($os)->read(optional()) -> returns('def') - -> one($os)->read(optional()) -> returns(false) - -> ignoring($os) - ); - $is = $this->_createKeyCacheInputStream(true); - $cache = $this->_createCache($is); - $cache->importFromByteStream( - $this->_key1, 'foo', $os, Swift_KeyCache::MODE_WRITE - ); - $this->assertEqual('abcdef', $cache->getString($this->_key1, 'foo')); - } - - public function testByteStreamCanBeAppended() - { - $os1 = $this->_createOutputStream(); - $os2 = $this->_createOutputStream(); - $this->_checking(Expectations::create() - -> one($os1)->read(optional()) -> returns('abc') - -> one($os1)->read(optional()) -> returns('def') - -> one($os1)->read(optional()) -> returns(false) - -> ignoring($os1) - - -> one($os2)->read(optional()) -> returns('xyz') - -> one($os2)->read(optional()) -> returns('uvw') - -> one($os2)->read(optional()) -> returns(false) - -> ignoring($os2) - ); - $is = $this->_createKeyCacheInputStream(true); - - $cache = $this->_createCache($is); - - $cache->importFromByteStream( - $this->_key1, 'foo', $os1, Swift_KeyCache::MODE_APPEND - ); - $cache->importFromByteStream( - $this->_key1, 'foo', $os2, Swift_KeyCache::MODE_APPEND - ); - - $this->assertEqual('abcdefxyzuvw', $cache->getString($this->_key1, 'foo')); - } - - public function testByteStreamAndStringCanBeAppended() - { - $os = $this->_createOutputStream(); - $this->_checking(Expectations::create() - -> one($os)->read(optional()) -> returns('abc') - -> one($os)->read(optional()) -> returns('def') - -> one($os)->read(optional()) -> returns(false) - -> ignoring($os) - ); - $is = $this->_createKeyCacheInputStream(true); - - $cache = $this->_createCache($is); - - $cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_APPEND - ); - $cache->importFromByteStream( - $this->_key1, 'foo', $os, Swift_KeyCache::MODE_APPEND - ); - $this->assertEqual('testabcdef', $cache->getString($this->_key1, 'foo')); - } - - public function testDataCanBeExportedToByteStream() - { - //See acceptance test for more detail - $is = $this->_createInputStream(); - $this->_checking(Expectations::create() - -> atLeast(1)->of($is)->write(any()) - -> ignoring($is) - ); - $kcis = $this->_createKeyCacheInputStream(true); - - $cache = $this->_createCache($kcis); - - $cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - - $cache->exportToByteStream($this->_key1, 'foo', $is); - } - - public function testKeyCanBeCleared() - { - $is = $this->_createKeyCacheInputStream(true); - $cache = $this->_createCache($is); - - $cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($cache->hasKey($this->_key1, 'foo')); - $cache->clearKey($this->_key1, 'foo'); - $this->assertFalse($cache->hasKey($this->_key1, 'foo')); - } - - public function testNsKeyCanBeCleared() - { - $is = $this->_createKeyCacheInputStream(true); - $cache = $this->_createCache($is); - - $cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $cache->setString( - $this->_key1, 'bar', 'xyz', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($cache->hasKey($this->_key1, 'foo')); - $this->assertTrue($cache->hasKey($this->_key1, 'bar')); - $cache->clearAll($this->_key1); - $this->assertFalse($cache->hasKey($this->_key1, 'foo')); - $this->assertFalse($cache->hasKey($this->_key1, 'bar')); - } - - // -- Creation methods - - private function _createCache($is) - { - return new Swift_KeyCache_ArrayKeyCache($is); - } - - private function _createKeyCacheInputStream($stub = false) - { - return $stub - ? $this->_stub('Swift_KeyCache_KeyCacheInputStream') - : $this->_mock('Swift_KeyCache_KeyCacheInputStream') - ; - } - - private function _createOutputStream($stub = false) - { - return $stub - ? $this->_stub('Swift_OutputByteStream') - : $this->_mock('Swift_OutputByteStream') - ; - } - - private function _createInputStream($stub = false) - { - return $stub - ? $this->_stub('Swift_InputByteStream') - : $this->_mock('Swift_InputByteStream') - ; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/SimpleKeyCacheInputStreamTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/SimpleKeyCacheInputStreamTest.php deleted file mode 100644 index 94a86ba..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/SimpleKeyCacheInputStreamTest.php +++ /dev/null @@ -1,77 +0,0 @@ -_createKeyCache(); - $this->_checking(Expectations::create() - -> one($cache)->setString($this->_nsKey, 'foo', 'a', Swift_KeyCache::MODE_APPEND) - -> one($cache)->setString($this->_nsKey, 'foo', 'b', Swift_KeyCache::MODE_APPEND) - -> one($cache)->setString($this->_nsKey, 'foo', 'c', Swift_KeyCache::MODE_APPEND) - ); - - $stream = new Swift_KeyCache_SimpleKeyCacheInputStream(); - $stream->setKeyCache($cache); - $stream->setNsKey($this->_nsKey); - $stream->setItemKey('foo'); - - $stream->write('a'); - $stream->write('b'); - $stream->write('c'); - } - - public function testFlushContentClearsKey() - { - $cache = $this->_createKeyCache(); - $this->_checking(Expectations::create() - -> one($cache)->clearKey($this->_nsKey, 'foo') - ); - - $stream = new Swift_KeyCache_SimpleKeyCacheInputStream(); - $stream->setKeyCache($cache); - $stream->setNsKey($this->_nsKey); - $stream->setItemKey('foo'); - - $stream->flushBuffers(); - } - - public function testClonedStreamStillReferencesSameCache() - { - $cache = $this->_createKeyCache(); - $this->_checking(Expectations::create() - -> one($cache)->setString($this->_nsKey, 'foo', 'a', Swift_KeyCache::MODE_APPEND) - -> one($cache)->setString($this->_nsKey, 'foo', 'b', Swift_KeyCache::MODE_APPEND) - -> one($cache)->setString('test', 'bar', 'x', Swift_KeyCache::MODE_APPEND) - ); - - $stream = new Swift_KeyCache_SimpleKeyCacheInputStream(); - $stream->setKeyCache($cache); - $stream->setNsKey($this->_nsKey); - $stream->setItemKey('foo'); - - $stream->write('a'); - $stream->write('b'); - - $newStream = clone $stream; - $newStream->setKeyCache($cache); - $newStream->setNsKey('test'); - $newStream->setItemKey('bar'); - - $newStream->write('x'); - } - - // -- Creation Methods - - private function _createKeyCache() - { - return $this->_mock('Swift_KeyCache'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mailer/ArrayRecipientIteratorTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mailer/ArrayRecipientIteratorTest.php deleted file mode 100644 index f86b181..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mailer/ArrayRecipientIteratorTest.php +++ /dev/null @@ -1,46 +0,0 @@ -assertFalse($it->hasNext()); - } - - public function testHasNextReturnsTrueIfItemsLeft() - { - $it = new Swift_Mailer_ArrayRecipientIterator(array('foo@bar' => 'Foo')); - $this->assertTrue($it->hasNext()); - } - - public function testReadingToEndOfListCausesHasNextToReturnFalse() - { - $it = new Swift_Mailer_ArrayRecipientIterator(array('foo@bar' => 'Foo')); - $this->assertTrue($it->hasNext()); - $it->nextRecipient(); - $this->assertFalse($it->hasNext()); - } - - public function testReturnedValueHasPreservedKeyValuePair() - { - $it = new Swift_Mailer_ArrayRecipientIterator(array('foo@bar' => 'Foo')); - $this->assertEqual(array('foo@bar' => 'Foo'), $it->nextRecipient()); - } - - public function testIteratorMovesNextAfterEachIteration() - { - $it = new Swift_Mailer_ArrayRecipientIterator(array( - 'foo@bar' => 'Foo', - 'zip@button' => 'Zip thing', - 'test@test' => null - )); - $this->assertEqual(array('foo@bar' => 'Foo'), $it->nextRecipient()); - $this->assertEqual(array('zip@button' => 'Zip thing'), $it->nextRecipient()); - $this->assertEqual(array('test@test' => null), $it->nextRecipient()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/MailerTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/MailerTest.php deleted file mode 100644 index 48c209d..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/MailerTest.php +++ /dev/null @@ -1,149 +0,0 @@ -_createTransport(); - $message = $this->_createMessage(); - $con = $this->_states('Connection')->startsAs('off'); - $this->_checking(Expectations::create() - -> allowing($transport)->isStarted() -> returns(false) -> when($con->is('off')) - -> allowing($transport)->isStarted() -> returns(false) -> when($con->is('on')) - -> one($transport)->start() -> when($con->is('off')) -> then($con->is('on')) - -> ignoring($transport) - -> ignoring($message) - ); - - $mailer = $this->_createMailer($transport); - $mailer->send($message); - } - - public function testTransportIsOnlyStartedOnce() - { - $transport = $this->_createTransport(); - $message = $this->_createMessage(); - $con = $this->_states('Connection')->startsAs('off'); - $this->_checking(Expectations::create() - -> allowing($transport)->isStarted() -> returns(false) -> when($con->is('off')) - -> allowing($transport)->isStarted() -> returns(false) -> when($con->is('on')) - -> one($transport)->start() -> when($con->is('off')) -> then($con->is('on')) - -> ignoring($transport) - -> ignoring($message) - ); - $mailer = $this->_createMailer($transport); - for ($i = 0; $i < 10; ++$i) { - $mailer->send($message); - } - } - - public function testMessageIsPassedToTransport() - { - $transport = $this->_createTransport(); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> one($transport)->send($message, optional()) - -> ignoring($transport) - -> ignoring($message) - ); - - $mailer = $this->_createMailer($transport); - $mailer->send($message); - } - - public function testSendReturnsCountFromTransport() - { - $transport = $this->_createTransport(); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> one($transport)->send($message, optional()) -> returns(57) - -> ignoring($transport) - -> ignoring($message) - ); - - $mailer = $this->_createMailer($transport); - $this->assertEqual(57, $mailer->send($message)); - } - - public function testFailedRecipientReferenceIsPassedToTransport() - { - $failures = array(); - - $transport = $this->_createTransport(); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> one($transport)->send($message, reference($failures)) - -> ignoring($transport) - -> ignoring($message) - ); - - $mailer = $this->_createMailer($transport); - $mailer->send($message, $failures); - } - - public function testSendRecordsRfcComplianceExceptionAsEntireSendFailure() - { - $failures = array(); - - $rfcException = new Swift_RfcComplianceException('test'); - $transport = $this->_createTransport(); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getTo() -> returns(array('foo&invalid' => 'Foo', 'bar@valid.tld' => 'Bar')) - -> one($transport)->send($message, reference($failures)) -> throws($rfcException) - -> ignoring($transport) - -> ignoring($message) - ); - - $mailer = $this->_createMailer($transport); - $this->assertEqual(0, $mailer->send($message, $failures), '%s: Should return 0'); - $this->assertEqual(array('foo&invalid', 'bar@valid.tld'), $failures, '%s: Failures should contain all addresses since the entire message failed to compile'); - } - - public function testRegisterPluginDelegatesToTransport() - { - $plugin = $this->_createPlugin(); - $transport = $this->_createTransport(); - $mailer = $this->_createMailer($transport); - - $this->_checking(Expectations::create() - -> one($transport)->registerPlugin($plugin) - ); - $mailer->registerPlugin($plugin); - } - - // -- Creation methods - - private function _createPlugin() - { - return $this->_mock('Swift_Events_EventListener'); - } - - private function _createTransport() - { - return $this->_mock('Swift_Transport'); - } - - private function _createMessage() - { - return $this->_mock('Swift_Mime_Message'); - } - - private function _createIterator() - { - return $this->_mock('Swift_Mailer_RecipientIterator'); - } - - private function _createMailer(Swift_Transport $transport) - { - return new Swift_Mailer($transport); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AbstractMimeEntityTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AbstractMimeEntityTest.php deleted file mode 100644 index a4fba32..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AbstractMimeEntityTest.php +++ /dev/null @@ -1,1094 +0,0 @@ -_createHeaderSet(); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $this->assertSame($headers, $entity->getHeaders()); - } - - public function testContentTypeIsReturnedFromHeader() - { - $ctype = $this->_createHeader('Content-Type', 'image/jpeg-test'); - $headers = $this->_createHeaderSet(array('Content-Type' => $ctype)); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $this->assertEqual('image/jpeg-test', $entity->getContentType()); - } - - public function testContentTypeIsSetInHeader() - { - $ctype = $this->_createHeader('Content-Type', 'text/plain', array(), false); - $headers = $this->_createHeaderSet(array('Content-Type' => $ctype)); - $this->_checking(Expectations::create() - -> one($ctype)->setFieldBodyModel('image/jpeg') - -> ignoring($ctype) - ); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setContentType('image/jpeg'); - } - - public function testContentTypeHeaderIsAddedIfNoneSet() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addParameterizedHeader('Content-Type', 'image/jpeg') - -> ignoring($headers) - ); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setContentType('image/jpeg'); - } - - public function testContentTypeCanBeSetViaSetBody() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addParameterizedHeader('Content-Type', 'text/html') - -> ignoring($headers) - ); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setBody('foo', 'text/html'); - } - - public function testGetEncoderFromConstructor() - { - $encoder = $this->_createEncoder('base64'); - $entity = $this->_createEntity($this->_createHeaderSet(), $encoder, - $this->_createCache() - ); - $this->assertSame($encoder, $entity->getEncoder()); - } - - public function testSetAndGetEncoder() - { - $encoder = $this->_createEncoder('base64'); - $headers = $this->_createHeaderSet(); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setEncoder($encoder); - $this->assertSame($encoder, $entity->getEncoder()); - } - - public function testSettingEncoderUpdatesTransferEncoding() - { - $encoder = $this->_createEncoder('base64'); - $encoding = $this->_createHeader( - 'Content-Transfer-Encoding', '8bit', array(), false - ); - $headers = $this->_createHeaderSet(array( - 'Content-Transfer-Encoding' => $encoding - )); - $this->_checking(Expectations::create() - -> one($encoding)->setFieldBodyModel('base64') - -> ignoring($encoding) - ); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setEncoder($encoder); - } - - public function testSettingEncoderAddsEncodingHeaderIfNonePresent() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addTextHeader('Content-Transfer-Encoding', 'something') - -> ignoring($headers) - ); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setEncoder($this->_createEncoder('something')); - } - - public function testIdIsReturnedFromHeader() - { - /* -- RFC 2045, 7. - In constructing a high-level user agent, it may be desirable to allow - one body to make reference to another. Accordingly, bodies may be - labelled using the "Content-ID" header field, which is syntactically - identical to the "Message-ID" header field - */ - - $cid = $this->_createHeader('Content-ID', 'zip@button'); - $headers = $this->_createHeaderSet(array('Content-ID' => $cid)); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $this->assertEqual('zip@button', $entity->getId()); - } - - public function testIdIsSetInHeader() - { - $cid = $this->_createHeader('Content-ID', 'zip@button', array(), false); - $headers = $this->_createHeaderSet(array('Content-ID' => $cid)); - $this->_checking(Expectations::create() - -> one($cid)->setFieldBodyModel('foo@bar') - -> ignoring($cid) - ); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setId('foo@bar'); - } - - public function testIdIsAutoGenerated() - { - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertPattern('/^.*?@.*?$/D', $entity->getId()); - } - - public function testGenerateIdCreatesNewId() - { - $headers = $this->_createHeaderSet(); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $id1 = $entity->generateId(); - $id2 = $entity->generateId(); - $this->assertNotEqual($id1, $id2); - } - - public function testGenerateIdSetsNewId() - { - $headers = $this->_createHeaderSet(); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $id = $entity->generateId(); - $this->assertEqual($id, $entity->getId()); - } - - public function testDescriptionIsReadFromHeader() - { - /* -- RFC 2045, 8. - The ability to associate some descriptive information with a given - body is often desirable. For example, it may be useful to mark an - "image" body as "a picture of the Space Shuttle Endeavor." Such text - may be placed in the Content-Description header field. This header - field is always optional. - */ - - $desc = $this->_createHeader('Content-Description', 'something'); - $headers = $this->_createHeaderSet(array('Content-Description' => $desc)); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $this->assertEqual('something', $entity->getDescription()); - } - - public function testDescriptionIsSetInHeader() - { - $desc = $this->_createHeader('Content-Description', '', array(), false); - $headers = $this->_createHeaderSet(array('Content-Description' => $desc)); - $this->_checking(Expectations::create() - -> one($desc)->setFieldBodyModel('whatever') - -> ignoring($desc) - ); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setDescription('whatever'); - } - - public function testDescriptionHeaderIsAddedIfNotPresent() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addTextHeader('Content-Description', 'whatever') - -> ignoring($headers) - ); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setDescription('whatever'); - } - - public function testSetAndGetMaxLineLength() - { - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setMaxLineLength(60); - $this->assertEqual(60, $entity->getMaxLineLength()); - } - - public function testEncoderIsUsedForStringGeneration() - { - $encoder = $this->_createEncoder('base64', false); - $this->_checking(Expectations::create() - -> one($encoder)->encodeString('blah', optional()) - -> ignoring($encoder) - ); - $entity = $this->_createEntity($this->_createHeaderSet(), - $encoder, $this->_createCache() - ); - $entity->setBody("blah"); - $entity->toString(); - } - - public function testMaxLineLengthIsProvidedWhenEncoding() - { - $encoder = $this->_createEncoder('base64', false); - $this->_checking(Expectations::create() - -> one($encoder)->encodeString('blah', 0, 65) - -> ignoring($encoder) - ); - $entity = $this->_createEntity($this->_createHeaderSet(), - $encoder, $this->_createCache() - ); - $entity->setBody("blah"); - $entity->setMaxLineLength(65); - $entity->toString(); - } - - public function testHeadersAppearInString() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> ignoring($headers)->toString() -> returns( - "Content-Type: text/plain; charset=utf-8\r\n" . - "X-MyHeader: foobar\r\n" - ) - -> ignoring($headers) - ); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $this->assertEqual( - "Content-Type: text/plain; charset=utf-8\r\n" . - "X-MyHeader: foobar\r\n", - $entity->toString() - ); - } - - public function testSetAndGetBody() - { - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setBody("blah\r\nblah!"); - $this->assertEqual("blah\r\nblah!", $entity->getBody()); - } - - public function testBodyIsAppended() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> ignoring($headers)->toString() -> returns( - "Content-Type: text/plain; charset=utf-8\r\n" - ) - -> ignoring($headers) - ); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setBody("blah\r\nblah!"); - $this->assertEqual( - "Content-Type: text/plain; charset=utf-8\r\n" . - "\r\n" . - "blah\r\nblah!", - $entity->toString() - ); - } - - public function testGetBodyReturnsStringFromByteStream() - { - $os = $this->_createOutputStream("byte stream string"); - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setBody($os); - $this->assertEqual("byte stream string", $entity->getBody()); - } - - public function testByteStreamBodyIsAppended() - { - $headers = $this->_createHeaderSet(array(), false); - $os = $this->_createOutputStream("streamed"); - $this->_checking(Expectations::create() - -> ignoring($headers)->toString() -> returns( - "Content-Type: text/plain; charset=utf-8\r\n" - ) - -> ignoring($headers) - ); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setBody($os); - $this->assertEqual( - "Content-Type: text/plain; charset=utf-8\r\n" . - "\r\n" . - "streamed", - $entity->toString() - ); - } - - public function testBoundaryCanBeRetrieved() - { - /* -- RFC 2046, 5.1.1. - boundary := 0*69 bcharsnospace - - bchars := bcharsnospace / " " - - bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / - "+" / "_" / "," / "-" / "." / - "/" / ":" / "=" / "?" - */ - - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertPattern( - '/^[a-zA-Z0-9\'\(\)\+_\-,\.\/:=\?\ ]{0,69}[a-zA-Z0-9\'\(\)\+_\-,\.\/:=\?]$/D', - $entity->getBoundary() - ); - } - - public function testBoundaryNeverChanges() - { - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $firstBoundary = $entity->getBoundary(); - for ($i = 0; $i < 10; $i++) { - $this->assertEqual($firstBoundary, $entity->getBoundary()); - } - } - - public function testBoundaryCanBeSet() - { - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setBoundary('foobar'); - $this->assertEqual('foobar', $entity->getBoundary()); - } - - public function testAddingChildrenGeneratesBoundaryInHeaders() - { - $child = $this->_createChild(); - $cType = $this->_createHeader('Content-Type', 'text/plain', array(), false); - $this->_checking(Expectations::create() - -> one($cType)->setParameter('boundary', any()) - -> ignoring($cType) - ); - - $entity = $this->_createEntity($this->_createHeaderSet(array( - 'Content-Type' => $cType - )), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setChildren(array($child)); - } - - public function testChildrenOfLevelAttachmentAndLessCauseMultipartMixed() - { - for ($level = Swift_Mime_MimeEntity::LEVEL_MIXED; - $level > Swift_Mime_MimeEntity::LEVEL_TOP; $level /= 2) - { - $child = $this->_createChild($level); - $cType = $this->_createHeader( - 'Content-Type', 'text/plain', array(), false - ); - $this->_checking(Expectations::create() - -> one($cType)->setFieldBodyModel('multipart/mixed') - -> ignoring($cType) - ); - $entity = $this->_createEntity($this->_createHeaderSet(array( - 'Content-Type' => $cType)), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setChildren(array($child)); - } - } - - public function testChildrenOfLevelAlternativeAndLessCauseMultipartAlternative() - { - for ($level = Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE; - $level > Swift_Mime_MimeEntity::LEVEL_MIXED; $level /= 2) - { - $child = $this->_createChild($level); - $cType = $this->_createHeader( - 'Content-Type', 'text/plain', array(), false - ); - $this->_checking(Expectations::create() - -> one($cType)->setFieldBodyModel('multipart/alternative') - -> ignoring($cType) - ); - $entity = $this->_createEntity($this->_createHeaderSet(array( - 'Content-Type' => $cType)), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setChildren(array($child)); - } - } - - public function testChildrenOfLevelRelatedAndLessCauseMultipartRelated() - { - for ($level = Swift_Mime_MimeEntity::LEVEL_RELATED; - $level > Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE; $level /= 2) - { - $child = $this->_createChild($level); - $cType = $this->_createHeader( - 'Content-Type', 'text/plain', array(), false - ); - $this->_checking(Expectations::create() - -> one($cType)->setFieldBodyModel('multipart/related') - -> ignoring($cType) - ); - $entity = $this->_createEntity($this->_createHeaderSet(array( - 'Content-Type' => $cType)), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setChildren(array($child)); - } - } - - public function testHighestLevelChildDeterminesContentType() - { - $combinations = array( - array('levels' => array(Swift_Mime_MimeEntity::LEVEL_MIXED, - Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, - Swift_Mime_MimeEntity::LEVEL_RELATED - ), - 'type' => 'multipart/mixed' - ), - array('levels' => array(Swift_Mime_MimeEntity::LEVEL_MIXED, - Swift_Mime_MimeEntity::LEVEL_RELATED - ), - 'type' => 'multipart/mixed' - ), - array('levels' => array(Swift_Mime_MimeEntity::LEVEL_MIXED, - Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE - ), - 'type' => 'multipart/mixed' - ), - array('levels' => array(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, - Swift_Mime_MimeEntity::LEVEL_RELATED - ), - 'type' => 'multipart/alternative' - ) - ); - - foreach ($combinations as $combination) { - $children = array(); - foreach ($combination['levels'] as $level) { - $children[] = $this->_createChild($level); - } - - $cType = $this->_createHeader( - 'Content-Type', 'text/plain', array(), false - ); - $this->_checking(Expectations::create() - -> one($cType)->setFieldBodyModel($combination['type']) - -> ignoring($cType) - ); - $entity = $this->_createEntity($this->_createHeaderSet(array( - 'Content-Type' => $cType)), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setChildren($children); - } - } - - public function testChildrenAppearNestedInString() - { - /* -- RFC 2046, 5.1.1. - (excerpt too verbose to paste here) - */ - - $headers = $this->_createHeaderSet(array(), false); - - $child1 = $this->_createChild(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, - "Content-Type: text/plain\r\n" . - "\r\n" . - "foobar" - ); - - $child2 = $this->_createChild(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, - "Content-Type: text/html\r\n" . - "\r\n" . - "foobar" - ); - - $this->_checking(Expectations::create() - -> ignoring($headers)->toString() -> returns( - "Content-Type: multipart/alternative; boundary=\"xxx\"\r\n" - ) - -> ignoring($headers) - ); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setBoundary('xxx'); - $entity->setChildren(array($child1, $child2)); - - $this->assertEqual( - "Content-Type: multipart/alternative; boundary=\"xxx\"\r\n" . - "\r\n" . - "\r\n--xxx\r\n" . - "Content-Type: text/plain\r\n" . - "\r\n" . - "foobar\r\n" . - "\r\n--xxx\r\n" . - "Content-Type: text/html\r\n" . - "\r\n" . - "foobar\r\n" . - "\r\n--xxx--\r\n", - $entity->toString() - ); - } - - public function testMixingLevelsIsHierarchical() - { - $headers = $this->_createHeaderSet(array(), false); - $newHeaders = $this->_createHeaderSet(array(), false); - - $part = $this->_createChild(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, - "Content-Type: text/plain\r\n" . - "\r\n" . - "foobar" - ); - - $attachment = $this->_createChild(Swift_Mime_MimeEntity::LEVEL_MIXED, - "Content-Type: application/octet-stream\r\n" . - "\r\n" . - "data" - ); - - $this->_checking(Expectations::create() - -> ignoring($headers)->toString() -> returns( - "Content-Type: multipart/mixed; boundary=\"xxx\"\r\n" - ) - -> ignoring($headers)->newInstance() -> returns($newHeaders) - -> ignoring($headers) - -> ignoring($newHeaders)->toString() -> returns( - "Content-Type: multipart/alternative; boundary=\"yyy\"\r\n" - ) - -> ignoring($newHeaders) - ); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setBoundary('xxx'); - $entity->setChildren(array($part, $attachment)); - - $this->assertPattern( - "~^" . - "Content-Type: multipart/mixed; boundary=\"xxx\"\r\n" . - "\r\n\r\n--xxx\r\n" . - "Content-Type: multipart/alternative; boundary=\"yyy\"\r\n" . - "\r\n\r\n--(.*?)\r\n" . - "Content-Type: text/plain\r\n" . - "\r\n" . - "foobar" . - "\r\n\r\n--\\1--\r\n" . - "\r\n\r\n--xxx\r\n" . - "Content-Type: application/octet-stream\r\n" . - "\r\n" . - "data" . - "\r\n\r\n--xxx--\r\n" . - "\$~", - $entity->toString() - ); - } - - public function testSettingEncoderNotifiesChildren() - { - $child = $this->_createChild(0, '', false); - $encoder = $this->_createEncoder('base64'); - - $this->_checking(Expectations::create() - -> one($child)->encoderChanged($encoder) - -> ignoring($child) - ); - - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setChildren(array($child)); - $entity->setEncoder($encoder); - } - - public function testReceiptOfEncoderChangeNotifiesChildren() - { - $child = $this->_createChild(0, '', false); - $encoder = $this->_createEncoder('base64'); - - $this->_checking(Expectations::create() - -> one($child)->encoderChanged($encoder) - -> ignoring($child) - ); - - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setChildren(array($child)); - $entity->encoderChanged($encoder); - } - - public function testReceiptOfCharsetChangeNotifiesChildren() - { - $child = $this->_createChild(0, '', false); - - $this->_checking(Expectations::create() - -> one($child)->charsetChanged('windows-874') - -> ignoring($child) - ); - - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setChildren(array($child)); - $entity->charsetChanged('windows-874'); - } - - public function testEntityIsWrittenToByteStream() - { - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $is = $this->_createInputStream(false); - $this->_checking(Expectations::create() - -> atLeast(1)->of($is)->write(any()) - -> ignoring($is) - ); - - $entity->toByteStream($is); - } - - public function testEntityHeadersAreComittedToByteStream() - { - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $is = $this->_createInputStream(false); - $this->_checking(Expectations::create() - -> atLeast(1)->of($is)->commit() - -> atLeast(1)->of($is)->write(any()) - -> ignoring($is) - ); - - $entity->toByteStream($is); - } - - public function testOrderingTextBeforeHtml() - { - $htmlChild = $this->_createChild(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, - "Content-Type: text/html\r\n" . - "\r\n" . - "HTML PART", - false - ); - $textChild = $this->_createChild(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, - "Content-Type: text/plain\r\n" . - "\r\n" . - "TEXT PART", - false - ); - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> ignoring($headers)->toString() -> returns( - "Content-Type: multipart/alternative; boundary=\"xxx\"\r\n" - ) - -> ignoring($headers) - -> ignoring($htmlChild)->getContentType() -> returns('text/html') - -> ignoring($htmlChild) - -> ignoring($textChild)->getContentType() -> returns('text/plain') - -> ignoring($textChild) - ); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setBoundary('xxx'); - $entity->setChildren(array($htmlChild, $textChild)); - - $this->assertEqual( - "Content-Type: multipart/alternative; boundary=\"xxx\"\r\n" . - "\r\n\r\n--xxx\r\n" . - "Content-Type: text/plain\r\n" . - "\r\n" . - "TEXT PART" . - "\r\n\r\n--xxx\r\n" . - "Content-Type: text/html\r\n" . - "\r\n" . - "HTML PART" . - "\r\n\r\n--xxx--\r\n", - $entity->toString() - ); - } - - public function testUnsettingChildrenRestoresContentType() - { - $cType = $this->_createHeader('Content-Type', 'text/plain', array(), false); - $child = $this->_createChild(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE); - - $s = $this->_mockery()->sequence('Type setting'); - $this->_checking(Expectations::create() - -> one($cType)->setFieldBodyModel('image/jpeg') -> inSequence($s) - -> one($cType)->setFieldBodyModel('multipart/alternative') -> inSequence($s) - -> one($cType)->setFieldBodyModel('image/jpeg') -> inSequence($s) - -> ignoring($cType) - ); - - $entity = $this->_createEntity($this->_createHeaderSet(array( - 'Content-Type' => $cType - )), - $this->_createEncoder(), $this->_createCache() - ); - - $entity->setContentType('image/jpeg'); - $entity->setChildren(array($child)); - $entity->setChildren(array()); - } - - public function testBodyIsReadFromCacheWhenUsingToStringIfPresent() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> ignoring($headers)->toString() -> returns( - "Content-Type: text/plain; charset=utf-8\r\n" - ) - -> ignoring($headers) - ); - - $cache = $this->_createCache(false); - $this->_checking(Expectations::create() - -> one($cache)->hasKey(any(), 'body') -> returns(true) - -> one($cache)->getString(any(), 'body') -> returns("\r\ncache\r\ncache!") - -> ignoring($cache) - ); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $cache - ); - - $entity->setBody("blah\r\nblah!"); - $this->assertEqual( - "Content-Type: text/plain; charset=utf-8\r\n" . - "\r\n" . - "cache\r\ncache!", - $entity->toString() - ); - } - - public function testBodyIsAddedToCacheWhenUsingToString() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> ignoring($headers)->toString() -> returns( - "Content-Type: text/plain; charset=utf-8\r\n" - ) - -> ignoring($headers) - ); - - $cache = $this->_createCache(false); - $this->_checking(Expectations::create() - -> one($cache)->hasKey(any(), 'body') -> returns(false) - -> one($cache)->setString(any(), 'body', "\r\nblah\r\nblah!", Swift_KeyCache::MODE_WRITE) - -> ignoring($cache) - ); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $cache - ); - - $entity->setBody("blah\r\nblah!"); - $entity->toString(); - } - - public function testBodyIsClearedFromCacheIfNewBodySet() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> ignoring($headers)->toString() -> returns( - "Content-Type: text/plain; charset=utf-8\r\n" - ) - -> ignoring($headers) - ); - - $cache = $this->_createCache(false); - $this->_checking(Expectations::create() - -> one($cache)->clearKey(any(), 'body') - -> ignoring($cache) - ); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $cache - ); - - $entity->setBody("blah\r\nblah!"); - $entity->toString(); - - $entity->setBody("new\r\nnew!"); - } - - public function testBodyIsNotClearedFromCacheIfSameBodySet() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> ignoring($headers)->toString() -> returns( - "Content-Type: text/plain; charset=utf-8\r\n" - ) - -> ignoring($headers) - ); - - $cache = $this->_createCache(false); - $this->_checking(Expectations::create() - -> never($cache)->clearKey(any(), 'body') - -> ignoring($cache) - ); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $cache - ); - - $entity->setBody("blah\r\nblah!"); - $entity->toString(); - - $entity->setBody("blah\r\nblah!"); - } - - public function testBodyIsClearedFromCacheIfNewEncoderSet() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> ignoring($headers)->toString() -> returns( - "Content-Type: text/plain; charset=utf-8\r\n" - ) - -> ignoring($headers) - ); - - $cache = $this->_createCache(false); - $this->_checking(Expectations::create() - -> one($cache)->clearKey(any(), 'body') - -> ignoring($cache) - ); - - $otherEncoder = $this->_createEncoder(); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $cache - ); - - $entity->setBody("blah\r\nblah!"); - $entity->toString(); - - $entity->setEncoder($otherEncoder); - } - - public function testBodyIsReadFromCacheWhenUsingToByteStreamIfPresent() - { - $is = $this->_createInputStream(); - $cache = $this->_createCache(false); - - $this->_checking(Expectations::create() - -> one($cache)->hasKey(any(), 'body') -> returns(true) - -> one($cache)->exportToByteStream(any(), 'body', $is) - -> ignoring($cache) - ); - - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $cache - ); - $entity->setBody('foo'); - - $entity->toByteStream($is); - } - - public function testBodyIsAddedToCacheWhenUsingToByteStream() - { - $is = $this->_createInputStream(); - $cache = $this->_createCache(false); - - $this->_checking(Expectations::create() - -> one($cache)->hasKey(any(), 'body') -> returns(false) - //The input stream should be fetched for writing - // Proving that it's actually written to is possible, but extremely - // fragile. Best let the acceptance tests cover this aspect - -> one($cache)->getInputByteStream(any(), 'body') - -> ignoring($cache) - ); - - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $cache - ); - $entity->setBody('foo'); - - $entity->toByteStream($is); - } - - public function testFluidInterface() - { - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - - $this->assertSame($entity, - $entity - ->setContentType('text/plain') - ->setEncoder($this->_createEncoder()) - ->setId('foo@bar') - ->setDescription('my description') - ->setMaxLineLength(998) - ->setBody('xx') - ->setBoundary('xyz') - ->setChildren(array()) - ); - } - - // -- Private helpers - - abstract protected function _createEntity($headers, $encoder, $cache); - - protected function _createChild($level = null, $string = '', $stub = true) - { - $child = $this->_mock('Swift_Mime_MimeEntity'); - if (isset($level)) { - $this->_checking(Expectations::create() - -> ignoring($child)->getNestingLevel() -> returns($level) - ); - } - $this->_checking(Expectations::create() - -> ignoring($child)->toString() -> returns($string) - ); - if ($stub) { - $this->_checking(Expectations::create() - -> ignoring($child) - ); - } - return $child; - } - - protected function _createEncoder($name = 'quoted-printable', $stub = true) - { - $encoder = $this->_mock('Swift_Mime_ContentEncoder'); - $this->_checking(Expectations::create() - -> ignoring($encoder)->getName() -> returns($name) - ); - - if ($stub) { - $this->_checking(Expectations::create() - -> ignoring($encoder)->encodeString(any(), optional()) - -> calls(array($this, 'returnStringFromEncoder')) - -> ignoring($encoder) - ); - } - return $encoder; - } - - protected function _createCache($stub = true) - { - $cache = $this->_mock('Swift_KeyCache'); - - if ($stub) { - $this->_checking(Expectations::create() - -> ignoring($cache) - ); - } - return $cache; - } - - protected function _createHeaderSet($headers = array(), $stub = true) - { - $set = $this->_mock('Swift_Mime_HeaderSet'); - foreach ($headers as $key => $header) { - $this->_checking(Expectations::create() - -> ignoring($set)->has($key) -> returns(true) - -> ignoring($set)->get($key) -> returns($header) - ); - } - if ($stub) { - $this->_checking(Expectations::create() - -> ignoring($set)->newInstance() -> returns($set) - -> ignoring($set) - ); - } - return $set; - } - - protected function _createHeader($name, $model = null, $params = array(), $stub = true) - { - $header = $this->_mock('Swift_Mime_ParameterizedHeader'); - $this->_checking(Expectations::create() - -> ignoring($header)->getFieldName() -> returns($name) - -> ignoring($header)->getFieldBodyModel() -> returns($model) - ); - foreach ($params as $key => $value) { - $this->_checking(Expectations::create() - -> ignoring($header)->getParameter($key) -> returns($value) - ); - } - if ($stub) { - $this->_checking(Expectations::create() - -> ignoring($header) - ); - } - return $header; - } - - protected function _createOutputStream($data = null, $stub = true) - { - $os = $this->_mock('Swift_OutputByteStream'); - if (isset($data)) { - $pos = $this->_mockery()->states('position')->startsAs('at beginning'); - $this->_checking(Expectations::create() - -> ignoring($os)->read(optional()) -> returns($data) - -> when($pos->isNot('at end')) -> then($pos->is('at end')) - - -> ignoring($os)->read(optional()) -> returns(false) - ); - if ($stub) { - $this->_checking(Expectations::create() - -> ignoring($os) - ); - } - } - return $os; - } - - protected function _createInputStream($stub = true) - { - $is = $this->_mock('Swift_InputByteStream'); - if ($stub) { - $this->_checking(Expectations::create() - -> ignoring($is) - ); - } - return $is; - } - - // -- Mock helpers - - public function returnStringFromEncoder(Yay_Invocation $invocation) - { - $args = $invocation->getArguments(); - return array_shift($args); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AttachmentTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AttachmentTest.php deleted file mode 100644 index ff3b810..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AttachmentTest.php +++ /dev/null @@ -1,297 +0,0 @@ -_createAttachment($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual( - Swift_Mime_MimeEntity::LEVEL_MIXED, $attachment->getNestingLevel() - ); - } - - public function testDispositionIsReturnedFromHeader() - { - /* -- RFC 2183, 2.1, 2.2. - */ - - $disposition = $this->_createHeader('Content-Disposition', 'attachment'); - $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual('attachment', $attachment->getDisposition()); - } - - public function testDispositionIsSetInHeader() - { - $disposition = $this->_createHeader('Content-Disposition', 'attachment', - array(), false - ); - $this->_checking(Expectations::create() - -> one($disposition)->setFieldBodyModel('inline') - -> ignoring($disposition) - ); - $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition)), - $this->_createEncoder(), $this->_createCache() - ); - $attachment->setDisposition('inline'); - } - - public function testDispositionIsAddedIfNonePresent() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addParameterizedHeader('Content-Disposition', 'inline') - -> ignoring($headers) - ); - $attachment = $this->_createAttachment($headers, $this->_createEncoder(), - $this->_createCache() - ); - $attachment->setDisposition('inline'); - } - - public function testDispositionIsAutoDefaultedToAttachment() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addParameterizedHeader('Content-Disposition', 'attachment') - -> ignoring($headers) - ); - $attachment = $this->_createAttachment($headers, $this->_createEncoder(), - $this->_createCache() - ); - } - - public function testDefaultContentTypeInitializedToOctetStream() - { - $cType = $this->_createHeader('Content-Type', '', - array(), false - ); - $this->_checking(Expectations::create() - -> one($cType)->setFieldBodyModel('application/octet-stream') - -> ignoring($cType) - ); - $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Type' => $cType)), - $this->_createEncoder(), $this->_createCache() - ); - } - - public function testFilenameIsReturnedFromHeader() - { - /* -- RFC 2183, 2.3. - */ - - $disposition = $this->_createHeader('Content-Disposition', 'attachment', - array('filename'=>'foo.txt') - ); - $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual('foo.txt', $attachment->getFilename()); - } - - public function testFilenameIsSetInHeader() - { - $disposition = $this->_createHeader('Content-Disposition', 'attachment', - array('filename'=>'foo.txt'), false - ); - $this->_checking(Expectations::create() - -> one($disposition)->setParameter('filename', 'bar.txt') - -> ignoring($disposition) - ); - $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition)), - $this->_createEncoder(), $this->_createCache() - ); - $attachment->setFilename('bar.txt'); - } - - public function testSettingFilenameSetsNameInContentType() - { - /* - This is a legacy requirement which isn't covered by up-to-date RFCs. - */ - - $cType = $this->_createHeader('Content-Type', 'text/plain', - array(), false - ); - $this->_checking(Expectations::create() - -> one($cType)->setParameter('name', 'bar.txt') - -> ignoring($cType) - ); - $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Type' => $cType)), - $this->_createEncoder(), $this->_createCache() - ); - $attachment->setFilename('bar.txt'); - } - - public function testSizeIsReturnedFromHeader() - { - /* -- RFC 2183, 2.7. - */ - - $disposition = $this->_createHeader('Content-Disposition', 'attachment', - array('size'=>1234) - ); - $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual(1234, $attachment->getSize()); - } - - public function testSizeIsSetInHeader() - { - $disposition = $this->_createHeader('Content-Disposition', 'attachment', - array(), false - ); - $this->_checking(Expectations::create() - -> one($disposition)->setParameter('size', 12345) - -> ignoring($disposition) - ); - $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition)), - $this->_createEncoder(), $this->_createCache() - ); - $attachment->setSize(12345); - } - - public function testFilnameCanBeReadFromFileStream() - { - $file = $this->_createFileStream('/bar/file.ext', ''); - $disposition = $this->_createHeader('Content-Disposition', 'attachment', - array('filename'=>'foo.txt'), false - ); - $this->_checking(Expectations::create() - -> one($disposition)->setParameter('filename', 'file.ext') - -> ignoring($disposition) - ); - $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition)), - $this->_createEncoder(), $this->_createCache() - ); - $attachment->setFile($file); - } - - public function testContentTypeCanBeSetViaSetFile() - { - $file = $this->_createFileStream('/bar/file.ext', ''); - $disposition = $this->_createHeader('Content-Disposition', 'attachment', - array('filename'=>'foo.txt'), false - ); - $ctype = $this->_createHeader('Content-Type', 'text/plain', array(), false); - $headers = $this->_createHeaderSet(array( - 'Content-Disposition' => $disposition, - 'Content-Type' => $ctype - )); - $this->_checking(Expectations::create() - -> one($disposition)->setParameter('filename', 'file.ext') - -> one($ctype)->setFieldBodyModel('text/html') - -> ignoring($disposition) - -> ignoring($ctype) - ); - $attachment = $this->_createAttachment($headers, $this->_createEncoder(), - $this->_createCache() - ); - $attachment->setFile($file, 'text/html'); - } - - public function XtestContentTypeCanBeLookedUpFromCommonListIfNotProvided() - { - $file = $this->_createFileStream('/bar/file.zip', ''); - $disposition = $this->_createHeader('Content-Disposition', 'attachment', - array('filename'=>'foo.zip'), false - ); - $ctype = $this->_createHeader('Content-Type', 'text/plain', array(), false); - $headers = $this->_createHeaderSet(array( - 'Content-Disposition' => $disposition, - 'Content-Type' => $ctype - )); - $this->_checking(Expectations::create() - -> one($disposition)->setParameter('filename', 'file.zip') - -> one($ctype)->setFieldBodyModel('application/zip') - -> ignoring($disposition) - -> ignoring($ctype) - ); - $attachment = $this->_createAttachment($headers, $this->_createEncoder(), - $this->_createCache(), array('zip'=>'application/zip', 'txt'=>'text/plain') - ); - $attachment->setFile($file); - } - - public function testDataCanBeReadFromFile() - { - $file = $this->_createFileStream('/foo/file.ext', ''); - $attachment = $this->_createAttachment($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $attachment->setFile($file); - $this->assertEqual('', $attachment->getBody()); - } - - public function testFluidInterface() - { - $attachment = $this->_createAttachment($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertSame($attachment, - $attachment - ->setContentType('application/pdf') - ->setEncoder($this->_createEncoder()) - ->setId('foo@bar') - ->setDescription('my pdf') - ->setMaxLineLength(998) - ->setBody('xx') - ->setBoundary('xyz') - ->setChildren(array()) - ->setDisposition('inline') - ->setFilename('afile.txt') - ->setSize(123) - ->setFile($this->_createFileStream('foo.txt', '')) - ); - } - - // -- Private helpers - - protected function _createEntity($headers, $encoder, $cache) - { - return $this->_createAttachment($headers, $encoder, $cache); - } - - protected function _createAttachment($headers, $encoder, $cache, - $mimeTypes = array()) - { - return new Swift_Mime_Attachment($headers, $encoder, $cache, new Swift_Mime_Grammar(), $mimeTypes); - } - - protected function _createFileStream($path, $data, $stub = true) - { - $file = $this->_mock('Swift_FileStream'); - $pos = $this->_mockery()->states('position')->startsAs('at start'); - $this->_checking(Expectations::create() - -> ignoring($file)->getPath() -> returns($path) - -> ignoring($file)->read(optional()) -> returns($data) - -> when($pos->isNot('at end')) -> then($pos->is('at end')) - -> ignoring($file)->read(optional()) -> returns(false) - ); - if ($stub) { - $this->_checking(Expectations::create() - -> ignoring($file) - ); - } - return $file; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/Base64ContentEncoderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/Base64ContentEncoderTest.php deleted file mode 100644 index 54d63ac..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/Base64ContentEncoderTest.php +++ /dev/null @@ -1,293 +0,0 @@ -getArguments(); - $this->content .= current($args); - } - public function describeTo(Yay_Description $description) { - $description->appendText(' gathers input;'); - } -} - -class Swift_Mime_ContentEncoder_Base64ContentEncoderTest - extends Swift_Tests_SwiftUnitTestCase -{ - private $_encoder; - - public function setUp() - { - $this->_encoder = new Swift_Mime_ContentEncoder_Base64ContentEncoder(); - } - - public function testNameIsBase64() - { - $this->assertEqual('base64', $this->_encoder->getName()); - } - - /* - There's really no point in testing the entire base64 encoding to the - level QP encoding has been tested. base64_encode() has been in PHP for - years. - */ - - public function testInputOutputRatioIs3to4Bytes() - { - /* - RFC 2045, 6.8 - - The encoding process represents 24-bit groups of input bits as output - strings of 4 encoded characters. Proceeding from left to right, a - 24-bit input group is formed by concatenating 3 8bit input groups. - These 24 bits are then treated as 4 concatenated 6-bit groups, each - of which is translated into a single digit in the base64 alphabet. - */ - - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> one($os)->read(optional()) -> returns('123') - -> allowing($os)->read(optional()) -> returns(false) - - -> ignoring($os) - ); - - $this->_encoder->encodeByteStream($os, $is); - $this->assertEqual('MTIz', $collection->content); - } - - public function testPadLength() - { - /* - RFC 2045, 6.8 - - Special processing is performed if fewer than 24 bits are available - at the end of the data being encoded. A full encoding quantum is - always completed at the end of a body. When fewer than 24 input bits - are available in an input group, zero bits are added (on the right) - to form an integral number of 6-bit groups. Padding at the end of - the data is performed using the "=" character. Since all base64 - input is an integral number of octets, only the following cases can - arise: (1) the final quantum of encoding input is an integral - multiple of 24 bits; here, the final unit of encoded output will be - an integral multiple of 4 characters with no "=" padding, (2) the - final quantum of encoding input is exactly 8 bits; here, the final - unit of encoded output will be two characters followed by two "=" - padding characters, or (3) the final quantum of encoding input is - exactly 16 bits; here, the final unit of encoded output will be three - characters followed by one "=" padding character. - */ - - for ($i = 0; $i < 30; ++$i) { - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> one($os)->read(optional()) -> returns(pack('C', rand(0, 255))) - -> allowing($os)->read(optional()) -> returns(false) - -> ignoring($os) - ); - - $this->_encoder->encodeByteStream($os, $is); - $this->assertPattern('~^[a-zA-Z0-9/\+]{2}==$~', $collection->content, - '%s: A single byte should have 2 bytes of padding' - ); - } - - for ($i = 0; $i < 30; ++$i) { - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> one($os)->read(optional()) -> returns(pack('C*', rand(0, 255), rand(0, 255))) - -> allowing($os)->read(optional()) -> returns(false) - -> ignoring($os) - ); - - $this->_encoder->encodeByteStream($os, $is); - $this->assertPattern('~^[a-zA-Z0-9/\+]{3}=$~', $collection->content, - '%s: Two bytes should have 1 byte of padding' - ); - } - - for ($i = 0; $i < 30; ++$i) { - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> one($os)->read(optional()) -> returns(pack('C*', rand(0, 255), rand(0, 255), rand(0, 255))) - -> allowing($os)->read(optional()) -> returns(false) - -> ignoring($os) - ); - - $this->_encoder->encodeByteStream($os, $is); - $this->assertPattern('~^[a-zA-Z0-9/\+]{4}$~', $collection->content, - '%s: Three bytes should have no padding' - ); - } - } - - public function testMaximumLineLengthIs76Characters() - { - /* - The encoded output stream must be represented in lines of no more - than 76 characters each. All line breaks or other characters not - found in Table 1 must be ignored by decoding software. - */ - - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> one($os)->read(optional()) -> returns('abcdefghijkl') //12 - -> one($os)->read(optional()) -> returns('mnopqrstuvwx') //24 - -> one($os)->read(optional()) -> returns('yzabc1234567') //36 - -> one($os)->read(optional()) -> returns('890ABCDEFGHI') //48 - -> one($os)->read(optional()) -> returns('JKLMNOPQRSTU') //60 - -> one($os)->read(optional()) -> returns('VWXYZ1234567') //72 - -> one($os)->read(optional()) -> returns('abcdefghijkl') //84 - -> allowing($os)->read(optional()) -> returns(false) - -> ignoring($os) - ); - - $this->_encoder->encodeByteStream($os, $is); - $this->assertEqual( - "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXphYmMxMjM0NTY3ODkwQUJDREVGR0hJSktMTU5PUFFS\r\n" . - "U1RVVldYWVoxMjM0NTY3YWJjZGVmZ2hpamts", - $collection->content - ); - } - - public function testMaximumLineLengthCanBeDifferent() - { - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> one($os)->read(optional()) -> returns('abcdefghijkl') //12 - -> one($os)->read(optional()) -> returns('mnopqrstuvwx') //24 - -> one($os)->read(optional()) -> returns('yzabc1234567') //36 - -> one($os)->read(optional()) -> returns('890ABCDEFGHI') //48 - -> one($os)->read(optional()) -> returns('JKLMNOPQRSTU') //60 - -> one($os)->read(optional()) -> returns('VWXYZ1234567') //72 - -> one($os)->read(optional()) -> returns('abcdefghijkl') //84 - -> allowing($os)->read(optional()) -> returns(false) - -> ignoring($os) - ); - - $this->_encoder->encodeByteStream($os, $is, 0, 50); - $this->assertEqual( - "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXphYmMxMjM0NTY3OD\r\n" . - "kwQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVoxMjM0NTY3YWJj\r\n" . - "ZGVmZ2hpamts", - $collection->content - ); - } - - public function testMaximumLineLengthIsNeverMoreThan76Chars() - { - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> one($os)->read(optional()) -> returns('abcdefghijkl') //12 - -> one($os)->read(optional()) -> returns('mnopqrstuvwx') //24 - -> one($os)->read(optional()) -> returns('yzabc1234567') //36 - -> one($os)->read(optional()) -> returns('890ABCDEFGHI') //48 - -> one($os)->read(optional()) -> returns('JKLMNOPQRSTU') //60 - -> one($os)->read(optional()) -> returns('VWXYZ1234567') //72 - -> one($os)->read(optional()) -> returns('abcdefghijkl') //84 - -> allowing($os)->read(optional()) -> returns(false) - -> ignoring($os) - ); - - $this->_encoder->encodeByteStream($os, $is, 0, 100); - $this->assertEqual( - "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXphYmMxMjM0NTY3ODkwQUJDREVGR0hJSktMTU5PUFFS\r\n" . - "U1RVVldYWVoxMjM0NTY3YWJjZGVmZ2hpamts", - $collection->content - ); - } - - public function testFirstLineLengthCanBeDifferent() - { - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> one($os)->read(optional()) -> returns('abcdefghijkl') //12 - -> one($os)->read(optional()) -> returns('mnopqrstuvwx') //24 - -> one($os)->read(optional()) -> returns('yzabc1234567') //36 - -> one($os)->read(optional()) -> returns('890ABCDEFGHI') //48 - -> one($os)->read(optional()) -> returns('JKLMNOPQRSTU') //60 - -> one($os)->read(optional()) -> returns('VWXYZ1234567') //72 - -> one($os)->read(optional()) -> returns('abcdefghijkl') //84 - -> allowing($os)->read(optional()) -> returns(false) - -> ignoring($os) - ); - - $this->_encoder->encodeByteStream($os, $is, 19); - $this->assertEqual( - "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXphYmMxMjM0NTY3ODkwQUJDR\r\n" . - "EVGR0hJSktMTU5PUFFSU1RVVldYWVoxMjM0NTY3YWJjZGVmZ2hpamts", - $collection->content - ); - } - - // -- Private Methods - - private function _createOutputByteStream($stub = false) - { - return $stub - ? $this->_stub('Swift_OutputByteStream') - : $this->_mock('Swift_OutputByteStream') - ; - } - - private function _createInputByteStream($stub = false) - { - return $stub - ? $this->_stub('Swift_InputByteStream') - : $this->_mock('Swift_InputByteStream') - ; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/PlainContentEncoderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/PlainContentEncoderTest.php deleted file mode 100644 index 53f3fa8..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/PlainContentEncoderTest.php +++ /dev/null @@ -1,275 +0,0 @@ -getArguments(); - $this->content .= current($args); - } - public function describeTo(Yay_Description $description) { - $description->appendText(' gathers input;'); - } -} - -class Swift_Mime_ContentEncoder_PlainContentEncoderTest - extends Swift_Tests_SwiftUnitTestCase -{ - public function testNameCanBeSpecifiedInConstructor() - { - $encoder = $this->_getEncoder('7bit'); - $this->assertEqual('7bit', $encoder->getName()); - - $encoder = $this->_getEncoder('8bit'); - $this->assertEqual('8bit', $encoder->getName()); - } - - public function testNoOctetsAreModifiedInString() - { - $encoder = $this->_getEncoder('7bit'); - foreach (range(0x00, 0xFF) as $octet) { - $byte = pack('C', $octet); - $this->assertIdenticalBinary($byte, $encoder->encodeString($byte)); - } - } - - public function testNoOctetsAreModifiedInByteStream() - { - $encoder = $this->_getEncoder('7bit'); - foreach (range(0x00, 0xFF) as $octet) { - $byte = pack('C', $octet); - - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> one($os)->read(optional()) -> returns($byte) - -> allowing($os)->read(optional()) -> returns(false) - - -> ignoring($os) - ); - - $encoder->encodeByteStream($os, $is); - $this->assertIdenticalBinary($byte, $collection->content); - } - } - - public function testLineLengthCanBeSpecified() - { - $encoder = $this->_getEncoder('7bit'); - - $chars = array(); - for ($i = 0; $i < 50; $i++) { - $chars[] = 'a'; - } - $input = implode(' ', $chars); //99 chars long - - $this->assertEqual( - 'a a a a a a a a a a a a a a a a a a a a a a a a a ' . "\r\n" . //50 * - 'a a a a a a a a a a a a a a a a a a a a a a a a a', //99 - $encoder->encodeString($input, 0, 50), - '%s: Lines should be wrapped at 50 chars' - ); - } - - public function testLineLengthCanBeSpecifiedInByteStream() - { - $encoder = $this->_getEncoder('7bit'); - - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - ); - - for ($i = 0; $i < 50; $i++) { - $this->_checking(Expectations::create() - -> one($os)->read(optional()) -> returns('a ') - ); - } - - $this->_checking(Expectations::create() - -> allowing($os)->read(optional()) -> returns(false) - ); - - $encoder->encodeByteStream($os, $is, 0, 50); - $this->assertEqual( - str_repeat('a ', 25) . "\r\n" . str_repeat('a ', 25), - $collection->content - ); - } - - public function testencodeStringGeneratesCorrectCrlf() - { - $encoder = $this->_getEncoder('7bit', true); - $this->assertEqual("a\r\nb", $encoder->encodeString("a\rb"), - '%s: Line endings should be standardized' - ); - $this->assertEqual("a\r\nb", $encoder->encodeString("a\nb"), - '%s: Line endings should be standardized' - ); - $this->assertEqual("a\r\n\r\nb", $encoder->encodeString("a\n\rb"), - '%s: Line endings should be standardized' - ); - $this->assertEqual("a\r\n\r\nb", $encoder->encodeString("a\r\rb"), - '%s: Line endings should be standardized' - ); - $this->assertEqual("a\r\n\r\nb", $encoder->encodeString("a\n\nb"), - '%s: Line endings should be standardized' - ); - } - - public function testCanonicEncodeByteStreamGeneratesCorrectCrlf_1() - { - $encoder = $this->_getEncoder('7bit', true); - - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> one($os)->read(optional()) -> returns('a') - -> one($os)->read(optional()) -> returns("\r") - -> one($os)->read(optional()) -> returns('b') - -> allowing($os)->read(optional()) -> returns(false) - - -> ignoring($os) - ); - - $encoder->encodeByteStream($os, $is); - $this->assertEqual("a\r\nb", $collection->content); - } - - public function testCanonicEncodeByteStreamGeneratesCorrectCrlf_2() - { - $encoder = $this->_getEncoder('7bit', true); - - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> one($os)->read(optional()) -> returns('a') - -> one($os)->read(optional()) -> returns("\n") - -> one($os)->read(optional()) -> returns('b') - -> allowing($os)->read(optional()) -> returns(false) - - -> ignoring($os) - ); - - $encoder->encodeByteStream($os, $is); - $this->assertEqual("a\r\nb", $collection->content); - } - - public function testCanonicEncodeByteStreamGeneratesCorrectCrlf_3() - { - $encoder = $this->_getEncoder('7bit', true); - - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> one($os)->read(optional()) -> returns('a') - -> one($os)->read(optional()) -> returns("\n\r") - -> one($os)->read(optional()) -> returns('b') - -> allowing($os)->read(optional()) -> returns(false) - - -> ignoring($os) - ); - - $encoder->encodeByteStream($os, $is); - $this->assertEqual("a\r\n\r\nb", $collection->content); - } - - public function testCanonicEncodeByteStreamGeneratesCorrectCrlf_4() - { - $encoder = $this->_getEncoder('7bit', true); - - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> one($os)->read(optional()) -> returns('a') - -> one($os)->read(optional()) -> returns("\n\n") - -> one($os)->read(optional()) -> returns('b') - -> allowing($os)->read(optional()) -> returns(false) - - -> ignoring($os) - ); - - $encoder->encodeByteStream($os, $is); - $this->assertEqual("a\r\n\r\nb", $collection->content); - } - - public function testCanonicEncodeByteStreamGeneratesCorrectCrlf_5() - { - $encoder = $this->_getEncoder('7bit', true); - - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> one($os)->read(optional()) -> returns('a') - -> one($os)->read(optional()) -> returns("\r\r") - -> one($os)->read(optional()) -> returns('b') - -> allowing($os)->read(optional()) -> returns(false) - - -> ignoring($os) - ); - - $encoder->encodeByteStream($os, $is); - $this->assertEqual("a\r\n\r\nb", $collection->content); - } - - // -- Private helpers - - private function _getEncoder($name, $canonical = false) - { - return new Swift_Mime_ContentEncoder_PlainContentEncoder($name, $canonical); - } - - private function _createOutputByteStream($stub = false) - { - return $stub - ? $this->_stub('Swift_OutputByteStream') - : $this->_mock('Swift_OutputByteStream') - ; - } - - private function _createInputByteStream($stub = false) - { - return $stub - ? $this->_stub('Swift_InputByteStream') - : $this->_mock('Swift_InputByteStream') - ; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/QpContentEncoderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/QpContentEncoderTest.php deleted file mode 100644 index 95b4d37..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/QpContentEncoderTest.php +++ /dev/null @@ -1,474 +0,0 @@ -getArguments(); - $this->content .= current($args); - } - public function describeTo(Yay_Description $description) { - $description->appendText(' gathers input;'); - } -} - -class Swift_Mime_ContentEncoder_QpContentEncoderTest - extends Swift_Tests_SwiftUnitTestCase -{ - public function testNameIsQuotedPrintable() - { - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder( - $this->_createCharacterStream(true) - ); - $this->assertEqual('quoted-printable', $encoder->getName()); - } - - /* -- RFC 2045, 6.7 -- - (1) (General 8bit representation) Any octet, except a CR or - LF that is part of a CRLF line break of the canonical - (standard) form of the data being encoded, may be - represented by an "=" followed by a two digit - hexadecimal representation of the octet's value. The - digits of the hexadecimal alphabet, for this purpose, - are "0123456789ABCDEF". Uppercase letters must be - used; lowercase letters are not allowed. Thus, for - example, the decimal value 12 (US-ASCII form feed) can - be represented by "=0C", and the decimal value 61 (US- - ASCII EQUAL SIGN) can be represented by "=3D". This - rule must be followed except when the following rules - allow an alternative encoding. - */ - - public function testPermittedCharactersAreNotEncoded() - { - /* -- RFC 2045, 6.7 -- - (2) (Literal representation) Octets with decimal values of - 33 through 60 inclusive, and 62 through 126, inclusive, - MAY be represented as the US-ASCII characters which - correspond to those octets (EXCLAMATION POINT through - LESS THAN, and GREATER THAN through TILDE, - respectively). - */ - - foreach (array_merge(range(33, 60), range(62, 126)) as $ordinal) { - $char = chr($ordinal); - - $os = $this->_createOutputByteStream(true); - $charStream = $this->_createCharacterStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> one($charStream)->flushContents() - -> one($charStream)->importByteStream($os) - -> one($charStream)->readBytes(any()) -> returns(array($ordinal)) - -> allowing($charStream)->readBytes(any()) -> returns(false) - - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> ignoring($os) - ); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - $this->assertIdenticalBinary($char, $collection->content); - } - } - - public function testLinearWhiteSpaceAtLineEndingIsEncoded() - { - /* -- RFC 2045, 6.7 -- - (3) (White Space) Octets with values of 9 and 32 MAY be - represented as US-ASCII TAB (HT) and SPACE characters, - respectively, but MUST NOT be so represented at the end - of an encoded line. Any TAB (HT) or SPACE characters - on an encoded line MUST thus be followed on that line - by a printable character. In particular, an "=" at the - end of an encoded line, indicating a soft line break - (see rule #5) may follow one or more TAB (HT) or SPACE - characters. It follows that an octet with decimal - value 9 or 32 appearing at the end of an encoded line - must be represented according to Rule #1. This rule is - necessary because some MTAs (Message Transport Agents, - programs which transport messages from one user to - another, or perform a portion of such transfers) are - known to pad lines of text with SPACEs, and others are - known to remove "white space" characters from the end - of a line. Therefore, when decoding a Quoted-Printable - body, any trailing white space on a line must be - deleted, as it will necessarily have been added by - intermediate transport agents. - */ - - $HT = chr(0x09); //9 - $SPACE = chr(0x20); //32 - - //HT - $os = $this->_createOutputByteStream(true); - $charStream = $this->_createCharacterStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> one($charStream)->flushContents() - -> one($charStream)->importByteStream($os) - -> one($charStream)->readBytes(any()) -> returns(array(ord('a'))) - -> one($charStream)->readBytes(any()) -> returns(array(0x09)) - -> one($charStream)->readBytes(any()) -> returns(array(0x09)) - -> one($charStream)->readBytes(any()) -> returns(array(0x0D)) - -> one($charStream)->readBytes(any()) -> returns(array(0x0A)) - -> one($charStream)->readBytes(any()) -> returns(array(ord('b'))) - -> allowing($charStream)->readBytes(any()) -> returns(false) - - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> ignoring($os) - ); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - - $this->assertEqual("a\t=09\r\nb", $collection->content); - - //SPACE - $os = $this->_createOutputByteStream(true); - $charStream = $this->_createCharacterStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> one($charStream)->flushContents() - -> one($charStream)->importByteStream($os) - -> one($charStream)->readBytes(any()) -> returns(array(ord('a'))) - -> one($charStream)->readBytes(any()) -> returns(array(0x20)) - -> one($charStream)->readBytes(any()) -> returns(array(0x20)) - -> one($charStream)->readBytes(any()) -> returns(array(0x0D)) - -> one($charStream)->readBytes(any()) -> returns(array(0x0A)) - -> one($charStream)->readBytes(any()) -> returns(array(ord('b'))) - -> allowing($charStream)->readBytes(any()) -> returns(false) - - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> ignoring($os) - ); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - - $this->assertEqual("a =20\r\nb", $collection->content); - } - - public function testCRLFIsLeftAlone() - { - /* - (4) (Line Breaks) A line break in a text body, represented - as a CRLF sequence in the text canonical form, must be - represented by a (RFC 822) line break, which is also a - CRLF sequence, in the Quoted-Printable encoding. Since - the canonical representation of media types other than - text do not generally include the representation of - line breaks as CRLF sequences, no hard line breaks - (i.e. line breaks that are intended to be meaningful - and to be displayed to the user) can occur in the - quoted-printable encoding of such types. Sequences - like "=0D", "=0A", "=0A=0D" and "=0D=0A" will routinely - appear in non-text data represented in quoted- - printable, of course. - - Note that many implementations may elect to encode the - local representation of various content types directly - rather than converting to canonical form first, - encoding, and then converting back to local - representation. In particular, this may apply to plain - text material on systems that use newline conventions - other than a CRLF terminator sequence. Such an - implementation optimization is permissible, but only - when the combined canonicalization-encoding step is - equivalent to performing the three steps separately. - */ - - $os = $this->_createOutputByteStream(true); - $charStream = $this->_createCharacterStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> one($charStream)->flushContents() - -> one($charStream)->importByteStream($os) - -> one($charStream)->readBytes(any()) -> returns(array(ord('a'))) - -> one($charStream)->readBytes(any()) -> returns(array(0x0D)) - -> one($charStream)->readBytes(any()) -> returns(array(0x0A)) - -> one($charStream)->readBytes(any()) -> returns(array(ord('b'))) - -> one($charStream)->readBytes(any()) -> returns(array(0x0D)) - -> one($charStream)->readBytes(any()) -> returns(array(0x0A)) - -> one($charStream)->readBytes(any()) -> returns(array(ord('c'))) - -> one($charStream)->readBytes(any()) -> returns(array(0x0D)) - -> one($charStream)->readBytes(any()) -> returns(array(0x0A)) - -> allowing($charStream)->readBytes(any()) -> returns(false) - - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> ignoring($os) - ); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - $this->assertEqual("a\r\nb\r\nc\r\n", $collection->content); - } - - public function testLinesLongerThan76CharactersAreSoftBroken() - { - /* - (5) (Soft Line Breaks) The Quoted-Printable encoding - REQUIRES that encoded lines be no more than 76 - characters long. If longer lines are to be encoded - with the Quoted-Printable encoding, "soft" line breaks - must be used. An equal sign as the last character on a - encoded line indicates such a non-significant ("soft") - line break in the encoded text. - */ - - $os = $this->_createOutputByteStream(true); - $charStream = $this->_createCharacterStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> one($charStream)->flushContents() - -> one($charStream)->importByteStream($os) - - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> ignoring($os) - ); - - for ($seq = 0; $seq <= 140; ++$seq) { - $this->_checking(Expectations::create() - -> one($charStream)->readBytes(any()) -> returns(array(ord('a'))) - ); - } - $this->_checking(Expectations::create() - -> allowing($charStream)->readBytes(any()) -> returns(false) - ); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - $this->assertEqual(str_repeat('a', 75) . "=\r\n" . str_repeat('a', 66), $collection->content); - } - - public function testMaxLineLengthCanBeSpecified() - { - $os = $this->_createOutputByteStream(true); - $charStream = $this->_createCharacterStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> one($charStream)->flushContents() - -> one($charStream)->importByteStream($os) - - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> ignoring($os) - ); - - - for ($seq = 0; $seq <= 100; ++$seq) { - $this->_checking(Expectations::create() - -> one($charStream)->readBytes(any()) -> returns(array(ord('a'))) - ); - } - - $this->_checking(Expectations::create() - -> one($charStream)->readBytes(any()) -> returns(false) - ); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is, 0, 54); - $this->assertEqual(str_repeat('a', 53) . "=\r\n" . str_repeat('a', 48), $collection->content); - } - - public function testBytesBelowPermittedRangeAreEncoded() - { - /* - According to Rule (1 & 2) - */ - - foreach (range(0, 32) as $ordinal) { - $char = chr($ordinal); - - $os = $this->_createOutputByteStream(true); - $charStream = $this->_createCharacterStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> one($charStream)->flushContents() - -> one($charStream)->importByteStream($os) - - -> one($charStream)->readBytes(any()) -> returns(array($ordinal)) - -> allowing($charStream)->readBytes(any()) -> returns(false) - - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> ignoring($os) - ); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - $this->assertEqual(sprintf('=%02X', $ordinal), $collection->content); - } - } - - public function testDecimalByte61IsEncoded() - { - /* - According to Rule (1 & 2) - */ - - $char = chr(61); - - $os = $this->_createOutputByteStream(true); - $charStream = $this->_createCharacterStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> one($charStream)->flushContents() - -> one($charStream)->importByteStream($os) - - -> one($charStream)->readBytes(any()) -> returns(array(61)) - -> allowing($charStream)->readBytes(any()) -> returns(false) - - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> ignoring($os) - ); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - $this->assertEqual(sprintf('=%02X', 61), $collection->content); - } - - public function testBytesAbovePermittedRangeAreEncoded() - { - /* - According to Rule (1 & 2) - */ - - foreach (range(127, 255) as $ordinal) { - $char = chr($ordinal); - - $os = $this->_createOutputByteStream(true); - $charStream = $this->_createCharacterStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> one($charStream)->flushContents() - -> one($charStream)->importByteStream($os) - - -> one($charStream)->readBytes(any()) -> returns(array($ordinal)) - -> allowing($charStream)->readBytes(any()) -> returns(false) - - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> ignoring($os) - ); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - $this->assertEqual(sprintf('=%02X', $ordinal), $collection->content); - } - } - - public function testFirstLineLengthCanBeDifferent() - { - $os = $this->_createOutputByteStream(true); - $charStream = $this->_createCharacterStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $this->_checking(Expectations::create() - -> one($charStream)->flushContents() - -> one($charStream)->importByteStream($os) - - -> allowing($is)->write(any(), optional()) -> will($collection) - -> ignoring($is) - - -> ignoring($os) - ); - - for ($seq = 0; $seq <= 140; ++$seq) { - $this->_checking(Expectations::create() - -> one($charStream)->readBytes(any()) -> returns(array(ord('a'))) - ); - } - $this->_checking(Expectations::create() - -> one($charStream)->readBytes(any()) -> returns(false) - ); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is, 22); - $this->assertEqual( - str_repeat('a', 53) . "=\r\n" . str_repeat('a', 75) . "=\r\n" . str_repeat('a', 13), - $collection->content - ); - } - - public function testObserverInterfaceCanChangeCharset() - { - $stream = $this->_createCharacterStream(); - $this->_checking(Expectations::create() - -> one($stream)->setCharacterSet('windows-1252') - -> ignoring($stream) - ); - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($stream); - $encoder->charsetChanged('windows-1252'); - } - - // -- Creation Methods - - private function _createCharacterStream($stub = false) - { - return $stub - ? $this->_stub('Swift_CharacterStream') - : $this->_mock('Swift_CharacterStream') - ; - } - - private function _createEncoder($charStream) - { - return new Swift_Mime_HeaderEncoder_QpHeaderEncoder($charStream); - } - - private function _createOutputByteStream($stub = false) - { - return $stub - ? $this->_stub('Swift_OutputByteStream') - : $this->_mock('Swift_OutputByteStream') - ; - } - - private function _createInputByteStream($stub = false) - { - return $stub - ? $this->_stub('Swift_InputByteStream') - : $this->_mock('Swift_InputByteStream') - ; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/EmbeddedFileTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/EmbeddedFileTest.php deleted file mode 100644 index 4b5c711..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/EmbeddedFileTest.php +++ /dev/null @@ -1,63 +0,0 @@ -_createEmbeddedFile($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual( - Swift_Mime_MimeEntity::LEVEL_RELATED, $file->getNestingLevel() - ); - } - - public function testIdIsAutoGenerated() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addIdHeader('Content-ID', pattern('/^.*?@.*?$/D')) - -> ignoring($headers) - ); - $file = $this->_createEmbeddedFile($headers, $this->_createEncoder(), - $this->_createCache() - ); - } - - public function testDefaultDispositionIsAttachment() - { //Overridden - } - - public function testDefaultDispositionIsInline() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addParameterizedHeader('Content-Disposition', 'inline') - -> ignoring($headers) - ); - $file = $this->_createEmbeddedFile($headers, $this->_createEncoder(), - $this->_createCache() - ); - } - - // -- Private helpers - - protected function _createAttachment($headers, $encoder, $cache, - $mimeTypes = array()) - { - return $this->_createEmbeddedFile($headers, $encoder, $cache, $mimeTypes); - } - - private function _createEmbeddedFile($headers, $encoder, $cache) - { - return new Swift_Mime_EmbeddedFile($headers, $encoder, $cache, new Swift_Mime_Grammar()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/Base64HeaderEncoderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/Base64HeaderEncoderTest.php deleted file mode 100644 index 780d353..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/Base64HeaderEncoderTest.php +++ /dev/null @@ -1,15 +0,0 @@ -assertEqual('B', $encoder->getName()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/QpHeaderEncoderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/QpHeaderEncoderTest.php deleted file mode 100644 index 92fd94e..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/QpHeaderEncoderTest.php +++ /dev/null @@ -1,223 +0,0 @@ -_createEncoder( - $this->_createCharacterStream(true) - ); - $this->assertEqual('Q', $encoder->getName()); - } - - public function testSpaceAndTabNeverAppear() - { - /* -- RFC 2047, 4. - Only a subset of the printable ASCII characters may be used in - 'encoded-text'. Space and tab characters are not allowed, so that - the beginning and end of an 'encoded-word' are obvious. - */ - - $charStream = $this->_createCharacterStream(); - $this->_checking(Expectations::create() - -> one($charStream)->readBytes(any()) -> returns(array(ord('a'))) - -> one($charStream)->readBytes(any()) -> returns(array(0x20)) - -> one($charStream)->readBytes(any()) -> returns(array(0x09)) - -> one($charStream)->readBytes(any()) -> returns(array(0x20)) - -> one($charStream)->readBytes(any()) -> returns(array(ord('b'))) - -> allowing($charStream)->readBytes(any()) -> returns(false) - -> ignoring($charStream) - ); - - $encoder = $this->_createEncoder($charStream); - $this->assertNoPattern('~[ \t]~', $encoder->encodeString("a \t b"), - '%s: encoded-words in headers cannot contain LWSP as per RFC 2047.' - ); - } - - public function testSpaceIsRepresentedByUnderscore() - { - /* -- RFC 2047, 4.2. - (2) The 8-bit hexadecimal value 20 (e.g., ISO-8859-1 SPACE) may be - represented as "_" (underscore, ASCII 95.). (This character may - not pass through some internetwork mail gateways, but its use - will greatly enhance readability of "Q" encoded data with mail - readers that do not support this encoding.) Note that the "_" - always represents hexadecimal 20, even if the SPACE character - occupies a different code position in the character set in use. - */ - $charStream = $this->_createCharacterStream(); - $this->_checking(Expectations::create() - -> one($charStream)->readBytes(any()) -> returns(array(ord('a'))) - -> one($charStream)->readBytes(any()) -> returns(array(0x20)) - -> one($charStream)->readBytes(any()) -> returns(array(ord('b'))) - -> allowing($charStream)->readBytes(any()) -> returns(false) - -> ignoring($charStream) - ); - - $encoder = $this->_createEncoder($charStream); - $this->assertEqual('a_b', $encoder->encodeString('a b'), - '%s: Spaces can be represented by more readable underscores as per RFC 2047.' - ); - } - - public function testEqualsAndQuestionAndUnderscoreAreEncoded() - { - /* -- RFC 2047, 4.2. - (3) 8-bit values which correspond to printable ASCII characters other - than "=", "?", and "_" (underscore), MAY be represented as those - characters. (But see section 5 for restrictions.) In - particular, SPACE and TAB MUST NOT be represented as themselves - within encoded words. - */ - $charStream = $this->_createCharacterStream(); - $this->_checking(Expectations::create() - -> one($charStream)->readBytes(any()) -> returns(array(ord('='))) - -> one($charStream)->readBytes(any()) -> returns(array(ord('?'))) - -> one($charStream)->readBytes(any()) -> returns(array(ord('_'))) - -> allowing($charStream)->readBytes(any()) -> returns(false) - -> ignoring($charStream) - ); - - $encoder = $this->_createEncoder($charStream); - $this->assertEqual('=3D=3F=5F', $encoder->encodeString('=?_'), - '%s: Chars =, ? and _ (underscore) may not appear as per RFC 2047.' - ); - } - - public function testParensAndQuotesAreEncoded() - { - /* -- RFC 2047, 5 (2). - A "Q"-encoded 'encoded-word' which appears in a 'comment' MUST NOT - contain the characters "(", ")" or " - */ - - $charStream = $this->_createCharacterStream(); - $this->_checking(Expectations::create() - -> one($charStream)->readBytes(any()) -> returns(array(ord('('))) - -> one($charStream)->readBytes(any()) -> returns(array(ord('"'))) - -> one($charStream)->readBytes(any()) -> returns(array(ord(')'))) - -> allowing($charStream)->readBytes(any()) -> returns(false) - -> ignoring($charStream) - ); - - $encoder = $this->_createEncoder($charStream); - $this->assertEqual('=28=22=29', $encoder->encodeString('(")'), - '%s: Chars (, " (DQUOTE) and ) may not appear as per RFC 2047.' - ); - } - - public function testOnlyCharactersAllowedInPhrasesAreUsed() - { - /* -- RFC 2047, 5. - (3) As a replacement for a 'word' entity within a 'phrase', for example, - one that precedes an address in a From, To, or Cc header. The ABNF - definition for 'phrase' from RFC 822 thus becomes: - - phrase = 1*( encoded-word / word ) - - In this case the set of characters that may be used in a "Q"-encoded - 'encoded-word' is restricted to: . An 'encoded-word' that appears within a - 'phrase' MUST be separated from any adjacent 'word', 'text' or - 'special' by 'linear-white-space'. - */ - - $allowedBytes = array_merge( - range(ord('a'), ord('z')), range(ord('A'), ord('Z')), - range(ord('0'), ord('9')), - array(ord('!'), ord('*'), ord('+'), ord('-'), ord('/')) - ); - - foreach (range(0x00, 0xFF) as $byte) { - $char = pack('C', $byte); - - $charStream = $this->_createCharacterStream(); - $this->_checking(Expectations::create() - -> one($charStream)->readBytes(any()) -> returns(array($byte)) - -> allowing($charStream)->readBytes(any()) -> returns(false) - -> ignoring($charStream) - ); - - $encoder = $this->_createEncoder($charStream); - $encodedChar = $encoder->encodeString($char); - - if (in_array($byte, $allowedBytes)) { - $this->assertEqual($char, $encodedChar, - '%s: Character ' . $char . ' should not be encoded.' - ); - } - elseif (0x20 == $byte) //Special case - { - $this->assertEqual('_', $encodedChar, - '%s: Space character should be replaced.' - ); - } else { - $this->assertEqual(sprintf('=%02X', $byte), $encodedChar, - '%s: Byte ' . $byte . ' should be encoded.' - ); - } - } - } - - public function testEqualsNeverAppearsAtEndOfLine() - { - /* -- RFC 2047, 5 (3). - The 'encoded-text' in an 'encoded-word' must be self-contained; - 'encoded-text' MUST NOT be continued from one 'encoded-word' to - another. This implies that the 'encoded-text' portion of a "B" - 'encoded-word' will be a multiple of 4 characters long; for a "Q" - 'encoded-word', any "=" character that appears in the 'encoded-text' - portion will be followed by two hexadecimal characters. - */ - - $input = str_repeat('a', 140); - - $charStream = $this->_createCharacterStream(); - - $output = ''; - $seq = 0; - for (; $seq < 140; ++$seq) { - $this->_checking(Expectations::create() - -> one($charStream)->readBytes(any()) -> returns(array(ord('a'))) - ); - - if (75 == $seq) { - $output .= "\r\n"; // =\r\n - } - $output .= 'a'; - } - - $this->_checking(Expectations::create() - -> allowing($charStream)->readBytes(any()) -> returns(false) - -> ignoring($charStream) - ); - - $encoder = $this->_createEncoder($charStream); - $this->assertEqual($output, $encoder->encodeString($input)); - } - - // -- Creation Methods - - private function _createEncoder($charStream) - { - return new Swift_Mime_HeaderEncoder_QpHeaderEncoder($charStream); - } - - private function _createCharacterStream($stub = false) - { - return $stub - ? $this->_stub('Swift_CharacterStream') - : $this->_mock('Swift_CharacterStream') - ; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/DateHeaderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/DateHeaderTest.php deleted file mode 100644 index 3fa3adf..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/DateHeaderTest.php +++ /dev/null @@ -1,76 +0,0 @@ -_getHeader('Date'); - $this->assertEqual(Swift_Mime_Header::TYPE_DATE, $header->getFieldType()); - } - - public function testGetTimestamp() - { - $timestamp = time(); - $header = $this->_getHeader('Date'); - $header->setTimestamp($timestamp); - $this->assertIdentical($timestamp, $header->getTimestamp()); - } - - public function testTimestampCanBeSetBySetter() - { - $timestamp = time(); - $header = $this->_getHeader('Date'); - $header->setTimestamp($timestamp); - $this->assertIdentical($timestamp, $header->getTimestamp()); - } - - public function testIntegerTimestampIsConvertedToRfc2822Date() - { - $timestamp = time(); - $header = $this->_getHeader('Date'); - $header->setTimestamp($timestamp); - $this->assertEqual(date('r', $timestamp), $header->getFieldBody()); - } - - public function testSetBodyModel() - { - $timestamp = time(); - $header = $this->_getHeader('Date'); - $header->setFieldBodyModel($timestamp); - $this->assertEqual(date('r', $timestamp), $header->getFieldBody()); - } - - public function testGetBodyModel() - { - $timestamp = time(); - $header = $this->_getHeader('Date'); - $header->setTimestamp($timestamp); - $this->assertEqual($timestamp, $header->getFieldBodyModel()); - } - - public function testToString() - { - $timestamp = time(); - $header = $this->_getHeader('Date'); - $header->setTimestamp($timestamp); - $this->assertEqual('Date: ' . date('r', $timestamp) . "\r\n", - $header->toString() - ); - } - - // -- Private methods - - private function _getHeader($name) - { - return new Swift_Mime_Headers_DateHeader($name, new Swift_Mime_Grammar()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/IdentificationHeaderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/IdentificationHeaderTest.php deleted file mode 100644 index bf4ae96..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/IdentificationHeaderTest.php +++ /dev/null @@ -1,199 +0,0 @@ -_getHeader('Message-ID'); - $this->assertEqual(Swift_Mime_Header::TYPE_ID, $header->getFieldType()); - } - - public function testValueMatchesMsgIdSpec() - { - /* -- RFC 2822, 3.6.4. - message-id = "Message-ID:" msg-id CRLF - - in-reply-to = "In-Reply-To:" 1*msg-id CRLF - - references = "References:" 1*msg-id CRLF - - msg-id = [CFWS] "<" id-left "@" id-right ">" [CFWS] - - id-left = dot-atom-text / no-fold-quote / obs-id-left - - id-right = dot-atom-text / no-fold-literal / obs-id-right - - no-fold-quote = DQUOTE *(qtext / quoted-pair) DQUOTE - - no-fold-literal = "[" *(dtext / quoted-pair) "]" - */ - - $header = $this->_getHeader('Message-ID'); - $header->setId('id-left@id-right'); - $this->assertEqual('', $header->getFieldBody()); - } - - public function testIdCanBeRetrievedVerbatim() - { - $header = $this->_getHeader('Message-ID'); - $header->setId('id-left@id-right'); - $this->assertEqual('id-left@id-right', $header->getId()); - } - - public function testMultipleIdsCanBeSet() - { - $header = $this->_getHeader('References'); - $header->setIds(array('a@b', 'x@y')); - $this->assertEqual(array('a@b', 'x@y'), $header->getIds()); - } - - public function testSettingMultipleIdsProducesAListValue() - { - /* -- RFC 2822, 3.6.4. - The "References:" and "In-Reply-To:" field each contain one or more - unique message identifiers, optionally separated by CFWS. - - .. SNIP .. - - in-reply-to = "In-Reply-To:" 1*msg-id CRLF - - references = "References:" 1*msg-id CRLF - */ - - $header = $this->_getHeader('References'); - $header->setIds(array('a@b', 'x@y')); - $this->assertEqual(' ', $header->getFieldBody()); - } - - public function testIdLeftCanBeQuoted() - { - /* -- RFC 2822, 3.6.4. - id-left = dot-atom-text / no-fold-quote / obs-id-left - */ - - $header = $this->_getHeader('References'); - $header->setId('"ab"@c'); - $this->assertEqual('"ab"@c', $header->getId()); - $this->assertEqual('<"ab"@c>', $header->getFieldBody()); - } - - public function testIdLeftCanContainAnglesAsQuotedPairs() - { - /* -- RFC 2822, 3.6.4. - no-fold-quote = DQUOTE *(qtext / quoted-pair) DQUOTE - */ - - $header = $this->_getHeader('References'); - $header->setId('"a\\<\\>b"@c'); - $this->assertEqual('"a\\<\\>b"@c', $header->getId()); - $this->assertEqual('<"a\\<\\>b"@c>', $header->getFieldBody()); - } - - public function testIdLeftCanBeDotAtom() - { - $header = $this->_getHeader('References'); - $header->setId('a.b+&%$.c@d'); - $this->assertEqual('a.b+&%$.c@d', $header->getId()); - $this->assertEqual('', $header->getFieldBody()); - } - - public function testInvalidIdLeftThrowsException() - { - try { - $header = $this->_getHeader('References'); - $header->setId('a b c@d'); - $this->fail( - 'Exception should be thrown since "a b c" is not valid id-left.' - ); - } catch (Exception $e) { - $this->pass(); - } - } - - public function testIdRightCanBeDotAtom() - { - /* -- RFC 2822, 3.6.4. - id-right = dot-atom-text / no-fold-literal / obs-id-right - */ - - $header = $this->_getHeader('References'); - $header->setId('a@b.c+&%$.d'); - $this->assertEqual('a@b.c+&%$.d', $header->getId()); - $this->assertEqual('', $header->getFieldBody()); - } - - public function testIdRightCanBeLiteral() - { - /* -- RFC 2822, 3.6.4. - no-fold-literal = "[" *(dtext / quoted-pair) "]" - */ - - $header = $this->_getHeader('References'); - $header->setId('a@[1.2.3.4]'); - $this->assertEqual('a@[1.2.3.4]', $header->getId()); - $this->assertEqual('', $header->getFieldBody()); - } - - public function testInvalidIdRightThrowsException() - { - try { - $header = $this->_getHeader('References'); - $header->setId('a@b c d'); - $this->fail( - 'Exception should be thrown since "b c d" is not valid id-right.' - ); - } catch (Exception $e) { - $this->pass(); - } - } - - public function testMissingAtSignThrowsException() - { - /* -- RFC 2822, 3.6.4. - msg-id = [CFWS] "<" id-left "@" id-right ">" [CFWS] - */ - - try { - $header = $this->_getHeader('References'); - $header->setId('abc'); - $this->fail( - 'Exception should be thrown since "abc" is does not contain @.' - ); - } catch (Exception $e) { - $this->pass(); - } - } - - public function testSetBodyModel() - { - $header = $this->_getHeader('Message-ID'); - $header->setFieldBodyModel('a@b'); - $this->assertEqual(array('a@b'), $header->getIds()); - } - - public function testGetBodyModel() - { - $header = $this->_getHeader('Message-ID'); - $header->setId('a@b'); - $this->assertEqual(array('a@b'), $header->getFieldBodyModel()); - } - - public function testStringValue() - { - $header = $this->_getHeader('References'); - $header->setIds(array('a@b', 'x@y')); - $this->assertEqual('References: ' . "\r\n", $header->toString()); - } - - // -- Private methods - - private function _getHeader($name) - { - return new Swift_Mime_Headers_IdentificationHeader($name, new Swift_Mime_Grammar()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/MailboxHeaderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/MailboxHeaderTest.php deleted file mode 100644 index c109da2..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/MailboxHeaderTest.php +++ /dev/null @@ -1,338 +0,0 @@ -_getHeader('To', $this->_getEncoder('Q', true)); - $this->assertEqual(Swift_Mime_Header::TYPE_MAILBOX, $header->getFieldType()); - } - - public function testMailboxIsSetForAddress() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setAddresses('chris@swiftmailer.org'); - $this->assertEqual(array('chris@swiftmailer.org'), - $header->getNameAddressStrings() - ); - } - - public function testMailboxIsRenderedForNameAddress() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array('chris@swiftmailer.org' => 'Chris Corbyn')); - $this->assertEqual( - array('Chris Corbyn '), $header->getNameAddressStrings() - ); - } - - public function testAddressCanBeReturnedForAddress() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setAddresses('chris@swiftmailer.org'); - $this->assertEqual(array('chris@swiftmailer.org'), $header->getAddresses()); - } - - public function testAddressCanBeReturnedForNameAddress() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array('chris@swiftmailer.org' => 'Chris Corbyn')); - $this->assertEqual(array('chris@swiftmailer.org'), $header->getAddresses()); - } - - public function testQuotesInNameAreQuoted() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn, "DHE"' - )); - $this->assertEqual( - array('"Chris Corbyn, \"DHE\"" '), - $header->getNameAddressStrings() - ); - } - - public function testEscapeCharsInNameAreQuoted() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn, \\escaped\\' - )); - $this->assertEqual( - array('"Chris Corbyn, \\\\escaped\\\\" '), - $header->getNameAddressStrings() - ); - } - - public function testGetMailboxesReturnsNameValuePairs() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn, DHE' - )); - $this->assertEqual( - array('chris@swiftmailer.org' => 'Chris Corbyn, DHE'), $header->getNameAddresses() - ); - } - - public function testMultipleAddressesCanBeSetAndFetched() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setAddresses(array( - 'chris@swiftmailer.org', 'mark@swiftmailer.org' - )); - $this->assertEqual( - array('chris@swiftmailer.org', 'mark@swiftmailer.org'), - $header->getAddresses() - ); - } - - public function testMultipleAddressesAsMailboxes() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setAddresses(array( - 'chris@swiftmailer.org', 'mark@swiftmailer.org' - )); - $this->assertEqual( - array('chris@swiftmailer.org'=>null, 'mark@swiftmailer.org'=>null), - $header->getNameAddresses() - ); - } - - public function testMultipleAddressesAsMailboxStrings() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setAddresses(array( - 'chris@swiftmailer.org', 'mark@swiftmailer.org' - )); - $this->assertEqual( - array('chris@swiftmailer.org', 'mark@swiftmailer.org'), - $header->getNameAddressStrings() - ); - } - - public function testMultipleNamedMailboxesReturnsMultipleAddresses() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn' - )); - $this->assertEqual( - array('chris@swiftmailer.org', 'mark@swiftmailer.org'), - $header->getAddresses() - ); - } - - public function testMultipleNamedMailboxesReturnsMultipleMailboxes() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn' - )); - $this->assertEqual(array( - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn' - ), - $header->getNameAddresses() - ); - } - - public function testMultipleMailboxesProducesMultipleMailboxStrings() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn' - )); - $this->assertEqual(array( - 'Chris Corbyn ', - 'Mark Corbyn ' - ), - $header->getNameAddressStrings() - ); - } - - public function testSetAddressesOverwritesAnyMailboxes() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn' - )); - $this->assertEqual( - array('chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn'), - $header->getNameAddresses() - ); - $this->assertEqual( - array('chris@swiftmailer.org', 'mark@swiftmailer.org'), - $header->getAddresses() - ); - - $header->setAddresses(array('chris@swiftmailer.org', 'mark@swiftmailer.org')); - - $this->assertEqual( - array('chris@swiftmailer.org' => null, 'mark@swiftmailer.org' => null), - $header->getNameAddresses() - ); - $this->assertEqual( - array('chris@swiftmailer.org', 'mark@swiftmailer.org'), - $header->getAddresses() - ); - } - - public function testNameIsEncodedIfNonAscii() - { - $name = 'C' . pack('C', 0x8F) . 'rbyn'; - - $encoder = $this->_getEncoder('Q'); - $this->_checking(Expectations::create() - -> one($encoder)->encodeString($name, any(), any()) -> returns('C=8Frbyn') - -> ignoring($encoder) - ); - - $header = $this->_getHeader('From', $encoder); - $header->setNameAddresses(array('chris@swiftmailer.org'=>'Chris ' . $name)); - - $addresses = $header->getNameAddressStrings(); - $this->assertEqual( - 'Chris =?' . $this->_charset . '?Q?C=8Frbyn?= ', - array_shift($addresses) - ); - } - - public function testEncodingLineLengthCalculations() - { - /* -- RFC 2047, 2. - An 'encoded-word' may not be more than 75 characters long, including - 'charset', 'encoding', 'encoded-text', and delimiters. - */ - - $name = 'C' . pack('C', 0x8F) . 'rbyn'; - - $encoder = $this->_getEncoder('Q'); - $this->_checking(Expectations::create() - -> one($encoder)->encodeString($name, 6, 63) -> returns('C=8Frbyn') - -> ignoring($encoder) - ); - - $header = $this->_getHeader('From', $encoder); - $header->setNameAddresses(array('chris@swiftmailer.org'=>'Chris ' . $name)); - - $header->getNameAddressStrings(); - } - - public function testGetValueReturnsMailboxStringValue() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn' - )); - $this->assertEqual( - 'Chris Corbyn ', $header->getFieldBody() - ); - } - - public function testGetValueReturnsMailboxStringValueForMultipleMailboxes() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn' - )); - $this->assertEqual( - 'Chris Corbyn , Mark Corbyn ', - $header->getFieldBody() - ); - } - - public function testRemoveAddressesWithSingleValue() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn' - )); - $header->removeAddresses('chris@swiftmailer.org'); - $this->assertEqual(array('mark@swiftmailer.org'), - $header->getAddresses() - ); - } - - public function testRemoveAddressesWithList() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn' - )); - $header->removeAddresses( - array('chris@swiftmailer.org', 'mark@swiftmailer.org') - ); - $this->assertEqual(array(), $header->getAddresses()); - } - - public function testSetBodyModel() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setFieldBodyModel('chris@swiftmailer.org'); - $this->assertEqual(array('chris@swiftmailer.org'=>null), $header->getNameAddresses()); - } - - public function testGetBodyModel() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setAddresses(array('chris@swiftmailer.org')); - $this->assertEqual(array('chris@swiftmailer.org'=>null), $header->getFieldBodyModel()); - } - - public function testToString() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn' - )); - $this->assertEqual( - 'From: Chris Corbyn , ' . - 'Mark Corbyn ' . "\r\n", - $header->toString() - ); - } - - // -- Private methods - - private function _getHeader($name, $encoder) - { - $header = new Swift_Mime_Headers_MailboxHeader($name, $encoder, new Swift_Mime_Grammar()); - $header->setCharset($this->_charset); - return $header; - } - - private function _getEncoder($type, $stub = false) - { - $encoder = $this->_mock('Swift_Mime_HeaderEncoder'); - $this->_checking(Expectations::create() - -> ignoring($encoder)->getName() -> returns($type) - ); - if ($stub) { - $this->_checking(Expectations::create() - -> ignoring($encoder) - ); - } - return $encoder; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/ParameterizedHeaderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/ParameterizedHeaderTest.php deleted file mode 100644 index c762340..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/ParameterizedHeaderTest.php +++ /dev/null @@ -1,420 +0,0 @@ -_getHeader('Content-Type', - $this->_getHeaderEncoder('Q', true), $this->_getParameterEncoder(true) - ); - $this->assertEqual(Swift_Mime_Header::TYPE_PARAMETERIZED, $header->getFieldType()); - } - - public function testValueIsReturnedVerbatim() - { - $header = $this->_getHeader('Content-Type', - $this->_getHeaderEncoder('Q', true), $this->_getParameterEncoder(true) - ); - $header->setValue('text/plain'); - $this->assertEqual('text/plain', $header->getValue()); - } - - public function testParametersAreAppended() - { - /* -- RFC 2045, 5.1 - parameter := attribute "=" value - - attribute := token - ; Matching of attributes - ; is ALWAYS case-insensitive. - - value := token / quoted-string - - token := 1* - - tspecials := "(" / ")" / "<" / ">" / "@" / - "," / ";" / ":" / "\" / <"> - "/" / "[" / "]" / "?" / "=" - ; Must be in quoted-string, - ; to use within parameter values - */ - - $header = $this->_getHeader('Content-Type', - $this->_getHeaderEncoder('Q', true), $this->_getParameterEncoder(true) - ); - $header->setValue('text/plain'); - $header->setParameters(array('charset' => 'utf-8')); - $this->assertEqual('text/plain; charset=utf-8', $header->getFieldBody()); - } - - public function testSpaceInParamResultsInQuotedString() - { - $header = $this->_getHeader('Content-Disposition', - $this->_getHeaderEncoder('Q', true), $this->_getParameterEncoder(true) - ); - $header->setValue('attachment'); - $header->setParameters(array('filename' => 'my file.txt')); - $this->assertEqual('attachment; filename="my file.txt"', - $header->getFieldBody() - ); - } - - public function testLongParamsAreBrokenIntoMultipleAttributeStrings() - { - /* -- RFC 2231, 3. - The asterisk character ("*") followed - by a decimal count is employed to indicate that multiple parameters - are being used to encapsulate a single parameter value. The count - starts at 0 and increments by 1 for each subsequent section of the - parameter value. Decimal values are used and neither leading zeroes - nor gaps in the sequence are allowed. - - The original parameter value is recovered by concatenating the - various sections of the parameter, in order. For example, the - content-type field - - Content-Type: message/external-body; access-type=URL; - URL*0="ftp://"; - URL*1="cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar" - - is semantically identical to - - Content-Type: message/external-body; access-type=URL; - URL="ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar" - - Note that quotes around parameter values are part of the value - syntax; they are NOT part of the value itself. Furthermore, it is - explicitly permitted to have a mixture of quoted and unquoted - continuation fields. - */ - - $value = str_repeat('a', 180); - - $encoder = $this->_getParameterEncoder(); - $this->_checking(Expectations::create() - -> one($encoder)->encodeString($value, any(), 63) - -> returns(str_repeat('a', 63) . "\r\n" . - str_repeat('a', 63) . "\r\n" . str_repeat('a', 54)) - - -> ignoring($encoder) - ); - - $header = $this->_getHeader('Content-Disposition', - $this->_getHeaderEncoder('Q', true), $encoder - ); - $header->setValue('attachment'); - $header->setParameters(array('filename' => $value)); - $header->setMaxLineLength(78); - $this->assertEqual( - 'attachment; ' . - 'filename*0*=utf-8\'\'' . str_repeat('a', 63) . ";\r\n " . - 'filename*1*=' . str_repeat('a', 63) . ";\r\n " . - 'filename*2*=' . str_repeat('a', 54), - $header->getFieldBody() - ); - } - - public function testEncodedParamDataIncludesCharsetAndLanguage() - { - /* -- RFC 2231, 4. - Asterisks ("*") are reused to provide the indicator that language and - character set information is present and encoding is being used. A - single quote ("'") is used to delimit the character set and language - information at the beginning of the parameter value. Percent signs - ("%") are used as the encoding flag, which agrees with RFC 2047. - - Specifically, an asterisk at the end of a parameter name acts as an - indicator that character set and language information may appear at - the beginning of the parameter value. A single quote is used to - separate the character set, language, and actual value information in - the parameter value string, and an percent sign is used to flag - octets encoded in hexadecimal. For example: - - Content-Type: application/x-stuff; - title*=us-ascii'en-us'This%20is%20%2A%2A%2Afun%2A%2A%2A - - Note that it is perfectly permissible to leave either the character - set or language field blank. Note also that the single quote - delimiters MUST be present even when one of the field values is - omitted. - */ - - $value = str_repeat('a', 20) . pack('C', 0x8F) . str_repeat('a', 10); - - $encoder = $this->_getParameterEncoder(); - $this->_checking(Expectations::create() - -> one($encoder)->encodeString($value, 12, 62) - -> returns(str_repeat('a', 20) . '%8F' . str_repeat('a', 10)) - - -> ignoring($encoder) - ); - - $header = $this->_getHeader('Content-Disposition', - $this->_getHeaderEncoder('Q', true), $encoder - ); - $header->setValue('attachment'); - $header->setParameters(array('filename' => $value)); - $header->setMaxLineLength(78); - $header->setLanguage($this->_lang); - $this->assertEqual( - 'attachment; filename*=' . $this->_charset . "'" . $this->_lang . "'" . - str_repeat('a', 20) . '%8F' . str_repeat('a', 10), - $header->getFieldBody() - ); - } - - public function testMultipleEncodedParamLinesAreFormattedCorrectly() - { - /* -- RFC 2231, 4.1. - Character set and language information may be combined with the - parameter continuation mechanism. For example: - - Content-Type: application/x-stuff - title*0*=us-ascii'en'This%20is%20even%20more%20 - title*1*=%2A%2A%2Afun%2A%2A%2A%20 - title*2="isn't it!" - - Note that: - - (1) Language and character set information only appear at - the beginning of a given parameter value. - - (2) Continuations do not provide a facility for using more - than one character set or language in the same - parameter value. - - (3) A value presented using multiple continuations may - contain a mixture of encoded and unencoded segments. - - (4) The first segment of a continuation MUST be encoded if - language and character set information are given. - - (5) If the first segment of a continued parameter value is - encoded the language and character set field delimiters - MUST be present even when the fields are left blank. - */ - - $value = str_repeat('a', 20) . pack('C', 0x8F) . str_repeat('a', 60); - - $encoder = $this->_getParameterEncoder(); - $this->_checking(Expectations::create() - -> one($encoder)->encodeString($value, 12, 62) - -> returns(str_repeat('a', 20) . '%8F' . str_repeat('a', 28) . "\r\n" . - str_repeat('a', 32)) - - -> ignoring($encoder) - ); - - $header = $this->_getHeader('Content-Disposition', - $this->_getHeaderEncoder('Q', true), $encoder - ); - $header->setValue('attachment'); - $header->setParameters(array('filename' => $value)); - $header->setMaxLineLength(78); - $header->setLanguage($this->_lang); - $this->assertEqual( - 'attachment; filename*0*=' . $this->_charset . "'" . $this->_lang . "'" . - str_repeat('a', 20) . '%8F' . str_repeat('a', 28) . ";\r\n " . - 'filename*1*=' . str_repeat('a', 32), - $header->getFieldBody() - ); - } - - public function testToString() - { - $header = $this->_getHeader('Content-Type', - $this->_getHeaderEncoder('Q', true), $this->_getParameterEncoder(true) - ); - $header->setValue('text/html'); - $header->setParameters(array('charset' => 'utf-8')); - $this->assertEqual('Content-Type: text/html; charset=utf-8' . "\r\n", - $header->toString() - ); - } - - public function testValueCanBeEncodedIfNonAscii() - { - $value = 'fo' . pack('C', 0x8F) .'bar'; - - $encoder = $this->_getHeaderEncoder('Q'); - $this->_checking(Expectations::create() - -> one($encoder)->encodeString($value, any(), any()) -> returns('fo=8Fbar') - -> ignoring($encoder) - ); - - $header = $this->_getHeader('X-Foo', $encoder, $this->_getParameterEncoder(true)); - $header->setValue($value); - $header->setParameters(array('lookslike' => 'foobar')); - $this->assertEqual('X-Foo: =?utf-8?Q?fo=8Fbar?=; lookslike=foobar' . "\r\n", - $header->toString() - ); - } - - public function testValueAndParamCanBeEncodedIfNonAscii() - { - $value = 'fo' . pack('C', 0x8F) .'bar'; - - $encoder = $this->_getHeaderEncoder('Q'); - $this->_checking(Expectations::create() - -> one($encoder)->encodeString($value, any(), any()) -> returns('fo=8Fbar') - -> ignoring($encoder) - ); - - $paramEncoder = $this->_getParameterEncoder(); - $this->_checking(Expectations::create() - -> one($paramEncoder)->encodeString($value, any(), any()) -> returns('fo%8Fbar') - -> ignoring($paramEncoder) - ); - - $header = $this->_getHeader('X-Foo', $encoder, $paramEncoder); - $header->setValue($value); - $header->setParameters(array('says' => $value)); - $this->assertEqual("X-Foo: =?utf-8?Q?fo=8Fbar?=; says*=utf-8''fo%8Fbar\r\n", - $header->toString() - ); - } - - public function testParamsAreEncodedWithEncodedWordsIfNoParamEncoderSet() - { - $value = 'fo' . pack('C', 0x8F) .'bar'; - - $encoder = $this->_getHeaderEncoder('Q'); - $this->_checking(Expectations::create() - -> one($encoder)->encodeString($value, any(), any()) -> returns('fo=8Fbar') - -> ignoring($encoder) - ); - - $header = $this->_getHeader('X-Foo', $encoder, null); - $header->setValue('bar'); - $header->setParameters(array('says' => $value)); - $this->assertEqual("X-Foo: bar; says=\"=?utf-8?Q?fo=8Fbar?=\"\r\n", - $header->toString() - ); - } - - public function testLanguageInformationAppearsInEncodedWords() - { - /* -- RFC 2231, 5. - 5. Language specification in Encoded Words - - RFC 2047 provides support for non-US-ASCII character sets in RFC 822 - message header comments, phrases, and any unstructured text field. - This is done by defining an encoded word construct which can appear - in any of these places. Given that these are fields intended for - display, it is sometimes necessary to associate language information - with encoded words as well as just the character set. This - specification extends the definition of an encoded word to allow the - inclusion of such information. This is simply done by suffixing the - character set specification with an asterisk followed by the language - tag. For example: - - From: =?US-ASCII*EN?Q?Keith_Moore?= - */ - - $value = 'fo' . pack('C', 0x8F) .'bar'; - - $encoder = $this->_getHeaderEncoder('Q'); - $this->_checking(Expectations::create() - -> one($encoder)->encodeString($value, any(), any()) -> returns('fo=8Fbar') - -> ignoring($encoder) - ); - - $paramEncoder = $this->_getParameterEncoder(); - $this->_checking(Expectations::create() - -> one($paramEncoder)->encodeString($value, any(), any()) -> returns('fo%8Fbar') - -> ignoring($paramEncoder) - ); - - $header = $this->_getHeader('X-Foo', $encoder, $paramEncoder); - $header->setLanguage('en'); - $header->setValue($value); - $header->setParameters(array('says' => $value)); - $this->assertEqual("X-Foo: =?utf-8*en?Q?fo=8Fbar?=; says*=utf-8'en'fo%8Fbar\r\n", - $header->toString() - ); - } - - public function testSetBodyModel() - { - $header = $this->_getHeader('Content-Type', - $this->_getHeaderEncoder('Q', true), $this->_getParameterEncoder(true) - ); - $header->setFieldBodyModel('text/html'); - $this->assertEqual('text/html', $header->getValue()); - } - - public function testGetBodyModel() - { - $header = $this->_getHeader('Content-Type', - $this->_getHeaderEncoder('Q', true), $this->_getParameterEncoder(true) - ); - $header->setValue('text/plain'); - $this->assertEqual('text/plain', $header->getFieldBodyModel()); - } - - public function testSetParameter() - { - $header = $this->_getHeader('Content-Type', - $this->_getHeaderEncoder('Q', true), $this->_getParameterEncoder(true) - ); - $header->setParameters(array('charset'=>'utf-8', 'delsp' => 'yes')); - $header->setParameter('delsp', 'no'); - $this->assertEqual(array('charset'=>'utf-8', 'delsp'=>'no'), - $header->getParameters() - ); - } - - public function testGetParameter() - { - $header = $this->_getHeader('Content-Type', - $this->_getHeaderEncoder('Q', true), $this->_getParameterEncoder(true) - ); - $header->setParameters(array('charset'=>'utf-8', 'delsp' => 'yes')); - $this->assertEqual('utf-8', $header->getParameter('charset')); - } - - // -- Private helper - - private function _getHeader($name, $encoder, $paramEncoder) - { - $header = new Swift_Mime_Headers_ParameterizedHeader($name, $encoder, - $paramEncoder, new Swift_Mime_Grammar() - ); - $header->setCharset($this->_charset); - return $header; - } - - private function _getHeaderEncoder($type, $stub = false) - { - $encoder = $this->_mock('Swift_Mime_HeaderEncoder'); - $this->_checking(Expectations::create() - -> ignoring($encoder)->getName() -> returns($type) - ); - if ($stub) { - $this->_checking(Expectations::create() - -> ignoring($encoder) - ); - } - return $encoder; - } - - private function _getParameterEncoder($stub = false) - { - if ($stub) { - return $this->_stub('Swift_Encoder'); - } else { - return $this->_mock('Swift_Encoder'); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/PathHeaderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/PathHeaderTest.php deleted file mode 100644 index 5fa9df2..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/PathHeaderTest.php +++ /dev/null @@ -1,83 +0,0 @@ -_getHeader('Return-Path'); - $this->assertEqual(Swift_Mime_Header::TYPE_PATH, $header->getFieldType()); - } - - public function testSingleAddressCanBeSetAndFetched() - { - $header = $this->_getHeader('Return-Path'); - $header->setAddress('chris@swiftmailer.org'); - $this->assertEqual('chris@swiftmailer.org', $header->getAddress()); - } - - public function testAddressMustComplyWithRfc2822() - { - try { - $header = $this->_getHeader('Return-Path'); - $header->setAddress('chr is@swiftmailer.org'); - $this->fail('Address must be valid according to RFC 2822 addr-spec grammar.'); - } catch (Exception $e) { - $this->pass(); - } - } - - public function testValueIsAngleAddrWithValidAddress() - { - /* -- RFC 2822, 3.6.7. - return = "Return-Path:" path CRLF - - path = ([CFWS] "<" ([CFWS] / addr-spec) ">" [CFWS]) / - obs-path - */ - - $header = $this->_getHeader('Return-Path'); - $header->setAddress('chris@swiftmailer.org'); - $this->assertEqual('', $header->getFieldBody()); - } - - public function testValueIsEmptyAngleBracketsIfEmptyAddressSet() - { - $header = $this->_getHeader('Return-Path'); - $header->setAddress(''); - $this->assertEqual('<>', $header->getFieldBody()); - } - - public function testSetBodyModel() - { - $header = $this->_getHeader('Return-Path'); - $header->setFieldBodyModel('foo@bar.tld'); - $this->assertEqual('foo@bar.tld', $header->getAddress()); - } - - public function testGetBodyModel() - { - $header = $this->_getHeader('Return-Path'); - $header->setAddress('foo@bar.tld'); - $this->assertEqual('foo@bar.tld', $header->getFieldBodyModel()); - } - - public function testToString() - { - $header = $this->_getHeader('Return-Path'); - $header->setAddress('chris@swiftmailer.org'); - $this->assertEqual('Return-Path: ' . "\r\n", - $header->toString() - ); - } - - // -- Private methods - - private function _getHeader($name) - { - return new Swift_Mime_Headers_PathHeader($name, new Swift_Mime_Grammar()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/UnstructuredHeaderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/UnstructuredHeaderTest.php deleted file mode 100644 index 47e4654..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/UnstructuredHeaderTest.php +++ /dev/null @@ -1,364 +0,0 @@ -_getHeader('Subject', $this->_getEncoder('Q', true)); - $this->assertEqual(Swift_Mime_Header::TYPE_TEXT, $header->getFieldType()); - } - - public function testGetNameReturnsNameVerbatim() - { - $header = $this->_getHeader('Subject', $this->_getEncoder('Q', true)); - $this->assertEqual('Subject', $header->getFieldName()); - } - - public function testGetValueReturnsValueVerbatim() - { - $header = $this->_getHeader('Subject', $this->_getEncoder('Q', true)); - $header->setValue('Test'); - $this->assertEqual('Test', $header->getValue()); - } - - public function testBasicStructureIsKeyValuePair() - { - /* -- RFC 2822, 2.2 - Header fields are lines composed of a field name, followed by a colon - (":"), followed by a field body, and terminated by CRLF. - */ - $header = $this->_getHeader('Subject', $this->_getEncoder('Q', true)); - $header->setValue('Test'); - $this->assertEqual('Subject: Test' . "\r\n", $header->toString()); - } - - public function testLongHeadersAreFoldedAtWordBoundary() - { - /* -- RFC 2822, 2.2.3 - Each header field is logically a single line of characters comprising - the field name, the colon, and the field body. For convenience - however, and to deal with the 998/78 character limitations per line, - the field body portion of a header field can be split into a multiple - line representation; this is called "folding". The general rule is - that wherever this standard allows for folding white space (not - simply WSP characters), a CRLF may be inserted before any WSP. - */ - - $value = 'The quick brown fox jumped over the fence, he was a very very ' . - 'scary brown fox with a bushy tail'; - $header = $this->_getHeader('X-Custom-Header', - $this->_getEncoder('Q', true) - ); - $header->setValue($value); - $header->setMaxLineLength(78); //A safe [RFC 2822, 2.2.3] default - /* - X-Custom-Header: The quick brown fox jumped over the fence, he was a very very - scary brown fox with a bushy tail - */ - $this->assertEqual( - 'X-Custom-Header: The quick brown fox jumped over the fence, he was a' . - ' very very' . "\r\n" . //Folding - ' scary brown fox with a bushy tail' . "\r\n", - $header->toString(), '%s: The header should have been folded at 78th char' - ); - } - - public function testPrintableAsciiOnlyAppearsInHeaders() - { - /* -- RFC 2822, 2.2. - A field name MUST be composed of printable US-ASCII characters (i.e., - characters that have values between 33 and 126, inclusive), except - colon. A field body may be composed of any US-ASCII characters, - except for CR and LF. - */ - - $nonAsciiChar = pack('C', 0x8F); - $header = $this->_getHeader('X-Test', $this->_getEncoder('Q', true)); - $header->setValue($nonAsciiChar); - $this->assertPattern( - '~^[^:\x00-\x20\x80-\xFF]+: [^\x80-\xFF\r\n]+\r\n$~s', - $header->toString() - ); - } - - public function testEncodedWordsFollowGeneralStructure() - { - /* -- RFC 2047, 1. - Generally, an "encoded-word" is a sequence of printable ASCII - characters that begins with "=?", ends with "?=", and has two "?"s in - between. - */ - - $nonAsciiChar = pack('C', 0x8F); - $header = $this->_getHeader('X-Test', $this->_getEncoder('Q', true)); - $header->setValue($nonAsciiChar); - $this->assertPattern( - '~^X-Test: \=?.*?\?.*?\?.*?\?=\r\n$~s', - $header->toString() - ); - } - - public function testEncodedWordIncludesCharsetAndEncodingMethodAndText() - { - /* -- RFC 2047, 2. - An 'encoded-word' is defined by the following ABNF grammar. The - notation of RFC 822 is used, with the exception that white space - characters MUST NOT appear between components of an 'encoded-word'. - - encoded-word = "=?" charset "?" encoding "?" encoded-text "?=" - */ - - $nonAsciiChar = pack('C', 0x8F); - - $encoder = $this->_getEncoder('Q'); - $this->_checking(Expectations::create() - -> one($encoder)->encodeString($nonAsciiChar, any(), any()) -> returns('=8F') - -> ignoring($encoder) - ); - $header = $this->_getHeader('X-Test', $encoder); - $header->setValue($nonAsciiChar); - $this->assertEqual( - 'X-Test: =?' . $this->_charset . '?Q?=8F?=' . "\r\n", - $header->toString() - ); - } - - public function testEncodedWordsAreUsedToEncodedNonPrintableAscii() - { - //SPACE and TAB permitted - $nonPrintableBytes = array_merge( - range(0x00, 0x08), range(0x10, 0x19), array(0x7F) - ); - - foreach ($nonPrintableBytes as $byte) { - $char = pack('C', $byte); - $encodedChar = sprintf('=%02X', $byte); - - $encoder = $this->_getEncoder('Q'); - $this->_checking(Expectations::create() - -> one($encoder)->encodeString($char, any(), any()) -> returns($encodedChar) - -> ignoring($encoder) - ); - - $header = $this->_getHeader('X-A', $encoder); - $header->setValue($char); - - $this->assertEqual( - 'X-A: =?' . $this->_charset . '?Q?' . $encodedChar . '?=' . "\r\n", - $header->toString(), '%s: Non-printable ascii should be encoded' - ); - } - } - - public function testEncodedWordsAreUsedToEncode8BitOctets() - { - $_8BitBytes = range(0x80, 0xFF); - - foreach ($_8BitBytes as $byte) { - $char = pack('C', $byte); - $encodedChar = sprintf('=%02X', $byte); - - $encoder = $this->_getEncoder('Q'); - $this->_checking(Expectations::create() - -> one($encoder)->encodeString($char, any(), any()) -> returns($encodedChar) - -> ignoring($encoder) - ); - - $header = $this->_getHeader('X-A', $encoder); - $header->setValue($char); - - $this->assertEqual( - 'X-A: =?' . $this->_charset . '?Q?' . $encodedChar . '?=' . "\r\n", - $header->toString(), '%s: 8-bit octets should be encoded' - ); - } - } - - public function testEncodedWordsAreNoMoreThan75CharsPerLine() - { - /* -- RFC 2047, 2. - An 'encoded-word' may not be more than 75 characters long, including - 'charset', 'encoding', 'encoded-text', and delimiters. - - ... SNIP ... - - While there is no limit to the length of a multiple-line header - field, each line of a header field that contains one or more - 'encoded-word's is limited to 76 characters. - */ - - $nonAsciiChar = pack('C', 0x8F); - - $encoder = $this->_getEncoder('Q'); - $this->_checking(Expectations::create() - -> one($encoder)->encodeString($nonAsciiChar, 8, 63) -> returns('=8F') - -> ignoring($encoder) - ); - //Note that multi-line headers begin with LWSP which makes 75 + 1 = 76 - //Note also that =?utf-8?q??= is 12 chars which makes 75 - 12 = 63 - - //* X-Test: is 8 chars - $header = $this->_getHeader('X-Test', $encoder); - $header->setValue($nonAsciiChar); - - $this->assertEqual( - 'X-Test: =?' . $this->_charset . '?Q?=8F?=' . "\r\n", - $header->toString() - ); - } - - public function testFWSPIsUsedWhenEncoderReturnsMultipleLines() - { - /* --RFC 2047, 2. - If it is desirable to encode more text than will fit in an 'encoded-word' of - 75 characters, multiple 'encoded-word's (separated by CRLF SPACE) may - be used. - */ - - //Note the Mock does NOT return 8F encoded, the 8F merely triggers - // encoding for the sake of testing - $nonAsciiChar = pack('C', 0x8F); - - $encoder = $this->_getEncoder('Q'); - $this->_checking(Expectations::create() - -> one($encoder)->encodeString($nonAsciiChar, 8, 63) - -> returns('line_one_here' . "\r\n" . 'line_two_here') - -> ignoring($encoder) - ); - - //Note that multi-line headers begin with LWSP which makes 75 + 1 = 76 - //Note also that =?utf-8?q??= is 12 chars which makes 75 - 12 = 63 - - //* X-Test: is 8 chars - $header = $this->_getHeader('X-Test', $encoder); - $header->setValue($nonAsciiChar); - - $this->assertEqual( - 'X-Test: =?' . $this->_charset . '?Q?line_one_here?=' . "\r\n" . - ' =?' . $this->_charset . '?Q?line_two_here?=' . "\r\n", - $header->toString() - ); - } - - public function testAdjacentWordsAreEncodedTogether() - { - /* -- RFC 2047, 5 (1) - Ordinary ASCII text and 'encoded-word's may appear together in the - same header field. However, an 'encoded-word' that appears in a - header field defined as '*text' MUST be separated from any adjacent - 'encoded-word' or 'text' by 'linear-white-space'. - - -- RFC 2047, 2. - IMPORTANT: 'encoded-word's are designed to be recognized as 'atom's - by an RFC 822 parser. As a consequence, unencoded white space - characters (such as SPACE and HTAB) are FORBIDDEN within an - 'encoded-word'. - */ - - //It would be valid to encode all words needed, however it's probably - // easiest to encode the longest amount required at a time - - $word = 'w' . pack('C', 0x8F) . 'rd'; - $text = 'start ' . $word . ' ' . $word . ' then end ' . $word; - // 'start', ' word word', ' and end', ' word' - - $encoder = $this->_getEncoder('Q'); - $this->_checking(Expectations::create() - -> one($encoder)->encodeString($word . ' ' . $word, any(), any()) - -> returns('w=8Frd_w=8Frd') - -> one($encoder)->encodeString($word, any(), any()) -> returns('w=8Frd') - -> ignoring($encoder) - ); - - $header = $this->_getHeader('X-Test', $encoder); - $header->setValue($text); - - $headerString = $header->toString(); - - $this->assertEqual('X-Test: start =?' . $this->_charset . '?Q?' . - 'w=8Frd_w=8Frd?= then end =?' . $this->_charset . '?Q?'. - 'w=8Frd?=' . "\r\n", $headerString, - '%s: Adjacent encoded words should appear grouped with WSP encoded' - ); - } - - public function testLanguageInformationAppearsInEncodedWords() - { - /* -- RFC 2231, 5. - 5. Language specification in Encoded Words - - RFC 2047 provides support for non-US-ASCII character sets in RFC 822 - message header comments, phrases, and any unstructured text field. - This is done by defining an encoded word construct which can appear - in any of these places. Given that these are fields intended for - display, it is sometimes necessary to associate language information - with encoded words as well as just the character set. This - specification extends the definition of an encoded word to allow the - inclusion of such information. This is simply done by suffixing the - character set specification with an asterisk followed by the language - tag. For example: - - From: =?US-ASCII*EN?Q?Keith_Moore?= - */ - - $value = 'fo' . pack('C', 0x8F) . 'bar'; - - $encoder = $this->_getEncoder('Q'); - $this->_checking(Expectations::create() - -> one($encoder)->encodeString($value, any(), any()) -> returns('fo=8Fbar') - -> ignoring($encoder) - ); - - $header = $this->_getHeader('Subject', $encoder); - $header->setLanguage('en'); - $header->setValue($value); - $this->assertEqual("Subject: =?utf-8*en?Q?fo=8Fbar?=\r\n", - $header->toString() - ); - } - - public function testSetBodyModel() - { - $header = $this->_getHeader('Subject', $this->_getEncoder('Q', true)); - $header->setFieldBodyModel('test'); - $this->assertEqual('test', $header->getValue()); - } - - public function testGetBodyModel() - { - $header = $this->_getHeader('Subject', $this->_getEncoder('Q', true)); - $header->setValue('test'); - $this->assertEqual('test', $header->getFieldBodyModel()); - } - - // -- Private methods - - private function _getHeader($name, $encoder) - { - $header = new Swift_Mime_Headers_UnstructuredHeader($name, $encoder, new Swift_Mime_Grammar()); - $header->setCharset($this->_charset); - return $header; - } - - private function _getEncoder($type, $stub = false) - { - $encoder = $this->_mock('Swift_Mime_HeaderEncoder'); - $this->_checking(Expectations::create() - -> ignoring($encoder)->getName() -> returns($type) - ); - if ($stub) { - $this->_checking(Expectations::create() - -> ignoring($encoder) - ); - } - return $encoder; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/MimePartTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/MimePartTest.php deleted file mode 100644 index aadf788..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/MimePartTest.php +++ /dev/null @@ -1,252 +0,0 @@ -_createMimePart($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual( - Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, $part->getNestingLevel() - ); - } - - public function testCharsetIsReturnedFromHeader() - { - /* -- RFC 2046, 4.1.2. - A critical parameter that may be specified in the Content-Type field - for "text/plain" data is the character set. This is specified with a - "charset" parameter, as in: - - Content-type: text/plain; charset=iso-8859-1 - - Unlike some other parameter values, the values of the charset - parameter are NOT case sensitive. The default character set, which - must be assumed in the absence of a charset parameter, is US-ASCII. - */ - - $cType = $this->_createHeader('Content-Type', 'text/plain', - array('charset' => 'iso-8859-1') - ); - $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual('iso-8859-1', $part->getCharset()); - } - - public function testCharsetIsSetInHeader() - { - $cType = $this->_createHeader('Content-Type', 'text/plain', - array('charset' => 'iso-8859-1'), false - ); - $this->_checking(Expectations::create() - -> one($cType)->setParameter('charset', 'utf-8') - -> ignoring($cType) - ); - $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType)), - $this->_createEncoder(), $this->_createCache() - ); - $part->setCharset('utf-8'); - } - - public function testCharsetIsSetInHeaderIfPassedToSetBody() - { - $cType = $this->_createHeader('Content-Type', 'text/plain', - array('charset' => 'iso-8859-1'), false - ); - $this->_checking(Expectations::create() - -> one($cType)->setParameter('charset', 'utf-8') - -> ignoring($cType) - ); - $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType)), - $this->_createEncoder(), $this->_createCache() - ); - $part->setBody('', 'text/plian', 'utf-8'); - } - - public function testSettingCharsetNotifiesEncoder() - { - $encoder = $this->_createEncoder('quoted-printable', false); - $this->_checking(Expectations::create() - -> one($encoder)->charsetChanged('utf-8') - -> ignoring($encoder) - ); - $part = $this->_createMimePart($this->_createHeaderSet(), - $encoder, $this->_createCache() - ); - $part->setCharset('utf-8'); - } - - public function testSettingCharsetNotifiesHeaders() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->charsetChanged('utf-8') - -> ignoring($headers) - ); - $part = $this->_createMimePart($headers, $this->_createEncoder(), - $this->_createCache() - ); - $part->setCharset('utf-8'); - } - - public function testSettingCharsetNotifiesChildren() - { - $child = $this->_createChild(0, '', false); - - $this->_checking(Expectations::create() - -> one($child)->charsetChanged('windows-874') - -> ignoring($child) - ); - - $part = $this->_createMimePart($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $part->setChildren(array($child)); - $part->setCharset('windows-874'); - } - - public function testCharsetChangeUpdatesCharset() - { - $cType = $this->_createHeader('Content-Type', 'text/plain', - array('charset' => 'iso-8859-1'), false - ); - $this->_checking(Expectations::create() - -> one($cType)->setParameter('charset', 'utf-8') - -> ignoring($cType) - ); - $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType)), - $this->_createEncoder(), $this->_createCache() - ); - $part->charsetChanged('utf-8'); - } - - public function testSettingCharsetClearsCache() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> ignoring($headers)->toString() -> returns( - "Content-Type: text/plain; charset=utf-8\r\n" - ) - -> ignoring($headers) - ); - - $cache = $this->_createCache(false); - $this->_checking(Expectations::create() - -> one($cache)->clearKey(any(), 'body') - -> ignoring($cache) - ); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $cache - ); - - $entity->setBody("blah\r\nblah!"); - $entity->toString(); - - $entity->setCharset('iso-2022'); - } - - public function testFormatIsReturnedFromHeader() - { - /* -- RFC 3676. - */ - - $cType = $this->_createHeader('Content-Type', 'text/plain', - array('format' => 'flowed') - ); - $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual('flowed', $part->getFormat()); - } - - public function testFormatIsSetInHeader() - { - $cType = $this->_createHeader('Content-Type', 'text/plain', array(), false); - $this->_checking(Expectations::create() - -> one($cType)->setParameter('format', 'fixed') - -> ignoring($cType) - ); - $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType)), - $this->_createEncoder(), $this->_createCache() - ); - $part->setFormat('fixed'); - } - - public function testDelSpIsReturnedFromHeader() - { - /* -- RFC 3676. - */ - - $cType = $this->_createHeader('Content-Type', 'text/plain', - array('delsp' => 'no') - ); - $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertIdentical(false, $part->getDelSp()); - } - - public function testDelSpIsSetInHeader() - { - $cType = $this->_createHeader('Content-Type', 'text/plain', array(), false); - $this->_checking(Expectations::create() - -> one($cType)->setParameter('delsp', 'yes') - -> ignoring($cType) - ); - $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType)), - $this->_createEncoder(), $this->_createCache() - ); - $part->setDelSp(true); - } - - public function testFluidInterface() - { - $part = $this->_createMimePart($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - - $this->assertSame($part, - $part - ->setContentType('text/plain') - ->setEncoder($this->_createEncoder()) - ->setId('foo@bar') - ->setDescription('my description') - ->setMaxLineLength(998) - ->setBody('xx') - ->setBoundary('xyz') - ->setChildren(array()) - ->setCharset('utf-8') - ->setFormat('flowed') - ->setDelSp(true) - ); - } - - // -- Private helpers - - //abstract - protected function _createEntity($headers, $encoder, $cache) - { - return $this->_createMimePart($headers, $encoder, $cache); - } - - protected function _createMimePart($headers, $encoder, $cache) - { - return new Swift_Mime_MimePart($headers, $encoder, $cache, new Swift_Mime_Grammar()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderFactoryTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderFactoryTest.php deleted file mode 100644 index 4f56f52..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderFactoryTest.php +++ /dev/null @@ -1,179 +0,0 @@ -_factory = $this->_createFactory(); - } - - public function testMailboxHeaderIsCorrectType() - { - $header = $this->_factory->createMailboxHeader('X-Foo'); - $this->assertIsA($header, 'Swift_Mime_Headers_MailboxHeader'); - } - - public function testMailboxHeaderHasCorrectName() - { - $header = $this->_factory->createMailboxHeader('X-Foo'); - $this->assertEqual('X-Foo', $header->getFieldName()); - } - - public function testMailboxHeaderHasCorrectModel() - { - $header = $this->_factory->createMailboxHeader('X-Foo', - array('foo@bar'=>'FooBar') - ); - $this->assertEqual(array('foo@bar'=>'FooBar'), $header->getFieldBodyModel()); - } - - public function testDateHeaderHasCorrectType() - { - $header = $this->_factory->createDateHeader('X-Date'); - $this->assertIsA($header, 'Swift_Mime_Headers_DateHeader'); - } - - public function testDateHeaderHasCorrectName() - { - $header = $this->_factory->createDateHeader('X-Date'); - $this->assertEqual('X-Date', $header->getFieldName()); - } - - public function testDateHeaderHasCorrectModel() - { - $header = $this->_factory->createDateHeader('X-Date', 123); - $this->assertEqual(123, $header->getFieldBodyModel()); - } - - public function testTextHeaderHasCorrectType() - { - $header = $this->_factory->createTextHeader('X-Foo'); - $this->assertIsA($header, 'Swift_Mime_Headers_UnstructuredHeader'); - } - - public function testTextHeaderHasCorrectName() - { - $header = $this->_factory->createTextHeader('X-Foo'); - $this->assertEqual('X-Foo', $header->getFieldName()); - } - - public function testTextHeaderHasCorrectModel() - { - $header = $this->_factory->createTextHeader('X-Foo', 'bar'); - $this->assertEqual('bar', $header->getFieldBodyModel()); - } - - public function testParameterizedHeaderHasCorrectType() - { - $header = $this->_factory->createParameterizedHeader('X-Foo'); - $this->assertIsA($header, 'Swift_Mime_Headers_ParameterizedHeader'); - } - - public function testParameterizedHeaderHasCorrectName() - { - $header = $this->_factory->createParameterizedHeader('X-Foo'); - $this->assertEqual('X-Foo', $header->getFieldName()); - } - - public function testParameterizedHeaderHasCorrectModel() - { - $header = $this->_factory->createParameterizedHeader('X-Foo', 'bar'); - $this->assertEqual('bar', $header->getFieldBodyModel()); - } - - public function testParameterizedHeaderHasCorrectParams() - { - $header = $this->_factory->createParameterizedHeader('X-Foo', 'bar', - array('zip' => 'button') - ); - $this->assertEqual(array('zip'=>'button'), $header->getParameters()); - } - - public function testIdHeaderHasCorrectType() - { - $header = $this->_factory->createIdHeader('X-ID'); - $this->assertIsA($header, 'Swift_Mime_Headers_IdentificationHeader'); - } - - public function testIdHeaderHasCorrectName() - { - $header = $this->_factory->createIdHeader('X-ID'); - $this->assertEqual('X-ID', $header->getFieldName()); - } - - public function testIdHeaderHasCorrectModel() - { - $header = $this->_factory->createIdHeader('X-ID', 'xyz@abc'); - $this->assertEqual(array('xyz@abc'), $header->getFieldBodyModel()); - } - - public function testPathHeaderHasCorrectType() - { - $header = $this->_factory->createPathHeader('X-Path'); - $this->assertIsA($header, 'Swift_Mime_Headers_PathHeader'); - } - - public function testPathHeaderHasCorrectName() - { - $header = $this->_factory->createPathHeader('X-Path'); - $this->assertEqual('X-Path', $header->getFieldName()); - } - - public function testPathHeaderHasCorrectModel() - { - $header = $this->_factory->createPathHeader('X-Path', 'foo@bar'); - $this->assertEqual('foo@bar', $header->getFieldBodyModel()); - } - - public function testCharsetChangeNotificationNotifiesEncoders() - { - $encoder = $this->_createHeaderEncoder(false); - $paramEncoder = $this->_createParamEncoder(false); - - $factory = $this->_createFactory($encoder, $paramEncoder); - - $this->_checking(Expectations::create() - -> one($encoder)->charsetChanged('utf-8') - -> one($paramEncoder)->charsetChanged('utf-8') - -> ignoring($encoder) - -> ignoring($paramEncoder) - ); - - $factory->charsetChanged('utf-8'); - } - - // -- Creation methods - - private function _createFactory($encoder = null, $paramEncoder = null) - { - return new Swift_Mime_SimpleHeaderFactory( - $encoder - ? $encoder : $this->_createHeaderEncoder(), - $paramEncoder - ? $paramEncoder : $this->_createParamEncoder(), - new Swift_Mime_Grammar() - ); - } - - private function _createHeaderEncoder($stub = true) - { - return $stub - ? $this->_stub('Swift_Mime_HeaderEncoder') - : $this->_mock('Swift_Mime_HeaderEncoder'); - } - - private function _createParamEncoder($stub = true) - { - return $stub - ? $this->_stub('Swift_Encoder') - : $this->_mock('Swift_Encoder'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderSetTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderSetTest.php deleted file mode 100644 index 943701d..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderSetTest.php +++ /dev/null @@ -1,652 +0,0 @@ -_createFactory(); - $this->_checking(Expectations::create() - -> one($factory)->createMailboxHeader('From', array('person@domain'=>'Person')) - -> returns($this->_createHeader('From')) - ); - $set = $this->_createSet($factory); - $set->addMailboxHeader('From', array('person@domain'=>'Person')); - } - - public function testAddDateHeaderDelegatesToFactory() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> one($factory)->createDateHeader('Date', 1234) - -> returns($this->_createHeader('Date')) - ); - $set = $this->_createSet($factory); - $set->addDateHeader('Date', 1234); - } - - public function testAddTextHeaderDelegatesToFactory() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> one($factory)->createTextHeader('Subject', 'some text') - -> returns($this->_createHeader('Subject')) - ); - $set = $this->_createSet($factory); - $set->addTextHeader('Subject', 'some text'); - } - - public function testAddParameterizedHeaderDelegatesToFactory() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> one($factory)->createParameterizedHeader( - 'Content-Type', 'text/plain', array('charset'=>'utf-8') - ) -> returns($this->_createHeader('Content-Type')) - ); - $set = $this->_createSet($factory); - $set->addParameterizedHeader('Content-Type', 'text/plain', - array('charset'=>'utf-8') - ); - } - - public function testAddIdHeaderDelegatesToFactory() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> one($factory)->createIdHeader('Message-ID', 'some@id') - -> returns($this->_createHeader('Message-ID')) - ); - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - } - - public function testAddPathHeaderDelegatesToFactory() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> one($factory)->createPathHeader('Return-Path', 'some@path') - -> returns($this->_createHeader('Return-Path')) - ); - $set = $this->_createSet($factory); - $set->addPathHeader('Return-Path', 'some@path'); - } - - public function testHasReturnsFalseWhenNoHeaders() - { - $set = $this->_createSet($this->_createFactory()); - $this->assertFalse($set->has('Some-Header')); - } - - public function testAddedMailboxHeaderIsSeenByHas() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createMailboxHeader('From', array('person@domain'=>'Person')) - -> returns($this->_createHeader('From')) - ); - $set = $this->_createSet($factory); - $set->addMailboxHeader('From', array('person@domain'=>'Person')); - $this->assertTrue($set->has('From')); - } - - public function testAddedDateHeaderIsSeenByHas() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createDateHeader('Date', 1234) - -> returns($this->_createHeader('Date')) - ); - $set = $this->_createSet($factory); - $set->addDateHeader('Date', 1234); - $this->assertTrue($set->has('Date')); - } - - public function testAddedTextHeaderIsSeenByHas() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createTextHeader('Subject', 'some text') - -> returns($this->_createHeader('Subject')) - ); - $set = $this->_createSet($factory); - $set->addTextHeader('Subject', 'some text'); - $this->assertTrue($set->has('Subject')); - } - - public function testAddedParameterizedHeaderIsSeenByHas() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createParameterizedHeader( - 'Content-Type', 'text/plain', array('charset'=>'utf-8') - ) -> returns($this->_createHeader('Content-Type')) - ); - $set = $this->_createSet($factory); - $set->addParameterizedHeader('Content-Type', 'text/plain', - array('charset'=>'utf-8') - ); - $this->assertTrue($set->has('Content-Type')); - } - - public function testAddedIdHeaderIsSeenByHas() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createIdHeader('Message-ID', 'some@id') - -> returns($this->_createHeader('Message-ID')) - ); - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertTrue($set->has('Message-ID')); - } - - public function testAddedPathHeaderIsSeenByHas() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createPathHeader('Return-Path', 'some@path') - -> returns($this->_createHeader('Return-Path')) - ); - $set = $this->_createSet($factory); - $set->addPathHeader('Return-Path', 'some@path'); - $this->assertTrue($set->has('Return-Path')); - } - - public function testNewlySetHeaderIsSeenByHas() - { - $factory = $this->_createFactory(); - $header = $this->_createHeader('X-Foo', 'bar'); - $set = $this->_createSet($factory); - $set->set($header); - $this->assertTrue($set->has('X-Foo')); - } - - public function testHasCanAcceptOffset() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createIdHeader('Message-ID', 'some@id') - -> returns($this->_createHeader('Message-ID')) - ); - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertTrue($set->has('Message-ID', 0)); - } - - public function testHasWithIllegalOffsetReturnsFalse() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createIdHeader('Message-ID', 'some@id') - -> returns($this->_createHeader('Message-ID')) - ); - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertFalse($set->has('Message-ID', 1)); - } - - public function testHasCanDistinguishMultipleHeaders() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createIdHeader('Message-ID', 'some@id') - -> returns($this->_createHeader('Message-ID')) - -> ignoring($factory)->createIdHeader('Message-ID', 'other@id') - -> returns($this->_createHeader('Message-ID')) - ); - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Message-ID', 'other@id'); - $this->assertTrue($set->has('Message-ID', 1)); - } - - public function testGetWithUnspecifiedOffset() - { - $header = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createIdHeader('Message-ID', 'some@id') - -> returns($header) - ); - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertSame($header, $set->get('Message-ID')); - } - - public function testGetWithSpeiciedOffset() - { - $header0 = $this->_createHeader('Message-ID'); - $header1 = $this->_createHeader('Message-ID'); - $header2 = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createIdHeader('Message-ID', 'some@id') - -> returns($header0) - -> ignoring($factory)->createIdHeader('Message-ID', 'other@id') - -> returns($header1) - -> ignoring($factory)->createIdHeader('Message-ID', 'more@id') - -> returns($header2) - ); - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Message-ID', 'other@id'); - $set->addIdHeader('Message-ID', 'more@id'); - $this->assertSame($header1, $set->get('Message-ID', 1)); - } - - public function testGetReturnsNullIfHeaderNotSet() - { - $set = $this->_createSet($this->_createFactory()); - $this->assertNull($set->get('Message-ID', 99)); - } - - public function testGetAllReturnsAllHeadersMatchingName() - { - $header0 = $this->_createHeader('Message-ID'); - $header1 = $this->_createHeader('Message-ID'); - $header2 = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createIdHeader('Message-ID', 'some@id') - -> returns($header0) - -> ignoring($factory)->createIdHeader('Message-ID', 'other@id') - -> returns($header1) - -> ignoring($factory)->createIdHeader('Message-ID', 'more@id') - -> returns($header2) - ); - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Message-ID', 'other@id'); - $set->addIdHeader('Message-ID', 'more@id'); - - $this->assertEqual(array($header0, $header1, $header2), - $set->getAll('Message-ID') - ); - } - - public function testGetAllReturnsAllHeadersIfNoArguments() - { - $header0 = $this->_createHeader('Message-ID'); - $header1 = $this->_createHeader('Subject'); - $header2 = $this->_createHeader('To'); - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createIdHeader('Message-ID', 'some@id') - -> returns($header0) - -> ignoring($factory)->createIdHeader('Subject', 'thing') - -> returns($header1) - -> ignoring($factory)->createIdHeader('To', 'person@example.org') - -> returns($header2) - ); - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Subject', 'thing'); - $set->addIdHeader('To', 'person@example.org'); - - $this->assertEqual(array($header0, $header1, $header2), - $set->getAll() - ); - } - - public function testGetAllReturnsEmptyArrayIfNoneSet() - { - $set = $this->_createSet($this->_createFactory()); - $this->assertEqual(array(), $set->getAll('Received')); - } - - public function testRemoveWithUnspecifiedOffset() - { - $header = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createIdHeader('Message-ID', 'some@id') - -> returns($header) - ); - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->remove('Message-ID'); - $this->assertFalse($set->has('Message-ID')); - } - - public function testRemoveWithSpecifiedIndexRemovesHeader() - { - $header0 = $this->_createHeader('Message-ID'); - $header1 = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createIdHeader('Message-ID', 'some@id') - -> returns($header0) - -> ignoring($factory)->createIdHeader('Message-ID', 'other@id') - -> returns($header1) - ); - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Message-ID', 'other@id'); - $set->remove('Message-ID', 1); - $this->assertFalse($set->has('Message-ID', 1)); - } - - public function testRemoveWithSpecifiedIndexLeavesOtherHeaders() - { - $header0 = $this->_createHeader('Message-ID'); - $header1 = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createIdHeader('Message-ID', 'some@id') - -> returns($header0) - -> ignoring($factory)->createIdHeader('Message-ID', 'other@id') - -> returns($header1) - ); - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Message-ID', 'other@id'); - $set->remove('Message-ID', 1); - $this->assertTrue($set->has('Message-ID', 0)); - } - - public function testRemoveWithInvalidOffsetDoesNothing() - { - $header = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createIdHeader('Message-ID', 'some@id') - -> returns($header) - ); - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->remove('Message-ID', 50); - $this->assertTrue($set->has('Message-ID')); - } - - public function testRemoveAllRemovesAllHeadersWithName() - { - $header0 = $this->_createHeader('Message-ID'); - $header1 = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createIdHeader('Message-ID', 'some@id') - -> returns($header0) - -> ignoring($factory)->createIdHeader('Message-ID', 'other@id') - -> returns($header1) - ); - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Message-ID', 'other@id'); - $set->removeAll('Message-ID'); - $this->assertFalse($set->has('Message-ID', 0)); - $this->assertFalse($set->has('Message-ID', 1)); - } - - public function testHasIsNotCaseSensitive() - { - $header = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createIdHeader('Message-ID', 'some@id') - -> returns($header) - ); - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertTrue($set->has('message-id')); - } - - public function testGetIsNotCaseSensitive() - { - $header = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createIdHeader('Message-ID', 'some@id') - -> returns($header) - ); - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertSame($header, $set->get('message-id')); - } - - public function testGetAllIsNotCaseSensitive() - { - $header = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createIdHeader('Message-ID', 'some@id') - -> returns($header) - ); - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertEqual(array($header), $set->getAll('message-id')); - } - - public function testRemoveIsNotCaseSensitive() - { - $header = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createIdHeader('Message-ID', 'some@id') - -> returns($header) - ); - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->remove('message-id'); - $this->assertFalse($set->has('Message-ID')); - } - - public function testRemoveAllIsNotCaseSensitive() - { - $header = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createIdHeader('Message-ID', 'some@id') - -> returns($header) - ); - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->removeAll('message-id'); - $this->assertFalse($set->has('Message-ID')); - } - - public function testNewInstance() - { - $set = $this->_createSet($this->_createFactory()); - $instance = $set->newInstance(); - $this->assertIsA($instance, 'Swift_Mime_HeaderSet'); - } - - public function testToStringJoinsHeadersTogether() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> one($factory)->createTextHeader('Foo', 'bar') - -> returns($this->_createHeader('Foo', 'bar')) - -> one($factory)->createTextHeader('Zip', 'buttons') - -> returns($this->_createHeader('Zip', 'buttons')) - ); - $set = $this->_createSet($factory); - $set->addTextHeader('Foo', 'bar'); - $set->addTextHeader('Zip', 'buttons'); - $this->assertEqual( - "Foo: bar\r\n" . - "Zip: buttons\r\n", - $set->toString() - ); - } - - public function testHeadersWithoutBodiesAreNotDisplayed() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> one($factory)->createTextHeader('Foo', 'bar') - -> returns($this->_createHeader('Foo', 'bar')) - -> one($factory)->createTextHeader('Zip', '') - -> returns($this->_createHeader('Zip', '')) - ); - $set = $this->_createSet($factory); - $set->addTextHeader('Foo', 'bar'); - $set->addTextHeader('Zip', ''); - $this->assertEqual( - "Foo: bar\r\n", - $set->toString() - ); - } - - public function testHeadersWithoutBodiesCanBeForcedToDisplay() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> one($factory)->createTextHeader('Foo', '') - -> returns($this->_createHeader('Foo', '')) - -> one($factory)->createTextHeader('Zip', '') - -> returns($this->_createHeader('Zip', '')) - ); - $set = $this->_createSet($factory); - $set->addTextHeader('Foo', ''); - $set->addTextHeader('Zip', ''); - $set->setAlwaysDisplayed(array('Foo', 'Zip')); - $this->assertEqual( - "Foo: \r\n" . - "Zip: \r\n", - $set->toString() - ); - } - - public function testHeaderSequencesCanBeSpecified() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> one($factory)->createTextHeader('First', 'one') - -> returns($this->_createHeader('First', 'one')) - -> one($factory)->createTextHeader('Second', 'two') - -> returns($this->_createHeader('Second', 'two')) - -> one($factory)->createTextHeader('Third', 'three') - -> returns($this->_createHeader('Third', 'three')) - ); - $set = $this->_createSet($factory); - $set->addTextHeader('Third', 'three'); - $set->addTextHeader('First', 'one'); - $set->addTextHeader('Second', 'two'); - - $set->defineOrdering(array('First', 'Second', 'Third')); - - $this->assertEqual( - "First: one\r\n" . - "Second: two\r\n" . - "Third: three\r\n", - $set->toString() - ); - } - - public function testUnsortedHeadersAppearAtEnd() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> one($factory)->createTextHeader('First', 'one') - -> returns($this->_createHeader('First', 'one')) - -> one($factory)->createTextHeader('Second', 'two') - -> returns($this->_createHeader('Second', 'two')) - -> one($factory)->createTextHeader('Third', 'three') - -> returns($this->_createHeader('Third', 'three')) - -> one($factory)->createTextHeader('Fourth', 'four') - -> returns($this->_createHeader('Fourth', 'four')) - -> one($factory)->createTextHeader('Fifth', 'five') - -> returns($this->_createHeader('Fifth', 'five')) - ); - $set = $this->_createSet($factory); - $set->addTextHeader('Fourth', 'four'); - $set->addTextHeader('Fifth', 'five'); - $set->addTextHeader('Third', 'three'); - $set->addTextHeader('First', 'one'); - $set->addTextHeader('Second', 'two'); - - $set->defineOrdering(array('First', 'Second', 'Third')); - - $this->assertEqual( - "First: one\r\n" . - "Second: two\r\n" . - "Third: three\r\n" . - "Fourth: four\r\n" . - "Fifth: five\r\n", - $set->toString() - ); - } - - public function testSettingCharsetNotifiesAlreadyExistingHeaders() - { - $subject = $this->_createHeader('Subject', 'some text'); - $xHeader = $this->_createHeader('X-Header', 'some text'); - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createTextHeader('Subject', 'some text') - -> returns($subject) - -> ignoring($factory)->createTextHeader('X-Header', 'some text') - -> returns($xHeader) - -> ignoring($factory) - -> one($subject)->setCharset('utf-8') - -> one($xHeader)->setCharset('utf-8') - ); - $set = $this->_createSet($factory); - $set->addTextHeader('Subject', 'some text'); - $set->addTextHeader('X-Header', 'some text'); - - $set->setCharset('utf-8'); - } - - public function testCharsetChangeNotifiesAlreadyExistingHeaders() - { - $subject = $this->_createHeader('Subject', 'some text'); - $xHeader = $this->_createHeader('X-Header', 'some text'); - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> ignoring($factory)->createTextHeader('Subject', 'some text') - -> returns($subject) - -> ignoring($factory)->createTextHeader('X-Header', 'some text') - -> returns($xHeader) - -> ignoring($factory) - -> one($subject)->setCharset('utf-8') - -> one($xHeader)->setCharset('utf-8') - ); - $set = $this->_createSet($factory); - $set->addTextHeader('Subject', 'some text'); - $set->addTextHeader('X-Header', 'some text'); - - $set->charsetChanged('utf-8'); - } - - public function testCharsetChangeNotifiesFactory() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> one($factory)->charsetChanged('utf-8') - -> ignoring($factory) - ); - $set = $this->_createSet($factory); - - $set->setCharset('utf-8'); - } - - // -- Creation methods - - private function _createSet($factory) - { - return new Swift_Mime_SimpleHeaderSet($factory); - } - - private function _createFactory() - { - return $this->_mock('Swift_Mime_HeaderFactory'); - } - - private function _createHeader($name, $body = '') - { - $header = $this->_mock('Swift_Mime_Header'); - $this->_checking(Expectations::create() - -> ignoring($header)->getFieldName() -> returns($name) - -> ignoring($header)->toString() -> returns(sprintf("%s: %s\r\n", $name, $body)) - -> ignoring($header)->getFieldBody() -> returns($body) - ); - return $header; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMessageTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMessageTest.php deleted file mode 100644 index 831f2bf..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMessageTest.php +++ /dev/null @@ -1,803 +0,0 @@ -_createMessage($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual( - Swift_Mime_MimeEntity::LEVEL_TOP, $message->getNestingLevel() - ); - } - - public function testDateIsReturnedFromHeader() - { - $date = $this->_createHeader('Date', 123); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Date' => $date)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual(123, $message->getDate()); - } - - public function testDateIsSetInHeader() - { - $date = $this->_createHeader('Date', 123, array(), false); - $this->_checking(Expectations::create() - -> one($date)->setFieldBodyModel(1234) - -> ignoring($date) - ); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Date' => $date)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setDate(1234); - } - - public function testDateHeaderIsCreatedIfNonePresent() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addDateHeader('Date', 1234) - -> ignoring($headers) - ); - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setDate(1234); - } - - public function testDateHeaderIsAddedDuringConstruction() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addDateHeader('Date', pattern('/^[0-9]+$/D')) - -> ignoring($headers) - ); - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - } - - public function testIdIsReturnedFromHeader() - { - /* -- RFC 2045, 7. - In constructing a high-level user agent, it may be desirable to allow - one body to make reference to another. Accordingly, bodies may be - labelled using the "Content-ID" header field, which is syntactically - identical to the "Message-ID" header field - */ - - $messageId = $this->_createHeader('Message-ID', 'a@b'); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Message-ID' => $messageId)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual('a@b', $message->getId()); - } - - public function testIdIsSetInHeader() - { - $messageId = $this->_createHeader('Message-ID', 'a@b', array(), false); - $this->_checking(Expectations::create() - -> one($messageId)->setFieldBodyModel('x@y') - -> ignoring($messageId) - ); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Message-ID' => $messageId)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setId('x@y'); - } - - public function testIdIsAutoGenerated() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addIdHeader('Message-ID', pattern('/^.*?@.*?$/D')) - -> ignoring($headers) - ); - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - } - - public function testSubjectIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.5. - */ - - $subject = $this->_createHeader('Subject', 'example subject'); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Subject' => $subject)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual('example subject', $message->getSubject()); - } - - public function testSubjectIsSetInHeader() - { - $subject = $this->_createHeader('Subject', '', array(), false); - $this->_checking(Expectations::create() - -> one($subject)->setFieldBodyModel('foo') - -> ignoring($subject) - ); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Subject' => $subject)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setSubject('foo'); - } - - public function testSubjectHeaderIsCreatedIfNotPresent() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addTextHeader('Subject', 'example subject') - -> ignoring($headers) - ); - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setSubject('example subject'); - } - - public function testReturnPathIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.7. - */ - - $path = $this->_createHeader('Return-Path', 'bounces@domain'); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Return-Path' => $path)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual('bounces@domain', $message->getReturnPath()); - } - - public function testReturnPathIsSetInHeader() - { - $path = $this->_createHeader('Return-Path', '', array(), false); - $this->_checking(Expectations::create() - -> one($path)->setFieldBodyModel('bounces@domain') - -> ignoring($path) - ); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Return-Path' => $path)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setReturnPath('bounces@domain'); - } - - public function testReturnPathHeaderIsAddedIfNoneSet() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addPathHeader('Return-Path', 'bounces@domain') - -> ignoring($headers) - ); - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setReturnPath('bounces@domain'); - } - - public function testSenderIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.2. - */ - - $sender = $this->_createHeader('Sender', array('sender@domain'=>'Name')); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Sender' => $sender)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual(array('sender@domain'=>'Name'), $message->getSender()); - } - - public function testSenderIsSetInHeader() - { - $sender = $this->_createHeader('Sender', array('sender@domain'=>'Name'), - array(), false - ); - $this->_checking(Expectations::create() - -> one($sender)->setFieldBodyModel(array('other@domain'=>'Other')) - -> ignoring($sender) - ); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Sender' => $sender)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setSender(array('other@domain'=>'Other')); - } - - public function testSenderHeaderIsAddedIfNoneSet() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addMailboxHeader('Sender', (array) 'sender@domain') - -> ignoring($headers) - ); - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setSender('sender@domain'); - } - - public function testNameCanBeUsedInSenderHeader() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addMailboxHeader('Sender', array('sender@domain'=>'Name')) - -> ignoring($headers) - ); - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setSender('sender@domain', 'Name'); - } - - public function testFromIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.2. - */ - - $from = $this->_createHeader('From', array('from@domain'=>'Name')); - $message = $this->_createMessage( - $this->_createHeaderSet(array('From' => $from)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual(array('from@domain'=>'Name'), $message->getFrom()); - } - - public function testFromIsSetInHeader() - { - $from = $this->_createHeader('From', array('from@domain'=>'Name'), - array(), false - ); - $this->_checking(Expectations::create() - -> one($from)->setFieldBodyModel(array('other@domain'=>'Other')) - -> ignoring($from) - ); - $message = $this->_createMessage( - $this->_createHeaderSet(array('From' => $from)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setFrom(array('other@domain'=>'Other')); - } - - public function testFromIsAddedToHeadersDuringAddFrom() - { - $from = $this->_createHeader('From', array('from@domain'=>'Name'), - array(), false - ); - $this->_checking(Expectations::create() - -> one($from)->setFieldBodyModel(array('from@domain'=>'Name', 'other@domain'=>'Other')) - -> ignoring($from) - ); - $message = $this->_createMessage( - $this->_createHeaderSet(array('From' => $from)), - $this->_createEncoder(), $this->_createCache() - ); - $message->addFrom('other@domain', 'Other'); - } - - public function testFromHeaderIsAddedIfNoneSet() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addMailboxHeader('From', (array) 'from@domain') - -> ignoring($headers) - ); - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setFrom('from@domain'); - } - - public function testPersonalNameCanBeUsedInFromAddress() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addMailboxHeader('From', array('from@domain'=>'Name')) - -> ignoring($headers) - ); - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setFrom('from@domain', 'Name'); - } - - public function testReplyToIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.2. - */ - - $reply = $this->_createHeader('Reply-To', array('reply@domain'=>'Name')); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Reply-To' => $reply)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual(array('reply@domain'=>'Name'), $message->getReplyTo()); - } - - public function testReplyToIsSetInHeader() - { - $reply = $this->_createHeader('Reply-To', array('reply@domain'=>'Name'), - array(), false - ); - $this->_checking(Expectations::create() - -> one($reply)->setFieldBodyModel(array('other@domain'=>'Other')) - -> ignoring($reply) - ); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Reply-To' => $reply)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setReplyTo(array('other@domain'=>'Other')); - } - - public function testReplyToIsAddedToHeadersDuringAddReplyTo() - { - $replyTo = $this->_createHeader('Reply-To', array('from@domain'=>'Name'), - array(), false - ); - $this->_checking(Expectations::create() - -> one($replyTo)->setFieldBodyModel(array('from@domain'=>'Name', 'other@domain'=>'Other')) - -> ignoring($replyTo) - ); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Reply-To' => $replyTo)), - $this->_createEncoder(), $this->_createCache() - ); - $message->addReplyTo('other@domain', 'Other'); - } - - public function testReplyToHeaderIsAddedIfNoneSet() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addMailboxHeader('Reply-To', (array) 'reply@domain') - -> ignoring($headers) - ); - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setReplyTo('reply@domain'); - } - - public function testNameCanBeUsedInReplyTo() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addMailboxHeader('Reply-To', array('reply@domain'=>'Name')) - -> ignoring($headers) - ); - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setReplyTo('reply@domain', 'Name'); - } - - public function testToIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.3. - */ - - $to = $this->_createHeader('To', array('to@domain'=>'Name')); - $message = $this->_createMessage( - $this->_createHeaderSet(array('To' => $to)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual(array('to@domain'=>'Name'), $message->getTo()); - } - - public function testToIsSetInHeader() - { - $to = $this->_createHeader('To', array('to@domain'=>'Name'), - array(), false - ); - $this->_checking(Expectations::create() - -> one($to)->setFieldBodyModel(array('other@domain'=>'Other')) - -> ignoring($to) - ); - $message = $this->_createMessage( - $this->_createHeaderSet(array('To' => $to)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setTo(array('other@domain'=>'Other')); - } - - public function testToIsAddedToHeadersDuringAddTo() - { - $to = $this->_createHeader('To', array('from@domain'=>'Name'), - array(), false - ); - $this->_checking(Expectations::create() - -> one($to)->setFieldBodyModel(array('from@domain'=>'Name', 'other@domain'=>'Other')) - -> ignoring($to) - ); - $message = $this->_createMessage( - $this->_createHeaderSet(array('To' => $to)), - $this->_createEncoder(), $this->_createCache() - ); - $message->addTo('other@domain', 'Other'); - } - - public function testToHeaderIsAddedIfNoneSet() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addMailboxHeader('To', (array) 'to@domain') - -> ignoring($headers) - ); - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setTo('to@domain'); - } - - public function testNameCanBeUsedInToHeader() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addMailboxHeader('To', array('to@domain'=>'Name')) - -> ignoring($headers) - ); - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setTo('to@domain', 'Name'); - } - - - public function testCcIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.3. - */ - - $cc = $this->_createHeader('Cc', array('cc@domain'=>'Name')); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Cc' => $cc)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual(array('cc@domain'=>'Name'), $message->getCc()); - } - - public function testCcIsSetInHeader() - { - $cc = $this->_createHeader('Cc', array('cc@domain'=>'Name'), - array(), false - ); - $this->_checking(Expectations::create() - -> one($cc)->setFieldBodyModel(array('other@domain'=>'Other')) - -> ignoring($cc) - ); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Cc' => $cc)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setCc(array('other@domain'=>'Other')); - } - - public function testCcIsAddedToHeadersDuringAddCc() - { - $cc = $this->_createHeader('Cc', array('from@domain'=>'Name'), - array(), false - ); - $this->_checking(Expectations::create() - -> one($cc)->setFieldBodyModel(array('from@domain'=>'Name', 'other@domain'=>'Other')) - -> ignoring($cc) - ); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Cc' => $cc)), - $this->_createEncoder(), $this->_createCache() - ); - $message->addCc('other@domain', 'Other'); - } - - public function testCcHeaderIsAddedIfNoneSet() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addMailboxHeader('Cc', (array) 'cc@domain') - -> ignoring($headers) - ); - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setCc('cc@domain'); - } - - public function testNameCanBeUsedInCcHeader() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addMailboxHeader('Cc', array('cc@domain'=>'Name')) - -> ignoring($headers) - ); - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setCc('cc@domain', 'Name'); - } - - - public function testBccIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.3. - */ - - $bcc = $this->_createHeader('Bcc', array('bcc@domain'=>'Name')); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Bcc' => $bcc)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual(array('bcc@domain'=>'Name'), $message->getBcc()); - } - - public function testBccIsSetInHeader() - { - $bcc = $this->_createHeader('Bcc', array('bcc@domain'=>'Name'), - array(), false - ); - $this->_checking(Expectations::create() - -> one($bcc)->setFieldBodyModel(array('other@domain'=>'Other')) - -> ignoring($bcc) - ); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Bcc' => $bcc)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setBcc(array('other@domain'=>'Other')); - } - - public function testBccIsAddedToHeadersDuringAddBcc() - { - $bcc = $this->_createHeader('Bcc', array('from@domain'=>'Name'), - array(), false - ); - $this->_checking(Expectations::create() - -> one($bcc)->setFieldBodyModel(array('from@domain'=>'Name', 'other@domain'=>'Other')) - -> ignoring($bcc) - ); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Bcc' => $bcc)), - $this->_createEncoder(), $this->_createCache() - ); - $message->addBcc('other@domain', 'Other'); - } - - public function testBccHeaderIsAddedIfNoneSet() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addMailboxHeader('Bcc', (array) 'bcc@domain') - -> ignoring($headers) - ); - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setBcc('bcc@domain'); - } - - public function testNameCanBeUsedInBcc() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addMailboxHeader('Bcc', array('bcc@domain'=>'Name')) - -> ignoring($headers) - ); - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setBcc('bcc@domain', 'Name'); - } - - public function testPriorityIsReadFromHeader() - { - $prio = $this->_createHeader('X-Priority', '2 (High)'); - $message = $this->_createMessage( - $this->_createHeaderSet(array('X-Priority' => $prio)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual(2, $message->getPriority()); - } - - public function testPriorityIsSetInHeader() - { - $prio = $this->_createHeader('X-Priority', '2 (High)', array(), false); - $this->_checking(Expectations::create() - -> one($prio)->setFieldBodyModel('5 (Lowest)') - -> ignoring($prio) - ); - $message = $this->_createMessage( - $this->_createHeaderSet(array('X-Priority' => $prio)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setPriority(5); - } - - public function testPriorityHeaderIsAddedIfNoneSet() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addTextHeader('X-Priority', '4 (Low)') - -> ignoring($headers) - ); - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setPriority(4); - } - - public function testReadReceiptAddressReadFromHeader() - { - $rcpt = $this->_createHeader('Disposition-Notification-To', - array('chris@swiftmailer.org'=>'Chris') - ); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Disposition-Notification-To' => $rcpt)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEqual(array('chris@swiftmailer.org'=>'Chris'), - $message->getReadReceiptTo() - ); - } - - public function testReadReceiptIsSetInHeader() - { - $rcpt = $this->_createHeader('Disposition-Notification-To', array(), array(), false); - $this->_checking(Expectations::create() - -> one($rcpt)->setFieldBodyModel('mark@swiftmailer.org') - -> ignoring($rcpt) - ); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Disposition-Notification-To' => $rcpt)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setReadReceiptTo('mark@swiftmailer.org'); - } - - public function testReadReceiptHeaderIsAddedIfNoneSet() - { - $headers = $this->_createHeaderSet(array(), false); - $this->_checking(Expectations::create() - -> one($headers)->addMailboxHeader( - 'Disposition-Notification-To', 'mark@swiftmailer.org' - ) - -> ignoring($headers) - ); - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setReadReceiptTo('mark@swiftmailer.org'); - } - - public function testChildrenCanBeAttached() - { - $child1 = $this->_createChild(); - $child2 = $this->_createChild(); - - $message = $this->_createMessage($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - - $message->attach($child1); - $message->attach($child2); - - $this->assertEqual(array($child1, $child2), $message->getChildren()); - } - - public function testChildrenCanBeDetached() - { - $child1 = $this->_createChild(); - $child2 = $this->_createChild(); - - $message = $this->_createMessage($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - - $message->attach($child1); - $message->attach($child2); - - $message->detach($child1); - - $this->assertEqual(array($child2), $message->getChildren()); - } - - public function testEmbedAttachesChild() - { - $child = $this->_createChild(); - - $message = $this->_createMessage($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - - $message->embed($child); - - $this->assertEqual(array($child), $message->getChildren()); - } - - public function testEmbedReturnsValidCid() - { - $child = $this->_createChild(Swift_Mime_MimeEntity::LEVEL_RELATED, '', - false - ); - $this->_checking(Expectations::create() - -> ignoring($child)->getId() -> returns('foo@bar') - -> ignoring($child) - ); - $message = $this->_createMessage($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - - $this->assertEqual('cid:foo@bar', $message->embed($child)); - } - - public function testFluidInterface() - { - $child = $this->_createChild(); - $message = $this->_createMessage($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertSame($message, - $message - ->setContentType('text/plain') - ->setEncoder($this->_createEncoder()) - ->setId('foo@bar') - ->setDescription('my description') - ->setMaxLineLength(998) - ->setBody('xx') - ->setBoundary('xyz') - ->setChildren(array()) - ->setCharset('iso-8859-1') - ->setFormat('flowed') - ->setDelSp(false) - ->setSubject('subj') - ->setDate(123) - ->setReturnPath('foo@bar') - ->setSender('foo@bar') - ->setFrom(array('x@y' => 'XY')) - ->setReplyTo(array('ab@cd' => 'ABCD')) - ->setTo(array('chris@site.tld', 'mark@site.tld')) - ->setCc('john@somewhere.tld') - ->setBcc(array('one@site', 'two@site' => 'Two')) - ->setPriority(4) - ->setReadReceiptTo('a@b') - ->attach($child) - ->detach($child) - ); - } - - // -- Private helpers - - //abstract - protected function _createEntity($headers, $encoder, $cache) - { - return $this->_createMessage($headers, $encoder, $cache); - } - - protected function _createMimePart($headers, $encoder, $cache) - { - return $this->_createMessage($headers, $encoder, $cache); - } - - private function _createMessage($headers, $encoder, $cache) - { - return new Swift_Mime_SimpleMessage($headers, $encoder, $cache, new Swift_Mime_Grammar()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMimeEntityTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMimeEntityTest.php deleted file mode 100644 index 02277e3..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMimeEntityTest.php +++ /dev/null @@ -1,15 +0,0 @@ -assertEqual(10, $plugin->getThreshold()); - $plugin->setThreshold(100); - $this->assertEqual(100, $plugin->getThreshold()); - } - - public function testSleepTimeCanBeSetAndFetched() - { - $plugin = new Swift_Plugins_AntiFloodPlugin(10, 5); - $this->assertEqual(5, $plugin->getSleepTime()); - $plugin->setSleepTime(1); - $this->assertEqual(1, $plugin->getSleepTime()); - } - - public function testPluginStopsConnectionAfterThreshold() - { - $transport = $this->_createTransport(); - $evt = $this->_createSendEvent($transport); - $this->_checking(Expectations::create() - -> one($transport)->start() - -> one($transport)->stop() - -> ignoring($transport) - ); - - $plugin = new Swift_Plugins_AntiFloodPlugin(10); - for ($i = 0; $i < 12; $i++) { - $plugin->sendPerformed($evt); - } - } - - public function testPluginCanStopAndStartMultipleTimes() - { - $transport = $this->_createTransport(); - $evt = $this->_createSendEvent($transport); - $this->_checking(Expectations::create() - -> exactly(5)->of($transport)->start() - -> exactly(5)->of($transport)->stop() - -> ignoring($transport) - ); - - $plugin = new Swift_Plugins_AntiFloodPlugin(2); - for ($i = 0; $i < 11; $i++) { - $plugin->sendPerformed($evt); - } - } - - public function testPluginCanSleepDuringRestart() - { - $sleeper = $this->_createSleeper(); - $transport = $this->_createTransport(); - $evt = $this->_createSendEvent($transport); - $this->_checking(Expectations::create() - -> one($sleeper)->sleep(10) - -> one($transport)->start() - -> one($transport)->stop() - -> ignoring($transport) - ); - - $plugin = new Swift_Plugins_AntiFloodPlugin(99, 10, $sleeper); - for ($i = 0; $i < 101; $i++) { - $plugin->sendPerformed($evt); - } - } - - // -- Creation Methods - - private function _createTransport() - { - return $this->_mock('Swift_Transport'); - } - - private function _createSendEvent($transport) - { - $evt = $this->_mock('Swift_Events_SendEvent'); - $this->_checking(Expectations::create() - -> ignoring($evt)->getSource() -> returns($transport) - -> ignoring($evt)->getTransport() -> returns($transport) - ); - return $evt; - } - - private function _createSleeper() - { - return $this->_mock('Swift_Plugins_Sleeper'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/BandwidthMonitorPluginTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/BandwidthMonitorPluginTest.php deleted file mode 100644 index af97fe6..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/BandwidthMonitorPluginTest.php +++ /dev/null @@ -1,125 +0,0 @@ -_monitor = new Swift_Plugins_BandwidthMonitorPlugin(); - } - - public function testBytesOutIncreasesAccordingToMessageLength() - { - $message = $this->_createMessageWithByteCount(6); - $evt = $this->_createSendEvent($message); - - $this->assertEqual(0, $this->_monitor->getBytesOut()); - $this->_monitor->sendPerformed($evt); - $this->assertEqual(6, $this->_monitor->getBytesOut()); - $this->_monitor->sendPerformed($evt); - $this->assertEqual(12, $this->_monitor->getBytesOut()); - } - - public function testBytesOutIncreasesWhenCommandsSent() - { - $evt = $this->_createCommandEvent("RCPT TO: \r\n"); - - $this->assertEqual(0, $this->_monitor->getBytesOut()); - $this->_monitor->commandSent($evt); - $this->assertEqual(24, $this->_monitor->getBytesOut()); - $this->_monitor->commandSent($evt); - $this->assertEqual(48, $this->_monitor->getBytesOut()); - } - - public function testBytesInIncreasesWhenResponsesReceived() - { - $evt = $this->_createResponseEvent("250 Ok\r\n"); - - $this->assertEqual(0, $this->_monitor->getBytesIn()); - $this->_monitor->responseReceived($evt); - $this->assertEqual(8, $this->_monitor->getBytesIn()); - $this->_monitor->responseReceived($evt); - $this->assertEqual(16, $this->_monitor->getBytesIn()); - } - - public function testCountersCanBeReset() - { - $evt = $this->_createResponseEvent("250 Ok\r\n"); - - $this->assertEqual(0, $this->_monitor->getBytesIn()); - $this->_monitor->responseReceived($evt); - $this->assertEqual(8, $this->_monitor->getBytesIn()); - $this->_monitor->responseReceived($evt); - $this->assertEqual(16, $this->_monitor->getBytesIn()); - - $evt = $this->_createCommandEvent("RCPT TO: \r\n"); - - $this->assertEqual(0, $this->_monitor->getBytesOut()); - $this->_monitor->commandSent($evt); - $this->assertEqual(24, $this->_monitor->getBytesOut()); - $this->_monitor->commandSent($evt); - $this->assertEqual(48, $this->_monitor->getBytesOut()); - - $this->_monitor->reset(); - - $this->assertEqual(0, $this->_monitor->getBytesOut()); - $this->assertEqual(0, $this->_monitor->getBytesIn()); - } - - // -- Creation Methods - - private function _createSendEvent($message) - { - $evt = $this->_mock('Swift_Events_SendEvent'); - $this->_checking(Expectations::create() - -> ignoring($evt)->getMessage() -> returns($message) - ); - return $evt; - } - - private function _createCommandEvent($command) - { - $evt = $this->_mock('Swift_Events_CommandEvent'); - $this->_checking(Expectations::create() - -> ignoring($evt)->getCommand() -> returns($command) - ); - return $evt; - } - - private function _createResponseEvent($response) - { - $evt = $this->_mock('Swift_Events_ResponseEvent'); - $this->_checking(Expectations::create() - -> ignoring($evt)->getResponse() -> returns($response) - ); - return $evt; - } - - private function _createMessageWithByteCount($bytes) - { - $this->_bytes = $bytes; - $msg = $this->_mock('Swift_Mime_Message'); - $this->_checking(Expectations::create() - -> ignoring($msg)->toByteStream(any()) -> calls(array($this, '_write')) - ); - return $msg; - } - - private $_bytes = 0; - public function _write($invocation) - { - $args = $invocation->getArguments(); - $is = $args[0]; - for ($i = 0; $i < $this->_bytes; ++$i) { - $is->write('x'); - } - } - -} \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/DecoratorPluginTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/DecoratorPluginTest.php deleted file mode 100644 index 2bd051b..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/DecoratorPluginTest.php +++ /dev/null @@ -1,231 +0,0 @@ -_createMessage( - $this->_createHeaders(), - array('zip@button.tld' => 'Zipathon'), - array('chris.corbyn@swiftmailer.org' => 'Chris'), - 'Subject', - 'Hello {name}, you are customer #{id}' - ); - $this->_checking(Expectations::create() - -> one($message)->setBody('Hello Zip, you are customer #456') - -> ignoring($message) - ); - - $plugin = $this->_createPlugin( - array('zip@button.tld' => array('{name}' => 'Zip', '{id}' => '456')) - ); - - $evt = $this->_createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - - public function testReplacementsCanBeAppliedToSameMessageMultipleTimes() - { - $message = $this->_createMessage( - $this->_createHeaders(), - array('zip@button.tld' => 'Zipathon', 'foo@bar.tld' => 'Foo'), - array('chris.corbyn@swiftmailer.org' => 'Chris'), - 'Subject', - 'Hello {name}, you are customer #{id}' - ); - $this->_checking(Expectations::create() - -> one($message)->setBody('Hello Zip, you are customer #456') - -> one($message)->setBody('Hello {name}, you are customer #{id}') - -> one($message)->setBody('Hello Foo, you are customer #123') - -> ignoring($message) - ); - - $plugin = $this->_createPlugin( - array( - 'foo@bar.tld' => array('{name}' => 'Foo', '{id}' => '123'), - 'zip@button.tld' => array('{name}' => 'Zip', '{id}' => '456') - ) - ); - - $evt = $this->_createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - - public function testReplacementsCanBeMadeInHeaders() - { - $headers = $this->_createHeaders(array( - $returnPathHeader = $this->_createHeader('Return-Path', 'foo-{id}@swiftmailer.org'), - $toHeader = $this->_createHeader('Subject', 'A message for {name}!') - )); - - $message = $this->_createMessage( - $headers, - array('zip@button.tld' => 'Zipathon'), - array('chris.corbyn@swiftmailer.org' => 'Chris'), - 'A message for {name}!', - 'Hello {name}, you are customer #{id}' - ); - $this->_checking(Expectations::create() - -> one($message)->setBody('Hello Zip, you are customer #456') - -> one($toHeader)->setFieldBodyModel('A message for Zip!') - -> one($returnPathHeader)->setFieldBodyModel('foo-456@swiftmailer.org') - -> ignoring($message) - -> ignoring($toHeader) - -> ignoring($returnPathHeader) - ); - - $plugin = $this->_createPlugin( - array('zip@button.tld' => array('{name}' => 'Zip', '{id}' => '456')) - ); - - $evt = $this->_createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - - public function testReplacementsAreMadeOnSubparts() - { - $part1 = $this->_createPart('text/plain', 'Your name is {name}?', '1@x'); - $part2 = $this->_createPart('text/html', 'Your name is {name}?', '2@x'); - $message = $this->_createMessage( - $this->_createHeaders(), - array('zip@button.tld' => 'Zipathon'), - array('chris.corbyn@swiftmailer.org' => 'Chris'), - 'A message for {name}!', - 'Subject' - ); - $this->_checking(Expectations::create() - -> ignoring($message)->getChildren() -> returns(array($part1, $part2)) - -> one($part1)->setBody('Your name is Zip?') - -> one($part2)->setBody('Your name is Zip?') - -> ignoring($part1) - -> ignoring($part2) - -> ignoring($message) - ); - - $plugin = $this->_createPlugin( - array('zip@button.tld' => array('{name}' => 'Zip', '{id}' => '456')) - ); - - $evt = $this->_createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - - public function testReplacementsCanBeTakenFromCustomReplacementsObject() - { - $message = $this->_createMessage( - $this->_createHeaders(), - array('foo@bar' => 'Foobar', 'zip@zap' => 'Zip zap'), - array('chris.corbyn@swiftmailer.org' => 'Chris'), - 'Subject', - 'Something {a}' - ); - - $replacements = $this->_createReplacements(); - - $this->_checking(Expectations::create() - -> one($message)->setBody('Something b') - -> one($message)->setBody('Something c') - -> one($replacements)->getReplacementsFor('foo@bar') -> returns(array('{a}'=>'b')) - -> one($replacements)->getReplacementsFor('zip@zap') -> returns(array('{a}'=>'c')) - -> ignoring($message) - ); - - $plugin = $this->_createPlugin($replacements); - - $evt = $this->_createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - - // -- Creation methods - - private function _createMessage($headers, $to = array(), $from = null, $subject = null, - $body = null) - { - $message = $this->_mock('Swift_Mime_Message'); - foreach ($to as $addr => $name) { - $this->_checking(Expectations::create() - -> one($message)->getTo() -> returns(array($addr => $name)) - ); - } - $this->_checking(Expectations::create() - -> allowing($message)->getHeaders() -> returns($headers) - -> ignoring($message)->getFrom() -> returns($from) - -> ignoring($message)->getSubject() -> returns($subject) - -> ignoring($message)->getBody() -> returns($body) - ); - return $message; - } - - private function _createPlugin($replacements) - { - return new Swift_Plugins_DecoratorPlugin($replacements); - } - - private function _createReplacements() - { - return $this->_mock('Swift_Plugins_Decorator_Replacements'); - } - - private function _createSendEvent(Swift_Mime_Message $message) - { - $evt = $this->_mock('Swift_Events_SendEvent'); - $this->_checking(Expectations::create() - -> ignoring($evt)->getMessage() -> returns($message) - -> ignoring($evt) - ); - return $evt; - } - - private function _createPart($type, $body, $id) - { - $part = $this->_mock('Swift_Mime_MimeEntity'); - $this->_checking(Expectations::create() - -> ignoring($part)->getContentType() -> returns($type) - -> ignoring($part)->getBody() -> returns($body) - -> ignoring($part)->getId() -> returns($id) - ); - return $part; - } - - private function _createHeaders($headers = array()) - { - $set = $this->_mock('Swift_Mime_HeaderSet'); - - $this->_checking(Expectations::create() - -> allowing($set)->getAll() -> returns($headers) - -> ignoring($set) - ); - - foreach ($headers as $header) { - $set->set($header); - } - - return $set; - } - - private function _createHeader($name, $body = '') - { - $header = $this->_mock('Swift_Mime_Header'); - $this->_checking(Expectations::create() - -> ignoring($header)->getFieldName() -> returns($name) - -> ignoring($header)->getFieldBodyModel() -> returns($body) - ); - return $header; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/LoggerPluginTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/LoggerPluginTest.php deleted file mode 100644 index 32147c6..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/LoggerPluginTest.php +++ /dev/null @@ -1,194 +0,0 @@ -_createLogger(); - $this->_checking(Expectations::create() - -> one($logger)->add('foo') - ); - - $plugin = $this->_createPlugin($logger); - $plugin->add('foo'); - } - - public function testLoggerDelegatesDumpingEntries() - { - $logger = $this->_createLogger(); - $this->_checking(Expectations::create() - -> one($logger)->dump() -> returns('foobar') - ); - - $plugin = $this->_createPlugin($logger); - $this->assertEqual('foobar', $plugin->dump()); - } - - public function testLoggerDelegatesClearingEntries() - { - $logger = $this->_createLogger(); - $this->_checking(Expectations::create() - -> one($logger)->clear() - ); - - $plugin = $this->_createPlugin($logger); - $plugin->clear(); - } - - public function testCommandIsSentToLogger() - { - $evt = $this->_createCommandEvent("foo\r\n"); - $logger = $this->_createLogger(); - $this->_checking(Expectations::create() - -> one($logger)->add(pattern('~foo\r\n~')) - ); - - $plugin = $this->_createPlugin($logger); - $plugin->commandSent($evt); - } - - public function testResponseIsSentToLogger() - { - $evt = $this->_createResponseEvent("354 Go ahead\r\n"); - $logger = $this->_createLogger(); - $this->_checking(Expectations::create() - -> one($logger)->add(pattern('~354 Go ahead\r\n~')) - ); - - $plugin = $this->_createPlugin($logger); - $plugin->responseReceived($evt); - } - - public function testTransportBeforeStartChangeIsSentToLogger() - { - $evt = $this->_createTransportChangeEvent(); - $logger = $this->_createLogger(); - $this->_checking(Expectations::create() - -> one($logger)->add(any()) - ); - - $plugin = $this->_createPlugin($logger); - $plugin->beforeTransportStarted($evt); - } - - public function testTransportStartChangeIsSentToLogger() - { - $evt = $this->_createTransportChangeEvent(); - $logger = $this->_createLogger(); - $this->_checking(Expectations::create() - -> one($logger)->add(any()) - ); - - $plugin = $this->_createPlugin($logger); - $plugin->transportStarted($evt); - } - - public function testTransportStopChangeIsSentToLogger() - { - $evt = $this->_createTransportChangeEvent(); - $logger = $this->_createLogger(); - $this->_checking(Expectations::create() - -> one($logger)->add(any()) - ); - - $plugin = $this->_createPlugin($logger); - $plugin->transportStopped($evt); - } - - public function testTransportBeforeStopChangeIsSentToLogger() - { - $evt = $this->_createTransportChangeEvent(); - $logger = $this->_createLogger(); - $this->_checking(Expectations::create() - -> one($logger)->add(any()) - ); - - $plugin = $this->_createPlugin($logger); - $plugin->beforeTransportStopped($evt); - } - - public function testExceptionsArePassedToDelegateAndLeftToBubbleUp() - { - $transport = $this->_createTransport(); - $evt = $this->_createTransportExceptionEvent(); - $logger = $this->_createLogger(); - $this->_checking(Expectations::create() - -> one($logger)->add(any()) - -> allowing($logger) - ); - - $plugin = $this->_createPlugin($logger); - try { - $plugin->exceptionThrown($evt); - $this->fail('Exception should bubble up.'); - } catch (Swift_TransportException $ex) { - } - } - - // -- Creation Methods - - private function _createLogger() - { - return $this->_mock('Swift_Plugins_Logger'); - } - - private function _createPlugin($logger) - { - return new Swift_Plugins_LoggerPlugin($logger); - } - - private function _createCommandEvent($command) - { - $evt = $this->_mock('Swift_Events_CommandEvent'); - $this->_checking(Expectations::create() - -> ignoring($evt)->getCommand() -> returns($command) - -> ignoring($evt) - ); - return $evt; - } - - private function _createResponseEvent($response) - { - $evt = $this->_mock('Swift_Events_ResponseEvent'); - $this->_checking(Expectations::create() - -> ignoring($evt)->getResponse() -> returns($response) - -> ignoring($evt) - ); - return $evt; - } - - private function _createTransport() - { - return $this->_mock('Swift_Transport'); - } - - private function _createTransportChangeEvent() - { - $evt = $this->_mock('Swift_Events_TransportChangeEvent'); - $this->_checking(Expectations::create() - -> ignoring($evt)->getSource() -> returns($this->_createTransport()) - -> ignoring($evt) - ); - return $evt; - } - - private function _createTransportExceptionEvent() - { - $evt = $this->_mock('Swift_Events_TransportExceptionEvent'); - $this->_checking(Expectations::create() - -> ignoring($evt)->getException() -> returns(new Swift_TransportException('')) - -> ignoring($evt) - ); - return $evt; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/ArrayLoggerTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/ArrayLoggerTest.php deleted file mode 100644 index 464154e..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/ArrayLoggerTest.php +++ /dev/null @@ -1,70 +0,0 @@ -add(">> Foo\r\n"); - $this->assertEqual(">> Foo\r\n", $logger->dump()); - } - - public function testAddingMultipleEntriesDumpsMultipleLines() - { - $logger = new Swift_Plugins_Loggers_ArrayLogger(); - $logger->add(">> FOO\r\n"); - $logger->add("<< 502 That makes no sense\r\n"); - $logger->add(">> RSET\r\n"); - $logger->add("<< 250 OK\r\n"); - - $this->assertEqual( - ">> FOO\r\n" . PHP_EOL . - "<< 502 That makes no sense\r\n" . PHP_EOL . - ">> RSET\r\n" . PHP_EOL . - "<< 250 OK\r\n", - $logger->dump() - ); - } - - public function testLogCanBeCleared() - { - $logger = new Swift_Plugins_Loggers_ArrayLogger(); - $logger->add(">> FOO\r\n"); - $logger->add("<< 502 That makes no sense\r\n"); - $logger->add(">> RSET\r\n"); - $logger->add("<< 250 OK\r\n"); - - $this->assertEqual( - ">> FOO\r\n" . PHP_EOL . - "<< 502 That makes no sense\r\n" . PHP_EOL . - ">> RSET\r\n" . PHP_EOL . - "<< 250 OK\r\n", - $logger->dump() - ); - - $logger->clear(); - - $this->assertEqual('', $logger->dump()); - } - - public function testLengthCanBeTruncated() - { - $logger = new Swift_Plugins_Loggers_ArrayLogger(2); - $logger->add(">> FOO\r\n"); - $logger->add("<< 502 That makes no sense\r\n"); - $logger->add(">> RSET\r\n"); - $logger->add("<< 250 OK\r\n"); - - $this->assertEqual( - ">> RSET\r\n" . PHP_EOL . - "<< 250 OK\r\n", - $logger->dump(), - '%s: Log should be truncated to last 2 entries' - ); - } - -} \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/EchoLoggerTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/EchoLoggerTest.php deleted file mode 100644 index 5615354..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/EchoLoggerTest.php +++ /dev/null @@ -1,29 +0,0 @@ -add(">> Foo"); - $data = ob_get_clean(); - - $this->assertEqual(">> Foo" . PHP_EOL, $data); - } - - public function testAddingEntryDumpsEscapedLineWithHtml() - { - $logger = new Swift_Plugins_Loggers_EchoLogger(true); - ob_start(); - $logger->add(">> Foo"); - $data = ob_get_clean(); - - $this->assertEqual(">> Foo
    " . PHP_EOL, $data); - } - -} \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/PopBeforeSmtpPluginTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/PopBeforeSmtpPluginTest.php deleted file mode 100644 index ff92315..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/PopBeforeSmtpPluginTest.php +++ /dev/null @@ -1,113 +0,0 @@ -_createConnection(); - - $plugin = $this->_createPlugin('pop.host.tld', 110); - $plugin->setConnection($connection); - - $transport = $this->_createTransport(); - $evt = $this->_createTransportChangeEvent($transport); - - $this->_checking(Expectations::create() - -> one($connection)->connect() - -> ignoring($connection) - ); - - $plugin->beforeTransportStarted($evt); - } - - public function testPluginDisconnectsFromPop3HostBeforeTransportStarts() - { - $connection = $this->_createConnection(); - - $plugin = $this->_createPlugin('pop.host.tld', 110); - $plugin->setConnection($connection); - - $transport = $this->_createTransport(); - $evt = $this->_createTransportChangeEvent($transport); - - $this->_checking(Expectations::create() - -> one($connection)->disconnect() - -> ignoring($connection) - ); - - $plugin->beforeTransportStarted($evt); - } - - public function testPluginDoesNotConnectToSmtpIfBoundToDifferentTransport() - { - $connection = $this->_createConnection(); - - $smtp = $this->_createTransport(); - - $plugin = $this->_createPlugin('pop.host.tld', 110); - $plugin->setConnection($connection); - $plugin->bindSmtp($smtp); - - $transport = $this->_createTransport(); - $evt = $this->_createTransportChangeEvent($transport); - - $this->_checking(Expectations::create() - -> never($connection) - ); - - $plugin->beforeTransportStarted($evt); - } - - public function testPluginCanBindToSpecificTransport() - { - $connection = $this->_createConnection(); - - $smtp = $this->_createTransport(); - - $plugin = $this->_createPlugin('pop.host.tld', 110); - $plugin->setConnection($connection); - $plugin->bindSmtp($smtp); - - $evt = $this->_createTransportChangeEvent($smtp); - - $this->_checking(Expectations::create() - -> one($connection)->connect() - -> ignoring($connection) - ); - - $plugin->beforeTransportStarted($evt); - } - - // -- Creation Methods - - private function _createTransport() - { - return $this->_mock('Swift_Transport'); - } - - private function _createTransportChangeEvent($transport) - { - $evt = $this->_mock('Swift_Events_TransportChangeEvent'); - $this->_checking(Expectations::create() - -> ignoring($evt)->getSource() -> returns($transport) - -> ignoring($evt)->getTransport() -> returns($transport) - ); - return $evt; - } - - public function _createConnection() - { - return $this->_mock('Swift_Plugins_Pop_Pop3Connection'); - } - - public function _createPlugin($host, $port, $crypto = null) - { - return new Swift_Plugins_PopBeforeSmtpPlugin($host, $port, $crypto); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/RedirectingPluginTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/RedirectingPluginTest.php deleted file mode 100644 index 432428e..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/RedirectingPluginTest.php +++ /dev/null @@ -1,66 +0,0 @@ -assertEqual('fabien@example.com', $plugin->getRecipient()); - $plugin->setRecipient('chris@example.com'); - $this->assertEqual('chris@example.com', $plugin->getRecipient()); - } - - public function testPluginChangesRecipients() - { - $message = Swift_Message::newInstance() - ->setSubject('...') - ->setFrom(array('john@example.com' => 'John Doe')) - ->setTo($to = array( - 'fabien-to@example.com' => 'Fabien (To)', - 'chris-to@example.com' => 'Chris (To)', - )) - ->setCc($cc = array( - 'fabien-cc@example.com' => 'Fabien (Cc)', - 'chris-cc@example.com' => 'Chris (Cc)', - )) - ->setBcc($bcc = array( - 'fabien-bcc@example.com' => 'Fabien (Bcc)', - 'chris-bcc@example.com' => 'Chris (Bcc)', - )) - ->setBody('...') - ; - - $plugin = new Swift_Plugins_RedirectingPlugin('god@example.com'); - - $evt = $this->_createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - - $this->assertEqual($message->getTo(), array('god@example.com' => '')); - $this->assertEqual($message->getCc(), array()); - $this->assertEqual($message->getBcc(), array()); - - $plugin->sendPerformed($evt); - - $this->assertEqual($message->getTo(), $to); - $this->assertEqual($message->getCc(), $cc); - $this->assertEqual($message->getBcc(), $bcc); - } - - // -- Creation Methods - - private function _createSendEvent(Swift_Mime_Message $message) - { - $evt = $this->_mock('Swift_Events_SendEvent'); - $this->_checking(Expectations::create() - -> ignoring($evt)->getMessage() -> returns($message) - -> ignoring($evt) - ); - return $evt; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ReporterPluginTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ReporterPluginTest.php deleted file mode 100644 index 72279d7..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ReporterPluginTest.php +++ /dev/null @@ -1,120 +0,0 @@ -_createMessage(); - $evt = $this->_createSendEvent(); - $reporter = $this->_createReporter(); - - $this->_checking(Expectations::create() - -> allowing($message)->getTo() -> returns(array('foo@bar.tld' => 'Foo')) - -> allowing($evt)->getMessage() -> returns($message) - -> allowing($evt)->getFailedRecipients() -> returns(array()) - -> one($reporter)->notify($message, 'foo@bar.tld', Swift_Plugins_Reporter::RESULT_PASS) - -> ignoring($message) - -> ignoring($evt) - ); - - $plugin = new Swift_Plugins_ReporterPlugin($reporter); - $plugin->sendPerformed($evt); - } - - public function testReportingFailedTo() - { - $message = $this->_createMessage(); - $evt = $this->_createSendEvent(); - $reporter = $this->_createReporter(); - - $this->_checking(Expectations::create() - -> allowing($message)->getTo() -> returns(array( - 'foo@bar.tld' => 'Foo', 'zip@button' => 'Zip' - )) - -> allowing($evt)->getMessage() -> returns($message) - -> allowing($evt)->getFailedRecipients() -> returns(array('zip@button')) - -> one($reporter)->notify($message, 'foo@bar.tld', Swift_Plugins_Reporter::RESULT_PASS) - -> one($reporter)->notify($message, 'zip@button', Swift_Plugins_Reporter::RESULT_FAIL) - -> ignoring($message) - -> ignoring($evt) - ); - - $plugin = new Swift_Plugins_ReporterPlugin($reporter); - $plugin->sendPerformed($evt); - } - - public function testReportingFailedCc() - { - $message = $this->_createMessage(); - $evt = $this->_createSendEvent(); - $reporter = $this->_createReporter(); - - $this->_checking(Expectations::create() - -> allowing($message)->getTo() -> returns(array( - 'foo@bar.tld' => 'Foo' - )) - -> allowing($message)->getCc() -> returns(array( - 'zip@button' => 'Zip', 'test@test.com' => 'Test' - )) - -> allowing($evt)->getMessage() -> returns($message) - -> allowing($evt)->getFailedRecipients() -> returns(array('zip@button')) - -> one($reporter)->notify($message, 'foo@bar.tld', Swift_Plugins_Reporter::RESULT_PASS) - -> one($reporter)->notify($message, 'zip@button', Swift_Plugins_Reporter::RESULT_FAIL) - -> one($reporter)->notify($message, 'test@test.com', Swift_Plugins_Reporter::RESULT_PASS) - -> ignoring($message) - -> ignoring($evt) - ); - - $plugin = new Swift_Plugins_ReporterPlugin($reporter); - $plugin->sendPerformed($evt); - } - - public function testReportingFailedBcc() - { - $message = $this->_createMessage(); - $evt = $this->_createSendEvent(); - $reporter = $this->_createReporter(); - - $this->_checking(Expectations::create() - -> allowing($message)->getTo() -> returns(array( - 'foo@bar.tld' => 'Foo' - )) - -> allowing($message)->getBcc() -> returns(array( - 'zip@button' => 'Zip', 'test@test.com' => 'Test' - )) - -> allowing($evt)->getMessage() -> returns($message) - -> allowing($evt)->getFailedRecipients() -> returns(array('zip@button')) - -> one($reporter)->notify($message, 'foo@bar.tld', Swift_Plugins_Reporter::RESULT_PASS) - -> one($reporter)->notify($message, 'zip@button', Swift_Plugins_Reporter::RESULT_FAIL) - -> one($reporter)->notify($message, 'test@test.com', Swift_Plugins_Reporter::RESULT_PASS) - -> ignoring($message) - -> ignoring($evt) - ); - - $plugin = new Swift_Plugins_ReporterPlugin($reporter); - $plugin->sendPerformed($evt); - } - - // -- Creation Methods - - private function _createMessage() - { - return $this->_mock('Swift_Mime_Message'); - } - - private function _createSendEvent() - { - return $this->_mock('Swift_Events_SendEvent'); - } - - private function _createReporter() - { - return $this->_mock('Swift_Plugins_Reporter'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HitReporterTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HitReporterTest.php deleted file mode 100644 index 3d4e310..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HitReporterTest.php +++ /dev/null @@ -1,69 +0,0 @@ -_hitReporter = new Swift_Plugins_Reporters_HitReporter(); - $this->_message = $this->_mock('Swift_Mime_Message'); - } - - public function testReportingFail() - { - $this->_hitReporter->notify($this->_message, 'foo@bar.tld', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $this->assertEqual(array('foo@bar.tld'), - $this->_hitReporter->getFailedRecipients() - ); - } - - public function testMultipleReports() - { - $this->_hitReporter->notify($this->_message, 'foo@bar.tld', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $this->_hitReporter->notify($this->_message, 'zip@button', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $this->assertEqual(array('foo@bar.tld', 'zip@button'), - $this->_hitReporter->getFailedRecipients() - ); - } - - public function testReportingPassIsIgnored() - { - $this->_hitReporter->notify($this->_message, 'foo@bar.tld', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $this->_hitReporter->notify($this->_message, 'zip@button', - Swift_Plugins_Reporter::RESULT_PASS - ); - $this->assertEqual(array('foo@bar.tld'), - $this->_hitReporter->getFailedRecipients() - ); - } - - public function testBufferCanBeCleared() - { - $this->_hitReporter->notify($this->_message, 'foo@bar.tld', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $this->_hitReporter->notify($this->_message, 'zip@button', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $this->assertEqual(array('foo@bar.tld', 'zip@button'), - $this->_hitReporter->getFailedRecipients() - ); - $this->_hitReporter->clear(); - $this->assertEqual(array(), $this->_hitReporter->getFailedRecipients()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HtmlReporterTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HtmlReporterTest.php deleted file mode 100644 index 76ab3e3..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HtmlReporterTest.php +++ /dev/null @@ -1,59 +0,0 @@ -_html = new Swift_Plugins_Reporters_HtmlReporter(); - $this->_message = $this->_mock('Swift_Mime_Message'); - } - - public function testReportingPass() - { - ob_start(); - $this->_html->notify($this->_message, 'foo@bar.tld', - Swift_Plugins_Reporter::RESULT_PASS - ); - $html = ob_get_clean(); - - $this->assertPattern('~ok|pass~i', $html, '%s: Reporter should indicate pass'); - $this->assertPattern('~foo@bar\.tld~', $html, '%s: Reporter should show address'); - } - - public function testReportingFail() - { - ob_start(); - $this->_html->notify($this->_message, 'zip@button', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $html = ob_get_clean(); - - $this->assertPattern('~fail~i', $html, '%s: Reporter should indicate fail'); - $this->assertPattern('~zip@button~', $html, '%s: Reporter should show address'); - } - - public function testMultipleReports() - { - ob_start(); - $this->_html->notify($this->_message, 'foo@bar.tld', - Swift_Plugins_Reporter::RESULT_PASS - ); - $this->_html->notify($this->_message, 'zip@button', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $html = ob_get_clean(); - - $this->assertPattern('~ok|pass~i', $html, '%s: Reporter should indicate pass'); - $this->assertPattern('~foo@bar\.tld~', $html, '%s: Reporter should show address'); - $this->assertPattern('~fail~i', $html, '%s: Reporter should indicate fail'); - $this->assertPattern('~zip@button~', $html, '%s: Reporter should show address'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ThrottlerPluginTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ThrottlerPluginTest.php deleted file mode 100644 index 86e24d6..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ThrottlerPluginTest.php +++ /dev/null @@ -1,124 +0,0 @@ -_createSleeper(); - $timer = $this->_createTimer(); - - //10MB/min - $plugin = new Swift_Plugins_ThrottlerPlugin( - 10000000, Swift_Plugins_ThrottlerPlugin::BYTES_PER_MINUTE, - $sleeper, $timer - ); - - $this->_checking(Expectations::create() - -> one($timer)->getTimestamp() -> returns(0) - -> one($timer)->getTimestamp() -> returns(1) //expected 0.6 - -> one($timer)->getTimestamp() -> returns(1) //expected 1.2 (sleep 1) - -> one($timer)->getTimestamp() -> returns(2) //expected 1.8 - -> one($timer)->getTimestamp() -> returns(2) //expected 2.4 (sleep 1) - -> ignoring($timer) - - -> exactly(2)->of($sleeper)->sleep(1) - ); - - //10,000,000 bytes per minute - //100,000 bytes per email - - // .: (10,000,000/100,000)/60 emails per second = 1.667 emais/sec - - $message = $this->_createMessageWithByteCount(100000); //100KB - - $evt = $this->_createSendEvent($message); - - for ($i = 0; $i < 5; ++$i) { - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - } - - public function testMessagesPerMinuteThrottling() - { - $sleeper = $this->_createSleeper(); - $timer = $this->_createTimer(); - - //60/min - $plugin = new Swift_Plugins_ThrottlerPlugin( - 60, Swift_Plugins_ThrottlerPlugin::MESSAGES_PER_MINUTE, - $sleeper, $timer - ); - - $this->_checking(Expectations::create() - -> one($timer)->getTimestamp() -> returns(0) - -> one($timer)->getTimestamp() -> returns(0) //expected 1 (sleep 1) - -> one($timer)->getTimestamp() -> returns(2) //expected 2 - -> one($timer)->getTimestamp() -> returns(2) //expected 3 (sleep 1) - -> one($timer)->getTimestamp() -> returns(4) //expected 4 - -> ignoring($timer) - - -> exactly(2)->of($sleeper)->sleep(1) - ); - - //60 messages per minute - //1 message per second - - $message = $this->_createMessageWithByteCount(10); - - $evt = $this->_createSendEvent($message); - - for ($i = 0; $i < 5; ++$i) { - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - } - - // -- Creation Methods - - private function _createSleeper() - { - return $this->_mock('Swift_Plugins_Sleeper'); - } - - private function _createTimer() - { - return $this->_mock('Swift_Plugins_Timer'); - } - - private function _createMessageWithByteCount($bytes) - { - $this->_bytes = $bytes; - $msg = $this->_mock('Swift_Mime_Message'); - $this->_checking(Expectations::create() - -> ignoring($msg)->toByteStream(any()) -> calls(array($this, '_write')) - ); - return $msg; - } - - private function _createSendEvent($message) - { - $evt = $this->_mock('Swift_Events_SendEvent'); - $this->_checking(Expectations::create() - -> ignoring($evt)->getMessage() -> returns($message) - ); - return $evt; - } - - private $_bytes = 0; - public function _write($invocation) - { - $args = $invocation->getArguments(); - $is = $args[0]; - for ($i = 0; $i < $this->_bytes; ++$i) { - $is->write('x'); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/ByteArrayReplacementFilterTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/ByteArrayReplacementFilterTest.php deleted file mode 100644 index 5a6977f..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/ByteArrayReplacementFilterTest.php +++ /dev/null @@ -1,135 +0,0 @@ -_createFilter(array(0x61, 0x62), array(0x63, 0x64)); - $this->assertEqual( - array(0x59, 0x60, 0x63, 0x64, 0x65), - $filter->filter(array(0x59, 0x60, 0x61, 0x62, 0x65)) - ); - } - - public function testShouldBufferReturnsTrueIfPartialMatchAtEndOfBuffer() - { - $filter = $this->_createFilter(array(0x61, 0x62), array(0x63, 0x64)); - $this->assertTrue($filter->shouldBuffer(array(0x59, 0x60, 0x61)), - '%s: Filter should buffer since 0x61 0x62 is the needle and the ending ' . - '0x61 could be from 0x61 0x62' - ); - } - - public function testFilterCanMakeMultipleReplacements() - { - $filter = $this->_createFilter(array(array(0x61), array(0x62)), array(0x63)); - $this->assertEqual( - array(0x60, 0x63, 0x60, 0x63, 0x60), - $filter->filter(array(0x60, 0x61, 0x60, 0x62, 0x60)) - ); - } - - public function testMultipleReplacementsCanBeDifferent() - { - $filter = $this->_createFilter(array(array(0x61), array(0x62)), array(array(0x63), array(0x64))); - $this->assertEqual( - array(0x60, 0x63, 0x60, 0x64, 0x60), - $filter->filter(array(0x60, 0x61, 0x60, 0x62, 0x60)) - ); - } - - public function testShouldBufferReturnsFalseIfPartialMatchNotAtEndOfString() - { - $filter = $this->_createFilter(array(0x0D, 0x0A), array(0x0A)); - $this->assertFalse($filter->shouldBuffer(array(0x61, 0x62, 0x0D, 0x0A, 0x63)), - '%s: Filter should not buffer since x0Dx0A is the needle and is not at EOF' - ); - } - - public function testShouldBufferReturnsTrueIfAnyOfMultipleMatchesAtEndOfString() - { - $filter = $this->_createFilter(array(array(0x61, 0x62), array(0x63)), array(0x64)); - $this->assertTrue($filter->shouldBuffer(array(0x59, 0x60, 0x61)), - '%s: Filter should buffer since 0x61 0x62 is a needle and the ending ' . - '0x61 could be from 0x61 0x62' - ); - } - - public function testConvertingAllLineEndingsToCRLFWhenInputIsLF() - { - $filter = $this->_createFilter( - array(array(0x0D, 0x0A), array(0x0D), array(0x0A)), - array(array(0x0A), array(0x0A), array(0x0D, 0x0A)) - ); - - $this->assertEqual( - array(0x60, 0x0D, 0x0A, 0x61, 0x0D, 0x0A, 0x62, 0x0D, 0x0A, 0x63), - $filter->filter(array(0x60, 0x0A, 0x61, 0x0A, 0x62, 0x0A, 0x63)) - ); - } - - public function testConvertingAllLineEndingsToCRLFWhenInputIsCR() - { - $filter = $this->_createFilter( - array(array(0x0D, 0x0A), array(0x0D), array(0x0A)), - array(array(0x0A), array(0x0A), array(0x0D, 0x0A)) - ); - - $this->assertEqual( - array(0x60, 0x0D, 0x0A, 0x61, 0x0D, 0x0A, 0x62, 0x0D, 0x0A, 0x63), - $filter->filter(array(0x60, 0x0D, 0x61, 0x0D, 0x62, 0x0D, 0x63)) - ); - } - - public function testConvertingAllLineEndingsToCRLFWhenInputIsCRLF() - { - $filter = $this->_createFilter( - array(array(0x0D, 0x0A), array(0x0D), array(0x0A)), - array(array(0x0A), array(0x0A), array(0x0D, 0x0A)) - ); - - $this->assertEqual( - array(0x60, 0x0D, 0x0A, 0x61, 0x0D, 0x0A, 0x62, 0x0D, 0x0A, 0x63), - $filter->filter(array(0x60, 0x0D, 0x0A, 0x61, 0x0D, 0x0A, 0x62, 0x0D, 0x0A, 0x63)) - ); - } - - public function testConvertingAllLineEndingsToCRLFWhenInputIsLFCR() - { - $filter = $this->_createFilter( - array(array(0x0D, 0x0A), array(0x0D), array(0x0A)), - array(array(0x0A), array(0x0A), array(0x0D, 0x0A)) - ); - - $this->assertEqual( - array(0x60, 0x0D, 0x0A, 0x0D, 0x0A, 0x61, 0x0D, 0x0A, 0x0D, 0x0A, 0x62, 0x0D, 0x0A, 0x0D, 0x0A, 0x63), - $filter->filter(array(0x60, 0x0A, 0x0D, 0x61, 0x0A, 0x0D, 0x62, 0x0A, 0x0D, 0x63)) - ); - } - - public function testConvertingAllLineEndingsToCRLFWhenInputContainsLFLF() - { - //Lighthouse Bug #23 - - $filter = $this->_createFilter( - array(array(0x0D, 0x0A), array(0x0D), array(0x0A)), - array(array(0x0A), array(0x0A), array(0x0D, 0x0A)) - ); - - $this->assertEqual( - array(0x60, 0x0D, 0x0A, 0x0D, 0x0A, 0x61, 0x0D, 0x0A, 0x0D, 0x0A, 0x62, 0x0D, 0x0A, 0x0D, 0x0A, 0x63), - $filter->filter(array(0x60, 0x0A, 0x0A, 0x61, 0x0A, 0x0A, 0x62, 0x0A, 0x0A, 0x63)) - ); - } - - // -- Creation methods - - private function _createFilter($search, $replace) - { - return new Swift_StreamFilters_ByteArrayReplacementFilter($search, $replace); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterFactoryTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterFactoryTest.php deleted file mode 100644 index 8190988..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterFactoryTest.php +++ /dev/null @@ -1,41 +0,0 @@ -_createFactory(); - $this->assertIsA($factory->createFilter('a', 'b'), - 'Swift_StreamFilters_StringReplacementFilter' - ); - } - - public function testSameInstancesAreCached() - { - $factory = $this->_createFactory(); - $filter1 = $factory->createFilter('a', 'b'); - $filter2 = $factory->createFilter('a', 'b'); - $this->assertSame($filter1, $filter2, '%s: Instances should be cached'); - } - - public function testDifferingInstancesAreNotCached() - { - $factory = $this->_createFactory(); - $filter1 = $factory->createFilter('a', 'b'); - $filter2 = $factory->createFilter('a', 'c'); - $this->assertNotEqual($filter1, $filter2, - '%s: Differing instances should not be cached' - ); - } - - // -- Creation methods - - private function _createFactory() - { - return new Swift_StreamFilters_StringReplacementFilterFactory(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterTest.php deleted file mode 100644 index 712f1dc..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterTest.php +++ /dev/null @@ -1,59 +0,0 @@ -_createFilter('foo', 'bar'); - $this->assertEqual('XbarYbarZ', $filter->filter('XfooYfooZ')); - } - - public function testShouldBufferReturnsTrueIfPartialMatchAtEndOfBuffer() - { - $filter = $this->_createFilter('foo', 'bar'); - $this->assertTrue($filter->shouldBuffer('XfooYf'), - '%s: Filter should buffer since "foo" is the needle and the ending ' . - '"f" could be from "foo"' - ); - } - - public function testFilterCanMakeMultipleReplacements() - { - $filter = $this->_createFilter(array('a', 'b'), 'foo'); - $this->assertEqual('XfooYfooZ', $filter->filter('XaYbZ')); - } - - public function testMultipleReplacementsCanBeDifferent() - { - $filter = $this->_createFilter(array('a', 'b'), array('foo', 'zip')); - $this->assertEqual('XfooYzipZ', $filter->filter('XaYbZ')); - } - - public function testShouldBufferReturnsFalseIfPartialMatchNotAtEndOfString() - { - $filter = $this->_createFilter("\r\n", "\n"); - $this->assertFalse($filter->shouldBuffer("foo\r\nbar"), - '%s: Filter should not buffer since x0Dx0A is the needle and is not at EOF' - ); - } - - public function testShouldBufferReturnsTrueIfAnyOfMultipleMatchesAtEndOfString() - { - $filter = $this->_createFilter(array('foo', 'zip'), 'bar'); - $this->assertTrue($filter->shouldBuffer('XfooYzi'), - '%s: Filter should buffer since "zip" is a needle and the ending ' . - '"zi" could be from "zip"' - ); - } - - // -- Creation methods - - private function _createFilter($search, $replace) - { - return new Swift_StreamFilters_StringReplacementFilter($search, $replace); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpEventSupportTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpEventSupportTest.php deleted file mode 100644 index e1749f2..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpEventSupportTest.php +++ /dev/null @@ -1,378 +0,0 @@ -_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $listener = $this->_mock('Swift_Events_EventListener'); - $smtp = $this->_getTransport($buf, $dispatcher); - $this->_checking(Expectations::create() - -> one($dispatcher)->bindEventListener($listener) - ); - $smtp->registerPlugin($listener); - } - - public function testSendingDispatchesBeforeSendEvent() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $message = $this->_createMessage(); - $smtp = $this->_getTransport($buf, $dispatcher); - $evt = $this->_mock('Swift_Events_SendEvent'); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('chris@swiftmailer.org'=>null)) - -> allowing($message)->getTo() -> returns(array('mark@swiftmailer.org'=>'Mark')) - -> ignoring($message) - -> one($dispatcher)->createSendEvent(optional()) -> returns($evt) - -> one($dispatcher)->dispatchEvent($evt, 'beforeSendPerformed') - -> ignoring($dispatcher) - -> ignoring($evt) - ); - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEqual(1, $smtp->send($message)); - } - - public function testSendingDispatchesSendEvent() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $message = $this->_createMessage(); - $smtp = $this->_getTransport($buf, $dispatcher); - $evt = $this->_mock('Swift_Events_SendEvent'); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('chris@swiftmailer.org'=>null)) - -> allowing($message)->getTo() -> returns(array('mark@swiftmailer.org'=>'Mark')) - -> ignoring($message) - -> one($dispatcher)->createSendEvent(optional()) -> returns($evt) - -> one($dispatcher)->dispatchEvent($evt, 'sendPerformed') - -> ignoring($dispatcher) - -> ignoring($evt) - ); - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEqual(1, $smtp->send($message)); - } - - public function testSendEventCapturesFailures() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->_mock('Swift_Events_SendEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('chris@swiftmailer.org'=>null)) - -> allowing($message)->getTo() -> returns(array('mark@swiftmailer.org'=>'Mark')) - -> ignoring($message) - -> one($buf)->write("MAIL FROM: \r\n") -> returns(1) - -> one($buf)->readLine(1) -> returns("250 OK\r\n") - -> one($buf)->write("RCPT TO: \r\n") -> returns(2) - -> one($buf)->readLine(2) -> returns("500 Not now\r\n") - -> allowing($dispatcher)->createSendEvent($smtp, optional()) -> returns($evt) - -> one($evt)->setFailedRecipients(array('mark@swiftmailer.org')) - -> ignoring($dispatcher) - -> ignoring($evt) - ); - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEqual(0, $smtp->send($message)); - } - - public function testSendEventHasResultFailedIfAllFailures() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->_mock('Swift_Events_SendEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('chris@swiftmailer.org'=>null)) - -> allowing($message)->getTo() -> returns(array('mark@swiftmailer.org'=>'Mark')) - -> ignoring($message) - -> one($buf)->write("MAIL FROM: \r\n") -> returns(1) - -> one($buf)->readLine(1) -> returns("250 OK\r\n") - -> one($buf)->write("RCPT TO: \r\n") -> returns(2) - -> one($buf)->readLine(2) -> returns("500 Not now\r\n") - -> allowing($dispatcher)->createSendEvent($smtp, optional()) -> returns($evt) - -> one($evt)->setResult(Swift_Events_SendEvent::RESULT_FAILED) - -> ignoring($dispatcher) - -> ignoring($evt) - ); - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEqual(0, $smtp->send($message)); - } - - public function testSendEventHasResultTentativeIfSomeFailures() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->_mock('Swift_Events_SendEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('chris@swiftmailer.org'=>null)) - -> allowing($message)->getTo() -> returns(array( - 'mark@swiftmailer.org'=>'Mark', 'chris@site.tld'=>'Chris' - )) - -> ignoring($message) - -> one($buf)->write("MAIL FROM: \r\n") -> returns(1) - -> one($buf)->readLine(1) -> returns("250 OK\r\n") - -> one($buf)->write("RCPT TO: \r\n") -> returns(2) - -> one($buf)->readLine(2) -> returns("500 Not now\r\n") - -> allowing($dispatcher)->createSendEvent($smtp, optional()) -> returns($evt) - -> one($evt)->setResult(Swift_Events_SendEvent::RESULT_TENTATIVE) - -> ignoring($dispatcher) - -> ignoring($evt) - ); - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEqual(1, $smtp->send($message)); - } - - public function testSendEventHasResultSuccessIfNoFailures() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->_mock('Swift_Events_SendEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('chris@swiftmailer.org'=>null)) - -> allowing($message)->getTo() -> returns(array( - 'mark@swiftmailer.org'=>'Mark', 'chris@site.tld'=>'Chris' - )) - -> ignoring($message) - -> allowing($dispatcher)->createSendEvent($smtp, optional()) -> returns($evt) - -> one($evt)->setResult(Swift_Events_SendEvent::RESULT_SUCCESS) - -> ignoring($dispatcher) - -> ignoring($evt) - ); - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEqual(2, $smtp->send($message)); - } - - public function testCancellingEventBubbleBeforeSendStopsEvent() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->_mock('Swift_Events_SendEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('chris@swiftmailer.org'=>null)) - -> allowing($message)->getTo() -> returns(array('mark@swiftmailer.org'=>'Mark')) - -> ignoring($message) - -> allowing($dispatcher)->createSendEvent($smtp, optional()) -> returns($evt) - -> one($dispatcher)->dispatchEvent($evt, 'beforeSendPerformed') - -> ignoring($dispatcher) - -> atLeast(1)->of($evt)->bubbleCancelled() -> returns(true) - -> ignoring($evt) - ); - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEqual(0, $smtp->send($message)); - } - - public function testStartingTransportDispatchesTransportChangeEvent() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->_mock('Swift_Events_TransportChangeEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - $this->_checking(Expectations::create() - -> allowing($dispatcher)->createTransportChangeEvent($smtp, optional()) -> returns($evt) - -> one($dispatcher)->dispatchEvent($evt, 'transportStarted') - -> ignoring($dispatcher) - -> ignoring($evt) - ); - $this->_finishBuffer($buf); - $smtp->start(); - } - - public function testStartingTransportDispatchesBeforeTransportChangeEvent() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->_mock('Swift_Events_TransportChangeEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - $this->_checking(Expectations::create() - -> allowing($dispatcher)->createTransportChangeEvent($smtp, optional()) -> returns($evt) - -> one($dispatcher)->dispatchEvent($evt, 'beforeTransportStarted') - -> ignoring($dispatcher) - -> ignoring($evt) - ); - $this->_finishBuffer($buf); - $smtp->start(); - } - - public function testCancellingBubbleBeforeTransportStartStopsEvent() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->_mock('Swift_Events_TransportChangeEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - $this->_checking(Expectations::create() - -> allowing($dispatcher)->createTransportChangeEvent($smtp, optional()) -> returns($evt) - -> one($dispatcher)->dispatchEvent($evt, 'beforeTransportStarted') - -> allowing($evt)->bubbleCancelled() -> returns(true) - -> ignoring($dispatcher) - -> ignoring($evt) - ); - $this->_finishBuffer($buf); - $smtp->start(); - - $this->assertFalse($smtp->isStarted(), - '%s: Transport should not be started since event bubble was cancelled' - ); - } - - public function testStoppingTransportDispatchesTransportChangeEvent() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->_mock('Swift_Events_TransportChangeEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - $this->_checking(Expectations::create() - -> allowing($dispatcher)->createTransportChangeEvent($smtp, optional()) -> returns($evt) - -> one($dispatcher)->dispatchEvent($evt, 'transportStopped') - -> ignoring($dispatcher) - -> ignoring($evt) - ); - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->stop(); - } - - public function testStoppingTransportDispatchesBeforeTransportChangeEvent() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->_mock('Swift_Events_TransportChangeEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - $this->_checking(Expectations::create() - -> allowing($dispatcher)->createTransportChangeEvent($smtp, optional()) -> returns($evt) - -> one($dispatcher)->dispatchEvent($evt, 'beforeTransportStopped') - -> ignoring($dispatcher) - -> ignoring($evt) - ); - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->stop(); - } - - public function testCancellingBubbleBeforeTransportStoppedStopsEvent() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->_mock('Swift_Events_TransportChangeEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - $seq = $this->_sequence('stopping transport'); - $this->_checking(Expectations::create() - -> allowing($dispatcher)->createTransportChangeEvent($smtp, optional()) -> returns($evt) - -> one($dispatcher)->dispatchEvent($evt, 'beforeTransportStopped') -> inSequence($seq) - -> allowing($evt)->bubbleCancelled() -> inSequence($seq) -> returns(true) - -> ignoring($dispatcher) - -> ignoring($evt) - ); - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->stop(); - - $this->assertTrue($smtp->isStarted(), - '%s: Transport should not be stopped since event bubble was cancelled' - ); - } - - public function testResponseEventsAreGenerated() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->_mock('Swift_Events_ResponseEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - $this->_checking(Expectations::create() - -> allowing($dispatcher)->createResponseEvent($smtp, optional()) -> returns($evt) - -> one($dispatcher)->dispatchEvent($evt, 'responseReceived') - -> ignoring($dispatcher) - -> ignoring($evt) - ); - $this->_finishBuffer($buf); - $smtp->start(); - } - - public function testCommandEventsAreGenerated() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->_mock('Swift_Events_CommandEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - $this->_checking(Expectations::create() - -> allowing($dispatcher)->createCommandEvent($smtp, optional()) -> returns($evt) - -> one($dispatcher)->dispatchEvent($evt, 'commandSent') - -> ignoring($dispatcher) - -> ignoring($evt) - ); - $this->_finishBuffer($buf); - $smtp->start(); - } - - public function testExceptionsCauseExceptionEvents() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->_mock('Swift_Events_TransportExceptionEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - $this->_checking(Expectations::create() - -> atLeast(1)->of($buf)->readLine(any()) -> returns("503 I'm sleepy, go away!\r\n") - -> allowing($dispatcher)->createTransportExceptionEvent($smtp, optional()) -> returns($evt) - -> one($dispatcher)->dispatchEvent($evt, 'exceptionThrown') - -> ignoring($dispatcher) - -> ignoring($evt) - ); - $this->_finishBuffer($buf); - try { - $smtp->start(); - $this->fail('TransportException should be thrown on invalid response'); - } catch (Swift_TransportException $e) { - } - } - - public function testExceptionBubblesCanBeCancelled() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->_mock('Swift_Events_TransportExceptionEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - $this->_checking(Expectations::create() - -> atLeast(1)->of($buf)->readLine(any()) -> returns("503 I'm sleepy, go away!\r\n") - -> allowing($dispatcher)->createTransportExceptionEvent($smtp, optional()) -> returns($evt) - -> one($dispatcher)->dispatchEvent($evt, 'exceptionThrown') - -> atLeast(1)->of($evt)->bubbleCancelled() -> returns(true) - -> ignoring($dispatcher) - -> ignoring($evt) - ); - $this->_finishBuffer($buf); - $smtp->start(); - } - - // -- Creation Methods - - protected function _createEventDispatcher($stub = true) - { - return $stub - ? $this->_stub('Swift_Events_EventDispatcher') - : $this->_mock('Swift_Events_EventDispatcher') - ; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpTest.php deleted file mode 100644 index 298969e..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpTest.php +++ /dev/null @@ -1,924 +0,0 @@ -_getBuffer(); - $smtp = $this->_getTransport($buf); - $s = $this->_sequence('SMTP-convo'); - $this->_checking(Expectations::create() - -> one($buf)->initialize() -> inSequence($s) - -> one($buf)->readLine(0) -> inSequence($s) -> returns("220 some.server.tld bleh\r\n") - ); - $this->_finishBuffer($buf); - try { - $this->assertFalse($smtp->isStarted(), '%s: SMTP should begin non-started'); - $smtp->start(); - $this->assertTrue($smtp->isStarted(), '%s: start() should have started connection'); - } catch (Exception $e) { - $this->fail('220 is a valid SMTP greeting and should be accepted'); - } - } - - public function testBadGreetingCausesException() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $s = $this->_sequence('SMTP-convo'); - $this->_checking(Expectations::create() - -> one($buf)->initialize() -> inSequence($s) - -> one($buf)->readLine(0) -> inSequence($s) -> returns("554 I'm busy\r\n") - ); - $this->_finishBuffer($buf); - try { - $this->assertFalse($smtp->isStarted(), '%s: SMTP should begin non-started'); - $smtp->start(); - $this->fail('554 greeting indicates an error and should cause an exception'); - } catch (Exception $e) { - $this->assertFalse($smtp->isStarted(), '%s: start() should have failed'); - } - } - - public function testStartSendsHeloToInitiate() - { - /* -- RFC 2821, 3.2. - - 3.2 Client Initiation - - Once the server has sent the welcoming message and the client has - received it, the client normally sends the EHLO command to the - server, indicating the client's identity. In addition to opening the - session, use of EHLO indicates that the client is able to process - service extensions and requests that the server provide a list of the - extensions it supports. Older SMTP systems which are unable to - support service extensions and contemporary clients which do not - require service extensions in the mail session being initiated, MAY - use HELO instead of EHLO. Servers MUST NOT return the extended - EHLO-style response to a HELO command. For a particular connection - attempt, if the server returns a "command not recognized" response to - EHLO, the client SHOULD be able to fall back and send HELO. - - In the EHLO command the host sending the command identifies itself; - the command may be interpreted as saying "Hello, I am " (and, - in the case of EHLO, "and I support service extension requests"). - - -- RFC 2281, 4.1.1.1. - - ehlo = "EHLO" SP Domain CRLF - helo = "HELO" SP Domain CRLF - - -- RFC 2821, 4.3.2. - - EHLO or HELO - S: 250 - E: 504, 550 - - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $s = $this->_sequence('SMTP-convo'); - $this->_checking(Expectations::create() - -> one($buf)->initialize() -> inSequence($s) - -> one($buf)->readLine(0) -> inSequence($s) -> returns("220 some.server.tld bleh\r\n") - -> one($buf)->write(pattern('~^HELO .*?\r\n$~D')) -> inSequence($s) -> returns(1) - -> one($buf)->readLine(1) -> inSequence($s) -> returns('250 ServerName' . "\r\n") - ); - $this->_finishBuffer($buf); - try { - $smtp->start(); - } catch (Exception $e) { - $this->fail('Starting SMTP should send HELO and accept 250 response'); - } - } - - public function testInvalidHeloResponseCausesException() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $s = $this->_sequence('SMTP-convo'); - $this->_checking(Expectations::create() - -> one($buf)->initialize() -> inSequence($s) - -> one($buf)->readLine(0) -> inSequence($s) -> returns("220 some.server.tld bleh\r\n") - -> one($buf)->write(pattern('~^HELO .*?\r\n$~D')) -> inSequence($s) -> returns(1) - -> one($buf)->readLine(1) -> inSequence($s) -> returns('504 WTF' . "\r\n") - ); - $this->_finishBuffer($buf); - try { - $this->assertFalse($smtp->isStarted(), '%s: SMTP should begin non-started'); - $smtp->start(); - $this->fail('Non 250 HELO response should raise Exception'); - } catch (Exception $e) { - $this->assertFalse($smtp->isStarted(), '%s: SMTP start() should have failed'); - } - } - - public function testDomainNameIsPlacedInHelo() - { - /* -- RFC 2821, 4.1.4. - - The SMTP client MUST, if possible, ensure that the domain parameter - to the EHLO command is a valid principal host name (not a CNAME or MX - name) for its host. If this is not possible (e.g., when the client's - address is dynamically assigned and the client does not have an - obvious name), an address literal SHOULD be substituted for the - domain name and supplemental information provided that will assist in - identifying the client. - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $s = $this->_sequence('SMTP-convo'); - $this->_checking(Expectations::create() - -> one($buf)->initialize() -> inSequence($s) - -> one($buf)->readLine(0) -> inSequence($s) -> returns("220 some.server.tld bleh\r\n") - -> one($buf)->write("HELO mydomain.com\r\n") -> inSequence($s) -> returns(1) - -> one($buf)->readLine(1) -> inSequence($s) -> returns('250 ServerName' . "\r\n") - ); - $this->_finishBuffer($buf); - $smtp->setLocalDomain('mydomain.com'); - $smtp->start(); - } - - public function testSuccessfulMailCommand() - { - /* -- RFC 2821, 3.3. - - There are three steps to SMTP mail transactions. The transaction - starts with a MAIL command which gives the sender identification. - - ..... - - The first step in the procedure is the MAIL command. - - MAIL FROM: [SP ] - - -- RFC 2821, 4.1.1.2. - - Syntax: - - "MAIL FROM:" ("<>" / Reverse-Path) - [SP Mail-parameters] CRLF - -- RFC 2821, 4.1.2. - - Reverse-path = Path - Forward-path = Path - Path = "<" [ A-d-l ":" ] Mailbox ">" - A-d-l = At-domain *( "," A-d-l ) - ; Note that this form, the so-called "source route", - ; MUST BE accepted, SHOULD NOT be generated, and SHOULD be - ; ignored. - At-domain = "@" domain - - -- RFC 2821, 4.3.2. - - MAIL - S: 250 - E: 552, 451, 452, 550, 553, 503 - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain.com'=>'Me')) - -> allowing($message)->getTo() -> returns(array('foo@bar'=>null)) - -> allowing($message) - - -> one($buf)->write("MAIL FROM: \r\n") -> returns(1) - -> one($buf)->readLine(1) -> returns('250 OK' . "\r\n") - ); - $this->_finishBuffer($buf); - try { - $smtp->start(); - $smtp->send($message); - } catch (Exception $e) { - $this->fail('MAIL FROM should accept a 250 response'); - } - } - - public function testInvalidResponseCodeFromMailCausesException() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain.com'=>'Me')) - -> allowing($message)->getTo() -> returns(array('foo@bar'=>null)) - -> allowing($message) - - -> one($buf)->write("MAIL FROM: \r\n") -> returns(1) - -> one($buf)->readLine(1) -> returns('553 Bad' . "\r\n") - ); - $this->_finishBuffer($buf); - try { - $smtp->start(); - $smtp->send($message); - $this->fail('MAIL FROM should accept a 250 response'); - } catch (Exception $e) { - } - } - - public function testSenderIsPreferredOverFrom() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain.com'=>'Me')) - -> allowing($message)->getSender() -> returns(array('another@domain.com'=>'Someone')) - -> allowing($message)->getTo() -> returns(array('foo@bar'=>null)) - -> allowing($message) - - -> one($buf)->write("MAIL FROM: \r\n") -> returns(1) - -> one($buf)->readLine(1) -> returns('250 OK' . "\r\n") - ); - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testReturnPathIsPreferredOverSender() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain.com'=>'Me')) - -> allowing($message)->getSender() -> returns(array('another@domain.com'=>'Someone')) - -> allowing($message)->getReturnPath() -> returns('more@domain.com') - -> allowing($message)->getTo() -> returns(array('foo@bar'=>null)) - -> allowing($message) - - -> one($buf)->write("MAIL FROM: \r\n") -> returns(1) - -> one($buf)->readLine(1) -> returns('250 OK' . "\r\n") - ); - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testSuccessfulRcptCommandWith250Response() - { - /* -- RFC 2821, 3.3. - - The second step in the procedure is the RCPT command. - - RCPT TO: [ SP ] - - The first or only argument to this command includes a forward-path - (normally a mailbox and domain, always surrounded by "<" and ">" - brackets) identifying one recipient. If accepted, the SMTP server - returns a 250 OK reply and stores the forward-path. If the recipient - is known not to be a deliverable address, the SMTP server returns a - 550 reply, typically with a string such as "no such user - " and the - mailbox name (other circumstances and reply codes are possible). - This step of the procedure can be repeated any number of times. - - -- RFC 2821, 4.1.1.3. - - This command is used to identify an individual recipient of the mail - data; multiple recipients are specified by multiple use of this - command. The argument field contains a forward-path and may contain - optional parameters. - - The forward-path normally consists of the required destination - mailbox. Sending systems SHOULD not generate the optional list of - hosts known as a source route. - - ....... - - "RCPT TO:" ("" / "" / Forward-Path) - [SP Rcpt-parameters] CRLF - - -- RFC 2821, 4.2.2. - - 250 Requested mail action okay, completed - 251 User not local; will forward to - (See section 3.4) - 252 Cannot VRFY user, but will accept message and attempt - delivery - - -- RFC 2821, 4.3.2. - - RCPT - S: 250, 251 (but see section 3.4 for discussion of 251 and 551) - E: 550, 551, 552, 553, 450, 451, 452, 503, 550 - */ - - //We'll treat 252 as accepted since it isn't really a failure - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $s = $this->_sequence('SMTP-envelope'); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain.com'=>'Me')) - -> allowing($message)->getTo() -> returns(array('foo@bar'=>null)) - -> allowing($message) - - -> one($buf)->write("MAIL FROM: \r\n") -> inSequence($s) -> returns(1) - -> one($buf)->readLine(1) -> returns('250 OK' . "\r\n") - -> one($buf)->write("RCPT TO: \r\n") -> inSequence($s) -> returns(2) - -> one($buf)->readLine(2) -> returns('250 OK' . "\r\n") - ); - $this->_finishBuffer($buf); - try { - $smtp->start(); - $smtp->send($message); - } catch (Exception $e) { - $this->fail('RCPT TO should accept a 250 response'); - } - } - - public function testMailFromCommandIsOnlySentOncePerMessage() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $s = $this->_sequence('SMTP-envelope'); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain.com'=>'Me')) - -> allowing($message)->getTo() -> returns(array('foo@bar'=>null)) - -> allowing($message) - - -> one($buf)->write("MAIL FROM: \r\n") -> inSequence($s) -> returns(1) - -> one($buf)->readLine(1) -> returns('250 OK' . "\r\n") - -> one($buf)->write("RCPT TO: \r\n") -> inSequence($s) -> returns(2) - -> one($buf)->readLine(2) -> returns('250 OK' . "\r\n") - -> never($buf)->write("MAIL FROM: \r\n") - ); - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testMultipleRecipientsSendsMultipleRcpt() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain.com'=>'Me')) - -> allowing($message)->getTo() -> returns(array( - 'foo@bar' => null, - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user' - )) - -> allowing($message) - - -> one($buf)->write("RCPT TO: \r\n") -> returns(1) - -> one($buf)->readLine(1) -> returns('250 OK' . "\r\n") - -> one($buf)->write("RCPT TO: \r\n") -> returns(2) - -> one($buf)->readLine(2) -> returns('250 OK' . "\r\n") - -> one($buf)->write("RCPT TO: \r\n") -> returns(3) - -> one($buf)->readLine(3) -> returns('250 OK' . "\r\n") - ); - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testCcRecipientsSendsMultipleRcpt() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain.com'=>'Me')) - -> allowing($message)->getTo() -> returns(array('foo@bar' => null)) - -> allowing($message)->getCc() -> returns(array( - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user' - )) - -> allowing($message) - - -> one($buf)->write("RCPT TO: \r\n") -> returns(1) - -> one($buf)->readLine(1) -> returns('250 OK' . "\r\n") - -> one($buf)->write("RCPT TO: \r\n") -> returns(2) - -> one($buf)->readLine(2) -> returns('250 OK' . "\r\n") - -> one($buf)->write("RCPT TO: \r\n") -> returns(3) - -> one($buf)->readLine(3) -> returns('250 OK' . "\r\n") - ); - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testSendReturnsNumberOfSuccessfulRecipients() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain.com'=>'Me')) - -> allowing($message)->getTo() -> returns(array('foo@bar' => null)) - -> allowing($message)->getCc() -> returns(array( - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user' - )) - -> allowing($message) - - -> one($buf)->write("RCPT TO: \r\n") -> returns(1) - -> one($buf)->readLine(1) -> returns('250 OK' . "\r\n") - -> one($buf)->write("RCPT TO: \r\n") -> returns(2) - -> one($buf)->readLine(2) -> returns('501 Nobody here' . "\r\n") - -> one($buf)->write("RCPT TO: \r\n") -> returns(3) - -> one($buf)->readLine(3) -> returns('250 OK' . "\r\n") - ); - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEqual(2, $smtp->send($message), - '%s: 1 of 3 recipients failed so 2 should be returned' - ); - } - - public function testRsetIsSentIfNoSuccessfulRecipients() - { - /* --RFC 2821, 4.1.1.5. - - This command specifies that the current mail transaction will be - aborted. Any stored sender, recipients, and mail data MUST be - discarded, and all buffers and state tables cleared. The receiver - MUST send a "250 OK" reply to a RSET command with no arguments. A - reset command may be issued by the client at any time. - - -- RFC 2821, 4.3.2. - - RSET - S: 250 - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain.com'=>'Me')) - -> allowing($message)->getTo() -> returns(array('foo@bar' => null)) - -> allowing($message) - - -> one($buf)->write("RCPT TO: \r\n") -> returns(1) - -> one($buf)->readLine(1) -> returns('503 Bad' . "\r\n") - -> one($buf)->write("RSET\r\n") -> returns(2) - -> one($buf)->readLine(2) -> returns('250 OK' . "\r\n") - ); - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEqual(0, $smtp->send($message), - '%s: 1 of 1 recipients failed so 0 should be returned' - ); - } - - public function testSuccessfulDataCommand() - { - /* -- RFC 2821, 3.3. - - The third step in the procedure is the DATA command (or some - alternative specified in a service extension). - - DATA - - If accepted, the SMTP server returns a 354 Intermediate reply and - considers all succeeding lines up to but not including the end of - mail data indicator to be the message text. - - -- RFC 2821, 4.1.1.4. - - The receiver normally sends a 354 response to DATA, and then treats - the lines (strings ending in sequences, as described in - section 2.3.7) following the command as mail data from the sender. - This command causes the mail data to be appended to the mail data - buffer. The mail data may contain any of the 128 ASCII character - codes, although experience has indicated that use of control - characters other than SP, HT, CR, and LF may cause problems and - SHOULD be avoided when possible. - - -- RFC 2821, 4.3.2. - - DATA - I: 354 -> data -> S: 250 - E: 552, 554, 451, 452 - E: 451, 554, 503 - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain.com'=>'Me')) - -> allowing($message)->getTo() -> returns(array('foo@bar' => null)) - -> allowing($message) - - -> one($buf)->write("DATA\r\n") -> returns(1) - -> one($buf)->readLine(1) -> returns('354 Go ahead' . "\r\n") - ); - $this->_finishBuffer($buf); - try { - $smtp->start(); - $smtp->send($message); - } catch (Exception $e) { - $this->fail('354 is the expected response to DATA'); - } - } - - public function testBadDataResponseCausesException() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain.com'=>'Me')) - -> allowing($message)->getTo() -> returns(array('foo@bar' => null)) - -> allowing($message) - - -> one($buf)->write("DATA\r\n") -> returns(1) - -> one($buf)->readLine(1) -> returns('451 Bad' . "\r\n") - ); - $this->_finishBuffer($buf); - try { - $smtp->start(); - $smtp->send($message); - $this->fail('354 is the expected response to DATA (not observed)'); - } catch (Exception $e) { - } - } - - public function testMessageIsStreamedToBufferForData() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $s = $this->_sequence('DATA Streaming'); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain.com'=>'Me')) - -> allowing($message)->getTo() -> returns(array('foo@bar' => null)) - - -> one($buf)->write("DATA\r\n") -> inSequence($s) -> returns(1) - -> one($buf)->readLine(1) -> returns('354 OK' . "\r\n") - -> one($message)->toByteStream($buf) -> inSequence($s) - -> one($buf)->write("\r\n.\r\n") -> inSequence($s) -> returns(2) - -> one($buf)->readLine(2) -> returns('250 OK' . "\r\n") - - -> allowing($message) - ); - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testBadResponseAfterDataTransmissionCausesException() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $s = $this->_sequence('DATA Streaming'); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain.com'=>'Me')) - -> allowing($message)->getTo() -> returns(array('foo@bar' => null)) - - -> one($buf)->write("DATA\r\n") -> inSequence($s) -> returns(1) - -> one($buf)->readLine(1) -> returns('354 OK' . "\r\n") - -> one($message)->toByteStream($buf) -> inSequence($s) - -> one($buf)->write("\r\n.\r\n") -> inSequence($s) -> returns(2) - -> one($buf)->readLine(2) -> returns('554 Error' . "\r\n") - - -> allowing($message) - ); - $this->_finishBuffer($buf); - try { - $smtp->start(); - $smtp->send($message); - $this->fail('250 is the expected response after a DATA transmission (not observed)'); - } catch (Exception $e) { - } - } - - public function testBccRecipientsAreRemovedFromHeaders() - { - /* -- RFC 2821, 7.2. - - Addresses that do not appear in the message headers may appear in the - RCPT commands to an SMTP server for a number of reasons. The two - most common involve the use of a mailing address as a "list exploder" - (a single address that resolves into multiple addresses) and the - appearance of "blind copies". Especially when more than one RCPT - command is present, and in order to avoid defeating some of the - purpose of these mechanisms, SMTP clients and servers SHOULD NOT copy - the full set of RCPT command arguments into the headers, either as - part of trace headers or as informational or private-extension - headers. Since this rule is often violated in practice, and cannot - be enforced, sending SMTP systems that are aware of "bcc" use MAY - find it helpful to send each blind copy as a separate message - transaction containing only a single RCPT command. - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain.com'=>'Me')) - -> allowing($message)->getTo() -> returns(array('foo@bar' => null)) - -> allowing($message)->getBcc() -> returns(array( - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user' - )) - -> atLeast(1)->of($message)->setBcc(array()) - -> allowing($message) - ); - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testEachBccRecipientIsSentASeparateMessage() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain.com'=>'Me')) - -> allowing($message)->getTo() -> returns(array('foo@bar' => null)) - -> allowing($message)->getBcc() -> returns(array( - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user' - )) - -> atLeast(1)->of($message)->setBcc(array()) - -> one($message)->setBcc(array('zip@button' => 'Zip Button')) - -> one($message)->setBcc(array('test@domain' => 'Test user')) - -> atLeast(1)->of($message)->setBcc(array( - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user' - )) - -> allowing($message) - - -> one($buf)->write("MAIL FROM: \r\n") -> returns(1) - -> one($buf)->readLine(1) -> returns("250 OK\r\n") - -> one($buf)->write("RCPT TO: \r\n") -> returns(2) - -> one($buf)->readLine(2) -> returns("250 OK\r\n") - -> one($buf)->write("DATA\r\n") -> returns(3) - -> one($buf)->readLine(3) -> returns("354 OK\r\n") - -> one($buf)->write("\r\n.\r\n") -> returns(4) - -> one($buf)->readLine(4) -> returns("250 OK\r\n") - - -> one($buf)->write("MAIL FROM: \r\n") -> returns(5) - -> one($buf)->readLine(5) -> returns("250 OK\r\n") - -> one($buf)->write("RCPT TO: \r\n") -> returns(6) - -> one($buf)->readLine(6) -> returns("250 OK\r\n") - -> one($buf)->write("DATA\r\n") -> returns(7) - -> one($buf)->readLine(7) -> returns("354 OK\r\n") - -> one($buf)->write("\r\n.\r\n") -> returns(8) - -> one($buf)->readLine(8) -> returns("250 OK\r\n") - - -> one($buf)->write("MAIL FROM: \r\n") -> returns(9) - -> one($buf)->readLine(9) -> returns("250 OK\r\n") - -> one($buf)->write("RCPT TO: \r\n") -> returns(10) - -> one($buf)->readLine(10) -> returns("250 OK\r\n") - -> one($buf)->write("DATA\r\n") -> returns(11) - -> one($buf)->readLine(11) -> returns("354 OK\r\n") - -> one($buf)->write("\r\n.\r\n") -> returns(12) - -> one($buf)->readLine(12) -> returns("250 OK\r\n") - ); - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEqual(3, $smtp->send($message)); - } - - public function testMessageStateIsRestoredOnFailure() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain.com'=>'Me')) - -> allowing($message)->getTo() -> returns(array('foo@bar' => null)) - -> allowing($message)->getBcc() -> returns(array( - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user' - )) - -> one($message)->setBcc(array()) - -> one($message)->setBcc(array( - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user' - )) - -> allowing($message) - -> one($buf)->write("MAIL FROM: \r\n") -> returns(1) - -> one($buf)->readLine(1) -> returns("250 OK\r\n") - -> one($buf)->write("RCPT TO: \r\n") -> returns(2) - -> one($buf)->readLine(2) -> returns("250 OK\r\n") - -> one($buf)->write("DATA\r\n") -> returns(3) - -> one($buf)->readLine(3) -> returns("451 No\r\n") - ); - $this->_finishBuffer($buf); - - $smtp->start(); - try { - $smtp->send($message); - $this->fail('A bad response was given so exception is expected'); - } catch (Exception $e) { - } - } - - public function testStopSendsQuitCommand() - { - /* -- RFC 2821, 4.1.1.10. - - This command specifies that the receiver MUST send an OK reply, and - then close the transmission channel. - - The receiver MUST NOT intentionally close the transmission channel - until it receives and replies to a QUIT command (even if there was an - error). The sender MUST NOT intentionally close the transmission - channel until it sends a QUIT command and SHOULD wait until it - receives the reply (even if there was an error response to a previous - command). If the connection is closed prematurely due to violations - of the above or system or network failure, the server MUST cancel any - pending transaction, but not undo any previously completed - transaction, and generally MUST act as if the command or transaction - in progress had received a temporary error (i.e., a 4yz response). - - The QUIT command may be issued at any time. - - Syntax: - "QUIT" CRLF - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> one($buf)->initialize() - -> one($buf)->write("QUIT\r\n") -> returns(1) - -> one($buf)->readLine(1) -> returns("221 Bye\r\n") - -> one($buf)->terminate() - ); - $this->_finishBuffer($buf); - - $this->assertFalse($smtp->isStarted()); - $smtp->start(); - $this->assertTrue($smtp->isStarted()); - $smtp->stop(); - $this->assertFalse($smtp->isStarted()); - } - - public function testBufferCanBeFetched() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $ref = $smtp->getBuffer(); - $this->assertReference($buf, $ref); - } - - public function testBufferCanBeWrittenToUsingExecuteCommand() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> one($buf)->write("FOO\r\n") -> returns(1) - -> one($buf)->readLine(1) -> returns("250 OK\r\n") - -> ignoring($buf) - ); - - $res = $smtp->executeCommand("FOO\r\n"); - $this->assertEqual("250 OK\r\n", $res); - } - - public function testResponseCodesAreValidated() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> one($buf)->write("FOO\r\n") -> returns(1) - -> one($buf)->readLine(1) -> returns("551 Not ok\r\n") - -> ignoring($buf) - ); - - try { - $smtp->executeCommand("FOO\r\n", array(250, 251)); - $this->fail('A 250 or 251 response was needed but 551 was returned.'); - } catch (Exception $e) { - } - } - - public function testFailedRecipientsCanBeCollectedByReference() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain.com'=>'Me')) - -> allowing($message)->getTo() -> returns(array('foo@bar' => null)) - -> allowing($message)->getBcc() -> returns(array( - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user' - )) - -> atLeast(1)->of($message)->setBcc(array()) - -> one($message)->setBcc(array('zip@button' => 'Zip Button')) - -> one($message)->setBcc(array('test@domain' => 'Test user')) - -> atLeast(1)->of($message)->setBcc(array( - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user' - )) - -> allowing($message) - - -> one($buf)->write("MAIL FROM: \r\n") -> returns(1) - -> one($buf)->readLine(1) -> returns("250 OK\r\n") - -> one($buf)->write("RCPT TO: \r\n") -> returns(2) - -> one($buf)->readLine(2) -> returns("250 OK\r\n") - -> one($buf)->write("DATA\r\n") -> returns(3) - -> one($buf)->readLine(3) -> returns("354 OK\r\n") - -> one($buf)->write("\r\n.\r\n") -> returns(4) - -> one($buf)->readLine(4) -> returns("250 OK\r\n") - - -> one($buf)->write("MAIL FROM: \r\n") -> returns(5) - -> one($buf)->readLine(5) -> returns("250 OK\r\n") - -> one($buf)->write("RCPT TO: \r\n") -> returns(6) - -> one($buf)->readLine(6) -> returns("500 Bad\r\n") - -> one($buf)->write("RSET\r\n") -> returns(7) - -> one($buf)->readLine(7) -> returns("250 OK\r\n") - - -> one($buf)->write("MAIL FROM: \r\n") -> returns(8) - -> one($buf)->readLine(8) -> returns("250 OK\r\n") - -> one($buf)->write("RCPT TO: \r\n") -> returns(9) - -> one($buf)->readLine(9) -> returns("500 Bad\r\n") - -> one($buf)->write("RSET\r\n") -> returns(10) - -> one($buf)->readLine(10) -> returns("250 OK\r\n") - ); - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEqual(1, $smtp->send($message, $failures)); - $this->assertEqual(array('zip@button', 'test@domain'), $failures, - '%s: Failures should be caught in an array' - ); - } - - public function testSendingRegeneratesMessageId() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain.com'=>'Me')) - -> allowing($message)->getTo() -> returns(array('foo@bar'=>null)) - -> one($message)->generateId() - -> allowing($message) - ); - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - // -- Protected methods - - protected function _getBuffer() - { - return $this->_mock('Swift_Transport_IoBuffer'); - } - - protected function _createMessage() - { - return $this->_mock('Swift_Mime_Message'); - } - - protected function _finishBuffer($buf) - { - $this->_checking(Expectations::create() - -> ignoring($buf)->readLine(0) -> returns('220 server.com foo' . "\r\n") - -> ignoring($buf)->write(pattern('~^(EH|HE)LO .*?\r\n$~D')) -> returns($x = uniqid()) - -> ignoring($buf)->readLine($x) -> returns('250 ServerName' . "\r\n") - -> ignoring($buf)->write(pattern('~^MAIL FROM: <.*?>\r\n$~D')) -> returns($x = uniqid()) - -> ignoring($buf)->readLine($x) -> returns('250 OK' . "\r\n") - -> ignoring($buf)->write(pattern('~^RCPT TO: <.*?>\r\n$~D')) -> returns($x = uniqid()) - -> ignoring($buf)->readLine($x) -> returns('250 OK' . "\r\n") - -> ignoring($buf)->write("DATA\r\n") -> returns($x = uniqid()) - -> ignoring($buf)->readLine($x) -> returns('354 OK' . "\r\n") - -> ignoring($buf)->write("\r\n.\r\n") -> returns($x = uniqid()) - -> ignoring($buf)->readLine($x) -> returns('250 OK' . "\r\n") - -> ignoring($buf)->write("RSET\r\n") -> returns($x = uniqid()) - -> ignoring($buf)->readLine($x) -> returns("250 OK\r\n") - -> ignoring($buf) -> returns(false) - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/CramMd5AuthenticatorTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/CramMd5AuthenticatorTest.php deleted file mode 100644 index ee0eab9..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/CramMd5AuthenticatorTest.php +++ /dev/null @@ -1,67 +0,0 @@ -_agent = $this->_mock('Swift_Transport_SmtpAgent'); - } - - public function testKeywordIsCramMd5() - { - /* -- RFC 2195, 2. - The authentication type associated with CRAM is "CRAM-MD5". - */ - - $cram = $this->_getAuthenticator(); - $this->assertEqual('CRAM-MD5', $cram->getAuthKeyword()); - } - - public function testSuccessfulAuthentication() - { - $cram = $this->_getAuthenticator(); - $this->_checking(Expectations::create() - -> one($this->_agent)->executeCommand("AUTH CRAM-MD5\r\n", array(334)) - -> returns('334 ' . base64_encode('') . "\r\n") - // The use of any() is controversial, but here to avoid crazy test logic - -> one($this->_agent)->executeCommand(any(), array(235)) - ); - - $this->assertTrue($cram->authenticate($this->_agent, 'jack', 'pass'), - '%s: The buffer accepted all commands authentication should succeed' - ); - } - - public function testAuthenticationFailureSendRsetAndReturnFalse() - { - $cram = $this->_getAuthenticator(); - $this->_checking(Expectations::create() - -> one($this->_agent)->executeCommand("AUTH CRAM-MD5\r\n", array(334)) - -> returns('334 ' . base64_encode('') . "\r\n") - // The use of any() is controversial, but here to avoid crazy test logic - -> one($this->_agent)->executeCommand(any(), array(235)) - -> throws(new Swift_TransportException("")) - - -> one($this->_agent)->executeCommand("RSET\r\n", array(250)) - ); - - $this->assertFalse($cram->authenticate($this->_agent, 'jack', 'pass'), - '%s: Authentication fails, so RSET should be sent' - ); - } - - // -- Private helpers - - private function _getAuthenticator() - { - return new Swift_Transport_Esmtp_Auth_CramMd5Authenticator(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/LoginAuthenticatorTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/LoginAuthenticatorTest.php deleted file mode 100644 index 7a9f0b4..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/LoginAuthenticatorTest.php +++ /dev/null @@ -1,60 +0,0 @@ -_agent = $this->_mock('Swift_Transport_SmtpAgent'); - } - - public function testKeywordIsLogin() - { - $login = $this->_getAuthenticator(); - $this->assertEqual('LOGIN', $login->getAuthKeyword()); - } - - public function testSuccessfulAuthentication() - { - $login = $this->_getAuthenticator(); - $this->_checking(Expectations::create() - -> one($this->_agent)->executeCommand("AUTH LOGIN\r\n", array(334)) - -> one($this->_agent)->executeCommand(base64_encode('jack') . "\r\n", array(334)) - -> one($this->_agent)->executeCommand(base64_encode('pass') . "\r\n", array(235)) - ); - - $this->assertTrue($login->authenticate($this->_agent, 'jack', 'pass'), - '%s: The buffer accepted all commands authentication should succeed' - ); - } - - public function testAuthenticationFailureSendRsetAndReturnFalse() - { - $login = $this->_getAuthenticator(); - $this->_checking(Expectations::create() - -> one($this->_agent)->executeCommand("AUTH LOGIN\r\n", array(334)) - -> one($this->_agent)->executeCommand(base64_encode('jack') . "\r\n", array(334)) - -> one($this->_agent)->executeCommand(base64_encode('pass') . "\r\n", array(235)) - -> throws(new Swift_TransportException("")) - -> one($this->_agent)->executeCommand("RSET\r\n", array(250)) - ); - - $this->assertFalse($login->authenticate($this->_agent, 'jack', 'pass'), - '%s: Authentication fails, so RSET should be sent' - ); - } - - // -- Private helpers - - private function _getAuthenticator() - { - return new Swift_Transport_Esmtp_Auth_LoginAuthenticator(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/PlainAuthenticatorTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/PlainAuthenticatorTest.php deleted file mode 100644 index 19c2bc2..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/PlainAuthenticatorTest.php +++ /dev/null @@ -1,71 +0,0 @@ -_agent = $this->_mock('Swift_Transport_SmtpAgent'); - } - - public function testKeywordIsPlain() - { - /* -- RFC 4616, 1. - The name associated with this mechanism is "PLAIN". - */ - - $login = $this->_getAuthenticator(); - $this->assertEqual('PLAIN', $login->getAuthKeyword()); - } - - public function testSuccessfulAuthentication() - { - /* -- RFC 4616, 2. - The client presents the authorization identity (identity to act as), - followed by a NUL (U+0000) character, followed by the authentication - identity (identity whose password will be used), followed by a NUL - (U+0000) character, followed by the clear-text password. - */ - - $plain = $this->_getAuthenticator(); - $this->_checking(Expectations::create() - -> one($this->_agent)->executeCommand('AUTH PLAIN ' . base64_encode( - 'jack' . chr(0) . 'jack' . chr(0) . 'pass' - ) . "\r\n", array(235)) - ); - - $this->assertTrue($plain->authenticate($this->_agent, 'jack', 'pass'), - '%s: The buffer accepted all commands authentication should succeed' - ); - } - - public function testAuthenticationFailureSendRsetAndReturnFalse() - { - $plain = $this->_getAuthenticator(); - $this->_checking(Expectations::create() - -> one($this->_agent)->executeCommand('AUTH PLAIN ' . base64_encode( - 'jack' . chr(0) . 'jack' . chr(0) . 'pass' - ) . "\r\n", array(235)) -> throws(new Swift_TransportException("")) - - -> one($this->_agent)->executeCommand("RSET\r\n", array(250)) - ); - - $this->assertFalse($plain->authenticate($this->_agent, 'jack', 'pass'), - '%s: Authentication fails, so RSET should be sent' - ); - } - - // -- Private helpers - - private function _getAuthenticator() - { - return new Swift_Transport_Esmtp_Auth_PlainAuthenticator(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/AuthHandlerTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/AuthHandlerTest.php deleted file mode 100644 index 7dbc040..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/AuthHandlerTest.php +++ /dev/null @@ -1,156 +0,0 @@ -_agent = $this->_mock('Swift_Transport_SmtpAgent'); - } - - public function testKeywordIsAuth() - { - $auth = $this->_createHandler(array()); - $this->assertEqual('AUTH', $auth->getHandledKeyword()); - } - - public function testUsernameCanBeSetAndFetched() - { - $auth = $this->_createHandler(array()); - $auth->setUsername('jack'); - $this->assertEqual('jack', $auth->getUsername()); - } - - public function testPasswordCanBeSetAndFetched() - { - $auth = $this->_createHandler(array()); - $auth->setPassword('pass'); - $this->assertEqual('pass', $auth->getPassword()); - } - - public function testAuthModeCanBeSetAndFetched() - { - $auth = $this->_createHandler(array()); - $auth->setAuthMode('PLAIN'); - $this->assertEqual('PLAIN', $auth->getAuthMode()); - } - - public function testMixinMethods() - { - $auth = $this->_createHandler(array()); - $mixins = $auth->exposeMixinMethods(); - $this->assertTrue(in_array('getUsername', $mixins), - '%s: getUsername() should be accessible via mixin' - ); - $this->assertTrue(in_array('setUsername', $mixins), - '%s: setUsername() should be accessible via mixin' - ); - $this->assertTrue(in_array('getPassword', $mixins), - '%s: getPassword() should be accessible via mixin' - ); - $this->assertTrue(in_array('setPassword', $mixins), - '%s: setPassword() should be accessible via mixin' - ); - $this->assertTrue(in_array('setAuthMode', $mixins), - '%s: setAuthMode() should be accessible via mixin' - ); - $this->assertTrue(in_array('getAuthMode', $mixins), - '%s: getAuthMode() should be accessible via mixin' - ); - } - - public function testAuthenticatorsAreCalledAccordingToParamsAfterEhlo() - { - $a1 = $this->_createMockAuthenticator('PLAIN'); - $a2 = $this->_createMockAuthenticator('LOGIN'); - - $this->_checking(Expectations::create() - -> never($a1)->authenticate($this->_agent, 'jack', 'pass') - -> one($a2)->authenticate($this->_agent, 'jack', 'pass') -> returns(true) - ); - - $auth = $this->_createHandler(array($a1, $a2)); - $auth->setUsername('jack'); - $auth->setPassword('pass'); - - $auth->setKeywordParams(array('CRAM-MD5', 'LOGIN')); - $auth->afterEhlo($this->_agent); - } - - public function testAuthenticatorsAreNotUsedIfNoUsernameSet() - { - $a1 = $this->_createMockAuthenticator('PLAIN'); - $a2 = $this->_createMockAuthenticator('LOGIN'); - - $this->_checking(Expectations::create() - -> never($a1)->authenticate($this->_agent, 'jack', 'pass') - -> never($a2)->authenticate($this->_agent, 'jack', 'pass') -> returns(true) - ); - - $auth = $this->_createHandler(array($a1, $a2)); - - $auth->setKeywordParams(array('CRAM-MD5', 'LOGIN')); - $auth->afterEhlo($this->_agent); - } - - public function testSeveralAuthenticatorsAreTriedIfNeeded() - { - $a1 = $this->_createMockAuthenticator('PLAIN'); - $a2 = $this->_createMockAuthenticator('LOGIN'); - - $this->_checking(Expectations::create() - -> one($a1)->authenticate($this->_agent, 'jack', 'pass') -> returns(false) - -> one($a2)->authenticate($this->_agent, 'jack', 'pass') -> returns(true) - ); - - $auth = $this->_createHandler(array($a1, $a2)); - $auth->setUsername('jack'); - $auth->setPassword('pass'); - - $auth->setKeywordParams(array('PLAIN', 'LOGIN')); - $auth->afterEhlo($this->_agent); - } - - public function testFirstAuthenticatorToPassBreaksChain() - { - $a1 = $this->_createMockAuthenticator('PLAIN'); - $a2 = $this->_createMockAuthenticator('LOGIN'); - $a3 = $this->_createMockAuthenticator('CRAM-MD5'); - - $this->_checking(Expectations::create() - -> one($a1)->authenticate($this->_agent, 'jack', 'pass') -> returns(false) - -> one($a2)->authenticate($this->_agent, 'jack', 'pass') -> returns(true) - -> never($a3)->authenticate($this->_agent, 'jack', 'pass') - ); - - $auth = $this->_createHandler(array($a1, $a2)); - $auth->setUsername('jack'); - $auth->setPassword('pass'); - - $auth->setKeywordParams(array('PLAIN', 'LOGIN', 'CRAM-MD5')); - $auth->afterEhlo($this->_agent); - } - - // -- Private helpers - - private function _createHandler($authenticators) - { - return new Swift_Transport_Esmtp_AuthHandler($authenticators); - } - - private function _createMockAuthenticator($type) - { - $authenticator = $this->_mock('Swift_Transport_Esmtp_Authenticator'); - $this->_checking(Expectations::create() - -> ignoring($authenticator)->getAuthKeyword() -> returns($type) - ); - return $authenticator; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransport/ExtensionSupportTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransport/ExtensionSupportTest.php deleted file mode 100644 index d4fb6fd..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransport/ExtensionSupportTest.php +++ /dev/null @@ -1,312 +0,0 @@ -_getBuffer(); - $smtp = $this->_getTransport($buf); - $ext1 = $this->_mock('Swift_Transport_EsmtpHandler'); - $ext2 = $this->_mock('Swift_Transport_EsmtpHandler'); - $this->_checking(Expectations::create() - -> allowing($ext1)->getHandledKeyword() -> returns('AUTH') - -> allowing($ext1)->getPriorityOver('STARTTLS') -> returns(0) - -> allowing($ext2)->getHandledKeyword() -> returns('STARTTLS') - -> allowing($ext2)->getPriorityOver('AUTH') -> returns(-1) - -> ignoring($ext1) - -> ignoring($ext2) - ); - $this->_finishBuffer($buf); - $smtp->setExtensionHandlers(array($ext1, $ext2)); - $this->assertEqual(array($ext2, $ext1), $smtp->getExtensionHandlers()); - } - - public function testHandlersAreNotifiedOfParams() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $ext1 = $this->_mock('Swift_Transport_EsmtpHandler'); - $ext2 = $this->_mock('Swift_Transport_EsmtpHandler'); - $s = $this->_sequence('Initiation-sequence'); - $this->_checking(Expectations::create() - -> one($buf)->readLine(0) -> inSequence($s) -> returns("220 server.com foo\r\n") - -> one($buf)->write(pattern('~^EHLO .*?\r\n$~D')) -> inSequence($s) -> returns(1) - -> one($buf)->readLine(1) -> inSequence($s) -> returns("250-ServerName.tld\r\n") - -> one($buf)->readLine(1) -> inSequence($s) -> returns("250-AUTH PLAIN LOGIN\r\n") - -> one($buf)->readLine(1) -> inSequence($s) -> returns("250 SIZE=123456\r\n") - - -> allowing($ext1)->getHandledKeyword() -> returns('AUTH') - -> one($ext1)->setKeywordParams(array('PLAIN', 'LOGIN')) - -> allowing($ext2)->getHandledKeyword() -> returns('SIZE') - -> allowing($ext2)->setKeywordParams(array('123456')) - -> ignoring($ext1) - -> ignoring($ext2) - ); - $this->_finishBuffer($buf); - $smtp->setExtensionHandlers(array($ext1, $ext2)); - $smtp->start(); - } - - public function testSupportedExtensionHandlersAreRunAfterEhlo() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $ext1 = $this->_mock('Swift_Transport_EsmtpHandler'); - $ext2 = $this->_mock('Swift_Transport_EsmtpHandler'); - $ext3 = $this->_mock('Swift_Transport_EsmtpHandler'); - $s = $this->_sequence('Initiation-sequence'); - $this->_checking(Expectations::create() - -> one($buf)->readLine(0) -> inSequence($s) -> returns("220 server.com foo\r\n") - -> one($buf)->write(pattern('~^EHLO .*?\r\n$~D')) -> inSequence($s) -> returns(1) - -> one($buf)->readLine(1) -> inSequence($s) -> returns("250-ServerName.tld\r\n") - -> one($buf)->readLine(1) -> inSequence($s) -> returns("250-AUTH PLAIN LOGIN\r\n") - -> one($buf)->readLine(1) -> inSequence($s) -> returns("250 SIZE=123456\r\n") - - -> allowing($ext1)->getHandledKeyword() -> returns('AUTH') - -> one($ext1)->afterEhlo($smtp) - -> allowing($ext2)->getHandledKeyword() -> returns('SIZE') - -> allowing($ext2)->afterEhlo($smtp) - -> allowing($ext3)->getHandledKeyword() -> returns('STARTTLS') - -> never($ext3)->afterEhlo(any()) - -> ignoring($ext1) - -> ignoring($ext2) - -> ignoring($ext3) - ); - $this->_finishBuffer($buf); - $smtp->setExtensionHandlers(array($ext1, $ext2, $ext3)); - $smtp->start(); - } - - public function testExtensionsCanModifyMailFromParams() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $ext1 = $this->_mock('Swift_Transport_EsmtpHandler'); - $ext2 = $this->_mock('Swift_Transport_EsmtpHandler'); - $ext3 = $this->_mock('Swift_Transport_EsmtpHandler'); - $message = $this->_createMessage(); - $s = $this->_sequence('Initiation-sequence'); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain'=>'Me')) - -> allowing($message)->getTo() -> returns(array('foo@bar'=>null)) - -> ignoring($message) - - -> one($buf)->readLine(0) -> inSequence($s) -> returns("220 server.com foo\r\n") - -> one($buf)->write(pattern('~^EHLO .*?\r\n$~D')) -> inSequence($s) -> returns(1) - -> one($buf)->readLine(1) -> inSequence($s) -> returns("250-ServerName.tld\r\n") - -> one($buf)->readLine(1) -> inSequence($s) -> returns("250-AUTH PLAIN LOGIN\r\n") - -> one($buf)->readLine(1) -> inSequence($s) -> returns("250 SIZE=123456\r\n") - -> one($buf)->write("MAIL FROM: FOO ZIP\r\n") -> inSequence($s) -> returns(2) - -> one($buf)->readLine(2) -> inSequence($s) -> returns("250 OK\r\n") - -> one($buf)->write("RCPT TO: \r\n") -> inSequence($s) -> returns(3) - -> one($buf)->readLine(3) -> inSequence($s) -> returns("250 OK\r\n") - - -> allowing($ext1)->getHandledKeyword() -> returns('AUTH') - -> one($ext1)->getMailParams() -> returns('FOO') - -> allowing($ext1)->getPriorityOver('AUTH') -> returns(-1) - -> allowing($ext2)->getHandledKeyword() -> returns('SIZE') - -> one($ext2)->getMailParams() -> returns('ZIP') - -> allowing($ext2)->getPriorityOver('AUTH') -> returns(1) - -> allowing($ext3)->getHandledKeyword() -> returns('STARTTLS') - -> never($ext3)->getMailParams() - -> ignoring($ext1) - -> ignoring($ext2) - -> ignoring($ext3) - ); - $this->_finishBuffer($buf); - $smtp->setExtensionHandlers(array($ext1, $ext2, $ext3)); - $smtp->start(); - $smtp->send($message); - } - - public function testExtensionsCanModifyRcptParams() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $ext1 = $this->_mock('Swift_Transport_EsmtpHandler'); - $ext2 = $this->_mock('Swift_Transport_EsmtpHandler'); - $ext3 = $this->_mock('Swift_Transport_EsmtpHandler'); - $message = $this->_createMessage(); - $s = $this->_sequence('Initiation-sequence'); - $this->_checking(Expectations::create() - -> allowing($message)->getFrom() -> returns(array('me@domain'=>'Me')) - -> allowing($message)->getTo() -> returns(array('foo@bar'=>null)) - -> ignoring($message) - - -> one($buf)->readLine(0) -> inSequence($s) -> returns("220 server.com foo\r\n") - -> one($buf)->write(pattern('~^EHLO .*?\r\n$~D')) -> inSequence($s) -> returns(1) - -> one($buf)->readLine(1) -> inSequence($s) -> returns("250-ServerName.tld\r\n") - -> one($buf)->readLine(1) -> inSequence($s) -> returns("250-AUTH PLAIN LOGIN\r\n") - -> one($buf)->readLine(1) -> inSequence($s) -> returns("250 SIZE=123456\r\n") - -> one($buf)->write("MAIL FROM: \r\n") -> inSequence($s) -> returns(2) - -> one($buf)->readLine(2) -> inSequence($s) -> returns("250 OK\r\n") - -> one($buf)->write("RCPT TO: FOO ZIP\r\n") -> inSequence($s) -> returns(3) - -> one($buf)->readLine(3) -> inSequence($s) -> returns("250 OK\r\n") - - -> allowing($ext1)->getHandledKeyword() -> returns('AUTH') - -> one($ext1)->getRcptParams() -> returns('FOO') - -> allowing($ext1)->getPriorityOver('AUTH') -> returns(-1) - -> allowing($ext2)->getHandledKeyword() -> returns('SIZE') - -> one($ext2)->getRcptParams() -> returns('ZIP') - -> allowing($ext2)->getPriorityOver('AUTH') -> returns(1) - -> allowing($ext3)->getHandledKeyword() -> returns('STARTTLS') - -> never($ext3)->getRcptParams() - -> ignoring($ext1) - -> ignoring($ext2) - -> ignoring($ext3) - ); - $this->_finishBuffer($buf); - $smtp->setExtensionHandlers(array($ext1, $ext2, $ext3)); - $smtp->start(); - $smtp->send($message); - } - - public function testExtensionsAreNotifiedOnCommand() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $ext1 = $this->_mock('Swift_Transport_EsmtpHandler'); - $ext2 = $this->_mock('Swift_Transport_EsmtpHandler'); - $ext3 = $this->_mock('Swift_Transport_EsmtpHandler'); - $s = $this->_sequence('Initiation-sequence'); - $this->_checking(Expectations::create() - -> one($buf)->readLine(0) -> inSequence($s) -> returns("220 server.com foo\r\n") - -> one($buf)->write(pattern('~^EHLO .*?\r\n$~D')) -> inSequence($s) -> returns(1) - -> one($buf)->readLine(1) -> inSequence($s) -> returns("250-ServerName.tld\r\n") - -> one($buf)->readLine(1) -> inSequence($s) -> returns("250-AUTH PLAIN LOGIN\r\n") - -> one($buf)->readLine(1) -> inSequence($s) -> returns("250 SIZE=123456\r\n") - -> one($buf)->write("FOO\r\n") -> inSequence($s) -> returns(2) - -> one($buf)->readLine(2) -> inSequence($s) -> returns("250 Cool\r\n") - - -> allowing($ext1)->getHandledKeyword() -> returns('AUTH') - -> one($ext1)->onCommand($smtp, "FOO\r\n", array(250, 251), optional()) - -> allowing($ext2)->getHandledKeyword() -> returns('SIZE') - -> one($ext2)->onCommand($smtp, "FOO\r\n", array(250, 251), optional()) - -> allowing($ext3)->getHandledKeyword() -> returns('STARTTLS') - -> never($ext3)->onCommand(any(), any(), any(), optional()) - -> ignoring($ext1) - -> ignoring($ext2) - -> ignoring($ext3) - ); - $this->_finishBuffer($buf); - $smtp->setExtensionHandlers(array($ext1, $ext2, $ext3)); - $smtp->start(); - $smtp->executeCommand("FOO\r\n", array(250, 251)); - } - - public function testChainOfCommandAlgorithmWhenNotifyingExtensions() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $ext1 = $this->_mock('Swift_Transport_EsmtpHandler'); - $ext2 = $this->_mock('Swift_Transport_EsmtpHandler'); - $ext3 = $this->_mock('Swift_Transport_EsmtpHandler'); - $s = $this->_sequence('Initiation-sequence'); - $this->_checking(Expectations::create() - -> one($buf)->readLine(0) -> inSequence($s) -> returns("220 server.com foo\r\n") - -> one($buf)->write(pattern('~^EHLO .*?\r\n$~D')) -> inSequence($s) -> returns(1) - -> one($buf)->readLine(1) -> inSequence($s) -> returns("250-ServerName.tld\r\n") - -> one($buf)->readLine(1) -> inSequence($s) -> returns("250-AUTH PLAIN LOGIN\r\n") - -> one($buf)->readLine(1) -> inSequence($s) -> returns("250 SIZE=123456\r\n") - -> never($buf)->write("FOO\r\n") - - -> allowing($ext1)->getHandledKeyword() -> returns('AUTH') - -> one($ext1)->onCommand($smtp, "FOO\r\n", array(250, 251), optional()) -> calls(array($this, 'cbStopCommand')) - -> allowing($ext2)->getHandledKeyword() -> returns('SIZE') - -> never($ext2)->onCommand(any(), any(), any(), optional()) - -> allowing($ext3)->getHandledKeyword() -> returns('STARTTLS') - -> never($ext3)->onCommand(any(), any(), any(), optional()) - -> ignoring($ext1) - -> ignoring($ext2) - -> ignoring($ext3) - ); - $this->_finishBuffer($buf); - $smtp->setExtensionHandlers(array($ext1, $ext2, $ext3)); - $smtp->start(); - $smtp->executeCommand("FOO\r\n", array(250, 251)); - } - - public function cbStopCommand(Yay_Invocation $invocation) - { - $args =& $invocation->getArguments(); - $stop =& $args[4]; - $stop = true; - return "250 ok"; - } - - public function testExtensionsCanExposeMixinMethods() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $ext1 = $this->_mock('Swift_Transport_EsmtpHandlerMixin'); - $ext2 = $this->_mock('Swift_Transport_EsmtpHandler'); - $this->_checking(Expectations::create() - -> allowing($ext1)->getHandledKeyword() -> returns('AUTH') - -> allowing($ext1)->exposeMixinMethods() -> returns(array('setUsername', 'setPassword')) - -> one($ext1)->setUsername('mick') - -> one($ext1)->setPassword('pass') - -> allowing($ext2)->getHandledKeyword() -> returns('STARTTLS') - -> ignoring($ext1) - -> ignoring($ext2) - ); - $this->_finishBuffer($buf); - $smtp->setExtensionHandlers(array($ext1, $ext2)); - $smtp->setUsername('mick'); - $smtp->setPassword('pass'); - } - - public function testMixinMethodsBeginningWithSetAndNullReturnAreFluid() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $ext1 = $this->_mock('Swift_Transport_EsmtpHandlerMixin'); - $ext2 = $this->_mock('Swift_Transport_EsmtpHandler'); - $this->_checking(Expectations::create() - -> allowing($ext1)->getHandledKeyword() -> returns('AUTH') - -> allowing($ext1)->exposeMixinMethods() -> returns(array('setUsername', 'setPassword')) - -> one($ext1)->setUsername('mick') -> returns(NULL) - -> one($ext1)->setPassword('pass') -> returns(NULL) - -> allowing($ext2)->getHandledKeyword() -> returns('STARTTLS') - -> ignoring($ext1) - -> ignoring($ext2) - ); - $this->_finishBuffer($buf); - $smtp->setExtensionHandlers(array($ext1, $ext2)); - $ret = $smtp->setUsername('mick'); - $this->assertReference($smtp, $ret); - $ret = $smtp->setPassword('pass'); - $this->assertReference($smtp, $ret); - } - - public function testMixinSetterWhichReturnValuesAreNotFluid() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $ext1 = $this->_mock('Swift_Transport_EsmtpHandlerMixin'); - $ext2 = $this->_mock('Swift_Transport_EsmtpHandler'); - $this->_checking(Expectations::create() - -> allowing($ext1)->getHandledKeyword() -> returns('AUTH') - -> allowing($ext1)->exposeMixinMethods() -> returns(array('setUsername', 'setPassword')) - -> one($ext1)->setUsername('mick') -> returns('x') - -> one($ext1)->setPassword('pass') -> returns('x') - -> allowing($ext2)->getHandledKeyword() -> returns('STARTTLS') - -> ignoring($ext1) - -> ignoring($ext2) - ); - $this->_finishBuffer($buf); - $smtp->setExtensionHandlers(array($ext1, $ext2)); - $this->assertEqual('x', $smtp->setUsername('mick')); - $this->assertEqual('x', $smtp->setPassword('pass')); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransportTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransportTest.php deleted file mode 100644 index 6987907..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransportTest.php +++ /dev/null @@ -1,234 +0,0 @@ -_createEventDispatcher(); - } - return new Swift_Transport_EsmtpTransport($buf, array(), $dispatcher); - } - - public function testHostCanBeSetAndFetched() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $smtp->setHost('foo'); - $this->assertEqual('foo', $smtp->getHost(), '%s: Host should be returned'); - } - - public function testPortCanBeSetAndFetched() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $smtp->setPort(25); - $this->assertEqual(25, $smtp->getPort(), '%s: Port should be returned'); - } - - public function testTimeoutCanBeSetAndFetched() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $this->_checking(Expectations::create() - -> one($buf)->setParam('timeout', 10)); - $smtp->setTimeout(10); - $this->assertEqual(10, $smtp->getTimeout(), '%s: Timeout should be returned'); - } - - public function testEncryptionCanBeSetAndFetched() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $smtp->setEncryption('tls'); - $this->assertEqual('tls', $smtp->getEncryption(), '%s: Crypto should be returned'); - } - - public function testStartSendsHeloToInitiate() - {//Overridden for EHLO instead - } - - public function testStartSendsEhloToInitiate() - { - /* -- RFC 2821, 3.2. - - 3.2 Client Initiation - - Once the server has sent the welcoming message and the client has - received it, the client normally sends the EHLO command to the - server, indicating the client's identity. In addition to opening the - session, use of EHLO indicates that the client is able to process - service extensions and requests that the server provide a list of the - extensions it supports. Older SMTP systems which are unable to - support service extensions and contemporary clients which do not - require service extensions in the mail session being initiated, MAY - use HELO instead of EHLO. Servers MUST NOT return the extended - EHLO-style response to a HELO command. For a particular connection - attempt, if the server returns a "command not recognized" response to - EHLO, the client SHOULD be able to fall back and send HELO. - - In the EHLO command the host sending the command identifies itself; - the command may be interpreted as saying "Hello, I am " (and, - in the case of EHLO, "and I support service extension requests"). - - -- RFC 2281, 4.1.1.1. - - ehlo = "EHLO" SP Domain CRLF - helo = "HELO" SP Domain CRLF - - -- RFC 2821, 4.3.2. - - EHLO or HELO - S: 250 - E: 504, 550 - - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $s = $this->_sequence('SMTP-convo'); - $this->_checking(Expectations::create() - -> one($buf)->initialize() -> inSequence($s) - -> one($buf)->readLine(0) -> inSequence($s) -> returns("220 some.server.tld bleh\r\n") - -> one($buf)->write(pattern('~^EHLO .+?\r\n$~D')) -> inSequence($s) -> returns(1) - -> one($buf)->readLine(1) -> inSequence($s) -> returns('250 ServerName' . "\r\n") - ); - $this->_finishBuffer($buf); - try { - $smtp->start(); - } catch (Exception $e) { - $this->fail('Starting Esmtp should send EHLO and accept 250 response'); - } - } - - public function testHeloIsUsedAsFallback() - { - /* -- RFC 2821, 4.1.4. - - If the EHLO command is not acceptable to the SMTP server, 501, 500, - or 502 failure replies MUST be returned as appropriate. The SMTP - server MUST stay in the same state after transmitting these replies - that it was in before the EHLO was received. - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $s = $this->_sequence('SMTP-convo'); - $this->_checking(Expectations::create() - -> one($buf)->initialize() -> inSequence($s) - -> one($buf)->readLine(0) -> inSequence($s) -> returns("220 some.server.tld bleh\r\n") - -> one($buf)->write(pattern('~^EHLO .+?\r\n$~D')) -> inSequence($s) -> returns(1) - -> one($buf)->readLine(1) -> inSequence($s) -> returns('501 WTF' . "\r\n") - -> one($buf)->write(pattern('~^HELO .+?\r\n$~D')) -> inSequence($s) -> returns(2) - -> one($buf)->readLine(2) -> inSequence($s) -> returns('250 HELO' . "\r\n") - ); - $this->_finishBuffer($buf); - try { - $smtp->start(); - } catch (Exception $e) { - $this->fail( - 'Starting Esmtp should fallback to HELO if needed and accept 250 response' - ); - } - } - - public function testInvalidHeloResponseCausesException() - {//Overridden to first try EHLO - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $s = $this->_sequence('SMTP-convo'); - $this->_checking(Expectations::create() - -> one($buf)->initialize() -> inSequence($s) - -> one($buf)->readLine(0) -> inSequence($s) -> returns("220 some.server.tld bleh\r\n") - -> one($buf)->write(pattern('~^EHLO .*?\r\n$~D')) -> inSequence($s) -> returns(1) - -> one($buf)->readLine(1) -> inSequence($s) -> returns('501 WTF' . "\r\n") - -> one($buf)->write(pattern('~^HELO .*?\r\n$~D')) -> inSequence($s) -> returns(2) - -> one($buf)->readLine(2) -> inSequence($s) -> returns('504 WTF' . "\r\n") - ); - $this->_finishBuffer($buf); - try { - $this->assertFalse($smtp->isStarted(), '%s: SMTP should begin non-started'); - $smtp->start(); - $this->fail('Non 250 HELO response should raise Exception'); - } catch (Exception $e) { - $this->assertFalse($smtp->isStarted(), '%s: SMTP start() should have failed'); - } - } - - public function testDomainNameIsPlacedInEhlo() - { - /* -- RFC 2821, 4.1.4. - - The SMTP client MUST, if possible, ensure that the domain parameter - to the EHLO command is a valid principal host name (not a CNAME or MX - name) for its host. If this is not possible (e.g., when the client's - address is dynamically assigned and the client does not have an - obvious name), an address literal SHOULD be substituted for the - domain name and supplemental information provided that will assist in - identifying the client. - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $s = $this->_sequence('SMTP-convo'); - $this->_checking(Expectations::create() - -> one($buf)->initialize() -> inSequence($s) - -> one($buf)->readLine(0) -> inSequence($s) -> returns("220 some.server.tld bleh\r\n") - -> one($buf)->write("EHLO mydomain.com\r\n") -> inSequence($s) -> returns(1) - -> one($buf)->readLine(1) -> inSequence($s) -> returns('250 ServerName' . "\r\n") - ); - $this->_finishBuffer($buf); - $smtp->setLocalDomain('mydomain.com'); - $smtp->start(); - } - - public function testDomainNameIsPlacedInHelo() - { //Overridden to include ESMTP - /* -- RFC 2821, 4.1.4. - - The SMTP client MUST, if possible, ensure that the domain parameter - to the EHLO command is a valid principal host name (not a CNAME or MX - name) for its host. If this is not possible (e.g., when the client's - address is dynamically assigned and the client does not have an - obvious name), an address literal SHOULD be substituted for the - domain name and supplemental information provided that will assist in - identifying the client. - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $s = $this->_sequence('SMTP-convo'); - $this->_checking(Expectations::create() - -> one($buf)->initialize() -> inSequence($s) - -> one($buf)->readLine(0) -> inSequence($s) -> returns("220 some.server.tld bleh\r\n") - -> one($buf)->write(pattern('~^EHLO .+?\r\n$~D')) -> inSequence($s) -> returns(1) - -> one($buf)->readLine(1) -> inSequence($s) -> returns('501 WTF' . "\r\n") - -> one($buf)->write("HELO mydomain.com\r\n") -> inSequence($s) -> returns(2) - -> one($buf)->readLine(2) -> inSequence($s) -> returns('250 ServerName' . "\r\n") - ); - $this->_finishBuffer($buf); - $smtp->setLocalDomain('mydomain.com'); - $smtp->start(); - } - - public function testFluidInterface() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $this->_checking(Expectations::create() - -> one($buf)->setParam('timeout', 30)); - - $ref = $smtp - ->setHost('foo') - ->setPort(25) - ->setEncryption('tls') - ->setTimeout(30) - ; - $this->assertReference($ref, $smtp); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/FailoverTransportTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/FailoverTransportTest.php deleted file mode 100644 index bd4ddf1..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/FailoverTransportTest.php +++ /dev/null @@ -1,334 +0,0 @@ -mock('Swift_Mime_Message'); - $message2 = $context->mock('Swift_Mime_Message'); - $t1 = $context->mock('Swift_Transport'); - $t2 = $context->mock('Swift_Transport'); - $con = $context->states('Connection')->startsAs('off'); - $context->checking(Expectations::create() - -> ignoring($message1) - -> ignoring($message2) - -> allowing($t1)->isStarted() -> returns(false) -> when($con->is('off')) - -> allowing($t1)->isStarted() -> returns(true) -> when($con->is('on')) - -> one($t1)->start() -> when($con->isNot('on')) -> then($con->is('on')) - -> one($t1)->send($message1, optional()) -> returns(1) -> when($con->is('on')) - -> one($t1)->send($message2, optional()) -> returns(1) -> when($con->is('on')) - -> ignoring($t1) - -> never($t2)->start() - -> never($t2)->send(any(), optional()) - -> ignoring($t2) - ); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertEqual(1, $transport->send($message1)); - $this->assertEqual(1, $transport->send($message2)); - $context->assertIsSatisfied(); - } - - public function testMessageCanBeTriedOnNextTransportIfExceptionThrown() - { - $e = new Swift_TransportException('b0rken'); - - $context = new Mockery(); - $message = $context->mock('Swift_Mime_Message'); - $t1 = $context->mock('Swift_Transport'); - $t2 = $context->mock('Swift_Transport'); - $con1 = $context->states('Connection')->startsAs('off'); - $con2 = $context->states('Connection')->startsAs('off'); - $context->checking(Expectations::create() - -> ignoring($message) - -> allowing($t1)->isStarted() -> returns(false) -> when($con1->is('off')) - -> allowing($t1)->isStarted() -> returns(true) -> when($con1->is('on')) - -> one($t1)->start() -> when($con1->isNot('on')) -> then($con1->is('on')) - -> one($t1)->send($message, optional()) -> throws($e) -> when($con1->is('on')) - -> ignoring($t1) - -> allowing($t2)->isStarted() -> returns(false) -> when($con2->is('off')) - -> allowing($t2)->isStarted() -> returns(true) -> when($con2->is('on')) - -> one($t2)->start() -> when($con2->isNot('on')) -> then($con2->is('on')) - -> one($t2)->send($message, optional()) -> returns(1) -> when($con2->is('on')) - -> ignoring($t2) - ); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertEqual(1, $transport->send($message)); - $context->assertIsSatisfied(); - } - - public function testZeroIsReturnedIfTransportReturnsZero() - { - $context = new Mockery(); - $message = $context->mock('Swift_Mime_Message'); - $t1 = $context->mock('Swift_Transport'); - $con = $context->states('Connection')->startsAs('off'); - $context->checking(Expectations::create() - -> ignoring($message) - -> allowing($t1)->isStarted() -> returns(false) -> when($con->is('off')) - -> allowing($t1)->isStarted() -> returns(true) -> when($con->is('on')) - -> one($t1)->start() -> when($con->isNot('on')) -> then($con->is('on')) - -> one($t1)->send($message, optional()) -> returns(0) -> when($con->is('on')) - -> ignoring($t1) - ); - - $transport = $this->_getTransport(array($t1)); - $transport->start(); - $this->assertEqual(0, $transport->send($message)); - $context->assertIsSatisfied(); - } - - public function testTransportsWhichThrowExceptionsAreNotRetried() - { - $e = new Swift_TransportException('maur b0rken'); - - $context = new Mockery(); - $message1 = $context->mock('Swift_Mime_Message'); - $message2 = $context->mock('Swift_Mime_Message'); - $message3 = $context->mock('Swift_Mime_Message'); - $message4 = $context->mock('Swift_Mime_Message'); - $t1 = $context->mock('Swift_Transport'); - $t2 = $context->mock('Swift_Transport'); - $con1 = $context->states('Connection')->startsAs('off'); - $con2 = $context->states('Connection')->startsAs('off'); - $context->checking(Expectations::create() - -> ignoring($message1) - -> ignoring($message2) - -> ignoring($message3) - -> ignoring($message4) - -> allowing($t1)->isStarted() -> returns(false) -> when($con1->is('off')) - -> allowing($t1)->isStarted() -> returns(true) -> when($con1->is('on')) - -> one($t1)->start() -> when($con1->isNot('on')) -> then($con1->is('on')) - -> one($t1)->send($message1, optional()) -> throws($e) -> when($con1->is('on')) - -> never($t1)->send($message2, optional()) - -> never($t1)->send($message3, optional()) - -> never($t1)->send($message4, optional()) - -> ignoring($t1) - -> allowing($t2)->isStarted() -> returns(false) -> when($con2->is('off')) - -> allowing($t2)->isStarted() -> returns(true) -> when($con2->is('on')) - -> one($t2)->start() -> when($con2->isNot('on')) -> then($con2->is('on')) - -> one($t2)->send($message1, optional()) -> returns(1) -> when($con2->is('on')) - -> one($t2)->send($message2, optional()) -> returns(1) -> when($con2->is('on')) - -> one($t2)->send($message3, optional()) -> returns(1) -> when($con2->is('on')) - -> one($t2)->send($message4, optional()) -> returns(1) -> when($con2->is('on')) - -> ignoring($t2) - ); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertEqual(1, $transport->send($message1)); - $this->assertEqual(1, $transport->send($message2)); - $this->assertEqual(1, $transport->send($message3)); - $this->assertEqual(1, $transport->send($message4)); - } - - public function testExceptionIsThrownIfAllTransportsDie() - { - $e = new Swift_TransportException('b0rken'); - - $context = new Mockery(); - $message = $context->mock('Swift_Mime_Message'); - $t1 = $context->mock('Swift_Transport'); - $t2 = $context->mock('Swift_Transport'); - $con1 = $context->states('Connection')->startsAs('off'); - $con2 = $context->states('Connection')->startsAs('off'); - $context->checking(Expectations::create() - -> ignoring($message) - -> allowing($t1)->isStarted() -> returns(false) -> when($con1->is('off')) - -> allowing($t1)->isStarted() -> returns(true) -> when($con1->is('on')) - -> one($t1)->start() -> when($con1->isNot('on')) -> then($con1->is('on')) - -> one($t1)->send($message, optional()) -> throws($e) -> when($con1->is('on')) - -> ignoring($t1) - -> allowing($t2)->isStarted() -> returns(false) -> when($con2->is('off')) - -> allowing($t2)->isStarted() -> returns(true) -> when($con2->is('on')) - -> one($t2)->start() -> when($con2->isNot('on')) -> then($con2->is('on')) - -> one($t2)->send($message, optional()) -> throws($e) -> when($con2->is('on')) - -> ignoring($t2) - ); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - try { - $transport->send($message); - $this->fail('All transports failed so Exception should be thrown'); - } catch (Exception $e) { - } - $context->assertIsSatisfied(); - } - - public function testStoppingTransportStopsAllDelegates() - { - $context = new Mockery(); - $t1 = $context->mock('Swift_Transport'); - $t2 = $context->mock('Swift_Transport'); - $con1 = $context->states('Connection')->startsAs('on'); - $con2 = $context->states('Connection')->startsAs('on'); - $context->checking(Expectations::create() - -> allowing($t1)->isStarted() -> returns(true) -> when($con1->is('on')) - -> one($t1)->stop() -> when($con1->is('on')) -> then($con1->is('off')) - -> ignoring($t1) - -> allowing($t2)->isStarted() -> returns(true) -> when($con2->is('on')) - -> one($t2)->stop() -> when($con2->is('on')) -> then($con2->is('off')) - -> ignoring($t2) - ); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $transport->stop(); - $context->assertIsSatisfied(); - } - - public function testTransportShowsAsNotStartedIfAllDelegatesDead() - { - $e = new Swift_TransportException('b0rken'); - - $context = new Mockery(); - $message = $context->mock('Swift_Mime_Message'); - $t1 = $context->mock('Swift_Transport'); - $t2 = $context->mock('Swift_Transport'); - $con1 = $context->states('Connection')->startsAs('off'); - $con2 = $context->states('Connection')->startsAs('off'); - $context->checking(Expectations::create() - -> ignoring($message) - -> allowing($t1)->isStarted() -> returns(false) -> when($con1->is('off')) - -> allowing($t1)->isStarted() -> returns(true) -> when($con1->is('on')) - -> one($t1)->start() -> when($con1->isNot('on')) -> then($con1->is('on')) - -> one($t1)->send($message, optional()) -> throws($e) -> when($con1->is('on')) - -> ignoring($t1) - -> allowing($t2)->isStarted() -> returns(false) -> when($con2->is('off')) - -> allowing($t2)->isStarted() -> returns(true) -> when($con2->is('on')) - -> one($t2)->start() -> when($con2->isNot('on')) -> then($con2->is('on')) - -> one($t2)->send($message, optional()) -> throws($e) -> when($con2->is('on')) - -> ignoring($t2) - ); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertTrue($transport->isStarted()); - try { - $transport->send($message); - $this->fail('All transports failed so Exception should be thrown'); - } catch (Exception $e) { - $this->assertFalse($transport->isStarted()); - } - $context->assertIsSatisfied(); - } - - public function testRestartingTransportRestartsDeadDelegates() - { - $e = new Swift_TransportException('b0rken'); - - $context = new Mockery(); - $message1 = $context->mock('Swift_Mime_Message'); - $message2 = $context->mock('Swift_Mime_Message'); - $t1 = $context->mock('Swift_Transport'); - $t2 = $context->mock('Swift_Transport'); - $con1 = $context->states('Connection')->startsAs('off'); - $con2 = $context->states('Connection')->startsAs('off'); - $context->checking(Expectations::create() - -> ignoring($message1) - -> ignoring($message2) - -> allowing($t1)->isStarted() -> returns(false) -> when($con1->is('off')) - -> allowing($t1)->isStarted() -> returns(true) -> when($con1->is('on')) - -> exactly(2)->of($t1)->start() -> when($con1->isNot('on')) -> then($con1->is('on')) - -> one($t1)->send($message1, optional()) -> throws($e) -> when($con1->is('on')) -> then($con1->is('off')) - -> one($t1)->send($message2, optional()) -> returns(10) -> when($con1->is('on')) - -> ignoring($t1) - -> allowing($t2)->isStarted() -> returns(false) -> when($con2->is('off')) - -> allowing($t2)->isStarted() -> returns(true) -> when($con2->is('on')) - -> one($t2)->start() -> when($con2->isNot('on')) -> then($con2->is('on')) - -> one($t2)->send($message1, optional()) -> throws($e) -> when($con2->is('on')) - -> never($t2)->send($message2, optional()) - -> ignoring($t2) - ); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertTrue($transport->isStarted()); - try { - $transport->send($message1); - $this->fail('All transports failed so Exception should be thrown'); - } catch (Exception $e) { - $this->assertFalse($transport->isStarted()); - } - //Restart and re-try - $transport->start(); - $this->assertTrue($transport->isStarted()); - $this->assertEqual(10, $transport->send($message2)); - $context->assertIsSatisfied(); - } - - public function testFailureReferenceIsPassedToDelegates() - { - $failures = array(); - - $context = new Mockery(); - $message = $context->mock('Swift_Mime_Message'); - $t1 = $context->mock('Swift_Transport'); - $con = $context->states('Connection')->startsAs('off'); - $context->checking(Expectations::create() - -> ignoring($message) - -> allowing($t1)->isStarted() -> returns(false) -> when($con->is('off')) - -> allowing($t1)->isStarted() -> returns(true) -> when($con->is('on')) - -> one($t1)->start() -> when($con->isNot('on')) -> then($con->is('on')) - -> one($t1)->send($message, reference($failures)) -> returns(1) -> when($con->is('on')) - -> ignoring($t1) - ); - - $transport = $this->_getTransport(array($t1)); - $transport->start(); - $transport->send($message, $failures); - $context->assertIsSatisfied(); - } - - public function testRegisterPluginDelegatesToLoadedTransports() - { - $context = new Mockery(); - - $plugin = $this->_createPlugin($context); - - $t1 = $context->mock('Swift_Transport'); - $t2 = $context->mock('Swift_Transport'); - $context->checking(Expectations::create() - -> one($t1)->registerPlugin($plugin) - -> one($t2)->registerPlugin($plugin) - -> ignoring($t1) - -> ignoring($t2) - ); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->registerPlugin($plugin); - - $context->assertIsSatisfied(); - } - - // -- Private helpers - - private function _getTransport(array $transports) - { - $transport = new Swift_Transport_FailoverTransport(); - $transport->setTransports($transports); - return $transport; - } - - private function _createPlugin($context) - { - return $context->mock('Swift_Events_EventListener'); - } - - private function _createInnerTransport() - { - return $this->_mockery()->mock('Swift_Transport'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/LoadBalancedTransportTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/LoadBalancedTransportTest.php deleted file mode 100644 index d0cffff..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/LoadBalancedTransportTest.php +++ /dev/null @@ -1,418 +0,0 @@ -mock('Swift_Mime_Message'); - $message2 = $context->mock('Swift_Mime_Message'); - $t1 = $context->mock('Swift_Transport'); - $t2 = $context->mock('Swift_Transport'); - $con1 = $context->states('Connection 1')->startsAs('off'); - $con2 = $context->states('Connection 2')->startsAs('off'); - $context->checking(Expectations::create() - -> ignoring($message1) - -> ignoring($message2) - -> allowing($t1)->isStarted() -> returns(false) -> when($con1->is('off')) - -> allowing($t1)->isStarted() -> returns(true) -> when($con1->is('on')) - -> allowing($t1)->start() -> when($con1->is('off')) -> then($con1->is('on')) - -> one($t1)->send($message1, optional()) -> returns(1) -> when($con1->is('on')) - -> never($t1)->send($message2, optional()) - -> ignoring($t1) - -> allowing($t2)->isStarted() -> returns(false) -> when($con2->is('off')) - -> allowing($t2)->isStarted() -> returns(true) -> when($con2->is('on')) - -> allowing($t2)->start() -> when($con2->is('off')) -> then($con2->is('on')) - -> one($t2)->send($message2, optional()) -> returns(1) -> when($con2->is('on')) - -> never($t2)->send($message1, optional()) - -> ignoring($t2) - ); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertEqual(1, $transport->send($message1)); - $this->assertEqual(1, $transport->send($message2)); - - $context->assertIsSatisfied(); - } - - public function testTransportsAreReusedInRotatingFashion() - { - $context = new Mockery(); - $message1 = $context->mock('Swift_Mime_Message'); - $message2 = $context->mock('Swift_Mime_Message'); - $message3 = $context->mock('Swift_Mime_Message'); - $message4 = $context->mock('Swift_Mime_Message'); - $t1 = $context->mock('Swift_Transport'); - $t2 = $context->mock('Swift_Transport'); - $con1 = $context->states('Connection 1')->startsAs('off'); - $con2 = $context->states('Connection 2')->startsAs('off'); - $context->checking(Expectations::create() - -> ignoring($message1) - -> ignoring($message2) - -> allowing($t1)->isStarted() -> returns(false) -> when($con1->is('off')) - -> allowing($t1)->isStarted() -> returns(true) -> when($con1->is('on')) - -> allowing($t1)->start() -> when($con1->is('off')) -> then($con1->is('on')) - -> one($t1)->send($message1, optional()) -> returns(1) -> when($con1->is('on')) - -> never($t1)->send($message2, optional()) - -> one($t1)->send($message3, optional()) -> returns(1) -> when($con1->is('on')) - -> never($t1)->send($message4, optional()) - -> ignoring($t1) - -> allowing($t2)->isStarted() -> returns(false) -> when($con2->is('off')) - -> allowing($t2)->isStarted() -> returns(true) -> when($con2->is('on')) - -> allowing($t2)->start() -> when($con2->is('off')) -> then($con2->is('on')) - -> one($t2)->send($message2, optional()) -> returns(1) -> when($con2->is('on')) - -> never($t2)->send($message1, optional()) - -> one($t2)->send($message4, optional()) -> returns(1) -> when($con2->is('on')) - -> never($t2)->send($message3, optional()) - -> ignoring($t2) - ); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - - $this->assertEqual(1, $transport->send($message1)); - $this->assertEqual(1, $transport->send($message2)); - $this->assertEqual(1, $transport->send($message3)); - $this->assertEqual(1, $transport->send($message4)); - - $context->assertIsSatisfied(); - } - - public function testMessageCanBeTriedOnNextTransportIfExceptionThrown() - { - $e = new Swift_TransportException('b0rken'); - - $context = new Mockery(); - $message = $context->mock('Swift_Mime_Message'); - $t1 = $context->mock('Swift_Transport'); - $t2 = $context->mock('Swift_Transport'); - $con1 = $context->states('Connection')->startsAs('off'); - $con2 = $context->states('Connection')->startsAs('off'); - $context->checking(Expectations::create() - -> ignoring($message) - -> allowing($t1)->isStarted() -> returns(false) -> when($con1->is('off')) - -> allowing($t1)->isStarted() -> returns(true) -> when($con1->is('on')) - -> one($t1)->start() -> when($con1->isNot('on')) -> then($con1->is('on')) - -> one($t1)->send($message, optional()) -> throws($e) -> when($con1->is('on')) - -> ignoring($t1) - -> allowing($t2)->isStarted() -> returns(false) -> when($con2->is('off')) - -> allowing($t2)->isStarted() -> returns(true) -> when($con2->is('on')) - -> one($t2)->start() -> when($con2->isNot('on')) -> then($con2->is('on')) - -> one($t2)->send($message, optional()) -> returns(1) -> when($con2->is('on')) - -> ignoring($t2) - ); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertEqual(1, $transport->send($message)); - $context->assertIsSatisfied(); - } - - public function testMessageIsTriedOnNextTransportIfZeroReturned() - { - $context = new Mockery(); - $message = $context->mock('Swift_Mime_Message'); - $t1 = $context->mock('Swift_Transport'); - $t2 = $context->mock('Swift_Transport'); - $con1 = $context->states('Connection')->startsAs('off'); - $con2 = $context->states('Connection')->startsAs('off'); - $context->checking(Expectations::create() - -> ignoring($message) - -> allowing($t1)->isStarted() -> returns(false) -> when($con1->is('off')) - -> allowing($t1)->isStarted() -> returns(true) -> when($con1->is('on')) - -> one($t1)->start() -> when($con1->isNot('on')) -> then($con1->is('on')) - -> one($t1)->send($message, optional()) -> returns(0) -> when($con1->is('on')) - -> ignoring($t1) - -> allowing($t2)->isStarted() -> returns(false) -> when($con2->is('off')) - -> allowing($t2)->isStarted() -> returns(true) -> when($con2->is('on')) - -> one($t2)->start() -> when($con2->isNot('on')) -> then($con2->is('on')) - -> one($t2)->send($message, optional()) -> returns(1) -> when($con2->is('on')) - -> ignoring($t2) - ); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertEqual(1, $transport->send($message)); - $context->assertIsSatisfied(); - } - - public function testZeroIsReturnedIfAllTransportsReturnZero() - { - $context = new Mockery(); - $message = $context->mock('Swift_Mime_Message'); - $t1 = $context->mock('Swift_Transport'); - $t2 = $context->mock('Swift_Transport'); - $con1 = $context->states('Connection')->startsAs('off'); - $con2 = $context->states('Connection')->startsAs('off'); - $context->checking(Expectations::create() - -> ignoring($message) - -> allowing($t1)->isStarted() -> returns(false) -> when($con1->is('off')) - -> allowing($t1)->isStarted() -> returns(true) -> when($con1->is('on')) - -> one($t1)->start() -> when($con1->isNot('on')) -> then($con1->is('on')) - -> one($t1)->send($message, optional()) -> returns(0) -> when($con1->is('on')) - -> ignoring($t1) - -> allowing($t2)->isStarted() -> returns(false) -> when($con2->is('off')) - -> allowing($t2)->isStarted() -> returns(true) -> when($con2->is('on')) - -> one($t2)->start() -> when($con2->isNot('on')) -> then($con2->is('on')) - -> one($t2)->send($message, optional()) -> returns(0) -> when($con2->is('on')) - -> ignoring($t2) - ); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertEqual(0, $transport->send($message)); - $context->assertIsSatisfied(); - } - - public function testTransportsWhichThrowExceptionsAreNotRetried() - { - $e = new Swift_TransportException('maur b0rken'); - - $context = new Mockery(); - $message1 = $context->mock('Swift_Mime_Message'); - $message2 = $context->mock('Swift_Mime_Message'); - $message3 = $context->mock('Swift_Mime_Message'); - $message4 = $context->mock('Swift_Mime_Message'); - $t1 = $context->mock('Swift_Transport'); - $t2 = $context->mock('Swift_Transport'); - $con1 = $context->states('Connection')->startsAs('off'); - $con2 = $context->states('Connection')->startsAs('off'); - $context->checking(Expectations::create() - -> ignoring($message1) - -> ignoring($message2) - -> ignoring($message3) - -> ignoring($message4) - -> allowing($t1)->isStarted() -> returns(false) -> when($con1->is('off')) - -> allowing($t1)->isStarted() -> returns(true) -> when($con1->is('on')) - -> one($t1)->start() -> when($con1->isNot('on')) -> then($con1->is('on')) - -> one($t1)->send($message1, optional()) -> throws($e) -> when($con1->is('on')) - -> never($t1)->send($message2, optional()) - -> never($t1)->send($message3, optional()) - -> never($t1)->send($message4, optional()) - -> ignoring($t1) - -> allowing($t2)->isStarted() -> returns(false) -> when($con2->is('off')) - -> allowing($t2)->isStarted() -> returns(true) -> when($con2->is('on')) - -> one($t2)->start() -> when($con2->isNot('on')) -> then($con2->is('on')) - -> one($t2)->send($message1, optional()) -> returns(1) -> when($con2->is('on')) - -> one($t2)->send($message2, optional()) -> returns(1) -> when($con2->is('on')) - -> one($t2)->send($message3, optional()) -> returns(1) -> when($con2->is('on')) - -> one($t2)->send($message4, optional()) -> returns(1) -> when($con2->is('on')) - -> ignoring($t2) - ); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertEqual(1, $transport->send($message1)); - $this->assertEqual(1, $transport->send($message2)); - $this->assertEqual(1, $transport->send($message3)); - $this->assertEqual(1, $transport->send($message4)); - } - - public function testExceptionIsThrownIfAllTransportsDie() - { - $e = new Swift_TransportException('b0rken'); - - $context = new Mockery(); - $message = $context->mock('Swift_Mime_Message'); - $t1 = $context->mock('Swift_Transport'); - $t2 = $context->mock('Swift_Transport'); - $con1 = $context->states('Connection')->startsAs('off'); - $con2 = $context->states('Connection')->startsAs('off'); - $context->checking(Expectations::create() - -> ignoring($message) - -> allowing($t1)->isStarted() -> returns(false) -> when($con1->is('off')) - -> allowing($t1)->isStarted() -> returns(true) -> when($con1->is('on')) - -> one($t1)->start() -> when($con1->isNot('on')) -> then($con1->is('on')) - -> one($t1)->send($message, optional()) -> throws($e) -> when($con1->is('on')) - -> ignoring($t1) - -> allowing($t2)->isStarted() -> returns(false) -> when($con2->is('off')) - -> allowing($t2)->isStarted() -> returns(true) -> when($con2->is('on')) - -> one($t2)->start() -> when($con2->isNot('on')) -> then($con2->is('on')) - -> one($t2)->send($message, optional()) -> throws($e) -> when($con2->is('on')) - -> ignoring($t2) - ); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - try { - $transport->send($message); - $this->fail('All transports failed so Exception should be thrown'); - } catch (Exception $e) { - } - $context->assertIsSatisfied(); - } - - public function testStoppingTransportStopsAllDelegates() - { - $context = new Mockery(); - $t1 = $context->mock('Swift_Transport'); - $t2 = $context->mock('Swift_Transport'); - $con1 = $context->states('Connection')->startsAs('on'); - $con2 = $context->states('Connection')->startsAs('on'); - $context->checking(Expectations::create() - -> allowing($t1)->isStarted() -> returns(true) -> when($con1->is('on')) - -> one($t1)->stop() -> when($con1->is('on')) -> then($con1->is('off')) - -> ignoring($t1) - -> allowing($t2)->isStarted() -> returns(true) -> when($con2->is('on')) - -> one($t2)->stop() -> when($con2->is('on')) -> then($con2->is('off')) - -> ignoring($t2) - ); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $transport->stop(); - $context->assertIsSatisfied(); - } - - public function testTransportShowsAsNotStartedIfAllDelegatesDead() - { - $e = new Swift_TransportException('b0rken'); - - $context = new Mockery(); - $message = $context->mock('Swift_Mime_Message'); - $t1 = $context->mock('Swift_Transport'); - $t2 = $context->mock('Swift_Transport'); - $con1 = $context->states('Connection')->startsAs('off'); - $con2 = $context->states('Connection')->startsAs('off'); - $context->checking(Expectations::create() - -> ignoring($message) - -> allowing($t1)->isStarted() -> returns(false) -> when($con1->is('off')) - -> allowing($t1)->isStarted() -> returns(true) -> when($con1->is('on')) - -> one($t1)->start() -> when($con1->isNot('on')) -> then($con1->is('on')) - -> one($t1)->send($message, optional()) -> throws($e) -> when($con1->is('on')) - -> ignoring($t1) - -> allowing($t2)->isStarted() -> returns(false) -> when($con2->is('off')) - -> allowing($t2)->isStarted() -> returns(true) -> when($con2->is('on')) - -> one($t2)->start() -> when($con2->isNot('on')) -> then($con2->is('on')) - -> one($t2)->send($message, optional()) -> throws($e) -> when($con2->is('on')) - -> ignoring($t2) - ); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertTrue($transport->isStarted()); - try { - $transport->send($message); - $this->fail('All transports failed so Exception should be thrown'); - } catch (Exception $e) { - $this->assertFalse($transport->isStarted()); - } - $context->assertIsSatisfied(); - } - - public function testRestartingTransportRestartsDeadDelegates() - { - $e = new Swift_TransportException('b0rken'); - - $context = new Mockery(); - $message1 = $context->mock('Swift_Mime_Message'); - $message2 = $context->mock('Swift_Mime_Message'); - $t1 = $context->mock('Swift_Transport'); - $t2 = $context->mock('Swift_Transport'); - $con1 = $context->states('Connection')->startsAs('off'); - $con2 = $context->states('Connection')->startsAs('off'); - $context->checking(Expectations::create() - -> ignoring($message1) - -> ignoring($message2) - -> allowing($t1)->isStarted() -> returns(false) -> when($con1->is('off')) - -> allowing($t1)->isStarted() -> returns(true) -> when($con1->is('on')) - -> exactly(2)->of($t1)->start() -> when($con1->isNot('on')) -> then($con1->is('on')) - -> one($t1)->send($message1, optional()) -> throws($e) -> when($con1->is('on')) -> then($con1->is('off')) - -> one($t1)->send($message2, optional()) -> returns(10) -> when($con1->is('on')) - -> ignoring($t1) - -> allowing($t2)->isStarted() -> returns(false) -> when($con2->is('off')) - -> allowing($t2)->isStarted() -> returns(true) -> when($con2->is('on')) - -> one($t2)->start() -> when($con2->isNot('on')) -> then($con2->is('on')) - -> one($t2)->send($message1, optional()) -> throws($e) -> when($con2->is('on')) - -> never($t2)->send($message2, optional()) - -> ignoring($t2) - ); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertTrue($transport->isStarted()); - try { - $transport->send($message1); - $this->fail('All transports failed so Exception should be thrown'); - } catch (Exception $e) { - $this->assertFalse($transport->isStarted()); - } - //Restart and re-try - $transport->start(); - $this->assertTrue($transport->isStarted()); - $this->assertEqual(10, $transport->send($message2)); - $context->assertIsSatisfied(); - } - - public function testFailureReferenceIsPassedToDelegates() - { - $failures = array(); - - $context = new Mockery(); - $message = $context->mock('Swift_Mime_Message'); - $t1 = $context->mock('Swift_Transport'); - $con = $context->states('Connection')->startsAs('off'); - $context->checking(Expectations::create() - -> ignoring($message) - -> allowing($t1)->isStarted() -> returns(false) -> when($con->is('off')) - -> allowing($t1)->isStarted() -> returns(true) -> when($con->is('on')) - -> one($t1)->start() -> when($con->isNot('on')) -> then($con->is('on')) - -> one($t1)->send($message, reference($failures)) -> returns(1) -> when($con->is('on')) - -> ignoring($t1) - ); - - $transport = $this->_getTransport(array($t1)); - $transport->start(); - $transport->send($message, $failures); - $context->assertIsSatisfied(); - } - - public function testRegisterPluginDelegatesToLoadedTransports() - { - $context = new Mockery(); - - $plugin = $this->_createPlugin($context); - - $t1 = $context->mock('Swift_Transport'); - $t2 = $context->mock('Swift_Transport'); - $context->checking(Expectations::create() - -> one($t1)->registerPlugin($plugin) - -> one($t2)->registerPlugin($plugin) - -> ignoring($t1) - -> ignoring($t2) - ); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->registerPlugin($plugin); - - $context->assertIsSatisfied(); - } - - // -- Private helpers - - private function _getTransport(array $transports) - { - $transport = new Swift_Transport_LoadBalancedTransport(); - $transport->setTransports($transports); - return $transport; - } - - private function _createPlugin($context) - { - return $context->mock('Swift_Events_EventListener'); - } - - private function _createInnerTransport() - { - return $this->_mockery()->mock('Swift_Transport'); - } - -} \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/MailTransportTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/MailTransportTest.php deleted file mode 100644 index 90833cf..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/MailTransportTest.php +++ /dev/null @@ -1,315 +0,0 @@ -_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $headers = $this->_createHeaders(); - $message = $this->_createMessage($headers); - - $this->_checking(Expectations::create() - -> one($invoker)->mail(any(), any(), any(), any(), optional()) - -> ignoring($dispatcher) - -> ignoring($headers) - -> ignoring($message) - ); - - $transport->send($message); - } - - public function testTransportUsesToFieldBodyInSending() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $to = $this->_createHeader(); - $headers = $this->_createHeaders(array( - 'To' => $to - )); - $message = $this->_createMessage($headers); - - $this->_checking(Expectations::create() - -> allowing($to)->getFieldBody() -> returns("Foo ") - -> one($invoker)->mail("Foo ", any(), any(), any(), optional()) - -> ignoring($dispatcher) - -> ignoring($headers) - -> ignoring($message) - -> ignoring($to) - ); - - $transport->send($message); - } - - public function testTransportUsesSubjectFieldBodyInSending() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $subj = $this->_createHeader(); - $headers = $this->_createHeaders(array( - 'Subject' => $subj - )); - $message = $this->_createMessage($headers); - - $this->_checking(Expectations::create() - -> allowing($subj)->getFieldBody() -> returns("Thing") - -> one($invoker)->mail(any(), "Thing", any(), any(), optional()) - -> ignoring($dispatcher) - -> ignoring($headers) - -> ignoring($message) - -> ignoring($subj) - ); - - $transport->send($message); - } - - public function testTransportUsesBodyOfMessage() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $headers = $this->_createHeaders(); - $message = $this->_createMessage($headers); - - $this->_checking(Expectations::create() - -> allowing($message)->toString() -> returns( - "To: Foo \r\n" . - "\r\n" . - "This body" - ) - -> one($invoker)->mail(any(), any(), "This body", any(), optional()) - -> ignoring($dispatcher) - -> ignoring($headers) - -> ignoring($message) - ); - - $transport->send($message); - } - - public function testTransportUsesHeadersFromMessage() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $headers = $this->_createHeaders(); - $message = $this->_createMessage($headers); - - $this->_checking(Expectations::create() - -> allowing($message)->toString() -> returns( - "Subject: Stuff\r\n" . - "\r\n" . - "This body" - ) - -> one($invoker)->mail(any(), any(), any(), "Subject: Stuff" . PHP_EOL, optional()) - -> ignoring($dispatcher) - -> ignoring($headers) - -> ignoring($message) - ); - - $transport->send($message); - } - - public function testTransportReturnsCountOfAllRecipientsIfInvokerReturnsTrue() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $headers = $this->_createHeaders(); - $message = $this->_createMessage($headers); - - $this->_checking(Expectations::create() - -> allowing($message)->getTo() -> returns(array('foo@bar'=>null, 'zip@button'=>null)) - -> allowing($message)->getCc() -> returns(array('test@test'=>null)) - -> one($invoker)->mail(any(), any(), any(), any(), optional()) -> returns(true) - -> ignoring($dispatcher) - -> ignoring($headers) - -> ignoring($message) - ); - - $this->assertEqual(3, $transport->send($message)); - } - - public function testTransportReturnsZeroIfInvokerReturnsFalse() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $headers = $this->_createHeaders(); - $message = $this->_createMessage($headers); - - $this->_checking(Expectations::create() - -> allowing($message)->getTo() -> returns(array('foo@bar'=>null, 'zip@button'=>null)) - -> allowing($message)->getCc() -> returns(array('test@test'=>null)) - -> one($invoker)->mail(any(), any(), any(), any(), optional()) -> returns(false) - -> ignoring($dispatcher) - -> ignoring($headers) - -> ignoring($message) - ); - - $this->assertEqual(0, $transport->send($message)); - } - - public function testToHeaderIsRemovedFromHeaderSetDuringSending() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $to = $this->_createHeader(); - $headers = $this->_createHeaders(array( - 'To' => $to - )); - $message = $this->_createMessage($headers); - - $this->_checking(Expectations::create() - -> one($headers)->remove('To') - -> one($invoker)->mail(any(), any(), any(), any(), optional()) - -> ignoring($dispatcher) - -> ignoring($headers) - -> ignoring($message) - -> ignoring($to) - ); - - $transport->send($message); - } - - public function testSubjectHeaderIsRemovedFromHeaderSetDuringSending() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $subject = $this->_createHeader(); - $headers = $this->_createHeaders(array( - 'Subject' => $subject - )); - $message = $this->_createMessage($headers); - - $this->_checking(Expectations::create() - -> one($headers)->remove('Subject') - -> one($invoker)->mail(any(), any(), any(), any(), optional()) - -> ignoring($dispatcher) - -> ignoring($headers) - -> ignoring($message) - -> ignoring($subject) - ); - - $transport->send($message); - } - - public function testToHeaderIsPutBackAfterSending() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $to = $this->_createHeader(); - $headers = $this->_createHeaders(array( - 'To' => $to - )); - $message = $this->_createMessage($headers); - - $this->_checking(Expectations::create() - -> one($headers)->set($to, optional()) - -> one($invoker)->mail(any(), any(), any(), any(), optional()) - -> ignoring($dispatcher) - -> ignoring($headers) - -> ignoring($message) - -> ignoring($to) - ); - - $transport->send($message); - } - - public function testSubjectHeaderIsPutBackAfterSending() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $subject = $this->_createHeader(); - $headers = $this->_createHeaders(array( - 'Subject' => $subject - )); - $message = $this->_createMessage($headers); - - $this->_checking(Expectations::create() - -> one($headers)->set($subject, optional()) - -> one($invoker)->mail(any(), any(), any(), any(), optional()) - -> ignoring($dispatcher) - -> ignoring($headers) - -> ignoring($message) - -> ignoring($subject) - ); - - $transport->send($message); - } - - // -- Creation Methods - - private function _createTransport($invoker, $dispatcher) - { - return new Swift_Transport_MailTransport($invoker, $dispatcher); - } - - private function _createEventDispatcher() - { - return $this->_mock('Swift_Events_EventDispatcher'); - } - - private function _createInvoker() - { - return $this->_mock('Swift_Transport_MailInvoker'); - } - - private function _createMessage($headers) - { - $message = $this->_mock('Swift_Mime_Message'); - - $this->_checking(Expectations::create() - -> allowing($message)->getHeaders() -> returns($headers) - ); - - return $message; - } - - private function _createHeaders($headers = array()) - { - $set = $this->_mock('Swift_Mime_HeaderSet'); - - if (count($headers) > 0) { - foreach ($headers as $name => $header) { - $this->_checking(Expectations::create() - -> allowing($set)->get($name) -> returns($header) - -> allowing($set)->has($name) -> returns(true) - ); - } - } - - $header = $this->_createHeader(); - $this->_checking(Expectations::create() - -> allowing($set)->get(any()) -> returns($header) - -> allowing($set)->has(any()) -> returns(true) - -> ignoring($header) - ); - - return $set; - } - - private function _createHeader() - { - return $this->_mock('Swift_Mime_Header'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/SendmailTransportTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/SendmailTransportTest.php deleted file mode 100644 index a58a354..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/SendmailTransportTest.php +++ /dev/null @@ -1,133 +0,0 @@ -_createEventDispatcher(); - } - $transport = new Swift_Transport_SendmailTransport($buf, $dispatcher); - $transport->setCommand($command); - return $transport; - } - - protected function _getSendmail($buf, $dispatcher = null) - { - if (!$dispatcher) { - $dispatcher = $this->_createEventDispatcher(); - } - $sendmail = new Swift_Transport_SendmailTransport($buf, $dispatcher); - return $sendmail; - } - - public function testCommandCanBeSetAndFetched() - { - $buf = $this->_getBuffer(); - $sendmail = $this->_getSendmail($buf); - - $sendmail->setCommand('/usr/sbin/sendmail -bs'); - $this->assertEqual('/usr/sbin/sendmail -bs', $sendmail->getCommand()); - $sendmail->setCommand('/usr/sbin/sendmail -oi -t'); - $this->assertEqual('/usr/sbin/sendmail -oi -t', $sendmail->getCommand()); - } - - public function testSendingMessageIn_t_ModeUsesSimplePipe() - { - $buf = $this->_getBuffer(); - $sendmail = $this->_getSendmail($buf); - $message = $this->_createMessage(); - - $this->_checking(Expectations::create() - -> allowing($message)->getTo() -> returns(array('foo@bar'=>'Foobar', 'zip@button'=>'Zippy')) - -> one($message)->toByteStream($buf) - -> ignoring($message) - -> one($buf)->initialize() - -> one($buf)->terminate() - -> one($buf)->setWriteTranslations(array("\r\n"=>"\n", "\n." => "\n..")) - -> one($buf)->setWriteTranslations(array()) - -> ignoring($buf) - ); - - $sendmail->setCommand('/usr/sbin/sendmail -t'); - $this->assertEqual(2, $sendmail->send($message)); - } - - public function testSendingIn_t_ModeWith_i_FlagDoesntEscapeDot() - { - $buf = $this->_getBuffer(); - $sendmail = $this->_getSendmail($buf); - $message = $this->_createMessage(); - - $this->_checking(Expectations::create() - -> allowing($message)->getTo() -> returns(array('foo@bar'=>'Foobar', 'zip@button'=>'Zippy')) - -> one($message)->toByteStream($buf) - -> ignoring($message) - -> one($buf)->initialize() - -> one($buf)->terminate() - -> one($buf)->setWriteTranslations(array("\r\n"=>"\n")) - -> one($buf)->setWriteTranslations(array()) - -> ignoring($buf) - ); - - $sendmail->setCommand('/usr/sbin/sendmail -i -t'); - $this->assertEqual(2, $sendmail->send($message)); - } - - public function testSendingInTModeWith_oi_FlagDoesntEscapeDot() - { - $buf = $this->_getBuffer(); - $sendmail = $this->_getSendmail($buf); - $message = $this->_createMessage(); - - $this->_checking(Expectations::create() - -> allowing($message)->getTo() -> returns(array('foo@bar'=>'Foobar', 'zip@button'=>'Zippy')) - -> one($message)->toByteStream($buf) - -> ignoring($message) - -> one($buf)->initialize() - -> one($buf)->terminate() - -> one($buf)->setWriteTranslations(array("\r\n"=>"\n")) - -> one($buf)->setWriteTranslations(array()) - -> ignoring($buf) - ); - - $sendmail->setCommand('/usr/sbin/sendmail -oi -t'); - $this->assertEqual(2, $sendmail->send($message)); - } - - public function testSendingMessageRegeneratesId() - { - $buf = $this->_getBuffer(); - $sendmail = $this->_getSendmail($buf); - $message = $this->_createMessage(); - - $this->_checking(Expectations::create() - -> allowing($message)->getTo() -> returns(array('foo@bar'=>'Foobar', 'zip@button'=>'Zippy')) - -> one($message)->generateId() - -> ignoring($message) - -> one($buf)->initialize() - -> one($buf)->terminate() - -> one($buf)->setWriteTranslations(array("\r\n"=>"\n", "\n." => "\n..")) - -> one($buf)->setWriteTranslations(array()) - -> ignoring($buf) - ); - - $sendmail->setCommand('/usr/sbin/sendmail -t'); - $this->assertEqual(2, $sendmail->send($message)); - } - - public function testFluidInterface() - { - $buf = $this->_getBuffer(); - $sendmail = $this->_getTransport($buf); - - $ref = $sendmail->setCommand('/foo'); - $this->assertReference($ref, $sendmail); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/StreamBufferTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/StreamBufferTest.php deleted file mode 100644 index 8b225af..0000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/StreamBufferTest.php +++ /dev/null @@ -1,50 +0,0 @@ -_createFactory(); - $this->_checking(Expectations::create() - -> one($factory)->createFilter('a', 'b') -> returns($this->_createFilter()) - -> never($factory) - ); - $buffer = $this->_createBuffer($factory); - $buffer->setWriteTranslations(array('a' => 'b')); - } - - public function testOverridingTranslationsOnlyAddsNeededFilters() - { - $factory = $this->_createFactory(); - $this->_checking(Expectations::create() - -> one($factory)->createFilter('a', 'b') -> returns($this->_createFilter()) - -> one($factory)->createFilter('x', 'y') -> returns($this->_createFilter()) - -> never($factory) - ); - $buffer = $this->_createBuffer($factory); - $buffer->setWriteTranslations(array('a' => 'b')); - $buffer->setWriteTranslations(array('x' => 'y', 'a' => 'b')); - } - - // -- Creation methods - - private function _createBuffer($replacementFactory) - { - return new Swift_Transport_StreamBuffer($replacementFactory); - } - - private function _createFactory() - { - return $this->_mock('Swift_ReplacementFilterFactory'); - } - - private function _createFilter() - { - return $this->_stub('Swift_StreamFilter'); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/.gitignore b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/.gitignore deleted file mode 100644 index 57be4e3..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/.gitignore +++ /dev/null @@ -1 +0,0 @@ -phpunit.xml \ No newline at end of file diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/AsseticBundle.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/AsseticBundle.php deleted file mode 100644 index a6cc751..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/AsseticBundle.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle; - -use Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler\TemplateResourcesPass; -use Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler\AssetFactoryPass; -use Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler\AssetManagerPass; -use Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler\CheckYuiFilterPass; -use Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler\FilterManagerPass; -use Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler\CheckCssEmbedFilterPass; -use Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler\CheckClosureFilterPass; -use Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler\TemplatingPass; -use Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler\SprocketsFilterPass; -use Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler\RouterResourcePass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\HttpKernel\Bundle\Bundle; - -/** - * Assetic integration. - * - * @author Kris Wallsmith - */ -class AsseticBundle extends Bundle -{ - public function build(ContainerBuilder $container) - { - parent::build($container); - - $container->addCompilerPass(new TemplateResourcesPass()); - $container->addCompilerPass(new CheckClosureFilterPass()); - $container->addCompilerPass(new CheckCssEmbedFilterPass()); - $container->addCompilerPass(new CheckYuiFilterPass()); - $container->addCompilerPass(new SprocketsFilterPass()); - $container->addCompilerPass(new TemplatingPass()); - $container->addCompilerPass(new AssetFactoryPass()); - $container->addCompilerPass(new AssetManagerPass()); - $container->addCompilerPass(new FilterManagerPass()); - $container->addCompilerPass(new RouterResourcePass()); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/CacheWarmer/AssetManagerCacheWarmer.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/CacheWarmer/AssetManagerCacheWarmer.php deleted file mode 100644 index 871626c..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/CacheWarmer/AssetManagerCacheWarmer.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\CacheWarmer; - -use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * The AssetManagerCacheWarmer warms up the formula loader. - * - * @author Kris Wallsmith - */ -class AssetManagerCacheWarmer implements CacheWarmerInterface -{ - private $container; - - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - public function warmUp($cacheDir) - { - $am = $this->container->get('assetic.asset_manager'); - $am->load(); - } - - public function isOptional() - { - return true; - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Command/DumpCommand.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Command/DumpCommand.php deleted file mode 100644 index e6399fb..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Command/DumpCommand.php +++ /dev/null @@ -1,232 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Command; - -use Assetic\Util\PathUtils; - -use Assetic\AssetWriter; -use Assetic\Asset\AssetInterface; -use Assetic\Factory\LazyAssetManager; -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Dumps assets to the filesystem. - * - * @author Kris Wallsmith - */ -class DumpCommand extends ContainerAwareCommand -{ - private $basePath; - private $verbose; - private $am; - - protected function configure() - { - $this - ->setName('assetic:dump') - ->setDescription('Dumps all assets to the filesystem') - ->addArgument('write_to', InputArgument::OPTIONAL, 'Override the configured asset root') - ->addOption('watch', null, InputOption::VALUE_NONE, 'Check for changes every second, debug mode only') - ->addOption('force', null, InputOption::VALUE_NONE, 'Force an initial generation of all assets (used with --watch)') - ->addOption('period', null, InputOption::VALUE_REQUIRED, 'Set the polling period in seconds (used with --watch)', 1) - ; - } - - protected function initialize(InputInterface $input, OutputInterface $output) - { - parent::initialize($input, $output); - - $this->basePath = $input->getArgument('write_to') ?: $this->getContainer()->getParameter('assetic.write_to'); - $this->verbose = $input->getOption('verbose'); - $this->am = $this->getContainer()->get('assetic.asset_manager'); - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $output->writeln(sprintf('Dumping all %s assets.', $input->getOption('env'))); - $output->writeln(sprintf('Debug mode is %s.', $this->am->isDebug() ? 'on' : 'off')); - $output->writeln(''); - - if (!$input->getOption('watch')) { - foreach ($this->am->getNames() as $name) { - $this->dumpAsset($name, $output); - } - - return; - } - - if (!$this->am->isDebug()) { - throw new \RuntimeException('The --watch option is only available in debug mode.'); - } - - $this->watch($input, $output); - } - - /** - * Watches a asset manager for changes. - * - * This method includes an infinite loop the continuously polls the asset - * manager for changes. - * - * @param InputInterface $input The command input - * @param OutputInterface $output The command output - */ - private function watch(InputInterface $input, OutputInterface $output) - { - $refl = new \ReflectionClass('Assetic\\AssetManager'); - $prop = $refl->getProperty('assets'); - $prop->setAccessible(true); - - $cache = sys_get_temp_dir().'/assetic_watch_'.substr(sha1($this->basePath), 0, 7); - if ($input->getOption('force') || !file_exists($cache)) { - $previously = array(); - } else { - $previously = unserialize(file_get_contents($cache)); - } - - $error = ''; - while (true) { - try { - foreach ($this->am->getNames() as $name) { - if ($this->checkAsset($name, $previously)) { - $this->dumpAsset($name, $output); - } - } - - // reset the asset manager - $prop->setValue($this->am, array()); - $this->am->load(); - - file_put_contents($cache, serialize($previously)); - $error = ''; - - sleep($input->getOption('period')); - } catch (\Exception $e) { - if ($error != $msg = $e->getMessage()) { - $output->writeln('[error] '.$msg); - $error = $msg; - } - } - } - } - - /** - * Checks if an asset should be dumped. - * - * @param string $name The asset name - * @param array &$previously An array of previous visits - * - * @return Boolean Whether the asset should be dumped - */ - private function checkAsset($name, array &$previously) - { - $formula = $this->am->hasFormula($name) ? serialize($this->am->getFormula($name)) : null; - $asset = $this->am->get($name); - $mtime = $asset->getLastModified(); - - if (isset($previously[$name])) { - $changed = $previously[$name]['mtime'] != $mtime || $previously[$name]['formula'] != $formula; - } else { - $changed = true; - } - - $previously[$name] = array('mtime' => $mtime, 'formula' => $formula); - - return $changed; - } - - /** - * Writes an asset. - * - * If the application or asset is in debug mode, each leaf asset will be - * dumped as well. - * - * @param string $name An asset name - * @param OutputInterface $output The command output - */ - private function dumpAsset($name, OutputInterface $output) - { - $asset = $this->am->get($name); - $formula = $this->am->getFormula($name); - - // start by dumping the main asset - $this->doDump($asset, $output); - - // dump each leaf if debug - if (isset($formula[2]['debug']) ? $formula[2]['debug'] : $this->am->isDebug()) { - foreach ($asset as $leaf) { - $this->doDump($leaf, $output); - } - } - } - - /** - * Performs the asset dump. - * - * @param AssetInterface $asset An asset - * @param OutputInterface $output The command output - * - * @throws RuntimeException If there is a problem writing the asset - */ - private function doDump(AssetInterface $asset, OutputInterface $output) - { - $writer = new AssetWriter(sys_get_temp_dir(), $this->getContainer()->getParameter('assetic.variables')); - $ref = new \ReflectionMethod($writer, 'getCombinations'); - $ref->setAccessible(true); - $combinations = $ref->invoke($writer, $asset->getVars()); - - foreach ($combinations as $combination) { - $asset->setValues($combination); - - $target = rtrim($this->basePath, '/').'/'.str_replace('_controller/', '', - PathUtils::resolvePath($asset->getTargetPath(), $asset->getVars(), - $asset->getValues())); - if (!is_dir($dir = dirname($target))) { - $output->writeln(sprintf( - '%s [dir+] %s', - date('H:i:s'), - $dir - )); - if (false === @mkdir($dir, 0777, true)) { - throw new \RuntimeException('Unable to create directory '.$dir); - } - } - - $output->writeln(sprintf( - '%s [file+] %s', - date('H:i:s'), - $target - )); - if ($this->verbose) { - if ($asset instanceof \Traversable) { - foreach ($asset as $leaf) { - $root = $leaf->getSourceRoot(); - $path = $leaf->getSourcePath(); - $output->writeln(sprintf(' %s/%s', $root ?: '[unknown root]', $path ?: '[unknown path]')); - } - } else { - $root = $asset->getSourceRoot(); - $path = $asset->getSourcePath(); - $output->writeln(sprintf(' %s/%s', $root ?: '[unknown root]', $path ?: '[unknown path]')); - } - } - - if (false === @file_put_contents($target, $asset->dump())) { - throw new \RuntimeException('Unable to write file '.$target); - } - } - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Config/AsseticResource.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Config/AsseticResource.php deleted file mode 100644 index 3e1db07..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Config/AsseticResource.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Config; - -use Assetic\Factory\Resource\ResourceInterface as AsseticResourceInterface; -use Symfony\Component\Config\Resource\ResourceInterface as SymfonyResourceInterface; - -/** - * Turns an Assetic resource into a Symfony one. - * - * @author Kris Wallsmith - */ -class AsseticResource implements SymfonyResourceInterface -{ - private $resource; - - public function __construct(AsseticResourceInterface $resource) - { - $this->resource = $resource; - } - - public function __toString() - { - return (string) $this->resource; - } - - public function isFresh($timestamp) - { - return $this->resource->isFresh($timestamp); - } - - /** - * Returns the Assetic resource. - * - * @return AsseticResourceInterface The wrapped Assetic resource - */ - public function getResource() - { - return $this->resource; - } - - public function exists() - { - return true; - } - - public function getId() - { - return md5('assetic'.$this->resource); - } - - public function getModificationTime() - { - return -1; - } - - public function serialize() - { - return serialize($this->resource); - } - - public function unserialize($serialized) - { - $this->resource = unserialize($serialized); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Controller/AsseticController.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Controller/AsseticController.php deleted file mode 100644 index bc3a1ad..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Controller/AsseticController.php +++ /dev/null @@ -1,121 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Controller; - -use Assetic\ValueSupplierInterface; - -use Assetic\Asset\AssetCache; -use Assetic\Asset\AssetInterface; -use Assetic\Factory\LazyAssetManager; -use Assetic\Cache\CacheInterface; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Symfony\Component\HttpKernel\Profiler\Profiler; - -/** - * Serves assets. - * - * @author Kris Wallsmith - */ -class AsseticController -{ - protected $request; - protected $am; - protected $cache; - protected $enableProfiler; - protected $profiler; - protected $valueSupplier; - - public function __construct(Request $request, LazyAssetManager $am, CacheInterface $cache, $enableProfiler = false, Profiler $profiler = null) - { - $this->request = $request; - $this->am = $am; - $this->cache = $cache; - $this->enableProfiler = (boolean) $enableProfiler; - $this->profiler = $profiler; - } - - public function setValueSupplier(ValueSupplierInterface $supplier) - { - $this->valueSupplier = $supplier; - } - - public function render($name, $pos = null) - { - if (!$this->enableProfiler && null !== $this->profiler) { - $this->profiler->disable(); - } - - if (!$this->am->has($name)) { - throw new NotFoundHttpException(sprintf('The "%s" asset could not be found.', $name)); - } - - $asset = $this->am->get($name); - if (null !== $pos && !$asset = $this->findAssetLeaf($asset, $pos)) { - throw new NotFoundHttpException(sprintf('The "%s" asset does not include a leaf at position %d.', $name, $pos)); - } - - $response = $this->createResponse(); - $response->setExpires(new \DateTime()); - - // last-modified - if (null !== $lastModified = $asset->getLastModified()) { - $date = new \DateTime(); - $date->setTimestamp($lastModified); - $response->setLastModified($date); - } - - // etag - if ($this->am->hasFormula($name)) { - $formula = $this->am->getFormula($name); - $formula['last_modified'] = $lastModified; - $response->setETag(md5(serialize($formula))); - } - - if ($response->isNotModified($this->request)) { - return $response; - } - - $response->setContent($this->cachifyAsset($asset)->dump()); - - return $response; - } - - protected function createResponse() - { - return new Response(); - } - - protected function cachifyAsset(AssetInterface $asset) - { - if ($vars = $asset->getVars()) { - if (null === $this->valueSupplier) { - throw new \RuntimeException(sprintf('You must configure a value supplier if you have assets with variables.')); - } - - $asset->setValues(array_intersect_key($this->valueSupplier->getValues(), array_flip($vars))); - } - - return new AssetCache($asset, $this->cache); - } - - private function findAssetLeaf(\Traversable $asset, $pos) - { - $i = 0; - foreach ($asset as $leaf) { - if ($pos == $i++) { - return $leaf; - } - } - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DefaultValueSupplier.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DefaultValueSupplier.php deleted file mode 100644 index c365bc0..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DefaultValueSupplier.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ -class DefaultValueSupplier implements ValueSupplierInterface -{ - protected $container; - - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - public function getValues() - { - if (!$this->container->isScopeActive('request')) { - return array(); - } - - $request = $this->container->get('request'); - - return array( - 'locale' => $request->getLocale(), - 'env' => $this->container->getParameter('kernel.environment'), - ); - } -} \ No newline at end of file diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/AsseticExtension.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/AsseticExtension.php deleted file mode 100644 index ce2503a..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/AsseticExtension.php +++ /dev/null @@ -1,144 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\DependencyInjection; - -use Symfony\Component\Config\FileLocator; -use Symfony\Component\Config\Definition\Processor; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\HttpKernel\DependencyInjection\Extension; - -/** - * Semantic asset configuration. - * - * @author Kris Wallsmith - */ -class AsseticExtension extends Extension -{ - /** - * Loads the configuration. - * - * @param array $configs An array of configuration settings - * @param ContainerBuilder $container A ContainerBuilder instance - */ - public function load(array $configs, ContainerBuilder $container) - { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); - $loader->load('assetic.xml'); - $loader->load('templating_twig.xml'); - $loader->load('templating_php.xml'); - - $processor = new Processor(); - $configuration = $this->getConfiguration($configs, $container); - $config = $processor->processConfiguration($configuration, $configs); - - $container->setParameter('assetic.debug', $config['debug']); - $container->setParameter('assetic.use_controller', $config['use_controller']['enabled']); - $container->setParameter('assetic.enable_profiler', $config['use_controller']['profiler']); - $container->setParameter('assetic.read_from', $config['read_from']); - $container->setParameter('assetic.write_to', $config['write_to']); - $container->setParameter('assetic.variables', $config['variables']); - - $container->setParameter('assetic.java.bin', $config['java']); - $container->setParameter('assetic.node.bin', $config['node']); - $container->setParameter('assetic.ruby.bin', $config['ruby']); - $container->setParameter('assetic.sass.bin', $config['sass']); - - // register formulae - $formulae = array(); - foreach ($config['assets'] as $name => $formula) { - $formulae[$name] = array($formula['inputs'], $formula['filters'], $formula['options']); - } - - if ($formulae) { - $container->getDefinition('assetic.config_resource')->replaceArgument(0, $formulae); - } else { - $container->removeDefinition('assetic.config_loader'); - $container->removeDefinition('assetic.config_resource'); - } - - // register filters - foreach ($config['filters'] as $name => $filter) { - if (isset($filter['resource'])) { - $loader->load($container->getParameterBag()->resolveValue($filter['resource'])); - unset($filter['resource']); - } else { - $loader->load('filters/'.$name.'.xml'); - } - - if (isset($filter['file'])) { - $container->getDefinition('assetic.filter.'.$name)->setFile($filter['file']); - unset($filter['file']); - } - - if (isset($filter['apply_to'])) { - if (!is_array($filter['apply_to'])) { - $filter['apply_to'] = array($filter['apply_to']); - } - - foreach ($filter['apply_to'] as $i => $pattern) { - $worker = new DefinitionDecorator('assetic.worker.ensure_filter'); - $worker->replaceArgument(0, '/'.$pattern.'/'); - $worker->replaceArgument(1, new Reference('assetic.filter.'.$name)); - $worker->addTag('assetic.factory_worker'); - - $container->setDefinition('assetic.filter.'.$name.'.worker'.$i, $worker); - } - - unset($filter['apply_to']); - } - - foreach ($filter as $key => $value) { - $container->setParameter('assetic.filter.'.$name.'.'.$key, $value); - } - } - - // twig functions - $container->setParameter('assetic.twig_extension.functions', $config['twig']['functions']); - - // choose dynamic or static - if ($useController = $container->getParameterBag()->resolveValue($container->getParameterBag()->get('assetic.use_controller'))) { - $loader->load('controller.xml'); - $container->getDefinition('assetic.helper.dynamic')->addTag('templating.helper', array('alias' => 'assetic')); - $container->removeDefinition('assetic.helper.static'); - } else { - $container->getDefinition('assetic.helper.static')->addTag('templating.helper', array('alias' => 'assetic')); - $container->removeDefinition('assetic.helper.dynamic'); - } - - $container->setParameter('assetic.bundles', $config['bundles']); - } - - /** - * Returns the base path for the XSD files. - * - * @return string The XSD base path - */ - public function getXsdValidationBasePath() - { - return __DIR__ . '/../Resources/config/schema'; - } - - public function getNamespace() - { - return 'http://symfony.com/schema/dic/assetic'; - } - - public function getConfiguration(array $config, ContainerBuilder $container) - { - $bundles = $container->getParameter('kernel.bundles'); - - return new Configuration(array_keys($bundles)); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/AssetFactoryPass.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/AssetFactoryPass.php deleted file mode 100644 index 46647c4..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/AssetFactoryPass.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Adds services tagged as workers to the asset factory. - * - * @author Kris Wallsmith - */ -class AssetFactoryPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('assetic.asset_factory')) { - return; - } - - $factory = $container->getDefinition('assetic.asset_factory'); - foreach ($container->findTaggedServiceIds('assetic.factory_worker') as $id => $attr) { - $factory->addMethodCall('addWorker', array(new Reference($id))); - } - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/AssetManagerPass.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/AssetManagerPass.php deleted file mode 100644 index fe45f9c..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/AssetManagerPass.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Adds services tagged as assets to the asset manager. - * - * @author Kris Wallsmith - */ -class AssetManagerPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('assetic.asset_manager')) { - return; - } - - $am = $container->getDefinition('assetic.asset_manager'); - - // add assets - foreach ($container->findTaggedServiceIds('assetic.asset') as $id => $attributes) { - foreach ($attributes as $attr) { - if (isset($attr['alias'])) { - $am->addMethodCall('set', array($attr['alias'], new Reference($id))); - } - } - } - - // add loaders - $loaders = array(); - foreach ($container->findTaggedServiceIds('assetic.formula_loader') as $id => $attributes) { - foreach ($attributes as $attr) { - if (isset($attr['alias'])) { - $loaders[$attr['alias']] = new Reference($id); - } - } - } - $am->replaceArgument(1, $loaders); - - // add resources - foreach ($container->findTaggedServiceIds('assetic.formula_resource') as $id => $attributes) { - foreach ($attributes as $attr) { - if (isset($attr['loader'])) { - $am->addMethodCall('addResource', array(new Reference($id), $attr['loader'])); - } - } - } - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/CheckClosureFilterPass.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/CheckClosureFilterPass.php deleted file mode 100644 index 3e1eec0..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/CheckClosureFilterPass.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Tags either the closure JAR or API filter for the filter manager. - * - * @author Kris Wallsmith - */ -class CheckClosureFilterPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if ($container->hasDefinition('assetic.filter.closure.jar') - && $container->hasParameter('assetic.filter.closure.jar') - && $container->getParameterBag()->resolveValue($container->getParameter('assetic.filter.closure.jar'))) { - $container->removeDefinition('assetic.filter.closure.api'); - $container->setAlias('assetic.filter.closure', 'assetic.filter.closure.jar'); - } elseif ($container->hasDefinition('assetic.filter.closure.api')) { - $container->removeDefinition('assetic.filter.closure.jar'); - $container->setAlias('assetic.filter.closure', 'assetic.filter.closure.api'); - } - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/CheckCssEmbedFilterPass.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/CheckCssEmbedFilterPass.php deleted file mode 100644 index e9c660c..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/CheckCssEmbedFilterPass.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Checks that the location of the CssEmbed JAR has been configured. - * - * @author Kris Wallsmith - */ -class CheckCssEmbedFilterPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if ($container->hasDefinition('assetic.filter.cssembed') && - !$container->getParameterBag()->resolveValue($container->getParameter('assetic.filter.cssembed.jar'))) { - throw new \RuntimeException('The "assetic.filters.cssembed" configuration requires a "jar" value.'); - } - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/CheckYuiFilterPass.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/CheckYuiFilterPass.php deleted file mode 100644 index 2c1f55c..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/CheckYuiFilterPass.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Checks that the location of the YUI JAR has been configured. - * - * @author Kris Wallsmith - */ -class CheckYuiFilterPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if ($container->hasDefinition('assetic.filter.yui_css') && - !$container->getParameterBag()->resolveValue($container->getParameter('assetic.filter.yui_css.jar'))) { - throw new \RuntimeException('The "assetic.filters.yui_css" configuration requires a "jar" value.'); - } - - if ($container->hasDefinition('assetic.filter.yui_js') && - !$container->getParameterBag()->resolveValue($container->getParameter('assetic.filter.yui_js.jar'))) { - throw new \RuntimeException('The "assetic.filters.yui_js" configuration requires a "jar" value.'); - } - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/FilterManagerPass.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/FilterManagerPass.php deleted file mode 100644 index af1ad24..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/FilterManagerPass.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Adds services tagged as filters to the filter manager. - * - * @author Kris Wallsmith - */ -class FilterManagerPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('assetic.filter_manager')) { - return; - } - - $mapping = array(); - foreach ($container->findTaggedServiceIds('assetic.filter') as $id => $attributes) { - foreach ($attributes as $attr) { - if (isset($attr['alias'])) { - $mapping[$attr['alias']] = $id; - } - } - } - - $container - ->getDefinition('assetic.filter_manager') - ->replaceArgument(1, $mapping); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/RouterResourcePass.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/RouterResourcePass.php deleted file mode 100644 index 770485d..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/RouterResourcePass.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\Yaml\Yaml; - -/** - * This pass adds Assetic routes when use_controller is true. - * - * @author Kris Wallsmith - */ -class RouterResourcePass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->getParameter('assetic.use_controller') || !$container->getParameter('router.resource')) { - return; - } - - $file = $container->getParameter('kernel.cache_dir').'/assetic/routing.yml'; - - if (!is_dir($dir = dirname($file))) { - mkdir($dir, 0777, true); - } - - file_put_contents($file, Yaml::dump(array( - '_assetic' => array('resource' => '.', 'type' => 'assetic'), - '_app' => array('resource' => $container->getParameter('router.resource')), - ))); - - $container->setParameter('router.resource', $file); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/SprocketsFilterPass.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/SprocketsFilterPass.php deleted file mode 100644 index 50ffce4..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/SprocketsFilterPass.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Finishes configuration of the Sprockets filter. - * - * @author Kris Wallsmith - */ -class SprocketsFilterPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('assetic.filter.sprockets')) { - return; - } - - $filter = $container->getDefinition('assetic.filter.sprockets'); - foreach ($container->getParameter('assetic.filter.sprockets.include_dirs') as $dir) { - $filter->addMethodCall('addIncludeDir', array($dir)); - } - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/TemplateResourcesPass.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/TemplateResourcesPass.php deleted file mode 100644 index c734b53..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/TemplateResourcesPass.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Bundle\AsseticBundle\DependencyInjection\DirectoryResourceDefinition; - -/** - * This pass adds directory resources to scan for assetic assets. - * - * @author Kris Wallsmith - * @author Lukas Kahwe Smith - */ -class TemplateResourcesPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('assetic.asset_manager')) { - return; - } - - $engines = $container->getParameter('templating.engines'); - - // bundle and kernel resources - $bundles = $container->getParameter('kernel.bundles'); - $asseticBundles = $container->getParameterBag()->resolveValue($container->getParameter('assetic.bundles')); - foreach ($asseticBundles as $bundleName) { - $rc = new \ReflectionClass($bundles[$bundleName]); - foreach ($engines as $engine) { - $this->setBundleDirectoryResources($container, $engine, dirname($rc->getFileName()), $bundleName); - } - } - - foreach ($engines as $engine) { - $this->setAppDirectoryResources($container, $engine); - } - } - - protected function setBundleDirectoryResources(ContainerBuilder $container, $engine, $bundleDirName, $bundleName) - { - $container->setDefinition( - 'assetic.'.$engine.'_directory_resource.'.$bundleName, - new DirectoryResourceDefinition($bundleName, $engine, array( - $container->getParameter('kernel.root_dir').'/Resources/'.$bundleName.'/views', - $bundleDirName.'/Resources/views', - )) - ); - } - - protected function setAppDirectoryResources(ContainerBuilder $container, $engine) - { - $container->setDefinition( - 'assetic.'.$engine.'_directory_resource.kernel', - new DirectoryResourceDefinition('', $engine, array($container->getParameter('kernel.root_dir').'/Resources/views')) - ); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/TemplatingPass.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/TemplatingPass.php deleted file mode 100644 index 8a0fdfb..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Compiler/TemplatingPass.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * This pass removes services associated with unused templating engines. - * - * @author Kris Wallsmith - */ -class TemplatingPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('assetic.asset_manager')) { - return; - } - - $engines = $container->getParameterBag()->resolveValue($container->getParameter('templating.engines')); - - if (!in_array('twig', $engines)) { - foreach ($container->findTaggedServiceIds('assetic.templating.twig') as $id => $attr) { - $container->removeDefinition($id); - } - } - - if (!in_array('php', $engines)) { - foreach ($container->findTaggedServiceIds('assetic.templating.php') as $id => $attr) { - $container->removeDefinition($id); - } - } - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Configuration.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Configuration.php deleted file mode 100644 index accfb4f..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/Configuration.php +++ /dev/null @@ -1,199 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\AsseticBundle\DependencyInjection; - -use Symfony\Component\Process\ExecutableFinder; -use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\Config\Definition\ConfigurationInterface; - -/** - * This class contains the configuration information for the bundle - * - * This information is solely responsible for how the different configuration - * sections are normalized, and merged. - * - * @author Christophe Coevoet - * @author Kris Wallsmith - */ -class Configuration implements ConfigurationInterface -{ - private $bundles; - - /** - * Constructor - * - * @param array $bundles An array of bundle names - */ - public function __construct(array $bundles) - { - $this->bundles = $bundles; - } - - /** - * Generates the configuration tree builder. - * - * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder - */ - public function getConfigTreeBuilder() - { - $builder = new TreeBuilder(); - $finder = new ExecutableFinder(); - - $builder->root('assetic') - ->children() - ->booleanNode('debug')->defaultValue('%kernel.debug%')->end() - ->arrayNode('use_controller') - ->addDefaultsIfNotSet() - ->treatTrueLike(array('enabled' => true)) - ->treatFalseLike(array('enabled' => false)) - ->children() - ->booleanNode('enabled')->defaultValue('%kernel.debug%')->end() - ->booleanNode('profiler')->defaultFalse()->end() - ->end() - ->end() - ->scalarNode('read_from')->defaultValue('%kernel.root_dir%/../web')->end() - ->scalarNode('write_to')->defaultValue('%assetic.read_from%')->end() - ->scalarNode('java')->defaultValue(function() use($finder) { return $finder->find('java', '/usr/bin/java'); })->end() - ->scalarNode('node')->defaultValue(function() use($finder) { return $finder->find('node', '/usr/bin/node'); })->end() - ->scalarNode('ruby')->defaultValue(function() use($finder) { return $finder->find('ruby', '/usr/bin/ruby'); })->end() - ->scalarNode('sass')->defaultValue(function() use($finder) { return $finder->find('sass', '/usr/bin/sass'); })->end() - ->end() - - // variables - ->fixXmlConfig('variable') - ->children() - ->arrayNode('variables') - ->useAttributeAsKey('name') - ->prototype('array') - ->prototype('scalar')->end() - ->end() - ->end() - ->end() - - // bundles - ->fixXmlConfig('bundle') - ->children() - ->arrayNode('bundles') - ->defaultValue($this->bundles) - ->prototype('scalar') - ->validate() - ->ifNotInArray($this->bundles) - ->thenInvalid('%s is not a valid bundle.') - ->end() - ->end() - ->end() - ->end() - - // assets - ->fixXmlConfig('asset') - ->children() - ->arrayNode('assets') - ->requiresAtLeastOneElement() - ->useAttributeAsKey('name') - ->prototype('array') - ->beforeNormalization() - // a scalar is a simple formula of one input file - ->ifTrue(function($v) { return !is_array($v); }) - ->then(function($v) { return array('inputs' => array($v)); }) - ->end() - ->beforeNormalization() - ->always() - ->then(function($v) - { - // cast scalars as array - foreach (array('input', 'inputs', 'filter', 'filters') as $key) { - if (isset($v[$key]) && !is_array($v[$key])) { - $v[$key] = array($v[$key]); - } - } - - // organize arbitrary options - foreach ($v as $key => $value) { - if (!in_array($key, array('input', 'inputs', 'filter', 'filters', 'option', 'options'))) { - $v['options'][$key] = $value; - unset($v[$key]); - } - } - - return $v; - }) - ->end() - - // the formula - ->fixXmlConfig('input') - ->fixXmlConfig('filter') - ->children() - ->arrayNode('inputs') - ->prototype('scalar')->end() - ->end() - ->arrayNode('filters') - ->prototype('scalar')->end() - ->end() - ->arrayNode('options') - ->useAttributeAsKey('name') - ->prototype('variable')->end() - ->end() - ->end() - ->end() - ->end() - ->end() - - // filters - ->fixXmlConfig('filter') - ->children() - ->arrayNode('filters') - ->requiresAtLeastOneElement() - ->useAttributeAsKey('name') - ->prototype('variable') - ->treatNullLike(array()) - ->validate() - ->ifTrue(function($v) { return !is_array($v); }) - ->thenInvalid('The assetic.filters config %s must be either null or an array.') - ->end() - ->end() - ->validate() - ->always(function($v) use ($finder) { - if (isset($v['compass']) && !isset($v['compass']['bin'])) { - $v['compass']['bin'] = $finder->find('compass', '/usr/bin/compass'); - } - - return $v; - }) - ->end() - ->end() - ->end() - - // twig - ->children() - ->arrayNode('twig') - ->addDefaultsIfNotSet() - ->fixXmlConfig('function') - ->children() - ->arrayNode('functions') - ->defaultValue(array()) - ->useAttributeAsKey('name') - ->prototype('variable') - ->treatNullLike(array()) - ->validate() - ->ifTrue(function($v) { return !is_array($v); }) - ->thenInvalid('The assetic.twig.functions config %s must be either null or an array.') - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ; - - return $builder; - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/DirectoryResourceDefinition.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/DirectoryResourceDefinition.php deleted file mode 100644 index f572a65..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/DependencyInjection/DirectoryResourceDefinition.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\AsseticBundle\DependencyInjection; - -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Reference; - -/** - * Encapsulates logic for creating a directory resource. - * - * @author Kris Wallsmith - */ -class DirectoryResourceDefinition extends Definition -{ - /** - * Constructor. - * - * @param string $bundle A bundle name or empty string - * @param string $engine The templating engine - * @param array $dirs An array of directories to merge - */ - public function __construct($bundle, $engine, array $dirs) - { - if (!count($dirs)) { - throw new \InvalidArgumentException('You must provide at least one directory.'); - } - - parent::__construct(); - - $this - ->addTag('assetic.templating.'.$engine) - ->addTag('assetic.formula_resource', array('loader' => $engine)); - ; - - if (1 == count($dirs)) { - // no need to coalesce - self::configureDefinition($this, $bundle, $engine, reset($dirs)); - return; - } - - // gather the wrapped resource definitions - $resources = array(); - foreach ($dirs as $dir) { - $resources[] = $resource = new Definition(); - self::configureDefinition($resource, $bundle, $engine, $dir); - } - - $this - ->setClass('%assetic.coalescing_directory_resource.class%') - ->addArgument($resources) - ->setPublic(false) - ; - } - - static private function configureDefinition(Definition $definition, $bundle, $engine, $dir) - { - $definition - ->setClass('%assetic.directory_resource.class%') - ->addArgument(new Reference('templating.loader')) - ->addArgument($bundle) - ->addArgument($dir) - ->addArgument('/\.[^.]+\.'.$engine.'$/') - ->setPublic(false) - ; - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/EventListener/RequestListener.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/EventListener/RequestListener.php deleted file mode 100644 index ae1d874..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/EventListener/RequestListener.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\EventListener; - -use Symfony\Component\HttpKernel\Event\GetResponseEvent; - -/** - * Adds a few formats to each request. - * - * @author Kris Wallsmith - */ -class RequestListener -{ - public function onKernelRequest(GetResponseEvent $event) - { - $request = $event->getRequest(); - - $request->setFormat('png', 'image/png'); - $request->setFormat('jpg', 'image/jpeg'); - $request->setFormat('gif', 'image/gif'); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Exception/InvalidBundleException.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Exception/InvalidBundleException.php deleted file mode 100644 index 960473f..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Exception/InvalidBundleException.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Exception; - -class InvalidBundleException extends \LogicException -{ - public function __construct($bundle, $usage, $template, array $enabled, $code = 0, \Exception $previous = null) - { - $message = sprintf('You must add %s to the assetic.bundle config to use %s in %s.', $bundle, $usage, $template); - - if ($enabled) { - $message .= sprintf(' (currently enabled: %s)', implode(', ', $enabled)); - } - - parent::__construct($message, $code, $previous); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/AssetFactory.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/AssetFactory.php deleted file mode 100644 index 85f7324..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/AssetFactory.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Factory; - -use Assetic\Factory\AssetFactory as BaseAssetFactory; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; -use Symfony\Component\HttpKernel\KernelInterface; - -/** - * Loads asset formulae from the filesystem. - * - * @author Kris Wallsmith - */ -class AssetFactory extends BaseAssetFactory -{ - private $kernel; - private $container; - private $parameterBag; - - /** - * Constructor. - * - * @param KernelInterface $kernel The kernel is used to parse bundle notation - * @param ContainerInterface $container The container is used to load the managers lazily, thus avoiding a circular dependency - * @param ParameterBagInterface $parameterBag The container parameter bag - * @param string $baseDir The base directory for relative inputs - * @param Boolean $debug The current debug mode - */ - public function __construct(KernelInterface $kernel, ContainerInterface $container, ParameterBagInterface $parameterBag, $baseDir, $debug = false) - { - $this->kernel = $kernel; - $this->container = $container; - $this->parameterBag = $parameterBag; - - parent::__construct($baseDir, $debug); - } - - /** - * Adds support for bundle notation file and glob assets and parameter placeholders. - * - * FIXME: This is a naive implementation of globs in that it doesn't - * attempt to support bundle inheritance within the glob pattern itself. - */ - protected function parseInput($input, array $options = array()) - { - $input = $this->parameterBag->resolveValue($input); - - // expand bundle notation - if ('@' == $input[0] && false !== strpos($input, '/')) { - // use the bundle path as this asset's root - $bundle = substr($input, 1); - if (false !== $pos = strpos($bundle, '/')) { - $bundle = substr($bundle, 0, $pos); - } - $options['root'] = array($this->kernel->getBundle($bundle)->getPath()); - - // canonicalize the input - if (false !== $pos = strpos($input, '*')) { - // locateResource() does not support globs so we provide a naive implementation here - list($before, $after) = explode('*', $input, 2); - $input = $this->kernel->locateResource($before).'*'.$after; - } else { - $input = $this->kernel->locateResource($input); - } - } - - return parent::parseInput($input, $options); - } - - protected function createAssetReference($name) - { - if (!$this->getAssetManager()) { - $this->setAssetManager($this->container->get('assetic.asset_manager')); - } - - return parent::createAssetReference($name); - } - - protected function getFilter($name) - { - if (!$this->getFilterManager()) { - $this->setFilterManager($this->container->get('assetic.filter_manager')); - } - - return parent::getFilter($name); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Loader/AsseticHelperFormulaLoader.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Loader/AsseticHelperFormulaLoader.php deleted file mode 100644 index 3f69e18..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Loader/AsseticHelperFormulaLoader.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Factory\Loader; - -use Assetic\Factory\Loader\BasePhpFormulaLoader; - -/** - * Loads formulae from Symfony2 PHP templates. - * - * @author Kris Wallsmith - */ -class AsseticHelperFormulaLoader extends BasePhpFormulaLoader -{ - protected function registerPrototypes() - { - return array( - '$view[\'assetic\']->javascripts(*)' => array('output' => 'js/*.js'), - '$view[\'assetic\']->stylesheets(*)' => array('output' => 'css/*.css'), - '$view[\'assetic\']->image(*)' => array('output' => 'images/*', 'single' => true), - '$view["assetic"]->javascripts(*)' => array('output' => 'js/*.js'), - '$view["assetic"]->stylesheets(*)' => array('output' => 'css/*.css'), - '$view["assetic"]->image(*)' => array('output' => 'images/*', 'single' => true), - '$view->get(\'assetic\')->javascripts(*)' => array('output' => 'js/*.js'), - '$view->get(\'assetic\')->stylesheets(*)' => array('output' => 'css/*.css'), - '$view->get(\'assetic\')->image(*)' => array('output' => 'images/*', 'single' => true), - '$view->get("assetic")->javascripts(*)' => array('output' => 'js/*.js'), - '$view->get("assetic")->stylesheets(*)' => array('output' => 'css/*.css'), - '$view->get("assetic")->image(*)' => array('output' => 'images/*', 'single' => true), - ); - } - - protected function registerSetupCode() - { - return <<<'EOF' -class Helper -{ - public function assets() - { - global $_call; - $_call = func_get_args(); - } - - public function javascripts() - { - global $_call; - $_call = func_get_args(); - } - - public function stylesheets() - { - global $_call; - $_call = func_get_args(); - } - - public function image() - { - global $_call; - $_call = func_get_args(); - } -} - -class View extends ArrayObject -{ - public function __construct(Helper $helper) - { - parent::__construct(array('assetic' => $helper)); - } - - public function get() - { - return $this['assetic']; - } -} - -$view = new View(new Helper()); -EOF; - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Loader/ConfigurationLoader.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Loader/ConfigurationLoader.php deleted file mode 100644 index 28385e1..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Loader/ConfigurationLoader.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Factory\Loader; - -use Assetic\Factory\Loader\FormulaLoaderInterface; -use Assetic\Factory\Resource\ResourceInterface; -use Symfony\Bundle\AsseticBundle\Factory\Resource\ConfigurationResource; - -/** - * Loads configured formulae. - * - * @author Kris Wallsmith - */ -class ConfigurationLoader implements FormulaLoaderInterface -{ - public function load(ResourceInterface $resource) - { - return $resource instanceof ConfigurationResource ? $resource->getContent() : array(); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Resource/CoalescingDirectoryResource.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Resource/CoalescingDirectoryResource.php deleted file mode 100644 index 1ad87e9..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Resource/CoalescingDirectoryResource.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Factory\Resource; - -use Assetic\Factory\Resource\CoalescingDirectoryResource as BaseCoalescingDirectoryResource; -use Assetic\Factory\Resource\ResourceInterface; - -/** - * Coalesces multiple directories together into one merged resource. - * - * @author Kris Wallsmith - */ -class CoalescingDirectoryResource extends BaseCoalescingDirectoryResource -{ - protected function getRelativeName(ResourceInterface $file, ResourceInterface $directory) - { - $name = (string) $file; - - return substr($name, strpos($name, ':')); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Resource/ConfigurationResource.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Resource/ConfigurationResource.php deleted file mode 100644 index e1fac48..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Resource/ConfigurationResource.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Factory\Resource; - -use Assetic\Factory\Resource\ResourceInterface; - -/** - * A configured resource. - * - * @author Kris Wallsmith - */ -class ConfigurationResource implements ResourceInterface -{ - private $formulae; - - public function __construct(array $formulae) - { - $this->formulae = $formulae; - } - - public function isFresh($timestamp) - { - return true; - } - - public function getContent() - { - return $this->formulae; - } - - public function __toString() - { - return 'symfony'; - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Resource/DirectoryResource.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Resource/DirectoryResource.php deleted file mode 100644 index 54ce81c..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Resource/DirectoryResource.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Factory\Resource; - -use Assetic\Factory\Resource\DirectoryResource as BaseDirectoryResource; -use Symfony\Component\Templating\Loader\LoaderInterface; - -/** - * A directory resource that creates Symfony2 templating resources. - * - * @author Kris Wallsmith - */ -class DirectoryResource extends BaseDirectoryResource -{ - protected $loader; - protected $bundle; - protected $path; - - /** - * Constructor. - * - * @param LoaderInterface $loader The templating loader - * @param string $bundle The current bundle name - * @param string $path The directory path - * @param string $pattern A regex pattern for file basenames - */ - public function __construct(LoaderInterface $loader, $bundle, $path, $pattern = null) - { - $this->loader = $loader; - $this->bundle = $bundle; - $this->path = rtrim($path, '/').'/'; - - parent::__construct($path, $pattern); - } - - public function getIterator() - { - return is_dir($this->path) - ? new DirectoryResourceIterator($this->loader, $this->bundle, $this->path, $this->getInnerIterator()) - : new \EmptyIterator(); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Resource/DirectoryResourceIterator.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Resource/DirectoryResourceIterator.php deleted file mode 100644 index e31cc7e..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Resource/DirectoryResourceIterator.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Factory\Resource; - -use Symfony\Component\Templating\Loader\LoaderInterface; - -class DirectoryResourceIterator extends \RecursiveIteratorIterator -{ - protected $loader; - protected $bundle; - protected $path; - - /** - * Constructor. - * - * @param LoaderInterface $loader The templating loader - * @param string $bundle The current bundle name - * @param string $path The directory - * @param RecursiveIterator $iterator The inner iterator - */ - public function __construct(LoaderInterface $loader, $bundle, $path, \RecursiveIterator $iterator) - { - $this->loader = $loader; - $this->bundle = $bundle; - $this->path = $path; - - parent::__construct($iterator); - } - - public function current() - { - $file = parent::current(); - - return new FileResource($this->loader, $this->bundle, $this->path, $file->getPathname()); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Resource/FileResource.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Resource/FileResource.php deleted file mode 100644 index 72585d5..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Resource/FileResource.php +++ /dev/null @@ -1,88 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Factory\Resource; - -use Assetic\Factory\Resource\ResourceInterface; -use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference; -use Symfony\Component\Templating\Loader\LoaderInterface; - -/** - * A file resource. - * - * @author Kris Wallsmith - */ -class FileResource implements ResourceInterface -{ - protected $loader; - protected $bundle; - protected $baseDir; - protected $path; - protected $template; - - /** - * Constructor. - * - * @param LoaderInterface $loader The templating loader - * @param string $bundle The current bundle name - * @param string $baseDir The directory - * @param string $path The file path - */ - public function __construct(LoaderInterface $loader, $bundle, $baseDir, $path) - { - $this->loader = $loader; - $this->bundle = $bundle; - $this->baseDir = $baseDir; - $this->path = $path; - } - - public function isFresh($timestamp) - { - return $this->loader->isFresh($this->getTemplate(), $timestamp); - } - - public function getContent() - { - $templateReference = $this->getTemplate(); - $fileResource = $this->loader->load($templateReference); - - if (!$fileResource) { - throw new \InvalidArgumentException(sprintf('Unable to find template "%s".', $templateReference)); - } - - return $fileResource->getContent(); - } - - public function __toString() - { - return (string) $this->getTemplate(); - } - - protected function getTemplate() - { - if (null === $this->template) { - $this->template = self::createTemplateReference($this->bundle, substr($this->path, strlen($this->baseDir))); - } - - return $this->template; - } - - static private function createTemplateReference($bundle, $file) - { - $parts = explode('/', strtr($file, '\\', '/')); - $elements = explode('.', array_pop($parts)); - $engine = array_pop($elements); - $format = array_pop($elements); - $name = implode('.', $elements); - - return new TemplateReference($bundle, implode('/', $parts), $name, $format, $engine); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Worker/UseControllerWorker.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Worker/UseControllerWorker.php deleted file mode 100644 index b894154..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Factory/Worker/UseControllerWorker.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Factory\Worker; - -use Assetic\Asset\AssetInterface; -use Assetic\Factory\Worker\WorkerInterface; - -/** - * Prepends a fake front controller so the asset knows where it is-ish. - * - * @author Kris Wallsmith - */ -class UseControllerWorker implements WorkerInterface -{ - public function process(AssetInterface $asset) - { - $targetUrl = $asset->getTargetPath(); - if ($targetUrl && '/' != $targetUrl[0] && 0 !== strpos($targetUrl, '_controller/')) { - $asset->setTargetPath('_controller/'.$targetUrl); - } - - return $asset; - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/FilterManager.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/FilterManager.php deleted file mode 100644 index c547a86..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/FilterManager.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle; - -use Assetic\FilterManager as BaseFilterManager; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Lazy filter manager. - * - * @author Kris Wallsmith - */ -class FilterManager extends BaseFilterManager -{ - protected $container; - protected $mappings; - - /** - * Constructor. - * - * @param ContainerInterface $container The service container - * @param array $mappings A hash of filter names to service ids - */ - public function __construct(ContainerInterface $container, array $mappings) - { - $this->container = $container; - $this->mappings = $mappings; - } - - public function get($name) - { - return isset($this->mappings[$name]) - ? $this->container->get($this->mappings[$name]) - : parent::get($name); - } - - public function has($name) - { - return isset($this->mappings[$name]) || parent::has($name); - } - - public function getNames() - { - return array_unique(array_merge(array_keys($this->mappings), parent::getNames())); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/assetic.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/assetic.xml deleted file mode 100644 index 7d05979..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/assetic.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - Symfony\Bundle\AsseticBundle\Factory\AssetFactory - Assetic\Factory\LazyAssetManager - Symfony\Bundle\AsseticBundle\CacheWarmer\AssetManagerCacheWarmer - Assetic\Factory\Loader\CachedFormulaLoader - Assetic\Cache\ConfigCache - Symfony\Bundle\AsseticBundle\Factory\Loader\ConfigurationLoader - Symfony\Bundle\AsseticBundle\Factory\Resource\ConfigurationResource - Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource - Symfony\Bundle\AsseticBundle\Factory\Resource\DirectoryResource - Symfony\Bundle\AsseticBundle\FilterManager - Assetic\Factory\Worker\EnsureFilterWorker - Symfony\Bundle\AsseticBundle\DefaultValueSupplier - - - %kernel.cache_dir%/assetic - - - - - - - - - - - - - - - - - - - %assetic.read_from% - %assetic.debug% - - - - - - - - - - - - %assetic.cache_dir%/config - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/controller.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/controller.xml deleted file mode 100644 index 19b348f..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/controller.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - Symfony\Bundle\AsseticBundle\Controller\AsseticController - Symfony\Bundle\AsseticBundle\Routing\AsseticLoader - Assetic\Cache\FilesystemCache - Symfony\Bundle\AsseticBundle\Factory\Worker\UseControllerWorker - Symfony\Bundle\AsseticBundle\EventListener\RequestListener - - - - - - - - - - - - %assetic.enable_profiler% - - - - - - - - %assetic.cache_dir%/assets - - - - - - - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/closure.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/closure.xml deleted file mode 100644 index 4450220..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/closure.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - Assetic\Filter\GoogleClosure\CompilerApiFilter - Assetic\Filter\GoogleClosure\CompilerJarFilter - %assetic.java.bin% - null - - - - - - %assetic.filter.closure.jar% - %assetic.filter.closure.java% - - %assetic.filter.closure.compilation_level% - - - - - - - %assetic.filter.closure.compilation_level% - - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/coffee.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/coffee.xml deleted file mode 100644 index 4feda54..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/coffee.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - Assetic\Filter\CoffeeScriptFilter - /usr/bin/coffee - %assetic.node.bin% - null - - - - - - %assetic.filter.coffee.bin% - %assetic.filter.coffee.node% - %assetic.filter.coffee.bare% - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/compass.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/compass.xml deleted file mode 100644 index 5825588..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/compass.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - Assetic\Filter\CompassFilter - /usr/bin/compass - false - null - null - null - null - null - null - null - - - - - - - %assetic.filter.compass.bin% - %assetic.ruby.bin% - %assetic.filter.compass.debug% - %assetic.filter.compass.style% - %assetic.filter.compass.images_dir% - %assetic.filter.compass.javascripts_dir% - %assetic.filter.compass.http_path% - %assetic.filter.compass.http_images_path% - %assetic.filter.compass.generated_images_path% - %assetic.filter.compass.http_javascripts_path% - %assetic.filter.compass.plugins% - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/cssembed.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/cssembed.xml deleted file mode 100644 index ccf0d56..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/cssembed.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - Assetic\Filter\CssEmbedFilter - %assetic.java.bin% - - %kernel.charset% - false - null - null - false - null - null - - - - - - %assetic.filter.cssembed.jar% - %assetic.filter.cssembed.java% - %assetic.filter.cssembed.charset% - %assetic.filter.cssembed.mhtml% - %assetic.filter.cssembed.mhtml_root% - %assetic.filter.cssembed.root% - %assetic.filter.cssembed.skip_missing% - %assetic.filter.cssembed.max_uri_length% - %assetic.filter.cssembed.max_image_size% - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/cssimport.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/cssimport.xml deleted file mode 100644 index 08440cd..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/cssimport.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - Assetic\Filter\CssImportFilter - - - - - - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/cssmin.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/cssmin.xml deleted file mode 100644 index 0fd1057..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/cssmin.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - Assetic\Filter\CssMinFilter - - - - - - - - %assetic.filter.cssmin.filters% - %assetic.filter.cssmin.plugins% - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/cssrewrite.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/cssrewrite.xml deleted file mode 100644 index 383d8cd..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/cssrewrite.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - Assetic\Filter\CssRewriteFilter - - - - - - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/gss.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/gss.xml deleted file mode 100644 index a1514bf..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/gss.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - Assetic\Filter\GssFilter - %assetic.java.bin% - - - - - - - %assetic.filter.gss.jar% - %assetic.filter.gss.java% - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/jpegoptim.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/jpegoptim.xml deleted file mode 100644 index 0de4069..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/jpegoptim.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - Assetic\Filter\JpegoptimFilter - /usr/bin/jpegoptim - false - null - - - - - - %assetic.filter.jpegoptim.bin% - %assetic.filter.jpegoptim.strip_all% - %assetic.filter.jpegoptim.max% - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/jpegtran.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/jpegtran.xml deleted file mode 100644 index 3d0f854..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/jpegtran.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - Assetic\Filter\JpegtranFilter - /usr/bin/jpegtran - null - false - false - null - - - - - - %assetic.filter.jpegtran.bin% - %assetic.filter.jpegtran.copy% - %assetic.filter.jpegtran.optimize% - %assetic.filter.jpegtran.progressive% - %assetic.filter.jpegtran.restart% - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/less.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/less.xml deleted file mode 100644 index dacaf22..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/less.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - Assetic\Filter\LessFilter - %assetic.node.bin% - %assetic.node.paths% - null - - - - - - %assetic.filter.less.node% - %assetic.filter.less.node_paths% - %assetic.filter.less.compress% - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/lessphp.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/lessphp.xml deleted file mode 100644 index c4fbefa..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/lessphp.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - Assetic\Filter\LessphpFilter - - - - - - - %assetic.filter.lessphp.presets% - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/optipng.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/optipng.xml deleted file mode 100644 index 5925e77..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/optipng.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - Assetic\Filter\OptiPngFilter - /usr/bin/optipng - null - - - - - - %assetic.filter.optipng.bin% - %assetic.filter.optipng.level% - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/packager.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/packager.xml deleted file mode 100644 index 6446116..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/packager.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - Assetic\Filter\PackagerFilter - - - - - - - %assetic.filter.packager.packages% - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/pngout.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/pngout.xml deleted file mode 100644 index 2c5af72..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/pngout.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - Assetic\Filter\PngoutFilter - /usr/bin/pngout - null - null - null - null - - - - - - %assetic.filter.pngout.bin% - %assetic.filter.pngout.color% - %assetic.filter.pngout.filter% - %assetic.filter.pngout.strategy% - %assetic.filter.pngout.block_split_threshold% - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/sass.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/sass.xml deleted file mode 100644 index 9df1f07..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/sass.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - Assetic\Filter\Sass\SassFilter - %assetic.sass.bin% - null - null - - - - - - %assetic.filter.sass.bin% - %assetic.ruby.bin% - %assetic.filter.sass.style% - %assetic.filter.sass.compass% - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/scss.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/scss.xml deleted file mode 100644 index 23e49bc..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/scss.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - Assetic\Filter\Sass\ScssFilter - %assetic.sass.bin% - null - null - - - - - - %assetic.filter.scss.sass% - %assetic.ruby.bin% - %assetic.filter.scss.style% - %assetic.filter.scss.compass% - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/sprockets.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/sprockets.xml deleted file mode 100644 index 27808c3..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/sprockets.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - Assetic\Filter\SprocketsFilter - null - %assetic.ruby.bin% - %assetic.write_to% - - - - - - - %assetic.filter.sprockets.lib% - %assetic.filter.sprockets.ruby% - %assetic.filter.sprockets.asset_root% - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/stylus.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/stylus.xml deleted file mode 100644 index cfc5b93..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/stylus.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - Assetic\Filter\StylusFilter - %assetic.node.bin% - %assetic.node.paths% - null - - - - - - %assetic.filter.stylus.node% - %assetic.filter.stylus.node_paths% - %assetic.filter.stylus.compress% - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/uglifyjs.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/uglifyjs.xml deleted file mode 100644 index 3ccb42b..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/uglifyjs.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - Assetic\Filter\UglifyJsFilter - /usr/bin/uglifyjs - %assetic.node.bin% - false - false - false - - - - - - %assetic.filter.uglifyjs.bin% - %assetic.filter.uglifyjs.node% - - %assetic.filter.uglifyjs.beautify% - - - %assetic.filter.uglifyjs.no_copyright% - - - %assetic.filter.uglifyjs.unsafe% - - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/yui_css.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/yui_css.xml deleted file mode 100644 index a5808c6..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/yui_css.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - Assetic\Filter\Yui\CssCompressorFilter - %assetic.java.bin% - - %kernel.charset% - - - - - - %assetic.filter.yui_css.jar% - %assetic.filter.yui_css.java% - %assetic.filter.yui_css.charset% - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/yui_js.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/yui_js.xml deleted file mode 100644 index 75a53e6..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/filters/yui_js.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - Assetic\Filter\Yui\JsCompressorFilter - %assetic.java.bin% - - %kernel.charset% - null - null - null - - - - - - %assetic.filter.yui_js.jar% - %assetic.filter.yui_js.java% - %assetic.filter.yui_js.charset% - %assetic.filter.yui_js.nomunge% - %assetic.filter.yui_js.preserve_semi% - %assetic.filter.yui_js.disable_optimizations% - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/schema/assetic-1.0.xsd b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/schema/assetic-1.0.xsd deleted file mode 100644 index 82e35a3..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/schema/assetic-1.0.xsd +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/templating_php.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/templating_php.xml deleted file mode 100644 index b6843d9..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/templating_php.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - Symfony\Bundle\AsseticBundle\Templating\DynamicAsseticHelper - Symfony\Bundle\AsseticBundle\Templating\StaticAsseticHelper - Symfony\Bundle\AsseticBundle\Factory\Loader\AsseticHelperFormulaLoader - - - - - - - - - - - - - - - - - - - - - %kernel.debug% - - - - - - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/templating_twig.xml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/templating_twig.xml deleted file mode 100644 index 8ab025b..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Resources/config/templating_twig.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - Symfony\Bundle\AsseticBundle\Twig\AsseticExtension - Assetic\Extension\Twig\TwigFormulaLoader - - - - - - - - - %assetic.use_controller% - %assetic.twig_extension.functions% - %assetic.bundles% - - - - - - - - %kernel.debug% - - - - - - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Routing/AsseticLoader.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Routing/AsseticLoader.php deleted file mode 100644 index b2e8385..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Routing/AsseticLoader.php +++ /dev/null @@ -1,122 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Routing; - -use Assetic\Asset\AssetInterface; -use Assetic\Factory\LazyAssetManager; -use Symfony\Bundle\AsseticBundle\Config\AsseticResource; -use Symfony\Component\Config\Loader\Loader; -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\Routing\Route; -use Symfony\Component\Routing\RouteCollection; - -/** - * Loads routes for all assets. - * - * Assets should only be served through the routing system for ease-of-use - * during development. - * - * For example, add the following to your application's routing_dev.yml: - * - * _assetic: - * resource: . - * type: assetic - * - * In a production environment you should use the `assetic:dump` command to - * create static asset files. - * - * @author Kris Wallsmith - */ -class AsseticLoader extends Loader -{ - protected $am; - - public function __construct(LazyAssetManager $am) - { - $this->am = $am; - } - - public function load($routingResource, $type = null) - { - $routes = new RouteCollection(); - - // resources - foreach ($this->am->getResources() as $resources) { - if (!$resources instanceof \Traversable) { - $resources = array($resources); - } - foreach ($resources as $resource) { - $routes->addResource(new AsseticResource($resource)); - } - } - - // routes - foreach ($this->am->getNames() as $name) { - $asset = $this->am->get($name); - $formula = $this->am->getFormula($name); - - $this->loadRouteForAsset($routes, $asset, $name); - - $debug = isset($formula[2]['debug']) ? $formula[2]['debug'] : $this->am->isDebug(); - $combine = isset($formula[2]['combine']) ? $formula[2]['combine'] : !$debug; - - // add a route for each "leaf" in debug mode - if (!$combine) { - $i = 0; - foreach ($asset as $leaf) { - $this->loadRouteForAsset($routes, $leaf, $name, $i++); - } - } - } - - return $routes; - } - - /** - * Loads a route to serve an supplied asset. - * - * The fake front controller that {@link UseControllerWorker} adds to the - * target URL will be removed before set as a route pattern. - * - * @param RouteCollection $routes The route collection - * @param AssetInterface $asset The asset - * @param string $name The name to use - * @param integer $pos The leaf index - */ - private function loadRouteForAsset(RouteCollection $routes, AssetInterface $asset, $name, $pos = null) - { - $defaults = array( - '_controller' => 'assetic.controller:render', - 'name' => $name, - 'pos' => $pos, - ); - - // remove the fake front controller - $pattern = str_replace('_controller/', '', $asset->getTargetPath()); - - if ($format = pathinfo($pattern, PATHINFO_EXTENSION)) { - $defaults['_format'] = $format; - } - - $route = '_assetic_'.$name; - if (null !== $pos) { - $route .= '_'.$pos; - } - - $routes->add($route, new Route($pattern, $defaults)); - } - - public function supports($resource, $type = null) - { - return 'assetic' == $type; - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Templating/AsseticHelper.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Templating/AsseticHelper.php deleted file mode 100644 index 4944209..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Templating/AsseticHelper.php +++ /dev/null @@ -1,157 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Templating; - -use Assetic\Asset\AssetInterface; -use Assetic\Factory\AssetFactory; -use Assetic\Util\TraversableString; -use Symfony\Component\Templating\Helper\Helper; - -/** - * The "assetic" templating helper. - * - * @author Kris Wallsmith - */ -abstract class AsseticHelper extends Helper -{ - protected $factory; - - /** - * Constructor. - * - * @param AssetFactory $factory The asset factory - */ - public function __construct(AssetFactory $factory) - { - $this->factory = $factory; - } - - /** - * Returns an array of javascript urls. - */ - public function javascripts($inputs = array(), $filters = array(), array $options = array()) - { - if (!isset($options['output'])) { - $options['output'] = 'js/*.js'; - } - - return $this->getAssetUrls($inputs, $filters, $options); - } - - /** - * Returns an array of stylesheet urls. - */ - public function stylesheets($inputs = array(), $filters = array(), array $options = array()) - { - if (!isset($options['output'])) { - $options['output'] = 'css/*.css'; - } - - return $this->getAssetUrls($inputs, $filters, $options); - } - - /** - * Returns an array of one image url. - */ - public function image($inputs = array(), $filters = array(), array $options = array()) - { - if (!isset($options['output'])) { - $options['output'] = 'images/*'; - } - - $options['single'] = true; - - return $this->getAssetUrls($inputs, $filters, $options); - } - - /** - * Gets the URLs for the configured asset. - * - * Usage looks something like this: - * - * assets('@jquery, js/src/core/*', '?yui_js') as $url): ?> - * - * - * - * When in debug mode, the helper returns an array of one or more URLs. - * When not in debug mode it returns an array of one URL. - * - * @param array|string $inputs An array or comma-separated list of input strings - * @param array|string $filters An array or comma-separated list of filter names - * @param array $options An array of options - * - * @return array An array of URLs for the asset - */ - private function getAssetUrls($inputs = array(), $filters = array(), array $options = array()) - { - $explode = function($value) - { - return array_map('trim', explode(',', $value)); - }; - - if (!is_array($inputs)) { - $inputs = $explode($inputs); - } - - if (!is_array($filters)) { - $filters = $explode($filters); - } - - if (!isset($options['debug'])) { - $options['debug'] = $this->factory->isDebug(); - } - - if (!isset($options['combine'])) { - $options['combine'] = !$options['debug']; - } - - if (isset($options['single']) && $options['single'] && 1 < count($inputs)) { - $inputs = array_slice($inputs, -1); - } - - if (!isset($options['name'])) { - $options['name'] = $this->factory->generateAssetName($inputs, $filters, $options); - } - - $asset = $this->factory->createAsset($inputs, $filters, $options); - - $one = $this->getAssetUrl($asset, $options); - $many = array(); - if ($options['combine']) { - $many[] = $one; - } else { - $i = 0; - foreach ($asset as $leaf) { - $many[] = $this->getAssetUrl($leaf, array_replace($options, array( - 'name' => $options['name'].'_'.$i++, - ))); - } - } - - return new TraversableString($one, $many); - } - - /** - * Returns an URL for the supplied asset. - * - * @param AssetInterface $asset An asset - * @param array $options An array of options - * - * @return string An echo-ready URL - */ - abstract protected function getAssetUrl(AssetInterface $asset, $options = array()); - - public function getName() - { - return 'assetic'; - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Templating/DynamicAsseticHelper.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Templating/DynamicAsseticHelper.php deleted file mode 100644 index c4bdcd7..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Templating/DynamicAsseticHelper.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Templating; - -use Assetic\Asset\AssetInterface; -use Assetic\Factory\AssetFactory; -use Symfony\Bundle\FrameworkBundle\Templating\Helper\RouterHelper; - -/** - * The dynamic "assetic" templating helper. - * - * @author Kris Wallsmith - */ -class DynamicAsseticHelper extends AsseticHelper -{ - private $routerHelper; - - /** - * Constructor. - * - * @param RouterHelper $routerHelper The router helper - * @param AssetFactory $factory The asset factory - */ - public function __construct(RouterHelper $routerHelper, AssetFactory $factory) - { - $this->routerHelper = $routerHelper; - - parent::__construct($factory); - } - - protected function getAssetUrl(AssetInterface $asset, $options = array()) - { - return $this->routerHelper->generate('_assetic_'.$options['name']); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Templating/StaticAsseticHelper.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Templating/StaticAsseticHelper.php deleted file mode 100644 index 39ba793..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Templating/StaticAsseticHelper.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Templating; - -use Assetic\Asset\AssetInterface; -use Assetic\Factory\AssetFactory; -use Symfony\Component\Templating\Helper\CoreAssetsHelper; - -/** - * The static "assetic" templating helper. - * - * @author Kris Wallsmith - */ -class StaticAsseticHelper extends AsseticHelper -{ - private $assetsHelper; - - /** - * Constructor. - * - * @param CoreAssetsHelper $assetsHelper The assets helper - * @param AssetFactory $factory The asset factory - */ - public function __construct(CoreAssetsHelper $assetsHelper, AssetFactory $factory) - { - $this->assetsHelper = $assetsHelper; - - parent::__construct($factory); - } - - protected function getAssetUrl(AssetInterface $asset, $options = array()) - { - return $this->assetsHelper->getUrl($asset->getTargetPath(), isset($options['package']) ? $options['package'] : null); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/CacheWarmer/AssetManagerCacheWarmerTest.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/CacheWarmer/AssetManagerCacheWarmerTest.php deleted file mode 100644 index 597fe4d..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/CacheWarmer/AssetManagerCacheWarmerTest.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Tests\CacheWarmer; - -use Symfony\Bundle\AsseticBundle\CacheWarmer\AssetManagerCacheWarmer; - -class AssetManagerCacheWarmerTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!class_exists('Assetic\\AssetManager')) { - $this->markTestSkipped('Assetic is not available.'); - } - } - - public function testWarmUp() - { - $am = $this - ->getMockBuilder('Assetic\\Factory\\LazyAssetManager') - ->disableOriginalConstructor() - ->getMock() - ; - - $am->expects($this->once())->method('load'); - - $container = $this - ->getMockBuilder('Symfony\\Component\\DependencyInjection\\Container') - ->setConstructorArgs(array()) - ->getMock() - ; - - $container - ->expects($this->once()) - ->method('get') - ->with('assetic.asset_manager') - ->will($this->returnValue($am)) - ; - - $warmer = new AssetManagerCacheWarmer($container); - $warmer->warmUp('/path/to/cache'); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Command/DumpCommandTest.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Command/DumpCommandTest.php deleted file mode 100644 index a2862c7..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Command/DumpCommandTest.php +++ /dev/null @@ -1,202 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Tests\Command; - -use Symfony\Bundle\AsseticBundle\Command\DumpCommand; -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\NullOutput; - -class DumpCommandTest extends \PHPUnit_Framework_TestCase -{ - private $writeTo; - private $application; - private $definition; - private $kernel; - private $container; - private $am; - - protected function setUp() - { - if (!class_exists('Assetic\\AssetManager')) { - $this->markTestSkipped('Assetic is not available.'); - } - - $this->writeTo = sys_get_temp_dir().'/assetic_dump'; - - $this->application = $this->getMockBuilder('Symfony\\Bundle\\FrameworkBundle\\Console\\Application') - ->disableOriginalConstructor() - ->getMock(); - $this->definition = $this->getMockBuilder('Symfony\\Component\\Console\\Input\\InputDefinition') - ->disableOriginalConstructor() - ->getMock(); - $this->kernel = $this->getMock('Symfony\\Component\\HttpKernel\\KernelInterface'); - $this->helperSet = $this->getMock('Symfony\\Component\\Console\\Helper\\HelperSet'); - $this->container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface'); - $this->am = $this->getMockBuilder('Assetic\\Factory\\LazyAssetManager') - ->disableOriginalConstructor() - ->getMock(); - - $this->application->expects($this->any()) - ->method('getDefinition') - ->will($this->returnValue($this->definition)); - $this->definition->expects($this->any()) - ->method('getArguments') - ->will($this->returnValue(array())); - $this->definition->expects($this->any()) - ->method('getOptions') - ->will($this->returnValue(array( - new InputOption('--verbose', '-v', InputOption::VALUE_NONE, 'Increase verbosity of messages.'), - new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The Environment name.', 'dev'), - new InputOption('--no-debug', null, InputOption::VALUE_NONE, 'Switches off debug mode.'), - ))); - $this->application->expects($this->any()) - ->method('getKernel') - ->will($this->returnValue($this->kernel)); - $this->application->expects($this->once()) - ->method('getHelperSet') - ->will($this->returnValue($this->helperSet)); - $this->kernel->expects($this->any()) - ->method('getContainer') - ->will($this->returnValue($this->container)); - - $writeTo = $this->writeTo; - $this->container->expects($this->any()) - ->method('getParameter') - ->will($this->returnCallback(function($p) use($writeTo) { - if ('assetic.write_to' === $p) { - return $writeTo; - } else if ('assetic.variables' === $p) { - return array(); - } - - throw new \RuntimeException(sprintf('Unknown parameter "%s".', $p)); - })); - - $this->container->expects($this->once()) - ->method('get') - ->with('assetic.asset_manager') - ->will($this->returnValue($this->am)); - - $this->command = new DumpCommand(); - $this->command->setApplication($this->application); - } - - protected function tearDown() - { - if (is_dir($this->writeTo)) { - array_map('unlink', glob($this->writeTo.'/*')); - rmdir($this->writeTo); - } - } - - public function testEmptyAssetManager() - { - $this->am->expects($this->once()) - ->method('getNames') - ->will($this->returnValue(array())); - - $this->command->run(new ArrayInput(array()), new NullOutput()); - } - - public function testDumpOne() - { - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - - $this->am->expects($this->once()) - ->method('getNames') - ->will($this->returnValue(array('test_asset'))); - $this->am->expects($this->once()) - ->method('get') - ->with('test_asset') - ->will($this->returnValue($asset)); - $this->am->expects($this->once()) - ->method('getFormula') - ->with('test_asset') - ->will($this->returnValue(array())); - $this->am->expects($this->once()) - ->method('isDebug') - ->will($this->returnValue(false)); - $asset->expects($this->once()) - ->method('getTargetPath') - ->will($this->returnValue('test_asset.css')); - $asset->expects($this->once()) - ->method('dump') - ->will($this->returnValue('/* test_asset */')); - $asset->expects($this->any()) - ->method('getVars') - ->will($this->returnValue(array())); - $asset->expects($this->any()) - ->method('getValues') - ->will($this->returnValue(array())); - - $this->command->run(new ArrayInput(array()), new NullOutput()); - - $this->assertFileExists($this->writeTo.'/test_asset.css'); - $this->assertEquals('/* test_asset */', file_get_contents($this->writeTo.'/test_asset.css')); - } - - public function testDumpDebug() - { - $asset = $this->getMock('Assetic\\Asset\\AssetCollection'); - $leaf = $this->getMock('Assetic\\Asset\\AssetInterface'); - - $this->am->expects($this->once()) - ->method('getNames') - ->will($this->returnValue(array('test_asset'))); - $this->am->expects($this->once()) - ->method('get') - ->with('test_asset') - ->will($this->returnValue($asset)); - $this->am->expects($this->once()) - ->method('getFormula') - ->with('test_asset') - ->will($this->returnValue(array())); - $this->am->expects($this->once()) - ->method('isDebug') - ->will($this->returnValue(true)); - $asset->expects($this->once()) - ->method('getTargetPath') - ->will($this->returnValue('test_asset.css')); - $asset->expects($this->once()) - ->method('dump') - ->will($this->returnValue('/* test_asset */')); - $asset->expects($this->once()) - ->method('getIterator') - ->will($this->returnValue(new \ArrayIterator(array($leaf)))); - $asset->expects($this->any()) - ->method('getVars') - ->will($this->returnValue(array())); - $asset->expects($this->any()) - ->method('getValues') - ->will($this->returnValue(array())); - $leaf->expects($this->once()) - ->method('getTargetPath') - ->will($this->returnValue('test_leaf.css')); - $leaf->expects($this->once()) - ->method('dump') - ->will($this->returnValue('/* test_leaf */')); - $leaf->expects($this->any()) - ->method('getVars') - ->will($this->returnValue(array())); - $leaf->expects($this->any()) - ->method('getValues') - ->will($this->returnValue(array())); - - $this->command->run(new ArrayInput(array()), new NullOutput()); - - $this->assertFileExists($this->writeTo.'/test_asset.css'); - $this->assertFileExists($this->writeTo.'/test_leaf.css'); - $this->assertEquals('/* test_asset */', file_get_contents($this->writeTo.'/test_asset.css')); - $this->assertEquals('/* test_leaf */', file_get_contents($this->writeTo.'/test_leaf.css')); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Controller/AsseticControllerTest.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Controller/AsseticControllerTest.php deleted file mode 100644 index 5fb058e..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Controller/AsseticControllerTest.php +++ /dev/null @@ -1,167 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Tests\Controller; - -use Symfony\Bundle\AsseticBundle\Controller\AsseticController; - -class AsseticControllerTest extends \PHPUnit_Framework_TestCase -{ - protected $request; - protected $headers; - protected $am; - protected $cache; - - protected $controller; - - protected function setUp() - { - if (!class_exists('Assetic\\AssetManager')) { - $this->markTestSkipped('Assetic is not available.'); - } - - $this->request = $this->getMock('Symfony\\Component\\HttpFoundation\\Request'); - $this->headers = $this->getMock('Symfony\\Component\\HttpFoundation\\ParameterBag'); - $this->request->headers = $this->headers; - $this->am = $this->getMockBuilder('Assetic\\Factory\\LazyAssetManager') - ->disableOriginalConstructor() - ->getMock(); - $this->cache = $this->getMock('Assetic\\Cache\\CacheInterface'); - - $this->controller = new AsseticController($this->request, $this->am, $this->cache); - } - - public function testRenderNotFound() - { - $this->setExpectedException('Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException'); - - $name = 'foo'; - - $this->am->expects($this->once()) - ->method('has') - ->with($name) - ->will($this->returnValue(false)); - - $this->controller->render($name); - } - - public function testRenderLastModifiedFresh() - { - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - - $name = 'foo'; - $lastModified = strtotime('2010-10-10 10:10:10'); - $ifModifiedSince = gmdate('D, d M Y H:i:s', $lastModified).' GMT'; - - $asset->expects($this->any())->method('getFilters')->will($this->returnValue(array())); - $this->am->expects($this->once())->method('has')->with($name)->will($this->returnValue(true)); - $this->am->expects($this->once())->method('get')->with($name)->will($this->returnValue($asset)); - $asset->expects($this->once())->method('getLastModified')->will($this->returnValue($lastModified)); - $this->headers->expects($this->once())->method('get')->with('If-Modified-Since')->will($this->returnValue($ifModifiedSince)); - - $asset->expects($this->never()) - ->method('dump'); - - $response = $this->controller->render($name); - $this->assertEquals(304, $response->getStatusCode(), '->render() sends a Not Modified response when If-Modified-Since is fresh'); - } - - public function testRenderLastModifiedStale() - { - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - - $name = 'foo'; - $content = '==ASSET_CONTENT=='; - $lastModified = strtotime('2010-10-10 10:10:10'); - $ifModifiedSince = gmdate('D, d M Y H:i:s', $lastModified - 300).' GMT'; - - $asset->expects($this->any())->method('getFilters')->will($this->returnValue(array())); - $this->am->expects($this->once())->method('has')->with($name)->will($this->returnValue(true)); - $this->am->expects($this->once())->method('get')->with($name)->will($this->returnValue($asset)); - $asset->expects($this->exactly(2))->method('getLastModified')->will($this->returnValue($lastModified)); - $this->headers->expects($this->once())->method('get')->with('If-Modified-Since')->will($this->returnValue($ifModifiedSince)); - - $this->cache->expects($this->once()) - ->method('has') - ->with($this->isType('string')) - ->will($this->returnValue(false)); - $asset->expects($this->once()) - ->method('dump') - ->will($this->returnValue($content)); - - $response = $this->controller->render($name); - $this->assertEquals(200, $response->getStatusCode(), '->render() sends an OK response when If-Modified-Since is stale'); - $this->assertEquals($content, $response->getContent(), '->render() sends the dumped asset as the response content'); - } - - public function testRenderETagFresh() - { - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - - $name = 'foo'; - $formula = array(array('js/core.js'), array(), array('')); - $etag = md5(serialize($formula + array('last_modified' => null))); - - $asset->expects($this->any())->method('getFilters')->will($this->returnValue(array())); - $this->am->expects($this->once())->method('has')->with($name)->will($this->returnValue(true)); - $this->am->expects($this->once())->method('get')->with($name)->will($this->returnValue($asset)); - - $this->am->expects($this->once()) - ->method('hasFormula') - ->with($name) - ->will($this->returnValue(true)); - $this->am->expects($this->once()) - ->method('getFormula') - ->with($name) - ->will($this->returnValue($formula)); - $this->request->expects($this->once()) - ->method('getETags') - ->will($this->returnValue(array('"'.$etag.'"'))); - $asset->expects($this->never()) - ->method('dump'); - - $response = $this->controller->render($name); - $this->assertEquals(304, $response->getStatusCode(), '->render() sends a Not Modified response when If-None-Match is fresh'); - } - - public function testRenderETagStale() - { - $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); - - $name = 'foo'; - $content = '==ASSET_CONTENT=='; - $formula = array(array('js/core.js'), array(), array('')); - $etag = md5(serialize($formula + array('last_modified' => null))); - - $asset->expects($this->any())->method('getFilters')->will($this->returnValue(array())); - $this->am->expects($this->once())->method('has')->with($name)->will($this->returnValue(true)); - $this->am->expects($this->once())->method('get')->with($name)->will($this->returnValue($asset)); - - $this->am->expects($this->once()) - ->method('hasFormula') - ->with($name) - ->will($this->returnValue(true)); - $this->am->expects($this->once()) - ->method('getFormula') - ->with($name) - ->will($this->returnValue($formula)); - $this->request->expects($this->once()) - ->method('getETags') - ->will($this->returnValue(array('"123"'))); - $asset->expects($this->once()) - ->method('dump') - ->will($this->returnValue($content)); - - $response = $this->controller->render($name); - $this->assertEquals(200, $response->getStatusCode(), '->render() sends an OK response when If-None-Match is stale'); - $this->assertEquals($content, $response->getContent(), '->render() sends the dumped asset as the response content'); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/DependencyInjection/AsseticExtensionTest.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/DependencyInjection/AsseticExtensionTest.php deleted file mode 100644 index ebdb8cb..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/DependencyInjection/AsseticExtensionTest.php +++ /dev/null @@ -1,215 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Tests\DependencyInjection; - -use Symfony\Bundle\AsseticBundle\DependencyInjection\AsseticExtension; -use Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler\CheckYuiFilterPass; -use Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler\CheckClosureFilterPass; -use Symfony\Component\DependencyInjection\Container; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Dumper\PhpDumper; -use Symfony\Component\DependencyInjection\Scope; -use Symfony\Component\HttpFoundation\Request; - -class AsseticExtensionTest extends \PHPUnit_Framework_TestCase -{ - private $kernel; - private $container; - - static public function assertSaneContainer(Container $container, $message = '') - { - $errors = array(); - foreach ($container->getServiceIds() as $id) { - try { - $container->get($id); - } catch (\Exception $e) { - $errors[$id] = $e->getMessage(); - } - } - - self::assertEquals(array(), $errors, $message); - } - - protected function setUp() - { - if (!class_exists('Assetic\\AssetManager')) { - $this->markTestSkipped('Assetic is not available.'); - } - - $this->kernel = $this->getMock('Symfony\\Component\\HttpKernel\\KernelInterface'); - - $this->container = new ContainerBuilder(); - $this->container->addScope(new Scope('request')); - $this->container->register('request', 'Symfony\\Component\\HttpFoundation\\Request')->setScope('request'); - $this->container->register('templating.helper.assets', $this->getMockClass('Symfony\\Component\\Templating\\Helper\\AssetsHelper')); - $this->container->register('templating.helper.router', $this->getMockClass('Symfony\\Bundle\\FrameworkBundle\\Templating\\Helper\\RouterHelper')) - ->addArgument(new Definition($this->getMockClass('Symfony\\Component\\Routing\\RouterInterface'))); - $this->container->register('twig', 'Twig_Environment'); - $this->container->setParameter('kernel.bundles', array()); - $this->container->setParameter('kernel.cache_dir', __DIR__); - $this->container->setParameter('kernel.debug', false); - $this->container->setParameter('kernel.root_dir', __DIR__); - $this->container->setParameter('kernel.charset', 'UTF-8'); - $this->container->set('kernel', $this->kernel); - } - - /** - * @dataProvider getDebugModes - */ - public function testDefaultConfig($debug) - { - $this->container->setParameter('kernel.debug', $debug); - - $extension = new AsseticExtension(); - $extension->load(array(array()), $this->container); - - $this->assertFalse($this->container->has('assetic.filter.yui_css'), '->load() does not load the yui_css filter when a yui value is not provided'); - $this->assertFalse($this->container->has('assetic.filter.yui_js'), '->load() does not load the yui_js filter when a yui value is not provided'); - - $this->assertSaneContainer($this->getDumpedContainer()); - } - - public function getDebugModes() - { - return array( - array(true), - array(false), - ); - } - - /** - * @dataProvider getFilterNames - */ - public function testFilterConfigs($name, $config = array()) - { - $extension = new AsseticExtension(); - $extension->load(array(array('filters' => array($name => $config))), $this->container); - - $this->assertSaneContainer($this->getDumpedContainer()); - } - - public function getFilterNames() - { - return array( - array('closure', array('jar' => '/path/to/closure.jar')), - array('coffee'), - array('compass'), - array('cssembed', array('jar' => '/path/to/cssembed.jar')), - array('cssimport'), - array('cssrewrite'), - array('jpegoptim'), - array('jpegtran'), - array('less'), - array('lessphp'), - array('optipng'), - array('packager'), - array('pngout'), - array('sass'), - array('scss'), - array('sprockets', array('include_dirs' => array('foo'))), - array('stylus'), - array('yui_css', array('jar' => '/path/to/yuicompressor.jar')), - array('yui_js', array('jar' => '/path/to/yuicompressor.jar')), - ); - } - - /** - * @dataProvider getUseControllerKeys - */ - public function testUseController($bool, $includes, $omits) - { - $extension = new AsseticExtension(); - $extension->load(array(array('use_controller' => $bool)), $this->container); - - foreach ($includes as $id) { - $this->assertTrue($this->container->has($id), '"'.$id.'" is registered when use_controller is '.$bool); - } - - foreach ($omits as $id) { - $this->assertFalse($this->container->has($id), '"'.$id.'" is not registered when use_controller is '.$bool); - } - - $this->assertSaneContainer($this->getDumpedContainer()); - } - - public function getUseControllerKeys() - { - return array( - array(true, array('assetic.routing_loader', 'assetic.controller'), array()), - array(false, array(), array('assetic.routing_loader', 'assetic.controller')), - ); - } - - /** - * @dataProvider getClosureJarAndExpected - */ - public function testClosureCompilerPass($jar, $expected) - { - $this->container->addCompilerPass(new CheckClosureFilterPass()); - - $extension = new AsseticExtension(); - $extension->load(array(array( - 'filters' => array( - 'closure' => array('jar' => $jar), - ), - )), $this->container); - - $container = $this->getDumpedContainer(); - $this->assertSaneContainer($container); - - $this->assertTrue($this->container->getDefinition($expected)->hasTag('assetic.filter')); - $this->assertNotEmpty($container->getParameter('assetic.filter.closure.java')); - } - - public function getClosureJarAndExpected() - { - return array( - array(null, 'assetic.filter.closure.api'), - array('/path/to/closure.jar', 'assetic.filter.closure.jar'), - ); - } - - public function testInvalidYuiConfig() - { - $this->setExpectedException('RuntimeException', 'assetic.filters.yui_js'); - - $this->container->addCompilerPass(new CheckYuiFilterPass()); - - $extension = new AsseticExtension(); - $extension->load(array(array( - 'filters' => array( - 'yui_js' => array(), - ), - )), $this->container); - - $this->getDumpedContainer(); - } - - private function getDumpedContainer() - { - static $i = 0; - $class = 'AsseticExtensionTestContainer'.$i++; - - $this->container->compile(); - - $dumper = new PhpDumper($this->container); - eval('?>'.$dumper->dump(array('class' => $class))); - - $container = new $class(); - $container->enterScope('request'); - $container->set('request', Request::create('/')); - $container->set('kernel', $this->kernel); - - return $container; - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Factory/AssetFactoryTest.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Factory/AssetFactoryTest.php deleted file mode 100644 index 89f2f9e..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Factory/AssetFactoryTest.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Tests\Factory; - -use Symfony\Bundle\AsseticBundle\Factory\AssetFactory; - -class AssetFactoryTest extends \PHPUnit_Framework_TestCase -{ - protected $kernel; - protected $factory; - protected $container; - - protected function setUp() - { - if (!class_exists('Assetic\\AssetManager')) { - $this->markTestSkipped('Assetic is not available.'); - } - - $this->kernel = $this->getMock('Symfony\\Component\\HttpKernel\\KernelInterface'); - $this->container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface'); - $this->parameterBag = $this->getMock('Symfony\\Component\\DependencyInjection\\ParameterBag\\ParameterBagInterface'); - $this->factory = new AssetFactory($this->kernel, $this->container, $this->parameterBag, '/path/to/web'); - } - - public function testBundleNotation() - { - $input = '@MyBundle/Resources/css/main.css'; - $bundle = $this->getMock('Symfony\\Component\\HttpKernel\\Bundle\\BundleInterface'); - - $this->parameterBag->expects($this->once()) - ->method('resolveValue') - ->will($this->returnCallback(function($v) { return $v; })); - $this->kernel->expects($this->once()) - ->method('getBundle') - ->with('MyBundle') - ->will($this->returnValue($bundle)); - $this->kernel->expects($this->once()) - ->method('locateResource') - ->with($input) - ->will($this->returnValue('/path/to/MyBundle/Resources/css/main.css')); - $bundle->expects($this->once()) - ->method('getPath') - ->will($this->returnValue('/path/to/MyBundle')); - - $coll = $this->factory->createAsset($input)->all(); - $asset = $coll[0]; - - $this->assertEquals('/path/to/MyBundle', $asset->getSourceRoot(), '->createAsset() sets the asset root'); - $this->assertEquals('Resources/css/main.css', $asset->getSourcePath(), '->createAsset() sets the asset path'); - } - - /** - * @dataProvider getGlobs - */ - public function testBundleGlobNotation($input) - { - $bundle = $this->getMock('Symfony\\Component\\HttpKernel\\Bundle\\BundleInterface'); - - $this->parameterBag->expects($this->once()) - ->method('resolveValue') - ->will($this->returnCallback(function($v) { return $v; })); - $this->kernel->expects($this->once()) - ->method('getBundle') - ->with('MyBundle') - ->will($this->returnValue($bundle)); - $this->kernel->expects($this->once()) - ->method('locateResource') - ->with('@MyBundle/Resources/css/') - ->will($this->returnValue('/path/to/MyBundle/Resources/css/')); - $bundle->expects($this->once()) - ->method('getPath') - ->will($this->returnValue('/path/to/MyBundle')); - - $coll = $this->factory->createAsset($input)->all(); - $asset = $coll[0]; - - $this->assertEquals('/path/to/MyBundle', $asset->getSourceRoot(), '->createAsset() sets the asset root'); - $this->assertNull($asset->getSourcePath(), '->createAsset() sets the asset path to null'); - } - - public function getGlobs() - { - return array( - array('@MyBundle/Resources/css/*'), - array('@MyBundle/Resources/css/*/*.css'), - ); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Factory/Resource/CoalescingDirectoryResourceTest.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Factory/Resource/CoalescingDirectoryResourceTest.php deleted file mode 100644 index 4967e45..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Factory/Resource/CoalescingDirectoryResourceTest.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Tests\Factory\Resource; - -use Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource; - -class CoalescingDirectoryResourceTest extends \PHPUnit_Framework_TestCase -{ - public function testFiltering() - { - $dir1 = $this->getMock('Assetic\\Factory\\Resource\\IteratorResourceInterface'); - $file1a = $this->getMock('Assetic\\Factory\\Resource\\ResourceInterface'); - $file1b = $this->getMock('Assetic\\Factory\\Resource\\ResourceInterface'); - - $dir2 = $this->getMock('Assetic\\Factory\\Resource\\IteratorResourceInterface'); - $file2a = $this->getMock('Assetic\\Factory\\Resource\\ResourceInterface'); - $file2c = $this->getMock('Assetic\\Factory\\Resource\\ResourceInterface'); - - $dir1->expects($this->any()) - ->method('getIterator') - ->will($this->returnValue(new \ArrayIterator(array($file1a, $file1b)))); - $file1a->expects($this->any()) - ->method('__toString') - ->will($this->returnValue('FooBundle:Foo:file1.foo.bar')); - $file1b->expects($this->any()) - ->method('__toString') - ->will($this->returnValue('FooBundle:Foo:file2.foo.bar')); - - $dir2->expects($this->any()) - ->method('getIterator') - ->will($this->returnValue(new \ArrayIterator(array($file2a, $file2c)))); - $file2a->expects($this->any()) - ->method('__toString') - ->will($this->returnValue('BarBundle:Foo:file1.foo.bar')); - $file2c->expects($this->any()) - ->method('__toString') - ->will($this->returnValue('BarBundle:Foo:file3.foo.bar')); - - $resource = new CoalescingDirectoryResource(array($dir1, $dir2)); - - $actual = array(); - foreach ($resource as $file) { - $actual[] = (string) $file; - } - - $expected = array( - 'FooBundle:Foo:file1.foo.bar', - 'FooBundle:Foo:file2.foo.bar', - 'BarBundle:Foo:file3.foo.bar', - ); - - $this->assertEquals($expected, $actual); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Factory/Resource/FileResourceTest.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Factory/Resource/FileResourceTest.php deleted file mode 100644 index 2132366..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Factory/Resource/FileResourceTest.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Tests\Factory\Resource; - -use Symfony\Bundle\AsseticBundle\Factory\Resource\FileResource; - -class FileResourceTest extends \PHPUnit_Framework_TestCase -{ - private $loader; - - protected function setUp() - { - $this->loader = $this->getMock('Symfony\\Component\\Templating\\Loader\\LoaderInterface'); - } - - public function testCastAsString() - { - $baseDir = '/path/to/MyBundle/Resources/views/'; - $resource = new FileResource($this->loader, 'MyBundle', $baseDir, $baseDir.'Section/template.html.twig'); - $this->assertEquals('MyBundle:Section:template.html.twig', (string) $resource); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/FilterManagerTest.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/FilterManagerTest.php deleted file mode 100644 index 9ef67fb..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/FilterManagerTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Tests; - -use Symfony\Bundle\AsseticBundle\FilterManager; - -class FilterManagerTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!class_exists('Assetic\\AssetManager')) { - $this->markTestSkipped('Assetic is not available.'); - } - } - - public function testGet() - { - $container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface'); - $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); - - $container->expects($this->exactly(2)) - ->method('get') - ->with('assetic.filter.bar') - ->will($this->returnValue($filter)); - - $fm = new FilterManager($container, array('foo' => 'assetic.filter.bar')); - - $this->assertSame($filter, $fm->get('foo'), '->get() loads the filter from the container'); - $this->assertSame($filter, $fm->get('foo'), '->get() loads the filter from the container'); - } - - public function testHas() - { - $container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface'); - - $fm = new FilterManager($container, array('foo' => 'assetic.filter.bar')); - $this->assertTrue($fm->has('foo'), '->has() returns true for lazily mapped filters'); - } - - public function testGetNames() - { - $container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface'); - $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); - - $fm = new FilterManager($container, array('foo' => 'assetic.filter.bar')); - $fm->set('bar', $filter); - - $this->assertEquals(array('foo', 'bar'), $fm->getNames(), '->getNames() returns all lazy and normal filter names'); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/FunctionalTest.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/FunctionalTest.php deleted file mode 100644 index 814c1cd..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/FunctionalTest.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Tests; - -use Symfony\Component\DomCrawler\Crawler; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\Filesystem\Filesystem; - -/** - * @group functional - */ -class FunctionalTest extends \PHPUnit_Framework_TestCase -{ - protected $cacheDir; - - protected function setUp() - { - if (!class_exists('Assetic\\AssetManager')) { - $this->markTestSkipped('Assetic is not available.'); - } - - $this->cacheDir = __DIR__.'/Resources/cache'; - if (file_exists($this->cacheDir)) { - $filesystem = new Filesystem(); - $filesystem->remove($this->cacheDir); - } - - mkdir($this->cacheDir, 0777, true); - } - - protected function tearDown() - { - $filesystem = new Filesystem(); - $filesystem->remove($this->cacheDir); - } - - public function testTwigRenderDebug() - { - $kernel = new TestKernel('test', true); - $kernel->boot(); - $container = $kernel->getContainer(); - $container->enterScope('request'); - $container->set('request', new Request()); - - $content = $container->get('templating')->render('::layout.html.twig'); - $crawler = new Crawler($content); - - $this->assertEquals(3, count($crawler->filter('link[href$=".css"]'))); - $this->assertEquals(2, count($crawler->filter('script[src$=".js"]'))); - } - - public function testPhpRenderDebug() - { - $kernel = new TestKernel('test', true); - $kernel->boot(); - $container = $kernel->getContainer(); - $container->enterScope('request'); - $container->set('request', new Request()); - - $content = $container->get('templating')->render('::layout.html.php'); - $crawler = new Crawler($content); - - $this->assertEquals(3, count($crawler->filter('link[href$=".css"]'))); - $this->assertEquals(2, count($crawler->filter('script[src$=".js"]'))); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/Resources/views/base.html.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/Resources/views/base.html.php deleted file mode 100644 index 69a886c..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/Resources/views/base.html.php +++ /dev/null @@ -1,11 +0,0 @@ - - - - <?php $view['slots']->output('title') ?> - output('stylesheets') ?> - - - output('_content') ?> - output('javascripts') ?> - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/Resources/views/base.html.twig b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/Resources/views/base.html.twig deleted file mode 100644 index f2d8de8..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/Resources/views/base.html.twig +++ /dev/null @@ -1,11 +0,0 @@ - - - - {% block title '' %} - {% block stylesheets '' %} - - - {% block content '' %} - {% block javascripts '' %} - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/Resources/views/layout.html.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/Resources/views/layout.html.php deleted file mode 100644 index bd70943..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/Resources/views/layout.html.php +++ /dev/null @@ -1,17 +0,0 @@ -extend('::base.html.php') ?> - -start('stylesheets') ?> - stylesheets('stylesheet1.css, stylesheet2.css, @TestBundle/Resources/css/bundle.css') as $url): ?> - - -stop() ?> - -start('javascripts') ?> - javascripts('javascript1.js, javascript2.js') as $url): ?> - - -stop() ?> - -image('logo.png') as $url): ?> - - diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/Resources/views/layout.html.twig b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/Resources/views/layout.html.twig deleted file mode 100644 index 24cb963..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/Resources/views/layout.html.twig +++ /dev/null @@ -1,19 +0,0 @@ -{% extends '::base.html.twig' %} - -{% block stylesheets %} - {% stylesheets 'stylesheet1.css' 'stylesheet2.css' '@TestBundle/Resources/css/bundle.css' %} - - {% endstylesheets %} -{% endblock %} - -{% block javascripts %} - {% javascripts 'javascript1.js' 'javascript2.js' %} - - {% endjavascripts %} -{% endblock %} - -{% block content %} - {% image 'logo.png' %} - - {% endimage %} -{% endblock %} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/config/config.yml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/config/config.yml deleted file mode 100644 index b43798c..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/config/config.yml +++ /dev/null @@ -1,40 +0,0 @@ -framework: - charset: UTF-8 - secret: xxxxxxxxxx - csrf_protection: - enabled: true - router: { resource: "%kernel.root_dir%/config/routing.yml" } - validation: { enabled: true, enable_annotations: true } - templating: { engines: ['twig', 'php'] } - session: - lifetime: 3600 - auto_start: false - -twig: - debug: %kernel.debug% - strict_variables: %kernel.debug% - -assetic: - use_controller: true - read_from: "%kernel.root_dir%/web" - bundles: [ TestBundle ] - assets: - jquery: js/jquery.js - app_css: - inputs: - - css/main.css - - css/more.css - - @widget_css - filters: [ ?yui_css ] - output: css/packed/app.css - widget_css: - inputs: css/widget.sass - filters: sass - filters: - sass: - apply_to: "\.sass$" - yui_css: - jar: %kernel.root_dir/java/yui-compressor-2.4.6.jar - twig: - functions: - yui_css: { output: css/*.css } diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/config/routing.yml b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/config/routing.yml deleted file mode 100644 index 1d36e9b..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/config/routing.yml +++ /dev/null @@ -1,3 +0,0 @@ -_assetic: - resource: . - type: assetic diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/web/javascript1.js b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/web/javascript1.js deleted file mode 100644 index 17f5a35..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/web/javascript1.js +++ /dev/null @@ -1 +0,0 @@ -// javascript1.js \ No newline at end of file diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/web/javascript2.js b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/web/javascript2.js deleted file mode 100644 index 1790420..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/web/javascript2.js +++ /dev/null @@ -1 +0,0 @@ -// javascript2.js \ No newline at end of file diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/web/stylesheet1.css b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/web/stylesheet1.css deleted file mode 100644 index 394efa6..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/web/stylesheet1.css +++ /dev/null @@ -1 +0,0 @@ -/* stylesheet1.css */ \ No newline at end of file diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/web/stylesheet2.css b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/web/stylesheet2.css deleted file mode 100644 index fbeb02a..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Resources/web/stylesheet2.css +++ /dev/null @@ -1 +0,0 @@ -/* stylesheet2.css */ \ No newline at end of file diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Templating/AsseticHelperTest.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Templating/AsseticHelperTest.php deleted file mode 100644 index fd1ed8f..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/Templating/AsseticHelperTest.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Tests\Templating; - -use Assetic\Asset\AssetCollection; -use Assetic\Asset\AssetInterface; -use Assetic\Asset\StringAsset; -use Assetic\Factory\AssetFactory; -use Symfony\Bundle\AsseticBundle\Templating\AsseticHelper; - -class AsseticHelperTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!class_exists('Assetic\\AssetManager')) { - $this->markTestSkipped('Assetic is not available.'); - } - } - - /** - * @dataProvider getDebugAndCount - */ - public function testUrls($debug, $count, $message) - { - $helper = new AsseticHelperForTest(new AssetFactory('/foo', $debug), $debug); - $urls = $helper->javascripts(array('js/jquery.js', 'js/jquery.plugin.js')); - - $this->assertInstanceOf('Traversable', $urls, '->javascripts() returns an array'); - $this->assertEquals($count, count($urls), $message); - } - - public function getDebugAndCount() - { - return array( - array(false, 1, '->javascripts() returns one url when not in debug mode'), - array(true, 2, '->javascripts() returns many urls when in debug mode'), - ); - } -} - -class AsseticHelperForTest extends AsseticHelper -{ - protected function getAssetUrl(AssetInterface $asset, $options = array()) - { - return $asset->getTargetPath(); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/TestBundle/Resources/css/bundle.css b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/TestBundle/Resources/css/bundle.css deleted file mode 100644 index ab93fa7..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/TestBundle/Resources/css/bundle.css +++ /dev/null @@ -1 +0,0 @@ -/* bundle.css */ \ No newline at end of file diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/TestBundle/TestBundle.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/TestBundle/TestBundle.php deleted file mode 100644 index 89564c2..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/TestBundle/TestBundle.php +++ /dev/null @@ -1,18 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Tests\TestBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; - -class TestBundle extends Bundle -{ -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/TestKernel.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/TestKernel.php deleted file mode 100644 index 3f1c0a8..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/TestKernel.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Tests; - -use Symfony\Component\Config\Loader\LoaderInterface; -use Symfony\Component\HttpKernel\Kernel; - -class TestKernel extends Kernel -{ - public function getRootDir() - { - return __DIR__.'/Resources'; - } - - public function registerBundles() - { - return array( - new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(), - new \Symfony\Bundle\TwigBundle\TwigBundle(), - new \Symfony\Bundle\AsseticBundle\AsseticBundle(), - new \Symfony\Bundle\AsseticBundle\Tests\TestBundle\TestBundle(), - ); - } - - public function registerContainerConfiguration(LoaderInterface $loader) - { - $loader->load(__DIR__.'/Resources/config/config.yml'); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/bootstrap.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/bootstrap.php deleted file mode 100644 index e7b1f84..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Tests/bootstrap.php +++ /dev/null @@ -1,17 +0,0 @@ -registerNamespace('Symfony', $_SERVER['SYMFONY']); -$loader->registerNamespace('Assetic', $_SERVER['ASSETIC']); -$loader->registerPrefix('Twig_', $_SERVER['TWIG']); -$loader->register(); - -spl_autoload_register(function($class) -{ - if (0 === strpos($class, 'Symfony\\Bundle\\AsseticBundle\\') && - file_exists($file = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 3)).'.php')) { - require_once $file; - } -}); diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Twig/AsseticExtension.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Twig/AsseticExtension.php deleted file mode 100644 index 9cbec1f..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Twig/AsseticExtension.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Twig; - -use Assetic\ValueSupplierInterface; -use Assetic\Extension\Twig\AsseticExtension as BaseAsseticExtension; -use Assetic\Factory\AssetFactory; -use Symfony\Component\Templating\TemplateNameParserInterface; - -/** - * Assetic extension. - * - * @author Kris Wallsmith - */ -class AsseticExtension extends BaseAsseticExtension -{ - private $useController; - - public function __construct(AssetFactory $factory, TemplateNameParserInterface $templateNameParser, $useController = false, $functions = array(), $enabledBundles = array(), ValueSupplierInterface $valueSupplier = null) - { - parent::__construct($factory, $functions, $valueSupplier); - - $this->useController = $useController; - $this->templateNameParser = $templateNameParser; - $this->enabledBundles = $enabledBundles; - } - - public function getTokenParsers() - { - return array( - $this->createTokenParser('javascripts', 'js/*.js'), - $this->createTokenParser('stylesheets', 'css/*.css'), - $this->createTokenParser('image', 'images/*', true), - ); - } - - public function getNodeVisitors() - { - return array( - new AsseticNodeVisitor($this->templateNameParser, $this->enabledBundles), - ); - } - - public function getGlobals() - { - $globals = parent::getGlobals(); - $globals['assetic']['use_controller'] = $this->useController; - - return $globals; - } - - private function createTokenParser($tag, $output, $single = false) - { - $tokenParser = new AsseticTokenParser($this->factory, $tag, $output, $single, array('package')); - $tokenParser->setTemplateNameParser($this->templateNameParser); - $tokenParser->setEnabledBundles($this->enabledBundles); - - return $tokenParser; - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Twig/AsseticNode.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Twig/AsseticNode.php deleted file mode 100644 index 1a6a0cc..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Twig/AsseticNode.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Twig; - -use Assetic\Asset\AssetInterface; -use Assetic\Extension\Twig\AsseticNode as BaseAsseticNode; - -/** - * Assetic node. - * - * @author Kris Wallsmith - */ -class AsseticNode extends BaseAsseticNode -{ - protected function compileAssetUrl(\Twig_Compiler $compiler, AssetInterface $asset, $name) - { - $compiler - ->raw('isset($context[\'assetic\'][\'use_controller\']) && $context[\'assetic\'][\'use_controller\'] ? ') - ->subcompile($this->getPathFunction($name)) - ->raw(' : ') - ->subcompile($this->getAssetFunction(new TargetPathNode($this, $asset, $name))) - ; - } - - private function getPathFunction($name) - { - return new \Twig_Node_Expression_Function( - version_compare(\Twig_Environment::VERSION, '1.2.0-DEV', '<') - ? new \Twig_Node_Expression_Name('path', $this->getLine()) : 'path', - new \Twig_Node(array(new \Twig_Node_Expression_Constant('_assetic_'.$name, $this->getLine()))), - $this->getLine() - ); - } - - private function getAssetFunction($path) - { - $arguments = array($path); - - if ($this->hasAttribute('package')) { - $arguments[] = new \Twig_Node_Expression_Constant($this->getAttribute('package'), $this->getLine()); - } - - return new \Twig_Node_Expression_Function( - version_compare(\Twig_Environment::VERSION, '1.2.0-DEV', '<') - ? new \Twig_Node_Expression_Name('asset', $this->getLine()) : 'asset', - new \Twig_Node($arguments), - $this->getLine() - ); - } -} - -class TargetPathNode extends AsseticNode -{ - private $node; - private $asset; - private $name; - - public function __construct(AsseticNode $node, AssetInterface $asset, $name) - { - $this->node = $node; - $this->asset = $asset; - $this->name = $name; - } - - public function compile(\Twig_Compiler $compiler) - { - BaseAsseticNode::compileAssetUrl($compiler, $this->asset, $this->name); - } - - public function getLine() - { - return $this->node->getLine(); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Twig/AsseticNodeVisitor.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Twig/AsseticNodeVisitor.php deleted file mode 100644 index 9dc7d7b..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Twig/AsseticNodeVisitor.php +++ /dev/null @@ -1,120 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Twig; - -use Assetic\Extension\Twig\AsseticFilterFunction; -use Symfony\Bundle\AsseticBundle\Exception\InvalidBundleException; -use Symfony\Component\Templating\TemplateNameParserInterface; - -/** - * Assetic node visitor. - * - * @author Kris Wallsmith - */ -class AsseticNodeVisitor implements \Twig_NodeVisitorInterface -{ - private $templateNameParser; - private $enabledBundles; - private $useNodeName; - - public function __construct(TemplateNameParserInterface $templateNameParser, array $enabledBundles) - { - $this->templateNameParser = $templateNameParser; - $this->enabledBundles = $enabledBundles; - - $this->useNodeName = version_compare(\Twig_Environment::VERSION, '1.2.0-DEV', '<'); - } - - public function enterNode(\Twig_NodeInterface $node, \Twig_Environment $env) - { - return $node; - } - - public function leaveNode(\Twig_NodeInterface $node, \Twig_Environment $env) - { - if (!$formula = $this->checkNode($node, $env, $name)) { - return $node; - } - - // check the bundle - $templateRef = $this->templateNameParser->parse($env->getParser()->getStream()->getFilename()); - $bundle = $templateRef->get('bundle'); - if ($bundle && !in_array($bundle, $this->enabledBundles)) { - throw new InvalidBundleException($bundle, "the $name() function", $templateRef->getLogicalName(), $this->enabledBundles); - } - - list($input, $filters, $options) = $formula; - $line = $node->getLine(); - - // check context and call either asset() or path() - return new \Twig_Node_Expression_Conditional( - new \Twig_Node_Expression_GetAttr( - new \Twig_Node_Expression_Name('assetic', $line), - new \Twig_Node_Expression_Constant('use_controller', $line), - new \Twig_Node(), - \Twig_TemplateInterface::ARRAY_CALL, - $line - ), - new \Twig_Node_Expression_Function( - $this->useNodeName ? new \Twig_Node_Expression_Name('path', $line) : 'path', - new \Twig_Node(array( - new \Twig_Node_Expression_Constant('_assetic_'.$options['name'], $line), - )), - $line - ), - new \Twig_Node_Expression_Function( - $this->useNodeName ? new \Twig_Node_Expression_Name('asset', $line) : 'asset', - new \Twig_Node(array($node, new \Twig_Node_Expression_Constant(isset($options['package']) ? $options['package'] : null, $line))), - $line - ), - $line - ); - } - - /** - * Extracts formulae from filter function nodes. - * - * @return array|null The formula - */ - private function checkNode(\Twig_NodeInterface $node, \Twig_Environment $env, & $name = null) - { - if ($node instanceof \Twig_Node_Expression_Function) { - $name = $this->useNodeName - ? $node->getNode('name')->getAttribute('name') - : $node->getAttribute('name'); - if ($env->getFunction($name) instanceof AsseticFilterFunction) { - $arguments = array(); - foreach ($node->getNode('arguments') as $argument) { - $arguments[] = eval('return '.$env->compile($argument).';'); - } - - $invoker = $env->getExtension('assetic')->getFilterInvoker($name); - $factory = $invoker->getFactory(); - - $inputs = isset($arguments[0]) ? (array) $arguments[0] : array(); - $filters = $invoker->getFilters(); - $options = array_replace($invoker->getOptions(), isset($arguments[1]) ? $arguments[1] : array()); - - if (!isset($options['name'])) { - $options['name'] = $factory->generateAssetName($inputs, $filters); - } - - return array($inputs, $filters, $options); - } - } - } - - public function getPriority() - { - return 0; - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Twig/AsseticTokenParser.php b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Twig/AsseticTokenParser.php deleted file mode 100644 index 2a10fc9..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Twig/AsseticTokenParser.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Symfony\Bundle\AsseticBundle\Twig; - -use Assetic\Asset\AssetInterface; -use Assetic\Extension\Twig\AsseticTokenParser as BaseAsseticTokenParser; -use Symfony\Bundle\AsseticBundle\Exception\InvalidBundleException; -use Symfony\Component\Templating\TemplateNameParserInterface; - -/** - * Assetic token parser. - * - * @author Kris Wallsmith - */ -class AsseticTokenParser extends BaseAsseticTokenParser -{ - private $templateNameParser; - private $enabledBundles; - - public function setTemplateNameParser(TemplateNameParserInterface $templateNameParser) - { - $this->templateNameParser = $templateNameParser; - } - - public function setEnabledBundles(array $enabledBundles = null) - { - $this->enabledBundles = $enabledBundles; - } - - public function parse(\Twig_Token $token) - { - if ($this->templateNameParser && is_array($this->enabledBundles)) { - // check the bundle - $templateRef = null; - try { - $templateRef = $this->templateNameParser->parse($this->parser->getStream()->getFilename()); - } catch (\RuntimeException $e) { - // this happens when the filename isn't a Bundle:* url - // and it contains ".." - } catch (\InvalidArgumentException $e) { - // this happens when the filename isn't a Bundle:* url - // but an absolute path instead - } - $bundle = $templateRef ? $templateRef->get('bundle') : null; - if ($bundle && !in_array($bundle, $this->enabledBundles)) { - throw new InvalidBundleException($bundle, "the {% {$this->getTag()} %} tag", $templateRef->getLogicalName(), $this->enabledBundles); - } - } - - return parent::parse($token); - } - - protected function createNode(AssetInterface $asset, \Twig_NodeInterface $body, array $inputs, array $filters, $name, array $attributes = array(), $lineno = 0, $tag = null) - { - return new AsseticNode($asset, $body, $inputs, $filters, $name, $attributes, $lineno, $tag); - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/UPGRADE.md b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/UPGRADE.md deleted file mode 100644 index a61e131..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/UPGRADE.md +++ /dev/null @@ -1,10 +0,0 @@ -Changes in version 2.1 ----------------------- - - * Friendlier exception message when using Assetic in a bundle that Assetic - has not been configured to scan - * Assets are no longer dumped to the filesystem when `cache:warmup` is run. - This can only be done using the `assetic:dump` command - * Added support for GSS filter - * Assetic's routes are now automatically added when `use_controller` is - `true` diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/composer.json b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/composer.json deleted file mode 100644 index 15c8bdc..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/composer.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "symfony/assetic-bundle", - "version": "2.1.0", - "description": "Integrates Assetic into Symfony2", - "keywords": ["assets", "compression", "minification"], - "homepage": "https://github.com/symfony/AsseticBundle", - "type": "symfony-bundle", - "license": "MIT", - "authors": [ - { - "name": "Kris Wallsmith", - "email": "kris.wallsmith@gmail.com", - "homepage": "http://kriswallsmith.net/" - } - ], - "require": { - "php": ">=5.3.0", - "symfony/framework-bundle": "2.1.*", - "kriswallsmith/assetic": "1.1.*" - }, - "suggest": { - "symfony/twig-bundle": "2.1.*" - }, - "autoload": { - "psr-0": { "Symfony\\Bundle\\AsseticBundle": "" } - }, - "target-dir": "Symfony/Bundle/AsseticBundle", - "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev" - } - } -} diff --git a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/phpunit.xml.dist b/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/phpunit.xml.dist deleted file mode 100644 index 9e0e4c9..0000000 --- a/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/phpunit.xml.dist +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - ./Tests/ - - - - - - - - - - - - ./ - - ./Resources - ./Tests - - - - diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/.gitignore b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/.gitignore deleted file mode 100644 index 1d034f4..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -vendor -composer.phar -composer.lock -phpunit.xml diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/.travis.yml b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/.travis.yml deleted file mode 100644 index 39a0efe..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: php - -php: - - 5.3 - - 5.4 - -before_script: - - curl -s http://getcomposer.org/installer | php - - php composer.phar install --dev diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/Compiler/AddProcessorsPass.php b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/Compiler/AddProcessorsPass.php deleted file mode 100644 index 21b51a9..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/Compiler/AddProcessorsPass.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\MonologBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\Reference; - -/** - * Registers processors in Monolog loggers or handlers. - * - * @author Christophe Coevoet - */ -class AddProcessorsPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('monolog.logger')) { - return; - } - - foreach ($container->findTaggedServiceIds('monolog.processor') as $id => $tags) { - foreach ($tags as $tag) { - if (!empty($tag['channel']) && !empty($tag['handler'])) { - throw new \InvalidArgumentException(sprintf('you cannot specify both the "handler" and "channel" attributes for the "monolog.processor" tag on service "%s"', $id)); - } - - if (!empty($tag['handler'])) { - $definition = $container->findDefinition(sprintf('monolog.handler.%s', $tag['handler'])); - } elseif (!empty($tag['channel'])) { - if ('app' === $tag['channel']) { - $definition = $container->getDefinition('monolog.logger'); - } else { - $definition = $container->getDefinition(sprintf('monolog.logger.%s', $tag['channel'])); - } - } else { - $definition = $container->getDefinition('monolog.logger_prototype'); - } - - if (!empty($tag['method'])) { - $processor = array(new Reference($id), $tag['method']); - } else { - // If no method is defined, fallback to use __invoke - $processor = new Reference($id); - } - $definition->addMethodCall('pushProcessor', array($processor)); - } - } - } -} diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/Compiler/DebugHandlerPass.php b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/Compiler/DebugHandlerPass.php deleted file mode 100644 index 6bb67c5..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/Compiler/DebugHandlerPass.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\MonologBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\Definition; -use Monolog\Logger; - -/** - * Adds the DebugHandler when the profiler is enabled. - * - * @author Christophe Coevoet - */ -class DebugHandlerPass implements CompilerPassInterface -{ - private $channelPass; - - public function __construct(LoggerChannelPass $channelPass) - { - $this->channelPass = $channelPass; - } - - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('profiler')) { - return; - } - - $debugHandler = new Definition('%monolog.handler.debug.class%', array(Logger::DEBUG, true)); - $container->setDefinition('monolog.handler.debug', $debugHandler); - - foreach ($this->channelPass->getChannels() as $channel) { - $container - ->getDefinition($channel === 'app' ? 'monolog.logger' : 'monolog.logger.'.$channel) - ->addMethodCall('pushHandler', array(new Reference('monolog.handler.debug'))); - } - } -} diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/Compiler/LoggerChannelPass.php b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/Compiler/LoggerChannelPass.php deleted file mode 100644 index 030a87f..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/Compiler/LoggerChannelPass.php +++ /dev/null @@ -1,105 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\MonologBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; - -/** - * Replaces the default logger by another one with its own channel for tagged services. - * - * @author Christophe Coevoet - */ -class LoggerChannelPass implements CompilerPassInterface -{ - protected $channels = array('app'); - - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('monolog.logger')) { - return; - } - - foreach ($container->findTaggedServiceIds('monolog.logger') as $id => $tags) { - foreach ($tags as $tag) { - if (empty($tag['channel']) || 'app' === $tag['channel']) { - continue; - } - - $definition = $container->getDefinition($id); - $loggerId = sprintf('monolog.logger.%s', $tag['channel']); - $this->createLogger($tag['channel'], $loggerId, $container); - - foreach ($definition->getArguments() as $index => $argument) { - if ($argument instanceof Reference && 'logger' === (string) $argument) { - $definition->replaceArgument($index, new Reference($loggerId, $argument->getInvalidBehavior(), $argument->isStrict())); - } - } - - $calls = $definition->getMethodCalls(); - foreach ($calls as $i => $call) { - foreach ($call[1] as $index => $argument) { - if ($argument instanceof Reference && 'logger' === (string) $argument) { - $calls[$i][1][$index] = new Reference($loggerId, $argument->getInvalidBehavior(), $argument->isStrict()); - } - } - } - $definition->setMethodCalls($calls); - } - } - - $handlersToChannels = $container->getParameter('monolog.handlers_to_channels'); - - foreach ($handlersToChannels as $handler => $channels) { - foreach ($this->processChannels($channels) as $channel) { - try { - $logger = $container->getDefinition($channel === 'app' ? 'monolog.logger' : 'monolog.logger.'.$channel); - } catch (InvalidArgumentException $e) { - $msg = 'Monolog configuration error: The logging channel "'.$channel.'" assigned to the "'.substr($handler, 16).'" handler does not exist.'; - throw new \InvalidArgumentException($msg, 0, $e); - } - $logger->addMethodCall('pushHandler', array(new Reference($handler))); - } - } - } - - public function getChannels() - { - return $this->channels; - } - - protected function processChannels($configuration) - { - if (null === $configuration) { - return $this->channels; - } - - if ('inclusive' === $configuration['type']) { - return $configuration['elements']; - } - - return array_diff($this->channels, $configuration['elements']); - } - - protected function createLogger($channel, $loggerId, ContainerBuilder $container) - { - if (!in_array($channel, $this->channels)) { - $logger = new DefinitionDecorator('monolog.logger_prototype'); - $logger->replaceArgument(0, $channel); - $container->setDefinition($loggerId, $logger); - $this->channels[] = $channel; - } - } -} diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/Configuration.php b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/Configuration.php deleted file mode 100644 index 57a0420..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/Configuration.php +++ /dev/null @@ -1,215 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\MonologBundle\DependencyInjection; - -use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\Config\Definition\ConfigurationInterface; -use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; - -/** - * This class contains the configuration information for the bundle - * - * This information is solely responsible for how the different configuration - * sections are normalized, and merged. - * - * @author Jordi Boggiano - * @author Christophe Coevoet - */ -class Configuration implements ConfigurationInterface -{ - /** - * Generates the configuration tree builder. - * - * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder - */ - public function getConfigTreeBuilder() - { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('monolog'); - - $rootNode - ->fixXmlConfig('handler') - ->children() - ->arrayNode('handlers') - ->canBeUnset() - ->useAttributeAsKey('name') - ->prototype('array') - ->fixXmlConfig('member') - ->canBeUnset() - ->children() - ->scalarNode('type') - ->isRequired() - ->treatNullLike('null') - ->beforeNormalization() - ->always() - ->then(function($v) { return strtolower($v); }) - ->end() - ->end() - ->scalarNode('id')->end() - ->scalarNode('priority')->defaultValue(0)->end() - ->scalarNode('level')->defaultValue('DEBUG')->end() - ->booleanNode('bubble')->defaultTrue()->end() - ->scalarNode('path')->defaultValue('%kernel.logs_dir%/%kernel.environment%.log')->end() // stream and rotating - ->scalarNode('ident')->defaultFalse()->end() // syslog - ->scalarNode('facility')->defaultValue('user')->end() // syslog - ->scalarNode('max_files')->defaultValue(0)->end() // rotating - ->scalarNode('action_level')->defaultValue('WARNING')->end() // fingers_crossed - ->scalarNode('activation_strategy')->defaultNull()->end() // fingers_crossed - ->booleanNode('stop_buffering')->defaultTrue()->end()// fingers_crossed - ->scalarNode('buffer_size')->defaultValue(0)->end() // fingers_crossed and buffer - ->scalarNode('handler')->end() // fingers_crossed and buffer - ->arrayNode('publisher') - ->canBeUnset() - ->beforeNormalization() - ->ifString() - ->then(function($v) { return array('id'=> $v); }) - ->end() - ->children() - ->scalarNode('id')->end() - ->scalarNode('hostname')->end() - ->scalarNode('port')->defaultValue(12201)->end() - ->scalarNode('chunk_size')->defaultValue(1420)->end() - ->end() - ->validate() - ->ifTrue(function($v) { - return !isset($v['id']) && !isset($v['hostname']); - }) - ->thenInvalid('What must be set is either the hostname or the id.') - ->end() - ->end() // gelf - ->arrayNode('members') // group - ->canBeUnset() - ->performNoDeepMerging() - ->prototype('scalar')->end() - ->end() - ->scalarNode('from_email')->end() // swift_mailer and native_mailer - ->scalarNode('to_email')->end() // swift_mailer and native_mailer - ->scalarNode('subject')->end() // swift_mailer and native_mailer - ->arrayNode('email_prototype') // swift_mailer - ->canBeUnset() - ->beforeNormalization() - ->ifString() - ->then(function($v) { return array('id' => $v); }) - ->end() - ->children() - ->scalarNode('id')->isRequired()->end() - ->scalarNode('factory-method')->defaultNull()->end() - ->end() - ->end() - ->arrayNode('channels') - ->fixXmlConfig('channel', 'elements') - ->canBeUnset() - ->beforeNormalization() - ->ifString() - ->then(function($v) { return array('elements' => array($v)); }) - ->end() - ->beforeNormalization() - ->ifTrue(function($v) { return is_array($v) && is_numeric(key($v)); }) - ->then(function($v) { return array('elements' => $v); }) - ->end() - ->validate() - ->ifTrue(function($v) { return empty($v); }) - ->thenUnset() - ->end() - ->validate() - ->always(function ($v) { - $isExclusive = null; - if (isset($v['type'])) { - $isExclusive = 'exclusive' === $v['type']; - } - - $elements = array(); - foreach ($v['elements'] as $element) { - if (0 === strpos($element, '!')) { - if (false === $isExclusive) { - throw new InvalidConfigurationException('Cannot combine exclusive/inclusive definitions in channels list.'); - } - $elements[] = substr($element, 1); - $isExclusive = true; - } else { - if (true === $isExclusive) { - throw new InvalidConfigurationException('Cannot combine exclusive/inclusive definitions in channels list'); - } - $elements[] = $element; - $isExclusive = false; - } - } - - return array('type' => $isExclusive ? 'exclusive' : 'inclusive', 'elements' => $elements); - }) - ->end() - ->children() - ->scalarNode('type') - ->validate() - ->ifNotInArray(array('inclusive', 'exclusive')) - ->thenInvalid('The type of channels has to be inclusive or exclusive') - ->end() - ->end() - ->arrayNode('elements') - ->prototype('scalar')->end() - ->end() - ->end() - ->end() - ->scalarNode('formatter')->end() - ->end() - ->validate() - ->ifTrue(function($v) { return ('fingers_crossed' === $v['type'] || 'buffer' === $v['type']) && 1 !== count($v['handler']); }) - ->thenInvalid('The handler has to be specified to use a FingersCrossedHandler or BufferHandler') - ->end() - ->validate() - ->ifTrue(function($v) { return 'swift_mailer' === $v['type'] && empty($v['email_prototype']) && (empty($v['from_email']) || empty($v['to_email']) || empty($v['subject'])); }) - ->thenInvalid('The sender, recipient and subject or an email prototype have to be specified to use a SwiftMailerHandler') - ->end() - ->validate() - ->ifTrue(function($v) { return 'native_mailer' === $v['type'] && (empty($v['from_email']) || empty($v['to_email']) || empty($v['subject'])); }) - ->thenInvalid('The sender, recipient and subject have to be specified to use a NativeMailerHandler') - ->end() - ->validate() - ->ifTrue(function($v) { return 'service' === $v['type'] && !isset($v['id']); }) - ->thenInvalid('The id has to be specified to use a service as handler') - ->end() - ->validate() - ->ifTrue(function($v) { return 'gelf' === $v['type'] && !isset($v['publisher']); }) - ->thenInvalid('The publisher has to be specified to use a GelfHandler') - ->end() - ->end() - ->validate() - ->ifTrue(function($v) { return isset($v['debug']); }) - ->thenInvalid('The "debug" name cannot be used as it is reserved for the handler of the profiler') - ->end() - ->example(array( - 'syslog' => array( - 'type' => 'stream', - 'path' => '/var/log/symfony.log', - 'level' => 'ERROR', - 'bubble' => 'false', - 'formatter' => 'my_formatter', - 'processors' => array('some_callable') - ), - 'main' => array( - 'type' => 'fingers_crossed', - 'action_level' => 'WARNING', - 'buffer_size' => 30, - 'handler' => 'custom', - ), - 'custom' => array( - 'type' => 'service', - 'id' => 'my_handler' - ) - )) - ->end() - ->end() - ; - - return $treeBuilder; - } -} diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/MonologExtension.php b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/MonologExtension.php deleted file mode 100644 index 5636a84..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/MonologExtension.php +++ /dev/null @@ -1,289 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\MonologBundle\DependencyInjection; - -use Symfony\Component\HttpKernel\DependencyInjection\Extension; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\Config\FileLocator; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Reference; - -/** - * MonologExtension is an extension for the Monolog library. - * - * @author Jordi Boggiano - * @author Christophe Coevoet - */ -class MonologExtension extends Extension -{ - private $nestedHandlers = array(); - - /** - * Loads the Monolog configuration. - * - * @param array $configs An array of configuration settings - * @param ContainerBuilder $container A ContainerBuilder instance - */ - public function load(array $configs, ContainerBuilder $container) - { - $configuration = $this->getConfiguration($configs, $container); - $config = $this->processConfiguration($configuration, $configs); - - if (isset($config['handlers'])) { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('monolog.xml'); - $container->setAlias('logger', 'monolog.logger'); - - $handlers = array(); - - foreach ($config['handlers'] as $name => $handler) { - $handlers[] = array( - 'id' => $this->buildHandler($container, $name, $handler), - 'priority' => $handler['priority'], - 'channels' => isset($handler['channels']) ? $handler['channels'] : null - ); - } - - $handlers = array_reverse($handlers); - uasort($handlers, function($a, $b) { - if ($a['priority'] == $b['priority']) { - return 0; - } - - return $a['priority'] < $b['priority'] ? -1 : 1; - }); - $handlersToChannels = array(); - foreach ($handlers as $handler) { - if (!in_array($handler['id'], $this->nestedHandlers)) { - $handlersToChannels[$handler['id']] = $handler['channels']; - } - } - $container->setParameter('monolog.handlers_to_channels', $handlersToChannels); - - $this->addClassesToCompile(array( - 'Monolog\\Formatter\\FormatterInterface', - 'Monolog\\Formatter\\LineFormatter', - 'Monolog\\Handler\\HandlerInterface', - 'Monolog\\Handler\\AbstractHandler', - 'Monolog\\Handler\\AbstractProcessingHandler', - 'Monolog\\Handler\\StreamHandler', - 'Monolog\\Handler\\FingersCrossedHandler', - 'Monolog\\Handler\\TestHandler', - 'Monolog\\Logger', - 'Symfony\\Bridge\\Monolog\\Logger', - 'Symfony\\Bridge\\Monolog\\Handler\\DebugHandler', - )); - } - } - - /** - * Returns the base path for the XSD files. - * - * @return string The XSD base path - */ - public function getXsdValidationBasePath() - { - return __DIR__.'/../Resources/config/schema'; - } - - public function getNamespace() - { - return 'http://symfony.com/schema/dic/monolog'; - } - - private function buildHandler(ContainerBuilder $container, $name, array $handler) - { - $handlerId = $this->getHandlerId($name); - $definition = new Definition(sprintf('%%monolog.handler.%s.class%%', $handler['type'])); - $handler['level'] = is_int($handler['level']) ? $handler['level'] : constant('Monolog\Logger::'.strtoupper($handler['level'])); - - switch ($handler['type']) { - case 'service': - $container->setAlias($handlerId, $handler['id']); - - return $handlerId; - - case 'stream': - $definition->setArguments(array( - $handler['path'], - $handler['level'], - $handler['bubble'], - )); - break; - - case 'firephp': - $definition->setArguments(array( - $handler['level'], - $handler['bubble'], - )); - $definition->addTag('kernel.event_listener', array('event' => 'kernel.response', 'method' => 'onKernelResponse')); - break; - - case 'gelf': - if (isset($handler['publisher']['id'])) { - $publisherId = $handler['publisher']['id']; - } else { - $publisher = new Definition("%monolog.gelf.publisher.class%", array( - $handler['publisher']['hostname'], - $handler['publisher']['port'], - $handler['publisher']['chunk_size'], - )); - - $publisherId = 'monolog.gelf.publisher'; - $publisher->setPublic(false); - $container->setDefinition($publisherId, $publisher); - } - - $definition->setArguments(array( - new Reference($publisherId), - $handler['level'], - $handler['bubble'], - )); - break; - - case 'chromephp': - $definition->setArguments(array( - $handler['level'], - $handler['bubble'], - )); - $definition->addTag('kernel.event_listener', array('event' => 'kernel.response', 'method' => 'onKernelResponse')); - break; - - case 'rotating_file': - $definition->setArguments(array( - $handler['path'], - $handler['max_files'], - $handler['level'], - $handler['bubble'], - )); - break; - - case 'fingers_crossed': - $handler['action_level'] = is_int($handler['action_level']) ? $handler['action_level'] : constant('Monolog\Logger::'.strtoupper($handler['action_level'])); - $nestedHandlerId = $this->getHandlerId($handler['handler']); - $this->nestedHandlers[] = $nestedHandlerId; - - if (isset($handler['activation_strategy'])) { - $activation = new Reference($handler['activation_strategy']); - } else { - $activation = $handler['action_level']; - } - - $definition->setArguments(array( - new Reference($nestedHandlerId), - $activation, - $handler['buffer_size'], - $handler['bubble'], - $handler['stop_buffering'], - )); - break; - - case 'buffer': - $nestedHandlerId = $this->getHandlerId($handler['handler']); - $this->nestedHandlers[] = $nestedHandlerId; - - $definition->setArguments(array( - new Reference($nestedHandlerId), - $handler['buffer_size'], - $handler['level'], - $handler['bubble'], - )); - break; - - case 'group': - $references = array(); - foreach ($handler['members'] as $nestedHandler) { - $nestedHandlerId = $this->getHandlerId($nestedHandler); - $this->nestedHandlers[] = $nestedHandlerId; - $references[] = new Reference($nestedHandlerId); - } - - $definition->setArguments(array( - $references, - $handler['bubble'], - )); - break; - - case 'syslog': - $definition->setArguments(array( - $handler['ident'], - $handler['facility'], - $handler['level'], - $handler['bubble'], - )); - break; - - case 'swift_mailer': - if (isset($handler['email_prototype'])) { - if (!empty($handler['email_prototype']['method'])) { - $prototype = array(new Reference($handler['email_prototype']['id']), $handler['email_prototype']['method']); - } else { - $prototype = new Reference($handler['email_prototype']['id']); - } - } else { - $message = new Definition('Swift_Message'); - $message->setFactoryService('mailer'); - $message->setFactoryMethod('createMessage'); - $message->setPublic(false); - $message->addMethodCall('setFrom', array($handler['from_email'])); - $message->addMethodCall('setTo', array($handler['to_email'])); - $message->addMethodCall('setSubject', array($handler['subject'])); - $messageId = sprintf('%s.mail_prototype', $handlerId); - $container->setDefinition($messageId, $message); - $prototype = new Reference($messageId); - } - $definition->setArguments(array( - new Reference('mailer'), - $prototype, - $handler['level'], - $handler['bubble'], - )); - break; - - case 'native_mailer': - $definition->setArguments(array( - $handler['to_email'], - $handler['subject'], - $handler['from_email'], - $handler['level'], - $handler['bubble'], - )); - break; - - // Handlers using the constructor of AbstractHandler without adding their own arguments - case 'test': - case 'null': - case 'debug': - $definition->setArguments(array( - $handler['level'], - $handler['bubble'], - )); - break; - - default: - throw new \InvalidArgumentException(sprintf('Invalid handler type "%s" given for handler "%s"', $handler['type'], $name)); - } - - if (!empty($handler['formatter'])) { - $definition->addMethodCall('setFormatter', array(new Reference($handler['formatter']))); - } - $container->setDefinition($handlerId, $definition); - - return $handlerId; - } - - private function getHandlerId($name) - { - return sprintf('monolog.handler.%s', $name); - } -} diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/LICENSE b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/LICENSE deleted file mode 100644 index cdffe7a..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2012 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/MonologBundle.php b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/MonologBundle.php deleted file mode 100644 index 482f135..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/MonologBundle.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\MonologBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Bundle\MonologBundle\DependencyInjection\Compiler\LoggerChannelPass; -use Symfony\Bundle\MonologBundle\DependencyInjection\Compiler\DebugHandlerPass; -use Symfony\Bundle\MonologBundle\DependencyInjection\Compiler\AddProcessorsPass; - -/** - * Bundle. - * - * @author Jordi Boggiano - */ -class MonologBundle extends Bundle -{ - public function build(ContainerBuilder $container) - { - parent::build($container); - - $container->addCompilerPass($channelPass = new LoggerChannelPass()); - $container->addCompilerPass(new DebugHandlerPass($channelPass)); - $container->addCompilerPass(new AddProcessorsPass()); - } -} diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Resources/config/monolog.xml b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Resources/config/monolog.xml deleted file mode 100644 index 5e76780..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Resources/config/monolog.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - Symfony\Bridge\Monolog\Logger - Gelf\MessagePublisher - Monolog\Handler\StreamHandler - Monolog\Handler\GroupHandler - Monolog\Handler\BufferHandler - Monolog\Handler\RotatingFileHandler - Monolog\Handler\SyslogHandler - Monolog\Handler\NullHandler - Monolog\Handler\TestHandler - Monolog\Handler\GelfHandler - Symfony\Bridge\Monolog\Handler\FirePHPHandler - Symfony\Bridge\Monolog\Handler\ChromePhpHandler - Symfony\Bridge\Monolog\Handler\DebugHandler - Monolog\Handler\SwiftMailerHandler - Monolog\Handler\NativeMailerHandler - - Monolog\Handler\FingersCrossedHandler - Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy - - - - - app - - - - - - - - - diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Resources/config/schema/monolog-1.0.xsd b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Resources/config/schema/monolog-1.0.xsd deleted file mode 100644 index aeba3a3..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Resources/config/schema/monolog-1.0.xsd +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Compiler/AddProcessorsPassTest.php b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Compiler/AddProcessorsPassTest.php deleted file mode 100644 index 99374b1..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Compiler/AddProcessorsPassTest.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\MonologBundle\Tests\DependencyInjection\Compiler; - -use Symfony\Bundle\MonologBundle\DependencyInjection\Compiler\AddProcessorsPass; -use Symfony\Bundle\MonologBundle\Tests\TestCase; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\Config\FileLocator; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; - -class AddProcessorsPassTest extends TestCase -{ - public function testHandlerProcessors() - { - $container = $this->getContainer(); - - $service = $container->getDefinition('monolog.handler.test'); - $calls = $service->getMethodCalls(); - $this->assertCount(1, $calls); - $this->assertEquals(array('pushProcessor', array(new Reference('test'))), $calls[0]); - - $service = $container->getDefinition('handler_test'); - $calls = $service->getMethodCalls(); - $this->assertCount(1, $calls); - $this->assertEquals(array('pushProcessor', array(new Reference('test2'))), $calls[0]); - } - - protected function getContainer() - { - $container = new ContainerBuilder(); - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config')); - $loader->load('monolog.xml'); - - $definition = $container->getDefinition('monolog.logger_prototype'); - $container->setDefinition('monolog.handler.test', new Definition('%monolog.handler.null.class%', array (100, false))); - $container->setDefinition('handler_test', new Definition('%monolog.handler.null.class%', array (100, false))); - $container->setAlias('monolog.handler.test2', 'handler_test'); - $definition->addMethodCall('pushHandler', array(new Reference('monolog.handler.test'))); - $definition->addMethodCall('pushHandler', array(new Reference('monolog.handler.test2'))); - - $service = new Definition('TestClass', array('false', new Reference('logger'))); - $service->addTag('monolog.processor', array ('handler' => 'test')); - $container->setDefinition('test', $service); - - $service = new Definition('TestClass', array('false', new Reference('logger'))); - $service->addTag('monolog.processor', array ('handler' => 'test2')); - $container->setDefinition('test2', $service); - - $container->getCompilerPassConfig()->setOptimizationPasses(array()); - $container->getCompilerPassConfig()->setRemovingPasses(array()); - $container->addCompilerPass(new AddProcessorsPass()); - $container->compile(); - - return $container; - } -} diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Compiler/LoggerChannelPassTest.php b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Compiler/LoggerChannelPassTest.php deleted file mode 100644 index e6b670e..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Compiler/LoggerChannelPassTest.php +++ /dev/null @@ -1,130 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\MonologBundle\Tests\DependencyInjection\Compiler; - -use Symfony\Bundle\MonologBundle\Tests\TestCase; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Bundle\MonologBundle\DependencyInjection\Compiler\LoggerChannelPass; -use Symfony\Component\Config\FileLocator; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; - -class LoggerChannelPassTest extends TestCase -{ - public function testProcess() - { - $container = $this->getContainer(); - $this->assertTrue($container->hasDefinition('monolog.logger.test'), '->process adds a logger service for tagged service'); - - $service = $container->getDefinition('test'); - $this->assertEquals('monolog.logger.test', (string) $service->getArgument(1), '->process replaces the logger by the new one'); - - - // pushHandlers for service "test" - $expected = array( - 'test' => array('monolog.handler.a', 'monolog.handler.b', 'monolog.handler.c'), - 'foo' => array('monolog.handler.b'), - 'bar' => array('monolog.handler.b', 'monolog.handler.c'), - ); - - foreach ($expected as $serviceName => $handlers) { - $service = $container->getDefinition($serviceName); - $channel = $container->getDefinition((string) $service->getArgument(1)); - - $calls = $channel->getMethodCalls(); - $this->assertCount(count($handlers), $calls); - foreach ($handlers as $i => $handler) { - list($methodName, $arguments) = $calls[$i]; - $this->assertEquals('pushHandler', $methodName); - $this->assertCount(1, $arguments); - $this->assertEquals($handler, (string) $arguments[0]); - } - } - } - - public function testProcessSetters() - { - $container = $this->getContainerWithSetter(); - $this->assertTrue($container->hasDefinition('monolog.logger.test'), '->process adds a logger service for tagged service'); - - $service = $container->getDefinition('foo'); - $calls = $service->getMethodCalls(); - $this->assertEquals('monolog.logger.test', (string) $calls[0][1][0], '->process replaces the logger by the new one in setters'); - } - - protected function getContainer() - { - $container = new ContainerBuilder(); - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config')); - $loader->load('monolog.xml'); - $definition = $container->getDefinition('monolog.logger_prototype'); - $container->set('monolog.handler.test', new Definition('%monolog.handler.null.class%', array (100, false))); - $definition->addMethodCall('pushHandler', array(new Reference('monolog.handler.test'))); - - // Handlers - $container->set('monolog.handler.a', new Definition('%monolog.handler.null.class%', array (100, false))); - $container->set('monolog.handler.b', new Definition('%monolog.handler.null.class%', array (100, false))); - $container->set('monolog.handler.c', new Definition('%monolog.handler.null.class%', array (100, false))); - - // Channels - foreach (array('test', 'foo', 'bar') as $name) { - $service = new Definition('TestClass', array('false', new Reference('logger'))); - $service->addTag('monolog.logger', array ('channel' => $name)); - $container->setDefinition($name, $service); - } - - $container->setParameter('monolog.handlers_to_channels', array( - 'monolog.handler.a' => array( - 'type' => 'inclusive', - 'elements' => array('test') - ), - 'monolog.handler.b' => null, - 'monolog.handler.c' => array( - 'type' => 'exclusive', - 'elements' => array('foo') - ) - )); - - $container->getCompilerPassConfig()->setOptimizationPasses(array()); - $container->getCompilerPassConfig()->setRemovingPasses(array()); - $container->addCompilerPass(new LoggerChannelPass()); - $container->compile(); - - return $container; - } - - protected function getContainerWithSetter() - { - $container = new ContainerBuilder(); - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config')); - $loader->load('monolog.xml'); - $definition = $container->getDefinition('monolog.logger_prototype'); - $container->set('monolog.handler.test', new Definition('%monolog.handler.null.class%', array (100, false))); - $definition->addMethodCall('pushHandler', array(new Reference('monolog.handler.test'))); - - // Channels - $service = new Definition('TestClass'); - $service->addTag('monolog.logger', array ('channel' => 'test')); - $service->addMethodCall('setLogger', array(new Reference('logger'))); - $container->setDefinition('foo', $service); - - $container->setParameter('monolog.handlers_to_channels', array()); - - $container->getCompilerPassConfig()->setOptimizationPasses(array()); - $container->getCompilerPassConfig()->setRemovingPasses(array()); - $container->addCompilerPass(new LoggerChannelPass()); - $container->compile(); - - return $container; - } -} diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/ConfigurationTest.php b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/ConfigurationTest.php deleted file mode 100644 index a01bc70..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/ConfigurationTest.php +++ /dev/null @@ -1,228 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\MonologBundle\Tests\DependencyInjection; - -use Symfony\Bundle\MonologBundle\DependencyInjection\Configuration; -use Symfony\Component\Config\Definition\Processor; - -class ConfigurationTest extends \PHPUnit_Framework_TestCase -{ - /** - * Some basic tests to make sure the configuration is correctly processed in - * the standard case. - */ - public function testProcessSimpleCase() - { - $configs = array( - array( - 'handlers' => array('foobar' => array('type' => 'stream', 'path' => '/foo/bar')) - ) - ); - - $config = $this->process($configs); - - $this->assertArrayHasKey('handlers', $config); - $this->assertArrayHasKey('foobar', $config['handlers']); - $this->assertEquals('stream', $config['handlers']['foobar']['type']); - $this->assertEquals('/foo/bar', $config['handlers']['foobar']['path']); - } - - public function provideProcessStringChannels() - { - return array( - array('foo', 'foo', true), - array('!foo', 'foo', false) - ); - } - - /** - * @dataProvider provideProcessStringChannels - */ - public function testProcessStringChannels($string, $expectedString, $isInclusive) - { - $configs = array( - array( - 'handlers' => array( - 'foobar' => array( - 'type' => 'stream', - 'path' => '/foo/bar', - 'channels' => $string - ) - ) - ) - ); - - $config = $this->process($configs); - - $this->assertEquals($isInclusive ? 'inclusive' : 'exclusive', $config['handlers']['foobar']['channels']['type']); - $this->assertCount(1, $config['handlers']['foobar']['channels']['elements']); - $this->assertEquals($expectedString, $config['handlers']['foobar']['channels']['elements'][0]); - } - - public function provideGelfPublisher() - { - return array( - array( - 'gelf.publisher' - ), - array( - array( - 'id' => 'gelf.publisher' - ) - ) - ); - } - - /** - * @dataProvider provideGelfPublisher - */ - public function testGelfPublisherService($publisher) - { - $configs = array( - array( - 'handlers' => array( - 'gelf' => array( - 'type' => 'gelf', - 'publisher' => $publisher, - ), - ) - ) - ); - - $config = $this->process($configs); - - $this->assertArrayHasKey('id', $config['handlers']['gelf']['publisher']); - $this->assertArrayNotHasKey('hostname', $config['handlers']['gelf']['publisher']); - $this->assertEquals('gelf.publisher', $config['handlers']['gelf']['publisher']['id']); - } - - public function testArrays() - { - $configs = array( - array( - 'handlers' => array( - 'foo' => array( - 'type' => 'stream', - 'path' => '/foo', - 'channels' => array('A', 'B') - ), - 'bar' => array( - 'type' => 'stream', - 'path' => '/foo', - 'channels' => array('!C', '!D') - ), - ) - ) - ); - - $config = $this->process($configs); - - // Check foo - $this->assertCount(2, $config['handlers']['foo']['channels']['elements']); - $this->assertEquals('inclusive', $config['handlers']['foo']['channels']['type']); - $this->assertEquals('A', $config['handlers']['foo']['channels']['elements'][0]); - $this->assertEquals('B', $config['handlers']['foo']['channels']['elements'][1]); - - // Check bar - $this->assertCount(2, $config['handlers']['bar']['channels']['elements']); - $this->assertEquals('exclusive', $config['handlers']['bar']['channels']['type']); - $this->assertEquals('C', $config['handlers']['bar']['channels']['elements'][0]); - $this->assertEquals('D', $config['handlers']['bar']['channels']['elements'][1]); - } - - /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function testInvalidArrays() - { - $configs = array( - array( - 'handlers' => array( - 'foo' => array( - 'type' => 'stream', - 'path' => '/foo', - 'channels' => array('A', '!B') - ) - ) - ) - ); - - $config = $this->process($configs); - } - - /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function testMergingInvalidChannels() - { - $configs = array( - array( - 'handlers' => array( - 'foo' => array( - 'type' => 'stream', - 'path' => '/foo', - 'channels' => 'A', - ) - ) - ), - array( - 'handlers' => array( - 'foo' => array( - 'channels' => '!B', - ) - ) - ) - ); - - $config = $this->process($configs); - } - - public function testWithType() - { - $configs = array( - array( - 'handlers' => array( - 'foo' => array( - 'type' => 'stream', - 'path' => '/foo', - 'channels' => array( - 'type' => 'inclusive', - 'elements' => array('A', 'B') - ) - ) - ) - ) - ); - - $config = $this->process($configs); - - // Check foo - $this->assertCount(2, $config['handlers']['foo']['channels']['elements']); - $this->assertEquals('inclusive', $config['handlers']['foo']['channels']['type']); - $this->assertEquals('A', $config['handlers']['foo']['channels']['elements'][0]); - $this->assertEquals('B', $config['handlers']['foo']['channels']['elements'][1]); - } - - /** - * Processes an array of configurations and returns a compiled version. - * - * @param array $configs An array of raw configurations - * - * @return array A normalized array - */ - protected function process($configs) - { - $processor = new Processor(); - - return $processor->processConfiguration(new Configuration(), $configs); - } -} diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/handlers_with_channels.xml b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/handlers_with_channels.xml deleted file mode 100644 index d9eb899..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/handlers_with_channels.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - foo - - - - nested - - !foo - !bar - - - - - - - security - doctrine - - - - diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/multiple_handlers.xml b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/multiple_handlers.xml deleted file mode 100644 index fe98c55..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/multiple_handlers.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/new_and_priority.xml b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/new_and_priority.xml deleted file mode 100644 index 1cefae5..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/new_and_priority.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/new_and_priority_import.xml b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/new_and_priority_import.xml deleted file mode 100644 index 47d9de6..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/new_and_priority_import.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/new_at_end.xml b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/new_at_end.xml deleted file mode 100644 index b6fdd68..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/new_at_end.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/new_at_end_import.xml b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/new_at_end_import.xml deleted file mode 100644 index 5370fac..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/new_at_end_import.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/overwriting.xml b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/overwriting.xml deleted file mode 100644 index 5b41da0..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/overwriting.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/overwriting_import.xml b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/overwriting_import.xml deleted file mode 100644 index fe98c55..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/xml/overwriting_import.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/handlers_with_channels.yml b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/handlers_with_channels.yml deleted file mode 100644 index 583ebae..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/handlers_with_channels.yml +++ /dev/null @@ -1,30 +0,0 @@ -monolog: - handlers: - custom: - type: stream - path: /tmp/symfony.log - bubble: false - level: ERROR - channels: foo - main: - type: group - members: [nested] - channels: ["!foo", "!bar"] - nested: - type: stream - extra: - type: syslog - ident: monolog - facility: user - level: ALERT - more: - type: native_mailer - to_email: monitoring@example.org - from_email: webmaster@example.org - subject: Monolog report - level: CRITICAL - channels: - type: inclusive - elements: - - security - - doctrine diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/multiple_handlers.yml b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/multiple_handlers.yml deleted file mode 100644 index 14af13e..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/multiple_handlers.yml +++ /dev/null @@ -1,13 +0,0 @@ -monolog: - handlers: - custom: - type: stream - path: /tmp/symfony.log - bubble: false - level: ERROR - main: - type: fingers_crossed - action_level: ERROR - handler: nested - nested: - type: stream diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/new_and_priority.yml b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/new_and_priority.yml deleted file mode 100644 index 32fd789..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/new_and_priority.yml +++ /dev/null @@ -1,22 +0,0 @@ -imports: - - { resource: new_and_priority_import.yml } - -monolog: - handlers: - custom: - type: stream - path: /tmp/symfony.log - bubble: true - level: WARNING - first: - type: rotating_file - path: /tmp/monolog.log - bubble: true - level: ERROR - priority: 3 - last: - type: stream - path: /tmp/last.log - bubble: true - level: ERROR - priority: -3 diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/new_and_priority_import.yml b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/new_and_priority_import.yml deleted file mode 100644 index 66f63f2..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/new_and_priority_import.yml +++ /dev/null @@ -1,13 +0,0 @@ -monolog: - handlers: - custom: - type: stream - path: /tmp/symfony.log - bubble: true - level: ERROR - main: - type: buffer - level: INFO - handler: nested - nested: - type: stream \ No newline at end of file diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/new_at_end.yml b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/new_at_end.yml deleted file mode 100644 index d951d2b..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/new_at_end.yml +++ /dev/null @@ -1,15 +0,0 @@ -imports: - - { resource: new_at_end_import.yml } - -monolog: - handlers: - custom: - type: stream - path: /tmp/symfony.log - bubble: false - level: WARNING - new: - type: stream - path: /tmp/monolog.log - bubble: true - level: ERROR diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/new_at_end_import.yml b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/new_at_end_import.yml deleted file mode 100644 index d87c3cf..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/new_at_end_import.yml +++ /dev/null @@ -1,13 +0,0 @@ -monolog: - handlers: - custom: - type: stream - path: /tmp/symfony.log - bubble: true - level: ERROR - main: - type: fingers_crossed - action_level: ERROR - handler: nested - nested: - type: stream \ No newline at end of file diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/overwriting.yml b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/overwriting.yml deleted file mode 100644 index e2ee75a..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/overwriting.yml +++ /dev/null @@ -1,10 +0,0 @@ -imports: - - { resource: overwriting_import.yml } - -monolog: - handlers: - custom: - type: stream - path: /tmp/symfony.log - bubble: true - level: WARNING diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/overwriting_import.yml b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/overwriting_import.yml deleted file mode 100644 index 0b89ea7..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/Fixtures/yml/overwriting_import.yml +++ /dev/null @@ -1,13 +0,0 @@ -monolog: - handlers: - custom: - type: stream - path: /tmp/symfony.log - bubble: false - level: ERROR - main: - type: fingers_crossed - action_level: ERROR - handler: nested - nested: - type: stream \ No newline at end of file diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/MonologExtensionTest.php b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/MonologExtensionTest.php deleted file mode 100644 index 6d49ffc..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/MonologExtensionTest.php +++ /dev/null @@ -1,285 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\MonologBundle\Tests\DependencyInjection; - -use Symfony\Bundle\MonologBundle\Tests\TestCase; -use Symfony\Bundle\MonologBundle\DependencyInjection\MonologExtension; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -abstract class MonologExtensionTest extends TestCase -{ - public function testLoadWithDefault() - { - $container = new ContainerBuilder(); - $loader = new MonologExtension(); - - $loader->load(array(array('handlers' => array('main' => array('type' => 'stream')))), $container); - $this->assertTrue($container->hasDefinition('monolog.logger')); - $this->assertTrue($container->hasDefinition('monolog.handler.main')); - - $logger = $container->getDefinition('monolog.logger'); - $this->assertDICDefinitionMethodCallAt(0, $logger, 'pushHandler', array(new Reference('monolog.handler.main'))); - - $handler = $container->getDefinition('monolog.handler.main'); - $this->assertDICDefinitionClass($handler, '%monolog.handler.stream.class%'); - $this->assertDICConstructorArguments($handler, array('%kernel.logs_dir%/%kernel.environment%.log', \Monolog\Logger::DEBUG, true)); - } - - public function testLoadWithCustomValues() - { - $container = new ContainerBuilder(); - $loader = new MonologExtension(); - - $loader->load(array(array('handlers' => array('custom' => array('type' => 'stream', 'path' => '/tmp/symfony.log', 'bubble' => false, 'level' => 'ERROR')))), $container); - $this->assertTrue($container->hasDefinition('monolog.logger')); - $this->assertTrue($container->hasDefinition('monolog.handler.custom')); - - $logger = $container->getDefinition('monolog.logger'); - $this->assertDICDefinitionMethodCallAt(0, $logger, 'pushHandler', array(new Reference('monolog.handler.custom'))); - - $handler = $container->getDefinition('monolog.handler.custom'); - $this->assertDICDefinitionClass($handler, '%monolog.handler.stream.class%'); - $this->assertDICConstructorArguments($handler, array('/tmp/symfony.log', \Monolog\Logger::ERROR, false)); - } - - public function testLoadWithSeveralHandlers() - { - $container = $this->getContainer('multiple_handlers'); - - $this->assertTrue($container->hasDefinition('monolog.logger')); - $this->assertTrue($container->hasDefinition('monolog.handler.custom')); - $this->assertTrue($container->hasDefinition('monolog.handler.main')); - $this->assertTrue($container->hasDefinition('monolog.handler.nested')); - - $logger = $container->getDefinition('monolog.logger'); - $this->assertDICDefinitionMethodCallAt(1, $logger, 'pushHandler', array(new Reference('monolog.handler.custom'))); - $this->assertDICDefinitionMethodCallAt(0, $logger, 'pushHandler', array(new Reference('monolog.handler.main'))); - - $handler = $container->getDefinition('monolog.handler.custom'); - $this->assertDICDefinitionClass($handler, '%monolog.handler.stream.class%'); - $this->assertDICConstructorArguments($handler, array('/tmp/symfony.log', \Monolog\Logger::ERROR, false)); - - $handler = $container->getDefinition('monolog.handler.main'); - $this->assertDICDefinitionClass($handler, '%monolog.handler.fingers_crossed.class%'); - $this->assertDICConstructorArguments($handler, array(new Reference('monolog.handler.nested'), \Monolog\Logger::ERROR, 0, true, true)); - } - - public function testLoadWithOverwriting() - { - $container = $this->getContainer('overwriting'); - - $this->assertTrue($container->hasDefinition('monolog.logger')); - $this->assertTrue($container->hasDefinition('monolog.handler.custom')); - $this->assertTrue($container->hasDefinition('monolog.handler.main')); - $this->assertTrue($container->hasDefinition('monolog.handler.nested')); - - $logger = $container->getDefinition('monolog.logger'); - $this->assertDICDefinitionMethodCallAt(1, $logger, 'pushHandler', array(new Reference('monolog.handler.custom'))); - $this->assertDICDefinitionMethodCallAt(0, $logger, 'pushHandler', array(new Reference('monolog.handler.main'))); - - $handler = $container->getDefinition('monolog.handler.custom'); - $this->assertDICDefinitionClass($handler, '%monolog.handler.stream.class%'); - $this->assertDICConstructorArguments($handler, array('/tmp/symfony.log', \Monolog\Logger::WARNING, true)); - - $handler = $container->getDefinition('monolog.handler.main'); - $this->assertDICDefinitionClass($handler, '%monolog.handler.fingers_crossed.class%'); - $this->assertDICConstructorArguments($handler, array(new Reference('monolog.handler.nested'), \Monolog\Logger::ERROR, 0, true, true)); - } - - public function testLoadWithNewAtEnd() - { - $container = $this->getContainer('new_at_end'); - - $this->assertTrue($container->hasDefinition('monolog.logger')); - $this->assertTrue($container->hasDefinition('monolog.handler.custom')); - $this->assertTrue($container->hasDefinition('monolog.handler.main')); - $this->assertTrue($container->hasDefinition('monolog.handler.nested')); - $this->assertTrue($container->hasDefinition('monolog.handler.new')); - - $logger = $container->getDefinition('monolog.logger'); - $this->assertDICDefinitionMethodCallAt(2, $logger, 'pushHandler', array(new Reference('monolog.handler.new'))); - $this->assertDICDefinitionMethodCallAt(1, $logger, 'pushHandler', array(new Reference('monolog.handler.custom'))); - $this->assertDICDefinitionMethodCallAt(0, $logger, 'pushHandler', array(new Reference('monolog.handler.main'))); - - $handler = $container->getDefinition('monolog.handler.new'); - $this->assertDICDefinitionClass($handler, '%monolog.handler.stream.class%'); - $this->assertDICConstructorArguments($handler, array('/tmp/monolog.log', \Monolog\Logger::ERROR, true)); - } - - public function testLoadWithNewAndPriority() - { - $container = $this->getContainer('new_and_priority'); - - $this->assertTrue($container->hasDefinition('monolog.logger')); - $this->assertTrue($container->hasDefinition('monolog.handler.custom')); - $this->assertTrue($container->hasDefinition('monolog.handler.main')); - $this->assertTrue($container->hasDefinition('monolog.handler.nested')); - $this->assertTrue($container->hasDefinition('monolog.handler.first')); - $this->assertTrue($container->hasDefinition('monolog.handler.last')); - - $logger = $container->getDefinition('monolog.logger'); - $this->assertDICDefinitionMethodCallAt(2, $logger, 'pushHandler', array(new Reference('monolog.handler.last'))); - $this->assertDICDefinitionMethodCallAt(1, $logger, 'pushHandler', array(new Reference('monolog.handler.custom'))); - $this->assertDICDefinitionMethodCallAt(0, $logger, 'pushHandler', array(new Reference('monolog.handler.main'))); - $this->assertDICDefinitionMethodCallAt(2, $logger, 'pushHandler', array(new Reference('monolog.handler.first'))); - - $handler = $container->getDefinition('monolog.handler.main'); - $this->assertDICDefinitionClass($handler, '%monolog.handler.buffer.class%'); - $this->assertDICConstructorArguments($handler, array(new Reference('monolog.handler.nested'), 0, \Monolog\Logger::INFO, true)); - - $handler = $container->getDefinition('monolog.handler.first'); - $this->assertDICDefinitionClass($handler, '%monolog.handler.rotating_file.class%'); - $this->assertDICConstructorArguments($handler, array('/tmp/monolog.log', 0, \Monolog\Logger::ERROR, true)); - - $handler = $container->getDefinition('monolog.handler.last'); - $this->assertDICDefinitionClass($handler, '%monolog.handler.stream.class%'); - $this->assertDICConstructorArguments($handler, array('/tmp/last.log', \Monolog\Logger::ERROR, true)); - } - - public function testHandlersWithChannels() - { - $container = $this->getContainer('handlers_with_channels'); - - $this->assertEquals( - array( - 'monolog.handler.custom' => array('type' => 'inclusive', 'elements' => array('foo')), - 'monolog.handler.main' => array('type' => 'exclusive', 'elements' => array('foo', 'bar')), - 'monolog.handler.extra' => null, - 'monolog.handler.more' => array('type' => 'inclusive', 'elements' => array('security', 'doctrine')), - ), - $container->getParameter('monolog.handlers_to_channels') - ); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testExceptionWhenInvalidHandler() - { - $container = new ContainerBuilder(); - $loader = new MonologExtension(); - - $loader->load(array(array('handlers' => array('main' => array('type' => 'invalid_handler')))), $container); - } - - /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function testExceptionWhenUsingFingerscrossedWithoutHandler() - { - $container = new ContainerBuilder(); - $loader = new MonologExtension(); - - $loader->load(array(array('handlers' => array('main' => array('type' => 'fingers_crossed')))), $container); - } - - /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function testExceptionWhenUsingBufferWithoutHandler() - { - $container = new ContainerBuilder(); - $loader = new MonologExtension(); - - $loader->load(array(array('handlers' => array('main' => array('type' => 'buffer')))), $container); - } - - /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function testExceptionWhenUsingGelfWithoutPublisher() - { - $container = new ContainerBuilder(); - $loader = new MonologExtension(); - - $loader->load(array(array('handlers' => array('gelf' => array('type' => 'gelf')))), $container); - } - - /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function testExceptionWhenUsingGelfWithoutPublisherHostname() - { - $container = new ContainerBuilder(); - $loader = new MonologExtension(); - - $loader->load(array(array('handlers' => array('gelf' => array('type' => 'gelf', 'publisher' => array())))), $container); - } - - /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function testExceptionWhenUsingServiceWithoutId() - { - $container = new ContainerBuilder(); - $loader = new MonologExtension(); - - $loader->load(array(array('handlers' => array('main' => array('type' => 'service')))), $container); - } - - /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function testExceptionWhenUsingDebugName() - { - // logger - $container = new ContainerBuilder(); - $loader = new MonologExtension(); - - $loader->load(array(array('handlers' => array('debug' => array('type' => 'stream')))), $container); - } - - protected function getContainer($fixture) - { - $container = new ContainerBuilder(); - $container->registerExtension(new MonologExtension()); - - $this->loadFixture($container, $fixture); - - $container->getCompilerPassConfig()->setOptimizationPasses(array()); - $container->getCompilerPassConfig()->setRemovingPasses(array()); - $container->compile(); - - return $container; - } - - abstract protected function loadFixture(ContainerBuilder $container, $fixture); - - /** - * Assertion on the Class of a DIC Service Definition. - * - * @param \Symfony\Component\DependencyInjection\Definition $definition - * @param string $expectedClass - */ - protected function assertDICDefinitionClass($definition, $expectedClass) - { - $this->assertEquals($expectedClass, $definition->getClass(), "Expected Class of the DIC Container Service Definition is wrong."); - } - - protected function assertDICConstructorArguments($definition, $args) - { - $this->assertEquals($args, $definition->getArguments(), "Expected and actual DIC Service constructor arguments of definition '".$definition->getClass()."' don't match."); - } - - protected function assertDICDefinitionMethodCallAt($pos, $definition, $methodName, array $params = null) - { - $calls = $definition->getMethodCalls(); - if (isset($calls[$pos][0])) { - $this->assertEquals($methodName, $calls[$pos][0], "Method '".$methodName."' is expected to be called at position $pos."); - - if ($params !== null) { - $this->assertEquals($params, $calls[$pos][1], "Expected parameters to methods '".$methodName."' do not match the actual parameters."); - } - } - } -} diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/XmlMonologExtensionTest.php b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/XmlMonologExtensionTest.php deleted file mode 100644 index f269939..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/XmlMonologExtensionTest.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\MonologBundle\Tests\DependencyInjection; - -use Symfony\Component\Config\FileLocator; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; - -class XmlMonologExtensionTest extends MonologExtensionTest -{ - protected function loadFixture(ContainerBuilder $container, $fixture) - { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/Fixtures/xml')); - $loader->load($fixture.'.xml'); - } -} diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/YamlMonologExtensionTest.php b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/YamlMonologExtensionTest.php deleted file mode 100644 index 8758801..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/YamlMonologExtensionTest.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\MonologBundle\Tests\DependencyInjection; - -use Symfony\Component\Config\FileLocator; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; - -class YamlMonologExtensionTest extends MonologExtensionTest -{ - protected function loadFixture(ContainerBuilder $container, $fixture) - { - $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/Fixtures/yml')); - $loader->load($fixture.'.yml'); - } -} diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/TestCase.php b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/TestCase.php deleted file mode 100644 index 06e4589..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/Tests/TestCase.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\MonologBundle\Tests; - -class TestCase extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!class_exists('Monolog\\Logger')) { - $this->markTestSkipped('Monolog is not available.'); - } - } -} diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/composer.json b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/composer.json deleted file mode 100644 index a50ed5e..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "symfony/monolog-bundle", - "type": "symfony-bundle", - "description": "Symfony MonologBundle", - "keywords": [], - "homepage": "http://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "require": { - "php": ">=5.3.2", - "symfony/monolog-bridge": "2.1.*", - "symfony/dependency-injection": "2.1.*", - "symfony/config": "2.1.*", - "monolog/monolog": "1.*" - }, - "require-dev": { - "symfony/yaml": "2.1.*", - "symfony/config": "2.1.*" - }, - "autoload": { - "psr-0": { "Symfony\\Bundle\\MonologBundle": "" } - }, - "target-dir": "Symfony/Bundle/MonologBundle", - "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev" - } - } -} diff --git a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/phpunit.xml.dist b/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/phpunit.xml.dist deleted file mode 100644 index 90560f7..0000000 --- a/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/phpunit.xml.dist +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - ./Tests - - - - - - . - - ./Resources - ./Tests - ./vendor - - - - diff --git a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/.gitignore b/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/.gitignore deleted file mode 100644 index d95451e..0000000 --- a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/vendor/ -/composer.lock - diff --git a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Command/SendEmailCommand.php b/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Command/SendEmailCommand.php deleted file mode 100644 index f680414..0000000 --- a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Command/SendEmailCommand.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SwiftmailerBundle\Command; - -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Input\InputOption; - -/** - * Send Emails from the spool. - * - * @author Fabien Potencier - * @author Clément JOBEILI - */ -class SendEmailCommand extends ContainerAwareCommand -{ - /** - * @see Command - */ - protected function configure() - { - $this - ->setName('swiftmailer:spool:send') - ->setDescription('Sends emails from the spool') - ->addOption('message-limit', 0, InputOption::VALUE_OPTIONAL, 'The maximum number of messages to send.') - ->addOption('time-limit', 0, InputOption::VALUE_OPTIONAL, 'The time limit for sending messages (in seconds).') - ->addOption('recover-timeout', 0, InputOption::VALUE_OPTIONAL, 'The timeout for recovering messages that have taken too long to send (in seconds).') - ->setHelp(<<swiftmailer:spool:send command sends all emails from the spool. - -php app/console swiftmailer:spool:send --message-limit=10 --time-limit=10 --recover-timeout=900 - -EOF - ) - ; - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $mailer = $this->getContainer()->get('mailer'); - $transport = $mailer->getTransport(); - - if ($transport instanceof \Swift_Transport_SpoolTransport) { - $spool = $transport->getSpool(); - if ($spool instanceof \Swift_ConfigurableSpool) { - $spool->setMessageLimit($input->getOption('message-limit')); - $spool->setTimeLimit($input->getOption('time-limit')); - } - if ($spool instanceof \Swift_FileSpool) { - if (null !== $input->getOption('recover-timeout')) { - $spool->recover($input->getOption('recover-timeout')); - } else { - $spool->recover(); - } - } - $sent = $spool->flushQueue($this->getContainer()->get('swiftmailer.transport.real')); - - $output->writeln(sprintf('sent %s emails', $sent)); - } - } -} diff --git a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/DependencyInjection/Compiler/RegisterPluginsPass.php b/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/DependencyInjection/Compiler/RegisterPluginsPass.php deleted file mode 100644 index 63a12dc..0000000 --- a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/DependencyInjection/Compiler/RegisterPluginsPass.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SwiftmailerBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * RegisterPluginsPass registers Swiftmailer plugins. - * - * @author Fabien Potencier - */ -class RegisterPluginsPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('swiftmailer.mailer')) { - return; - } - - $definition = $container->findDefinition('swiftmailer.transport'); - foreach ($container->findTaggedServiceIds('swiftmailer.plugin') as $id => $args) { - $definition->addMethodCall('registerPlugin', array(new Reference($id))); - } - } -} diff --git a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/DependencyInjection/Configuration.php b/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/DependencyInjection/Configuration.php deleted file mode 100644 index 8dbe78c..0000000 --- a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/DependencyInjection/Configuration.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SwiftmailerBundle\DependencyInjection; - -use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\Config\Definition\ConfigurationInterface; - -/** - * This class contains the configuration information for the bundle - * - * This information is solely responsible for how the different configuration - * sections are normalized, and merged. - * - * @author Christophe Coevoet - */ -class Configuration implements ConfigurationInterface -{ - private $debug; - - /** - * Constructor. - * - * @param Boolean $debug The kernel.debug value - */ - public function __construct($debug) - { - $this->debug = (Boolean) $debug; - } - - /** - * Generates the configuration tree builder. - * - * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder - */ - public function getConfigTreeBuilder() - { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('swiftmailer'); - - $rootNode - ->children() - ->scalarNode('transport')->defaultValue('smtp')->end() - ->scalarNode('username')->defaultNull()->end() - ->scalarNode('password')->defaultNull()->end() - ->scalarNode('host')->defaultValue('localhost')->end() - ->scalarNode('port')->defaultFalse()->end() - ->scalarNode('timeout')->defaultValue(30)->end() - ->scalarNode('source_ip')->defaultNull()->end() - ->scalarNode('encryption') - ->defaultNull() - ->validate() - ->ifNotInArray(array('tls', 'ssl', null)) - ->thenInvalid('The %s encryption is not supported') - ->end() - ->end() - ->scalarNode('auth_mode') - ->defaultNull() - ->validate() - ->ifNotInArray(array('plain', 'login', 'cram-md5', null)) - ->thenInvalid('The %s authentication mode is not supported') - ->end() - ->end() - ->arrayNode('spool') - ->children() - ->scalarNode('type')->defaultValue('file')->end() - ->scalarNode('path')->defaultValue('%kernel.cache_dir%/swiftmailer/spool')->end() - ->end() - ->end() - ->scalarNode('sender_address')->end() - ->arrayNode('antiflood') - ->children() - ->scalarNode('threshold')->defaultValue(99)->end() - ->scalarNode('sleep')->defaultValue(0)->end() - ->end() - ->end() - ->scalarNode('delivery_address')->end() - ->booleanNode('disable_delivery')->end() - ->booleanNode('logging')->defaultValue($this->debug)->end() - ->end() - ; - - return $treeBuilder; - } -} diff --git a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/DependencyInjection/SwiftmailerExtension.php b/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/DependencyInjection/SwiftmailerExtension.php deleted file mode 100644 index ef58191..0000000 --- a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/DependencyInjection/SwiftmailerExtension.php +++ /dev/null @@ -1,155 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SwiftmailerBundle\DependencyInjection; - -use Symfony\Component\HttpKernel\DependencyInjection\Extension; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\Config\FileLocator; - -/** - * SwiftmailerExtension is an extension for the SwiftMailer library. - * - * @author Fabien Potencier - */ -class SwiftmailerExtension extends Extension -{ - /** - * Loads the Swift Mailer configuration. - * - * Usage example: - * - * - * fabien - * xxxxx - * - * - * - * @param array $configs An array of configuration settings - * @param ContainerBuilder $container A ContainerBuilder instance - */ - public function load(array $configs, ContainerBuilder $container) - { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('swiftmailer.xml'); - $container->setAlias('mailer', 'swiftmailer.mailer'); - - $configuration = $this->getConfiguration($configs, $container); - $config = $this->processConfiguration($configuration, $configs); - - if (null === $config['transport']) { - $transport = 'null'; - } elseif ('gmail' === $config['transport']) { - $config['encryption'] = 'ssl'; - $config['auth_mode'] = 'login'; - $config['host'] = 'smtp.gmail.com'; - $transport = 'smtp'; - } else { - $transport = $config['transport']; - } - - if (isset($config['disable_delivery']) && $config['disable_delivery']) { - $transport = 'null'; - } - - if ('smtp' === $transport) { - $loader->load('smtp.xml'); - } - - if (in_array($transport, array('smtp', 'mail', 'sendmail', 'null'))) { - // built-in transport - $transport = 'swiftmailer.transport.'.$transport; - } - - $container->setAlias('swiftmailer.transport', $transport); - - if (false === $config['port']) { - $config['port'] = 'ssl' === $config['encryption'] ? 465 : 25; - } - - foreach (array('encryption', 'port', 'host', 'username', 'password', 'auth_mode', 'timeout', 'source_ip') as $key) { - $container->setParameter('swiftmailer.transport.smtp.'.$key, $config[$key]); - } - - // spool? - if (isset($config['spool'])) { - $type = $config['spool']['type']; - - $loader->load('spool.xml'); - if ($type === 'file') { - $loader->load('spool_file.xml'); - } elseif ($type === 'memory') { - $loader->load('spool_memory.xml'); - } - $container->setAlias('swiftmailer.transport.real', $transport); - $container->setAlias('swiftmailer.transport', 'swiftmailer.transport.spool'); - $container->setAlias('swiftmailer.spool', 'swiftmailer.spool.'.$type); - - foreach (array('path') as $key) { - $container->setParameter('swiftmailer.spool.'.$type.'.'.$key, $config['spool'][$key]); - } - } - $container->setParameter('swiftmailer.spool.enabled', isset($config['spool'])); - - // antiflood? - if (isset($config['antiflood'])) { - $container->setParameter('swiftmailer.plugin.antiflood.threshold', $config['antiflood']['threshold']); - $container->setParameter('swiftmailer.plugin.antiflood.sleep', $config['antiflood']['sleep']); - - $container->getDefinition('swiftmailer.plugin.antiflood')->addTag('swiftmailer.plugin'); - } - - if ($config['logging']) { - $container->getDefinition('swiftmailer.plugin.messagelogger')->addTag('swiftmailer.plugin'); - $container->findDefinition('swiftmailer.data_collector')->addTag('data_collector', array('template' => 'SwiftmailerBundle:Collector:swiftmailer', 'id' => 'swiftmailer')); - } - - if (isset($config['sender_address']) && $config['sender_address']) { - $container->setParameter('swiftmailer.sender_address', $config['sender_address']); - $container->getDefinition('swiftmailer.plugin.impersonate')->addTag('swiftmailer.plugin'); - } else { - $container->setParameter('swiftmailer.sender_address', null); - } - - if (isset($config['delivery_address']) && $config['delivery_address']) { - $container->setParameter('swiftmailer.single_address', $config['delivery_address']); - $container->getDefinition('swiftmailer.plugin.redirecting')->addTag('swiftmailer.plugin'); - } else { - $container->setParameter('swiftmailer.single_address', null); - } - } - - /** - * Returns the base path for the XSD files. - * - * @return string The XSD base path - */ - public function getXsdValidationBasePath() - { - return __DIR__.'/../Resources/config/schema'; - } - - /** - * Returns the namespace to be used for this extension (XML namespace). - * - * @return string The XML namespace - */ - public function getNamespace() - { - return 'http://symfony.com/schema/dic/swiftmailer'; - } - - public function getConfiguration(array $config, ContainerBuilder $container) - { - return new Configuration($container->getParameter('kernel.debug')); - } -} diff --git a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/EventListener/EmailSenderListener.php b/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/EventListener/EmailSenderListener.php deleted file mode 100644 index dcc8fbe..0000000 --- a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/EventListener/EmailSenderListener.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SwiftmailerBundle\EventListener; - -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\IntrospectableContainerInterface; -use Symfony\Component\HttpKernel\Event\PostResponseEvent; -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -/** - * Sends emails for the memory spool. - * - * Emails are sent on the kernel.terminate event. - * - * @author Fabien Potencier - */ -class EmailSenderListener implements EventSubscriberInterface -{ - private $container; - - public function __construct(ContainerInterface $container, $autoStart = false) - { - $this->container = $container; - } - - public function onKernelTerminate(PostResponseEvent $event) - { - if ($this->container instanceof IntrospectableContainerInterface && !$this->container->initialized('mailer')) { - return; - } - - $transport = $this->container->get('mailer')->getTransport(); - if (!$transport instanceof \Swift_Transport_SpoolTransport) { - return; - } - - $spool = $transport->getSpool(); - if (!$spool instanceof \Swift_MemorySpool) { - return; - } - - $spool->flushQueue($this->container->get('swiftmailer.transport.real')); - } - - static public function getSubscribedEvents() - { - return array(KernelEvents::TERMINATE => 'onKernelTerminate'); - } -} diff --git a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/LICENSE b/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/LICENSE deleted file mode 100644 index cdffe7a..0000000 --- a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2012 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/schema/swiftmailer-1.0.xsd b/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/schema/swiftmailer-1.0.xsd deleted file mode 100644 index 9bc89ef..0000000 --- a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/schema/swiftmailer-1.0.xsd +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/smtp.xml b/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/smtp.xml deleted file mode 100644 index fafa8ae..0000000 --- a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/smtp.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - Swift_Transport_EsmtpTransport - - - - - - - - - - - %swiftmailer.transport.smtp.host% - %swiftmailer.transport.smtp.port% - %swiftmailer.transport.smtp.encryption% - %swiftmailer.transport.smtp.username% - %swiftmailer.transport.smtp.password% - %swiftmailer.transport.smtp.auth_mode% - %swiftmailer.transport.smtp.timeout% - %swiftmailer.transport.smtp.source_ip% - - - diff --git a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/spool.xml b/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/spool.xml deleted file mode 100644 index d9009d7..0000000 --- a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/spool.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - Swift_Plugins_RedirectingPlugin - Swift_Plugins_BlackholePlugin - - - - - - - - - diff --git a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/spool_file.xml b/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/spool_file.xml deleted file mode 100644 index b452553..0000000 --- a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/spool_file.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - Swift_FileSpool - - - - - %swiftmailer.spool.file.path% - - - diff --git a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/spool_memory.xml b/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/spool_memory.xml deleted file mode 100644 index eefe660..0000000 --- a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/spool_memory.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - Swift_MemorySpool - Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener - - - - - - - - - - - diff --git a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/swiftmailer.xml b/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/swiftmailer.xml deleted file mode 100644 index 57753bf..0000000 --- a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/config/swiftmailer.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - Swift_Mailer - - Swift_Transport_SendmailTransport - Swift_Transport_MailTransport - - Swift_Transport_FailoverTransport - - Swift_Plugins_RedirectingPlugin - Swift_Plugins_ImpersonatePlugin - Swift_Plugins_MessageLogger - Swift_Plugins_AntiFloodPlugin - 99 - 0 - - Symfony\Bridge\Swiftmailer\DataCollector\MessageDataCollector - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %swiftmailer.single_address% - - - - %swiftmailer.plugin.antiflood.threshold% - %swiftmailer.plugin.antiflood.sleep% - - - - %swiftmailer.sender_address% - - - - - - - %swiftmailer.spool.enabled% - - - - - diff --git a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/views/Collector/swiftmailer.html.twig b/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/views/Collector/swiftmailer.html.twig deleted file mode 100644 index 5c9ea17..0000000 --- a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Resources/views/Collector/swiftmailer.html.twig +++ /dev/null @@ -1,59 +0,0 @@ -{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %} - -{% block toolbar %} - {% if collector.messagecount %} - {% set icon %} - Swiftmailer - {{ collector.messageCount }} - {% endset %} - {% set text %} -
    - Messages - {{ collector.messageCount }} -
    -
    - Is spooled ? - {{ collector.isSpool ? 'yes' : 'no' }} -
    - {% endset %} - {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %} - {% endif %} -{% endblock %} - -{% block menu %} - - Configuration - E-Mails - - {{ collector.messagecount }} - - -{% endblock %} - -{% block panel %} -

    Messages {{ collector.isSpool ? 'spooled' : 'sent' }}

    - - {% if not collector.messages %} -

    - No message sent. -

    - {% else %} - {% for i, message in collector.messages %} -

    Message {{ i + 1 }} / {{ collector.messagecount }}

    - - {% for header in message.headers.all %} -
    {{ header }}
    - {% endfor %} - -

    -

    -                    {%- if message.charset %}
    -                        {{- message.body|e('html', message.charset)|convert_encoding('UTF-8', message.charset) }}
    -                    {%- else %}
    -                        {{- message.body|e('html') }}
    -                    {%- endif -%}
    -                
    -

    - {% endfor %} - {% endif %} -{% endblock %} diff --git a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/SwiftmailerBundle.php b/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/SwiftmailerBundle.php deleted file mode 100644 index 8456bbf..0000000 --- a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/SwiftmailerBundle.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SwiftmailerBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Bundle\SwiftmailerBundle\DependencyInjection\Compiler\RegisterPluginsPass; - -/** - * Bundle. - * - * @author Fabien Potencier - */ -class SwiftmailerBundle extends Bundle -{ - public function build(ContainerBuilder $container) - { - parent::build($container); - - $container->addCompilerPass(new RegisterPluginsPass()); - } -} diff --git a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Tests/DependencyInjection/SwiftmailerExtensionTest.php b/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Tests/DependencyInjection/SwiftmailerExtensionTest.php deleted file mode 100644 index 9d72ddf..0000000 --- a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Tests/DependencyInjection/SwiftmailerExtensionTest.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SwiftmailerBundle\Tests\DependencyInjection; - -use Symfony\Bundle\SwiftmailerBundle\Tests\TestCase; -use Symfony\Bundle\SwiftmailerBundle\DependencyInjection\SwiftmailerExtension; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class SwiftmailerExtensionTest extends TestCase -{ - public function testConfigLoad() - { - $container = new ContainerBuilder(); - $container->setParameter('kernel.debug', false); - $loader = new SwiftmailerExtension(); - - $loader->load(array(array()), $container); - $this->assertEquals('Swift_Mailer', $container->getParameter('swiftmailer.class'), '->load() loads the swiftmailer.xml file if not already loaded'); - - $loader->load(array(array('transport' => 'sendmail')), $container); - $this->assertEquals('swiftmailer.transport.sendmail', (string) $container->getAlias('swiftmailer.transport')); - - $loader->load(array(array()), $container); - $this->assertEquals('swiftmailer.transport.smtp', (string) $container->getAlias('swiftmailer.transport')); - } - - public function testNullTransport() - { - $container = new ContainerBuilder(); - $container->setParameter('kernel.debug', false); - $loader = new SwiftmailerExtension(); - - $loader->load(array(array('transport' => null)), $container); - $this->assertEquals('swiftmailer.transport.null', (string) $container->getAlias('swiftmailer.transport')); - } - - public function testSpool() - { - $container = new ContainerBuilder(); - $container->setParameter('kernel.debug', false); - $loader = new SwiftmailerExtension(); - - $loader->load(array(array('spool' => array())), $container); - $this->assertEquals('swiftmailer.transport.spool', (string) $container->getAlias('swiftmailer.transport')); - $this->assertEquals('swiftmailer.transport.smtp', (string) $container->getAlias('swiftmailer.transport.real')); - } - -} diff --git a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Tests/TestCase.php b/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Tests/TestCase.php deleted file mode 100644 index b65b64a..0000000 --- a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/Tests/TestCase.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SwiftmailerBundle\Tests; - -class TestCase extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!class_exists('Swift_Mailer')) { - $this->markTestSkipped('Swiftmailer is not available.'); - } - } -} diff --git a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/composer.json b/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/composer.json deleted file mode 100644 index 889bc85..0000000 --- a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "symfony/swiftmailer-bundle", - "type": "symfony-bundle", - "description": "Symfony SwiftmailerBundle", - "keywords": [], - "homepage": "http://symfony.com", - "version": "2.1.0", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "require": { - "php": ">=5.3.2", - "swiftmailer/swiftmailer": ">=4.2.0,<4.3-dev", - "symfony/swiftmailer-bridge": "2.1.*" - }, - "require-dev": { - "symfony/dependency-injection": "2.1.*", - "symfony/http-kernel": "2.1.*", - "symfony/config": "2.1.*" - }, - "autoload": { - "psr-0": { "Symfony\\Bundle\\SwiftmailerBundle": "" } - }, - "target-dir": "Symfony/Bundle/SwiftmailerBundle", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} diff --git a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/phpunit.xml.dist b/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/phpunit.xml.dist deleted file mode 100644 index 67d0dc9..0000000 --- a/vendor/symfony/swiftmailer-bundle/Symfony/Bundle/SwiftmailerBundle/phpunit.xml.dist +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - ./Tests - - - - - - . - - ./Resources - ./Tests - ./vendor - - - - diff --git a/vendor/symfony/symfony/.editorconfig b/vendor/symfony/symfony/.editorconfig deleted file mode 100644 index 153cf3e..0000000 --- a/vendor/symfony/symfony/.editorconfig +++ /dev/null @@ -1,10 +0,0 @@ -; top-most EditorConfig file -root = true - -; Unix-style newlines -[*] -end_of_line = LF - -[*.php] -indent_style = space -indent_size = 4 diff --git a/vendor/symfony/symfony/.gitignore b/vendor/symfony/symfony/.gitignore deleted file mode 100644 index fc673fa..0000000 --- a/vendor/symfony/symfony/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -phpunit.xml -composer.lock -composer.phar -autoload.php -/vendor/ diff --git a/vendor/symfony/symfony/.travis.yml b/vendor/symfony/symfony/.travis.yml deleted file mode 100644 index 94afb77..0000000 --- a/vendor/symfony/symfony/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: php - -php: - - 5.3.3 - - 5.3 - - 5.4 - -before_script: - - curl -s http://getcomposer.org/installer | php - - COMPOSER_ROOT_VERSION=dev-master php composer.phar --dev install diff --git a/vendor/symfony/symfony/CHANGELOG-2.0.md b/vendor/symfony/symfony/CHANGELOG-2.0.md deleted file mode 100644 index b028537..0000000 --- a/vendor/symfony/symfony/CHANGELOG-2.0.md +++ /dev/null @@ -1,341 +0,0 @@ -CHANGELOG for 2.0.x -=================== - -This changelog references the relevant changes (bug and security fixes) done -in 2.0 minor versions. - -To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash -To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.0.0...v2.0.1 - -* 2.0.14 (2012-05-17) - - * d1c831d: Change must-proxy-revalidate by proxy-revalidate - * 445fd2f: In console terms columns are width and rows are height - * 926ac98: [Finder] replaced static by self on a private variable - * 47605f6: [Form][DataMapper] Do not update form to data when form is read only - * c642a5e: [CssSelector] ignored an optional whitespace after a combinator - * cbc3ed3: [HttpKernel] added some constant for better forward compatibility - * 906f6f6: [DependencyInjection] fixed private services removal when used as configurators (closes #3758) - * 970d0b4: [BrowserKit] Check class existence only when required. - * 1ed8b72: Autoloader should not throw exception because PHP will continue to call other registered autoloaders. - * 7fe236a: [Security] Configure ports in RetryAuthenticationEntryPoint according to router settings - -* 2.0.13 (2012-04-30) - - * 5b92b9e: [Console] Selectively output to STDOUT or OUTPUT stream - * c89f3d3: [HttpKernel] Added DEPRECATED errors - * 689a40d: [MonologBridge] Fixed the WebProcessor - * 2e7d3b1: http_build_query fix - * de73de0: http_build_query fix - * 3b7ee9a: http_build_query fix - * 14b3b05: [TwigBundle] added missing entry in the XSD schema - * 7ddc8cb: [FrameworkBundle] Monitor added/removed translations files in dev (fix #3653) - * 686653a: [HttpKernel] Fixed wache vary write (fixes #3896). - * 45ada32: Add Support for boolean as to string into yaml extension - * cd783fb: [HttpKernel] Fixed cache vary lookup (fixes #3896). - * 3939c90: [FrameworkBundle] Fix TraceableEventDispatcher unable to trace static class callables - * e4cbbf3: [Locale] fixed StubNumberFormatter::format() to behave like the NumberFormatter::parse() regarding to error flagging - * f16ff89: [Locale] fixed StubNumberFormatter::parse() to behave like the NumberFormatter::parse() regarding to error flagging - * 0a60664: [Locale] updated StubIntlDateFormatter::format() exception message when timestamp argument is an array for PHP >= 5.3.4 - * 6f9c05d: [Locale] Complete Stub with intl_error_name - * 312a5a4: [Locale] fixed StubIntlDateFormatter::format() to set the right error for PHP >= 5.3.4 and to behave like the intl when formatting successfully - * bb61e09: [Locale] use the correct way for Intl error - * 01fcb08: [HttpKernel] Fix the ProfilerListener (fix #3620) - * 3ae826a: Fix issue #3251: Check attribute type of service tags - * 57dd914: [EventDispatcher] Fixed E_NOTICES with multiple eventnames per subscriber with mixed priorities - * 77185e0: [Routing] Allow spaces in the script name for the apache dumper - * 6465a69: [Routing] Fixes to handle spaces in route pattern - * 31dde14: [Locale] updated StubIntlDateFormatter::format() behavior for PHP >= 5.3.4 - * 8a2b115: [Console] Mock terminal size to prevent formatting errors on small terminals - * 595cc11: [Console] Wrap exception messages to the terminal width to avoid ugly output - * 97f7b29: [Console] Avoid outputing \r's in exception messages - * 04ae7cc: [Routing] fixed exception message. - * f7647f9: [Routing] improved exception message when giving an invalid route name. - * 0024ddc: Fix for using route name as check_path. - * fc41d4f: [Security] [HttpDigest] Fixes a configuration error caused by an invalid 'key' child node configuration - * 24a0d0a: [DependencyInjection] Support Yaml calls without arguments - * 15dd17e: Simplified CONTENT_ headers retrieval - * 86a3512: [FrameworkBundle] Add support for full URLs to redirect controller - * 068e859: [TwigBundle] Changed getAndCleanOutputBuffering() handling of systems where ob_get_level() never returns 0 - * efa807a: [HttpKernel] fixed sub-request which should be always a GET (refs #3657) - * c1206c3: [FrameworkBundle] Subrequests should always use GET method - * 0c9b2d4: use SecurityContextInterface instead of SecurityContext - -* 2.0.12 (2012-03-19) - - * 54b2413: Webprofiler ipv6 search fix - * 8642473: Changed instances of \DateTimeZone::UTC to 'UTC' as the constant is not valid a produces this error when DateTimeZone is instantiated: DateTimeZone::__construct() [datetimezone.--construct]: Unknown or bad timezone (1024) - * fbed9ff: Update src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php - * 1b395f5: Revert "Throw exception when "date_widget" option is not equal to "time_widget"" - * ed218bb: Fixed an "Array to string conversion" warning when using PHP 5.4. Also affects Symfony2 master. - * 50cb486: Fixed proxy generation in the DoctrineBundle when using Doctrine >= 2.2.0 - * 93cc9ef: [Validator] Remove a race condition in the ClassMetaDataFactory (fix #3217) - * 878c239: Fixed autoloader leakage in tests - * 17c3482: fixed timezone bug in DateTimeToTimestampTransformer - * 705e460: provided unmerged definition for correct help generation - * 45bbb5b: added getNativeDefinition() to allow specifying an alternate InputDefinition for help generation - * aa53b88: Sets _format attribute only if it wasn't set previously by the user - * a827375: [CssSelector] fixed CssSelector::toXPath() when the CSS selector is an empty string - * ad07a95: [BrowserKit] Fixed Client->back/forward/reload() not keeping all request attributes - * eee5065: [TwigBundle] Workaround a flaw in the design of the configuration (normalization) - * 7aad478: [Locale] Prevent empty bundle - * a894431: [DependencyInjection] Allow parsing of parameters near escaped percent signs - * f758884: [FrameworkBundle] ContainerAwareEventDispatcher::removeListener() (closes #3115) - * 8fe6ee3: [Console] fixed help command when used from the shell (closes #3480) - * caa44ae: Only work with the cli sapi - * e2fc3cd: [Process] PHP_BINARY return the current process - * dc2d5a0: [HttpFoundation][Session] Fix bug in PDO Session Storage with SQLSRV making assumptions about parameters with length being OUTPUT not INPUT parameters. - * e8281cf: SqliteProfilerStorage fix - -* 2.0.11 (2012-02-24) - - * 3e64d36: [Serializer] Fix XML decoding attack vector through external entities - * 66d0d3d: [FrameworkBundle] Fix a bug in the RedirectableUrlMatcher - * 24a3cd3: Finder - allow sorting when searching in multiple directories - * 6e75fd1: Resolves issue with spl_autoload_register creating new copies of the container and passing that into the closure. - * d02ca25: [MonologBundle] Fixed a bug when adding a processor on a service handler - * 2434552: [Translation] Fixed fallback location if location is longer than three characters (possibly by mistake). - * ec7fb0b: [Routing] added a proper exception when a route pattern references the same variable more than once (closes #3344) - * beb4fc0: [WIP][Locale] StubIntlDateFormatter::parse was throwing exception instead of returning Boolean false like intl implementation - -* 2.0.10 (2012-02-06) - - * 8e13095: Fixed the unescaping of parameters to handle arrays - * c3f0ec7: Make DoctrineBundle fowards compatible with Doctrine 2.2 - * e814d27: [FormType] Fixed broken MoneyType regexp for JPY - * 7f96c8a: [HttpKernel] Prevent php script execution in cached ESI pages using HttpCache - * 959614b: Use reflection to determaine the correct path for component validation.xml file - * cacc880: [Bugfix][Locale] Fixed incomplete Locale data loading - * d67d419: [HttpFoundation] added missing trustProxy condition - * efce640: [Yaml][Parser] throw an exception if not readable - * aa58330: [Form] fixed flawed condition - * 253eeba: [BugFix][Validator] Fix for PHP incosistent behaviour of ArrayAccess - * 0507840: Prevent parameters from overwriting the template filename. - * 9bc41d0: [HttpFoundation] Fixed #3053 - * 9441c46: [DependencyInjection] PhpDumper, fixes #2730 - -* 2.0.9 (2012-01-06) - - * 0492290: [Console] added a missing method (closes #3043) - * e09b523: updated Twig to 1.5.1 to fix a regression - * 261325d: Cast $query['params'] to array to ensure it is a valid argument for the foreach. - * 85ca8e3: ParameterBag no longer resolves parameters that have spaces. - * aacb2de: use the forward compat version in the Filesystem service - * 41950a6: [WebProfilerBundle] add margin-bottom to caption - -* 2.0.8 (2011-12-26) - - * adea589: [Twig] made code compatible with Twig 1.5 - * 6e98730: added forwards compatibility for the Filesystem component - * 1b4aaa2: [HttpFoundation] fixed ApacheRequest - * 8235848: [HttpFoundation][File] Add flv file default extension - * 5a6c989: FrameworkBundle: Adding test-attribute in xsd-schema to write functional-tests if using xml-configurations - * 649fa52: [DoctrineBridge] Fixed the entity provider to support proxies - * e417153: [BugFix][Console] Fix type hint for output formatter - * d1fa8cc: [WebProfiler] Fix some design glitches (closes #2867) - * 662fdc3: [DoctrineBundle] Fixed incorrectly shown params - * 9e38d6a: [SwiftmailerBundle] fixed the send email command when the queue does not extends Swift_ConfigurableSpool - * 5c41ec9: [HttpKernel][Client] Only simple (name=value without any other params) cookies can be stored in same line, so lets add every as standalone to be compliant with rfc6265 - * 8069ea6: [Form] Added missing use statements (closes #2880) - * d5a1343: [Console] Improve input definition output for Boolean defaults - * 62f3dc4: [SecurityBundle] Changed environment to something unique. - * 0900ecc: #2688: Entities are generated in wrong folder (doctrine:generate:entities Namespace) - * f3e92c4: [TwigBundle] Fix the exception message escaping - * 4d64d90: Allow empty result; change default *choices* value to **null** instead of **array()**. - added *testEmptyChoicesAreManaged* test - `null` as default value for choices. - is_array() used to test if choices are user-defined. - `null` as default value in __construct too. - `null` as default value for choices in EntityType. - * ec7eec5: [DependencyInjection] fixed espacing issue (close #2819) - * 6548354: fixed data-url - * d97d7e9: Added a check to see if the type is a string if it's not a FormTypeInterface - * 7827f72: Fixes #2817: ensure that the base loader is correctly initialised - * 9c1fbb8: [DoctrineBridge] fixed the refreshing of the user for invalid users - * 45bba7b: Added a hint about a possible cause for why no mime type guesser is be available - * 3759ff0: [Locale] StubNumberFormatter allow to parse 64bit number in 64bit mode - * db2d773: [FrameworkBundle] Improve the TemplateLocator exception message - * 2c3e9ad: [DependencyInjection] Made the reference case insensitive - * 4535abe: [DoctrineBridge] Fixed attempt to serialize non-serializable values - -* 2.0.7 (2011-12-08) - - * b7fd519: [Security] fixed cast - * acbbe8a: [Process] introduced usage of PHP_BINARY (available as of PHP 5.4) - * 03ed770: [Validator] The current class isn't set in execution context when doing validateProperty() - * 7cfc392: check for session before trying to authentication details - * 3c83b89: [DoctrineBridge] Catch user-error when the identifier is not serialized with the User entity. - * 769c17b: Throw exceptions in case someone forgot to set method name in call. - * 4a8f101b: Fixed problem with multiple occurences of a given namespace. fix #2688 - * 63e2a99: [CssSelector] Fixed Issue for XPathExprOr: missing prefix in string conversion - * 36c7d03: Fixed GH-2720 - Fix disabled atrribute handling for radio form elements - * 17dc605: [FrameworkBundle] Checks that the template is readable before checking its modification time - * 61e0bde: [HttpKernel] ControllerResolver arguments reflection for Closure object. - * e06cea9: [HttpFoundation] Cookie values should not be restricted - * a931e21: get correct client IP from X-forwarded-for header - * 78e9b2f: [Form] Fixed textarea_widget (W3C standards) - * 36cebf0: Fix infinite loop on circular reference in form factory - * 79ae3fc: [Form] fixed radio and checkbox when data is not bool - * c1426ba: added locale handling forward compatibility - * 10eed30: added MessageDataCollector forward compatibility - * 57e1aeb: Fixed undefined index notice in readProperty() method (PropertyPath) - -* 2.0.6 (2011-11-16) - - * f7c5bf1: [HttpKernel] fixed Content-Length header when using ESI tags (closes #2623) - * d67fbe9: [HttpFoundation] added an exception to MimeTypeGuesser::guess() when no guesser are available (closes #2636) - * 0462a89: [Security] fixed HttpUtils::checkRequestPath() to not catch all exceptions (closes #2637) - * 24dcd0f: [DoctrineBundle] added missing default parameters, needed to setup and use DBAL without ORM - * 462580c: [Form] Check for normal integers. refs 0427b126c15a0a27cd7033375e30371ae6a4e516 - * bb5fb79: changed the way we store the current ob level (refs #2617) - * fb0fffe: [Validator] fixed a unit test for PHP 5.4 (closes #2585) - * 7cba0a0: Also identify FirePHP by the X-FirePHP-Version header - * ed1a6c2: [TwigBundle] Do not clean output buffering below initial level - * e83e00a: Fixed rendering of FileType (value is not a valid attribute for input[type=file]) - * 8351a11: Added check for array fields to be integers in reverseTransform method. This prevents checkdate from getting strings as arguments and throwing incorrect ErrorException when submitting form with malformed (string) data in, for example, Date field. #2609 - * 45b218e: [Translation] added detection for circular references when adding a fallback catalogue - * a245e15: [DomCrawler] trim URI in getURI - * 9d2ab9c: [Doctrine] fixed security user reloading when the user has been changed via a form with validation errors (closes #2033) - * d789f94: Serializer#normalize gives precedence to objects that support normalization - * 57b7daf: [Security] Fix checkRequestPath doc; closes #2323 - * b33198f: fixed CodeHelper::formatFileFromText() method to allow " as a file wrapper (it occurs for the main exception message) - * c31c512: [FrameworkBundle] fixed output buffering when an error occurs in a sub-request - * 380c67e: [FrameworkBundle] fixed HttpKernel when the app is stateless - * 95a1902: [Finder] bypassed some code when possible - * 957690c: fixing WebTastCase when kernel is not found and improving exception message - * dbba796: [Yaml] fixed dumper for floats when the locale separator is not a dot - * f9befb6: Remove only the security token instead of the session cookie. - * 348bccb: Clear session cookie if user was deleted, is disabled or locked to prevent infinite redirect loops to the login path (fixes #1798). - * 89cd64a: Set error code when number cannot be parsed. Fixes #2389 - * c9d05d7: Let NumberFormatter handle integer type casting - - -* 2.0.5 (2011-11-02) - - * c5e2def: Fix ternary operator usage in RequestMatcher::checkIpv6() - * 43ce425: [HttpKernel] added missing accessor - * 80f0b98: [DependencyInjection] Fix DefinitionDecorator::getArgument() for replacements - * 4bd340d: [Security] Fix typo in init:acl command name - * 3043fa0: [HttpFoundation] fixed PHP 5.4 regression - * 8dcde3c: [DependencyInjection] fixed int casting for XML files (based on what is done in the YAML component) - * 6c2f093: [HttpFoundation] removed superfluous query call (closes #2469) - * 6343bef: [HttpKernel] Updated mirror method to check for symlinks before dirs and files - * 27d0809: [MonologBridge] Adjust for Monolog 1.0.2 - * 808088a: added the ability to use dot and single quotes in the keys and values - * cbb4bba: [Routing] fixed side-effect in the PHP matcher dumper - * 1a43505: [FrameworkBundle] fixed priority to be consistent with 2.1 - * 6b872cf: Check if cache_warmer service is available before doing the actual cache warmup - * e81c710: Increased the priority of the profiler request listener - * 2b0af5e: [HttpKernel] fixed profile parent/children for deep-nested requests - * 9d8046e: [Doctrine] GH-1635 - UniqueValidator now works with associations - * 3426c83: [BrowserKit] fixed cookie updates from Response (the URI here is not the base URI, so it should not be used to determine the default values missing in the cookie, closes #2309) - * c0f5b8a: [HttpKernel] fixed profile saving when it has children - * 3d7510e: [HttpKernel] fixed missing init for Profile children property - * 00cbd39: [BrowserKit] Fixed cookie expiry discard when attribute contains capitals - * edfa29b: session data needs to be encoded because it can contain non binary safe characters e.g null. Fixes #2067 - * c00ba4d: [Console] fixed typo (closes #2358) - * 2270a4d: [Bridge][Doctrine] Adding a catch for when a developer uses the EntityType with multiple=false but on a "hasMany" relationship - * 2877883: anything in front of ;q= is part of the mime type, anything after may be ignored - * d2d849c: Added translations for "hy" - * ae0685a: [Translation] Loader should only load local files - * 8bd0e42: [Form] Use proper parent (text) for EmailType and TextareaType - * 95049ef: [Form] Added type check to `ScalarToChoiceTransformer` - * a74ae9d: [HttpFoundation] made X_REWRITE_URL only available on Windows platforms - * 828b18f: [Form] Fixed lacking attributes in DateTimeType - -* 2.0.4 (2011-10-04) - - * cf4a91e: [ClassLoader] fixed usage of trait_exists() - * 8d6add6: [DoctrineBridge] fixed directory reference when the directory cannot be created - * 5419638: [HttpKernel] Show the actual directory needing to be created. - * 5c8a2fb: [Routing] fixed route overriden mechanism when using embedded collections (closes #2139) - * e70c884: [Bridge/Monolog] Fix WebProcessor to accept a Request object. - * 600b8ef: [Validator] added support for grapheme_strlen when mbstring is not installed but intl is installed - * d429594: removed separator of choice widget when the separator is null - * 17af138: fixed usage of LIBXML_COMPACT as it is not always available - * b12ce94: [HttpFoundation] fix #2142 PathInfo parsing/checking - * b402835: [HttpFoundation] standardized cookie paths (an empty path is equivalent to /) - * 1284681: [BrowserKit] standardized cookie paths (an empty path is equivalent to /) - * 1e7e6ba: [HttpFoundation] removed the possibility for a cookie path to set it to null (as this is equivalent to /) - * 2db24c2: removed time limit for the vendors script (closes #2282) - * c13b4e2: fixed fallback catalogue mechanism in Framework bundle - * 369f181: [FrameworkBundle] Add request scope to assets helper only if needed - * d6b915a: [FrameworkBundle] Assets templating helper does not need request scope - * ed02aa9: Fix console: list 'namespace' command display all available commands - * 85ed5c6: [ClassLoader] Fixed state when trait_exists doesn't exists - * e866a67: [DoctrineBundle] Tries to auto-generate the missing proxy files on the autoloader - * 908a7a3: [HttpFoundation] Fix bug in clearCookie/removeCookie not clearing cookies set with a default '/' path, unless it was explicitly specified - -* 2.0.3 (2011-09-25) - - * 49c585e: Revert "merged branch stealth35/ini_bool (PR #2235)" - -* 2.0.2 (2011-09-25) - - * ae3aded: Added PCRE_DOTALL modifier to RouteCompiler to allow urlencoded linefeed in route parameters. - * e5a23db: [ClassLoader] added support for PHP 5.4 traits - * 11c4412: [DependencyInjection] fix 2219 IniFileLoader accept Boolean - * 64d44fb: [Translator] fixed recursion when using a fallback that is the same as the locale - * bca551e: [DomCrawler] ChoiceFormField should take the content when value is unavailable - * b635dca: [Translator] fixed non-loaded locale - * ab8e760: Fixed the creation of the subrequests - * 8e2cbe6: fixes usage of mb_* - * fd4d241: Profiler session import fixed. - * 9fb15c7: [Process] workaround a faulty implementation of is_executable on Windows - * 43b55ef: [Locale] Fix #2179 StubIntlDateFormatter support yy format - * 9ffd8ca: [Translation] renamed hasStrict() to defines() - * 79710ed: [Translation] added a MessageCatalogue::hasStrict() method to check if a string has a translation (but without taking into account the fallback mechanism) - * c50a3a1: [Translation] fixed transchoice when used with a fallback - * c985ffa: [Translation] fixed message selector when the message is empty (closes #2144) - * 27ba003: [HttpFoundation] changed the strategy introduced in a5ccda47b4406518ee75929ce2e690b6998c021b to fix functional tests and still allow to call save more than once for a Session - * ff99d80: Changed the behavior of Session::regenerate to destroy the session when it invalidates it. - * 73c8d2b: [Form] fixed error bubbling for Date and Time types when rendering as multiple choices (closes #2062) - * 95dc7e1: Fixed fourth argument of Filesystem->mirror() - * ae52303: [HttpFoundation] Fixed duplicate of request - * cd40ed4: Added missing method to HTTP Digest entry point - * 3a7e038: [FrameworkBundle] sanitize target arg in asset:install command - * 8d50c16: few optimisations for XliffFileLoader and XmlFileLoader - * 639513a: Per the documentation, the `NotBlank` constraint should be using the `empty` language construct, otherwise it will not trigger on, for example, a boolean false from an unchecked checkbox field. - * d19f1d7: [Doctrine] Fix UniqueEntityValidator reporting a false positive by ignoring multiple query results - * 0224a34: Fixes typo on ACL Doctrine cache. - * 6bd1749: Fixed a bug when multiple expanded choices would render unchecked because of the Form Framework's strict type checking. - * f448029: [HttpKernel] Tweaked SQLite to speed up SqliteProfilerStorage - * 2cfa22c: Fix Method ContainerAwareEventDispatcher::hasListeners - * f4c133e: removed trailing dot to make it consistent with other validator messages - * a6670c2: [Routing] fixed a caching issue when annotations are used on a base class used by more than one concrete class - * 946ccb6: [Routing] fixed annotation loaders for abstract classes, added more unit tests - * 723cb71: [Translation] Add compatibility to PCRE 6.6.0 for explicit interval pluralization - * 24bacdc: Ignore VCS files in assets:install command (closes #2025) - * 020fa51: [RedirectResponse] Added missing `doctype` and `title` tag - -* 2.0.1 (2011-08-26) - - * 1c7694f: [HttpFoundation] added a missing exception - * 84c1719: [FrameworkBundle] Avoid listener key conflicts in ContainerAwareEventDispatcher - * 536538f: [DoctrineBundle] removed an unused and confusing parameter (the connection class can be changed via the wrapper_class setting of a connection) - * d7f0789: [FrameworkBundle] fixed duplicated RequestContext instances - * 89f477e: [WebProfilerBundle] Throw exception if a collector template isn't found - * 6ca72cf: [WebProfilerBundle] Allow .html.twig in collector template names - * 39fabab: [EventDispatcher] Fix removeSubscriber() to work with priority syntax - * 3380f2a: [DomCrawler] fixed disabled fields in forms (they are available in the DOM, but their values are not submitted -- whereas before, they were simply removed from the DOM) - * 2b1bb2c: [Form] added missing DelegatingValidator registration in the Form Extension class (used when using the Form component outside a Symfony2 project where the validation.xml is used instead) - * fdd2e7a: [Form] Fixing a bug where setting empty_value to false caused a variable to not be found - * bc7edfe: [FrameworkBundle] changed resource filename of Japanese validator translation - * c29fa9d: [Form] Fix for treatment zero as empty data. Closes #1986 - * 6e7c375: [FrameworkBundle] Cleanup schema file - * b6ee1a6: fixes a bug when overriding method via the X-HTTP-METHOD-OVERRIDE header - * 80d1718: [Fix] Email() constraints now guess as 'email' field type - * 3a64b08: Search in others user providers when a user is not found in the first user provider and throws the right exception. - * 805a267: Remove Content-Length header adding for now. Fixes #1846. - * ae55a98: Added $format in serialize() method, to keep consistence and give a hint to the normalizer. - * 7ec533e: got an if-condition out of unnecessary loops in Symfony\Component\ClassLoader\UniversalClassLoader - * 34a1b53: [HttpFoundation] Do not save session in Session::__destroy() when saved already - * 81fb8e1: [DomCrawler] fix finding charset in addContent - * 4f9d229: The trace argument value could be string ("*DEEP NESTED ARRAY*") - * be031f5: [HttpKernel] fixed ControllerResolver when the controller is a class name with an __invoke() method - * 275da0d: [Validator] changed 'self' to 'static' for child class to override pattern constant - * e78bc32: Fixed: Notice: Undefined index: enable_annotations in ... - * 86f888f: fix https default port check - * 8a980bd: $node->hasAttribute('disabled') sf2 should not create disagreement between implementation and practice for a crawler. If sahi real browser can find an element that is disabled, then sf2 should too. https://github.com/Behat/Mink/pull/58#issuecomment-1712459 - * 1087792: -- fix use of STDIN - * ee5b9ce: [SwiftmailerBundle] Allow non-file spools - * d880db2: [Form] Test covered fix for invalid date (13 month/31.02.2011 etc.) send to transformer. Closes #1755 - * df74f49: Patched src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php to throw an exception when an invalid date is passed for transformation (e.g. 31st February) - * 8519967: Calling supportsClass from vote to find out if we can vote - -* 2.0.0 (2011-07-28) diff --git a/vendor/symfony/symfony/CONTRIBUTORS.md b/vendor/symfony/symfony/CONTRIBUTORS.md deleted file mode 100644 index 5f51233..0000000 --- a/vendor/symfony/symfony/CONTRIBUTORS.md +++ /dev/null @@ -1,457 +0,0 @@ -CONTRIBUTORS -============ - -Symfony2 is the result of the work of many people who made the code better -(see http://symfony.com/contributors for more information): - - - Fabien Potencier (fabpot) - - Bernhard Schussek (bschussek) - - Victor Berchet (vicb) - - Jordi Boggiano (Seldaek) - - Johannes (schmittjoh) - - Kris Wallsmith (kriswallsmith) - - Christophe Coevoet (stof) - - Drak (drak) - - Lukas Kahwe Smith (lsmith77) - - Ryan Weaver (weaverryan) - - Jeremy Mikola (jmikola) - - Pascal Borreli (pborreli) - - Benjamin Eberlei (beberlei) - - Joseph Bielawski (stloyd) - - Igor Wiedler (igorw) - - Hugo Hamon (hhamon) - - William DURAND (willdurand) - - Eriksen Costa (eriksencosta) - - Alexandre Salomé (alexandresalome) - - stealth35 (stealth35) - - Jonathan H. Wage (jwage) - - Thibault Duplessis (ornicar) - - Jakub Zalas (jakzal) - - Eric Clemmons (ericclemmons) - - Martin Hasoň (hason) - - Henrik Westphal (snc) - - Dariusz Górecki (canni) - - Tobias Schultze (Tobion) - - Miha Vrhovnik (mvrhov) - - Bulat Shakirzyanov (avalanche123) - - Henrik Bjørnskov (henrikbjorn) - - Andrej Hudec (pulzarraider) - - Francis Besset (francisbesset) - - Kevin Bond (kbond) - - Deni (yethee) - - Arnout Boks (aboks) - - Jordan Alliot (jalliot) - - Marc Weistroff (marcw) - - Konstantin Kudryashov (everzet) - - Toni Uebernickel (havvg) - - Sebastian Hörl (blogsh) - - Excel Web Zone (excelwebzone) - - Brandon Turner (blt04) - - Hidenori Goto (hidenorigoto) - - Brikou CARRE (brikou) - - Lenar Lõhmus (lenar) - - John Wards (johnwards) - - Jean-François Simon (jfsimon) - - Daniel Holmes (danielholmes) - - Antoine Hérault (Herzult) - - Tigran Azatyan (tigranazatyan) - - Helmer Aaviksoo (helmer) - - Jacob Dreesen (jdreesen) - - umpirsky (umpirsky) - - Pierre Minnieur (pminnieur) - - Michał Pipa (michal-pipa) - - Fabien Pennequin (FabienPennequin) - - Richard Shank (IamPersistent) - - Benjamin Dulau (benjamindulau) - - Douglas Greenshields (shieldo) - - Christian Raue (craue) - - Grégoire Pineau (lyrixx) - - Katsuhiro OGAWA (fivestar) - - Richard Miller (richardmiller) - - Jeremy Mikola - - Bart van den Burg (Burgov) - - blue-eyes (blue-eyes) - - Juti Noppornpitak (shiroyuki) - - Robert Schönthal (digitalkaoz) - - Florin Patan (dlsniper) - - Rafael Dohms (rdohms) - - Tim Nagel (merk) - - Włodzimierz Gajda (gajdaw) - - Michel Weimerskirch (mweimerskirch) - - Javier Eguiluz (javiereguiluz) - - Joseph Rouff (rouffj) - - Marcel Beerta (mazen) - - Daniel Gomes - - Wotre (Wotre) - - Matthieu Vachon (maoueh) - - Amal Raghav (kertz) - - Artur Kotyrba (udat) - - Gustavo Piltcher - - Rui Marinho - - Clément JOBEILI (dator) - - Michael Holm (hollodk) - - dbu - - Julien Brochet (aerialls) - - Thomas (rande) - - Alexander (asm89) - - Gordon Franke (gimler) - - Noel GUILBERT (noelg) - - Alif Rachmawadi (subosito) - - Lars Strojny (lstrojny) - - Martin Schuhfuss (usefulthink) - - Dennis Benkert (denderello) - - Matthieu Bontemps (mbontemps) - - Jonathan Ingram (jonathaningram) - - Alessandro Desantis (alessandro1997) - - Oscar Cubo Medina (ocubom) - - Pablo Godel (pgodel) - - Dustin Whittle (dustinwhittle) - - Jean-François PHILIPPE (jfphilippe) - - Arnaud Le Blanc (arnaud-lb) - - Justin Hileman (bobthecow) - - Danny Berger (dpb587) - - Sven Paulus (subsven) - - Gábor Egyed (1ed) - - Xavier Perez (DuoSRX) - - Joel Wurtz (Brouznouf) - - Joe Lencioni (lencioni) - - brki (brki) - - Francois Zaninotto - - Leszek Prabucki (l3l0) - - Francois Zaninotto (fzaninotto) - - Gyula Sallai (thesalla) - - Xavier Montaña Carreras (xmontana) - - Andreas Hucks (meandmymonkey) - - Arjen Brouwer (arjenjb) - - Jérémie Augustin (jaugustin) - - Boussekeyt Jules (gordonslondon) - - Jan Sorgalla (jsor) - - Daniel Gomes (danielcsgomes) - - Lee McDermott (lmcd) - - Manuel Reinhard (sprain) - - Jeroen Hoek (jdhoek) - - Albert Jessurum (ajessu) - - Ryan Rogers (timewasted) - - flevour (flevour) - - Michel Salib (michelsalib) - - geoffrey - - Kim Hemsø Rasmussen (kimhemsoe) - - Manuel Kiessling (ManuelKiessling) - - Bilal Amarni (bamarni) - - Tobias Naumann (tna) - - Shein Alexey (conf) - - Aurelijus Valeiša (aurelijus) - - Ray (rrehbeindoi) - - Adrian Rudnik (kreischweide) - - Marcin Chylek (SongoQ) - - Pavel Campr (pcampr) - - Josip Kruslin (aubx) - - drak3 (drak3) - - Chris Boden (cboden) - - Dustin Dobervich (dustin10) - - Sebastian Marek (proofek) - - Olivier Dolbeau (odolbeau) - - Michele Orselli (micheleorselli) - - Andréia Bohner (andreia) - - Sebastian Bergmann (sebastianbergmann) - - Miquel Rodríguez Telep (mrtorrent) - - Peter Kokot (maastermedia) - - Jérôme Tamarelle (GromNaN) - - Jérémy Romey (jeremyFreeAgent) - - Yuen-Chi Lian (yclian) - - John Bohn (jjbohn) - - Greg Thornton (xdissent) - - andrewtch (andrewtch) - - Costin Bereveanu (schniper) - - Ondrej Slinták (ondrowan) - - Markus Lanthaler (lanthaler) - - Konstantin Leboev (realmfoo) - - Thomas Adam (tecbot) - - superjavason (superjavason) - - Donald Tyler (Chekote) - - Matthew Lewinski - - Kai - - Sergey Linnik (Partugal) - - Johnny Peck (johnnypeck) - - Laszlo Korte (laszlokorte) - - Hubert LECORCHE (hlecorche) - - Sergey Skopin (grizlik) - - drmonty (drmonty) - - Michael Ridgway (mridgway) - - Anthon Pang (robocoder) - - Stepan Tanasiychuk (stfalcon) - - Bertrand Zuchuat (Garfield-fr) - - Sebastien Armand (khepin) - - Sebastiaan Stok (sstok) - - Jan Schumann (janschumann) - - Asier Illarramendi (doup) - - Shigenobu Nishikawa (shishi) - - Marcin Sikoń (marphi) - - cedric lombardot (cedriclombardot) - - Laurent Bachelier (laurentb) - - Fabian Lange (CodingFabian) - - Yoshio HANAWA - - Pablo Díez (pablodip) - - Fran Moreno (franmomu) - - Manuel de Ruiter (ManuelAC) - - Crell (Crell) - - Benoit Tirmarche (mcbennn) - - Grégoire Passault - - Ismael Ambrosi (iambrosi) - - Tom Klingenberg (ktomk) - - De Cock Xavier (xdecock) - - Cristian González Sánchez (cristiangsp) - - Nils Adermann (naderman) - - Steve Kondik (cyanogen) - - Benjamin Lévêque (benji07) - - Matt Robinson (inanimatt) - - Ivan Rey (ivanrey) - - Ned Schwartz (theinterned) - - Ziumin (Ziumin) - - Aurélien Fredouelle (AurelC2G) - - Marek Kalnik (marekkalnik) - - Adán Lobato (adanlobato) - - Tiago Ribeiro (fixe) - - Geoffrey Tran (geoffreytran) - - Christian Schaefer (caefer) - - Robert Gruendler (pulse00) - - Elliot Anderson (elliot) - - xaav - - Anton Babenko (antonbabenko) - - Martin Hasoň - - José Nahuel Cuesta Luengo (ncuesta) - - Erkhembayar Gantulga (erheme318) - - Rostyslav Kinash - - yktd26 (yktd26) - - Tom Van Looy (tvlooy) - - umpirski (umpirski) - - Neil Katin - - John Kary (johnkary) - - Peter Kokot (peterkokot) - - Hossein Bukhamsin (husinluck) - - Fabrice Bernhard (fabriceb) - - develop - - Hiromi Hishida (77web) - - Klein Florian (docteurklein) - - Stéphane PY (stephpy) - - Joshua Nye (zerosanity) - - markchalloner (markchalloner) - - Mike Lively (mlively) - - Michael Williams (mtotheikle) - - Thomas Chmielowiec (chmielot) - - Casper Valdemar Poulsen (cvaldemar) - - Degory Valentine - - Krzysiek Łabuś (Crozin) - - Thomas Bibb (thomasbibb) - - Ivan Kurnosov - - stloyd - - Jan Prieser (jaypea) - - Thomas Chmielowiec (chmielot) - - Grégoire Paris (greg0ire) - - paulkamer (paulkamer) - - Peter Kruithof (pkruithof) - - alefranz (alefranz) - - frost-nzcr4 (frost-nzcr4) - - Petit Yoann (Abhoryo) - - Fabian Vogler (fabian) - - Maksim Kotlyar - - Artyom Protaskin (gatsu) - - Grégoire Passault (Gregwar) - - Alexander Miehe (Engerim) - - Cyril Quintin (cyqui) - - Gerard van Helden (drm) - - kazusuke sasezaki (sasezaki) - - root - - Kirill chEbba Chebunin (chEbba) - - Julien DIDIER (juliendidier) - - Chris Smith (cs278) - - Derek ROTH (DerekRoth) - - mwsaz - - corphi (corphi) - - Giulio De Donato (liuggio) - - Matthias (mpdude) - - Emil Einarsson (Einarsson) - - Yanick Witschi (Toflar) - - Don Pinkster - - Piotr Błasiak (blahy) - - Saem Ghani (saem) - - Michael Roterman (wtfzdotnet) - - Arno Geurts - - Jörg Rühl (LennyLinux) - - jeanfrancois.simon - - Bernd Matzner (bmatzner) - - Daniel Cestari (dcestari) - - Jesse Cooke (jc00ke) - - jdewit (jdewit) - - Javier López (loalf) - - Magnus Nordlander (magnusnordlander) - - Adam Monsen (meonkeys) - - nervo (nervo) - - Oleg Stepura (olegstepura) - - patrick-mcdougle (patrick-mcdougle) - - Sebastian Busch (sbusch) - - Benoît Merlet (trompette) - - xanido (xanido) - - Xavier HAUSHERR (xkobal) - - Craig Marvelley (craigmarvelley) - - Jan Behrens (deegital) - - Hans (drublic) - - m0ppers (m0ppers) - - Michael Shtukin (mshtukin) - - Teo (teo-sk) - - Tony Piper (tonypiper) - - sensio - - Théophile Helleboid - chtitux (chtitux) - - Matthew Lewinski (lewinski) - - Markus Bachmann (Baachi) - - scoolen (scoolen) - - irmantas (irmantas) - - tero (tero) - - Vadim Tyukov (vatson) - - Stainslav Turza (S0RIEN) - - chispita - - Tobias Sjösten (tobiassjosten) - - Wojciech Sznapka (wowo) - - julien.galenski - - Martijn Evers (martijn4evers) - - Jeremy Bush (zombor) - - Evan Villemez (evillemez) - - Davide Borsatto (davideborsatto) - - kaiwa - - Gustavo Adrian - - Roger Webb - - Nicolas Fabre (nfabre) - - Clément Herreman (clemherreman) - - heccjj (heccjj) - - Ringosan (Ringosan) - - Balázs Benyó (duplabe) - - Sebastian Utz (seut) - - Cédric Lahouste (RapotOR) - - George Giannoulopoulos (dotoree) - - Alberto Pirovano (geezmo) - - Xavier Briand (xavierbriand) - - Romain Geissler (Romain-Geissler) - - Carsten Nielsen (phreaknerd) - - JerikVenture (JerikVenture) - - Evan Kaufman (EvanK) - - meckhardt (meckhardt) - - Sebastian Ionescu - - Dirk Pahl (dirkaholic) - - Konrad Mohrfeldt (kmohrf) - - Nicolas Badey (Nico-B) - - Philipp Scheit (pscheit) - - Bouke Haarsma (Bouke) - - Lars Strojny - - Yrwein (Yrwein) - - pborreli - - Martin Parsiegla - - Christoph Nißle (DerStoffel) - - Luis Muñoz - - Oleg Zinchenko (cystbear) - - Guilherme Blanco (guilhermeblanco) - - Stefano Sala (stewe) - - Sebastian Hörl - - Romain Dorgueil - - Benjamin Zikarsky (bzikarsky) - - pierre - - Andy Stanberry (cranberyxl) - - Alessio (ioalessio) - - Jérôme Macias (jeromemacias) - - Philip Dahlstrøm (phidah) - - Gustavo Falco - - gnat42 (gnat42) - - Alexey Popkov (patashnik) - - devel - - Hiroki HIROCASTER OHTSUKA (hirocaster) - - jpauli (jpauli) - - Kevin McBride (krmcbride) - - Dan Patrick (mdpatrick) - - Drew Butler (nodrew) - - Pierre-Yves LEBECQ (pylebecq) - - Jan Eichhorn (Exeu) - - Alexander Zogheb - - cim-dch (cim-dch) - - Dan Ordille (dordille) - - Martin Mayer (martinmayer) - - Uwe Jäger (uwej711) - - Baptiste Clavié (Taluu) - - Tuxosaurus (Tuxosaurus) - - Hugo Hamon - - Lenar Lõhmus - - Juan M Martínez - - Alex - - agilemedialab (agilemedialab) - - Alan Chen (alan0101c) - - Masao Maeda (brtriver) - - clemens-tolboom (clemens-tolboom) - - Gustavo Falco (comfortablynumb) - - Denis Klementjev (dklementjev) - - Kévin Dunglas (dunglas) - - Gabriel Birke (gbirke) - - Osman Üngür (import) - - Robert Campbell (jayrulez) - - Gábor Fási (maerlyn) - - Matthew Davis (mdavis1982) - - Matt Lehner (mlehner) - - Jimmy Leger (redpanda) - - Nicolas A. Bérard-Nault - - Alexey Popkov - - Arnaud Buathier (arnapou) - - chesteroni (chesteroni) - - Elnur Abdurrakhimov (elnur) - - Beau Simensen (simensen) - - Till Klampaeckel (till) - - Juan Ases García (Ases) - - Eugene Babushkin (EugeneBabushkin) - - Fabien D. (FabienD) - - Matt Drollette (MDrollette) - - Matthieu Moquet (MattKetmo) - - Kornienko Alexander (Skorney) - - Vincent (Vincent-P) - - Drew Butler - - Pierre-Louis LAUNAY - - Sébastien HOUZE - - Sergiy Sokolenko - - Adrien Brault (adrienbrault) - - Vladimir Sazhin (cannie) - - Chris Sedlmayr (catchamonkey) - - Christian Stocker (chregu) - - chx (chx) - - Luis Cordova (cordoval) - - Damien Alexandre (damienalexandre) - - Damon Jones (damonjones) - - ds (dantleech) - - Djama Suemenich (djama) - - Daniel Londero (dlondero) - - Kyle Wild (dorkitude) - - David Soria Parra (dsp) - - Kousuke Ebihara (ebihara) - - ideea (ideea) - - Jérémy CROMBEZ (jcrombez) - - Johannes (johannes85) - - Justin Rainbow (justinrainbow) - - Abdulkadir N. A. (kadeer) - - Krzysztof Menżyk (krymen) - - kwiateusz (kwiateusz) - - Samuel Laulhau (lalop) - - Matt Fitzgerald (matthewfitz) - - Penny Leach (mjollnir) - - Marc Abramowitz (msabramo) - - Michael Schneider (mschneid) - - Oncle Tom (oncletom) - - ouardisoft (ouardisoft) - - Petr Jaroš (petajaros) - - pzwosta (pzwosta) - - Julien 'ruian' Galenski (ruian) - - Ruud Kamphuis (ruudk) - - Markus Tacker (tacker) - - Tyler Stroud (tystr) - - Vyacheslav Slinko (vslinko) - - Josiah (web-dev) - - Gustavo Adrian - - max - - Muharrem Demirci (mdemirci) - - meze (meze) - - Nicolas de Marqué Fromentin (nicodmf) - - Florent Cailhol (ooflorent) - - Pierre (ptheg) diff --git a/vendor/symfony/symfony/LICENSE b/vendor/symfony/symfony/LICENSE deleted file mode 100644 index cdffe7a..0000000 --- a/vendor/symfony/symfony/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2012 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/symfony/README.md b/vendor/symfony/symfony/README.md deleted file mode 100644 index fcac8d1..0000000 --- a/vendor/symfony/symfony/README.md +++ /dev/null @@ -1,57 +0,0 @@ -README -====== - -[![Build Status](https://secure.travis-ci.org/symfony/symfony.png?branch=master)](http://travis-ci.org/symfony/symfony) - -What is Symfony2? ------------------ - -Symfony2 is a PHP 5.3 full-stack web framework. It is written with speed and -flexibility in mind. It allows developers to build better and easy to maintain -websites with PHP. - -Symfony can be used to develop all kind of websites, from your personal blog -to high traffic ones like Dailymotion or Yahoo! Answers. - -Requirements ------------- - -Symfony2 is only supported on PHP 5.3.3 and up. - -Be warned that PHP versions before 5.3.8 are known to be buggy and might not -work for you: - - * before PHP 5.3.4, if you get "Notice: Trying to get property of - non-object", you've hit a known PHP bug (see - https://bugs.php.net/bug.php?id=52083 and - https://bugs.php.net/bug.php?id=50027); - - * before PHP 5.3.8, if you get an error involving annotations, you've hit a - known PHP bug (see https://bugs.php.net/bug.php?id=55156). - -Installation ------------- - -The best way to install Symfony2 is to download the Symfony Standard Edition -available at [http://symfony.com/download][1]. - -Documentation -------------- - -The "[Quick Tour][2]" tutorial gives you a first feeling of the framework. If, -like us, you think that Symfony2 can help speed up your development and take -the quality of your work to the next level, read the official -[Symfony2 documentation][3]. - -Contributing ------------- - -Symfony2 is an open source, community-driven project. If you'd like to contribute, -please read the [Contributing Code][4] part of the documentation. If you're submitting -a pull request, please follow the guidelines in the [Submitting a Patch][5] section. - -[1]: http://symfony.com/download -[2]: http://symfony.com/get_started -[3]: http://symfony.com/doc/current/ -[4]: http://symfony.com/doc/current/contributing/code/index.html -[5]: http://symfony.com/doc/current/contributing/code/patches.html#check-list diff --git a/vendor/symfony/symfony/UPGRADE-2.1.md b/vendor/symfony/symfony/UPGRADE-2.1.md deleted file mode 100644 index 4112e66..0000000 --- a/vendor/symfony/symfony/UPGRADE-2.1.md +++ /dev/null @@ -1,1409 +0,0 @@ -UPGRADE FROM 2.0 to 2.1 -======================= - -### General - - * The merging strategy for `assets_base_urls` and `base_urls` has changed. - - Unlike most configuration blocks, successive values for `assets_base_urls` - will overwrite each other instead of being merged. This behavior was chosen - because developers will typically define base URL's for each environment. - Given that most projects tend to inherit configurations (e.g. - `config_test.yml` imports `config_dev.yml`) and/or share a common base - configuration (i.e. `config.yml`), merging could yield a set of base URL's - for multiple environments. - - * The priorities for the built-in listeners have changed. - - ``` - 2.0 2.1 - security.firewall kernel.request 64 8 - locale listener kernel.request 0 16 - router listener early_request 255 n/a - request 0 32 - ``` - -### Doctrine - - * The DoctrineBundle is moved from the Symfony repository to the Doctrine repository. - Therefore you should change the namespace of this bundle in your AppKernel.php: - - Before: `new Symfony\Bundle\DoctrineBundle\DoctrineBundle()` - After: `new Doctrine\Bundle\DoctrineBundle\DoctrineBundle()` - -### HttpFoundation - - * Locale management was moved from the Session class to the Request class. - - ##### Configuring the default locale - - Before: - - ``` - framework: - session: - default_locale: fr - ``` - - After: - - ``` - framework: - default_locale: fr - ``` - - * The methods `getPathInfo()`, `getBaseUrl()` and `getBasePath()` of - a `Request` now all return a raw value (vs a urldecoded value before). Any call - to one of these methods must be checked and wrapped in a `rawurldecode()` if - needed. - - ##### Retrieving the locale from a Twig template - - Before: `{{ app.request.session.locale }}` or `{{ app.session.locale }}` - - After: `{{ app.request.locale }}` - - ##### Retrieving the locale from a PHP template - - Before: `$view['session']->getLocale()` - - After: `$view['request']->getLocale()` - - ##### Retrieving the locale from PHP code - - Before: `$session->getLocale()` - - After: `$request->getLocale()` - -### HttpFoundation - - * The current locale for the user is not stored anymore in the session - - You can simulate the old behavior by registering a listener that looks like the following, if the paramater which handle locale value in the request is `_locale`: - - ``` - namespace XXX; - - use Symfony\Component\HttpKernel\Event\GetResponseEvent; - use Symfony\Component\HttpKernel\KernelEvents; - use Symfony\Component\EventDispatcher\EventSubscriberInterface; - - class LocaleListener implements EventSubscriberInterface - { - private $defaultLocale; - - public function __construct($defaultLocale = 'en') - { - $this->defaultLocale = $defaultLocale; - } - - public function onKernelRequest(GetResponseEvent $event) - { - $request = $event->getRequest(); - if (!$request->hasPreviousSession()) { - return; - } - - if ($locale = $request->attributes->get('_locale')) { - $request->getSession()->set('_locale', $locale); - } else { - $request->setLocale($request->getSession()->get('_locale', $this->defaultLocale)); - } - } - - static public function getSubscribedEvents() - { - return array( - // must be registered before the default Locale listener - KernelEvents::REQUEST => array(array('onKernelRequest', 17)), - ); - } - } - ``` - -### Security - - * `Symfony\Component\Security\Core\User\UserInterface::equals()` has moved to - `Symfony\Component\Security\Core\User\EquatableInterface::isEqualTo()`. - - You must rename the `equals()` method in your implementation of the `User` - class to `isEqualTo()` and implement `EquatableInterface`. Apart from that, - no other changes are required. - - Alternatively, you may use the default implementation provided by - `AbstractToken::hasUserChanged()` if you have no need of custom comparison - logic. In this case, do not implement `EquatableInterface` and remove your - comparison method. - - Before: - - ``` - class User implements UserInterface - { - // ... - public function equals(UserInterface $user) { /* ... */ } - // ... - } - ``` - - After: - - ``` - class User implements UserInterface, EquatableInterface - { - // ... - public function isEqualTo(UserInterface $user) { /* ... */ } - // ... - } - ``` - - * The custom factories for the firewall configuration are now - registered during the build method of bundles instead of being registered - by the end-user. This means that you will you need to remove the 'factories' - keys in your security configuration. - - * The Firewall listener is now registered after the Router listener. This - means that specific Firewall URLs (like /login_check and /logout) must now - have proper routes defined in your routing configuration. - - * The user provider configuration has been refactored. The configuration - for the chain provider and the memory provider has been changed: - - Before: - - ``` yaml - security: - providers: - my_chain_provider: - providers: [my_memory_provider, my_doctrine_provider] - my_memory_provider: - users: - toto: { password: foobar, roles: [ROLE_USER] } - foo: { password: bar, roles: [ROLE_USER, ROLE_ADMIN] } - ``` - - After: - - ``` yaml - security: - providers: - my_chain_provider: - chain: - providers: [my_memory_provider, my_doctrine_provider] - my_memory_provider: - memory: - users: - toto: { password: foobar, roles: [ROLE_USER] } - foo: { password: bar, roles: [ROLE_USER, ROLE_ADMIN] } - ``` - - * `MutableAclInterface::setParentAcl` now accepts `null`, review any - implementations of this interface to reflect this change. - - * The `UserPassword` constraint has moved from the Security Bundle to the Security Component: - - Before: - - ``` - use Symfony\Bundle\SecurityBundle\Validator\Constraint\UserPassword; - use Symfony\Bundle\SecurityBundle\Validator\Constraint as SecurityAssert; - ``` - - After: - - ``` - use Symfony\Component\Security\Core\Validator\Constraint\UserPassword; - use Symfony\Component\Security\Core\Validator\Constraint as SecurityAssert; - ``` - -### Form - -#### BC Breaks in Form Types and Options - - * A third argument `$options` was added to the methods `buildView()` and - `buildViewBottomUp()` in `FormTypeInterface` and `FormTypeExtensionInterface`. - Furthermore, `buildViewBottomUp()` was renamed to `finishView()`. At last, - all methods in these types now receive instances of `FormBuilderInterface` - where they received instances of `FormBuilder` before. You need to change the - method signatures in your form types and extensions as shown below. - - Before: - - ``` - use Symfony\Component\Form\FormBuilder; - - public function buildForm(FormBuilder $builder, array $options) - ``` - - After: - - ``` - use Symfony\Component\Form\FormBuilderInterface; - - public function buildForm(FormBuilderInterface $builder, array $options) - ``` - - * The method `createBuilder` was removed from `FormTypeInterface` for performance - reasons. It is now not possible anymore to use custom implementations of - `FormBuilderInterface` for specific form types. - - If you are in such a situation, you can implement a custom `ResolvedFormTypeInterface` - where you create your own `FormBuilderInterface` implementation. You also need to - register a custom `ResolvedFormTypeFactoryInterface` implementation under the service - name "form.resolved_type_factory" in order to replace the default implementation. - - * If you previously inherited from `FieldType`, you should now inherit from - `FormType`. You should also set the option `compound` to `false` if your field - is not supposed to contain child fields. - - `FieldType` was deprecated and will be removed in Symfony 2.3. - - Before: - - ``` - public function getParent(array $options) - { - return 'field'; - } - ``` - - After: - - ``` - public function getParent() - { - return 'form'; - } - - public function setDefaultOptions(OptionsResolverInterface $resolver) - { - $resolver->setDefaults(array( - 'compound' => false, - )); - } - ``` - - The changed signature of `getParent()` is explained in the next step. - The new method `setDefaultOptions` is described in the section "Deprecations". - - * No options are passed to `getParent()` of `FormTypeInterface` anymore. If - you previously dynamically inherited from `FormType` or `FieldType`, you can now - dynamically set the "compound" option instead. - - Before: - - ``` - public function getParent(array $options) - { - return $options['expanded'] ? 'form' : 'field'; - } - ``` - - After: - - ``` - use Symfony\Component\OptionsResolver\OptionsResolverInterface; - use Symfony\Component\OptionsResolver\Options; - - public function setDefaultOptions(OptionsResolverInterface $resolver) - { - $compound = function (Options $options) { - return $options['expanded']; - }; - - $resolver->setDefaults(array( - 'compound' => $compound, - )); - } - - public function getParent() - { - return 'form'; - } - ``` - - The new method `setDefaultOptions` is described in the section "Deprecations". - - * The "data_class" option now *must* be set if a form maps to an object. If - you leave it empty, the form will expect an array, an instance of \ArrayAccess - or a scalar value and fail with a corresponding exception. - - Likewise, if a form maps to an array or an instance of \ArrayAccess, the option - *must* be left null now. - - Form mapped to an instance of `Person`: - - ``` - use Symfony\Component\OptionsResolver\OptionsResolverInterface; - - public function setDefaultOptions(OptionsResolverInterface $resolver) - { - $resolver->setDefaults(array( - 'data_class' => 'Acme\Demo\Person', - )); - } - ``` - - * The mapping of property paths to arrays has changed. - - Previously, a property path "street" mapped to both a field `$street` of - a class (or its accessors `getStreet()` and `setStreet()`) and an index - `['street']` of an array or an object implementing `\ArrayAccess`. - - Now, the property path "street" only maps to a class field (or accessors), - while the property path "[street]" only maps to indices. - - If you defined property paths manually in the "property_path" option, you - should revise them and adjust them if necessary. - - Before: - - ``` - $builder->add('name', 'text', array( - 'property_path' => 'address.street', - )); - ``` - - After (if the address object is an array): - - ``` - $builder->add('name', 'text', array( - 'property_path' => 'address[street]', - )); - ``` - - If address is an object in this case, the code given in "Before" - works without changes. - - * Form and field names must now start with a letter, digit or underscore - and only contain letters, digits, underscores, hyphens and colons. - - * In the collection type's template, the default name of the prototype field - has changed from `$$name$$` to `__name__`. - - For custom names, dollar signs are no longer prepended and appended. You are - advised to prepend and append two underscores wherever you specify a value - for the field's "prototype_name" option. - - Before: - - ``` - $builder->add('tags', 'collection', array('prototype' => 'proto')); - - // results in the name "$$proto$$" in the template - ``` - - After: - - ``` - $builder->add('tags', 'collection', array('prototype' => '__proto__')); - - // results in the name "__proto__" in the template - ``` - - * The "read_only" option now renders as `readonly="readonly"`, use - "disabled" instead for `disabled="disabled"`. - - * Child forms are no longer automatically validated. That means that you must - explicitly set the `Valid` constraint in your model if you want to validate - objects modified by child forms. - - If you don't want to set the `Valid` constraint, or if there is no reference - from the data of the parent form to the data of the child form, you can - enable BC behavior by setting the "cascade_validation" option to `true` - on the parent form. - -#### BC Breaks in Themes and HTML - - * FormType and FieldType were merged and require you to adapt your form - themes. - - The block `field_widget` and all references to it should be renamed to - `form_widget_simple`: - - Before: - - ``` - {% block url_widget %} - {% spaceless %} - {% set type = type|default('url') %} - {{ block('field_widget') }} - {% endspaceless %} - {% endblock url_widget %} - ``` - - After: - - ``` - {% block url_widget %} - {% spaceless %} - {% set type = type|default('url') %} - {{ block('form_widget_simple') }} - {% endspaceless %} - {% endblock url_widget %} - ``` - - All other `field_*` blocks and references to them should be renamed to - `form_*`. If you previously defined both a `field_*` and a `form_*` - block, you can merge them into a single `form_*` block and check the new - Boolean variable `compound` instead: - - Before: - - ``` - {% block form_errors %} - {% spaceless %} - ... form code ... - {% endspaceless %} - {% endblock form_errors %} - - {% block field_errors %} - {% spaceless %} - ... field code ... - {% endspaceless %} - {% endblock field_errors %} - ``` - - After: - - ``` - {% block form_errors %} - {% spaceless %} - {% if compound %} - ... form code ... - {% else %} - ... field code ... - {% endif %} - {% endspaceless %} - {% endblock form_errors %} - ``` - - Furthermore, the block `generic_label` was merged into `form_label`. You - should now override `form_label` in order to customize labels. - - Last but not least, the block `widget_choice_options` was renamed to - `choice_widget_options` to be consistent with the rest of the default - theme. - - * The strategy for generating the `id` and `name` HTML attributes for - checkboxes and radio buttons in a choice field has changed. - - Instead of appending the choice value, a generated integer is now appended - by default. Take care if your JavaScript relies on that. If you want to - read the actual choice value, read the `value` attribute instead. - - * In the choice field type's template, the structure of the `choices` variable - has changed. - - The `choices` variable now contains `ChoiceView` objects with two getters, - `getValue()` and `getLabel()`, to access the choice data. - - Before: - - ``` - {% for choice, label in choices %} - - {% endfor %} - ``` - - After: - - ``` - {% for choice in choices %} - - {% endfor %} - ``` - - * Creation of default labels has been moved to the view layer. You will need - to incorporate this logic into any custom `form_label` templates to - accommodate those cases when the `label` option has not been explicitly - set. - - ``` - {% block form_label %} - {% if label is empty %} - {% set label = name|humanize %} - {% endif %} - - {# ... #} - - {% endblock %} - ```` - - * Custom styling of individual rows of a collection form has been removed for - performance reasons. Instead, all rows now have the same block name, where - the word "entry" replaces the previous occurence of the row index. - - Before: - - ``` - {% block _author_tags_0_label %} - {# ... #} - {% endblock %} - - {% block _author_tags_1_label %} - {# ... #} - {% endblock %} - ``` - - After: - - ``` - {% block _author_tags_entry_label %} - {# ... #} - {% endblock %} - ``` - - * The method `renderBlock()` of the helper for the PHP Templating component was - renamed to `block()`. Its first argument is now expected to be a `FormView` - instance. - - Before: - - ``` - renderBlock('widget_attributes') ?> - ``` - - After: - - ``` - block($form, 'widget_attributes') ?> - ``` - -#### Other BC Breaks - - * The order of the first two arguments of the methods `createNamed` and - `createNamedBuilder` in `FormFactoryInterface` was reversed to be - consistent with the rest of the component. You should scan your code - for occurrences of these methods and reverse the parameters. - - Before: - - ``` - $form = $factory->createNamed('text', 'firstName'); - ``` - - After: - - ``` - $form = $factory->createNamed('firstName', 'text'); - ``` - - * The implementation of `ChoiceList` was changed heavily. As a result, - `ArrayChoiceList` was replaced. If you have custom classes that extend - this class, you must now extend `SimpleChoiceList` and pass choices - to the parent constructor. - - Before: - - ``` - class MyChoiceList extends ArrayChoiceList - { - protected function load() - { - parent::load(); - - // load choices - - $this->choices = $choices; - } - } - ``` - - After: - - ``` - class MyChoiceList extends SimpleChoiceList - { - public function __construct() - { - // load choices - - parent::__construct($choices); - } - } - ``` - - If you need to load the choices lazily -- that is, as soon as they are - accessed for the first time -- you can extend `LazyChoiceList` instead - and load the choices by overriding `loadChoiceList()`. - - ``` - class MyChoiceList extends LazyChoiceList - { - protected function loadChoiceList() - { - // load choices - - return new SimpleChoiceList($choices); - } - } - ``` - - `PaddedChoiceList`, `MonthChoiceList` and `TimezoneChoiceList` were removed. - Their functionality was merged into `DateType`, `TimeType` and `TimezoneType`. - - `EntityChoiceList` was adapted. The methods `getEntities()`, - `getEntitiesByKeys()`, `getIdentifier()` and `getIdentifierValues()` were - removed or made private. Instead of the first two, you can now use - `getChoices()` and `getChoicesByValues()`. For the latter two, no - replacement exists. - - * HTML attributes are now passed in the `label_attr` variable for the `form_label` function. - - Before: - - ``` - {{ form_label(form.name, 'Your Name', { 'attr': {'class': 'foo'} }) }} - ``` - - After: - - ``` - {{ form_label(form.name, 'Your Name', { 'label_attr': {'class': 'foo'} }) }} - ``` - - * `EntitiesToArrayTransformer` and `EntityToIdTransformer` were removed. - The former was replaced by `CollectionToArrayTransformer` in combination - with `EntityChoiceList`, the latter is not required in the core anymore. - - * The following transformers were renamed: - - * `ArrayToBooleanChoicesTransformer` to `ChoicesToBooleanArrayTransformer` - * `ScalarToBooleanChoicesTransformer` to `ChoiceToBooleanArrayTransformer` - * `ArrayToChoicesTransformer` to `ChoicesToValuesTransformer` - * `ScalarToChoiceTransformer` to `ChoiceToValueTransformer` - - to be consistent with the naming in `ChoiceListInterface`. - - * `FormUtil::toArrayKey()` and `FormUtil::toArrayKeys()` were removed. - They were merged into ChoiceList and have no public equivalent anymore. - - * The `add()`, `remove()`, `setParent()`, `bind()` and `setData()` methods in - the Form class now throw an exception if the form is already bound. - - If you used these methods on bound forms, you should consider moving your - logic to an event listener that observes `FormEvents::PRE_BIND` or - `FormEvents::BIND`. - -#### Deprecations - - * The following methods of `FormTypeInterface` and `FormTypeExtensionInterface` - are deprecated and will be removed in Symfony 2.3: - - * `getDefaultOptions` - * `getAllowedOptionValues` - - You should use the newly added `setDefaultOptions` instead, which gives you - access to the OptionsResolverInterface instance and with that a lot more power. - - Before: - - ``` - public function getDefaultOptions(array $options) - { - return array( - 'gender' => 'male', - ); - } - - public function getAllowedOptionValues(array $options) - { - return array( - 'gender' => array('male', 'female'), - ); - } - ``` - - After: - - ``` - public function setDefaultOptions(OptionsResolverInterface $resolver) - { - $resolver->setDefaults(array( - 'gender' => 'male', - )); - - $resolver->setAllowedValues(array( - 'gender' => array('male', 'female'), - )); - } - ``` - - You can specify options that depend on other options using closures. - - Before: - - ``` - public function getDefaultOptions(array $options) - { - $defaultOptions = array(); - - if ($options['multiple']) { - $defaultOptions['empty_data'] = array(); - } - - return $defaultOptions; - } - ``` - - After: - - ``` - public function setDefaultOptions(OptionsResolverInterface $resolver) - { - $resolver->setDefaults(array( - 'empty_data' => function (Options $options, $value) { - return $options['multiple'] ? array() : $value; - } - )); - } - ``` - - The second argument `$value` contains the current default value and - does not have to be specified if not needed. - - * The following methods in `FormBuilder` were deprecated and have a new - equivalent: - - * `prependClientTransformer`: `addViewTransformer`, with `true` as second argument - * `appendClientTransformer`: `addViewTransformer` - * `getClientTransformers`: `getViewTransformers` - * `resetClientTransformers`: `resetViewTransformers` - * `prependNormTransformer`: `addModelTransformer` - * `appendNormTransformer`: `addModelTransformer`, with `true` as second argument - * `getNormTransformers`: `getModelTransformers` - * `resetNormTransformers`: `resetModelTransformers` - - The deprecated methods will be removed in Symfony 2.3. You are advised to - update your application. - - Before: - - ``` - $builder->appendClientTransformer(new MyTransformer()); - ``` - - After: - - ``` - $builder->addViewTransformer(new MyTransformer()); - ``` - - * The following events were deprecated and have a new equivalent: - - * `FormEvents::SET_DATA`: `FormEvents::PRE_SET_DATA` - * `FormEvents::BIND_CLIENT_DATA`: `FormEvents::PRE_BIND` - * `FormEvents::BIND_NORM_DATA`: `FormEvents::BIND` - - The deprecated events will be removed in Symfony 2.3. - - Furthermore, the event classes `DataEvent` and `FilterDataEvent` were - deprecated and replaced by the generic `FormEvent`. You are advised to - code your listeners against the new event now. The deprecated events will - be removed in Symfony 2.3. - - Before: - - ``` - $builder->addListener(FormEvents::BIND_CLIENT_DATA, function (FilterDataEvent $event) { - // ... - }); - ``` - - After: - - ``` - $builder->addListener(FormEvents::PRE_BIND, function (FormEvent $event) { - // ... - }); - ``` - - * The interface `FormValidatorInterface` was deprecated and will be removed - in Symfony 2.3. - - If you implemented custom validators using this interface, you can - substitute them by event listeners listening to the `FormEvents::POST_BIND` - (or any other of the `*BIND` events). In case you used the CallbackValidator - class, you should now pass the callback directly to `addEventListener`. - - * The method `guessMinLength()` of `FormTypeGuesserInterface` was deprecated - and will be removed in Symfony 2.3. You should use the new method - `guessPattern()` instead which may return any regular expression that - is inserted in the HTML5 attribute `pattern`. - - Before: - - ``` - public function guessMinLength($class, $property) - { - if (/* condition */) { - return new ValueGuess($minLength, Guess::LOW_CONFIDENCE); - } - } - ``` - - After: - - ``` - public function guessPattern($class, $property) - { - if (/* condition */) { - return new ValueGuess('.{' . $minLength . ',}', Guess::LOW_CONFIDENCE); - } - } - ``` - - * Setting the option "property_path" to `false` was deprecated and will be unsupported - as of Symfony 2.3. - - You should use the new option "mapped" instead in order to set that you don't want - a field to be mapped to its parent's data. - - Before: - - ``` - $builder->add('termsAccepted', 'checkbox', array( - 'property_path' => false, - )); - ``` - - After: - - ``` - $builder->add('termsAccepted', 'checkbox', array( - 'mapped' => false, - )); - ``` - - * The following methods in `Form` were deprecated and will be removed in - Symfony 2.3: - - * `getTypes` - * `getErrorBubbling` - * `getNormTransformers` - * `getClientTransformers` - * `getAttribute` - * `hasAttribute` - * `getClientData` - * `getChildren` - * `hasChildren` - * `bindRequest` - - Before: - - ``` - $form->getErrorBubbling() - ``` - - After: - - ``` - $form->getConfig()->getErrorBubbling(); - ``` - - The method `getClientData` has a new equivalent that is named `getViewData`. - You can access all other methods on the `FormConfigInterface` object instead. - - Instead of `getChildren` and `hasChildren`, you should now use `all` and - `count`. - - Before: - - ``` - if ($form->hasChildren()) { - ``` - - After: - - ``` - if (count($form) > 0) { - ``` - - Instead of `bindRequest`, you should now simply call `bind`: - - Before: - - ``` - $form->bindRequest($request); - ``` - - After: - - ``` - $form->bind($request); - ``` - - * The option "validation_constraint" was deprecated and will be removed - in Symfony 2.3. You should use the option "constraints" instead, - where you can pass one or more constraints for a form. - - Before: - - ``` - $builder->add('name', 'text', array( - 'validation_constraint' => new NotBlank(), - )); - ``` - - After: - - ``` - $builder->add('name', 'text', array( - 'constraints' => new NotBlank(), - )); - ``` - - Unlike previously, you can also pass a list of constraints now: - - ``` - $builder->add('name', 'text', array( - 'constraints' => array( - new NotBlank(), - new MinLength(3), - ), - )); - ``` - - Be aware that constraints will now only be validated if they belong - to the validated group! So if you validate a form in group "Custom" - and previously did: - - ``` - $builder->add('name', 'text', array( - 'validation_constraint' => new NotBlank(), - )); - ``` - - Then you need to add the constraint to the group "Custom" now: - - ``` - $builder->add('name', 'text', array( - 'constraints' => new NotBlank(array('groups' => 'Custom')), - )); - ``` - - * The options "data_timezone" and "user_timezone" in `DateType`, - `DateTimeType` and `TimeType` were deprecated and will be removed in - Symfony 2.3. They were renamed to "model_timezone" and "view_timezone". - - Before: - - ``` - $builder->add('scheduledFor', 'date', array( - 'data_timezone' => 'UTC', - 'user_timezone' => 'America/New_York', - )); - ``` - - After: - - ``` - $builder->add('scheduledFor', 'date', array( - 'model_timezone' => 'UTC', - 'view_timezone' => 'America/New_York', - )); - ``` - - * The methods `addType`, `hasType` and `getType` in `FormFactory` are deprecated - and will be removed in Symfony 2.3. You should use the methods with the same - name on the `FormRegistry` instead. - - Before: - - ``` - $this->get('form.factory')->addType(new MyFormType()); - ``` - - After: - - ``` - $registry = $this->get('form.registry'); - - $registry->addType($registry->resolveType(new MyFormType())); - ``` - - * The following methods in class `FormView` were deprecated and will be - removed in Symfony 2.3: - - * `set` - * `has` - * `get` - * `all` - * `getVars` - * `addChild` - * `getChild` - * `getChildren` - * `removeChild` - * `hasChild` - * `hasChildren` - * `getParent` - * `hasParent` - * `setParent` - - You should access the public properties `vars`, `children` and `parent` - instead. - - Before: - - ``` - $view->set('help', 'A text longer than six characters'); - $view->set('error_class', 'max_length_error'); - ``` - - After: - - ``` - $view->vars = array_replace($view->vars, array( - 'help' => 'A text longer than six characters', - 'error_class' => 'max_length_error', - )); - ``` - - Before: - - ``` - echo $view->get('error_class'); - ``` - - After: - - ``` - echo $view->vars['error_class']; - ``` - - Before: - - ``` - if ($view->hasChildren()) { ... - ``` - - After: - - ``` - if (count($view->children)) { ... - ``` - -### Validator - - * The methods `setMessage()`, `getMessageTemplate()` and - `getMessageParameters()` in the `ConstraintValidator` class were deprecated and will - be removed in Symfony 2.3. - - If you have implemented custom validators, you should use the - `addViolation()` method on the `ExecutionContext` object instead. - - Before: - - ``` - public function isValid($value, Constraint $constraint) - { - // ... - if (!$valid) { - $this->setMessage($constraint->message, array( - '{{ value }}' => $value, - )); - - return false; - } - } - ``` - - After: - - ``` - public function isValid($value, Constraint $constraint) - { - // ... - if (!$valid) { - $this->context->addViolation($constraint->message, array( - '{{ value }}' => $value, - )); - - return false; - } - } - ``` - - * The method `setPropertyPath()` in the ExecutionContext class - was removed. - - You should use the `addViolationAtSubPath()` method on the - `ExecutionContext` object instead. - - Before: - - ``` - public function isPropertyValid(ExecutionContext $context) - { - // ... - $propertyPath = $context->getPropertyPath() . '.property'; - $context->setPropertyPath($propertyPath); - $context->addViolation('Error Message', array(), null); - } - ``` - - After: - - ``` - public function isPropertyValid(ExecutionContext $context) - { - // ... - $context->addViolationAtSubPath('property', 'Error Message', array(), null); - - } - ``` - - * The method `isValid` of `ConstraintValidatorInterface` was renamed to - `validate` and its return value was dropped. - - `ConstraintValidator` still contains the deprecated `isValid` method and - forwards `validate` calls to `isValid` by default. This BC layer will be - removed in Symfony 2.3. You are advised to rename your methods. You should - also remove the return values, which have never been used by the framework. - - Before: - - ``` - public function isValid($value, Constraint $constraint) - { - // ... - if (!$valid) { - $this->context->addViolation($constraint->message, array( - '{{ value }}' => $value, - )); - - return false; - } - } - ``` - - After: - - ``` - public function validate($value, Constraint $constraint) - { - // ... - if (!$valid) { - $this->context->addViolation($constraint->message, array( - '{{ value }}' => $value, - )); - - return; - } - } - ``` - - * Core translation messages changed. A dot is added at the end of each message. - Overwritten core translations need to be fixed. - - * Collections (arrays or instances of `\Traversable`) in properties - annotated with `Valid` are not traversed recursively by default anymore. - - This means that if a collection contains an entry which is again a - collection, the inner collection won't be traversed anymore as it - happened before. You can set the BC behavior by setting the new property - `deep` of `Valid` to `true`. - - Before: - - ``` - /** @Assert\Valid */ - private $recursiveCollection; - ``` - - After: - - ``` - /** @Assert\Valid(deep = true) */ - private $recursiveCollection; - ``` - - * The `Size`, `Min` and `Max` constraints were deprecated and will be removed in - Symfony 2.3. You should use the new constraint `Range` instead. - - Before: - - ``` - /** @Assert\Size(min = 2, max = 16) */ - private $numberOfCpus; - ``` - - After: - - ``` - /** @Assert\Range(min = 2, max = 16) */ - private $numberOfCpus; - ``` - - Before: - - ``` - /** @Assert\Min(2) */ - private $numberOfCpus; - ``` - - After: - - ``` - /** @Assert\Range(min = 2) */ - private $numberOfCpus; - ``` - - * The `MinLength` and `MaxLength` constraints were deprecated and will be - removed in Symfony 2.3. You should use the new constraint `Length` instead. - - Before: - - ``` - /** @Assert\MinLength(8) */ - private $password; - ``` - - After: - - ``` - /** @Assert\Length(min = 8) */ - private $password; - ``` - -### Session - - * Flash messages now return an array based on their type. The old method is - still available but is now deprecated. - - ##### Retrieving the flash messages from a Twig template - - Before: - - ``` - {% if app.session.hasFlash('notice') %} -
    - {{ app.session.getFlash('notice') }} -
    - {% endif %} - ``` - After: - - ``` - {% for flashMessage in app.session.flashbag.get('notice') %} -
    - {{ flashMessage }} -
    - {% endfor %} - ``` - - You can process all flash messages in a single loop with: - - ``` - {% for type, flashMessages in app.session.flashbag.all() %} - {% for flashMessage in flashMessages %} -
    - {{ flashMessage }} -
    - {% endfor %} - {% endfor %} - ``` - - * Session handler drivers should implement `\SessionHandlerInterface` or extend from - `Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeHandlerInterface` base class and renamed - to `Handler\FooSessionHandler`. E.g. `PdoSessionStorage` becomes `Handler\PdoSessionHandler`. - - * Refactor code using `$session->*flash*()` methods to use `$session->getFlashBag()->*()`. - -### Serializer - - * The key names created by the `GetSetMethodNormalizer` have changed from - all lowercased to camelCased (e.g. `mypropertyvalue` to `myPropertyValue`). - - * The `item` element is now converted to an array when deserializing XML. - - ``` xml - - - <![CDATA[title1]]><![CDATA[title2]]> - - ``` - - Before: - - Array() - - After: - - Array( - [item] => Array( - [0] => Array( - [title] => title1 - ) - [1] => Array( - [title] => title2 - ) - ) - ) - -### Routing - - * The UrlMatcher urldecodes the route parameters only once, they were - decoded twice before. Note that the `urldecode()` calls have been changed for a - single `rawurldecode()` in order to support `+` for input paths. - - * Two new parameters have been added to the DIC: `router.request_context.host` - and `router.request_context.scheme`. You can customize them for your - functional tests or for generating urls with the right host and scheme - when your are in the cli context. - -### FrameworkBundle - - * session options: lifetime, path, domain, secure, httponly were deprecated. - Prefixed versions should now be used instead: cookie_lifetime, cookie_path, cookie_domain, cookie_secure, cookie_httponly - - Before: - - ``` - framework: - session: - lifetime: 3600 - path: \ - domain: example.com - secure: true - httponly: true - ``` - - After: - - ``` - framework: - session: - cookie_lifetime: 3600 - cookie_path: \ - cookie_domain: example.com - cookie_secure: true - cookie_httponly: true - ``` - -Added `handler_id`, defaults to `session.handler.native_file`. - - ``` - framework: - session: - storage_id: session.storage.native - handler_id: session.handler.native_file - ``` - -To use mock session storage use the following. `handler_id` is irrelevant in this context. - - ``` - framework: - session: - storage_id: session.storage.mock_file - ``` - -### WebProfilerBundle - - * You must clear old profiles after upgrading to 2.1. If you are using a - database then you will need to remove the table. diff --git a/vendor/symfony/symfony/autoload.php.dist b/vendor/symfony/symfony/autoload.php.dist deleted file mode 100644 index 93aa33f..0000000 --- a/vendor/symfony/symfony/autoload.php.dist +++ /dev/null @@ -1,17 +0,0 @@ -add('IntlDateFormatter', __DIR__.'/src/Symfony/Component/Locale/Resources/stubs'); - $loader->add('Collator', __DIR__.'/src/Symfony/Component/Locale/Resources/stubs'); - $loader->add('Locale', __DIR__.'/src/Symfony/Component/Locale/Resources/stubs'); - $loader->add('NumberFormatter', __DIR__.'/src/Symfony/Component/Locale/Resources/stubs'); -} - -AnnotationRegistry::registerLoader(array($loader, 'loadClass')); -AnnotationRegistry::registerFile(__DIR__.'/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'); diff --git a/vendor/symfony/symfony/composer.json b/vendor/symfony/symfony/composer.json deleted file mode 100644 index 4c062ea..0000000 --- a/vendor/symfony/symfony/composer.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "symfony/symfony", - "type": "library", - "description": "The Symfony PHP framework", - "keywords": ["framework"], - "homepage": "http://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "require": { - "php": ">=5.3.3", - "doctrine/common": ">2.2,<2.4-dev", - "twig/twig": ">=1.9.1,<2.0-dev" - }, - "replace": { - "symfony/doctrine-bridge": "self.version", - "symfony/monolog-bridge": "self.version", - "symfony/propel1-bridge": "self.version", - "symfony/swiftmailer-bridge": "self.version", - "symfony/twig-bridge": "self.version", - "symfony/framework-bundle": "self.version", - "symfony/security-bundle": "self.version", - "symfony/twig-bundle": "self.version", - "symfony/web-profiler-bundle": "self.version", - "symfony/browser-kit": "self.version", - "symfony/class-loader": "self.version", - "symfony/config": "self.version", - "symfony/console": "self.version", - "symfony/css-selector": "self.version", - "symfony/dependency-injection": "self.version", - "symfony/dom-crawler": "self.version", - "symfony/event-dispatcher": "self.version", - "symfony/filesystem": "self.version", - "symfony/finder": "self.version", - "symfony/form": "self.version", - "symfony/http-foundation": "self.version", - "symfony/http-kernel": "self.version", - "symfony/locale": "self.version", - "symfony/options-resolver": "self.version", - "symfony/process": "self.version", - "symfony/routing": "self.version", - "symfony/security": "self.version", - "symfony/serializer": "self.version", - "symfony/templating": "self.version", - "symfony/translation": "self.version", - "symfony/validator": "self.version", - "symfony/yaml": "self.version" - }, - "require-dev": { - "doctrine/dbal": ">=2.2,<2.4-dev", - "doctrine/orm": ">=2.2,<2.4-dev", - "doctrine/data-fixtures": "1.0.*", - "propel/propel1": "dev-master", - "monolog/monolog": "dev-master" - }, - "autoload": { - "psr-0": { - "Symfony": "src/", - "SessionHandlerInterface": "src/Symfony/Component/HttpFoundation/Resources/stubs" - } - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} diff --git a/vendor/symfony/symfony/phpunit.xml.dist b/vendor/symfony/symfony/phpunit.xml.dist deleted file mode 100644 index 64f0b50..0000000 --- a/vendor/symfony/symfony/phpunit.xml.dist +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - ./src/Symfony/Bridge/*/Tests/ - ./src/Symfony/Component/*/Tests/ - ./src/Symfony/Bundle/*/Tests/ - - - - - - benchmark - - - - - - ./src/Symfony/ - - ./src/Symfony/Bridge/*/Tests - ./src/Symfony/Component/*/Tests - ./src/Symfony/Bundle/*/Tests - ./src/Symfony/Bundle/*/Resources - ./src/Symfony/Component/*/Resources - ./src/Symfony/Component/*/*/Resources - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/CHANGELOG.md b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/CHANGELOG.md deleted file mode 100644 index ada3e62..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/CHANGELOG.md +++ /dev/null @@ -1,12 +0,0 @@ -CHANGELOG -========= - -2.1.0 ------ - - * added a default implementation of the ManagerRegistry - * added a session storage for Doctrine DBAL - * DoctrineOrmTypeGuesser now guesses "collection" for array Doctrine type - * DoctrineType now caches its choice lists in order to improve performance - * DoctrineType now uses ManagerRegistry::getManagerForClass() if the option "em" is not set - * UniqueEntity validation constraint now accepts a "repositoryMethod" option that will be used to check for uniqueness instead of the default "findBy" diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php deleted file mode 100644 index f57d8fa..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\CacheWarmer; - -use Doctrine\Common\Persistence\ManagerRegistry; -use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface; - -/** - * The proxy generator cache warmer generates all entity proxies. - * - * In the process of generating proxies the cache for all the metadata is primed also, - * since this information is necessary to build the proxies in the first place. - * - * @author Benjamin Eberlei - */ -class ProxyCacheWarmer implements CacheWarmerInterface -{ - private $registry; - - /** - * Constructor. - * - * @param ManagerRegistry $registry A ManagerRegistry instance - */ - public function __construct(ManagerRegistry $registry) - { - $this->registry = $registry; - } - - /** - * This cache warmer is not optional, without proxies fatal error occurs! - * - * @return false - */ - public function isOptional() - { - return false; - } - - public function warmUp($cacheDir) - { - foreach ($this->registry->getManagers() as $em) { - // we need the directory no matter the proxy cache generation strategy - if (!is_dir($proxyCacheDir = $em->getConfiguration()->getProxyDir())) { - if (false === @mkdir($proxyCacheDir, 0777, true)) { - throw new \RuntimeException(sprintf('Unable to create the Doctrine Proxy directory "%s".', $proxyCacheDir)); - } - } elseif (!is_writable($proxyCacheDir)) { - throw new \RuntimeException(sprintf('The Doctrine Proxy directory "%s" is not writeable for the current system user.', $proxyCacheDir)); - } - - // if proxies are autogenerated we don't need to generate them in the cache warmer - if ($em->getConfiguration()->getAutoGenerateProxyClasses()) { - continue; - } - - $classes = $em->getMetadataFactory()->getAllMetadata(); - - $em->getProxyFactory()->generateProxyClasses($classes); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php deleted file mode 100644 index eb0dc05..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php +++ /dev/null @@ -1,137 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine; - -use Doctrine\Common\EventArgs; -use Doctrine\Common\EventManager; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Allows lazy loading of listener services. - * - * @author Johannes M. Schmitt - */ -class ContainerAwareEventManager extends EventManager -{ - /** - * Map of registered listeners. - * => - * - * @var array - */ - private $listeners = array(); - private $initialized = array(); - private $container; - - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - /** - * Dispatches an event to all registered listeners. - * - * @param string $eventName The name of the event to dispatch. The name of the event is - * the name of the method that is invoked on listeners. - * @param EventArgs $eventArgs The event arguments to pass to the event handlers/listeners. - * If not supplied, the single empty EventArgs instance is used. - * @return boolean - */ - public function dispatchEvent($eventName, EventArgs $eventArgs = null) - { - if (isset($this->listeners[$eventName])) { - $eventArgs = $eventArgs === null ? EventArgs::getEmptyInstance() : $eventArgs; - - $initialized = isset($this->initialized[$eventName]); - - foreach ($this->listeners[$eventName] as $hash => $listener) { - if (!$initialized && is_string($listener)) { - $this->listeners[$eventName][$hash] = $listener = $this->container->get($listener); - } - - $listener->$eventName($eventArgs); - } - $this->initialized[$eventName] = true; - } - } - - /** - * Gets the listeners of a specific event or all listeners. - * - * @param string $event The name of the event. - * @return array The event listeners for the specified event, or all event listeners. - */ - public function getListeners($event = null) - { - return $event ? $this->listeners[$event] : $this->listeners; - } - - /** - * Checks whether an event has any registered listeners. - * - * @param string $event - * @return boolean TRUE if the specified event has any listeners, FALSE otherwise. - */ - public function hasListeners($event) - { - return isset($this->listeners[$event]) && $this->listeners[$event]; - } - - /** - * Adds an event listener that listens on the specified events. - * - * @param string|array $events The event(s) to listen on. - * @param object|string $listener The listener object. - */ - public function addEventListener($events, $listener) - { - if (is_string($listener)) { - if ($this->initialized) { - throw new \RuntimeException('Adding lazy-loading listeners after construction is not supported.'); - } - - $hash = '_service_'.$listener; - } else { - // Picks the hash code related to that listener - $hash = spl_object_hash($listener); - } - - foreach ((array) $events as $event) { - // Overrides listener if a previous one was associated already - // Prevents duplicate listeners on same event (same instance only) - $this->listeners[$event][$hash] = $listener; - } - } - - /** - * Removes an event listener from the specified events. - * - * @param string|array $events - * @param object|string $listener - */ - public function removeEventListener($events, $listener) - { - if (is_string($listener)) { - $hash = '_service_'.$listener; - } else { - // Picks the hash code related to that listener - $hash = spl_object_hash($listener); - } - - foreach ((array) $events as $event) { - // Check if actually have this listener associated - if (isset($this->listeners[$event][$hash])) { - unset($this->listeners[$event][$hash]); - } - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php deleted file mode 100644 index 35979af..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php +++ /dev/null @@ -1,177 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\DataCollector; - -use Doctrine\Common\Persistence\ManagerRegistry; -use Doctrine\DBAL\Logging\DebugStack; -use Doctrine\DBAL\Types\Type; -use Symfony\Component\HttpKernel\DataCollector\DataCollector; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; - -/** - * DoctrineDataCollector. - * - * @author Fabien Potencier - */ -class DoctrineDataCollector extends DataCollector -{ - private $registry; - private $connections; - private $managers; - private $loggers = array(); - - public function __construct(ManagerRegistry $registry) - { - $this->registry = $registry; - $this->connections = $registry->getConnectionNames(); - $this->managers = $registry->getManagerNames(); - } - - /** - * Adds the stack logger for a connection. - * - * @param string $name - * @param DebugStack $logger - */ - public function addLogger($name, DebugStack $logger) - { - $this->loggers[$name] = $logger; - } - - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Exception $exception = null) - { - $queries = array(); - foreach ($this->loggers as $name => $logger) { - $queries[$name] = $this->sanitizeQueries($name, $logger->queries); - } - - $this->data = array( - 'queries' => $queries, - 'connections' => $this->connections, - 'managers' => $this->managers, - ); - } - - public function getManagers() - { - return $this->data['managers']; - } - - public function getConnections() - { - return $this->data['connections']; - } - - public function getQueryCount() - { - return array_sum(array_map('count', $this->data['queries'])); - } - - public function getQueries() - { - return $this->data['queries']; - } - - public function getTime() - { - $time = 0; - foreach ($this->data['queries'] as $queries) { - foreach ($queries as $query) { - $time += $query['executionMS']; - } - } - - return $time; - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'db'; - } - - private function sanitizeQueries($connectionName, $queries) - { - foreach ($queries as $i => $query) { - $queries[$i] = $this->sanitizeQuery($connectionName, $query); - } - - return $queries; - } - - private function sanitizeQuery($connectionName, $query) - { - $query['explainable'] = true; - $query['params'] = (array) $query['params']; - foreach ($query['params'] as $j => &$param) { - if (isset($query['types'][$j])) { - // Transform the param according to the type - $type = $query['types'][$j]; - if (is_string($type)) { - $type = Type::getType($type); - } - if ($type instanceof Type) { - $query['types'][$j] = $type->getBindingType(); - $param = $type->convertToDatabaseValue($param, $this->registry->getConnection($connectionName)->getDatabasePlatform()); - } - } - - list($param, $explainable) = $this->sanitizeParam($param); - if (!$explainable) { - $query['explainable'] = false; - } - } - - return $query; - } - - /** - * Sanitizes a param. - * - * The return value is an array with the sanitized value and a boolean - * indicating if the original value was kept (allowing to use the sanitized - * value to explain the query). - * - * @param mixed $var - * @return array - */ - private function sanitizeParam($var) - { - if (is_object($var)) { - return array(sprintf('Object(%s)', get_class($var)), false); - } - - if (is_array($var)) { - $a = array(); - $original = true; - foreach ($var as $k => $v) { - list($value, $orig) = $this->sanitizeParam($v); - $original = $original && $orig; - $a[$k] = $value; - } - - return array($a, $original); - } - - if (is_resource($var)) { - return array(sprintf('Resource(%s)', get_resource_type($var)), false); - } - - return array($var, true); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DataFixtures/ContainerAwareLoader.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DataFixtures/ContainerAwareLoader.php deleted file mode 100644 index 0b10527..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DataFixtures/ContainerAwareLoader.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\DataFixtures; - -use Doctrine\Common\DataFixtures\FixtureInterface; -use Doctrine\Common\DataFixtures\Loader; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Doctrine data fixtures loader that injects the service container into - * fixture objects that implement ContainerAwareInterface. - * - * Note: Use of this class requires the Doctrine data fixtures extension, which - * is a suggested dependency for Symfony. - */ -class ContainerAwareLoader extends Loader -{ - /** - * @var ContainerInterface - */ - private $container; - - /** - * Constructor. - * - * @param ContainerInterface $container A ContainerInterface instance - */ - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - /** - * {@inheritdoc} - */ - public function addFixture(FixtureInterface $fixture) - { - if ($fixture instanceof ContainerAwareInterface) { - $fixture->setContainer($this->container); - } - - parent::addFixture($fixture); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php deleted file mode 100644 index e9294f9..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php +++ /dev/null @@ -1,383 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\DependencyInjection; - -use Symfony\Component\HttpKernel\DependencyInjection\Extension; -use Symfony\Component\DependencyInjection\Alias; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\Config\Resource\FileResource; - -/** - * This abstract classes groups common code that Doctrine Object Manager extensions (ORM, MongoDB, CouchDB) need. - * - * @author Benjamin Eberlei - */ -abstract class AbstractDoctrineExtension extends Extension -{ - /** - * Used inside metadata driver method to simplify aggregation of data. - * - * @var array - */ - protected $aliasMap = array(); - - /** - * Used inside metadata driver method to simplify aggregation of data. - * - * @var array - */ - protected $drivers = array(); - - /** - * @param array $objectManager A configured object manager. - * @param ContainerBuilder $container A ContainerBuilder instance - */ - protected function loadMappingInformation(array $objectManager, ContainerBuilder $container) - { - if ($objectManager['auto_mapping']) { - // automatically register bundle mappings - foreach (array_keys($container->getParameter('kernel.bundles')) as $bundle) { - if (!isset($objectManager['mappings'][$bundle])) { - $objectManager['mappings'][$bundle] = null; - } - } - } - - foreach ($objectManager['mappings'] as $mappingName => $mappingConfig) { - if (null !== $mappingConfig && false === $mappingConfig['mapping']) { - continue; - } - - $mappingConfig = array_replace(array( - 'dir' => false, - 'type' => false, - 'prefix' => false, - ), (array) $mappingConfig); - - $mappingConfig['dir'] = $container->getParameterBag()->resolveValue($mappingConfig['dir']); - // a bundle configuration is detected by realizing that the specified dir is not absolute and existing - if (!isset($mappingConfig['is_bundle'])) { - $mappingConfig['is_bundle'] = !is_dir($mappingConfig['dir']); - } - - if ($mappingConfig['is_bundle']) { - $bundle = null; - foreach ($container->getParameter('kernel.bundles') as $name => $class) { - if ($mappingName === $name) { - $bundle = new \ReflectionClass($class); - - break; - } - } - - if (null === $bundle) { - throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled.', $mappingName)); - } - - $mappingConfig = $this->getMappingDriverBundleConfigDefaults($mappingConfig, $bundle, $container); - if (!$mappingConfig) { - continue; - } - } - - $this->assertValidMappingConfiguration($mappingConfig, $objectManager['name']); - $this->setMappingDriverConfig($mappingConfig, $mappingName); - $this->setMappingDriverAlias($mappingConfig, $mappingName); - } - } - - /** - * Register the alias for this mapping driver. - * - * Aliases can be used in the Query languages of all the Doctrine object managers to simplify writing tasks. - * - * @param array $mappingConfig - * @param string $mappingName - */ - protected function setMappingDriverAlias($mappingConfig, $mappingName) - { - if (isset($mappingConfig['alias'])) { - $this->aliasMap[$mappingConfig['alias']] = $mappingConfig['prefix']; - } else { - $this->aliasMap[$mappingName] = $mappingConfig['prefix']; - } - } - - /** - * Register the mapping driver configuration for later use with the object managers metadata driver chain. - * - * @param array $mappingConfig - * @param string $mappingName - */ - protected function setMappingDriverConfig(array $mappingConfig, $mappingName) - { - if (is_dir($mappingConfig['dir'])) { - $this->drivers[$mappingConfig['type']][$mappingConfig['prefix']] = realpath($mappingConfig['dir']); - } else { - throw new \InvalidArgumentException(sprintf('Invalid Doctrine mapping path given. Cannot load Doctrine mapping/bundle named "%s".', $mappingName)); - } - } - - /** - * If this is a bundle controlled mapping all the missing information can be autodetected by this method. - * - * Returns false when autodetection failed, an array of the completed information otherwise. - * - * @param array $bundleConfig - * @param \ReflectionClass $bundle - * @param ContainerBuilder $container A ContainerBuilder instance - * - * @return array|false - */ - protected function getMappingDriverBundleConfigDefaults(array $bundleConfig, \ReflectionClass $bundle, ContainerBuilder $container) - { - $bundleDir = dirname($bundle->getFilename()); - - if (!$bundleConfig['type']) { - $bundleConfig['type'] = $this->detectMetadataDriver($bundleDir, $container); - } - - if (!$bundleConfig['type']) { - // skip this bundle, no mapping information was found. - return false; - } - - if (!$bundleConfig['dir']) { - if (in_array($bundleConfig['type'], array('annotation', 'staticphp'))) { - $bundleConfig['dir'] = $bundleDir.'/'.$this->getMappingObjectDefaultName(); - } else { - $bundleConfig['dir'] = $bundleDir.'/'.$this->getMappingResourceConfigDirectory(); - } - } else { - $bundleConfig['dir'] = $bundleDir.'/'.$bundleConfig['dir']; - } - - if (!$bundleConfig['prefix']) { - $bundleConfig['prefix'] = $bundle->getNamespaceName().'\\'.$this->getMappingObjectDefaultName(); - } - - return $bundleConfig; - } - - /** - * Register all the collected mapping information with the object manager by registering the appropriate mapping drivers. - * - * @param array $objectManager - * @param ContainerBuilder $container A ContainerBuilder instance - */ - protected function registerMappingDrivers($objectManager, ContainerBuilder $container) - { - // configure metadata driver for each bundle based on the type of mapping files found - if ($container->hasDefinition($this->getObjectManagerElementName($objectManager['name'].'_metadata_driver'))) { - $chainDriverDef = $container->getDefinition($this->getObjectManagerElementName($objectManager['name'].'_metadata_driver')); - } else { - $chainDriverDef = new Definition('%'.$this->getObjectManagerElementName('metadata.driver_chain.class%')); - $chainDriverDef->setPublic(false); - } - - foreach ($this->drivers as $driverType => $driverPaths) { - $mappingService = $this->getObjectManagerElementName($objectManager['name'].'_'.$driverType.'_metadata_driver'); - if ($container->hasDefinition($mappingService)) { - $mappingDriverDef = $container->getDefinition($mappingService); - $args = $mappingDriverDef->getArguments(); - if ($driverType == 'annotation') { - $args[1] = array_merge(array_values($driverPaths), $args[1]); - } else { - $args[0] = array_merge(array_values($driverPaths), $args[0]); - } - $mappingDriverDef->setArguments($args); - } elseif ($driverType == 'annotation') { - $mappingDriverDef = new Definition('%'.$this->getObjectManagerElementName('metadata.'.$driverType.'.class%'), array( - new Reference($this->getObjectManagerElementName('metadata.annotation_reader')), - array_values($driverPaths) - )); - } else { - $mappingDriverDef = new Definition('%'.$this->getObjectManagerElementName('metadata.'.$driverType.'.class%'), array( - array_values($driverPaths) - )); - } - $mappingDriverDef->setPublic(false); - if (false !== strpos($mappingDriverDef->getClass(), 'yml') || false !== strpos($mappingDriverDef->getClass(), 'xml')) { - $mappingDriverDef->setArguments(array(array_flip($driverPaths))); - $mappingDriverDef->addMethodCall('setGlobalBasename', array('mapping')); - } - - $container->setDefinition($mappingService, $mappingDriverDef); - - foreach ($driverPaths as $prefix => $driverPath) { - $chainDriverDef->addMethodCall('addDriver', array(new Reference($mappingService), $prefix)); - } - } - - $container->setDefinition($this->getObjectManagerElementName($objectManager['name'].'_metadata_driver'), $chainDriverDef); - } - - /** - * Assertion if the specified mapping information is valid. - * - * @param array $mappingConfig - * @param string $objectManagerName - */ - protected function assertValidMappingConfiguration(array $mappingConfig, $objectManagerName) - { - if (!$mappingConfig['type'] || !$mappingConfig['dir'] || !$mappingConfig['prefix']) { - throw new \InvalidArgumentException(sprintf('Mapping definitions for Doctrine manager "%s" require at least the "type", "dir" and "prefix" options.', $objectManagerName)); - } - - if (!is_dir($mappingConfig['dir'])) { - throw new \InvalidArgumentException(sprintf('Specified non-existing directory "%s" as Doctrine mapping source.', $mappingConfig['dir'])); - } - - if (!in_array($mappingConfig['type'], array('xml', 'yml', 'annotation', 'php', 'staticphp'))) { - throw new \InvalidArgumentException(sprintf('Can only configure "xml", "yml", "annotation", "php" or '. - '"staticphp" through the DoctrineBundle. Use your own bundle to configure other metadata drivers. '. - 'You can register them by adding a a new driver to the '. - '"%s" service definition.', $this->getObjectManagerElementName($objectManagerName.'.metadata_driver') - )); - } - } - - /** - * Detects what metadata driver to use for the supplied directory. - * - * @param string $dir A directory path - * @param ContainerBuilder $container A ContainerBuilder instance - * - * @return string|null A metadata driver short name, if one can be detected - */ - protected function detectMetadataDriver($dir, ContainerBuilder $container) - { - // add the closest existing directory as a resource - $configPath = $this->getMappingResourceConfigDirectory(); - $resource = $dir.'/'.$configPath; - while (!is_dir($resource)) { - $resource = dirname($resource); - } - - $container->addResource(new FileResource($resource)); - - $extension = $this->getMappingResourceExtension(); - if (($files = glob($dir.'/'.$configPath.'/*.'.$extension.'.xml')) && count($files)) { - return 'xml'; - } elseif (($files = glob($dir.'/'.$configPath.'/*.'.$extension.'.yml')) && count($files)) { - return 'yml'; - } elseif (($files = glob($dir.'/'.$configPath.'/*.'.$extension.'.php')) && count($files)) { - return 'php'; - } - - // add the directory itself as a resource - $container->addResource(new FileResource($dir)); - - if (is_dir($dir.'/'.$this->getMappingObjectDefaultName())) { - return 'annotation'; - } - - return null; - } - - /** - * Loads a configured object manager metadata, query or result cache driver. - * - * @param array $objectManager A configured object manager. - * @param ContainerBuilder $container A ContainerBuilder instance. - * @param string $cacheName - * - * @throws \InvalidArgumentException In case of unknown driver type. - */ - protected function loadObjectManagerCacheDriver(array $objectManager, ContainerBuilder $container, $cacheName) - { - $cacheDriver = $objectManager[$cacheName.'_driver']; - $cacheDriverService = $this->getObjectManagerElementName($objectManager['name'] . '_' . $cacheName); - - switch ($cacheDriver['type']) { - case 'service': - $container->setAlias($cacheDriverService, new Alias($cacheDriver['id'], false)); - - return; - case 'memcache': - $memcacheClass = !empty($cacheDriver['class']) ? $cacheDriver['class'] : '%'.$this->getObjectManagerElementName('cache.memcache.class').'%'; - $memcacheInstanceClass = !empty($cacheDriver['instance_class']) ? $cacheDriver['instance_class'] : '%'.$this->getObjectManagerElementName('cache.memcache_instance.class').'%'; - $memcacheHost = !empty($cacheDriver['host']) ? $cacheDriver['host'] : '%'.$this->getObjectManagerElementName('cache.memcache_host').'%'; - $memcachePort = !empty($cacheDriver['port']) ? $cacheDriver['port'] : '%'.$this->getObjectManagerElementName('cache.memcache_port').'%'; - $cacheDef = new Definition($memcacheClass); - $memcacheInstance = new Definition($memcacheInstanceClass); - $memcacheInstance->addMethodCall('connect', array( - $memcacheHost, $memcachePort - )); - $container->setDefinition($this->getObjectManagerElementName(sprintf('%s_memcache_instance', $objectManager['name'])), $memcacheInstance); - $cacheDef->addMethodCall('setMemcache', array(new Reference($this->getObjectManagerElementName(sprintf('%s_memcache_instance', $objectManager['name']))))); - break; - case 'memcached': - $memcachedClass = !empty($cacheDriver['class']) ? $cacheDriver['class'] : '%'.$this->getObjectManagerElementName('cache.memcached.class').'%'; - $memcachedInstanceClass = !empty($cacheDriver['instance_class']) ? $cacheDriver['instance_class'] : '%'.$this->getObjectManagerElementName('cache.memcached_instance.class').'%'; - $memcachedHost = !empty($cacheDriver['host']) ? $cacheDriver['host'] : '%'.$this->getObjectManagerElementName('cache.memcached_host').'%'; - $memcachedPort = !empty($cacheDriver['port']) ? $cacheDriver['port'] : '%'.$this->getObjectManagerElementName('cache.memcached_port').'%'; - $cacheDef = new Definition($memcachedClass); - $memcachedInstance = new Definition($memcachedInstanceClass); - $memcachedInstance->addMethodCall('addServer', array( - $memcachedHost, $memcachedPort - )); - $container->setDefinition($this->getObjectManagerElementName(sprintf('%s_memcached_instance', $objectManager['name'])), $memcachedInstance); - $cacheDef->addMethodCall('setMemcached', array(new Reference($this->getObjectManagerElementName(sprintf('%s_memcached_instance', $objectManager['name']))))); - break; - case 'apc': - case 'array': - case 'xcache': - $cacheDef = new Definition('%'.$this->getObjectManagerElementName(sprintf('cache.%s.class', $cacheDriver['type'])).'%'); - break; - default: - throw new \InvalidArgumentException(sprintf('"%s" is an unrecognized Doctrine cache driver.', $cacheDriver['type'])); - } - - $cacheDef->setPublic(false); - // generate a unique namespace for the given application - $namespace = 'sf2'.$this->getMappingResourceExtension().'_'.$objectManager['name'].'_'.md5($container->getParameter('kernel.root_dir').$container->getParameter('kernel.environment')); - $cacheDef->addMethodCall('setNamespace', array($namespace)); - - $container->setDefinition($cacheDriverService, $cacheDef); - } - - /** - * Prefixes the relative dependency injection container path with the object manager prefix. - * - * @example $name is 'entity_manager' then the result would be 'doctrine.orm.entity_manager' - * - * @param string $name - * @return string - */ - abstract protected function getObjectManagerElementName($name); - - /** - * Noun that describes the mapped objects such as Entity or Document. - * - * Will be used for autodetection of persistent objects directory. - * - * @return string - */ - abstract protected function getMappingObjectDefaultName(); - - /** - * Relative path from the bundle root to the directory where mapping files reside. - * - * @return string - */ - abstract protected function getMappingResourceConfigDirectory(); - - /** - * Extension used by the mapping files. - * - * @return string - */ - abstract protected function getMappingResourceExtension(); -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php deleted file mode 100644 index 756b790..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\Config\Resource\FileResource; - -/** - * Registers additional validators - * - * @author Benjamin Eberlei - */ -class DoctrineValidationPass implements CompilerPassInterface -{ - /** - * @var string - */ - private $managerType; - - public function __construct($managerType) - { - $this->managerType = $managerType; - } - - /** - * {@inheritDoc} - */ - public function process(ContainerBuilder $container) - { - $this->updateValidatorMappingFiles($container, 'xml', 'xml'); - $this->updateValidatorMappingFiles($container, 'yaml', 'yml'); - } - - /** - * Gets the validation mapping files for the format and extends them with - * files matching a doctrine search pattern (Resources/config/validation.orm.xml) - * - * @param ContainerBuilder $container - * @param string $mapping - * @param type $extension - */ - private function updateValidatorMappingFiles(ContainerBuilder $container, $mapping, $extension) - { - if ( ! $container->hasParameter('validator.mapping.loader.' . $mapping . '_files_loader.mapping_files')) { - return; - } - - $files = $container->getParameter('validator.mapping.loader.' . $mapping . '_files_loader.mapping_files'); - $validationPath = 'Resources/config/validation.' . $this->managerType . '.' . $extension; - - foreach ($container->getParameter('kernel.bundles') as $bundle) { - $reflection = new \ReflectionClass($bundle); - if (is_file($file = dirname($reflection->getFilename()) . '/' . $validationPath)) { - $files[] = realpath($file); - $container->addResource(new FileResource($file)); - } - } - - $container->setParameter('validator.mapping.loader.' . $mapping . '_files_loader.mapping_files', $files); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php deleted file mode 100644 index d450e49..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php +++ /dev/null @@ -1,138 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Registers event listeners and subscribers to the available doctrine connections. - * - * @author Jeremy Mikola - * @author Alexander - */ -class RegisterEventListenersAndSubscribersPass implements CompilerPassInterface -{ - private $connections; - private $container; - private $eventManagers; - private $managerTemplate; - private $tagPrefix; - - /** - * Constructor. - * - * @param string $connections Parameter ID for connections - * @param string $managerTemplate sprintf() template for generating the event - * manager's service ID for a connection name - * @param string $tagPrefix Tag prefix for listeners and subscribers - */ - public function __construct($connections, $managerTemplate, $tagPrefix) - { - $this->connections = $connections; - $this->managerTemplate = $managerTemplate; - $this->tagPrefix = $tagPrefix; - } - - /** - * {@inheritDoc} - */ - public function process(ContainerBuilder $container) - { - if (!$container->hasParameter($this->connections)) { - return; - } - - $this->container = $container; - $this->connections = $container->getParameter($this->connections); - $sortFunc = function($a, $b) { - $a = isset($a['priority']) ? $a['priority'] : 0; - $b = isset($b['priority']) ? $b['priority'] : 0; - - return $a > $b ? -1 : 1; - }; - - $subscribersPerCon = $this->groupByConnection($container->findTaggedServiceIds($this->tagPrefix.'.event_subscriber')); - foreach ($subscribersPerCon as $con => $subscribers) { - $em = $this->getEventManager($con); - - uasort($subscribers, $sortFunc); - foreach ($subscribers as $id => $instance) { - $em->addMethodCall('addEventSubscriber', array(new Reference($id))); - } - } - - $listenersPerCon = $this->groupByConnection($container->findTaggedServiceIds($this->tagPrefix.'.event_listener'), true); - foreach ($listenersPerCon as $con => $listeners) { - $em = $this->getEventManager($con); - - uasort($listeners, $sortFunc); - foreach ($listeners as $id => $instance) { - $em->addMethodCall('addEventListener', array( - array_unique($instance['event']), - isset($instance['lazy']) && $instance['lazy'] ? $id : new Reference($id), - )); - } - } - } - - private function groupByConnection(array $services, $isListener = false) - { - $grouped = array(); - foreach ($allCons = array_keys($this->connections) as $con) { - $grouped[$con] = array(); - } - - foreach ($services as $id => $instances) { - foreach ($instances as $instance) { - if ($isListener) { - if (!isset($instance['event'])) { - throw new \InvalidArgumentException(sprintf('Doctrine event listener "%s" must specify the "event" attribute.', $id)); - } - $instance['event'] = array($instance['event']); - - if (isset($instance['lazy']) && $instance['lazy']) { - $this->container->getDefinition($id)->setPublic(true); - } - } - - $cons = isset($instance['connection']) ? array($instance['connection']) : $allCons; - foreach ($cons as $con) { - if (!isset($grouped[$con])) { - throw new \RuntimeException(sprintf('The Doctrine connection "%s" referenced in service "%s" does not exist. Available connections names: %s', $con, $id, implode(', ', array_keys($this->connections)))); - } - - if ($isListener && isset($grouped[$con][$id])) { - $grouped[$con][$id]['event'] = array_merge($grouped[$con][$id]['event'], $instance['event']); - } else { - $grouped[$con][$id] = $instance; - } - } - } - } - - return $grouped; - } - - private function getEventManager($name) - { - if (null === $this->eventManagers) { - $this->eventManagers = array(); - foreach ($this->connections as $n => $id) { - $this->eventManagers[$n] = $this->container->getDefinition(sprintf($this->managerTemplate, $n)); - } - } - - return $this->eventManagers[$name]; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/Security/UserProvider/EntityFactory.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/Security/UserProvider/EntityFactory.php deleted file mode 100644 index 421fd44..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/Security/UserProvider/EntityFactory.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\DependencyInjection\Security\UserProvider; - -use Symfony\Component\Config\Definition\Builder\NodeDefinition; - -use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\UserProviderFactoryInterface; -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * EntityFactory creates services for Doctrine user provider. - * - * @author Fabien Potencier - * @author Christophe Coevoet - */ -class EntityFactory implements UserProviderFactoryInterface -{ - private $key; - private $providerId; - - public function __construct($key, $providerId) - { - $this->key = $key; - $this->providerId = $providerId; - } - - public function create(ContainerBuilder $container, $id, $config) - { - $container - ->setDefinition($id, new DefinitionDecorator($this->providerId)) - ->addArgument($config['class']) - ->addArgument($config['property']) - ->addArgument($config['manager_name']) - ; - } - - public function getKey() - { - return $this->key; - } - - public function addConfiguration(NodeDefinition $node) - { - $node - ->children() - ->scalarNode('class')->isRequired()->cannotBeEmpty()->end() - ->scalarNode('property')->defaultNull()->end() - ->scalarNode('manager_name')->defaultNull()->end() - ->end() - ; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php deleted file mode 100644 index 6406bb1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php +++ /dev/null @@ -1,394 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Form\ChoiceList; - -use Symfony\Component\Form\Exception\FormException; -use Symfony\Component\Form\Exception\StringCastException; -use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList; -use Doctrine\Common\Persistence\ObjectManager; - -/** - * A choice list presenting a list of Doctrine entities as choices - * - * @author Bernhard Schussek - */ -class EntityChoiceList extends ObjectChoiceList -{ - /** - * @var ObjectManager - */ - private $em; - - /** - * @var string - */ - private $class; - - /** - * @var \Doctrine\Common\Persistence\Mapping\ClassMetadata - */ - private $classMetadata; - - /** - * Contains the query builder that builds the query for fetching the - * entities - * - * This property should only be accessed through queryBuilder. - * - * @var EntityLoaderInterface - */ - private $entityLoader; - - /** - * The identifier field, if the identifier is not composite - * - * @var array - */ - private $idField = null; - - /** - * Whether to use the identifier for index generation - * - * @var Boolean - */ - private $idAsIndex = false; - - /** - * Whether to use the identifier for value generation - * - * @var Boolean - */ - private $idAsValue = false; - - /** - * Whether the entities have already been loaded. - * - * @var Boolean - */ - private $loaded = false; - - /** - * Creates a new entity choice list. - * - * @param ObjectManager $manager An EntityManager instance - * @param string $class The class name - * @param string $labelPath The property path used for the label - * @param EntityLoaderInterface $entityLoader An optional query builder - * @param array $entities An array of choices - * @param string $groupPath A property path pointing to the property used - * to group the choices. Only allowed if - * the choices are given as flat array. - */ - public function __construct(ObjectManager $manager, $class, $labelPath = null, EntityLoaderInterface $entityLoader = null, $entities = null, $groupPath = null) - { - $this->em = $manager; - $this->entityLoader = $entityLoader; - $this->classMetadata = $manager->getClassMetadata($class); - $this->class = $this->classMetadata->getName(); - $this->loaded = is_array($entities) || $entities instanceof \Traversable; - - $identifier = $this->classMetadata->getIdentifierFieldNames(); - - if (1 === count($identifier)) { - $this->idField = $identifier[0]; - $this->idAsValue = true; - - if ('integer' === $this->classMetadata->getTypeOfField($this->idField)) { - $this->idAsIndex = true; - } - } - - if (!$this->loaded) { - // Make sure the constraints of the parent constructor are - // fulfilled - $entities = array(); - } - - parent::__construct($entities, $labelPath, array(), $groupPath); - } - - /** - * Returns the list of entities - * - * @return array - * - * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface - */ - public function getChoices() - { - if (!$this->loaded) { - $this->load(); - } - - return parent::getChoices(); - } - - /** - * Returns the values for the entities - * - * @return array - * - * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface - */ - public function getValues() - { - if (!$this->loaded) { - $this->load(); - } - - return parent::getValues(); - } - - /** - * Returns the choice views of the preferred choices as nested array with - * the choice groups as top-level keys. - * - * @return array - * - * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface - */ - public function getPreferredViews() - { - if (!$this->loaded) { - $this->load(); - } - - return parent::getPreferredViews(); - } - - /** - * Returns the choice views of the choices that are not preferred as nested - * array with the choice groups as top-level keys. - * - * @return array - * - * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface - */ - public function getRemainingViews() - { - if (!$this->loaded) { - $this->load(); - } - - return parent::getRemainingViews(); - } - - /** - * Returns the entities corresponding to the given values. - * - * @param array $values - * - * @return array - * - * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface - */ - public function getChoicesForValues(array $values) - { - if (!$this->loaded) { - // Optimize performance in case we have an entity loader and - // a single-field identifier - if ($this->idAsValue && $this->entityLoader) { - if (empty($values)) { - return array(); - } - - return $this->entityLoader->getEntitiesByIds($this->idField, $values); - } - - $this->load(); - } - - return parent::getChoicesForValues($values); - } - - /** - * Returns the values corresponding to the given entities. - * - * @param array $entities - * - * @return array - * - * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface - */ - public function getValuesForChoices(array $entities) - { - if (!$this->loaded) { - // Optimize performance for single-field identifiers. We already - // know that the IDs are used as values - - // Attention: This optimization does not check choices for existence - if ($this->idAsValue) { - $values = array(); - - foreach ($entities as $entity) { - if ($entity instanceof $this->class) { - // Make sure to convert to the right format - $values[] = $this->fixValue(current($this->getIdentifierValues($entity))); - } - } - - return $values; - } - - $this->load(); - } - - return parent::getValuesForChoices($entities); - } - - /** - * Returns the indices corresponding to the given entities. - * - * @param array $entities - * - * @return array - * - * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface - */ - public function getIndicesForChoices(array $entities) - { - if (!$this->loaded) { - // Optimize performance for single-field identifiers. We already - // know that the IDs are used as indices - - // Attention: This optimization does not check choices for existence - if ($this->idAsIndex) { - $indices = array(); - - foreach ($entities as $entity) { - if ($entity instanceof $this->class) { - // Make sure to convert to the right format - $indices[] = $this->fixIndex(current($this->getIdentifierValues($entity))); - } - } - - return $indices; - } - - $this->load(); - } - - return parent::getIndicesForChoices($entities); - } - - /** - * Returns the entities corresponding to the given values. - * - * @param array $values - * - * @return array - * - * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface - */ - public function getIndicesForValues(array $values) - { - if (!$this->loaded) { - // Optimize performance for single-field identifiers. - - // Attention: This optimization does not check values for existence - if ($this->idAsIndex && $this->idAsValue) { - return $this->fixIndices($values); - } - - $this->load(); - } - - return parent::getIndicesForValues($values); - } - - /** - * Creates a new unique index for this entity. - * - * If the entity has a single-field identifier, this identifier is used. - * - * Otherwise a new integer is generated. - * - * @param mixed $entity The choice to create an index for - * - * @return integer|string A unique index containing only ASCII letters, - * digits and underscores. - */ - protected function createIndex($entity) - { - if ($this->idAsIndex) { - return current($this->getIdentifierValues($entity)); - } - - return parent::createIndex($entity); - } - - /** - * Creates a new unique value for this entity. - * - * If the entity has a single-field identifier, this identifier is used. - * - * Otherwise a new integer is generated. - * - * @param mixed $entity The choice to create a value for - * - * @return integer|string A unique value without character limitations. - */ - protected function createValue($entity) - { - if ($this->idAsValue) { - return (string) current($this->getIdentifierValues($entity)); - } - - return parent::createValue($entity); - } - - /** - * Loads the list with entities. - */ - private function load() - { - if ($this->entityLoader) { - $entities = $this->entityLoader->getEntities(); - } else { - $entities = $this->em->getRepository($this->class)->findAll(); - } - - try { - // The second parameter $labels is ignored by ObjectChoiceList - // The third parameter $preferredChoices is currently not supported - parent::initialize($entities, array(), array()); - } catch (StringCastException $e) { - throw new StringCastException(str_replace('argument $labelPath', 'option "property"', $e->getMessage()), null, $e); - } - - $this->loaded = true; - } - - /** - * Returns the values of the identifier fields of an entity. - * - * Doctrine must know about this entity, that is, the entity must already - * be persisted or added to the identity map before. Otherwise an - * exception is thrown. - * - * @param object $entity The entity for which to get the identifier - * - * @return array The identifier values - * - * @throws FormException If the entity does not exist in Doctrine's identity map - */ - private function getIdentifierValues($entity) - { - if (!$this->em->contains($entity)) { - throw new FormException('Entities passed to the choice field must be managed'); - } - - $this->em->initializeObject($entity); - - return $this->classMetadata->getIdentifierValues($entity); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityLoaderInterface.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityLoaderInterface.php deleted file mode 100644 index 4f53986..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityLoaderInterface.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Form\ChoiceList; - -/** - * Custom loader for entities in the choice list. - * - * @author Benjamin Eberlei - */ -interface EntityLoaderInterface -{ - /** - * Returns an array of entities that are valid choices in the corresponding choice list. - * - * @return array The entities. - */ - public function getEntities(); - - /** - * Returns an array of entities matching the given identifiers. - * - * @param string $identifier The identifier field of the object. This method - * is not applicable for fields with multiple - * identifiers. - * @param array $values The values of the identifiers. - * - * @return array The entities. - */ - public function getEntitiesByIds($identifier, array $values); -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php deleted file mode 100644 index 5d9b5e2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php +++ /dev/null @@ -1,82 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Form\ChoiceList; - -use Symfony\Component\Form\Exception\UnexpectedTypeException; -use Doctrine\ORM\QueryBuilder; -use Doctrine\DBAL\Connection; - -/** - * Getting Entities through the ORM QueryBuilder - */ -class ORMQueryBuilderLoader implements EntityLoaderInterface -{ - /** - * Contains the query builder that builds the query for fetching the - * entities - * - * This property should only be accessed through queryBuilder. - * - * @var Doctrine\ORM\QueryBuilder - */ - private $queryBuilder; - - /** - * Construct an ORM Query Builder Loader - * - * @param QueryBuilder $queryBuilder - * @param EntityManager $manager - * @param string $class - */ - public function __construct($queryBuilder, $manager = null, $class = null) - { - // If a query builder was passed, it must be a closure or QueryBuilder - // instance - if (!($queryBuilder instanceof QueryBuilder || $queryBuilder instanceof \Closure)) { - throw new UnexpectedTypeException($queryBuilder, 'Doctrine\ORM\QueryBuilder or \Closure'); - } - - if ($queryBuilder instanceof \Closure) { - $queryBuilder = $queryBuilder($manager->getRepository($class)); - - if (!$queryBuilder instanceof QueryBuilder) { - throw new UnexpectedTypeException($queryBuilder, 'Doctrine\ORM\QueryBuilder'); - } - } - - $this->queryBuilder = $queryBuilder; - } - - /** - * {@inheritDoc} - */ - public function getEntities() - { - return $this->queryBuilder->getQuery()->execute(); - } - - /** - * {@inheritDoc} - */ - public function getEntitiesByIds($identifier, array $values) - { - $qb = clone ($this->queryBuilder); - $alias = current($qb->getRootAliases()); - $parameter = 'ORMQueryBuilderLoader_getEntitiesByIds_'.$identifier; - $where = $qb->expr()->in($alias.'.'.$identifier, ':'.$parameter); - - return $qb->andWhere($where) - ->getQuery() - ->setParameter($parameter, $values, Connection::PARAM_STR_ARRAY) - ->getResult(); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php deleted file mode 100644 index 2c1e7fe..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Form\DataTransformer; - -use Symfony\Component\Form\Exception\UnexpectedTypeException; -use Symfony\Component\Form\DataTransformerInterface; -use Doctrine\Common\Collections\Collection; -use Doctrine\Common\Collections\ArrayCollection; - -/** - * @author Bernhard Schussek - */ -class CollectionToArrayTransformer implements DataTransformerInterface -{ - /** - * Transforms a collection into an array. - * - * @param Collection $collection A collection of entities - * - * @return mixed An array of entities - */ - public function transform($collection) - { - if (null === $collection) { - return array(); - } - - if (!$collection instanceof Collection) { - throw new UnexpectedTypeException($collection, 'Doctrine\Common\Collections\Collection'); - } - - return $collection->toArray(); - } - - /** - * Transforms choice keys into entities. - * - * @param mixed $array An array of entities - * - * @return Collection A collection of entities - */ - public function reverseTransform($array) - { - if ('' === $array || null === $array) { - $array = array(); - } else { - $array = (array) $array; - } - - return new ArrayCollection($array); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmExtension.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmExtension.php deleted file mode 100644 index 7c9941c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmExtension.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Form; - -use Doctrine\Common\Persistence\ManagerRegistry; -use Symfony\Component\Form\AbstractExtension; - -class DoctrineOrmExtension extends AbstractExtension -{ - protected $registry; - - public function __construct(ManagerRegistry $registry) - { - $this->registry = $registry; - } - - protected function loadTypes() - { - return array( - new Type\EntityType($this->registry), - ); - } - - protected function loadTypeGuesser() - { - return new DoctrineOrmTypeGuesser($this->registry); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php deleted file mode 100644 index 0123d22..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php +++ /dev/null @@ -1,154 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Form; - -use Doctrine\Common\Persistence\ManagerRegistry; -use Doctrine\Common\Persistence\Mapping\MappingException; -use Doctrine\ORM\Mapping\MappingException as LegacyMappingException; -use Symfony\Component\Form\FormTypeGuesserInterface; -use Symfony\Component\Form\Guess\Guess; -use Symfony\Component\Form\Guess\TypeGuess; -use Symfony\Component\Form\Guess\ValueGuess; - -class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface -{ - protected $registry; - - private $cache; - - public function __construct(ManagerRegistry $registry) - { - $this->registry = $registry; - $this->cache = array(); - } - - /** - * {@inheritDoc} - */ - public function guessType($class, $property) - { - if (!$ret = $this->getMetadata($class)) { - return new TypeGuess('text', array(), Guess::LOW_CONFIDENCE); - } - - list($metadata, $name) = $ret; - - if ($metadata->hasAssociation($property)) { - $multiple = $metadata->isCollectionValuedAssociation($property); - $mapping = $metadata->getAssociationMapping($property); - - return new TypeGuess('entity', array('em' => $name, 'class' => $mapping['targetEntity'], 'multiple' => $multiple), Guess::HIGH_CONFIDENCE); - } - - switch ($metadata->getTypeOfField($property)) { - case 'array': - return new TypeGuess('collection', array(), Guess::MEDIUM_CONFIDENCE); - case 'boolean': - return new TypeGuess('checkbox', array(), Guess::HIGH_CONFIDENCE); - case 'datetime': - case 'vardatetime': - case 'datetimetz': - return new TypeGuess('datetime', array(), Guess::HIGH_CONFIDENCE); - case 'date': - return new TypeGuess('date', array(), Guess::HIGH_CONFIDENCE); - case 'time': - return new TypeGuess('time', array(), Guess::HIGH_CONFIDENCE); - case 'decimal': - case 'float': - return new TypeGuess('number', array(), Guess::MEDIUM_CONFIDENCE); - case 'integer': - case 'bigint': - case 'smallint': - return new TypeGuess('integer', array(), Guess::MEDIUM_CONFIDENCE); - case 'string': - return new TypeGuess('text', array(), Guess::MEDIUM_CONFIDENCE); - case 'text': - return new TypeGuess('textarea', array(), Guess::MEDIUM_CONFIDENCE); - default: - return new TypeGuess('text', array(), Guess::LOW_CONFIDENCE); - } - } - - /** - * {@inheritDoc} - */ - public function guessRequired($class, $property) - { - $ret = $this->getMetadata($class); - if ($ret && $ret[0]->hasField($property)) { - if (!$ret[0]->isNullable($property)) { - return new ValueGuess(true, Guess::HIGH_CONFIDENCE); - } - - return new ValueGuess(false, Guess::MEDIUM_CONFIDENCE); - } - } - - /** - * {@inheritDoc} - */ - public function guessMaxLength($class, $property) - { - $ret = $this->getMetadata($class); - if ($ret && $ret[0]->hasField($property) && !$ret[0]->hasAssociation($property)) { - $mapping = $ret[0]->getFieldMapping($property); - - if (isset($mapping['length'])) { - return new ValueGuess($mapping['length'], Guess::HIGH_CONFIDENCE); - } - - if (in_array($ret[0]->getTypeOfField($property), array('decimal', 'float'))) { - return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE); - } - } - } - - /** - * {@inheritDoc} - */ - public function guessMinLength($class, $property) - { - } - - /** - * {@inheritDoc} - */ - public function guessPattern($class, $property) - { - $ret = $this->getMetadata($class); - if ($ret && $ret[0]->hasField($property) && !$ret[0]->hasAssociation($property)) { - $mapping = $ret[0]->getFieldMapping($property); - - if (in_array($ret[0]->getTypeOfField($property), array('decimal', 'float'))) { - return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE); - } - } - } - - protected function getMetadata($class) - { - if (array_key_exists($class, $this->cache)) { - return $this->cache[$class]; - } - - $this->cache[$class] = null; - foreach ($this->registry->getManagers() as $name => $em) { - try { - return $this->cache[$class] = array($em->getClassMetadata($class), $name); - } catch (MappingException $e) { - // not an entity or mapped super class - } catch (LegacyMappingException $e) { - // not an entity or mapped super class, using Doctrine ORM 2.2 - } - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php deleted file mode 100644 index 7b7f580..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Form\EventListener; - -use Symfony\Component\Form\FormEvents; -use Symfony\Component\Form\FormEvent; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -/** - * Merge changes from the request to a Doctrine\Common\Collections\Collection instance. - * - * This works with ORM, MongoDB and CouchDB instances of the collection interface. - * - * @author Bernhard Schussek - * - * @see Doctrine\Common\Collections\Collection - */ -class MergeDoctrineCollectionListener implements EventSubscriberInterface -{ - public static function getSubscribedEvents() - { - // Higher priority than core MergeCollectionListener so that this one - // is called before - return array(FormEvents::BIND => array('onBind', 10)); - } - - public function onBind(FormEvent $event) - { - $collection = $event->getForm()->getData(); - $data = $event->getData(); - - // If all items were removed, call clear which has a higher - // performance on persistent collections - if ($collection && count($data) === 0) { - $collection->clear(); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php deleted file mode 100644 index 48cbdda..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php +++ /dev/null @@ -1,156 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Form\Type; - -use Doctrine\Common\Persistence\ManagerRegistry; -use Doctrine\Common\Persistence\ObjectManager; -use Symfony\Component\Form\FormBuilderInterface; -use Symfony\Bridge\Doctrine\Form\ChoiceList\EntityChoiceList; -use Symfony\Bridge\Doctrine\Form\ChoiceList\EntityLoaderInterface; -use Symfony\Bridge\Doctrine\Form\EventListener\MergeDoctrineCollectionListener; -use Symfony\Bridge\Doctrine\Form\DataTransformer\CollectionToArrayTransformer; -use Symfony\Component\Form\AbstractType; -use Symfony\Component\OptionsResolver\Options; -use Symfony\Component\OptionsResolver\OptionsResolverInterface; - -abstract class DoctrineType extends AbstractType -{ - /** - * @var ManagerRegistry - */ - protected $registry; - - /** - * @var array - */ - private $choiceListCache = array(); - - public function __construct(ManagerRegistry $registry) - { - $this->registry = $registry; - } - - public function buildForm(FormBuilderInterface $builder, array $options) - { - if ($options['multiple']) { - $builder - ->addEventSubscriber(new MergeDoctrineCollectionListener()) - ->addViewTransformer(new CollectionToArrayTransformer(), true) - ; - } - } - - public function setDefaultOptions(OptionsResolverInterface $resolver) - { - $choiceListCache =& $this->choiceListCache; - $registry = $this->registry; - $type = $this; - - $loader = function (Options $options) use ($type) { - if (null !== $options['query_builder']) { - return $type->getLoader($options['em'], $options['query_builder'], $options['class']); - } - - return null; - }; - - $choiceList = function (Options $options) use (&$choiceListCache, &$time) { - // Support for closures - $propertyHash = is_object($options['property']) - ? spl_object_hash($options['property']) - : $options['property']; - - $choiceHashes = $options['choices']; - - // Support for recursive arrays - if (is_array($choiceHashes)) { - // A second parameter ($key) is passed, so we cannot use - // spl_object_hash() directly (which strictly requires - // one parameter) - array_walk_recursive($choiceHashes, function ($value) { - return spl_object_hash($value); - }); - } - - // Support for custom loaders (with query builders) - $loaderHash = is_object($options['loader']) - ? spl_object_hash($options['loader']) - : $options['loader']; - - // Support for closures - $groupByHash = is_object($options['group_by']) - ? spl_object_hash($options['group_by']) - : $options['group_by']; - - $hash = md5(json_encode(array( - spl_object_hash($options['em']), - $options['class'], - $propertyHash, - $loaderHash, - $choiceHashes, - $groupByHash - ))); - - if (!isset($choiceListCache[$hash])) { - $choiceListCache[$hash] = new EntityChoiceList( - $options['em'], - $options['class'], - $options['property'], - $options['loader'], - $options['choices'], - $options['group_by'] - ); - } - - return $choiceListCache[$hash]; - }; - - $emNormalizer = function (Options $options, $em) use ($registry) { - /* @var ManagerRegistry $registry */ - if (null !== $em) { - return $registry->getManager($em); - } - - return $registry->getManagerForClass($options['class']); - }; - - $resolver->setDefaults(array( - 'em' => null, - 'class' => null, - 'property' => null, - 'query_builder' => null, - 'loader' => $loader, - 'choices' => null, - 'choice_list' => $choiceList, - 'group_by' => null, - )); - - $resolver->setNormalizers(array( - 'em' => $emNormalizer, - )); - } - - /** - * Return the default loader object. - * - * @param ObjectManager $manager - * @param mixed $queryBuilder - * @param string $class - * @return EntityLoaderInterface - */ - abstract public function getLoader(ObjectManager $manager, $queryBuilder, $class); - - public function getParent() - { - return 'choice'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php deleted file mode 100644 index 51b47be..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Form\Type; - -use Doctrine\Common\Persistence\ObjectManager; -use Symfony\Bridge\Doctrine\Form\ChoiceList\ORMQueryBuilderLoader; - -class EntityType extends DoctrineType -{ - /** - * Return the default loader object. - * - * @param ObjectManager $manager - * @param mixed $queryBuilder - * @param string $class - * @return ORMQueryBuilderLoader - */ - public function getLoader(ObjectManager $manager, $queryBuilder, $class) - { - return new ORMQueryBuilderLoader( - $queryBuilder, - $manager, - $class - ); - } - - public function getName() - { - return 'entity'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandler.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandler.php deleted file mode 100644 index 9a41efb..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandler.php +++ /dev/null @@ -1,172 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\HttpFoundation; - -use Doctrine\DBAL\Platforms\MySqlPlatform; -use Doctrine\DBAL\Driver\Connection; - -/** - * DBAL based session storage. - * - * @author Fabien Potencier - * @author Johannes M. Schmitt - */ -class DbalSessionHandler implements \SessionHandlerInterface -{ - /** - * @var Connection - */ - private $con; - - /** - * @var string - */ - private $tableName; - - /** - * Constructor. - * - * @param Connection $con An instance of Connection. - * @param string $tableName Table name. - */ - public function __construct(Connection $con, $tableName = 'sessions') - { - $this->con = $con; - $this->tableName = $tableName; - } - - /** - * {@inheritdoc} - */ - public function open($path = null, $name = null) - { - return true; - } - - /** - * {@inheritdoc} - */ - public function close() - { - // do nothing - return true; - } - - /** - * {@inheritdoc} - */ - public function destroy($id) - { - try { - $this->con->executeQuery("DELETE FROM {$this->tableName} WHERE sess_id = :id", array( - 'id' => $id, - )); - } catch (\PDOException $e) { - throw new \RuntimeException(sprintf('PDOException was thrown when trying to manipulate session data: %s', $e->getMessage()), 0, $e); - } - - return true; - } - - /** - * {@inheritdoc} - */ - public function gc($lifetime) - { - try { - $this->con->executeQuery("DELETE FROM {$this->tableName} WHERE sess_time < :time", array( - 'time' => time() - $lifetime, - )); - } catch (\PDOException $e) { - throw new \RuntimeException(sprintf('PDOException was thrown when trying to manipulate session data: %s', $e->getMessage()), 0, $e); - } - - return true; - } - - /** - * {@inheritdoc} - */ - public function read($id) - { - try { - $data = $this->con->executeQuery("SELECT sess_data FROM {$this->tableName} WHERE sess_id = :id", array( - 'id' => $id, - ))->fetchColumn(); - - if (false !== $data) { - return base64_decode($data); - } - - // session does not exist, create it - $this->createNewSession($id); - - return ''; - } catch (\PDOException $e) { - throw new \RuntimeException(sprintf('PDOException was thrown when trying to read the session data: %s', $e->getMessage()), 0, $e); - } - } - - /** - * {@inheritdoc} - */ - public function write($id, $data) - { - $platform = $this->con->getDatabasePlatform(); - - // this should maybe be abstracted in Doctrine DBAL - if ($platform instanceof MySqlPlatform) { - $sql = "INSERT INTO {$this->tableName} (sess_id, sess_data, sess_time) VALUES (%1\$s, %2\$s, %3\$d) " - ."ON DUPLICATE KEY UPDATE sess_data = VALUES(sess_data), sess_time = CASE WHEN sess_time = %3\$d THEN (VALUES(sess_time) + 1) ELSE VALUES(sess_time) END"; - } else { - $sql = "UPDATE {$this->tableName} SET sess_data = %2\$s, sess_time = %3\$d WHERE sess_id = %1\$s"; - } - - try { - $rowCount = $this->con->exec(sprintf( - $sql, - $this->con->quote($id), - //session data can contain non binary safe characters so we need to encode it - $this->con->quote(base64_encode($data)), - time() - )); - - if (!$rowCount) { - // No session exists in the database to update. This happens when we have called - // session_regenerate_id() - $this->createNewSession($id, $data); - } - } catch (\PDOException $e) { - throw new \RuntimeException(sprintf('PDOException was thrown when trying to write the session data: %s', $e->getMessage()), 0, $e); - } - - return true; - } - - /** - * Creates a new session with the given $id and $data - * - * @param string $id - * @param string $data - */ - private function createNewSession($id, $data = '') - { - $this->con->exec(sprintf("INSERT INTO {$this->tableName} (sess_id, sess_data, sess_time) VALUES (%s, %s, %d)", - $this->con->quote($id), - //session data can contain non binary safe characters so we need to encode it - $this->con->quote(base64_encode($data)), - time() - )); - - return true; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandlerSchema.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandlerSchema.php deleted file mode 100644 index b7b4b91..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandlerSchema.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\HttpFoundation; - -use Doctrine\DBAL\Schema\Schema; - -/** - * DBAL Session Storage Schema. - * - * @author Johannes M. Schmitt - */ -final class DbalSessionHandlerSchema extends Schema -{ - private $tableName; - - public function __construct($tableName = 'sessions') - { - parent::__construct(); - - $this->tableName = $tableName; - $this->addSessionTable(); - } - - public function addToSchema(Schema $schema) - { - foreach ($this->getTables() as $table) { - $schema->_addTable($table); - } - } - - private function addSessionTable() - { - $table = $this->createTable($this->tableName); - $table->addColumn('sess_id', 'string'); - $table->addColumn('sess_data', 'text')->setNotNull(true); - $table->addColumn('sess_time', 'integer')->setNotNull(true)->setUnsigned(true); - $table->setPrimaryKey(array('sess_id')); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/LICENSE b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/LICENSE deleted file mode 100644 index cdffe7a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2012 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php deleted file mode 100644 index 066ff8a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Logger; - -use Symfony\Component\HttpKernel\Log\LoggerInterface; -use Symfony\Component\HttpKernel\Debug\Stopwatch; -use Doctrine\DBAL\Logging\SQLLogger; - -/** - * DbalLogger. - * - * @author Fabien Potencier - */ -class DbalLogger implements SQLLogger -{ - protected $logger; - protected $stopwatch; - - /** - * Constructor. - * - * @param LoggerInterface $logger A LoggerInterface instance - * @param Stopwatch $stopwatch A Stopwatch instance - */ - public function __construct(LoggerInterface $logger = null, Stopwatch $stopwatch = null) - { - $this->logger = $logger; - $this->stopwatch = $stopwatch; - } - - /** - * {@inheritdoc} - */ - public function startQuery($sql, array $params = null, array $types = null) - { - if (null !== $this->stopwatch) { - $this->stopwatch->start('doctrine', 'doctrine'); - } - - if (null !== $this->logger) { - $this->log($sql.' ('.json_encode($params).')'); - } - } - - /** - * {@inheritdoc} - */ - public function stopQuery() - { - if (null !== $this->stopwatch) { - $this->stopwatch->stop('doctrine'); - } - } - - /** - * Logs a message. - * - * @param string $message A message to log - */ - public function log($message) - { - $this->logger->debug($message); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/ManagerRegistry.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/ManagerRegistry.php deleted file mode 100644 index 80eeb37..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/ManagerRegistry.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine; - -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Doctrine\Common\Persistence\AbstractManagerRegistry; - -/** - * References Doctrine connections and entity/document managers. - * - * @author Lukas Kahwe Smith - */ -abstract class ManagerRegistry extends AbstractManagerRegistry implements ContainerAwareInterface -{ - /** - * @var ContainerInterface - */ - protected $container; - - /** - * @inheritdoc - */ - protected function getService($name) - { - return $this->container->get($name); - } - - /** - * @inheritdoc - */ - protected function resetService($name) - { - $this->container->set($name, null); - } - - /** - * @inheritdoc - */ - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/README.md b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/README.md deleted file mode 100644 index 211eb7f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/README.md +++ /dev/null @@ -1,28 +0,0 @@ -Doctrine Bridge -=============== - -Provides integration for [Doctrine](http://www.doctrine-project.org/) with -various Symfony2 components. - -Resources ---------- - -You can run the unit tests with the following command: - - phpunit -c src/Symfony/Bridge/Doctrine/ - -If you also want to run the unit tests that depend on other Symfony -Components, declare the following environment variables before running -PHPUnit: - - export DOCTRINE_COMMON=../path/to/doctrine-common - export DOCTRINE_DBAL=../path/to/doctrine-dbal - export DOCTRINE_ORM=../path/to/doctrine - export DOCTRINE_FIXTURES=../path/to/doctrine-fixtures - export SYMFONY_HTTP_FOUNDATION=../path/to/HttpFoundation - export SYMFONY_DEPENDENCY_INJECTION=../path/to/DependencyInjection - export SYMFONY_FORM=../path/to/Form - export SYMFONY_SECURITY=../path/to/Security - export SYMFONY_VALIDATOR=../path/to/Validator - export SYMFONY_HTTP_KERNEL=../path/to/HttpKernel - export SYMFONY_EVENT_DISPATCHER=../path/to/EventDispatcher diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/RegistryInterface.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/RegistryInterface.php deleted file mode 100644 index dbba073..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/RegistryInterface.php +++ /dev/null @@ -1,94 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine; - -use Doctrine\Common\Persistence\ManagerRegistry as ManagerRegistryInterface; -use Doctrine\ORM\Configuration; - -/** - * References Doctrine connections and entity managers. - * - * @author Fabien Potencier - */ -interface RegistryInterface extends ManagerRegistryInterface -{ - /** - * Gets the default entity manager name. - * - * @return string The default entity manager name - */ - public function getDefaultEntityManagerName(); - - /** - * Gets a named entity manager. - * - * @param string $name The entity manager name (null for the default one) - * - * @return EntityManager - */ - public function getEntityManager($name = null); - - /** - * Gets an array of all registered entity managers - * - * @return array An array of EntityManager instances - */ - public function getEntityManagers(); - - /** - * Resets a named entity manager. - * - * This method is useful when an entity manager has been closed - * because of a rollbacked transaction AND when you think that - * it makes sense to get a new one to replace the closed one. - * - * Be warned that you will get a brand new entity manager as - * the existing one is not useable anymore. This means that any - * other object with a dependency on this entity manager will - * hold an obsolete reference. You can inject the registry instead - * to avoid this problem. - * - * @param string $name The entity manager name (null for the default one) - * - * @return EntityManager - */ - public function resetEntityManager($name = null); - - /** - * Resolves a registered namespace alias to the full namespace. - * - * This method looks for the alias in all registered entity managers. - * - * @param string $alias The alias - * - * @return string The full namespace - * - * @see Configuration::getEntityNamespace - */ - public function getEntityNamespace($alias); - - /** - * Gets all connection names. - * - * @return array An array of connection names - */ - public function getEntityManagerNames(); - - /** - * Gets the entity manager associated with a given class. - * - * @param string $class A Doctrine Entity class name - * - * @return EntityManager|null - */ - public function getEntityManagerForClass($class); -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php deleted file mode 100644 index 487b1d6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Security\User; - -use Doctrine\Common\Persistence\ManagerRegistry; -use Symfony\Component\Security\Core\Exception\UnsupportedUserException; -use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; -use Symfony\Component\Security\Core\User\UserProviderInterface; -use Symfony\Component\Security\Core\User\UserInterface; - -/** - * Wrapper around a Doctrine ObjectManager. - * - * Provides easy to use provisioning for Doctrine entity users. - * - * @author Fabien Potencier - * @author Johannes M. Schmitt - */ -class EntityUserProvider implements UserProviderInterface -{ - private $class; - private $repository; - private $property; - private $metadata; - - public function __construct(ManagerRegistry $registry, $class, $property = null, $managerName = null) - { - $em = $registry->getManager($managerName); - $this->class = $class; - $this->metadata = $em->getClassMetadata($class); - - if (false !== strpos($this->class, ':')) { - $this->class = $this->metadata->getName(); - } - - $this->repository = $em->getRepository($class); - $this->property = $property; - } - - /** - * {@inheritdoc} - */ - public function loadUserByUsername($username) - { - if (null !== $this->property) { - $user = $this->repository->findOneBy(array($this->property => $username)); - } else { - if (!$this->repository instanceof UserProviderInterface) { - throw new \InvalidArgumentException(sprintf('The Doctrine repository "%s" must implement UserProviderInterface.', get_class($this->repository))); - } - - $user = $this->repository->loadUserByUsername($username); - } - - if (null === $user) { - throw new UsernameNotFoundException(sprintf('User "%s" not found.', $username)); - } - - return $user; - } - - /** - * {@inheritDoc} - */ - public function refreshUser(UserInterface $user) - { - if (!$user instanceof $this->class) { - throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', get_class($user))); - } - - if ($this->repository instanceof UserProviderInterface) { - $refreshedUser = $this->repository->refreshUser($user); - } else { - // The user must be reloaded via the primary key as all other data - // might have changed without proper persistence in the database. - // That's the case when the user has been changed by a form with - // validation errors. - if (!$id = $this->metadata->getIdentifierValues($user)) { - throw new \InvalidArgumentException("You cannot refresh a user ". - "from the EntityUserProvider that does not contain an identifier. ". - "The user object has to be serialized with its own identifier " . - "mapped by Doctrine." - ); - } - - if (null === $refreshedUser = $this->repository->find($id)) { - throw new UsernameNotFoundException(sprintf('User with id %s not found', json_encode($id))); - } - } - - return $refreshedUser; - } - - /** - * {@inheritDoc} - */ - public function supportsClass($class) - { - return $class === $this->class || is_subclass_of($class, $this->class); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php deleted file mode 100644 index b5985ca..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests; - -use Symfony\Bridge\Doctrine\ContainerAwareEventManager; -use Symfony\Component\DependencyInjection\Container; - -class ContainerAwareEventManagerTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!class_exists('Symfony\Component\DependencyInjection\Container')) { - $this->markTestSkipped('The "DependencyInjection" component is not available'); - } - - $this->container = new Container(); - $this->evm = new ContainerAwareEventManager($this->container); - } - - public function testDispatchEvent() - { - $this->container->set('foobar', $listener1 = new MyListener()); - $this->evm->addEventListener('foo', 'foobar'); - $this->evm->addEventListener('foo', $listener2 = new MyListener()); - - $this->evm->dispatchEvent('foo'); - - $this->assertTrue($listener1->called); - $this->assertTrue($listener2->called); - } - - public function testRemoveEventListener() - { - $this->evm->addEventListener('foo', 'bar'); - $this->evm->addEventListener('foo', $listener = new MyListener()); - - $listeners = array('foo' => array('_service_bar' => 'bar', spl_object_hash($listener) => $listener)); - $this->assertSame($listeners, $this->evm->getListeners()); - $this->assertSame($listeners['foo'], $this->evm->getListeners('foo')); - - $this->evm->removeEventListener('foo', $listener); - $this->assertSame(array('_service_bar' => 'bar'), $this->evm->getListeners('foo')); - - $this->evm->removeEventListener('foo', 'bar'); - $this->assertSame(array(), $this->evm->getListeners('foo')); - } -} - -class MyListener -{ - public $called = false; - - public function foo() - { - $this->called = true; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php deleted file mode 100644 index 0679356..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php +++ /dev/null @@ -1,158 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests\DataCollector; - -use Doctrine\DBAL\Platforms\MySqlPlatform; -use Symfony\Bridge\Doctrine\DataCollector\DoctrineDataCollector; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; - -class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!class_exists('Doctrine\DBAL\Platforms\MySqlPlatform')) { - $this->markTestSkipped('Doctrine DBAL is not available.'); - } - - if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) { - $this->markTestSkipped('The "HttpKernel" component is not available'); - } - } - - public function testCollectConnections() - { - $c = $this->createCollector(array()); - $c->collect(new Request(), new Response()); - $this->assertEquals(array('default' => 'doctrine.dbal.default_connection'), $c->getConnections()); - } - - public function testCollectManagers() - { - $c = $this->createCollector(array()); - $c->collect(new Request(), new Response()); - $this->assertEquals(array('default' => 'doctrine.orm.default_entity_manager'), $c->getManagers()); - } - - public function testCollectQueryCount() - { - $c = $this->createCollector(array()); - $c->collect(new Request(), new Response()); - $this->assertEquals(0, $c->getQueryCount()); - - $queries = array( - array('sql' => "SELECT * FROM table1", 'params' => array(), 'types' => array(), 'executionMS' => 0) - ); - $c = $this->createCollector($queries); - $c->collect(new Request(), new Response()); - $this->assertEquals(1, $c->getQueryCount()); - } - - public function testCollectTime() - { - $c = $this->createCollector(array()); - $c->collect(new Request(), new Response()); - $this->assertEquals(0, $c->getTime()); - - $queries = array( - array('sql' => "SELECT * FROM table1", 'params' => array(), 'types' => array(), 'executionMS' => 1) - ); - $c = $this->createCollector($queries); - $c->collect(new Request(), new Response()); - $this->assertEquals(1, $c->getTime()); - - $queries = array( - array('sql' => "SELECT * FROM table1", 'params' => array(), 'types' => array(), 'executionMS' => 1), - array('sql' => "SELECT * FROM table2", 'params' => array(), 'types' => array(), 'executionMS' => 2) - ); - $c = $this->createCollector($queries); - $c->collect(new Request(), new Response()); - $this->assertEquals(3, $c->getTime()); - } - - /** - * @dataProvider paramProvider - */ - public function testCollectQueries($param, $types, $expected, $explainable) - { - $queries = array( - array('sql' => "SELECT * FROM table1 WHERE field1 = ?1", 'params' => array($param), 'types' => $types, 'executionMS' => 1) - ); - $c = $this->createCollector($queries); - $c->collect(new Request(), new Response()); - - $collected_queries = $c->getQueries(); - $this->assertEquals($expected, $collected_queries['default'][0]['params'][0]); - $this->assertEquals($explainable, $collected_queries['default'][0]['explainable']); - } - - /** - * @dataProvider paramProvider - */ - public function testSerialization($param, $types, $expected, $explainable) - { - $queries = array( - array('sql' => "SELECT * FROM table1 WHERE field1 = ?1", 'params' => array($param), 'types' => $types, 'executionMS' => 1) - ); - $c = $this->createCollector($queries); - $c->collect(new Request(), new Response()); - $c = unserialize(serialize($c)); - - $collected_queries = $c->getQueries(); - $this->assertEquals($expected, $collected_queries['default'][0]['params'][0]); - $this->assertEquals($explainable, $collected_queries['default'][0]['explainable']); - } - - public function paramProvider() - { - return array( - array('some value', array(), 'some value', true), - array(1, array(), 1, true), - array(true, array(), true, true), - array(null, array(), null, true), - array(new \DateTime('2011-09-11'), array('date'), '2011-09-11', true), - array(fopen(__FILE__, 'r'), array(), 'Resource(stream)', false), - array(new \SplFileInfo(__FILE__), array(), 'Object(SplFileInfo)', false), - ); - } - - private function createCollector($queries) - { - $connection = $this->getMockBuilder('Doctrine\DBAL\Connection') - ->disableOriginalConstructor() - ->getMock(); - $connection->expects($this->any()) - ->method('getDatabasePlatform') - ->will($this->returnValue(new MySqlPlatform())); - - $registry = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry'); - $registry - ->expects($this->any()) - ->method('getConnectionNames') - ->will($this->returnValue(array('default' => 'doctrine.dbal.default_connection'))); - $registry - ->expects($this->any()) - ->method('getManagerNames') - ->will($this->returnValue(array('default' => 'doctrine.orm.default_entity_manager'))); - $registry->expects($this->any()) - ->method('getConnection') - ->will($this->returnValue($connection)); - - $logger = $this->getMock('Doctrine\DBAL\Logging\DebugStack'); - $logger->queries = $queries; - - $collector = new DoctrineDataCollector($registry); - $collector->addLogger('default', $logger); - - return $collector; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/DataFixtures/ContainerAwareLoaderTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/DataFixtures/ContainerAwareLoaderTest.php deleted file mode 100644 index 52d653b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/DataFixtures/ContainerAwareLoaderTest.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests\DataFixtures; - -use Symfony\Bridge\Doctrine\DataFixtures\ContainerAwareLoader; -use Symfony\Bridge\Doctrine\Tests\Fixtures\ContainerAwareFixture; - -class ContainerAwareLoaderTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!class_exists('Symfony\Component\DependencyInjection\Container')) { - $this->markTestSkipped('The "DependencyInjection" component is not available'); - } - - if (!class_exists('Doctrine\Common\DataFixtures\Loader')) { - $this->markTestSkipped('Doctrine Data Fixtures is not available.'); - } - } - - public function testShouldSetContainerOnContainerAwareFixture() - { - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - $loader = new ContainerAwareLoader($container); - $fixture = new ContainerAwareFixture(); - - $loader->addFixture($fixture); - - $this->assertSame($container, $fixture->container); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php deleted file mode 100644 index e679aaf..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php +++ /dev/null @@ -1,157 +0,0 @@ - -* -* For the full copyright and license information, please view the LICENSE -* file that was distributed with this source code. -*/ - -namespace Symfony\Bridge\Doctrine\Tests\DependencyInjection\Compiler; - -use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterEventListenersAndSubscribersPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class RegisterEventListenersAndSubscribersPassTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!class_exists('Symfony\Component\DependencyInjection\Container')) { - $this->markTestSkipped('The "DependencyInjection" component is not available'); - } - } - - public function testProcessEventListenersWithPriorities() - { - $container = $this->createBuilder(); - - $container - ->register('a', 'stdClass') - ->addTag('doctrine.event_listener', array( - 'event' => 'foo', - 'priority' => -5, - )) - ->addTag('doctrine.event_listener', array( - 'event' => 'bar', - )) - ; - $container - ->register('b', 'stdClass') - ->addTag('doctrine.event_listener', array( - 'event' => 'foo', - )) - ; - - $this->process($container); - $this->assertEquals(array('b', 'a'), $this->getServiceOrder($container, 'addEventListener')); - - $calls = $container->getDefinition('doctrine.dbal.default_connection.event_manager')->getMethodCalls(); - $this->assertEquals(array('foo', 'bar'), $calls[1][1][0]); - } - - public function testProcessEventListenersWithMultipleConnections() - { - $container = $this->createBuilder(true); - - $container - ->register('a', 'stdClass') - ->addTag('doctrine.event_listener', array( - 'event' => 'onFlush', - )) - ; - $this->process($container); - - $callsDefault = $container->getDefinition('doctrine.dbal.default_connection.event_manager')->getMethodCalls(); - - $this->assertEquals('addEventListener', $callsDefault[0][0]); - $this->assertEquals(array('onFlush'), $callsDefault[0][1][0]); - - $callsSecond = $container->getDefinition('doctrine.dbal.second_connection.event_manager')->getMethodCalls(); - $this->assertEquals($callsDefault, $callsSecond); - } - - public function testProcessEventSubscribersWithPriorities() - { - $container = $this->createBuilder(); - - $container - ->register('a', 'stdClass') - ->addTag('doctrine.event_subscriber') - ; - $container - ->register('b', 'stdClass') - ->addTag('doctrine.event_subscriber', array( - 'priority' => 5, - )) - ; - $container - ->register('c', 'stdClass') - ->addTag('doctrine.event_subscriber', array( - 'priority' => 10, - )) - ; - $container - ->register('d', 'stdClass') - ->addTag('doctrine.event_subscriber', array( - 'priority' => 10, - )) - ; - $container - ->register('e', 'stdClass') - ->addTag('doctrine.event_subscriber', array( - 'priority' => 10, - )) - ; - - $this->process($container); - $this->assertEquals(array('c', 'd', 'e', 'b', 'a'), $this->getServiceOrder($container, 'addEventSubscriber')); - } - - private function process(ContainerBuilder $container) - { - $pass = new RegisterEventListenersAndSubscribersPass('doctrine.connections', 'doctrine.dbal.%s_connection.event_manager', 'doctrine'); - $pass->process($container); - } - - private function getServiceOrder(ContainerBuilder $container, $method) - { - $order = array(); - foreach ($container->getDefinition('doctrine.dbal.default_connection.event_manager')->getMethodCalls() as $call) { - list($name, $arguments) = $call; - if ($method !== $name) { - continue; - } - - if ('addEventListener' === $name) { - $order[] = (string) $arguments[1]; - continue; - } - - $order[] = (string) $arguments[0]; - } - - return $order; - } - - private function createBuilder($multipleConnections = false) - { - $container = new ContainerBuilder(); - - $connections = array('default' => 'doctrine.dbal.default_connection'); - - $container->register('doctrine.dbal.default_connection.event_manager', 'stdClass'); - $container->register('doctrine.dbal.default_connection', 'stdClass'); - - if ($multipleConnections) { - $container->register('doctrine.dbal.second_connection.event_manager', 'stdClass'); - $container->register('doctrine.dbal.second_connection', 'stdClass'); - $connections['second'] = 'doctrine.dbal.second_connection'; - } - - $container->setParameter('doctrine.connections', $connections); - - return $container; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php deleted file mode 100644 index 005c807..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests; - -use Doctrine\Common\Annotations\AnnotationReader; -use Doctrine\ORM\Mapping\Driver\AnnotationDriver; -use Doctrine\ORM\EntityManager; - -abstract class DoctrineOrmTestCase extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!class_exists('Doctrine\Common\Version')) { - $this->markTestSkipped('Doctrine Common is not available.'); - } - - if (!class_exists('Doctrine\DBAL\Platforms\MySqlPlatform')) { - $this->markTestSkipped('Doctrine DBAL is not available.'); - } - - if (!class_exists('Doctrine\ORM\EntityManager')) { - $this->markTestSkipped('Doctrine ORM is not available.'); - } - } - - /** - * @return EntityManager - */ - public static function createTestEntityManager($paths = array()) - { - if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) { - self::markTestSkipped('This test requires SQLite support in your environment'); - } - $config = new \Doctrine\ORM\Configuration(); - $config->setEntityNamespaces(array('SymfonyTestsDoctrine' => 'Symfony\Bridge\Doctrine\Tests\Fixtures')); - $config->setAutoGenerateProxyClasses(true); - $config->setProxyDir(\sys_get_temp_dir()); - $config->setProxyNamespace('SymfonyTests\Doctrine'); - $config->setMetadataDriverImpl(new AnnotationDriver(new AnnotationReader())); - $config->setQueryCacheImpl(new \Doctrine\Common\Cache\ArrayCache()); - $config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache()); - - $params = array( - 'driver' => 'pdo_sqlite', - 'memory' => true, - ); - - return EntityManager::create($params, $config); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/AssociationEntity.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/AssociationEntity.php deleted file mode 100644 index 0fe3d14..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/AssociationEntity.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests\Fixtures; - -use Doctrine\ORM\Mapping AS ORM; - -/** - * @ORM\Entity - */ -class AssociationEntity -{ - /** - * @var int - * @ORM\Id @ORM\GeneratedValue - * @ORM\Column(type="integer") - */ - private $id; - - /** - * @ORM\ManyToOne(targetEntity="SingleIdentEntity") - * @var \Symfony\Bridge\Doctrine\Tests\Form\Fixtures\SingleIdentEntity - */ - public $single; - - /** - * @ORM\ManyToOne(targetEntity="CompositeIdentEntity") - * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="composite_id1", referencedColumnName="id1"), - * @ORM\JoinColumn(name="composite_id2", referencedColumnName="id2") - * }) - * @var \Symfony\Bridge\Doctrine\Tests\Form\Fixtures\CompositeIdentEntity - */ - public $composite; -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeIdentEntity.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeIdentEntity.php deleted file mode 100644 index 9d26314..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeIdentEntity.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests\Fixtures; - -use Doctrine\ORM\Mapping\Id; -use Doctrine\ORM\Mapping\Column; -use Doctrine\ORM\Mapping\Entity; -use Symfony\Component\Security\Core\User\UserInterface; - -/** @Entity */ -class CompositeIdentEntity implements UserInterface -{ - /** @Id @Column(type="integer") */ - protected $id1; - - /** @Id @Column(type="integer") */ - protected $id2; - - /** @Column(type="string") */ - public $name; - - public function __construct($id1, $id2, $name) - { - $this->id1 = $id1; - $this->id2 = $id2; - $this->name = $name; - } - - public function getRoles() - { - } - - public function getPassword() - { - } - - public function getSalt() - { - } - - public function getUsername() - { - return $this->name; - } - - public function eraseCredentials() - { - } - - public function equals(UserInterface $user) - { - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeStringIdentEntity.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeStringIdentEntity.php deleted file mode 100644 index 43c71f6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeStringIdentEntity.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests\Fixtures; - -use Doctrine\ORM\Mapping\Id; -use Doctrine\ORM\Mapping\Column; -use Doctrine\ORM\Mapping\Entity; - -/** @Entity */ -class CompositeStringIdentEntity -{ - /** @Id @Column(type="string") */ - protected $id1; - - /** @Id @Column(type="string") */ - protected $id2; - - /** @Column(type="string") */ - public $name; - - public function __construct($id1, $id2, $name) - { - $this->id1 = $id1; - $this->id2 = $id2; - $this->name = $name; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/ContainerAwareFixture.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/ContainerAwareFixture.php deleted file mode 100644 index 5141e16..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/ContainerAwareFixture.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests\Fixtures; - -use Doctrine\Common\DataFixtures\FixtureInterface; -use Doctrine\Common\Persistence\ObjectManager; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; - -class ContainerAwareFixture implements FixtureInterface, ContainerAwareInterface -{ - public $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - - public function load(ObjectManager $manager) - { - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/ItemGroupEntity.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/ItemGroupEntity.php deleted file mode 100644 index 04d2ddf..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/ItemGroupEntity.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests\Fixtures; - -use Doctrine\ORM\Mapping\Id; -use Doctrine\ORM\Mapping\Column; -use Doctrine\ORM\Mapping\Entity; - -/** @Entity */ -class ItemGroupEntity -{ - /** @Id @Column(type="integer") */ - protected $id; - - /** @Column(type="string", nullable=true) */ - public $name; - - /** @Column(type="string", nullable=true) */ - public $groupName; - - public function __construct($id, $name, $groupName) - { - $this->id = $id; - $this->name = $name; - $this->groupName = $groupName; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/NoToStringSingleIdentEntity.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/NoToStringSingleIdentEntity.php deleted file mode 100644 index a5ecb3d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/NoToStringSingleIdentEntity.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests\Fixtures; - -use Doctrine\ORM\Mapping\Id; -use Doctrine\ORM\Mapping\Column; -use Doctrine\ORM\Mapping\Entity; - -/** @Entity */ -class NoToStringSingleIdentEntity -{ - /** @Id @Column(type="integer") */ - protected $id; - - /** @Column(type="string", nullable=true) */ - public $name; - - public function __construct($id, $name) - { - $this->id = $id; - $this->name = $name; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIdentEntity.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIdentEntity.php deleted file mode 100644 index 09ee18a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIdentEntity.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests\Fixtures; - -use Doctrine\ORM\Mapping\Id; -use Doctrine\ORM\Mapping\Column; -use Doctrine\ORM\Mapping\Entity; - -/** @Entity */ -class SingleIdentEntity -{ - /** @Id @Column(type="integer") */ - protected $id; - - /** @Column(type="string", nullable=true) */ - public $name; - - public function __construct($id, $name) - { - $this->id = $id; - $this->name = $name; - } - - public function __toString() - { - return (string) $this->name; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleStringIdentEntity.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleStringIdentEntity.php deleted file mode 100644 index 50f53b7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleStringIdentEntity.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests\Fixtures; - -use Doctrine\ORM\Mapping\Id; -use Doctrine\ORM\Mapping\Column; -use Doctrine\ORM\Mapping\Entity; - -/** @Entity */ -class SingleStringIdentEntity -{ - /** @Id @Column(type="string") */ - protected $id; - - /** @Column(type="string") */ - public $name; - - public function __construct($id, $name) - { - $this->id = $id; - $this->name = $name; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/EntityChoiceListTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/EntityChoiceListTest.php deleted file mode 100644 index 5d9c747..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/EntityChoiceListTest.php +++ /dev/null @@ -1,311 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests\Form\ChoiceList; - -use Symfony\Bridge\Doctrine\Form\ChoiceList\ORMQueryBuilderLoader; -use Symfony\Bridge\Doctrine\Tests\DoctrineOrmTestCase; -use Symfony\Bridge\Doctrine\Tests\Fixtures\ItemGroupEntity; -use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIdentEntity; -use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStringIdentEntity; -use Symfony\Bridge\Doctrine\Tests\Fixtures\NoToStringSingleIdentEntity; -use Symfony\Bridge\Doctrine\Form\ChoiceList\EntityChoiceList; -use Symfony\Component\Form\Extension\Core\View\ChoiceView; -use Doctrine\ORM\Tools\SchemaTool; - -class EntityChoiceListTest extends DoctrineOrmTestCase -{ - const ITEM_GROUP_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\ItemGroupEntity'; - - const SINGLE_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIdentEntity'; - - const SINGLE_STRING_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStringIdentEntity'; - - const COMPOSITE_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIdentEntity'; - - private $em; - - protected function setUp() - { - if (!class_exists('Symfony\Component\Form\Form')) { - $this->markTestSkipped('The "Form" component is not available'); - } - - parent::setUp(); - - $this->em = $this->createTestEntityManager(); - - $schemaTool = new SchemaTool($this->em); - $classes = array( - $this->em->getClassMetadata(self::ITEM_GROUP_CLASS), - $this->em->getClassMetadata(self::SINGLE_IDENT_CLASS), - $this->em->getClassMetadata(self::SINGLE_STRING_IDENT_CLASS), - $this->em->getClassMetadata(self::COMPOSITE_IDENT_CLASS), - ); - - try { - $schemaTool->dropSchema($classes); - } catch (\Exception $e) { - } - - try { - $schemaTool->createSchema($classes); - } catch (\Exception $e) { - } - } - - protected function tearDown() - { - parent::tearDown(); - - $this->em = null; - } - - /** - * @expectedException Symfony\Component\Form\Exception\FormException - * @expectedMessage Entity "Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIdentEntity" passed to the choice field must have a "__toString()" method defined (or you can also override the "property" option). - */ - public function testEntitesMustHaveAToStringMethod() - { - $entity1 = new NoToStringSingleIdentEntity(1, 'Foo'); - $entity2 = new NoToStringSingleIdentEntity(2, 'Bar'); - - // Persist for managed state - $this->em->persist($entity1); - $this->em->persist($entity2); - - $choiceList = new EntityChoiceList( - $this->em, - self::SINGLE_IDENT_CLASS, - null, - null, - array( - $entity1, - $entity2, - ) - ); - - $choiceList->getValues(); - } - - /** - * @expectedException Symfony\Component\Form\Exception\FormException - */ - public function testChoicesMustBeManaged() - { - $entity1 = new SingleIdentEntity(1, 'Foo'); - $entity2 = new SingleIdentEntity(2, 'Bar'); - - // no persist here! - - $choiceList = new EntityChoiceList( - $this->em, - self::SINGLE_IDENT_CLASS, - 'name', - null, - array( - $entity1, - $entity2, - ) - ); - - // triggers loading -> exception - $choiceList->getChoices(); - } - - public function testFlattenedChoicesAreManaged() - { - $entity1 = new SingleIdentEntity(1, 'Foo'); - $entity2 = new SingleIdentEntity(2, 'Bar'); - - // Persist for managed state - $this->em->persist($entity1); - $this->em->persist($entity2); - - $choiceList = new EntityChoiceList( - $this->em, - self::SINGLE_IDENT_CLASS, - 'name', - null, - array( - $entity1, - $entity2, - ) - ); - - $this->assertSame(array(1 => $entity1, 2 => $entity2), $choiceList->getChoices()); - } - - public function testEmptyChoicesAreManaged() - { - $entity1 = new SingleIdentEntity(1, 'Foo'); - $entity2 = new SingleIdentEntity(2, 'Bar'); - - // Persist for managed state - $this->em->persist($entity1); - $this->em->persist($entity2); - - $choiceList = new EntityChoiceList( - $this->em, - self::SINGLE_IDENT_CLASS, - 'name', - null, - array() - ); - - $this->assertSame(array(), $choiceList->getChoices()); - } - - public function testNestedChoicesAreManaged() - { - $entity1 = new SingleIdentEntity(1, 'Foo'); - $entity2 = new SingleIdentEntity(2, 'Bar'); - - // Oh yeah, we're persisting with fire now! - $this->em->persist($entity1); - $this->em->persist($entity2); - - $choiceList = new EntityChoiceList( - $this->em, - self::SINGLE_IDENT_CLASS, - 'name', - null, - array( - 'group1' => array($entity1), - 'group2' => array($entity2), - ) - ); - - $this->assertSame(array(1 => $entity1, 2 => $entity2), $choiceList->getChoices()); - $this->assertEquals(array( - 'group1' => array(1 => new ChoiceView($entity1, '1', 'Foo')), - 'group2' => array(2 => new ChoiceView($entity2, '2', 'Bar')) - ), $choiceList->getRemainingViews()); - } - - public function testGroupBySupportsString() - { - $item1 = new ItemGroupEntity(1, 'Foo', 'Group1'); - $item2 = new ItemGroupEntity(2, 'Bar', 'Group1'); - $item3 = new ItemGroupEntity(3, 'Baz', 'Group2'); - $item4 = new ItemGroupEntity(4, 'Boo!', null); - - $this->em->persist($item1); - $this->em->persist($item2); - $this->em->persist($item3); - $this->em->persist($item4); - - $choiceList = new EntityChoiceList( - $this->em, - self::ITEM_GROUP_CLASS, - 'name', - null, - array( - $item1, - $item2, - $item3, - $item4, - ), - 'groupName' - ); - - $this->assertEquals(array(1 => $item1, 2 => $item2, 3 => $item3, 4 => $item4), $choiceList->getChoices()); - $this->assertEquals(array( - 'Group1' => array(1 => new ChoiceView($item1, '1', 'Foo'), 2 => new ChoiceView($item2, '2', 'Bar')), - 'Group2' => array(3 => new ChoiceView($item3, '3', 'Baz')), - 4 => new ChoiceView($item4, '4', 'Boo!') - ), $choiceList->getRemainingViews()); - } - - public function testGroupByInvalidPropertyPathReturnsFlatChoices() - { - $item1 = new ItemGroupEntity(1, 'Foo', 'Group1'); - $item2 = new ItemGroupEntity(2, 'Bar', 'Group1'); - - $this->em->persist($item1); - $this->em->persist($item2); - - $choiceList = new EntityChoiceList( - $this->em, - self::ITEM_GROUP_CLASS, - 'name', - null, - array( - $item1, - $item2, - ), - 'child.that.does.not.exist' - ); - - $this->assertEquals(array( - 1 => $item1, - 2 => $item2 - ), $choiceList->getChoices()); - } - - public function testPossibleToProvideShorthandEntityName() - { - $shorthandName = 'SymfonyTestsDoctrine:SingleIdentEntity'; - - $item1 = new SingleIdentEntity(1, 'Foo'); - $item2 = new SingleIdentEntity(2, 'Bar'); - - $this->em->persist($item1); - $this->em->persist($item2); - - $choiceList = new EntityChoiceList( - $this->em, - $shorthandName, - null, - null, - null, - null - ); - - $this->assertEquals(array(1, 2), $choiceList->getValuesForChoices(array($item1, $item2))); - $this->assertEquals(array(1, 2), $choiceList->getIndicesForChoices(array($item1, $item2))); - } - - // Ticket #3446 - public function testGetEmptyArrayChoicesForEmptyValues() - { - $qb = $this->em->createQueryBuilder()->select('s')->from(self::SINGLE_IDENT_CLASS, 's'); - $entityLoader = new ORMQueryBuilderLoader($qb); - $choiceList = new EntityChoiceList( - $this->em, - self::SINGLE_IDENT_CLASS, - null, - $entityLoader - ); - - $this->assertEquals(array(), $choiceList->getChoicesForValues(array())); - } - - // https://github.com/symfony/symfony/issues/3635 - public function testSingleNonIntIdFallsBackToGeneration() - { - $entity1 = new SingleStringIdentEntity('Id 1', 'Foo'); - $entity2 = new SingleStringIdentEntity('Id 2', 'Bar'); - - // Persist for managed state - $this->em->persist($entity1); - $this->em->persist($entity2); - $this->em->flush(); - - $choiceList = new EntityChoiceList( - $this->em, - self::SINGLE_STRING_IDENT_CLASS, - 'name' - ); - - $this->assertSame(array(0 => $entity1, 1 => $entity2), $choiceList->getChoices()); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php deleted file mode 100644 index ea068c2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php +++ /dev/null @@ -1,112 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests\Form\Type; - -use Symfony\Component\Form\Tests\FormPerformanceTestCase; -use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIdentEntity; -use Doctrine\ORM\Tools\SchemaTool; -use Symfony\Bridge\Doctrine\Tests\DoctrineOrmTestCase; -use Symfony\Component\Form\Extension\Core\CoreExtension; -use Symfony\Bridge\Doctrine\Form\DoctrineOrmExtension; - -/** - * @author Bernhard Schussek - */ -class EntityTypePerformanceTest extends FormPerformanceTestCase -{ - const ENTITY_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIdentEntity'; - - /** - * @var \Doctrine\ORM\EntityManager - */ - private $em; - - protected function getExtensions() - { - $manager = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry'); - $manager->expects($this->any()) - ->method('getManager') - ->will($this->returnValue($this->em)); - - return array( - new CoreExtension(), - new DoctrineOrmExtension($manager) - ); - } - - protected function setUp() - { - if (!class_exists('Symfony\Component\Form\Form')) { - $this->markTestSkipped('The "Form" component is not available'); - } - - if (!class_exists('Doctrine\DBAL\Platforms\MySqlPlatform')) { - $this->markTestSkipped('Doctrine DBAL is not available.'); - } - - if (!class_exists('Doctrine\Common\Version')) { - $this->markTestSkipped('Doctrine Common is not available.'); - } - - if (!class_exists('Doctrine\ORM\EntityManager')) { - $this->markTestSkipped('Doctrine ORM is not available.'); - } - - $this->em = DoctrineOrmTestCase::createTestEntityManager(); - - parent::setUp(); - - $schemaTool = new SchemaTool($this->em); - $classes = array( - $this->em->getClassMetadata(self::ENTITY_CLASS), - ); - - try { - $schemaTool->dropSchema($classes); - } catch (\Exception $e) { - } - - try { - $schemaTool->createSchema($classes); - } catch (\Exception $e) { - } - - $ids = range(1, 300); - - foreach ($ids as $id) { - $name = 65 + chr($id % 57); - $this->em->persist(new SingleIdentEntity($id, $name)); - } - - $this->em->flush(); - } - - /** - * This test case is realistic in collection forms where each - * row contains the same entity field. - * - * @group benchmark - */ - public function testCollapsedEntityField() - { - $this->setMaxRunningTime(1); - - for ($i = 0; $i < 20; ++$i) { - $form = $this->factory->create('entity', null, array( - 'class' => self::ENTITY_CLASS, - )); - - // force loading of the choice list - $form->createView(); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php deleted file mode 100644 index 073336a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php +++ /dev/null @@ -1,723 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests\Form\Type; - -use Symfony\Component\Form\Exception\UnexpectedTypeException; -use Symfony\Component\Form\Tests\Extension\Core\Type\TypeTestCase; -use Symfony\Bridge\Doctrine\Tests\DoctrineOrmTestCase; -use Symfony\Bridge\Doctrine\Tests\Fixtures\ItemGroupEntity; -use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIdentEntity; -use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStringIdentEntity; -use Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIdentEntity; -use Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeStringIdentEntity; -use Symfony\Bridge\Doctrine\Form\DoctrineOrmExtension; -use Doctrine\ORM\Tools\SchemaTool; -use Doctrine\Common\Collections\ArrayCollection; -use Symfony\Component\Form\Extension\Core\View\ChoiceView; - -class EntityTypeTest extends TypeTestCase -{ - const ITEM_GROUP_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\ItemGroupEntity'; - const SINGLE_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIdentEntity'; - const SINGLE_STRING_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStringIdentEntity'; - const COMPOSITE_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIdentEntity'; - const COMPOSITE_STRING_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeStringIdentEntity'; - - /** - * @var \Doctrine\ORM\EntityManager - */ - private $em; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - private $emRegistry; - - protected function setUp() - { - if (!class_exists('Symfony\Component\Form\Form')) { - $this->markTestSkipped('The "Form" component is not available'); - } - - if (!class_exists('Doctrine\DBAL\Platforms\MySqlPlatform')) { - $this->markTestSkipped('Doctrine DBAL is not available.'); - } - - if (!class_exists('Doctrine\Common\Version')) { - $this->markTestSkipped('Doctrine Common is not available.'); - } - - if (!class_exists('Doctrine\ORM\EntityManager')) { - $this->markTestSkipped('Doctrine ORM is not available.'); - } - - $this->em = DoctrineOrmTestCase::createTestEntityManager(); - $this->emRegistry = $this->createRegistryMock('default', $this->em); - - parent::setUp(); - - $schemaTool = new SchemaTool($this->em); - $classes = array( - $this->em->getClassMetadata(self::ITEM_GROUP_CLASS), - $this->em->getClassMetadata(self::SINGLE_IDENT_CLASS), - $this->em->getClassMetadata(self::SINGLE_STRING_IDENT_CLASS), - $this->em->getClassMetadata(self::COMPOSITE_IDENT_CLASS), - $this->em->getClassMetadata(self::COMPOSITE_STRING_IDENT_CLASS), - ); - - try { - $schemaTool->dropSchema($classes); - } catch (\Exception $e) { - } - - try { - $schemaTool->createSchema($classes); - } catch (\Exception $e) { - } - } - - protected function tearDown() - { - parent::tearDown(); - - $this->em = null; - } - - protected function getExtensions() - { - return array_merge(parent::getExtensions(), array( - new DoctrineOrmExtension($this->emRegistry), - )); - } - - protected function persist(array $entities) - { - foreach ($entities as $entity) { - $this->em->persist($entity); - } - - $this->em->flush(); - // no clear, because entities managed by the choice field must - // be managed! - } - - public function testSetDataToUninitializedEntityWithNonRequired() - { - $entity1 = new SingleIdentEntity(1, 'Foo'); - $entity2 = new SingleIdentEntity(2, 'Bar'); - - $this->persist(array($entity1, $entity2)); - - $field = $this->factory->createNamed('name', 'entity', null, array( - 'em' => 'default', - 'class' => self::SINGLE_IDENT_CLASS, - 'required' => false, - 'property' => 'name' - )); - - $this->assertEquals(array(1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')), $field->createView()->vars['choices']); - } - - public function testSetDataToUninitializedEntityWithNonRequiredToString() - { - $entity1 = new SingleIdentEntity(1, 'Foo'); - $entity2 = new SingleIdentEntity(2, 'Bar'); - - $this->persist(array($entity1, $entity2)); - - $field = $this->factory->createNamed('name', 'entity', null, array( - 'em' => 'default', - 'class' => self::SINGLE_IDENT_CLASS, - 'required' => false, - )); - - $this->assertEquals(array(1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')), $field->createView()->vars['choices']); - } - - public function testSetDataToUninitializedEntityWithNonRequiredQueryBuilder() - { - $entity1 = new SingleIdentEntity(1, 'Foo'); - $entity2 = new SingleIdentEntity(2, 'Bar'); - - $this->persist(array($entity1, $entity2)); - $qb = $this->em->createQueryBuilder()->select('e')->from(self::SINGLE_IDENT_CLASS, 'e'); - - $field = $this->factory->createNamed('name', 'entity', null, array( - 'em' => 'default', - 'class' => self::SINGLE_IDENT_CLASS, - 'required' => false, - 'property' => 'name', - 'query_builder' => $qb - )); - - $this->assertEquals(array(1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')), $field->createView()->vars['choices']); - } - - /** - * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException - */ - public function testConfigureQueryBuilderWithNonQueryBuilderAndNonClosure() - { - $field = $this->factory->createNamed('name', 'entity', null, array( - 'em' => 'default', - 'class' => self::SINGLE_IDENT_CLASS, - 'query_builder' => new \stdClass(), - )); - } - - /** - * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException - */ - public function testConfigureQueryBuilderWithClosureReturningNonQueryBuilder() - { - $field = $this->factory->createNamed('name', 'entity', null, array( - 'em' => 'default', - 'class' => self::SINGLE_IDENT_CLASS, - 'query_builder' => function () { - return new \stdClass(); - }, - )); - - $field->bind('2'); - } - - public function testSetDataSingleNull() - { - $field = $this->factory->createNamed('name', 'entity', null, array( - 'multiple' => false, - 'em' => 'default', - 'class' => self::SINGLE_IDENT_CLASS, - )); - $field->setData(null); - - $this->assertNull($field->getData()); - $this->assertSame('', $field->getClientData()); - } - - public function testSetDataMultipleExpandedNull() - { - $field = $this->factory->createNamed('name', 'entity', null, array( - 'multiple' => true, - 'expanded' => true, - 'em' => 'default', - 'class' => self::SINGLE_IDENT_CLASS, - )); - $field->setData(null); - - $this->assertNull($field->getData()); - $this->assertSame(array(), $field->getClientData()); - } - - public function testSetDataMultipleNonExpandedNull() - { - $field = $this->factory->createNamed('name', 'entity', null, array( - 'multiple' => true, - 'expanded' => false, - 'em' => 'default', - 'class' => self::SINGLE_IDENT_CLASS, - )); - $field->setData(null); - - $this->assertNull($field->getData()); - $this->assertSame(array(), $field->getClientData()); - } - - public function testSubmitSingleExpandedNull() - { - $field = $this->factory->createNamed('name', 'entity', null, array( - 'multiple' => false, - 'expanded' => true, - 'em' => 'default', - 'class' => self::SINGLE_IDENT_CLASS, - )); - $field->bind(null); - - $this->assertNull($field->getData()); - $this->assertSame(array(), $field->getClientData()); - } - - public function testSubmitSingleNonExpandedNull() - { - $field = $this->factory->createNamed('name', 'entity', null, array( - 'multiple' => false, - 'expanded' => false, - 'em' => 'default', - 'class' => self::SINGLE_IDENT_CLASS, - )); - $field->bind(null); - - $this->assertNull($field->getData()); - $this->assertSame('', $field->getClientData()); - } - - public function testSubmitMultipleNull() - { - $field = $this->factory->createNamed('name', 'entity', null, array( - 'multiple' => true, - 'em' => 'default', - 'class' => self::SINGLE_IDENT_CLASS, - )); - $field->bind(null); - - $this->assertEquals(new ArrayCollection(), $field->getData()); - $this->assertSame(array(), $field->getClientData()); - } - - public function testSubmitSingleNonExpandedSingleIdentifier() - { - $entity1 = new SingleIdentEntity(1, 'Foo'); - $entity2 = new SingleIdentEntity(2, 'Bar'); - - $this->persist(array($entity1, $entity2)); - - $field = $this->factory->createNamed('name', 'entity', null, array( - 'multiple' => false, - 'expanded' => false, - 'em' => 'default', - 'class' => self::SINGLE_IDENT_CLASS, - 'property' => 'name', - )); - - $field->bind('2'); - - $this->assertTrue($field->isSynchronized()); - $this->assertSame($entity2, $field->getData()); - $this->assertSame('2', $field->getClientData()); - } - - public function testSubmitSingleNonExpandedCompositeIdentifier() - { - $entity1 = new CompositeIdentEntity(10, 20, 'Foo'); - $entity2 = new CompositeIdentEntity(30, 40, 'Bar'); - - $this->persist(array($entity1, $entity2)); - - $field = $this->factory->createNamed('name', 'entity', null, array( - 'multiple' => false, - 'expanded' => false, - 'em' => 'default', - 'class' => self::COMPOSITE_IDENT_CLASS, - 'property' => 'name', - )); - - // the collection key is used here - $field->bind('1'); - - $this->assertTrue($field->isSynchronized()); - $this->assertSame($entity2, $field->getData()); - $this->assertSame('1', $field->getClientData()); - } - - public function testSubmitMultipleNonExpandedSingleIdentifier() - { - $entity1 = new SingleIdentEntity(1, 'Foo'); - $entity2 = new SingleIdentEntity(2, 'Bar'); - $entity3 = new SingleIdentEntity(3, 'Baz'); - - $this->persist(array($entity1, $entity2, $entity3)); - - $field = $this->factory->createNamed('name', 'entity', null, array( - 'multiple' => true, - 'expanded' => false, - 'em' => 'default', - 'class' => self::SINGLE_IDENT_CLASS, - 'property' => 'name', - )); - - $field->bind(array('1', '3')); - - $expected = new ArrayCollection(array($entity1, $entity3)); - - $this->assertTrue($field->isSynchronized()); - $this->assertEquals($expected, $field->getData()); - $this->assertSame(array('1', '3'), $field->getClientData()); - } - - public function testSubmitMultipleNonExpandedSingleIdentifier_existingData() - { - $entity1 = new SingleIdentEntity(1, 'Foo'); - $entity2 = new SingleIdentEntity(2, 'Bar'); - $entity3 = new SingleIdentEntity(3, 'Baz'); - - $this->persist(array($entity1, $entity2, $entity3)); - - $field = $this->factory->createNamed('name', 'entity', null, array( - 'multiple' => true, - 'expanded' => false, - 'em' => 'default', - 'class' => self::SINGLE_IDENT_CLASS, - 'property' => 'name', - )); - - $existing = new ArrayCollection(array(0 => $entity2)); - - $field->setData($existing); - $field->bind(array('1', '3')); - - // entry with index 0 ($entity2) was replaced - $expected = new ArrayCollection(array(0 => $entity1, 1 => $entity3)); - - $this->assertTrue($field->isSynchronized()); - $this->assertEquals($expected, $field->getData()); - // same object still, useful if it is a PersistentCollection - $this->assertSame($existing, $field->getData()); - $this->assertSame(array('1', '3'), $field->getClientData()); - } - - public function testSubmitMultipleNonExpandedCompositeIdentifier() - { - $entity1 = new CompositeIdentEntity(10, 20, 'Foo'); - $entity2 = new CompositeIdentEntity(30, 40, 'Bar'); - $entity3 = new CompositeIdentEntity(50, 60, 'Baz'); - - $this->persist(array($entity1, $entity2, $entity3)); - - $field = $this->factory->createNamed('name', 'entity', null, array( - 'multiple' => true, - 'expanded' => false, - 'em' => 'default', - 'class' => self::COMPOSITE_IDENT_CLASS, - 'property' => 'name', - )); - - // because of the composite key collection keys are used - $field->bind(array('0', '2')); - - $expected = new ArrayCollection(array($entity1, $entity3)); - - $this->assertTrue($field->isSynchronized()); - $this->assertEquals($expected, $field->getData()); - $this->assertSame(array('0', '2'), $field->getClientData()); - } - - public function testSubmitMultipleNonExpandedCompositeIdentifier_existingData() - { - $entity1 = new CompositeIdentEntity(10, 20, 'Foo'); - $entity2 = new CompositeIdentEntity(30, 40, 'Bar'); - $entity3 = new CompositeIdentEntity(50, 60, 'Baz'); - - $this->persist(array($entity1, $entity2, $entity3)); - - $field = $this->factory->createNamed('name', 'entity', null, array( - 'multiple' => true, - 'expanded' => false, - 'em' => 'default', - 'class' => self::COMPOSITE_IDENT_CLASS, - 'property' => 'name', - )); - - $existing = new ArrayCollection(array(0 => $entity2)); - - $field->setData($existing); - $field->bind(array('0', '2')); - - // entry with index 0 ($entity2) was replaced - $expected = new ArrayCollection(array(0 => $entity1, 1 => $entity3)); - - $this->assertTrue($field->isSynchronized()); - $this->assertEquals($expected, $field->getData()); - // same object still, useful if it is a PersistentCollection - $this->assertSame($existing, $field->getData()); - $this->assertSame(array('0', '2'), $field->getClientData()); - } - - public function testSubmitSingleExpanded() - { - $entity1 = new SingleIdentEntity(1, 'Foo'); - $entity2 = new SingleIdentEntity(2, 'Bar'); - - $this->persist(array($entity1, $entity2)); - - $field = $this->factory->createNamed('name', 'entity', null, array( - 'multiple' => false, - 'expanded' => true, - 'em' => 'default', - 'class' => self::SINGLE_IDENT_CLASS, - 'property' => 'name', - )); - - $field->bind('2'); - - $this->assertTrue($field->isSynchronized()); - $this->assertSame($entity2, $field->getData()); - $this->assertFalse($field['1']->getData()); - $this->assertTrue($field['2']->getData()); - $this->assertNull($field['1']->getClientData()); - $this->assertSame('2', $field['2']->getClientData()); - } - - public function testSubmitMultipleExpanded() - { - $entity1 = new SingleIdentEntity(1, 'Foo'); - $entity2 = new SingleIdentEntity(2, 'Bar'); - $entity3 = new SingleIdentEntity(3, 'Bar'); - - $this->persist(array($entity1, $entity2, $entity3)); - - $field = $this->factory->createNamed('name', 'entity', null, array( - 'multiple' => true, - 'expanded' => true, - 'em' => 'default', - 'class' => self::SINGLE_IDENT_CLASS, - 'property' => 'name', - )); - - $field->bind(array('1', '3')); - - $expected = new ArrayCollection(array($entity1, $entity3)); - - $this->assertTrue($field->isSynchronized()); - $this->assertEquals($expected, $field->getData()); - $this->assertTrue($field['1']->getData()); - $this->assertFalse($field['2']->getData()); - $this->assertTrue($field['3']->getData()); - $this->assertSame('1', $field['1']->getClientData()); - $this->assertNull($field['2']->getClientData()); - $this->assertSame('3', $field['3']->getClientData()); - } - - public function testOverrideChoices() - { - $entity1 = new SingleIdentEntity(1, 'Foo'); - $entity2 = new SingleIdentEntity(2, 'Bar'); - $entity3 = new SingleIdentEntity(3, 'Baz'); - - $this->persist(array($entity1, $entity2, $entity3)); - - $field = $this->factory->createNamed('name', 'entity', null, array( - 'em' => 'default', - 'class' => self::SINGLE_IDENT_CLASS, - // not all persisted entities should be displayed - 'choices' => array($entity1, $entity2), - 'property' => 'name', - )); - - $field->bind('2'); - - $this->assertEquals(array(1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')), $field->createView()->vars['choices']); - $this->assertTrue($field->isSynchronized()); - $this->assertSame($entity2, $field->getData()); - $this->assertSame('2', $field->getClientData()); - } - - public function testGroupByChoices() - { - $item1 = new ItemGroupEntity(1, 'Foo', 'Group1'); - $item2 = new ItemGroupEntity(2, 'Bar', 'Group1'); - $item3 = new ItemGroupEntity(3, 'Baz', 'Group2'); - $item4 = new ItemGroupEntity(4, 'Boo!', null); - - $this->persist(array($item1, $item2, $item3, $item4)); - - $field = $this->factory->createNamed('name', 'entity', null, array( - 'em' => 'default', - 'class' => self::ITEM_GROUP_CLASS, - 'choices' => array($item1, $item2, $item3, $item4), - 'property' => 'name', - 'group_by' => 'groupName', - )); - - $field->bind('2'); - - $this->assertSame('2', $field->getClientData()); - $this->assertEquals(array( - 'Group1' => array(1 => new ChoiceView($item1, '1', 'Foo'), 2 => new ChoiceView($item2, '2', 'Bar')), - 'Group2' => array(3 => new ChoiceView($item3, '3', 'Baz')), - '4' => new ChoiceView($item4, '4', 'Boo!') - ), $field->createView()->vars['choices']); - } - - public function testDisallowChoicesThatAreNotIncluded_choicesSingleIdentifier() - { - $entity1 = new SingleIdentEntity(1, 'Foo'); - $entity2 = new SingleIdentEntity(2, 'Bar'); - $entity3 = new SingleIdentEntity(3, 'Baz'); - - $this->persist(array($entity1, $entity2, $entity3)); - - $field = $this->factory->createNamed('name', 'entity', null, array( - 'em' => 'default', - 'class' => self::SINGLE_IDENT_CLASS, - 'choices' => array($entity1, $entity2), - 'property' => 'name', - )); - - $field->bind('3'); - - $this->assertFalse($field->isSynchronized()); - $this->assertNull($field->getData()); - } - - public function testDisallowChoicesThatAreNotIncluded_choicesCompositeIdentifier() - { - $entity1 = new CompositeIdentEntity(10, 20, 'Foo'); - $entity2 = new CompositeIdentEntity(30, 40, 'Bar'); - $entity3 = new CompositeIdentEntity(50, 60, 'Baz'); - - $this->persist(array($entity1, $entity2, $entity3)); - - $field = $this->factory->createNamed('name', 'entity', null, array( - 'em' => 'default', - 'class' => self::COMPOSITE_IDENT_CLASS, - 'choices' => array($entity1, $entity2), - 'property' => 'name', - )); - - $field->bind('2'); - - $this->assertFalse($field->isSynchronized()); - $this->assertNull($field->getData()); - } - - public function testDisallowChoicesThatAreNotIncludedQueryBuilderSingleIdentifier() - { - $entity1 = new SingleIdentEntity(1, 'Foo'); - $entity2 = new SingleIdentEntity(2, 'Bar'); - $entity3 = new SingleIdentEntity(3, 'Baz'); - - $this->persist(array($entity1, $entity2, $entity3)); - - $repository = $this->em->getRepository(self::SINGLE_IDENT_CLASS); - - $field = $this->factory->createNamed('name', 'entity', null, array( - 'em' => 'default', - 'class' => self::SINGLE_IDENT_CLASS, - 'query_builder' => $repository->createQueryBuilder('e') - ->where('e.id IN (1, 2)'), - 'property' => 'name', - )); - - $field->bind('3'); - - $this->assertFalse($field->isSynchronized()); - $this->assertNull($field->getData()); - } - - public function testDisallowChoicesThatAreNotIncludedQueryBuilderAsClosureSingleIdentifier() - { - $entity1 = new SingleIdentEntity(1, 'Foo'); - $entity2 = new SingleIdentEntity(2, 'Bar'); - $entity3 = new SingleIdentEntity(3, 'Baz'); - - $this->persist(array($entity1, $entity2, $entity3)); - - $field = $this->factory->createNamed('name', 'entity', null, array( - 'em' => 'default', - 'class' => self::SINGLE_IDENT_CLASS, - 'query_builder' => function ($repository) { - return $repository->createQueryBuilder('e') - ->where('e.id IN (1, 2)'); - }, - 'property' => 'name', - )); - - $field->bind('3'); - - $this->assertFalse($field->isSynchronized()); - $this->assertNull($field->getData()); - } - - public function testDisallowChoicesThatAreNotIncludedQueryBuilderAsClosureCompositeIdentifier() - { - $entity1 = new CompositeIdentEntity(10, 20, 'Foo'); - $entity2 = new CompositeIdentEntity(30, 40, 'Bar'); - $entity3 = new CompositeIdentEntity(50, 60, 'Baz'); - - $this->persist(array($entity1, $entity2, $entity3)); - - $field = $this->factory->createNamed('name', 'entity', null, array( - 'em' => 'default', - 'class' => self::COMPOSITE_IDENT_CLASS, - 'query_builder' => function ($repository) { - return $repository->createQueryBuilder('e') - ->where('e.id1 IN (10, 50)'); - }, - 'property' => 'name', - )); - - $field->bind('2'); - - $this->assertFalse($field->isSynchronized()); - $this->assertNull($field->getData()); - } - - public function testSubmitSingleStringIdentifier() - { - $entity1 = new SingleStringIdentEntity('foo', 'Foo'); - - $this->persist(array($entity1)); - - $field = $this->factory->createNamed('name', 'entity', null, array( - 'multiple' => false, - 'expanded' => false, - 'em' => 'default', - 'class' => self::SINGLE_STRING_IDENT_CLASS, - 'property' => 'name', - )); - - $field->bind('foo'); - - $this->assertTrue($field->isSynchronized()); - $this->assertSame($entity1, $field->getData()); - $this->assertSame('foo', $field->getClientData()); - } - - public function testSubmitCompositeStringIdentifier() - { - $entity1 = new CompositeStringIdentEntity('foo1', 'foo2', 'Foo'); - - $this->persist(array($entity1)); - - $field = $this->factory->createNamed('name', 'entity', null, array( - 'multiple' => false, - 'expanded' => false, - 'em' => 'default', - 'class' => self::COMPOSITE_STRING_IDENT_CLASS, - 'property' => 'name', - )); - - // the collection key is used here - $field->bind('0'); - - $this->assertTrue($field->isSynchronized()); - $this->assertSame($entity1, $field->getData()); - $this->assertSame('0', $field->getClientData()); - } - - public function testGetManagerForClassIfNoEm() - { - $this->emRegistry->expects($this->never()) - ->method('getManager'); - - $this->emRegistry->expects($this->once()) - ->method('getManagerForClass') - ->with(self::SINGLE_IDENT_CLASS) - ->will($this->returnValue($this->em)); - - $this->factory->createNamed('name', 'entity', null, array( - 'class' => self::SINGLE_IDENT_CLASS, - 'required' => false, - 'property' => 'name' - )); - } - - protected function createRegistryMock($name, $em) - { - $registry = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry'); - $registry->expects($this->any()) - ->method('getManager') - ->with($this->equalTo($name)) - ->will($this->returnValue($em)); - - return $registry; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/HttpFoundation/DbalSessionHandlerTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/HttpFoundation/DbalSessionHandlerTest.php deleted file mode 100644 index 2238187..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/HttpFoundation/DbalSessionHandlerTest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\HttpFoundation; - -use Symfony\Bridge\Doctrine\HttpFoundation\DbalSessionHandler; - -/** - * Test class for DbalSessionHandler. - * - * @author Drak - */ -class DbalSessionHandlerTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - - public function testConstruct() - { - $this->connection = $this->getMock('Doctrine\DBAL\Driver\Connection'); - $mock = $this->getMockBuilder('Symfony\Bridge\Doctrine\HttpFoundation\DbalSessionHandler'); - $mock->setConstructorArgs(array($this->connection)); - $this->driver = $mock->getMock(); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php deleted file mode 100644 index 3df1be5..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php +++ /dev/null @@ -1,119 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests\Security\User; - -use Symfony\Bridge\Doctrine\Tests\DoctrineOrmTestCase; -use Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIdentEntity; -use Symfony\Bridge\Doctrine\Security\User\EntityUserProvider; -use Doctrine\ORM\Tools\SchemaTool; - -class EntityUserProviderTest extends DoctrineOrmTestCase -{ - protected function setUp() - { - if (!class_exists('Symfony\Component\Security\Core\SecurityContext')) { - $this->markTestSkipped('The "Security" component is not available'); - } - - parent::setUp(); - } - - public function testRefreshUserGetsUserByPrimaryKey() - { - $em = $this->createTestEntityManager(); - $this->createSchema($em); - - $user1 = new CompositeIdentEntity(1, 1, 'user1'); - $user2 = new CompositeIdentEntity(1, 2, 'user2'); - - $em->persist($user1); - $em->persist($user2); - $em->flush(); - - $provider = new EntityUserProvider($this->getManager($em), 'Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIdentEntity', 'name'); - - // try to change the user identity - $user1->name = 'user2'; - - $this->assertSame($user1, $provider->refreshUser($user1)); - } - - public function testRefreshUserRequiresId() - { - $em = $this->createTestEntityManager(); - - $user1 = new CompositeIdentEntity(null, null, 'user1'); - $provider = new EntityUserProvider($this->getManager($em), 'Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIdentEntity', 'name'); - - $this->setExpectedException( - 'InvalidArgumentException', - 'You cannot refresh a user from the EntityUserProvider that does not contain an identifier. The user object has to be serialized with its own identifier mapped by Doctrine' - ); - $provider->refreshUser($user1); - } - - public function testRefreshInvalidUser() - { - $em = $this->createTestEntityManager(); - $this->createSchema($em); - - $user1 = new CompositeIdentEntity(1, 1, 'user1'); - - $em->persist($user1); - $em->flush(); - - $provider = new EntityUserProvider($this->getManager($em), 'Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIdentEntity', 'name'); - - $user2 = new CompositeIdentEntity(1, 2, 'user2'); - $this->setExpectedException( - 'Symfony\Component\Security\Core\Exception\UsernameNotFoundException', - 'User with id {"id1":1,"id2":2} not found' - ); - $provider->refreshUser($user2); - } - - public function testSupportProxy() - { - $em = $this->createTestEntityManager(); - $this->createSchema($em); - - $user1 = new CompositeIdentEntity(1, 1, 'user1'); - - $em->persist($user1); - $em->flush(); - $em->clear(); - - $provider = new EntityUserProvider($this->getManager($em), 'Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIdentEntity', 'name'); - - $user2 = $em->getReference('Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIdentEntity', array('id1' => 1, 'id2' => 1)); - $this->assertTrue($provider->supportsClass(get_class($user2))); - } - - private function getManager($em, $name = null) - { - $manager = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry'); - $manager->expects($this->once()) - ->method('getManager') - ->with($this->equalTo($name)) - ->will($this->returnValue($em)); - - return $manager; - } - - private function createSchema($em) - { - $schemaTool = new SchemaTool($em); - $schemaTool->createSchema(array( - $em->getClassMetadata('Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIdentEntity'), - )); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueValidatorTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueValidatorTest.php deleted file mode 100644 index 7ae10e7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueValidatorTest.php +++ /dev/null @@ -1,320 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests\Validator\Constraints; - -use Symfony\Bridge\Doctrine\Tests\DoctrineOrmTestCase; -use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIdentEntity; -use Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIdentEntity; -use Symfony\Bridge\Doctrine\Tests\Fixtures\AssociationEntity; -use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; -use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator; -use Symfony\Component\Validator\Mapping\ClassMetadata; -use Symfony\Component\Validator\Validator; -use Doctrine\ORM\Tools\SchemaTool; - -class UniqueValidatorTest extends DoctrineOrmTestCase -{ - protected function setUp() - { - parent::setUp(); - - if (!class_exists('Symfony\Component\Security\Core\SecurityContext')) { - $this->markTestSkipped('The "Security" component is not available'); - } - - if (!class_exists('Symfony\Component\Validator\Constraint')) { - $this->markTestSkipped('The "Validator" component is not available'); - } - } - - protected function createRegistryMock($entityManagerName, $em) - { - $registry = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry'); - $registry->expects($this->any()) - ->method('getManager') - ->with($this->equalTo($entityManagerName)) - ->will($this->returnValue($em)); - - return $registry; - } - - protected function createRepositoryMock() - { - $repository = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectRepository') - ->setMethods(array('findByCustom', 'find', 'findAll', 'findOneBy', 'findBy', 'getClassName')) - ->getMock() - ; - - return $repository; - } - - protected function createEntityManagerMock($repositoryMock) - { - $em = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectManager') - ->getMock() - ; - $em->expects($this->any()) - ->method('getRepository') - ->will($this->returnValue($repositoryMock)) - ; - - $classMetadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $classMetadata - ->expects($this->any()) - ->method('hasField') - ->will($this->returnValue(true)) - ; - $refl = $this->getMockBuilder('Doctrine\Common\Reflection\StaticReflectionProperty') - ->disableOriginalConstructor() - ->setMethods(array('getValue')) - ->getMock() - ; - $refl - ->expects($this->any()) - ->method('getValue') - ->will($this->returnValue(true)) - ; - $classMetadata->reflFields = array('name' => $refl); - $em->expects($this->any()) - ->method('getClassMetadata') - ->will($this->returnValue($classMetadata)) - ; - - return $em; - } - - protected function createMetadataFactoryMock($metadata) - { - $metadataFactory = $this->getMock('Symfony\Component\Validator\Mapping\ClassMetadataFactoryInterface'); - $metadataFactory->expects($this->any()) - ->method('getClassMetadata') - ->with($this->equalTo($metadata->name)) - ->will($this->returnValue($metadata)); - - return $metadataFactory; - } - - protected function createValidatorFactory($uniqueValidator) - { - $validatorFactory = $this->getMock('Symfony\Component\Validator\ConstraintValidatorFactoryInterface'); - $validatorFactory->expects($this->any()) - ->method('getInstance') - ->with($this->isInstanceOf('Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity')) - ->will($this->returnValue($uniqueValidator)); - - return $validatorFactory; - } - - public function createValidator($entityManagerName, $em, $validateClass = null, $uniqueFields = null, $errorPath = null, $repositoryMethod = 'findBy') - { - if (!$validateClass) { - $validateClass = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIdentEntity'; - } - if (!$uniqueFields) { - $uniqueFields = array('name'); - } - - $registry = $this->createRegistryMock($entityManagerName, $em); - - $uniqueValidator = new UniqueEntityValidator($registry); - - $metadata = new ClassMetadata($validateClass); - $constraint = new UniqueEntity(array( - 'fields' => $uniqueFields, - 'em' => $entityManagerName, - 'errorPath' => $errorPath, - 'repositoryMethod' => $repositoryMethod - )); - $metadata->addConstraint($constraint); - - $metadataFactory = $this->createMetadataFactoryMock($metadata); - $validatorFactory = $this->createValidatorFactory($uniqueValidator); - - return new Validator($metadataFactory, $validatorFactory); - } - - private function createSchema($em) - { - $schemaTool = new SchemaTool($em); - $schemaTool->createSchema(array( - $em->getClassMetadata('Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIdentEntity'), - $em->getClassMetadata('Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIdentEntity'), - $em->getClassMetadata('Symfony\Bridge\Doctrine\Tests\Fixtures\AssociationEntity'), - )); - } - - /** - * This is a functional test as there is a large integration necessary to get the validator working. - */ - public function testValidateUniqueness() - { - $entityManagerName = "foo"; - $em = $this->createTestEntityManager(); - $this->createSchema($em); - $validator = $this->createValidator($entityManagerName, $em); - - $entity1 = new SingleIdentEntity(1, 'Foo'); - $violationsList = $validator->validate($entity1); - $this->assertEquals(0, $violationsList->count(), "No violations found on entity before it is saved to the database."); - - $em->persist($entity1); - $em->flush(); - - $violationsList = $validator->validate($entity1); - $this->assertEquals(0, $violationsList->count(), "No violations found on entity after it was saved to the database."); - - $entity2 = new SingleIdentEntity(2, 'Foo'); - - $violationsList = $validator->validate($entity2); - $this->assertEquals(1, $violationsList->count(), "No violations found on entity after it was saved to the database."); - - $violation = $violationsList[0]; - $this->assertEquals('This value is already used.', $violation->getMessage()); - $this->assertEquals('name', $violation->getPropertyPath()); - $this->assertEquals('Foo', $violation->getInvalidValue()); - } - - public function testValidateCustomErrorPath() - { - $entityManagerName = "foo"; - $em = $this->createTestEntityManager(); - $this->createSchema($em); - $validator = $this->createValidator($entityManagerName, $em, null, null, 'bar'); - - $entity1 = new SingleIdentEntity(1, 'Foo'); - - $em->persist($entity1); - $em->flush(); - - $entity2 = new SingleIdentEntity(2, 'Foo'); - - $violationsList = $validator->validate($entity2); - $this->assertEquals(1, $violationsList->count(), "No violations found on entity after it was saved to the database."); - - $violation = $violationsList[0]; - $this->assertEquals('This value is already used.', $violation->getMessage()); - $this->assertEquals('bar', $violation->getPropertyPath()); - $this->assertEquals('Foo', $violation->getInvalidValue()); - } - - public function testValidateUniquenessWithNull() - { - $entityManagerName = "foo"; - $em = $this->createTestEntityManager(); - $this->createSchema($em); - $validator = $this->createValidator($entityManagerName, $em); - - $entity1 = new SingleIdentEntity(1, null); - $entity2 = new SingleIdentEntity(2, null); - - $em->persist($entity1); - $em->persist($entity2); - $em->flush(); - - $violationsList = $validator->validate($entity1); - $this->assertEquals(0, $violationsList->count(), "No violations found on entity having a null value."); - } - - public function testValidateUniquenessAfterConsideringMultipleQueryResults() - { - $entityManagerName = "foo"; - $em = $this->createTestEntityManager(); - $this->createSchema($em); - $validator = $this->createValidator($entityManagerName, $em); - - $entity1 = new SingleIdentEntity(1, 'foo'); - $entity2 = new SingleIdentEntity(2, 'foo'); - - $em->persist($entity1); - $em->persist($entity2); - $em->flush(); - - $violationsList = $validator->validate($entity1); - $this->assertEquals(1, $violationsList->count(), 'Violation found on entity with conflicting entity existing in the database.'); - - $violationsList = $validator->validate($entity2); - $this->assertEquals(1, $violationsList->count(), 'Violation found on entity with conflicting entity existing in the database.'); - } - - public function testValidateUniquenessUsingCustomRepositoryMethod() - { - $entityManagerName = 'foo'; - $repository = $this->createRepositoryMock(); - $repository->expects($this->once()) - ->method('findByCustom') - ->will($this->returnValue(array())) - ; - $em = $this->createEntityManagerMock($repository); - $validator = $this->createValidator($entityManagerName, $em, null, array(), null, 'findByCustom'); - - $entity1 = new SingleIdentEntity(1, 'foo'); - - $violationsList = $validator->validate($entity1); - $this->assertEquals(0, $violationsList->count(), 'Violation is using custom repository method.'); - } - - /** - * @group GH-1635 - */ - public function testAssociatedEntity() - { - $entityManagerName = "foo"; - $em = $this->createTestEntityManager(); - $this->createSchema($em); - $validator = $this->createValidator($entityManagerName, $em, 'Symfony\Bridge\Doctrine\Tests\Fixtures\AssociationEntity', array('single')); - - $entity1 = new SingleIdentEntity(1, 'foo'); - $associated = new AssociationEntity(); - $associated->single = $entity1; - - $em->persist($entity1); - $em->persist($associated); - $em->flush(); - - $violationsList = $validator->validate($associated); - $this->assertEquals(0, $violationsList->count()); - - $associated2 = new AssociationEntity(); - $associated2->single = $entity1; - - $em->persist($associated2); - $em->flush(); - - $violationsList = $validator->validate($associated2); - $this->assertEquals(1, $violationsList->count()); - } - - /** - * @group GH-1635 - */ - public function testAssociatedCompositeEntity() - { - $entityManagerName = "foo"; - $em = $this->createTestEntityManager(); - $this->createSchema($em); - $validator = $this->createValidator($entityManagerName, $em, 'Symfony\Bridge\Doctrine\Tests\Fixtures\AssociationEntity', array('composite')); - - $composite = new CompositeIdentEntity(1, 1, "test"); - $associated = new AssociationEntity(); - $associated->composite = $composite; - - $em->persist($composite); - $em->persist($associated); - $em->flush(); - - $this->setExpectedException( - 'Symfony\Component\Validator\Exception\ConstraintDefinitionException', - 'Associated entities are not allowed to have more than one identifier field' - ); - $violationsList = $validator->validate($associated); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/bootstrap.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/bootstrap.php deleted file mode 100644 index 994592e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Tests/bootstrap.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -spl_autoload_register($loader = function ($class) { - foreach (array( - 'SYMFONY_HTTP_FOUNDATION' => 'HttpFoundation', - 'SYMFONY_DEPENDENCY_INJECTION' => 'DependencyInjection', - 'SYMFONY_FORM' => 'Form', - 'SYMFONY_SECURITY' => 'Security', - 'SYMFONY_VALIDATOR' => 'Validator', - 'SYMFONY_HTTP_KERNEL' => 'HttpKernel', - 'SYMFONY_EVENT_DISPATCHER' => 'EventDispatcher', - ) as $env => $name) { - if (isset($_SERVER[$env]) && 0 === strpos(ltrim($class, '/'), 'Symfony\Component\\'.$name)) { - if (file_exists($file = $_SERVER[$env].'/'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\\'.$name)).'.php')) { - require_once $file; - } - } - } - - if (isset($_SERVER['SYMFONY_HTTP_FOUNDATION']) && 'SessionHandlerInterface' === ltrim($class, '/')) { - require_once $_SERVER['SYMFONY_HTTP_FOUNDATION'].'/Resources/stubs/SessionHandlerInterface.php'; - } - - if (isset($_SERVER['DOCTRINE_FIXTURES']) && 0 === strpos(ltrim($class, '/'), 'Doctrine\Common\DataFixtures')) { - if (file_exists($file = $_SERVER['DOCTRINE_FIXTURES'].'/lib/'.str_replace('\\', '/', $class).'.php')) { - require_once $file; - } - } - - if (isset($_SERVER['DOCTRINE_COMMON']) && 0 === strpos(ltrim($class, '/'), 'Doctrine\Common')) { - if (file_exists($file = $_SERVER['DOCTRINE_COMMON'].'/lib/'.str_replace('\\', '/', $class).'.php')) { - require_once $file; - } - } - - if (isset($_SERVER['DOCTRINE_DBAL']) && 0 === strpos(ltrim($class, '/'), 'Doctrine\DBAL')) { - if (file_exists($file = $_SERVER['DOCTRINE_DBAL'].'/lib/'.str_replace('\\', '/', $class).'.php')) { - require_once $file; - } - } - - if (isset($_SERVER['DOCTRINE_ORM']) && 0 === strpos(ltrim($class, '/'), 'Doctrine\ORM')) { - if (file_exists($file = $_SERVER['DOCTRINE_ORM'].'/lib/'.str_replace('\\', '/', $class).'.php')) { - require_once $file; - } - } - - if (0 === strpos(ltrim($class, '/'), 'Symfony\Bridge\Doctrine')) { - if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Bridge\Doctrine')).'.php')) { - require_once $file; - } - } -}); - -if (isset($_SERVER['DOCTRINE_COMMON'])) { - Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(function($class) use ($loader) { - $loader($class); - - return class_exists($class, false); - }); -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntity.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntity.php deleted file mode 100644 index ae4367f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntity.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; - -/** - * Constraint for the Unique Entity validator - * - * @Annotation - * @author Benjamin Eberlei - */ -class UniqueEntity extends Constraint -{ - public $message = 'This value is already used.'; - public $service = 'doctrine.orm.validator.unique'; - public $em = null; - public $repositoryMethod = 'findBy'; - public $fields = array(); - public $errorPath = null; - - public function getRequiredOptions() - { - return array('fields'); - } - - /** - * The validator must be defined as a service with this name. - * - * @return string - */ - public function validatedBy() - { - return $this->service; - } - - /** - * {@inheritDoc} - */ - public function getTargets() - { - return self::CLASS_CONSTRAINT; - } - - public function getDefaultOption() - { - return 'fields'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php deleted file mode 100644 index 81b68a9..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php +++ /dev/null @@ -1,125 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Validator\Constraints; - -use Doctrine\Common\Persistence\ManagerRegistry; -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\ConstraintDefinitionException; -use Symfony\Component\Validator\ConstraintValidator; - -/** - * Unique Entity Validator checks if one or a set of fields contain unique values. - * - * @author Benjamin Eberlei - */ -class UniqueEntityValidator extends ConstraintValidator -{ - /** - * @var ManagerRegistry - */ - private $registry; - - /** - * @param ManagerRegistry $registry - */ - public function __construct(ManagerRegistry $registry) - { - $this->registry = $registry; - } - - /** - * @param object $entity - * @param Constraint $constraint - */ - public function validate($entity, Constraint $constraint) - { - if (!is_array($constraint->fields) && !is_string($constraint->fields)) { - throw new UnexpectedTypeException($constraint->fields, 'array'); - } - - if (null !== $constraint->errorPath && !is_string($constraint->errorPath)) { - throw new UnexpectedTypeException($constraint->errorPath, 'string or null'); - } - - $fields = (array) $constraint->fields; - - if (0 === count($fields)) { - throw new ConstraintDefinitionException('At least one field has to be specified.'); - } - - if ($constraint->em) { - $em = $this->registry->getManager($constraint->em); - } else { - $em = $this->registry->getManagerForClass(get_class($entity)); - } - - $className = $this->context->getCurrentClass(); - $class = $em->getClassMetadata($className); - /* @var $class \Doctrine\Common\Persistence\Mapping\ClassMetadata */ - - $criteria = array(); - foreach ($fields as $fieldName) { - if (!$class->hasField($fieldName) && !$class->hasAssociation($fieldName)) { - throw new ConstraintDefinitionException("Only field names mapped by Doctrine can be validated for uniqueness."); - } - - $criteria[$fieldName] = $class->reflFields[$fieldName]->getValue($entity); - - if (null === $criteria[$fieldName]) { - return; - } - - if ($class->hasAssociation($fieldName)) { - /* Ensure the Proxy is initialized before using reflection to - * read its identifiers. This is necessary because the wrapped - * getter methods in the Proxy are being bypassed. - */ - $em->initializeObject($criteria[$fieldName]); - - $relatedClass = $em->getClassMetadata($class->getAssociationTargetClass($fieldName)); - $relatedId = $relatedClass->getIdentifierValues($criteria[$fieldName]); - - if (count($relatedId) > 1) { - throw new ConstraintDefinitionException( - "Associated entities are not allowed to have more than one identifier field to be " . - "part of a unique constraint in: " . $class->getName() . "#" . $fieldName - ); - } - $criteria[$fieldName] = array_pop($relatedId); - } - } - - $repository = $em->getRepository($className); - $result = $repository->{$constraint->repositoryMethod}($criteria); - - /* If the result is a MongoCursor, it must be advanced to the first - * element. Rewinding should have no ill effect if $result is another - * iterator implementation. - */ - if ($result instanceof \Iterator) { - $result->rewind(); - } - - /* If no entity matched the query criteria or a single entity matched, - * which is the same as the entity being validated, the criteria is - * unique. - */ - if (0 === count($result) || (1 === count($result) && $entity === ($result instanceof \Iterator ? $result->current() : current($result)))) { - return; - } - - $errorPath = null !== $constraint->errorPath ? $constraint->errorPath : $fields[0]; - - $this->context->addViolationAtSubPath($errorPath, $constraint->message, array(), $criteria[$fields[0]]); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Validator/DoctrineInitializer.php b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Validator/DoctrineInitializer.php deleted file mode 100644 index 42cafdd..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Validator/DoctrineInitializer.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Validator; - -use Doctrine\Common\Persistence\ManagerRegistry; -use Symfony\Component\Validator\ObjectInitializerInterface; - -/** - * Automatically loads proxy object before validation. - * - * @author Fabien Potencier - */ -class DoctrineInitializer implements ObjectInitializerInterface -{ - protected $registry; - - public function __construct(ManagerRegistry $registry) - { - $this->registry = $registry; - } - - public function initialize($object) - { - $manager = $this->registry->getManagerForClass(get_class($object)); - if (null !== $manager) { - $manager->initializeObject($object); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/composer.json b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/composer.json deleted file mode 100644 index df69458..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "symfony/doctrine-bridge", - "type": "symfony-bridge", - "description": "Symfony Doctrine Bridge", - "keywords": [], - "homepage": "http://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "require": { - "php": ">=5.3.3", - "doctrine/common": ">=2.2,<2.4-dev" - }, - "suggest": { - "symfony/form": "self.version", - "symfony/validator": "self.version", - "doctrine/data-fixtures": "1.0.*", - "doctrine/dbal": ">=2.2,<2.4-dev", - "doctrine/orm": ">=2.2,<2.4-dev" - }, - "autoload": { - "psr-0": { "Symfony\\Bridge\\Doctrine": "" } - }, - "target-dir": "Symfony/Bridge/Doctrine", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/phpunit.xml.dist b/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/phpunit.xml.dist deleted file mode 100644 index 779a6e0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/phpunit.xml.dist +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ./Tests/ - - - - - - ./ - - ./Resources - ./Tests - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/CHANGELOG.md b/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/CHANGELOG.md deleted file mode 100644 index 88ecedd..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/CHANGELOG.md +++ /dev/null @@ -1,7 +0,0 @@ -CHANGELOG -========= - -2.1.0 ------ - - * added ChromePhpHandler diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php b/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php deleted file mode 100644 index 81766d7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Monolog\Handler; - -use Monolog\Handler\ChromePHPHandler as BaseChromePhpHandler; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; -use Symfony\Component\HttpKernel\HttpKernelInterface; - -/** - * ChromePhpHandler. - * - * @author Christophe Coevoet - */ -class ChromePhpHandler extends BaseChromePhpHandler -{ - /** - * @var array - */ - private $headers = array(); - - /** - * @var Response - */ - private $response; - - /** - * Adds the headers to the response once it's created - */ - public function onKernelResponse(FilterResponseEvent $event) - { - if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { - return; - } - - if (!preg_match('{\bChrome/\d+[\.\d+]*\b}', $event->getRequest()->headers->get('User-Agent'))) { - - $this->sendHeaders = false; - $this->headers = array(); - - return; - } - - $this->response = $event->getResponse(); - foreach ($this->headers as $header => $content) { - $this->response->headers->set($header, $content); - } - $this->headers = array(); - } - - /** - * {@inheritDoc} - */ - protected function sendHeader($header, $content) - { - if (!$this->sendHeaders) { - return; - } - - if ($this->response) { - $this->response->headers->set($header, $content); - } else { - $this->headers[$header] = $content; - } - } - - /** - * Override default behavior since we check it in onKernelResponse - */ - protected function headersAccepted() - { - return true; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Handler/DebugHandler.php b/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Handler/DebugHandler.php deleted file mode 100644 index e1c1f51..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Handler/DebugHandler.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Monolog\Handler; - -use Monolog\Logger; -use Monolog\Handler\TestHandler; -use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; - -/** - * DebugLogger. - * - * @author Jordi Boggiano - */ -class DebugHandler extends TestHandler implements DebugLoggerInterface -{ - /** - * {@inheritdoc} - */ - public function getLogs() - { - $records = array(); - foreach ($this->records as $record) { - $records[] = array( - 'timestamp' => $record['datetime']->getTimestamp(), - 'message' => $record['message'], - 'priority' => $record['level'], - 'priorityName' => $record['level_name'], - 'context' => $record['context'], - ); - } - - return $records; - } - - /** - * {@inheritdoc} - */ - public function countErrors() - { - $cnt = 0; - foreach (array(Logger::ERROR, Logger::CRITICAL, Logger::ALERT) as $level) { - if (isset($this->recordsByLevel[$level])) { - $cnt += count($this->recordsByLevel[$level]); - } - } - - return $cnt; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php b/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php deleted file mode 100644 index f36cd9f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Monolog\Handler; - -use Monolog\Handler\FirePHPHandler as BaseFirePHPHandler; -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\HttpKernelInterface; - -/** - * FirePHPHandler. - * - * @author Jordi Boggiano - */ -class FirePHPHandler extends BaseFirePHPHandler -{ - /** - * @var array - */ - private $headers = array(); - - /** - * @var Response - */ - private $response; - - /** - * Adds the headers to the response once it's created - */ - public function onKernelResponse(FilterResponseEvent $event) - { - if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { - return; - } - - if (!preg_match('{\bFirePHP/\d+\.\d+\b}', $event->getRequest()->headers->get('User-Agent')) - && !$event->getRequest()->headers->has('X-FirePHP-Version')) { - - $this->sendHeaders = false; - $this->headers = array(); - - return; - } - - $this->response = $event->getResponse(); - foreach ($this->headers as $header => $content) { - $this->response->headers->set($header, $content); - } - $this->headers = array(); - } - - /** - * {@inheritDoc} - */ - protected function sendHeader($header, $content) - { - if (!$this->sendHeaders) { - return; - } - - if ($this->response) { - $this->response->headers->set($header, $content); - } else { - $this->headers[$header] = $content; - } - } - - /** - * Override default behavior since we check the user agent in onKernelResponse - */ - protected function headersAccepted() - { - return true; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/LICENSE b/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/LICENSE deleted file mode 100644 index cdffe7a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2012 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Logger.php b/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Logger.php deleted file mode 100644 index f818381..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Logger.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Monolog; - -use Monolog\Logger as BaseLogger; -use Symfony\Component\HttpKernel\Log\LoggerInterface; -use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; - -/** - * Logger. - * - * @author Fabien Potencier - */ -class Logger extends BaseLogger implements LoggerInterface, DebugLoggerInterface -{ - /** - * @see Symfony\Component\HttpKernel\Log\DebugLoggerInterface - */ - public function getLogs() - { - if ($logger = $this->getDebugLogger()) { - return $logger->getLogs(); - } - } - - /** - * @see Symfony\Component\HttpKernel\Log\DebugLoggerInterface - */ - public function countErrors() - { - if ($logger = $this->getDebugLogger()) { - return $logger->countErrors(); - } - } - - /** - * Returns a DebugLoggerInterface instance if one is registered with this logger. - * - * @return DebugLoggerInterface A DebugLoggerInterface instance or null if none is registered - */ - private function getDebugLogger() - { - foreach ($this->handlers as $handler) { - if ($handler instanceof DebugLoggerInterface) { - return $handler; - } - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Processor/WebProcessor.php b/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Processor/WebProcessor.php deleted file mode 100644 index aac05d2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Processor/WebProcessor.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Monolog\Processor; - -use Monolog\Processor\WebProcessor as BaseWebProcessor; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Event\GetResponseEvent; -use Symfony\Component\HttpKernel\HttpKernelInterface; - -/** - * WebProcessor override to read from the HttpFoundation's Request - * - * @author Jordi Boggiano - */ -class WebProcessor extends BaseWebProcessor -{ - public function __construct() - { - // Pass an empty array as the default null value would access $_SERVER - parent::__construct(array()); - } - - public function onKernelRequest(GetResponseEvent $event) - { - if (HttpKernelInterface::MASTER_REQUEST === $event->getRequestType()) { - $this->serverData = $event->getRequest()->server->all(); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/README.md b/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/README.md deleted file mode 100644 index 111f673..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/README.md +++ /dev/null @@ -1,18 +0,0 @@ -Monolog Bridge -============== - -Provides integration for Monolog with various Symfony2 components. - -Resources ---------- - -You can run the unit tests with the following command: - - phpunit -c src/Symfony/Bridge/Monolog/ - -If you also want to run the unit tests that depend on other Symfony -Components, declare the following environment variables before running -PHPUnit: - - export MONOLOG=../path/to/Monolog - export SYMFONY_HTTP_FOUNDATION=../path/to/HttpFoundation diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Tests/Processor/WebProcessorTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Tests/Processor/WebProcessorTest.php deleted file mode 100644 index caf764a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Tests/Processor/WebProcessorTest.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Monolog\Tests\Processor; - -use Monolog\Logger; -use Symfony\Bridge\Monolog\Processor\WebProcessor; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\HttpKernelInterface; - -class WebProcessorTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!class_exists('Monolog\\Logger')) { - $this->markTestSkipped('Monolog is not available.'); - } - } - - public function testUsesRequestServerData() - { - $server = array( - 'REQUEST_URI' => 'A', - 'REMOTE_ADDR' => 'B', - 'REQUEST_METHOD' => 'C', - 'SERVER_NAME' => 'D', - 'HTTP_REFERER' => 'E' - ); - - $request = new Request(); - $request->server->replace($server); - - $event = $this->getMockBuilder('Symfony\Component\HttpKernel\Event\GetResponseEvent') - ->disableOriginalConstructor() - ->getMock(); - $event->expects($this->any()) - ->method('getRequestType') - ->will($this->returnValue(HttpKernelInterface::MASTER_REQUEST)); - $event->expects($this->any()) - ->method('getRequest') - ->will($this->returnValue($request)); - - $processor = new WebProcessor(); - $processor->onKernelRequest($event); - $record = $processor($this->getRecord()); - - $this->assertEquals($server['REQUEST_URI'], $record['extra']['url']); - $this->assertEquals($server['REMOTE_ADDR'], $record['extra']['ip']); - $this->assertEquals($server['REQUEST_METHOD'], $record['extra']['http_method']); - $this->assertEquals($server['SERVER_NAME'], $record['extra']['server']); - $this->assertEquals($server['HTTP_REFERER'], $record['extra']['referrer']); - } - - /** - * @return array Record - */ - protected function getRecord($level = Logger::WARNING, $message = 'test') - { - return array( - 'message' => $message, - 'context' => array(), - 'level' => $level, - 'level_name' => Logger::getLevelName($level), - 'channel' => 'test', - 'datetime' => new \DateTime(), - 'extra' => array(), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Tests/bootstrap.php b/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Tests/bootstrap.php deleted file mode 100644 index 571a8ef..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/Tests/bootstrap.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -spl_autoload_register(function ($class) { - foreach (array( - 'SYMFONY_HTTP_FOUNDATION' => 'HttpFoundation', - ) as $env => $name) { - if (isset($_SERVER[$env]) && 0 === strpos(ltrim($class, '/'), 'Symfony\Component\\'.$name)) { - if (file_exists($file = $_SERVER[$env].'/'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\\'.$name)).'.php')) { - require_once $file; - } - } - } - - if (isset($_SERVER['MONOLOG']) && 0 === strpos(ltrim($class, '/'), 'Monolog')) { - if (file_exists($file = $_SERVER['MONOLOG'].'/src/'.str_replace('\\', '/', $class).'.php')) { - require_once $file; - } - } - - if (0 === strpos(ltrim($class, '/'), 'Symfony\Bridge\Monolog')) { - if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Bridge\Monolog')).'.php')) { - require_once $file; - } - } -}); diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/composer.json b/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/composer.json deleted file mode 100644 index 3375b49..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/composer.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "symfony/monolog-bridge", - "type": "symfony-bridge", - "description": "Symfony Monolog Bridge", - "keywords": [], - "homepage": "http://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "require": { - "php": ">=5.3.3", - "symfony/http-kernel": "self.version", - "monolog/monolog": "1.*" - }, - "autoload": { - "psr-0": { "Symfony\\Bridge\\Monolog": "" } - }, - "target-dir": "Symfony/Bridge/Monolog", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/phpunit.xml.dist b/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/phpunit.xml.dist deleted file mode 100644 index f26e3fa..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Monolog/phpunit.xml.dist +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ./Tests/ - - - - - - ./ - - ./Resources - ./Tests - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/CHANGELOG.md b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/CHANGELOG.md deleted file mode 100644 index e76b9f6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/CHANGELOG.md +++ /dev/null @@ -1,7 +0,0 @@ -CHANGELOG -========= - -2.1.0 ------ - - * added the bridge diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/DataCollector/PropelDataCollector.php b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/DataCollector/PropelDataCollector.php deleted file mode 100644 index 40f3687..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/DataCollector/PropelDataCollector.php +++ /dev/null @@ -1,145 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Propel1\DataCollector; - -use Symfony\Bridge\Propel1\Logger\PropelLogger; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\DataCollector\DataCollector; - -/** - * The PropelDataCollector collector class collects information. - * - * @author William Durand - */ -class PropelDataCollector extends DataCollector -{ - /** - * Propel logger - * @var \Symfony\Bridge\Propel1\Logger\PropelLogger - */ - private $logger; - - /** - * Propel configuration - * @var \PropelConfiguration - */ - protected $propelConfiguration; - - /** - * Constructor - * - * @param PropelLogger $logger A Propel logger. - * @param \PropelConfiguration $propelConfiguration The Propel configuration object. - */ - public function __construct(PropelLogger $logger, \PropelConfiguration $propelConfiguration) - { - $this->logger = $logger; - $this->propelConfiguration = $propelConfiguration; - } - - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Exception $exception = null) - { - $this->data = array( - 'queries' => $this->buildQueries(), - 'querycount' => $this->countQueries(), - ); - } - - /** - * Returns the collector name. - * - * @return string The collector name. - */ - public function getName() - { - return 'propel'; - } - - /** - * Returns queries. - * - * @return array Queries - */ - public function getQueries() - { - return $this->data['queries']; - } - - /** - * Returns the query count. - * - * @return int The query count - */ - public function getQueryCount() - { - return $this->data['querycount']; - } - - /** - * Returns the total time of queries. - * - * @return float The total time of queries - */ - public function getTime() - { - $time = 0; - foreach ($this->data['queries'] as $query) { - $time += (float) $query['time']; - } - - return $time; - } - - /** - * Creates an array of Build objects. - * - * @return array An array of Build objects - */ - private function buildQueries() - { - $queries = array(); - - $outerGlue = $this->propelConfiguration->getParameter('debugpdo.logging.outerglue', ' | '); - $innerGlue = $this->propelConfiguration->getParameter('debugpdo.logging.innerglue', ': '); - - foreach ($this->logger->getQueries() as $q) { - $parts = explode($outerGlue, $q, 4); - - $times = explode($innerGlue, $parts[0]); - $con = explode($innerGlue, $parts[2]); - $memories = explode($innerGlue, $parts[1]); - - $sql = trim($parts[3]); - $con = trim($con[1]); - $time = trim($times[1]); - $memory = trim($memories[1]); - - $queries[] = array('connection' => $con, 'sql' => $sql, 'time' => $time, 'memory' => $memory); - } - - return $queries; - } - - /** - * Count queries. - * - * @return int The number of queries. - */ - private function countQueries() - { - return count($this->logger->getQueries()); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/DependencyInjection/Security/UserProvider/PropelFactory.php b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/DependencyInjection/Security/UserProvider/PropelFactory.php deleted file mode 100644 index 2706d34..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/DependencyInjection/Security/UserProvider/PropelFactory.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Propel1\DependencyInjection\Security\UserProvider; - -use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\UserProviderFactoryInterface; -use Symfony\Component\Config\Definition\Builder\NodeDefinition; -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * PropelFactory creates services for Propel user provider. - * - * @author William Durand - */ -class PropelFactory implements UserProviderFactoryInterface -{ - private $key; - private $providerId; - - public function __construct($key, $providerId) - { - $this->key = $key; - $this->providerId = $providerId; - } - - public function create(ContainerBuilder $container, $id, $config) - { - $container - ->setDefinition($id, new DefinitionDecorator($this->providerId)) - ->addArgument($config['class']) - ->addArgument($config['property']) - ; - } - - public function getKey() - { - return $this->key; - } - - public function addConfiguration(NodeDefinition $node) - { - $node - ->children() - ->scalarNode('class')->isRequired()->cannotBeEmpty()->end() - ->scalarNode('property')->defaultNull()->end() - ->end() - ; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php deleted file mode 100644 index 54fe224..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php +++ /dev/null @@ -1,354 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Propel1\Form\ChoiceList; - -use \BaseObject; -use \Persistent; -use Symfony\Component\Form\Exception\FormException; -use Symfony\Component\Form\Exception\StringCastException; -use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList; - -/** - * Widely inspirated by the EntityChoiceList. - * - * @author William Durand - */ -class ModelChoiceList extends ObjectChoiceList -{ - /** - * The fields of which the identifier of the underlying class consists - * - * This property should only be accessed through identifier. - * - * @var array - */ - private $identifier = array(); - - /** - * Query - */ - private $query = null; - - /** - * Whether the model objects have already been loaded. - * - * @var Boolean - */ - private $loaded = false; - - /** - * @param string $class - * @param string $labelPath - * @param array $choices - * @param \ModelCriteria $queryObject - * @param string $groupPath - */ - public function __construct($class, $labelPath = null, $choices = null, $queryObject = null, $groupPath = null) - { - $this->class = $class; - - $queryClass = $this->class . 'Query'; - $query = new $queryClass(); - - $this->identifier = $query->getTableMap()->getPrimaryKeys(); - $this->query = $queryObject ?: $query; - $this->loaded = is_array($choices) || $choices instanceof \Traversable; - - if (!$this->loaded) { - // Make sure the constraints of the parent constructor are - // fulfilled - $choices = array(); - } - - parent::__construct($choices, $labelPath, array(), $groupPath); - } - - /** - * Returns the class name - * - * @return string - */ - public function getClass() - { - return $this->class; - } - - /** - * Returns the list of model objects - * - * @return array - * - * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface - */ - public function getChoices() - { - if (!$this->loaded) { - $this->load(); - } - - return parent::getChoices(); - } - - /** - * Returns the values for the model objects - * - * @return array - * - * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface - */ - public function getValues() - { - if (!$this->loaded) { - $this->load(); - } - - return parent::getValues(); - } - - /** - * Returns the choice views of the preferred choices as nested array with - * the choice groups as top-level keys. - * - * @return array - * - * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface - */ - public function getPreferredViews() - { - if (!$this->loaded) { - $this->load(); - } - - return parent::getPreferredViews(); - } - - /** - * Returns the choice views of the choices that are not preferred as nested - * array with the choice groups as top-level keys. - * - * @return array - * - * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface - */ - public function getRemainingViews() - { - if (!$this->loaded) { - $this->load(); - } - - return parent::getRemainingViews(); - } - - /** - * Returns the model objects corresponding to the given values. - * - * @param array $values - * - * @return array - * - * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface - */ - public function getChoicesForValues(array $values) - { - if (!$this->loaded) { - if (1 === count($this->identifier)) { - $filterBy = 'filterBy' . current($this->identifier)->getPhpName(); - - return (array) $this->query->create() - ->$filterBy($values) - ->find(); - } - - $this->load(); - } - - return parent::getChoicesForValues($values); - } - - /** - * Returns the values corresponding to the given model objects. - * - * @param array $models - * - * @return array - * - * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface - */ - public function getValuesForChoices(array $models) - { - if (!$this->loaded) { - // Optimize performance for single-field identifiers. We already - // know that the IDs are used as values - - // Attention: This optimization does not check choices for existence - if (1 === count($this->identifier)) { - $values = array(); - foreach ($models as $model) { - if ($model instanceof $this->class) { - // Make sure to convert to the right format - $values[] = $this->fixValue(current($this->getIdentifierValues($model))); - } - } - - return $values; - } - - $this->load(); - } - - return parent::getValuesForChoices($models); - } - - /** - * Returns the indices corresponding to the given models. - * - * @param array $models - * - * @return array - * - * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface - */ - public function getIndicesForChoices(array $models) - { - if (!$this->loaded) { - // Optimize performance for single-field identifiers. We already - // know that the IDs are used as indices - - // Attention: This optimization does not check choices for existence - if (1 === count($this->identifier)) { - $indices = array(); - - foreach ($models as $model) { - if ($model instanceof $this->class) { - // Make sure to convert to the right format - $indices[] = $this->fixIndex(current($this->getIdentifierValues($model))); - } - } - - return $indices; - } - - $this->load(); - } - - return parent::getIndicesForChoices($models); - } - - /** - * Returns the models corresponding to the given values. - * - * @param array $values - * - * @return array - * - * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface - */ - public function getIndicesForValues(array $values) - { - if (!$this->loaded) { - // Optimize performance for single-field identifiers. We already - // know that the IDs are used as indices and values - - // Attention: This optimization does not check values for existence - if (1 === count($this->identifier)) { - return $this->fixIndices($values); - } - - $this->load(); - } - - return parent::getIndicesForValues($values); - } - - /** - * Creates a new unique index for this model. - * - * If the model has a single-field identifier, this identifier is used. - * - * Otherwise a new integer is generated. - * - * @param mixed $model The choice to create an index for - * - * @return integer|string A unique index containing only ASCII letters, - * digits and underscores. - */ - protected function createIndex($model) - { - if (1 === count($this->identifier)) { - return current($this->getIdentifierValues($model)); - } - - return parent::createIndex($model); - } - - /** - * Creates a new unique value for this model. - * - * If the model has a single-field identifier, this identifier is used. - * - * Otherwise a new integer is generated. - * - * @param mixed $model The choice to create a value for - * - * @return integer|string A unique value without character limitations. - */ - protected function createValue($model) - { - if (1 === count($this->identifier)) { - return (string) current($this->getIdentifierValues($model)); - } - - return parent::createValue($model); - } - - /** - * Loads the list with model objects. - */ - private function load() - { - $models = (array) $this->query->find(); - - try { - // The second parameter $labels is ignored by ObjectChoiceList - // The third parameter $preferredChoices is currently not supported - parent::initialize($models, array(), array()); - } catch (StringCastException $e) { - throw new StringCastException(str_replace('argument $labelPath', 'option "property"', $e->getMessage()), null, $e); - } - - $this->loaded = true; - } - - /** - * Returns the values of the identifier fields of an model - * - * Propel must know about this model, that is, the model must already - * be persisted or added to the idmodel map before. Otherwise an - * exception is thrown. - * - * @param object $model The model for which to get the identifier - * @throws FormException If the model does not exist - */ - private function getIdentifierValues($model) - { - if ($model instanceof Persistent) { - return array($model->getPrimaryKey()); - } - - // readonly="true" models do not implement Persistent. - if ($model instanceof BaseObject and method_exists($model, 'getPrimaryKey')) { - return array($model->getPrimaryKey()); - } - - return $model->getPrimaryKeys(); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Form/DataTransformer/CollectionToArrayTransformer.php b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Form/DataTransformer/CollectionToArrayTransformer.php deleted file mode 100644 index 9d3b61f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Form/DataTransformer/CollectionToArrayTransformer.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Propel1\Form\DataTransformer; - -use \PropelObjectCollection; -use Symfony\Component\Form\DataTransformerInterface; -use Symfony\Component\Form\Exception\UnexpectedTypeException; - -/** - * CollectionToArrayTransformer class. - * - * @author William Durand - * @author Pierre-Yves Lebecq - */ -class CollectionToArrayTransformer implements DataTransformerInterface -{ - public function transform($collection) - { - if (null === $collection) { - return array(); - } - - if (!$collection instanceof PropelObjectCollection) { - throw new UnexpectedTypeException($collection, '\PropelObjectCollection'); - } - - return $collection->getData(); - } - - public function reverseTransform($array) - { - $collection = new PropelObjectCollection(); - - if ('' === $array || null === $array) { - return $collection; - } - - if (!is_array($array)) { - throw new UnexpectedTypeException($array, 'array'); - } - - $collection->setData($array); - - return $collection; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Form/PropelExtension.php b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Form/PropelExtension.php deleted file mode 100644 index 3df2afd..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Form/PropelExtension.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Propel1\Form; - -use Symfony\Component\Form\AbstractExtension; - -/** - * Represents the Propel form extension, which loads the Propel functionality. - * - * @author Joseph Rouff - */ -class PropelExtension extends AbstractExtension -{ - protected function loadTypes() - { - return array( - new Type\ModelType(), - ); - } - - protected function loadTypeGuesser() - { - return new PropelTypeGuesser(); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Form/PropelTypeGuesser.php b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Form/PropelTypeGuesser.php deleted file mode 100644 index 4ee475e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Form/PropelTypeGuesser.php +++ /dev/null @@ -1,172 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Propel1\Form; - -use Symfony\Component\Form\FormTypeGuesserInterface; -use Symfony\Component\Form\Guess\Guess; -use Symfony\Component\Form\Guess\TypeGuess; -use Symfony\Component\Form\Guess\ValueGuess; - -/** - * Propel Type guesser. - * - * @author Fabien Potencier - */ -class PropelTypeGuesser implements FormTypeGuesserInterface -{ - private $cache = array(); - - /** - * {@inheritDoc} - */ - public function guessType($class, $property) - { - if (!$table = $this->getTable($class)) { - return new TypeGuess('text', array(), Guess::LOW_CONFIDENCE); - } - - foreach ($table->getRelations() as $relation) { - if (in_array($relation->getType(), array(\RelationMap::MANY_TO_ONE, \RelationMap::ONE_TO_MANY))) { - if ($property == $relation->getForeignTable()->getName()) { - return new TypeGuess('model', array( - 'class' => $relation->getForeignTable()->getClassName(), - 'multiple' => \RelationMap::MANY_TO_ONE === $relation->getType() ? false : true, - ), Guess::HIGH_CONFIDENCE); - } - } elseif ($relation->getType() === \RelationMap::MANY_TO_MANY) { - if (strtolower($property) == strtolower($relation->getPluralName())) { - return new TypeGuess('model', array( - 'class' => $relation->getLocalTable()->getClassName(), - 'multiple' => true, - ), Guess::HIGH_CONFIDENCE); - } - } - } - - if (!$column = $this->getColumn($class, $property)) { - return new TypeGuess('text', array(), Guess::LOW_CONFIDENCE); - } - - switch ($column->getType()) { - case \PropelColumnTypes::BOOLEAN: - case \PropelColumnTypes::BOOLEAN_EMU: - return new TypeGuess('checkbox', array(), Guess::HIGH_CONFIDENCE); - case \PropelColumnTypes::TIMESTAMP: - case \PropelColumnTypes::BU_TIMESTAMP: - return new TypeGuess('datetime', array(), Guess::HIGH_CONFIDENCE); - case \PropelColumnTypes::DATE: - case \PropelColumnTypes::BU_DATE: - return new TypeGuess('date', array(), Guess::HIGH_CONFIDENCE); - case \PropelColumnTypes::TIME: - return new TypeGuess('time', array(), Guess::HIGH_CONFIDENCE); - case \PropelColumnTypes::FLOAT: - case \PropelColumnTypes::REAL: - case \PropelColumnTypes::DOUBLE: - case \PropelColumnTypes::DECIMAL: - return new TypeGuess('number', array(), Guess::MEDIUM_CONFIDENCE); - case \PropelColumnTypes::TINYINT: - case \PropelColumnTypes::SMALLINT: - case \PropelColumnTypes::INTEGER: - case \PropelColumnTypes::BIGINT: - case \PropelColumnTypes::NUMERIC: - return new TypeGuess('integer', array(), Guess::MEDIUM_CONFIDENCE); - case \PropelColumnTypes::CHAR: - case \PropelColumnTypes::VARCHAR: - return new TypeGuess('text', array(), Guess::MEDIUM_CONFIDENCE); - case \PropelColumnTypes::LONGVARCHAR: - case \PropelColumnTypes::BLOB: - case \PropelColumnTypes::CLOB: - case \PropelColumnTypes::CLOB_EMU: - return new TypeGuess('textarea', array(), Guess::MEDIUM_CONFIDENCE); - default: - return new TypeGuess('text', array(), Guess::LOW_CONFIDENCE); - } - } - - /** - * {@inheritDoc} - */ - public function guessRequired($class, $property) - { - if ($column = $this->getColumn($class, $property)) { - return new ValueGuess($column->isNotNull(), Guess::HIGH_CONFIDENCE); - } - } - - /** - * {@inheritDoc} - */ - public function guessMaxLength($class, $property) - { - if ($column = $this->getColumn($class, $property)) { - if ($column->isText()) { - return new ValueGuess($column->getSize(), Guess::HIGH_CONFIDENCE); - } - switch ($column->getType()) { - case \PropelColumnTypes::FLOAT: - case \PropelColumnTypes::REAL: - case \PropelColumnTypes::DOUBLE: - case \PropelColumnTypes::DECIMAL: - return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE); - } - } - } - - /** - * {@inheritDoc} - */ - public function guessMinLength($class, $property) - { - } - - /** - * {@inheritDoc} - */ - public function guessPattern($class, $property) - { - if ($column = $this->getColumn($class, $property)) { - switch ($column->getType()) { - case \PropelColumnTypes::FLOAT: - case \PropelColumnTypes::REAL: - case \PropelColumnTypes::DOUBLE: - case \PropelColumnTypes::DECIMAL: - return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE); - } - } - } - - protected function getTable($class) - { - if (isset($this->cache[$class])) { - return $this->cache[$class]; - } - - if (class_exists($queryClass = $class.'Query')) { - $query = new $queryClass(); - - return $this->cache[$class] = $query->getTableMap(); - } - } - - protected function getColumn($class, $property) - { - if (isset($this->cache[$class.'::'.$property])) { - return $this->cache[$class.'::'.$property]; - } - - $table = $this->getTable($class); - - if ($table && $table->hasColumn($property)) { - return $this->cache[$class.'::'.$property] = $table->getColumn($property); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Form/Type/ModelType.php b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Form/Type/ModelType.php deleted file mode 100644 index 820153c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Form/Type/ModelType.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Propel1\Form\Type; - -use Symfony\Bridge\Propel1\Form\ChoiceList\ModelChoiceList; -use Symfony\Bridge\Propel1\Form\DataTransformer\CollectionToArrayTransformer; -use Symfony\Component\Form\AbstractType; -use Symfony\Component\Form\FormBuilderInterface; -use Symfony\Component\OptionsResolver\Options; -use Symfony\Component\OptionsResolver\OptionsResolverInterface; - -/** - * ModelType class. - * - * @author William Durand - */ -class ModelType extends AbstractType -{ - public function buildForm(FormBuilderInterface $builder, array $options) - { - if ($options['multiple']) { - $builder->addViewTransformer(new CollectionToArrayTransformer(), true); - } - } - - public function setDefaultOptions(OptionsResolverInterface $resolver) - { - $choiceList = function (Options $options) { - return new ModelChoiceList( - $options['class'], - $options['property'], - $options['choices'], - $options['query'], - $options['group_by'] - ); - }; - - $resolver->setDefaults(array( - 'template' => 'choice', - 'multiple' => false, - 'expanded' => false, - 'class' => null, - 'property' => null, - 'query' => null, - 'choices' => null, - 'choice_list' => $choiceList, - 'group_by' => null, - 'by_reference' => false, - )); - } - - public function getParent() - { - return 'choice'; - } - - public function getName() - { - return 'model'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/LICENSE b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/LICENSE deleted file mode 100644 index cdffe7a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2012 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Logger/PropelLogger.php b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Logger/PropelLogger.php deleted file mode 100644 index 43211a0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Logger/PropelLogger.php +++ /dev/null @@ -1,170 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Propel1\Logger; - -use Symfony\Component\HttpKernel\Debug\Stopwatch; -use Symfony\Component\HttpKernel\Log\LoggerInterface; - -/** - * PropelLogger. - * - * @author Fabien Potencier - * @author William Durand - */ -class PropelLogger -{ - /** - * @var LoggerInterface - */ - protected $logger; - - /** - * @var array - */ - protected $queries; - - /** - * @var \Symfony\Component\HttpKernel\Debug\Stopwatch - */ - protected $stopwatch; - - private $isPrepared; - - /** - * Constructor. - * - * @param LoggerInterface $logger A LoggerInterface instance - * @param Stopwatch $stopwatch A Stopwatch instance - */ - public function __construct(LoggerInterface $logger = null, Stopwatch $stopwatch = null) - { - $this->logger = $logger; - $this->queries = array(); - $this->stopwatch = $stopwatch; - $this->isPrepared = false; - } - - /** - * A convenience function for logging an alert event. - * - * @param mixed $message the message to log. - */ - public function alert($message) - { - if (null !== $this->logger) { - $this->logger->alert($message); - } - } - - /** - * A convenience function for logging a critical event. - * - * @param mixed $message the message to log. - */ - public function crit($message) - { - if (null !== $this->logger) { - $this->logger->crit($message); - } - } - - /** - * A convenience function for logging an error event. - * - * @param mixed $message the message to log. - */ - public function err($message) - { - if (null !== $this->logger) { - $this->logger->err($message); - } - } - - /** - * A convenience function for logging a warning event. - * - * @param mixed $message the message to log. - */ - public function warning($message) - { - if (null !== $this->logger) { - $this->logger->warn($message); - } - } - - /** - * A convenience function for logging an critical event. - * - * @param mixed $message the message to log. - */ - public function notice($message) - { - if (null !== $this->logger) { - $this->logger->notice($message); - } - } - - /** - * A convenience function for logging an critical event. - * - * @param mixed $message the message to log. - */ - public function info($message) - { - if (null !== $this->logger) { - $this->logger->info($message); - } - } - - /** - * A convenience function for logging a debug event. - * - * @param mixed $message the message to log. - */ - public function debug($message) - { - $add = true; - - if (null !== $this->stopwatch) { - $trace = debug_backtrace(); - $method = $trace[2]['args'][2]; - - $watch = 'Propel Query '.(count($this->queries)+1); - if ('PropelPDO::prepare' === $method) { - $this->isPrepared = true; - $this->stopwatch->start($watch, 'propel'); - - $add = false; - } elseif ($this->isPrepared) { - $this->isPrepared = false; - $this->stopwatch->stop($watch); - } - } - - if ($add) { - $this->queries[] = $message; - if (null !== $this->logger) { - $this->logger->debug($message); - } - } - } - - /** - * Returns queries. - * - * @return array Queries - */ - public function getQueries() - { - return $this->queries; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/README.md b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/README.md deleted file mode 100644 index f3ca773..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/README.md +++ /dev/null @@ -1,20 +0,0 @@ -Propel Bridge -============= - -Provides integration for Propel with various Symfony2 components. - -Resources ---------- - -You can run the unit tests with the following command: - - phpunit -c src/Symfony/Bridge/Propel/ - -If you also want to run the unit tests that depend on other Symfony -Components, declare the following environment variables before running -PHPUnit: - - export PROPEL1=../path/to/Propel - export SYMFONY_HTTP_FOUNDATION=../path/to/HttpFoundation - export SYMFONY_HTTP_KERNEL=../path/to/HttpKernel - export SYMFONY_FORM=../path/to/Form diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Security/User/PropelUserProvider.php b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Security/User/PropelUserProvider.php deleted file mode 100644 index 4392bb4..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Security/User/PropelUserProvider.php +++ /dev/null @@ -1,100 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Propel1\Security\User; - -use Symfony\Component\Security\Core\User\UserInterface; -use Symfony\Component\Security\Core\User\UserProviderInterface; -use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; -use Symfony\Component\Security\Core\Exception\UnsupportedUserException; - -/** - * Provides easy to use provisioning for Propel model users. - * - * @author William DURAND - */ -class PropelUserProvider implements UserProviderInterface -{ - /** - * A Model class name. - * @var string - */ - protected $class; - - /** - * A Query class name. - * @var string - */ - protected $queryClass; - - /** - * A property to use to retrieve the user. - * @var string - */ - protected $property; - - /** - * Default constructor - * - * @param $class The User model class. - * @param $property The property to use to retrieve a user. - */ - public function __construct($class, $property = null) - { - $this->class = $class; - $this->queryClass = $class . 'Query'; - $this->property = $property; - } - - /** - * {@inheritdoc} - */ - public function loadUserByUsername($username) - { - $queryClass = $this->queryClass; - $query = $queryClass::create(); - - if (null !== $this->property) { - $filter = 'filterBy' . ucfirst($this->property); - $query->$filter($username); - } else { - $query->filterByUsername($username); - } - - if (null === $user = $query->findOne()) { - throw new UsernameNotFoundException(sprintf('User "%s" not found.', $username)); - } - - return $user; - } - - /** - * {@inheritdoc} - */ - public function refreshUser(UserInterface $user) - { - if (!$user instanceof $this->class) { - throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', get_class($user))); - } - - $queryClass = $this->queryClass; - - return $queryClass::create()->findPk($user->getPrimaryKey()); - } - - /** - * {@inheritdoc} - */ - public function supportsClass($class) - { - return $class === $this->class; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/DataCollector/PropelDataCollectorTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/DataCollector/PropelDataCollectorTest.php deleted file mode 100644 index 23d6fc9..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/DataCollector/PropelDataCollectorTest.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Propel1\Tests\DataCollector; - -use Symfony\Bridge\Propel1\DataCollector\PropelDataCollector; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Bridge\Propel1\Tests\Propel1TestCase; - -class PropelDataCollectorTest extends Propel1TestCase -{ - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - - public function testCollectWithoutData() - { - $c = $this->createCollector(array()); - $c->collect(new Request(), new Response()); - - $this->assertEquals(array(), $c->getQueries()); - $this->assertEquals(0, $c->getQueryCount()); - } - - public function testCollectWithData() - { - $queries = array( - "time: 0.000 sec | mem: 1.4 MB | connection: default | SET NAMES 'utf8'", - ); - - $c = $this->createCollector($queries); - $c->collect(new Request(), new Response()); - - $this->assertEquals(array( - array( - 'sql' => "SET NAMES 'utf8'", - 'time' => '0.000 sec', - 'connection'=> 'default', - 'memory' => '1.4 MB' - ) - ), $c->getQueries()); - $this->assertEquals(1, $c->getQueryCount()); - } - - public function testCollectWithMultipleData() - { - $queries = array( - "time: 0.000 sec | mem: 1.4 MB | connection: default | SET NAMES 'utf8'", - "time: 0.012 sec | mem: 2.4 MB | connection: default | SELECT tags.NAME, image.FILENAME FROM tags LEFT JOIN image ON tags.IMAGEID = image.ID WHERE image.ID = 12", - "time: 0.012 sec | mem: 2.4 MB | connection: default | INSERT INTO `table` (`some_array`) VALUES ('| 1 | 2 | 3 |')", - ); - - $c = $this->createCollector($queries); - $c->collect(new Request(), new Response()); - - $this->assertEquals(array( - array( - 'sql' => "SET NAMES 'utf8'", - 'time' => '0.000 sec', - 'connection'=> 'default', - 'memory' => '1.4 MB' - ), - array( - 'sql' => "SELECT tags.NAME, image.FILENAME FROM tags LEFT JOIN image ON tags.IMAGEID = image.ID WHERE image.ID = 12", - 'time' => '0.012 sec', - 'connection'=> 'default', - 'memory' => '2.4 MB' - ), - array( - 'sql' => "INSERT INTO `table` (`some_array`) VALUES ('| 1 | 2 | 3 |')", - 'time' => '0.012 sec', - 'connection'=> 'default', - 'memory' => '2.4 MB' - ), - ), $c->getQueries()); - $this->assertEquals(3, $c->getQueryCount()); - $this->assertEquals(0.024, $c->getTime()); - } - - private function createCollector($queries) - { - $config = $this->getMock('\PropelConfiguration'); - $config - ->expects($this->any()) - ->method('getParameter') - ->will($this->returnArgument(1)) - ; - - $logger = $this->getMock('\Symfony\Bridge\Propel1\Logger\PropelLogger'); - $logger - ->expects($this->any()) - ->method('getQueries') - ->will($this->returnValue($queries)) - ; - - return new PropelDataCollector($logger, $config); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Fixtures/Column.php b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Fixtures/Column.php deleted file mode 100644 index 6b03977..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Fixtures/Column.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Propel1\Tests\Fixtures; - -class Column -{ - private $name; - - private $type; - - public function __construct($name, $type) - { - $this->name = $name; - $this->type = $type; - } - - public function getType() - { - return $this->type; - } - - public function isText() - { - if (!$this->type) { - return false; - } - - switch ($this->type) { - case \PropelColumnTypes::CHAR: - case \PropelColumnTypes::VARCHAR: - case \PropelColumnTypes::LONGVARCHAR: - case \PropelColumnTypes::BLOB: - case \PropelColumnTypes::CLOB: - case \PropelColumnTypes::CLOB_EMU: - return true; - } - - return false; - } - - public function getSize() - { - return $this->isText() ? 255 : 0; - } - - public function isNotNull() - { - return ('id' === $this->name); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Fixtures/Item.php b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Fixtures/Item.php deleted file mode 100644 index 70705b6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Fixtures/Item.php +++ /dev/null @@ -1,108 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Propel1\Tests\Fixtures; - -use \PropelPDO; - -class Item implements \Persistent -{ - private $id; - - private $value; - - private $groupName; - - private $price; - - public function __construct($id = null, $value = null, $groupName = null, $price = null) - { - $this->id = $id; - $this->value = $value; - $this->groupName = $groupName; - $this->price = $price; - } - - public function getId() - { - return $this->id; - } - - public function setId($id) - { - $this->id = $id; - } - - public function getValue() - { - return $this->value; - } - - public function getGroupName() - { - return $this->groupName; - } - - public function getPrice() - { - return $this->price; - } - - public function getPrimaryKey() - { - return $this->getId(); - } - - public function setPrimaryKey($primaryKey) - { - $this->setId($primaryKey); - } - - public function isModified() - { - return false; - } - - public function isColumnModified($col) - { - return false; - } - - public function isNew() - { - return false; - } - - public function setNew($b) - { - } - - public function resetModified() - { - } - - public function isDeleted() - { - return false; - } - - public function setDeleted($b) - { - } - - public function delete(PropelPDO $con = null) - { - } - - public function save(PropelPDO $con = null) - { - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Fixtures/ItemQuery.php b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Fixtures/ItemQuery.php deleted file mode 100644 index 75d2a4f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Fixtures/ItemQuery.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Propel1\Tests\Fixtures; - -class ItemQuery -{ - private $map = array( - 'id' => \PropelColumnTypes::INTEGER, - 'value' => \PropelColumnTypes::VARCHAR, - 'price' => \PropelColumnTypes::FLOAT, - 'is_active' => \PropelColumnTypes::BOOLEAN, - 'enabled' => \PropelColumnTypes::BOOLEAN_EMU, - 'updated_at' => \PropelColumnTypes::TIMESTAMP, - ); - - public function getTableMap() - { - // Allows to define methods in this class - // to avoid a lot of mock classes - return $this; - } - - public function getPrimaryKeys() - { - return array('id'); - } - - /** - * Method from the TableMap API - */ - public function hasColumn($column) - { - return in_array($column, array_keys($this->map)); - } - - /** - * Method from the TableMap API - */ - public function getColumn($column) - { - if ($this->hasColumn($column)) { - return new Column($column, $this->map[$column]); - } - - return null; - } - - /** - * Method from the TableMap API - */ - public function getRelations() - { - return array(); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Fixtures/ReadOnlyItem.php b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Fixtures/ReadOnlyItem.php deleted file mode 100644 index fbedf25..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Fixtures/ReadOnlyItem.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Propel1\Tests\Fixtures; - -class ReadOnlyItem extends \BaseObject -{ - public function getName() - { - return 'Marvin'; - } - - public function getPrimaryKey() - { - return 42; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Fixtures/ReadOnlyItemQuery.php b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Fixtures/ReadOnlyItemQuery.php deleted file mode 100644 index 8c9677f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Fixtures/ReadOnlyItemQuery.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Propel1\Tests\Fixtures; - -class ReadOnlyItemQuery -{ - public function getTableMap() - { - // Allows to define methods in this class - // to avoid a lot of mock classes - return $this; - } - - public function getPrimaryKeys() - { - return array('id'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/ModelChoiceListTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/ModelChoiceListTest.php deleted file mode 100644 index 68f690d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/ModelChoiceListTest.php +++ /dev/null @@ -1,161 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Propel1\Tests\Form\ChoiceList; - -use Symfony\Bridge\Propel1\Form\ChoiceList\ModelChoiceList; -use Symfony\Component\Form\Extension\Core\View\ChoiceView; -use Symfony\Bridge\Propel1\Tests\Fixtures\Item; -use Symfony\Bridge\Propel1\Tests\Fixtures\ReadOnlyItem; -use Symfony\Bridge\Propel1\Tests\Propel1TestCase; - -class ModelChoiceListTest extends Propel1TestCase -{ - const ITEM_CLASS = '\Symfony\Bridge\Propel1\Tests\Fixtures\Item'; - - protected function setUp() - { - if (!class_exists('Symfony\Component\Form\Form')) { - $this->markTestSkipped('The "Form" component is not available'); - } - } - - public function testEmptyChoicesReturnsEmpty() - { - $choiceList = new ModelChoiceList( - self::ITEM_CLASS, - 'value', - array() - ); - - $this->assertSame(array(), $choiceList->getChoices()); - } - - public function testReadOnlyIsValidChoice() - { - $item = new ReadOnlyItem(); - $choiceList = new ModelChoiceList( - '\Symfony\Bridge\Propel1\Tests\Fixtures\ReadOnlyItem', - 'name', - array( - $item, - ) - ); - - $this->assertSame(array(42 => $item), $choiceList->getChoices()); - } - - public function testFlattenedChoices() - { - $item1 = new Item(1, 'Foo'); - $item2 = new Item(2, 'Bar'); - - $choiceList = new ModelChoiceList( - self::ITEM_CLASS, - 'value', - array( - $item1, - $item2, - ) - ); - - $this->assertSame(array(1 => $item1, 2 => $item2), $choiceList->getChoices()); - } - - public function testNestedChoices() - { - $item1 = new Item(1, 'Foo'); - $item2 = new Item(2, 'Bar'); - - $choiceList = new ModelChoiceList( - self::ITEM_CLASS, - 'value', - array( - 'group1' => array($item1), - 'group2' => array($item2), - ) - ); - - $this->assertSame(array(1 => $item1, 2 => $item2), $choiceList->getChoices()); - $this->assertEquals(array( - 'group1' => array(1 => new ChoiceView($item1, '1', 'Foo')), - 'group2' => array(2 => new ChoiceView($item2, '2', 'Bar')) - ), $choiceList->getRemainingViews()); - } - - public function testGroupBySupportsString() - { - $item1 = new Item(1, 'Foo', 'Group1'); - $item2 = new Item(2, 'Bar', 'Group1'); - $item3 = new Item(3, 'Baz', 'Group2'); - $item4 = new Item(4, 'Boo!', null); - - $choiceList = new ModelChoiceList( - self::ITEM_CLASS, - 'value', - array( - $item1, - $item2, - $item3, - $item4, - ), - null, - 'groupName' - ); - - $this->assertEquals(array(1 => $item1, 2 => $item2, 3 => $item3, 4 => $item4), $choiceList->getChoices()); - $this->assertEquals(array( - 'Group1' => array(1 => new ChoiceView($item1, '1', 'Foo'), 2 => new ChoiceView($item2, '2', 'Bar')), - 'Group2' => array(3 => new ChoiceView($item3, '3', 'Baz')), - 4 => new ChoiceView($item4, '4', 'Boo!') - ), $choiceList->getRemainingViews()); - } - - public function testGroupByInvalidPropertyPathReturnsFlatChoices() - { - $item1 = new Item(1, 'Foo', 'Group1'); - $item2 = new Item(2, 'Bar', 'Group1'); - - $choiceList = new ModelChoiceList( - self::ITEM_CLASS, - 'value', - array( - $item1, - $item2, - ), - null, - 'child.that.does.not.exist' - ); - - $this->assertEquals(array( - 1 => $item1, - 2 => $item2 - ), $choiceList->getChoices()); - } - - public function testGetValuesForChoices() - { - $item1 = new Item(1, 'Foo'); - $item2 = new Item(2, 'Bar'); - - $choiceList = new ModelChoiceList( - self::ITEM_CLASS, - 'value', - null, - null, - null, - null - ); - - $this->assertEquals(array(1, 2), $choiceList->getValuesForChoices(array($item1, $item2))); - $this->assertEquals(array(1, 2), $choiceList->getIndicesForChoices(array($item1, $item2))); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php deleted file mode 100644 index 625b748..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php +++ /dev/null @@ -1,111 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Propel1\Tests\Form\DataTransformer; - -use \PropelObjectCollection; -use Symfony\Bridge\Propel1\Form\DataTransformer\CollectionToArrayTransformer; -use Symfony\Bridge\Propel1\Tests\Propel1TestCase; - -class CollectionToArrayTransformerTest extends Propel1TestCase -{ - private $transformer; - - protected function setUp() - { - if (!class_exists('Symfony\Component\Form\Form')) { - $this->markTestSkipped('The "Form" component is not available'); - } - - parent::setUp(); - - $this->transformer = new CollectionToArrayTransformer(); - } - - public function testTransform() - { - $result = $this->transformer->transform(new PropelObjectCollection()); - - $this->assertTrue(is_array($result)); - $this->assertEquals(0, count($result)); - } - - public function testTransformWithNull() - { - $result = $this->transformer->transform(null); - - $this->assertTrue(is_array($result)); - $this->assertEquals(0, count($result)); - } - - /** - * @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException - */ - public function testTransformThrowsExceptionIfNotPropelObjectCollection() - { - $this->transformer->transform(new DummyObject()); - } - - public function testTransformWithData() - { - $coll = new PropelObjectCollection(); - $coll->setData(array('foo', 'bar')); - - $result = $this->transformer->transform($coll); - - $this->assertTrue(is_array($result)); - $this->assertEquals(2, count($result)); - $this->assertEquals('foo', $result[0]); - $this->assertEquals('bar', $result[1]); - } - - public function testReverseTransformWithNull() - { - $result = $this->transformer->reverseTransform(null); - - $this->assertInstanceOf('\PropelObjectCollection', $result); - $this->assertEquals(0, count($result->getData())); - } - - public function testReverseTransformWithEmptyString() - { - $result = $this->transformer->reverseTransform(''); - - $this->assertInstanceOf('\PropelObjectCollection', $result); - $this->assertEquals(0, count($result->getData())); - } - - /** - * @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException - */ - public function testReverseTransformThrowsExceptionIfNotArray() - { - $this->transformer->reverseTransform(new DummyObject()); - } - - public function testReverseTransformWithData() - { - $inputData = array('foo', 'bar'); - - $result = $this->transformer->reverseTransform($inputData); - $data = $result->getData(); - - $this->assertInstanceOf('\PropelObjectCollection', $result); - - $this->assertTrue(is_array($data)); - $this->assertEquals(2, count($data)); - $this->assertEquals('foo', $data[0]); - $this->assertEquals('bar', $data[1]); - $this->assertsame($inputData, $data); - } -} - -class DummyObject {} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Form/PropelTypeGuesserTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Form/PropelTypeGuesserTest.php deleted file mode 100644 index a9ed9a0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Form/PropelTypeGuesserTest.php +++ /dev/null @@ -1,119 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Propel1\Tests\Form; - -use Symfony\Bridge\Propel1\Form\PropelTypeGuesser; -use Symfony\Bridge\Propel1\Tests\Propel1TestCase; -use Symfony\Component\Form\Guess\Guess; - -class PropelTypeGuesserTest extends Propel1TestCase -{ - const CLASS_NAME = 'Symfony\Bridge\Propel1\Tests\Fixtures\Item'; - - const UNKNOWN_CLASS_NAME = 'Symfony\Bridge\Propel1\Tests\Fixtures\UnknownItem'; - - private $guesser; - - public function setUp() - { - $this->guesser = new PropelTypeGuesser(); - } - - public function testGuessMaxLengthWithText() - { - $value = $this->guesser->guessMaxLength(self::CLASS_NAME, 'value'); - - $this->assertNotNull($value); - $this->assertEquals(255, $value->getValue()); - } - - public function testGuessMaxLengthWithFloat() - { - $value = $this->guesser->guessMaxLength(self::CLASS_NAME, 'price'); - - $this->assertNotNull($value); - $this->assertNull($value->getValue()); - } - - public function testGuessMinLengthWithText() - { - $value = $this->guesser->guessPattern(self::CLASS_NAME, 'value'); - - $this->assertNull($value); - } - - public function testGuessMinLengthWithFloat() - { - $value = $this->guesser->guessPattern(self::CLASS_NAME, 'price'); - - $this->assertNotNull($value); - $this->assertNull($value->getValue()); - } - - public function testGuessRequired() - { - $value = $this->guesser->guessRequired(self::CLASS_NAME, 'id'); - - $this->assertNotNull($value); - $this->assertTrue($value->getValue()); - } - - public function testGuessRequiredWithNullableColumn() - { - $value = $this->guesser->guessRequired(self::CLASS_NAME, 'value'); - - $this->assertNotNull($value); - $this->assertFalse($value->getValue()); - } - - public function testGuessTypeWithoutTable() - { - $value = $this->guesser->guessType(self::UNKNOWN_CLASS_NAME, 'property'); - - $this->assertNotNull($value); - $this->assertEquals('text', $value->getType()); - $this->assertEquals(Guess::LOW_CONFIDENCE, $value->getConfidence()); - } - - public function testGuessTypeWithoutColumn() - { - $value = $this->guesser->guessType(self::CLASS_NAME, 'property'); - - $this->assertNotNull($value); - $this->assertEquals('text', $value->getType()); - $this->assertEquals(Guess::LOW_CONFIDENCE, $value->getConfidence()); - } - - /** - * @dataProvider dataProviderForGuessType - */ - public function testGuessType($property, $type, $confidence) - { - $value = $this->guesser->guessType(self::CLASS_NAME, $property); - - $this->assertNotNull($value); - $this->assertEquals($type, $value->getType()); - $this->assertEquals($confidence, $value->getConfidence()); - } - - public static function dataProviderForGuessType() - { - return array( - array('is_active', 'checkbox', Guess::HIGH_CONFIDENCE), - array('enabled', 'checkbox', Guess::HIGH_CONFIDENCE), - array('id', 'integer', Guess::MEDIUM_CONFIDENCE), - array('value', 'text', Guess::MEDIUM_CONFIDENCE), - array('price', 'number', Guess::MEDIUM_CONFIDENCE), - array('updated_at', 'datetime', Guess::HIGH_CONFIDENCE), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Propel1TestCase.php b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Propel1TestCase.php deleted file mode 100644 index 93cc808..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/Propel1TestCase.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Propel1\Tests; - -abstract class Propel1TestCase extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!class_exists('\Propel')) { - $this->markTestSkipped('Propel is not available.'); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/bootstrap.php b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/bootstrap.php deleted file mode 100644 index abb49e0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/Tests/bootstrap.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -spl_autoload_register(function ($class) { - foreach (array( - 'SYMFONY_HTTP_FOUNDATION' => 'HttpFoundation', - 'SYMFONY_HTTP_KERNEL' => 'HttpKernel', - 'SYMFONY_FORM' => 'Form', - ) as $env => $name) { - if (isset($_SERVER[$env]) && 0 === strpos(ltrim($class, '/'), 'Symfony\Component\\'.$name)) { - if (file_exists($file = $_SERVER[$env].'/'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\\'.$name)).'.php')) { - require_once $file; - } - } - } - - if (0 === strpos(ltrim($class, '/'), 'Symfony\Bridge\Propel1')) { - if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Bridge\Propel1')).'.php')) { - require_once $file; - } - } -}); - -if (isset($_SERVER['PROPEL1']) && is_file($file = $_SERVER['PROPEL1'].'/runtime/lib/Propel.php')) { - require_once $file; -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/composer.json b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/composer.json deleted file mode 100644 index f716f02..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/composer.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "symfony/propel1-bridge", - "type": "symfony-bridge", - "description": "Symfony Propel1 Bridge", - "keywords": [], - "homepage": "http://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "require": { - "php": ">=5.3.3", - "symfony/http-foundation": "self.version", - "symfony/http-kernel": "self.version", - "symfony/form": "self.version", - "propel/propel1": "1.6.*" - }, - "autoload": { - "psr-0": { "Symfony\\Bridge\\Propel1": "" } - }, - "target-dir": "Symfony/Bridge/Propel1", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/phpunit.xml.dist b/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/phpunit.xml.dist deleted file mode 100644 index ae1d6cd..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Propel1/phpunit.xml.dist +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ./Tests/ - - - - - - ./ - - ./Resources - ./Tests - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Swiftmailer/CHANGELOG.md b/vendor/symfony/symfony/src/Symfony/Bridge/Swiftmailer/CHANGELOG.md deleted file mode 100644 index 67100f8..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Swiftmailer/CHANGELOG.md +++ /dev/null @@ -1,7 +0,0 @@ -CHANGELOG -========= - -2.1.0 ------ - - * added a data collector diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Swiftmailer/DataCollector/MessageDataCollector.php b/vendor/symfony/symfony/src/Symfony/Bridge/Swiftmailer/DataCollector/MessageDataCollector.php deleted file mode 100644 index 3ae96a2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Swiftmailer/DataCollector/MessageDataCollector.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Swiftmailer\DataCollector; - -use Symfony\Component\HttpKernel\DataCollector\DataCollector; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * MessageDataCollector. - * - * @author Fabien Potencier - * @author Clément JOBEILI - */ -class MessageDataCollector extends DataCollector -{ - private $container; - private $isSpool; - - /** - * Constructor. - * - * We don't inject the message logger and mailer here - * to avoid the creation of these objects when no emails are sent. - * - * @param ContainerInterface $container A ContainerInterface instance - * @param Boolean $isSpool - */ - public function __construct(ContainerInterface $container, $isSpool) - { - $this->container = $container; - $this->isSpool = $isSpool; - } - - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Exception $exception = null) - { - // only collect when Swiftmailer has already been initialized - if (class_exists('Swift_Mailer', false)) { - $logger = $this->container->get('swiftmailer.plugin.messagelogger'); - $this->data['messages'] = $logger->getMessages(); - $this->data['messageCount'] = $logger->countMessages(); - } else { - $this->data['messages'] = array(); - $this->data['messageCount'] = 0; - } - - $this->data['isSpool'] = $this->isSpool; - } - - public function getMessageCount() - { - return $this->data['messageCount']; - } - - public function getMessages() - { - return $this->data['messages']; - } - - public function isSpool() - { - return $this->data['isSpool']; - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'swiftmailer'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Swiftmailer/LICENSE b/vendor/symfony/symfony/src/Symfony/Bridge/Swiftmailer/LICENSE deleted file mode 100644 index cdffe7a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Swiftmailer/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2012 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Swiftmailer/composer.json b/vendor/symfony/symfony/src/Symfony/Bridge/Swiftmailer/composer.json deleted file mode 100644 index 9a10dd5..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Swiftmailer/composer.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "symfony/swiftmailer-bridge", - "type": "symfony-bridge", - "description": "Symfony Swiftmailer Bridge", - "keywords": [], - "homepage": "http://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "require": { - "php": ">=5.3.3", - "swiftmailer/swiftmailer": ">=4.2.0,<4.3-dev" - }, - "suggest": { - "symfony/http-kernel": "self.version" - }, - "autoload": { - "psr-0": { "Symfony\\Bridge\\Swiftmailer": "" } - }, - "target-dir": "Symfony/Bridge/Swiftmailer", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/.gitignore b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/.gitignore deleted file mode 100644 index d1502b0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -vendor/ -composer.lock diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/CHANGELOG.md b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/CHANGELOG.md deleted file mode 100644 index 630fc2a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/CHANGELOG.md +++ /dev/null @@ -1,12 +0,0 @@ -CHANGELOG -========= - -2.1.0 ------ - - * added global variables access in a form theme - * added TwigEngine - * added TwigExtractor - * added a csrf_token function - * added a way to specify a default domain for a Twig template (via the - 'trans_default_domain' tag) diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Extension/FormExtension.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Extension/FormExtension.php deleted file mode 100644 index 13ce859..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Extension/FormExtension.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Extension; - -use Symfony\Bridge\Twig\TokenParser\FormThemeTokenParser; -use Symfony\Bridge\Twig\Form\TwigRendererInterface; -use Symfony\Component\Form\Extension\Core\View\ChoiceView; -use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface; - -/** - * FormExtension extends Twig with form capabilities. - * - * @author Fabien Potencier - * @author Bernhard Schussek - */ -class FormExtension extends \Twig_Extension -{ - /** - * This property is public so that it can be accessed directly from compiled - * templates without having to call a getter, which slightly decreases performance. - * - * @var \Symfony\Component\Form\FormRendererInterface - */ - public $renderer; - - public function __construct(TwigRendererInterface $renderer) - { - $this->renderer = $renderer; - } - - /** - * {@inheritdoc} - */ - public function initRuntime(\Twig_Environment $environment) - { - $this->renderer->setEnvironment($environment); - } - - /** - * {@inheritdoc} - */ - public function getTokenParsers() - { - return array( - // {% form_theme form "SomeBundle::widgets.twig" %} - new FormThemeTokenParser(), - ); - } - - /** - * {@inheritdoc} - */ - public function getFunctions() - { - return array( - 'form_enctype' => new \Twig_Function_Node('Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', array('is_safe' => array('html'))), - 'form_widget' => new \Twig_Function_Node('Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', array('is_safe' => array('html'))), - 'form_errors' => new \Twig_Function_Node('Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', array('is_safe' => array('html'))), - 'form_label' => new \Twig_Function_Node('Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', array('is_safe' => array('html'))), - 'form_row' => new \Twig_Function_Node('Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', array('is_safe' => array('html'))), - 'form_rest' => new \Twig_Function_Node('Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', array('is_safe' => array('html'))), - 'csrf_token' => new \Twig_Function_Method($this, 'renderer->renderCsrfToken'), - ); - } - - /** - * {@inheritdoc} - */ - public function getFilters() - { - return array( - 'humanize' => new \Twig_Filter_Method($this, 'renderer->humanize'), - ); - } - - /** - * {@inheritdoc} - */ - public function getTests() - { - return array( - 'selectedchoice' => new \Twig_Test_Method($this, 'isSelectedChoice'), - ); - } - - /** - * Returns whether a choice is selected for a given form value. - * - * Unfortunately Twig does not support an efficient way to execute the - * "is_selected" closure passed to the template by ChoiceType. It is faster - * to implement the logic here (around 65ms for a specific form). - * - * Directly implementing the logic here is also faster than doing so in - * ChoiceView (around 30ms). - * - * The worst option tested so far is to implement the logic in ChoiceView - * and access the ChoiceView method directly in the template. Doing so is - * around 220ms slower than doing the method call here in the filter. Twig - * seems to be much more efficient at executing filters than at executing - * methods of an object. - * - * @param ChoiceView $choice The choice to check. - * @param string|array $selectedValue The selected value to compare. - * - * @return Boolean Whether the choice is selected. - * - * @see ChoiceView::isSelected() - */ - public function isSelectedChoice(ChoiceView $choice, $selectedValue) - { - if (is_array($selectedValue)) { - return false !== array_search($choice->value, $selectedValue, true); - } - - return $choice->value === $selectedValue; - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'form'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Extension/RoutingExtension.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Extension/RoutingExtension.php deleted file mode 100644 index 65d7dd2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Extension/RoutingExtension.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Extension; - -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; - -/** - * Provides integration of the Routing component with Twig. - * - * @author Fabien Potencier - */ -class RoutingExtension extends \Twig_Extension -{ - private $generator; - - public function __construct(UrlGeneratorInterface $generator) - { - $this->generator = $generator; - } - - /** - * Returns a list of functions to add to the existing list. - * - * @return array An array of functions - */ - public function getFunctions() - { - return array( - 'url' => new \Twig_Function_Method($this, 'getUrl'), - 'path' => new \Twig_Function_Method($this, 'getPath'), - ); - } - - public function getPath($name, $parameters = array()) - { - return $this->generator->generate($name, $parameters, false); - } - - public function getUrl($name, $parameters = array()) - { - return $this->generator->generate($name, $parameters, true); - } - - /** - * Returns the name of the extension. - * - * @return string The extension name - */ - public function getName() - { - return 'routing'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Extension/SecurityExtension.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Extension/SecurityExtension.php deleted file mode 100644 index c9f4466..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Extension/SecurityExtension.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Extension; - -use Symfony\Component\Security\Acl\Voter\FieldVote; -use Symfony\Component\Security\Core\SecurityContextInterface; - -/** - * SecurityExtension exposes security context features. - * - * @author Fabien Potencier - */ -class SecurityExtension extends \Twig_Extension -{ - private $context; - - public function __construct(SecurityContextInterface $context = null) - { - $this->context = $context; - } - - public function isGranted($role, $object = null, $field = null) - { - if (null === $this->context) { - return false; - } - - if (null !== $field) { - $object = new FieldVote($object, $field); - } - - return $this->context->isGranted($role, $object); - } - - /** - * {@inheritdoc} - */ - public function getFunctions() - { - return array( - 'is_granted' => new \Twig_Function_Method($this, 'isGranted'), - ); - } - - /** - * Returns the name of the extension. - * - * @return string The extension name - */ - public function getName() - { - return 'security'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Extension/TranslationExtension.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Extension/TranslationExtension.php deleted file mode 100644 index 3718e9e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Extension/TranslationExtension.php +++ /dev/null @@ -1,114 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Extension; - -use Symfony\Bridge\Twig\TokenParser\TransTokenParser; -use Symfony\Bridge\Twig\TokenParser\TransChoiceTokenParser; -use Symfony\Bridge\Twig\TokenParser\TransDefaultDomainTokenParser; -use Symfony\Component\Translation\TranslatorInterface; -use Symfony\Bridge\Twig\NodeVisitor\TranslationNodeVisitor; -use Symfony\Bridge\Twig\NodeVisitor\TranslationDefaultDomainNodeVisitor; - -/** - * Provides integration of the Translation component with Twig. - * - * @author Fabien Potencier - */ -class TranslationExtension extends \Twig_Extension -{ - private $translator; - private $translationNodeVisitor; - - public function __construct(TranslatorInterface $translator) - { - $this->translator = $translator; - $this->translationNodeVisitor = new TranslationNodeVisitor(); - } - - public function getTranslator() - { - return $this->translator; - } - - /** - * {@inheritdoc} - */ - public function getFilters() - { - return array( - 'trans' => new \Twig_Filter_Method($this, 'trans'), - 'transchoice' => new \Twig_Filter_Method($this, 'transchoice'), - ); - } - - /** - * Returns the token parser instance to add to the existing list. - * - * @return array An array of Twig_TokenParser instances - */ - public function getTokenParsers() - { - return array( - // {% trans %}Symfony is great!{% endtrans %} - new TransTokenParser(), - - // {% transchoice count %} - // {0} There is no apples|{1} There is one apple|]1,Inf] There is {{ count }} apples - // {% endtranschoice %} - new TransChoiceTokenParser(), - - // {% trans_default_domain "foobar" %} - new TransDefaultDomainTokenParser(), - ); - } - - /** - * {@inheritdoc} - */ - public function getNodeVisitors() - { - return array($this->translationNodeVisitor, new TranslationDefaultDomainNodeVisitor()); - } - - public function getTranslationNodeVisitor() - { - return $this->translationNodeVisitor; - } - - public function trans($message, array $arguments = array(), $domain = null, $locale = null) - { - if (null === $domain) { - $domain = 'messages'; - } - - return $this->translator->trans($message, $arguments, $domain, $locale); - } - - public function transchoice($message, $count, array $arguments = array(), $domain = null, $locale = null) - { - if (null === $domain) { - $domain = 'messages'; - } - - return $this->translator->transChoice($message, $count, array_merge(array('%count%' => $count), $arguments), $domain, $locale); - } - - /** - * Returns the name of the extension. - * - * @return string The extension name - */ - public function getName() - { - return 'translator'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Extension/YamlExtension.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Extension/YamlExtension.php deleted file mode 100644 index 130575c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Extension/YamlExtension.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Extension; - -use Symfony\Component\Yaml\Dumper as YamlDumper; - -/** - * Provides integration of the Yaml component with Twig. - * - * @author Fabien Potencier - */ -class YamlExtension extends \Twig_Extension -{ - /** - * {@inheritdoc} - */ - public function getFilters() - { - return array( - 'yaml_encode' => new \Twig_Filter_Method($this, 'encode'), - 'yaml_dump' => new \Twig_Filter_Method($this, 'dump'), - ); - } - - public function encode($input, $inline = 0) - { - static $dumper; - - if (null === $dumper) { - $dumper = new YamlDumper(); - } - - return $dumper->dump($input, $inline); - } - - public function dump($value) - { - if (is_resource($value)) { - return '%Resource%'; - } - - if (is_array($value) || is_object($value)) { - return '%'.gettype($value).'% '.$this->encode($value); - } - - return $this->encode($value); - } - - /** - * Returns the name of the extension. - * - * @return string The extension name - */ - public function getName() - { - return 'yaml'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Form/TwigRenderer.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Form/TwigRenderer.php deleted file mode 100644 index 72798d1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Form/TwigRenderer.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Form; - -use Symfony\Component\Form\FormRenderer; -use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface; - -/** - * @author Bernhard Schussek - */ -class TwigRenderer extends FormRenderer implements TwigRendererInterface -{ - /** - * @var TwigRendererEngineInterface - */ - private $engine; - - public function __construct(TwigRendererEngineInterface $engine, CsrfProviderInterface $csrfProvider = null) - { - parent::__construct($engine, $csrfProvider); - - $this->engine = $engine; - } - - /** - * {@inheritdoc} - */ - public function setEnvironment(\Twig_Environment $environment) - { - $this->engine->setEnvironment($environment); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Form/TwigRendererEngine.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Form/TwigRendererEngine.php deleted file mode 100644 index 05beb31..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Form/TwigRendererEngine.php +++ /dev/null @@ -1,183 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Form; - -use Symfony\Component\Form\AbstractRendererEngine; -use Symfony\Component\Form\FormView; - -/** - * @author Bernhard Schussek - */ -class TwigRendererEngine extends AbstractRendererEngine implements TwigRendererEngineInterface -{ - /** - * @var \Twig_Environment - */ - private $environment; - - /** - * @var \Twig_Template - */ - private $template; - - /** - * {@inheritdoc} - */ - public function setEnvironment(\Twig_Environment $environment) - { - $this->environment = $environment; - } - - /** - * {@inheritdoc} - */ - public function renderBlock(FormView $view, $resource, $blockName, array $variables = array()) - { - $cacheKey = $view->vars[self::CACHE_KEY_VAR]; - - $context = $this->environment->mergeGlobals($variables); - - ob_start(); - - // By contract,This method can only be called after getting the resource - // (which is passed to the method). Getting a resource for the first time - // (with an empty cache) is guaranteed to invoke loadResourcesFromTheme(), - // where the property $template is initialized. - - // We do not call renderBlock here to avoid too many nested level calls - // (XDebug limits the level to 100 by default) - $this->template->displayBlock($blockName, $context, $this->resources[$cacheKey]); - - return ob_get_clean(); - } - - /** - * Loads the cache with the resource for a given block name. - * - * This implementation eagerly loads all blocks of the themes assigned to the given view - * and all of its ancestors views. This is necessary, because Twig receives the - * list of blocks later. At that point, all blocks must already be loaded, for the - * case that the function "block()" is used in the Twig template. - * - * @see getResourceForBlock() - * - * @param string $cacheKey The cache key of the form view. - * @param FormView $view The form view for finding the applying themes. - * @param string $blockName The name of the block to load. - * - * @return Boolean True if the resource could be loaded, false otherwise. - */ - protected function loadResourceForBlockName($cacheKey, FormView $view, $blockName) - { - // The caller guarantees that $this->resources[$cacheKey][$block] is - // not set, but it doesn't have to check whether $this->resources[$cacheKey] - // is set. If $this->resources[$cacheKey] is set, all themes for this - // $cacheKey are already loaded (due to the eager population, see doc comment). - if (isset($this->resources[$cacheKey])) { - // As said in the previous, the caller guarantees that - // $this->resources[$cacheKey][$block] is not set. Since the themes are - // already loaded, it can only be a non-existing block. - $this->resources[$cacheKey][$blockName] = false; - - return false; - } - - // Recursively try to find the block in the themes assigned to $view, - // then of its parent view, then of the parent view of the parent and so on. - // When the root view is reached in this recursion, also the default - // themes are taken into account. - - // Check each theme whether it contains the searched block - if (isset($this->themes[$cacheKey])) { - for ($i = count($this->themes[$cacheKey]) - 1; $i >= 0; --$i) { - $this->loadResourcesFromTheme($cacheKey, $this->themes[$cacheKey][$i]); - // CONTINUE LOADING (see doc comment) - } - } - - // Check the default themes once we reach the root view without success - if (!$view->parent) { - for ($i = count($this->defaultThemes) - 1; $i >= 0; --$i) { - $this->loadResourcesFromTheme($cacheKey, $this->defaultThemes[$i]); - // CONTINUE LOADING (see doc comment) - } - } - - // Proceed with the themes of the parent view - if ($view->parent) { - $parentCacheKey = $view->parent->vars[self::CACHE_KEY_VAR]; - - if (!isset($this->resources[$parentCacheKey])) { - $this->loadResourceForBlockName($parentCacheKey, $view->parent, $blockName); - } - - // EAGER CACHE POPULATION (see doc comment) - foreach ($this->resources[$parentCacheKey] as $nestedBlockName => $resource) { - if (!isset($this->resources[$cacheKey][$nestedBlockName])) { - $this->resources[$cacheKey][$nestedBlockName] = $resource; - } - } - } - - // Even though we loaded the themes, it can happen that none of them - // contains the searched block - if (!isset($this->resources[$cacheKey][$blockName])) { - // Cache that we didn't find anything to speed up further accesses - $this->resources[$cacheKey][$blockName] = false; - } - - return false !== $this->resources[$cacheKey][$blockName]; - } - - /** - * Loads the resources for all blocks in a theme. - * - * @param string $cacheKey The cache key for storing the resource. - * @param mixed $theme The theme to load the block from. This parameter - * is passed by reference, because it might be necessary - * to initialize the theme first. Any changes made to - * this variable will be kept and be available upon - * further calls to this method using the same theme. - */ - protected function loadResourcesFromTheme($cacheKey, &$theme) - { - if (!$theme instanceof \Twig_Template) { - /* @var \Twig_Template $theme */ - $theme = $this->environment->loadTemplate($theme); - } - - if (null === $this->template) { - // Store the first \Twig_Template instance that we find so that - // we can call displayBlock() later on. It doesn't matter *which* - // template we use for that, since we pass the used blocks manually - // anyway. - $this->template = $theme; - } - - // Use a separate variable for the inheritance traversal, because - // theme is a reference and we don't want to change it. - $currentTheme = $theme; - - // The do loop takes care of template inheritance. - // Add blocks from all templates in the inheritance tree, but avoid - // overriding blocks already set. - do { - foreach ($currentTheme->getBlocks() as $block => $blockData) { - if (!isset($this->resources[$cacheKey][$block])) { - // The resource given back is the key to the bucket that - // contains this block. - $this->resources[$cacheKey][$block] = $blockData; - } - } - } while (false !== $currentTheme = $currentTheme->getParent(array())); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Form/TwigRendererEngineInterface.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Form/TwigRendererEngineInterface.php deleted file mode 100644 index ef764a2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Form/TwigRendererEngineInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Form; - -use Symfony\Component\Form\FormRendererEngineInterface; - -/** - * @author Bernhard Schussek - */ -interface TwigRendererEngineInterface extends FormRendererEngineInterface -{ - /** - * Sets Twig's environment. - * - * @param \Twig_Environment $environment - */ - public function setEnvironment(\Twig_Environment $environment); -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Form/TwigRendererInterface.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Form/TwigRendererInterface.php deleted file mode 100644 index 4682f52..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Form/TwigRendererInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Form; - -use Symfony\Component\Form\FormRendererInterface; - -/** - * @author Bernhard Schussek - */ -interface TwigRendererInterface extends FormRendererInterface -{ - /** - * Sets Twig's environment. - * - * @param \Twig_Environment $environment - */ - public function setEnvironment(\Twig_Environment $environment); -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/LICENSE b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/LICENSE deleted file mode 100644 index cdffe7a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2012 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Node/FormThemeNode.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Node/FormThemeNode.php deleted file mode 100644 index 329ab86..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Node/FormThemeNode.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Node; - -/** - * @author Fabien Potencier - */ -class FormThemeNode extends \Twig_Node -{ - public function __construct(\Twig_NodeInterface $form, \Twig_NodeInterface $resources, $lineno, $tag = null) - { - parent::__construct(array('form' => $form, 'resources' => $resources), array(), $lineno, $tag); - } - - /** - * Compiles the node to PHP. - * - * @param \Twig_Compiler $compiler A Twig_Compiler instance - */ - public function compile(\Twig_Compiler $compiler) - { - $compiler - ->addDebugInfo($this) - ->write('$this->env->getExtension(\'form\')->renderer->setTheme(') - ->subcompile($this->getNode('form')) - ->raw(', ') - ->subcompile($this->getNode('resources')) - ->raw(");\n"); - ; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Node/SearchAndRenderBlockNode.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Node/SearchAndRenderBlockNode.php deleted file mode 100644 index dca1686..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Node/SearchAndRenderBlockNode.php +++ /dev/null @@ -1,106 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Node; - -/** - * @author Bernhard Schussek - */ -class SearchAndRenderBlockNode extends \Twig_Node_Expression_Function -{ - public function compile(\Twig_Compiler $compiler) - { - $compiler->addDebugInfo($this); - $compiler->raw('$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock('); - - preg_match('/_([^_]+)$/', $this->getAttribute('name'), $matches); - - $label = null; - $arguments = iterator_to_array($this->getNode('arguments')); - $blockNameSuffix = $matches[1]; - - if (isset($arguments[0])) { - $compiler->subcompile($arguments[0]); - $compiler->raw(', \'' . $blockNameSuffix . '\''); - - if (isset($arguments[1])) { - if ('label' === $blockNameSuffix) { - // The "label" function expects the label in the second and - // the variables in the third argument - $label = $arguments[1]; - $variables = isset($arguments[2]) ? $arguments[2] : null; - $lineno = $label->getLine(); - - if ($label instanceof \Twig_Node_Expression_Constant) { - // If the label argument is given as a constant, we can either - // strip it away if it is empty, or integrate it into the array - // of variables at compile time. - $labelIsExpression = false; - - // Only insert the label into the array if it is not empty - if (!twig_test_empty($label->getAttribute('value'))) { - $originalVariables = $variables; - $variables = new \Twig_Node_Expression_Array(array(), $lineno); - $labelKey = new \Twig_Node_Expression_Constant('label', $lineno); - - if (null !== $originalVariables) { - foreach ($originalVariables->getKeyValuePairs() as $pair) { - // Don't copy the original label attribute over if it exists - if ((string) $labelKey !== (string) $pair['key']) { - $variables->addElement($pair['value'], $pair['key']); - } - } - } - - // Insert the label argument into the array - $variables->addElement($label, $labelKey); - } - } else { - // The label argument is not a constant, but some kind of - // expression. This expression needs to be evaluated at runtime. - // Depending on the result (whether it is null or not), the - // label in the arguments should take precedence over the label - // in the attributes or not. - $labelIsExpression = true; - } - } else { - // All other functions than "label" expect the variables - // in the second argument - $label = null; - $variables = $arguments[1]; - $labelIsExpression = false; - } - - if (null !== $variables || $labelIsExpression) { - $compiler->raw(', '); - - if (null !== $variables) { - $compiler->subcompile($variables); - } - - if ($labelIsExpression) { - if (null !== $variables) { - $compiler->raw(' + '); - } - - // Check at runtime whether the label is empty. - // If not, add it to the array at runtime. - $compiler->raw('(twig_test_empty($_label_ = '); - $compiler->subcompile($label); - $compiler->raw(') ? array() : array("label" => $_label_))'); - } - } - } - } - - $compiler->raw(")"); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Node/TransDefaultDomainNode.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Node/TransDefaultDomainNode.php deleted file mode 100644 index adee71f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Node/TransDefaultDomainNode.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Node; - -/** - * @author Fabien Potencier - */ -class TransDefaultDomainNode extends \Twig_Node -{ - public function __construct(\Twig_Node_Expression $expr, $lineno = 0, $tag = null) - { - parent::__construct(array('expr' => $expr), array(), $lineno, $tag); - } - - /** - * Compiles the node to PHP. - * - * @param \Twig_Compiler $compiler A Twig_Compiler instance - */ - public function compile(\Twig_Compiler $compiler) - { - // noop as this node is just a marker for TranslationDefaultDomainNodeVisitor - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Node/TransNode.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Node/TransNode.php deleted file mode 100644 index a68c101..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Node/TransNode.php +++ /dev/null @@ -1,119 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Node; - -/** - * @author Fabien Potencier - */ -class TransNode extends \Twig_Node -{ - public function __construct(\Twig_NodeInterface $body, \Twig_NodeInterface $domain = null, \Twig_Node_Expression $count = null, \Twig_Node_Expression $vars = null, \Twig_Node_Expression $locale = null, $lineno = 0, $tag = null) - { - parent::__construct(array('count' => $count, 'body' => $body, 'domain' => $domain, 'vars' => $vars, 'locale' => $locale), array(), $lineno, $tag); - } - - /** - * Compiles the node to PHP. - * - * @param \Twig_Compiler $compiler A Twig_Compiler instance - */ - public function compile(\Twig_Compiler $compiler) - { - $compiler->addDebugInfo($this); - - $vars = $this->getNode('vars'); - $defaults = new \Twig_Node_Expression_Array(array(), -1); - if ($vars instanceof \Twig_Node_Expression_Array) { - $defaults = $this->getNode('vars'); - $vars = null; - } - list($msg, $defaults) = $this->compileString($this->getNode('body'), $defaults); - - $method = null === $this->getNode('count') ? 'trans' : 'transChoice'; - - $compiler - ->write('echo $this->env->getExtension(\'translator\')->getTranslator()->'.$method.'(') - ->subcompile($msg) - ; - - $compiler->raw(', '); - - if (null !== $this->getNode('count')) { - $compiler - ->subcompile($this->getNode('count')) - ->raw(', ') - ; - } - - if (null !== $vars) { - $compiler - ->raw('array_merge(') - ->subcompile($defaults) - ->raw(', ') - ->subcompile($this->getNode('vars')) - ->raw(')') - ; - } else { - $compiler->subcompile($defaults); - } - - $compiler->raw(', '); - - if (null === $this->getNode('domain')) { - $compiler->repr('messages'); - } else { - $compiler->subcompile($this->getNode('domain')); - } - - if (null !== $this->getNode('locale')) { - $compiler - ->raw(', ') - ->subcompile($this->getNode('locale')) - ; - } - $compiler->raw(");\n"); - } - - protected function compileString(\Twig_NodeInterface $body, \Twig_Node_Expression_Array $vars) - { - if ($body instanceof \Twig_Node_Expression_Constant) { - $msg = $body->getAttribute('value'); - } elseif ($body instanceof \Twig_Node_Text) { - $msg = $body->getAttribute('data'); - } else { - return array($body, $vars); - } - - preg_match_all('/(?=')) { - foreach ($matches[1] as $var) { - $key = new \Twig_Node_Expression_Constant('%'.$var.'%', $body->getLine()); - if (!$vars->hasElement($key)) { - $vars->addElement(new \Twig_Node_Expression_Name($var, $body->getLine()), $key); - } - } - } else { - $current = array(); - foreach ($vars as $name => $var) { - $current[$name] = true; - } - foreach ($matches[1] as $var) { - if (!isset($current['%'.$var.'%'])) { - $vars->setNode('%'.$var.'%', new \Twig_Node_Expression_Name($var, $body->getLine())); - } - } - } - - return array(new \Twig_Node_Expression_Constant(str_replace('%%', '%', trim($msg)), $body->getLine()), $vars); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php deleted file mode 100644 index c7bebdd..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\NodeVisitor; - -use Symfony\Bridge\Twig\Node\TransNode; -use Symfony\Bridge\Twig\Node\TransDefaultDomainNode; - -/** - * TranslationDefaultDomainNodeVisitor. - * - * @author Fabien Potencier - */ -class TranslationDefaultDomainNodeVisitor implements \Twig_NodeVisitorInterface -{ - private $domain; - - /** - * {@inheritdoc} - */ - public function enterNode(\Twig_NodeInterface $node, \Twig_Environment $env) - { - if ($node instanceof \Twig_Node_Module) { - $this->domain = null; - } - - if ($node instanceof TransDefaultDomainNode) { - $var = $env->getParser()->getVarName(); - $name = new \Twig_Node_Expression_AssignName($var, $node->getLine()); - $this->domain = new \Twig_Node_Expression_Name($var, $node->getLine()); - - return new \Twig_Node_Set(false, new \Twig_Node(array($name)), new \Twig_Node(array($node->getNode('expr'))), $node->getLine()); - } - - if (null === $this->domain) { - return $node; - } - - if ($node instanceof \Twig_Node_Expression_Filter && in_array($node->getNode('filter')->getAttribute('value'), array('trans', 'transchoice'))) { - $ind = 'trans' === $node->getNode('filter')->getAttribute('value') ? 1 : 2; - $arguments = $node->getNode('arguments'); - if (!$arguments->hasNode($ind)) { - if (!$arguments->hasNode($ind - 1)) { - $arguments->setNode($ind - 1, new \Twig_Node_Expression_Array(array(), $node->getLine())); - } - - $arguments->setNode($ind, $this->domain); - } - } elseif ($node instanceof TransNode) { - if (null === $node->getNode('domain')) { - $node->setNode('domain', $this->domain); - } - } - - return $node; - } - - /** - * {@inheritdoc} - */ - public function leaveNode(\Twig_NodeInterface $node, \Twig_Environment $env) - { - return $node; - } - - /** - * {@inheritdoc} - */ - public function getPriority() - { - return 0; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php deleted file mode 100644 index 3a943f7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\NodeVisitor; - -use Symfony\Bridge\Twig\Node\TransNode; - -/** - * TranslationNodeVisitor extracts translation messages. - * - * @author Fabien Potencier - */ -class TranslationNodeVisitor implements \Twig_NodeVisitorInterface -{ - private $enabled = false; - private $messages = array(); - - public function enable() - { - $this->enabled = true; - $this->messages = array(); - } - - public function disable() - { - $this->enabled = false; - $this->messages = array(); - } - - public function getMessages() - { - return $this->messages; - } - - /** - * {@inheritdoc} - */ - public function enterNode(\Twig_NodeInterface $node, \Twig_Environment $env) - { - if (!$this->enabled) { - return $node; - } - - if ( - $node instanceof \Twig_Node_Expression_Filter && - 'trans' === $node->getNode('filter')->getAttribute('value') && - $node->getNode('node') instanceof \Twig_Node_Expression_Constant - ) { - // extract constant nodes with a trans filter - $this->messages[] = array( - $node->getNode('node')->getAttribute('value'), - $node->getNode('arguments')->hasNode(1) ? $node->getNode('arguments')->getNode(1)->getAttribute('value') : null, - ); - } elseif ( - $node instanceof \Twig_Node_Expression_Filter && - 'transchoice' === $node->getNode('filter')->getAttribute('value') && - $node->getNode('node') instanceof \Twig_Node_Expression_Constant - ) { - // extract constant nodes with a trans filter - $this->messages[] = array( - $node->getNode('node')->getAttribute('value'), - $node->getNode('arguments')->hasNode(2) ? $node->getNode('arguments')->getNode(2)->getAttribute('value') : null, - ); - } elseif ($node instanceof TransNode) { - // extract trans nodes - $this->messages[] = array( - $node->getNode('body')->getAttribute('data'), - null === $node->getNode('domain') ? 'messages' : $node->getNode('domain')->getAttribute('value'), - ); - } - - return $node; - } - - /** - * {@inheritdoc} - */ - public function leaveNode(\Twig_NodeInterface $node, \Twig_Environment $env) - { - return $node; - } - - /** - * {@inheritdoc} - */ - public function getPriority() - { - return -10; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/README.md b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/README.md deleted file mode 100644 index 80cf13b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/README.md +++ /dev/null @@ -1,15 +0,0 @@ -Twig Bridge -=========== - -Provides integration for [Twig](http://twig.sensiolabs.org/) with various -Symfony2 components. - -Resources ---------- - -If you want to run the unit tests, install dev dependencies before -running PHPUnit: - - php composer.phar install --dev - - phpunit diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig deleted file mode 100644 index 0e562e4..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig +++ /dev/null @@ -1,331 +0,0 @@ -{# Widgets #} - -{% block form_widget %} -{% spaceless %} - {% if compound %} - {{ block('form_widget_compound') }} - {% else %} - {{ block('form_widget_simple') }} - {% endif %} -{% endspaceless %} -{% endblock form_widget %} - -{% block form_widget_simple %} -{% spaceless %} - {% set type = type|default('text') %} - -{% endspaceless %} -{% endblock form_widget_simple %} - -{% block form_widget_compound %} -{% spaceless %} -
    - {% if form.parent is empty %} - {{ form_errors(form) }} - {% endif %} - {{ block('form_rows') }} - {{ form_rest(form) }} -
    -{% endspaceless %} -{% endblock form_widget_compound %} - -{% block collection_widget %} -{% spaceless %} - {% if prototype is defined %} - {% set attr = attr|merge({'data-prototype': form_row(prototype) }) %} - {% endif %} - {{ block('form_widget') }} -{% endspaceless %} -{% endblock collection_widget %} - -{% block textarea_widget %} -{% spaceless %} - -{% endspaceless %} -{% endblock textarea_widget %} - -{% block choice_widget %} -{% spaceless %} - {% if expanded %} - {{ block('choice_widget_expanded') }} - {% else %} - {{ block('choice_widget_collapsed') }} - {% endif %} -{% endspaceless %} -{% endblock choice_widget %} - -{% block choice_widget_expanded %} -{% spaceless %} -
    - {% for child in form %} - {{ form_widget(child) }} - {{ form_label(child) }} - {% endfor %} -
    -{% endspaceless %} -{% endblock choice_widget_expanded %} - -{% block choice_widget_collapsed %} -{% spaceless %} - -{% endspaceless %} -{% endblock choice_widget_collapsed %} - -{% block choice_widget_options %} -{% spaceless %} - {% for group_label, choice in options %} - {% if choice is iterable %} - - {% set options = choice %} - {{ block('choice_widget_options') }} - - {% else %} - - {% endif %} - {% endfor %} -{% endspaceless %} -{% endblock choice_widget_options %} - -{% block checkbox_widget %} -{% spaceless %} - -{% endspaceless %} -{% endblock checkbox_widget %} - -{% block radio_widget %} -{% spaceless %} - -{% endspaceless %} -{% endblock radio_widget %} - -{% block datetime_widget %} -{% spaceless %} - {% if widget == 'single_text' %} - {{ block('form_widget_simple') }} - {% else %} -
    - {{ form_errors(form.date) }} - {{ form_errors(form.time) }} - {{ form_widget(form.date) }} - {{ form_widget(form.time) }} -
    - {% endif %} -{% endspaceless %} -{% endblock datetime_widget %} - -{% block date_widget %} -{% spaceless %} - {% if widget == 'single_text' %} - {{ block('form_widget_simple') }} - {% else %} -
    - {{ date_pattern|replace({ - '{{ year }}': form_widget(form.year), - '{{ month }}': form_widget(form.month), - '{{ day }}': form_widget(form.day), - })|raw }} -
    - {% endif %} -{% endspaceless %} -{% endblock date_widget %} - -{% block time_widget %} -{% spaceless %} - {% if widget == 'single_text' %} - {{ block('form_widget_simple') }} - {% else %} -
    - {{ form_widget(form.hour, { 'attr': { 'size': '1' } }) }}:{{ form_widget(form.minute, { 'attr': { 'size': '1' } }) }}{% if with_seconds %}:{{ form_widget(form.second, { 'attr': { 'size': '1' } }) }}{% endif %} -
    - {% endif %} -{% endspaceless %} -{% endblock time_widget %} - -{% block number_widget %} -{% spaceless %} - {# type="number" doesn't work with floats #} - {% set type = type|default('text') %} - {{ block('form_widget_simple') }} -{% endspaceless %} -{% endblock number_widget %} - -{% block integer_widget %} -{% spaceless %} - {% set type = type|default('number') %} - {{ block('form_widget_simple') }} -{% endspaceless %} -{% endblock integer_widget %} - -{% block money_widget %} -{% spaceless %} - {{ money_pattern|replace({ '{{ widget }}': block('form_widget_simple') })|raw }} -{% endspaceless %} -{% endblock money_widget %} - -{% block url_widget %} -{% spaceless %} - {% set type = type|default('url') %} - {{ block('form_widget_simple') }} -{% endspaceless %} -{% endblock url_widget %} - -{% block search_widget %} -{% spaceless %} - {% set type = type|default('search') %} - {{ block('form_widget_simple') }} -{% endspaceless %} -{% endblock search_widget %} - -{% block percent_widget %} -{% spaceless %} - {% set type = type|default('text') %} - {{ block('form_widget_simple') }} % -{% endspaceless %} -{% endblock percent_widget %} - -{% block password_widget %} -{% spaceless %} - {% set type = type|default('password') %} - {{ block('form_widget_simple') }} -{% endspaceless %} -{% endblock password_widget %} - -{% block hidden_widget %} -{% spaceless %} - {% set type = type|default('hidden') %} - {{ block('form_widget_simple') }} -{% endspaceless %} -{% endblock hidden_widget %} - -{% block email_widget %} -{% spaceless %} - {% set type = type|default('email') %} - {{ block('form_widget_simple') }} -{% endspaceless %} -{% endblock email_widget %} - -{# Labels #} - -{% block form_label %} -{% spaceless %} - {% if not compound %} - {% set label_attr = label_attr|merge({'for': id}) %} - {% endif %} - {% if required %} - {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %} - {% endif %} - {% if label is empty %} - {% set label = name|humanize %} - {% endif %} - {{ label|trans({}, translation_domain) }} -{% endspaceless %} -{% endblock form_label %} - -{# Rows #} - -{% block repeated_row %} -{% spaceless %} - {# - No need to render the errors here, as all errors are mapped - to the first child (see RepeatedTypeValidatorExtension). - #} - {{ block('form_rows') }} -{% endspaceless %} -{% endblock repeated_row %} - -{% block form_row %} -{% spaceless %} -
    - {{ form_label(form) }} - {{ form_errors(form) }} - {{ form_widget(form) }} -
    -{% endspaceless %} -{% endblock form_row %} - -{% block hidden_row %} - {{ form_widget(form) }} -{% endblock hidden_row %} - -{# Misc #} - -{% block form_enctype %} -{% spaceless %} - {% if multipart %}enctype="multipart/form-data"{% endif %} -{% endspaceless %} -{% endblock form_enctype %} - -{% block form_errors %} -{% spaceless %} - {% if errors|length > 0 %} -
      - {% for error in errors %} -
    • {{ - error.messagePluralization is null - ? error.messageTemplate|trans(error.messageParameters, 'validators') - : error.messageTemplate|transchoice(error.messagePluralization, error.messageParameters, 'validators') - }}
    • - {% endfor %} -
    - {% endif %} -{% endspaceless %} -{% endblock form_errors %} - -{% block form_rest %} -{% spaceless %} - {% for child in form %} - {% if not child.rendered %} - {{ form_row(child) }} - {% endif %} - {% endfor %} -{% endspaceless %} -{% endblock form_rest %} - -{# Support #} - -{% block form_rows %} -{% spaceless %} - {% for child in form %} - {{ form_row(child) }} - {% endfor %} -{% endspaceless %} -{% endblock form_rows %} - -{% block widget_attributes %} -{% spaceless %} - id="{{ id }}" name="{{ full_name }}"{% if read_only %} readonly="readonly"{% endif %}{% if disabled %} disabled="disabled"{% endif %}{% if required %} required="required"{% endif %}{% if max_length %} maxlength="{{ max_length }}"{% endif %}{% if pattern %} pattern="{{ pattern }}"{% endif %} - {% for attrname, attrvalue in attr %}{% if attrname in ['placeholder', 'title'] %}{{ attrname }}="{{ attrvalue|trans({}, translation_domain) }}" {% else %}{{ attrname }}="{{ attrvalue }}" {% endif %}{% endfor %} -{% endspaceless %} -{% endblock widget_attributes %} - -{% block widget_container_attributes %} -{% spaceless %} - {% if id is not empty %}id="{{ id }}" {% endif %} - {% for attrname, attrvalue in attr %}{{ attrname }}="{{ attrvalue }}" {% endfor %} -{% endspaceless %} -{% endblock widget_container_attributes %} - -{# Deprecated in Symfony 2.1, to be removed in 2.3 #} - -{% block generic_label %}{{ block('form_label') }}{% endblock %} -{% block widget_choice_options %}{{ block('choice_widget_options') }}{% endblock %} -{% block field_widget %}{{ block('form_widget_simple') }}{% endblock %} -{% block field_label %}{{ block('form_label') }}{% endblock %} -{% block field_row %}{{ block('form_row') }}{% endblock %} -{% block field_enctype %}{{ block('form_enctype') }}{% endblock %} -{% block field_errors %}{{ block('form_errors') }}{% endblock %} -{% block field_rest %}{{ block('form_rest') }}{% endblock %} -{% block field_rows %}{{ block('form_rows') }}{% endblock %} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form/form_table_layout.html.twig b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form/form_table_layout.html.twig deleted file mode 100644 index 63bd7d2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form/form_table_layout.html.twig +++ /dev/null @@ -1,41 +0,0 @@ -{% use "form_div_layout.html.twig" %} - -{% block form_row %} -{% spaceless %} -
    - {{ form_label(form) }} - - {{ form_errors(form) }} - {{ form_widget(form) }} -
    - {{ form_widget(form) }} -
    - {% if form.parent is empty and errors|length > 0 %} - - - - {% endif %} - {{ block('form_rows') }} - {{ form_rest(form) }} -
    - {{ form_errors(form) }} -
    -{% endspaceless %} -{% endblock form_widget_compound %} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/Fixtures/StubFilesystemLoader.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/Fixtures/StubFilesystemLoader.php deleted file mode 100644 index 36c61cd..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/Fixtures/StubFilesystemLoader.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Tests\Extension\Fixtures; - -// Preventing autoloader throwing E_FATAL when Twig is now available -if (!class_exists('Twig_Environment')) { - class StubFilesystemLoader - { - } -} else { - class StubFilesystemLoader extends \Twig_Loader_Filesystem - { - protected function findTemplate($name) - { - // strip away bundle name - $parts = explode(':', $name); - - return parent::findTemplate(end($parts)); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/Fixtures/StubTranslator.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/Fixtures/StubTranslator.php deleted file mode 100644 index b7d011b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/Fixtures/StubTranslator.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Tests\Extension\Fixtures; - -use Symfony\Component\Translation\TranslatorInterface; - -class StubTranslator implements TranslatorInterface -{ - public function trans($id, array $parameters = array(), $domain = null, $locale = null) - { - return '[trans]'.$id.'[/trans]'; - } - - public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null) - { - return '[trans]'.$id.'[/trans]'; - } - - public function setLocale($locale) - { - } - - public function getLocale() - { - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php deleted file mode 100644 index 903db69..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php +++ /dev/null @@ -1,194 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Tests\Extension; - -use Symfony\Bridge\Twig\Extension\FormExtension; -use Symfony\Bridge\Twig\Form\TwigRenderer; -use Symfony\Bridge\Twig\Form\TwigRendererEngine; -use Symfony\Bridge\Twig\Extension\TranslationExtension; -use Symfony\Bridge\Twig\Tests\Extension\Fixtures\StubTranslator; -use Symfony\Bridge\Twig\Tests\Extension\Fixtures\StubFilesystemLoader; -use Symfony\Component\Form\FormView; -use Symfony\Component\Form\Extension\Core\View\ChoiceView; -use Symfony\Component\Form\Tests\AbstractDivLayoutTest; - -class FormExtensionDivLayoutTest extends AbstractDivLayoutTest -{ - /** - * @var FormExtension - */ - protected $extension; - - protected function setUp() - { - if (!class_exists('Symfony\Component\Locale\Locale')) { - $this->markTestSkipped('The "Locale" component is not available'); - } - - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - - if (!class_exists('Symfony\Component\Form\Form')) { - $this->markTestSkipped('The "Form" component is not available'); - } - - if (!class_exists('Twig_Environment')) { - $this->markTestSkipped('Twig is not available.'); - } - - parent::setUp(); - - $rendererEngine = new TwigRendererEngine(array( - 'form_div_layout.html.twig', - 'custom_widgets.html.twig', - )); - $renderer = new TwigRenderer($rendererEngine, $this->getMock('Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface')); - - $this->extension = new FormExtension($renderer); - - $loader = new StubFilesystemLoader(array( - __DIR__.'/../../Resources/views/Form', - __DIR__, - )); - - $environment = new \Twig_Environment($loader, array('strict_variables' => true)); - $environment->addExtension(new TranslationExtension(new StubTranslator())); - $environment->addGlobal('global', ''); - $environment->addExtension($this->extension); - - $this->extension->initRuntime($environment); - } - - protected function tearDown() - { - parent::tearDown(); - - $this->extension = null; - } - - public function testThemeBlockInheritanceUsingUse() - { - $view = $this->factory - ->createNamed('name', 'email') - ->createView() - ; - - $this->setTheme($view, array('theme_use.html.twig')); - - $this->assertMatchesXpath( - $this->renderWidget($view), - '/input[@type="email"][@rel="theme"]' - ); - } - - public function testThemeBlockInheritanceUsingExtend() - { - $view = $this->factory - ->createNamed('name', 'email') - ->createView() - ; - - $this->setTheme($view, array('theme_extends.html.twig')); - - $this->assertMatchesXpath( - $this->renderWidget($view), - '/input[@type="email"][@rel="theme"]' - ); - } - - public function isSelectedChoiceProvider() - { - // The commented cases should not be necessary anymore, because the - // choice lists should assure that both values passed here are always - // strings - return array( -// array(true, 0, 0), - array(true, '0', '0'), - array(true, '1', '1'), -// array(true, false, 0), -// array(true, true, 1), - array(true, '', ''), -// array(true, null, ''), - array(true, '1.23', '1.23'), - array(true, 'foo', 'foo'), - array(true, 'foo10', 'foo10'), - array(true, 'foo', array(1, 'foo', 'foo10')), - - array(false, 10, array(1, 'foo', 'foo10')), - array(false, 0, array(1, 'foo', 'foo10')), - ); - } - - /** - * @dataProvider isSelectedChoiceProvider - */ - public function testIsChoiceSelected($expected, $choice, $value) - { - $choice = new ChoiceView($choice, $choice, $choice . ' label'); - - $this->assertSame($expected, $this->extension->isSelectedChoice($choice, $value)); - } - - protected function renderEnctype(FormView $view) - { - return (string) $this->extension->renderer->searchAndRenderBlock($view, 'enctype'); - } - - protected function renderLabel(FormView $view, $label = null, array $vars = array()) - { - if ($label !== null) { - $vars += array('label' => $label); - } - - return (string) $this->extension->renderer->searchAndRenderBlock($view, 'label', $vars); - } - - protected function renderErrors(FormView $view) - { - return (string) $this->extension->renderer->searchAndRenderBlock($view, 'errors'); - } - - protected function renderWidget(FormView $view, array $vars = array()) - { - return (string) $this->extension->renderer->searchAndRenderBlock($view, 'widget', $vars); - } - - protected function renderRow(FormView $view, array $vars = array()) - { - return (string) $this->extension->renderer->searchAndRenderBlock($view, 'row', $vars); - } - - protected function renderRest(FormView $view, array $vars = array()) - { - return (string) $this->extension->renderer->searchAndRenderBlock($view, 'rest', $vars); - } - - protected function setTheme(FormView $view, array $themes) - { - $this->extension->renderer->setTheme($view, $themes); - } - - public static function themeBlockInheritanceProvider() - { - return array( - array(array('theme.html.twig')) - ); - } - - public static function themeInheritanceProvider() - { - return array( - array(array('parent_label.html.twig'), array('child_label.html.twig')) - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php deleted file mode 100644 index da0d846..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php +++ /dev/null @@ -1,116 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Tests\Extension; - -use Symfony\Component\Form\FormView; -use Symfony\Bridge\Twig\Form\TwigRenderer; -use Symfony\Bridge\Twig\Form\TwigRendererEngine; -use Symfony\Bridge\Twig\Extension\FormExtension; -use Symfony\Bridge\Twig\Extension\TranslationExtension; -use Symfony\Component\Form\Tests\AbstractTableLayoutTest; -use Symfony\Bridge\Twig\Tests\Extension\Fixtures\StubTranslator; -use Symfony\Bridge\Twig\Tests\Extension\Fixtures\StubFilesystemLoader; - -class FormExtensionTableLayoutTest extends AbstractTableLayoutTest -{ - /** - * @var FormExtension - */ - protected $extension; - - protected function setUp() - { - if (!class_exists('Symfony\Component\Locale\Locale')) { - $this->markTestSkipped('The "Locale" component is not available'); - } - - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - - if (!class_exists('Symfony\Component\Form\Form')) { - $this->markTestSkipped('The "Form" component is not available'); - } - - if (!class_exists('Twig_Environment')) { - $this->markTestSkipped('Twig is not available.'); - } - - parent::setUp(); - - $rendererEngine = new TwigRendererEngine(array( - 'form_table_layout.html.twig', - 'custom_widgets.html.twig', - )); - $renderer = new TwigRenderer($rendererEngine, $this->getMock('Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface')); - - $this->extension = new FormExtension($renderer); - - $loader = new StubFilesystemLoader(array( - __DIR__.'/../../Resources/views/Form', - __DIR__, - )); - - $environment = new \Twig_Environment($loader, array('strict_variables' => true)); - $environment->addExtension(new TranslationExtension(new StubTranslator())); - $environment->addGlobal('global', ''); - $environment->addExtension($this->extension); - - $this->extension->initRuntime($environment); - } - - protected function tearDown() - { - parent::tearDown(); - - $this->extension = null; - } - - protected function renderEnctype(FormView $view) - { - return (string) $this->extension->renderer->searchAndRenderBlock($view, 'enctype'); - } - - protected function renderLabel(FormView $view, $label = null, array $vars = array()) - { - if ($label !== null) { - $vars += array('label' => $label); - } - - return (string) $this->extension->renderer->searchAndRenderBlock($view, 'label', $vars); - } - - protected function renderErrors(FormView $view) - { - return (string) $this->extension->renderer->searchAndRenderBlock($view, 'errors'); - } - - protected function renderWidget(FormView $view, array $vars = array()) - { - return (string) $this->extension->renderer->searchAndRenderBlock($view, 'widget', $vars); - } - - protected function renderRow(FormView $view, array $vars = array()) - { - return (string) $this->extension->renderer->searchAndRenderBlock($view, 'row', $vars); - } - - protected function renderRest(FormView $view, array $vars = array()) - { - return (string) $this->extension->renderer->searchAndRenderBlock($view, 'rest', $vars); - } - - protected function setTheme(FormView $view, array $themes) - { - $this->extension->renderer->setTheme($view, $themes); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php deleted file mode 100644 index b5d8666..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php +++ /dev/null @@ -1,149 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Tests\Extension; - -use Symfony\Bridge\Twig\Extension\TranslationExtension; -use Symfony\Component\Translation\Translator; -use Symfony\Component\Translation\MessageSelector; -use Symfony\Component\Translation\Loader\ArrayLoader; -use Symfony\Bridge\Twig\Tests\TestCase; - -class TranslationExtensionTest extends TestCase -{ - protected function setUp() - { - if (!class_exists('Symfony\Component\Translation\Translator')) { - $this->markTestSkipped('The "Translation" component is not available'); - } - - if (!class_exists('Twig_Environment')) { - $this->markTestSkipped('Twig is not available.'); - } - } - - public function testEscaping() - { - $output = $this->getTemplate('{% trans %}Percent: %value%%% (%msg%){% endtrans %}')->render(array('value' => 12, 'msg' => 'approx.')); - - $this->assertEquals('Percent: 12% (approx.)', $output); - } - - /** - * @dataProvider getTransTests - */ - public function testTrans($template, $expected, array $variables = array()) - { - if ($expected != $this->getTemplate($template)->render($variables)) { - print $template."\n"; - $loader = new \Twig_Loader_Array(array('index' => $template)); - $twig = new \Twig_Environment($loader, array('debug' => true, 'cache' => false)); - $twig->addExtension(new TranslationExtension(new Translator('en', new MessageSelector()))); - - echo $twig->compile($twig->parse($twig->tokenize($twig->getLoader()->getSource('index'), 'index')))."\n\n"; - $this->assertEquals($expected, $this->getTemplate($template)->render($variables)); - } - - $this->assertEquals($expected, $this->getTemplate($template)->render($variables)); - } - - public function getTransTests() - { - return array( - // trans tag - array('{% trans %}Hello{% endtrans %}', 'Hello'), - array('{% trans %}%name%{% endtrans %}', 'Symfony2', array('name' => 'Symfony2')), - - array('{% trans from elsewhere %}Hello{% endtrans %}', 'Hello'), - - array('{% trans %}Hello %name%{% endtrans %}', 'Hello Symfony2', array('name' => 'Symfony2')), - array('{% trans with { \'%name%\': \'Symfony2\' } %}Hello %name%{% endtrans %}', 'Hello Symfony2'), - array('{% set vars = { \'%name%\': \'Symfony2\' } %}{% trans with vars %}Hello %name%{% endtrans %}', 'Hello Symfony2'), - - array('{% trans into "fr"%}Hello{% endtrans %}', 'Hello'), - - // transchoice - array('{% transchoice count from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}', - 'There is no apples', array('count' => 0)), - array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}', - 'There is 5 apples', array('count' => 5)), - array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}', - 'There is 5 apples (Symfony2)', array('count' => 5, 'name' => 'Symfony2')), - array('{% transchoice count with { \'%name%\': \'Symfony2\' } %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}', - 'There is 5 apples (Symfony2)', array('count' => 5)), - array('{% transchoice count into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}', - 'There is no apples', array('count' => 0)), - - // trans filter - array('{{ "Hello"|trans }}', 'Hello'), - array('{{ name|trans }}', 'Symfony2', array('name' => 'Symfony2')), - array('{{ hello|trans({ \'%name%\': \'Symfony2\' }) }}', 'Hello Symfony2', array('hello' => 'Hello %name%')), - array('{% set vars = { \'%name%\': \'Symfony2\' } %}{{ hello|trans(vars) }}', 'Hello Symfony2', array('hello' => 'Hello %name%')), - array('{{ "Hello"|trans({}, "messages", "fr") }}', 'Hello'), - - // transchoice filter - array('{{ "{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples"|transchoice(count) }}', 'There is 5 apples', array('count' => 5)), - array('{{ text|transchoice(5, {\'%name%\': \'Symfony2\'}) }}', 'There is 5 apples (Symfony2)', array('text' => '{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%)')), - array('{{ "{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples"|transchoice(count, {}, "messages", "fr") }}', 'There is 5 apples', array('count' => 5)), - ); - } - - public function testDefaultTranslationDomain() - { - $templates = array( - 'index' => ' - {%- extends "base" %} - - {%- trans_default_domain "foo" %} - - {%- block content %} - {%- trans %}foo{% endtrans %} - {%- trans from "custom" %}foo{% endtrans %} - {{- "foo"|trans }} - {{- "foo"|trans({}, "custom") }} - {{- "foo"|transchoice(1) }} - {{- "foo"|transchoice(1, {}, "custom") }} - {% endblock %} - ', - - 'base' => ' - {%- block content "" %} - ', - ); - - $translator = new Translator('en', new MessageSelector()); - $translator->addLoader('array', new ArrayLoader()); - $translator->addResource('array', array('foo' => 'foo (messages)'), 'en'); - $translator->addResource('array', array('foo' => 'foo (custom)'), 'en', 'custom'); - $translator->addResource('array', array('foo' => 'foo (foo)'), 'en', 'foo'); - - $template = $this->getTemplate($templates, $translator); - - $this->assertEquals('foo (foo)foo (custom)foo (foo)foo (custom)foo (foo)foo (custom)', trim($template->render(array()))); - } - - protected function getTemplate($template, $translator = null) - { - if (null === $translator) { - $translator = new Translator('en', new MessageSelector()); - } - - if (is_array($template)) { - $loader = new \Twig_Loader_Array($template); - } else { - $loader = new \Twig_Loader_Array(array('index' => $template)); - } - $twig = new \Twig_Environment($loader, array('debug' => true, 'cache' => false)); - $twig->addExtension(new TranslationExtension($translator)); - - return $twig->loadTemplate('index'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/child_label.html.twig b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/child_label.html.twig deleted file mode 100644 index 8c7c248..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/child_label.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% block form_label %} - -{% endblock form_label %} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/custom_widgets.html.twig b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/custom_widgets.html.twig deleted file mode 100644 index 12fd7c6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/custom_widgets.html.twig +++ /dev/null @@ -1,16 +0,0 @@ -{% block _text_id_widget %} -{% spaceless %} -
    - {{ form_widget(form) }} -
    -{% endspaceless %} -{% endblock _text_id_widget %} - -{% block _name_entry_label %} -{% spaceless %} - {% if label is empty %} - {% set label = name|humanize %} - {% endif %} - -{% endspaceless %} -{% endblock _name_entry_label %} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/parent_label.html.twig b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/parent_label.html.twig deleted file mode 100644 index e96278b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/parent_label.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% block form_label %} - -{% endblock form_label %} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/theme.html.twig b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/theme.html.twig deleted file mode 100644 index da1c1b6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/theme.html.twig +++ /dev/null @@ -1,6 +0,0 @@ -{% block form_widget_simple %} -{% spaceless %} - {% set type = type|default('text') %} - -{% endspaceless %} -{% endblock form_widget_simple %} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/theme_extends.html.twig b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/theme_extends.html.twig deleted file mode 100644 index 8c71986..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/theme_extends.html.twig +++ /dev/null @@ -1,8 +0,0 @@ -{% extends 'form_div_layout.html.twig' %} - -{% block form_widget_simple %} -{% spaceless %} - {% set type = type|default('text') %} - -{% endspaceless %} -{% endblock form_widget_simple %} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/theme_use.html.twig b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/theme_use.html.twig deleted file mode 100644 index d485b8d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/theme_use.html.twig +++ /dev/null @@ -1,8 +0,0 @@ -{% use 'form_div_layout.html.twig' %} - -{% block form_widget_simple %} -{% spaceless %} - {% set type = type|default('text') %} - -{% endspaceless %} -{% endblock form_widget_simple %} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php deleted file mode 100644 index 90afef1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Tests\Node; - -use Symfony\Bridge\Twig\Tests\TestCase; -use Symfony\Bridge\Twig\Node\FormThemeNode; - -class FormThemeTest extends TestCase -{ - protected function setUp() - { - parent::setUp(); - - if (version_compare(\Twig_Environment::VERSION, '1.5.0', '<')) { - $this->markTestSkipped('Requires Twig version to be at least 1.5.0.'); - } - } - - public function testConstructor() - { - $form = new \Twig_Node_Expression_Name('form', 0); - $resources = new \Twig_Node(array( - new \Twig_Node_Expression_Constant('tpl1', 0), - new \Twig_Node_Expression_Constant('tpl2', 0) - )); - - $node = new FormThemeNode($form, $resources, 0); - - $this->assertEquals($form, $node->getNode('form')); - $this->assertEquals($resources, $node->getNode('resources')); - } - - public function testCompile() - { - $form = new \Twig_Node_Expression_Name('form', 0); - $resources = new \Twig_Node_Expression_Array(array( - new \Twig_Node_Expression_Constant(0, 0), - new \Twig_Node_Expression_Constant('tpl1', 0), - new \Twig_Node_Expression_Constant(1, 0), - new \Twig_Node_Expression_Constant('tpl2', 0) - ), 0); - - $node = new FormThemeNode($form, $resources, 0); - - $compiler = new \Twig_Compiler(new \Twig_Environment()); - - $this->assertEquals( - sprintf( - '$this->env->getExtension(\'form\')->renderer->setTheme(%s, array(0 => "tpl1", 1 => "tpl2"));', - $this->getVariableGetter('form') - ), - trim($compiler->compile($node)->getSource()) - ); - - $resources = new \Twig_Node_Expression_Constant('tpl1', 0); - - $node = new FormThemeNode($form, $resources, 0); - - $this->assertEquals( - sprintf( - '$this->env->getExtension(\'form\')->renderer->setTheme(%s, "tpl1");', - $this->getVariableGetter('form') - ), - trim($compiler->compile($node)->getSource()) - ); - } - - protected function getVariableGetter($name) - { - if (version_compare(phpversion(), '5.4.0RC1', '>=')) { - return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name); - } - - return sprintf('$this->getContext($context, "%s")', $name); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php deleted file mode 100644 index c1f247c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php +++ /dev/null @@ -1,282 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Tests\Node; - -use Symfony\Bridge\Twig\Tests\TestCase; -use Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode; - -class SearchAndRenderBlockNodeTest extends TestCase -{ - protected function setUp() - { - parent::setUp(); - - if (version_compare(\Twig_Environment::VERSION, '1.5.0', '<')) { - $this->markTestSkipped('Requires Twig version to be at least 1.5.0.'); - } - } - - public function testCompileWidget() - { - $arguments = new \Twig_Node(array( - new \Twig_Node_Expression_Name('form', 0), - )); - - $node = new SearchAndRenderBlockNode('form_widget', $arguments, 0); - - $compiler = new \Twig_Compiler(new \Twig_Environment()); - - $this->assertEquals( - sprintf( - '$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock(%s, \'widget\')', - $this->getVariableGetter('form') - ), - trim($compiler->compile($node)->getSource()) - ); - } - - public function testCompileWidgetWithVariables() - { - $arguments = new \Twig_Node(array( - new \Twig_Node_Expression_Name('form', 0), - new \Twig_Node_Expression_Array(array( - new \Twig_Node_Expression_Constant('foo', 0), - new \Twig_Node_Expression_Constant('bar', 0), - ), 0), - )); - - $node = new SearchAndRenderBlockNode('form_widget', $arguments, 0); - - $compiler = new \Twig_Compiler(new \Twig_Environment()); - - $this->assertEquals( - sprintf( - '$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock(%s, \'widget\', array("foo" => "bar"))', - $this->getVariableGetter('form') - ), - trim($compiler->compile($node)->getSource()) - ); - } - - public function testCompileLabelWithLabel() - { - $arguments = new \Twig_Node(array( - new \Twig_Node_Expression_Name('form', 0), - new \Twig_Node_Expression_Constant('my label', 0), - )); - - $node = new SearchAndRenderBlockNode('form_label', $arguments, 0); - - $compiler = new \Twig_Compiler(new \Twig_Environment()); - - $this->assertEquals( - sprintf( - '$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock(%s, \'label\', array("label" => "my label"))', - $this->getVariableGetter('form') - ), - trim($compiler->compile($node)->getSource()) - ); - } - - public function testCompileLabelWithNullLabel() - { - $arguments = new \Twig_Node(array( - new \Twig_Node_Expression_Name('form', 0), - new \Twig_Node_Expression_Constant(null, 0), - )); - - $node = new SearchAndRenderBlockNode('form_label', $arguments, 0); - - $compiler = new \Twig_Compiler(new \Twig_Environment()); - - // "label" => null must not be included in the output! - // Otherwise the default label is overwritten with null. - $this->assertEquals( - sprintf( - '$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock(%s, \'label\')', - $this->getVariableGetter('form') - ), - trim($compiler->compile($node)->getSource()) - ); - } - - public function testCompileLabelWithEmptyStringLabel() - { - $arguments = new \Twig_Node(array( - new \Twig_Node_Expression_Name('form', 0), - new \Twig_Node_Expression_Constant('', 0), - )); - - $node = new SearchAndRenderBlockNode('form_label', $arguments, 0); - - $compiler = new \Twig_Compiler(new \Twig_Environment()); - - // "label" => null must not be included in the output! - // Otherwise the default label is overwritten with null. - $this->assertEquals( - sprintf( - '$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock(%s, \'label\')', - $this->getVariableGetter('form') - ), - trim($compiler->compile($node)->getSource()) - ); - } - - public function testCompileLabelWithDefaultLabel() - { - $arguments = new \Twig_Node(array( - new \Twig_Node_Expression_Name('form', 0), - )); - - $node = new SearchAndRenderBlockNode('form_label', $arguments, 0); - - $compiler = new \Twig_Compiler(new \Twig_Environment()); - - $this->assertEquals( - sprintf( - '$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock(%s, \'label\')', - $this->getVariableGetter('form') - ), - trim($compiler->compile($node)->getSource()) - ); - } - - public function testCompileLabelWithAttributes() - { - $arguments = new \Twig_Node(array( - new \Twig_Node_Expression_Name('form', 0), - new \Twig_Node_Expression_Constant(null, 0), - new \Twig_Node_Expression_Array(array( - new \Twig_Node_Expression_Constant('foo', 0), - new \Twig_Node_Expression_Constant('bar', 0), - ), 0), - )); - - $node = new SearchAndRenderBlockNode('form_label', $arguments, 0); - - $compiler = new \Twig_Compiler(new \Twig_Environment()); - - // "label" => null must not be included in the output! - // Otherwise the default label is overwritten with null. - // https://github.com/symfony/symfony/issues/5029 - $this->assertEquals( - sprintf( - '$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock(%s, \'label\', array("foo" => "bar"))', - $this->getVariableGetter('form') - ), - trim($compiler->compile($node)->getSource()) - ); - } - - public function testCompileLabelWithLabelAndAttributes() - { - $arguments = new \Twig_Node(array( - new \Twig_Node_Expression_Name('form', 0), - new \Twig_Node_Expression_Constant('value in argument', 0), - new \Twig_Node_Expression_Array(array( - new \Twig_Node_Expression_Constant('foo', 0), - new \Twig_Node_Expression_Constant('bar', 0), - new \Twig_Node_Expression_Constant('label', 0), - new \Twig_Node_Expression_Constant('value in attributes', 0), - ), 0), - )); - - $node = new SearchAndRenderBlockNode('form_label', $arguments, 0); - - $compiler = new \Twig_Compiler(new \Twig_Environment()); - - $this->assertEquals( - sprintf( - '$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock(%s, \'label\', array("foo" => "bar", "label" => "value in argument"))', - $this->getVariableGetter('form') - ), - trim($compiler->compile($node)->getSource()) - ); - } - - public function testCompileLabelWithLabelThatEvaluatesToNull() - { - $arguments = new \Twig_Node(array( - new \Twig_Node_Expression_Name('form', 0), - new \Twig_Node_Expression_Conditional( - // if - new \Twig_Node_Expression_Constant(true, 0), - // then - new \Twig_Node_Expression_Constant(null, 0), - // else - new \Twig_Node_Expression_Constant(null, 0), - 0 - ), - )); - - $node = new SearchAndRenderBlockNode('form_label', $arguments, 0); - - $compiler = new \Twig_Compiler(new \Twig_Environment()); - - // "label" => null must not be included in the output! - // Otherwise the default label is overwritten with null. - // https://github.com/symfony/symfony/issues/5029 - $this->assertEquals( - sprintf( - '$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock(%s, \'label\', (twig_test_empty($_label_ = ((true) ? (null) : (null))) ? array() : array("label" => $_label_)))', - $this->getVariableGetter('form') - ), - trim($compiler->compile($node)->getSource()) - ); - } - - public function testCompileLabelWithLabelThatEvaluatesToNullAndAttributes() - { - $arguments = new \Twig_Node(array( - new \Twig_Node_Expression_Name('form', 0), - new \Twig_Node_Expression_Conditional( - // if - new \Twig_Node_Expression_Constant(true, 0), - // then - new \Twig_Node_Expression_Constant(null, 0), - // else - new \Twig_Node_Expression_Constant(null, 0), - 0 - ), - new \Twig_Node_Expression_Array(array( - new \Twig_Node_Expression_Constant('foo', 0), - new \Twig_Node_Expression_Constant('bar', 0), - new \Twig_Node_Expression_Constant('label', 0), - new \Twig_Node_Expression_Constant('value in attributes', 0), - ), 0), - )); - - $node = new SearchAndRenderBlockNode('form_label', $arguments, 0); - - $compiler = new \Twig_Compiler(new \Twig_Environment()); - - // "label" => null must not be included in the output! - // Otherwise the default label is overwritten with null. - // https://github.com/symfony/symfony/issues/5029 - $this->assertEquals( - sprintf( - '$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock(%s, \'label\', array("foo" => "bar", "label" => "value in attributes") + (twig_test_empty($_label_ = ((true) ? (null) : (null))) ? array() : array("label" => $_label_)))', - $this->getVariableGetter('form') - ), - trim($compiler->compile($node)->getSource()) - ); - } - - protected function getVariableGetter($name) - { - if (version_compare(phpversion(), '5.4.0RC1', '>=')) { - return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name); - } - - return sprintf('$this->getContext($context, "%s")', $name); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/TestCase.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/TestCase.php deleted file mode 100644 index ecfb7da..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/TestCase.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Tests; - -abstract class TestCase extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!class_exists('Twig_Environment')) { - $this->markTestSkipped('Twig is not available.'); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/TokenParser/FormThemeTokenParserTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/TokenParser/FormThemeTokenParserTest.php deleted file mode 100644 index 077cd76..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/TokenParser/FormThemeTokenParserTest.php +++ /dev/null @@ -1,108 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Tests\Node; - -use Symfony\Bridge\Twig\Tests\TestCase; -use Symfony\Bridge\Twig\TokenParser\FormThemeTokenParser; -use Symfony\Bridge\Twig\Node\FormThemeNode; - -class FormThemeTokenParserTest extends TestCase -{ - protected function setUp() - { - parent::setUp(); - - if (version_compare(\Twig_Environment::VERSION, '1.5.0', '<')) { - $this->markTestSkipped('Requires Twig version to be at least 1.5.0.'); - } - } - - /** - * @dataProvider getTestsForFormTheme - */ - public function testCompile($source, $expected) - { - $env = new \Twig_Environment(new \Twig_Loader_String(), array('cache' => false, 'autoescape' => false, 'optimizations' => 0)); - $env->addTokenParser(new FormThemeTokenParser()); - $stream = $env->tokenize($source); - $parser = new \Twig_Parser($env); - - $this->assertEquals($expected, $parser->parse($stream)->getNode('body')->getNode(0)); - } - - public function getTestsForFormTheme() - { - return array( - array( - '{% form_theme form "tpl1" %}', - new FormThemeNode( - new \Twig_Node_Expression_Name('form', 1), - new \Twig_Node_Expression_Array(array( - new \Twig_Node_Expression_Constant(0, 1), - new \Twig_Node_Expression_Constant('tpl1', 1), - ), 1), - 1, - 'form_theme' - ) - ), - array( - '{% form_theme form "tpl1" "tpl2" %}', - new FormThemeNode( - new \Twig_Node_Expression_Name('form', 1), - new \Twig_Node_Expression_Array(array( - new \Twig_Node_Expression_Constant(0, 1), - new \Twig_Node_Expression_Constant('tpl1', 1), - new \Twig_Node_Expression_Constant(1, 1), - new \Twig_Node_Expression_Constant('tpl2', 1) - ), 1), - 1, - 'form_theme' - ) - ), - array( - '{% form_theme form with "tpl1" %}', - new FormThemeNode( - new \Twig_Node_Expression_Name('form', 1), - new \Twig_Node_Expression_Constant('tpl1', 1), - 1, - 'form_theme' - ) - ), - array( - '{% form_theme form with ["tpl1"] %}', - new FormThemeNode( - new \Twig_Node_Expression_Name('form', 1), - new \Twig_Node_Expression_Array(array( - new \Twig_Node_Expression_Constant(0, 1), - new \Twig_Node_Expression_Constant('tpl1', 1), - ), 1), - 1, - 'form_theme' - ) - ), - array( - '{% form_theme form with ["tpl1", "tpl2"] %}', - new FormThemeNode( - new \Twig_Node_Expression_Name('form', 1), - new \Twig_Node_Expression_Array(array( - new \Twig_Node_Expression_Constant(0, 1), - new \Twig_Node_Expression_Constant('tpl1', 1), - new \Twig_Node_Expression_Constant(1, 1), - new \Twig_Node_Expression_Constant('tpl2', 1) - ), 1), - 1, - 'form_theme' - ) - ), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Translation/TwigExtractorTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Translation/TwigExtractorTest.php deleted file mode 100644 index 2d6ffdf..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Translation/TwigExtractorTest.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Tests\Translation; - -use Symfony\Bridge\Twig\Extension\TranslationExtension; -use Symfony\Bridge\Twig\Translation\TwigExtractor; -use Symfony\Component\Translation\MessageCatalogue; -use Symfony\Bridge\Twig\Tests\TestCase; - -class TwigExtractorTest extends TestCase -{ - protected function setUp() - { - if (!class_exists('Symfony\Component\Translation\Translator')) { - $this->markTestSkipped('The "Translation" component is not available'); - } - } - - /** - * @dataProvider getExtractData - */ - public function testExtract($template, $messages) - { - $loader = new \Twig_Loader_Array(array()); - $twig = new \Twig_Environment($loader, array( - 'strict_variables' => true, - 'debug' => true, - 'cache' => false, - 'autoescape' => false, - )); - $twig->addExtension(new TranslationExtension($this->getMock('Symfony\Component\Translation\TranslatorInterface'))); - - $extractor = new TwigExtractor($twig); - $extractor->setPrefix('prefix'); - $catalogue = new MessageCatalogue('en'); - - $m = new \ReflectionMethod($extractor, 'extractTemplate'); - $m->setAccessible(true); - $m->invoke($extractor, $template, $catalogue); - - foreach ($messages as $key => $domain) { - $this->assertTrue($catalogue->has($key, $domain)); - $this->assertEquals('prefix'.$key, $catalogue->get($key, $domain)); - } - } - - public function getExtractData() - { - return array( - array('{{ "new key" | trans() }}', array('new key' => 'messages')), - array('{{ "new key" | trans() | upper }}', array('new key' => 'messages')), - array('{{ "new key" | trans({}, "domain") }}', array('new key' => 'domain')), - array('{{ "new key" | transchoice(1) }}', array('new key' => 'messages')), - array('{{ "new key" | transchoice(1) | upper }}', array('new key' => 'messages')), - array('{{ "new key" | transchoice(1, {}, "domain") }}', array('new key' => 'domain')), - array('{% trans %}new key{% endtrans %}', array('new key' => 'messages')), - array('{% trans from "domain" %}new key{% endtrans %}', array('new key' => 'domain')), - array('{% set foo = "new key" | trans %}', array('new key' => 'messages')), - array('{{ 1 ? "new key" | trans : "another key" | trans }}', array('new key' => 'messages', 'another key' => 'messages')), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/bootstrap.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/bootstrap.php deleted file mode 100644 index dffd6eb..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/bootstrap.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) { - require_once $loader; -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TokenParser/FormThemeTokenParser.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TokenParser/FormThemeTokenParser.php deleted file mode 100644 index 244d676..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TokenParser/FormThemeTokenParser.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\TokenParser; - -use Symfony\Bridge\Twig\Node\FormThemeNode; - -/** - * Token Parser for the 'form_theme' tag. - * - * @author Fabien Potencier - */ -class FormThemeTokenParser extends \Twig_TokenParser -{ - /** - * Parses a token and returns a node. - * - * @param \Twig_Token $token A Twig_Token instance - * - * @return \Twig_NodeInterface A Twig_NodeInterface instance - */ - public function parse(\Twig_Token $token) - { - $lineno = $token->getLine(); - $stream = $this->parser->getStream(); - - $form = $this->parser->getExpressionParser()->parseExpression(); - - if ($this->parser->getStream()->test(\Twig_Token::NAME_TYPE, 'with')) { - $this->parser->getStream()->next(); - $resources = $this->parser->getExpressionParser()->parseExpression(); - } else { - $resources = new \Twig_Node_Expression_Array(array(), $stream->getCurrent()->getLine()); - do { - $resources->addElement($this->parser->getExpressionParser()->parseExpression()); - } while (!$stream->test(\Twig_Token::BLOCK_END_TYPE)); - } - - $stream->expect(\Twig_Token::BLOCK_END_TYPE); - - return new FormThemeNode($form, $resources, $lineno, $this->getTag()); - } - - /** - * Gets the tag name associated with this token parser. - * - * @return string The tag name - */ - public function getTag() - { - return 'form_theme'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TokenParser/TransChoiceTokenParser.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TokenParser/TransChoiceTokenParser.php deleted file mode 100644 index 872bd2e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TokenParser/TransChoiceTokenParser.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\TokenParser; - -use Symfony\Bridge\Twig\Node\TransNode; - -/** - * Token Parser for the 'transchoice' tag. - * - * @author Fabien Potencier - */ -class TransChoiceTokenParser extends TransTokenParser -{ - /** - * Parses a token and returns a node. - * - * @param \Twig_Token $token A Twig_Token instance - * - * @return \Twig_NodeInterface A Twig_NodeInterface instance - */ - public function parse(\Twig_Token $token) - { - $lineno = $token->getLine(); - $stream = $this->parser->getStream(); - - $vars = new \Twig_Node_Expression_Array(array(), $lineno); - - $count = $this->parser->getExpressionParser()->parseExpression(); - - $domain = null; - $locale = null; - - if ($stream->test('with')) { - // {% transchoice count with vars %} - $stream->next(); - $vars = $this->parser->getExpressionParser()->parseExpression(); - } - - if ($stream->test('from')) { - // {% transchoice count from "messages" %} - $stream->next(); - $domain = $this->parser->getExpressionParser()->parseExpression(); - } - - if ($stream->test('into')) { - // {% transchoice count into "fr" %} - $stream->next(); - $locale = $this->parser->getExpressionParser()->parseExpression(); - } - - $stream->expect(\Twig_Token::BLOCK_END_TYPE); - - $body = $this->parser->subparse(array($this, 'decideTransChoiceFork'), true); - - if (!$body instanceof \Twig_Node_Text && !$body instanceof \Twig_Node_Expression) { - throw new \Twig_Error_Syntax('A message must be a simple text.'); - } - - $stream->expect(\Twig_Token::BLOCK_END_TYPE); - - return new TransNode($body, $domain, $count, $vars, $locale, $lineno, $this->getTag()); - } - - public function decideTransChoiceFork($token) - { - return $token->test(array('endtranschoice')); - } - - /** - * Gets the tag name associated with this token parser. - * - * @return string The tag name - */ - public function getTag() - { - return 'transchoice'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TokenParser/TransDefaultDomainTokenParser.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TokenParser/TransDefaultDomainTokenParser.php deleted file mode 100644 index 0a0ed55..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TokenParser/TransDefaultDomainTokenParser.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\TokenParser; - -use Symfony\Bridge\Twig\Node\TransDefaultDomainNode; - -/** - * Token Parser for the 'trans_default_domain' tag. - * - * @author Fabien Potencier - */ -class TransDefaultDomainTokenParser extends \Twig_TokenParser -{ - /** - * Parses a token and returns a node. - * - * @param \Twig_Token $token A Twig_Token instance - * - * @return \Twig_NodeInterface A Twig_NodeInterface instance - */ - public function parse(\Twig_Token $token) - { - $expr = $this->parser->getExpressionParser()->parseExpression(); - - $this->parser->getStream()->expect(\Twig_Token::BLOCK_END_TYPE); - - return new TransDefaultDomainNode($expr, $token->getLine(), $this->getTag()); - } - - /** - * Gets the tag name associated with this token parser. - * - * @return string The tag name - */ - public function getTag() - { - return 'trans_default_domain'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php deleted file mode 100644 index 082c4a4..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\TokenParser; - -use Symfony\Bridge\Twig\Node\TransNode; - -/** - * Token Parser for the 'trans' tag. - * - * @author Fabien Potencier - */ -class TransTokenParser extends \Twig_TokenParser -{ - /** - * Parses a token and returns a node. - * - * @param \Twig_Token $token A Twig_Token instance - * - * @return \Twig_NodeInterface A Twig_NodeInterface instance - */ - public function parse(\Twig_Token $token) - { - $lineno = $token->getLine(); - $stream = $this->parser->getStream(); - - $vars = new \Twig_Node_Expression_Array(array(), $lineno); - $domain = null; - $locale = null; - if (!$stream->test(\Twig_Token::BLOCK_END_TYPE)) { - if ($stream->test('with')) { - // {% trans with vars %} - $stream->next(); - $vars = $this->parser->getExpressionParser()->parseExpression(); - } - - if ($stream->test('from')) { - // {% trans from "messages" %} - $stream->next(); - $domain = $this->parser->getExpressionParser()->parseExpression(); - } - - if ($stream->test('into')) { - // {% trans into "fr" %} - $stream->next(); - $locale = $this->parser->getExpressionParser()->parseExpression(); - } elseif (!$stream->test(\Twig_Token::BLOCK_END_TYPE)) { - throw new \Twig_Error_Syntax('Unexpected token. Twig was looking for the "with" or "from" keyword.'); - } - } - - // {% trans %}message{% endtrans %} - $stream->expect(\Twig_Token::BLOCK_END_TYPE); - $body = $this->parser->subparse(array($this, 'decideTransFork'), true); - - if (!$body instanceof \Twig_Node_Text && !$body instanceof \Twig_Node_Expression) { - throw new \Twig_Error_Syntax('A message inside a trans tag must be a simple text'); - } - - $stream->expect(\Twig_Token::BLOCK_END_TYPE); - - return new TransNode($body, $domain, null, $vars, $locale, $lineno, $this->getTag()); - } - - public function decideTransFork($token) - { - return $token->test(array('endtrans')); - } - - /** - * Gets the tag name associated with this token parser. - * - * @return string The tag name - */ - public function getTag() - { - return 'trans'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Translation/TwigExtractor.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Translation/TwigExtractor.php deleted file mode 100644 index b1dc386..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Translation/TwigExtractor.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig\Translation; - -use Symfony\Component\Finder\Finder; -use Symfony\Component\Translation\Extractor\ExtractorInterface; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * TwigExtractor extracts translation messages from a twig template. - * - * @author Michel Salib - * @author Fabien Potencier - */ -class TwigExtractor implements ExtractorInterface -{ - /** - * Default domain for found messages. - * - * @var string - */ - private $defaultDomain = 'messages'; - - /** - * Prefix for found message. - * - * @var string - */ - private $prefix = ''; - - /** - * The twig environment. - * @var \Twig_Environment - */ - private $twig; - - public function __construct(\Twig_Environment $twig) - { - $this->twig = $twig; - } - - /** - * {@inheritDoc} - */ - public function extract($directory, MessageCatalogue $catalogue) - { - // load any existing translation files - $finder = new Finder(); - $files = $finder->files()->name('*.twig')->in($directory); - foreach ($files as $file) { - $this->extractTemplate(file_get_contents($file->getPathname()), $catalogue); - } - } - - /** - * {@inheritDoc} - */ - public function setPrefix($prefix) - { - $this->prefix = $prefix; - } - - protected function extractTemplate($template, MessageCatalogue $catalogue) - { - $visitor = $this->twig->getExtension('translator')->getTranslationNodeVisitor(); - $visitor->enable(); - - $this->twig->parse($this->twig->tokenize($template)); - - foreach ($visitor->getMessages() as $message) { - $catalogue->set($message[0], $this->prefix.$message[0], $message[1] ? $message[1] : $this->defaultDomain); - } - - $visitor->disable(); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php deleted file mode 100644 index 955d4e0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php +++ /dev/null @@ -1,126 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Twig; - -use Symfony\Component\Templating\EngineInterface; -use Symfony\Component\Templating\StreamingEngineInterface; -use Symfony\Component\Templating\TemplateNameParserInterface; - -/** - * This engine knows how to render Twig templates. - * - * @author Fabien Potencier - */ -class TwigEngine implements EngineInterface, StreamingEngineInterface -{ - protected $environment; - protected $parser; - - /** - * Constructor. - * - * @param \Twig_Environment $environment A \Twig_Environment instance - * @param TemplateNameParserInterface $parser A TemplateNameParserInterface instance - */ - public function __construct(\Twig_Environment $environment, TemplateNameParserInterface $parser) - { - $this->environment = $environment; - $this->parser = $parser; - } - - /** - * Renders a template. - * - * @param mixed $name A template name - * @param array $parameters An array of parameters to pass to the template - * - * @return string The evaluated template as a string - * - * @throws \InvalidArgumentException if the template does not exist - * @throws \RuntimeException if the template cannot be rendered - */ - public function render($name, array $parameters = array()) - { - return $this->load($name)->render($parameters); - } - - /** - * Streams a template. - * - * @param mixed $name A template name or a TemplateReferenceInterface instance - * @param array $parameters An array of parameters to pass to the template - * - * @throws \RuntimeException if the template cannot be rendered - */ - public function stream($name, array $parameters = array()) - { - $this->load($name)->display($parameters); - } - - /** - * Returns true if the template exists. - * - * @param mixed $name A template name - * - * @return Boolean true if the template exists, false otherwise - */ - public function exists($name) - { - try { - $this->load($name); - } catch (\InvalidArgumentException $e) { - return false; - } - - return true; - } - - /** - * Returns true if this class is able to render the given template. - * - * @param string $name A template name - * - * @return Boolean True if this class supports the given resource, false otherwise - */ - public function supports($name) - { - if ($name instanceof \Twig_Template) { - return true; - } - - $template = $this->parser->parse($name); - - return 'twig' === $template->get('engine'); - } - - /** - * Loads the given template. - * - * @param mixed $name A template name or an instance of Twig_Template - * - * @return \Twig_TemplateInterface A \Twig_TemplateInterface instance - * - * @throws \InvalidArgumentException if the template does not exist - */ - protected function load($name) - { - if ($name instanceof \Twig_Template) { - return $name; - } - - try { - return $this->environment->loadTemplate($name); - } catch (\Twig_Error_Loader $e) { - throw new \InvalidArgumentException($e->getMessage(), $e->getCode(), $e); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/composer.json b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/composer.json deleted file mode 100644 index c86cb1b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/composer.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "symfony/twig-bridge", - "type": "symfony-bridge", - "description": "Symfony Twig Bridge", - "keywords": [], - "homepage": "http://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "require": { - "php": ">=5.3.3", - "twig/twig": ">=1.9.1,<2.0-dev" - }, - "require-dev": { - "symfony/form": "2.1.*", - "symfony/routing": "2.1.*", - "symfony/templating": "2.1.*", - "symfony/translation": "2.1.*", - "symfony/yaml": "2.1.*", - "symfony/security": "2.1.*" - }, - "suggest": { - "symfony/form": "self.version", - "symfony/routing": "self.version", - "symfony/templating": "self.version", - "symfony/translation": "self.version", - "symfony/yaml": "self.version", - "symfony/security": "self.version" - }, - "autoload": { - "psr-0": { "Symfony\\Bridge\\Twig": "" } - }, - "target-dir": "Symfony/Bridge/Twig", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/phpunit.xml.dist b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/phpunit.xml.dist deleted file mode 100644 index f0f8181..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/phpunit.xml.dist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - ./Tests/ - - - - - - ./ - - ./Resources - ./Tests - ./vendor - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md deleted file mode 100644 index 986ca4f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md +++ /dev/null @@ -1,43 +0,0 @@ -CHANGELOG -========= - -2.1.0 ------ - - * moved the translation files to the Form and Validator components - * changed the default extension for XLIFF files from .xliff to .xlf - * moved Symfony\Bundle\FrameworkBundle\ContainerAwareEventDispatcher to Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher - * moved Symfony\Bundle\FrameworkBundle\Debug\TraceableEventDispatcher to Symfony\Component\EventDispatcher\ContainerAwareTraceableEventDispatcher - * added a router:match command - * added a config:dump-reference command - * added a server:run command - * added kernel.event_subscriber tag - * added a way to create relative symlinks when running assets:install command (--relative option) - * added Controller::getUser() - * [BC BREAK] assets_base_urls and base_urls merging strategy has changed - * changed the default profiler storage to use the filesystem instead of SQLite - * added support for placeholders in route defaults and requirements (replaced - by the value set in the service container) - * added Filesystem component as a dependency - * added support for hinclude (use ``standalone: 'js'`` in render tag) - * session options: lifetime, path, domain, secure, httponly were deprecated. - Prefixed versions should now be used instead: cookie_lifetime, cookie_path, - cookie_domain, cookie_secure, cookie_httponly - * [BC BREAK] following session options: 'lifetime', 'path', 'domain', 'secure', - 'httponly' are now prefixed with cookie_ when dumped to the container - * Added `handler_id` configuration under `session` key to represent `session.handler` - service, defaults to `session.handler.native_file`. - * Added `gc_maxlifetime`, `gc_probability`, and `gc_divisor` to session - configuration. This means session garbage collection has a - `gc_probability`/`gc_divisor` chance of being run. The `gc_maxlifetime` defines - how long a session can idle for. It is different from cookie lifetime which - declares how long a cookie can be stored on the remote client. - * Removed 'auto_start' configuration parameter from session config. The session will - start on demand. - * [BC BREAK] TemplateNameParser::parseFromFilename() has been moved to a dedicated - parser: TemplateFilenameParser::parse(). - * [BC BREAK] Kernel parameters are replaced by their value wherever they appear - in Route patterns, requirements and defaults. Use '%%' as the escaped value for '%'. - * [BC BREAK] Switched behavior of flash messages to expire flash messages on retrieval - using Symfony\Component\HttpFoundation\Session\Flash\FlashBag as opposed to on - next pageload regardless of whether they are displayed or not. \ No newline at end of file diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/RouterCacheWarmer.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/RouterCacheWarmer.php deleted file mode 100644 index df7261b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/RouterCacheWarmer.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\CacheWarmer; - -use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface; -use Symfony\Component\HttpKernel\CacheWarmer\WarmableInterface; -use Symfony\Component\Routing\RouterInterface; - -/** - * Generates the router matcher and generator classes. - * - * @author Fabien Potencier - */ -class RouterCacheWarmer implements CacheWarmerInterface -{ - protected $router; - - /** - * Constructor. - * - * @param Router $router A Router instance - */ - public function __construct(RouterInterface $router) - { - $this->router = $router; - } - - /** - * Warms up the cache. - * - * @param string $cacheDir The cache directory - */ - public function warmUp($cacheDir) - { - if ($this->router instanceof WarmableInterface) { - $this->router->warmUp($cacheDir); - } - } - - /** - * Checks whether this warmer is optional or not. - * - * @return Boolean always true - */ - public function isOptional() - { - return true; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinder.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinder.php deleted file mode 100644 index 7c441a8..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinder.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\CacheWarmer; - -use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Finder\Finder; -use Symfony\Component\Templating\TemplateNameParserInterface; -use Symfony\Component\HttpKernel\Bundle\BundleInterface; - -/** - * Finds all the templates. - * - * @author Victor Berchet - */ -class TemplateFinder implements TemplateFinderInterface -{ - private $kernel; - private $parser; - private $rootDir; - private $templates; - - /** - * Constructor. - * - * @param KernelInterface $kernel A KernelInterface instance - * @param TemplateNameParserInterface $parser A TemplateNameParserInterface instance - * @param string $rootDir The directory where global templates can be stored - */ - public function __construct(KernelInterface $kernel, TemplateNameParserInterface $parser, $rootDir) - { - $this->kernel = $kernel; - $this->parser = $parser; - $this->rootDir = $rootDir; - } - - /** - * Find all the templates in the bundle and in the kernel Resources folder. - * - * @return array An array of templates of type TemplateReferenceInterface - */ - public function findAllTemplates() - { - if (null !== $this->templates) { - return $this->templates; - } - - $templates = array(); - - foreach ($this->kernel->getBundles() as $name => $bundle) { - $templates = array_merge($templates, $this->findTemplatesInBundle($bundle)); - } - - $templates = array_merge($templates, $this->findTemplatesInFolder($this->rootDir.'/views')); - - return $this->templates = $templates; - } - - /** - * Find templates in the given directory. - * - * @param string $dir The folder where to look for templates - * - * @return array An array of templates of type TemplateReferenceInterface - */ - private function findTemplatesInFolder($dir) - { - $templates = array(); - - if (is_dir($dir)) { - $finder = new Finder(); - foreach ($finder->files()->followLinks()->in($dir) as $file) { - $template = $this->parser->parse($file->getRelativePathname()); - if (false !== $template) { - $templates[] = $template; - } - } - } - - return $templates; - } - - /** - * Find templates in the given bundle. - * - * @param BundleInterface $bundle The bundle where to look for templates - * - * @return array An array of templates of type TemplateReferenceInterface - */ - private function findTemplatesInBundle(BundleInterface $bundle) - { - $templates = $this->findTemplatesInFolder($bundle->getPath().'/Resources/views'); - $name = $bundle->getName(); - - foreach ($templates as $i => $template) { - $templates[$i] = $template->set('bundle', $name); - } - - return $templates; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinderInterface.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinderInterface.php deleted file mode 100644 index 433ed8f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinderInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\CacheWarmer; - -/** - * Interface for finding all the templates. - * - * @author Victor Berchet - */ -interface TemplateFinderInterface -{ - /** - * Find all the templates. - * - * @return array An array of templates of type TemplateReferenceInterface - */ - public function findAllTemplates(); -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplatePathsCacheWarmer.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplatePathsCacheWarmer.php deleted file mode 100644 index 0936290..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplatePathsCacheWarmer.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\CacheWarmer; - -use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmer; -use Symfony\Bundle\FrameworkBundle\Templating\Loader\TemplateLocator; - -/** - * Computes the association between template names and their paths on the disk. - * - * @author Fabien Potencier - */ -class TemplatePathsCacheWarmer extends CacheWarmer -{ - protected $finder; - protected $locator; - - /** - * Constructor. - * - * @param TemplateFinderInterface $finder A template finder - * @param TemplateLocator $locator The template locator - */ - public function __construct(TemplateFinderInterface $finder, TemplateLocator $locator) - { - $this->finder = $finder; - $this->locator = $locator; - } - - /** - * Warms up the cache. - * - * @param string $cacheDir The cache directory - */ - public function warmUp($cacheDir) - { - $templates = array(); - - foreach ($this->finder->findAllTemplates() as $template) { - $templates[$template->getLogicalName()] = $this->locator->locate($template); - } - - $this->writeCacheFile($cacheDir.'/templates.php', sprintf(' - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle; - -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\HttpKernel\Client as BaseClient; -use Symfony\Component\HttpKernel\Profiler\Profile as HttpProfile; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; - -/** - * Client simulates a browser and makes requests to a Kernel object. - * - * @author Fabien Potencier - */ -class Client extends BaseClient -{ - private $hasPerformedRequest = false; - - /** - * Returns the container. - * - * @return ContainerInterface - */ - public function getContainer() - { - return $this->kernel->getContainer(); - } - - /** - * Returns the kernel. - * - * @return HttpKernelInterface - */ - public function getKernel() - { - return $this->kernel; - } - - /** - * Gets the profile associated with the current Response. - * - * @return HttpProfile A Profile instance - */ - public function getProfile() - { - if (!$this->kernel->getContainer()->has('profiler')) { - return false; - } - - return $this->kernel->getContainer()->get('profiler')->loadProfileFromResponse($this->response); - } - - /** - * Makes a request. - * - * @param Request $request A Request instance - * - * @return Response A Response instance - */ - protected function doRequest($request) - { - // avoid shutting down the Kernel if no request has been performed yet - // WebTestCase::createClient() boots the Kernel but do not handle a request - if ($this->hasPerformedRequest) { - $this->kernel->shutdown(); - } else { - $this->hasPerformedRequest = true; - } - - return $this->kernel->handle($request); - } - - /** - * Returns the script to execute when the request must be insulated. - * - * It assumes that the autoloader is named 'autoload.php' and that it is - * stored in the same directory as the kernel (this is the case for the - * Symfony Standard Edition). If this is not your case, create your own - * client and override this method. - * - * @param Request $request A Request instance - * - * @return string The script content - */ - protected function getScript($request) - { - $kernel = str_replace("'", "\\'", serialize($this->kernel)); - $request = str_replace("'", "\\'", serialize($request)); - - $r = new \ReflectionObject($this->kernel); - - $autoloader = dirname($r->getFileName()).'/autoload.php'; - if (is_file($autoloader)) { - $autoloader = str_replace("'", "\\'", $autoloader); - } else { - $autoloader = ''; - } - - $path = str_replace("'", "\\'", $r->getFileName()); - - return <<boot(); -echo serialize(\$kernel->handle(unserialize('$request'))); -EOF; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php deleted file mode 100644 index 0159fbc..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php +++ /dev/null @@ -1,112 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Command; - -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; -use Symfony\Component\Finder\Finder; - -/** - * Command that places bundle web assets into a given directory. - * - * @author Fabien Potencier - */ -class AssetsInstallCommand extends ContainerAwareCommand -{ - /** - * @see Command - */ - protected function configure() - { - $this - ->setName('assets:install') - ->setDefinition(array( - new InputArgument('target', InputArgument::OPTIONAL, 'The target directory', 'web'), - )) - ->addOption('symlink', null, InputOption::VALUE_NONE, 'Symlinks the assets instead of copying it') - ->addOption('relative', null, InputOption::VALUE_NONE, 'Make relative symlinks') - ->setDescription('Installs bundles web assets under a public web directory') - ->setHelp(<<%command.name% command installs bundle assets into a given -directory (e.g. the web directory). - -php %command.full_name% web - -A "bundles" directory will be created inside the target directory, and the -"Resources/public" directory of each bundle will be copied into it. - -To create a symlink to each bundle instead of copying its assets, use the ---symlink option: - -php %command.full_name% web --symlink - -To make symlink relative, add the --relative option: - -php %command.full_name% web --symlink --relative - -EOT - ) - ; - } - - /** - * @see Command - * - * @throws \InvalidArgumentException When the target directory does not exist - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $targetArg = rtrim($input->getArgument('target'), '/'); - - if (!is_dir($targetArg)) { - throw new \InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $input->getArgument('target'))); - } - - if (!function_exists('symlink') && $input->getOption('symlink')) { - throw new \InvalidArgumentException('The symlink() function is not available on your system. You need to install the assets without the --symlink option.'); - } - - $filesystem = $this->getContainer()->get('filesystem'); - - // Create the bundles directory otherwise symlink will fail. - $filesystem->mkdir($targetArg.'/bundles/', 0777); - - $output->writeln(sprintf("Installing assets using the %s option", $input->getOption('symlink') ? 'symlink' : 'hard copy')); - - foreach ($this->getContainer()->get('kernel')->getBundles() as $bundle) { - if (is_dir($originDir = $bundle->getPath().'/Resources/public')) { - $bundlesDir = $targetArg.'/bundles/'; - $targetDir = $bundlesDir.preg_replace('/bundle$/', '', strtolower($bundle->getName())); - - $output->writeln(sprintf('Installing assets for %s into %s', $bundle->getNamespace(), $targetDir)); - - $filesystem->remove($targetDir); - - if ($input->getOption('symlink')) { - if ($input->getOption('relative')) { - $relativeOriginDir = $filesystem->makePathRelative($originDir, realpath($bundlesDir)); - } else { - $relativeOriginDir = $originDir; - } - $filesystem->symlink($relativeOriginDir, $targetDir); - } else { - $filesystem->mkdir($targetDir, 0777); - // We use a custom iterator to ignore VCS files - $filesystem->mirror($originDir, $targetDir, Finder::create()->in($originDir)); - } - } - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php deleted file mode 100644 index a9aa7a5..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php +++ /dev/null @@ -1,177 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Command; - -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Finder\Finder; - -/** - * Clear and Warmup the cache. - * - * @author Francis Besset - * @author Fabien Potencier - */ -class CacheClearCommand extends ContainerAwareCommand -{ - protected $name; - - /** - * @see Command - */ - protected function configure() - { - $this - ->setName('cache:clear') - ->setDefinition(array( - new InputOption('no-warmup', '', InputOption::VALUE_NONE, 'Do not warm up the cache'), - new InputOption('no-optional-warmers', '', InputOption::VALUE_NONE, 'Skip optional cache warmers (faster)'), - )) - ->setDescription('Clears the cache') - ->setHelp(<<%command.name% command clears the application cache for a given environment -and debug mode: - -php %command.full_name% --env=dev -php %command.full_name% --env=prod --no-debug -EOF - ) - ; - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $realCacheDir = $this->getContainer()->getParameter('kernel.cache_dir'); - $oldCacheDir = $realCacheDir.'_old'; - - if (!is_writable($realCacheDir)) { - throw new \RuntimeException(sprintf('Unable to write in the "%s" directory', $realCacheDir)); - } - - $kernel = $this->getContainer()->get('kernel'); - $output->writeln(sprintf('Clearing the cache for the %s environment with debug %s', $kernel->getEnvironment(), var_export($kernel->isDebug(), true))); - - $this->getContainer()->get('cache_clearer')->clear($realCacheDir); - - if ($input->getOption('no-warmup')) { - rename($realCacheDir, $oldCacheDir); - } else { - $warmupDir = $realCacheDir.'_new'; - - $this->warmup($warmupDir, !$input->getOption('no-optional-warmers')); - - rename($realCacheDir, $oldCacheDir); - rename($warmupDir, $realCacheDir); - } - - $this->getContainer()->get('filesystem')->remove($oldCacheDir); - } - - protected function warmup($warmupDir, $enableOptionalWarmers = true) - { - $this->getContainer()->get('filesystem')->remove($warmupDir); - - $parent = $this->getContainer()->get('kernel'); - $class = get_class($parent); - $namespace = ''; - if (false !== $pos = strrpos($class, '\\')) { - $namespace = substr($class, 0, $pos); - $class = substr($class, $pos + 1); - } - - $kernel = $this->getTempKernel($parent, $namespace, $class, $warmupDir); - $kernel->boot(); - - $warmer = $kernel->getContainer()->get('cache_warmer'); - - if ($enableOptionalWarmers) { - $warmer->enableOptionalWarmers(); - } - - $warmer->warmUp($warmupDir); - - // fix container files and classes - $regex = '/'.preg_quote($this->getTempKernelSuffix(), '/').'/'; - $finder = new Finder(); - foreach ($finder->files()->name(get_class($kernel->getContainer()).'*')->in($warmupDir) as $file) { - $content = file_get_contents($file); - $content = preg_replace($regex, '', $content); - - // fix absolute paths to the cache directory - $content = preg_replace('/'.preg_quote($warmupDir, '/').'/', preg_replace('/_new$/', '', $warmupDir), $content); - - file_put_contents(preg_replace($regex, '', $file), $content); - unlink($file); - } - - // fix meta references to the Kernel - foreach ($finder->files()->name('*.meta')->in($warmupDir) as $file) { - $content = preg_replace( - '/C\:\d+\:"'.preg_quote($class.$this->getTempKernelSuffix(), '"/').'"/', - sprintf('C:%s:"%s"', strlen($class), $class), - file_get_contents($file) - ); - file_put_contents($file, $content); - } - } - - protected function getTempKernelSuffix() - { - if (null === $this->name) { - $this->name = '__'.uniqid().'__'; - } - - return $this->name; - } - - protected function getTempKernel(KernelInterface $parent, $namespace, $class, $warmupDir) - { - $suffix = $this->getTempKernelSuffix(); - $rootDir = $parent->getRootDir(); - $code = <<getContainer()->get('filesystem')->mkdir($warmupDir); - file_put_contents($file = $warmupDir.'/kernel.tmp', $code); - require_once $file; - @unlink($file); - $class = "$namespace\\$class$suffix"; - - return new $class($parent->getEnvironment(), $parent->isDebug()); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php deleted file mode 100644 index baca895..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Command; - -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Warmup the cache. - * - * @author Fabien Potencier - */ -class CacheWarmupCommand extends ContainerAwareCommand -{ - /** - * @see Command - */ - protected function configure() - { - $this - ->setName('cache:warmup') - ->setDefinition(array( - new InputOption('no-optional-warmers', '', InputOption::VALUE_NONE, 'Skip optional cache warmers (faster)'), - )) - ->setDescription('Warms up an empty cache') - ->setHelp(<<%command.name% command warms up the cache. - -Before running this command, the cache must be empty. - -This command does not generate the classes cache (as when executing this -command, too many classes that should be part of the cache are already loaded -in memory). Use curl or any other similar tool to warm up -the classes cache if you want. -EOF - ) - ; - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $kernel = $this->getContainer()->get('kernel'); - $output->writeln(sprintf('Warming up the cache for the %s environment with debug %s', $kernel->getEnvironment(), var_export($kernel->isDebug(), true))); - - $warmer = $this->getContainer()->get('cache_warmer'); - - if (!$input->getOption('no-optional-warmers')) { - $warmer->enableOptionalWarmers(); - } - - $warmer->warmUp($this->getContainer()->getParameter('kernel.cache_dir')); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php deleted file mode 100644 index cd43ca0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php +++ /dev/null @@ -1,266 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Command; - -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Config\Definition\NodeInterface; -use Symfony\Component\Config\Definition\ArrayNode; -use Symfony\Component\Config\Definition\PrototypedArrayNode; -use Symfony\Component\Config\Definition\ConfigurationInterface; - -/** - * A console command for dumping available configuration reference - * - * @author Kevin Bond - */ -class ConfigDumpReferenceCommand extends ContainerDebugCommand -{ - protected $output; - - /** - * @see Command - */ - protected function configure() - { - $this - ->setName('config:dump-reference') - ->setDefinition(array( - new InputArgument('name', InputArgument::REQUIRED, 'The Bundle or extension alias') - )) - ->setDescription('Dumps default configuration for an extension') - ->setHelp(<<%command.name% command dumps the default configuration for an extension/bundle. - -The extension alias or bundle name can be used: - -Example: - - php %command.full_name% framework - -or - - php %command.full_name% FrameworkBundle -EOF - ) - ; - } - - /** - * @see Command - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $this->output = $output; - $kernel = $this->getContainer()->get('kernel'); - $containerBuilder = $this->getContainerBuilder(); - - $name = $input->getArgument('name'); - - $extension = null; - - if (preg_match('/Bundle$/', $name)) { - // input is bundle name - $extension = $kernel->getBundle($name)->getContainerExtension(); - - if (!$extension) { - throw new \LogicException('No extensions with configuration available for "'.$name.'"'); - } - - $message = 'Default configuration for "'.$name.'"'; - } else { - foreach ($kernel->getBundles() as $bundle) { - $extension = $bundle->getContainerExtension(); - - if ($extension && $extension->getAlias() === $name) { - break; - } - - $extension = null; - } - - if (!$extension) { - throw new \LogicException('No extension with alias "'.$name.'" is enabled'); - } - - $message = 'Default configuration for extension with alias: "'.$name.'"'; - } - - $configuration = $extension->getConfiguration(array(), $containerBuilder); - - if (!$configuration) { - throw new \LogicException('The extension with alias "'.$extension->getAlias(). - '" does not have it\'s getConfiguration() method setup'); - } - - if (!$configuration instanceof ConfigurationInterface) { - throw new \LogicException( - 'Configuration class "'.get_class($configuration). - '" should implement ConfigurationInterface in order to be dumpable'); - } - - $rootNode = $configuration->getConfigTreeBuilder()->buildTree(); - - $output->writeln($message); - - // root node - $this->outputNode($rootNode); - } - - /** - * Outputs a single config reference line - * - * @param string $text - * @param int $indent - */ - private function outputLine($text, $indent = 0) - { - $indent = strlen($text) + $indent; - - $format = '%'.$indent.'s'; - - $this->output->writeln(sprintf($format, $text)); - } - - private function outputArray(array $array, $depth) - { - $isIndexed = array_values($array) === $array; - - foreach ($array as $key => $value) { - if (is_array($value)) { - $val = ''; - } else { - $val = $value; - } - - if ($isIndexed) { - $this->outputLine('- '.$val, $depth * 4); - } else { - $this->outputLine(sprintf('%-20s %s', $key.':', $val), $depth * 4); - } - - if (is_array($value)) { - $this->outputArray($value, $depth + 1); - } - } - } - - /** - * @param NodeInterface $node - * @param int $depth - */ - private function outputNode(NodeInterface $node, $depth = 0) - { - $comments = array(); - $default = ''; - $defaultArray = null; - $children = null; - $example = $node->getExample(); - - // defaults - if ($node instanceof ArrayNode) { - $children = $node->getChildren(); - - if ($node instanceof PrototypedArrayNode) { - $prototype = $node->getPrototype(); - - if ($prototype instanceof ArrayNode) { - $children = $prototype->getChildren(); - } - - // check for attribute as key - if ($key = $node->getKeyAttribute()) { - $keyNode = new ArrayNode($key, $node); - $keyNode->setInfo('Prototype'); - - // add children - foreach ($children as $childNode) { - $keyNode->addChild($childNode); - } - $children = array($key => $keyNode); - } - } - - if (!$children) { - if ($node->hasDefaultValue() && count($defaultArray = $node->getDefaultValue())) { - $default = ''; - } elseif (!is_array($example)) { - $default = '[]'; - } - } - } else { - $default = '~'; - - if ($node->hasDefaultValue()) { - $default = $node->getDefaultValue(); - - if (true === $default) { - $default = 'true'; - } elseif (false === $default) { - $default = 'false'; - } elseif (null === $default) { - $default = '~'; - } - } - } - - // required? - if ($node->isRequired()) { - $comments[] = 'Required'; - } - - // example - if ($example && !is_array($example)) { - $comments[] = 'Example: '.$example; - } - - $default = (string) $default != '' ? ' '.$default : ''; - $comments = count($comments) ? '# '.implode(', ', $comments) : ''; - - $text = sprintf('%-20s %s %s', $node->getName().':', $default, $comments); - - if ($info = $node->getInfo()) { - $this->outputLine(''); - $this->outputLine('# '.$info, $depth * 4); - } - - $this->outputLine($text, $depth * 4); - - // output defaults - if ($defaultArray) { - $this->outputLine(''); - - $message = count($defaultArray) > 1 ? 'Defaults' : 'Default'; - - $this->outputLine('# '.$message.':', $depth * 4 + 4); - - $this->outputArray($defaultArray, $depth + 1); - } - - if (is_array($example)) { - $this->outputLine(''); - - $message = count($example) > 1 ? 'Examples' : 'Example'; - - $this->outputLine('# '.$message.':', $depth * 4 + 4); - - $this->outputArray($example, $depth + 1); - } - - if ($children) { - foreach ($children as $childNode) { - $this->outputNode($childNode, $depth + 1); - } - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ContainerAwareCommand.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ContainerAwareCommand.php deleted file mode 100644 index 0540870..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ContainerAwareCommand.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Command; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; - -/** - * Command. - * - * @author Fabien Potencier - */ -abstract class ContainerAwareCommand extends Command implements ContainerAwareInterface -{ - /** - * @var ContainerInterface - */ - private $container; - - /** - * @return ContainerInterface - */ - protected function getContainer() - { - if (null === $this->container) { - $this->container = $this->getApplication()->getKernel()->getContainer(); - } - - return $this->container; - } - - /** - * @see ContainerAwareInterface::setContainer() - */ - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php deleted file mode 100644 index 56263d3..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php +++ /dev/null @@ -1,226 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Command; - -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; -use Symfony\Component\DependencyInjection\Alias; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\Config\FileLocator; - -/** - * A console command for retrieving information about services - * - * @author Ryan Weaver - */ -class ContainerDebugCommand extends ContainerAwareCommand -{ - /** - * @var ContainerBuilder - */ - protected $containerBuilder; - - /** - * @see Command - */ - protected function configure() - { - $this - ->setName('container:debug') - ->setDefinition(array( - new InputArgument('name', InputArgument::OPTIONAL, 'A service name (foo)'), - new InputOption('show-private', null, InputOption::VALUE_NONE, 'Use to show public *and* private services'), - )) - ->setDescription('Displays current services for an application') - ->setHelp(<<%command.name% command displays all configured public services: - - php %command.full_name% - -To get specific information about a service, specify its name: - - php %command.full_name% validator - -By default, private services are hidden. You can display all services by -using the --show-private flag: - - php %command.full_name% --show-private -EOF - ) - ; - } - - /** - * @see Command - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $name = $input->getArgument('name'); - - $this->containerBuilder = $this->getContainerBuilder(); - $serviceIds = $this->containerBuilder->getServiceIds(); - - // sort so that it reads like an index of services - asort($serviceIds); - - if ($name) { - $this->outputService($output, $name); - } else { - $this->outputServices($output, $serviceIds, $input->getOption('show-private')); - } - } - - protected function outputServices(OutputInterface $output, $serviceIds, $showPrivate = false) - { - // set the label to specify public or public+private - if ($showPrivate) { - $label = 'Public and private services'; - } else { - $label = 'Public services'; - } - - $output->writeln($this->getHelper('formatter')->formatSection('container', $label)); - - // loop through to get space needed and filter private services - $maxName = 4; - $maxScope = 6; - foreach ($serviceIds as $key => $serviceId) { - $definition = $this->resolveServiceDefinition($serviceId); - - if ($definition instanceof Definition) { - // filter out private services unless shown explicitly - if (!$showPrivate && !$definition->isPublic()) { - unset($serviceIds[$key]); - continue; - } - - if (strlen($definition->getScope()) > $maxScope) { - $maxScope = strlen($definition->getScope()); - } - } - - if (strlen($serviceId) > $maxName) { - $maxName = strlen($serviceId); - } - } - $format = '%-'.$maxName.'s %-'.$maxScope.'s %s'; - - // the title field needs extra space to make up for comment tags - $format1 = '%-'.($maxName + 19).'s %-'.($maxScope + 19).'s %s'; - $output->writeln(sprintf($format1, 'Service Id', 'Scope', 'Class Name')); - - foreach ($serviceIds as $serviceId) { - $definition = $this->resolveServiceDefinition($serviceId); - - if ($definition instanceof Definition) { - $output->writeln(sprintf($format, $serviceId, $definition->getScope(), $definition->getClass())); - } elseif ($definition instanceof Alias) { - $alias = $definition; - $output->writeln(sprintf($format, $serviceId, 'n/a', sprintf('alias for %s', (string) $alias))); - } else { - // we have no information (happens with "service_container") - $service = $definition; - $output->writeln(sprintf($format, $serviceId, '', get_class($service))); - } - } - } - - /** - * Renders detailed service information about one service - */ - protected function outputService(OutputInterface $output, $serviceId) - { - $definition = $this->resolveServiceDefinition($serviceId); - - $label = sprintf('Information for service %s', $serviceId); - $output->writeln($this->getHelper('formatter')->formatSection('container', $label)); - $output->writeln(''); - - if ($definition instanceof Definition) { - $output->writeln(sprintf('Service Id %s', $serviceId)); - $output->writeln(sprintf('Class %s', $definition->getClass())); - - $tags = $definition->getTags() ? implode(', ', array_keys($definition->getTags())) : '-'; - $output->writeln(sprintf('Tags %s', $tags)); - - $output->writeln(sprintf('Scope %s', $definition->getScope())); - - $public = $definition->isPublic() ? 'yes' : 'no'; - $output->writeln(sprintf('Public %s', $public)); - - $synthetic = $definition->isSynthetic() ? 'yes' : 'no'; - $output->writeln(sprintf('Synthetic %s', $synthetic)); - - $file = $definition->getFile() ? $definition->getFile() : '-'; - $output->writeln(sprintf('Required File %s', $file)); - } elseif ($definition instanceof Alias) { - $alias = $definition; - $output->writeln(sprintf('This service is an alias for the service %s', (string) $alias)); - } else { - // edge case (but true for "service_container", all we have is the service itself - $service = $definition; - $output->writeln(sprintf('Service Id %s', $serviceId)); - $output->writeln(sprintf('Class %s', get_class($service))); - } - } - - /** - * Loads the ContainerBuilder from the cache. - * - * @return ContainerBuilder - */ - protected function getContainerBuilder() - { - if (!$this->getApplication()->getKernel()->isDebug()) { - throw new \LogicException(sprintf('Debug information about the container is only available in debug mode.')); - } - - if (!is_file($cachedFile = $this->getContainer()->getParameter('debug.container.dump'))) { - throw new \LogicException(sprintf('Debug information about the container could not be found. Please clear the cache and try again.')); - } - - $container = new ContainerBuilder(); - - $loader = new XmlFileLoader($container, new FileLocator()); - $loader->load($cachedFile); - - return $container; - } - - /** - * Given an array of service IDs, this returns the array of corresponding - * Definition and Alias objects that those ids represent. - * - * @param string $serviceId The service id to resolve - * - * @return \Symfony\Component\DependencyInjection\Definition|\Symfony\Component\DependencyInjection\Alias - */ - protected function resolveServiceDefinition($serviceId) - { - if ($this->containerBuilder->hasDefinition($serviceId)) { - return $this->containerBuilder->getDefinition($serviceId); - } - - // Some service IDs don't have a Definition, they're simply an Alias - if ($this->containerBuilder->hasAlias($serviceId)) { - return $this->containerBuilder->getAlias($serviceId); - } - - // the service has been injected in some special way, just return the service - return $this->containerBuilder->get($serviceId); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/RouterApacheDumperCommand.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/RouterApacheDumperCommand.php deleted file mode 100644 index 12fe9b0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/RouterApacheDumperCommand.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Command; - -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Routing\Matcher\Dumper\ApacheMatcherDumper; -use Symfony\Component\Routing\RouterInterface; - -/** - * RouterApacheDumperCommand. - * - * @author Fabien Potencier - */ -class RouterApacheDumperCommand extends ContainerAwareCommand -{ - /** - * {@inheritDoc} - */ - public function isEnabled() - { - if (!$this->getContainer()->has('router')) { - return false; - } - $router = $this->getContainer()->get('router'); - if (!$router instanceof RouterInterface) { - return false; - } - - return parent::isEnabled(); - } - - /** - * @see Command - */ - protected function configure() - { - $this - ->setName('router:dump-apache') - ->setDefinition(array( - new InputArgument('script_name', InputArgument::OPTIONAL, 'The script name of the application\'s front controller.'), - new InputOption('base-uri', null, InputOption::VALUE_REQUIRED, 'The base URI'), - )) - ->setDescription('Dumps all routes as Apache rewrite rules') - ->setHelp(<<%command.name% dumps all routes as Apache rewrite rules. -These can then be used with the ApacheUrlMatcher to use Apache for route -matching. - - php %command.full_name% -EOF - ) - ; - } - - /** - * @see Command - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $router = $this->getContainer()->get('router'); - - $dumpOptions = array(); - if ($input->getArgument('script_name')) { - $dumpOptions['script_name'] = $input->getArgument('script_name'); - } - if ($input->getOption('base-uri')) { - $dumpOptions['base_uri'] = $input->getOption('base-uri'); - } - - $dumper = new ApacheMatcherDumper($router->getRouteCollection()); - - $output->writeln($dumper->dump($dumpOptions), OutputInterface::OUTPUT_RAW); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php deleted file mode 100644 index c1ed499..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php +++ /dev/null @@ -1,178 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Command; - -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Routing\RouterInterface; -use Symfony\Component\Console\Output\Output; - -/** - * A console command for retrieving information about routes - * - * @author Fabien Potencier - */ -class RouterDebugCommand extends ContainerAwareCommand -{ - /** - * {@inheritDoc} - */ - public function isEnabled() - { - if (!$this->getContainer()->has('router')) { - return false; - } - $router = $this->getContainer()->get('router'); - if (!$router instanceof RouterInterface) { - return false; - } - - return parent::isEnabled(); - } - - /** - * @see Command - */ - protected function configure() - { - $this - ->setName('router:debug') - ->setDefinition(array( - new InputArgument('name', InputArgument::OPTIONAL, 'A route name'), - )) - ->setDescription('Displays current routes for an application') - ->setHelp(<<%command.name% displays the configured routes: - - php %command.full_name% -EOF - ) - ; - } - - /** - * @see Command - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $name = $input->getArgument('name'); - - if ($name) { - $this->outputRoute($output, $name); - } else { - $this->outputRoutes($output); - } - } - - protected function outputRoutes(OutputInterface $output, $routes = null) - { - if (null === $routes) { - $routes = array(); - foreach ($this->getContainer()->get('router')->getRouteCollection()->all() as $name => $route) { - $routes[$name] = $route->compile(); - } - } - - $output->writeln($this->getHelper('formatter')->formatSection('router', 'Current routes')); - - $maxName = 4; - $maxMethod = 6; - foreach ($routes as $name => $route) { - $requirements = $route->getRequirements(); - $method = isset($requirements['_method']) - ? strtoupper(is_array($requirements['_method']) - ? implode(', ', $requirements['_method']) : $requirements['_method'] - ) - : 'ANY'; - - if (strlen($name) > $maxName) { - $maxName = strlen($name); - } - - if (strlen($method) > $maxMethod) { - $maxMethod = strlen($method); - } - } - $format = '%-'.$maxName.'s %-'.$maxMethod.'s %s'; - - // displays the generated routes - $format1 = '%-'.($maxName + 19).'s %-'.($maxMethod + 19).'s %s'; - $output->writeln(sprintf($format1, 'Name', 'Method', 'Pattern')); - foreach ($routes as $name => $route) { - $requirements = $route->getRequirements(); - $method = isset($requirements['_method']) - ? strtoupper(is_array($requirements['_method']) - ? implode(', ', $requirements['_method']) : $requirements['_method'] - ) - : 'ANY'; - $output->writeln(sprintf($format, $name, $method, $route->getPattern())); - } - } - - /** - * @throws \InvalidArgumentException When route does not exist - */ - protected function outputRoute(OutputInterface $output, $name) - { - $route = $this->getContainer()->get('router')->getRouteCollection()->get($name); - if (!$route) { - throw new \InvalidArgumentException(sprintf('The route "%s" does not exist.', $name)); - } - - $output->writeln($this->getHelper('formatter')->formatSection('router', sprintf('Route "%s"', $name))); - - $route = $route->compile(); - $output->writeln(sprintf('Name %s', $name)); - $output->writeln(sprintf('Pattern %s', $route->getPattern())); - $output->writeln(sprintf('Class %s', get_class($route))); - - $defaults = ''; - $d = $route->getDefaults(); - ksort($d); - foreach ($d as $name => $value) { - $defaults .= ($defaults ? "\n".str_repeat(' ', 13) : '').$name.': '.$this->formatValue($value); - } - $output->writeln(sprintf('Defaults %s', $defaults)); - - $requirements = ''; - $r = $route->getRequirements(); - ksort($r); - foreach ($r as $name => $value) { - $requirements .= ($requirements ? "\n".str_repeat(' ', 13) : '').$name.': '.$this->formatValue($value); - } - $output->writeln(sprintf('Requirements %s', $requirements)); - - $options = ''; - $o = $route->getOptions(); - ksort($o); - foreach ($o as $name => $value) { - $options .= ($options ? "\n".str_repeat(' ', 13) : '').$name.': '.$this->formatValue($value); - } - $output->writeln(sprintf('Options %s', $options)); - $output->write('Regex '); - $output->writeln(preg_replace('/^ /', '', preg_replace('/^/m', ' ', $route->getRegex())), OutputInterface::OUTPUT_RAW); - } - - protected function formatValue($value) - { - if (is_object($value)) { - return sprintf('object(%s)', get_class($value)); - } - - if (is_string($value)) { - return $value; - } - - return preg_replace("/\n\s*/s", '', var_export($value, true)); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php deleted file mode 100644 index a6b4b08..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Command; - -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Routing\RouterInterface; -use Symfony\Component\Routing\Matcher\TraceableUrlMatcher; - -/** - * A console command to test route matching. - * - * @author Fabien Potencier - */ -class RouterMatchCommand extends ContainerAwareCommand -{ - /** - * {@inheritDoc} - */ - public function isEnabled() - { - if (!$this->getContainer()->has('router')) { - return false; - } - $router = $this->getContainer()->get('router'); - if (!$router instanceof RouterInterface) { - return false; - } - - return parent::isEnabled(); - } - - /** - * @see Command - */ - protected function configure() - { - $this - ->setName('router:match') - ->setDefinition(array( - new InputArgument('path_info', InputArgument::REQUIRED, 'A path info'), - )) - ->setDescription('Helps debug routes by simulating a path info match') - ->setHelp(<<%command.name% simulates a path info match: - - php %command.full_name% /foo -EOF - ) - ; - } - - /** - * @see Command - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $router = $this->getContainer()->get('router'); - $matcher = new TraceableUrlMatcher($router->getRouteCollection(), $router->getContext()); - - $traces = $matcher->getTraces($input->getArgument('path_info')); - - $matches = false; - foreach ($traces as $i => $trace) { - if (TraceableUrlMatcher::ROUTE_ALMOST_MATCHES == $trace['level']) { - $output->writeln(sprintf('Route "%s" almost matches but %s', $trace['name'], lcfirst($trace['log']))); - } elseif (TraceableUrlMatcher::ROUTE_MATCHES == $trace['level']) { - $output->writeln(sprintf('Route "%s" matches', $trace['name'])); - $matches = true; - } elseif ($input->getOption('verbose')) { - $output->writeln(sprintf('Route "%s" does not match: %s', $trace['name'], $trace['log'])); - } - } - - if (!$matches) { - $output->writeln('None of the routes matches'); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php deleted file mode 100644 index 446db90..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Command; - -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Process\ProcessBuilder; - -/** - * Runs Symfony2 application using PHP built-in web server - * - * @author Michał Pipa - */ -class ServerRunCommand extends ContainerAwareCommand -{ - /** - * {@inheritDoc} - */ - public function isEnabled() - { - if (version_compare(phpversion(), '5.4.0', '<')) { - return false; - } - - return parent::isEnabled(); - } - - /** - * @see Command - */ - protected function configure() - { - $this - ->setDefinition(array( - new InputArgument('address', InputArgument::OPTIONAL, 'Address:port', 'localhost:8000'), - new InputOption('docroot', 'd', InputOption::VALUE_REQUIRED, 'Document root', 'web/'), - new InputOption('router', 'r', InputOption::VALUE_REQUIRED, 'Path to custom router script'), - )) - ->setName('server:run') - ->setDescription('Runs PHP built-in web server') - ->setHelp(<<%command.name% runs PHP built-in web server: - - %command.full_name% - -To change default bind address and port use the address argument: - - %command.full_name% 127.0.0.1:8080 - -To change default docroot directory use the --docroot option: - - %command.full_name% --docroot=htdocs/ - -If you have custom docroot directory layout, you can specify your own -router script using --router option: - - %command.full_name% --router=app/config/router.php - -See also: http://www.php.net/manual/en/features.commandline.webserver.php -EOF - ) - ; - } - - /** - * @see Command - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $router = $input->getOption('router') ?: $this - ->getContainer() - ->get('kernel') - ->locateResource('@FrameworkBundle/Resources/config/router.php') - ; - - $output->writeln(sprintf("Server running on %s\n", $input->getArgument('address'))); - - $builder = new ProcessBuilder(array(PHP_BINARY, '-S', $input->getArgument('address'), $router)); - $builder->setWorkingDirectory($input->getOption('docroot')); - $builder->setTimeout(null); - $builder->getProcess()->run(function ($type, $buffer) use ($output) { - if (OutputInterface::VERBOSITY_VERBOSE === $output->getVerbosity()) { - $output->write($buffer); - } - }); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php deleted file mode 100644 index bbcff61..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Command; - -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Translation\MessageCatalogue; -use Symfony\Component\Yaml\Yaml; - -/** - * A command that parse templates to extract translation messages and add them into the translation files. - * - * @author Michel Salib - */ -class TranslationUpdateCommand extends ContainerAwareCommand -{ - /** - * Compiled catalogue of messages. - * @var MessageCatalogue - */ - protected $catalogue; - - /** - * {@inheritDoc} - */ - protected function configure() - { - $this - ->setName('translation:update') - ->setDefinition(array( - new InputArgument('locale', InputArgument::REQUIRED, 'The locale'), - new InputArgument('bundle', InputArgument::REQUIRED, 'The bundle where to load the messages'), - new InputOption( - 'prefix', null, InputOption::VALUE_OPTIONAL, - 'Override the default prefix', '__' - ), - new InputOption( - 'output-format', null, InputOption::VALUE_OPTIONAL, - 'Override the default output format', 'yml' - ), - new InputOption( - 'dump-messages', null, InputOption::VALUE_NONE, - 'Should the messages be dumped in the console' - ), - new InputOption( - 'force', null, InputOption::VALUE_NONE, - 'Should the update be done' - ) - )) - ->setDescription('Updates the translation file') - ->setHelp(<<%command.name% command extract translation strings from templates -of a given bundle. It can display them or merge the new ones into the translation files. -When new translation strings are found it can automatically add a prefix to the translation -message. - -php %command.full_name% --dump-messages en AcmeBundle -php %command.full_name% --force --prefix="new_" fr AcmeBundle -EOF - ) - ; - } - - /** - * {@inheritDoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - // check presence of force or dump-message - if ($input->getOption('force') !== true && $input->getOption('dump-messages') !== true) { - $output->writeln('You must choose one of --force or --dump-messages'); - - return; - } - - // check format - $writer = $this->getContainer()->get('translation.writer'); - $supportedFormats = $writer->getFormats(); - if (!in_array($input->getOption('output-format'), $supportedFormats)) { - $output->writeln('Wrong output format'); - $output->writeln('Supported formats are '.implode(', ', $supportedFormats).'.'); - - return; - } - - // get bundle directory - $foundBundle = $this->getApplication()->getKernel()->getBundle($input->getArgument('bundle')); - $bundleTransPath = $foundBundle->getPath().'/Resources/translations'; - $output->writeln(sprintf('Generating "%s" translation files for "%s"', $input->getArgument('locale'), $foundBundle->getName())); - - // create catalogue - $catalogue = new MessageCatalogue($input->getArgument('locale')); - - // load any messages from templates - $output->writeln('Parsing templates'); - $extractor = $this->getContainer()->get('translation.extractor'); - $extractor->setPrefix($input->getOption('prefix')); - $extractor->extract($foundBundle->getPath().'/Resources/views/', $catalogue); - - // load any existing messages from the translation files - $output->writeln('Loading translation files'); - $loader = $this->getContainer()->get('translation.loader'); - $loader->loadMessages($bundleTransPath, $catalogue); - - // show compiled list of messages - if ($input->getOption('dump-messages') === true) { - foreach ($catalogue->getDomains() as $domain) { - $output->writeln(sprintf("\nDisplaying messages for domain %s:\n", $domain)); - $output->writeln(Yaml::dump($catalogue->all($domain), 10)); - } - if ($input->getOption('output-format') == 'xliff') { - $output->writeln('Xliff output version is 1.2'); - } - } - - // save the files - if ($input->getOption('force') === true) { - $output->writeln('Writing files'); - $writer->writeTranslations($catalogue, $input->getOption('output-format'), array('path' => $bundleTransPath)); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php deleted file mode 100644 index cd80330..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Console; - -use Symfony\Component\Console\Application as BaseApplication; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\HttpKernel\Kernel; - -/** - * Application. - * - * @author Fabien Potencier - */ -class Application extends BaseApplication -{ - private $kernel; - - /** - * Constructor. - * - * @param KernelInterface $kernel A KernelInterface instance - */ - public function __construct(KernelInterface $kernel) - { - $this->kernel = $kernel; - - parent::__construct('Symfony', Kernel::VERSION.' - '.$kernel->getName().'/'.$kernel->getEnvironment().($kernel->isDebug() ? '/debug' : '')); - - $this->getDefinition()->addOption(new InputOption('--shell', '-s', InputOption::VALUE_NONE, 'Launch the shell.')); - $this->getDefinition()->addOption(new InputOption('--process-isolation', null, InputOption::VALUE_NONE, 'Launch commands from shell as a separate processes.')); - $this->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The Environment name.', $kernel->getEnvironment())); - $this->getDefinition()->addOption(new InputOption('--no-debug', null, InputOption::VALUE_NONE, 'Switches off debug mode.')); - } - - /** - * Gets the Kernel associated with this Console. - * - * @return KernelInterface A KernelInterface instance - */ - public function getKernel() - { - return $this->kernel; - } - - /** - * Runs the current application. - * - * @param InputInterface $input An Input instance - * @param OutputInterface $output An Output instance - * - * @return integer 0 if everything went fine, or an error code - */ - public function doRun(InputInterface $input, OutputInterface $output) - { - $this->registerCommands(); - - if (true === $input->hasParameterOption(array('--shell', '-s'))) { - $shell = new Shell($this); - $shell->setProcessIsolation($input->hasParameterOption(array('--process-isolation'))); - $shell->run(); - - return 0; - } - - return parent::doRun($input, $output); - } - - protected function registerCommands() - { - $this->kernel->boot(); - foreach ($this->kernel->getBundles() as $bundle) { - $bundle->registerCommands($this); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Shell.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Shell.php deleted file mode 100644 index 33100bd..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Shell.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Console; - -use Symfony\Component\Console\Shell as BaseShell; - -/** - * Shell. - * - * @author Fabien Potencier - */ -class Shell extends BaseShell -{ - /** - * Returns the shell header. - * - * @return string The header string - */ - protected function getHeader() - { - return << - _____ __ ___ - / ____| / _| |__ \ - | (___ _ _ _ __ ___ | |_ ___ _ __ _ _ ) | - \___ \| | | | '_ ` _ \| _/ _ \| '_ \| | | | / / - ____) | |_| | | | | | | || (_) | | | | |_| |/ /_ - |_____/ \__, |_| |_| |_|_| \___/|_| |_|\__, |____| - __/ | __/ | - |___/ |___/ - - -EOF - .parent::getHeader(); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php deleted file mode 100644 index ba3a8ba..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php +++ /dev/null @@ -1,247 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Controller; - -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\RedirectResponse; -use Symfony\Component\HttpFoundation\StreamedResponse; -use Symfony\Component\DependencyInjection\ContainerAware; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Symfony\Component\Form\FormTypeInterface; -use Symfony\Component\Form\Form; -use Symfony\Component\Form\FormBuilder; -use Doctrine\Bundle\DoctrineBundle\Registry; -use Symfony\Component\HttpFoundation\Request; - -/** - * Controller is a simple implementation of a Controller. - * - * It provides methods to common features needed in controllers. - * - * @author Fabien Potencier - */ -class Controller extends ContainerAware -{ - /** - * Generates a URL from the given parameters. - * - * @param string $route The name of the route - * @param mixed $parameters An array of parameters - * @param Boolean $absolute Whether to generate an absolute URL - * - * @return string The generated URL - */ - public function generateUrl($route, $parameters = array(), $absolute = false) - { - return $this->container->get('router')->generate($route, $parameters, $absolute); - } - - /** - * Forwards the request to another controller. - * - * @param string $controller The controller name (a string like BlogBundle:Post:index) - * @param array $path An array of path parameters - * @param array $query An array of query parameters - * - * @return Response A Response instance - */ - public function forward($controller, array $path = array(), array $query = array()) - { - return $this->container->get('http_kernel')->forward($controller, $path, $query); - } - - /** - * Returns a RedirectResponse to the given URL. - * - * @param string $url The URL to redirect to - * @param integer $status The status code to use for the Response - * - * @return RedirectResponse - */ - public function redirect($url, $status = 302) - { - return new RedirectResponse($url, $status); - } - - /** - * Returns a rendered view. - * - * @param string $view The view name - * @param array $parameters An array of parameters to pass to the view - * - * @return string The renderer view - */ - public function renderView($view, array $parameters = array()) - { - return $this->container->get('templating')->render($view, $parameters); - } - - /** - * Renders a view. - * - * @param string $view The view name - * @param array $parameters An array of parameters to pass to the view - * @param Response $response A response instance - * - * @return Response A Response instance - */ - public function render($view, array $parameters = array(), Response $response = null) - { - return $this->container->get('templating')->renderResponse($view, $parameters, $response); - } - - /** - * Streams a view. - * - * @param string $view The view name - * @param array $parameters An array of parameters to pass to the view - * @param StreamedResponse $response A response instance - * - * @return StreamedResponse A StreamedResponse instance - */ - public function stream($view, array $parameters = array(), StreamedResponse $response = null) - { - $templating = $this->container->get('templating'); - - $callback = function () use ($templating, $view, $parameters) { - $templating->stream($view, $parameters); - }; - - if (null === $response) { - return new StreamedResponse($callback); - } - - $response->setCallback($callback); - - return $response; - } - - /** - * Returns a NotFoundHttpException. - * - * This will result in a 404 response code. Usage example: - * - * throw $this->createNotFoundException('Page not found!'); - * - * @param string $message A message - * @param Exception $previous The previous exception - * - * @return NotFoundHttpException - */ - public function createNotFoundException($message = 'Not Found', \Exception $previous = null) - { - return new NotFoundHttpException($message, $previous); - } - - /** - * Creates and returns a Form instance from the type of the form. - * - * @param string|FormTypeInterface $type The built type of the form - * @param mixed $data The initial data for the form - * @param array $options Options for the form - * - * @return Form - */ - public function createForm($type, $data = null, array $options = array()) - { - return $this->container->get('form.factory')->create($type, $data, $options); - } - - /** - * Creates and returns a form builder instance - * - * @param mixed $data The initial data for the form - * @param array $options Options for the form - * - * @return FormBuilder - */ - public function createFormBuilder($data = null, array $options = array()) - { - return $this->container->get('form.factory')->createBuilder('form', $data, $options); - } - - /** - * Shortcut to return the request service. - * - * @return Request - */ - public function getRequest() - { - return $this->container->get('request'); - } - - /** - * Shortcut to return the Doctrine Registry service. - * - * @return Registry - * - * @throws \LogicException If DoctrineBundle is not available - */ - public function getDoctrine() - { - if (!$this->container->has('doctrine')) { - throw new \LogicException('The DoctrineBundle is not registered in your application.'); - } - - return $this->container->get('doctrine'); - } - - /** - * Get a user from the Security Context - * - * @return mixed - * - * @throws \LogicException If SecurityBundle is not available - * - * @see Symfony\Component\Security\Core\Authentication\Token\TokenInterface::getUser() - */ - public function getUser() - { - if (!$this->container->has('security.context')) { - throw new \LogicException('The SecurityBundle is not registered in your application.'); - } - - if (null === $token = $this->container->get('security.context')->getToken()) { - return null; - } - - if (!is_object($user = $token->getUser())) { - return null; - } - - return $user; - } - - /** - * Returns true if the service id is defined. - * - * @param string $id The service id - * - * @return Boolean true if the service id is defined, false otherwise - */ - public function has($id) - { - return $this->container->has($id); - } - - /** - * Gets a service by id. - * - * @param string $id The service id - * - * @return object The service - */ - public function get($id) - { - return $this->container->get($id); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerNameParser.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerNameParser.php deleted file mode 100644 index 1c3fe19..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerNameParser.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Controller; - -use Symfony\Component\HttpKernel\KernelInterface; - -/** - * ControllerNameParser converts controller from the short notation a:b:c - * (BlogBundle:Post:index) to a fully-qualified class::method string - * (Bundle\BlogBundle\Controller\PostController::indexAction). - * - * @author Fabien Potencier - */ -class ControllerNameParser -{ - protected $kernel; - - /** - * Constructor. - * - * @param KernelInterface $kernel A KernelInterface instance - */ - public function __construct(KernelInterface $kernel) - { - $this->kernel = $kernel; - } - - /** - * Converts a short notation a:b:c to a class::method. - * - * @param string $controller A short notation controller (a:b:c) - */ - public function parse($controller) - { - if (3 != count($parts = explode(':', $controller))) { - throw new \InvalidArgumentException(sprintf('The "%s" controller is not a valid a:b:c controller string.', $controller)); - } - - list($bundle, $controller, $action) = $parts; - $controller = str_replace('/', '\\', $controller); - $class = null; - $logs = array(); - foreach ($this->kernel->getBundle($bundle, false) as $b) { - $try = $b->getNamespace().'\\Controller\\'.$controller.'Controller'; - if (!class_exists($try)) { - $logs[] = sprintf('Unable to find controller "%s:%s" - class "%s" does not exist.', $bundle, $controller, $try); - } else { - $class = $try; - - break; - } - } - - if (null === $class) { - $this->handleControllerNotFoundException($bundle, $controller, $logs); - } - - return $class.'::'.$action.'Action'; - } - - private function handleControllerNotFoundException($bundle, $controller, array $logs) - { - // just one log, return it as the exception - if (1 == count($logs)) { - throw new \InvalidArgumentException($logs[0]); - } - - // many logs, use a message that mentions each searched bundle - $names = array(); - foreach ($this->kernel->getBundle($bundle, false) as $b) { - $names[] = $b->getName(); - } - $msg = sprintf('Unable to find controller "%s:%s" in bundles %s.', $bundle, $controller, implode(', ', $names)); - - throw new \InvalidArgumentException($msg); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerResolver.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerResolver.php deleted file mode 100644 index 08a76f0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerResolver.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Controller; - -use Symfony\Component\HttpKernel\Log\LoggerInterface; -use Symfony\Component\HttpKernel\Controller\ControllerResolver as BaseControllerResolver; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; - -/** - * ControllerResolver. - * - * @author Fabien Potencier - */ -class ControllerResolver extends BaseControllerResolver -{ - protected $container; - protected $parser; - - /** - * Constructor. - * - * @param ContainerInterface $container A ContainerInterface instance - * @param ControllerNameParser $parser A ControllerNameParser instance - * @param LoggerInterface $logger A LoggerInterface instance - */ - public function __construct(ContainerInterface $container, ControllerNameParser $parser, LoggerInterface $logger = null) - { - $this->container = $container; - $this->parser = $parser; - - parent::__construct($logger); - } - - /** - * Returns a callable for the given controller. - * - * @param string $controller A Controller string - * - * @return mixed A PHP callable - * - * @throws \LogicException When the name could not be parsed - * @throws \InvalidArgumentException When the controller class does not exist - */ - protected function createController($controller) - { - if (false === strpos($controller, '::')) { - $count = substr_count($controller, ':'); - if (2 == $count) { - // controller in the a:b:c notation then - $controller = $this->parser->parse($controller); - } elseif (1 == $count) { - // controller in the service:method notation - list($service, $method) = explode(':', $controller, 2); - - return array($this->container->get($service), $method); - } else { - throw new \LogicException(sprintf('Unable to parse the controller name "%s".', $controller)); - } - } - - list($class, $method) = explode('::', $controller, 2); - - if (!class_exists($class)) { - throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class)); - } - - $controller = new $class(); - if ($controller instanceof ContainerAwareInterface) { - $controller->setContainer($this->container); - } - - return array($controller, $method); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/InternalController.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/InternalController.php deleted file mode 100644 index 641deb7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/InternalController.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Controller; - -use Symfony\Component\DependencyInjection\ContainerAware; -use Symfony\Component\HttpFoundation\Response; - -/** - * InternalController. - * - * @author Fabien Potencier - */ -class InternalController extends ContainerAware -{ - /** - * Forwards to the given controller with the given path. - * - * @param string $path The path - * @param string $controller The controller name - * - * @return Response A Response instance - */ - public function indexAction($path, $controller) - { - $request = $this->container->get('request'); - $attributes = $request->attributes; - - $attributes->remove('path'); - $attributes->remove('controller'); - if ('none' !== $path) { - parse_str($path, $tmp); - $attributes->add($tmp); - } - - return $this->container->get('http_kernel')->forward($controller, $attributes->all(), $request->query->all()); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/RedirectController.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/RedirectController.php deleted file mode 100644 index 386fe58..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/RedirectController.php +++ /dev/null @@ -1,101 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Controller; - -use Symfony\Component\DependencyInjection\ContainerAware; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\RedirectResponse; - -/** - * Redirects a request to another URL. - * - * @author Fabien Potencier - */ -class RedirectController extends ContainerAware -{ - /** - * Redirects to another route. - * - * It expects a route path parameter. - * By default, the response status code is 301. - * - * If the route is empty, the status code will be 410. - * If the permanent path parameter is set, the status code will be 302. - * - * @param string $route The route pattern to redirect to - * @param Boolean $permanent Whether the redirect is permanent or not - * - * @return Response A Response instance - */ - public function redirectAction($route, $permanent = false) - { - if (!$route) { - return new Response(null, 410); - } - - $attributes = $this->container->get('request')->attributes->get('_route_params'); - unset($attributes['route'], $attributes['permanent']); - - return new RedirectResponse($this->container->get('router')->generate($route, $attributes), $permanent ? 301 : 302); - } - - /** - * Redirects to a URL. - * - * By default, the response status code is 301. - * - * If the path is empty, the status code will be 410. - * If the permanent flag is set, the status code will be 302. - * - * @param string $path The path to redirect to - * @param Boolean $permanent Whether the redirect is permanent or not - * @param Boolean $scheme The URL scheme (null to keep the current one) - * @param integer $httpPort The HTTP port - * @param integer $httpsPort The HTTPS port - * - * @return Response A Response instance - */ - public function urlRedirectAction($path, $permanent = false, $scheme = null, $httpPort = 80, $httpsPort = 443) - { - if (!$path) { - return new Response(null, 410); - } - - $statusCode = $permanent ? 301 : 302; - - // redirect if the path is a full URL - if (parse_url($path, PHP_URL_SCHEME)) { - return new RedirectResponse($path, $statusCode); - } - - $request = $this->container->get('request'); - if (null === $scheme) { - $scheme = $request->getScheme(); - } - - $qs = $request->getQueryString(); - if ($qs) { - $qs = '?'.$qs; - } - - $port = ''; - if ('http' === $scheme && 80 != $httpPort) { - $port = ':'.$httpPort; - } elseif ('https' === $scheme && 443 != $httpsPort) { - $port = ':'.$httpsPort; - } - - $url = $scheme.'://'.$request->getHost().$port.$request->getBaseUrl().$path.$qs; - - return new RedirectResponse($url, $statusCode); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php deleted file mode 100644 index fd6f1aa..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Controller; - -use Symfony\Component\DependencyInjection\ContainerAware; -use Symfony\Component\HttpFoundation\Response; - -/** - * TemplateController. - * - * @author Fabien Potencier - */ -class TemplateController extends ContainerAware -{ - /** - * Renders a template. - * - * @param string $template The template name - * - * @return Response A Response instance - */ - public function templateAction($template) - { - return $this->container->get('templating')->renderResponse($template); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/TraceableControllerResolver.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/TraceableControllerResolver.php deleted file mode 100644 index 4994bea..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/TraceableControllerResolver.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Controller; - -use Symfony\Component\HttpKernel\Log\LoggerInterface; -use Symfony\Component\HttpKernel\Debug\Stopwatch; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser; - -/** - * TraceableControllerResolver. - * - * @author Fabien Potencier - */ -class TraceableControllerResolver extends ControllerResolver -{ - private $stopwatch; - - /** - * Constructor. - * - * @param ContainerInterface $container A ContainerInterface instance - * @param ControllerNameParser $parser A ControllerNameParser instance - * @param Stopwatch $stopwatch A Stopwatch instance - * @param LoggerInterface $logger A LoggerInterface instance - */ - public function __construct(ContainerInterface $container, ControllerNameParser $parser, Stopwatch $stopwatch, LoggerInterface $logger = null) - { - parent::__construct($container, $parser, $logger); - - $this->stopwatch = $stopwatch; - } - - /** - * @{inheritdoc} - */ - public function getController(Request $request) - { - $e = $this->stopwatch->start('controller.get_callable'); - - $ret = parent::getController($request); - - $e->stop(); - - return $ret; - } - - /** - * @{inheritdoc} - */ - public function getArguments(Request $request, $controller) - { - $e = $this->stopwatch->start('controller.get_arguments'); - - $ret = parent::getArguments($request, $controller); - - $e->stop(); - - return $ret; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DataCollector/RouterDataCollector.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DataCollector/RouterDataCollector.php deleted file mode 100644 index b7289e7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DataCollector/RouterDataCollector.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\DataCollector; - -use Symfony\Component\HttpKernel\DataCollector\RouterDataCollector as BaseRouterDataCollector; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Bundle\FrameworkBundle\Controller\RedirectController; - -/** - * RouterDataCollector. - * - * @author Fabien Potencier - */ -class RouterDataCollector extends BaseRouterDataCollector -{ - public function guessRoute(Request $request, $controller) - { - if (is_array($controller)) { - $controller = $controller[0]; - } - - if ($controller instanceof RedirectController) { - return $request->attributes->get('_route'); - } - - return parent::guessRoute($request, $controller); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddCacheClearerPass.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddCacheClearerPass.php deleted file mode 100644 index c98e4e6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddCacheClearerPass.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\Reference; - -/** - * Registers the cache clearers. - * - * @author Dustin Dobervich - */ -class AddCacheClearerPass implements CompilerPassInterface -{ - /** - * {@inheritDoc} - */ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('cache_clearer')) { - return; - } - - $clearers = array(); - foreach ($container->findTaggedServiceIds('kernel.cache_clearer') as $id => $attributes) { - $clearers[] = new Reference($id); - } - - $container->getDefinition('cache_clearer')->replaceArgument(0, $clearers); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddCacheWarmerPass.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddCacheWarmerPass.php deleted file mode 100644 index cf77dd5..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddCacheWarmerPass.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\Reference; - -/** - * Registers the cache warmers. - * - * @author Fabien Potencier - */ -class AddCacheWarmerPass implements CompilerPassInterface -{ - /** - * {@inheritDoc} - */ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('cache_warmer')) { - return; - } - - $warmers = array(); - foreach ($container->findTaggedServiceIds('kernel.cache_warmer') as $id => $attributes) { - $priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0; - $warmers[$priority][] = new Reference($id); - } - - if (empty($warmers)) { - return; - } - - // sort by priority and flatten - krsort($warmers); - $warmers = call_user_func_array('array_merge', $warmers); - - $container->getDefinition('cache_warmer')->replaceArgument(0, $warmers); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddConstraintValidatorsPass.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddConstraintValidatorsPass.php deleted file mode 100644 index 757c98b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddConstraintValidatorsPass.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -class AddConstraintValidatorsPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('validator.validator_factory')) { - return; - } - - $validators = array(); - foreach ($container->findTaggedServiceIds('validator.constraint_validator') as $id => $attributes) { - if (isset($attributes[0]['alias'])) { - $validators[$attributes[0]['alias']] = $id; - } - } - - $container->getDefinition('validator.validator_factory')->replaceArgument(1, $validators); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddValidatorInitializersPass.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddValidatorInitializersPass.php deleted file mode 100644 index 6f3be9b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddValidatorInitializersPass.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -class AddValidatorInitializersPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('validator')) { - return; - } - - $initializers = array(); - foreach ($container->findTaggedServiceIds('validator.initializer') as $id => $attributes) { - $initializers[] = new Reference($id); - } - - $container->getDefinition('validator')->replaceArgument(2, $initializers); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CompilerDebugDumpPass.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CompilerDebugDumpPass.php deleted file mode 100644 index ad93d7b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CompilerDebugDumpPass.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\Config\ConfigCache; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -class CompilerDebugDumpPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - $cache = new ConfigCache($this->getCompilerLogFilename($container), false); - $cache->write(implode("\n", $container->getCompiler()->getLog())); - } - - public static function getCompilerLogFilename(ContainerInterface $container) - { - $class = $container->getParameter('kernel.container_class'); - - return $container->getParameter('kernel.cache_dir').'/'.$class.'Compiler.log'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ContainerBuilderDebugDumpPass.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ContainerBuilderDebugDumpPass.php deleted file mode 100644 index 1457d7c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ContainerBuilderDebugDumpPass.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Dumper\XmlDumper; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\Config\ConfigCache; - -/** - * Dumps the ContainerBuilder to a cache file so that it can be used by - * debugging tools such as the container:debug console command. - * - * @author Ryan Weaver - * @author Fabien Potencier - */ -class ContainerBuilderDebugDumpPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - $dumper = new XmlDumper($container); - $cache = new ConfigCache($container->getParameter('debug.container.dump'), false); - $cache->write($dumper->dump()); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/FormPass.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/FormPass.php deleted file mode 100644 index e077cc1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/FormPass.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Adds all services with the tags "form.type" and "form.type_guesser" as - * arguments of the "form.extension" service - * - * @author Bernhard Schussek - */ -class FormPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('form.extension')) { - return; - } - - // Builds an array with service IDs as keys and tag aliases as values - $types = array(); - - foreach ($container->findTaggedServiceIds('form.type') as $serviceId => $tag) { - $alias = isset($tag[0]['alias']) - ? $tag[0]['alias'] - : $serviceId; - - // Flip, because we want tag aliases (= type identifiers) as keys - $types[$alias] = $serviceId; - } - - $container->getDefinition('form.extension')->replaceArgument(1, $types); - - $typeExtensions = array(); - - foreach ($container->findTaggedServiceIds('form.type_extension') as $serviceId => $tag) { - $alias = isset($tag[0]['alias']) - ? $tag[0]['alias'] - : $serviceId; - - $typeExtensions[$alias][] = $serviceId; - } - - $container->getDefinition('form.extension')->replaceArgument(2, $typeExtensions); - - // Find all services annotated with "form.type_guesser" - $guessers = array_keys($container->findTaggedServiceIds('form.type_guesser')); - - $container->getDefinition('form.extension')->replaceArgument(3, $guessers); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ProfilerPass.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ProfilerPass.php deleted file mode 100644 index d7dce5a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ProfilerPass.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Adds tagged data_collector services to profiler service - * - * @author Fabien Potencier - */ -class ProfilerPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (false === $container->hasDefinition('profiler')) { - return; - } - - $definition = $container->getDefinition('profiler'); - - $collectors = new \SplPriorityQueue(); - $order = PHP_INT_MAX; - foreach ($container->findTaggedServiceIds('data_collector') as $id => $attributes) { - $priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0; - $template = null; - - if (isset($attributes[0]['template'])) { - if (!isset($attributes[0]['id'])) { - throw new \InvalidArgumentException(sprintf('Data collector service "%s" must have an id attribute in order to specify a template', $id)); - } - $template = array($attributes[0]['id'], $attributes[0]['template']); - } - - $collectors->insert(array($id, $template), array($priority, --$order)); - } - - $templates = array(); - foreach ($collectors as $collector) { - $definition->addMethodCall('add', array(new Reference($collector[0]))); - $templates[$collector[0]] = $collector[1]; - } - - $container->setParameter('data_collector.templates', $templates); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/RegisterKernelListenersPass.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/RegisterKernelListenersPass.php deleted file mode 100644 index 06a0d19..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/RegisterKernelListenersPass.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -class RegisterKernelListenersPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('event_dispatcher')) { - return; - } - - $definition = $container->getDefinition('event_dispatcher'); - - foreach ($container->findTaggedServiceIds('kernel.event_listener') as $id => $events) { - foreach ($events as $event) { - $priority = isset($event['priority']) ? $event['priority'] : 0; - - if (!isset($event['event'])) { - throw new \InvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "kernel.event_listener" tags.', $id)); - } - - if (!isset($event['method'])) { - $event['method'] = 'on'.preg_replace(array( - '/(?<=\b)[a-z]/ie', - '/[^a-z0-9]/i' - ), array('strtoupper("\\0")', ''), $event['event']); - } - - $definition->addMethodCall('addListenerService', array($event['event'], array($id, $event['method']), $priority)); - } - } - - foreach ($container->findTaggedServiceIds('kernel.event_subscriber') as $id => $attributes) { - // We must assume that the class value has been correctly filled, even if the service is created by a factory - $class = $container->getDefinition($id)->getClass(); - - $refClass = new \ReflectionClass($class); - $interface = 'Symfony\Component\EventDispatcher\EventSubscriberInterface'; - if (!$refClass->implementsInterface($interface)) { - throw new \InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $id, $interface)); - } - - $definition->addMethodCall('addSubscriberService', array($id, $class)); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/RoutingResolverPass.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/RoutingResolverPass.php deleted file mode 100644 index 322f7ba..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/RoutingResolverPass.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Adds tagged routing.loader services to routing.resolver service - * - * @author Fabien Potencier - */ -class RoutingResolverPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (false === $container->hasDefinition('routing.resolver')) { - return; - } - - $definition = $container->getDefinition('routing.resolver'); - - foreach ($container->findTaggedServiceIds('routing.loader') as $id => $attributes) { - $definition->addMethodCall('addLoader', array(new Reference($id))); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TemplatingPass.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TemplatingPass.php deleted file mode 100644 index 4ab3a9a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TemplatingPass.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -class TemplatingPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if ($container->hasDefinition('templating')) { - return; - } - - if ($container->hasDefinition('templating.engine.php')) { - $helpers = array(); - foreach ($container->findTaggedServiceIds('templating.helper') as $id => $attributes) { - if (isset($attributes[0]['alias'])) { - $helpers[$attributes[0]['alias']] = $id; - } - } - - if (count($helpers) > 0) { - $definition = $container->getDefinition('templating.engine.php'); - $definition->addMethodCall('setHelpers', array($helpers)); - } - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslationDumperPass.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslationDumperPass.php deleted file mode 100644 index b7ba860..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslationDumperPass.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Adds tagged translation.formatter services to translation writer - */ -class TranslationDumperPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('translation.writer')) { - return; - } - - $definition = $container->getDefinition('translation.writer'); - - foreach ($container->findTaggedServiceIds('translation.dumper') as $id => $attributes) { - $definition->addMethodCall('addDumper', array($attributes[0]['alias'], new Reference($id))); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslationExtractorPass.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslationExtractorPass.php deleted file mode 100644 index d982ced..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslationExtractorPass.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Adds tagged translation.extractor services to translation extractor - */ -class TranslationExtractorPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('translation.extractor')) { - return; - } - - $definition = $container->getDefinition('translation.extractor'); - - foreach ($container->findTaggedServiceIds('translation.extractor') as $id => $attributes) { - if (!isset($attributes[0]['alias'])) { - throw new \RuntimeException(sprintf('The alias for the tag "translation.extractor" of service "%s" must be set.', $id)); - } - - $definition->addMethodCall('addExtractor', array($attributes[0]['alias'], new Reference($id))); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslatorPass.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslatorPass.php deleted file mode 100644 index 4e45016..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslatorPass.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -class TranslatorPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('translator.default')) { - return; - } - - $loaders = array(); - foreach ($container->findTaggedServiceIds('translation.loader') as $id => $attributes) { - $loaders[$id][] = $attributes[0]['alias']; - if (isset($attributes[0]['legacy-alias'])) { - $loaders[$id][] = $attributes[0]['legacy-alias']; - } - } - - if ($container->hasDefinition('translation.loader')) { - $definition = $container->getDefinition('translation.loader'); - foreach ($loaders as $id => $formats) { - foreach ($formats as $format) { - $definition->addMethodCall('addLoader', array($format, new Reference($id))); - } - } - } - - $container->findDefinition('translator.default')->replaceArgument(2, $loaders); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php deleted file mode 100644 index f2941c6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ /dev/null @@ -1,412 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\DependencyInjection; - -use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; -use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\Config\Definition\ConfigurationInterface; - -/** - * FrameworkExtension configuration structure. - * - * @author Jeremy Mikola - */ -class Configuration implements ConfigurationInterface -{ - private $debug; - - /** - * Constructor - * - * @param Boolean $debug Whether to use the debug mode - */ - public function __construct($debug) - { - $this->debug = (Boolean) $debug; - } - - /** - * Generates the configuration tree builder. - * - * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder - */ - public function getConfigTreeBuilder() - { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('framework'); - - $rootNode - ->children() - ->scalarNode('charset') - ->defaultNull() - ->beforeNormalization() - ->ifTrue(function($v) { return null !== $v; }) - ->then(function($v) { - $message = 'The charset setting is deprecated. Just remove it from your configuration file.'; - - if ('UTF-8' !== $v) { - $message .= sprintf(' You need to define a getCharset() method in your Application Kernel class that returns "%s".', $v); - } - - throw new \RuntimeException($message); - }) - ->end() - ->end() - ->scalarNode('trust_proxy_headers')->defaultFalse()->end() - ->scalarNode('secret')->isRequired()->end() - ->scalarNode('ide')->defaultNull()->end() - ->booleanNode('test')->end() - ->scalarNode('default_locale')->defaultValue('en')->end() - ->end() - ; - - $this->addFormSection($rootNode); - $this->addEsiSection($rootNode); - $this->addProfilerSection($rootNode); - $this->addRouterSection($rootNode); - $this->addSessionSection($rootNode); - $this->addTemplatingSection($rootNode); - $this->addTranslatorSection($rootNode); - $this->addValidationSection($rootNode); - $this->addAnnotationsSection($rootNode); - - return $treeBuilder; - } - - private function addFormSection(ArrayNodeDefinition $rootNode) - { - $rootNode - ->children() - ->arrayNode('form') - ->info('form configuration') - ->canBeUnset() - ->treatNullLike(array('enabled' => true)) - ->treatTrueLike(array('enabled' => true)) - ->children() - ->booleanNode('enabled')->defaultTrue()->end() - ->end() - ->end() - ->arrayNode('csrf_protection') - ->canBeUnset() - ->treatNullLike(array('enabled' => true)) - ->treatTrueLike(array('enabled' => true)) - ->children() - ->booleanNode('enabled')->defaultTrue()->end() - ->scalarNode('field_name')->defaultValue('_token')->end() - ->end() - ->end() - ->end() - ; - } - - private function addEsiSection(ArrayNodeDefinition $rootNode) - { - $rootNode - ->children() - ->arrayNode('esi') - ->info('esi configuration') - ->canBeUnset() - ->treatNullLike(array('enabled' => true)) - ->treatTrueLike(array('enabled' => true)) - ->children() - ->booleanNode('enabled')->defaultTrue()->end() - ->end() - ->end() - ->end() - ; - } - - private function addProfilerSection(ArrayNodeDefinition $rootNode) - { - $rootNode - ->children() - ->arrayNode('profiler') - ->info('profiler configuration') - ->canBeUnset() - ->children() - ->booleanNode('only_exceptions')->defaultFalse()->end() - ->booleanNode('only_master_requests')->defaultFalse()->end() - ->scalarNode('dsn')->defaultValue('file:%kernel.cache_dir%/profiler')->end() - ->scalarNode('username')->defaultValue('')->end() - ->scalarNode('password')->defaultValue('')->end() - ->scalarNode('lifetime')->defaultValue(86400)->end() - ->arrayNode('matcher') - ->canBeUnset() - ->performNoDeepMerging() - ->children() - ->scalarNode('ip')->end() - ->scalarNode('path') - ->info('use the urldecoded format') - ->example('^/path to resource/') - ->end() - ->scalarNode('service')->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ; - } - - private function addRouterSection(ArrayNodeDefinition $rootNode) - { - $rootNode - ->children() - ->arrayNode('router') - ->info('router configuration') - ->canBeUnset() - ->children() - ->scalarNode('resource')->isRequired()->end() - ->scalarNode('type')->end() - ->scalarNode('http_port')->defaultValue(80)->end() - ->scalarNode('https_port')->defaultValue(443)->end() - ->scalarNode('strict_parameters') - ->info( - 'set to false to disable exceptions when a route is '. - 'generated with invalid parameters (and return null instead)' - ) - ->defaultTrue() - ->end() - ->end() - ->end() - ->end() - ; - } - - private function addSessionSection(ArrayNodeDefinition $rootNode) - { - $rootNode - ->children() - ->arrayNode('session') - ->info('session configuration') - ->canBeUnset() - ->children() - ->booleanNode('auto_start') - ->info('DEPRECATED! Session starts on demand') - ->defaultNull() - ->beforeNormalization() - ->ifTrue(function($v) { return null !== $v; }) - ->then(function($v) { - throw new \RuntimeException('The auto_start setting is deprecated. Just remove it from your configuration file.'); - }) - ->end() - ->end() - ->scalarNode('storage_id')->defaultValue('session.storage.native')->end() - ->scalarNode('handler_id')->defaultValue('session.handler.native_file')->end() - ->scalarNode('name')->end() - ->scalarNode('cookie_lifetime')->end() - ->scalarNode('cookie_path')->end() - ->scalarNode('cookie_domain')->end() - ->booleanNode('cookie_secure')->end() - ->booleanNode('cookie_httponly')->end() - ->scalarNode('gc_divisor')->end() - ->scalarNode('gc_probability')->end() - ->scalarNode('gc_maxlifetime')->end() - ->scalarNode('save_path')->defaultValue('%kernel.cache_dir%/sessions')->end() - ->scalarNode('lifetime')->info('DEPRECATED! Please use: cookie_lifetime')->end() - ->scalarNode('path')->info('DEPRECATED! Please use: cookie_path')->end() - ->scalarNode('domain')->info('DEPRECATED! Please use: cookie_domain')->end() - ->booleanNode('secure')->info('DEPRECATED! Please use: cookie_secure')->end() - ->booleanNode('httponly')->info('DEPRECATED! Please use: cookie_httponly')->end() - ->end() - ->end() - ->end() - ; - } - - private function addTemplatingSection(ArrayNodeDefinition $rootNode) - { - $organizeUrls = function($urls) { - $urls += array( - 'http' => array(), - 'ssl' => array(), - ); - - foreach ($urls as $i => $url) { - if (is_integer($i)) { - if (0 === strpos($url, 'https://') || 0 === strpos($url, '//')) { - $urls['http'][] = $urls['ssl'][] = $url; - } else { - $urls['http'][] = $url; - } - unset($urls[$i]); - } - } - - return $urls; - }; - - $rootNode - ->children() - ->arrayNode('templating') - ->info('templating configuration') - ->canBeUnset() - ->children() - ->scalarNode('assets_version')->defaultValue(null)->end() - ->scalarNode('assets_version_format')->defaultValue('%%s?%%s')->end() - ->scalarNode('hinclude_default_template')->defaultNull()->end() - ->arrayNode('form') - ->addDefaultsIfNotSet() - ->fixXmlConfig('resource') - ->children() - ->arrayNode('resources') - ->addDefaultChildrenIfNoneSet() - ->prototype('scalar')->defaultValue('FrameworkBundle:Form')->end() - ->validate() - ->ifTrue(function($v) {return !in_array('FrameworkBundle:Form', $v); }) - ->then(function($v){ - return array_merge(array('FrameworkBundle:Form'), $v); - }) - ->end() - ->end() - ->end() - ->end() - ->end() - ->fixXmlConfig('assets_base_url') - ->children() - ->arrayNode('assets_base_urls') - ->performNoDeepMerging() - ->addDefaultsIfNotSet() - ->beforeNormalization() - ->ifTrue(function($v) { return !is_array($v); }) - ->then(function($v) { return array($v); }) - ->end() - ->beforeNormalization() - ->always() - ->then($organizeUrls) - ->end() - ->children() - ->arrayNode('http') - ->prototype('scalar')->end() - ->end() - ->arrayNode('ssl') - ->prototype('scalar')->end() - ->end() - ->end() - ->end() - ->scalarNode('cache')->end() - ->end() - ->fixXmlConfig('engine') - ->children() - ->arrayNode('engines') - ->example(array('twig')) - ->isRequired() - ->requiresAtLeastOneElement() - ->beforeNormalization() - ->ifTrue(function($v){ return !is_array($v); }) - ->then(function($v){ return array($v); }) - ->end() - ->prototype('scalar')->end() - ->end() - ->end() - ->fixXmlConfig('loader') - ->children() - ->arrayNode('loaders') - ->beforeNormalization() - ->ifTrue(function($v){ return !is_array($v); }) - ->then(function($v){ return array($v); }) - ->end() - ->prototype('scalar')->end() - ->end() - ->end() - ->fixXmlConfig('package') - ->children() - ->arrayNode('packages') - ->useAttributeAsKey('name') - ->prototype('array') - ->fixXmlConfig('base_url') - ->children() - ->scalarNode('version')->defaultNull()->end() - ->scalarNode('version_format')->defaultValue('%%s?%%s')->end() - ->arrayNode('base_urls') - ->performNoDeepMerging() - ->addDefaultsIfNotSet() - ->beforeNormalization() - ->ifTrue(function($v) { return !is_array($v); }) - ->then(function($v) { return array($v); }) - ->end() - ->beforeNormalization() - ->always() - ->then($organizeUrls) - ->end() - ->children() - ->arrayNode('http') - ->prototype('scalar')->end() - ->end() - ->arrayNode('ssl') - ->prototype('scalar')->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ; - } - - private function addTranslatorSection(ArrayNodeDefinition $rootNode) - { - $rootNode - ->children() - ->arrayNode('translator') - ->info('translator configuration') - ->canBeUnset() - ->treatNullLike(array('enabled' => true)) - ->treatTrueLike(array('enabled' => true)) - ->children() - ->booleanNode('enabled')->defaultTrue()->end() - ->scalarNode('fallback')->defaultValue('en')->end() - ->end() - ->end() - ->end() - ; - } - - private function addValidationSection(ArrayNodeDefinition $rootNode) - { - $rootNode - ->children() - ->arrayNode('validation') - ->info('validation configuration') - ->canBeUnset() - ->treatNullLike(array('enabled' => true)) - ->treatTrueLike(array('enabled' => true)) - ->children() - ->booleanNode('enabled')->defaultTrue()->end() - ->scalarNode('cache')->end() - ->booleanNode('enable_annotations')->defaultFalse()->end() - ->end() - ->end() - ->end() - ; - } - - private function addAnnotationsSection(ArrayNodeDefinition $rootNode) - { - $rootNode - ->children() - ->arrayNode('annotations') - ->info('annotation configuration') - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('cache')->defaultValue('file')->end() - ->scalarNode('file_cache_dir')->defaultValue('%kernel.cache_dir%/annotations')->end() - ->booleanNode('debug')->defaultValue($this->debug)->end() - ->end() - ->end() - ->end() - ; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php deleted file mode 100644 index 94aa955..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ /dev/null @@ -1,651 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\DependencyInjection; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\Config\Resource\DirectoryResource; -use Symfony\Component\Finder\Finder; -use Symfony\Component\HttpKernel\DependencyInjection\Extension; -use Symfony\Component\Config\FileLocator; - -/** - * FrameworkExtension. - * - * @author Fabien Potencier - * @author Jeremy Mikola - */ -class FrameworkExtension extends Extension -{ - /** - * Responds to the app.config configuration parameter. - * - * @param array $configs - * @param ContainerBuilder $container - */ - public function load(array $configs, ContainerBuilder $container) - { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - - $loader->load('web.xml'); - $loader->load('services.xml'); - - // A translator must always be registered (as support is included by - // default in the Form component). If disabled, an identity translator - // will be used and everything will still work as expected. - $loader->load('translation.xml'); - - if ($container->getParameter('kernel.debug')) { - $loader->load('debug.xml'); - $container->setDefinition('event_dispatcher', $container->findDefinition('debug.event_dispatcher')); - $container->setAlias('debug.event_dispatcher', 'event_dispatcher'); - - $container->setDefinition('controller_resolver', $container->findDefinition('debug.controller_resolver')); - $container->setAlias('debug.controller_resolver', 'controller_resolver'); - } - - $configuration = $this->getConfiguration($configs, $container); - $config = $this->processConfiguration($configuration, $configs); - - $container->setParameter('kernel.secret', $config['secret']); - - $container->setParameter('kernel.trust_proxy_headers', $config['trust_proxy_headers']); - - $container->setParameter('kernel.default_locale', $config['default_locale']); - - if (!empty($config['test'])) { - $loader->load('test.xml'); - } - - if (isset($config['session'])) { - $this->registerSessionConfiguration($config['session'], $container, $loader); - } - - if (isset($config['form']) && !empty($config['form']['enabled'])) { - $this->registerFormConfiguration($config, $container, $loader); - $config['validation']['enabled'] = true; - } - - if (!empty($config['validation']['enabled'])) { - $this->registerValidationConfiguration($config['validation'], $container, $loader); - } - - if (isset($config['esi'])) { - $this->registerEsiConfiguration($config['esi'], $loader); - } - - if (isset($config['profiler'])) { - $this->registerProfilerConfiguration($config['profiler'], $container, $loader); - } - - if (isset($config['router'])) { - $this->registerRouterConfiguration($config['router'], $container, $loader); - } - - if (isset($config['templating'])) { - $this->registerTemplatingConfiguration($config['templating'], $config['ide'], $container, $loader); - } - - if (isset($config['translator'])) { - $this->registerTranslatorConfiguration($config['translator'], $container); - } - - $this->registerAnnotationsConfiguration($config['annotations'], $container, $loader); - - $this->addClassesToCompile(array( - 'Symfony\\Component\\HttpFoundation\\ParameterBag', - 'Symfony\\Component\\HttpFoundation\\HeaderBag', - 'Symfony\\Component\\HttpFoundation\\FileBag', - 'Symfony\\Component\\HttpFoundation\\ServerBag', - 'Symfony\\Component\\HttpFoundation\\Request', - 'Symfony\\Component\\HttpFoundation\\Response', - 'Symfony\\Component\\HttpFoundation\\ResponseHeaderBag', - - 'Symfony\\Component\\Config\\FileLocator', - - 'Symfony\\Component\\EventDispatcher\\Event', - 'Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher', - - 'Symfony\\Component\\HttpKernel\\EventListener\\ResponseListener', - 'Symfony\\Component\\HttpKernel\\EventListener\\RouterListener', - 'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver', - 'Symfony\\Component\\HttpKernel\\Event\\KernelEvent', - 'Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent', - 'Symfony\\Component\\HttpKernel\\Event\\FilterResponseEvent', - 'Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent', - 'Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent', - 'Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent', - 'Symfony\\Component\\HttpKernel\\KernelEvents', - 'Symfony\\Component\\HttpKernel\\Config\\FileLocator', - - 'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerNameParser', - 'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver', - // Cannot be included because annotations will parse the big compiled class file - // 'Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller', - )); - } - - public function getConfiguration(array $config, ContainerBuilder $container) - { - return new Configuration($container->getParameter('kernel.debug')); - } - - /** - * Loads Form configuration. - * - * @param array $config A configuration array - * @param ContainerBuilder $container A ContainerBuilder instance - * @param XmlFileLoader $loader An XmlFileLoader instance - */ - private function registerFormConfiguration($config, ContainerBuilder $container, XmlFileLoader $loader) - { - $loader->load('form.xml'); - if (isset($config['csrf_protection'])) { - if (!isset($config['session'])) { - throw new \LogicException('CSRF protection needs that sessions are enabled.'); - } - $loader->load('form_csrf.xml'); - - $container->setParameter('form.type_extension.csrf.enabled', $config['csrf_protection']['enabled']); - $container->setParameter('form.type_extension.csrf.field_name', $config['csrf_protection']['field_name']); - } - } - - /** - * Loads the ESI configuration. - * - * @param array $config An ESI configuration array - * @param XmlFileLoader $loader An XmlFileLoader instance - */ - private function registerEsiConfiguration(array $config, XmlFileLoader $loader) - { - if (!empty($config['enabled'])) { - $loader->load('esi.xml'); - } - } - - /** - * Loads the profiler configuration. - * - * @param array $config A profiler configuration array - * @param ContainerBuilder $container A ContainerBuilder instance - * @param XmlFileLoader $loader An XmlFileLoader instance - */ - private function registerProfilerConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader) - { - $loader->load('profiling.xml'); - $loader->load('collectors.xml'); - - $container->setParameter('profiler_listener.only_exceptions', $config['only_exceptions']); - $container->setParameter('profiler_listener.only_master_requests', $config['only_master_requests']); - - // Choose storage class based on the DSN - $supported = array( - 'sqlite' => 'Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage', - 'mysql' => 'Symfony\Component\HttpKernel\Profiler\MysqlProfilerStorage', - 'file' => 'Symfony\Component\HttpKernel\Profiler\FileProfilerStorage', - 'mongodb' => 'Symfony\Component\HttpKernel\Profiler\MongoDbProfilerStorage', - 'memcache' => 'Symfony\Component\HttpKernel\Profiler\MemcacheProfilerStorage', - 'memcached' => 'Symfony\Component\HttpKernel\Profiler\MemcachedProfilerStorage', - 'redis' => 'Symfony\Component\HttpKernel\Profiler\RedisProfilerStorage', - ); - list($class, ) = explode(':', $config['dsn'], 2); - if (!isset($supported[$class])) { - throw new \LogicException(sprintf('Driver "%s" is not supported for the profiler.', $class)); - } - - $container->setParameter('profiler.storage.dsn', $config['dsn']); - $container->setParameter('profiler.storage.username', $config['username']); - $container->setParameter('profiler.storage.password', $config['password']); - $container->setParameter('profiler.storage.lifetime', $config['lifetime']); - - $container->getDefinition('profiler.storage')->setClass($supported[$class]); - - if (isset($config['matcher'])) { - if (isset($config['matcher']['service'])) { - $container->setAlias('profiler.request_matcher', $config['matcher']['service']); - } elseif (isset($config['matcher']['ip']) || isset($config['matcher']['path'])) { - $definition = $container->register('profiler.request_matcher', 'Symfony\\Component\\HttpFoundation\\RequestMatcher'); - $definition->setPublic(false); - - if (isset($config['matcher']['ip'])) { - $definition->addMethodCall('matchIp', array($config['matcher']['ip'])); - } - - if (isset($config['matcher']['path'])) { - $definition->addMethodCall('matchPath', array($config['matcher']['path'])); - } - } - } - } - - /** - * Loads the router configuration. - * - * @param array $config A router configuration array - * @param ContainerBuilder $container A ContainerBuilder instance - * @param XmlFileLoader $loader An XmlFileLoader instance - */ - private function registerRouterConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader) - { - $loader->load('routing.xml'); - - $container->setParameter('router.resource', $config['resource']); - $router = $container->findDefinition('router.default'); - - $argument = $router->getArgument(2); - $argument['strict_parameters'] = $config['strict_parameters']; - if (isset($config['type'])) { - $argument['resource_type'] = $config['type']; - } - $router->replaceArgument(2, $argument); - - $container->setParameter('request_listener.http_port', $config['http_port']); - $container->setParameter('request_listener.https_port', $config['https_port']); - - $this->addClassesToCompile(array( - 'Symfony\\Component\\Routing\\Generator\\UrlGenerator', - 'Symfony\\Component\\Routing\\RequestContext', - 'Symfony\\Component\\Routing\\Router', - 'Symfony\\Bundle\\FrameworkBundle\\Routing\\RedirectableUrlMatcher', - $container->findDefinition('router.default')->getClass(), - )); - } - - /** - * Loads the session configuration. - * - * @param array $config A session configuration array - * @param ContainerBuilder $container A ContainerBuilder instance - * @param XmlFileLoader $loader An XmlFileLoader instance - */ - private function registerSessionConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader) - { - $loader->load('session.xml'); - - // session storage - $container->setAlias('session.storage', $config['storage_id']); - $options = array(); - foreach (array('name', 'cookie_lifetime', 'cookie_path', 'cookie_domain', 'cookie_secure', 'cookie_httponly', 'gc_maxlifetime', 'gc_probability', 'gc_divisor') as $key) { - if (isset($config[$key])) { - $options[$key] = $config[$key]; - } - } - - //we deprecated session options without cookie_ prefix, but we are still supporting them, - //Let's merge the ones that were supplied without prefix - foreach (array('lifetime', 'path', 'domain', 'secure', 'httponly') as $key) { - if (!isset($options['cookie_'.$key]) && isset($config[$key])) { - $options['cookie_'.$key] = $config[$key]; - } - } - $container->setParameter('session.storage.options', $options); - - // session handler (the internal callback registered with PHP session management) - $container->setAlias('session.handler', $config['handler_id']); - - $container->setParameter('session.save_path', $config['save_path']); - - $this->addClassesToCompile(array( - 'Symfony\\Bundle\\FrameworkBundle\\EventListener\\SessionListener', - 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage', - 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeFileSessionHandler', - 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\AbstractProxy', - 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\SessionHandlerProxy', - $container->getDefinition('session')->getClass(), - )); - - if ($container->hasDefinition($config['storage_id'])) { - $this->addClassesToCompile(array( - $container->findDefinition('session.storage')->getClass(), - )); - } - } - - /** - * Loads the templating configuration. - * - * @param array $config A templating configuration array - * @param string $ide - * @param ContainerBuilder $container A ContainerBuilder instance - * @param XmlFileLoader $loader An XmlFileLoader instance - */ - private function registerTemplatingConfiguration(array $config, $ide, ContainerBuilder $container, XmlFileLoader $loader) - { - $loader->load('templating.xml'); - $loader->load('templating_php.xml'); - - $links = array( - 'textmate' => 'txmt://open?url=file://%%f&line=%%l', - 'macvim' => 'mvim://open?url=file://%%f&line=%%l', - ); - - $container->setParameter('templating.helper.code.file_link_format', isset($links[$ide]) ? $links[$ide] : $ide); - $container->setParameter('templating.helper.form.resources', $config['form']['resources']); - $container->setParameter('templating.hinclude.default_template', $config['hinclude_default_template']); - - if ($container->getParameter('kernel.debug')) { - $loader->load('templating_debug.xml'); - } - - // create package definitions and add them to the assets helper - $defaultPackage = $this->createPackageDefinition($container, $config['assets_base_urls']['http'], $config['assets_base_urls']['ssl'], $config['assets_version'], $config['assets_version_format']); - $container->setDefinition('templating.asset.default_package', $defaultPackage); - $namedPackages = array(); - foreach ($config['packages'] as $name => $package) { - $namedPackage = $this->createPackageDefinition($container, $package['base_urls']['http'], $package['base_urls']['ssl'], $package['version'], $package['version_format'], $name); - $container->setDefinition('templating.asset.package.'.$name, $namedPackage); - $namedPackages[$name] = new Reference('templating.asset.package.'.$name); - } - $container->getDefinition('templating.helper.assets')->setArguments(array( - new Reference('templating.asset.default_package'), - $namedPackages, - )); - - // Apply request scope to assets helper if one or more packages are request-scoped - $requireRequestScope = array_reduce( - $namedPackages, - function($v, Reference $ref) use ($container) { - return $v || 'request' === $container->getDefinition($ref)->getScope(); - }, - 'request' === $defaultPackage->getScope() - ); - - if ($requireRequestScope) { - $container->getDefinition('templating.helper.assets')->setScope('request'); - } - - if (!empty($config['loaders'])) { - $loaders = array_map(function($loader) { return new Reference($loader); }, $config['loaders']); - - // Use a delegation unless only a single loader was registered - if (1 === count($loaders)) { - $container->setAlias('templating.loader', (string) reset($loaders)); - } else { - $container->getDefinition('templating.loader.chain')->addArgument($loaders); - $container->setAlias('templating.loader', 'templating.loader.chain'); - } - } - - $container->setParameter('templating.loader.cache.path', null); - if (isset($config['cache'])) { - // Wrap the existing loader with cache (must happen after loaders are registered) - $container->setDefinition('templating.loader.wrapped', $container->findDefinition('templating.loader')); - $loaderCache = $container->getDefinition('templating.loader.cache'); - $container->setParameter('templating.loader.cache.path', $config['cache']); - - $container->setDefinition('templating.loader', $loaderCache); - } - - $this->addClassesToCompile(array( - 'Symfony\\Bundle\\FrameworkBundle\\Templating\\GlobalVariables', - 'Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateReference', - 'Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateNameParser', - $container->findDefinition('templating.locator')->getClass(), - )); - - if (in_array('php', $config['engines'], true)) { - $this->addClassesToCompile(array( - 'Symfony\\Component\\Templating\\Storage\\FileStorage', - 'Symfony\\Bundle\\FrameworkBundle\\Templating\\PhpEngine', - 'Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\FilesystemLoader', - )); - } - - $container->setParameter('templating.engines', $config['engines']); - $engines = array_map(function($engine) { return new Reference('templating.engine.'.$engine); }, $config['engines']); - - // Use a delegation unless only a single engine was registered - if (1 === count($engines)) { - $container->setAlias('templating', (string) reset($engines)); - } else { - $container->getDefinition('templating.engine.delegating')->replaceArgument(1, $engines); - $container->setAlias('templating', 'templating.engine.delegating'); - } - } - - /** - * Returns a definition for an asset package. - */ - private function createPackageDefinition(ContainerBuilder $container, array $httpUrls, array $sslUrls, $version, $format, $name = null) - { - if (!$httpUrls) { - $package = new DefinitionDecorator('templating.asset.path_package'); - $package - ->setPublic(false) - ->setScope('request') - ->replaceArgument(1, $version) - ->replaceArgument(2, $format) - ; - - return $package; - } - - if ($httpUrls == $sslUrls) { - $package = new DefinitionDecorator('templating.asset.url_package'); - $package - ->setPublic(false) - ->replaceArgument(0, $sslUrls) - ->replaceArgument(1, $version) - ->replaceArgument(2, $format) - ; - - return $package; - } - - $prefix = $name ? 'templating.asset.package.'.$name : 'templating.asset.default_package'; - - $httpPackage = new DefinitionDecorator('templating.asset.url_package'); - $httpPackage - ->replaceArgument(0, $httpUrls) - ->replaceArgument(1, $version) - ->replaceArgument(2, $format) - ; - $container->setDefinition($prefix.'.http', $httpPackage); - - if ($sslUrls) { - $sslPackage = new DefinitionDecorator('templating.asset.url_package'); - $sslPackage - ->replaceArgument(0, $sslUrls) - ->replaceArgument(1, $version) - ->replaceArgument(2, $format) - ; - } else { - $sslPackage = new DefinitionDecorator('templating.asset.path_package'); - $sslPackage - ->setScope('request') - ->replaceArgument(1, $version) - ->replaceArgument(2, $format) - ; - } - $container->setDefinition($prefix.'.ssl', $sslPackage); - - $package = new DefinitionDecorator('templating.asset.request_aware_package'); - $package - ->setPublic(false) - ->setScope('request') - ->replaceArgument(1, $prefix.'.http') - ->replaceArgument(2, $prefix.'.ssl') - ; - - return $package; - } - - /** - * Loads the translator configuration. - * - * @param array $config A translator configuration array - * @param ContainerBuilder $container A ContainerBuilder instance - */ - private function registerTranslatorConfiguration(array $config, ContainerBuilder $container) - { - if (!empty($config['enabled'])) { - // Use the "real" translator instead of the identity default - $container->setAlias('translator', 'translator.default'); - $translator = $container->findDefinition('translator.default'); - $translator->addMethodCall('setFallbackLocale', array($config['fallback'])); - - // Discover translation directories - $dirs = array(); - if (class_exists('Symfony\Component\Validator\Validator')) { - $r = new \ReflectionClass('Symfony\Component\Validator\Validator'); - - $dirs[] = dirname($r->getFilename()).'/Resources/translations'; - } - if (class_exists('Symfony\Component\Form\Form')) { - $r = new \ReflectionClass('Symfony\Component\Form\Form'); - - $dirs[] = dirname($r->getFilename()).'/Resources/translations'; - } - $overridePath = $container->getParameter('kernel.root_dir').'/Resources/%s/translations'; - foreach ($container->getParameter('kernel.bundles') as $bundle => $class) { - $reflection = new \ReflectionClass($class); - if (is_dir($dir = dirname($reflection->getFilename()).'/Resources/translations')) { - $dirs[] = $dir; - } - if (is_dir($dir = sprintf($overridePath, $bundle))) { - $dirs[] = $dir; - } - } - if (is_dir($dir = $container->getParameter('kernel.root_dir').'/Resources/translations')) { - $dirs[] = $dir; - } - - // Register translation resources - if ($dirs) { - foreach ($dirs as $dir) { - $container->addResource(new DirectoryResource($dir)); - } - $finder = Finder::create() - ->files() - ->filter(function (\SplFileInfo $file) { - return 2 === substr_count($file->getBasename(), '.') && preg_match('/\.\w+$/', $file->getBasename()); - }) - ->in($dirs) - ; - - foreach ($finder as $file) { - // filename is domain.locale.format - list($domain, $locale, $format) = explode('.', $file->getBasename(), 3); - $translator->addMethodCall('addResource', array($format, (string) $file, $locale, $domain)); - } - } - } - } - - /** - * Loads the validator configuration. - * - * @param array $config A validation configuration array - * @param ContainerBuilder $container A ContainerBuilder instance - * @param XmlFileLoader $loader An XmlFileLoader instance - */ - private function registerValidationConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader) - { - $loader->load('validator.xml'); - - $container->setParameter('validator.mapping.loader.xml_files_loader.mapping_files', $this->getValidatorXmlMappingFiles($container)); - $container->setParameter('validator.mapping.loader.yaml_files_loader.mapping_files', $this->getValidatorYamlMappingFiles($container)); - - if (array_key_exists('enable_annotations', $config) && $config['enable_annotations']) { - $loaderChain = $container->getDefinition('validator.mapping.loader.loader_chain'); - $arguments = $loaderChain->getArguments(); - array_unshift($arguments[0], new Reference('validator.mapping.loader.annotation_loader')); - $loaderChain->setArguments($arguments); - } - - if (isset($config['cache'])) { - $container->getDefinition('validator.mapping.class_metadata_factory') - ->replaceArgument(1, new Reference('validator.mapping.cache.'.$config['cache'])); - $container->setParameter( - 'validator.mapping.cache.prefix', - 'validator_'.md5($container->getParameter('kernel.root_dir')) - ); - } - } - - private function getValidatorXmlMappingFiles(ContainerBuilder $container) - { - $reflClass = new \ReflectionClass('Symfony\Component\Form\FormInterface'); - $files = array(dirname($reflClass->getFileName()).'/Resources/config/validation.xml'); - $container->addResource(new FileResource($files[0])); - - foreach ($container->getParameter('kernel.bundles') as $bundle) { - $reflection = new \ReflectionClass($bundle); - if (is_file($file = dirname($reflection->getFilename()).'/Resources/config/validation.xml')) { - $files[] = realpath($file); - $container->addResource(new FileResource($file)); - } - } - - return $files; - } - - private function getValidatorYamlMappingFiles(ContainerBuilder $container) - { - $files = array(); - - foreach ($container->getParameter('kernel.bundles') as $bundle) { - $reflection = new \ReflectionClass($bundle); - if (is_file($file = dirname($reflection->getFilename()).'/Resources/config/validation.yml')) { - $files[] = realpath($file); - $container->addResource(new FileResource($file)); - } - } - - return $files; - } - - private function registerAnnotationsConfiguration(array $config, ContainerBuilder $container,$loader) - { - $loader->load('annotations.xml'); - - if ('file' === $config['cache']) { - $cacheDir = $container->getParameterBag()->resolveValue($config['file_cache_dir']); - if (!is_dir($cacheDir) && false === @mkdir($cacheDir, 0777, true)) { - throw new \RuntimeException(sprintf('Could not create cache directory "%s".', $cacheDir)); - } - - $container - ->getDefinition('annotations.file_cache_reader') - ->replaceArgument(1, $cacheDir) - ->replaceArgument(2, $config['debug']) - ; - $container->setAlias('annotation_reader', 'annotations.file_cache_reader'); - } elseif ('none' !== $config['cache']) { - $container - ->getDefinition('annotations.cached_reader') - ->replaceArgument(1, new Reference($config['cache'])) - ->replaceArgument(2, $config['debug']) - ; - $container->setAlias('annotation_reader', 'annotations.cached_reader'); - } - } - - /** - * Returns the base path for the XSD files. - * - * @return string The XSD base path - */ - public function getXsdValidationBasePath() - { - return __DIR__.'/../Resources/config/schema'; - } - - public function getNamespace() - { - return 'http://symfony.com/schema/dic/symfony'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/EventListener/SessionListener.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/EventListener/SessionListener.php deleted file mode 100644 index f8155a9..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/EventListener/SessionListener.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\EventListener; - -use Symfony\Component\DependencyInjection\ContainerInterface; - -use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\HttpKernel\Event\GetResponseEvent; -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -/** - * Sets the session on the request. - * - * This will also start the session if it was already started during a previous - * request. - * - * @author Johannes M. Schmitt - */ -class SessionListener implements EventSubscriberInterface -{ - /** - * @var ContainerInterface - */ - private $container; - - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - public function onKernelRequest(GetResponseEvent $event) - { - if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { - return; - } - - $request = $event->getRequest(); - if (!$this->container->has('session') || $request->hasSession()) { - return; - } - - $request->setSession($this->container->get('session')); - } - - public static function getSubscribedEvents() - { - return array( - KernelEvents::REQUEST => array('onKernelRequest', 128), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/EventListener/TestSessionListener.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/EventListener/TestSessionListener.php deleted file mode 100644 index 9e06177..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/EventListener/TestSessionListener.php +++ /dev/null @@ -1,88 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\EventListener; - -use Symfony\Component\HttpFoundation\Cookie; -use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; -use Symfony\Component\HttpKernel\Event\GetResponseEvent; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -/** - * TestSessionListener. - * - * Saves session in test environment. - * - * @author Bulat Shakirzyanov - * @author Fabien Potencier - */ -class TestSessionListener implements EventSubscriberInterface -{ - protected $container; - - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - public function onKernelRequest(GetResponseEvent $event) - { - if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { - return; - } - - // bootstrap the session - if (!$this->container->has('session')) { - return; - } - - $session = $this->container->get('session'); - $cookies = $event->getRequest()->cookies; - - if ($cookies->has($session->getName())) { - $session->setId($cookies->get($session->getName())); - } else { - $session->migrate(false); - } - } - - /** - * Checks if session was initialized and saves if current request is master - * Runs on 'kernel.response' in test environment - * - * @param FilterResponseEvent $event - */ - public function onKernelResponse(FilterResponseEvent $event) - { - if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { - return; - } - - if ($session = $event->getRequest()->getSession()) { - $session->save(); - - $params = session_get_cookie_params(); - - $event->getResponse()->headers->setCookie(new Cookie($session->getName(), $session->getId(), 0 === $params['lifetime'] ? 0 : time() + $params['lifetime'], $params['path'], $params['domain'], $params['secure'], $params['httponly'])); - } - } - - public static function getSubscribedEvents() - { - return array( - KernelEvents::REQUEST => array('onKernelRequest', 192), - KernelEvents::RESPONSE => array('onKernelResponse', -128), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php deleted file mode 100644 index 544f202..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle; - -use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddConstraintValidatorsPass; -use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddValidatorInitializersPass; -use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\FormPass; -use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TemplatingPass; -use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\RegisterKernelListenersPass; -use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\RoutingResolverPass; -use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ProfilerPass; -use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TranslatorPass; -use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddCacheWarmerPass; -use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddCacheClearerPass; -use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ContainerBuilderDebugDumpPass; -use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CompilerDebugDumpPass; -use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TranslationExtractorPass; -use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TranslationDumperPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\PassConfig; -use Symfony\Component\DependencyInjection\Scope; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Bundle\Bundle; - -/** - * Bundle. - * - * @author Fabien Potencier - */ -class FrameworkBundle extends Bundle -{ - public function boot() - { - if ($this->container->getParameter('kernel.trust_proxy_headers')) { - Request::trustProxyData(); - } - } - - public function build(ContainerBuilder $container) - { - parent::build($container); - - $container->addScope(new Scope('request')); - - $container->addCompilerPass(new RoutingResolverPass()); - $container->addCompilerPass(new ProfilerPass()); - $container->addCompilerPass(new RegisterKernelListenersPass(), PassConfig::TYPE_AFTER_REMOVING); - $container->addCompilerPass(new TemplatingPass()); - $container->addCompilerPass(new AddConstraintValidatorsPass()); - $container->addCompilerPass(new AddValidatorInitializersPass()); - $container->addCompilerPass(new FormPass()); - $container->addCompilerPass(new TranslatorPass()); - $container->addCompilerPass(new AddCacheWarmerPass()); - $container->addCompilerPass(new AddCacheClearerPass()); - $container->addCompilerPass(new TranslationExtractorPass()); - $container->addCompilerPass(new TranslationDumperPass()); - - if ($container->getParameter('kernel.debug')) { - $container->addCompilerPass(new ContainerBuilderDebugDumpPass(), PassConfig::TYPE_AFTER_REMOVING); - $container->addCompilerPass(new CompilerDebugDumpPass(), PassConfig::TYPE_AFTER_REMOVING); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php deleted file mode 100644 index f07c994..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php +++ /dev/null @@ -1,82 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\HttpCache; - -use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\HttpKernel\HttpCache\HttpCache as BaseHttpCache; -use Symfony\Component\HttpKernel\HttpCache\Esi; -use Symfony\Component\HttpKernel\HttpCache\Store; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; - -/** - * Manages HTTP cache objects in a Container. - * - * @author Fabien Potencier - */ -abstract class HttpCache extends BaseHttpCache -{ - protected $cacheDir; - protected $kernel; - - /** - * Constructor. - * - * @param HttpKernelInterface $kernel An HttpKernelInterface instance - * @param string $cacheDir The cache directory (default used if null) - */ - public function __construct(HttpKernelInterface $kernel, $cacheDir = null) - { - $this->kernel = $kernel; - $this->cacheDir = $cacheDir; - - parent::__construct($kernel, $this->createStore(), $this->createEsi(), array_merge(array('debug' => $kernel->isDebug()), $this->getOptions())); - } - - /** - * Forwards the Request to the backend and returns the Response. - * - * @param Request $request A Request instance - * @param Boolean $raw Whether to catch exceptions or not - * @param Response $entry A Response instance (the stale entry if present, null otherwise) - * - * @return Response A Response instance - */ - protected function forward(Request $request, $raw = false, Response $entry = null) - { - $this->getKernel()->boot(); - $this->getKernel()->getContainer()->set('cache', $this); - $this->getKernel()->getContainer()->set('esi', $this->getEsi()); - - return parent::forward($request, $raw, $entry); - } - - /** - * Returns an array of options to customize the Cache configuration. - * - * @return array An array of options - */ - protected function getOptions() - { - return array(); - } - - protected function createEsi() - { - return new Esi(); - } - - protected function createStore() - { - return new Store($this->cacheDir ?: $this->kernel->getCacheDir().'/http_cache'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php deleted file mode 100644 index ddc5994..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php +++ /dev/null @@ -1,241 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\StreamedResponse; -use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\HttpKernel\HttpKernel as BaseHttpKernel; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; - -/** - * This HttpKernel is used to manage scope changes of the DI container. - * - * @author Fabien Potencier - * @author Johannes M. Schmitt - */ -class HttpKernel extends BaseHttpKernel -{ - protected $container; - - private $esiSupport; - - public function __construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver) - { - parent::__construct($dispatcher, $controllerResolver); - - $this->container = $container; - } - - public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) - { - $request->headers->set('X-Php-Ob-Level', ob_get_level()); - - $this->container->enterScope('request'); - $this->container->set('request', $request, 'request'); - - try { - $response = parent::handle($request, $type, $catch); - } catch (\Exception $e) { - $this->container->leaveScope('request'); - - throw $e; - } - - $this->container->leaveScope('request'); - - return $response; - } - - /** - * Forwards the request to another controller. - * - * @param string $controller The controller name (a string like BlogBundle:Post:index) - * @param array $attributes An array of request attributes - * @param array $query An array of request query parameters - * - * @return Response A Response instance - */ - public function forward($controller, array $attributes = array(), array $query = array()) - { - $attributes['_controller'] = $controller; - $subRequest = $this->container->get('request')->duplicate($query, null, $attributes); - - return $this->handle($subRequest, HttpKernelInterface::SUB_REQUEST); - } - - /** - * Renders a Controller and returns the Response content. - * - * Note that this method generates an esi:include tag only when both the standalone - * option is set to true and the request has ESI capability (@see Symfony\Component\HttpKernel\HttpCache\ESI). - * - * Available options: - * - * * attributes: An array of request attributes (only when the first argument is a controller) - * * query: An array of request query parameters (only when the first argument is a controller) - * * ignore_errors: true to return an empty string in case of an error - * * alt: an alternative controller to execute in case of an error (can be a controller, a URI, or an array with the controller, the attributes, and the query arguments) - * * standalone: whether to generate an esi:include tag or not when ESI is supported - * * comment: a comment to add when returning an esi:include tag - * - * @param string $controller A controller name to execute (a string like BlogBundle:Post:index), or a relative URI - * @param array $options An array of options - * - * @return string The Response content - */ - public function render($controller, array $options = array()) - { - $options = array_merge(array( - 'attributes' => array(), - 'query' => array(), - 'ignore_errors' => !$this->container->getParameter('kernel.debug'), - 'alt' => array(), - 'standalone' => false, - 'comment' => '', - ), $options); - - if (!is_array($options['alt'])) { - $options['alt'] = array($options['alt']); - } - - if (null === $this->esiSupport) { - $this->esiSupport = $this->container->has('esi') && $this->container->get('esi')->hasSurrogateEsiCapability($this->container->get('request')); - } - - if ($this->esiSupport && (true === $options['standalone'] || 'esi' === $options['standalone'])) { - $uri = $this->generateInternalUri($controller, $options['attributes'], $options['query']); - - $alt = ''; - if ($options['alt']) { - $alt = $this->generateInternalUri($options['alt'][0], isset($options['alt'][1]) ? $options['alt'][1] : array(), isset($options['alt'][2]) ? $options['alt'][2] : array()); - } - - return $this->container->get('esi')->renderIncludeTag($uri, $alt, $options['ignore_errors'], $options['comment']); - } - - if ('js' === $options['standalone']) { - $uri = $this->generateInternalUri($controller, $options['attributes'], $options['query'], false); - $defaultContent = null; - - if ($template = $this->container->getParameter('templating.hinclude.default_template')) { - $defaultContent = $this->container->get('templating')->render($template); - } - - return $this->renderHIncludeTag($uri, $defaultContent); - } - - $request = $this->container->get('request'); - - // controller or URI? - if (0 === strpos($controller, '/')) { - $subRequest = Request::create($request->getUriForPath($controller), 'get', array(), $request->cookies->all(), array(), $request->server->all()); - if ($session = $request->getSession()) { - $subRequest->setSession($session); - } - } else { - $options['attributes']['_controller'] = $controller; - - if (!isset($options['attributes']['_format'])) { - $options['attributes']['_format'] = $request->getRequestFormat(); - } - - $options['attributes']['_route'] = '_internal'; - $subRequest = $request->duplicate($options['query'], null, $options['attributes']); - $subRequest->setMethod('GET'); - } - - $level = ob_get_level(); - try { - $response = $this->handle($subRequest, HttpKernelInterface::SUB_REQUEST, false); - - if (!$response->isSuccessful()) { - throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $request->getUri(), $response->getStatusCode())); - } - - if (!$response instanceof StreamedResponse) { - return $response->getContent(); - } - - $response->sendContent(); - } catch (\Exception $e) { - if ($options['alt']) { - $alt = $options['alt']; - unset($options['alt']); - $options['attributes'] = isset($alt[1]) ? $alt[1] : array(); - $options['query'] = isset($alt[2]) ? $alt[2] : array(); - - return $this->render($alt[0], $options); - } - - if (!$options['ignore_errors']) { - throw $e; - } - - // let's clean up the output buffers that were created by the sub-request - while (ob_get_level() > $level) { - ob_get_clean(); - } - } - } - - /** - * Generates an internal URI for a given controller. - * - * This method uses the "_internal" route, which should be available. - * - * @param string $controller A controller name to execute (a string like BlogBundle:Post:index), or a relative URI - * @param array $attributes An array of request attributes - * @param array $query An array of request query parameters - * @param boolean $secure - * - * @return string An internal URI - */ - public function generateInternalUri($controller, array $attributes = array(), array $query = array(), $secure = true) - { - if (0 === strpos($controller, '/')) { - return $controller; - } - - $path = http_build_query($attributes, '', '&'); - $uri = $this->container->get('router')->generate($secure ? '_internal' : '_internal_public', array( - 'controller' => $controller, - 'path' => $path ?: 'none', - '_format' => $this->container->get('request')->getRequestFormat(), - )); - - if ($queryString = http_build_query($query, '', '&')) { - $uri .= '?'.$queryString; - } - - return $uri; - } - - /** - * Renders an HInclude tag. - * - * @param string $uri A URI - * @param string $defaultContent Default content - */ - public function renderHIncludeTag($uri, $defaultContent = null) - { - return sprintf('%s', $uri, $defaultContent); - } - - public function hasEsiSupport() - { - return $this->esiSupport; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/LICENSE b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/LICENSE deleted file mode 100644 index cdffe7a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2012 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/annotations.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/annotations.xml deleted file mode 100644 index 1c0c312..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/annotations.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - Doctrine\Common\Annotations\AnnotationReader - Doctrine\Common\Annotations\CachedReader - Doctrine\Common\Annotations\FileCacheReader - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/collectors.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/collectors.xml deleted file mode 100644 index 8163646..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/collectors.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector - Symfony\Component\HttpKernel\DataCollector\RequestDataCollector - Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector - Symfony\Component\HttpKernel\DataCollector\EventDataCollector - Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector - Symfony\Component\HttpKernel\DataCollector\TimeDataCollector - Symfony\Component\HttpKernel\DataCollector\MemoryDataCollector - Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/debug.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/debug.xml deleted file mode 100644 index 51b239e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/debug.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - Symfony\Component\HttpKernel\Debug\ContainerAwareTraceableEventDispatcher - Symfony\Component\HttpKernel\Debug\Stopwatch - %kernel.cache_dir%/%kernel.container_class%.xml - Symfony\Bundle\FrameworkBundle\Controller\TraceableControllerResolver - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/esi.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/esi.xml deleted file mode 100644 index 9e1d57f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/esi.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - Symfony\Component\HttpKernel\HttpCache\Esi - Symfony\Component\HttpKernel\EventListener\EsiListener - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/form.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/form.xml deleted file mode 100644 index d2df3eb..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/form.xml +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - Symfony\Component\Form\ResolvedFormTypeFactory - Symfony\Component\Form\FormRegistry - Symfony\Component\Form\FormFactory - Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension - Symfony\Component\Form\Extension\Validator\ValidatorTypeGuesser - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/form_csrf.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/form_csrf.xml deleted file mode 100644 index 72442bc..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/form_csrf.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - Symfony\Component\Form\Extension\Csrf\CsrfProvider\SessionCsrfProvider - - - - - - %kernel.secret% - - - - - - %form.type_extension.csrf.enabled% - %form.type_extension.csrf.field_name% - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/profiling.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/profiling.xml deleted file mode 100644 index a866660..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/profiling.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - Symfony\Component\HttpKernel\Profiler\Profiler - Symfony\Component\HttpKernel\EventListener\ProfilerListener - - - - - - - - - - - %profiler.storage.dsn% - %profiler.storage.username% - %profiler.storage.password% - %profiler.storage.lifetime% - - - - - - - %profiler_listener.only_exceptions% - %profiler_listener.only_master_requests% - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/router.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/router.php deleted file mode 100644 index e55c81c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/router.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * This file implements rewrite rules for PHP built-in web server. - * - * See: http://www.php.net/manual/en/features.commandline.webserver.php - * - * If you have custom directory layout, then you have to write your own router - * and pass it as a value to 'router' option of server:run command. - * - * @author: Michał Pipa - * @author: Albert Jessurum - */ - -if (is_file($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $_SERVER['SCRIPT_NAME'])) { - return false; -} - -$_SERVER['SCRIPT_FILENAME'] = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'app_dev.php'; - -require 'app_dev.php'; diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml deleted file mode 100644 index ff6c6f5..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - Symfony\Bundle\FrameworkBundle\Routing\Router - Symfony\Component\Routing\RequestContext - Symfony\Bundle\FrameworkBundle\Routing\DelegatingLoader - Symfony\Component\Config\Loader\LoaderResolver - Symfony\Component\Routing\Loader\XmlFileLoader - Symfony\Component\Routing\Loader\YamlFileLoader - Symfony\Component\Routing\Loader\PhpFileLoader - Symfony\Component\Routing\Generator\UrlGenerator - Symfony\Component\Routing\Generator\UrlGenerator - Symfony\Component\Routing\Generator\Dumper\PhpGeneratorDumper - Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher - Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher - Symfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper - Symfony\Bundle\FrameworkBundle\CacheWarmer\RouterCacheWarmer - %kernel.name%%kernel.environment%UrlMatcher - %kernel.name%%kernel.environment%UrlGenerator - Symfony\Component\HttpKernel\EventListener\RouterListener - localhost - http - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %router.resource% - - %kernel.cache_dir% - %kernel.debug% - %router.options.generator_class% - %router.options.generator_base_class% - %router.options.generator_dumper_class% - %router.options.generator.cache_class% - %router.options.matcher_class% - %router.options.matcher_base_class% - %router.options.matcher_dumper_class% - %router.options.matcher.cache_class% - - - - - - - - - - GET - %router.request_context.host% - %router.request_context.scheme% - %request_listener.http_port% - %request_listener.https_port% - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing/internal.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing/internal.xml deleted file mode 100644 index 556c45b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing/internal.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - FrameworkBundle:Internal:index - .+ - [^.]+ - - - - FrameworkBundle:Internal:index - .+ - [^.]+ - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd deleted file mode 100644 index 5a97023..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml deleted file mode 100644 index 36f01f0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher - Symfony\Bundle\FrameworkBundle\HttpKernel - Symfony\Component\Filesystem\Filesystem - Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate - Symfony\Component\HttpKernel\CacheClearer\ChainCacheClearer - Symfony\Component\HttpKernel\Config\FileLocator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %kernel.root_dir%/Resources - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml deleted file mode 100644 index a89cf9a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - Symfony\Component\HttpFoundation\Session\Session - Symfony\Component\HttpFoundation\Session\Flash\FlashBag - Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag - Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage - Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage - Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler - Symfony\Bundle\FrameworkBundle\EventListener\SessionListener - - - - - - - - - - - %session.storage.options% - - - - - - - - - %kernel.cache_dir%/sessions - - - - %session.save_path% - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating.xml deleted file mode 100644 index 63238d7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - Symfony\Bundle\FrameworkBundle\Templating\DelegatingEngine - Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser - Symfony\Bundle\FrameworkBundle\Templating\TemplateFilenameParser - Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplatePathsCacheWarmer - Symfony\Bundle\FrameworkBundle\Templating\Loader\TemplateLocator - Symfony\Bundle\FrameworkBundle\Templating\Loader\FilesystemLoader - Symfony\Component\Templating\Loader\CacheLoader - Symfony\Component\Templating\Loader\ChainLoader - Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinder - - - - - - - - - - - - - - - - - %kernel.cache_dir% - - - - - - %kernel.root_dir%/Resources - - - - - - - - - - - - - - - %templating.loader.cache.path% - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_debug.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_debug.xml deleted file mode 100644 index 0d3cebe..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_debug.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Symfony\Bundle\FrameworkBundle\Templating\Debugger - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_php.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_php.xml deleted file mode 100644 index ea17954..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_php.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - Symfony\Bundle\FrameworkBundle\Templating\PhpEngine - Symfony\Component\Templating\Helper\SlotsHelper - Symfony\Component\Templating\Helper\CoreAssetsHelper - Symfony\Bundle\FrameworkBundle\Templating\Helper\ActionsHelper - Symfony\Bundle\FrameworkBundle\Templating\Helper\RouterHelper - Symfony\Bundle\FrameworkBundle\Templating\Helper\RequestHelper - Symfony\Bundle\FrameworkBundle\Templating\Helper\SessionHelper - Symfony\Bundle\FrameworkBundle\Templating\Helper\CodeHelper - Symfony\Bundle\FrameworkBundle\Templating\Helper\TranslatorHelper - Symfony\Bundle\FrameworkBundle\Templating\Helper\FormHelper - Symfony\Component\Form\Extension\Templating\TemplatingRendererEngine - Symfony\Component\Form\FormRenderer - Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables - Symfony\Bundle\FrameworkBundle\Templating\Asset\PathPackage - Symfony\Component\Templating\Asset\UrlPackage - Symfony\Bundle\FrameworkBundle\Templating\Asset\PackageFactory - - - - - - - - - %kernel.charset% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %templating.helper.code.file_link_format% - %kernel.root_dir% - %kernel.charset% - - - - - - - - - - - - - - - %templating.helper.form.resources% - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/test.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/test.xml deleted file mode 100644 index 4e609a0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/test.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - Symfony\Bundle\FrameworkBundle\Client - - Symfony\Component\BrowserKit\History - Symfony\Component\BrowserKit\CookieJar - Symfony\Bundle\FrameworkBundle\EventListener\TestSessionListener - - - - - - %test.client.parameters% - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/translation.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/translation.xml deleted file mode 100644 index 6a37782..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/translation.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - Symfony\Bundle\FrameworkBundle\Translation\Translator - Symfony\Component\Translation\IdentityTranslator - Symfony\Component\Translation\MessageSelector - Symfony\Component\Translation\Loader\PhpFileLoader - Symfony\Component\Translation\Loader\YamlFileLoader - Symfony\Component\Translation\Loader\XliffFileLoader - Symfony\Component\Translation\Loader\PoFileLoader - Symfony\Component\Translation\Loader\MoFileLoader - Symfony\Component\Translation\Loader\QtTranslationsLoader - Symfony\Component\Translation\Loader\CsvFileLoader - Symfony\Component\Translation\Loader\IcuResFileLoader - Symfony\Component\Translation\Loader\IcuDatFileLoader - Symfony\Component\Translation\Loader\IniFileLoader - Symfony\Component\Translation\Dumper\PhpFileDumper - Symfony\Component\Translation\Dumper\XliffFileDumper - Symfony\Component\Translation\Dumper\PoFileDumper - Symfony\Component\Translation\Dumper\MoFileDumper - Symfony\Component\Translation\Dumper\YamlFileDumper - Symfony\Component\Translation\Dumper\QtFileDumper - Symfony\Component\Translation\Dumper\CsvFileDumper - Symfony\Component\Translation\Dumper\IniFileDumper - Symfony\Component\Translation\Dumper\IcuResFileDumper - Symfony\Bundle\FrameworkBundle\Translation\PhpExtractor - Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader - Symfony\Component\Translation\Extractor\ChainExtractor - Symfony\Component\Translation\Writer\TranslationWriter - - - - - - - - - %kernel.cache_dir%/translations - %kernel.debug% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml deleted file mode 100644 index 2dad8ca..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - Symfony\Component\Validator\Validator - Symfony\Component\Validator\Mapping\ClassMetadataFactory - Symfony\Component\Validator\Mapping\Cache\ApcCache - - Symfony\Component\Validator\Mapping\Loader\LoaderChain - Symfony\Component\Validator\Mapping\Loader\StaticMethodLoader - Symfony\Component\Validator\Mapping\Loader\AnnotationLoader - Symfony\Component\Validator\Mapping\Loader\XmlFilesLoader - Symfony\Component\Validator\Mapping\Loader\YamlFilesLoader - Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory - - - - - - - - - - - - - - - %validator.mapping.cache.prefix% - - - - - - - - - - - - - - - - - - - - - - - %validator.mapping.loader.xml_files_loader.mapping_files% - - - - %validator.mapping.loader.yaml_files_loader.mapping_files% - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/web.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/web.xml deleted file mode 100644 index d34ecdf..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/web.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver - Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser - Symfony\Component\HttpKernel\EventListener\ResponseListener - Symfony\Component\HttpKernel\EventListener\StreamedResponseListener - Symfony\Component\HttpKernel\EventListener\LocaleListener - - - - - - - - - - - - - - - - - - %kernel.charset% - - - - - - - - - %kernel.default_locale% - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/css/exception.css b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/css/exception.css deleted file mode 100644 index 22c9387..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/css/exception.css +++ /dev/null @@ -1,232 +0,0 @@ -/* -Copyright (c) 2010, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.com/yui/license.html -version: 3.1.2 -build: 56 -*/ -.sf-exceptionreset html{color:#000;background:#FFF;}.sf-exceptionreset body,.sf-exceptionreset div,.sf-exceptionreset dl,.sf-exceptionreset dt,.sf-exceptionreset dd,.sf-exceptionreset ul,.sf-exceptionreset ol,.sf-exceptionreset li,.sf-exceptionreset h1,.sf-exceptionreset h2,.sf-exceptionreset h3,.sf-exceptionreset h4,.sf-exceptionreset h5,.sf-exceptionreset h6,.sf-exceptionreset pre,.sf-exceptionreset code,.sf-exceptionreset form,.sf-exceptionreset fieldset,.sf-exceptionreset legend,.sf-exceptionreset input,.sf-exceptionreset textarea,.sf-exceptionreset p,.sf-exceptionreset blockquote,.sf-exceptionreset th,.sf-exceptionreset td{margin:0;padding:0;}.sf-exceptionreset table{border-collapse:collapse;border-spacing:0;}.sf-exceptionreset fieldset,.sf-exceptionreset img{border:0;}.sf-exceptionreset address,.sf-exceptionreset caption,.sf-exceptionreset cite,.sf-exceptionreset code,.sf-exceptionreset dfn,.sf-exceptionreset em,.sf-exceptionreset strong,.sf-exceptionreset th,.sf-exceptionreset var{font-style:normal;font-weight:normal;}.sf-exceptionreset li{list-style:none;}.sf-exceptionreset caption,.sf-exceptionreset th{text-align:left;}.sf-exceptionreset h1,.sf-exceptionreset h2,.sf-exceptionreset h3,.sf-exceptionreset h4,.sf-exceptionreset h5,.sf-exceptionreset h6{font-size:100%;font-weight:normal;}.sf-exceptionreset q:before,.sf-exceptionreset q:after{content:'';}.sf-exceptionreset abbr,.sf-exceptionreset acronym{border:0;font-variant:normal;}.sf-exceptionreset sup{vertical-align:text-top;}.sf-exceptionreset sub{vertical-align:text-bottom;}.sf-exceptionreset input,.sf-exceptionreset textarea,.sf-exceptionreset select{font-family:inherit;font-size:inherit;font-weight:inherit;}.sf-exceptionreset input,.sf-exceptionreset textarea,.sf-exceptionreset select{*font-size:100%;}.sf-exceptionreset legend{color:#000;} - -.sf-exceptionreset html, -.sf-exceptionreset body { - width: 100%; - min-height: 100%; - _height: 100%; - margin: 0; - padding: 0; -} -.sf-exceptionreset body { - font: 1em "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif; - text-align: left; - background-color: #efefef; -} - -.sf-exceptionreset abbr { - border-bottom: 1px dotted #000; - cursor: help; -} - -.sf-exceptionreset p { - font-size: 14px; - line-height: 20px; - color: #868686; - padding-bottom: 20px; -} - -.sf-exceptionreset strong { - color: #313131; - font-weight: bold; -} - -.sf-exceptionreset a { - color: #6c6159; -} -.sf-exceptionreset a img { - border: none; -} -.sf-exceptionreset a:hover { - text-decoration: underline; -} - -.sf-exceptionreset em { - font-style: italic; -} - -.sf-exceptionreset h2, -.sf-exceptionreset h3 { - font-weight: bold; -} -.sf-exceptionreset h1 { - font-family: Georgia, "Times New Roman", Times, serif; - font-size: 20px; - color: #313131; - word-break: break-all; -} - -.sf-exceptionreset li { - padding-bottom: 10px; -} - -.sf-exceptionreset .traces { - padding-bottom: 14px; -} -.sf-exceptionreset .traces li { - font-size: 12px; - color: #868686; - padding: 5px 4px; - list-style-type: decimal; - margin-left: 20px; - white-space: break-word; -} -.sf-exceptionreset #logs .traces li.error { - font-style: normal; - color: #AA3333; - background: #f9ecec; -} -.sf-exceptionreset #logs .traces li.warning { - font-style: normal; - background: #ffcc00; -} -/* fix for Opera not liking empty
  • */ -.sf-exceptionreset .traces li:after { - content: "\00A0"; -} - -.sf-exceptionreset .trace { - border: 1px solid #D3D3D3; - padding: 10px; - overflow: auto; - margin: 10px 0 20px; -} - -.sf-exceptionreset .block, -.sf-exceptionreset .block_exception { - -moz-border-radius: 16px; - -webkit-border-radius: 16px; - border-radius: 16px; - margin-bottom: 20px; -} -.sf-exceptionreset .block { - background-color: #FFFFFF; - border: 1px solid #dfdfdf; - padding: 40px 50px; -} -.sf-exceptionreset .block_exception { - background-color: #f6f6f6; - border: 1px solid #dfdfdf; - padding: 30px 28px; -} -.sf-exceptionreset .block_exception div { - color: #313131; - font-size: 10px; -} - -.sf-exceptionreset .block_exception_detected .illustration_exception, -.sf-exceptionreset .block_exception_detected .text_exception { - float: left; -} -.sf-exceptionreset .block_exception_detected .illustration_exception { - width: 152px; -} -.sf-exceptionreset .block_exception_detected .text_exception { - width: 670px; - padding: 30px 44px 24px 46px; - position: relative; -} - -.sf-exceptionreset .text_exception .open_quote, -.sf-exceptionreset .text_exception .close_quote { - position: absolute; -} -.sf-exceptionreset .open_quote { - top: 0; - left: 0; -} -.sf-exceptionreset .close_quote { - bottom: 0; - right: 50px; -} - -.sf-exceptionreset .block_exception p { - font-family: Arial, Helvetica, sans-serif; -} -.sf-exceptionreset .block_exception p a, -.sf-exceptionreset .block_exception p a:hover { - color: #565656; -} - -.sf-exceptionreset h2 { - font-size: 16px; - font-family: Arial, Helvetica, sans-serif; - padding-bottom: 16px; -} - -.sf-exceptionreset li a { - background: none; - color: #868686; - text-decoration: none; -} - -.sf-exceptionreset li a:hover { - background: none; - color: #313131; - text-decoration: underline; -} - -.sf-exceptionreset .logs h2 { - float: left; - width: 654px; -} - -.sf-exceptionreset .error_count { - float: right; - width: 170px; - text-align: right; -} - -.sf-exceptionreset .error_count span { - display: inline-block; - background-color: #aacd4e; - -moz-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; - padding: 4px; - color: white; - margin-right: 2px; - font-size: 11px; - font-weight: bold; -} - -.sf-exceptionreset .toggle { - vertical-align: middle; -} - -.sf-exceptionreset .linked ul, -.sf-exceptionreset .linked li { - display: inline; -} - -.sf-exceptionreset #output_content { - color: #000; - font-size: 12px; -} - -.sf-exceptionreset ol { - padding: 10px 0; -} -.sf-exceptionreset ol li { - list-style: decimal; - margin-left: 20px; - padding: 2px; - padding-bottom: 20px; -} -.sf-exceptionreset ol ol li { - list-style-position: inside; - margin-left: 0; - white-space: nowrap; - font-size: 12px; - padding-bottom: 0; -} -.sf-exceptionreset li .selected { - background-color: #ffd; -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/css/exception_layout.css b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/css/exception_layout.css deleted file mode 100644 index da4fc19..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/css/exception_layout.css +++ /dev/null @@ -1,136 +0,0 @@ -html { - background: #eee; -} - -body { - font: 11px Verdana, Arial, sans-serif; - color: #333; -} - -.sf-exceptionreset, .sf-exceptionreset .block, .sf-exceptionreset #message { - margin: auto; -} - -img { - border: 0; -} - -.clear { - clear: both; - height: 0; - font-size: 0; - line-height: 0; -} - -.clear_fix:after { - content: "\0020"; - display: block; - height: 0; - clear: both; - visibility: hidden; -} -.clear_fix { - display: inline-block; -} -* html .clear_fix { - height: 1%; -} -.clear_fix { - display: block; -} - -.header { - padding: 30px 30px 20px 30px; -} - -.header_logo { - float: left; -} - -.search { - float: right; - padding-top: 20px; -} - -.search label { - line-height: 28px; - vertical-align: middle; -} - -.search input { - width: 188px; - margin-right: 10px; - font-size: 12px; - border: 1px solid #dadada; - background: #FFFFFF url(../images/input_bg.gif) repeat-x left top; - padding: 5px 6px; - color: #565656; -} - -.search input[type="search"] { - -webkit-appearance: textfield; -} - -.search button { - -webkit-appearance: button-bevel; - float: none; - padding: 0; - margin: 0; - overflow: visible; - width: auto; - text-decoration: none; - cursor: pointer; - white-space: nowrap; - display: inline-block; - text-align: center; - vertical-align: middle; - border: 0; - background: none; -} - -.search button:-moz-focus-inner { - padding: 0; - border: none; -} - -.search button:hover { - text-decoration: none; -} - -.search button span span, -.search button span span span { - position: static; -} - -.search button span { - position: relative; - text-decoration: none; - display: block; - height: 28px; - float: left; - padding: 0 0 0 8px; - background: transparent url(../images/border_l.png) no-repeat top left; -} - -.search button span span { - padding: 0 8px 0 0; - background: transparent url(../images/border_r.png) right top no-repeat; -} - -.search button span span span { - padding: 0 7px; - font: bold 11px Arial, Helvetica, sans-serif; - color: #6b6b6b; - line-height: 28px; - background: transparent url(../images/btn_bg.png) repeat-x top left; -} - -#content { - width: 970px; - margin: 0 auto; -} - -pre { - white-space: normal; - font-family: Arial, Helvetica, sans-serif; -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/blue_picto_less.gif b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/blue_picto_less.gif deleted file mode 100644 index dc70f6a66cd468f06725b27bd35fbf2a1f121be7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 197 zcmZ?wbhEHb6k-r!I3mPw{q6UbW6w9<{*bcc;hV3&61F|)KK1hP$De6C9$tO(J%8`x z^qr4-PruCF^SJ-a%bV|h{QvhaZtH{p|Nk=(2NZv@FfstG(g7(4+3CRQv_OT?M|kdw zl@<*%+*nl3AJ^v0@8i0(;J={!hv^c}x{jq7EpTDY^Of5yIWuVe{u@4FhxfJkvMjiu Qv&D_=NPc2PhZBP}02D({KmY&$ diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/blue_picto_more.gif b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/blue_picto_more.gif deleted file mode 100644 index 098e388616bf08387e170f294569efa3fabd7d8b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 213 zcmZ?wbhEHb6k-r!I3mn&{q6Vr?|-E2c)0QQhn8c{Q+7PO`sVwaufHCD{Mmi#Wx}=x z`FkJtpLve^YX(Xwd!)Vlq3luGa$EH1=Dff- k*{|A?#)-y}Z?pVFiw`FHF$7EyT^s1Mu31G+Ns+-C0Ksxq{{R30 diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/border_l.png b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/border_l.png deleted file mode 100644 index df27713055121a905d1105f17c4e4c9ca48b9798..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 249 zcmVNK0>rvd3;C00000NkvXXu0mjfS~+5n diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/border_r.png b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/border_r.png deleted file mode 100644 index fdd6dc6699d7418a90f22f706045fb40beb49cad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 253 zcmVSk!+zrx!6>i2 ztY;=K!`pA2RRv{r!*zXL%pXT()lp(xgbN3a-0R9amHu`3X5BqX00000NkvXXu0mjf D?AT_F diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/btn_bg.png b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/btn_bg.png deleted file mode 100644 index 303c12952684a30aa8d0903d42c3cddf6dbfaa17..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 87 zcmeAS@N?(olHy`uVBq!ia0vp^j6f{I!2%??LS)^6l$@uFV+hCf_3mj l3wbl4$&Bg~CC(=dOPoJGVbN2P?*PlOse(~bP+qZ8&e*Ad;-1*0kA78$7 z`R?7jH?H5fdiCmq`wvc?JoW9{HwIFG;!hSv1_l8J9grrFoer!s7by2VVVIlYu{yapvAW>KdDo%y|1sa$EVOTxm1J6*MUJ_ xZKi;(9(M?re%-=(dK?1GoaxoUY^)5kSE!pYxz^-q@G-J2)Z}B1c2H!n1^}rAZQB3< diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/exception_detected.gif b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/exception_detected.gif deleted file mode 100644 index fc412874d6f88ff0c5793f1087986984fd08c9de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3996 zcmV;N4`c90Nk%w1VQ>I^0Qdg@<>lq!>&m~`dO<-!!otGP;iB2+wyn=ptgNhpf`ZJ< z%-ra`($dmhU0t!Uv5t<8$H&LF)oEyGXuiI_>FMc!fPkQ&pq`$djEs!6wYAdYrseI? zw9;hC-j+;EOnZBKoSd9sU|`D1%8H7Lq@<+0yu9At-rU^WW@ctsSXkHB*O!-<&(F_w zb#+8UL|a>1hK7cknwq-0x>Z$Gl9G~reSL0jZfa_3@9*!ZsHljDh@zsRn3$N5kdSb2 zaBOUBgoK1qQBi(=epXgiMn*hsg{_3+>9yx8cj^78V<-G;K#U-S6p z`uz3v`Re!j?!w!Ev(jO-(_^vGUB%mp+vvOa`|$Mi^t#q^@$>50+1b(LpY8GD-0HTq z(`Limg2>&G&*Pi)`RL&7zU%YV@b=)c(O|I9T-)2*#Kgqc=d8fme7V+b>F?T8Q&YCn zXvf}))#R<%=Cj%9u+A0FEg&sewAZ0G0a z(b3V<<)hy0y2jj#xYcXy^w+DatJLPDlgz@bldxSu^7QQR@bK~R@#^s0(9qD}>cw+&bG+Af^!4)b_u}&O?#|+w&*7iQ-H+$) z)VF?Ou+S=FUu(Q%)vC&??*?rUFsoLkcKR-YJ z|NpAZPWJZpA^8LW00930EC2ui0B`_&06+-;0RIUbNU)&6g9j&ROQrA9C30~hMl^Ow zOsZGftRdXUv7^V29AC-tN3x{JlPFWFT*>m$GmtQ0t{Ta*rp=o;ZEhnI6C@c^Ho?@X zW+!LLC796g$rZ()s(w(Rnpx7%$&x?)dPS(hsb3l{{rvcQ;-p`enjLx~^knmm)GmjX zr19!6R=+U*=J0{4$6ppqQ{V*hCm^fQ!!~!REtn0lW0q(A^g}a+j~Z3}qL_*5gw2*Q z{RX{>&@Yoe(1L0%SZt6PO_g2xO(D5Nijyd6!j4Kb$KQcQ{RlzDoMkgqLTCLU;xhO# z&UUOprgBcby2(zYqH8xu%A0lT2RcCi+D^W_M|La^^fAxAeR)RlN*)+b@Q8&0{POGH z&%giv5bhk|-he$Jaf5!xB(c#ENj#vRGe~TNgc4=wM}U9@wK73B7!vrABlzv7MTq(V zkbr*}$g^JzE%?We7Tx@yUl}9>;hz;rDByvM`B~s$Oh^FIB9Hz}fCL3v5XsL63`(FR ze;%-qM2A0?hs23bW|^fGR8~nKgAni-#4Sn4Qi_W$G%+CzJlc>%gkEmo%@W_?}^of8U46HMJQ9~v4j`>RIx=K{n#PNWKa0R zOK6Am$ksGP zKYD=mg-!90Ck9Su{Go?ib@(GlZcs^ah^m=P@dp=*%n|7sne?NHKW+4bsz0O+Led)j z2(XtQS7cF%KTCvB6{r2M;g2r;=)%%!?M<8P!Z*F5CqeY=%dnrxF!OME+$;mspW@i# z%Ech7wTw!SfOG@^6VM<*F)rwrLNOoY08f`8*R0HrJu;!hn@J?m1Tt*$7X&mq^Q=S@ zpQNB)3^dmaBmw$)aD;$Jtgv4K5du=gel|Gr4-z3*IJF5C>UY7^R`AyfK}jf`9}o&U zJ)K_Z%={J#F{&PeI`XK-X0}c=!x7-NvodlLV&hQC_fJ|V44msc= z(8*yd83__oGrnEbPulS02w67M^pDSIAi$q;B*RFaqHD*>G!x^rhZywLUeG!bpA_(9>O!+$s~Fzoc#0A3`h+=&!e>LyCorl2uXrWkw+MmY%wpdr_{6vd&blhn-^&$ zLXslMf#C<80)VE5KUDDA&mq_JV+b2~NY@|O(2s2S;}p7hLT>DUhJKWTB>6MLDEh$( zl5C%mH7OD1y^<9h5pDzKmIV6erzH+dQd|z zx=@l>=+9K#ATQ02opELKH@UsYb8?ELfnz8GPuELUgJc1@y;U(m;|Y zNTDAGSVC`D;)(K*L1HVJ!y#2s2|@H@3{P-_y9^;4f6$>Hq2QMn8j%Q7RY4MpAc$#wENFk#MeL z3FmO9J0H3K5@YD|p93+6Hcf(#jWi<$IQttvq@jY<0kkIp=m1XyX94~c0RuXC!IQMm z0t|d3q5Mbz037Kn|4fjr=eGPJP=?50F4O{tVRz z`xyW(!nz-4e1Zu4v4RO&wt^&}jvo?GLRCWsx^%Pv1qlFwllWl)2!umtkW;8)`C)~+ zDS-)tP11fO;Jc}zG-@Akn~Q9qfW-1h0jgTP zg9$8U5EDe80~9m>1s|Bl&h`p2W<;X^>agNrOtA=5aAUpNfrL41kvny~VxkyE$T+sK z%_Ur-oFQh07zQfNlE@(y5AB2VTD+1d7{Hw4cnytj@(9}1j1fD2j3-`lu>jC1$j+&R zk3B?0m%u#Sd8%UxmODIB@R^q!O3B0w3N$l4W7SA8#1M3E5r%M} z!UeEMVl1-=vp*DJ>XVoY(AyLM%Ab6gGkjqSV2}b8Y+{S;9GT}i`2{HV%m^!s z@>7awk|$UK4qd<{VL+1yrbi**HaWR=wtW~jG@>Xe(S)K>qKGSW*&kf##~ol9l{NSS zD~6CvKe&)TG|=hmQt-zbys*NRq*>LSI7|vDL6QToVG6$pURQYa2YCi?M( zQ0>|7{y4<^4p{{!aH1)vIH5mcgO^X;fhFf7PoZr>g|Zmp3dgqgAgtYwQ-u2(B(cL4 z_S}mUVu4N#4D%B}!v!`7XDgVB$|00voI(i9Hv$NiN}`bJvDXCC&mzhHA-CWJDU8Ai zYoJrNH}QnRK z2r&r-zyY~44XKc2QWz7iumA;+3>@Yh#t?&BSS5>46Bq6H6N0^EgRtPpi3p%^U%4bin&E&u|6Fozreu?hu{cm+@&F>qZj zk^;jJh-G*LC9oepa0^ht1WW)0kVC1Q2j0{J;a6_#;Sw0Q&)mUn7tDkq!}Z1jFzFSychI zP+b_HAF{AHA`mtnZ~;Gc1ZDFgN(CY=qh2ASj%6SL(0~Ns5F!u2Qb=G^`9TEAuv7iP z0!M%gFa(nmfQ%F{0Us~}&fr=6a17y) zT`r&uw8$SRU;+-nAH@Iw&Zr-efF$_=1N_Jj6Tkon@BlCniy@N)=QUf8<03O40Yp#+ z4KQB)aRXsv1Wy@P6QT?|Fas_U1Wv;sO)!e1Xd}4cGXYItk3`}Evd{z-pimwl z3p6P@0tNv>AeUJ}0uka1rFjDXfCD#Knl?ZJ&7fE7MK`*5mq5uM3VjDT_z|nqu-K zqQxVb7@l8q3{PU4N}>YZDVEV_j7OjZTf-v{&;(Y)BN?CsBuOMjLZ8*81ip}6`SAju zpjSzdH2q-%fG{O*QUm@W0V~y+4@Fa>2nC@iT)0R#J~N_BAY2{7S|eJbZxRy$0RTJJ C!j+l; diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/exception_detected.png b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/exception_detected.png deleted file mode 100644 index c56c3d2ae3dc77c511c8f123335a3b73b604f01d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3637 zcmV-54$AR~P)c!CEqQKdIu+Utp%}%z{ zXvN!!)#R<@?9S@&+|uKwzu9`P&|1UWh1=-6@bl>L^Xk;(tGCo__4f4T?a{>Bhpf(0 z&ET8k?99E_c&o=?^3LF$%ixo-(OufBVW60l({QddT<)PK)sO|LH=<(0R-G=G! z+Og4I-Rro!*KxDbVY1R+_WJDd_vGB_wy@D!>GILX-iqSx!{_nMuh3Zi{`>X$>hSj9 z!P|cL`|!ZpeAnl!=J3n$_u{_Uc+caT>hsgn<)hi@u>Su2*yyh8^w+%DbJpjo-|W1r z&QQwUmc!hFw$x|t_1x?8)y(0Qz1ViT)^GRv?!?@L!rOqZ&sfmoo%#Fo&f=NI-H7!0 z=-%wQ$={E;)@}Oy_51zz@Alr~@5RdCk>TyZ&El8QF7?Y_p`i`wV8 z&*7iD)^yb7rM}pC$lZ^@+JWKf$La6b?(*cb(qiA~!|(FuzuA4X(q#7b_T}Z}zP`Sa zl9Fg>Xk=t$L_|bCKR;MlSbKYWsHmva)YS6w^0l?KW@cteN=lB7j^5th@bK`Onwm^Z zOmlN{*Vot3(9m03Tb!JnprD{ZK|x?(VBz86gwwG`T6(v_x1JlhK7bwQBm95+lq>cYHDiC z%*;qgNa^Y6?Ck86l$4~Tq=JHi#Kgqf+S>8)@v^eA!otGq>+8Y6!SwX>$H&K0Q&X6j zn4X@VPEJm&tgNrEuYiDn?d|Q#%F36Qmu_xu*x1;FgoMw}&(YD*($dn9kdX89^Ho(< z;^N}5v9WAyY@(u~R#sN4tE+x~etms?+}zyn@9(<0y12NwP|ZzQ00001bW%=J06^y0 zW&i*R<4Ht8RCwC$nSERpWfsTBTvOaKkG+Aen|0e>REoeh;FKU>3kre>h)Vc!5xEIM zND!KUfthXDo7?V=iaub7_);p68Kqnu^p3Assacj~mSvl!xx3a@d!F%r?tPHGICGi! zYrlWMJTvh8o^$4$=bV|5bkOCBuD|Kl?aJ<)9^HJp_PpY^(yzr;SNFQ6H?*bCwbxy5 zzS<2p`a(PS_3igN6V>|v{wBCQ*Yq4=H z;~yO2IdCr5fei4%p`m!c_fCBPj4%{9Vd2BTMPNi^)NrvvKG=T5{0R&YjWNI(F#=#@ zbZp$Hcz^^XMvJ>@yMkT82oK?y=*YN;#H2WgPex*FVhWBMKLL})irilM59k8|DX9;q zdFUi2MopUR4^xmc#)4K$I!+D97>m<_F%xW7OawQNw718Az%WD%6GWzG0Su3_W(R|1 z5)yIo6LCgP?xO&CICKV%2bhTo`IrijjACtjter~L1Kbo~_%sTNkVG;y(*nMQm<>6| z$$uR4io#}LdJ&&}^lV!;rbXcsK$pkN!La}{Fa-qe@$6AQA=-+O2b+IMDL^Vt4=KUY zFiSBGn~SmWbMZ+4UyRH^x>$-C_hVQA7Dj|7VOSy-0+i8pU14)GxXHzmoC(q8mT=67 zkHxfk7-fT}aDG09$3QAy%Xlme47Y}bS*;^Oah~mdBr&z=OuZOt|drvWh@ zOG4u?)IS-mk-1rUNDO@fAM#Bt2n5fh+!QKq0Xrfkzg3!VbL#mAC){+I-M^6&*PMj~WlRP?0mDd0Z_5v@h>g*bmEH?I&! z>M0l3K^uz3xoYqNSF02f!D0-T#3K4Gz%m=8kadusX-UEi>sWsnP1`&aU>wZD2q9*4cip+^}<8pyF?UJRB( z8O|?596bsj2S|%a!KvjKX@My2Y+E4)7ZqbbMmQ4rFoJ?7xrlt?YjZc|gWKuag1}8y z5>5#kiG{WjjLE}j7={zT5@hZ&Y(-3i$0H*bTA)4JZN0DZ6Wg|ET5yupKN~aW z45jEChsB6fAd%->aU#Ho;Nft2UX&!ACT3vxlQCr&3Asr~jE9UkOd7?l2}p@a1f2}L z<1&w@Bh z9lZP)n8l#M`rgwF1ala&NYY1Flk_O%J5%v5MqYp4)p4)(=^`276@Ta$H~m#I#>+v_ z5&B+b{Bz8e;5GjJByZ^FZ9?AW?bnh;&v<3tjRPdFdGHo6NZ=#=JNPl^MKFNHhk~=C zT=6&E&h+UbnL?Ldf7kQa+11Riv)A9(e${&Zfkl$pEV`#xUk_hOdzh^z22sCfyWP^g zyO^SuSEOH`Yr)NpQYUb$ka>eUL-1t}v3c?}=P4&te){0fNt4-7Vy|eLo$#rJU+I6fguf1-Tc?I_Fw?2;@(JHlWT(9H zDkG{iy^D&qG=ASaLHQufcgW$IP<1rWiNkyW&J}z><8?<&6I8hiKUCZcP`E`$RLQ-9 z19aje=K_u{`Pe&SKUuo;9a)>9o=>L=E2yK4aLB?6c;wcq+VQbZ8T-r|MfosIvi}o0 zXknKM9;bV%NNzO2{n}sb`kW3wRlRZK2}Z1zod;j2lDw&k)qlB_E^Ve0Cuu2PHL!KZ z`I@*(S1FobxH~EpZv;Q$ksy=c*Nix%O4V;N;?yUS+MwMsc{SHz$7T5&#yP4P%aigS z1_k9~2P)R9@6lRo6%wpv#EzZhV~ua+(^^`nGF{-7sbn!{ll;a*qtfUQ<9w&CWCXvPTeOYsG+od*vUdmLe6xBv`&!w@ScSu&;8|^geUyIhE~z?q z#5wPW-`8v9Z|72HiCBG}ah5G^U>e)rUB%e$D#n(aIZ?aY$mU8np0n!Wuf-&&vH5*Q ztZj7FijV(EKMx$-;~amZvQ^;es0HDs~*$F18u_8`$UEJg1=Q*!iz> z%*h@j_fY<#vF6am3R>o|@9ho})B_2s4toVzu8k^;M5)qjr%FezI^66~6y1WdEGz$J z>;m5k8;=^w3sqIrT|DW|%Cf3oP?C8hpJ+OBe!bmr?#o*lvEjrT{eo)C4~*F8aFAnU z!-Dd1##vWY$y}UjX|3LJRJi!#250`LvML+aqZ_%IwP8u~330gmWb>EoQr4YRy)1*( zjco;0N^Un*vQp7T?_0r}22Hdd`+?F*3Uf9BnXo8#wSZ*FSlt(Mn{D(?dAVw|+lY==K*ob4@={JrSly%d{Vu0v27 zDx%=Iy)jXiO{|lNgSkFX0FiWu2p1MaIR5FoGW(j`H1Wt*AeN1GHS%M!jfeYf`bukgoDP{?7 zV{Q(d6`H6TyVz|VQY3Sb9d9xhwatQqS2|9&DqUs?D#zR*vsF3ia${q&>TsKQN>L?~ zP#qVX@xNiOLsj-xIu)uFSy6v<>Q(SZa+8qN=562AG}JVn-{qio#c}rhYc{>4rT zRHVOpt7dym)h`Zipm~Z^iJO}2ytvYUx>juYH z0D^Y*AYBhfdtYY{Z|hju|4aK!Hk+|Em85|8xE4{xAAL-`mID zH_!AxD^!6aQ2l(X{{j%F{b%_vkq2~9io<_Sr~((D`c5-Am*GEu3{XLy<9{BgKoZc3 z2-p8yFh8x7asq1Uvii>rRWRQQ250VyAfim;BEHvs2)+P7g{zfnbt3LIKNvq5tYvY!UK&bj(3Q7V-u^$a7^EJg@9f#LU;{Kr(Tt1(0s@wR46q?b^YiD=S2#O6 z{{R`_fK34qoCo6lAR34K99LIYyap72%!rOqjVej6(%^<@- z2B>`d_N}q2tLv_>ukTkRv!lS0swdLLTpmpZCd~U002ovPDHLkV1jKGbGrZl diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/input_bg.gif b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/input_bg.gif deleted file mode 100644 index 7c0efc1087c3cedd2a95deaef7322d4770170ff3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 63 zcmZ?wbhEHbWMp7vSj52a_3PL7@8AFZ`}fzcU$0)hVt@g~pDbXe4u}M)WngCUU{vO0 Gum%7TE)u5z diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/logo_symfony.gif b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/logo_symfony.gif deleted file mode 100644 index 703cf45fc78e6d31d4a9af460252b536b1c9854e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1698 zcmV;T23`3_Nk%w1VYUE10K^&q%gfAUVr4x$Kl1YON=QuQ<>lDe*q4@=v9Pj!eSesj znO9X=ad2|Jy}yf!jHIKbv9Yp#e1F*3*>P`jS5;V~q@}*Tzl({C|Ns9mE;9fB{{R30 z000000000000000A^8LW000^QEC2ui0JZ==06+!*peBxFX^z0-1i_MJ3+p_pEh_&5dM^QH^o`2q?YC;|Y#eo6?SBFL~IkO9*W zUWrg(6a+6t1e9~gkzoUD0u)q?cL8IkHxMNMW_YDz4U&xn4G;-%fMrJwrreB*aD?3_ z1wa){Fo|t|jsdNTB$!ozNI7K6ROJ$p6pPVgF9`4wMB>|mt0D|wjG70m21m-KH6S4q zhKOfKG;JyM!j7010!F!0IkQPpts|OdaKxZQty_Z;XW06P@mIDOfgM&{!i#`0fD`e3 zQEdyS&0Nj2C9?Kr8lnz-R4p>0a~KE_K`S#&yS5Dk42ZH}fWWNn-@r{EpxZBi&EUv6 z8aN0#2?2n~qoYCA9N}^4*n51eZlv`Vo}$7KN0+^P4l3M z2>3zos9Q+@lo%19fEJ&v_eMl=Ver}i6~3L26fm|Wb=^(lB>@IXO1OprcmzanA$V+L zb^~<*z@))9>6GxyTD2hYPk$N-mINXQ^p_PtcqCwBVHzYQp9trqhK*03$jI3zp=`EL z4gk;<4l+DyFhEu)P)UL+z8NDzFH^jr%?TK>h?fa6iXfN(BusNv6&G%ik!z~7xy6*t zIl-j}Y9eFPWF!!y%L|M_g5H-VU{nL2eF8edifzfKN)iT20F<12yZv3FsjK z;Rr5efTm$DL^*<=i7qz6og;{q#A5}anraE7fn!1!py{+pbtXdbOp509;L?wY*qD(5 z06@@Q5uSu`O>_G}VTmEZ{vb*JgE&xUL1w2rpe-Fev@4h-90G~<(Y|8JzQl6785e#5UFuM(io2~!?FPxpW2UiiX#KE~* z@e34008|A3Hij{FaHUIu9SUF;&k<9N3>-uiQxHZ4U%WA%01CV85UvN?MKf#F{QQ#6 zwS{a20W27sMHohcl(Pv9{JSJU??&s;yP0%mi5&wxi^V4(W-tK+3tD074XPv%P67Jn zgWlPu)oR5^7&M*1$rz+WHy1@*`e+rU;lOHbgVTm}65KMKgaFOHA#`1H_0h5o&rIGb zE)5zmMj3GkP)KY67-azeT>((?w-JLB@U8#{nAQ0qC1>EkRbD)Is|#A0lK2~y79sN} zNG@y24sdXt_r~;iTHpx_=E*BaSP{$|$EWviZgdX{vBSluA zfC7ZqxHo|4cW)@0O6rG$hWUwSS3w4Z5G8{2&1zKz6h<&!@COo>P*Ep(L223&B{pG- z2y^&^Ds~qJqs^mjH~7XN@K6{!CC`PjdZDVeRKRC^iZLxrq7p~2JUof2D@uqT9E_kv z39)c17fSdz2oVk(|*9gP26mT@rLI(4sh?6#MCjsXOoCcz2gl2{9QVN>M zDBh=%)a0N50dPS1QV22^6&KcVi9jlXAybu*3hZqF zu;Jn-Qqr8K6@)kfNWj!GMXb&_vW`!zqp1P`D-sM~lX-ZeEsNm?6HFs{LTHX2-e5P0 zkjo5$5s}2!XM@Adqk=r!%(|SQh-ZjzVV3BW)ka{=J|u_>4l{-2o)9YhVN4aQ+W{Xl zVi%ZY#c|acCDCl7u_MR{1AEbx1k!1WaqiPJ^IWEzLb9vsZ1bQIlEVaoGL-Z@6r#YP s-o}b>F^nP~2bk%~rANzE00$7X3b6#@NZAEF2Ha}_46x5i%M$_sJDrx#NB{r; diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/logo_symfony.png b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/logo_symfony.png deleted file mode 100644 index 1ce063dbd18de9998794b299f9f752f212dddc8a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1459 zcmV;k1x)&hP)K0000{P)t-s|NsBX z%gm&srHhJ;WMXAkRar1DGUesvv9PjANKEqb@^Nr-*x1;KUY;)etdtJmzn?n z|FN;M*x1=|Z*ruhrI(hNetmz7iHyF!zsO|%wEzGB0d!JMQvg8b*k%9#1rSL@K~#9! z)tcLuqaYAPEkzJS63qoW|No(56(U~3kYut}Gv^_(NoY6ap$h0OVuG?_tmeFCtSX`S zA0$e~cVeZ;9J*orsaTUUwB%9AT*0B{f0fM9<*MRIwJJAiUGoh^yqAqMC$2%$E|kbx5e8UKU?5vzLh{HFQxH9KM%@JP2d}K#Y*fgQ-9to7&7QQ ztl-RbxDLL7?DF6n+4lf6fHRPwi(@ZPE(7WA^EcZ$YPYaqt7pj6 zd@1=@05=*W=hUnjUFfOR3(5=Xlc4BNz^{EU=m!1t}> ze#y>!5NpoMWi%ZE`Ww}Lk!*xmd9!HDdbf%_MiZv~xRi;C^QtKLKH8+8uo?+^ocLZl zn@$>q_g?LSGw~6`1m1ylTpb`}Rdm+Msf)E8%`wveSmO$U^X1fl5vPyMQf9;f`%HjK zTz>{qKk4Sj9!(``ARsY0aANUO6A(++S_>CsN9Za=^?3s(a&;D0NTal0D_oH zHGk0cl}EIngFpc{o%2RHdqg`3?UQ>mKLsAJDcBIqrotDCjzBHJlSj$}HpQ1DR)csX zun*vxZr(aN>1d_u;B@v5HU(7p^4H?^7Mp#5y-bp7w$3*9 zDOY4r5b}zQKt~o$HIV?uMY(66#%>eXJ|#(fIbaWNK}y)JiN+FDyk0vOHW-`(cG}x; z#HIqEefq8!ga@*Q{BeI_Mw-}eNf+*Uww$Y%uyt5-H}rdt*xiI&`E^hmyuG;iIy=Mo z+7lCtEEnXQ0T>!3jZN?Cyls!z^c0Nb@~|bl%vGlM*@O8M9#gf(6|8CiN{Ll1Jjm`v zY++ncvUX!c)ITaJ?CB$7>8pH1sq-{}bMuR$#b5e#=bWhQsU3Rz<%7bKJQosHL{#M?qe`Bp z32481PN=|ck5i&9P>Enea%bHYUz73KFBR@vBG@dovo>F(2HItApXVCQ^l&*X9*L)s zM3SH__csLqDt>rL%ReQ39=Y>Gh5S|3yUoqdTx+gzYN>MiLm7DNGg6y`MSfe&=D-0A zKPh^Psw}dQT~|hKdY}5DDLWI5;hdOskqPR|xXmq`<>XIIJ_*X6I;b%@{+mErqE18C zy2wv96>wW*DK-Ap)uPB%qKZV^Aau@Z+9P?}s3L!XZP_vlTML=t{Q>1VgP8{u0!9D; N002ovPDHLkV1gV()aL*I diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/open_quote.gif b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/images/open_quote.gif deleted file mode 100644 index 0e116ceadd25fcab384427f1e9076869a3201c82..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 281 zcmZ?wbhEHblwlBKI3mDs>(=dOPoJGVbN2P?*PlOse(~bP+qZ8&e*Ad;-1*0kA78$7 z`R?7jH?H5fdiCmq`wvc?JoW9{HwIFG;!hSv1_l8J9grrFoer$i6jb^I3@sQ}u5x>z z<3DHJD*^ihx9-&3S<@Hi&+>qift8t8=!L0J^V|#UbM7sblock($form, 'widget_attributes') ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/checkbox_widget.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/checkbox_widget.html.php deleted file mode 100644 index d3cf747..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/checkbox_widget.html.php +++ /dev/null @@ -1,5 +0,0 @@ -block($form, 'widget_attributes') ?> - value="escape($value) ?>" - checked="checked" -/> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_options.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_options.html.php deleted file mode 100644 index 211ae73..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_options.html.php +++ /dev/null @@ -1 +0,0 @@ -block($form, 'choice_widget_options') ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget.html.php deleted file mode 100644 index 13593a9..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget.html.php +++ /dev/null @@ -1,5 +0,0 @@ - -block($form, 'choice_widget_expanded') ?> - -block($form, 'choice_widget_collapsed') ?> - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_collapsed.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_collapsed.html.php deleted file mode 100644 index 251d418..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_collapsed.html.php +++ /dev/null @@ -1,13 +0,0 @@ - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_expanded.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_expanded.html.php deleted file mode 100644 index 64ae7db..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_expanded.html.php +++ /dev/null @@ -1,6 +0,0 @@ -
    block($form, 'widget_container_attributes') ?>> - - widget($child) ?> - label($child) ?> - -
    diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_options.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_options.html.php deleted file mode 100644 index a7a9311..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_options.html.php +++ /dev/null @@ -1,11 +0,0 @@ - - - $choice): ?> - - - block($form, 'choice_widget_options', array('choices' => $choice)) ?> - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/collection_widget.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/collection_widget.html.php deleted file mode 100644 index 9f6a94b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/collection_widget.html.php +++ /dev/null @@ -1,4 +0,0 @@ - - escape($view['form']->row($prototype)) ?> - -widget($form, array('attr' => $attr)) ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/container_attributes.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/container_attributes.html.php deleted file mode 100644 index 302bbfc..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/container_attributes.html.php +++ /dev/null @@ -1 +0,0 @@ -block($form, 'widget_container_attributes') ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/date_widget.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/date_widget.html.php deleted file mode 100644 index 22e51d2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/date_widget.html.php +++ /dev/null @@ -1,11 +0,0 @@ - - block($form, 'form_widget_simple'); ?> - -
    block($form, 'widget_container_attributes') ?>> - widget($form['year']), - $view['form']->widget($form['month']), - $view['form']->widget($form['day']), - ), $date_pattern) ?> -
    - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/datetime_widget.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/datetime_widget.html.php deleted file mode 100644 index aef2a32..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/datetime_widget.html.php +++ /dev/null @@ -1,7 +0,0 @@ - - block($form, 'form_widget_simple'); ?> - -
    block($form, 'widget_container_attributes') ?>> - widget($form['date']).' '.$view['form']->widget($form['time']) ?> -
    - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/email_widget.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/email_widget.html.php deleted file mode 100644 index 0b30c5b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/email_widget.html.php +++ /dev/null @@ -1 +0,0 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'email')) ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_enctype.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_enctype.html.php deleted file mode 100644 index 2e107a7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_enctype.html.php +++ /dev/null @@ -1 +0,0 @@ -block($form, 'form_enctype') ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_errors.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_errors.html.php deleted file mode 100644 index ffed7cf..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_errors.html.php +++ /dev/null @@ -1 +0,0 @@ -block($form, 'form_errors') ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_label.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_label.html.php deleted file mode 100644 index 0b59dfb..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_label.html.php +++ /dev/null @@ -1 +0,0 @@ -block($form, 'form_label') ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_rest.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_rest.html.php deleted file mode 100644 index ee1bc31..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_rest.html.php +++ /dev/null @@ -1 +0,0 @@ -block($form, 'form_rest') ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_row.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_row.html.php deleted file mode 100644 index 971d8ac..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_row.html.php +++ /dev/null @@ -1 +0,0 @@ -block($form, 'form_row') ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_rows.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_rows.html.php deleted file mode 100644 index d4af23d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_rows.html.php +++ /dev/null @@ -1 +0,0 @@ -block($form, 'form_rows') ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_widget.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_widget.html.php deleted file mode 100644 index 91e5ef1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/field_widget.html.php +++ /dev/null @@ -1 +0,0 @@ -block($form, 'form_widget_simple') ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_enctype.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_enctype.html.php deleted file mode 100644 index 36eba3c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_enctype.html.php +++ /dev/null @@ -1 +0,0 @@ -vars['multipart']): ?>enctype="multipart/form-data" diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_errors.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_errors.html.php deleted file mode 100644 index 339e3d0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_errors.html.php +++ /dev/null @@ -1,21 +0,0 @@ - -
      - -
    • getMessagePluralization()) { - echo $view['translator']->trans( - $error->getMessageTemplate(), - $error->getMessageParameters(), - 'validators' - ); - } else { - echo $view['translator']->transChoice( - $error->getMessageTemplate(), - $error->getMessagePluralization(), - $error->getMessageParameters(), - 'validators' - ); - }?>
    • - -
    - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_label.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_label.html.php deleted file mode 100644 index 48dd147..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_label.html.php +++ /dev/null @@ -1,4 +0,0 @@ - - -humanize($name); } ?> - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_rest.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_rest.html.php deleted file mode 100644 index 89041c6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_rest.html.php +++ /dev/null @@ -1,5 +0,0 @@ - - isRendered()): ?> - row($child) ?> - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_row.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_row.html.php deleted file mode 100644 index a4f86d0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_row.html.php +++ /dev/null @@ -1,5 +0,0 @@ -
    - label($form) ?> - errors($form) ?> - widget($form) ?> -
    diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_rows.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_rows.html.php deleted file mode 100644 index 8c3ba86..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_rows.html.php +++ /dev/null @@ -1,3 +0,0 @@ - - row($child) ?> - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_widget.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_widget.html.php deleted file mode 100644 index c5af39a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_widget.html.php +++ /dev/null @@ -1,5 +0,0 @@ - -block($form, 'form_widget_compound')?> - -block($form, 'form_widget_simple')?> - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_widget_compound.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_widget_compound.html.php deleted file mode 100644 index 45a8210..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_widget_compound.html.php +++ /dev/null @@ -1,11 +0,0 @@ -
    block($form, 'widget_container_attributes') ?>> - parent && $errors): ?> - - - errors($form) ?> - - - - block($form, 'form_rows') ?> - rest($form) ?> -
    diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_widget_simple.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_widget_simple.html.php deleted file mode 100644 index 11c2283..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_widget_simple.html.php +++ /dev/null @@ -1,5 +0,0 @@ -value="escape($value) ?>" - block($form, 'widget_attributes') ?> -/> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/hidden_row.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/hidden_row.html.php deleted file mode 100644 index 3239d8f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/hidden_row.html.php +++ /dev/null @@ -1 +0,0 @@ -widget($form) ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/hidden_widget.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/hidden_widget.html.php deleted file mode 100644 index 68eec54..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/hidden_widget.html.php +++ /dev/null @@ -1 +0,0 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : "hidden")) ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/integer_widget.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/integer_widget.html.php deleted file mode 100644 index 3775a71..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/integer_widget.html.php +++ /dev/null @@ -1 +0,0 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : "number")) ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/money_widget.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/money_widget.html.php deleted file mode 100644 index 644d284..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/money_widget.html.php +++ /dev/null @@ -1 +0,0 @@ -block($form, 'form_widget_simple'), $money_pattern) ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/number_widget.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/number_widget.html.php deleted file mode 100644 index 854952f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/number_widget.html.php +++ /dev/null @@ -1 +0,0 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : "text")) ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/password_widget.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/password_widget.html.php deleted file mode 100644 index 845fcb2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/password_widget.html.php +++ /dev/null @@ -1 +0,0 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : "password")) ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/percent_widget.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/percent_widget.html.php deleted file mode 100644 index 35b9b04..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/percent_widget.html.php +++ /dev/null @@ -1 +0,0 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : "text")) ?> % diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/radio_widget.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/radio_widget.html.php deleted file mode 100644 index ddc8c52..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/radio_widget.html.php +++ /dev/null @@ -1,5 +0,0 @@ -block($form, 'widget_attributes') ?> - value="escape($value) ?>" - checked="checked" -/> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/repeated_row.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/repeated_row.html.php deleted file mode 100644 index d4af23d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/repeated_row.html.php +++ /dev/null @@ -1 +0,0 @@ -block($form, 'form_rows') ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/search_widget.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/search_widget.html.php deleted file mode 100644 index d91267f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/search_widget.html.php +++ /dev/null @@ -1 +0,0 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : "search")) ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/textarea_widget.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/textarea_widget.html.php deleted file mode 100644 index c989ce5..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/textarea_widget.html.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/time_widget.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/time_widget.html.php deleted file mode 100644 index 591bbf7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/time_widget.html.php +++ /dev/null @@ -1,18 +0,0 @@ - - block($form, 'form_widget_simple'); ?> - -
    block($form, 'widget_container_attributes') ?>> - widget($form['hour'], array('attr' => array('size' => 1))); - echo ':'; - echo $view['form']->widget($form['minute'], array('attr' => array('size' => 1))); - - if ($with_seconds) { - echo ':'; - echo $view['form']->widget($form['second'], array('attr' => array('size' => 1))); - } - ?> -
    - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/url_widget.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/url_widget.html.php deleted file mode 100644 index c2ab28a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/url_widget.html.php +++ /dev/null @@ -1 +0,0 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : "url")) ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_attributes.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_attributes.html.php deleted file mode 100644 index 210b84c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_attributes.html.php +++ /dev/null @@ -1,10 +0,0 @@ -id="escape($id) ?>" -name="escape($full_name) ?>" -readonly="readonly" -disabled="disabled" -required="required" -maxlength="escape($max_length) ?>" -pattern="escape($pattern) ?>" - $v): ?> - escape($k), $view->escape(in_array($v, array('placeholder', 'title')) ? $view['translator']->trans($v, array(), $translation_domain) : $v)) ?> - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_container_attributes.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_container_attributes.html.php deleted file mode 100644 index 2a8e979..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_container_attributes.html.php +++ /dev/null @@ -1,2 +0,0 @@ -id="escape($id) ?>" - $v) { printf('%s="%s" ', $view->escape($k), $view->escape($v)); } ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_errors.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_errors.html.php deleted file mode 100644 index 339e3d0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_errors.html.php +++ /dev/null @@ -1,21 +0,0 @@ - -
      - -
    • getMessagePluralization()) { - echo $view['translator']->trans( - $error->getMessageTemplate(), - $error->getMessageParameters(), - 'validators' - ); - } else { - echo $view['translator']->transChoice( - $error->getMessageTemplate(), - $error->getMessagePluralization(), - $error->getMessageParameters(), - 'validators' - ); - }?>
    • - -
    - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_row.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_row.html.php deleted file mode 100644 index 7e1f2f5..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_row.html.php +++ /dev/null @@ -1,9 +0,0 @@ - - - label($form) ?> - - - errors($form) ?> - widget($form) ?> - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_widget_compound.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_widget_compound.html.php deleted file mode 100644 index a4878e5..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_widget_compound.html.php +++ /dev/null @@ -1,7 +0,0 @@ -block($form, 'widget_container_attributes') ?>> - parent): ?> - errors($form) ?> - - block($form, 'form_rows') ?> - rest($form) ?> -
    diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/hidden_row.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/hidden_row.html.php deleted file mode 100644 index 491ece3..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/hidden_row.html.php +++ /dev/null @@ -1,5 +0,0 @@ - - - widget($form) ?> - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Routing/DelegatingLoader.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Routing/DelegatingLoader.php deleted file mode 100644 index a1baa9a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Routing/DelegatingLoader.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Routing; - -use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser; -use Symfony\Component\Config\Loader\DelegatingLoader as BaseDelegatingLoader; -use Symfony\Component\Config\Loader\LoaderResolverInterface; -use Symfony\Component\HttpKernel\Log\LoggerInterface; - -/** - * DelegatingLoader delegates route loading to other loaders using a loader resolver. - * - * This implementation resolves the _controller attribute from the short notation - * to the fully-qualified form (from a:b:c to class:method). - * - * @author Fabien Potencier - */ -class DelegatingLoader extends BaseDelegatingLoader -{ - protected $parser; - protected $logger; - - /** - * Constructor. - * - * @param ControllerNameParser $parser A ControllerNameParser instance - * @param LoggerInterface $logger A LoggerInterface instance - * @param LoaderResolverInterface $resolver A LoaderResolverInterface instance - */ - public function __construct(ControllerNameParser $parser, LoggerInterface $logger = null, LoaderResolverInterface $resolver) - { - $this->parser = $parser; - $this->logger = $logger; - - parent::__construct($resolver); - } - - /** - * Loads a resource. - * - * @param mixed $resource A resource - * @param string $type The resource type - * - * @return RouteCollection A RouteCollection instance - */ - public function load($resource, $type = null) - { - $collection = parent::load($resource, $type); - - foreach ($collection->all() as $route) { - if ($controller = $route->getDefault('_controller')) { - try { - $controller = $this->parser->parse($controller); - } catch (\Exception $e) { - // unable to optimize unknown notation - } - - $route->setDefault('_controller', $controller); - } - } - - return $collection; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Routing/RedirectableUrlMatcher.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Routing/RedirectableUrlMatcher.php deleted file mode 100644 index ffbb648..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Routing/RedirectableUrlMatcher.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Routing; - -use Symfony\Component\Routing\Matcher\RedirectableUrlMatcher as BaseMatcher; - -/** - * @author Fabien Potencier - */ -class RedirectableUrlMatcher extends BaseMatcher -{ - /** - * Redirects the user to another URL. - * - * @param string $path The path info to redirect to. - * @param string $route The route that matched - * @param string $scheme The URL scheme (null to keep the current one) - * - * @return array An array of parameters - */ - public function redirect($path, $route, $scheme = null) - { - return array( - '_controller' => 'Symfony\\Bundle\\FrameworkBundle\\Controller\\RedirectController::urlRedirectAction', - 'path' => $path, - 'permanent' => true, - 'scheme' => $scheme, - 'httpPort' => $this->context->getHttpPort(), - 'httpsPort' => $this->context->getHttpsPort(), - '_route' => $route, - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php deleted file mode 100644 index 49c3dda..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php +++ /dev/null @@ -1,151 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Routing; - -use Symfony\Component\Routing\Router as BaseRouter; -use Symfony\Component\Routing\RequestContext; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\Routing\RouteCollection; -use Symfony\Component\HttpKernel\CacheWarmer\WarmableInterface; -use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; - -/** - * This Router only creates the Loader only when the cache is empty. - * - * @author Fabien Potencier - */ -class Router extends BaseRouter implements WarmableInterface -{ - private $container; - - /** - * Constructor. - * - * @param ContainerInterface $container A ContainerInterface instance - * @param mixed $resource The main resource to load - * @param array $options An array of options - * @param RequestContext $context The context - */ - public function __construct(ContainerInterface $container, $resource, array $options = array(), RequestContext $context = null) - { - $this->container = $container; - - $this->resource = $resource; - $this->context = null === $context ? new RequestContext() : $context; - $this->setOptions($options); - } - - /** - * {@inheritdoc} - */ - public function getRouteCollection() - { - if (null === $this->collection) { - $this->collection = $this->container->get('routing.loader')->load($this->resource, $this->options['resource_type']); - $this->resolveParameters($this->collection); - } - - return $this->collection; - } - - /** - * {@inheritdoc} - */ - public function warmUp($cacheDir) - { - $currentDir = $this->getOption('cache_dir'); - - // force cache generation - $this->setOption('cache_dir', $cacheDir); - $this->getMatcher(); - $this->getGenerator(); - - $this->setOption('cache_dir', $currentDir); - } - - /** - * Replaces placeholders with service container parameter values in: - * - the route defaults, - * - the route requirements, - * - the route pattern. - * - * @param RouteCollection $collection - */ - private function resolveParameters(RouteCollection $collection) - { - foreach ($collection as $route) { - if ($route instanceof RouteCollection) { - $this->resolveParameters($route); - } else { - foreach ($route->getDefaults() as $name => $value) { - $route->setDefault($name, $this->resolveString($value)); - } - - foreach ($route->getRequirements() as $name => $value) { - $route->setRequirement($name, $this->resolveString($value)); - } - - $route->setPattern($this->resolveString($route->getPattern())); - } - } - } - - /** - * Replaces placeholders with the service container parameters in the given string. - * - * @param mixed $value The source string which might contain %placeholders% - * - * @return mixed A string where the placeholders have been replaced, or the original value if not a string. - * - * @throws ParameterNotFoundException When a placeholder does not exist as a container parameter - * @throws RuntimeException When a container value is not a string or a numeric value - */ - private function resolveString($value) - { - $container = $this->container; - - if (null === $value || false === $value || true === $value || is_object($value)) { - return $value; - } - - $escapedValue = preg_replace_callback('/%%|%([^%\s]+)%/', function ($match) use ($container, $value) { - // skip %% - if (!isset($match[1])) { - return '%%'; - } - - $key = strtolower($match[1]); - - if (!$container->hasParameter($key)) { - throw new ParameterNotFoundException($key); - } - - $resolved = $container->getParameter($key); - - if (is_string($resolved) || is_numeric($resolved)) { - return (string) $resolved; - } - - throw new RuntimeException(sprintf( - 'A string value must be composed of strings and/or numbers,' . - 'but found parameter "%s" of type %s inside string value "%s".', - $key, - gettype($resolved), - $value) - ); - - }, $value); - - return str_replace('%%', '%', $escapedValue); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Asset/PackageFactory.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Asset/PackageFactory.php deleted file mode 100644 index de36a32..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Asset/PackageFactory.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Templating\Asset; - -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\HttpFoundation\Request; - -/** - * Creates packages based on whether the current request is secure. - * - * @author Kris Wallsmith - */ -class PackageFactory -{ - private $container; - - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - /** - * Returns either the HTTP or SSL version of an asset package. - * - * @param Request $request The current request - * @param string $httpId The id for the package to use when the current request is HTTP - * @param string $sslId The id for the package to use when the current request is SSL - * - * @return PackageInterface The package - */ - public function getPackage(Request $request, $httpId, $sslId) - { - return $this->container->get($request->isSecure() ? $sslId : $httpId); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Asset/PathPackage.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Asset/PathPackage.php deleted file mode 100644 index 6aa8c58..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Asset/PathPackage.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Templating\Asset; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\Templating\Asset\PathPackage as BasePathPackage; - -/** - * The path packages adds a version and a base path to asset URLs. - * - * @author Kris Wallsmith - */ -class PathPackage extends BasePathPackage -{ - /** - * Constructor. - * - * @param Request $request The current request - * @param string $version The version - * @param string $format The version format - */ - public function __construct(Request $request, $version = null, $format = null) - { - parent::__construct($request->getBasePath(), $version, $format); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Debugger.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Debugger.php deleted file mode 100644 index e63d034..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Debugger.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Templating; - -use Symfony\Component\Templating\DebuggerInterface; -use Symfony\Component\HttpKernel\Log\LoggerInterface; - -/** - * Binds the Symfony templating loader debugger to the Symfony logger. - * - * @author Fabien Potencier - */ -class Debugger implements DebuggerInterface -{ - protected $logger; - - /** - * Constructor. - * - * @param LoggerInterface $logger A LoggerInterface instance - */ - public function __construct(LoggerInterface $logger = null) - { - $this->logger = $logger; - } - - /** - * Logs a message. - * - * @param string $message A message to log - */ - public function log($message) - { - if (null !== $this->logger) { - $this->logger->debug($message); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/DelegatingEngine.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/DelegatingEngine.php deleted file mode 100644 index c5f1a3e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/DelegatingEngine.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Templating; - -use Symfony\Component\Templating\DelegatingEngine as BaseDelegatingEngine; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface; -use Symfony\Component\HttpFoundation\Response; - -/** - * DelegatingEngine selects an engine for a given template. - * - * @author Fabien Potencier - */ -class DelegatingEngine extends BaseDelegatingEngine implements EngineInterface -{ - protected $container; - - /** - * Constructor. - * - * @param ContainerInterface $container The DI container - * @param array $engineIds An array of engine Ids - */ - public function __construct(ContainerInterface $container, array $engineIds) - { - $this->container = $container; - $this->engines = $engineIds; - } - - /** - * {@inheritdoc} - */ - public function supports($name) - { - foreach ($this->engines as $i => $engine) { - if (is_string($engine)) { - $engine = $this->engines[$i] = $this->container->get($engine); - } - - if ($engine->supports($name)) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - protected function getEngine($name) - { - foreach ($this->engines as $i => $engine) { - if (is_string($engine)) { - $engine = $this->engines[$i] = $this->container->get($engine); - } - - if ($engine->supports($name)) { - return $engine; - } - } - - throw new \RuntimeException(sprintf('No engine is able to work with the template "%s".', $name)); - } - - /** - * Renders a view and returns a Response. - * - * @param string $view The view name - * @param array $parameters An array of parameters to pass to the view - * @param Response $response A Response instance - * - * @return Response A Response instance - */ - public function renderResponse($view, array $parameters = array(), Response $response = null) - { - return $this->getEngine($view)->renderResponse($view, $parameters, $response); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/EngineInterface.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/EngineInterface.php deleted file mode 100644 index edc087e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/EngineInterface.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Templating; - -use Symfony\Component\Templating\EngineInterface as BaseEngineInterface; -use Symfony\Component\HttpFoundation\Response; - -/** - * EngineInterface is the interface each engine must implement. - * - * @author Fabien Potencier - */ -interface EngineInterface extends BaseEngineInterface -{ - /** - * Renders a view and returns a Response. - * - * @param string $view The view name - * @param array $parameters An array of parameters to pass to the view - * @param Response $response A Response instance - * - * @return Response A Response instance - */ - public function renderResponse($view, array $parameters = array(), Response $response = null); -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php deleted file mode 100644 index f77ca12..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Templating; - -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * GlobalVariables is the entry point for Symfony global variables in Twig templates. - * - * @author Fabien Potencier - */ -class GlobalVariables -{ - protected $container; - - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - /** - * Returns the security context service. - * - * @return Symfony\Component\Security\Core\SecurityContext|void The security context - */ - public function getSecurity() - { - if ($this->container->has('security.context')) { - return $this->container->get('security.context'); - } - } - - /** - * Returns the current user. - * - * @return mixed|void - * - * @see Symfony\Component\Security\Core\Authentication\Token\TokenInterface::getUser() - */ - public function getUser() - { - if (!$security = $this->getSecurity()) { - return; - } - - if (!$token = $security->getToken()) { - return; - } - - $user = $token->getUser(); - if (!is_object($user)) { - return; - } - - return $user; - } - - /** - * Returns the current request. - * - * @return Symfony\Component\HttpFoundation\Request|void The http request object - */ - public function getRequest() - { - if ($this->container->has('request') && $request = $this->container->get('request')) { - return $request; - } - } - - /** - * Returns the current session. - * - * @return Symfony\Component\HttpFoundation\Session\Session|void The session - */ - public function getSession() - { - if ($request = $this->getRequest()) { - return $request->getSession(); - } - } - - /** - * Returns the current app environment. - * - * @return string The current environment string (e.g 'dev') - */ - public function getEnvironment() - { - return $this->container->getParameter('kernel.environment'); - } - - /** - * Returns the current app debug mode. - * - * @return Boolean The current debug mode - */ - public function getDebug() - { - return (Boolean) $this->container->getParameter('kernel.debug'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php deleted file mode 100644 index d10ef85..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Templating\Helper; - -use Symfony\Component\Templating\Helper\Helper; -use Symfony\Bundle\FrameworkBundle\HttpKernel; - -/** - * ActionsHelper manages action inclusions. - * - * @author Fabien Potencier - */ -class ActionsHelper extends Helper -{ - protected $kernel; - - /** - * Constructor. - * - * @param HttpKernel $kernel A HttpKernel instance - */ - public function __construct(HttpKernel $kernel) - { - $this->kernel = $kernel; - } - - /** - * Returns the Response content for a given controller or URI. - * - * @param string $controller A controller name to execute (a string like BlogBundle:Post:index), or a relative URI - * @param array $attributes An array of request attributes - * @param array $options An array of options - * - * @see Symfony\Bundle\FrameworkBundle\HttpKernel::render() - */ - public function render($controller, array $attributes = array(), array $options = array()) - { - $options['attributes'] = $attributes; - - return $this->kernel->render($controller, $options); - } - - /** - * Returns the canonical name of this helper. - * - * @return string The canonical name - */ - public function getName() - { - return 'actions'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php deleted file mode 100644 index 3fdad98..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php +++ /dev/null @@ -1,222 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Templating\Helper; - -use Symfony\Component\Templating\Helper\Helper; - -if (!defined('ENT_SUBSTITUTE')) { - define('ENT_SUBSTITUTE', 8); -} - -/** - * CodeHelper. - * - * @author Fabien Potencier - */ -class CodeHelper extends Helper -{ - protected $fileLinkFormat; - protected $rootDir; - protected $charset; - - /** - * Constructor. - * - * @param string $fileLinkFormat The format for links to source files - * @param string $rootDir The project root directory - * @param string $charset The charset - */ - public function __construct($fileLinkFormat, $rootDir, $charset) - { - $this->fileLinkFormat = empty($fileLinkFormat) ? ini_get('xdebug.file_link_format') : $fileLinkFormat; - $this->rootDir = str_replace('\\', '/', $rootDir).'/'; - $this->charset = $charset; - } - - /** - * Formats an array as a string. - * - * @param array $args The argument array - * - * @return string - */ - public function formatArgsAsText(array $args) - { - return strip_tags($this->formatArgs($args)); - } - - public function abbrClass($class) - { - $parts = explode('\\', $class); - $short = array_pop($parts); - - return sprintf("%s", $class, $short); - } - - public function abbrMethod($method) - { - if (false !== strpos($method, '::')) { - list($class, $method) = explode('::', $method, 2); - $result = sprintf("%s::%s()", $this->abbrClass($class), $method); - } elseif ('Closure' === $method) { - $result = sprintf("%s", $method, $method); - } else { - $result = sprintf("%s()", $method, $method); - } - - return $result; - } - - /** - * Formats an array as a string. - * - * @param array $args The argument array - * - * @return string - */ - public function formatArgs(array $args) - { - $result = array(); - foreach ($args as $key => $item) { - if ('object' === $item[0]) { - $parts = explode('\\', $item[1]); - $short = array_pop($parts); - $formattedValue = sprintf("object(%s)", $item[1], $short); - } elseif ('array' === $item[0]) { - $formattedValue = sprintf("array(%s)", is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]); - } elseif ('string' === $item[0]) { - $formattedValue = sprintf("'%s'", htmlspecialchars($item[1], ENT_QUOTES, $this->getCharset())); - } elseif ('null' === $item[0]) { - $formattedValue = 'null'; - } elseif ('boolean' === $item[0]) { - $formattedValue = ''.strtolower(var_export($item[1], true)).''; - } elseif ('resource' === $item[0]) { - $formattedValue = 'resource'; - } else { - $formattedValue = str_replace("\n", '', var_export(htmlspecialchars((string) $item[1], ENT_QUOTES, $this->getCharset()), true)); - } - - $result[] = is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue); - } - - return implode(', ', $result); - } - - /** - * Returns an excerpt of a code file around the given line number. - * - * @param string $file A file path - * @param int $line The selected line number - * - * @return string An HTML string - */ - public function fileExcerpt($file, $line) - { - if (is_readable($file)) { - $code = highlight_file($file, true); - // remove main code/span tags - $code = preg_replace('#^\s*(.*)\s*#s', '\\1', $code); - $content = preg_split('#
    #', $code); - - $lines = array(); - for ($i = max($line - 3, 1), $max = min($line + 3, count($content)); $i <= $max; $i++) { - $lines[] = ''.self::fixCodeMarkup($content[$i - 1]).'
  • '; - } - - return '
      '.implode("\n", $lines).'
    '; - } - } - - /** - * Formats a file path. - * - * @param string $file An absolute file path - * @param integer $line The line number - * @param string $text Use this text for the link rather than the file path - * - * @return string - */ - public function formatFile($file, $line, $text = null) - { - if (null === $text) { - $file = trim($file); - $fileStr = $file; - if (0 === strpos($fileStr, $this->rootDir)) { - $fileStr = str_replace($this->rootDir, '', str_replace('\\', '/', $fileStr)); - $fileStr = sprintf('kernel.root_dir/%s', $this->rootDir, $fileStr); - } - - $text = "$fileStr at line $line"; - } - - if (false !== $link = $this->getFileLink($file, $line)) { - return sprintf('%s', htmlspecialchars($link, ENT_QUOTES | ENT_SUBSTITUTE, $this->charset), $text); - } - - return $text; - } - - /** - * Returns the link for a given file/line pair. - * - * @param string $file An absolute file path - * @param integer $line The line number - * - * @return string A link of false - */ - public function getFileLink($file, $line) - { - if ($this->fileLinkFormat && is_file($file)) { - return strtr($this->fileLinkFormat, array('%f' => $file, '%l' => $line)); - } - - return false; - } - - public function formatFileFromText($text) - { - $that = $this; - - return preg_replace_callback('/in ("|")?(.+?)\1(?: +(?:on|at))? +line (\d+)/s', function ($match) use ($that) { - return 'in '.$that->formatFile($match[2], $match[3]); - }, $text); - } - - /** - * Returns the canonical name of this helper. - * - * @return string The canonical name - */ - public function getName() - { - return 'code'; - } - - protected static function fixCodeMarkup($line) - { - // ending tag from previous line - $opening = strpos($line, ''); - if (false !== $closing && (false === $opening || $closing < $opening)) { - $line = substr_replace($line, '', $closing, 7); - } - - // missing tag at the end of line - $opening = strpos($line, ''); - if (false !== $opening && (false === $closing || $closing > $opening)) { - $line .= ''; - } - - return $line; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php deleted file mode 100644 index e271bc5..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php +++ /dev/null @@ -1,208 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Templating\Helper; - -use Symfony\Component\Templating\Helper\Helper; -use Symfony\Component\Form\FormRendererInterface; -use Symfony\Component\Form\FormView; -use Symfony\Component\Templating\EngineInterface; -use Symfony\Component\Form\Exception\FormException; -use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface; -use Symfony\Component\Form\Extension\Core\View\ChoiceView; -use Symfony\Component\Form\Util\FormUtil; - -/** - * FormHelper provides helpers to help display forms. - * - * @author Fabien Potencier - * @author Bernhard Schussek - */ -class FormHelper extends Helper -{ - /** - * @var FormRendererInterface - */ - private $renderer; - - /** - * @param FormRendererInterface $renderer - */ - public function __construct(FormRendererInterface $renderer) - { - $this->renderer = $renderer; - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'form'; - } - - /** - * Sets a theme for a given view. - * - * The theme format is ":". - * - * @param FormView $view A FormView instance - * @param string|array $themes A theme or an array of theme - */ - public function setTheme(FormView $view, $themes) - { - $this->renderer->setTheme($view, $themes); - } - - /** - * Renders the HTML enctype in the form tag, if necessary. - * - * Example usage templates: - * - *
    enctype() ?>> - * - * @param FormView $view The view for which to render the encoding type - * - * @return string The HTML markup - */ - public function enctype(FormView $view) - { - return $this->renderer->searchAndRenderBlock($view, 'enctype'); - } - - /** - * Renders the HTML for a given view. - * - * Example usage: - * - * widget() ?> - * - * You can pass options during the call: - * - * widget(array('attr' => array('class' => 'foo'))) ?> - * - * widget(array('separator' => '+++++)) ?> - * - * @param FormView $view The view for which to render the widget - * @param array $variables Additional variables passed to the template - * - * @return string The HTML markup - */ - public function widget(FormView $view, array $variables = array()) - { - return $this->renderer->searchAndRenderBlock($view, 'widget', $variables); - } - - /** - * Renders the entire form field "row". - * - * @param FormView $view The view for which to render the row - * @param array $variables Additional variables passed to the template - * - * @return string The HTML markup - */ - public function row(FormView $view, array $variables = array()) - { - return $this->renderer->searchAndRenderBlock($view, 'row', $variables); - } - - /** - * Renders the label of the given view. - * - * @param FormView $view The view for which to render the label - * @param string $label The label - * @param array $variables Additional variables passed to the template - * - * @return string The HTML markup - */ - public function label(FormView $view, $label = null, array $variables = array()) - { - if (null !== $label) { - $variables += array('label' => $label); - } - - return $this->renderer->searchAndRenderBlock($view, 'label', $variables); - } - - /** - * Renders the errors of the given view. - * - * @param FormView $view The view to render the errors for - * - * @return string The HTML markup - */ - public function errors(FormView $view) - { - return $this->renderer->searchAndRenderBlock($view, 'errors'); - } - - /** - * Renders views which have not already been rendered. - * - * @param FormView $view The parent view - * @param array $variables An array of variables - * - * @return string The HTML markup - */ - public function rest(FormView $view, array $variables = array()) - { - return $this->renderer->searchAndRenderBlock($view, 'rest', $variables); - } - - /** - * Renders a block of the template. - * - * @param FormView $view The view for determining the used themes. - * @param string $blockName The name of the block to render. - * @param array $variables The variable to pass to the template. - * - * @return string The HTML markup - */ - public function block(FormView $view, $blockName, array $variables = array()) - { - return $this->renderer->renderBlock($view, $blockName, $variables); - } - - /** - * Returns a CSRF token. - * - * Use this helper for CSRF protection without the overhead of creating a - * form. - * - * - * echo $view['form']->csrfToken('rm_user_'.$user->getId()); - * - * - * Check the token in your action using the same intention. - * - * - * $csrfProvider = $this->get('form.csrf_provider'); - * if (!$csrfProvider->isCsrfTokenValid('rm_user_'.$user->getId(), $token)) { - * throw new \RuntimeException('CSRF attack detected.'); - * } - * - * - * @param string $intention The intention of the protected action - * - * @return string A CSRF token - * - * @throws \BadMethodCallException When no CSRF provider was injected in the constructor. - */ - public function csrfToken($intention) - { - return $this->renderer->renderCsrfToken($intention); - } - - public function humanize($text) - { - return $this->renderer->humanize($text); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RequestHelper.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RequestHelper.php deleted file mode 100644 index 49ad326..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RequestHelper.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Templating\Helper; - -use Symfony\Component\Templating\Helper\Helper; -use Symfony\Component\HttpFoundation\Request; - -/** - * RequestHelper provides access to the current request parameters. - * - * @author Fabien Potencier - */ -class RequestHelper extends Helper -{ - protected $request; - - /** - * Constructor. - * - * @param Request $request A Request instance - */ - public function __construct(Request $request) - { - $this->request = $request; - } - - /** - * Returns a parameter from the current request object. - * - * @param string $key The name of the parameter - * @param string $default A default value - * - * @see Symfony\Component\HttpFoundation\Request::get() - */ - public function getParameter($key, $default = null) - { - return $this->request->get($key, $default); - } - - /** - * Returns the locale - * - * @return string - */ - public function getLocale() - { - return $this->request->getLocale(); - } - - /** - * Returns the canonical name of this helper. - * - * @return string The canonical name - */ - public function getName() - { - return 'request'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RouterHelper.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RouterHelper.php deleted file mode 100644 index 6ce7896..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RouterHelper.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Templating\Helper; - -use Symfony\Component\Templating\Helper\Helper; -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; - -/** - * RouterHelper manages links between pages in a template context. - * - * @author Fabien Potencier - */ -class RouterHelper extends Helper -{ - protected $generator; - - /** - * Constructor. - * - * @param UrlGeneratorInterface $router A Router instance - */ - public function __construct(UrlGeneratorInterface $router) - { - $this->generator = $router; - } - - /** - * Generates a URL from the given parameters. - * - * @param string $name The name of the route - * @param mixed $parameters An array of parameters - * @param Boolean $absolute Whether to generate an absolute URL - * - * @return string The generated URL - */ - public function generate($name, $parameters = array(), $absolute = false) - { - return $this->generator->generate($name, $parameters, $absolute); - } - - /** - * Returns the canonical name of this helper. - * - * @return string The canonical name - */ - public function getName() - { - return 'router'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/SessionHelper.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/SessionHelper.php deleted file mode 100644 index aac3f6d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/SessionHelper.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Templating\Helper; - -use Symfony\Component\Templating\Helper\Helper; -use Symfony\Component\HttpFoundation\Request; - -/** - * SessionHelper provides read-only access to the session attributes. - * - * @author Fabien Potencier - */ -class SessionHelper extends Helper -{ - protected $session; - - /** - * Constructor. - * - * @param Request $request A Request instance - */ - public function __construct(Request $request) - { - $this->session = $request->getSession(); - } - - /** - * Returns an attribute - * - * @param string $name The attribute name - * @param mixed $default The default value - * - * @return mixed - */ - public function get($name, $default = null) - { - return $this->session->get($name, $default); - } - - public function getFlash($name, array $default = array()) - { - return $this->session->getFlashBag()->get($name, $default); - } - - public function getFlashes() - { - return $this->session->getFlashBag()->all(); - } - - public function hasFlash($name) - { - return $this->session->getFlashBag()->has($name); - } - - /** - * Returns the canonical name of this helper. - * - * @return string The canonical name - */ - public function getName() - { - return 'session'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/TranslatorHelper.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/TranslatorHelper.php deleted file mode 100644 index 30816d7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/TranslatorHelper.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Templating\Helper; - -use Symfony\Component\Templating\Helper\Helper; -use Symfony\Component\Translation\TranslatorInterface; - -/** - * TranslatorHelper. - * - * @author Fabien Potencier - */ -class TranslatorHelper extends Helper -{ - protected $translator; - - /** - * Constructor. - * - * @param TranslatorInterface $translator A TranslatorInterface instance - */ - public function __construct(TranslatorInterface $translator) - { - $this->translator = $translator; - } - - /** - * @see TranslatorInterface::trans() - */ - public function trans($id, array $parameters = array(), $domain = 'messages', $locale = null) - { - return $this->translator->trans($id, $parameters, $domain, $locale); - } - - /** - * @see TranslatorInterface::transChoice() - */ - public function transChoice($id, $number, array $parameters = array(), $domain = 'messages', $locale = null) - { - return $this->translator->transChoice($id, $number, $parameters, $domain, $locale); - } - - /** - * Returns the canonical name of this helper. - * - * @return string The canonical name - */ - public function getName() - { - return 'translator'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/FilesystemLoader.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/FilesystemLoader.php deleted file mode 100644 index 894f93b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/FilesystemLoader.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Templating\Loader; - -use Symfony\Component\Templating\Storage\FileStorage; -use Symfony\Component\Templating\Loader\LoaderInterface; -use Symfony\Component\Config\FileLocatorInterface; -use Symfony\Component\Templating\TemplateReferenceInterface; - -/** - * FilesystemLoader is a loader that read templates from the filesystem. - * - * @author Fabien Potencier - */ -class FilesystemLoader implements LoaderInterface -{ - protected $locator; - - /** - * Constructor. - * - * @param FileLocatorInterface $locator A FileLocatorInterface instance - */ - public function __construct(FileLocatorInterface $locator) - { - $this->locator = $locator; - } - - /** - * Loads a template. - * - * @param TemplateReferenceInterface $template A template - * - * @return Storage|Boolean false if the template cannot be loaded, a Storage instance otherwise - */ - public function load(TemplateReferenceInterface $template) - { - try { - $file = $this->locator->locate($template); - } catch (\InvalidArgumentException $e) { - return false; - } - - return new FileStorage($file); - } - - /** - * Returns true if the template is still fresh. - * - * @param TemplateReferenceInterface $template The template name as an array - * @param integer $time The last modification time of the cached template (timestamp) - */ - public function isFresh(TemplateReferenceInterface $template, $time) - { - if (false === $storage = $this->load($template)) { - return false; - } - - if (!is_readable((string) $storage)) { - return false; - } - - return filemtime((string) $storage) < $time; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php deleted file mode 100644 index 0ff6b8c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Templating\Loader; - -use Symfony\Component\Config\FileLocatorInterface; -use Symfony\Component\Templating\TemplateReferenceInterface; - -/** - * TemplateLocator locates templates in bundles. - * - * @author Fabien Potencier - */ -class TemplateLocator implements FileLocatorInterface -{ - protected $locator; - protected $cache; - - /** - * Constructor. - * - * @param FileLocatorInterface $locator A FileLocatorInterface instance - * @param string $cacheDir The cache path - */ - public function __construct(FileLocatorInterface $locator, $cacheDir = null) - { - if (null !== $cacheDir && is_file($cache = $cacheDir.'/templates.php')) { - $this->cache = require $cache; - } - - $this->locator = $locator; - } - - /** - * Returns a full path for a given file. - * - * @param TemplateReferenceInterface $template A template - * - * @return string The full path for the file - */ - protected function getCacheKey($template) - { - return $template->getLogicalName(); - } - - /** - * Returns a full path for a given file. - * - * @param TemplateReferenceInterface $template A template - * @param string $currentPath Unused - * @param Boolean $first Unused - * - * @return string The full path for the file - * - * @throws \InvalidArgumentException When the template is not an instance of TemplateReferenceInterface - * @throws \InvalidArgumentException When the template file can not be found - */ - public function locate($template, $currentPath = null, $first = true) - { - if (!$template instanceof TemplateReferenceInterface) { - throw new \InvalidArgumentException("The template must be an instance of TemplateReferenceInterface."); - } - - $key = $this->getCacheKey($template); - - if (isset($this->cache[$key])) { - return $this->cache[$key]; - } - - try { - return $this->cache[$key] = $this->locator->locate($template->getPath(), $currentPath); - } catch (\InvalidArgumentException $e) { - throw new \InvalidArgumentException(sprintf('Unable to find template "%s" : "%s".', $template, $e->getMessage()), 0, $e); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/PhpEngine.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/PhpEngine.php deleted file mode 100644 index a93098e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/PhpEngine.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Templating; - -use Symfony\Component\Templating\PhpEngine as BasePhpEngine; -use Symfony\Component\Templating\Loader\LoaderInterface; -use Symfony\Component\Templating\TemplateNameParserInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\HttpFoundation\Response; - -/** - * This engine knows how to render Symfony templates. - * - * @author Fabien Potencier - */ -class PhpEngine extends BasePhpEngine implements EngineInterface -{ - protected $container; - - /** - * Constructor. - * - * @param TemplateNameParserInterface $parser A TemplateNameParserInterface instance - * @param ContainerInterface $container The DI container - * @param LoaderInterface $loader A loader instance - * @param GlobalVariables|null $globals A GlobalVariables instance or null - */ - public function __construct(TemplateNameParserInterface $parser, ContainerInterface $container, LoaderInterface $loader, GlobalVariables $globals = null) - { - $this->container = $container; - - parent::__construct($parser, $loader); - - if (null !== $globals) { - $this->addGlobal('app', $globals); - } - } - - /** - * @throws \InvalidArgumentException When the helper is not defined - */ - public function get($name) - { - if (!isset($this->helpers[$name])) { - throw new \InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name)); - } - - if (is_string($this->helpers[$name])) { - $this->helpers[$name] = $this->container->get($this->helpers[$name]); - $this->helpers[$name]->setCharset($this->charset); - } - - return $this->helpers[$name]; - } - - /** - * {@inheritdoc} - */ - public function setHelpers(array $helpers) - { - $this->helpers = $helpers; - } - - /** - * Renders a view and returns a Response. - * - * @param string $view The view name - * @param array $parameters An array of parameters to pass to the view - * @param Response $response A Response instance - * - * @return Response A Response instance - */ - public function renderResponse($view, array $parameters = array(), Response $response = null) - { - if (null === $response) { - $response = new Response(); - } - - $response->setContent($this->render($view, $parameters)); - - return $response; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateFilenameParser.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateFilenameParser.php deleted file mode 100644 index befb3e8..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateFilenameParser.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Templating; - -use Symfony\Component\Templating\TemplateNameParserInterface; - -/** - * TemplateFilenameParser converts template filenames to - * TemplateReferenceInterface instances. - * - * @author Fabien Potencier - */ -class TemplateFilenameParser implements TemplateNameParserInterface -{ - /** - * {@inheritdoc} - */ - public function parse($file) - { - $parts = explode('/', strtr($file, '\\', '/')); - - $elements = explode('.', array_pop($parts)); - if (3 > count($elements)) { - return false; - } - $engine = array_pop($elements); - $format = array_pop($elements); - - return new TemplateReference('', implode('/', $parts), implode('.', $elements), $format, $engine); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateNameParser.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateNameParser.php deleted file mode 100644 index 4eeda1d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateNameParser.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Templating; - -use Symfony\Component\Templating\TemplateNameParserInterface; -use Symfony\Component\Templating\TemplateReferenceInterface; -use Symfony\Component\HttpKernel\KernelInterface; - -/** - * TemplateNameParser converts template names from the short notation - * "bundle:section:template.format.engine" to TemplateReferenceInterface - * instances. - * - * @author Fabien Potencier - */ -class TemplateNameParser implements TemplateNameParserInterface -{ - protected $kernel; - protected $cache; - - /** - * Constructor. - * - * @param KernelInterface $kernel A KernelInterface instance - */ - public function __construct(KernelInterface $kernel) - { - $this->kernel = $kernel; - $this->cache = array(); - } - - /** - * {@inheritdoc} - */ - public function parse($name) - { - if ($name instanceof TemplateReferenceInterface) { - return $name; - } elseif (isset($this->cache[$name])) { - return $this->cache[$name]; - } - - // normalize name - $name = str_replace(':/', ':', preg_replace('#/{2,}#', '/', strtr($name, '\\', '/'))); - - if (false !== strpos($name, '..')) { - throw new \RuntimeException(sprintf('Template name "%s" contains invalid characters.', $name)); - } - - $parts = explode(':', $name); - if (3 !== count($parts)) { - throw new \InvalidArgumentException(sprintf('Template name "%s" is not valid (format is "bundle:section:template.format.engine").', $name)); - } - - $elements = explode('.', $parts[2]); - if (3 > count($elements)) { - throw new \InvalidArgumentException(sprintf('Template name "%s" is not valid (format is "bundle:section:template.format.engine").', $name)); - } - $engine = array_pop($elements); - $format = array_pop($elements); - - $template = new TemplateReference($parts[0], $parts[1], implode('.', $elements), $format, $engine); - - if ($template->get('bundle')) { - try { - $this->kernel->getBundle($template->get('bundle')); - } catch (\Exception $e) { - throw new \InvalidArgumentException(sprintf('Template name "%s" is not valid.', $name), 0, $e); - } - } - - return $this->cache[$name] = $template; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateReference.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateReference.php deleted file mode 100644 index 65a5779..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateReference.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Templating; - -use Symfony\Component\Templating\TemplateReference as BaseTemplateReference; - -/** - * Internal representation of a template. - * - * @author Victor Berchet - */ -class TemplateReference extends BaseTemplateReference -{ - public function __construct($bundle = null, $controller = null, $name = null, $format = null, $engine = null) - { - $this->parameters = array( - 'bundle' => $bundle, - 'controller' => $controller, - 'name' => $name, - 'format' => $format, - 'engine' => $engine, - ); - } - - /** - * Returns the path to the template - * - as a path when the template is not part of a bundle - * - as a resource when the template is part of a bundle - * - * @return string A path to the template or a resource - */ - public function getPath() - { - $controller = str_replace('\\', '/', $this->get('controller')); - - $path = (empty($controller) ? '' : $controller.'/').$this->get('name').'.'.$this->get('format').'.'.$this->get('engine'); - - return empty($this->parameters['bundle']) ? 'views/'.$path : '@'.$this->get('bundle').'/Resources/views/'.$path; - } - - /** - * {@inheritdoc} - */ - public function getLogicalName() - { - return sprintf('%s:%s:%s.%s.%s', $this->parameters['bundle'], $this->parameters['controller'], $this->parameters['name'], $this->parameters['format'], $this->parameters['engine']); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php deleted file mode 100644 index ea0c49e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php +++ /dev/null @@ -1,169 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Test; - -use Symfony\Bundle\FrameworkBundle\Client; -use Symfony\Component\Finder\Finder; -use Symfony\Component\HttpKernel\HttpKernelInterface; - -/** - * WebTestCase is the base class for functional tests. - * - * @author Fabien Potencier - */ -abstract class WebTestCase extends \PHPUnit_Framework_TestCase -{ - protected static $class; - protected static $kernel; - - /** - * Creates a Client. - * - * @param array $options An array of options to pass to the createKernel class - * @param array $server An array of server parameters - * - * @return Client A Client instance - */ - protected static function createClient(array $options = array(), array $server = array()) - { - if (null !== static::$kernel) { - static::$kernel->shutdown(); - } - - static::$kernel = static::createKernel($options); - static::$kernel->boot(); - - $client = static::$kernel->getContainer()->get('test.client'); - $client->setServerParameters($server); - - return $client; - } - - /** - * Finds the directory where the phpunit.xml(.dist) is stored. - * - * If you run tests with the PHPUnit CLI tool, everything will work as expected. - * If not, override this method in your test classes. - * - * @return string The directory where phpunit.xml(.dist) is stored - */ - protected static function getPhpUnitXmlDir() - { - if (!isset($_SERVER['argv']) || false === strpos($_SERVER['argv'][0], 'phpunit')) { - throw new \RuntimeException('You must override the WebTestCase::createKernel() method.'); - } - - $dir = static::getPhpUnitCliConfigArgument(); - if ($dir === null && - (is_file(getcwd().DIRECTORY_SEPARATOR.'phpunit.xml') || - is_file(getcwd().DIRECTORY_SEPARATOR.'phpunit.xml.dist'))) { - $dir = getcwd(); - } - - // Can't continue - if ($dir === null) { - throw new \RuntimeException('Unable to guess the Kernel directory.'); - } - - if (!is_dir($dir)) { - $dir = dirname($dir); - } - - return $dir; - } - - /** - * Finds the value of configuration flag from cli - * - * PHPUnit will use the last configuration argument on the command line, so this only returns - * the last configuration argument - * - * @return string The value of the phpunit cli configuration option - */ - private static function getPhpUnitCliConfigArgument() - { - $dir = null; - $reversedArgs = array_reverse($_SERVER['argv']); - foreach ($reversedArgs as $argIndex => $testArg) { - if ($testArg === '-c' || $testArg === '--configuration') { - $dir = realpath($reversedArgs[$argIndex - 1]); - break; - } elseif (strpos($testArg, '--configuration=') === 0) { - $argPath = substr($testArg, strlen('--configuration=')); - $dir = realpath($argPath); - break; - } - } - - return $dir; - } - - /** - * Attempts to guess the kernel location. - * - * When the Kernel is located, the file is required. - * - * @return string The Kernel class name - */ - protected static function getKernelClass() - { - $dir = isset($_SERVER['KERNEL_DIR']) ? $_SERVER['KERNEL_DIR'] : static::getPhpUnitXmlDir(); - - $finder = new Finder(); - $finder->name('*Kernel.php')->depth(0)->in($dir); - $results = iterator_to_array($finder); - if (!count($results)) { - throw new \RuntimeException('Either set KERNEL_DIR in your phpunit.xml according to http://symfony.com/doc/current/book/testing.html#your-first-functional-test or override the WebTestCase::createKernel() method.'); - } - - $file = current($results); - $class = $file->getBasename('.php'); - - require_once $file; - - return $class; - } - - /** - * Creates a Kernel. - * - * Available options: - * - * * environment - * * debug - * - * @param array $options An array of options - * - * @return HttpKernelInterface A HttpKernelInterface instance - */ - protected static function createKernel(array $options = array()) - { - if (null === static::$class) { - static::$class = static::getKernelClass(); - } - - return new static::$class( - isset($options['environment']) ? $options['environment'] : 'test', - isset($options['debug']) ? $options['debug'] : true - ); - } - - /** - * Shuts the kernel down if it was used in the test. - */ - protected function tearDown() - { - if (null !== static::$kernel) { - static::$kernel->shutdown(); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplateFinderTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplateFinderTest.php deleted file mode 100644 index f2e756a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplateFinderTest.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\CacheWarmer; - -use Symfony\Bundle\FrameworkBundle\Tests\TestCase; -use Symfony\Bundle\FrameworkBundle\Templating\TemplateFilenameParser; -use Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinder; -use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\BaseBundle\BaseBundle; - -class TemplateFinderTest extends TestCase -{ - public function testFindAllTemplates() - { - $kernel = $this - ->getMockBuilder('Symfony\Component\HttpKernel\Kernel') - ->disableOriginalConstructor() - ->getMock() - ; - - $kernel - ->expects($this->any()) - ->method('getBundle') - ; - - $kernel - ->expects($this->once()) - ->method('getBundles') - ->will($this->returnValue(array('BaseBundle' => new BaseBundle()))) - ; - - $parser = new TemplateFilenameParser($kernel); - - $finder = new TemplateFinder($kernel, $parser, __DIR__.'/../Fixtures/Resources'); - - $templates = array_map( - function ($template) { return $template->getLogicalName(); }, - $finder->findAllTemplates() - ); - - $this->assertEquals(6, count($templates), '->findAllTemplates() find all templates in the bundles and global folders'); - $this->assertContains('BaseBundle::base.format.engine', $templates); - $this->assertContains('BaseBundle::this.is.a.template.format.engine', $templates); - $this->assertContains('BaseBundle:controller:base.format.engine', $templates); - $this->assertContains('::this.is.a.template.format.engine', $templates); - $this->assertContains('::resource.format.engine', $templates); - } - -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TestCaseMethod.tpl b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TestCaseMethod.tpl deleted file mode 100644 index 5279001..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TestCaseMethod.tpl +++ /dev/null @@ -1,47 +0,0 @@ -collectRawCodeCoverageInformation({collectCodeCoverageInformation}); - - $test = new {className}('{methodName}', unserialize('{data}'), '{dataName}'); - $test->setDependencyInput(unserialize('{dependencyInput}')); - $test->setInIsolation(TRUE); - - ob_end_clean(); - ob_start(); - $test->run($result); - $output = ob_get_clean(); - - print serialize( - array( - 'testResult' => $test->getResult(), - 'numAssertions' => $test->getNumAssertions(), - 'result' => $result, - 'output' => $output - ) - ); - - ob_start(); -} - -{globals} - -if (isset($GLOBALS['__PHPUNIT_BOOTSTRAP'])) { - require_once $GLOBALS['__PHPUNIT_BOOTSTRAP']; - unset($GLOBALS['__PHPUNIT_BOOTSTRAP']); -} - -{constants} - -__phpunit_run_isolated_test(); -ob_end_clean(); -?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerNameParserTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerNameParserTest.php deleted file mode 100644 index 9cc0b77..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerNameParserTest.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Controller; - -use Symfony\Bundle\FrameworkBundle\Tests\TestCase; -use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser; -use Symfony\Component\ClassLoader\UniversalClassLoader; - -class ControllerNameParserTest extends TestCase -{ - protected $loader; - - protected function setUp() - { - $this->loader = new UniversalClassLoader(); - $this->loader->registerNamespaces(array( - 'TestBundle' => __DIR__.'/../Fixtures', - 'TestApplication' => __DIR__.'/../Fixtures', - )); - $this->loader->register(); - } - - public function tearDown() - { - spl_autoload_unregister(array($this->loader, 'loadClass')); - - $this->loader = null; - } - - public function testParse() - { - $parser = $this->createParser(); - - $this->assertEquals('TestBundle\FooBundle\Controller\DefaultController::indexAction', $parser->parse('FooBundle:Default:index'), '->parse() converts a short a:b:c notation string to a class::method string'); - $this->assertEquals('TestBundle\FooBundle\Controller\Sub\DefaultController::indexAction', $parser->parse('FooBundle:Sub\Default:index'), '->parse() converts a short a:b:c notation string to a class::method string'); - $this->assertEquals('TestBundle\Fabpot\FooBundle\Controller\DefaultController::indexAction', $parser->parse('SensioFooBundle:Default:index'), '->parse() converts a short a:b:c notation string to a class::method string'); - $this->assertEquals('TestBundle\Sensio\Cms\FooBundle\Controller\DefaultController::indexAction', $parser->parse('SensioCmsFooBundle:Default:index'), '->parse() converts a short a:b:c notation string to a class::method string'); - $this->assertEquals('TestBundle\FooBundle\Controller\Test\DefaultController::indexAction', $parser->parse('FooBundle:Test\\Default:index'), '->parse() converts a short a:b:c notation string to a class::method string'); - $this->assertEquals('TestBundle\FooBundle\Controller\Test\DefaultController::indexAction', $parser->parse('FooBundle:Test/Default:index'), '->parse() converts a short a:b:c notation string to a class::method string'); - - try { - $parser->parse('foo:'); - $this->fail('->parse() throws an \InvalidArgumentException if the controller is not an a:b:c string'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->parse() throws an \InvalidArgumentException if the controller is not an a:b:c string'); - } - } - - /** - * @dataProvider getMissingControllersTest - */ - public function testMissingControllers($name) - { - $parser = $this->createParser(); - - try { - $parser->parse($name); - $this->fail('->parse() throws a \InvalidArgumentException if the string is in the valid format, but not matching class can be found'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->parse() throws a \InvalidArgumentException if the class is found but does not exist'); - } - } - - public function getMissingControllersTest() - { - return array( - array('FooBundle:Fake:index'), // a normal bundle - array('SensioFooBundle:Fake:index'), // a bundle with children - ); - } - - private function createParser() - { - $bundles = array( - 'SensioFooBundle' => array($this->getBundle('TestBundle\Fabpot\FooBundle', 'FabpotFooBundle'), $this->getBundle('TestBundle\Sensio\FooBundle', 'SensioFooBundle')), - 'SensioCmsFooBundle' => array($this->getBundle('TestBundle\Sensio\Cms\FooBundle', 'SensioCmsFooBundle')), - 'FooBundle' => array($this->getBundle('TestBundle\FooBundle', 'FooBundle')), - 'FabpotFooBundle' => array($this->getBundle('TestBundle\Fabpot\FooBundle', 'FabpotFooBundle'), $this->getBundle('TestBundle\Sensio\FooBundle', 'SensioFooBundle')), - ); - - $kernel = $this->getMock('Symfony\Component\HttpKernel\KernelInterface'); - $kernel - ->expects($this->any()) - ->method('getBundle') - ->will($this->returnCallback(function ($bundle) use ($bundles) { - return $bundles[$bundle]; - })) - ; - - return new ControllerNameParser($kernel); - } - - private function getBundle($namespace, $name) - { - $bundle = $this->getMock('Symfony\Component\HttpKernel\Bundle\BundleInterface'); - $bundle->expects($this->any())->method('getName')->will($this->returnValue($name)); - $bundle->expects($this->any())->method('getNamespace')->will($this->returnValue($namespace)); - - return $bundle; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php deleted file mode 100644 index b64021e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php +++ /dev/null @@ -1,122 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Controller; - -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\ParameterBag; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Bundle\FrameworkBundle\Controller\RedirectController; -use Symfony\Bundle\FrameworkBundle\Tests\TestCase; - -/** - * @author Marcin Sikon - */ -class RedirectControllerTest extends TestCase -{ - public function testEmptyRoute() - { - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - - $controller = new RedirectController(); - $controller->setContainer($container); - - $returnResponse = $controller->redirectAction(''); - - $this->assertInstanceOf('\Symfony\Component\HttpFoundation\Response', $returnResponse); - - $this->assertEquals(410, $returnResponse->getStatusCode()); - } - - /** - * @dataProvider provider - */ - public function testRoute($permanent, $expectedCode) - { - $request = new Request(); - - $route = 'new-route'; - $url = '/redirect-url'; - $params = array('additional-parameter' => 'value'); - $attributes = array( - 'route' => $route, - 'permanent' => $permanent, - '_route' => 'current-route', - '_route_params' => array( - 'route' => $route, - 'permanent' => $permanent, - ), - ); - $attributes['_route_params'] = $attributes['_route_params'] + $params; - - $request->attributes = new ParameterBag($attributes); - - $router = $this->getMock('Symfony\Component\Routing\RouterInterface'); - $router - ->expects($this->once()) - ->method('generate') - ->with($this->equalTo($route), $this->equalTo($params)) - ->will($this->returnValue($url)); - - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - - $container - ->expects($this->at(0)) - ->method('get') - ->with($this->equalTo('request')) - ->will($this->returnValue($request)); - - $container - ->expects($this->at(1)) - ->method('get') - ->with($this->equalTo('router')) - ->will($this->returnValue($router)); - - $controller = new RedirectController(); - $controller->setContainer($container); - - $returnResponse = $controller->redirectAction($route, $permanent); - - $this->assertInstanceOf('\Symfony\Component\HttpFoundation\Response', $returnResponse); - - $this->assertTrue($returnResponse->isRedirect($url)); - $this->assertEquals($expectedCode, $returnResponse->getStatusCode()); - } - - public function provider() - { - return array( - array(true, 301), - array(false, 302), - ); - } - - public function testEmptyPath() - { - $controller = new RedirectController(); - $returnResponse = $controller->urlRedirectAction(''); - - $this->assertInstanceOf('\Symfony\Component\HttpFoundation\Response', $returnResponse); - - $this->assertEquals(410, $returnResponse->getStatusCode()); - } - - public function testFullURL() - { - $controller = new RedirectController(); - $returnResponse = $controller->urlRedirectAction('http://foo.bar/'); - - $this->assertInstanceOf('\Symfony\Component\HttpFoundation\Response', $returnResponse); - - $this->assertEquals('http://foo.bar/', $returnResponse->headers->get('Location')); - $this->assertEquals(302, $returnResponse->getStatusCode()); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddCacheWarmerPassTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddCacheWarmerPassTest.php deleted file mode 100644 index 03eacc3..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddCacheWarmerPassTest.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddCacheWarmerPass; - -class AddCacheWarmerPassTest extends \PHPUnit_Framework_TestCase -{ - public function testThatCacheWarmersAreProcessedInPriorityOrder() - { - $services = array( - 'my_cache_warmer_service1' => array(0 => array('priority' => 100)), - 'my_cache_warmer_service2' => array(0 => array('priority' => 200)), - 'my_cache_warmer_service3' => array() - ); - - $definition = $this->getMock('Symfony\Component\DependencyInjection\Definition'); - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder'); - - $container->expects($this->atLeastOnce()) - ->method('findTaggedServiceIds') - ->will($this->returnValue($services)); - $container->expects($this->atLeastOnce()) - ->method('getDefinition') - ->with('cache_warmer') - ->will($this->returnValue($definition)); - $container->expects($this->atLeastOnce()) - ->method('hasDefinition') - ->with('cache_warmer') - ->will($this->returnValue(true)); - - $definition->expects($this->once()) - ->method('replaceArgument') - ->with(0, array( - new Reference('my_cache_warmer_service2'), - new Reference('my_cache_warmer_service1'), - new Reference('my_cache_warmer_service3') - )); - - $addCacheWarmerPass = new AddCacheWarmerPass(); - $addCacheWarmerPass->process($container); - } - - public function testThatCompilerPassIsIgnoredIfThereIsNoCacheWarmerDefinition() - { - $definition = $this->getMock('Symfony\Component\DependencyInjection\Definition'); - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder'); - - $container->expects($this->never())->method('findTaggedServiceIds'); - $container->expects($this->never())->method('getDefinition'); - $container->expects($this->atLeastOnce()) - ->method('hasDefinition') - ->with('cache_warmer') - ->will($this->returnValue(false)); - $definition->expects($this->never())->method('replaceArgument'); - - $addCacheWarmerPass = new AddCacheWarmerPass(); - $addCacheWarmerPass->process($container); - } - - public function testThatCacheWarmersMightBeNotDefined() - { - $definition = $this->getMock('Symfony\Component\DependencyInjection\Definition'); - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder'); - - $container->expects($this->atLeastOnce()) - ->method('findTaggedServiceIds') - ->will($this->returnValue(array())); - $container->expects($this->never())->method('getDefinition'); - $container->expects($this->atLeastOnce()) - ->method('hasDefinition') - ->with('cache_warmer') - ->will($this->returnValue(true)); - - $definition->expects($this->never())->method('replaceArgument'); - - $addCacheWarmerPass = new AddCacheWarmerPass(); - $addCacheWarmerPass->process($container); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ProfilerPassTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ProfilerPassTest.php deleted file mode 100644 index 05c3ec1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ProfilerPassTest.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ProfilerPass; - -class ProfilerPassTest extends \PHPUnit_Framework_TestCase -{ - /** - * Tests that collectors that specify a template but no "id" will throw - * an exception (both are needed if the template is specified). Thus, - * a fully-valid tag looks something like this: - * - * - */ - public function testTemplateNoIdThrowsException() - { - // one service, with a template key, but no id - $services = array( - 'my_collector_service' => array(0 => array('template' => 'foo')), - ); - - $builder = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder'); - $builder->expects($this->atLeastOnce()) - ->method('findTaggedServiceIds') - ->will($this->returnValue($services)); - - $this->setExpectedException('InvalidArgumentException'); - - $profilerPass = new ProfilerPass(); - $profilerPass->process($builder); - } - - public function testValidCollector() - { - // one service, with a template key, but no id - $services = array( - 'my_collector_service' => array(0 => array('template' => 'foo', 'id' => 'my_collector')), - ); - - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder'); - $container->expects($this->atLeastOnce()) - ->method('findTaggedServiceIds') - ->will($this->returnValue($services)); - - // fake the getDefinition() to return a Profiler definition - $definition = new Definition('ProfilerClass'); - $container->expects($this->atLeastOnce()) - ->method('getDefinition') - ->will($this->returnValue($definition)); - - // assert that the data_collector.templates parameter should be set - $container->expects($this->once()) - ->method('setParameter') - ->with('data_collector.templates', array('my_collector_service' => array('my_collector', 'foo'))); - - $profilerPass = new ProfilerPass(); - $profilerPass->process($container); - - // grab the method calls off of the "profiler" definition - $methodCalls = $definition->getMethodCalls(); - $this->assertCount(1, $methodCalls); - $this->assertEquals('add', $methodCalls[0][0]); // grab the method part of the first call - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/RegisterKernelListenersPassTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/RegisterKernelListenersPassTest.php deleted file mode 100644 index 670052f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/RegisterKernelListenersPassTest.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\RegisterKernelListenersPass; - -class RegisterKernelListenersPassTest extends \PHPUnit_Framework_TestCase -{ - /** - * Tests that event subscribers not implementing EventSubscriberInterface - * trigger an exception. - * - * @expectedException \InvalidArgumentException - */ - public function testEventSubscriberWithoutInterface() - { - // one service, not implementing any interface - $services = array( - 'my_event_subscriber' => array(0 => array()), - ); - - $definition = $this->getMock('Symfony\Component\DependencyInjection\Definition'); - $definition->expects($this->atLeastOnce()) - ->method('getClass') - ->will($this->returnValue('stdClass')); - - $builder = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder'); - $builder->expects($this->any()) - ->method('hasDefinition') - ->will($this->returnValue(true)); - - // We don't test kernel.event_listener here - $builder->expects($this->atLeastOnce()) - ->method('findTaggedServiceIds') - ->will($this->onConsecutiveCalls(array(), $services)); - - $builder->expects($this->atLeastOnce()) - ->method('getDefinition') - ->will($this->returnValue($definition)); - - $registerListenersPass = new RegisterKernelListenersPass(); - $registerListenersPass->process($builder); - } - - public function testValidEventSubscriber() - { - $services = array( - 'my_event_subscriber' => array(0 => array()), - ); - - $definition = $this->getMock('Symfony\Component\DependencyInjection\Definition'); - $definition->expects($this->atLeastOnce()) - ->method('getClass') - ->will($this->returnValue('Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler\SubscriberService')); - - $builder = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder'); - $builder->expects($this->any()) - ->method('hasDefinition') - ->will($this->returnValue(true)); - - // We don't test kernel.event_listener here - $builder->expects($this->atLeastOnce()) - ->method('findTaggedServiceIds') - ->will($this->onConsecutiveCalls(array(), $services)); - - $builder->expects($this->atLeastOnce()) - ->method('getDefinition') - ->will($this->returnValue($definition)); - - $registerListenersPass = new RegisterKernelListenersPass(); - $registerListenersPass->process($builder); - } -} - -class SubscriberService implements \Symfony\Component\EventDispatcher\EventSubscriberInterface -{ - public static function getSubscribedEvents() {} -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/TranslatorPassTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/TranslatorPassTest.php deleted file mode 100644 index 871acb2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/TranslatorPassTest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TranslatorPass; - -class TranslatorPassTest extends \PHPUnit_Framework_TestCase -{ - public function testValidCollector() - { - $definition = $this->getMock('Symfony\Component\DependencyInjection\Definition'); - $definition->expects($this->at(0)) - ->method('addMethodCall') - ->with('addLoader', array('xliff', new Reference('xliff'))); - $definition->expects($this->at(1)) - ->method('addMethodCall') - ->with('addLoader', array('xlf', new Reference('xliff'))); - - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder'); - $container->expects($this->any()) - ->method('hasDefinition') - ->will($this->returnValue(true)); - $container->expects($this->once()) - ->method('getDefinition') - ->will($this->returnValue($definition)); - $container->expects($this->once()) - ->method('findTaggedServiceIds') - ->will($this->returnValue(array('xliff' => array(array('alias' => 'xliff', 'legacy-alias' => 'xlf'))))); - $container->expects($this->once()) - ->method('findDefinition') - ->will($this->returnValue($this->getMock('Symfony\Component\DependencyInjection\Definition'))); - ; - - $pass = new TranslatorPass(); - $pass->process($container); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/TestBundle/Resources/config/validation.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/TestBundle/Resources/config/validation.xml deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/TestBundle/Resources/config/validation.yml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/TestBundle/Resources/config/validation.yml deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/TestBundle/TestBundle.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/TestBundle/TestBundle.php deleted file mode 100644 index e936bfd..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/TestBundle/TestBundle.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests; - -class TestBundle extends \Symfony\Component\HttpKernel\Bundle\Bundle -{ - -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/deprecated_merge_full.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/deprecated_merge_full.php deleted file mode 100644 index b7a56d6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/deprecated_merge_full.php +++ /dev/null @@ -1,20 +0,0 @@ -loadFromExtension('framework', array( - 'secret' => 's3cr3t', - 'session' => array( - 'storage_id' => 'session.storage.native', - 'handler_id' => 'session.handler.native_file', - 'name' => '_SYMFONY', - 'lifetime' => 2012, - 'path' => '/sf2', - 'domain' => 'sf2.example.com', - 'secure' => false, - 'httponly' => false, - 'cookie_lifetime' => 86400, - 'cookie_path' => '/', - 'cookie_domain' => 'example.com', - 'cookie_secure' => true, - 'cookie_httponly' => true, - ), -)); diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/deprecated_merge_partial.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/deprecated_merge_partial.php deleted file mode 100644 index 5d56c1c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/deprecated_merge_partial.php +++ /dev/null @@ -1,17 +0,0 @@ -loadFromExtension('framework', array( - 'secret' => 's3cr3t', - 'session' => array( - 'storage_id' => 'session.storage.native', - 'handler_id' => 'session.handler.native_file', - 'name' => '_SYMFONY', - 'lifetime' => 2012, - 'path' => '/sf2', - 'domain' => 'sf2.example.com', - 'secure' => false, - 'cookie_lifetime' => 86400, - 'cookie_path' => '/', - 'cookie_httponly' => true, - ), -)); diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php deleted file mode 100644 index b4c1acc..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php +++ /dev/null @@ -1,71 +0,0 @@ -loadFromExtension('framework', array( - 'secret' => 's3cr3t', - 'default_locale' => 'fr', - 'form' => null, - 'csrf_protection' => array( - 'enabled' => true, - 'field_name' => '_csrf', - ), - 'esi' => array( - 'enabled' => true, - ), - 'profiler' => array( - 'only_exceptions' => true, - ), - 'router' => array( - 'resource' => '%kernel.root_dir%/config/routing.xml', - 'type' => 'xml', - ), - 'session' => array( - 'storage_id' => 'session.storage.native', - 'handler_id' => 'session.handler.native_file', - 'name' => '_SYMFONY', - 'lifetime' => 86400, - 'path' => '/', - 'domain' => 'example.com', - 'secure' => true, - 'httponly' => true, - 'gc_maxlifetime' => 90000, - 'gc_divisor' => 108, - 'gc_probability' => 1, - 'save_path' => '/path/to/sessions', - ), - 'templating' => array( - 'assets_version' => 'SomeVersionScheme', - 'assets_base_urls' => 'http://cdn.example.com', - 'cache' => '/path/to/cache', - 'engines' => array('php', 'twig'), - 'loader' => array('loader.foo', 'loader.bar'), - 'packages' => array( - 'images' => array( - 'version' => '1.0.0', - 'base_urls' => array('http://images1.example.com', 'http://images2.example.com'), - ), - 'foo' => array( - 'version' => '1.0.0', - ), - 'bar' => array( - 'base_urls' => array('http://bar1.example.com', 'http://bar2.example.com'), - ), - ), - 'form' => array( - 'resources' => array('theme1', 'theme2') - ), - ), - 'translator' => array( - 'enabled' => true, - 'fallback' => 'fr', - ), - 'validation' => array( - 'enabled' => true, - 'cache' => 'apc', - ), - 'annotations' => array( - 'cache' => 'file', - 'debug' => true, - 'file_cache_dir' => '%kernel.cache_dir%/annotations', - ), - 'ide' => 'file%%link%%format' -)); diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_url_package.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_url_package.php deleted file mode 100644 index a5dda77..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_url_package.php +++ /dev/null @@ -1,14 +0,0 @@ -loadFromExtension('framework', array( - 'secret' => 's3cr3t', - 'templating' => array( - 'assets_base_urls' => 'https://cdn.example.com', - 'engines' => array('php', 'twig'), - 'packages' => array( - 'images' => array( - 'base_urls' => 'https://images.example.com', - ), - ), - ), -)); diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_annotations.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_annotations.php deleted file mode 100644 index 75c8f48..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_annotations.php +++ /dev/null @@ -1,9 +0,0 @@ -loadFromExtension('framework', array( - 'secret' => 's3cr3t', - 'validation' => array( - 'enabled' => true, - 'enable_annotations' => true, - ), -)); diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/deprecated_merge_full.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/deprecated_merge_full.xml deleted file mode 100644 index 2a3b6d6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/deprecated_merge_full.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/deprecated_merge_partial.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/deprecated_merge_partial.xml deleted file mode 100644 index c58dcbf..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/deprecated_merge_partial.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml deleted file mode 100644 index 3e75d66..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - loader.foo - loader.bar - php - twig - http://cdn.example.com - - http://images1.example.com - http://images2.example.com - - - - http://bar1.example.com - http://bar2.example.com - - - theme1 - theme2 - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/templating_url_package.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/templating_url_package.xml deleted file mode 100644 index 0fd2039..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/templating_url_package.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - php - twig - https://cdn.example.com - - https://images.example.com - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/validation_annotations.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/validation_annotations.xml deleted file mode 100644 index 22f1536..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/validation_annotations.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/deprecated_merge_full.yml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/deprecated_merge_full.yml deleted file mode 100644 index af6abaf..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/deprecated_merge_full.yml +++ /dev/null @@ -1,16 +0,0 @@ -framework: - secret: s3cr3t - session: - storage_id: session.storage.native - handler_id: session.handler.native_file - name: _SYMFONY - lifetime: 2012 - path: /sf2 - domain: sf2.example.com - secure: false - httponly: false - cookie_lifetime: 86400 - cookie_path: / - cookie_domain: example.com - cookie_secure: true - cookie_httponly: true diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/deprecated_merge_partial.yml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/deprecated_merge_partial.yml deleted file mode 100644 index 765719c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/deprecated_merge_partial.yml +++ /dev/null @@ -1,14 +0,0 @@ -framework: - secret: s3cr3t - session: - storage_id: session.storage.native - handler_id: session.handler.native_file - name: _SYMFONY - lifetime: 2012 - path: /sf2 - domain: sf2.example.com - secure: false - httponly: false - cookie_lifetime: 86400 - cookie_path: / - cookie_httponly: true diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml deleted file mode 100644 index f10bb5c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml +++ /dev/null @@ -1,54 +0,0 @@ -framework: - secret: s3cr3t - default_locale: fr - form: ~ - csrf_protection: - enabled: true - field_name: _csrf - esi: - enabled: true - profiler: - only_exceptions: true - router: - resource: %kernel.root_dir%/config/routing.xml - type: xml - session: - storage_id: session.storage.native - handler_id: session.handler.native_file - name: _SYMFONY - lifetime: 86400 - path: / - domain: example.com - secure: true - httponly: true - gc_probability: 1 - gc_divisor: 108 - gc_maxlifetime: 90000 - save_path: /path/to/sessions - templating: - assets_version: SomeVersionScheme - assets_base_urls: http://cdn.example.com - engines: [php, twig] - loader: [loader.foo, loader.bar] - cache: /path/to/cache - packages: - images: - version: 1.0.0 - base_urls: ["http://images1.example.com", "http://images2.example.com"] - foo: - version: 1.0.0 - bar: - base_urls: ["http://images1.example.com", "http://images2.example.com"] - form: - resources: [theme1, theme2] - translator: - enabled: true - fallback: fr - validation: - enabled: true - cache: apc - annotations: - cache: file - debug: true - file_cache_dir: %kernel.cache_dir%/annotations - ide: file%%link%%format diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/templating_url_package.yml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/templating_url_package.yml deleted file mode 100644 index bfec7a1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/templating_url_package.yml +++ /dev/null @@ -1,8 +0,0 @@ -framework: - secret: s3cr3t - templating: - assets_base_urls: https://cdn.example.com - engines: [php, twig] - packages: - images: - base_urls: https://images.example.com diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/validation_annotations.yml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/validation_annotations.yml deleted file mode 100644 index 41f1796..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/validation_annotations.yml +++ /dev/null @@ -1,5 +0,0 @@ -framework: - secret: s3cr3t - validation: - enabled: true - enable_annotations: true diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php deleted file mode 100644 index 385ece0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ /dev/null @@ -1,304 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection; - -use Symfony\Bundle\FrameworkBundle\Tests\TestCase; -use Symfony\Bundle\FrameworkBundle\DependencyInjection\FrameworkExtension; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; - -abstract class FrameworkExtensionTest extends TestCase -{ - abstract protected function loadFromFile(ContainerBuilder $container, $file); - - public function testCsrfProtection() - { - $container = $this->createContainerFromFile('full'); - - $def = $container->getDefinition('form.type_extension.csrf'); - - $this->assertTrue($container->getParameter('form.type_extension.csrf.enabled')); - $this->assertEquals('%form.type_extension.csrf.enabled%', $def->getArgument(1)); - $this->assertEquals('_csrf', $container->getParameter('form.type_extension.csrf.field_name')); - $this->assertEquals('%form.type_extension.csrf.field_name%', $def->getArgument(2)); - $this->assertEquals('s3cr3t', $container->getParameterBag()->resolveValue($container->findDefinition('form.csrf_provider')->getArgument(1))); - } - - public function testEsi() - { - $container = $this->createContainerFromFile('full'); - - $this->assertTrue($container->hasDefinition('esi'), '->registerEsiConfiguration() loads esi.xml'); - } - - public function testProfiler() - { - $container = $this->createContainerFromFile('full'); - - $this->assertTrue($container->hasDefinition('profiler'), '->registerProfilerConfiguration() loads profiling.xml'); - $this->assertTrue($container->hasDefinition('data_collector.config'), '->registerProfilerConfiguration() loads collectors.xml'); - $this->assertTrue($container->getParameter('profiler_listener.only_exceptions')); - $this->assertEquals('%profiler_listener.only_exceptions%', $container->getDefinition('profiler_listener')->getArgument(2)); - } - - public function testRouter() - { - $container = $this->createContainerFromFile('full'); - - $this->assertTrue($container->has('router'), '->registerRouterConfiguration() loads routing.xml'); - $arguments = $container->findDefinition('router')->getArguments(); - $this->assertEquals($container->getParameter('kernel.root_dir').'/config/routing.xml', $container->getParameter('router.resource'), '->registerRouterConfiguration() sets routing resource'); - $this->assertEquals('%router.resource%', $arguments[1], '->registerRouterConfiguration() sets routing resource'); - $this->assertEquals('xml', $arguments[2]['resource_type'], '->registerRouterConfiguration() sets routing resource type'); - } - - /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function testRouterRequiresResourceOption() - { - $container = $this->createContainer(); - $loader = new FrameworkExtension(); - $loader->load(array(array('router' => true)), $container); - } - - public function testSession() - { - $container = $this->createContainerFromFile('full'); - - $this->assertTrue($container->hasDefinition('session'), '->registerSessionConfiguration() loads session.xml'); - $this->assertEquals('fr', $container->getParameter('kernel.default_locale')); - $this->assertEquals('session.storage.native', (string) $container->getAlias('session.storage')); - $this->assertEquals('session.handler.native_file', (string) $container->getAlias('session.handler')); - - $options = $container->getParameter('session.storage.options'); - $this->assertEquals('_SYMFONY', $options['name']); - $this->assertEquals(86400, $options['cookie_lifetime']); - $this->assertEquals('/', $options['cookie_path']); - $this->assertEquals('example.com', $options['cookie_domain']); - $this->assertTrue($options['cookie_secure']); - $this->assertTrue($options['cookie_httponly']); - $this->assertEquals(108, $options['gc_divisor']); - $this->assertEquals(1, $options['gc_probability']); - $this->assertEquals(90000, $options['gc_maxlifetime']); - - $this->assertEquals('/path/to/sessions', $container->getParameter('session.save_path')); - } - - public function testSessionDeprecatedMergeFull() - { - $container = $this->createContainerFromFile('deprecated_merge_full'); - - $this->assertTrue($container->hasDefinition('session'), '->registerSessionConfiguration() loads session.xml'); - - $options = $container->getParameter('session.storage.options'); - $this->assertEquals('_SYMFONY', $options['name']); - $this->assertEquals(86400, $options['cookie_lifetime']); - $this->assertEquals('/', $options['cookie_path']); - $this->assertEquals('example.com', $options['cookie_domain']); - $this->assertTrue($options['cookie_secure']); - $this->assertTrue($options['cookie_httponly']); - } - - public function testSessionDeprecatedMergePartial() - { - $container = $this->createContainerFromFile('deprecated_merge_partial'); - - $this->assertTrue($container->hasDefinition('session'), '->registerSessionConfiguration() loads session.xml'); - - $options = $container->getParameter('session.storage.options'); - $this->assertEquals('_SYMFONY', $options['name']); - $this->assertEquals(86400, $options['cookie_lifetime']); - $this->assertEquals('/', $options['cookie_path']); - $this->assertEquals('sf2.example.com', $options['cookie_domain']); - $this->assertFalse($options['cookie_secure']); - $this->assertTrue($options['cookie_httponly']); - } - - public function testTemplating() - { - $container = $this->createContainerFromFile('full'); - - $this->assertTrue($container->hasDefinition('templating.name_parser'), '->registerTemplatingConfiguration() loads templating.xml'); - - $this->assertEquals('request', $container->getDefinition('templating.helper.assets')->getScope(), '->registerTemplatingConfiguration() sets request scope on assets helper if one or more packages are request-scoped'); - - // default package should have one http base url and path package ssl url - $this->assertTrue($container->hasDefinition('templating.asset.default_package.http')); - $package = $container->getDefinition('templating.asset.default_package.http'); - $this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\DefinitionDecorator', $package); - $this->assertEquals('templating.asset.url_package', $package->getParent()); - $arguments = array_values($package->getArguments()); - $this->assertEquals(array('http://cdn.example.com'), $arguments[0]); - $this->assertEquals('SomeVersionScheme', $arguments[1]); - $this->assertEquals('%%s?%%s', $arguments[2]); - - $this->assertTrue($container->hasDefinition('templating.asset.default_package.ssl')); - $package = $container->getDefinition('templating.asset.default_package.ssl'); - $this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\DefinitionDecorator', $package); - $this->assertEquals('templating.asset.path_package', $package->getParent()); - - $this->assertEquals('templating.engine.delegating', (string) $container->getAlias('templating'), '->registerTemplatingConfiguration() configures delegating loader if multiple engines are provided'); - - $this->assertEquals($container->getDefinition('templating.loader.chain'), $container->getDefinition('templating.loader.wrapped'), '->registerTemplatingConfiguration() configures loader chain if multiple loaders are provided'); - - $this->assertEquals($container->getDefinition('templating.loader'), $container->getDefinition('templating.loader.cache'), '->registerTemplatingConfiguration() configures the loader to use cache'); - - $this->assertEquals('%templating.loader.cache.path%', $container->getDefinition('templating.loader.cache')->getArgument(1)); - $this->assertEquals('/path/to/cache', $container->getParameter('templating.loader.cache.path')); - - $this->assertEquals(array('php', 'twig'), $container->getParameter('templating.engines'), '->registerTemplatingConfiguration() sets a templating.engines parameter'); - - $this->assertEquals(array('FrameworkBundle:Form', 'theme1', 'theme2'), $container->getParameter('templating.helper.form.resources'), '->registerTemplatingConfiguration() registers the theme and adds the base theme'); - } - - public function testTemplatingAssetsHelperScopeDependsOnPackageArgumentScopes() - { - $container = $this->createContainerFromFile('templating_url_package'); - - $this->assertNotEquals('request', $container->getDefinition('templating.helper.assets')->getScope(), '->registerTemplatingConfiguration() does not set request scope on assets helper if no packages are request-scoped'); - } - - public function testTranslator() - { - $container = $this->createContainerFromFile('full'); - - $this->assertTrue($container->hasDefinition('translator.default'), '->registerTranslatorConfiguration() loads translation.xml'); - $this->assertEquals('translator.default', (string) $container->getAlias('translator'), '->registerTranslatorConfiguration() redefines translator service from identity to real translator'); - - $resources = array(); - foreach ($container->getDefinition('translator.default')->getMethodCalls() as $call) { - if ('addResource' == $call[0]) { - $resources[] = $call[1]; - } - } - - $files = array_map(function($resource) use ($resources) { return str_replace(realpath(__DIR__.'/../../../../..').'/', '', realpath($resource[1])); }, $resources); - $this->assertContains( - 'Symfony/Component/Validator/Resources/translations/validators.en.xlf', - $files, - '->registerTranslatorConfiguration() finds Validator translation resources' - ); - $this->assertContains( - 'Symfony/Component/Form/Resources/translations/validators.en.xlf', - $files, - '->registerTranslatorConfiguration() finds Form translation resources' - ); - - $calls = $container->getDefinition('translator.default')->getMethodCalls(); - $this->assertEquals('fr', $calls[0][1][0]); - } - - /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function testTemplatingRequiresAtLeastOneEngine() - { - $container = $this->createContainer(); - $loader = new FrameworkExtension(); - $loader->load(array(array('templating' => null)), $container); - } - - public function testValidation() - { - $container = $this->createContainerFromFile('full'); - - $this->assertTrue($container->hasDefinition('validator'), '->registerValidationConfiguration() loads validator.xml'); - $this->assertTrue($container->hasDefinition('validator.mapping.loader.xml_files_loader'), '->registerValidationConfiguration() defines the XML loader'); - $this->assertTrue($container->hasDefinition('validator.mapping.loader.yaml_files_loader'), '->registerValidationConfiguration() defines the YAML loader'); - - $xmlFiles = $container->getParameter('validator.mapping.loader.xml_files_loader.mapping_files'); - $this->assertContains( - realpath(__DIR__.'/../../../../Component/Form/Resources/config/validation.xml'), - array_map('realpath', $xmlFiles), - '->registerValidationConfiguration() adds Form validation.xml to XML loader' - ); - } - - public function testAnnotations() - { - if (!class_exists('Doctrine\\Common\\Version')) { - $this->markTestSkipped('Doctrine is not available.'); - } - - $container = $this->createContainerFromFile('full'); - - $this->assertEquals($container->getParameter('kernel.cache_dir').'/annotations', $container->getDefinition('annotations.file_cache_reader')->getArgument(1)); - $this->assertInstanceOf('Doctrine\Common\Annotations\FileCacheReader', $container->get('annotation_reader')); - } - - public function testFileLinkFormat() - { - $container = $this->createContainerFromFile('full'); - - $this->assertEquals('file%link%format', $container->getParameter('templating.helper.code.file_link_format')); - } - - public function testValidationAnnotations() - { - $container = $this->createContainerFromFile('validation_annotations'); - - $this->assertTrue($container->hasDefinition('validator.mapping.loader.annotation_loader'), '->registerValidationConfiguration() defines the annotation loader'); - $loaders = $container->getDefinition('validator.mapping.loader.loader_chain')->getArgument(0); - $found = false; - foreach ($loaders as $loader) { - if ('validator.mapping.loader.annotation_loader' === (string) $loader) { - $found = true; - } - } - $this->assertTrue($found, 'validator.mapping.loader.annotation_loader is added to the loader chain.'); - } - - public function testValidationPaths() - { - require_once __DIR__."/Fixtures/TestBundle/TestBundle.php"; - - $container = $this->createContainerFromFile('validation_annotations', array( - 'kernel.bundles' => array('TestBundle' => 'Symfony\Bundle\FrameworkBundle\Tests\TestBundle'), - )); - - $yamlArgs = $container->getParameter('validator.mapping.loader.yaml_files_loader.mapping_files'); - $this->assertCount(1, $yamlArgs); - $this->assertStringEndsWith('TestBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'validation.yml', $yamlArgs[0]); - - $xmlArgs = $container->getParameter('validator.mapping.loader.xml_files_loader.mapping_files'); - $this->assertCount(2, $xmlArgs); - $this->assertStringEndsWith('Component'.DIRECTORY_SEPARATOR.'Form/Resources/config/validation.xml', $xmlArgs[0]); - $this->assertStringEndsWith('TestBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'validation.xml', $xmlArgs[1]); - } - - protected function createContainer(array $data = array()) - { - return new ContainerBuilder(new ParameterBag(array_merge(array( - 'kernel.bundles' => array('FrameworkBundle' => 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle'), - 'kernel.cache_dir' => __DIR__, - 'kernel.compiled_classes' => array(), - 'kernel.debug' => false, - 'kernel.environment' => 'test', - 'kernel.name' => 'kernel', - 'kernel.root_dir' => __DIR__, - ), $data))); - } - - protected function createContainerFromFile($file, $data = array()) - { - $container = $this->createContainer($data); - $container->registerExtension(new FrameworkExtension()); - $this->loadFromFile($container, $file); - - $container->getCompilerPassConfig()->setOptimizationPasses(array()); - $container->getCompilerPassConfig()->setRemovingPasses(array()); - $container->compile(); - - return $container; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/PhpFrameworkExtensionTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/PhpFrameworkExtensionTest.php deleted file mode 100644 index fad373e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/PhpFrameworkExtensionTest.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; -use Symfony\Component\Config\FileLocator; - -class PhpFrameworkExtensionTest extends FrameworkExtensionTest -{ - protected function loadFromFile(ContainerBuilder $container, $file) - { - $loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/Fixtures/php')); - $loader->load($file.'.php'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/XmlFrameworkExtensionTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/XmlFrameworkExtensionTest.php deleted file mode 100644 index 2c27eb0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/XmlFrameworkExtensionTest.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\Config\FileLocator; - -class XmlFrameworkExtensionTest extends FrameworkExtensionTest -{ - protected function loadFromFile(ContainerBuilder $container, $file) - { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/Fixtures/xml')); - $loader->load($file.'.xml'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/YamlFrameworkExtensionTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/YamlFrameworkExtensionTest.php deleted file mode 100644 index 43070c0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/YamlFrameworkExtensionTest.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; -use Symfony\Component\Config\FileLocator; - -class YamlFrameworkExtensionTest extends FrameworkExtensionTest -{ - protected function loadFromFile(ContainerBuilder $container, $file) - { - $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/Fixtures/yml')); - $loader->load($file.'.yml'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/EventListener/TestSessionListenerTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/EventListener/TestSessionListenerTest.php deleted file mode 100644 index 88fadf2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/EventListener/TestSessionListenerTest.php +++ /dev/null @@ -1,106 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\EventListener; - -use Symfony\Bundle\FrameworkBundle\EventListener\TestSessionListener; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; - -/** - * SessionListenerTest. - * - * Tests SessionListener. - * - * @author Bulat Shakirzyanov - */ -class TestSessionListenerTest extends \PHPUnit_Framework_TestCase -{ - private $listener; - private $session; - - protected function setUp() - { - $this->listener = new TestSessionListener($this->getMock('Symfony\Component\DependencyInjection\ContainerInterface')); - $this->session = $this->getSession(); - } - - protected function tearDown() - { - $this->listener = null; - $this->session = null; - } - - public function testShouldSaveMasterRequestSession() - { - $this->sessionMustBeSaved(); - - $this->filterResponse(new Request()); - } - - public function testShouldNotSaveSubRequestSession() - { - $this->sessionMustNotBeSaved(); - - $this->filterResponse(new Request(), HttpKernelInterface::SUB_REQUEST); - } - - public function testDoesNotDeleteCookieIfUsingSessionLifetime() - { - $params = session_get_cookie_params(); - session_set_cookie_params(0, $params['path'], $params['domain'], $params['secure'], $params['httponly']); - - $response = $this->filterResponse(new Request(), HttpKernelInterface::MASTER_REQUEST); - $cookies = $response->headers->getCookies(); - - $this->assertEquals(0, reset($cookies)->getExpiresTime()); - } - - private function filterResponse(Request $request, $type = HttpKernelInterface::MASTER_REQUEST) - { - $request->setSession($this->session); - $response = new Response(); - $kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'); - $event = new FilterResponseEvent($kernel, $request, $type, $response); - - $this->listener->onKernelResponse($event); - - $this->assertSame($response, $event->getResponse()); - - return $response; - } - - private function sessionMustNotBeSaved() - { - $this->session->expects($this->never()) - ->method('save'); - } - - private function sessionMustBeSaved() - { - $this->session->expects($this->once()) - ->method('save'); - } - - private function getSession() - { - $mock = $this->getMockBuilder('Symfony\Component\HttpFoundation\Session\Session') - ->disableOriginalConstructor() - ->getMock(); - - // set return value for getName() - $mock->expects($this->any())->method('getName')->will($this->returnValue('MOCKSESSID')); - - return $mock; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/BaseBundle.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/BaseBundle.php deleted file mode 100644 index 494a18d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/BaseBundle.php +++ /dev/null @@ -1,18 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Fixtures\BaseBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; - -class BaseBundle extends Bundle -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/Resources/views/base.format.engine b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/Resources/views/base.format.engine deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/Resources/views/controller/base.format.engine b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/Resources/views/controller/base.format.engine deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/Resources/views/this.is.a.template.format.engine b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/Resources/views/this.is.a.template.format.engine deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/resource.format.engine b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/resource.format.engine deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/this.is.a.template.format.engine b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/this.is.a.template.format.engine deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php deleted file mode 100644 index 48ea9fd..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php +++ /dev/null @@ -1,2 +0,0 @@ -This template is used for translation message extraction tests -trans('new key') ?> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Fabpot/FooBundle/Controller/DefaultController.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Fabpot/FooBundle/Controller/DefaultController.php deleted file mode 100644 index c4bee6c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Fabpot/FooBundle/Controller/DefaultController.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace TestBundle\Fabpot\FooBundle\Controller; - -/** - * DefaultController. - * - * @author Fabien Potencier - */ -class DefaultController -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Fabpot/FooBundle/FabpotFooBundle.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Fabpot/FooBundle/FabpotFooBundle.php deleted file mode 100644 index 17894ba..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Fabpot/FooBundle/FabpotFooBundle.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace TestBundle\Fabpot\FooBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; - -/** - * Bundle. - * - * @author Fabien Potencier - */ -class FabpotFooBundle extends Bundle -{ - /** - * {@inheritdoc} - */ - public function getParent() - { - return 'SensioFooBundle'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/Controller/DefaultController.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/Controller/DefaultController.php deleted file mode 100644 index ddda38c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/Controller/DefaultController.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace TestBundle\FooBundle\Controller; - -/** - * DefaultController. - * - * @author Fabien Potencier - */ -class DefaultController -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/Controller/Sub/DefaultController.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/Controller/Sub/DefaultController.php deleted file mode 100644 index 3c889e7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/Controller/Sub/DefaultController.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace TestBundle\FooBundle\Controller\Sub; - -/** - * DefaultController. - * - * @author Fabien Potencier - */ -class DefaultController -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/Controller/Test/DefaultController.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/Controller/Test/DefaultController.php deleted file mode 100644 index 1bffc7f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/Controller/Test/DefaultController.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace TestBundle\FooBundle\Controller\Test; - -/** - * DefaultController. - * - * @author Fabien Potencier - */ -class DefaultController -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/FooBundle.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/FooBundle.php deleted file mode 100644 index 656f17c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/FooBundle.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace TestBundle\FooBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; - -/** - * Bundle. - * - * @author Fabien Potencier - */ -class FooBundle extends Bundle -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/Cms/FooBundle/Controller/DefaultController.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/Cms/FooBundle/Controller/DefaultController.php deleted file mode 100644 index 1bb8038..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/Cms/FooBundle/Controller/DefaultController.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace TestBundle\Sensio\Cms\FooBundle\Controller; - -/** - * DefaultController. - * - * @author Fabien Potencier - */ -class DefaultController -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/Cms/FooBundle/SensioCmsFooBundle.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/Cms/FooBundle/SensioCmsFooBundle.php deleted file mode 100644 index 58967d8..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/Cms/FooBundle/SensioCmsFooBundle.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace TestBundle\Sensio\Cms\FooBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; - -/** - * Bundle. - * - * @author Fabien Potencier - */ -class SensioCmsFooBundle extends Bundle -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/FooBundle/Controller/DefaultController.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/FooBundle/Controller/DefaultController.php deleted file mode 100644 index 86486f0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/FooBundle/Controller/DefaultController.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace TestBundle\Sensio\FooBundle\Controller; - -/** - * DefaultController. - * - * @author Fabien Potencier - */ -class DefaultController -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/FooBundle/SensioFooBundle.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/FooBundle/SensioFooBundle.php deleted file mode 100644 index d1bc5dc..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/FooBundle/SensioFooBundle.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace TestBundle\Sensio\FooBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; - -/** - * Bundle. - * - * @author Fabien Potencier - */ -class SensioFooBundle extends Bundle -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SessionController.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SessionController.php deleted file mode 100644 index 8d39576..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SessionController.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\Controller; - -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\RedirectResponse; -use Symfony\Component\DependencyInjection\ContainerAware; - -class SessionController extends ContainerAware -{ - public function welcomeAction($name=null) - { - $request = $this->container->get('request'); - $session = $request->getSession(); - - // new session case - if (!$session->has('name')) { - if (!$name) { - return new Response('You are new here and gave no name.'); - } - - // remember name - $session->set('name', $name); - - return new Response(sprintf('Hello %s, nice to meet you.', $name)); - } - - // existing session - $name = $session->get('name'); - - return new Response(sprintf('Welcome back %s, nice to meet you.', $name)); - } - - public function logoutAction() - { - $request = $this->container->get('request')->getSession('session')->invalidate(); - - return new Response('Session cleared.'); - } - - public function setFlashAction($message) - { - $request = $this->container->get('request'); - $session = $request->getSession(); - $session->getFlashBag()->set('notice', $message); - - return new RedirectResponse($this->container->get('router')->generate('session_showflash')); - } - - public function showFlashAction() - { - $request = $this->container->get('request'); - $session = $request->getSession(); - - if ($session->getFlashBag()->has('notice')) { - list($output) = $session->getFlashBag()->get('notice'); - } else { - $output = 'No flash was set.'; - } - - return new Response($output); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Resources/config/routing.yml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Resources/config/routing.yml deleted file mode 100644 index 69a8e6d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Resources/config/routing.yml +++ /dev/null @@ -1,19 +0,0 @@ -session_welcome: - pattern: /session - defaults: { _controller: TestBundle:Session:welcome } - -session_welcome_name: - pattern: /session/{name} - defaults: { _controller: TestBundle:Session:welcome } - -session_logout: - pattern: /session_logout - defaults: { _controller: TestBundle:Session:logout} - -session_setflash: - pattern: /session_setflash/{message} - defaults: { _controller: TestBundle:Session:setFlash} - -session_showflash: - pattern: /session_showflash - defaults: { _controller: TestBundle:Session:showFlash} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/TestBundle.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/TestBundle.php deleted file mode 100644 index d17347c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/TestBundle.php +++ /dev/null @@ -1,18 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; - -class TestBundle extends Bundle -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php deleted file mode 100644 index 3e90e9d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php +++ /dev/null @@ -1,154 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; - -/** - * @group functional - */ -class SessionTest extends WebTestCase -{ - /** - * Tests session attributes persist. - * - * @dataProvider getConfigs - */ - public function testWelcome($config, $insulate) - { - $client = $this->createClient(array('test_case' => 'Session', 'root_config' => $config)); - if ($insulate) { - $client->insulate(); - } - - // no session - $crawler = $client->request('GET', '/session'); - $this->assertContains('You are new here and gave no name.', $crawler->text()); - - // remember name - $crawler = $client->request('GET', '/session/drak'); - $this->assertContains('Hello drak, nice to meet you.', $crawler->text()); - - // prove remembered name - $crawler = $client->request('GET', '/session'); - $this->assertContains('Welcome back drak, nice to meet you.', $crawler->text()); - - // clear session - $crawler = $client->request('GET', '/session_logout'); - $this->assertContains('Session cleared.', $crawler->text()); - - // prove cleared session - $crawler = $client->request('GET', '/session'); - $this->assertContains('You are new here and gave no name.', $crawler->text()); - } - - /** - * Tests flash messages work in practice. - * - * @dataProvider getConfigs - */ - public function testFlash($config, $insulate) - { - $client = $this->createClient(array('test_case' => 'Session', 'root_config' => $config)); - if ($insulate) { - $client->insulate(); - } - - // set flash - $crawler = $client->request('GET', '/session_setflash/Hello%20world.'); - - // check flash displays on redirect - $this->assertContains('Hello world.', $client->followRedirect()->text()); - - // check flash is gone - $crawler = $client->request('GET', '/session_showflash'); - $this->assertContains('No flash was set.', $crawler->text()); - } - - /** - * See if two separate insulated clients can run without - * polluting eachother's session data. - * - * @dataProvider getConfigs - */ - public function testTwoClients($config, $insulate) - { - // start first client - $client1 = $this->createClient(array('test_case' => 'Session', 'root_config' => $config)); - if ($insulate) { - $client1->insulate(); - } - - // start second client - $client2 = $this->createClient(array('test_case' => 'Session', 'root_config' => $config)); - if ($insulate) { - $client2->insulate(); - } - - // new session, so no name set. - $crawler1 = $client1->request('GET', '/session'); - $this->assertContains('You are new here and gave no name.', $crawler1->text()); - - // set name of client1 - $crawler1 = $client1->request('GET', '/session/client1'); - $this->assertContains('Hello client1, nice to meet you.', $crawler1->text()); - - // no session for client2 - $crawler2 = $client2->request('GET', '/session'); - $this->assertContains('You are new here and gave no name.', $crawler2->text()); - - // remember name client2 - $crawler2 = $client2->request('GET', '/session/client2'); - $this->assertContains('Hello client2, nice to meet you.', $crawler2->text()); - - // prove remembered name of client1 - $crawler1 = $client1->request('GET', '/session'); - $this->assertContains('Welcome back client1, nice to meet you.', $crawler1->text()); - - // prove remembered name of client2 - $crawler2 = $client2->request('GET', '/session'); - $this->assertContains('Welcome back client2, nice to meet you.', $crawler2->text()); - - // clear client1 - $crawler1 = $client1->request('GET', '/session_logout'); - $this->assertContains('Session cleared.', $crawler1->text()); - - // prove client1 data is cleared - $crawler1 = $client1->request('GET', '/session'); - $this->assertContains('You are new here and gave no name.', $crawler1->text()); - - // prove remembered name of client2 remains untouched. - $crawler2 = $client2->request('GET', '/session'); - $this->assertContains('Welcome back client2, nice to meet you.', $crawler2->text()); - } - - public function getConfigs() - { - return array( - // configfile, insulate - array('config.yml', true), - array('config.yml', false), - ); - } - - protected function setUp() - { - parent::setUp(); - - $this->deleteTmpDir('SessionTest'); - } - - protected function tearDown() - { - parent::tearDown(); - - $this->deleteTmpDir('SessionTest'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php deleted file mode 100644 index affbeb9..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; - -use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase; -use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\HttpKernel\Kernel; - -class WebTestCase extends BaseWebTestCase -{ - public static function assertRedirect($response, $location) - { - self::assertTrue($response->isRedirect(), 'Response is not a redirect, got status code: '.$response->getStatusCode()); - self::assertEquals('http://localhost'.$location, $response->headers->get('Location')); - } - - protected function setUp() - { - if (!class_exists('Twig_Environment')) { - $this->markTestSkipped('Twig is not available.'); - } - - parent::setUp(); - } - - protected function deleteTmpDir($testCase) - { - if (!file_exists($dir = sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$testCase)) { - return; - } - - $fs = new Filesystem(); - $fs->remove($dir); - } - - protected static function getKernelClass() - { - require_once __DIR__.'/app/AppKernel.php'; - - return 'Symfony\Bundle\FrameworkBundle\Tests\Functional\AppKernel'; - } - - protected static function createKernel(array $options = array()) - { - $class = self::getKernelClass(); - - if (!isset($options['test_case'])) { - throw new \InvalidArgumentException('The option "test_case" must be set.'); - } - - return new $class( - $options['test_case'], - isset($options['root_config']) ? $options['root_config'] : 'config.yml', - isset($options['environment']) ? $options['environment'] : 'frameworkbundletest', - isset($options['debug']) ? $options['debug'] : true - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php deleted file mode 100644 index 655c9c7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; - -// get the autoload file -$dir = __DIR__; -$lastDir = null; -while ($dir !== $lastDir) { - $lastDir = $dir; - - if (file_exists($dir.'/autoload.php')) { - require_once $dir.'/autoload.php'; - break; - } - - if (file_exists($dir.'/autoload.php.dist')) { - require_once $dir.'/autoload.php.dist'; - break; - } - - $dir = dirname($dir); -} - -use Symfony\Component\Config\Loader\LoaderInterface; -use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\HttpKernel\Kernel; - -/** - * App Test Kernel for functional tests. - * - * @author Johannes M. Schmitt - */ -class AppKernel extends Kernel -{ - private $testCase; - private $rootConfig; - - public function __construct($testCase, $rootConfig, $environment, $debug) - { - if (!is_dir(__DIR__.'/'.$testCase)) { - throw new \InvalidArgumentException(sprintf('The test case "%s" does not exist.', $testCase)); - } - $this->testCase = $testCase; - - $fs = new Filesystem(); - if (!$fs->isAbsolutePath($rootConfig) && !file_exists($rootConfig = __DIR__.'/'.$testCase.'/'.$rootConfig)) { - throw new \InvalidArgumentException(sprintf('The root config "%s" does not exist.', $rootConfig)); - } - $this->rootConfig = $rootConfig; - - parent::__construct($environment, $debug); - } - - public function registerBundles() - { - if (!file_exists($filename = $this->getRootDir().'/'.$this->testCase.'/bundles.php')) { - throw new \RuntimeException(sprintf('The bundles file "%s" does not exist.', $filename)); - } - - return include $filename; - } - - public function init() - { - } - - public function getRootDir() - { - return __DIR__; - } - - public function getCacheDir() - { - return sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$this->testCase.'/cache/'.$this->environment; - } - - public function getLogDir() - { - return sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$this->testCase.'/logs'; - } - - public function registerContainerConfiguration(LoaderInterface $loader) - { - $loader->load($this->rootConfig); - } - - public function serialize() - { - return serialize(array($this->testCase, $this->rootConfig, $this->getEnvironment(), $this->isDebug())); - } - - public function unserialize($str) - { - call_user_func_array(array($this, '__construct'), unserialize($str)); - } - - protected function getKernelParameters() - { - $parameters = parent::getKernelParameters(); - $parameters['kernel.test_case'] = $this->testCase; - - return $parameters; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/bundles.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/bundles.php deleted file mode 100644 index 351cf79..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/bundles.php +++ /dev/null @@ -1,9 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests; - -use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Bundle\FrameworkBundle\HttpKernel; -use Symfony\Component\EventDispatcher\EventDispatcher; - -class HttpKernelTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getProviderTypes - */ - public function testHandle($type) - { - $request = new Request(); - $expected = new Response(); - - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - $container - ->expects($this->once()) - ->method('enterScope') - ->with($this->equalTo('request')) - ; - $container - ->expects($this->once()) - ->method('leaveScope') - ->with($this->equalTo('request')) - ; - $container - ->expects($this->once()) - ->method('set') - ->with($this->equalTo('request'), $this->equalTo($request), $this->equalTo('request')) - ; - - $dispatcher = new EventDispatcher(); - $resolver = $this->getMock('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface'); - $kernel = new HttpKernel($dispatcher, $container, $resolver); - - $controller = function() use ($expected) { - return $expected; - }; - - $resolver->expects($this->once()) - ->method('getController') - ->with($request) - ->will($this->returnValue($controller)); - $resolver->expects($this->once()) - ->method('getArguments') - ->with($request, $controller) - ->will($this->returnValue(array())); - - $actual = $kernel->handle($request, $type); - - $this->assertSame($expected, $actual, '->handle() returns the response'); - } - - /** - * @dataProvider getProviderTypes - */ - public function testHandleRestoresThePreviousRequestOnException($type) - { - $request = new Request(); - $expected = new \Exception(); - - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - $container - ->expects($this->once()) - ->method('enterScope') - ->with($this->equalTo('request')) - ; - $container - ->expects($this->once()) - ->method('leaveScope') - ->with($this->equalTo('request')) - ; - $container - ->expects($this->once()) - ->method('set') - ->with($this->equalTo('request'), $this->equalTo($request), $this->equalTo('request')) - ; - - $dispatcher = new EventDispatcher(); - $resolver = $this->getMock('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface'); - $kernel = new HttpKernel($dispatcher, $container, $resolver); - - $controller = function() use ($expected) { - throw $expected; - }; - - $resolver->expects($this->once()) - ->method('getController') - ->with($request) - ->will($this->returnValue($controller)); - $resolver->expects($this->once()) - ->method('getArguments') - ->with($request, $controller) - ->will($this->returnValue(array())); - - try { - $kernel->handle($request, $type); - $this->fail('->handle() suppresses the controller exception'); - } catch (\Exception $actual) { - $this->assertSame($expected, $actual, '->handle() throws the controller exception'); - } - } - - public function testGenerateInternalUriHandlesNullValues() - { - $request = new Request(); - - $router = $this->getMock('Symfony\\Component\\Routing\\RouterInterface'); - $container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface'); - $container - ->expects($this->at(0)) - ->method('get') - ->with($this->equalTo('router')) - ->will($this->returnValue($router)) - ; - $container - ->expects($this->at('1')) - ->method('get') - ->with($this->equalTo('request')) - ->will($this->returnValue($request)) - ; - - $controller = 'AController'; - $attributes = array('anAttribute' => null); - $query = array('aQueryParam' => null); - - $expectedPath = 'none'; - - $routeParameters = array('controller' => $controller, 'path' => $expectedPath, '_format' => 'html'); - $router - ->expects($this->once()) - ->method('generate') - ->with($this->equalTo('_internal'), $this->equalTo($routeParameters)) - ->will($this->returnValue('GENERATED_URI')) - ; - - $dispatcher = new EventDispatcher(); - $resolver = $this->getMock('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface'); - $kernel = new HttpKernel($dispatcher, $container, $resolver); - - $uri = $kernel->generateInternalUri($controller, $attributes, $query); - $this->assertEquals('GENERATED_URI', $uri); - } - - public function getProviderTypes() - { - return array( - array(HttpKernelInterface::MASTER_REQUEST), - array(HttpKernelInterface::SUB_REQUEST), - ); - } - - public function testExceptionInSubRequestsDoesNotMangleOutputBuffers() - { - $request = new Request(); - - $container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface'); - $container - ->expects($this->at(0)) - ->method('getParameter') - ->with($this->equalTo('kernel.debug')) - ->will($this->returnValue(false)) - ; - $container - ->expects($this->at(1)) - ->method('has') - ->with($this->equalTo('esi')) - ->will($this->returnValue(false)) - ; - $container - ->expects($this->at(2)) - ->method('get') - ->with($this->equalTo('request')) - ->will($this->returnValue($request)) - ; - - $dispatcher = new EventDispatcher(); - $resolver = $this->getMock('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface'); - $resolver->expects($this->once()) - ->method('getController') - ->will($this->returnValue(function () { - ob_start(); - echo 'bar'; - throw new \RuntimeException(); - })); - $resolver->expects($this->once()) - ->method('getArguments') - ->will($this->returnValue(array())); - - $kernel = new HttpKernel($dispatcher, $container, $resolver); - - // simulate a main request with output buffering - ob_start(); - echo 'Foo'; - - // simulate a sub-request with output buffering and an exception - $kernel->render('/'); - - $this->assertEquals('Foo', ob_get_clean()); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RedirectableUrlMatcherTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RedirectableUrlMatcherTest.php deleted file mode 100644 index fe8fc70..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RedirectableUrlMatcherTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Routing; - -use Symfony\Component\Routing\Route; -use Symfony\Component\Routing\RouteCollection; -use Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher; -use Symfony\Component\Routing\RequestContext; - -class RedirectableUrlMatcherTest extends \PHPUnit_Framework_TestCase -{ - public function testRedirectWhenNoSlash() - { - $coll = new RouteCollection(); - $coll->add('foo', new Route('/foo/')); - - $matcher = new RedirectableUrlMatcher($coll, $context = new RequestContext()); - - $this->assertEquals(array( - '_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction', - 'path' => '/foo/', - 'permanent' => true, - 'scheme' => null, - 'httpPort' => $context->getHttpPort(), - 'httpsPort' => $context->getHttpsPort(), - '_route' => null, - ), - $matcher->match('/foo') - ); - } - - public function testSchemeRedirect() - { - $coll = new RouteCollection(); - $coll->add('foo', new Route('/foo', array(), array('_scheme' => 'https'))); - - $matcher = new RedirectableUrlMatcher($coll, $context = new RequestContext()); - - $this->assertEquals(array( - '_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction', - 'path' => '/foo', - 'permanent' => true, - 'scheme' => 'https', - 'httpPort' => $context->getHttpPort(), - 'httpsPort' => $context->getHttpsPort(), - '_route' => 'foo', - ), - $matcher->match('/foo') - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php deleted file mode 100644 index 2c6a031..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php +++ /dev/null @@ -1,189 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Routing; - -use Symfony\Bundle\FrameworkBundle\Routing\Router; -use Symfony\Component\Routing\Route; -use Symfony\Component\Routing\RouteCollection; - -class RoutingTest extends \PHPUnit_Framework_TestCase -{ - public function testDefaultsPlaceholders() - { - $routes = new RouteCollection(); - - $routes->add('foo', new Route( - '/foo', - array( - 'foo' => 'before_%parameter.foo%', - 'bar' => '%parameter.bar%_after', - 'baz' => '%%unescaped%%', - ), - array( - ) - )); - - $sc = $this->getServiceContainer($routes); - - $sc->expects($this->at(1))->method('hasParameter')->will($this->returnValue(true)); - $sc->expects($this->at(2))->method('getParameter')->will($this->returnValue('foo')); - $sc->expects($this->at(3))->method('hasParameter')->will($this->returnValue(true)); - $sc->expects($this->at(4))->method('getParameter')->will($this->returnValue('bar')); - - $router = new Router($sc, 'foo'); - $route = $router->getRouteCollection()->get('foo'); - - $this->assertEquals( - array( - 'foo' => 'before_foo', - 'bar' => 'bar_after', - 'baz' => '%unescaped%', - ), - $route->getDefaults() - ); - } - - public function testRequirementsPlaceholders() - { - $routes = new RouteCollection(); - - $routes->add('foo', new Route( - '/foo', - array( - ), - array( - 'foo' => 'before_%parameter.foo%', - 'bar' => '%parameter.bar%_after', - 'baz' => '%%unescaped%%', - ) - )); - - $sc = $this->getServiceContainer($routes); - - $sc->expects($this->at(1))->method('hasParameter')->with('parameter.foo')->will($this->returnValue(true)); - $sc->expects($this->at(2))->method('getParameter')->with('parameter.foo')->will($this->returnValue('foo')); - $sc->expects($this->at(3))->method('hasParameter')->with('parameter.bar')->will($this->returnValue(true)); - $sc->expects($this->at(4))->method('getParameter')->with('parameter.bar')->will($this->returnValue('bar')); - - $router = new Router($sc, 'foo'); - $route = $router->getRouteCollection()->get('foo'); - - $this->assertEquals( - array( - 'foo' => 'before_foo', - 'bar' => 'bar_after', - 'baz' => '%unescaped%', - ), - $route->getRequirements() - ); - } - - public function testPatternPlaceholders() - { - $routes = new RouteCollection(); - - $routes->add('foo', new Route('/before/%parameter.foo%/after/%%unescaped%%')); - - $sc = $this->getServiceContainer($routes); - - $sc->expects($this->at(1))->method('hasParameter')->with('parameter.foo')->will($this->returnValue(true)); - $sc->expects($this->at(2))->method('getParameter')->with('parameter.foo')->will($this->returnValue('foo')); - - $router = new Router($sc, 'foo'); - $route = $router->getRouteCollection()->get('foo'); - - $this->assertEquals( - '/before/foo/after/%unescaped%', - $route->getPattern() - ); - } - - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException - * @expectedExceptionMessage You have requested a non-existent parameter "nope". - */ - public function testExceptionOnNonExistentParameter() - { - $routes = new RouteCollection(); - - $routes->add('foo', new Route('/%nope%')); - - $sc = $this->getServiceContainer($routes); - - $sc->expects($this->at(1))->method('hasParameter')->with('nope')->will($this->returnValue(false)); - - $router = new Router($sc, 'foo'); - $router->getRouteCollection()->get('foo'); - } - - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException - * @expectedExceptionMessage A string value must be composed of strings and/or numbers,but found parameter "object" of type object inside string value "/%object%". - */ - public function testExceptionOnNonStringParameter() - { - $routes = new RouteCollection(); - - $routes->add('foo', new Route('/%object%')); - - $sc = $this->getServiceContainer($routes); - - $sc->expects($this->at(1))->method('hasParameter')->with('object')->will($this->returnValue(true)); - $sc->expects($this->at(2))->method('getParameter')->with('object')->will($this->returnValue(new \stdClass())); - - $router = new Router($sc, 'foo'); - $router->getRouteCollection()->get('foo'); - } - - /** - * @dataProvider getNonStringValues - */ - public function testDefaultValuesAsNonStrings($value) - { - $routes = new RouteCollection(); - $routes->add('foo', new Route('foo', array('foo' => $value), array('foo' => '\d+'))); - - $sc = $this->getServiceContainer($routes); - - $router = new Router($sc, 'foo'); - - $route = $router->getRouteCollection()->get('foo'); - - $this->assertSame($value, $route->getDefault('foo')); - } - - public function getNonStringValues() - { - return array(array(null), array(false), array(true), array(new \stdClass()), array(array('foo', 'bar'))); - } - - private function getServiceContainer(RouteCollection $routes) - { - $loader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface'); - - $loader - ->expects($this->any()) - ->method('load') - ->will($this->returnValue($routes)) - ; - - $sc = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface'); - - $sc - ->expects($this->once()) - ->method('get') - ->will($this->returnValue($loader)) - ; - - return $sc; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/CodeHelperTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/CodeHelperTest.php deleted file mode 100644 index 0d53544..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/CodeHelperTest.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper; - -use Symfony\Bundle\FrameworkBundle\Templating\Helper\CodeHelper; - -class CodeHelperTest extends \PHPUnit_Framework_TestCase -{ - protected static $helper; - - public static function setUpBeforeClass() - { - self::$helper = new CodeHelper('txmt://open?url=file://%f&line=%l', '/root', 'UTF-8'); - } - - public function testFormatFile() - { - $expected = sprintf('%s at line 25', __FILE__, __FILE__); - $this->assertEquals($expected, self::$helper->formatFile(__FILE__, 25)); - } - - /** - * @dataProvider getClassNameProvider - */ - public function testGettingClassAbbreviation($class, $abbr) - { - $this->assertEquals(self::$helper->abbrClass($class), $abbr); - } - - /** - * @dataProvider getMethodNameProvider - */ - public function testGettingMethodAbbreviation($method, $abbr) - { - $this->assertEquals(self::$helper->abbrMethod($method), $abbr); - } - - public function getClassNameProvider() - { - return array( - array('F\Q\N\Foo', 'Foo'), - array('Bare', 'Bare'), - ); - } - - public function getMethodNameProvider() - { - return array( - array('F\Q\N\Foo::Method', 'Foo::Method()'), - array('Bare::Method', 'Bare::Method()'), - array('Closure', 'Closure'), - array('Method', 'Method()') - ); - } - - public function testGetName() - { - $this->assertEquals('code', self::$helper->getName()); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Fixtures/StubTemplateNameParser.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Fixtures/StubTemplateNameParser.php deleted file mode 100644 index 3a66454..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Fixtures/StubTemplateNameParser.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper\Fixtures; - -use Symfony\Component\Templating\TemplateNameParserInterface; -use Symfony\Component\Templating\TemplateReference; - -class StubTemplateNameParser implements TemplateNameParserInterface -{ - private $root; - - private $rootTheme; - - public function __construct($root, $rootTheme) - { - $this->root = $root; - $this->rootTheme = $rootTheme; - } - - public function parse($name) - { - list($bundle, $controller, $template) = explode(':', $name, 3); - - if ($template[0] == '_') { - $path = $this->rootTheme.'/Custom/'.$template; - } elseif ($bundle === 'TestBundle') { - $path = $this->rootTheme.'/'.$controller.'/'.$template; - } else { - $path = $this->root.'/'.$controller.'/'.$template; - } - - return new TemplateReference($path, 'php'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Fixtures/StubTranslator.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Fixtures/StubTranslator.php deleted file mode 100644 index 17d1fd4..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Fixtures/StubTranslator.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper\Fixtures; - -use Symfony\Component\Translation\TranslatorInterface; - -class StubTranslator implements TranslatorInterface -{ - public function trans($id, array $parameters = array(), $domain = null, $locale = null) - { - return '[trans]'.$id.'[/trans]'; - } - - public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null) - { - return '[trans]'.$id.'[/trans]'; - } - - public function setLocale($locale) - { - } - - public function getLocale() - { - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php deleted file mode 100644 index cc38697..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper; - -use Symfony\Bundle\FrameworkBundle\Templating\Helper\FormHelper; -use Symfony\Bundle\FrameworkBundle\Templating\Helper\TranslatorHelper; -use Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper\Fixtures\StubTemplateNameParser; -use Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper\Fixtures\StubTranslator; -use Symfony\Component\Templating\PhpEngine; -use Symfony\Component\Templating\Loader\FilesystemLoader; -use Symfony\Component\Form\FormView; -use Symfony\Component\Form\FormRenderer; -use Symfony\Component\Form\Extension\Templating\TemplatingRendererEngine; -use Symfony\Component\Form\Tests\AbstractDivLayoutTest; - -class FormHelperDivLayoutTest extends AbstractDivLayoutTest -{ - protected $helper; - - protected function setUp() - { - parent::setUp(); - - $root = realpath(__DIR__.'/../../../Resources/views'); - $rootTheme = realpath(__DIR__.'/Resources'); - $templateNameParser = new StubTemplateNameParser($root, $rootTheme); - $loader = new FilesystemLoader(array()); - $engine = new PhpEngine($templateNameParser, $loader); - $engine->addGlobal('global', ''); - $rendererEngine = new TemplatingRendererEngine($engine, array('FrameworkBundle:Form')); - $renderer = new FormRenderer($rendererEngine, $this->getMock('Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface')); - - $this->helper = new FormHelper($renderer); - - $engine->setHelpers(array( - $this->helper, - new TranslatorHelper(new StubTranslator()), - )); - } - - protected function tearDown() - { - $this->helper = null; - } - - protected function renderEnctype(FormView $view) - { - return (string) $this->helper->enctype($view); - } - - protected function renderLabel(FormView $view, $label = null, array $vars = array()) - { - return (string) $this->helper->label($view, $label, $vars); - } - - protected function renderErrors(FormView $view) - { - return (string) $this->helper->errors($view); - } - - protected function renderWidget(FormView $view, array $vars = array()) - { - return (string) $this->helper->widget($view, $vars); - } - - protected function renderRow(FormView $view, array $vars = array()) - { - return (string) $this->helper->row($view, $vars); - } - - protected function renderRest(FormView $view, array $vars = array()) - { - return (string) $this->helper->rest($view, $vars); - } - - protected function setTheme(FormView $view, array $themes) - { - $this->helper->setTheme($view, $themes); - } - - public static function themeBlockInheritanceProvider() - { - return array( - array(array('TestBundle:Parent')) - ); - } - - public static function themeInheritanceProvider() - { - return array( - array(array('TestBundle:Parent'), array('TestBundle:Child')) - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php deleted file mode 100644 index ad8b74e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper; - -use Symfony\Bundle\FrameworkBundle\Templating\Helper\FormHelper; -use Symfony\Bundle\FrameworkBundle\Templating\Helper\TranslatorHelper; -use Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper\Fixtures\StubTemplateNameParser; -use Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper\Fixtures\StubTranslator; -use Symfony\Component\Form\FormView; -use Symfony\Component\Form\FormRenderer; -use Symfony\Component\Form\Extension\Templating\TemplatingRendererEngine; -use Symfony\Component\Form\Tests\AbstractTableLayoutTest; -use Symfony\Component\Templating\PhpEngine; -use Symfony\Component\Templating\Loader\FilesystemLoader; - -class FormHelperTableLayoutTest extends AbstractTableLayoutTest -{ - protected $helper; - - protected function setUp() - { - parent::setUp(); - - $root = realpath(__DIR__.'/../../../Resources/views'); - $rootTheme = realpath(__DIR__.'/Resources'); - $templateNameParser = new StubTemplateNameParser($root, $rootTheme); - $loader = new FilesystemLoader(array()); - $engine = new PhpEngine($templateNameParser, $loader); - $engine->addGlobal('global', ''); - $rendererEngine = new TemplatingRendererEngine($engine, array( - 'FrameworkBundle:Form', - 'FrameworkBundle:FormTable' - )); - $renderer = new FormRenderer($rendererEngine, $this->getMock('Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface')); - - $this->helper = new FormHelper($renderer); - - $engine->setHelpers(array( - $this->helper, - new TranslatorHelper(new StubTranslator()), - )); - } - - protected function tearDown() - { - $this->helper = null; - } - - protected function renderEnctype(FormView $view) - { - return (string) $this->helper->enctype($view); - } - - protected function renderLabel(FormView $view, $label = null, array $vars = array()) - { - return (string) $this->helper->label($view, $label, $vars); - } - - protected function renderErrors(FormView $view) - { - return (string) $this->helper->errors($view); - } - - protected function renderWidget(FormView $view, array $vars = array()) - { - return (string) $this->helper->widget($view, $vars); - } - - protected function renderRow(FormView $view, array $vars = array()) - { - return (string) $this->helper->row($view, $vars); - } - - protected function renderRest(FormView $view, array $vars = array()) - { - return (string) $this->helper->rest($view, $vars); - } - - protected function setTheme(FormView $view, array $themes) - { - $this->helper->setTheme($view, $themes); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/RequestHelperTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/RequestHelperTest.php deleted file mode 100644 index d3d4f22..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/RequestHelperTest.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Bundle\FrameworkBundle\Templating\Helper\RequestHelper; - -class RequestHelperTest extends \PHPUnit_Framework_TestCase -{ - protected $request; - - protected function setUp() - { - $this->request = new Request(); - $this->request->initialize(array('foobar' => 'bar')); - } - - protected function tearDown() - { - $this->request = null; - } - - public function testGetParameter() - { - $helper = new RequestHelper($this->request); - - $this->assertEquals('bar', $helper->getParameter('foobar')); - $this->assertEquals('foo', $helper->getParameter('bar', 'foo')); - - $this->assertNull($helper->getParameter('foo')); - } - - public function testGetLocale() - { - $helper = new RequestHelper($this->request); - - $this->assertEquals('en', $helper->getLocale()); - } - - public function testGetName() - { - $helper = new RequestHelper($this->request); - - $this->assertEquals('request', $helper->getName()); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Child/form_label.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Child/form_label.html.php deleted file mode 100644 index 0c1af40..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Child/form_label.html.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_entry_label.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_entry_label.html.php deleted file mode 100644 index 0efecf0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_entry_label.html.php +++ /dev/null @@ -1,2 +0,0 @@ -humanize($name); } ?> - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_text_id_widget.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_text_id_widget.html.php deleted file mode 100644 index 078fe57..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_text_id_widget.html.php +++ /dev/null @@ -1,3 +0,0 @@ -
    - widget($form) ?> -
    diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Parent/form_label.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Parent/form_label.html.php deleted file mode 100644 index 068c5de..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Parent/form_label.html.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Parent/form_widget_simple.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Parent/form_widget_simple.html.php deleted file mode 100644 index 3c6c158..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Parent/form_widget_simple.html.php +++ /dev/null @@ -1,2 +0,0 @@ - -block($form, 'widget_attributes') ?> value="" rel="theme" /> diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/SessionHelperTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/SessionHelperTest.php deleted file mode 100644 index 4bd043e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/SessionHelperTest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Session\Session; -use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; -use Symfony\Bundle\FrameworkBundle\Templating\Helper\SessionHelper; - -class SessionHelperTest extends \PHPUnit_Framework_TestCase -{ - protected $request; - - protected function setUp() - { - $this->request = new Request(); - - $session = new Session(new MockArraySessionStorage()); - $session->set('foobar', 'bar'); - $session->getFlashBag()->set('notice', 'bar'); - - $this->request->setSession($session); - } - - protected function tearDown() - { - $this->request = null; - } - - public function testFlash() - { - $helper = new SessionHelper($this->request); - - $this->assertTrue($helper->hasFlash('notice')); - - $this->assertEquals(array('bar'), $helper->getFlash('notice')); - } - - public function testGetFlashes() - { - $helper = new SessionHelper($this->request); - $this->assertEquals(array('notice' => array('bar')), $helper->getFlashes()); - } - - public function testGet() - { - $helper = new SessionHelper($this->request); - - $this->assertEquals('bar', $helper->get('foobar')); - $this->assertEquals('foo', $helper->get('bar', 'foo')); - - $this->assertNull($helper->get('foo')); - } - - public function testGetName() - { - $helper = new SessionHelper($this->request); - - $this->assertEquals('session', $helper->getName()); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Loader/TemplateLocatorTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Loader/TemplateLocatorTest.php deleted file mode 100644 index 1b28ec4..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Loader/TemplateLocatorTest.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Templating\Loader; - -use Symfony\Bundle\FrameworkBundle\Templating\Loader\TemplateLocator; -use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference; -use Symfony\Bundle\FrameworkBundle\Tests\TestCase; - -class TemplateLocatorTest extends TestCase -{ - public function testLocateATemplate() - { - $template = new TemplateReference('bundle', 'controller', 'name', 'format', 'engine'); - - $fileLocator = $this->getFileLocator(); - - $fileLocator - ->expects($this->once()) - ->method('locate') - ->with($template->getPath()) - ->will($this->returnValue('/path/to/template')) - ; - - $locator = new TemplateLocator($fileLocator); - - $this->assertEquals('/path/to/template', $locator->locate($template)); - } - - public function testThrowsExceptionWhenTemplateNotFound() - { - $template = new TemplateReference('bundle', 'controller', 'name', 'format', 'engine'); - - $fileLocator = $this->getFileLocator(); - - $errorMessage = 'FileLocator exception message'; - - $fileLocator - ->expects($this->once()) - ->method('locate') - ->will($this->throwException(new \InvalidArgumentException($errorMessage))) - ; - - $locator = new TemplateLocator($fileLocator); - - try { - $locator->locate($template); - $this->fail('->locate() should throw an exception when the file is not found.'); - } catch (\InvalidArgumentException $e) { - $this->assertContains( - $errorMessage, - $e->getMessage(), - 'TemplateLocator exception should propagate the FileLocator exception message' - ); - } - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testThrowsAnExceptionWhenTemplateIsNotATemplateReferenceInterface() - { - $locator = new TemplateLocator($this->getFileLocator()); - $locator->locate('template'); - } - - protected function getFileLocator() - { - return $this - ->getMockBuilder('Symfony\Component\Config\FileLocator') - ->setMethods(array('locate')) - ->setConstructorArgs(array('/path/to/fallback')) - ->getMock() - ; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/PhpEngineTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/PhpEngineTest.php deleted file mode 100644 index 476b398..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/PhpEngineTest.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Templating; - -use Symfony\Bundle\FrameworkBundle\Templating\PhpEngine; -use Symfony\Component\DependencyInjection\Container; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Session\Session; -use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; -use Symfony\Component\Templating\TemplateNameParser; -use Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables; -use Symfony\Bundle\FrameworkBundle\Tests\TestCase; - -class PhpEngineTest extends TestCase -{ - public function testEvaluateAddsAppGlobal() - { - $container = $this->getContainer(); - $loader = $this->getMockForAbstractClass('Symfony\Component\Templating\Loader\Loader'); - $engine = new PhpEngine(new TemplateNameParser(), $container, $loader, $app = new GlobalVariables($container)); - $globals = $engine->getGlobals(); - $this->assertSame($app, $globals['app']); - } - - public function testEvaluateWithoutAvailableRequest() - { - $container = new Container(); - $loader = $this->getMockForAbstractClass('Symfony\Component\Templating\Loader\Loader'); - $engine = new PhpEngine(new TemplateNameParser(), $container, $loader, new GlobalVariables($container)); - - $container->set('request', null); - - $globals = $engine->getGlobals(); - $this->assertEmpty($globals['app']->getRequest()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testGetInvalidHelper() - { - $container = $this->getContainer(); - $loader = $this->getMockForAbstractClass('Symfony\Component\Templating\Loader\Loader'); - $engine = new PhpEngine(new TemplateNameParser(), $container, $loader); - - $engine->get('non-existing-helper'); - } - - /** - * Creates a Container with a Session-containing Request service. - * - * @return Container - */ - protected function getContainer() - { - $container = new Container(); - $request = new Request(); - $session = new Session(new MockArraySessionStorage()); - - $request->setSession($session); - $container->set('request', $request); - - return $container; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateFilenameParserTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateFilenameParserTest.php deleted file mode 100644 index 77dd269..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateFilenameParserTest.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Templating; - -use Symfony\Bundle\FrameworkBundle\Tests\TestCase; -use Symfony\Bundle\FrameworkBundle\Templating\TemplateFilenameParser; -use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference; - -class TemplateFilenameParserTest extends TestCase -{ - protected $parser; - - protected function setUp() - { - $this->parser = new TemplateFilenameParser(); - } - - protected function tearDown() - { - $this->parser = null; - } - - /** - * @dataProvider getFilenameToTemplateProvider - */ - public function testParseFromFilename($file, $ref) - { - $template = $this->parser->parse($file); - - if ($ref === false) { - $this->assertFalse($template); - } else { - $this->assertEquals($template->getLogicalName(), $ref->getLogicalName()); - } - } - - public function getFilenameToTemplateProvider() - { - return array( - array('/path/to/section/name.format.engine', new TemplateReference('', '/path/to/section', 'name', 'format', 'engine')), - array('\\path\\to\\section\\name.format.engine', new TemplateReference('', '/path/to/section', 'name', 'format', 'engine')), - array('name.format.engine', new TemplateReference('', '', 'name', 'format', 'engine')), - array('name.format', false), - array('name', false), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateNameParserTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateNameParserTest.php deleted file mode 100644 index 2a1544c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateNameParserTest.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Templating; - -use Symfony\Bundle\FrameworkBundle\Tests\TestCase; -use Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser; -use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference; - -class TemplateNameParserTest extends TestCase -{ - protected $parser; - - protected function setUp() - { - $kernel = $this->getMock('Symfony\Component\HttpKernel\KernelInterface'); - $kernel - ->expects($this->any()) - ->method('getBundle') - ->will($this->returnCallback(function ($bundle) { - if (in_array($bundle, array('SensioFooBundle', 'SensioCmsFooBundle', 'FooBundle'))) { - return true; - } - - throw new \InvalidArgumentException(); - })) - ; - $this->parser = new TemplateNameParser($kernel); - } - - protected function tearDown() - { - $this->parser = null; - } - - /** - * @dataProvider getLogicalNameToTemplateProvider - */ - public function testParse($name, $ref) - { - $template = $this->parser->parse($name); - - $this->assertEquals($template->getLogicalName(), $ref->getLogicalName()); - $this->assertEquals($template->getLogicalName(), $name); - } - - public function getLogicalNameToTemplateProvider() - { - return array( - array('FooBundle:Post:index.html.php', new TemplateReference('FooBundle', 'Post', 'index', 'html', 'php')), - array('FooBundle:Post:index.html.twig', new TemplateReference('FooBundle', 'Post', 'index', 'html', 'twig')), - array('FooBundle:Post:index.xml.php', new TemplateReference('FooBundle', 'Post', 'index', 'xml', 'php')), - array('SensioFooBundle:Post:index.html.php', new TemplateReference('SensioFooBundle', 'Post', 'index', 'html', 'php')), - array('SensioCmsFooBundle:Post:index.html.php', new TemplateReference('SensioCmsFooBundle', 'Post', 'index', 'html', 'php')), - array(':Post:index.html.php', new TemplateReference('', 'Post', 'index', 'html', 'php')), - array('::index.html.php', new TemplateReference('', '', 'index', 'html', 'php')), - array('FooBundle:Post:foo.bar.index.html.php', new TemplateReference('FooBundle', 'Post', 'foo.bar.index', 'html', 'php')), - ); - } - - /** - * @dataProvider getInvalidLogicalNameProvider - * @expectedException \InvalidArgumentException - */ - public function testParseInvalidName($name) - { - $this->parser->parse($name); - } - - public function getInvalidLogicalNameProvider() - { - return array( - array('BarBundle:Post:index.html.php'), - array('FooBundle:Post:index'), - array('FooBundle:Post'), - array('FooBundle:Post:foo:bar'), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateReferenceTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateReferenceTest.php deleted file mode 100644 index 5ee2a8e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateReferenceTest.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Templating; - -use Symfony\Bundle\FrameworkBundle\Tests\TestCase; -use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference; - -class TemplateReferenceTest extends TestCase -{ - public function testGetPathWorksWithNamespacedControllers() - { - $reference = new TemplateReference('AcmeBlogBundle', 'Admin\Post', 'index', 'html', 'twig'); - - $this->assertSame( - '@AcmeBlogBundle/Resources/views/Admin/Post/index.html.twig', - $reference->getPath() - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateTest.php deleted file mode 100644 index c49010b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateTest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Templating; - -use Symfony\Bundle\FrameworkBundle\Tests\TestCase; -use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference; - -class TemplateTest extends TestCase -{ - /** - * @dataProvider getTemplateToPathProvider - */ - public function testGetPathForTemplatesInABundle($template, $path) - { - if ($template->get('bundle')) { - $this->assertEquals($template->getPath(), $path); - } - } - - /** - * @dataProvider getTemplateToPathProvider - */ - public function testGetPathForTemplatesOutOfABundle($template, $path) - { - if (!$template->get('bundle')) { - $this->assertEquals($template->getPath(), $path); - } - } - - public function getTemplateToPathProvider() - { - return array( - array(new TemplateReference('FooBundle', 'Post', 'index', 'html', 'php'), '@FooBundle/Resources/views/Post/index.html.php'), - array(new TemplateReference('FooBundle', '', 'index', 'html', 'twig'), '@FooBundle/Resources/views/index.html.twig'), - array(new TemplateReference('', 'Post', 'index', 'html', 'php'), 'views/Post/index.html.php'), - array(new TemplateReference('', '', 'index', 'html', 'php'), 'views/index.html.php'), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/TestCase.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/TestCase.php deleted file mode 100644 index 8e72430..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/TestCase.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests; - -class TestCase extends \PHPUnit_Framework_TestCase -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/PhpExtractorTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/PhpExtractorTest.php deleted file mode 100644 index 4305f0e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/PhpExtractorTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Translation; - -use Symfony\Bundle\FrameworkBundle\Tests\TestCase; -use Symfony\Bundle\FrameworkBundle\Translation\PhpExtractor; -use Symfony\Component\Translation\MessageCatalogue; - -class PhpExtractorTest extends TestCase -{ - public function testExtraction() - { - // Arrange - $extractor = new PhpExtractor(); - $extractor->setPrefix('prefix'); - $catalogue = new MessageCatalogue('en'); - - // Act - $extractor->extract(__DIR__.'/../Fixtures/Resources/views/', $catalogue); - - // Assert - $this->assertCount(1, $catalogue->all('messages'), '->extract() should find 1 translation'); - $this->assertTrue($catalogue->has('new key'), '->extract() should find at leat "new key" message'); - $this->assertEquals('prefixnew key', $catalogue->get('new key'), '->extract() should apply "prefix" as prefix'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php deleted file mode 100644 index 99751d1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php +++ /dev/null @@ -1,189 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Translation; - -use Symfony\Bundle\FrameworkBundle\Translation\Translator; -use Symfony\Component\Translation\MessageCatalogue; -use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\Translation\MessageSelector; - -class TranslatorTest extends \PHPUnit_Framework_TestCase -{ - protected $tmpDir; - - protected function setUp() - { - $this->tmpDir = sys_get_temp_dir().'/sf2_translation'; - $this->deleteTmpDir(); - } - - public function tearDown() - { - $this->deleteTmpDir(); - } - - protected function deleteTmpDir() - { - if (!file_exists($dir = $this->tmpDir)) { - return; - } - - $fs = new Filesystem(); - $fs->remove($dir); - } - - public function testTransWithoutCaching() - { - $translator = $this->getTranslator($this->getLoader()); - $translator->setLocale('fr'); - $translator->setFallbackLocale(array('en', 'es')); - - $this->assertEquals('foo (FR)', $translator->trans('foo')); - $this->assertEquals('bar (EN)', $translator->trans('bar')); - $this->assertEquals('foobar (ES)', $translator->trans('foobar')); - $this->assertEquals('choice 0 (EN)', $translator->transChoice('choice', 0)); - $this->assertEquals('no translation', $translator->trans('no translation')); - } - - public function testTransWithCaching() - { - // prime the cache - $translator = $this->getTranslator($this->getLoader(), array('cache_dir' => $this->tmpDir)); - $translator->setLocale('fr'); - $translator->setFallbackLocale(array('en', 'es')); - - $this->assertEquals('foo (FR)', $translator->trans('foo')); - $this->assertEquals('bar (EN)', $translator->trans('bar')); - $this->assertEquals('foobar (ES)', $translator->trans('foobar')); - $this->assertEquals('choice 0 (EN)', $translator->transChoice('choice', 0)); - $this->assertEquals('no translation', $translator->trans('no translation')); - - // do it another time as the cache is primed now - $loader = $this->getMock('Symfony\Component\Translation\Loader\LoaderInterface'); - $translator = $this->getTranslator($loader, array('cache_dir' => $this->tmpDir)); - $translator->setLocale('fr'); - $translator->setFallbackLocale(array('en', 'es')); - - $this->assertEquals('foo (FR)', $translator->trans('foo')); - $this->assertEquals('bar (EN)', $translator->trans('bar')); - $this->assertEquals('foobar (ES)', $translator->trans('foobar')); - $this->assertEquals('choice 0 (EN)', $translator->transChoice('choice', 0)); - $this->assertEquals('no translation', $translator->trans('no translation')); - } - - public function testGetLocale() - { - $request = $this->getMock('Symfony\Component\HttpFoundation\Request'); - - $request - ->expects($this->once()) - ->method('getLocale') - ->will($this->returnValue('en')) - ; - - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - - $container - ->expects($this->exactly(2)) - ->method('isScopeActive') - ->with('request') - ->will($this->onConsecutiveCalls(false, true)) - ; - - $container - ->expects($this->once()) - ->method('has') - ->with('request') - ->will($this->returnValue(true)) - ; - - $container - ->expects($this->once()) - ->method('get') - ->with('request') - ->will($this->returnValue($request)) - ; - - $translator = new Translator($container, new MessageSelector()); - - $this->assertNull($translator->getLocale()); - $this->assertSame('en', $translator->getLocale()); - } - - protected function getCatalogue($locale, $messages) - { - $catalogue = new MessageCatalogue($locale); - foreach ($messages as $key => $translation) { - $catalogue->set($key, $translation); - } - - return $catalogue; - } - - protected function getLoader() - { - $loader = $this->getMock('Symfony\Component\Translation\Loader\LoaderInterface'); - $loader - ->expects($this->at(0)) - ->method('load') - ->will($this->returnValue($this->getCatalogue('fr', array( - 'foo' => 'foo (FR)', - )))) - ; - $loader - ->expects($this->at(1)) - ->method('load') - ->will($this->returnValue($this->getCatalogue('en', array( - 'foo' => 'foo (EN)', - 'bar' => 'bar (EN)', - 'choice' => '{0} choice 0 (EN)|{1} choice 1 (EN)|]1,Inf] choice inf (EN)', - )))) - ; - $loader - ->expects($this->at(2)) - ->method('load') - ->will($this->returnValue($this->getCatalogue('es', array( - 'foobar' => 'foobar (ES)', - )))) - ; - - return $loader; - } - - protected function getContainer($loader) - { - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - $container - ->expects($this->any()) - ->method('get') - ->will($this->returnValue($loader)) - ; - - return $container; - } - - public function getTranslator($loader, $options = array()) - { - $translator = new Translator( - $this->getContainer($loader), - new MessageSelector(), - array('loader' => array('loader')), - $options - ); - - $translator->addResource('loader', 'foo', 'fr'); - $translator->addResource('loader', 'foo', 'en'); - $translator->addResource('loader', 'foo', 'es'); - - return $translator; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Validator/ConstraintValidatorFactoryTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Validator/ConstraintValidatorFactoryTest.php deleted file mode 100644 index 7dc3389..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Validator/ConstraintValidatorFactoryTest.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Validator; - -use Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory; -use Symfony\Component\DependencyInjection\Container; -use Symfony\Component\Validator\Constraints\Blank as BlankConstraint; - -class ConstraintValidatorFactoryTest extends \PHPUnit_Framework_TestCase -{ - public function testGetInstanceCreatesValidator() - { - $class = get_class($this->getMockForAbstractClass('Symfony\\Component\\Validator\\ConstraintValidator')); - - $constraint = $this->getMock('Symfony\\Component\\Validator\\Constraint'); - $constraint - ->expects($this->once()) - ->method('validatedBy') - ->will($this->returnValue($class)); - - $factory = new ConstraintValidatorFactory(new Container()); - $this->assertInstanceOf($class, $factory->getInstance($constraint)); - } - - public function testGetInstanceReturnsExistingValidator() - { - $factory = new ConstraintValidatorFactory(new Container()); - $v1 = $factory->getInstance(new BlankConstraint()); - $v2 = $factory->getInstance(new BlankConstraint()); - $this->assertSame($v1, $v2); - } - - public function testGetInstanceReturnsService() - { - $service = 'validator_constraint_service'; - $alias = 'validator_constraint_alias'; - $validator = new \stdClass(); - - // mock ContainerBuilder b/c it implements TaggedContainerInterface - $container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerBuilder'); - $container - ->expects($this->once()) - ->method('get') - ->with($service) - ->will($this->returnValue($validator)); - - $constraint = $this->getMock('Symfony\\Component\\Validator\\Constraint'); - $constraint - ->expects($this->once()) - ->method('validatedBy') - ->will($this->returnValue($alias)); - - $factory = new ConstraintValidatorFactory($container, array('validator_constraint_alias' => 'validator_constraint_service')); - $this->assertSame($validator, $factory->getInstance($constraint)); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Translation/PhpExtractor.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Translation/PhpExtractor.php deleted file mode 100644 index 1eb3605..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Translation/PhpExtractor.php +++ /dev/null @@ -1,123 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Translation; - -use Symfony\Component\Finder\Finder; -use Symfony\Component\Translation\MessageCatalogue; -use Symfony\Component\Translation\Extractor\ExtractorInterface; - -/** - * PhpExtractor extracts translation messages from a php template. - * - * @author Michel Salib - */ -class PhpExtractor implements ExtractorInterface -{ - const MESSAGE_TOKEN = 300; - const IGNORE_TOKEN = 400; - - /** - * Prefix for new found message. - * - * @var string - */ - private $prefix = ''; - - /** - * The sequence that captures translation messages. - * - * @var array - */ - protected $sequences = array( - array( - '$view', - '[', - '\'translator\'', - ']', - '->', - 'trans', - '(', - self::MESSAGE_TOKEN, - ')', - ), - ); - - /** - * {@inheritDoc} - */ - public function extract($directory, MessageCatalogue $catalog) - { - // load any existing translation files - $finder = new Finder(); - $files = $finder->files()->name('*.php')->in($directory); - foreach ($files as $file) { - $this->parseTokens(token_get_all(file_get_contents($file)), $catalog); - } - } - - /** - * {@inheritDoc} - */ - public function setPrefix($prefix) - { - $this->prefix = $prefix; - } - - /** - * Normalizes a token. - * - * @param mixed $token - * @return string - */ - protected function normalizeToken($token) - { - if (is_array($token)) { - return $token[1]; - } - - return $token; - } - - /** - * Extracts trans message from php tokens. - * - * @param array $tokens - * @param MessageCatalogue $catalog - */ - protected function parseTokens($tokens, MessageCatalogue $catalog) - { - foreach ($tokens as $key => $token) { - foreach ($this->sequences as $sequence) { - $message = ''; - - foreach ($sequence as $id => $item) { - if ($this->normalizeToken($tokens[$key + $id]) == $item) { - continue; - } elseif (self::MESSAGE_TOKEN == $item) { - $message = $this->normalizeToken($tokens[$key + $id]); - } elseif (self::IGNORE_TOKEN == $item) { - continue; - } else { - break; - } - } - - $message = trim($message, '\''); - - if ($message) { - $catalog->set($message, $this->prefix.$message); - break; - } - } - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php deleted file mode 100644 index aea1ec4..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Translation; - -use Symfony\Component\Finder\Finder; -use Symfony\Component\Translation\MessageCatalogue; -use Symfony\Component\Translation\Loader\LoaderInterface; - -/** - * TranslationLoader loads translation messages from translation files. - * - * @author Michel Salib - */ -class TranslationLoader -{ - /** - * Loaders used for import. - * - * @var array - */ - private $loaders = array(); - - /** - * Adds a loader to the translation extractor. - * @param string $format The format of the loader - * @param LoaderInterface $loader - */ - public function addLoader($format, LoaderInterface $loader) - { - $this->loaders[$format] = $loader; - } - - /** - * Loads translation messages from a directory to the catalogue. - * - * @param string $directory the directory to look into - * @param MessageCatalogue $catalogue the catalogue - */ - public function loadMessages($directory, MessageCatalogue $catalogue) - { - foreach ($this->loaders as $format => $loader) { - // load any existing translation files - $finder = new Finder(); - $extension = $catalogue->getLocale().'.'.$format; - $files = $finder->files()->name('*.'.$extension)->in($directory); - foreach ($files as $file) { - $domain = substr($file->getFileName(), 0, -1 * strlen($extension) - 1); - $catalogue->addCatalogue($loader->load($file->getPathname(), $catalogue->getLocale(), $domain)); - } - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php deleted file mode 100644 index 4d16bcf..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php +++ /dev/null @@ -1,148 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Translation; - -use Symfony\Component\Translation\Translator as BaseTranslator; -use Symfony\Component\Translation\MessageSelector; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\Config\ConfigCache; - -/** - * Translator. - * - * @author Fabien Potencier - */ -class Translator extends BaseTranslator -{ - protected $container; - protected $options; - protected $loaderIds; - - /** - * Constructor. - * - * Available options: - * - * * cache_dir: The cache directory (or null to disable caching) - * * debug: Whether to enable debugging or not (false by default) - * - * @param ContainerInterface $container A ContainerInterface instance - * @param MessageSelector $selector The message selector for pluralization - * @param array $loaderIds An array of loader Ids - * @param array $options An array of options - */ - public function __construct(ContainerInterface $container, MessageSelector $selector, $loaderIds = array(), array $options = array()) - { - $this->container = $container; - $this->loaderIds = $loaderIds; - - $this->options = array( - 'cache_dir' => null, - 'debug' => false, - ); - - // check option names - if ($diff = array_diff(array_keys($options), array_keys($this->options))) { - throw new \InvalidArgumentException(sprintf('The Translator does not support the following options: \'%s\'.', implode('\', \'', $diff))); - } - - $this->options = array_merge($this->options, $options); - - parent::__construct(null, $selector); - } - - /** - * {@inheritdoc} - */ - public function getLocale() - { - if (null === $this->locale && $this->container->isScopeActive('request') && $this->container->has('request')) { - $this->locale = $this->container->get('request')->getLocale(); - } - - return $this->locale; - } - - /** - * {@inheritdoc} - */ - protected function loadCatalogue($locale) - { - if (isset($this->catalogues[$locale])) { - return; - } - - if (null === $this->options['cache_dir']) { - $this->initialize(); - - return parent::loadCatalogue($locale); - } - - $cache = new ConfigCache($this->options['cache_dir'].'/catalogue.'.$locale.'.php', $this->options['debug']); - if (!$cache->isFresh()) { - $this->initialize(); - - parent::loadCatalogue($locale); - - $fallbackContent = ''; - $current = ''; - foreach ($this->computeFallbackLocales($locale) as $fallback) { - $fallbackContent .= sprintf(<<addFallbackCatalogue(\$catalogue%s); - - -EOF - , - ucfirst($fallback), - $fallback, - var_export($this->catalogues[$fallback]->all(), true), - ucfirst($current), - ucfirst($fallback) - ); - $current = $fallback; - } - - $content = sprintf(<<catalogues[$locale]->all(), true), - $fallbackContent - ); - - $cache->write($content, $this->catalogues[$locale]->getResources()); - - return; - } - - $this->catalogues[$locale] = include $cache; - } - - protected function initialize() - { - foreach ($this->loaderIds as $id => $aliases) { - foreach ($aliases as $alias) { - $this->addLoader($alias, $this->container->get($id)); - } - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Validator/ConstraintValidatorFactory.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Validator/ConstraintValidatorFactory.php deleted file mode 100644 index b42aca1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Validator/ConstraintValidatorFactory.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Validator; - -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\ConstraintValidatorFactoryInterface; - -/** - * Uses a service container to create constraint validators. - * - * A constraint validator should be tagged as "validator.constraint_validator" - * in the service container and include an "alias" attribute: - * - * - * - * - * - * - * A constraint may then return this alias in its validatedBy() method: - * - * public function validatedBy() - * { - * return 'some_alias'; - * } - * - * @author Kris Wallsmith - */ -class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface -{ - protected $container; - protected $validators; - - /** - * Constructor. - * - * @param ContainerInterface $container The service container - * @param array $validators An array of validators - */ - public function __construct(ContainerInterface $container, array $validators = array()) - { - $this->container = $container; - $this->validators = $validators; - } - - /** - * Returns the validator for the supplied constraint. - * - * @param Constraint $constraint A constraint - * - * @return Symfony\Component\Validator\ConstraintValidator A validator for the supplied constraint - */ - public function getInstance(Constraint $constraint) - { - $name = $constraint->validatedBy(); - - if (!isset($this->validators[$name])) { - $this->validators[$name] = new $name(); - } elseif (is_string($this->validators[$name])) { - $this->validators[$name] = $this->container->get($this->validators[$name]); - } - - return $this->validators[$name]; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/composer.json b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/composer.json deleted file mode 100644 index 55c4366..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/composer.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "symfony/framework-bundle", - "type": "symfony-bundle", - "description": "Symfony FrameworkBundle", - "keywords": [], - "homepage": "http://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "require": { - "php": ">=5.3.3", - "symfony/dependency-injection" : "self.version", - "symfony/config" : "self.version", - "symfony/event-dispatcher": "self.version", - "symfony/http-kernel": "self.version", - "symfony/filesystem": "self.version", - "symfony/routing": "self.version", - "symfony/templating": "self.version", - "symfony/translation": "self.version", - "doctrine/common": ">=2.2,<2.4-dev" - }, - "suggest": { - "symfony/console": "self.version", - "symfony/finder": "self.version", - "symfony/form": "self.version", - "symfony/validator": "self.version" - }, - "autoload": { - "psr-0": { "Symfony\\Bundle\\FrameworkBundle": "" } - }, - "target-dir": "Symfony/Bundle/FrameworkBundle", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md deleted file mode 100644 index 39926ae..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md +++ /dev/null @@ -1,77 +0,0 @@ -CHANGELOG -========= - -2.1.0 ------ - - * [BC BREAK] The custom factories for the firewall configuration are now - registered during the build method of bundles instead of being registered - by the end-user (you need to remove the 'factories' keys in your security - configuration). - - * [BC BREAK] The Firewall listener is now registered after the Router one. This - means that specific Firewall URLs (like /login_check and /logout must now - have proper route defined in your routing configuration) - - * [BC BREAK] refactored the user provider configuration. The configuration - changed for the chain provider and the memory provider: - - Before: - - ``` yaml - security: - providers: - my_chain_provider: - providers: [my_memory_provider, my_doctrine_provider] - my_memory_provider: - users: - toto: { password: foobar, roles: [ROLE_USER] } - foo: { password: bar, roles: [ROLE_USER, ROLE_ADMIN] } - ``` - - After: - - ``` yaml - security: - providers: - my_chain_provider: - chain: - providers: [my_memory_provider, my_doctrine_provider] - my_memory_provider: - memory: - users: - toto: { password: foobar, roles: [ROLE_USER] } - foo: { password: bar, roles: [ROLE_USER, ROLE_ADMIN] } - ``` - - * [BC BREAK] Method `equals` was removed from `UserInterface` to its own new - `EquatableInterface`. The user class can now implement this interface to override - the default implementation of users equality test. - - * added a validator for the user password - * added 'erase_credentials' as a configuration key (true by default) - * added new events: `security.authentication.success` and `security.authentication.failure` - fired on authentication success/failure, regardless of authentication method, - events are defined in new event class: `Symfony\Component\Security\Core\AuthenticationEvents`. - - * Added optional CSRF protection to LogoutListener: - - ``` yaml - security: - firewalls: - default: - logout: - path: /logout_path - target: / - csrf_parameter: _csrf_token # Optional (defaults to "_csrf_token") - csrf_provider: form.csrf_provider # Required to enable protection - intention: logout # Optional (defaults to "logout") - ``` - - If the LogoutListener has CSRF protection enabled but cannot validate a token, - then a LogoutException will be thrown. - - * Added `logout_url` templating helper and Twig extension, which may be used to - generate logout URL's within templates. The security firewall's config key - must be specified. If a firewall's logout listener has CSRF protection - enabled, a token will be automatically added to the generated URL. diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Command/InitAclCommand.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Command/InitAclCommand.php deleted file mode 100644 index eaa518f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Command/InitAclCommand.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Command; - -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; -use Symfony\Component\Security\Acl\Dbal\Schema; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Doctrine\DBAL\Schema\SchemaException; - -/** - * Installs the tables required by the ACL system - * - * @author Johannes M. Schmitt - */ -class InitAclCommand extends ContainerAwareCommand -{ - /** - * @see Command - */ - protected function configure() - { - $this - ->setName('init:acl') - ->setDescription('Mounts ACL tables in the database') - ->setHelp(<<%command.name% command mounts ACL tables in the database. - -php %command.full_name% - -The name of the DBAL connection must be configured in your app/config/security.yml configuration file in the security.acl.connection variable. - -security: - acl: - connection: default -EOF - ) - ; - } - - /** - * @see Command - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $container = $this->getContainer(); - - $connection = $container->get('security.acl.dbal.connection'); - $schema = $container->get('security.acl.dbal.schema'); - - try { - $schema->addToSchema($connection->getSchemaManager()->createSchema()); - } catch (SchemaException $e) { - $output->writeln("Aborting: " . $e->getMessage()); - - return; - } - - foreach ($schema->toSql($connection->getDatabasePlatform()) as $sql) { - $connection->exec($sql); - } - - $output->writeln('ACL tables have been initialized successfully.'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php deleted file mode 100644 index 609f8db..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\DataCollector; - -use Symfony\Component\Security\Core\SecurityContextInterface; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\DataCollector\DataCollector; - -/** - * SecurityDataCollector. - * - * @author Fabien Potencier - */ -class SecurityDataCollector extends DataCollector -{ - private $context; - - public function __construct(SecurityContextInterface $context = null) - { - $this->context = $context; - } - - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Exception $exception = null) - { - if (null === $this->context) { - $this->data = array( - 'enabled' => false, - 'authenticated' => false, - 'user' => '', - 'roles' => array(), - ); - } elseif (null === $token = $this->context->getToken()) { - $this->data = array( - 'enabled' => true, - 'authenticated' => false, - 'user' => '', - 'roles' => array(), - ); - } else { - $this->data = array( - 'enabled' => true, - 'authenticated' => $token->isAuthenticated(), - 'user' => $token->getUsername(), - 'roles' => array_map(function ($role){ return $role->getRole();}, $token->getRoles()), - ); - } - } - - /** - * Checks if security is enabled. - * - * @return Boolean true if security is enabled, false otherwise - */ - public function isEnabled() - { - return $this->data['enabled']; - } - - /** - * Gets the user. - * - * @return string The user - */ - public function getUser() - { - return $this->data['user']; - } - - /** - * Gets the roles of the user. - * - * @return array The roles - */ - public function getRoles() - { - return $this->data['roles']; - } - - /** - * Checks if the user is authenticated or not. - * - * @return Boolean true if the user is authenticated, false otherwise - */ - public function isAuthenticated() - { - return $this->data['authenticated']; - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'security'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSecurityVotersPass.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSecurityVotersPass.php deleted file mode 100644 index cfc6173..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSecurityVotersPass.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Adds all configured security voters to the access decision manager - * - * @author Johannes M. Schmitt - */ -class AddSecurityVotersPass implements CompilerPassInterface -{ - /** - * {@inheritDoc} - */ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('security.access.decision_manager')) { - return; - } - - $voters = new \SplPriorityQueue(); - foreach ($container->findTaggedServiceIds('security.voter') as $id => $attributes) { - $priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0; - $voters->insert(new Reference($id), $priority); - } - - $voters = iterator_to_array($voters); - ksort($voters); - - $container->getDefinition('security.access.decision_manager')->replaceArgument(0, array_values($voters)); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php deleted file mode 100644 index c7b631e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php +++ /dev/null @@ -1,391 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\DependencyInjection; - -use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory; - -use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; -use Symfony\Component\Config\Definition\ConfigurationInterface; - -/** - * This class contains the configuration information for the following tags: - * - * * security.config - * * security.acl - * - * This information is solely responsible for how the different configuration - * sections are normalized, and merged. - * - * @author Johannes M. Schmitt - */ -class MainConfiguration implements ConfigurationInterface -{ - private $factories; - private $userProviderFactories; - - /** - * Constructor. - * - * @param array $factories - * @param array $userProviderFactories - */ - public function __construct(array $factories, array $userProviderFactories) - { - $this->factories = $factories; - $this->userProviderFactories = $userProviderFactories; - } - - /** - * Generates the configuration tree builder. - * - * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder - */ - public function getConfigTreeBuilder() - { - $tb = new TreeBuilder(); - $rootNode = $tb->root('security'); - - $rootNode - ->children() - ->scalarNode('access_denied_url')->defaultNull()->example('/foo/error403')->end() - ->scalarNode('session_fixation_strategy')->cannotBeEmpty()->info('strategy can be: none, migrate, invalidate')->defaultValue('migrate')->end() - ->booleanNode('hide_user_not_found')->defaultTrue()->end() - ->booleanNode('always_authenticate_before_granting')->defaultFalse()->end() - ->booleanNode('erase_credentials')->defaultTrue()->end() - ->arrayNode('access_decision_manager') - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('strategy')->defaultValue('affirmative')->end() - ->booleanNode('allow_if_all_abstain')->defaultFalse()->end() - ->booleanNode('allow_if_equal_granted_denied')->defaultTrue()->end() - ->end() - ->end() - ->end() - ; - - $this->addAclSection($rootNode); - $this->addEncodersSection($rootNode); - $this->addProvidersSection($rootNode); - $this->addFirewallsSection($rootNode, $this->factories); - $this->addAccessControlSection($rootNode); - $this->addRoleHierarchySection($rootNode); - - return $tb; - } - - private function addAclSection(ArrayNodeDefinition $rootNode) - { - $rootNode - ->children() - ->arrayNode('acl') - ->children() - ->scalarNode('connection') - ->defaultNull() - ->info('any name configured in doctrine.dbal section') - ->end() - ->arrayNode('cache') - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('id')->end() - ->scalarNode('prefix')->defaultValue('sf2_acl_')->end() - ->end() - ->end() - ->scalarNode('provider')->end() - ->arrayNode('tables') - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('class')->defaultValue('acl_classes')->end() - ->scalarNode('entry')->defaultValue('acl_entries')->end() - ->scalarNode('object_identity')->defaultValue('acl_object_identities')->end() - ->scalarNode('object_identity_ancestors')->defaultValue('acl_object_identity_ancestors')->end() - ->scalarNode('security_identity')->defaultValue('acl_security_identities')->end() - ->end() - ->end() - ->arrayNode('voter') - ->addDefaultsIfNotSet() - ->children() - ->booleanNode('allow_if_object_identity_unavailable')->defaultTrue()->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ; - } - - private function addRoleHierarchySection(ArrayNodeDefinition $rootNode) - { - $rootNode - ->fixXmlConfig('role', 'role_hierarchy') - ->children() - ->arrayNode('role_hierarchy') - ->useAttributeAsKey('id') - ->prototype('array') - ->performNoDeepMerging() - ->beforeNormalization()->ifString()->then(function($v) { return array('value' => $v); })->end() - ->beforeNormalization() - ->ifTrue(function($v) { return is_array($v) && isset($v['value']); }) - ->then(function($v) { return preg_split('/\s*,\s*/', $v['value']); }) - ->end() - ->prototype('scalar')->end() - ->end() - ->end() - ->end() - ; - } - - private function addAccessControlSection(ArrayNodeDefinition $rootNode) - { - $rootNode - ->fixXmlConfig('rule', 'access_control') - ->children() - ->arrayNode('access_control') - ->cannotBeOverwritten() - ->prototype('array') - ->children() - ->scalarNode('requires_channel')->defaultNull()->end() - ->scalarNode('path') - ->defaultNull() - ->info('use the urldecoded format') - ->example('^/path to resource/') - ->end() - ->scalarNode('host')->defaultNull()->end() - ->scalarNode('ip')->defaultNull()->end() - ->arrayNode('methods') - ->beforeNormalization()->ifString()->then(function($v) { return preg_split('/\s*,\s*/', $v); })->end() - ->prototype('scalar')->end() - ->end() - ->end() - ->fixXmlConfig('role') - ->children() - ->arrayNode('roles') - ->beforeNormalization()->ifString()->then(function($v) { return preg_split('/\s*,\s*/', $v); })->end() - ->prototype('scalar')->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ; - } - - private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $factories) - { - $firewallNodeBuilder = $rootNode - ->fixXmlConfig('firewall') - ->children() - ->arrayNode('firewalls') - ->isRequired() - ->requiresAtLeastOneElement() - ->disallowNewKeysInSubsequentConfigs() - ->useAttributeAsKey('name') - ->prototype('array') - ->children() - ; - - $firewallNodeBuilder - ->scalarNode('pattern')->end() - ->booleanNode('security')->defaultTrue()->end() - ->scalarNode('request_matcher')->end() - ->scalarNode('access_denied_url')->end() - ->scalarNode('access_denied_handler')->end() - ->scalarNode('entry_point')->end() - ->scalarNode('provider')->end() - ->booleanNode('stateless')->defaultFalse()->end() - ->scalarNode('context')->cannotBeEmpty()->end() - ->arrayNode('logout') - ->treatTrueLike(array()) - ->canBeUnset() - ->children() - ->scalarNode('csrf_parameter')->defaultValue('_csrf_token')->end() - ->scalarNode('csrf_provider')->cannotBeEmpty()->end() - ->scalarNode('intention')->defaultValue('logout')->end() - ->scalarNode('path')->defaultValue('/logout')->end() - ->scalarNode('target')->defaultValue('/')->end() - ->scalarNode('success_handler')->end() - ->booleanNode('invalidate_session')->defaultTrue()->end() - ->end() - ->fixXmlConfig('delete_cookie') - ->children() - ->arrayNode('delete_cookies') - ->beforeNormalization() - ->ifTrue(function($v) { return is_array($v) && is_int(key($v)); }) - ->then(function($v) { return array_map(function($v) { return array('name' => $v); }, $v); }) - ->end() - ->useAttributeAsKey('name') - ->prototype('array') - ->children() - ->scalarNode('path')->defaultNull()->end() - ->scalarNode('domain')->defaultNull()->end() - ->end() - ->end() - ->end() - ->end() - ->fixXmlConfig('handler') - ->children() - ->arrayNode('handlers') - ->prototype('scalar')->end() - ->end() - ->end() - ->end() - ->arrayNode('anonymous') - ->canBeUnset() - ->children() - ->scalarNode('key')->defaultValue(uniqid())->end() - ->end() - ->end() - ->arrayNode('switch_user') - ->canBeUnset() - ->children() - ->scalarNode('provider')->end() - ->scalarNode('parameter')->defaultValue('_switch_user')->end() - ->scalarNode('role')->defaultValue('ROLE_ALLOWED_TO_SWITCH')->end() - ->end() - ->end() - ; - - $abstractFactoryKeys = array(); - foreach ($factories as $factoriesAtPosition) { - foreach ($factoriesAtPosition as $factory) { - $name = str_replace('-', '_', $factory->getKey()); - $factoryNode = $firewallNodeBuilder->arrayNode($name) - ->canBeUnset() - ; - - if ($factory instanceof AbstractFactory) { - $abstractFactoryKeys[] = $name; - } - - $factory->addConfiguration($factoryNode); - } - } - - // check for unreachable check paths - $firewallNodeBuilder - ->end() - ->validate() - ->ifTrue(function($v) { - return true === $v['security'] && isset($v['pattern']) && !isset($v['request_matcher']); - }) - ->then(function($firewall) use ($abstractFactoryKeys) { - foreach ($abstractFactoryKeys as $k) { - if (!isset($firewall[$k]['check_path'])) { - continue; - } - - if (false !== strpos('/', $firewall[$k]['check_path']) && !preg_match('#'.$firewall['pattern'].'#', $firewall[$k]['check_path'])) { - throw new \LogicException(sprintf('The check_path "%s" for login method "%s" is not matched by the firewall pattern "%s".', $firewall[$k]['check_path'], $k, $firewall['pattern'])); - } - } - - return $firewall; - }) - ->end() - ; - } - - private function addProvidersSection(ArrayNodeDefinition $rootNode) - { - $providerNodeBuilder = $rootNode - ->fixXmlConfig('provider') - ->children() - ->arrayNode('providers') - ->example(array( - 'memory' => array( - 'name' => 'memory', - 'memory' => array( - 'users' => array( - 'foo' => array('password' => 'foo', 'roles' => 'ROLE_USER'), - 'bar' => array('password' => 'bar', 'roles' => '[ROLE_USER, ROLE_ADMIN]') - ), - ) - ), - 'entity' => array('entity' => array('class' => 'SecurityBundle:User', 'property' => 'username')) - )) - ->disallowNewKeysInSubsequentConfigs() - ->isRequired() - ->requiresAtLeastOneElement() - ->useAttributeAsKey('name') - ->prototype('array') - ; - - $providerNodeBuilder - ->children() - ->scalarNode('id')->end() - ->arrayNode('chain') - ->fixXmlConfig('provider') - ->children() - ->arrayNode('providers') - ->beforeNormalization() - ->ifString() - ->then(function($v) { return preg_split('/\s*,\s*/', $v); }) - ->end() - ->prototype('scalar')->end() - ->end() - ->end() - ->end() - ->end() - ; - - foreach ($this->userProviderFactories as $factory) { - $name = str_replace('-', '_', $factory->getKey()); - $factoryNode = $providerNodeBuilder->children()->arrayNode($name)->canBeUnset(); - - $factory->addConfiguration($factoryNode); - } - - $providerNodeBuilder - ->validate() - ->ifTrue(function($v){return count($v) > 1;}) - ->thenInvalid('You cannot set multiple provider types for the same provider') - ->end() - ->validate() - ->ifTrue(function($v){return count($v) === 0;}) - ->thenInvalid('You must set a provider definition for the provider.') - ->end() - ; - } - - private function addEncodersSection(ArrayNodeDefinition $rootNode) - { - $rootNode - ->fixXmlConfig('encoder') - ->children() - ->arrayNode('encoders') - ->example(array( - 'Acme\DemoBundle\Entity\User1' => 'sha512', - 'Acme\DemoBundle\Entity\User2' => array( - 'algorithm' => 'sha512', - 'encode_as_base64' => 'true', - 'iterations'=> 5000 - ) - )) - ->requiresAtLeastOneElement() - ->useAttributeAsKey('class') - ->prototype('array') - ->canBeUnset() - ->performNoDeepMerging() - ->beforeNormalization()->ifString()->then(function($v) { return array('algorithm' => $v); })->end() - ->children() - ->scalarNode('algorithm')->cannotBeEmpty()->end() - ->booleanNode('ignore_case')->defaultFalse()->end() - ->booleanNode('encode_as_base64')->defaultTrue()->end() - ->scalarNode('iterations')->defaultValue(5000)->end() - ->scalarNode('id')->end() - ->end() - ->end() - ->end() - ->end() - ; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AbstractFactory.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AbstractFactory.php deleted file mode 100644 index 20f62c6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AbstractFactory.php +++ /dev/null @@ -1,197 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory; - -use Symfony\Component\Config\Definition\Builder\NodeDefinition; - -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * AbstractFactory is the base class for all classes inheriting from - * AbstractAuthenticationListener - * - * @author Lukas Kahwe Smith - * @author Johannes M. Schmitt - */ -abstract class AbstractFactory implements SecurityFactoryInterface -{ - protected $options = array( - 'check_path' => '/login_check', - 'use_forward' => false, - ); - - protected $defaultSuccessHandlerOptions = array( - 'always_use_default_target_path' => false, - 'default_target_path' => '/', - 'login_path' => '/login', - 'target_path_parameter' => '_target_path', - 'use_referer' => false, - ); - - protected $defaultFailureHandlerOptions = array( - 'failure_path' => null, - 'failure_forward' => false, - 'login_path' => '/login', - ); - - public function create(ContainerBuilder $container, $id, $config, $userProviderId, $defaultEntryPointId) - { - // authentication provider - $authProviderId = $this->createAuthProvider($container, $id, $config, $userProviderId); - - // authentication listener - $listenerId = $this->createListener($container, $id, $config, $userProviderId); - - // add remember-me aware tag if requested - if ($this->isRememberMeAware($config)) { - $container - ->getDefinition($listenerId) - ->addTag('security.remember_me_aware', array('id' => $id, 'provider' => $userProviderId)) - ; - } - - // create entry point if applicable (optional) - $entryPointId = $this->createEntryPoint($container, $id, $config, $defaultEntryPointId); - - return array($authProviderId, $listenerId, $entryPointId); - } - - public function addConfiguration(NodeDefinition $node) - { - $builder = $node->children(); - - $builder - ->scalarNode('provider')->end() - ->booleanNode('remember_me')->defaultTrue()->end() - ->scalarNode('success_handler')->end() - ->scalarNode('failure_handler')->end() - ; - - foreach (array_merge($this->options, $this->defaultSuccessHandlerOptions, $this->defaultFailureHandlerOptions) as $name => $default) { - if (is_bool($default)) { - $builder->booleanNode($name)->defaultValue($default); - } else { - $builder->scalarNode($name)->defaultValue($default); - } - } - } - - final public function addOption($name, $default = null) - { - $this->options[$name] = $default; - } - - /** - * Subclasses must return the id of a service which implements the - * AuthenticationProviderInterface. - * - * @param ContainerBuilder $container - * @param string $id The unique id of the firewall - * @param array $config The options array for this listener - * @param string $userProviderId The id of the user provider - * - * @return string never null, the id of the authentication provider - */ - abstract protected function createAuthProvider(ContainerBuilder $container, $id, $config, $userProviderId); - - /** - * Subclasses must return the id of the abstract listener template. - * - * Listener definitions should inherit from the AbstractAuthenticationListener - * like this: - * - * - * - * In the above case, this method would return "my.listener.id". - * - * @return string - */ - abstract protected function getListenerId(); - - /** - * Subclasses may create an entry point of their as they see fit. The - * default implementation does not change the default entry point. - * - * @param ContainerBuilder $container - * @param string $id - * @param array $config - * @param string $defaultEntryPointId - * - * @return string the entry point id - */ - protected function createEntryPoint($container, $id, $config, $defaultEntryPointId) - { - return $defaultEntryPointId; - } - - /** - * Subclasses may disable remember-me features for the listener, by - * always returning false from this method. - * - * @param array $config - * - * @return Boolean Whether a possibly configured RememberMeServices should be set for this listener - */ - protected function isRememberMeAware($config) - { - return $config['remember_me']; - } - - protected function createListener($container, $id, $config, $userProvider) - { - $listenerId = $this->getListenerId(); - $listener = new DefinitionDecorator($listenerId); - $listener->replaceArgument(4, $id); - $listener->replaceArgument(5, new Reference($this->createAuthenticationSuccessHandler($container, $id, $config))); - $listener->replaceArgument(6, new Reference($this->createAuthenticationFailureHandler($container, $id, $config))); - $listener->replaceArgument(7, array_intersect_key($config, $this->options)); - - $listenerId .= '.'.$id; - $container->setDefinition($listenerId, $listener); - - return $listenerId; - } - - protected function createAuthenticationSuccessHandler($container, $id, $config) - { - if (isset($config['success_handler'])) { - return $config['success_handler']; - } - - $successHandlerId = 'security.authentication.success_handler.'.$id.'.'.str_replace('-', '_', $this->getKey()); - - $successHandler = $container->setDefinition($successHandlerId, new DefinitionDecorator('security.authentication.success_handler')); - $successHandler->replaceArgument(1, array_intersect_key($config, $this->defaultSuccessHandlerOptions)); - $successHandler->addMethodCall('setProviderKey', array($id)); - - return $successHandlerId; - } - - protected function createAuthenticationFailureHandler($container, $id, $config) - { - if (isset($config['failure_handler'])) { - return $config['failure_handler']; - } - - $id = 'security.authentication.failure_handler.'.$id.'.'.str_replace('-', '_', $this->getKey()); - - $failureHandler = $container->setDefinition($id, new DefinitionDecorator('security.authentication.failure_handler')); - $failureHandler->replaceArgument(2, array_intersect_key($config, $this->defaultFailureHandlerOptions)); - - return $id; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FormLoginFactory.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FormLoginFactory.php deleted file mode 100644 index ce06bba..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FormLoginFactory.php +++ /dev/null @@ -1,100 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory; - -use Symfony\Component\Config\Definition\Builder\NodeDefinition; -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * FormLoginFactory creates services for form login authentication. - * - * @author Fabien Potencier - * @author Johannes M. Schmitt - */ -class FormLoginFactory extends AbstractFactory -{ - public function __construct() - { - $this->addOption('username_parameter', '_username'); - $this->addOption('password_parameter', '_password'); - $this->addOption('csrf_parameter', '_csrf_token'); - $this->addOption('intention', 'authenticate'); - $this->addOption('post_only', true); - } - - public function getPosition() - { - return 'form'; - } - - public function getKey() - { - return 'form-login'; - } - - public function addConfiguration(NodeDefinition $node) - { - parent::addConfiguration($node); - - $node - ->children() - ->scalarNode('csrf_provider')->cannotBeEmpty()->end() - ->end() - ; - } - - protected function getListenerId() - { - return 'security.authentication.listener.form'; - } - - protected function createAuthProvider(ContainerBuilder $container, $id, $config, $userProviderId) - { - $provider = 'security.authentication.provider.dao.'.$id; - $container - ->setDefinition($provider, new DefinitionDecorator('security.authentication.provider.dao')) - ->replaceArgument(0, new Reference($userProviderId)) - ->replaceArgument(2, $id) - ; - - return $provider; - } - - protected function createListener($container, $id, $config, $userProvider) - { - $listenerId = parent::createListener($container, $id, $config, $userProvider); - - if (isset($config['csrf_provider'])) { - $container - ->getDefinition($listenerId) - ->addArgument(new Reference($config['csrf_provider'])) - ; - } - - return $listenerId; - } - - protected function createEntryPoint($container, $id, $config, $defaultEntryPoint) - { - $entryPointId = 'security.authentication.form_entry_point.'.$id; - $container - ->setDefinition($entryPointId, new DefinitionDecorator('security.authentication.form_entry_point')) - ->addArgument(new Reference('security.http_utils')) - ->addArgument($config['login_path']) - ->addArgument($config['use_forward']) - ; - - return $entryPointId; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpBasicFactory.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpBasicFactory.php deleted file mode 100644 index c87f68c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpBasicFactory.php +++ /dev/null @@ -1,82 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory; - -use Symfony\Component\Config\Definition\Builder\NodeDefinition; - -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * HttpBasicFactory creates services for HTTP basic authentication. - * - * @author Fabien Potencier - */ -class HttpBasicFactory implements SecurityFactoryInterface -{ - public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint) - { - $provider = 'security.authentication.provider.dao.'.$id; - $container - ->setDefinition($provider, new DefinitionDecorator('security.authentication.provider.dao')) - ->replaceArgument(0, new Reference($userProvider)) - ->replaceArgument(2, $id) - ; - - // entry point - $entryPointId = $this->createEntryPoint($container, $id, $config, $defaultEntryPoint); - - // listener - $listenerId = 'security.authentication.listener.basic.'.$id; - $listener = $container->setDefinition($listenerId, new DefinitionDecorator('security.authentication.listener.basic')); - $listener->replaceArgument(2, $id); - $listener->replaceArgument(3, new Reference($entryPointId)); - - return array($provider, $listenerId, $entryPointId); - } - - public function getPosition() - { - return 'http'; - } - - public function getKey() - { - return 'http-basic'; - } - - public function addConfiguration(NodeDefinition $node) - { - $node - ->children() - ->scalarNode('provider')->end() - ->scalarNode('realm')->defaultValue('Secured Area')->end() - ->end() - ; - } - - protected function createEntryPoint($container, $id, $config, $defaultEntryPoint) - { - if (null !== $defaultEntryPoint) { - return $defaultEntryPoint; - } - - $entryPointId = 'security.authentication.basic_entry_point.'.$id; - $container - ->setDefinition($entryPointId, new DefinitionDecorator('security.authentication.basic_entry_point')) - ->addArgument($config['realm']) - ; - - return $entryPointId; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpDigestFactory.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpDigestFactory.php deleted file mode 100644 index 3a49b5d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpDigestFactory.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory; - -use Symfony\Component\Config\Definition\Builder\NodeDefinition; - -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * HttpDigestFactory creates services for HTTP digest authentication. - * - * @author Fabien Potencier - */ -class HttpDigestFactory implements SecurityFactoryInterface -{ - public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint) - { - $provider = 'security.authentication.provider.dao.'.$id; - $container - ->setDefinition($provider, new DefinitionDecorator('security.authentication.provider.dao')) - ->replaceArgument(0, new Reference($userProvider)) - ->replaceArgument(2, $id) - ; - - // entry point - $entryPointId = $this->createEntryPoint($container, $id, $config, $defaultEntryPoint); - - // listener - $listenerId = 'security.authentication.listener.digest.'.$id; - $listener = $container->setDefinition($listenerId, new DefinitionDecorator('security.authentication.listener.digest')); - $listener->replaceArgument(1, new Reference($userProvider)); - $listener->replaceArgument(2, $id); - $listener->replaceArgument(3, new Reference($entryPointId)); - - return array($provider, $listenerId, $entryPointId); - } - - public function getPosition() - { - return 'http'; - } - - public function getKey() - { - return 'http-digest'; - } - - public function addConfiguration(NodeDefinition $node) - { - $node - ->children() - ->scalarNode('provider')->end() - ->scalarNode('realm')->defaultValue('Secured Area')->end() - ->scalarNode('key')->isRequired()->cannotBeEmpty()->end() - ->end() - ; - } - - protected function createEntryPoint($container, $id, $config, $defaultEntryPoint) - { - if (null !== $defaultEntryPoint) { - return $defaultEntryPoint; - } - - $entryPointId = 'security.authentication.digest_entry_point.'.$id; - $container - ->setDefinition($entryPointId, new DefinitionDecorator('security.authentication.digest_entry_point')) - ->addArgument($config['realm']) - ->addArgument($config['key']) - ; - - return $entryPointId; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php deleted file mode 100644 index 08c4a33..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php +++ /dev/null @@ -1,143 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory; - -use Symfony\Component\Config\Definition\Builder\NodeDefinition; -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class RememberMeFactory implements SecurityFactoryInterface -{ - protected $options = array( - 'name' => 'REMEMBERME', - 'lifetime' => 31536000, - 'path' => '/', - 'domain' => null, - 'secure' => false, - 'httponly' => true, - 'always_remember_me' => false, - 'remember_me_parameter' => '_remember_me', - ); - - public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint) - { - // authentication provider - $authProviderId = 'security.authentication.provider.rememberme.'.$id; - $container - ->setDefinition($authProviderId, new DefinitionDecorator('security.authentication.provider.rememberme')) - ->addArgument($config['key']) - ->addArgument($id) - ; - - // remember me services - if (isset($config['token_provider'])) { - $templateId = 'security.authentication.rememberme.services.persistent'; - $rememberMeServicesId = $templateId.'.'.$id; - } else { - $templateId = 'security.authentication.rememberme.services.simplehash'; - $rememberMeServicesId = $templateId.'.'.$id; - } - - if ($container->hasDefinition('security.logout_listener.'.$id)) { - $container - ->getDefinition('security.logout_listener.'.$id) - ->addMethodCall('addHandler', array(new Reference($rememberMeServicesId))) - ; - } - - $rememberMeServices = $container->setDefinition($rememberMeServicesId, new DefinitionDecorator($templateId)); - $rememberMeServices->replaceArgument(1, $config['key']); - $rememberMeServices->replaceArgument(2, $id); - - if (isset($config['token_provider'])) { - $rememberMeServices->addMethodCall('setTokenProvider', array( - new Reference($config['token_provider']) - )); - } - - // remember-me options - $rememberMeServices->replaceArgument(3, array_intersect_key($config, $this->options)); - - // attach to remember-me aware listeners - $userProviders = array(); - foreach ($container->findTaggedServiceIds('security.remember_me_aware') as $serviceId => $attributes) { - foreach ($attributes as $attribute) { - if (!isset($attribute['id']) || $attribute['id'] !== $id) { - continue; - } - - if (!isset($attribute['provider'])) { - throw new \RuntimeException('Each "security.remember_me_aware" tag must have a provider attribute.'); - } - - $userProviders[] = new Reference($attribute['provider']); - $container - ->getDefinition($serviceId) - ->addMethodCall('setRememberMeServices', array(new Reference($rememberMeServicesId))) - ; - } - } - if ($config['user_providers']) { - $userProviders = array(); - foreach ($config['user_providers'] as $providerName) { - $userProviders[] = new Reference('security.user.provider.concrete.'.$providerName); - } - } - if (count($userProviders) === 0) { - throw new \RuntimeException('You must configure at least one remember-me aware listener (such as form-login) for each firewall that has remember-me enabled.'); - } - $rememberMeServices->replaceArgument(0, $userProviders); - - // remember-me listener - $listenerId = 'security.authentication.listener.rememberme.'.$id; - $listener = $container->setDefinition($listenerId, new DefinitionDecorator('security.authentication.listener.rememberme')); - $listener->replaceArgument(1, new Reference($rememberMeServicesId)); - - return array($authProviderId, $listenerId, $defaultEntryPoint); - } - - public function getPosition() - { - return 'remember_me'; - } - - public function getKey() - { - return 'remember-me'; - } - - public function addConfiguration(NodeDefinition $node) - { - $node->fixXmlConfig('user_provider'); - $builder = $node->children(); - - $builder - ->scalarNode('key')->isRequired()->cannotBeEmpty()->end() - ->scalarNode('token_provider')->end() - ->arrayNode('user_providers') - ->beforeNormalization() - ->ifString()->then(function($v) { return array($v); }) - ->end() - ->prototype('scalar')->end() - ->end() - ; - - foreach ($this->options as $name => $value) { - if (is_bool($value)) { - $builder->booleanNode($name)->defaultValue($value); - } else { - $builder->scalarNode($name)->defaultValue($value); - } - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SecurityFactoryInterface.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SecurityFactoryInterface.php deleted file mode 100644 index 5e8773b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SecurityFactoryInterface.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory; - -use Symfony\Component\Config\Definition\Builder\NodeDefinition; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * SecurityFactoryInterface is the interface for all security authentication listener. - * - * @author Fabien Potencier - */ -interface SecurityFactoryInterface -{ - public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint); - - public function getPosition(); - - public function getKey(); - - public function addConfiguration(NodeDefinition $builder); -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/X509Factory.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/X509Factory.php deleted file mode 100644 index d24942b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/X509Factory.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory; - -use Symfony\Component\Config\Definition\Builder\NodeDefinition; - -use Symfony\Component\DependencyInjection\DefinitionDecorator; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * X509Factory creates services for X509 certificate authentication. - * - * @author Fabien Potencier - */ -class X509Factory implements SecurityFactoryInterface -{ - public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint) - { - $provider = 'security.authentication.provider.pre_authenticated.'.$id; - $container - ->setDefinition($provider, new DefinitionDecorator('security.authentication.provider.pre_authenticated')) - ->replaceArgument(0, new Reference($userProvider)) - ->addArgument($id) - ; - - // listener - $listenerId = 'security.authentication.listener.x509.'.$id; - $listener = $container->setDefinition($listenerId, new DefinitionDecorator('security.authentication.listener.x509')); - $listener->replaceArgument(2, $id); - $listener->replaceArgument(3, $config['user']); - $listener->replaceArgument(4, $config['credentials']); - - return array($provider, $listenerId, $defaultEntryPoint); - } - - public function getPosition() - { - return 'pre_auth'; - } - - public function getKey() - { - return 'x509'; - } - - public function addConfiguration(NodeDefinition $node) - { - $node - ->children() - ->scalarNode('provider')->end() - ->scalarNode('user')->defaultValue('SSL_CLIENT_S_DN_Email')->end() - ->scalarNode('credentials')->defaultValue('SSL_CLIENT_S_DN')->end() - ->end() - ; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/UserProvider/InMemoryFactory.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/UserProvider/InMemoryFactory.php deleted file mode 100644 index bab1bb4..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/UserProvider/InMemoryFactory.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider; - -use Symfony\Component\Config\Definition\Builder\NodeDefinition; - -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * InMemoryFactory creates services for the memory provider. - * - * @author Fabien Potencier - * @author Christophe Coevoet - */ -class InMemoryFactory implements UserProviderFactoryInterface -{ - public function create(ContainerBuilder $container, $id, $config) - { - $definition = $container->setDefinition($id, new DefinitionDecorator('security.user.provider.in_memory')); - - foreach ($config['users'] as $username => $user) { - $userId = $id.'_'.$username; - - $container - ->setDefinition($userId, new DefinitionDecorator('security.user.provider.in_memory.user')) - ->setArguments(array($username, (string) $user['password'], $user['roles'])) - ; - - $definition->addMethodCall('createUser', array(new Reference($userId))); - } - } - - public function getKey() - { - return 'memory'; - } - - public function addConfiguration(NodeDefinition $node) - { - $node - ->fixXmlConfig('user') - ->children() - ->arrayNode('users') - ->useAttributeAsKey('name') - ->prototype('array') - ->children() - ->scalarNode('password')->defaultValue(uniqid())->end() - ->arrayNode('roles') - ->beforeNormalization()->ifString()->then(function($v) { return preg_split('/\s*,\s*/', $v); })->end() - ->prototype('scalar')->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/UserProvider/UserProviderFactoryInterface.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/UserProvider/UserProviderFactoryInterface.php deleted file mode 100644 index df25035..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/UserProvider/UserProviderFactoryInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider; - -use Symfony\Component\Config\Definition\Builder\NodeDefinition; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * UserProviderFactoryInterface is the interface for all user provider factories. - * - * @author Fabien Potencier - * @author Christophe Coevoet - */ -interface UserProviderFactoryInterface -{ - public function create(ContainerBuilder $container, $id, $config); - - public function getKey(); - - public function addConfiguration(NodeDefinition $builder); -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php deleted file mode 100644 index de1001a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php +++ /dev/null @@ -1,631 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\DependencyInjection; - -use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface; -use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\UserProviderFactoryInterface; -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\Alias; -use Symfony\Component\HttpKernel\DependencyInjection\Extension; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Parameter; -use Symfony\Component\Config\FileLocator; - -/** - * SecurityExtension. - * - * @author Fabien Potencier - * @author Johannes M. Schmitt - */ -class SecurityExtension extends Extension -{ - private $requestMatchers = array(); - private $contextListeners = array(); - private $listenerPositions = array('pre_auth', 'form', 'http', 'remember_me'); - private $factories = array(); - private $userProviderFactories = array(); - - public function __construct() - { - foreach ($this->listenerPositions as $position) { - $this->factories[$position] = array(); - } - } - - public function load(array $configs, ContainerBuilder $container) - { - if (!array_filter($configs)) { - return; - } - - $mainConfig = $this->getConfiguration($configs, $container); - - $config = $this->processConfiguration($mainConfig, $configs); - - // load services - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('security.xml'); - $loader->load('security_listeners.xml'); - $loader->load('security_rememberme.xml'); - $loader->load('templating_php.xml'); - $loader->load('templating_twig.xml'); - $loader->load('collectors.xml'); - - // set some global scalars - $container->setParameter('security.access.denied_url', $config['access_denied_url']); - $container->setParameter('security.authentication.manager.erase_credentials', $config['erase_credentials']); - $container->setParameter('security.authentication.session_strategy.strategy', $config['session_fixation_strategy']); - $container - ->getDefinition('security.access.decision_manager') - ->addArgument($config['access_decision_manager']['strategy']) - ->addArgument($config['access_decision_manager']['allow_if_all_abstain']) - ->addArgument($config['access_decision_manager']['allow_if_equal_granted_denied']) - ; - $container->setParameter('security.access.always_authenticate_before_granting', $config['always_authenticate_before_granting']); - $container->setParameter('security.authentication.hide_user_not_found', $config['hide_user_not_found']); - - $this->createFirewalls($config, $container); - $this->createAuthorization($config, $container); - $this->createRoleHierarchy($config, $container); - - if ($config['encoders']) { - $this->createEncoders($config['encoders'], $container); - } - - // load ACL - if (isset($config['acl'])) { - $this->aclLoad($config['acl'], $container); - } - - // add some required classes for compilation - $this->addClassesToCompile(array( - 'Symfony\\Component\\Security\\Http\\Firewall', - 'Symfony\\Component\\Security\\Core\\SecurityContext', - 'Symfony\\Component\\Security\\Core\\User\\UserProviderInterface', - 'Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationProviderManager', - 'Symfony\\Component\\Security\\Core\\Authorization\\AccessDecisionManager', - 'Symfony\\Component\\Security\\Core\\Authorization\\Voter\\VoterInterface', - 'Symfony\\Bundle\\SecurityBundle\\Security\\FirewallMap', - 'Symfony\\Bundle\\SecurityBundle\\Security\\FirewallContext', - 'Symfony\\Component\\HttpFoundation\\RequestMatcher', - )); - } - - private function aclLoad($config, ContainerBuilder $container) - { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('security_acl.xml'); - - if (isset($config['cache']['id'])) { - $container->setAlias('security.acl.cache', $config['cache']['id']); - } - $container->getDefinition('security.acl.voter.basic_permissions')->addArgument($config['voter']['allow_if_object_identity_unavailable']); - - // custom ACL provider - if (isset($config['provider'])) { - $container->setAlias('security.acl.provider', $config['provider']); - - return; - } - - $this->configureDbalAclProvider($config, $container, $loader); - } - - private function configureDbalAclProvider(array $config, ContainerBuilder $container, $loader) - { - $loader->load('security_acl_dbal.xml'); - - if (null !== $config['connection']) { - $container->setAlias('security.acl.dbal.connection', sprintf('doctrine.dbal.%s_connection', $config['connection'])); - } - - $container - ->getDefinition('security.acl.dbal.schema_listener') - ->addTag('doctrine.event_listener', array( - 'connection' => $config['connection'], - 'event' => 'postGenerateSchema', - 'lazy' => true - )) - ; - - $container->getDefinition('security.acl.cache.doctrine')->addArgument($config['cache']['prefix']); - - $container->setParameter('security.acl.dbal.class_table_name', $config['tables']['class']); - $container->setParameter('security.acl.dbal.entry_table_name', $config['tables']['entry']); - $container->setParameter('security.acl.dbal.oid_table_name', $config['tables']['object_identity']); - $container->setParameter('security.acl.dbal.oid_ancestors_table_name', $config['tables']['object_identity_ancestors']); - $container->setParameter('security.acl.dbal.sid_table_name', $config['tables']['security_identity']); - } - - /** - * Loads the web configuration. - * - * @param array $config An array of configuration settings - * @param ContainerBuilder $container A ContainerBuilder instance - */ - - private function createRoleHierarchy($config, ContainerBuilder $container) - { - if (!isset($config['role_hierarchy'])) { - $container->removeDefinition('security.access.role_hierarchy_voter'); - - return; - } - - $container->setParameter('security.role_hierarchy.roles', $config['role_hierarchy']); - $container->removeDefinition('security.access.simple_role_voter'); - } - - private function createAuthorization($config, ContainerBuilder $container) - { - if (!$config['access_control']) { - return; - } - - $this->addClassesToCompile(array( - 'Symfony\\Component\\Security\\Http\\AccessMap', - )); - - foreach ($config['access_control'] as $access) { - $matcher = $this->createRequestMatcher( - $container, - $access['path'], - $access['host'], - count($access['methods']) === 0 ? null : $access['methods'], - $access['ip'] - ); - - $container->getDefinition('security.access_map') - ->addMethodCall('add', array($matcher, $access['roles'], $access['requires_channel'])); - } - } - - private function createFirewalls($config, ContainerBuilder $container) - { - if (!isset($config['firewalls'])) { - return; - } - - $firewalls = $config['firewalls']; - $providerIds = $this->createUserProviders($config, $container); - - // make the ContextListener aware of the configured user providers - $definition = $container->getDefinition('security.context_listener'); - $arguments = $definition->getArguments(); - $userProviders = array(); - foreach ($providerIds as $userProviderId) { - $userProviders[] = new Reference($userProviderId); - } - $arguments[1] = $userProviders; - $definition->setArguments($arguments); - - // load firewall map - $mapDef = $container->getDefinition('security.firewall.map'); - $map = $authenticationProviders = array(); - foreach ($firewalls as $name => $firewall) { - list($matcher, $listeners, $exceptionListener) = $this->createFirewall($container, $name, $firewall, $authenticationProviders, $providerIds); - - $contextId = 'security.firewall.map.context.'.$name; - $context = $container->setDefinition($contextId, new DefinitionDecorator('security.firewall.context')); - $context - ->replaceArgument(0, $listeners) - ->replaceArgument(1, $exceptionListener) - ; - $map[$contextId] = $matcher; - } - $mapDef->replaceArgument(1, $map); - - // add authentication providers to authentication manager - $authenticationProviders = array_map(function($id) { - return new Reference($id); - }, array_values(array_unique($authenticationProviders))); - $container - ->getDefinition('security.authentication.manager') - ->replaceArgument(0, $authenticationProviders) - ; - } - - private function createFirewall(ContainerBuilder $container, $id, $firewall, &$authenticationProviders, $providerIds) - { - // Matcher - $i = 0; - $matcher = null; - if (isset($firewall['request_matcher'])) { - $matcher = new Reference($firewall['request_matcher']); - } elseif (isset($firewall['pattern'])) { - $matcher = $this->createRequestMatcher($container, $firewall['pattern']); - } - - // Security disabled? - if (false === $firewall['security']) { - return array($matcher, array(), null); - } - - // Provider id (take the first registered provider if none defined) - if (isset($firewall['provider'])) { - $defaultProvider = $this->getUserProviderId($firewall['provider']); - } else { - $defaultProvider = reset($providerIds); - } - - // Register listeners - $listeners = array(); - - // Channel listener - $listeners[] = new Reference('security.channel_listener'); - - // Context serializer listener - if (false === $firewall['stateless']) { - $contextKey = $id; - if (isset($firewall['context'])) { - $contextKey = $firewall['context']; - } - - $listeners[] = new Reference($this->createContextListener($container, $contextKey)); - } - - // Logout listener - if (isset($firewall['logout'])) { - $listenerId = 'security.logout_listener.'.$id; - $listener = $container->setDefinition($listenerId, new DefinitionDecorator('security.logout_listener')); - $listener->replaceArgument(3, array( - 'csrf_parameter' => $firewall['logout']['csrf_parameter'], - 'intention' => $firewall['logout']['intention'], - 'logout_path' => $firewall['logout']['path'], - )); - $listeners[] = new Reference($listenerId); - - // add logout success handler - if (isset($firewall['logout']['success_handler'])) { - $logoutSuccessHandlerId = $firewall['logout']['success_handler']; - } else { - $logoutSuccessHandlerId = 'security.logout.success_handler.'.$id; - $logoutSuccessHandler = $container->setDefinition($logoutSuccessHandlerId, new DefinitionDecorator('security.logout.success_handler')); - $logoutSuccessHandler->replaceArgument(1, $firewall['logout']['target']); - } - $listener->replaceArgument(2, new Reference($logoutSuccessHandlerId)); - - // add CSRF provider - if (isset($firewall['logout']['csrf_provider'])) { - $listener->addArgument(new Reference($firewall['logout']['csrf_provider'])); - } - - // add session logout handler - if (true === $firewall['logout']['invalidate_session'] && false === $firewall['stateless']) { - $listener->addMethodCall('addHandler', array(new Reference('security.logout.handler.session'))); - } - - // add cookie logout handler - if (count($firewall['logout']['delete_cookies']) > 0) { - $cookieHandlerId = 'security.logout.handler.cookie_clearing.'.$id; - $cookieHandler = $container->setDefinition($cookieHandlerId, new DefinitionDecorator('security.logout.handler.cookie_clearing')); - $cookieHandler->addArgument($firewall['logout']['delete_cookies']); - - $listener->addMethodCall('addHandler', array(new Reference($cookieHandlerId))); - } - - // add custom handlers - foreach ($firewall['logout']['handlers'] as $handlerId) { - $listener->addMethodCall('addHandler', array(new Reference($handlerId))); - } - - // register with LogoutUrlHelper - $container - ->getDefinition('templating.helper.logout_url') - ->addMethodCall('registerListener', array( - $id, - $firewall['logout']['path'], - $firewall['logout']['intention'], - $firewall['logout']['csrf_parameter'], - isset($firewall['logout']['csrf_provider']) ? new Reference($firewall['logout']['csrf_provider']) : null, - )) - ; - } - - // Authentication listeners - list($authListeners, $defaultEntryPoint) = $this->createAuthenticationListeners($container, $id, $firewall, $authenticationProviders, $defaultProvider); - - $listeners = array_merge($listeners, $authListeners); - - // Access listener - $listeners[] = new Reference('security.access_listener'); - - // Switch user listener - if (isset($firewall['switch_user'])) { - $listeners[] = new Reference($this->createSwitchUserListener($container, $id, $firewall['switch_user'], $defaultProvider)); - } - - // Determine default entry point - if (isset($firewall['entry_point'])) { - $defaultEntryPoint = $firewall['entry_point']; - } - - // Exception listener - $exceptionListener = new Reference($this->createExceptionListener($container, $firewall, $id, $defaultEntryPoint)); - - return array($matcher, $listeners, $exceptionListener); - } - - private function createContextListener($container, $contextKey) - { - if (isset($this->contextListeners[$contextKey])) { - return $this->contextListeners[$contextKey]; - } - - $listenerId = 'security.context_listener.'.count($this->contextListeners); - $listener = $container->setDefinition($listenerId, new DefinitionDecorator('security.context_listener')); - $listener->replaceArgument(2, $contextKey); - - return $this->contextListeners[$contextKey] = $listenerId; - } - - private function createAuthenticationListeners($container, $id, $firewall, &$authenticationProviders, $defaultProvider) - { - $listeners = array(); - $hasListeners = false; - $defaultEntryPoint = null; - - foreach ($this->listenerPositions as $position) { - foreach ($this->factories[$position] as $factory) { - $key = str_replace('-', '_', $factory->getKey()); - - if (isset($firewall[$key])) { - $userProvider = isset($firewall[$key]['provider']) ? $this->getUserProviderId($firewall[$key]['provider']) : $defaultProvider; - - list($provider, $listenerId, $defaultEntryPoint) = $factory->create($container, $id, $firewall[$key], $userProvider, $defaultEntryPoint); - - $listeners[] = new Reference($listenerId); - $authenticationProviders[] = $provider; - $hasListeners = true; - } - } - } - - // Anonymous - if (isset($firewall['anonymous'])) { - $listenerId = 'security.authentication.listener.anonymous.'.$id; - $container - ->setDefinition($listenerId, new DefinitionDecorator('security.authentication.listener.anonymous')) - ->replaceArgument(1, $firewall['anonymous']['key']) - ; - - $listeners[] = new Reference($listenerId); - - $providerId = 'security.authentication.provider.anonymous.'.$id; - $container - ->setDefinition($providerId, new DefinitionDecorator('security.authentication.provider.anonymous')) - ->replaceArgument(0, $firewall['anonymous']['key']) - ; - - $authenticationProviders[] = $providerId; - $hasListeners = true; - } - - if (false === $hasListeners) { - throw new \LogicException(sprintf('No authentication listener registered for firewall "%s".', $id)); - } - - return array($listeners, $defaultEntryPoint); - } - - private function createEncoders($encoders, ContainerBuilder $container) - { - $encoderMap = array(); - foreach ($encoders as $class => $encoder) { - $encoderMap[$class] = $this->createEncoder($encoder, $container); - } - - $container - ->getDefinition('security.encoder_factory.generic') - ->setArguments(array($encoderMap)) - ; - } - - private function createEncoder($config, ContainerBuilder $container) - { - // a custom encoder service - if (isset($config['id'])) { - return new Reference($config['id']); - } - - // plaintext encoder - if ('plaintext' === $config['algorithm']) { - $arguments = array($config['ignore_case']); - - return array( - 'class' => new Parameter('security.encoder.plain.class'), - 'arguments' => $arguments, - ); - } - - // message digest encoder - $arguments = array( - $config['algorithm'], - $config['encode_as_base64'], - $config['iterations'], - ); - - return array( - 'class' => new Parameter('security.encoder.digest.class'), - 'arguments' => $arguments, - ); - } - - // Parses user providers and returns an array of their ids - private function createUserProviders($config, ContainerBuilder $container) - { - $providerIds = array(); - foreach ($config['providers'] as $name => $provider) { - $id = $this->createUserDaoProvider($name, $provider, $container); - $providerIds[] = $id; - } - - return $providerIds; - } - - // Parses a tag and returns the id for the related user provider service - private function createUserDaoProvider($name, $provider, ContainerBuilder $container, $master = true) - { - $name = $this->getUserProviderId(strtolower($name)); - - foreach ($this->userProviderFactories as $factory) { - $key = str_replace('-', '_', $factory->getKey()); - - if (!empty($provider[$key])) { - $factory->create($container, $name, $provider[$key]); - - return $name; - } - } - - // Existing DAO service provider - if (isset($provider['id'])) { - $container->setAlias($name, new Alias($provider['id'], false)); - - return $provider['id']; - } - - // Chain provider - if (isset($provider['chain'])) { - $providers = array(); - foreach ($provider['chain']['providers'] as $providerName) { - $providers[] = new Reference($this->getUserProviderId(strtolower($providerName))); - } - - $container - ->setDefinition($name, new DefinitionDecorator('security.user.provider.chain')) - ->addArgument($providers) - ; - - return $name; - } - - // Doctrine Entity DAO provider - if (isset($provider['entity'])) { - $container - ->setDefinition($name, new DefinitionDecorator('security.user.provider.entity')) - ->addArgument($provider['entity']['class']) - ->addArgument($provider['entity']['property']) - ; - - return $name; - } - - // In-memory DAO provider - $definition = $container->setDefinition($name, new DefinitionDecorator('security.user.provider.in_memory')); - foreach ($provider['users'] as $username => $user) { - $userId = $name.'_'.$username; - - $container - ->setDefinition($userId, new DefinitionDecorator('security.user.provider.in_memory.user')) - ->setArguments(array($username, (string) $user['password'], $user['roles'])) - ; - - $definition->addMethodCall('createUser', array(new Reference($userId))); - } - - return $name; - } - - private function getUserProviderId($name) - { - return 'security.user.provider.concrete.'.$name; - } - - private function createExceptionListener($container, $config, $id, $defaultEntryPoint) - { - $exceptionListenerId = 'security.exception_listener.'.$id; - $listener = $container->setDefinition($exceptionListenerId, new DefinitionDecorator('security.exception_listener')); - $listener->replaceArgument(3, $id); - $listener->replaceArgument(4, null === $defaultEntryPoint ? null : new Reference($defaultEntryPoint)); - - // access denied handler setup - if (isset($config['access_denied_handler'])) { - $listener->replaceArgument(6, new Reference($config['access_denied_handler'])); - } elseif (isset($config['access_denied_url'])) { - $listener->replaceArgument(5, $config['access_denied_url']); - } - - return $exceptionListenerId; - } - - private function createSwitchUserListener($container, $id, $config, $defaultProvider) - { - $userProvider = isset($config['provider']) ? $this->getUserProviderId($config['provider']) : $defaultProvider; - - $switchUserListenerId = 'security.authentication.switchuser_listener.'.$id; - $listener = $container->setDefinition($switchUserListenerId, new DefinitionDecorator('security.authentication.switchuser_listener')); - $listener->replaceArgument(1, new Reference($userProvider)); - $listener->replaceArgument(3, $id); - $listener->replaceArgument(6, $config['parameter']); - $listener->replaceArgument(7, $config['role']); - - return $switchUserListenerId; - } - - private function createRequestMatcher($container, $path = null, $host = null, $methods = null, $ip = null, array $attributes = array()) - { - $serialized = serialize(array($path, $host, $methods, $ip, $attributes)); - $id = 'security.request_matcher.'.md5($serialized).sha1($serialized); - - if (isset($this->requestMatchers[$id])) { - return $this->requestMatchers[$id]; - } - - // only add arguments that are necessary - $arguments = array($path, $host, $methods, $ip, $attributes); - while (count($arguments) > 0 && !end($arguments)) { - array_pop($arguments); - } - - $container - ->register($id, '%security.matcher.class%') - ->setPublic(false) - ->setArguments($arguments) - ; - - return $this->requestMatchers[$id] = new Reference($id); - } - - public function addSecurityListenerFactory(SecurityFactoryInterface $factory) - { - $this->factories[$factory->getPosition()][] = $factory; - } - - public function addUserProviderFactory(UserProviderFactoryInterface $factory) - { - $this->userProviderFactories[] = $factory; - } - - /** - * Returns the base path for the XSD files. - * - * @return string The XSD base path - */ - public function getXsdValidationBasePath() - { - return __DIR__.'/../Resources/config/schema'; - } - - public function getNamespace() - { - return 'http://symfony.com/schema/dic/security'; - } - - public function getConfiguration(array $config, ContainerBuilder $container) - { - // first assemble the factories - return new MainConfiguration($this->factories, $this->userProviderFactories); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/EventListener/AclSchemaListener.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/EventListener/AclSchemaListener.php deleted file mode 100644 index 53758ab..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/EventListener/AclSchemaListener.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\EventListener; - -use Symfony\Component\DependencyInjection\ContainerInterface; -use Doctrine\ORM\Tools\Event\GenerateSchemaEventArgs; - -/** - * Merges ACL schema into the given schema. - * - * @author Johannes M. Schmitt - */ -class AclSchemaListener -{ - private $container; - - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - public function postGenerateSchema(GenerateSchemaEventArgs $args) - { - $schema = $args->getSchema(); - $this->container->get('security.acl.dbal.schema')->addToSchema($schema); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/EventListener/ResponseListener.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/EventListener/ResponseListener.php deleted file mode 100644 index 62d53dc..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/EventListener/ResponseListener.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\EventListener; - -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; -use Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface; - -/** - * Adds remember-me cookies to the Response. - * - * @author Johannes M. Schmitt - */ -class ResponseListener -{ - public function onKernelResponse(FilterResponseEvent $event) - { - $request = $event->getRequest(); - $response = $event->getResponse(); - - if ($request->attributes->has(RememberMeServicesInterface::COOKIE_ATTR_NAME)) { - $response->headers->setCookie($request->attributes->get(RememberMeServicesInterface::COOKIE_ATTR_NAME)); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/LICENSE b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/LICENSE deleted file mode 100644 index cdffe7a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2012 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/collectors.xml b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/collectors.xml deleted file mode 100644 index f6106f7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/collectors.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml deleted file mode 100644 index 4733425..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - Symfony\Component\Security\Core\SecurityContext - - Symfony\Component\Security\Core\User\UserChecker - - Symfony\Component\Security\Core\Encoder\EncoderFactory - Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder - Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder - - Symfony\Component\Security\Core\User\InMemoryUserProvider - Symfony\Component\Security\Core\User\User - Symfony\Component\Security\Core\User\ChainUserProvider - - Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver - Symfony\Component\Security\Core\Authentication\Token\AnonymousToken - Symfony\Component\Security\Core\Authentication\Token\RememberMeToken - - Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager - - Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy - - Symfony\Component\Security\Core\Authorization\AccessDecisionManager - - Symfony\Component\Security\Core\Authorization\Voter\RoleVoter - Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter - Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter - - Symfony\Component\Security\Http\Firewall - Symfony\Bundle\SecurityBundle\Security\FirewallMap - Symfony\Bundle\SecurityBundle\Security\FirewallContext - Symfony\Component\HttpFoundation\RequestMatcher - - Symfony\Component\Security\Core\Role\RoleHierarchy - - Symfony\Component\Security\Http\HttpUtils - - Symfony\Component\Security\Core\Validator\Constraint\UserPasswordValidator - - - - - - - %security.access.always_authenticate_before_granting% - - - - - - %security.authentication.manager.erase_credentials% - - - - - - - %security.authentication.trust_resolver.anonymous_class% - %security.authentication.trust_resolver.rememberme_class% - - - - %security.authentication.session_strategy.strategy% - - - - - - - - - - - - - - - - - - %security.role_hierarchy.roles% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security_acl.xml b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security_acl.xml deleted file mode 100644 index 624b6b1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security_acl.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - Symfony\Component\Security\Acl\Domain\PermissionGrantingStrategy - - Symfony\Component\Security\Acl\Voter\AclVoter - Symfony\Component\Security\Acl\Permission\BasicPermissionMap - - Symfony\Component\Security\Acl\Domain\ObjectIdentityRetrievalStrategy - Symfony\Component\Security\Acl\Domain\SecurityIdentityRetrievalStrategy - - Symfony\Component\Security\Acl\Domain\DoctrineAclCache - - Symfony\Component\Security\Acl\Domain\AclCollectionCache - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security_acl_dbal.xml b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security_acl_dbal.xml deleted file mode 100644 index aac84a3..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security_acl_dbal.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - Symfony\Component\Security\Acl\Dbal\MutableAclProvider - Symfony\Component\Security\Acl\Dbal\Schema - Symfony\Bundle\SecurityBundle\EventListener\AclSchemaListener - - - - - - - - - - %security.acl.dbal.class_table_name% - %security.acl.dbal.entry_table_name% - %security.acl.dbal.oid_table_name% - %security.acl.dbal.oid_ancestors_table_name% - %security.acl.dbal.sid_table_name% - - - - - - - %security.acl.dbal.class_table_name% - %security.acl.dbal.entry_table_name% - %security.acl.dbal.oid_table_name% - %security.acl.dbal.oid_ancestors_table_name% - %security.acl.dbal.sid_table_name% - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security_listeners.xml b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security_listeners.xml deleted file mode 100644 index 6148337..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security_listeners.xml +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - Symfony\Component\Security\Http\EntryPoint\RetryAuthenticationEntryPoint - - Symfony\Component\Security\Http\Firewall\ChannelListener - - Symfony\Component\Security\Http\EntryPoint\FormAuthenticationEntryPoint - Symfony\Component\Security\Http\Firewall\UsernamePasswordFormAuthenticationListener - - Symfony\Component\Security\Http\Firewall\BasicAuthenticationListener - Symfony\Component\Security\Http\EntryPoint\BasicAuthenticationEntryPoint - - Symfony\Component\Security\Http\Firewall\DigestAuthenticationListener - Symfony\Component\Security\Http\EntryPoint\DigestAuthenticationEntryPoint - - Symfony\Component\Security\Http\Firewall\X509AuthenticationListener - - Symfony\Component\Security\Http\Firewall\AnonymousAuthenticationListener - - Symfony\Component\Security\Http\Firewall\SwitchUserListener - - Symfony\Component\Security\Http\Firewall\LogoutListener - Symfony\Component\Security\Http\Logout\SessionLogoutHandler - Symfony\Component\Security\Http\Logout\CookieClearingLogoutHandler - Symfony\Component\Security\Http\Logout\DefaultLogoutSuccessHandler - - Symfony\Component\Security\Http\Firewall\AccessListener - Symfony\Component\Security\Http\AccessMap - Symfony\Component\Security\Http\Firewall\ExceptionListener - Symfony\Component\Security\Http\Firewall\ContextListener - - Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider - Symfony\Component\Security\Core\Authentication\Provider\PreAuthenticatedAuthenticationProvider - - Symfony\Component\Security\Core\Authentication\Provider\AnonymousAuthenticationProvider - - Symfony\Component\Security\Http\Authentication\DefaultAuthenticationSuccessHandler - Symfony\Component\Security\Http\Authentication\DefaultAuthenticationFailureHandler - - - - - - - - - - - - - - - - %request_listener.http_port% - %request_listener.https_port% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %security.authentication.hide_user_not_found% - - - - - - - - - - - - - - - %security.access.denied_url% - - - - - - - - - - - - - _switch_user - ROLE_ALLOWED_TO_SWITCH - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security_rememberme.xml b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security_rememberme.xml deleted file mode 100644 index 983ef57..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security_rememberme.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - Symfony\Component\Security\Core\Authentication\Provider\RememberMeAuthenticationProvider - - Symfony\Component\Security\Http\Firewall\RememberMeListener - Symfony\Component\Security\Core\Authentication\RememberMe\InMemoryTokenProvider - - Symfony\Component\Security\Http\RememberMe\PersistentTokenBasedRememberMeServices - Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices - - Symfony\Bundle\SecurityBundle\EventListener\ResponseListener - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/templating_php.xml b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/templating_php.xml deleted file mode 100644 index c91bf79..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/templating_php.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - Symfony\Bundle\SecurityBundle\Templating\Helper\LogoutUrlHelper - Symfony\Bundle\SecurityBundle\Templating\Helper\SecurityHelper - - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/templating_twig.xml b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/templating_twig.xml deleted file mode 100644 index d457cf1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/templating_twig.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - Symfony\Bundle\SecurityBundle\Twig\Extension\LogoutUrlExtension - Symfony\Bridge\Twig\Extension\SecurityExtension - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig deleted file mode 100644 index d0838de..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig +++ /dev/null @@ -1,74 +0,0 @@ -{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %} - -{% block toolbar %} - {% if collector.user %} - {% set color_code = (collector.enabled and collector.authenticated) ? 'green' : 'yellow' %} - {% set authentication_color_code = (collector.enabled and collector.authenticated) ? 'green' : 'red' %} - {% set authentication_color_text = (collector.enabled and collector.authenticated) ? 'Yes' : 'No' %} - {% else %} - {% set color_code = collector.enabled ? 'red' : 'black' %} - {% endif %} - {% set text %} - {% if collector.user %} -
    - Logged in as - {{ collector.user }} -
    -
    - Authenticated - {{ authentication_color_text }} -
    - {% elseif collector.enabled %} - You are not authenticated. - {% else %} - The security is disabled. - {% endif %} - {% endset %} - {% set icon %} - Security - - {% if collector.user %}
    {{ collector.user }}
    {% endif %} - {% endset %} - {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %} -{% endblock %} - -{% block menu %} - - - Security - -{% endblock %} - -{% block panel %} -

    Security

    - {% if collector.user %} - - - - - - - - - - - - - -
    Username{{ collector.user }}
    Authenticated? - {% if collector.authenticated %} - yes - {% else %} - no {% if not collector.roles|length %}(probably because the user has no roles){% endif %} - {% endif %} -
    Roles{{ collector.roles|yaml_encode }}
    - {% elseif collector.enabled %} -

    - No token -

    - {% else %} -

    - The security component is disabled -

    - {% endif %} -{% endblock %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php deleted file mode 100644 index 13d096d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Security; - -use Symfony\Component\Security\Http\Firewall\ExceptionListener; - -/** - * This is a wrapper around the actual firewall configuration which allows us - * to lazy load the context for one specific firewall only when we need it. - * - * @author Johannes M. Schmitt - */ -class FirewallContext -{ - private $listeners; - private $exceptionListener; - - public function __construct(array $listeners, ExceptionListener $exceptionListener = null) - { - $this->listeners = $listeners; - $this->exceptionListener = $exceptionListener; - } - - public function getContext() - { - return array($this->listeners, $this->exceptionListener); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Security/FirewallMap.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Security/FirewallMap.php deleted file mode 100644 index b06234b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Security/FirewallMap.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Security; - -use Symfony\Component\Security\Http\FirewallMapInterface; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * This is a lazy-loading firewall map implementation - * - * Listeners will only be initialized if we really need them. - * - * @author Johannes M. Schmitt - */ -class FirewallMap implements FirewallMapInterface -{ - protected $container; - protected $map; - - public function __construct(ContainerInterface $container, array $map) - { - $this->container = $container; - $this->map = $map; - } - - public function getListeners(Request $request) - { - foreach ($this->map as $contextId => $requestMatcher) { - if (null === $requestMatcher || $requestMatcher->matches($request)) { - return $this->container->get($contextId)->getContext(); - } - } - - return array(array(), null); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/SecurityBundle.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/SecurityBundle.php deleted file mode 100644 index 7d810fd..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/SecurityBundle.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\AddSecurityVotersPass; -use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\FormLoginFactory; -use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\HttpBasicFactory; -use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\HttpDigestFactory; -use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\RememberMeFactory; -use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\X509Factory; -use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\InMemoryFactory; - -/** - * Bundle. - * - * @author Fabien Potencier - */ -class SecurityBundle extends Bundle -{ - public function build(ContainerBuilder $container) - { - parent::build($container); - - $extension = $container->getExtension('security'); - $extension->addSecurityListenerFactory(new FormLoginFactory()); - $extension->addSecurityListenerFactory(new HttpBasicFactory()); - $extension->addSecurityListenerFactory(new HttpDigestFactory()); - $extension->addSecurityListenerFactory(new RememberMeFactory()); - $extension->addSecurityListenerFactory(new X509Factory()); - - $extension->addUserProviderFactory(new InMemoryFactory()); - $container->addCompilerPass(new AddSecurityVotersPass()); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Templating/Helper/LogoutUrlHelper.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Templating/Helper/LogoutUrlHelper.php deleted file mode 100644 index b24988e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Templating/Helper/LogoutUrlHelper.php +++ /dev/null @@ -1,121 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Templating\Helper; - -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface; -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -use Symfony\Component\Templating\Helper\Helper; - -/** - * LogoutUrlHelper provides generator functions for the logout URL. - * - * @author Jeremy Mikola - */ -class LogoutUrlHelper extends Helper -{ - private $container; - private $listeners; - private $router; - - /** - * Constructor. - * - * @param ContainerInterface $container A ContainerInterface instance - * @param UrlGeneratorInterface $router A Router instance - */ - public function __construct(ContainerInterface $container, UrlGeneratorInterface $router) - { - $this->container = $container; - $this->router = $router; - $this->listeners = array(); - } - - /** - * Registers a firewall's LogoutListener, allowing its URL to be generated. - * - * @param string $key The firewall key - * @param string $logoutPath The path that starts the logout process - * @param string $intention The intention for CSRF token generation - * @param string $csrfParameter The CSRF token parameter name - * @param CsrfProviderInterface $csrfProvider A CsrfProviderInterface instance - */ - public function registerListener($key, $logoutPath, $intention, $csrfParameter, CsrfProviderInterface $csrfProvider = null) - { - $this->listeners[$key] = array($logoutPath, $intention, $csrfParameter, $csrfProvider); - } - - /** - * Generate the relative logout URL for the firewall. - * - * @param string $key The firewall key - * @return string The relative logout URL - */ - public function getLogoutPath($key) - { - return $this->generateLogoutUrl($key, false); - } - - /** - * Generate the absolute logout URL for the firewall. - * - * @param string $key The firewall key - * @return string The absolute logout URL - */ - public function getLogoutUrl($key) - { - return $this->generateLogoutUrl($key, true); - } - - /** - * Generate the logout URL for the firewall. - * - * @param string $key The firewall key - * @param Boolean $absolute Whether to generate an absolute URL - * @return string The logout URL - * @throws InvalidArgumentException if no LogoutListener is registered for the key - */ - private function generateLogoutUrl($key, $absolute) - { - if (!array_key_exists($key, $this->listeners)) { - throw new \InvalidArgumentException(sprintf('No LogoutListener found for firewall key "%s".', $key)); - } - - list($logoutPath, $intention, $csrfParameter, $csrfProvider) = $this->listeners[$key]; - - $parameters = null !== $csrfProvider ? array($csrfParameter => $csrfProvider->generateCsrfToken($intention)) : array(); - - if ('/' === $logoutPath[0]) { - $request = $this->container->get('request'); - - $url = ($absolute ? $request->getUriForPath($logoutPath) : $request->getBasePath() . $logoutPath); - - if (!empty($parameters)) { - $url .= '?' . http_build_query($parameters); - } - } else { - $url = $this->router->generate($logoutPath, $parameters, $absolute); - } - - return $url; - } - - /** - * Returns the canonical name of this helper. - * - * @return string The canonical name - */ - public function getName() - { - return 'logout_url'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Templating/Helper/SecurityHelper.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Templating/Helper/SecurityHelper.php deleted file mode 100644 index 7ca0e7b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Templating/Helper/SecurityHelper.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Templating\Helper; - -use Symfony\Component\Security\Acl\Voter\FieldVote; -use Symfony\Component\Templating\Helper\Helper; -use Symfony\Component\Security\Core\SecurityContextInterface; - -/** - * SecurityHelper provides read-only access to the security context. - * - * @author Fabien Potencier - */ -class SecurityHelper extends Helper -{ - private $context; - - /** - * Constructor. - * - * @param SecurityContextInterface $context A SecurityContext instance - */ - public function __construct(SecurityContextInterface $context = null) - { - $this->context = $context; - } - - public function isGranted($role, $object = null, $field = null) - { - if (null === $this->context) { - return false; - } - - if (null !== $field) { - $object = new FieldVote($object, $field); - } - - return $this->context->isGranted($role, $object); - } - - /** - * Returns the canonical name of this helper. - * - * @return string The canonical name - */ - public function getName() - { - return 'security'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/ConfigurationTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/ConfigurationTest.php deleted file mode 100644 index c859cff..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/ConfigurationTest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection; - -use Symfony\Bundle\SecurityBundle\DependencyInjection\MainConfiguration; -use Symfony\Component\Config\Definition\Processor; - -class ConfigurationTest extends \PHPUnit_Framework_TestCase -{ - /** - * The minimal, required config needed to not have any required validation - * issues. - * - * @var array - */ - protected static $minimalConfig = array( - 'providers' => array( - 'stub' => array( - 'id' => 'foo', - ), - ), - 'firewalls' => array( - 'stub' => array(), - ), - ); - - /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function testNoConfigForProvider() - { - $config = array( - 'providers' => array( - 'stub' => array(), - ), - ); - - $processor = new Processor(); - $configuration = new MainConfiguration(array(), array()); - $config = $processor->processConfiguration($configuration, array($config)); - } - - /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function testManyConfigForProvider() - { - $config = array( - 'providers' => array( - 'stub' => array( - 'id' => 'foo', - 'chain' => array(), - ), - ), - ); - - $processor = new Processor(); - $configuration = new MainConfiguration(array(), array()); - $config = $processor->processConfiguration($configuration, array($config)); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php deleted file mode 100644 index 8652333..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php +++ /dev/null @@ -1,75 +0,0 @@ -loadFromExtension('security', array( - 'acl' => array(), - 'encoders' => array( - 'JMS\FooBundle\Entity\User1' => 'plaintext', - 'JMS\FooBundle\Entity\User2' => array( - 'algorithm' => 'sha1', - 'encode_as_base64' => false, - 'iterations' => 5, - ), - 'JMS\FooBundle\Entity\User3' => array( - 'algorithm' => 'md5', - ), - 'JMS\FooBundle\Entity\User4' => array( - 'id' => 'security.encoder.foo', - ), - ), - 'providers' => array( - 'default' => array( - 'memory' => array( - 'users' => array( - 'foo' => array('password' => 'foo', 'roles' => 'ROLE_USER'), - ), - ), - ), - 'digest' => array( - 'memory' => array( - 'users' => array( - 'foo' => array('password' => 'foo', 'roles' => 'ROLE_USER, ROLE_ADMIN'), - ), - ), - ), - 'basic' => array( - 'memory' => array( - 'users' => array( - 'foo' => array('password' => '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'roles' => 'ROLE_SUPER_ADMIN'), - 'bar' => array('password' => '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'roles' => array('ROLE_USER', 'ROLE_ADMIN')), - ), - ), - ), - 'service' => array( - 'id' => 'user.manager', - ), - 'chain' => array( - 'chain' => array( - 'providers' => array('service', 'basic'), - ), - ), - ), - - 'firewalls' => array( - 'simple' => array('pattern' => '/login', 'security' => false), - 'secure' => array('stateless' => true, - 'http_basic' => true, - 'http_digest' => array('key' => 'TheKey'), - 'form_login' => true, - 'anonymous' => true, - 'switch_user' => true, - 'x509' => true, - 'logout' => true, - ), - ), - - 'access_control' => array( - array('path' => '/blog/524', 'role' => 'ROLE_USER', 'requires_channel' => 'https'), - array('path' => '/blog/.*', 'role' => 'IS_AUTHENTICATED_ANONYMOUSLY'), - ), - - 'role_hierarchy' => array( - 'ROLE_ADMIN' => 'ROLE_USER', - 'ROLE_SUPER_ADMIN' => array('ROLE_USER', 'ROLE_ADMIN', 'ROLE_ALLOWED_TO_SWITCH'), - 'ROLE_REMOTE' => 'ROLE_USER,ROLE_ADMIN', - ), -)); diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/custom_acl_provider.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/custom_acl_provider.php deleted file mode 100644 index 4acf6cc..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/custom_acl_provider.php +++ /dev/null @@ -1,9 +0,0 @@ -load('container1.php', $container); - -$container->loadFromExtension('security', array( - 'acl' => array( - 'provider' => 'foo', - ) -)); diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge.php deleted file mode 100644 index 82966dc..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge.php +++ /dev/null @@ -1,20 +0,0 @@ -load('merge_import.php', $container); - -$container->loadFromExtension('security', array( - 'providers' => array( - 'default' => array('id' => 'foo'), - ), - - 'firewalls' => array( - 'main' => array( - 'form_login' => false, - 'http_basic' => null, - ), - ), - - 'role_hierarchy' => array( - 'FOO' => array('MOO'), - ) -)); diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge_import.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge_import.php deleted file mode 100644 index 1e29d40..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge_import.php +++ /dev/null @@ -1,15 +0,0 @@ -loadFromExtension('security', array( - 'firewalls' => array( - 'main' => array( - 'form_login' => array( - 'login_path' => '/login', - ) - ) - ), - 'role_hierarchy' => array( - 'FOO' => 'BAR', - 'ADMIN' => 'USER', - ), -)); diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/container1.xml b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/container1.xml deleted file mode 100644 index 20c3760..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/container1.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ROLE_USER - ROLE_USER,ROLE_ADMIN,ROLE_ALLOWED_TO_SWITCH - ROLE_USER,ROLE_ADMIN - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/custom_acl_provider.xml b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/custom_acl_provider.xml deleted file mode 100644 index 6addc81..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/custom_acl_provider.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/merge.xml b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/merge.xml deleted file mode 100644 index 8a17f6d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/merge.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/merge_import.xml b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/merge_import.xml deleted file mode 100644 index 81b8cff..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/merge_import.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/container1.yml b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/container1.yml deleted file mode 100644 index ade174f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/container1.yml +++ /dev/null @@ -1,57 +0,0 @@ -security: - acl: ~ - encoders: - JMS\FooBundle\Entity\User1: plaintext - JMS\FooBundle\Entity\User2: - algorithm: sha1 - encode_as_base64: false - iterations: 5 - JMS\FooBundle\Entity\User3: - algorithm: md5 - JMS\FooBundle\Entity\User4: - id: security.encoder.foo - - providers: - default: - memory: - users: - foo: { password: foo, roles: ROLE_USER } - digest: - memory: - users: - foo: { password: foo, roles: 'ROLE_USER, ROLE_ADMIN' } - basic: - memory: - users: - foo: { password: 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33, roles: ROLE_SUPER_ADMIN } - bar: { password: 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33, roles: [ROLE_USER, ROLE_ADMIN] } - service: - id: user.manager - chain: - chain: - providers: [service, basic] - - - firewalls: - simple: { pattern: /login, security: false } - secure: - stateless: true - http_basic: true - http_digest: - key: TheKey - form_login: true - anonymous: true - switch_user: true - x509: true - logout: true - - role_hierarchy: - ROLE_ADMIN: ROLE_USER - ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH] - ROLE_REMOTE: ROLE_USER,ROLE_ADMIN - - access_control: - - { path: /blog/524, role: ROLE_USER, requires_channel: https } - - - path: /blog/.* - role: IS_AUTHENTICATED_ANONYMOUSLY diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/custom_acl_provider.yml b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/custom_acl_provider.yml deleted file mode 100644 index 633eed0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/custom_acl_provider.yml +++ /dev/null @@ -1,6 +0,0 @@ -imports: - - { resource: container1.yml } - -security: - acl: - provider: foo diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/merge.yml b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/merge.yml deleted file mode 100644 index 60c0bbe..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/merge.yml +++ /dev/null @@ -1,14 +0,0 @@ -imports: - - { resource: merge_import.yml } - -security: - providers: - default: { id: foo } - - firewalls: - main: - form_login: false - http_basic: ~ - - role_hierarchy: - FOO: [MOO] diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/merge_import.yml b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/merge_import.yml deleted file mode 100644 index 4f8db0a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/merge_import.yml +++ /dev/null @@ -1,9 +0,0 @@ -security: - firewalls: - main: - form_login: - login_path: /login - - role_hierarchy: - FOO: BAR - ADMIN: USER diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/PhpSecurityExtensionTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/PhpSecurityExtensionTest.php deleted file mode 100644 index fc54797..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/PhpSecurityExtensionTest.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; -use Symfony\Component\Config\FileLocator; - -class PhpSecurityExtensionTest extends SecurityExtensionTest -{ - protected function loadFromFile(ContainerBuilder $container, $file) - { - $loadXml = new PhpFileLoader($container, new FileLocator(__DIR__.'/Fixtures/php')); - $loadXml->load($file.'.php'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Security/Factory/AbstractFactoryTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Security/Factory/AbstractFactoryTest.php deleted file mode 100644 index 2bc24bc..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Security/Factory/AbstractFactoryTest.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Security\Factory; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class AbstractFactoryTest extends \PHPUnit_Framework_TestCase -{ - public function testCreate() - { - list($container, - $authProviderId, - $listenerId, - $entryPointId - ) = $this->callFactory('foo', array('use_forward' => true, 'failure_path' => '/foo', 'success_handler' => 'qux', 'failure_handler' => 'bar', 'remember_me' => true), 'user_provider', 'entry_point'); - - // auth provider - $this->assertEquals('auth_provider', $authProviderId); - - // listener - $this->assertEquals('abstract_listener.foo', $listenerId); - $this->assertTrue($container->hasDefinition('abstract_listener.foo')); - $definition = $container->getDefinition('abstract_listener.foo'); - $this->assertEquals(array( - 'index_4' => 'foo', - 'index_5' => new Reference('qux'), - 'index_6' => new Reference('bar'), - 'index_7' => array( - 'use_forward' => true, - ), - ), $definition->getArguments()); - - // entry point - $this->assertEquals('entry_point', $entryPointId, '->create() does not change the default entry point.'); - } - - public function testDefaultFailureHandler() - { - list($container, - $authProviderId, - $listenerId, - $entryPointId - ) = $this->callFactory('foo', array('remember_me' => true), 'user_provider', 'entry_point'); - - $definition = $container->getDefinition('abstract_listener.foo'); - $arguments = $definition->getArguments(); - $this->assertEquals(new Reference('security.authentication.failure_handler.foo.abstract_factory'), $arguments['index_6']); - } - - public function testDefaultSuccessHandler() - { - list($container, - $authProviderId, - $listenerId, - $entryPointId - ) = $this->callFactory('foo', array('remember_me' => true), 'user_provider', 'entry_point'); - - $definition = $container->getDefinition('abstract_listener.foo'); - $arguments = $definition->getArguments(); - $this->assertEquals(new Reference('security.authentication.success_handler.foo.abstract_factory'), $arguments['index_5']); - } - - protected function callFactory($id, $config, $userProviderId, $defaultEntryPointId) - { - $factory = $this->getMockForAbstractClass('Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory', array()); - - $factory - ->expects($this->once()) - ->method('createAuthProvider') - ->will($this->returnValue('auth_provider')) - ; - $factory - ->expects($this->atLeastOnce()) - ->method('getListenerId') - ->will($this->returnValue('abstract_listener')) - ; - $factory - ->expects($this->any()) - ->method('getKey') - ->will($this->returnValue('abstract_factory')) - ; - - $container = new ContainerBuilder(); - $container->register('auth_provider'); - - list($authProviderId, - $listenerId, - $entryPointId - ) = $factory->create($container, $id, $config, $userProviderId, $defaultEntryPointId); - - return array($container, $authProviderId, $listenerId, $entryPointId); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php deleted file mode 100644 index 60e1778..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php +++ /dev/null @@ -1,183 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection; - -use Symfony\Component\DependencyInjection\Reference; - -use Symfony\Component\DependencyInjection\Parameter; -use Symfony\Bundle\SecurityBundle\SecurityBundle; -use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -abstract class SecurityExtensionTest extends \PHPUnit_Framework_TestCase -{ - abstract protected function loadFromFile(ContainerBuilder $container, $file); - - public function testRolesHierarchy() - { - $container = $this->getContainer('container1'); - $this->assertEquals(array( - 'ROLE_ADMIN' => array('ROLE_USER'), - 'ROLE_SUPER_ADMIN' => array('ROLE_USER', 'ROLE_ADMIN', 'ROLE_ALLOWED_TO_SWITCH'), - 'ROLE_REMOTE' => array('ROLE_USER', 'ROLE_ADMIN'), - ), $container->getParameter('security.role_hierarchy.roles')); - } - - public function testUserProviders() - { - $container = $this->getContainer('container1'); - - $providers = array_values(array_filter($container->getServiceIds(), function ($key) { return 0 === strpos($key, 'security.user.provider.concrete'); })); - - $expectedProviders = array( - 'security.user.provider.concrete.default', - 'security.user.provider.concrete.default_foo', - 'security.user.provider.concrete.digest', - 'security.user.provider.concrete.digest_foo', - 'security.user.provider.concrete.basic', - 'security.user.provider.concrete.basic_foo', - 'security.user.provider.concrete.basic_bar', - 'security.user.provider.concrete.service', - 'security.user.provider.concrete.chain', - ); - - $this->assertEquals(array(), array_diff($expectedProviders, $providers)); - $this->assertEquals(array(), array_diff($providers, $expectedProviders)); - - // chain provider - $this->assertEquals(array(array( - new Reference('security.user.provider.concrete.service'), - new Reference('security.user.provider.concrete.basic'), - )), $container->getDefinition('security.user.provider.concrete.chain')->getArguments()); - } - - public function testFirewalls() - { - $container = $this->getContainer('container1'); - - $arguments = $container->getDefinition('security.firewall.map')->getArguments(); - $listeners = array(); - foreach (array_keys($arguments[1]) as $contextId) { - $contextDef = $container->getDefinition($contextId); - $arguments = $contextDef->getArguments(); - $listeners[] = array_map(function ($ref) { return (string) $ref; }, $arguments['index_0']); - } - - $this->assertEquals(array( - array(), - array( - 'security.channel_listener', - 'security.logout_listener.secure', - 'security.authentication.listener.x509.secure', - 'security.authentication.listener.form.secure', - 'security.authentication.listener.basic.secure', - 'security.authentication.listener.digest.secure', - 'security.authentication.listener.anonymous.secure', - 'security.access_listener', - 'security.authentication.switchuser_listener.secure', - ), - ), $listeners); - } - - public function testAccess() - { - $container = $this->getContainer('container1'); - - $rules = array(); - foreach ($container->getDefinition('security.access_map')->getMethodCalls() as $call) { - if ($call[0] == 'add') { - $rules[] = array((string) $call[1][0], $call[1][1], $call[1][2]); - } - } - - $matcherIds = array(); - foreach ($rules as $rule) { - list($matcherId, $roles, $channel) = $rule; - - $this->assertFalse(isset($matcherIds[$matcherId])); - $matcherIds[$matcherId] = true; - - $i = count($matcherIds); - if (1 === $i) { - $this->assertEquals(array('ROLE_USER'), $roles); - $this->assertEquals('https', $channel); - } elseif (2 === $i) { - $this->assertEquals(array('IS_AUTHENTICATED_ANONYMOUSLY'), $roles); - $this->assertNull($channel); - } - } - } - - public function testMerge() - { - $container = $this->getContainer('merge'); - - $this->assertEquals(array( - 'FOO' => array('MOO'), - 'ADMIN' => array('USER'), - ), $container->getParameter('security.role_hierarchy.roles')); - } - - public function testEncoders() - { - $container = $this->getContainer('container1'); - - $this->assertEquals(array(array( - 'JMS\FooBundle\Entity\User1' => array( - 'class' => new Parameter('security.encoder.plain.class'), - 'arguments' => array(false), - ), - 'JMS\FooBundle\Entity\User2' => array( - 'class' => new Parameter('security.encoder.digest.class'), - 'arguments' => array('sha1', false, 5), - ), - 'JMS\FooBundle\Entity\User3' => array( - 'class' => new Parameter('security.encoder.digest.class'), - 'arguments' => array('md5', true, 5000), - ), - 'JMS\FooBundle\Entity\User4' => new Reference('security.encoder.foo'), - )), $container->getDefinition('security.encoder_factory.generic')->getArguments()); - } - - public function testAcl() - { - $container = $this->getContainer('container1'); - - $this->assertTrue($container->hasDefinition('security.acl.dbal.provider')); - $this->assertEquals('security.acl.dbal.provider', (string) $container->getAlias('security.acl.provider')); - } - - public function testCustomAclProvider() - { - $container = $this->getContainer('custom_acl_provider'); - - $this->assertFalse($container->hasDefinition('security.acl.dbal.provider')); - $this->assertEquals('foo', (string) $container->getAlias('security.acl.provider')); - } - - protected function getContainer($file) - { - $container = new ContainerBuilder(); - $security = new SecurityExtension(); - $container->registerExtension($security); - - $bundle = new SecurityBundle(); - $bundle->build($container); // Attach all default factories - $this->loadFromFile($container, $file); - - $container->getCompilerPassConfig()->setOptimizationPasses(array()); - $container->getCompilerPassConfig()->setRemovingPasses(array()); - $container->compile(); - - return $container; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/XmlSecurityExtensionTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/XmlSecurityExtensionTest.php deleted file mode 100644 index 6ce0489..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/XmlSecurityExtensionTest.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\Config\FileLocator; - -class XmlSecurityExtensionTest extends SecurityExtensionTest -{ - protected function loadFromFile(ContainerBuilder $container, $file) - { - $loadXml = new XmlFileLoader($container, new FileLocator(__DIR__.'/Fixtures/xml')); - $loadXml->load($file.'.xml'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/YamlSecurityExtensionTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/YamlSecurityExtensionTest.php deleted file mode 100644 index f5fabe0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/YamlSecurityExtensionTest.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; -use Symfony\Component\Config\FileLocator; - -class YamlSecurityExtensionTest extends SecurityExtensionTest -{ - protected function loadFromFile(ContainerBuilder $container, $file) - { - $loadXml = new YamlFileLoader($container, new FileLocator(__DIR__.'/Fixtures/yml')); - $loadXml->load($file.'.yml'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/AuthenticationCommencingTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/AuthenticationCommencingTest.php deleted file mode 100644 index e94a21e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/AuthenticationCommencingTest.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\Functional; - -class AuthenticationCommencingTest extends WebTestCase -{ - public function testAuthenticationIsCommencingIfAccessDeniedExceptionIsWrapped() - { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => 'config.yml')); - $client->insulate(); - - $client->request('GET', '/secure-but-not-covered-by-access-control'); - $this->assertRedirect($client->getResponse(), '/login'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Controller/LoginController.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Controller/LoginController.php deleted file mode 100644 index 3442459..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Controller/LoginController.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\CsrfFormLoginBundle\Controller; - -use Symfony\Component\DependencyInjection\ContainerAware; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Security\Core\Exception\AccessDeniedException; - -class LoginController extends ContainerAware -{ - public function loginAction() - { - $form = $this->container->get('form.factory')->create('user_login'); - - return $this->container->get('templating')->renderResponse('CsrfFormLoginBundle:Login:login.html.twig', array( - 'form' => $form->createView(), - )); - } - - public function afterLoginAction() - { - return $this->container->get('templating')->renderResponse('CsrfFormLoginBundle:Login:after_login.html.twig'); - } - - public function loginCheckAction() - { - return new Response('', 400); - } - - public function secureAction() - { - throw new \Exception('Wrapper', 0, new \Exception('Another Wrapper', 0, new AccessDeniedException())); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/CsrfFormLoginBundle.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/CsrfFormLoginBundle.php deleted file mode 100644 index 41309d9..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/CsrfFormLoginBundle.php +++ /dev/null @@ -1,18 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\CsrfFormLoginBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; - -class CsrfFormLoginBundle extends Bundle -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Form/UserLoginFormType.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Form/UserLoginFormType.php deleted file mode 100644 index 21389ef..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Form/UserLoginFormType.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\CsrfFormLoginBundle\Form; - -use Symfony\Component\Form\AbstractType; -use Symfony\Component\Form\FormBuilderInterface; -use Symfony\Component\Form\FormError; -use Symfony\Component\Form\FormEvents; -use Symfony\Component\Form\FormEvent; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\Security\Core\SecurityContextInterface; -use Symfony\Component\OptionsResolver\OptionsResolverInterface; - -/** - * Form type for use with the Security component's form-based authentication - * listener. - * - * @author Henrik Bjornskov - * @author Jeremy Mikola - */ -class UserLoginFormType extends AbstractType -{ - private $request; - - /** - * @param Request $request A request instance - */ - public function __construct(Request $request) - { - $this->request = $request; - } - - /** - * @see Symfony\Component\Form\AbstractType::buildForm() - */ - public function buildForm(FormBuilderInterface $builder, array $options) - { - $builder - ->add('username', 'text') - ->add('password', 'password') - ->add('_target_path', 'hidden') - ; - - $request = $this->request; - - /* Note: since the Security component's form login listener intercepts - * the POST request, this form will never really be bound to the - * request; however, we can match the expected behavior by checking the - * session for an authentication error and last username. - */ - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($request) { - if ($request->attributes->has(SecurityContextInterface::AUTHENTICATION_ERROR)) { - $error = $request->attributes->get(SecurityContextInterface::AUTHENTICATION_ERROR); - } else { - $error = $request->getSession()->get(SecurityContextInterface::AUTHENTICATION_ERROR); - } - - if ($error) { - $event->getForm()->addError(new FormError($error->getMessage())); - } - - $event->setData(array_replace((array) $event->getData(), array( - 'username' => $request->getSession()->get(SecurityContextInterface::LAST_USERNAME), - ))); - }); - } - - /** - * @see Symfony\Component\Form\AbstractType::setDefaultOptions() - */ - public function setDefaultOptions(OptionsResolverInterface $resolver) - { - /* Note: the form's intention must correspond to that for the form login - * listener in order for the CSRF token to validate successfully. - */ - - $resolver->setDefaults(array( - 'intention' => 'authenticate', - )); - } - - /** - * @see Symfony\Component\Form\FormTypeInterface::getName() - */ - public function getName() - { - return 'user_login'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Resources/config/routing.yml b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Resources/config/routing.yml deleted file mode 100644 index 0c9842b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Resources/config/routing.yml +++ /dev/null @@ -1,30 +0,0 @@ -form_login: - pattern: /login - defaults: { _controller: CsrfFormLoginBundle:Login:login } - -form_login_check: - pattern: /login_check - defaults: { _controller: CsrfFormLoginBundle:Login:loginCheck } - -form_login_homepage: - pattern: / - defaults: { _controller: CsrfFormLoginBundle:Login:afterLogin } - -form_login_custom_target_path: - pattern: /foo - defaults: { _controller: CsrfFormLoginBundle:Login:afterLogin } - -form_login_default_target_path: - pattern: /profile - defaults: { _controller: CsrfFormLoginBundle:Login:afterLogin } - -form_login_redirect_to_protected_resource_after_login: - pattern: /protected-resource - defaults: { _controller: CsrfFormLoginBundle:Login:afterLogin } - -form_logout: - pattern: /logout_path - -form_secure_action: - pattern: /secure-but-not-covered-by-access-control - defaults: { _controller: CsrfFormLoginBundle:Login:secure } diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Resources/views/Login/after_login.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Resources/views/Login/after_login.html.twig deleted file mode 100644 index b56c186..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Resources/views/Login/after_login.html.twig +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "::base.html.twig" %} - -{% block body %} - Hello {{ app.user.username }}!

    - You're browsing to path "{{ app.request.pathInfo }}".

    - Log out. - Log out. -{% endblock %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Resources/views/Login/login.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Resources/views/Login/login.html.twig deleted file mode 100644 index 36ae015..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Resources/views/Login/login.html.twig +++ /dev/null @@ -1,12 +0,0 @@ -{% extends "::base.html.twig" %} - -{% block body %} - - - {{ form_widget(form) }} - - {# Note: ensure the submit name does not conflict with the form's name or it may clobber field data #} - - - -{% endblock %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LocalizedController.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LocalizedController.php deleted file mode 100644 index 381b13d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LocalizedController.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FormLoginBundle\Controller; - -use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\DependencyInjection\ContainerAware; - -class LocalizedController extends ContainerAware -{ - public function loginAction() - { - // get the login error if there is one - if ($this->container->get('request')->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) { - $error = $this->container->get('request')->attributes->get(SecurityContext::AUTHENTICATION_ERROR); - } else { - $error = $this->container->get('request')->getSession()->get(SecurityContext::AUTHENTICATION_ERROR); - } - - return $this->container->get('templating')->renderResponse('FormLoginBundle:Localized:login.html.twig', array( - // last username entered by the user - 'last_username' => $this->container->get('request')->getSession()->get(SecurityContext::LAST_USERNAME), - 'error' => $error, - )); - } - - public function loginCheckAction() - { - throw new \RuntimeException('loginCheckAction() should never be called.'); - } - - public function logoutAction() - { - throw new \RuntimeException('logoutAction() should never be called.'); - } - - public function secureAction() - { - throw new \RuntimeException('secureAction() should never be called.'); - } - - public function profileAction() - { - return new Response('Profile'); - } - - public function homepageAction() - { - return new Response('Homepage'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LoginController.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LoginController.php deleted file mode 100644 index cec298c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LoginController.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FormLoginBundle\Controller; - -use Symfony\Component\Security\Core\Exception\AccessDeniedException; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\DependencyInjection\ContainerAware; - -class LoginController extends ContainerAware -{ - public function loginAction() - { - // get the login error if there is one - if ($this->container->get('request')->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) { - $error = $this->container->get('request')->attributes->get(SecurityContext::AUTHENTICATION_ERROR); - } else { - $error = $this->container->get('request')->getSession()->get(SecurityContext::AUTHENTICATION_ERROR); - } - - return $this->container->get('templating')->renderResponse('FormLoginBundle:Login:login.html.twig', array( - // last username entered by the user - 'last_username' => $this->container->get('request')->getSession()->get(SecurityContext::LAST_USERNAME), - 'error' => $error, - )); - } - - public function afterLoginAction() - { - return $this->container->get('templating')->renderResponse('FormLoginBundle:Login:after_login.html.twig'); - } - - public function loginCheckAction() - { - return new Response('', 400); - } - - public function secureAction() - { - throw new \Exception('Wrapper', 0, new \Exception('Another Wrapper', 0, new AccessDeniedException())); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/DependencyInjection/FormLoginExtension.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/DependencyInjection/FormLoginExtension.php deleted file mode 100644 index 016bf5a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/DependencyInjection/FormLoginExtension.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FormLoginBundle\DependencyInjection; - -use Symfony\Component\DependencyInjection\Reference; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\HttpKernel\DependencyInjection\Extension; - -class FormLoginExtension extends Extension -{ - public function load(array $configs, ContainerBuilder $container) - { - $container - ->register('localized_form_failure_handler', 'Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FormLoginBundle\Security\LocalizedFormFailureHandler') - ->addArgument(new Reference('router')) - ; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/FormLoginBundle.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/FormLoginBundle.php deleted file mode 100644 index eab1913..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/FormLoginBundle.php +++ /dev/null @@ -1,18 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FormLoginBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; - -class FormLoginBundle extends Bundle -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Resources/config/localized_routing.yml b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Resources/config/localized_routing.yml deleted file mode 100644 index a10bf9e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Resources/config/localized_routing.yml +++ /dev/null @@ -1,29 +0,0 @@ -localized_login_path: - pattern: /{_locale}/login - defaults: { _controller: FormLoginBundle:Localized:login } - requirements: { _locale: "^[a-z]{2}$" } - -localized_check_path: - pattern: /{_locale}/login_check - defaults: { _controller: FormLoginBundle:Localized:loginCheck } - requirements: { _locale: "^[a-z]{2}$" } - -localized_default_target_path: - pattern: /{_locale}/profile - defaults: { _controller: FormLoginBundle:Localized:profile } - requirements: { _locale: "^[a-z]{2}$" } - -localized_logout_path: - pattern: /{_locale}/logout - defaults: { _controller: FormLoginBundle:Localized:logout } - requirements: { _locale: "^[a-z]{2}$" } - -localized_logout_target_path: - pattern: /{_locale}/ - defaults: { _controller: FormLoginBundle:Localized:homepage } - requirements: { _locale: "^[a-z]{2}$" } - -localized_secure_path: - pattern: /{_locale}/secure/ - defaults: { _controller: FormLoginBundle:Localized:secure } - requirements: { _locale: "^[a-z]{2}$" } diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Resources/config/routing.yml b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Resources/config/routing.yml deleted file mode 100644 index c9684ce..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Resources/config/routing.yml +++ /dev/null @@ -1,33 +0,0 @@ -form_login: - pattern: /login - defaults: { _controller: FormLoginBundle:Login:login } - -form_login_check: - pattern: /login_check - defaults: { _controller: FormLoginBundle:Login:loginCheck } - -form_login_homepage: - pattern: / - defaults: { _controller: FormLoginBundle:Login:afterLogin } - -form_login_custom_target_path: - pattern: /foo - defaults: { _controller: FormLoginBundle:Login:afterLogin } - -form_login_default_target_path: - pattern: /profile - defaults: { _controller: FormLoginBundle:Login:afterLogin } - -form_login_redirect_to_protected_resource_after_login: - pattern: /protected_resource - defaults: { _controller: FormLoginBundle:Login:afterLogin } - -highly_protected_resource: - pattern: /highly_protected_resource - -form_logout: - pattern: /logout_path - -form_secure_action: - pattern: /secure-but-not-covered-by-access-control - defaults: { _controller: FormLoginBundle:Login:secure } diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Resources/views/Localized/login.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Resources/views/Localized/login.html.twig deleted file mode 100644 index 60dd2f1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Resources/views/Localized/login.html.twig +++ /dev/null @@ -1,21 +0,0 @@ -{% extends "::base.html.twig" %} - -{% block body %} - - {% if error %} -
    {{ error.message }}
    - {% endif %} - -
    - - - - - - - - - -
    - -{% endblock %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Resources/views/Login/after_login.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Resources/views/Login/after_login.html.twig deleted file mode 100644 index 9972b48..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Resources/views/Login/after_login.html.twig +++ /dev/null @@ -1,6 +0,0 @@ -{% extends "::base.html.twig" %} - -{% block body %} - Hello {{ app.user.username }}!

    - You're browsing to path "{{ app.request.pathInfo }}". -{% endblock %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Resources/views/Login/login.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Resources/views/Login/login.html.twig deleted file mode 100644 index 6c1a224..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Resources/views/Login/login.html.twig +++ /dev/null @@ -1,21 +0,0 @@ -{% extends "::base.html.twig" %} - -{% block body %} - - {% if error %} -
    {{ error.message }}
    - {% endif %} - -
    - - - - - - - - - -
    - -{% endblock %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Security/LocalizedFormFailureHandler.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Security/LocalizedFormFailureHandler.php deleted file mode 100644 index fda394d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Security/LocalizedFormFailureHandler.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FormLoginBundle\Security; - -use Symfony\Component\HttpFoundation\RedirectResponse; -use Symfony\Component\Routing\RouterInterface; -use Symfony\Component\Security\Core\Exception\AuthenticationException; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface; - -class LocalizedFormFailureHandler implements AuthenticationFailureHandlerInterface -{ - private $router; - - public function __construct(RouterInterface $router) - { - $this->router = $router; - } - - public function onAuthenticationFailure(Request $request, AuthenticationException $exception) - { - return new RedirectResponse($this->router->generate('localized_login_path', array(), true)); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/CsrfFormLoginTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/CsrfFormLoginTest.php deleted file mode 100644 index 4c4c1ac..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/CsrfFormLoginTest.php +++ /dev/null @@ -1,132 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\Functional; - -/** - * @group functional - */ -class CsrfFormLoginTest extends WebTestCase -{ - /** - * @dataProvider getConfigs - */ - public function testFormLoginAndLogoutWithCsrfTokens($config) - { - $client = $this->createClient(array('test_case' => 'CsrfFormLogin', 'root_config' => $config)); - $client->insulate(); - - $form = $client->request('GET', '/login')->selectButton('login')->form(); - $form['user_login[username]'] = 'johannes'; - $form['user_login[password]'] = 'test'; - $client->submit($form); - - $this->assertRedirect($client->getResponse(), '/profile'); - - $crawler = $client->followRedirect(); - - $text = $crawler->text(); - $this->assertContains('Hello johannes!', $text); - $this->assertContains('You\'re browsing to path "/profile".', $text); - - $logoutLinks = $crawler->selectLink('Log out')->links(); - $this->assertCount(2, $logoutLinks); - $this->assertContains('_csrf_token=', $logoutLinks[0]->getUri()); - $this->assertSame($logoutLinks[0]->getUri(), $logoutLinks[1]->getUri()); - - $client->click($logoutLinks[0]); - - $this->assertRedirect($client->getResponse(), '/'); - } - - /** - * @dataProvider getConfigs - */ - public function testFormLoginWithInvalidCsrfToken($config) - { - $client = $this->createClient(array('test_case' => 'CsrfFormLogin', 'root_config' => $config)); - $client->insulate(); - - $form = $client->request('GET', '/login')->selectButton('login')->form(); - $form['user_login[_token]'] = ''; - $client->submit($form); - - $this->assertRedirect($client->getResponse(), '/login'); - - $text = $client->followRedirect()->text(); - $this->assertContains('Invalid CSRF token.', $text); - } - - /** - * @dataProvider getConfigs - */ - public function testFormLoginWithCustomTargetPath($config) - { - $client = $this->createClient(array('test_case' => 'CsrfFormLogin', 'root_config' => $config)); - $client->insulate(); - - $form = $client->request('GET', '/login')->selectButton('login')->form(); - $form['user_login[username]'] = 'johannes'; - $form['user_login[password]'] = 'test'; - $form['user_login[_target_path]'] = '/foo'; - $client->submit($form); - - $this->assertRedirect($client->getResponse(), '/foo'); - - $text = $client->followRedirect()->text(); - $this->assertContains('Hello johannes!', $text); - $this->assertContains('You\'re browsing to path "/foo".', $text); - } - - /** - * @dataProvider getConfigs - */ - public function testFormLoginRedirectsToProtectedResourceAfterLogin($config) - { - $client = $this->createClient(array('test_case' => 'CsrfFormLogin', 'root_config' => $config)); - $client->insulate(); - - $client->request('GET', '/protected-resource'); - $this->assertRedirect($client->getResponse(), '/login'); - - $form = $client->followRedirect()->selectButton('login')->form(); - $form['user_login[username]'] = 'johannes'; - $form['user_login[password]'] = 'test'; - $client->submit($form); - $this->assertRedirect($client->getResponse(), '/protected-resource'); - - $text = $client->followRedirect()->text(); - $this->assertContains('Hello johannes!', $text); - $this->assertContains('You\'re browsing to path "/protected-resource".', $text); - } - - public function getConfigs() - { - return array( - array('config.yml'), - array('routes_as_path.yml'), - ); - } - - protected function setUp() - { - parent::setUp(); - - $this->deleteTmpDir('CsrfFormLogin'); - } - - protected function tearDown() - { - parent::tearDown(); - - $this->deleteTmpDir('CsrfFormLogin'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/FormLoginTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/FormLoginTest.php deleted file mode 100644 index 0dc038e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/FormLoginTest.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\Functional; - -/** - * @group functional - */ -class FormLoginTest extends WebTestCase -{ - /** - * @dataProvider getConfigs - */ - public function testFormLogin($config) - { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config)); - $client->insulate(); - - $form = $client->request('GET', '/login')->selectButton('login')->form(); - $form['_username'] = 'johannes'; - $form['_password'] = 'test'; - $client->submit($form); - - $this->assertRedirect($client->getResponse(), '/profile'); - - $text = $client->followRedirect()->text(); - $this->assertContains('Hello johannes!', $text); - $this->assertContains('You\'re browsing to path "/profile".', $text); - } - - /** - * @dataProvider getConfigs - */ - public function testFormLoginWithCustomTargetPath($config) - { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config)); - $client->insulate(); - - $form = $client->request('GET', '/login')->selectButton('login')->form(); - $form['_username'] = 'johannes'; - $form['_password'] = 'test'; - $form['_target_path'] = '/foo'; - $client->submit($form); - - $this->assertRedirect($client->getResponse(), '/foo'); - - $text = $client->followRedirect()->text(); - $this->assertContains('Hello johannes!', $text); - $this->assertContains('You\'re browsing to path "/foo".', $text); - } - - /** - * @dataProvider getConfigs - */ - public function testFormLoginRedirectsToProtectedResourceAfterLogin($config) - { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config)); - $client->insulate(); - - $client->request('GET', '/protected_resource'); - $this->assertRedirect($client->getResponse(), '/login'); - - $form = $client->followRedirect()->selectButton('login')->form(); - $form['_username'] = 'johannes'; - $form['_password'] = 'test'; - $client->submit($form); - $this->assertRedirect($client->getResponse(), '/protected_resource'); - - $text = $client->followRedirect()->text(); - $this->assertContains('Hello johannes!', $text); - $this->assertContains('You\'re browsing to path "/protected_resource".', $text); - } - - public function getConfigs() - { - return array( - array('config.yml'), - array('routes_as_path.yml'), - ); - } - - protected function setUp() - { - parent::setUp(); - - $this->deleteTmpDir('StandardFormLogin'); - } - - protected function tearDown() - { - parent::tearDown(); - - $this->deleteTmpDir('StandardFormLogin'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php deleted file mode 100644 index 84c7905..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\Functional; - -class LocalizedRoutesAsPathTest extends WebTestCase -{ - /** - * @dataProvider getLocales - */ - public function testLoginLogoutProcedure($locale) - { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => 'localized_routes.yml')); - $client->insulate(); - - $crawler = $client->request('GET', '/'.$locale.'/login'); - $form = $crawler->selectButton('login')->form(); - $form['_username'] = 'johannes'; - $form['_password'] = 'test'; - $client->submit($form); - - $this->assertRedirect($client->getResponse(), '/'.$locale.'/profile'); - $this->assertEquals('Profile', $client->followRedirect()->text()); - - $client->request('GET', '/'.$locale.'/logout'); - $this->assertRedirect($client->getResponse(), '/'.$locale.'/'); - $this->assertEquals('Homepage', $client->followRedirect()->text()); - } - - /** - * @dataProvider getLocales - */ - public function testLoginFailureWithLocalizedFailurePath($locale) - { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => 'localized_form_failure_handler.yml')); - $client->insulate(); - - $crawler = $client->request('GET', '/'.$locale.'/login'); - $form = $crawler->selectButton('login')->form(); - $form['_username'] = 'johannes'; - $form['_password'] = 'foobar'; - $client->submit($form); - - $this->assertRedirect($client->getResponse(), '/'.$locale.'/login'); - } - - /** - * @dataProvider getLocales - */ - public function testAccessRestrictedResource($locale) - { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => 'localized_routes.yml')); - $client->insulate(); - - $client->request('GET', '/'.$locale.'/secure/'); - $this->assertRedirect($client->getResponse(), '/'.$locale.'/login'); - } - - /** - * @dataProvider getLocales - */ - public function testAccessRestrictedResourceWithForward($locale) - { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => 'localized_routes_with_forward.yml')); - $client->insulate(); - - $crawler = $client->request('GET', '/'.$locale.'/secure/'); - $this->assertCount(1, $crawler->selectButton('login'), (string) $client->getResponse()); - } - - public function getLocales() - { - return array(array('en'), array('de')); - } - - protected function setUp() - { - parent::setUp(); - - $this->deleteTmpDir('StandardFormLogin'); - } - - protected function tearDown() - { - parent::tearDown(); - - $this->deleteTmpDir('StandardFormLogin'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php deleted file mode 100644 index 3ae81bc..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\Functional; - -class SecurityRoutingIntegrationTest extends WebTestCase -{ - /** - * @dataProvider getConfigs - */ - public function testRoutingErrorIsNotExposedForProtectedResourceWhenAnonymous($config) - { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config)); - $client->insulate(); - $client->request('GET', '/protected_resource'); - - $this->assertRedirect($client->getResponse(), '/login'); - } - - /** - * @dataProvider getConfigs - */ - public function testRoutingErrorIsExposedWhenNotProtected($config) - { - if (strpos(PHP_OS, "WIN") === 0 && version_compare(phpversion(), "5.3.9", "<")) { - $this->markTestSkipped('Test hangs on Windows & PHP due to https://bugs.php.net/bug.php?id=60120 fixed in http://svn.php.net/viewvc?view=revision&revision=318366'); - } - - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config)); - $client->insulate(); - $client->request('GET', '/unprotected_resource'); - - $this->assertEquals(404, $client->getResponse()->getStatusCode(), (string) $client->getResponse()); - } - - /** - * @dataProvider getConfigs - */ - public function testRoutingErrorIsNotExposedForProtectedResourceWhenLoggedInWithInsufficientRights($config) - { - if (strpos(PHP_OS, "WIN") === 0 && version_compare(phpversion(), "5.3.9", "<")) { - $this->markTestSkipped('Test hangs on Windows & PHP due to https://bugs.php.net/bug.php?id=60120 fixed in http://svn.php.net/viewvc?view=revision&revision=318366'); - } - - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config)); - $client->insulate(); - - $form = $client->request('GET', '/login')->selectButton('login')->form(); - $form['_username'] = 'johannes'; - $form['_password'] = 'test'; - $client->submit($form); - - $client->request('GET', '/highly_protected_resource'); - - $this->assertNotEquals(404, $client->getResponse()->getStatusCode()); - } - - public function getConfigs() - { - return array(array('config.yml'), array('routes_as_path.yml')); - } - - protected function setUp() - { - parent::setUp(); - - $this->deleteTmpDir('StandardFormLogin'); - } - - protected function tearDown() - { - parent::tearDown(); - - $this->deleteTmpDir('StandardFormLogin'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SwitchUserTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SwitchUserTest.php deleted file mode 100644 index 217e27b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SwitchUserTest.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\Functional; - -/** - * @group functional - */ -class SwitchUserTest extends WebTestCase -{ - /** - * @dataProvider getTestParameters - */ - public function testSwitchUser($originalUser, $targetUser, $expectedUser, $expectedStatus) - { - $client = $this->createAuthenticatedClient($originalUser); - - $client->request('GET', '/profile?_switch_user=' . $targetUser); - - $this->assertEquals($expectedStatus, $client->getResponse()->getStatusCode()); - $this->assertEquals($expectedUser, $client->getProfile()->getCollector('security')->getUser()); - } - - public function testSwitchedUserCannotSwitchToOther() - { - $client = $this->createAuthenticatedClient('user_can_switch'); - - $client->request('GET', '/profile?_switch_user=user_cannot_switch_1'); - $client->request('GET', '/profile?_switch_user=user_cannot_switch_2'); - - $this->assertEquals(500, $client->getResponse()->getStatusCode()); - $this->assertEquals('user_cannot_switch_1', $client->getProfile()->getCollector('security')->getUser()); - } - - public function testSwitchedUserExit() - { - $client = $this->createAuthenticatedClient('user_can_switch'); - - $client->request('GET', '/profile?_switch_user=user_cannot_switch_1'); - $client->request('GET', '/profile?_switch_user=_exit'); - - $this->assertEquals(200, $client->getResponse()->getStatusCode()); - $this->assertEquals('user_can_switch', $client->getProfile()->getCollector('security')->getUser()); - } - - public function getTestParameters() - { - return array( - 'unauthorized_user_cannot_switch' => array('user_cannot_switch_1', 'user_cannot_switch_1', 'user_cannot_switch_1', 403), - 'authorized_user_can_switch' => array('user_can_switch', 'user_cannot_switch_1', 'user_cannot_switch_1', 200), - 'authorized_user_cannot_switch_to_non_existent' => array('user_can_switch', 'user_does_not_exist', 'user_can_switch', 500), - 'authorized_user_can_switch_to_himself' => array('user_can_switch', 'user_can_switch', 'user_can_switch', 200), - ); - } - - protected function createAuthenticatedClient($username) - { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => 'switchuser.yml')); - $client->followRedirects(true); - $client->insulate(); - - $form = $client->request('GET', '/login')->selectButton('login')->form(); - $form['_username'] = $username; - $form['_password'] = 'test'; - $client->submit($form); - - return $client; - } - - protected function setUp() - { - parent::setUp(); - - $this->deleteTmpDir('StandardFormLogin'); - } - - protected function tearDown() - { - parent::tearDown(); - - $this->deleteTmpDir('StandardFormLogin'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/WebTestCase.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/WebTestCase.php deleted file mode 100644 index 3c78d10..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/WebTestCase.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\Functional; - -use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase; -use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\HttpKernel\Kernel; - -class WebTestCase extends BaseWebTestCase -{ - public static function assertRedirect($response, $location) - { - self::assertTrue($response->isRedirect(), 'Response is not a redirect, got status code: '.substr($response, 0, 2000)); - self::assertEquals('http://localhost'.$location, $response->headers->get('Location')); - } - - protected function setUp() - { - if (!class_exists('Twig_Environment')) { - $this->markTestSkipped('Twig is not available.'); - } - - parent::setUp(); - } - - protected function deleteTmpDir($testCase) - { - if (!file_exists($dir = sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$testCase)) { - return; - } - - $fs = new Filesystem(); - $fs->remove($dir); - } - - protected static function getKernelClass() - { - require_once __DIR__.'/app/AppKernel.php'; - - return 'Symfony\Bundle\SecurityBundle\Tests\Functional\AppKernel'; - } - - protected static function createKernel(array $options = array()) - { - $class = self::getKernelClass(); - - if (!isset($options['test_case'])) { - throw new \InvalidArgumentException('The option "test_case" must be set.'); - } - - return new $class( - $options['test_case'], - isset($options['root_config']) ? $options['root_config'] : 'config.yml', - isset($options['environment']) ? $options['environment'] : 'securitybundletest' . strtolower($options['test_case']), - isset($options['debug']) ? $options['debug'] : true - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AppKernel.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AppKernel.php deleted file mode 100644 index dbe618f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AppKernel.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Tests\Functional; - -// get the autoload file -$dir = __DIR__; -$lastDir = null; -while ($dir !== $lastDir) { - $lastDir = $dir; - - if (is_file($dir.'/autoload.php')) { - require_once $dir.'/autoload.php'; - break; - } - - if (is_file($dir.'/autoload.php.dist')) { - require_once $dir.'/autoload.php.dist'; - break; - } - - $dir = dirname($dir); -} - -use Symfony\Component\Config\Loader\LoaderInterface; -use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\HttpKernel\Kernel; - -/** - * App Test Kernel for functional tests. - * - * @author Johannes M. Schmitt - */ -class AppKernel extends Kernel -{ - private $testCase; - private $rootConfig; - - public function __construct($testCase, $rootConfig, $environment, $debug) - { - if (!is_dir(__DIR__.'/'.$testCase)) { - throw new \InvalidArgumentException(sprintf('The test case "%s" does not exist.', $testCase)); - } - $this->testCase = $testCase; - - $fs = new Filesystem(); - if (!$fs->isAbsolutePath($rootConfig) && !is_file($rootConfig = __DIR__.'/'.$testCase.'/'.$rootConfig)) { - throw new \InvalidArgumentException(sprintf('The root config "%s" does not exist.', $rootConfig)); - } - $this->rootConfig = $rootConfig; - - parent::__construct($environment, $debug); - } - - public function registerBundles() - { - if (!is_file($filename = $this->getRootDir().'/'.$this->testCase.'/bundles.php')) { - throw new \RuntimeException(sprintf('The bundles file "%s" does not exist.', $filename)); - } - - return include $filename; - } - - public function init() - { - } - - public function getRootDir() - { - return __DIR__; - } - - public function getCacheDir() - { - return sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$this->testCase.'/cache/'.$this->environment; - } - - public function getLogDir() - { - return sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$this->testCase.'/logs'; - } - - public function registerContainerConfiguration(LoaderInterface $loader) - { - $loader->load($this->rootConfig); - } - - public function serialize() - { - return serialize(array($this->testCase, $this->rootConfig, $this->getEnvironment(), $this->isDebug())); - } - - public function unserialize($str) - { - call_user_func_array(array($this, '__construct'), unserialize($str)); - } - - protected function getKernelParameters() - { - $parameters = parent::getKernelParameters(); - $parameters['kernel.test_case'] = $this->testCase; - - return $parameters; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/bundles.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/bundles.php deleted file mode 100644 index cee883f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/bundles.php +++ /dev/null @@ -1,8 +0,0 @@ - - - - - {% block title %}Welcome!{% endblock %} - {% block stylesheets %}{% endblock %} - - - - {% block body %}{% endblock %} - {% block javascripts %}{% endblock %} - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/bundles.php b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/bundles.php deleted file mode 100644 index e4bbc08..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/bundles.php +++ /dev/null @@ -1,13 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Twig\Extension; - -use Symfony\Bundle\SecurityBundle\Templating\Helper\LogoutUrlHelper; - -/** - * LogoutUrlHelper provides generator functions for the logout URL to Twig. - * - * @author Jeremy Mikola - */ -class LogoutUrlExtension extends \Twig_Extension -{ - private $helper; - - /** - * Constructor. - * - * @param LogoutUrlHelper $helper - */ - public function __construct(LogoutUrlHelper $helper) - { - $this->helper = $helper; - } - - /** - * @see Twig_Extension::getFunctions() - */ - public function getFunctions() - { - return array( - 'logout_url' => new \Twig_Function_Method($this, 'getLogoutUrl'), - 'logout_path' => new \Twig_Function_Method($this, 'getLogoutPath'), - ); - } - - /** - * Generate the relative logout URL for the firewall. - * - * @param string $key The firewall key - * @return string The relative logout URL - */ - public function getLogoutPath($key) - { - return $this->helper->getLogoutPath($key); - } - - /** - * Generate the absolute logout URL for the firewall. - * - * @param string $key The firewall key - * @return string The absolute logout URL - */ - public function getLogoutUrl($key) - { - return $this->helper->getLogoutUrl($key); - } - - /** - * @see Twig_ExtensionInterface::getName() - */ - public function getName() - { - return 'logout_url'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/composer.json b/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/composer.json deleted file mode 100644 index 3530d67..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/composer.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "symfony/security-bundle", - "type": "symfony-bundle", - "description": "Symfony SecurityBundle", - "keywords": [], - "homepage": "http://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "require": { - "php": ">=5.3.3", - "symfony/security": "self.version" - }, - "autoload": { - "psr-0": { "Symfony\\Bundle\\SecurityBundle": "" } - }, - "target-dir": "Symfony/Bundle/SecurityBundle", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/CHANGELOG.md b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/CHANGELOG.md deleted file mode 100644 index 59f86af..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/CHANGELOG.md +++ /dev/null @@ -1,11 +0,0 @@ -CHANGELOG -========= - -2.1.0 ------ - - * added a new setting ("paths") to configure more paths for the Twig filesystem loader - * added contextual escaping based on the template file name (disabled if you explicitly pass an autoescape option) - * added a command that extracts translation messages from templates - * added the real template name when an error occurs in a Twig template - * added the twig:lint command that will validate a Twig template syntax. diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheCacheWarmer.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheCacheWarmer.php deleted file mode 100644 index 47225fb..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheCacheWarmer.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle\CacheWarmer; - -use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinderInterface; - -/** - * Generates the Twig cache for all templates. - * - * This warmer must be registered after TemplatePathsCacheWarmer, - * as the Twig loader will need the cache generated by it. - * - * @author Fabien Potencier - */ -class TemplateCacheCacheWarmer implements CacheWarmerInterface -{ - protected $container; - protected $warmer; - - /** - * Constructor. - * - * @param ContainerInterface $container The dependency injection container - * @param TemplateFinderInterface $finder The template paths cache warmer - */ - public function __construct(ContainerInterface $container, TemplateFinderInterface $finder) - { - // We don't inject the Twig environment directly as it depends on the - // template locator (via the loader) which might be a cached one. - // The cached template locator is available once the TemplatePathsCacheWarmer - // has been warmed up - $this->container = $container; - $this->finder = $finder; - } - - /** - * Warms up the cache. - * - * @param string $cacheDir The cache directory - */ - public function warmUp($cacheDir) - { - $twig = $this->container->get('twig'); - - foreach ($this->finder->findAllTemplates() as $template) { - if ('twig' !== $template->get('engine')) { - continue; - } - - try { - $twig->loadTemplate($template); - } catch (\Twig_Error $e) { - // problem during compilation, give up - } - } - } - - /** - * Checks whether this warmer is optional or not. - * - * @return Boolean always true - */ - public function isOptional() - { - return true; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Command/LintCommand.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Command/LintCommand.php deleted file mode 100644 index 33e44a5..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Command/LintCommand.php +++ /dev/null @@ -1,139 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle\Command; - -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Finder\Finder; - -/** - * Command that will validate your template syntax and output encountered errors. - * - * @author Marc Weistroff - */ -class LintCommand extends ContainerAwareCommand -{ - protected function configure() - { - $this - ->setName('twig:lint') - ->setDescription('Lints a template and outputs eventual errors') - ->addArgument('filename') - ->setHelp(<<%command.name% command lints a template and outputs to stdout -the first encountered syntax error. - -php %command.full_name% filename - -The command gets the contents of filename and validates its syntax. - -php %command.full_name% dirname - -The command finds all twig templates in dirname and validates the syntax -of each Twig template. - -php %command.full_name% @AcmeMyBundle - -The command finds all twig templates in the AcmeMyBundle bundle and validates -the syntax of each Twig template. - -cat filename | php %command.full_name% - -The command gets the template contents from stdin and validates its syntax. -EOF - ) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $twig = $this->getContainer()->get('twig'); - $template = null; - $filename = $input->getArgument('filename'); - - if (!$filename) { - if (0 !== ftell(STDIN)) { - throw new \RuntimeException("Please provide a filename or pipe template content to stdin."); - } - - while (!feof(STDIN)) { - $template .= fread(STDIN, 1024); - } - - return $twig->parse($twig->tokenize($template)); - } - - if (0 !== strpos($filename, '@') && !is_readable($filename)) { - throw new \RuntimeException(sprintf('File or directory "%s" is not readable', $filename)); - } - - $files = array(); - if (is_file($filename)) { - $files = array($filename); - } elseif (is_dir($filename)) { - $files = Finder::create()->files()->in($filename)->name('*.twig'); - } else { - $dir = $this->getApplication()->getKernel()->locateResource($filename); - $files = Finder::create()->files()->in($dir)->name('*.twig'); - } - - $error = false; - foreach ($files as $file) { - try { - $twig->parse($twig->tokenize(file_get_contents($file), (string) $file)); - $output->writeln(sprintf("OK in %s", $file)); - } catch (\Twig_Error $e) { - $this->renderException($output, $file, $e); - $error = true; - } - } - - return $error ? 1 : 0; - } - - protected function renderException(OutputInterface $output, $file, \Twig_Error $exception) - { - $line = $exception->getTemplateLine(); - $lines = $this->getContext($file, $line); - - $output->writeln(sprintf("KO in %s (line %s)", $file, $line)); - foreach ($lines as $no => $code) { - $output->writeln(sprintf( - "%s %-6s %s", - $no == $line ? '>>' : ' ', - $no, - $code - )); - if ($no == $line) { - $output->writeln(sprintf('>> %s ', $exception->getRawMessage())); - } - } - } - - protected function getContext($file, $line, $context = 3) - { - $fileContent = file_get_contents($file); - $lines = explode("\n", $fileContent); - - $position = max(0, $line - $context); - $max = min(count($lines), $line - 1 + $context); - - $result = array(); - while ($position < $max) { - $result[$position + 1] = $lines[$position]; - $position++; - } - - return $result; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php deleted file mode 100644 index 54be66a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php +++ /dev/null @@ -1,114 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle\Controller; - -use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface; -use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference; -use Symfony\Component\DependencyInjection\ContainerAware; -use Symfony\Component\HttpKernel\Exception\FlattenException; -use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; -use Symfony\Component\HttpFoundation\Response; - -/** - * ExceptionController. - * - * @author Fabien Potencier - */ -class ExceptionController extends ContainerAware -{ - /** - * Converts an Exception to a Response. - * - * @param FlattenException $exception A FlattenException instance - * @param DebugLoggerInterface $logger A DebugLoggerInterface instance - * @param string $format The format to use for rendering (html, xml, ...) - * - * @return Response - * - * @throws \InvalidArgumentException When the exception template does not exist - */ - public function showAction(FlattenException $exception, DebugLoggerInterface $logger = null, $format = 'html') - { - $this->container->get('request')->setRequestFormat($format); - - $currentContent = $this->getAndCleanOutputBuffering(); - - $templating = $this->container->get('templating'); - $code = $exception->getStatusCode(); - - return $templating->renderResponse( - $this->findTemplate($templating, $format, $code, $this->container->get('kernel')->isDebug()), - array( - 'status_code' => $code, - 'status_text' => isset(Response::$statusTexts[$code]) ? Response::$statusTexts[$code] : '', - 'exception' => $exception, - 'logger' => $logger, - 'currentContent' => $currentContent, - ) - ); - } - - /** - * @return string - */ - protected function getAndCleanOutputBuffering() - { - // ob_get_level() never returns 0 on some Windows configurations, so if - // the level is the same two times in a row, the loop should be stopped. - $previousObLevel = null; - $startObLevel = $this->container->get('request')->headers->get('X-Php-Ob-Level', -1); - - $currentContent = ''; - - while (($obLevel = ob_get_level()) > $startObLevel && $obLevel !== $previousObLevel) { - $previousObLevel = $obLevel; - $currentContent .= ob_get_clean(); - } - - return $currentContent; - } - - /** - * @param EngineInterface $templating - * @param string $format - * @param integer $code An HTTP response status code - * @param Boolean $debug - * - * @return TemplateReference - */ - protected function findTemplate($templating, $format, $code, $debug) - { - $name = $debug ? 'exception' : 'error'; - if ($debug && 'html' == $format) { - $name = 'exception_full'; - } - - // when not in debug, try to find a template for the specific HTTP status code and format - if (!$debug) { - $template = new TemplateReference('TwigBundle', 'Exception', $name.$code, $format, 'twig'); - if ($templating->exists($template)) { - return $template; - } - } - - // try to find a template for the given format - $template = new TemplateReference('TwigBundle', 'Exception', $name, $format, 'twig'); - if ($templating->exists($template)) { - return $template; - } - - // default to a generic HTML exception - $this->container->get('request')->setRequestFormat('html'); - - return new TemplateReference('TwigBundle', 'Exception', $name, 'html', 'twig'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Debug/TimedTwigEngine.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Debug/TimedTwigEngine.php deleted file mode 100644 index e428401..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Debug/TimedTwigEngine.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle\Debug; - -use Symfony\Bundle\TwigBundle\TwigEngine; -use Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables; -use Symfony\Component\Templating\TemplateNameParserInterface; -use Symfony\Component\HttpKernel\Debug\Stopwatch; -use Symfony\Component\Config\FileLocatorInterface; - -/** - * Times the time spent to render a template. - * - * @author Fabien Potencier - */ -class TimedTwigEngine extends TwigEngine -{ - protected $stopwatch; - - /** - * Constructor. - * - * @param \Twig_Environment $environment A \Twig_Environment instance - * @param TemplateNameParserInterface $parser A TemplateNameParserInterface instance - * @param FileLocatorInterface $locator A FileLocatorInterface instance - * @param Stopwatch $stopwatch A Stopwatch instance - * @param GlobalVariables $globals A GlobalVariables instance - */ - public function __construct(\Twig_Environment $environment, TemplateNameParserInterface $parser, FileLocatorInterface $locator, Stopwatch $stopwatch, GlobalVariables $globals = null) - { - parent::__construct($environment, $parser, $locator, $globals); - - $this->stopwatch = $stopwatch; - } - - /** - * {@inheritdoc} - */ - public function render($name, array $parameters = array()) - { - $e = $this->stopwatch->start(sprintf('template.twig (%s)', $name), 'template'); - - $ret = parent::render($name, $parameters); - - $e->stop(); - - return $ret; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExceptionListenerPass.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExceptionListenerPass.php deleted file mode 100644 index 18d98b3..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExceptionListenerPass.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Registers the Twig exception listener if Twig is registered as a templating engine. - * - * @author Fabien Potencier - */ -class ExceptionListenerPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (false === $container->hasDefinition('twig')) { - return; - } - - // register the exception controller only if Twig is enabled - $engines = $container->getParameter('templating.engines'); - if (!in_array('twig', $engines)) { - $container->removeDefinition('twig.exception_listener'); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigEnvironmentPass.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigEnvironmentPass.php deleted file mode 100644 index 785c597..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigEnvironmentPass.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Adds tagged twig.extension services to twig service - * - * @author Fabien Potencier - */ -class TwigEnvironmentPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (false === $container->hasDefinition('twig')) { - return; - } - - $definition = $container->getDefinition('twig'); - - // Extensions must always be registered before everything else. - // For instance, global variable definitions must be registered - // afterward. If not, the globals from the extensions will never - // be registered. - $calls = $definition->getMethodCalls(); - $definition->setMethodCalls(array()); - foreach ($container->findTaggedServiceIds('twig.extension') as $id => $attributes) { - $definition->addMethodCall('addExtension', array(new Reference($id))); - } - $definition->setMethodCalls(array_merge($definition->getMethodCalls(), $calls)); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php deleted file mode 100644 index 7936d21..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle\DependencyInjection; - -use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; -use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\Config\Definition\ConfigurationInterface; - -/** - * TwigExtension configuration structure. - * - * @author Jeremy Mikola - */ -class Configuration implements ConfigurationInterface -{ - /** - * Generates the configuration tree builder. - * - * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder - */ - public function getConfigTreeBuilder() - { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('twig'); - - $rootNode - ->children() - ->scalarNode('exception_controller')->defaultValue('Symfony\\Bundle\\TwigBundle\\Controller\\ExceptionController::showAction')->end() - ->end() - ; - - $this->addFormSection($rootNode); - $this->addGlobalsSection($rootNode); - $this->addTwigOptions($rootNode); - - return $treeBuilder; - } - - private function addFormSection(ArrayNodeDefinition $rootNode) - { - $rootNode - ->children() - ->arrayNode('form') - ->addDefaultsIfNotSet() - ->fixXmlConfig('resource') - ->children() - ->arrayNode('resources') - ->addDefaultChildrenIfNoneSet() - ->prototype('scalar')->defaultValue('form_div_layout.html.twig')->end() - ->example(array('MyBundle::form.html.twig')) - ->validate() - ->ifTrue(function($v) { return !in_array('form_div_layout.html.twig', $v); }) - ->then(function($v){ - return array_merge(array('form_div_layout.html.twig'), $v); - }) - ->end() - ->end() - ->end() - ->end() - ->end() - ; - } - - private function addGlobalsSection(ArrayNodeDefinition $rootNode) - { - $rootNode - ->fixXmlConfig('global') - ->children() - ->arrayNode('globals') - ->useAttributeAsKey('key') - ->example(array('foo' => '"@bar"', 'pi' => 3.14)) - ->prototype('array') - ->beforeNormalization() - ->ifTrue(function($v){ return is_string($v) && 0 === strpos($v, '@'); }) - ->then(function($v){ return array('id' => substr($v, 1), 'type' => 'service'); }) - ->end() - ->beforeNormalization() - ->ifTrue(function($v){ - if (is_array($v)) { - $keys = array_keys($v); - sort($keys); - - return $keys !== array('id', 'type') && $keys !== array('value'); - } - - return true; - }) - ->then(function($v){ return array('value' => $v); }) - ->end() - ->children() - ->scalarNode('id')->end() - ->scalarNode('type') - ->validate() - ->ifNotInArray(array('service')) - ->thenInvalid('The %s type is not supported') - ->end() - ->end() - ->variableNode('value')->end() - ->end() - ->end() - ->end() - ->end() - ; - } - - private function addTwigOptions(ArrayNodeDefinition $rootNode) - { - $rootNode - ->fixXmlConfig('path') - ->children() - ->scalarNode('autoescape')->end() - ->scalarNode('base_template_class')->example('Twig_Template')->end() - ->scalarNode('cache')->defaultValue('%kernel.cache_dir%/twig')->end() - ->scalarNode('charset')->defaultValue('%kernel.charset%')->end() - ->scalarNode('debug')->defaultValue('%kernel.debug%')->end() - ->scalarNode('strict_variables')->end() - ->scalarNode('auto_reload')->end() - ->scalarNode('optimizations')->end() - ->arrayNode('paths') - ->prototype('variable')->end() - ->end() - ->end() - ; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php deleted file mode 100644 index d65dc9f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php +++ /dev/null @@ -1,125 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle\DependencyInjection; - -use Symfony\Component\Config\FileLocator; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\HttpKernel\DependencyInjection\Extension; - -/** - * TwigExtension. - * - * @author Fabien Potencier - * @author Jeremy Mikola - */ -class TwigExtension extends Extension -{ - /** - * Responds to the twig configuration parameter. - * - * @param array $configs - * @param ContainerBuilder $container - */ - public function load(array $configs, ContainerBuilder $container) - { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('twig.xml'); - - foreach ($configs as &$config) { - if (isset($config['globals'])) { - foreach ($config['globals'] as $name => $value) { - if (is_array($value) && isset($value['key'])) { - $config['globals'][$name] = array( - 'key' => $name, - 'value' => $config['globals'][$name] - ); - } - } - } - } - - $configuration = $this->getConfiguration($configs, $container); - - $config = $this->processConfiguration($configuration, $configs); - - $container->setParameter('twig.exception_listener.controller', $config['exception_controller']); - - $container->setParameter('twig.form.resources', $config['form']['resources']); - - $reflClass = new \ReflectionClass('Symfony\Bridge\Twig\Extension\FormExtension'); - $container->getDefinition('twig.loader')->addMethodCall('addPath', array(dirname(dirname($reflClass->getFileName())).'/Resources/views/Form')); - - if (!empty($config['paths'])) { - foreach ($config['paths'] as $path) { - $container->getDefinition('twig.loader')->addMethodCall('addPath', array($path)); - } - } - - if (!empty($config['globals'])) { - $def = $container->getDefinition('twig'); - foreach ($config['globals'] as $key => $global) { - if (isset($global['type']) && 'service' === $global['type']) { - $def->addMethodCall('addGlobal', array($key, new Reference($global['id']))); - } else { - $def->addMethodCall('addGlobal', array($key, $global['value'])); - } - } - } - - unset( - $config['form'], - $config['globals'], - $config['extensions'] - ); - - $container->setParameter('twig.options', $config); - - if ($container->getParameter('kernel.debug')) { - $loader->load('debug.xml'); - - $container->setDefinition('templating.engine.twig', $container->findDefinition('debug.templating.engine.twig')); - $container->setAlias('debug.templating.engine.twig', 'templating.engine.twig'); - } - - if (!isset($config['autoescape'])) { - $container->findDefinition('templating.engine.twig')->addMethodCall('setDefaultEscapingStrategy', array(array(new Reference('templating.engine.twig'), 'guessDefaultEscapingStrategy'))); - } - - $this->addClassesToCompile(array( - 'Twig_Environment', - 'Twig_Extension', - 'Twig_Extension_Core', - 'Twig_Extension_Escaper', - 'Twig_Extension_Optimizer', - 'Twig_LoaderInterface', - 'Twig_Markup', - 'Twig_Template', - )); - } - - /** - * Returns the base path for the XSD files. - * - * @return string The XSD base path - */ - public function getXsdValidationBasePath() - { - return __DIR__.'/../Resources/config/schema'; - } - - public function getNamespace() - { - return 'http://symfony.com/schema/dic/twig'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Extension/ActionsExtension.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Extension/ActionsExtension.php deleted file mode 100644 index 017bfb4..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Extension/ActionsExtension.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle\Extension; - -use Symfony\Bundle\TwigBundle\TokenParser\RenderTokenParser; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Twig extension for Symfony actions helper - * - * @author Fabien Potencier - */ -class ActionsExtension extends \Twig_Extension -{ - private $container; - - /** - * Constructor. - * - * @param ContainerInterface $container The service container - */ - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - /** - * Returns the Response content for a given controller or URI. - * - * @param string $controller A controller name to execute (a string like BlogBundle:Post:index), or a relative URI - * @param array $attributes An array of request attributes - * @param array $options An array of options - * - * @see Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver::render() - */ - public function renderAction($controller, array $attributes = array(), array $options = array()) - { - return $this->container->get('templating.helper.actions')->render($controller, $attributes, $options); - } - - /** - * Returns the token parser instance to add to the existing list. - * - * @return array An array of Twig_TokenParser instances - */ - public function getTokenParsers() - { - return array( - // {% render 'BlogBundle:Post:list' with { 'limit': 2 }, { 'alt': 'BlogBundle:Post:error' } %} - new RenderTokenParser(), - ); - } - - public function getName() - { - return 'actions'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Extension/AssetsExtension.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Extension/AssetsExtension.php deleted file mode 100644 index 29bb2ec..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Extension/AssetsExtension.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle\Extension; - -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Twig extension for Symfony assets helper - * - * @author Fabien Potencier - */ -class AssetsExtension extends \Twig_Extension -{ - private $container; - - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - /** - * Returns a list of functions to add to the existing list. - * - * @return array An array of functions - */ - public function getFunctions() - { - return array( - 'asset' => new \Twig_Function_Method($this, 'getAssetUrl'), - 'assets_version' => new \Twig_Function_Method($this, 'getAssetsVersion'), - ); - } - - /** - * Returns the public path of an asset. - * - * Absolute paths (i.e. http://...) are returned unmodified. - * - * @param string $path A public path - * @param string $packageName The name of the asset package to use - * - * @return string A public path which takes into account the base path and URL path - */ - public function getAssetUrl($path, $packageName = null) - { - return $this->container->get('templating.helper.assets')->getUrl($path, $packageName); - } - - /** - * Returns the version of the assets in a package. - * - * @param string $packageName - * - * @return int - */ - public function getAssetsVersion($packageName = null) - { - return $this->container->get('templating.helper.assets')->getVersion($packageName); - } - - /** - * Returns the name of the extension. - * - * @return string The extension name - */ - public function getName() - { - return 'assets'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Extension/CodeExtension.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Extension/CodeExtension.php deleted file mode 100644 index d3f16ae..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Extension/CodeExtension.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle\Extension; - -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Twig extension for Symfony code helper - * - * - * @author Fabien Potencier - */ -class CodeExtension extends \Twig_Extension -{ - private $container; - - /** - * Constructor of Twig Extension to provide functions for code formatting - * - * @param ContainerInterface $container A ContainerInterface instance - */ - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - /** - * {@inheritdoc} - */ - public function getFilters() - { - return array( - 'abbr_class' => new \Twig_Filter_Method($this, 'abbrClass', array('is_safe' => array('html'))), - 'abbr_method' => new \Twig_Filter_Method($this, 'abbrMethod', array('is_safe' => array('html'))), - 'format_args' => new \Twig_Filter_Method($this, 'formatArgs', array('is_safe' => array('html'))), - 'format_args_as_text' => new \Twig_Filter_Method($this, 'formatArgsAsText'), - 'file_excerpt' => new \Twig_Filter_Method($this, 'fileExcerpt', array('is_safe' => array('html'))), - 'format_file' => new \Twig_Filter_Method($this, 'formatFile', array('is_safe' => array('html'))), - 'format_file_from_text' => new \Twig_Filter_Method($this, 'formatFileFromText', array('is_safe' => array('html'))), - 'file_link' => new \Twig_Filter_Method($this, 'getFileLink', array('is_safe' => array('html'))), - ); - } - - public function abbrClass($class) - { - return $this->container->get('templating.helper.code')->abbrClass($class); - } - - public function abbrMethod($method) - { - return $this->container->get('templating.helper.code')->abbrMethod($method); - } - - public function formatArgs($args) - { - return $this->container->get('templating.helper.code')->formatArgs($args); - } - - public function formatArgsAsText($args) - { - return $this->container->get('templating.helper.code')->formatArgsAsText($args); - } - - public function fileExcerpt($file, $line) - { - return $this->container->get('templating.helper.code')->fileExcerpt($file, $line); - } - - public function formatFile($file, $line, $text = null) - { - return $this->container->get('templating.helper.code')->formatFile($file, $line, $text); - } - - public function getFileLink($file, $line) - { - return $this->container->get('templating.helper.code')->getFileLink($file, $line); - } - - public function formatFileFromText($text) - { - return $this->container->get('templating.helper.code')->formatFileFromText($text); - } - - public function getName() - { - return 'code'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/LICENSE b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/LICENSE deleted file mode 100644 index cdffe7a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2012 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php deleted file mode 100644 index a79d35c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle\Loader; - -use Symfony\Component\Templating\TemplateNameParserInterface; -use Symfony\Component\Config\FileLocatorInterface; - -/** - * FilesystemLoader extends the default Twig filesystem loader - * to work with the Symfony2 paths. - * - * @author Fabien Potencier - */ -class FilesystemLoader extends \Twig_Loader_Filesystem -{ - protected $locator; - protected $parser; - - /** - * Constructor. - * - * @param FileLocatorInterface $locator A FileLocatorInterface instance - * @param TemplateNameParserInterface $parser A TemplateNameParserInterface instance - */ - public function __construct(FileLocatorInterface $locator, TemplateNameParserInterface $parser) - { - parent::__construct(array()); - - $this->locator = $locator; - $this->parser = $parser; - $this->cache = array(); - } - - /** - * Returns the path to the template file. - * - * The file locator is used to locate the template when the naming convention - * is the symfony one (i.e. the name can be parsed). - * Otherwise the template is located using the locator from the twig library. - * - * @param string|TemplateReferenceInterface $template The template - * - * @return string The path to the template file - * - * @throws \Twig_Error_Loader if the template could not be found - */ - protected function findTemplate($template) - { - $logicalName = (string) $template; - - if (isset($this->cache[$logicalName])) { - return $this->cache[$logicalName]; - } - - $file = null; - $previous = null; - try { - $template = $this->parser->parse($template); - try { - $file = $this->locator->locate($template); - } catch (\InvalidArgumentException $e) { - $previous = $e; - } - } catch (\Exception $e) { - try { - $file = parent::findTemplate($template); - } catch (\Twig_Error_Loader $e) { - $previous = $e; - } - } - - if (false === $file || null === $file) { - throw new \Twig_Error_Loader(sprintf('Unable to find template "%s".', $logicalName), -1, null, $previous); - } - - return $this->cache[$logicalName] = $file; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Node/RenderNode.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Node/RenderNode.php deleted file mode 100644 index 3c40f3c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Node/RenderNode.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle\Node; - -/** - * Represents a render node. - * - * @author Fabien Potencier - */ -class RenderNode extends \Twig_Node -{ - public function __construct(\Twig_Node_Expression $expr, \Twig_Node_Expression $attributes, \Twig_Node_Expression $options, $lineno, $tag = null) - { - parent::__construct(array('expr' => $expr, 'attributes' => $attributes, 'options' => $options), array(), $lineno, $tag); - } - - /** - * Compiles the node to PHP. - * - * @param \Twig_Compiler $compiler A Twig_Compiler instance - */ - public function compile(\Twig_Compiler $compiler) - { - $compiler - ->addDebugInfo($this) - ->write("echo \$this->env->getExtension('actions')->renderAction(") - ->subcompile($this->getNode('expr')) - ->raw(', ') - ->subcompile($this->getNode('attributes')) - ->raw(', ') - ->subcompile($this->getNode('options')) - ->raw(");\n") - ; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/config/debug.xml b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/config/debug.xml deleted file mode 100644 index 2857e18..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/config/debug.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - Symfony\Bundle\TwigBundle\Debug\TimedTwigEngine - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/config/schema/twig-1.0.xsd b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/config/schema/twig-1.0.xsd deleted file mode 100644 index 2a72ef6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/config/schema/twig-1.0.xsd +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml deleted file mode 100644 index eae0a49..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - Twig_Environment - Symfony\Bundle\TwigBundle\Loader\FilesystemLoader - Symfony\Bundle\TwigBundle\TwigEngine - Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer - Symfony\Bridge\Twig\Extension\TranslationExtension - Symfony\Bundle\TwigBundle\Extension\AssetsExtension - Symfony\Bundle\TwigBundle\Extension\ActionsExtension - Symfony\Bundle\TwigBundle\Extension\CodeExtension - Symfony\Bridge\Twig\Extension\RoutingExtension - Symfony\Bridge\Twig\Extension\YamlExtension - Symfony\Bridge\Twig\Extension\FormExtension - Symfony\Bridge\Twig\Form\TwigRendererEngine - Symfony\Bridge\Twig\Form\TwigRenderer - Symfony\Bridge\Twig\Translation\TwigExtractor - Symfony\Component\HttpKernel\EventListener\ExceptionListener - - - - - - %twig.options% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %twig.form.resources% - - - - - - - - - - - - - - - - %twig.exception_listener.controller% - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.atom.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.atom.twig deleted file mode 100644 index 9c1ab3e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.atom.twig +++ /dev/null @@ -1 +0,0 @@ -{% include 'TwigBundle:Exception:error.xml.twig' with { 'exception': exception } %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.css.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.css.twig deleted file mode 100644 index d8a9369..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.css.twig +++ /dev/null @@ -1,4 +0,0 @@ -/* -{{ status_code }} {{ status_text }} - -*/ diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.html.twig deleted file mode 100644 index 22d0c3a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.html.twig +++ /dev/null @@ -1,17 +0,0 @@ - - - - - An Error Occurred: {{ status_text }} - - -

    Oops! An Error Occurred

    -

    The server returned a "{{ status_code }} {{ status_text }}".

    - -
    - Something is broken. Please e-mail us at [email] and let us know - what you were doing when this error occurred. We will fix it as soon - as possible. Sorry for any inconvenience caused. -
    - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.js.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.js.twig deleted file mode 100644 index d8a9369..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.js.twig +++ /dev/null @@ -1,4 +0,0 @@ -/* -{{ status_code }} {{ status_text }} - -*/ diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.json.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.json.twig deleted file mode 100644 index fc19fd8..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.json.twig +++ /dev/null @@ -1 +0,0 @@ -{{ { 'error': { 'code': status_code, 'message': status_text } }|json_encode|raw }} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.rdf.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.rdf.twig deleted file mode 100644 index 9c1ab3e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.rdf.twig +++ /dev/null @@ -1 +0,0 @@ -{% include 'TwigBundle:Exception:error.xml.twig' with { 'exception': exception } %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.txt.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.txt.twig deleted file mode 100644 index b621b08..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.txt.twig +++ /dev/null @@ -1,8 +0,0 @@ -Oops! An Error Occurred -======================= - -The server returned a "{{ status_code }} {{ status_text }}". - -Please e-mail us at [email] and let us know what you were doing when this -error occurred. We will fix it as soon as possible. Sorry for any -inconvenience caused. diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.xml.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.xml.twig deleted file mode 100644 index 5ea8f56..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.xml.twig +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.atom.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.atom.twig deleted file mode 100644 index 989740f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.atom.twig +++ /dev/null @@ -1 +0,0 @@ -{% include 'TwigBundle:Exception:exception.xml.twig' with { 'exception': exception } %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.css.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.css.twig deleted file mode 100644 index 870d4a0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.css.twig +++ /dev/null @@ -1,3 +0,0 @@ -/* -{% include 'TwigBundle:Exception:exception.txt.twig' with { 'exception': exception } %} -*/ diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.html.twig deleted file mode 100644 index a3d953a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.html.twig +++ /dev/null @@ -1,129 +0,0 @@ -
    - -
    -
    -
    - Exception detected! -
    -
    - -
    - -
    - -

    - {{ exception.message|nl2br|format_file_from_text }} -

    - -
    - {{ status_code }} {{ status_text }} - {{ exception.class|abbr_class }} -
    - - {% set previous_count = exception.allPrevious|length %} - {% if previous_count %} -
    {{ previous_count }} linked Exception{{ previous_count > 1 ? 's' : '' }}: -
      - {% for i, previous in exception.allPrevious %} -
    • - {{ previous.class|abbr_class }} » -
    • - {% endfor %} -
    -
    - {% endif %} - -
    - -
    - -
    -
    -
    - - {% for position, e in exception.toarray %} - {% include 'TwigBundle:Exception:traces.html.twig' with { 'exception': e, 'position': position, 'count': previous_count } only %} - {% endfor %} - - {% if logger %} -
    -
    - {% spaceless %} -

    - Logs  - - - - - -

    - {% endspaceless %} - - {% if logger.counterrors %} -
    - - {{ logger.counterrors }} error{{ logger.counterrors > 1 ? 's' : ''}} - -
    - {% endif %} - -
    - -
    - {% include 'TwigBundle:Exception:logs.html.twig' with { 'logs': logger.logs } only %} -
    - -
    - {% endif %} - - {% if currentContent %} -
    - {% spaceless %} -

    - Content of the Output  - - - + - -

    - {% endspaceless %} - - - -
    -
    - {% endif %} - -
    - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.js.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.js.twig deleted file mode 100644 index 870d4a0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.js.twig +++ /dev/null @@ -1,3 +0,0 @@ -/* -{% include 'TwigBundle:Exception:exception.txt.twig' with { 'exception': exception } %} -*/ diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.json.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.json.twig deleted file mode 100644 index 042e082..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.json.twig +++ /dev/null @@ -1 +0,0 @@ -{{ exception.toarray|json_encode|raw }} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.rdf.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.rdf.twig deleted file mode 100644 index 989740f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.rdf.twig +++ /dev/null @@ -1 +0,0 @@ -{% include 'TwigBundle:Exception:exception.xml.twig' with { 'exception': exception } %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.txt.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.txt.twig deleted file mode 100644 index 3c7a912..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.txt.twig +++ /dev/null @@ -1,7 +0,0 @@ -[exception] {{ status_code ~ ' | ' ~ status_text ~ ' | ' ~ exception.class }} -[message] {{ exception.message }} -{% for i, e in exception.toarray %} -[{{ i + 1 }}] {{ e.class }}: {{ e.message }} -{% include 'TwigBundle:Exception:traces.txt.twig' with { 'exception': e } only %} - -{% endfor %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.xml.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.xml.twig deleted file mode 100644 index fa99d44..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.xml.twig +++ /dev/null @@ -1,9 +0,0 @@ - - - -{% for e in exception.toarray %} - -{% include 'TwigBundle:Exception:traces.xml.twig' with { 'exception': e } only %} - -{% endfor %} - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception_full.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception_full.html.twig deleted file mode 100644 index 78a07c0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception_full.html.twig +++ /dev/null @@ -1,9 +0,0 @@ -{% extends 'TwigBundle::layout.html.twig' %} - -{% block title %} - {{ exception.message }} ({{ status_code }} {{ status_text }}) -{% endblock %} - -{% block body %} - {% include 'TwigBundle:Exception:exception.html.twig' %} -{% endblock %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/logs.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/logs.html.twig deleted file mode 100644 index f75ec58..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/logs.html.twig +++ /dev/null @@ -1,7 +0,0 @@ -
      - {% for log in logs %} - = 400 %} class="error"{% elseif log.priority >= 300 %} class="warning"{% endif %}> - {{ log.priorityName }} - {{ log.message }} - - {% endfor %} -
    diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.html.twig deleted file mode 100644 index cc2e0dd..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.html.twig +++ /dev/null @@ -1,22 +0,0 @@ -{% if trace.function %} - at - - {{ trace.short_class }} - {{ trace.type ~ trace.function }} - - ({{ trace.args|format_args }}) -{% endif %} - -{% if trace.file is defined and trace.file and trace.line is defined and trace.line %} - {{ trace.function ? '
    ' : '' }} - in {{ trace.file|format_file(trace.line) }}  - {% spaceless %} - - - - + - - {% endspaceless %} -
    - {{ trace.file|file_excerpt(trace.line) }} -
    -{% endif %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.txt.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.txt.twig deleted file mode 100644 index 1b3b77d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.txt.twig +++ /dev/null @@ -1,8 +0,0 @@ -{% if trace.function %} - at {{ trace.class ~ trace.type ~ trace.function }}({{ trace.args|format_args_as_text }}) -{% else %} - at n/a -{% endif %} -{% if trace.file is defined and trace.line is defined %} - in {{ trace.file }} line {{ trace.line }} -{% endif %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.html.twig deleted file mode 100644 index f82b754..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.html.twig +++ /dev/null @@ -1,25 +0,0 @@ -
    - {% if count > 0 %} -

    - [{{ count - position + 1 }}/{{ count + 1 }}] - {{ exception.class|abbr_class }}: {{ exception.message|nl2br|format_file_from_text }}  - {% spaceless %} - - - - + - - {% endspaceless %} -

    - {% else %} -

    Stack Trace

    - {% endif %} - - -
      - {% for i, trace in exception.trace %} -
    1. - {% include 'TwigBundle:Exception:trace.html.twig' with { 'prefix': position, 'i': i, 'trace': trace } only %} -
    2. - {% endfor %} -
    -
    diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.txt.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.txt.twig deleted file mode 100644 index 2cb3ba4..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.txt.twig +++ /dev/null @@ -1,6 +0,0 @@ -{% if exception.trace|length %} -{% for trace in exception.trace %} -{% include 'TwigBundle:Exception:trace.txt.twig' with { 'trace': trace } only %} - -{% endfor %} -{% endif %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.xml.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.xml.twig deleted file mode 100644 index 133a626..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.xml.twig +++ /dev/null @@ -1,8 +0,0 @@ - -{% for trace in exception.trace %} - -{% include 'TwigBundle:Exception:trace.txt.twig' with { 'trace': trace } only %} - - -{% endfor %} - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/layout.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/layout.html.twig deleted file mode 100644 index d8c359c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/layout.html.twig +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - {% block title '' %} - - - - -
    -
    - - - -
    - - {% block body '' %} -
    - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php deleted file mode 100644 index 3940083..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle\Tests\Controller; - -use Symfony\Bundle\TwigBundle\Tests\TestCase; - -use Symfony\Bundle\TwigBundle\Controller\ExceptionController; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Scope; -use Symfony\Component\HttpFoundation\Request; - -class ExceptionControllerTest extends TestCase -{ - protected $controller; - protected $container; - protected $flatten; - protected $templating; - protected $kernel; - - protected function setUp() - { - parent::setUp(); - - $this->flatten = $this->getMock('Symfony\Component\HttpKernel\Exception\FlattenException'); - $this->flatten - ->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue(404)); - $this->controller = new ExceptionController(); - $this->kernel = $this->getMock('Symfony\\Component\\HttpKernel\\KernelInterface'); - $this->templating = $this->getMockBuilder('Symfony\\Bundle\\TwigBundle\\TwigEngine') - ->disableOriginalConstructor() - ->getMock(); - $this->templating - ->expects($this->any()) - ->method('renderResponse') - ->will($this->returnValue($this->getMock('Symfony\Component\HttpFoundation\Response'))); - $this->request = Request::create('/'); - $this->container = $this->getContainer(); - } - - protected function tearDown() - { - parent::tearDown(); - - $this->controller = null; - $this->container = null; - $this->flatten = null; - $this->templating = null; - $this->kernel = null; - } - - public function testOnlyClearOwnOutputBuffers() - { - $this->request->headers->set('X-Php-Ob-Level', 1); - - $this->controller->setContainer($this->container); - $this->controller->showAction($this->flatten); - } - - private function getContainer() - { - $container = new ContainerBuilder(); - $container->addScope(new Scope('request')); - $container->set('request', $this->request); - $container->set('templating', $this->templating); - $container->setParameter('kernel.bundles', array()); - $container->setParameter('kernel.cache_dir', __DIR__); - $container->setParameter('kernel.root_dir', __DIR__); - $container->set('kernel', $this->kernel); - - return $container; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/full.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/full.php deleted file mode 100644 index ba3150e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/full.php +++ /dev/null @@ -1,22 +0,0 @@ -loadFromExtension('twig', array( - 'form' => array( - 'resources' => array( - 'MyBundle::form.html.twig', - ) - ), - 'globals' => array( - 'foo' => '@bar', - 'pi' => 3.14, - 'bad' => array('key' => 'foo'), - ), - 'auto_reload' => true, - 'autoescape' => true, - 'base_template_class' => 'stdClass', - 'cache' => '/tmp', - 'charset' => 'ISO-8859-1', - 'debug' => true, - 'strict_variables' => true, - 'paths' => array('path1', 'path2'), -)); diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/xml/full.xml b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/xml/full.xml deleted file mode 100644 index 63cbe3e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/xml/full.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - MyBundle::form.html.twig - - - 3.14 - path1 - path2 - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/yml/full.yml b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/yml/full.yml deleted file mode 100644 index 8378e33..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/yml/full.yml +++ /dev/null @@ -1,16 +0,0 @@ -twig: - form: - resources: - - MyBundle::form.html.twig - globals: - foo: "@bar" - pi: 3.14 - bad: {key: foo} - auto_reload: true - autoescape: true - base_template_class: stdClass - cache: /tmp - charset: ISO-8859-1 - debug: true - strict_variables: true - paths: [path1, path2] diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php deleted file mode 100644 index eccc1f2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php +++ /dev/null @@ -1,158 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle\Tests\DependencyInjection; - -use Symfony\Bundle\TwigBundle\DependencyInjection\TwigExtension; -use Symfony\Bundle\TwigBundle\Tests\TestCase; -use Symfony\Component\Config\FileLocator; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; - -class TwigExtensionTest extends TestCase -{ - public function testLoadEmptyConfiguration() - { - $container = $this->createContainer(); - $container->registerExtension(new TwigExtension()); - $container->loadFromExtension('twig', array()); - $this->compileContainer($container); - - $this->assertEquals('Twig_Environment', $container->getParameter('twig.class'), '->load() loads the twig.xml file'); - $this->assertContains('form_div_layout.html.twig', $container->getParameter('twig.form.resources'), '->load() includes default template for form resources'); - - // Twig options - $options = $container->getParameter('twig.options'); - $this->assertEquals(__DIR__.'/twig', $options['cache'], '->load() sets default value for cache option'); - $this->assertEquals('UTF-8', $options['charset'], '->load() sets default value for charset option'); - $this->assertFalse($options['debug'], '->load() sets default value for debug option'); - } - - /** - * @dataProvider getFormats - */ - public function testLoadFullConfiguration($format) - { - $container = $this->createContainer(); - $container->registerExtension(new TwigExtension()); - $this->loadFromFile($container, 'full', $format); - $this->compileContainer($container); - - $this->assertEquals('Twig_Environment', $container->getParameter('twig.class'), '->load() loads the twig.xml file'); - - // Form resources - $resources = $container->getParameter('twig.form.resources'); - $this->assertContains('form_div_layout.html.twig', $resources, '->load() includes default template for form resources'); - $this->assertContains('MyBundle::form.html.twig', $resources, '->load() merges new templates into form resources'); - - // Globals - $calls = $container->getDefinition('twig')->getMethodCalls(); - $this->assertEquals('foo', $calls[0][1][0], '->load() registers services as Twig globals'); - $this->assertEquals(new Reference('bar'), $calls[0][1][1], '->load() registers services as Twig globals'); - $this->assertEquals('pi', $calls[1][1][0], '->load() registers variables as Twig globals'); - $this->assertEquals(3.14, $calls[1][1][1], '->load() registers variables as Twig globals'); - - // Yaml and Php specific configs - if (in_array($format, array('yml', 'php'))) { - $this->assertEquals('bad', $calls[2][1][0], '->load() registers variables as Twig globals'); - $this->assertEquals(array('key' => 'foo'), $calls[2][1][1], '->load() registers variables as Twig globals'); - } - - // Twig options - $options = $container->getParameter('twig.options'); - $this->assertTrue($options['auto_reload'], '->load() sets the auto_reload option'); - $this->assertTrue($options['autoescape'], '->load() sets the autoescape option'); - $this->assertEquals('stdClass', $options['base_template_class'], '->load() sets the base_template_class option'); - $this->assertEquals('/tmp', $options['cache'], '->load() sets the cache option'); - $this->assertEquals('ISO-8859-1', $options['charset'], '->load() sets the charset option'); - $this->assertTrue($options['debug'], '->load() sets the debug option'); - $this->assertTrue($options['strict_variables'], '->load() sets the strict_variables option'); - } - - public function testGlobalsWithDifferentTypesAndValues() - { - $globals = array( - 'array' => array(), - 'false' => false, - 'float' => 2.0, - 'integer' => 3, - 'null' => null, - 'object' => new \stdClass(), - 'string' => 'foo', - 'true' => true, - ); - - $container = $this->createContainer(); - $container->registerExtension(new TwigExtension()); - $container->loadFromExtension('twig', array('globals' => $globals)); - $this->compileContainer($container); - - $calls = $container->getDefinition('twig')->getMethodCalls(); - - foreach ($calls as $call) { - list($name, $value) = each($globals); - $this->assertEquals($name, $call[1][0]); - $this->assertSame($value, $call[1][1]); - } - } - - public function getFormats() - { - return array( - array('php'), - array('yml'), - array('xml'), - ); - } - - private function createContainer() - { - $container = new ContainerBuilder(new ParameterBag(array( - 'kernel.cache_dir' => __DIR__, - 'kernel.charset' => 'UTF-8', - 'kernel.debug' => false, - ))); - - return $container; - } - - private function compileContainer(ContainerBuilder $container) - { - $container->getCompilerPassConfig()->setOptimizationPasses(array()); - $container->getCompilerPassConfig()->setRemovingPasses(array()); - $container->compile(); - } - - private function loadFromFile(ContainerBuilder $container, $file, $format) - { - $locator = new FileLocator(__DIR__.'/Fixtures/'.$format); - - switch ($format) { - case 'php': - $loader = new PhpFileLoader($container, $locator); - break; - case 'xml': - $loader = new XmlFileLoader($container, $locator); - break; - case 'yml': - $loader = new YamlFileLoader($container, $locator); - break; - default: - throw new \InvalidArgumentException('Unsupported format: '.$format); - } - - $loader->load($file.'.'.$format); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/Loader/FilesystemLoaderTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/Loader/FilesystemLoaderTest.php deleted file mode 100644 index 0d29d30..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/Loader/FilesystemLoaderTest.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle\Tests\Loader; - -use Symfony\Bundle\TwigBundle\Tests\TestCase; -use Symfony\Bundle\TwigBundle\Loader\FilesystemLoader; -use Symfony\Component\Config\FileLocatorInterface; -use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference; -use Symfony\Component\Templating\TemplateNameParserInterface; -use InvalidArgumentException; - -class FilesystemLoaderTest extends TestCase -{ - /** @var FileLocatorInterface */ - private $locator; - /** @var TemplateNameParserInterface */ - private $parser; - /** @var FilesystemLoader */ - private $loader; - - protected function setUp() - { - parent::setUp(); - - $this->locator = $this->getMock('Symfony\Component\Config\FileLocatorInterface'); - $this->parser = $this->getMock('Symfony\Component\Templating\TemplateNameParserInterface'); - $this->loader = new FilesystemLoader($this->locator, $this->parser); - - $this->parser->expects($this->once()) - ->method('parse') - ->with('name.format.engine') - ->will($this->returnValue(new TemplateReference('', '', 'name', 'format', 'engine'))) - ; - } - - protected function tearDown() - { - parent::tearDown(); - - $this->locator = null; - $this->parser = null; - $this->loader = null; - } - - public function testTwigErrorIfLocatorThrowsInvalid() - { - $this->setExpectedException('Twig_Error_Loader'); - $invalidException = new InvalidArgumentException('Unable to find template "NonExistent".'); - $this->locator->expects($this->once()) - ->method('locate') - ->will($this->throwException($invalidException)); - - $this->loader->getCacheKey('name.format.engine'); - } - - public function testTwigErrorIfLocatorReturnsFalse() - { - $this->setExpectedException('Twig_Error_Loader'); - $this->locator->expects($this->once()) - ->method('locate') - ->will($this->returnValue(false)); - - $this->loader->getCacheKey('name.format.engine'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/TestCase.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/TestCase.php deleted file mode 100644 index a3848ef..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/TestCase.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle\Tests; - -class TestCase extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!class_exists('Twig_Environment')) { - $this->markTestSkipped('Twig is not available.'); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/TwigEngineTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/TwigEngineTest.php deleted file mode 100644 index f15ef3f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/TwigEngineTest.php +++ /dev/null @@ -1,94 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle\Tests; - -use Symfony\Bundle\TwigBundle\TwigEngine; -use Symfony\Component\DependencyInjection\Container; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Session\Session; -use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; -use Symfony\Component\Templating\TemplateNameParser; -use Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables; - -class TwigEngineTest extends TestCase -{ - public function testEvaluateAddsAppGlobal() - { - $environment = $this->getTwigEnvironment(); - $container = $this->getContainer(); - $locator = $this->getMock('Symfony\Component\Config\FileLocatorInterface'); - $engine = new TwigEngine($environment, new TemplateNameParser(), $locator, $app = new GlobalVariables($container)); - - $template = $this->getMock('\Twig_TemplateInterface'); - - $environment->expects($this->once()) - ->method('loadTemplate') - ->will($this->returnValue($template)); - - $engine->render('name'); - - $request = $container->get('request'); - $globals = $environment->getGlobals(); - $this->assertSame($app, $globals['app']); - } - - public function testEvaluateWithoutAvailableRequest() - { - $environment = $this->getTwigEnvironment(); - $container = new Container(); - $locator = $this->getMock('Symfony\Component\Config\FileLocatorInterface'); - $engine = new TwigEngine($environment, new TemplateNameParser(), $locator, new GlobalVariables($container)); - - $template = $this->getMock('\Twig_TemplateInterface'); - - $environment->expects($this->once()) - ->method('loadTemplate') - ->will($this->returnValue($template)); - - $container->set('request', null); - - $engine->render('name'); - - $globals = $environment->getGlobals(); - $this->assertEmpty($globals['app']->getRequest()); - } - - /** - * Creates a Container with a Session-containing Request service. - * - * @return Container - */ - protected function getContainer() - { - $container = new Container(); - $request = new Request(); - $session = new Session(new MockArraySessionStorage()); - - $request->setSession($session); - $container->set('request', $request); - - return $container; - } - - /** - * Creates a mock Twig_Environment object. - * - * @return \Twig_Environment - */ - protected function getTwigEnvironment() - { - return $this - ->getMockBuilder('\Twig_Environment') - ->setMethods(array('loadTemplate')) - ->getMock(); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TokenParser/RenderTokenParser.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TokenParser/RenderTokenParser.php deleted file mode 100644 index 272324b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TokenParser/RenderTokenParser.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle\TokenParser; - -use Symfony\Bundle\TwigBundle\Node\RenderNode; - -/** - * Token Parser for the render tag. - * - * @author Fabien Potencier - */ -class RenderTokenParser extends \Twig_TokenParser -{ - /** - * Parses a token and returns a node. - * - * @param \Twig_Token $token A \Twig_Token instance - * - * @return \Twig_NodeInterface A \Twig_NodeInterface instance - */ - public function parse(\Twig_Token $token) - { - $expr = $this->parser->getExpressionParser()->parseExpression(); - - // attributes - if ($this->parser->getStream()->test(\Twig_Token::NAME_TYPE, 'with')) { - $this->parser->getStream()->next(); - - $hasAttributes = true; - $attributes = $this->parser->getExpressionParser()->parseExpression(); - } else { - $hasAttributes = false; - $attributes = new \Twig_Node_Expression_Array(array(), $token->getLine()); - } - - // options - if ($hasAttributes && $this->parser->getStream()->test(\Twig_Token::PUNCTUATION_TYPE, ',')) { - $this->parser->getStream()->next(); - - $options = $this->parser->getExpressionParser()->parseExpression(); - } else { - $options = new \Twig_Node_Expression_Array(array(), $token->getLine()); - } - - $this->parser->getStream()->expect(\Twig_Token::BLOCK_END_TYPE); - - return new RenderNode($expr, $attributes, $options, $token->getLine(), $this->getTag()); - } - - /** - * Gets the tag name associated with this token parser. - * - * @return string The tag name - */ - public function getTag() - { - return 'render'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TwigBundle.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TwigBundle.php deleted file mode 100644 index a67756c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TwigBundle.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Bundle\TwigBundle\DependencyInjection\Compiler\TwigEnvironmentPass; -use Symfony\Bundle\TwigBundle\DependencyInjection\Compiler\ExceptionListenerPass; - -/** - * Bundle. - * - * @author Fabien Potencier - */ -class TwigBundle extends Bundle -{ - public function build(ContainerBuilder $container) - { - parent::build($container); - - $container->addCompilerPass(new TwigEnvironmentPass()); - $container->addCompilerPass(new ExceptionListenerPass()); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TwigEngine.php b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TwigEngine.php deleted file mode 100644 index 53a2ca2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TwigEngine.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\TwigBundle; - -use Symfony\Bridge\Twig\TwigEngine as BaseEngine; -use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface; -use Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables; -use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference; -use Symfony\Component\Templating\TemplateNameParserInterface; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Config\FileLocatorInterface; - -/** - * This engine renders Twig templates. - * - * @author Fabien Potencier - */ -class TwigEngine extends BaseEngine implements EngineInterface -{ - protected $locator; - - /** - * Constructor. - * - * @param \Twig_Environment $environment A \Twig_Environment instance - * @param TemplateNameParserInterface $parser A TemplateNameParserInterface instance - * @param FileLocatorInterface $locator A FileLocatorInterface instance - * @param GlobalVariables|null $globals A GlobalVariables instance or null - */ - public function __construct(\Twig_Environment $environment, TemplateNameParserInterface $parser, FileLocatorInterface $locator, GlobalVariables $globals = null) - { - parent::__construct($environment, $parser); - - $this->locator = $locator; - - if (null !== $globals) { - $environment->addGlobal('app', $globals); - } - } - - public function setDefaultEscapingStrategy($strategy) - { - $this->environment->getExtension('escaper')->setDefaultStrategy($strategy); - } - - public function guessDefaultEscapingStrategy($filename) - { - // remove .twig - $filename = substr($filename, 0, -5); - - // get the format - $format = substr($filename, strrpos($filename, '.') + 1); - - if ('js' === $format) { - return 'js'; - } - - return 'html'; - } - - /** - * Renders a template. - * - * @param mixed $name A template name - * @param array $parameters An array of parameters to pass to the template - * - * @return string The evaluated template as a string - * - * @throws \InvalidArgumentException if the template does not exist - * @throws \RuntimeException if the template cannot be rendered - */ - public function render($name, array $parameters = array()) - { - try { - return parent::render($name, $parameters); - } catch (\Twig_Error $e) { - if ($name instanceof TemplateReference) { - try { - // try to get the real file name of the template where the error occurred - $e->setTemplateFile(sprintf('%s', $this->locator->locate($this->parser->parse($e->getTemplateFile())))); - } catch (\Exception $ex) { - } - } - - throw $e; - } - } - - /** - * Renders a view and returns a Response. - * - * @param string $view The view name - * @param array $parameters An array of parameters to pass to the view - * @param Response $response A Response instance - * - * @return Response A Response instance - */ - public function renderResponse($view, array $parameters = array(), Response $response = null) - { - if (null === $response) { - $response = new Response(); - } - - $response->setContent($this->render($view, $parameters)); - - return $response; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/composer.json b/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/composer.json deleted file mode 100644 index 22538b2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/composer.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "symfony/twig-bundle", - "type": "symfony-bundle", - "description": "Symfony TwigBundle", - "keywords": [], - "homepage": "http://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "require": { - "php": ">=5.3.3", - "symfony/twig-bridge": "self.version" - }, - "autoload": { - "psr-0": { "Symfony\\Bundle\\TwigBundle": "" } - }, - "target-dir": "Symfony/Bundle/TwigBundle", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md deleted file mode 100644 index 38cac53..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md +++ /dev/null @@ -1,14 +0,0 @@ -CHANGELOG -========= - -2.1.0 ------ - - * deprecated the verbose setting (not relevant anymore) - * [BC BREAK] You must clear old profiles after upgrading to 2.1 (don't forget - to remove the table if you are using a DB) - * added support for the request method - * added a routing panel - * added a timeline panel - * The toolbar position can now be configured via the `position` option (can - be `top` or `bottom`) diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php deleted file mode 100644 index f646d50..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\WebProfilerBundle\Controller; - -use Symfony\Component\HttpKernel\Exception\FlattenException; -use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Bundle\TwigBundle\Controller\ExceptionController as BaseExceptionController; - -/** - * ExceptionController. - * - * @author Fabien Potencier - */ -class ExceptionController extends BaseExceptionController -{ - /** - * {@inheritdoc} - */ - public function showAction(FlattenException $exception, DebugLoggerInterface $logger = null, $format = 'html') - { - $template = $this->container->get('kernel')->isDebug() ? 'exception' : 'error'; - $code = $exception->getStatusCode(); - - return $this->container->get('templating')->renderResponse( - 'TwigBundle:Exception:'.$template.'.html.twig', - array( - 'status_code' => $code, - 'status_text' => Response::$statusTexts[$code], - 'exception' => $exception, - 'logger' => null, - 'currentContent' => '', - ) - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php deleted file mode 100644 index 3eebc77..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php +++ /dev/null @@ -1,330 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\WebProfilerBundle\Controller; - -use Symfony\Component\DependencyInjection\ContainerAware; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\RedirectResponse; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Bundle\WebProfilerBundle\Profiler\TemplateManager; - -/** - * ProfilerController. - * - * @author Fabien Potencier - */ -class ProfilerController extends ContainerAware -{ - protected $templateManager; - - /** - * Renders a profiler panel for the given token. - * - * @param Request $request The HTTP request - * @param string $token The profiler token - * - * @return Response A Response instance - */ - public function panelAction(Request $request, $token) - { - $profiler = $this->container->get('profiler'); - $profiler->disable(); - - $panel = $request->query->get('panel', 'request'); - $page = $request->query->get('page', 'home'); - - if (!$profile = $profiler->loadProfile($token)) { - return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:info.html.twig', array('about' => 'no_token', 'token' => $token)); - } - - if (!$profile->hasCollector($panel)) { - throw new NotFoundHttpException(sprintf('Panel "%s" is not available for token "%s".', $panel, $token)); - } - - return $this->container->get('templating')->renderResponse($this->getTemplateManager()->getName($profile, $panel), array( - 'token' => $token, - 'profile' => $profile, - 'collector' => $profile->getCollector($panel), - 'panel' => $panel, - 'page' => $page, - 'templates' => $this->getTemplateManager()->getTemplates($profile), - 'is_ajax' => $request->isXmlHttpRequest(), - )); - } - - /** - * Exports data for a given token. - * - * @param string $token The profiler token - * - * @return Response A Response instance - */ - public function exportAction($token) - { - $profiler = $this->container->get('profiler'); - $profiler->disable(); - - if (!$profile = $profiler->loadProfile($token)) { - throw new NotFoundHttpException(sprintf('Token "%s" does not exist.', $token)); - } - - return new Response($profiler->export($profile), 200, array( - 'Content-Type' => 'text/plain', - 'Content-Disposition' => 'attachment; filename= '.$token.'.txt', - )); - } - - /** - * Purges all tokens. - * - * @return Response A Response instance - */ - public function purgeAction() - { - $profiler = $this->container->get('profiler'); - $profiler->disable(); - $profiler->purge(); - - return new RedirectResponse($this->container->get('router')->generate('_profiler_info', array('about' => 'purge'))); - } - - /** - * Imports token data. - * - * @return Response A Response instance - */ - public function importAction(Request $request) - { - $profiler = $this->container->get('profiler'); - $profiler->disable(); - - $router = $this->container->get('router'); - - $file = $request->files->get('file'); - - if (empty($file) || !$file->isValid()) { - return new RedirectResponse($router->generate('_profiler_info', array('about' => 'upload_error'))); - } - - if (!$profile = $profiler->import(file_get_contents($file->getPathname()))) { - return new RedirectResponse($router->generate('_profiler_info', array('about' => 'already_exists'))); - } - - return new RedirectResponse($router->generate('_profiler', array('token' => $profile->getToken()))); - } - - /** - * Displays information page. - * - * @param string $about - * - * @return Response A Response instance - */ - public function infoAction($about) - { - $profiler = $this->container->get('profiler'); - $profiler->disable(); - - return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:info.html.twig', array( - 'about' => $about - )); - } - - /** - * Renders the Web Debug Toolbar. - * - * @param Request $request The current Request - * @param string $token The profiler token - * @param string $position The toolbar position (top, bottom, normal, or null -- use the configuration) - * - * @return Response A Response instance - */ - public function toolbarAction(Request $request, $token, $position = null) - { - $session = $request->getSession(); - - if (null !== $session && $session->getFlashBag() instanceof AutoExpireFlashBag) { - // keep current flashes for one more request if using AutoExpireFlashBag - $session->getFlashBag()->setAll($session->getFlashBag()->peekAll()); - } - - if (null === $token) { - return new Response(); - } - - $profiler = $this->container->get('profiler'); - $profiler->disable(); - - if (!$profile = $profiler->loadProfile($token)) { - return new Response(); - } - - if (null === $position) { - $position = $this->container->getParameter('web_profiler.debug_toolbar.position'); - } - - $url = null; - try { - $url = $this->container->get('router')->generate('_profiler', array('token' => $token)); - } catch (\Exception $e) { - // the profiler is not enabled - } - - return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:toolbar.html.twig', array( - 'position' => $position, - 'profile' => $profile, - 'templates' => $this->getTemplateManager()->getTemplates($profile), - 'profiler_url' => $url, - )); - } - - /** - * Renders the profiler search bar. - * - * @param Request $request The current Request - * - * @return Response A Response instance - */ - public function searchBarAction(Request $request) - { - $profiler = $this->container->get('profiler'); - $profiler->disable(); - - if (null === $session = $request->getSession()) { - $ip = - $method = - $url = - $limit = - $token = null; - } else { - $ip = $session->get('_profiler_search_ip'); - $method = $session->get('_profiler_search_method'); - $url = $session->get('_profiler_search_url'); - $limit = $session->get('_profiler_search_limit'); - $token = $session->get('_profiler_search_token'); - } - - return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:search.html.twig', array( - 'token' => $token, - 'ip' => $ip, - 'method' => $method, - 'url' => $url, - 'limit' => $limit, - )); - } - - /** - * Search results. - * - * @param Request $request The current Request - * @param string $token The token - * - * @return Response A Response instance - */ - public function searchResultsAction(Request $request, $token) - { - $profiler = $this->container->get('profiler'); - $profiler->disable(); - - $profile = $profiler->loadProfile($token); - - $ip = $request->query->get('ip'); - $method = $request->query->get('method'); - $url = $request->query->get('url'); - $limit = $request->query->get('limit'); - - return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:results.html.twig', array( - 'token' => $token, - 'profile' => $profile, - 'tokens' => $profiler->find($ip, $url, $limit, $method), - 'ip' => $ip, - 'method' => $method, - 'url' => $url, - 'limit' => $limit, - 'panel' => null, - )); - } - - /** - * Narrow the search bar. - * - * @param Request $request The current Request - * - * @return Response A Response instance - */ - public function searchAction(Request $request) - { - $profiler = $this->container->get('profiler'); - $profiler->disable(); - - $ip = preg_replace('/[^:\d\.]/', '', $request->query->get('ip')); - $method = $request->query->get('method'); - $url = $request->query->get('url'); - $limit = $request->query->get('limit'); - $token = $request->query->get('token'); - - if (null !== $session = $request->getSession()) { - $session->set('_profiler_search_ip', $ip); - $session->set('_profiler_search_method', $method); - $session->set('_profiler_search_url', $url); - $session->set('_profiler_search_limit', $limit); - $session->set('_profiler_search_token', $token); - } - - if (!empty($token)) { - return new RedirectResponse($this->container->get('router')->generate('_profiler', array('token' => $token))); - } - - $tokens = $profiler->find($ip, $url, $limit, $method); - - return new RedirectResponse($this->container->get('router')->generate('_profiler_search_results', array( - 'token' => $tokens ? $tokens[0]['token'] : 'empty', - 'ip' => $ip, - 'method' => $method, - 'url' => $url, - 'limit' => $limit, - ))); - } - - /** - * Displays the PHP info. - * - * @return Response A Response instance - */ - public function phpinfoAction() - { - $profiler = $this->container->get('profiler'); - $profiler->disable(); - - ob_start(); - phpinfo(); - $phpinfo = ob_get_clean(); - - return new Response($phpinfo); - } - - protected function getTemplateManager() - { - if (null === $this->templateManager) { - $this->templateManager = new TemplateManager( - $this->container->get('profiler'), - $this->container->get('templating'), - $this->container->get('twig'), - $this->container->getParameter('data_collector.templates') - ); - } - - return $this->templateManager; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Controller/RouterController.php b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Controller/RouterController.php deleted file mode 100644 index 758b1b7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Controller/RouterController.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\WebProfilerBundle\Controller; - -use Symfony\Component\DependencyInjection\ContainerAware; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Matcher\TraceableUrlMatcher; - -/** - * RouterController. - * - * @author Fabien Potencier - */ -class RouterController extends ContainerAware -{ - /** - * Renders the profiler panel for the given token. - * - * @param string $token The profiler token - * - * @return Response A Response instance - */ - public function panelAction($token) - { - $profiler = $this->container->get('profiler'); - $profiler->disable(); - - if (!$this->container->has('router')) { - return new Response('The Router is not enabled.'); - } - $router = $this->container->get('router'); - - $profile = $profiler->loadProfile($token); - - $context = $router->getContext(); - $context->setMethod($profile->getMethod()); - $matcher = new TraceableUrlMatcher($router->getRouteCollection(), $context); - - $request = $profile->getCollector('request'); - - return $this->container->get('templating')->renderResponse('WebProfilerBundle:Router:panel.html.twig', array( - 'request' => $request, - 'router' => $profile->getCollector('router'), - 'traces' => $matcher->getTraces($request->getPathInfo()), - )); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/Configuration.php b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/Configuration.php deleted file mode 100644 index 6ba5e1a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/Configuration.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\WebProfilerBundle\DependencyInjection; - -use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\Config\Definition\ConfigurationInterface; - -/** - * This class contains the configuration information for the bundle - * - * This information is solely responsible for how the different configuration - * sections are normalized, and merged. - * - * @author Fabien Potencier - */ -class Configuration implements ConfigurationInterface -{ - /** - * Generates the configuration tree builder. - * - * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder - */ - public function getConfigTreeBuilder() - { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('web_profiler'); - - $rootNode - ->children() - ->booleanNode('verbose')->defaultTrue()->info('DEPRECATED, it is not useful anymore and can be removed safely from your configuration')->end() - ->booleanNode('toolbar')->defaultFalse()->end() - ->scalarNode('position') - ->defaultValue('bottom') - ->validate() - ->ifNotInArray(array('bottom', 'top')) - ->thenInvalid('The CSS position %s is not supported') - ->end() - ->end() - ->booleanNode('intercept_redirects')->defaultFalse()->end() - ->end() - ; - - return $treeBuilder; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php deleted file mode 100644 index cbcd824..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\WebProfilerBundle\DependencyInjection; - -use Symfony\Component\HttpKernel\DependencyInjection\Extension; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\Config\FileLocator; -use Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener; - -/** - * WebProfilerExtension. - * - * Usage: - * - * - * - * @author Fabien Potencier - */ -class WebProfilerExtension extends Extension -{ - /** - * Loads the web profiler configuration. - * - * @param array $configs An array of configuration settings - * @param ContainerBuilder $container A ContainerBuilder instance - */ - public function load(array $configs, ContainerBuilder $container) - { - $configuration = $this->getConfiguration($configs, $container); - $config = $this->processConfiguration($configuration, $configs); - - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('toolbar.xml'); - - $container->setParameter('web_profiler.debug_toolbar.intercept_redirects', $config['intercept_redirects']); - - if (!$config['toolbar']) { - $mode = WebDebugToolbarListener::DISABLED; - } else { - $mode = WebDebugToolbarListener::ENABLED; - } - - $container->setParameter('web_profiler.debug_toolbar.mode', $mode); - $container->setParameter('web_profiler.debug_toolbar.position', $config['position']); - } - - /** - * Returns the base path for the XSD files. - * - * @return string The XSD base path - */ - public function getXsdValidationBasePath() - { - return __DIR__.'/../Resources/config/schema'; - } - - public function getNamespace() - { - return 'http://symfony.com/schema/dic/webprofiler'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php deleted file mode 100644 index 6d48730..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php +++ /dev/null @@ -1,136 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\WebProfilerBundle\EventListener; - -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag; -use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Bundle\TwigBundle\TwigEngine; - -/** - * WebDebugToolbarListener injects the Web Debug Toolbar. - * - * The onKernelResponse method must be connected to the kernel.response event. - * - * The WDT is only injected on well-formed HTML (with a proper tag). - * This means that the WDT is never included in sub-requests or ESI requests. - * - * @author Fabien Potencier - */ -class WebDebugToolbarListener implements EventSubscriberInterface -{ - const DISABLED = 1; - const ENABLED = 2; - - protected $templating; - protected $interceptRedirects; - protected $mode; - protected $position; - - public function __construct(TwigEngine $templating, $interceptRedirects = false, $mode = self::ENABLED, $position = 'bottom') - { - $this->templating = $templating; - $this->interceptRedirects = (Boolean) $interceptRedirects; - $this->mode = (integer) $mode; - $this->position = $position; - } - - public function isEnabled() - { - return self::DISABLED !== $this->mode; - } - - public function onKernelResponse(FilterResponseEvent $event) - { - if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { - return; - } - - $response = $event->getResponse(); - $request = $event->getRequest(); - - // do not capture redirects or modify XML HTTP Requests - if ($request->isXmlHttpRequest()) { - return; - } - - if ($response->headers->has('X-Debug-Token') && $response->isRedirect() && $this->interceptRedirects) { - $session = $request->getSession(); - if ($session && $session->getFlashBag() instanceof AutoExpireFlashBag) { - // keep current flashes for one more request if using AutoExpireFlashBag - $session->getFlashBag()->setAll($session->getFlashBag()->peekAll()); - } - - $response->setContent($this->templating->render('WebProfilerBundle:Profiler:toolbar_redirect.html.twig', array('location' => $response->headers->get('Location')))); - $response->setStatusCode(200); - $response->headers->remove('Location'); - } - - if (self::DISABLED === $this->mode - || !$response->headers->has('X-Debug-Token') - || $response->isRedirection() - || ($response->headers->has('Content-Type') && false === strpos($response->headers->get('Content-Type'), 'html')) - || 'html' !== $request->getRequestFormat() - ) { - return; - } - - $this->injectToolbar($response); - } - - /** - * Injects the web debug toolbar into the given Response. - * - * @param Response $response A Response instance - */ - protected function injectToolbar(Response $response) - { - if (function_exists('mb_stripos')) { - $posrFunction = 'mb_strripos'; - $posFunction = 'mb_stripos'; - $substrFunction = 'mb_substr'; - } else { - $posrFunction = 'strripos'; - $posFunction = 'stripos'; - $substrFunction = 'substr'; - } - - $content = $response->getContent(); - - if ($this->position === 'bottom') { - $pos = $posrFunction($content, ''); - } else { - $pos = $posFunction($content, '', $pos) + 1; - } - } - if (false !== $pos) { - $toolbar = "\n".str_replace("\n", '', $this->templating->render( - 'WebProfilerBundle:Profiler:toolbar_js.html.twig', - array('token' => $response->headers->get('X-Debug-Token')) - ))."\n"; - $content = $substrFunction($content, 0, $pos).$toolbar.$substrFunction($content, $pos); - $response->setContent($content); - } - } - - public static function getSubscribedEvents() - { - return array( - KernelEvents::RESPONSE => array('onKernelResponse', -128), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/LICENSE b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/LICENSE deleted file mode 100644 index cdffe7a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2012 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php deleted file mode 100644 index badbb65..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php +++ /dev/null @@ -1,123 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\WebProfilerBundle\Profiler; - -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Symfony\Component\HttpKernel\Profiler\Profiler; -use Symfony\Component\HttpKernel\Profiler\Profile; -use Symfony\Component\Templating\EngineInterface; - -/** - * Profiler Templates Manager - * - * @author Fabien Potencier - * @author Artur Wielogórski - */ -class TemplateManager -{ - protected $templating; - protected $twig; - protected $templates; - protected $profiler; - - /** - * Constructor. - * - * @param Profiler $profiler - * @param TwigEngine $templating - * @param \Twig_Environment $twig - * @param array $templates - */ - public function __construct(Profiler $profiler, EngineInterface $templating, \Twig_Environment $twig, array $templates) - { - $this->profiler = $profiler; - $this->templating = $templating; - $this->twig = $twig; - $this->templates = $templates; - } - - /** - * Gets the template name for a given panel. - * - * @param Profile $profile - * @param string $panel - * - * @return mixed - * - * @throws NotFoundHttpException - */ - public function getName(Profile $profile, $panel) - { - $templates = $this->getNames($profile); - - if (!isset($templates[$panel])) { - throw new NotFoundHttpException(sprintf('Panel "%s" is not registered in profiler or is not present in viewed profile.', $panel)); - } - - return $templates[$panel]; - } - - /** - * Gets the templates for a given profile. - * - * @param Profile $profile - * - * @return array - */ - public function getTemplates(Profile $profile) - { - $templates = $this->getNames($profile); - foreach ($templates as $name => $template) { - $templates[$name] = $this->twig->loadTemplate($template); - } - - return $templates; - } - - /** - * Gets template names of templates that are present in the viewed profile. - * - * @param Profile $profile - * - * @return array - * - * @throws \UnexpectedValueException - */ - protected function getNames(Profile $profile) - { - $templates = array(); - - foreach ($this->templates as $arguments) { - if (null === $arguments) { - continue; - } - - list($name, $template) = $arguments; - - if (!$this->profiler->has($name) || !$profile->hasCollector($name)) { - continue; - } - - if ('.html.twig' === substr($template, -10)) { - $template = substr($template, 0, -10); - } - - if (!$this->templating->exists($template.'.html.twig')) { - throw new \UnexpectedValueException(sprintf('The profiler template "%s.html.twig" for data collector "%s" does not exist.', $template, $name)); - } - - $templates[$name] = $template.'.html.twig'; - } - - return $templates; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/ICONS_LICENSE.txt b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/ICONS_LICENSE.txt deleted file mode 100644 index 2e20272..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/ICONS_LICENSE.txt +++ /dev/null @@ -1,5 +0,0 @@ -Icons License -============= - -Icons created by Sensio (http://www.sensio.com/) are shared under a Creative -Commons Attribution license (http://creativecommons.org/licenses/by-sa/3.0/). \ No newline at end of file diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml deleted file mode 100644 index a7383ab..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - WebProfilerBundle:Profiler:search - - - - WebProfilerBundle:Profiler:purge - - - - WebProfilerBundle:Profiler:info - - - - WebProfilerBundle:Profiler:import - - - - WebProfilerBundle:Profiler:export - - - - WebProfilerBundle:Profiler:phpinfo - - - - WebProfilerBundle:Profiler:searchResults - - - - WebProfilerBundle:Profiler:panel - - - - FrameworkBundle:Redirect:redirect - _profiler_search_results - empty - - - - 10 - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/wdt.xml b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/wdt.xml deleted file mode 100644 index da52074..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/wdt.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - WebProfilerBundle:Profiler:toolbar - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/config/schema/webprofiler-1.0.xsd b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/config/schema/webprofiler-1.0.xsd deleted file mode 100644 index 5c95e72..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/config/schema/webprofiler-1.0.xsd +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/config/toolbar.xml b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/config/toolbar.xml deleted file mode 100644 index 908a32d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/config/toolbar.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener - - - - - - - %web_profiler.debug_toolbar.intercept_redirects% - %web_profiler.debug_toolbar.mode% - %web_profiler.debug_toolbar.position% - - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/css/profiler.css b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/css/profiler.css deleted file mode 100644 index 8381a9a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/css/profiler.css +++ /dev/null @@ -1,490 +0,0 @@ -/* -Copyright (c) 2008, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.6.0 -*/ -html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var,optgroup{font-style:inherit;font-weight:inherit;}del,ins{text-decoration:none;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:baseline;}sub{vertical-align:baseline;}legend{color:#000;}input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}input,button,textarea,select{*font-size:100%;} - -html, body { - background-color: #efefef; -} -body { - font: 1em "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif; - text-align: left; -} - -p { - font-size: 14px; - line-height: 20px; - color: #313131; - padding-bottom: 20px -} - -strong { - color: #313131; - font-weight: bold; -} -em { - font-style: italic; -} - -a { - color: #6c6159; -} -a img { - border: none; -} -a:hover { - text-decoration: underline; -} - -button::-moz-focus-inner { - padding: 0; - border: none; -} -button { - overflow: visible; - width: auto; - background-color: transparent; - font-weight: bold; -} - -caption { - margin-bottom: 7px; -} -table, tr, th, td { - border-collapse: collapse; - border: 1px solid #d0dbb3; -} -table { - width: 100%; - margin: 10px 0 30px; -} -table th { - font-weight: bold; - background-color: #f1f7e2; -} -table th, table td { - font-size: 12px; - padding: 8px 10px; -} - -fieldset { - border: none; -} - -abbr { - border-bottom: 1px dotted #000; - cursor: help; -} - -.clear { - clear: both; - height: 0; - font-size: 0; - line-height: 0; -} -.clear_fix:after -{ - content: "\0020"; - display: block; - height: 0; - clear: both; - visibility: hidden; -} -* html .clear_fix -{ - height: 1%; -} -.clear_fix -{ - display: block; -} - -#content { - padding: 0 50px; - margin: 0 auto; - font-family: Arial, Helvetica, sans-serif; - min-width: 970px; -} - -#header { - padding: 30px 30px 20px; -} - -#header h1 { - float: left; -} - -.search { - float: right; -} - -#menu_profiler { - border-right: 1px solid #dfdfdf; -} - -#menu_profiler li { - border-bottom: 1px solid #dfdfdf; - position: relative; - padding-bottom: 0; - display: block; - background-color: #f6f6f6; -} - -#menu_profiler li a { - color: #404040; - display: block; - font-size: 13px; - text-transform: uppercase; - text-decoration: none; - cursor: pointer; -} - -#menu_profiler li a span.label { - display: block; - padding: 20px 20px 16px 65px; - min-height: 24px; - _height: 24px; -} - -#menu_profiler li a span.icon { - display: block; - position: absolute; - left: 0; - top: 12px; - width: 60px; - text-align: center; -} - -#menu_profiler li.selected a, -#menu_profiler li a:hover { - background: #d1d1d1 url(../images/profiler/bg_submenu.png) repeat-x 0 0; -} - -#navigation div:first-child, -#menu_profiler li:first-child, -#menu_profiler li:first-child a, -#menu_profiler li:first-child a span.label { - -moz-border-radius: 16px 0 0 0; - -webkit-border-radius: 16px 0 0 0; - border-radius: 16px 0 0 0; -} - -#menu_profiler li a span.count { - padding: 0; - position: absolute; - right: 10px; - top: 20px; -} - -#collector_wrapper { - float: left; - width: 100%; -} - -#collector_content { - margin-left: 250px; - padding: 40px 50px; -} - -#navigation { - float: left; - width: 250px; - margin-left: -100%; -} - -#collector_content table td { - background-color: white; -} - -h1 { - font-family: Georgia, "Times New Roman", Times, serif; - color: #404040; -} -h2, h3 { - font-weight: bold; - margin-bottom: 20px; -} - -li { - padding-bottom: 10px; - -} - -#main { - -moz-border-radius: 16px; - -webkit-border-radius: 16px; - border-radius: 16px; - margin-bottom: 20px; -} - -#menu_profiler span.count span { - display: inline-block; - background-color: #aacd4e; - -moz-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; - padding: 4px; - color: #fff; - margin-right: 2px; - font-size: 11px; -} - -#resume { - background-color: #f6f6f6; - border-bottom: 1px solid #dfdfdf; - padding: 10px 50px; - margin-left: 210px; - color: #313131; - font-size: 12px; - -moz-border-radius-topright: 16px; - -webkit-border-top-right-radius: 16px; - border-top-right-radius: 16px; -} - -a#resume-view-all { - display: inline-block; - padding: 0.2em 0.7em; - margin-right: 0.5em; - background-color: #666; - border-radius: 16px; - color: white; - font-weight: bold; - text-decoration: none; -} - -table th.value { - width: 450px; - background-color: #dfeeb8; -} - -#content h2 { - font-size: 24px; - color: #313131; - font-weight: bold; -} - -#content #main { - padding: 0; - background-color: #FFF; - border: 1px solid #dfdfdf; -} - -#content #main p { - color: #313131; - font-size: 14px; - padding-bottom: 20px; -} - -.sf-toolbarreset { - border-top: 0; - padding: 0; -} - -.sf-exceptionreset .block_exception_detected .text_exception { - width: 520px; -} - -.sf-exceptionreset .block_exception_detected .illustration_exception { - display: none; -} - -ul.alt { - margin: 10px 0 30px; -} - -ul.alt li { - padding: 5px 7px; - font-size: 13px; -} - -ul.alt li.even { - background: #f1f7e2; -} - -ul.alt li.error { - background-color: #f66; - margin-bottom: 1px; -} - -ul.alt li.warning { - background-color: #ffcc00; - margin-bottom: 1px; -} - -td.main, td.menu { - text-align: left; - margin: 0; - padding: 0; - border: 0; - vertical-align: top; -} - -.search { - padding-top: 20px; -} - -.search label { - line-height: 28px; - vertical-align: middle; -} - -.search input { - width: 188px; - margin-right: 10px; - font-size: 12px; - border: 1px solid #dadada; - background: #FFF url(../images/profiler/input_bg.gif) repeat-x left top; - padding: 5px 6px; - color: #565656; -} - -.search input[type="search"] { - -webkit-appearance: textfield; -} - -.search button { - -webkit-appearance: button-bevel; - float: none; - padding: 0; - margin: 0; - border: 0; - text-decoration: none; - cursor: pointer; - white-space: nowrap; - display: inline-block; - text-align: center; - vertical-align: middle; - background: none; -} - -.search button:hover { - text-decoration: none; -} - -.search button span span, -.search button span span span { - position: static; -} - -.search button span { - position: relative; - text-decoration: none; - display: block; - height: 28px; - float: left; - padding: 0 0 0 8px; - background: transparent url(../images/profiler/border_l.png) no-repeat top left; -} - -.search button span span { - padding: 0 8px 0 0; - background: transparent url(../images/profiler/border_r.png) right top no-repeat; -} - -.search button span span span { - padding: 0 7px; - font: bold 11px Arial, Helvetica, sans-serif; - color: #6b6b6b; - line-height: 28px; - background: transparent url(../images/profiler/btn_bg.png) repeat-x top left; -} - -#navigation div:first-child { - margin: 0 0 20px; - border-top: 0; -} - -#navigation .search { - padding-top: 15px; - float: none; - background: none repeat scroll 0 0 #f6f6f6; - color: #333; - margin: 20px 0; - border: 1px solid #dfdfdf; - border-left: none; -} - -#navigation .search h3 { - font-family: Arial, Helvetica, sans-serif; - text-transform: uppercase; - margin-left: 10px; - font-size: 13px; -} - -#navigation .search form { - padding: 15px 0; -} - -#navigation .search button { - float: right; - margin-right: 20px; -} - -#navigation .search label { - display: block; - float: left; - width: 50px; -} - -#navigation .search input, -#navigation .search select, -#navigation .search label, -#navigation .search a { - font-size: 12px; -} - -#navigation .search form { - padding-left: 10px; -} - -#navigation .search input { - width: 160px; -} - -#navigation .import label { - float: none; - display: inline; -} - -#navigation .import input { - width: 100px; -} - -.timeline { - background-color: #fbfbfb; - margin-bottom: 15px; - margin-top: 5px; -} - -#collector_content .routing tr.matches td { - background-color: #0e0; -} - -#collector_content .routing tr.almost td { - background-color: #fa0; -} - -.loading { - background: transparent url(../images/profiler/spinner.gif) scroll no-repeat 50% 50%; - height: 30px; - display: none; -} - -.sf-profiler-timeline .legends { - font-size: 12px; - line-height: 1.5em; -} - -.sf-profiler-timeline .legends span { - border-left-width: 10px; - border-left-style: solid; - padding: 0 10px 0 5px; -} - -.sf-profiler-timeline canvas { - border: 1px solid #999; - border-width: 1px 0; -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/favicon.ico b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/favicon.ico deleted file mode 100644 index 864803618e0888f8463c0b30038633c018f939cc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1150 zcmaizUr1AN6vuy3^oL%AsH~?RBQobI=ccaNk~J)QQD?41%~lUl4?1&O#PTUgotA-9 zsDZB9Dx!CTsTlUUw?V5x4YK5>5M*n+r|-FL<1!X8KKK0Y+4-K|Ip_DgLX_ZFS}O27 zD6VZ4Vy_V55P%DwO+Snf_;2^FO_X=lLt9ZPzz)z@c~ldI{Q@#slCUp96W9qfs%tQ*oXL6(4`+eocJ>~>XTi!Tx6`NE0#k>{2Oo} ztK9}W2EBZ;)|i=(L{i>6UU}sHFa>93DOU?()OGNh>)?K^U==8P)fsB(g!Z`H)Oe2K zAL8V3c}P=UQK;p237iK()-qO$m3q1_)5Uf>)l?g3abZDzzr3uhc^8WX1k|b(vZuwUYd`2nOcXxJ?f6`A^uQ+Js>k0*)1Z4Ms zn^LJ1IeVQ{e)veSS*BUf_2AsdWHfQT>0~mg)MIP0(fZmtg+pPwU~40@=~Q74tpCV* z?ho@%#bU9aI76NxIeHwFNF*?aMWwIcY>?`WCUqU3p`BrU7P-H#KQlGy-*EQ!{qC?| zBHyTwqR}XwX|T}E>o*E#8G_CNzUOjq9hiOEpwp*$E~o3w^mcAenG2uk(7mCIUZ>~% zB=me1mhaCn;Cq#;BX2o}t+|y3?+$Lc6{R^^&pjZF^ diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/close.png b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/close.png deleted file mode 100644 index 6a4de0354d85b9d30921cac498cd4b0d00ef3a11..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 402 zcmeAS@N?(olHy`uVBq!ia0vp^{2@j7K zvs2ce=MWwB(R})q8=oF4u?C*GUKkR*RNDHvnl5X8=vfKD1K*zT0bRx5>FVdQ&MBb@ E0NzsAIRF3v diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/config.png b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/config.png deleted file mode 100644 index e0898afb5ed30c21ef05835249fb604be332619b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 379 zcmeAS@N?(olHy`uVBq!ia0vp^qChOe!3-pK9%IP?QfUD`A+GLQ&_>0QAirP+ZXQ*24NZL`V>4?T2XCLC^s4IG zhMflv9zK5Ji|9{WhJi;!* z@ji2=PcELst@*DeOJd4loBa&4Jfc}#4ssre6_1usdc5ZS+}@P@kQ1Fn8iwq z@?OgHN<1<{)!%!Y%$eB_g5EcI*K+K;b~bUc{)W_yTdA4SKc#24t?ST=EzrGTqoC+D zK{nW|Vg9Oq&DkOT%Yx4ClkU!lU3^*KTIml)jr-y6fBc|zd2E~P{tP4LkX6rmxWPjF5aHzlW_ck&n}HX$jc~AVRgC<_pwnwF6G4^8u1rB9RF3%!Gb{YPEVGnM{5_5(|Yw5uTaQFHose z7%xv1i^W~6iS_mME%Drheu0&hm3@7#3zSMFj&n$2*ayEj7Zw(_km~$Z&Lij-z#EG8_Vx^t zST>to=bV|D*+B|sx7(lNsUBV*qF-QfaZ&X5_rF6@KA+ziA0NNRYe}$lI{m$;r{_Jd z5794BC=|r(?Cc(rGMUT^uh;A3wIpzy;dL&T`-8QOXLa-o;JAhtC&>?2fEdo5x7lp> z)#J9dwr5CDN54QxJ4<#N4Lk8!8`z>i$4d!BxQU@*8jH#f&0JljYi z5py^kcSc4=zVTYITCHnHq2LI^h7>-oz-j1!TabhzJe{1J{5?HAP1t-(NFfpH?CgBP zS#NZ7beG>u!57#kb&l7D1#l@Z_4f8gd_Lc!fq{WHLqkKGxTJg7;UrxE!SGve@eEhz zE2lKUX~wVszUj_FH^ku~yoS#}l2C?+hc|hqpy*F|ZXM`2P45A`cmrIaw@6YVk;od) z4a@^c^Gz3s#bOOS9?vS0>f8iz1pT`p8jUu%p9brJf05)R-x7!^>5*r*G+~%19 z{Q}`|xB>3}yGUYzK%mAm1NsHz|CqE2oU8(W0iU|2^=5jyzyJUM M07*qoM6N<$f|KG{cmMzZ diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/exception.png b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/exception.png deleted file mode 100644 index b02aac786ad78700bec10aa73d17c9fe2b4d67ac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 921 zcmV;K17`e*P)lZKjl)u z|0&?yWd*aq0(`wJQjb-!7MOtX@o~r0)Rd^GsMtXG3}_Gsd4f6Cu$DdSRV`p*V&W?3 z1!8Du$Q>LU{1kqWCzxXmYuUqI)dI%G#$x48Vj#6+|o+iyc<@0&C?y&fqM61%$-M$A3*oNcax_F}NEW8~drI zre@aRa0qX(CMG84vve>Ya0X{_rq2Qf2M4bJLE75dwzIRdXK=!gi;IhYhJ}TFOioUo zYi(_Hc6D`qA@sS%9BbH@nwt8&zP^5)KH*HiZo$C7z#Aq%0HqTw_kAwzhV)v$JzYiWdVqggrey_rS~M=H@+E;ScEf4Li*lfgD0DxB;TT zP22`|cXzk&1Mb`jdanbWG)wEVfbj6}`N+t~g@}jpn?OjsD=#lUiy_99mX`K|mhnY2Ha70TPAb+m1N|N_V9R&ycDp!FU0t0ELKd(i zGqjB5Tt-I53VQFTc@ka&PxN~Ii|Xp?!-j?iah{^0qQ%V2%xM|Mat=MN=;-J-oWWWC z3ebdxhJMJ;&v)Uk+rkd4;#nZhV=|fEr>Cb+%P^L56z41`DA?x=&f-j;1wegBRaMn7 zEWd=dVDDE}R&Fy^z-``4OiY}^Q|}cmW3EfJHq1DJ<-6e&HrTIQfFZ-c4GI9`Bp{UF zTfmJ2xnnRGHfR}3xg@E_EXDf)zm9RZ&cLmhgcaUkjiN{W_W)ilN;F^|hznp&qo`Le vps=ve6A!^I5QIM0Jk=_$%m0in1$g8yv3?9zY$BFI00000NkvXXu0mjffpfD? diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/import.png b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/import.png deleted file mode 100644 index 5d724cbdd0330e0ac234748faa688468d47a0f1d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 988 zcmV<210(#2P)$bMGPt()WN9*hBCmS0ZT3B0K3)j@t1QQbz-I&vJEhQyodw6*GKs3>yhFW@*HKdWt znW17${n zYt)FIUiMJ@sHmuT>-BmySzKHUBbSR2V})7>c@o$-CrL?3H*jJh@hvPYcv!b$4r)YC zFMB9{OifLN=I7@%nVp^Wm`$jWJZ3YcrKK+Mcs!m%WE<;N%s~yc;$sh0TwLtJZZsJm zA3sF4nN65S1W$rbe7(KBucGO!(bw1aQhe3b)hnv1s>+8G(4@1o^Oe$k<% z)YSAen$8+^b#>3h*V5ARP&GC-`p3q`G^wqvePK1A9ue&RnfTD?Q8b+;F5`{*L42*P ztz+DPdvtVE6CCRY>+^~FZ%{+6_?nxWCn9JZ%;vzWyrsXt|Eu^$Mn>+a!NI{hctdH@ z-QE3-BC`qg-=Lea=muJ!G4b=;-LM z;m2nWSqmj4CHv{=>AP$~IA+bPf#)5)xN3KPetr=1Fzcs*U&i;yc4ZCRk#^k8?~!#Z zK>Lv%pfC=^=z9#Vs%U|``6_q}^cg%cw93E+CP65Ib{BZTZ53-YG&I}a zHc(N>1A8Wq`q$u_>rb(PNf6@vp962lza@|PjJWt?a3Q7V-u^$a7^EJg@9f#LU;{Kr(Tt1(0s@wR46q?b^YiD=S2#O6 z{{R`_fK34qoCo6lAR34K99LIYyap72%!rOqjVej6(%^<@- z2B>`d_N}q2tLv_>ukTkRv!lS0swdLLTpmpZCd~U002ovPDHLkV1jKGbGrZl diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/mail.png b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/mail.png deleted file mode 100644 index 1713d40c060bf2ccee2ac2a09cffa42da910d3e5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 568 zcmV-80>}M{P)`6+&*pk#3bBkd2 zBE^eTDg_f_T+JpRrcK{MkYwHbA85cP#x}Si5Hj$Wb$0eQvYk$c zb2^hhr_W=*LJ&|#{}4>h=1ka5(%sm&C;bcD zXN1oo0c0KFWJn%)fy@#<^Jjtugq<=Bt(ag$asPt8WB3`$ogOTTvV#-=0000)Eqs|6>4qdwaN8Z*MP< zn`-dB52%HwB*-tAfk8mQz``N2VEz8>8`D{{|Yz;OXk;vd$@?2>{|QPv-yt diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/bg_submenu.gif b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/bg_submenu.gif deleted file mode 100644 index fc77660ee663d1a415dcbf56540d290146865653..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 176 zcmZ?wbhEHbWMr^rIKsg2_U+qOuU=ihe*M9N2Y2t@y?XWP#fum3-@kw3#*OFCpFeu^ z=+>=UckbMI^5n_GhYz1Vefs9jo0l(NK701;@#DvrFJHcQ@80d(w_m(?ap}^fn>TM> zyLRo$l`F4bzh-~|#h)x-rVfY%+3CQlt03UvHC0ri+_YIWM?gIG{F9I~O&QXu42FIQ Z(umr;+o5m?Xj*6#? zV+coda>eN*2foO6Nlv&S@ULFPj%D#C1(Qu#DW)8TBEgI&r^>p;|BtW-s%P+Y^>bP0 Hl+XkKuhJeq diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/border_l.png b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/border_l.png deleted file mode 100644 index df27713055121a905d1105f17c4e4c9ca48b9798..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 249 zcmVNK0>rvd3;C00000NkvXXu0mjfS~+5n diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/border_r.png b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/border_r.png deleted file mode 100644 index fdd6dc6699d7418a90f22f706045fb40beb49cad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 253 zcmVSk!+zrx!6>i2 ztY;=K!`pA2RRv{r!*zXL%pXT()lp(xgbN3a-0R9amHu`3X5BqX00000NkvXXu0mjf D?AT_F diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/btn_bg.png b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/btn_bg.png deleted file mode 100644 index 303c12952684a30aa8d0903d42c3cddf6dbfaa17..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 87 zcmeAS@N?(olHy`uVBq!ia0vp^j6f{I!2%??LS)^6l$@uFV+hCf_3mj l3wbl4$&Bg~CCLQ&_>0QAirP+ZXQ*24NZL`V>4?T2XCLC^s4IG zhMflv9zK5Ji|9{WhJi;!* z@ji2=PcELst@*DeOJd4loBa&4Jfc}#4ssre6_1usdc5ZS+}@P@kQ1Fn8iwq z@?OgHN<1<{)!%!Y%$eB_g5EcI*K+K;b~bUc{)W_yTdA4SKc#24t?ST=EzrGTqoC+D zK{nW|Vg9Oq&DkOT%Yx4ClkU!lU3^*KTIml)jr-y6fBcEqByClst+F}H;@= zc!2!U5;r(BL)r>gP;WTIEjAX>5_23kA;Slz`ibo6kZCOuLdo000B)NklHtqOmq3dkMR-j{EN}yH75GylFBwa@b z8+1$741%H6F5PHl8lrW|T!9T;GMO=hB}&-Tn8{?oCWFD_{b14}(4Cu``+hvXd(J)Y zc`xy3fK$GuuuN{#=738C4REzNa$8|p`4(_!KL|L%SJes5$=zgAqZ%g}4wX?wZO|x3fLV z>ogA4heyd9pM1 zhC#KkyZs>YkOc11hErZ%`$1v%pxWLbJA>R^9i)}$Q+o_k*~aEex|WK3H`GW24_tDq z#-K5fTPcV~MbxTKk5pYMHa1UXdklSQ0x3wNu1vf_-3rR$B3jcboEJa<;k>35(NyF` zD)Tz6V6-U&BB}5O@bMI$Mm%LjR_+&I>8jjMDK=1V93?`I5R!>bxSbxr5%akq0Lp_&|(Gh8K^vf zxUkSfn(Q7ew%lu;q@UR{BkAC*i6ElE%r2|H_eVc#eP}^cn8oR?&_c}&Dq+w~Gy8WP z@oOQRz#HN@TB!f)j_eOv>22B;Eqo!xy49g4-fvwzJin=b${pP|Dq%d63o)xh&#K30 zk>Q^U7bOq3-5>MS-lhHAaU`#XtaBBz^OQ{IO<(NoysVsPxz0w8m4mx7^kh{RD=D5D zcEEtjv+kT3HnQgeHmwN#ow{xD)a|=9OyUK+^p#}?wSQ|=3lT?*tUyCGpyYn>;kQoH ztysT!=IgC1R12~C0G%wDe>m{T&sj|8=FANCqessyQ9FW!|5fNlhGdpbT1PM2b$<#V zpBFC(Q2Oh4ADz0&R?CyKtXhaN+t_80zl$jG2X}5?`DMs-m;O(@b3?>rjBfCjHMw@= zQ8VnA4)ozLicpMW{_okXSgh9bArGumDTR3%Vt^<4UGWghpS3%Bod_1ODV6mo( zplTt;6Sa3NZWWPN|8jY^zQeGHU^n(5UmI4t!E_!(b5AI zo`64u2u0?nLloL{3u-(`6e0OlH{D_&ap+liucOXlJq2(l5CVZ~8-(?KM77~sY;z$X zz_yW7R4dlIYK4zxZ?gKb(5>Xa(Ul$=ZS}TJq zHA_7iZ>^Z1WBFvv?2;BeTRBQcEf+Vlq#@VvS>itomMrO}*HG>0$-J35bAmnI_Qk*@ zJx(&%nBg$epp!2gaLAlx9s1J?`|%Dw;acd4-2NO&WNsMBVrzF5Lk8n`m9=ha>_gHn z*pBeQ66XtBw5Qth`Aal*Pe_J6p69n7&!~yv=*)T^H8=^0tEGIwW=yYEMb)(Vs>H$9 zx~`v{S}ix{9ux?}QxGjSKVC4OfA>DSBC%)`Dz(mCQFcInY{WC~faA2qat_b)t`|H8 z32JQ}eZO6sa8H(7CthOwnEGXdX4kGM;7>7~EuOYM3 zuo(ho7n4P73k028lYi%D;C-YLU>E{dy$0b+(21U}7CV++tx3uYfluMH8RfC#o^d21 zaE;3v;tjWyn6CT(q0t_Q_=kc&(3eOd|NEfPnbv4+R%O3W?uVSkMcITI9@R0 z?q{2^Z*6FJ!wvUEKlQW>x_zQEobK|^?(wFp*t0ft3$!1PEuNpFc>u*Yp)+M}=KoWwn6UXo^@%zzA zBD?X(dj6z^*bXt0aS#y*fgk)4idUh80xx3|yx~XGNa81BKZ*FSB>V>=&rC#_tbtqr O0000YH z0D^Y*AYBhfdtYY{Z|hju|4aK!Hk+|Em85|8xE4{xAAL-`mID zH_!AxD^!6aQ2l(X{{j%F{b%_vkq2~9io<_Sr~((D`c5-Am*GEu3{XLy<9{BgKoZc3 z2-p8yFh8x7asq1Uvii>rRWRQQ250VyAfim;BEHvs2)+P7g{zfnbt3LIKNvq5tYvY!UK&bj(zzgM))Fw{O2+Q&aO4#CCUg{|K~5jwTiX!3-c?2({=JkZr<1 zgr@UAydMdlCqhpM5Jy5S`VC}T6Jt>U5IZ2@0wVN))goDBLyScZ$jKCDz^Fx|7L8g& zyhUUdL8BI76siY4e*AcaRu&-_s?IN7yr`vlssplF?%cT(G_)-mP2O~~$jQm+FVJ9n znp@P>)pY}CusMcBz$WZpkbtYJ>%TW|-dqI=9z<*Pkb*Zr^PK{QMf2y+KZDe&e0k=~ znN*;JBU;OcSZo2cglEQ#8Ko!|fm|?c+O(%gjr5NpAt7r50s>Z$g98HtSNi+=9|xNA z6J(x`kIxTqyADX`0CCl!Lx(Pum6d()^78sgt@r|3`e((86`-gv1X;uZ#GqDx91!;d v@p2$u0mRG5#2~%vfp{CJSq#MSKr9IWWrXsZtL8yN00000NkvXXu0mjf2Is<6 diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/logo_symfony_profiler.gif b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/logo_symfony_profiler.gif deleted file mode 100644 index 61d5f94d07c5b98abe28946293d7dbc7c6a33265..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2589 zcmb8q`#+P51Hkd;*@YR)GrKerwuUYvq!N-bm)t^Hbj4Ykj5Cfjmuj2UP==CQE_0bA zVv?gJjieQFsSp(_$w7x4_3CSEP>(S;rsWMYPCA_ zNSLF&)4O-?dU|@URo7%mvU#TxRVvlU$cU%A*UZdJL4ILSAd?dneXFT?X=&;G`}aE? zc6oXF%+JqvbaaSP&-L{5UM(uVckftr2CVNJfCT!(wXL@zL;CO?^{#+8pan6ijw<}@1t5+ z=;0&v1p)#`i+3?ol9hef;Pf72v4uVdZ(>oLU&tni*XPnu2jF}5C1`-4www0NM)&Kq z8y+`7je|(VF$@gmiUR;6jC2MLH!^N7o`OSbJuA6i}x<|`Q`^|NW4!MWH-ReZ4qruBVR@H1ysNW zyGftz4?iU4+p{79{ClX|D*iNZ-U860pJlVh@Gg5J_SpZVz5mfT9lcX?V6BL^cI)qX zF!(d7XRC=xP8NB!4fRq9@(tNo-zUfoF$bS>(Sdk+Mt$GNEiT~^Sb-{Lz1u+0UM%sD zG*gQf`G)|>;7R*5a8N-X+8p|H*$=MZ7HbnZjVqlR1JE_!bCxK(VtR}cr*ewq2~{}! z6mEpmmY!3Rwn#UW$+7HbHnJf*YxwBY5#qMX7iRDu`5{u3(%gW7n zNBv#FkT`jfZn`}F7Ix33#u!a&!fbf9X-pWSztd#UcEY85Mfxh6z0i^ zp^ga~2q{*L4Y~e_ZgudfX&Cc?UTo0WT}^b-9h!(}9%E^!{Diwfp--rGDzXoIGWdiU z$oAx20StF$bUIC=)>eYtRnG!jdir9Ez(8Z- zH}le91k}hhmd(3>)T^A*EcU>74ur?V&Ifs{Pyd8Nkg(Sv`{A8kXO__(5~0>jr3rQ; zCZ@Km;Q;J?)Id96<^ z1TSXn_iS45&lLt@MeZY-@?h!j7206c<&#XG(dxI3>37Q~gzdXUyy#|aSbRzUSH@j& zN@;Don_*A)J=a&ma;$cGebTH;-ACb!t7=5!k`H=!GBzn<>t(wKnlhOBzVTr6;HF?) zAv4_UeY!WwOm%cHblQ=E4`n3;_&KsnWo76Bvp4 zUbW5pG>*20A5=*53D3jqbi>Ka6YD$7QDoRP7T?~sQ;HF{Zdf4qVAfD8^t{ilWknxP z_g|ib*+Pv@I?iyy#R{VLN&YX}4Di)>1<7|W&}fLoK-p^2NKFAsw3voKty}Yfq-9vT z5~~|mRcSOg+3w&(M;P;;YL=e7w$ngQ*JDQ|%2CZ{q*0)g0r2muc0aZ{G%canF|^RJ z>7nHU;6z>3dikQ#LBYN(jze#xZ+pU&yMkyEJx!#PM2>b`_*ugbiCujcPC>MhOKAK>js9*HJdcxXVi>1Wr`Ij5dc32TbQuxx_)NeOUN)ha1U`R@r zynBa-tloq%3p~63#DAAlV>R-=&jZRqldH*S3TAZN(DS=;Ahdtfy$jCVd9B%u5QttPyh z;H{LL)3U4BFYgHTtIV%Y#&x7Jm4cJ4&PZJsP1b3q>p2_CBHQaU_^vLUA|49RIpG|n zLqs(>g<0mOO%1nBZXJM@g)OetykOJPiRRl0UpG{jF5+*rEw`ZV2*>5|nnd#XFDToP z%U;rLqB8&OYu#_e6cUdsb-wxWJO2rJZs~k?TbdGN)vwH$lJXvZsLF^6;Z|mQJ%-Jt zOdYwkx8#kmS@D^$WgRK8bHmaN`$@m~gimU$=7?S^A{KD%csI#)96wwJG_qY24bP5; z?)WGV#eE(aD_Q2Zy+Q>;59T-G1`Y(k5;WHx|E0h*VnV$)T~@?Y;A-P8paD zr1JM8HV1q`OOlHcv{Z+y(zS1`L)gefliNoAW9*S3F*;XSrWc%R&}@i$S+y~@{{{ur zQ{J91`&3mDaXT|4x;;qQFA(^`;T)Y9^UUO3mXgog41ivc6;E+xuKoNXhEvy^my1?LV)x%Y~8Cp2ioCer~#|&Qv_9d^zGLiZ6?O#mV}i hY0Xb?;{51}>rW<5p#>W&)F4!o_eOI;XaWEZ{{sdMXSDzT diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/logo_symfony_profiler.png b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/logo_symfony_profiler.png deleted file mode 100644 index 0d267cc0b5934dcfaa878bfca380ebf222d42bde..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2222 zcmV;f2vPTmP)2NKEYP?7_jogoB04%gmdaoV~rh#Kgq0v9j9Q+J1b0*x1=|Z*o^vSkKST zWMXBcq@~^6-P6<4zP`VUiHyw5%(}X|FfKCx|Nrmr@6CP%hyVZpFLY8)Q~&?}|NsC0 z|NsC0|NsC0|NsC0|NsC0|NsC0|NsC0|NsC0|NsC0|NsC0|Ns90TBSJm00009c5p#w z0003K0000!0CytY^#A||j7da6RCwC$o9BA!I1q;23$9=~p@a}pEc^a1Z#ARl62;_f zl4lp6?*|sPrDR@4Gb0&{S|fA2w(X3N%(mBCvmTQ^WD;#{(viK5#>~V=Abr{XSef`S z(JJ=G$i&RZr;5$7F>%*qP`NuQCSFEvQ0$F}$IlwKQC$dXd(TXUXU>_Dc!tKN!NhUznMp8!WI?@THkV99m<{iki93{YPT(eT4q*%R zzY4R7F_}CiqHS28F&TD~w4yq*_WS}~qIVQ;8U*GS7eqcRvwnIJbtplJQI?asw#w4@ zoJmZ2T3jyk=FF)I(vl{kOyfT&UP3~Co=LJR%Xj0YzKuyg>C96sMNV%F%O0zeTdLXZ zpG+zb@_OL^bckRSZeN@&ToC#ocA&VONf6XuR`@H6r%74L_AnEVv{gX#kj3jB z-&ZpcYd55&Y2A?h#XzEZ{nwamJIk7?Vfp-2ohoqxXVEKZDfpUoo@qwdh_KP`WtyF& z<XZu+>Mwfo#(R&pUEYjISewN0%$N{7?b+Dy=vgl060v{937{kNFr%D+*7SrU z_dMN<#5`Qq*HsCcAO>n^@=!8!54#d&EP;R&(ojr9|CJ>MG_aFRTG~|YG&2(+c5&Rm zv8}jOXMmyNo#@Ui_g<>`ORNM5LnHcbYrC&?9tIEDvQlw5E`_3AE_gO#s8L zKqfD%5}7O~U?^T$6soGrBsi+iqj_^HzbluB+3+@o?sT* zqC$&Zc0O*#lZ-;d(L6`?h+Te1h$yCbS->_B31~?_=_@ed0Kk0;c7;ND(J@)>00kfF zr7>Wa2~HMO%)es$L^SFKRTEvsnX)OfGeL&jdXKRWt~_4lwCa@zAoInI1C~F}p6E ztIZ?;!?_%cKytD~cxS}l$D+T{NFHDfFabA_4HP6C4U-r2E#t;pFjT*=sOs1qFC{5Ozy{MPac&Ql^ zwb5uK_42R+tF=rDsPYc9a6LSgEhc7r=k=7P8|fSAP&o0MOoHxmc`IiZ23$Rp*5g@3 z@*xwCmp&?^>`JEhnln*QP=G|wq`pFbRGUdn8d^LTNMXNdRIz)amD?}Zh!dJ3u&8}( z6N+1uB*rP(fB@wNNF@$bk4~3Z24ZeP@{Y?|qZUkrlBXTAvT7|8(2}hh%Lk*)BquG+ zFPBBT&VM92Wtt5Vq3o-B&)8optn0fWv9J>T{>rd$ccr)Y=o6h5yvWyR@bPE_!S?&4 zmc)w5kI4Ask=IdQ*bnc|i)G+9Y70~GH<&=~)M$^fWlnSoKXno_|JG;9F7CZ}zr-XW z8qEgW#2k2R1Bv+C%L0C?kW)ys`a8G8l4|V1&P=b;D01Ni@#iTt{n-uQ)(t wj7(5|-p7*r?udVzk1~VYmSHsy%z8xn2M#?biPf5D^8f$<07*qoM6N<$f@M`lDF6Tf diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/mail.png b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/mail.png deleted file mode 100644 index bdfa605520b0a3afadf5cad62027b7a235314637..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1093 zcmV-L1iJf)P)Y z8^>id(;U|sm(bK2r*tF}vvS6J`hOQEMsynIj#mge@Mq?nx%WH2`z`0YvxhNek?QK| zEYY_2`474dvA4Us`$T(tyL($(+k@uj=JKYdCV4|cgGwTiydD`DIZfB>7AOzY+uLg+ zlgXS~TU+l-rP7xGdJCWh{LYN2v$OLF?mZ+5=z;Tai#KGVkL2;Tjv z(P-|$rj4bb`v?djOK53nc?zKB#>U2vw27sHx4DId1sUuPVINx|p!+*IIzj<7N(RMH zeSJNfot;%6ci+=|W@hF#_O&t>)D};x77LOzIXOA4P$=H%=SrpW5%#q<7xXHgR4EoD z@>>HBN(|Tf`ubjB-(%*2UR0@6&*tXllt=*`8A743yu3W-<>kd39UVoLv$OM;u&}VZ zl!B%}Posd^F;qzQw(03P%G#rLhw}&ijZ$G?BnA@>9AH%P@uIG zGAAd8cLa)c!-Heo+D;3-ju(t^W1u8gS65b9S;=Z@YIJUHZbFKNRa8{0QNg;qyYp*8 zKrf+NNdE>(LOxNKA&+o=etzZ@4dp%EOXoA?yI{~WQ&Uq#ra)_JYguV&Da**nVB_QC zEG8yqJ4M3=2M1YZW+p2sDWR^!Eb*w#;^Jbm9<-;YXOp40xHx{@)6=KQ^QGh?~Axq?9tLf&{e(E^k_u&HRMt;WX2ZdgO>V>n`1adGjMMKd}& z$|55p4MR;feyG*zF&7sXL7-NU11eiXpeU>j#^dATS$=;0mR>{k@}8!)8xgwtbtE;O6I-Rb! ztgLJZ9@81S9=15-`T#x!fu37lUVaS7Z|MDckMf}l3JTis&gAXw{VOps@w*VvBaj1> z1xXCN#Y2iAN(~{Pd!eJyB`6wa-=_Q$5%@cGMmj)%lE}6lK^prj@=xeD6T-hD>{$G#00000 LNkvXXu0mjf+fV`B diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/request.png b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/request.png deleted file mode 100644 index 62cda7bf019f29472e30edf240ca69020e18fd93..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1042 zcmV+t1nv8YP)>OZ=T5lrpPJAqabVSi3JG9p6aG6T4nCQ;;=s%{ z-h|KOFphYDDJ;c+rIW*=_un7)|04&@O+AodL`@D`1Zi2nYr$dT%WF_U z3K@k??yrQ80t9=LV#shhyX+&6;-=UqgwHkFMpP(mHrbZ zLHrke8(BjZ6;^^R3zn3m?<)+4FJko#sl#-iwBII7g8P|Nb%F=>8BUUY+X-gX3W7^5 ze?s@+SrN(zragyXczs>C=nqoQDizm9{gY5IiUwn2`W4T1bl-h;pAIAQtyZim}9zyTZlM~#OJ zDq}|rMDYD{h0sj*`BsP66B*P@+?A}So^5gPw8I9D)a#Vy($}M|TTjCa^C83z>_Q3_ zz;|=YsHU(g&6@7P3Pjb(>3GF)#gff)$%R1-wp-NO`&?3{R^ty}1QPQ*vNYqmODXEL z)eIMvH*aj`J7X1%RY-#Ae2@obA!Hj_K({2r`U}~zEO~lk(hGOxo2&OEYv07%=ljgV zxADsr9oJEUIz&_Dv_xcJTIk|Fh_%;wBp!*)riKIplor}6r0WMn+6%qlF;iI4L##zX zwv{x|L8O3<>4@3WMJYE+Fpq+TJg>~PGC_Uy%AiE#-fAw1j5~5_3#P%dHBn@?AC09l zmV$XBq5n*tGoO_fDzh#teO+#K=Gkh}ARZin(Rs3#%!}Do$&S5s3um#BouAS`;9w;t#r` z>Nc`b3^h^X35tdJ5Mw9K=Fs9l*@^GK#X^E|;@Aknas(ixXQ$N2b!-IEfnF(s5r{~l zvZ+3XkKl(zNdJPg`s%@sr@Kgu>Slyt2C0Ja177$H<+y@2Vn3k_pJLWKx^wvN4cc}b zLJ_L&|AX5R1WtC&mF^@zp-L?ISIm`=TY3o?4o$uT9H`Tzg` M07*qoM6N<$f*-f;hyVZp diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/routing.png b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/routing.png deleted file mode 100644 index 27df877ff2392618a12b2704e06effe19f52ebd9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 696 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabRA=0VB`z%330WzxBpK%ShZ>uT+@;z zOWqPkdV;W*f?|M%<}SbZ*OlOAD`ad-pP|EdwP1h zy1Kf!xB!iEa&ig{4RvsE05U>CLV#>wH~^*U^f}G|11O>-$S;_Ik%^g=jh%y&o0m^i zOj<@>K}ktjRn5T2#LV2n($?O=!NtqRFCaE9K0CjlxTLbGp`odzr+@0=Wh+*%+pu%j z{)0!)oV|YQ&fSNPpTBtd>eIKMzkdJy`}dz<%dX?V&}Z~?aSW-rb@t-TphFGGsWJis OoWax8&t;ucLK6U4)pJ?^ diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/security.png b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/security.png deleted file mode 100644 index 8f3b4ea3bd1ecd8b45ed8f349a320d9df9a73611..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 994 zcmV<810DQ{P)(t7K+01!mnmtO#BG3 zviZ@5`8mxYtW`Eyj(M>{LE8eisk#0qUSqtNZ)-17;KiRk?|II7p5LDHob!$ybGzOD zg^ob~IndD1P+#OT=;^q)I4u@(AC_o8+Sgmq%M^UrqJ6yu4cQCUYPA+TPeNmiUb|eb zar&fZmL|#H2hb32LBl+Ps~`c{ps1FXmIqN$Q4WDXU@tB%9-5k(62l(B%nQhWKM0{v z=&q=!a5XhG+2wM%T_%$`5)u-2S)gIQfC?ag#(pk2Ir*dK;)#ig?_m$5!eIOaY{=5m z(#`et^_hu@2~BHj>uhapt)Zu6S7n5J_y)a+l)KoVNWX|qlMN~oiMDMvn=(B; z-GVgRbUIy+)oOjB*XsvVDwU?QvvW8tE$y?(WE$if^hRD@-YVzv{r&yV0JV~un)(&?JAgKlU8B(`F;`3DhK2?`zHA@gsrTR5*ocdXiTMeN zyY~&YSm@M#pjA~>I)y?pMQO!7z6Z(s`ufJ(+uNI$mzO0S9UY?vgF%7L!CNu;)z{ab z5sSsQ0jJxWBY>Qooaay^d`_@Ik=m`LrKQJ+vr^wJDJgliSN)lpnYzNl!da?(zS>hn zb#?W1EcoT1w+cW$)YQ~mf`7QDJvTSkh%7t;q=_99A0NMozWNSp@A3h9DU7_OS15`pSD=T}8!uk{$8M)2dE3~VttBv{`GzyI!pkb&+sZ_R5oEP#P^lx)y3EocyQA5wW#^&nIZ zU1U_w*v2@;9jjvY3-T5;fC&nQ!aQ^h3MA2(v2lw#HkjEj;OGyCBT$xp03qV7(1w$i Qi~s-t07*qoM6N<$f*l3ov;Y7A diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/spinner.gif b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/spinner.gif deleted file mode 100644 index 6954f42e8232f8f30c1ca480a20ff7ef9ff8af87..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1505 zcmY+^YfMvT9LMpex6@O4fnK3X3)ET)R0Qb|wVHZ*Kyh?C3)yyXzQA|S+fTl~=f7oZOw_t` zAK(N2kO4B0oVqjBcbV_pPjgKtn;0yHR3@GObKc=}G&M9yCDQrV^E?4h5vm|V~M4S0kf0M<>Q7cpP5GXB`6<2OOsz3=c+Oe&NDD3x&mnieSa) z*yzIF3+6I&MOB3<$CR0sIs0N(xkjm4uj**)NKH=F>a+tx0~O^JHmeOq(208!vp>vE zKcB|**!0tBED7uF>(y@4PCcALW6-I`Q<)i=wmO?KQmNXc3iy|S| z06@TBWEuoyK!Lw;qz?elxVkYfI~lF1efTogf-gb?Z9hXltqp(TKP2*K=qLVoN@EUAXw=1u->wAe!h)XrYz6Y5+{90O;g73A3QbFKvZOYD3swX@*n6 zG)501$OYW~6zZe2eW-8-8ZDl9lENYGq0Az*=^sI9YjzFxI0c@{Al4f5Ukz4 z%B|xNF&0zVr;$LM5;l*L5gOfC&W4ke7I#L1*ISfuDeAi0mM0&v>mkkfywR)mK?_O! zMMey}D>6dgv8x_OO*)<87nZYU1v&TWS(ilOnC|I<$;X{PBZp8fCbAUK8M~>~DV`YZ zXo5h7?QPIVSp-~UN0~qlfuOS*T+|#v+YL zF<$&|iZ}`|zD6UITuJo?3O_E;2ZLZ;QC>WUn24Jc@)h<)5ymQ;heMb|;+(((BF1YQ4@ z=+2t>tYZdzc0}4o2l$dVvrAf5g}_O$EXiC?PYS_F^%^E%;-pqQkXJ|8d44z10rj0@ z?gV9a76=h0ky|;9i!+qei#Jko{Xk@8eF~o)QqZTFER;Mgf?FxUFM4w(ZvIromSlPBz&_Z2Z7ivd5{YvP;ZB52+ zB_iCk7h~{`hyRku;!RnXT*D-8;gP?-s}C?-(yzV!1{X-pfW-`4=44a`hsOIIzg7 zq1I3;8;wT*+-zj)2~H!9YS(#2Zi-T^?b3>a0OZoD^!6bip`JW!rVKPROGxh{e)<*d zQWkR+!anF|z6uy5jUb;ZDVC=4wZi-yEghDpwruARp}SS`{3kD4`_aoE^PalGm?r;U J??_>=;XgR+=cxby diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/time.png b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/time.png deleted file mode 100644 index 3250e11944f0099e5eb958c70bfb7981d76c7789..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 776 zcmV+j1NZ!iP)D{o!y|ga zR!k<--F!a3V@u*xDm93q%QBNT(ChUS+LO=~i?L{8UD75GD3I?a$5h=%oT!^vcnu#K z`FaJ&>fdyFK0Q5s0kMLP;-#gfJ!-Xjg@#y0o{`ZJW7<9-c6TRnFaFt063m{M;Pd%h zq}MItVXM{pk}I*(=}aMhSBtn@E+0`S6cw(-I-Tw_;tw>7d*bo<1PNkaOehozXX;z- zMzJUoiCkqMJ_>?>YS1~&(&_XBe&cTxOJcFu6a#TTk;@u%PP2uD1smB)8)DqN%s|{i zrzt>j`MJ8fs%;kc0<}t|`auF&$7nQufkO^@ep_5%)a`b^=SuAHc$VQf*)ER{MWfLe zSK?$c`2ddn?ZiWsO63yD**CVOsLyL?{~Q=-Cl-R!$mi#5O0lTwY4jLvkF;)?4Tix* zzu*6nEpaFmdW$wE!QiH45gf*l&!S+I{#5GqdOxAP>tw6scN7!)z$tKhZfF|cb z;d&{&1xC6b1R6-l(!Y_-W?!JP(9Um{%k_P6aWRW$r@%2F-s&k+1P%f_xR=RfUI&B0 zGLA*nW*N$96?0k2<#MkOdk0v+KCqqX@m2taNbe_s4@AJTVzD@1DwXDOodgfTEU<#( zr0(+Bc#{x-0n&>TKnBhdq+}lVlAwQ_yiu4Hhux{q<0kGTc?8n0000F zzp^XpXx0ewM`RzGrLnXbng-gI8g`pc@0{0BZsK3h;atu=&w0*)^Pa<5q0$>HH&Jk@ z+|(Pq3<9|2n+~5T5H!juu-Ygu5Tu>G91gB;nqNh8 zK0-Q7!Iw&h^$}jXBA~E}!ctmTg#d5F&?m(rC!2KKsdE^=*Elj3A|hvd2|~RQLmpqO zwz`wFjwu>9putT?n|j(EtG3dY5aNZXFtN3BW|$fzJ7S7XT6ZDUu1{xJMA3@CMZ^Rr z3)j7d93H~CYX9!LA5vf(pKSm`4wX_FA+#;fImIbdGvF&Z1 zj3FIoEk%efZD$eTERv38q+LLeGFSEhyg6dYAPXNEu}6XGduXt|qmld}E@gs6N(LcS zwo#A|3K`KPwz{XPw!P5V-3i$(@3-S1av^&Yt9J{UKQsT>|osn);>8P|0-Le#w2eagSoa>Xt2i*!luZCJ8axGv zFDBnC=Bok81!f8apH?=dzjS#iQ~E4&9axW)NquwQNJqcfL+m$?bTs$b8<2{~nVeUa zvL7t+>=P=nckUh$iv7sIA>^q?-Jp6DdE`G6aR@^YqHxO4N#XkVHA3&KLp(Oj-z5C8 z4uRMK4QMuSq=#YIo1S00000NkvXXu0mjf*^pR4 diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/routing.png b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/routing.png deleted file mode 100644 index 6c620bfb5a1a55b0847cd18107ca1b8659316a3f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 337 zcmV-X0j~auP)ky^G7nE0Gk0I93LOw%McS2GaFgZ)z$R}P*X0F0S&kesH&=3#ZXjKv;$et z-QE2+P*V*d17^*dbss2~4Dv$Ogb5R#;xV8Ai2H$fKN4OC#3ewi3o^hEh%1430}$^4 z;x05VBp}=D<>mF}*s){LKyd|lAVN77Kn&8MM<@_IJw2bCKYv~VUo<-43Ijhszu&ue z@16-1R{~;2VhlhI1CSTz0dW`*ixTUC03bF1i2<=4lr0Lx%)}btKu%J&&dA7k3Bn*Y jIR>ah;~9k2@fiRBN=VE9ZwhAW00000NkvXXu0mjf4MlwL diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/search.png b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/search.png deleted file mode 100644 index 4405064ab227a3c905905360a05293e08a423eed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 785 zcmV+s1Md8ZP)jn9dCz${Np8GXBO?FR?Errz zu6Z>;5(@Ad-fApp9_zkd)&tZ*s#Sov)=Z5X z4R9wM4!;^59sRVsyX)@l?a6hx&N|k!4>_X(4^S74M$7B#>*tk9Mf_qt``C|j1HlG} zL?Y?6wYBqdxh#tB@(9s^CNLTu&5MV9?AMw=12hZ`4Sn3%*%2z0N|%UP2!pvw^I6on zUJv`R&pjO5575%m@&Xr_TPzkuJqP0h>x9_f*4CC`-g1Mot6u(-H*i73?9*LR|Kyb#XKRm^jp zbzTqpe{&xQ^p}udLwSBR!$J5i(QFsp$#MIPO zwWp^?hY0vUGC4UJfgD_bTu0X{;MV3RCMK#~U0t<9*gukukB?Imyo3Wd1JQV(`6jJ% zzy(qKB~?2+J2^yupaD{;lr0Bb5YO1yShc;q{RrDVvK{~zSr87mAfAztk!ove>!Ixc zygdiyfD7VDBoaTZ2f)+KO*r6!5T2kvTMsZeICxV};Y>Zg{nzYvfUEuhvoJY4k!qI+ P00000NkvXXu0mjf-zaj^ diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/security.png b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/security.png deleted file mode 100644 index fff6dd2eae93a991a5753a5b3d283413aabb42bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 808 zcmV+@1K0eCP)Od}MALrH}s*_7rBD+j(0Syl)RL70(A z%MsyR7fvxSbf#95$~uAGR65-zZR`7k^T3d^jUeeF2OqZQ`~3F%ob#OL*$zdc(S7AW z@Sg}$@cMfKsc~y2{JT zJ^lUtB$QE3^RW$bb8{n@-*h+}-$q78*6FiCp@_uvlaPR8fzae=V`HN>wvoYLP$54; z^DL{VsMz&-y$iLqwR~P)-nL4m+N!Uw|BP%gKR-V#^yBslIB>#jHuvrk+^3w?W@l%I z=jP_7b8>RF+S=Nt$MNdu=$IWI9)1e(N2}HPC6VCF;NYMoR?ySaV?%zH)iyUbZ{TW| zv4pEWpRW%OG-$C{#=E+@9FYF7+wHFt2~tC$&~=SQvrSoXadD96`J2d3v)bBJG#VGH ztE=D4%*^ycc|^9*@U{9p}Zm?_eo^ zHZ(LWjgF4aW@KcD3;ce+j^ntnm;hI{h1wf?vXEY{U$)t7UYvoIs;VlU&4~(d+h&aK zf)`*ihUegp%jGg9JH2rQ`+&FrxBUwTYn4zcmBD09)M|AEhb=(h1V@qzuqy({hQLE? z(RaxNPN#DjwGY4}{2r}}2_z*YC7TqmEr?7F00002e+feX diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/symfony.png b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/symfony.png deleted file mode 100644 index 6b66c424b9b1d78e05f6cef0f0c00a4594e73a9d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1332 zcmeAS@N?(olHy`uVBq!ia0vp^Qa~)j!3-ol&c;7vU|>oK@Ck7>&@=i^I%sKb18VB+ z?wdYs23+@wnK=-~vZc$BHNq7@1pR#jfsE3UGGsMC_JaoxfTXXF ze@A;4L<;CI2&1f|eBy*jPo6wEefmslavDT%&g{7m#?GC)fQ%O}UO>24u3P~!oE=?q zvU69jUbANP+Qj%Iph$ODPjFzUqrJ0>lUrtb*0E#9fr8mtxj^#Go41oDPL7XDEG#Gj zI)2BFou^Kn28IbRD9TGKfbNM1iv$`4v~lg4b!X3>v$3*^jgG6SuA4h&o~^b0`STZ& z5|R(>KLE7!!uboK!C{LQE_QeIJb3U>cxa@Rg^j1XcX?UmlEq7b8ka6v2Gp`;%htn( zjs*AxR#(*m$wv<#0Udet=rN!RfkqYN7uD6)o10p?I=hDih3?qC186nSRY2`Pm-P2d z@b>hbH+OziWQ@I?BhW`c#{kVYF){-hWom35;2#tl6A$!SWkpq6YrC_PE0AGkY60|k zU_da?%-rle3o|P>7Z0Fymgd$#D}c7=<>Uk140Jru0oIl_9&Vo2mbM=5UO-EMsSD_4 ziIUuMV6r<^666=mz`)4N!pg?Q&BMzlAS5gzDJ3l}tDvZ)qNb*Vrpq+ zZDVKe?CRm=?c?Vk5D**{9T%67l#-g3nUh;kP*_}2QdU`6Ti@8!+}7RK-#=mE%vrPM z&YQPj`HIzR)^6CaVbkU zx^?Hy-Me=mK791(>C~P0{Q2`2 z5d8lA`_G@hfB&77bJ-5`%~nqr$B>F!sh3j2Ljon*9+sbz8g`S%z}xF4N-Dt?3Q@PP1 ze(|1;v+P-#b8kl3BZI}y!}iZt*x8rsdg#n{mbNlo=ZV$_ z=3mO%#P;ry+k6+PrQzMoBC6|@%oB}HRi9+F__m?!^A~=d*W37>uF^UFte&sueO%in zcehYsAqk_28+=~woj+l-r>ll}?W40Rn0AzjZ`!`#itY;yxAk+Xe%O?&Z!Z%rQ&_oj zhmEFsqj35>HV*6QVyip7^JmxXnb+2(e$+kkw!y9byI=Y^?(?UW7|n6r8U6E_ye@y- zzrPh#fnL_iTb$QMP8Te`CO+j(bx6>L!iO{D40mmIo_$YgUwqN4DJvgO`d$8Q$Klt! k*Ir2EuThT*=l{=Ob*=M|$G)3tz+}nb>FVdQ&MBb@0N#S`-v9sr diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/time.png b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/time.png deleted file mode 100644 index d7c2e7dbb9405c3fe63e3012bb9c165585e8fa96..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 482 zcmV<80UiE{P)Kj@h+2dohY%qeI?BZ%p`bxp z8X6jcaEQW7f>cVb&l_F{o}OtCbnw8zeV^yJ_kIycl1Ab`1j^;IA{L9K-bs(S-wddu z9>6u}!r`#P?RKBoY&H>RmMGYN_INxwj^mawqwRELQIpAJOc0Ay=m$c_xm?aj9qN9` z*=%;kZnrIv>T4VWvH%D&I%`xsOX27^se6u05d(|`du5IKs)VhuGp zkx0DNYPAD6Rxn8e8ejygV7E{x++lH=xI5nx%d%23nQW9wrCZGKfB{p~m0#yEU;t*o zfjw|qtyV8_whQbFUF7Qrkq0^J~=H2KoBZ8W{+{{Fx4 Y37#u7c<*%S3;+NC07*qoM6N<$g4T`DZU6uP diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig deleted file mode 100644 index 2e1428f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig +++ /dev/null @@ -1,165 +0,0 @@ -{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %} - -{% block toolbar %} - {# Symfony Logo #} - {% set icon %} - - Symfony - {{ collector.symfonyversion }} - - {% endset %} - {% set text %} -
    - Symfony {{ collector.symfonyversion }} -
    - - {% endset %} - {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': false } %} - - {# PHP Information #} - {% set icon %} - - PHP - - {% endset %} - {% set text %} - {% spaceless %} -
    - PHP - {{ collector.phpversion }} -
    -
    - PHP Extensions - xdebug - accel -
    - {% endspaceless %} - {% endset %} - {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': false } %} - - {# Environment #} - {% set debug_status_class %}sf-toolbar-status sf-toolbar-status-{{ collector.debug ? 'green' : 'red' }}{% endset %} - {% set icon %} - Environment - - {{ token }} - - {{ collector.appname }}{{ collector.env }} - - {% endset %} - {% set text %} - {% spaceless %} -
    - Name - {{ collector.appname }} -
    -
    - Environment - {{ collector.env }} -
    -
    - Debug - {{ collector.debug ? 'en' : 'dis' }}abled -
    -
    - Token - - {% if profiler_url %} - {{ collector.token }} - {% else %} - {{ collector.token }} - {% endif %} - -
    - {% endspaceless %} - {% endset %} - {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %} -{% endblock %} - -{% block menu %} - - Configuration - Config - -{% endblock %} - -{% block panel %} -

    Project Configuration

    - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    Symfony version{{ collector.symfonyversion }}
    Application name{{ collector.appname }}
    Environment{{ collector.env }}
    Debug{{ collector.debug ? 'enabled' : 'disabled' }}
    - -

    PHP configuration

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    PHP version{{ collector.phpversion }}
    Xdebug{{ collector.hasxdebug ? 'enabled' : 'disabled' }}
    PHP acceleration{{ collector.hasaccelerator ? 'enabled' : 'disabled' }}
    XCache{{ collector.hasxcache ? 'enabled' : 'disabled' }}
    APC{{ collector.hasapc ? 'enabled' : 'disabled' }}
    EAccelerator{{ collector.haseaccelerator ? 'enabled' : 'disabled' }}
    Full PHP configurationphpinfo
    - - {% if collector.bundles %} -

    Active bundles

    - - - - - - {% set bundles = collector.bundles %} - {% for name in bundles|keys|sort %} - - - - - {% endfor %} -
    NamePath
    {{ name }}{{ bundles[name] }}
    - {% endif %} -{% endblock %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/events.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/events.html.twig deleted file mode 100644 index 97a073a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/events.html.twig +++ /dev/null @@ -1,72 +0,0 @@ -{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %} - -{% from _self import display_listener %} - -{% block menu %} - - Events - Events - -{% endblock %} - -{% block panel %} - {% if collector.calledlisteners|length %} - {{ block('panelContent') }} - {% else %} -

    Events

    -

    - No events have been recorded. Are you sure that debugging is enabled in the kernel ? -

    - {% endif %} -{% endblock %} - -{% block panelContent %} -

    Called Listeners

    - - - - - - - - {% for listener in collector.calledlisteners %} - - - - - - {% endfor %} -
    Event namePriorityListener
    {{ listener.event }}{{ listener.priority }}{{ display_listener(listener) }}
    - - {% if collector.notcalledlisteners %} -

    Not Called Listeners

    - - - - - - - - {% set listeners = collector.notcalledlisteners %} - {% for listener in listeners|keys|sort %} - - - - - - {% endfor %} -
    Event namePriorityListener
    {{ listeners[listener].event }}{{ listeners[listener].priority }}{{ display_listener(listeners[listener]) }}
    - {% endif %} -{% endblock %} - -{% macro display_listener(listener) %} - {% if listener.type == "Closure" %} - Closure - {% elseif listener.type == "Function" %} - {% set link = listener.file|file_link(listener.line) %} - {% if link %}{{ listener.function }}{% else %}{{ listener.function }}{% endif %} - {% elseif listener.type == "Method" %} - {% set link = listener.file|file_link(listener.line) %} - {{ listener.class|abbr_class }}::{% if link %}{{ listener.method }}{% else %}{{ listener.method }}{% endif %} - {% endif %} -{% endmacro %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/exception.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/exception.html.twig deleted file mode 100644 index a684d1d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/exception.html.twig +++ /dev/null @@ -1,30 +0,0 @@ -{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %} - -{% block head %} - - {{ parent() }} -{% endblock %} - -{% block menu %} - - Exception - Exception - - {% if collector.hasexception %} - 1 - {% endif %} - - -{% endblock %} - -{% block panel %} -

    Exception

    - - {% if not collector.hasexception %} -

    - No exception was thrown and uncaught during the request. -

    - {% else %} - {% render 'WebProfilerBundle:Exception:show' with { 'exception': collector.exception, 'format': 'html' } %} - {% endif %} -{% endblock %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig deleted file mode 100644 index 5d6ed4a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig +++ /dev/null @@ -1,77 +0,0 @@ -{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %} - -{% block toolbar %} - {% if collector.counterrors %} - {% set icon %} - Logs - {{ collector.counterrors }} - {% endset %} - {% set text %} -
    - Exception - {{ collector.counterrors }} -
    - {% endset %} - {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %} - {% endif %} -{% endblock %} - -{% block menu %} - - Logger - Logs - {% if collector.counterrors %} - - {{ collector.counterrors }} - - {% endif %} - -{% endblock %} - -{% block panel %} -

    Logs

    - - {% set priority = app.request.query.get('priority', 0) %} - - - - - - -
    Filter -
    - - - - -
    -
    - - {% if collector.logs %} -
      - {% for log in collector.logs if log.priority >= priority %} -
    • - {{ log.priorityName }} - {{ log.message }} - {% if log.context is defined and log.context is not empty %} -
      - - Context: {{ log.context|yaml_encode }} - - {% endif %} -
    • - {% else %} -
    • No logs available for this priority.
    • - {% endfor %} -
    - {% else %} -

    - No logs available. -

    - {% endif %} -{% endblock %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig deleted file mode 100644 index ca6d3ca..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig +++ /dev/null @@ -1,17 +0,0 @@ -{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %} - -{% block toolbar %} - {% set icon %} - - Memory Usage - {{ '%.1f'|format(collector.memory / 1024 / 1024) }} MB - - {% endset %} - {% set text %} -
    - Memory usage - {{ '%.1f'|format(collector.memory / 1024 / 1024) }} MB -
    - {% endset %} - {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': false } %} -{% endblock %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig deleted file mode 100644 index fa43c50..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig +++ /dev/null @@ -1,161 +0,0 @@ -{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %} - -{% block toolbar %} - {% set request_handler %} - {% if collector.controller.class is defined %} - {% set link = collector.controller.file|file_link(collector.controller.line) %} - {{ collector.controller.class|abbr_class }} - - {{ collector.controller.method }} - - {% else %} - {{ collector.controller }} - {% endif %} - {% endset %} - {% set request_status_code_color = (400 > collector.statuscode) ? ((200 == collector.statuscode) ? 'green' : 'yellow') : 'red'%} - {% set request_route = collector.route ? collector.route : 'NONE' %} - {% set icon %} - Request - {{ collector.statuscode }} - {{ request_handler }} - on {{ request_route }} - {% endset %} - {% set text %} - {% spaceless %} -
    - Status Code - {{ collector.statuscode }} -
    -
    - Controller - {{ request_handler }} -
    -
    - Route name - {{ request_route }} -
    -
    - Has session - {% if collector.sessionmetadata|length %}yes{% else %}no{% endif %} -
    - {% endspaceless %} - {% endset %} - {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %} -{% endblock %} - -{% block menu %} - - Request - Request - -{% endblock %} - -{% block panel %} -

    Request GET Parameters

    - - {% if collector.requestquery.all|length %} - {% include 'WebProfilerBundle:Profiler:bag.html.twig' with { 'bag': collector.requestquery } only %} - {% else %} -

    - No GET parameters -

    - {% endif %} - -

    Request POST Parameters

    - - {% if collector.requestrequest.all|length %} - {% include 'WebProfilerBundle:Profiler:bag.html.twig' with { 'bag': collector.requestrequest } only %} - {% else %} -

    - No POST parameters -

    - {% endif %} - -

    Request Attributes

    - - {% if collector.requestattributes.all|length %} - {% include 'WebProfilerBundle:Profiler:bag.html.twig' with { 'bag': collector.requestattributes } only %} - {% else %} -

    - No attributes -

    - {% endif %} - -

    Request Cookies

    - - {% if collector.requestcookies.all|length %} - {% include 'WebProfilerBundle:Profiler:bag.html.twig' with { 'bag': collector.requestcookies } only %} - {% else %} -

    - No cookies -

    - {% endif %} - -

    Request Headers

    - - {% include 'WebProfilerBundle:Profiler:bag.html.twig' with { 'bag': collector.requestheaders } only %} - -

    Request Content

    - - {% if collector.content == false %} -

    Request content not available (it was retrieved as a resource).

    - {% elseif collector.content %} -
    {{ collector.content }}
    - {% else %} -

    No content

    - {% endif %} - -

    Request Server Parameters

    - - {% include 'WebProfilerBundle:Profiler:bag.html.twig' with { 'bag': collector.requestserver } only %} - -

    Response Headers

    - - {% include 'WebProfilerBundle:Profiler:bag.html.twig' with { 'bag': collector.responseheaders } only %} - -

    Session Metadata

    - - {% if collector.sessionmetadata|length %} - {% include 'WebProfilerBundle:Profiler:table.html.twig' with { 'data': collector.sessionmetadata } only %} - {% else %} -

    - No session metadata -

    - {% endif %} - -

    Session Attributes

    - - {% if collector.sessionattributes|length %} - {% include 'WebProfilerBundle:Profiler:table.html.twig' with { 'data': collector.sessionattributes } only %} - {% else %} -

    - No session attributes -

    - {% endif %} - -

    Flashes

    - - {% if collector.flashes|length %} - {% include 'WebProfilerBundle:Profiler:table.html.twig' with { 'data': collector.flashes } only %} - {% else %} -

    - No flashes -

    - {% endif %} - - {% if profile.parent %} -

    Parent request: {{ profile.parent.token }}

    - - {% include 'WebProfilerBundle:Profiler:bag.html.twig' with { 'bag': profile.parent.getcollector('request').requestattributes } only %} - {% endif %} - - {% if profile.children|length %} -

    Sub requests

    - - {% for child in profile.children %} -

    {{ child.token }}

    - {% include 'WebProfilerBundle:Profiler:bag.html.twig' with { 'bag': child.getcollector('request').requestattributes } only %} - {% endfor %} - {% endif %} - -{% endblock %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/router.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/router.html.twig deleted file mode 100644 index a37ffe7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/router.html.twig +++ /dev/null @@ -1,15 +0,0 @@ -{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %} - -{% block toolbar %} -{% endblock %} - -{% block menu %} - - Routing - Routing - -{% endblock %} - -{% block panel %} - {% render "WebProfilerBundle:Router:panel" with {'token': token} %} -{% endblock %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig deleted file mode 100644 index d283182..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig +++ /dev/null @@ -1,468 +0,0 @@ -{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %} - -{% if colors is not defined %} - {% set colors = { - 'default': '#aacd4e', - 'section': '#666', - 'event_listener': '#3dd', - 'event_listener_loading': '#add', - 'template': '#dd3', - 'doctrine': '#d3d', - 'propel': '#f4d', - 'child_sections': '#eed', - } %} -{% endif %} - -{% block toolbar %} - {% set total_time = collector.events|length ? '%.0f ms'|format(collector.totaltime) : 'n/a' %} - {% set icon %} - Time - {{ total_time }} - {% endset %} - {% set text %} -
    - Total time - {{ total_time }} -
    - {% endset %} - {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %} -{% endblock %} - -{% block menu %} - - Timeline - Timeline - -{% endblock %} - -{% block panel %} -

    Timeline

    - {% if collector.events|length %} - {{ block('panelContent') }} - {% else %} -

    - No timing events have been recorded. Are you sure that debugging is enabled in the kernel ? -

    - {% endif %} -{% endblock %} - -{% block panelContent %} -
    - - - - - - - - - - - - - - -
    Total time{{ '%.0f'|format(collector.totaltime) }} ms
    Initialization time{{ '%.0f'|format(collector.inittime) }} ms
    Threshold ms
    -
    - -

    - {{ profile.parent ? "Request" : "Main Request" }} - - - {{ collector.events.__section__.totaltime }} ms - {% if profile.parent %} - - parent - {% endif %} - -

    - - {% set max = collector.events.__section__.endtime %} - - {{ _self.display_timeline('timeline_' ~ token, collector.events, colors) }} - - {% if profile.children|length %} - {% for child in profile.children %} - {% set events = child.getcollector('time').events %} -

    - Sub-request "{{ child.getcollector('request').requestattributes.get('_controller') }}" - - {{ events.__section__.totaltime }} ms -

    - - {{ _self.display_timeline('timeline_' ~ child.token, events, colors) }} - {% endfor %} - {% endif %} - - -{% endblock %} - -{% macro dump_request_data(token, profile, events, origin) %} - { - "id": "{{ token }}", - "left": {{ "%F"|format(events.__section__.origin - origin) }}, - "events": [ -{{ _self.dump_events(events) }} - ] - } -{% endmacro %} - -{% macro dump_events(events) %} -{% for name, event in events %} -{% if '__section__' != name %} - { - "name": "{{ name }}", - "category": "{{ event.category }}", - "origin": {{ "%F"|format(event.origin) }}, - "starttime": {{ "%F"|format(event.starttime) }}, - "endtime": {{ "%F"|format(event.endtime) }}, - "totaltime": {{ "%F"|format(event.totaltime) }}, - "periods": [ - {%- for period in event.periods -%} - {"begin": {{ "%F"|format(period.0) }}, "end": {{ "%F"|format(period.1) }}}{{ loop.last ? '' : ', ' }} - {%- endfor -%} - ] - }{{ loop.last ? '' : ',' }} -{% endif %} -{% endfor %} -{% endmacro %} - -{% macro display_timeline(id, events, colors) %} -
    -
    - {% for category, color in colors %} - {{ category }} - {% endfor %} -
    - -
    -{% endmacro %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/admin.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/admin.html.twig deleted file mode 100644 index 2488af4..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/admin.html.twig +++ /dev/null @@ -1,27 +0,0 @@ - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/ajax_layout.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/ajax_layout.html.twig deleted file mode 100644 index 3e2f6f0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/ajax_layout.html.twig +++ /dev/null @@ -1 +0,0 @@ -{% block panel '' %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/bag.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/bag.html.twig deleted file mode 100644 index b85d744..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/bag.html.twig +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - {% for key in bag.keys|sort %} - - - - - {% endfor %} - -
    KeyValue
    {{ key }}{{ bag.get(key)|yaml_dump }}
    diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base.html.twig deleted file mode 100644 index 0198e7b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base.html.twig +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - {% block title 'Profiler' %} - - {% block head %} - - {% endblock %} - {% include 'WebProfilerBundle:Profiler:toolbar_style.html.twig' with { 'position': 'top', 'floatable': false } %} - - - {% block body '' %} - - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig deleted file mode 100644 index d6cd784..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig +++ /dev/null @@ -1,72 +0,0 @@ - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/header.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/header.html.twig deleted file mode 100644 index ce548de..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/header.html.twig +++ /dev/null @@ -1,25 +0,0 @@ - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/info.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/info.html.twig deleted file mode 100644 index d35f91c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/info.html.twig +++ /dev/null @@ -1,43 +0,0 @@ -{% extends 'WebProfilerBundle:Profiler:base.html.twig' %} - -{% block body %} -
    - {% include 'WebProfilerBundle:Profiler:header.html.twig' only %} - -
    -
    -
    -
    - {% block panel %} - {% if about == 'purge' %} -

    The profiler database was purged successfully

    -

    - Now you need to browse some pages with the Symfony Profiler enabled to collect data. -

    - {% elseif about == 'upload_error' %} -

    A problem occurred when uploading the data

    -

    - No file given or the file was not uploaded successfully. -

    - {% elseif about == 'already_exists' %} -

    A problem occurred when uploading the data

    -

    - The token already exists in the database. -

    - {% elseif about == 'no_token' %} -

    Token not found

    -

    - Token "{{ token }}" was not found in the database. -

    - {% endif %} - {% endblock %} -
    -
    - -
    -
    -
    -{% endblock %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.html.twig deleted file mode 100644 index 2c4a0a7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.html.twig +++ /dev/null @@ -1,54 +0,0 @@ -{% extends 'WebProfilerBundle:Profiler:base.html.twig' %} - -{% block body %} - - {% render 'WebProfilerBundle:Profiler:toolbar' with { 'token': token, 'position': 'normal' } %} - -
    - {% include 'WebProfilerBundle:Profiler:header.html.twig' only %} - -
    - -
    -
    - {% if profile %} -
    - View all - Profile for: - {{ profile.method|upper }} - {% if profile.method|upper in ['GET', 'HEAD'] %} - {{ profile.url }} - {% else %} - {{ profile.url }} - {% endif %} - - by {{ profile.ip }} at {{ profile.time|date('r') }} - -
    - {% endif %} - -
    - {% include 'WebProfilerBundle:Profiler:base_js.html.twig' %} - {% block panel '' %} -
    -
    - -
    -
    -
    -{% endblock %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/results.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/results.html.twig deleted file mode 100644 index d8db945..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/results.html.twig +++ /dev/null @@ -1,35 +0,0 @@ -{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %} - -{% block panel %} -

    Search Results

    - - {% if tokens %} - - - - - - - - - - - - {% for elements in tokens %} - - - - - - - - {% endfor %} - -
    TokenIPMethodURLTime
    {{ elements.token }}{{ elements.ip }}{{ elements.method }}{{ elements.url }}{{ elements.time|date('r') }}
    - {% else %} -

    - The query returned no result. -

    - {% endif %} - -{% endblock %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/search.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/search.html.twig deleted file mode 100644 index d308240..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/search.html.twig +++ /dev/null @@ -1,39 +0,0 @@ - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/table.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/table.html.twig deleted file mode 100644 index 246edbd..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/table.html.twig +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - {% for key in data|keys|sort %} - - - - - {% endfor %} - -
    KeyValue
    {{ key }}{{ data[key]|yaml_dump }}
    diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig deleted file mode 100644 index 65e9b1d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig +++ /dev/null @@ -1,26 +0,0 @@ - -{% if 'normal' != position %} - {% include 'WebProfilerBundle:Profiler:toolbar_style.html.twig' with { 'position': position, 'floatable': true } %} -
    -{% endif %} - -
    - {% for name, template in templates %} - {{ template.renderblock('toolbar', { - 'collector': profile.getcollector(name), - 'profiler_url': profiler_url, - 'token': profile.token, - 'name': name - }) - }} - {% endfor %} - - {% if 'normal' != position %} - - {% endif %} -
    - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig deleted file mode 100644 index 42bbfea..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig +++ /dev/null @@ -1,9 +0,0 @@ -{% if link %} - {% set icon %} - {{ icon }} - {% endset %} -{% endif %} -
    -
    {{ icon|default('') }}
    -
    {{ text|default('') }}
    -
    diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig deleted file mode 100644 index f3ce853..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig +++ /dev/null @@ -1,18 +0,0 @@ - -{% include 'WebProfilerBundle:Profiler:base_js.html.twig' %} - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_redirect.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_redirect.html.twig deleted file mode 100644 index 9156125..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_redirect.html.twig +++ /dev/null @@ -1,18 +0,0 @@ -{% extends 'TwigBundle::layout.html.twig' %} - -{% block title 'Redirection Intercepted' %} - -{% block body %} -
    -
    -

    This request redirects to {{ location }}.

    - -

    - - The redirect was intercepted by the web debug toolbar to help debugging. - For more information, see the "intercept-redirects" option of the Profiler. - -

    -
    -
    -{% endblock %} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_style.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_style.html.twig deleted file mode 100644 index a7801ac..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_style.html.twig +++ /dev/null @@ -1,275 +0,0 @@ - diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Router/panel.html.twig b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Router/panel.html.twig deleted file mode 100644 index ab0eaf6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Router/panel.html.twig +++ /dev/null @@ -1,44 +0,0 @@ -

    Routing for "{{ request.pathinfo }}"

    - -
      -
    • - Route:  - {% if request.route %} - {{ request.route }} - {% else %} - No matching route - {% endif %} -
    • -
    • - Route parameters:  - {% if request.routeParams|length %} - {% include 'WebProfilerBundle:Profiler:table.html.twig' with { 'data': request.routeParams, 'class': 'inline' } only %} - {% else %} - No parameters - {% endif %} -
    • - {% if router.redirect %} -
    • - Redirecting to:  "{{ router.targetUrl }}" {% if router.targetRoute %}(route: "{{ router.targetRoute }}"){% endif %} -
    • - {% endif %} -
    • - Route matching logs - - - - - - - {% for trace in traces %} - - - - - - {% endfor %} -
      Route namePatternLog
      {{ trace.name }}{{ trace.pattern }}{{ trace.log }}
      - Note: The above matching is based on the configuration for the current router which might differ from - the configuration used while routing this request. -
    • -
    diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ExceptionControllerTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ExceptionControllerTest.php deleted file mode 100644 index 03ff572..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ExceptionControllerTest.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\WebProfilerBundle\Tests\Controller; - -use Symfony\Bundle\WebProfilerBundle\Tests\TestCase; - -use Symfony\Bundle\WebProfilerBundle\Controller\ExceptionController; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Scope; -use Symfony\Component\DependencyInjection\Definition; - -class ExceptionControllerTest extends TestCase -{ - protected $controller; - protected $container; - protected $flatten; - protected $kernel; - - protected function setUp() - { - parent::setUp(); - - $this->flatten = $this->getMock('Symfony\Component\HttpKernel\Exception\FlattenException'); - $this->flatten->expects($this->once())->method('getStatusCode')->will($this->returnValue(404)); - $this->controller = new ExceptionController(); - $this->kernel = $this->getMock('Symfony\\Component\\HttpKernel\\KernelInterface'); - $this->container = $this->getContainer(); - } - - protected function tearDown() - { - parent::tearDown(); - - $this->controller = null; - $this->container = null; - $this->flatten = null; - $this->kernel = null; - } - - /** - * @dataProvider getDebugModes - */ - public function testShowActionDependingOnDebug($debug) - { - $this->container->setParameter('kernel.debug', $debug); - $this->controller->setContainer($this->container); - $this->controller->showAction($this->flatten); - } - - public function getDebugModes() - { - return array( - array(true), - array(false), - ); - } - - private function getContainer() - { - $container = new ContainerBuilder(); - $container->addScope(new Scope('request')); - $container->register('request', 'Symfony\\Component\\HttpFoundation\\Request')->setScope('request'); - $container->register('templating.helper.assets', $this->getMockClass('Symfony\\Component\\Templating\\Helper\\AssetsHelper')); - $container->register('templating.helper.router', $this->getMockClass('Symfony\\Bundle\\FrameworkBundle\\Templating\\Helper\\RouterHelper')) - ->addArgument(new Definition($this->getMockClass('Symfony\\Component\\Routing\\RouterInterface'))); - $container->register('twig', 'Twig_Environment'); - $container->register('templating.engine.twig', $this->getMockClass('Symfony\\Bundle\\TwigBundle\\TwigEngine')) - ->addArgument($this->getMock('Twig_Environment')) - ->addArgument($this->getMock('Symfony\\Component\\Templating\\TemplateNameParserInterface')) - ->addArgument(new Definition($this->getMockClass('Symfony\Component\Config\FileLocatorInterface'))) - ->addArgument($this->getMock('Symfony\\Bundle\\FrameworkBundle\\Templating\\GlobalVariables', array(), array($this->getMock('Symfony\\Component\\DependencyInjection\\Container')))); - $container->setAlias('templating', 'templating.engine.twig'); - $container->setParameter('kernel.bundles', array()); - $container->setParameter('kernel.cache_dir', __DIR__); - $container->setParameter('kernel.root_dir', __DIR__); - $container->set('kernel', $this->kernel); - - return $container; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/ConfigurationTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/ConfigurationTest.php deleted file mode 100644 index 729d271..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/ConfigurationTest.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\WebProfilerBundle\Tests\DependencyInjection; - -use Symfony\Bundle\WebProfilerBundle\DependencyInjection\Configuration; -use Symfony\Component\Config\Definition\Processor; - -class ConfigurationTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getDebugModes - */ - public function testConfigTree($options, $results) - { - $processor = new Processor(); - $configuration = new Configuration(array()); - $config = $processor->processConfiguration($configuration, array($options)); - - $this->assertEquals($results, $config); - } - - public function getDebugModes() - { - return array( - array(array(), array('intercept_redirects' => false, 'toolbar' => false, 'verbose' => true, 'position' => 'bottom')), - array(array('intercept_redirects' => true), array('intercept_redirects' => true, 'toolbar' => false, 'verbose' => true, 'position' => 'bottom')), - array(array('intercept_redirects' => false), array('intercept_redirects' => false, 'toolbar' => false, 'verbose' => true, 'position' => 'bottom')), - array(array('toolbar' => true), array('intercept_redirects' => false, 'toolbar' => true, 'verbose' => true, 'position' => 'bottom')), - array(array('verbose' => false, 'position' => 'top'), array('intercept_redirects' => false, 'toolbar' => false, 'verbose' => false, 'position' => 'top')), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/WebProfilerExtensionTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/WebProfilerExtensionTest.php deleted file mode 100644 index 48f3cc7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/WebProfilerExtensionTest.php +++ /dev/null @@ -1,133 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\WebProfilerBundle\Tests\DependencyInjection; - -use Symfony\Bundle\WebProfilerBundle\Tests\TestCase; - -use Symfony\Bundle\WebProfilerBundle\DependencyInjection\WebProfilerExtension; -use Symfony\Component\DependencyInjection\Container; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Dumper\PhpDumper; -use Symfony\Component\DependencyInjection\Scope; - -class WebProfilerExtensionTest extends TestCase -{ - private $kernel; - /** - * @var Symfony\Component\DependencyInjection\Container $container - */ - private $container; - - public static function assertSaneContainer(Container $container, $message = '') - { - $errors = array(); - foreach ($container->getServiceIds() as $id) { - try { - $container->get($id); - } catch (\Exception $e) { - $errors[$id] = $e->getMessage(); - } - } - - self::assertEquals(array(), $errors, $message); - } - - protected function setUp() - { - parent::setUp(); - - $this->kernel = $this->getMock('Symfony\\Component\\HttpKernel\\KernelInterface'); - - $this->container = new ContainerBuilder(); - $this->container->addScope(new Scope('request')); - $this->container->register('request', 'Symfony\\Component\\HttpFoundation\\Request')->setScope('request'); - $this->container->register('templating.helper.assets', $this->getMockClass('Symfony\\Component\\Templating\\Helper\\AssetsHelper')); - $this->container->register('templating.helper.router', $this->getMockClass('Symfony\\Bundle\\FrameworkBundle\\Templating\\Helper\\RouterHelper')) - ->addArgument(new Definition($this->getMockClass('Symfony\\Component\\Routing\\RouterInterface'))); - $this->container->register('twig', 'Twig_Environment'); - $this->container->register('templating.engine.twig', $this->getMockClass('Symfony\\Bundle\\TwigBundle\\TwigEngine')) - ->addArgument(new Definition($this->getMockClass('Twig_Environment'))) - ->addArgument(new Definition($this->getMockClass('Symfony\\Component\\Templating\\TemplateNameParserInterface'))) - ->addArgument(new Definition($this->getMockClass('Symfony\Component\Config\FileLocatorInterface'))) - ->addArgument(new Definition($this->getMockClass('Symfony\\Bundle\\FrameworkBundle\\Templating\\GlobalVariables'), array(new Definition($this->getMockClass('Symfony\\Component\\DependencyInjection\\Container'))))); - $this->container->setParameter('kernel.bundles', array()); - $this->container->setParameter('kernel.cache_dir', __DIR__); - $this->container->setParameter('kernel.debug', false); - $this->container->setParameter('kernel.root_dir', __DIR__); - $this->container->register('profiler', $this->getMockClass('Symfony\\Component\\HttpKernel\\Profiler\\Profiler')) - ->addArgument(new Definition($this->getMockClass('Symfony\\Component\\HttpKernel\\Profiler\\ProfilerStorageInterface'))); - $this->container->setParameter('data_collector.templates', array()); - $this->container->set('kernel', $this->kernel); - } - - protected function tearDown() - { - parent::tearDown(); - - $this->container = null; - $this->kernel = null; - } - - /** - * @dataProvider getDebugModes - */ - public function testDefaultConfig($debug) - { - $this->container->setParameter('kernel.debug', $debug); - - $extension = new WebProfilerExtension(); - $extension->load(array(array()), $this->container); - - $this->assertFalse($this->container->get('web_profiler.debug_toolbar')->isEnabled()); - - $this->assertSaneContainer($this->getDumpedContainer()); - } - - /** - * @dataProvider getDebugModes - */ - public function testToolbarConfig($enabled) - { - $extension = new WebProfilerExtension(); - $extension->load(array(array('toolbar' => $enabled)), $this->container); - - $this->assertSame($enabled, $this->container->get('web_profiler.debug_toolbar')->isEnabled()); - - $this->assertSaneContainer($this->getDumpedContainer()); - } - - public function getDebugModes() - { - return array( - array(true), - array(false), - ); - } - - private function getDumpedContainer() - { - static $i = 0; - $class = 'WebProfilerExtensionTestContainer'.$i++; - - $this->container->compile(); - - $dumper = new PhpDumper($this->container); - eval('?>'.$dumper->dump(array('class' => $class))); - - $container = new $class(); - $container->enterScope('request'); - $container->set('kernel', $this->kernel); - - return $container; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php deleted file mode 100644 index c9e4a59..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php +++ /dev/null @@ -1,226 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\WebProfilerBundle\Tests\EventListener; - -use Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; -use Symfony\Component\HttpKernel\HttpKernelInterface; - -class WebDebugToolbarListenerTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getInjectToolbarTests - */ - public function testInjectToolbar($content, $expected) - { - $listener = new WebDebugToolbarListener($this->getTemplatingMock()); - $m = new \ReflectionMethod($listener, 'injectToolbar'); - $m->setAccessible(true); - - $response = new Response($content); - - $m->invoke($listener, $response); - $this->assertEquals($expected, $response->getContent()); - } - - public function getInjectToolbarTests() - { - return array( - array('', "\nWDT\n"), - array(' - - - - - ', " - - - - \nWDT\n - "), - ); - } - - /** - * @dataProvider provideRedirects - */ - public function testRedirectionIsIntercepted($statusCode, $hasSession) - { - $response = new Response('Some content', $statusCode); - $response->headers->set('X-Debug-Token', 'xxxxxxxx'); - $event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(false, 'html', $hasSession), HttpKernelInterface::MASTER_REQUEST, $response); - - $listener = new WebDebugToolbarListener($this->getTemplatingMock('Redirection'), true); - $listener->onKernelResponse($event); - - $this->assertEquals(200, $response->getStatusCode()); - $this->assertEquals('Redirection', $response->getContent()); - } - - public function testToolbarIsInjected() - { - $response = new Response(''); - $response->headers->set('X-Debug-Token', 'xxxxxxxx'); - - $event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(), HttpKernelInterface::MASTER_REQUEST, $response); - - $listener = new WebDebugToolbarListener($this->getTemplatingMock()); - $listener->onKernelResponse($event); - - $this->assertEquals("\nWDT\n", $response->getContent()); - } - - /** - * @depends testToolbarIsInjected - * @dataProvider provideRedirects - */ - public function testToolbarIsNotInjectedOnRedirection($statusCode, $hasSession) - { - $response = new Response('', $statusCode); - $response->headers->set('X-Debug-Token', 'xxxxxxxx'); - $event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(false, 'html', $hasSession), HttpKernelInterface::MASTER_REQUEST, $response); - - $listener = new WebDebugToolbarListener($this->getTemplatingMock()); - $listener->onKernelResponse($event); - - $this->assertEquals('', $response->getContent()); - } - - public function provideRedirects() - { - return array( - array(301, true), - array(302, true), - array(301, false), - array(302, false), - ); - } - - /** - * @depends testToolbarIsInjected - */ - public function testToolbarIsNotInjectedWhenThereIsNoNoXDebugTokenResponseHeader() - { - $response = new Response(''); - - $event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(), HttpKernelInterface::MASTER_REQUEST, $response); - - $listener = new WebDebugToolbarListener($this->getTemplatingMock()); - $listener->onKernelResponse($event); - - $this->assertEquals('', $response->getContent()); - } - - /** - * @depends testToolbarIsInjected - */ - public function testToolbarIsNotInjectedWhenOnSubRequest() - { - $response = new Response(''); - $response->headers->set('X-Debug-Token', 'xxxxxxxx'); - - $event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(), HttpKernelInterface::SUB_REQUEST, $response); - - $listener = new WebDebugToolbarListener($this->getTemplatingMock()); - $listener->onKernelResponse($event); - - $this->assertEquals('', $response->getContent()); - } - - /** - * @depends testToolbarIsInjected - */ - public function testToolbarIsNotInjectedOnIncompleteHtmlResponses() - { - $response = new Response('
    Some content
    '); - $response->headers->set('X-Debug-Token', 'xxxxxxxx'); - - $event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(), HttpKernelInterface::MASTER_REQUEST, $response); - - $listener = new WebDebugToolbarListener($this->getTemplatingMock()); - $listener->onKernelResponse($event); - - $this->assertEquals('
    Some content
    ', $response->getContent()); - } - - /** - * @depends testToolbarIsInjected - */ - public function testToolbarIsNotInjectedOnXmlHttpRequests() - { - $response = new Response(''); - $response->headers->set('X-Debug-Token', 'xxxxxxxx'); - - $event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(true), HttpKernelInterface::MASTER_REQUEST, $response); - - $listener = new WebDebugToolbarListener($this->getTemplatingMock()); - $listener->onKernelResponse($event); - - $this->assertEquals('', $response->getContent()); - } - - /** - * @depends testToolbarIsInjected - */ - public function testToolbarIsNotInjectedOnNonHtmlRequests() - { - $response = new Response(''); - $response->headers->set('X-Debug-Token', 'xxxxxxxx'); - - $event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(false, 'json'), HttpKernelInterface::MASTER_REQUEST, $response); - - $listener = new WebDebugToolbarListener($this->getTemplatingMock()); - $listener->onKernelResponse($event); - - $this->assertEquals('', $response->getContent()); - } - - protected function getRequestMock($isXmlHttpRequest = false, $requestFormat = 'html', $hasSession = true) - { - $request = $this->getMock( - 'Symfony\Component\HttpFoundation\Request', - array('getSession', 'isXmlHttpRequest', 'getRequestFormat'), - array(), '', false - ); - $request->expects($this->any()) - ->method('isXmlHttpRequest') - ->will($this->returnValue($isXmlHttpRequest)); - $request->expects($this->any()) - ->method('getRequestFormat') - ->will($this->returnValue($requestFormat)); - - if ($hasSession) { - $session = $this->getMock('Symfony\Component\HttpFoundation\Session\Session', array(), array(), '', false); - $request->expects($this->any()) - ->method('getSession') - ->will($this->returnValue($session)); - } - - return $request; - } - - protected function getTemplatingMock($render = 'WDT') - { - $templating = $this->getMock('Symfony\Bundle\TwigBundle\TwigEngine', array(), array(), '', false); - $templating->expects($this->any()) - ->method('render') - ->will($this->returnValue($render)); - - return $templating; - } - - protected function getKernelMock() - { - return $this->getMock('Symfony\Component\HttpKernel\Kernel', array(), array(), '', false); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/Profiler/TemplateManagerTest.php b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/Profiler/TemplateManagerTest.php deleted file mode 100644 index 6a9242f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/Profiler/TemplateManagerTest.php +++ /dev/null @@ -1,178 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\WebProfilerBundle\Tests\Profiler; - -use Symfony\Bundle\WebProfilerBundle\Tests\TestCase; -use Symfony\Bundle\WebProfilerBundle\Profiler\TemplateManager; - -/** - * Test for TemplateManager class. - * - * @author Artur Wielogórski - */ -class TemplateManagerTest extends TestCase -{ - /** - * @var \Symfony\Bundle\TwigBundle\TwigEngine - */ - protected $twigEngine; - - /** - * @var \Twig_Environment - */ - protected $twigEnvironment; - - /** - * @var \Symfony\Component\HttpKernel\Profiler\Profiler - */ - protected $profiler; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $profile; - - /** - * @var \Symfony\Bundle\WebProfilerBundle\Profiler\TemplateManager - */ - protected $templateManager; - - public function setUp() - { - parent::setUp(); - - $profiler = $this->mockProfiler(); - $twigEngine = $this->mockTwigEngine(); - $twigEnvironment = $this->mockTwigEnvironment(); - $templates = array( - 'data_collector.foo'=>array('foo','FooBundle:Collector:foo'), - 'data_collector.bar'=>array('bar','FooBundle:Collector:bar'), - 'data_collector.baz'=>array('baz','FooBundle:Collector:baz') - ); - - $this->templateManager = new TemplateManager($profiler, $twigEngine, $twigEnvironment, $templates); - } - - /** - * @expectedException Symfony\Component\HttpKernel\Exception\NotFoundHttpException - */ - public function testGetNameOfInvalidTemplate() - { - $profile = $this->mockProfile(); - $this->templateManager->getName($profile, 'notexistingpanel'); - } - - /** - * if template exists in both profile and profiler then its name should be returned - */ - public function testGetNameValidTemplate() - { - $this->profiler->expects($this->any()) - ->method('has') - ->withAnyParameters() - ->will($this->returnCallback(array($this, 'profilerHasCallback'))); - - $profile = $this->mockProfile(); - $profile->expects($this->any()) - ->method('hasCollector') - ->will($this->returnCallback(array($this, 'profileHasCollectorCallback'))); - - $this->assertEquals('FooBundle:Collector:foo.html.twig', $this->templateManager->getName($profile, 'foo')); - } - - /** - * template should be loaded for 'foo' because other collectors are - * missing in profile or in profiler - */ - public function testGetTemplates() - { - - $profile = $this->mockProfile(); - $profile->expects($this->any()) - ->method('hasCollector') - ->will($this->returnCallback(array($this, 'profilerHasCallback'))); - - $this->profiler->expects($this->any()) - ->method('has') - ->withAnyParameters() - ->will($this->returnCallback(array($this, 'profileHasCollectorCallback'))); - - $result = $this->templateManager->getTemplates($profile); - $this->assertArrayHasKey('foo',$result); - $this->assertArrayNotHasKey('bar',$result); - $this->assertArrayNotHasKey('baz',$result); - } - - public function profilerHasCallback($panel) - { - switch ($panel) { - case 'foo': - case 'bar': - return true; - default: - return false; - } - } - - public function profileHasCollectorCallback($panel) - { - switch ($panel) { - case 'foo': - case 'baz': - return true; - default: - return false; - } - } - - protected function mockProfile() - { - $this->profile = $this->getMockBuilder('Symfony\Component\HttpKernel\Profiler\Profile') - ->disableOriginalConstructor() - ->getMock(); - - return $this->profile; - } - - protected function mockTwigEnvironment() - { - $this->twigEnvironment = $this->getMockBuilder('Twig_Environment')->getMock(); - - $this->twigEnvironment->expects($this->any()) - ->method('loadTemplate') - ->will($this->returnValue('loadedTemplate')); - - return $this->twigEnvironment; - } - - protected function mockTwigEngine() - { - $this->twigEngine = $this->getMockBuilder('Symfony\Bundle\TwigBundle\TwigEngine') - ->disableOriginalConstructor() - ->getMock(); - - $this->twigEngine->expects($this->any()) - ->method('exists') - ->will($this->returnValue(true)); - - return $this->twigEngine; - } - - protected function mockProfiler() - { - $this->profiler = $this->getMockBuilder('Symfony\Component\HttpKernel\Profiler\Profiler') - ->disableOriginalConstructor() - ->getMock(); - - return $this->profiler; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/TestCase.php b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/TestCase.php deleted file mode 100644 index 586da13..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Tests/TestCase.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\WebProfilerBundle\Tests; - -class TestCase extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!class_exists('Twig_Environment')) { - $this->markTestSkipped('Twig is not available.'); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/WebProfilerBundle.php b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/WebProfilerBundle.php deleted file mode 100644 index fecc0f3..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/WebProfilerBundle.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\WebProfilerBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; - -/** - * Bundle. - * - * @author Fabien Potencier - */ -class WebProfilerBundle extends Bundle -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/composer.json b/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/composer.json deleted file mode 100644 index f4c5baa..0000000 --- a/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/composer.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "symfony/web-profiler-bundle", - "type": "symfony-bundle", - "description": "Symfony WebProfilerBundle", - "keywords": [], - "homepage": "http://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "require": { - "php": ">=5.3.3", - "symfony/twig-bundle": "self.version" - }, - "autoload": { - "psr-0": { "Symfony\\Bundle\\WebProfilerBundle": "" } - }, - "target-dir": "Symfony/Bundle/WebProfilerBundle", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/.gitignore b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/.gitignore deleted file mode 100644 index d1502b0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -vendor/ -composer.lock diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/CHANGELOG.md b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/CHANGELOG.md deleted file mode 100644 index 42d32a7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -CHANGELOG -========= - -2.1.0 ------ - - * [BC BREAK] The CookieJar internals have changed to allow cookies with the - same name on different sub-domains/sub-paths diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Client.php b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Client.php deleted file mode 100644 index c57b9e3..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Client.php +++ /dev/null @@ -1,492 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\BrowserKit; - -use Symfony\Component\DomCrawler\Crawler; -use Symfony\Component\DomCrawler\Link; -use Symfony\Component\DomCrawler\Form; -use Symfony\Component\Process\PhpProcess; - -/** - * Client simulates a browser. - * - * To make the actual request, you need to implement the doRequest() method. - * - * If you want to be able to run requests in their own process (insulated flag), - * you need to also implement the getScript() method. - * - * @author Fabien Potencier - * - * @api - */ -abstract class Client -{ - protected $history; - protected $cookieJar; - protected $server; - protected $request; - protected $response; - protected $crawler; - protected $insulated; - protected $redirect; - protected $followRedirects; - - /** - * Constructor. - * - * @param array $server The server parameters (equivalent of $_SERVER) - * @param History $history A History instance to store the browser history - * @param CookieJar $cookieJar A CookieJar instance to store the cookies - * - * @api - */ - public function __construct(array $server = array(), History $history = null, CookieJar $cookieJar = null) - { - $this->setServerParameters($server); - $this->history = null === $history ? new History() : $history; - $this->cookieJar = null === $cookieJar ? new CookieJar() : $cookieJar; - $this->insulated = false; - $this->followRedirects = true; - } - - /** - * Sets whether to automatically follow redirects or not. - * - * @param Boolean $followRedirect Whether to follow redirects - * - * @api - */ - public function followRedirects($followRedirect = true) - { - $this->followRedirects = (Boolean) $followRedirect; - } - - /** - * Sets the insulated flag. - * - * @param Boolean $insulated Whether to insulate the requests or not - * - * @throws \RuntimeException When Symfony Process Component is not installed - * - * @api - */ - public function insulate($insulated = true) - { - if ($insulated && !class_exists('Symfony\\Component\\Process\\Process')) { - // @codeCoverageIgnoreStart - throw new \RuntimeException('Unable to isolate requests as the Symfony Process Component is not installed.'); - // @codeCoverageIgnoreEnd - } - - $this->insulated = (Boolean) $insulated; - } - - /** - * Sets server parameters. - * - * @param array $server An array of server parameters - * - * @api - */ - public function setServerParameters(array $server) - { - $this->server = array_merge(array( - 'HTTP_HOST' => 'localhost', - 'HTTP_USER_AGENT' => 'Symfony2 BrowserKit', - ), $server); - } - - /** - * Sets single server parameter. - * - * @param string $key A key of the parameter - * @param string $value A value of the parameter - */ - public function setServerParameter($key, $value) - { - $this->server[$key] = $value; - } - - /** - * Gets single server parameter for specified key. - * - * @param string $key A key of the parameter to get - * @param string $default A default value when key is undefined - * - * @return string A value of the parameter - */ - public function getServerParameter($key, $default = '') - { - return (isset($this->server[$key])) ? $this->server[$key] : $default; - } - - /** - * Returns the History instance. - * - * @return History A History instance - * - * @api - */ - public function getHistory() - { - return $this->history; - } - - /** - * Returns the CookieJar instance. - * - * @return CookieJar A CookieJar instance - * - * @api - */ - public function getCookieJar() - { - return $this->cookieJar; - } - - /** - * Returns the current Crawler instance. - * - * @return Crawler A Crawler instance - * - * @api - */ - public function getCrawler() - { - return $this->crawler; - } - - /** - * Returns the current Response instance. - * - * @return Response A Response instance - * - * @api - */ - public function getResponse() - { - return $this->response; - } - - /** - * Returns the current Request instance. - * - * @return Request A Request instance - * - * @api - */ - public function getRequest() - { - return $this->request; - } - - /** - * Clicks on a given link. - * - * @param Link $link A Link instance - * - * @return Crawler - * - * @api - */ - public function click(Link $link) - { - if ($link instanceof Form) { - return $this->submit($link); - } - - return $this->request($link->getMethod(), $link->getUri()); - } - - /** - * Submits a form. - * - * @param Form $form A Form instance - * @param array $values An array of form field values - * - * @return Crawler - * - * @api - */ - public function submit(Form $form, array $values = array()) - { - $form->setValues($values); - - return $this->request($form->getMethod(), $form->getUri(), $form->getPhpValues(), $form->getPhpFiles()); - } - - /** - * Calls a URI. - * - * @param string $method The request method - * @param string $uri The URI to fetch - * @param array $parameters The Request parameters - * @param array $files The files - * @param array $server The server parameters (HTTP headers are referenced with a HTTP_ prefix as PHP does) - * @param string $content The raw body data - * @param Boolean $changeHistory Whether to update the history or not (only used internally for back(), forward(), and reload()) - * - * @return Crawler - * - * @api - */ - public function request($method, $uri, array $parameters = array(), array $files = array(), array $server = array(), $content = null, $changeHistory = true) - { - $uri = $this->getAbsoluteUri($uri); - - $server = array_merge($this->server, $server); - if (!$this->history->isEmpty()) { - $server['HTTP_REFERER'] = $this->history->current()->getUri(); - } - $server['HTTP_HOST'] = parse_url($uri, PHP_URL_HOST); - $server['HTTPS'] = 'https' == parse_url($uri, PHP_URL_SCHEME); - - $request = new Request($uri, $method, $parameters, $files, $this->cookieJar->allValues($uri), $server, $content); - - $this->request = $this->filterRequest($request); - - if (true === $changeHistory) { - $this->history->add($request); - } - - if ($this->insulated) { - $this->response = $this->doRequestInProcess($this->request); - } else { - $this->response = $this->doRequest($this->request); - } - - $response = $this->filterResponse($this->response); - - $this->cookieJar->updateFromResponse($response); - - $this->redirect = $response->getHeader('Location'); - - if ($this->followRedirects && $this->redirect) { - return $this->crawler = $this->followRedirect(); - } - - return $this->crawler = $this->createCrawlerFromContent($request->getUri(), $response->getContent(), $response->getHeader('Content-Type')); - } - - /** - * Makes a request in another process. - * - * @param Request $request A Request instance - * - * @return Response A Response instance - * - * @throws \RuntimeException When processing returns exit code - */ - protected function doRequestInProcess($request) - { - // We set the TMPDIR (for Macs) and TEMP (for Windows), because on these platforms the temp directory changes based on the user. - $process = new PhpProcess($this->getScript($request), null, array('TMPDIR' => sys_get_temp_dir(), 'TEMP' => sys_get_temp_dir())); - $process->run(); - - if (!$process->isSuccessful() || !preg_match('/^O\:\d+\:/', $process->getOutput())) { - throw new \RuntimeException('OUTPUT: '.$process->getOutput().' ERROR OUTPUT: '.$process->getErrorOutput()); - } - - return unserialize($process->getOutput()); - } - - /** - * Makes a request. - * - * @param Request $request A Request instance - * - * @return Response A Response instance - */ - abstract protected function doRequest($request); - - /** - * Returns the script to execute when the request must be insulated. - * - * @param Request $request A Request instance - * - * @throws \LogicException When this abstract class is not implemented - */ - protected function getScript($request) - { - // @codeCoverageIgnoreStart - throw new \LogicException('To insulate requests, you need to override the getScript() method.'); - // @codeCoverageIgnoreEnd - } - - /** - * Filters the request. - * - * @param Request $request The request to filter - * - * @return Request - */ - protected function filterRequest(Request $request) - { - return $request; - } - - /** - * Filters the Response. - * - * @param Response $response The Response to filter - * - * @return Response - */ - protected function filterResponse($response) - { - return $response; - } - - /** - * Creates a crawler. - * - * This method returns null if the DomCrawler component is not available. - * - * @param string $uri A uri - * @param string $content Content for the crawler to use - * @param string $type Content type - * - * @return Crawler|null - */ - protected function createCrawlerFromContent($uri, $content, $type) - { - if (!class_exists('Symfony\Component\DomCrawler\Crawler')) { - return null; - } - - $crawler = new Crawler(null, $uri); - $crawler->addContent($content, $type); - - return $crawler; - } - - /** - * Goes back in the browser history. - * - * @return Crawler - * - * @api - */ - public function back() - { - return $this->requestFromRequest($this->history->back(), false); - } - - /** - * Goes forward in the browser history. - * - * @return Crawler - * - * @api - */ - public function forward() - { - return $this->requestFromRequest($this->history->forward(), false); - } - - /** - * Reloads the current browser. - * - * @return Crawler - * - * @api - */ - public function reload() - { - return $this->requestFromRequest($this->history->current(), false); - } - - /** - * Follow redirects? - * - * @return Crawler - * - * @throws \LogicException If request was not a redirect - * - * @api - */ - public function followRedirect() - { - if (empty($this->redirect)) { - throw new \LogicException('The request was not redirected.'); - } - - return $this->request('get', $this->redirect); - } - - /** - * Restarts the client. - * - * It flushes history and all cookies. - * - * @api - */ - public function restart() - { - $this->cookieJar->clear(); - $this->history->clear(); - } - - /** - * Takes a URI and converts it to absolute if it is not already absolute. - * - * @param string $uri A uri - * - * @return string An absolute uri - */ - protected function getAbsoluteUri($uri) - { - // already absolute? - if (0 === strpos($uri, 'http')) { - return $uri; - } - - if (!$this->history->isEmpty()) { - $currentUri = $this->history->current()->getUri(); - } else { - $currentUri = sprintf('http%s://%s/', - isset($this->server['HTTPS']) ? 's' : '', - isset($this->server['HTTP_HOST']) ? $this->server['HTTP_HOST'] : 'localhost' - ); - } - - // anchor? - if (!$uri || '#' == $uri[0]) { - return preg_replace('/#.*?$/', '', $currentUri).$uri; - } - - if ('/' !== $uri[0]) { - $path = parse_url($currentUri, PHP_URL_PATH); - - if ('/' !== substr($path, -1)) { - $path = substr($path, 0, strrpos($path, '/') + 1); - } - - $uri = $path.$uri; - } - - return preg_replace('#^(.*?//[^/]+)\/.*$#', '$1', $currentUri).$uri; - } - - /** - * Makes a request from a Request object directly. - * - * @param Request $request A Request instance - * @param Boolean $changeHistory Whether to update the history or not (only used internally for back(), forward(), and reload()) - * - * @return Crawler - */ - protected function requestFromRequest(Request $request, $changeHistory = true) - { - return $this->request($request->getMethod(), $request->getUri(), $request->getParameters(), $request->getFiles(), $request->getServer(), $request->getContent(), $changeHistory); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Cookie.php b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Cookie.php deleted file mode 100644 index 148767d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Cookie.php +++ /dev/null @@ -1,315 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\BrowserKit; - -/** - * Cookie represents an HTTP cookie. - * - * @author Fabien Potencier - * - * @api - */ -class Cookie -{ - /** - * Handles dates as defined by RFC 2616 section 3.3.1, and also some other - * non-standard, but common formats. - * - * @var array - */ - private static $dateFormats = array( - 'D, d M Y H:i:s T', - 'D, d-M-y H:i:s T', - 'D, d-M-Y H:i:s T', - 'D M j G:i:s Y', - ); - - protected $name; - protected $value; - protected $expires; - protected $path; - protected $domain; - protected $secure; - protected $httponly; - protected $rawValue; - - /** - * Sets a cookie. - * - * @param string $name The cookie name - * @param string $value The value of the cookie - * @param string $expires The time the cookie expires - * @param string $path The path on the server in which the cookie will be available on - * @param string $domain The domain that the cookie is available - * @param Boolean $secure Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client - * @param Boolean $httponly The cookie httponly flag - * @param Boolean $encodedValue Whether the value is encoded or not - * - * @api - */ - public function __construct($name, $value, $expires = null, $path = null, $domain = '', $secure = false, $httponly = true, $encodedValue = false) - { - if ($encodedValue) { - $this->value = urldecode($value); - $this->rawValue = $value; - } else { - $this->value = $value; - $this->rawValue = urlencode($value); - } - $this->name = $name; - $this->expires = null === $expires ? null : (integer) $expires; - $this->path = empty($path) ? '/' : $path; - $this->domain = $domain; - $this->secure = (Boolean) $secure; - $this->httponly = (Boolean) $httponly; - } - - /** - * Returns the HTTP representation of the Cookie. - * - * @return string The HTTP representation of the Cookie - * - * @api - */ - public function __toString() - { - $cookie = sprintf('%s=%s', $this->name, $this->rawValue); - - if (null !== $this->expires) { - $cookie .= '; expires='.substr(\DateTime::createFromFormat('U', $this->expires, new \DateTimeZone('GMT'))->format(self::$dateFormats[0]), 0, -5); - } - - if ('' !== $this->domain) { - $cookie .= '; domain='.$this->domain; - } - - if ('/' !== $this->path) { - $cookie .= '; path='.$this->path; - } - - if ($this->secure) { - $cookie .= '; secure'; - } - - if ($this->httponly) { - $cookie .= '; httponly'; - } - - return $cookie; - } - - /** - * Creates a Cookie instance from a Set-Cookie header value. - * - * @param string $cookie A Set-Cookie header value - * @param string $url The base URL - * - * @return Cookie A Cookie instance - * - * @api - */ - public static function fromString($cookie, $url = null) - { - $parts = explode(';', $cookie); - - if (false === strpos($parts[0], '=')) { - throw new \InvalidArgumentException('The cookie string "%s" is not valid.'); - } - - list($name, $value) = explode('=', array_shift($parts), 2); - - $values = array( - 'name' => trim($name), - 'value' => trim($value), - 'expires' => null, - 'path' => '/', - 'domain' => '', - 'secure' => false, - 'httponly' => false, - 'passedRawValue' => true, - ); - - if (null !== $url) { - if ((false === $urlParts = parse_url($url)) || !isset($urlParts['host']) || !isset($urlParts['path'])) { - throw new \InvalidArgumentException(sprintf('The URL "%s" is not valid.', $url)); - } - $parts = array_merge($urlParts, $parts); - - $values['domain'] = $parts['host']; - $values['path'] = substr($parts['path'], 0, strrpos($parts['path'], '/')); - } - - foreach ($parts as $part) { - $part = trim($part); - - if ('secure' === strtolower($part)) { - // Ignore the secure flag if the original URI is not given or is not HTTPS - if (!$url || !isset($urlParts['scheme']) || 'https' != $urlParts['scheme']) { - continue; - } - - $values['secure'] = true; - - continue; - } - - if ('httponly' === strtolower($part)) { - $values['httponly'] = true; - - continue; - } - - if (2 === count($elements = explode('=', $part, 2))) { - if ('expires' === strtolower($elements[0])) { - $elements[1] = self::parseDate($elements[1]); - } - - $values[strtolower($elements[0])] = $elements[1]; - } - } - - return new static( - $values['name'], - $values['value'], - $values['expires'], - $values['path'], - $values['domain'], - $values['secure'], - $values['httponly'], - $values['passedRawValue'] - ); - } - - private static function parseDate($dateValue) - { - // trim single quotes around date if present - if (($length = strlen($dateValue)) > 1 && "'" === $dateValue[0] && "'" === $dateValue[$length-1]) { - $dateValue = substr($dateValue, 1, -1); - } - - foreach (self::$dateFormats as $dateFormat) { - if (false !== $date = \DateTime::createFromFormat($dateFormat, $dateValue, new \DateTimeZone('GMT'))) { - return $date->getTimestamp(); - } - } - - throw new \InvalidArgumentException(sprintf('Could not parse date "%s".', $dateValue)); - } - - /** - * Gets the name of the cookie. - * - * @return string The cookie name - * - * @api - */ - public function getName() - { - return $this->name; - } - - /** - * Gets the value of the cookie. - * - * @return string The cookie value - * - * @api - */ - public function getValue() - { - return $this->value; - } - - /** - * Gets the raw value of the cookie. - * - * @return string The cookie value - * - * @api - */ - public function getRawValue() - { - return $this->rawValue; - } - - /** - * Gets the expires time of the cookie. - * - * @return string The cookie expires time - * - * @api - */ - public function getExpiresTime() - { - return $this->expires; - } - - /** - * Gets the path of the cookie. - * - * @return string The cookie path - * - * @api - */ - public function getPath() - { - return $this->path; - } - - /** - * Gets the domain of the cookie. - * - * @return string The cookie domain - * - * @api - */ - public function getDomain() - { - return $this->domain; - } - - /** - * Returns the secure flag of the cookie. - * - * @return Boolean The cookie secure flag - * - * @api - */ - public function isSecure() - { - return $this->secure; - } - - /** - * Returns the httponly flag of the cookie. - * - * @return Boolean The cookie httponly flag - * - * @api - */ - public function isHttpOnly() - { - return $this->httponly; - } - - /** - * Returns true if the cookie has expired. - * - * @return Boolean true if the cookie has expired, false otherwise - * - * @api - */ - public function isExpired() - { - return null !== $this->expires && 0 !== $this->expires && $this->expires < time(); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/CookieJar.php b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/CookieJar.php deleted file mode 100644 index 2a5c170..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/CookieJar.php +++ /dev/null @@ -1,215 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\BrowserKit; - -/** - * CookieJar. - * - * @author Fabien Potencier - * - * @api - */ -class CookieJar -{ - protected $cookieJar = array(); - - /** - * Sets a cookie. - * - * @param Cookie $cookie A Cookie instance - * - * @api - */ - public function set(Cookie $cookie) - { - $this->cookieJar[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()] = $cookie; - } - - /** - * Gets a cookie by name. - * - * @param string $name The cookie name - * @param string $path The cookie path - * @param string $domain The cookie domain - * - * @return Cookie|null A Cookie instance or null if the cookie does not exist - * - * @api - */ - public function get($name, $path = '/', $domain = null) - { - $this->flushExpiredCookies(); - - return isset($this->cookieJar[$domain][$path][$name]) ? $this->cookieJar[$domain][$path][$name] : null; - } - - /** - * Removes a cookie by name. - * - * @param string $name The cookie name - * @param string $path The cookie path - * @param string $domain The cookie domain - * - * @api - */ - public function expire($name, $path = '/', $domain = null) - { - if (null === $path) { - $path = '/'; - } - - unset($this->cookieJar[$domain][$path][$name]); - - if (empty($this->cookieJar[$domain][$path])) { - unset($this->cookieJar[$domain][$path]); - - if (empty($this->cookieJar[$domain])) { - unset($this->cookieJar[$domain]); - } - } - } - - /** - * Removes all the cookies from the jar. - * - * @api - */ - public function clear() - { - $this->cookieJar = array(); - } - - /** - * Updates the cookie jar from a response Set-Cookie headers. - * - * @param array $setCookies Set-Cookie headers from an HTTP response - * @param string $uri The base URL - */ - public function updateFromSetCookie(array $setCookies, $uri = null) - { - $cookies = array(); - - foreach ($setCookies as $cookie) { - foreach (explode(',', $cookie) as $i => $part) { - if (0 === $i || preg_match('/^(?P\s*[0-9A-Za-z!#\$%\&\'\*\+\-\.^_`\|~]+)=/', $part)) { - $cookies[] = ltrim($part); - } else { - $cookies[count($cookies) - 1] .= ','.$part; - } - } - } - - foreach ($cookies as $cookie) { - $this->set(Cookie::fromString($cookie, $uri)); - } - } - - /** - * Updates the cookie jar from a Response object. - * - * @param Response $response A Response object - * @param string $uri The base URL - */ - public function updateFromResponse(Response $response, $uri = null) - { - $this->updateFromSetCookie($response->getHeader('Set-Cookie', false), $uri); - } - - /** - * Returns not yet expired cookies. - * - * @return array An array of cookies - */ - public function all() - { - $this->flushExpiredCookies(); - - $flattenedCookies = array(); - foreach ($this->cookieJar as $path) { - foreach ($path as $cookies) { - foreach ($cookies as $cookie) { - $flattenedCookies[] = $cookie; - } - } - } - - return $flattenedCookies; - } - - /** - * Returns not yet expired cookie values for the given URI. - * - * @param string $uri A URI - * @param Boolean $returnsRawValue Returns raw value or urldecoded value - * - * @return array An array of cookie values - */ - public function allValues($uri, $returnsRawValue = false) - { - $this->flushExpiredCookies(); - - $parts = array_replace(array('path' => '/'), parse_url($uri)); - $cookies = array(); - foreach ($this->cookieJar as $domain => $pathCookies) { - if ($domain) { - $domain = ltrim($domain, '.'); - if ($domain != substr($parts['host'], -strlen($domain))) { - continue; - } - } - - foreach ($pathCookies as $path => $namedCookies) { - if ($path != substr($parts['path'], 0, strlen($path))) { - continue; - } - - foreach ($namedCookies as $cookie) { - if ($cookie->isSecure() && 'https' != $parts['scheme']) { - continue; - } - - $cookies[$cookie->getName()] = $returnsRawValue ? $cookie->getRawValue() : $cookie->getValue(); - } - } - } - - return $cookies; - } - - /** - * Returns not yet expired raw cookie values for the given URI. - * - * @param string $uri A URI - * - * @return array An array of cookie values - */ - public function allRawValues($uri) - { - return $this->allValues($uri, true); - } - - /** - * Removes all expired cookies. - */ - public function flushExpiredCookies() - { - foreach ($this->cookieJar as $domain => $pathCookies) { - foreach ($pathCookies as $path => $namedCookies) { - foreach ($namedCookies as $name => $cookie) { - if ($cookie->isExpired()) { - unset($this->cookieJar[$domain][$path][$name]); - } - } - } - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/History.php b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/History.php deleted file mode 100644 index a22847e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/History.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\BrowserKit; - -/** - * History. - * - * @author Fabien Potencier - */ -class History -{ - protected $stack = array(); - protected $position = -1; - - /** - * Constructor. - */ - public function __construct() - { - $this->clear(); - } - - /** - * Clears the history. - */ - public function clear() - { - $this->stack = array(); - $this->position = -1; - } - - /** - * Adds a Request to the history. - * - * @param Request $request A Request instance - */ - public function add(Request $request) - { - $this->stack = array_slice($this->stack, 0, $this->position + 1); - $this->stack[] = clone $request; - $this->position = count($this->stack) - 1; - } - - /** - * Returns true if the history is empty. - * - * @return Boolean true if the history is empty, false otherwise - */ - public function isEmpty() - { - return count($this->stack) == 0; - } - - /** - * Goes back in the history. - * - * @return Request A Request instance - * - * @throws \LogicException if the stack is already on the first page - */ - public function back() - { - if ($this->position < 1) { - throw new \LogicException('You are already on the first page.'); - } - - return clone $this->stack[--$this->position]; - } - - /** - * Goes forward in the history. - * - * @return Request A Request instance - * - * @throws \LogicException if the stack is already on the last page - */ - public function forward() - { - if ($this->position > count($this->stack) - 2) { - throw new \LogicException('You are already on the last page.'); - } - - return clone $this->stack[++$this->position]; - } - - /** - * Returns the current element in the history. - * - * @return Request A Request instance - * - * @throws \LogicException if the stack is empty - */ - public function current() - { - if (-1 == $this->position) { - throw new \LogicException('The page history is empty.'); - } - - return clone $this->stack[$this->position]; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/LICENSE b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/LICENSE deleted file mode 100644 index cdffe7a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2012 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/README.md b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/README.md deleted file mode 100644 index 061c2d7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/README.md +++ /dev/null @@ -1,26 +0,0 @@ -BrowserKit Component -==================== - -BrowserKit simulates the behavior of a web browser. - -The component only provide an abstract client and does not provide any -"default" backend for the HTTP layer. - -Resources ---------- - -For a simple implementation of a browser based on an HTTP layer, have a look -at [Goutte](https://github.com/fabpot/Goutte). - -For an implementation based on HttpKernelInterface, have a look at the -[Client](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Client.php) -provided by the HttpKernel component. - -You can run the unit tests with the following command: - - phpunit - -If you also want to run the unit tests that depend on other Symfony -Components, install dev dependencies before running PHPUnit: - - php composer.phar install --dev diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Request.php b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Request.php deleted file mode 100644 index c02f657..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Request.php +++ /dev/null @@ -1,138 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\BrowserKit; - -/** - * Request object. - * - * @author Fabien Potencier - * - * @api - */ -class Request -{ - protected $uri; - protected $method; - protected $parameters; - protected $files; - protected $cookies; - protected $server; - protected $content; - - /** - * Constructor. - * - * @param string $uri The request URI - * @param array $method The HTTP method request - * @param array $parameters The request parameters - * @param array $files An array of uploaded files - * @param array $cookies An array of cookies - * @param array $server An array of server parameters - * @param string $content The raw body data - * - * @api - */ - public function __construct($uri, $method, array $parameters = array(), array $files = array(), array $cookies = array(), array $server = array(), $content = null) - { - $this->uri = $uri; - $this->method = $method; - $this->parameters = $parameters; - $this->files = $files; - $this->cookies = $cookies; - $this->server = $server; - $this->content = $content; - } - - /** - * Gets the request URI. - * - * @return string The request URI - * - * @api - */ - public function getUri() - { - return $this->uri; - } - - /** - * Gets the request HTTP method. - * - * @return string The request HTTP method - * - * @api - */ - public function getMethod() - { - return $this->method; - } - - /** - * Gets the request parameters. - * - * @return array The request parameters - * - * @api - */ - public function getParameters() - { - return $this->parameters; - } - - /** - * Gets the request server files. - * - * @return array The request files - * - * @api - */ - public function getFiles() - { - return $this->files; - } - - /** - * Gets the request cookies. - * - * @return array The request cookies - * - * @api - */ - public function getCookies() - { - return $this->cookies; - } - - /** - * Gets the request server parameters. - * - * @return array The request server parameters - * - * @api - */ - public function getServer() - { - return $this->server; - } - - /** - * Gets the request raw body data. - * - * @return string The request raw body data. - * - * @api - */ - public function getContent() - { - return $this->content; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Response.php b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Response.php deleted file mode 100644 index 182fdda..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Response.php +++ /dev/null @@ -1,138 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\BrowserKit; - -/** - * Response object. - * - * @author Fabien Potencier - * - * @api - */ -class Response -{ - protected $content; - protected $status; - protected $headers; - - /** - * Constructor. - * - * The headers array is a set of key/value pairs. If a header is present multiple times - * then the value is an array of all the values. - * - * @param string $content The content of the response - * @param integer $status The response status code - * @param array $headers An array of headers - * - * @api - */ - public function __construct($content = '', $status = 200, array $headers = array()) - { - $this->content = $content; - $this->status = $status; - $this->headers = $headers; - } - - /** - * Converts the response object to string containing all headers and the response content. - * - * @return string The response with headers and content - */ - public function __toString() - { - $headers = ''; - foreach ($this->headers as $name => $value) { - if (is_string($value)) { - $headers .= $this->buildHeader($name, $value); - } else { - foreach ($value as $headerValue) { - $headers .= $this->buildHeader($name, $headerValue); - } - } - } - - return $headers."\n".$this->content; - } - - /** - * Returns the build header line. - * - * @param string $name The header name - * @param string $value The header value - * - * @return string The built header line - */ - protected function buildHeader($name, $value) - { - return sprintf("%s: %s\n", $name, $value); - } - - /** - * Gets the response content. - * - * @return string The response content - * - * @api - */ - public function getContent() - { - return $this->content; - } - - /** - * Gets the response status code. - * - * @return integer The response status code - * - * @api - */ - public function getStatus() - { - return $this->status; - } - - /** - * Gets the response headers. - * - * @return array The response headers - * - * @api - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * Gets a response header. - * - * @param string $header The header name - * @param Boolean $first Whether to return the first value or all header values - * - * @return string|array The first header value if $first is true, an array of values otherwise - */ - public function getHeader($header, $first = true) - { - foreach ($this->headers as $key => $value) { - if (str_replace('-', '_', strtolower($key)) == str_replace('-', '_', strtolower($header))) { - if ($first) { - return is_array($value) ? (count($value) ? $value[0] : '') : $value; - } - - return is_array($value) ? $value : array($value); - } - } - - return $first ? null : array(); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/ClientTest.php b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/ClientTest.php deleted file mode 100644 index 91d52df..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/ClientTest.php +++ /dev/null @@ -1,419 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Tests\BrowserKit; - -use Symfony\Component\BrowserKit\Client; -use Symfony\Component\BrowserKit\History; -use Symfony\Component\BrowserKit\CookieJar; -use Symfony\Component\BrowserKit\Request; -use Symfony\Component\BrowserKit\Response; - -class TestClient extends Client -{ - protected $nextResponse = null; - protected $nextScript = null; - - public function setNextResponse(Response $response) - { - $this->nextResponse = $response; - } - - public function setNextScript($script) - { - $this->nextScript = $script; - } - - protected function doRequest($request) - { - if (null === $this->nextResponse) { - return new Response(); - } - - $response = $this->nextResponse; - $this->nextResponse = null; - - return $response; - } - - protected function getScript($request) - { - $r = new \ReflectionClass('Symfony\Component\BrowserKit\Response'); - $path = $r->getFileName(); - - return <<nextScript); -EOF; - } -} - -class ClientTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\BrowserKit\Client::getHistory - */ - public function testGetHistory() - { - $client = new TestClient(array(), $history = new History()); - $this->assertSame($history, $client->getHistory(), '->getHistory() returns the History'); - } - - /** - * @covers Symfony\Component\BrowserKit\Client::getCookieJar - */ - public function testGetCookieJar() - { - $client = new TestClient(array(), null, $cookieJar = new CookieJar()); - $this->assertSame($cookieJar, $client->getCookieJar(), '->getCookieJar() returns the CookieJar'); - } - - /** - * @covers Symfony\Component\BrowserKit\Client::getRequest - */ - public function testGetRequest() - { - $client = new TestClient(); - $client->request('GET', 'http://example.com/'); - - $this->assertEquals('http://example.com/', $client->getRequest()->getUri(), '->getCrawler() returns the Request of the last request'); - } - - /** - * @covers Symfony\Component\BrowserKit\Client::getResponse - */ - public function testGetResponse() - { - $client = new TestClient(); - $client->setNextResponse(new Response('foo')); - $client->request('GET', 'http://example.com/'); - - $this->assertEquals('foo', $client->getResponse()->getContent(), '->getCrawler() returns the Response of the last request'); - } - - public function testGetContent() - { - $json = '{"jsonrpc":"2.0","method":"echo","id":7,"params":["Hello World"]}'; - - $client = new TestClient(); - $client->request('POST', 'http://example.com/jsonrpc', array(), array(), array(), $json); - $this->assertEquals($json, $client->getRequest()->getContent()); - } - - /** - * @covers Symfony\Component\BrowserKit\Client::getCrawler - */ - public function testGetCrawler() - { - $client = new TestClient(); - $client->setNextResponse(new Response('foo')); - $crawler = $client->request('GET', 'http://example.com/'); - - $this->assertSame($crawler, $client->getCrawler(), '->getCrawler() returns the Crawler of the last request'); - } - - public function testRequestHttpHeaders() - { - $client = new TestClient(); - $client->request('GET', '/'); - $headers = $client->getRequest()->getServer(); - $this->assertEquals('localhost', $headers['HTTP_HOST'], '->request() sets the HTTP_HOST header'); - - $client = new TestClient(); - $client->request('GET', 'http://www.example.com'); - $headers = $client->getRequest()->getServer(); - $this->assertEquals('www.example.com', $headers['HTTP_HOST'], '->request() sets the HTTP_HOST header'); - - $client->request('GET', 'https://www.example.com'); - $headers = $client->getRequest()->getServer(); - $this->assertTrue($headers['HTTPS'], '->request() sets the HTTPS header'); - } - - public function testRequestURIConversion() - { - $client = new TestClient(); - $client->request('GET', '/foo'); - $this->assertEquals('http://localhost/foo', $client->getRequest()->getUri(), '->request() converts the URI to an absolute one'); - - $client = new TestClient(); - $client->request('GET', 'http://www.example.com'); - $this->assertEquals('http://www.example.com', $client->getRequest()->getUri(), '->request() does not change absolute URIs'); - - $client = new TestClient(); - $client->request('GET', 'http://www.example.com/'); - $client->request('GET', '/foo'); - $this->assertEquals('http://www.example.com/foo', $client->getRequest()->getUri(), '->request() uses the previous request for relative URLs'); - - $client = new TestClient(); - $client->request('GET', 'http://www.example.com/foo'); - $client->request('GET', '#'); - $this->assertEquals('http://www.example.com/foo#', $client->getRequest()->getUri(), '->request() uses the previous request for #'); - $client->request('GET', '#'); - $this->assertEquals('http://www.example.com/foo#', $client->getRequest()->getUri(), '->request() uses the previous request for #'); - $client->request('GET', '#foo'); - $this->assertEquals('http://www.example.com/foo#foo', $client->getRequest()->getUri(), '->request() uses the previous request for #'); - - $client = new TestClient(); - $client->request('GET', 'http://www.example.com/foo/'); - $client->request('GET', 'bar'); - $this->assertEquals('http://www.example.com/foo/bar', $client->getRequest()->getUri(), '->request() uses the previous request for relative URLs'); - - $client = new TestClient(); - $client->request('GET', 'http://www.example.com/foo/foobar'); - $client->request('GET', 'bar'); - $this->assertEquals('http://www.example.com/foo/bar', $client->getRequest()->getUri(), '->request() uses the previous request for relative URLs'); - } - - public function testRequestReferer() - { - $client = new TestClient(); - $client->request('GET', 'http://www.example.com/foo/foobar'); - $client->request('GET', 'bar'); - $server = $client->getRequest()->getServer(); - $this->assertEquals('http://www.example.com/foo/foobar', $server['HTTP_REFERER'], '->request() sets the referer'); - } - - public function testRequestHistory() - { - $client = new TestClient(); - $client->request('GET', 'http://www.example.com/foo/foobar'); - $client->request('GET', 'bar'); - - $this->assertEquals('http://www.example.com/foo/bar', $client->getHistory()->current()->getUri(), '->request() updates the History'); - $this->assertEquals('http://www.example.com/foo/foobar', $client->getHistory()->back()->getUri(), '->request() updates the History'); - } - - public function testRequestCookies() - { - $client = new TestClient(); - $client->setNextResponse(new Response('foo', 200, array('Set-Cookie' => 'foo=bar'))); - $client->request('GET', 'http://www.example.com/foo/foobar'); - $this->assertEquals(array('foo' => 'bar'), $client->getCookieJar()->allValues('http://www.example.com/foo/foobar'), '->request() updates the CookieJar'); - - $client->request('GET', 'bar'); - $this->assertEquals(array('foo' => 'bar'), $client->getCookieJar()->allValues('http://www.example.com/foo/foobar'), '->request() updates the CookieJar'); - } - - public function testClick() - { - if (!class_exists('Symfony\Component\DomCrawler\Crawler')) { - $this->markTestSkipped('The "DomCrawler" component is not available'); - } - - if (!class_exists('Symfony\Component\CssSelector\CssSelector')) { - $this->markTestSkipped('The "CssSelector" component is not available'); - } - - $client = new TestClient(); - $client->setNextResponse(new Response('foo')); - $crawler = $client->request('GET', 'http://www.example.com/foo/foobar'); - - $client->click($crawler->filter('a')->link()); - - $this->assertEquals('http://www.example.com/foo', $client->getRequest()->getUri(), '->click() clicks on links'); - } - - public function testClickForm() - { - if (!class_exists('Symfony\Component\DomCrawler\Crawler')) { - $this->markTestSkipped('The "DomCrawler" component is not available'); - } - - if (!class_exists('Symfony\Component\CssSelector\CssSelector')) { - $this->markTestSkipped('The "CssSelector" component is not available'); - } - - $client = new TestClient(); - $client->setNextResponse(new Response('
    ')); - $crawler = $client->request('GET', 'http://www.example.com/foo/foobar'); - - $client->click($crawler->filter('input')->form()); - - $this->assertEquals('http://www.example.com/foo', $client->getRequest()->getUri(), '->click() Form submit forms'); - } - - public function testSubmit() - { - if (!class_exists('Symfony\Component\DomCrawler\Crawler')) { - $this->markTestSkipped('The "DomCrawler" component is not available'); - } - - if (!class_exists('Symfony\Component\CssSelector\CssSelector')) { - $this->markTestSkipped('The "CssSelector" component is not available'); - } - - $client = new TestClient(); - $client->setNextResponse(new Response('
    ')); - $crawler = $client->request('GET', 'http://www.example.com/foo/foobar'); - - $client->submit($crawler->filter('input')->form()); - - $this->assertEquals('http://www.example.com/foo', $client->getRequest()->getUri(), '->submit() submit forms'); - } - - public function testFollowRedirect() - { - $client = new TestClient(); - $client->followRedirects(false); - $client->request('GET', 'http://www.example.com/foo/foobar'); - - try { - $client->followRedirect(); - $this->fail('->followRedirect() throws a \LogicException if the request was not redirected'); - } catch (\Exception $e) { - $this->assertInstanceof('LogicException', $e, '->followRedirect() throws a \LogicException if the request was not redirected'); - } - - $client->setNextResponse(new Response('', 302, array('Location' => 'http://www.example.com/redirected'))); - $client->request('GET', 'http://www.example.com/foo/foobar'); - $client->followRedirect(); - - $this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), '->followRedirect() follows a redirect if any'); - - $client = new TestClient(); - $client->setNextResponse(new Response('', 302, array('Location' => 'http://www.example.com/redirected'))); - $client->request('GET', 'http://www.example.com/foo/foobar'); - - $this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), '->followRedirect() automatically follows redirects if followRedirects is true'); - } - - public function testFollowRedirectWithCookies() - { - $client = new TestClient(); - $client->followRedirects(false); - $client->setNextResponse(new Response('', 302, array( - 'Location' => 'http://www.example.com/redirected', - 'Set-Cookie' => 'foo=bar', - ))); - $client->request('GET', 'http://www.example.com/'); - $this->assertEquals(array(), $client->getRequest()->getCookies()); - $client->followRedirect(); - $this->assertEquals(array('foo' => 'bar'), $client->getRequest()->getCookies()); - } - - public function testBack() - { - $client = new TestClient(); - - $parameters = array('foo' => 'bar'); - $files = array('myfile.foo' => 'baz'); - $server = array('X_TEST_FOO' => 'bazbar'); - $content = 'foobarbaz'; - - $client->request('GET', 'http://www.example.com/foo/foobar', $parameters, $files, $server, $content); - $client->request('GET', 'http://www.example.com/foo'); - $client->back(); - - $this->assertEquals('http://www.example.com/foo/foobar', $client->getRequest()->getUri(), '->back() goes back in the history'); - $this->assertArrayHasKey('foo', $client->getRequest()->getParameters(), '->back() keeps parameters'); - $this->assertArrayHasKey('myfile.foo', $client->getRequest()->getFiles(), '->back() keeps files'); - $this->assertArrayHasKey('X_TEST_FOO', $client->getRequest()->getServer(), '->back() keeps $_SERVER'); - $this->assertEquals($content, $client->getRequest()->getContent(), '->back() keeps content'); - } - - public function testForward() - { - $client = new TestClient(); - - $parameters = array('foo' => 'bar'); - $files = array('myfile.foo' => 'baz'); - $server = array('X_TEST_FOO' => 'bazbar'); - $content = 'foobarbaz'; - - $client->request('GET', 'http://www.example.com/foo/foobar'); - $client->request('GET', 'http://www.example.com/foo', $parameters, $files, $server, $content); - $client->back(); - $client->forward(); - - $this->assertEquals('http://www.example.com/foo', $client->getRequest()->getUri(), '->forward() goes forward in the history'); - $this->assertArrayHasKey('foo', $client->getRequest()->getParameters(), '->forward() keeps parameters'); - $this->assertArrayHasKey('myfile.foo', $client->getRequest()->getFiles(), '->forward() keeps files'); - $this->assertArrayHasKey('X_TEST_FOO', $client->getRequest()->getServer(), '->forward() keeps $_SERVER'); - $this->assertEquals($content, $client->getRequest()->getContent(), '->forward() keeps content'); - } - - public function testReload() - { - $client = new TestClient(); - - $parameters = array('foo' => 'bar'); - $files = array('myfile.foo' => 'baz'); - $server = array('X_TEST_FOO' => 'bazbar'); - $content = 'foobarbaz'; - - $client->request('GET', 'http://www.example.com/foo/foobar', $parameters, $files, $server, $content); - $client->reload(); - - $this->assertEquals('http://www.example.com/foo/foobar', $client->getRequest()->getUri(), '->reload() reloads the current page'); - $this->assertArrayHasKey('foo', $client->getRequest()->getParameters(), '->reload() keeps parameters'); - $this->assertArrayHasKey('myfile.foo', $client->getRequest()->getFiles(), '->reload() keeps files'); - $this->assertArrayHasKey('X_TEST_FOO', $client->getRequest()->getServer(), '->reload() keeps $_SERVER'); - $this->assertEquals($content, $client->getRequest()->getContent(), '->reload() keeps content'); - } - - public function testRestart() - { - $client = new TestClient(); - $client->request('GET', 'http://www.example.com/foo/foobar'); - $client->restart(); - - $this->assertTrue($client->getHistory()->isEmpty(), '->restart() clears the history'); - $this->assertEquals(array(), $client->getCookieJar()->all(), '->restart() clears the cookies'); - } - - public function testInsulatedRequests() - { - if (!class_exists('Symfony\Component\Process\Process')) { - $this->markTestSkipped('The "Process" component is not available'); - } - - $client = new TestClient(); - $client->insulate(); - $client->setNextScript("new Symfony\Component\BrowserKit\Response('foobar')"); - $client->request('GET', 'http://www.example.com/foo/foobar'); - - $this->assertEquals('foobar', $client->getResponse()->getContent(), '->insulate() process the request in a forked process'); - - $client->setNextScript("new Symfony\Component\BrowserKit\Response('foobar)"); - - try { - $client->request('GET', 'http://www.example.com/foo/foobar'); - $this->fail('->request() throws a \RuntimeException if the script has an error'); - } catch (\Exception $e) { - $this->assertInstanceof('RuntimeException', $e, '->request() throws a \RuntimeException if the script has an error'); - } - } - - public function testGetServerParameter() - { - $client = new TestClient(); - $this->assertEquals('localhost', $client->getServerParameter('HTTP_HOST')); - $this->assertEquals('Symfony2 BrowserKit', $client->getServerParameter('HTTP_USER_AGENT')); - $this->assertEquals('testvalue', $client->getServerParameter('testkey', 'testvalue')); - } - - public function testSetServerParameter() - { - $client = new TestClient(); - - $this->assertEquals('localhost', $client->getServerParameter('HTTP_HOST')); - $this->assertEquals('Symfony2 BrowserKit', $client->getServerParameter('HTTP_USER_AGENT')); - - $client->setServerParameter('HTTP_HOST', 'testhost'); - $this->assertEquals('testhost', $client->getServerParameter('HTTP_HOST')); - - $client->setServerParameter('HTTP_USER_AGENT', 'testua'); - $this->assertEquals('testua', $client->getServerParameter('HTTP_USER_AGENT')); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/CookieJarTest.php b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/CookieJarTest.php deleted file mode 100644 index 0c077d3..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/CookieJarTest.php +++ /dev/null @@ -1,191 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Tests\BrowserKit; - -use Symfony\Component\BrowserKit\CookieJar; -use Symfony\Component\BrowserKit\Cookie; -use Symfony\Component\BrowserKit\Response; - -class CookieJarTest extends \PHPUnit_Framework_TestCase -{ - public function testSetGet() - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie = new Cookie('foo', 'bar')); - - $this->assertEquals($cookie, $cookieJar->get('foo'), '->set() sets a cookie'); - - $this->assertNull($cookieJar->get('foobar'), '->get() returns null if the cookie does not exist'); - - $cookieJar->set($cookie = new Cookie('foo', 'bar', time() - 86400)); - $this->assertNull($cookieJar->get('foo'), '->get() returns null if the cookie is expired'); - } - - public function testExpire() - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie = new Cookie('foo', 'bar')); - $cookieJar->expire('foo'); - $this->assertNull($cookieJar->get('foo'), '->get() returns null if the cookie is expired'); - } - - public function testAll() - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie1 = new Cookie('foo', 'bar')); - $cookieJar->set($cookie2 = new Cookie('bar', 'foo')); - - $this->assertEquals(array($cookie1, $cookie2), $cookieJar->all(), '->all() returns all cookies in the jar'); - } - - public function testClear() - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie1 = new Cookie('foo', 'bar')); - $cookieJar->set($cookie2 = new Cookie('bar', 'foo')); - - $cookieJar->clear(); - - $this->assertEquals(array(), $cookieJar->all(), '->clear() expires all cookies'); - } - - public function testUpdateFromResponse() - { - $response = new Response('', 200, array('Set-Cookie' => 'foo=foo')); - - $cookieJar = new CookieJar(); - $cookieJar->updateFromResponse($response); - - $this->assertEquals('foo', $cookieJar->get('foo')->getValue(), '->updateFromResponse() updates cookies from a Response objects'); - } - - public function testUpdateFromSetCookie() - { - $setCookies = array('foo=foo'); - - $cookieJar = new CookieJar(); - $cookieJar->set(new Cookie('bar', 'bar')); - $cookieJar->updateFromSetCookie($setCookies); - - $this->assertInstanceOf('Symfony\Component\BrowserKit\Cookie', $cookieJar->get('foo')); - $this->assertInstanceOf('Symfony\Component\BrowserKit\Cookie', $cookieJar->get('bar')); - $this->assertEquals('foo', $cookieJar->get('foo')->getValue(), '->updateFromSetCookie() updates cookies from a Set-Cookie header'); - $this->assertEquals('bar', $cookieJar->get('bar')->getValue(), '->updateFromSetCookie() keeps existing cookies'); - } - - public function testUpdateFromSetCookieWithMultipleCookies() - { - $timestamp = time() + 3600; - $date = gmdate('D, d M Y H:i:s \G\M\T', $timestamp); - $setCookies = array(sprintf('foo=foo; expires=%s; domain=.symfony.com; path=/, bar=bar; domain=.blog.symfony.com, PHPSESSID=id; expires=%s', $date, $date)); - - $cookieJar = new CookieJar(); - $cookieJar->updateFromSetCookie($setCookies); - - $fooCookie = $cookieJar->get('foo', '/', '.symfony.com'); - $barCookie = $cookieJar->get('bar', '/', '.blog.symfony.com'); - $phpCookie = $cookieJar->get('PHPSESSID'); - - $this->assertInstanceOf('Symfony\Component\BrowserKit\Cookie', $fooCookie); - $this->assertInstanceOf('Symfony\Component\BrowserKit\Cookie', $barCookie); - $this->assertInstanceOf('Symfony\Component\BrowserKit\Cookie', $phpCookie); - $this->assertEquals('foo', $fooCookie->getValue()); - $this->assertEquals('bar', $barCookie->getValue()); - $this->assertEquals('id', $phpCookie->getValue()); - $this->assertEquals($timestamp, $fooCookie->getExpiresTime()); - $this->assertNull($barCookie->getExpiresTime()); - $this->assertEquals($timestamp, $phpCookie->getExpiresTime()); - } - - /** - * @dataProvider provideAllValuesValues - */ - public function testAllValues($uri, $values) - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie1 = new Cookie('foo_nothing', 'foo')); - $cookieJar->set($cookie2 = new Cookie('foo_expired', 'foo', time() - 86400)); - $cookieJar->set($cookie3 = new Cookie('foo_path', 'foo', null, '/foo')); - $cookieJar->set($cookie4 = new Cookie('foo_domain', 'foo', null, '/', '.example.com')); - $cookieJar->set($cookie4 = new Cookie('foo_strict_domain', 'foo', null, '/', '.www4.example.com')); - $cookieJar->set($cookie5 = new Cookie('foo_secure', 'foo', null, '/', '', true)); - - $this->assertEquals($values, array_keys($cookieJar->allValues($uri)), '->allValues() returns the cookie for a given URI'); - } - - public function provideAllValuesValues() - { - return array( - array('http://www.example.com', array('foo_nothing', 'foo_domain')), - array('http://www.example.com/', array('foo_nothing', 'foo_domain')), - array('http://foo.example.com/', array('foo_nothing', 'foo_domain')), - array('http://foo.example1.com/', array('foo_nothing')), - array('https://foo.example.com/', array('foo_nothing', 'foo_secure', 'foo_domain')), - array('http://www.example.com/foo/bar', array('foo_nothing', 'foo_path', 'foo_domain')), - array('http://www4.example.com/', array('foo_nothing', 'foo_domain', 'foo_strict_domain')), - ); - } - - public function testEncodedValues() - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie = new Cookie('foo', 'bar%3Dbaz', null, '/', '', false, true, true)); - - $this->assertEquals(array('foo' => 'bar=baz'), $cookieJar->allValues('/')); - $this->assertEquals(array('foo' => 'bar%3Dbaz'), $cookieJar->allRawValues('/')); - } - - public function testCookieExpireWithSameNameButDifferentPaths() - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie1 = new Cookie('foo', 'bar1', null, '/foo')); - $cookieJar->set($cookie2 = new Cookie('foo', 'bar2', null, '/bar')); - $cookieJar->expire('foo', '/foo'); - - $this->assertNull($cookieJar->get('foo'), '->get() returns null if the cookie is expired'); - $this->assertEquals(array(), array_keys($cookieJar->allValues('http://example.com/'))); - $this->assertEquals(array(), $cookieJar->allValues('http://example.com/foo')); - $this->assertEquals(array('foo' => 'bar2'), $cookieJar->allValues('http://example.com/bar')); - } - - public function testCookieExpireWithNullPaths() - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie1 = new Cookie('foo', 'bar1', null, '/')); - $cookieJar->expire('foo', null); - - $this->assertNull($cookieJar->get('foo'), '->get() returns null if the cookie is expired'); - $this->assertEquals(array(), array_keys($cookieJar->allValues('http://example.com/'))); - } - - public function testCookieWithSameNameButDifferentPaths() - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie1 = new Cookie('foo', 'bar1', null, '/foo')); - $cookieJar->set($cookie2 = new Cookie('foo', 'bar2', null, '/bar')); - - $this->assertEquals(array(), array_keys($cookieJar->allValues('http://example.com/'))); - $this->assertEquals(array('foo' => 'bar1'), $cookieJar->allValues('http://example.com/foo')); - $this->assertEquals(array('foo' => 'bar2'), $cookieJar->allValues('http://example.com/bar')); - } - - public function testCookieWithSameNameButDifferentDomains() - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie1 = new Cookie('foo', 'bar1', null, '/', 'foo.example.com')); - $cookieJar->set($cookie2 = new Cookie('foo', 'bar2', null, '/', 'bar.example.com')); - - $this->assertEquals(array(), array_keys($cookieJar->allValues('http://example.com/'))); - $this->assertEquals(array('foo' => 'bar1'), $cookieJar->allValues('http://foo.example.com/')); - $this->assertEquals(array('foo' => 'bar2'), $cookieJar->allValues('http://bar.example.com/')); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/CookieTest.php b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/CookieTest.php deleted file mode 100644 index 2db3ac6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/CookieTest.php +++ /dev/null @@ -1,174 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Tests\BrowserKit; - -use Symfony\Component\BrowserKit\Cookie; - -class CookieTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getTestsForToFromString - */ - public function testToFromString($cookie, $url = null) - { - $this->assertEquals($cookie, (string) Cookie::fromString($cookie, $url)); - } - - public function getTestsForToFromString() - { - return array( - array('foo=bar'), - array('foo=bar; path=/foo'), - array('foo=bar; domain=google.com'), - array('foo=bar; domain=example.com; secure', 'https://example.com/'), - array('foo=bar; httponly'), - array('foo=bar; domain=google.com; path=/foo; secure; httponly', 'https://google.com/'), - array('foo=bar=baz'), - array('foo=bar%3Dbaz'), - ); - } - - public function testFromStringIgnoreSecureFlag() - { - $this->assertFalse(Cookie::fromString('foo=bar; secure')->isSecure()); - $this->assertFalse(Cookie::fromString('foo=bar; secure', 'http://example.com/')->isSecure()); - } - - /** - * @dataProvider getExpireCookieStrings - */ - public function testFromStringAcceptsSeveralExpiresDateFormats($cookie) - { - $this->assertEquals(1596185377, Cookie::fromString($cookie)->getExpiresTime()); - } - - public function getExpireCookieStrings() - { - return array( - array('foo=bar; expires=Fri, 31-Jul-2020 08:49:37 GMT'), - array('foo=bar; expires=Fri, 31 Jul 2020 08:49:37 GMT'), - array('foo=bar; expires=Friday, 31-Jul-20 08:49:37 GMT'), - array('foo=bar; expires=Fri Jul 31 08:49:37 2020'), - array('foo=bar; expires=\'Fri Jul 31 08:49:37 2020\''), - ); - } - - public function testFromStringWithCapitalization() - { - $this->assertEquals('Foo=Bar', (string) Cookie::fromString('Foo=Bar')); - $this->assertEquals('foo=bar; expires=Fri, 31 Dec 2010 23:59:59 GMT', (string) Cookie::fromString('foo=bar; Expires=Fri, 31 Dec 2010 23:59:59 GMT')); - $this->assertEquals('foo=bar; domain=www.example.org; httponly', (string) Cookie::fromString('foo=bar; DOMAIN=www.example.org; HttpOnly')); - } - - public function testFromStringWithUrl() - { - $this->assertEquals('foo=bar; domain=www.example.com', (string) Cookie::FromString('foo=bar', 'http://www.example.com/')); - $this->assertEquals('foo=bar; domain=www.example.com; path=/foo', (string) Cookie::FromString('foo=bar', 'http://www.example.com/foo/bar')); - $this->assertEquals('foo=bar; domain=www.example.com', (string) Cookie::FromString('foo=bar; path=/', 'http://www.example.com/foo/bar')); - $this->assertEquals('foo=bar; domain=www.myotherexample.com', (string) Cookie::FromString('foo=bar; domain=www.myotherexample.com', 'http://www.example.com/')); - } - - public function testFromStringThrowsAnExceptionIfCookieIsNotValid() - { - $this->setExpectedException('InvalidArgumentException'); - Cookie::FromString('foo'); - } - - public function testFromStringThrowsAnExceptionIfCookieDateIsNotValid() - { - $this->setExpectedException('InvalidArgumentException'); - Cookie::FromString('foo=bar; expires=foo'); - } - - public function testFromStringThrowsAnExceptionIfUrlIsNotValid() - { - $this->setExpectedException('InvalidArgumentException'); - Cookie::FromString('foo=bar', 'foobar'); - } - - public function testGetName() - { - $cookie = new Cookie('foo', 'bar'); - $this->assertEquals('foo', $cookie->getName(), '->getName() returns the cookie name'); - } - - public function testGetValue() - { - $cookie = new Cookie('foo', 'bar'); - $this->assertEquals('bar', $cookie->getValue(), '->getValue() returns the cookie value'); - - $cookie = new Cookie('foo', 'bar%3Dbaz', null, '/', '', false, true, true); // raw value - $this->assertEquals('bar=baz', $cookie->getValue(), '->getValue() returns the urldecoded cookie value'); - } - - public function testGetRawValue() - { - $cookie = new Cookie('foo', 'bar=baz'); // decoded value - $this->assertEquals('bar%3Dbaz', $cookie->getRawValue(), '->getRawValue() returns the urlencoded cookie value'); - $cookie = new Cookie('foo', 'bar%3Dbaz', null, '/', '', false, true, true); // raw value - $this->assertEquals('bar%3Dbaz', $cookie->getRawValue(), '->getRawValue() returns the non-urldecoded cookie value'); - } - - public function testGetPath() - { - $cookie = new Cookie('foo', 'bar', 0); - $this->assertEquals('/', $cookie->getPath(), '->getPath() returns / is no path is defined'); - - $cookie = new Cookie('foo', 'bar', 0, '/foo'); - $this->assertEquals('/foo', $cookie->getPath(), '->getPath() returns the cookie path'); - } - - public function testGetDomain() - { - $cookie = new Cookie('foo', 'bar', 0, '/', 'foo.com'); - $this->assertEquals('foo.com', $cookie->getDomain(), '->getDomain() returns the cookie domain'); - } - - public function testIsSecure() - { - $cookie = new Cookie('foo', 'bar'); - $this->assertFalse($cookie->isSecure(), '->isSecure() returns false if not defined'); - - $cookie = new Cookie('foo', 'bar', 0, '/', 'foo.com', true); - $this->assertTrue($cookie->isSecure(), '->isSecure() returns the cookie secure flag'); - } - - public function testIsHttponly() - { - $cookie = new Cookie('foo', 'bar'); - $this->assertTrue($cookie->isHttpOnly(), '->isHttpOnly() returns false if not defined'); - - $cookie = new Cookie('foo', 'bar', 0, '/', 'foo.com', false, true); - $this->assertTrue($cookie->isHttpOnly(), '->isHttpOnly() returns the cookie httponly flag'); - } - - public function testGetExpiresTime() - { - $cookie = new Cookie('foo', 'bar'); - $this->assertNull($cookie->getExpiresTime(), '->getExpiresTime() returns the expires time'); - - $cookie = new Cookie('foo', 'bar', $time = time() - 86400); - $this->assertEquals($time, $cookie->getExpiresTime(), '->getExpiresTime() returns the expires time'); - } - - public function testIsExpired() - { - $cookie = new Cookie('foo', 'bar'); - $this->assertFalse($cookie->isExpired(), '->isExpired() returns false when the cookie never expires (null as expires time)'); - - $cookie = new Cookie('foo', 'bar', time() - 86400); - $this->assertTrue($cookie->isExpired(), '->isExpired() returns true when the cookie is expired'); - - $cookie = new Cookie('foo', 'bar', 0); - $this->assertFalse($cookie->isExpired()); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/HistoryTest.php b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/HistoryTest.php deleted file mode 100644 index 6794f31..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/HistoryTest.php +++ /dev/null @@ -1,101 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Tests\BrowserKit; - -use Symfony\Component\BrowserKit\History; -use Symfony\Component\BrowserKit\Request; - -class HistoryTest extends \PHPUnit_Framework_TestCase -{ - public function testAdd() - { - $history = new History(); - $history->add(new Request('http://www.example1.com/', 'get')); - $this->assertSame('http://www.example1.com/', $history->current()->getUri(), '->add() adds a request to the history'); - - $history->add(new Request('http://www.example2.com/', 'get')); - $this->assertSame('http://www.example2.com/', $history->current()->getUri(), '->add() adds a request to the history'); - - $history->add(new Request('http://www.example3.com/', 'get')); - $history->back(); - $history->add(new Request('http://www.example4.com/', 'get')); - $this->assertSame('http://www.example4.com/', $history->current()->getUri(), '->add() adds a request to the history'); - - $history->back(); - $this->assertSame('http://www.example2.com/', $history->current()->getUri(), '->add() adds a request to the history'); - } - - public function testClearIsEmpty() - { - $history = new History(); - $history->add(new Request('http://www.example.com/', 'get')); - - $this->assertFalse($history->isEmpty(), '->isEmpty() returns false if the history is not empty'); - - $history->clear(); - - $this->assertTrue($history->isEmpty(), '->isEmpty() true if the history is empty'); - } - - public function testCurrent() - { - $history = new History(); - - try { - $history->current(); - $this->fail('->current() throws a \LogicException if the history is empty'); - } catch (\Exception $e) { - $this->assertInstanceof('LogicException', $e, '->current() throws a \LogicException if the history is empty'); - } - - $history->add(new Request('http://www.example.com/', 'get')); - - $this->assertSame('http://www.example.com/', $history->current()->getUri(), '->current() returns the current request in the history'); - } - - public function testBack() - { - $history = new History(); - $history->add(new Request('http://www.example.com/', 'get')); - - try { - $history->back(); - $this->fail('->back() throws a \LogicException if the history is already on the first page'); - } catch (\Exception $e) { - $this->assertInstanceof('LogicException', $e, '->current() throws a \LogicException if the history is already on the first page'); - } - - $history->add(new Request('http://www.example1.com/', 'get')); - $history->back(); - - $this->assertSame('http://www.example.com/', $history->current()->getUri(), '->back() returns the previous request in the history'); - } - - public function testForward() - { - $history = new History(); - $history->add(new Request('http://www.example.com/', 'get')); - $history->add(new Request('http://www.example1.com/', 'get')); - - try { - $history->forward(); - $this->fail('->forward() throws a \LogicException if the history is already on the last page'); - } catch (\Exception $e) { - $this->assertInstanceof('LogicException', $e, '->forward() throws a \LogicException if the history is already on the last page'); - } - - $history->back(); - $history->forward(); - - $this->assertSame('http://www.example1.com/', $history->current()->getUri(), '->forward() returns the next request in the history'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/RequestTest.php b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/RequestTest.php deleted file mode 100644 index c567fad..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/RequestTest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Tests\BrowserKit; - -use Symfony\Component\BrowserKit\Request; - -class RequestTest extends \PHPUnit_Framework_TestCase -{ - public function testGetUri() - { - $request = new Request('http://www.example.com/', 'get'); - $this->assertEquals('http://www.example.com/', $request->getUri(), '->getUri() returns the URI of the request'); - } - - public function testGetMethod() - { - $request = new Request('http://www.example.com/', 'get'); - $this->assertEquals('get', $request->getMethod(), '->getMethod() returns the method of the request'); - } - - public function testGetParameters() - { - $request = new Request('http://www.example.com/', 'get', array('foo' => 'bar')); - $this->assertEquals(array('foo' => 'bar'), $request->getParameters(), '->getParameters() returns the parameters of the request'); - } - - public function testGetFiles() - { - $request = new Request('http://www.example.com/', 'get', array(), array('foo' => 'bar')); - $this->assertEquals(array('foo' => 'bar'), $request->getFiles(), '->getFiles() returns the uploaded files of the request'); - } - - public function testGetCookies() - { - $request = new Request('http://www.example.com/', 'get', array(), array(), array('foo' => 'bar')); - $this->assertEquals(array('foo' => 'bar'), $request->getCookies(), '->getCookies() returns the cookies of the request'); - } - - public function testGetServer() - { - $request = new Request('http://www.example.com/', 'get', array(), array(), array(), array('foo' => 'bar')); - $this->assertEquals(array('foo' => 'bar'), $request->getServer(), '->getServer() returns the server parameters of the request'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/ResponseTest.php b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/ResponseTest.php deleted file mode 100644 index 1e8c638..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/ResponseTest.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Tests\BrowserKit; - -use Symfony\Component\BrowserKit\Response; - -class ResponseTest extends \PHPUnit_Framework_TestCase -{ - public function testGetUri() - { - $response = new Response('foo'); - $this->assertEquals('foo', $response->getContent(), '->getContent() returns the content of the response'); - } - - public function testGetStatus() - { - $response = new Response('foo', 304); - $this->assertEquals('304', $response->getStatus(), '->getStatus() returns the status of the response'); - } - - public function testGetHeaders() - { - $response = new Response('foo', 200, array('foo' => 'bar')); - $this->assertEquals(array('foo' => 'bar'), $response->getHeaders(), '->getHeaders() returns the headers of the response'); - } - - public function testGetHeader() - { - $response = new Response('foo', 200, array( - 'Content-Type' => 'text/html', - 'Set-Cookie' => array('foo=bar', 'bar=foo'), - )); - - $this->assertEquals('text/html', $response->getHeader('Content-Type'), '->getHeader() returns a header of the response'); - $this->assertEquals('text/html', $response->getHeader('content-type'), '->getHeader() returns a header of the response'); - $this->assertEquals('text/html', $response->getHeader('content_type'), '->getHeader() returns a header of the response'); - $this->assertEquals('foo=bar', $response->getHeader('Set-Cookie'), '->getHeader() returns the first header value'); - $this->assertEquals(array('foo=bar', 'bar=foo'), $response->getHeader('Set-Cookie', false), '->getHeader() returns all header values if first is false'); - - $this->assertNull($response->getHeader('foo'), '->getHeader() returns null if the header is not defined'); - $this->assertEquals(array(), $response->getHeader('foo', false), '->getHeader() returns an empty array if the header is not defined and first is set to false'); - } - - public function testMagicToString() - { - $response = new Response('foo', 304, array('foo' => 'bar')); - - $this->assertEquals("foo: bar\n\nfoo", $response->__toString(), '->__toString() returns the headers and the content as a string'); - } - - public function testMagicToStringWithMultipleSetCookieHeader() - { - $headers = array( - 'content-type' => 'text/html; charset=utf-8', - 'set-cookie' => array('foo=bar', 'bar=foo') - ); - - $expected = 'content-type: text/html; charset=utf-8'."\n"; - $expected.= 'set-cookie: foo=bar'."\n"; - $expected.= 'set-cookie: bar=foo'."\n\n"; - $expected.= 'foo'; - - $response = new Response('foo', 304, $headers); - - $this->assertEquals($expected, $response->__toString(), '->__toString() returns the headers and the content as a string'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/bootstrap.php b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/bootstrap.php deleted file mode 100644 index 1b326ff..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/bootstrap.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -spl_autoload_register(function ($class) { - if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\BrowserKit')) { - if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\BrowserKit')).'.php')) { - require_once $file; - } - } -}); - -if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) { - require_once $loader; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/composer.json b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/composer.json deleted file mode 100644 index c5f208a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "symfony/browser-kit", - "type": "library", - "description": "Symfony BrowserKit Component", - "keywords": [], - "homepage": "http://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "require": { - "php": ">=5.3.3", - "symfony/dom-crawler": "2.1.*" - }, - "require-dev": { - "symfony/process": "2.1.*", - "symfony/css-selector": "2.1.*" - }, - "suggest": { - "symfony/process": "self.version" - }, - "autoload": { - "psr-0": { "Symfony\\Component\\BrowserKit": "" } - }, - "target-dir": "Symfony/Component/BrowserKit", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/phpunit.xml.dist b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/phpunit.xml.dist deleted file mode 100644 index 0ddabed..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/phpunit.xml.dist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - ./Tests/ - - - - - - ./ - - ./Resources - ./Tests - ./vendor - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/.gitignore b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/.gitignore deleted file mode 100644 index d1502b0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -vendor/ -composer.lock diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ApcClassLoader.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ApcClassLoader.php deleted file mode 100644 index 0c99e6a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ApcClassLoader.php +++ /dev/null @@ -1,118 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader; - -/** - * ApcClassLoader implements a wrapping autoloader cached in APC for PHP 5.3. - * - * It expects an object implementing a findFile method to find the file. This - * allow using it as a wrapper around the other loaders of the component (the - * ClassLoader and the UniversalClassLoader for instance) but also around any - * other autoloader following this convention (the Composer one for instance) - * - * $loader = new ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * $cachedLoader = new ApcClassLoader('my_prefix', $loader); - * - * // activate the cached autoloader - * $cachedLoader->register(); - * - * // eventually deactivate the non-cached loader if it was registered previously - * // to be sure to use the cached one. - * $loader->unregister(); - * - * @author Fabien Potencier - * @author Kris Wallsmith - * - * @api - */ -class ApcClassLoader -{ - private $prefix; - private $classFinder; - - /** - * Constructor. - * - * @param string $prefix A prefix to create a namespace in APC - * @param object $classFinder An object that implements findFile() method. - * - * @api - */ - public function __construct($prefix, $classFinder) - { - if (!extension_loaded('apc')) { - throw new \RuntimeException('Unable to use ApcClassLoader as APC is not enabled.'); - } - - if (!method_exists($classFinder, 'findFile')) { - throw new \InvalidArgumentException('The class finder must implement a "findFile" method.'); - } - - $this->prefix = $prefix; - $this->classFinder = $classFinder; - } - - /** - * Registers this instance as an autoloader. - * - * @param Boolean $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * - * @return Boolean|null True, if loaded - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - require $file; - - return true; - } - } - - /** - * Finds a file by class name while caching lookups to APC. - * - * @param string $class A class name to resolve to file - * - * @return string|null - */ - public function findFile($class) - { - if (false === $file = apc_fetch($this->prefix.$class)) { - apc_store($this->prefix.$class, $file = $this->classFinder->findFile($class)); - } - - return $file; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php deleted file mode 100644 index 379fbe4..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader; - -/** - * ApcUniversalClassLoader implements a "universal" autoloader cached in APC for PHP 5.3. - * - * It is able to load classes that use either: - * - * * The technical interoperability standards for PHP 5.3 namespaces and - * class names (https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md); - * - * * The PEAR naming convention for classes (http://pear.php.net/). - * - * Classes from a sub-namespace or a sub-hierarchy of PEAR classes can be - * looked for in a list of locations to ease the vendoring of a sub-set of - * classes for large projects. - * - * Example usage: - * - * require 'vendor/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php'; - * require 'vendor/symfony/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php'; - * - * use Symfony\Component\ClassLoader\ApcUniversalClassLoader; - * - * $loader = new ApcUniversalClassLoader('apc.prefix.'); - * - * // register classes with namespaces - * $loader->registerNamespaces(array( - * 'Symfony\Component' => __DIR__.'/component', - * 'Symfony' => __DIR__.'/framework', - * 'Sensio' => array(__DIR__.'/src', __DIR__.'/vendor'), - * )); - * - * // register a library using the PEAR naming convention - * $loader->registerPrefixes(array( - * 'Swift_' => __DIR__.'/Swift', - * )); - * - * // activate the autoloader - * $loader->register(); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * @author Fabien Potencier - * @author Kris Wallsmith - * - * @api - */ -class ApcUniversalClassLoader extends UniversalClassLoader -{ - private $prefix; - - /** - * Constructor. - * - * @param string $prefix A prefix to create a namespace in APC - * - * @api - */ - public function __construct($prefix) - { - if (!extension_loaded('apc')) { - throw new \RuntimeException('Unable to use ApcUniversalClassLoader as APC is not enabled.'); - } - - $this->prefix = $prefix; - } - - /** - * Finds a file by class name while caching lookups to APC. - * - * @param string $class A class name to resolve to file - * - * @return string|null The path, if found - */ - public function findFile($class) - { - if (false === $file = apc_fetch($this->prefix.$class)) { - apc_store($this->prefix.$class, $file = parent::findFile($class)); - } - - return $file; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/CHANGELOG.md b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/CHANGELOG.md deleted file mode 100644 index 694e713..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/CHANGELOG.md +++ /dev/null @@ -1,15 +0,0 @@ -CHANGELOG -========= - -2.1.0 ------ - - * added a DebugClassLoader able to wrap any autoloader providing a findFile - method - * added a new ApcClassLoader and XcacheClassLoader using composition to wrap - other loaders - * added a new ClassLoader which does not distinguish between namespaced and - pear-like classes (as the PEAR convention is a subset of PSR-0) and - supports using Composer's namespace maps - * added a class map generator - * added support for loading globally-installed PEAR packages diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php deleted file mode 100644 index 7f5bdd1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php +++ /dev/null @@ -1,320 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader; - -/** - * ClassCollectionLoader. - * - * @author Fabien Potencier - */ -class ClassCollectionLoader -{ - private static $loaded; - private static $seen; - - /** - * Loads a list of classes and caches them in one big file. - * - * @param array $classes An array of classes to load - * @param string $cacheDir A cache directory - * @param string $name The cache name prefix - * @param Boolean $autoReload Whether to flush the cache when the cache is stale or not - * @param Boolean $adaptive Whether to remove already declared classes or not - * @param string $extension File extension of the resulting file - * - * @throws \InvalidArgumentException When class can't be loaded - */ - public static function load($classes, $cacheDir, $name, $autoReload, $adaptive = false, $extension = '.php') - { - // each $name can only be loaded once per PHP process - if (isset(self::$loaded[$name])) { - return; - } - - self::$loaded[$name] = true; - - $declared = array_merge(get_declared_classes(), get_declared_interfaces()); - if (function_exists('get_declared_traits')) { - $declared = array_merge($declared, get_declared_traits()); - } - - if ($adaptive) { - // don't include already declared classes - $classes = array_diff($classes, $declared); - - // the cache is different depending on which classes are already declared - $name = $name.'-'.substr(md5(implode('|', $classes)), 0, 5); - } - - $classes = array_unique($classes); - - $cache = $cacheDir.'/'.$name.$extension; - - // auto-reload - $reload = false; - if ($autoReload) { - $metadata = $cacheDir.'/'.$name.$extension.'.meta'; - if (!is_file($metadata) || !is_file($cache)) { - $reload = true; - } else { - $time = filemtime($cache); - $meta = unserialize(file_get_contents($metadata)); - - sort($meta[1]); - sort($classes); - - if ($meta[1] != $classes) { - $reload = true; - } else { - foreach ($meta[0] as $resource) { - if (!is_file($resource) || filemtime($resource) > $time) { - $reload = true; - - break; - } - } - } - } - } - - if (!$reload && is_file($cache)) { - require_once $cache; - - return; - } - - $files = array(); - $content = ''; - foreach (self::getOrderedClasses($classes) as $class) { - if (in_array($class->getName(), $declared)) { - continue; - } - - $files[] = $class->getFileName(); - - $c = preg_replace(array('/^\s*<\?php/', '/\?>\s*$/'), '', file_get_contents($class->getFileName())); - - // add namespace declaration for global code - if (!$class->inNamespace()) { - $c = "\nnamespace\n{\n".self::stripComments($c)."\n}\n"; - } else { - $c = self::fixNamespaceDeclarations('getName()])) { - return array(); - } - - self::$seen[$class->getName()] = true; - - $classes = array($class); - $parent = $class; - while (($parent = $parent->getParentClass()) && $parent->isUserDefined() && !isset(self::$seen[$parent->getName()])) { - self::$seen[$parent->getName()] = true; - - array_unshift($classes, $parent); - } - - if (function_exists('get_declared_traits')) { - foreach ($classes as $c) { - foreach (self::getTraits($c) as $trait) { - self::$seen[$trait->getName()] = true; - - array_unshift($classes, $trait); - } - } - } - - return array_merge(self::getInterfaces($class), $classes); - } - - private static function getInterfaces(\ReflectionClass $class) - { - $classes = array(); - - foreach ($class->getInterfaces() as $interface) { - $classes = array_merge($classes, self::getInterfaces($interface)); - } - - if ($class->isUserDefined() && $class->isInterface() && !isset(self::$seen[$class->getName()])) { - self::$seen[$class->getName()] = true; - - $classes[] = $class; - } - - return $classes; - } - - private static function getTraits(\ReflectionClass $class) - { - $traits = $class->getTraits(); - $classes = array(); - while ($trait = array_pop($traits)) { - if ($trait->isUserDefined() && !isset(self::$seen[$trait->getName()])) { - $classes[] = $trait; - - $traits = array_merge($traits, $trait->getTraits()); - } - } - - return $classes; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassLoader.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassLoader.php deleted file mode 100644 index a2038a0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassLoader.php +++ /dev/null @@ -1,203 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader; - -/** - * ClassLoader implements an PSR-0 class loader - * - * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md - * - * $loader = new ClassLoader(); - * - * // register classes with namespaces - * $loader->addPrefix('Symfony\Component', __DIR__.'/component'); - * $loader->addPrefix('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (e.g. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * @author Fabien Potencier - * @author Jordi Boggiano - */ -class ClassLoader -{ - private $prefixes = array(); - private $fallbackDirs = array(); - private $useIncludePath = false; - - /** - * Returns prefixes. - * - * @return array - */ - public function getPrefixes() - { - return $this->prefixes; - } - - /** - * Returns fallback directories. - * - * @return array - */ - public function getFallbackDirs() - { - return $this->fallbackDirs; - } - - /** - * Adds prefixes. - * - * @param array $prefixes Prefixes to add - */ - public function addPrefixes(array $prefixes) - { - foreach ($prefixes as $prefix => $path) { - $this->addPrefix($prefix, $path); - } - } - - /** - * Registers a set of classes - * - * @param string $prefix The classes prefix - * @param array|string $paths The location(s) of the classes - */ - public function addPrefix($prefix, $paths) - { - if (!$prefix) { - foreach ((array) $paths as $path) { - $this->fallbackDirs[] = $path; - } - - return; - } - if (isset($this->prefixes[$prefix])) { - $this->prefixes[$prefix] = array_merge( - $this->prefixes[$prefix], - (array) $paths - ); - } else { - $this->prefixes[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include for class files. - * - * @param Boolean $useIncludePath - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return Boolean - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Registers this instance as an autoloader. - * - * @param Boolean $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * - * @return Boolean|null True, if loaded - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - require $file; - - return true; - } - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|null The path, if found - */ - public function findFile($class) - { - if ('\\' == $class[0]) { - $class = substr($class, 1); - } - - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)) . DIRECTORY_SEPARATOR; - $className = substr($class, $pos + 1); - } else { - // PEAR-like class name - $classPath = null; - $className = $class; - } - - $classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; - - foreach ($this->prefixes as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) { - return $dir . DIRECTORY_SEPARATOR . $classPath; - } - } - } - } - - foreach ($this->fallbackDirs as $dir) { - if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) { - return $dir . DIRECTORY_SEPARATOR . $classPath; - } - } - - if ($this->useIncludePath && $file = stream_resolve_include_path($classPath)) { - return $file; - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassMapGenerator.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassMapGenerator.php deleted file mode 100644 index b0e6580..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassMapGenerator.php +++ /dev/null @@ -1,133 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader; - -/** - * ClassMapGenerator - * - * @author Gyula Sallai - */ -class ClassMapGenerator -{ - /** - * Generate a class map file - * - * @param array|string $dirs Directories or a single path to search in - * @param string $file The name of the class map file - */ - public static function dump($dirs, $file) - { - $dirs = (array) $dirs; - $maps = array(); - - foreach ($dirs as $dir) { - $maps = array_merge($maps, static::createMap($dir)); - } - - file_put_contents($file, sprintf('isFile()) { - continue; - } - - $path = $file->getRealPath(); - - if (pathinfo($path, PATHINFO_EXTENSION) !== 'php') { - continue; - } - - $classes = self::findClasses($path); - - foreach ($classes as $class) { - $map[$class] = $path; - } - - } - - return $map; - } - - /** - * Extract the classes in the given file - * - * @param string $path The file to check - * - * @return array The found classes - */ - private static function findClasses($path) - { - $contents = file_get_contents($path); - $tokens = token_get_all($contents); - $T_TRAIT = version_compare(PHP_VERSION, '5.4', '<') ? -1 : T_TRAIT; - - $classes = array(); - - $namespace = ''; - for ($i = 0, $max = count($tokens); $i < $max; $i++) { - $token = $tokens[$i]; - - if (is_string($token)) { - continue; - } - - $class = ''; - - switch ($token[0]) { - case T_NAMESPACE: - $namespace = ''; - // If there is a namespace, extract it - while (($t = $tokens[++$i]) && is_array($t)) { - if (in_array($t[0], array(T_STRING, T_NS_SEPARATOR))) { - $namespace .= $t[1]; - } - } - $namespace .= '\\'; - break; - case T_CLASS: - case T_INTERFACE: - case $T_TRAIT: - // Find the classname - while (($t = $tokens[++$i]) && is_array($t)) { - if (T_STRING === $t[0]) { - $class .= $t[1]; - } elseif ($class !== '' && T_WHITESPACE == $t[0]) { - break; - } - } - - $classes[] = ltrim($namespace . $class, '\\'); - break; - default: - break; - } - } - - return $classes; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/DebugClassLoader.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/DebugClassLoader.php deleted file mode 100644 index dbfb5ab..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/DebugClassLoader.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader; - -/** - * Autoloader checking if the class is really defined in the file found. - * - * The DebugClassLoader will wrap all registered autoloaders providing a - * findFile method and will throw an exception if a file is found but does - * not declare the class. - * - * @author Fabien Potencier - * @author Christophe Coevoet - * - * @api - */ -class DebugClassLoader -{ - private $classFinder; - - /** - * Constructor. - * - * @param object $classFinder - * - * @api - */ - public function __construct($classFinder) - { - $this->classFinder = $classFinder; - } - - /** - * Replaces all autoloaders implementing a findFile method by a DebugClassLoader wrapper. - */ - public static function enable() - { - if (!is_array($functions = spl_autoload_functions())) { - return; - } - - foreach ($functions as $function) { - spl_autoload_unregister($function); - } - - foreach ($functions as $function) { - if (is_array($function) && method_exists($function[0], 'findFile')) { - $function = array(new static($function[0]), 'loadClass'); - } - - spl_autoload_register($function); - } - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * - * @return Boolean|null True, if loaded - */ - public function loadClass($class) - { - if ($file = $this->classFinder->findFile($class)) { - require $file; - - if (!class_exists($class, false) && !interface_exists($class, false) && (!function_exists('trait_exists') || !trait_exists($class, false))) { - throw new \RuntimeException(sprintf('The autoloader expected class "%s" to be defined in file "%s". The file was found but the class was not in it, the class name or namespace probably has a typo.', $class, $file)); - } - - return true; - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php deleted file mode 100644 index 96c6290..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader; - -/** - * Checks that the class is actually declared in the included file. - * - * @author Fabien Potencier - */ -class DebugUniversalClassLoader extends UniversalClassLoader -{ - /** - * Replaces all regular UniversalClassLoader instances by a DebugUniversalClassLoader ones. - */ - public static function enable() - { - if (!is_array($functions = spl_autoload_functions())) { - return; - } - - foreach ($functions as $function) { - spl_autoload_unregister($function); - } - - foreach ($functions as $function) { - if (is_array($function) && $function[0] instanceof UniversalClassLoader) { - $loader = new static(); - $loader->registerNamespaceFallbacks($function[0]->getNamespaceFallbacks()); - $loader->registerPrefixFallbacks($function[0]->getPrefixFallbacks()); - $loader->registerNamespaces($function[0]->getNamespaces()); - $loader->registerPrefixes($function[0]->getPrefixes()); - $loader->useIncludePath($function[0]->getUseIncludePath()); - - $function[0] = $loader; - } - - spl_autoload_register($function); - } - } - - /** - * {@inheritDoc} - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - require $file; - - if (!class_exists($class, false) && !interface_exists($class, false) && (!function_exists('trait_exists') || !trait_exists($class, false))) { - throw new \RuntimeException(sprintf('The autoloader expected class "%s" to be defined in file "%s". The file was found but the class was not in it, the class name or namespace probably has a typo.', $class, $file)); - } - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/LICENSE b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/LICENSE deleted file mode 100644 index cdffe7a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2012 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/MapClassLoader.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/MapClassLoader.php deleted file mode 100644 index cf17d42..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/MapClassLoader.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader; - -/** - * A class loader that uses a mapping file to look up paths. - * - * @author Fabien Potencier - */ -class MapClassLoader -{ - private $map = array(); - - /** - * Constructor. - * - * @param array $map A map where keys are classes and values the absolute file path - */ - public function __construct(array $map) - { - $this->map = $map; - } - - /** - * Registers this instance as an autoloader. - * - * @param Boolean $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - */ - public function loadClass($class) - { - if ('\\' === $class[0]) { - $class = substr($class, 1); - } - - if (isset($this->map[$class])) { - require $this->map[$class]; - } - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|null The path, if found - */ - public function findFile($class) - { - if ('\\' === $class[0]) { - $class = substr($class, 1); - } - - if (isset($this->map[$class])) { - return $this->map[$class]; - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/README.md b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/README.md deleted file mode 100644 index 64dffe9..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/README.md +++ /dev/null @@ -1,72 +0,0 @@ -ClassLoader Component -===================== - -ClassLoader loads your project classes automatically if they follow some -standard PHP conventions. - -The Universal ClassLoader is able to autoload classes that implement the PSR-0 -standard or the PEAR naming convention. - -First, register the autoloader: - - require_once __DIR__.'/src/Symfony/Component/ClassLoader/UniversalClassLoader.php'; - - use Symfony\Component\ClassLoader\UniversalClassLoader; - - $loader = new UniversalClassLoader(); - $loader->register(); - -Then, register some namespaces with the `registerNamespace()` method: - - $loader->registerNamespace('Symfony', __DIR__.'/src'); - $loader->registerNamespace('Monolog', __DIR__.'/vendor/monolog/src'); - -The `registerNamespace()` method takes a namespace prefix and a path where to -look for the classes as arguments. - -You can also register a sub-namespaces: - - $loader->registerNamespace('Doctrine\\Common', __DIR__.'/vendor/doctrine-common/lib'); - -The order of registration is significant and the first registered namespace -takes precedence over later registered one. - -You can also register more than one path for a given namespace: - - $loader->registerNamespace('Symfony', array(__DIR__.'/src', __DIR__.'/symfony/src')); - -Alternatively, you can use the `registerNamespaces()` method to register more -than one namespace at once: - - $loader->registerNamespaces(array( - 'Symfony' => array(__DIR__.'/src', __DIR__.'/symfony/src'), - 'Doctrine\\Common' => __DIR__.'/vendor/doctrine-common/lib', - 'Doctrine' => __DIR__.'/vendor/doctrine/lib', - 'Monolog' => __DIR__.'/vendor/monolog/src', - )); - -For better performance, you can use the APC based version of the universal -class loader: - - require_once __DIR__.'/src/Symfony/Component/ClassLoader/UniversalClassLoader.php'; - require_once __DIR__.'/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php'; - - use Symfony\Component\ClassLoader\ApcUniversalClassLoader; - - $loader = new ApcUniversalClassLoader('apc.prefix.'); - -Furthermore, the component provides tools to aggregate classes into a single -file, which is especially useful to improve performance on servers that do not -provide byte caches. - -Resources ---------- - -You can run the unit tests with the following command: - - phpunit - -If you also want to run the unit tests that depend on other Symfony -Components, install dev dependencies before running PHPUnit: - - php composer.phar install --dev diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/ApcUniversalClassLoaderTest.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/ApcUniversalClassLoaderTest.php deleted file mode 100644 index 9a7acfd..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/ApcUniversalClassLoaderTest.php +++ /dev/null @@ -1,192 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader\Tests; - -use Symfony\Component\ClassLoader\ApcUniversalClassLoader; - -class ApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!extension_loaded('apc')) { - $this->markTestSkipped('The apc extension is not available.'); - } - - if (!(ini_get('apc.enabled') && ini_get('apc.enable_cli'))) { - $this->markTestSkipped('The apc extension is available, but not enabled.'); - } else { - apc_clear_cache('user'); - } - } - - protected function tearDown() - { - if (ini_get('apc.enabled') && ini_get('apc.enable_cli')) { - apc_clear_cache('user'); - } - } - - public function testConstructor() - { - $loader = new ApcUniversalClassLoader('test.prefix.'); - $loader->registerNamespace('Apc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - - $this->assertEquals($loader->findFile('\Apc\Namespaced\FooBar'), apc_fetch('test.prefix.\Apc\Namespaced\FooBar'), '__construct() takes a prefix as its first argument'); - } - - /** - * @dataProvider getLoadClassTests - */ - public function testLoadClass($className, $testClassName, $message) - { - $loader = new ApcUniversalClassLoader('test.prefix.'); - $loader->registerNamespace('Apc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->registerPrefix('Apc_Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->loadClass($testClassName); - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassTests() - { - return array( - array('\\Apc\\Namespaced\\Foo', '\\Apc\\Namespaced\\Foo', '->loadClass() loads Apc\Namespaced\Foo class'), - array('Apc_Pearlike_Foo', 'Apc_Pearlike_Foo', '->loadClass() loads Apc_Pearlike_Foo class'), - array('\\Apc\\Namespaced\\Bar', '\\Apc\\Namespaced\\Bar', '->loadClass() loads Apc\Namespaced\Bar class with a leading slash'), - array('Apc_Pearlike_Bar', '\\Apc_Pearlike_Bar', '->loadClass() loads Apc_Pearlike_Bar class with a leading slash'), - ); - } - - /** - * @dataProvider getLoadClassFromFallbackTests - */ - public function testLoadClassFromFallback($className, $testClassName, $message) - { - $loader = new ApcUniversalClassLoader('test.prefix.fallback'); - $loader->registerNamespace('Apc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->registerPrefix('Apc_Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->registerNamespaceFallbacks(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/fallback')); - $loader->registerPrefixFallbacks(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/fallback')); - $loader->loadClass($testClassName); - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassFromFallbackTests() - { - return array( - array('\\Apc\\Namespaced\\Baz', '\\Apc\\Namespaced\\Baz', '->loadClass() loads Apc\Namespaced\Baz class'), - array('Apc_Pearlike_Baz', 'Apc_Pearlike_Baz', '->loadClass() loads Apc_Pearlike_Baz class'), - array('\\Apc\\Namespaced\\FooBar', '\\Apc\\Namespaced\\FooBar', '->loadClass() loads Apc\Namespaced\Baz class from fallback dir'), - array('Apc_Pearlike_FooBar', 'Apc_Pearlike_FooBar', '->loadClass() loads Apc_Pearlike_Baz class from fallback dir'), - ); - } - - /** - * @dataProvider getLoadClassNamespaceCollisionTests - */ - public function testLoadClassNamespaceCollision($namespaces, $className, $message) - { - $loader = new ApcUniversalClassLoader('test.prefix.collision.'); - $loader->registerNamespaces($namespaces); - - $loader->loadClass($className); - - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassNamespaceCollisionTests() - { - return array( - array( - array( - 'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha', - 'Apc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta', - ), - '\Apc\NamespaceCollision\A\Foo', - '->loadClass() loads NamespaceCollision\A\Foo from alpha.', - ), - array( - array( - 'Apc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta', - 'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha', - ), - '\Apc\NamespaceCollision\A\Bar', - '->loadClass() loads NamespaceCollision\A\Bar from alpha.', - ), - array( - array( - 'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha', - 'Apc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta', - ), - '\Apc\NamespaceCollision\A\B\Foo', - '->loadClass() loads NamespaceCollision\A\B\Foo from beta.', - ), - array( - array( - 'Apc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta', - 'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha', - ), - '\Apc\NamespaceCollision\A\B\Bar', - '->loadClass() loads NamespaceCollision\A\B\Bar from beta.', - ), - ); - } - - /** - * @dataProvider getLoadClassPrefixCollisionTests - */ - public function testLoadClassPrefixCollision($prefixes, $className, $message) - { - $loader = new ApcUniversalClassLoader('test.prefix.collision.'); - $loader->registerPrefixes($prefixes); - - $loader->loadClass($className); - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassPrefixCollisionTests() - { - return array( - array( - array( - 'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc', - 'ApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc', - ), - 'ApcPrefixCollision_A_Foo', - '->loadClass() loads ApcPrefixCollision_A_Foo from alpha.', - ), - array( - array( - 'ApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc', - 'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc', - ), - 'ApcPrefixCollision_A_Bar', - '->loadClass() loads ApcPrefixCollision_A_Bar from alpha.', - ), - array( - array( - 'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc', - 'ApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc', - ), - 'ApcPrefixCollision_A_B_Foo', - '->loadClass() loads ApcPrefixCollision_A_B_Foo from beta.', - ), - array( - array( - 'ApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc', - 'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc', - ), - 'ApcPrefixCollision_A_B_Bar', - '->loadClass() loads ApcPrefixCollision_A_B_Bar from beta.', - ), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php deleted file mode 100644 index 90eca1d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php +++ /dev/null @@ -1,176 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader\Tests; - -use Symfony\Component\ClassLoader\ClassCollectionLoader; - -require_once __DIR__.'/Fixtures/ClassesWithParents/GInterface.php'; -require_once __DIR__.'/Fixtures/ClassesWithParents/CInterface.php'; -require_once __DIR__.'/Fixtures/ClassesWithParents/B.php'; -require_once __DIR__.'/Fixtures/ClassesWithParents/A.php'; - -class ClassCollectionLoaderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getDifferentOrders - */ - public function testClassReordering(array $classes) - { - $expected = array( - 'ClassesWithParents\\GInterface', - 'ClassesWithParents\\CInterface', - 'ClassesWithParents\\B', - 'ClassesWithParents\\A', - ); - - $r = new \ReflectionClass('Symfony\Component\ClassLoader\ClassCollectionLoader'); - $m = $r->getMethod('getOrderedClasses'); - $m->setAccessible(true); - - $ordered = $m->invoke('Symfony\Component\ClassLoader\ClassCollectionLoader', $classes); - - $this->assertEquals($expected, array_map(function ($class) { return $class->getName(); }, $ordered)); - } - - public function getDifferentOrders() - { - return array( - array(array( - 'ClassesWithParents\\A', - 'ClassesWithParents\\CInterface', - 'ClassesWithParents\\GInterface', - 'ClassesWithParents\\B', - )), - array(array( - 'ClassesWithParents\\B', - 'ClassesWithParents\\A', - 'ClassesWithParents\\CInterface', - )), - array(array( - 'ClassesWithParents\\CInterface', - 'ClassesWithParents\\B', - 'ClassesWithParents\\A', - )), - array(array( - 'ClassesWithParents\\A', - )), - ); - } - - /** - * @dataProvider getDifferentOrdersForTraits - */ - public function testClassWithTraitsReordering(array $classes) - { - if (version_compare(phpversion(), '5.4.0', '<')) { - $this->markTestSkipped('Requires PHP > 5.4.0.'); - - return; - } - - require_once __DIR__.'/Fixtures/ClassesWithParents/ATrait.php'; - require_once __DIR__.'/Fixtures/ClassesWithParents/BTrait.php'; - require_once __DIR__.'/Fixtures/ClassesWithParents/CTrait.php'; - require_once __DIR__.'/Fixtures/ClassesWithParents/D.php'; - require_once __DIR__.'/Fixtures/ClassesWithParents/E.php'; - - $expected = array( - 'ClassesWithParents\\GInterface', - 'ClassesWithParents\\CInterface', - 'ClassesWithParents\\CTrait', - 'ClassesWithParents\\ATrait', - 'ClassesWithParents\\BTrait', - 'ClassesWithParents\\B', - 'ClassesWithParents\\A', - 'ClassesWithParents\\D', - 'ClassesWithParents\\E', - ); - - $r = new \ReflectionClass('Symfony\Component\ClassLoader\ClassCollectionLoader'); - $m = $r->getMethod('getOrderedClasses'); - $m->setAccessible(true); - - $ordered = $m->invoke('Symfony\Component\ClassLoader\ClassCollectionLoader', $classes); - - $this->assertEquals($expected, array_map(function ($class) { return $class->getName(); }, $ordered)); - } - - public function getDifferentOrdersForTraits() - { - return array( - array(array( - 'ClassesWithParents\\E', - 'ClassesWithParents\\ATrait', - )), - array(array( - 'ClassesWithParents\\E', - )), - ); - } - - public function testFixNamespaceDeclarations() - { - $source = <<assertEquals($expected, ClassCollectionLoader::fixNamespaceDeclarations($source)); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testUnableToLoadClassException() - { - ClassCollectionLoader::load(array('SomeNotExistingClass'), '', 'foo', false); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/ClassLoaderTest.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/ClassLoaderTest.php deleted file mode 100644 index c9fe382..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/ClassLoaderTest.php +++ /dev/null @@ -1,163 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader\Tests; - -use Symfony\Component\ClassLoader\ClassLoader; - -class ClassLoaderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getLoadClassTests - */ - public function testLoadClass($className, $testClassName, $message) - { - $loader = new ClassLoader(); - $loader->addPrefix('Namespaced2\\', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->addPrefix('Pearlike2_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->loadClass($testClassName); - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassTests() - { - return array( - array('\\Namespaced2\\Foo', 'Namespaced2\\Foo', '->loadClass() loads Namespaced2\Foo class'), - array('\\Pearlike2_Foo', 'Pearlike2_Foo', '->loadClass() loads Pearlike2_Foo class'), - array('\\Namespaced2\\Bar', '\\Namespaced2\\Bar', '->loadClass() loads Namespaced2\Bar class with a leading slash'), - array('\\Pearlike2_Bar', '\\Pearlike2_Bar', '->loadClass() loads Pearlike2_Bar class with a leading slash'), - ); - } - - public function testUseIncludePath() - { - $loader = new ClassLoader(); - $this->assertFalse($loader->getUseIncludePath()); - - $this->assertNull($loader->findFile('Foo')); - - $includePath = get_include_path(); - - $loader->setUseIncludePath(true); - $this->assertTrue($loader->getUseIncludePath()); - - set_include_path(__DIR__.'/Fixtures/includepath' . PATH_SEPARATOR . $includePath); - - $this->assertEquals(__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'includepath'.DIRECTORY_SEPARATOR.'Foo.php', $loader->findFile('Foo')); - - set_include_path($includePath); - } - - /** - * @dataProvider getLoadClassFromFallbackTests - */ - public function testLoadClassFromFallback($className, $testClassName, $message) - { - $loader = new ClassLoader(); - $loader->addPrefix('Namespaced2\\', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->addPrefix('Pearlike2_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->addPrefix('', array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/fallback')); - $loader->loadClass($testClassName); - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassFromFallbackTests() - { - return array( - array('\\Namespaced2\\Baz', 'Namespaced2\\Baz', '->loadClass() loads Namespaced2\Baz class'), - array('\\Pearlike2_Baz', 'Pearlike2_Baz', '->loadClass() loads Pearlike2_Baz class'), - array('\\Namespaced2\\FooBar', 'Namespaced2\\FooBar', '->loadClass() loads Namespaced2\Baz class from fallback dir'), - array('\\Pearlike2_FooBar', 'Pearlike2_FooBar', '->loadClass() loads Pearlike2_Baz class from fallback dir'), - ); - } - - /** - * @dataProvider getLoadClassNamespaceCollisionTests - */ - public function testLoadClassNamespaceCollision($namespaces, $className, $message) - { - $loader = new ClassLoader(); - $loader->addPrefixes($namespaces); - - $loader->loadClass($className); - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassNamespaceCollisionTests() - { - return array( - array( - array( - 'NamespaceCollision\\C' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - 'NamespaceCollision\\C\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - ), - 'NamespaceCollision\C\Foo', - '->loadClass() loads NamespaceCollision\C\Foo from alpha.', - ), - array( - array( - 'NamespaceCollision\\C\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - 'NamespaceCollision\\C' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - ), - 'NamespaceCollision\C\Bar', - '->loadClass() loads NamespaceCollision\C\Bar from alpha.', - ), - array( - array( - 'NamespaceCollision\\C' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - 'NamespaceCollision\\C\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - ), - 'NamespaceCollision\C\B\Foo', - '->loadClass() loads NamespaceCollision\C\B\Foo from beta.', - ), - array( - array( - 'NamespaceCollision\\C\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - 'NamespaceCollision\\C' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - ), - 'NamespaceCollision\C\B\Bar', - '->loadClass() loads NamespaceCollision\C\B\Bar from beta.', - ), - array( - array( - 'PrefixCollision_C_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - 'PrefixCollision_C_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - ), - 'PrefixCollision_C_Foo', - '->loadClass() loads PrefixCollision_C_Foo from alpha.', - ), - array( - array( - 'PrefixCollision_C_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - 'PrefixCollision_C_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - ), - 'PrefixCollision_C_Bar', - '->loadClass() loads PrefixCollision_C_Bar from alpha.', - ), - array( - array( - 'PrefixCollision_C_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - 'PrefixCollision_C_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - ), - 'PrefixCollision_C_B_Foo', - '->loadClass() loads PrefixCollision_C_B_Foo from beta.', - ), - array( - array( - 'PrefixCollision_C_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - 'PrefixCollision_C_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - ), - 'PrefixCollision_C_B_Bar', - '->loadClass() loads PrefixCollision_C_B_Bar from beta.', - ), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php deleted file mode 100644 index 6cebd38..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php +++ /dev/null @@ -1,102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader\Tests; - -use Symfony\Component\ClassLoader\ClassMapGenerator; - -class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase -{ - - /** - * @dataProvider getTestCreateMapTests - */ - public function testCreateMap($directory, $expected) - { - $this->assertEqualsNormalized($expected, ClassMapGenerator::createMap($directory)); - } - - public function getTestCreateMapTests() - { - $data = array( - array(__DIR__.'/Fixtures/Namespaced', array( - 'Namespaced\\Bar' => realpath(__DIR__).'/Fixtures/Namespaced/Bar.php', - 'Namespaced\\Foo' => realpath(__DIR__).'/Fixtures/Namespaced/Foo.php', - 'Namespaced\\Baz' => realpath(__DIR__).'/Fixtures/Namespaced/Baz.php', - ) - ), - array(__DIR__.'/Fixtures/beta/NamespaceCollision', array( - 'NamespaceCollision\\A\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Bar.php', - 'NamespaceCollision\\A\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Foo.php', - 'NamespaceCollision\\C\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Bar.php', - 'NamespaceCollision\\C\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Foo.php', - )), - array(__DIR__.'/Fixtures/Pearlike', array( - 'Pearlike_Foo' => realpath(__DIR__).'/Fixtures/Pearlike/Foo.php', - 'Pearlike_Bar' => realpath(__DIR__).'/Fixtures/Pearlike/Bar.php', - 'Pearlike_Baz' => realpath(__DIR__).'/Fixtures/Pearlike/Baz.php', - )), - array(__DIR__.'/Fixtures/classmap', array( - 'Foo\\Bar\\A' => realpath(__DIR__).'/Fixtures/classmap/sameNsMultipleClasses.php', - 'Foo\\Bar\\B' => realpath(__DIR__).'/Fixtures/classmap/sameNsMultipleClasses.php', - 'A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php', - 'Alpha\\A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php', - 'Alpha\\B' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php', - 'Beta\\A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php', - 'Beta\\B' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php', - 'ClassMap\\SomeInterface' => realpath(__DIR__).'/Fixtures/classmap/SomeInterface.php', - 'ClassMap\\SomeParent' => realpath(__DIR__).'/Fixtures/classmap/SomeParent.php', - 'ClassMap\\SomeClass' => realpath(__DIR__).'/Fixtures/classmap/SomeClass.php', - )), - ); - - if (version_compare(PHP_VERSION, '5.4', '>=')) { - $data[] = array(__DIR__.'/Fixtures/php5.4', array( - 'TFoo' => __DIR__.'/Fixtures/php5.4/traits.php', - 'CFoo' => __DIR__.'/Fixtures/php5.4/traits.php', - 'Foo\\TBar' => __DIR__.'/Fixtures/php5.4/traits.php', - 'Foo\\IBar' => __DIR__.'/Fixtures/php5.4/traits.php', - 'Foo\\TFooBar' => __DIR__.'/Fixtures/php5.4/traits.php', - 'Foo\\CBar' => __DIR__.'/Fixtures/php5.4/traits.php', - )); - } - - return $data; - } - - public function testCreateMapFinderSupport() - { - if (!class_exists('Symfony\\Component\\Finder\\Finder')) { - $this->markTestSkipped('Finder component is not available'); - } - - $finder = new \Symfony\Component\Finder\Finder(); - $finder->files()->in(__DIR__ . '/Fixtures/beta/NamespaceCollision'); - - $this->assertEqualsNormalized(array( - 'NamespaceCollision\\A\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Bar.php', - 'NamespaceCollision\\A\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Foo.php', - 'NamespaceCollision\\C\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Bar.php', - 'NamespaceCollision\\C\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Foo.php', - ), ClassMapGenerator::createMap($finder)); - } - - protected function assertEqualsNormalized($expected, $actual, $message = null) - { - foreach ($expected as $ns => $path) { - $expected[$ns] = strtr($path, '\\', '/'); - } - foreach ($actual as $ns => $path) { - $actual[$ns] = strtr($path, '\\', '/'); - } - $this->assertEquals($expected, $actual, $message); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Bar.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Bar.php deleted file mode 100644 index 4259f14..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Bar.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Apc\Namespaced; - -class Bar -{ - public static $loaded = true; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Baz.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Baz.php deleted file mode 100644 index 3ddb595..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Baz.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Apc\Namespaced; - -class Baz -{ - public static $loaded = true; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Foo.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Foo.php deleted file mode 100644 index cf0a4b7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/Foo.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Apc\Namespaced; - -class Foo -{ - public static $loaded = true; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/FooBar.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/FooBar.php deleted file mode 100644 index bbbc815..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Namespaced/FooBar.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Apc\Namespaced; - -class FooBar -{ - public static $loaded = true; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Bar.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Bar.php deleted file mode 100644 index e774cb9..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/Pearlike/Bar.php +++ /dev/null @@ -1,6 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Apc\NamespaceCollision\A; - -class Bar -{ - public static $loaded = true; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Foo.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Foo.php deleted file mode 100644 index 184a1b1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Foo.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Apc\NamespaceCollision\A; - -class Foo -{ - public static $loaded = true; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Bar.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Bar.php deleted file mode 100644 index 3892f70..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Bar.php +++ /dev/null @@ -1,6 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Apc\NamespaceCollision\A\B; - -class Bar -{ - public static $loaded = true; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Foo.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Foo.php deleted file mode 100644 index 450eeb5..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Foo.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Apc\NamespaceCollision\A\B; - -class Foo -{ - public static $loaded = true; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/fallback/Apc/Pearlike/FooBar.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/fallback/Apc/Pearlike/FooBar.php deleted file mode 100644 index 96f2f76..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/fallback/Apc/Pearlike/FooBar.php +++ /dev/null @@ -1,6 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Apc\Namespaced; - -class FooBar -{ - public static $loaded = true; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/A.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/A.php deleted file mode 100644 index dff891d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/A.php +++ /dev/null @@ -1,5 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Namespaced; - -class Bar -{ - public static $loaded = true; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Baz.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Baz.php deleted file mode 100644 index 0b0bbd0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Baz.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Namespaced; - -class Baz -{ - public static $loaded = true; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Foo.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Foo.php deleted file mode 100644 index df5e1f4..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced/Foo.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Namespaced; - -class Foo -{ - public static $loaded = true; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Bar.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Bar.php deleted file mode 100644 index 7bf42ab..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/Namespaced2/Bar.php +++ /dev/null @@ -1,8 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace NamespaceCollision\A; - -class Bar -{ - public static $loaded = true; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/A/Foo.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/A/Foo.php deleted file mode 100644 index aee6a08..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/A/Foo.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace NamespaceCollision\A; - -class Foo -{ - public static $loaded = true; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/C/Bar.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/C/Bar.php deleted file mode 100644 index c1b8dd6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/alpha/NamespaceCollision/C/Bar.php +++ /dev/null @@ -1,8 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace NamespaceCollision\A\B; - -class Bar -{ - public static $loaded = true; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/A/B/Foo.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/A/B/Foo.php deleted file mode 100644 index f5f2d72..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/A/B/Foo.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace NamespaceCollision\A\B; - -class Foo -{ - public static $loaded = true; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/C/B/Bar.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/C/B/Bar.php deleted file mode 100644 index 4bb03dc..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/beta/NamespaceCollision/C/B/Bar.php +++ /dev/null @@ -1,8 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace ClassMap; - -class SomeClass extends SomeParent implements SomeInterface -{ - -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeInterface.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeInterface.php deleted file mode 100644 index 09d7a8f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeInterface.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace ClassMap; - -interface SomeInterface -{ - -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeParent.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeParent.php deleted file mode 100644 index 5a859a9..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeParent.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace ClassMap; - -abstract class SomeParent -{ - -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/multipleNs.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/multipleNs.php deleted file mode 100644 index d19e07f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/multipleNs.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Foo\Bar; - -class A {} -class B {} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Namespaced/FooBar.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Namespaced/FooBar.php deleted file mode 100644 index 0fd29ef..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Namespaced/FooBar.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Namespaced; - -class FooBar -{ - public static $loaded = true; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Namespaced2/FooBar.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Namespaced2/FooBar.php deleted file mode 100644 index 1036d43..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/Fixtures/fallback/Namespaced2/FooBar.php +++ /dev/null @@ -1,8 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader\Tests; - -use Symfony\Component\ClassLoader\UniversalClassLoader; - -class UniversalClassLoaderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getLoadClassTests - */ - public function testLoadClass($className, $testClassName, $message) - { - $loader = new UniversalClassLoader(); - $loader->registerNamespace('Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->registerPrefix('Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->loadClass($testClassName); - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassTests() - { - return array( - array('\\Namespaced\\Foo', 'Namespaced\\Foo', '->loadClass() loads Namespaced\Foo class'), - array('\\Pearlike_Foo', 'Pearlike_Foo', '->loadClass() loads Pearlike_Foo class'), - array('\\Namespaced\\Bar', '\\Namespaced\\Bar', '->loadClass() loads Namespaced\Bar class with a leading slash'), - array('\\Pearlike_Bar', '\\Pearlike_Bar', '->loadClass() loads Pearlike_Bar class with a leading slash'), - ); - } - - public function testUseIncludePath() - { - $loader = new UniversalClassLoader(); - $this->assertFalse($loader->getUseIncludePath()); - - $this->assertNull($loader->findFile('Foo')); - - $includePath = get_include_path(); - - $loader->useIncludePath(true); - $this->assertTrue($loader->getUseIncludePath()); - - set_include_path(__DIR__.'/Fixtures/includepath' . PATH_SEPARATOR . $includePath); - - $this->assertEquals(__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'includepath'.DIRECTORY_SEPARATOR.'Foo.php', $loader->findFile('Foo')); - - set_include_path($includePath); - } - - /** - * @dataProvider getLoadClassFromFallbackTests - */ - public function testLoadClassFromFallback($className, $testClassName, $message) - { - $loader = new UniversalClassLoader(); - $loader->registerNamespace('Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->registerPrefix('Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->registerNamespaceFallbacks(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/fallback')); - $loader->registerPrefixFallbacks(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/fallback')); - $loader->loadClass($testClassName); - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassFromFallbackTests() - { - return array( - array('\\Namespaced\\Baz', 'Namespaced\\Baz', '->loadClass() loads Namespaced\Baz class'), - array('\\Pearlike_Baz', 'Pearlike_Baz', '->loadClass() loads Pearlike_Baz class'), - array('\\Namespaced\\FooBar', 'Namespaced\\FooBar', '->loadClass() loads Namespaced\Baz class from fallback dir'), - array('\\Pearlike_FooBar', 'Pearlike_FooBar', '->loadClass() loads Pearlike_Baz class from fallback dir'), - ); - } - - public function testRegisterPrefixFallback() - { - $loader = new UniversalClassLoader(); - $loader->registerPrefixFallback(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/fallback'); - $this->assertEquals(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/fallback'), $loader->getPrefixFallbacks()); - } - - public function testRegisterNamespaceFallback() - { - $loader = new UniversalClassLoader(); - $loader->registerNamespaceFallback(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/Namespaced/fallback'); - $this->assertEquals(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/Namespaced/fallback'), $loader->getNamespaceFallbacks()); - } - - /** - * @dataProvider getLoadClassNamespaceCollisionTests - */ - public function testLoadClassNamespaceCollision($namespaces, $className, $message) - { - $loader = new UniversalClassLoader(); - $loader->registerNamespaces($namespaces); - - $loader->loadClass($className); - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassNamespaceCollisionTests() - { - return array( - array( - array( - 'NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - 'NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - ), - 'NamespaceCollision\A\Foo', - '->loadClass() loads NamespaceCollision\A\Foo from alpha.', - ), - array( - array( - 'NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - 'NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - ), - 'NamespaceCollision\A\Bar', - '->loadClass() loads NamespaceCollision\A\Bar from alpha.', - ), - array( - array( - 'NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - 'NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - ), - 'NamespaceCollision\A\B\Foo', - '->loadClass() loads NamespaceCollision\A\B\Foo from beta.', - ), - array( - array( - 'NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - 'NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - ), - 'NamespaceCollision\A\B\Bar', - '->loadClass() loads NamespaceCollision\A\B\Bar from beta.', - ), - ); - } - - /** - * @dataProvider getLoadClassPrefixCollisionTests - */ - public function testLoadClassPrefixCollision($prefixes, $className, $message) - { - $loader = new UniversalClassLoader(); - $loader->registerPrefixes($prefixes); - - $loader->loadClass($className); - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassPrefixCollisionTests() - { - return array( - array( - array( - 'PrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - 'PrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - ), - 'PrefixCollision_A_Foo', - '->loadClass() loads PrefixCollision_A_Foo from alpha.', - ), - array( - array( - 'PrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - 'PrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - ), - 'PrefixCollision_A_Bar', - '->loadClass() loads PrefixCollision_A_Bar from alpha.', - ), - array( - array( - 'PrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - 'PrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - ), - 'PrefixCollision_A_B_Foo', - '->loadClass() loads PrefixCollision_A_B_Foo from beta.', - ), - array( - array( - 'PrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - 'PrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - ), - 'PrefixCollision_A_B_Bar', - '->loadClass() loads PrefixCollision_A_B_Bar from beta.', - ), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/bootstrap.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/bootstrap.php deleted file mode 100644 index 54dac3f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/Tests/bootstrap.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -spl_autoload_register(function ($class) { - if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\ClassLoader')) { - if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\ClassLoader')).'.php')) { - require_once $file; - } - } -}); - -if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) { - require_once $loader; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php deleted file mode 100644 index b6128ad..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php +++ /dev/null @@ -1,319 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader; - -/** - * UniversalClassLoader implements a "universal" autoloader for PHP 5.3. - * - * It is able to load classes that use either: - * - * * The technical interoperability standards for PHP 5.3 namespaces and - * class names (https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md); - * - * * The PEAR naming convention for classes (http://pear.php.net/). - * - * Classes from a sub-namespace or a sub-hierarchy of PEAR classes can be - * looked for in a list of locations to ease the vendoring of a sub-set of - * classes for large projects. - * - * Example usage: - * - * $loader = new UniversalClassLoader(); - * - * // register classes with namespaces - * $loader->registerNamespaces(array( - * 'Symfony\Component' => __DIR__.'/component', - * 'Symfony' => __DIR__.'/framework', - * 'Sensio' => array(__DIR__.'/src', __DIR__.'/vendor'), - * )); - * - * // register a library using the PEAR naming convention - * $loader->registerPrefixes(array( - * 'Swift_' => __DIR__.'/Swift', - * )); - * - * - * // to enable searching the include path (e.g. for PEAR packages) - * $loader->useIncludePath(true); - * - * // activate the autoloader - * $loader->register(); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * @author Fabien Potencier - * - * @api - */ -class UniversalClassLoader -{ - private $namespaces = array(); - private $prefixes = array(); - private $namespaceFallbacks = array(); - private $prefixFallbacks = array(); - private $useIncludePath = false; - - /** - * Turns on searching the include for class files. Allows easy loading - * of installed PEAR packages - * - * @param Boolean $useIncludePath - */ - public function useIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return Boolean - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Gets the configured namespaces. - * - * @return array A hash with namespaces as keys and directories as values - */ - public function getNamespaces() - { - return $this->namespaces; - } - - /** - * Gets the configured class prefixes. - * - * @return array A hash with class prefixes as keys and directories as values - */ - public function getPrefixes() - { - return $this->prefixes; - } - - /** - * Gets the directory(ies) to use as a fallback for namespaces. - * - * @return array An array of directories - */ - public function getNamespaceFallbacks() - { - return $this->namespaceFallbacks; - } - - /** - * Gets the directory(ies) to use as a fallback for class prefixes. - * - * @return array An array of directories - */ - public function getPrefixFallbacks() - { - return $this->prefixFallbacks; - } - - /** - * Registers the directory to use as a fallback for namespaces. - * - * @param array $dirs An array of directories - * - * @api - */ - public function registerNamespaceFallbacks(array $dirs) - { - $this->namespaceFallbacks = $dirs; - } - - /** - * Registers a directory to use as a fallback for namespaces. - * - * @param string $dir A directory - */ - public function registerNamespaceFallback($dir) - { - $this->namespaceFallbacks[] = $dir; - } - - /** - * Registers directories to use as a fallback for class prefixes. - * - * @param array $dirs An array of directories - * - * @api - */ - public function registerPrefixFallbacks(array $dirs) - { - $this->prefixFallbacks = $dirs; - } - - /** - * Registers a directory to use as a fallback for class prefixes. - * - * @param string $dir A directory - */ - public function registerPrefixFallback($dir) - { - $this->prefixFallbacks[] = $dir; - } - - /** - * Registers an array of namespaces - * - * @param array $namespaces An array of namespaces (namespaces as keys and locations as values) - * - * @api - */ - public function registerNamespaces(array $namespaces) - { - foreach ($namespaces as $namespace => $locations) { - $this->namespaces[$namespace] = (array) $locations; - } - } - - /** - * Registers a namespace. - * - * @param string $namespace The namespace - * @param array|string $paths The location(s) of the namespace - * - * @api - */ - public function registerNamespace($namespace, $paths) - { - $this->namespaces[$namespace] = (array) $paths; - } - - /** - * Registers an array of classes using the PEAR naming convention. - * - * @param array $classes An array of classes (prefixes as keys and locations as values) - * - * @api - */ - public function registerPrefixes(array $classes) - { - foreach ($classes as $prefix => $locations) { - $this->prefixes[$prefix] = (array) $locations; - } - } - - /** - * Registers a set of classes using the PEAR naming convention. - * - * @param string $prefix The classes prefix - * @param array|string $paths The location(s) of the classes - * - * @api - */ - public function registerPrefix($prefix, $paths) - { - $this->prefixes[$prefix] = (array) $paths; - } - - /** - * Registers this instance as an autoloader. - * - * @param Boolean $prepend Whether to prepend the autoloader or not - * - * @api - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - require $file; - } - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|null The path, if found - */ - public function findFile($class) - { - if ('\\' == $class[0]) { - $class = substr($class, 1); - } - - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $namespace = substr($class, 0, $pos); - $className = substr($class, $pos + 1); - $normalizedClass = str_replace('\\', DIRECTORY_SEPARATOR, $namespace).DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $className).'.php'; - foreach ($this->namespaces as $ns => $dirs) { - if (0 !== strpos($namespace, $ns)) { - continue; - } - - foreach ($dirs as $dir) { - $file = $dir.DIRECTORY_SEPARATOR.$normalizedClass; - if (is_file($file)) { - return $file; - } - } - } - - foreach ($this->namespaceFallbacks as $dir) { - $file = $dir.DIRECTORY_SEPARATOR.$normalizedClass; - if (is_file($file)) { - return $file; - } - } - - } else { - // PEAR-like class name - $normalizedClass = str_replace('_', DIRECTORY_SEPARATOR, $class).'.php'; - foreach ($this->prefixes as $prefix => $dirs) { - if (0 !== strpos($class, $prefix)) { - continue; - } - - foreach ($dirs as $dir) { - $file = $dir.DIRECTORY_SEPARATOR.$normalizedClass; - if (is_file($file)) { - return $file; - } - } - } - - foreach ($this->prefixFallbacks as $dir) { - $file = $dir.DIRECTORY_SEPARATOR.$normalizedClass; - if (is_file($file)) { - return $file; - } - } - } - - if ($this->useIncludePath && $file = stream_resolve_include_path($normalizedClass)) { - return $file; - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/XcacheClassLoader.php b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/XcacheClassLoader.php deleted file mode 100644 index 2decbce..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/XcacheClassLoader.php +++ /dev/null @@ -1,121 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader; - -/** - * XcacheClassLoader implements a wrapping autoloader cached in Xcache for PHP 5.3. - * - * It expects an object implementing a findFile method to find the file. This - * allows using it as a wrapper around the other loaders of the component (the - * ClassLoader and the UniversalClassLoader for instance) but also around any - * other autoloader following this convention (the Composer one for instance) - * - * $loader = new ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * $cachedLoader = new XcacheClassLoader('my_prefix', $loader); - * - * // activate the cached autoloader - * $cachedLoader->register(); - * - * // eventually deactivate the non-cached loader if it was registered previously - * // to be sure to use the cached one. - * $loader->unregister(); - * - * @author Fabien Potencier - * @author Kris Wallsmith - * @author Kim Hemsø Rasmussen - * - * @api - */ -class XcacheClassLoader -{ - private $prefix; - private $classFinder; - - /** - * Constructor. - * - * @param string $prefix A prefix to create a namespace in Xcache - * @param object $classFinder An object that implements findFile() method. - * - * @api - */ - public function __construct($prefix, $classFinder) - { - if (!extension_loaded('Xcache')) { - throw new \RuntimeException('Unable to use XcacheClassLoader as Xcache is not enabled.'); - } - - if (!method_exists($classFinder, 'findFile')) { - throw new \InvalidArgumentException('The class finder must implement a "findFile" method.'); - } - - $this->prefix = $prefix; - $this->classFinder = $classFinder; - } - - /** - * Registers this instance as an autoloader. - * - * @param Boolean $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * - * @return Boolean|null True, if loaded - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - require $file; - - return true; - } - } - - /** - * Finds a file by class name while caching lookups to Xcache. - * - * @param string $class A class name to resolve to file - * - * @return string|null - */ - public function findFile($class) - { - if (xcache_isset($this->prefix.$class)) { - $file = xcache_get($this->prefix.$class); - } else { - xcache_set($this->prefix.$class, $file = $this->classFinder->findFile($class)); - } - - return $file; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/composer.json b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/composer.json deleted file mode 100644 index 6e3b3b8..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/composer.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "symfony/class-loader", - "type": "library", - "description": "Symfony ClassLoader Component", - "keywords": [], - "homepage": "http://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "minimum-stability": "dev", - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "symfony/finder": "2.1.*" - }, - "autoload": { - "psr-0": { "Symfony\\Component\\ClassLoader": "" } - }, - "target-dir": "Symfony/Component/ClassLoader", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/phpunit.xml.dist b/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/phpunit.xml.dist deleted file mode 100644 index ae7e2ad..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/phpunit.xml.dist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - ./Tests/ - - - - - - ./ - - ./Resources - ./Tests - ./vendor - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/CHANGELOG.md b/vendor/symfony/symfony/src/Symfony/Component/Config/CHANGELOG.md deleted file mode 100644 index 27dd931..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/CHANGELOG.md +++ /dev/null @@ -1,10 +0,0 @@ -CHANGELOG -========= - -2.1.0 ------ - - * added a way to add documentation on configuration - * implemented `Serializable` on resources - * LoaderResolverInterface is now used instead of LoaderResolver for type - hinting diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/ConfigCache.php b/vendor/symfony/symfony/src/Symfony/Component/Config/ConfigCache.php deleted file mode 100644 index 1a96bdd..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/ConfigCache.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config; - -/** - * ConfigCache manages PHP cache files. - * - * When debug is enabled, it knows when to flush the cache - * thanks to an array of ResourceInterface instances. - * - * @author Fabien Potencier - */ -class ConfigCache -{ - private $debug; - private $file; - - /** - * Constructor. - * - * @param string $file The absolute cache path - * @param Boolean $debug Whether debugging is enabled or not - */ - public function __construct($file, $debug) - { - $this->file = $file; - $this->debug = (Boolean) $debug; - } - - /** - * Gets the cache file path. - * - * @return string The cache file path - */ - public function __toString() - { - return $this->file; - } - - /** - * Checks if the cache is still fresh. - * - * This method always returns true when debug is off and the - * cache file exists. - * - * @return Boolean true if the cache is fresh, false otherwise - */ - public function isFresh() - { - if (!is_file($this->file)) { - return false; - } - - if (!$this->debug) { - return true; - } - - $metadata = $this->file.'.meta'; - if (!is_file($metadata)) { - return false; - } - - $time = filemtime($this->file); - $meta = unserialize(file_get_contents($metadata)); - foreach ($meta as $resource) { - if (!$resource->isFresh($time)) { - return false; - } - } - - return true; - } - - /** - * Writes cache. - * - * @param string $content The content to write in the cache - * @param array $metadata An array of ResourceInterface instances - * - * @throws \RuntimeException When cache file can't be wrote - */ - public function write($content, array $metadata = null) - { - $dir = dirname($this->file); - if (!is_dir($dir)) { - if (false === @mkdir($dir, 0777, true)) { - throw new \RuntimeException(sprintf('Unable to create the %s directory', $dir)); - } - } elseif (!is_writable($dir)) { - throw new \RuntimeException(sprintf('Unable to write in the %s directory', $dir)); - } - - $tmpFile = tempnam(dirname($this->file), basename($this->file)); - if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $this->file)) { - @chmod($this->file, 0666 & ~umask()); - } else { - throw new \RuntimeException(sprintf('Failed to write cache file "%s".', $this->file)); - } - - if (null !== $metadata && true === $this->debug) { - $file = $this->file.'.meta'; - $tmpFile = tempnam(dirname($file), basename($file)); - if (false !== @file_put_contents($tmpFile, serialize($metadata)) && @rename($tmpFile, $file)) { - @chmod($file, 0666 & ~umask()); - } - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/ArrayNode.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/ArrayNode.php deleted file mode 100644 index 170a903..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/ArrayNode.php +++ /dev/null @@ -1,362 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition; - -use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; -use Symfony\Component\Config\Definition\Exception\InvalidTypeException; -use Symfony\Component\Config\Definition\Exception\UnsetKeyException; - -/** - * Represents an Array node in the config tree. - * - * @author Johannes M. Schmitt - */ -class ArrayNode extends BaseNode implements PrototypeNodeInterface -{ - protected $xmlRemappings; - protected $children; - protected $allowFalse; - protected $allowNewKeys; - protected $addIfNotSet; - protected $performDeepMerging; - protected $ignoreExtraKeys; - - /** - * Constructor. - * - * @param string $name The Node's name - * @param NodeInterface $parent The node parent - */ - public function __construct($name, NodeInterface $parent = null) - { - parent::__construct($name, $parent); - - $this->children = array(); - $this->xmlRemappings = array(); - $this->removeKeyAttribute = true; - $this->allowFalse = false; - $this->addIfNotSet = false; - $this->allowNewKeys = true; - $this->performDeepMerging = true; - } - - /** - * Retrieves the children of this node. - * - * @return array The children - */ - public function getChildren() - { - return $this->children; - } - - /** - * Sets the xml remappings that should be performed. - * - * @param array $remappings an array of the form array(array(string, string)) - */ - public function setXmlRemappings(array $remappings) - { - $this->xmlRemappings = $remappings; - } - - /** - * Sets whether to add default values for this array if it has not been - * defined in any of the configuration files. - * - * @param Boolean $boolean - */ - public function setAddIfNotSet($boolean) - { - $this->addIfNotSet = (Boolean) $boolean; - } - - /** - * Sets whether false is allowed as value indicating that the array should be unset. - * - * @param Boolean $allow - */ - public function setAllowFalse($allow) - { - $this->allowFalse = (Boolean) $allow; - } - - /** - * Sets whether new keys can be defined in subsequent configurations. - * - * @param Boolean $allow - */ - public function setAllowNewKeys($allow) - { - $this->allowNewKeys = (Boolean) $allow; - } - - /** - * Sets if deep merging should occur. - * - * @param Boolean $boolean - */ - public function setPerformDeepMerging($boolean) - { - $this->performDeepMerging = (Boolean) $boolean; - } - - /** - * Whether extra keys should just be ignore without an exception. - * - * @param Boolean $boolean To allow extra keys - */ - public function setIgnoreExtraKeys($boolean) - { - $this->ignoreExtraKeys = (Boolean) $boolean; - } - - /** - * Sets the node Name. - * - * @param string $name The node's name - */ - public function setName($name) - { - $this->name = $name; - } - - /** - * Checks if the node has a default value. - * - * @return Boolean - */ - public function hasDefaultValue() - { - return $this->addIfNotSet; - } - - /** - * Retrieves the default value. - * - * @return array The default value - * - * @throws \RuntimeException if the node has no default value - */ - public function getDefaultValue() - { - if (!$this->hasDefaultValue()) { - throw new \RuntimeException(sprintf('The node at path "%s" has no default value.', $this->getPath())); - } - - $defaults = array(); - foreach ($this->children as $name => $child) { - if ($child->hasDefaultValue()) { - $defaults[$name] = $child->getDefaultValue(); - } - } - - return $defaults; - } - - /** - * Adds a child node. - * - * @param NodeInterface $node The child node to add - * - * @throws \InvalidArgumentException when the child node has no name - * @throws \InvalidArgumentException when the child node's name is not unique - */ - public function addChild(NodeInterface $node) - { - $name = $node->getName(); - if (empty($name)) { - throw new \InvalidArgumentException('Child nodes must be named.'); - } - if (isset($this->children[$name])) { - throw new \InvalidArgumentException(sprintf('A child node named "%s" already exists.', $name)); - } - - $this->children[$name] = $node; - } - - /** - * Finalizes the value of this node. - * - * @param mixed $value - * - * @return mixed The finalised value - * - * @throws UnsetKeyException - * @throws InvalidConfigurationException if the node doesn't have enough children - */ - protected function finalizeValue($value) - { - if (false === $value) { - $msg = sprintf('Unsetting key for path "%s", value: %s', $this->getPath(), json_encode($value)); - throw new UnsetKeyException($msg); - } - - foreach ($this->children as $name => $child) { - if (!array_key_exists($name, $value)) { - if ($child->isRequired()) { - $msg = sprintf('The child node "%s" at path "%s" must be configured.', $name, $this->getPath()); - $ex = new InvalidConfigurationException($msg); - $ex->setPath($this->getPath()); - - throw $ex; - } - - if ($child->hasDefaultValue()) { - $value[$name] = $child->getDefaultValue(); - } - - continue; - } - - try { - $value[$name] = $child->finalize($value[$name]); - } catch (UnsetKeyException $unset) { - unset($value[$name]); - } - } - - return $value; - } - - /** - * Validates the type of the value. - * - * @param mixed $value - * - * @throws InvalidTypeException - */ - protected function validateType($value) - { - if (!is_array($value) && (!$this->allowFalse || false !== $value)) { - $ex = new InvalidTypeException(sprintf( - 'Invalid type for path "%s". Expected array, but got %s', - $this->getPath(), - gettype($value) - )); - $ex->setPath($this->getPath()); - - throw $ex; - } - } - - /** - * Normalizes the value. - * - * @param mixed $value The value to normalize - * - * @return mixed The normalized value - */ - protected function normalizeValue($value) - { - if (false === $value) { - return $value; - } - - $value = $this->remapXml($value); - - $normalized = array(); - foreach ($this->children as $name => $child) { - if (array_key_exists($name, $value)) { - $normalized[$name] = $child->normalize($value[$name]); - unset($value[$name]); - } - } - - // if extra fields are present, throw exception - if (count($value) && !$this->ignoreExtraKeys) { - $msg = sprintf('Unrecognized options "%s" under "%s"', implode(', ', array_keys($value)), $this->getPath()); - $ex = new InvalidConfigurationException($msg); - $ex->setPath($this->getPath()); - - throw $ex; - } - - return $normalized; - } - - /** - * Remaps multiple singular values to a single plural value. - * - * @param array $value The source values - * - * @return array The remapped values - */ - protected function remapXml($value) - { - foreach ($this->xmlRemappings as $transformation) { - list($singular, $plural) = $transformation; - - if (!isset($value[$singular])) { - continue; - } - - $value[$plural] = Processor::normalizeConfig($value, $singular, $plural); - unset($value[$singular]); - } - - return $value; - } - - /** - * Merges values together. - * - * @param mixed $leftSide The left side to merge. - * @param mixed $rightSide The right side to merge. - * - * @return mixed The merged values - * - * @throws InvalidConfigurationException - * @throws \RuntimeException - */ - protected function mergeValues($leftSide, $rightSide) - { - if (false === $rightSide) { - // if this is still false after the last config has been merged the - // finalization pass will take care of removing this key entirely - return false; - } - - if (false === $leftSide || !$this->performDeepMerging) { - return $rightSide; - } - - foreach ($rightSide as $k => $v) { - // no conflict - if (!array_key_exists($k, $leftSide)) { - if (!$this->allowNewKeys) { - $ex = new InvalidConfigurationException(sprintf( - 'You are not allowed to define new elements for path "%s". ' - .'Please define all elements for this path in one config file. ' - .'If you are trying to overwrite an element, make sure you redefine it ' - .'with the same name.', - $this->getPath() - )); - $ex->setPath($this->getPath()); - - throw $ex; - } - - $leftSide[$k] = $v; - continue; - } - - if (!isset($this->children[$k])) { - throw new \RuntimeException('merge() expects a normalized config array.'); - } - - $leftSide[$k] = $this->children[$k]->merge($leftSide[$k], $v); - } - - return $leftSide; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/BaseNode.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/BaseNode.php deleted file mode 100644 index 099da4b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/BaseNode.php +++ /dev/null @@ -1,337 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition; - -use Symfony\Component\Config\Definition\Exception\Exception; -use Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException; -use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; - -/** - * The base node class - * - * @author Johannes M. Schmitt - */ -abstract class BaseNode implements NodeInterface -{ - protected $name; - protected $parent; - protected $normalizationClosures; - protected $finalValidationClosures; - protected $allowOverwrite; - protected $required; - protected $equivalentValues; - protected $attributes = array(); - - /** - * Constructor. - * - * @param string $name The name of the node - * @param NodeInterface $parent The parent of this node - * - * @throws \InvalidArgumentException if the name contains a period. - */ - public function __construct($name, NodeInterface $parent = null) - { - if (false !== strpos($name, '.')) { - throw new \InvalidArgumentException('The name must not contain ".".'); - } - - $this->name = $name; - $this->parent = $parent; - $this->normalizationClosures = array(); - $this->finalValidationClosures = array(); - $this->allowOverwrite = true; - $this->required = false; - $this->equivalentValues = array(); - } - - public function setAttribute($key, $value) - { - $this->attributes[$key] = $value; - } - - public function getAttribute($key, $default = null) - { - return isset($this->attributes[$key]) ? $this->attributes[$key] : $default; - } - - public function hasAttribute($key) - { - return isset($this->attributes[$key]); - } - - public function getAttributes() - { - return $this->attributes; - } - - public function setAttributes(array $attributes) - { - $this->attributes = $attributes; - } - - public function removeAttribute($key) - { - unset($this->attributes[$key]); - } - - /** - * Sets an info message. - * - * @param string $info - */ - public function setInfo($info) - { - $this->setAttribute('info', $info); - } - - /** - * Returns info message. - * - * @return string The info text - */ - public function getInfo() - { - return $this->getAttribute('info'); - } - - /** - * Sets the example configuration for this node. - * - * @param string|array $example - */ - public function setExample($example) - { - $this->setAttribute('example', $example); - } - - /** - * Retrieves the example configuration for this node. - * - * @return string|array The example - */ - public function getExample() - { - return $this->getAttribute('example'); - } - - /** - * Adds an equivalent value. - * - * @param mixed $originalValue - * @param mixed $equivalentValue - */ - public function addEquivalentValue($originalValue, $equivalentValue) - { - $this->equivalentValues[] = array($originalValue, $equivalentValue); - } - - /** - * Set this node as required. - * - * @param Boolean $boolean Required node - */ - public function setRequired($boolean) - { - $this->required = (Boolean) $boolean; - } - - /** - * Sets if this node can be overridden. - * - * @param Boolean $allow - */ - public function setAllowOverwrite($allow) - { - $this->allowOverwrite = (Boolean) $allow; - } - - /** - * Sets the closures used for normalization. - * - * @param array $closures An array of Closures used for normalization - */ - public function setNormalizationClosures(array $closures) - { - $this->normalizationClosures = $closures; - } - - /** - * Sets the closures used for final validation. - * - * @param array $closures An array of Closures used for final validation - */ - public function setFinalValidationClosures(array $closures) - { - $this->finalValidationClosures = $closures; - } - - /** - * Checks if this node is required. - * - * @return Boolean - */ - public function isRequired() - { - return $this->required; - } - - /** - * Returns the name of this node - * - * @return string The Node's name. - */ - public function getName() - { - return $this->name; - } - - /** - * Retrieves the path of this node. - * - * @return string The Node's path - */ - public function getPath() - { - $path = $this->name; - - if (null !== $this->parent) { - $path = $this->parent->getPath().'.'.$path; - } - - return $path; - } - - /** - * Merges two values together. - * - * @param mixed $leftSide - * @param mixed $rightSide - * - * @return mixed The merged value - * - * @throws ForbiddenOverwriteException - */ - final public function merge($leftSide, $rightSide) - { - if (!$this->allowOverwrite) { - throw new ForbiddenOverwriteException(sprintf( - 'Configuration path "%s" cannot be overwritten. You have to ' - .'define all options for this path, and any of its sub-paths in ' - .'one configuration section.', - $this->getPath() - )); - } - - $this->validateType($leftSide); - $this->validateType($rightSide); - - return $this->mergeValues($leftSide, $rightSide); - } - - /** - * Normalizes a value, applying all normalization closures. - * - * @param mixed $value Value to normalize. - * - * @return mixed The normalized value. - */ - final public function normalize($value) - { - // run custom normalization closures - foreach ($this->normalizationClosures as $closure) { - $value = $closure($value); - } - - // replace value with their equivalent - foreach ($this->equivalentValues as $data) { - if ($data[0] === $value) { - $value = $data[1]; - } - } - - // validate type - $this->validateType($value); - - // normalize value - return $this->normalizeValue($value); - } - - /** - * Finalizes a value, applying all finalization closures. - * - * @param mixed $value The value to finalize - * - * @return mixed The finalized value - */ - final public function finalize($value) - { - $this->validateType($value); - - $value = $this->finalizeValue($value); - - // Perform validation on the final value if a closure has been set. - // The closure is also allowed to return another value. - foreach ($this->finalValidationClosures as $closure) { - try { - $value = $closure($value); - } catch (Exception $correctEx) { - throw $correctEx; - } catch (\Exception $invalid) { - throw new InvalidConfigurationException(sprintf( - 'Invalid configuration for path "%s": %s', - $this->getPath(), - $invalid->getMessage() - ), $invalid->getCode(), $invalid); - } - } - - return $value; - } - - /** - * Validates the type of a Node. - * - * @param mixed $value The value to validate - * - * @throws InvalidTypeException when the value is invalid - */ - abstract protected function validateType($value); - - /** - * Normalizes the value. - * - * @param mixed $value The value to normalize. - * - * @return mixed The normalized value - */ - abstract protected function normalizeValue($value); - - /** - * Merges two values together. - * - * @param mixed $leftSide - * @param mixed $rightSide - * - * @return mixed The merged value - */ - abstract protected function mergeValues($leftSide, $rightSide); - - /** - * Finalizes a value. - * - * @param mixed $value The value to finalize - * - * @return mixed The finalized value - */ - abstract protected function finalizeValue($value); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/BooleanNode.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/BooleanNode.php deleted file mode 100644 index fb37d62..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/BooleanNode.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition; - -use Symfony\Component\Config\Definition\Exception\InvalidTypeException; - -/** - * This node represents a Boolean value in the config tree. - * - * @author Johannes M. Schmitt - */ -class BooleanNode extends ScalarNode -{ - /** - * {@inheritDoc} - */ - protected function validateType($value) - { - if (!is_bool($value)) { - $ex = new InvalidTypeException(sprintf( - 'Invalid type for path "%s". Expected boolean, but got %s.', - $this->getPath(), - gettype($value) - )); - $ex->setPath($this->getPath()); - - throw $ex; - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php deleted file mode 100644 index db530e9..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php +++ /dev/null @@ -1,419 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Builder; - -use Symfony\Component\Config\Definition\ArrayNode; -use Symfony\Component\Config\Definition\PrototypedArrayNode; -use Symfony\Component\Config\Definition\Exception\InvalidDefinitionException; - -/** - * This class provides a fluent interface for defining an array node. - * - * @author Johannes M. Schmitt - */ -class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinitionInterface -{ - protected $performDeepMerging; - protected $ignoreExtraKeys; - protected $children; - protected $prototype; - protected $atLeastOne; - protected $allowNewKeys; - protected $key; - protected $removeKeyItem; - protected $addDefaults; - protected $addDefaultChildren; - protected $nodeBuilder; - - /** - * {@inheritDoc} - */ - public function __construct($name, NodeParentInterface $parent = null) - { - parent::__construct($name, $parent); - - $this->children = array(); - $this->addDefaults = false; - $this->addDefaultChildren = false; - $this->allowNewKeys = true; - $this->atLeastOne = false; - $this->allowEmptyValue = true; - $this->performDeepMerging = true; - $this->nullEquivalent = array(); - $this->trueEquivalent = array(); - } - - /** - * Sets a custom children builder. - * - * @param NodeBuilder $builder A custom NodeBuilder - */ - public function setBuilder(NodeBuilder $builder) - { - $this->nodeBuilder = $builder; - } - - /** - * Returns a builder to add children nodes. - * - * @return NodeBuilder - */ - public function children() - { - return $this->getNodeBuilder(); - } - - /** - * Sets a prototype for child nodes. - * - * @param string $type the type of node - * - * @return NodeDefinition - */ - public function prototype($type) - { - return $this->prototype = $this->getNodeBuilder()->node(null, $type)->setParent($this); - } - - /** - * Adds the default value if the node is not set in the configuration. - * - * This method is applicable to concrete nodes only (not to prototype nodes). - * If this function has been called and the node is not set during the finalization - * phase, it's default value will be derived from its children default values. - * - * @return ArrayNodeDefinition - */ - public function addDefaultsIfNotSet() - { - $this->addDefaults = true; - - return $this; - } - - /** - * Adds children with a default value when none are defined. - * - * @param integer|string|array|null $children The number of children|The child name|The children names to be added - * - * This method is applicable to prototype nodes only. - * - * @return ArrayNodeDefinition - */ - public function addDefaultChildrenIfNoneSet($children = null) - { - $this->addDefaultChildren = $children; - - return $this; - } - - /** - * Requires the node to have at least one element. - * - * This method is applicable to prototype nodes only. - * - * @return ArrayNodeDefinition - */ - public function requiresAtLeastOneElement() - { - $this->atLeastOne = true; - - return $this; - } - - /** - * Disallows adding news keys in a subsequent configuration. - * - * If used all keys have to be defined in the same configuration file. - * - * @return ArrayNodeDefinition - */ - public function disallowNewKeysInSubsequentConfigs() - { - $this->allowNewKeys = false; - - return $this; - } - - /** - * Sets a normalization rule for XML configurations. - * - * @param string $singular The key to remap - * @param string $plural The plural of the key for irregular plurals - * - * @return ArrayNodeDefinition - */ - public function fixXmlConfig($singular, $plural = null) - { - $this->normalization()->remap($singular, $plural); - - return $this; - } - - /** - * Sets the attribute which value is to be used as key. - * - * This is useful when you have an indexed array that should be an - * associative array. You can select an item from within the array - * to be the key of the particular item. For example, if "id" is the - * "key", then: - * - * array( - * array('id' => 'my_name', 'foo' => 'bar'), - * ); - * - * becomes - * - * array( - * 'my_name' => array('foo' => 'bar'), - * ); - * - * If you'd like "'id' => 'my_name'" to still be present in the resulting - * array, then you can set the second argument of this method to false. - * - * This method is applicable to prototype nodes only. - * - * @param string $name The name of the key - * @param Boolean $removeKeyItem Whether or not the key item should be removed. - * - * @return ArrayNodeDefinition - */ - public function useAttributeAsKey($name, $removeKeyItem = true) - { - $this->key = $name; - $this->removeKeyItem = $removeKeyItem; - - return $this; - } - - /** - * Sets whether the node can be unset. - * - * @param Boolean $allow - * - * @return ArrayNodeDefinition - */ - public function canBeUnset($allow = true) - { - $this->merge()->allowUnset($allow); - - return $this; - } - - /** - * Disables the deep merging of the node. - * - * @return ArrayNodeDefinition - */ - public function performNoDeepMerging() - { - $this->performDeepMerging = false; - - return $this; - } - - /** - * Allows extra config keys to be specified under an array without - * throwing an exception. - * - * Those config values are simply ignored. This should be used only - * in special cases where you want to send an entire configuration - * array through a special tree that processes only part of the array. - * - * @return ArrayNodeDefinition - */ - public function ignoreExtraKeys() - { - $this->ignoreExtraKeys = true; - - return $this; - } - - /** - * Appends a node definition. - * - * $node = new ArrayNodeDefinition() - * ->children() - * ->scalarNode('foo')->end() - * ->scalarNode('baz')->end() - * ->end() - * ->append($this->getBarNodeDefinition()) - * ; - * - * @param NodeDefinition $node A NodeDefinition instance - * - * @return ArrayNodeDefinition This node - */ - public function append(NodeDefinition $node) - { - $this->children[$node->name] = $node->setParent($this); - - return $this; - } - - /** - * Returns a node builder to be used to add children and prototype - * - * @return NodeBuilder The node builder - */ - protected function getNodeBuilder() - { - if (null === $this->nodeBuilder) { - $this->nodeBuilder = new NodeBuilder(); - } - - return $this->nodeBuilder->setParent($this); - } - - /** - * {@inheritDoc} - */ - protected function createNode() - { - if (null === $this->prototype) { - $node = new ArrayNode($this->name, $this->parent); - - $this->validateConcreteNode($node); - - $node->setAddIfNotSet($this->addDefaults); - - foreach ($this->children as $child) { - $child->parent = $node; - $node->addChild($child->getNode()); - } - } else { - $node = new PrototypedArrayNode($this->name, $this->parent); - - $this->validatePrototypeNode($node); - - if (null !== $this->key) { - $node->setKeyAttribute($this->key, $this->removeKeyItem); - } - - if (true === $this->atLeastOne) { - $node->setMinNumberOfElements(1); - } - - if ($this->default) { - $node->setDefaultValue($this->defaultValue); - } - - if (false !== $this->addDefaultChildren) { - $node->setAddChildrenIfNoneSet($this->addDefaultChildren); - if ($this->prototype instanceof static && null === $this->prototype->prototype) { - $this->prototype->addDefaultsIfNotSet(); - } - } - - $this->prototype->parent = $node; - $node->setPrototype($this->prototype->getNode()); - } - - $node->setAllowNewKeys($this->allowNewKeys); - $node->addEquivalentValue(null, $this->nullEquivalent); - $node->addEquivalentValue(true, $this->trueEquivalent); - $node->addEquivalentValue(false, $this->falseEquivalent); - $node->setPerformDeepMerging($this->performDeepMerging); - $node->setRequired($this->required); - $node->setIgnoreExtraKeys($this->ignoreExtraKeys); - - if (null !== $this->normalization) { - $node->setNormalizationClosures($this->normalization->before); - $node->setXmlRemappings($this->normalization->remappings); - } - - if (null !== $this->merge) { - $node->setAllowOverwrite($this->merge->allowOverwrite); - $node->setAllowFalse($this->merge->allowFalse); - } - - if (null !== $this->validation) { - $node->setFinalValidationClosures($this->validation->rules); - } - - return $node; - } - - /** - * Validate the configuration of a concrete node. - * - * @param NodeInterface $node The related node - * - * @throws InvalidDefinitionException When an error is detected in the configuration - */ - protected function validateConcreteNode(ArrayNode $node) - { - $path = $node->getPath(); - - if (null !== $this->key) { - throw new InvalidDefinitionException( - sprintf('->useAttributeAsKey() is not applicable to concrete nodes at path "%s"', $path) - ); - } - - if (true === $this->atLeastOne) { - throw new InvalidDefinitionException( - sprintf('->requiresAtLeastOneElement() is not applicable to concrete nodes at path "%s"', $path) - ); - } - - if ($this->default) { - throw new InvalidDefinitionException( - sprintf('->defaultValue() is not applicable to concrete nodes at path "%s"', $path) - ); - } - - if (false !== $this->addDefaultChildren) { - throw new InvalidDefinitionException( - sprintf('->addDefaultChildrenIfNoneSet() is not applicable to concrete nodes at path "%s"', $path) - ); - } - } - - /** - * Validate the configuration of a prototype node. - * - * @param NodeInterface $node The related node - * - * @throws InvalidDefinitionException When an error is detected in the configuration - */ - protected function validatePrototypeNode(PrototypedArrayNode $node) - { - $path = $node->getPath(); - - if ($this->addDefaults) { - throw new InvalidDefinitionException( - sprintf('->addDefaultsIfNotSet() is not applicable to prototype nodes at path "%s"', $path) - ); - } - - if (false !== $this->addDefaultChildren) { - if ($this->default) { - throw new InvalidDefinitionException( - sprintf('A default value and default children might not be used together at path "%s"', $path) - ); - } - - if (null !== $this->key && (null === $this->addDefaultChildren || is_integer($this->addDefaultChildren) && $this->addDefaultChildren > 0)) { - throw new InvalidDefinitionException( - sprintf('->addDefaultChildrenIfNoneSet() should set default children names as ->useAttributeAsKey() is used at path "%s"', $path) - ); - } - - if (null === $this->key && (is_string($this->addDefaultChildren) || is_array($this->addDefaultChildren))) { - throw new InvalidDefinitionException( - sprintf('->addDefaultChildrenIfNoneSet() might not set default children names as ->useAttributeAsKey() is not used at path "%s"', $path) - ); - } - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php deleted file mode 100644 index 7ee4d4d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Builder; - -use Symfony\Component\Config\Definition\BooleanNode; - -/** - * This class provides a fluent interface for defining a node. - * - * @author Johannes M. Schmitt - */ -class BooleanNodeDefinition extends ScalarNodeDefinition -{ - /** - * {@inheritDoc} - */ - public function __construct($name, NodeParentInterface $parent = null) - { - parent::__construct($name, $parent); - - $this->nullEquivalent = true; - } - - /** - * Instantiate a Node - * - * @return BooleanNode The node - */ - protected function instantiateNode() - { - return new BooleanNode($this->name, $this->parent); - } - -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/EnumNodeDefinition.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/EnumNodeDefinition.php deleted file mode 100755 index 1db01de..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/EnumNodeDefinition.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ -class EnumNodeDefinition extends ScalarNodeDefinition -{ - private $values; - - public function values(array $values) - { - $values = array_unique($values); - - if (count($values) <= 1) { - throw new \InvalidArgumentException('->values() must be called with at least two distinct values.'); - } - - $this->values = $values; - - return $this; - } - - /** - * Instantiate a Node - * - * @return EnumNode The node - */ - protected function instantiateNode() - { - if (null === $this->values) { - throw new \RuntimeException('You must call ->values() on enum nodes.'); - } - - return new EnumNode($this->name, $this->parent, $this->values); - } -} \ No newline at end of file diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php deleted file mode 100644 index 10d2e00..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php +++ /dev/null @@ -1,229 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Builder; -use Symfony\Component\Config\Definition\Exception\UnsetKeyException; - -/** - * This class builds an if expression. - * - * @author Johannes M. Schmitt - * @author Christophe Coevoet - */ -class ExprBuilder -{ - protected $node; - public $ifPart; - public $thenPart; - - /** - * Constructor - * - * @param NodeDefinition $node The related node - */ - public function __construct(NodeDefinition $node) - { - $this->node = $node; - } - - /** - * Marks the expression as being always used. - * - * @param \Closure $then - * - * @return ExprBuilder - */ - public function always(\Closure $then = null) - { - $this->ifPart = function($v) { return true; }; - - if (null !== $then) { - $this->thenPart = $then; - } - - return $this; - } - - /** - * Sets a closure to use as tests. - * - * The default one tests if the value is true. - * - * @param \Closure $closure - * - * @return ExprBuilder - */ - public function ifTrue(\Closure $closure = null) - { - if (null === $closure) { - $closure = function($v) { return true === $v; }; - } - - $this->ifPart = $closure; - - return $this; - } - - /** - * Tests if the value is a string. - * - * @return ExprBuilder - */ - public function ifString() - { - $this->ifPart = function($v) { return is_string($v); }; - - return $this; - } - - /** - * Tests if the value is null. - * - * @return ExprBuilder - */ - public function ifNull() - { - $this->ifPart = function($v) { return null === $v; }; - - return $this; - } - - /** - * Tests if the value is an array. - * - * @return ExprBuilder - */ - public function ifArray() - { - $this->ifPart = function($v) { return is_array($v); }; - - return $this; - } - - /** - * Tests if the value is in an array. - * - * @param array $array - * - * @return ExprBuilder - */ - public function ifInArray(array $array) - { - $this->ifPart = function($v) use ($array) { return in_array($v, $array, true); }; - - return $this; - } - - /** - * Tests if the value is not in an array. - * - * @param array $array - * - * @return ExprBuilder - */ - public function ifNotInArray(array $array) - { - $this->ifPart = function($v) use ($array) { return !in_array($v, $array, true); }; - - return $this; - } - - /** - * Sets the closure to run if the test pass. - * - * @param \Closure $closure - * - * @return ExprBuilder - */ - public function then(\Closure $closure) - { - $this->thenPart = $closure; - - return $this; - } - - /** - * Sets a closure returning an empty array. - * - * @return ExprBuilder - */ - public function thenEmptyArray() - { - $this->thenPart = function($v) { return array(); }; - - return $this; - } - - /** - * Sets a closure marking the value as invalid at validation time. - * - * if you want to add the value of the node in your message just use a %s placeholder. - * - * @param string $message - * - * @return ExprBuilder - */ - public function thenInvalid($message) - { - $this->thenPart = function ($v) use ($message) {throw new \InvalidArgumentException(sprintf($message, json_encode($v))); }; - - return $this; - } - - /** - * Sets a closure unsetting this key of the array at validation time. - * - * @return ExprBuilder - */ - public function thenUnset() - { - $this->thenPart = function ($v) { throw new UnsetKeyException('Unsetting key'); }; - - return $this; - } - - /** - * Returns the related node - * - * @return NodeDefinition - */ - public function end() - { - if (null === $this->ifPart) { - throw new \RuntimeException('You must specify an if part.'); - } - if (null === $this->thenPart) { - throw new \RuntimeException('You must specify a then part.'); - } - - return $this->node; - } - - /** - * Builds the expressions. - * - * @param array $expressions An array of ExprBuilder instances to build - * - * @return array - */ - public static function buildExpressions(array $expressions) - { - foreach ($expressions as $k => $expr) { - if ($expr instanceof ExprBuilder) { - $expressions[$k] = function($v) use ($expr) { - return call_user_func($expr->ifPart, $v) ? call_user_func($expr->thenPart, $v) : $v; - }; - } - } - - return $expressions; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/MergeBuilder.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/MergeBuilder.php deleted file mode 100644 index 5e09ff5..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/MergeBuilder.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Builder; - -/** - * This class builds merge conditions. - * - * @author Johannes M. Schmitt - */ -class MergeBuilder -{ - protected $node; - public $allowFalse; - public $allowOverwrite; - - /** - * Constructor - * - * @param NodeDefinition $node The related node - */ - public function __construct(NodeDefinition $node) - { - $this->node = $node; - $this->allowFalse = false; - $this->allowOverwrite = true; - } - - /** - * Sets whether the node can be unset. - * - * @param Boolean $allow - * - * @return MergeBuilder - */ - public function allowUnset($allow = true) - { - $this->allowFalse = $allow; - - return $this; - } - - /** - * Sets whether the node can be overwritten. - * - * @param Boolean $deny Whether the overwriting is forbidden or not - * - * @return MergeBuilder - */ - public function denyOverwrite($deny = true) - { - $this->allowOverwrite = !$deny; - - return $this; - } - - /** - * Returns the related node. - * - * @return NodeDefinition - */ - public function end() - { - return $this->node; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php deleted file mode 100644 index c960ac4..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php +++ /dev/null @@ -1,219 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Builder; - -/** - * This class provides a fluent interface for building a node. - * - * @author Johannes M. Schmitt - */ -class NodeBuilder implements NodeParentInterface -{ - protected $parent; - protected $nodeMapping; - - /** - * Constructor - * - */ - public function __construct() - { - $this->nodeMapping = array( - 'variable' => __NAMESPACE__.'\\VariableNodeDefinition', - 'scalar' => __NAMESPACE__.'\\ScalarNodeDefinition', - 'boolean' => __NAMESPACE__.'\\BooleanNodeDefinition', - 'array' => __NAMESPACE__.'\\ArrayNodeDefinition', - 'enum' => __NAMESPACE__.'\\EnumNodeDefinition', - ); - } - - /** - * Set the parent node. - * - * @param ParentNodeDefinitionInterface $parent The parent node - * - * @return NodeBuilder This node builder - */ - public function setParent(ParentNodeDefinitionInterface $parent = null) - { - $this->parent = $parent; - - return $this; - } - - /** - * Creates a child array node. - * - * @param string $name The name of the node - * - * @return ArrayNodeDefinition The child node - */ - public function arrayNode($name) - { - return $this->node($name, 'array'); - } - - /** - * Creates a child scalar node. - * - * @param string $name the name of the node - * - * @return ScalarNodeDefinition The child node - */ - public function scalarNode($name) - { - return $this->node($name, 'scalar'); - } - - /** - * Creates a child Boolean node. - * - * @param string $name The name of the node - * - * @return BooleanNodeDefinition The child node - */ - public function booleanNode($name) - { - return $this->node($name, 'boolean'); - } - - /** - * Creates a child EnumNode. - * - * @param string $name - * - * @return EnumNodeDefinition - */ - public function enumNode($name) - { - return $this->node($name, 'enum'); - } - - /** - * Creates a child variable node. - * - * @param string $name The name of the node - * - * @return VariableNodeDefinition The builder of the child node - */ - public function variableNode($name) - { - return $this->node($name, 'variable'); - } - - /** - * Returns the parent node. - * - * @return ParentNodeDefinitionInterface The parent node - */ - public function end() - { - return $this->parent; - } - - /** - * Creates a child node. - * - * @param string $name The name of the node - * @param string $type The type of the node - * - * @return NodeDefinition The child node - * - * @throws \RuntimeException When the node type is not registered - * @throws \RuntimeException When the node class is not found - */ - public function node($name, $type) - { - $class = $this->getNodeClass($type); - - $node = new $class($name); - - $this->append($node); - - return $node; - } - - /** - * Appends a node definition. - * - * Usage: - * - * $node = new ArrayNodeDefinition('name') - * ->children() - * ->scalarNode('foo')->end() - * ->scalarNode('baz')->end() - * ->append($this->getBarNodeDefinition()) - * ->end() - * ; - * - * @return NodeBuilder This node builder - */ - public function append(NodeDefinition $node) - { - if ($node instanceof ParentNodeDefinitionInterface) { - $builder = clone $this; - $builder->setParent(null); - $node->setBuilder($builder); - } - - if (null !== $this->parent) { - $this->parent->append($node); - // Make this builder the node parent to allow for a fluid interface - $node->setParent($this); - } - - return $this; - } - - /** - * Adds or overrides a node Type. - * - * @param string $type The name of the type - * @param string $class The fully qualified name the node definition class - * - * @return NodeBuilder This node builder - */ - public function setNodeClass($type, $class) - { - $this->nodeMapping[strtolower($type)] = $class; - - return $this; - } - - /** - * Returns the class name of the node definition. - * - * @param string $type The node type - * - * @return string The node definition class name - * - * @throws \RuntimeException When the node type is not registered - * @throws \RuntimeException When the node class is not found - */ - protected function getNodeClass($type) - { - $type = strtolower($type); - - if (!isset($this->nodeMapping[$type])) { - throw new \RuntimeException(sprintf('The node type "%s" is not registered.', $type)); - } - - $class = $this->nodeMapping[$type]; - - if (!class_exists($class)) { - throw new \RuntimeException(sprintf('The node class "%s" does not exist.', $class)); - } - - return $class; - } - -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php deleted file mode 100644 index 614ceff..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php +++ /dev/null @@ -1,343 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Builder; - -use Symfony\Component\Config\Definition\NodeInterface; - -/** - * This class provides a fluent interface for defining a node. - * - * @author Johannes M. Schmitt - */ -abstract class NodeDefinition implements NodeParentInterface -{ - protected $name; - protected $normalization; - protected $validation; - protected $defaultValue; - protected $default; - protected $required; - protected $merge; - protected $allowEmptyValue; - protected $nullEquivalent; - protected $trueEquivalent; - protected $falseEquivalent; - protected $parent; - protected $attributes = array(); - - /** - * Constructor - * - * @param string $name The name of the node - * @param NodeParentInterface $parent The parent - */ - public function __construct($name, NodeParentInterface $parent = null) - { - $this->parent = $parent; - $this->name = $name; - $this->default = false; - $this->required = false; - $this->trueEquivalent = true; - $this->falseEquivalent = false; - } - - /** - * Sets the parent node. - * - * @param NodeParentInterface $parent The parent - * - * @return NodeDefinition - */ - public function setParent(NodeParentInterface $parent) - { - $this->parent = $parent; - - return $this; - } - - /** - * Sets info message. - * - * @param string $info The info text - * - * @return NodeDefinition - */ - public function info($info) - { - return $this->attribute('info', $info); - } - - /** - * Sets example configuration. - * - * @param string|array $example - * - * @return NodeDefinition - */ - public function example($example) - { - return $this->attribute('example', $example); - } - - /** - * Sets an attribute on the node. - * - * @param string $key - * @param mixed $value - * - * @return NodeDefinition - */ - public function attribute($key, $value) - { - $this->attributes[$key] = $value; - - return $this; - } - - /** - * Returns the parent node. - * - * @return NodeParentInterface The builder of the parent node - */ - public function end() - { - return $this->parent; - } - - /** - * Creates the node. - * - * @param Boolean $forceRootNode Whether to force this node as the root node - * - * @return NodeInterface - */ - public function getNode($forceRootNode = false) - { - if ($forceRootNode) { - $this->parent = null; - } - - if (null !== $this->normalization) { - $this->normalization->before = ExprBuilder::buildExpressions($this->normalization->before); - } - - if (null !== $this->validation) { - $this->validation->rules = ExprBuilder::buildExpressions($this->validation->rules); - } - - $node = $this->createNode(); - $node->setAttributes($this->attributes); - - return $node; - } - - /** - * Sets the default value. - * - * @param mixed $value The default value - * - * @return NodeDefinition - */ - public function defaultValue($value) - { - $this->default = true; - $this->defaultValue = $value; - - return $this; - } - - /** - * Sets the node as required. - * - * @return NodeDefinition - */ - public function isRequired() - { - $this->required = true; - - return $this; - } - - /** - * Sets the equivalent value used when the node contains null. - * - * @param mixed $value - * - * @return NodeDefinition - */ - public function treatNullLike($value) - { - $this->nullEquivalent = $value; - - return $this; - } - - /** - * Sets the equivalent value used when the node contains true. - * - * @param mixed $value - * - * @return NodeDefinition - */ - public function treatTrueLike($value) - { - $this->trueEquivalent = $value; - - return $this; - } - - /** - * Sets the equivalent value used when the node contains false. - * - * @param mixed $value - * - * @return NodeDefinition - */ - public function treatFalseLike($value) - { - $this->falseEquivalent = $value; - - return $this; - } - - /** - * Sets null as the default value. - * - * @return NodeDefinition - */ - public function defaultNull() - { - return $this->defaultValue(null); - } - - /** - * Sets true as the default value. - * - * @return NodeDefinition - */ - public function defaultTrue() - { - return $this->defaultValue(true); - } - - /** - * Sets false as the default value. - * - * @return NodeDefinition - */ - public function defaultFalse() - { - return $this->defaultValue(false); - } - - /** - * Sets an expression to run before the normalization. - * - * @return ExprBuilder - */ - public function beforeNormalization() - { - return $this->normalization()->before(); - } - - /** - * Denies the node value being empty. - * - * @return NodeDefinition - */ - public function cannotBeEmpty() - { - $this->allowEmptyValue = false; - - return $this; - } - - /** - * Sets an expression to run for the validation. - * - * The expression receives the value of the node and must return it. It can - * modify it. - * An exception should be thrown when the node is not valid. - * - * @return ExprBuilder - */ - public function validate() - { - return $this->validation()->rule(); - } - - /** - * Sets whether the node can be overwritten. - * - * @param Boolean $deny Whether the overwriting is forbidden or not - * - * @return NodeDefinition - */ - public function cannotBeOverwritten($deny = true) - { - $this->merge()->denyOverwrite($deny); - - return $this; - } - - /** - * Gets the builder for validation rules. - * - * @return ValidationBuilder - */ - protected function validation() - { - if (null === $this->validation) { - $this->validation = new ValidationBuilder($this); - } - - return $this->validation; - } - - /** - * Gets the builder for merging rules. - * - * @return MergeBuilder - */ - protected function merge() - { - if (null === $this->merge) { - $this->merge = new MergeBuilder($this); - } - - return $this->merge; - } - - /** - * Gets the builder for normalization rules. - * - * @return NormalizationBuilder - */ - protected function normalization() - { - if (null === $this->normalization) { - $this->normalization = new NormalizationBuilder($this); - } - - return $this->normalization; - } - - /** - * Instantiate and configure the node according to this definition - * - * @return NodeInterface $node The node instance - * - * @throws Symfony\Component\Config\Definition\Exception\InvalidDefinitionException When the definition is invalid - */ - abstract protected function createNode(); - -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/NodeParentInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/NodeParentInterface.php deleted file mode 100644 index 24f3971..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/NodeParentInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Builder; - -/** - * An interface that must be implemented by all node parents - * - * @author Victor Berchet - */ -interface NodeParentInterface -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php deleted file mode 100644 index 87f25b7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Builder; - -/** - * This class builds normalization conditions. - * - * @author Johannes M. Schmitt - */ -class NormalizationBuilder -{ - protected $node; - public $before; - public $remappings; - - /** - * Constructor - * - * @param NodeDefinition $node The related node - */ - public function __construct(NodeDefinition $node) - { - $this->node = $node; - $this->keys = false; - $this->remappings = array(); - $this->before = array(); - } - - /** - * Registers a key to remap to its plural form. - * - * @param string $key The key to remap - * @param string $plural The plural of the key in case of irregular plural - * - * @return NormalizationBuilder - */ - public function remap($key, $plural = null) - { - $this->remappings[] = array($key, null === $plural ? $key.'s' : $plural); - - return $this; - } - - /** - * Registers a closure to run before the normalization or an expression builder to build it if null is provided. - * - * @param \Closure $closure - * - * @return ExprBuilder|NormalizationBuilder - */ - public function before(\Closure $closure = null) - { - if (null !== $closure) { - $this->before[] = $closure; - - return $this; - } - - return $this->before[] = new ExprBuilder($this->node); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/ParentNodeDefinitionInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/ParentNodeDefinitionInterface.php deleted file mode 100644 index 005c26b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/ParentNodeDefinitionInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Builder; - -/** - * An interface that must be implemented by nodes which can have children - * - * @author Victor Berchet - */ -interface ParentNodeDefinitionInterface -{ - public function children(); - - public function append(NodeDefinition $node); - - public function setBuilder(NodeBuilder $builder); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/ScalarNodeDefinition.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/ScalarNodeDefinition.php deleted file mode 100644 index 6a115fe..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/ScalarNodeDefinition.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Builder; - -use Symfony\Component\Config\Definition\ScalarNode; - -/** - * This class provides a fluent interface for defining a node. - * - * @author Johannes M. Schmitt - */ -class ScalarNodeDefinition extends VariableNodeDefinition -{ - /** - * Instantiate a Node - * - * @return ScalarNode The node - */ - protected function instantiateNode() - { - return new ScalarNode($this->name, $this->parent); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/TreeBuilder.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/TreeBuilder.php deleted file mode 100644 index 1070fd7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/TreeBuilder.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Builder; - -/** - * This is the entry class for building a config tree. - * - * @author Johannes M. Schmitt - */ -class TreeBuilder implements NodeParentInterface -{ - protected $tree; - protected $root; - protected $builder; - - /** - * Creates the root node. - * - * @param string $name The name of the root node - * @param string $type The type of the root node - * @param NodeBuilder $builder A custom node builder instance - * - * @return ArrayNodeDefinition|NodeDefinition The root node (as an ArrayNodeDefinition when the type is 'array') - * - * @throws \RuntimeException When the node type is not supported - */ - public function root($name, $type = 'array', NodeBuilder $builder = null) - { - $builder = $builder ?: new NodeBuilder(); - - return $this->root = $builder->node($name, $type)->setParent($this); - } - - /** - * Builds the tree. - * - * @return NodeInterface - */ - public function buildTree() - { - if (null === $this->root) { - throw new \RuntimeException('The configuration tree has no root node.'); - } - if (null !== $this->tree) { - return $this->tree; - } - - return $this->tree = $this->root->getNode(true); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php deleted file mode 100644 index 22f54a1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Builder; - -/** - * This class builds validation conditions. - * - * @author Christophe Coevoet - */ -class ValidationBuilder -{ - protected $node; - public $rules; - - /** - * Constructor - * - * @param NodeDefinition $node The related node - */ - public function __construct(NodeDefinition $node) - { - $this->node = $node; - - $this->rules = array(); - } - - /** - * Registers a closure to run as normalization or an expression builder to build it if null is provided. - * - * @param \Closure $closure - * - * @return ExprBuilder|ValidationBuilder - */ - public function rule(\Closure $closure = null) - { - if (null !== $closure) { - $this->rules[] = $closure; - - return $this; - } - - return $this->rules[] = new ExprBuilder($this->node); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/VariableNodeDefinition.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/VariableNodeDefinition.php deleted file mode 100644 index 75da3ab..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Builder/VariableNodeDefinition.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Builder; - -use Symfony\Component\Config\Definition\VariableNode; - -/** - * This class provides a fluent interface for defining a node. - * - * @author Johannes M. Schmitt - */ -class VariableNodeDefinition extends NodeDefinition -{ - /** - * Instantiate a Node - * - * @return VariableNode The node - */ - protected function instantiateNode() - { - return new VariableNode($this->name, $this->parent); - } - - /** - * {@inheritDoc} - */ - protected function createNode() - { - $node = $this->instantiateNode(); - - if (null !== $this->normalization) { - $node->setNormalizationClosures($this->normalization->before); - } - - if (null !== $this->merge) { - $node->setAllowOverwrite($this->merge->allowOverwrite); - } - - if (true === $this->default) { - $node->setDefaultValue($this->defaultValue); - } - - if (false === $this->allowEmptyValue) { - $node->setAllowEmptyValue($this->allowEmptyValue); - } - - $node->addEquivalentValue(null, $this->nullEquivalent); - $node->addEquivalentValue(true, $this->trueEquivalent); - $node->addEquivalentValue(false, $this->falseEquivalent); - $node->setRequired($this->required); - - if (null !== $this->validation) { - $node->setFinalValidationClosures($this->validation->rules); - } - - return $node; - } - -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/ConfigurationInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/ConfigurationInterface.php deleted file mode 100644 index 336cb00..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/ConfigurationInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition; - -/** - * Configuration interface - * - * @author Victor Berchet - */ -interface ConfigurationInterface -{ - /** - * Generates the configuration tree builder. - * - * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder - */ - public function getConfigTreeBuilder(); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/EnumNode.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/EnumNode.php deleted file mode 100755 index 9bfb467..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/EnumNode.php +++ /dev/null @@ -1,50 +0,0 @@ - - */ -class EnumNode extends ScalarNode -{ - private $values; - - public function __construct($name, NodeInterface $parent = null, array $values = array()) - { - $values = array_unique($values); - if (count($values) <= 1) { - throw new \InvalidArgumentException('$values must contain at least two distinct elements.'); - } - - parent::__construct($name, $parent); - $this->values = $values; - } - - public function getValues() - { - return $this->values; - } - - protected function finalizeValue($value) - { - $value = parent::finalizeValue($value); - - if (!in_array($value, $this->values, true)) { - $ex = new InvalidConfigurationException(sprintf( - 'The value %s is not allowed for path "%s". Permissible values: %s', - json_encode($value), - $this->getPath(), - implode(', ', array_map('json_encode', $this->values)))); - $ex->setPath($this->getPath()); - - throw $ex; - } - - return $value; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/DuplicateKeyException.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/DuplicateKeyException.php deleted file mode 100644 index 48dd932..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/DuplicateKeyException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Exception; - -/** - * This exception is thrown whenever the key of an array is not unique. This can - * only be the case if the configuration is coming from an XML file. - * - * @author Johannes M. Schmitt - */ -class DuplicateKeyException extends InvalidConfigurationException -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/Exception.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/Exception.php deleted file mode 100644 index 1fda6c2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/Exception.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Exception; - -/** - * Base exception for all configuration exceptions - * - * @author Johannes M. Schmitt - */ -class Exception extends \RuntimeException -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/ForbiddenOverwriteException.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/ForbiddenOverwriteException.php deleted file mode 100644 index 726c07f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/ForbiddenOverwriteException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Exception; - -/** - * This exception is thrown when a configuration path is overwritten from a - * subsequent configuration file, but the entry node specifically forbids this. - * - * @author Johannes M. Schmitt - */ -class ForbiddenOverwriteException extends InvalidConfigurationException -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/InvalidConfigurationException.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/InvalidConfigurationException.php deleted file mode 100644 index 840e3f3..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/InvalidConfigurationException.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Exception; - -/** - * A very general exception which can be thrown whenever non of the more specific - * exceptions is suitable. - * - * @author Johannes M. Schmitt - */ -class InvalidConfigurationException extends Exception -{ - private $path; - - public function setPath($path) - { - $this->path = $path; - } - - public function getPath() - { - return $this->path; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/InvalidDefinitionException.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/InvalidDefinitionException.php deleted file mode 100644 index 98310da..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/InvalidDefinitionException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Exception; - -/** - * Thrown when an error is detected in a node Definition. - * - * @author Victor Berchet - */ -class InvalidDefinitionException extends Exception -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/InvalidTypeException.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/InvalidTypeException.php deleted file mode 100644 index d7ca8c9..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/InvalidTypeException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Exception; - -/** - * This exception is thrown if an invalid type is encountered. - * - * @author Johannes M. Schmitt - */ -class InvalidTypeException extends InvalidConfigurationException -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/UnsetKeyException.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/UnsetKeyException.php deleted file mode 100644 index 863181a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Exception/UnsetKeyException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Exception; - -/** - * This exception is usually not encountered by the end-user, but only used - * internally to signal the parent scope to unset a key. - * - * @author Johannes M. Schmitt - */ -class UnsetKeyException extends Exception -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/NodeInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/NodeInterface.php deleted file mode 100644 index cdbc0ef..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/NodeInterface.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition; - -/** - * Common Interface among all nodes. - * - * In most cases, it is better to inherit from BaseNode instead of implementing - * this interface yourself. - * - * @author Johannes M. Schmitt - */ -interface NodeInterface -{ - /** - * Returns the name of the node. - * - * @return string The name of the node - */ - public function getName(); - - /** - * Returns the path of the node. - * - * @return string The node path - */ - public function getPath(); - - /** - * Returns true when the node is required. - * - * @return Boolean If the node is required - */ - public function isRequired(); - - /** - * Returns true when the node has a default value. - * - * @return Boolean If the node has a default value - */ - public function hasDefaultValue(); - - /** - * Returns the default value of the node. - * - * @return mixed The default value - * @throws \RuntimeException if the node has no default value - */ - public function getDefaultValue(); - - /** - * Normalizes the supplied value. - * - * @param mixed $value The value to normalize - * - * @return mixed The normalized value - */ - public function normalize($value); - - /** - * Merges two values together. - * - * @param mixed $leftSide - * @param mixed $rightSide - * - * @return mixed The merged values - */ - public function merge($leftSide, $rightSide); - - /** - * Finalizes a value. - * - * @param mixed $value The value to finalize - * - * @return mixed The finalized value - */ - public function finalize($value); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Processor.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Processor.php deleted file mode 100644 index a40d2c7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Processor.php +++ /dev/null @@ -1,127 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition; - -/** - * This class is the entry point for config normalization/merging/finalization. - * - * @author Johannes M. Schmitt - */ -class Processor -{ - /** - * Processes an array of configurations. - * - * @param NodeInterface $configTree The node tree describing the configuration - * @param array $configs An array of configuration items to process - * - * @return array The processed configuration - */ - public function process(NodeInterface $configTree, array $configs) - { - $configs = self::normalizeKeys($configs); - - $currentConfig = array(); - foreach ($configs as $config) { - $config = $configTree->normalize($config); - $currentConfig = $configTree->merge($currentConfig, $config); - } - - return $configTree->finalize($currentConfig); - } - - /** - * Processes an array of configurations. - * - * @param ConfigurationInterface $configuration The configuration class - * @param array $configs An array of configuration items to process - * - * @return array The processed configuration - */ - public function processConfiguration(ConfigurationInterface $configuration, array $configs) - { - return $this->process($configuration->getConfigTreeBuilder()->buildTree(), $configs); - } - - /** - * This method normalizes keys between the different configuration formats - * - * Namely, you mostly have foo_bar in YAML while you have foo-bar in XML. - * After running this method, all keys are normalized to foo_bar. - * - * If you have a mixed key like foo-bar_moo, it will not be altered. - * The key will also not be altered if the target key already exists. - * - * @param array $config - * - * @return array the config with normalized keys - */ - public static function normalizeKeys(array $config) - { - foreach ($config as $key => $value) { - if (is_array($value)) { - $config[$key] = self::normalizeKeys($value); - } - - if (false !== strpos($key, '-') && false === strpos($key, '_') && !array_key_exists($normalizedKey = str_replace('-', '_', $key), $config)) { - $config[$normalizedKey] = $config[$key]; - unset($config[$key]); - } - } - - return $config; - } - - /** - * Normalizes a configuration entry. - * - * This method returns a normalize configuration array for a given key - * to remove the differences due to the original format (YAML and XML mainly). - * - * Here is an example. - * - * The configuration is XML: - * - * - * - * - * And the same configuration in YAML: - * - * twig.extensions: ['twig.extension.foo', 'twig.extension.bar'] - * - * @param array $config A config array - * @param string $key The key to normalize - * @param string $plural The plural form of the key if it is irregular - * - * @return array - */ - public static function normalizeConfig($config, $key, $plural = null) - { - if (null === $plural) { - $plural = $key.'s'; - } - - $values = array(); - if (isset($config[$plural])) { - $values = $config[$plural]; - } elseif (isset($config[$key])) { - if (is_string($config[$key]) || !is_int(key($config[$key]))) { - // only one - $values = array($config[$key]); - } else { - $values = $config[$key]; - } - } - - return $values; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/PrototypeNodeInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/PrototypeNodeInterface.php deleted file mode 100644 index 8bbb84d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/PrototypeNodeInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition; - -/** - * This interface must be implemented by nodes which can be used as prototypes. - * - * @author Johannes M. Schmitt - */ -interface PrototypeNodeInterface extends NodeInterface -{ - /** - * Sets the name of the node. - * - * @param string $name The name of the node - */ - public function setName($name); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php deleted file mode 100644 index a2f8fba..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php +++ /dev/null @@ -1,342 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition; - -use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; -use Symfony\Component\Config\Definition\Exception\DuplicateKeyException; -use Symfony\Component\Config\Definition\Exception\UnsetKeyException; -use Symfony\Component\Config\Definition\Exception\Exception; - -/** - * Represents a prototyped Array node in the config tree. - * - * @author Johannes M. Schmitt - */ -class PrototypedArrayNode extends ArrayNode -{ - protected $prototype; - protected $keyAttribute; - protected $removeKeyAttribute; - protected $minNumberOfElements; - protected $defaultValue; - protected $defaultChildren; - - /** - * Constructor. - * - * @param string $name The Node's name - * @param NodeInterface $parent The node parent - */ - public function __construct($name, NodeInterface $parent = null) - { - parent::__construct($name, $parent); - - $this->minNumberOfElements = 0; - $this->defaultValue = array(); - } - - /** - * Sets the minimum number of elements that a prototype based node must - * contain. By default this is zero, meaning no elements. - * - * @param integer $number - */ - public function setMinNumberOfElements($number) - { - $this->minNumberOfElements = $number; - } - - /** - * Sets the attribute which value is to be used as key. - * - * This is useful when you have an indexed array that should be an - * associative array. You can select an item from within the array - * to be the key of the particular item. For example, if "id" is the - * "key", then: - * - * array( - * array('id' => 'my_name', 'foo' => 'bar'), - * ); - * - * becomes - * - * array( - * 'my_name' => array('foo' => 'bar'), - * ); - * - * If you'd like "'id' => 'my_name'" to still be present in the resulting - * array, then you can set the second argument of this method to false. - * - * @param string $attribute The name of the attribute which value is to be used as a key - * @param Boolean $remove Whether or not to remove the key - */ - public function setKeyAttribute($attribute, $remove = true) - { - $this->keyAttribute = $attribute; - $this->removeKeyAttribute = $remove; - } - - /** - * Retrieves the name of the attribute which value should be used as key. - * - * @return string The name of the attribute - */ - public function getKeyAttribute() - { - return $this->keyAttribute; - } - - /** - * Sets the default value of this node. - * - * @param string $value - * - * @throws \InvalidArgumentException if the default value is not an array - */ - public function setDefaultValue($value) - { - if (!is_array($value)) { - throw new \InvalidArgumentException($this->getPath().': the default value of an array node has to be an array.'); - } - - $this->defaultValue = $value; - } - - /** - * Checks if the node has a default value. - * - * @return Boolean - */ - public function hasDefaultValue() - { - return true; - } - - /** - * Adds default children when none are set. - * - * @param integer|string|array|null $children The number of children|The child name|The children names to be added - */ - public function setAddChildrenIfNoneSet($children = array('defaults')) - { - if (null === $children) { - $this->defaultChildren = array('defaults'); - } else { - $this->defaultChildren = is_integer($children) && $children > 0 ? range(1, $children) : (array) $children; - } - } - - /** - * Retrieves the default value. - * - * The default value could be either explicited or derived from the prototype - * default value. - * - * @return array The default value - */ - public function getDefaultValue() - { - if (null !== $this->defaultChildren) { - $default = $this->prototype->hasDefaultValue() ? $this->prototype->getDefaultValue() : array(); - $defaults = array(); - foreach (array_values($this->defaultChildren) as $i => $name) { - $defaults[null === $this->keyAttribute ? $i : $name] = $default; - } - - return $defaults; - } - - return $this->defaultValue; - } - - /** - * Sets the node prototype. - * - * @param PrototypeNodeInterface $node - */ - public function setPrototype(PrototypeNodeInterface $node) - { - $this->prototype = $node; - } - - /** - * Retrieves the prototype - * - * @return PrototypeNodeInterface The prototype - */ - public function getPrototype() - { - return $this->prototype; - } - - /** - * Disable adding concrete children for prototyped nodes. - * - * @param NodeInterface $node The child node to add - * - * @throws \RuntimeException Prototyped array nodes can't have concrete children. - */ - public function addChild(NodeInterface $node) - { - throw new Exception('A prototyped array node can not have concrete children.'); - } - - /** - * Finalizes the value of this node. - * - * @param mixed $value - * - * @return mixed The finalized value - * - * @throws UnsetKeyException - * @throws InvalidConfigurationException if the node doesn't have enough children - */ - protected function finalizeValue($value) - { - if (false === $value) { - $msg = sprintf('Unsetting key for path "%s", value: %s', $this->getPath(), json_encode($value)); - throw new UnsetKeyException($msg); - } - - foreach ($value as $k => $v) { - $this->prototype->setName($k); - try { - $value[$k] = $this->prototype->finalize($v); - } catch (UnsetKeyException $unset) { - unset($value[$k]); - } - } - - if (count($value) < $this->minNumberOfElements) { - $msg = sprintf('The path "%s" should have at least %d element(s) defined.', $this->getPath(), $this->minNumberOfElements); - $ex = new InvalidConfigurationException($msg); - $ex->setPath($this->getPath()); - - throw $ex; - } - - return $value; - } - - /** - * Normalizes the value. - * - * @param mixed $value The value to normalize - * - * @return mixed The normalized value - */ - protected function normalizeValue($value) - { - if (false === $value) { - return $value; - } - - $value = $this->remapXml($value); - - $isAssoc = array_keys($value) === range(0, count($value) -1); - $normalized = array(); - foreach ($value as $k => $v) { - if (null !== $this->keyAttribute && is_array($v)) { - if (!isset($v[$this->keyAttribute]) && is_int($k) && $isAssoc) { - $msg = sprintf('The attribute "%s" must be set for path "%s".', $this->keyAttribute, $this->getPath()); - $ex = new InvalidConfigurationException($msg); - $ex->setPath($this->getPath()); - - throw $ex; - } elseif (isset($v[$this->keyAttribute])) { - $k = $v[$this->keyAttribute]; - - // remove the key attribute when required - if ($this->removeKeyAttribute) { - unset($v[$this->keyAttribute]); - } - - // if only "value" is left - if (1 == count($v) && isset($v['value'])) { - $v = $v['value']; - } - } - - if (array_key_exists($k, $normalized)) { - $msg = sprintf('Duplicate key "%s" for path "%s".', $k, $this->getPath()); - $ex = new DuplicateKeyException($msg); - $ex->setPath($this->getPath()); - - throw $ex; - } - } - - $this->prototype->setName($k); - if (null !== $this->keyAttribute) { - $normalized[$k] = $this->prototype->normalize($v); - } else { - $normalized[] = $this->prototype->normalize($v); - } - } - - return $normalized; - } - - /** - * Merges values together. - * - * @param mixed $leftSide The left side to merge. - * @param mixed $rightSide The right side to merge. - * - * @return mixed The merged values - * - * @throws InvalidConfigurationException - * @throws \RuntimeException - */ - protected function mergeValues($leftSide, $rightSide) - { - if (false === $rightSide) { - // if this is still false after the last config has been merged the - // finalization pass will take care of removing this key entirely - return false; - } - - if (false === $leftSide || !$this->performDeepMerging) { - return $rightSide; - } - - foreach ($rightSide as $k => $v) { - // prototype, and key is irrelevant, so simply append the element - if (null === $this->keyAttribute) { - $leftSide[] = $v; - continue; - } - - // no conflict - if (!array_key_exists($k, $leftSide)) { - if (!$this->allowNewKeys) { - $ex = new InvalidConfigurationException(sprintf( - 'You are not allowed to define new elements for path "%s". ' . - 'Please define all elements for this path in one config file.', - $this->getPath() - )); - $ex->setPath($this->getPath()); - - throw $ex; - } - - $leftSide[$k] = $v; - continue; - } - - $this->prototype->setName($k); - $leftSide[$k] = $this->prototype->merge($leftSide[$k], $v); - } - - return $leftSide; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/ScalarNode.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/ScalarNode.php deleted file mode 100644 index 51141c4..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/ScalarNode.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition; - -use Symfony\Component\Config\Definition\VariableNode; -use Symfony\Component\Config\Definition\Exception\InvalidTypeException; - -/** - * This node represents a scalar value in the config tree. - * - * The following values are considered scalars: - * * booleans - * * strings - * * null - * * integers - * * floats - * - * @author Johannes M. Schmitt - */ -class ScalarNode extends VariableNode -{ - /** - * {@inheritDoc} - */ - protected function validateType($value) - { - if (!is_scalar($value) && null !== $value) { - $ex = new InvalidTypeException(sprintf( - 'Invalid type for path "%s". Expected scalar, but got %s.', - $this->getPath(), - gettype($value) - )); - $ex->setPath($this->getPath()); - - throw $ex; - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/VariableNode.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/VariableNode.php deleted file mode 100644 index 69dfea6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/VariableNode.php +++ /dev/null @@ -1,114 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition; - -use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; - -/** - * This node represents a value of variable type in the config tree. - * - * This node is intended for values of arbitrary type. - * Any PHP type is accepted as a value. - * - * @author Jeremy Mikola - */ -class VariableNode extends BaseNode implements PrototypeNodeInterface -{ - protected $defaultValueSet = false; - protected $defaultValue; - protected $allowEmptyValue = true; - - /** - * {@inheritDoc} - */ - public function setDefaultValue($value) - { - $this->defaultValueSet = true; - $this->defaultValue = $value; - } - - /** - * {@inheritDoc} - */ - public function hasDefaultValue() - { - return $this->defaultValueSet; - } - - /** - * {@inheritDoc} - */ - public function getDefaultValue() - { - return $this->defaultValue instanceof \Closure ? call_user_func($this->defaultValue) : $this->defaultValue; - } - - /** - * Sets if this node is allowed to have an empty value. - * - * @param Boolean $boolean True if this entity will accept empty values. - */ - public function setAllowEmptyValue($boolean) - { - $this->allowEmptyValue = (Boolean) $boolean; - } - - /** - * {@inheritDoc} - */ - public function setName($name) - { - $this->name = $name; - } - - /** - * {@inheritDoc} - */ - protected function validateType($value) - { - } - - /** - * {@inheritDoc} - */ - protected function finalizeValue($value) - { - if (!$this->allowEmptyValue && empty($value)) { - $ex = new InvalidConfigurationException(sprintf( - 'The path "%s" cannot contain an empty value, but got %s.', - $this->getPath(), - json_encode($value) - )); - $ex->setPath($this->getPath()); - - throw $ex; - } - - return $value; - } - - /** - * {@inheritDoc} - */ - protected function normalizeValue($value) - { - return $value; - } - - /** - * {@inheritDoc} - */ - protected function mergeValues($leftSide, $rightSide) - { - return $rightSide; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Exception/FileLoaderImportCircularReferenceException.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Exception/FileLoaderImportCircularReferenceException.php deleted file mode 100644 index b1ad442..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Exception/FileLoaderImportCircularReferenceException.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Exception; - -/** - * Exception class for when a circular reference is detected when importing resources. - * - * @author Fabien Potencier - */ -class FileLoaderImportCircularReferenceException extends FileLoaderLoadException -{ - public function __construct(array $resources, $code = null, $previous = null) - { - $message = sprintf('Circular reference detected in "%s" ("%s" > "%s").', $this->varToString($resources[0]), implode('" > "', $resources), $resources[0]); - - call_user_func('Exception::__construct', $message, $code, $previous); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Exception/FileLoaderLoadException.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Exception/FileLoaderLoadException.php deleted file mode 100644 index fcf61db..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Exception/FileLoaderLoadException.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Exception; - -/** - * Exception class for when a resource cannot be loaded or imported. - * - * @author Ryan Weaver - */ -class FileLoaderLoadException extends \Exception -{ - /** - * @param string $resource The resource that could not be imported - * @param string $sourceResource The original resource importing the new resource - * @param integer $code The error code - * @param Exception $previous A previous exception - */ - public function __construct($resource, $sourceResource = null, $code = null, $previous = null) - { - if (null === $sourceResource) { - $message = sprintf('Cannot load resource "%s".', $this->varToString($resource)); - } else { - $message = sprintf('Cannot import resource "%s" from "%s".', $this->varToString($resource), $this->varToString($sourceResource)); - } - - // Is the resource located inside a bundle? - if ('@' === $resource[0]) { - $parts = explode(DIRECTORY_SEPARATOR, $resource); - $bundle = substr($parts[0], 1); - $message .= ' '.sprintf('Make sure the "%s" bundle is correctly registered and loaded in the application kernel class.', $bundle); - } - - parent::__construct($message, $code, $previous); - } - - protected function varToString($var) - { - if (is_object($var)) { - return sprintf('Object(%s)', get_class($var)); - } - - if (is_array($var)) { - $a = array(); - foreach ($var as $k => $v) { - $a[] = sprintf('%s => %s', $k, $this->varToString($v)); - } - - return sprintf("Array(%s)", implode(', ', $a)); - } - - if (is_resource($var)) { - return sprintf('Resource(%s)', get_resource_type($var)); - } - - if (null === $var) { - return 'null'; - } - - if (false === $var) { - return 'false'; - } - - if (true === $var) { - return 'true'; - } - - return (string) $var; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/FileLocator.php b/vendor/symfony/symfony/src/Symfony/Component/Config/FileLocator.php deleted file mode 100644 index 7f9dadc..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/FileLocator.php +++ /dev/null @@ -1,99 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config; - -/** - * FileLocator uses an array of pre-defined paths to find files. - * - * @author Fabien Potencier - */ -class FileLocator implements FileLocatorInterface -{ - protected $paths; - - /** - * Constructor. - * - * @param string|array $paths A path or an array of paths where to look for resources - */ - public function __construct($paths = array()) - { - $this->paths = (array) $paths; - } - - /** - * Returns a full path for a given file name. - * - * @param mixed $name The file name to locate - * @param string $currentPath The current path - * @param Boolean $first Whether to return the first occurrence or an array of filenames - * - * @return string|array The full path to the file|An array of file paths - * - * @throws \InvalidArgumentException When file is not found - */ - public function locate($name, $currentPath = null, $first = true) - { - if ($this->isAbsolutePath($name)) { - if (!file_exists($name)) { - throw new \InvalidArgumentException(sprintf('The file "%s" does not exist.', $name)); - } - - return $name; - } - - $filepaths = array(); - if (null !== $currentPath && file_exists($file = $currentPath.DIRECTORY_SEPARATOR.$name)) { - if (true === $first) { - return $file; - } - $filepaths[] = $file; - } - - foreach ($this->paths as $path) { - if (file_exists($file = $path.DIRECTORY_SEPARATOR.$name)) { - if (true === $first) { - return $file; - } - $filepaths[] = $file; - } - } - - if (!$filepaths) { - throw new \InvalidArgumentException(sprintf('The file "%s" does not exist (in: %s%s).', $name, null !== $currentPath ? $currentPath.', ' : '', implode(', ', $this->paths))); - } - - return array_values(array_unique($filepaths)); - } - - /** - * Returns whether the file path is an absolute path. - * - * @param string $file A file path - * - * @return Boolean - */ - private function isAbsolutePath($file) - { - if ($file[0] == '/' || $file[0] == '\\' - || (strlen($file) > 3 && ctype_alpha($file[0]) - && $file[1] == ':' - && ($file[2] == '\\' || $file[2] == '/') - ) - || null !== parse_url($file, PHP_URL_SCHEME) - ) { - return true; - } - - return false; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/FileLocatorInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Config/FileLocatorInterface.php deleted file mode 100644 index 4ff19b4..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/FileLocatorInterface.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config; - -/** - * @author Fabien Potencier - */ -interface FileLocatorInterface -{ - /** - * Returns a full path for a given file name. - * - * @param mixed $name The file name to locate - * @param string $currentPath The current path - * @param Boolean $first Whether to return the first occurrence or an array of filenames - * - * @return string|array The full path to the file|An array of file paths - * - * @throws \InvalidArgumentException When file is not found - */ - public function locate($name, $currentPath = null, $first = true); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/LICENSE b/vendor/symfony/symfony/src/Symfony/Component/Config/LICENSE deleted file mode 100644 index cdffe7a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2012 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Loader/DelegatingLoader.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Loader/DelegatingLoader.php deleted file mode 100644 index 775946b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Loader/DelegatingLoader.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Loader; - -use Symfony\Component\Config\Exception\FileLoaderLoadException; - -/** - * DelegatingLoader delegates loading to other loaders using a loader resolver. - * - * This loader acts as an array of LoaderInterface objects - each having - * a chance to load a given resource (handled by the resolver) - * - * @author Fabien Potencier - */ -class DelegatingLoader extends Loader -{ - /** - * Constructor. - * - * @param LoaderResolverInterface $resolver A LoaderResolverInterface instance - */ - public function __construct(LoaderResolverInterface $resolver) - { - $this->resolver = $resolver; - } - - /** - * Loads a resource. - * - * @param mixed $resource A resource - * @param string $type The resource type - * - * @return mixed - * - * @throws FileLoaderLoadException if no loader is found. - */ - public function load($resource, $type = null) - { - if (false === $loader = $this->resolver->resolve($resource, $type)) { - throw new FileLoaderLoadException($resource); - } - - return $loader->load($resource, $type); - } - - /** - * {@inheritdoc} - */ - public function supports($resource, $type = null) - { - return false === $this->resolver->resolve($resource, $type) ? false : true; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Loader/FileLoader.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Loader/FileLoader.php deleted file mode 100644 index c4e3ced..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Loader/FileLoader.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Loader; - -use Symfony\Component\Config\FileLocatorInterface; -use Symfony\Component\Config\Exception\FileLoaderLoadException; -use Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException; - -/** - * FileLoader is the abstract class used by all built-in loaders that are file based. - * - * @author Fabien Potencier - */ -abstract class FileLoader extends Loader -{ - protected static $loading = array(); - - protected $locator; - - private $currentDir; - - /** - * Constructor. - * - * @param FileLocatorInterface $locator A FileLocatorInterface instance - */ - public function __construct(FileLocatorInterface $locator) - { - $this->locator = $locator; - } - - public function setCurrentDir($dir) - { - $this->currentDir = $dir; - } - - public function getLocator() - { - return $this->locator; - } - - /** - * Imports a resource. - * - * @param mixed $resource A Resource - * @param string $type The resource type - * @param Boolean $ignoreErrors Whether to ignore import errors or not - * @param string $sourceResource The original resource importing the new resource - * - * @return mixed - */ - public function import($resource, $type = null, $ignoreErrors = false, $sourceResource = null) - { - try { - $loader = $this->resolve($resource, $type); - - if ($loader instanceof FileLoader && null !== $this->currentDir) { - $resource = $this->locator->locate($resource, $this->currentDir); - } - - if (isset(self::$loading[$resource])) { - throw new FileLoaderImportCircularReferenceException(array_keys(self::$loading)); - } - self::$loading[$resource] = true; - - $ret = $loader->load($resource); - - unset(self::$loading[$resource]); - - return $ret; - } catch (FileLoaderImportCircularReferenceException $e) { - throw $e; - } catch (\Exception $e) { - if (!$ignoreErrors) { - // prevent embedded imports from nesting multiple exceptions - if ($e instanceof FileLoaderLoadException) { - throw $e; - } - - throw new FileLoaderLoadException($resource, $sourceResource, null, $e); - } - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Loader/Loader.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Loader/Loader.php deleted file mode 100644 index b9c174f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Loader/Loader.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Loader; - -use Symfony\Component\Config\Exception\FileLoaderLoadException; - -/** - * Loader is the abstract class used by all built-in loaders. - * - * @author Fabien Potencier - */ -abstract class Loader implements LoaderInterface -{ - protected $resolver; - - /** - * Gets the loader resolver. - * - * @return LoaderResolverInterface A LoaderResolverInterface instance - */ - public function getResolver() - { - return $this->resolver; - } - - /** - * Sets the loader resolver. - * - * @param LoaderResolverInterface $resolver A LoaderResolverInterface instance - */ - public function setResolver(LoaderResolverInterface $resolver) - { - $this->resolver = $resolver; - } - - /** - * Imports a resource. - * - * @param mixed $resource A Resource - * @param string $type The resource type - */ - public function import($resource, $type = null) - { - $this->resolve($resource)->load($resource, $type); - } - - /** - * Finds a loader able to load an imported resource. - * - * @param mixed $resource A Resource - * @param string $type The resource type - * - * @return LoaderInterface A LoaderInterface instance - * - * @throws FileLoaderLoadException if no loader is found - */ - public function resolve($resource, $type = null) - { - if ($this->supports($resource, $type)) { - return $this; - } - - $loader = null === $this->resolver ? false : $this->resolver->resolve($resource, $type); - - if (false === $loader) { - throw new FileLoaderLoadException($resource); - } - - return $loader; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Loader/LoaderInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Loader/LoaderInterface.php deleted file mode 100644 index d0ac5b8..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Loader/LoaderInterface.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Loader; - -/** - * LoaderInterface is the interface implemented by all loader classes. - * - * @author Fabien Potencier - */ -interface LoaderInterface -{ - /** - * Loads a resource. - * - * @param mixed $resource The resource - * @param string $type The resource type - */ - public function load($resource, $type = null); - - /** - * Returns true if this class supports the given resource. - * - * @param mixed $resource A resource - * @param string $type The resource type - * - * @return Boolean true if this class supports the given resource, false otherwise - */ - public function supports($resource, $type = null); - - /** - * Gets the loader resolver. - * - * @return LoaderResolverInterface A LoaderResolverInterface instance - */ - public function getResolver(); - - /** - * Sets the loader resolver. - * - * @param LoaderResolverInterface $resolver A LoaderResolverInterface instance - */ - public function setResolver(LoaderResolverInterface $resolver); - -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Loader/LoaderResolver.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Loader/LoaderResolver.php deleted file mode 100644 index 2340fe0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Loader/LoaderResolver.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Loader; - -/** - * LoaderResolver selects a loader for a given resource. - * - * A resource can be anything (e.g. a full path to a config file or a Closure). - * Each loader determines whether it can load a resource and how. - * - * @author Fabien Potencier - */ -class LoaderResolver implements LoaderResolverInterface -{ - /** - * @var LoaderInterface[] An array of LoaderInterface objects - */ - private $loaders; - - /** - * Constructor. - * - * @param LoaderInterface[] $loaders An array of loaders - */ - public function __construct(array $loaders = array()) - { - $this->loaders = array(); - foreach ($loaders as $loader) { - $this->addLoader($loader); - } - } - - /** - * Returns a loader able to load the resource. - * - * @param mixed $resource A resource - * @param string $type The resource type - * - * @return LoaderInterface|false A LoaderInterface instance - */ - public function resolve($resource, $type = null) - { - foreach ($this->loaders as $loader) { - if ($loader->supports($resource, $type)) { - return $loader; - } - } - - return false; - } - - /** - * Adds a loader. - * - * @param LoaderInterface $loader A LoaderInterface instance - */ - public function addLoader(LoaderInterface $loader) - { - $this->loaders[] = $loader; - $loader->setResolver($this); - } - - /** - * Returns the registered loaders. - * - * @return LoaderInterface[] An array of LoaderInterface instances - */ - public function getLoaders() - { - return $this->loaders; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Loader/LoaderResolverInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Loader/LoaderResolverInterface.php deleted file mode 100644 index 57d8781..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Loader/LoaderResolverInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Loader; - -/** - * LoaderResolverInterface selects a loader for a given resource. - * - * @author Fabien Potencier - */ -interface LoaderResolverInterface -{ - /** - * Returns a loader able to load the resource. - * - * @param mixed $resource A resource - * @param string $type The resource type - * - * @return LoaderInterface A LoaderInterface instance - */ - public function resolve($resource, $type = null); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/README.md b/vendor/symfony/symfony/src/Symfony/Component/Config/README.md deleted file mode 100644 index e87363d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Config Component -================ - -Config provides the infrastructure for loading configurations from different -data sources and optionally monitoring these data sources for changes. There -are additional tools for validating, normalizing and handling of defaults that -can optionally be used to convert from different formats to arrays. - -Resources ---------- - -You can run the unit tests with the following command: - - phpunit diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Resource/DirectoryResource.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Resource/DirectoryResource.php deleted file mode 100644 index 5ccd204..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Resource/DirectoryResource.php +++ /dev/null @@ -1,102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Resource; - -/** - * DirectoryResource represents a resources stored in a subdirectory tree. - * - * @author Fabien Potencier - */ -class DirectoryResource implements ResourceInterface, \Serializable -{ - private $resource; - private $pattern; - - /** - * Constructor. - * - * @param string $resource The file path to the resource - * @param string $pattern A pattern to restrict monitored files - */ - public function __construct($resource, $pattern = null) - { - $this->resource = $resource; - $this->pattern = $pattern; - } - - /** - * Returns a string representation of the Resource. - * - * @return string A string representation of the Resource - */ - public function __toString() - { - return (string) $this->resource; - } - - /** - * Returns the resource tied to this Resource. - * - * @return mixed The resource - */ - public function getResource() - { - return $this->resource; - } - - public function getPattern() - { - return $this->pattern; - } - - /** - * Returns true if the resource has not been updated since the given timestamp. - * - * @param integer $timestamp The last time the resource was loaded - * - * @return Boolean true if the resource has not been updated, false otherwise - */ - public function isFresh($timestamp) - { - if (!is_dir($this->resource)) { - return false; - } - - $newestMTime = filemtime($this->resource); - foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->resource), \RecursiveIteratorIterator::SELF_FIRST) as $file) { - // if regex filtering is enabled only check matching files - if ($this->pattern && $file->isFile() && !preg_match($this->pattern, $file->getBasename())) { - continue; - } - - // always monitor directories for changes, except the .. entries - // (otherwise deleted files wouldn't get detected) - if ($file->isDir() && '/..' === substr($file, -3)) { - continue; - } - - $newestMTime = max($file->getMTime(), $newestMTime); - } - - return $newestMTime < $timestamp; - } - - public function serialize() - { - return serialize(array($this->resource, $this->pattern)); - } - - public function unserialize($serialized) - { - list($this->resource, $this->pattern) = unserialize($serialized); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Resource/FileResource.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Resource/FileResource.php deleted file mode 100644 index 619f84b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Resource/FileResource.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Resource; - -/** - * FileResource represents a resource stored on the filesystem. - * - * The resource can be a file or a directory. - * - * @author Fabien Potencier - */ -class FileResource implements ResourceInterface, \Serializable -{ - private $resource; - - /** - * Constructor. - * - * @param string $resource The file path to the resource - */ - public function __construct($resource) - { - $this->resource = realpath($resource); - } - - /** - * Returns a string representation of the Resource. - * - * @return string A string representation of the Resource - */ - public function __toString() - { - return (string) $this->resource; - } - - /** - * Returns the resource tied to this Resource. - * - * @return mixed The resource - */ - public function getResource() - { - return $this->resource; - } - - /** - * Returns true if the resource has not been updated since the given timestamp. - * - * @param integer $timestamp The last time the resource was loaded - * - * @return Boolean true if the resource has not been updated, false otherwise - */ - public function isFresh($timestamp) - { - if (!file_exists($this->resource)) { - return false; - } - - return filemtime($this->resource) < $timestamp; - } - - public function serialize() - { - return serialize($this->resource); - } - - public function unserialize($serialized) - { - $this->resource = unserialize($serialized); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Resource/ResourceInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Resource/ResourceInterface.php deleted file mode 100644 index d624a57..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Resource/ResourceInterface.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Resource; - -/** - * ResourceInterface is the interface that must be implemented by all Resource classes. - * - * @author Fabien Potencier - */ -interface ResourceInterface -{ - /** - * Returns a string representation of the Resource. - * - * @return string A string representation of the Resource - */ - public function __toString(); - - /** - * Returns true if the resource has not been updated since the given timestamp. - * - * @param integer $timestamp The last time the resource was loaded - * - * @return Boolean true if the resource has not been updated, false otherwise - */ - public function isFresh($timestamp); - - /** - * Returns the resource tied to this Resource. - * - * @return mixed The resource - */ - public function getResource(); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/ArrayNodeTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/ArrayNodeTest.php deleted file mode 100644 index ef45ba8..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/ArrayNodeTest.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Definition; - -use Symfony\Component\Config\Definition\ArrayNode; - -class ArrayNodeTest extends \PHPUnit_Framework_TestCase -{ - /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidTypeException - */ - public function testNormalizeThrowsExceptionWhenFalseIsNotAllowed() - { - $node = new ArrayNode('root'); - $node->normalize(false); - } - - /** - * normalize() should protect against child values with no corresponding node - */ - public function testExceptionThrownOnUnrecognizedChild() - { - $node = new ArrayNode('root'); - - try { - $node->normalize(array('foo' => 'bar')); - $this->fail('An exception should have been throw for a bad child node'); - } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\Component\Config\Definition\Exception\InvalidConfigurationException', $e); - $this->assertEquals('Unrecognized options "foo" under "root"', $e->getMessage()); - } - } - - /** - * Tests that no exception is thrown for an unrecognized child if the - * ignoreExtraKeys option is set to true. - * - * Related to testExceptionThrownOnUnrecognizedChild - */ - public function testIgnoreExtraKeysNoException() - { - $node = new ArrayNode('roo'); - $node->setIgnoreExtraKeys(true); - - $node->normalize(array('foo' => 'bar')); - $this->assertTrue(true, 'No exception was thrown when setIgnoreExtraKeys is true'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/BooleanNodeTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/BooleanNodeTest.php deleted file mode 100644 index ea5fffe..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/BooleanNodeTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Definition; - -use Symfony\Component\Config\Definition\BooleanNode; - -class BooleanNodeTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getValidValues - */ - public function testNormalize($value) - { - $node = new BooleanNode('test'); - $this->assertSame($value, $node->normalize($value)); - } - - public function getValidValues() - { - return array( - array(false), - array(true), - ); - } - - /** - * @dataProvider getInvalidValues - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidTypeException - */ - public function testNormalizeThrowsExceptionOnInvalidValues($value) - { - $node = new BooleanNode('test'); - $node->normalize($value); - } - - public function getInvalidValues() - { - return array( - array(null), - array(''), - array('foo'), - array(0), - array(1), - array(0.0), - array(0.1), - array(array()), - array(array('foo' => 'bar')), - array(new \stdClass()), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php deleted file mode 100644 index 3831d70..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php +++ /dev/null @@ -1,159 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Definition\Builder; - -use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; -use Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition; -use Symfony\Component\Config\Definition\Exception\InvalidDefinitionException; - -class ArrayNodeDefinitionTest extends \PHPUnit_Framework_TestCase -{ - public function testAppendingSomeNode() - { - $parent = new ArrayNodeDefinition('root'); - $child = new ScalarNodeDefinition('child'); - - $parent - ->children() - ->scalarNode('foo')->end() - ->scalarNode('bar')->end() - ->end() - ->append($child); - - $this->assertCount(3, $this->getField($parent, 'children')); - $this->assertTrue(in_array($child, $this->getField($parent, 'children'))); - } - - /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidDefinitionException - * @dataProvider providePrototypeNodeSpecificCalls - */ - public function testPrototypeNodeSpecificOption($method, $args) - { - $node = new ArrayNodeDefinition('root'); - - call_user_func_array(array($node, $method), $args); - - $node->getNode(); - } - - public function providePrototypeNodeSpecificCalls() - { - return array( - array('defaultValue', array(array())), - array('addDefaultChildrenIfNoneSet', array()), - array('requiresAtLeastOneElement', array()), - array('useAttributeAsKey', array('foo')) - ); - } - - /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidDefinitionException - */ - public function testConcreteNodeSpecificOption() - { - $node = new ArrayNodeDefinition('root'); - $node->addDefaultsIfNotSet()->prototype('array'); - $node->getNode(); - } - - /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidDefinitionException - */ - public function testPrototypeNodesCantHaveADefaultValueWhenUsingDefaultChildren() - { - $node = new ArrayNodeDefinition('root'); - $node - ->defaultValue(array()) - ->addDefaultChildrenIfNoneSet('foo') - ->prototype('array') - ; - $node->getNode(); - } - - public function testPrototypedArrayNodeDefaultWhenUsingDefaultChildren() - { - $node = new ArrayNodeDefinition('root'); - $node - ->addDefaultChildrenIfNoneSet() - ->prototype('array') - ; - $tree = $node->getNode(); - $this->assertEquals(array(array()), $tree->getDefaultValue()); - } - - /** - * @dataProvider providePrototypedArrayNodeDefaults - */ - public function testPrototypedArrayNodeDefault($args, $shouldThrowWhenUsingAttrAsKey, $shouldThrowWhenNotUsingAttrAsKey, $defaults) - { - $node = new ArrayNodeDefinition('root'); - $node - ->addDefaultChildrenIfNoneSet($args) - ->prototype('array') - ; - - try { - $tree = $node->getNode(); - $this->assertFalse($shouldThrowWhenNotUsingAttrAsKey); - $this->assertEquals($defaults, $tree->getDefaultValue()); - } catch (InvalidDefinitionException $e) { - $this->assertTrue($shouldThrowWhenNotUsingAttrAsKey); - } - - $node = new ArrayNodeDefinition('root'); - $node - ->useAttributeAsKey('attr') - ->addDefaultChildrenIfNoneSet($args) - ->prototype('array') - ; - - try { - $tree = $node->getNode(); - $this->assertFalse($shouldThrowWhenUsingAttrAsKey); - $this->assertEquals($defaults, $tree->getDefaultValue()); - } catch (InvalidDefinitionException $e) { - $this->assertTrue($shouldThrowWhenUsingAttrAsKey); - } - } - - public function providePrototypedArrayNodeDefaults() - { - return array( - array(null, true, false, array(array())), - array(2, true, false, array(array(), array())), - array('2', false, true, array('2' => array())), - array('foo', false, true, array('foo' => array())), - array(array('foo'), false, true, array('foo' => array())), - array(array('foo', 'bar'), false, true, array('foo' => array(), 'bar' => array())), - ); - } - - public function testNestedPrototypedArrayNodes() - { - $node = new ArrayNodeDefinition('root'); - $node - ->addDefaultChildrenIfNoneSet() - ->prototype('array') - ->prototype('array') - ; - $node->getNode(); - } - - protected function getField($object, $field) - { - $reflection = new \ReflectionProperty($object, $field); - $reflection->setAccessible(true); - - return $reflection->getValue($object); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/EnumNodeDefinitionTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/EnumNodeDefinitionTest.php deleted file mode 100755 index b3c9f87..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/EnumNodeDefinitionTest.php +++ /dev/null @@ -1,37 +0,0 @@ -values() must be called with at least two distinct values. - */ - public function testNoDistinctValues() - { - $def = new EnumNodeDefinition('foo'); - $def->values(array('foo', 'foo')); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage You must call ->values() on enum nodes. - */ - public function testNoValuesPassed() - { - $def = new EnumNodeDefinition('foo'); - $def->getNode(); - } - - public function testGetNode() - { - $def = new EnumNodeDefinition('foo'); - $def->values(array('foo', 'bar')); - - $node = $def->getNode(); - $this->assertEquals(array('foo', 'bar'), $node->getValues()); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php deleted file mode 100644 index 11d20a4..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php +++ /dev/null @@ -1,211 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Definition\Builder; - -use Symfony\Component\Config\Definition\Builder\TreeBuilder; - -class ExprBuilderTest extends \PHPUnit_Framework_TestCase -{ - - public function testAlwaysExpression() - { - $test = $this->getTestBuilder() - ->always($this->returnClosure('new_value')) - ->end(); - - $this->assertFinalizedValueIs('new_value', $test); - } - - public function testIfTrueExpression() - { - $test = $this->getTestBuilder() - ->ifTrue() - ->then($this->returnClosure('new_value')) - ->end(); - $this->assertFinalizedValueIs('new_value', $test, array('key'=>true)); - - $test = $this->getTestBuilder() - ->ifTrue( function($v){ return true; }) - ->then($this->returnClosure('new_value')) - ->end(); - $this->assertFinalizedValueIs('new_value', $test); - - $test = $this->getTestBuilder() - ->ifTrue( function($v){ return false; }) - ->then($this->returnClosure('new_value')) - ->end(); - $this->assertFinalizedValueIs('value',$test); - } - - public function testIfStringExpression() - { - $test = $this->getTestBuilder() - ->ifString() - ->then($this->returnClosure('new_value')) - ->end(); - $this->assertFinalizedValueIs('new_value', $test); - - $test = $this->getTestBuilder() - ->ifString() - ->then($this->returnClosure('new_value')) - ->end(); - $this->assertFinalizedValueIs(45, $test, array('key'=>45)); - - } - - public function testIfNullExpression() - { - $test = $this->getTestBuilder() - ->ifNull() - ->then($this->returnClosure('new_value')) - ->end(); - $this->assertFinalizedValueIs('new_value', $test, array('key'=>null)); - - $test = $this->getTestBuilder() - ->ifNull() - ->then($this->returnClosure('new_value')) - ->end(); - $this->assertFinalizedValueIs('value', $test); - } - - public function testIfArrayExpression() - { - $test = $this->getTestBuilder() - ->ifArray() - ->then($this->returnClosure('new_value')) - ->end(); - $this->assertFinalizedValueIs('new_value', $test, array('key'=>array())); - - $test = $this->getTestBuilder() - ->ifArray() - ->then($this->returnClosure('new_value')) - ->end(); - $this->assertFinalizedValueIs('value', $test); - } - - public function testIfInArrayExpression() - { - $test = $this->getTestBuilder() - ->ifInArray(array('foo', 'bar', 'value')) - ->then($this->returnClosure('new_value')) - ->end(); - $this->assertFinalizedValueIs('new_value', $test); - - $test = $this->getTestBuilder() - ->ifInArray(array('foo', 'bar')) - ->then($this->returnClosure('new_value')) - ->end(); - $this->assertFinalizedValueIs('value', $test); - } - - public function testIfNotInArrayExpression() - { - $test = $this->getTestBuilder() - ->ifNotInArray(array('foo', 'bar')) - ->then($this->returnClosure('new_value')) - ->end(); - $this->assertFinalizedValueIs('new_value', $test); - - $test = $this->getTestBuilder() - ->ifNotInArray(array('foo', 'bar', 'value_from_config' )) - ->then($this->returnClosure('new_value')) - ->end(); - $this->assertFinalizedValueIs('new_value', $test); - } - - public function testThenEmptyArrayExpression() - { - $test = $this->getTestBuilder() - ->ifString() - ->thenEmptyArray() - ->end(); - $this->assertFinalizedValueIs(array(), $test); - } - - /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function testThenInvalid() - { - $test = $this->getTestBuilder() - ->ifString() - ->thenInvalid('Invalid value') - ->end(); - $this->finalizeTestBuilder($test); - } - - public function testThenUnsetExpression() - { - $test = $this->getTestBuilder() - ->ifString() - ->thenUnset() - ->end(); - $this->assertEquals(array(), $this->finalizeTestBuilder($test)); - } - - /** - * Create a test treebuilder with a variable node, and init the validation - * @return TreeBuilder - */ - protected function getTestBuilder() - { - $builder = new TreeBuilder(); - - return $builder - ->root('test') - ->children() - ->variableNode('key') - ->validate() - ; - } - - /** - * Close the validation process and finalize with the given config - * @param TreeBuilder $testBuilder The tree builder to finalize - * @param array $config The config you want to use for the finalization, if nothing provided - * a simple array('key'=>'value') will be used - * @return array The finalized config values - */ - protected function finalizeTestBuilder($testBuilder, $config=null) - { - return $testBuilder - ->end() - ->end() - ->end() - ->buildTree() - ->finalize($config === null ? array('key'=>'value') : $config) - ; - } - - /** - * Return a closure that will return the given value - * @param $val The value that the closure must return - * @return Closure - */ - protected function returnClosure($val) - { - return function($v) use ($val) { - return $val; - }; - } - - /** - * Assert that the given test builder, will return the given value - * @param mixed $value The value to test - * @param TreeBuilder $treeBuilder The tree builder to finalize - * @param mixed $config The config values that new to be finalized - */ - protected function assertFinalizedValueIs($value, $treeBuilder, $config=null) - { - $this->assertEquals(array('key'=>$value), $this->finalizeTestBuilder($treeBuilder, $config)); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/NodeBuilderTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/NodeBuilderTest.php deleted file mode 100644 index c829591..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/NodeBuilderTest.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Definition\Builder; - -use Symfony\Component\Config\Definition\Builder\NodeBuilder as BaseNodeBuilder; -use Symfony\Component\Config\Definition\Builder\VariableNodeDefinition as BaseVariableNodeDefinition; - -class NodeBuilderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @expectedException \RuntimeException - */ - public function testThrowsAnExceptionWhenTryingToCreateANonRegisteredNodeType() - { - $builder = new BaseNodeBuilder(); - $builder->node('', 'foobar'); - } - - /** - * @expectedException \RuntimeException - */ - public function testThrowsAnExceptionWhenTheNodeClassIsNotFound() - { - $builder = new BaseNodeBuilder(); - $builder - ->setNodeClass('noclasstype', '\\foo\\bar\\noclass') - ->node('', 'noclasstype'); - } - - public function testAddingANewNodeType() - { - $class = __NAMESPACE__.'\\SomeNodeDefinition'; - - $builder = new BaseNodeBuilder(); - $node = $builder - ->setNodeClass('newtype', $class) - ->node('', 'newtype'); - - $this->assertEquals(get_class($node), $class); - } - - public function testOverridingAnExistingNodeType() - { - $class = __NAMESPACE__.'\\SomeNodeDefinition'; - - $builder = new BaseNodeBuilder(); - $node = $builder - ->setNodeClass('variable', $class) - ->node('', 'variable'); - - $this->assertEquals(get_class($node), $class); - } - - public function testNodeTypesAreNotCaseSensitive() - { - $builder = new BaseNodeBuilder(); - - $node1 = $builder->node('', 'VaRiAbLe'); - $node2 = $builder->node('', 'variable'); - - $this->assertEquals(get_class($node1), get_class($node2)); - - $builder->setNodeClass('CuStOm', __NAMESPACE__.'\\SomeNodeDefinition'); - - $node1 = $builder->node('', 'CUSTOM'); - $node2 = $builder->node('', 'custom'); - - $this->assertEquals(get_class($node1), get_class($node2)); - } -} - -class SomeNodeDefinition extends BaseVariableNodeDefinition -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php deleted file mode 100644 index 8afbaf8..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php +++ /dev/null @@ -1,127 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Definition\Builder; - -use Symfony\Component\Config\Tests\Definition\Builder\NodeBuilder as CustomNodeBuilder; -use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\Config\Definition\Builder\NodeBuilder; - -require __DIR__.'/../../Fixtures/Builder/NodeBuilder.php'; -require __DIR__.'/../../Fixtures/Builder/BarNodeDefinition.php'; -require __DIR__.'/../../Fixtures/Builder/VariableNodeDefinition.php'; - -class TreeBuilderTest extends \PHPUnit_Framework_TestCase -{ - public function testUsingACustomNodeBuilder() - { - $builder = new TreeBuilder(); - $root = $builder->root('custom', 'array', new CustomNodeBuilder()); - - $nodeBuilder = $root->children(); - - $this->assertEquals(get_class($nodeBuilder), 'Symfony\Component\Config\Tests\Definition\Builder\NodeBuilder'); - - $nodeBuilder = $nodeBuilder->arrayNode('deeper')->children(); - - $this->assertEquals(get_class($nodeBuilder), 'Symfony\Component\Config\Tests\Definition\Builder\NodeBuilder'); - } - - public function testOverrideABuiltInNodeType() - { - $builder = new TreeBuilder(); - $root = $builder->root('override', 'array', new CustomNodeBuilder()); - - $definition = $root->children()->variableNode('variable'); - - $this->assertEquals(get_class($definition), 'Symfony\Component\Config\Tests\Definition\Builder\VariableNodeDefinition'); - } - - public function testAddANodeType() - { - $builder = new TreeBuilder(); - $root = $builder->root('override', 'array', new CustomNodeBuilder()); - - $definition = $root->children()->barNode('variable'); - - $this->assertEquals(get_class($definition), 'Symfony\Component\Config\Tests\Definition\Builder\BarNodeDefinition'); - } - - public function testCreateABuiltInNodeTypeWithACustomNodeBuilder() - { - $builder = new TreeBuilder(); - $root = $builder->root('builtin', 'array', new CustomNodeBuilder()); - - $definition = $root->children()->booleanNode('boolean'); - - $this->assertEquals(get_class($definition), 'Symfony\Component\Config\Definition\Builder\BooleanNodeDefinition'); - } - - public function testPrototypedArrayNodeUseTheCustomNodeBuilder() - { - $builder = new TreeBuilder(); - $root = $builder->root('override', 'array', new CustomNodeBuilder()); - - $root->prototype('bar')->end(); - } - - public function testAnExtendedNodeBuilderGetsPropagatedToTheChildren() - { - $builder = new TreeBuilder(); - - $builder->root('propagation') - ->children() - ->setNodeClass('extended', 'Symfony\Component\Config\Tests\Definition\Builder\VariableNodeDefinition') - ->node('foo', 'extended')->end() - ->arrayNode('child') - ->children() - ->node('foo', 'extended') - ->end() - ->end() - ->end() - ->end(); - } - - public function testDefinitionInfoGetsTransferredToNode() - { - $builder = new TreeBuilder(); - - $builder->root('test')->info('root info') - ->children() - ->node('child', 'variable')->info('child info')->defaultValue('default') - ->end() - ->end(); - - $tree = $builder->buildTree(); - $children = $tree->getChildren(); - - $this->assertEquals('root info', $tree->getInfo()); - $this->assertEquals('child info', $children['child']->getInfo()); - } - - public function testDefinitionExampleGetsTransferredToNode() - { - $builder = new TreeBuilder(); - - $builder->root('test') - ->example(array('key' => 'value')) - ->children() - ->node('child', 'variable')->info('child info')->defaultValue('default')->example('example') - ->end() - ->end(); - - $tree = $builder->buildTree(); - $children = $tree->getChildren(); - - $this->assertTrue(is_array($tree->getExample())); - $this->assertEquals('example', $children['child']->getExample()); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/EnumNodeTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/EnumNodeTest.php deleted file mode 100755 index 8e3d66a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/EnumNodeTest.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Definition; - -use Symfony\Component\Config\Definition\EnumNode; - -class EnumNodeTest extends \PHPUnit_Framework_TestCase -{ - public function testFinalizeValue() - { - $node = new EnumNode('foo', null, array('foo', 'bar')); - $this->assertSame('foo', $node->finalize('foo')); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testConstructionWithOneValue() - { - new EnumNode('foo', null, array('foo', 'foo')); - } - - /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - * @expectedExceptionMessage The value "foobar" is not allowed for path "foo". Permissible values: "foo", "bar" - */ - public function testFinalizeWithInvalidValue() - { - $node = new EnumNode('foo', null, array('foo', 'bar')); - $node->finalize('foobar'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/FinalizationTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/FinalizationTest.php deleted file mode 100644 index 19fc347..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/FinalizationTest.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Definition; - -use Symfony\Component\Config\Definition\Builder\TreeBuilder; -use Symfony\Component\Config\Definition\Processor; -use Symfony\Component\Config\Definition\NodeInterface; - -class FinalizationTest extends \PHPUnit_Framework_TestCase -{ - public function testUnsetKeyWithDeepHierarchy() - { - $tb = new TreeBuilder(); - $tree = $tb - ->root('config', 'array') - ->children() - ->node('level1', 'array') - ->canBeUnset() - ->children() - ->node('level2', 'array') - ->canBeUnset() - ->children() - ->node('somevalue', 'scalar')->end() - ->node('anothervalue', 'scalar')->end() - ->end() - ->end() - ->node('level1_scalar', 'scalar')->end() - ->end() - ->end() - ->end() - ->end() - ->buildTree() - ; - - $a = array( - 'level1' => array( - 'level2' => array( - 'somevalue' => 'foo', - 'anothervalue' => 'bar', - ), - 'level1_scalar' => 'foo', - ), - ); - - $b = array( - 'level1' => array( - 'level2' => false, - ), - ); - - $this->assertEquals(array( - 'level1' => array( - 'level1_scalar' => 'foo', - ), - ), $this->process($tree, array($a, $b))); - } - - protected function process(NodeInterface $tree, array $configs) - { - $processor = new Processor(); - - return $processor->process($tree, $configs); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/MergeTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/MergeTest.php deleted file mode 100644 index d90a3a9..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/MergeTest.php +++ /dev/null @@ -1,195 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Definition; - -use Symfony\Component\Config\Definition\Builder\TreeBuilder; - -class MergeTest extends \PHPUnit_Framework_TestCase -{ - /** - * @expectedException Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException - */ - public function testForbiddenOverwrite() - { - $tb = new TreeBuilder(); - $tree = $tb - ->root('root', 'array') - ->children() - ->node('foo', 'scalar') - ->cannotBeOverwritten() - ->end() - ->end() - ->end() - ->buildTree() - ; - - $a = array( - 'foo' => 'bar', - ); - - $b = array( - 'foo' => 'moo', - ); - - $tree->merge($a, $b); - } - - public function testUnsetKey() - { - $tb = new TreeBuilder(); - $tree = $tb - ->root('root', 'array') - ->children() - ->node('foo', 'scalar')->end() - ->node('bar', 'scalar')->end() - ->node('unsettable', 'array') - ->canBeUnset() - ->children() - ->node('foo', 'scalar')->end() - ->node('bar', 'scalar')->end() - ->end() - ->end() - ->node('unsetted', 'array') - ->canBeUnset() - ->prototype('scalar')->end() - ->end() - ->end() - ->end() - ->buildTree() - ; - - $a = array( - 'foo' => 'bar', - 'unsettable' => array( - 'foo' => 'a', - 'bar' => 'b', - ), - 'unsetted' => false, - ); - - $b = array( - 'foo' => 'moo', - 'bar' => 'b', - 'unsettable' => false, - 'unsetted' => array('a', 'b'), - ); - - $this->assertEquals(array( - 'foo' => 'moo', - 'bar' => 'b', - 'unsettable' => false, - 'unsetted' => array('a', 'b'), - ), $tree->merge($a, $b)); - } - - /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function testDoesNotAllowNewKeysInSubsequentConfigs() - { - $tb = new TreeBuilder(); - $tree = $tb - ->root('config', 'array') - ->children() - ->node('test', 'array') - ->disallowNewKeysInSubsequentConfigs() - ->useAttributeAsKey('key') - ->prototype('array') - ->children() - ->node('value', 'scalar')->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->buildTree(); - - $a = array( - 'test' => array( - 'a' => array('value' => 'foo') - ) - ); - - $b = array( - 'test' => array( - 'b' => array('value' => 'foo') - ) - ); - - $tree->merge($a, $b); - } - - public function testPerformsNoDeepMerging() - { - $tb = new TreeBuilder(); - - $tree = $tb - ->root('config', 'array') - ->children() - ->node('no_deep_merging', 'array') - ->performNoDeepMerging() - ->children() - ->node('foo', 'scalar')->end() - ->node('bar', 'scalar')->end() - ->end() - ->end() - ->end() - ->end() - ->buildTree() - ; - - $a = array( - 'no_deep_merging' => array( - 'foo' => 'a', - 'bar' => 'b', - ), - ); - - $b = array( - 'no_deep_merging' => array( - 'c' => 'd', - ) - ); - - $this->assertEquals(array( - 'no_deep_merging' => array( - 'c' => 'd', - ) - ), $tree->merge($a, $b)); - } - - public function testPrototypeWithoutAKeyAttribute() - { - $tb = new TreeBuilder(); - - $tree = $tb - ->root('config', 'array') - ->children() - ->arrayNode('append_elements') - ->prototype('scalar')->end() - ->end() - ->end() - ->end() - ->buildTree() - ; - - $a = array( - 'append_elements' => array('a', 'b'), - ); - - $b = array( - 'append_elements' => array('c', 'd'), - ); - - $this->assertEquals(array('append_elements' => array('a', 'b', 'c', 'd')), $tree->merge($a, $b)); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/NormalizationTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/NormalizationTest.php deleted file mode 100644 index ee49154..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/NormalizationTest.php +++ /dev/null @@ -1,210 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Definition; - -use Symfony\Component\Config\Definition\NodeInterface; -use Symfony\Component\Config\Definition\Builder\TreeBuilder; - -class NormalizerTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getEncoderTests - */ - public function testNormalizeEncoders($denormalized) - { - $tb = new TreeBuilder(); - $tree = $tb - ->root('root_name', 'array') - ->fixXmlConfig('encoder') - ->children() - ->node('encoders', 'array') - ->useAttributeAsKey('class') - ->prototype('array') - ->beforeNormalization()->ifString()->then(function($v) { return array('algorithm' => $v); })->end() - ->children() - ->node('algorithm', 'scalar')->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->buildTree() - ; - - $normalized = array( - 'encoders' => array( - 'foo' => array('algorithm' => 'plaintext'), - ), - ); - - $this->assertNormalized($tree, $denormalized, $normalized); - } - - public function getEncoderTests() - { - $configs = array(); - - // XML - $configs[] = array( - 'encoder' => array( - array('class' => 'foo', 'algorithm' => 'plaintext'), - ), - ); - - // XML when only one element of this type - $configs[] = array( - 'encoder' => array('class' => 'foo', 'algorithm' => 'plaintext'), - ); - - // YAML/PHP - $configs[] = array( - 'encoders' => array( - array('class' => 'foo', 'algorithm' => 'plaintext'), - ), - ); - - // YAML/PHP - $configs[] = array( - 'encoders' => array( - 'foo' => 'plaintext', - ), - ); - - // YAML/PHP - $configs[] = array( - 'encoders' => array( - 'foo' => array('algorithm' => 'plaintext'), - ), - ); - - return array_map(function($v) { - return array($v); - }, $configs); - } - - /** - * @dataProvider getAnonymousKeysTests - */ - public function testAnonymousKeysArray($denormalized) - { - $tb = new TreeBuilder(); - $tree = $tb - ->root('root', 'array') - ->children() - ->node('logout', 'array') - ->fixXmlConfig('handler') - ->children() - ->node('handlers', 'array') - ->prototype('scalar')->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->buildTree() - ; - - $normalized = array('logout' => array('handlers' => array('a', 'b', 'c'))); - - $this->assertNormalized($tree, $denormalized, $normalized); - } - - public function getAnonymousKeysTests() - { - $configs = array(); - - $configs[] = array( - 'logout' => array( - 'handlers' => array('a', 'b', 'c'), - ), - ); - - $configs[] = array( - 'logout' => array( - 'handler' => array('a', 'b', 'c'), - ), - ); - - return array_map(function($v) { return array($v); }, $configs); - } - - /** - * @dataProvider getNumericKeysTests - */ - public function testNumericKeysAsAttributes($denormalized) - { - $normalized = array( - 'thing' => array(42 => array('foo', 'bar'), 1337 => array('baz', 'qux')), - ); - - $this->assertNormalized($this->getNumericKeysTestTree(), $denormalized, $normalized); - } - - public function getNumericKeysTests() - { - $configs = array(); - - $configs[] = array( - 'thing' => array( - 42 => array('foo', 'bar'), 1337 => array('baz', 'qux'), - ), - ); - - $configs[] = array( - 'thing' => array( - array('foo', 'bar', 'id' => 42), array('baz', 'qux', 'id' => 1337), - ), - ); - - return array_map(function($v) { return array($v); }, $configs); - } - - /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - * @expectedExceptionMessage The attribute "id" must be set for path "root.thing". - */ - public function testNonAssociativeArrayThrowsExceptionIfAttributeNotSet() - { - $denormalized = array( - 'thing' => array( - array('foo', 'bar'), array('baz', 'qux') - ) - ); - - $this->assertNormalized($this->getNumericKeysTestTree(), $denormalized, array()); - } - - public static function assertNormalized(NodeInterface $tree, $denormalized, $normalized) - { - self::assertSame($normalized, $tree->normalize($denormalized)); - } - - private function getNumericKeysTestTree() - { - $tb = new TreeBuilder(); - $tree = $tb - ->root('root', 'array') - ->children() - ->node('thing', 'array') - ->useAttributeAsKey('id') - ->prototype('array') - ->prototype('scalar')->end() - ->end() - ->end() - ->end() - ->end() - ->buildTree() - ; - - return $tree; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/ProcessorTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/ProcessorTest.php deleted file mode 100644 index 56368ac..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/ProcessorTest.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Definition; - -use Symfony\Component\Config\Definition\Processor; - -class ProcessorTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getKeyNormalizationTests - */ - public function testNormalizeKeys($denormalized, $normalized) - { - $this->assertSame($normalized, Processor::normalizeKeys($denormalized)); - } - - public function getKeyNormalizationTests() - { - return array( - array( - array('foo-bar' => 'foo'), - array('foo_bar' => 'foo'), - ), - array( - array('foo-bar_moo' => 'foo'), - array('foo-bar_moo' => 'foo'), - ), - array( - array('foo-bar' => null, 'foo_bar' => 'foo'), - array('foo-bar' => null, 'foo_bar' => 'foo'), - ), - array( - array('foo-bar' => array('foo-bar' => 'foo')), - array('foo_bar' => array('foo_bar' => 'foo')), - ), - array( - array('foo_bar' => array('foo-bar' => 'foo')), - array('foo_bar' => array('foo_bar' => 'foo')), - ) - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/PrototypedArrayNodeTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/PrototypedArrayNodeTest.php deleted file mode 100644 index 31d3c89..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/PrototypedArrayNodeTest.php +++ /dev/null @@ -1,181 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Definition; - -use Symfony\Component\Config\Definition\PrototypedArrayNode; -use Symfony\Component\Config\Definition\ArrayNode; -use Symfony\Component\Config\Definition\ScalarNode; - -class PrototypedArrayNodeTest extends \PHPUnit_Framework_TestCase -{ - - public function testGetDefaultValueReturnsAnEmptyArrayForPrototypes() - { - $node = new PrototypedArrayNode('root'); - $prototype = new ArrayNode(null, $node); - $node->setPrototype($prototype); - $this->assertEmpty($node->getDefaultValue()); - } - - public function testGetDefaultValueReturnsDefaultValueForPrototypes() - { - $node = new PrototypedArrayNode('root'); - $prototype = new ArrayNode(null, $node); - $node->setPrototype($prototype); - $node->setDefaultValue(array ('test')); - $this->assertEquals(array ('test'), $node->getDefaultValue()); - } - - // a remapped key (e.g. "mapping" -> "mappings") should be unset after being used - public function testRemappedKeysAreUnset() - { - $node = new ArrayNode('root'); - $mappingsNode = new PrototypedArrayNode('mappings'); - $node->addChild($mappingsNode); - - // each item under mappings is just a scalar - $prototype = new ScalarNode(null, $mappingsNode); - $mappingsNode->setPrototype($prototype); - - $remappings = array(); - $remappings[] = array('mapping', 'mappings'); - $node->setXmlRemappings($remappings); - - $normalized = $node->normalize(array('mapping' => array('foo', 'bar'))); - $this->assertEquals(array('mappings' => array('foo', 'bar')), $normalized); - } - - /** - * Tests that when a key attribute is mapped, that key is removed from the array: - * - * - * - * - * The above should finally be mapped to an array that looks like this - * (because "id" is the key attribute). - * - * array( - * 'things' => array( - * 'option1' => 'foo', - * 'option2' => 'bar', - * ) - * ) - */ - public function testMappedAttributeKeyIsRemoved() - { - $node = new PrototypedArrayNode('root'); - $node->setKeyAttribute('id', true); - - // each item under the root is an array, with one scalar item - $prototype = new ArrayNode(null, $node); - $prototype->addChild(new ScalarNode('foo')); - $node->setPrototype($prototype); - - $children = array(); - $children[] = array('id' => 'item_name', 'foo' => 'bar'); - $normalized = $node->normalize($children); - - $expected = array(); - $expected['item_name'] = array('foo' => 'bar'); - $this->assertEquals($expected, $normalized); - } - - /** - * Tests the opposite of the testMappedAttributeKeyIsRemoved because - * the removal can be toggled with an option. - */ - public function testMappedAttributeKeyNotRemoved() - { - $node = new PrototypedArrayNode('root'); - $node->setKeyAttribute('id', false); - - // each item under the root is an array, with two scalar items - $prototype = new ArrayNode(null, $node); - $prototype->addChild(new ScalarNode('foo')); - $prototype->addChild(new ScalarNode('id')); // the key attribute will remain - $node->setPrototype($prototype); - - $children = array(); - $children[] = array('id' => 'item_name', 'foo' => 'bar'); - $normalized = $node->normalize($children); - - $expected = array(); - $expected['item_name'] = array('id' => 'item_name', 'foo' => 'bar'); - $this->assertEquals($expected, $normalized); - } - - public function testAddDefaultChildren() - { - $node = $this->getPrototypeNodeWithDefaultChildren(); - $node->setAddChildrenIfNoneSet(); - $this->assertTrue($node->hasDefaultValue()); - $this->assertEquals(array(array('foo' => 'bar')), $node->getDefaultValue()); - - $node = $this->getPrototypeNodeWithDefaultChildren(); - $node->setKeyAttribute('foobar'); - $node->setAddChildrenIfNoneSet(); - $this->assertTrue($node->hasDefaultValue()); - $this->assertEquals(array('defaults' => array('foo' => 'bar')), $node->getDefaultValue()); - - $node = $this->getPrototypeNodeWithDefaultChildren(); - $node->setKeyAttribute('foobar'); - $node->setAddChildrenIfNoneSet('defaultkey'); - $this->assertTrue($node->hasDefaultValue()); - $this->assertEquals(array('defaultkey' => array('foo' => 'bar')), $node->getDefaultValue()); - - $node = $this->getPrototypeNodeWithDefaultChildren(); - $node->setKeyAttribute('foobar'); - $node->setAddChildrenIfNoneSet(array('defaultkey')); - $this->assertTrue($node->hasDefaultValue()); - $this->assertEquals(array('defaultkey' => array('foo' => 'bar')), $node->getDefaultValue()); - - $node = $this->getPrototypeNodeWithDefaultChildren(); - $node->setKeyAttribute('foobar'); - $node->setAddChildrenIfNoneSet(array('dk1', 'dk2')); - $this->assertTrue($node->hasDefaultValue()); - $this->assertEquals(array('dk1' => array('foo' => 'bar'), 'dk2' => array('foo' => 'bar')), $node->getDefaultValue()); - - $node = $this->getPrototypeNodeWithDefaultChildren(); - $node->setAddChildrenIfNoneSet(array(5, 6)); - $this->assertTrue($node->hasDefaultValue()); - $this->assertEquals(array(0 => array('foo' => 'bar'), 1 => array('foo' => 'bar')), $node->getDefaultValue()); - - $node = $this->getPrototypeNodeWithDefaultChildren(); - $node->setAddChildrenIfNoneSet(2); - $this->assertTrue($node->hasDefaultValue()); - $this->assertEquals(array(array('foo' => 'bar'), array('foo' => 'bar')), $node->getDefaultValue()); - } - - public function testDefaultChildrenWinsOverDefaultValue() - { - $node = $this->getPrototypeNodeWithDefaultChildren(); - $node->setAddChildrenIfNoneSet(); - $node->setDefaultValue(array('bar' => 'foo')); - $this->assertTrue($node->hasDefaultValue()); - $this->assertEquals(array(array('foo' => 'bar')), $node->getDefaultValue()); - } - - protected function getPrototypeNodeWithDefaultChildren() - { - $node = new PrototypedArrayNode('root'); - $prototype = new ArrayNode(null, $node); - $child = new ScalarNode('foo'); - $child->setDefaultValue('bar'); - $prototype->addChild($child); - $prototype->setAddIfNotSet(true); - $node->setPrototype($prototype); - - return $node; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/ScalarNodeTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/ScalarNodeTest.php deleted file mode 100644 index 91e47ef..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/ScalarNodeTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Definition; - -use Symfony\Component\Config\Definition\ScalarNode; - -class ScalarNodeTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getValidValues - */ - public function testNormalize($value) - { - $node = new ScalarNode('test'); - $this->assertSame($value, $node->normalize($value)); - } - - public function getValidValues() - { - return array( - array(false), - array(true), - array(null), - array(''), - array('foo'), - array(0), - array(1), - array(0.0), - array(0.1), - ); - } - - /** - * @dataProvider getInvalidValues - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidTypeException - */ - public function testNormalizeThrowsExceptionOnInvalidValues($value) - { - $node = new ScalarNode('test'); - $node->normalize($value); - } - - public function getInvalidValues() - { - return array( - array(array()), - array(array('foo' => 'bar')), - array(new \stdClass()), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/FileLocatorTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/FileLocatorTest.php deleted file mode 100644 index 8e8f442..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/FileLocatorTest.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests; - -use Symfony\Component\Config\FileLocator; - -class FileLocatorTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getIsAbsolutePathTests - */ - public function testIsAbsolutePath($path) - { - $loader = new FileLocator(array()); - $r = new \ReflectionObject($loader); - $m = $r->getMethod('isAbsolutePath'); - $m->setAccessible(true); - - $this->assertTrue($m->invoke($loader, $path), '->isAbsolutePath() returns true for an absolute path'); - } - - public function getIsAbsolutePathTests() - { - return array( - array('/foo.xml'), - array('c:\\\\foo.xml'), - array('c:/foo.xml'), - array('\\server\\foo.xml'), - array('https://server/foo.xml'), - array('phar://server/foo.xml'), - ); - } - - public function testLocate() - { - $loader = new FileLocator(__DIR__.'/Fixtures'); - - $this->assertEquals( - __DIR__.DIRECTORY_SEPARATOR.'FileLocatorTest.php', - $loader->locate('FileLocatorTest.php', __DIR__), - '->locate() returns the absolute filename if the file exists in the given path' - ); - - $this->assertEquals( - __DIR__.'/Fixtures'.DIRECTORY_SEPARATOR.'foo.xml', - $loader->locate('foo.xml', __DIR__), - '->locate() returns the absolute filename if the file exists in one of the paths given in the constructor' - ); - - $this->assertEquals( - __DIR__.'/Fixtures'.DIRECTORY_SEPARATOR.'foo.xml', - $loader->locate(__DIR__.'/Fixtures'.DIRECTORY_SEPARATOR.'foo.xml', __DIR__), - '->locate() returns the absolute filename if the file exists in one of the paths given in the constructor' - ); - - $loader = new FileLocator(array(__DIR__.'/Fixtures', __DIR__.'/Fixtures/Again')); - - $this->assertEquals( - array(__DIR__.'/Fixtures'.DIRECTORY_SEPARATOR.'foo.xml', __DIR__.'/Fixtures/Again'.DIRECTORY_SEPARATOR.'foo.xml'), - $loader->locate('foo.xml', __DIR__, false), - '->locate() returns an array of absolute filenames' - ); - - $this->assertEquals( - array(__DIR__.'/Fixtures'.DIRECTORY_SEPARATOR.'foo.xml', __DIR__.'/Fixtures/Again'.DIRECTORY_SEPARATOR.'foo.xml'), - $loader->locate('foo.xml', __DIR__.'/Fixtures', false), - '->locate() returns an array of absolute filenames' - ); - - $loader = new FileLocator(__DIR__.'/Fixtures/Again'); - - $this->assertEquals( - array(__DIR__.'/Fixtures'.DIRECTORY_SEPARATOR.'foo.xml', __DIR__.'/Fixtures/Again'.DIRECTORY_SEPARATOR.'foo.xml'), - $loader->locate('foo.xml', __DIR__.'/Fixtures', false), - '->locate() returns an array of absolute filenames' - ); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testLocateThrowsAnExceptionIfTheFileDoesNotExists() - { - $loader = new FileLocator(array(__DIR__.'/Fixtures')); - - $loader->locate('foobar.xml', __DIR__); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testLocateThrowsAnExceptionIfTheFileDoesNotExistsInAbsolutePath() - { - $loader = new FileLocator(array(__DIR__.'/Fixtures')); - - $loader->locate(__DIR__.'/Fixtures/foobar.xml', __DIR__); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Fixtures/Again/foo.xml b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Fixtures/Again/foo.xml deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Fixtures/Builder/BarNodeDefinition.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Fixtures/Builder/BarNodeDefinition.php deleted file mode 100644 index 47701c1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Fixtures/Builder/BarNodeDefinition.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Definition\Builder; - -use Symfony\Component\Config\Definition\Builder\NodeDefinition; - -class BarNodeDefinition extends NodeDefinition -{ - protected function createNode() - { - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Fixtures/Builder/NodeBuilder.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Fixtures/Builder/NodeBuilder.php deleted file mode 100644 index aa59863..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Fixtures/Builder/NodeBuilder.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Definition\Builder; - -use Symfony\Component\Config\Definition\Builder\NodeBuilder as BaseNodeBuilder; - -class NodeBuilder extends BaseNodeBuilder -{ - public function barNode($name) - { - return $this->node($name, 'bar'); - } - - protected function getNodeClass($type) - { - switch ($type) { - case 'variable': - return __NAMESPACE__.'\\'.ucfirst($type).'NodeDefinition'; - case 'bar': - return __NAMESPACE__.'\\'.ucfirst($type).'NodeDefinition'; - default: - return parent::getNodeClass($type); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Fixtures/Builder/VariableNodeDefinition.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Fixtures/Builder/VariableNodeDefinition.php deleted file mode 100644 index 1017880..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Fixtures/Builder/VariableNodeDefinition.php +++ /dev/null @@ -1,18 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Definition\Builder; - -use Symfony\Component\Config\Definition\Builder\VariableNodeDefinition as BaseVariableNodeDefinition; - -class VariableNodeDefinition extends BaseVariableNodeDefinition -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Fixtures/foo.xml b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Fixtures/foo.xml deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Loader/DelegatingLoaderTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Loader/DelegatingLoaderTest.php deleted file mode 100644 index 3b04a01..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Loader/DelegatingLoaderTest.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Loader; - -use Symfony\Component\Config\Loader\LoaderResolver; -use Symfony\Component\Config\Loader\DelegatingLoader; - -class DelegatingLoaderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\Config\Loader\DelegatingLoader::__construct - */ - public function testConstructor() - { - $loader = new DelegatingLoader($resolver = new LoaderResolver()); - $this->assertTrue(true, '__construct() takes a loader resolver as its first argument'); - } - - /** - * @covers Symfony\Component\Config\Loader\DelegatingLoader::getResolver - * @covers Symfony\Component\Config\Loader\DelegatingLoader::setResolver - */ - public function testGetSetResolver() - { - $resolver = new LoaderResolver(); - $loader = new DelegatingLoader($resolver); - $this->assertSame($resolver, $loader->getResolver(), '->getResolver() gets the resolver loader'); - $loader->setResolver($resolver = new LoaderResolver()); - $this->assertSame($resolver, $loader->getResolver(), '->setResolver() sets the resolver loader'); - } - - /** - * @covers Symfony\Component\Config\Loader\DelegatingLoader::supports - */ - public function testSupports() - { - $loader1 = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface'); - $loader1->expects($this->once())->method('supports')->will($this->returnValue(true)); - $loader = new DelegatingLoader(new LoaderResolver(array($loader1))); - $this->assertTrue($loader->supports('foo.xml'), '->supports() returns true if the resource is loadable'); - - $loader1 = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface'); - $loader1->expects($this->once())->method('supports')->will($this->returnValue(false)); - $loader = new DelegatingLoader(new LoaderResolver(array($loader1))); - $this->assertFalse($loader->supports('foo.foo'), '->supports() returns false if the resource is not loadable'); - } - - /** - * @covers Symfony\Component\Config\Loader\DelegatingLoader::load - */ - public function testLoad() - { - $loader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface'); - $loader->expects($this->once())->method('supports')->will($this->returnValue(true)); - $loader->expects($this->once())->method('load'); - $resolver = new LoaderResolver(array($loader)); - $loader = new DelegatingLoader($resolver); - - $loader->load('foo'); - } - - /** - * @expectedException Symfony\Component\Config\Exception\FileLoaderLoadException - */ - public function testLoadThrowsAnExceptionIfTheResourceCannotBeLoaded() - { - $loader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface'); - $loader->expects($this->once())->method('supports')->will($this->returnValue(false)); - $resolver = new LoaderResolver(array($loader)); - $loader = new DelegatingLoader($resolver); - - $loader->load('foo'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Loader/LoaderResolverTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Loader/LoaderResolverTest.php deleted file mode 100644 index 8ee276b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Loader/LoaderResolverTest.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Loader; - -use Symfony\Component\Config\Loader\LoaderResolver; - -class LoaderResolverTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\Config\Loader\LoaderResolver::__construct - */ - public function testConstructor() - { - $resolver = new LoaderResolver(array( - $loader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface'), - )); - - $this->assertEquals(array($loader), $resolver->getLoaders(), '__construct() takes an array of loaders as its first argument'); - } - - /** - * @covers Symfony\Component\Config\Loader\LoaderResolver::resolve - */ - public function testResolve() - { - $loader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface'); - $resolver = new LoaderResolver(array($loader)); - $this->assertFalse($resolver->resolve('foo.foo'), '->resolve() returns false if no loader is able to load the resource'); - - $loader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface'); - $loader->expects($this->once())->method('supports')->will($this->returnValue(true)); - $resolver = new LoaderResolver(array($loader)); - $this->assertEquals($loader, $resolver->resolve(function () {}), '->resolve() returns the loader for the given resource'); - } - - /** - * @covers Symfony\Component\Config\Loader\LoaderResolver::getLoaders - * @covers Symfony\Component\Config\Loader\LoaderResolver::addLoader - */ - public function testLoaders() - { - $resolver = new LoaderResolver(); - $resolver->addLoader($loader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface')); - - $this->assertEquals(array($loader), $resolver->getLoaders(), 'addLoader() adds a loader'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Loader/LoaderTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Loader/LoaderTest.php deleted file mode 100644 index 5b14e19..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Loader/LoaderTest.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Loader; - -use Symfony\Component\Config\Loader\LoaderResolver; -use Symfony\Component\Config\Loader\Loader; -use Symfony\Component\Config\Exception\FileLoaderLoadException; - -class LoaderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\Config\Loader\Loader::getResolver - * @covers Symfony\Component\Config\Loader\Loader::setResolver - */ - public function testGetSetResolver() - { - $resolver = new LoaderResolver(); - $loader = new ProjectLoader1(); - $loader->setResolver($resolver); - $this->assertSame($resolver, $loader->getResolver(), '->setResolver() sets the resolver loader'); - } - - /** - * @covers Symfony\Component\Config\Loader\Loader::resolve - */ - public function testResolve() - { - $loader1 = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface'); - $loader1->expects($this->once())->method('supports')->will($this->returnValue(true)); - $resolver = new LoaderResolver(array($loader1)); - $loader = new ProjectLoader1(); - $loader->setResolver($resolver); - - $this->assertSame($loader, $loader->resolve('foo.foo'), '->resolve() finds a loader'); - $this->assertSame($loader1, $loader->resolve('foo.xml'), '->resolve() finds a loader'); - - $loader1 = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface'); - $loader1->expects($this->once())->method('supports')->will($this->returnValue(false)); - $resolver = new LoaderResolver(array($loader1)); - $loader = new ProjectLoader1(); - $loader->setResolver($resolver); - try { - $loader->resolve('FOOBAR'); - $this->fail('->resolve() throws a FileLoaderLoadException if the resource cannot be loaded'); - } catch (FileLoaderLoadException $e) { - $this->assertInstanceOf('Symfony\Component\Config\Exception\FileLoaderLoadException', $e, '->resolve() throws a FileLoaderLoadException if the resource cannot be loaded'); - } - } -} - -class ProjectLoader1 extends Loader -{ - public function load($resource, $type = null) - { - } - - public function supports($resource, $type = null) - { - return is_string($resource) && 'foo' === pathinfo($resource, PATHINFO_EXTENSION); - } - - public function getType() - { - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Resource/DirectoryResourceTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Resource/DirectoryResourceTest.php deleted file mode 100644 index c626ec6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Resource/DirectoryResourceTest.php +++ /dev/null @@ -1,171 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Resource; - -use Symfony\Component\Config\Resource\DirectoryResource; - -class DirectoryResourceTest extends \PHPUnit_Framework_TestCase -{ - protected $directory; - - protected function setUp() - { - $this->directory = sys_get_temp_dir().'/symfonyDirectoryIterator'; - if (!file_exists($this->directory)) { - mkdir($this->directory); - } - touch($this->directory.'/tmp.xml'); - } - - protected function tearDown() - { - if (!is_dir($this->directory)) { - return; - } - $this->removeDirectory($this->directory); - } - - protected function removeDirectory($directory) - { - $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($directory), \RecursiveIteratorIterator::CHILD_FIRST); - foreach ($iterator as $path) { - if (preg_match('#/\.\.?$#', $path->__toString())) { - continue; - } - if ($path->isDir()) { - rmdir($path->__toString()); - } else { - unlink($path->__toString()); - } - } - rmdir($directory); - } - - /** - * @covers Symfony\Component\Config\Resource\DirectoryResource::getResource - */ - public function testGetResource() - { - $resource = new DirectoryResource($this->directory); - $this->assertEquals($this->directory, $resource->getResource(), '->getResource() returns the path to the resource'); - } - - public function testGetPattern() - { - $resource = new DirectoryResource('foo', 'bar'); - $this->assertEquals('bar', $resource->getPattern()); - } - - /** - * @covers Symfony\Component\Config\Resource\DirectoryResource::isFresh - */ - public function testIsFresh() - { - $resource = new DirectoryResource($this->directory); - $this->assertTrue($resource->isFresh(time() + 10), '->isFresh() returns true if the resource has not changed'); - $this->assertFalse($resource->isFresh(time() - 86400), '->isFresh() returns false if the resource has been updated'); - - $resource = new DirectoryResource('/____foo/foobar'.rand(1, 999999)); - $this->assertFalse($resource->isFresh(time()), '->isFresh() returns false if the resource does not exist'); - } - - /** - * @covers Symfony\Component\Config\Resource\DirectoryResource::isFresh - */ - public function testIsFreshUpdateFile() - { - $resource = new DirectoryResource($this->directory); - touch($this->directory.'/tmp.xml', time() + 20); - $this->assertFalse($resource->isFresh(time() + 10), '->isFresh() returns false if an existing file is modified'); - } - - /** - * @covers Symfony\Component\Config\Resource\DirectoryResource::isFresh - */ - public function testIsFreshNewFile() - { - $resource = new DirectoryResource($this->directory); - touch($this->directory.'/new.xml', time() + 20); - $this->assertFalse($resource->isFresh(time() + 10), '->isFresh() returns false if a new file is added'); - } - - /** - * @covers Symfony\Component\Config\Resource\DirectoryResource::isFresh - */ - public function testIsFreshDeleteFile() - { - $resource = new DirectoryResource($this->directory); - unlink($this->directory.'/tmp.xml'); - $this->assertFalse($resource->isFresh(time()), '->isFresh() returns false if an existing file is removed'); - } - - /** - * @covers Symfony\Component\Config\Resource\DirectoryResource::isFresh - */ - public function testIsFreshDeleteDirectory() - { - $resource = new DirectoryResource($this->directory); - $this->removeDirectory($this->directory); - $this->assertFalse($resource->isFresh(time()), '->isFresh() returns false if the whole resource is removed'); - } - - /** - * @covers Symfony\Component\Config\Resource\DirectoryResource::isFresh - */ - public function testIsFreshCreateFileInSubdirectory() - { - $subdirectory = $this->directory.'/subdirectory'; - mkdir($subdirectory); - - $resource = new DirectoryResource($this->directory); - $this->assertTrue($resource->isFresh(time() + 10), '->isFresh() returns true if an unmodified subdirectory exists'); - - touch($subdirectory.'/newfile.xml', time() + 20); - $this->assertFalse($resource->isFresh(time() + 10), '->isFresh() returns false if a new file in a subdirectory is added'); - } - - /** - * @covers Symfony\Component\Config\Resource\DirectoryResource::isFresh - */ - public function testIsFreshModifySubdirectory() - { - $resource = new DirectoryResource($this->directory); - - $subdirectory = $this->directory.'/subdirectory'; - mkdir($subdirectory); - touch($subdirectory, time() + 20); - - $this->assertFalse($resource->isFresh(time() + 10), '->isFresh() returns false if a subdirectory is modified (e.g. a file gets deleted)'); - } - - /** - * @covers Symfony\Component\Config\Resource\DirectoryResource::isFresh - */ - public function testFilterRegexListNoMatch() - { - $resource = new DirectoryResource($this->directory, '/\.(foo|xml)$/'); - - touch($this->directory.'/new.bar', time() + 20); - $this->assertTrue($resource->isFresh(time() + 10), '->isFresh() returns true if a new file not matching the filter regex is created'); - } - - /** - * @covers Symfony\Component\Config\Resource\DirectoryResource::isFresh - */ - public function testFilterRegexListMatch() - { - $resource = new DirectoryResource($this->directory, '/\.(foo|xml)$/'); - - touch($this->directory.'/new.xml', time() + 20); - $this->assertFalse($resource->isFresh(time() + 10), '->isFresh() returns false if an new file matching the filter regex is created '); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Resource/FileResourceTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Resource/FileResourceTest.php deleted file mode 100644 index 83c403b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Resource/FileResourceTest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Tests\Resource; - -use Symfony\Component\Config\Resource\FileResource; - -class FileResourceTest extends \PHPUnit_Framework_TestCase -{ - protected $resource; - protected $file; - - protected function setUp() - { - $this->file = sys_get_temp_dir().'/tmp.xml'; - touch($this->file); - $this->resource = new FileResource($this->file); - } - - protected function tearDown() - { - unlink($this->file); - } - - /** - * @covers Symfony\Component\Config\Resource\FileResource::getResource - */ - public function testGetResource() - { - $this->assertEquals(realpath($this->file), $this->resource->getResource(), '->getResource() returns the path to the resource'); - } - - /** - * @covers Symfony\Component\Config\Resource\FileResource::isFresh - */ - public function testIsFresh() - { - $this->assertTrue($this->resource->isFresh(time() + 10), '->isFresh() returns true if the resource has not changed'); - $this->assertFalse($this->resource->isFresh(time() - 86400), '->isFresh() returns false if the resource has been updated'); - - $resource = new FileResource('/____foo/foobar'.rand(1, 999999)); - $this->assertFalse($resource->isFresh(time()), '->isFresh() returns false if the resource does not exist'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/bootstrap.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/bootstrap.php deleted file mode 100644 index 3a61b6d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/bootstrap.php +++ /dev/null @@ -1,18 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -spl_autoload_register(function ($class) { - if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\Config')) { - if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\Config')).'.php')) { - require_once $file; - } - } -}); diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/composer.json b/vendor/symfony/symfony/src/Symfony/Component/Config/composer.json deleted file mode 100644 index 41f08cb..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/composer.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "symfony/config", - "type": "library", - "description": "Symfony Config Component", - "keywords": [], - "homepage": "http://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "require": { - "php": ">=5.3.3" - }, - "autoload": { - "psr-0": { "Symfony\\Component\\Config": "" } - }, - "target-dir": "Symfony/Component/Config", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/phpunit.xml.dist b/vendor/symfony/symfony/src/Symfony/Component/Config/phpunit.xml.dist deleted file mode 100644 index e019519..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Config/phpunit.xml.dist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - ./Tests/ - - - - - - ./ - - ./Resources - ./Tests - ./vendor - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php deleted file mode 100644 index 9fc8518..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php +++ /dev/null @@ -1,1080 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\ArgvInput; -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Command\HelpCommand; -use Symfony\Component\Console\Command\ListCommand; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Helper\FormatterHelper; -use Symfony\Component\Console\Helper\DialogHelper; - -/** - * An Application is the container for a collection of commands. - * - * It is the main entry point of a Console application. - * - * This class is optimized for a standard CLI environment. - * - * Usage: - * - * $app = new Application('myapp', '1.0 (stable)'); - * $app->add(new SimpleCommand()); - * $app->run(); - * - * @author Fabien Potencier - * - * @api - */ -class Application -{ - private $commands; - private $wantHelps = false; - private $runningCommand; - private $name; - private $version; - private $catchExceptions; - private $autoExit; - private $definition; - private $helperSet; - - /** - * Constructor. - * - * @param string $name The name of the application - * @param string $version The version of the application - * - * @api - */ - public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN') - { - $this->name = $name; - $this->version = $version; - $this->catchExceptions = true; - $this->autoExit = true; - $this->commands = array(); - $this->helperSet = $this->getDefaultHelperSet(); - $this->definition = $this->getDefaultInputDefinition(); - - foreach ($this->getDefaultCommands() as $command) { - $this->add($command); - } - } - - /** - * Runs the current application. - * - * @param InputInterface $input An Input instance - * @param OutputInterface $output An Output instance - * - * @return integer 0 if everything went fine, or an error code - * - * @throws \Exception When doRun returns Exception - * - * @api - */ - public function run(InputInterface $input = null, OutputInterface $output = null) - { - if (null === $input) { - $input = new ArgvInput(); - } - - if (null === $output) { - $output = new ConsoleOutput(); - } - - try { - $statusCode = $this->doRun($input, $output); - } catch (\Exception $e) { - if (!$this->catchExceptions) { - throw $e; - } - - if ($output instanceof ConsoleOutputInterface) { - $this->renderException($e, $output->getErrorOutput()); - } else { - $this->renderException($e, $output); - } - $statusCode = $e->getCode(); - - $statusCode = is_numeric($statusCode) && $statusCode ? $statusCode : 1; - } - - if ($this->autoExit) { - if ($statusCode > 255) { - $statusCode = 255; - } - // @codeCoverageIgnoreStart - exit($statusCode); - // @codeCoverageIgnoreEnd - } - - return $statusCode; - } - - /** - * Runs the current application. - * - * @param InputInterface $input An Input instance - * @param OutputInterface $output An Output instance - * - * @return integer 0 if everything went fine, or an error code - */ - public function doRun(InputInterface $input, OutputInterface $output) - { - $name = $this->getCommandName($input); - - if (true === $input->hasParameterOption(array('--ansi'))) { - $output->setDecorated(true); - } elseif (true === $input->hasParameterOption(array('--no-ansi'))) { - $output->setDecorated(false); - } - - if (true === $input->hasParameterOption(array('--help', '-h'))) { - if (!$name) { - $name = 'help'; - $input = new ArrayInput(array('command' => 'help')); - } else { - $this->wantHelps = true; - } - } - - if (true === $input->hasParameterOption(array('--no-interaction', '-n'))) { - $input->setInteractive(false); - } - - if (function_exists('posix_isatty') && $this->getHelperSet()->has('dialog')) { - $inputStream = $this->getHelperSet()->get('dialog')->getInputStream(); - if (!posix_isatty($inputStream)) { - $input->setInteractive(false); - } - } - - if (true === $input->hasParameterOption(array('--quiet', '-q'))) { - $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); - } elseif (true === $input->hasParameterOption(array('--verbose', '-v'))) { - $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); - } - - if (true === $input->hasParameterOption(array('--version', '-V'))) { - $output->writeln($this->getLongVersion()); - - return 0; - } - - if (!$name) { - $name = 'list'; - $input = new ArrayInput(array('command' => 'list')); - } - - // the command name MUST be the first element of the input - $command = $this->find($name); - - $this->runningCommand = $command; - $statusCode = $command->run($input, $output); - $this->runningCommand = null; - - return is_numeric($statusCode) ? $statusCode : 0; - } - - /** - * Set a helper set to be used with the command. - * - * @param HelperSet $helperSet The helper set - * - * @api - */ - public function setHelperSet(HelperSet $helperSet) - { - $this->helperSet = $helperSet; - } - - /** - * Get the helper set associated with the command. - * - * @return HelperSet The HelperSet instance associated with this command - * - * @api - */ - public function getHelperSet() - { - return $this->helperSet; - } - - /** - * Gets the InputDefinition related to this Application. - * - * @return InputDefinition The InputDefinition instance - */ - public function getDefinition() - { - return $this->definition; - } - - /** - * Gets the help message. - * - * @return string A help message. - */ - public function getHelp() - { - $messages = array( - $this->getLongVersion(), - '', - 'Usage:', - sprintf(" [options] command [arguments]\n"), - 'Options:', - ); - - foreach ($this->getDefinition()->getOptions() as $option) { - $messages[] = sprintf(' %-29s %s %s', - '--'.$option->getName().'', - $option->getShortcut() ? '-'.$option->getShortcut().'' : ' ', - $option->getDescription() - ); - } - - return implode(PHP_EOL, $messages); - } - - /** - * Sets whether to catch exceptions or not during commands execution. - * - * @param Boolean $boolean Whether to catch exceptions or not during commands execution - * - * @api - */ - public function setCatchExceptions($boolean) - { - $this->catchExceptions = (Boolean) $boolean; - } - - /** - * Sets whether to automatically exit after a command execution or not. - * - * @param Boolean $boolean Whether to automatically exit after a command execution or not - * - * @api - */ - public function setAutoExit($boolean) - { - $this->autoExit = (Boolean) $boolean; - } - - /** - * Gets the name of the application. - * - * @return string The application name - * - * @api - */ - public function getName() - { - return $this->name; - } - - /** - * Sets the application name. - * - * @param string $name The application name - * - * @api - */ - public function setName($name) - { - $this->name = $name; - } - - /** - * Gets the application version. - * - * @return string The application version - * - * @api - */ - public function getVersion() - { - return $this->version; - } - - /** - * Sets the application version. - * - * @param string $version The application version - * - * @api - */ - public function setVersion($version) - { - $this->version = $version; - } - - /** - * Returns the long version of the application. - * - * @return string The long application version - * - * @api - */ - public function getLongVersion() - { - if ('UNKNOWN' !== $this->getName() && 'UNKNOWN' !== $this->getVersion()) { - return sprintf('%s version %s', $this->getName(), $this->getVersion()); - } - - return 'Console Tool'; - } - - /** - * Registers a new command. - * - * @param string $name The command name - * - * @return Command The newly created command - * - * @api - */ - public function register($name) - { - return $this->add(new Command($name)); - } - - /** - * Adds an array of command objects. - * - * @param Command[] $commands An array of commands - * - * @api - */ - public function addCommands(array $commands) - { - foreach ($commands as $command) { - $this->add($command); - } - } - - /** - * Adds a command object. - * - * If a command with the same name already exists, it will be overridden. - * - * @param Command $command A Command object - * - * @return Command The registered command - * - * @api - */ - public function add(Command $command) - { - $command->setApplication($this); - - if (!$command->isEnabled()) { - $command->setApplication(null); - - return; - } - - $this->commands[$command->getName()] = $command; - - foreach ($command->getAliases() as $alias) { - $this->commands[$alias] = $command; - } - - return $command; - } - - /** - * Returns a registered command by name or alias. - * - * @param string $name The command name or alias - * - * @return Command A Command object - * - * @throws \InvalidArgumentException When command name given does not exist - * - * @api - */ - public function get($name) - { - if (!isset($this->commands[$name])) { - throw new \InvalidArgumentException(sprintf('The command "%s" does not exist.', $name)); - } - - $command = $this->commands[$name]; - - if ($this->wantHelps) { - $this->wantHelps = false; - - $helpCommand = $this->get('help'); - $helpCommand->setCommand($command); - - return $helpCommand; - } - - return $command; - } - - /** - * Returns true if the command exists, false otherwise. - * - * @param string $name The command name or alias - * - * @return Boolean true if the command exists, false otherwise - * - * @api - */ - public function has($name) - { - return isset($this->commands[$name]); - } - - /** - * Returns an array of all unique namespaces used by currently registered commands. - * - * It does not returns the global namespace which always exists. - * - * @return array An array of namespaces - */ - public function getNamespaces() - { - $namespaces = array(); - foreach ($this->commands as $command) { - $namespaces[] = $this->extractNamespace($command->getName()); - - foreach ($command->getAliases() as $alias) { - $namespaces[] = $this->extractNamespace($alias); - } - } - - return array_values(array_unique(array_filter($namespaces))); - } - - /** - * Finds a registered namespace by a name or an abbreviation. - * - * @param string $namespace A namespace or abbreviation to search for - * - * @return string A registered namespace - * - * @throws \InvalidArgumentException When namespace is incorrect or ambiguous - */ - public function findNamespace($namespace) - { - $allNamespaces = array(); - foreach ($this->getNamespaces() as $n) { - $allNamespaces[$n] = explode(':', $n); - } - - $found = array(); - foreach (explode(':', $namespace) as $i => $part) { - $abbrevs = static::getAbbreviations(array_unique(array_values(array_filter(array_map(function ($p) use ($i) { return isset($p[$i]) ? $p[$i] : ''; }, $allNamespaces))))); - - if (!isset($abbrevs[$part])) { - $message = sprintf('There are no commands defined in the "%s" namespace.', $namespace); - - if (1 <= $i) { - $part = implode(':', $found).':'.$part; - } - - if ($alternatives = $this->findAlternativeNamespace($part, $abbrevs)) { - $message .= "\n\nDid you mean one of these?\n "; - $message .= implode("\n ", $alternatives); - } - - throw new \InvalidArgumentException($message); - } - - if (count($abbrevs[$part]) > 1) { - throw new \InvalidArgumentException(sprintf('The namespace "%s" is ambiguous (%s).', $namespace, $this->getAbbreviationSuggestions($abbrevs[$part]))); - } - - $found[] = $abbrevs[$part][0]; - } - - return implode(':', $found); - } - - /** - * Finds a command by name or alias. - * - * Contrary to get, this command tries to find the best - * match if you give it an abbreviation of a name or alias. - * - * @param string $name A command name or a command alias - * - * @return Command A Command instance - * - * @throws \InvalidArgumentException When command name is incorrect or ambiguous - * - * @api - */ - public function find($name) - { - // namespace - $namespace = ''; - $searchName = $name; - if (false !== $pos = strrpos($name, ':')) { - $namespace = $this->findNamespace(substr($name, 0, $pos)); - $searchName = $namespace.substr($name, $pos); - } - - // name - $commands = array(); - foreach ($this->commands as $command) { - if ($this->extractNamespace($command->getName()) == $namespace) { - $commands[] = $command->getName(); - } - } - - $abbrevs = static::getAbbreviations(array_unique($commands)); - if (isset($abbrevs[$searchName]) && 1 == count($abbrevs[$searchName])) { - return $this->get($abbrevs[$searchName][0]); - } - - if (isset($abbrevs[$searchName]) && count($abbrevs[$searchName]) > 1) { - $suggestions = $this->getAbbreviationSuggestions($abbrevs[$searchName]); - - throw new \InvalidArgumentException(sprintf('Command "%s" is ambiguous (%s).', $name, $suggestions)); - } - - // aliases - $aliases = array(); - foreach ($this->commands as $command) { - foreach ($command->getAliases() as $alias) { - if ($this->extractNamespace($alias) == $namespace) { - $aliases[] = $alias; - } - } - } - - $aliases = static::getAbbreviations(array_unique($aliases)); - if (!isset($aliases[$searchName])) { - $message = sprintf('Command "%s" is not defined.', $name); - - if ($alternatives = $this->findAlternativeCommands($searchName, $abbrevs)) { - $message .= "\n\nDid you mean one of these?\n "; - $message .= implode("\n ", $alternatives); - } - - throw new \InvalidArgumentException($message); - } - - if (count($aliases[$searchName]) > 1) { - throw new \InvalidArgumentException(sprintf('Command "%s" is ambiguous (%s).', $name, $this->getAbbreviationSuggestions($aliases[$searchName]))); - } - - return $this->get($aliases[$searchName][0]); - } - - /** - * Gets the commands (registered in the given namespace if provided). - * - * The array keys are the full names and the values the command instances. - * - * @param string $namespace A namespace name - * - * @return array An array of Command instances - * - * @api - */ - public function all($namespace = null) - { - if (null === $namespace) { - return $this->commands; - } - - $commands = array(); - foreach ($this->commands as $name => $command) { - if ($namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1)) { - $commands[$name] = $command; - } - } - - return $commands; - } - - /** - * Returns an array of possible abbreviations given a set of names. - * - * @param array $names An array of names - * - * @return array An array of abbreviations - */ - public static function getAbbreviations($names) - { - $abbrevs = array(); - foreach ($names as $name) { - for ($len = strlen($name) - 1; $len > 0; --$len) { - $abbrev = substr($name, 0, $len); - if (!isset($abbrevs[$abbrev])) { - $abbrevs[$abbrev] = array($name); - } else { - $abbrevs[$abbrev][] = $name; - } - } - } - - // Non-abbreviations always get entered, even if they aren't unique - foreach ($names as $name) { - $abbrevs[$name] = array($name); - } - - return $abbrevs; - } - - /** - * Returns a text representation of the Application. - * - * @param string $namespace An optional namespace name - * @param boolean $raw Whether to return raw command list - * - * @return string A string representing the Application - */ - public function asText($namespace = null, $raw = false) - { - $commands = $namespace ? $this->all($this->findNamespace($namespace)) : $this->commands; - - $width = 0; - foreach ($commands as $command) { - $width = strlen($command->getName()) > $width ? strlen($command->getName()) : $width; - } - $width += 2; - - if ($raw) { - $messages = array(); - foreach ($this->sortCommands($commands) as $space => $commands) { - foreach ($commands as $name => $command) { - $messages[] = sprintf("%-${width}s %s", $name, $command->getDescription()); - } - } - - return implode(PHP_EOL, $messages); - } - - $messages = array($this->getHelp(), ''); - if ($namespace) { - $messages[] = sprintf("Available commands for the \"%s\" namespace:", $namespace); - } else { - $messages[] = 'Available commands:'; - } - - // add commands by namespace - foreach ($this->sortCommands($commands) as $space => $commands) { - if (!$namespace && '_global' !== $space) { - $messages[] = ''.$space.''; - } - - foreach ($commands as $name => $command) { - $messages[] = sprintf(" %-${width}s %s", $name, $command->getDescription()); - } - } - - return implode(PHP_EOL, $messages); - } - - /** - * Returns an XML representation of the Application. - * - * @param string $namespace An optional namespace name - * @param Boolean $asDom Whether to return a DOM or an XML string - * - * @return string|DOMDocument An XML string representing the Application - */ - public function asXml($namespace = null, $asDom = false) - { - $commands = $namespace ? $this->all($this->findNamespace($namespace)) : $this->commands; - - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->formatOutput = true; - $dom->appendChild($xml = $dom->createElement('symfony')); - - $xml->appendChild($commandsXML = $dom->createElement('commands')); - - if ($namespace) { - $commandsXML->setAttribute('namespace', $namespace); - } else { - $namespacesXML = $dom->createElement('namespaces'); - $xml->appendChild($namespacesXML); - } - - // add commands by namespace - foreach ($this->sortCommands($commands) as $space => $commands) { - if (!$namespace) { - $namespaceArrayXML = $dom->createElement('namespace'); - $namespacesXML->appendChild($namespaceArrayXML); - $namespaceArrayXML->setAttribute('id', $space); - } - - foreach ($commands as $name => $command) { - if ($name !== $command->getName()) { - continue; - } - - if (!$namespace) { - $commandXML = $dom->createElement('command'); - $namespaceArrayXML->appendChild($commandXML); - $commandXML->appendChild($dom->createTextNode($name)); - } - - $node = $command->asXml(true)->getElementsByTagName('command')->item(0); - $node = $dom->importNode($node, true); - - $commandsXML->appendChild($node); - } - } - - return $asDom ? $dom : $dom->saveXml(); - } - - /** - * Renders a caught exception. - * - * @param Exception $e An exception instance - * @param OutputInterface $output An OutputInterface instance - */ - public function renderException($e, $output) - { - $strlen = function ($string) { - if (!function_exists('mb_strlen')) { - return strlen($string); - } - - if (false === $encoding = mb_detect_encoding($string)) { - return strlen($string); - } - - return mb_strlen($string, $encoding); - }; - - do { - $title = sprintf(' [%s] ', get_class($e)); - $len = $strlen($title); - $width = $this->getTerminalWidth() ? $this->getTerminalWidth() - 1 : PHP_INT_MAX; - $lines = array(); - foreach (preg_split("{\r?\n}", $e->getMessage()) as $line) { - foreach (str_split($line, $width - 4) as $line) { - $lines[] = sprintf(' %s ', $line); - $len = max($strlen($line) + 4, $len); - } - } - - $messages = array(str_repeat(' ', $len), $title.str_repeat(' ', max(0, $len - $strlen($title)))); - - foreach ($lines as $line) { - $messages[] = $line.str_repeat(' ', $len - $strlen($line)); - } - - $messages[] = str_repeat(' ', $len); - - $output->writeln(""); - $output->writeln(""); - foreach ($messages as $message) { - $output->writeln(''.$message.''); - } - $output->writeln(""); - $output->writeln(""); - - if (OutputInterface::VERBOSITY_VERBOSE === $output->getVerbosity()) { - $output->writeln('Exception trace:'); - - // exception related properties - $trace = $e->getTrace(); - array_unshift($trace, array( - 'function' => '', - 'file' => $e->getFile() != null ? $e->getFile() : 'n/a', - 'line' => $e->getLine() != null ? $e->getLine() : 'n/a', - 'args' => array(), - )); - - for ($i = 0, $count = count($trace); $i < $count; $i++) { - $class = isset($trace[$i]['class']) ? $trace[$i]['class'] : ''; - $type = isset($trace[$i]['type']) ? $trace[$i]['type'] : ''; - $function = $trace[$i]['function']; - $file = isset($trace[$i]['file']) ? $trace[$i]['file'] : 'n/a'; - $line = isset($trace[$i]['line']) ? $trace[$i]['line'] : 'n/a'; - - $output->writeln(sprintf(' %s%s%s() at %s:%s', $class, $type, $function, $file, $line)); - } - - $output->writeln(""); - $output->writeln(""); - } - } while ($e = $e->getPrevious()); - - if (null !== $this->runningCommand) { - $output->writeln(sprintf('%s', sprintf($this->runningCommand->getSynopsis(), $this->getName()))); - $output->writeln(""); - $output->writeln(""); - } - } - - /** - * Tries to figure out the terminal width in which this application runs - * - * @return int|null - */ - protected function getTerminalWidth() - { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { - if ($ansicon = getenv('ANSICON')) { - return preg_replace('{^(\d+)x.*$}', '$1', $ansicon); - } - - exec('mode CON', $execData); - if (preg_match('{columns:\s*(\d+)}i', $execData[4], $matches)) { - return $matches[1]; - } - } - - if (preg_match("{rows.(\d+);.columns.(\d+);}i", $this->getSttyColumns(), $match)) { - return $match[2]; - } - } - - /** - * Tries to figure out the terminal height in which this application runs - * - * @return int|null - */ - protected function getTerminalHeight() - { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { - if ($ansicon = getenv('ANSICON')) { - return preg_replace('{^\d+x\d+ \(\d+x(\d+)\)$}', '$1', trim($ansicon)); - } - - exec('mode CON', $execData); - if (preg_match('{lines:\s*(\d+)}i', $execData[3], $matches)) { - return $matches[1]; - } - } - - if (preg_match("{rows.(\d+);.columns.(\d+);}i", $this->getSttyColumns(), $match)) { - return $match[1]; - } - } - - /** - * Gets the name of the command based on input. - * - * @param InputInterface $input The input interface - * - * @return string The command name - */ - protected function getCommandName(InputInterface $input) - { - return $input->getFirstArgument(); - } - - /** - * Gets the default input definition. - * - * @return InputDefinition An InputDefinition instance - */ - protected function getDefaultInputDefinition() - { - return new InputDefinition(array( - new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), - - new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message.'), - new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message.'), - new InputOption('--verbose', '-v', InputOption::VALUE_NONE, 'Increase verbosity of messages.'), - new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version.'), - new InputOption('--ansi', '', InputOption::VALUE_NONE, 'Force ANSI output.'), - new InputOption('--no-ansi', '', InputOption::VALUE_NONE, 'Disable ANSI output.'), - new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question.'), - )); - } - - /** - * Gets the default commands that should always be available. - * - * @return array An array of default Command instances - */ - protected function getDefaultCommands() - { - return array(new HelpCommand(), new ListCommand()); - } - - /** - * Gets the default helper set with the helpers that should always be available. - * - * @return HelperSet A HelperSet instance - */ - protected function getDefaultHelperSet() - { - return new HelperSet(array( - new FormatterHelper(), - new DialogHelper(), - )); - } - - /** - * Runs and parses stty -a if it's available, suppressing any error output - * - * @return string - */ - private function getSttyColumns() - { - if (!function_exists('proc_open')) { - return; - } - - $descriptorspec = array(1 => array('pipe', 'w'), 2 => array('pipe', 'w')); - $process = proc_open('stty -a | grep columns', $descriptorspec, $pipes, null, null, array('suppress_errors' => true)); - if (is_resource($process)) { - $info = stream_get_contents($pipes[1]); - fclose($pipes[1]); - fclose($pipes[2]); - proc_close($process); - - return $info; - } - } - - /** - * Sorts commands in alphabetical order. - * - * @param array $commands An associative array of commands to sort - * - * @return array A sorted array of commands - */ - private function sortCommands($commands) - { - $namespacedCommands = array(); - foreach ($commands as $name => $command) { - $key = $this->extractNamespace($name, 1); - if (!$key) { - $key = '_global'; - } - - $namespacedCommands[$key][$name] = $command; - } - ksort($namespacedCommands); - - foreach ($namespacedCommands as &$commands) { - ksort($commands); - } - - return $namespacedCommands; - } - - /** - * Returns abbreviated suggestions in string format. - * - * @param array $abbrevs Abbreviated suggestions to convert - * - * @return string A formatted string of abbreviated suggestions - */ - private function getAbbreviationSuggestions($abbrevs) - { - return sprintf('%s, %s%s', $abbrevs[0], $abbrevs[1], count($abbrevs) > 2 ? sprintf(' and %d more', count($abbrevs) - 2) : ''); - } - - /** - * Returns the namespace part of the command name. - * - * @param string $name The full name of the command - * @param string $limit The maximum number of parts of the namespace - * - * @return string The namespace of the command - */ - private function extractNamespace($name, $limit = null) - { - $parts = explode(':', $name); - array_pop($parts); - - return implode(':', null === $limit ? $parts : array_slice($parts, 0, $limit)); - } - - /** - * Finds alternative commands of $name - * - * @param string $name The full name of the command - * @param array $abbrevs The abbreviations - * - * @return array A sorted array of similar commands - */ - private function findAlternativeCommands($name, $abbrevs) - { - $callback = function($item) { - return $item->getName(); - }; - - return $this->findAlternatives($name, $this->commands, $abbrevs, $callback); - } - - /** - * Finds alternative namespace of $name - * - * @param string $name The full name of the namespace - * @param array $abbrevs The abbreviations - * - * @return array A sorted array of similar namespace - */ - private function findAlternativeNamespace($name, $abbrevs) - { - return $this->findAlternatives($name, $this->getNamespaces(), $abbrevs); - } - - /** - * Finds alternative of $name among $collection, - * if nothing is found in $collection, try in $abbrevs - * - * @param string $name The string - * @param array|Traversable $collection The collection - * @param array $abbrevs The abbreviations - * @param Closure|string|array $callback The callable to transform collection item before comparison - * - * @return array A sorted array of similar string - */ - private function findAlternatives($name, $collection, $abbrevs, $callback = null) - { - $alternatives = array(); - - foreach ($collection as $item) { - if (null !== $callback) { - $item = call_user_func($callback, $item); - } - - $lev = levenshtein($name, $item); - if ($lev <= strlen($name) / 3 || false !== strpos($item, $name)) { - $alternatives[$item] = $lev; - } - } - - if (!$alternatives) { - foreach ($abbrevs as $key => $values) { - $lev = levenshtein($name, $key); - if ($lev <= strlen($name) / 3 || false !== strpos($key, $name)) { - foreach ($values as $value) { - $alternatives[$value] = $lev; - } - } - } - } - - asort($alternatives); - - return array_keys($alternatives); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/CHANGELOG.md b/vendor/symfony/symfony/src/Symfony/Component/Console/CHANGELOG.md deleted file mode 100644 index 79449d8..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/CHANGELOG.md +++ /dev/null @@ -1,19 +0,0 @@ -CHANGELOG -========= - -2.1.0 ------ - - * added ConsoleOutputInterface - * added the possibility to disable a command (Command::isEnabled()) - * added suggestions when a command does not exist - * added a --raw option to the list command - * added support for STDERR in the console output class (errors are now sent - to STDERR) - * made the defaults (helper set, commands, input definition) in Application - more easily customizable - * added support for the shell even if readline is not available - * added support for process isolation in Symfony shell via - `--process-isolation` switch - * added support for `--`, which disables options parsing after that point - (tokens will be parsed as arguments) diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php deleted file mode 100644 index 001e364..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php +++ /dev/null @@ -1,614 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Helper\HelperSet; - -/** - * Base class for all commands. - * - * @author Fabien Potencier - * - * @api - */ -class Command -{ - private $application; - private $name; - private $aliases; - private $definition; - private $help; - private $description; - private $ignoreValidationErrors; - private $applicationDefinitionMerged; - private $code; - private $synopsis; - private $helperSet; - - /** - * Constructor. - * - * @param string $name The name of the command - * - * @throws \LogicException When the command name is empty - * - * @api - */ - public function __construct($name = null) - { - $this->definition = new InputDefinition(); - $this->ignoreValidationErrors = false; - $this->applicationDefinitionMerged = false; - $this->aliases = array(); - - if (null !== $name) { - $this->setName($name); - } - - $this->configure(); - - if (!$this->name) { - throw new \LogicException('The command name cannot be empty.'); - } - } - - /** - * Ignores validation errors. - * - * This is mainly useful for the help command. - */ - public function ignoreValidationErrors() - { - $this->ignoreValidationErrors = true; - } - - /** - * Sets the application instance for this command. - * - * @param Application $application An Application instance - * - * @api - */ - public function setApplication(Application $application = null) - { - $this->application = $application; - if ($application) { - $this->setHelperSet($application->getHelperSet()); - } else { - $this->helperSet = null; - } - } - - /** - * Sets the helper set. - * - * @param HelperSet $helperSet A HelperSet instance - */ - public function setHelperSet(HelperSet $helperSet) - { - $this->helperSet = $helperSet; - } - - /** - * Gets the helper set. - * - * @return HelperSet A HelperSet instance - */ - public function getHelperSet() - { - return $this->helperSet; - } - - /** - * Gets the application instance for this command. - * - * @return Application An Application instance - * - * @api - */ - public function getApplication() - { - return $this->application; - } - - /** - * Checks whether the command is enabled or not in the current environment - * - * Override this to check for x or y and return false if the command can not - * run properly under the current conditions. - * - * @return Boolean - */ - public function isEnabled() - { - return true; - } - - /** - * Configures the current command. - */ - protected function configure() - { - } - - /** - * Executes the current command. - * - * This method is not abstract because you can use this class - * as a concrete class. In this case, instead of defining the - * execute() method, you set the code to execute by passing - * a Closure to the setCode() method. - * - * @param InputInterface $input An InputInterface instance - * @param OutputInterface $output An OutputInterface instance - * - * @return integer 0 if everything went fine, or an error code - * - * @throws \LogicException When this abstract method is not implemented - * @see setCode() - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - throw new \LogicException('You must override the execute() method in the concrete command class.'); - } - - /** - * Interacts with the user. - * - * @param InputInterface $input An InputInterface instance - * @param OutputInterface $output An OutputInterface instance - */ - protected function interact(InputInterface $input, OutputInterface $output) - { - } - - /** - * Initializes the command just after the input has been validated. - * - * This is mainly useful when a lot of commands extends one main command - * where some things need to be initialized based on the input arguments and options. - * - * @param InputInterface $input An InputInterface instance - * @param OutputInterface $output An OutputInterface instance - */ - protected function initialize(InputInterface $input, OutputInterface $output) - { - } - - /** - * Runs the command. - * - * The code to execute is either defined directly with the - * setCode() method or by overriding the execute() method - * in a sub-class. - * - * @param InputInterface $input An InputInterface instance - * @param OutputInterface $output An OutputInterface instance - * - * @return integer The command exit code - * - * @see setCode() - * @see execute() - * - * @api - */ - public function run(InputInterface $input, OutputInterface $output) - { - // force the creation of the synopsis before the merge with the app definition - $this->getSynopsis(); - - // add the application arguments and options - $this->mergeApplicationDefinition(); - - // bind the input against the command specific arguments/options - try { - $input->bind($this->definition); - } catch (\Exception $e) { - if (!$this->ignoreValidationErrors) { - throw $e; - } - } - - $this->initialize($input, $output); - - if ($input->isInteractive()) { - $this->interact($input, $output); - } - - $input->validate(); - - if ($this->code) { - return call_user_func($this->code, $input, $output); - } - - return $this->execute($input, $output); - } - - /** - * Sets the code to execute when running this command. - * - * If this method is used, it overrides the code defined - * in the execute() method. - * - * @param \Closure $code A \Closure - * - * @return Command The current instance - * - * @see execute() - * - * @api - */ - public function setCode(\Closure $code) - { - $this->code = $code; - - return $this; - } - - /** - * Merges the application definition with the command definition. - */ - private function mergeApplicationDefinition() - { - if (null === $this->application || true === $this->applicationDefinitionMerged) { - return; - } - - $currentArguments = $this->definition->getArguments(); - $this->definition->setArguments($this->application->getDefinition()->getArguments()); - $this->definition->addArguments($currentArguments); - - $this->definition->addOptions($this->application->getDefinition()->getOptions()); - - $this->applicationDefinitionMerged = true; - } - - /** - * Sets an array of argument and option instances. - * - * @param array|InputDefinition $definition An array of argument and option instances or a definition instance - * - * @return Command The current instance - * - * @api - */ - public function setDefinition($definition) - { - if ($definition instanceof InputDefinition) { - $this->definition = $definition; - } else { - $this->definition->setDefinition($definition); - } - - $this->applicationDefinitionMerged = false; - - return $this; - } - - /** - * Gets the InputDefinition attached to this Command. - * - * @return InputDefinition An InputDefinition instance - * - * @api - */ - public function getDefinition() - { - return $this->definition; - } - - /** - * Gets the InputDefinition to be used to create XML and Text representations of this Command. - * - * Can be overridden to provide the original command representation when it would otherwise - * be changed by merging with the application InputDefinition. - * - * @return InputDefinition An InputDefinition instance - */ - protected function getNativeDefinition() - { - return $this->getDefinition(); - } - - /** - * Adds an argument. - * - * @param string $name The argument name - * @param integer $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL - * @param string $description A description text - * @param mixed $default The default value (for InputArgument::OPTIONAL mode only) - * - * @return Command The current instance - * - * @api - */ - public function addArgument($name, $mode = null, $description = '', $default = null) - { - $this->definition->addArgument(new InputArgument($name, $mode, $description, $default)); - - return $this; - } - - /** - * Adds an option. - * - * @param string $name The option name - * @param string $shortcut The shortcut (can be null) - * @param integer $mode The option mode: One of the InputOption::VALUE_* constants - * @param string $description A description text - * @param mixed $default The default value (must be null for InputOption::VALUE_REQUIRED or InputOption::VALUE_NONE) - * - * @return Command The current instance - * - * @api - */ - public function addOption($name, $shortcut = null, $mode = null, $description = '', $default = null) - { - $this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default)); - - return $this; - } - - /** - * Sets the name of the command. - * - * This method can set both the namespace and the name if - * you separate them by a colon (:) - * - * $command->setName('foo:bar'); - * - * @param string $name The command name - * - * @return Command The current instance - * - * @throws \InvalidArgumentException When command name given is empty - * - * @api - */ - public function setName($name) - { - $this->validateName($name); - - $this->name = $name; - - return $this; - } - - /** - * Returns the command name. - * - * @return string The command name - * - * @api - */ - public function getName() - { - return $this->name; - } - - /** - * Sets the description for the command. - * - * @param string $description The description for the command - * - * @return Command The current instance - * - * @api - */ - public function setDescription($description) - { - $this->description = $description; - - return $this; - } - - /** - * Returns the description for the command. - * - * @return string The description for the command - * - * @api - */ - public function getDescription() - { - return $this->description; - } - - /** - * Sets the help for the command. - * - * @param string $help The help for the command - * - * @return Command The current instance - * - * @api - */ - public function setHelp($help) - { - $this->help = $help; - - return $this; - } - - /** - * Returns the help for the command. - * - * @return string The help for the command - * - * @api - */ - public function getHelp() - { - return $this->help; - } - - /** - * Returns the processed help for the command replacing the %command.name% and - * %command.full_name% patterns with the real values dynamically. - * - * @return string The processed help for the command - */ - public function getProcessedHelp() - { - $name = $this->name; - - $placeholders = array( - '%command.name%', - '%command.full_name%' - ); - $replacements = array( - $name, - $_SERVER['PHP_SELF'].' '.$name - ); - - return str_replace($placeholders, $replacements, $this->getHelp()); - } - - /** - * Sets the aliases for the command. - * - * @param array $aliases An array of aliases for the command - * - * @return Command The current instance - * - * @api - */ - public function setAliases($aliases) - { - foreach ($aliases as $alias) { - $this->validateName($alias); - } - - $this->aliases = $aliases; - - return $this; - } - - /** - * Returns the aliases for the command. - * - * @return array An array of aliases for the command - * - * @api - */ - public function getAliases() - { - return $this->aliases; - } - - /** - * Returns the synopsis for the command. - * - * @return string The synopsis - */ - public function getSynopsis() - { - if (null === $this->synopsis) { - $this->synopsis = trim(sprintf('%s %s', $this->name, $this->definition->getSynopsis())); - } - - return $this->synopsis; - } - - /** - * Gets a helper instance by name. - * - * @param string $name The helper name - * - * @return mixed The helper value - * - * @throws \InvalidArgumentException if the helper is not defined - * - * @api - */ - public function getHelper($name) - { - return $this->helperSet->get($name); - } - - /** - * Returns a text representation of the command. - * - * @return string A string representing the command - */ - public function asText() - { - $messages = array( - 'Usage:', - ' '.$this->getSynopsis(), - '', - ); - - if ($this->getAliases()) { - $messages[] = 'Aliases: '.implode(', ', $this->getAliases()).''; - } - - $messages[] = $this->getNativeDefinition()->asText(); - - if ($help = $this->getProcessedHelp()) { - $messages[] = 'Help:'; - $messages[] = ' '.str_replace("\n", "\n ", $help)."\n"; - } - - return implode("\n", $messages); - } - - /** - * Returns an XML representation of the command. - * - * @param Boolean $asDom Whether to return a DOM or an XML string - * - * @return string|DOMDocument An XML string representing the command - */ - public function asXml($asDom = false) - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->formatOutput = true; - $dom->appendChild($commandXML = $dom->createElement('command')); - $commandXML->setAttribute('id', $this->name); - $commandXML->setAttribute('name', $this->name); - - $commandXML->appendChild($usageXML = $dom->createElement('usage')); - $usageXML->appendChild($dom->createTextNode(sprintf($this->getSynopsis(), ''))); - - $commandXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $this->getDescription()))); - - $commandXML->appendChild($helpXML = $dom->createElement('help')); - $helpXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $this->getProcessedHelp()))); - - $commandXML->appendChild($aliasesXML = $dom->createElement('aliases')); - foreach ($this->getAliases() as $alias) { - $aliasesXML->appendChild($aliasXML = $dom->createElement('alias')); - $aliasXML->appendChild($dom->createTextNode($alias)); - } - - $definition = $this->getNativeDefinition()->asXml(true); - $commandXML->appendChild($dom->importNode($definition->getElementsByTagName('arguments')->item(0), true)); - $commandXML->appendChild($dom->importNode($definition->getElementsByTagName('options')->item(0), true)); - - return $asDom ? $dom : $dom->saveXml(); - } - - private function validateName($name) - { - if (!preg_match('/^[^\:]+(\:[^\:]+)*$/', $name)) { - throw new \InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name)); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Command/HelpCommand.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Command/HelpCommand.php deleted file mode 100644 index 93c8104..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Command/HelpCommand.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; -use Symfony\Component\Console\Command\Command; - -/** - * HelpCommand displays the help for a given command. - * - * @author Fabien Potencier - */ -class HelpCommand extends Command -{ - private $command; - - /** - * {@inheritdoc} - */ - protected function configure() - { - $this->ignoreValidationErrors(); - - $this - ->setName('help') - ->setDefinition(array( - new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'), - new InputOption('xml', null, InputOption::VALUE_NONE, 'To output help as XML'), - )) - ->setDescription('Displays help for a command') - ->setHelp(<<%command.name% command displays help for a given command: - - php %command.full_name% list - -You can also output the help as XML by using the --xml option: - - php %command.full_name% --xml list -EOF - ) - ; - } - - /** - * Sets the command - * - * @param Command $command The command to set - */ - public function setCommand(Command $command) - { - $this->command = $command; - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - if (null === $this->command) { - $this->command = $this->getApplication()->get($input->getArgument('command_name')); - } - - if ($input->getOption('xml')) { - $output->writeln($this->command->asXml(), OutputInterface::OUTPUT_RAW); - } else { - $output->writeln($this->command->asText()); - } - - $this->command = null; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Command/ListCommand.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Command/ListCommand.php deleted file mode 100644 index 032de16..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Command/ListCommand.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputDefinition; - -/** - * ListCommand displays the list of all available commands for the application. - * - * @author Fabien Potencier - */ -class ListCommand extends Command -{ - /** - * {@inheritdoc} - */ - protected function configure() - { - $this - ->setName('list') - ->setDefinition($this->createDefinition()) - ->setDescription('Lists commands') - ->setHelp(<<%command.name% command lists all commands: - - php %command.full_name% - -You can also display the commands for a specific namespace: - - php %command.full_name% test - -You can also output the information as XML by using the --xml option: - - php %command.full_name% --xml - -It's also possible to get raw list of commands (useful for embedding command runner): - - php %command.full_name% --raw -EOF - ) - ; - } - - /** - * {@inheritdoc} - */ - protected function getNativeDefinition() - { - return $this->createDefinition(); - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - if ($input->getOption('xml')) { - $output->writeln($this->getApplication()->asXml($input->getArgument('namespace')), OutputInterface::OUTPUT_RAW); - } else { - $output->writeln($this->getApplication()->asText($input->getArgument('namespace'), $input->getOption('raw'))); - } - } - - private function createDefinition() - { - return new InputDefinition(array( - new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'), - new InputOption('xml', null, InputOption::VALUE_NONE, 'To output help as XML'), - new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'), - )); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatter.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatter.php deleted file mode 100644 index e509ade..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatter.php +++ /dev/null @@ -1,249 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * Formatter class for console output. - * - * @author Konstantin Kudryashov - * - * @api - */ -class OutputFormatter implements OutputFormatterInterface -{ - /** - * The pattern to phrase the format. - */ - const FORMAT_PATTERN = '#(\\\\?)<(/?)([a-z][a-z0-9_=;-]+)?>((?:(?!\\\\?<).)*)#is'; - - private $decorated; - private $styles = array(); - private $styleStack; - - /** - * Escapes "<" special char in given text. - * - * @param string $text Text to escape - * - * @return string Escaped text - */ - public static function escape($text) - { - return preg_replace('/([^\\\\]?) FormatterStyle" instances - * - * @api - */ - public function __construct($decorated = null, array $styles = array()) - { - $this->decorated = (Boolean) $decorated; - - $this->setStyle('error', new OutputFormatterStyle('white', 'red')); - $this->setStyle('info', new OutputFormatterStyle('green')); - $this->setStyle('comment', new OutputFormatterStyle('yellow')); - $this->setStyle('question', new OutputFormatterStyle('black', 'cyan')); - - foreach ($styles as $name => $style) { - $this->setStyle($name, $style); - } - - $this->styleStack = new OutputFormatterStyleStack(); - } - - /** - * Sets the decorated flag. - * - * @param Boolean $decorated Whether to decorate the messages or not - * - * @api - */ - public function setDecorated($decorated) - { - $this->decorated = (Boolean) $decorated; - } - - /** - * Gets the decorated flag. - * - * @return Boolean true if the output will decorate messages, false otherwise - * - * @api - */ - public function isDecorated() - { - return $this->decorated; - } - - /** - * Sets a new style. - * - * @param string $name The style name - * @param OutputFormatterStyleInterface $style The style instance - * - * @api - */ - public function setStyle($name, OutputFormatterStyleInterface $style) - { - $this->styles[strtolower($name)] = $style; - } - - /** - * Checks if output formatter has style with specified name. - * - * @param string $name - * - * @return Boolean - * - * @api - */ - public function hasStyle($name) - { - return isset($this->styles[strtolower($name)]); - } - - /** - * Gets style options from style with specified name. - * - * @param string $name - * - * @return OutputFormatterStyleInterface - * - * @throws \InvalidArgumentException When style isn't defined - * - * @api - */ - public function getStyle($name) - { - if (!$this->hasStyle($name)) { - throw new \InvalidArgumentException('Undefined style: '.$name); - } - - return $this->styles[strtolower($name)]; - } - - /** - * Formats a message according to the given styles. - * - * @param string $message The message to style - * - * @return string The styled message - * - * @api - */ - public function format($message) - { - $message = preg_replace_callback(self::FORMAT_PATTERN, array($this, 'replaceStyle'), $message); - - return str_replace('\\<', '<', $message); - } - - /** - * @return OutputFormatterStyleStack - */ - public function getStyleStack() - { - return $this->styleStack; - } - - /** - * Replaces style of the output. - * - * @param array $match - * - * @return string The replaced style - */ - private function replaceStyle($match) - { - // we got "\<" escaped char - if ('\\' === $match[1]) { - return $match[0]; - } - - if ('' === $match[3]) { - if ('/' === $match[2]) { - // we got "" tag - $this->styleStack->pop(); - - return $this->applyStyle($this->styleStack->getCurrent(), $match[4]); - } - - // we got "<>" tag - return '<>'.$match[4]; - } - - if (isset($this->styles[strtolower($match[3])])) { - $style = $this->styles[strtolower($match[3])]; - } else { - $style = $this->createStyleFromString($match[3]); - - if (false === $style) { - return $match[0]; - } - } - - if ('/' === $match[2]) { - $this->styleStack->pop($style); - } else { - $this->styleStack->push($style); - } - - return $this->applyStyle($this->styleStack->getCurrent(), $match[4]); - } - - /** - * Tries to create new style instance from string. - * - * @param string $string - * - * @return OutputFormatterStyle|Boolean false if string is not format string - */ - private function createStyleFromString($string) - { - if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', strtolower($string), $matches, PREG_SET_ORDER)) { - return false; - } - - $style = new OutputFormatterStyle(); - foreach ($matches as $match) { - array_shift($match); - - if ('fg' == $match[0]) { - $style->setForeground($match[1]); - } elseif ('bg' == $match[0]) { - $style->setBackground($match[1]); - } else { - $style->setOption($match[1]); - } - } - - return $style; - } - - /** - * Applies style to text if must be applied. - * - * @param OutputFormatterStyleInterface $style Style to apply - * @param string $text Input text - * - * @return string string Styled text - */ - private function applyStyle(OutputFormatterStyleInterface $style, $text) - { - return $this->isDecorated() && strlen($text) > 0 ? $style->apply($text) : $text; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatterInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatterInterface.php deleted file mode 100644 index 0836084..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatterInterface.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * Formatter interface for console output. - * - * @author Konstantin Kudryashov - * - * @api - */ -interface OutputFormatterInterface -{ - /** - * Sets the decorated flag. - * - * @param Boolean $decorated Whether to decorate the messages or not - * - * @api - */ - public function setDecorated($decorated); - - /** - * Gets the decorated flag. - * - * @return Boolean true if the output will decorate messages, false otherwise - * - * @api - */ - public function isDecorated(); - - /** - * Sets a new style. - * - * @param string $name The style name - * @param OutputFormatterStyleInterface $style The style instance - * - * @api - */ - public function setStyle($name, OutputFormatterStyleInterface $style); - - /** - * Checks if output formatter has style with specified name. - * - * @param string $name - * - * @return Boolean - * - * @api - */ - public function hasStyle($name); - - /** - * Gets style options from style with specified name. - * - * @param string $name - * - * @return OutputFormatterStyleInterface - * - * @api - */ - public function getStyle($name); - - /** - * Formats a message according to the given styles. - * - * @param string $message The message to style - * - * @return string The styled message - * - * @api - */ - public function format($message); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php deleted file mode 100644 index 3c6b8ad..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php +++ /dev/null @@ -1,218 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * Formatter style class for defining styles. - * - * @author Konstantin Kudryashov - * - * @api - */ -class OutputFormatterStyle implements OutputFormatterStyleInterface -{ - private static $availableForegroundColors = array( - 'black' => 30, - 'red' => 31, - 'green' => 32, - 'yellow' => 33, - 'blue' => 34, - 'magenta' => 35, - 'cyan' => 36, - 'white' => 37 - ); - private static $availableBackgroundColors = array( - 'black' => 40, - 'red' => 41, - 'green' => 42, - 'yellow' => 43, - 'blue' => 44, - 'magenta' => 45, - 'cyan' => 46, - 'white' => 47 - ); - private static $availableOptions = array( - 'bold' => 1, - 'underscore' => 4, - 'blink' => 5, - 'reverse' => 7, - 'conceal' => 8 - ); - - private $foreground; - private $background; - private $options = array(); - - /** - * Initializes output formatter style. - * - * @param string $foreground The style foreground color name - * @param string $background The style background color name - * @param array $options The style options - * - * @api - */ - public function __construct($foreground = null, $background = null, array $options = array()) - { - if (null !== $foreground) { - $this->setForeground($foreground); - } - if (null !== $background) { - $this->setBackground($background); - } - if (count($options)) { - $this->setOptions($options); - } - } - - /** - * Sets style foreground color. - * - * @param string $color The color name - * - * @throws \InvalidArgumentException When the color name isn't defined - * - * @api - */ - public function setForeground($color = null) - { - if (null === $color) { - $this->foreground = null; - - return; - } - - if (!isset(static::$availableForegroundColors[$color])) { - throw new \InvalidArgumentException(sprintf( - 'Invalid foreground color specified: "%s". Expected one of (%s)', - $color, - implode(', ', array_keys(static::$availableForegroundColors)) - )); - } - - $this->foreground = static::$availableForegroundColors[$color]; - } - - /** - * Sets style background color. - * - * @param string $color The color name - * - * @throws \InvalidArgumentException When the color name isn't defined - * - * @api - */ - public function setBackground($color = null) - { - if (null === $color) { - $this->background = null; - - return; - } - - if (!isset(static::$availableBackgroundColors[$color])) { - throw new \InvalidArgumentException(sprintf( - 'Invalid background color specified: "%s". Expected one of (%s)', - $color, - implode(', ', array_keys(static::$availableBackgroundColors)) - )); - } - - $this->background = static::$availableBackgroundColors[$color]; - } - - /** - * Sets some specific style option. - * - * @param string $option The option name - * - * @throws \InvalidArgumentException When the option name isn't defined - * - * @api - */ - public function setOption($option) - { - if (!isset(static::$availableOptions[$option])) { - throw new \InvalidArgumentException(sprintf( - 'Invalid option specified: "%s". Expected one of (%s)', - $option, - implode(', ', array_keys(static::$availableOptions)) - )); - } - - if (false === array_search(static::$availableOptions[$option], $this->options)) { - $this->options[] = static::$availableOptions[$option]; - } - } - - /** - * Unsets some specific style option. - * - * @param string $option The option name - * - * @throws \InvalidArgumentException When the option name isn't defined - * - */ - public function unsetOption($option) - { - if (!isset(static::$availableOptions[$option])) { - throw new \InvalidArgumentException(sprintf( - 'Invalid option specified: "%s". Expected one of (%s)', - $option, - implode(', ', array_keys(static::$availableOptions)) - )); - } - - $pos = array_search(static::$availableOptions[$option], $this->options); - if (false !== $pos) { - unset($this->options[$pos]); - } - } - - /** - * Sets multiple style options at once. - * - * @param array $options - */ - public function setOptions(array $options) - { - $this->options = array(); - - foreach ($options as $option) { - $this->setOption($option); - } - } - - /** - * Applies the style to a given text. - * - * @param string $text The text to style - * - * @return string - */ - public function apply($text) - { - $codes = array(); - - if (null !== $this->foreground) { - $codes[] = $this->foreground; - } - if (null !== $this->background) { - $codes[] = $this->background; - } - if (count($this->options)) { - $codes = array_merge($codes, $this->options); - } - - return sprintf("\033[%sm%s\033[0m", implode(';', $codes), $text); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php deleted file mode 100644 index e8642b3..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * Formatter style interface for defining styles. - * - * @author Konstantin Kudryashov - * - * @api - */ -interface OutputFormatterStyleInterface -{ - /** - * Sets style foreground color. - * - * @param string $color The color name - * - * @api - */ - public function setForeground($color = null); - - /** - * Sets style background color. - * - * @param string $color The color name - * - * @api - */ - public function setBackground($color = null); - - /** - * Sets some specific style option. - * - * @param string $option The option name - * - * @api - */ - public function setOption($option); - - /** - * Unsets some specific style option. - * - * @param string $option The option name - */ - public function unsetOption($option); - - /** - * Sets multiple style options at once. - * - * @param array $options - */ - public function setOptions(array $options); - - /** - * Applies the style to a given text. - * - * @param string $text The text to style - * - * @return string - */ - public function apply($text); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php deleted file mode 100644 index 5915023..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php +++ /dev/null @@ -1,121 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * @author Jean-François Simon - */ -class OutputFormatterStyleStack -{ - /** - * @var OutputFormatterStyleInterface[] - */ - private $styles; - - /** - * @var OutputFormatterStyleInterface - */ - private $emptyStyle; - - /** - * Constructor. - * - * @param OutputFormatterStyleInterface $emptyStyle - */ - public function __construct(OutputFormatterStyleInterface $emptyStyle = null) - { - $this->emptyStyle = $emptyStyle ?: new OutputFormatterStyle(); - $this->reset(); - } - - /** - * Resets stack (ie. empty internal arrays). - */ - public function reset() - { - $this->styles = array(); - } - - /** - * Pushes a style in the stack. - * - * @param OutputFormatterStyleInterface $style - */ - public function push(OutputFormatterStyleInterface $style) - { - $this->styles[] = $style; - } - - /** - * Pops a style from the stack. - * - * @param OutputFormatterStyleInterface $style - * - * @return OutputFormatterStyleInterface - * - * @throws \InvalidArgumentException When style tags incorrectly nested - */ - public function pop(OutputFormatterStyleInterface $style = null) - { - if (empty($this->styles)) { - return $this->emptyStyle; - } - - if (null === $style) { - return array_pop($this->styles); - } - - foreach (array_reverse($this->styles, true) as $index => $stackedStyle) { - if ($style->apply('') === $stackedStyle->apply('')) { - $this->styles = array_slice($this->styles, 0, $index); - - return $stackedStyle; - } - } - - throw new \InvalidArgumentException('Incorrectly nested style tag found.'); - } - - /** - * Computes current style with stacks top codes. - * - * @return OutputFormatterStyle - */ - public function getCurrent() - { - if (empty($this->styles)) { - return $this->emptyStyle; - } - - return $this->styles[count($this->styles)-1]; - } - - /** - * @param OutputFormatterStyleInterface $emptyStyle - * - * @return OutputFormatterStyleStack - */ - public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle) - { - $this->emptyStyle = $emptyStyle; - - return $this; - } - - /** - * @return OutputFormatterStyleInterface - */ - public function getEmptyStyle() - { - return $this->emptyStyle; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Helper/DialogHelper.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Helper/DialogHelper.php deleted file mode 100644 index 03daf8c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Helper/DialogHelper.php +++ /dev/null @@ -1,141 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Output\OutputInterface; - -/** - * The Dialog class provides helpers to interact with the user. - * - * @author Fabien Potencier - */ -class DialogHelper extends Helper -{ - private $inputStream; - - /** - * Asks a question to the user. - * - * @param OutputInterface $output An Output instance - * @param string|array $question The question to ask - * @param string $default The default answer if none is given by the user - * - * @return string The user answer - * - * @throws \RuntimeException If there is no data to read in the input stream - */ - public function ask(OutputInterface $output, $question, $default = null) - { - $output->write($question); - - $ret = fgets($this->inputStream ?: STDIN, 4096); - if (false === $ret) { - throw new \RuntimeException('Aborted'); - } - $ret = trim($ret); - - return strlen($ret) > 0 ? $ret : $default; - } - - /** - * Asks a confirmation to the user. - * - * The question will be asked until the user answers by nothing, yes, or no. - * - * @param OutputInterface $output An Output instance - * @param string|array $question The question to ask - * @param Boolean $default The default answer if the user enters nothing - * - * @return Boolean true if the user has confirmed, false otherwise - */ - public function askConfirmation(OutputInterface $output, $question, $default = true) - { - $answer = 'z'; - while ($answer && !in_array(strtolower($answer[0]), array('y', 'n'))) { - $answer = $this->ask($output, $question); - } - - if (false === $default) { - return $answer && 'y' == strtolower($answer[0]); - } - - return !$answer || 'y' == strtolower($answer[0]); - } - - /** - * Asks for a value and validates the response. - * - * The validator receives the data to validate. It must return the - * validated data when the data is valid and throw an exception - * otherwise. - * - * @param OutputInterface $output An Output instance - * @param string|array $question The question to ask - * @param callback $validator A PHP callback - * @param integer $attempts Max number of times to ask before giving up (false by default, which means infinite) - * @param string $default The default answer if none is given by the user - * - * @return mixed - * - * @throws \Exception When any of the validators return an error - */ - public function askAndValidate(OutputInterface $output, $question, $validator, $attempts = false, $default = null) - { - $error = null; - while (false === $attempts || $attempts--) { - if (null !== $error) { - $output->writeln($this->getHelperSet()->get('formatter')->formatBlock($error->getMessage(), 'error')); - } - - $value = $this->ask($output, $question, $default); - - try { - return call_user_func($validator, $value); - } catch (\Exception $error) { - } - } - - throw $error; - } - - /** - * Sets the input stream to read from when interacting with the user. - * - * This is mainly useful for testing purpose. - * - * @param resource $stream The input stream - */ - public function setInputStream($stream) - { - $this->inputStream = $stream; - } - - /** - * Returns the helper's input stream - * - * @return string - */ - public function getInputStream() - { - return $this->inputStream; - } - - /** - * Returns the helper's canonical name. - * - * @return string The helper name - */ - public function getName() - { - return 'dialog'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Helper/FormatterHelper.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Helper/FormatterHelper.php deleted file mode 100644 index 34ae394..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Helper/FormatterHelper.php +++ /dev/null @@ -1,102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Formatter\OutputFormatter; - -/** - * The Formatter class provides helpers to format messages. - * - * @author Fabien Potencier - */ -class FormatterHelper extends Helper -{ - /** - * Formats a message within a section. - * - * @param string $section The section name - * @param string $message The message - * @param string $style The style to apply to the section - * - * @return string The format section - */ - public function formatSection($section, $message, $style = 'info') - { - return sprintf('<%s>[%s] %s', $style, $section, $style, $message); - } - - /** - * Formats a message as a block of text. - * - * @param string|array $messages The message to write in the block - * @param string $style The style to apply to the whole block - * @param Boolean $large Whether to return a large block - * - * @return string The formatter message - */ - public function formatBlock($messages, $style, $large = false) - { - $messages = (array) $messages; - - $len = 0; - $lines = array(); - foreach ($messages as $message) { - $message = OutputFormatter::escape($message); - $lines[] = sprintf($large ? ' %s ' : ' %s ', $message); - $len = max($this->strlen($message) + ($large ? 4 : 2), $len); - } - - $messages = $large ? array(str_repeat(' ', $len)) : array(); - foreach ($lines as $line) { - $messages[] = $line.str_repeat(' ', $len - $this->strlen($line)); - } - if ($large) { - $messages[] = str_repeat(' ', $len); - } - - foreach ($messages as &$message) { - $message = sprintf('<%s>%s', $style, $message, $style); - } - - return implode("\n", $messages); - } - - /** - * Returns the length of a string, using mb_strlen if it is available. - * - * @param string $string The string to check its length - * - * @return integer The length of the string - */ - private function strlen($string) - { - if (!function_exists('mb_strlen')) { - return strlen($string); - } - - if (false === $encoding = mb_detect_encoding($string)) { - return strlen($string); - } - - return mb_strlen($string, $encoding); - } - - /** - * Returns the helper's canonical name. - * - * @return string The canonical name of the helper - */ - public function getName() - { - return 'formatter'; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Helper/Helper.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Helper/Helper.php deleted file mode 100644 index 28488ca..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Helper/Helper.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * Helper is the base class for all helper classes. - * - * @author Fabien Potencier - */ -abstract class Helper implements HelperInterface -{ - protected $helperSet = null; - - /** - * Sets the helper set associated with this helper. - * - * @param HelperSet $helperSet A HelperSet instance - */ - public function setHelperSet(HelperSet $helperSet = null) - { - $this->helperSet = $helperSet; - } - - /** - * Gets the helper set associated with this helper. - * - * @return HelperSet A HelperSet instance - */ - public function getHelperSet() - { - return $this->helperSet; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Helper/HelperInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Helper/HelperInterface.php deleted file mode 100644 index 6d39449..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Helper/HelperInterface.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * HelperInterface is the interface all helpers must implement. - * - * @author Fabien Potencier - * - * @api - */ -interface HelperInterface -{ - /** - * Sets the helper set associated with this helper. - * - * @param HelperSet $helperSet A HelperSet instance - * - * @api - */ - public function setHelperSet(HelperSet $helperSet = null); - - /** - * Gets the helper set associated with this helper. - * - * @return HelperSet A HelperSet instance - * - * @api - */ - public function getHelperSet(); - - /** - * Returns the canonical name of this helper. - * - * @return string The canonical name - * - * @api - */ - public function getName(); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Helper/HelperSet.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Helper/HelperSet.php deleted file mode 100644 index d95c9a3..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Helper/HelperSet.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Command\Command; - -/** - * HelperSet represents a set of helpers to be used with a command. - * - * @author Fabien Potencier - */ -class HelperSet -{ - private $helpers; - private $command; - - /** - * Constructor. - * - * @param Helper[] $helpers An array of helper. - */ - public function __construct(array $helpers = array()) - { - $this->helpers = array(); - foreach ($helpers as $alias => $helper) { - $this->set($helper, is_int($alias) ? null : $alias); - } - } - - /** - * Sets a helper. - * - * @param HelperInterface $helper The helper instance - * @param string $alias An alias - */ - public function set(HelperInterface $helper, $alias = null) - { - $this->helpers[$helper->getName()] = $helper; - if (null !== $alias) { - $this->helpers[$alias] = $helper; - } - - $helper->setHelperSet($this); - } - - /** - * Returns true if the helper if defined. - * - * @param string $name The helper name - * - * @return Boolean true if the helper is defined, false otherwise - */ - public function has($name) - { - return isset($this->helpers[$name]); - } - - /** - * Gets a helper value. - * - * @param string $name The helper name - * - * @return HelperInterface The helper instance - * - * @throws \InvalidArgumentException if the helper is not defined - */ - public function get($name) - { - if (!$this->has($name)) { - throw new \InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name)); - } - - return $this->helpers[$name]; - } - - /** - * Sets the command associated with this helper set. - * - * @param Command $command A Command instance - */ - public function setCommand(Command $command = null) - { - $this->command = $command; - } - - /** - * Gets the command associated with this helper set. - * - * @return Command A Command instance - */ - public function getCommand() - { - return $this->command; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Input/ArgvInput.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Input/ArgvInput.php deleted file mode 100644 index 3ca9b05..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Input/ArgvInput.php +++ /dev/null @@ -1,313 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -/** - * ArgvInput represents an input coming from the CLI arguments. - * - * Usage: - * - * $input = new ArgvInput(); - * - * By default, the `$_SERVER['argv']` array is used for the input values. - * - * This can be overridden by explicitly passing the input values in the constructor: - * - * $input = new ArgvInput($_SERVER['argv']); - * - * If you pass it yourself, don't forget that the first element of the array - * is the name of the running application. - * - * When passing an argument to the constructor, be sure that it respects - * the same rules as the argv one. It's almost always better to use the - * `StringInput` when you want to provide your own input. - * - * @author Fabien Potencier - * - * @see http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html - * @see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02 - * - * @api - */ -class ArgvInput extends Input -{ - private $tokens; - private $parsed; - - /** - * Constructor. - * - * @param array $argv An array of parameters from the CLI (in the argv format) - * @param InputDefinition $definition A InputDefinition instance - * - * @api - */ - public function __construct(array $argv = null, InputDefinition $definition = null) - { - if (null === $argv) { - $argv = $_SERVER['argv']; - } - - // strip the application name - array_shift($argv); - - $this->tokens = $argv; - - parent::__construct($definition); - } - - protected function setTokens(array $tokens) - { - $this->tokens = $tokens; - } - - /** - * Processes command line arguments. - */ - protected function parse() - { - $parseOptions = true; - $this->parsed = $this->tokens; - while (null !== $token = array_shift($this->parsed)) { - if ($parseOptions && '' == $token) { - $this->parseArgument($token); - } elseif ($parseOptions && '--' == $token) { - $parseOptions = false; - } elseif ($parseOptions && 0 === strpos($token, '--')) { - $this->parseLongOption($token); - } elseif ($parseOptions && '-' === $token[0]) { - $this->parseShortOption($token); - } else { - $this->parseArgument($token); - } - } - } - - /** - * Parses a short option. - * - * @param string $token The current token. - */ - private function parseShortOption($token) - { - $name = substr($token, 1); - - if (strlen($name) > 1) { - if ($this->definition->hasShortcut($name[0]) && $this->definition->getOptionForShortcut($name[0])->acceptValue()) { - // an option with a value (with no space) - $this->addShortOption($name[0], substr($name, 1)); - } else { - $this->parseShortOptionSet($name); - } - } else { - $this->addShortOption($name, null); - } - } - - /** - * Parses a short option set. - * - * @param string $name The current token - * - * @throws \RuntimeException When option given doesn't exist - */ - private function parseShortOptionSet($name) - { - $len = strlen($name); - for ($i = 0; $i < $len; $i++) { - if (!$this->definition->hasShortcut($name[$i])) { - throw new \RuntimeException(sprintf('The "-%s" option does not exist.', $name[$i])); - } - - $option = $this->definition->getOptionForShortcut($name[$i]); - if ($option->acceptValue()) { - $this->addLongOption($option->getName(), $i === $len - 1 ? null : substr($name, $i + 1)); - - break; - } else { - $this->addLongOption($option->getName(), true); - } - } - } - - /** - * Parses a long option. - * - * @param string $token The current token - */ - private function parseLongOption($token) - { - $name = substr($token, 2); - - if (false !== $pos = strpos($name, '=')) { - $this->addLongOption(substr($name, 0, $pos), substr($name, $pos + 1)); - } else { - $this->addLongOption($name, null); - } - } - - /** - * Parses an argument. - * - * @param string $token The current token - * - * @throws \RuntimeException When too many arguments are given - */ - private function parseArgument($token) - { - $c = count($this->arguments); - - // if input is expecting another argument, add it - if ($this->definition->hasArgument($c)) { - $arg = $this->definition->getArgument($c); - $this->arguments[$arg->getName()] = $arg->isArray()? array($token) : $token; - - // if last argument isArray(), append token to last argument - } elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) { - $arg = $this->definition->getArgument($c - 1); - $this->arguments[$arg->getName()][] = $token; - - // unexpected argument - } else { - throw new \RuntimeException('Too many arguments.'); - } - } - - /** - * Adds a short option value. - * - * @param string $shortcut The short option key - * @param mixed $value The value for the option - * - * @throws \RuntimeException When option given doesn't exist - */ - private function addShortOption($shortcut, $value) - { - if (!$this->definition->hasShortcut($shortcut)) { - throw new \RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut)); - } - - $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); - } - - /** - * Adds a long option value. - * - * @param string $name The long option key - * @param mixed $value The value for the option - * - * @throws \RuntimeException When option given doesn't exist - */ - private function addLongOption($name, $value) - { - if (!$this->definition->hasOption($name)) { - throw new \RuntimeException(sprintf('The "--%s" option does not exist.', $name)); - } - - $option = $this->definition->getOption($name); - - if (null === $value && $option->acceptValue()) { - // if option accepts an optional or mandatory argument - // let's see if there is one provided - $next = array_shift($this->parsed); - if ('-' !== $next[0]) { - $value = $next; - } else { - array_unshift($this->parsed, $next); - } - } - - if (null === $value) { - if ($option->isValueRequired()) { - throw new \RuntimeException(sprintf('The "--%s" option requires a value.', $name)); - } - - $value = $option->isValueOptional() ? $option->getDefault() : true; - } - - if ($option->isArray()) { - $this->options[$name][] = $value; - } else { - $this->options[$name] = $value; - } - } - - /** - * Returns the first argument from the raw parameters (not parsed). - * - * @return string The value of the first argument or null otherwise - */ - public function getFirstArgument() - { - foreach ($this->tokens as $token) { - if ($token && '-' === $token[0]) { - continue; - } - - return $token; - } - } - - /** - * Returns true if the raw parameters (not parsed) contain a value. - * - * This method is to be used to introspect the input parameters - * before they have been validated. It must be used carefully. - * - * @param string|array $values The value(s) to look for in the raw parameters (can be an array) - * - * @return Boolean true if the value is contained in the raw parameters - */ - public function hasParameterOption($values) - { - $values = (array) $values; - - foreach ($this->tokens as $v) { - if (in_array($v, $values)) { - return true; - } - } - - return false; - } - - /** - * Returns the value of a raw option (not parsed). - * - * This method is to be used to introspect the input parameters - * before they have been validated. It must be used carefully. - * - * @param string|array $values The value(s) to look for in the raw parameters (can be an array) - * @param mixed $default The default value to return if no result is found - * - * @return mixed The option value - */ - public function getParameterOption($values, $default = false) - { - $values = (array) $values; - - $tokens = $this->tokens; - while ($token = array_shift($tokens)) { - foreach ($values as $value) { - if (0 === strpos($token, $value)) { - if (false !== $pos = strpos($token, '=')) { - return substr($token, $pos + 1); - } - - return array_shift($tokens); - } - } - } - - return $default; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Input/ArrayInput.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Input/ArrayInput.php deleted file mode 100644 index 9921fff..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Input/ArrayInput.php +++ /dev/null @@ -1,190 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -/** - * ArrayInput represents an input provided as an array. - * - * Usage: - * - * $input = new ArrayInput(array('name' => 'foo', '--bar' => 'foobar')); - * - * @author Fabien Potencier - * - * @api - */ -class ArrayInput extends Input -{ - private $parameters; - - /** - * Constructor. - * - * @param array $parameters An array of parameters - * @param InputDefinition $definition A InputDefinition instance - * - * @api - */ - public function __construct(array $parameters, InputDefinition $definition = null) - { - $this->parameters = $parameters; - - parent::__construct($definition); - } - - /** - * Returns the first argument from the raw parameters (not parsed). - * - * @return string The value of the first argument or null otherwise - */ - public function getFirstArgument() - { - foreach ($this->parameters as $key => $value) { - if ($key && '-' === $key[0]) { - continue; - } - - return $value; - } - } - - /** - * Returns true if the raw parameters (not parsed) contain a value. - * - * This method is to be used to introspect the input parameters - * before they have been validated. It must be used carefully. - * - * @param string|array $values The values to look for in the raw parameters (can be an array) - * - * @return Boolean true if the value is contained in the raw parameters - */ - public function hasParameterOption($values) - { - $values = (array) $values; - - foreach ($this->parameters as $k => $v) { - if (!is_int($k)) { - $v = $k; - } - - if (in_array($v, $values)) { - return true; - } - } - - return false; - } - - /** - * Returns the value of a raw option (not parsed). - * - * This method is to be used to introspect the input parameters - * before they have been validated. It must be used carefully. - * - * @param string|array $values The value(s) to look for in the raw parameters (can be an array) - * @param mixed $default The default value to return if no result is found - * - * @return mixed The option value - */ - public function getParameterOption($values, $default = false) - { - $values = (array) $values; - - foreach ($this->parameters as $k => $v) { - if (is_int($k) && in_array($v, $values)) { - return true; - } elseif (in_array($k, $values)) { - return $v; - } - } - - return $default; - } - - /** - * Processes command line arguments. - */ - protected function parse() - { - foreach ($this->parameters as $key => $value) { - if (0 === strpos($key, '--')) { - $this->addLongOption(substr($key, 2), $value); - } elseif ('-' === $key[0]) { - $this->addShortOption(substr($key, 1), $value); - } else { - $this->addArgument($key, $value); - } - } - } - - /** - * Adds a short option value. - * - * @param string $shortcut The short option key - * @param mixed $value The value for the option - * - * @throws \InvalidArgumentException When option given doesn't exist - */ - private function addShortOption($shortcut, $value) - { - if (!$this->definition->hasShortcut($shortcut)) { - throw new \InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut)); - } - - $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); - } - - /** - * Adds a long option value. - * - * @param string $name The long option key - * @param mixed $value The value for the option - * - * @throws \InvalidArgumentException When option given doesn't exist - * @throws \InvalidArgumentException When a required value is missing - */ - private function addLongOption($name, $value) - { - if (!$this->definition->hasOption($name)) { - throw new \InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name)); - } - - $option = $this->definition->getOption($name); - - if (null === $value) { - if ($option->isValueRequired()) { - throw new \InvalidArgumentException(sprintf('The "--%s" option requires a value.', $name)); - } - - $value = $option->isValueOptional() ? $option->getDefault() : true; - } - - $this->options[$name] = $value; - } - - /** - * Adds an argument value. - * - * @param string $name The argument name - * @param mixed $value The value for the argument - * - * @throws \InvalidArgumentException When argument given doesn't exist - */ - private function addArgument($name, $value) - { - if (!$this->definition->hasArgument($name)) { - throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - $this->arguments[$name] = $value; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Input/Input.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Input/Input.php deleted file mode 100644 index 70291be..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Input/Input.php +++ /dev/null @@ -1,211 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -/** - * Input is the base class for all concrete Input classes. - * - * Three concrete classes are provided by default: - * - * * `ArgvInput`: The input comes from the CLI arguments (argv) - * * `StringInput`: The input is provided as a string - * * `ArrayInput`: The input is provided as an array - * - * @author Fabien Potencier - */ -abstract class Input implements InputInterface -{ - protected $definition; - protected $options; - protected $arguments; - protected $interactive = true; - - /** - * Constructor. - * - * @param InputDefinition $definition A InputDefinition instance - */ - public function __construct(InputDefinition $definition = null) - { - if (null === $definition) { - $this->definition = new InputDefinition(); - } else { - $this->bind($definition); - $this->validate(); - } - } - - /** - * Binds the current Input instance with the given arguments and options. - * - * @param InputDefinition $definition A InputDefinition instance - */ - public function bind(InputDefinition $definition) - { - $this->arguments = array(); - $this->options = array(); - $this->definition = $definition; - - $this->parse(); - } - - /** - * Processes command line arguments. - */ - abstract protected function parse(); - - /** - * Validates the input. - * - * @throws \RuntimeException When not enough arguments are given - */ - public function validate() - { - if (count($this->arguments) < $this->definition->getArgumentRequiredCount()) { - throw new \RuntimeException('Not enough arguments.'); - } - } - - /** - * Checks if the input is interactive. - * - * @return Boolean Returns true if the input is interactive - */ - public function isInteractive() - { - return $this->interactive; - } - - /** - * Sets the input interactivity. - * - * @param Boolean $interactive If the input should be interactive - */ - public function setInteractive($interactive) - { - $this->interactive = (Boolean) $interactive; - } - - /** - * Returns the argument values. - * - * @return array An array of argument values - */ - public function getArguments() - { - return array_merge($this->definition->getArgumentDefaults(), $this->arguments); - } - - /** - * Returns the argument value for a given argument name. - * - * @param string $name The argument name - * - * @return mixed The argument value - * - * @throws \InvalidArgumentException When argument given doesn't exist - */ - public function getArgument($name) - { - if (!$this->definition->hasArgument($name)) { - throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - return isset($this->arguments[$name]) ? $this->arguments[$name] : $this->definition->getArgument($name)->getDefault(); - } - - /** - * Sets an argument value by name. - * - * @param string $name The argument name - * @param string $value The argument value - * - * @throws \InvalidArgumentException When argument given doesn't exist - */ - public function setArgument($name, $value) - { - if (!$this->definition->hasArgument($name)) { - throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - $this->arguments[$name] = $value; - } - - /** - * Returns true if an InputArgument object exists by name or position. - * - * @param string|integer $name The InputArgument name or position - * - * @return Boolean true if the InputArgument object exists, false otherwise - */ - public function hasArgument($name) - { - return $this->definition->hasArgument($name); - } - - /** - * Returns the options values. - * - * @return array An array of option values - */ - public function getOptions() - { - return array_merge($this->definition->getOptionDefaults(), $this->options); - } - - /** - * Returns the option value for a given option name. - * - * @param string $name The option name - * - * @return mixed The option value - * - * @throws \InvalidArgumentException When option given doesn't exist - */ - public function getOption($name) - { - if (!$this->definition->hasOption($name)) { - throw new \InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); - } - - return isset($this->options[$name]) ? $this->options[$name] : $this->definition->getOption($name)->getDefault(); - } - - /** - * Sets an option value by name. - * - * @param string $name The option name - * @param string $value The option value - * - * @throws \InvalidArgumentException When option given doesn't exist - */ - public function setOption($name, $value) - { - if (!$this->definition->hasOption($name)) { - throw new \InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); - } - - $this->options[$name] = $value; - } - - /** - * Returns true if an InputOption object exists by name. - * - * @param string $name The InputOption name - * - * @return Boolean true if the InputOption object exists, false otherwise - */ - public function hasOption($name) - { - return $this->definition->hasOption($name); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Input/InputArgument.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Input/InputArgument.php deleted file mode 100644 index e7cc935..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Input/InputArgument.php +++ /dev/null @@ -1,132 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -/** - * Represents a command line argument. - * - * @author Fabien Potencier - * - * @api - */ -class InputArgument -{ - const REQUIRED = 1; - const OPTIONAL = 2; - const IS_ARRAY = 4; - - private $name; - private $mode; - private $default; - private $description; - - /** - * Constructor. - * - * @param string $name The argument name - * @param integer $mode The argument mode: self::REQUIRED or self::OPTIONAL - * @param string $description A description text - * @param mixed $default The default value (for self::OPTIONAL mode only) - * - * @throws \InvalidArgumentException When argument mode is not valid - * - * @api - */ - public function __construct($name, $mode = null, $description = '', $default = null) - { - if (null === $mode) { - $mode = self::OPTIONAL; - } elseif (!is_int($mode) || $mode > 7 || $mode < 1) { - throw new \InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode)); - } - - $this->name = $name; - $this->mode = $mode; - $this->description = $description; - - $this->setDefault($default); - } - - /** - * Returns the argument name. - * - * @return string The argument name - */ - public function getName() - { - return $this->name; - } - - /** - * Returns true if the argument is required. - * - * @return Boolean true if parameter mode is self::REQUIRED, false otherwise - */ - public function isRequired() - { - return self::REQUIRED === (self::REQUIRED & $this->mode); - } - - /** - * Returns true if the argument can take multiple values. - * - * @return Boolean true if mode is self::IS_ARRAY, false otherwise - */ - public function isArray() - { - return self::IS_ARRAY === (self::IS_ARRAY & $this->mode); - } - - /** - * Sets the default value. - * - * @param mixed $default The default value - * - * @throws \LogicException When incorrect default value is given - */ - public function setDefault($default = null) - { - if (self::REQUIRED === $this->mode && null !== $default) { - throw new \LogicException('Cannot set a default value except for Parameter::OPTIONAL mode.'); - } - - if ($this->isArray()) { - if (null === $default) { - $default = array(); - } elseif (!is_array($default)) { - throw new \LogicException('A default value for an array argument must be an array.'); - } - } - - $this->default = $default; - } - - /** - * Returns the default value. - * - * @return mixed The default value - */ - public function getDefault() - { - return $this->default; - } - - /** - * Returns the description text. - * - * @return string The description text - */ - public function getDescription() - { - return $this->description; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Input/InputDefinition.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Input/InputDefinition.php deleted file mode 100644 index 2db9222..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Input/InputDefinition.php +++ /dev/null @@ -1,531 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -/** - * A InputDefinition represents a set of valid command line arguments and options. - * - * Usage: - * - * $definition = new InputDefinition(array( - * new InputArgument('name', InputArgument::REQUIRED), - * new InputOption('foo', 'f', InputOption::VALUE_REQUIRED), - * )); - * - * @author Fabien Potencier - * - * @api - */ -class InputDefinition -{ - private $arguments; - private $requiredCount; - private $hasAnArrayArgument = false; - private $hasOptional; - private $options; - private $shortcuts; - - /** - * Constructor. - * - * @param array $definition An array of InputArgument and InputOption instance - * - * @api - */ - public function __construct(array $definition = array()) - { - $this->setDefinition($definition); - } - - /** - * Sets the definition of the input. - * - * @param array $definition The definition array - * - * @api - */ - public function setDefinition(array $definition) - { - $arguments = array(); - $options = array(); - foreach ($definition as $item) { - if ($item instanceof InputOption) { - $options[] = $item; - } else { - $arguments[] = $item; - } - } - - $this->setArguments($arguments); - $this->setOptions($options); - } - - /** - * Sets the InputArgument objects. - * - * @param array $arguments An array of InputArgument objects - * - * @api - */ - public function setArguments($arguments = array()) - { - $this->arguments = array(); - $this->requiredCount = 0; - $this->hasOptional = false; - $this->hasAnArrayArgument = false; - $this->addArguments($arguments); - } - - /** - * Adds an array of InputArgument objects. - * - * @param InputArgument[] $arguments An array of InputArgument objects - * - * @api - */ - public function addArguments($arguments = array()) - { - if (null !== $arguments) { - foreach ($arguments as $argument) { - $this->addArgument($argument); - } - } - } - - /** - * Adds an InputArgument object. - * - * @param InputArgument $argument An InputArgument object - * - * @throws \LogicException When incorrect argument is given - * - * @api - */ - public function addArgument(InputArgument $argument) - { - if (isset($this->arguments[$argument->getName()])) { - throw new \LogicException(sprintf('An argument with name "%s" already exists.', $argument->getName())); - } - - if ($this->hasAnArrayArgument) { - throw new \LogicException('Cannot add an argument after an array argument.'); - } - - if ($argument->isRequired() && $this->hasOptional) { - throw new \LogicException('Cannot add a required argument after an optional one.'); - } - - if ($argument->isArray()) { - $this->hasAnArrayArgument = true; - } - - if ($argument->isRequired()) { - ++$this->requiredCount; - } else { - $this->hasOptional = true; - } - - $this->arguments[$argument->getName()] = $argument; - } - - /** - * Returns an InputArgument by name or by position. - * - * @param string|integer $name The InputArgument name or position - * - * @return InputArgument An InputArgument object - * - * @throws \InvalidArgumentException When argument given doesn't exist - * - * @api - */ - public function getArgument($name) - { - $arguments = is_int($name) ? array_values($this->arguments) : $this->arguments; - - if (!$this->hasArgument($name)) { - throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - return $arguments[$name]; - } - - /** - * Returns true if an InputArgument object exists by name or position. - * - * @param string|integer $name The InputArgument name or position - * - * @return Boolean true if the InputArgument object exists, false otherwise - * - * @api - */ - public function hasArgument($name) - { - $arguments = is_int($name) ? array_values($this->arguments) : $this->arguments; - - return isset($arguments[$name]); - } - - /** - * Gets the array of InputArgument objects. - * - * @return array An array of InputArgument objects - * - * @api - */ - public function getArguments() - { - return $this->arguments; - } - - /** - * Returns the number of InputArguments. - * - * @return integer The number of InputArguments - */ - public function getArgumentCount() - { - return $this->hasAnArrayArgument ? PHP_INT_MAX : count($this->arguments); - } - - /** - * Returns the number of required InputArguments. - * - * @return integer The number of required InputArguments - */ - public function getArgumentRequiredCount() - { - return $this->requiredCount; - } - - /** - * Gets the default values. - * - * @return array An array of default values - */ - public function getArgumentDefaults() - { - $values = array(); - foreach ($this->arguments as $argument) { - $values[$argument->getName()] = $argument->getDefault(); - } - - return $values; - } - - /** - * Sets the InputOption objects. - * - * @param array $options An array of InputOption objects - * - * @api - */ - public function setOptions($options = array()) - { - $this->options = array(); - $this->shortcuts = array(); - $this->addOptions($options); - } - - /** - * Adds an array of InputOption objects. - * - * @param InputOption[] $options An array of InputOption objects - * - * @api - */ - public function addOptions($options = array()) - { - foreach ($options as $option) { - $this->addOption($option); - } - } - - /** - * Adds an InputOption object. - * - * @param InputOption $option An InputOption object - * - * @throws \LogicException When option given already exist - * - * @api - */ - public function addOption(InputOption $option) - { - if (isset($this->options[$option->getName()]) && !$option->equals($this->options[$option->getName()])) { - throw new \LogicException(sprintf('An option named "%s" already exists.', $option->getName())); - } elseif (isset($this->shortcuts[$option->getShortcut()]) && !$option->equals($this->options[$this->shortcuts[$option->getShortcut()]])) { - throw new \LogicException(sprintf('An option with shortcut "%s" already exists.', $option->getShortcut())); - } - - $this->options[$option->getName()] = $option; - if ($option->getShortcut()) { - $this->shortcuts[$option->getShortcut()] = $option->getName(); - } - } - - /** - * Returns an InputOption by name. - * - * @param string $name The InputOption name - * - * @return InputOption A InputOption object - * - * @throws \InvalidArgumentException When option given doesn't exist - * - * @api - */ - public function getOption($name) - { - if (!$this->hasOption($name)) { - throw new \InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name)); - } - - return $this->options[$name]; - } - - /** - * Returns true if an InputOption object exists by name. - * - * @param string $name The InputOption name - * - * @return Boolean true if the InputOption object exists, false otherwise - * - * @api - */ - public function hasOption($name) - { - return isset($this->options[$name]); - } - - /** - * Gets the array of InputOption objects. - * - * @return array An array of InputOption objects - * - * @api - */ - public function getOptions() - { - return $this->options; - } - - /** - * Returns true if an InputOption object exists by shortcut. - * - * @param string $name The InputOption shortcut - * - * @return Boolean true if the InputOption object exists, false otherwise - */ - public function hasShortcut($name) - { - return isset($this->shortcuts[$name]); - } - - /** - * Gets an InputOption by shortcut. - * - * @param string $shortcut the Shortcut name - * - * @return InputOption An InputOption object - */ - public function getOptionForShortcut($shortcut) - { - return $this->getOption($this->shortcutToName($shortcut)); - } - - /** - * Gets an array of default values. - * - * @return array An array of all default values - */ - public function getOptionDefaults() - { - $values = array(); - foreach ($this->options as $option) { - $values[$option->getName()] = $option->getDefault(); - } - - return $values; - } - - /** - * Returns the InputOption name given a shortcut. - * - * @param string $shortcut The shortcut - * - * @return string The InputOption name - * - * @throws \InvalidArgumentException When option given does not exist - */ - private function shortcutToName($shortcut) - { - if (!isset($this->shortcuts[$shortcut])) { - throw new \InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut)); - } - - return $this->shortcuts[$shortcut]; - } - - /** - * Gets the synopsis. - * - * @return string The synopsis - */ - public function getSynopsis() - { - $elements = array(); - foreach ($this->getOptions() as $option) { - $shortcut = $option->getShortcut() ? sprintf('-%s|', $option->getShortcut()) : ''; - $elements[] = sprintf('['.($option->isValueRequired() ? '%s--%s="..."' : ($option->isValueOptional() ? '%s--%s[="..."]' : '%s--%s')).']', $shortcut, $option->getName()); - } - - foreach ($this->getArguments() as $argument) { - $elements[] = sprintf($argument->isRequired() ? '%s' : '[%s]', $argument->getName().($argument->isArray() ? '1' : '')); - - if ($argument->isArray()) { - $elements[] = sprintf('... [%sN]', $argument->getName()); - } - } - - return implode(' ', $elements); - } - - /** - * Returns a textual representation of the InputDefinition. - * - * @return string A string representing the InputDefinition - */ - public function asText() - { - // find the largest option or argument name - $max = 0; - foreach ($this->getOptions() as $option) { - $nameLength = strlen($option->getName()) + 2; - if ($option->getShortcut()) { - $nameLength += strlen($option->getShortcut()) + 3; - } - - $max = max($max, $nameLength); - } - foreach ($this->getArguments() as $argument) { - $max = max($max, strlen($argument->getName())); - } - ++$max; - - $text = array(); - - if ($this->getArguments()) { - $text[] = 'Arguments:'; - foreach ($this->getArguments() as $argument) { - if (null !== $argument->getDefault() && (!is_array($argument->getDefault()) || count($argument->getDefault()))) { - $default = sprintf(' (default: %s)', $this->formatDefaultValue($argument->getDefault())); - } else { - $default = ''; - } - - $description = str_replace("\n", "\n".str_pad('', $max + 2, ' '), $argument->getDescription()); - - $text[] = sprintf(" %-${max}s %s%s", $argument->getName(), $description, $default); - } - - $text[] = ''; - } - - if ($this->getOptions()) { - $text[] = 'Options:'; - - foreach ($this->getOptions() as $option) { - if ($option->acceptValue() && null !== $option->getDefault() && (!is_array($option->getDefault()) || count($option->getDefault()))) { - $default = sprintf(' (default: %s)', $this->formatDefaultValue($option->getDefault())); - } else { - $default = ''; - } - - $multiple = $option->isArray() ? ' (multiple values allowed)' : ''; - $description = str_replace("\n", "\n".str_pad('', $max + 2, ' '), $option->getDescription()); - - $optionMax = $max - strlen($option->getName()) - 2; - $text[] = sprintf(" %s %-${optionMax}s%s%s%s", - '--'.$option->getName(), - $option->getShortcut() ? sprintf('(-%s) ', $option->getShortcut()) : '', - $description, - $default, - $multiple - ); - } - - $text[] = ''; - } - - return implode("\n", $text); - } - - /** - * Returns an XML representation of the InputDefinition. - * - * @param Boolean $asDom Whether to return a DOM or an XML string - * - * @return string|DOMDocument An XML string representing the InputDefinition - */ - public function asXml($asDom = false) - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->formatOutput = true; - $dom->appendChild($definitionXML = $dom->createElement('definition')); - - $definitionXML->appendChild($argumentsXML = $dom->createElement('arguments')); - foreach ($this->getArguments() as $argument) { - $argumentsXML->appendChild($argumentXML = $dom->createElement('argument')); - $argumentXML->setAttribute('name', $argument->getName()); - $argumentXML->setAttribute('is_required', $argument->isRequired() ? 1 : 0); - $argumentXML->setAttribute('is_array', $argument->isArray() ? 1 : 0); - $argumentXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode($argument->getDescription())); - - $argumentXML->appendChild($defaultsXML = $dom->createElement('defaults')); - $defaults = is_array($argument->getDefault()) ? $argument->getDefault() : (is_bool($argument->getDefault()) ? array(var_export($argument->getDefault(), true)) : ($argument->getDefault() ? array($argument->getDefault()) : array())); - foreach ($defaults as $default) { - $defaultsXML->appendChild($defaultXML = $dom->createElement('default')); - $defaultXML->appendChild($dom->createTextNode($default)); - } - } - - $definitionXML->appendChild($optionsXML = $dom->createElement('options')); - foreach ($this->getOptions() as $option) { - $optionsXML->appendChild($optionXML = $dom->createElement('option')); - $optionXML->setAttribute('name', '--'.$option->getName()); - $optionXML->setAttribute('shortcut', $option->getShortcut() ? '-'.$option->getShortcut() : ''); - $optionXML->setAttribute('accept_value', $option->acceptValue() ? 1 : 0); - $optionXML->setAttribute('is_value_required', $option->isValueRequired() ? 1 : 0); - $optionXML->setAttribute('is_multiple', $option->isArray() ? 1 : 0); - $optionXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode($option->getDescription())); - - if ($option->acceptValue()) { - $optionXML->appendChild($defaultsXML = $dom->createElement('defaults')); - $defaults = is_array($option->getDefault()) ? $option->getDefault() : (is_bool($option->getDefault()) ? array(var_export($option->getDefault(), true)) : ($option->getDefault() ? array($option->getDefault()) : array())); - foreach ($defaults as $default) { - $defaultsXML->appendChild($defaultXML = $dom->createElement('default')); - $defaultXML->appendChild($dom->createTextNode($default)); - } - } - } - - return $asDom ? $dom : $dom->saveXml(); - } - - private function formatDefaultValue($default) - { - return json_encode($default); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Input/InputInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Input/InputInterface.php deleted file mode 100644 index c39429d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Input/InputInterface.php +++ /dev/null @@ -1,152 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -/** - * InputInterface is the interface implemented by all input classes. - * - * @author Fabien Potencier - */ -interface InputInterface -{ - /** - * Returns the first argument from the raw parameters (not parsed). - * - * @return string The value of the first argument or null otherwise - */ - public function getFirstArgument(); - - /** - * Returns true if the raw parameters (not parsed) contain a value. - * - * This method is to be used to introspect the input parameters - * before they have been validated. It must be used carefully. - * - * @param string|array $values The values to look for in the raw parameters (can be an array) - * - * @return Boolean true if the value is contained in the raw parameters - */ - public function hasParameterOption($values); - - /** - * Returns the value of a raw option (not parsed). - * - * This method is to be used to introspect the input parameters - * before they have been validated. It must be used carefully. - * - * @param string|array $values The value(s) to look for in the raw parameters (can be an array) - * @param mixed $default The default value to return if no result is found - * - * @return mixed The option value - */ - public function getParameterOption($values, $default = false); - - /** - * Binds the current Input instance with the given arguments and options. - * - * @param InputDefinition $definition A InputDefinition instance - */ - public function bind(InputDefinition $definition); - - /** - * Validates if arguments given are correct. - * - * Throws an exception when not enough arguments are given. - * - * @throws \RuntimeException - */ - public function validate(); - - /** - * Returns all the given arguments merged with the default values. - * - * @return array - */ - public function getArguments(); - - /** - * Gets argument by name. - * - * @param string $name The name of the argument - * - * @return mixed - */ - public function getArgument($name); - - /** - * Sets an argument value by name. - * - * @param string $name The argument name - * @param string $value The argument value - * - * @throws \InvalidArgumentException When argument given doesn't exist - */ - public function setArgument($name, $value); - - /** - * Returns true if an InputArgument object exists by name or position. - * - * @param string|integer $name The InputArgument name or position - * - * @return Boolean true if the InputArgument object exists, false otherwise - */ - public function hasArgument($name); - - /** - * Returns all the given options merged with the default values. - * - * @return array - */ - public function getOptions(); - - /** - * Gets an option by name. - * - * @param string $name The name of the option - * - * @return mixed - */ - public function getOption($name); - - /** - * Sets an option value by name. - * - * @param string $name The option name - * @param string $value The option value - * - * @throws \InvalidArgumentException When option given doesn't exist - */ - public function setOption($name, $value); - - /** - * Returns true if an InputOption object exists by name. - * - * @param string $name The InputOption name - * - * @return Boolean true if the InputOption object exists, false otherwise - */ - public function hasOption($name); - - /** - * Is this input means interactive? - * - * @return Boolean - */ - public function isInteractive(); - - /** - * Sets the input interactivity. - * - * @param Boolean $interactive If the input should be interactive - */ - public function setInteractive($interactive); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Input/InputOption.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Input/InputOption.php deleted file mode 100644 index e194b32..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Input/InputOption.php +++ /dev/null @@ -1,209 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -/** - * Represents a command line option. - * - * @author Fabien Potencier - * - * @api - */ -class InputOption -{ - const VALUE_NONE = 1; - const VALUE_REQUIRED = 2; - const VALUE_OPTIONAL = 4; - const VALUE_IS_ARRAY = 8; - - private $name; - private $shortcut; - private $mode; - private $default; - private $description; - - /** - * Constructor. - * - * @param string $name The option name - * @param string $shortcut The shortcut (can be null) - * @param integer $mode The option mode: One of the VALUE_* constants - * @param string $description A description text - * @param mixed $default The default value (must be null for self::VALUE_REQUIRED or self::VALUE_NONE) - * - * @throws \InvalidArgumentException If option mode is invalid or incompatible - * - * @api - */ - public function __construct($name, $shortcut = null, $mode = null, $description = '', $default = null) - { - if (0 === strpos($name, '--')) { - $name = substr($name, 2); - } - - if (empty($name)) { - throw new \InvalidArgumentException('An option name cannot be empty.'); - } - - if (empty($shortcut)) { - $shortcut = null; - } - - if (null !== $shortcut) { - if ('-' === $shortcut[0]) { - $shortcut = substr($shortcut, 1); - } - - if (empty($shortcut)) { - throw new \InvalidArgumentException('An option shortcut cannot be empty.'); - } - } - - if (null === $mode) { - $mode = self::VALUE_NONE; - } elseif (!is_int($mode) || $mode > 15 || $mode < 1) { - throw new \InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode)); - } - - $this->name = $name; - $this->shortcut = $shortcut; - $this->mode = $mode; - $this->description = $description; - - if ($this->isArray() && !$this->acceptValue()) { - throw new \InvalidArgumentException('Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.'); - } - - $this->setDefault($default); - } - - /** - * Returns the option shortcut. - * - * @return string The shortcut - */ - public function getShortcut() - { - return $this->shortcut; - } - - /** - * Returns the option name. - * - * @return string The name - */ - public function getName() - { - return $this->name; - } - - /** - * Returns true if the option accepts a value. - * - * @return Boolean true if value mode is not self::VALUE_NONE, false otherwise - */ - public function acceptValue() - { - return $this->isValueRequired() || $this->isValueOptional(); - } - - /** - * Returns true if the option requires a value. - * - * @return Boolean true if value mode is self::VALUE_REQUIRED, false otherwise - */ - public function isValueRequired() - { - return self::VALUE_REQUIRED === (self::VALUE_REQUIRED & $this->mode); - } - - /** - * Returns true if the option takes an optional value. - * - * @return Boolean true if value mode is self::VALUE_OPTIONAL, false otherwise - */ - public function isValueOptional() - { - return self::VALUE_OPTIONAL === (self::VALUE_OPTIONAL & $this->mode); - } - - /** - * Returns true if the option can take multiple values. - * - * @return Boolean true if mode is self::VALUE_IS_ARRAY, false otherwise - */ - public function isArray() - { - return self::VALUE_IS_ARRAY === (self::VALUE_IS_ARRAY & $this->mode); - } - - /** - * Sets the default value. - * - * @param mixed $default The default value - * - * @throws \LogicException When incorrect default value is given - */ - public function setDefault($default = null) - { - if (self::VALUE_NONE === (self::VALUE_NONE & $this->mode) && null !== $default) { - throw new \LogicException('Cannot set a default value when using Option::VALUE_NONE mode.'); - } - - if ($this->isArray()) { - if (null === $default) { - $default = array(); - } elseif (!is_array($default)) { - throw new \LogicException('A default value for an array option must be an array.'); - } - } - - $this->default = $this->acceptValue() ? $default : false; - } - - /** - * Returns the default value. - * - * @return mixed The default value - */ - public function getDefault() - { - return $this->default; - } - - /** - * Returns the description text. - * - * @return string The description text - */ - public function getDescription() - { - return $this->description; - } - - /** - * Checks whether the given option equals this one - * - * @param InputOption $option option to compare - * @return Boolean - */ - public function equals(InputOption $option) - { - return $option->getName() === $this->getName() - && $option->getShortcut() === $this->getShortcut() - && $option->getDefault() === $this->getDefault() - && $option->isArray() === $this->isArray() - && $option->isValueRequired() === $this->isValueRequired() - && $option->isValueOptional() === $this->isValueOptional() - ; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Input/StringInput.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Input/StringInput.php deleted file mode 100644 index 93b1b83..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Input/StringInput.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -/** - * StringInput represents an input provided as a string. - * - * Usage: - * - * $input = new StringInput('foo --bar="foobar"'); - * - * @author Fabien Potencier - * - * @api - */ -class StringInput extends ArgvInput -{ - const REGEX_STRING = '([^ ]+?)(?: |(?setTokens($this->tokenize($input)); - } - - /** - * Tokenizes a string. - * - * @param string $input The input to tokenize - * - * @return array An array of tokens - * - * @throws \InvalidArgumentException When unable to parse input (should never happen) - */ - private function tokenize($input) - { - $input = preg_replace('/(\r\n|\r|\n|\t)/', ' ', $input); - - $tokens = array(); - $length = strlen($input); - $cursor = 0; - while ($cursor < $length) { - if (preg_match('/\s+/A', $input, $match, null, $cursor)) { - } elseif (preg_match('/([^="\' ]+?)(=?)('.self::REGEX_QUOTED_STRING.'+)/A', $input, $match, null, $cursor)) { - $tokens[] = $match[1].$match[2].stripcslashes(str_replace(array('"\'', '\'"', '\'\'', '""'), '', substr($match[3], 1, strlen($match[3]) - 2))); - } elseif (preg_match('/'.self::REGEX_QUOTED_STRING.'/A', $input, $match, null, $cursor)) { - $tokens[] = stripcslashes(substr($match[0], 1, strlen($match[0]) - 2)); - } elseif (preg_match('/'.self::REGEX_STRING.'/A', $input, $match, null, $cursor)) { - $tokens[] = stripcslashes($match[1]); - } else { - // should never happen - // @codeCoverageIgnoreStart - throw new \InvalidArgumentException(sprintf('Unable to parse input near "... %s ..."', substr($input, $cursor, 10))); - // @codeCoverageIgnoreEnd - } - - $cursor += strlen($match[0]); - } - - return $tokens; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/LICENSE b/vendor/symfony/symfony/src/Symfony/Component/Console/LICENSE deleted file mode 100644 index cdffe7a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2012 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Output/ConsoleOutput.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Output/ConsoleOutput.php deleted file mode 100644 index 0b7e083..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Output/ConsoleOutput.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; -use Symfony\Component\Console\Output\ConsoleOutputInterface; - -/** - * ConsoleOutput is the default class for all CLI output. It uses STDOUT. - * - * This class is a convenient wrapper around `StreamOutput`. - * - * $output = new ConsoleOutput(); - * - * This is equivalent to: - * - * $output = new StreamOutput(fopen('php://stdout', 'w')); - * - * @author Fabien Potencier - * - * @api - */ -class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface -{ - private $stderr; - - /** - * Constructor. - * - * @param integer $verbosity The verbosity level (self::VERBOSITY_QUIET, self::VERBOSITY_NORMAL, - * self::VERBOSITY_VERBOSE) - * @param Boolean $decorated Whether to decorate messages or not (null for auto-guessing) - * @param OutputFormatter $formatter Output formatter instance - * - * @api - */ - public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null) - { - $outputStream = 'php://stdout'; - if (!$this->hasStdoutSupport()) { - $outputStream = 'php://output'; - } - - parent::__construct(fopen($outputStream, 'w'), $verbosity, $decorated, $formatter); - - $this->stderr = new StreamOutput(fopen('php://stderr', 'w'), $verbosity, $decorated, $formatter); - } - - public function setDecorated($decorated) - { - parent::setDecorated($decorated); - $this->stderr->setDecorated($decorated); - } - - public function setFormatter(OutputFormatterInterface $formatter) - { - parent::setFormatter($formatter); - $this->stderr->setFormatter($formatter); - } - - public function setVerbosity($level) - { - parent::setVerbosity($level); - $this->stderr->setVerbosity($level); - } - - /** - * @return OutputInterface - */ - public function getErrorOutput() - { - return $this->stderr; - } - - public function setErrorOutput(OutputInterface $error) - { - $this->stderr = $error; - } - - /** - * Returns true if current environment supports writing console output to - * STDOUT. - * - * IBM iSeries (OS400) exhibits character-encoding issues when writing to - * STDOUT and doesn't properly convert ASCII to EBCDIC, resulting in garbage - * output. - * - * @return boolean - */ - protected function hasStdoutSupport() - { - return ('OS400' != php_uname('s')); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Output/ConsoleOutputInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Output/ConsoleOutputInterface.php deleted file mode 100644 index 5006b80..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Output/ConsoleOutputInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Output\OutputInterface; - -/** - * ConsoleOutputInterface is the interface implemented by ConsoleOutput class. - * This adds information about stderr output stream. - * - * @author Dariusz Górecki - */ -interface ConsoleOutputInterface extends OutputInterface -{ - /** - * @return OutputInterface - */ - public function getErrorOutput(); - - public function setErrorOutput(OutputInterface $error); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Output/NullOutput.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Output/NullOutput.php deleted file mode 100644 index 783d42b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Output/NullOutput.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -/** - * NullOutput suppresses all output. - * - * $output = new NullOutput(); - * - * @author Fabien Potencier - * - * @api - */ -class NullOutput extends Output -{ - /** - * Writes a message to the output. - * - * @param string $message A message to write to the output - * @param Boolean $newline Whether to add a newline or not - */ - protected function doWrite($message, $newline) - { - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Output/Output.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Output/Output.php deleted file mode 100644 index 3866dbc..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Output/Output.php +++ /dev/null @@ -1,180 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; -use Symfony\Component\Console\Formatter\OutputFormatter; - -/** - * Base class for output classes. - * - * There are three levels of verbosity: - * - * * normal: no option passed (normal output - information) - * * verbose: -v (more output - debug) - * * quiet: -q (no output) - * - * @author Fabien Potencier - * - * @api - */ -abstract class Output implements OutputInterface -{ - private $verbosity; - private $formatter; - - /** - * Constructor. - * - * @param integer $verbosity The verbosity level (self::VERBOSITY_QUIET, self::VERBOSITY_NORMAL, self::VERBOSITY_VERBOSE) - * @param Boolean $decorated Whether to decorate messages or not (null for auto-guessing) - * @param OutputFormatterInterface $formatter Output formatter instance - * - * @api - */ - public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null) - { - $this->verbosity = null === $verbosity ? self::VERBOSITY_NORMAL : $verbosity; - $this->formatter = null === $formatter ? new OutputFormatter() : $formatter; - $this->formatter->setDecorated((Boolean) $decorated); - } - - /** - * Sets output formatter. - * - * @param OutputFormatterInterface $formatter - * - * @api - */ - public function setFormatter(OutputFormatterInterface $formatter) - { - $this->formatter = $formatter; - } - - /** - * Returns current output formatter instance. - * - * @return OutputFormatterInterface - * - * @api - */ - public function getFormatter() - { - return $this->formatter; - } - - /** - * Sets the decorated flag. - * - * @param Boolean $decorated Whether to decorate the messages or not - * - * @api - */ - public function setDecorated($decorated) - { - $this->formatter->setDecorated((Boolean) $decorated); - } - - /** - * Gets the decorated flag. - * - * @return Boolean true if the output will decorate messages, false otherwise - * - * @api - */ - public function isDecorated() - { - return $this->formatter->isDecorated(); - } - - /** - * Sets the verbosity of the output. - * - * @param integer $level The level of verbosity - * - * @api - */ - public function setVerbosity($level) - { - $this->verbosity = (int) $level; - } - - /** - * Gets the current verbosity of the output. - * - * @return integer The current level of verbosity - * - * @api - */ - public function getVerbosity() - { - return $this->verbosity; - } - - /** - * Writes a message to the output and adds a newline at the end. - * - * @param string|array $messages The message as an array of lines of a single string - * @param integer $type The type of output - * - * @api - */ - public function writeln($messages, $type = 0) - { - $this->write($messages, true, $type); - } - - /** - * Writes a message to the output. - * - * @param string|array $messages The message as an array of lines of a single string - * @param Boolean $newline Whether to add a newline or not - * @param integer $type The type of output - * - * @throws \InvalidArgumentException When unknown output type is given - * - * @api - */ - public function write($messages, $newline = false, $type = 0) - { - if (self::VERBOSITY_QUIET === $this->verbosity) { - return; - } - - $messages = (array) $messages; - - foreach ($messages as $message) { - switch ($type) { - case OutputInterface::OUTPUT_NORMAL: - $message = $this->formatter->format($message); - break; - case OutputInterface::OUTPUT_RAW: - break; - case OutputInterface::OUTPUT_PLAIN: - $message = strip_tags($this->formatter->format($message)); - break; - default: - throw new \InvalidArgumentException(sprintf('Unknown output type given (%s)', $type)); - } - - $this->doWrite($message, $newline); - } - } - - /** - * Writes a message to the output. - * - * @param string $message A message to write to the output - * @param Boolean $newline Whether to add a newline or not - */ - abstract protected function doWrite($message, $newline); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Output/OutputInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Output/OutputInterface.php deleted file mode 100644 index 88ffba8..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Output/OutputInterface.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * OutputInterface is the interface implemented by all Output classes. - * - * @author Fabien Potencier - * - * @api - */ -interface OutputInterface -{ - const VERBOSITY_QUIET = 0; - const VERBOSITY_NORMAL = 1; - const VERBOSITY_VERBOSE = 2; - - const OUTPUT_NORMAL = 0; - const OUTPUT_RAW = 1; - const OUTPUT_PLAIN = 2; - - /** - * Writes a message to the output. - * - * @param string|array $messages The message as an array of lines of a single string - * @param Boolean $newline Whether to add a newline or not - * @param integer $type The type of output - * - * @throws \InvalidArgumentException When unknown output type is given - * - * @api - */ - public function write($messages, $newline = false, $type = 0); - - /** - * Writes a message to the output and adds a newline at the end. - * - * @param string|array $messages The message as an array of lines of a single string - * @param integer $type The type of output - * - * @api - */ - public function writeln($messages, $type = 0); - - /** - * Sets the verbosity of the output. - * - * @param integer $level The level of verbosity - * - * @api - */ - public function setVerbosity($level); - - /** - * Gets the current verbosity of the output. - * - * @return integer The current level of verbosity - * - * @api - */ - public function getVerbosity(); - - /** - * Sets the decorated flag. - * - * @param Boolean $decorated Whether to decorate the messages or not - * - * @api - */ - public function setDecorated($decorated); - - /** - * Gets the decorated flag. - * - * @return Boolean true if the output will decorate messages, false otherwise - * - * @api - */ - public function isDecorated(); - - /** - * Sets output formatter. - * - * @param OutputFormatterInterface $formatter - * - * @api - */ - public function setFormatter(OutputFormatterInterface $formatter); - - /** - * Returns current output formatter instance. - * - * @return OutputFormatterInterface - * - * @api - */ - public function getFormatter(); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Output/StreamOutput.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Output/StreamOutput.php deleted file mode 100644 index e00d065..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Output/StreamOutput.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * StreamOutput writes the output to a given stream. - * - * Usage: - * - * $output = new StreamOutput(fopen('php://stdout', 'w')); - * - * As `StreamOutput` can use any stream, you can also use a file: - * - * $output = new StreamOutput(fopen('/path/to/output.log', 'a', false)); - * - * @author Fabien Potencier - * - * @api - */ -class StreamOutput extends Output -{ - private $stream; - - /** - * Constructor. - * - * @param mixed $stream A stream resource - * @param integer $verbosity The verbosity level (self::VERBOSITY_QUIET, self::VERBOSITY_NORMAL, - * self::VERBOSITY_VERBOSE) - * @param Boolean $decorated Whether to decorate messages or not (null for auto-guessing) - * @param OutputFormatter $formatter Output formatter instance - * - * @throws \InvalidArgumentException When first argument is not a real stream - * - * @api - */ - public function __construct($stream, $verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null) - { - if (!is_resource($stream) || 'stream' !== get_resource_type($stream)) { - throw new \InvalidArgumentException('The StreamOutput class needs a stream as its first argument.'); - } - - $this->stream = $stream; - - if (null === $decorated) { - $decorated = $this->hasColorSupport($decorated); - } - - parent::__construct($verbosity, $decorated, $formatter); - } - - /** - * Gets the stream attached to this StreamOutput instance. - * - * @return resource A stream resource - */ - public function getStream() - { - return $this->stream; - } - - /** - * Writes a message to the output. - * - * @param string $message A message to write to the output - * @param Boolean $newline Whether to add a newline or not - * - * @throws \RuntimeException When unable to write output (should never happen) - */ - protected function doWrite($message, $newline) - { - if (false === @fwrite($this->stream, $message.($newline ? PHP_EOL : ''))) { - // @codeCoverageIgnoreStart - // should never happen - throw new \RuntimeException('Unable to write output.'); - // @codeCoverageIgnoreEnd - } - - fflush($this->stream); - } - - /** - * Returns true if the stream supports colorization. - * - * Colorization is disabled if not supported by the stream: - * - * - windows without ansicon - * - non tty consoles - * - * @return Boolean true if the stream supports colorization, false otherwise - */ - protected function hasColorSupport() - { - // @codeCoverageIgnoreStart - if (DIRECTORY_SEPARATOR == '\\') { - return false !== getenv('ANSICON'); - } - - return function_exists('posix_isatty') && @posix_isatty($this->stream); - // @codeCoverageIgnoreEnd - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/README.md b/vendor/symfony/symfony/src/Symfony/Component/Console/README.md deleted file mode 100644 index d817952..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/README.md +++ /dev/null @@ -1,55 +0,0 @@ -Console Component -================= - -Console eases the creation of beautiful and testable command line interfaces. - -The Application object manages the CLI application: - - use Symfony\Component\Console\Application; - - $console = new Application(); - $console->run(); - -The ``run()`` method parses the arguments and options passed on the command -line and executes the right command. - -Registering a new command can easily be done via the ``register()`` method, -which returns a ``Command`` instance: - - use Symfony\Component\Console\Input\InputInterface; - use Symfony\Component\Console\Input\InputArgument; - use Symfony\Component\Console\Input\InputOption; - use Symfony\Component\Console\Output\OutputInterface; - - $console - ->register('ls') - ->setDefinition(array( - new InputArgument('dir', InputArgument::REQUIRED, 'Directory name'), - )) - ->setDescription('Displays the files in the given directory') - ->setCode(function (InputInterface $input, OutputInterface $output) { - $dir = $input->getArgument('dir'); - - $output->writeln(sprintf('Dir listing for %s', $dir)); - }) - ; - -You can also register new commands via classes. - -The component provides a lot of features like output coloring, input and -output abstractions (so that you can easily unit-test your commands), -validation, automatic help messages, ... - -Tests ---------- - -You can run the unit tests with the following command: - - phpunit - -Resources ---------- - -[The Console Component](http://symfony.com/doc/current/components/console.html) - -[How to create a Console Command](http://symfony.com/doc/current/cookbook/console/console_command.html) diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Shell.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Shell.php deleted file mode 100644 index 2dc51b6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Shell.php +++ /dev/null @@ -1,207 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Input\StringInput; -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Process\ProcessBuilder; -use Symfony\Component\Process\PhpExecutableFinder; - -/** - * A Shell wraps an Application to add shell capabilities to it. - * - * Support for history and completion only works with a PHP compiled - * with readline support (either --with-readline or --with-libedit) - * - * @author Fabien Potencier - * @author Martin Hasoň - */ -class Shell -{ - private $application; - private $history; - private $output; - private $hasReadline; - private $prompt; - private $processIsolation; - - /** - * Constructor. - * - * If there is no readline support for the current PHP executable - * a \RuntimeException exception is thrown. - * - * @param Application $application An application instance - */ - public function __construct(Application $application) - { - $this->hasReadline = function_exists('readline'); - $this->application = $application; - $this->history = getenv('HOME').'/.history_'.$application->getName(); - $this->output = new ConsoleOutput(); - $this->prompt = $application->getName().' > '; - $this->processIsolation = false; - } - - /** - * Runs the shell. - */ - public function run() - { - $this->application->setAutoExit(false); - $this->application->setCatchExceptions(true); - - if ($this->hasReadline) { - readline_read_history($this->history); - readline_completion_function(array($this, 'autocompleter')); - } - - $this->output->writeln($this->getHeader()); - $php = null; - if ($this->processIsolation) { - $finder = new PhpExecutableFinder(); - $php = $finder->find(); - $this->output->writeln(<<Running with process isolation, you should consider this: - * each command is executed as separate process, - * commands don't support interactivity, all params must be passed explicitly, - * commands output is not colorized. - -EOF - ); - } - - while (true) { - $command = $this->readline(); - - if (false === $command) { - $this->output->writeln("\n"); - - break; - } - - if ($this->hasReadline) { - readline_add_history($command); - readline_write_history($this->history); - } - - if ($this->processIsolation) { - $pb = new ProcessBuilder(); - - $process = $pb - ->add($php) - ->add($_SERVER['argv'][0]) - ->add($command) - ->inheritEnvironmentVariables(true) - ->getProcess() - ; - - $output = $this->output; - $process->run(function($type, $data) use ($output) { - $output->writeln($data); - }); - - $ret = $process->getExitCode(); - } else { - $ret = $this->application->run(new StringInput($command), $this->output); - } - - if (0 !== $ret) { - $this->output->writeln(sprintf('The command terminated with an error status (%s)', $ret)); - } - } - } - - /** - * Returns the shell header. - * - * @return string The header string - */ - protected function getHeader() - { - return <<{$this->application->getName()} shell ({$this->application->getVersion()}). - -At the prompt, type help for some help, -or list to get a list of available commands. - -To exit the shell, type ^D. - -EOF; - } - - /** - * Tries to return autocompletion for the current entered text. - * - * @param string $text The last segment of the entered text - * - * @return Boolean|array A list of guessed strings or true - */ - private function autocompleter($text) - { - $info = readline_info(); - $text = substr($info['line_buffer'], 0, $info['end']); - - if ($info['point'] !== $info['end']) { - return true; - } - - // task name? - if (false === strpos($text, ' ') || !$text) { - return array_keys($this->application->all()); - } - - // options and arguments? - try { - $command = $this->application->find(substr($text, 0, strpos($text, ' '))); - } catch (\Exception $e) { - return true; - } - - $list = array('--help'); - foreach ($command->getDefinition()->getOptions() as $option) { - $list[] = '--'.$option->getName(); - } - - return $list; - } - - /** - * Reads a single line from standard input. - * - * @return string The single line from standard input - */ - private function readline() - { - if ($this->hasReadline) { - $line = readline($this->prompt); - } else { - $this->output->write($this->prompt); - $line = fgets(STDIN, 1024); - $line = (!$line && strlen($line) == 0) ? false : rtrim($line); - } - - return $line; - } - - public function getProcessIsolation() - { - return $this->processIsolation; - } - - public function setProcessIsolation($processIsolation) - { - $this->processIsolation = (Boolean) $processIsolation; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tester/ApplicationTester.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tester/ApplicationTester.php deleted file mode 100644 index 2c576aa..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tester/ApplicationTester.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\StreamOutput; - -/** - * Eases the testing of console applications. - * - * @author Fabien Potencier - */ -class ApplicationTester -{ - private $application; - private $input; - private $output; - - /** - * Constructor. - * - * @param Application $application An Application instance to test. - */ - public function __construct(Application $application) - { - $this->application = $application; - } - - /** - * Executes the application. - * - * Available options: - * - * * interactive: Sets the input interactive flag - * * decorated: Sets the output decorated flag - * * verbosity: Sets the output verbosity flag - * - * @param array $input An array of arguments and options - * @param array $options An array of options - * - * @return integer The command exit code - */ - public function run(array $input, $options = array()) - { - $this->input = new ArrayInput($input); - if (isset($options['interactive'])) { - $this->input->setInteractive($options['interactive']); - } - - $this->output = new StreamOutput(fopen('php://memory', 'w', false)); - if (isset($options['decorated'])) { - $this->output->setDecorated($options['decorated']); - } - if (isset($options['verbosity'])) { - $this->output->setVerbosity($options['verbosity']); - } - - return $this->application->run($this->input, $this->output); - } - - /** - * Gets the display returned by the last execution of the application. - * - * @return string The display - */ - public function getDisplay() - { - rewind($this->output->getStream()); - - return stream_get_contents($this->output->getStream()); - } - - /** - * Gets the input instance used by the last execution of the application. - * - * @return InputInterface The current input instance - */ - public function getInput() - { - return $this->input; - } - - /** - * Gets the output instance used by the last execution of the application. - * - * @return OutputInterface The current output instance - */ - public function getOutput() - { - return $this->output; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tester/CommandTester.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tester/CommandTester.php deleted file mode 100644 index c840574..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tester/CommandTester.php +++ /dev/null @@ -1,102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Output\StreamOutput; - -/** - * Eases the testing of console commands. - * - * @author Fabien Potencier - */ -class CommandTester -{ - private $command; - private $input; - private $output; - - /** - * Constructor. - * - * @param Command $command A Command instance to test. - */ - public function __construct(Command $command) - { - $this->command = $command; - } - - /** - * Executes the command. - * - * Available options: - * - * * interactive: Sets the input interactive flag - * * decorated: Sets the output decorated flag - * * verbosity: Sets the output verbosity flag - * - * @param array $input An array of arguments and options - * @param array $options An array of options - * - * @return integer The command exit code - */ - public function execute(array $input, array $options = array()) - { - $this->input = new ArrayInput($input); - if (isset($options['interactive'])) { - $this->input->setInteractive($options['interactive']); - } - - $this->output = new StreamOutput(fopen('php://memory', 'w', false)); - if (isset($options['decorated'])) { - $this->output->setDecorated($options['decorated']); - } - if (isset($options['verbosity'])) { - $this->output->setVerbosity($options['verbosity']); - } - - return $this->command->run($this->input, $this->output); - } - - /** - * Gets the display returned by the last execution of the command. - * - * @return string The display - */ - public function getDisplay() - { - rewind($this->output->getStream()); - - return stream_get_contents($this->output->getStream()); - } - - /** - * Gets the input instance used by the last execution of the command. - * - * @return InputInterface The current input instance - */ - public function getInput() - { - return $this->input; - } - - /** - * Gets the output instance used by the last execution of the command. - * - * @return OutputInterface The current output instance - */ - public function getOutput() - { - return $this->output; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/ApplicationTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/ApplicationTest.php deleted file mode 100644 index da54d77..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/ApplicationTest.php +++ /dev/null @@ -1,470 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\NullOutput; -use Symfony\Component\Console\Output\Output; -use Symfony\Component\Console\Tester\ApplicationTester; - -class ApplicationTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixturesPath; - - public static function setUpBeforeClass() - { - self::$fixturesPath = realpath(__DIR__.'/Fixtures/'); - require_once self::$fixturesPath.'/FooCommand.php'; - require_once self::$fixturesPath.'/Foo1Command.php'; - require_once self::$fixturesPath.'/Foo2Command.php'; - require_once self::$fixturesPath.'/Foo3Command.php'; - } - - protected function normalizeLineBreaks($text) - { - return str_replace(PHP_EOL, "\n", $text); - } - - /** - * Replaces the dynamic placeholders of the command help text with a static version. - * The placeholder %command.full_name% includes the script path that is not predictable - * and can not be tested against. - */ - protected function ensureStaticCommandHelp(Application $application) - { - foreach ($application->all() as $command) { - $command->setHelp(str_replace('%command.full_name%', 'app/console %command.name%', $command->getHelp())); - } - } - - public function testConstructor() - { - $application = new Application('foo', 'bar'); - $this->assertEquals('foo', $application->getName(), '__construct() takes the application name as its first argument'); - $this->assertEquals('bar', $application->getVersion(), '__construct() takes the application version as its first argument'); - $this->assertEquals(array('help', 'list'), array_keys($application->all()), '__construct() registered the help and list commands by default'); - } - - public function testSetGetName() - { - $application = new Application(); - $application->setName('foo'); - $this->assertEquals('foo', $application->getName(), '->setName() sets the name of the application'); - } - - public function testSetGetVersion() - { - $application = new Application(); - $application->setVersion('bar'); - $this->assertEquals('bar', $application->getVersion(), '->setVersion() sets the version of the application'); - } - - public function testGetLongVersion() - { - $application = new Application('foo', 'bar'); - $this->assertEquals('foo version bar', $application->getLongVersion(), '->getLongVersion() returns the long version of the application'); - } - - public function testHelp() - { - $application = new Application(); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_gethelp.txt', $this->normalizeLineBreaks($application->getHelp()), '->setHelp() returns a help message'); - } - - public function testAll() - { - $application = new Application(); - $commands = $application->all(); - $this->assertEquals('Symfony\\Component\\Console\\Command\\HelpCommand', get_class($commands['help']), '->all() returns the registered commands'); - - $application->add(new \FooCommand()); - $commands = $application->all('foo'); - $this->assertEquals(1, count($commands), '->all() takes a namespace as its first argument'); - } - - public function testRegister() - { - $application = new Application(); - $command = $application->register('foo'); - $this->assertEquals('foo', $command->getName(), '->register() registers a new command'); - } - - public function testAdd() - { - $application = new Application(); - $application->add($foo = new \FooCommand()); - $commands = $application->all(); - $this->assertEquals($foo, $commands['foo:bar'], '->add() registers a command'); - - $application = new Application(); - $application->addCommands(array($foo = new \FooCommand(), $foo1 = new \Foo1Command())); - $commands = $application->all(); - $this->assertEquals(array($foo, $foo1), array($commands['foo:bar'], $commands['foo:bar1']), '->addCommands() registers an array of commands'); - } - - public function testHasGet() - { - $application = new Application(); - $this->assertTrue($application->has('list'), '->has() returns true if a named command is registered'); - $this->assertFalse($application->has('afoobar'), '->has() returns false if a named command is not registered'); - - $application->add($foo = new \FooCommand()); - $this->assertTrue($application->has('afoobar'), '->has() returns true if an alias is registered'); - $this->assertEquals($foo, $application->get('foo:bar'), '->get() returns a command by name'); - $this->assertEquals($foo, $application->get('afoobar'), '->get() returns a command by alias'); - - try { - $application->get('foofoo'); - $this->fail('->get() throws an \InvalidArgumentException if the command does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->get() throws an \InvalidArgumentException if the command does not exist'); - $this->assertEquals('The command "foofoo" does not exist.', $e->getMessage(), '->get() throws an \InvalidArgumentException if the command does not exist'); - } - - $application = new Application(); - $application->add($foo = new \FooCommand()); - // simulate --help - $r = new \ReflectionObject($application); - $p = $r->getProperty('wantHelps'); - $p->setAccessible(true); - $p->setValue($application, true); - $command = $application->get('foo:bar'); - $this->assertEquals('Symfony\Component\Console\Command\HelpCommand', get_class($command), '->get() returns the help command if --help is provided as the input'); - } - - public function testGetNamespaces() - { - $application = new Application(); - $application->add(new \FooCommand()); - $application->add(new \Foo1Command()); - $this->assertEquals(array('foo'), $application->getNamespaces(), '->getNamespaces() returns an array of unique used namespaces'); - } - - public function testFindNamespace() - { - $application = new Application(); - $application->add(new \FooCommand()); - $this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns the given namespace if it exists'); - $this->assertEquals('foo', $application->findNamespace('f'), '->findNamespace() finds a namespace given an abbreviation'); - $application->add(new \Foo2Command()); - $this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns the given namespace if it exists'); - try { - $application->findNamespace('f'); - $this->fail('->findNamespace() throws an \InvalidArgumentException if the abbreviation is ambiguous'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->findNamespace() throws an \InvalidArgumentException if the abbreviation is ambiguous'); - $this->assertEquals('The namespace "f" is ambiguous (foo, foo1).', $e->getMessage(), '->findNamespace() throws an \InvalidArgumentException if the abbreviation is ambiguous'); - } - - try { - $application->findNamespace('bar'); - $this->fail('->findNamespace() throws an \InvalidArgumentException if no command is in the given namespace'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->findNamespace() throws an \InvalidArgumentException if no command is in the given namespace'); - $this->assertEquals('There are no commands defined in the "bar" namespace.', $e->getMessage(), '->findNamespace() throws an \InvalidArgumentException if no command is in the given namespace'); - } - } - - public function testFind() - { - $application = new Application(); - $application->add(new \FooCommand()); - $this->assertEquals('FooCommand', get_class($application->find('foo:bar')), '->find() returns a command if its name exists'); - $this->assertEquals('Symfony\Component\Console\Command\HelpCommand', get_class($application->find('h')), '->find() returns a command if its name exists'); - $this->assertEquals('FooCommand', get_class($application->find('f:bar')), '->find() returns a command if the abbreviation for the namespace exists'); - $this->assertEquals('FooCommand', get_class($application->find('f:b')), '->find() returns a command if the abbreviation for the namespace and the command name exist'); - $this->assertEquals('FooCommand', get_class($application->find('a')), '->find() returns a command if the abbreviation exists for an alias'); - - $application->add(new \Foo1Command()); - $application->add(new \Foo2Command()); - - try { - $application->find('f'); - $this->fail('->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for a namespace'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for a namespace'); - $this->assertRegExp('/Command "f" is not defined./', $e->getMessage(), '->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for a namespace'); - } - - try { - $application->find('a'); - $this->fail('->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for an alias'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for an alias'); - $this->assertEquals('Command "a" is ambiguous (afoobar, afoobar1 and 1 more).', $e->getMessage(), '->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for an alias'); - } - - try { - $application->find('foo:b'); - $this->fail('->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for a command'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for a command'); - $this->assertEquals('Command "foo:b" is ambiguous (foo:bar, foo:bar1).', $e->getMessage(), '->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for a command'); - } - } - - public function testFindAlternativeCommands() - { - $application = new Application(); - - $application->add(new \FooCommand()); - $application->add(new \Foo1Command()); - $application->add(new \Foo2Command()); - - try { - $application->find($commandName = 'Unknown command'); - $this->fail('->find() throws an \InvalidArgumentException if command does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist'); - $this->assertEquals(sprintf('Command "%s" is not defined.', $commandName), $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, without alternatives'); - } - - try { - $application->find($commandName = 'foo'); - $this->fail('->find() throws an \InvalidArgumentException if command does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist'); - $this->assertRegExp(sprintf('/Command "%s" is not defined./', $commandName), $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternatives'); - $this->assertRegExp('/foo:bar/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternative : "foo:bar"'); - $this->assertRegExp('/foo1:bar/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternative : "foo1:bar"'); - $this->assertRegExp('/foo:bar1/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternative : "foo:bar1"'); - } - - // Test if "foo1" command throw an "\InvalidArgumentException" and does not contain - // "foo:bar" as alternative because "foo1" is too far from "foo:bar" - try { - $application->find($commandName = 'foo1'); - $this->fail('->find() throws an \InvalidArgumentException if command does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist'); - $this->assertRegExp(sprintf('/Command "%s" is not defined./', $commandName), $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternatives'); - $this->assertFalse(strpos($e->getMessage(), 'foo:bar'), '->find() throws an \InvalidArgumentException if command does not exist, without "foo:bar" alternative'); - } - } - - public function testFindAlternativeNamespace() - { - $application = new Application(); - - $application->add(new \FooCommand()); - $application->add(new \Foo1Command()); - $application->add(new \Foo2Command()); - $application->add(new \foo3Command()); - - try { - $application->find('Unknown-namespace:Unknown-command'); - $this->fail('->find() throws an \InvalidArgumentException if namespace does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if namespace does not exist'); - $this->assertEquals('There are no commands defined in the "Unknown-namespace" namespace.', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, without alternatives'); - } - - try { - $application->find('foo2:command'); - $this->fail('->find() throws an \InvalidArgumentException if namespace does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if namespace does not exist'); - $this->assertRegExp('/There are no commands defined in the "foo2" namespace./', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative'); - $this->assertRegExp('/foo/', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative : "foo"'); - $this->assertRegExp('/foo1/', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative : "foo1"'); - $this->assertRegExp('/foo3/', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative : "foo3"'); - } - } - - public function testSetCatchExceptions() - { - $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth')); - $application->setAutoExit(false); - $application->expects($this->any()) - ->method('getTerminalWidth') - ->will($this->returnValue(120)); - $tester = new ApplicationTester($application); - - $application->setCatchExceptions(true); - $tester->run(array('command' => 'foo'), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->setCatchExceptions() sets the catch exception flag'); - - $application->setCatchExceptions(false); - try { - $tester->run(array('command' => 'foo'), array('decorated' => false)); - $this->fail('->setCatchExceptions() sets the catch exception flag'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Exception', $e, '->setCatchExceptions() sets the catch exception flag'); - $this->assertEquals('Command "foo" is not defined.', $e->getMessage(), '->setCatchExceptions() sets the catch exception flag'); - } - } - - public function testAsText() - { - $application = new Application(); - $application->add(new \FooCommand); - $this->ensureStaticCommandHelp($application); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_astext1.txt', $this->normalizeLineBreaks($application->asText()), '->asText() returns a text representation of the application'); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_astext2.txt', $this->normalizeLineBreaks($application->asText('foo')), '->asText() returns a text representation of the application'); - } - - public function testAsXml() - { - $application = new Application(); - $application->add(new \FooCommand); - $this->ensureStaticCommandHelp($application); - $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/application_asxml1.txt', $application->asXml(), '->asXml() returns an XML representation of the application'); - $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/application_asxml2.txt', $application->asXml('foo'), '->asXml() returns an XML representation of the application'); - } - - public function testRenderException() - { - $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth')); - $application->setAutoExit(false); - $application->expects($this->any()) - ->method('getTerminalWidth') - ->will($this->returnValue(120)); - $tester = new ApplicationTester($application); - - $tester->run(array('command' => 'foo'), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->renderException() renders a pretty exception'); - - $tester->run(array('command' => 'foo'), array('decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE)); - $this->assertContains('Exception trace', $tester->getDisplay(), '->renderException() renders a pretty exception with a stack trace when verbosity is verbose'); - - $tester->run(array('command' => 'list', '--foo' => true), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception2.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->renderException() renders the command synopsis when an exception occurs in the context of a command'); - - $application->add(new \Foo3Command); - $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo3:bar'), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->renderException() renders a pretty exceptions with previous exceptions'); - - $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth')); - $application->setAutoExit(false); - $application->expects($this->any()) - ->method('getTerminalWidth') - ->will($this->returnValue(32)); - $tester = new ApplicationTester($application); - - $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth')); - $application->setAutoExit(false); - $application->expects($this->any()) - ->method('getTerminalWidth') - ->will($this->returnValue(32)); - $tester = new ApplicationTester($application); - - $tester->run(array('command' => 'foo'), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception4.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->renderException() wraps messages when they are bigger than the terminal'); - } - - public function testRun() - { - $application = new Application(); - $application->setAutoExit(false); - $application->setCatchExceptions(false); - $application->add($command = new \Foo1Command()); - $_SERVER['argv'] = array('cli.php', 'foo:bar1'); - - ob_start(); - $application->run(); - ob_end_clean(); - - $this->assertSame('Symfony\Component\Console\Input\ArgvInput', get_class($command->input), '->run() creates an ArgvInput by default if none is given'); - $this->assertSame('Symfony\Component\Console\Output\ConsoleOutput', get_class($command->output), '->run() creates a ConsoleOutput by default if none is given'); - - $application = new Application(); - $application->setAutoExit(false); - $application->setCatchExceptions(false); - - $this->ensureStaticCommandHelp($application); - $tester = new ApplicationTester($application); - - $tester->run(array(), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_run1.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() runs the list command if no argument is passed'); - - $tester->run(array('--help' => true), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() runs the help command if --help is passed'); - - $tester->run(array('-h' => true), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() runs the help command if -h is passed'); - - $tester->run(array('command' => 'list', '--help' => true), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() displays the help if --help is passed'); - - $tester->run(array('command' => 'list', '-h' => true), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() displays the help if -h is passed'); - - $tester->run(array('--ansi' => true)); - $this->assertTrue($tester->getOutput()->isDecorated(), '->run() forces color output if --ansi is passed'); - - $tester->run(array('--no-ansi' => true)); - $this->assertFalse($tester->getOutput()->isDecorated(), '->run() forces color output to be disabled if --no-ansi is passed'); - - $tester->run(array('--version' => true), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() displays the program version if --version is passed'); - - $tester->run(array('-V' => true), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() displays the program version if -v is passed'); - - $tester->run(array('command' => 'list', '--quiet' => true)); - $this->assertSame('', $tester->getDisplay(), '->run() removes all output if --quiet is passed'); - - $tester->run(array('command' => 'list', '-q' => true)); - $this->assertSame('', $tester->getDisplay(), '->run() removes all output if -q is passed'); - - $tester->run(array('command' => 'list', '--verbose' => true)); - $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose is passed'); - - $tester->run(array('command' => 'list', '-v' => true)); - $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if -v is passed'); - - $application = new Application(); - $application->setAutoExit(false); - $application->setCatchExceptions(false); - $application->add(new \FooCommand()); - $tester = new ApplicationTester($application); - - $tester->run(array('command' => 'foo:bar', '--no-interaction' => true), array('decorated' => false)); - $this->assertSame('called'.PHP_EOL, $tester->getDisplay(), '->run() does not call interact() if --no-interaction is passed'); - - $tester->run(array('command' => 'foo:bar', '-n' => true), array('decorated' => false)); - $this->assertSame('called'.PHP_EOL, $tester->getDisplay(), '->run() does not call interact() if -n is passed'); - } - - /** - * @expectedException \LogicException - * @dataProvider getAddingAlreadySetDefinitionElementData - */ - public function testAddingAlreadySetDefinitionElementData($def) - { - $application = new Application(); - $application->setAutoExit(false); - $application->setCatchExceptions(false); - $application - ->register('foo') - ->setDefinition(array($def)) - ->setCode(function (InputInterface $input, OutputInterface $output) {}) - ; - - $input = new ArrayInput(array('command' => 'foo')); - $output = new NullOutput(); - $application->run($input, $output); - } - - public function getAddingAlreadySetDefinitionElementData() - { - return array( - array(new InputArgument('command', InputArgument::REQUIRED)), - array(new InputOption('quiet', '', InputOption::VALUE_NONE)), - array(new InputOption('query', 'q', InputOption::VALUE_NONE)), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Command/CommandTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Command/CommandTest.php deleted file mode 100644 index e248cff..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Command/CommandTest.php +++ /dev/null @@ -1,253 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Command; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Helper\FormatterHelper; -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\StringInput; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\NullOutput; -use Symfony\Component\Console\Tester\CommandTester; - -class CommandTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixturesPath; - - public static function setUpBeforeClass() - { - self::$fixturesPath = __DIR__.'/../Fixtures/'; - require_once self::$fixturesPath.'/TestCommand.php'; - } - - public function testConstructor() - { - try { - $command = new Command(); - $this->fail('__construct() throws a \LogicException if the name is null'); - } catch (\Exception $e) { - $this->assertInstanceOf('\LogicException', $e, '__construct() throws a \LogicException if the name is null'); - $this->assertEquals('The command name cannot be empty.', $e->getMessage(), '__construct() throws a \LogicException if the name is null'); - } - $command = new Command('foo:bar'); - $this->assertEquals('foo:bar', $command->getName(), '__construct() takes the command name as its first argument'); - } - - public function testSetApplication() - { - $application = new Application(); - $command = new \TestCommand(); - $command->setApplication($application); - $this->assertEquals($application, $command->getApplication(), '->setApplication() sets the current application'); - } - - public function testSetGetDefinition() - { - $command = new \TestCommand(); - $ret = $command->setDefinition($definition = new InputDefinition()); - $this->assertEquals($command, $ret, '->setDefinition() implements a fluent interface'); - $this->assertEquals($definition, $command->getDefinition(), '->setDefinition() sets the current InputDefinition instance'); - $command->setDefinition(array(new InputArgument('foo'), new InputOption('bar'))); - $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->setDefinition() also takes an array of InputArguments and InputOptions as an argument'); - $this->assertTrue($command->getDefinition()->hasOption('bar'), '->setDefinition() also takes an array of InputArguments and InputOptions as an argument'); - $command->setDefinition(new InputDefinition()); - } - - public function testAddArgument() - { - $command = new \TestCommand(); - $ret = $command->addArgument('foo'); - $this->assertEquals($command, $ret, '->addArgument() implements a fluent interface'); - $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->addArgument() adds an argument to the command'); - } - - public function testAddOption() - { - $command = new \TestCommand(); - $ret = $command->addOption('foo'); - $this->assertEquals($command, $ret, '->addOption() implements a fluent interface'); - $this->assertTrue($command->getDefinition()->hasOption('foo'), '->addOption() adds an option to the command'); - } - - public function testGetNamespaceGetNameSetName() - { - $command = new \TestCommand(); - $this->assertEquals('namespace:name', $command->getName(), '->getName() returns the command name'); - $command->setName('foo'); - $this->assertEquals('foo', $command->getName(), '->setName() sets the command name'); - - $ret = $command->setName('foobar:bar'); - $this->assertEquals($command, $ret, '->setName() implements a fluent interface'); - $this->assertEquals('foobar:bar', $command->getName(), '->setName() sets the command name'); - - try { - $command->setName(''); - $this->fail('->setName() throws an \InvalidArgumentException if the name is empty'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->setName() throws an \InvalidArgumentException if the name is empty'); - $this->assertEquals('Command name "" is invalid.', $e->getMessage(), '->setName() throws an \InvalidArgumentException if the name is empty'); - } - - try { - $command->setName('foo:'); - $this->fail('->setName() throws an \InvalidArgumentException if the name is empty'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->setName() throws an \InvalidArgumentException if the name is empty'); - $this->assertEquals('Command name "foo:" is invalid.', $e->getMessage(), '->setName() throws an \InvalidArgumentException if the name is empty'); - } - } - - public function testGetSetDescription() - { - $command = new \TestCommand(); - $this->assertEquals('description', $command->getDescription(), '->getDescription() returns the description'); - $ret = $command->setDescription('description1'); - $this->assertEquals($command, $ret, '->setDescription() implements a fluent interface'); - $this->assertEquals('description1', $command->getDescription(), '->setDescription() sets the description'); - } - - public function testGetSetHelp() - { - $command = new \TestCommand(); - $this->assertEquals('help', $command->getHelp(), '->getHelp() returns the help'); - $ret = $command->setHelp('help1'); - $this->assertEquals($command, $ret, '->setHelp() implements a fluent interface'); - $this->assertEquals('help1', $command->getHelp(), '->setHelp() sets the help'); - } - - public function testGetProcessedHelp() - { - $command = new \TestCommand(); - $command->setHelp('The %command.name% command does... Example: php %command.full_name%.'); - $this->assertContains('The namespace:name command does...', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.name% correctly'); - $this->assertNotContains('%command.full_name%', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.full_name%'); - } - - public function testGetSetAliases() - { - $command = new \TestCommand(); - $this->assertEquals(array('name'), $command->getAliases(), '->getAliases() returns the aliases'); - $ret = $command->setAliases(array('name1')); - $this->assertEquals($command, $ret, '->setAliases() implements a fluent interface'); - $this->assertEquals(array('name1'), $command->getAliases(), '->setAliases() sets the aliases'); - } - - public function testGetSynopsis() - { - $command = new \TestCommand(); - $command->addOption('foo'); - $command->addArgument('foo'); - $this->assertEquals('namespace:name [--foo] [foo]', $command->getSynopsis(), '->getSynopsis() returns the synopsis'); - } - - public function testGetHelper() - { - $application = new Application(); - $command = new \TestCommand(); - $command->setApplication($application); - $formatterHelper = new FormatterHelper(); - $this->assertEquals($formatterHelper->getName(), $command->getHelper('formatter')->getName(), '->getHelper() returns the correct helper'); - } - - public function testGet() - { - $application = new Application(); - $command = new \TestCommand(); - $command->setApplication($application); - $formatterHelper = new FormatterHelper(); - $this->assertEquals($formatterHelper->getName(), $command->getHelper('formatter')->getName(), '->__get() returns the correct helper'); - } - - public function testMergeApplicationDefinition() - { - $application1 = new Application(); - $application1->getDefinition()->addArguments(array(new InputArgument('foo'))); - $application1->getDefinition()->addOptions(array(new InputOption('bar'))); - $command = new \TestCommand(); - $command->setApplication($application1); - $command->setDefinition($definition = new InputDefinition(array(new InputArgument('bar'), new InputOption('foo')))); - - $r = new \ReflectionObject($command); - $m = $r->getMethod('mergeApplicationDefinition'); - $m->setAccessible(true); - $m->invoke($command); - $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->mergeApplicationDefinition() merges the application arguments and the command arguments'); - $this->assertTrue($command->getDefinition()->hasArgument('bar'), '->mergeApplicationDefinition() merges the application arguments and the command arguments'); - $this->assertTrue($command->getDefinition()->hasOption('foo'), '->mergeApplicationDefinition() merges the application options and the command options'); - $this->assertTrue($command->getDefinition()->hasOption('bar'), '->mergeApplicationDefinition() merges the application options and the command options'); - - $m->invoke($command); - $this->assertEquals(3, $command->getDefinition()->getArgumentCount(), '->mergeApplicationDefinition() does not try to merge twice the application arguments and options'); - } - - public function testRun() - { - $command = new \TestCommand(); - $tester = new CommandTester($command); - try { - $tester->execute(array('--bar' => true)); - $this->fail('->run() throws a \InvalidArgumentException when the input does not validate the current InputDefinition'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->run() throws a \InvalidArgumentException when the input does not validate the current InputDefinition'); - $this->assertEquals('The "--bar" option does not exist.', $e->getMessage(), '->run() throws a \InvalidArgumentException when the input does not validate the current InputDefinition'); - } - - $tester->execute(array(), array('interactive' => true)); - $this->assertEquals('interact called'.PHP_EOL.'execute called'.PHP_EOL, $tester->getDisplay(), '->run() calls the interact() method if the input is interactive'); - - $tester->execute(array(), array('interactive' => false)); - $this->assertEquals('execute called'.PHP_EOL, $tester->getDisplay(), '->run() does not call the interact() method if the input is not interactive'); - - $command = new Command('foo'); - try { - $command->run(new StringInput(''), new NullOutput()); - $this->fail('->run() throws a \LogicException if the execute() method has not been overridden and no code has been provided'); - } catch (\Exception $e) { - $this->assertInstanceOf('\LogicException', $e, '->run() throws a \LogicException if the execute() method has not been overridden and no code has been provided'); - $this->assertEquals('You must override the execute() method in the concrete command class.', $e->getMessage(), '->run() throws a \LogicException if the execute() method has not been overridden and no code has been provided'); - } - } - - public function testSetCode() - { - $command = new \TestCommand(); - $ret = $command->setCode(function (InputInterface $input, OutputInterface $output) { - $output->writeln('from the code...'); - }); - $this->assertEquals($command, $ret, '->setCode() implements a fluent interface'); - $tester = new CommandTester($command); - $tester->execute(array()); - $this->assertEquals('interact called'.PHP_EOL.'from the code...'.PHP_EOL, $tester->getDisplay()); - } - - public function testAsText() - { - $command = new \TestCommand(); - $command->setApplication(new Application()); - $tester = new CommandTester($command); - $tester->execute(array('command' => $command->getName())); - $this->assertStringEqualsFile(self::$fixturesPath.'/command_astext.txt', $command->asText(), '->asText() returns a text representation of the command'); - } - - public function testAsXml() - { - $command = new \TestCommand(); - $command->setApplication(new Application()); - $tester = new CommandTester($command); - $tester->execute(array('command' => $command->getName())); - $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/command_asxml.txt', $command->asXml(), '->asXml() returns an XML representation of the command'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Command/HelpCommandTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Command/HelpCommandTest.php deleted file mode 100644 index 417eea1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Command/HelpCommandTest.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Command; - -use Symfony\Component\Console\Tester\CommandTester; -use Symfony\Component\Console\Command\HelpCommand; -use Symfony\Component\Console\Command\ListCommand; -use Symfony\Component\Console\Application; - -class HelpCommandTest extends \PHPUnit_Framework_TestCase -{ - public function testExecute() - { - $command = new HelpCommand(); - - $commandTester = new CommandTester($command); - $command->setCommand(new ListCommand()); - $commandTester->execute(array()); - $this->assertRegExp('/list \[--xml\] \[--raw\] \[namespace\]/', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); - - $command->setCommand(new ListCommand()); - $commandTester->execute(array('--xml' => true)); - $this->assertRegExp('/getDisplay(), '->execute() returns an XML help text if --xml is passed'); - - $application = new Application(); - $commandTester = new CommandTester($application->get('help')); - $commandTester->execute(array('command_name' => 'list')); - $this->assertRegExp('/list \[--xml\] \[--raw\] \[namespace\]/', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); - - $commandTester->execute(array('command_name' => 'list', '--xml' => true)); - $this->assertRegExp('/getDisplay(), '->execute() returns an XML help text if --xml is passed'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php deleted file mode 100644 index fb0eacc..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Command; - -use Symfony\Component\Console\Tester\CommandTester; -use Symfony\Component\Console\Application; - -class ListCommandTest extends \PHPUnit_Framework_TestCase -{ - public function testExecute() - { - $application = new Application(); - - $commandTester = new CommandTester($command = $application->get('list')); - $commandTester->execute(array('command' => $command->getName()), array('decorated' => false)); - $this->assertRegExp('/help Displays help for a command/', $commandTester->getDisplay(), '->execute() returns a list of available commands'); - - $commandTester->execute(array('command' => $command->getName(), '--xml' => true)); - $this->assertRegExp('//', $commandTester->getDisplay(), '->execute() returns a list of available commands in XML if --xml is passed'); - - $commandTester->execute(array('command' => $command->getName(), '--raw' => true)); - $output = <<assertEquals(str_replace("\n", PHP_EOL, $output), $commandTester->getDisplay(), 'boo'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/Foo1Command.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/Foo1Command.php deleted file mode 100644 index 254162f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/Foo1Command.php +++ /dev/null @@ -1,26 +0,0 @@ -setName('foo:bar1') - ->setDescription('The foo:bar1 command') - ->setAliases(array('afoobar1')) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $this->input = $input; - $this->output = $output; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/Foo2Command.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/Foo2Command.php deleted file mode 100644 index 8071dc8..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/Foo2Command.php +++ /dev/null @@ -1,21 +0,0 @@ -setName('foo1:bar') - ->setDescription('The foo1:bar command') - ->setAliases(array('afoobar2')) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/Foo3Command.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/Foo3Command.php deleted file mode 100644 index 7349bc3..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/Foo3Command.php +++ /dev/null @@ -1,25 +0,0 @@ -setName('foo3:bar') - ->setDescription('The foo3:bar command') - ; - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - try { - throw new \Exception("First exception"); - } catch (\Exception $e) { - throw new \Exception("Second exception", 0, $e); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/FooCommand.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/FooCommand.php deleted file mode 100644 index 355e0ad..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/FooCommand.php +++ /dev/null @@ -1,33 +0,0 @@ -setName('foo:bar') - ->setDescription('The foo:bar command') - ->setAliases(array('afoobar')) - ; - } - - protected function interact(InputInterface $input, OutputInterface $output) - { - $output->writeln('interact called'); - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $this->input = $input; - $this->output = $output; - - $output->writeln('called'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/TestCommand.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/TestCommand.php deleted file mode 100644 index dcd3273..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/TestCommand.php +++ /dev/null @@ -1,28 +0,0 @@ -setName('namespace:name') - ->setAliases(array('name')) - ->setDescription('description') - ->setHelp('help') - ; - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $output->writeln('execute called'); - } - - protected function interact(InputInterface $input, OutputInterface $output) - { - $output->writeln('interact called'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_astext1.txt b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_astext1.txt deleted file mode 100644 index 2f692c0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_astext1.txt +++ /dev/null @@ -1,20 +0,0 @@ -Console Tool - -Usage: - [options] command [arguments] - -Options: - --help -h Display this help message. - --quiet -q Do not output any message. - --verbose -v Increase verbosity of messages. - --version -V Display this application version. - --ansi Force ANSI output. - --no-ansi Disable ANSI output. - --no-interaction -n Do not ask any interactive question. - -Available commands: - afoobar The foo:bar command - help Displays help for a command - list Lists commands -foo - foo:bar The foo:bar command \ No newline at end of file diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_astext2.txt b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_astext2.txt deleted file mode 100644 index 1457bf7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_astext2.txt +++ /dev/null @@ -1,16 +0,0 @@ -Console Tool - -Usage: - [options] command [arguments] - -Options: - --help -h Display this help message. - --quiet -q Do not output any message. - --verbose -v Increase verbosity of messages. - --version -V Display this application version. - --ansi Force ANSI output. - --no-ansi Disable ANSI output. - --no-interaction -n Do not ask any interactive question. - -Available commands for the "foo" namespace: - foo:bar The foo:bar command \ No newline at end of file diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt deleted file mode 100644 index ce21a32..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt +++ /dev/null @@ -1,83 +0,0 @@ - - - - - help [--xml] [command_name] - Displays help for a command - The <info>help</info> command displays help for a given command: - - <info>php app/console help list</info> - - You can also output the help as XML by using the <comment>--xml</comment> option: - - <info>php app/console help --xml list</info> - - - - The command name - - help - - - - - - - - - list [--xml] [--raw] [namespace] - Lists commands - The <info>list</info> command lists all commands: - - <info>php app/console list</info> - - You can also display the commands for a specific namespace: - - <info>php app/console list test</info> - - You can also output the information as XML by using the <comment>--xml</comment> option: - - <info>php app/console list --xml</info> - - It's also possible to get raw list of commands (useful for embedding command runner): - - <info>php app/console list --raw</info> - - - - The namespace name - - - - - - - - - - foo:bar - The foo:bar command - - - afoobar - - - - - - - - help - list - - - foo:bar - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_asxml2.txt b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_asxml2.txt deleted file mode 100644 index 9e1f4a1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_asxml2.txt +++ /dev/null @@ -1,15 +0,0 @@ - - - - - foo:bar - The foo:bar command - - - afoobar - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_gethelp.txt b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_gethelp.txt deleted file mode 100644 index 5ad5420..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_gethelp.txt +++ /dev/null @@ -1,13 +0,0 @@ -Console Tool - -Usage: - [options] command [arguments] - -Options: - --help -h Display this help message. - --quiet -q Do not output any message. - --verbose -v Increase verbosity of messages. - --version -V Display this application version. - --ansi Force ANSI output. - --no-ansi Disable ANSI output. - --no-interaction -n Do not ask any interactive question. \ No newline at end of file diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception1.txt b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception1.txt deleted file mode 100644 index 4629345..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception1.txt +++ /dev/null @@ -1,8 +0,0 @@ - - - - [InvalidArgumentException] - Command "foo" is not defined. - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception2.txt b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception2.txt deleted file mode 100644 index 56dd52e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception2.txt +++ /dev/null @@ -1,11 +0,0 @@ - - - - [InvalidArgumentException] - The "--foo" option does not exist. - - - -list [--xml] [--raw] [namespace] - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception3.txt b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception3.txt deleted file mode 100644 index c639924..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception3.txt +++ /dev/null @@ -1,19 +0,0 @@ - - - - [Exception] - Second exception - - - - - - - [Exception] - First exception - - - -foo3:bar - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception4.txt b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception4.txt deleted file mode 100644 index 19f893b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception4.txt +++ /dev/null @@ -1,9 +0,0 @@ - - - - [InvalidArgumentException] - Command "foo" is not define - d. - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_run1.txt b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_run1.txt deleted file mode 100644 index 176dc88..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_run1.txt +++ /dev/null @@ -1,17 +0,0 @@ -Console Tool - -Usage: - [options] command [arguments] - -Options: - --help -h Display this help message. - --quiet -q Do not output any message. - --verbose -v Increase verbosity of messages. - --version -V Display this application version. - --ansi Force ANSI output. - --no-ansi Disable ANSI output. - --no-interaction -n Do not ask any interactive question. - -Available commands: - help Displays help for a command - list Lists commands diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_run2.txt b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_run2.txt deleted file mode 100644 index cad7dd5..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_run2.txt +++ /dev/null @@ -1,26 +0,0 @@ -Usage: - help [--xml] [command_name] - -Arguments: - command The command to execute - command_name The command name (default: "help") - -Options: - --xml To output help as XML - --help (-h) Display this help message. - --quiet (-q) Do not output any message. - --verbose (-v) Increase verbosity of messages. - --version (-V) Display this application version. - --ansi Force ANSI output. - --no-ansi Disable ANSI output. - --no-interaction (-n) Do not ask any interactive question. - -Help: - The help command displays help for a given command: - - php app/console help list - - You can also output the help as XML by using the --xml option: - - php app/console help --xml list - diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_run3.txt b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_run3.txt deleted file mode 100644 index 441db54..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_run3.txt +++ /dev/null @@ -1,27 +0,0 @@ -Usage: - list [--xml] [--raw] [namespace] - -Arguments: - namespace The namespace name - -Options: - --xml To output help as XML - --raw To output raw command list - -Help: - The list command lists all commands: - - php app/console list - - You can also display the commands for a specific namespace: - - php app/console list test - - You can also output the information as XML by using the --xml option: - - php app/console list --xml - - It's also possible to get raw list of commands (useful for embedding command runner): - - php app/console list --raw - diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_run4.txt b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_run4.txt deleted file mode 100644 index 47187fc..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/application_run4.txt +++ /dev/null @@ -1 +0,0 @@ -Console Tool diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/command_astext.txt b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/command_astext.txt deleted file mode 100644 index e599903..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/command_astext.txt +++ /dev/null @@ -1,18 +0,0 @@ -Usage: - namespace:name - -Aliases: name -Arguments: - command The command to execute - -Options: - --help (-h) Display this help message. - --quiet (-q) Do not output any message. - --verbose (-v) Increase verbosity of messages. - --version (-V) Display this application version. - --ansi Force ANSI output. - --no-ansi Disable ANSI output. - --no-interaction (-n) Do not ask any interactive question. - -Help: - help diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/command_asxml.txt b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/command_asxml.txt deleted file mode 100644 index 806c5a5..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/command_asxml.txt +++ /dev/null @@ -1,38 +0,0 @@ - - - namespace:name - description - help - - name - - - - The command to execute - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/definition_astext.txt b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/definition_astext.txt deleted file mode 100644 index 9dd5390..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/definition_astext.txt +++ /dev/null @@ -1,11 +0,0 @@ -Arguments: - foo The foo argument - baz The baz argument (default: true) - bar The bar argument (default: ["bar"]) - -Options: - --foo (-f) The foo option - --baz The baz option (default: false) - --bar (-b) The bar option (default: "bar") - --qux The qux option (default: ["foo","bar"]) (multiple values allowed) - --qux2 The qux2 option (default: {"foo":"bar"}) (multiple values allowed) diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/definition_asxml.txt b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/definition_asxml.txt deleted file mode 100644 index eec8c07..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Fixtures/definition_asxml.txt +++ /dev/null @@ -1,39 +0,0 @@ - - - - - The foo argument - - - - The baz argument - - true - - - - The bar argument - - bar - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleStackTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleStackTest.php deleted file mode 100644 index e99ebc5..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleStackTest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Formatter; - -use Symfony\Component\Console\Formatter\OutputFormatterStyleStack; -use Symfony\Component\Console\Formatter\OutputFormatterStyle; - -class OutputFormatterStyleStackTest extends \PHPUnit_Framework_TestCase -{ - public function testPush() - { - $stack = new OutputFormatterStyleStack(); - $stack->push($s1 = new OutputFormatterStyle('white', 'black')); - $stack->push($s2 = new OutputFormatterStyle('yellow', 'blue')); - - $this->assertEquals($s2, $stack->getCurrent()); - - $stack->push($s3 = new OutputFormatterStyle('green', 'red')); - - $this->assertEquals($s3, $stack->getCurrent()); - } - - public function testPop() - { - $stack = new OutputFormatterStyleStack(); - $stack->push($s1 = new OutputFormatterStyle('white', 'black')); - $stack->push($s2 = new OutputFormatterStyle('yellow', 'blue')); - - $this->assertEquals($s2, $stack->pop()); - $this->assertEquals($s1, $stack->pop()); - } - - public function testPopEmpty() - { - $stack = new OutputFormatterStyleStack(); - $style = new OutputFormatterStyle(); - - $this->assertEquals($style, $stack->pop()); - } - - public function testPopNotLast() - { - $stack = new OutputFormatterStyleStack(); - $stack->push($s1 = new OutputFormatterStyle('white', 'black')); - $stack->push($s2 = new OutputFormatterStyle('yellow', 'blue')); - $stack->push($s3 = new OutputFormatterStyle('green', 'red')); - - $this->assertEquals($s2, $stack->pop($s2)); - $this->assertEquals($s1, $stack->pop()); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testInvalidPop() - { - $stack = new OutputFormatterStyleStack(); - $stack->push(new OutputFormatterStyle('white', 'black')); - $stack->pop(new OutputFormatterStyle('yellow', 'blue')); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleTest.php deleted file mode 100644 index b2875e9..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleTest.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Formatter; - -use Symfony\Component\Console\Formatter\OutputFormatterStyle; - -class OutputFormatterStyleTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $style = new OutputFormatterStyle('green', 'black', array('bold', 'underscore')); - $this->assertEquals("\033[32;40;1;4mfoo\033[0m", $style->apply('foo')); - - $style = new OutputFormatterStyle('red', null, array('blink')); - $this->assertEquals("\033[31;5mfoo\033[0m", $style->apply('foo')); - - $style = new OutputFormatterStyle(null, 'white'); - $this->assertEquals("\033[47mfoo\033[0m", $style->apply('foo')); - } - - public function testForeground() - { - $style = new OutputFormatterStyle(); - - $style->setForeground('black'); - $this->assertEquals("\033[30mfoo\033[0m", $style->apply('foo')); - - $style->setForeground('blue'); - $this->assertEquals("\033[34mfoo\033[0m", $style->apply('foo')); - - $this->setExpectedException('InvalidArgumentException'); - $style->setForeground('undefined-color'); - } - - public function testBackground() - { - $style = new OutputFormatterStyle(); - - $style->setBackground('black'); - $this->assertEquals("\033[40mfoo\033[0m", $style->apply('foo')); - - $style->setBackground('yellow'); - $this->assertEquals("\033[43mfoo\033[0m", $style->apply('foo')); - - $this->setExpectedException('InvalidArgumentException'); - $style->setBackground('undefined-color'); - } - - public function testOptions() - { - $style = new OutputFormatterStyle(); - - $style->setOptions(array('reverse', 'conceal')); - $this->assertEquals("\033[7;8mfoo\033[0m", $style->apply('foo')); - - $style->setOption('bold'); - $this->assertEquals("\033[7;8;1mfoo\033[0m", $style->apply('foo')); - - $style->unsetOption('reverse'); - $this->assertEquals("\033[8;1mfoo\033[0m", $style->apply('foo')); - - $style->setOption('bold'); - $this->assertEquals("\033[8;1mfoo\033[0m", $style->apply('foo')); - - $style->setOptions(array('bold')); - $this->assertEquals("\033[1mfoo\033[0m", $style->apply('foo')); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php deleted file mode 100644 index 6a5ffda..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php +++ /dev/null @@ -1,206 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - - -namespace Symfony\Component\Console\Tests\Formatter; - -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Formatter\OutputFormatterStyle; - -class FormatterStyleTest extends \PHPUnit_Framework_TestCase -{ - public function testEmptyTag() - { - $formatter = new OutputFormatter(true); - $this->assertEquals("foo<>bar", $formatter->format('foo<>bar')); - } - - public function testLGCharEscaping() - { - $formatter = new OutputFormatter(true); - - $this->assertEquals("fooformat('foo\\assertEquals("some info", $formatter->format('\\some info\\')); - $this->assertEquals("\\some info\\", OutputFormatter::escape('some info')); - - $this->assertEquals( - "\033[33mSymfony\\Component\\Console does work very well!\033[0m", - $formatter->format('Symfony\Component\Console does work very well!') - ); - } - - public function testBundledStyles() - { - $formatter = new OutputFormatter(true); - - $this->assertTrue($formatter->hasStyle('error')); - $this->assertTrue($formatter->hasStyle('info')); - $this->assertTrue($formatter->hasStyle('comment')); - $this->assertTrue($formatter->hasStyle('question')); - - $this->assertEquals( - "\033[37;41msome error\033[0m", - $formatter->format('some error') - ); - $this->assertEquals( - "\033[32msome info\033[0m", - $formatter->format('some info') - ); - $this->assertEquals( - "\033[33msome comment\033[0m", - $formatter->format('some comment') - ); - $this->assertEquals( - "\033[30;46msome question\033[0m", - $formatter->format('some question') - ); - } - - public function testNestedStyles() - { - $formatter = new OutputFormatter(true); - - $this->assertEquals( - "\033[37;41msome \033[0m\033[32msome info\033[0m\033[37;41m error\033[0m", - $formatter->format('some some info error') - ); - } - - public function testDeepNestedStyles() - { - $formatter = new OutputFormatter(true); - - $this->assertEquals( - "\033[37;41merror\033[0m\033[32minfo\033[0m\033[33mcomment\033[0m\033[37;41merror\033[0m", - $formatter->format('errorinfocommenterror') - ); - } - - public function testNewStyle() - { - $formatter = new OutputFormatter(true); - - $style = new OutputFormatterStyle('blue', 'white'); - $formatter->setStyle('test', $style); - - $this->assertEquals($style, $formatter->getStyle('test')); - $this->assertNotEquals($style, $formatter->getStyle('info')); - - $this->assertEquals("\033[34;47msome custom msg\033[0m", $formatter->format('some custom msg')); - } - - public function testRedefineStyle() - { - $formatter = new OutputFormatter(true); - - $style = new OutputFormatterStyle('blue', 'white'); - $formatter->setStyle('info', $style); - - $this->assertEquals("\033[34;47msome custom msg\033[0m", $formatter->format('some custom msg')); - } - - public function testInlineStyle() - { - $formatter = new OutputFormatter(true); - - $this->assertEquals("\033[34;41msome text\033[0m", $formatter->format('some text')); - $this->assertEquals("\033[34;41msome text\033[0m", $formatter->format('some text')); - } - - public function testNotDecoratedFormatter() - { - $formatter = new OutputFormatter(false); - - $this->assertTrue($formatter->hasStyle('error')); - $this->assertTrue($formatter->hasStyle('info')); - $this->assertTrue($formatter->hasStyle('comment')); - $this->assertTrue($formatter->hasStyle('question')); - - $this->assertEquals( - "some error", $formatter->format('some error') - ); - $this->assertEquals( - "some info", $formatter->format('some info') - ); - $this->assertEquals( - "some comment", $formatter->format('some comment') - ); - $this->assertEquals( - "some question", $formatter->format('some question') - ); - - $formatter->setDecorated(true); - - $this->assertEquals( - "\033[37;41msome error\033[0m", $formatter->format('some error') - ); - $this->assertEquals( - "\033[32msome info\033[0m", $formatter->format('some info') - ); - $this->assertEquals( - "\033[33msome comment\033[0m", $formatter->format('some comment') - ); - $this->assertEquals( - "\033[30;46msome question\033[0m", $formatter->format('some question') - ); - } - - public function testContentWithLineBreaks() - { - $formatter = new OutputFormatter(true); - - $this->assertEquals(<<format(<< -some text -EOF - )); - - $this->assertEquals(<<format(<<some text - -EOF - )); - - $this->assertEquals(<<format(<< -some text - -EOF - )); - - $this->assertEquals(<<format(<< -some text -more text - -EOF - )); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php deleted file mode 100644 index a486f62..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Helper; - -use Symfony\Component\Console\Helper\DialogHelper; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Helper\FormatterHelper; -use Symfony\Component\Console\Output\StreamOutput; - -class DialogHelperTest extends \PHPUnit_Framework_TestCase -{ - public function testAsk() - { - $dialog = new DialogHelper(); - - $dialog->setInputStream($this->getInputStream("\n8AM\n")); - - $this->assertEquals('2PM', $dialog->ask($this->getOutputStream(), 'What time is it?', '2PM')); - $this->assertEquals('8AM', $dialog->ask($output = $this->getOutputStream(), 'What time is it?', '2PM')); - - rewind($output->getStream()); - $this->assertEquals('What time is it?', stream_get_contents($output->getStream())); - } - - public function testAskConfirmation() - { - $dialog = new DialogHelper(); - - $dialog->setInputStream($this->getInputStream("\n\n")); - $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?')); - $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false)); - - $dialog->setInputStream($this->getInputStream("y\nyes\n")); - $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false)); - $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false)); - - $dialog->setInputStream($this->getInputStream("n\nno\n")); - $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', true)); - $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', true)); - } - - public function testAskAndValidate() - { - $dialog = new DialogHelper(); - $helperSet = new HelperSet(array(new FormatterHelper())); - $dialog->setHelperSet($helperSet); - - $question ='What color was the white horse of Henry IV?'; - $error = 'This is not a color!'; - $validator = function ($color) use ($error) { - if (!in_array($color, array('white', 'black'))) { - throw new \InvalidArgumentException($error); - } - - return $color; - }; - - $dialog->setInputStream($this->getInputStream("\nblack\n")); - $this->assertEquals('white', $dialog->askAndValidate($this->getOutputStream(), $question, $validator, 2, 'white')); - $this->assertEquals('black', $dialog->askAndValidate($this->getOutputStream(), $question, $validator, 2, 'white')); - - $dialog->setInputStream($this->getInputStream("green\nyellow\norange\n")); - try { - $this->assertEquals('white', $dialog->askAndValidate($this->getOutputStream(), $question, $validator, 2, 'white')); - $this->fail(); - } catch (\InvalidArgumentException $e) { - $this->assertEquals($error, $e->getMessage()); - } - } - - protected function getInputStream($input) - { - $stream = fopen('php://memory', 'r+', false); - fputs($stream, $input); - rewind($stream); - - return $stream; - } - - protected function getOutputStream() - { - return new StreamOutput(fopen('php://memory', 'r+', false)); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Helper/FormatterHelperTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Helper/FormatterHelperTest.php deleted file mode 100644 index 5ab62a3..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Helper/FormatterHelperTest.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Helper; - -use Symfony\Component\Console\Helper\FormatterHelper; - -class FormatterHelperTest extends \PHPUnit_Framework_TestCase -{ - public function testFormatSection() - { - $formatter = new FormatterHelper(); - - $this->assertEquals( - '[cli] Some text to display', - $formatter->formatSection('cli', 'Some text to display'), - '::formatSection() formats a message in a section' - ); - } - - public function testFormatBlock() - { - $formatter = new FormatterHelper(); - - $this->assertEquals( - ' Some text to display ', - $formatter->formatBlock('Some text to display', 'error'), - '::formatBlock() formats a message in a block' - ); - - $this->assertEquals( - ' Some text to display ' . "\n" . - ' foo bar ', - $formatter->formatBlock(array('Some text to display', 'foo bar'), 'error'), - '::formatBlock() formats a message in a block' - ); - - $this->assertEquals( - ' ' . "\n" . - ' Some text to display ' . "\n" . - ' ', - $formatter->formatBlock('Some text to display', 'error', true), - '::formatBlock() formats a message in a block' - ); - } - - public function testFormatBlockWithDiacriticLetters() - { - if (!extension_loaded('mbstring')) { - $this->markTestSkipped('This test requires mbstring to work.'); - } - - $formatter = new FormatterHelper(); - - $this->assertEquals( - ' ' . "\n" . - ' Du texte à afficher ' . "\n" . - ' ', - $formatter->formatBlock('Du texte à afficher', 'error', true), - '::formatBlock() formats a message in a block' - ); - } - - public function testFormatBlockLGEscaping() - { - $formatter = new FormatterHelper(); - - $this->assertEquals( - ' ' . "\n" . - ' \some info\ ' . "\n" . - ' ', - $formatter->formatBlock('some info', 'error', true), - '::formatBlock() escapes \'<\' chars' - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/ArgvInputTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/ArgvInputTest.php deleted file mode 100644 index cf63177..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/ArgvInputTest.php +++ /dev/null @@ -1,217 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Input; - -use Symfony\Component\Console\Input\ArgvInput; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; - -class ArgvInputTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $_SERVER['argv'] = array('cli.php', 'foo'); - $input = new ArgvInput(); - $r = new \ReflectionObject($input); - $p = $r->getProperty('tokens'); - $p->setAccessible(true); - - $this->assertEquals(array('foo'), $p->getValue($input), '__construct() automatically get its input from the argv server variable'); - } - - public function testParser() - { - $input = new ArgvInput(array('cli.php', 'foo')); - $input->bind(new InputDefinition(array(new InputArgument('name')))); - $this->assertEquals(array('name' => 'foo'), $input->getArguments(), '->parse() parses required arguments'); - - $input->bind(new InputDefinition(array(new InputArgument('name')))); - $this->assertEquals(array('name' => 'foo'), $input->getArguments(), '->parse() is stateless'); - - $input = new ArgvInput(array('cli.php', '--foo')); - $input->bind(new InputDefinition(array(new InputOption('foo')))); - $this->assertEquals(array('foo' => true), $input->getOptions(), '->parse() parses long options without a value'); - - $input = new ArgvInput(array('cli.php', '--foo=bar')); - $input->bind(new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)))); - $this->assertEquals(array('foo' => 'bar'), $input->getOptions(), '->parse() parses long options with a required value (with a = separator)'); - - $input = new ArgvInput(array('cli.php', '--foo', 'bar')); - $input->bind(new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)))); - $this->assertEquals(array('foo' => 'bar'), $input->getOptions(), '->parse() parses long options with a required value (with a space separator)'); - - try { - $input = new ArgvInput(array('cli.php', '--foo')); - $input->bind(new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)))); - $this->fail('->parse() throws a \RuntimeException if no value is passed to an option when it is required'); - } catch (\Exception $e) { - $this->assertInstanceOf('\RuntimeException', $e, '->parse() throws a \RuntimeException if no value is passed to an option when it is required'); - $this->assertEquals('The "--foo" option requires a value.', $e->getMessage(), '->parse() throws a \RuntimeException if no value is passed to an option when it is required'); - } - - $input = new ArgvInput(array('cli.php', '-f')); - $input->bind(new InputDefinition(array(new InputOption('foo', 'f')))); - $this->assertEquals(array('foo' => true), $input->getOptions(), '->parse() parses short options without a value'); - - $input = new ArgvInput(array('cli.php', '-fbar')); - $input->bind(new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)))); - $this->assertEquals(array('foo' => 'bar'), $input->getOptions(), '->parse() parses short options with a required value (with no separator)'); - - $input = new ArgvInput(array('cli.php', '-f', 'bar')); - $input->bind(new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)))); - $this->assertEquals(array('foo' => 'bar'), $input->getOptions(), '->parse() parses short options with a required value (with a space separator)'); - - $input = new ArgvInput(array('cli.php', '-f', '-b', 'foo')); - $input->bind(new InputDefinition(array(new InputArgument('name'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b')))); - $this->assertEquals(array('foo' => null, 'bar' => true), $input->getOptions(), '->parse() parses short options with an optional value which is not present'); - - try { - $input = new ArgvInput(array('cli.php', '-f')); - $input->bind(new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)))); - $this->fail('->parse() throws a \RuntimeException if no value is passed to an option when it is required'); - } catch (\Exception $e) { - $this->assertInstanceOf('\RuntimeException', $e, '->parse() throws a \RuntimeException if no value is passed to an option when it is required'); - $this->assertEquals('The "--foo" option requires a value.', $e->getMessage(), '->parse() throws a \RuntimeException if no value is passed to an option when it is required'); - } - - try { - $input = new ArgvInput(array('cli.php', '-ffoo')); - $input->bind(new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_NONE)))); - $this->fail('->parse() throws a \RuntimeException if a value is passed to an option which does not take one'); - } catch (\Exception $e) { - $this->assertInstanceOf('\RuntimeException', $e, '->parse() throws a \RuntimeException if a value is passed to an option which does not take one'); - $this->assertEquals('The "-o" option does not exist.', $e->getMessage(), '->parse() throws a \RuntimeException if a value is passed to an option which does not take one'); - } - - try { - $input = new ArgvInput(array('cli.php', 'foo', 'bar')); - $input->bind(new InputDefinition()); - $this->fail('->parse() throws a \RuntimeException if too many arguments are passed'); - } catch (\Exception $e) { - $this->assertInstanceOf('\RuntimeException', $e, '->parse() throws a \RuntimeException if too many arguments are passed'); - $this->assertEquals('Too many arguments.', $e->getMessage(), '->parse() throws a \RuntimeException if too many arguments are passed'); - } - - try { - $input = new ArgvInput(array('cli.php', '--foo')); - $input->bind(new InputDefinition()); - $this->fail('->parse() throws a \RuntimeException if an unknown long option is passed'); - } catch (\Exception $e) { - $this->assertInstanceOf('\RuntimeException', $e, '->parse() throws a \RuntimeException if an unknown long option is passed'); - $this->assertEquals('The "--foo" option does not exist.', $e->getMessage(), '->parse() throws a \RuntimeException if an unknown long option is passed'); - } - - try { - $input = new ArgvInput(array('cli.php', '-f')); - $input->bind(new InputDefinition()); - $this->fail('->parse() throws a \RuntimeException if an unknown short option is passed'); - } catch (\Exception $e) { - $this->assertInstanceOf('\RuntimeException', $e, '->parse() throws a \RuntimeException if an unknown short option is passed'); - $this->assertEquals('The "-f" option does not exist.', $e->getMessage(), '->parse() throws a \RuntimeException if an unknown short option is passed'); - } - - $input = new ArgvInput(array('cli.php', '-fb')); - $input->bind(new InputDefinition(array(new InputOption('foo', 'f'), new InputOption('bar', 'b')))); - $this->assertEquals(array('foo' => true, 'bar' => true), $input->getOptions(), '->parse() parses short options when they are aggregated as a single one'); - - $input = new ArgvInput(array('cli.php', '-fb', 'bar')); - $input->bind(new InputDefinition(array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_REQUIRED)))); - $this->assertEquals(array('foo' => true, 'bar' => 'bar'), $input->getOptions(), '->parse() parses short options when they are aggregated as a single one and the last one has a required value'); - - $input = new ArgvInput(array('cli.php', '-fb', 'bar')); - $input->bind(new InputDefinition(array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)))); - $this->assertEquals(array('foo' => true, 'bar' => 'bar'), $input->getOptions(), '->parse() parses short options when they are aggregated as a single one and the last one has an optional value'); - - $input = new ArgvInput(array('cli.php', '-fbbar')); - $input->bind(new InputDefinition(array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)))); - $this->assertEquals(array('foo' => true, 'bar' => 'bar'), $input->getOptions(), '->parse() parses short options when they are aggregated as a single one and the last one has an optional value with no separator'); - - $input = new ArgvInput(array('cli.php', '-fbbar')); - $input->bind(new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)))); - $this->assertEquals(array('foo' => 'bbar', 'bar' => null), $input->getOptions(), '->parse() parses short options when they are aggregated as a single one and one of them takes a value'); - - try { - $input = new ArgvInput(array('cli.php', 'foo', 'bar', 'baz', 'bat')); - $input->bind(new InputDefinition(array(new InputArgument('name', InputArgument::IS_ARRAY)))); - $this->assertEquals(array('name' => array('foo', 'bar', 'baz', 'bat')), $input->getArguments(), '->parse() parses array arguments'); - } catch (\RuntimeException $e) { - $this->assertNotEquals('Too many arguments.', $e->getMessage(), '->parse() parses array arguments'); - } - - $input = new ArgvInput(array('cli.php', '--name=foo', '--name=bar', '--name=baz')); - $input->bind(new InputDefinition(array(new InputOption('name', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY)))); - $this->assertEquals(array('name' => array('foo', 'bar', 'baz')), $input->getOptions()); - - try { - $input = new ArgvInput(array('cli.php', '-1')); - $input->bind(new InputDefinition(array(new InputArgument('number')))); - $this->fail('->parse() throws a \RuntimeException if an unknown option is passed'); - } catch (\Exception $e) { - $this->assertInstanceOf('\RuntimeException', $e, '->parse() parses arguments with leading dashes as options without having encountered a double-dash sequence'); - $this->assertEquals('The "-1" option does not exist.', $e->getMessage(), '->parse() parses arguments with leading dashes as options without having encountered a double-dash sequence'); - } - - $input = new ArgvInput(array('cli.php', '--', '-1')); - $input->bind(new InputDefinition(array(new InputArgument('number')))); - $this->assertEquals(array('number' => '-1'), $input->getArguments(), '->parse() parses arguments with leading dashes as arguments after having encountered a double-dash sequence'); - - $input = new ArgvInput(array('cli.php', '-f', 'bar', '--', '-1')); - $input->bind(new InputDefinition(array(new InputArgument('number'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)))); - $this->assertEquals(array('foo' => 'bar'), $input->getOptions(), '->parse() parses arguments with leading dashes as options before having encountered a double-dash sequence'); - $this->assertEquals(array('number' => '-1'), $input->getArguments(), '->parse() parses arguments with leading dashes as arguments after having encountered a double-dash sequence'); - - $input = new ArgvInput(array('cli.php', '-f', 'bar', '')); - $input->bind(new InputDefinition(array(new InputArgument('empty'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)))); - $this->assertEquals(array('empty' => ''), $input->getArguments(), '->parse() parses empty string arguments'); - } - - public function testGetFirstArgument() - { - $input = new ArgvInput(array('cli.php', '-fbbar')); - $this->assertEquals('', $input->getFirstArgument(), '->getFirstArgument() returns the first argument from the raw input'); - - $input = new ArgvInput(array('cli.php', '-fbbar', 'foo')); - $this->assertEquals('foo', $input->getFirstArgument(), '->getFirstArgument() returns the first argument from the raw input'); - } - - public function testHasParameterOption() - { - $input = new ArgvInput(array('cli.php', '-f', 'foo')); - $this->assertTrue($input->hasParameterOption('-f'), '->hasParameterOption() returns true if the given short option is in the raw input'); - - $input = new ArgvInput(array('cli.php', '--foo', 'foo')); - $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if the given short option is in the raw input'); - - $input = new ArgvInput(array('cli.php', 'foo')); - $this->assertFalse($input->hasParameterOption('--foo'), '->hasParameterOption() returns false if the given short option is not in the raw input'); - } - - /** - * @dataProvider provideGetParameterOptionValues - */ - public function testGetParameterOptionEqualSign($argv, $key, $expected) - { - $input = new ArgvInput($argv); - $this->assertEquals($expected, $input->getParameterOption($key), '->getParameterOption() returns the expected value'); - } - - public function provideGetParameterOptionValues() - { - return array( - array(array('app/console', 'foo:bar', '-e', 'dev'), '-e', 'dev'), - array(array('app/console', 'foo:bar', '--env=dev'), '--env', 'dev'), - array(array('app/console', 'foo:bar', '-e', 'dev'), array('-e', '--env'), 'dev'), - array(array('app/console', 'foo:bar', '--env=dev'), array('-e', '--env'), 'dev'), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/ArrayInputTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/ArrayInputTest.php deleted file mode 100644 index 82f477e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/ArrayInputTest.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Input; - -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; - -class ArrayInputTest extends \PHPUnit_Framework_TestCase -{ - public function testGetFirstArgument() - { - $input = new ArrayInput(array()); - $this->assertNull($input->getFirstArgument(), '->getFirstArgument() returns null if no argument were passed'); - $input = new ArrayInput(array('name' => 'Fabien')); - $this->assertEquals('Fabien', $input->getFirstArgument(), '->getFirstArgument() returns the first passed argument'); - $input = new ArrayInput(array('--foo' => 'bar', 'name' => 'Fabien')); - $this->assertEquals('Fabien', $input->getFirstArgument(), '->getFirstArgument() returns the first passed argument'); - } - - public function testHasParameterOption() - { - $input = new ArrayInput(array('name' => 'Fabien', '--foo' => 'bar')); - $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if an option is present in the passed parameters'); - $this->assertFalse($input->hasParameterOption('--bar'), '->hasParameterOption() returns false if an option is not present in the passed parameters'); - - $input = new ArrayInput(array('--foo')); - $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if an option is present in the passed parameters'); - } - - public function testParse() - { - $input = new ArrayInput(array('name' => 'foo'), new InputDefinition(array(new InputArgument('name')))); - $this->assertEquals(array('name' => 'foo'), $input->getArguments(), '->parse() parses required arguments'); - - try { - $input = new ArrayInput(array('foo' => 'foo'), new InputDefinition(array(new InputArgument('name')))); - $this->fail('->parse() throws an \InvalidArgumentException exception if an invalid argument is passed'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->parse() throws an \InvalidArgumentException exception if an invalid argument is passed'); - $this->assertEquals('The "foo" argument does not exist.', $e->getMessage(), '->parse() throws an \InvalidArgumentException exception if an invalid argument is passed'); - } - - $input = new ArrayInput(array('--foo' => 'bar'), new InputDefinition(array(new InputOption('foo')))); - $this->assertEquals(array('foo' => 'bar'), $input->getOptions(), '->parse() parses long options'); - - $input = new ArrayInput(array('--foo' => 'bar'), new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')))); - $this->assertEquals(array('foo' => 'bar'), $input->getOptions(), '->parse() parses long options with a default value'); - - $input = new ArrayInput(array('--foo' => null), new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')))); - $this->assertEquals(array('foo' => 'default'), $input->getOptions(), '->parse() parses long options with a default value'); - - try { - $input = new ArrayInput(array('--foo' => null), new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)))); - $this->fail('->parse() throws an \InvalidArgumentException exception if a required option is passed without a value'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->parse() throws an \InvalidArgumentException exception if a required option is passed without a value'); - $this->assertEquals('The "--foo" option requires a value.', $e->getMessage(), '->parse() throws an \InvalidArgumentException exception if a required option is passed without a value'); - } - - try { - $input = new ArrayInput(array('--foo' => 'foo'), new InputDefinition()); - $this->fail('->parse() throws an \InvalidArgumentException exception if an invalid option is passed'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->parse() throws an \InvalidArgumentException exception if an invalid option is passed'); - $this->assertEquals('The "--foo" option does not exist.', $e->getMessage(), '->parse() throws an \InvalidArgumentException exception if an invalid option is passed'); - } - - $input = new ArrayInput(array('-f' => 'bar'), new InputDefinition(array(new InputOption('foo', 'f')))); - $this->assertEquals(array('foo' => 'bar'), $input->getOptions(), '->parse() parses short options'); - - try { - $input = new ArrayInput(array('-o' => 'foo'), new InputDefinition()); - $this->fail('->parse() throws an \InvalidArgumentException exception if an invalid option is passed'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->parse() throws an \InvalidArgumentException exception if an invalid option is passed'); - $this->assertEquals('The "-o" option does not exist.', $e->getMessage(), '->parse() throws an \InvalidArgumentException exception if an invalid option is passed'); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/InputArgumentTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/InputArgumentTest.php deleted file mode 100644 index 1b680a9..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/InputArgumentTest.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Input; - -use Symfony\Component\Console\Input\InputArgument; - -class InputArgumentTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $argument = new InputArgument('foo'); - $this->assertEquals('foo', $argument->getName(), '__construct() takes a name as its first argument'); - - // mode argument - $argument = new InputArgument('foo'); - $this->assertFalse($argument->isRequired(), '__construct() gives a "InputArgument::OPTIONAL" mode by default'); - - $argument = new InputArgument('foo', null); - $this->assertFalse($argument->isRequired(), '__construct() can take "InputArgument::OPTIONAL" as its mode'); - - $argument = new InputArgument('foo', InputArgument::OPTIONAL); - $this->assertFalse($argument->isRequired(), '__construct() can take "InputArgument::OPTIONAL" as its mode'); - - $argument = new InputArgument('foo', InputArgument::REQUIRED); - $this->assertTrue($argument->isRequired(), '__construct() can take "InputArgument::REQUIRED" as its mode'); - - try { - $argument = new InputArgument('foo', 'ANOTHER_ONE'); - $this->fail('__construct() throws an Exception if the mode is not valid'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Exception', $e, '__construct() throws an Exception if the mode is not valid'); - $this->assertEquals('Argument mode "ANOTHER_ONE" is not valid.', $e->getMessage()); - } - try { - $argument = new InputArgument('foo', -1); - $this->fail('__construct() throws an Exception if the mode is not valid'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Exception', $e, '__construct() throws an Exception if the mode is not valid'); - $this->assertEquals('Argument mode "-1" is not valid.', $e->getMessage()); - } - } - - public function testIsArray() - { - $argument = new InputArgument('foo', InputArgument::IS_ARRAY); - $this->assertTrue($argument->isArray(), '->isArray() returns true if the argument can be an array'); - $argument = new InputArgument('foo', InputArgument::OPTIONAL | InputArgument::IS_ARRAY); - $this->assertTrue($argument->isArray(), '->isArray() returns true if the argument can be an array'); - $argument = new InputArgument('foo', InputArgument::OPTIONAL); - $this->assertFalse($argument->isArray(), '->isArray() returns false if the argument can not be an array'); - } - - public function testGetDescription() - { - $argument = new InputArgument('foo', null, 'Some description'); - $this->assertEquals('Some description', $argument->getDescription(), '->getDescription() return the message description'); - } - - public function testGetDefault() - { - $argument = new InputArgument('foo', InputArgument::OPTIONAL, '', 'default'); - $this->assertEquals('default', $argument->getDefault(), '->getDefault() return the default value'); - } - - public function testSetDefault() - { - $argument = new InputArgument('foo', InputArgument::OPTIONAL, '', 'default'); - $argument->setDefault(null); - $this->assertNull($argument->getDefault(), '->setDefault() can reset the default value by passing null'); - $argument->setDefault('another'); - $this->assertEquals('another', $argument->getDefault(), '->setDefault() changes the default value'); - - $argument = new InputArgument('foo', InputArgument::OPTIONAL | InputArgument::IS_ARRAY); - $argument->setDefault(array(1, 2)); - $this->assertEquals(array(1, 2), $argument->getDefault(), '->setDefault() changes the default value'); - - try { - $argument = new InputArgument('foo', InputArgument::REQUIRED); - $argument->setDefault('default'); - $this->fail('->setDefault() throws an Exception if you give a default value for a required argument'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Exception', $e, '->parse() throws an \InvalidArgumentException exception if an invalid option is passed'); - $this->assertEquals('Cannot set a default value except for Parameter::OPTIONAL mode.', $e->getMessage()); - } - - try { - $argument = new InputArgument('foo', InputArgument::IS_ARRAY); - $argument->setDefault('default'); - $this->fail('->setDefault() throws an Exception if you give a default value which is not an array for a IS_ARRAY option'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Exception', $e, '->setDefault() throws an Exception if you give a default value which is not an array for a IS_ARRAY option'); - $this->assertEquals('A default value for an array argument must be an array.', $e->getMessage()); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php deleted file mode 100644 index 20554ec..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php +++ /dev/null @@ -1,363 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Input; - -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; - -class InputDefinitionTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixtures; - - protected $foo, $bar, $foo1, $foo2; - - public static function setUpBeforeClass() - { - self::$fixtures = __DIR__.'/../Fixtures/'; - } - - public function testConstructor() - { - $this->initializeArguments(); - - $definition = new InputDefinition(); - $this->assertEquals(array(), $definition->getArguments(), '__construct() creates a new InputDefinition object'); - - $definition = new InputDefinition(array($this->foo, $this->bar)); - $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getArguments(), '__construct() takes an array of InputArgument objects as its first argument'); - - $this->initializeOptions(); - - $definition = new InputDefinition(); - $this->assertEquals(array(), $definition->getOptions(), '__construct() creates a new InputDefinition object'); - - $definition = new InputDefinition(array($this->foo, $this->bar)); - $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getOptions(), '__construct() takes an array of InputOption objects as its first argument'); - } - - public function testSetArguments() - { - $this->initializeArguments(); - - $definition = new InputDefinition(); - $definition->setArguments(array($this->foo)); - $this->assertEquals(array('foo' => $this->foo), $definition->getArguments(), '->setArguments() sets the array of InputArgument objects'); - $definition->setArguments(array($this->bar)); - - $this->assertEquals(array('bar' => $this->bar), $definition->getArguments(), '->setArguments() clears all InputArgument objects'); - } - - public function testAddArguments() - { - $this->initializeArguments(); - - $definition = new InputDefinition(); - $definition->addArguments(array($this->foo)); - $this->assertEquals(array('foo' => $this->foo), $definition->getArguments(), '->addArguments() adds an array of InputArgument objects'); - $definition->addArguments(array($this->bar)); - $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getArguments(), '->addArguments() does not clear existing InputArgument objects'); - } - - public function testAddArgument() - { - $this->initializeArguments(); - - $definition = new InputDefinition(); - $definition->addArgument($this->foo); - $this->assertEquals(array('foo' => $this->foo), $definition->getArguments(), '->addArgument() adds a InputArgument object'); - $definition->addArgument($this->bar); - $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getArguments(), '->addArgument() adds a InputArgument object'); - - // arguments must have different names - try { - $definition->addArgument($this->foo1); - $this->fail('->addArgument() throws a Exception if another argument is already registered with the same name'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Exception', $e, '->addArgument() throws a Exception if another argument is already registered with the same name'); - $this->assertEquals('An argument with name "foo" already exists.', $e->getMessage()); - } - - // cannot add a parameter after an array parameter - $definition->addArgument(new InputArgument('fooarray', InputArgument::IS_ARRAY)); - try { - $definition->addArgument(new InputArgument('anotherbar')); - $this->fail('->addArgument() throws a Exception if there is an array parameter already registered'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Exception', $e, '->addArgument() throws a Exception if there is an array parameter already registered'); - $this->assertEquals('Cannot add an argument after an array argument.', $e->getMessage()); - } - - // cannot add a required argument after an optional one - $definition = new InputDefinition(); - $definition->addArgument($this->foo); - try { - $definition->addArgument($this->foo2); - $this->fail('->addArgument() throws an exception if you try to add a required argument after an optional one'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Exception', $e, '->addArgument() throws an exception if you try to add a required argument after an optional one'); - $this->assertEquals('Cannot add a required argument after an optional one.', $e->getMessage()); - } - } - - public function testGetArgument() - { - $this->initializeArguments(); - - $definition = new InputDefinition(); - $definition->addArguments(array($this->foo)); - $this->assertEquals($this->foo, $definition->getArgument('foo'), '->getArgument() returns a InputArgument by its name'); - try { - $definition->getArgument('bar'); - $this->fail('->getArgument() throws an exception if the InputArgument name does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Exception', $e, '->getArgument() throws an exception if the InputArgument name does not exist'); - $this->assertEquals('The "bar" argument does not exist.', $e->getMessage()); - } - } - - public function testHasArgument() - { - $this->initializeArguments(); - - $definition = new InputDefinition(); - $definition->addArguments(array($this->foo)); - $this->assertTrue($definition->hasArgument('foo'), '->hasArgument() returns true if a InputArgument exists for the given name'); - $this->assertFalse($definition->hasArgument('bar'), '->hasArgument() returns false if a InputArgument exists for the given name'); - } - - public function testGetArgumentRequiredCount() - { - $this->initializeArguments(); - - $definition = new InputDefinition(); - $definition->addArgument($this->foo2); - $this->assertEquals(1, $definition->getArgumentRequiredCount(), '->getArgumentRequiredCount() returns the number of required arguments'); - $definition->addArgument($this->foo); - $this->assertEquals(1, $definition->getArgumentRequiredCount(), '->getArgumentRequiredCount() returns the number of required arguments'); - } - - public function testGetArgumentCount() - { - $this->initializeArguments(); - - $definition = new InputDefinition(); - $definition->addArgument($this->foo2); - $this->assertEquals(1, $definition->getArgumentCount(), '->getArgumentCount() returns the number of arguments'); - $definition->addArgument($this->foo); - $this->assertEquals(2, $definition->getArgumentCount(), '->getArgumentCount() returns the number of arguments'); - } - - public function testGetArgumentDefaults() - { - $definition = new InputDefinition(array( - new InputArgument('foo1', InputArgument::OPTIONAL), - new InputArgument('foo2', InputArgument::OPTIONAL, '', 'default'), - new InputArgument('foo3', InputArgument::OPTIONAL | InputArgument::IS_ARRAY), - // new InputArgument('foo4', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, '', array(1, 2)), - )); - $this->assertEquals(array('foo1' => null, 'foo2' => 'default', 'foo3' => array()), $definition->getArgumentDefaults(), '->getArgumentDefaults() return the default values for each argument'); - - $definition = new InputDefinition(array( - new InputArgument('foo4', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, '', array(1, 2)), - )); - $this->assertEquals(array('foo4' => array(1, 2)), $definition->getArgumentDefaults(), '->getArgumentDefaults() return the default values for each argument'); - } - - public function testSetOptions() - { - $this->initializeOptions(); - - $definition = new InputDefinition(array($this->foo)); - $this->assertEquals(array('foo' => $this->foo), $definition->getOptions(), '->setOptions() sets the array of InputOption objects'); - $definition->setOptions(array($this->bar)); - $this->assertEquals(array('bar' => $this->bar), $definition->getOptions(), '->setOptions() clears all InputOption objects'); - try { - $definition->getOptionForShortcut('f'); - $this->fail('->setOptions() clears all InputOption objects'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Exception', $e, '->setOptions() clears all InputOption objects'); - $this->assertEquals('The "-f" option does not exist.', $e->getMessage()); - } - } - - public function testAddOptions() - { - $this->initializeOptions(); - - $definition = new InputDefinition(array($this->foo)); - $this->assertEquals(array('foo' => $this->foo), $definition->getOptions(), '->addOptions() adds an array of InputOption objects'); - $definition->addOptions(array($this->bar)); - $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getOptions(), '->addOptions() does not clear existing InputOption objects'); - } - - public function testAddOption() - { - $this->initializeOptions(); - - $definition = new InputDefinition(); - $definition->addOption($this->foo); - $this->assertEquals(array('foo' => $this->foo), $definition->getOptions(), '->addOption() adds a InputOption object'); - $definition->addOption($this->bar); - $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getOptions(), '->addOption() adds a InputOption object'); - try { - $definition->addOption($this->foo2); - $this->fail('->addOption() throws a Exception if the another option is already registered with the same name'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Exception', $e, '->addOption() throws a Exception if the another option is already registered with the same name'); - $this->assertEquals('An option named "foo" already exists.', $e->getMessage()); - } - try { - $definition->addOption($this->foo1); - $this->fail('->addOption() throws a Exception if the another option is already registered with the same shortcut'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Exception', $e, '->addOption() throws a Exception if the another option is already registered with the same shortcut'); - $this->assertEquals('An option with shortcut "f" already exists.', $e->getMessage()); - } - } - - public function testGetOption() - { - $this->initializeOptions(); - - $definition = new InputDefinition(array($this->foo)); - $this->assertEquals($this->foo, $definition->getOption('foo'), '->getOption() returns a InputOption by its name'); - try { - $definition->getOption('bar'); - $this->fail('->getOption() throws an exception if the option name does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Exception', $e, '->getOption() throws an exception if the option name does not exist'); - $this->assertEquals('The "--bar" option does not exist.', $e->getMessage()); - } - } - - public function testHasOption() - { - $this->initializeOptions(); - - $definition = new InputDefinition(array($this->foo)); - $this->assertTrue($definition->hasOption('foo'), '->hasOption() returns true if a InputOption exists for the given name'); - $this->assertFalse($definition->hasOption('bar'), '->hasOption() returns false if a InputOption exists for the given name'); - } - - public function testHasShortcut() - { - $this->initializeOptions(); - - $definition = new InputDefinition(array($this->foo)); - $this->assertTrue($definition->hasShortcut('f'), '->hasShortcut() returns true if a InputOption exists for the given shortcut'); - $this->assertFalse($definition->hasShortcut('b'), '->hasShortcut() returns false if a InputOption exists for the given shortcut'); - } - - public function testGetOptionForShortcut() - { - $this->initializeOptions(); - - $definition = new InputDefinition(array($this->foo)); - $this->assertEquals($this->foo, $definition->getOptionForShortcut('f'), '->getOptionForShortcut() returns a InputOption by its shortcut'); - try { - $definition->getOptionForShortcut('l'); - $this->fail('->getOption() throws an exception if the shortcut does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Exception', $e, '->getOption() throws an exception if the shortcut does not exist'); - $this->assertEquals('The "-l" option does not exist.', $e->getMessage()); - } - } - - public function testGetOptionDefaults() - { - $definition = new InputDefinition(array( - new InputOption('foo1', null, InputOption::VALUE_NONE), - new InputOption('foo2', null, InputOption::VALUE_REQUIRED), - new InputOption('foo3', null, InputOption::VALUE_REQUIRED, '', 'default'), - new InputOption('foo4', null, InputOption::VALUE_OPTIONAL), - new InputOption('foo5', null, InputOption::VALUE_OPTIONAL, '', 'default'), - new InputOption('foo6', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY), - new InputOption('foo7', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, '', array(1, 2)), - )); - $defaults = array( - 'foo1' => null, - 'foo2' => null, - 'foo3' => 'default', - 'foo4' => null, - 'foo5' => 'default', - 'foo6' => array(), - 'foo7' => array(1, 2), - ); - $this->assertEquals($defaults, $definition->getOptionDefaults(), '->getOptionDefaults() returns the default values for all options'); - } - - public function testGetSynopsis() - { - $definition = new InputDefinition(array(new InputOption('foo'))); - $this->assertEquals('[--foo]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options'); - $definition = new InputDefinition(array(new InputOption('foo', 'f'))); - $this->assertEquals('[-f|--foo]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options'); - $definition = new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))); - $this->assertEquals('[-f|--foo="..."]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options'); - $definition = new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL))); - $this->assertEquals('[-f|--foo[="..."]]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options'); - - $definition = new InputDefinition(array(new InputArgument('foo'))); - $this->assertEquals('[foo]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options'); - $definition = new InputDefinition(array(new InputArgument('foo', InputArgument::REQUIRED))); - $this->assertEquals('foo', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options'); - $definition = new InputDefinition(array(new InputArgument('foo', InputArgument::IS_ARRAY))); - $this->assertEquals('[foo1] ... [fooN]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options'); - $definition = new InputDefinition(array(new InputArgument('foo', InputArgument::REQUIRED | InputArgument::IS_ARRAY))); - $this->assertEquals('foo1 ... [fooN]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options'); - } - - public function testAsText() - { - $definition = new InputDefinition(array( - new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'), - new InputArgument('baz', InputArgument::OPTIONAL, 'The baz argument', true), - new InputArgument('bar', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'The bar argument', array('bar')), - new InputOption('foo', 'f', InputOption::VALUE_REQUIRED, 'The foo option'), - new InputOption('baz', null, InputOption::VALUE_OPTIONAL, 'The baz option', false), - new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL, 'The bar option', 'bar'), - new InputOption('qux', '', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The qux option', array('foo', 'bar')), - new InputOption('qux2', '', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The qux2 option', array('foo' => 'bar')), - )); - $this->assertStringEqualsFile(self::$fixtures.'/definition_astext.txt', $definition->asText(), '->asText() returns a textual representation of the InputDefinition'); - } - - public function testAsXml() - { - $definition = new InputDefinition(array( - new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'), - new InputArgument('baz', InputArgument::OPTIONAL, 'The baz argument', true), - new InputArgument('bar', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'The bar argument', array('bar')), - new InputOption('foo', 'f', InputOption::VALUE_REQUIRED, 'The foo option'), - new InputOption('baz', null, InputOption::VALUE_OPTIONAL, 'The baz option', false), - new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL, 'The bar option', 'bar'), - )); - $this->assertXmlStringEqualsXmlFile(self::$fixtures.'/definition_asxml.txt', $definition->asXml(), '->asText() returns a textual representation of the InputDefinition'); - } - - protected function initializeArguments() - { - $this->foo = new InputArgument('foo'); - $this->bar = new InputArgument('bar'); - $this->foo1 = new InputArgument('foo'); - $this->foo2 = new InputArgument('foo2', InputArgument::REQUIRED); - } - - protected function initializeOptions() - { - $this->foo = new InputOption('foo', 'f'); - $this->bar = new InputOption('bar', 'b'); - $this->foo1 = new InputOption('fooBis', 'f'); - $this->foo2 = new InputOption('foo', 'p'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/InputOptionTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/InputOptionTest.php deleted file mode 100644 index b5d8b43..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/InputOptionTest.php +++ /dev/null @@ -1,192 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Input; - -use Symfony\Component\Console\Input\InputOption; - -class InputOptionTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $option = new InputOption('foo'); - $this->assertEquals('foo', $option->getName(), '__construct() takes a name as its first argument'); - $option = new InputOption('--foo'); - $this->assertEquals('foo', $option->getName(), '__construct() removes the leading -- of the option name'); - - try { - $option = new InputOption('foo', 'f', InputOption::VALUE_IS_ARRAY); - $this->fail('->setDefault() throws an Exception if VALUE_IS_ARRAY option is used when an option does not accept a value'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Exception', $e, '->setDefault() throws an Exception if VALUE_IS_ARRAY option is used when an option does not accept a value'); - $this->assertEquals('Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.', $e->getMessage()); - } - - // shortcut argument - $option = new InputOption('foo', 'f'); - $this->assertEquals('f', $option->getShortcut(), '__construct() can take a shortcut as its second argument'); - $option = new InputOption('foo', '-f'); - $this->assertEquals('f', $option->getShortcut(), '__construct() removes the leading - of the shortcut'); - $option = new InputOption('foo'); - $this->assertNull($option->getShortcut(), '__construct() makes the shortcut null by default'); - - // mode argument - $option = new InputOption('foo', 'f'); - $this->assertFalse($option->acceptValue(), '__construct() gives a "InputOption::VALUE_NONE" mode by default'); - $this->assertFalse($option->isValueRequired(), '__construct() gives a "InputOption::VALUE_NONE" mode by default'); - $this->assertFalse($option->isValueOptional(), '__construct() gives a "InputOption::VALUE_NONE" mode by default'); - - $option = new InputOption('foo', 'f', null); - $this->assertFalse($option->acceptValue(), '__construct() can take "InputOption::VALUE_NONE" as its mode'); - $this->assertFalse($option->isValueRequired(), '__construct() can take "InputOption::VALUE_NONE" as its mode'); - $this->assertFalse($option->isValueOptional(), '__construct() can take "InputOption::VALUE_NONE" as its mode'); - - $option = new InputOption('foo', 'f', InputOption::VALUE_NONE); - $this->assertFalse($option->acceptValue(), '__construct() can take "InputOption::VALUE_NONE" as its mode'); - $this->assertFalse($option->isValueRequired(), '__construct() can take "InputOption::VALUE_NONE" as its mode'); - $this->assertFalse($option->isValueOptional(), '__construct() can take "InputOption::VALUE_NONE" as its mode'); - - $option = new InputOption('foo', 'f', InputOption::VALUE_REQUIRED); - $this->assertTrue($option->acceptValue(), '__construct() can take "InputOption::VALUE_REQUIRED" as its mode'); - $this->assertTrue($option->isValueRequired(), '__construct() can take "InputOption::VALUE_REQUIRED" as its mode'); - $this->assertFalse($option->isValueOptional(), '__construct() can take "InputOption::VALUE_REQUIRED" as its mode'); - - $option = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL); - $this->assertTrue($option->acceptValue(), '__construct() can take "InputOption::VALUE_OPTIONAL" as its mode'); - $this->assertFalse($option->isValueRequired(), '__construct() can take "InputOption::VALUE_OPTIONAL" as its mode'); - $this->assertTrue($option->isValueOptional(), '__construct() can take "InputOption::VALUE_OPTIONAL" as its mode'); - - try { - $option = new InputOption('foo', 'f', 'ANOTHER_ONE'); - $this->fail('__construct() throws an Exception if the mode is not valid'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Exception', $e, '__construct() throws an Exception if the mode is not valid'); - $this->assertEquals('Option mode "ANOTHER_ONE" is not valid.', $e->getMessage()); - } - try { - $option = new InputOption('foo', 'f', -1); - $this->fail('__construct() throws an Exception if the mode is not valid'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Exception', $e, '__construct() throws an Exception if the mode is not valid'); - $this->assertEquals('Option mode "-1" is not valid.', $e->getMessage()); - } - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testEmptyNameIsInvalid() - { - new InputOption(''); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testDoubleDashNameIsInvalid() - { - new InputOption('--'); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testSingleDashOptionIsInvalid() - { - new InputOption('foo', '-'); - } - - public function testIsArray() - { - $option = new InputOption('foo', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY); - $this->assertTrue($option->isArray(), '->isArray() returns true if the option can be an array'); - $option = new InputOption('foo', null, InputOption::VALUE_NONE); - $this->assertFalse($option->isArray(), '->isArray() returns false if the option can not be an array'); - } - - public function testGetDescription() - { - $option = new InputOption('foo', 'f', null, 'Some description'); - $this->assertEquals('Some description', $option->getDescription(), '->getDescription() returns the description message'); - } - - public function testGetDefault() - { - $option = new InputOption('foo', null, InputOption::VALUE_OPTIONAL, '', 'default'); - $this->assertEquals('default', $option->getDefault(), '->getDefault() returns the default value'); - - $option = new InputOption('foo', null, InputOption::VALUE_REQUIRED, '', 'default'); - $this->assertEquals('default', $option->getDefault(), '->getDefault() returns the default value'); - - $option = new InputOption('foo', null, InputOption::VALUE_REQUIRED); - $this->assertNull($option->getDefault(), '->getDefault() returns null if no default value is configured'); - - $option = new InputOption('foo', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY); - $this->assertEquals(array(), $option->getDefault(), '->getDefault() returns an empty array if option is an array'); - - $option = new InputOption('foo', null, InputOption::VALUE_NONE); - $this->assertFalse($option->getDefault(), '->getDefault() returns false if the option does not take a value'); - } - - public function testSetDefault() - { - $option = new InputOption('foo', null, InputOption::VALUE_REQUIRED, '', 'default'); - $option->setDefault(null); - $this->assertNull($option->getDefault(), '->setDefault() can reset the default value by passing null'); - $option->setDefault('another'); - $this->assertEquals('another', $option->getDefault(), '->setDefault() changes the default value'); - - $option = new InputOption('foo', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY); - $option->setDefault(array(1, 2)); - $this->assertEquals(array(1, 2), $option->getDefault(), '->setDefault() changes the default value'); - - $option = new InputOption('foo', 'f', InputOption::VALUE_NONE); - try { - $option->setDefault('default'); - $this->fail('->setDefault() throws an Exception if you give a default value for a VALUE_NONE option'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Exception', $e, '->setDefault() throws an Exception if you give a default value for a VALUE_NONE option'); - $this->assertEquals('Cannot set a default value when using Option::VALUE_NONE mode.', $e->getMessage()); - } - - $option = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY); - try { - $option->setDefault('default'); - $this->fail('->setDefault() throws an Exception if you give a default value which is not an array for a VALUE_IS_ARRAY option'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Exception', $e, '->setDefault() throws an Exception if you give a default value which is not an array for a VALUE_IS_ARRAY option'); - $this->assertEquals('A default value for an array option must be an array.', $e->getMessage()); - } - } - - public function testEquals() - { - $option = new InputOption('foo', 'f', null, 'Some description'); - $option2 = new InputOption('foo', 'f', null, 'Alternative description'); - $this->assertTrue($option->equals($option2)); - - $option = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, 'Some description'); - $option2 = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, 'Some description', true); - $this->assertFalse($option->equals($option2)); - - $option = new InputOption('foo', 'f', null, 'Some description'); - $option2 = new InputOption('bar', 'f', null, 'Some description'); - $this->assertFalse($option->equals($option2)); - - $option = new InputOption('foo', 'f', null, 'Some description'); - $option2 = new InputOption('foo', '', null, 'Some description'); - $this->assertFalse($option->equals($option2)); - - $option = new InputOption('foo', 'f', null, 'Some description'); - $option2 = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, 'Some description'); - $this->assertFalse($option->equals($option2)); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/InputTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/InputTest.php deleted file mode 100644 index 779d45d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/InputTest.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Input; - -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; - -class InputTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $input = new ArrayInput(array('name' => 'foo'), new InputDefinition(array(new InputArgument('name')))); - $this->assertEquals('foo', $input->getArgument('name'), '->__construct() takes a InputDefinition as an argument'); - } - - public function testOptions() - { - $input = new ArrayInput(array('--name' => 'foo'), new InputDefinition(array(new InputOption('name')))); - $this->assertEquals('foo', $input->getOption('name'), '->getOption() returns the value for the given option'); - - $input->setOption('name', 'bar'); - $this->assertEquals('bar', $input->getOption('name'), '->setOption() sets the value for a given option'); - $this->assertEquals(array('name' => 'bar'), $input->getOptions(), '->getOptions() returns all option values'); - - $input = new ArrayInput(array('--name' => 'foo'), new InputDefinition(array(new InputOption('name'), new InputOption('bar', '', InputOption::VALUE_OPTIONAL, '', 'default')))); - $this->assertEquals('default', $input->getOption('bar'), '->getOption() returns the default value for optional options'); - $this->assertEquals(array('name' => 'foo', 'bar' => 'default'), $input->getOptions(), '->getOptions() returns all option values, even optional ones'); - - try { - $input->setOption('foo', 'bar'); - $this->fail('->setOption() throws a \InvalidArgumentException if the option does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->setOption() throws a \InvalidArgumentException if the option does not exist'); - $this->assertEquals('The "foo" option does not exist.', $e->getMessage()); - } - - try { - $input->getOption('foo'); - $this->fail('->getOption() throws a \InvalidArgumentException if the option does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->setOption() throws a \InvalidArgumentException if the option does not exist'); - $this->assertEquals('The "foo" option does not exist.', $e->getMessage()); - } - } - - public function testArguments() - { - $input = new ArrayInput(array('name' => 'foo'), new InputDefinition(array(new InputArgument('name')))); - $this->assertEquals('foo', $input->getArgument('name'), '->getArgument() returns the value for the given argument'); - - $input->setArgument('name', 'bar'); - $this->assertEquals('bar', $input->getArgument('name'), '->setArgument() sets the value for a given argument'); - $this->assertEquals(array('name' => 'bar'), $input->getArguments(), '->getArguments() returns all argument values'); - - $input = new ArrayInput(array('name' => 'foo'), new InputDefinition(array(new InputArgument('name'), new InputArgument('bar', InputArgument::OPTIONAL, '', 'default')))); - $this->assertEquals('default', $input->getArgument('bar'), '->getArgument() returns the default value for optional arguments'); - $this->assertEquals(array('name' => 'foo', 'bar' => 'default'), $input->getArguments(), '->getArguments() returns all argument values, even optional ones'); - - try { - $input->setArgument('foo', 'bar'); - $this->fail('->setArgument() throws a \InvalidArgumentException if the argument does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->setOption() throws a \InvalidArgumentException if the option does not exist'); - $this->assertEquals('The "foo" argument does not exist.', $e->getMessage()); - } - - try { - $input->getArgument('foo'); - $this->fail('->getArgument() throws a \InvalidArgumentException if the argument does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->setOption() throws a \InvalidArgumentException if the option does not exist'); - $this->assertEquals('The "foo" argument does not exist.', $e->getMessage()); - } - } - - public function testValidate() - { - $input = new ArrayInput(array()); - $input->bind(new InputDefinition(array(new InputArgument('name', InputArgument::REQUIRED)))); - - try { - $input->validate(); - $this->fail('->validate() throws a \RuntimeException if not enough arguments are given'); - } catch (\Exception $e) { - $this->assertInstanceOf('\RuntimeException', $e, '->validate() throws a \RuntimeException if not enough arguments are given'); - $this->assertEquals('Not enough arguments.', $e->getMessage()); - } - - $input = new ArrayInput(array('name' => 'foo')); - $input->bind(new InputDefinition(array(new InputArgument('name', InputArgument::REQUIRED)))); - - try { - $input->validate(); - } catch (\RuntimeException $e) { - $this->fail('->validate() does not throw a \RuntimeException if enough arguments are given'); - } - } - - public function testSetFetInteractive() - { - $input = new ArrayInput(array()); - $this->assertTrue($input->isInteractive(), '->isInteractive() returns whether the input should be interactive or not'); - $input->setInteractive(false); - $this->assertFalse($input->isInteractive(), '->setInteractive() changes the interactive flag'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/StringInputTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/StringInputTest.php deleted file mode 100644 index 031797c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Input/StringInputTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Input; - -use Symfony\Component\Console\Input\StringInput; - -class StringInputTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getTokenizeData - */ - public function testTokenize($input, $tokens, $message) - { - $input = new StringInput($input); - $r = new \ReflectionClass('Symfony\Component\Console\Input\ArgvInput'); - $p = $r->getProperty('tokens'); - $p->setAccessible(true); - $this->assertEquals($tokens, $p->getValue($input), $message); - } - - public function getTokenizeData() - { - return array( - array('', array(), '->tokenize() parses an empty string'), - array('foo', array('foo'), '->tokenize() parses arguments'), - array(' foo bar ', array('foo', 'bar'), '->tokenize() ignores whitespaces between arguments'), - array('"quoted"', array('quoted'), '->tokenize() parses quoted arguments'), - array("'quoted'", array('quoted'), '->tokenize() parses quoted arguments'), - array('\"quoted\"', array('"quoted"'), '->tokenize() parses escaped-quoted arguments'), - array("\'quoted\'", array('\'quoted\''), '->tokenize() parses escaped-quoted arguments'), - array('-a', array('-a'), '->tokenize() parses short options'), - array('-azc', array('-azc'), '->tokenize() parses aggregated short options'), - array('-awithavalue', array('-awithavalue'), '->tokenize() parses short options with a value'), - array('-a"foo bar"', array('-afoo bar'), '->tokenize() parses short options with a value'), - array('-a"foo bar""foo bar"', array('-afoo barfoo bar'), '->tokenize() parses short options with a value'), - array('-a\'foo bar\'', array('-afoo bar'), '->tokenize() parses short options with a value'), - array('-a\'foo bar\'\'foo bar\'', array('-afoo barfoo bar'), '->tokenize() parses short options with a value'), - array('-a\'foo bar\'"foo bar"', array('-afoo barfoo bar'), '->tokenize() parses short options with a value'), - array('--long-option', array('--long-option'), '->tokenize() parses long options'), - array('--long-option=foo', array('--long-option=foo'), '->tokenize() parses long options with a value'), - array('--long-option="foo bar"', array('--long-option=foo bar'), '->tokenize() parses long options with a value'), - array('--long-option="foo bar""another"', array('--long-option=foo baranother'), '->tokenize() parses long options with a value'), - array('--long-option=\'foo bar\'', array('--long-option=foo bar'), '->tokenize() parses long options with a value'), - array("--long-option='foo bar''another'", array("--long-option=foo baranother"), '->tokenize() parses long options with a value'), - array("--long-option='foo bar'\"another\"", array("--long-option=foo baranother"), '->tokenize() parses long options with a value'), - array('foo -a -ffoo --long bar', array('foo', '-a', '-ffoo', '--long', 'bar'), '->tokenize() parses when several arguments and options'), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Output/ConsoleOutputTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Output/ConsoleOutputTest.php deleted file mode 100644 index 7a3ede3..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Output/ConsoleOutputTest.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Output; - -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Console\Output\Output; - -class ConsoleOutputTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $output = new ConsoleOutput(Output::VERBOSITY_QUIET, true); - $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '__construct() takes the verbosity as its first argument'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Output/NullOutputTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Output/NullOutputTest.php deleted file mode 100644 index 8dd5f7c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Output/NullOutputTest.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Output; - -use Symfony\Component\Console\Output\NullOutput; - -class NullOutputTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $output = new NullOutput(); - $output->write('foo'); - $this->assertTrue(true, '->write() does nothing'); // FIXME - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Output/OutputTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Output/OutputTest.php deleted file mode 100644 index aa4a204..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Output/OutputTest.php +++ /dev/null @@ -1,101 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Output; - -use Symfony\Component\Console\Output\Output; -use Symfony\Component\Console\Formatter\OutputFormatterStyle; - -class OutputTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $output = new TestOutput(Output::VERBOSITY_QUIET, true); - $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '__construct() takes the verbosity as its first argument'); - $this->assertTrue($output->isDecorated(), '__construct() takes the decorated flag as its second argument'); - } - - public function testSetIsDecorated() - { - $output = new TestOutput(); - $output->setDecorated(true); - $this->assertTrue($output->isDecorated(), 'setDecorated() sets the decorated flag'); - } - - public function testSetGetVerbosity() - { - $output = new TestOutput(); - $output->setVerbosity(Output::VERBOSITY_QUIET); - $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '->setVerbosity() sets the verbosity'); - } - - public function testWrite() - { - $fooStyle = new OutputFormatterStyle('yellow', 'red', array('blink')); - $output = new TestOutput(Output::VERBOSITY_QUIET); - $output->writeln('foo'); - $this->assertEquals('', $output->output, '->writeln() outputs nothing if verbosity is set to VERBOSITY_QUIET'); - - $output = new TestOutput(); - $output->writeln(array('foo', 'bar')); - $this->assertEquals("foo\nbar\n", $output->output, '->writeln() can take an array of messages to output'); - - $output = new TestOutput(); - $output->writeln('foo', Output::OUTPUT_RAW); - $this->assertEquals("foo\n", $output->output, '->writeln() outputs the raw message if OUTPUT_RAW is specified'); - - $output = new TestOutput(); - $output->writeln('foo', Output::OUTPUT_PLAIN); - $this->assertEquals("foo\n", $output->output, '->writeln() strips decoration tags if OUTPUT_PLAIN is specified'); - - $output = new TestOutput(); - $output->setDecorated(false); - $output->writeln('foo'); - $this->assertEquals("foo\n", $output->output, '->writeln() strips decoration tags if decoration is set to false'); - - $output = new TestOutput(); - $output->getFormatter()->setStyle('FOO', $fooStyle); - $output->setDecorated(true); - $output->writeln('foo'); - $this->assertEquals("\033[33;41;5mfoo\033[0m\n", $output->output, '->writeln() decorates the output'); - - try { - $output->writeln('foo', 24); - $this->fail('->writeln() throws an \InvalidArgumentException when the type does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->writeln() throws an \InvalidArgumentException when the type does not exist'); - $this->assertEquals('Unknown output type given (24)', $e->getMessage()); - } - - $output->clear(); - $output->write('foo'); - $this->assertEquals('foo', $output->output, '->write() do nothing when a style does not exist'); - - $output->clear(); - $output->writeln('foo'); - $this->assertEquals("foo\n", $output->output, '->writeln() do nothing when a style does not exist'); - } -} - -class TestOutput extends Output -{ - public $output = ''; - - public function clear() - { - $this->output = ''; - } - - protected function doWrite($message, $newline) - { - $this->output .= $message.($newline ? "\n" : ''); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Output/StreamOutputTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Output/StreamOutputTest.php deleted file mode 100644 index b151a48..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Output/StreamOutputTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Output; - -use Symfony\Component\Console\Output\Output; -use Symfony\Component\Console\Output\StreamOutput; - -class StreamOutputTest extends \PHPUnit_Framework_TestCase -{ - protected $stream; - - protected function setUp() - { - $this->stream = fopen('php://memory', 'a', false); - } - - protected function tearDown() - { - $this->stream = null; - } - - public function testConstructor() - { - try { - $output = new StreamOutput('foo'); - $this->fail('__construct() throws an \InvalidArgumentException if the first argument is not a stream'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '__construct() throws an \InvalidArgumentException if the first argument is not a stream'); - $this->assertEquals('The StreamOutput class needs a stream as its first argument.', $e->getMessage()); - } - - $output = new StreamOutput($this->stream, Output::VERBOSITY_QUIET, true); - $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '__construct() takes the verbosity as its first argument'); - $this->assertTrue($output->isDecorated(), '__construct() takes the decorated flag as its second argument'); - } - - public function testGetStream() - { - $output = new StreamOutput($this->stream); - $this->assertEquals($this->stream, $output->getStream(), '->getStream() returns the current stream'); - } - - public function testDoWrite() - { - $output = new StreamOutput($this->stream); - $output->writeln('foo'); - rewind($output->getStream()); - $this->assertEquals('foo'.PHP_EOL, stream_get_contents($output->getStream()), '->doWrite() writes to the stream'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Tester/ApplicationTesterTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Tester/ApplicationTesterTest.php deleted file mode 100644 index 6ce30ab..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Tester/ApplicationTesterTest.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Tester; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Output\Output; -use Symfony\Component\Console\Tester\ApplicationTester; - -class ApplicationTesterTest extends \PHPUnit_Framework_TestCase -{ - protected $application; - protected $tester; - - protected function setUp() - { - $this->application = new Application(); - $this->application->setAutoExit(false); - $this->application->register('foo') - ->addArgument('foo') - ->setCode(function ($input, $output) { $output->writeln('foo'); }) - ; - - $this->tester = new ApplicationTester($this->application); - $this->tester->run(array('command' => 'foo', 'foo' => 'bar'), array('interactive' => false, 'decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE)); - } - - protected function tearDown() - { - $this->application = null; - $this->tester = null; - } - - public function testRun() - { - $this->assertFalse($this->tester->getInput()->isInteractive(), '->execute() takes an interactive option'); - $this->assertFalse($this->tester->getOutput()->isDecorated(), '->execute() takes a decorated option'); - $this->assertEquals(Output::VERBOSITY_VERBOSE, $this->tester->getOutput()->getVerbosity(), '->execute() takes a verbosity option'); - } - - public function testGetInput() - { - $this->assertEquals('bar', $this->tester->getInput()->getArgument('foo'), '->getInput() returns the current input instance'); - } - - public function testGetOutput() - { - rewind($this->tester->getOutput()->getStream()); - $this->assertEquals('foo'.PHP_EOL, stream_get_contents($this->tester->getOutput()->getStream()), '->getOutput() returns the current output instance'); - } - - public function testGetDisplay() - { - $this->assertEquals('foo'.PHP_EOL, $this->tester->getDisplay(), '->getDisplay() returns the display of the last execution'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Tester/CommandTesterTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Tester/CommandTesterTest.php deleted file mode 100644 index e64d967..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Tester/CommandTesterTest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Tester; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Output\Output; -use Symfony\Component\Console\Tester\CommandTester; - -class CommandTesterTest extends \PHPUnit_Framework_TestCase -{ - protected $application; - protected $tester; - - protected function setUp() - { - $this->command = new Command('foo'); - $this->command->addArgument('command'); - $this->command->addArgument('foo'); - $this->command->setCode(function ($input, $output) { $output->writeln('foo'); }); - - $this->tester = new CommandTester($this->command); - $this->tester->execute(array('foo' => 'bar'), array('interactive' => false, 'decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE)); - } - - protected function tearDown() - { - $this->command = null; - $this->tester = null; - } - - public function testExecute() - { - $this->assertFalse($this->tester->getInput()->isInteractive(), '->execute() takes an interactive option'); - $this->assertFalse($this->tester->getOutput()->isDecorated(), '->execute() takes a decorated option'); - $this->assertEquals(Output::VERBOSITY_VERBOSE, $this->tester->getOutput()->getVerbosity(), '->execute() takes a verbosity option'); - } - - public function testGetInput() - { - $this->assertEquals('bar', $this->tester->getInput()->getArgument('foo'), '->getInput() returns the current input instance'); - } - - public function testGetOutput() - { - rewind($this->tester->getOutput()->getStream()); - $this->assertEquals('foo'.PHP_EOL, stream_get_contents($this->tester->getOutput()->getStream()), '->getOutput() returns the current output instance'); - } - - public function testGetDisplay() - { - $this->assertEquals('foo'.PHP_EOL, $this->tester->getDisplay(), '->getDisplay() returns the display of the last execution'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/bootstrap.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/bootstrap.php deleted file mode 100644 index c486b72..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/bootstrap.php +++ /dev/null @@ -1,18 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -spl_autoload_register(function ($class) { - if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\Console')) { - if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\Console')).'.php')) { - require_once $file; - } - } -}); diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/composer.json b/vendor/symfony/symfony/src/Symfony/Component/Console/composer.json deleted file mode 100644 index 6de78af..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/composer.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "symfony/console", - "type": "library", - "description": "Symfony Console Component", - "keywords": [], - "homepage": "http://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "require": { - "php": ">=5.3.3" - }, - "autoload": { - "psr-0": { "Symfony\\Component\\Console": "" } - }, - "target-dir": "Symfony/Component/Console", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/phpunit.xml.dist b/vendor/symfony/symfony/src/Symfony/Component/Console/phpunit.xml.dist deleted file mode 100644 index fd1c069..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/Console/phpunit.xml.dist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - ./Tests/ - - - - - - ./ - - ./Resources - ./Tests - ./vendor - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/CHANGELOG.md b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/CHANGELOG.md deleted file mode 100644 index be10abe..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/CHANGELOG.md +++ /dev/null @@ -1,7 +0,0 @@ -CHANGELOG -========= - -2.1.0 ------ - - * none diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/CssSelector.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/CssSelector.php deleted file mode 100644 index f624fff..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/CssSelector.php +++ /dev/null @@ -1,322 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector; - -use Symfony\Component\CssSelector\Exception\ParseException; - -/** - * CssSelector is the main entry point of the component and can convert CSS - * selectors to XPath expressions. - * - * $xpath = CssSelector::toXpath('h1.foo'); - * - * This component is a port of the Python lxml library, - * which is copyright Infrae and distributed under the BSD license. - * - * @author Fabien Potencier - * - * @api - */ -class CssSelector -{ - /** - * Translates a CSS expression to its XPath equivalent. - * Optionally, a prefix can be added to the resulting XPath - * expression with the $prefix parameter. - * - * @param mixed $cssExpr The CSS expression. - * @param string $prefix An optional prefix for the XPath expression. - * - * @return string - * - * @throws ParseException When got None for xpath expression - * - * @api - */ - public static function toXPath($cssExpr, $prefix = 'descendant-or-self::') - { - if (is_string($cssExpr)) { - if (!$cssExpr) { - return $prefix.'*'; - } - - if (preg_match('#^\w+\s*$#u', $cssExpr, $match)) { - return $prefix.trim($match[0]); - } - - if (preg_match('~^(\w*)#(\w+)\s*$~u', $cssExpr, $match)) { - return sprintf("%s%s[@id = '%s']", $prefix, $match[1] ? $match[1] : '*', $match[2]); - } - - if (preg_match('#^(\w*)\.(\w+)\s*$#u', $cssExpr, $match)) { - return sprintf("%s%s[contains(concat(' ', normalize-space(@class), ' '), ' %s ')]", $prefix, $match[1] ? $match[1] : '*', $match[2]); - } - - $parser = new self(); - $cssExpr = $parser->parse($cssExpr); - } - - $expr = $cssExpr->toXpath(); - - // @codeCoverageIgnoreStart - if (!$expr) { - throw new ParseException(sprintf('Got None for xpath expression from %s.', $cssExpr)); - } - // @codeCoverageIgnoreEnd - - if ($prefix) { - $expr->addPrefix($prefix); - } - - return (string) $expr; - } - - /** - * Parses an expression and returns the Node object that represents - * the parsed expression. - * - * @param string $string The expression to parse - * - * @return Node\NodeInterface - * - * @throws \Exception When tokenizer throws it while parsing - */ - public function parse($string) - { - $tokenizer = new Tokenizer(); - - $stream = new TokenStream($tokenizer->tokenize($string), $string); - - try { - return $this->parseSelectorGroup($stream); - } catch (\Exception $e) { - $class = get_class($e); - - throw new $class(sprintf('%s at %s -> %s', $e->getMessage(), implode($stream->getUsed(), ''), $stream->peek()), 0, $e); - } - } - - /** - * Parses a selector group contained in $stream and returns - * the Node object that represents the expression. - * - * @param TokenStream $stream The stream to parse. - * - * @return Node\NodeInterface - */ - private function parseSelectorGroup($stream) - { - $result = array(); - while (true) { - $result[] = $this->parseSelector($stream); - if ($stream->peek() == ',') { - $stream->next(); - } else { - break; - } - } - - if (count($result) == 1) { - return $result[0]; - } - - return new Node\OrNode($result); - } - - /** - * Parses a selector contained in $stream and returns the Node - * object that represents it. - * - * @param TokenStream $stream The stream containing the selector. - * - * @return Node\NodeInterface - * - * @throws ParseException When expected selector but got something else - */ - private function parseSelector($stream) - { - $result = $this->parseSimpleSelector($stream); - - while (true) { - $peek = $stream->peek(); - if (',' == $peek || null === $peek) { - return $result; - } elseif (in_array($peek, array('+', '>', '~'))) { - // A combinator - $combinator = (string) $stream->next(); - - // Ignore optional whitespace after a combinator - while (' ' == $stream->peek()) { - $stream->next(); - } - } else { - $combinator = ' '; - } - $consumed = count($stream->getUsed()); - $nextSelector = $this->parseSimpleSelector($stream); - if ($consumed == count($stream->getUsed())) { - throw new ParseException(sprintf("Expected selector, got '%s'", $stream->peek())); - } - - $result = new Node\CombinedSelectorNode($result, $combinator, $nextSelector); - } - - return $result; - } - - /** - * Parses a simple selector (the current token) from $stream and returns - * the resulting Node object. - * - * @param TokenStream $stream The stream containing the selector. - * - * @return Node\NodeInterface - * - * @throws ParseException When expected symbol but got something else - */ - private function parseSimpleSelector($stream) - { - $peek = $stream->peek(); - if ('*' != $peek && !$peek->isType('Symbol')) { - $element = $namespace = '*'; - } else { - $next = $stream->next(); - if ('*' != $next && !$next->isType('Symbol')) { - throw new ParseException(sprintf("Expected symbol, got '%s'", $next)); - } - - if ($stream->peek() == '|') { - $namespace = $next; - $stream->next(); - $element = $stream->next(); - if ('*' != $element && !$next->isType('Symbol')) { - throw new ParseException(sprintf("Expected symbol, got '%s'", $next)); - } - } else { - $namespace = '*'; - $element = $next; - } - } - - $result = new Node\ElementNode($namespace, $element); - $hasHash = false; - while (true) { - $peek = $stream->peek(); - if ('#' == $peek) { - if ($hasHash) { - /* You can't have two hashes - (FIXME: is there some more general rule I'm missing?) */ - // @codeCoverageIgnoreStart - break; - // @codeCoverageIgnoreEnd - } - $stream->next(); - $result = new Node\HashNode($result, $stream->next()); - $hasHash = true; - - continue; - } elseif ('.' == $peek) { - $stream->next(); - $result = new Node\ClassNode($result, $stream->next()); - - continue; - } elseif ('[' == $peek) { - $stream->next(); - $result = $this->parseAttrib($result, $stream); - $next = $stream->next(); - if (']' != $next) { - throw new ParseException(sprintf("] expected, got '%s'", $next)); - } - - continue; - } elseif (':' == $peek || '::' == $peek) { - $type = $stream->next(); - $ident = $stream->next(); - if (!$ident || !$ident->isType('Symbol')) { - throw new ParseException(sprintf("Expected symbol, got '%s'", $ident)); - } - - if ($stream->peek() == '(') { - $stream->next(); - $peek = $stream->peek(); - if ($peek->isType('String')) { - $selector = $stream->next(); - } elseif ($peek->isType('Symbol') && is_int($peek)) { - $selector = intval($stream->next()); - } else { - // FIXME: parseSimpleSelector, or selector, or...? - $selector = $this->parseSimpleSelector($stream); - } - $next = $stream->next(); - if (')' != $next) { - throw new ParseException(sprintf("Expected ')', got '%s' and '%s'", $next, $selector)); - } - - $result = new Node\FunctionNode($result, $type, $ident, $selector); - } else { - $result = new Node\PseudoNode($result, $type, $ident); - } - - continue; - } else { - if (' ' == $peek) { - $stream->next(); - } - - break; - } - // FIXME: not sure what "negation" is - } - - return $result; - } - - /** - * Parses an attribute from a selector contained in $stream and returns - * the resulting AttribNode object. - * - * @param Node\NodeInterface $selector The selector object whose attribute - * is to be parsed. - * @param TokenStream $stream The container token stream. - * - * @return Node\AttribNode - * - * @throws ParseException When encountered unexpected selector - */ - private function parseAttrib($selector, $stream) - { - $attrib = $stream->next(); - if ($stream->peek() == '|') { - $namespace = $attrib; - $stream->next(); - $attrib = $stream->next(); - } else { - $namespace = '*'; - } - - if ($stream->peek() == ']') { - return new Node\AttribNode($selector, $namespace, $attrib, 'exists', null); - } - - $op = $stream->next(); - if (!in_array($op, array('^=', '$=', '*=', '=', '~=', '|=', '!='))) { - throw new ParseException(sprintf("Operator expected, got '%s'", $op)); - } - - $value = $stream->next(); - if (!$value->isType('Symbol') && !$value->isType('String')) { - throw new ParseException(sprintf("Expected string or symbol, got '%s'", $value)); - } - - return new Node\AttribNode($selector, $namespace, $attrib, $op, $value); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Exception/ParseException.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Exception/ParseException.php deleted file mode 100644 index 38206c2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Exception/ParseException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Exception; - -/** - * ParseException is thrown when a CSS selector syntax is not valid. - * - * This component is a port of the Python lxml library, - * which is copyright Infrae and distributed under the BSD license. - * - * @author Fabien Potencier - */ -class ParseException extends \Exception -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/LICENSE b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/LICENSE deleted file mode 100644 index cdffe7a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2012 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/AttribNode.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/AttribNode.php deleted file mode 100644 index b89606e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/AttribNode.php +++ /dev/null @@ -1,131 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Node; - -use Symfony\Component\CssSelector\XPathExpr; -use Symfony\Component\CssSelector\Exception\ParseException; - -/** - * AttribNode represents a "selector[namespace|attrib operator value]" node. - * - * This component is a port of the Python lxml library, - * which is copyright Infrae and distributed under the BSD license. - * - * @author Fabien Potencier - */ -class AttribNode implements NodeInterface -{ - protected $selector; - protected $namespace; - protected $attrib; - protected $operator; - protected $value; - - /** - * Constructor. - * - * @param NodeInterface $selector The XPath selector - * @param string $namespace The namespace - * @param string $attrib The attribute - * @param string $operator The operator - * @param string $value The value - */ - public function __construct($selector, $namespace, $attrib, $operator, $value) - { - $this->selector = $selector; - $this->namespace = $namespace; - $this->attrib = $attrib; - $this->operator = $operator; - $this->value = $value; - } - - /** - * {@inheritDoc} - */ - public function __toString() - { - if ($this->operator == 'exists') { - return sprintf('%s[%s[%s]]', __CLASS__, $this->selector, $this->formatAttrib()); - } - - return sprintf('%s[%s[%s %s %s]]', __CLASS__, $this->selector, $this->formatAttrib(), $this->operator, $this->value); - } - - /** - * {@inheritDoc} - */ - public function toXpath() - { - $path = $this->selector->toXpath(); - $attrib = $this->xpathAttrib(); - $value = $this->value; - if ($this->operator == 'exists') { - $path->addCondition($attrib); - } elseif ($this->operator == '=') { - $path->addCondition(sprintf('%s = %s', $attrib, XPathExpr::xpathLiteral($value))); - } elseif ($this->operator == '!=') { - // FIXME: this seems like a weird hack... - if ($value) { - $path->addCondition(sprintf('not(%s) or %s != %s', $attrib, $attrib, XPathExpr::xpathLiteral($value))); - } else { - $path->addCondition(sprintf('%s != %s', $attrib, XPathExpr::xpathLiteral($value))); - } - // path.addCondition('%s != %s' % (attrib, xpathLiteral(value))) - } elseif ($this->operator == '~=') { - $path->addCondition(sprintf("contains(concat(' ', normalize-space(%s), ' '), %s)", $attrib, XPathExpr::xpathLiteral(' '.$value.' '))); - } elseif ($this->operator == '|=') { - // Weird, but true... - $path->addCondition(sprintf('%s = %s or starts-with(%s, %s)', $attrib, XPathExpr::xpathLiteral($value), $attrib, XPathExpr::xpathLiteral($value.'-'))); - } elseif ($this->operator == '^=') { - $path->addCondition(sprintf('starts-with(%s, %s)', $attrib, XPathExpr::xpathLiteral($value))); - } elseif ($this->operator == '$=') { - // Oddly there is a starts-with in XPath 1.0, but not ends-with - $path->addCondition(sprintf('substring(%s, string-length(%s)-%s) = %s', $attrib, $attrib, strlen($value) - 1, XPathExpr::xpathLiteral($value))); - } elseif ($this->operator == '*=') { - // FIXME: case sensitive? - $path->addCondition(sprintf('contains(%s, %s)', $attrib, XPathExpr::xpathLiteral($value))); - } else { - throw new ParseException(sprintf('Unknown operator: %s', $this->operator)); - } - - return $path; - } - - /** - * Returns the XPath Attribute - * - * @return string The XPath attribute - */ - protected function xpathAttrib() - { - // FIXME: if attrib is *? - if ($this->namespace == '*') { - return '@'.$this->attrib; - } - - return sprintf('@%s:%s', $this->namespace, $this->attrib); - } - - /** - * Returns a formatted attribute - * - * @return string The formatted attribute - */ - protected function formatAttrib() - { - if ($this->namespace == '*') { - return $this->attrib; - } - - return sprintf('%s|%s', $this->namespace, $this->attrib); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/ClassNode.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/ClassNode.php deleted file mode 100644 index 014aa80..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/ClassNode.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Node; - -use Symfony\Component\CssSelector\XPathExpr; - -/** - * ClassNode represents a "selector.className" node. - * - * This component is a port of the Python lxml library, - * which is copyright Infrae and distributed under the BSD license. - * - * @author Fabien Potencier - */ -class ClassNode implements NodeInterface -{ - protected $selector; - protected $className; - - /** - * The constructor. - * - * @param NodeInterface $selector The XPath Selector - * @param string $className The class name - */ - public function __construct($selector, $className) - { - $this->selector = $selector; - $this->className = $className; - } - - /** - * {@inheritDoc} - */ - public function __toString() - { - return sprintf('%s[%s.%s]', __CLASS__, $this->selector, $this->className); - } - - /** - * {@inheritDoc} - */ - public function toXpath() - { - $selXpath = $this->selector->toXpath(); - $selXpath->addCondition(sprintf("contains(concat(' ', normalize-space(@class), ' '), %s)", XPathExpr::xpathLiteral(' '.$this->className.' '))); - - return $selXpath; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php deleted file mode 100644 index 13e3927..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php +++ /dev/null @@ -1,142 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Node; - -use Symfony\Component\CssSelector\Exception\ParseException; - -/** - * CombinedSelectorNode represents a combinator node. - * - * This component is a port of the Python lxml library, - * which is copyright Infrae and distributed under the BSD license. - * - * @author Fabien Potencier - */ -class CombinedSelectorNode implements NodeInterface -{ - protected static $methodMapping = array( - ' ' => 'descendant', - '>' => 'child', - '+' => 'direct_adjacent', - '~' => 'indirect_adjacent', - ); - - protected $selector; - protected $combinator; - protected $subselector; - - /** - * The constructor. - * - * @param NodeInterface $selector The XPath selector - * @param string $combinator The combinator - * @param NodeInterface $subselector The sub XPath selector - */ - public function __construct($selector, $combinator, $subselector) - { - $this->selector = $selector; - $this->combinator = $combinator; - $this->subselector = $subselector; - } - - /** - * {@inheritDoc} - */ - public function __toString() - { - $comb = $this->combinator == ' ' ? '' : $this->combinator; - - return sprintf('%s[%s %s %s]', __CLASS__, $this->selector, $comb, $this->subselector); - } - - /** - * {@inheritDoc} - * @throws ParseException When unknown combinator is found - */ - public function toXpath() - { - if (!isset(self::$methodMapping[$this->combinator])) { - throw new ParseException(sprintf('Unknown combinator: %s', $this->combinator)); - } - - $method = '_xpath_'.self::$methodMapping[$this->combinator]; - $path = $this->selector->toXpath(); - - return $this->$method($path, $this->subselector); - } - - /** - * Joins a NodeInterface into the XPath of this object. - * - * @param XPathExpr $xpath The XPath expression for this object - * @param NodeInterface $sub The NodeInterface object to add - * - * @return XPathExpr An XPath instance - */ - protected function _xpath_descendant($xpath, $sub) - { - // when sub is a descendant in any way of xpath - $xpath->join('/descendant::', $sub->toXpath()); - - return $xpath; - } - - /** - * Joins a NodeInterface as a child of this object. - * - * @param XPathExpr $xpath The parent XPath expression - * @param NodeInterface $sub The NodeInterface object to add - * - * @return XPathExpr An XPath instance - */ - protected function _xpath_child($xpath, $sub) - { - // when sub is an immediate child of xpath - $xpath->join('/', $sub->toXpath()); - - return $xpath; - } - - /** - * Joins an XPath expression as an adjacent of another. - * - * @param XPathExpr $xpath The parent XPath expression - * @param NodeInterface $sub The adjacent XPath expression - * - * @return XPathExpr An XPath instance - */ - protected function _xpath_direct_adjacent($xpath, $sub) - { - // when sub immediately follows xpath - $xpath->join('/following-sibling::', $sub->toXpath()); - $xpath->addNameTest(); - $xpath->addCondition('position() = 1'); - - return $xpath; - } - - /** - * Joins an XPath expression as an indirect adjacent of another. - * - * @param XPathExpr $xpath The parent XPath expression - * @param NodeInterface $sub The indirect adjacent NodeInterface object - * - * @return XPathExpr An XPath instance - */ - protected function _xpath_indirect_adjacent($xpath, $sub) - { - // when sub comes somewhere after xpath as a sibling - $xpath->join('/following-sibling::', $sub->toXpath()); - - return $xpath; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/ElementNode.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/ElementNode.php deleted file mode 100644 index 5cc7d4b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/ElementNode.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Node; - -use Symfony\Component\CssSelector\XPathExpr; - -/** - * ElementNode represents a "namespace|element" node. - * - * This component is a port of the Python lxml library, - * which is copyright Infrae and distributed under the BSD license. - * - * @author Fabien Potencier - */ -class ElementNode implements NodeInterface -{ - protected $namespace; - protected $element; - - /** - * Constructor. - * - * @param string $namespace Namespace - * @param string $element Element - */ - public function __construct($namespace, $element) - { - $this->namespace = $namespace; - $this->element = $element; - } - - /** - * {@inheritDoc} - */ - public function __toString() - { - return sprintf('%s[%s]', __CLASS__, $this->formatElement()); - } - - /** - * Formats the element into a string. - * - * @return string Element as an XPath string - */ - public function formatElement() - { - if ($this->namespace == '*') { - return $this->element; - } - - return sprintf('%s|%s', $this->namespace, $this->element); - } - - /** - * {@inheritDoc} - */ - public function toXpath() - { - if ($this->namespace == '*') { - $el = strtolower($this->element); - } else { - // FIXME: Should we lowercase here? - $el = sprintf('%s:%s', $this->namespace, $this->element); - } - - return new XPathExpr(null, null, $el); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/FunctionNode.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/FunctionNode.php deleted file mode 100644 index b392b27..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/FunctionNode.php +++ /dev/null @@ -1,290 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Node; - -use Symfony\Component\CssSelector\Exception\ParseException; -use Symfony\Component\CssSelector\XPathExpr; - -/** - * FunctionNode represents a "selector:name(expr)" node. - * - * This component is a port of the Python lxml library, - * which is copyright Infrae and distributed under the BSD license. - * - * @author Fabien Potencier - */ -class FunctionNode implements NodeInterface -{ - protected static $unsupported = array('target', 'lang', 'enabled', 'disabled'); - - protected $selector; - protected $type; - protected $name; - protected $expr; - - /** - * Constructor. - * - * @param NodeInterface $selector The XPath expression - * @param string $type - * @param string $name - * @param XPathExpr $expr - */ - public function __construct($selector, $type, $name, $expr) - { - $this->selector = $selector; - $this->type = $type; - $this->name = $name; - $this->expr = $expr; - } - - /** - * {@inheritDoc} - */ - public function __toString() - { - return sprintf('%s[%s%s%s(%s)]', __CLASS__, $this->selector, $this->type, $this->name, $this->expr); - } - - /** - * {@inheritDoc} - * @throws ParseException When unsupported or unknown pseudo-class is found - */ - public function toXpath() - { - $selPath = $this->selector->toXpath(); - if (in_array($this->name, self::$unsupported)) { - throw new ParseException(sprintf('The pseudo-class %s is not supported', $this->name)); - } - $method = '_xpath_'.str_replace('-', '_', $this->name); - if (!method_exists($this, $method)) { - throw new ParseException(sprintf('The pseudo-class %s is unknown', $this->name)); - } - - return $this->$method($selPath, $this->expr); - } - - /** - * undocumented function - * - * @param XPathExpr $xpath - * @param mixed $expr - * @param Boolean $last - * @param Boolean $addNameTest - * - * @return XPathExpr - */ - protected function _xpath_nth_child($xpath, $expr, $last = false, $addNameTest = true) - { - list($a, $b) = $this->parseSeries($expr); - if (!$a && !$b && !$last) { - // a=0 means nothing is returned... - $xpath->addCondition('false() and position() = 0'); - - return $xpath; - } - - if ($addNameTest) { - $xpath->addNameTest(); - } - - $xpath->addStarPrefix(); - if ($a == 0) { - if ($last) { - $b = sprintf('last() - %s', $b); - } - $xpath->addCondition(sprintf('position() = %s', $b)); - - return $xpath; - } - - if ($last) { - // FIXME: I'm not sure if this is right - $a = -$a; - $b = -$b; - } - - if ($b > 0) { - $bNeg = -$b; - } else { - $bNeg = sprintf('+%s', -$b); - } - - if ($a != 1) { - $expr = array(sprintf('(position() %s) mod %s = 0', $bNeg, $a)); - } else { - $expr = array(); - } - - if ($b >= 0) { - $expr[] = sprintf('position() >= %s', $b); - } elseif ($b < 0 && $last) { - $expr[] = sprintf('position() < (last() %s)', $b); - } - $expr = implode($expr, ' and '); - - if ($expr) { - $xpath->addCondition($expr); - } - - return $xpath; - /* FIXME: handle an+b, odd, even - an+b means every-a, plus b, e.g., 2n+1 means odd - 0n+b means b - n+0 means a=1, i.e., all elements - an means every a elements, i.e., 2n means even - -n means -1n - -1n+6 means elements 6 and previous */ - } - - /** - * undocumented function - * - * @param XPathExpr $xpath - * @param XPathExpr $expr - * - * @return XPathExpr - */ - protected function _xpath_nth_last_child($xpath, $expr) - { - return $this->_xpath_nth_child($xpath, $expr, true); - } - - /** - * undocumented function - * - * @param XPathExpr $xpath - * @param XPathExpr $expr - * - * @return XPathExpr - */ - protected function _xpath_nth_of_type($xpath, $expr) - { - if ($xpath->getElement() == '*') { - throw new ParseException('*:nth-of-type() is not implemented'); - } - - return $this->_xpath_nth_child($xpath, $expr, false, false); - } - - /** - * undocumented function - * - * @param XPathExpr $xpath - * @param XPathExpr $expr - * - * @return XPathExpr - */ - protected function _xpath_nth_last_of_type($xpath, $expr) - { - return $this->_xpath_nth_child($xpath, $expr, true, false); - } - - /** - * undocumented function - * - * @param XPathExpr $xpath - * @param XPathExpr $expr - * - * @return XPathExpr - */ - protected function _xpath_contains($xpath, $expr) - { - // text content, minus tags, must contain expr - if ($expr instanceof ElementNode) { - $expr = $expr->formatElement(); - } - - // FIXME: lower-case is only available with XPath 2 - //$xpath->addCondition(sprintf('contains(lower-case(string(.)), %s)', XPathExpr::xpathLiteral(strtolower($expr)))); - $xpath->addCondition(sprintf('contains(string(.), %s)', XPathExpr::xpathLiteral($expr))); - - // FIXME: Currently case insensitive matching doesn't seem to be happening - - return $xpath; - } - - /** - * undocumented function - * - * @param XPathExpr $xpath - * @param XPathExpr $expr - * - * @return XPathExpr - */ - protected function _xpath_not($xpath, $expr) - { - // everything for which not expr applies - $expr = $expr->toXpath(); - $cond = $expr->getCondition(); - // FIXME: should I do something about element_path? - $xpath->addCondition(sprintf('not(%s)', $cond)); - - return $xpath; - } - - /** - * Parses things like '1n+2', or 'an+b' generally, returning (a, b) - * - * @param mixed $s - * - * @return array - */ - protected function parseSeries($s) - { - if ($s instanceof ElementNode) { - $s = $s->formatElement(); - } - - if (!$s || '*' == $s) { - // Happens when there's nothing, which the CSS parser thinks of as * - return array(0, 0); - } - - if ('odd' == $s) { - return array(2, 1); - } - - if ('even' == $s) { - return array(2, 0); - } - - if ('n' == $s) { - return array(1, 0); - } - - if (false === strpos($s, 'n')) { - // Just a b - - return array(0, intval((string) $s)); - } - - list($a, $b) = explode('n', $s); - if (!$a) { - $a = 1; - } elseif ('-' == $a || '+' == $a) { - $a = intval($a.'1'); - } else { - $a = intval($a); - } - - if (!$b) { - $b = 0; - } elseif ('-' == $b || '+' == $b) { - $b = intval($b.'1'); - } else { - $b = intval($b); - } - - return array($a, $b); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/HashNode.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/HashNode.php deleted file mode 100644 index 87a6590..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/HashNode.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Node; - -use Symfony\Component\CssSelector\XPathExpr; - -/** - * HashNode represents a "selector#id" node. - * - * This component is a port of the Python lxml library, - * which is copyright Infrae and distributed under the BSD license. - * - * @author Fabien Potencier - */ -class HashNode implements NodeInterface -{ - protected $selector; - protected $id; - - /** - * Constructor. - * - * @param NodeInterface $selector The NodeInterface object - * @param string $id The ID - */ - public function __construct($selector, $id) - { - $this->selector = $selector; - $this->id = $id; - } - - /** - * {@inheritDoc} - */ - public function __toString() - { - return sprintf('%s[%s#%s]', __CLASS__, $this->selector, $this->id); - } - - /** - * {@inheritDoc} - */ - public function toXpath() - { - $path = $this->selector->toXpath(); - $path->addCondition(sprintf('@id = %s', XPathExpr::xpathLiteral($this->id))); - - return $path; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/NodeInterface.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/NodeInterface.php deleted file mode 100644 index 113b1b7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/NodeInterface.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Node; - -/** - * ClassNode represents a "selector.className" node. - * - * This component is a port of the Python lxml library, - * which is copyright Infrae and distributed under the BSD license. - * - * @author Fabien Potencier - */ -interface NodeInterface -{ - /** - * Returns a string representation of the object. - * - * @return string The string representation - */ - public function __toString(); - - /** - * @return XPathExpr The XPath expression - * - * @throws ParseException When unknown operator is found - */ - public function toXpath(); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/OrNode.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/OrNode.php deleted file mode 100644 index dc047a3..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/OrNode.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Node; - -use Symfony\Component\CssSelector\XPathExprOr; - -/** - * OrNode represents a "Or" node. - * - * This component is a port of the Python lxml library, - * which is copyright Infrae and distributed under the BSD license. - * - * @author Fabien Potencier - */ -class OrNode implements NodeInterface -{ - protected $items; - - /** - * Constructor. - * - * @param array $items An array of NodeInterface objects - */ - public function __construct($items) - { - $this->items = $items; - } - - /** - * {@inheritDoc} - */ - public function __toString() - { - return sprintf('%s(%s)', __CLASS__, $this->items); - } - - /** - * {@inheritDoc} - */ - public function toXpath() - { - $paths = array(); - foreach ($this->items as $item) { - $paths[] = $item->toXpath(); - } - - return new XPathExprOr($paths); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/PseudoNode.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/PseudoNode.php deleted file mode 100644 index 67f0beb..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/PseudoNode.php +++ /dev/null @@ -1,228 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Node; - -use Symfony\Component\CssSelector\Exception\ParseException; - -/** - * PseudoNode represents a "selector:ident" node. - * - * This component is a port of the Python lxml library, - * which is copyright Infrae and distributed under the BSD license. - * - * @author Fabien Potencier - */ -class PseudoNode implements NodeInterface -{ - protected static $unsupported = array( - 'indeterminate', 'first-line', 'first-letter', - 'selection', 'before', 'after', 'link', 'visited', - 'active', 'focus', 'hover', - ); - - protected $element; - protected $type; - protected $ident; - - /** - * Constructor. - * - * @param NodeInterface $element The NodeInterface element - * @param string $type Node type - * @param string $ident The ident - * - * @throws ParseException When incorrect PseudoNode type is given - */ - public function __construct($element, $type, $ident) - { - $this->element = $element; - - if (!in_array($type, array(':', '::'))) { - throw new ParseException(sprintf('The PseudoNode type can only be : or :: (%s given).', $type)); - } - - $this->type = $type; - $this->ident = $ident; - } - - /** - * {@inheritDoc} - */ - public function __toString() - { - return sprintf('%s[%s%s%s]', __CLASS__, $this->element, $this->type, $this->ident); - } - - /** - * {@inheritDoc} - * @throws ParseException When unsupported or unknown pseudo-class is found - */ - public function toXpath() - { - $elXpath = $this->element->toXpath(); - - if (in_array($this->ident, self::$unsupported)) { - throw new ParseException(sprintf('The pseudo-class %s is unsupported', $this->ident)); - } - $method = 'xpath_'.str_replace('-', '_', $this->ident); - if (!method_exists($this, $method)) { - throw new ParseException(sprintf('The pseudo-class %s is unknown', $this->ident)); - } - - return $this->$method($elXpath); - } - - /** - * @param XPathExpr $xpath The XPath expression - * - * @return XPathExpr The modified XPath expression - */ - protected function xpath_checked($xpath) - { - // FIXME: is this really all the elements? - $xpath->addCondition("(@selected or @checked) and (name(.) = 'input' or name(.) = 'option')"); - - return $xpath; - } - - /** - * @param XPathExpr $xpath The XPath expression - * - * @return XPathExpr The modified XPath expression - * - * @throws ParseException If this element is the root element - */ - protected function xpath_root($xpath) - { - // if this element is the root element - throw new ParseException(); - } - - /** - * Marks this XPath expression as the first child. - * - * @param XPathExpr $xpath The XPath expression - * - * @return XPathExpr The modified expression - */ - protected function xpath_first_child($xpath) - { - $xpath->addStarPrefix(); - $xpath->addNameTest(); - $xpath->addCondition('position() = 1'); - - return $xpath; - } - - /** - * Sets the XPath to be the last child. - * - * @param XPathExpr $xpath The XPath expression - * - * @return XPathExpr The modified expression - */ - protected function xpath_last_child($xpath) - { - $xpath->addStarPrefix(); - $xpath->addNameTest(); - $xpath->addCondition('position() = last()'); - - return $xpath; - } - - /** - * Sets the XPath expression to be the first of type. - * - * @param XPathExpr $xpath The XPath expression - * - * @return XPathExpr The modified expression - */ - protected function xpath_first_of_type($xpath) - { - if ($xpath->getElement() == '*') { - throw new ParseException('*:first-of-type is not implemented'); - } - $xpath->addStarPrefix(); - $xpath->addCondition('position() = 1'); - - return $xpath; - } - - /** - * Sets the XPath expression to be the last of type. - * - * @param XPathExpr $xpath The XPath expression - * - * @return XPathExpr The modified expression - * - * @throws ParseException Because *:last-of-type is not implemented - */ - protected function xpath_last_of_type($xpath) - { - if ($xpath->getElement() == '*') { - throw new ParseException('*:last-of-type is not implemented'); - } - $xpath->addStarPrefix(); - $xpath->addCondition('position() = last()'); - - return $xpath; - } - - /** - * Sets the XPath expression to be the only child. - * - * @param XPathExpr $xpath The XPath expression - * - * @return XPathExpr The modified expression - */ - protected function xpath_only_child($xpath) - { - $xpath->addNameTest(); - $xpath->addStarPrefix(); - $xpath->addCondition('last() = 1'); - - return $xpath; - } - - /** - * Sets the XPath expression to be only of type. - * - * @param XPathExpr $xpath The XPath expression - * - * @return XPathExpr The modified expression - * - * @throws ParseException Because *:only-of-type is not implemented - */ - protected function xpath_only_of_type($xpath) - { - if ($xpath->getElement() == '*') { - throw new ParseException('*:only-of-type is not implemented'); - } - $xpath->addCondition('last() = 1'); - - return $xpath; - } - - /** - * undocumented function - * - * @param XPathExpr $xpath The XPath expression - * - * @return XPathExpr The modified expression - */ - protected function xpath_empty($xpath) - { - $xpath->addCondition('not(*) and not(normalize-space())'); - - return $xpath; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/README.md b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/README.md deleted file mode 100644 index dd92f7a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/README.md +++ /dev/null @@ -1,23 +0,0 @@ -CssSelector Component -===================== - -CssSelector converts CSS selectors to XPath expressions. - -The component only goal is to convert CSS selectors to their XPath -equivalents: - - use Symfony\Component\CssSelector\CssSelector; - - print CssSelector::toXPath('div.item > h4 > a'); - -Resources ---------- - -This component is a port of the Python lxml library, which is copyright Infrae -and distributed under the BSD license. - -Current code is a port of https://github.com/SimonSapin/cssselect@fd2e70 - -You can run the unit tests with the following command: - - phpunit diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/CssSelectorTest.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/CssSelectorTest.php deleted file mode 100644 index 0d9ca85..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/CssSelectorTest.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests; - -use Symfony\Component\CssSelector\CssSelector; - -class CssSelectorTest extends \PHPUnit_Framework_TestCase -{ - public function testCsstoXPath() - { - $this->assertEquals('descendant-or-self::*', CssSelector::toXPath('')); - $this->assertEquals('descendant-or-self::h1', CssSelector::toXPath('h1')); - $this->assertEquals("descendant-or-self::h1[@id = 'foo']", CssSelector::toXPath('h1#foo')); - $this->assertEquals("descendant-or-self::h1[contains(concat(' ', normalize-space(@class), ' '), ' foo ')]", CssSelector::toXPath('h1.foo')); - - $this->assertEquals('descendant-or-self::foo:h1', CssSelector::toXPath('foo|h1')); - } - - /** - * @dataProvider getCssSelectors - */ - public function testParse($css, $xpath) - { - $parser = new CssSelector(); - - $this->assertEquals($xpath, (string) $parser->parse($css)->toXPath(), '->parse() parses an input string and returns a node'); - } - - public function testParseExceptions() - { - $parser = new CssSelector(); - - try { - $parser->parse('h1:'); - $this->fail('->parse() throws an Exception if the css selector is not valid'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Symfony\Component\CssSelector\Exception\ParseException', $e, '->parse() throws an Exception if the css selector is not valid'); - $this->assertEquals("Expected symbol, got '' at h1: -> ", $e->getMessage(), '->parse() throws an Exception if the css selector is not valid'); - } - } - - public function getCssSelectors() - { - return array( - array('h1', "h1"), - array('foo|h1', "foo:h1"), - array('h1, h2, h3', "h1 | h2 | h3"), - array('h1:nth-child(3n+1)', "*/*[name() = 'h1' and ((position() -1) mod 3 = 0 and position() >= 1)]"), - array('h1 > p', "h1/p"), - array('h1#foo', "h1[@id = 'foo']"), - array('h1.foo', "h1[contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), - array('h1[class*="foo bar"]', "h1[contains(@class, 'foo bar')]"), - array('h1[foo|class*="foo bar"]', "h1[contains(@foo:class, 'foo bar')]"), - array('h1[class]', "h1[@class]"), - array('h1 .foo', "h1/descendant::*[contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), - array('h1 #foo', "h1/descendant::*[@id = 'foo']"), - array('h1 [class*=foo]', "h1/descendant::*[contains(@class, 'foo')]"), - array('div>.foo', "div/*[contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), - array('div > .foo', "div/*[contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/AttribNodeTest.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/AttribNodeTest.php deleted file mode 100644 index 2f19fe2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/AttribNodeTest.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Node; - -use Symfony\Component\CssSelector\Node\AttribNode; -use Symfony\Component\CssSelector\Node\ElementNode; - -class AttribNodeTest extends \PHPUnit_Framework_TestCase -{ - public function testToXpath() - { - $element = new ElementNode('*', 'h1'); - - $operators = array( - '^=' => "h1[starts-with(@class, 'foo')]", - '$=' => "h1[substring(@class, string-length(@class)-2) = 'foo']", - '*=' => "h1[contains(@class, 'foo')]", - '=' => "h1[@class = 'foo']", - '~=' => "h1[contains(concat(' ', normalize-space(@class), ' '), ' foo ')]", - '|=' => "h1[@class = 'foo' or starts-with(@class, 'foo-')]", - '!=' => "h1[not(@class) or @class != 'foo']", - ); - - // h1[class??foo] - foreach ($operators as $op => $xpath) { - $attrib = new AttribNode($element, '*', 'class', $op, 'foo'); - $this->assertEquals($xpath, (string) $attrib->toXpath(), '->toXpath() returns the xpath representation of the node'); - } - - // h1[class] - $attrib = new AttribNode($element, '*', 'class', 'exists', 'foo'); - $this->assertEquals('h1[@class]', (string) $attrib->toXpath(), '->toXpath() returns the xpath representation of the node'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php deleted file mode 100644 index c0a96f1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Node; - -use Symfony\Component\CssSelector\Node\ClassNode; -use Symfony\Component\CssSelector\Node\ElementNode; - -class ClassNodeTest extends \PHPUnit_Framework_TestCase -{ - public function testToXpath() - { - // h1.foo - $element = new ElementNode('*', 'h1'); - $class = new ClassNode($element, 'foo'); - - $this->assertEquals("h1[contains(concat(' ', normalize-space(@class), ' '), ' foo ')]", (string) $class->toXpath(), '->toXpath() returns the xpath representation of the node'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php deleted file mode 100644 index 28f4e28..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Node; - -use Symfony\Component\CssSelector\Node\CombinedSelectorNode; -use Symfony\Component\CssSelector\Node\ElementNode; - -class CombinedSelectorNodeTest extends \PHPUnit_Framework_TestCase -{ - public function testToXpath() - { - $combinators = array( - ' ' => "h1/descendant::p", - '>' => "h1/p", - '+' => "h1/following-sibling::*[name() = 'p' and (position() = 1)]", - '~' => "h1/following-sibling::p", - ); - - // h1 ?? p - $element1 = new ElementNode('*', 'h1'); - $element2 = new ElementNode('*', 'p'); - foreach ($combinators as $combinator => $xpath) { - $combinator = new CombinedSelectorNode($element1, $combinator, $element2); - $this->assertEquals($xpath, (string) $combinator->toXpath(), '->toXpath() returns the xpath representation of the node'); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php deleted file mode 100644 index 5d23e3f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Node; - -use Symfony\Component\CssSelector\Node\ElementNode; - -class ElementNodeTest extends \PHPUnit_Framework_TestCase -{ - public function testToXpath() - { - // h1 - $element = new ElementNode('*', 'h1'); - - $this->assertEquals('h1', (string) $element->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // foo|h1 - $element = new ElementNode('foo', 'h1'); - - $this->assertEquals('foo:h1', (string) $element->toXpath(), '->toXpath() returns the xpath representation of the node'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php deleted file mode 100644 index 9654402..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Node; - -use Symfony\Component\CssSelector\Node\FunctionNode; -use Symfony\Component\CssSelector\Node\ElementNode; -use Symfony\Component\CssSelector\Token; - -class FunctionNodeTest extends \PHPUnit_Framework_TestCase -{ - public function testToXpath() - { - $element = new ElementNode('*', 'h1'); - - // h1:contains("foo") - $function = new FunctionNode($element, ':', 'contains', 'foo'); - $this->assertEquals("h1[contains(string(.), 'foo')]", (string) $function->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // h1:nth-child(1) - $function = new FunctionNode($element, ':', 'nth-child', 1); - $this->assertEquals("*/*[name() = 'h1' and (position() = 1)]", (string) $function->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // h1:nth-child() - $function = new FunctionNode($element, ':', 'nth-child', ''); - $this->assertEquals("h1[false() and position() = 0]", (string) $function->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // h1:nth-child(odd) - $element2 = new ElementNode('*', new Token('Symbol', 'odd', -1)); - $function = new FunctionNode($element, ':', 'nth-child', $element2); - $this->assertEquals("*/*[name() = 'h1' and ((position() -1) mod 2 = 0 and position() >= 1)]", (string) $function->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // h1:nth-child(even) - $element2 = new ElementNode('*', new Token('Symbol', 'even', -1)); - $function = new FunctionNode($element, ':', 'nth-child', $element2); - $this->assertEquals("*/*[name() = 'h1' and ((position() +0) mod 2 = 0 and position() >= 0)]", (string) $function->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // h1:nth-child(n) - $element2 = new ElementNode('*', new Token('Symbol', 'n', -1)); - $function = new FunctionNode($element, ':', 'nth-child', $element2); - $this->assertEquals("*/*[name() = 'h1' and (position() >= 0)]", (string) $function->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // h1:nth-child(3n+1) - $element2 = new ElementNode('*', new Token('Symbol', '3n+1', -1)); - $function = new FunctionNode($element, ':', 'nth-child', $element2); - $this->assertEquals("*/*[name() = 'h1' and ((position() -1) mod 3 = 0 and position() >= 1)]", (string) $function->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // h1:nth-child(n+1) - $element2 = new ElementNode('*', new Token('Symbol', 'n+1', -1)); - $function = new FunctionNode($element, ':', 'nth-child', $element2); - $this->assertEquals("*/*[name() = 'h1' and (position() >= 1)]", (string) $function->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // h1:nth-child(1) - $element2 = new ElementNode('*', new Token('Symbol', '2', -1)); - $function = new FunctionNode($element, ':', 'nth-child', $element2); - $this->assertEquals("*/*[name() = 'h1' and (position() = 2)]", (string) $function->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // h1:nth-child(2n) - $element2 = new ElementNode('*', new Token('Symbol', '2n', -1)); - $function = new FunctionNode($element, ':', 'nth-child', $element2); - $this->assertEquals("*/*[name() = 'h1' and ((position() +0) mod 2 = 0 and position() >= 0)]", (string) $function->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // h1:nth-child(-n) - $element2 = new ElementNode('*', new Token('Symbol', '-n', -1)); - $function = new FunctionNode($element, ':', 'nth-child', $element2); - $this->assertEquals("*/*[name() = 'h1' and ((position() +0) mod -1 = 0 and position() >= 0)]", (string) $function->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // h1:nth-last-child(2) - $function = new FunctionNode($element, ':', 'nth-last-child', 2); - $this->assertEquals("*/*[name() = 'h1' and (position() = last() - 2)]", (string) $function->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // h1:nth-of-type(2) - $function = new FunctionNode($element, ':', 'nth-of-type', 2); - $this->assertEquals("*/h1[position() = 2]", (string) $function->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // h1:nth-last-of-type(2) - $function = new FunctionNode($element, ':', 'nth-last-of-type', 2); - $this->assertEquals("*/h1[position() = last() - 2]", (string) $function->toXpath(), '->toXpath() returns the xpath representation of the node'); - - /* - // h1:not(p) - $element2 = new ElementNode('*', 'p'); - $function = new FunctionNode($element, ':', 'not', $element2); - - $this->assertEquals("h1[not()]", (string) $function->toXpath(), '->toXpath() returns the xpath representation of the node'); - */ - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php deleted file mode 100644 index d919747..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Node; - -use Symfony\Component\CssSelector\Node\HashNode; -use Symfony\Component\CssSelector\Node\ElementNode; - -class HashNodeTest extends \PHPUnit_Framework_TestCase -{ - public function testToXpath() - { - // h1#foo - $element = new ElementNode('*', 'h1'); - $hash = new HashNode($element, 'foo'); - - $this->assertEquals("h1[@id = 'foo']", (string) $hash->toXpath(), '->toXpath() returns the xpath representation of the node'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/OrNodeTest.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/OrNodeTest.php deleted file mode 100644 index 9b9e6e3..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/OrNodeTest.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Node; - -use Symfony\Component\CssSelector\Node\OrNode; -use Symfony\Component\CssSelector\Node\ElementNode; - -class OrNodeTest extends \PHPUnit_Framework_TestCase -{ - public function testToXpath() - { - // h1, h2, h3 - $element1 = new ElementNode('*', 'h1'); - $element2 = new ElementNode('*', 'h2'); - $element3 = new ElementNode('*', 'h3'); - $or = new OrNode(array($element1, $element2, $element3)); - - $this->assertEquals("h1 | h2 | h3", (string) $or->toXpath(), '->toXpath() returns the xpath representation of the node'); - } - - public function testIssueMissingPrefix() - { - // h1, h2, h3 - $element1 = new ElementNode('*', 'h1'); - $element2 = new ElementNode('*', 'h2'); - $element3 = new ElementNode('*', 'h3'); - $or = new OrNode(array($element1, $element2, $element3)); - - $xPath = $or->toXPath(); - $xPath->addPrefix('descendant-or-self::'); - - $this->assertEquals("descendant-or-self::h1 | descendant-or-self::h2 | descendant-or-self::h3", (string) $xPath); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php deleted file mode 100644 index 8bd0cec..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Node; - -use Symfony\Component\CssSelector\Node\PseudoNode; -use Symfony\Component\CssSelector\Node\ElementNode; - -class PseudoNodeTest extends \PHPUnit_Framework_TestCase -{ - public function testToXpath() - { - $element = new ElementNode('*', 'h1'); - - // h1:checked - $pseudo = new PseudoNode($element, ':', 'checked'); - $this->assertEquals("h1[(@selected or @checked) and (name(.) = 'input' or name(.) = 'option')]", (string) $pseudo->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // h1:first-child - $pseudo = new PseudoNode($element, ':', 'first-child'); - $this->assertEquals("*/*[name() = 'h1' and (position() = 1)]", (string) $pseudo->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // h1:last-child - $pseudo = new PseudoNode($element, ':', 'last-child'); - $this->assertEquals("*/*[name() = 'h1' and (position() = last())]", (string) $pseudo->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // h1:first-of-type - $pseudo = new PseudoNode($element, ':', 'first-of-type'); - $this->assertEquals("*/h1[position() = 1]", (string) $pseudo->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // h1:last-of-type - $pseudo = new PseudoNode($element, ':', 'last-of-type'); - $this->assertEquals("*/h1[position() = last()]", (string) $pseudo->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // h1:only-child - $pseudo = new PseudoNode($element, ':', 'only-child'); - $this->assertEquals("*/*[name() = 'h1' and (last() = 1)]", (string) $pseudo->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // h1:only-of-type - $pseudo = new PseudoNode($element, ':', 'only-of-type'); - $this->assertEquals("h1[last() = 1]", (string) $pseudo->toXpath(), '->toXpath() returns the xpath representation of the node'); - - // h1:empty - $pseudo = new PseudoNode($element, ':', 'empty'); - $this->assertEquals("h1[not(*) and not(normalize-space())]", (string) $pseudo->toXpath(), '->toXpath() returns the xpath representation of the node'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/TokenizerTest.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/TokenizerTest.php deleted file mode 100644 index 6c559b4..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/TokenizerTest.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests; - -use Symfony\Component\CssSelector\Tokenizer; - -class TokenizerTest extends \PHPUnit_Framework_TestCase -{ - protected $tokenizer; - - protected function setUp() - { - $this->tokenizer = new Tokenizer(); - } - - /** - * @dataProvider getCssSelectors - */ - public function testTokenize($css) - { - $this->assertEquals($css, $this->tokensToString($this->tokenizer->tokenize($css)), '->tokenize() lexes an input string and returns an array of tokens'); - } - - public function testTokenizeWithQuotedStrings() - { - $this->assertEquals('foo[class=foo bar ]', $this->tokensToString($this->tokenizer->tokenize('foo[class="foo bar"]')), '->tokenize() lexes an input string and returns an array of tokens'); - $this->assertEquals("foo[class=foo Abar ]", $this->tokensToString($this->tokenizer->tokenize('foo[class="foo \\65 bar"]')), '->tokenize() lexes an input string and returns an array of tokens'); - } - - /** - * @expectedException Symfony\Component\CssSelector\Exception\ParseException - */ - public function testTokenizeInvalidString() - { - $this->tokensToString($this->tokenizer->tokenize('/invalid')); - } - - public function getCssSelectors() - { - return array( - array('h1'), - array('h1:nth-child(3n+1)'), - array('h1 > p'), - array('h1#foo'), - array('h1.foo'), - array('h1[class*=foo]'), - array('h1 .foo'), - array('h1 #foo'), - array('h1 [class*=foo]'), - ); - } - - protected function tokensToString($tokens) - { - $str = ''; - foreach ($tokens as $token) { - $str .= str_repeat(' ', $token->getPosition() - strlen($str)).$token; - } - - return $str; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/XPathExprTest.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/XPathExprTest.php deleted file mode 100644 index df6e5a0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/XPathExprTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests; - -use Symfony\Component\CssSelector\XPathExpr; - -class XPathExprTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getXPathLiteralValues - */ - public function testXpathLiteral($value, $literal) - { - $this->assertEquals($literal, XPathExpr::xpathLiteral($value)); - } - - public function getXPathLiteralValues() - { - return array( - array('foo', "'foo'"), - array("foo's bar", '"foo\'s bar"'), - array("foo's \"middle\" bar", 'concat(\'foo\', "\'", \'s "middle" bar\')'), - array("foo's 'middle' \"bar\"", 'concat(\'foo\', "\'", \'s \', "\'", \'middle\', "\'", \' "bar"\')'), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/bootstrap.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/bootstrap.php deleted file mode 100644 index d2c7d08..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tests/bootstrap.php +++ /dev/null @@ -1,18 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -spl_autoload_register(function ($class) { - if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\CssSelector')) { - if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\CssSelector')).'.php')) { - require_once $file; - } - } -}); diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Token.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Token.php deleted file mode 100644 index 6748a44..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Token.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector; - -/** - * Token represents a CSS Selector token. - * - * This component is a port of the Python lxml library, - * which is copyright Infrae and distributed under the BSD license. - * - * @author Fabien Potencier - */ -class Token -{ - private $type; - private $value; - private $position; - - /** - * Constructor. - * - * @param string $type The type of this token. - * @param mixed $value The value of this token. - * @param integer $position The order of this token. - */ - public function __construct($type, $value, $position) - { - $this->type = $type; - $this->value = $value; - $this->position = $position; - } - - /** - * Gets a string representation of this token. - * - * @return string - */ - public function __toString() - { - return (string) $this->value; - } - - /** - * Answers whether this token's type equals to $type. - * - * @param string $type The type to test against this token's one. - * - * @return Boolean - */ - public function isType($type) - { - return $this->type == $type; - } - - /** - * Gets the position of this token. - * - * @return integer - */ - public function getPosition() - { - return $this->position; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/TokenStream.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/TokenStream.php deleted file mode 100644 index cf04702..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/TokenStream.php +++ /dev/null @@ -1,105 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector; - -/** - * TokenStream represents a stream of CSS Selector tokens. - * - * This component is a port of the Python lxml library, - * which is copyright Infrae and distributed under the BSD license. - * - * @author Fabien Potencier - */ -class TokenStream -{ - private $used; - private $tokens; - private $source; - private $peeked; - private $peeking; - - /** - * Constructor. - * - * @param array $tokens The tokens that make the stream. - * @param mixed $source The source of the stream. - */ - public function __construct($tokens, $source = null) - { - $this->used = array(); - $this->tokens = $tokens; - $this->source = $source; - $this->peeked = null; - $this->peeking = false; - } - - /** - * Gets the tokens that have already been visited in this stream. - * - * @return array - */ - public function getUsed() - { - return $this->used; - } - - /** - * Gets the next token in the stream or null if there is none. - * Note that if this stream was set to be peeking its behavior - * will be restored to not peeking after this operation. - * - * @return mixed - */ - public function next() - { - if ($this->peeking) { - $this->peeking = false; - $this->used[] = $this->peeked; - - return $this->peeked; - } - - if (!count($this->tokens)) { - return null; - } - - $next = array_shift($this->tokens); - $this->used[] = $next; - - return $next; - } - - /** - * Peeks for the next token in this stream. This means that the next token - * will be returned but it won't be considered as used (visited) until the - * next() method is invoked. - * If there are no remaining tokens null will be returned. - * - * @see next() - * - * @return mixed - */ - public function peek() - { - if (!$this->peeking) { - if (!count($this->tokens)) { - return null; - } - - $this->peeked = array_shift($this->tokens); - - $this->peeking = true; - } - - return $this->peeked; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tokenizer.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tokenizer.php deleted file mode 100644 index 67d5b67..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/Tokenizer.php +++ /dev/null @@ -1,201 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector; - -use Symfony\Component\CssSelector\Exception\ParseException; - -/** - * Tokenizer lexes a CSS Selector to tokens. - * - * This component is a port of the Python lxml library, - * which is copyright Infrae and distributed under the BSD license. - * - * @author Fabien Potencier - */ -class Tokenizer -{ - /** - * Takes a CSS selector and returns an array holding the Tokens - * it contains. - * - * @param string $s The selector to lex. - * - * @return array Token[] - */ - public function tokenize($s) - { - if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) { - $mbEncoding = mb_internal_encoding(); - mb_internal_encoding('ASCII'); - } - - $tokens = array(); - $pos = 0; - $s = preg_replace('#/\*.*?\*/#s', '', $s); - - while (true) { - if (preg_match('#\s+#A', $s, $match, 0, $pos)) { - $precedingWhitespacePos = $pos; - $pos += strlen($match[0]); - } else { - $precedingWhitespacePos = 0; - } - - if ($pos >= strlen($s)) { - if (isset($mbEncoding)) { - mb_internal_encoding($mbEncoding); - } - - return $tokens; - } - - if (preg_match('#[+-]?\d*n(?:[+-]\d+)?#A', $s, $match, 0, $pos) && 'n' !== $match[0]) { - $sym = substr($s, $pos, strlen($match[0])); - $tokens[] = new Token('Symbol', $sym, $pos); - $pos += strlen($match[0]); - - continue; - } - - $c = $s[$pos]; - $c2 = substr($s, $pos, 2); - if (in_array($c2, array('~=', '|=', '^=', '$=', '*=', '::', '!='))) { - $tokens[] = new Token('Token', $c2, $pos); - $pos += 2; - - continue; - } - - if (in_array($c, array('>', '+', '~', ',', '.', '*', '=', '[', ']', '(', ')', '|', ':', '#'))) { - if (in_array($c, array('.', '#', '[')) && $precedingWhitespacePos > 0) { - $tokens[] = new Token('Token', ' ', $precedingWhitespacePos); - } - $tokens[] = new Token('Token', $c, $pos); - ++$pos; - - continue; - } - - if ('"' === $c || "'" === $c) { - // Quoted string - $oldPos = $pos; - list($sym, $pos) = $this->tokenizeEscapedString($s, $pos); - - $tokens[] = new Token('String', $sym, $oldPos); - - continue; - } - - $oldPos = $pos; - list($sym, $pos) = $this->tokenizeSymbol($s, $pos); - - $tokens[] = new Token('Symbol', $sym, $oldPos); - - continue; - } - } - - /** - * Tokenizes a quoted string (i.e. 'A string quoted with \' characters'), - * and returns an array holding the unquoted string contained by $s and - * the new position from which tokenizing should take over. - * - * @param string $s The selector string containing the quoted string. - * @param integer $pos The starting position for the quoted string. - * - * @return array - * - * @throws ParseException When expected closing is not found - */ - private function tokenizeEscapedString($s, $pos) - { - $quote = $s[$pos]; - - $pos = $pos + 1; - $start = $pos; - while (true) { - $next = strpos($s, $quote, $pos); - if (false === $next) { - throw new ParseException(sprintf('Expected closing %s for string in: %s', $quote, substr($s, $start))); - } - - $result = substr($s, $start, $next - $start); - if ('\\' === $result[strlen($result) - 1]) { - // next quote character is escaped - $pos = $next + 1; - continue; - } - - if (false !== strpos($result, '\\')) { - $result = $this->unescapeStringLiteral($result); - } - - return array($result, $next + 1); - } - } - - /** - * Unescapes a string literal and returns the unescaped string. - * - * @param string $literal The string literal to unescape. - * - * @return string - * - * @throws ParseException When invalid escape sequence is found - */ - private function unescapeStringLiteral($literal) - { - return preg_replace_callback('#(\\\\(?:[A-Fa-f0-9]{1,6}(?:\r\n|\s)?|[^A-Fa-f0-9]))#', function ($matches) use ($literal) { - if ($matches[0][0] == '\\' && strlen($matches[0]) > 1) { - $matches[0] = substr($matches[0], 1); - if (in_array($matches[0][0], array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'a', 'b', 'c', 'd', 'e', 'f'))) { - return chr(trim($matches[0])); - } - } else { - throw new ParseException(sprintf('Invalid escape sequence %s in string %s', $matches[0], $literal)); - } - }, $literal); - } - - /** - * Lexes selector $s and returns an array holding the name of the symbol - * contained in it and the new position from which tokenizing should take - * over. - * - * @param string $s The selector string. - * @param integer $pos The position in $s at which the symbol starts. - * - * @return array - * - * @throws ParseException When Unexpected symbol is found - */ - private function tokenizeSymbol($s, $pos) - { - $start = $pos; - - if (!preg_match('#[^\w\-]#', $s, $match, PREG_OFFSET_CAPTURE, $pos)) { - // Goes to end of s - return array(substr($s, $start), strlen($s)); - } - - $matchStart = $match[0][1]; - - if ($matchStart == $pos) { - throw new ParseException(sprintf('Unexpected symbol: %s at %s', $s[$pos], $pos)); - } - - $result = substr($s, $start, $matchStart - $start); - $pos = $matchStart; - - return array($result, $pos); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/XPathExpr.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/XPathExpr.php deleted file mode 100644 index 507b8ac..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/XPathExpr.php +++ /dev/null @@ -1,254 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector; - -/** - * XPathExpr represents an XPath expression. - * - * This component is a port of the Python lxml library, - * which is copyright Infrae and distributed under the BSD license. - * - * @author Fabien Potencier - */ -class XPathExpr -{ - private $prefix; - private $path; - private $element; - private $condition; - private $starPrefix; - - /** - * Constructor. - * - * @param string $prefix Prefix for the XPath expression. - * @param string $path Actual path of the expression. - * @param string $element The element in the expression. - * @param string $condition A condition for the expression. - * @param Boolean $starPrefix Indicates whether to use a star prefix. - */ - public function __construct($prefix = null, $path = null, $element = '*', $condition = null, $starPrefix = false) - { - $this->prefix = $prefix; - $this->path = $path; - $this->element = $element; - $this->condition = $condition; - $this->starPrefix = $starPrefix; - } - - /** - * Gets the prefix of this XPath expression. - * - * @return string - */ - public function getPrefix() - { - return $this->prefix; - } - - /** - * Gets the path of this XPath expression. - * - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Answers whether this XPath expression has a star prefix. - * - * @return Boolean - */ - public function hasStarPrefix() - { - return $this->starPrefix; - } - - /** - * Gets the element of this XPath expression. - * - * @return string - */ - public function getElement() - { - return $this->element; - } - - /** - * Gets the condition of this XPath expression. - * - * @return string - */ - public function getCondition() - { - return $this->condition; - } - - /** - * Gets a string representation for this XPath expression. - * - * @return string - */ - public function __toString() - { - $path = ''; - if (null !== $this->prefix) { - $path .= $this->prefix; - } - - if (null !== $this->path) { - $path .= $this->path; - } - - $path .= $this->element; - - if ($this->condition) { - $path .= sprintf('[%s]', $this->condition); - } - - return $path; - } - - /** - * Adds a condition to this XPath expression. - * Any pre-existent condition will be ANDed to it. - * - * @param string $condition The condition to add. - */ - public function addCondition($condition) - { - if ($this->condition) { - $this->condition = sprintf('%s and (%s)', $this->condition, $condition); - } else { - $this->condition = $condition; - } - } - - /** - * Adds a prefix to this XPath expression. - * It will be prepended to any pre-existent prefixes. - * - * @param string $prefix The prefix to add. - */ - public function addPrefix($prefix) - { - if ($this->prefix) { - $this->prefix = $prefix.$this->prefix; - } else { - $this->prefix = $prefix; - } - } - - /** - * Adds a condition to this XPath expression using the name of the element - * as the desired value. - * This method resets the element to '*'. - */ - public function addNameTest() - { - if ($this->element == '*') { - // We weren't doing a test anyway - return; - } - - $this->addCondition(sprintf('name() = %s', XPathExpr::xpathLiteral($this->element))); - $this->element = '*'; - } - - /** - * Adds a star prefix to this XPath expression. - * This method will prepend a '*' to the path and set the star prefix flag - * to true. - */ - public function addStarPrefix() - { - /* - Adds a /* prefix if there is no prefix. This is when you need - to keep context's constrained to a single parent. - */ - if ($this->path) { - $this->path .= '*/'; - } else { - $this->path = '*/'; - } - - $this->starPrefix = true; - } - - /** - * Joins this XPath expression with $other (another XPath expression) using - * $combiner to join them. - * - * @param string $combiner The combiner string. - * @param XPathExpr $other The other XPath expression to combine with - * this one. - */ - public function join($combiner, $other) - { - $prefix = (string) $this; - - $prefix .= $combiner; - $path = $other->getPrefix().$other->getPath(); - - /* We don't need a star prefix if we are joining to this other - prefix; so we'll get rid of it */ - if ($other->hasStarPrefix() && '*/' == $path) { - $path = ''; - } - $this->prefix = $prefix; - $this->path = $path; - $this->element = $other->getElement(); - $this->condition = $other->GetCondition(); - } - - /** - * Gets an XPath literal for $s. - * - * @param mixed $s Can either be a Node\ElementNode or a string. - * - * @return string - */ - public static function xpathLiteral($s) - { - if ($s instanceof Node\ElementNode) { - // This is probably a symbol that looks like an expression... - $s = $s->formatElement(); - } else { - $s = (string) $s; - } - - if (false === strpos($s, "'")) { - return sprintf("'%s'", $s); - } - - if (false === strpos($s, '"')) { - return sprintf('"%s"', $s); - } - - $string = $s; - $parts = array(); - while (true) { - if (false !== $pos = strpos($string, "'")) { - $parts[] = sprintf("'%s'", substr($string, 0, $pos)); - $parts[] = "\"'\""; - $string = substr($string, $pos + 1); - } else { - $parts[] = "'$string'"; - break; - } - } - - return sprintf('concat(%s)', implode($parts, ', ')); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/XPathExprOr.php b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/XPathExprOr.php deleted file mode 100644 index f516367..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/XPathExprOr.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector; - -/** - * XPathExprOr represents XPath |'d expressions. - * - * Note that unfortunately it isn't the union, it's the sum, so duplicate elements will appear. - * - * This component is a port of the Python lxml library, - * which is copyright Infrae and distributed under the BSD license. - * - * @author Fabien Potencier - */ -class XPathExprOr extends XPathExpr -{ - /** - * Constructor. - * - * @param array $items The items in the expression. - * @param string $prefix Optional prefix for the expression. - */ - public function __construct($items, $prefix = null) - { - $this->items = $items; - $this->prefix = $prefix; - } - - /** - * Gets a string representation of this |'d expression. - * - * @return string - */ - public function __toString() - { - $prefix = $this->getPrefix(); - - $tmp = array(); - foreach ($this->items as $i) { - $tmp[] = sprintf('%s%s', $prefix, $i); - } - - return implode($tmp, ' | '); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/composer.json b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/composer.json deleted file mode 100644 index a2a65e6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/composer.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "symfony/css-selector", - "type": "library", - "description": "Symfony CssSelector Component", - "keywords": [], - "homepage": "http://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "require": { - "php": ">=5.3.3" - }, - "autoload": { - "psr-0": { "Symfony\\Component\\CssSelector": "" } - }, - "target-dir": "Symfony/Component/CssSelector", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/phpunit.xml.dist b/vendor/symfony/symfony/src/Symfony/Component/CssSelector/phpunit.xml.dist deleted file mode 100644 index 1aeb811..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/CssSelector/phpunit.xml.dist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - ./Tests/ - - - - - - ./ - - ./Resources - ./Tests - ./vendor - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/.gitignore b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/.gitignore deleted file mode 100644 index d1502b0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -vendor/ -composer.lock diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Alias.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Alias.php deleted file mode 100644 index fd75578..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Alias.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection; - -/** - * @api - */ -class Alias -{ - private $id; - private $public; - - /** - * Constructor. - * - * @param string $id Alias identifier - * @param Boolean $public If this alias is public - * - * @api - */ - public function __construct($id, $public = true) - { - $this->id = strtolower($id); - $this->public = $public; - } - - /** - * Checks if this DI Alias should be public or not. - * - * @return Boolean - * - * @api - */ - public function isPublic() - { - return $this->public; - } - - /** - * Sets if this Alias is public. - * - * @param Boolean $boolean If this Alias should be public - * - * @api - */ - public function setPublic($boolean) - { - $this->public = (Boolean) $boolean; - } - - /** - * Returns the Id of this alias. - * - * @return string The alias id - * - * @api - */ - public function __toString() - { - return $this->id; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/CHANGELOG.md b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/CHANGELOG.md deleted file mode 100644 index 8f5d6b3..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/CHANGELOG.md +++ /dev/null @@ -1,15 +0,0 @@ -CHANGELOG -========= - -2.1.0 ------ - - * added IntrospectableContainerInterface (to be able to check if a service - has been initialized or not) - * added ConfigurationExtensionInterface - * added Definition::clearTag() - * component exceptions that inherit base SPL classes are now used exclusively - (this includes dumped containers) - * [BC BREAK] fixed unescaping of class arguments, method - ParameterBag::unescapeValue() was made public - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php deleted file mode 100644 index 19079b4..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php +++ /dev/null @@ -1,140 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * Run this pass before passes that need to know more about the relation of - * your services. - * - * This class will populate the ServiceReferenceGraph with information. You can - * retrieve the graph in other passes from the compiler. - * - * @author Johannes M. Schmitt - */ -class AnalyzeServiceReferencesPass implements RepeatablePassInterface -{ - private $graph; - private $container; - private $currentId; - private $currentDefinition; - private $repeatedPass; - private $onlyConstructorArguments; - - /** - * Constructor. - * - * @param Boolean $onlyConstructorArguments Sets this Service Reference pass to ignore method calls - */ - public function __construct($onlyConstructorArguments = false) - { - $this->onlyConstructorArguments = (Boolean) $onlyConstructorArguments; - } - - /** - * {@inheritDoc} - */ - public function setRepeatedPass(RepeatedPass $repeatedPass) - { - $this->repeatedPass = $repeatedPass; - } - - /** - * Processes a ContainerBuilder object to populate the service reference graph. - * - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - $this->container = $container; - $this->graph = $container->getCompiler()->getServiceReferenceGraph(); - $this->graph->clear(); - - foreach ($container->getDefinitions() as $id => $definition) { - if ($definition->isSynthetic() || $definition->isAbstract()) { - continue; - } - - $this->currentId = $id; - $this->currentDefinition = $definition; - $this->processArguments($definition->getArguments()); - - if (!$this->onlyConstructorArguments) { - $this->processArguments($definition->getMethodCalls()); - $this->processArguments($definition->getProperties()); - if ($definition->getConfigurator()) { - $this->processArguments(array($definition->getConfigurator())); - } - } - } - - foreach ($container->getAliases() as $id => $alias) { - $this->graph->connect($id, $alias, (string) $alias, $this->getDefinition((string) $alias), null); - } - } - - /** - * Processes service definitions for arguments to find relationships for the service graph. - * - * @param array $arguments An array of Reference or Definition objects relating to service definitions - */ - private function processArguments(array $arguments) - { - foreach ($arguments as $argument) { - if (is_array($argument)) { - $this->processArguments($argument); - } elseif ($argument instanceof Reference) { - $this->graph->connect( - $this->currentId, - $this->currentDefinition, - $this->getDefinitionId((string) $argument), - $this->getDefinition((string) $argument), - $argument - ); - } elseif ($argument instanceof Definition) { - $this->processArguments($argument->getArguments()); - $this->processArguments($argument->getMethodCalls()); - $this->processArguments($argument->getProperties()); - } - } - } - - /** - * Returns a service definition given the full name or an alias. - * - * @param string $id A full id or alias for a service definition. - * - * @return Definition The definition related to the supplied id - */ - private function getDefinition($id) - { - $id = $this->getDefinitionId($id); - - return null === $id ? null : $this->container->getDefinition($id); - } - - private function getDefinitionId($id) - { - while ($this->container->hasAlias($id)) { - $id = (string) $this->container->getAlias($id); - } - - if (!$this->container->hasDefinition($id)) { - return null; - } - - return $id; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php deleted file mode 100644 index 9cb3ff0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * Checks your services for circular references - * - * References from method calls are ignored since we might be able to resolve - * these references depending on the order in which services are called. - * - * Circular reference from method calls will only be detected at run-time. - * - * @author Johannes M. Schmitt - */ -class CheckCircularReferencesPass implements CompilerPassInterface -{ - private $currentId; - private $currentPath; - - /** - * Checks the ContainerBuilder object for circular references. - * - * @param ContainerBuilder $container The ContainerBuilder instances - */ - public function process(ContainerBuilder $container) - { - $graph = $container->getCompiler()->getServiceReferenceGraph(); - - foreach ($graph->getNodes() as $id => $node) { - $this->currentId = $id; - $this->currentPath = array($id); - - $this->checkOutEdges($node->getOutEdges()); - } - } - - /** - * Checks for circular references. - * - * @param array $edges An array of Nodes - * - * @throws ServiceCircularReferenceException When a circular reference is found. - */ - private function checkOutEdges(array $edges) - { - foreach ($edges as $edge) { - $node = $edge->getDestNode(); - $this->currentPath[] = $id = $node->getId(); - - if ($this->currentId === $id) { - throw new ServiceCircularReferenceException($this->currentId, $this->currentPath); - } - - $this->checkOutEdges($node->getOutEdges()); - array_pop($this->currentPath); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php deleted file mode 100644 index e536331..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; - -/** - * This pass validates each definition individually only taking the information - * into account which is contained in the definition itself. - * - * Later passes can rely on the following, and specifically do not need to - * perform these checks themselves: - * - * - non synthetic, non abstract services always have a class set - * - synthetic services are always public - * - synthetic services are always of non-prototype scope - * - * @author Johannes M. Schmitt - */ -class CheckDefinitionValidityPass implements CompilerPassInterface -{ - /** - * Processes the ContainerBuilder to validate the Definition. - * - * @param ContainerBuilder $container - * - * @throws RuntimeException When the Definition is invalid - */ - public function process(ContainerBuilder $container) - { - foreach ($container->getDefinitions() as $id => $definition) { - // synthetic service is public - if ($definition->isSynthetic() && !$definition->isPublic()) { - throw new RuntimeException(sprintf( - 'A synthetic service ("%s") must be public.', - $id - )); - } - - // synthetic service has non-prototype scope - if ($definition->isSynthetic() && ContainerInterface::SCOPE_PROTOTYPE === $definition->getScope()) { - throw new RuntimeException(sprintf( - 'A synthetic service ("%s") cannot be of scope "prototype".', - $id - )); - } - - // non-synthetic, non-abstract service has class - if (!$definition->isAbstract() && !$definition->isSynthetic() && !$definition->getClass()) { - if ($definition->getFactoryClass() || $definition->getFactoryService()) { - throw new RuntimeException(sprintf( - 'Please add the class to service "%s" even if it is constructed by a factory ' - .'since we might need to add method calls based on compile-time checks.', - $id - )); - } - - throw new RuntimeException(sprintf( - 'The definition for "%s" has no class. If you intend to inject ' - .'this service dynamically at runtime, please mark it as synthetic=true. ' - .'If this is an abstract definition solely used by child definitions, ' - .'please add abstract=true, otherwise specify a class to get rid of this error.', - $id - )); - } - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php deleted file mode 100644 index 2cd5480..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Definition; - -use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * Checks that all references are pointing to a valid service. - * - * @author Johannes M. Schmitt - */ -class CheckExceptionOnInvalidReferenceBehaviorPass implements CompilerPassInterface -{ - private $container; - private $sourceId; - - public function process(ContainerBuilder $container) - { - $this->container = $container; - - foreach ($container->getDefinitions() as $id => $definition) { - $this->sourceId = $id; - $this->processDefinition($definition); - } - } - - private function processDefinition(Definition $definition) - { - $this->processReferences($definition->getArguments()); - $this->processReferences($definition->getMethodCalls()); - $this->processReferences($definition->getProperties()); - } - - private function processReferences(array $arguments) - { - foreach ($arguments as $argument) { - if (is_array($argument)) { - $this->processReferences($argument); - } elseif ($argument instanceof Definition) { - $this->processDefinition($argument); - } elseif ($argument instanceof Reference && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE === $argument->getInvalidBehavior()) { - $destId = (string) $argument; - - if (!$this->container->has($destId)) { - throw new ServiceNotFoundException($destId, $this->sourceId); - } - } - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php deleted file mode 100644 index 436dc74..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php +++ /dev/null @@ -1,167 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; -use Symfony\Component\DependencyInjection\Exception\ScopeCrossingInjectionException; -use Symfony\Component\DependencyInjection\Exception\ScopeWideningInjectionException; - -/** - * Checks the validity of references - * - * The following checks are performed by this pass: - * - target definitions are not abstract - * - target definitions are of equal or wider scope - * - target definitions are in the same scope hierarchy - * - * @author Johannes M. Schmitt - */ -class CheckReferenceValidityPass implements CompilerPassInterface -{ - private $container; - private $currentId; - private $currentDefinition; - private $currentScope; - private $currentScopeAncestors; - private $currentScopeChildren; - - /** - * Processes the ContainerBuilder to validate References. - * - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - $this->container = $container; - - $children = $this->container->getScopeChildren(); - $ancestors = array(); - - $scopes = $this->container->getScopes(); - foreach ($scopes as $name => $parent) { - $ancestors[$name] = array($parent); - - while (isset($scopes[$parent])) { - $ancestors[$name][] = $parent = $scopes[$parent]; - } - } - - foreach ($container->getDefinitions() as $id => $definition) { - if ($definition->isSynthetic() || $definition->isAbstract()) { - continue; - } - - $this->currentId = $id; - $this->currentDefinition = $definition; - $this->currentScope = $scope = $definition->getScope(); - - if (ContainerInterface::SCOPE_CONTAINER === $scope) { - $this->currentScopeChildren = array_keys($scopes); - $this->currentScopeAncestors = array(); - } elseif (ContainerInterface::SCOPE_PROTOTYPE !== $scope) { - $this->currentScopeChildren = $children[$scope]; - $this->currentScopeAncestors = $ancestors[$scope]; - } - - $this->validateReferences($definition->getArguments()); - $this->validateReferences($definition->getMethodCalls()); - $this->validateReferences($definition->getProperties()); - } - } - - /** - * Validates an array of References. - * - * @param array $arguments An array of Reference objects - * - * @throws RuntimeException when there is a reference to an abstract definition. - */ - private function validateReferences(array $arguments) - { - foreach ($arguments as $argument) { - if (is_array($argument)) { - $this->validateReferences($argument); - } elseif ($argument instanceof Reference) { - $targetDefinition = $this->getDefinition((string) $argument); - - if (null !== $targetDefinition && $targetDefinition->isAbstract()) { - throw new RuntimeException(sprintf( - 'The definition "%s" has a reference to an abstract definition "%s". ' - .'Abstract definitions cannot be the target of references.', - $this->currentId, - $argument - )); - } - - $this->validateScope($argument, $targetDefinition); - } - } - } - - /** - * Validates the scope of a single Reference. - * - * @param Reference $reference - * @param Definition $definition - * - * @throws ScopeWideningInjectionException when the definition references a service of a narrower scope - * @throws ScopeCrossingInjectionException when the definition references a service of another scope hierarchy - */ - private function validateScope(Reference $reference, Definition $definition = null) - { - if (ContainerInterface::SCOPE_PROTOTYPE === $this->currentScope) { - return; - } - - if (!$reference->isStrict()) { - return; - } - - if (null === $definition) { - return; - } - - if ($this->currentScope === $scope = $definition->getScope()) { - return; - } - - $id = (string) $reference; - - if (in_array($scope, $this->currentScopeChildren, true)) { - throw new ScopeWideningInjectionException($this->currentId, $this->currentScope, $id, $scope); - } - - if (!in_array($scope, $this->currentScopeAncestors, true)) { - throw new ScopeCrossingInjectionException($this->currentId, $this->currentScope, $id, $scope); - } - } - - /** - * Returns the Definition given an id. - * - * @param string $id Definition identifier - * - * @return Definition - */ - private function getDefinition($id) - { - if (!$this->container->hasDefinition($id)) { - return null; - } - - return $this->container->getDefinition($id); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php deleted file mode 100644 index 01f224b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php +++ /dev/null @@ -1,122 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\PassConfig; - -/** - * This class is used to remove circular dependencies between individual passes. - * - * @author Johannes M. Schmitt - * - * @api - */ -class Compiler -{ - private $passConfig; - private $log; - private $loggingFormatter; - private $serviceReferenceGraph; - - /** - * Constructor. - */ - public function __construct() - { - $this->passConfig = new PassConfig(); - $this->serviceReferenceGraph = new ServiceReferenceGraph(); - $this->loggingFormatter = new LoggingFormatter(); - $this->log = array(); - } - - /** - * Returns the PassConfig. - * - * @return PassConfig The PassConfig instance - * - * @api - */ - public function getPassConfig() - { - return $this->passConfig; - } - - /** - * Returns the ServiceReferenceGraph. - * - * @return ServiceReferenceGraph The ServiceReferenceGraph instance - * - * @api - */ - public function getServiceReferenceGraph() - { - return $this->serviceReferenceGraph; - } - - /** - * Returns the logging formatter which can be used by compilation passes. - * - * @return LoggingFormatter - */ - public function getLoggingFormatter() - { - return $this->loggingFormatter; - } - - /** - * Adds a pass to the PassConfig. - * - * @param CompilerPassInterface $pass A compiler pass - * @param string $type The type of the pass - * - * @api - */ - public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION) - { - $this->passConfig->addPass($pass, $type); - } - - /** - * Adds a log message. - * - * @param string $string The log message - */ - public function addLogMessage($string) - { - $this->log[] = $string; - } - - /** - * Returns the log. - * - * @return array Log array - */ - public function getLog() - { - return $this->log; - } - - /** - * Run the Compiler and process all Passes. - * - * @param ContainerBuilder $container - * - * @api - */ - public function compile(ContainerBuilder $container) - { - foreach ($this->passConfig->getPasses() as $pass) { - $pass->process($container); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CompilerPassInterface.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CompilerPassInterface.php deleted file mode 100644 index beacda9..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CompilerPassInterface.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * Interface that must be implemented by compilation passes - * - * @author Johannes M. Schmitt - * - * @api - */ -interface CompilerPassInterface -{ - /** - * You can modify the container here before it is dumped to PHP code. - * - * @param ContainerBuilder $container - * - * @api - */ - public function process(ContainerBuilder $container); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php deleted file mode 100644 index 70592df..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php +++ /dev/null @@ -1,137 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * Inline service definitions where this is possible. - * - * @author Johannes M. Schmitt - */ -class InlineServiceDefinitionsPass implements RepeatablePassInterface -{ - private $repeatedPass; - private $graph; - private $compiler; - private $formatter; - private $currentId; - - /** - * {@inheritDoc} - */ - public function setRepeatedPass(RepeatedPass $repeatedPass) - { - $this->repeatedPass = $repeatedPass; - } - - /** - * Processes the ContainerBuilder for inline service definitions. - * - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - $this->compiler = $container->getCompiler(); - $this->formatter = $this->compiler->getLoggingFormatter(); - $this->graph = $this->compiler->getServiceReferenceGraph(); - - foreach ($container->getDefinitions() as $id => $definition) { - $this->currentId = $id; - - $definition->setArguments( - $this->inlineArguments($container, $definition->getArguments()) - ); - - $definition->setMethodCalls( - $this->inlineArguments($container, $definition->getMethodCalls()) - ); - - $definition->setProperties( - $this->inlineArguments($container, $definition->getProperties()) - ); - } - } - - /** - * Processes inline arguments. - * - * @param ContainerBuilder $container The ContainerBuilder - * @param array $arguments An array of arguments - */ - private function inlineArguments(ContainerBuilder $container, array $arguments) - { - foreach ($arguments as $k => $argument) { - if (is_array($argument)) { - $arguments[$k] = $this->inlineArguments($container, $argument); - } elseif ($argument instanceof Reference) { - if (!$container->hasDefinition($id = (string) $argument)) { - continue; - } - - if ($this->isInlineableDefinition($container, $id, $definition = $container->getDefinition($id))) { - $this->compiler->addLogMessage($this->formatter->formatInlineService($this, $id, $this->currentId)); - - if (ContainerInterface::SCOPE_PROTOTYPE !== $definition->getScope()) { - $arguments[$k] = $definition; - } else { - $arguments[$k] = clone $definition; - } - } - } elseif ($argument instanceof Definition) { - $argument->setArguments($this->inlineArguments($container, $argument->getArguments())); - $argument->setMethodCalls($this->inlineArguments($container, $argument->getMethodCalls())); - $argument->setProperties($this->inlineArguments($container, $argument->getProperties())); - } - } - - return $arguments; - } - - /** - * Checks if the definition is inlineable. - * - * @param ContainerBuilder $container - * @param string $id - * @param Definition $definition - * - * @return Boolean If the definition is inlineable - */ - private function isInlineableDefinition(ContainerBuilder $container, $id, Definition $definition) - { - if (ContainerInterface::SCOPE_PROTOTYPE === $definition->getScope()) { - return true; - } - - if ($definition->isPublic()) { - return false; - } - - if (!$this->graph->hasNode($id)) { - return true; - } - - $ids = array(); - foreach ($this->graph->getNode($id)->getInEdges() as $edge) { - $ids[] = $edge->getSourceNode()->getId(); - } - - if (count(array_unique($ids)) > 1) { - return false; - } - - return $container->getDefinition(reset($ids))->getScope() === $definition->getScope(); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/LoggingFormatter.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/LoggingFormatter.php deleted file mode 100644 index 6bd6161..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/LoggingFormatter.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -/** - * Used to format logging messages during the compilation. - * - * @author Johannes M. Schmitt - */ -class LoggingFormatter -{ - public function formatRemoveService(CompilerPassInterface $pass, $id, $reason) - { - return $this->format($pass, sprintf('Removed service "%s"; reason: %s', $id, $reason)); - } - - public function formatInlineService(CompilerPassInterface $pass, $id, $target) - { - return $this->format($pass, sprintf('Inlined service "%s" to "%s".', $id, $target)); - } - - public function formatUpdateReference(CompilerPassInterface $pass, $serviceId, $oldDestId, $newDestId) - { - return $this->format($pass, sprintf('Changed reference of service "%s" previously pointing to "%s" to "%s".', $serviceId, $oldDestId, $newDestId)); - } - - public function formatResolveInheritance(CompilerPassInterface $pass, $childId, $parentId) - { - return $this->format($pass, sprintf('Resolving inheritance for "%s" (parent: %s).', $childId, $parentId)); - } - - public function format(CompilerPassInterface $pass, $message) - { - return sprintf('%s: %s', get_class($pass), $message); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php deleted file mode 100644 index a9beb5b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * Merges extension configs into the container builder - * - * @author Fabien Potencier - */ -class MergeExtensionConfigurationPass implements CompilerPassInterface -{ - /** - * {@inheritDoc} - */ - public function process(ContainerBuilder $container) - { - $parameters = $container->getParameterBag()->all(); - $definitions = $container->getDefinitions(); - $aliases = $container->getAliases(); - - foreach ($container->getExtensions() as $name => $extension) { - if (!$config = $container->getExtensionConfig($name)) { - // this extension was not called - continue; - } - $config = $container->getParameterBag()->resolveValue($config); - - $tmpContainer = new ContainerBuilder($container->getParameterBag()); - $tmpContainer->addObjectResource($extension); - - $extension->load($config, $tmpContainer); - - $container->merge($tmpContainer); - } - - $container->addDefinitions($definitions); - $container->addAliases($aliases); - $container->getParameterBag()->add($parameters); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php deleted file mode 100644 index e863f75..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php +++ /dev/null @@ -1,259 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; - -/** - * Compiler Pass Configuration - * - * This class has a default configuration embedded. - * - * @author Johannes M. Schmitt - * - * @api - */ -class PassConfig -{ - const TYPE_AFTER_REMOVING = 'afterRemoving'; - const TYPE_BEFORE_OPTIMIZATION = 'beforeOptimization'; - const TYPE_BEFORE_REMOVING = 'beforeRemoving'; - const TYPE_OPTIMIZE = 'optimization'; - const TYPE_REMOVE = 'removing'; - - private $mergePass; - private $afterRemovingPasses; - private $beforeOptimizationPasses; - private $beforeRemovingPasses; - private $optimizationPasses; - private $removingPasses; - - /** - * Constructor. - */ - public function __construct() - { - $this->mergePass = new MergeExtensionConfigurationPass(); - - $this->afterRemovingPasses = array(); - $this->beforeOptimizationPasses = array(); - $this->beforeRemovingPasses = array(); - - $this->optimizationPasses = array( - new ResolveDefinitionTemplatesPass(), - new ResolveParameterPlaceHoldersPass(), - new CheckDefinitionValidityPass(), - new ResolveReferencesToAliasesPass(), - new ResolveInvalidReferencesPass(), - new AnalyzeServiceReferencesPass(true), - new CheckCircularReferencesPass(), - new CheckReferenceValidityPass(), - ); - - $this->removingPasses = array( - new RemovePrivateAliasesPass(), - new RemoveAbstractDefinitionsPass(), - new ReplaceAliasByActualDefinitionPass(), - new RepeatedPass(array( - new AnalyzeServiceReferencesPass(), - new InlineServiceDefinitionsPass(), - new AnalyzeServiceReferencesPass(), - new RemoveUnusedDefinitionsPass(), - )), - new CheckExceptionOnInvalidReferenceBehaviorPass(), - ); - } - - /** - * Returns all passes in order to be processed. - * - * @return array An array of all passes to process - * - * @api - */ - public function getPasses() - { - return array_merge( - array($this->mergePass), - $this->beforeOptimizationPasses, - $this->optimizationPasses, - $this->beforeRemovingPasses, - $this->removingPasses, - $this->afterRemovingPasses - ); - } - - /** - * Adds a pass. - * - * @param CompilerPassInterface $pass A Compiler pass - * @param string $type The pass type - * - * @throws InvalidArgumentException when a pass type doesn't exist - * - * @api - */ - public function addPass(CompilerPassInterface $pass, $type = self::TYPE_BEFORE_OPTIMIZATION) - { - $property = $type.'Passes'; - if (!isset($this->$property)) { - throw new InvalidArgumentException(sprintf('Invalid type "%s".', $type)); - } - - $passes = &$this->$property; - $passes[] = $pass; - } - - /** - * Gets all passes for the AfterRemoving pass. - * - * @return array An array of passes - * - * @api - */ - public function getAfterRemovingPasses() - { - return $this->afterRemovingPasses; - } - - /** - * Gets all passes for the BeforeOptimization pass. - * - * @return array An array of passes - * - * @api - */ - public function getBeforeOptimizationPasses() - { - return $this->beforeOptimizationPasses; - } - - /** - * Gets all passes for the BeforeRemoving pass. - * - * @return array An array of passes - * - * @api - */ - public function getBeforeRemovingPasses() - { - return $this->beforeRemovingPasses; - } - - /** - * Gets all passes for the Optimization pass. - * - * @return array An array of passes - * - * @api - */ - public function getOptimizationPasses() - { - return $this->optimizationPasses; - } - - /** - * Gets all passes for the Removing pass. - * - * @return array An array of passes - * - * @api - */ - public function getRemovingPasses() - { - return $this->removingPasses; - } - - /** - * Gets all passes for the Merge pass. - * - * @return array An array of passes - * - * @api - */ - public function getMergePass() - { - return $this->mergePass; - } - - /** - * Sets the Merge Pass. - * - * @param CompilerPassInterface $pass The merge pass - * - * @api - */ - public function setMergePass(CompilerPassInterface $pass) - { - $this->mergePass = $pass; - } - - /** - * Sets the AfterRemoving passes. - * - * @param array $passes An array of passes - * - * @api - */ - public function setAfterRemovingPasses(array $passes) - { - $this->afterRemovingPasses = $passes; - } - - /** - * Sets the BeforeOptimization passes. - * - * @param array $passes An array of passes - * - * @api - */ - public function setBeforeOptimizationPasses(array $passes) - { - $this->beforeOptimizationPasses = $passes; - } - - /** - * Sets the BeforeRemoving passes. - * - * @param array $passes An array of passes - * - * @api - */ - public function setBeforeRemovingPasses(array $passes) - { - $this->beforeRemovingPasses = $passes; - } - - /** - * Sets the Optimization passes. - * - * @param array $passes An array of passes - * - * @api - */ - public function setOptimizationPasses(array $passes) - { - $this->optimizationPasses = $passes; - } - - /** - * Sets the Removing passes. - * - * @param array $passes An array of passes - * - * @api - */ - public function setRemovingPasses(array $passes) - { - $this->removingPasses = $passes; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php deleted file mode 100644 index d97d923..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * Removes abstract Definitions - * - */ -class RemoveAbstractDefinitionsPass implements CompilerPassInterface -{ - /** - * Removes abstract definitions from the ContainerBuilder - * - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - $compiler = $container->getCompiler(); - $formatter = $compiler->getLoggingFormatter(); - - foreach ($container->getDefinitions() as $id => $definition) { - if ($definition->isAbstract()) { - $container->removeDefinition($id); - $compiler->addLogMessage($formatter->formatRemoveService($this, $id, 'abstract')); - } - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php deleted file mode 100644 index 4842337..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * Remove private aliases from the container. They were only used to establish - * dependencies between services, and these dependencies have been resolved in - * one of the previous passes. - * - * @author Johannes M. Schmitt - */ -class RemovePrivateAliasesPass implements CompilerPassInterface -{ - /** - * Removes private aliases from the ContainerBuilder - * - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - $compiler = $container->getCompiler(); - $formatter = $compiler->getLoggingFormatter(); - - foreach ($container->getAliases() as $id => $alias) { - if ($alias->isPublic()) { - continue; - } - - $container->removeAlias($id); - $compiler->addLogMessage($formatter->formatRemoveService($this, $id, 'private alias')); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RemoveUnusedDefinitionsPass.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RemoveUnusedDefinitionsPass.php deleted file mode 100644 index 0c7be66..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RemoveUnusedDefinitionsPass.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * Removes unused service definitions from the container. - * - * @author Johannes M. Schmitt - */ -class RemoveUnusedDefinitionsPass implements RepeatablePassInterface -{ - private $repeatedPass; - - /** - * {@inheritDoc} - */ - public function setRepeatedPass(RepeatedPass $repeatedPass) - { - $this->repeatedPass = $repeatedPass; - } - - /** - * Processes the ContainerBuilder to remove unused definitions. - * - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - $compiler = $container->getCompiler(); - $formatter = $compiler->getLoggingFormatter(); - $graph = $compiler->getServiceReferenceGraph(); - - $hasChanged = false; - foreach ($container->getDefinitions() as $id => $definition) { - if ($definition->isPublic()) { - continue; - } - - if ($graph->hasNode($id)) { - $edges = $graph->getNode($id)->getInEdges(); - $referencingAliases = array(); - $sourceIds = array(); - foreach ($edges as $edge) { - $node = $edge->getSourceNode(); - $sourceIds[] = $node->getId(); - - if ($node->isAlias()) { - $referencingAliases[] = $node->getValue(); - } - } - $isReferenced = (count(array_unique($sourceIds)) - count($referencingAliases)) > 0; - } else { - $referencingAliases = array(); - $isReferenced = false; - } - - if (1 === count($referencingAliases) && false === $isReferenced) { - $container->setDefinition((string) reset($referencingAliases), $definition); - $definition->setPublic(true); - $container->removeDefinition($id); - $compiler->addLogMessage($formatter->formatRemoveService($this, $id, 'replaces alias '.reset($referencingAliases))); - } elseif (0 === count($referencingAliases) && false === $isReferenced) { - $container->removeDefinition($id); - $compiler->addLogMessage($formatter->formatRemoveService($this, $id, 'unused')); - $hasChanged = true; - } - } - - if ($hasChanged) { - $this->repeatedPass->setRepeat(); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RepeatablePassInterface.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RepeatablePassInterface.php deleted file mode 100644 index d60ae35..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RepeatablePassInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -/** - * Interface that must be implemented by passes that are run as part of an - * RepeatedPass. - * - * @author Johannes M. Schmitt - */ -interface RepeatablePassInterface extends CompilerPassInterface -{ - /** - * Sets the RepeatedPass interface. - * - * @param RepeatedPass $repeatedPass - */ - public function setRepeatedPass(RepeatedPass $repeatedPass); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php deleted file mode 100644 index d4af431..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; - -/** - * A pass that might be run repeatedly. - * - * @author Johannes M. Schmitt - */ -class RepeatedPass implements CompilerPassInterface -{ - private $repeat; - private $passes; - - /** - * Constructor. - * - * @param array $passes An array of RepeatablePassInterface objects - * @throws InvalidArgumentException if a pass is not a RepeatablePassInterface instance - */ - public function __construct(array $passes) - { - foreach ($passes as $pass) { - if (!$pass instanceof RepeatablePassInterface) { - throw new InvalidArgumentException('$passes must be an array of RepeatablePassInterface.'); - } - - $pass->setRepeatedPass($this); - } - - $this->passes = $passes; - } - - /** - * Process the repeatable passes that run more than once. - * - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - $this->repeat = false; - foreach ($this->passes as $pass) { - $pass->process($container); - } - - if ($this->repeat) { - $this->process($container); - } - } - - /** - * Sets if the pass should repeat - */ - public function setRepeat() - { - $this->repeat = true; - } - - /** - * Returns the passes - * - * @return array An array of RepeatablePassInterface objects - */ - public function getPasses() - { - return $this->passes; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php deleted file mode 100644 index 5d00ed6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php +++ /dev/null @@ -1,116 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * Replaces aliases with actual service definitions, effectively removing these - * aliases. - * - * @author Johannes M. Schmitt - */ -class ReplaceAliasByActualDefinitionPass implements CompilerPassInterface -{ - private $compiler; - private $formatter; - private $sourceId; - - /** - * Process the Container to replace aliases with service definitions. - * - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - $this->compiler = $container->getCompiler(); - $this->formatter = $this->compiler->getLoggingFormatter(); - - foreach ($container->getAliases() as $id => $alias) { - $aliasId = (string) $alias; - - $definition = $container->getDefinition($aliasId); - - if ($definition->isPublic()) { - continue; - } - - $definition->setPublic(true); - $container->setDefinition($id, $definition); - $container->removeDefinition($aliasId); - - $this->updateReferences($container, $aliasId, $id); - - // we have to restart the process due to concurrent modification of - // the container - $this->process($container); - - break; - } - } - - /** - * Updates references to remove aliases. - * - * @param ContainerBuilder $container The container - * @param string $currentId The alias identifier being replaced - * @param string $newId The id of the service the alias points to - */ - private function updateReferences($container, $currentId, $newId) - { - foreach ($container->getAliases() as $id => $alias) { - if ($currentId === (string) $alias) { - $container->setAlias($id, $newId); - } - } - - foreach ($container->getDefinitions() as $id => $definition) { - $this->sourceId = $id; - - $definition->setArguments( - $this->updateArgumentReferences($definition->getArguments(), $currentId, $newId) - ); - - $definition->setMethodCalls( - $this->updateArgumentReferences($definition->getMethodCalls(), $currentId, $newId) - ); - - $definition->setProperties( - $this->updateArgumentReferences($definition->getProperties(), $currentId, $newId) - ); - } - } - - /** - * Updates argument references. - * - * @param array $arguments An array of Arguments - * @param string $currentId The alias identifier - * @param string $newId The identifier the alias points to - */ - private function updateArgumentReferences(array $arguments, $currentId, $newId) - { - foreach ($arguments as $k => $argument) { - if (is_array($argument)) { - $arguments[$k] = $this->updateArgumentReferences($argument, $currentId, $newId); - } elseif ($argument instanceof Reference) { - if ($currentId === (string) $argument) { - $arguments[$k] = new Reference($newId, $argument->getInvalidBehavior()); - $this->compiler->addLogMessage($this->formatter->formatUpdateReference($this, $this->sourceId, $currentId, $newId)); - } - } - } - - return $arguments; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php deleted file mode 100644 index 53c6f52..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php +++ /dev/null @@ -1,148 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; - -/** - * This replaces all DefinitionDecorator instances with their equivalent fully - * merged Definition instance. - * - * @author Johannes M. Schmitt - */ -class ResolveDefinitionTemplatesPass implements CompilerPassInterface -{ - private $container; - private $compiler; - private $formatter; - - /** - * Process the ContainerBuilder to replace DefinitionDecorator instances with their real Definition instances. - * - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - $this->container = $container; - $this->compiler = $container->getCompiler(); - $this->formatter = $this->compiler->getLoggingFormatter(); - - foreach (array_keys($container->getDefinitions()) as $id) { - // yes, we are specifically fetching the definition from the - // container to ensure we are not operating on stale data - $definition = $container->getDefinition($id); - if (!$definition instanceof DefinitionDecorator || $definition->isAbstract()) { - continue; - } - - $this->resolveDefinition($id, $definition); - } - } - - /** - * Resolves the definition - * - * @param string $id The definition identifier - * @param DefinitionDecorator $definition - * - * @return Definition - */ - private function resolveDefinition($id, DefinitionDecorator $definition) - { - if (!$this->container->hasDefinition($parent = $definition->getParent())) { - throw new RuntimeException(sprintf('The parent definition "%s" defined for definition "%s" does not exist.', $parent, $id)); - } - - $parentDef = $this->container->getDefinition($parent); - if ($parentDef instanceof DefinitionDecorator) { - $parentDef = $this->resolveDefinition($parent, $parentDef); - } - - $this->compiler->addLogMessage($this->formatter->formatResolveInheritance($this, $id, $parent)); - $def = new Definition(); - - // merge in parent definition - // purposely ignored attributes: scope, abstract, tags - $def->setClass($parentDef->getClass()); - $def->setArguments($parentDef->getArguments()); - $def->setMethodCalls($parentDef->getMethodCalls()); - $def->setProperties($parentDef->getProperties()); - $def->setFactoryClass($parentDef->getFactoryClass()); - $def->setFactoryMethod($parentDef->getFactoryMethod()); - $def->setFactoryService($parentDef->getFactoryService()); - $def->setConfigurator($parentDef->getConfigurator()); - $def->setFile($parentDef->getFile()); - $def->setPublic($parentDef->isPublic()); - - // overwrite with values specified in the decorator - $changes = $definition->getChanges(); - if (isset($changes['class'])) { - $def->setClass($definition->getClass()); - } - if (isset($changes['factory_class'])) { - $def->setFactoryClass($definition->getFactoryClass()); - } - if (isset($changes['factory_method'])) { - $def->setFactoryMethod($definition->getFactoryMethod()); - } - if (isset($changes['factory_service'])) { - $def->setFactoryService($definition->getFactoryService()); - } - if (isset($changes['configurator'])) { - $def->setConfigurator($definition->getConfigurator()); - } - if (isset($changes['file'])) { - $def->setFile($definition->getFile()); - } - if (isset($changes['public'])) { - $def->setPublic($definition->isPublic()); - } - - // merge arguments - foreach ($definition->getArguments() as $k => $v) { - if (is_numeric($k)) { - $def->addArgument($v); - continue; - } - - if (0 !== strpos($k, 'index_')) { - throw new RuntimeException(sprintf('Invalid argument key "%s" found.', $k)); - } - - $index = (integer) substr($k, strlen('index_')); - $def->replaceArgument($index, $v); - } - - // merge properties - foreach ($definition->getProperties() as $k => $v) { - $def->setProperty($k, $v); - } - - // append method calls - if (count($calls = $definition->getMethodCalls()) > 0) { - $def->setMethodCalls(array_merge($def->getMethodCalls(), $calls)); - } - - // these attributes are always taken from the child - $def->setAbstract($definition->isAbstract()); - $def->setScope($definition->getScope()); - $def->setTags($definition->getTags()); - - // set new definition on container - $this->container->setDefinition($id, $def); - - return $def; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php deleted file mode 100644 index 996199c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; - -/** - * Emulates the invalid behavior if the reference is not found within the - * container. - * - * @author Johannes M. Schmitt - */ -class ResolveInvalidReferencesPass implements CompilerPassInterface -{ - private $container; - - /** - * Process the ContainerBuilder to resolve invalid references. - * - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - $this->container = $container; - foreach ($container->getDefinitions() as $definition) { - if ($definition->isSynthetic() || $definition->isAbstract()) { - continue; - } - - $definition->setArguments( - $this->processArguments($definition->getArguments()) - ); - - $calls = array(); - foreach ($definition->getMethodCalls() as $call) { - try { - $calls[] = array($call[0], $this->processArguments($call[1], true)); - } catch (RuntimeException $ignore) { - // this call is simply removed - } - } - $definition->setMethodCalls($calls); - - $properties = array(); - foreach ($definition->getProperties() as $name => $value) { - try { - $value = $this->processArguments(array($value), true); - $properties[$name] = reset($value); - } catch (RuntimeException $ignore) { - // ignore property - } - } - $definition->setProperties($properties); - } - } - - /** - * Processes arguments to determine invalid references. - * - * @param array $arguments An array of Reference objects - * @param Boolean $inMethodCall - */ - private function processArguments(array $arguments, $inMethodCall = false) - { - foreach ($arguments as $k => $argument) { - if (is_array($argument)) { - $arguments[$k] = $this->processArguments($argument, $inMethodCall); - } elseif ($argument instanceof Reference) { - $id = (string) $argument; - - $invalidBehavior = $argument->getInvalidBehavior(); - $exists = $this->container->has($id); - - // resolve invalid behavior - if ($exists && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) { - $arguments[$k] = new Reference($id); - } elseif (!$exists && ContainerInterface::NULL_ON_INVALID_REFERENCE === $invalidBehavior) { - $arguments[$k] = null; - } elseif (!$exists && ContainerInterface::IGNORE_ON_INVALID_REFERENCE === $invalidBehavior) { - if ($inMethodCall) { - throw new RuntimeException('Method shouldn\'t be called.'); - } - - $arguments[$k] = null; - } - } - } - - return $arguments; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php deleted file mode 100644 index f6e4c85..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; - -/** - * Resolves all parameter placeholders "%somevalue%" to their real values. - * - * @author Johannes M. Schmitt - */ -class ResolveParameterPlaceHoldersPass implements CompilerPassInterface -{ - /** - * Processes the ContainerBuilder to resolve parameter placeholders. - * - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - $parameterBag = $container->getParameterBag(); - - foreach ($container->getDefinitions() as $id => $definition) { - try { - $definition->setClass($parameterBag->resolveValue($definition->getClass())); - $definition->setFile($parameterBag->resolveValue($definition->getFile())); - $definition->setArguments($parameterBag->resolveValue($definition->getArguments())); - - $calls = array(); - foreach ($definition->getMethodCalls() as $name => $arguments) { - $calls[$parameterBag->resolveValue($name)] = $parameterBag->resolveValue($arguments); - } - $definition->setMethodCalls($calls); - - $definition->setProperties($parameterBag->resolveValue($definition->getProperties())); - } catch (ParameterNotFoundException $e) { - $e->setSourceId($id); - - throw $e; - } - } - - $aliases = array(); - foreach ($container->getAliases() as $name => $target) { - $aliases[$parameterBag->resolveValue($name)] = $parameterBag->resolveValue($target); - } - $container->setAliases($aliases); - - $parameterBag->resolve(); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php deleted file mode 100644 index 015bdeb..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Alias; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * Replaces all references to aliases with references to the actual service. - * - * @author Johannes M. Schmitt - */ -class ResolveReferencesToAliasesPass implements CompilerPassInterface -{ - private $container; - - /** - * Processes the ContainerBuilder to replace references to aliases with actual service references. - * - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - $this->container = $container; - - foreach ($container->getDefinitions() as $definition) { - if ($definition->isSynthetic() || $definition->isAbstract()) { - continue; - } - - $definition->setArguments($this->processArguments($definition->getArguments())); - $definition->setMethodCalls($this->processArguments($definition->getMethodCalls())); - $definition->setProperties($this->processArguments($definition->getProperties())); - } - - foreach ($container->getAliases() as $id => $alias) { - $aliasId = (string) $alias; - if ($aliasId !== $defId = $this->getDefinitionId($aliasId)) { - $container->setAlias($id, new Alias($defId, $alias->isPublic())); - } - } - } - - /** - * Processes the arguments to replace aliases. - * - * @param array $arguments An array of References - * - * @return array An array of References - */ - private function processArguments(array $arguments) - { - foreach ($arguments as $k => $argument) { - if (is_array($argument)) { - $arguments[$k] = $this->processArguments($argument); - } elseif ($argument instanceof Reference) { - $defId = $this->getDefinitionId($id = (string) $argument); - - if ($defId !== $id) { - $arguments[$k] = new Reference($defId, $argument->getInvalidBehavior(), $argument->isStrict()); - } - } - } - - return $arguments; - } - - /** - * Resolves an alias into a definition id. - * - * @param string $id The definition or alias id to resolve - * - * @return string The definition id with aliases resolved - */ - private function getDefinitionId($id) - { - while ($this->container->hasAlias($id)) { - $id = (string) $this->container->getAlias($id); - } - - return $id; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php deleted file mode 100644 index b241bf8..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; - -/** - * This is a directed graph of your services. - * - * This information can be used by your compiler passes instead of collecting - * it themselves which improves performance quite a lot. - * - * @author Johannes M. Schmitt - */ -class ServiceReferenceGraph -{ - private $nodes; - - /** - * Constructor. - */ - public function __construct() - { - $this->nodes = array(); - } - - /** - * Checks if the graph has a specific node. - * - * @param string $id Id to check - */ - public function hasNode($id) - { - return isset($this->nodes[$id]); - } - - /** - * Gets a node by identifier. - * - * @param string $id The id to retrieve - * - * @return ServiceReferenceGraphNode The node matching the supplied identifier - * - * @throws InvalidArgumentException if no node matches the supplied identifier - */ - public function getNode($id) - { - if (!isset($this->nodes[$id])) { - throw new InvalidArgumentException(sprintf('There is no node with id "%s".', $id)); - } - - return $this->nodes[$id]; - } - - /** - * Returns all nodes. - * - * @return array An array of all ServiceReferenceGraphNode objects - */ - public function getNodes() - { - return $this->nodes; - } - - /** - * Clears all nodes. - */ - public function clear() - { - $this->nodes = array(); - } - - /** - * Connects 2 nodes together in the Graph. - * - * @param string $sourceId - * @param string $sourceValue - * @param string $destId - * @param string $destValue - * @param string $reference - */ - public function connect($sourceId, $sourceValue, $destId, $destValue = null, $reference = null) - { - $sourceNode = $this->createNode($sourceId, $sourceValue); - $destNode = $this->createNode($destId, $destValue); - $edge = new ServiceReferenceGraphEdge($sourceNode, $destNode, $reference); - - $sourceNode->addOutEdge($edge); - $destNode->addInEdge($edge); - } - - /** - * Creates a graph node. - * - * @param string $id - * @param string $value - * - * @return ServiceReferenceGraphNode - */ - private function createNode($id, $value) - { - if (isset($this->nodes[$id]) && $this->nodes[$id]->getValue() === $value) { - return $this->nodes[$id]; - } - - return $this->nodes[$id] = new ServiceReferenceGraphNode($id, $value); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php deleted file mode 100644 index 19da234..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -/** - * Represents an edge in your service graph. - * - * Value is typically a reference. - * - * @author Johannes M. Schmitt - */ -class ServiceReferenceGraphEdge -{ - private $sourceNode; - private $destNode; - private $value; - - /** - * Constructor. - * - * @param ServiceReferenceGraphNode $sourceNode - * @param ServiceReferenceGraphNode $destNode - * @param string $value - */ - public function __construct(ServiceReferenceGraphNode $sourceNode, ServiceReferenceGraphNode $destNode, $value = null) - { - $this->sourceNode = $sourceNode; - $this->destNode = $destNode; - $this->value = $value; - } - - /** - * Returns the value of the edge - * - * @return ServiceReferenceGraphNode - */ - public function getValue() - { - return $this->value; - } - - /** - * Returns the source node - * - * @return ServiceReferenceGraphNode - */ - public function getSourceNode() - { - return $this->sourceNode; - } - - /** - * Returns the destination node - * - * @return ServiceReferenceGraphNode - */ - public function getDestNode() - { - return $this->destNode; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php deleted file mode 100644 index 3fd5077..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php +++ /dev/null @@ -1,124 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Alias; - -/** - * Represents a node in your service graph. - * - * Value is typically a definition, or an alias. - * - * @author Johannes M. Schmitt - */ -class ServiceReferenceGraphNode -{ - private $id; - private $inEdges; - private $outEdges; - private $value; - - /** - * Constructor. - * - * @param string $id The node identifier - * @param mixed $value The node value - */ - public function __construct($id, $value) - { - $this->id = $id; - $this->value = $value; - $this->inEdges = array(); - $this->outEdges = array(); - } - - /** - * Adds an in edge to this node. - * - * @param ServiceReferenceGraphEdge $edge - */ - public function addInEdge(ServiceReferenceGraphEdge $edge) - { - $this->inEdges[] = $edge; - } - - /** - * Adds an out edge to this node. - * - * @param ServiceReferenceGraphEdge $edge - */ - public function addOutEdge(ServiceReferenceGraphEdge $edge) - { - $this->outEdges[] = $edge; - } - - /** - * Checks if the value of this node is an Alias. - * - * @return Boolean True if the value is an Alias instance - */ - public function isAlias() - { - return $this->value instanceof Alias; - } - - /** - * Checks if the value of this node is a Definition. - * - * @return Boolean True if the value is a Definition instance - */ - public function isDefinition() - { - return $this->value instanceof Definition; - } - - /** - * Returns the identifier. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Returns the in edges. - * - * @return array The in ServiceReferenceGraphEdge array - */ - public function getInEdges() - { - return $this->inEdges; - } - - /** - * Returns the out edges. - * - * @return array The out ServiceReferenceGraphEdge array - */ - public function getOutEdges() - { - return $this->outEdges; - } - - /** - * Returns the value of this Node - * - * @return mixed The value - */ - public function getValue() - { - return $this->value; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php deleted file mode 100644 index 88e1f26..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php +++ /dev/null @@ -1,467 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection; - -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; -use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; -use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; -use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; - -/** - * Container is a dependency injection container. - * - * It gives access to object instances (services). - * - * Services and parameters are simple key/pair stores. - * - * Parameter and service keys are case insensitive. - * - * A service id can contain lowercased letters, digits, underscores, and dots. - * Underscores are used to separate words, and dots to group services - * under namespaces: - * - *
      - *
    • request
    • - *
    • mysql_session_storage
    • - *
    • symfony.mysql_session_storage
    • - *
    - * - * A service can also be defined by creating a method named - * getXXXService(), where XXX is the camelized version of the id: - * - *
      - *
    • request -> getRequestService()
    • - *
    • mysql_session_storage -> getMysqlSessionStorageService()
    • - *
    • symfony.mysql_session_storage -> getSymfony_MysqlSessionStorageService()
    • - *
    - * - * The container can have three possible behaviors when a service does not exist: - * - * * EXCEPTION_ON_INVALID_REFERENCE: Throws an exception (the default) - * * NULL_ON_INVALID_REFERENCE: Returns null - * * IGNORE_ON_INVALID_REFERENCE: Ignores the wrapping command asking for the reference - * (for instance, ignore a setter if the service does not exist) - * - * @author Fabien Potencier - * @author Johannes M. Schmitt - * - * @api - */ -class Container implements IntrospectableContainerInterface -{ - protected $parameterBag; - protected $services; - protected $scopes; - protected $scopeChildren; - protected $scopedServices; - protected $scopeStacks; - protected $loading = array(); - - /** - * Constructor. - * - * @param ParameterBagInterface $parameterBag A ParameterBagInterface instance - * - * @api - */ - public function __construct(ParameterBagInterface $parameterBag = null) - { - $this->parameterBag = null === $parameterBag ? new ParameterBag() : $parameterBag; - - $this->services = array(); - $this->scopes = array(); - $this->scopeChildren = array(); - $this->scopedServices = array(); - $this->scopeStacks = array(); - - $this->set('service_container', $this); - } - - /** - * Compiles the container. - * - * This method does two things: - * - * * Parameter values are resolved; - * * The parameter bag is frozen. - * - * @api - */ - public function compile() - { - $this->parameterBag->resolve(); - - $this->parameterBag = new FrozenParameterBag($this->parameterBag->all()); - } - - /** - * Returns true if the container parameter bag are frozen. - * - * @return Boolean true if the container parameter bag are frozen, false otherwise - * - * @api - */ - public function isFrozen() - { - return $this->parameterBag instanceof FrozenParameterBag; - } - - /** - * Gets the service container parameter bag. - * - * @return ParameterBagInterface A ParameterBagInterface instance - * - * @api - */ - public function getParameterBag() - { - return $this->parameterBag; - } - - /** - * Gets a parameter. - * - * @param string $name The parameter name - * - * @return mixed The parameter value - * - * @throws InvalidArgumentException if the parameter is not defined - * - * @api - */ - public function getParameter($name) - { - return $this->parameterBag->get($name); - } - - /** - * Checks if a parameter exists. - * - * @param string $name The parameter name - * - * @return Boolean The presence of parameter in container - * - * @api - */ - public function hasParameter($name) - { - return $this->parameterBag->has($name); - } - - /** - * Sets a parameter. - * - * @param string $name The parameter name - * @param mixed $value The parameter value - * - * @api - */ - public function setParameter($name, $value) - { - $this->parameterBag->set($name, $value); - } - - /** - * Sets a service. - * - * @param string $id The service identifier - * @param object $service The service instance - * @param string $scope The scope of the service - * - * @api - */ - public function set($id, $service, $scope = self::SCOPE_CONTAINER) - { - if (self::SCOPE_PROTOTYPE === $scope) { - throw new InvalidArgumentException('You cannot set services of scope "prototype".'); - } - - $id = strtolower($id); - - if (self::SCOPE_CONTAINER !== $scope) { - if (!isset($this->scopedServices[$scope])) { - throw new RuntimeException('You cannot set services of inactive scopes.'); - } - - $this->scopedServices[$scope][$id] = $service; - } - - $this->services[$id] = $service; - } - - /** - * Returns true if the given service is defined. - * - * @param string $id The service identifier - * - * @return Boolean true if the service is defined, false otherwise - * - * @api - */ - public function has($id) - { - $id = strtolower($id); - - return isset($this->services[$id]) || method_exists($this, 'get'.strtr($id, array('_' => '', '.' => '_')).'Service'); - } - - /** - * Gets a service. - * - * If a service is defined both through a set() method and - * with a get{$id}Service() method, the former has always precedence. - * - * @param string $id The service identifier - * @param integer $invalidBehavior The behavior when the service does not exist - * - * @return object The associated service - * - * @throws InvalidArgumentException if the service is not defined - * - * @see Reference - * - * @api - */ - public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) - { - $id = strtolower($id); - - if (isset($this->services[$id])) { - return $this->services[$id]; - } - - if (isset($this->loading[$id])) { - throw new ServiceCircularReferenceException($id, array_keys($this->loading)); - } - - if (method_exists($this, $method = 'get'.strtr($id, array('_' => '', '.' => '_')).'Service')) { - $this->loading[$id] = true; - - try { - $service = $this->$method(); - } catch (\Exception $e) { - unset($this->loading[$id]); - throw $e; - } - - unset($this->loading[$id]); - - return $service; - } - - if (self::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) { - throw new ServiceNotFoundException($id); - } - } - - /** - * Returns true if the given service has actually been initialized - * - * @param string $id The service identifier - * - * @return Boolean true if service has already been initialized, false otherwise - */ - public function initialized($id) - { - return isset($this->services[strtolower($id)]); - } - - /** - * Gets all service ids. - * - * @return array An array of all defined service ids - */ - public function getServiceIds() - { - $ids = array(); - $r = new \ReflectionClass($this); - foreach ($r->getMethods() as $method) { - if (preg_match('/^get(.+)Service$/', $method->name, $match)) { - $ids[] = self::underscore($match[1]); - } - } - - return array_unique(array_merge($ids, array_keys($this->services))); - } - - /** - * This is called when you enter a scope - * - * @param string $name - * - * @api - */ - public function enterScope($name) - { - if (!isset($this->scopes[$name])) { - throw new InvalidArgumentException(sprintf('The scope "%s" does not exist.', $name)); - } - - if (self::SCOPE_CONTAINER !== $this->scopes[$name] && !isset($this->scopedServices[$this->scopes[$name]])) { - throw new RuntimeException(sprintf('The parent scope "%s" must be active when entering this scope.', $this->scopes[$name])); - } - - // check if a scope of this name is already active, if so we need to - // remove all services of this scope, and those of any of its child - // scopes from the global services map - if (isset($this->scopedServices[$name])) { - $services = array($this->services, $name => $this->scopedServices[$name]); - unset($this->scopedServices[$name]); - - foreach ($this->scopeChildren[$name] as $child) { - $services[$child] = $this->scopedServices[$child]; - unset($this->scopedServices[$child]); - } - - // update global map - $this->services = call_user_func_array('array_diff_key', $services); - array_shift($services); - - // add stack entry for this scope so we can restore the removed services later - if (!isset($this->scopeStacks[$name])) { - $this->scopeStacks[$name] = new \SplStack(); - } - $this->scopeStacks[$name]->push($services); - } - - $this->scopedServices[$name] = array(); - } - - /** - * This is called to leave the current scope, and move back to the parent - * scope. - * - * @param string $name The name of the scope to leave - * - * @throws InvalidArgumentException if the scope is not active - * - * @api - */ - public function leaveScope($name) - { - if (!isset($this->scopedServices[$name])) { - throw new InvalidArgumentException(sprintf('The scope "%s" is not active.', $name)); - } - - // remove all services of this scope, or any of its child scopes from - // the global service map - $services = array($this->services, $this->scopedServices[$name]); - unset($this->scopedServices[$name]); - foreach ($this->scopeChildren[$name] as $child) { - if (!isset($this->scopedServices[$child])) { - continue; - } - - $services[] = $this->scopedServices[$child]; - unset($this->scopedServices[$child]); - } - $this->services = call_user_func_array('array_diff_key', $services); - - // check if we need to restore services of a previous scope of this type - if (isset($this->scopeStacks[$name]) && count($this->scopeStacks[$name]) > 0) { - $services = $this->scopeStacks[$name]->pop(); - $this->scopedServices += $services; - - array_unshift($services, $this->services); - $this->services = call_user_func_array('array_merge', $services); - } - } - - /** - * Adds a scope to the container. - * - * @param ScopeInterface $scope - * - * @api - */ - public function addScope(ScopeInterface $scope) - { - $name = $scope->getName(); - $parentScope = $scope->getParentName(); - - if (self::SCOPE_CONTAINER === $name || self::SCOPE_PROTOTYPE === $name) { - throw new InvalidArgumentException(sprintf('The scope "%s" is reserved.', $name)); - } - if (isset($this->scopes[$name])) { - throw new InvalidArgumentException(sprintf('A scope with name "%s" already exists.', $name)); - } - if (self::SCOPE_CONTAINER !== $parentScope && !isset($this->scopes[$parentScope])) { - throw new InvalidArgumentException(sprintf('The parent scope "%s" does not exist, or is invalid.', $parentScope)); - } - - $this->scopes[$name] = $parentScope; - $this->scopeChildren[$name] = array(); - - // normalize the child relations - while ($parentScope !== self::SCOPE_CONTAINER) { - $this->scopeChildren[$parentScope][] = $name; - $parentScope = $this->scopes[$parentScope]; - } - } - - /** - * Returns whether this container has a certain scope - * - * @param string $name The name of the scope - * - * @return Boolean - * - * @api - */ - public function hasScope($name) - { - return isset($this->scopes[$name]); - } - - /** - * Returns whether this scope is currently active - * - * This does not actually check if the passed scope actually exists. - * - * @param string $name - * - * @return Boolean - * - * @api - */ - public function isScopeActive($name) - { - return isset($this->scopedServices[$name]); - } - - /** - * Camelizes a string. - * - * @param string $id A string to camelize - * - * @return string The camelized string - */ - public static function camelize($id) - { - return preg_replace_callback('/(^|_|\.)+(.)/', function ($match) { return ('.' === $match[1] ? '_' : '').strtoupper($match[2]); }, $id); - } - - /** - * A string to underscore. - * - * @param string $id The string to underscore - * - * @return string The underscored string - */ - public static function underscore($id) - { - return strtolower(preg_replace(array('/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'), array('\\1_\\2', '\\1_\\2'), strtr($id, '_', '.'))); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerAware.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerAware.php deleted file mode 100644 index 4096915..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerAware.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection; - -/** - * A simple implementation of ContainerAwareInterface. - * - * @author Fabien Potencier - * - * @api - */ -abstract class ContainerAware implements ContainerAwareInterface -{ - /** - * @var ContainerInterface - * - * @api - */ - protected $container; - - /** - * Sets the Container associated with this Controller. - * - * @param ContainerInterface $container A ContainerInterface instance - * - * @api - */ - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerAwareInterface.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerAwareInterface.php deleted file mode 100644 index eb96632..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerAwareInterface.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection; - -/** - * ContainerAwareInterface should be implemented by classes that depends on a Container. - * - * @author Fabien Potencier - * - * @api - */ -interface ContainerAwareInterface -{ - /** - * Sets the Container. - * - * @param ContainerInterface $container A ContainerInterface instance - * - * @api - */ - public function setContainer(ContainerInterface $container = null); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php deleted file mode 100644 index 692cf91..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ /dev/null @@ -1,871 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection; - -use Symfony\Component\DependencyInjection\Compiler\Compiler; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\Compiler\PassConfig; -use Symfony\Component\DependencyInjection\Exception\BadMethodCallException; -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\DependencyInjection\Exception\LogicException; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; -use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\Config\Resource\ResourceInterface; - -/** - * ContainerBuilder is a DI container that provides an API to easily describe services. - * - * @author Fabien Potencier - * - * @api - */ -class ContainerBuilder extends Container implements TaggedContainerInterface -{ - private $extensions = array(); - private $extensionsByNs = array(); - private $definitions = array(); - private $aliases = array(); - private $resources = array(); - private $extensionConfigs = array(); - private $compiler; - - /** - * Registers an extension. - * - * @param ExtensionInterface $extension An extension instance - * - * @api - */ - public function registerExtension(ExtensionInterface $extension) - { - $this->extensions[$extension->getAlias()] = $extension; - - if (false !== $extension->getNamespace()) { - $this->extensionsByNs[$extension->getNamespace()] = $extension; - } - } - - /** - * Returns an extension by alias or namespace. - * - * @param string $name An alias or a namespace - * - * @return ExtensionInterface An extension instance - * - * @api - */ - public function getExtension($name) - { - if (isset($this->extensions[$name])) { - return $this->extensions[$name]; - } - - if (isset($this->extensionsByNs[$name])) { - return $this->extensionsByNs[$name]; - } - - throw new LogicException(sprintf('Container extension "%s" is not registered', $name)); - } - - /** - * Returns all registered extensions. - * - * @return array An array of ExtensionInterface - * - * @api - */ - public function getExtensions() - { - return $this->extensions; - } - - /** - * Checks if we have an extension. - * - * @param string $name The name of the extension - * - * @return Boolean If the extension exists - * - * @api - */ - public function hasExtension($name) - { - return isset($this->extensions[$name]) || isset($this->extensionsByNs[$name]); - } - - /** - * Returns an array of resources loaded to build this configuration. - * - * @return ResourceInterface[] An array of resources - * - * @api - */ - public function getResources() - { - return array_unique($this->resources); - } - - /** - * Adds a resource for this configuration. - * - * @param ResourceInterface $resource A resource instance - * - * @return ContainerBuilder The current instance - * - * @api - */ - public function addResource(ResourceInterface $resource) - { - $this->resources[] = $resource; - - return $this; - } - - public function setResources(array $resources) - { - $this->resources = $resources; - - return $this; - } - - /** - * Adds the object class hierarchy as resources. - * - * @param object $object An object instance - * - * @api - */ - public function addObjectResource($object) - { - $parent = new \ReflectionObject($object); - do { - $this->addResource(new FileResource($parent->getFileName())); - } while ($parent = $parent->getParentClass()); - } - - /** - * Loads the configuration for an extension. - * - * @param string $extension The extension alias or namespace - * @param array $values An array of values that customizes the extension - * - * @return ContainerBuilder The current instance - * @throws BadMethodCallException When this ContainerBuilder is frozen - * - * @api - */ - public function loadFromExtension($extension, array $values = array()) - { - if ($this->isFrozen()) { - throw new BadMethodCallException('Cannot load from an extension on a frozen container.'); - } - - $namespace = $this->getExtension($extension)->getAlias(); - - $this->extensionConfigs[$namespace][] = $values; - - return $this; - } - - /** - * Adds a compiler pass. - * - * @param CompilerPassInterface $pass A compiler pass - * @param string $type The type of compiler pass - * - * @api - */ - public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION) - { - if (null === $this->compiler) { - $this->compiler = new Compiler(); - } - - $this->compiler->addPass($pass, $type); - - $this->addObjectResource($pass); - } - - /** - * Returns the compiler pass config which can then be modified. - * - * @return PassConfig The compiler pass config - * - * @api - */ - public function getCompilerPassConfig() - { - if (null === $this->compiler) { - $this->compiler = new Compiler(); - } - - return $this->compiler->getPassConfig(); - } - - /** - * Returns the compiler. - * - * @return Compiler The compiler - * - * @api - */ - public function getCompiler() - { - if (null === $this->compiler) { - $this->compiler = new Compiler(); - } - - return $this->compiler; - } - - /** - * Returns all Scopes. - * - * @return array An array of scopes - * - * @api - */ - public function getScopes() - { - return $this->scopes; - } - - /** - * Returns all Scope children. - * - * @return array An array of scope children. - * - * @api - */ - public function getScopeChildren() - { - return $this->scopeChildren; - } - - /** - * Sets a service. - * - * @param string $id The service identifier - * @param object $service The service instance - * @param string $scope The scope - * - * @throws BadMethodCallException When this ContainerBuilder is frozen - * - * @api - */ - public function set($id, $service, $scope = self::SCOPE_CONTAINER) - { - if ($this->isFrozen()) { - throw new BadMethodCallException('Setting service on a frozen container is not allowed'); - } - - $id = strtolower($id); - - unset($this->definitions[$id], $this->aliases[$id]); - - parent::set($id, $service, $scope); - } - - /** - * Removes a service definition. - * - * @param string $id The service identifier - * - * @api - */ - public function removeDefinition($id) - { - unset($this->definitions[strtolower($id)]); - } - - /** - * Returns true if the given service is defined. - * - * @param string $id The service identifier - * - * @return Boolean true if the service is defined, false otherwise - * - * @api - */ - public function has($id) - { - $id = strtolower($id); - - return isset($this->definitions[$id]) || isset($this->aliases[$id]) || parent::has($id); - } - - /** - * Gets a service. - * - * @param string $id The service identifier - * @param integer $invalidBehavior The behavior when the service does not exist - * - * @return object The associated service - * - * @throws InvalidArgumentException if the service is not defined - * @throws LogicException if the service has a circular reference to itself - * - * @see Reference - * - * @api - */ - public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) - { - $id = strtolower($id); - - try { - return parent::get($id, ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE); - } catch (InvalidArgumentException $e) { - if (isset($this->loading[$id])) { - throw new LogicException(sprintf('The service "%s" has a circular reference to itself.', $id), 0, $e); - } - - if (!$this->hasDefinition($id) && isset($this->aliases[$id])) { - return $this->get($this->aliases[$id]); - } - - try { - $definition = $this->getDefinition($id); - } catch (InvalidArgumentException $e) { - if (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) { - return null; - } - - throw $e; - } - - $this->loading[$id] = true; - - $service = $this->createService($definition, $id); - - unset($this->loading[$id]); - - return $service; - } - } - - /** - * Merges a ContainerBuilder with the current ContainerBuilder configuration. - * - * Service definitions overrides the current defined ones. - * - * But for parameters, they are overridden by the current ones. It allows - * the parameters passed to the container constructor to have precedence - * over the loaded ones. - * - * $container = new ContainerBuilder(array('foo' => 'bar')); - * $loader = new LoaderXXX($container); - * $loader->load('resource_name'); - * $container->register('foo', new stdClass()); - * - * In the above example, even if the loaded resource defines a foo - * parameter, the value will still be 'bar' as defined in the ContainerBuilder - * constructor. - * - * @param ContainerBuilder $container The ContainerBuilder instance to merge. - * - * - * @throws BadMethodCallException When this ContainerBuilder is frozen - * - * @api - */ - public function merge(ContainerBuilder $container) - { - if ($this->isFrozen()) { - throw new BadMethodCallException('Cannot merge on a frozen container.'); - } - - $this->addDefinitions($container->getDefinitions()); - $this->addAliases($container->getAliases()); - $this->getParameterBag()->add($container->getParameterBag()->all()); - - foreach ($container->getResources() as $resource) { - $this->addResource($resource); - } - - foreach ($this->extensions as $name => $extension) { - if (!isset($this->extensionConfigs[$name])) { - $this->extensionConfigs[$name] = array(); - } - - $this->extensionConfigs[$name] = array_merge($this->extensionConfigs[$name], $container->getExtensionConfig($name)); - } - } - - /** - * Returns the configuration array for the given extension. - * - * @param string $name The name of the extension - * - * @return array An array of configuration - * - * @api - */ - public function getExtensionConfig($name) - { - if (!isset($this->extensionConfigs[$name])) { - $this->extensionConfigs[$name] = array(); - } - - return $this->extensionConfigs[$name]; - } - - /** - * Compiles the container. - * - * This method passes the container to compiler - * passes whose job is to manipulate and optimize - * the container. - * - * The main compiler passes roughly do four things: - * - * * The extension configurations are merged; - * * Parameter values are resolved; - * * The parameter bag is frozen; - * * Extension loading is disabled. - * - * @api - */ - public function compile() - { - if (null === $this->compiler) { - $this->compiler = new Compiler(); - } - - foreach ($this->compiler->getPassConfig()->getPasses() as $pass) { - $this->addObjectResource($pass); - } - - $this->compiler->compile($this); - - $this->extensionConfigs = array(); - - parent::compile(); - } - - /** - * Gets all service ids. - * - * @return array An array of all defined service ids - */ - public function getServiceIds() - { - return array_unique(array_merge(array_keys($this->getDefinitions()), array_keys($this->aliases), parent::getServiceIds())); - } - - /** - * Adds the service aliases. - * - * @param array $aliases An array of aliases - * - * @api - */ - public function addAliases(array $aliases) - { - foreach ($aliases as $alias => $id) { - $this->setAlias($alias, $id); - } - } - - /** - * Sets the service aliases. - * - * @param array $aliases An array of service definitions - * - * @api - */ - public function setAliases(array $aliases) - { - $this->aliases = array(); - $this->addAliases($aliases); - } - - /** - * Sets an alias for an existing service. - * - * @param string $alias The alias to create - * @param mixed $id The service to alias - * - * @api - */ - public function setAlias($alias, $id) - { - $alias = strtolower($alias); - - if (is_string($id)) { - $id = new Alias($id); - } elseif (!$id instanceof Alias) { - throw new InvalidArgumentException('$id must be a string, or an Alias object.'); - } - - if ($alias === strtolower($id)) { - throw new InvalidArgumentException('An alias can not reference itself, got a circular reference on "'.$alias.'".'); - } - - unset($this->definitions[$alias]); - - $this->aliases[$alias] = $id; - } - - /** - * Removes an alias. - * - * @param string $alias The alias to remove - * - * @api - */ - public function removeAlias($alias) - { - unset($this->aliases[strtolower($alias)]); - } - - /** - * Returns true if an alias exists under the given identifier. - * - * @param string $id The service identifier - * - * @return Boolean true if the alias exists, false otherwise - * - * @api - */ - public function hasAlias($id) - { - return isset($this->aliases[strtolower($id)]); - } - - /** - * Gets all defined aliases. - * - * @return array An array of aliases - * - * @api - */ - public function getAliases() - { - return $this->aliases; - } - - /** - * Gets an alias. - * - * @param string $id The service identifier - * - * @return string The aliased service identifier - * - * @throws InvalidArgumentException if the alias does not exist - * - * @api - */ - public function getAlias($id) - { - $id = strtolower($id); - - if (!$this->hasAlias($id)) { - throw new InvalidArgumentException(sprintf('The service alias "%s" does not exist.', $id)); - } - - return $this->aliases[$id]; - } - - /** - * Registers a service definition. - * - * This methods allows for simple registration of service definition - * with a fluid interface. - * - * @param string $id The service identifier - * @param string $class The service class - * - * @return Definition A Definition instance - * - * @api - */ - public function register($id, $class = null) - { - return $this->setDefinition(strtolower($id), new Definition($class)); - } - - /** - * Adds the service definitions. - * - * @param Definition[] $definitions An array of service definitions - * - * @api - */ - public function addDefinitions(array $definitions) - { - foreach ($definitions as $id => $definition) { - $this->setDefinition($id, $definition); - } - } - - /** - * Sets the service definitions. - * - * @param array $definitions An array of service definitions - * - * @api - */ - public function setDefinitions(array $definitions) - { - $this->definitions = array(); - $this->addDefinitions($definitions); - } - - /** - * Gets all service definitions. - * - * @return array An array of Definition instances - * - * @api - */ - public function getDefinitions() - { - return $this->definitions; - } - - /** - * Sets a service definition. - * - * @param string $id The service identifier - * @param Definition $definition A Definition instance - * - * @throws BadMethodCallException When this ContainerBuilder is frozen - * - * @api - */ - public function setDefinition($id, Definition $definition) - { - if ($this->isFrozen()) { - throw new BadMethodCallException('Adding definition to a frozen container is not allowed'); - } - - $id = strtolower($id); - - unset($this->aliases[$id]); - - return $this->definitions[$id] = $definition; - } - - /** - * Returns true if a service definition exists under the given identifier. - * - * @param string $id The service identifier - * - * @return Boolean true if the service definition exists, false otherwise - * - * @api - */ - public function hasDefinition($id) - { - return array_key_exists(strtolower($id), $this->definitions); - } - - /** - * Gets a service definition. - * - * @param string $id The service identifier - * - * @return Definition A Definition instance - * - * @throws InvalidArgumentException if the service definition does not exist - * - * @api - */ - public function getDefinition($id) - { - $id = strtolower($id); - - if (!$this->hasDefinition($id)) { - throw new InvalidArgumentException(sprintf('The service definition "%s" does not exist.', $id)); - } - - return $this->definitions[$id]; - } - - /** - * Gets a service definition by id or alias. - * - * The method "unaliases" recursively to return a Definition instance. - * - * @param string $id The service identifier or alias - * - * @return Definition A Definition instance - * - * @throws InvalidArgumentException if the service definition does not exist - * - * @api - */ - public function findDefinition($id) - { - while ($this->hasAlias($id)) { - $id = (string) $this->getAlias($id); - } - - return $this->getDefinition($id); - } - - /** - * Creates a service for a service definition. - * - * @param Definition $definition A service definition instance - * @param string $id The service identifier - * - * @return object The service described by the service definition - * - * @throws RuntimeException When factory specification is incomplete or scope is inactive - * @throws InvalidArgumentException When configure callable is not callable - */ - private function createService(Definition $definition, $id) - { - $parameterBag = $this->getParameterBag(); - - if (null !== $definition->getFile()) { - require_once $parameterBag->resolveValue($definition->getFile()); - } - - $arguments = $this->resolveServices( - $parameterBag->unescapeValue($parameterBag->resolveValue($definition->getArguments())) - ); - - if (null !== $definition->getFactoryMethod()) { - if (null !== $definition->getFactoryClass()) { - $factory = $parameterBag->resolveValue($definition->getFactoryClass()); - } elseif (null !== $definition->getFactoryService()) { - $factory = $this->get($parameterBag->resolveValue($definition->getFactoryService())); - } else { - throw new RuntimeException('Cannot create service from factory method without a factory service or factory class.'); - } - - $service = call_user_func_array(array($factory, $definition->getFactoryMethod()), $arguments); - } else { - $r = new \ReflectionClass($parameterBag->resolveValue($definition->getClass())); - - $service = null === $r->getConstructor() ? $r->newInstance() : $r->newInstanceArgs($arguments); - } - - if (self::SCOPE_PROTOTYPE !== $scope = $definition->getScope()) { - if (self::SCOPE_CONTAINER !== $scope && !isset($this->scopedServices[$scope])) { - throw new RuntimeException('You tried to create a service of an inactive scope.'); - } - - $this->services[$lowerId = strtolower($id)] = $service; - - if (self::SCOPE_CONTAINER !== $scope) { - $this->scopedServices[$scope][$lowerId] = $service; - } - } - - foreach ($definition->getMethodCalls() as $call) { - $services = self::getServiceConditionals($call[1]); - - $ok = true; - foreach ($services as $s) { - if (!$this->has($s)) { - $ok = false; - break; - } - } - - if ($ok) { - call_user_func_array(array($service, $call[0]), $this->resolveServices($parameterBag->resolveValue($call[1]))); - } - } - - $properties = $this->resolveServices($parameterBag->resolveValue($definition->getProperties())); - foreach ($properties as $name => $value) { - $service->$name = $value; - } - - if ($callable = $definition->getConfigurator()) { - if (is_array($callable) && is_object($callable[0]) && $callable[0] instanceof Reference) { - $callable[0] = $this->get((string) $callable[0]); - } elseif (is_array($callable)) { - $callable[0] = $parameterBag->resolveValue($callable[0]); - } - - if (!is_callable($callable)) { - throw new InvalidArgumentException(sprintf('The configure callable for class "%s" is not a callable.', get_class($service))); - } - - call_user_func($callable, $service); - } - - return $service; - } - - /** - * Replaces service references by the real service instance. - * - * @param mixed $value A value - * - * @return mixed The same value with all service references replaced by the real service instances - */ - public function resolveServices($value) - { - if (is_array($value)) { - foreach ($value as &$v) { - $v = $this->resolveServices($v); - } - } elseif (is_object($value) && $value instanceof Reference) { - $value = $this->get((string) $value, $value->getInvalidBehavior()); - } elseif (is_object($value) && $value instanceof Definition) { - $value = $this->createService($value, null); - } - - return $value; - } - - /** - * Returns service ids for a given tag. - * - * @param string $name The tag name - * - * @return array An array of tags - * - * @api - */ - public function findTaggedServiceIds($name) - { - $tags = array(); - foreach ($this->getDefinitions() as $id => $definition) { - if ($definition->getTag($name)) { - $tags[$id] = $definition->getTag($name); - } - } - - return $tags; - } - - /** - * Returns the Service Conditionals. - * - * @param mixed $value An array of conditionals to return. - * - * @return array An array of Service conditionals - */ - public static function getServiceConditionals($value) - { - $services = array(); - - if (is_array($value)) { - foreach ($value as $v) { - $services = array_unique(array_merge($services, self::getServiceConditionals($v))); - } - } elseif (is_object($value) && $value instanceof Reference && $value->getInvalidBehavior() === ContainerInterface::IGNORE_ON_INVALID_REFERENCE) { - $services[] = (string) $value; - } - - return $services; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerInterface.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerInterface.php deleted file mode 100644 index d5e07a0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerInterface.php +++ /dev/null @@ -1,154 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection; - -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; - -/** - * ContainerInterface is the interface implemented by service container classes. - * - * @author Fabien Potencier - * @author Johannes M. Schmitt - * - * @api - */ -interface ContainerInterface -{ - const EXCEPTION_ON_INVALID_REFERENCE = 1; - const NULL_ON_INVALID_REFERENCE = 2; - const IGNORE_ON_INVALID_REFERENCE = 3; - const SCOPE_CONTAINER = 'container'; - const SCOPE_PROTOTYPE = 'prototype'; - - /** - * Sets a service. - * - * @param string $id The service identifier - * @param object $service The service instance - * @param string $scope The scope of the service - * - * @api - */ - public function set($id, $service, $scope = self::SCOPE_CONTAINER); - - /** - * Gets a service. - * - * @param string $id The service identifier - * @param int $invalidBehavior The behavior when the service does not exist - * - * @return object The associated service - * - * @throws InvalidArgumentException if the service is not defined - * - * @see Reference - * - * @api - */ - public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE); - - /** - * Returns true if the given service is defined. - * - * @param string $id The service identifier - * - * @return Boolean true if the service is defined, false otherwise - * - * @api - */ - public function has($id); - - /** - * Gets a parameter. - * - * @param string $name The parameter name - * - * @return mixed The parameter value - * - * @throws InvalidArgumentException if the parameter is not defined - * - * @api - */ - public function getParameter($name); - - /** - * Checks if a parameter exists. - * - * @param string $name The parameter name - * - * @return Boolean The presence of parameter in container - * - * @api - */ - public function hasParameter($name); - - /** - * Sets a parameter. - * - * @param string $name The parameter name - * @param mixed $value The parameter value - * - * @api - */ - public function setParameter($name, $value); - - /** - * Enters the given scope - * - * @param string $name - * - * @api - */ - public function enterScope($name); - - /** - * Leaves the current scope, and re-enters the parent scope - * - * @param string $name - * - * @api - */ - public function leaveScope($name); - - /** - * Adds a scope to the container - * - * @param ScopeInterface $scope - * - * @api - */ - public function addScope(ScopeInterface $scope); - - /** - * Whether this container has the given scope - * - * @param string $name - * - * @return Boolean - * - * @api - */ - public function hasScope($name); - - /** - * Determines whether the given scope is currently active. - * - * It does however not check if the scope actually exists. - * - * @param string $name - * - * @return Boolean - * - * @api - */ - public function isScopeActive($name); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Definition.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Definition.php deleted file mode 100644 index e7265f2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Definition.php +++ /dev/null @@ -1,655 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection; - -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\DependencyInjection\Exception\OutOfBoundsException; - -/** - * Definition represents a service definition. - * - * @author Fabien Potencier - * - * @api - */ -class Definition -{ - private $class; - private $file; - private $factoryClass; - private $factoryMethod; - private $factoryService; - private $scope; - private $properties; - private $calls; - private $configurator; - private $tags; - private $public; - private $synthetic; - private $abstract; - - protected $arguments; - - /** - * Constructor. - * - * @param string $class The service class - * @param array $arguments An array of arguments to pass to the service constructor - * - * @api - */ - public function __construct($class = null, array $arguments = array()) - { - $this->class = $class; - $this->arguments = $arguments; - $this->calls = array(); - $this->scope = ContainerInterface::SCOPE_CONTAINER; - $this->tags = array(); - $this->public = true; - $this->synthetic = false; - $this->abstract = false; - $this->properties = array(); - } - - /** - * Sets the name of the class that acts as a factory using the factory method, - * which will be invoked statically. - * - * @param string $factoryClass The factory class name - * - * @return Definition The current instance - * - * @api - */ - public function setFactoryClass($factoryClass) - { - $this->factoryClass = $factoryClass; - - return $this; - } - - /** - * Gets the factory class. - * - * @return string The factory class name - * - * @api - */ - public function getFactoryClass() - { - return $this->factoryClass; - } - - /** - * Sets the factory method able to create an instance of this class. - * - * @param string $factoryMethod The factory method name - * - * @return Definition The current instance - * - * @api - */ - public function setFactoryMethod($factoryMethod) - { - $this->factoryMethod = $factoryMethod; - - return $this; - } - - /** - * Gets the factory method. - * - * @return string The factory method name - * - * @api - */ - public function getFactoryMethod() - { - return $this->factoryMethod; - } - - /** - * Sets the name of the service that acts as a factory using the factory method. - * - * @param string $factoryService The factory service id - * - * @return Definition The current instance - * - * @api - */ - public function setFactoryService($factoryService) - { - $this->factoryService = $factoryService; - - return $this; - } - - /** - * Gets the factory service id. - * - * @return string The factory service id - * - * @api - */ - public function getFactoryService() - { - return $this->factoryService; - } - - /** - * Sets the service class. - * - * @param string $class The service class - * - * @return Definition The current instance - * - * @api - */ - public function setClass($class) - { - $this->class = $class; - - return $this; - } - - /** - * Gets the service class. - * - * @return string The service class - * - * @api - */ - public function getClass() - { - return $this->class; - } - - /** - * Sets the arguments to pass to the service constructor/factory method. - * - * @param array $arguments An array of arguments - * - * @return Definition The current instance - * - * @api - */ - public function setArguments(array $arguments) - { - $this->arguments = $arguments; - - return $this; - } - - /** - * @api - */ - public function setProperties(array $properties) - { - $this->properties = $properties; - - return $this; - } - - /** - * @api - */ - public function getProperties() - { - return $this->properties; - } - - /** - * @api - */ - public function setProperty($name, $value) - { - $this->properties[$name] = $value; - - return $this; - } - - /** - * Adds an argument to pass to the service constructor/factory method. - * - * @param mixed $argument An argument - * - * @return Definition The current instance - * - * @api - */ - public function addArgument($argument) - { - $this->arguments[] = $argument; - - return $this; - } - - /** - * Sets a specific argument - * - * @param integer $index - * @param mixed $argument - * - * @return Definition The current instance - * - * @api - */ - public function replaceArgument($index, $argument) - { - if ($index < 0 || $index > count($this->arguments) - 1) { - throw new OutOfBoundsException(sprintf('The index "%d" is not in the range [0, %d].', $index, count($this->arguments) - 1)); - } - - $this->arguments[$index] = $argument; - - return $this; - } - - /** - * Gets the arguments to pass to the service constructor/factory method. - * - * @return array The array of arguments - * - * @api - */ - public function getArguments() - { - return $this->arguments; - } - - /** - * Gets an argument to pass to the service constructor/factory method. - * - * @param integer $index - * - * @return mixed The argument value - * - * @api - */ - public function getArgument($index) - { - if ($index < 0 || $index > count($this->arguments) - 1) { - throw new OutOfBoundsException(sprintf('The index "%d" is not in the range [0, %d].', $index, count($this->arguments) - 1)); - } - - return $this->arguments[$index]; - } - - /** - * Sets the methods to call after service initialization. - * - * @param array $calls An array of method calls - * - * @return Definition The current instance - * - * @api - */ - public function setMethodCalls(array $calls = array()) - { - $this->calls = array(); - foreach ($calls as $call) { - $this->addMethodCall($call[0], $call[1]); - } - - return $this; - } - - /** - * Adds a method to call after service initialization. - * - * @param string $method The method name to call - * @param array $arguments An array of arguments to pass to the method call - * - * @return Definition The current instance - * - * @throws InvalidArgumentException on empty $method param - * - * @api - */ - public function addMethodCall($method, array $arguments = array()) - { - if (empty($method)) { - throw new InvalidArgumentException(sprintf('Method name cannot be empty.')); - } - $this->calls[] = array($method, $arguments); - - return $this; - } - - /** - * Removes a method to call after service initialization. - * - * @param string $method The method name to remove - * - * @return Definition The current instance - * - * @api - */ - public function removeMethodCall($method) - { - foreach ($this->calls as $i => $call) { - if ($call[0] === $method) { - unset($this->calls[$i]); - break; - } - } - - return $this; - } - - /** - * Check if the current definition has a given method to call after service initialization. - * - * @param string $method The method name to search for - * - * @return Boolean - * - * @api - */ - public function hasMethodCall($method) - { - foreach ($this->calls as $call) { - if ($call[0] === $method) { - return true; - } - } - - return false; - } - - /** - * Gets the methods to call after service initialization. - * - * @return array An array of method calls - * - * @api - */ - public function getMethodCalls() - { - return $this->calls; - } - - /** - * Sets tags for this definition - * - * @param array $tags - * - * @return Definition the current instance - * - * @api - */ - public function setTags(array $tags) - { - $this->tags = $tags; - - return $this; - } - - /** - * Returns all tags. - * - * @return array An array of tags - * - * @api - */ - public function getTags() - { - return $this->tags; - } - - /** - * Gets a tag by name. - * - * @param string $name The tag name - * - * @return array An array of attributes - * - * @api - */ - public function getTag($name) - { - return isset($this->tags[$name]) ? $this->tags[$name] : array(); - } - - /** - * Adds a tag for this definition. - * - * @param string $name The tag name - * @param array $attributes An array of attributes - * - * @return Definition The current instance - * - * @api - */ - public function addTag($name, array $attributes = array()) - { - $this->tags[$name][] = $attributes; - - return $this; - } - - /** - * Whether this definition has a tag with the given name - * - * @param string $name - * - * @return Boolean - * - * @api - */ - public function hasTag($name) - { - return isset($this->tags[$name]); - } - - /** - * Clears all tags for a given name. - * - * @param string $name The tag name - * - * @return Definition - */ - public function clearTag($name) - { - if (isset($this->tags[$name])) { - unset($this->tags[$name]); - } - - return $this; - } - - /** - * Clears the tags for this definition. - * - * @return Definition The current instance - * - * @api - */ - public function clearTags() - { - $this->tags = array(); - - return $this; - } - - /** - * Sets a file to require before creating the service. - * - * @param string $file A full pathname to include - * - * @return Definition The current instance - * - * @api - */ - public function setFile($file) - { - $this->file = $file; - - return $this; - } - - /** - * Gets the file to require before creating the service. - * - * @return string The full pathname to include - * - * @api - */ - public function getFile() - { - return $this->file; - } - - /** - * Sets the scope of the service - * - * @param string $scope Whether the service must be shared or not - * - * @return Definition The current instance - * - * @api - */ - public function setScope($scope) - { - $this->scope = $scope; - - return $this; - } - - /** - * Returns the scope of the service - * - * @return string - * - * @api - */ - public function getScope() - { - return $this->scope; - } - - /** - * Sets the visibility of this service. - * - * @param Boolean $boolean - * - * @return Definition The current instance - * - * @api - */ - public function setPublic($boolean) - { - $this->public = (Boolean) $boolean; - - return $this; - } - - /** - * Whether this service is public facing - * - * @return Boolean - * - * @api - */ - public function isPublic() - { - return $this->public; - } - - /** - * Sets whether this definition is synthetic, that is not constructed by the - * container, but dynamically injected. - * - * @param Boolean $boolean - * - * @return Definition the current instance - * - * @api - */ - public function setSynthetic($boolean) - { - $this->synthetic = (Boolean) $boolean; - - return $this; - } - - /** - * Whether this definition is synthetic, that is not constructed by the - * container, but dynamically injected. - * - * @return Boolean - * - * @api - */ - public function isSynthetic() - { - return $this->synthetic; - } - - /** - * Whether this definition is abstract, that means it merely serves as a - * template for other definitions. - * - * @param Boolean $boolean - * - * @return Definition the current instance - * - * @api - */ - public function setAbstract($boolean) - { - $this->abstract = (Boolean) $boolean; - - return $this; - } - - /** - * Whether this definition is abstract, that means it merely serves as a - * template for other definitions. - * - * @return Boolean - * - * @api - */ - public function isAbstract() - { - return $this->abstract; - } - - /** - * Sets a configurator to call after the service is fully initialized. - * - * @param mixed $callable A PHP callable - * - * @return Definition The current instance - * - * @api - */ - public function setConfigurator($callable) - { - $this->configurator = $callable; - - return $this; - } - - /** - * Gets the configurator to call after the service is fully initialized. - * - * @return mixed The PHP callable to call - * - * @api - */ - public function getConfigurator() - { - return $this->configurator; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/DefinitionDecorator.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/DefinitionDecorator.php deleted file mode 100644 index 0306f75..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/DefinitionDecorator.php +++ /dev/null @@ -1,205 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection; - -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\DependencyInjection\Exception\OutOfBoundsException; - -/** - * This definition decorates another definition. - * - * @author Johannes M. Schmitt - * - * @api - */ -class DefinitionDecorator extends Definition -{ - private $parent; - private $changes; - - /** - * Constructor. - * - * @param Definition $parent The Definition instance to decorate. - * - * @api - */ - public function __construct($parent) - { - parent::__construct(); - - $this->parent = $parent; - $this->changes = array(); - } - - /** - * Returns the Definition being decorated. - * - * @return Definition - * - * @api - */ - public function getParent() - { - return $this->parent; - } - - /** - * Returns all changes tracked for the Definition object. - * - * @return array An array of changes for this Definition - * - * @api - */ - public function getChanges() - { - return $this->changes; - } - - /** - * {@inheritDoc} - * - * @api - */ - public function setClass($class) - { - $this->changes['class'] = true; - - return parent::setClass($class); - } - - /** - * {@inheritDoc} - * - * @api - */ - public function setFactoryClass($class) - { - $this->changes['factory_class'] = true; - - return parent::setFactoryClass($class); - } - - /** - * {@inheritDoc} - * - * @api - */ - public function setFactoryMethod($method) - { - $this->changes['factory_method'] = true; - - return parent::setFactoryMethod($method); - } - - /** - * {@inheritDoc} - * - * @api - */ - public function setFactoryService($service) - { - $this->changes['factory_service'] = true; - - return parent::setFactoryService($service); - } - - /** - * {@inheritDoc} - * - * @api - */ - public function setConfigurator($callable) - { - $this->changes['configurator'] = true; - - return parent::setConfigurator($callable); - } - - /** - * {@inheritDoc} - * - * @api - */ - public function setFile($file) - { - $this->changes['file'] = true; - - return parent::setFile($file); - } - - /** - * {@inheritDoc} - * - * @api - */ - public function setPublic($boolean) - { - $this->changes['public'] = true; - - return parent::setPublic($boolean); - } - - /** - * Gets an argument to pass to the service constructor/factory method. - * - * If replaceArgument() has been used to replace an argument, this method - * will return the replacement value. - * - * @param integer $index - * - * @return mixed The argument value - * - * @api - */ - public function getArgument($index) - { - if (array_key_exists('index_'.$index, $this->arguments)) { - return $this->arguments['index_'.$index]; - } - - $lastIndex = count(array_filter(array_keys($this->arguments), 'is_int')) - 1; - - if ($index < 0 || $index > $lastIndex) { - throw new OutOfBoundsException(sprintf('The index "%d" is not in the range [0, %d].', $index, $lastIndex)); - } - - return $this->arguments[$index]; - } - - /** - * You should always use this method when overwriting existing arguments - * of the parent definition. - * - * If you directly call setArguments() keep in mind that you must follow - * certain conventions when you want to overwrite the arguments of the - * parent definition, otherwise your arguments will only be appended. - * - * @param integer $index - * @param mixed $value - * - * @return DefinitionDecorator the current instance - * @throws InvalidArgumentException when $index isn't an integer - * - * @api - */ - public function replaceArgument($index, $value) - { - if (!is_int($index)) { - throw new InvalidArgumentException('$index must be an integer.'); - } - - $this->arguments['index_'.$index] = $value; - - return $this; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/Dumper.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/Dumper.php deleted file mode 100644 index 9892401..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/Dumper.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Dumper; - -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * Dumper is the abstract class for all built-in dumpers. - * - * @author Fabien Potencier - * - * @api - */ -abstract class Dumper implements DumperInterface -{ - protected $container; - - /** - * Constructor. - * - * @param ContainerBuilder $container The service container to dump - * - * @api - */ - public function __construct(ContainerBuilder $container) - { - $this->container = $container; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/DumperInterface.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/DumperInterface.php deleted file mode 100644 index ba146f6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/DumperInterface.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Dumper; - -/** - * DumperInterface is the interface implemented by service container dumper classes. - * - * @author Fabien Potencier - * - * @api - */ -interface DumperInterface -{ - /** - * Dumps the service container. - * - * @param array $options An array of options - * - * @return string The representation of the service container - * - * @api - */ - public function dump(array $options = array()); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php deleted file mode 100644 index debdc52..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php +++ /dev/null @@ -1,273 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Dumper; - -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Parameter; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * GraphvizDumper dumps a service container as a graphviz file. - * - * You can convert the generated dot file with the dot utility (http://www.graphviz.org/): - * - * dot -Tpng container.dot > foo.png - * - * @author Fabien Potencier - */ -class GraphvizDumper extends Dumper -{ - private $nodes; - private $edges; - private $options = array( - 'graph' => array('ratio' => 'compress'), - 'node' => array('fontsize' => 11, 'fontname' => 'Arial', 'shape' => 'record'), - 'edge' => array('fontsize' => 9, 'fontname' => 'Arial', 'color' => 'grey', 'arrowhead' => 'open', 'arrowsize' => 0.5), - 'node.instance' => array('fillcolor' => '#9999ff', 'style' => 'filled'), - 'node.definition' => array('fillcolor' => '#eeeeee'), - 'node.missing' => array('fillcolor' => '#ff9999', 'style' => 'filled'), - ); - - /** - * Dumps the service container as a graphviz graph. - * - * Available options: - * - * * graph: The default options for the whole graph - * * node: The default options for nodes - * * edge: The default options for edges - * * node.instance: The default options for services that are defined directly by object instances - * * node.definition: The default options for services that are defined via service definition instances - * * node.missing: The default options for missing services - * - * @param array $options An array of options - * - * @return string The dot representation of the service container - */ - public function dump(array $options = array()) - { - foreach (array('graph', 'node', 'edge', 'node.instance', 'node.definition', 'node.missing') as $key) { - if (isset($options[$key])) { - $this->options[$key] = array_merge($this->options[$key], $options[$key]); - } - } - - $this->nodes = $this->findNodes(); - - $this->edges = array(); - foreach ($this->container->getDefinitions() as $id => $definition) { - $this->edges[$id] = array_merge( - $this->findEdges($id, $definition->getArguments(), true, ''), - $this->findEdges($id, $definition->getProperties(), false, '') - ); - - foreach ($definition->getMethodCalls() as $call) { - $this->edges[$id] = array_merge( - $this->edges[$id], - $this->findEdges($id, $call[1], false, $call[0].'()') - ); - } - } - - return $this->startDot().$this->addNodes().$this->addEdges().$this->endDot(); - } - - /** - * Returns all nodes. - * - * @return string A string representation of all nodes - */ - private function addNodes() - { - $code = ''; - foreach ($this->nodes as $id => $node) { - $aliases = $this->getAliases($id); - - $code .= sprintf(" node_%s [label=\"%s\\n%s\\n\", shape=%s%s];\n", $this->dotize($id), $id.($aliases ? ' ('.implode(', ', $aliases).')' : ''), $node['class'], $this->options['node']['shape'], $this->addAttributes($node['attributes'])); - } - - return $code; - } - - /** - * Returns all edges. - * - * @return string A string representation of all edges - */ - private function addEdges() - { - $code = ''; - foreach ($this->edges as $id => $edges) { - foreach ($edges as $edge) { - $code .= sprintf(" node_%s -> node_%s [label=\"%s\" style=\"%s\"];\n", $this->dotize($id), $this->dotize($edge['to']), $edge['name'], $edge['required'] ? 'filled' : 'dashed'); - } - } - - return $code; - } - - /** - * Finds all edges belonging to a specific service id. - * - * @param string $id The service id used to find edges - * @param array $arguments An array of arguments - * @param Boolean $required - * @param string $name - * - * @return array An array of edges - */ - private function findEdges($id, $arguments, $required, $name) - { - $edges = array(); - foreach ($arguments as $argument) { - if (is_object($argument) && $argument instanceof Parameter) { - $argument = $this->container->hasParameter($argument) ? $this->container->getParameter($argument) : null; - } elseif (is_string($argument) && preg_match('/^%([^%]+)%$/', $argument, $match)) { - $argument = $this->container->hasParameter($match[1]) ? $this->container->getParameter($match[1]) : null; - } - - if ($argument instanceof Reference) { - if (!$this->container->has((string) $argument)) { - $this->nodes[(string) $argument] = array('name' => $name, 'required' => $required, 'class' => '', 'attributes' => $this->options['node.missing']); - } - - $edges[] = array('name' => $name, 'required' => $required, 'to' => $argument); - } elseif (is_array($argument)) { - $edges = array_merge($edges, $this->findEdges($id, $argument, $required, $name)); - } - } - - return $edges; - } - - /** - * Finds all nodes. - * - * @return array An array of all nodes - */ - private function findNodes() - { - $nodes = array(); - - $container = clone $this->container; - - foreach ($container->getDefinitions() as $id => $definition) { - $nodes[$id] = array('class' => str_replace('\\', '\\\\', $this->container->getParameterBag()->resolveValue($definition->getClass())), 'attributes' => array_merge($this->options['node.definition'], array('style' => ContainerInterface::SCOPE_PROTOTYPE !== $definition->getScope() ? 'filled' : 'dotted'))); - - $container->setDefinition($id, new Definition('stdClass')); - } - - foreach ($container->getServiceIds() as $id) { - $service = $container->get($id); - - if (in_array($id, array_keys($container->getAliases()))) { - continue; - } - - if (!$container->hasDefinition($id)) { - $nodes[$id] = array('class' => str_replace('\\', '\\\\', get_class($service)), 'attributes' => $this->options['node.instance']); - } - } - - return $nodes; - } - - /** - * Returns the start dot. - * - * @return string The string representation of a start dot - */ - private function startDot() - { - return sprintf("digraph sc {\n %s\n node [%s];\n edge [%s];\n\n", - $this->addOptions($this->options['graph']), - $this->addOptions($this->options['node']), - $this->addOptions($this->options['edge']) - ); - } - - /** - * Returns the end dot. - * - * @return string - */ - private function endDot() - { - return "}\n"; - } - - /** - * Adds attributes - * - * @param array $attributes An array of attributes - * - * @return string A comma separated list of attributes - */ - private function addAttributes($attributes) - { - $code = array(); - foreach ($attributes as $k => $v) { - $code[] = sprintf('%s="%s"', $k, $v); - } - - return $code ? ', '.implode(', ', $code) : ''; - } - - /** - * Adds options - * - * @param array $options An array of options - * - * @return string A space separated list of options - */ - private function addOptions($options) - { - $code = array(); - foreach ($options as $k => $v) { - $code[] = sprintf('%s="%s"', $k, $v); - } - - return implode(' ', $code); - } - - /** - * Dotizes an identifier. - * - * @param string $id The identifier to dotize - * - * @return string A dotized string - */ - private function dotize($id) - { - return strtolower(preg_replace('/[^\w]/i', '_', $id)); - } - - /** - * Compiles an array of aliases for a specified service id. - * - * @param string $id A service id - * - * @return array An array of aliases - */ - private function getAliases($id) - { - $aliases = array(); - foreach ($this->container->getAliases() as $alias => $origin) { - if ($id == $origin) { - $aliases[] = $alias; - } - } - - return $aliases; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php deleted file mode 100644 index 4d34e55..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ /dev/null @@ -1,1136 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Dumper; - -use Symfony\Component\DependencyInjection\Variable; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Container; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Parameter; -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; -use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; - -/** - * PhpDumper dumps a service container as a PHP class. - * - * @author Fabien Potencier - * @author Johannes M. Schmitt - * - * @api - */ -class PhpDumper extends Dumper -{ - /** - * Characters that might appear in the generated variable name as first character - * @var string - */ - const FIRST_CHARS = 'abcdefghijklmnopqrstuvwxyz'; - - /** - * Characters that might appear in the generated variable name as any but the first character - * @var string - */ - const NON_FIRST_CHARS = 'abcdefghijklmnopqrstuvwxyz0123456789_'; - - private $inlinedDefinitions; - private $definitionVariables; - private $referenceVariables; - private $variableCount; - private $reservedVariables = array('instance', 'class'); - - /** - * {@inheritDoc} - * - * @api - */ - public function __construct(ContainerBuilder $container) - { - parent::__construct($container); - - $this->inlinedDefinitions = new \SplObjectStorage; - } - - /** - * Dumps the service container as a PHP class. - * - * Available options: - * - * * class: The class name - * * base_class: The base class name - * - * @param array $options An array of options - * - * @return string A PHP class representing of the service container - * - * @api - */ - public function dump(array $options = array()) - { - $options = array_merge(array( - 'class' => 'ProjectServiceContainer', - 'base_class' => 'Container', - ), $options); - - $code = $this->startClass($options['class'], $options['base_class']); - - if ($this->container->isFrozen()) { - $code .= $this->addFrozenConstructor(); - } else { - $code .= $this->addConstructor(); - } - - $code .= - $this->addServices(). - $this->addDefaultParametersMethod(). - $this->endClass() - ; - - return $code; - } - - /** - * Generates Service local temp variables. - * - * @param string $cId - * @param string $definition - * - * @return string - */ - private function addServiceLocalTempVariables($cId, $definition) - { - static $template = " \$%s = %s;\n"; - - $localDefinitions = array_merge( - array($definition), - $this->getInlinedDefinitions($definition) - ); - - $calls = $behavior = array(); - foreach ($localDefinitions as $iDefinition) { - $this->getServiceCallsFromArguments($iDefinition->getArguments(), $calls, $behavior); - $this->getServiceCallsFromArguments($iDefinition->getMethodCalls(), $calls, $behavior); - $this->getServiceCallsFromArguments($iDefinition->getProperties(), $calls, $behavior); - } - - $code = ''; - foreach ($calls as $id => $callCount) { - if ('service_container' === $id || $id === $cId) { - continue; - } - - if ($callCount > 1) { - $name = $this->getNextVariableName(); - $this->referenceVariables[$id] = new Variable($name); - - if (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE === $behavior[$id]) { - $code .= sprintf($template, $name, $this->getServiceCall($id)); - } else { - $code .= sprintf($template, $name, $this->getServiceCall($id, new Reference($id, ContainerInterface::NULL_ON_INVALID_REFERENCE))); - } - } - } - - if ('' !== $code) { - $code .= "\n"; - } - - return $code; - } - - /** - * Generates the require_once statement for service includes. - * - * @param string $id The service id - * @param Definition $definition - * - * @return string - */ - private function addServiceInclude($id, $definition) - { - $template = " require_once %s;\n"; - $code = ''; - - if (null !== $file = $definition->getFile()) { - $code .= sprintf($template, $this->dumpValue($file)); - } - - foreach ($this->getInlinedDefinitions($definition) as $definition) { - if (null !== $file = $definition->getFile()) { - $code .= sprintf($template, $this->dumpValue($file)); - } - } - - if ('' !== $code) { - $code .= "\n"; - } - - return $code; - } - - /** - * Generates the inline definition of a service. - * - * @param string $id - * @param Definition $definition - * - * @return string - */ - private function addServiceInlinedDefinitions($id, $definition) - { - $code = ''; - $variableMap = $this->definitionVariables; - $nbOccurrences = new \SplObjectStorage(); - $processed = new \SplObjectStorage(); - $inlinedDefinitions = $this->getInlinedDefinitions($definition); - - foreach ($inlinedDefinitions as $definition) { - if (false === $nbOccurrences->contains($definition)) { - $nbOccurrences->offsetSet($definition, 1); - } else { - $i = $nbOccurrences->offsetGet($definition); - $nbOccurrences->offsetSet($definition, $i+1); - } - } - - foreach ($inlinedDefinitions as $sDefinition) { - if ($processed->contains($sDefinition)) { - continue; - } - $processed->offsetSet($sDefinition); - - $class = $this->dumpValue($sDefinition->getClass()); - if ($nbOccurrences->offsetGet($sDefinition) > 1 || count($sDefinition->getMethodCalls()) > 0 || $sDefinition->getProperties() || null !== $sDefinition->getConfigurator() || false !== strpos($class, '$')) { - $name = $this->getNextVariableName(); - $variableMap->offsetSet($sDefinition, new Variable($name)); - - // a construct like: - // $a = new ServiceA(ServiceB $b); $b = new ServiceB(ServiceA $a); - // this is an indication for a wrong implementation, you can circumvent this problem - // by setting up your service structure like this: - // $b = new ServiceB(); - // $a = new ServiceA(ServiceB $b); - // $b->setServiceA(ServiceA $a); - if ($this->hasReference($id, $sDefinition->getArguments())) { - throw new ServiceCircularReferenceException($id, array($id)); - } - - $arguments = array(); - foreach ($sDefinition->getArguments() as $argument) { - $arguments[] = $this->dumpValue($argument); - } - - if (null !== $sDefinition->getFactoryMethod()) { - if (null !== $sDefinition->getFactoryClass()) { - $code .= sprintf(" \$%s = call_user_func(array(%s, '%s')%s);\n", $name, $this->dumpValue($sDefinition->getFactoryClass()), $sDefinition->getFactoryMethod(), count($arguments) > 0 ? ', '.implode(', ', $arguments) : ''); - } elseif (null !== $sDefinition->getFactoryService()) { - $code .= sprintf(" \$%s = %s->%s(%s);\n", $name, $this->getServiceCall($sDefinition->getFactoryService()), $sDefinition->getFactoryMethod(), implode(', ', $arguments)); - } else { - throw new RuntimeException('Factory service or factory class must be defined in service definition for '.$id); - } - } elseif (false !== strpos($class, '$')) { - $code .= sprintf(" \$class = %s;\n \$%s = new \$class(%s);\n", $class, $name, implode(', ', $arguments)); - } else { - $code .= sprintf(" \$%s = new \\%s(%s);\n", $name, substr(str_replace('\\\\', '\\', $class), 1, -1), implode(', ', $arguments)); - } - - if (!$this->hasReference($id, $sDefinition->getMethodCalls()) && !$this->hasReference($id, $sDefinition->getProperties())) { - $code .= $this->addServiceMethodCalls(null, $sDefinition, $name); - $code .= $this->addServiceProperties(null, $sDefinition, $name); - $code .= $this->addServiceConfigurator(null, $sDefinition, $name); - } - - $code .= "\n"; - } - } - - return $code; - } - - /** - * Adds the service return statement. - * - * @param string $id Service id - * @param Definition $definition - * - * @return string - */ - private function addServiceReturn($id, $definition) - { - if ($this->isSimpleInstance($id, $definition)) { - return " }\n"; - } - - return "\n return \$instance;\n }\n"; - } - - /** - * Generates the service instance. - * - * @param string $id - * @param Definition $definition - * - * @return string - * - * @throws InvalidArgumentException - * @throws RuntimeException - */ - private function addServiceInstance($id, $definition) - { - $class = $this->dumpValue($definition->getClass()); - - if (0 === strpos($class, "'") && !preg_match('/^\'[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\\\{2}[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)*\'$/', $class)) { - throw new InvalidArgumentException(sprintf('"%s" is not a valid class name for the "%s" service.', $class, $id)); - } - - $arguments = array(); - foreach ($definition->getArguments() as $value) { - $arguments[] = $this->dumpValue($value); - } - - $simple = $this->isSimpleInstance($id, $definition); - - $instantiation = ''; - if (ContainerInterface::SCOPE_CONTAINER === $definition->getScope()) { - $instantiation = "\$this->services['$id'] = ".($simple ? '' : '$instance'); - } elseif (ContainerInterface::SCOPE_PROTOTYPE !== $scope = $definition->getScope()) { - $instantiation = "\$this->services['$id'] = \$this->scopedServices['$scope']['$id'] = ".($simple ? '' : '$instance'); - } elseif (!$simple) { - $instantiation = '$instance'; - } - - $return = ''; - if ($simple) { - $return = 'return '; - } else { - $instantiation .= ' = '; - } - - if (null !== $definition->getFactoryMethod()) { - if (null !== $definition->getFactoryClass()) { - $code = sprintf(" $return{$instantiation}call_user_func(array(%s, '%s')%s);\n", $this->dumpValue($definition->getFactoryClass()), $definition->getFactoryMethod(), $arguments ? ', '.implode(', ', $arguments) : ''); - } elseif (null !== $definition->getFactoryService()) { - $code = sprintf(" $return{$instantiation}%s->%s(%s);\n", $this->getServiceCall($definition->getFactoryService()), $definition->getFactoryMethod(), implode(', ', $arguments)); - } else { - throw new RuntimeException('Factory method requires a factory service or factory class in service definition for '.$id); - } - } elseif (false !== strpos($class, '$')) { - $code = sprintf(" \$class = %s;\n\n $return{$instantiation}new \$class(%s);\n", $class, implode(', ', $arguments)); - } else { - $code = sprintf(" $return{$instantiation}new \\%s(%s);\n", substr(str_replace('\\\\', '\\', $class), 1, -1), implode(', ', $arguments)); - } - - if (!$simple) { - $code .= "\n"; - } - - return $code; - } - - /** - * Checks if the definition is a simple instance. - * - * @param string $id - * @param Definition $definition - * - * @return Boolean - */ - private function isSimpleInstance($id, $definition) - { - foreach (array_merge(array($definition), $this->getInlinedDefinitions($definition)) as $sDefinition) { - if ($definition !== $sDefinition && !$this->hasReference($id, $sDefinition->getMethodCalls())) { - continue; - } - - if ($sDefinition->getMethodCalls() || $sDefinition->getProperties() || $sDefinition->getConfigurator()) { - return false; - } - } - - return true; - } - - /** - * Adds method calls to a service definition. - * - * @param string $id - * @param Definition $definition - * @param string $variableName - * - * @return string - */ - private function addServiceMethodCalls($id, $definition, $variableName = 'instance') - { - $calls = ''; - foreach ($definition->getMethodCalls() as $call) { - $arguments = array(); - foreach ($call[1] as $value) { - $arguments[] = $this->dumpValue($value); - } - - $calls .= $this->wrapServiceConditionals($call[1], sprintf(" \$%s->%s(%s);\n", $variableName, $call[0], implode(', ', $arguments))); - } - - return $calls; - } - - private function addServiceProperties($id, $definition, $variableName = 'instance') - { - $code = ''; - foreach ($definition->getProperties() as $name => $value) { - $code .= sprintf(" \$%s->%s = %s;\n", $variableName, $name, $this->dumpValue($value)); - } - - return $code; - } - - /** - * Generates the inline definition setup. - * - * @param string $id - * @param Definition $definition - * @return string - */ - private function addServiceInlinedDefinitionsSetup($id, $definition) - { - $this->referenceVariables[$id] = new Variable('instance'); - - $code = ''; - $processed = new \SplObjectStorage(); - foreach ($this->getInlinedDefinitions($definition) as $iDefinition) { - if ($processed->contains($iDefinition)) { - continue; - } - $processed->offsetSet($iDefinition); - - if (!$this->hasReference($id, $iDefinition->getMethodCalls())) { - continue; - } - - if ($iDefinition->getMethodCalls()) { - $code .= $this->addServiceMethodCalls(null, $iDefinition, (string) $this->definitionVariables->offsetGet($iDefinition)); - } - if ($iDefinition->getConfigurator()) { - $code .= $this->addServiceConfigurator(null, $iDefinition, (string) $this->definitionVariables->offsetGet($iDefinition)); - } - } - - if ('' !== $code) { - $code .= "\n"; - } - - return $code; - } - - /** - * Adds configurator definition - * - * @param string $id - * @param Definition $definition - * @param string $variableName - * - * @return string - */ - private function addServiceConfigurator($id, $definition, $variableName = 'instance') - { - if (!$callable = $definition->getConfigurator()) { - return ''; - } - - if (is_array($callable)) { - if (is_object($callable[0]) && $callable[0] instanceof Reference) { - return sprintf(" %s->%s(\$%s);\n", $this->getServiceCall((string) $callable[0]), $callable[1], $variableName); - } - - return sprintf(" call_user_func(array(%s, '%s'), \$%s);\n", $this->dumpValue($callable[0]), $callable[1], $variableName); - } - - return sprintf(" %s(\$%s);\n", $callable, $variableName); - } - - /** - * Adds a service - * - * @param string $id - * @param Definition $definition - * - * @return string - */ - private function addService($id, $definition) - { - $name = Container::camelize($id); - $this->definitionVariables = new \SplObjectStorage(); - $this->referenceVariables = array(); - $this->variableCount = 0; - - $return = ''; - if ($definition->isSynthetic()) { - $return = sprintf('@throws RuntimeException always since this service is expected to be injected dynamically'); - } elseif ($class = $definition->getClass()) { - $return = sprintf("@return %s A %s instance.", 0 === strpos($class, '%') ? 'Object' : $class, $class); - } elseif ($definition->getFactoryClass()) { - $return = sprintf('@return Object An instance returned by %s::%s().', $definition->getFactoryClass(), $definition->getFactoryMethod()); - } elseif ($definition->getFactoryService()) { - $return = sprintf('@return Object An instance returned by %s::%s().', $definition->getFactoryService(), $definition->getFactoryMethod()); - } - - $doc = ''; - if (ContainerInterface::SCOPE_PROTOTYPE !== $definition->getScope()) { - $doc .= <<isPublic()) { - $doc .= <<getScope(); - if (ContainerInterface::SCOPE_CONTAINER !== $scope && ContainerInterface::SCOPE_PROTOTYPE !== $scope) { - $code .= <<scopedServices['$scope'])) { - throw new InactiveScopeException('$id', '$scope'); - } - - -EOF; - } - - if ($definition->isSynthetic()) { - $code .= sprintf(" throw new RuntimeException('You have requested a synthetic service (\"%s\"). The DIC does not know how to construct this service.');\n }\n", $id); - } else { - $code .= - $this->addServiceInclude($id, $definition). - $this->addServiceLocalTempVariables($id, $definition). - $this->addServiceInlinedDefinitions($id, $definition). - $this->addServiceInstance($id, $definition). - $this->addServiceInlinedDefinitionsSetup($id, $definition). - $this->addServiceMethodCalls($id, $definition). - $this->addServiceProperties($id, $definition). - $this->addServiceConfigurator($id, $definition). - $this->addServiceReturn($id, $definition) - ; - } - - $this->definitionVariables = null; - $this->referenceVariables = null; - - return $code; - } - - /** - * Adds a service alias. - * - * @param string $alias - * @param string $id - * - * @return string - */ - private function addServiceAlias($alias, $id) - { - $name = Container::camelize($alias); - $type = 'Object'; - - if ($this->container->hasDefinition($id)) { - $class = $this->container->getDefinition($id)->getClass(); - $type = 0 === strpos($class, '%') ? 'Object' : $class; - } - - return <<getServiceCall($id)}; - } - -EOF; - } - - /** - * Adds multiple services - * - * @return string - */ - private function addServices() - { - $publicServices = $privateServices = $aliasServices = ''; - $definitions = $this->container->getDefinitions(); - ksort($definitions); - foreach ($definitions as $id => $definition) { - if ($definition->isPublic()) { - $publicServices .= $this->addService($id, $definition); - } else { - $privateServices .= $this->addService($id, $definition); - } - } - - $aliases = $this->container->getAliases(); - ksort($aliases); - foreach ($aliases as $alias => $id) { - $aliasServices .= $this->addServiceAlias($alias, $id); - } - - return $publicServices.$aliasServices.$privateServices; - } - - /** - * Adds the class headers. - * - * @param string $class Class name - * @param string $baseClass The name of the base class - * - * @return string - */ - private function startClass($class, $baseClass) - { - $bagClass = $this->container->isFrozen() ? 'use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;' : 'use Symfony\Component\DependencyInjection\ParameterBag\\ParameterBag;'; - - return <<container->getParameterBag()->all() ? 'new ParameterBag($this->getDefaultParameters())' : null; - - $code = <<container->getScopes()) > 0) { - $code .= "\n"; - $code .= " \$this->scopes = ".$this->dumpValue($scopes).";\n"; - $code .= " \$this->scopeChildren = ".$this->dumpValue($this->container->getScopeChildren()).";\n"; - } - - $code .= <<parameters = \$this->getDefaultParameters(); - - \$this->services = - \$this->scopedServices = - \$this->scopeStacks = array(); - - \$this->set('service_container', \$this); - -EOF; - - $code .= "\n"; - if (count($scopes = $this->container->getScopes()) > 0) { - $code .= " \$this->scopes = ".$this->dumpValue($scopes).";\n"; - $code .= " \$this->scopeChildren = ".$this->dumpValue($this->container->getScopeChildren()).";\n"; - } else { - $code .= " \$this->scopes = array();\n"; - $code .= " \$this->scopeChildren = array();\n"; - } - - $code .= <<container->getParameterBag()->all()) { - return ''; - } - - $parameters = $this->exportParameters($this->container->getParameterBag()->all()); - - $code = ''; - if ($this->container->isFrozen()) { - $code .= <<parameters)) { - throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', \$name)); - } - - return \$this->parameters[\$name]; - } - - /** - * {@inheritdoc} - */ - public function hasParameter(\$name) - { - return array_key_exists(strtolower(\$name), \$this->parameters); - } - - /** - * {@inheritdoc} - */ - public function setParameter(\$name, \$value) - { - throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); - } - - /** - * {@inheritDoc} - */ - public function getParameterBag() - { - if (null === \$this->parameterBag) { - \$this->parameterBag = new FrozenParameterBag(\$this->parameters); - } - - return \$this->parameterBag; - } -EOF; - } - - $code .= << $value) { - if (is_array($value)) { - $value = $this->exportParameters($value, $path.'/'.$key, $indent + 4); - } elseif ($value instanceof Variable) { - throw new InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain variable references. Variable "%s" found in "%s".', $value, $path.'/'.$key)); - } elseif ($value instanceof Definition) { - throw new InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain service definitions. Definition for "%s" found in "%s".', $value->getClass(), $path.'/'.$key)); - } elseif ($value instanceof Reference) { - throw new InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain references to other services (reference to service "%s" found in "%s").', $value, $path.'/'.$key)); - } else { - $value = var_export($value, true); - } - - $php[] = sprintf('%s%s => %s,', str_repeat(' ', $indent), var_export($key, true), $value); - } - - return sprintf("array(\n%s\n%s)", implode("\n", $php), str_repeat(' ', $indent - 4)); - } - - /** - * Ends the class definition. - * - * @return string - */ - private function endClass() - { - return <<has('%s')", $service); - } - - // re-indent the wrapped code - $code = implode("\n", array_map(function ($line) { return $line ? ' '.$line : $line; }, explode("\n", $code))); - - return sprintf(" if (%s) {\n%s }\n", implode(' && ', $conditions), $code); - } - - /** - * Builds service calls from arguments - * - * @param array $arguments - * @param string &$calls By reference - * @param string &$behavior By reference - */ - private function getServiceCallsFromArguments(array $arguments, array &$calls, array &$behavior) - { - foreach ($arguments as $argument) { - if (is_array($argument)) { - $this->getServiceCallsFromArguments($argument, $calls, $behavior); - } elseif ($argument instanceof Reference) { - $id = (string) $argument; - - if (!isset($calls[$id])) { - $calls[$id] = 0; - } - if (!isset($behavior[$id])) { - $behavior[$id] = $argument->getInvalidBehavior(); - } elseif (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $behavior[$id]) { - $behavior[$id] = $argument->getInvalidBehavior(); - } - - $calls[$id] += 1; - } - } - } - - /** - * Returns the inline definition - * - * @param Definition $definition - * - * @return array - */ - private function getInlinedDefinitions(Definition $definition) - { - if (false === $this->inlinedDefinitions->contains($definition)) { - $definitions = array_merge( - $this->getDefinitionsFromArguments($definition->getArguments()), - $this->getDefinitionsFromArguments($definition->getMethodCalls()), - $this->getDefinitionsFromArguments($definition->getProperties()) - ); - - $this->inlinedDefinitions->offsetSet($definition, $definitions); - - return $definitions; - } - - return $this->inlinedDefinitions->offsetGet($definition); - } - - /** - * Gets the definition from arguments - * - * @param array $arguments - * - * @return array - */ - private function getDefinitionsFromArguments(array $arguments) - { - $definitions = array(); - foreach ($arguments as $argument) { - if (is_array($argument)) { - $definitions = array_merge($definitions, $this->getDefinitionsFromArguments($argument)); - } elseif ($argument instanceof Definition) { - $definitions = array_merge( - $definitions, - $this->getInlinedDefinitions($argument), - array($argument) - ); - } - } - - return $definitions; - } - - /** - * Checks if a service id has a reference - * - * @param string $id - * @param array $arguments - * - * @return Boolean - */ - private function hasReference($id, array $arguments) - { - foreach ($arguments as $argument) { - if (is_array($argument)) { - if ($this->hasReference($id, $argument)) { - return true; - } - } elseif ($argument instanceof Reference) { - if ($id === (string) $argument) { - return true; - } - } - } - - return false; - } - - /** - * Dumps values. - * - * @param array $value - * @param Boolean $interpolate - * - * @return string - */ - private function dumpValue($value, $interpolate = true) - { - if (is_array($value)) { - $code = array(); - foreach ($value as $k => $v) { - $code[] = sprintf('%s => %s', $this->dumpValue($k, $interpolate), $this->dumpValue($v, $interpolate)); - } - - return sprintf('array(%s)', implode(', ', $code)); - } elseif (is_object($value) && $value instanceof Definition) { - if (null !== $this->definitionVariables && $this->definitionVariables->contains($value)) { - return $this->dumpValue($this->definitionVariables->offsetGet($value), $interpolate); - } - if (count($value->getMethodCalls()) > 0) { - throw new RuntimeException('Cannot dump definitions which have method calls.'); - } - if (null !== $value->getConfigurator()) { - throw new RuntimeException('Cannot dump definitions which have a configurator.'); - } - - $arguments = array(); - foreach ($value->getArguments() as $argument) { - $arguments[] = $this->dumpValue($argument); - } - $class = $this->dumpValue($value->getClass()); - - if (false !== strpos($class, '$')) { - throw new RuntimeException('Cannot dump definitions which have a variable class name.'); - } - - if (null !== $value->getFactoryMethod()) { - if (null !== $value->getFactoryClass()) { - return sprintf("call_user_func(array(%s, '%s')%s)", $this->dumpValue($value->getFactoryClass()), $value->getFactoryMethod(), count($arguments) > 0 ? ', '.implode(', ', $arguments) : ''); - } elseif (null !== $value->getFactoryService()) { - return sprintf("%s->%s(%s)", $this->getServiceCall($value->getFactoryService()), $value->getFactoryMethod(), implode(', ', $arguments)); - } else { - throw new RuntimeException('Cannot dump definitions which have factory method without factory service or factory class.'); - } - } - - return sprintf("new \\%s(%s)", substr(str_replace('\\\\', '\\', $class), 1, -1), implode(', ', $arguments)); - } elseif (is_object($value) && $value instanceof Variable) { - return '$'.$value; - } elseif (is_object($value) && $value instanceof Reference) { - if (null !== $this->referenceVariables && isset($this->referenceVariables[$id = (string) $value])) { - return $this->dumpValue($this->referenceVariables[$id], $interpolate); - } - - return $this->getServiceCall((string) $value, $value); - } elseif (is_object($value) && $value instanceof Parameter) { - return $this->dumpParameter($value); - } elseif (true === $interpolate && is_string($value)) { - if (preg_match('/^%([^%]+)%$/', $value, $match)) { - // we do this to deal with non string values (Boolean, integer, ...) - // the preg_replace_callback converts them to strings - return $this->dumpParameter(strtolower($match[1])); - } else { - $that = $this; - $replaceParameters = function ($match) use ($that) { - return "'.".$that->dumpParameter(strtolower($match[2])).".'"; - }; - - $code = str_replace('%%', '%', preg_replace_callback('/(?container->isFrozen() && $this->container->hasParameter($name)) { - return $this->dumpValue($this->container->getParameter($name), false); - } - - return sprintf("\$this->getParameter('%s')", strtolower($name)); - } - - /** - * Gets a service call - * - * @param string $id - * @param Reference $reference - * - * @return string - */ - private function getServiceCall($id, Reference $reference = null) - { - if ('service_container' === $id) { - return '$this'; - } - - if (null !== $reference && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $reference->getInvalidBehavior()) { - return sprintf('$this->get(\'%s\', ContainerInterface::NULL_ON_INVALID_REFERENCE)', $id); - } else { - if ($this->container->hasAlias($id)) { - $id = (string) $this->container->getAlias($id); - } - - return sprintf('$this->get(\'%s\')', $id); - } - } - - /** - * Returns the next name to use - * - * @return string - */ - private function getNextVariableName() - { - $firstChars = self::FIRST_CHARS; - $firstCharsLength = strlen($firstChars); - $nonFirstChars = self::NON_FIRST_CHARS; - $nonFirstCharsLength = strlen($nonFirstChars); - - while (true) { - $name = ''; - $i = $this->variableCount; - - if ('' === $name) { - $name .= $firstChars[$i%$firstCharsLength]; - $i = intval($i/$firstCharsLength); - } - - while ($i > 0) { - $i -= 1; - $name .= $nonFirstChars[$i%$nonFirstCharsLength]; - $i = intval($i/$nonFirstCharsLength); - } - - $this->variableCount += 1; - - // check that the name is not reserved - if (in_array($name, $this->reservedVariables, true)) { - continue; - } - - return $name; - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php deleted file mode 100644 index d8791ce..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php +++ /dev/null @@ -1,301 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Dumper; - -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Parameter; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; - -/** - * XmlDumper dumps a service container as an XML string. - * - * @author Fabien Potencier - * @author Martin Hasoň - * - * @api - */ -class XmlDumper extends Dumper -{ - /** - * @var \DOMDocument - */ - private $document; - - /** - * Dumps the service container as an XML string. - * - * @param array $options An array of options - * - * @return string An xml string representing of the service container - * - * @api - */ - public function dump(array $options = array()) - { - $this->document = new \DOMDocument('1.0', 'utf-8'); - $this->document->formatOutput = true; - - $container = $this->document->createElementNS('http://symfony.com/schema/dic/services', 'container'); - $container->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); - $container->setAttribute('xsi:schemaLocation', 'http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd'); - - $this->addParameters($container); - $this->addServices($container); - - $this->document->appendChild($container); - $xml = $this->document->saveXML(); - $this->document = null; - - return $xml; - } - - /** - * Adds parameters. - * - * @param DOMElement $parent - */ - private function addParameters(\DOMElement $parent) - { - $data = $this->container->getParameterBag()->all(); - if (!$data) { - return; - } - - if ($this->container->isFrozen()) { - $data = $this->escape($data); - } - - $parameters = $this->document->createElement('parameters'); - $parent->appendChild($parameters); - $this->convertParameters($data, 'parameter', $parameters); - } - - /** - * Adds method calls. - * - * @param array $methodcalls - * @param DOMElement $parent - */ - private function addMethodCalls(array $methodcalls, \DOMElement $parent) - { - foreach ($methodcalls as $methodcall) { - $call = $this->document->createElement('call'); - $call->setAttribute('method', $methodcall[0]); - if (count($methodcall[1])) { - $this->convertParameters($methodcall[1], 'argument', $call); - } - $parent->appendChild($call); - } - } - - /** - * Adds a service. - * - * @param Definition $definition - * @param string $id - * @param DOMElement $parent - */ - private function addService($definition, $id, \DOMElement $parent) - { - $service = $this->document->createElement('service'); - if (null !== $id) { - $service->setAttribute('id', $id); - } - if ($definition->getClass()) { - $service->setAttribute('class', $definition->getClass()); - } - if ($definition->getFactoryMethod()) { - $service->setAttribute('factory-method', $definition->getFactoryMethod()); - } - if ($definition->getFactoryService()) { - $service->setAttribute('factory-service', $definition->getFactoryService()); - } - if (ContainerInterface::SCOPE_CONTAINER !== $scope = $definition->getScope()) { - $service->setAttribute('scope', $scope); - } - if (!$definition->isPublic()) { - $service->setAttribute('public', 'false'); - } - - foreach ($definition->getTags() as $name => $tags) { - foreach ($tags as $attributes) { - $tag = $this->document->createElement('tag'); - $tag->setAttribute('name', $name); - foreach ($attributes as $key => $value) { - $tag->setAttribute($key, $value); - } - $service->appendChild($tag); - } - } - - if ($definition->getFile()) { - $file = $this->document->createElement('file'); - $file->appendChild($this->document->createTextNode($definition->getFile())); - $service->appendChild($file); - } - - if ($parameters = $definition->getArguments()) { - $this->convertParameters($parameters, 'argument', $service); - } - - if ($parameters = $definition->getProperties()) { - $this->convertParameters($parameters, 'property', $service, 'name'); - } - - $this->addMethodCalls($definition->getMethodCalls(), $service); - - if ($callable = $definition->getConfigurator()) { - $configurator = $this->document->createElement('configurator'); - if (is_array($callable)) { - $configurator->setAttribute((is_object($callable[0]) && $callable[0] instanceof Reference ? 'service' : 'class'), $callable[0]); - $configurator->setAttribute('method', $callable[1]); - } else { - $configurator->setAttribute('function', $callable); - } - $service->appendChild($configurator); - } - - $parent->appendChild($service); - } - - /** - * Adds a service alias. - * - * @param string $alias - * @param string $id - * @param DOMElement $parent - */ - private function addServiceAlias($alias, $id, \DOMElement $parent) - { - $service = $this->document->createElement('service'); - $service->setAttribute('id', $alias); - $service->setAttribute('alias', $id); - if (!$id->isPublic()) { - $service->setAttribute('public', 'false'); - } - $parent->appendChild($service); - } - - /** - * Adds services. - * - * @param DOMElement $parent - */ - private function addServices(\DOMElement $parent) - { - $definitions = $this->container->getDefinitions(); - if (!$definitions) { - return; - } - - $services = $this->document->createElement('services'); - foreach ($definitions as $id => $definition) { - $this->addService($definition, $id, $services); - } - - foreach ($this->container->getAliases() as $alias => $id) { - $this->addServiceAlias($alias, $id, $services); - } - $parent->appendChild($services); - } - - /** - * Converts parameters. - * - * @param array $parameters - * @param string $type - * @param DOMElement $parent - * @param string $keyAttribute - */ - private function convertParameters($parameters, $type, \DOMElement $parent, $keyAttribute = 'key') - { - $withKeys = array_keys($parameters) !== range(0, count($parameters) - 1); - foreach ($parameters as $key => $value) { - $element = $this->document->createElement($type); - if ($withKeys) { - $element->setAttribute($keyAttribute, $key); - } - - if (is_array($value)) { - $element->setAttribute('type', 'collection'); - $this->convertParameters($value, $type, $element, 'key'); - } elseif (is_object($value) && $value instanceof Reference) { - $element->setAttribute('type', 'service'); - $element->setAttribute('id', (string) $value); - $behaviour = $value->getInvalidBehavior(); - if ($behaviour == ContainerInterface::NULL_ON_INVALID_REFERENCE) { - $element->setAttribute('on-invalid', 'null'); - } elseif ($behaviour == ContainerInterface::IGNORE_ON_INVALID_REFERENCE) { - $element->setAttribute('on-invalid', 'ignore'); - } - } elseif (is_object($value) && $value instanceof Definition) { - $element->setAttribute('type', 'service'); - $this->addService($value, null, $element); - } else { - if (in_array($value, array('null', 'true', 'false'), true)) { - $element->setAttribute('type', 'string'); - } - $text = $this->document->createTextNode(self::phpToXml($value)); - $element->appendChild($text); - } - $parent->appendChild($element); - } - } - - /** - * Escapes arguments - * - * @param array $arguments - * - * @return array - */ - private function escape($arguments) - { - $args = array(); - foreach ($arguments as $k => $v) { - if (is_array($v)) { - $args[$k] = $this->escape($v); - } elseif (is_string($v)) { - $args[$k] = str_replace('%', '%%', $v); - } else { - $args[$k] = $v; - } - } - - return $args; - } - - /** - * Converts php types to xml types. - * - * @param mixed $value Value to convert - */ - public static function phpToXml($value) - { - switch (true) { - case null === $value: - return 'null'; - case true === $value: - return 'true'; - case false === $value: - return 'false'; - case is_object($value) && $value instanceof Parameter: - return '%'.$value.'%'; - case is_object($value) || is_resource($value): - throw new RuntimeException('Unable to dump a service container if a parameter is an object or a resource.'); - default: - return (string) $value; - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php deleted file mode 100644 index 9717a25..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php +++ /dev/null @@ -1,295 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Dumper; - -use Symfony\Component\Yaml\Dumper as YmlDumper; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Parameter; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * YamlDumper dumps a service container as a YAML string. - * - * @author Fabien Potencier - * - * @api - */ -class YamlDumper extends Dumper -{ - private $dumper; - - /** - * Constructor. - * - * @param ContainerBuilder $container The service container to dump - * - * @api - */ - public function __construct(ContainerBuilder $container) - { - parent::__construct($container); - - $this->dumper = new YmlDumper(); - } - - /** - * Dumps the service container as an YAML string. - * - * @param array $options An array of options - * - * @return string A YAML string representing of the service container - * - * @api - */ - public function dump(array $options = array()) - { - return $this->addParameters()."\n".$this->addServices(); - } - - /** - * Adds a service - * - * @param string $id - * @param Definition $definition - * - * @return string - */ - private function addService($id, $definition) - { - $code = " $id:\n"; - if ($definition->getClass()) { - $code .= sprintf(" class: %s\n", $definition->getClass()); - } - - $tagsCode = ''; - foreach ($definition->getTags() as $name => $tags) { - foreach ($tags as $attributes) { - $att = array(); - foreach ($attributes as $key => $value) { - $att[] = sprintf('%s: %s', $this->dumper->dump($key), $this->dumper->dump($value)); - } - $att = $att ? ', '.implode(' ', $att) : ''; - - $tagsCode .= sprintf(" - { name: %s%s }\n", $this->dumper->dump($name), $att); - } - } - if ($tagsCode) { - $code .= " tags:\n".$tagsCode; - } - - if ($definition->getFile()) { - $code .= sprintf(" file: %s\n", $definition->getFile()); - } - - if ($definition->getFactoryMethod()) { - $code .= sprintf(" factory_method: %s\n", $definition->getFactoryMethod()); - } - - if ($definition->getFactoryService()) { - $code .= sprintf(" factory_service: %s\n", $definition->getFactoryService()); - } - - if ($definition->getArguments()) { - $code .= sprintf(" arguments: %s\n", $this->dumper->dump($this->dumpValue($definition->getArguments()), 0)); - } - - if ($definition->getProperties()) { - $code .= sprintf(" properties: %s\n", $this->dumper->dump($this->dumpValue($definition->getProperties()), 0)); - } - - if ($definition->getMethodCalls()) { - $code .= sprintf(" calls:\n%s\n", $this->dumper->dump($this->dumpValue($definition->getMethodCalls()), 1, 12)); - } - - if (ContainerInterface::SCOPE_CONTAINER !== $scope = $definition->getScope()) { - $code .= sprintf(" scope: %s\n", $scope); - } - - if ($callable = $definition->getConfigurator()) { - if (is_array($callable)) { - if (is_object($callable[0]) && $callable[0] instanceof Reference) { - $callable = array($this->getServiceCall((string) $callable[0], $callable[0]), $callable[1]); - } else { - $callable = array($callable[0], $callable[1]); - } - } - - $code .= sprintf(" configurator: %s\n", $this->dumper->dump($callable, 0)); - } - - return $code; - } - - /** - * Adds a service alias - * - * @param string $alias - * @param string $id - * - * @return string - */ - private function addServiceAlias($alias, $id) - { - if ($id->isPublic()) { - return sprintf(" %s: @%s\n", $alias, $id); - } else { - return sprintf(" %s:\n alias: %s\n public: false", $alias, $id); - } - } - - /** - * Adds services - * - * @return string - */ - private function addServices() - { - if (!$this->container->getDefinitions()) { - return ''; - } - - $code = "services:\n"; - foreach ($this->container->getDefinitions() as $id => $definition) { - $code .= $this->addService($id, $definition); - } - - foreach ($this->container->getAliases() as $alias => $id) { - $code .= $this->addServiceAlias($alias, $id); - } - - return $code; - } - - /** - * Adds parameters - * - * @return string - */ - private function addParameters() - { - if (!$this->container->getParameterBag()->all()) { - return ''; - } - - if ($this->container->isFrozen()) { - $parameters = $this->prepareParameters($this->container->getParameterBag()->all()); - } else { - $parameters = $this->container->getParameterBag()->all(); - } - - return $this->dumper->dump(array('parameters' => $parameters), 2); - } - - /** - * Dumps the value to YAML format - * - * @param mixed $value - * - * @throws RuntimeException When trying to dump object or resource - */ - private function dumpValue($value) - { - if (is_array($value)) { - $code = array(); - foreach ($value as $k => $v) { - $code[$k] = $this->dumpValue($v); - } - - return $code; - } elseif (is_object($value) && $value instanceof Reference) { - return $this->getServiceCall((string) $value, $value); - } elseif (is_object($value) && $value instanceof Parameter) { - return $this->getParameterCall((string) $value); - } elseif (is_object($value) || is_resource($value)) { - throw new RuntimeException('Unable to dump a service container if a parameter is an object or a resource.'); - } - - return $value; - } - - /** - * Gets the service call. - * - * @param string $id - * @param Reference $reference - * - * @return string - */ - private function getServiceCall($id, Reference $reference = null) - { - if (null !== $reference && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $reference->getInvalidBehavior()) { - return sprintf('@?%s', $id); - } - - return sprintf('@%s', $id); - } - - /** - * Gets parameter call. - * - * @param string $id - * - * @return string - */ - private function getParameterCall($id) - { - return sprintf('%%%s%%', $id); - } - - /** - * Prepares parameters - * - * @param array $parameters - * - * @return array - */ - private function prepareParameters($parameters) - { - $filtered = array(); - foreach ($parameters as $key => $value) { - if (is_array($value)) { - $value = $this->prepareParameters($value); - } elseif ($value instanceof Reference) { - $value = '@'.$value; - } - - $filtered[$key] = $value; - } - - return $this->escape($filtered); - } - - /** - * Escapes arguments - * - * @param array $arguments - * - * @return array - */ - private function escape($arguments) - { - $args = array(); - foreach ($arguments as $k => $v) { - if (is_array($v)) { - $args[$k] = $this->escape($v); - } elseif (is_string($v)) { - $args[$k] = str_replace('%', '%%', $v); - } else { - $args[$k] = $v; - } - } - - return $args; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/BadMethodCallException.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/BadMethodCallException.php deleted file mode 100644 index 959238e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/BadMethodCallException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Exception; - -/** - * Base BadMethodCallException for Dependency Injection component. - */ -class BadMethodCallException extends \BadMethodCallException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ExceptionInterface.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ExceptionInterface.php deleted file mode 100644 index f5e9099..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ExceptionInterface.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Exception; - -/** - * Base ExceptionInterface for Dependency Injection component. - * - * @author Fabien Potencier - * @author Bulat Shakirzyanov - */ -interface ExceptionInterface -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/InactiveScopeException.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/InactiveScopeException.php deleted file mode 100644 index 24d1ca0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/InactiveScopeException.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Exception; - -/** - * This exception is thrown when you try to create a service of an inactive scope. - * - * @author Johannes M. Schmitt - */ -class InactiveScopeException extends RuntimeException -{ - private $serviceId; - private $scope; - - public function __construct($serviceId, $scope) - { - parent::__construct(sprintf('You cannot create a service ("%s") of an inactive scope ("%s").', $serviceId, $scope)); - - $this->serviceId = $serviceId; - $this->scope = $scope; - } - - public function getServiceId() - { - return $this->serviceId; - } - - public function getScope() - { - return $this->scope; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/InvalidArgumentException.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/InvalidArgumentException.php deleted file mode 100644 index 119bb7d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Exception; - -/** - * Base InvalidArgumentException for Dependency Injection component. - * - * @author Bulat Shakirzyanov - */ -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/LogicException.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/LogicException.php deleted file mode 100644 index 17a070c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/LogicException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Exception; - -/** - * Base LogicException for Dependency Injection component. - */ -class LogicException extends \LogicException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/OutOfBoundsException.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/OutOfBoundsException.php deleted file mode 100644 index a61f143..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/OutOfBoundsException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Exception; - -/** - * Base OutOfBoundsException for Dependency Injection component. - */ -class OutOfBoundsException extends \OutOfBoundsException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php deleted file mode 100644 index 958ade0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Exception; - -/** - * This exception is thrown when a circular reference in a parameter is detected. - * - * @author Fabien Potencier - */ -class ParameterCircularReferenceException extends RuntimeException -{ - private $parameters; - - public function __construct($parameters) - { - parent::__construct(sprintf('Circular reference detected for parameter "%s" ("%s" > "%s").', $parameters[0], implode('" > "', $parameters), $parameters[0])); - - $this->parameters = $parameters; - } - - public function getParameters() - { - return $this->parameters; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php deleted file mode 100644 index 200fbec..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Exception; - -/** - * This exception is thrown when a non-existent parameter is used. - * - * @author Fabien Potencier - */ -class ParameterNotFoundException extends InvalidArgumentException -{ - private $key; - private $sourceId; - private $sourceKey; - - /** - * Constructor. - * - * @param string $key The requested parameter key - * @param string $sourceId The service id that references the non-existent parameter - * @param string $sourceKey The parameter key that references the non-existent parameter - */ - public function __construct($key, $sourceId = null, $sourceKey = null) - { - $this->key = $key; - $this->sourceId = $sourceId; - $this->sourceKey = $sourceKey; - - $this->updateRepr(); - } - - public function updateRepr() - { - if (null !== $this->sourceId) { - $this->message = sprintf('The service "%s" has a dependency on a non-existent parameter "%s".', $this->sourceId, $this->key); - } elseif (null !== $this->sourceKey) { - $this->message = sprintf('The parameter "%s" has a dependency on a non-existent parameter "%s".', $this->sourceKey, $this->key); - } else { - $this->message = sprintf('You have requested a non-existent parameter "%s".', $this->key); - } - } - - public function getKey() - { - return $this->key; - } - - public function getSourceId() - { - return $this->sourceId; - } - - public function getSourceKey() - { - return $this->sourceKey; - } - - public function setSourceId($sourceId) - { - $this->sourceId = $sourceId; - - $this->updateRepr(); - } - - public function setSourceKey($sourceKey) - { - $this->sourceKey = $sourceKey; - - $this->updateRepr(); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/RuntimeException.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/RuntimeException.php deleted file mode 100644 index 5c24541..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/RuntimeException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Exception; - -/** - * Base RuntimeException for Dependency Injection component. - * - * @author Johannes M. Schmitt - */ -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ScopeCrossingInjectionException.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ScopeCrossingInjectionException.php deleted file mode 100644 index f23374f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ScopeCrossingInjectionException.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Exception; - -/** - * This exception is thrown when the a scope crossing injection is detected. - * - * @author Johannes M. Schmitt - */ -class ScopeCrossingInjectionException extends RuntimeException -{ - private $sourceServiceId; - private $sourceScope; - private $destServiceId; - private $destScope; - - public function __construct($sourceServiceId, $sourceScope, $destServiceId, $destScope) - { - parent::__construct(sprintf( - 'Scope Crossing Injection detected: The definition "%s" references the service "%s" which belongs to another scope hierarchy. ' - .'This service might not be available consistently. Generally, it is safer to either move the definition "%s" to scope "%s", or ' - .'declare "%s" as a child scope of "%s". If you can be sure that the other scope is always active, you can set the reference to strict=false to get rid of this error.', - $sourceServiceId, - $destServiceId, - $sourceServiceId, - $destScope, - $sourceScope, - $destScope - )); - - $this->sourceServiceId = $sourceServiceId; - $this->sourceScope = $sourceScope; - $this->destServiceId = $destServiceId; - $this->destScope = $destScope; - } - - public function getSourceServiceId() - { - return $this->sourceServiceId; - } - - public function getSourceScope() - { - return $this->sourceScope; - } - - public function getDestServiceId() - { - return $this->destServiceId; - } - - public function getDestScope() - { - return $this->destScope; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ScopeWideningInjectionException.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ScopeWideningInjectionException.php deleted file mode 100644 index d463453..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ScopeWideningInjectionException.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Exception; - -/** - * Thrown when a scope widening injection is detected. - * - * @author Johannes M. Schmitt - */ -class ScopeWideningInjectionException extends RuntimeException -{ - private $sourceServiceId; - private $sourceScope; - private $destServiceId; - private $destScope; - - public function __construct($sourceServiceId, $sourceScope, $destServiceId, $destScope) - { - parent::__construct(sprintf( - 'Scope Widening Injection detected: The definition "%s" references the service "%s" which belongs to a narrower scope. ' - .'Generally, it is safer to either move "%s" to scope "%s" or alternatively rely on the provider pattern by injecting the container itself, and requesting the service "%s" each time it is needed. ' - .'In rare, special cases however that might not be necessary, then you can set the reference to strict=false to get rid of this error.', - $sourceServiceId, - $destServiceId, - $sourceServiceId, - $destScope, - $destServiceId - )); - - $this->sourceServiceId = $sourceServiceId; - $this->sourceScope = $sourceScope; - $this->destServiceId = $destServiceId; - $this->destScope = $destScope; - } - - public function getSourceServiceId() - { - return $this->sourceServiceId; - } - - public function getSourceScope() - { - return $this->sourceScope; - } - - public function getDestServiceId() - { - return $this->destServiceId; - } - - public function getDestScope() - { - return $this->destScope; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php deleted file mode 100644 index e000001..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Exception; - -/** - * This exception is thrown when a circular reference is detected. - * - * @author Johannes M. Schmitt - */ -class ServiceCircularReferenceException extends RuntimeException -{ - private $serviceId; - private $path; - - public function __construct($serviceId, array $path) - { - parent::__construct(sprintf('Circular reference detected for service "%s", path: "%s".', $serviceId, implode(' -> ', $path))); - - $this->serviceId = $serviceId; - $this->path = $path; - } - - public function getServiceId() - { - return $this->serviceId; - } - - public function getPath() - { - return $this->path; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php deleted file mode 100644 index f9af1ea..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Exception; - -/** - * This exception is thrown when a non-existent service is requested. - * - * @author Johannes M. Schmitt - */ -class ServiceNotFoundException extends InvalidArgumentException -{ - private $id; - private $sourceId; - - public function __construct($id, $sourceId = null) - { - if (null === $sourceId) { - $msg = sprintf('You have requested a non-existent service "%s".', $id); - } else { - $msg = sprintf('The service "%s" has a dependency on a non-existent service "%s".', $sourceId, $id); - } - - parent::__construct($msg); - - $this->id = $id; - $this->sourceId = $sourceId; - } - - public function getId() - { - return $this->id; - } - - public function getSourceId() - { - return $this->sourceId; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php deleted file mode 100644 index 1d96d24..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Extension; - -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * ConfigurationExtensionInterface is the interface implemented by container extension classes. - * - * @author Kevin Bond - */ -interface ConfigurationExtensionInterface -{ - /** - * Returns extension configuration - * - * @param array $config $config An array of configuration values - * @param ContainerBuilder $container A ContainerBuilder instance - * - * @return ConfigurationInterface|null The configuration or null - */ - public function getConfiguration(array $config, ContainerBuilder $container); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php deleted file mode 100644 index fc015e1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Extension; - -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * ExtensionInterface is the interface implemented by container extension classes. - * - * @author Fabien Potencier - * - * @api - */ -interface ExtensionInterface -{ - /** - * Loads a specific configuration. - * - * @param array $config An array of configuration values - * @param ContainerBuilder $container A ContainerBuilder instance - * - * @throws InvalidArgumentException When provided tag is not defined in this extension - * - * @api - */ - public function load(array $config, ContainerBuilder $container); - - /** - * Returns the namespace to be used for this extension (XML namespace). - * - * @return string The XML namespace - * - * @api - */ - public function getNamespace(); - - /** - * Returns the base path for the XSD files. - * - * @return string The XSD base path - * - * @api - */ - public function getXsdValidationBasePath(); - - /** - * Returns the recommended alias to use in XML. - * - * This alias is also the mandatory prefix to use when using YAML. - * - * @return string The alias - * - * @api - */ - public function getAlias(); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php deleted file mode 100644 index 34d6cad..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection; - -/** - * IntrospectableContainerInterface defines additional introspection functionality - * for containers, allowing logic to be implemented based on a Container's state. - * - * @author Evan Villemez - * - */ -interface IntrospectableContainerInterface extends ContainerInterface -{ - /** - * Check for whether or not a service has been initialized. - * - * @param string $id - * - * @return Boolean true if the service has been initialized, false otherwise - * - */ - public function initialized($id); - -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/LICENSE b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/LICENSE deleted file mode 100644 index cdffe7a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2012 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php deleted file mode 100644 index 775a352..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Loader; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\Config\Loader\Loader; - -/** - * ClosureLoader loads service definitions from a PHP closure. - * - * The Closure has access to the container as its first argument. - * - * @author Fabien Potencier - */ -class ClosureLoader extends Loader -{ - private $container; - - /** - * Constructor. - * - * @param ContainerBuilder $container A ContainerBuilder instance - */ - public function __construct(ContainerBuilder $container) - { - $this->container = $container; - } - - /** - * Loads a Closure. - * - * @param \Closure $closure The resource - * @param string $type The resource type - */ - public function load($closure, $type = null) - { - call_user_func($closure, $this->container); - } - - /** - * Returns true if this class supports the given resource. - * - * @param mixed $resource A resource - * @param string $type The resource type - * - * @return Boolean true if this class supports the given resource, false otherwise - */ - public function supports($resource, $type = null) - { - return $resource instanceof \Closure; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/FileLoader.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/FileLoader.php deleted file mode 100644 index 0699ab9..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/FileLoader.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Loader; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\Config\Loader\FileLoader as BaseFileLoader; -use Symfony\Component\Config\FileLocator; - -/** - * FileLoader is the abstract class used by all built-in loaders that are file based. - * - * @author Fabien Potencier - */ -abstract class FileLoader extends BaseFileLoader -{ - protected $container; - - /** - * Constructor. - * - * @param ContainerBuilder $container A ContainerBuilder instance - * @param FileLocator $locator A FileLocator instance - */ - public function __construct(ContainerBuilder $container, FileLocator $locator) - { - $this->container = $container; - - parent::__construct($locator); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php deleted file mode 100644 index e4b99f6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Loader; - -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; - -/** - * IniFileLoader loads parameters from INI files. - * - * @author Fabien Potencier - */ -class IniFileLoader extends FileLoader -{ - /** - * Loads a resource. - * - * @param mixed $file The resource - * @param string $type The resource type - * - * @throws InvalidArgumentException When ini file is not valid - */ - public function load($file, $type = null) - { - $path = $this->locator->locate($file); - - $this->container->addResource(new FileResource($path)); - - $result = parse_ini_file($path, true); - if (false === $result || array() === $result) { - throw new InvalidArgumentException(sprintf('The "%s" file is not valid.', $file)); - } - - if (isset($result['parameters']) && is_array($result['parameters'])) { - foreach ($result['parameters'] as $key => $value) { - $this->container->setParameter($key, $value); - } - } - } - - /** - * Returns true if this class supports the given resource. - * - * @param mixed $resource A resource - * @param string $type The resource type - * - * @return Boolean true if this class supports the given resource, false otherwise - */ - public function supports($resource, $type = null) - { - return is_string($resource) && 'ini' === pathinfo($resource, PATHINFO_EXTENSION); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php deleted file mode 100644 index f2bf441..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Loader; - -use Symfony\Component\Config\Resource\FileResource; - -/** - * PhpFileLoader loads service definitions from a PHP file. - * - * The PHP file is required and the $container variable can be - * used form the file to change the container. - * - * @author Fabien Potencier - */ -class PhpFileLoader extends FileLoader -{ - /** - * Loads a PHP file. - * - * @param mixed $file The resource - * @param string $type The resource type - */ - public function load($file, $type = null) - { - // the container and loader variables are exposed to the included file below - $container = $this->container; - $loader = $this; - - $path = $this->locator->locate($file); - $this->setCurrentDir(dirname($path)); - $this->container->addResource(new FileResource($path)); - - include $path; - } - - /** - * Returns true if this class supports the given resource. - * - * @param mixed $resource A resource - * @param string $type The resource type - * - * @return Boolean true if this class supports the given resource, false otherwise - */ - public function supports($resource, $type = null) - { - return is_string($resource) && 'php' === pathinfo($resource, PATHINFO_EXTENSION); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php deleted file mode 100644 index 7525027..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php +++ /dev/null @@ -1,499 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Loader; - -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Alias; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\SimpleXMLElement; -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; - -/** - * XmlFileLoader loads XML files service definitions. - * - * @author Fabien Potencier - */ -class XmlFileLoader extends FileLoader -{ - /** - * Loads an XML file. - * - * @param mixed $file The resource - * @param string $type The resource type - */ - public function load($file, $type = null) - { - $path = $this->locator->locate($file); - - $xml = $this->parseFile($path); - $xml->registerXPathNamespace('container', 'http://symfony.com/schema/dic/services'); - - $this->container->addResource(new FileResource($path)); - - // anonymous services - $this->processAnonymousServices($xml, $path); - - // imports - $this->parseImports($xml, $path); - - // parameters - $this->parseParameters($xml, $path); - - // extensions - $this->loadFromExtensions($xml); - - // services - $this->parseDefinitions($xml, $path); - } - - /** - * Returns true if this class supports the given resource. - * - * @param mixed $resource A resource - * @param string $type The resource type - * - * @return Boolean true if this class supports the given resource, false otherwise - */ - public function supports($resource, $type = null) - { - return is_string($resource) && 'xml' === pathinfo($resource, PATHINFO_EXTENSION); - } - - /** - * Parses parameters - * - * @param SimpleXMLElement $xml - * @param string $file - */ - private function parseParameters(SimpleXMLElement $xml, $file) - { - if (!$xml->parameters) { - return; - } - - $this->container->getParameterBag()->add($xml->parameters->getArgumentsAsPhp('parameter')); - } - - /** - * Parses imports - * - * @param SimpleXMLElement $xml - * @param string $file - */ - private function parseImports(SimpleXMLElement $xml, $file) - { - if (false === $imports = $xml->xpath('//container:imports/container:import')) { - return; - } - - foreach ($imports as $import) { - $this->setCurrentDir(dirname($file)); - $this->import((string) $import['resource'], null, (Boolean) $import->getAttributeAsPhp('ignore-errors'), $file); - } - } - - /** - * Parses multiple definitions - * - * @param SimpleXMLElement $xml - * @param string $file - */ - private function parseDefinitions(SimpleXMLElement $xml, $file) - { - if (false === $services = $xml->xpath('//container:services/container:service')) { - return; - } - - foreach ($services as $service) { - $this->parseDefinition((string) $service['id'], $service, $file); - } - } - - /** - * Parses an individual Definition - * - * @param string $id - * @param SimpleXMLElement $service - * @param string $file - */ - private function parseDefinition($id, $service, $file) - { - if ((string) $service['alias']) { - $public = true; - if (isset($service['public'])) { - $public = $service->getAttributeAsPhp('public'); - } - $this->container->setAlias($id, new Alias((string) $service['alias'], $public)); - - return; - } - - if (isset($service['parent'])) { - $definition = new DefinitionDecorator((string) $service['parent']); - } else { - $definition = new Definition(); - } - - foreach (array('class', 'scope', 'public', 'factory-class', 'factory-method', 'factory-service', 'synthetic', 'abstract') as $key) { - if (isset($service[$key])) { - $method = 'set'.str_replace('-', '', $key); - $definition->$method((string) $service->getAttributeAsPhp($key)); - } - } - - if ($service->file) { - $definition->setFile((string) $service->file); - } - - $definition->setArguments($service->getArgumentsAsPhp('argument')); - $definition->setProperties($service->getArgumentsAsPhp('property')); - - if (isset($service->configurator)) { - if (isset($service->configurator['function'])) { - $definition->setConfigurator((string) $service->configurator['function']); - } else { - if (isset($service->configurator['service'])) { - $class = new Reference((string) $service->configurator['service'], ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, false); - } else { - $class = (string) $service->configurator['class']; - } - - $definition->setConfigurator(array($class, (string) $service->configurator['method'])); - } - } - - foreach ($service->call as $call) { - $definition->addMethodCall((string) $call['method'], $call->getArgumentsAsPhp('argument')); - } - - foreach ($service->tag as $tag) { - $parameters = array(); - foreach ($tag->attributes() as $name => $value) { - if ('name' === $name) { - continue; - } - - $parameters[$name] = SimpleXMLElement::phpize($value); - } - - $definition->addTag((string) $tag['name'], $parameters); - } - - $this->container->setDefinition($id, $definition); - } - - /** - * Parses a XML file. - * - * @param string $file Path to a file - * - * @throws InvalidArgumentException When loading of XML file returns error - */ - private function parseFile($file) - { - $dom = new \DOMDocument(); - libxml_use_internal_errors(true); - if (!$dom->load($file, defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0)) { - throw new InvalidArgumentException(implode("\n", $this->getXmlErrors())); - } - $dom->validateOnParse = true; - $dom->normalizeDocument(); - libxml_use_internal_errors(false); - $this->validate($dom, $file); - - return simplexml_import_dom($dom, 'Symfony\\Component\\DependencyInjection\\SimpleXMLElement'); - } - - /** - * Processes anonymous services - * - * @param SimpleXMLElement $xml - * @param string $file - */ - private function processAnonymousServices(SimpleXMLElement $xml, $file) - { - $definitions = array(); - $count = 0; - - // anonymous services as arguments/properties - if (false !== $nodes = $xml->xpath('//container:argument[@type="service"][not(@id)]|//container:property[@type="service"][not(@id)]')) { - foreach ($nodes as $node) { - // give it a unique name - $node['id'] = sprintf('%s_%d', md5($file), ++$count); - - $definitions[(string) $node['id']] = array($node->service, $file, false); - $node->service['id'] = (string) $node['id']; - } - } - - // anonymous services "in the wild" - if (false !== $nodes = $xml->xpath('//container:services/container:service[not(@id)]')) { - foreach ($nodes as $node) { - // give it a unique name - $node['id'] = sprintf('%s_%d', md5($file), ++$count); - - $definitions[(string) $node['id']] = array($node, $file, true); - $node->service['id'] = (string) $node['id']; - } - } - - // resolve definitions - krsort($definitions); - foreach ($definitions as $id => $def) { - // anonymous services are always private - $def[0]['public'] = false; - - $this->parseDefinition($id, $def[0], $def[1]); - - $oNode = dom_import_simplexml($def[0]); - if (true === $def[2]) { - $nNode = new \DOMElement('_services'); - $oNode->parentNode->replaceChild($nNode, $oNode); - $nNode->setAttribute('id', $id); - } else { - $oNode->parentNode->removeChild($oNode); - } - } - } - - /** - * Validates an XML document. - * - * @param DOMDocument $dom - * @param string $file - */ - private function validate(\DOMDocument $dom, $file) - { - $this->validateSchema($dom, $file); - $this->validateExtensions($dom, $file); - } - - /** - * Validates a documents XML schema. - * - * @param \DOMDocument $dom - * @param string $file - * - * @throws RuntimeException When extension references a non-existent XSD file - * @throws InvalidArgumentException When XML doesn't validate its XSD schema - */ - private function validateSchema(\DOMDocument $dom, $file) - { - $schemaLocations = array('http://symfony.com/schema/dic/services' => str_replace('\\', '/', __DIR__.'/schema/dic/services/services-1.0.xsd')); - - if ($element = $dom->documentElement->getAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'schemaLocation')) { - $items = preg_split('/\s+/', $element); - for ($i = 0, $nb = count($items); $i < $nb; $i += 2) { - if (!$this->container->hasExtension($items[$i])) { - continue; - } - - if (($extension = $this->container->getExtension($items[$i])) && false !== $extension->getXsdValidationBasePath()) { - $path = str_replace($extension->getNamespace(), str_replace('\\', '/', $extension->getXsdValidationBasePath()).'/', $items[$i + 1]); - - if (!is_file($path)) { - throw new RuntimeException(sprintf('Extension "%s" references a non-existent XSD file "%s"', get_class($extension), $path)); - } - - $schemaLocations[$items[$i]] = $path; - } - } - } - - $tmpfiles = array(); - $imports = ''; - foreach ($schemaLocations as $namespace => $location) { - $parts = explode('/', $location); - if (0 === stripos($location, 'phar://')) { - $tmpfile = tempnam(sys_get_temp_dir(), 'sf2'); - if ($tmpfile) { - copy($location, $tmpfile); - $tmpfiles[] = $tmpfile; - $parts = explode('/', str_replace('\\', '/', $tmpfile)); - } - } - $drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : ''; - $location = 'file:///'.$drive.implode('/', array_map('rawurlencode', $parts)); - - $imports .= sprintf(' '."\n", $namespace, $location); - } - - $source = << - - - -$imports - -EOF - ; - - $current = libxml_use_internal_errors(true); - $valid = @$dom->schemaValidateSource($source); - foreach ($tmpfiles as $tmpfile) { - @unlink($tmpfile); - } - if (!$valid) { - throw new InvalidArgumentException(implode("\n", $this->getXmlErrors())); - } - libxml_use_internal_errors($current); - } - - /** - * Validates an extension. - * - * @param \DOMDocument $dom - * @param string $file - * - * @throws InvalidArgumentException When no extension is found corresponding to a tag - */ - private function validateExtensions(\DOMDocument $dom, $file) - { - foreach ($dom->documentElement->childNodes as $node) { - if (!$node instanceof \DOMElement || 'http://symfony.com/schema/dic/services' === $node->namespaceURI) { - continue; - } - - // can it be handled by an extension? - if (!$this->container->hasExtension($node->namespaceURI)) { - $extensionNamespaces = array_filter(array_map(function ($ext) { return $ext->getNamespace(); }, $this->container->getExtensions())); - throw new InvalidArgumentException(sprintf( - 'There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s', - $node->tagName, - $file, - $node->namespaceURI, - $extensionNamespaces ? sprintf('"%s"', implode('", "', $extensionNamespaces)) : 'none' - )); - } - } - } - - /** - * Returns an array of XML errors. - * - * @return array - */ - private function getXmlErrors() - { - $errors = array(); - foreach (libxml_get_errors() as $error) { - $errors[] = sprintf('[%s %s] %s (in %s - line %d, column %d)', - LIBXML_ERR_WARNING == $error->level ? 'WARNING' : 'ERROR', - $error->code, - trim($error->message), - $error->file ? $error->file : 'n/a', - $error->line, - $error->column - ); - } - - libxml_clear_errors(); - - return $errors; - } - - /** - * Loads from an extension. - * - * @param SimpleXMLElement $xml - */ - private function loadFromExtensions(SimpleXMLElement $xml) - { - foreach (dom_import_simplexml($xml)->childNodes as $node) { - if (!$node instanceof \DOMElement || $node->namespaceURI === 'http://symfony.com/schema/dic/services') { - continue; - } - - $values = static::convertDomElementToArray($node); - if (!is_array($values)) { - $values = array(); - } - - $this->container->loadFromExtension($node->namespaceURI, $values); - } - } - - /** - * Converts a \DomElement object to a PHP array. - * - * The following rules applies during the conversion: - * - * * Each tag is converted to a key value or an array - * if there is more than one "value" - * - * * The content of a tag is set under a "value" key (bar) - * if the tag also has some nested tags - * - * * The attributes are converted to keys () - * - * * The nested-tags are converted to keys (bar) - * - * @param \DomElement $element A \DomElement instance - * - * @return array A PHP array - */ - public static function convertDomElementToArray(\DomElement $element) - { - $empty = true; - $config = array(); - foreach ($element->attributes as $name => $node) { - $config[$name] = SimpleXMLElement::phpize($node->value); - $empty = false; - } - - $nodeValue = false; - foreach ($element->childNodes as $node) { - if ($node instanceof \DOMText) { - if (trim($node->nodeValue)) { - $nodeValue = trim($node->nodeValue); - $empty = false; - } - } elseif (!$node instanceof \DOMComment) { - if ($node instanceof \DOMElement && '_services' === $node->nodeName) { - $value = new Reference($node->getAttribute('id')); - } else { - $value = static::convertDomElementToArray($node); - } - - $key = $node->localName; - if (isset($config[$key])) { - if (!is_array($config[$key]) || !is_int(key($config[$key]))) { - $config[$key] = array($config[$key]); - } - $config[$key][] = $value; - } else { - $config[$key] = $value; - } - - $empty = false; - } - } - - if (false !== $nodeValue) { - $value = SimpleXMLElement::phpize($nodeValue); - if (count($config)) { - $config['value'] = $value; - } else { - $config = $value; - } - } - - return !$empty ? $config : null; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php deleted file mode 100644 index 63f3893..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php +++ /dev/null @@ -1,331 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Loader; - -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\Alias; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\Yaml\Yaml; - -/** - * YamlFileLoader loads YAML files service definitions. - * - * The YAML format does not support anonymous services (cf. the XML loader). - * - * @author Fabien Potencier - */ -class YamlFileLoader extends FileLoader -{ - /** - * Loads a Yaml file. - * - * @param mixed $file The resource - * @param string $type The resource type - */ - public function load($file, $type = null) - { - $path = $this->locator->locate($file); - - $content = $this->loadFile($path); - - $this->container->addResource(new FileResource($path)); - - // empty file - if (null === $content) { - return; - } - - // imports - $this->parseImports($content, $file); - - // parameters - if (isset($content['parameters'])) { - foreach ($content['parameters'] as $key => $value) { - $this->container->setParameter($key, $this->resolveServices($value)); - } - } - - // extensions - $this->loadFromExtensions($content); - - // services - $this->parseDefinitions($content, $file); - } - - /** - * Returns true if this class supports the given resource. - * - * @param mixed $resource A resource - * @param string $type The resource type - * - * @return Boolean true if this class supports the given resource, false otherwise - */ - public function supports($resource, $type = null) - { - return is_string($resource) && 'yml' === pathinfo($resource, PATHINFO_EXTENSION); - } - - /** - * Parses all imports - * - * @param array $content - * @param string $file - */ - private function parseImports($content, $file) - { - if (!isset($content['imports'])) { - return; - } - - foreach ($content['imports'] as $import) { - $this->setCurrentDir(dirname($file)); - $this->import($import['resource'], null, isset($import['ignore_errors']) ? (Boolean) $import['ignore_errors'] : false, $file); - } - } - - /** - * Parses definitions - * - * @param array $content - * @param string $file - */ - private function parseDefinitions($content, $file) - { - if (!isset($content['services'])) { - return; - } - - foreach ($content['services'] as $id => $service) { - $this->parseDefinition($id, $service, $file); - } - } - - /** - * Parses a definition. - * - * @param string $id - * @param array $service - * @param string $file - */ - private function parseDefinition($id, $service, $file) - { - if (is_string($service) && 0 === strpos($service, '@')) { - $this->container->setAlias($id, substr($service, 1)); - - return; - } elseif (isset($service['alias'])) { - $public = !array_key_exists('public', $service) || (Boolean) $service['public']; - $this->container->setAlias($id, new Alias($service['alias'], $public)); - - return; - } - - if (isset($service['parent'])) { - $definition = new DefinitionDecorator($service['parent']); - } else { - $definition = new Definition(); - } - - if (isset($service['class'])) { - $definition->setClass($service['class']); - } - - if (isset($service['scope'])) { - $definition->setScope($service['scope']); - } - - if (isset($service['synthetic'])) { - $definition->setSynthetic($service['synthetic']); - } - - if (isset($service['public'])) { - $definition->setPublic($service['public']); - } - - if (isset($service['abstract'])) { - $definition->setAbstract($service['abstract']); - } - - if (isset($service['factory_class'])) { - $definition->setFactoryClass($service['factory_class']); - } - - if (isset($service['factory_method'])) { - $definition->setFactoryMethod($service['factory_method']); - } - - if (isset($service['factory_service'])) { - $definition->setFactoryService($service['factory_service']); - } - - if (isset($service['file'])) { - $definition->setFile($service['file']); - } - - if (isset($service['arguments'])) { - $definition->setArguments($this->resolveServices($service['arguments'])); - } - - if (isset($service['properties'])) { - $definition->setProperties($this->resolveServices($service['properties'])); - } - - if (isset($service['configurator'])) { - if (is_string($service['configurator'])) { - $definition->setConfigurator($service['configurator']); - } else { - $definition->setConfigurator(array($this->resolveServices($service['configurator'][0]), $service['configurator'][1])); - } - } - - if (isset($service['calls'])) { - foreach ($service['calls'] as $call) { - $args = isset($call[1]) ? $this->resolveServices($call[1]) : array(); - $definition->addMethodCall($call[0], $args); - } - } - - if (isset($service['tags'])) { - if (!is_array($service['tags'])) { - throw new InvalidArgumentException(sprintf('Parameter "tags" must be an array for service "%s" in %s.', $id, $file)); - } - - foreach ($service['tags'] as $tag) { - if (!isset($tag['name'])) { - throw new InvalidArgumentException(sprintf('A "tags" entry is missing a "name" key for service "%s" in %s.', $id, $file)); - } - - $name = $tag['name']; - unset($tag['name']); - - foreach ($tag as $attribute => $value) { - if (!is_scalar($value)) { - throw new InvalidArgumentException(sprintf('A "tags" attribute must be of a scalar-type for service "%s", tag "%s" in %s.', $id, $name, $file)); - } - } - - $definition->addTag($name, $tag); - } - } - - $this->container->setDefinition($id, $definition); - } - - /** - * Loads a YAML file. - * - * @param string $file - * - * @return array The file content - */ - private function loadFile($file) - { - return $this->validate(Yaml::parse($file), $file); - } - - /** - * Validates a YAML file. - * - * @param mixed $content - * @param string $file - * - * @return array - * - * @throws InvalidArgumentException When service file is not valid - */ - private function validate($content, $file) - { - if (null === $content) { - return $content; - } - - if (!is_array($content)) { - throw new InvalidArgumentException(sprintf('The service file "%s" is not valid.', $file)); - } - - foreach (array_keys($content) as $namespace) { - if (in_array($namespace, array('imports', 'parameters', 'services'))) { - continue; - } - - if (!$this->container->hasExtension($namespace)) { - $extensionNamespaces = array_filter(array_map(function ($ext) { return $ext->getAlias(); }, $this->container->getExtensions())); - throw new InvalidArgumentException(sprintf( - 'There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s', - $namespace, - $file, - $namespace, - $extensionNamespaces ? sprintf('"%s"', implode('", "', $extensionNamespaces)) : 'none' - )); - } - } - - return $content; - } - - /** - * Resolves services. - * - * @param string $value - * - * @return Reference - */ - private function resolveServices($value) - { - if (is_array($value)) { - $value = array_map(array($this, 'resolveServices'), $value); - } elseif (is_string($value) && 0 === strpos($value, '@')) { - if (0 === strpos($value, '@?')) { - $value = substr($value, 2); - $invalidBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE; - } else { - $value = substr($value, 1); - $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE; - } - - if ('=' === substr($value, -1)) { - $value = substr($value, 0, -1); - $strict = false; - } else { - $strict = true; - } - - $value = new Reference($value, $invalidBehavior, $strict); - } - - return $value; - } - - /** - * Loads from Extensions - * - * @param array $content - */ - private function loadFromExtensions($content) - { - foreach ($content as $namespace => $values) { - if (in_array($namespace, array('imports', 'parameters', 'services'))) { - continue; - } - - if (!is_array($values)) { - $values = array(); - } - - $this->container->loadFromExtension($namespace, $values); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd deleted file mode 100644 index 316f2d7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Parameter.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Parameter.php deleted file mode 100644 index 7ba8c3a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Parameter.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection; - -/** - * Parameter represents a parameter reference. - * - * @author Fabien Potencier - * - * @api - */ -class Parameter -{ - private $id; - - /** - * Constructor. - * - * @param string $id The parameter key - */ - public function __construct($id) - { - $this->id = $id; - } - - /** - * __toString. - * - * @return string The parameter key - */ - public function __toString() - { - return (string) $this->id; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php deleted file mode 100644 index 9664b13..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\ParameterBag; - -use Symfony\Component\DependencyInjection\Exception\LogicException; - -/** - * Holds read-only parameters. - * - * @author Fabien Potencier - * - * @api - */ -class FrozenParameterBag extends ParameterBag -{ - /** - * Constructor. - * - * For performance reasons, the constructor assumes that - * all keys are already lowercased. - * - * This is always the case when used internally. - * - * @param array $parameters An array of parameters - * - * @api - */ - public function __construct(array $parameters = array()) - { - $this->parameters = $parameters; - $this->resolved = true; - } - - /** - * {@inheritDoc} - * - * @api - */ - public function clear() - { - throw new LogicException('Impossible to call clear() on a frozen ParameterBag.'); - } - - /** - * {@inheritDoc} - * - * @api - */ - public function add(array $parameters) - { - throw new LogicException('Impossible to call add() on a frozen ParameterBag.'); - } - - /** - * {@inheritDoc} - * - * @api - */ - public function set($name, $value) - { - throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php deleted file mode 100644 index 908e2a1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php +++ /dev/null @@ -1,294 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\ParameterBag; - -use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; -use Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; - -/** - * Holds parameters. - * - * @author Fabien Potencier - * - * @api - */ -class ParameterBag implements ParameterBagInterface -{ - protected $parameters; - protected $resolved; - - /** - * Constructor. - * - * @param array $parameters An array of parameters - * - * @api - */ - public function __construct(array $parameters = array()) - { - $this->parameters = array(); - $this->add($parameters); - $this->resolved = false; - } - - /** - * Clears all parameters. - * - * @api - */ - public function clear() - { - $this->parameters = array(); - } - - /** - * Adds parameters to the service container parameters. - * - * @param array $parameters An array of parameters - * - * @api - */ - public function add(array $parameters) - { - foreach ($parameters as $key => $value) { - $this->parameters[strtolower($key)] = $value; - } - } - - /** - * Gets the service container parameters. - * - * @return array An array of parameters - * - * @api - */ - public function all() - { - return $this->parameters; - } - - /** - * Gets a service container parameter. - * - * @param string $name The parameter name - * - * @return mixed The parameter value - * - * @throws ParameterNotFoundException if the parameter is not defined - * - * @api - */ - public function get($name) - { - $name = strtolower($name); - - if (!array_key_exists($name, $this->parameters)) { - throw new ParameterNotFoundException($name); - } - - return $this->parameters[$name]; - } - - /** - * Sets a service container parameter. - * - * @param string $name The parameter name - * @param mixed $value The parameter value - * - * @api - */ - public function set($name, $value) - { - $this->parameters[strtolower($name)] = $value; - } - - /** - * Returns true if a parameter name is defined. - * - * @param string $name The parameter name - * - * @return Boolean true if the parameter name is defined, false otherwise - * - * @api - */ - public function has($name) - { - return array_key_exists(strtolower($name), $this->parameters); - } - - /** - * Removes a parameter. - * - * @param string $key The key - * - * @api - */ - public function remove($key) - { - unset($this->parameters[$key]); - } - - /** - * Replaces parameter placeholders (%name%) by their values for all parameters. - */ - public function resolve() - { - if ($this->resolved) { - return; - } - - $parameters = array(); - foreach ($this->parameters as $key => $value) { - try { - $value = $this->resolveValue($value); - $parameters[$key] = $this->unescapeValue($value); - } catch (ParameterNotFoundException $e) { - $e->setSourceKey($key); - - throw $e; - } - } - - $this->parameters = $parameters; - $this->resolved = true; - } - - /** - * Replaces parameter placeholders (%name%) by their values. - * - * @param mixed $value A value - * @param array $resolving An array of keys that are being resolved (used internally to detect circular references) - * - * @return mixed The resolved value - * - * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist - * @throws ParameterCircularReferenceException if a circular reference if detected - * @throws RuntimeException when a given parameter has a type problem. - */ - public function resolveValue($value, array $resolving = array()) - { - if (is_array($value)) { - $args = array(); - foreach ($value as $k => $v) { - $args[$this->resolveValue($k, $resolving)] = $this->resolveValue($v, $resolving); - } - - return $args; - } - - if (!is_string($value)) { - return $value; - } - - return $this->resolveString($value, $resolving); - } - - /** - * Resolves parameters inside a string - * - * @param string $value The string to resolve - * @param array $resolving An array of keys that are being resolved (used internally to detect circular references) - * - * @return string The resolved string - * - * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist - * @throws ParameterCircularReferenceException if a circular reference if detected - * @throws RuntimeException when a given parameter has a type problem. - */ - public function resolveString($value, array $resolving = array()) - { - // we do this to deal with non string values (Boolean, integer, ...) - // as the preg_replace_callback throw an exception when trying - // a non-string in a parameter value - if (preg_match('/^%([^%\s]+)%$/', $value, $match)) { - $key = strtolower($match[1]); - - if (isset($resolving[$key])) { - throw new ParameterCircularReferenceException(array_keys($resolving)); - } - - $resolving[$key] = true; - - return $this->resolved ? $this->get($key) : $this->resolveValue($this->get($key), $resolving); - } - - $self = $this; - - return preg_replace_callback('/%%|%([^%\s]+)%/', function ($match) use ($self, $resolving, $value) { - // skip %% - if (!isset($match[1])) { - return '%%'; - } - - $key = strtolower($match[1]); - if (isset($resolving[$key])) { - throw new ParameterCircularReferenceException(array_keys($resolving)); - } - - $resolved = $self->get($key); - - if (!is_string($resolved) && !is_numeric($resolved)) { - throw new RuntimeException(sprintf('A string value must be composed of strings and/or numbers, but found parameter "%s" of type %s inside string value "%s".', $key, gettype($resolved), $value)); - } - - $resolved = (string) $resolved; - $resolving[$key] = true; - - return $self->isResolved() ? $resolved : $self->resolveString($resolved, $resolving); - }, $value); - } - - public function isResolved() - { - return $this->resolved; - } - - /** - * {@inheritDoc} - */ - public function escapeValue($value) - { - if (is_string($value)) { - return str_replace('%', '%%', $value); - } - - if (is_array($value)) { - $result = array(); - foreach ($value as $k => $v) { - $result[$k] = $this->escapeValue($v); - } - - return $result; - } - - return $value; - } - - public function unescapeValue($value) - { - if (is_string($value)) { - return str_replace('%%', '%', $value); - } - - if (is_array($value)) { - $result = array(); - foreach ($value as $k => $v) { - $result[$k] = $this->unescapeValue($v); - } - - return $result; - } - - return $value; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php deleted file mode 100644 index a26d6ae..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\ParameterBag; - -use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; - -/** - * ParameterBagInterface. - * - * @author Fabien Potencier - * - * @api - */ -interface ParameterBagInterface -{ - /** - * Clears all parameters. - * - * @api - */ - public function clear(); - - /** - * Adds parameters to the service container parameters. - * - * @param array $parameters An array of parameters - * - * @api - */ - public function add(array $parameters); - - /** - * Gets the service container parameters. - * - * @return array An array of parameters - * - * @api - */ - public function all(); - - /** - * Gets a service container parameter. - * - * @param string $name The parameter name - * - * @return mixed The parameter value - * - * @throws ParameterNotFoundException if the parameter is not defined - * - * @api - */ - public function get($name); - - /** - * Sets a service container parameter. - * - * @param string $name The parameter name - * @param mixed $value The parameter value - * - * @api - */ - public function set($name, $value); - - /** - * Returns true if a parameter name is defined. - * - * @param string $name The parameter name - * - * @return Boolean true if the parameter name is defined, false otherwise - * - * @api - */ - public function has($name); - - /** - * Replaces parameter placeholders (%name%) by their values for all parameters. - */ - public function resolve(); - - /** - * Replaces parameter placeholders (%name%) by their values. - * - * @param mixed $value A value - * - * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist - */ - public function resolveValue($value); - - /** - * Escape parameter placeholders % - * - * @param mixed $value - * - * @return mixed - */ - public function escapeValue($value); - - /** - * Unescape parameter placeholders % - * - * @param mixed $value - * - * @return mixed - */ - public function unescapeValue($value); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/README.md b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/README.md deleted file mode 100644 index 5cb62cf..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/README.md +++ /dev/null @@ -1,76 +0,0 @@ -DependencyInjection Component -============================= - -DependencyInjection manages your services via a robust and flexible Dependency -Injection Container. - -Here is a simple example that shows how to register services and parameters: - - use Symfony\Component\DependencyInjection\ContainerBuilder; - use Symfony\Component\DependencyInjection\Reference; - - $sc = new ContainerBuilder(); - $sc - ->register('foo', '%foo.class%') - ->addArgument(new Reference('bar')) - ; - $sc->setParameter('foo.class', 'Foo'); - - $sc->get('foo'); - -Method Calls (Setter Injection): - - $sc = new ContainerBuilder(); - - $sc - ->register('bar', '%bar.class%') - ->addMethodCall('setFoo', array(new Reference('foo'))) - ; - $sc->setParameter('bar.class', 'Bar'); - - $sc->get('bar'); - -Factory Class: - -If your service is retrieved by calling a static method: - - $sc = new ContainerBuilder(); - - $sc - ->register('bar', '%bar.class%') - ->setFactoryClass('%bar.class%') - ->setFactoryMethod('getInstance') - ->addArgument('Aarrg!!!') - ; - $sc->setParameter('bar.class', 'Bar'); - - $sc->get('bar'); - -File Include: - -For some services, especially those that are difficult or impossible to -autoload, you may need the container to include a file before -instantiating your class. - - $sc = new ContainerBuilder(); - - $sc - ->register('bar', '%bar.class%') - ->setFile('/path/to/file') - ->addArgument('Aarrg!!!') - ; - $sc->setParameter('bar.class', 'Bar'); - - $sc->get('bar'); - -Resources ---------- - -You can run the unit tests with the following command: - - phpunit - -If you also want to run the unit tests that depend on other Symfony -Components, install dev dependencies before running PHPUnit: - - php composer.phar install --dev diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Reference.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Reference.php deleted file mode 100644 index 1517da2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Reference.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection; - -/** - * Reference represents a service reference. - * - * @author Fabien Potencier - * - * @api - */ -class Reference -{ - private $id; - private $invalidBehavior; - private $strict; - - /** - * Constructor. - * - * @param string $id The service identifier - * @param int $invalidBehavior The behavior when the service does not exist - * @param Boolean $strict Sets how this reference is validated - * - * @see Container - */ - public function __construct($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, $strict = true) - { - $this->id = strtolower($id); - $this->invalidBehavior = $invalidBehavior; - $this->strict = $strict; - } - - /** - * __toString. - * - * @return string The service identifier - */ - public function __toString() - { - return (string) $this->id; - } - - /** - * Returns the behavior to be used when the service does not exist. - * - * @return int - */ - public function getInvalidBehavior() - { - return $this->invalidBehavior; - } - - /** - * Returns true when this Reference is strict - * - * @return Boolean - */ - public function isStrict() - { - return $this->strict; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Scope.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Scope.php deleted file mode 100644 index 161229e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Scope.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection; - -/** - * Scope class. - * - * @author Johannes M. Schmitt - * - * @api - */ -class Scope implements ScopeInterface -{ - private $name; - private $parentName; - - /** - * @api - */ - public function __construct($name, $parentName = ContainerInterface::SCOPE_CONTAINER) - { - $this->name = $name; - $this->parentName = $parentName; - } - - /** - * @api - */ - public function getName() - { - return $this->name; - } - - /** - * @api - */ - public function getParentName() - { - return $this->parentName; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ScopeInterface.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ScopeInterface.php deleted file mode 100644 index 81ac67c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ScopeInterface.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection; - -/** - * Scope Interface. - * - * @author Johannes M. Schmitt - * - * @api - */ -interface ScopeInterface -{ - /** - * @api - */ - public function getName(); - - /** - * @api - */ - public function getParentName(); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/SimpleXMLElement.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/SimpleXMLElement.php deleted file mode 100644 index d154602..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/SimpleXMLElement.php +++ /dev/null @@ -1,127 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection; - -/** - * SimpleXMLElement class. - * - * @author Fabien Potencier - */ -class SimpleXMLElement extends \SimpleXMLElement -{ - /** - * Converts an attribute as a php type. - * - * @param string $name - * - * @return mixed - */ - public function getAttributeAsPhp($name) - { - return self::phpize($this[$name]); - } - - /** - * Returns arguments as valid php types. - * - * @param string $name - * @param Boolean $lowercase - * - * @return mixed - */ - public function getArgumentsAsPhp($name, $lowercase = true) - { - $arguments = array(); - foreach ($this->$name as $arg) { - if (isset($arg['name'])) { - $arg['key'] = (string) $arg['name']; - } - $key = isset($arg['key']) ? (string) $arg['key'] : (!$arguments ? 0 : max(array_keys($arguments)) + 1); - - // parameter keys are case insensitive - if ('parameter' == $name && $lowercase) { - $key = strtolower($key); - } - - // this is used by DefinitionDecorator to overwrite a specific - // argument of the parent definition - if (isset($arg['index'])) { - $key = 'index_'.$arg['index']; - } - - switch ($arg['type']) { - case 'service': - $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE; - if (isset($arg['on-invalid']) && 'ignore' == $arg['on-invalid']) { - $invalidBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE; - } elseif (isset($arg['on-invalid']) && 'null' == $arg['on-invalid']) { - $invalidBehavior = ContainerInterface::NULL_ON_INVALID_REFERENCE; - } - - if (isset($arg['strict'])) { - $strict = self::phpize($arg['strict']); - } else { - $strict = true; - } - - $arguments[$key] = new Reference((string) $arg['id'], $invalidBehavior, $strict); - break; - case 'collection': - $arguments[$key] = $arg->getArgumentsAsPhp($name, false); - break; - case 'string': - $arguments[$key] = (string) $arg; - break; - case 'constant': - $arguments[$key] = constant((string) $arg); - break; - default: - $arguments[$key] = self::phpize($arg); - } - } - - return $arguments; - } - - /** - * Converts an xml value to a php type. - * - * @param mixed $value - * - * @return mixed - */ - public static function phpize($value) - { - $value = (string) $value; - $lowercaseValue = strtolower($value); - - switch (true) { - case 'null' === $lowercaseValue: - return null; - case ctype_digit($value): - $raw = $value; - $cast = intval($value); - - return '0' == $value[0] ? octdec($value) : (((string) $raw == (string) $cast) ? $cast : $raw); - case 'true' === $lowercaseValue: - return true; - case 'false' === $lowercaseValue: - return false; - case is_numeric($value): - return '0x' == $value[0].$value[1] ? hexdec($value) : floatval($value); - case preg_match('/^(-|\+)?[0-9,]+(\.[0-9]+)?$/', $value): - return floatval(str_replace(',', '', $value)); - default: - return $value; - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/TaggedContainerInterface.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/TaggedContainerInterface.php deleted file mode 100644 index 3b48817..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/TaggedContainerInterface.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection; - -/** - * TaggedContainerInterface is the interface implemented when a container knows how to deals with tags. - * - * @author Fabien Potencier - * - * @api - */ -interface TaggedContainerInterface extends ContainerInterface -{ - /** - * Returns service ids for a given tag. - * - * @param string $name The tag name - * - * @return array An array of tags - * - * @api - */ - public function findTaggedServiceIds($name); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php deleted file mode 100644 index c99659e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Compiler\Compiler; -use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass; -use Symfony\Component\DependencyInjection\Compiler\RepeatedPass; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class AnalyzeServiceReferencesPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcess() - { - $container = new ContainerBuilder(); - - $a = $container - ->register('a') - ->addArgument($ref1 = new Reference('b')) - ; - - $b = $container - ->register('b') - ->addMethodCall('setA', array($ref2 = new Reference('a'))) - ; - - $c = $container - ->register('c') - ->addArgument($ref3 = new Reference('a')) - ->addArgument($ref4 = new Reference('b')) - ; - - $d = $container - ->register('d') - ->setProperty('foo', $ref5 = new Reference('b')) - ; - - $e = $container - ->register('e') - ->setConfigurator(array($ref6 = new Reference('b'), 'methodName')) - ; - - $graph = $this->process($container); - - $this->assertCount(4, $edges = $graph->getNode('b')->getInEdges()); - - $this->assertSame($ref1, $edges[0]->getValue()); - $this->assertSame($ref4, $edges[1]->getValue()); - $this->assertSame($ref5, $edges[2]->getValue()); - $this->assertSame($ref6, $edges[3]->getValue()); - } - - public function testProcessDetectsReferencesFromInlinedDefinitions() - { - $container = new ContainerBuilder(); - - $container - ->register('a') - ; - - $container - ->register('b') - ->addArgument(new Definition(null, array($ref = new Reference('a')))) - ; - - $graph = $this->process($container); - - $this->assertCount(1, $refs = $graph->getNode('a')->getInEdges()); - $this->assertSame($ref, $refs[0]->getValue()); - } - - public function testProcessDoesNotSaveDuplicateReferences() - { - $container = new ContainerBuilder(); - - $container - ->register('a') - ; - $container - ->register('b') - ->addArgument(new Definition(null, array($ref1 = new Reference('a')))) - ->addArgument(new Definition(null, array($ref2 = new Reference('a')))) - ; - - $graph = $this->process($container); - - $this->assertCount(2, $graph->getNode('a')->getInEdges()); - } - - protected function process(ContainerBuilder $container) - { - $pass = new RepeatedPass(array(new AnalyzeServiceReferencesPass())); - $pass->process($container); - - return $container->getCompiler()->getServiceReferenceGraph(); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckCircularReferencesPassTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckCircularReferencesPassTest.php deleted file mode 100644 index 25f816b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckCircularReferencesPassTest.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Reference; - -use Symfony\Component\DependencyInjection\Compiler\CheckCircularReferencesPass; - -use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass; - -use Symfony\Component\DependencyInjection\Compiler\Compiler; - -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class CheckCircularReferencesPassTest extends \PHPUnit_Framework_TestCase -{ - /** - * @expectedException \RuntimeException - */ - public function testProcess() - { - $container = new ContainerBuilder(); - $container->register('a')->addArgument(new Reference('b')); - $container->register('b')->addArgument(new Reference('a')); - - $this->process($container); - } - - /** - * @expectedException \RuntimeException - */ - public function testProcessWithAliases() - { - $container = new ContainerBuilder(); - $container->register('a')->addArgument(new Reference('b')); - $container->setAlias('b', 'c'); - $container->setAlias('c', 'a'); - - $this->process($container); - } - - /** - * @expectedException \RuntimeException - */ - public function testProcessDetectsIndirectCircularReference() - { - $container = new ContainerBuilder(); - $container->register('a')->addArgument(new Reference('b')); - $container->register('b')->addArgument(new Reference('c')); - $container->register('c')->addArgument(new Reference('a')); - - $this->process($container); - } - - public function testProcessIgnoresMethodCalls() - { - $container = new ContainerBuilder(); - $container->register('a')->addArgument(new Reference('b')); - $container->register('b')->addMethodCall('setA', array(new Reference('a'))); - - $this->process($container); - } - - protected function process(ContainerBuilder $container) - { - $compiler = new Compiler(); - $passConfig = $compiler->getPassConfig(); - $passConfig->setOptimizationPasses(array( - new AnalyzeServiceReferencesPass(true), - new CheckCircularReferencesPass(), - )); - $passConfig->setRemovingPasses(array()); - - $compiler->compile($container); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckDefinitionValidityPassTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckDefinitionValidityPassTest.php deleted file mode 100644 index 06845a2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckDefinitionValidityPassTest.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Compiler\CheckDefinitionValidityPass; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class CheckDefinitionValidityPassTest extends \PHPUnit_Framework_TestCase -{ - /** - * @expectedException \RuntimeException - */ - public function testProcessDetectsSyntheticNonPublicDefinitions() - { - $container = new ContainerBuilder(); - $container->register('a')->setSynthetic(true)->setPublic(false); - - $this->process($container); - } - - /** - * @expectedException \RuntimeException - */ - public function testProcessDetectsSyntheticPrototypeDefinitions() - { - $container = new ContainerBuilder(); - $container->register('a')->setSynthetic(true)->setScope(ContainerInterface::SCOPE_PROTOTYPE); - - $this->process($container); - } - - /** - * @expectedException \RuntimeException - */ - public function testProcessDetectsNonSyntheticNonAbstractDefinitionWithoutClass() - { - $container = new ContainerBuilder(); - $container->register('a')->setSynthetic(false)->setAbstract(false); - - $this->process($container); - } - - public function testProcess() - { - $container = new ContainerBuilder(); - $container->register('a', 'class'); - $container->register('b', 'class')->setSynthetic(true)->setPublic(true); - $container->register('c', 'class')->setAbstract(true); - $container->register('d', 'class')->setSynthetic(true); - - $this->process($container); - } - - protected function process(ContainerBuilder $container) - { - $pass = new CheckDefinitionValidityPass(); - $pass->process($container); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckExceptionOnInvalidReferenceBehaviorPassTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckExceptionOnInvalidReferenceBehaviorPassTest.php deleted file mode 100644 index cbf9934..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckExceptionOnInvalidReferenceBehaviorPassTest.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Definition; - -use Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class CheckExceptionOnInvalidReferenceBehaviorPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcess() - { - $container = new ContainerBuilder(); - - $container - ->register('a', '\stdClass') - ->addArgument(new Reference('b')) - ; - $container->register('b', '\stdClass'); - } - - /** - * @expectedException Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException - */ - public function testProcessThrowsExceptionOnInvalidReference() - { - $container = new ContainerBuilder(); - - $container - ->register('a', '\stdClass') - ->addArgument(new Reference('b')) - ; - - $this->process($container); - } - - /** - * @expectedException Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException - */ - public function testProcessThrowsExceptionOnInvalidReferenceFromInlinedDefinition() - { - $container = new ContainerBuilder(); - - $def = new Definition(); - $def->addArgument(new Reference('b')); - - $container - ->register('a', '\stdClass') - ->addArgument($def) - ; - - $this->process($container); - } - - private function process(ContainerBuilder $container) - { - $pass = new CheckExceptionOnInvalidReferenceBehaviorPass(); - $pass->process($container); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckReferenceValidityPassTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckReferenceValidityPassTest.php deleted file mode 100644 index ee18e5c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckReferenceValidityPassTest.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Scope; - -use Symfony\Component\DependencyInjection\Compiler\CheckReferenceValidityPass; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class CheckReferenceValidityPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcessIgnoresScopeWideningIfNonStrictReference() - { - $container = new ContainerBuilder(); - $container->register('a')->addArgument(new Reference('b', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, false)); - $container->register('b')->setScope('prototype'); - - $this->process($container); - } - - /** - * @expectedException \RuntimeException - */ - public function testProcessDetectsScopeWidening() - { - $container = new ContainerBuilder(); - $container->register('a')->addArgument(new Reference('b')); - $container->register('b')->setScope('prototype'); - - $this->process($container); - } - - public function testProcessIgnoresCrossScopeHierarchyReferenceIfNotStrict() - { - $container = new ContainerBuilder(); - $container->addScope(new Scope('a')); - $container->addScope(new Scope('b')); - - $container->register('a')->setScope('a')->addArgument(new Reference('b', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, false)); - $container->register('b')->setScope('b'); - - $this->process($container); - } - - /** - * @expectedException \RuntimeException - */ - public function testProcessDetectsCrossScopeHierarchyReference() - { - $container = new ContainerBuilder(); - $container->addScope(new Scope('a')); - $container->addScope(new Scope('b')); - - $container->register('a')->setScope('a')->addArgument(new Reference('b')); - $container->register('b')->setScope('b'); - - $this->process($container); - } - - /** - * @expectedException \RuntimeException - */ - public function testProcessDetectsReferenceToAbstractDefinition() - { - $container = new ContainerBuilder(); - - $container->register('a')->setAbstract(true); - $container->register('b')->addArgument(new Reference('a')); - - $this->process($container); - } - - public function testProcess() - { - $container = new ContainerBuilder(); - $container->register('a')->addArgument(new Reference('b')); - $container->register('b'); - - $this->process($container); - } - - protected function process(ContainerBuilder $container) - { - $pass = new CheckReferenceValidityPass(); - $pass->process($container); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php deleted file mode 100644 index f22f0da..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Scope; - -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass; -use Symfony\Component\DependencyInjection\Compiler\Compiler; -use Symfony\Component\DependencyInjection\Compiler\RepeatedPass; -use Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class InlineServiceDefinitionsPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcess() - { - $container = new ContainerBuilder(); - $container - ->register('inlinable.service') - ->setPublic(false) - ; - - $container - ->register('service') - ->setArguments(array(new Reference('inlinable.service'))) - ; - - $this->process($container); - - $arguments = $container->getDefinition('service')->getArguments(); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Definition', $arguments[0]); - $this->assertSame($container->getDefinition('inlinable.service'), $arguments[0]); - } - - public function testProcessDoesNotInlineWhenAliasedServiceIsNotOfPrototypeScope() - { - $container = new ContainerBuilder(); - $container - ->register('foo') - ->setPublic(false) - ; - $container->setAlias('moo', 'foo'); - - $container - ->register('service') - ->setArguments(array($ref = new Reference('foo'))) - ; - - $this->process($container); - - $arguments = $container->getDefinition('service')->getArguments(); - $this->assertSame($ref, $arguments[0]); - } - - public function testProcessDoesInlineServiceOfPrototypeScope() - { - $container = new ContainerBuilder(); - $container - ->register('foo') - ->setScope('prototype') - ; - $container - ->register('bar') - ->setPublic(false) - ->setScope('prototype') - ; - $container->setAlias('moo', 'bar'); - - $container - ->register('service') - ->setArguments(array(new Reference('foo'), $ref = new Reference('moo'), new Reference('bar'))) - ; - - $this->process($container); - - $arguments = $container->getDefinition('service')->getArguments(); - $this->assertEquals($container->getDefinition('foo'), $arguments[0]); - $this->assertNotSame($container->getDefinition('foo'), $arguments[0]); - $this->assertSame($ref, $arguments[1]); - $this->assertEquals($container->getDefinition('bar'), $arguments[2]); - $this->assertNotSame($container->getDefinition('bar'), $arguments[2]); - } - - public function testProcessInlinesIfMultipleReferencesButAllFromTheSameDefinition() - { - $container = new ContainerBuilder(); - - $a = $container->register('a')->setPublic(false); - $b = $container - ->register('b') - ->addArgument(new Reference('a')) - ->addArgument(new Definition(null, array(new Reference('a')))) - ; - - $this->process($container); - - $arguments = $b->getArguments(); - $this->assertSame($a, $arguments[0]); - - $inlinedArguments = $arguments[1]->getArguments(); - $this->assertSame($a, $inlinedArguments[0]); - } - - public function testProcessInlinesOnlyIfSameScope() - { - $container = new ContainerBuilder(); - - $container->addScope(new Scope('foo')); - $a = $container->register('a')->setPublic(false)->setScope('foo'); - $b = $container->register('b')->addArgument(new Reference('a')); - - $this->process($container); - $arguments = $b->getArguments(); - $this->assertEquals(new Reference('a'), $arguments[0]); - $this->assertTrue($container->hasDefinition('a')); - } - - protected function process(ContainerBuilder $container) - { - $repeatedPass = new RepeatedPass(array(new AnalyzeServiceReferencesPass(), new InlineServiceDefinitionsPass())); - $repeatedPass->process($container); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php deleted file mode 100644 index c16e9e0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php +++ /dev/null @@ -1,118 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Alias; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * This class tests the integration of the different compiler passes - */ -class IntegrationTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - - /** - * This tests that the following dependencies are correctly processed: - * - * A is public, B/C are private - * A -> C - * B -> C - */ - public function testProcessRemovesAndInlinesRecursively() - { - $container = new ContainerBuilder(); - - $a = $container - ->register('a', '\stdClass') - ->addArgument(new Reference('c')) - ; - - $b = $container - ->register('b', '\stdClass') - ->addArgument(new Reference('c')) - ->setPublic(false) - ; - - $c = $container - ->register('c', '\stdClass') - ->setPublic(false) - ; - - $container->compile(); - - $this->assertTrue($container->hasDefinition('a')); - $arguments = $a->getArguments(); - $this->assertSame($c, $arguments[0]); - $this->assertFalse($container->hasDefinition('b')); - $this->assertFalse($container->hasDefinition('c')); - } - - public function testProcessInlinesReferencesToAliases() - { - $container = new ContainerBuilder(); - - $a = $container - ->register('a', '\stdClass') - ->addArgument(new Reference('b')) - ; - - $container->setAlias('b', new Alias('c', false)); - - $c = $container - ->register('c', '\stdClass') - ->setPublic(false) - ; - - $container->compile(); - - $this->assertTrue($container->hasDefinition('a')); - $arguments = $a->getArguments(); - $this->assertSame($c, $arguments[0]); - $this->assertFalse($container->hasAlias('b')); - $this->assertFalse($container->hasDefinition('c')); - } - - public function testProcessInlinesWhenThereAreMultipleReferencesButFromTheSameDefinition() - { - $container = new ContainerBuilder(); - - $container - ->register('a', '\stdClass') - ->addArgument(new Reference('b')) - ->addMethodCall('setC', array(new Reference('c'))) - ; - - $container - ->register('b', '\stdClass') - ->addArgument(new Reference('c')) - ->setPublic(false) - ; - - $container - ->register('c', '\stdClass') - ->setPublic(false) - ; - - $container->compile(); - - $this->assertTrue($container->hasDefinition('a')); - $this->assertFalse($container->hasDefinition('b')); - $this->assertFalse($container->hasDefinition('c'), 'Service C was not inlined.'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php deleted file mode 100644 index d7e5521..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass; -use Symfony\Component\DependencyInjection\Compiler\Compiler; -use Symfony\Component\DependencyInjection\Compiler\RepeatedPass; -use Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class RemoveUnusedDefinitionsPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcess() - { - $container = new ContainerBuilder(); - $container - ->register('foo') - ->setPublic(false) - ; - $container - ->register('bar') - ->setPublic(false) - ; - $container - ->register('moo') - ->setArguments(array(new Reference('bar'))) - ; - - $this->process($container); - - $this->assertFalse($container->hasDefinition('foo')); - $this->assertTrue($container->hasDefinition('bar')); - $this->assertTrue($container->hasDefinition('moo')); - } - - public function testProcessRemovesUnusedDefinitionsRecursively() - { - $container = new ContainerBuilder(); - $container - ->register('foo') - ->setPublic(false) - ; - $container - ->register('bar') - ->setArguments(array(new Reference('foo'))) - ->setPublic(false) - ; - - $this->process($container); - - $this->assertFalse($container->hasDefinition('foo')); - $this->assertFalse($container->hasDefinition('bar')); - } - - public function testProcessWorksWithInlinedDefinitions() - { - $container = new ContainerBuilder(); - $container - ->register('foo') - ->setPublic(false) - ; - $container - ->register('bar') - ->setArguments(array(new Definition(null, array(new Reference('foo'))))) - ; - - $this->process($container); - - $this->assertTrue($container->hasDefinition('foo')); - $this->assertTrue($container->hasDefinition('bar')); - } - - protected function process(ContainerBuilder $container) - { - $repeatedPass = new RepeatedPass(array(new AnalyzeServiceReferencesPass(), new RemoveUnusedDefinitionsPass())); - $repeatedPass->process($container); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php deleted file mode 100644 index a445a20..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Definition; - -class ReplaceAliasByActualDefinitionPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcess() - { - $container = new ContainerBuilder(); - - $container->register('a', '\stdClass'); - - $bDefinition = new Definition('\stdClass'); - $bDefinition->setPublic(false); - $container->setDefinition('b', $bDefinition); - - $container->setAlias('a_alias', 'a'); - $container->setAlias('b_alias', 'b'); - - $this->process($container); - - $this->assertTrue($container->has('a'), '->process() does nothing to public definitions.'); - $this->assertTrue($container->hasAlias('a_alias')); - $this->assertFalse($container->has('b'), '->process() removes non-public definitions.'); - $this->assertTrue( - $container->has('b_alias') && !$container->hasAlias('b_alias'), - '->process() replaces alias to actual.' - ); - } - - protected function process(ContainerBuilder $container) - { - $pass = new ReplaceAliasByActualDefinitionPass(); - $pass->process($container); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php deleted file mode 100644 index f3c5b15..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php +++ /dev/null @@ -1,151 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class ResolveDefinitionTemplatesPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcess() - { - $container = new ContainerBuilder(); - $container->register('parent', 'foo')->setArguments(array('moo', 'b'))->setProperty('foo', 'moo'); - $container->setDefinition('child', new DefinitionDecorator('parent')) - ->replaceArgument(0, 'a') - ->setProperty('foo', 'bar') - ->setClass('bar') - ; - - $this->process($container); - - $def = $container->getDefinition('child'); - $this->assertNotInstanceOf('Symfony\Component\DependencyInjection\DefinitionDecorator', $def); - $this->assertEquals('bar', $def->getClass()); - $this->assertEquals(array('a', 'b'), $def->getArguments()); - $this->assertEquals(array('foo' => 'bar'), $def->getProperties()); - } - - public function testProcessAppendsMethodCallsAlways() - { - $container = new ContainerBuilder(); - - $container - ->register('parent') - ->addMethodCall('foo', array('bar')) - ; - - $container - ->setDefinition('child', new DefinitionDecorator('parent')) - ->addMethodCall('bar', array('foo')) - ; - - $this->process($container); - - $def = $container->getDefinition('child'); - $this->assertEquals(array( - array('foo', array('bar')), - array('bar', array('foo')), - ), $def->getMethodCalls()); - } - - public function testProcessDoesNotCopyAbstract() - { - $container = new ContainerBuilder(); - - $container - ->register('parent') - ->setAbstract(true) - ; - - $container - ->setDefinition('child', new DefinitionDecorator('parent')) - ; - - $this->process($container); - - $def = $container->getDefinition('child'); - $this->assertFalse($def->isAbstract()); - } - - public function testProcessDoesNotCopyScope() - { - $container = new ContainerBuilder(); - - $container - ->register('parent') - ->setScope('foo') - ; - - $container - ->setDefinition('child', new DefinitionDecorator('parent')) - ; - - $this->process($container); - - $def = $container->getDefinition('child'); - $this->assertEquals(ContainerInterface::SCOPE_CONTAINER, $def->getScope()); - } - - public function testProcessDoesNotCopyTags() - { - $container = new ContainerBuilder(); - - $container - ->register('parent') - ->addTag('foo') - ; - - $container - ->setDefinition('child', new DefinitionDecorator('parent')) - ; - - $this->process($container); - - $def = $container->getDefinition('child'); - $this->assertEquals(array(), $def->getTags()); - } - - public function testProcessHandlesMultipleInheritance() - { - $container = new ContainerBuilder(); - - $container - ->register('parent', 'foo') - ->setArguments(array('foo', 'bar', 'c')) - ; - - $container - ->setDefinition('child2', new DefinitionDecorator('child1')) - ->replaceArgument(1, 'b') - ; - - $container - ->setDefinition('child1', new DefinitionDecorator('parent')) - ->replaceArgument(0, 'a') - ; - - $this->process($container); - - $def = $container->getDefinition('child2'); - $this->assertEquals(array('a', 'b', 'c'), $def->getArguments()); - $this->assertEquals('foo', $def->getClass()); - } - - protected function process(ContainerBuilder $container) - { - $pass = new ResolveDefinitionTemplatesPass(); - $pass->process($container); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInvalidReferencesPassTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInvalidReferencesPassTest.php deleted file mode 100644 index a18ba73..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInvalidReferencesPassTest.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Compiler\ResolveInvalidReferencesPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class ResolveInvalidReferencesPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcess() - { - $container = new ContainerBuilder(); - $def = $container - ->register('foo') - ->setArguments(array(new Reference('bar', ContainerInterface::NULL_ON_INVALID_REFERENCE))) - ->addMethodCall('foo', array(new Reference('moo', ContainerInterface::IGNORE_ON_INVALID_REFERENCE))) - ; - - $this->process($container); - - $arguments = $def->getArguments(); - $this->assertNull($arguments[0]); - $this->assertCount(0, $def->getMethodCalls()); - } - - public function testProcessIgnoreNonExistentServices() - { - $container = new ContainerBuilder(); - $def = $container - ->register('foo') - ->setArguments(array(new Reference('bar'))) - ; - - $this->process($container); - - $arguments = $def->getArguments(); - $this->assertEquals('bar', (string) $arguments[0]); - } - - public function testProcessRemovesPropertiesOnInvalid() - { - $container = new ContainerBuilder(); - $def = $container - ->register('foo') - ->setProperty('foo', new Reference('bar', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)) - ; - - $this->process($container); - - $this->assertEquals(array(), $def->getProperties()); - } - - protected function process(ContainerBuilder $container) - { - $pass = new ResolveInvalidReferencesPass(); - $pass->process($container); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php deleted file mode 100644 index ca089a5..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Compiler\ResolveReferencesToAliasesPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class ResolveReferencesToAliasesPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcess() - { - $container = new ContainerBuilder(); - $container->setAlias('bar', 'foo'); - $def = $container - ->register('moo') - ->setArguments(array(new Reference('bar'))) - ; - - $this->process($container); - - $arguments = $def->getArguments(); - $this->assertEquals('foo', (string) $arguments[0]); - } - - public function testProcessRecursively() - { - $container = new ContainerBuilder(); - $container->setAlias('bar', 'foo'); - $container->setAlias('moo', 'bar'); - $def = $container - ->register('foobar') - ->setArguments(array(new Reference('moo'))) - ; - - $this->process($container); - - $arguments = $def->getArguments(); - $this->assertEquals('foo', (string) $arguments[0]); - } - - protected function process(ContainerBuilder $container) - { - $pass = new ResolveReferencesToAliasesPass(); - $pass->process($container); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php deleted file mode 100644 index c9e6b07..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php +++ /dev/null @@ -1,553 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests; - -require_once __DIR__.'/Fixtures/includes/classes.php'; -require_once __DIR__.'/Fixtures/includes/ProjectExtension.php'; - -use Symfony\Component\DependencyInjection\Alias; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; -use Symfony\Component\Config\Resource\FileResource; - -class ContainerBuilderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::setDefinitions - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getDefinitions - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::setDefinition - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getDefinition - */ - public function testDefinitions() - { - $builder = new ContainerBuilder(); - $definitions = array( - 'foo' => new Definition('FooClass'), - 'bar' => new Definition('BarClass'), - ); - $builder->setDefinitions($definitions); - $this->assertEquals($definitions, $builder->getDefinitions(), '->setDefinitions() sets the service definitions'); - $this->assertTrue($builder->hasDefinition('foo'), '->hasDefinition() returns true if a service definition exists'); - $this->assertFalse($builder->hasDefinition('foobar'), '->hasDefinition() returns false if a service definition does not exist'); - - $builder->setDefinition('foobar', $foo = new Definition('FooBarClass')); - $this->assertEquals($foo, $builder->getDefinition('foobar'), '->getDefinition() returns a service definition if defined'); - $this->assertTrue($builder->setDefinition('foobar', $foo = new Definition('FooBarClass')) === $foo, '->setDefinition() implements a fluid interface by returning the service reference'); - - $builder->addDefinitions($defs = array('foobar' => new Definition('FooBarClass'))); - $this->assertEquals(array_merge($definitions, $defs), $builder->getDefinitions(), '->addDefinitions() adds the service definitions'); - - try { - $builder->getDefinition('baz'); - $this->fail('->getDefinition() throws an InvalidArgumentException if the service definition does not exist'); - } catch (\InvalidArgumentException $e) { - $this->assertEquals('The service definition "baz" does not exist.', $e->getMessage(), '->getDefinition() throws an InvalidArgumentException if the service definition does not exist'); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::register - */ - public function testRegister() - { - $builder = new ContainerBuilder(); - $builder->register('foo', 'FooClass'); - $this->assertTrue($builder->hasDefinition('foo'), '->register() registers a new service definition'); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Definition', $builder->getDefinition('foo'), '->register() returns the newly created Definition instance'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::has - */ - public function testHas() - { - $builder = new ContainerBuilder(); - $this->assertFalse($builder->has('foo'), '->has() returns false if the service does not exist'); - $builder->register('foo', 'FooClass'); - $this->assertTrue($builder->has('foo'), '->has() returns true if a service definition exists'); - $builder->set('bar', new \stdClass()); - $this->assertTrue($builder->has('bar'), '->has() returns true if a service exists'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::get - */ - public function testGet() - { - $builder = new ContainerBuilder(); - try { - $builder->get('foo'); - $this->fail('->get() throws an InvalidArgumentException if the service does not exist'); - } catch (\InvalidArgumentException $e) { - $this->assertEquals('The service definition "foo" does not exist.', $e->getMessage(), '->get() throws an InvalidArgumentException if the service does not exist'); - } - - $this->assertNull($builder->get('foo', ContainerInterface::NULL_ON_INVALID_REFERENCE), '->get() returns null if the service does not exist and NULL_ON_INVALID_REFERENCE is passed as a second argument'); - - $builder->register('foo', 'stdClass'); - $this->assertInternalType('object', $builder->get('foo'), '->get() returns the service definition associated with the id'); - $builder->set('bar', $bar = new \stdClass()); - $this->assertEquals($bar, $builder->get('bar'), '->get() returns the service associated with the id'); - $builder->register('bar', 'stdClass'); - $this->assertEquals($bar, $builder->get('bar'), '->get() returns the service associated with the id even if a definition has been defined'); - - $builder->register('baz', 'stdClass')->setArguments(array(new Reference('baz'))); - try { - @$builder->get('baz'); - $this->fail('->get() throws a ServiceCircularReferenceException if the service has a circular reference to itself'); - } catch (\Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException $e) { - $this->assertEquals('Circular reference detected for service "baz", path: "baz".', $e->getMessage(), '->get() throws a LogicException if the service has a circular reference to itself'); - } - - $builder->register('foobar', 'stdClass')->setScope('container'); - $this->assertTrue($builder->get('bar') === $builder->get('bar'), '->get() always returns the same instance if the service is shared'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getServiceIds - */ - public function testGetServiceIds() - { - $builder = new ContainerBuilder(); - $builder->register('foo', 'stdClass'); - $builder->bar = $bar = new \stdClass(); - $builder->register('bar', 'stdClass'); - $this->assertEquals(array('foo', 'bar', 'service_container'), $builder->getServiceIds(), '->getServiceIds() returns all defined service ids'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::setAlias - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::hasAlias - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getAlias - */ - public function testAliases() - { - $builder = new ContainerBuilder(); - $builder->register('foo', 'stdClass'); - $builder->setAlias('bar', 'foo'); - $this->assertTrue($builder->hasAlias('bar'), '->hasAlias() returns true if the alias exists'); - $this->assertFalse($builder->hasAlias('foobar'), '->hasAlias() returns false if the alias does not exist'); - $this->assertEquals('foo', (string) $builder->getAlias('bar'), '->getAlias() returns the aliased service'); - $this->assertTrue($builder->has('bar'), '->setAlias() defines a new service'); - $this->assertTrue($builder->get('bar') === $builder->get('foo'), '->setAlias() creates a service that is an alias to another one'); - - try { - $builder->getAlias('foobar'); - $this->fail('->getAlias() throws an InvalidArgumentException if the alias does not exist'); - } catch (\InvalidArgumentException $e) { - $this->assertEquals('The service alias "foobar" does not exist.', $e->getMessage(), '->getAlias() throws an InvalidArgumentException if the alias does not exist'); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getAliases - */ - public function testGetAliases() - { - $builder = new ContainerBuilder(); - $builder->setAlias('bar', 'foo'); - $builder->setAlias('foobar', 'foo'); - $builder->setAlias('moo', new Alias('foo', false)); - - $aliases = $builder->getAliases(); - $this->assertEquals('foo', (string) $aliases['bar']); - $this->assertTrue($aliases['bar']->isPublic()); - $this->assertEquals('foo', (string) $aliases['foobar']); - $this->assertEquals('foo', (string) $aliases['moo']); - $this->assertFalse($aliases['moo']->isPublic()); - - $builder->register('bar', 'stdClass'); - $this->assertFalse($builder->hasAlias('bar')); - - $builder->set('foobar', 'stdClass'); - $builder->set('moo', 'stdClass'); - $this->assertCount(0, $builder->getAliases(), '->getAliases() does not return aliased services that have been overridden'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::setAliases - */ - public function testSetAliases() - { - $builder = new ContainerBuilder(); - $builder->setAliases(array('bar' => 'foo', 'foobar' => 'foo')); - - $aliases = $builder->getAliases(); - $this->assertTrue(isset($aliases['bar'])); - $this->assertTrue(isset($aliases['foobar'])); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addAliases - */ - public function testAddAliases() - { - $builder = new ContainerBuilder(); - $builder->setAliases(array('bar' => 'foo')); - $builder->addAliases(array('foobar' => 'foo')); - - $aliases = $builder->getAliases(); - $this->assertTrue(isset($aliases['bar'])); - $this->assertTrue(isset($aliases['foobar'])); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addCompilerPass - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getCompilerPassConfig - */ - public function testAddGetCompilerPass() - { - if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { - $this->markTestSkipped('The "Config" component is not available'); - } - - $builder = new ContainerBuilder(); - $builderCompilerPasses = $builder->getCompiler()->getPassConfig()->getPasses(); - $builder->addCompilerPass($this->getMock('Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface')); - $this->assertEquals(sizeof($builderCompilerPasses) + 1, sizeof($builder->getCompiler()->getPassConfig()->getPasses())); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService - */ - public function testCreateService() - { - $builder = new ContainerBuilder(); - $builder->register('foo1', 'FooClass')->setFile(__DIR__.'/Fixtures/includes/foo.php'); - $this->assertInstanceOf('\FooClass', $builder->get('foo1'), '->createService() requires the file defined by the service definition'); - $builder->register('foo2', 'FooClass')->setFile(__DIR__.'/Fixtures/includes/%file%.php'); - $builder->setParameter('file', 'foo'); - $this->assertInstanceOf('\FooClass', $builder->get('foo2'), '->createService() replaces parameters in the file provided by the service definition'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService - */ - public function testCreateServiceClass() - { - $builder = new ContainerBuilder(); - $builder->register('foo1', '%class%'); - $builder->setParameter('class', 'stdClass'); - $this->assertInstanceOf('\stdClass', $builder->get('foo1'), '->createService() replaces parameters in the class provided by the service definition'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService - */ - public function testCreateServiceArguments() - { - $builder = new ContainerBuilder(); - $builder->register('bar', 'stdClass'); - $builder->register('foo1', 'FooClass')->addArgument(array('foo' => '%value%', '%value%' => 'foo', new Reference('bar'), '%%unescape_it%%')); - $builder->setParameter('value', 'bar'); - $this->assertEquals(array('foo' => 'bar', 'bar' => 'foo', $builder->get('bar'), '%unescape_it%'), $builder->get('foo1')->arguments, '->createService() replaces parameters and service references in the arguments provided by the service definition'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService - */ - public function testCreateServiceFactoryMethod() - { - $builder = new ContainerBuilder(); - $builder->register('bar', 'stdClass'); - $builder->register('foo1', 'FooClass')->setFactoryClass('FooClass')->setFactoryMethod('getInstance')->addArgument(array('foo' => '%value%', '%value%' => 'foo', new Reference('bar'))); - $builder->setParameter('value', 'bar'); - $this->assertTrue($builder->get('foo1')->called, '->createService() calls the factory method to create the service instance'); - $this->assertEquals(array('foo' => 'bar', 'bar' => 'foo', $builder->get('bar')), $builder->get('foo1')->arguments, '->createService() passes the arguments to the factory method'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService - */ - public function testCreateServiceFactoryService() - { - $builder = new ContainerBuilder(); - $builder->register('baz_service')->setFactoryService('baz_factory')->setFactoryMethod('getInstance'); - $builder->register('baz_factory', 'BazClass'); - - $this->assertInstanceOf('BazClass', $builder->get('baz_service')); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService - */ - public function testCreateServiceMethodCalls() - { - $builder = new ContainerBuilder(); - $builder->register('bar', 'stdClass'); - $builder->register('foo1', 'FooClass')->addMethodCall('setBar', array(array('%value%', new Reference('bar')))); - $builder->setParameter('value', 'bar'); - $this->assertEquals(array('bar', $builder->get('bar')), $builder->get('foo1')->bar, '->createService() replaces the values in the method calls arguments'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService - */ - public function testCreateServiceConfigurator() - { - $builder = new ContainerBuilder(); - $builder->register('foo1', 'FooClass')->setConfigurator('sc_configure'); - $this->assertTrue($builder->get('foo1')->configured, '->createService() calls the configurator'); - - $builder->register('foo2', 'FooClass')->setConfigurator(array('%class%', 'configureStatic')); - $builder->setParameter('class', 'BazClass'); - $this->assertTrue($builder->get('foo2')->configured, '->createService() calls the configurator'); - - $builder->register('baz', 'BazClass'); - $builder->register('foo3', 'FooClass')->setConfigurator(array(new Reference('baz'), 'configure')); - $this->assertTrue($builder->get('foo3')->configured, '->createService() calls the configurator'); - - $builder->register('foo4', 'FooClass')->setConfigurator('foo'); - try { - $builder->get('foo4'); - $this->fail('->createService() throws an InvalidArgumentException if the configure callable is not a valid callable'); - } catch (\InvalidArgumentException $e) { - $this->assertEquals('The configure callable for class "FooClass" is not a callable.', $e->getMessage(), '->createService() throws an InvalidArgumentException if the configure callable is not a valid callable'); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::resolveServices - */ - public function testResolveServices() - { - $builder = new ContainerBuilder(); - $builder->register('foo', 'FooClass'); - $this->assertEquals($builder->get('foo'), $builder->resolveServices(new Reference('foo')), '->resolveServices() resolves service references to service instances'); - $this->assertEquals(array('foo' => array('foo', $builder->get('foo'))), $builder->resolveServices(array('foo' => array('foo', new Reference('foo')))), '->resolveServices() resolves service references to service instances in nested arrays'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::merge - */ - public function testMerge() - { - if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { - $this->markTestSkipped('The "Config" component is not available'); - } - - $container = new ContainerBuilder(new ParameterBag(array('bar' => 'foo'))); - $config = new ContainerBuilder(new ParameterBag(array('foo' => 'bar'))); - $container->merge($config); - $this->assertEquals(array('bar' => 'foo', 'foo' => 'bar'), $container->getParameterBag()->all(), '->merge() merges current parameters with the loaded ones'); - - $container = new ContainerBuilder(new ParameterBag(array('bar' => 'foo'))); - $config = new ContainerBuilder(new ParameterBag(array('foo' => '%bar%'))); - $container->merge($config); -////// FIXME - $container->compile(); - $this->assertEquals(array('bar' => 'foo', 'foo' => 'foo'), $container->getParameterBag()->all(), '->merge() evaluates the values of the parameters towards already defined ones'); - - $container = new ContainerBuilder(new ParameterBag(array('bar' => 'foo'))); - $config = new ContainerBuilder(new ParameterBag(array('foo' => '%bar%', 'baz' => '%foo%'))); - $container->merge($config); -////// FIXME - $container->compile(); - $this->assertEquals(array('bar' => 'foo', 'foo' => 'foo', 'baz' => 'foo'), $container->getParameterBag()->all(), '->merge() evaluates the values of the parameters towards already defined ones'); - - $container = new ContainerBuilder(); - $container->register('foo', 'FooClass'); - $container->register('bar', 'BarClass'); - $config = new ContainerBuilder(); - $config->setDefinition('baz', new Definition('BazClass')); - $config->setAlias('alias_for_foo', 'foo'); - $container->merge($config); - $this->assertEquals(array('foo', 'bar', 'baz'), array_keys($container->getDefinitions()), '->merge() merges definitions already defined ones'); - - $aliases = $container->getAliases(); - $this->assertTrue(isset($aliases['alias_for_foo'])); - $this->assertEquals('foo', (string) $aliases['alias_for_foo']); - - $container = new ContainerBuilder(); - $container->register('foo', 'FooClass'); - $config->setDefinition('foo', new Definition('BazClass')); - $container->merge($config); - $this->assertEquals('BazClass', $container->getDefinition('foo')->getClass(), '->merge() overrides already defined services'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::merge - * @expectedException LogicException - */ - public function testMergeLogicException() - { - if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { - $this->markTestSkipped('The "Config" component is not available'); - } - - $container = new ContainerBuilder(); - $container->compile(); - $container->merge(new ContainerBuilder()); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::findTaggedServiceIds - */ - public function testfindTaggedServiceIds() - { - $builder = new ContainerBuilder(); - $builder - ->register('foo', 'FooClass') - ->addTag('foo', array('foo' => 'foo')) - ->addTag('bar', array('bar' => 'bar')) - ->addTag('foo', array('foofoo' => 'foofoo')) - ; - $this->assertEquals($builder->findTaggedServiceIds('foo'), array( - 'foo' => array( - array('foo' => 'foo'), - array('foofoo' => 'foofoo'), - ) - ), '->findTaggedServiceIds() returns an array of service ids and its tag attributes'); - $this->assertEquals(array(), $builder->findTaggedServiceIds('foobar'), '->findTaggedServiceIds() returns an empty array if there is annotated services'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::findDefinition - */ - public function testFindDefinition() - { - $container = new ContainerBuilder(); - $container->setDefinition('foo', $definition = new Definition('FooClass')); - $container->setAlias('bar', 'foo'); - $container->setAlias('foobar', 'bar'); - $this->assertEquals($definition, $container->findDefinition('foobar'), '->findDefinition() returns a Definition'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getResources - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addResource - */ - public function testResources() - { - if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { - $this->markTestSkipped('The "Config" component is not available'); - } - - $container = new ContainerBuilder(); - $container->addResource($a = new FileResource(__DIR__.'/Fixtures/xml/services1.xml')); - $container->addResource($b = new FileResource(__DIR__.'/Fixtures/xml/services2.xml')); - $resources = array(); - foreach ($container->getResources() as $resource) { - if (false === strpos($resource, '.php')) { - $resources[] = $resource; - } - } - $this->assertEquals(array($a, $b), $resources, '->getResources() returns an array of resources read for the current configuration'); - $this->assertSame($container, $container->setResources(array())); - $this->assertEquals(array(), $container->getResources()); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::registerExtension - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getExtension - */ - public function testExtension() - { - if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { - $this->markTestSkipped('The "Config" component is not available'); - } - - $container = new ContainerBuilder(); - - $container->registerExtension($extension = new \ProjectExtension()); - $this->assertTrue($container->getExtension('project') === $extension, '->registerExtension() registers an extension'); - - $this->setExpectedException('LogicException'); - $container->getExtension('no_registered'); - } - - public function testRegisteredButNotLoadedExtension() - { - if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { - $this->markTestSkipped('The "Config" component is not available'); - } - - $extension = $this->getMock('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface'); - $extension->expects($this->once())->method('getAlias')->will($this->returnValue('project')); - $extension->expects($this->never())->method('load'); - - $container = new ContainerBuilder(); - $container->registerExtension($extension); - $container->compile(); - } - - public function testRegisteredAndLoadedExtension() - { - if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { - $this->markTestSkipped('The "Config" component is not available'); - } - - $extension = $this->getMock('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface'); - $extension->expects($this->exactly(2))->method('getAlias')->will($this->returnValue('project')); - $extension->expects($this->once())->method('load')->with(array(array('foo' => 'bar'))); - - $container = new ContainerBuilder(); - $container->registerExtension($extension); - $container->loadFromExtension('project', array('foo' => 'bar')); - $container->compile(); - } - - public function testPrivateServiceUser() - { - if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { - $this->markTestSkipped('The "Config" component is not available'); - } - - $fooDefinition = new Definition('BarClass'); - $fooUserDefinition = new Definition('BarUserClass', array(new Reference('bar'))); - $container = new ContainerBuilder(); - - $fooDefinition->setPublic(false); - - $container->addDefinitions(array( - 'bar' => $fooDefinition, - 'bar_user' => $fooUserDefinition - )); - - $container->compile(); - $this->assertInstanceOf('BarClass', $container->get('bar_user')->bar); - } - - /** - * @expectedException BadMethodCallException - */ - public function testThrowsExceptionWhenSetServiceOnAFrozenContainer() - { - if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { - $this->markTestSkipped('The "Config" component is not available'); - } - - $container = new ContainerBuilder(); - $container->compile(); - $container->set('a', new \stdClass()); - } - - /** - * @expectedException BadMethodCallException - */ - public function testThrowsExceptionWhenSetDefinitionOnAFrozenContainer() - { - if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { - $this->markTestSkipped('The "Config" component is not available'); - } - - $container = new ContainerBuilder(); - $container->compile(); - $container->setDefinition('a', new Definition()); - } -} - -class FooClass {} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php deleted file mode 100644 index 1be5106..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php +++ /dev/null @@ -1,450 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests; - -use Symfony\Component\DependencyInjection\Scope; -use Symfony\Component\DependencyInjection\Container; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; - -class ContainerTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\DependencyInjection\Container::__construct - */ - public function testConstructor() - { - $sc = new Container(); - $this->assertSame($sc, $sc->get('service_container'), '__construct() automatically registers itself as a service'); - - $sc = new Container(new ParameterBag(array('foo' => 'bar'))); - $this->assertEquals(array('foo' => 'bar'), $sc->getParameterBag()->all(), '__construct() takes an array of parameters as its first argument'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Container::compile - */ - public function testCompile() - { - $sc = new Container(new ParameterBag(array('foo' => 'bar'))); - $sc->compile(); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag', $sc->getParameterBag(), '->compile() changes the parameter bag to a FrozenParameterBag instance'); - $this->assertEquals(array('foo' => 'bar'), $sc->getParameterBag()->all(), '->compile() copies the current parameters to the new parameter bag'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Container::isFrozen - */ - public function testIsFrozen() - { - $sc = new Container(new ParameterBag(array('foo' => 'bar'))); - $this->assertFalse($sc->isFrozen(), '->isFrozen() returns false if the parameters are not frozen'); - $sc->compile(); - $this->assertTrue($sc->isFrozen(), '->isFrozen() returns true if the parameters are frozen'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Container::getParameterBag - */ - public function testGetParameterBag() - { - $sc = new Container(); - $this->assertEquals(array(), $sc->getParameterBag()->all(), '->getParameterBag() returns an empty array if no parameter has been defined'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Container::setParameter - * @covers Symfony\Component\DependencyInjection\Container::getParameter - */ - public function testGetSetParameter() - { - $sc = new Container(new ParameterBag(array('foo' => 'bar'))); - $sc->setParameter('bar', 'foo'); - $this->assertEquals('foo', $sc->getParameter('bar'), '->setParameter() sets the value of a new parameter'); - - $sc->setParameter('foo', 'baz'); - $this->assertEquals('baz', $sc->getParameter('foo'), '->setParameter() overrides previously set parameter'); - - $sc->setParameter('Foo', 'baz1'); - $this->assertEquals('baz1', $sc->getParameter('foo'), '->setParameter() converts the key to lowercase'); - $this->assertEquals('baz1', $sc->getParameter('FOO'), '->getParameter() converts the key to lowercase'); - - try { - $sc->getParameter('baba'); - $this->fail('->getParameter() thrown an \InvalidArgumentException if the key does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->getParameter() thrown an \InvalidArgumentException if the key does not exist'); - $this->assertEquals('You have requested a non-existent parameter "baba".', $e->getMessage(), '->getParameter() thrown an \InvalidArgumentException if the key does not exist'); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\Container::getServiceIds - */ - public function testGetServiceIds() - { - $sc = new Container(); - $sc->set('foo', $obj = new \stdClass()); - $sc->set('bar', $obj = new \stdClass()); - $this->assertEquals(array('service_container', 'foo', 'bar'), $sc->getServiceIds(), '->getServiceIds() returns all defined service ids'); - - $sc = new ProjectServiceContainer(); - $this->assertEquals(array('scoped', 'scoped_foo', 'bar', 'foo_bar', 'foo.baz', 'circular', 'throw_exception', 'service_container'), $sc->getServiceIds(), '->getServiceIds() returns defined service ids by getXXXService() methods'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Container::set - */ - public function testSet() - { - $sc = new Container(); - $sc->set('foo', $foo = new \stdClass()); - $this->assertEquals($foo, $sc->get('foo'), '->set() sets a service'); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testSetDoesNotAllowPrototypeScope() - { - $c = new Container(); - $c->set('foo', new \stdClass(), 'prototype'); - } - - /** - * @expectedException \RuntimeException - */ - public function testSetDoesNotAllowInactiveScope() - { - $c = new Container(); - $c->addScope(new Scope('foo')); - $c->set('foo', new \stdClass(), 'foo'); - } - - public function testSetAlsoSetsScopedService() - { - $c = new Container(); - $c->addScope(new Scope('foo')); - $c->enterScope('foo'); - $c->set('foo', $foo = new \stdClass(), 'foo'); - - $services = $this->getField($c, 'scopedServices'); - $this->assertTrue(isset($services['foo']['foo'])); - $this->assertSame($foo, $services['foo']['foo']); - } - - /** - * @covers Symfony\Component\DependencyInjection\Container::get - */ - public function testGet() - { - $sc = new ProjectServiceContainer(); - $sc->set('foo', $foo = new \stdClass()); - $this->assertEquals($foo, $sc->get('foo'), '->get() returns the service for the given id'); - $this->assertEquals($sc->__bar, $sc->get('bar'), '->get() returns the service for the given id'); - $this->assertEquals($sc->__foo_bar, $sc->get('foo_bar'), '->get() returns the service if a get*Method() is defined'); - $this->assertEquals($sc->__foo_baz, $sc->get('foo.baz'), '->get() returns the service if a get*Method() is defined'); - - $sc->set('bar', $bar = new \stdClass()); - $this->assertEquals($bar, $sc->get('bar'), '->get() prefers to return a service defined with set() than one defined with a getXXXMethod()'); - - try { - $sc->get(''); - $this->fail('->get() throws a \InvalidArgumentException exception if the service is empty'); - } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException', $e, '->get() throws a ServiceNotFoundException exception if the service is empty'); - } - $this->assertNull($sc->get('', ContainerInterface::NULL_ON_INVALID_REFERENCE)); - } - - public function testGetCircularReference() - { - - $sc = new ProjectServiceContainer(); - try { - $sc->get('circular'); - $this->fail('->get() throws a ServiceCircularReferenceException if it contains circular reference'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException', $e, '->get() throws a ServiceCircularReferenceException if it contains circular reference'); - $this->assertStringStartsWith('Circular reference detected for service "circular"', $e->getMessage(), '->get() throws a \LogicException if it contains circular reference'); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\Container::has - */ - public function testHas() - { - $sc = new ProjectServiceContainer(); - $sc->set('foo', new \stdClass()); - $this->assertFalse($sc->has('foo1'), '->has() returns false if the service does not exist'); - $this->assertTrue($sc->has('foo'), '->has() returns true if the service exists'); - $this->assertTrue($sc->has('bar'), '->has() returns true if a get*Method() is defined'); - $this->assertTrue($sc->has('foo_bar'), '->has() returns true if a get*Method() is defined'); - $this->assertTrue($sc->has('foo.baz'), '->has() returns true if a get*Method() is defined'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Container::initialized - */ - public function testInitialized() - { - $sc = new ProjectServiceContainer(); - $sc->set('foo', new \stdClass()); - $this->assertTrue($sc->initialized('foo'), '->initialized() returns true if service is loaded'); - $this->assertFalse($sc->initialized('foo1'), '->initialized() returns false if service is not loaded'); - $this->assertFalse($sc->initialized('bar'), '->initialized() returns false if a service is defined, but not currently loaded'); - } - - public function testEnterLeaveCurrentScope() - { - $container = new ProjectServiceContainer(); - $container->addScope(new Scope('foo')); - - $container->enterScope('foo'); - $scoped1 = $container->get('scoped'); - $scopedFoo1 = $container->get('scoped_foo'); - - $container->enterScope('foo'); - $scoped2 = $container->get('scoped'); - $scoped3 = $container->get('scoped'); - $scopedFoo2 = $container->get('scoped_foo'); - - $container->leaveScope('foo'); - $scoped4 = $container->get('scoped'); - $scopedFoo3 = $container->get('scoped_foo'); - - $this->assertNotSame($scoped1, $scoped2); - $this->assertSame($scoped2, $scoped3); - $this->assertSame($scoped1, $scoped4); - $this->assertNotSame($scopedFoo1, $scopedFoo2); - $this->assertSame($scopedFoo1, $scopedFoo3); - } - - public function testEnterLeaveScopeWithChildScopes() - { - $container = new Container(); - $container->addScope(new Scope('foo')); - $container->addScope(new Scope('bar', 'foo')); - - $this->assertFalse($container->isScopeActive('foo')); - - $container->enterScope('foo'); - $container->enterScope('bar'); - - $this->assertTrue($container->isScopeActive('foo')); - $this->assertFalse($container->has('a')); - - $a = new \stdClass(); - $container->set('a', $a, 'bar'); - - $services = $this->getField($container, 'scopedServices'); - $this->assertTrue(isset($services['bar']['a'])); - $this->assertSame($a, $services['bar']['a']); - - $this->assertTrue($container->has('a')); - $container->leaveScope('foo'); - - $services = $this->getField($container, 'scopedServices'); - $this->assertFalse(isset($services['bar'])); - - $this->assertFalse($container->isScopeActive('foo')); - $this->assertFalse($container->has('a')); - } - - public function testLeaveScopeNotActive() - { - $container = new Container(); - $container->addScope(new Scope('foo')); - - try { - $container->leaveScope('foo'); - $this->fail('->leaveScope() throws a \LogicException if the scope is not active yet'); - } catch (\Exception $e) { - $this->assertInstanceOf('\LogicException', $e, '->leaveScope() throws a \LogicException if the scope is not active yet'); - $this->assertEquals('The scope "foo" is not active.', $e->getMessage(), '->leaveScope() throws a \LogicException if the scope is not active yet'); - } - - try { - $container->leaveScope('bar'); - $this->fail('->leaveScope() throws a \LogicException if the scope does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\LogicException', $e, '->leaveScope() throws a \LogicException if the scope does not exist'); - $this->assertEquals('The scope "bar" is not active.', $e->getMessage(), '->leaveScope() throws a \LogicException if the scope does not exist'); - } - } - - /** - * @expectedException \InvalidArgumentException - * @dataProvider getBuiltInScopes - */ - public function testAddScopeDoesNotAllowBuiltInScopes($scope) - { - $container = new Container(); - $container->addScope(new Scope($scope)); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testAddScopeDoesNotAllowExistingScope() - { - $container = new Container(); - $container->addScope(new Scope('foo')); - $container->addScope(new Scope('foo')); - } - - /** - * @expectedException \InvalidArgumentException - * @dataProvider getInvalidParentScopes - */ - public function testAddScopeDoesNotAllowInvalidParentScope($scope) - { - $c = new Container(); - $c->addScope(new Scope('foo', $scope)); - } - - public function testAddScope() - { - $c = new Container(); - $c->addScope(new Scope('foo')); - $c->addScope(new Scope('bar', 'foo')); - - $this->assertSame(array('foo' => 'container', 'bar' => 'foo'), $this->getField($c, 'scopes')); - $this->assertSame(array('foo' => array('bar'), 'bar' => array()), $this->getField($c, 'scopeChildren')); - } - - public function testHasScope() - { - $c = new Container(); - - $this->assertFalse($c->hasScope('foo')); - $c->addScope(new Scope('foo')); - $this->assertTrue($c->hasScope('foo')); - } - - public function testIsScopeActive() - { - $c = new Container(); - - $this->assertFalse($c->isScopeActive('foo')); - $c->addScope(new Scope('foo')); - - $this->assertFalse($c->isScopeActive('foo')); - $c->enterScope('foo'); - - $this->assertTrue($c->isScopeActive('foo')); - $c->leaveScope('foo'); - - $this->assertFalse($c->isScopeActive('foo')); - } - - public function testGetThrowsException() - { - $c = new ProjectServiceContainer(); - - try { - $c->get('throw_exception'); - $this->fail(); - } catch (\Exception $e) { - $this->assertEquals('Something went terribly wrong!', $e->getMessage()); - } - - try { - $c->get('throw_exception'); - $this->fail(); - } catch (\Exception $e) { - $this->assertEquals('Something went terribly wrong!', $e->getMessage()); - } - } - - public function getInvalidParentScopes() - { - return array( - array(ContainerInterface::SCOPE_PROTOTYPE), - array('bar'), - ); - } - - public function getBuiltInScopes() - { - return array( - array(ContainerInterface::SCOPE_CONTAINER), - array(ContainerInterface::SCOPE_PROTOTYPE), - ); - } - - protected function getField($obj, $field) - { - $reflection = new \ReflectionProperty($obj, $field); - $reflection->setAccessible(true); - - return $reflection->getValue($obj); - } -} - -class ProjectServiceContainer extends Container -{ - public $__bar, $__foo_bar, $__foo_baz; - - public function __construct() - { - parent::__construct(); - - $this->__bar = new \stdClass(); - $this->__foo_bar = new \stdClass(); - $this->__foo_baz = new \stdClass(); - } - - protected function getScopedService() - { - if (!isset($this->scopedServices['foo'])) { - throw new \RuntimeException('Invalid call'); - } - - return $this->services['scoped'] = $this->scopedServices['foo']['scoped'] = new \stdClass(); - } - - protected function getScopedFooService() - { - if (!isset($this->scopedServices['foo'])) { - throw new \RuntimeException('invalid call'); - } - - return $this->services['scoped_foo'] = $this->scopedServices['foo']['scoped_foo'] = new \stdClass(); - } - - protected function getBarService() - { - return $this->__bar; - } - - protected function getFooBarService() - { - return $this->__foo_bar; - } - - protected function getFoo_BazService() - { - return $this->__foo_baz; - } - - protected function getCircularService() - { - return $this->get('circular'); - } - - protected function getThrowExceptionService() - { - throw new \Exception('Something went terribly wrong!'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php deleted file mode 100644 index ec82cc1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\Config\FileLocator; - -class CrossCheckTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixturesPath; - - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - - public static function setUpBeforeClass() - { - self::$fixturesPath = __DIR__.'/Fixtures/'; - - require_once self::$fixturesPath.'/includes/classes.php'; - require_once self::$fixturesPath.'/includes/foo.php'; - } - - /** - * @dataProvider crossCheckLoadersDumpers - */ - public function testCrossCheck($fixture, $type) - { - $loaderClass = 'Symfony\\Component\\DependencyInjection\\Loader\\'.ucfirst($type).'FileLoader'; - $dumperClass = 'Symfony\\Component\\DependencyInjection\\Dumper\\'.ucfirst($type).'Dumper'; - - $tmp = tempnam('sf_service_container', 'sf'); - - file_put_contents($tmp, file_get_contents(self::$fixturesPath.'/'.$type.'/'.$fixture)); - - $container1 = new ContainerBuilder(); - $loader1 = new $loaderClass($container1, new FileLocator()); - $loader1->load($tmp); - - $dumper = new $dumperClass($container1); - file_put_contents($tmp, $dumper->dump()); - - $container2 = new ContainerBuilder(); - $loader2 = new $loaderClass($container2, new FileLocator()); - $loader2->load($tmp); - - unlink($tmp); - - $this->assertEquals($container2->getAliases(), $container1->getAliases(), 'loading a dump from a previously loaded container returns the same container'); - $this->assertEquals($container2->getDefinitions(), $container1->getDefinitions(), 'loading a dump from a previously loaded container returns the same container'); - $this->assertEquals($container2->getParameterBag()->all(), $container1->getParameterBag()->all(), '->getParameterBag() returns the same value for both containers'); - - $this->assertEquals(serialize($container2), serialize($container1), 'loading a dump from a previously loaded container returns the same container'); - - $services1 = array(); - foreach ($container1 as $id => $service) { - $services1[$id] = serialize($service); - } - $services2 = array(); - foreach ($container2 as $id => $service) { - $services2[$id] = serialize($service); - } - - unset($services1['service_container'], $services2['service_container']); - - $this->assertEquals($services2, $services1, 'Iterator on the containers returns the same services'); - } - - public function crossCheckLoadersDumpers() - { - return array( - array('services1.xml', 'xml'), - array('services2.xml', 'xml'), - array('services6.xml', 'xml'), - array('services8.xml', 'xml'), - array('services9.xml', 'xml'), - - array('services1.yml', 'yaml'), - array('services2.yml', 'yaml'), - array('services6.yml', 'yaml'), - array('services8.yml', 'yaml'), - array('services9.yml', 'yaml'), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/DefinitionDecoratorTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/DefinitionDecoratorTest.php deleted file mode 100644 index bf1bab1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/DefinitionDecoratorTest.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests; - -use Symfony\Component\DependencyInjection\DefinitionDecorator; - -class DefinitionDecoratorTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $def = new DefinitionDecorator('foo'); - - $this->assertEquals('foo', $def->getParent()); - $this->assertEquals(array(), $def->getChanges()); - } - - /** - * @dataProvider getPropertyTests - */ - public function testSetProperty($property, $changeKey) - { - $def = new DefinitionDecorator('foo'); - - $getter = 'get'.ucfirst($property); - $setter = 'set'.ucfirst($property); - - $this->assertNull($def->$getter()); - $this->assertSame($def, $def->$setter('foo')); - $this->assertEquals('foo', $def->$getter()); - $this->assertEquals(array($changeKey => true), $def->getChanges()); - } - - public function getPropertyTests() - { - return array( - array('class', 'class'), - array('factoryClass', 'factory_class'), - array('factoryMethod', 'factory_method'), - array('factoryService', 'factory_service'), - array('configurator', 'configurator'), - array('file', 'file'), - ); - } - - public function testSetPublic() - { - $def = new DefinitionDecorator('foo'); - - $this->assertTrue($def->isPublic()); - $this->assertSame($def, $def->setPublic(false)); - $this->assertFalse($def->isPublic()); - $this->assertEquals(array('public' => true), $def->getChanges()); - } - - public function testSetArgument() - { - $def = new DefinitionDecorator('foo'); - - $this->assertEquals(array(), $def->getArguments()); - $this->assertSame($def, $def->replaceArgument(0, 'foo')); - $this->assertEquals(array('index_0' => 'foo'), $def->getArguments()); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testReplaceArgumentShouldRequireIntegerIndex() - { - $def = new DefinitionDecorator('foo'); - - $def->replaceArgument('0', 'foo'); - } - - public function testReplaceArgument() - { - $def = new DefinitionDecorator('foo'); - - $def->setArguments(array(0 => 'foo', 1 => 'bar')); - $this->assertEquals('foo', $def->getArgument(0)); - $this->assertEquals('bar', $def->getArgument(1)); - - $this->assertSame($def, $def->replaceArgument(1, 'baz')); - $this->assertEquals('foo', $def->getArgument(0)); - $this->assertEquals('baz', $def->getArgument(1)); - - $this->assertEquals(array(0 => 'foo', 1 => 'bar', 'index_1' => 'baz'), $def->getArguments()); - } - - /** - * @expectedException OutOfBoundsException - */ - public function testGetArgumentShouldCheckBounds() - { - $def = new DefinitionDecorator('foo'); - - $def->setArguments(array(0 => 'foo')); - $def->replaceArgument(0, 'foo'); - - $def->getArgument(1); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php deleted file mode 100644 index 46ea75d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php +++ /dev/null @@ -1,292 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests; - -use Symfony\Component\DependencyInjection\Definition; - -class DefinitionTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\DependencyInjection\Definition::__construct - */ - public function testConstructor() - { - $def = new Definition('stdClass'); - $this->assertEquals('stdClass', $def->getClass(), '__construct() takes the class name as its first argument'); - - $def = new Definition('stdClass', array('foo')); - $this->assertEquals(array('foo'), $def->getArguments(), '__construct() takes an optional array of arguments as its second argument'); - } - - public function testSetGetFactoryClass() - { - $def = new Definition('stdClass'); - $this->assertNull($def->getFactoryClass()); - $this->assertSame($def, $def->setFactoryClass('stdClass2'), "->setFactoryClass() implements a fluent interface."); - $this->assertEquals('stdClass2', $def->getFactoryClass(), "->getFactoryClass() returns current class to construct this service."); - } - - public function testSetGetFactoryMethod() - { - $def = new Definition('stdClass'); - $this->assertNull($def->getFactoryMethod()); - $this->assertSame($def, $def->setFactoryMethod('foo'), '->setFactoryMethod() implements a fluent interface'); - $this->assertEquals('foo', $def->getFactoryMethod(), '->getFactoryMethod() returns the factory method name'); - } - - public function testSetGetFactoryService() - { - $def = new Definition('stdClass'); - $this->assertNull($def->getFactoryService()); - $this->assertSame($def, $def->setFactoryService('foo.bar'), "->setFactoryService() implements a fluent interface."); - $this->assertEquals('foo.bar', $def->getFactoryService(), "->getFactoryService() returns current service to construct this service."); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setClass - * @covers Symfony\Component\DependencyInjection\Definition::getClass - */ - public function testSetGetClass() - { - $def = new Definition('stdClass'); - $this->assertSame($def, $def->setClass('foo'), '->setClass() implements a fluent interface'); - $this->assertEquals('foo', $def->getClass(), '->getClass() returns the class name'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setArguments - * @covers Symfony\Component\DependencyInjection\Definition::getArguments - * @covers Symfony\Component\DependencyInjection\Definition::addArgument - */ - public function testArguments() - { - $def = new Definition('stdClass'); - $this->assertSame($def, $def->setArguments(array('foo')), '->setArguments() implements a fluent interface'); - $this->assertEquals(array('foo'), $def->getArguments(), '->getArguments() returns the arguments'); - $this->assertSame($def, $def->addArgument('bar'), '->addArgument() implements a fluent interface'); - $this->assertEquals(array('foo', 'bar'), $def->getArguments(), '->addArgument() adds an argument'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setMethodCalls - * @covers Symfony\Component\DependencyInjection\Definition::addMethodCall - * @covers Symfony\Component\DependencyInjection\Definition::hasMethodCall - * @covers Symfony\Component\DependencyInjection\Definition::removeMethodCall - */ - public function testMethodCalls() - { - $def = new Definition('stdClass'); - $this->assertSame($def, $def->setMethodCalls(array(array('foo', array('foo')))), '->setMethodCalls() implements a fluent interface'); - $this->assertEquals(array(array('foo', array('foo'))), $def->getMethodCalls(), '->getMethodCalls() returns the methods to call'); - $this->assertSame($def, $def->addMethodCall('bar', array('bar')), '->addMethodCall() implements a fluent interface'); - $this->assertEquals(array(array('foo', array('foo')), array('bar', array('bar'))), $def->getMethodCalls(), '->addMethodCall() adds a method to call'); - $this->assertTrue($def->hasMethodCall('bar'), '->hasMethodCall() returns true if first argument is a method to call registered'); - $this->assertFalse($def->hasMethodCall('no_registered'), '->hasMethodCall() returns false if first argument is not a method to call registered'); - $this->assertSame($def, $def->removeMethodCall('bar'), '->removeMethodCall() implements a fluent interface'); - $this->assertEquals(array(array('foo', array('foo'))), $def->getMethodCalls(), '->removeMethodCall() removes a method to call'); - } - - /** - * @expectedException Symfony\Component\DependencyInjection\Exception\InvalidArgumentException - * @expectedExceptionMessage Method name cannot be empty. - */ - public function testExceptionOnEmptyMethodCall() - { - $def = new Definition('stdClass'); - $def->addMethodCall(''); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setFile - * @covers Symfony\Component\DependencyInjection\Definition::getFile - */ - public function testSetGetFile() - { - $def = new Definition('stdClass'); - $this->assertSame($def, $def->setFile('foo'), '->setFile() implements a fluent interface'); - $this->assertEquals('foo', $def->getFile(), '->getFile() returns the file to include'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setScope - * @covers Symfony\Component\DependencyInjection\Definition::getScope - */ - public function testSetGetScope() - { - $def = new Definition('stdClass'); - $this->assertEquals('container', $def->getScope()); - $this->assertSame($def, $def->setScope('foo')); - $this->assertEquals('foo', $def->getScope()); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setPublic - * @covers Symfony\Component\DependencyInjection\Definition::isPublic - */ - public function testSetIsPublic() - { - $def = new Definition('stdClass'); - $this->assertTrue($def->isPublic(), '->isPublic() returns true by default'); - $this->assertSame($def, $def->setPublic(false), '->setPublic() implements a fluent interface'); - $this->assertFalse($def->isPublic(), '->isPublic() returns false if the instance must not be public.'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setSynthetic - * @covers Symfony\Component\DependencyInjection\Definition::isSynthetic - */ - public function testSetIsSynthetic() - { - $def = new Definition('stdClass'); - $this->assertFalse($def->isSynthetic(), '->isSynthetic() returns false by default'); - $this->assertSame($def, $def->setSynthetic(true), '->setSynthetic() implements a fluent interface'); - $this->assertTrue($def->isSynthetic(), '->isSynthetic() returns true if the instance must not be public.'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setAbstract - * @covers Symfony\Component\DependencyInjection\Definition::isAbstract - */ - public function testSetIsAbstract() - { - $def = new Definition('stdClass'); - $this->assertFalse($def->isAbstract(), '->isAbstract() returns false by default'); - $this->assertSame($def, $def->setAbstract(true), '->setAbstract() implements a fluent interface'); - $this->assertTrue($def->isAbstract(), '->isAbstract() returns true if the instance must not be public.'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setConfigurator - * @covers Symfony\Component\DependencyInjection\Definition::getConfigurator - */ - public function testSetGetConfigurator() - { - $def = new Definition('stdClass'); - $this->assertSame($def, $def->setConfigurator('foo'), '->setConfigurator() implements a fluent interface'); - $this->assertEquals('foo', $def->getConfigurator(), '->getConfigurator() returns the configurator'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::clearTags - */ - public function testClearTags() - { - $def = new Definition('stdClass'); - $this->assertSame($def, $def->clearTags(), '->clearTags() implements a fluent interface'); - $def->addTag('foo', array('foo' => 'bar')); - $def->clearTags(); - $this->assertEquals(array(), $def->getTags(), '->clearTags() removes all current tags'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::clearTags - */ - public function testClearTag() - { - $def = new Definition('stdClass'); - $this->assertSame($def, $def->clearTags(), '->clearTags() implements a fluent interface'); - $def->addTag('1foo1', array('foo1' => 'bar1')); - $def->addTag('2foo2', array('foo2' => 'bar2')); - $def->addTag('3foo3', array('foo3' => 'bar3')); - $def->clearTag('2foo2'); - $this->assertTrue($def->hasTag('1foo1')); - $this->assertFalse($def->hasTag('2foo2')); - $this->assertTrue($def->hasTag('3foo3')); - $def->clearTag('1foo1'); - $this->assertFalse($def->hasTag('1foo1')); - $this->assertTrue($def->hasTag('3foo3')); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::addTag - * @covers Symfony\Component\DependencyInjection\Definition::getTag - * @covers Symfony\Component\DependencyInjection\Definition::getTags - * @covers Symfony\Component\DependencyInjection\Definition::hasTag - */ - public function testTags() - { - $def = new Definition('stdClass'); - $this->assertEquals(array(), $def->getTag('foo'), '->getTag() returns an empty array if the tag is not defined'); - $this->assertFalse($def->hasTag('foo')); - $this->assertSame($def, $def->addTag('foo'), '->addTag() implements a fluent interface'); - $this->assertTrue($def->hasTag('foo')); - $this->assertEquals(array(array()), $def->getTag('foo'), '->getTag() returns attributes for a tag name'); - $def->addTag('foo', array('foo' => 'bar')); - $this->assertEquals(array(array(), array('foo' => 'bar')), $def->getTag('foo'), '->addTag() can adds the same tag several times'); - $def->addTag('bar', array('bar' => 'bar')); - $this->assertEquals($def->getTags(), array( - 'foo' => array(array(), array('foo' => 'bar')), - 'bar' => array(array('bar' => 'bar')), - ), '->getTags() returns all tags'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::replaceArgument - */ - public function testSetArgument() - { - $def = new Definition('stdClass'); - - $def->addArgument('foo'); - $this->assertSame(array('foo'), $def->getArguments()); - - $this->assertSame($def, $def->replaceArgument(0, 'moo')); - $this->assertSame(array('moo'), $def->getArguments()); - - $def->addArgument('moo'); - $def - ->replaceArgument(0, 'foo') - ->replaceArgument(1, 'bar') - ; - $this->assertSame(array('foo', 'bar'), $def->getArguments()); - } - - /** - * @expectedException OutOfBoundsException - */ - public function testGetArgumentShouldCheckBounds() - { - $def = new Definition('stdClass'); - - $def->addArgument('foo'); - $def->getArgument(1); - } - - /** - * @expectedException OutOfBoundsException - */ - public function testReplaceArgumentShouldCheckBounds() - { - $def = new Definition('stdClass'); - - $def->addArgument('foo'); - $def->replaceArgument(1, 'bar'); - } - - public function testSetGetProperties() - { - $def = new Definition('stdClass'); - - $this->assertEquals(array(), $def->getProperties()); - $this->assertSame($def, $def->setProperties(array('foo' => 'bar'))); - $this->assertEquals(array('foo' => 'bar'), $def->getProperties()); - } - - public function testSetProperty() - { - $def = new Definition('stdClass'); - - $this->assertEquals(array(), $def->getProperties()); - $this->assertSame($def, $def->setProperty('foo', 'bar')); - $this->assertEquals(array('foo' => 'bar'), $def->getProperties()); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Dumper/GraphvizDumperTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Dumper/GraphvizDumperTest.php deleted file mode 100644 index d3b93fd..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Dumper/GraphvizDumperTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Dumper; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Dumper\GraphvizDumper; - -class GraphvizDumperTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixturesPath; - - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - - public static function setUpBeforeClass() - { - self::$fixturesPath = __DIR__.'/../Fixtures/'; - } - - public function testDump() - { - $dumper = new GraphvizDumper($container = new ContainerBuilder()); - - $this->assertStringEqualsFile(self::$fixturesPath.'/graphviz/services1.dot', $dumper->dump(), '->dump() dumps an empty container as an empty dot file'); - - $container = include self::$fixturesPath.'/containers/container9.php'; - $dumper = new GraphvizDumper($container); - $this->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/services9.dot')), $dumper->dump(), '->dump() dumps services'); - - $container = include self::$fixturesPath.'/containers/container10.php'; - $dumper = new GraphvizDumper($container); - $this->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/services10.dot')), $dumper->dump(), '->dump() dumps services'); - - $container = include self::$fixturesPath.'/containers/container10.php'; - $dumper = new GraphvizDumper($container); - $this->assertEquals($dumper->dump(array( - 'graph' => array('ratio' => 'normal'), - 'node' => array('fontsize' => 13, 'fontname' => 'Verdana', 'shape' => 'square'), - 'edge' => array('fontsize' => 12, 'fontname' => 'Verdana', 'color' => 'white', 'arrowhead' => 'closed', 'arrowsize' => 1), - 'node.instance' => array('fillcolor' => 'green', 'style' => 'empty'), - 'node.definition' => array('fillcolor' => 'grey'), - 'node.missing' => array('fillcolor' => 'red', 'style' => 'empty'), - )), str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/services10-1.dot')), '->dump() dumps services'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php deleted file mode 100644 index c1e2070..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php +++ /dev/null @@ -1,130 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Dumper; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Dumper\PhpDumper; -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Definition; - -class PhpDumperTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixturesPath; - - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - - public static function setUpBeforeClass() - { - self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); - } - - public function testDump() - { - $dumper = new PhpDumper($container = new ContainerBuilder()); - - $this->assertStringEqualsFile(self::$fixturesPath.'/php/services1.php', $dumper->dump(), '->dump() dumps an empty container as an empty PHP class'); - $this->assertStringEqualsFile(self::$fixturesPath.'/php/services1-1.php', $dumper->dump(array('class' => 'Container', 'base_class' => 'AbstractContainer')), '->dump() takes a class and a base_class options'); - - $container = new ContainerBuilder(); - new PhpDumper($container); - } - - public function testDumpOptimizationString() - { - $definition = new Definition(); - $definition->setClass('stdClass'); - $definition->addArgument(array( - 'only dot' => '.', - 'concatenation as value' => '.\'\'.', - 'concatenation from the start value' => '\'\'.', - '.' => 'dot as a key', - '.\'\'.' => 'concatenation as a key', - '\'\'.' =>'concatenation from the start key', - 'optimize concatenation' => "string1%some_string%string2", - 'optimize concatenation with empty string' => "string1%empty_value%string2", - 'optimize concatenation from the start' => '%empty_value%start', - 'optimize concatenation at the end' => 'end%empty_value%', - )); - - $container = new ContainerBuilder(); - $container->setDefinition('test', $definition); - $container->setParameter('empty_value', ''); - $container->setParameter('some_string', '-'); - $container->compile(); - - $dumper = new PhpDumper($container); - $this->assertStringEqualsFile(self::$fixturesPath.'/php/services10.php', $dumper->dump(), '->dump() dumps an empty container as an empty PHP class'); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testExportParameters() - { - $dumper = new PhpDumper(new ContainerBuilder(new ParameterBag(array('foo' => new Reference('foo'))))); - $dumper->dump(); - } - - public function testAddParameters() - { - $container = include self::$fixturesPath.'/containers/container8.php'; - $dumper = new PhpDumper($container); - $this->assertStringEqualsFile(self::$fixturesPath.'/php/services8.php', $dumper->dump(), '->dump() dumps parameters'); - } - - public function testAddService() - { - $container = include self::$fixturesPath.'/containers/container9.php'; - $dumper = new PhpDumper($container); - $this->assertEquals(str_replace('%path%', str_replace('\\','\\\\',self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR), file_get_contents(self::$fixturesPath.'/php/services9.php')), $dumper->dump(), '->dump() dumps services'); - - $dumper = new PhpDumper($container = new ContainerBuilder()); - $container->register('foo', 'FooClass')->addArgument(new \stdClass()); - try { - $dumper->dump(); - $this->fail('->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Symfony\Component\DependencyInjection\Exception\RuntimeException', $e, '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - $this->assertEquals('Unable to dump a service container if a parameter is an object or a resource.', $e->getMessage(), '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - } - } - - public function testOverrideServiceWhenUsingADumpedContainer() - { - require_once self::$fixturesPath.'/php/services9.php'; - require_once self::$fixturesPath.'/includes/foo.php'; - - $container = new \ProjectServiceContainer(); - $container->set('bar', $bar = new \stdClass()); - $container->setParameter('foo_bar', 'foo_bar'); - - $this->assertEquals($bar, $container->get('bar'), '->set() overrides an already defined service'); - } - - public function testOverrideServiceWhenUsingADumpedContainerAndServiceIsUsedFromAnotherOne() - { - require_once self::$fixturesPath.'/php/services9.php'; - require_once self::$fixturesPath.'/includes/foo.php'; - require_once self::$fixturesPath.'/includes/classes.php'; - - $container = new \ProjectServiceContainer(); - $container->set('bar', $bar = new \stdClass()); - - $this->assertSame($bar, $container->get('foo')->bar, '->set() overrides an already defined service'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Dumper/XmlDumperTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Dumper/XmlDumperTest.php deleted file mode 100644 index b2cddb5..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Dumper/XmlDumperTest.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Dumper; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Dumper\XmlDumper; - -class XmlDumperTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixturesPath; - - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - - public static function setUpBeforeClass() - { - self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); - } - - public function testDump() - { - $dumper = new XmlDumper($container = new ContainerBuilder()); - - $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/xml/services1.xml', $dumper->dump(), '->dump() dumps an empty container as an empty XML file'); - - $container = new ContainerBuilder(); - $dumper = new XmlDumper($container); - } - - public function testExportParameters() - { - $container = include self::$fixturesPath.'//containers/container8.php'; - $dumper = new XmlDumper($container); - $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/xml/services8.xml', $dumper->dump(), '->dump() dumps parameters'); - } - - public function testAddParameters() - { - $container = include self::$fixturesPath.'//containers/container8.php'; - $dumper = new XmlDumper($container); - $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/xml/services8.xml', $dumper->dump(), '->dump() dumps parameters'); - } - - public function testAddService() - { - $container = include self::$fixturesPath.'/containers/container9.php'; - $dumper = new XmlDumper($container); - $this->assertEquals(str_replace('%path%', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR, file_get_contents(self::$fixturesPath.'/xml/services9.xml')), $dumper->dump(), '->dump() dumps services'); - - $dumper = new XmlDumper($container = new ContainerBuilder()); - $container->register('foo', 'FooClass')->addArgument(new \stdClass()); - try { - $dumper->dump(); - $this->fail('->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - } catch (\Exception $e) { - $this->assertInstanceOf('\RuntimeException', $e, '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - $this->assertEquals('Unable to dump a service container if a parameter is an object or a resource.', $e->getMessage(), '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - } - } - - public function testDumpAnonymousServices() - { - include self::$fixturesPath.'/containers/container11.php'; - $dumper = new XmlDumper($container); - $this->assertEquals(" - - - - - - - - - - - - - -", $dumper->dump()); - } - - public function testDumpEntities() - { - include self::$fixturesPath.'/containers/container12.php'; - $dumper = new XmlDumper($container); - $this->assertEquals(" - - - - - foo<>&bar - - - -", $dumper->dump()); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php deleted file mode 100644 index 47cc4be..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Dumper; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Dumper\YamlDumper; - -class YamlDumperTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixturesPath; - - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - - public static function setUpBeforeClass() - { - self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); - } - - public function testDump() - { - $dumper = new YamlDumper($container = new ContainerBuilder()); - - $this->assertStringEqualsFile(self::$fixturesPath.'/yaml/services1.yml', $dumper->dump(), '->dump() dumps an empty container as an empty YAML file'); - - $container = new ContainerBuilder(); - $dumper = new YamlDumper($container); - } - - public function testAddParameters() - { - $container = include self::$fixturesPath.'/containers/container8.php'; - $dumper = new YamlDumper($container); - $this->assertStringEqualsFile(self::$fixturesPath.'/yaml/services8.yml', $dumper->dump(), '->dump() dumps parameters'); - } - - public function testAddService() - { - $container = include self::$fixturesPath.'/containers/container9.php'; - $dumper = new YamlDumper($container); - $this->assertEquals(str_replace('%path%', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR, file_get_contents(self::$fixturesPath.'/yaml/services9.yml')), $dumper->dump(), '->dump() dumps services'); - - $dumper = new YamlDumper($container = new ContainerBuilder()); - $container->register('foo', 'FooClass')->addArgument(new \stdClass()); - try { - $dumper->dump(); - $this->fail('->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - } catch (\Exception $e) { - $this->assertInstanceOf('\RuntimeException', $e, '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - $this->assertEquals('Unable to dump a service container if a parameter is an object or a resource.', $e->getMessage(), '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container10.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container10.php deleted file mode 100644 index a16ca9f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container10.php +++ /dev/null @@ -1,14 +0,0 @@ - - register('foo', 'FooClass')-> - addArgument(new Reference('bar')) -; - -return $container; diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container11.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container11.php deleted file mode 100644 index 3e6cafc..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container11.php +++ /dev/null @@ -1,12 +0,0 @@ - - register('foo', 'FooClass')-> - addArgument(new Definition('BarClass', array(new Definition('BazClass')))) -; - -return $container; diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container12.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container12.php deleted file mode 100644 index 0dc8679..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container12.php +++ /dev/null @@ -1,13 +0,0 @@ - - register('foo', 'FooClass\\Foo')-> - addArgument('foo<>&bar')-> - addTag('foo"bar\\bar', array('foo' => 'foo"barřž€')) -; - -return $container; diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container8.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container8.php deleted file mode 100644 index 28c6536..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container8.php +++ /dev/null @@ -1,13 +0,0 @@ - '%baz%', - 'baz' => 'bar', - 'bar' => 'foo is %%foo bar', - 'values' => array(true, false, null, 0, 1000.3, 'true', 'false', 'null'), -))); - -return $container; diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php deleted file mode 100644 index 663f2a7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php +++ /dev/null @@ -1,58 +0,0 @@ - - register('foo', 'FooClass')-> - addTag('foo', array('foo' => 'foo'))-> - addTag('foo', array('bar' => 'bar'))-> - setFactoryClass('FooClass')-> - setFactoryMethod('getInstance')-> - setArguments(array('foo', new Reference('foo.baz'), array('%foo%' => 'foo is %foo%', 'bar' => '%foo%'), true, new Reference('service_container')))-> - setProperties(array('foo' => 'bar', 'moo' => new Reference('foo.baz')))-> - setScope('prototype')-> - addMethodCall('setBar', array(new Reference('bar')))-> - addMethodCall('initialize')-> - setConfigurator('sc_configure') -; -$container-> - register('bar', 'FooClass')-> - setArguments(array('foo', new Reference('foo.baz'), new Parameter('foo_bar')))-> - setScope('container')-> - setConfigurator(array(new Reference('foo.baz'), 'configure')) -; -$container-> - register('foo.baz', '%baz_class%')-> - setFactoryClass('%baz_class%')-> - setFactoryMethod('getInstance')-> - setConfigurator(array('%baz_class%', 'configureStatic1')) -; -$container->register('foo_bar', '%foo_class%'); -$container->getParameterBag()->clear(); -$container->getParameterBag()->add(array( - 'baz_class' => 'BazClass', - 'foo_class' => 'FooClass', - 'foo' => 'bar', -)); -$container->setAlias('alias_for_foo', 'foo'); -$container-> - register('method_call1', 'FooClass')-> - setFile(realpath(__DIR__.'/../includes/foo.php'))-> - addMethodCall('setBar', array(new Reference('foo')))-> - addMethodCall('setBar', array(new Reference('foo2', ContainerInterface::NULL_ON_INVALID_REFERENCE)))-> - addMethodCall('setBar', array(new Reference('foo3', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)))-> - addMethodCall('setBar', array(new Reference('foobaz', ContainerInterface::IGNORE_ON_INVALID_REFERENCE))) -; -$container-> - register('factory_service')-> - setFactoryService('foo.baz')-> - setFactoryMethod('getInstance') -; - -return $container; diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces1.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces1.php deleted file mode 100644 index 27503a3..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces1.php +++ /dev/null @@ -1,25 +0,0 @@ -setParameter('cla', 'Fo'); -$container->setParameter('ss', 'Class'); - -$definition = new Definition('%cla%o%ss%'); -$container->setDefinition('foo', $definition); - -return $container; - -if (!class_exists('FooClass')) { - class FooClass - { - public $bar; - - public function setBar($bar) - { - $this->bar = $bar; - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces2.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces2.php deleted file mode 100644 index a851901..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces2.php +++ /dev/null @@ -1,34 +0,0 @@ -setDefinition('barFactory', $factoryDefinition); - -$definition = new Definition(); -$definition->setFactoryService('barFactory'); -$definition->setFactoryMethod('createBarClass'); -$container->setDefinition('bar', $definition); - -return $container; - -class BarClass -{ - public $foo; - - public function setBar($foo) - { - $this->foo = $foo; - } -} - -class BarClassFactory -{ - public function createBarClass() - { - return new BarClass(); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services1.dot b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services1.dot deleted file mode 100644 index 1bb7c30..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services1.dot +++ /dev/null @@ -1,7 +0,0 @@ -digraph sc { - ratio="compress" - node [fontsize="11" fontname="Arial" shape="record"]; - edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"]; - - node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=record, fillcolor="#9999ff", style="filled"]; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10-1.dot b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10-1.dot deleted file mode 100644 index 0e578b1..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10-1.dot +++ /dev/null @@ -1,10 +0,0 @@ -digraph sc { - ratio="normal" - node [fontsize="13" fontname="Verdana" shape="square"]; - edge [fontsize="12" fontname="Verdana" color="white" arrowhead="closed" arrowsize="1"]; - - node_foo [label="foo\nFooClass\n", shape=square, fillcolor="grey", style="filled"]; - node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=square, fillcolor="green", style="empty"]; - node_bar [label="bar\n\n", shape=square, fillcolor="red", style="empty"]; - node_foo -> node_bar [label="" style="filled"]; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10.dot b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10.dot deleted file mode 100644 index f17857f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10.dot +++ /dev/null @@ -1,10 +0,0 @@ -digraph sc { - ratio="compress" - node [fontsize="11" fontname="Arial" shape="record"]; - edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"]; - - node_foo [label="foo\nFooClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=record, fillcolor="#9999ff", style="filled"]; - node_bar [label="bar\n\n", shape=record, fillcolor="#ff9999", style="filled"]; - node_foo -> node_bar [label="" style="filled"]; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services9.dot b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services9.dot deleted file mode 100644 index fdff221..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services9.dot +++ /dev/null @@ -1,25 +0,0 @@ -digraph sc { - ratio="compress" - node [fontsize="11" fontname="Arial" shape="record"]; - edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"]; - - node_foo [label="foo (alias_for_foo)\nFooClass\n", shape=record, fillcolor="#eeeeee", style="dotted"]; - node_bar [label="bar\nFooClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_foo_baz [label="foo.baz\nBazClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_foo_bar [label="foo_bar\nFooClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_method_call1 [label="method_call1\nFooClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_factory_service [label="factory_service\n\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=record, fillcolor="#9999ff", style="filled"]; - node_foo2 [label="foo2\n\n", shape=record, fillcolor="#ff9999", style="filled"]; - node_foo3 [label="foo3\n\n", shape=record, fillcolor="#ff9999", style="filled"]; - node_foobaz [label="foobaz\n\n", shape=record, fillcolor="#ff9999", style="filled"]; - node_foo -> node_foo_baz [label="" style="filled"]; - node_foo -> node_service_container [label="" style="filled"]; - node_foo -> node_foo_baz [label="" style="dashed"]; - node_foo -> node_bar [label="setBar()" style="dashed"]; - node_bar -> node_foo_baz [label="" style="filled"]; - node_method_call1 -> node_foo [label="setBar()" style="dashed"]; - node_method_call1 -> node_foo2 [label="setBar()" style="dashed"]; - node_method_call1 -> node_foo3 [label="setBar()" style="dashed"]; - node_method_call1 -> node_foobaz [label="setBar()" style="dashed"]; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php deleted file mode 100644 index 81ff7aa..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php +++ /dev/null @@ -1,41 +0,0 @@ -setDefinition('project.service.bar', new Definition('FooClass')); - $configuration->setParameter('project.parameter.bar', isset($config['foo']) ? $config['foo'] : 'foobar'); - - $configuration->setDefinition('project.service.foo', new Definition('FooClass')); - $configuration->setParameter('project.parameter.foo', isset($config['foo']) ? $config['foo'] : 'foobar'); - - return $configuration; - } - - public function getXsdValidationBasePath() - { - return false; - } - - public function getNamespace() - { - return 'http://www.example.com/schema/project'; - } - - public function getAlias() - { - return 'project'; - } - - public function getConfiguration(array $config, ContainerBuilder $container) - { - return null; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtension.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtension.php deleted file mode 100644 index 2ee2f12..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtension.php +++ /dev/null @@ -1,19 +0,0 @@ -A# zLP8n`gt&9#ui!7>hB(4=l2+ZJTe0LgvcK=W=kI&2?+9NI3CC$5!Hu~GgbJU@s^j!z z{1QBM7%2ZJ8MdYhcoM|C&3kxmYtW?-L2JZy@9%c{?%jvoUc1veSTEPe&bDQq8isKN z=QW&b2F35?`4D8>SOF>Ctr^B&_NuGb-{jBPS6ubDjx+Imh?pbt+ih;y6?>WtzZDF< zJ`$&2W{kSl$1*L`3t5to3u`2xH5$%QbIC08tz{A%A{~T*M@A|46iP|PpitVUEDVNB zZ!}o~J*NEia*i)(nkqr1lB1e??E}}fOHO`|QY}ZG=o*)#c)%h^1oL2d*pjc5K+h+W zi49X0i4bfrj*28Ru_o9Gs8ztV`Kx5!4Fi^3khL&jS=^KQ&NK?iYmmC}8Wg>v1h^Mt z3F8KR(%;{_L$hwO%sLiU%{3uN;z@)4|D9;AVaBgwz;iJsx9nJsotu@)mUGnYJkI*4 zU??Wh%em0!cq{5zM1l|^;A%gX(H@Lg8mb08PO(Eq0SqZV99?2|*#b#8+S{N5CMi*G z#O&8ugrb$`=(LZ=3vfi}j>&>CrDQNj)$Du}$Fp#muz1SHl<26)aP;0nP~6S;as##x fKmGdn{Kwgc7w>OxY?QCIKL337T|f4F&2IA_UuA6u diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php deleted file mode 100644 index 514df23..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php +++ /dev/null @@ -1,42 +0,0 @@ -configure(); -} - -class BarClass -{ -} - -class BazClass -{ - public function configure($instance) - { - $instance->configure(); - } - - public static function getInstance() - { - return new self(); - } - - public static function configureStatic($instance) - { - $instance->configure(); - } - - public static function configureStatic1() - { - } -} - -class BarUserClass -{ - public $bar; - - public function __construct(BarClass $bar) - { - $this->bar = $bar; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php deleted file mode 100644 index a593351..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php +++ /dev/null @@ -1,47 +0,0 @@ -addFromString('ProjectWithXsdExtensionInPhar.php',<<addFromString('schema/project-1.0.xsd', << - - - - - - - - - -EOT -); -$phar->setStub(''); diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/foo.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/foo.php deleted file mode 100644 index 180bb38..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/foo.php +++ /dev/null @@ -1,36 +0,0 @@ -arguments = $arguments; - } - - public static function getInstance($arguments = array()) - { - $obj = new self($arguments); - $obj->called = true; - - return $obj; - } - - public function initialize() - { - $this->initialized = true; - } - - public function configure() - { - $this->configured = true; - } - - public function setBar($value = null) - { - $this->bar = $value; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/schema/project-1.0.xsd b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/schema/project-1.0.xsd deleted file mode 100644 index 282884e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/schema/project-1.0.xsd +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/nonvalid.ini b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/nonvalid.ini deleted file mode 100644 index 9f84a60..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/nonvalid.ini +++ /dev/null @@ -1,2 +0,0 @@ -{NOT AN INI FILE} -{JUST A PLAIN TEXT FILE} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters.ini b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters.ini deleted file mode 100644 index df92f75..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters.ini +++ /dev/null @@ -1,3 +0,0 @@ -[parameters] - foo = bar - bar = %foo% diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters1.ini b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters1.ini deleted file mode 100644 index e50f722..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters1.ini +++ /dev/null @@ -1,3 +0,0 @@ -[parameters] - FOO = foo - baz = baz diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters2.ini b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters2.ini deleted file mode 100644 index 75fbac6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters2.ini +++ /dev/null @@ -1,2 +0,0 @@ -[parameters] - imported_from_ini = true diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php deleted file mode 100644 index de4b642..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php +++ /dev/null @@ -1,28 +0,0 @@ -parameters = $this->getDefaultParameters(); - - $this->services = - $this->scopedServices = - $this->scopeStacks = array(); - - $this->set('service_container', $this); - - $this->scopes = array(); - $this->scopeChildren = array(); - } - - /** - * Gets the 'test' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return stdClass A stdClass instance. - */ - protected function getTestService() - { - return $this->services['test'] = new \stdClass(array('only dot' => '.', 'concatenation as value' => '.\'\'.', 'concatenation from the start value' => '\'\'.', '.' => 'dot as a key', '.\'\'.' => 'concatenation as a key', '\'\'.' => 'concatenation from the start key', 'optimize concatenation' => 'string1-string2', 'optimize concatenation with empty string' => 'string1string2', 'optimize concatenation from the start' => 'start', 'optimize concatenation at the end' => 'end')); - } - - /** - * {@inheritdoc} - */ - public function getParameter($name) - { - $name = strtolower($name); - - if (!array_key_exists($name, $this->parameters)) { - throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name)); - } - - return $this->parameters[$name]; - } - - /** - * {@inheritdoc} - */ - public function hasParameter($name) - { - return array_key_exists(strtolower($name), $this->parameters); - } - - /** - * {@inheritdoc} - */ - public function setParameter($name, $value) - { - throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); - } - - /** - * {@inheritDoc} - */ - public function getParameterBag() - { - if (null === $this->parameterBag) { - $this->parameterBag = new FrozenParameterBag($this->parameters); - } - - return $this->parameterBag; - } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() - { - return array( - 'empty_value' => '', - 'some_string' => '-', - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php deleted file mode 100644 index 77e4183..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php +++ /dev/null @@ -1,52 +0,0 @@ -getDefaultParameters())); - } - - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() - { - return array( - 'foo' => '%baz%', - 'baz' => 'bar', - 'bar' => 'foo is %%foo bar', - 'values' => array( - 0 => true, - 1 => false, - 2 => NULL, - 3 => 0, - 4 => 1000.3, - 5 => 'true', - 6 => 'false', - 7 => 'null', - ), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php deleted file mode 100644 index c1513b6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php +++ /dev/null @@ -1,160 +0,0 @@ -getDefaultParameters())); - } - - /** - * Gets the 'bar' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return FooClass A FooClass instance. - */ - protected function getBarService() - { - $this->services['bar'] = $instance = new \FooClass('foo', $this->get('foo.baz'), $this->getParameter('foo_bar')); - - $this->get('foo.baz')->configure($instance); - - return $instance; - } - - /** - * Gets the 'factory_service' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return Object An instance returned by foo.baz::getInstance(). - */ - protected function getFactoryServiceService() - { - return $this->services['factory_service'] = $this->get('foo.baz')->getInstance(); - } - - /** - * Gets the 'foo' service. - * - * @return FooClass A FooClass instance. - */ - protected function getFooService() - { - $a = $this->get('foo.baz'); - - $instance = call_user_func(array('FooClass', 'getInstance'), 'foo', $a, array($this->getParameter('foo') => 'foo is '.$this->getParameter('foo'), 'bar' => $this->getParameter('foo')), true, $this); - - $instance->setBar($this->get('bar')); - $instance->initialize(); - $instance->foo = 'bar'; - $instance->moo = $a; - sc_configure($instance); - - return $instance; - } - - /** - * Gets the 'foo.baz' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return Object A %baz_class% instance. - */ - protected function getFoo_BazService() - { - $this->services['foo.baz'] = $instance = call_user_func(array($this->getParameter('baz_class'), 'getInstance')); - - call_user_func(array($this->getParameter('baz_class'), 'configureStatic1'), $instance); - - return $instance; - } - - /** - * Gets the 'foo_bar' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return Object A %foo_class% instance. - */ - protected function getFooBarService() - { - $class = $this->getParameter('foo_class'); - - return $this->services['foo_bar'] = new $class(); - } - - /** - * Gets the 'method_call1' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return FooClass A FooClass instance. - */ - protected function getMethodCall1Service() - { - require_once '%path%foo.php'; - - $this->services['method_call1'] = $instance = new \FooClass(); - - $instance->setBar($this->get('foo')); - $instance->setBar($this->get('foo2', ContainerInterface::NULL_ON_INVALID_REFERENCE)); - if ($this->has('foo3')) { - $instance->setBar($this->get('foo3', ContainerInterface::NULL_ON_INVALID_REFERENCE)); - } - if ($this->has('foobaz')) { - $instance->setBar($this->get('foobaz', ContainerInterface::NULL_ON_INVALID_REFERENCE)); - } - - return $instance; - } - - /** - * Gets the alias_for_foo service alias. - * - * @return FooClass An instance of the foo service - */ - protected function getAliasForFooService() - { - return $this->get('foo'); - } - - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() - { - return array( - 'baz_class' => 'BazClass', - 'foo_class' => 'FooClass', - 'foo' => 'bar', - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/simple.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/simple.php deleted file mode 100644 index aa4df99..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/simple.php +++ /dev/null @@ -1,3 +0,0 @@ -setParameter('foo', 'foo'); diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension1/services.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension1/services.xml deleted file mode 100644 index 52df38d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension1/services.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension2/services.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension2/services.xml deleted file mode 100644 index 21a7ef5..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension2/services.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services1.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services1.xml deleted file mode 100644 index 792fa07..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services1.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - BAR - - - - - - - - - %project.parameter.foo% - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services2.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services2.xml deleted file mode 100644 index 67d462b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services2.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - BAR - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services3.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services3.xml deleted file mode 100644 index c23f02a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services3.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - BAR - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services4.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services4.xml deleted file mode 100644 index 2c33c3a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services4.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services5.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services5.xml deleted file mode 100644 index 0eaaff2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services5.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services6.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services6.xml deleted file mode 100644 index a9c0103..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services6.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services7.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services7.xml deleted file mode 100644 index e77780d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services7.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/nonvalid.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/nonvalid.xml deleted file mode 100644 index e7b5bc9..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/nonvalid.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services1.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services1.xml deleted file mode 100644 index 6aa5732..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services1.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services13.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services13.xml deleted file mode 100644 index 1ac4938..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services13.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - true - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services2.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services2.xml deleted file mode 100644 index bada1c8..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services2.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - a string - bar - - 0 - 4 - null - true - true - false - on - off - 1.3 - 1,000.3 - a string - - foo - bar - - - - - value - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services3.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services3.xml deleted file mode 100644 index 87bf183..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - foo - - true - false - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4.xml deleted file mode 100644 index 03ad9f8..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4_bad_import.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4_bad_import.xml deleted file mode 100644 index 0b7f10a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4_bad_import.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services5.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services5.xml deleted file mode 100644 index acb93e7..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services5.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml deleted file mode 100644 index 45bc042..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - %path%/foo.php - - - foo - - - true - false - - - - - - - - - - - - - - - - - foo - - - true - false - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services7.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services7.xml deleted file mode 100644 index 824d8b5..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services7.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services8.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services8.xml deleted file mode 100644 index f11d606..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services8.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - %baz% - bar - foo is %%foo bar - - true - false - null - 0 - 1000.3 - true - false - null - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services9.xml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services9.xml deleted file mode 100644 index a73fb3e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services9.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - BazClass - FooClass - bar - - - - - - foo - - - foo is %foo% - %foo% - - true - - bar - - - - - - - - - foo - - %foo_bar% - - - - - - - - %path%foo.php - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag1.yml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag1.yml deleted file mode 100644 index 14536fd..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag1.yml +++ /dev/null @@ -1,5 +0,0 @@ -services: - foo_service: - class: FooClass - # tags is not an array - tags: string diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag2.yml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag2.yml deleted file mode 100644 index 9028814..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag2.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - foo_service: - class: FooClass - tags: - # tag is missing the name key - foo_tag: { foo: bar } diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag3.yml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag3.yml deleted file mode 100644 index 8137fab..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag3.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - foo_service: - class: FooClass - tags: - # tag-attribute is not a scalar - - { name: foo, foo: { foo: foo, bar: bar } } diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid1.yml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid1.yml deleted file mode 100644 index 4eddb87..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid1.yml +++ /dev/null @@ -1,2 +0,0 @@ -foo: - bar diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid2.yml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid2.yml deleted file mode 100644 index c508d53..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid2.yml +++ /dev/null @@ -1 +0,0 @@ -false diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services1.yml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services1.yml deleted file mode 100644 index 8b13789..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services1.yml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services10.yml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services10.yml deleted file mode 100644 index f2f8d95..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services10.yml +++ /dev/null @@ -1,9 +0,0 @@ -parameters: - project.parameter.foo: BAR - -services: - project.service.foo: - class: BAR - -project: - test: %project.parameter.foo% diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services11.yml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services11.yml deleted file mode 100644 index 40126f0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services11.yml +++ /dev/null @@ -1 +0,0 @@ -foobarfoobar: {} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services13.yml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services13.yml deleted file mode 100644 index d52d355..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services13.yml +++ /dev/null @@ -1,3 +0,0 @@ -# used to test imports in XML -parameters: - imported_from_yaml: true diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services2.yml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services2.yml deleted file mode 100644 index 8ddfe0d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services2.yml +++ /dev/null @@ -1,11 +0,0 @@ -parameters: - FOO: bar - values: - - true - - false - - 0 - - 1000.3 - bar: foo - foo_bar: @foo_bar - MixedCase: - MixedCaseKey: value diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services3.yml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services3.yml deleted file mode 100644 index 0e92cdf..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services3.yml +++ /dev/null @@ -1,5 +0,0 @@ -parameters: - foo: foo - values: - - true - - false diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4.yml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4.yml deleted file mode 100644 index 18f1065..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4.yml +++ /dev/null @@ -1,6 +0,0 @@ -imports: - - { resource: services2.yml } - - { resource: services3.yml } - - { resource: "../ini/parameters.ini", class: Symfony\Component\DependencyInjection\Loader\IniFileLoader } - - { resource: "../ini/parameters2.ini" } - - { resource: "../xml/services13.xml" } diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4_bad_import.yml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4_bad_import.yml deleted file mode 100644 index f7089fc..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4_bad_import.yml +++ /dev/null @@ -1,2 +0,0 @@ -imports: - - { resource: foo_fake.yml, ignore_errors: true } diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml deleted file mode 100644 index eaa52bd..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml +++ /dev/null @@ -1,26 +0,0 @@ -services: - foo: { class: FooClass } - baz: { class: BazClass } - scope.container: { class: FooClass, scope: container } - scope.custom: { class: FooClass, scope: custom } - scope.prototype: { class: FooClass, scope: prototype } - constructor: { class: FooClass, factory_method: getInstance } - file: { class: FooClass, file: %path%/foo.php } - arguments: { class: FooClass, arguments: [foo, @foo, [true, false]] } - configurator1: { class: FooClass, configurator: sc_configure } - configurator2: { class: FooClass, configurator: [@baz, configure] } - configurator3: { class: FooClass, configurator: [BazClass, configureStatic] } - method_call1: - class: FooClass - calls: - - [ setBar, [] ] - - [ setBar ] - method_call2: - class: FooClass - calls: - - [ setBar, [ foo, @foo, [true, false] ] ] - alias_for_foo: @foo - another_alias_for_foo: - alias: foo - public: false - factory_service: { class: BazClass, factory_method: getInstance, factory_service: baz_factory } diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services7.yml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services7.yml deleted file mode 100644 index 09064f2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services7.yml +++ /dev/null @@ -1,2 +0,0 @@ -services: - foo: { class: BarClass } diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services8.yml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services8.yml deleted file mode 100644 index 5e74748..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services8.yml +++ /dev/null @@ -1,6 +0,0 @@ -parameters: - foo: '%baz%' - baz: bar - bar: 'foo is %%foo bar' - values: [true, false, null, 0, 1000.3, 'true', 'false', 'null'] - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml deleted file mode 100644 index 0fd2ae3..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml +++ /dev/null @@ -1,43 +0,0 @@ -parameters: - baz_class: BazClass - foo_class: FooClass - foo: bar - -services: - foo: - class: FooClass - tags: - - { name: foo, foo: foo } - - { name: foo, bar: bar } - factory_method: getInstance - arguments: [foo, '@foo.baz', { '%foo%': 'foo is %foo%', bar: '%foo%' }, true, '@service_container'] - properties: { foo: bar, moo: '@foo.baz' } - calls: - - [setBar, ['@bar']] - - [initialize, { }] - - scope: prototype - configurator: sc_configure - bar: - class: FooClass - arguments: [foo, '@foo.baz', '%foo_bar%'] - configurator: ['@foo.baz', configure] - foo.baz: - class: %baz_class% - factory_method: getInstance - configurator: ['%baz_class%', configureStatic1] - foo_bar: - class: %foo_class% - method_call1: - class: FooClass - file: %path%foo.php - calls: - - [setBar, ['@foo']] - - [setBar, ['@?foo2']] - - [setBar, ['@?foo3']] - - [setBar, ['@?foobaz']] - - factory_service: - factory_method: getInstance - factory_service: foo.baz - alias_for_foo: @foo diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php deleted file mode 100644 index 33594d6..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Loader; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Loader\ClosureLoader; - -class ClosureLoaderTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\Loader\ClosureLoader::supports - */ - public function testSupports() - { - $loader = new ClosureLoader(new ContainerBuilder()); - - $this->assertTrue($loader->supports(function ($container) {}), '->supports() returns true if the resource is loadable'); - $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Loader\ClosureLoader::load - */ - public function testLoad() - { - $loader = new ClosureLoader($container = new ContainerBuilder()); - - $loader->load(function ($container) { - $container->setParameter('foo', 'foo'); - }); - - $this->assertEquals('foo', $container->getParameter('foo'), '->load() loads a \Closure resource'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php deleted file mode 100644 index bba9c8c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Loader; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Loader\IniFileLoader; -use Symfony\Component\Config\FileLocator; - -class IniFileLoaderTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixturesPath; - - protected $container; - protected $loader; - - public static function setUpBeforeClass() - { - self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); - } - - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - - $this->container = new ContainerBuilder(); - $this->loader = new IniFileLoader($this->container, new FileLocator(self::$fixturesPath.'/ini')); - } - - /** - * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::__construct - * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::load - */ - public function testIniFileCanBeLoaded() - { - $this->loader->load('parameters.ini'); - $this->assertEquals(array('foo' => 'bar', 'bar' => '%foo%'), $this->container->getParameterBag()->all(), '->load() takes a single file name as its first argument'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::__construct - * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::load - */ - public function testExceptionIsRaisedWhenIniFileDoesNotExist() - { - try { - $this->loader->load('foo.ini'); - $this->fail('->load() throws an InvalidArgumentException if the loaded file does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the loaded file does not exist'); - $this->assertStringStartsWith('The file "foo.ini" does not exist (in: ', $e->getMessage(), '->load() throws an InvalidArgumentException if the loaded file does not exist'); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::__construct - * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::load - */ - public function testExceptionIsRaisedWhenIniFileCannotBeParsed() - { - try { - @$this->loader->load('nonvalid.ini'); - $this->fail('->load() throws an InvalidArgumentException if the loaded file is not parseable'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the loaded file is not parseable'); - $this->assertEquals('The "nonvalid.ini" file is not valid.', $e->getMessage(), '->load() throws an InvalidArgumentException if the loaded file is not parseable'); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::supports - */ - public function testSupports() - { - $loader = new IniFileLoader(new ContainerBuilder(), new FileLocator()); - - $this->assertTrue($loader->supports('foo.ini'), '->supports() returns true if the resource is loadable'); - $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php deleted file mode 100644 index 3a97dc2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Loader; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\Config\Loader\Loader; -use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; -use Symfony\Component\Config\FileLocator; - -class PhpFileLoaderTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\Loader\PhpFileLoader::supports - */ - public function testSupports() - { - $loader = new PhpFileLoader(new ContainerBuilder(), new FileLocator()); - - $this->assertTrue($loader->supports('foo.php'), '->supports() returns true if the resource is loadable'); - $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Loader\PhpFileLoader::load - */ - public function testLoad() - { - $loader = new PhpFileLoader($container = new ContainerBuilder(), new FileLocator()); - - $loader->load(__DIR__.'/../Fixtures/php/simple.php'); - - $this->assertEquals('foo', $container->getParameter('foo'), '->load() loads a PHP file resource'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php deleted file mode 100644 index 12109c2..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php +++ /dev/null @@ -1,331 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Loader; - -use Symfony\Component\DependencyInjection\ContainerInterface; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\Config\Loader\Loader; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; -use Symfony\Component\DependencyInjection\Loader\IniFileLoader; -use Symfony\Component\Config\Loader\LoaderResolver; -use Symfony\Component\Config\FileLocator; - -class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixturesPath; - - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - - public static function setUpBeforeClass() - { - self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); - require_once self::$fixturesPath.'/includes/foo.php'; - require_once self::$fixturesPath.'/includes/ProjectExtension.php'; - require_once self::$fixturesPath.'/includes/ProjectWithXsdExtension.php'; - } - - public function testLoad() - { - $loader = new XmlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/ini')); - - try { - $loader->load('foo.xml'); - $this->fail('->load() throws an InvalidArgumentException if the loaded file does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the loaded file does not exist'); - $this->assertStringStartsWith('The file "foo.xml" does not exist (in:', $e->getMessage(), '->load() throws an InvalidArgumentException if the loaded file does not exist'); - } - } - - public function testParseFile() - { - $loader = new XmlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/ini')); - $r = new \ReflectionObject($loader); - $m = $r->getMethod('parseFile'); - $m->setAccessible(true); - - try { - $m->invoke($loader, self::$fixturesPath.'/ini/parameters.ini'); - $this->fail('->parseFile() throws an InvalidArgumentException if the loaded file is not a valid XML file'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->parseFile() throws an InvalidArgumentException if the loaded file is not a valid XML file'); - $this->assertStringStartsWith('[ERROR 4] Start tag expected, \'<\' not found (in', $e->getMessage(), '->parseFile() throws an InvalidArgumentException if the loaded file is not a valid XML file'); - } - - $loader = new XmlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/xml')); - - try { - $m->invoke($loader, self::$fixturesPath.'/xml/nonvalid.xml'); - $this->fail('->parseFile() throws an InvalidArgumentException if the loaded file does not validate the XSD'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->parseFile() throws an InvalidArgumentException if the loaded file does not validate the XSD'); - $this->assertStringStartsWith('[ERROR 1845] Element \'nonvalid\': No matching global declaration available for the validation root. (in', $e->getMessage(), '->parseFile() throws an InvalidArgumentException if the loaded file does not validate the XSD'); - } - - $xml = $m->invoke($loader, self::$fixturesPath.'/xml/services1.xml'); - $this->assertEquals('Symfony\\Component\\DependencyInjection\\SimpleXMLElement', get_class($xml), '->parseFile() returns an SimpleXMLElement object'); - } - - public function testLoadParameters() - { - $container = new ContainerBuilder(); - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - $loader->load('services2.xml'); - - $actual = $container->getParameterBag()->all(); - $expected = array('a string', 'foo' => 'bar', 'values' => array(0, 'integer' => 4, 100 => null, 'true', true, false, 'on', 'off', 'float' => 1.3, 1000.3, 'a string', array('foo', 'bar')), 'foo_bar' => new Reference('foo_bar'), 'mixedcase' => array('MixedCaseKey' => 'value')); - - $this->assertEquals($expected, $actual, '->load() converts XML values to PHP ones'); - } - - public function testLoadImports() - { - $container = new ContainerBuilder(); - $resolver = new LoaderResolver(array( - new IniFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')), - new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')), - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')), - )); - $loader->setResolver($resolver); - $loader->load('services4.xml'); - - $actual = $container->getParameterBag()->all(); - $expected = array('a string', 'foo' => 'bar', 'values' => array(true, false), 'foo_bar' => new Reference('foo_bar'), 'mixedcase' => array('MixedCaseKey' => 'value'), 'bar' => '%foo%', 'imported_from_ini' => true, 'imported_from_yaml' => true); - - $this->assertEquals(array_keys($expected), array_keys($actual), '->load() imports and merges imported files'); - - // Bad import throws no exception due to ignore_errors value. - $loader->load('services4_bad_import.xml'); - } - - public function testLoadAnonymousServices() - { - $container = new ContainerBuilder(); - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - $loader->load('services5.xml'); - $services = $container->getDefinitions(); - $this->assertEquals(4, count($services), '->load() attributes unique ids to anonymous services'); - - // anonymous service as an argument - $args = $services['foo']->getArguments(); - $this->assertEquals(1, count($args), '->load() references anonymous services as "normal" ones'); - $this->assertEquals('Symfony\\Component\\DependencyInjection\\Reference', get_class($args[0]), '->load() converts anonymous services to references to "normal" services'); - $this->assertTrue(isset($services[(string) $args[0]]), '->load() makes a reference to the created ones'); - $inner = $services[(string) $args[0]]; - $this->assertEquals('BarClass', $inner->getClass(), '->load() uses the same configuration as for the anonymous ones'); - - // inner anonymous services - $args = $inner->getArguments(); - $this->assertEquals(1, count($args), '->load() references anonymous services as "normal" ones'); - $this->assertEquals('Symfony\\Component\\DependencyInjection\\Reference', get_class($args[0]), '->load() converts anonymous services to references to "normal" services'); - $this->assertTrue(isset($services[(string) $args[0]]), '->load() makes a reference to the created ones'); - $inner = $services[(string) $args[0]]; - $this->assertEquals('BazClass', $inner->getClass(), '->load() uses the same configuration as for the anonymous ones'); - - // anonymous service as a property - $properties = $services['foo']->getProperties(); - $property = $properties['p']; - $this->assertEquals('Symfony\\Component\\DependencyInjection\\Reference', get_class($property), '->load() converts anonymous services to references to "normal" services'); - $this->assertTrue(isset($services[(string) $property]), '->load() makes a reference to the created ones'); - $inner = $services[(string) $property]; - $this->assertEquals('BazClass', $inner->getClass(), '->load() uses the same configuration as for the anonymous ones'); - } - - public function testLoadServices() - { - $container = new ContainerBuilder(); - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - $loader->load('services6.xml'); - $services = $container->getDefinitions(); - $this->assertTrue(isset($services['foo']), '->load() parses elements'); - $this->assertEquals('Symfony\\Component\\DependencyInjection\\Definition', get_class($services['foo']), '->load() converts element to Definition instances'); - $this->assertEquals('FooClass', $services['foo']->getClass(), '->load() parses the class attribute'); - $this->assertEquals('container', $services['scope.container']->getScope()); - $this->assertEquals('custom', $services['scope.custom']->getScope()); - $this->assertEquals('prototype', $services['scope.prototype']->getScope()); - $this->assertEquals('getInstance', $services['constructor']->getFactoryMethod(), '->load() parses the factory-method attribute'); - $this->assertEquals('%path%/foo.php', $services['file']->getFile(), '->load() parses the file tag'); - $this->assertEquals(array('foo', new Reference('foo'), array(true, false)), $services['arguments']->getArguments(), '->load() parses the argument tags'); - $this->assertEquals('sc_configure', $services['configurator1']->getConfigurator(), '->load() parses the configurator tag'); - $this->assertEquals(array(new Reference('baz', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, false), 'configure'), $services['configurator2']->getConfigurator(), '->load() parses the configurator tag'); - $this->assertEquals(array('BazClass', 'configureStatic'), $services['configurator3']->getConfigurator(), '->load() parses the configurator tag'); - $this->assertEquals(array(array('setBar', array())), $services['method_call1']->getMethodCalls(), '->load() parses the method_call tag'); - $this->assertEquals(array(array('setBar', array('foo', new Reference('foo'), array(true, false)))), $services['method_call2']->getMethodCalls(), '->load() parses the method_call tag'); - $this->assertNull($services['factory_service']->getClass()); - $this->assertEquals('getInstance', $services['factory_service']->getFactoryMethod()); - $this->assertEquals('baz_factory', $services['factory_service']->getFactoryService()); - - $aliases = $container->getAliases(); - $this->assertTrue(isset($aliases['alias_for_foo']), '->load() parses elements'); - $this->assertEquals('foo', (string) $aliases['alias_for_foo'], '->load() parses aliases'); - $this->assertTrue($aliases['alias_for_foo']->isPublic()); - $this->assertTrue(isset($aliases['another_alias_for_foo'])); - $this->assertEquals('foo', (string) $aliases['another_alias_for_foo']); - $this->assertFalse($aliases['another_alias_for_foo']->isPublic()); - } - - public function testConvertDomElementToArray() - { - $doc = new \DOMDocument("1.0"); - $doc->loadXML('bar'); - $this->assertEquals('bar', XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); - - $doc = new \DOMDocument("1.0"); - $doc->loadXML(''); - $this->assertEquals(array('foo' => 'bar'), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); - - $doc = new \DOMDocument("1.0"); - $doc->loadXML('bar'); - $this->assertEquals(array('foo' => 'bar'), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); - - $doc = new \DOMDocument("1.0"); - $doc->loadXML('barbar'); - $this->assertEquals(array('foo' => array('value' => 'bar', 'foo' => 'bar')), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); - - $doc = new \DOMDocument("1.0"); - $doc->loadXML(''); - $this->assertEquals(array('foo' => null), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); - - $doc = new \DOMDocument("1.0"); - $doc->loadXML(''); - $this->assertEquals(array('foo' => null), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); - - $doc = new \DOMDocument("1.0"); - $doc->loadXML(''); - $this->assertEquals(array('foo' => array(array('foo' => 'bar'), array('foo' => 'bar'))), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); - } - - public function testExtensions() - { - $container = new ContainerBuilder(); - $container->registerExtension(new \ProjectExtension()); - $container->registerExtension(new \ProjectWithXsdExtension()); - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - - // extension without an XSD - $loader->load('extensions/services1.xml'); - $container->compile(); - $services = $container->getDefinitions(); - $parameters = $container->getParameterBag()->all(); - - $this->assertTrue(isset($services['project.service.bar']), '->load() parses extension elements'); - $this->assertTrue(isset($parameters['project.parameter.bar']), '->load() parses extension elements'); - - $this->assertEquals('BAR', $services['project.service.foo']->getClass(), '->load() parses extension elements'); - $this->assertEquals('BAR', $parameters['project.parameter.foo'], '->load() parses extension elements'); - - // extension with an XSD - $container = new ContainerBuilder(); - $container->registerExtension(new \ProjectExtension()); - $container->registerExtension(new \ProjectWithXsdExtension()); - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - $loader->load('extensions/services2.xml'); - $container->compile(); - $services = $container->getDefinitions(); - $parameters = $container->getParameterBag()->all(); - - $this->assertTrue(isset($services['project.service.bar']), '->load() parses extension elements'); - $this->assertTrue(isset($parameters['project.parameter.bar']), '->load() parses extension elements'); - - $this->assertEquals('BAR', $services['project.service.foo']->getClass(), '->load() parses extension elements'); - $this->assertEquals('BAR', $parameters['project.parameter.foo'], '->load() parses extension elements'); - - $container = new ContainerBuilder(); - $container->registerExtension(new \ProjectExtension()); - $container->registerExtension(new \ProjectWithXsdExtension()); - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - - // extension with an XSD (does not validate) - try { - $loader->load('extensions/services3.xml'); - $this->fail('->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); - $this->assertRegexp('/The attribute \'bar\' is not allowed/', $e->getMessage(), '->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); - } - - // non-registered extension - try { - $loader->load('extensions/services4.xml'); - $this->fail('->load() throws an InvalidArgumentException if the tag is not valid'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the tag is not valid'); - $this->assertStringStartsWith('There is no extension able to load the configuration for "project:bar" (in', $e->getMessage(), '->load() throws an InvalidArgumentException if the tag is not valid'); - } - } - - public function testExtensionInPhar() - { - if (extension_loaded('suhosin') && false === strpos(ini_get('suhosin.executor.include.whitelist'), 'phar')) { - $this->markTestSkipped('To run this test, add "phar" to the "suhosin.executor.include.whitelist" settings in your php.ini file.'); - } - - require_once self::$fixturesPath.'/includes/ProjectWithXsdExtensionInPhar.phar'; - - // extension with an XSD in PHAR archive - $container = new ContainerBuilder(); - $container->registerExtension(new \ProjectWithXsdExtensionInPhar()); - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - $loader->load('extensions/services6.xml'); - - // extension with an XSD in PHAR archive (does not validate) - try { - $loader->load('extensions/services7.xml'); - $this->fail('->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); - $this->assertRegexp('/The attribute \'bar\' is not allowed/', $e->getMessage(), '->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\Loader\XmlFileLoader::supports - */ - public function testSupports() - { - $loader = new XmlFileLoader(new ContainerBuilder(), new FileLocator()); - - $this->assertTrue($loader->supports('foo.xml'), '->supports() returns true if the resource is loadable'); - $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); - } - - public function testNoNamingConflictsForAnonymousServices() - { - $container = new ContainerBuilder(); - - $loader1 = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml/extension1')); - $loader1->load('services.xml'); - $services = $container->getDefinitions(); - $this->assertEquals(2, count($services), '->load() attributes unique ids to anonymous services'); - $loader2 = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml/extension2')); - $loader2->load('services.xml'); - $services = $container->getDefinitions(); - $this->assertEquals(4, count($services), '->load() attributes unique ids to anonymous services'); - - $services = $container->getDefinitions(); - $args1 = $services['extension1.foo']->getArguments(); - $inner1 = $services[(string) $args1[0]]; - $this->assertEquals('BarClass1', $inner1->getClass(), '->load() uses the same configuration as for the anonymous ones'); - $args2 = $services['extension2.foo']->getArguments(); - $inner2 = $services[(string) $args2[0]]; - $this->assertEquals('BarClass2', $inner2->getClass(), '->load() uses the same configuration as for the anonymous ones'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php deleted file mode 100644 index e655d3b..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php +++ /dev/null @@ -1,211 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Loader; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\Config\Loader\Loader; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; -use Symfony\Component\DependencyInjection\Loader\IniFileLoader; -use Symfony\Component\Config\Loader\LoaderResolver; -use Symfony\Component\Config\FileLocator; - -class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixturesPath; - - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - - if (!class_exists('Symfony\Component\Yaml\Yaml')) { - $this->markTestSkipped('The "Yaml" component is not available'); - } - } - - public static function setUpBeforeClass() - { - self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); - require_once self::$fixturesPath.'/includes/foo.php'; - require_once self::$fixturesPath.'/includes/ProjectExtension.php'; - } - - public function testLoadFile() - { - $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/ini')); - $r = new \ReflectionObject($loader); - $m = $r->getMethod('loadFile'); - $m->setAccessible(true); - - try { - $m->invoke($loader, 'foo.yml'); - $this->fail('->load() throws an InvalidArgumentException if the loaded file does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the loaded file does not exist'); - $this->assertEquals('The service file "foo.yml" is not valid.', $e->getMessage(), '->load() throws an InvalidArgumentException if the loaded file does not exist'); - } - - try { - $m->invoke($loader, 'parameters.ini'); - $this->fail('->load() throws an InvalidArgumentException if the loaded file is not a valid YAML file'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the loaded file is not a valid YAML file'); - $this->assertEquals('The service file "parameters.ini" is not valid.', $e->getMessage(), '->load() throws an InvalidArgumentException if the loaded file is not a valid YAML file'); - } - - $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml')); - - foreach (array('nonvalid1', 'nonvalid2') as $fixture) { - try { - $m->invoke($loader, $fixture.'.yml'); - $this->fail('->load() throws an InvalidArgumentException if the loaded file does not validate'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the loaded file does not validate'); - $this->assertStringMatchesFormat('The service file "nonvalid%d.yml" is not valid.', $e->getMessage(), '->load() throws an InvalidArgumentException if the loaded file does not validate'); - } - } - } - - public function testLoadParameters() - { - $container = new ContainerBuilder(); - $loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')); - $loader->load('services2.yml'); - $this->assertEquals(array('foo' => 'bar', 'mixedcase' => array('MixedCaseKey' => 'value'), 'values' => array(true, false, 0, 1000.3), 'bar' => 'foo', 'foo_bar' => new Reference('foo_bar')), $container->getParameterBag()->all(), '->load() converts YAML keys to lowercase'); - } - - public function testLoadImports() - { - $container = new ContainerBuilder(); - $resolver = new LoaderResolver(array( - new IniFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')), - new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')), - $loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')), - )); - $loader->setResolver($resolver); - $loader->load('services4.yml'); - - $actual = $container->getParameterBag()->all(); - $expected = array('foo' => 'bar', 'values' => array(true, false), 'bar' => '%foo%', 'foo_bar' => new Reference('foo_bar'), 'mixedcase' => array('MixedCaseKey' => 'value'), 'imported_from_ini' => true, 'imported_from_xml' => true); - $this->assertEquals(array_keys($expected), array_keys($actual), '->load() imports and merges imported files'); - - // Bad import throws no exception due to ignore_errors value. - $loader->load('services4_bad_import.yml'); - } - - public function testLoadServices() - { - $container = new ContainerBuilder(); - $loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')); - $loader->load('services6.yml'); - $services = $container->getDefinitions(); - $this->assertTrue(isset($services['foo']), '->load() parses service elements'); - $this->assertEquals('Symfony\\Component\\DependencyInjection\\Definition', get_class($services['foo']), '->load() converts service element to Definition instances'); - $this->assertEquals('FooClass', $services['foo']->getClass(), '->load() parses the class attribute'); - $this->assertEquals('container', $services['scope.container']->getScope()); - $this->assertEquals('custom', $services['scope.custom']->getScope()); - $this->assertEquals('prototype', $services['scope.prototype']->getScope()); - $this->assertEquals('getInstance', $services['constructor']->getFactoryMethod(), '->load() parses the factory_method attribute'); - $this->assertEquals('%path%/foo.php', $services['file']->getFile(), '->load() parses the file tag'); - $this->assertEquals(array('foo', new Reference('foo'), array(true, false)), $services['arguments']->getArguments(), '->load() parses the argument tags'); - $this->assertEquals('sc_configure', $services['configurator1']->getConfigurator(), '->load() parses the configurator tag'); - $this->assertEquals(array(new Reference('baz'), 'configure'), $services['configurator2']->getConfigurator(), '->load() parses the configurator tag'); - $this->assertEquals(array('BazClass', 'configureStatic'), $services['configurator3']->getConfigurator(), '->load() parses the configurator tag'); - $this->assertEquals(array(array('setBar', array()), array('setBar', array())), $services['method_call1']->getMethodCalls(), '->load() parses the method_call tag'); - $this->assertEquals(array(array('setBar', array('foo', new Reference('foo'), array(true, false)))), $services['method_call2']->getMethodCalls(), '->load() parses the method_call tag'); - $this->assertEquals('baz_factory', $services['factory_service']->getFactoryService()); - - $aliases = $container->getAliases(); - $this->assertTrue(isset($aliases['alias_for_foo']), '->load() parses aliases'); - $this->assertEquals('foo', (string) $aliases['alias_for_foo'], '->load() parses aliases'); - $this->assertTrue($aliases['alias_for_foo']->isPublic()); - $this->assertTrue(isset($aliases['another_alias_for_foo'])); - $this->assertEquals('foo', (string) $aliases['another_alias_for_foo']); - $this->assertFalse($aliases['another_alias_for_foo']->isPublic()); - } - - public function testExtensions() - { - $container = new ContainerBuilder(); - $container->registerExtension(new \ProjectExtension()); - $loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')); - $loader->load('services10.yml'); - $container->compile(); - $services = $container->getDefinitions(); - $parameters = $container->getParameterBag()->all(); - - $this->assertTrue(isset($services['project.service.bar']), '->load() parses extension elements'); - $this->assertTrue(isset($parameters['project.parameter.bar']), '->load() parses extension elements'); - - $this->assertEquals('BAR', $services['project.service.foo']->getClass(), '->load() parses extension elements'); - $this->assertEquals('BAR', $parameters['project.parameter.foo'], '->load() parses extension elements'); - - try { - $loader->load('services11.yml'); - $this->fail('->load() throws an InvalidArgumentException if the tag is not valid'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the tag is not valid'); - $this->assertStringStartsWith('There is no extension able to load the configuration for "foobarfoobar" (in', $e->getMessage(), '->load() throws an InvalidArgumentException if the tag is not valid'); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\Loader\YamlFileLoader::supports - */ - public function testSupports() - { - $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator()); - - $this->assertTrue($loader->supports('foo.yml'), '->supports() returns true if the resource is loadable'); - $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); - } - - public function testNonArrayTagThrowsException() - { - $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml')); - try { - $loader->load('badtag1.yml'); - $this->fail('->load() should throw an exception when the tags key of a service is not an array'); - } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the tags key is not an array'); - $this->assertStringStartsWith('Parameter "tags" must be an array for service', $e->getMessage(), '->load() throws an InvalidArgumentException if the tags key is not an array'); - } - } - - public function testTagWithoutNameThrowsException() - { - $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml')); - try { - $loader->load('badtag2.yml'); - $this->fail('->load() should throw an exception when a tag is missing the name key'); - } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if a tag is missing the name key'); - $this->assertStringStartsWith('A "tags" entry is missing a "name" key for service ', $e->getMessage(), '->load() throws an InvalidArgumentException if a tag is missing the name key'); - } - } - - public function testTagWithAttributeArrayThrowsException() - { - $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml')); - try { - $loader->load('badtag3.yml'); - $this->fail('->load() should throw an exception when a tag-attribute is not a scalar'); - } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if a tag-attribute is not a scalar'); - $this->assertStringStartsWith('A "tags" attribute must be of a scalar-type for service ', $e->getMessage(), '->load() throws an InvalidArgumentException if a tag-attribute is not a scalar'); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php deleted file mode 100644 index e6e7fea..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\ParameterBag; - -use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; - -class FrozenParameterBagTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag::__construct - */ - public function testConstructor() - { - $parameters = array( - 'foo' => 'foo', - 'bar' => 'bar', - ); - $bag = new FrozenParameterBag($parameters); - $this->assertEquals($parameters, $bag->all(), '__construct() takes an array of parameters as its first argument'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag::clear - * @expectedException \LogicException - */ - public function testClear() - { - $bag = new FrozenParameterBag(array()); - $bag->clear(); - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag::set - * @expectedException \LogicException - */ - public function testSet() - { - $bag = new FrozenParameterBag(array()); - $bag->set('foo', 'bar'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag::add - * @expectedException \LogicException - */ - public function testAdd() - { - $bag = new FrozenParameterBag(array()); - $bag->add(array()); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php deleted file mode 100644 index 46fb358..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php +++ /dev/null @@ -1,244 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\ParameterBag; - -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; -use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; -use Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; - -class ParameterBagTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::__construct - */ - public function testConstructor() - { - $bag = new ParameterBag($parameters = array( - 'foo' => 'foo', - 'bar' => 'bar', - )); - $this->assertEquals($parameters, $bag->all(), '__construct() takes an array of parameters as its first argument'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::clear - */ - public function testClear() - { - $bag = new ParameterBag($parameters = array( - 'foo' => 'foo', - 'bar' => 'bar', - )); - $bag->clear(); - $this->assertEquals(array(), $bag->all(), '->clear() removes all parameters'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::remove - */ - public function testRemove() - { - $bag = new ParameterBag(array( - 'foo' => 'foo', - 'bar' => 'bar', - )); - $bag->remove('foo'); - $this->assertEquals(array('bar' => 'bar'), $bag->all(), '->remove() removes a parameter'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::get - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::set - */ - public function testGetSet() - { - $bag = new ParameterBag(array('foo' => 'bar')); - $bag->set('bar', 'foo'); - $this->assertEquals('foo', $bag->get('bar'), '->set() sets the value of a new parameter'); - - $bag->set('foo', 'baz'); - $this->assertEquals('baz', $bag->get('foo'), '->set() overrides previously set parameter'); - - $bag->set('Foo', 'baz1'); - $this->assertEquals('baz1', $bag->get('foo'), '->set() converts the key to lowercase'); - $this->assertEquals('baz1', $bag->get('FOO'), '->get() converts the key to lowercase'); - - try { - $bag->get('baba'); - $this->fail('->get() throws an \InvalidArgumentException if the key does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->get() throws an \InvalidArgumentException if the key does not exist'); - $this->assertEquals('You have requested a non-existent parameter "baba".', $e->getMessage(), '->get() throws an \InvalidArgumentException if the key does not exist'); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::has - */ - public function testHas() - { - $bag = new ParameterBag(array('foo' => 'bar')); - $this->assertTrue($bag->has('foo'), '->has() returns true if a parameter is defined'); - $this->assertTrue($bag->has('Foo'), '->has() converts the key to lowercase'); - $this->assertFalse($bag->has('bar'), '->has() returns false if a parameter is not defined'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::resolveValue - */ - public function testResolveValue() - { - $bag = new ParameterBag(array()); - $this->assertEquals('foo', $bag->resolveValue('foo'), '->resolveValue() returns its argument unmodified if no placeholders are found'); - - $bag = new ParameterBag(array('foo' => 'bar')); - $this->assertEquals('I\'m a bar', $bag->resolveValue('I\'m a %foo%'), '->resolveValue() replaces placeholders by their values'); - $this->assertEquals(array('bar' => 'bar'), $bag->resolveValue(array('%foo%' => '%foo%')), '->resolveValue() replaces placeholders in keys and values of arrays'); - $this->assertEquals(array('bar' => array('bar' => array('bar' => 'bar'))), $bag->resolveValue(array('%foo%' => array('%foo%' => array('%foo%' => '%foo%')))), '->resolveValue() replaces placeholders in nested arrays'); - $this->assertEquals('I\'m a %%foo%%', $bag->resolveValue('I\'m a %%foo%%'), '->resolveValue() supports % escaping by doubling it'); - $this->assertEquals('I\'m a bar %%foo bar', $bag->resolveValue('I\'m a %foo% %%foo %foo%'), '->resolveValue() supports % escaping by doubling it'); - $this->assertEquals(array('foo' => array('bar' => array('ding' => 'I\'m a bar %%foo %%bar'))), $bag->resolveValue(array('foo' => array('bar' => array('ding' => 'I\'m a bar %%foo %%bar')))), '->resolveValue() supports % escaping by doubling it'); - - $bag = new ParameterBag(array('foo' => true)); - $this->assertTrue($bag->resolveValue('%foo%'), '->resolveValue() replaces arguments that are just a placeholder by their value without casting them to strings'); - $bag = new ParameterBag(array('foo' => null)); - $this->assertNull($bag->resolveValue('%foo%'), '->resolveValue() replaces arguments that are just a placeholder by their value without casting them to strings'); - - $bag = new ParameterBag(array('foo' => 'bar', 'baz' => '%%%foo% %foo%%% %%foo%% %%%foo%%%')); - $this->assertEquals('%%bar bar%% %%foo%% %%bar%%', $bag->resolveValue('%baz%'), '->resolveValue() replaces params placed besides escaped %'); - - $bag = new ParameterBag(array('baz' => '%%s?%%s')); - $this->assertEquals('%%s?%%s', $bag->resolveValue('%baz%'), '->resolveValue() is not replacing greedily'); - - $bag = new ParameterBag(array()); - try { - $bag->resolveValue('%foobar%'); - $this->fail('->resolveValue() throws an InvalidArgumentException if a placeholder references a non-existent parameter'); - } catch (ParameterNotFoundException $e) { - $this->assertEquals('You have requested a non-existent parameter "foobar".', $e->getMessage(), '->resolveValue() throws a ParameterNotFoundException if a placeholder references a non-existent parameter'); - } - - try { - $bag->resolveValue('foo %foobar% bar'); - $this->fail('->resolveValue() throws a ParameterNotFoundException if a placeholder references a non-existent parameter'); - } catch (ParameterNotFoundException $e) { - $this->assertEquals('You have requested a non-existent parameter "foobar".', $e->getMessage(), '->resolveValue() throws a ParameterNotFoundException if a placeholder references a non-existent parameter'); - } - - $bag = new ParameterBag(array('foo' => 'a %bar%', 'bar' => array())); - try { - $bag->resolveValue('%foo%'); - $this->fail('->resolveValue() throws a RuntimeException when a parameter embeds another non-string parameter'); - } catch (RuntimeException $e) { - $this->assertEquals('A string value must be composed of strings and/or numbers, but found parameter "bar" of type array inside string value "a %bar%".', $e->getMessage(), '->resolveValue() throws a RuntimeException when a parameter embeds another non-string parameter'); - } - - $bag = new ParameterBag(array('foo' => '%bar%', 'bar' => '%foobar%', 'foobar' => '%foo%')); - try { - $bag->resolveValue('%foo%'); - $this->fail('->resolveValue() throws a ParameterCircularReferenceException when a parameter has a circular reference'); - } catch (ParameterCircularReferenceException $e) { - $this->assertEquals('Circular reference detected for parameter "foo" ("foo" > "bar" > "foobar" > "foo").', $e->getMessage(), '->resolveValue() throws a ParameterCircularReferenceException when a parameter has a circular reference'); - } - - $bag = new ParameterBag(array('foo' => 'a %bar%', 'bar' => 'a %foobar%', 'foobar' => 'a %foo%')); - try { - $bag->resolveValue('%foo%'); - $this->fail('->resolveValue() throws a ParameterCircularReferenceException when a parameter has a circular reference'); - } catch (ParameterCircularReferenceException $e) { - $this->assertEquals('Circular reference detected for parameter "foo" ("foo" > "bar" > "foobar" > "foo").', $e->getMessage(), '->resolveValue() throws a ParameterCircularReferenceException when a parameter has a circular reference'); - } - - $bag = new ParameterBag(array('host' => 'foo.bar', 'port' => 1337)); - $this->assertEquals('foo.bar:1337', $bag->resolveValue('%host%:%port%')); - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::resolve - */ - public function testResolveIndicatesWhyAParameterIsNeeded() - { - $bag = new ParameterBag(array('foo' => '%bar%')); - - try { - $bag->resolve(); - } catch (ParameterNotFoundException $e) { - $this->assertEquals('The parameter "foo" has a dependency on a non-existent parameter "bar".', $e->getMessage()); - } - - $bag = new ParameterBag(array('foo' => '%bar%')); - - try { - $bag->resolve(); - } catch (ParameterNotFoundException $e) { - $this->assertEquals('The parameter "foo" has a dependency on a non-existent parameter "bar".', $e->getMessage()); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::resolve - */ - public function testResolveUnescapesValue() - { - $bag = new ParameterBag(array( - 'foo' => array('bar' => array('ding' => 'I\'m a bar %%foo %%bar')), - 'bar' => 'I\'m a %%foo%%', - )); - - $bag->resolve(); - - $this->assertEquals('I\'m a %foo%', $bag->get('bar'), '->resolveValue() supports % escaping by doubling it'); - $this->assertEquals(array('bar' => array('ding' => 'I\'m a bar %foo %bar')), $bag->get('foo'), '->resolveValue() supports % escaping by doubling it'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::escapeValue - */ - public function testEscapeValue() - { - $bag = new ParameterBag(); - - $bag->add(array( - 'foo' => $bag->escapeValue(array('bar' => array('ding' => 'I\'m a bar %foo %bar', 'zero' => null))), - 'bar' => $bag->escapeValue('I\'m a %foo%'), - )); - - $this->assertEquals('I\'m a %%foo%%', $bag->get('bar'), '->escapeValue() escapes % by doubling it'); - $this->assertEquals(array('bar' => array('ding' => 'I\'m a bar %%foo %%bar', 'zero' => null)), $bag->get('foo'), '->escapeValue() escapes % by doubling it'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::resolve - * @dataProvider stringsWithSpacesProvider - */ - public function testResolveStringWithSpacesReturnsString($expected, $test, $description) - { - $bag = new ParameterBag(array('foo' => 'bar')); - - try { - $this->assertEquals($expected, $bag->resolveString($test), $description); - } catch (ParameterNotFoundException $e) { - $this->fail(sprintf('%s - "%s"', $description, $expected)); - } - } - - public function stringsWithSpacesProvider() - { - return array( - array('bar', '%foo%', 'Parameters must be wrapped by %.'), - array('% foo %', '% foo %', 'Parameters should not have spaces.'), - array('{% set my_template = "foo" %}', '{% set my_template = "foo" %}', 'Twig-like strings are not parameters.'), - array('50% is less than 100%', '50% is less than 100%', 'Text between % signs is allowed, if there are spaces.'), - ); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ParameterTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ParameterTest.php deleted file mode 100644 index bed188e..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ParameterTest.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests; - -use Symfony\Component\DependencyInjection\Parameter; - -class ParameterTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\DependencyInjection\Parameter::__construct - */ - public function testConstructor() - { - $ref = new Parameter('foo'); - $this->assertEquals('foo', (string) $ref, '__construct() sets the id of the parameter, which is used for the __toString() method'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ReferenceTest.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ReferenceTest.php deleted file mode 100644 index f14e99f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/ReferenceTest.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests; - -use Symfony\Component\DependencyInjection\Reference; - -class ReferenceTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\DependencyInjection\Reference::__construct - */ - public function testConstructor() - { - $ref = new Reference('foo'); - $this->assertEquals('foo', (string) $ref, '__construct() sets the id of the reference, which is used for the __toString() method'); - } - - public function testCaseInsensitive() - { - $ref = new Reference('FooBar'); - $this->assertEquals('foobar', (string) $ref, 'the id is lowercased as the container is case insensitive'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/bootstrap.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/bootstrap.php deleted file mode 100644 index fd3118f..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/bootstrap.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -spl_autoload_register(function ($class) { - if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\DependencyInjection')) { - if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\DependencyInjection')).'.php')) { - require_once $file; - } - } -}); - -if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) { - require_once $loader; -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Variable.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Variable.php deleted file mode 100644 index c84b8fd..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Variable.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection; - -/** - * Represents a variable. - * - * $var = new Variable('a'); - * - * will be dumped as - * - * $a - * - * by the PHP dumper. - * - * @author Johannes M. Schmitt - */ -class Variable -{ - private $name; - - /** - * Constructor - * - * @param string $name - */ - public function __construct($name) - { - $this->name = $name; - } - - /** - * Converts the object to a string - * - * @return string - */ - public function __toString() - { - return $this->name; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/composer.json b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/composer.json deleted file mode 100644 index 7238bd0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "symfony/dependency-injection", - "type": "library", - "description": "Symfony DependencyInjection Component", - "keywords": [], - "homepage": "http://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "symfony/yaml": "2.1.*", - "symfony/config": "2.1.*" - }, - "suggest": { - "symfony/yaml": "self.version", - "symfony/config": "self.version" - }, - "autoload": { - "psr-0": { "Symfony\\Component\\DependencyInjection": "" } - }, - "target-dir": "Symfony/Component/DependencyInjection", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/phpunit.xml.dist b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/phpunit.xml.dist deleted file mode 100644 index 554d104..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/phpunit.xml.dist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - ./Tests/ - - - - - - ./ - - ./Resources - ./Tests - ./vendor - - - - diff --git a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/.gitignore b/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/.gitignore deleted file mode 100644 index d1502b0..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -vendor/ -composer.lock diff --git a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/CHANGELOG.md b/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/CHANGELOG.md deleted file mode 100644 index 50edf20..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/CHANGELOG.md +++ /dev/null @@ -1,12 +0,0 @@ -CHANGELOG -========= - -2.1.0 ------ - - * added support for the HTTP PATCH method - * refactored the Form class internals to support multi-dimensional fields - (the public API is backward compatible) - * added a way to get parsing errors for Crawler::addHtmlContent() and - Crawler::addXmlContent() via libxml functions - * added support for submitting a form without a submit button diff --git a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Crawler.php b/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Crawler.php deleted file mode 100644 index b408d7d..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Crawler.php +++ /dev/null @@ -1,721 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DomCrawler; - -use Symfony\Component\CssSelector\CssSelector; - -/** - * Crawler eases navigation of a list of \DOMNode objects. - * - * @author Fabien Potencier - * - * @api - */ -class Crawler extends \SplObjectStorage -{ - /** - * @var string The current URI or the base href value - */ - private $uri; - - /** - * Constructor. - * - * @param mixed $node A Node to use as the base for the crawling - * @param string $uri The current URI or the base href value - * - * @api - */ - public function __construct($node = null, $uri = null) - { - $this->uri = $uri; - - $this->add($node); - } - - /** - * Removes all the nodes. - * - * @api - */ - public function clear() - { - $this->removeAll($this); - } - - /** - * Adds a node to the current list of nodes. - * - * This method uses the appropriate specialized add*() method based - * on the type of the argument. - * - * @param null|\DOMNodeList|array|\DOMNode $node A node - * - * @api - */ - public function add($node) - { - if ($node instanceof \DOMNodeList) { - $this->addNodeList($node); - } elseif (is_array($node)) { - $this->addNodes($node); - } elseif (is_string($node)) { - $this->addContent($node); - } elseif (is_object($node)) { - $this->addNode($node); - } - } - - /** - * Adds HTML/XML content. - * - * @param string $content A string to parse as HTML/XML - * @param null|string $type The content type of the string - * - * @return null|void - */ - public function addContent($content, $type = null) - { - if (empty($type)) { - $type = 'text/html'; - } - - // DOM only for HTML/XML content - if (!preg_match('/(x|ht)ml/i', $type, $matches)) { - return null; - } - - $charset = 'ISO-8859-1'; - if (false !== $pos = strpos($type, 'charset=')) { - $charset = substr($type, $pos + 8); - if (false !== $pos = strpos($charset, ';')) { - $charset = substr($charset, 0, $pos); - } - } - - if ('x' === $matches[1]) { - $this->addXmlContent($content, $charset); - } else { - $this->addHtmlContent($content, $charset); - } - } - - /** - * Adds an HTML content to the list of nodes. - * - * The libxml errors are disabled when the content is parsed. - * - * If you want to get parsing errors, be sure to enable - * internal errors via libxml_use_internal_errors(true) - * and then, get the errors via libxml_get_errors(). Be - * sure to clear errors with libxml_clear_errors() afterward. - * - * @param string $content The HTML content - * @param string $charset The charset - * - * @api - */ - public function addHtmlContent($content, $charset = 'UTF-8') - { - $dom = new \DOMDocument('1.0', $charset); - $dom->validateOnParse = true; - - if (function_exists('mb_convert_encoding')) { - $content = mb_convert_encoding($content, 'HTML-ENTITIES', $charset); - } - - $current = libxml_use_internal_errors(true); - @$dom->loadHTML($content); - libxml_use_internal_errors($current); - - $this->addDocument($dom); - - $base = $this->filterXPath('descendant-or-self::base')->extract(array('href')); - - if (count($base)) { - $this->uri = current($base); - } - } - - /** - * Adds an XML content to the list of nodes. - * - * The libxml errors are disabled when the content is parsed. - * - * If you want to get parsing errors, be sure to enable - * internal errors via libxml_use_internal_errors(true) - * and then, get the errors via libxml_get_errors(). Be - * sure to clear errors with libxml_clear_errors() afterward. - * - * @param string $content The XML content - * @param string $charset The charset - * - * @api - */ - public function addXmlContent($content, $charset = 'UTF-8') - { - $dom = new \DOMDocument('1.0', $charset); - $dom->validateOnParse = true; - - // remove the default namespace to make XPath expressions simpler - $current = libxml_use_internal_errors(true); - @$dom->loadXML(str_replace('xmlns', 'ns', $content)); - libxml_use_internal_errors($current); - - $this->addDocument($dom); - } - - /** - * Adds a \DOMDocument to the list of nodes. - * - * @param \DOMDocument $dom A \DOMDocument instance - * - * @api - */ - public function addDocument(\DOMDocument $dom) - { - if ($dom->documentElement) { - $this->addNode($dom->documentElement); - } - } - - /** - * Adds a \DOMNodeList to the list of nodes. - * - * @param \DOMNodeList $nodes A \DOMNodeList instance - * - * @api - */ - public function addNodeList(\DOMNodeList $nodes) - { - foreach ($nodes as $node) { - $this->addNode($node); - } - } - - /** - * Adds an array of \DOMNode instances to the list of nodes. - * - * @param array $nodes An array of \DOMNode instances - * - * @api - */ - public function addNodes(array $nodes) - { - foreach ($nodes as $node) { - $this->add($node); - } - } - - /** - * Adds a \DOMNode instance to the list of nodes. - * - * @param \DOMNode $node A \DOMNode instance - * - * @api - */ - public function addNode(\DOMNode $node) - { - if ($node instanceof \DOMDocument) { - $this->attach($node->documentElement); - } else { - $this->attach($node); - } - } - - /** - * Returns a node given its position in the node list. - * - * @param integer $position The position - * - * @return Crawler A new instance of the Crawler with the selected node, or an empty Crawler if it does not exist. - * - * @api - */ - public function eq($position) - { - foreach ($this as $i => $node) { - if ($i == $position) { - return new static($node, $this->uri); - } - } - - return new static(null, $this->uri); - } - - /** - * Calls an anonymous function on each node of the list. - * - * The anonymous function receives the position and the node as arguments. - * - * Example: - * - * $crawler->filter('h1')->each(function ($node, $i) - * { - * return $node->nodeValue; - * }); - * - * @param \Closure $closure An anonymous function - * - * @return array An array of values returned by the anonymous function - * - * @api - */ - public function each(\Closure $closure) - { - $data = array(); - foreach ($this as $i => $node) { - $data[] = $closure($node, $i); - } - - return $data; - } - - /** - * Reduces the list of nodes by calling an anonymous function. - * - * To remove a node from the list, the anonymous function must return false. - * - * @param \Closure $closure An anonymous function - * - * @return Crawler A Crawler instance with the selected nodes. - * - * @api - */ - public function reduce(\Closure $closure) - { - $nodes = array(); - foreach ($this as $i => $node) { - if (false !== $closure($node, $i)) { - $nodes[] = $node; - } - } - - return new static($nodes, $this->uri); - } - - /** - * Returns the first node of the current selection - * - * @return Crawler A Crawler instance with the first selected node - * - * @api - */ - public function first() - { - return $this->eq(0); - } - - /** - * Returns the last node of the current selection - * - * @return Crawler A Crawler instance with the last selected node - * - * @api - */ - public function last() - { - return $this->eq(count($this) - 1); - } - - /** - * Returns the siblings nodes of the current selection - * - * @return Crawler A Crawler instance with the sibling nodes - * - * @throws \InvalidArgumentException When current node is empty - * - * @api - */ - public function siblings() - { - if (!count($this)) { - throw new \InvalidArgumentException('The current node list is empty.'); - } - - return new static($this->sibling($this->getNode(0)->parentNode->firstChild), $this->uri); - } - - /** - * Returns the next siblings nodes of the current selection - * - * @return Crawler A Crawler instance with the next sibling nodes - * - * @throws \InvalidArgumentException When current node is empty - * - * @api - */ - public function nextAll() - { - if (!count($this)) { - throw new \InvalidArgumentException('The current node list is empty.'); - } - - return new static($this->sibling($this->getNode(0)), $this->uri); - } - - /** - * Returns the previous sibling nodes of the current selection - * - * @return Crawler A Crawler instance with the previous sibling nodes - * - * @api - */ - public function previousAll() - { - if (!count($this)) { - throw new \InvalidArgumentException('The current node list is empty.'); - } - - return new static($this->sibling($this->getNode(0), 'previousSibling'), $this->uri); - } - - /** - * Returns the parents nodes of the current selection - * - * @return Crawler A Crawler instance with the parents nodes of the current selection - * - * @throws \InvalidArgumentException When current node is empty - * - * @api - */ - public function parents() - { - if (!count($this)) { - throw new \InvalidArgumentException('The current node list is empty.'); - } - - $node = $this->getNode(0); - $nodes = array(); - - while ($node = $node->parentNode) { - if (1 === $node->nodeType && '_root' !== $node->nodeName) { - $nodes[] = $node; - } - } - - return new static($nodes, $this->uri); - } - - /** - * Returns the children nodes of the current selection - * - * @return Crawler A Crawler instance with the children nodes - * - * @throws \InvalidArgumentException When current node is empty - * - * @api - */ - public function children() - { - if (!count($this)) { - throw new \InvalidArgumentException('The current node list is empty.'); - } - - return new static($this->sibling($this->getNode(0)->firstChild), $this->uri); - } - - /** - * Returns the attribute value of the first node of the list. - * - * @param string $attribute The attribute name - * - * @return string The attribute value - * - * @throws \InvalidArgumentException When current node is empty - * - * @api - */ - public function attr($attribute) - { - if (!count($this)) { - throw new \InvalidArgumentException('The current node list is empty.'); - } - - return $this->getNode(0)->getAttribute($attribute); - } - - /** - * Returns the node value of the first node of the list. - * - * @return string The node value - * - * @throws \InvalidArgumentException When current node is empty - * - * @api - */ - public function text() - { - if (!count($this)) { - throw new \InvalidArgumentException('The current node list is empty.'); - } - - return $this->getNode(0)->nodeValue; - } - - /** - * Extracts information from the list of nodes. - * - * You can extract attributes or/and the node value (_text). - * - * Example: - * - * $crawler->filter('h1 a')->extract(array('_text', 'href')); - * - * @param array $attributes An array of attributes - * - * @return array An array of extracted values - * - * @api - */ - public function extract($attributes) - { - $attributes = (array) $attributes; - - $data = array(); - foreach ($this as $node) { - $elements = array(); - foreach ($attributes as $attribute) { - if ('_text' === $attribute) { - $elements[] = $node->nodeValue; - } else { - $elements[] = $node->getAttribute($attribute); - } - } - - $data[] = count($attributes) > 1 ? $elements : $elements[0]; - } - - return $data; - } - - /** - * Filters the list of nodes with an XPath expression. - * - * @param string $xpath An XPath expression - * - * @return Crawler A new instance of Crawler with the filtered list of nodes - * - * @api - */ - public function filterXPath($xpath) - { - $document = new \DOMDocument('1.0', 'UTF-8'); - $root = $document->appendChild($document->createElement('_root')); - foreach ($this as $node) { - $root->appendChild($document->importNode($node, true)); - } - - $domxpath = new \DOMXPath($document); - - return new static($domxpath->query($xpath), $this->uri); - } - - /** - * Filters the list of nodes with a CSS selector. - * - * This method only works if you have installed the CssSelector Symfony Component. - * - * @param string $selector A CSS selector - * - * @return Crawler A new instance of Crawler with the filtered list of nodes - * - * @throws \RuntimeException if the CssSelector Component is not available - * - * @api - */ - public function filter($selector) - { - if (!class_exists('Symfony\\Component\\CssSelector\\CssSelector')) { - // @codeCoverageIgnoreStart - throw new \RuntimeException('Unable to filter with a CSS selector as the Symfony CssSelector is not installed (you can use filterXPath instead).'); - // @codeCoverageIgnoreEnd - } - - return $this->filterXPath(CssSelector::toXPath($selector)); - } - - /** - * Selects links by name or alt value for clickable images. - * - * @param string $value The link text - * - * @return Crawler A new instance of Crawler with the filtered list of nodes - * - * @api - */ - public function selectLink($value) - { - $xpath = sprintf('//a[contains(concat(\' \', normalize-space(string(.)), \' \'), %s)] ', static::xpathLiteral(' '.$value.' ')). - sprintf('| //a/img[contains(concat(\' \', normalize-space(string(@alt)), \' \'), %s)]/ancestor::a', static::xpathLiteral(' '.$value.' ')); - - return $this->filterXPath($xpath); - } - - /** - * Selects a button by name or alt value for images. - * - * @param string $value The button text - * - * @return Crawler A new instance of Crawler with the filtered list of nodes - * - * @api - */ - public function selectButton($value) - { - $xpath = sprintf('//input[((@type="submit" or @type="button") and contains(concat(\' \', normalize-space(string(@value)), \' \'), %s)) ', static::xpathLiteral(' '.$value.' ')). - sprintf('or (@type="image" and contains(concat(\' \', normalize-space(string(@alt)), \' \'), %s)) or @id="%s" or @name="%s"] ', static::xpathLiteral(' '.$value.' '), $value, $value). - sprintf('| //button[contains(concat(\' \', normalize-space(string(.)), \' \'), %s) or @id="%s" or @name="%s"]', static::xpathLiteral(' '.$value.' '), $value, $value); - - return $this->filterXPath($xpath); - } - - /** - * Returns a Link object for the first node in the list. - * - * @param string $method The method for the link (get by default) - * - * @return Link A Link instance - * - * @throws \InvalidArgumentException If the current node list is empty - * - * @api - */ - public function link($method = 'get') - { - if (!count($this)) { - throw new \InvalidArgumentException('The current node list is empty.'); - } - - $node = $this->getNode(0); - - return new Link($node, $this->uri, $method); - } - - /** - * Returns an array of Link objects for the nodes in the list. - * - * @return array An array of Link instances - * - * @api - */ - public function links() - { - $links = array(); - foreach ($this as $node) { - $links[] = new Link($node, $this->uri, 'get'); - } - - return $links; - } - - /** - * Returns a Form object for the first node in the list. - * - * @param array $values An array of values for the form fields - * @param string $method The method for the form - * - * @return Form A Form instance - * - * @throws \InvalidArgumentException If the current node list is empty - * - * @api - */ - public function form(array $values = null, $method = null) - { - if (!count($this)) { - throw new \InvalidArgumentException('The current node list is empty.'); - } - - $form = new Form($this->getNode(0), $this->uri, $method); - - if (null !== $values) { - $form->setValues($values); - } - - return $form; - } - - /** - * Converts string for XPath expressions. - * - * Escaped characters are: quotes (") and apostrophe ('). - * - * Examples: - * - * echo Crawler::xpathLiteral('foo " bar'); - * //prints 'foo " bar' - * - * echo Crawler::xpathLiteral("foo ' bar"); - * //prints "foo ' bar" - * - * echo Crawler::xpathLiteral('a\'b"c'); - * //prints concat('a', "'", 'b"c') - * - * - * @param string $s String to be escaped - * - * @return string Converted string - * - */ - public static function xpathLiteral($s) - { - if (false === strpos($s, "'")) { - return sprintf("'%s'", $s); - } - - if (false === strpos($s, '"')) { - return sprintf('"%s"', $s); - } - - $string = $s; - $parts = array(); - while (true) { - if (false !== $pos = strpos($string, "'")) { - $parts[] = sprintf("'%s'", substr($string, 0, $pos)); - $parts[] = "\"'\""; - $string = substr($string, $pos + 1); - } else { - $parts[] = "'$string'"; - break; - } - } - - return sprintf("concat(%s)", implode($parts, ', ')); - } - - private function getNode($position) - { - foreach ($this as $i => $node) { - if ($i == $position) { - return $node; - } - // @codeCoverageIgnoreStart - } - - return null; - // @codeCoverageIgnoreEnd - } - - private function sibling($node, $siblingDir = 'nextSibling') - { - $nodes = array(); - - do { - if ($node !== $this->getNode(0) && $node->nodeType === 1) { - $nodes[] = $node; - } - } while ($node = $node->$siblingDir); - - return $nodes; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php b/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php deleted file mode 100644 index 2e192cb..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php +++ /dev/null @@ -1,307 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DomCrawler\Field; - -/** - * ChoiceFormField represents a choice form field. - * - * It is constructed from a HTML select tag, or a HTML checkbox, or radio inputs. - * - * @author Fabien Potencier - * - * @api - */ -class ChoiceFormField extends FormField -{ - /** - * @var string - */ - private $type; - /** - * @var Boolean - */ - private $multiple; - /** - * @var array - */ - private $options; - - /** - * Returns true if the field should be included in the submitted values. - * - * @return Boolean true if the field should be included in the submitted values, false otherwise - */ - public function hasValue() - { - // don't send a value for unchecked checkboxes - if (in_array($this->type, array('checkbox', 'radio')) && null === $this->value) { - return false; - } - - return true; - } - - /** - * Check if the current selected option is disabled - * - * @return Boolean - */ - public function isDisabled() - { - foreach ($this->options as $option) { - if ($option['value'] == $this->value && $option['disabled']) { - return true; - } - } - - return false; - } - - /** - * Sets the value of the field. - * - * @param string $value The value of the field - * - * @api - */ - public function select($value) - { - $this->setValue($value); - } - - /** - * Ticks a checkbox. - * - * @throws \LogicException When the type provided is not correct - * - * @api - */ - public function tick() - { - if ('checkbox' !== $this->type) { - throw new \LogicException(sprintf('You cannot tick "%s" as it is not a checkbox (%s).', $this->name, $this->type)); - } - - $this->setValue(true); - } - - /** - * Ticks a checkbox. - * - * @throws \LogicException When the type provided is not correct - * - * @api - */ - public function untick() - { - if ('checkbox' !== $this->type) { - throw new \LogicException(sprintf('You cannot tick "%s" as it is not a checkbox (%s).', $this->name, $this->type)); - } - - $this->setValue(false); - } - - /** - * Sets the value of the field. - * - * @param string $value The value of the field - * - * @throws \InvalidArgumentException When value type provided is not correct - */ - public function setValue($value) - { - if ('checkbox' == $this->type && false === $value) { - // uncheck - $this->value = null; - } elseif ('checkbox' == $this->type && true === $value) { - // check - $this->value = $this->options[0]['value']; - } else { - if (is_array($value)) { - if (!$this->multiple) { - throw new \InvalidArgumentException(sprintf('The value for "%s" cannot be an array.', $this->name)); - } - - foreach ($value as $v) { - if (!$this->containsOption($v, $this->options)) { - throw new \InvalidArgumentException(sprintf('Input "%s" cannot take "%s" as a value (possible values: %s).', $this->name, $v, implode(', ', $this->availableOptionValues()))); - } - } - } elseif (!$this->containsOption($value, $this->options)) { - throw new \InvalidArgumentException(sprintf('Input "%s" cannot take "%s" as a value (possible values: %s).', $this->name, $value, implode(', ', $this->availableOptionValues()))); - } - - if ($this->multiple) { - $value = (array) $value; - } - - if (is_array($value)) { - $this->value = $value; - } else { - parent::setValue($value); - } - } - } - - /** - * Adds a choice to the current ones. - * - * This method should only be used internally. - * - * @param \DOMNode $node A \DOMNode - * - * @throws \LogicException When choice provided is not multiple nor radio - */ - public function addChoice(\DOMNode $node) - { - if (!$this->multiple && 'radio' != $this->type) { - throw new \LogicException(sprintf('Unable to add a choice for "%s" as it is not multiple or is not a radio button.', $this->name)); - } - - $option = $this->buildOptionValue($node); - $this->options[] = $option; - - if ($node->getAttribute('checked')) { - $this->value = $option['value']; - } - } - - /** - * Returns the type of the choice field (radio, select, or checkbox). - * - * @return string The type - */ - public function getType() - { - return $this->type; - } - - /** - * Returns true if the field accepts multiple values. - * - * @return Boolean true if the field accepts multiple values, false otherwise - */ - public function isMultiple() - { - return $this->multiple; - } - - /** - * Initializes the form field. - * - * @throws \LogicException When node type is incorrect - */ - protected function initialize() - { - if ('input' != $this->node->nodeName && 'select' != $this->node->nodeName) { - throw new \LogicException(sprintf('A ChoiceFormField can only be created from an input or select tag (%s given).', $this->node->nodeName)); - } - - if ('input' == $this->node->nodeName && 'checkbox' != $this->node->getAttribute('type') && 'radio' != $this->node->getAttribute('type')) { - throw new \LogicException(sprintf('A ChoiceFormField can only be created from an input tag with a type of checkbox or radio (given type is %s).', $this->node->getAttribute('type'))); - } - - $this->value = null; - $this->options = array(); - $this->multiple = false; - - if ('input' == $this->node->nodeName) { - $this->type = $this->node->getAttribute('type'); - $optionValue = $this->buildOptionValue($this->node); - $this->options[] = $optionValue; - - if ($this->node->getAttribute('checked')) { - $this->value = $optionValue['value']; - } - } else { - $this->type = 'select'; - if ($this->node->hasAttribute('multiple')) { - $this->multiple = true; - $this->value = array(); - $this->name = str_replace('[]', '', $this->name); - } - - $found = false; - foreach ($this->xpath->query('descendant::option', $this->node) as $option) { - $this->options[] = $this->buildOptionValue($option); - - if ($option->getAttribute('selected')) { - $found = true; - if ($this->multiple) { - $this->value[] = $option->getAttribute('value'); - } else { - $this->value = $option->getAttribute('value'); - } - } - } - - // if no option is selected and if it is a simple select box, take the first option as the value - $option = $this->xpath->query('descendant::option', $this->node)->item(0); - if (!$found && !$this->multiple && $option instanceof \DOMElement) { - $this->value = $option->getAttribute('value'); - } - } - } - - /** - * Returns option value with associated disabled flag - * - * @param \DOMNode $node - * - * @return array - */ - private function buildOptionValue($node) - { - $option = array(); - - $defaultValue = (isset($node->nodeValue) && !empty($node->nodeValue)) ? $node->nodeValue : '1'; - $option['value'] = $node->hasAttribute('value') ? $node->getAttribute('value') : $defaultValue; - $option['disabled'] = ($node->hasAttribute('disabled') && $node->getAttribute('disabled') == 'disabled'); - - return $option; - } - - /** - * Checks whether given vale is in the existing options - * - * @param string $optionValue - * @param array $options - * - * @return bool - */ - public function containsOption($optionValue, $options) - { - foreach ($options as $option) { - if ($option['value'] == $optionValue) { - return true; - } - } - - return false; - } - - /** - * Returns list of available field options - * - * @return array - */ - public function availableOptionValues() - { - $values = array(); - - foreach ($this->options as $option) { - $values[] = $option['value']; - } - - return $values; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Field/FileFormField.php b/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Field/FileFormField.php deleted file mode 100644 index 1bb08af..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Field/FileFormField.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DomCrawler\Field; - -/** - * FileFormField represents a file form field (an HTML file input tag). - * - * @author Fabien Potencier - * - * @api - */ -class FileFormField extends FormField -{ - /** - * Sets the PHP error code associated with the field. - * - * @param integer $error The error code (one of UPLOAD_ERR_INI_SIZE, UPLOAD_ERR_FORM_SIZE, UPLOAD_ERR_PARTIAL, UPLOAD_ERR_NO_FILE, UPLOAD_ERR_NO_TMP_DIR, UPLOAD_ERR_CANT_WRITE, or UPLOAD_ERR_EXTENSION) - * - * @throws \InvalidArgumentException When error code doesn't exist - */ - public function setErrorCode($error) - { - $codes = array(UPLOAD_ERR_INI_SIZE, UPLOAD_ERR_FORM_SIZE, UPLOAD_ERR_PARTIAL, UPLOAD_ERR_NO_FILE, UPLOAD_ERR_NO_TMP_DIR, UPLOAD_ERR_CANT_WRITE, UPLOAD_ERR_EXTENSION); - if (!in_array($error, $codes)) { - throw new \InvalidArgumentException(sprintf('The error code %s is not valid.', $error)); - } - - $this->value = array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => $error, 'size' => 0); - } - - /** - * Sets the value of the field. - * - * @param string $value The value of the field - * - * @api - */ - public function upload($value) - { - $this->setValue($value); - } - - /** - * Sets the value of the field. - * - * @param string $value The value of the field - */ - public function setValue($value) - { - if (null !== $value && is_readable($value)) { - $error = UPLOAD_ERR_OK; - $size = filesize($value); - $name = basename($value); - - // copy to a tmp location - $tmp = tempnam(sys_get_temp_dir(), 'upload'); - unlink($tmp); - copy($value, $tmp); - $value = $tmp; - } else { - $error = UPLOAD_ERR_NO_FILE; - $size = 0; - $name = ''; - $value = ''; - } - - $this->value = array('name' => $name, 'type' => '', 'tmp_name' => $value, 'error' => $error, 'size' => $size); - } - - /** - * Initializes the form field. - * - * @throws \LogicException When node type is incorrect - */ - protected function initialize() - { - if ('input' != $this->node->nodeName) { - throw new \LogicException(sprintf('A FileFormField can only be created from an input tag (%s given).', $this->node->nodeName)); - } - - if ('file' != $this->node->getAttribute('type')) { - throw new \LogicException(sprintf('A FileFormField can only be created from an input tag with a type of file (given type is %s).', $this->node->getAttribute('type'))); - } - - $this->setValue(null); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Field/FormField.php b/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Field/FormField.php deleted file mode 100644 index 6412272..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Field/FormField.php +++ /dev/null @@ -1,122 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DomCrawler\Field; - -/** - * FormField is the abstract class for all form fields. - * - * @author Fabien Potencier - */ -abstract class FormField -{ - /** - * @var \DOMNode - */ - protected $node; - /** - * @var string - */ - protected $name; - /** - * @var string - */ - protected $value; - /** - * @var \DOMDocument - */ - protected $document; - /** - * @var \DOMXPath - */ - protected $xpath; - /** - * @var Boolean - */ - protected $disabled; - - /** - * Constructor. - * - * @param \DOMNode $node The node associated with this field - */ - public function __construct(\DOMNode $node) - { - $this->node = $node; - $this->name = $node->getAttribute('name'); - - $this->document = new \DOMDocument('1.0', 'UTF-8'); - $this->node = $this->document->importNode($this->node, true); - - $root = $this->document->appendChild($this->document->createElement('_root')); - $root->appendChild($this->node); - $this->xpath = new \DOMXPath($this->document); - - $this->initialize(); - } - - /** - * Returns the name of the field. - * - * @return string The name of the field - */ - public function getName() - { - return $this->name; - } - - /** - * Gets the value of the field. - * - * @return string|array The value of the field - */ - public function getValue() - { - return $this->value; - } - - /** - * Sets the value of the field. - * - * @param string $value The value of the field - * - * @api - */ - public function setValue($value) - { - $this->value = (string) $value; - } - - /** - * Returns true if the field should be included in the submitted values. - * - * @return Boolean true if the field should be included in the submitted values, false otherwise - */ - public function hasValue() - { - return true; - } - - /** - * Check if the current field is disabled - * - * @return Boolean - */ - public function isDisabled() - { - return $this->node->hasAttribute('disabled'); - } - - /** - * Initializes the form field. - */ - abstract protected function initialize(); -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Field/InputFormField.php b/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Field/InputFormField.php deleted file mode 100644 index 251873c..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Field/InputFormField.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DomCrawler\Field; - -/** - * InputFormField represents an input form field (an HTML input tag). - * - * For inputs with type of file, checkbox, or radio, there are other more - * specialized classes (cf. FileFormField and ChoiceFormField). - * - * @author Fabien Potencier - * - * @api - */ -class InputFormField extends FormField -{ - /** - * Initializes the form field. - * - * @throws \LogicException When node type is incorrect - */ - protected function initialize() - { - if ('input' != $this->node->nodeName) { - throw new \LogicException(sprintf('An InputFormField can only be created from an input tag (%s given).', $this->node->nodeName)); - } - - if ('checkbox' == $this->node->getAttribute('type')) { - throw new \LogicException('Checkboxes should be instances of ChoiceFormField.'); - } - - if ('file' == $this->node->getAttribute('type')) { - throw new \LogicException('File inputs should be instances of FileFormField.'); - } - - $this->value = $this->node->getAttribute('value'); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Field/TextareaFormField.php b/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Field/TextareaFormField.php deleted file mode 100644 index 794e966..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Field/TextareaFormField.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DomCrawler\Field; - -/** - * TextareaFormField represents a textarea form field (an HTML textarea tag). - * - * @author Fabien Potencier - * - * @api - */ -class TextareaFormField extends FormField -{ - /** - * Initializes the form field. - * - * @throws \LogicException When node type is incorrect - */ - protected function initialize() - { - if ('textarea' != $this->node->nodeName) { - throw new \LogicException(sprintf('A TextareaFormField can only be created from a textarea tag (%s given).', $this->node->nodeName)); - } - - $this->value = null; - foreach ($this->node->childNodes as $node) { - $this->value .= $this->document->saveXML($node); - } - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Form.php b/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Form.php deleted file mode 100644 index 9106a23..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Form.php +++ /dev/null @@ -1,586 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DomCrawler; - -use Symfony\Component\DomCrawler\Field\FormField; - -/** - * Form represents an HTML form. - * - * @author Fabien Potencier - * - * @api - */ -class Form extends Link implements \ArrayAccess -{ - /** - * @var \DOMNode - */ - private $button; - /** - * @var Field\FormField[] - */ - private $fields; - - /** - * Constructor. - * - * @param \DOMNode $node A \DOMNode instance - * @param string $currentUri The URI of the page where the form is embedded - * @param string $method The method to use for the link (if null, it defaults to the method defined by the form) - * - * @throws \LogicException if the node is not a button inside a form tag - * - * @api - */ - public function __construct(\DOMNode $node, $currentUri, $method = null) - { - parent::__construct($node, $currentUri, $method); - - $this->initialize(); - } - - /** - * Gets the form node associated with this form. - * - * @return \DOMNode A \DOMNode instance - */ - public function getFormNode() - { - return $this->node; - } - - /** - * Sets the value of the fields. - * - * @param array $values An array of field values - * - * @return Form - * - * @api - */ - public function setValues(array $values) - { - foreach ($values as $name => $value) { - $this->fields->set($name, $value); - } - - return $this; - } - - /** - * Gets the field values. - * - * The returned array does not include file fields (@see getFiles). - * - * @return array An array of field values. - * - * @api - */ - public function getValues() - { - $values = array(); - foreach ($this->fields->all() as $name => $field) { - if ($field->isDisabled()) { - continue; - } - - if (!$field instanceof Field\FileFormField && $field->hasValue()) { - $values[$name] = $field->getValue(); - } - } - - return $values; - } - - /** - * Gets the file field values. - * - * @return array An array of file field values. - * - * @api - */ - public function getFiles() - { - if (!in_array($this->getMethod(), array('POST', 'PUT', 'DELETE', 'PATCH'))) { - return array(); - } - - $files = array(); - - foreach ($this->fields->all() as $name => $field) { - if ($field->isDisabled()) { - continue; - } - - if ($field instanceof Field\FileFormField) { - $files[$name] = $field->getValue(); - } - } - - return $files; - } - - /** - * Gets the field values as PHP. - * - * This method converts fields with the array notation - * (like foo[bar] to arrays) like PHP does. - * - * @return array An array of field values. - * - * @api - */ - public function getPhpValues() - { - $qs = http_build_query($this->getValues(), '', '&'); - parse_str($qs, $values); - - return $values; - } - - /** - * Gets the file field values as PHP. - * - * This method converts fields with the array notation - * (like foo[bar] to arrays) like PHP does. - * - * @return array An array of field values. - * - * @api - */ - public function getPhpFiles() - { - $qs = http_build_query($this->getFiles(), '', '&'); - parse_str($qs, $values); - - return $values; - } - - /** - * Gets the URI of the form. - * - * The returned URI is not the same as the form "action" attribute. - * This method merges the value if the method is GET to mimics - * browser behavior. - * - * @return string The URI - * - * @api - */ - public function getUri() - { - $uri = parent::getUri(); - - if (!in_array($this->getMethod(), array('POST', 'PUT', 'DELETE', 'PATCH')) && $queryString = http_build_query($this->getValues(), null, '&')) { - $sep = false === strpos($uri, '?') ? '?' : '&'; - $uri .= $sep.$queryString; - } - - return $uri; - } - - protected function getRawUri() - { - return $this->node->getAttribute('action'); - } - - /** - * Gets the form method. - * - * If no method is defined in the form, GET is returned. - * - * @return string The method - * - * @api - */ - public function getMethod() - { - if (null !== $this->method) { - return $this->method; - } - - return $this->node->getAttribute('method') ? strtoupper($this->node->getAttribute('method')) : 'GET'; - } - - /** - * Returns true if the named field exists. - * - * @param string $name The field name - * - * @return Boolean true if the field exists, false otherwise - * - * @api - */ - public function has($name) - { - return $this->fields->has($name); - } - - /** - * Removes a field from the form. - * - * @param string $name The field name - * - * @throws \InvalidArgumentException when the name is malformed - * - * @api - */ - public function remove($name) - { - $this->fields->remove($name); - } - - /** - * Gets a named field. - * - * @param string $name The field name - * - * @return FormField The field instance - * - * @throws \InvalidArgumentException When field is not present in this form - * - * @api - */ - public function get($name) - { - return $this->fields->get($name); - } - - /** - * Sets a named field. - * - * @param FormField $field The field - * - * @api - */ - public function set(FormField $field) - { - $this->fields->add($field); - } - - /** - * Gets all fields. - * - * @return array An array of fields - * - * @api - */ - public function all() - { - return $this->fields->all(); - } - - /** - * Returns true if the named field exists. - * - * @param string $name The field name - * - * @return Boolean true if the field exists, false otherwise - */ - public function offsetExists($name) - { - return $this->has($name); - } - - /** - * Gets the value of a field. - * - * @param string $name The field name - * - * @return FormField The associated Field instance - * - * @throws \InvalidArgumentException if the field does not exist - */ - public function offsetGet($name) - { - return $this->fields->get($name); - } - - /** - * Sets the value of a field. - * - * @param string $name The field name - * @param string|array $value The value of the field - * - * @throws \InvalidArgumentException if the field does not exist - */ - public function offsetSet($name, $value) - { - $this->fields->set($name, $value); - } - - /** - * Removes a field from the form. - * - * @param string $name The field name - */ - public function offsetUnset($name) - { - $this->fields->remove($name); - } - - protected function setNode(\DOMNode $node) - { - $this->button = $node; - if ('button' == $node->nodeName || ('input' == $node->nodeName && in_array($node->getAttribute('type'), array('submit', 'button', 'image')))) { - do { - // use the ancestor form element - if (null === $node = $node->parentNode) { - throw new \LogicException('The selected node does not have a form ancestor.'); - } - } while ('form' != $node->nodeName); - } elseif ('form' != $node->nodeName) { - throw new \LogicException(sprintf('Unable to submit on a "%s" tag.', $node->nodeName)); - } - - $this->node = $node; - } - - private function initialize() - { - $this->fields = new FormFieldRegistry(); - - $document = new \DOMDocument('1.0', 'UTF-8'); - $node = $document->importNode($this->node, true); - $button = $document->importNode($this->button, true); - $root = $document->appendChild($document->createElement('_root')); - $root->appendChild($node); - $root->appendChild($button); - $xpath = new \DOMXPath($document); - - foreach ($xpath->query('descendant::input | descendant::textarea | descendant::select', $root) as $node) { - if (!$node->hasAttribute('name')) { - continue; - } - - $nodeName = $node->nodeName; - - if ($node === $button) { - $this->set(new Field\InputFormField($node)); - } elseif ('select' == $nodeName || 'input' == $nodeName && 'checkbox' == $node->getAttribute('type')) { - $this->set(new Field\ChoiceFormField($node)); - } elseif ('input' == $nodeName && 'radio' == $node->getAttribute('type')) { - if ($this->has($node->getAttribute('name'))) { - $this->get($node->getAttribute('name'))->addChoice($node); - } else { - $this->set(new Field\ChoiceFormField($node)); - } - } elseif ('input' == $nodeName && 'file' == $node->getAttribute('type')) { - $this->set(new Field\FileFormField($node)); - } elseif ('input' == $nodeName && !in_array($node->getAttribute('type'), array('submit', 'button', 'image'))) { - $this->set(new Field\InputFormField($node)); - } elseif ('textarea' == $nodeName) { - $this->set(new Field\TextareaFormField($node)); - } - } - } -} - -class FormFieldRegistry -{ - private $fields = array(); - - private $base; - - /** - * Adds a field to the registry. - * - * @param FormField $field The field - * - * @throws \InvalidArgumentException when the name is malformed - */ - public function add(FormField $field) - { - $segments = $this->getSegments($field->getName()); - - $target =& $this->fields; - while ($segments) { - if (!is_array($target)) { - $target = array(); - } - $path = array_shift($segments); - if ('' === $path) { - $target =& $target[]; - } else { - $target =& $target[$path]; - } - } - $target = $field; - } - - /** - * Removes a field and its children from the registry. - * - * @param string $name The fully qualified name of the base field - * - * @throws \InvalidArgumentException when the name is malformed - */ - public function remove($name) - { - $segments = $this->getSegments($name); - $target =& $this->fields; - while (count($segments) > 1) { - $path = array_shift($segments); - if (!array_key_exists($path, $target)) { - return; - } - $target =& $target[$path]; - } - unset($target[array_shift($segments)]); - } - - /** - * Returns the value of the field and its children. - * - * @param string $name The fully qualified name of the field - * - * @return mixed The value of the field - * - * @throws \InvalidArgumentException when the name is malformed - * @throws \InvalidArgumentException if the field does not exist - */ - public function &get($name) - { - $segments = $this->getSegments($name); - $target =& $this->fields; - while ($segments) { - $path = array_shift($segments); - if (!array_key_exists($path, $target)) { - throw new \InvalidArgumentException(sprintf('Unreachable field "%s"', $path)); - } - $target =& $target[$path]; - } - - return $target; - } - - /** - * Tests whether the form has the given field. - * - * @param string $name The fully qualified name of the field - * - * @return Boolean Whether the form has the given field - */ - public function has($name) - { - try { - $this->get($name); - - return true; - } catch (\InvalidArgumentException $e) { - return false; - } - } - - /** - * Set the value of a field and its children. - * - * @param string $name The fully qualified name of the field - * @param mixed $value The value - * - * @throws \InvalidArgumentException when the name is malformed - * @throws \InvalidArgumentException if the field does not exist - */ - public function set($name, $value) - { - $target =& $this->get($name); - if (is_array($value)) { - $fields = self::create($name, $value); - foreach ($fields->all() as $k => $v) { - $this->set($k, $v); - } - } else { - $target->setValue($value); - } - } - - /** - * Returns the list of field with their value. - * - * @return array The list of fields as array((string) Fully qualified name => (mixed) value) - */ - public function all() - { - return $this->walk($this->fields, $this->base); - } - - /** - * Creates an instance of the class. - * - * This function is made private because it allows overriding the $base and - * the $values properties without any type checking. - * - * @param string $base The fully qualified name of the base field - * @param array $values The values of the fields - * - * @return FormFieldRegistry - */ - private static function create($base, array $values) - { - $registry = new static(); - $registry->base = $base; - $registry->fields = $values; - - return $registry; - } - - /** - * Transforms a PHP array in a list of fully qualified name / value. - * - * @param array $array The PHP array - * @param string $base The name of the base field - * @param array $output The initial values - * - * @return array The list of fields as array((string) Fully qualified name => (mixed) value) - */ - private function walk(array $array, $base = '', array &$output = array()) - { - foreach ($array as $k => $v) { - $path = empty($base) ? $k : sprintf("%s[%s]", $base, $k); - if (is_array($v)) { - $this->walk($v, $path, $output); - } else { - $output[$path] = $v; - } - } - - return $output; - } - - /** - * Splits a field name into segments as a web browser would do. - * - * - * getSegments('base[foo][3][]') = array('base', 'foo, '3', ''); - * - * - * @param string $name The name of the field - * - * @return array The list of segments - * - * @throws \InvalidArgumentException when the name is malformed - */ - private function getSegments($name) - { - if (preg_match('/^(?P[^[]+)(?P(\[.*)|$)/', $name, $m)) { - $segments = array($m['base']); - while (preg_match('/^\[(?P.*?)\](?P.*)$/', $m['extra'], $m)) { - $segments[] = $m['segment']; - } - - return $segments; - } - - throw new \InvalidArgumentException(sprintf('Malformed field path "%s"', $name)); - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/LICENSE b/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/LICENSE deleted file mode 100644 index cdffe7a..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2012 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Link.php b/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Link.php deleted file mode 100644 index 1804111..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Link.php +++ /dev/null @@ -1,157 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DomCrawler; - -/** - * Link represents an HTML link (an HTML a tag). - * - * @author Fabien Potencier - * - * @api - */ -class Link -{ - /** - * @var \DOMNode A \DOMNode instance - */ - protected $node; - /** - * @var string The method to use for the link - */ - protected $method; - /** - * @var string The URI of the page where the link is embedded (or the base href) - */ - protected $currentUri; - - /** - * Constructor. - * - * @param \DOMNode $node A \DOMNode instance - * @param string $currentUri The URI of the page where the link is embedded (or the base href) - * @param string $method The method to use for the link (get by default) - * - * @throws \InvalidArgumentException if the node is not a link - * - * @api - */ - public function __construct(\DOMNode $node, $currentUri, $method = 'GET') - { - if (!in_array(substr($currentUri, 0, 4), array('http', 'file'))) { - throw new \InvalidArgumentException(sprintf('Current URI must be an absolute URL ("%s").', $currentUri)); - } - - $this->setNode($node); - $this->method = $method ? strtoupper($method) : null; - $this->currentUri = $currentUri; - } - - /** - * Gets the node associated with this link. - * - * @return \DOMNode A \DOMNode instance - */ - public function getNode() - { - return $this->node; - } - - /** - * Gets the method associated with this link. - * - * @return string The method - * - * @api - */ - public function getMethod() - { - return $this->method; - } - - /** - * Gets the URI associated with this link. - * - * @return string The URI - * - * @api - */ - public function getUri() - { - $uri = trim($this->getRawUri()); - - // absolute URL? - if (0 === strpos($uri, 'http')) { - return $uri; - } - - // empty URI - if (!$uri) { - return $this->currentUri; - } - - // only an anchor - if ('#' === $uri[0]) { - $baseUri = $this->currentUri; - if (false !== $pos = strpos($baseUri, '#')) { - $baseUri = substr($baseUri, 0, $pos); - } - - return $baseUri.$uri; - } - - // only a query string - if ('?' === $uri[0]) { - $baseUri = $this->currentUri; - - // remove the query string from the current uri - if (false !== $pos = strpos($baseUri, '?')) { - $baseUri = substr($baseUri, 0, $pos); - } - - return $baseUri.$uri; - } - - // absolute path - if ('/' === $uri[0]) { - return preg_replace('#^(.*?//[^/]+)(?:\/.*)?$#', '$1', $this->currentUri).$uri; - } - - // relative path - return substr($this->currentUri, 0, strrpos($this->currentUri, '/') + 1).$uri; - } - - /** - * Returns raw uri data - * - * @return string - */ - protected function getRawUri() - { - return $this->node->getAttribute('href'); - } - - /** - * Sets current \DOMNode instance - * - * @param \DOMNode $node A \DOMNode instance - * - * @throws \LogicException If given node is not an anchor - */ - protected function setNode(\DOMNode $node) - { - if ('a' != $node->nodeName) { - throw new \LogicException(sprintf('Unable to click on a "%s" tag.', $node->nodeName)); - } - - $this->node = $node; - } -} diff --git a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/README.md b/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/README.md deleted file mode 100644 index b383b51..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/README.md +++ /dev/null @@ -1,35 +0,0 @@ -DomCrawler Component -==================== - -DomCrawler eases DOM navigation for HTML and XML documents. - -If you are familiar with jQuery, DomCrawler is a PHP equivalent: - - use Symfony\Component\DomCrawler\Crawler; - - $crawler = new Crawler(); - $crawler->addContent('

    Hello World!

    '); - - print $crawler->filterXPath('descendant-or-self::body/p')->text(); - -If you are also using the CssSelector component, you can use CSS Selectors -instead of XPath expressions: - - use Symfony\Component\DomCrawler\Crawler; - - $crawler = new Crawler(); - $crawler->addContent('

    Hello World!

    '); - - print $crawler->filter('body > p')->text(); - -Resources ---------- - -You can run the unit tests with the following command: - - phpunit - -If you also want to run the unit tests that depend on other Symfony -Components, install dev dependencies before running PHPUnit: - - php composer.phar install --dev diff --git a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php b/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php deleted file mode 100644 index 8ccab61..0000000 --- a/vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php +++ /dev/null @@ -1,595 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DomCrawler\Tests; - -use Symfony\Component\DomCrawler\Crawler; - -class CrawlerTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $crawler = new Crawler(); - $this->assertCount(0, $crawler, '__construct() returns an empty crawler'); - - $crawler = new Crawler(new \DOMNode()); - $this->assertCount(1, $crawler, '__construct() takes a node as a first argument'); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::add - */ - public function testAdd() - { - $crawler = new Crawler(); - $crawler->add($this->createDomDocument()); - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->add() adds nodes from a \DOMDocument'); - - $crawler = new Crawler(); - $crawler->add($this->createNodeList()); - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->add() adds nodes from a \DOMNodeList'); - - foreach ($this->createNodeList() as $node) { - $list[] = $node; - } - $crawler = new Crawler(); - $crawler->add($list); - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->add() adds nodes from an array of nodes'); - - $crawler = new Crawler(); - $crawler->add($this->createNodeList()->item(0)); - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->add() adds nodes from an \DOMNode'); - - $crawler = new Crawler(); - $crawler->add('Foo'); - $this->assertEquals('Foo', $crawler->filterXPath('//body')->text(), '->add() adds nodes from a string'); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addHtmlContent - */ - public function testAddHtmlContent() - { - $crawler = new Crawler(); - $crawler->addHtmlContent('
    ', 'UTF-8'); - - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addHtmlContent() adds nodes from an HTML string'); - - $crawler->addHtmlContent('', 'UTF-8'); - - $this->assertEquals('http://symfony.com', $crawler->filterXPath('//base')->attr('href'), '->addHtmlContent() adds nodes from an HTML string'); - $this->assertEquals('http://symfony.com/contact', $crawler->filterXPath('//a')->link()->getUri(), '->addHtmlContent() adds nodes from an HTML string'); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addHtmlContent - */ - public function testAddHtmlContentCharset() - { - $crawler = new Crawler(); - $crawler->addHtmlContent('
    Tiếng Việt', 'UTF-8'); - - $this->assertEquals('Tiếng Việt', $crawler->filterXPath('//div')->text()); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addHtmlContent - */ - public function testAddHtmlContentWithErrors() - { - libxml_use_internal_errors(true); - - $crawler = new Crawler(); - $crawler->addHtmlContent(<< - - - - - - - -EOF - , 'UTF-8'); - - $errors = libxml_get_errors(); - $this->assertCount(1, $errors); - $this->assertEquals("Tag nav invalid\n", $errors[0]->message); - - libxml_clear_errors(); - libxml_use_internal_errors(false); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addXmlContent - */ - public function testAddXmlContent() - { - $crawler = new Crawler(); - $crawler->addXmlContent('
    ', 'UTF-8'); - - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addXmlContent() adds nodes from an XML string'); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addXmlContent - */ - public function testAddXmlContentCharset() - { - $crawler = new Crawler(); - $crawler->addXmlContent('
    Tiếng Việt
    ', 'UTF-8'); - - $this->assertEquals('Tiếng Việt', $crawler->filterXPath('//div')->text()); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addXmlContent - */ - public function testAddXmlContentWithErrors() - { - libxml_use_internal_errors(true); - - $crawler = new Crawler(); - $crawler->addXmlContent(<< - - - - -
    - - -EOF - , 'UTF-8'); - - $this->assertTrue(count(libxml_get_errors()) > 1); - - libxml_clear_errors(); - libxml_use_internal_errors(false); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addContent - */ - public function testAddContent() - { - $crawler = new Crawler(); - $crawler->addContent('
    ', 'text/html; charset=UTF-8'); - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addContent() adds nodes from an HTML string'); - - $crawler = new Crawler(); - $crawler->addContent('
    ', 'text/html; charset=UTF-8; dir=RTL'); - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addContent() adds nodes from an HTML string with extended content type'); - - $crawler = new Crawler(); - $crawler->addContent('
    '); - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addContent() uses text/html as the default type'); - - $crawler = new Crawler(); - $crawler->addContent('
    ', 'text/xml; charset=UTF-8'); - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addContent() adds nodes from an XML string'); - - $crawler = new Crawler(); - $crawler->addContent('
    ', 'text/xml'); - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addContent() adds nodes from an XML string'); - - $crawler = new Crawler(); - $crawler->addContent('foo bar', 'text/plain'); - $this->assertCount(0, $crawler, '->addContent() does nothing if the type is not (x|ht)ml'); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addDocument - */ - public function testAddDocument() - { - $crawler = new Crawler(); - $crawler->addDocument($this->createDomDocument()); - - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addDocument() adds nodes from a \DOMDocument'); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addNodeList - */ - public function testAddNodeList() - { - $crawler = new Crawler(); - $crawler->addNodeList($this->createNodeList()); - - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addNodeList() adds nodes from a \DOMNodeList'); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addNodes - */ - public function testAddNodes() - { - foreach ($this->createNodeList() as $node) { - $list[] = $node; - } - - $crawler = new Crawler(); - $crawler->addNodes($list); - - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addNodes() adds nodes from an array of nodes'); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addNode - */ - public function testAddNode() - { - $crawler = new Crawler(); - $crawler->addNode($this->createNodeList()->item(0)); - - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addNode() adds nodes from an \DOMNode'); - } - - public function testClear() - { - $crawler = new Crawler(new \DOMNode()); - $crawler->clear(); - $this->assertCount(0, $crawler, '->clear() removes all the nodes from the crawler'); - } - - public function testEq() - { - $crawler = $this->createTestCrawler()->filterXPath('//li'); - $this->assertNotSame($crawler, $crawler->eq(0), '->eq() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->eq() returns a new instance of a crawler'); - - $this->assertEquals('Two', $crawler->eq(1)->text(), '->eq() returns the nth node of the list'); - $this->assertCount(0, $crawler->eq(100), '->eq() returns an empty crawler if the nth node does not exist'); - } - - public function testEach() - { - $data = $this->createTestCrawler()->filterXPath('//ul[1]/li')->each(function ($node, $i) { - return $i.'-'.$node->nodeValue; - }); - - $this->assertEquals(array('0-One', '1-Two', '2-Three'), $data, '->each() executes an anonymous function on each node of the list'); - } - - public function testReduce() - { - $crawler = $this->createTestCrawler()->filterXPath('//ul[1]/li'); - $nodes = $crawler->reduce(function ($node, $i) { - return $i == 1 ? false : true; - }); - $this->assertNotSame($nodes, $crawler, '->reduce() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $nodes, '->reduce() returns a new instance of a crawler'); - - $this->assertCount(2, $nodes, '->reduce() filters the nodes in the list'); - } - - public function testAttr() - { - $this->assertEquals('first', $this->createTestCrawler()->filterXPath('//li')->attr('class'), '->attr() returns the attribute of the first element of the node list'); - - try { - $this->createTestCrawler()->filterXPath('//ol')->attr('class'); - $this->fail('->attr() throws an \InvalidArgumentException if the node list is empty'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->attr() throws an \InvalidArgumentException if the node list is empty'); - } - } - - public function testText() - { - $this->assertEquals('One', $this->createTestCrawler()->filterXPath('//li')->text(), '->text() returns the node value of the first element of the node list'); - - try { - $this->createTestCrawler()->filterXPath('//ol')->text(); - $this->fail('->text() throws an \InvalidArgumentException if the node list is empty'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->text() throws an \InvalidArgumentException if the node list is empty'); - } - } - - public function testExtract() - { - $crawler = $this->createTestCrawler()->filterXPath('//ul[1]/li'); - - $this->assertEquals(array('One', 'Two', 'Three'), $crawler->extract('_text'), '->extract() returns an array of extracted data from the node list'); - $this->assertEquals(array(array('One', 'first'), array('Two', ''), array('Three', '')), $crawler->extract(array('_text', 'class')), '->extract() returns an array of extracted data from the node list'); - - $this->assertEquals(array(), $this->createTestCrawler()->filterXPath('//ol')->extract('_text'), '->extract() returns an empty array if the node list is empty'); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::filterXPath - */ - public function testFilterXPath() - { - $crawler = $this->createTestCrawler(); - $this->assertNotSame($crawler, $crawler->filterXPath('//li'), '->filterXPath() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->filterXPath() returns a new instance of a crawler'); - - $crawler = $this->createTestCrawler()->filterXPath('//ul'); - - $this->assertCount(6, $crawler->filterXPath('//li'), '->filterXPath() filters the node list with the XPath expression'); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::filter - */ - public function testFilter() - { - if (!class_exists('Symfony\Component\CssSelector\CssSelector')) { - $this->markTestSkipped('The "CssSelector" component is not available'); - } - - $crawler = $this->createTestCrawler(); - $this->assertNotSame($crawler, $crawler->filter('li'), '->filter() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->filter() returns a new instance of a crawler'); - - $crawler = $this->createTestCrawler()->filter('ul'); - - $this->assertCount(6, $crawler->filter('li'), '->filter() filters the node list with the CSS selector'); - } - - public function testSelectLink() - { - $crawler = $this->createTestCrawler(); - $this->assertNotSame($crawler, $crawler->selectLink('Foo'), '->selectLink() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->selectLink() returns a new instance of a crawler'); - - $this->assertCount(1, $crawler->selectLink('Fabien\'s Foo'), '->selectLink() selects links by the node values'); - $this->assertCount(1, $crawler->selectLink('Fabien\'s Bar'), '->selectLink() selects links by the alt attribute of a clickable image'); - - $this->assertCount(2, $crawler->selectLink('Fabien"s Foo'), '->selectLink() selects links by the node values'); - $this->assertCount(2, $crawler->selectLink('Fabien"s Bar'), '->selectLink() selects links by the alt attribute of a clickable image'); - - $this->assertCount(1, $crawler->selectLink('\' Fabien"s Foo'), '->selectLink() selects links by the node values'); - $this->assertCount(1, $crawler->selectLink('\' Fabien"s Bar'), '->selectLink() selects links by the alt attribute of a clickable image'); - - $this->assertCount(4, $crawler->selectLink('Foo'), '->selectLink() selects links by the node values'); - $this->assertCount(4, $crawler->selectLink('Bar'), '->selectLink() selects links by the node values'); - } - - public function testSelectButton() - { - $crawler = $this->createTestCrawler(); - $this->assertNotSame($crawler, $crawler->selectButton('FooValue'), '->selectButton() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->selectButton() returns a new instance of a crawler'); - - $this->assertEquals(1, $crawler->selectButton('FooValue')->count(), '->selectButton() selects buttons'); - $this->assertEquals(1, $crawler->selectButton('FooName')->count(), '->selectButton() selects buttons'); - $this->assertEquals(1, $crawler->selectButton('FooId')->count(), '->selectButton() selects buttons'); - - $this->assertEquals(1, $crawler->selectButton('BarValue')->count(), '->selectButton() selects buttons'); - $this->assertEquals(1, $crawler->selectButton('BarName')->count(), '->selectButton() selects buttons'); - $this->assertEquals(1, $crawler->selectButton('BarId')->count(), '->selectButton() selects buttons'); - } - - public function testLink() - { - $crawler = $this->createTestCrawler('http://example.com/bar/')->selectLink('Foo'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Link', $crawler->link(), '->link() returns a Link instance'); - - $this->assertEquals('POST', $crawler->link('post')->getMethod(), '->link() takes a method as its argument'); - - $crawler = $this->createTestCrawler('http://example.com/bar')->selectLink('GetLink'); - $this->assertEquals('http://example.com/bar?get=param', $crawler->link()->getUri(), '->link() returns a Link instance'); - - try { - $this->createTestCrawler()->filterXPath('//ol')->link(); - $this->fail('->link() throws an \InvalidArgumentException if the node list is empty'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->link() throws an \InvalidArgumentException if the node list is empty'); - } - } - - public function testLinks() - { - $crawler = $this->createTestCrawler('http://example.com/bar/')->selectLink('Foo'); - $this->assertInternalType('array', $crawler->links(), '->links() returns an array'); - - $this->assertCount(4, $crawler->links(), '->links() returns an array'); - $links = $crawler->links(); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Link', $links[0], '->links() returns an array of Link instances'); - - $this->assertEquals(array(), $this->createTestCrawler()->filterXPath('//ol')->links(), '->links() returns an empty array if the node selection is empty'); - } - - public function testForm() - { - $crawler = $this->createTestCrawler('http://example.com/bar/')->selectButton('FooValue'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Form', $crawler->form(), '->form() returns a Form instance'); - - $this->assertEquals(array('FooName' => 'FooBar'), $crawler->form(array('FooName' => 'FooBar'))->getValues(), '->form() takes an array of values to submit as its first argument'); - - try { - $this->createTestCrawler()->filterXPath('//ol')->form(); - $this->fail('->form() throws an \InvalidArgumentException if the node list is empty'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->form() throws an \InvalidArgumentException if the node list is empty'); - } - } - - public function testLast() - { - $crawler = $this->createTestCrawler()->filterXPath('//ul[1]/li'); - $this->assertNotSame($crawler, $crawler->last(), '->last() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->last() returns a new instance of a crawler'); - - $this->assertEquals('Three', $crawler->last()->text()); - } - - public function testFirst() - { - $crawler = $this->createTestCrawler()->filterXPath('//li'); - $this->assertNotSame($crawler, $crawler->first(), '->first() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->first() returns a new instance of a crawler'); - - $this->assertEquals('One', $crawler->first()->text()); - } - - public function testSiblings() - { - $crawler = $this->createTestCrawler()->filterXPath('//li')->eq(1); - $this->assertNotSame($crawler, $crawler->siblings(), '->siblings() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->siblings() returns a new instance of a crawler'); - - $nodes = $crawler->siblings(); - $this->assertEquals(2, $nodes->count()); - $this->assertEquals('One', $nodes->eq(0)->text()); - $this->assertEquals('Three', $nodes->eq(1)->text()); - - $nodes = $this->createTestCrawler()->filterXPath('//li')->eq(0)->siblings(); - $this->assertEquals(2, $nodes->count()); - $this->assertEquals('Two', $nodes->eq(0)->text()); - $this->assertEquals('Three', $nodes->eq(1)->text()); - - try { - $this->createTestCrawler()->filterXPath('//ol')->siblings(); - $this->fail('->siblings() throws an \InvalidArgumentException if the node list is empty'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->siblings() throws an \InvalidArgumentException if the node list is empty'); - } - } - - public function testNextAll() - { - $crawler = $this->createTestCrawler()->filterXPath('//li')->eq(1); - $this->assertNotSame($crawler, $crawler->nextAll(), '->nextAll() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->nextAll() returns a new instance of a crawler'); - - $nodes = $crawler->nextAll(); - $this->assertEquals(1, $nodes->count()); - $this->assertEquals('Three', $nodes->eq(0)->text()); - - try { - $this->createTestCrawler()->filterXPath('//ol')->nextAll(); - $this->fail('->nextAll() throws an \InvalidArgumentException if the node list is empty'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->nextAll() throws an \InvalidArgumentException if the node list is empty'); - } - } - - public function testPreviousAll() - { - $crawler = $this->createTestCrawler()->filterXPath('//li')->eq(2); - $this->assertNotSame($crawler, $crawler->previousAll(), '->previousAll() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->previousAll() returns a new instance of a crawler'); - - $nodes = $crawler->previousAll(); - $this->assertEquals(2, $nodes->count()); - $this->assertEquals('Two', $nodes->eq(0)->text()); - - try { - $this->createTestCrawler()->filterXPath('//ol')->previousAll(); - $this->fail('->previousAll() throws an \InvalidArgumentException if the node list is empty'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->previousAll() throws an \InvalidArgumentException if the node list is empty'); - } - } - - public function testChildren() - { - $crawler = $this->createTestCrawler()->filterXPath('//ul'); - $this->assertNotSame($crawler, $crawler->children(), '->children() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->children() returns a new instance of a crawler'); - - $nodes = $crawler->children(); - $this->assertEquals(3, $nodes->count()); - $this->assertEquals('One', $nodes->eq(0)->text()); - $this->assertEquals('Two', $nodes->eq(1)->text()); - $this->assertEquals('Three', $nodes->eq(2)->text()); - - try { - $this->createTestCrawler()->filterXPath('//ol')->children(); - $this->fail('->children() throws an \InvalidArgumentException if the node list is empty'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->children() throws an \InvalidArgumentException if the node list is empty'); - } - } - - public function testParents() - { - $crawler = $this->createTestCrawler()->filterXPath('//li[1]'); - $this->assertNotSame($crawler, $crawler->parents(), '->parents() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->parents() returns a new instance of a crawler'); - - $nodes = $crawler->parents(); - $this->assertEquals(3, $nodes->count()); - - $nodes = $this->createTestCrawler()->filterXPath('//html')->parents(); - $this->assertEquals(0, $nodes->count()); - - try { - $this->createTestCrawler()->filterXPath('//ol')->parents(); - $this->fail('->parents() throws an \InvalidArgumentException if the node list is empty'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->parents() throws an \InvalidArgumentException if the node list is empty'); - } - } - - public function createTestCrawler($uri = null) - { - $dom = new \DOMDocument(); - $dom->loadHTML(' - - -
    Foo - Fabien\'s Foo - Fabien"s Foo - \' Fabien"s Foo - - Bar -    Fabien\'s Bar   - Fabien"s Bar - \' Fabien"s Bar - - GetLink - -
    - - -
    -
    - -
    -
    - -

    - SimpleTest 1.0.1 has been - - released. - This is the last PHP 4 compatible release. - From now on, compatibility extends from PHP 5.0.5+. -

    -
    -
    - -

    - Familiar with unit testing ? Just dive directly into SimpleTest with - the one-page starter and - the complete API. -
    - Otherwise see the ongoing - documentation. -
    - And for example test cases check out the - tutorial. -

    -
    -
    - -

    - Need help on your testing strategy ? - Feel free to join the - SimpleTest support mailing-list. -

    -

    - If you need some new functionnality in SimpleTest, you may want to look at - the features tracker. - Also the bug and - patches trackers can be useful. -

    -
    -
    - -

    - And if you feel like giving a hand, feel free to look around the - current TODO list... -

    -
    -
    - - SourceForge.net Logo - -
    -
    -
    -
    -

    - [2008/04/08] - - SimpleTest 1.0.1 is released. - The last release that supports PHP4.2 up to PHP5.3 inclusive. - Compared to the last stable release, the main significant change - is the switch to autorun. -

    -

    - The SimpleTest PHP unit tester - is available for download from your nearest - SourceForge. - It is a PHP unit test and web test framework. - Users of JUnit will be - familiar with most of the interface. - The JWebUnit - style functionality is more complete now. - It has support for SSL, forms, frames, proxies and basic authentication. - The idea is that common but fiddly PHP tasks, such as logging into a site, - can be tested easily. -

    -

    Screenshots

    -

    - Here's what the result of your first test would look like : -

    -

    - test with 1 pass -

    -

    - Well not quite. In true TDD fashion, you should see a failing test case : -

    -

    - test with 1 fail -

    -

    - You may also prefer doing your testing with the command-line : -

    -

    - test in cli -

    -

    Documentation

    -

    - While (still) very scattered around different sites, - the SimpleTest documentation is quite dense and thorough. -

    - -

    - Other type of interesting stuff while starting out - with Test Driven Development and SimpleTest include : -

    - -

    - A couple of books do use SimpleTest quite extensively : -

    - -

    Contributing

    -

    - For translators the documentation is available in XML format : - we're always please to add new languages to our code base. -

    -

    - And while we do try our best keeping this tool bug-free, detecting defects and - submitting failing test cases and/or patches can come very handy ! Interested ? - Drop by the mailing-list, - most things tend to happen there... -

    -
    -